From 9bfe8e78fac7cc7ddcee5855bcfec6f8e9d6f687 Mon Sep 17 00:00:00 2001 From: Michael Thomsen Date: Wed, 13 May 2020 16:08:12 +0200 Subject: [PATCH 001/276] [ffigen] Initial commit --- pkgs/ffigen/.gitignore | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 pkgs/ffigen/.gitignore diff --git a/pkgs/ffigen/.gitignore b/pkgs/ffigen/.gitignore new file mode 100644 index 0000000000..dbef116d22 --- /dev/null +++ b/pkgs/ffigen/.gitignore @@ -0,0 +1,21 @@ +# See https://www.dartlang.org/guides/libraries/private-files + +# Files and directories created by pub +.dart_tool/ +.packages +build/ +# If you're building an application, you may want to check-in your pubspec.lock +pubspec.lock + +# Directory created by dartdoc +# If you don't generate documentation locally you can remove this line. +doc/api/ + +# Avoid committing generated Javascript files: +*.dart.js +*.info.json # Produced by the --dump-info flag. +*.js # When generated by dart2js. Don't specify *.js if your + # project includes source files written in JavaScript. +*.js_ +*.js.deps +*.js.map From 50fc8c44775e8f723410ca462556e4c7ef8c2d0e Mon Sep 17 00:00:00 2001 From: Michael Thomsen Date: Wed, 13 May 2020 16:15:04 +0200 Subject: [PATCH 002/276] [ffigen] Initialize repo --- pkgs/ffigen/.travis.yml | 13 +++++++++++++ pkgs/ffigen/AUTHORS | 6 ++++++ pkgs/ffigen/LICENSE | 26 ++++++++++++++++++++++++++ pkgs/ffigen/README.md | 4 ++++ pkgs/ffigen/analysis_options.yaml | 1 + pkgs/ffigen/pubspec.yaml | 14 ++++++++++++++ 6 files changed, 64 insertions(+) create mode 100644 pkgs/ffigen/.travis.yml create mode 100644 pkgs/ffigen/AUTHORS create mode 100644 pkgs/ffigen/LICENSE create mode 100644 pkgs/ffigen/README.md create mode 100644 pkgs/ffigen/analysis_options.yaml create mode 100644 pkgs/ffigen/pubspec.yaml diff --git a/pkgs/ffigen/.travis.yml b/pkgs/ffigen/.travis.yml new file mode 100644 index 0000000000..6ec14e5902 --- /dev/null +++ b/pkgs/ffigen/.travis.yml @@ -0,0 +1,13 @@ +language: dart +dart: +- dev +# Only building master means that we don't run two builds for each pull request. +dart_task: +- test: --platform vm +- dartanalyzer +- dartfmt +branches: + only: [master] +cache: + directories: + - $HOME/.pub-cache diff --git a/pkgs/ffigen/AUTHORS b/pkgs/ffigen/AUTHORS new file mode 100644 index 0000000000..846e4a1568 --- /dev/null +++ b/pkgs/ffigen/AUTHORS @@ -0,0 +1,6 @@ +# Below is a list of people and organizations that have contributed +# to the Dart project. Names should be added to the list like so: +# +# Name/Organization + +Google LLC diff --git a/pkgs/ffigen/LICENSE b/pkgs/ffigen/LICENSE new file mode 100644 index 0000000000..18daf2b5bd --- /dev/null +++ b/pkgs/ffigen/LICENSE @@ -0,0 +1,26 @@ +Copyright 2020, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md new file mode 100644 index 0000000000..3c017879d1 --- /dev/null +++ b/pkgs/ffigen/README.md @@ -0,0 +1,4 @@ +[![Build Status](https://travis-ci.org/dart-lang/ffigen.svg?branch=master)](https://travis-ci.org/dart-lang/ffigen) + +Experimental generator for [FFI](https://dart.dev/guides/libraries/c-interop) +bindings. diff --git a/pkgs/ffigen/analysis_options.yaml b/pkgs/ffigen/analysis_options.yaml new file mode 100644 index 0000000000..108d1058ac --- /dev/null +++ b/pkgs/ffigen/analysis_options.yaml @@ -0,0 +1 @@ +include: package:pedantic/analysis_options.yaml diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml new file mode 100644 index 0000000000..80a756fe02 --- /dev/null +++ b/pkgs/ffigen/pubspec.yaml @@ -0,0 +1,14 @@ +name: ffigen +version: 0.0.1 +author: Dart Team +homepage: https://github.com/dart-lang/ffigen +description: Experimental generator for FFI bindings. + +environment: + sdk: '>=2.7.0 <3.0.0' + +dependencies: + +dev_dependencies: + pedantic: ^1.9.0 + test: ^1.14.3 From 8417b07ca97e45af8ef34a1cff24cf7bfb1c44f7 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Fri, 15 May 2020 06:28:01 -0700 Subject: [PATCH 003/276] [ffigen] Remove/fix references to dartlang.org (#1) and other cleanup to .gitignore --- pkgs/ffigen/.gitignore | 17 +---------------- pkgs/ffigen/pubspec.yaml | 3 +-- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/pkgs/ffigen/.gitignore b/pkgs/ffigen/.gitignore index dbef116d22..3d4ae48b50 100644 --- a/pkgs/ffigen/.gitignore +++ b/pkgs/ffigen/.gitignore @@ -1,21 +1,6 @@ -# See https://www.dartlang.org/guides/libraries/private-files +# See https://dart.dev/guides/libraries/private-files # Files and directories created by pub .dart_tool/ .packages -build/ -# If you're building an application, you may want to check-in your pubspec.lock pubspec.lock - -# Directory created by dartdoc -# If you don't generate documentation locally you can remove this line. -doc/api/ - -# Avoid committing generated Javascript files: -*.dart.js -*.info.json # Produced by the --dump-info flag. -*.js # When generated by dart2js. Don't specify *.js if your - # project includes source files written in JavaScript. -*.js_ -*.js.deps -*.js.map diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 80a756fe02..7711721dc4 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -1,13 +1,12 @@ name: ffigen version: 0.0.1 -author: Dart Team homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings. environment: sdk: '>=2.7.0 <3.0.0' -dependencies: +#dependencies: dev_dependencies: pedantic: ^1.9.0 From ff1ac4a175009f3d0a9994c64520a5617c13c846 Mon Sep 17 00:00:00 2001 From: Michael Thomsen Date: Mon, 22 Jun 2020 11:38:04 +0200 Subject: [PATCH 004/276] [ffigen] Update README.md (#9) --- pkgs/ffigen/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 3c017879d1..41a9d580de 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -1,4 +1,4 @@ [![Build Status](https://travis-ci.org/dart-lang/ffigen.svg?branch=master)](https://travis-ci.org/dart-lang/ffigen) -Experimental generator for [FFI](https://dart.dev/guides/libraries/c-interop) +Experimental binding generator for [FFI](https://dart.dev/guides/libraries/c-interop) bindings. From 39b1468ca8f61f89a123c5b5b9bf1bf3276ec0ce Mon Sep 17 00:00:00 2001 From: Prerak Mann <31154435+mannprerak2@users.noreply.github.com> Date: Thu, 25 Jun 2020 18:47:14 +0530 Subject: [PATCH 005/276] [ffigen] Initial generator: functions, structs, enums (#2) * migrated code from dart_ffi_bindings_generator repository Commits till now: Prerak Mann (6): init stagehand dart package template, minor changes Updated Project Structure, Readme Reading pubspec configuration via yaml package setup tool - libclang_binding_generator restructure code setup basic classes for code_generator * update readme: building steps * code_generation: added function generation for primitives * code_generator: added test for function * code_generation: added struct generation for primitives, added tests * code_generation: added pointer support for function and structure, added test * tool: added script for basic clang_binding generator * code_generator: added constant, global, C string support (ptr to utf8), added tests * code_generator: added typedefc, added test * tool: completed basic clang binding generation * update readme * simplify setup * added basic parser logic, fixed visitChildren_wrap function * copied clang_constants from libclang * header_parser: revamped api and code_structure * wrapper.c: added pointer conversion utility, updated bindings * header_parser: basic parser completed - updated code_generator's Func, Struct, Typedef to not use const, as it makes list unmodifiable - added example from previous prototype * header_parser: updated exception handling - print stack trace of dart functions called via C * cleanup * Handled Disposing of pointers - Updated dartdocs on clang_binding functions - Added dispose methods in cx.. ..cursor,..type, ..string - Updated parser code to handle disposing * Added input_checker, passing compilerOpts to clang * fix nullpointer error on compilerOpts list * config_provider: added filtering for functions - added new libclang example - moved old example to example/simple * updated lib-clang example to work with clang not in include path, restructured filters * Multiple Changes - Added sort method in code_generator library - Sorted generated clang_bindings - Added typedef declaration visitor for extracting typestring of typedef parameters - Added new methods to wrapper.c for getting type declarations * created a temporary logging solution * added typedef struct parser * cleanup * restructured parsing * restructured code * header_parser: added struct parser, minor changes - added type_extracter, moved typedeclaration_visitor into it - cleanup imports * parser: fixed type extraction * updated libclang-example, minor fix for record_type spelling * code_generator: added EnumClass, added test * header_parser: added enum parsing * header_parser: added typedef enums * header_parser: extracted doxygen comment - added clang_Cursor_getBriefCommentText_wrap in libclang bindings - added comment extraction for functions, enums, structs * Added args parsing and logging - option for alternate yaml config - added verbosity levels:[ all, fine, info, warning, severe ] * config_provider: added output file option * tests: added native_function_test * code_generator: breaking change - updated internal handling of type - added support for NativeFunction type needed for creating typedefC - updated tests, tool - updated header_parser/type_extractor * Added support for function pointers in bindings - example/libclang-example: added clang_visitChildren_wrap method - clang_bindings: added new methods getNumArgType, getArgType * header_parser: changes, complete libclang_example - completed libclang_example, all structs starting with CX all functions starting with clang_ except those passing/returning structs b value - added automatic typenaming to unnamed typedefs, unnamed function paramters * minor changes - code_generator: added factory Type constructor - updated tests and code to prefer using factory type constructors - added location methods to bindings * header_parser: added support for multiple headers, header-filters * header_parser: add structs used by functions - updated example/libclang to auto add IndexerCallback struct as its used in a function - structs are now added automatically if they are returned or passed in to a function (if struct type is parsed by extractor it automatically adds it) * config_provider: added sizemap for char, ints * tests: added simple tests for functions - test with supported types - added automatic argument naming for functions in code_gen if they are null or only whitspaces - code_gen_tests: only create debug file on test failure * config_provider: added sort option to config - updated libclang-example to use this - renamed generated file names - renamed package name for example * example: added new cJSON example, bug fix - new cJSON example, parsing a json and comparing it to json parsed by dart:convert - bug fix: shouldInclude.* functions not adding to seen Set in includer * linter bug fix, updated code for warnings * minor changes - documentation updates - code_gen: wrong binding string type in metadata fix * logging: improved log comments * code_generator: removed global constants file - lib prefixes are passed via writer now * improved tests, minor changes - improved header_parser_test - updated named constructors of code_generator: Type * header_parser: struct fields parsed - all structs fields are excluded, if any field is struct by value or array - added 2 functions using tool to clang bindings for parsing array element name, number - updated libclang example - added Broadtype.Array for code_gen (only used as indicator of type rn to exclude from parsing) * parser: extract type from supported typdef - Added config 'use-supported-typedefs' - support for intptr_t - updated test: native_function_bindings, added intptr_t * header_parser: added workaround for array in struct - updated libclang example * fix: exclude array of struct in struct * config_provider: revamped internal API Reason: Multiple seperate things were added whenever a config spec was added to the tool regarding- 1. validate yaml, detect unknown keys 2. tracking default value 3. extracting from map 4. Warning user if config is required and isnt provided All this is now being managed at one place, A map of Spec is provided using the getSpecs function, Spec has everything listed above Adding a configuration is simply adding a Spec to the map returned by getSpecs in config.dart * Removed generated binding's dependency on package:ffi - updated examples, tests - changed Char_S type to Int8 (previously Utf8) * temp: adding cmake * WIP: cmakefile * fix: loading dylib for other platforms - updated validator, extractor - updated examples - config: changed libclang-dylib to libclang-dylib-folder * Added build script for windows: tool/wrapped_libclang/build_dylib_windows * Windows Testing - Added build scripts(.bat files) for building dll for examples/tests - Updated exmaple's input header globs to work on Windows (Globs on windows dont work if they start with "." or".." - Used path package instead * added warn about removing functions, minor changes * config_provider: minor changes - sizemap, enum, comments - Added enum to sizemap - warn unknown subkeys in sizemap - config option to disable dartdoc comment extraction * fixed tests, minor changes * Added warning for TU diagnostic errors * header_parser: handling unimplemented types - Added a BroadType.unimplemented, which can be used to determine and remove types - Removing functions and struct members if unimplemented types are used (and show warning) (earlier exception was thrown) - Added a flag to remove function with constant array passed as parameter * update readme, comments * update readme(s), linked todos to github issues * added copyright notice to code files, update readme(s) * Self hosting the tool: added libclang_config.yaml - Removed clang_constants.dart file, all bindings are now in clang_bindings.dart - Added build_dylib_macos script * Replace platform based build scripts with build.dart * Improved comments in accordance with styleguide * config_provider: refactoring * Added 3 lint rules - prefer_final_fields - prefer_final_locals - prefer_final_in_for_each * config_provider: made libclang_dylib_folder optional User now has an option to provide a seperate folder containing the dynamic library The default is to use the dynamic libraries in the tool/wrapped_libclang folder * header_parser: removed file extension checks User can provide any file path or glob matcher. If clang can't parse a header, we print a severe log and skip that header * minor changes * Updated warnings/error logs * Minor changes - Added test/native_function_test/build_test_dylib.dart - Updated comments - Added top level third_party folder - Updated examples, test with fixed comments * minor comment fix * Updated preamble message Preamble on generated files is now /// AUTO GENERATED FILE, DO NOT EDIT. /// /// Generated by `package:ffigen`. * Updated build.dart, build_test_dylib.dart, Minor changes - Added map of for storing default values for all platforms - Using Options instead of global variables * Minor changes * minor refactoring Co-authored-by: Daco Harkes --- pkgs/ffigen/.gitignore | 28 +- pkgs/ffigen/AUTHORS | 2 + pkgs/ffigen/CHANGELOG.md | 5 + pkgs/ffigen/README.md | 66 + pkgs/ffigen/analysis_options.yaml | 18 + pkgs/ffigen/bin/generate.dart | 176 + pkgs/ffigen/example/c_json/.gitignore | 11 + pkgs/ffigen/example/c_json/README.md | 25 + .../c_json/cjson_generated_bindings.dart | 1691 +++++++ pkgs/ffigen/example/c_json/example.json | 14 + pkgs/ffigen/example/c_json/main.dart | 98 + pkgs/ffigen/example/c_json/pubspec.yaml | 23 + .../example/libclang-example/.gitignore | 11 + .../libclang-example/generated_bindings.dart | 4405 +++++++++++++++++ .../example/libclang-example/pubspec.yaml | 63 + .../ffigen/example/libclang-example/readme.md | 11 + pkgs/ffigen/example/simple/.gitignore | 11 + pkgs/ffigen/example/simple/README.md | 10 + .../example/simple/generated_bindings.dart | 132 + pkgs/ffigen/example/simple/headers/example.h | 18 + pkgs/ffigen/example/simple/pubspec.yaml | 17 + pkgs/ffigen/lib/src/README.md | 41 + pkgs/ffigen/lib/src/code_generator.dart | 17 + .../lib/src/code_generator/binding.dart | 20 + .../src/code_generator/binding_string.dart | 27 + .../lib/src/code_generator/constant.dart | 53 + .../lib/src/code_generator/enum_class.dart | 69 + pkgs/ffigen/lib/src/code_generator/func.dart | 104 + .../ffigen/lib/src/code_generator/global.dart | 46 + .../lib/src/code_generator/library.dart | 83 + pkgs/ffigen/lib/src/code_generator/struc.dart | 194 + pkgs/ffigen/lib/src/code_generator/type.dart | 165 + .../lib/src/code_generator/typedef.dart | 54 + .../ffigen/lib/src/code_generator/writer.dart | 64 + pkgs/ffigen/lib/src/config_provider.dart | 8 + .../lib/src/config_provider/config.dart | 287 ++ .../lib/src/config_provider/filter.dart | 80 + .../lib/src/config_provider/spec_utils.dart | 241 + pkgs/ffigen/lib/src/header_parser.dart | 10 + .../clang_bindings/clang_bindings.dart | 1447 ++++++ pkgs/ffigen/lib/src/header_parser/data.dart | 9 + .../lib/src/header_parser/includer.dart | 95 + pkgs/ffigen/lib/src/header_parser/parser.dart | 96 + .../sub_parsers/enumdecl_parser.dart | 88 + .../sub_parsers/functiondecl_parser.dart | 113 + .../sub_parsers/structdecl_parser.dart | 129 + .../sub_parsers/typedefdecl_parser.dart | 71 + .../translation_unit_parser.dart | 80 + .../type_extractor/cxtypekindmap.dart | 43 + .../type_extractor/extractor.dart | 154 + pkgs/ffigen/lib/src/header_parser/utils.dart | 208 + pkgs/ffigen/lib/src/strings.dart | 66 + pkgs/ffigen/pubspec.yaml | 13 +- pkgs/ffigen/test/code_generator_test.dart | 646 +++ .../test/header_parser_tests/functions.h | 13 + .../header_parser_tests/functions_test.dart | 145 + .../build_test_dylib.dart | 130 + .../test/native_functions_test/config.yaml | 16 + .../native_functions_test/native_functions.c | 27 + .../native_functions.def | 16 + .../native_functions_bindings.dart | 226 + .../native_functions_test.dart | 61 + .../third_party/cjson_library/.gitignore | 17 + .../third_party/cjson_library/CMakeLists.txt | 11 + pkgs/ffigen/third_party/cjson_library/cJSON.c | 2998 +++++++++++ pkgs/ffigen/third_party/cjson_library/cJSON.h | 292 ++ pkgs/ffigen/tool/libclang_config.yaml | 76 + pkgs/ffigen/tool/wrapped_libclang/.gitignore | 12 + pkgs/ffigen/tool/wrapped_libclang/build.dart | 216 + pkgs/ffigen/tool/wrapped_libclang/wrapper.c | 274 + pkgs/ffigen/tool/wrapped_libclang/wrapper.def | 352 ++ 71 files changed, 16536 insertions(+), 2 deletions(-) create mode 100644 pkgs/ffigen/CHANGELOG.md create mode 100644 pkgs/ffigen/bin/generate.dart create mode 100644 pkgs/ffigen/example/c_json/.gitignore create mode 100644 pkgs/ffigen/example/c_json/README.md create mode 100644 pkgs/ffigen/example/c_json/cjson_generated_bindings.dart create mode 100644 pkgs/ffigen/example/c_json/example.json create mode 100644 pkgs/ffigen/example/c_json/main.dart create mode 100644 pkgs/ffigen/example/c_json/pubspec.yaml create mode 100644 pkgs/ffigen/example/libclang-example/.gitignore create mode 100644 pkgs/ffigen/example/libclang-example/generated_bindings.dart create mode 100644 pkgs/ffigen/example/libclang-example/pubspec.yaml create mode 100644 pkgs/ffigen/example/libclang-example/readme.md create mode 100644 pkgs/ffigen/example/simple/.gitignore create mode 100644 pkgs/ffigen/example/simple/README.md create mode 100644 pkgs/ffigen/example/simple/generated_bindings.dart create mode 100644 pkgs/ffigen/example/simple/headers/example.h create mode 100644 pkgs/ffigen/example/simple/pubspec.yaml create mode 100644 pkgs/ffigen/lib/src/README.md create mode 100644 pkgs/ffigen/lib/src/code_generator.dart create mode 100644 pkgs/ffigen/lib/src/code_generator/binding.dart create mode 100644 pkgs/ffigen/lib/src/code_generator/binding_string.dart create mode 100644 pkgs/ffigen/lib/src/code_generator/constant.dart create mode 100644 pkgs/ffigen/lib/src/code_generator/enum_class.dart create mode 100644 pkgs/ffigen/lib/src/code_generator/func.dart create mode 100644 pkgs/ffigen/lib/src/code_generator/global.dart create mode 100644 pkgs/ffigen/lib/src/code_generator/library.dart create mode 100644 pkgs/ffigen/lib/src/code_generator/struc.dart create mode 100644 pkgs/ffigen/lib/src/code_generator/type.dart create mode 100644 pkgs/ffigen/lib/src/code_generator/typedef.dart create mode 100644 pkgs/ffigen/lib/src/code_generator/writer.dart create mode 100644 pkgs/ffigen/lib/src/config_provider.dart create mode 100644 pkgs/ffigen/lib/src/config_provider/config.dart create mode 100644 pkgs/ffigen/lib/src/config_provider/filter.dart create mode 100644 pkgs/ffigen/lib/src/config_provider/spec_utils.dart create mode 100644 pkgs/ffigen/lib/src/header_parser.dart create mode 100644 pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart create mode 100644 pkgs/ffigen/lib/src/header_parser/data.dart create mode 100644 pkgs/ffigen/lib/src/header_parser/includer.dart create mode 100644 pkgs/ffigen/lib/src/header_parser/parser.dart create mode 100644 pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart create mode 100644 pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart create mode 100644 pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart create mode 100644 pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart create mode 100644 pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart create mode 100644 pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart create mode 100644 pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart create mode 100644 pkgs/ffigen/lib/src/header_parser/utils.dart create mode 100644 pkgs/ffigen/lib/src/strings.dart create mode 100644 pkgs/ffigen/test/code_generator_test.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/functions.h create mode 100644 pkgs/ffigen/test/header_parser_tests/functions_test.dart create mode 100644 pkgs/ffigen/test/native_functions_test/build_test_dylib.dart create mode 100644 pkgs/ffigen/test/native_functions_test/config.yaml create mode 100644 pkgs/ffigen/test/native_functions_test/native_functions.c create mode 100644 pkgs/ffigen/test/native_functions_test/native_functions.def create mode 100644 pkgs/ffigen/test/native_functions_test/native_functions_bindings.dart create mode 100644 pkgs/ffigen/test/native_functions_test/native_functions_test.dart create mode 100644 pkgs/ffigen/third_party/cjson_library/.gitignore create mode 100644 pkgs/ffigen/third_party/cjson_library/CMakeLists.txt create mode 100644 pkgs/ffigen/third_party/cjson_library/cJSON.c create mode 100644 pkgs/ffigen/third_party/cjson_library/cJSON.h create mode 100644 pkgs/ffigen/tool/libclang_config.yaml create mode 100644 pkgs/ffigen/tool/wrapped_libclang/.gitignore create mode 100644 pkgs/ffigen/tool/wrapped_libclang/build.dart create mode 100644 pkgs/ffigen/tool/wrapped_libclang/wrapper.c create mode 100644 pkgs/ffigen/tool/wrapped_libclang/wrapper.def diff --git a/pkgs/ffigen/.gitignore b/pkgs/ffigen/.gitignore index 3d4ae48b50..57990d8c7c 100644 --- a/pkgs/ffigen/.gitignore +++ b/pkgs/ffigen/.gitignore @@ -1,6 +1,32 @@ # See https://dart.dev/guides/libraries/private-files -# Files and directories created by pub +# Files and directories created by pub. .dart_tool/ .packages pubspec.lock + +# Directory created by dartdoc. +# If you don't generate documentation locally you can remove this line. +doc/api/ + +# Avoid committing generated Javascript files: +*.dart.js +*.info.json # Produced by the --dump-info flag. +*.js # When generated by dart2js. Don't specify *.js if your + # project includes source files written in JavaScript. +*.js_ +*.js.deps +*.js.map + +# Generated shared libraries. +*.so +*.so.* +*.dylib +*.dll + +# Directory for quick experiments. +experiments/ + +# Files generated by tests for debugging purposes. +test/debug_generated/* +!test/debug_generated/readme.md diff --git a/pkgs/ffigen/AUTHORS b/pkgs/ffigen/AUTHORS index 846e4a1568..4f334e852a 100644 --- a/pkgs/ffigen/AUTHORS +++ b/pkgs/ffigen/AUTHORS @@ -4,3 +4,5 @@ # Name/Organization Google LLC + +Prerak Mann diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md new file mode 100644 index 0000000000..8fcd296854 --- /dev/null +++ b/pkgs/ffigen/CHANGELOG.md @@ -0,0 +1,5 @@ +# 0.1.0 +- Initial release supporing binding generation for Functions, Structs, Enums. +- Glob support for specifying headers. +- HeaderFilter - Include/Exclude declarations from specific header files. +- Filters - Include/Exclude function, structs and enum declarations using Regexp or Name matching. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 41a9d580de..d85769b6b7 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -2,3 +2,69 @@ Experimental binding generator for [FFI](https://dart.dev/guides/libraries/c-interop) bindings. + +## Example + +For some header file _example.h_: +```C +int sum(int a, int b); +``` +Add configurations to Pubspec File: +```yaml +ffigen: + output: 'generated_bindings.dart' + headers: + - 'example.h' +``` +Output (_generated_bindings.dart_). +```dart +DynamicLibrary _dylib; + +/// Initialises dynamic library +void init(DynamicLibrary dylib) { + _dylib = dylib; +} + +int sum(int a,int b) { + return _sum(a,b); +} + +final _dart_sum _sum = _dylib.lookupFunction<_c_sum, _dart_sum>('sum'); + +typedef _c_sum = Int32 Function(Int32 a,Int32 b); + +typedef _dart_sum = int Function(int a,int b); +``` +## Using this package +- clone/download this repository. +- Build it (see [building](#building)). +- Add this package as dev_dependency in your `pubspec.yaml`. +- Configurations must be provided in the pubspec.yaml file under the key `ffigen` (or directly under a seperate yaml file which when u specify it passing `--config filename` when running the tool) +- Run the tool- `pub run ffigen:generate`. + +## Building +A dynamic library for a wrapper to libclang needs to be generated as it is used by the parser submodule. + +#### ubuntu/linux +1. Install libclangdev - `sudo apt-get install libclang-dev`. +2. `cd tool/wrapped_libclang`, then run `dart build.dart`. + +#### Windows +1. Install Visual Studio with C++ development support. +2. Install LLVM. +3. `cd tool\wrapped_libclang`, then run `dart build.dart`. + +#### MacOS +1. Install LLVM. +2. `cd tool/wrapped_libclang`, then run `dart build.dart`. + +## Trying out examples +1. `cd examples/`, Run `pub get`. +2. Run `pub run ffigen:generate`. + +## Running Tests +Dynamic library for some tests need to be built before running the examples. +1. `cd test/native_functions_test`. +2. Run `dart build_test_dylib.dart`. + +Run tests from the root of the package with `pub run test`. diff --git a/pkgs/ffigen/analysis_options.yaml b/pkgs/ffigen/analysis_options.yaml index 108d1058ac..fb0e867893 100644 --- a/pkgs/ffigen/analysis_options.yaml +++ b/pkgs/ffigen/analysis_options.yaml @@ -1 +1,19 @@ +# Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + include: package:pedantic/analysis_options.yaml + +analyzer: + strong-mode: + implicit-casts: false + implicit-dynamic: false + errors: + omit_local_variable_types: ignore + +linter: + rules: + - directives_ordering + - prefer_final_fields + - prefer_final_locals + - prefer_final_in_for_each diff --git a/pkgs/ffigen/bin/generate.dart b/pkgs/ffigen/bin/generate.dart new file mode 100644 index 0000000000..7f29f2a736 --- /dev/null +++ b/pkgs/ffigen/bin/generate.dart @@ -0,0 +1,176 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Executable script to generate bindings for some C library. +import 'dart:io'; + +import 'package:args/args.dart'; +import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:logging/logging.dart'; +import 'package:yaml/yaml.dart' as yaml; + +var _logger = Logger('generate.dart'); + +void main(List args) { + // Parses the cmd args. + final result = getArgResults(args); + + // Setup logging level and printing. + setupLogger(result); + + // Create a config object. + final config = getConfig(result); + + // Parse the bindings according to config object provided. + final library = parser.parse(config); + + if (config.sort) { + library.sort(); + } + + // Generate file for the parsed bindings. + final gen = File(config.output); + library.generateFile(gen); + _logger.info('Finished, Bindings generated in ${gen?.absolute?.path}'); +} + +Config getConfig(ArgResults result) { + _logger.info('Running in ${Directory.current}'); + + if (result.wasParsed('config')) { + return getConfigFromCustomYaml(result['config'] as String); + } else { + return getConfigFromPubspec(); + } +} + +/// Extracts configuration from pubspec file. +Config getConfigFromPubspec() { + final pubspecName = 'pubspec.yaml'; + final configKey = 'ffigen'; + + final pubspecFile = File(pubspecName); + + if (!pubspecFile.existsSync()) { + _logger.severe( + 'Error: $pubspecName not found, please run this tool from the root of your package.'); + exit(1); + } + + // Casting this because pubspec is expected to be a YamlMap. + + // Throws a [YamlException] if it's unable to parse the Yaml. + final bindingsConfigMap = + yaml.loadYaml(pubspecFile.readAsStringSync())[configKey] as yaml.YamlMap; + + if (bindingsConfigMap == null) { + _logger.severe("Couldn't find an entry for '$configKey' in $pubspecName."); + exit(1); + } + return Config.fromYaml(bindingsConfigMap); +} + +/// Extracts configuration from a custom yaml file. +Config getConfigFromCustomYaml(String yamlPath) { + final yamlFile = File(yamlPath); + + if (!yamlFile.existsSync()) { + _logger.severe('Error: $yamlPath not found.'); + exit(1); + } + + // Throws a [YamlException] if it's unable to parse the Yaml. + final bindingsConfigMap = + yaml.loadYaml(yamlFile.readAsStringSync()) as yaml.YamlMap; + + return Config.fromYaml(bindingsConfigMap); +} + +/// Parses the cmd line arguments. +ArgResults getArgResults(List args) { + final parser = ArgParser(allowTrailingOptions: true); + + parser.addSeparator( + 'FFIGEN: Generate dart bindings from C header files\nUsage:'); + parser.addOption( + 'config', + help: 'path to Yaml file containing configurations if not in pubspec.yaml', + ); + parser.addOption( + 'verbose', + abbr: 'v', + defaultsTo: 'info', + allowed: [ + 'all', + 'fine', + 'info', + 'warning', + 'severe', + ], + ); + parser.addFlag( + 'help', + abbr: 'h', + help: 'prints this usage', + negatable: false, + ); + + ArgResults results; + try { + results = parser.parse(args); + + if (results.wasParsed('help')) { + print(parser.usage); + exit(0); + } + } catch (e) { + print(e); + print(parser.usage); + exit(1); + } + + return results; +} + +/// Sets up the logging level and printing. +void setupLogger(ArgResults result) { + if (result.wasParsed('verbose')) { + switch (result['verbose'] as String) { + case 'all': + // Logs everything, the entire AST touched by our parser. + Logger.root.level = Level.ALL; + break; + case 'fine': + // Logs AST parts relevant to user (i.e those included in filters). + Logger.root.level = Level.FINE; + break; + case 'info': + // Logs relevant info for general user (default). + Logger.root.level = Level.INFO; + break; + case 'warning': + // Logs warnings for relevant stuff. + Logger.root.level = Level.WARNING; + break; + case 'severe': + // Logs severe warnings and errors. + Logger.root.level = Level.SEVERE; + break; + } + // Setup logger for printing (if verbosity was set by user). + Logger.root.onRecord.listen((record) { + print('${record.level.name.padRight(8)}: ${record.message}'); + }); + } else { + // Setup logger for printing (if verbosity was not set by user). + Logger.root.onRecord.listen((record) { + if (record.level.value > Level.INFO.value) { + print(' ${record.level.name.padRight(8)}: ${record.message}'); + } else { + print(record.message); + } + }); + } +} diff --git a/pkgs/ffigen/example/c_json/.gitignore b/pkgs/ffigen/example/c_json/.gitignore new file mode 100644 index 0000000000..1b05164275 --- /dev/null +++ b/pkgs/ffigen/example/c_json/.gitignore @@ -0,0 +1,11 @@ +# Files and directories created by pub. +.dart_tool/ +.packages +# Remove the following pattern if you wish to check in your lock file. +pubspec.lock + +# Conventional directory for build outputs. +build/ + +# Directory created by dartdoc. +doc/api/ diff --git a/pkgs/ffigen/example/c_json/README.md b/pkgs/ffigen/example/c_json/README.md new file mode 100644 index 0000000000..9ba9d43625 --- /dev/null +++ b/pkgs/ffigen/example/c_json/README.md @@ -0,0 +1,25 @@ +# cJson example + +Demonstrates generation of bindings for a C library called +[cJson](https://github.com/DaveGamble/cJSON) and then using these bindings +to parse some json. + +## Building the cJson dynamic library +From the root of this repository - +``` +cd third_party/cjson_library +cmake . +make +``` + +## Generating bindings +At the root of this example (`example/c_json`), run - +``` +pub run ffigen:generate +``` +This will generate bindings in a file: [cjson_generated_bindings.dart](./cjson_generated_bindings.dart) + +## Running the example +``` +dart main.dart +``` diff --git a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart new file mode 100644 index 0000000000..1cf00a3d90 --- /dev/null +++ b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart @@ -0,0 +1,1691 @@ +/// AUTO GENERATED FILE, DO NOT EDIT. +/// +/// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Holds the Dynamic library. +ffi.DynamicLibrary _dylib; + +/// Initialises the Dynamic library. +void init(ffi.DynamicLibrary dylib) { + _dylib = dylib; +} + +class cJSON extends ffi.Struct { + ffi.Pointer next; + + ffi.Pointer prev; + + ffi.Pointer child; + + @ffi.Int32() + int type; + + ffi.Pointer valuestring; + + @ffi.Int32() + int valueint; + + @ffi.Double() + double valuedouble; + + ffi.Pointer string; +} + +typedef _typedefC_noname_1 = ffi.Pointer Function( + ffi.Uint64, +); + +typedef _typedefC_noname_2 = ffi.Void Function( + ffi.Pointer, +); + +class cJSON_Hooks extends ffi.Struct { + ffi.Pointer> malloc_fn; + + ffi.Pointer> free_fn; +} + +ffi.Pointer cJSON_Version() { + return _cJSON_Version(); +} + +final _dart_cJSON_Version _cJSON_Version = _dylib + .lookupFunction<_c_cJSON_Version, _dart_cJSON_Version>('cJSON_Version'); + +typedef _c_cJSON_Version = ffi.Pointer Function(); + +typedef _dart_cJSON_Version = ffi.Pointer Function(); + +void cJSON_InitHooks( + ffi.Pointer hooks, +) { + return _cJSON_InitHooks( + hooks, + ); +} + +final _dart_cJSON_InitHooks _cJSON_InitHooks = + _dylib.lookupFunction<_c_cJSON_InitHooks, _dart_cJSON_InitHooks>( + 'cJSON_InitHooks'); + +typedef _c_cJSON_InitHooks = ffi.Void Function( + ffi.Pointer hooks, +); + +typedef _dart_cJSON_InitHooks = void Function( + ffi.Pointer hooks, +); + +ffi.Pointer cJSON_Parse( + ffi.Pointer value, +) { + return _cJSON_Parse( + value, + ); +} + +final _dart_cJSON_Parse _cJSON_Parse = + _dylib.lookupFunction<_c_cJSON_Parse, _dart_cJSON_Parse>('cJSON_Parse'); + +typedef _c_cJSON_Parse = ffi.Pointer Function( + ffi.Pointer value, +); + +typedef _dart_cJSON_Parse = ffi.Pointer Function( + ffi.Pointer value, +); + +ffi.Pointer cJSON_ParseWithOpts( + ffi.Pointer value, + ffi.Pointer> return_parse_end, + int require_null_terminated, +) { + return _cJSON_ParseWithOpts( + value, + return_parse_end, + require_null_terminated, + ); +} + +final _dart_cJSON_ParseWithOpts _cJSON_ParseWithOpts = + _dylib.lookupFunction<_c_cJSON_ParseWithOpts, _dart_cJSON_ParseWithOpts>( + 'cJSON_ParseWithOpts'); + +typedef _c_cJSON_ParseWithOpts = ffi.Pointer Function( + ffi.Pointer value, + ffi.Pointer> return_parse_end, + ffi.Int32 require_null_terminated, +); + +typedef _dart_cJSON_ParseWithOpts = ffi.Pointer Function( + ffi.Pointer value, + ffi.Pointer> return_parse_end, + int require_null_terminated, +); + +ffi.Pointer cJSON_Print( + ffi.Pointer item, +) { + return _cJSON_Print( + item, + ); +} + +final _dart_cJSON_Print _cJSON_Print = + _dylib.lookupFunction<_c_cJSON_Print, _dart_cJSON_Print>('cJSON_Print'); + +typedef _c_cJSON_Print = ffi.Pointer Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_Print = ffi.Pointer Function( + ffi.Pointer item, +); + +ffi.Pointer cJSON_PrintUnformatted( + ffi.Pointer item, +) { + return _cJSON_PrintUnformatted( + item, + ); +} + +final _dart_cJSON_PrintUnformatted _cJSON_PrintUnformatted = _dylib + .lookupFunction<_c_cJSON_PrintUnformatted, _dart_cJSON_PrintUnformatted>( + 'cJSON_PrintUnformatted'); + +typedef _c_cJSON_PrintUnformatted = ffi.Pointer Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_PrintUnformatted = ffi.Pointer Function( + ffi.Pointer item, +); + +ffi.Pointer cJSON_PrintBuffered( + ffi.Pointer item, + int prebuffer, + int fmt, +) { + return _cJSON_PrintBuffered( + item, + prebuffer, + fmt, + ); +} + +final _dart_cJSON_PrintBuffered _cJSON_PrintBuffered = + _dylib.lookupFunction<_c_cJSON_PrintBuffered, _dart_cJSON_PrintBuffered>( + 'cJSON_PrintBuffered'); + +typedef _c_cJSON_PrintBuffered = ffi.Pointer Function( + ffi.Pointer item, + ffi.Int32 prebuffer, + ffi.Int32 fmt, +); + +typedef _dart_cJSON_PrintBuffered = ffi.Pointer Function( + ffi.Pointer item, + int prebuffer, + int fmt, +); + +int cJSON_PrintPreallocated( + ffi.Pointer item, + ffi.Pointer buffer, + int length, + int format, +) { + return _cJSON_PrintPreallocated( + item, + buffer, + length, + format, + ); +} + +final _dart_cJSON_PrintPreallocated _cJSON_PrintPreallocated = _dylib + .lookupFunction<_c_cJSON_PrintPreallocated, _dart_cJSON_PrintPreallocated>( + 'cJSON_PrintPreallocated'); + +typedef _c_cJSON_PrintPreallocated = ffi.Int32 Function( + ffi.Pointer item, + ffi.Pointer buffer, + ffi.Int32 length, + ffi.Int32 format, +); + +typedef _dart_cJSON_PrintPreallocated = int Function( + ffi.Pointer item, + ffi.Pointer buffer, + int length, + int format, +); + +void cJSON_Delete( + ffi.Pointer item, +) { + return _cJSON_Delete( + item, + ); +} + +final _dart_cJSON_Delete _cJSON_Delete = + _dylib.lookupFunction<_c_cJSON_Delete, _dart_cJSON_Delete>('cJSON_Delete'); + +typedef _c_cJSON_Delete = ffi.Void Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_Delete = void Function( + ffi.Pointer item, +); + +int cJSON_GetArraySize( + ffi.Pointer array, +) { + return _cJSON_GetArraySize( + array, + ); +} + +final _dart_cJSON_GetArraySize _cJSON_GetArraySize = + _dylib.lookupFunction<_c_cJSON_GetArraySize, _dart_cJSON_GetArraySize>( + 'cJSON_GetArraySize'); + +typedef _c_cJSON_GetArraySize = ffi.Int32 Function( + ffi.Pointer array, +); + +typedef _dart_cJSON_GetArraySize = int Function( + ffi.Pointer array, +); + +ffi.Pointer cJSON_GetArrayItem( + ffi.Pointer array, + int index, +) { + return _cJSON_GetArrayItem( + array, + index, + ); +} + +final _dart_cJSON_GetArrayItem _cJSON_GetArrayItem = + _dylib.lookupFunction<_c_cJSON_GetArrayItem, _dart_cJSON_GetArrayItem>( + 'cJSON_GetArrayItem'); + +typedef _c_cJSON_GetArrayItem = ffi.Pointer Function( + ffi.Pointer array, + ffi.Int32 index, +); + +typedef _dart_cJSON_GetArrayItem = ffi.Pointer Function( + ffi.Pointer array, + int index, +); + +ffi.Pointer cJSON_GetObjectItem( + ffi.Pointer object, + ffi.Pointer string, +) { + return _cJSON_GetObjectItem( + object, + string, + ); +} + +final _dart_cJSON_GetObjectItem _cJSON_GetObjectItem = + _dylib.lookupFunction<_c_cJSON_GetObjectItem, _dart_cJSON_GetObjectItem>( + 'cJSON_GetObjectItem'); + +typedef _c_cJSON_GetObjectItem = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer string, +); + +typedef _dart_cJSON_GetObjectItem = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer string, +); + +ffi.Pointer cJSON_GetObjectItemCaseSensitive( + ffi.Pointer object, + ffi.Pointer string, +) { + return _cJSON_GetObjectItemCaseSensitive( + object, + string, + ); +} + +final _dart_cJSON_GetObjectItemCaseSensitive _cJSON_GetObjectItemCaseSensitive = + _dylib.lookupFunction<_c_cJSON_GetObjectItemCaseSensitive, + _dart_cJSON_GetObjectItemCaseSensitive>( + 'cJSON_GetObjectItemCaseSensitive'); + +typedef _c_cJSON_GetObjectItemCaseSensitive = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer string, +); + +typedef _dart_cJSON_GetObjectItemCaseSensitive = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer string, +); + +int cJSON_HasObjectItem( + ffi.Pointer object, + ffi.Pointer string, +) { + return _cJSON_HasObjectItem( + object, + string, + ); +} + +final _dart_cJSON_HasObjectItem _cJSON_HasObjectItem = + _dylib.lookupFunction<_c_cJSON_HasObjectItem, _dart_cJSON_HasObjectItem>( + 'cJSON_HasObjectItem'); + +typedef _c_cJSON_HasObjectItem = ffi.Int32 Function( + ffi.Pointer object, + ffi.Pointer string, +); + +typedef _dart_cJSON_HasObjectItem = int Function( + ffi.Pointer object, + ffi.Pointer string, +); + +ffi.Pointer cJSON_GetErrorPtr() { + return _cJSON_GetErrorPtr(); +} + +final _dart_cJSON_GetErrorPtr _cJSON_GetErrorPtr = + _dylib.lookupFunction<_c_cJSON_GetErrorPtr, _dart_cJSON_GetErrorPtr>( + 'cJSON_GetErrorPtr'); + +typedef _c_cJSON_GetErrorPtr = ffi.Pointer Function(); + +typedef _dart_cJSON_GetErrorPtr = ffi.Pointer Function(); + +ffi.Pointer cJSON_GetStringValue( + ffi.Pointer item, +) { + return _cJSON_GetStringValue( + item, + ); +} + +final _dart_cJSON_GetStringValue _cJSON_GetStringValue = + _dylib.lookupFunction<_c_cJSON_GetStringValue, _dart_cJSON_GetStringValue>( + 'cJSON_GetStringValue'); + +typedef _c_cJSON_GetStringValue = ffi.Pointer Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_GetStringValue = ffi.Pointer Function( + ffi.Pointer item, +); + +int cJSON_IsInvalid( + ffi.Pointer item, +) { + return _cJSON_IsInvalid( + item, + ); +} + +final _dart_cJSON_IsInvalid _cJSON_IsInvalid = + _dylib.lookupFunction<_c_cJSON_IsInvalid, _dart_cJSON_IsInvalid>( + 'cJSON_IsInvalid'); + +typedef _c_cJSON_IsInvalid = ffi.Int32 Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_IsInvalid = int Function( + ffi.Pointer item, +); + +int cJSON_IsFalse( + ffi.Pointer item, +) { + return _cJSON_IsFalse( + item, + ); +} + +final _dart_cJSON_IsFalse _cJSON_IsFalse = _dylib + .lookupFunction<_c_cJSON_IsFalse, _dart_cJSON_IsFalse>('cJSON_IsFalse'); + +typedef _c_cJSON_IsFalse = ffi.Int32 Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_IsFalse = int Function( + ffi.Pointer item, +); + +int cJSON_IsTrue( + ffi.Pointer item, +) { + return _cJSON_IsTrue( + item, + ); +} + +final _dart_cJSON_IsTrue _cJSON_IsTrue = + _dylib.lookupFunction<_c_cJSON_IsTrue, _dart_cJSON_IsTrue>('cJSON_IsTrue'); + +typedef _c_cJSON_IsTrue = ffi.Int32 Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_IsTrue = int Function( + ffi.Pointer item, +); + +int cJSON_IsBool( + ffi.Pointer item, +) { + return _cJSON_IsBool( + item, + ); +} + +final _dart_cJSON_IsBool _cJSON_IsBool = + _dylib.lookupFunction<_c_cJSON_IsBool, _dart_cJSON_IsBool>('cJSON_IsBool'); + +typedef _c_cJSON_IsBool = ffi.Int32 Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_IsBool = int Function( + ffi.Pointer item, +); + +int cJSON_IsNull( + ffi.Pointer item, +) { + return _cJSON_IsNull( + item, + ); +} + +final _dart_cJSON_IsNull _cJSON_IsNull = + _dylib.lookupFunction<_c_cJSON_IsNull, _dart_cJSON_IsNull>('cJSON_IsNull'); + +typedef _c_cJSON_IsNull = ffi.Int32 Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_IsNull = int Function( + ffi.Pointer item, +); + +int cJSON_IsNumber( + ffi.Pointer item, +) { + return _cJSON_IsNumber( + item, + ); +} + +final _dart_cJSON_IsNumber _cJSON_IsNumber = _dylib + .lookupFunction<_c_cJSON_IsNumber, _dart_cJSON_IsNumber>('cJSON_IsNumber'); + +typedef _c_cJSON_IsNumber = ffi.Int32 Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_IsNumber = int Function( + ffi.Pointer item, +); + +int cJSON_IsString( + ffi.Pointer item, +) { + return _cJSON_IsString( + item, + ); +} + +final _dart_cJSON_IsString _cJSON_IsString = _dylib + .lookupFunction<_c_cJSON_IsString, _dart_cJSON_IsString>('cJSON_IsString'); + +typedef _c_cJSON_IsString = ffi.Int32 Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_IsString = int Function( + ffi.Pointer item, +); + +int cJSON_IsArray( + ffi.Pointer item, +) { + return _cJSON_IsArray( + item, + ); +} + +final _dart_cJSON_IsArray _cJSON_IsArray = _dylib + .lookupFunction<_c_cJSON_IsArray, _dart_cJSON_IsArray>('cJSON_IsArray'); + +typedef _c_cJSON_IsArray = ffi.Int32 Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_IsArray = int Function( + ffi.Pointer item, +); + +int cJSON_IsObject( + ffi.Pointer item, +) { + return _cJSON_IsObject( + item, + ); +} + +final _dart_cJSON_IsObject _cJSON_IsObject = _dylib + .lookupFunction<_c_cJSON_IsObject, _dart_cJSON_IsObject>('cJSON_IsObject'); + +typedef _c_cJSON_IsObject = ffi.Int32 Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_IsObject = int Function( + ffi.Pointer item, +); + +int cJSON_IsRaw( + ffi.Pointer item, +) { + return _cJSON_IsRaw( + item, + ); +} + +final _dart_cJSON_IsRaw _cJSON_IsRaw = + _dylib.lookupFunction<_c_cJSON_IsRaw, _dart_cJSON_IsRaw>('cJSON_IsRaw'); + +typedef _c_cJSON_IsRaw = ffi.Int32 Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_IsRaw = int Function( + ffi.Pointer item, +); + +ffi.Pointer cJSON_CreateNull() { + return _cJSON_CreateNull(); +} + +final _dart_cJSON_CreateNull _cJSON_CreateNull = + _dylib.lookupFunction<_c_cJSON_CreateNull, _dart_cJSON_CreateNull>( + 'cJSON_CreateNull'); + +typedef _c_cJSON_CreateNull = ffi.Pointer Function(); + +typedef _dart_cJSON_CreateNull = ffi.Pointer Function(); + +ffi.Pointer cJSON_CreateTrue() { + return _cJSON_CreateTrue(); +} + +final _dart_cJSON_CreateTrue _cJSON_CreateTrue = + _dylib.lookupFunction<_c_cJSON_CreateTrue, _dart_cJSON_CreateTrue>( + 'cJSON_CreateTrue'); + +typedef _c_cJSON_CreateTrue = ffi.Pointer Function(); + +typedef _dart_cJSON_CreateTrue = ffi.Pointer Function(); + +ffi.Pointer cJSON_CreateFalse() { + return _cJSON_CreateFalse(); +} + +final _dart_cJSON_CreateFalse _cJSON_CreateFalse = + _dylib.lookupFunction<_c_cJSON_CreateFalse, _dart_cJSON_CreateFalse>( + 'cJSON_CreateFalse'); + +typedef _c_cJSON_CreateFalse = ffi.Pointer Function(); + +typedef _dart_cJSON_CreateFalse = ffi.Pointer Function(); + +ffi.Pointer cJSON_CreateBool( + int boolean, +) { + return _cJSON_CreateBool( + boolean, + ); +} + +final _dart_cJSON_CreateBool _cJSON_CreateBool = + _dylib.lookupFunction<_c_cJSON_CreateBool, _dart_cJSON_CreateBool>( + 'cJSON_CreateBool'); + +typedef _c_cJSON_CreateBool = ffi.Pointer Function( + ffi.Int32 boolean, +); + +typedef _dart_cJSON_CreateBool = ffi.Pointer Function( + int boolean, +); + +ffi.Pointer cJSON_CreateNumber( + double num, +) { + return _cJSON_CreateNumber( + num, + ); +} + +final _dart_cJSON_CreateNumber _cJSON_CreateNumber = + _dylib.lookupFunction<_c_cJSON_CreateNumber, _dart_cJSON_CreateNumber>( + 'cJSON_CreateNumber'); + +typedef _c_cJSON_CreateNumber = ffi.Pointer Function( + ffi.Double num, +); + +typedef _dart_cJSON_CreateNumber = ffi.Pointer Function( + double num, +); + +ffi.Pointer cJSON_CreateString( + ffi.Pointer string, +) { + return _cJSON_CreateString( + string, + ); +} + +final _dart_cJSON_CreateString _cJSON_CreateString = + _dylib.lookupFunction<_c_cJSON_CreateString, _dart_cJSON_CreateString>( + 'cJSON_CreateString'); + +typedef _c_cJSON_CreateString = ffi.Pointer Function( + ffi.Pointer string, +); + +typedef _dart_cJSON_CreateString = ffi.Pointer Function( + ffi.Pointer string, +); + +ffi.Pointer cJSON_CreateRaw( + ffi.Pointer raw, +) { + return _cJSON_CreateRaw( + raw, + ); +} + +final _dart_cJSON_CreateRaw _cJSON_CreateRaw = + _dylib.lookupFunction<_c_cJSON_CreateRaw, _dart_cJSON_CreateRaw>( + 'cJSON_CreateRaw'); + +typedef _c_cJSON_CreateRaw = ffi.Pointer Function( + ffi.Pointer raw, +); + +typedef _dart_cJSON_CreateRaw = ffi.Pointer Function( + ffi.Pointer raw, +); + +ffi.Pointer cJSON_CreateArray() { + return _cJSON_CreateArray(); +} + +final _dart_cJSON_CreateArray _cJSON_CreateArray = + _dylib.lookupFunction<_c_cJSON_CreateArray, _dart_cJSON_CreateArray>( + 'cJSON_CreateArray'); + +typedef _c_cJSON_CreateArray = ffi.Pointer Function(); + +typedef _dart_cJSON_CreateArray = ffi.Pointer Function(); + +ffi.Pointer cJSON_CreateObject() { + return _cJSON_CreateObject(); +} + +final _dart_cJSON_CreateObject _cJSON_CreateObject = + _dylib.lookupFunction<_c_cJSON_CreateObject, _dart_cJSON_CreateObject>( + 'cJSON_CreateObject'); + +typedef _c_cJSON_CreateObject = ffi.Pointer Function(); + +typedef _dart_cJSON_CreateObject = ffi.Pointer Function(); + +ffi.Pointer cJSON_CreateStringReference( + ffi.Pointer string, +) { + return _cJSON_CreateStringReference( + string, + ); +} + +final _dart_cJSON_CreateStringReference _cJSON_CreateStringReference = + _dylib.lookupFunction<_c_cJSON_CreateStringReference, + _dart_cJSON_CreateStringReference>('cJSON_CreateStringReference'); + +typedef _c_cJSON_CreateStringReference = ffi.Pointer Function( + ffi.Pointer string, +); + +typedef _dart_cJSON_CreateStringReference = ffi.Pointer Function( + ffi.Pointer string, +); + +ffi.Pointer cJSON_CreateObjectReference( + ffi.Pointer child, +) { + return _cJSON_CreateObjectReference( + child, + ); +} + +final _dart_cJSON_CreateObjectReference _cJSON_CreateObjectReference = + _dylib.lookupFunction<_c_cJSON_CreateObjectReference, + _dart_cJSON_CreateObjectReference>('cJSON_CreateObjectReference'); + +typedef _c_cJSON_CreateObjectReference = ffi.Pointer Function( + ffi.Pointer child, +); + +typedef _dart_cJSON_CreateObjectReference = ffi.Pointer Function( + ffi.Pointer child, +); + +ffi.Pointer cJSON_CreateArrayReference( + ffi.Pointer child, +) { + return _cJSON_CreateArrayReference( + child, + ); +} + +final _dart_cJSON_CreateArrayReference _cJSON_CreateArrayReference = + _dylib.lookupFunction<_c_cJSON_CreateArrayReference, + _dart_cJSON_CreateArrayReference>('cJSON_CreateArrayReference'); + +typedef _c_cJSON_CreateArrayReference = ffi.Pointer Function( + ffi.Pointer child, +); + +typedef _dart_cJSON_CreateArrayReference = ffi.Pointer Function( + ffi.Pointer child, +); + +ffi.Pointer cJSON_CreateIntArray( + ffi.Pointer numbers, + int count, +) { + return _cJSON_CreateIntArray( + numbers, + count, + ); +} + +final _dart_cJSON_CreateIntArray _cJSON_CreateIntArray = + _dylib.lookupFunction<_c_cJSON_CreateIntArray, _dart_cJSON_CreateIntArray>( + 'cJSON_CreateIntArray'); + +typedef _c_cJSON_CreateIntArray = ffi.Pointer Function( + ffi.Pointer numbers, + ffi.Int32 count, +); + +typedef _dart_cJSON_CreateIntArray = ffi.Pointer Function( + ffi.Pointer numbers, + int count, +); + +ffi.Pointer cJSON_CreateFloatArray( + ffi.Pointer numbers, + int count, +) { + return _cJSON_CreateFloatArray( + numbers, + count, + ); +} + +final _dart_cJSON_CreateFloatArray _cJSON_CreateFloatArray = _dylib + .lookupFunction<_c_cJSON_CreateFloatArray, _dart_cJSON_CreateFloatArray>( + 'cJSON_CreateFloatArray'); + +typedef _c_cJSON_CreateFloatArray = ffi.Pointer Function( + ffi.Pointer numbers, + ffi.Int32 count, +); + +typedef _dart_cJSON_CreateFloatArray = ffi.Pointer Function( + ffi.Pointer numbers, + int count, +); + +ffi.Pointer cJSON_CreateDoubleArray( + ffi.Pointer numbers, + int count, +) { + return _cJSON_CreateDoubleArray( + numbers, + count, + ); +} + +final _dart_cJSON_CreateDoubleArray _cJSON_CreateDoubleArray = _dylib + .lookupFunction<_c_cJSON_CreateDoubleArray, _dart_cJSON_CreateDoubleArray>( + 'cJSON_CreateDoubleArray'); + +typedef _c_cJSON_CreateDoubleArray = ffi.Pointer Function( + ffi.Pointer numbers, + ffi.Int32 count, +); + +typedef _dart_cJSON_CreateDoubleArray = ffi.Pointer Function( + ffi.Pointer numbers, + int count, +); + +ffi.Pointer cJSON_CreateStringArray( + ffi.Pointer> strings, + int count, +) { + return _cJSON_CreateStringArray( + strings, + count, + ); +} + +final _dart_cJSON_CreateStringArray _cJSON_CreateStringArray = _dylib + .lookupFunction<_c_cJSON_CreateStringArray, _dart_cJSON_CreateStringArray>( + 'cJSON_CreateStringArray'); + +typedef _c_cJSON_CreateStringArray = ffi.Pointer Function( + ffi.Pointer> strings, + ffi.Int32 count, +); + +typedef _dart_cJSON_CreateStringArray = ffi.Pointer Function( + ffi.Pointer> strings, + int count, +); + +void cJSON_AddItemToArray( + ffi.Pointer array, + ffi.Pointer item, +) { + return _cJSON_AddItemToArray( + array, + item, + ); +} + +final _dart_cJSON_AddItemToArray _cJSON_AddItemToArray = + _dylib.lookupFunction<_c_cJSON_AddItemToArray, _dart_cJSON_AddItemToArray>( + 'cJSON_AddItemToArray'); + +typedef _c_cJSON_AddItemToArray = ffi.Void Function( + ffi.Pointer array, + ffi.Pointer item, +); + +typedef _dart_cJSON_AddItemToArray = void Function( + ffi.Pointer array, + ffi.Pointer item, +); + +void cJSON_AddItemToObject( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer item, +) { + return _cJSON_AddItemToObject( + object, + string, + item, + ); +} + +final _dart_cJSON_AddItemToObject _cJSON_AddItemToObject = _dylib + .lookupFunction<_c_cJSON_AddItemToObject, _dart_cJSON_AddItemToObject>( + 'cJSON_AddItemToObject'); + +typedef _c_cJSON_AddItemToObject = ffi.Void Function( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer item, +); + +typedef _dart_cJSON_AddItemToObject = void Function( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer item, +); + +void cJSON_AddItemToObjectCS( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer item, +) { + return _cJSON_AddItemToObjectCS( + object, + string, + item, + ); +} + +final _dart_cJSON_AddItemToObjectCS _cJSON_AddItemToObjectCS = _dylib + .lookupFunction<_c_cJSON_AddItemToObjectCS, _dart_cJSON_AddItemToObjectCS>( + 'cJSON_AddItemToObjectCS'); + +typedef _c_cJSON_AddItemToObjectCS = ffi.Void Function( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer item, +); + +typedef _dart_cJSON_AddItemToObjectCS = void Function( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer item, +); + +void cJSON_AddItemReferenceToArray( + ffi.Pointer array, + ffi.Pointer item, +) { + return _cJSON_AddItemReferenceToArray( + array, + item, + ); +} + +final _dart_cJSON_AddItemReferenceToArray _cJSON_AddItemReferenceToArray = + _dylib.lookupFunction<_c_cJSON_AddItemReferenceToArray, + _dart_cJSON_AddItemReferenceToArray>('cJSON_AddItemReferenceToArray'); + +typedef _c_cJSON_AddItemReferenceToArray = ffi.Void Function( + ffi.Pointer array, + ffi.Pointer item, +); + +typedef _dart_cJSON_AddItemReferenceToArray = void Function( + ffi.Pointer array, + ffi.Pointer item, +); + +void cJSON_AddItemReferenceToObject( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer item, +) { + return _cJSON_AddItemReferenceToObject( + object, + string, + item, + ); +} + +final _dart_cJSON_AddItemReferenceToObject _cJSON_AddItemReferenceToObject = + _dylib.lookupFunction<_c_cJSON_AddItemReferenceToObject, + _dart_cJSON_AddItemReferenceToObject>('cJSON_AddItemReferenceToObject'); + +typedef _c_cJSON_AddItemReferenceToObject = ffi.Void Function( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer item, +); + +typedef _dart_cJSON_AddItemReferenceToObject = void Function( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer item, +); + +ffi.Pointer cJSON_DetachItemViaPointer( + ffi.Pointer parent, + ffi.Pointer item, +) { + return _cJSON_DetachItemViaPointer( + parent, + item, + ); +} + +final _dart_cJSON_DetachItemViaPointer _cJSON_DetachItemViaPointer = + _dylib.lookupFunction<_c_cJSON_DetachItemViaPointer, + _dart_cJSON_DetachItemViaPointer>('cJSON_DetachItemViaPointer'); + +typedef _c_cJSON_DetachItemViaPointer = ffi.Pointer Function( + ffi.Pointer parent, + ffi.Pointer item, +); + +typedef _dart_cJSON_DetachItemViaPointer = ffi.Pointer Function( + ffi.Pointer parent, + ffi.Pointer item, +); + +ffi.Pointer cJSON_DetachItemFromArray( + ffi.Pointer array, + int which, +) { + return _cJSON_DetachItemFromArray( + array, + which, + ); +} + +final _dart_cJSON_DetachItemFromArray _cJSON_DetachItemFromArray = + _dylib.lookupFunction<_c_cJSON_DetachItemFromArray, + _dart_cJSON_DetachItemFromArray>('cJSON_DetachItemFromArray'); + +typedef _c_cJSON_DetachItemFromArray = ffi.Pointer Function( + ffi.Pointer array, + ffi.Int32 which, +); + +typedef _dart_cJSON_DetachItemFromArray = ffi.Pointer Function( + ffi.Pointer array, + int which, +); + +void cJSON_DeleteItemFromArray( + ffi.Pointer array, + int which, +) { + return _cJSON_DeleteItemFromArray( + array, + which, + ); +} + +final _dart_cJSON_DeleteItemFromArray _cJSON_DeleteItemFromArray = + _dylib.lookupFunction<_c_cJSON_DeleteItemFromArray, + _dart_cJSON_DeleteItemFromArray>('cJSON_DeleteItemFromArray'); + +typedef _c_cJSON_DeleteItemFromArray = ffi.Void Function( + ffi.Pointer array, + ffi.Int32 which, +); + +typedef _dart_cJSON_DeleteItemFromArray = void Function( + ffi.Pointer array, + int which, +); + +ffi.Pointer cJSON_DetachItemFromObject( + ffi.Pointer object, + ffi.Pointer string, +) { + return _cJSON_DetachItemFromObject( + object, + string, + ); +} + +final _dart_cJSON_DetachItemFromObject _cJSON_DetachItemFromObject = + _dylib.lookupFunction<_c_cJSON_DetachItemFromObject, + _dart_cJSON_DetachItemFromObject>('cJSON_DetachItemFromObject'); + +typedef _c_cJSON_DetachItemFromObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer string, +); + +typedef _dart_cJSON_DetachItemFromObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer string, +); + +ffi.Pointer cJSON_DetachItemFromObjectCaseSensitive( + ffi.Pointer object, + ffi.Pointer string, +) { + return _cJSON_DetachItemFromObjectCaseSensitive( + object, + string, + ); +} + +final _dart_cJSON_DetachItemFromObjectCaseSensitive + _cJSON_DetachItemFromObjectCaseSensitive = _dylib.lookupFunction< + _c_cJSON_DetachItemFromObjectCaseSensitive, + _dart_cJSON_DetachItemFromObjectCaseSensitive>( + 'cJSON_DetachItemFromObjectCaseSensitive'); + +typedef _c_cJSON_DetachItemFromObjectCaseSensitive = ffi.Pointer + Function( + ffi.Pointer object, + ffi.Pointer string, +); + +typedef _dart_cJSON_DetachItemFromObjectCaseSensitive = ffi.Pointer + Function( + ffi.Pointer object, + ffi.Pointer string, +); + +void cJSON_DeleteItemFromObject( + ffi.Pointer object, + ffi.Pointer string, +) { + return _cJSON_DeleteItemFromObject( + object, + string, + ); +} + +final _dart_cJSON_DeleteItemFromObject _cJSON_DeleteItemFromObject = + _dylib.lookupFunction<_c_cJSON_DeleteItemFromObject, + _dart_cJSON_DeleteItemFromObject>('cJSON_DeleteItemFromObject'); + +typedef _c_cJSON_DeleteItemFromObject = ffi.Void Function( + ffi.Pointer object, + ffi.Pointer string, +); + +typedef _dart_cJSON_DeleteItemFromObject = void Function( + ffi.Pointer object, + ffi.Pointer string, +); + +void cJSON_DeleteItemFromObjectCaseSensitive( + ffi.Pointer object, + ffi.Pointer string, +) { + return _cJSON_DeleteItemFromObjectCaseSensitive( + object, + string, + ); +} + +final _dart_cJSON_DeleteItemFromObjectCaseSensitive + _cJSON_DeleteItemFromObjectCaseSensitive = _dylib.lookupFunction< + _c_cJSON_DeleteItemFromObjectCaseSensitive, + _dart_cJSON_DeleteItemFromObjectCaseSensitive>( + 'cJSON_DeleteItemFromObjectCaseSensitive'); + +typedef _c_cJSON_DeleteItemFromObjectCaseSensitive = ffi.Void Function( + ffi.Pointer object, + ffi.Pointer string, +); + +typedef _dart_cJSON_DeleteItemFromObjectCaseSensitive = void Function( + ffi.Pointer object, + ffi.Pointer string, +); + +void cJSON_InsertItemInArray( + ffi.Pointer array, + int which, + ffi.Pointer newitem, +) { + return _cJSON_InsertItemInArray( + array, + which, + newitem, + ); +} + +final _dart_cJSON_InsertItemInArray _cJSON_InsertItemInArray = _dylib + .lookupFunction<_c_cJSON_InsertItemInArray, _dart_cJSON_InsertItemInArray>( + 'cJSON_InsertItemInArray'); + +typedef _c_cJSON_InsertItemInArray = ffi.Void Function( + ffi.Pointer array, + ffi.Int32 which, + ffi.Pointer newitem, +); + +typedef _dart_cJSON_InsertItemInArray = void Function( + ffi.Pointer array, + int which, + ffi.Pointer newitem, +); + +int cJSON_ReplaceItemViaPointer( + ffi.Pointer parent, + ffi.Pointer item, + ffi.Pointer replacement, +) { + return _cJSON_ReplaceItemViaPointer( + parent, + item, + replacement, + ); +} + +final _dart_cJSON_ReplaceItemViaPointer _cJSON_ReplaceItemViaPointer = + _dylib.lookupFunction<_c_cJSON_ReplaceItemViaPointer, + _dart_cJSON_ReplaceItemViaPointer>('cJSON_ReplaceItemViaPointer'); + +typedef _c_cJSON_ReplaceItemViaPointer = ffi.Int32 Function( + ffi.Pointer parent, + ffi.Pointer item, + ffi.Pointer replacement, +); + +typedef _dart_cJSON_ReplaceItemViaPointer = int Function( + ffi.Pointer parent, + ffi.Pointer item, + ffi.Pointer replacement, +); + +void cJSON_ReplaceItemInArray( + ffi.Pointer array, + int which, + ffi.Pointer newitem, +) { + return _cJSON_ReplaceItemInArray( + array, + which, + newitem, + ); +} + +final _dart_cJSON_ReplaceItemInArray _cJSON_ReplaceItemInArray = + _dylib.lookupFunction<_c_cJSON_ReplaceItemInArray, + _dart_cJSON_ReplaceItemInArray>('cJSON_ReplaceItemInArray'); + +typedef _c_cJSON_ReplaceItemInArray = ffi.Void Function( + ffi.Pointer array, + ffi.Int32 which, + ffi.Pointer newitem, +); + +typedef _dart_cJSON_ReplaceItemInArray = void Function( + ffi.Pointer array, + int which, + ffi.Pointer newitem, +); + +void cJSON_ReplaceItemInObject( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer newitem, +) { + return _cJSON_ReplaceItemInObject( + object, + string, + newitem, + ); +} + +final _dart_cJSON_ReplaceItemInObject _cJSON_ReplaceItemInObject = + _dylib.lookupFunction<_c_cJSON_ReplaceItemInObject, + _dart_cJSON_ReplaceItemInObject>('cJSON_ReplaceItemInObject'); + +typedef _c_cJSON_ReplaceItemInObject = ffi.Void Function( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer newitem, +); + +typedef _dart_cJSON_ReplaceItemInObject = void Function( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer newitem, +); + +void cJSON_ReplaceItemInObjectCaseSensitive( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer newitem, +) { + return _cJSON_ReplaceItemInObjectCaseSensitive( + object, + string, + newitem, + ); +} + +final _dart_cJSON_ReplaceItemInObjectCaseSensitive + _cJSON_ReplaceItemInObjectCaseSensitive = _dylib.lookupFunction< + _c_cJSON_ReplaceItemInObjectCaseSensitive, + _dart_cJSON_ReplaceItemInObjectCaseSensitive>( + 'cJSON_ReplaceItemInObjectCaseSensitive'); + +typedef _c_cJSON_ReplaceItemInObjectCaseSensitive = ffi.Void Function( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer newitem, +); + +typedef _dart_cJSON_ReplaceItemInObjectCaseSensitive = void Function( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer newitem, +); + +ffi.Pointer cJSON_Duplicate( + ffi.Pointer item, + int recurse, +) { + return _cJSON_Duplicate( + item, + recurse, + ); +} + +final _dart_cJSON_Duplicate _cJSON_Duplicate = + _dylib.lookupFunction<_c_cJSON_Duplicate, _dart_cJSON_Duplicate>( + 'cJSON_Duplicate'); + +typedef _c_cJSON_Duplicate = ffi.Pointer Function( + ffi.Pointer item, + ffi.Int32 recurse, +); + +typedef _dart_cJSON_Duplicate = ffi.Pointer Function( + ffi.Pointer item, + int recurse, +); + +int cJSON_Compare( + ffi.Pointer a, + ffi.Pointer b, + int case_sensitive, +) { + return _cJSON_Compare( + a, + b, + case_sensitive, + ); +} + +final _dart_cJSON_Compare _cJSON_Compare = _dylib + .lookupFunction<_c_cJSON_Compare, _dart_cJSON_Compare>('cJSON_Compare'); + +typedef _c_cJSON_Compare = ffi.Int32 Function( + ffi.Pointer a, + ffi.Pointer b, + ffi.Int32 case_sensitive, +); + +typedef _dart_cJSON_Compare = int Function( + ffi.Pointer a, + ffi.Pointer b, + int case_sensitive, +); + +void cJSON_Minify( + ffi.Pointer json, +) { + return _cJSON_Minify( + json, + ); +} + +final _dart_cJSON_Minify _cJSON_Minify = + _dylib.lookupFunction<_c_cJSON_Minify, _dart_cJSON_Minify>('cJSON_Minify'); + +typedef _c_cJSON_Minify = ffi.Void Function( + ffi.Pointer json, +); + +typedef _dart_cJSON_Minify = void Function( + ffi.Pointer json, +); + +ffi.Pointer cJSON_AddNullToObject( + ffi.Pointer object, + ffi.Pointer name, +) { + return _cJSON_AddNullToObject( + object, + name, + ); +} + +final _dart_cJSON_AddNullToObject _cJSON_AddNullToObject = _dylib + .lookupFunction<_c_cJSON_AddNullToObject, _dart_cJSON_AddNullToObject>( + 'cJSON_AddNullToObject'); + +typedef _c_cJSON_AddNullToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, +); + +typedef _dart_cJSON_AddNullToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, +); + +ffi.Pointer cJSON_AddTrueToObject( + ffi.Pointer object, + ffi.Pointer name, +) { + return _cJSON_AddTrueToObject( + object, + name, + ); +} + +final _dart_cJSON_AddTrueToObject _cJSON_AddTrueToObject = _dylib + .lookupFunction<_c_cJSON_AddTrueToObject, _dart_cJSON_AddTrueToObject>( + 'cJSON_AddTrueToObject'); + +typedef _c_cJSON_AddTrueToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, +); + +typedef _dart_cJSON_AddTrueToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, +); + +ffi.Pointer cJSON_AddFalseToObject( + ffi.Pointer object, + ffi.Pointer name, +) { + return _cJSON_AddFalseToObject( + object, + name, + ); +} + +final _dart_cJSON_AddFalseToObject _cJSON_AddFalseToObject = _dylib + .lookupFunction<_c_cJSON_AddFalseToObject, _dart_cJSON_AddFalseToObject>( + 'cJSON_AddFalseToObject'); + +typedef _c_cJSON_AddFalseToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, +); + +typedef _dart_cJSON_AddFalseToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, +); + +ffi.Pointer cJSON_AddBoolToObject( + ffi.Pointer object, + ffi.Pointer name, + int boolean, +) { + return _cJSON_AddBoolToObject( + object, + name, + boolean, + ); +} + +final _dart_cJSON_AddBoolToObject _cJSON_AddBoolToObject = _dylib + .lookupFunction<_c_cJSON_AddBoolToObject, _dart_cJSON_AddBoolToObject>( + 'cJSON_AddBoolToObject'); + +typedef _c_cJSON_AddBoolToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, + ffi.Int32 boolean, +); + +typedef _dart_cJSON_AddBoolToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, + int boolean, +); + +ffi.Pointer cJSON_AddNumberToObject( + ffi.Pointer object, + ffi.Pointer name, + double number, +) { + return _cJSON_AddNumberToObject( + object, + name, + number, + ); +} + +final _dart_cJSON_AddNumberToObject _cJSON_AddNumberToObject = _dylib + .lookupFunction<_c_cJSON_AddNumberToObject, _dart_cJSON_AddNumberToObject>( + 'cJSON_AddNumberToObject'); + +typedef _c_cJSON_AddNumberToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, + ffi.Double number, +); + +typedef _dart_cJSON_AddNumberToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, + double number, +); + +ffi.Pointer cJSON_AddStringToObject( + ffi.Pointer object, + ffi.Pointer name, + ffi.Pointer string, +) { + return _cJSON_AddStringToObject( + object, + name, + string, + ); +} + +final _dart_cJSON_AddStringToObject _cJSON_AddStringToObject = _dylib + .lookupFunction<_c_cJSON_AddStringToObject, _dart_cJSON_AddStringToObject>( + 'cJSON_AddStringToObject'); + +typedef _c_cJSON_AddStringToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, + ffi.Pointer string, +); + +typedef _dart_cJSON_AddStringToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, + ffi.Pointer string, +); + +ffi.Pointer cJSON_AddRawToObject( + ffi.Pointer object, + ffi.Pointer name, + ffi.Pointer raw, +) { + return _cJSON_AddRawToObject( + object, + name, + raw, + ); +} + +final _dart_cJSON_AddRawToObject _cJSON_AddRawToObject = + _dylib.lookupFunction<_c_cJSON_AddRawToObject, _dart_cJSON_AddRawToObject>( + 'cJSON_AddRawToObject'); + +typedef _c_cJSON_AddRawToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, + ffi.Pointer raw, +); + +typedef _dart_cJSON_AddRawToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, + ffi.Pointer raw, +); + +ffi.Pointer cJSON_AddObjectToObject( + ffi.Pointer object, + ffi.Pointer name, +) { + return _cJSON_AddObjectToObject( + object, + name, + ); +} + +final _dart_cJSON_AddObjectToObject _cJSON_AddObjectToObject = _dylib + .lookupFunction<_c_cJSON_AddObjectToObject, _dart_cJSON_AddObjectToObject>( + 'cJSON_AddObjectToObject'); + +typedef _c_cJSON_AddObjectToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, +); + +typedef _dart_cJSON_AddObjectToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, +); + +ffi.Pointer cJSON_AddArrayToObject( + ffi.Pointer object, + ffi.Pointer name, +) { + return _cJSON_AddArrayToObject( + object, + name, + ); +} + +final _dart_cJSON_AddArrayToObject _cJSON_AddArrayToObject = _dylib + .lookupFunction<_c_cJSON_AddArrayToObject, _dart_cJSON_AddArrayToObject>( + 'cJSON_AddArrayToObject'); + +typedef _c_cJSON_AddArrayToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, +); + +typedef _dart_cJSON_AddArrayToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, +); + +double cJSON_SetNumberHelper( + ffi.Pointer object, + double number, +) { + return _cJSON_SetNumberHelper( + object, + number, + ); +} + +final _dart_cJSON_SetNumberHelper _cJSON_SetNumberHelper = _dylib + .lookupFunction<_c_cJSON_SetNumberHelper, _dart_cJSON_SetNumberHelper>( + 'cJSON_SetNumberHelper'); + +typedef _c_cJSON_SetNumberHelper = ffi.Double Function( + ffi.Pointer object, + ffi.Double number, +); + +typedef _dart_cJSON_SetNumberHelper = double Function( + ffi.Pointer object, + double number, +); + +ffi.Pointer cJSON_malloc( + int size, +) { + return _cJSON_malloc( + size, + ); +} + +final _dart_cJSON_malloc _cJSON_malloc = + _dylib.lookupFunction<_c_cJSON_malloc, _dart_cJSON_malloc>('cJSON_malloc'); + +typedef _c_cJSON_malloc = ffi.Pointer Function( + ffi.Uint64 size, +); + +typedef _dart_cJSON_malloc = ffi.Pointer Function( + int size, +); + +void cJSON_free( + ffi.Pointer object, +) { + return _cJSON_free( + object, + ); +} + +final _dart_cJSON_free _cJSON_free = + _dylib.lookupFunction<_c_cJSON_free, _dart_cJSON_free>('cJSON_free'); + +typedef _c_cJSON_free = ffi.Void Function( + ffi.Pointer object, +); + +typedef _dart_cJSON_free = void Function( + ffi.Pointer object, +); diff --git a/pkgs/ffigen/example/c_json/example.json b/pkgs/ffigen/example/c_json/example.json new file mode 100644 index 0000000000..073b05cbab --- /dev/null +++ b/pkgs/ffigen/example/c_json/example.json @@ -0,0 +1,14 @@ +{ + "name": "CoolGuy", + "age": 21, + "nicknames": [ + { + "name": "Mr. Cool", + "length": 8 + }, + { + "name": "Ice Cold", + "length": 8 + } + ] +} diff --git a/pkgs/ffigen/example/c_json/main.dart b/pkgs/ffigen/example/c_json/main.dart new file mode 100644 index 0000000000..22db183553 --- /dev/null +++ b/pkgs/ffigen/example/c_json/main.dart @@ -0,0 +1,98 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:convert'; +import 'dart:ffi'; +import 'dart:io'; + +import 'package:ffi/ffi.dart'; + +import 'cjson_generated_bindings.dart' as cjson; + +/// Using the generated C_JSON bindings. +void main() { + // Initialise cjson bindings. + cjson.init(DynamicLibrary.open(_getPath())); + + // Load json from [example.json] file. + final jsonString = File('./example.json').readAsStringSync(); + + // Parse this json string using our cJSON library. + final cjsonParsedJson = cjson.cJSON_Parse(Utf8.toUtf8(jsonString).cast()); + if (cjsonParsedJson == nullptr) { + print('Error parsing cjson.'); + exit(1); + } + // The json is now stored in some C data structure which we need + // to iterate and convert to a dart object (map/list). + + // Converting cjson object to a dart object. + final dynamic dartJson = convertCJsonToDartObj(cjsonParsedJson.cast()); + + // Delete the cjsonParsedJson object. + cjson.cJSON_Delete(cjsonParsedJson); + + // Check if the converted json is correct + // by comparing the result with json converted by `dart:convert`. + if (dartJson.toString() == json.decode(jsonString).toString()) { + print('Parsed Json: $dartJson'); + print('Json converted successfully'); + } else { + print("Converted json doesn't match\n"); + print('Actual:\n' + dartJson.toString() + '\n'); + print('Expected:\n' + json.decode(jsonString).toString()); + } +} + +String _getPath() { + var path = '../../third_party/cjson_library/libcjson.so'; + if (Platform.isMacOS) { + path = '../../third_party/cjson_library/libstructs.dylib'; + } + if (Platform.isWindows) { + path = r'..\..\third_party\cjson_library\Debug\structs.dll'; + } + return path; +} + +dynamic convertCJsonToDartObj(Pointer parsedcjson) { + dynamic obj; + if (cjson.cJSON_IsObject(parsedcjson.cast()) == 1) { + obj = {}; + + Pointer ptr; + ptr = parsedcjson.ref.child; + while (ptr != nullptr) { + final dynamic o = convertCJsonToDartObj(ptr); + _addToObj(obj, o, ptr.ref.string.cast()); + ptr = ptr.ref.next; + } + } else if (cjson.cJSON_IsArray(parsedcjson.cast()) == 1) { + obj = []; + + Pointer ptr; + ptr = parsedcjson.ref.child; + while (ptr != nullptr) { + final dynamic o = convertCJsonToDartObj(ptr); + _addToObj(obj, o); + ptr = ptr.ref.next; + } + } else if (cjson.cJSON_IsString(parsedcjson.cast()) == 1) { + obj = Utf8.fromUtf8(parsedcjson.ref.valuestring.cast()); + } else if (cjson.cJSON_IsNumber(parsedcjson.cast()) == 1) { + obj = parsedcjson.ref.valueint == parsedcjson.ref.valuedouble + ? parsedcjson.ref.valueint + : parsedcjson.ref.valuedouble; + } + + return obj; +} + +void _addToObj(dynamic obj, dynamic o, [Pointer name]) { + if (obj is Map) { + obj[Utf8.fromUtf8(name)] = o; + } else if (obj is List) { + obj.add(o); + } +} diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml new file mode 100644 index 0000000000..7e913b6e9d --- /dev/null +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -0,0 +1,23 @@ +# Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +name: c_json_example + +environment: + sdk: '>=2.8.1 <3.0.0' + +dependencies: + ffi: ^0.1.3 + +dev_dependencies: + ffigen: + path: '../../' + +ffigen: + output: 'cjson_generated_bindings.dart' + headers: + - '../../third_party/cjson_library/cJSON.h' + header-filter: + include: + - 'cJSON.h' diff --git a/pkgs/ffigen/example/libclang-example/.gitignore b/pkgs/ffigen/example/libclang-example/.gitignore new file mode 100644 index 0000000000..1b05164275 --- /dev/null +++ b/pkgs/ffigen/example/libclang-example/.gitignore @@ -0,0 +1,11 @@ +# Files and directories created by pub. +.dart_tool/ +.packages +# Remove the following pattern if you wish to check in your lock file. +pubspec.lock + +# Conventional directory for build outputs. +build/ + +# Directory created by dartdoc. +doc/api/ diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart new file mode 100644 index 0000000000..f68f632335 --- /dev/null +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -0,0 +1,4405 @@ +/// AUTO GENERATED FILE, DO NOT EDIT. +/// +/// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Holds the Dynamic library. +ffi.DynamicLibrary _dylib; + +/// Initialises the Dynamic library. +void init(ffi.DynamicLibrary dylib) { + _dylib = dylib; +} + +/// Contains the results of code-completion. +class CXCodeCompleteResults extends ffi.Struct { + ffi.Pointer Results; + + @ffi.Uint32() + int NumResults; +} + +/// A single result of code completion. +class CXCompletionResult extends ffi.Struct { + @ffi.Int32() + int CursorKind; + + ffi.Pointer CompletionString; +} + +/// A cursor representing some element in the abstract syntax tree for a translation unit. +class CXCursor extends ffi.Struct { + @ffi.Int32() + int kind; + + @ffi.Int32() + int xdata; + + ffi.Pointer _data_item_0; + ffi.Pointer _data_item_1; + ffi.Pointer _data_item_2; + + /// helper for array, supports `[]` operator + _ArrayHelper_CXCursor_data get data => _ArrayHelper_CXCursor_data(this, 3); +} + +/// Helper for array data in struct CXCursor +class _ArrayHelper_CXCursor_data { + final CXCursor _struct; + final int length; + _ArrayHelper_CXCursor_data(this._struct, this.length); + void operator []=(int index, ffi.Pointer value) { + switch (index) { + case 0: + _struct._data_item_0 = value; + break; + case 1: + _struct._data_item_1 = value; + break; + case 2: + _struct._data_item_2 = value; + break; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + ffi.Pointer operator [](int index) { + switch (index) { + case 0: + return _struct._data_item_0; + case 1: + return _struct._data_item_1; + case 2: + return _struct._data_item_2; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + @override + String toString() { + if (length == 0) return '[]'; + final sb = StringBuffer('['); + sb.write(this[0]); + for (var i = 1; i < length; i++) { + sb.write(','); + sb.write(this[i]); + } + sb.write(']'); + return sb.toString(); + } +} + +class CXCursorAndRangeVisitor extends ffi.Struct { + ffi.Pointer context; + + ffi.Pointer> visit; +} + +class CXCursorSetImpl extends ffi.Struct {} + +typedef CXCursorVisitor = ffi.Int32 Function( + CXCursor, + CXCursor, + ffi.Pointer, +); + +typedef CXFieldVisitor = ffi.Int32 Function( + CXCursor, + ffi.Pointer, +); + +/// Uniquely identifies a CXFile, that refers to the same underlying file, across an indexing session. +class CXFileUniqueID extends ffi.Struct { + @ffi.Uint64() + int _data_item_0; + @ffi.Uint64() + int _data_item_1; + @ffi.Uint64() + int _data_item_2; + + /// helper for array, supports `[]` operator + _ArrayHelper_CXFileUniqueID_data get data => + _ArrayHelper_CXFileUniqueID_data(this, 3); +} + +/// Helper for array data in struct CXFileUniqueID +class _ArrayHelper_CXFileUniqueID_data { + final CXFileUniqueID _struct; + final int length; + _ArrayHelper_CXFileUniqueID_data(this._struct, this.length); + void operator []=(int index, int value) { + switch (index) { + case 0: + _struct._data_item_0 = value; + break; + case 1: + _struct._data_item_1 = value; + break; + case 2: + _struct._data_item_2 = value; + break; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + int operator [](int index) { + switch (index) { + case 0: + return _struct._data_item_0; + case 1: + return _struct._data_item_1; + case 2: + return _struct._data_item_2; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + @override + String toString() { + if (length == 0) return '[]'; + final sb = StringBuffer('['); + sb.write(this[0]); + for (var i = 1; i < length; i++) { + sb.write(','); + sb.write(this[i]); + } + sb.write(']'); + return sb.toString(); + } +} + +class CXGlobalOptFlags { + static const int CXGlobalOpt_None = 0; + static const int CXGlobalOpt_ThreadBackgroundPriorityForIndexing = 1; + static const int CXGlobalOpt_ThreadBackgroundPriorityForEditing = 2; + static const int CXGlobalOpt_ThreadBackgroundPriorityForAll = 3; +} + +class CXIdxAttrInfo extends ffi.Struct {} + +class CXIdxBaseClassInfo extends ffi.Struct {} + +class CXIdxCXXClassDeclInfo extends ffi.Struct { + ffi.Pointer declInfo; + + ffi.Pointer> bases; + + @ffi.Uint32() + int numBases; +} + +class CXIdxContainerInfo extends ffi.Struct {} + +class CXIdxDeclInfo extends ffi.Struct {} + +class CXIdxEntityInfo extends ffi.Struct {} + +/// Data for IndexerCallbacks#indexEntityReference. +class CXIdxEntityRefInfo extends ffi.Struct {} + +class CXIdxIBOutletCollectionAttrInfo extends ffi.Struct {} + +/// Data for IndexerCallbacks#importedASTFile. +class CXIdxImportedASTFileInfo extends ffi.Struct {} + +/// Data for ppIncludedFile callback. +class CXIdxIncludedFileInfo extends ffi.Struct {} + +/// Source location passed to index callbacks. +class CXIdxLoc extends ffi.Struct { + ffi.Pointer _ptr_data_item_0; + ffi.Pointer _ptr_data_item_1; + ffi.Pointer _ptr_data_item_2; + + /// helper for array, supports `[]` operator + _ArrayHelper_CXIdxLoc_ptr_data get ptr_data => + _ArrayHelper_CXIdxLoc_ptr_data(this, 3); + @ffi.Uint32() + int int_data; +} + +/// Helper for array ptr_data in struct CXIdxLoc +class _ArrayHelper_CXIdxLoc_ptr_data { + final CXIdxLoc _struct; + final int length; + _ArrayHelper_CXIdxLoc_ptr_data(this._struct, this.length); + void operator []=(int index, ffi.Pointer value) { + switch (index) { + case 0: + _struct._ptr_data_item_0 = value; + break; + case 1: + _struct._ptr_data_item_1 = value; + break; + case 2: + _struct._ptr_data_item_2 = value; + break; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + ffi.Pointer operator [](int index) { + switch (index) { + case 0: + return _struct._ptr_data_item_0; + case 1: + return _struct._ptr_data_item_1; + case 2: + return _struct._ptr_data_item_2; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + @override + String toString() { + if (length == 0) return '[]'; + final sb = StringBuffer('['); + sb.write(this[0]); + for (var i = 1; i < length; i++) { + sb.write(','); + sb.write(this[i]); + } + sb.write(']'); + return sb.toString(); + } +} + +class CXIdxObjCCategoryDeclInfo extends ffi.Struct {} + +class CXIdxObjCContainerDeclInfo extends ffi.Struct { + ffi.Pointer declInfo; + + @ffi.Int32() + int kind; +} + +class CXIdxObjCInterfaceDeclInfo extends ffi.Struct { + ffi.Pointer containerInfo; + + ffi.Pointer superInfo; + + ffi.Pointer protocols; +} + +class CXIdxObjCPropertyDeclInfo extends ffi.Struct { + ffi.Pointer declInfo; + + ffi.Pointer getter; + + ffi.Pointer setter; +} + +class CXIdxObjCProtocolRefInfo extends ffi.Struct {} + +class CXIdxObjCProtocolRefListInfo extends ffi.Struct { + ffi.Pointer> protocols; + + @ffi.Uint32() + int numProtocols; +} + +typedef CXInclusionVisitor = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Uint32, + ffi.Pointer, +); + +/// 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 {} + +/// Identifies a specific source location within a translation unit. +class CXSourceLocation extends ffi.Struct { + ffi.Pointer _ptr_data_item_0; + ffi.Pointer _ptr_data_item_1; + ffi.Pointer _ptr_data_item_2; + + /// helper for array, supports `[]` operator + _ArrayHelper_CXSourceLocation_ptr_data get ptr_data => + _ArrayHelper_CXSourceLocation_ptr_data(this, 3); + @ffi.Uint32() + int int_data; +} + +/// Helper for array ptr_data in struct CXSourceLocation +class _ArrayHelper_CXSourceLocation_ptr_data { + final CXSourceLocation _struct; + final int length; + _ArrayHelper_CXSourceLocation_ptr_data(this._struct, this.length); + void operator []=(int index, ffi.Pointer value) { + switch (index) { + case 0: + _struct._ptr_data_item_0 = value; + break; + case 1: + _struct._ptr_data_item_1 = value; + break; + case 2: + _struct._ptr_data_item_2 = value; + break; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + ffi.Pointer operator [](int index) { + switch (index) { + case 0: + return _struct._ptr_data_item_0; + case 1: + return _struct._ptr_data_item_1; + case 2: + return _struct._ptr_data_item_2; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + @override + String toString() { + if (length == 0) return '[]'; + final sb = StringBuffer('['); + sb.write(this[0]); + for (var i = 1; i < length; i++) { + sb.write(','); + sb.write(this[i]); + } + sb.write(']'); + return sb.toString(); + } +} + +/// Identifies a half-open character range in the source code. +class CXSourceRange extends ffi.Struct { + ffi.Pointer _ptr_data_item_0; + ffi.Pointer _ptr_data_item_1; + ffi.Pointer _ptr_data_item_2; + + /// helper for array, supports `[]` operator + _ArrayHelper_CXSourceRange_ptr_data get ptr_data => + _ArrayHelper_CXSourceRange_ptr_data(this, 3); + @ffi.Uint32() + int begin_int_data; + + @ffi.Uint32() + int end_int_data; +} + +/// Helper for array ptr_data in struct CXSourceRange +class _ArrayHelper_CXSourceRange_ptr_data { + final CXSourceRange _struct; + final int length; + _ArrayHelper_CXSourceRange_ptr_data(this._struct, this.length); + void operator []=(int index, ffi.Pointer value) { + switch (index) { + case 0: + _struct._ptr_data_item_0 = value; + break; + case 1: + _struct._ptr_data_item_1 = value; + break; + case 2: + _struct._ptr_data_item_2 = value; + break; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + ffi.Pointer operator [](int index) { + switch (index) { + case 0: + return _struct._ptr_data_item_0; + case 1: + return _struct._ptr_data_item_1; + case 2: + return _struct._ptr_data_item_2; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + @override + String toString() { + if (length == 0) return '[]'; + final sb = StringBuffer('['); + sb.write(this[0]); + for (var i = 1; i < length; i++) { + sb.write(','); + sb.write(this[i]); + } + sb.write(']'); + return sb.toString(); + } +} + +/// Identifies an array of ranges. +class CXSourceRangeList extends ffi.Struct { + @ffi.Uint32() + int count; + + ffi.Pointer ranges; +} + +/// A character string. +class CXString extends ffi.Struct { + ffi.Pointer data; + + @ffi.Uint32() + int private_flags; +} + +class CXStringSet extends ffi.Struct { + ffi.Pointer Strings; + + @ffi.Uint32() + int Count; +} + +/// The memory usage of a CXTranslationUnit, broken into categories. +class CXTUResourceUsage extends ffi.Struct { + ffi.Pointer data; + + @ffi.Uint32() + int numEntries; + + ffi.Pointer entries; +} + +class CXTUResourceUsageEntry extends ffi.Struct { + @ffi.Int32() + int kind; + + @ffi.Uint64() + int amount; +} + +class CXTargetInfoImpl extends ffi.Struct {} + +/// Describes a single preprocessing token. +class CXToken extends ffi.Struct { + @ffi.Uint32() + int _int_data_item_0; + @ffi.Uint32() + int _int_data_item_1; + @ffi.Uint32() + int _int_data_item_2; + + /// helper for array, supports `[]` operator + _ArrayHelper_CXToken_int_data get int_data => + _ArrayHelper_CXToken_int_data(this, 3); + ffi.Pointer ptr_data; +} + +/// Helper for array int_data in struct CXToken +class _ArrayHelper_CXToken_int_data { + final CXToken _struct; + final int length; + _ArrayHelper_CXToken_int_data(this._struct, this.length); + void operator []=(int index, int value) { + switch (index) { + case 0: + _struct._int_data_item_0 = value; + break; + case 1: + _struct._int_data_item_1 = value; + break; + case 2: + _struct._int_data_item_2 = value; + break; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + int operator [](int index) { + switch (index) { + case 0: + return _struct._int_data_item_0; + case 1: + return _struct._int_data_item_1; + case 2: + return _struct._int_data_item_2; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + @override + String toString() { + if (length == 0) return '[]'; + final sb = StringBuffer('['); + sb.write(this[0]); + for (var i = 1; i < length; i++) { + sb.write(','); + sb.write(this[i]); + } + sb.write(']'); + return sb.toString(); + } +} + +class CXTranslationUnitImpl extends ffi.Struct {} + +/// The type of an element in the abstract syntax tree. +class CXType extends ffi.Struct { + @ffi.Int32() + int kind; + + ffi.Pointer _data_item_0; + ffi.Pointer _data_item_1; + ffi.Pointer _data_item_2; + + /// helper for array, supports `[]` operator + _ArrayHelper_CXType_data get data => _ArrayHelper_CXType_data(this, 3); +} + +/// Helper for array data in struct CXType +class _ArrayHelper_CXType_data { + final CXType _struct; + final int length; + _ArrayHelper_CXType_data(this._struct, this.length); + void operator []=(int index, ffi.Pointer value) { + switch (index) { + case 0: + _struct._data_item_0 = value; + break; + case 1: + _struct._data_item_1 = value; + break; + case 2: + _struct._data_item_2 = value; + break; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + ffi.Pointer operator [](int index) { + switch (index) { + case 0: + return _struct._data_item_0; + case 1: + return _struct._data_item_1; + case 2: + return _struct._data_item_2; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + @override + String toString() { + if (length == 0) return '[]'; + final sb = StringBuffer('['); + sb.write(this[0]); + for (var i = 1; i < length; i++) { + sb.write(','); + sb.write(this[i]); + } + sb.write(']'); + return sb.toString(); + } +} + +/// Describes the kind of type +class CXTypeKind { + static const int CXType_Invalid = 0; + 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; + 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; +} + +/// Provides the contents of a file that has not yet been saved to disk. +class CXUnsavedFile extends ffi.Struct { + ffi.Pointer Filename; + + ffi.Pointer Contents; + + @ffi.Uint64() + int Length; +} + +/// Describes a version number of the form major.minor.subminor. +class CXVersion extends ffi.Struct { + @ffi.Int32() + int Major; + + @ffi.Int32() + int Minor; + + @ffi.Int32() + int Subminor; +} + +/// A group of callbacks used by #clang_indexSourceFile and #clang_indexTranslationUnit. +class IndexerCallbacks extends ffi.Struct { + ffi.Pointer> abortQuery; + + ffi.Pointer> diagnostic; + + ffi.Pointer> enteredMainFile; + + ffi.Pointer> ppIncludedFile; + + ffi.Pointer> importedASTFile; + + ffi.Pointer> startedTranslationUnit; + + ffi.Pointer> indexDeclaration; + + ffi.Pointer> indexEntityReference; +} + +typedef ModifiedCXCursorVisitor = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_noname_1 = ffi.Void Function( + ffi.Pointer, +); + +typedef _typedefC_noname_10 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_noname_2 = ffi.Int32 Function( + ffi.Pointer, + CXCursor, + CXSourceRange, +); + +typedef _typedefC_noname_3 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_noname_4 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_noname_5 = ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_noname_6 = ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_noname_7 = ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_noname_8 = ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_noname_9 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, +); + +/// Gets the general options associated with a CXIndex. +int clang_CXIndex_getGlobalOptions( + ffi.Pointer arg0, +) { + return _clang_CXIndex_getGlobalOptions( + arg0, + ); +} + +final _dart_clang_CXIndex_getGlobalOptions _clang_CXIndex_getGlobalOptions = + _dylib.lookupFunction<_c_clang_CXIndex_getGlobalOptions, + _dart_clang_CXIndex_getGlobalOptions>('clang_CXIndex_getGlobalOptions'); + +typedef _c_clang_CXIndex_getGlobalOptions = ffi.Uint32 Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_CXIndex_getGlobalOptions = int Function( + ffi.Pointer arg0, +); + +/// Sets general options associated with a CXIndex. +void clang_CXIndex_setGlobalOptions( + ffi.Pointer arg0, + int options, +) { + return _clang_CXIndex_setGlobalOptions( + arg0, + options, + ); +} + +final _dart_clang_CXIndex_setGlobalOptions _clang_CXIndex_setGlobalOptions = + _dylib.lookupFunction<_c_clang_CXIndex_setGlobalOptions, + _dart_clang_CXIndex_setGlobalOptions>('clang_CXIndex_setGlobalOptions'); + +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, +); + +/// Sets the invocation emission path option in a CXIndex. +void clang_CXIndex_setInvocationEmissionPathOption( + ffi.Pointer arg0, + ffi.Pointer Path, +) { + return _clang_CXIndex_setInvocationEmissionPathOption( + arg0, + Path, + ); +} + +final _dart_clang_CXIndex_setInvocationEmissionPathOption + _clang_CXIndex_setInvocationEmissionPathOption = _dylib.lookupFunction< + _c_clang_CXIndex_setInvocationEmissionPathOption, + _dart_clang_CXIndex_setInvocationEmissionPathOption>( + 'clang_CXIndex_setInvocationEmissionPathOption'); + +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, +); + +ffi.Pointer clang_Cursor_getArgument_wrap( + ffi.Pointer cursor, + int i, +) { + return _clang_Cursor_getArgument_wrap( + cursor, + i, + ); +} + +final _dart_clang_Cursor_getArgument_wrap _clang_Cursor_getArgument_wrap = + _dylib.lookupFunction<_c_clang_Cursor_getArgument_wrap, + _dart_clang_Cursor_getArgument_wrap>('clang_Cursor_getArgument_wrap'); + +typedef _c_clang_Cursor_getArgument_wrap = ffi.Pointer Function( + ffi.Pointer cursor, + ffi.Uint32 i, +); + +typedef _dart_clang_Cursor_getArgument_wrap = ffi.Pointer Function( + ffi.Pointer cursor, + int i, +); + +/// Returns the first paragraph of doxygen doc comment. +ffi.Pointer clang_Cursor_getBriefCommentText_wrap( + ffi.Pointer cursor, +) { + return _clang_Cursor_getBriefCommentText_wrap( + cursor, + ); +} + +final _dart_clang_Cursor_getBriefCommentText_wrap + _clang_Cursor_getBriefCommentText_wrap = _dylib.lookupFunction< + _c_clang_Cursor_getBriefCommentText_wrap, + _dart_clang_Cursor_getBriefCommentText_wrap>( + 'clang_Cursor_getBriefCommentText_wrap'); + +typedef _c_clang_Cursor_getBriefCommentText_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_Cursor_getBriefCommentText_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); + +int clang_Cursor_getNumArguments_wrap( + ffi.Pointer cursor, +) { + return _clang_Cursor_getNumArguments_wrap( + cursor, + ); +} + +final _dart_clang_Cursor_getNumArguments_wrap + _clang_Cursor_getNumArguments_wrap = _dylib.lookupFunction< + _c_clang_Cursor_getNumArguments_wrap, + _dart_clang_Cursor_getNumArguments_wrap>( + 'clang_Cursor_getNumArguments_wrap'); + +typedef _c_clang_Cursor_getNumArguments_wrap = ffi.Int32 Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_Cursor_getNumArguments_wrap = int Function( + ffi.Pointer cursor, +); + +/// Disposes the created Eval memory. +void clang_EvalResult_dispose( + ffi.Pointer E, +) { + return _clang_EvalResult_dispose( + E, + ); +} + +final _dart_clang_EvalResult_dispose _clang_EvalResult_dispose = + _dylib.lookupFunction<_c_clang_EvalResult_dispose, + _dart_clang_EvalResult_dispose>('clang_EvalResult_dispose'); + +typedef _c_clang_EvalResult_dispose = ffi.Void Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_dispose = void Function( + ffi.Pointer E, +); + +/// Returns the evaluation result as double if the kind is double. +double clang_EvalResult_getAsDouble( + ffi.Pointer E, +) { + return _clang_EvalResult_getAsDouble( + E, + ); +} + +final _dart_clang_EvalResult_getAsDouble _clang_EvalResult_getAsDouble = + _dylib.lookupFunction<_c_clang_EvalResult_getAsDouble, + _dart_clang_EvalResult_getAsDouble>('clang_EvalResult_getAsDouble'); + +typedef _c_clang_EvalResult_getAsDouble = ffi.Double Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_getAsDouble = double Function( + ffi.Pointer E, +); + +/// Returns the evaluation result as integer if the kind is Int. +int clang_EvalResult_getAsInt( + ffi.Pointer E, +) { + return _clang_EvalResult_getAsInt( + E, + ); +} + +final _dart_clang_EvalResult_getAsInt _clang_EvalResult_getAsInt = + _dylib.lookupFunction<_c_clang_EvalResult_getAsInt, + _dart_clang_EvalResult_getAsInt>('clang_EvalResult_getAsInt'); + +typedef _c_clang_EvalResult_getAsInt = ffi.Int32 Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_getAsInt = int Function( + ffi.Pointer E, +); + +/// 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( + E, + ); +} + +final _dart_clang_EvalResult_getAsLongLong _clang_EvalResult_getAsLongLong = + _dylib.lookupFunction<_c_clang_EvalResult_getAsLongLong, + _dart_clang_EvalResult_getAsLongLong>('clang_EvalResult_getAsLongLong'); + +typedef _c_clang_EvalResult_getAsLongLong = ffi.Int64 Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_getAsLongLong = int Function( + ffi.Pointer E, +); + +/// 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( + E, + ); +} + +final _dart_clang_EvalResult_getAsStr _clang_EvalResult_getAsStr = + _dylib.lookupFunction<_c_clang_EvalResult_getAsStr, + _dart_clang_EvalResult_getAsStr>('clang_EvalResult_getAsStr'); + +typedef _c_clang_EvalResult_getAsStr = ffi.Pointer Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_getAsStr = ffi.Pointer Function( + ffi.Pointer E, +); + +/// 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( + E, + ); +} + +final _dart_clang_EvalResult_getAsUnsigned _clang_EvalResult_getAsUnsigned = + _dylib.lookupFunction<_c_clang_EvalResult_getAsUnsigned, + _dart_clang_EvalResult_getAsUnsigned>('clang_EvalResult_getAsUnsigned'); + +typedef _c_clang_EvalResult_getAsUnsigned = ffi.Uint64 Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_getAsUnsigned = int Function( + ffi.Pointer E, +); + +/// Returns the kind of the evaluated result. +int clang_EvalResult_getKind( + ffi.Pointer E, +) { + return _clang_EvalResult_getKind( + E, + ); +} + +final _dart_clang_EvalResult_getKind _clang_EvalResult_getKind = + _dylib.lookupFunction<_c_clang_EvalResult_getKind, + _dart_clang_EvalResult_getKind>('clang_EvalResult_getKind'); + +typedef _c_clang_EvalResult_getKind = ffi.Int32 Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_getKind = int Function( + ffi.Pointer E, +); + +/// 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( + E, + ); +} + +final _dart_clang_EvalResult_isUnsignedInt _clang_EvalResult_isUnsignedInt = + _dylib.lookupFunction<_c_clang_EvalResult_isUnsignedInt, + _dart_clang_EvalResult_isUnsignedInt>('clang_EvalResult_isUnsignedInt'); + +typedef _c_clang_EvalResult_isUnsignedInt = ffi.Uint32 Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_isUnsignedInt = int Function( + ffi.Pointer E, +); + +/// Returns non-zero if the file1 and file2 point to the same file, or they are both NULL. +int clang_File_isEqual( + ffi.Pointer file1, + ffi.Pointer file2, +) { + return _clang_File_isEqual( + file1, + file2, + ); +} + +final _dart_clang_File_isEqual _clang_File_isEqual = + _dylib.lookupFunction<_c_clang_File_isEqual, _dart_clang_File_isEqual>( + 'clang_File_isEqual'); + +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, +); + +/// 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( + CIdx, + ); +} + +final _dart_clang_IndexAction_create _clang_IndexAction_create = + _dylib.lookupFunction<_c_clang_IndexAction_create, + _dart_clang_IndexAction_create>('clang_IndexAction_create'); + +typedef _c_clang_IndexAction_create = ffi.Pointer Function( + ffi.Pointer CIdx, +); + +typedef _dart_clang_IndexAction_create = ffi.Pointer Function( + ffi.Pointer CIdx, +); + +/// Destroy the given index action. +void clang_IndexAction_dispose( + ffi.Pointer arg0, +) { + return _clang_IndexAction_dispose( + arg0, + ); +} + +final _dart_clang_IndexAction_dispose _clang_IndexAction_dispose = + _dylib.lookupFunction<_c_clang_IndexAction_dispose, + _dart_clang_IndexAction_dispose>('clang_IndexAction_dispose'); + +typedef _c_clang_IndexAction_dispose = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_IndexAction_dispose = void Function( + ffi.Pointer arg0, +); + +/// Returns the module file where the provided module object came from. +ffi.Pointer clang_Module_getASTFile( + ffi.Pointer Module, +) { + return _clang_Module_getASTFile( + Module, + ); +} + +final _dart_clang_Module_getASTFile _clang_Module_getASTFile = _dylib + .lookupFunction<_c_clang_Module_getASTFile, _dart_clang_Module_getASTFile>( + 'clang_Module_getASTFile'); + +typedef _c_clang_Module_getASTFile = ffi.Pointer Function( + ffi.Pointer Module, +); + +typedef _dart_clang_Module_getASTFile = ffi.Pointer Function( + ffi.Pointer Module, +); + +/// 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( + arg0, + Module, + ); +} + +final _dart_clang_Module_getNumTopLevelHeaders + _clang_Module_getNumTopLevelHeaders = _dylib.lookupFunction< + _c_clang_Module_getNumTopLevelHeaders, + _dart_clang_Module_getNumTopLevelHeaders>( + 'clang_Module_getNumTopLevelHeaders'); + +typedef _c_clang_Module_getNumTopLevelHeaders = ffi.Uint32 Function( + ffi.Pointer arg0, + ffi.Pointer Module, +); + +typedef _dart_clang_Module_getNumTopLevelHeaders = int Function( + ffi.Pointer arg0, + ffi.Pointer Module, +); + +/// 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( + Module, + ); +} + +final _dart_clang_Module_getParent _clang_Module_getParent = _dylib + .lookupFunction<_c_clang_Module_getParent, _dart_clang_Module_getParent>( + 'clang_Module_getParent'); + +typedef _c_clang_Module_getParent = ffi.Pointer Function( + ffi.Pointer Module, +); + +typedef _dart_clang_Module_getParent = ffi.Pointer Function( + ffi.Pointer Module, +); + +/// 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( + arg0, + Module, + Index, + ); +} + +final _dart_clang_Module_getTopLevelHeader _clang_Module_getTopLevelHeader = + _dylib.lookupFunction<_c_clang_Module_getTopLevelHeader, + _dart_clang_Module_getTopLevelHeader>('clang_Module_getTopLevelHeader'); + +typedef _c_clang_Module_getTopLevelHeader = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer Module, + ffi.Uint32 Index, +); + +typedef _dart_clang_Module_getTopLevelHeader = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer Module, + int Index, +); + +/// Returns non-zero if the module is a system one. +int clang_Module_isSystem( + ffi.Pointer Module, +) { + return _clang_Module_isSystem( + Module, + ); +} + +final _dart_clang_Module_isSystem _clang_Module_isSystem = _dylib + .lookupFunction<_c_clang_Module_isSystem, _dart_clang_Module_isSystem>( + 'clang_Module_isSystem'); + +typedef _c_clang_Module_isSystem = ffi.Int32 Function( + ffi.Pointer Module, +); + +typedef _dart_clang_Module_isSystem = int Function( + ffi.Pointer Module, +); + +/// Release a printing policy. +void clang_PrintingPolicy_dispose( + ffi.Pointer Policy, +) { + return _clang_PrintingPolicy_dispose( + Policy, + ); +} + +final _dart_clang_PrintingPolicy_dispose _clang_PrintingPolicy_dispose = + _dylib.lookupFunction<_c_clang_PrintingPolicy_dispose, + _dart_clang_PrintingPolicy_dispose>('clang_PrintingPolicy_dispose'); + +typedef _c_clang_PrintingPolicy_dispose = ffi.Void Function( + ffi.Pointer Policy, +); + +typedef _dart_clang_PrintingPolicy_dispose = void Function( + ffi.Pointer Policy, +); + +/// Get a property value for the given printing policy. +int clang_PrintingPolicy_getProperty( + ffi.Pointer Policy, + int Property, +) { + return _clang_PrintingPolicy_getProperty( + Policy, + Property, + ); +} + +final _dart_clang_PrintingPolicy_getProperty _clang_PrintingPolicy_getProperty = + _dylib.lookupFunction<_c_clang_PrintingPolicy_getProperty, + _dart_clang_PrintingPolicy_getProperty>( + 'clang_PrintingPolicy_getProperty'); + +typedef _c_clang_PrintingPolicy_getProperty = ffi.Uint32 Function( + ffi.Pointer Policy, + ffi.Int32 Property, +); + +typedef _dart_clang_PrintingPolicy_getProperty = int Function( + ffi.Pointer Policy, + int Property, +); + +/// Set a property value for the given printing policy. +void clang_PrintingPolicy_setProperty( + ffi.Pointer Policy, + int Property, + int Value, +) { + return _clang_PrintingPolicy_setProperty( + Policy, + Property, + Value, + ); +} + +final _dart_clang_PrintingPolicy_setProperty _clang_PrintingPolicy_setProperty = + _dylib.lookupFunction<_c_clang_PrintingPolicy_setProperty, + _dart_clang_PrintingPolicy_setProperty>( + 'clang_PrintingPolicy_setProperty'); + +typedef _c_clang_PrintingPolicy_setProperty = ffi.Void Function( + ffi.Pointer Policy, + ffi.Int32 Property, + ffi.Uint32 Value, +); + +typedef _dart_clang_PrintingPolicy_setProperty = void Function( + ffi.Pointer Policy, + int Property, + int Value, +); + +/// Destroy the CXTargetInfo object. +void clang_TargetInfo_dispose( + ffi.Pointer Info, +) { + return _clang_TargetInfo_dispose( + Info, + ); +} + +final _dart_clang_TargetInfo_dispose _clang_TargetInfo_dispose = + _dylib.lookupFunction<_c_clang_TargetInfo_dispose, + _dart_clang_TargetInfo_dispose>('clang_TargetInfo_dispose'); + +typedef _c_clang_TargetInfo_dispose = ffi.Void Function( + ffi.Pointer Info, +); + +typedef _dart_clang_TargetInfo_dispose = void Function( + ffi.Pointer Info, +); + +/// Get the pointer width of the target in bits. +int clang_TargetInfo_getPointerWidth( + ffi.Pointer Info, +) { + return _clang_TargetInfo_getPointerWidth( + Info, + ); +} + +final _dart_clang_TargetInfo_getPointerWidth _clang_TargetInfo_getPointerWidth = + _dylib.lookupFunction<_c_clang_TargetInfo_getPointerWidth, + _dart_clang_TargetInfo_getPointerWidth>( + 'clang_TargetInfo_getPointerWidth'); + +typedef _c_clang_TargetInfo_getPointerWidth = ffi.Int32 Function( + ffi.Pointer Info, +); + +typedef _dart_clang_TargetInfo_getPointerWidth = int Function( + ffi.Pointer Info, +); + +ffi.Pointer clang_Type_getNamedType_wrap( + ffi.Pointer elaboratedType, +) { + return _clang_Type_getNamedType_wrap( + elaboratedType, + ); +} + +final _dart_clang_Type_getNamedType_wrap _clang_Type_getNamedType_wrap = + _dylib.lookupFunction<_c_clang_Type_getNamedType_wrap, + _dart_clang_Type_getNamedType_wrap>('clang_Type_getNamedType_wrap'); + +typedef _c_clang_Type_getNamedType_wrap = ffi.Pointer Function( + ffi.Pointer elaboratedType, +); + +typedef _dart_clang_Type_getNamedType_wrap = ffi.Pointer Function( + ffi.Pointer elaboratedType, +); + +/// 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( + TU, + Tokens, + NumTokens, + Cursors, + ); +} + +final _dart_clang_annotateTokens _clang_annotateTokens = + _dylib.lookupFunction<_c_clang_annotateTokens, _dart_clang_annotateTokens>( + 'clang_annotateTokens'); + +typedef _c_clang_annotateTokens = ffi.Void Function( + ffi.Pointer TU, + ffi.Pointer Tokens, + ffi.Uint32 NumTokens, + ffi.Pointer Cursors, +); + +typedef _dart_clang_annotateTokens = void Function( + ffi.Pointer TU, + ffi.Pointer Tokens, + int NumTokens, + ffi.Pointer Cursors, +); + +/// 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( + TU, + complete_filename, + complete_line, + complete_column, + unsaved_files, + num_unsaved_files, + options, + ); +} + +final _dart_clang_codeCompleteAt _clang_codeCompleteAt = + _dylib.lookupFunction<_c_clang_codeCompleteAt, _dart_clang_codeCompleteAt>( + 'clang_codeCompleteAt'); + +typedef _c_clang_codeCompleteAt = ffi.Pointer Function( + ffi.Pointer TU, + ffi.Pointer complete_filename, + ffi.Uint32 complete_line, + ffi.Uint32 complete_column, + ffi.Pointer unsaved_files, + ffi.Uint32 num_unsaved_files, + ffi.Uint32 options, +); + +typedef _dart_clang_codeCompleteAt = ffi.Pointer + Function( + ffi.Pointer TU, + ffi.Pointer complete_filename, + int complete_line, + int complete_column, + ffi.Pointer unsaved_files, + int num_unsaved_files, + int options, +); + +/// 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( + Results, + IsIncomplete, + ); +} + +final _dart_clang_codeCompleteGetContainerKind + _clang_codeCompleteGetContainerKind = _dylib.lookupFunction< + _c_clang_codeCompleteGetContainerKind, + _dart_clang_codeCompleteGetContainerKind>( + 'clang_codeCompleteGetContainerKind'); + +typedef _c_clang_codeCompleteGetContainerKind = ffi.Int32 Function( + ffi.Pointer Results, + ffi.Pointer IsIncomplete, +); + +typedef _dart_clang_codeCompleteGetContainerKind = int Function( + ffi.Pointer Results, + ffi.Pointer IsIncomplete, +); + +/// Determines what completions are appropriate for the context the given code completion. +int clang_codeCompleteGetContexts( + ffi.Pointer Results, +) { + return _clang_codeCompleteGetContexts( + Results, + ); +} + +final _dart_clang_codeCompleteGetContexts _clang_codeCompleteGetContexts = + _dylib.lookupFunction<_c_clang_codeCompleteGetContexts, + _dart_clang_codeCompleteGetContexts>('clang_codeCompleteGetContexts'); + +typedef _c_clang_codeCompleteGetContexts = ffi.Uint64 Function( + ffi.Pointer Results, +); + +typedef _dart_clang_codeCompleteGetContexts = int Function( + ffi.Pointer Results, +); + +/// Retrieve a diagnostic associated with the given code completion. +ffi.Pointer clang_codeCompleteGetDiagnostic( + ffi.Pointer Results, + int Index, +) { + return _clang_codeCompleteGetDiagnostic( + Results, + Index, + ); +} + +final _dart_clang_codeCompleteGetDiagnostic _clang_codeCompleteGetDiagnostic = + _dylib.lookupFunction<_c_clang_codeCompleteGetDiagnostic, + _dart_clang_codeCompleteGetDiagnostic>( + 'clang_codeCompleteGetDiagnostic'); + +typedef _c_clang_codeCompleteGetDiagnostic = ffi.Pointer Function( + ffi.Pointer Results, + ffi.Uint32 Index, +); + +typedef _dart_clang_codeCompleteGetDiagnostic = ffi.Pointer Function( + ffi.Pointer Results, + int Index, +); + +/// Determine the number of diagnostics produced prior to the location where code completion was performed. +int clang_codeCompleteGetNumDiagnostics( + ffi.Pointer Results, +) { + return _clang_codeCompleteGetNumDiagnostics( + Results, + ); +} + +final _dart_clang_codeCompleteGetNumDiagnostics + _clang_codeCompleteGetNumDiagnostics = _dylib.lookupFunction< + _c_clang_codeCompleteGetNumDiagnostics, + _dart_clang_codeCompleteGetNumDiagnostics>( + 'clang_codeCompleteGetNumDiagnostics'); + +typedef _c_clang_codeCompleteGetNumDiagnostics = ffi.Uint32 Function( + ffi.Pointer Results, +); + +typedef _dart_clang_codeCompleteGetNumDiagnostics = int Function( + ffi.Pointer Results, +); + +/// Creates an empty CXCursorSet. +ffi.Pointer clang_createCXCursorSet() { + return _clang_createCXCursorSet(); +} + +final _dart_clang_createCXCursorSet _clang_createCXCursorSet = _dylib + .lookupFunction<_c_clang_createCXCursorSet, _dart_clang_createCXCursorSet>( + 'clang_createCXCursorSet'); + +typedef _c_clang_createCXCursorSet = ffi.Pointer Function(); + +typedef _dart_clang_createCXCursorSet = ffi.Pointer Function(); + +/// Provides a shared context for creating translation units. +ffi.Pointer clang_createIndex( + int excludeDeclarationsFromPCH, + int displayDiagnostics, +) { + return _clang_createIndex( + excludeDeclarationsFromPCH, + displayDiagnostics, + ); +} + +final _dart_clang_createIndex _clang_createIndex = + _dylib.lookupFunction<_c_clang_createIndex, _dart_clang_createIndex>( + 'clang_createIndex'); + +typedef _c_clang_createIndex = ffi.Pointer Function( + ffi.Int32 excludeDeclarationsFromPCH, + ffi.Int32 displayDiagnostics, +); + +typedef _dart_clang_createIndex = ffi.Pointer Function( + int excludeDeclarationsFromPCH, + int displayDiagnostics, +); + +/// Same as clang_createTranslationUnit2, but returns the CXTranslationUnit instead of an error code. In case of an error this routine returns a NULL CXTranslationUnit, without further detailed error codes. +ffi.Pointer clang_createTranslationUnit( + ffi.Pointer CIdx, + ffi.Pointer ast_filename, +) { + return _clang_createTranslationUnit( + CIdx, + ast_filename, + ); +} + +final _dart_clang_createTranslationUnit _clang_createTranslationUnit = + _dylib.lookupFunction<_c_clang_createTranslationUnit, + _dart_clang_createTranslationUnit>('clang_createTranslationUnit'); + +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, +); + +/// Create a translation unit from an AST file ( -emit-ast). +int clang_createTranslationUnit2( + ffi.Pointer CIdx, + ffi.Pointer ast_filename, + ffi.Pointer> out_TU, +) { + return _clang_createTranslationUnit2( + CIdx, + ast_filename, + out_TU, + ); +} + +final _dart_clang_createTranslationUnit2 _clang_createTranslationUnit2 = + _dylib.lookupFunction<_c_clang_createTranslationUnit2, + _dart_clang_createTranslationUnit2>('clang_createTranslationUnit2'); + +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, +); + +/// Return the CXTranslationUnit for a given source file and the provided command line arguments one would pass to the compiler. +ffi.Pointer clang_createTranslationUnitFromSourceFile( + 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, +) { + return _clang_createTranslationUnitFromSourceFile( + CIdx, + source_filename, + num_clang_command_line_args, + clang_command_line_args, + num_unsaved_files, + unsaved_files, + ); +} + +final _dart_clang_createTranslationUnitFromSourceFile + _clang_createTranslationUnitFromSourceFile = _dylib.lookupFunction< + _c_clang_createTranslationUnitFromSourceFile, + _dart_clang_createTranslationUnitFromSourceFile>( + 'clang_createTranslationUnitFromSourceFile'); + +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, +); + +/// Returns a default set of code-completion options that can be passed to clang_codeCompleteAt(). +int clang_defaultCodeCompleteOptions() { + return _clang_defaultCodeCompleteOptions(); +} + +final _dart_clang_defaultCodeCompleteOptions _clang_defaultCodeCompleteOptions = + _dylib.lookupFunction<_c_clang_defaultCodeCompleteOptions, + _dart_clang_defaultCodeCompleteOptions>( + 'clang_defaultCodeCompleteOptions'); + +typedef _c_clang_defaultCodeCompleteOptions = ffi.Uint32 Function(); + +typedef _dart_clang_defaultCodeCompleteOptions = int Function(); + +/// Retrieve the set of display options most similar to the default behavior of the clang compiler. +int clang_defaultDiagnosticDisplayOptions() { + return _clang_defaultDiagnosticDisplayOptions(); +} + +final _dart_clang_defaultDiagnosticDisplayOptions + _clang_defaultDiagnosticDisplayOptions = _dylib.lookupFunction< + _c_clang_defaultDiagnosticDisplayOptions, + _dart_clang_defaultDiagnosticDisplayOptions>( + 'clang_defaultDiagnosticDisplayOptions'); + +typedef _c_clang_defaultDiagnosticDisplayOptions = ffi.Uint32 Function(); + +typedef _dart_clang_defaultDiagnosticDisplayOptions = int Function(); + +/// Returns the set of flags that is suitable for parsing a translation unit that is being edited. +int clang_defaultEditingTranslationUnitOptions() { + return _clang_defaultEditingTranslationUnitOptions(); +} + +final _dart_clang_defaultEditingTranslationUnitOptions + _clang_defaultEditingTranslationUnitOptions = _dylib.lookupFunction< + _c_clang_defaultEditingTranslationUnitOptions, + _dart_clang_defaultEditingTranslationUnitOptions>( + 'clang_defaultEditingTranslationUnitOptions'); + +typedef _c_clang_defaultEditingTranslationUnitOptions = ffi.Uint32 Function(); + +typedef _dart_clang_defaultEditingTranslationUnitOptions = int Function(); + +/// Returns the set of flags that is suitable for reparsing a translation unit. +int clang_defaultReparseOptions( + ffi.Pointer TU, +) { + return _clang_defaultReparseOptions( + TU, + ); +} + +final _dart_clang_defaultReparseOptions _clang_defaultReparseOptions = + _dylib.lookupFunction<_c_clang_defaultReparseOptions, + _dart_clang_defaultReparseOptions>('clang_defaultReparseOptions'); + +typedef _c_clang_defaultReparseOptions = ffi.Uint32 Function( + ffi.Pointer TU, +); + +typedef _dart_clang_defaultReparseOptions = int Function( + ffi.Pointer TU, +); + +/// Returns the set of flags that is suitable for saving a translation unit. +int clang_defaultSaveOptions( + ffi.Pointer TU, +) { + return _clang_defaultSaveOptions( + TU, + ); +} + +final _dart_clang_defaultSaveOptions _clang_defaultSaveOptions = + _dylib.lookupFunction<_c_clang_defaultSaveOptions, + _dart_clang_defaultSaveOptions>('clang_defaultSaveOptions'); + +typedef _c_clang_defaultSaveOptions = ffi.Uint32 Function( + ffi.Pointer TU, +); + +typedef _dart_clang_defaultSaveOptions = int Function( + ffi.Pointer TU, +); + +/// Disposes a CXCursorSet and releases its associated memory. +void clang_disposeCXCursorSet( + ffi.Pointer cset, +) { + return _clang_disposeCXCursorSet( + cset, + ); +} + +final _dart_clang_disposeCXCursorSet _clang_disposeCXCursorSet = + _dylib.lookupFunction<_c_clang_disposeCXCursorSet, + _dart_clang_disposeCXCursorSet>('clang_disposeCXCursorSet'); + +typedef _c_clang_disposeCXCursorSet = ffi.Void Function( + ffi.Pointer cset, +); + +typedef _dart_clang_disposeCXCursorSet = void Function( + ffi.Pointer cset, +); + +/// Free the memory associated with a CXPlatformAvailability structure. +void clang_disposeCXPlatformAvailability( + ffi.Pointer availability, +) { + return _clang_disposeCXPlatformAvailability( + availability, + ); +} + +final _dart_clang_disposeCXPlatformAvailability + _clang_disposeCXPlatformAvailability = _dylib.lookupFunction< + _c_clang_disposeCXPlatformAvailability, + _dart_clang_disposeCXPlatformAvailability>( + 'clang_disposeCXPlatformAvailability'); + +typedef _c_clang_disposeCXPlatformAvailability = ffi.Void Function( + ffi.Pointer availability, +); + +typedef _dart_clang_disposeCXPlatformAvailability = void Function( + ffi.Pointer availability, +); + +/// Free the given set of code-completion results. +void clang_disposeCodeCompleteResults( + ffi.Pointer Results, +) { + return _clang_disposeCodeCompleteResults( + Results, + ); +} + +final _dart_clang_disposeCodeCompleteResults _clang_disposeCodeCompleteResults = + _dylib.lookupFunction<_c_clang_disposeCodeCompleteResults, + _dart_clang_disposeCodeCompleteResults>( + 'clang_disposeCodeCompleteResults'); + +typedef _c_clang_disposeCodeCompleteResults = ffi.Void Function( + ffi.Pointer Results, +); + +typedef _dart_clang_disposeCodeCompleteResults = void Function( + ffi.Pointer Results, +); + +/// Destroy a diagnostic. +void clang_disposeDiagnostic( + ffi.Pointer Diagnostic, +) { + return _clang_disposeDiagnostic( + Diagnostic, + ); +} + +final _dart_clang_disposeDiagnostic _clang_disposeDiagnostic = _dylib + .lookupFunction<_c_clang_disposeDiagnostic, _dart_clang_disposeDiagnostic>( + 'clang_disposeDiagnostic'); + +typedef _c_clang_disposeDiagnostic = ffi.Void Function( + ffi.Pointer Diagnostic, +); + +typedef _dart_clang_disposeDiagnostic = void Function( + ffi.Pointer Diagnostic, +); + +/// Release a CXDiagnosticSet and all of its contained diagnostics. +void clang_disposeDiagnosticSet( + ffi.Pointer Diags, +) { + return _clang_disposeDiagnosticSet( + Diags, + ); +} + +final _dart_clang_disposeDiagnosticSet _clang_disposeDiagnosticSet = + _dylib.lookupFunction<_c_clang_disposeDiagnosticSet, + _dart_clang_disposeDiagnosticSet>('clang_disposeDiagnosticSet'); + +typedef _c_clang_disposeDiagnosticSet = ffi.Void Function( + ffi.Pointer Diags, +); + +typedef _dart_clang_disposeDiagnosticSet = void Function( + ffi.Pointer Diags, +); + +/// Destroy the given index. +void clang_disposeIndex( + ffi.Pointer index, +) { + return _clang_disposeIndex( + index, + ); +} + +final _dart_clang_disposeIndex _clang_disposeIndex = + _dylib.lookupFunction<_c_clang_disposeIndex, _dart_clang_disposeIndex>( + 'clang_disposeIndex'); + +typedef _c_clang_disposeIndex = ffi.Void Function( + ffi.Pointer index, +); + +typedef _dart_clang_disposeIndex = void Function( + ffi.Pointer index, +); + +/// Free the set of overridden cursors returned by clang_getOverriddenCursors(). +void clang_disposeOverriddenCursors( + ffi.Pointer overridden, +) { + return _clang_disposeOverriddenCursors( + overridden, + ); +} + +final _dart_clang_disposeOverriddenCursors _clang_disposeOverriddenCursors = + _dylib.lookupFunction<_c_clang_disposeOverriddenCursors, + _dart_clang_disposeOverriddenCursors>('clang_disposeOverriddenCursors'); + +typedef _c_clang_disposeOverriddenCursors = ffi.Void Function( + ffi.Pointer overridden, +); + +typedef _dart_clang_disposeOverriddenCursors = void Function( + ffi.Pointer overridden, +); + +/// Destroy the given CXSourceRangeList. +void clang_disposeSourceRangeList( + ffi.Pointer ranges, +) { + return _clang_disposeSourceRangeList( + ranges, + ); +} + +final _dart_clang_disposeSourceRangeList _clang_disposeSourceRangeList = + _dylib.lookupFunction<_c_clang_disposeSourceRangeList, + _dart_clang_disposeSourceRangeList>('clang_disposeSourceRangeList'); + +typedef _c_clang_disposeSourceRangeList = ffi.Void Function( + ffi.Pointer ranges, +); + +typedef _dart_clang_disposeSourceRangeList = void Function( + ffi.Pointer ranges, +); + +/// Free the given string set. +void clang_disposeStringSet( + ffi.Pointer set, +) { + return _clang_disposeStringSet( + set, + ); +} + +final _dart_clang_disposeStringSet _clang_disposeStringSet = _dylib + .lookupFunction<_c_clang_disposeStringSet, _dart_clang_disposeStringSet>( + 'clang_disposeStringSet'); + +typedef _c_clang_disposeStringSet = ffi.Void Function( + ffi.Pointer set, +); + +typedef _dart_clang_disposeStringSet = void Function( + ffi.Pointer set, +); + +void clang_disposeString_wrap( + ffi.Pointer string, +) { + return _clang_disposeString_wrap( + string, + ); +} + +final _dart_clang_disposeString_wrap _clang_disposeString_wrap = + _dylib.lookupFunction<_c_clang_disposeString_wrap, + _dart_clang_disposeString_wrap>('clang_disposeString_wrap'); + +typedef _c_clang_disposeString_wrap = ffi.Void Function( + ffi.Pointer string, +); + +typedef _dart_clang_disposeString_wrap = void Function( + ffi.Pointer string, +); + +/// Free the given set of tokens. +void clang_disposeTokens( + ffi.Pointer TU, + ffi.Pointer Tokens, + int NumTokens, +) { + return _clang_disposeTokens( + TU, + Tokens, + NumTokens, + ); +} + +final _dart_clang_disposeTokens _clang_disposeTokens = + _dylib.lookupFunction<_c_clang_disposeTokens, _dart_clang_disposeTokens>( + 'clang_disposeTokens'); + +typedef _c_clang_disposeTokens = ffi.Void Function( + ffi.Pointer TU, + ffi.Pointer Tokens, + ffi.Uint32 NumTokens, +); + +typedef _dart_clang_disposeTokens = void Function( + ffi.Pointer TU, + ffi.Pointer Tokens, + int NumTokens, +); + +/// Destroy the specified CXTranslationUnit object. +void clang_disposeTranslationUnit( + ffi.Pointer arg0, +) { + return _clang_disposeTranslationUnit( + arg0, + ); +} + +final _dart_clang_disposeTranslationUnit _clang_disposeTranslationUnit = + _dylib.lookupFunction<_c_clang_disposeTranslationUnit, + _dart_clang_disposeTranslationUnit>('clang_disposeTranslationUnit'); + +typedef _c_clang_disposeTranslationUnit = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_disposeTranslationUnit = void Function( + ffi.Pointer arg0, +); + +void clang_enableStackTraces() { + return _clang_enableStackTraces(); +} + +final _dart_clang_enableStackTraces _clang_enableStackTraces = _dylib + .lookupFunction<_c_clang_enableStackTraces, _dart_clang_enableStackTraces>( + 'clang_enableStackTraces'); + +typedef _c_clang_enableStackTraces = ffi.Void Function(); + +typedef _dart_clang_enableStackTraces = void Function(); + +void clang_executeOnThread( + ffi.Pointer> fn, + ffi.Pointer user_data, + int stack_size, +) { + return _clang_executeOnThread( + fn, + user_data, + stack_size, + ); +} + +final _dart_clang_executeOnThread _clang_executeOnThread = _dylib + .lookupFunction<_c_clang_executeOnThread, _dart_clang_executeOnThread>( + 'clang_executeOnThread'); + +typedef _c_clang_executeOnThread = ffi.Void Function( + ffi.Pointer> fn, + ffi.Pointer user_data, + ffi.Uint32 stack_size, +); + +typedef _dart_clang_executeOnThread = void Function( + ffi.Pointer> fn, + ffi.Pointer user_data, + int stack_size, +); + +ffi.Pointer clang_formatDiagnostic_wrap( + ffi.Pointer diag, + int opts, +) { + return _clang_formatDiagnostic_wrap( + diag, + opts, + ); +} + +final _dart_clang_formatDiagnostic_wrap _clang_formatDiagnostic_wrap = + _dylib.lookupFunction<_c_clang_formatDiagnostic_wrap, + _dart_clang_formatDiagnostic_wrap>('clang_formatDiagnostic_wrap'); + +typedef _c_clang_formatDiagnostic_wrap = ffi.Pointer Function( + ffi.Pointer diag, + ffi.Int32 opts, +); + +typedef _dart_clang_formatDiagnostic_wrap = ffi.Pointer Function( + ffi.Pointer diag, + int opts, +); + +/// Retrieve all ranges from all files that were skipped by the preprocessor. +ffi.Pointer clang_getAllSkippedRanges( + ffi.Pointer tu, +) { + return _clang_getAllSkippedRanges( + tu, + ); +} + +final _dart_clang_getAllSkippedRanges _clang_getAllSkippedRanges = + _dylib.lookupFunction<_c_clang_getAllSkippedRanges, + _dart_clang_getAllSkippedRanges>('clang_getAllSkippedRanges'); + +typedef _c_clang_getAllSkippedRanges = ffi.Pointer Function( + ffi.Pointer tu, +); + +typedef _dart_clang_getAllSkippedRanges = ffi.Pointer + Function( + ffi.Pointer tu, +); + +ffi.Pointer clang_getArgType_wrap( + ffi.Pointer cxtype, + int i, +) { + return _clang_getArgType_wrap( + cxtype, + i, + ); +} + +final _dart_clang_getArgType_wrap _clang_getArgType_wrap = _dylib + .lookupFunction<_c_clang_getArgType_wrap, _dart_clang_getArgType_wrap>( + 'clang_getArgType_wrap'); + +typedef _c_clang_getArgType_wrap = ffi.Pointer Function( + ffi.Pointer cxtype, + ffi.Uint32 i, +); + +typedef _dart_clang_getArgType_wrap = ffi.Pointer Function( + ffi.Pointer cxtype, + int i, +); + +ffi.Pointer clang_getArrayElementType_wrap( + ffi.Pointer cxtype, +) { + return _clang_getArrayElementType_wrap( + cxtype, + ); +} + +final _dart_clang_getArrayElementType_wrap _clang_getArrayElementType_wrap = + _dylib.lookupFunction<_c_clang_getArrayElementType_wrap, + _dart_clang_getArrayElementType_wrap>('clang_getArrayElementType_wrap'); + +typedef _c_clang_getArrayElementType_wrap = ffi.Pointer Function( + ffi.Pointer cxtype, +); + +typedef _dart_clang_getArrayElementType_wrap = ffi.Pointer Function( + ffi.Pointer cxtype, +); + +ffi.Pointer clang_getCString_wrap( + ffi.Pointer string, +) { + return _clang_getCString_wrap( + string, + ); +} + +final _dart_clang_getCString_wrap _clang_getCString_wrap = _dylib + .lookupFunction<_c_clang_getCString_wrap, _dart_clang_getCString_wrap>( + 'clang_getCString_wrap'); + +typedef _c_clang_getCString_wrap = ffi.Pointer Function( + ffi.Pointer string, +); + +typedef _dart_clang_getCString_wrap = ffi.Pointer Function( + ffi.Pointer string, +); + +ffi.Pointer clang_getCanonicalType_wrap( + ffi.Pointer typerefType, +) { + return _clang_getCanonicalType_wrap( + typerefType, + ); +} + +final _dart_clang_getCanonicalType_wrap _clang_getCanonicalType_wrap = + _dylib.lookupFunction<_c_clang_getCanonicalType_wrap, + _dart_clang_getCanonicalType_wrap>('clang_getCanonicalType_wrap'); + +typedef _c_clang_getCanonicalType_wrap = ffi.Pointer Function( + ffi.Pointer typerefType, +); + +typedef _dart_clang_getCanonicalType_wrap = ffi.Pointer Function( + ffi.Pointer typerefType, +); + +/// Retrieve the child diagnostics of a CXDiagnostic. +ffi.Pointer clang_getChildDiagnostics( + ffi.Pointer D, +) { + return _clang_getChildDiagnostics( + D, + ); +} + +final _dart_clang_getChildDiagnostics _clang_getChildDiagnostics = + _dylib.lookupFunction<_c_clang_getChildDiagnostics, + _dart_clang_getChildDiagnostics>('clang_getChildDiagnostics'); + +typedef _c_clang_getChildDiagnostics = ffi.Pointer Function( + ffi.Pointer D, +); + +typedef _dart_clang_getChildDiagnostics = ffi.Pointer Function( + ffi.Pointer D, +); + +/// Determine the availability of the entity that this code-completion string refers to. +int clang_getCompletionAvailability( + ffi.Pointer completion_string, +) { + return _clang_getCompletionAvailability( + completion_string, + ); +} + +final _dart_clang_getCompletionAvailability _clang_getCompletionAvailability = + _dylib.lookupFunction<_c_clang_getCompletionAvailability, + _dart_clang_getCompletionAvailability>( + 'clang_getCompletionAvailability'); + +typedef _c_clang_getCompletionAvailability = ffi.Int32 Function( + ffi.Pointer completion_string, +); + +typedef _dart_clang_getCompletionAvailability = int Function( + ffi.Pointer completion_string, +); + +/// 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( + completion_string, + chunk_number, + ); +} + +final _dart_clang_getCompletionChunkCompletionString + _clang_getCompletionChunkCompletionString = _dylib.lookupFunction< + _c_clang_getCompletionChunkCompletionString, + _dart_clang_getCompletionChunkCompletionString>( + 'clang_getCompletionChunkCompletionString'); + +typedef _c_clang_getCompletionChunkCompletionString = ffi.Pointer + Function( + ffi.Pointer completion_string, + ffi.Uint32 chunk_number, +); + +typedef _dart_clang_getCompletionChunkCompletionString = ffi.Pointer + Function( + ffi.Pointer completion_string, + int chunk_number, +); + +/// Determine the kind of a particular chunk within a completion string. +int clang_getCompletionChunkKind( + ffi.Pointer completion_string, + int chunk_number, +) { + return _clang_getCompletionChunkKind( + completion_string, + chunk_number, + ); +} + +final _dart_clang_getCompletionChunkKind _clang_getCompletionChunkKind = + _dylib.lookupFunction<_c_clang_getCompletionChunkKind, + _dart_clang_getCompletionChunkKind>('clang_getCompletionChunkKind'); + +typedef _c_clang_getCompletionChunkKind = ffi.Int32 Function( + ffi.Pointer completion_string, + ffi.Uint32 chunk_number, +); + +typedef _dart_clang_getCompletionChunkKind = int Function( + ffi.Pointer completion_string, + int chunk_number, +); + +/// Retrieve the number of annotations associated with the given completion string. +int clang_getCompletionNumAnnotations( + ffi.Pointer completion_string, +) { + return _clang_getCompletionNumAnnotations( + completion_string, + ); +} + +final _dart_clang_getCompletionNumAnnotations + _clang_getCompletionNumAnnotations = _dylib.lookupFunction< + _c_clang_getCompletionNumAnnotations, + _dart_clang_getCompletionNumAnnotations>( + 'clang_getCompletionNumAnnotations'); + +typedef _c_clang_getCompletionNumAnnotations = ffi.Uint32 Function( + ffi.Pointer completion_string, +); + +typedef _dart_clang_getCompletionNumAnnotations = int Function( + ffi.Pointer completion_string, +); + +/// Retrieve the number of fix-its for the given completion index. +int clang_getCompletionNumFixIts( + ffi.Pointer results, + int completion_index, +) { + return _clang_getCompletionNumFixIts( + results, + completion_index, + ); +} + +final _dart_clang_getCompletionNumFixIts _clang_getCompletionNumFixIts = + _dylib.lookupFunction<_c_clang_getCompletionNumFixIts, + _dart_clang_getCompletionNumFixIts>('clang_getCompletionNumFixIts'); + +typedef _c_clang_getCompletionNumFixIts = ffi.Uint32 Function( + ffi.Pointer results, + ffi.Uint32 completion_index, +); + +typedef _dart_clang_getCompletionNumFixIts = int Function( + ffi.Pointer results, + int completion_index, +); + +/// Determine the priority of this code completion. +int clang_getCompletionPriority( + ffi.Pointer completion_string, +) { + return _clang_getCompletionPriority( + completion_string, + ); +} + +final _dart_clang_getCompletionPriority _clang_getCompletionPriority = + _dylib.lookupFunction<_c_clang_getCompletionPriority, + _dart_clang_getCompletionPriority>('clang_getCompletionPriority'); + +typedef _c_clang_getCompletionPriority = ffi.Uint32 Function( + ffi.Pointer completion_string, +); + +typedef _dart_clang_getCompletionPriority = int Function( + ffi.Pointer completion_string, +); + +ffi.Pointer clang_getCursorKindSpelling_wrap( + int kind, +) { + return _clang_getCursorKindSpelling_wrap( + kind, + ); +} + +final _dart_clang_getCursorKindSpelling_wrap _clang_getCursorKindSpelling_wrap = + _dylib.lookupFunction<_c_clang_getCursorKindSpelling_wrap, + _dart_clang_getCursorKindSpelling_wrap>( + 'clang_getCursorKindSpelling_wrap'); + +typedef _c_clang_getCursorKindSpelling_wrap = ffi.Pointer Function( + ffi.Int32 kind, +); + +typedef _dart_clang_getCursorKindSpelling_wrap = ffi.Pointer Function( + int kind, +); + +int clang_getCursorKind_wrap( + ffi.Pointer cursor, +) { + return _clang_getCursorKind_wrap( + cursor, + ); +} + +final _dart_clang_getCursorKind_wrap _clang_getCursorKind_wrap = + _dylib.lookupFunction<_c_clang_getCursorKind_wrap, + _dart_clang_getCursorKind_wrap>('clang_getCursorKind_wrap'); + +typedef _c_clang_getCursorKind_wrap = ffi.Int32 Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_getCursorKind_wrap = int Function( + ffi.Pointer cursor, +); + +ffi.Pointer clang_getCursorLocation_wrap( + ffi.Pointer cursor, +) { + return _clang_getCursorLocation_wrap( + cursor, + ); +} + +final _dart_clang_getCursorLocation_wrap _clang_getCursorLocation_wrap = + _dylib.lookupFunction<_c_clang_getCursorLocation_wrap, + _dart_clang_getCursorLocation_wrap>('clang_getCursorLocation_wrap'); + +typedef _c_clang_getCursorLocation_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_getCursorLocation_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); + +/// The name of parameter, struct, typedef. +ffi.Pointer clang_getCursorSpelling_wrap( + ffi.Pointer cursor, +) { + return _clang_getCursorSpelling_wrap( + cursor, + ); +} + +final _dart_clang_getCursorSpelling_wrap _clang_getCursorSpelling_wrap = + _dylib.lookupFunction<_c_clang_getCursorSpelling_wrap, + _dart_clang_getCursorSpelling_wrap>('clang_getCursorSpelling_wrap'); + +typedef _c_clang_getCursorSpelling_wrap = ffi.Pointer Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_getCursorSpelling_wrap = ffi.Pointer Function( + ffi.Pointer cursor, +); + +ffi.Pointer clang_getCursorType_wrap( + ffi.Pointer cursor, +) { + return _clang_getCursorType_wrap( + cursor, + ); +} + +final _dart_clang_getCursorType_wrap _clang_getCursorType_wrap = + _dylib.lookupFunction<_c_clang_getCursorType_wrap, + _dart_clang_getCursorType_wrap>('clang_getCursorType_wrap'); + +typedef _c_clang_getCursorType_wrap = ffi.Pointer Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_getCursorType_wrap = ffi.Pointer Function( + ffi.Pointer cursor, +); + +/// Retrieve a diagnostic associated with the given translation unit. +ffi.Pointer clang_getDiagnostic( + ffi.Pointer Unit, + int Index, +) { + return _clang_getDiagnostic( + Unit, + Index, + ); +} + +final _dart_clang_getDiagnostic _clang_getDiagnostic = + _dylib.lookupFunction<_c_clang_getDiagnostic, _dart_clang_getDiagnostic>( + 'clang_getDiagnostic'); + +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, +); + +/// Retrieve the category number for this diagnostic. +int clang_getDiagnosticCategory( + ffi.Pointer arg0, +) { + return _clang_getDiagnosticCategory( + arg0, + ); +} + +final _dart_clang_getDiagnosticCategory _clang_getDiagnosticCategory = + _dylib.lookupFunction<_c_clang_getDiagnosticCategory, + _dart_clang_getDiagnosticCategory>('clang_getDiagnosticCategory'); + +typedef _c_clang_getDiagnosticCategory = ffi.Uint32 Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_getDiagnosticCategory = int Function( + ffi.Pointer arg0, +); + +/// Retrieve a diagnostic associated with the given CXDiagnosticSet. +ffi.Pointer clang_getDiagnosticInSet( + ffi.Pointer Diags, + int Index, +) { + return _clang_getDiagnosticInSet( + Diags, + Index, + ); +} + +final _dart_clang_getDiagnosticInSet _clang_getDiagnosticInSet = + _dylib.lookupFunction<_c_clang_getDiagnosticInSet, + _dart_clang_getDiagnosticInSet>('clang_getDiagnosticInSet'); + +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, +); + +/// Determine the number of fix-it hints associated with the given diagnostic. +int clang_getDiagnosticNumFixIts( + ffi.Pointer Diagnostic, +) { + return _clang_getDiagnosticNumFixIts( + Diagnostic, + ); +} + +final _dart_clang_getDiagnosticNumFixIts _clang_getDiagnosticNumFixIts = + _dylib.lookupFunction<_c_clang_getDiagnosticNumFixIts, + _dart_clang_getDiagnosticNumFixIts>('clang_getDiagnosticNumFixIts'); + +typedef _c_clang_getDiagnosticNumFixIts = ffi.Uint32 Function( + ffi.Pointer Diagnostic, +); + +typedef _dart_clang_getDiagnosticNumFixIts = int Function( + ffi.Pointer Diagnostic, +); + +/// Determine the number of source ranges associated with the given diagnostic. +int clang_getDiagnosticNumRanges( + ffi.Pointer arg0, +) { + return _clang_getDiagnosticNumRanges( + arg0, + ); +} + +final _dart_clang_getDiagnosticNumRanges _clang_getDiagnosticNumRanges = + _dylib.lookupFunction<_c_clang_getDiagnosticNumRanges, + _dart_clang_getDiagnosticNumRanges>('clang_getDiagnosticNumRanges'); + +typedef _c_clang_getDiagnosticNumRanges = ffi.Uint32 Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_getDiagnosticNumRanges = int Function( + ffi.Pointer arg0, +); + +/// Retrieve the complete set of diagnostics associated with a translation unit. +ffi.Pointer clang_getDiagnosticSetFromTU( + ffi.Pointer Unit, +) { + return _clang_getDiagnosticSetFromTU( + Unit, + ); +} + +final _dart_clang_getDiagnosticSetFromTU _clang_getDiagnosticSetFromTU = + _dylib.lookupFunction<_c_clang_getDiagnosticSetFromTU, + _dart_clang_getDiagnosticSetFromTU>('clang_getDiagnosticSetFromTU'); + +typedef _c_clang_getDiagnosticSetFromTU = ffi.Pointer Function( + ffi.Pointer Unit, +); + +typedef _dart_clang_getDiagnosticSetFromTU = ffi.Pointer Function( + ffi.Pointer Unit, +); + +/// Determine the severity of the given diagnostic. +int clang_getDiagnosticSeverity( + ffi.Pointer arg0, +) { + return _clang_getDiagnosticSeverity( + arg0, + ); +} + +final _dart_clang_getDiagnosticSeverity _clang_getDiagnosticSeverity = + _dylib.lookupFunction<_c_clang_getDiagnosticSeverity, + _dart_clang_getDiagnosticSeverity>('clang_getDiagnosticSeverity'); + +typedef _c_clang_getDiagnosticSeverity = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_getDiagnosticSeverity = int Function( + ffi.Pointer arg0, +); + +int clang_getEnumConstantDeclValue_wrap( + ffi.Pointer cursor, +) { + return _clang_getEnumConstantDeclValue_wrap( + cursor, + ); +} + +final _dart_clang_getEnumConstantDeclValue_wrap + _clang_getEnumConstantDeclValue_wrap = _dylib.lookupFunction< + _c_clang_getEnumConstantDeclValue_wrap, + _dart_clang_getEnumConstantDeclValue_wrap>( + 'clang_getEnumConstantDeclValue_wrap'); + +typedef _c_clang_getEnumConstantDeclValue_wrap = ffi.Int64 Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_getEnumConstantDeclValue_wrap = int Function( + ffi.Pointer cursor, +); + +/// Retrieve a file handle within the given translation unit. +ffi.Pointer clang_getFile( + ffi.Pointer tu, + ffi.Pointer file_name, +) { + return _clang_getFile( + tu, + file_name, + ); +} + +final _dart_clang_getFile _clang_getFile = _dylib + .lookupFunction<_c_clang_getFile, _dart_clang_getFile>('clang_getFile'); + +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, +); + +/// Retrieve the buffer associated with the given file. +ffi.Pointer clang_getFileContents( + ffi.Pointer tu, + ffi.Pointer file, + ffi.Pointer size, +) { + return _clang_getFileContents( + tu, + file, + size, + ); +} + +final _dart_clang_getFileContents _clang_getFileContents = _dylib + .lookupFunction<_c_clang_getFileContents, _dart_clang_getFileContents>( + 'clang_getFileContents'); + +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, +); + +void clang_getFileLocation_wrap( + ffi.Pointer location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +) { + return _clang_getFileLocation_wrap( + location, + file, + line, + column, + offset, + ); +} + +final _dart_clang_getFileLocation_wrap _clang_getFileLocation_wrap = + _dylib.lookupFunction<_c_clang_getFileLocation_wrap, + _dart_clang_getFileLocation_wrap>('clang_getFileLocation_wrap'); + +typedef _c_clang_getFileLocation_wrap = ffi.Void Function( + ffi.Pointer location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _dart_clang_getFileLocation_wrap = void Function( + ffi.Pointer location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +ffi.Pointer clang_getFileName_wrap( + ffi.Pointer SFile, +) { + return _clang_getFileName_wrap( + SFile, + ); +} + +final _dart_clang_getFileName_wrap _clang_getFileName_wrap = _dylib + .lookupFunction<_c_clang_getFileName_wrap, _dart_clang_getFileName_wrap>( + 'clang_getFileName_wrap'); + +typedef _c_clang_getFileName_wrap = ffi.Pointer Function( + ffi.Pointer SFile, +); + +typedef _dart_clang_getFileName_wrap = ffi.Pointer Function( + ffi.Pointer SFile, +); + +/// Retrieve the last modification time of the given file. +int clang_getFileTime( + ffi.Pointer SFile, +) { + return _clang_getFileTime( + SFile, + ); +} + +final _dart_clang_getFileTime _clang_getFileTime = + _dylib.lookupFunction<_c_clang_getFileTime, _dart_clang_getFileTime>( + 'clang_getFileTime'); + +typedef _c_clang_getFileTime = ffi.Int64 Function( + ffi.Pointer SFile, +); + +typedef _dart_clang_getFileTime = int Function( + ffi.Pointer SFile, +); + +/// Retrieve the unique ID for the given file. +int clang_getFileUniqueID( + ffi.Pointer file, + ffi.Pointer outID, +) { + return _clang_getFileUniqueID( + file, + outID, + ); +} + +final _dart_clang_getFileUniqueID _clang_getFileUniqueID = _dylib + .lookupFunction<_c_clang_getFileUniqueID, _dart_clang_getFileUniqueID>( + 'clang_getFileUniqueID'); + +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, +); + +/// 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( + tu, + visitor, + client_data, + ); +} + +final _dart_clang_getInclusions _clang_getInclusions = + _dylib.lookupFunction<_c_clang_getInclusions, _dart_clang_getInclusions>( + 'clang_getInclusions'); + +typedef _c_clang_getInclusions = ffi.Void Function( + ffi.Pointer tu, + ffi.Pointer> visitor, + ffi.Pointer client_data, +); + +typedef _dart_clang_getInclusions = void Function( + ffi.Pointer tu, + ffi.Pointer> visitor, + ffi.Pointer client_data, +); + +/// 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( + arg0, + arg1, + ); +} + +final _dart_clang_getModuleForFile _clang_getModuleForFile = _dylib + .lookupFunction<_c_clang_getModuleForFile, _dart_clang_getModuleForFile>( + 'clang_getModuleForFile'); + +typedef _c_clang_getModuleForFile = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +typedef _dart_clang_getModuleForFile = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +int clang_getNumArgTypes_wrap( + ffi.Pointer cxtype, +) { + return _clang_getNumArgTypes_wrap( + cxtype, + ); +} + +final _dart_clang_getNumArgTypes_wrap _clang_getNumArgTypes_wrap = + _dylib.lookupFunction<_c_clang_getNumArgTypes_wrap, + _dart_clang_getNumArgTypes_wrap>('clang_getNumArgTypes_wrap'); + +typedef _c_clang_getNumArgTypes_wrap = ffi.Int32 Function( + ffi.Pointer cxtype, +); + +typedef _dart_clang_getNumArgTypes_wrap = int Function( + ffi.Pointer cxtype, +); + +/// Retrieve the number of chunks in the given code-completion string. +int clang_getNumCompletionChunks( + ffi.Pointer completion_string, +) { + return _clang_getNumCompletionChunks( + completion_string, + ); +} + +final _dart_clang_getNumCompletionChunks _clang_getNumCompletionChunks = + _dylib.lookupFunction<_c_clang_getNumCompletionChunks, + _dart_clang_getNumCompletionChunks>('clang_getNumCompletionChunks'); + +typedef _c_clang_getNumCompletionChunks = ffi.Uint32 Function( + ffi.Pointer completion_string, +); + +typedef _dart_clang_getNumCompletionChunks = int Function( + ffi.Pointer completion_string, +); + +/// Determine the number of diagnostics produced for the given translation unit. +int clang_getNumDiagnostics( + ffi.Pointer Unit, +) { + return _clang_getNumDiagnostics( + Unit, + ); +} + +final _dart_clang_getNumDiagnostics _clang_getNumDiagnostics = _dylib + .lookupFunction<_c_clang_getNumDiagnostics, _dart_clang_getNumDiagnostics>( + 'clang_getNumDiagnostics'); + +typedef _c_clang_getNumDiagnostics = ffi.Uint32 Function( + ffi.Pointer Unit, +); + +typedef _dart_clang_getNumDiagnostics = int Function( + ffi.Pointer Unit, +); + +/// Determine the number of diagnostics in a CXDiagnosticSet. +int clang_getNumDiagnosticsInSet( + ffi.Pointer Diags, +) { + return _clang_getNumDiagnosticsInSet( + Diags, + ); +} + +final _dart_clang_getNumDiagnosticsInSet _clang_getNumDiagnosticsInSet = + _dylib.lookupFunction<_c_clang_getNumDiagnosticsInSet, + _dart_clang_getNumDiagnosticsInSet>('clang_getNumDiagnosticsInSet'); + +typedef _c_clang_getNumDiagnosticsInSet = ffi.Uint32 Function( + ffi.Pointer Diags, +); + +typedef _dart_clang_getNumDiagnosticsInSet = int Function( + ffi.Pointer Diags, +); + +int clang_getNumElements_wrap( + ffi.Pointer cxtype, +) { + return _clang_getNumElements_wrap( + cxtype, + ); +} + +final _dart_clang_getNumElements_wrap _clang_getNumElements_wrap = + _dylib.lookupFunction<_c_clang_getNumElements_wrap, + _dart_clang_getNumElements_wrap>('clang_getNumElements_wrap'); + +typedef _c_clang_getNumElements_wrap = ffi.Uint64 Function( + ffi.Pointer cxtype, +); + +typedef _dart_clang_getNumElements_wrap = int Function( + ffi.Pointer cxtype, +); + +ffi.Pointer clang_getPointeeType_wrap( + ffi.Pointer pointerType, +) { + return _clang_getPointeeType_wrap( + pointerType, + ); +} + +final _dart_clang_getPointeeType_wrap _clang_getPointeeType_wrap = + _dylib.lookupFunction<_c_clang_getPointeeType_wrap, + _dart_clang_getPointeeType_wrap>('clang_getPointeeType_wrap'); + +typedef _c_clang_getPointeeType_wrap = ffi.Pointer Function( + ffi.Pointer pointerType, +); + +typedef _dart_clang_getPointeeType_wrap = ffi.Pointer Function( + ffi.Pointer pointerType, +); + +/// Retrieve a remapping. +ffi.Pointer clang_getRemappings( + ffi.Pointer path, +) { + return _clang_getRemappings( + path, + ); +} + +final _dart_clang_getRemappings _clang_getRemappings = + _dylib.lookupFunction<_c_clang_getRemappings, _dart_clang_getRemappings>( + 'clang_getRemappings'); + +typedef _c_clang_getRemappings = ffi.Pointer Function( + ffi.Pointer path, +); + +typedef _dart_clang_getRemappings = ffi.Pointer Function( + ffi.Pointer path, +); + +/// Retrieve a remapping. +ffi.Pointer clang_getRemappingsFromFileList( + ffi.Pointer> filePaths, + int numFiles, +) { + return _clang_getRemappingsFromFileList( + filePaths, + numFiles, + ); +} + +final _dart_clang_getRemappingsFromFileList _clang_getRemappingsFromFileList = + _dylib.lookupFunction<_c_clang_getRemappingsFromFileList, + _dart_clang_getRemappingsFromFileList>( + 'clang_getRemappingsFromFileList'); + +typedef _c_clang_getRemappingsFromFileList = ffi.Pointer Function( + ffi.Pointer> filePaths, + ffi.Uint32 numFiles, +); + +typedef _dart_clang_getRemappingsFromFileList = ffi.Pointer Function( + ffi.Pointer> filePaths, + int numFiles, +); + +ffi.Pointer clang_getResultType_wrap( + ffi.Pointer functionType, +) { + return _clang_getResultType_wrap( + functionType, + ); +} + +final _dart_clang_getResultType_wrap _clang_getResultType_wrap = + _dylib.lookupFunction<_c_clang_getResultType_wrap, + _dart_clang_getResultType_wrap>('clang_getResultType_wrap'); + +typedef _c_clang_getResultType_wrap = ffi.Pointer Function( + ffi.Pointer functionType, +); + +typedef _dart_clang_getResultType_wrap = ffi.Pointer Function( + ffi.Pointer functionType, +); + +/// Retrieve all ranges that were skipped by the preprocessor. +ffi.Pointer clang_getSkippedRanges( + ffi.Pointer tu, + ffi.Pointer file, +) { + return _clang_getSkippedRanges( + tu, + file, + ); +} + +final _dart_clang_getSkippedRanges _clang_getSkippedRanges = _dylib + .lookupFunction<_c_clang_getSkippedRanges, _dart_clang_getSkippedRanges>( + 'clang_getSkippedRanges'); + +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, +); + +/// Returns the human-readable null-terminated C string that represents the name of the memory category. This string should never be freed. +ffi.Pointer clang_getTUResourceUsageName( + int kind, +) { + return _clang_getTUResourceUsageName( + kind, + ); +} + +final _dart_clang_getTUResourceUsageName _clang_getTUResourceUsageName = + _dylib.lookupFunction<_c_clang_getTUResourceUsageName, + _dart_clang_getTUResourceUsageName>('clang_getTUResourceUsageName'); + +typedef _c_clang_getTUResourceUsageName = ffi.Pointer Function( + ffi.Int32 kind, +); + +typedef _dart_clang_getTUResourceUsageName = ffi.Pointer Function( + int kind, +); + +ffi.Pointer clang_getTranslationUnitCursor_wrap( + ffi.Pointer tu, +) { + return _clang_getTranslationUnitCursor_wrap( + tu, + ); +} + +final _dart_clang_getTranslationUnitCursor_wrap + _clang_getTranslationUnitCursor_wrap = _dylib.lookupFunction< + _c_clang_getTranslationUnitCursor_wrap, + _dart_clang_getTranslationUnitCursor_wrap>( + 'clang_getTranslationUnitCursor_wrap'); + +typedef _c_clang_getTranslationUnitCursor_wrap = ffi.Pointer Function( + ffi.Pointer tu, +); + +typedef _dart_clang_getTranslationUnitCursor_wrap = ffi.Pointer + Function( + ffi.Pointer tu, +); + +/// Get target information for this translation unit. +ffi.Pointer clang_getTranslationUnitTargetInfo( + ffi.Pointer CTUnit, +) { + return _clang_getTranslationUnitTargetInfo( + CTUnit, + ); +} + +final _dart_clang_getTranslationUnitTargetInfo + _clang_getTranslationUnitTargetInfo = _dylib.lookupFunction< + _c_clang_getTranslationUnitTargetInfo, + _dart_clang_getTranslationUnitTargetInfo>( + 'clang_getTranslationUnitTargetInfo'); + +typedef _c_clang_getTranslationUnitTargetInfo = ffi.Pointer + Function( + ffi.Pointer CTUnit, +); + +typedef _dart_clang_getTranslationUnitTargetInfo = ffi.Pointer + Function( + ffi.Pointer CTUnit, +); + +ffi.Pointer clang_getTypeDeclaration_wrap( + ffi.Pointer cxtype, +) { + return _clang_getTypeDeclaration_wrap( + cxtype, + ); +} + +final _dart_clang_getTypeDeclaration_wrap _clang_getTypeDeclaration_wrap = + _dylib.lookupFunction<_c_clang_getTypeDeclaration_wrap, + _dart_clang_getTypeDeclaration_wrap>('clang_getTypeDeclaration_wrap'); + +typedef _c_clang_getTypeDeclaration_wrap = ffi.Pointer Function( + ffi.Pointer cxtype, +); + +typedef _dart_clang_getTypeDeclaration_wrap = ffi.Pointer Function( + ffi.Pointer cxtype, +); + +ffi.Pointer clang_getTypeKindSpelling_wrap( + int typeKind, +) { + return _clang_getTypeKindSpelling_wrap( + typeKind, + ); +} + +final _dart_clang_getTypeKindSpelling_wrap _clang_getTypeKindSpelling_wrap = + _dylib.lookupFunction<_c_clang_getTypeKindSpelling_wrap, + _dart_clang_getTypeKindSpelling_wrap>('clang_getTypeKindSpelling_wrap'); + +typedef _c_clang_getTypeKindSpelling_wrap = ffi.Pointer Function( + ffi.Int32 typeKind, +); + +typedef _dart_clang_getTypeKindSpelling_wrap = ffi.Pointer Function( + int typeKind, +); + +ffi.Pointer clang_getTypeSpelling_wrap( + ffi.Pointer type, +) { + return _clang_getTypeSpelling_wrap( + type, + ); +} + +final _dart_clang_getTypeSpelling_wrap _clang_getTypeSpelling_wrap = + _dylib.lookupFunction<_c_clang_getTypeSpelling_wrap, + _dart_clang_getTypeSpelling_wrap>('clang_getTypeSpelling_wrap'); + +typedef _c_clang_getTypeSpelling_wrap = ffi.Pointer Function( + ffi.Pointer type, +); + +typedef _dart_clang_getTypeSpelling_wrap = ffi.Pointer Function( + ffi.Pointer type, +); + +ffi.Pointer clang_getTypedefDeclUnderlyingType_wrap( + ffi.Pointer cxcursor, +) { + return _clang_getTypedefDeclUnderlyingType_wrap( + cxcursor, + ); +} + +final _dart_clang_getTypedefDeclUnderlyingType_wrap + _clang_getTypedefDeclUnderlyingType_wrap = _dylib.lookupFunction< + _c_clang_getTypedefDeclUnderlyingType_wrap, + _dart_clang_getTypedefDeclUnderlyingType_wrap>( + 'clang_getTypedefDeclUnderlyingType_wrap'); + +typedef _c_clang_getTypedefDeclUnderlyingType_wrap = ffi.Pointer + Function( + ffi.Pointer cxcursor, +); + +typedef _dart_clang_getTypedefDeclUnderlyingType_wrap = ffi.Pointer + Function( + ffi.Pointer cxcursor, +); + +/// 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( + 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, + ); +} + +final _dart_clang_indexSourceFile _clang_indexSourceFile = _dylib + .lookupFunction<_c_clang_indexSourceFile, _dart_clang_indexSourceFile>( + 'clang_indexSourceFile'); + +typedef _c_clang_indexSourceFile = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer client_data, + ffi.Pointer index_callbacks, + ffi.Uint32 index_callbacks_size, + ffi.Uint32 index_options, + 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.Pointer> out_TU, + ffi.Uint32 TU_options, +); + +typedef _dart_clang_indexSourceFile = int Function( + 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, +); + +/// 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( + 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, + ); +} + +final _dart_clang_indexSourceFileFullArgv _clang_indexSourceFileFullArgv = + _dylib.lookupFunction<_c_clang_indexSourceFileFullArgv, + _dart_clang_indexSourceFileFullArgv>('clang_indexSourceFileFullArgv'); + +typedef _c_clang_indexSourceFileFullArgv = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer client_data, + ffi.Pointer index_callbacks, + ffi.Uint32 index_callbacks_size, + ffi.Uint32 index_options, + 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.Pointer> out_TU, + ffi.Uint32 TU_options, +); + +typedef _dart_clang_indexSourceFileFullArgv = int Function( + 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, +); + +/// 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( + arg0, + client_data, + index_callbacks, + index_callbacks_size, + index_options, + arg5, + ); +} + +final _dart_clang_indexTranslationUnit _clang_indexTranslationUnit = + _dylib.lookupFunction<_c_clang_indexTranslationUnit, + _dart_clang_indexTranslationUnit>('clang_indexTranslationUnit'); + +typedef _c_clang_indexTranslationUnit = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer client_data, + ffi.Pointer index_callbacks, + ffi.Uint32 index_callbacks_size, + ffi.Uint32 index_options, + ffi.Pointer arg5, +); + +typedef _dart_clang_indexTranslationUnit = int Function( + ffi.Pointer arg0, + ffi.Pointer client_data, + ffi.Pointer index_callbacks, + int index_callbacks_size, + int index_options, + ffi.Pointer arg5, +); + +ffi.Pointer clang_index_getCXXClassDeclInfo( + ffi.Pointer arg0, +) { + return _clang_index_getCXXClassDeclInfo( + arg0, + ); +} + +final _dart_clang_index_getCXXClassDeclInfo _clang_index_getCXXClassDeclInfo = + _dylib.lookupFunction<_c_clang_index_getCXXClassDeclInfo, + _dart_clang_index_getCXXClassDeclInfo>( + 'clang_index_getCXXClassDeclInfo'); + +typedef _c_clang_index_getCXXClassDeclInfo = ffi.Pointer + Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_index_getCXXClassDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +/// For retrieving a custom CXIdxClientContainer attached to a container. +ffi.Pointer clang_index_getClientContainer( + ffi.Pointer arg0, +) { + return _clang_index_getClientContainer( + arg0, + ); +} + +final _dart_clang_index_getClientContainer _clang_index_getClientContainer = + _dylib.lookupFunction<_c_clang_index_getClientContainer, + _dart_clang_index_getClientContainer>('clang_index_getClientContainer'); + +typedef _c_clang_index_getClientContainer = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_index_getClientContainer = ffi.Pointer Function( + ffi.Pointer arg0, +); + +/// For retrieving a custom CXIdxClientEntity attached to an entity. +ffi.Pointer clang_index_getClientEntity( + ffi.Pointer arg0, +) { + return _clang_index_getClientEntity( + arg0, + ); +} + +final _dart_clang_index_getClientEntity _clang_index_getClientEntity = + _dylib.lookupFunction<_c_clang_index_getClientEntity, + _dart_clang_index_getClientEntity>('clang_index_getClientEntity'); + +typedef _c_clang_index_getClientEntity = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_index_getClientEntity = ffi.Pointer Function( + ffi.Pointer arg0, +); + +ffi.Pointer + clang_index_getIBOutletCollectionAttrInfo( + ffi.Pointer arg0, +) { + return _clang_index_getIBOutletCollectionAttrInfo( + arg0, + ); +} + +final _dart_clang_index_getIBOutletCollectionAttrInfo + _clang_index_getIBOutletCollectionAttrInfo = _dylib.lookupFunction< + _c_clang_index_getIBOutletCollectionAttrInfo, + _dart_clang_index_getIBOutletCollectionAttrInfo>( + 'clang_index_getIBOutletCollectionAttrInfo'); + +typedef _c_clang_index_getIBOutletCollectionAttrInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_index_getIBOutletCollectionAttrInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +ffi.Pointer clang_index_getObjCCategoryDeclInfo( + ffi.Pointer arg0, +) { + return _clang_index_getObjCCategoryDeclInfo( + arg0, + ); +} + +final _dart_clang_index_getObjCCategoryDeclInfo + _clang_index_getObjCCategoryDeclInfo = _dylib.lookupFunction< + _c_clang_index_getObjCCategoryDeclInfo, + _dart_clang_index_getObjCCategoryDeclInfo>( + 'clang_index_getObjCCategoryDeclInfo'); + +typedef _c_clang_index_getObjCCategoryDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_index_getObjCCategoryDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +ffi.Pointer clang_index_getObjCContainerDeclInfo( + ffi.Pointer arg0, +) { + return _clang_index_getObjCContainerDeclInfo( + arg0, + ); +} + +final _dart_clang_index_getObjCContainerDeclInfo + _clang_index_getObjCContainerDeclInfo = _dylib.lookupFunction< + _c_clang_index_getObjCContainerDeclInfo, + _dart_clang_index_getObjCContainerDeclInfo>( + 'clang_index_getObjCContainerDeclInfo'); + +typedef _c_clang_index_getObjCContainerDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_index_getObjCContainerDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +ffi.Pointer clang_index_getObjCInterfaceDeclInfo( + ffi.Pointer arg0, +) { + return _clang_index_getObjCInterfaceDeclInfo( + arg0, + ); +} + +final _dart_clang_index_getObjCInterfaceDeclInfo + _clang_index_getObjCInterfaceDeclInfo = _dylib.lookupFunction< + _c_clang_index_getObjCInterfaceDeclInfo, + _dart_clang_index_getObjCInterfaceDeclInfo>( + 'clang_index_getObjCInterfaceDeclInfo'); + +typedef _c_clang_index_getObjCInterfaceDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_index_getObjCInterfaceDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +ffi.Pointer clang_index_getObjCPropertyDeclInfo( + ffi.Pointer arg0, +) { + return _clang_index_getObjCPropertyDeclInfo( + arg0, + ); +} + +final _dart_clang_index_getObjCPropertyDeclInfo + _clang_index_getObjCPropertyDeclInfo = _dylib.lookupFunction< + _c_clang_index_getObjCPropertyDeclInfo, + _dart_clang_index_getObjCPropertyDeclInfo>( + 'clang_index_getObjCPropertyDeclInfo'); + +typedef _c_clang_index_getObjCPropertyDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_index_getObjCPropertyDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +ffi.Pointer + clang_index_getObjCProtocolRefListInfo( + ffi.Pointer arg0, +) { + return _clang_index_getObjCProtocolRefListInfo( + arg0, + ); +} + +final _dart_clang_index_getObjCProtocolRefListInfo + _clang_index_getObjCProtocolRefListInfo = _dylib.lookupFunction< + _c_clang_index_getObjCProtocolRefListInfo, + _dart_clang_index_getObjCProtocolRefListInfo>( + 'clang_index_getObjCProtocolRefListInfo'); + +typedef _c_clang_index_getObjCProtocolRefListInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_index_getObjCProtocolRefListInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +int clang_index_isEntityObjCContainerKind( + int arg0, +) { + return _clang_index_isEntityObjCContainerKind( + arg0, + ); +} + +final _dart_clang_index_isEntityObjCContainerKind + _clang_index_isEntityObjCContainerKind = _dylib.lookupFunction< + _c_clang_index_isEntityObjCContainerKind, + _dart_clang_index_isEntityObjCContainerKind>( + 'clang_index_isEntityObjCContainerKind'); + +typedef _c_clang_index_isEntityObjCContainerKind = ffi.Int32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_index_isEntityObjCContainerKind = int Function( + int arg0, +); + +/// For setting a custom CXIdxClientContainer attached to a container. +void clang_index_setClientContainer( + ffi.Pointer arg0, + ffi.Pointer arg1, +) { + return _clang_index_setClientContainer( + arg0, + arg1, + ); +} + +final _dart_clang_index_setClientContainer _clang_index_setClientContainer = + _dylib.lookupFunction<_c_clang_index_setClientContainer, + _dart_clang_index_setClientContainer>('clang_index_setClientContainer'); + +typedef _c_clang_index_setClientContainer = ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +typedef _dart_clang_index_setClientContainer = void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +/// For setting a custom CXIdxClientEntity attached to an entity. +void clang_index_setClientEntity( + ffi.Pointer arg0, + ffi.Pointer arg1, +) { + return _clang_index_setClientEntity( + arg0, + arg1, + ); +} + +final _dart_clang_index_setClientEntity _clang_index_setClientEntity = + _dylib.lookupFunction<_c_clang_index_setClientEntity, + _dart_clang_index_setClientEntity>('clang_index_setClientEntity'); + +typedef _c_clang_index_setClientEntity = ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +typedef _dart_clang_index_setClientEntity = void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +/// Determine whether the given cursor kind represents an attribute. +int clang_isAttribute( + int arg0, +) { + return _clang_isAttribute( + arg0, + ); +} + +final _dart_clang_isAttribute _clang_isAttribute = + _dylib.lookupFunction<_c_clang_isAttribute, _dart_clang_isAttribute>( + 'clang_isAttribute'); + +typedef _c_clang_isAttribute = ffi.Uint32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_isAttribute = int Function( + int arg0, +); + +/// Determine whether the given cursor kind represents a declaration. +int clang_isDeclaration( + int arg0, +) { + return _clang_isDeclaration( + arg0, + ); +} + +final _dart_clang_isDeclaration _clang_isDeclaration = + _dylib.lookupFunction<_c_clang_isDeclaration, _dart_clang_isDeclaration>( + 'clang_isDeclaration'); + +typedef _c_clang_isDeclaration = ffi.Uint32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_isDeclaration = int Function( + int arg0, +); + +/// Determine whether the given cursor kind represents an expression. +int clang_isExpression( + int arg0, +) { + return _clang_isExpression( + arg0, + ); +} + +final _dart_clang_isExpression _clang_isExpression = + _dylib.lookupFunction<_c_clang_isExpression, _dart_clang_isExpression>( + 'clang_isExpression'); + +typedef _c_clang_isExpression = ffi.Uint32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_isExpression = int Function( + int arg0, +); + +/// Determine whether the given header is guarded against multiple inclusions, either with the conventional #ifndef/#define/#endif macro guards or with #pragma once. +int clang_isFileMultipleIncludeGuarded( + ffi.Pointer tu, + ffi.Pointer file, +) { + return _clang_isFileMultipleIncludeGuarded( + tu, + file, + ); +} + +final _dart_clang_isFileMultipleIncludeGuarded + _clang_isFileMultipleIncludeGuarded = _dylib.lookupFunction< + _c_clang_isFileMultipleIncludeGuarded, + _dart_clang_isFileMultipleIncludeGuarded>( + 'clang_isFileMultipleIncludeGuarded'); + +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, +); + +/// Determine whether the given cursor kind represents an invalid cursor. +int clang_isInvalid( + int arg0, +) { + return _clang_isInvalid( + arg0, + ); +} + +final _dart_clang_isInvalid _clang_isInvalid = + _dylib.lookupFunction<_c_clang_isInvalid, _dart_clang_isInvalid>( + 'clang_isInvalid'); + +typedef _c_clang_isInvalid = ffi.Uint32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_isInvalid = int Function( + int arg0, +); + +/// * Determine whether the given cursor represents a preprocessing element, such as a preprocessor directive or macro instantiation. +int clang_isPreprocessing( + int arg0, +) { + return _clang_isPreprocessing( + arg0, + ); +} + +final _dart_clang_isPreprocessing _clang_isPreprocessing = _dylib + .lookupFunction<_c_clang_isPreprocessing, _dart_clang_isPreprocessing>( + 'clang_isPreprocessing'); + +typedef _c_clang_isPreprocessing = ffi.Uint32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_isPreprocessing = int Function( + int arg0, +); + +/// Determine whether the given cursor kind represents a simple reference. +int clang_isReference( + int arg0, +) { + return _clang_isReference( + arg0, + ); +} + +final _dart_clang_isReference _clang_isReference = + _dylib.lookupFunction<_c_clang_isReference, _dart_clang_isReference>( + 'clang_isReference'); + +typedef _c_clang_isReference = ffi.Uint32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_isReference = int Function( + int arg0, +); + +/// Determine whether the given cursor kind represents a statement. +int clang_isStatement( + int arg0, +) { + return _clang_isStatement( + arg0, + ); +} + +final _dart_clang_isStatement _clang_isStatement = + _dylib.lookupFunction<_c_clang_isStatement, _dart_clang_isStatement>( + 'clang_isStatement'); + +typedef _c_clang_isStatement = ffi.Uint32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_isStatement = int Function( + int arg0, +); + +/// Determine whether the given cursor kind represents a translation unit. +int clang_isTranslationUnit( + int arg0, +) { + return _clang_isTranslationUnit( + arg0, + ); +} + +final _dart_clang_isTranslationUnit _clang_isTranslationUnit = _dylib + .lookupFunction<_c_clang_isTranslationUnit, _dart_clang_isTranslationUnit>( + 'clang_isTranslationUnit'); + +typedef _c_clang_isTranslationUnit = ffi.Uint32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_isTranslationUnit = int Function( + int arg0, +); + +/// * Determine whether the given cursor represents a currently unexposed piece of the AST (e.g., CXCursor_UnexposedStmt). +int clang_isUnexposed( + int arg0, +) { + return _clang_isUnexposed( + arg0, + ); +} + +final _dart_clang_isUnexposed _clang_isUnexposed = + _dylib.lookupFunction<_c_clang_isUnexposed, _dart_clang_isUnexposed>( + 'clang_isUnexposed'); + +typedef _c_clang_isUnexposed = ffi.Uint32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_isUnexposed = int Function( + int arg0, +); + +/// Deserialize a set of diagnostics from a Clang diagnostics bitcode file. +ffi.Pointer clang_loadDiagnostics( + ffi.Pointer file, + ffi.Pointer error, + ffi.Pointer errorString, +) { + return _clang_loadDiagnostics( + file, + error, + errorString, + ); +} + +final _dart_clang_loadDiagnostics _clang_loadDiagnostics = _dylib + .lookupFunction<_c_clang_loadDiagnostics, _dart_clang_loadDiagnostics>( + 'clang_loadDiagnostics'); + +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, +); + +/// Same as clang_parseTranslationUnit2, but returns the CXTranslationUnit instead of an error code. In case of an error this routine returns a NULL CXTranslationUnit, without further detailed error codes. +ffi.Pointer clang_parseTranslationUnit( + 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, +) { + return _clang_parseTranslationUnit( + CIdx, + source_filename, + command_line_args, + num_command_line_args, + unsaved_files, + num_unsaved_files, + options, + ); +} + +final _dart_clang_parseTranslationUnit _clang_parseTranslationUnit = + _dylib.lookupFunction<_c_clang_parseTranslationUnit, + _dart_clang_parseTranslationUnit>('clang_parseTranslationUnit'); + +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, +); + +/// Parse the given source file and the translation unit corresponding to that file. +int clang_parseTranslationUnit2( + 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, +) { + return _clang_parseTranslationUnit2( + CIdx, + source_filename, + command_line_args, + num_command_line_args, + unsaved_files, + num_unsaved_files, + options, + out_TU, + ); +} + +final _dart_clang_parseTranslationUnit2 _clang_parseTranslationUnit2 = + _dylib.lookupFunction<_c_clang_parseTranslationUnit2, + _dart_clang_parseTranslationUnit2>('clang_parseTranslationUnit2'); + +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, +); + +/// Same as clang_parseTranslationUnit2 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_parseTranslationUnit2FullArgv( + 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, +) { + return _clang_parseTranslationUnit2FullArgv( + CIdx, + source_filename, + command_line_args, + num_command_line_args, + unsaved_files, + num_unsaved_files, + options, + out_TU, + ); +} + +final _dart_clang_parseTranslationUnit2FullArgv + _clang_parseTranslationUnit2FullArgv = _dylib.lookupFunction< + _c_clang_parseTranslationUnit2FullArgv, + _dart_clang_parseTranslationUnit2FullArgv>( + 'clang_parseTranslationUnit2FullArgv'); + +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, +); + +/// Dispose the remapping. +void clang_remap_dispose( + ffi.Pointer arg0, +) { + return _clang_remap_dispose( + arg0, + ); +} + +final _dart_clang_remap_dispose _clang_remap_dispose = + _dylib.lookupFunction<_c_clang_remap_dispose, _dart_clang_remap_dispose>( + 'clang_remap_dispose'); + +typedef _c_clang_remap_dispose = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_remap_dispose = void Function( + ffi.Pointer arg0, +); + +/// 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( + arg0, + index, + original, + transformed, + ); +} + +final _dart_clang_remap_getFilenames _clang_remap_getFilenames = + _dylib.lookupFunction<_c_clang_remap_getFilenames, + _dart_clang_remap_getFilenames>('clang_remap_getFilenames'); + +typedef _c_clang_remap_getFilenames = ffi.Void Function( + ffi.Pointer arg0, + ffi.Uint32 index, + ffi.Pointer original, + ffi.Pointer transformed, +); + +typedef _dart_clang_remap_getFilenames = void Function( + ffi.Pointer arg0, + int index, + ffi.Pointer original, + ffi.Pointer transformed, +); + +/// Determine the number of remappings. +int clang_remap_getNumFiles( + ffi.Pointer arg0, +) { + return _clang_remap_getNumFiles( + arg0, + ); +} + +final _dart_clang_remap_getNumFiles _clang_remap_getNumFiles = _dylib + .lookupFunction<_c_clang_remap_getNumFiles, _dart_clang_remap_getNumFiles>( + 'clang_remap_getNumFiles'); + +typedef _c_clang_remap_getNumFiles = ffi.Uint32 Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_remap_getNumFiles = int Function( + ffi.Pointer arg0, +); + +/// Reparse the source files that produced this translation unit. +int clang_reparseTranslationUnit( + ffi.Pointer TU, + int num_unsaved_files, + ffi.Pointer unsaved_files, + int options, +) { + return _clang_reparseTranslationUnit( + TU, + num_unsaved_files, + unsaved_files, + options, + ); +} + +final _dart_clang_reparseTranslationUnit _clang_reparseTranslationUnit = + _dylib.lookupFunction<_c_clang_reparseTranslationUnit, + _dart_clang_reparseTranslationUnit>('clang_reparseTranslationUnit'); + +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, +); + +/// Saves a translation unit into a serialized representation of that translation unit on disk. +int clang_saveTranslationUnit( + ffi.Pointer TU, + ffi.Pointer FileName, + int options, +) { + return _clang_saveTranslationUnit( + TU, + FileName, + options, + ); +} + +final _dart_clang_saveTranslationUnit _clang_saveTranslationUnit = + _dylib.lookupFunction<_c_clang_saveTranslationUnit, + _dart_clang_saveTranslationUnit>('clang_saveTranslationUnit'); + +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, +); + +/// Sort the code-completion results in case-insensitive alphabetical order. +void clang_sortCodeCompletionResults( + ffi.Pointer Results, + int NumResults, +) { + return _clang_sortCodeCompletionResults( + Results, + NumResults, + ); +} + +final _dart_clang_sortCodeCompletionResults _clang_sortCodeCompletionResults = + _dylib.lookupFunction<_c_clang_sortCodeCompletionResults, + _dart_clang_sortCodeCompletionResults>( + 'clang_sortCodeCompletionResults'); + +typedef _c_clang_sortCodeCompletionResults = ffi.Void Function( + ffi.Pointer Results, + ffi.Uint32 NumResults, +); + +typedef _dart_clang_sortCodeCompletionResults = void Function( + ffi.Pointer Results, + int NumResults, +); + +/// Suspend a translation unit in order to free memory associated with it. +int clang_suspendTranslationUnit( + ffi.Pointer arg0, +) { + return _clang_suspendTranslationUnit( + arg0, + ); +} + +final _dart_clang_suspendTranslationUnit _clang_suspendTranslationUnit = + _dylib.lookupFunction<_c_clang_suspendTranslationUnit, + _dart_clang_suspendTranslationUnit>('clang_suspendTranslationUnit'); + +typedef _c_clang_suspendTranslationUnit = ffi.Uint32 Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_suspendTranslationUnit = int Function( + ffi.Pointer arg0, +); + +/// Enable/disable crash recovery. +void clang_toggleCrashRecovery( + int isEnabled, +) { + return _clang_toggleCrashRecovery( + isEnabled, + ); +} + +final _dart_clang_toggleCrashRecovery _clang_toggleCrashRecovery = + _dylib.lookupFunction<_c_clang_toggleCrashRecovery, + _dart_clang_toggleCrashRecovery>('clang_toggleCrashRecovery'); + +typedef _c_clang_toggleCrashRecovery = ffi.Void Function( + ffi.Uint32 isEnabled, +); + +typedef _dart_clang_toggleCrashRecovery = void Function( + int isEnabled, +); + +/// Visitor is a function pointer with parameters having pointers to cxcursor instead of cxcursor by default. +int clang_visitChildren_wrap( + ffi.Pointer parent, + ffi.Pointer> _modifiedVisitor, + ffi.Pointer clientData, +) { + return _clang_visitChildren_wrap( + parent, + _modifiedVisitor, + clientData, + ); +} + +final _dart_clang_visitChildren_wrap _clang_visitChildren_wrap = + _dylib.lookupFunction<_c_clang_visitChildren_wrap, + _dart_clang_visitChildren_wrap>('clang_visitChildren_wrap'); + +typedef _c_clang_visitChildren_wrap = ffi.Uint32 Function( + ffi.Pointer parent, + ffi.Pointer> _modifiedVisitor, + ffi.Pointer clientData, +); + +typedef _dart_clang_visitChildren_wrap = int Function( + ffi.Pointer parent, + ffi.Pointer> _modifiedVisitor, + ffi.Pointer clientData, +); diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml new file mode 100644 index 0000000000..bd000c6934 --- /dev/null +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -0,0 +1,63 @@ +# Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +name: libclang_example + +environment: + sdk: '>=2.8.1 <3.0.0' + +dev_dependencies: + ffigen: + path: '../../' + +ffigen: + output: 'generated_bindings.dart' + sort: true + + # Bash style Glob matching is also supported. + # TODO(11): Globs dont work on windows if they begin with '.' or '..'. + headers: + - '../../tool/wrapped_libclang/wrapper.c' + + # Excludes included headers based on their names (not fullpath name). + header-filter: + include: + - 'wrapper.c' + - 'CXString.h' + - 'Index.h' + + compiler-opts: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -IC:\Progra~1\LLVM\include -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/' + functions: + include: + matches: + # Should be valid regexp. + - 'clang_.*' + structs: + include: + matches: + - 'CX.*' + enums: + include: + # Compares the exact name. + names: + - 'CXTypeKind' + - 'CXGlobalOptFlags' + + # These are optional and also default, + # Omitting any and the default will be used. + size-map: + char: 1 + unsigned char: 1 + short: 2 + unsigned short: 2 + int: 4 + unsigned int: 4 + long: 8 + unsigned long: 8 + long long: 8 + unsigned long long: 8 + enum: 4 + + # True by default + extract-comments: true diff --git a/pkgs/ffigen/example/libclang-example/readme.md b/pkgs/ffigen/example/libclang-example/readme.md new file mode 100644 index 0000000000..4918a378bd --- /dev/null +++ b/pkgs/ffigen/example/libclang-example/readme.md @@ -0,0 +1,11 @@ +# Libclang example + +Demonstrates generating bindings for [Libclang](https://clang.llvm.org/doxygen/group__CINDEX.html). +This example actually uses a C file used in this package itself, ([wrapper.c](../../tool/wrapped_libclang/wrapper.c)), which adds a few more wrapper functions atop Libclang. + +## Generating bindings +At the root of this example (`example/libclang-example`), run - +``` +pub run ffigen:generate +``` +This will generate bindings in a file: [generated_bindings.dart](./generated_bindings.dart). diff --git a/pkgs/ffigen/example/simple/.gitignore b/pkgs/ffigen/example/simple/.gitignore new file mode 100644 index 0000000000..1b05164275 --- /dev/null +++ b/pkgs/ffigen/example/simple/.gitignore @@ -0,0 +1,11 @@ +# Files and directories created by pub. +.dart_tool/ +.packages +# Remove the following pattern if you wish to check in your lock file. +pubspec.lock + +# Conventional directory for build outputs. +build/ + +# Directory created by dartdoc. +doc/api/ diff --git a/pkgs/ffigen/example/simple/README.md b/pkgs/ffigen/example/simple/README.md new file mode 100644 index 0000000000..6fc5243e16 --- /dev/null +++ b/pkgs/ffigen/example/simple/README.md @@ -0,0 +1,10 @@ +# Simple header example + +A very simple example, generates bindings for a very small header file (`headers/example.h`). + +## Generating bindings +At the root of this example (`example/simple`), run - +``` +pub run ffigen:generate +``` +This will generate bindings in a file: [generated_bindings.dart](./generated_bindings.dart). diff --git a/pkgs/ffigen/example/simple/generated_bindings.dart b/pkgs/ffigen/example/simple/generated_bindings.dart new file mode 100644 index 0000000000..6e3a97b87e --- /dev/null +++ b/pkgs/ffigen/example/simple/generated_bindings.dart @@ -0,0 +1,132 @@ +/// AUTO GENERATED FILE, DO NOT EDIT. +/// +/// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Holds the Dynamic library. +ffi.DynamicLibrary _dylib; + +/// Initialises the Dynamic library. +void init(ffi.DynamicLibrary dylib) { + _dylib = dylib; +} + +/// Adds 2 integers. +int sum( + int a, + int b, +) { + return _sum( + a, + b, + ); +} + +final _dart_sum _sum = _dylib.lookupFunction<_c_sum, _dart_sum>('sum'); + +typedef _c_sum = ffi.Int32 Function( + ffi.Int32 a, + ffi.Int32 b, +); + +typedef _dart_sum = int Function( + int a, + int b, +); + +/// Subtracts 2 integers. +int subtract( + ffi.Pointer a, + int b, +) { + return _subtract( + a, + b, + ); +} + +final _dart_subtract _subtract = + _dylib.lookupFunction<_c_subtract, _dart_subtract>('subtract'); + +typedef _c_subtract = ffi.Int32 Function( + ffi.Pointer a, + ffi.Int32 b, +); + +typedef _dart_subtract = int Function( + ffi.Pointer a, + int b, +); + +/// Multiplies 2 integers, returns pointer to an integer,. +ffi.Pointer multiply( + int a, + int b, +) { + return _multiply( + a, + b, + ); +} + +final _dart_multiply _multiply = + _dylib.lookupFunction<_c_multiply, _dart_multiply>('multiply'); + +typedef _c_multiply = ffi.Pointer Function( + ffi.Int32 a, + ffi.Int32 b, +); + +typedef _dart_multiply = ffi.Pointer Function( + int a, + int b, +); + +/// Divides 2 integers, returns pointer to a float. +ffi.Pointer divide( + int a, + int b, +) { + return _divide( + a, + b, + ); +} + +final _dart_divide _divide = + _dylib.lookupFunction<_c_divide, _dart_divide>('divide'); + +typedef _c_divide = ffi.Pointer Function( + ffi.Int32 a, + ffi.Int32 b, +); + +typedef _dart_divide = ffi.Pointer Function( + int a, + int b, +); + +/// Divides 2 floats, returns a pointer to double. +ffi.Pointer dividePercision( + ffi.Pointer a, + ffi.Pointer b, +) { + return _dividePercision( + a, + b, + ); +} + +final _dart_dividePercision _dividePercision = + _dylib.lookupFunction<_c_dividePercision, _dart_dividePercision>( + 'dividePercision'); + +typedef _c_dividePercision = ffi.Pointer Function( + ffi.Pointer a, + ffi.Pointer b, +); + +typedef _dart_dividePercision = ffi.Pointer Function( + ffi.Pointer a, + ffi.Pointer b, +); diff --git a/pkgs/ffigen/example/simple/headers/example.h b/pkgs/ffigen/example/simple/headers/example.h new file mode 100644 index 0000000000..0f936ee33c --- /dev/null +++ b/pkgs/ffigen/example/simple/headers/example.h @@ -0,0 +1,18 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** Adds 2 integers. */ +int sum(int a, int b); + +/** Subtracts 2 integers. */ +int subtract(int *a, int b); + +/** Multiplies 2 integers, returns pointer to an integer,. */ +int *multiply(int a, int b); + +/** Divides 2 integers, returns pointer to a float. */ +float *divide(int a, int b); + +/** Divides 2 floats, returns a pointer to double. */ +double *dividePercision(float *a, float *b); diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml new file mode 100644 index 0000000000..454c138f9c --- /dev/null +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -0,0 +1,17 @@ +# Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +name: simple_example + +environment: + sdk: '>=2.8.1 <3.0.0' + +dev_dependencies: + ffigen: + path: '../../' + +ffigen: + output: 'generated_bindings.dart' + headers: + - 'headers/example.h' diff --git a/pkgs/ffigen/lib/src/README.md b/pkgs/ffigen/lib/src/README.md new file mode 100644 index 0000000000..2832400eb5 --- /dev/null +++ b/pkgs/ffigen/lib/src/README.md @@ -0,0 +1,41 @@ +## Project Structure + +- `bin` - Contains generate.dart script which end user will execute. +- `tool` - Contains script to generate LibClang bindings using Code_Generator submodule (dev use only). +- `example` - Example projects which demonstrate generation of bindings for given C header files. +- `lib/src/code_generator` - Generates binding files. +- `lib/src/config_provider` - Holds configurations to be passed to other modules. +- `lib/src/header_parser` - Parses header files, utilises clang_bindings. + +## Basic Workflow +1. The User provides the location all the header files (as a list of globs or filepaths), +For each header file, we create a translation unit and parse the `declarations` in it +to the bindings. +2. User can provide `header filters` to select which declaration from a particular header file should be added to the generated bindings. The can provide a list of header 'names' to include/exclude. +We compare the header file name (not the exact path) to decide. +The default behaviour is to include everything that's included when parsing a header. +3. Use can provide Compiler options, which are passed to clang compiler as it is. +4. All bindings are generated in a single file. + +# Code Details +## Modules +We are using libclang to parse header files. +This project is roughly divided in 3 major modules - +### code_generator +Converts a library(all bindings) to an actual string representation. +- Library (output of the header parser). +- Writer (provides configurations for generating bindings). +- Binding (base class for all bindings - Func, Struc, Global, EnumClass, etc). +### config_provider +This takes care of validating user config files, printing config warnings and errors, +converting config.yaml to a format the header_parser can use. +- Spec (represents a single config, which a user can provide in the config file). +- Config (holds all the config which will be required by header parser). +### header_parser +Uses libclang to convert the header to a Library which is then used by code_generator. +- clang_bindings (bindings to libclang which are used for parsing). +- sub_parsers (each sub-parser parses a particular kind of declaration - struct, function, typedef, enum). +- type_extractor (extracts types from variables, function parameters, return types). +- includer (tells what should/shouldn't be included depending of config). +- parser (Main Entrypoint) (creates translation units for all header files, and sets up parsing them). +- translation_unit_parser (parses header files, splits declarations and feeds them to their respective sub_parsers). \ No newline at end of file diff --git a/pkgs/ffigen/lib/src/code_generator.dart b/pkgs/ffigen/lib/src/code_generator.dart new file mode 100644 index 0000000000..9eb01b641f --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator.dart @@ -0,0 +1,17 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// Generates FFI bindings for a given [Library]. +library code_generator; + +export 'code_generator/binding.dart'; +export 'code_generator/constant.dart'; +export 'code_generator/enum_class.dart'; +export 'code_generator/func.dart'; +export 'code_generator/global.dart'; +export 'code_generator/library.dart'; +export 'code_generator/struc.dart'; +export 'code_generator/type.dart'; +export 'code_generator/typedef.dart'; + diff --git a/pkgs/ffigen/lib/src/code_generator/binding.dart b/pkgs/ffigen/lib/src/code_generator/binding.dart new file mode 100644 index 0000000000..127c0d25f1 --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/binding.dart @@ -0,0 +1,20 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:meta/meta.dart'; + +import 'binding_string.dart'; +import 'writer.dart'; + +/// Base class for all Bindings. +abstract class Binding { + final String name; + + final String dartDoc; + + const Binding({@required this.name, this.dartDoc}); + + /// Converts a Binding to its actual string representation. + BindingString toBindingString(Writer w); +} diff --git a/pkgs/ffigen/lib/src/code_generator/binding_string.dart b/pkgs/ffigen/lib/src/code_generator/binding_string.dart new file mode 100644 index 0000000000..c0d4325fe2 --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/binding_string.dart @@ -0,0 +1,27 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:meta/meta.dart'; + +/// A Binding's String representation. +class BindingString { + // Meta data, (not used for generation). + final BindingStringType type; + final String string; + + const BindingString({@required this.type, @required this.string}); + + @override + String toString() => string; +} + +/// A [BindingString]'s type. +enum BindingStringType { + func, + struc, + constant, + global, + enumClass, + typeDef, +} diff --git a/pkgs/ffigen/lib/src/code_generator/constant.dart b/pkgs/ffigen/lib/src/code_generator/constant.dart new file mode 100644 index 0000000000..bef22d8db6 --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/constant.dart @@ -0,0 +1,53 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:meta/meta.dart'; + +import 'binding.dart'; +import 'binding_string.dart'; +import 'type.dart'; +import 'writer.dart'; + +/// A simple Constant. +/// +/// Expands to - +/// ```dart +/// const = ; +/// ``` +/// +/// Example - +/// ```dart +/// const int name = 10; +/// ``` +class Constant extends Binding { + final Type type; + + /// The rawValue is pasted as it is. + /// + /// Put quotes if type is a string. + final String rawValue; + + const Constant({ + @required String name, + String dartDoc, + @required this.type, + @required this.rawValue, + }) : super(name: name, dartDoc: dartDoc); + + @override + BindingString toBindingString(Writer w) { + final s = StringBuffer(); + + if (dartDoc != null) { + s.write('/// '); + s.writeAll(dartDoc.split('\n'), '\n/// '); + s.write('\n'); + } + + s.write('const ${type.getDartType(w)} $name = $rawValue;\n\n'); + + return BindingString( + type: BindingStringType.constant, string: s.toString()); + } +} diff --git a/pkgs/ffigen/lib/src/code_generator/enum_class.dart b/pkgs/ffigen/lib/src/code_generator/enum_class.dart new file mode 100644 index 0000000000..90faf5bef3 --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/enum_class.dart @@ -0,0 +1,69 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:meta/meta.dart'; + +import 'binding.dart'; +import 'binding_string.dart'; +import 'writer.dart'; + +/// A binding for enums in C. +/// +/// For a C enum - +/// ```c +/// enum Fruits {apple, banana = 10}; +/// ``` +/// The generated dart code is +/// +/// ```dart +/// class Fruits { +/// static const apple = 0; +/// static const banana = 10; +/// } +/// ``` +class EnumClass extends Binding { + final List enumConstants; + + EnumClass({ + @required String name, + String dartDoc, + List enumConstants, + }) : enumConstants = enumConstants ?? [], + super(name: name, dartDoc: dartDoc); + + @override + BindingString toBindingString(Writer w) { + final s = StringBuffer(); + + if (dartDoc != null) { + s.write('/// '); + s.writeAll(dartDoc.split('\n'), '\n/// '); + s.write('\n'); + } + + // Print enclosing class. + s.write('class $name {\n'); + const depth = ' '; + for (final ec in enumConstants) { + if (ec.dartDoc != null) { + s.write(depth + '/// '); + s.writeAll(ec.dartDoc.split('\n'), '\n' + depth + '/// '); + s.write('\n'); + } + s.write(depth + 'static const int ${ec.name} = ${ec.value};\n'); + } + s.write('}\n\n'); + + return BindingString( + type: BindingStringType.enumClass, string: s.toString()); + } +} + +/// Represents a single value in an enum. +class EnumConstant { + final String dartDoc; + final String name; + final int value; + const EnumConstant({@required this.name, @required this.value, this.dartDoc}); +} diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart new file mode 100644 index 0000000000..688c573cb3 --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -0,0 +1,104 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:meta/meta.dart'; + +import 'binding.dart'; +import 'binding_string.dart'; +import 'type.dart'; +import 'writer.dart'; + +/// A binding for C function. +/// +/// For a C function - +/// ```c +/// int sum(int a, int b); +/// ``` +/// The Generated dart code is - +/// ```dart +/// int sum(int a, int b) { +/// return _sum(a, b); +/// } +/// +/// final _dart_sum _sum = _dylib.lookupFunction<_c_sum, _dart_sum>('sum'); +/// +/// typedef _c_sum = ffi.Int32 Function(ffi.Int32 a, ffi.Int32 b); +/// +/// typedef _dart_sum = int Function(int a, int b); +/// ``` +class Func extends Binding { + final Type returnType; + final List parameters; + + Func({ + @required String name, + String dartDoc, + @required this.returnType, + List parameters, + }) : parameters = parameters ?? [], + super(name: name, dartDoc: dartDoc) { + for (var i = 0; i < this.parameters.length; i++) { + if (this.parameters[i].name == null || + this.parameters[i].name.trim() == '') { + this.parameters[i].name = 'arg$i'; + } + } + } + + @override + BindingString toBindingString(Writer w) { + final s = StringBuffer(); + + final funcVarName = '_$name'; + final typedefC = '_c_$name'; + final typedefDart = '_dart_$name'; + + if (dartDoc != null) { + s.write('/// '); + s.writeAll(dartDoc.split('\n'), '\n/// '); + s.write('\n'); + } + + // Write enclosing function. + s.write('${returnType.getDartType(w)} $name(\n'); + for (final p in parameters) { + s.write(' ${p.type.getDartType(w)} ${p.name},\n'); + } + s.write(') {\n'); + s.write(' return $funcVarName(\n'); + for (final p in parameters) { + s.write(' ${p.name},\n'); + } + s.write(' );\n'); + s.write('}\n\n'); + + // Write function with dylib lookup. + s.write( + "final $typedefDart $funcVarName = ${w.dylibIdentifier}.lookupFunction<$typedefC,$typedefDart>('$name');\n\n"); + + // Write typdef for C. + s.write('typedef $typedefC = ${returnType.getCType(w)} Function(\n'); + for (final p in parameters) { + s.write(' ${p.type.getCType(w)} ${p.name},\n'); + } + s.write(');\n\n'); + + // Write typdef for dart. + s.write('typedef $typedefDart = ${returnType.getDartType(w)} Function(\n'); + for (final p in parameters) { + s.write(' ${p.type.getDartType(w)} ${p.name},\n'); + } + s.write(');\n\n'); + + return BindingString(type: BindingStringType.func, string: s.toString()); + } +} + +/// Represents a Function's parameter. +class Parameter { + String name; + final Type type; + + Parameter({this.name, @required this.type}); +} diff --git a/pkgs/ffigen/lib/src/code_generator/global.dart b/pkgs/ffigen/lib/src/code_generator/global.dart new file mode 100644 index 0000000000..8729785f21 --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/global.dart @@ -0,0 +1,46 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:meta/meta.dart'; + +import 'binding.dart'; +import 'binding_string.dart'; +import 'type.dart'; +import 'writer.dart'; + +/// A binding to a global variable +/// +/// For a C global variable - +/// ```c +/// int a; +/// ``` +/// The generated dart code is - +/// ```dart +/// final int a = _dylib.lookup('a').value; +/// ``` +class Global extends Binding { + final Type type; + + const Global({ + @required String name, + @required this.type, + String dartDoc, + }) : super(name: name, dartDoc: dartDoc); + + @override + BindingString toBindingString(Writer w) { + final s = StringBuffer(); + + if (dartDoc != null) { + s.write('/// '); + s.writeAll(dartDoc.split('\n'), '\n/// '); + s.write('\n'); + } + + s.write( + "final ${type.getDartType(w)} $name = ${w.dylibIdentifier}.lookup<${type.getCType(w)}>('$name').value;\n\n"); + + return BindingString(type: BindingStringType.global, string: s.toString()); + } +} diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart new file mode 100644 index 0000000000..8ae4a06ebb --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -0,0 +1,83 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:io'; + +import 'package:logging/logging.dart'; +import 'package:meta/meta.dart'; + +import 'binding.dart'; +import 'writer.dart'; + +var _logger = Logger('code_generator'); + +/// Container for all Bindings. +class Library { + /// Variable identifier used for dynamicLibrary. Defaults to `_dylib`, + final String dylibIdentifier; + + /// Init function for providing dynamic library. Defaults to `init`, + /// + /// Can be renamed in case of name conflicts with something else. + final String initFunctionIdentifier; + + /// Header of file. + final String header; + + /// List of bindings in this library. + final List bindings; + + Library({ + @required this.bindings, + this.dylibIdentifier = '_dylib', + this.initFunctionIdentifier = 'init', + this.header, + }) : assert(dylibIdentifier != null), + assert(initFunctionIdentifier != null); + + /// Sort all bindings in alphabetical order. + void sort() { + bindings.sort((b1, b2) => b1.name.compareTo(b2.name)); + } + + /// Generates [file] by generating C bindings. + /// + /// If format is true(default), 'dartfmt -w $PATH' will be called to format the generated file. + void generateFile(File file, {bool format = true}) { + file.writeAsStringSync(generate()); + if (format) { + _dartFmt(file.path); + } + } + + /// Generates bindings and stores it in given [Writer]. + void _generate(Writer w) { + w.header = header; + for (final b in bindings) { + w.addBindingString(b.toBindingString(w)); + } + } + + /// Formats a file using `dartfmt`. + void _dartFmt(String path) { + final result = Process.runSync('dartfmt', ['-w', path], + runInShell: Platform.isWindows); + if (result.stderr.toString().isNotEmpty) { + _logger.severe(result.stderr); + } + } + + /// Generates the bindings. + String generate() { + final w = Writer( + dylibIdentifier: dylibIdentifier, + initFunctionIdentifier: initFunctionIdentifier, + ); + _generate(w); + return w.generate(); + } + + @override + bool operator ==(Object o) => o is Library && o.generate() == generate(); +} diff --git a/pkgs/ffigen/lib/src/code_generator/struc.dart b/pkgs/ffigen/lib/src/code_generator/struc.dart new file mode 100644 index 0000000000..391dc2ed22 --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/struc.dart @@ -0,0 +1,194 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:meta/meta.dart'; + +import 'binding.dart'; +import 'binding_string.dart'; +import 'type.dart'; +import 'writer.dart'; + +/// A binding for C Struct. +/// +/// For a C structure - +/// ```c +/// struct C { +/// int a; +/// double b; +/// int c; +/// }; +/// ``` +/// The generated dart code is - +/// ```dart +/// class Struct extends ffi.Struct{ +/// @ffi.Int32() +/// int a; +/// +/// @ffi.Double() +/// double b; +/// +/// @ffi.Uint8() +/// int c; +/// +/// } +/// ``` +class Struc extends Binding { + final List members; + + Struc({ + @required String name, + String dartDoc, + List members, + }) : members = members ?? [], + super(name: name, dartDoc: dartDoc); + + @override + BindingString toBindingString(Writer w) { + final s = StringBuffer(); + + if (dartDoc != null) { + s.write('/// '); + s.writeAll(dartDoc.split('\n'), '\n/// '); + s.write('\n'); + } + + final helpers = []; + + // Write class declaration. + s.write('class $name extends ${w.ffiLibraryPrefix}.Struct{\n'); + for (final m in members) { + if (m.type.broadType == BroadType.ConstantArray) { + // TODO(5): Remove array helpers when inline array support arives. + final arrayHelper = ArrayHelper( + helperClassName: '_ArrayHelper_${name}_${m.name}', + elementType: m.type.elementType, + length: 3, + name: m.name, + structName: name, + elementNamePrefix: '_${m.name}_item_', + ); + s.write(arrayHelper.declarationString(w)); + helpers.add(arrayHelper); + } else { + if (m.type.isPrimitive) { + s.write(' @${m.type.getCType(w)}()\n'); + } + s.write(' ${m.type.getDartType(w)} ${m.name};\n\n'); + } + } + s.write('}\n\n'); + + for (final helper in helpers) { + s.write(helper.helperClassString(w)); + } + + return BindingString(type: BindingStringType.struc, string: s.toString()); + } +} + +class Member { + final String name; + final Type type; + + const Member({this.name, this.type}); +} + +// Helper bindings for struct array. +class ArrayHelper { + final Type elementType; + final int length; + final String structName; + + final String name; + final String helperClassName; + final String elementNamePrefix; + + ArrayHelper({ + @required this.elementType, + @required this.length, + @required this.structName, + @required this.name, + @required this.helperClassName, + @required this.elementNamePrefix, + }); + + /// Create declaration binding, added inside the struct binding. + String declarationString(Writer w) { + final s = StringBuffer(); + final arrayDartType = elementType.getDartType(w); + final arrayCType = elementType.getCType(w); + + for (var i = 0; i < length; i++) { + if (elementType.isPrimitive) { + s.write(' @${arrayCType}()\n'); + } + s.write(' ${arrayDartType} ${elementNamePrefix}$i;\n'); + } + + s.write('/// helper for array, supports `[]` operator\n'); + s.write( + '$helperClassName get $name => ${helperClassName}(this, $length);\n'); + + return s.toString(); + } + + /// Creates an array helper binding for struct array. + String helperClassString(Writer w) { + final s = StringBuffer(); + + final arrayType = elementType.getDartType(w); + + s.write('/// Helper for array $name in struct $structName\n'); + + // Write class declaration. + s.write('class $helperClassName{\n'); + s.write('final $structName _struct;\n'); + s.write('final int length;\n'); + s.write('$helperClassName(this._struct, this.length);\n'); + + // Override []= operator. + s.write('void operator []=(int index, $arrayType value) {\n'); + s.write('switch(index) {\n'); + for (var i = 0; i < length; i++) { + s.write('case $i:\n'); + s.write(' _struct.${elementNamePrefix}$i = value;\n'); + s.write(' break;\n'); + } + s.write('default:\n'); + s.write( + " throw RangeError('Index \$index must be in the range [0..${length - 1}].');"); + s.write('}\n'); + s.write('}\n'); + + // Override [] operator. + s.write('$arrayType operator [](int index) {\n'); + s.write('switch(index) {\n'); + for (var i = 0; i < length; i++) { + s.write('case $i:\n'); + s.write(' return _struct.${elementNamePrefix}$i;\n'); + } + s.write('default:\n'); + s.write( + " throw RangeError('Index \$index must be in the range [0..${length - 1}].');"); + s.write('}\n'); + s.write('}\n'); + + // Override toString(). + s.write('@override\n'); + s.write('String toString() {\n'); + s.write("if (length == 0) return '[]';\n"); + s.write("final sb = StringBuffer('[');\n"); + s.write('sb.write(this[0]);\n'); + s.write('for (var i = 1; i < length; i++) {\n'); + s.write(" sb.write(',');\n"); + s.write(' sb.write(this[i]);'); + s.write('}\n'); + s.write("sb.write(']');"); + s.write('return sb.toString();\n'); + s.write('}\n'); + + s.write('}\n\n'); + return s.toString(); + } +} diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart new file mode 100644 index 0000000000..b393d34955 --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -0,0 +1,165 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:meta/meta.dart'; + +import 'writer.dart'; + +class _SubType { + final String c; + final String dart; + + const _SubType({this.c, this.dart}); +} + +enum SupportedNativeType { + Void, + Char, + Int8, + Int16, + Int32, + Int64, + Uint8, + Uint16, + Uint32, + Uint64, + Float, + Double, + IntPtr, +} + +/// The basic types in which all types can be broadly classified into. +enum BroadType { + NativeType, + Pointer, + Struct, + NativeFunction, + + /// Stores its element type in NativeType as only those are supported. + ConstantArray, + + /// Used as a marker, so that functions/structs having these can exclude them. + Unimplemented, +} + +/// Type class for return types, variable types, etc. +class Type { + static const _primitives = { + SupportedNativeType.Void: _SubType(c: 'Void', dart: 'void'), + SupportedNativeType.Char: _SubType(c: 'Uint8', dart: 'int'), + SupportedNativeType.Int8: _SubType(c: 'Int8', dart: 'int'), + SupportedNativeType.Int16: _SubType(c: 'Int16', dart: 'int'), + SupportedNativeType.Int32: _SubType(c: 'Int32', dart: 'int'), + SupportedNativeType.Int64: _SubType(c: 'Int64', dart: 'int'), + SupportedNativeType.Uint8: _SubType(c: 'Uint8', dart: 'int'), + SupportedNativeType.Uint16: _SubType(c: 'Uint16', dart: 'int'), + SupportedNativeType.Uint32: _SubType(c: 'Uint32', dart: 'int'), + SupportedNativeType.Uint64: _SubType(c: 'Uint64', dart: 'int'), + SupportedNativeType.Float: _SubType(c: 'Float', dart: 'double'), + SupportedNativeType.Double: _SubType(c: 'Double', dart: 'double'), + SupportedNativeType.IntPtr: _SubType(c: 'IntPtr', dart: 'int'), + }; + + /// For providing name of Struct. + String structName; + + /// For providing name of nativeFunc. + String nativeFuncName; + + /// For providing [SupportedNativeType] only. + final SupportedNativeType nativeType; + + /// The BroadType of this Type. + final BroadType broadType; + + /// Child Type, e.g Pointer(Parent) to Int(Child). + final Type child; + + /// For ConstantArray type. + final int arrayLength; + final Type elementType; + + /// For storing cursor type info for an unimplemented type. + String unimplementedReason; + + Type._({ + @required this.broadType, + this.child, + this.structName, + this.nativeType, + this.nativeFuncName, + this.arrayLength, + this.elementType, + this.unimplementedReason, + }); + + factory Type.pointer(Type child) { + return Type._(broadType: BroadType.Pointer, child: child); + } + factory Type.struct(String structName) { + return Type._(broadType: BroadType.Struct, structName: structName); + } + factory Type.nativeFunc(String nativeFuncName) { + return Type._( + broadType: BroadType.NativeFunction, nativeFuncName: nativeFuncName); + } + factory Type.nativeType(SupportedNativeType nativeType) { + return Type._(broadType: BroadType.NativeType, nativeType: nativeType); + } + factory Type.constantArray(int arrayLength, Type elementType) { + return Type._(broadType: BroadType.ConstantArray, elementType: elementType); + } + factory Type.unimplemented(String reason) { + return Type._( + broadType: BroadType.Unimplemented, unimplementedReason: reason); + } + + /// Get base broad type for any type. + /// + /// E.g int** has base Broadtype as NativeType. + BroadType getBaseBroadType() { + if (broadType == BroadType.Pointer) { + return child.getBaseBroadType(); + } else { + return broadType; + } + } + + bool get isPrimitive => broadType == BroadType.NativeType; + + String getCType(Writer w) { + switch (broadType) { + case BroadType.NativeType: + return '${w.ffiLibraryPrefix}.${_primitives[nativeType].c}'; + case BroadType.Pointer: + return '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; + case BroadType.Struct: + return structName; + case BroadType.NativeFunction: + return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFuncName}>'; + default: + throw Exception('cType unknown'); + } + } + + String getDartType(Writer w) { + switch (broadType) { + case BroadType.NativeType: + return _primitives[nativeType].dart; + case BroadType.Pointer: + return '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; + case BroadType.Struct: + return structName; + case BroadType.NativeFunction: + return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFuncName}>'; + default: + throw Exception('dart type unknown for ${broadType.toString()}'); + } + } + + @override + String toString() { + return 'Type: ${broadType}'; + } +} diff --git a/pkgs/ffigen/lib/src/code_generator/typedef.dart b/pkgs/ffigen/lib/src/code_generator/typedef.dart new file mode 100644 index 0000000000..ea9568f373 --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/typedef.dart @@ -0,0 +1,54 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:meta/meta.dart'; + +import 'binding.dart'; +import 'binding_string.dart'; +import 'func.dart' show Parameter; +import 'type.dart'; +import 'writer.dart'; + +/// A simple typedef function for C functions, Expands to - +/// +/// ```dart +/// typedef $name = $returnType Function( +/// $parameter1..., +/// $parameter2..., +/// . +/// . +/// );` +/// ``` +/// Note: This doesn't bind with anything. +class TypedefC extends Binding { + final Type returnType; + final List parameters; + + TypedefC({ + @required String name, + String dartDoc, + @required this.returnType, + List parameters, + }) : parameters = parameters ?? [], + super(name: name, dartDoc: dartDoc); + + @override + BindingString toBindingString(Writer w) { + final s = StringBuffer(); + + if (dartDoc != null) { + s.write('/// '); + s.writeAll(dartDoc.split('\n'), '\n/// '); + s.write('\n'); + } + + s.write('typedef $name = ${returnType.getCType(w)} Function(\n'); + for (final p in parameters) { + s.write(' ${p.type.getCType(w)} ${p.name},\n'); + } + s.write(');\n\n'); + + return BindingString(type: BindingStringType.typeDef, string: s.toString()); + } +} diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart new file mode 100644 index 0000000000..cc4496ff9c --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -0,0 +1,64 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'binding_string.dart'; + +/// To store generated String bindings. +class Writer { + String header; + String dylibIdentifier; + String initFunctionIdentifier; + + /// dart:ffi library import prefix. + String ffiLibraryPrefix; + + final List _bindings = []; + + Writer({ + this.dylibIdentifier = '_dylib', + this.initFunctionIdentifier = 'init', + this.ffiLibraryPrefix = 'ffi', + }); + + String generate() { + final s = StringBuffer(); + + // Write header (if any) + if (header != null) { + s.write(header); + s.write('\n'); + } else { + // Write default header, in case none was provided. + s.write('''/// AUTO GENERATED FILE, DO NOT EDIT. +/// +/// Generated by `package:ffigen`. +'''); + } + + // Write neccesary imports. + s.write("import 'dart:ffi' as $ffiLibraryPrefix;\n"); + s.write('\n'); + + // Write dylib. + s.write('/// Holds the Dynamic library.\n'); + s.write('$ffiLibraryPrefix.DynamicLibrary ${dylibIdentifier};\n'); + s.write('\n'); + s.write('/// Initialises the Dynamic library.\n'); + s.write( + 'void $initFunctionIdentifier($ffiLibraryPrefix.DynamicLibrary dylib){\n'); + s.write(' ${dylibIdentifier} = dylib;\n'); + s.write('}\n'); + + // Write bindings. + for (final bs in _bindings) { + s.write(bs.string); + } + + return s.toString(); + } + + void addBindingString(BindingString b) { + _bindings.add(b); + } +} diff --git a/pkgs/ffigen/lib/src/config_provider.dart b/pkgs/ffigen/lib/src/config_provider.dart new file mode 100644 index 0000000000..990e137dd5 --- /dev/null +++ b/pkgs/ffigen/lib/src/config_provider.dart @@ -0,0 +1,8 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// Creates config object used by other sub_modules. +library config_provider; + +export 'config_provider/config.dart'; diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart new file mode 100644 index 0000000000..89f55c204a --- /dev/null +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -0,0 +1,287 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:io'; + +/// Validates the yaml input by the user, prints useful info for the user + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser/type_extractor/cxtypekindmap.dart'; + +import 'package:logging/logging.dart'; +import 'package:meta/meta.dart'; +import 'package:path/path.dart' as path; +import 'package:yaml/yaml.dart'; + +import '../strings.dart' as strings; +import 'filter.dart'; +import 'spec_utils.dart'; + +var _logger = Logger('config_provider/config'); + +/// Provides configurations to other modules. +/// +/// Handles validation, extraction of confiurations from yaml file. +class Config { + /// output file name. + String output; + + /// libclang path (in accordance with the platform). + /// + /// File may have the following extensions - `.so` / `.dll` / `.dylib` + /// as extracted by configspec. + String libclang_dylib_path; + + /// Path to headers. + /// + /// This contains all the headers, after extraction from Globs. + List headers; + + /// Filter for headers. + HeaderFilter headerFilter; + + /// CommandLine Arguments to pass to clang_compiler. + List compilerOpts; + + /// Filter for functions. + Filter functionFilters; + + /// Filter for structs. + Filter structFilters; + + /// Filter for enumClass. + Filter enumClassFilters; + + /// If generated bindings should be sorted alphabetically. + bool sort; + + /// If typedef of supported types(int8_t) should be directly used. + bool useSupportedTypedefs; + + /// If tool should extract doc comment from bindings. + bool extractComments; + + /// Manually creating configurations. + /// + /// Use [Config.fromYaml] if extracting info from a yaml file. + /// Ensure that log printing is setup before using this. + Config.raw({ + this.output, + @required this.libclang_dylib_path, + @required this.headers, + this.headerFilter, + this.compilerOpts, + this.functionFilters, + this.structFilters, + this.enumClassFilters, + this.sort = false, + this.useSupportedTypedefs = true, + this.extractComments = true, + }); + + Config._(); + + /// Create config from Yaml map. + /// + /// Ensure that log printing is setup before using this. + factory Config.fromYaml(YamlMap map) { + final configspecs = Config._(); + _logger.finest('Config Map: ' + map.toString()); + + final specs = configspecs._getSpecs(); + + final result = configspecs._checkConfigs(map, specs); + if (!result) { + _logger.info('Please fix errors in Configurations and re-run the tool'); + exit(1); + } + + configspecs._extract(map, specs); + return configspecs; + } + + /// Validates Yaml according to given specs. + bool _checkConfigs(YamlMap map, Map specs) { + var _result = true; + for (final key in specs.keys) { + final spec = specs[key]; + if (spec.isRequired && !map.containsKey(key)) { + _logger.severe("Key '${key}' is required."); + _result = false; + } else if (map.containsKey(key)) { + _result = _result && spec.validator(key, map[key]); + } + } + // Warn about unknown keys. + for (final key in map.keys) { + if (!specs.containsKey(key)) { + _logger.warning("Unknown key '$key' found."); + } + } + + return _result; + } + + /// Extracts variables from Yaml according to given specs. + /// + /// Validation must be done beforehand, using [_checkConfigs]. + void _extract(YamlMap map, Map specs) { + for (final key in specs.keys) { + final spec = specs[key]; + if (map.containsKey(key)) { + spec.extractedResult(spec.extractor(map[key])); + } else { + spec.extractedResult(spec.defaultValue); + } + } + } + + /// Returns map of various specifications avaialble for our tool. + /// + /// Key: Name, Value: [Specification] + Map _getSpecs() { + return { + strings.output: Specification( + description: 'Output file name', + isRequired: true, + validator: outputValidator, + extractor: outputExtractor, + defaultValue: null, + extractedResult: (dynamic result) => output = result as String, + ), + strings.libclang_dylib_folder: Specification( + description: + 'Path to folder containing libclang dynamic library, used to parse C headers', + isRequired: false, + defaultValue: getDylibPath(Platform.script + .resolve(path.join('..', 'tool', 'wrapped_libclang')) + .toFilePath()), + validator: libclangDylibValidator, + extractor: libclangDylibExtractor, + extractedResult: (dynamic result) => + libclang_dylib_path = result as String, + ), + strings.headers: Specification>( + description: 'List of C headers to generate bindings of', + isRequired: true, + validator: headersValidator, + extractor: headersExtractor, + extractedResult: (dynamic result) => headers = result as List, + ), + strings.headerFilter: Specification( + description: 'Include/Exclude inclusion headers', + validator: headerFilterValidator, + extractor: headerFilterExtractor, + defaultValue: HeaderFilter(), + extractedResult: (dynamic result) { + return headerFilter = result as HeaderFilter; + }, + ), + strings.compilerOpts: Specification>( + description: 'Raw compiler options to pass to clang compiler', + isRequired: false, + validator: compilerOptsValidator, + extractor: compilerOptsExtractor, + defaultValue: null, + extractedResult: (dynamic result) => + compilerOpts = result as List, + ), + strings.functions: Specification( + description: 'Filter for functions', + isRequired: false, + validator: filterValidator, + extractor: filterExtractor, + defaultValue: null, + extractedResult: (dynamic result) => functionFilters = result as Filter, + ), + strings.structs: Specification( + description: 'Filter for Structs', + isRequired: false, + validator: filterValidator, + extractor: filterExtractor, + defaultValue: null, + extractedResult: (dynamic result) => structFilters = result as Filter, + ), + strings.enums: Specification( + description: 'Filter for enums', + isRequired: false, + validator: filterValidator, + extractor: filterExtractor, + defaultValue: null, + extractedResult: (dynamic result) => + enumClassFilters = result as Filter, + ), + strings.sizemap: Specification>( + description: 'map of types: byte size in int', + validator: sizemapValidator, + extractor: sizemapExtractor, + defaultValue: {}, + extractedResult: (dynamic result) { + final map = result as Map; + for (final key in map.keys) { + if (cxTypeKindToSupportedNativeTypes.containsKey(key)) { + cxTypeKindToSupportedNativeTypes[key] = map[key]; + } + } + }, + ), + strings.sort: Specification( + description: 'whether or not to sort the bindings alphabetically', + isRequired: false, + validator: booleanValidator, + extractor: booleanExtractor, + defaultValue: false, + extractedResult: (dynamic result) => sort = result as bool, + ), + strings.useSupportedTypedefs: Specification( + description: 'whether or not to directly map supported typedef by name', + isRequired: false, + validator: booleanValidator, + extractor: booleanExtractor, + defaultValue: true, + extractedResult: (dynamic result) => + useSupportedTypedefs = result as bool, + ), + strings.extractComments: Specification( + description: 'whether or not to extract comments from bindings', + isRequired: false, + validator: booleanValidator, + extractor: booleanExtractor, + defaultValue: true, + extractedResult: (dynamic result) => extractComments = result as bool, + ), + }; + } +} + +/// Represents a single specification in configurations. +/// +/// [E] is the return type of the extractedResult. +class Specification { + final String description; + final bool Function(String name, dynamic value) validator; + final E Function(dynamic map) extractor; + final E defaultValue; + final bool isRequired; + final void Function(dynamic result) extractedResult; + + Specification({ + @required this.extractedResult, + @required this.description, + @required this.validator, + @required this.extractor, + this.defaultValue, + this.isRequired = false, + }); +} + +class HeaderFilter { + Set includedInclusionHeaders; + Set excludedInclusionHeaders; + + HeaderFilter({ + this.includedInclusionHeaders = const {}, + this.excludedInclusionHeaders = const {}, + }); +} diff --git a/pkgs/ffigen/lib/src/config_provider/filter.dart b/pkgs/ffigen/lib/src/config_provider/filter.dart new file mode 100644 index 0000000000..b35dc0b228 --- /dev/null +++ b/pkgs/ffigen/lib/src/config_provider/filter.dart @@ -0,0 +1,80 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// A generic filter for filtering strings based on regexes and prefixes. +/// +/// Excludes override includes. +/// +/// User can provide fiters for functions, structs, enums and include/exclude +/// them using regexp and full name matching. +class Filter { + // matchers + List _includeMatchers = []; + Set _includeFull = {}; + List _excludeMatchers = []; + Set _excludeFull = {}; + + Filter({ + List includeMatchers, + List includeFull, + List excludeMatchers, + List excludeFull, + }) { + if (includeMatchers != null) { + _includeMatchers = + includeMatchers.map((e) => RegExp(e, dotAll: true)).toList(); + } + if (includeFull != null) { + _includeFull = includeFull.map((e) => e).toSet(); + } + if (excludeMatchers != null) { + _excludeMatchers = + excludeMatchers.map((e) => RegExp(e, dotAll: true)).toList(); + } + if (excludeFull != null) { + _excludeFull = excludeFull.map((e) => e).toSet(); + } + } + + /// Checks if a name is allowed by a filter. + bool shouldInclude(String name) { + if (_excludeFull.contains(name)) { + return false; + } + + for (final em in _excludeMatchers) { + if (em.firstMatch(name)?.end == name.length) { + return false; + } + } + + if (_includeFull.contains(name)) { + return true; + } + + for (final im in _includeMatchers) { + if (im.firstMatch(name)?.end == name.length) { + return true; + } + } + + // If user has provided 'include' field in the filter, then default + // matching is false. + if (_includeMatchers.isNotEmpty || _includeFull.isNotEmpty) { + return false; + } else { + return true; + } + } + + @override + String toString() { + return ''' (includeFull, includeMatchers, excludeFull, excludeMatchers) +$_includeFull +$_includeMatchers +$_excludeFull +$_excludeMatchers + '''; + } +} diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart new file mode 100644 index 0000000000..683d53dd6e --- /dev/null +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -0,0 +1,241 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:io'; + +import 'package:ffigen/src/code_generator.dart'; +import 'package:glob/glob.dart'; +import 'package:logging/logging.dart'; +import 'package:path/path.dart' as p; +import 'package:yaml/yaml.dart'; + +import '../strings.dart' as strings; +import './config.dart'; +import 'filter.dart'; + +var _logger = Logger('config_provider/utils'); + +bool booleanExtractor(dynamic value) => value as bool; + +bool booleanValidator(String name, dynamic value) { + if (value is! bool) { + _logger.severe("Expected value of key '$name' to be a bool."); + return false; + } else { + return true; + } +} + +Map sizemapExtractor(dynamic yamlConfig) { + final resultMap = {}; + final sizemap = yamlConfig as YamlMap; + if (sizemap != null) { + for (final typeName in strings.sizemap_native_mapping.keys) { + if (sizemap.containsKey(typeName)) { + final cxTypeInt = strings.sizemap_native_mapping[typeName]; + final byteSize = sizemap[typeName] as int; + resultMap[cxTypeInt] = nativeSupportedType(byteSize, + signed: typeName.contains('unsigned') ? false : true); + } + } + } + return resultMap; +} + +bool sizemapValidator(String name, dynamic yamlConfig) { + if (yamlConfig is! YamlMap) { + _logger.severe("Expected value of key '$name' to be a Map."); + return false; + } + for (final key in (yamlConfig as YamlMap).keys) { + if (!strings.sizemap_native_mapping.containsKey(key)) { + _logger.warning("Unknown subkey '$key' in '$name'."); + } + } + + return true; +} + +List compilerOptsExtractor(dynamic value) => + (value as String)?.split(' '); + +bool compilerOptsValidator(String name, dynamic value) { + if (value is! String) { + _logger.severe("Expected value of key '$name' to be a string."); + return false; + } else { + return true; + } +} + +HeaderFilter headerFilterExtractor(dynamic yamlConfig) { + final includedInclusionHeaders = {}; + final excludedInclusionHeaders = {}; + + final headerFilter = yamlConfig as YamlMap; + if (headerFilter != null) { + // Add include/excluded header-filter from Yaml. + final include = headerFilter[strings.include] as YamlList; + include?.cast()?.forEach(includedInclusionHeaders.add); + + final exclude = headerFilter[strings.exclude] as YamlList; + exclude?.cast()?.forEach(excludedInclusionHeaders.add); + } + + return HeaderFilter( + includedInclusionHeaders: includedInclusionHeaders, + excludedInclusionHeaders: excludedInclusionHeaders, + ); +} + +bool headerFilterValidator(String name, dynamic value) { + if (value is! YamlMap) { + _logger.severe("Expected value of key '$name' to be a Map."); + return false; + } else { + return true; + } +} + +List headersExtractor(dynamic yamlConfig) { + final headers = []; + for (final h in (yamlConfig as YamlList)) { + final headerGlob = h as String; + // Add file directly to header if it's not a Glob but a File. + if (File(headerGlob).existsSync()) { + headers.add(headerGlob); + _logger.fine('Adding header/file: $headerGlob'); + } else { + final glob = Glob(headerGlob); + for (final file in glob.listSync(followLinks: true)) { + headers.add(file.path); + _logger.fine('Adding header/file: ${file.path}'); + } + } + } + return headers; +} + +bool headersValidator(String name, dynamic value) { + if (value is! YamlList) { + _logger.severe( + "Expected value of key '${strings.headers}' to be a List of String."); + return false; + } else { + return true; + } +} + +String libclangDylibExtractor(dynamic value) => getDylibPath(value as String); + +bool libclangDylibValidator(String name, dynamic value) { + if (value is! String) { + _logger.severe("Expected value of key '$name' to be a string."); + return false; + } else { + final dylibPath = getDylibPath(value as String); + if (!File(dylibPath).existsSync()) { + _logger.severe( + 'Dynamic library: $dylibPath does not exist or is corrupt, input folder: $value.'); + return false; + } else { + return true; + } + } +} + +String getDylibPath(String dylibParentFoler) { + String dylibPath; + if (Platform.isMacOS) { + dylibPath = p.join(dylibParentFoler, strings.libclang_dylib_macos); + } else if (Platform.isWindows) { + // Fix path for windows if '/' is used as seperator instead of '\' + // because our examples input path like this. + final newValue = dylibParentFoler.replaceAll('/', r'\'); + dylibPath = p.join(newValue, strings.libclang_dylib_windows); + } else { + dylibPath = p.join(dylibParentFoler, strings.libclang_dylib_linux); + } + return dylibPath; +} + +String outputExtractor(dynamic value) => value as String; + +bool outputValidator(String name, dynamic value) { + if (value is String) { + return true; + } else { + _logger.severe("Expected value of key '${strings.output}' to be a String."); + return false; + } +} + +Filter filterExtractor(dynamic yamlMap) { + List includeMatchers, includeFull, excludeMatchers, excludeFull; + + final include = yamlMap[strings.include] as YamlMap; + if (include != null) { + includeMatchers = (include[strings.matches] as YamlList)?.cast(); + includeFull = (include[strings.names] as YamlList)?.cast(); + } + + final exclude = yamlMap[strings.exclude] as YamlMap; + if (exclude != null) { + excludeMatchers = (exclude[strings.matches] as YamlList)?.cast(); + excludeFull = (exclude[strings.names] as YamlList)?.cast(); + } + + return Filter( + includeMatchers: includeMatchers, + includeFull: includeFull, + excludeMatchers: excludeMatchers, + excludeFull: excludeFull, + ); +} + +bool filterValidator(String name, dynamic value) { + var _result = true; + if (value is YamlMap) { + for (final key in value.keys) { + if (key == strings.include || key == strings.exclude) { + if (value[key] is! YamlMap) { + _logger.severe("Expected '$name -> $key' to be a Map."); + } + for (final subkey in value[key].keys) { + if (subkey == strings.matches || subkey == strings.names) { + if (value[key][subkey] is! YamlList) { + _logger.severe("Expected '$name -> $key -> $subkey' to be a List."); + _result = false; + } + } else { + _logger.severe("Unknown key '$subkey' in '$name -> $key'."); + } + } + } else { + _logger.severe("Unknown key '$key' in '$name'."); + _result = false; + } + } + } else { + _logger.severe("Expected value '$name' to be a Map."); + _result = false; + } + return _result; +} + +SupportedNativeType nativeSupportedType(int value, {bool signed = true}) { + switch (value) { + case 1: + return signed ? SupportedNativeType.Int8 : SupportedNativeType.Uint8; + case 2: + return signed ? SupportedNativeType.Int16 : SupportedNativeType.Uint16; + case 4: + return signed ? SupportedNativeType.Int32 : SupportedNativeType.Uint32; + case 8: + return signed ? SupportedNativeType.Int64 : SupportedNativeType.Uint64; + default: + throw Exception( + 'Unsupported value given to sizemap, Allowed values for sizes are: 1, 2, 4, 8'); + } +} diff --git a/pkgs/ffigen/lib/src/header_parser.dart b/pkgs/ffigen/lib/src/header_parser.dart new file mode 100644 index 0000000000..e4dc2c9446 --- /dev/null +++ b/pkgs/ffigen/lib/src/header_parser.dart @@ -0,0 +1,10 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// Generates a [Library] (code_generator) +/// +/// Parses the header files AST using clang_bindings. +library header_parser; + +export 'header_parser/parser.dart' show parse; diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart new file mode 100644 index 0000000000..f70197106e --- /dev/null +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -0,0 +1,1447 @@ +/// AUTO GENERATED FILE, DO NOT EDIT. +/// +/// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Holds the Dynamic library. +ffi.DynamicLibrary _dylib; + +/// Initialises the Dynamic library. +void init(ffi.DynamicLibrary dylib) { + _dylib = dylib; +} + +/// Describes how the traversal of the children of a particular cursor should proceed after visiting a particular child cursor. +class CXChildVisitResult { + static const int CXChildVisit_Break = 0; + static const int CXChildVisit_Continue = 1; + static const int CXChildVisit_Recurse = 2; +} + +/// A cursor representing some element in the abstract syntax tree for a translation unit. +class CXCursor extends ffi.Struct { + @ffi.Int32() + int kind; + + @ffi.Int32() + int xdata; + + ffi.Pointer _data_item_0; + ffi.Pointer _data_item_1; + ffi.Pointer _data_item_2; + + /// helper for array, supports `[]` operator + _ArrayHelper_CXCursor_data get data => _ArrayHelper_CXCursor_data(this, 3); +} + +/// Helper for array data in struct CXCursor +class _ArrayHelper_CXCursor_data { + final CXCursor _struct; + final int length; + _ArrayHelper_CXCursor_data(this._struct, this.length); + void operator []=(int index, ffi.Pointer value) { + switch (index) { + case 0: + _struct._data_item_0 = value; + break; + case 1: + _struct._data_item_1 = value; + break; + case 2: + _struct._data_item_2 = value; + break; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + ffi.Pointer operator [](int index) { + switch (index) { + case 0: + return _struct._data_item_0; + case 1: + return _struct._data_item_1; + case 2: + return _struct._data_item_2; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + @override + String toString() { + if (length == 0) return '[]'; + final sb = StringBuffer('['); + sb.write(this[0]); + for (var i = 1; i < length; i++) { + sb.write(','); + sb.write(this[i]); + } + sb.write(']'); + return sb.toString(); + } +} + +/// Describes the kind of entity that a cursor refers to. +class CXCursorKind { + static const int CXCursor_UnexposedDecl = 1; + static const int CXCursor_StructDecl = 2; + static const int CXCursor_UnionDecl = 3; + static const int CXCursor_ClassDecl = 4; + static const int CXCursor_EnumDecl = 5; + static const int CXCursor_FieldDecl = 6; + static const int CXCursor_EnumConstantDecl = 7; + static const int CXCursor_FunctionDecl = 8; + static const int CXCursor_VarDecl = 9; + static const int CXCursor_ParmDecl = 10; + static const int CXCursor_ObjCInterfaceDecl = 11; + static const int CXCursor_ObjCCategoryDecl = 12; + static const int CXCursor_ObjCProtocolDecl = 13; + static const int CXCursor_ObjCPropertyDecl = 14; + static const int CXCursor_ObjCIvarDecl = 15; + static const int CXCursor_ObjCInstanceMethodDecl = 16; + static const int CXCursor_ObjCClassMethodDecl = 17; + static const int CXCursor_ObjCImplementationDecl = 18; + static const int CXCursor_ObjCCategoryImplDecl = 19; + static const int CXCursor_TypedefDecl = 20; + static const int CXCursor_CXXMethod = 21; + static const int CXCursor_Namespace = 22; + static const int CXCursor_LinkageSpec = 23; + static const int CXCursor_Constructor = 24; + static const int CXCursor_Destructor = 25; + static const int CXCursor_ConversionFunction = 26; + static const int CXCursor_TemplateTypeParameter = 27; + static const int CXCursor_NonTypeTemplateParameter = 28; + static const int CXCursor_TemplateTemplateParameter = 29; + static const int CXCursor_FunctionTemplate = 30; + static const int CXCursor_ClassTemplate = 31; + static const int CXCursor_ClassTemplatePartialSpecialization = 32; + static const int CXCursor_NamespaceAlias = 33; + static const int CXCursor_UsingDirective = 34; + static const int CXCursor_UsingDeclaration = 35; + static const int CXCursor_TypeAliasDecl = 36; + static const int CXCursor_ObjCSynthesizeDecl = 37; + static const int CXCursor_ObjCDynamicDecl = 38; + 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; + static const int CXCursor_TypeRef = 43; + static const int CXCursor_CXXBaseSpecifier = 44; + static const int CXCursor_TemplateRef = 45; + static const int CXCursor_NamespaceRef = 46; + static const int CXCursor_MemberRef = 47; + static const int CXCursor_LabelRef = 48; + static const int CXCursor_OverloadedDeclRef = 49; + 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; + static const int CXCursor_UnexposedExpr = 100; + static const int CXCursor_DeclRefExpr = 101; + static const int CXCursor_MemberRefExpr = 102; + static const int CXCursor_CallExpr = 103; + static const int CXCursor_ObjCMessageExpr = 104; + static const int CXCursor_BlockExpr = 105; + static const int CXCursor_IntegerLiteral = 106; + static const int CXCursor_FloatingLiteral = 107; + static const int CXCursor_ImaginaryLiteral = 108; + static const int CXCursor_StringLiteral = 109; + static const int CXCursor_CharacterLiteral = 110; + static const int CXCursor_ParenExpr = 111; + static const int CXCursor_UnaryOperator = 112; + static const int CXCursor_ArraySubscriptExpr = 113; + static const int CXCursor_BinaryOperator = 114; + static const int CXCursor_CompoundAssignOperator = 115; + static const int CXCursor_ConditionalOperator = 116; + static const int CXCursor_CStyleCastExpr = 117; + static const int CXCursor_CompoundLiteralExpr = 118; + static const int CXCursor_InitListExpr = 119; + static const int CXCursor_AddrLabelExpr = 120; + static const int CXCursor_StmtExpr = 121; + static const int CXCursor_GenericSelectionExpr = 122; + static const int CXCursor_GNUNullExpr = 123; + static const int CXCursor_CXXStaticCastExpr = 124; + static const int CXCursor_CXXDynamicCastExpr = 125; + static const int CXCursor_CXXReinterpretCastExpr = 126; + static const int CXCursor_CXXConstCastExpr = 127; + static const int CXCursor_CXXFunctionalCastExpr = 128; + static const int CXCursor_CXXTypeidExpr = 129; + static const int CXCursor_CXXBoolLiteralExpr = 130; + static const int CXCursor_CXXNullPtrLiteralExpr = 131; + static const int CXCursor_CXXThisExpr = 132; + static const int CXCursor_CXXThrowExpr = 133; + static const int CXCursor_CXXNewExpr = 134; + static const int CXCursor_CXXDeleteExpr = 135; + static const int CXCursor_UnaryExpr = 136; + static const int CXCursor_ObjCStringLiteral = 137; + static const int CXCursor_ObjCEncodeExpr = 138; + static const int CXCursor_ObjCSelectorExpr = 139; + static const int CXCursor_ObjCProtocolExpr = 140; + static const int CXCursor_ObjCBridgedCastExpr = 141; + static const int CXCursor_PackExpansionExpr = 142; + static const int CXCursor_SizeOfPackExpr = 143; + static const int CXCursor_LambdaExpr = 144; + static const int CXCursor_ObjCBoolLiteralExpr = 145; + static const int CXCursor_ObjCSelfExpr = 146; + static const int CXCursor_OMPArraySectionExpr = 147; + static const int CXCursor_ObjCAvailabilityCheckExpr = 148; + static const int CXCursor_FixedPointLiteral = 149; + static const int CXCursor_LastExpr = 149; + static const int CXCursor_FirstStmt = 200; + static const int CXCursor_UnexposedStmt = 200; + static const int CXCursor_LabelStmt = 201; + static const int CXCursor_CompoundStmt = 202; + static const int CXCursor_CaseStmt = 203; + static const int CXCursor_DefaultStmt = 204; + static const int CXCursor_IfStmt = 205; + static const int CXCursor_SwitchStmt = 206; + static const int CXCursor_WhileStmt = 207; + static const int CXCursor_DoStmt = 208; + static const int CXCursor_ForStmt = 209; + static const int CXCursor_GotoStmt = 210; + static const int CXCursor_IndirectGotoStmt = 211; + static const int CXCursor_ContinueStmt = 212; + static const int CXCursor_BreakStmt = 213; + static const int CXCursor_ReturnStmt = 214; + static const int CXCursor_GCCAsmStmt = 215; + static const int CXCursor_AsmStmt = 215; + static const int CXCursor_ObjCAtTryStmt = 216; + static const int CXCursor_ObjCAtCatchStmt = 217; + static const int CXCursor_ObjCAtFinallyStmt = 218; + static const int CXCursor_ObjCAtThrowStmt = 219; + static const int CXCursor_ObjCAtSynchronizedStmt = 220; + static const int CXCursor_ObjCAutoreleasePoolStmt = 221; + static const int CXCursor_ObjCForCollectionStmt = 222; + static const int CXCursor_CXXCatchStmt = 223; + static const int CXCursor_CXXTryStmt = 224; + static const int CXCursor_CXXForRangeStmt = 225; + static const int CXCursor_SEHTryStmt = 226; + static const int CXCursor_SEHExceptStmt = 227; + static const int CXCursor_SEHFinallyStmt = 228; + static const int CXCursor_MSAsmStmt = 229; + static const int CXCursor_NullStmt = 230; + static const int CXCursor_DeclStmt = 231; + static const int CXCursor_OMPParallelDirective = 232; + static const int CXCursor_OMPSimdDirective = 233; + static const int CXCursor_OMPForDirective = 234; + static const int CXCursor_OMPSectionsDirective = 235; + static const int CXCursor_OMPSectionDirective = 236; + static const int CXCursor_OMPSingleDirective = 237; + static const int CXCursor_OMPParallelForDirective = 238; + static const int CXCursor_OMPParallelSectionsDirective = 239; + static const int CXCursor_OMPTaskDirective = 240; + static const int CXCursor_OMPMasterDirective = 241; + static const int CXCursor_OMPCriticalDirective = 242; + static const int CXCursor_OMPTaskyieldDirective = 243; + static const int CXCursor_OMPBarrierDirective = 244; + static const int CXCursor_OMPTaskwaitDirective = 245; + static const int CXCursor_OMPFlushDirective = 246; + static const int CXCursor_SEHLeaveStmt = 247; + static const int CXCursor_OMPOrderedDirective = 248; + static const int CXCursor_OMPAtomicDirective = 249; + static const int CXCursor_OMPForSimdDirective = 250; + static const int CXCursor_OMPParallelForSimdDirective = 251; + static const int CXCursor_OMPTargetDirective = 252; + static const int CXCursor_OMPTeamsDirective = 253; + static const int CXCursor_OMPTaskgroupDirective = 254; + static const int CXCursor_OMPCancellationPointDirective = 255; + static const int CXCursor_OMPCancelDirective = 256; + static const int CXCursor_OMPTargetDataDirective = 257; + static const int CXCursor_OMPTaskLoopDirective = 258; + static const int CXCursor_OMPTaskLoopSimdDirective = 259; + static const int CXCursor_OMPDistributeDirective = 260; + static const int CXCursor_OMPTargetEnterDataDirective = 261; + static const int CXCursor_OMPTargetExitDataDirective = 262; + static const int CXCursor_OMPTargetParallelDirective = 263; + static const int CXCursor_OMPTargetParallelForDirective = 264; + static const int CXCursor_OMPTargetUpdateDirective = 265; + static const int CXCursor_OMPDistributeParallelForDirective = 266; + static const int CXCursor_OMPDistributeParallelForSimdDirective = 267; + static const int CXCursor_OMPDistributeSimdDirective = 268; + static const int CXCursor_OMPTargetParallelForSimdDirective = 269; + static const int CXCursor_OMPTargetSimdDirective = 270; + static const int CXCursor_OMPTeamsDistributeDirective = 271; + static const int CXCursor_OMPTeamsDistributeSimdDirective = 272; + static const int CXCursor_OMPTeamsDistributeParallelForSimdDirective = 273; + static const int CXCursor_OMPTeamsDistributeParallelForDirective = 274; + static const int CXCursor_OMPTargetTeamsDirective = 275; + static const int CXCursor_OMPTargetTeamsDistributeDirective = 276; + static const int CXCursor_OMPTargetTeamsDistributeParallelForDirective = 277; + static const int CXCursor_OMPTargetTeamsDistributeParallelForSimdDirective = + 278; + static const int CXCursor_OMPTargetTeamsDistributeSimdDirective = 279; + static const int CXCursor_BuiltinBitCastExpr = 280; + static const int CXCursor_OMPMasterTaskLoopDirective = 281; + static const int CXCursor_OMPParallelMasterTaskLoopDirective = 282; + static const int CXCursor_OMPMasterTaskLoopSimdDirective = 283; + static const int CXCursor_OMPParallelMasterTaskLoopSimdDirective = 284; + static const int CXCursor_OMPParallelMasterDirective = 285; + static const int CXCursor_LastStmt = 285; + static const int CXCursor_TranslationUnit = 300; + static const int CXCursor_FirstAttr = 400; + 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; + static const int CXCursor_ModuleImportDecl = 600; + static const int CXCursor_TypeAliasTemplateDecl = 601; + static const int CXCursor_StaticAssert = 602; + static const int CXCursor_FriendDecl = 603; + static const int CXCursor_FirstExtraDecl = 600; + static const int CXCursor_LastExtraDecl = 603; + static const int CXCursor_OverloadCandidate = 700; +} + +/// Options to control the display of diagnostics. +class CXDiagnosticDisplayOptions { + static const int CXDiagnostic_DisplaySourceLocation = 1; + static const int CXDiagnostic_DisplayColumn = 2; + static const int CXDiagnostic_DisplaySourceRanges = 4; + static const int CXDiagnostic_DisplayOption = 8; + static const int CXDiagnostic_DisplayCategoryId = 16; + static const int CXDiagnostic_DisplayCategoryName = 32; +} + +/// Identifies a specific source location within a translation unit. +class CXSourceLocation extends ffi.Struct { + ffi.Pointer _ptr_data_item_0; + ffi.Pointer _ptr_data_item_1; + ffi.Pointer _ptr_data_item_2; + + /// helper for array, supports `[]` operator + _ArrayHelper_CXSourceLocation_ptr_data get ptr_data => + _ArrayHelper_CXSourceLocation_ptr_data(this, 3); + @ffi.Uint32() + int int_data; +} + +/// Helper for array ptr_data in struct CXSourceLocation +class _ArrayHelper_CXSourceLocation_ptr_data { + final CXSourceLocation _struct; + final int length; + _ArrayHelper_CXSourceLocation_ptr_data(this._struct, this.length); + void operator []=(int index, ffi.Pointer value) { + switch (index) { + case 0: + _struct._ptr_data_item_0 = value; + break; + case 1: + _struct._ptr_data_item_1 = value; + break; + case 2: + _struct._ptr_data_item_2 = value; + break; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + ffi.Pointer operator [](int index) { + switch (index) { + case 0: + return _struct._ptr_data_item_0; + case 1: + return _struct._ptr_data_item_1; + case 2: + return _struct._ptr_data_item_2; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + @override + String toString() { + if (length == 0) return '[]'; + final sb = StringBuffer('['); + sb.write(this[0]); + for (var i = 1; i < length; i++) { + sb.write(','); + sb.write(this[i]); + } + sb.write(']'); + return sb.toString(); + } +} + +/// A character string. +class CXString extends ffi.Struct { + ffi.Pointer data; + + @ffi.Uint32() + int private_flags; +} + +class CXTranslationUnitImpl extends ffi.Struct {} + +/// Flags that control the creation of translation units. +class CXTranslationUnit_Flags { + static const int CXTranslationUnit_None = 0; + static const int CXTranslationUnit_DetailedPreprocessingRecord = 1; + static const int CXTranslationUnit_Incomplete = 2; + static const int CXTranslationUnit_PrecompiledPreamble = 4; + static const int CXTranslationUnit_CacheCompletionResults = 8; + static const int CXTranslationUnit_ForSerialization = 16; + static const int CXTranslationUnit_CXXChainedPCH = 32; + static const int CXTranslationUnit_SkipFunctionBodies = 64; + static const int CXTranslationUnit_IncludeBriefCommentsInCodeCompletion = 128; + static const int CXTranslationUnit_CreatePreambleOnFirstParse = 256; + static const int CXTranslationUnit_KeepGoing = 512; + static const int CXTranslationUnit_SingleFileParse = 1024; + static const int CXTranslationUnit_LimitSkipFunctionBodiesToPreamble = 2048; + static const int CXTranslationUnit_IncludeAttributedTypes = 4096; + static const int CXTranslationUnit_VisitImplicitAttributes = 8192; + static const int CXTranslationUnit_IgnoreNonErrorsFromIncludedFiles = 16384; + static const int CXTranslationUnit_RetainExcludedConditionalBlocks = 32768; +} + +/// The type of an element in the abstract syntax tree. +class CXType extends ffi.Struct { + @ffi.Int32() + int kind; + + ffi.Pointer _data_item_0; + ffi.Pointer _data_item_1; + ffi.Pointer _data_item_2; + + /// helper for array, supports `[]` operator + _ArrayHelper_CXType_data get data => _ArrayHelper_CXType_data(this, 3); +} + +/// Helper for array data in struct CXType +class _ArrayHelper_CXType_data { + final CXType _struct; + final int length; + _ArrayHelper_CXType_data(this._struct, this.length); + void operator []=(int index, ffi.Pointer value) { + switch (index) { + case 0: + _struct._data_item_0 = value; + break; + case 1: + _struct._data_item_1 = value; + break; + case 2: + _struct._data_item_2 = value; + break; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + ffi.Pointer operator [](int index) { + switch (index) { + case 0: + return _struct._data_item_0; + case 1: + return _struct._data_item_1; + case 2: + return _struct._data_item_2; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + @override + String toString() { + if (length == 0) return '[]'; + final sb = StringBuffer('['); + sb.write(this[0]); + for (var i = 1; i < length; i++) { + sb.write(','); + sb.write(this[i]); + } + sb.write(']'); + return sb.toString(); + } +} + +/// Describes the kind of type +class CXTypeKind { + static const int CXType_Invalid = 0; + 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; + 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; +} + +/// Provides the contents of a file that has not yet been saved to disk. +class CXUnsavedFile extends ffi.Struct { + ffi.Pointer Filename; + + ffi.Pointer Contents; + + @ffi.Uint64() + int Length; +} + +typedef ModifiedCXCursorVisitor = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, +); + +ffi.Pointer clang_Cursor_getArgument_wrap( + ffi.Pointer cursor, + int i, +) { + return _clang_Cursor_getArgument_wrap( + cursor, + i, + ); +} + +final _dart_clang_Cursor_getArgument_wrap _clang_Cursor_getArgument_wrap = + _dylib.lookupFunction<_c_clang_Cursor_getArgument_wrap, + _dart_clang_Cursor_getArgument_wrap>('clang_Cursor_getArgument_wrap'); + +typedef _c_clang_Cursor_getArgument_wrap = ffi.Pointer Function( + ffi.Pointer cursor, + ffi.Uint32 i, +); + +typedef _dart_clang_Cursor_getArgument_wrap = ffi.Pointer Function( + ffi.Pointer cursor, + int i, +); + +/// Returns the first paragraph of doxygen doc comment. +ffi.Pointer clang_Cursor_getBriefCommentText_wrap( + ffi.Pointer cursor, +) { + return _clang_Cursor_getBriefCommentText_wrap( + cursor, + ); +} + +final _dart_clang_Cursor_getBriefCommentText_wrap + _clang_Cursor_getBriefCommentText_wrap = _dylib.lookupFunction< + _c_clang_Cursor_getBriefCommentText_wrap, + _dart_clang_Cursor_getBriefCommentText_wrap>( + 'clang_Cursor_getBriefCommentText_wrap'); + +typedef _c_clang_Cursor_getBriefCommentText_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_Cursor_getBriefCommentText_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); + +int clang_Cursor_getNumArguments_wrap( + ffi.Pointer cursor, +) { + return _clang_Cursor_getNumArguments_wrap( + cursor, + ); +} + +final _dart_clang_Cursor_getNumArguments_wrap + _clang_Cursor_getNumArguments_wrap = _dylib.lookupFunction< + _c_clang_Cursor_getNumArguments_wrap, + _dart_clang_Cursor_getNumArguments_wrap>( + 'clang_Cursor_getNumArguments_wrap'); + +typedef _c_clang_Cursor_getNumArguments_wrap = ffi.Int32 Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_Cursor_getNumArguments_wrap = int Function( + ffi.Pointer cursor, +); + +ffi.Pointer clang_Type_getNamedType_wrap( + ffi.Pointer elaboratedType, +) { + return _clang_Type_getNamedType_wrap( + elaboratedType, + ); +} + +final _dart_clang_Type_getNamedType_wrap _clang_Type_getNamedType_wrap = + _dylib.lookupFunction<_c_clang_Type_getNamedType_wrap, + _dart_clang_Type_getNamedType_wrap>('clang_Type_getNamedType_wrap'); + +typedef _c_clang_Type_getNamedType_wrap = ffi.Pointer Function( + ffi.Pointer elaboratedType, +); + +typedef _dart_clang_Type_getNamedType_wrap = ffi.Pointer Function( + ffi.Pointer elaboratedType, +); + +/// Provides a shared context for creating translation units. +ffi.Pointer clang_createIndex( + int excludeDeclarationsFromPCH, + int displayDiagnostics, +) { + return _clang_createIndex( + excludeDeclarationsFromPCH, + displayDiagnostics, + ); +} + +final _dart_clang_createIndex _clang_createIndex = + _dylib.lookupFunction<_c_clang_createIndex, _dart_clang_createIndex>( + 'clang_createIndex'); + +typedef _c_clang_createIndex = ffi.Pointer Function( + ffi.Int32 excludeDeclarationsFromPCH, + ffi.Int32 displayDiagnostics, +); + +typedef _dart_clang_createIndex = ffi.Pointer Function( + int excludeDeclarationsFromPCH, + int displayDiagnostics, +); + +/// Destroy a diagnostic. +void clang_disposeDiagnostic( + ffi.Pointer Diagnostic, +) { + return _clang_disposeDiagnostic( + Diagnostic, + ); +} + +final _dart_clang_disposeDiagnostic _clang_disposeDiagnostic = _dylib + .lookupFunction<_c_clang_disposeDiagnostic, _dart_clang_disposeDiagnostic>( + 'clang_disposeDiagnostic'); + +typedef _c_clang_disposeDiagnostic = ffi.Void Function( + ffi.Pointer Diagnostic, +); + +typedef _dart_clang_disposeDiagnostic = void Function( + ffi.Pointer Diagnostic, +); + +/// Destroy the given index. +void clang_disposeIndex( + ffi.Pointer index, +) { + return _clang_disposeIndex( + index, + ); +} + +final _dart_clang_disposeIndex _clang_disposeIndex = + _dylib.lookupFunction<_c_clang_disposeIndex, _dart_clang_disposeIndex>( + 'clang_disposeIndex'); + +typedef _c_clang_disposeIndex = ffi.Void Function( + ffi.Pointer index, +); + +typedef _dart_clang_disposeIndex = void Function( + ffi.Pointer index, +); + +void clang_disposeString_wrap( + ffi.Pointer string, +) { + return _clang_disposeString_wrap( + string, + ); +} + +final _dart_clang_disposeString_wrap _clang_disposeString_wrap = + _dylib.lookupFunction<_c_clang_disposeString_wrap, + _dart_clang_disposeString_wrap>('clang_disposeString_wrap'); + +typedef _c_clang_disposeString_wrap = ffi.Void Function( + ffi.Pointer string, +); + +typedef _dart_clang_disposeString_wrap = void Function( + ffi.Pointer string, +); + +/// Destroy the specified CXTranslationUnit object. +void clang_disposeTranslationUnit( + ffi.Pointer arg0, +) { + return _clang_disposeTranslationUnit( + arg0, + ); +} + +final _dart_clang_disposeTranslationUnit _clang_disposeTranslationUnit = + _dylib.lookupFunction<_c_clang_disposeTranslationUnit, + _dart_clang_disposeTranslationUnit>('clang_disposeTranslationUnit'); + +typedef _c_clang_disposeTranslationUnit = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_disposeTranslationUnit = void Function( + ffi.Pointer arg0, +); + +ffi.Pointer clang_formatDiagnostic_wrap( + ffi.Pointer diag, + int opts, +) { + return _clang_formatDiagnostic_wrap( + diag, + opts, + ); +} + +final _dart_clang_formatDiagnostic_wrap _clang_formatDiagnostic_wrap = + _dylib.lookupFunction<_c_clang_formatDiagnostic_wrap, + _dart_clang_formatDiagnostic_wrap>('clang_formatDiagnostic_wrap'); + +typedef _c_clang_formatDiagnostic_wrap = ffi.Pointer Function( + ffi.Pointer diag, + ffi.Int32 opts, +); + +typedef _dart_clang_formatDiagnostic_wrap = ffi.Pointer Function( + ffi.Pointer diag, + int opts, +); + +ffi.Pointer clang_getArgType_wrap( + ffi.Pointer cxtype, + int i, +) { + return _clang_getArgType_wrap( + cxtype, + i, + ); +} + +final _dart_clang_getArgType_wrap _clang_getArgType_wrap = _dylib + .lookupFunction<_c_clang_getArgType_wrap, _dart_clang_getArgType_wrap>( + 'clang_getArgType_wrap'); + +typedef _c_clang_getArgType_wrap = ffi.Pointer Function( + ffi.Pointer cxtype, + ffi.Uint32 i, +); + +typedef _dart_clang_getArgType_wrap = ffi.Pointer Function( + ffi.Pointer cxtype, + int i, +); + +ffi.Pointer clang_getArrayElementType_wrap( + ffi.Pointer cxtype, +) { + return _clang_getArrayElementType_wrap( + cxtype, + ); +} + +final _dart_clang_getArrayElementType_wrap _clang_getArrayElementType_wrap = + _dylib.lookupFunction<_c_clang_getArrayElementType_wrap, + _dart_clang_getArrayElementType_wrap>('clang_getArrayElementType_wrap'); + +typedef _c_clang_getArrayElementType_wrap = ffi.Pointer Function( + ffi.Pointer cxtype, +); + +typedef _dart_clang_getArrayElementType_wrap = ffi.Pointer Function( + ffi.Pointer cxtype, +); + +ffi.Pointer clang_getCString_wrap( + ffi.Pointer string, +) { + return _clang_getCString_wrap( + string, + ); +} + +final _dart_clang_getCString_wrap _clang_getCString_wrap = _dylib + .lookupFunction<_c_clang_getCString_wrap, _dart_clang_getCString_wrap>( + 'clang_getCString_wrap'); + +typedef _c_clang_getCString_wrap = ffi.Pointer Function( + ffi.Pointer string, +); + +typedef _dart_clang_getCString_wrap = ffi.Pointer Function( + ffi.Pointer string, +); + +ffi.Pointer clang_getCanonicalType_wrap( + ffi.Pointer typerefType, +) { + return _clang_getCanonicalType_wrap( + typerefType, + ); +} + +final _dart_clang_getCanonicalType_wrap _clang_getCanonicalType_wrap = + _dylib.lookupFunction<_c_clang_getCanonicalType_wrap, + _dart_clang_getCanonicalType_wrap>('clang_getCanonicalType_wrap'); + +typedef _c_clang_getCanonicalType_wrap = ffi.Pointer Function( + ffi.Pointer typerefType, +); + +typedef _dart_clang_getCanonicalType_wrap = ffi.Pointer Function( + ffi.Pointer typerefType, +); + +ffi.Pointer clang_getCursorKindSpelling_wrap( + int kind, +) { + return _clang_getCursorKindSpelling_wrap( + kind, + ); +} + +final _dart_clang_getCursorKindSpelling_wrap _clang_getCursorKindSpelling_wrap = + _dylib.lookupFunction<_c_clang_getCursorKindSpelling_wrap, + _dart_clang_getCursorKindSpelling_wrap>( + 'clang_getCursorKindSpelling_wrap'); + +typedef _c_clang_getCursorKindSpelling_wrap = ffi.Pointer Function( + ffi.Int32 kind, +); + +typedef _dart_clang_getCursorKindSpelling_wrap = ffi.Pointer Function( + int kind, +); + +int clang_getCursorKind_wrap( + ffi.Pointer cursor, +) { + return _clang_getCursorKind_wrap( + cursor, + ); +} + +final _dart_clang_getCursorKind_wrap _clang_getCursorKind_wrap = + _dylib.lookupFunction<_c_clang_getCursorKind_wrap, + _dart_clang_getCursorKind_wrap>('clang_getCursorKind_wrap'); + +typedef _c_clang_getCursorKind_wrap = ffi.Int32 Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_getCursorKind_wrap = int Function( + ffi.Pointer cursor, +); + +ffi.Pointer clang_getCursorLocation_wrap( + ffi.Pointer cursor, +) { + return _clang_getCursorLocation_wrap( + cursor, + ); +} + +final _dart_clang_getCursorLocation_wrap _clang_getCursorLocation_wrap = + _dylib.lookupFunction<_c_clang_getCursorLocation_wrap, + _dart_clang_getCursorLocation_wrap>('clang_getCursorLocation_wrap'); + +typedef _c_clang_getCursorLocation_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_getCursorLocation_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); + +/// The name of parameter, struct, typedef. +ffi.Pointer clang_getCursorSpelling_wrap( + ffi.Pointer cursor, +) { + return _clang_getCursorSpelling_wrap( + cursor, + ); +} + +final _dart_clang_getCursorSpelling_wrap _clang_getCursorSpelling_wrap = + _dylib.lookupFunction<_c_clang_getCursorSpelling_wrap, + _dart_clang_getCursorSpelling_wrap>('clang_getCursorSpelling_wrap'); + +typedef _c_clang_getCursorSpelling_wrap = ffi.Pointer Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_getCursorSpelling_wrap = ffi.Pointer Function( + ffi.Pointer cursor, +); + +ffi.Pointer clang_getCursorType_wrap( + ffi.Pointer cursor, +) { + return _clang_getCursorType_wrap( + cursor, + ); +} + +final _dart_clang_getCursorType_wrap _clang_getCursorType_wrap = + _dylib.lookupFunction<_c_clang_getCursorType_wrap, + _dart_clang_getCursorType_wrap>('clang_getCursorType_wrap'); + +typedef _c_clang_getCursorType_wrap = ffi.Pointer Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_getCursorType_wrap = ffi.Pointer Function( + ffi.Pointer cursor, +); + +/// Retrieve a diagnostic associated with the given translation unit. +ffi.Pointer clang_getDiagnostic( + ffi.Pointer Unit, + int Index, +) { + return _clang_getDiagnostic( + Unit, + Index, + ); +} + +final _dart_clang_getDiagnostic _clang_getDiagnostic = + _dylib.lookupFunction<_c_clang_getDiagnostic, _dart_clang_getDiagnostic>( + 'clang_getDiagnostic'); + +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, +); + +int clang_getEnumConstantDeclValue_wrap( + ffi.Pointer cursor, +) { + return _clang_getEnumConstantDeclValue_wrap( + cursor, + ); +} + +final _dart_clang_getEnumConstantDeclValue_wrap + _clang_getEnumConstantDeclValue_wrap = _dylib.lookupFunction< + _c_clang_getEnumConstantDeclValue_wrap, + _dart_clang_getEnumConstantDeclValue_wrap>( + 'clang_getEnumConstantDeclValue_wrap'); + +typedef _c_clang_getEnumConstantDeclValue_wrap = ffi.Int64 Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_getEnumConstantDeclValue_wrap = int Function( + ffi.Pointer cursor, +); + +void clang_getFileLocation_wrap( + ffi.Pointer location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +) { + return _clang_getFileLocation_wrap( + location, + file, + line, + column, + offset, + ); +} + +final _dart_clang_getFileLocation_wrap _clang_getFileLocation_wrap = + _dylib.lookupFunction<_c_clang_getFileLocation_wrap, + _dart_clang_getFileLocation_wrap>('clang_getFileLocation_wrap'); + +typedef _c_clang_getFileLocation_wrap = ffi.Void Function( + ffi.Pointer location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _dart_clang_getFileLocation_wrap = void Function( + ffi.Pointer location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +ffi.Pointer clang_getFileName_wrap( + ffi.Pointer SFile, +) { + return _clang_getFileName_wrap( + SFile, + ); +} + +final _dart_clang_getFileName_wrap _clang_getFileName_wrap = _dylib + .lookupFunction<_c_clang_getFileName_wrap, _dart_clang_getFileName_wrap>( + 'clang_getFileName_wrap'); + +typedef _c_clang_getFileName_wrap = ffi.Pointer Function( + ffi.Pointer SFile, +); + +typedef _dart_clang_getFileName_wrap = ffi.Pointer Function( + ffi.Pointer SFile, +); + +int clang_getNumArgTypes_wrap( + ffi.Pointer cxtype, +) { + return _clang_getNumArgTypes_wrap( + cxtype, + ); +} + +final _dart_clang_getNumArgTypes_wrap _clang_getNumArgTypes_wrap = + _dylib.lookupFunction<_c_clang_getNumArgTypes_wrap, + _dart_clang_getNumArgTypes_wrap>('clang_getNumArgTypes_wrap'); + +typedef _c_clang_getNumArgTypes_wrap = ffi.Int32 Function( + ffi.Pointer cxtype, +); + +typedef _dart_clang_getNumArgTypes_wrap = int Function( + ffi.Pointer cxtype, +); + +/// Determine the number of diagnostics produced for the given translation unit. +int clang_getNumDiagnostics( + ffi.Pointer Unit, +) { + return _clang_getNumDiagnostics( + Unit, + ); +} + +final _dart_clang_getNumDiagnostics _clang_getNumDiagnostics = _dylib + .lookupFunction<_c_clang_getNumDiagnostics, _dart_clang_getNumDiagnostics>( + 'clang_getNumDiagnostics'); + +typedef _c_clang_getNumDiagnostics = ffi.Uint32 Function( + ffi.Pointer Unit, +); + +typedef _dart_clang_getNumDiagnostics = int Function( + ffi.Pointer Unit, +); + +int clang_getNumElements_wrap( + ffi.Pointer cxtype, +) { + return _clang_getNumElements_wrap( + cxtype, + ); +} + +final _dart_clang_getNumElements_wrap _clang_getNumElements_wrap = + _dylib.lookupFunction<_c_clang_getNumElements_wrap, + _dart_clang_getNumElements_wrap>('clang_getNumElements_wrap'); + +typedef _c_clang_getNumElements_wrap = ffi.Uint64 Function( + ffi.Pointer cxtype, +); + +typedef _dart_clang_getNumElements_wrap = int Function( + ffi.Pointer cxtype, +); + +ffi.Pointer clang_getPointeeType_wrap( + ffi.Pointer pointerType, +) { + return _clang_getPointeeType_wrap( + pointerType, + ); +} + +final _dart_clang_getPointeeType_wrap _clang_getPointeeType_wrap = + _dylib.lookupFunction<_c_clang_getPointeeType_wrap, + _dart_clang_getPointeeType_wrap>('clang_getPointeeType_wrap'); + +typedef _c_clang_getPointeeType_wrap = ffi.Pointer Function( + ffi.Pointer pointerType, +); + +typedef _dart_clang_getPointeeType_wrap = ffi.Pointer Function( + ffi.Pointer pointerType, +); + +ffi.Pointer clang_getResultType_wrap( + ffi.Pointer functionType, +) { + return _clang_getResultType_wrap( + functionType, + ); +} + +final _dart_clang_getResultType_wrap _clang_getResultType_wrap = + _dylib.lookupFunction<_c_clang_getResultType_wrap, + _dart_clang_getResultType_wrap>('clang_getResultType_wrap'); + +typedef _c_clang_getResultType_wrap = ffi.Pointer Function( + ffi.Pointer functionType, +); + +typedef _dart_clang_getResultType_wrap = ffi.Pointer Function( + ffi.Pointer functionType, +); + +ffi.Pointer clang_getTranslationUnitCursor_wrap( + ffi.Pointer tu, +) { + return _clang_getTranslationUnitCursor_wrap( + tu, + ); +} + +final _dart_clang_getTranslationUnitCursor_wrap + _clang_getTranslationUnitCursor_wrap = _dylib.lookupFunction< + _c_clang_getTranslationUnitCursor_wrap, + _dart_clang_getTranslationUnitCursor_wrap>( + 'clang_getTranslationUnitCursor_wrap'); + +typedef _c_clang_getTranslationUnitCursor_wrap = ffi.Pointer Function( + ffi.Pointer tu, +); + +typedef _dart_clang_getTranslationUnitCursor_wrap = ffi.Pointer + Function( + ffi.Pointer tu, +); + +ffi.Pointer clang_getTypeDeclaration_wrap( + ffi.Pointer cxtype, +) { + return _clang_getTypeDeclaration_wrap( + cxtype, + ); +} + +final _dart_clang_getTypeDeclaration_wrap _clang_getTypeDeclaration_wrap = + _dylib.lookupFunction<_c_clang_getTypeDeclaration_wrap, + _dart_clang_getTypeDeclaration_wrap>('clang_getTypeDeclaration_wrap'); + +typedef _c_clang_getTypeDeclaration_wrap = ffi.Pointer Function( + ffi.Pointer cxtype, +); + +typedef _dart_clang_getTypeDeclaration_wrap = ffi.Pointer Function( + ffi.Pointer cxtype, +); + +ffi.Pointer clang_getTypeKindSpelling_wrap( + int typeKind, +) { + return _clang_getTypeKindSpelling_wrap( + typeKind, + ); +} + +final _dart_clang_getTypeKindSpelling_wrap _clang_getTypeKindSpelling_wrap = + _dylib.lookupFunction<_c_clang_getTypeKindSpelling_wrap, + _dart_clang_getTypeKindSpelling_wrap>('clang_getTypeKindSpelling_wrap'); + +typedef _c_clang_getTypeKindSpelling_wrap = ffi.Pointer Function( + ffi.Int32 typeKind, +); + +typedef _dart_clang_getTypeKindSpelling_wrap = ffi.Pointer Function( + int typeKind, +); + +ffi.Pointer clang_getTypeSpelling_wrap( + ffi.Pointer type, +) { + return _clang_getTypeSpelling_wrap( + type, + ); +} + +final _dart_clang_getTypeSpelling_wrap _clang_getTypeSpelling_wrap = + _dylib.lookupFunction<_c_clang_getTypeSpelling_wrap, + _dart_clang_getTypeSpelling_wrap>('clang_getTypeSpelling_wrap'); + +typedef _c_clang_getTypeSpelling_wrap = ffi.Pointer Function( + ffi.Pointer type, +); + +typedef _dart_clang_getTypeSpelling_wrap = ffi.Pointer Function( + ffi.Pointer type, +); + +ffi.Pointer clang_getTypedefDeclUnderlyingType_wrap( + ffi.Pointer cxcursor, +) { + return _clang_getTypedefDeclUnderlyingType_wrap( + cxcursor, + ); +} + +final _dart_clang_getTypedefDeclUnderlyingType_wrap + _clang_getTypedefDeclUnderlyingType_wrap = _dylib.lookupFunction< + _c_clang_getTypedefDeclUnderlyingType_wrap, + _dart_clang_getTypedefDeclUnderlyingType_wrap>( + 'clang_getTypedefDeclUnderlyingType_wrap'); + +typedef _c_clang_getTypedefDeclUnderlyingType_wrap = ffi.Pointer + Function( + ffi.Pointer cxcursor, +); + +typedef _dart_clang_getTypedefDeclUnderlyingType_wrap = ffi.Pointer + Function( + ffi.Pointer cxcursor, +); + +/// Same as clang_parseTranslationUnit2, but returns the CXTranslationUnit instead of an error code. In case of an error this routine returns a NULL CXTranslationUnit, without further detailed error codes. +ffi.Pointer clang_parseTranslationUnit( + 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, +) { + return _clang_parseTranslationUnit( + CIdx, + source_filename, + command_line_args, + num_command_line_args, + unsaved_files, + num_unsaved_files, + options, + ); +} + +final _dart_clang_parseTranslationUnit _clang_parseTranslationUnit = + _dylib.lookupFunction<_c_clang_parseTranslationUnit, + _dart_clang_parseTranslationUnit>('clang_parseTranslationUnit'); + +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, +); + +/// Visitor is a function pointer with parameters having pointers to cxcursor instead of cxcursor by default. +int clang_visitChildren_wrap( + ffi.Pointer parent, + ffi.Pointer> _modifiedVisitor, + ffi.Pointer clientData, +) { + return _clang_visitChildren_wrap( + parent, + _modifiedVisitor, + clientData, + ); +} + +final _dart_clang_visitChildren_wrap _clang_visitChildren_wrap = + _dylib.lookupFunction<_c_clang_visitChildren_wrap, + _dart_clang_visitChildren_wrap>('clang_visitChildren_wrap'); + +typedef _c_clang_visitChildren_wrap = ffi.Uint32 Function( + ffi.Pointer parent, + ffi.Pointer> _modifiedVisitor, + ffi.Pointer clientData, +); + +typedef _dart_clang_visitChildren_wrap = int Function( + ffi.Pointer parent, + ffi.Pointer> _modifiedVisitor, + ffi.Pointer clientData, +); diff --git a/pkgs/ffigen/lib/src/header_parser/data.dart b/pkgs/ffigen/lib/src/header_parser/data.dart new file mode 100644 index 0000000000..900c0ff5f4 --- /dev/null +++ b/pkgs/ffigen/lib/src/header_parser/data.dart @@ -0,0 +1,9 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/config_provider.dart'; +/// Holds all Global shared variables. + +/// Holds configurations. +Config config; diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart new file mode 100644 index 0000000000..23698a5f45 --- /dev/null +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -0,0 +1,95 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:meta/meta.dart'; +import 'package:path/path.dart' as p; +import 'data.dart'; + +/// Utility functions to check whether a binding should be parsed or not +/// based on filters and if a binding is seen already. + +// Stores binding names already scene. +Set _structs = {}; +Set _functions = {}; +Set _enumClass = {}; +Set _typedefC = {}; + +bool shouldIncludeStruct(String name) { + if (_structs.contains(name) || name == '') { + return false; + } else if (config.structFilters == null || + config.structFilters.shouldInclude(name)) { + _structs.add(name); + return true; + } else { + return false; + } +} + +bool shouldIncludeFunc(String name) { + if (_functions.contains(name) || name == '') { + return false; + } else if (config.functionFilters == null || + config.functionFilters.shouldInclude(name)) { + _functions.add(name); + return true; + } else { + return false; + } +} + +bool shouldIncludeEnumClass(String name) { + if (_enumClass.contains(name) || name == '') { + return false; + } else if (config.enumClassFilters == null || + config.enumClassFilters.shouldInclude(name)) { + _enumClass.add(name); + return true; + } else { + return false; + } +} + +/// True if a cursor should be included based on header-filter, use for root +/// declarations. +bool shouldIncludeRootCursor(String sourceFile) { + final name = p.basename(sourceFile); + + if (config.headerFilter.excludedInclusionHeaders.contains(name)) { + return false; + } + + if (config.headerFilter.includedInclusionHeaders.contains(name)) { + return true; + } + + // If any includedInclusionHeaders is provided, return false. + if (config.headerFilter.includedInclusionHeaders.isNotEmpty) { + return false; + } else { + return true; + } +} + +bool isUnseenTypedefC(String name, {@required bool addToSeen}) { + if (_typedefC.contains(name)) { + return false; + } else { + if (addToSeen) { + _typedefC.add(name); + } + return true; + } +} + +bool isUnseenStruct(String name, {@required bool addToSeen}) { + if (_structs.contains(name)) { + return false; + } else { + if (addToSeen) { + _structs.add(name); + } + return true; + } +} diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart new file mode 100644 index 0000000000..eac3c93c41 --- /dev/null +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -0,0 +1,96 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:ffi'; + +import 'package:ffi/ffi.dart'; +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser/translation_unit_parser.dart'; +import 'package:logging/logging.dart'; + +import 'clang_bindings/clang_bindings.dart' as clang; +import 'data.dart' as data; +import 'utils.dart'; + +/// Main entrypoint for header_parser. +Library parse(Config conf, {bool sort = false}) { + initParser(conf); + + final bindings = parseToBindings(); + + final library = Library(bindings: bindings); + + if (sort) { + library.sort(); + } + return library; +} + +// =================================================================================== +// BELOW FUNCTIONS ARE MEANT FOR INTERNAL USE AND TESTING +// =================================================================================== + +var _logger = Logger('parser:parser'); + +/// initialises parser, clears any previous values. +void initParser(Config c) { + data.config = c; + + clang.init(DynamicLibrary.open(data.config.libclang_dylib_path)); +} + +/// Parses source files and adds generated bindings to [bindings]. +List parseToBindings() { + final index = clang.clang_createIndex(0, 0); + + Pointer> clangCmdArgs = nullptr; + var cmdLen = 0; + if (data.config.compilerOpts != null) { + clangCmdArgs = createDynamicStringArray(data.config.compilerOpts); + cmdLen = data.config.compilerOpts.length; + } + + // Contains all bindings. + final bindings = []; + + // Log all headers for user. + _logger.info('Input Headers: ${data.config.headers}'); + + for (final headerLocation in data.config.headers) { + _logger.fine('Creating TranslationUnit for header: $headerLocation'); + + final tu = clang.clang_parseTranslationUnit( + index, + Utf8.toUtf8(headerLocation).cast(), + clangCmdArgs.cast(), + cmdLen, + nullptr, + 0, + clang.CXTranslationUnit_Flags.CXTranslationUnit_SkipFunctionBodies, + ); + + if (tu == nullptr) { + _logger.severe( + "Skipped header/file: $headerLocation, couldn't parse source."); + // Skip parsing this header. + continue; + } + + logTuDiagnostics(tu, _logger, headerLocation); + final rootCursor = clang.clang_getTranslationUnitCursor_wrap(tu); + + bindings.addAll(parseTranslationUnit(rootCursor)); + + // Cleanup. + rootCursor.dispose(); + clang.clang_disposeTranslationUnit(tu); + } + + if (data.config.compilerOpts != null) { + clangCmdArgs.dispose(data.config.compilerOpts.length); + } + clang.clang_disposeIndex(index); + return bindings; +} diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart new file mode 100644 index 0000000000..19fd1cede3 --- /dev/null +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -0,0 +1,88 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:ffi'; + +import 'package:ffigen/src/code_generator.dart'; +import 'package:logging/logging.dart'; + +import '../clang_bindings/clang_bindings.dart' as clang; +import '../includer.dart'; +import '../utils.dart'; + +var _logger = Logger('parser:enumdecl_parser'); + +/// Temporarily holds a enumClass before its returned by [parseEnumDeclaration]. +EnumClass _enumClass; + +/// Parses a function declaration. +EnumClass parseEnumDeclaration( + Pointer cursor, { + + /// Optionally provide name to use (useful in case struct is inside a typedef). + String name, +}) { + _enumClass = null; + + final enumName = name ?? cursor.spelling(); + if (enumName == '') { + _logger.finest('unnamed enum declaration'); + } else if (shouldIncludeEnumClass(enumName)) { + _logger.fine('++++ Adding Enum: ${cursor.completeStringRepr()}'); + _enumClass = EnumClass( + dartDoc: getCursorDocComment(cursor), + name: enumName, + ); + _addEnumConstant(cursor); + } + + return _enumClass; +} + +void _addEnumConstant(Pointer cursor) { + final resultCode = clang.clang_visitChildren_wrap( + cursor, + Pointer.fromFunction( + _enumCursorVisitor, clang.CXChildVisitResult.CXChildVisit_Break), + nullptr, + ); + + visitChildrenResultChecker(resultCode); +} + +/// Visitor for a enum cursor [clang.CXCursorKind.CXCursor_EnumDecl]. +/// +/// Invoked on every enum directly under rootCursor. +/// Used for for extracting enum values. +int _enumCursorVisitor(Pointer cursor, + Pointer parent, Pointer clientData) { + try { + _logger.finest(' enumCursorVisitor: ${cursor.completeStringRepr()}'); + switch (clang.clang_getCursorKind_wrap(cursor)) { + case clang.CXCursorKind.CXCursor_EnumConstantDecl: + _addEnumConstantToEnumClass(cursor); + break; + default: + print('invalid enum constant'); + } + cursor.dispose(); + parent.dispose(); + } catch (e, s) { + _logger.severe(e); + _logger.severe(s); + rethrow; + } + return clang.CXChildVisitResult.CXChildVisit_Continue; +} + +/// Adds the parameter to func in [functiondecl_parser.dart]. +void _addEnumConstantToEnumClass(Pointer cursor) { + _enumClass.enumConstants.add( + EnumConstant( + // Extracting doc comment doesn't always give the right comment + // so we are skipping dartdoc for individual enum constants. + name: cursor.spelling(), + value: clang.clang_getEnumConstantDeclValue_wrap(cursor)), + ); +} diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart new file mode 100644 index 0000000000..62803f6491 --- /dev/null +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -0,0 +1,113 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:ffi'; + +import 'package:ffigen/src/code_generator.dart'; +import 'package:logging/logging.dart'; + +import '../clang_bindings/clang_bindings.dart' as clang; +import '../includer.dart'; +import '../utils.dart'; + +var _logger = Logger('parser:functiondecl_parser'); + +/// Temporarily holds a function before its returned by [parseFunctionDeclaration]. +Func _func; + +/// Parses a function declaration. +Func parseFunctionDeclaration(Pointer cursor) { + _func = null; + structByValueParameter = false; + unimplementedParameterType = false; + constantArrayParameterType = false; + + final name = cursor.spelling(); + if (shouldIncludeFunc(name)) { + _logger.fine('++++ Adding Function: ${cursor.completeStringRepr()}'); + + final rt = _getFunctionReturnType(cursor); + final parameters = _getParameters(cursor); + + //TODO(3): Remove this when support for Structs by value arrives. + if (rt.broadType == BroadType.Struct || structByValueParameter) { + _logger.fine( + '---- Removed Function, reason: struct pass/return by value: ${cursor.completeStringRepr()}'); + _logger.warning( + "Skipped Function '$name', struct pass/return by value not supported."); + return null; // Returning null so that [addToBindings] function excludes this. + } + + if (constantArrayParameterType) { + _logger.fine( + '---- Removed Function, reason: constant array passed to function parameter: ${cursor.completeStringRepr()}'); + _logger.warning( + "Skipped Function '$name', constant array in function parameter not supported."); + return null; // Returning null so that [addToBindings] function excludes this. + } + + if (rt.getBaseBroadType() == BroadType.Unimplemented || + unimplementedParameterType) { + _logger.fine( + '---- Removed Function, reason: unsupported return type or parameter type: ${cursor.completeStringRepr()}'); + _logger.warning( + "Skipped Function '$name', function has unsupported return type or parameter type."); + return null; // Returning null so that [addToBindings] function excludes this. + } + + _func = Func( + dartDoc: getCursorDocComment(cursor), + name: name, + returnType: rt, + parameters: parameters, + ); + } + + return _func; +} + +bool structByValueParameter = false; +bool constantArrayParameterType = false; +bool unimplementedParameterType = false; +Type _getFunctionReturnType(Pointer cursor) { + return cursor.returnType().toCodeGenTypeAndDispose(); +} + +List _getParameters(Pointer cursor) { + final parameters = []; + + final totalArgs = clang.clang_Cursor_getNumArguments_wrap(cursor); + for (var i = 0; i < totalArgs; i++) { + final paramCursor = clang.clang_Cursor_getArgument_wrap(cursor, i); + + _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) { + structByValueParameter = true; + } else if (pt.broadType == BroadType.ConstantArray) { + constantArrayParameterType = true; + } else if (pt.getBaseBroadType() == BroadType.Unimplemented) { + unimplementedParameterType = true; + } + + final pn = paramCursor.spelling(); + + /// If [pn] is null or empty, its set to `arg$i` by code_generator. + parameters.add( + Parameter( + name: pn, + type: pt, + ), + ); + paramCursor.dispose(); + } + + return parameters; +} + +Type _getParameterType(Pointer cursor) { + return cursor.type().toCodeGenTypeAndDispose(); +} diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart new file mode 100644 index 0000000000..27d8efddab --- /dev/null +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -0,0 +1,129 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:ffi'; + +import 'package:ffigen/src/code_generator.dart'; +import 'package:logging/logging.dart'; + +import '../clang_bindings/clang_bindings.dart' as clang; +import '../includer.dart'; +import '../utils.dart'; + +var _logger = Logger('parser:structdecl_parser'); + +/// Temporarily holds a struc before its returned by [parseStructDeclaration]. +Struc _struc; + +/// Parses a struct declaration. +Struc parseStructDeclaration( + Pointer cursor, { + + /// Optionally provide name (useful in case struct is inside a typedef). + String name, + + /// Option to override shouldInclude methods. (Useful in case of extracting + /// structs when they are passed/returned by an included function.) + /// + /// Check if binding is not already included before setting this to true. + bool doInclude = false, +}) { + _struc = null; + final structName = name ?? cursor.spelling(); + + if (structName == '') { + _logger.finest('unnamed structure or typedef structure declaration'); + return null; + } else if (doInclude || shouldIncludeStruct(structName)) { + _logger.fine( + '++++ Adding Structure: structName: ${structName}, ${cursor.completeStringRepr()}'); + + final members = _getMembers(cursor, structName); + _struc = Struc( + dartDoc: getCursorDocComment(cursor), + name: structName, + members: members, + ); + } + + return _struc; +} + +List _members; +List _getMembers(Pointer cursor, String structName) { + _members = []; + nestedStructMember = false; + unimplementedMemberType = false; + + final resultCode = clang.clang_visitChildren_wrap( + cursor, + Pointer.fromFunction( + _structMembersVisitor, clang.CXChildVisitResult.CXChildVisit_Break), + nullptr); + + visitChildrenResultChecker(resultCode); + + // Returning null to exclude the struct members as it has a struct by value field. + if (nestedStructMember) { + _logger.fine( + '---- Removed Struct members, reason: struct has struct members ${cursor.completeStringRepr()}'); + _logger.warning( + "Removed All Struct Members from '$structName', Nested Structures not supported."); + return null; + } else if (unimplementedMemberType) { + _logger.fine( + '---- Removed Struct members, reason: member with unimplementedtype ${cursor.completeStringRepr()}'); + _logger.warning( + "Removed All Struct Members from '$structName', struct member has an unsupported type."); + return null; + } + + return _members; +} + +bool nestedStructMember = false; +bool unimplementedMemberType = false; + +/// Visitor for the struct cursor [CXCursorKind.CXCursor_StructDecl]. +/// +/// Child visitor invoked on struct cursor. +int _structMembersVisitor(Pointer cursor, + Pointer parent, Pointer clientData) { + try { + if (cursor.kind() == clang.CXCursorKind.CXCursor_FieldDecl) { + _logger.finer('===== member: ${cursor.completeStringRepr()}'); + + final mt = cursor.type().toCodeGenTypeAndDispose(); + + //TODO(4): Remove these when support for Structs by value arrives. + if (mt.broadType == BroadType.Struct) { + // Setting this flag will exclude adding members for this struct's bindings. + nestedStructMember = true; + } else if (mt.broadType == BroadType.ConstantArray) { + if (mt.elementType.broadType == BroadType.Struct) { + // Setting this flag will exclude adding members for this struct's bindings. + nestedStructMember = true; + } + } + + if (mt.getBaseBroadType() == BroadType.Unimplemented) { + unimplementedMemberType = true; + } + + _members.add( + Member( + name: cursor.spelling(), + type: mt, + ), + ); + } + cursor.dispose(); + parent.dispose(); + } catch (e, s) { + _logger.severe(e); + _logger.severe(s); + rethrow; + } + return clang.CXChildVisitResult.CXChildVisit_Continue; +} diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart new file mode 100644 index 0000000000..c68b5e3320 --- /dev/null +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart @@ -0,0 +1,71 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:ffi'; + +import 'package:ffigen/src/code_generator.dart'; +import 'package:logging/logging.dart'; + +import '../clang_bindings/clang_bindings.dart' as clang; +import '../sub_parsers/enumdecl_parser.dart'; +import '../sub_parsers/structdecl_parser.dart'; +import '../utils.dart'; + +var _logger = Logger('parser:typedefdecl_parser'); + +/// Temporarily holds a binding before its returned by [parseTypedefDeclaration]. +Binding _binding; + +/// Temporarily holds parent cursor name. +String _typedefName; + +/// Parses a typedef declaration. +Binding parseTypedefDeclaration(Pointer cursor) { + _binding = null; + // Name of typedef. + _typedefName = cursor.spelling(); + + final resultCode = clang.clang_visitChildren_wrap( + cursor, + Pointer.fromFunction(_typedefdeclarationCursorVisitor, + clang.CXChildVisitResult.CXChildVisit_Break), + nullptr, + ); + + visitChildrenResultChecker(resultCode); + + return _binding; +} + +/// Visitor for extracting binding for a TypedefDeclarations of a +/// [clang.CXCursorKind.CXCursor_TypedefDecl]. +/// +/// Visitor invoked on cursor of type declaration returned by +/// [clang.clang_getTypeDeclaration_wrap]. +int _typedefdeclarationCursorVisitor(Pointer cursor, + Pointer parent, Pointer clientData) { + try { + _logger.finest( + 'typedefdeclarationCursorVisitor: ${cursor.completeStringRepr()}'); + + switch (clang.clang_getCursorKind_wrap(cursor)) { + case clang.CXCursorKind.CXCursor_StructDecl: + _binding = parseStructDeclaration(cursor, name: _typedefName); + break; + case clang.CXCursorKind.CXCursor_EnumDecl: + _binding = parseEnumDeclaration(cursor, name: _typedefName); + break; + default: + _logger.finest('typedefdeclarationCursorVisitor: Ignored'); + } + + cursor.dispose(); + parent.dispose(); + } catch (e, s) { + _logger.severe(e); + _logger.severe(s); + rethrow; + } + return clang.CXChildVisitResult.CXChildVisit_Continue; +} diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart new file mode 100644 index 0000000000..8632b259c0 --- /dev/null +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -0,0 +1,80 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:ffi'; + +import 'package:ffigen/src/code_generator.dart'; +import 'package:logging/logging.dart'; + +import 'clang_bindings/clang_bindings.dart' as clang; +import 'includer.dart'; +import 'sub_parsers/enumdecl_parser.dart'; +import 'sub_parsers/functiondecl_parser.dart'; +import 'sub_parsers/structdecl_parser.dart'; +import 'sub_parsers/typedefdecl_parser.dart'; +import 'utils.dart'; + +var _logger = Logger('parser:root_parser'); + +List _bindings; + +/// Parses the translation unit and returns the generated bindings. +List parseTranslationUnit(Pointer translationUnitCursor) { + _bindings = []; + + final resultCode = clang.clang_visitChildren_wrap( + translationUnitCursor, + Pointer.fromFunction( + _rootCursorVisitor, clang.CXChildVisitResult.CXChildVisit_Break), + nullptr, + ); + + visitChildrenResultChecker(resultCode); + + return _bindings; +} + +/// Child visitor invoked on translationUnitCursor [CXCursorKind.CXCursor_TranslationUnit]. +int _rootCursorVisitor(Pointer cursor, + Pointer parent, Pointer clientData) { + try { + if (shouldIncludeRootCursor(cursor.sourceFileName())) { + _logger.finest('rootCursorVisitor: ${cursor.completeStringRepr()}'); + switch (clang.clang_getCursorKind_wrap(cursor)) { + case clang.CXCursorKind.CXCursor_FunctionDecl: + addToBindings(parseFunctionDeclaration(cursor)); + break; + case clang.CXCursorKind.CXCursor_TypedefDecl: + addToBindings(parseTypedefDeclaration(cursor)); + break; + case clang.CXCursorKind.CXCursor_StructDecl: + addToBindings(parseStructDeclaration(cursor)); + break; + case clang.CXCursorKind.CXCursor_EnumDecl: + addToBindings(parseEnumDeclaration(cursor)); + break; + default: + _logger.finer('rootCursorVisitor: CursorKind not implemented'); + } + } else { + _logger.finest( + 'rootCursorVisitor:(excluded in header-filter) ${cursor.completeStringRepr()}'); + } + + cursor.dispose(); + parent.dispose(); + } catch (e, s) { + _logger.severe(e); + _logger.severe(s); + rethrow; + } + return clang.CXChildVisitResult.CXChildVisit_Continue; +} + +/// Adds to binding if not null. +void addToBindings(Binding b) { + if (b != null) { + _bindings.add(b); + } +} diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart new file mode 100644 index 0000000000..6dd175f4fc --- /dev/null +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart @@ -0,0 +1,43 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/header_parser/clang_bindings/clang_bindings.dart' + as clang; +import 'package:ffigen/src/code_generator.dart' show SupportedNativeType; + +/// Utility to convert CXType to [code_generator.Type]. +/// +/// Key: CXTypekindEnum, Value: TypeString for code_generator +var cxTypeKindToSupportedNativeTypes = { + clang.CXTypeKind.CXType_Void: SupportedNativeType.Void, + clang.CXTypeKind.CXType_UChar: SupportedNativeType.Uint8, + clang.CXTypeKind.CXType_UShort: SupportedNativeType.Uint16, + clang.CXTypeKind.CXType_UInt: SupportedNativeType.Uint32, + clang.CXTypeKind.CXType_ULong: SupportedNativeType.Uint64, + clang.CXTypeKind.CXType_ULongLong: SupportedNativeType.Uint64, + clang.CXTypeKind.CXType_SChar: SupportedNativeType.Int8, + clang.CXTypeKind.CXType_Short: SupportedNativeType.Int16, + clang.CXTypeKind.CXType_Int: SupportedNativeType.Int32, + clang.CXTypeKind.CXType_Long: SupportedNativeType.Int64, + clang.CXTypeKind.CXType_LongLong: SupportedNativeType.Int64, + clang.CXTypeKind.CXType_Float: SupportedNativeType.Float, + clang.CXTypeKind.CXType_Double: SupportedNativeType.Double, + clang.CXTypeKind.CXType_Char_S: SupportedNativeType.Int8, + clang.CXTypeKind.CXType_Enum: SupportedNativeType.Int32, +}; + +SupportedNativeType get enumNativeType => + cxTypeKindToSupportedNativeTypes[clang.CXTypeKind.CXType_Enum]; + +var suportedTypedefToSuportedNativeType = { + 'uint8_t': SupportedNativeType.Uint8, + 'uint16_t': SupportedNativeType.Uint16, + 'uint32_t': SupportedNativeType.Uint32, + 'uint64_t': SupportedNativeType.Uint64, + 'int8_t': SupportedNativeType.Int8, + 'int16_t': SupportedNativeType.Int16, + 'int32_t': SupportedNativeType.Int32, + 'int64_t': SupportedNativeType.Int64, + 'intptr_t': SupportedNativeType.IntPtr, +}; diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart new file mode 100644 index 0000000000..db374876f2 --- /dev/null +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -0,0 +1,154 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// Extracts code_gen Type from type. +import 'dart:ffi'; + +import 'package:ffigen/src/code_generator.dart'; +import 'package:logging/logging.dart'; + +import '../clang_bindings/clang_bindings.dart' as clang; +import '../data.dart'; +import '../includer.dart'; +import '../sub_parsers/structdecl_parser.dart'; +import '../translation_unit_parser.dart'; +import '../type_extractor/cxtypekindmap.dart'; +import '../utils.dart'; + +var _logger = Logger('parser:extractor'); +const _padding = ' '; + +/// Converts cxtype to a typestring code_generator can accept. +Type getCodeGenType(Pointer cxtype, {String parentName}) { + _logger.fine('${_padding}getCodeGenType ${cxtype.completeStringRepr()}'); + final kind = cxtype.kind(); + + switch (kind) { + case clang.CXTypeKind.CXType_Pointer: + final pt = clang.clang_getPointeeType_wrap(cxtype); + final s = getCodeGenType(pt, parentName: parentName); + pt.dispose(); + return Type.pointer(s); + case clang.CXTypeKind.CXType_Typedef: + // Get name from typedef name if config allows. + if (config.useSupportedTypedefs) { + final spelling = cxtype.spelling(); + if (suportedTypedefToSuportedNativeType.containsKey(spelling)) { + _logger.fine(' Type Mapped from supported typedef'); + return Type.nativeType(suportedTypedefToSuportedNativeType[spelling]); + } + } + + // This is important or we get stuck in infinite recursion. + final ct = clang.clang_getCanonicalType_wrap(cxtype); + + final s = getCodeGenType(ct, parentName: parentName ?? cxtype.spelling()); + ct.dispose(); + return s; + case clang.CXTypeKind.CXType_Elaborated: + final et = clang.clang_Type_getNamedType_wrap(cxtype); + final s = getCodeGenType(et, parentName: parentName); + et.dispose(); + return s; + case clang.CXTypeKind.CXType_Record: + return _extractfromRecord(cxtype); + case clang.CXTypeKind.CXType_Enum: + return Type.nativeType( + enumNativeType, + ); + case clang.CXTypeKind + .CXType_FunctionProto: // Primarily used for function pointers. + return _extractFromFunctionProto(cxtype, parentName); + case clang.CXTypeKind + .CXType_ConstantArray: // Primarily used for constant array in struct members. + return Type.constantArray( + clang.clang_getNumElements_wrap(cxtype), + clang.clang_getArrayElementType_wrap(cxtype).toCodeGenTypeAndDispose(), + ); + default: + if (cxTypeKindToSupportedNativeTypes.containsKey(kind)) { + return Type.nativeType( + cxTypeKindToSupportedNativeTypes[kind], + ); + } else { + _logger.fine( + 'typedeclarationCursorVisitor: getCodeGenType: Type Not Implemented, ${cxtype.completeStringRepr()}'); + return Type.unimplemented( + 'Type: ${cxtype.kindSpelling()} not implemented'); + } + } +} + +Type _extractfromRecord(Pointer cxtype) { + Type type; + + final cursor = clang.clang_getTypeDeclaration_wrap(cxtype); + _logger.fine('${_padding}_extractfromRecord: ${cursor.completeStringRepr()}'); + + switch (clang.clang_getCursorKind_wrap(cursor)) { + case clang.CXCursorKind.CXCursor_StructDecl: + final cxtype = cursor.type(); + var structName = cursor.spelling(); + if (structName == '') { + // Incase of anonymous structs defined inside a typedef. + structName = cxtype.spelling(); + } + + type = Type.struct(structName); + + // Also add a struct binding, if its unseen. + if (isUnseenStruct(structName, addToSeen: true)) { + addToBindings( + parseStructDeclaration(cursor, name: structName, doInclude: true)); + } + + cxtype.dispose(); + break; + default: + _logger.fine( + 'typedeclarationCursorVisitor: _extractfromRecord: Not Implemented, ${cursor.completeStringRepr()}'); + return Type.unimplemented( + 'Type: ${cxtype.kindSpelling()} not implemented'); + } + cursor.dispose(); + return type; +} + +// Used for function pointer arguments. +Type _extractFromFunctionProto( + Pointer cxtype, String parentName) { + var name = parentName; + + // Set a name for typedefc incase it was null or empty. + if (name == null || name == '') { + name = _getNextUniqueString('_typedefC_noname'); + } + + if (isUnseenTypedefC(name, addToSeen: true)) { + final typedefC = TypedefC( + name: name, + returnType: + clang.clang_getResultType_wrap(cxtype).toCodeGenTypeAndDispose(), + ); + final totalArgs = clang.clang_getNumArgTypes_wrap(cxtype); + for (var i = 0; i < totalArgs; i++) { + final t = clang.clang_getArgType_wrap(cxtype, i); + typedefC.parameters.add( + Parameter(name: '', type: t.toCodeGenTypeAndDispose()), + ); + } + addToBindings(typedefC); + } + return Type.nativeFunc(name); +} + +/// Generate a unique string for naming in [TypedefC]. +String _getNextUniqueString(String prefix) { + int i = _uniqueStringCounters[prefix] ?? 0; + i++; + _uniqueStringCounters[prefix] = i; + return '${prefix}_$i'; +} + +Map _uniqueStringCounters = {}; diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart new file mode 100644 index 0000000000..254a950513 --- /dev/null +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -0,0 +1,208 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:ffi'; + +import 'package:ffi/ffi.dart'; +import 'package:ffigen/src/code_generator.dart'; +import 'package:logging/logging.dart'; + +import 'clang_bindings/clang_bindings.dart' as clang; +import 'data.dart'; +import 'type_extractor/extractor.dart'; + +/// Check [resultCode] of [clang.clang_visitChildren_wrap]. +/// +/// Throws exception if resultCode is not 0. +void visitChildrenResultChecker(int resultCode) { + if (resultCode != 0) { + throw Exception( + 'Exception thrown in a dart function called via C, use --verbose to see more details'); + } +} + +/// Logs the warnings/errors returned by clang for a translation unit. +void logTuDiagnostics( + Pointer tu, + Logger logger, + String header, +) { + final total = clang.clang_getNumDiagnostics(tu); + if (total == 0) { + return; + } + + logger.warning('Header $header: Total errors/warnings: $total.'); + for (var i = 0; i < total; i++) { + final diag = clang.clang_getDiagnostic(tu, i); + final cxstring = clang.clang_formatDiagnostic_wrap( + diag, + clang.CXDiagnosticDisplayOptions.CXDiagnostic_DisplaySourceLocation | + clang.CXDiagnosticDisplayOptions.CXDiagnostic_DisplayColumn | + clang.CXDiagnosticDisplayOptions.CXDiagnostic_DisplayCategoryName, + ); + logger.warning(' ' + cxstring.toStringAndDispose()); + clang.clang_disposeDiagnostic(diag); + } +} + +extension CXCursorExt on Pointer { + /// Returns the kind int from [clang.CXCursorKind]. + int kind() { + return clang.clang_getCursorKind_wrap(this); + } + + /// Name of the cursor (E.g function name, Struct name, Parameter name). + String spelling() { + return clang.clang_getCursorSpelling_wrap(this).toStringAndDispose(); + } + + /// Spelling for a [clang.CXCursorKind], useful for debug purposes. + String kindSpelling() { + return clang + .clang_getCursorKindSpelling_wrap(clang.clang_getCursorKind_wrap(this)) + .toStringAndDispose(); + } + + /// for debug: returns [spelling] [kind] [kindSpelling] [type] [typeSpelling]. + String completeStringRepr() { + final cxtype = type(); + final s = + '(Cursor) spelling: ${spelling()}, kind: ${kind()}, kindSpelling: ${kindSpelling()}, type: ${cxtype.kind()}, typeSpelling: ${cxtype.spelling()}'; + cxtype.dispose(); + return s; + } + + /// Dispose type using [type.dispose]. + Pointer type() { + return clang.clang_getCursorType_wrap(this); + } + + /// Only valid for [clang.CXCursorKind.CXCursor_FunctionDecl]. + /// + /// Dispose type using [type.dispose]. + Pointer returnType() { + final t = type(); + final r = clang.clang_getResultType_wrap(t); + t.dispose(); + return r; + } + + String sourceFileName() { + final cxsource = clang.clang_getCursorLocation_wrap(this); + final cxfilePtr = allocate>(); + final line = allocate(); + final column = allocate(); + final offset = allocate(); + + // Puts the values in these pointers. + clang.clang_getFileLocation_wrap(cxsource, cxfilePtr, line, column, offset); + final s = + clang.clang_getFileName_wrap(cxfilePtr.value).toStringAndDispose(); + free(cxsource); + free(cxfilePtr); + free(line); + free(column); + free(offset); + return s; + } + + void dispose() { + free(this); + } +} + +// TODO(13): Improve generated doc comment. +String getCursorDocComment(Pointer cursor) { + return config.extractComments + ? clang.clang_Cursor_getBriefCommentText_wrap(cursor).toStringAndDispose() + : null; +} + +extension CXTypeExt on Pointer { + /// Get code_gen [Type] representation of [clang.CXType]. + Type toCodeGenType() { + return getCodeGenType(this); + } + + /// Get code_gen [Type] representation of [clang.CXType] and dispose the type. + Type toCodeGenTypeAndDispose() { + final t = getCodeGenType(this); + dispose(); + return t; + } + + /// Spelling for a [clang.CXTypeKind], useful for debug purposes. + String spelling() { + return clang.clang_getTypeSpelling_wrap(this).toStringAndDispose(); + } + + /// Returns the typeKind int from [clang.CXTypeKind]. + int kind() { + return ref.kind; + } + + String kindSpelling() { + return clang.clang_getTypeKindSpelling_wrap(kind()).toStringAndDispose(); + } + + /// For debugging: returns [spelling] [kind] [kindSpelling]. + String completeStringRepr() { + final s = + '(Type) spelling: ${spelling()}, kind: ${kind()}, kindSpelling: ${kindSpelling()}'; + return s; + } + + void dispose() { + free(this); + } +} + +extension CXStringExt on Pointer { + /// Convert CXString to a Dart string + /// + /// Make sure to dispose CXstring using dispose method, or use the + /// [toStringAndDispose] method. + String string() { + String s; + final cstring = clang.clang_getCString_wrap(this); + if (cstring != nullptr) { + s = Utf8.fromUtf8(cstring.cast()); + } + return s; + } + + /// Converts CXString to dart string and disposes CXString. + String toStringAndDispose() { + // Note: clang_getCString_wrap returns a const char *, calling free will result in error. + final s = string(); + clang.clang_disposeString_wrap(this); + return s; + } + + void dispose() { + clang.clang_disposeString_wrap(this); + } +} + +/// Converts a [List] to [Pointer>]. +Pointer> createDynamicStringArray(List list) { + final nativeCmdArgs = allocate>(count: list.length); + + for (var i = 0; i < list.length; i++) { + nativeCmdArgs[i] = Utf8.toUtf8(list[i]); + } + + return nativeCmdArgs; +} + +extension DynamicCStringArray on Pointer> { + // Properly disposes a Pointer, ensure that sure length is correct. + void dispose(int length) { + for (var i = 0; i < length; i++) { + free(this[i]); + } + free(this); + } +} diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart new file mode 100644 index 0000000000..9d9ff17ad8 --- /dev/null +++ b/pkgs/ffigen/lib/src/strings.dart @@ -0,0 +1,66 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. +import 'package:ffigen/src/header_parser/clang_bindings/clang_bindings.dart' + as clang; + +const output = 'output'; +const libclang_dylib_folder = 'libclang-dylib-folder'; +const headers = 'headers'; +const headerFilter = 'header-filter'; +const compilerOpts = 'compiler-opts'; +const filters = 'filters'; + +// Declarations. +const functions = 'functions'; +const structs = 'structs'; +const enums = 'enums'; + +// Sub-fields of Declarations. +const include = 'include'; +const exclude = 'exclude'; + +// Sub-fields of include/exclude. +const matches = 'matches'; // regex +const names = 'names'; // hashset + +const sizemap = 'size-map'; + +// Sizemap values. +const SChar = 'char'; +const UChar = 'unsigned char'; +const Short = 'short'; +const UShort = 'unsigned short'; +const Int = 'int'; +const UInt = 'unsigned int'; +const Long = 'long'; +const ULong = 'unsigned long'; +const LongLong = 'long long'; +const ULongLong = 'unsigned long long'; +const Enum = 'enum'; + +// Used for validation and extraction of sizemap. +const sizemap_native_mapping = { + SChar: clang.CXTypeKind.CXType_SChar, + UChar: clang.CXTypeKind.CXType_UChar, + Short: clang.CXTypeKind.CXType_Short, + UShort: clang.CXTypeKind.CXType_UShort, + Int: clang.CXTypeKind.CXType_Int, + UInt: clang.CXTypeKind.CXType_UInt, + Long: clang.CXTypeKind.CXType_Long, + ULong: clang.CXTypeKind.CXType_ULong, + LongLong: clang.CXTypeKind.CXType_LongLong, + ULongLong: clang.CXTypeKind.CXType_ULongLong, + Enum: clang.CXTypeKind.CXType_Enum +}; + +// Boolean flags. +const sort = 'sort'; +const useSupportedTypedefs = 'use-supported-typedefs'; +const warnWhenRemoving = 'warn-when-removing'; +const extractComments = 'extract-comments'; + +// Dynamic library names. +const libclang_dylib_linux = 'libwrapped_clang.so'; +const libclang_dylib_macos = 'libwrapped_clang.dylib'; +const libclang_dylib_windows = 'wrapped_clang.dll'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 7711721dc4..64ecfbde7f 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -1,3 +1,7 @@ +# Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + name: ffigen version: 0.0.1 homepage: https://github.com/dart-lang/ffigen @@ -6,7 +10,14 @@ description: Experimental generator for FFI bindings. environment: sdk: '>=2.7.0 <3.0.0' -#dependencies: +dependencies: + ffi: ^0.1.3 + yaml: ^2.2.1 + meta: ^1.1.8 + args: ^1.6.0 + logging: ^0.11.4 + glob: ^1.2.0 + path: ^1.7.0 dev_dependencies: pedantic: ^1.9.0 diff --git a/pkgs/ffigen/test/code_generator_test.dart b/pkgs/ffigen/test/code_generator_test.dart new file mode 100644 index 0000000000..431283724e --- /dev/null +++ b/pkgs/ffigen/test/code_generator_test.dart @@ -0,0 +1,646 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:io'; + +import 'package:ffigen/src/code_generator.dart'; +import 'package:test/test.dart'; + +void main() { + group('code_generator: ', () { + test('Function Binding (primitives, pointers)', () { + final library = Library( + bindings: [ + Func( + name: 'noParam', + dartDoc: 'Just a test function\nheres another line', + returnType: Type.nativeType( + SupportedNativeType.Int32, + ), + ), + Func( + name: 'withPrimitiveParam', + parameters: [ + Parameter( + name: 'a', + type: Type.nativeType( + SupportedNativeType.Int32, + ), + ), + Parameter( + name: 'b', + type: Type.nativeType( + SupportedNativeType.Uint8, + ), + ), + ], + returnType: Type.nativeType( + SupportedNativeType.Char, + ), + ), + Func( + name: 'withPointerParam', + parameters: [ + Parameter( + name: 'a', + type: Type.pointer( + Type.nativeType( + SupportedNativeType.Int32, + ), + ), + ), + Parameter( + name: 'b', + type: Type.pointer( + Type.pointer( + Type.nativeType( + SupportedNativeType.Uint8, + ), + ), + ), + ), + ], + returnType: Type.pointer( + Type.nativeType( + SupportedNativeType.Double, + ), + ), + ), + ], + ); + + final gen = library.generate(); + + // Writing to file for debug purpose. + final file = File( + 'test/debug_generated/Function-Binding-test-output.dart', + ); + try { + expect(gen, '''/// AUTO GENERATED FILE, DO NOT EDIT. +/// +/// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Holds the Dynamic library. +ffi.DynamicLibrary _dylib; + +/// Initialises the Dynamic library. +void init(ffi.DynamicLibrary dylib){ + _dylib = dylib; +} +/// Just a test function +/// heres another line +int noParam( +) { + return _noParam( + ); +} + +final _dart_noParam _noParam = _dylib.lookupFunction<_c_noParam,_dart_noParam>('noParam'); + +typedef _c_noParam = ffi.Int32 Function( +); + +typedef _dart_noParam = int Function( +); + +int withPrimitiveParam( + int a, + int b, +) { + return _withPrimitiveParam( + a, + b, + ); +} + +final _dart_withPrimitiveParam _withPrimitiveParam = _dylib.lookupFunction<_c_withPrimitiveParam,_dart_withPrimitiveParam>('withPrimitiveParam'); + +typedef _c_withPrimitiveParam = ffi.Uint8 Function( + ffi.Int32 a, + ffi.Uint8 b, +); + +typedef _dart_withPrimitiveParam = int Function( + int a, + int b, +); + +ffi.Pointer withPointerParam( + ffi.Pointer a, + ffi.Pointer> b, +) { + return _withPointerParam( + a, + b, + ); +} + +final _dart_withPointerParam _withPointerParam = _dylib.lookupFunction<_c_withPointerParam,_dart_withPointerParam>('withPointerParam'); + +typedef _c_withPointerParam = ffi.Pointer Function( + ffi.Pointer a, + ffi.Pointer> b, +); + +typedef _dart_withPointerParam = ffi.Pointer Function( + ffi.Pointer a, + ffi.Pointer> b, +); + +'''); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + file.writeAsStringSync(gen); + print('Failed test, Debug output: ${file.absolute?.path}'); + rethrow; + } + }); + + test('Struct Binding (primitives, pointers)', () { + final library = Library( + bindings: [ + Struc( + name: 'NoMember', + dartDoc: 'Just a test struct\nheres another line', + ), + Struc( + name: 'WithPrimitiveMember', + members: [ + Member( + name: 'a', + type: Type.nativeType( + SupportedNativeType.Int32, + ), + ), + Member( + name: 'b', + type: Type.nativeType( + SupportedNativeType.Double, + ), + ), + Member( + name: 'c', + type: Type.nativeType( + SupportedNativeType.Char, + ), + ), + ], + ), + Struc( + name: 'WithPointerMember', + members: [ + Member( + name: 'a', + type: Type.pointer( + Type.nativeType( + SupportedNativeType.Int32, + ), + ), + ), + Member( + name: 'b', + type: Type.pointer( + Type.pointer( + Type.nativeType( + SupportedNativeType.Double, + ), + ), + ), + ), + Member( + name: 'c', + type: Type.nativeType( + SupportedNativeType.Char, + ), + ), + ], + ), + ], + ); + + final gen = library.generate(); + + // Writing to file for debug purpose. + final file = File('test/debug_generated/Struct-Binding-test-output.dart'); + + try { + expect(gen, '''/// AUTO GENERATED FILE, DO NOT EDIT. +/// +/// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Holds the Dynamic library. +ffi.DynamicLibrary _dylib; + +/// Initialises the Dynamic library. +void init(ffi.DynamicLibrary dylib){ + _dylib = dylib; +} +/// Just a test struct +/// heres another line +class NoMember extends ffi.Struct{ +} + +class WithPrimitiveMember extends ffi.Struct{ + @ffi.Int32() + int a; + + @ffi.Double() + double b; + + @ffi.Uint8() + int c; + +} + +class WithPointerMember extends ffi.Struct{ + ffi.Pointer a; + + ffi.Pointer> b; + + @ffi.Uint8() + int c; + +} + +'''); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + file.writeAsStringSync(gen); + print('Failed test, Debug output: ${file.absolute?.path}'); + rethrow; + } + }); + + test('Function and Struct Binding (pointer to Struct)', () { + final library = Library( + bindings: [ + Struc( + name: 'SomeStruc', + members: [ + Member( + name: 'a', + type: Type.nativeType( + SupportedNativeType.Int32, + ), + ), + Member( + name: 'b', + type: Type.nativeType( + SupportedNativeType.Double, + ), + ), + Member( + name: 'c', + type: Type.nativeType( + SupportedNativeType.Char, + ), + ), + ], + ), + Func( + name: 'someFunc', + parameters: [ + Parameter( + name: 'some', + type: Type.pointer( + Type.pointer( + Type.struct( + 'SomeStruc', + ), + ), + ), + ), + ], + returnType: Type.pointer( + Type.struct( + 'SomeStruc', + ), + ), + ), + ], + ); + + final gen = library.generate(); + + // Writing to file for debug purpose. + final file = + File('test/debug_generated/Func-n-Struct-Binding-test-output.dart'); + try { + //expect + expect(gen, '''/// AUTO GENERATED FILE, DO NOT EDIT. +/// +/// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Holds the Dynamic library. +ffi.DynamicLibrary _dylib; + +/// Initialises the Dynamic library. +void init(ffi.DynamicLibrary dylib){ + _dylib = dylib; +} +class SomeStruc extends ffi.Struct{ + @ffi.Int32() + int a; + + @ffi.Double() + double b; + + @ffi.Uint8() + int c; + +} + +ffi.Pointer someFunc( + ffi.Pointer> some, +) { + return _someFunc( + some, + ); +} + +final _dart_someFunc _someFunc = _dylib.lookupFunction<_c_someFunc,_dart_someFunc>('someFunc'); + +typedef _c_someFunc = ffi.Pointer Function( + ffi.Pointer> some, +); + +typedef _dart_someFunc = ffi.Pointer Function( + ffi.Pointer> some, +); + +'''); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + file.writeAsStringSync(gen); + print('Failed test, Debug output: ${file.absolute?.path}'); + rethrow; + } + }); + + test('global (primitives, pointers, pointer to struct)', () { + final library = Library( + bindings: [ + Global( + name: 'test1', + type: Type.nativeType( + SupportedNativeType.Int32, + ), + ), + Global( + name: 'test2', + type: Type.pointer( + Type.nativeType( + SupportedNativeType.Float, + ), + ), + ), + Struc( + name: 'Some', + ), + Global( + name: 'test5', + type: Type.pointer( + Type.struct( + 'Some', + ), + ), + ), + ], + ); + + final gen = library.generate(); + + // Writing to file for debug purpose. + final file = File( + 'test/debug_generated/Global-Binding-test-output.dart', + ); + try { + expect(gen, '''/// AUTO GENERATED FILE, DO NOT EDIT. +/// +/// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Holds the Dynamic library. +ffi.DynamicLibrary _dylib; + +/// Initialises the Dynamic library. +void init(ffi.DynamicLibrary dylib){ + _dylib = dylib; +} +final int test1 = _dylib.lookup('test1').value; + +final ffi.Pointer test2 = _dylib.lookup>('test2').value; + +class Some extends ffi.Struct{ +} + +final ffi.Pointer test5 = _dylib.lookup>('test5').value; + +'''); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + file.writeAsStringSync(gen); + print('Failed test, Debug output: ${file.absolute?.path}'); + rethrow; + } + }); + + test('constant', () { + final library = Library( + bindings: [ + Constant( + name: 'test1', + type: Type.nativeType( + SupportedNativeType.Int32, + ), + rawValue: '20', + ), + Constant( + name: 'test2', + type: Type.nativeType( + SupportedNativeType.Float, + ), + rawValue: '20.0', + ), + ], + ); + + final gen = library.generate(); + + // Writing to file for debug purpose. + final file = File( + 'test/debug_generated/Constant-test-output.dart', + ); + try { + expect(gen, '''/// AUTO GENERATED FILE, DO NOT EDIT. +/// +/// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Holds the Dynamic library. +ffi.DynamicLibrary _dylib; + +/// Initialises the Dynamic library. +void init(ffi.DynamicLibrary dylib){ + _dylib = dylib; +} +const int test1 = 20; + +const double test2 = 20.0; + +'''); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + file.writeAsStringSync(gen); + print('Failed test, Debug output: ${file.absolute?.path}'); + rethrow; + } + }); + + test('TypedefC (primitive, pointers, pointer to struct)', () { + final library = Library( + bindings: [ + TypedefC( + dartDoc: 'just a test', + name: 'test1', + returnType: Type.nativeType( + SupportedNativeType.Int32, + ), + ), + Struc(name: 'SomeStruct'), + TypedefC( + name: 'test2', + returnType: Type.pointer( + Type.nativeType( + SupportedNativeType.Int32, + ), + ), + parameters: [ + Parameter( + name: 'param1', + type: Type.pointer( + Type.struct('SomeStruct'), + ), + ), + Parameter( + name: 'param2', + type: Type.nativeType( + SupportedNativeType.Char, + ), + ), + ], + ), + ], + ); + + final gen = library.generate(); + + // Writing to file for debug purpose. + final file = + File('test/debug_generated/typedef-Binding-test-output.dart'); + try { + expect(gen, '''/// AUTO GENERATED FILE, DO NOT EDIT. +/// +/// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Holds the Dynamic library. +ffi.DynamicLibrary _dylib; + +/// Initialises the Dynamic library. +void init(ffi.DynamicLibrary dylib){ + _dylib = dylib; +} +/// just a test +typedef test1 = ffi.Int32 Function( +); + +class SomeStruct extends ffi.Struct{ +} + +typedef test2 = ffi.Pointer Function( + ffi.Pointer param1, + ffi.Uint8 param2, +); + +'''); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + file.writeAsStringSync(gen); + print('Failed test, Debug output: ${file.absolute?.path}'); + rethrow; + } + }); + + test('enum_class', () { + final library = Library( + bindings: [ + EnumClass( + name: 'Constants', + dartDoc: 'test line 1\ntest line 2', + enumConstants: [ + EnumConstant( + name: 'a', + value: 10, + ), + EnumConstant(name: 'b', value: -1, dartDoc: 'negative'), + ], + ), + ], + ); + + final gen = library.generate(); + + // Writing to file for debug purpose. + final file = File( + 'test/debug_generated/enum-class-test-output.dart', + ); + try { + expect(gen, '''/// AUTO GENERATED FILE, DO NOT EDIT. +/// +/// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Holds the Dynamic library. +ffi.DynamicLibrary _dylib; + +/// Initialises the Dynamic library. +void init(ffi.DynamicLibrary dylib){ + _dylib = dylib; +} +/// test line 1 +/// test line 2 +class Constants { + static const int a = 10; + /// negative + static const int b = -1; +} + +'''); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + file.writeAsStringSync(gen); + print('Failed test, Debug output: ${file.absolute?.path}'); + rethrow; + } + }); + }); +} diff --git a/pkgs/ffigen/test/header_parser_tests/functions.h b/pkgs/ffigen/test/header_parser_tests/functions.h new file mode 100644 index 0000000000..306ff0f934 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/functions.h @@ -0,0 +1,13 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#include + +// Simple tests with primitives. +void func1(); +int32_t func2(int16_t); +double func3(float, int8_t a, int64_t, int32_t b); + +// Tests with pointers to primitives. +void *func4(int8_t **, double, int32_t ***); diff --git a/pkgs/ffigen/test/header_parser_tests/functions_test.dart b/pkgs/ffigen/test/header_parser_tests/functions_test.dart new file mode 100644 index 0000000000..f9e261e80d --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/functions_test.dart @@ -0,0 +1,145 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:io'; + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/code_generator/writer.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/config_provider.dart'; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; + +final writer = Writer(); + +void main() { + group('header_parser', () { + Library actual, expected; + + setUpAll(() { + expected = expectedLibrary(); + + var dylibPath = 'tool/wrapped_libclang/libwrapped_clang.so'; + if (Platform.isMacOS) { + dylibPath = 'tool/wrapped_libclang/libwrapped_clang.dylib'; + } else if (Platform.isWindows) { + dylibPath = 'tool/wrapped_libclang/wrapped_clang.dll'; + } + + Logger.root.onRecord.listen((log) { + print('${log.level.name.padRight(8)}: ${log.message}'); + }); + + actual = parser.parse( + Config.raw( + libclang_dylib_path: dylibPath, + headers: [ + 'test/header_parser_tests/functions.h', + ], + headerFilter: HeaderFilter( + includedInclusionHeaders: { + 'functions.h', + }, + ), + ), + ); + }); + test('Total bindings count', () { + expect(actual.bindings.length, expected.bindings.length); + }); + + test('func1', () { + expect(binding(actual, 'func1'), binding(expected, 'func1')); + }); + test('func2', () { + expect(binding(actual, 'func2'), binding(expected, 'func2')); + }); + test('func3', () { + expect(binding(actual, 'func3'), binding(expected, 'func3')); + }); + + test('func4', () { + expect(binding(actual, 'func4'), binding(expected, 'func4')); + }); + }); +} + +/// Extracts a binding's string from a library. +String binding(Library lib, String name) { + return lib.bindings + .firstWhere((element) => element.name == name) + .toBindingString(writer) + .string; +} + +Library expectedLibrary() { + return Library( + bindings: [ + Func( + name: 'func1', + returnType: Type.nativeType( + SupportedNativeType.Void, + ), + ), + Func( + name: 'func2', + returnType: Type.nativeType( + SupportedNativeType.Int32, + ), + parameters: [ + Parameter( + name: '', + type: Type.nativeType( + SupportedNativeType.Int16, + ), + ), + ], + ), + Func( + name: 'func3', + returnType: Type.nativeType( + SupportedNativeType.Double, + ), + parameters: [ + Parameter( + type: Type.nativeType( + SupportedNativeType.Float, + ), + ), + Parameter( + name: 'a', + type: Type.nativeType( + SupportedNativeType.Int8, + ), + ), + Parameter( + name: '', + type: Type.nativeType( + SupportedNativeType.Int64, + ), + ), + Parameter( + name: 'b', + type: Type.nativeType( + SupportedNativeType.Int32, + ), + ), + ], + ), + Func( + name: 'func4', + returnType: Type.pointer(Type.nativeType(SupportedNativeType.Void)), + parameters: [ + Parameter( + type: Type.pointer( + Type.pointer(Type.nativeType(SupportedNativeType.Int8)))), + Parameter(type: Type.nativeType(SupportedNativeType.Double)), + Parameter( + type: Type.pointer(Type.pointer( + Type.pointer(Type.nativeType(SupportedNativeType.Int32)))), + ) + ]), + ], + ); +} diff --git a/pkgs/ffigen/test/native_functions_test/build_test_dylib.dart b/pkgs/ffigen/test/native_functions_test/build_test_dylib.dart new file mode 100644 index 0000000000..25258f0512 --- /dev/null +++ b/pkgs/ffigen/test/native_functions_test/build_test_dylib.dart @@ -0,0 +1,130 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// ======================================================================= +/// ==== Script to generate dynamic library for native_function_tests ===== +/// ======================================================================= +/// This Script effectively calls the following (but user can provide +/// command line args which will replace the defaults shown below)- +/// +/// Linux: +/// ``` +/// clang -shared -fpic native_functions.c -o native_functions.so +/// ``` +/// MacOS: +/// ``` +/// clang -shared -fpic native_functions.c -o native_functions.dylib +/// ``` +/// Windows: +/// ``` +/// call clang -shared native_functions.c -o native_functions.dll -Wl,"/DEF:native_functions.def" +/// del native_functions.exp +/// del native_functions.lib +/// ``` +/// ======================================================================= +/// ======================================================================= +/// ======================================================================= + +import 'dart:io'; + +import 'package:meta/meta.dart'; + +const MACOS = 'macos'; +const WINDOWS = 'windows'; +const LINUX = 'linux'; + +Map platformOptions = { + LINUX: Options( + outputfilename: 'native_functions.so', + sharedFlag: '-shared', + inputHeader: 'native_functions.c', + fPIC: '-fpic', + ), + WINDOWS: Options( + outputfilename: 'native_functions.dll', + sharedFlag: '-shared', + inputHeader: 'native_functions.c', + moduleDefPath: '-Wl,/DEF:native_functions.def', + ), + MACOS: Options( + outputfilename: 'native_functions.dylib', + sharedFlag: '-shared', + inputHeader: 'native_functions.c', + fPIC: '-fpic', + ), +}; + +void main(List arguments) { + print('Building Dynamic Library for Native Tests... '); + final options = getPlatformOptions(); + + // Run clang compiler to generate the dynamic library. + final ProcessResult result = runClangProcess(options); + printSuccess(result, options); +} + +/// Calls the clang compiler. +ProcessResult runClangProcess(Options options) { + final result = Process.runSync( + 'clang', + [ + options.sharedFlag, + options.fPIC, + options.inputHeader, + '-o', + options.outputfilename, + options.moduleDefPath, + ], + ); + return result; +} + +/// Prints success message (or process error if any). +void printSuccess(ProcessResult result, Options options) { + print(result.stdout); + if ((result.stderr as String).isEmpty) { + print('Generated file: ${options.outputfilename}'); + } else { + print(result.stderr); + } +} + +/// Get options based on current platform. +Options getPlatformOptions() { + if (Platform.isMacOS) { + return platformOptions[MACOS]; + } else if (Platform.isWindows) { + return platformOptions[WINDOWS]; + } else if (Platform.isLinux) { + return platformOptions[LINUX]; + } else { + throw Exception('Unknown Platform.'); + } +} + +/// Hold options which would be passed to clang. +class Options { + /// Name of dynamic library to generate. + final String outputfilename; + + /// Tells compiler to generate a shared library. + final String sharedFlag; + + /// Flag for generating Position Independant Code (Not used on windows). + final String fPIC; + + /// Input file. + final String inputHeader; + + /// Path to `.def` file containing symbols to export, windows use only. + final String moduleDefPath; + + Options({ + @required this.outputfilename, + @required this.sharedFlag, + @required this.inputHeader, + this.fPIC = '', + this.moduleDefPath = '', + }); +} diff --git a/pkgs/ffigen/test/native_functions_test/config.yaml b/pkgs/ffigen/test/native_functions_test/config.yaml new file mode 100644 index 0000000000..4af2defbf1 --- /dev/null +++ b/pkgs/ffigen/test/native_functions_test/config.yaml @@ -0,0 +1,16 @@ +# Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +# =================== GENERATING TEST BINDINGS ================== +# dart ../../bin/generate.dart --config config.yaml +# =============================================================== + +output: 'native_functions_bindings.dart' +libclang-dylib-folder: '../../tool/wrapped_libclang' +sort: true +headers: + - 'native_functions.c' +header-filter: + include: + - 'native_functions.c' diff --git a/pkgs/ffigen/test/native_functions_test/native_functions.c b/pkgs/ffigen/test/native_functions_test/native_functions.c new file mode 100644 index 0000000000..544357e3ac --- /dev/null +++ b/pkgs/ffigen/test/native_functions_test/native_functions.c @@ -0,0 +1,27 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#include + +uint8_t Function1Uint8(uint8_t x) { return x + 42; } + +uint16_t Function1Uint16(uint16_t x) { return x + 42; } + +uint32_t Function1Uint32(uint32_t x) { return x + 42; } + +uint64_t Function1Uint64(uint64_t x) { return x + 42; } + +int8_t Function1Int8(int8_t x) { return x + 42; } + +int16_t Function1Int16(int16_t x) { return x + 42; } + +int32_t Function1Int32(int32_t x) { return x + 42; } + +int64_t Function1Int64(int64_t x) { return x + 42; } + +intptr_t Function1IntPtr(intptr_t x) { return x + 42; } + +float Function1Float(float x) { return x + 42.0f; } + +double Function1Double(double x) { return x + 42.0; } diff --git a/pkgs/ffigen/test/native_functions_test/native_functions.def b/pkgs/ffigen/test/native_functions_test/native_functions.def new file mode 100644 index 0000000000..f2d6f914a8 --- /dev/null +++ b/pkgs/ffigen/test/native_functions_test/native_functions.def @@ -0,0 +1,16 @@ +; Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +; for details. All rights reserved. Use of this source code is governed by a +; BSD-style license that can be found in the LICENSE file. + +EXPORTS +Function1Uint8 +Function1Uint16 +Function1Uint32 +Function1Uint64 +Function1Int8 +Function1Int16 +Function1Int32 +Function1Int64 +Function1IntPtr +Function1Float +Function1Double \ No newline at end of file diff --git a/pkgs/ffigen/test/native_functions_test/native_functions_bindings.dart b/pkgs/ffigen/test/native_functions_test/native_functions_bindings.dart new file mode 100644 index 0000000000..a9eb1e9b75 --- /dev/null +++ b/pkgs/ffigen/test/native_functions_test/native_functions_bindings.dart @@ -0,0 +1,226 @@ +/// AUTO GENERATED FILE, DO NOT EDIT. +/// +/// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Holds the Dynamic library. +ffi.DynamicLibrary _dylib; + +/// Initialises the Dynamic library. +void init(ffi.DynamicLibrary dylib) { + _dylib = dylib; +} + +double Function1Double( + double x, +) { + return _Function1Double( + x, + ); +} + +final _dart_Function1Double _Function1Double = + _dylib.lookupFunction<_c_Function1Double, _dart_Function1Double>( + 'Function1Double'); + +typedef _c_Function1Double = ffi.Double Function( + ffi.Double x, +); + +typedef _dart_Function1Double = double Function( + double x, +); + +double Function1Float( + double x, +) { + return _Function1Float( + x, + ); +} + +final _dart_Function1Float _Function1Float = _dylib + .lookupFunction<_c_Function1Float, _dart_Function1Float>('Function1Float'); + +typedef _c_Function1Float = ffi.Float Function( + ffi.Float x, +); + +typedef _dart_Function1Float = double Function( + double x, +); + +int Function1Int16( + int x, +) { + return _Function1Int16( + x, + ); +} + +final _dart_Function1Int16 _Function1Int16 = _dylib + .lookupFunction<_c_Function1Int16, _dart_Function1Int16>('Function1Int16'); + +typedef _c_Function1Int16 = ffi.Int16 Function( + ffi.Int16 x, +); + +typedef _dart_Function1Int16 = int Function( + int x, +); + +int Function1Int32( + int x, +) { + return _Function1Int32( + x, + ); +} + +final _dart_Function1Int32 _Function1Int32 = _dylib + .lookupFunction<_c_Function1Int32, _dart_Function1Int32>('Function1Int32'); + +typedef _c_Function1Int32 = ffi.Int32 Function( + ffi.Int32 x, +); + +typedef _dart_Function1Int32 = int Function( + int x, +); + +int Function1Int64( + int x, +) { + return _Function1Int64( + x, + ); +} + +final _dart_Function1Int64 _Function1Int64 = _dylib + .lookupFunction<_c_Function1Int64, _dart_Function1Int64>('Function1Int64'); + +typedef _c_Function1Int64 = ffi.Int64 Function( + ffi.Int64 x, +); + +typedef _dart_Function1Int64 = int Function( + int x, +); + +int Function1Int8( + int x, +) { + return _Function1Int8( + x, + ); +} + +final _dart_Function1Int8 _Function1Int8 = _dylib + .lookupFunction<_c_Function1Int8, _dart_Function1Int8>('Function1Int8'); + +typedef _c_Function1Int8 = ffi.Int8 Function( + ffi.Int8 x, +); + +typedef _dart_Function1Int8 = int Function( + int x, +); + +int Function1IntPtr( + int x, +) { + return _Function1IntPtr( + x, + ); +} + +final _dart_Function1IntPtr _Function1IntPtr = + _dylib.lookupFunction<_c_Function1IntPtr, _dart_Function1IntPtr>( + 'Function1IntPtr'); + +typedef _c_Function1IntPtr = ffi.IntPtr Function( + ffi.IntPtr x, +); + +typedef _dart_Function1IntPtr = int Function( + int x, +); + +int Function1Uint16( + int x, +) { + return _Function1Uint16( + x, + ); +} + +final _dart_Function1Uint16 _Function1Uint16 = + _dylib.lookupFunction<_c_Function1Uint16, _dart_Function1Uint16>( + 'Function1Uint16'); + +typedef _c_Function1Uint16 = ffi.Uint16 Function( + ffi.Uint16 x, +); + +typedef _dart_Function1Uint16 = int Function( + int x, +); + +int Function1Uint32( + int x, +) { + return _Function1Uint32( + x, + ); +} + +final _dart_Function1Uint32 _Function1Uint32 = + _dylib.lookupFunction<_c_Function1Uint32, _dart_Function1Uint32>( + 'Function1Uint32'); + +typedef _c_Function1Uint32 = ffi.Uint32 Function( + ffi.Uint32 x, +); + +typedef _dart_Function1Uint32 = int Function( + int x, +); + +int Function1Uint64( + int x, +) { + return _Function1Uint64( + x, + ); +} + +final _dart_Function1Uint64 _Function1Uint64 = + _dylib.lookupFunction<_c_Function1Uint64, _dart_Function1Uint64>( + 'Function1Uint64'); + +typedef _c_Function1Uint64 = ffi.Uint64 Function( + ffi.Uint64 x, +); + +typedef _dart_Function1Uint64 = int Function( + int x, +); + +int Function1Uint8( + int x, +) { + return _Function1Uint8( + x, + ); +} + +final _dart_Function1Uint8 _Function1Uint8 = _dylib + .lookupFunction<_c_Function1Uint8, _dart_Function1Uint8>('Function1Uint8'); + +typedef _c_Function1Uint8 = ffi.Uint8 Function( + ffi.Uint8 x, +); + +typedef _dart_Function1Uint8 = int Function( + int x, +); diff --git a/pkgs/ffigen/test/native_functions_test/native_functions_test.dart b/pkgs/ffigen/test/native_functions_test/native_functions_test.dart new file mode 100644 index 0000000000..b63fc35e4d --- /dev/null +++ b/pkgs/ffigen/test/native_functions_test/native_functions_test.dart @@ -0,0 +1,61 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:ffi'; +import 'dart:io'; +import 'dart:math'; + +import 'package:test/test.dart'; +import 'native_functions_bindings.dart' as bindings; + +void main() { + group('Tests for native functions', () { + setUpAll(() { + var dylibName = 'test/native_functions_test/native_functions.so'; + if (Platform.isMacOS) { + dylibName = 'test/native_functions_test/native_functions.dylib'; + } else if (Platform.isWindows) { + dylibName = r'test\native_functions_test\native_functions.dll'; + } + bindings.init(DynamicLibrary.open(dylibName)); + }); + test('uint8_t', () { + expect(bindings.Function1Uint8(pow(2, 8).toInt()), 42); + }); + test('uint16_t', () { + expect(bindings.Function1Uint16(pow(2, 16).toInt()), 42); + }); + test('uint32_t', () { + expect(bindings.Function1Uint32(pow(2, 32).toInt()), 42); + }); + test('uint64_t', () { + expect(bindings.Function1Uint64(pow(2, 64).toInt()), 42); + }); + test('int8_t', () { + expect( + bindings.Function1Int8(pow(2, 7).toInt()), -pow(2, 7).toInt() + 42); + }); + test('int16_t', () { + expect(bindings.Function1Int16(pow(2, 15).toInt()), + -pow(2, 15).toInt() + 42); + }); + test('int32_t', () { + expect(bindings.Function1Int32(pow(2, 31).toInt()), + -pow(2, 31).toInt() + 42); + }); + test('int64_t', () { + expect(bindings.Function1Int64(pow(2, 63).toInt()), + -pow(2, 63).toInt() + 42); + }); + test('intptr_t', () { + expect(bindings.Function1IntPtr(0), 42); + }); + test('float', () { + expect(bindings.Function1Float(0), 42.0); + }); + test('double', () { + expect(bindings.Function1Double(0), 42.0); + }); + }); +} diff --git a/pkgs/ffigen/third_party/cjson_library/.gitignore b/pkgs/ffigen/third_party/cjson_library/.gitignore new file mode 100644 index 0000000000..53d01a30bb --- /dev/null +++ b/pkgs/ffigen/third_party/cjson_library/.gitignore @@ -0,0 +1,17 @@ +# CMake generated files and directories. +CMakeCache.txt +CMakeFiles/ +CmakeScripts/ +Makefile +cmake_install.cmake + +# Xcode tooling generated via `cmake -G Xcode .`. +cjson_library.xcodeproj/ + +# Xcode generated build and output directories. +cjson_library.build/ + +# Generated shared library files. +*.dylib +*.so.* +*.dll diff --git a/pkgs/ffigen/third_party/cjson_library/CMakeLists.txt b/pkgs/ffigen/third_party/cjson_library/CMakeLists.txt new file mode 100644 index 0000000000..815ba4fa8a --- /dev/null +++ b/pkgs/ffigen/third_party/cjson_library/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.7 FATAL_ERROR) +project(cjson_library VERSION 1.0.0 LANGUAGES C) +add_library(cjson_library SHARED cJSON.c) + +set_target_properties(cjson_library PROPERTIES + PUBLIC_HEADER cJSON.h + VERSION ${PROJECT_VERSION} + SOVERSION 1 + OUTPUT_NAME "cjson" + XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Hex_Identity_ID_Goes_Here" +) diff --git a/pkgs/ffigen/third_party/cjson_library/cJSON.c b/pkgs/ffigen/third_party/cjson_library/cJSON.c new file mode 100644 index 0000000000..a198d6687c --- /dev/null +++ b/pkgs/ffigen/third_party/cjson_library/cJSON.c @@ -0,0 +1,2998 @@ +/* + Copyright (c) 2009-2017 Dave Gamble and cJSON contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ + +/* cJSON */ +/* JSON parser in C. */ + +/* disable warnings about old C89 functions in MSVC */ +#if !defined(_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) +#define _CRT_SECURE_NO_DEPRECATE +#endif + +#ifdef __GNUC__ +#pragma GCC visibility push(default) +#endif +#if defined(_MSC_VER) +#pragma warning (push) +/* disable warning about single line comments in system headers */ +#pragma warning (disable : 4001) +#endif + +#include +#include +#include +#include +#include +#include + +#ifdef ENABLE_LOCALES +#include +#endif + +#if defined(_MSC_VER) +#pragma warning (pop) +#endif +#ifdef __GNUC__ +#pragma GCC visibility pop +#endif + +#include "cJSON.h" + +/* define our own boolean type */ +#ifdef true +#undef true +#endif +#define true ((cJSON_bool)1) + +#ifdef false +#undef false +#endif +#define false ((cJSON_bool)0) + +typedef struct { + const unsigned char *json; + size_t position; +} error; +static error global_error = { NULL, 0 }; + +CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void) +{ + return (const char*) (global_error.json + global_error.position); +} + +CJSON_PUBLIC(char *) cJSON_GetStringValue(const cJSON * const item) { + if (!cJSON_IsString(item)) { + return NULL; + } + + return item->valuestring; +} + +/* This is a safeguard to prevent copy-pasters from using incompatible C and header files */ +#if (CJSON_VERSION_MAJOR != 1) || (CJSON_VERSION_MINOR != 7) || (CJSON_VERSION_PATCH != 12) + #error cJSON.h and cJSON.c have different versions. Make sure that both have the same. +#endif + +CJSON_PUBLIC(const char*) cJSON_Version(void) +{ + static char version[15]; + sprintf(version, "%i.%i.%i", CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, CJSON_VERSION_PATCH); + + return version; +} + +/* Case insensitive string comparison, doesn't consider two NULL pointers equal though */ +static int case_insensitive_strcmp(const unsigned char *string1, const unsigned char *string2) +{ + if ((string1 == NULL) || (string2 == NULL)) + { + return 1; + } + + if (string1 == string2) + { + return 0; + } + + for(; tolower(*string1) == tolower(*string2); (void)string1++, string2++) + { + if (*string1 == '\0') + { + return 0; + } + } + + return tolower(*string1) - tolower(*string2); +} + +typedef struct internal_hooks +{ + void *(CJSON_CDECL *allocate)(size_t size); + void (CJSON_CDECL *deallocate)(void *pointer); + void *(CJSON_CDECL *reallocate)(void *pointer, size_t size); +} internal_hooks; + +#if defined(_MSC_VER) +/* work around MSVC error C2322: '...' address of dllimport '...' is not static */ +static void * CJSON_CDECL internal_malloc(size_t size) +{ + return malloc(size); +} +static void CJSON_CDECL internal_free(void *pointer) +{ + free(pointer); +} +static void * CJSON_CDECL internal_realloc(void *pointer, size_t size) +{ + return realloc(pointer, size); +} +#else +#define internal_malloc malloc +#define internal_free free +#define internal_realloc realloc +#endif + +/* strlen of character literals resolved at compile time */ +#define static_strlen(string_literal) (sizeof(string_literal) - sizeof("")) + +static internal_hooks global_hooks = { internal_malloc, internal_free, internal_realloc }; + +static unsigned char* cJSON_strdup(const unsigned char* string, const internal_hooks * const hooks) +{ + size_t length = 0; + unsigned char *copy = NULL; + + if (string == NULL) + { + return NULL; + } + + length = strlen((const char*)string) + sizeof(""); + copy = (unsigned char*)hooks->allocate(length); + if (copy == NULL) + { + return NULL; + } + memcpy(copy, string, length); + + return copy; +} + +CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks) +{ + if (hooks == NULL) + { + /* Reset hooks */ + global_hooks.allocate = malloc; + global_hooks.deallocate = free; + global_hooks.reallocate = realloc; + return; + } + + global_hooks.allocate = malloc; + if (hooks->malloc_fn != NULL) + { + global_hooks.allocate = hooks->malloc_fn; + } + + global_hooks.deallocate = free; + if (hooks->free_fn != NULL) + { + global_hooks.deallocate = hooks->free_fn; + } + + /* use realloc only if both free and malloc are used */ + global_hooks.reallocate = NULL; + if ((global_hooks.allocate == malloc) && (global_hooks.deallocate == free)) + { + global_hooks.reallocate = realloc; + } +} + +/* Internal constructor. */ +static cJSON *cJSON_New_Item(const internal_hooks * const hooks) +{ + cJSON* node = (cJSON*)hooks->allocate(sizeof(cJSON)); + if (node) + { + memset(node, '\0', sizeof(cJSON)); + } + + return node; +} + +/* Delete a cJSON structure. */ +CJSON_PUBLIC(void) cJSON_Delete(cJSON *item) +{ + cJSON *next = NULL; + while (item != NULL) + { + next = item->next; + if (!(item->type & cJSON_IsReference) && (item->child != NULL)) + { + cJSON_Delete(item->child); + } + if (!(item->type & cJSON_IsReference) && (item->valuestring != NULL)) + { + global_hooks.deallocate(item->valuestring); + } + if (!(item->type & cJSON_StringIsConst) && (item->string != NULL)) + { + global_hooks.deallocate(item->string); + } + global_hooks.deallocate(item); + item = next; + } +} + +/* get the decimal point character of the current locale */ +static unsigned char get_decimal_point(void) +{ +#ifdef ENABLE_LOCALES + struct lconv *lconv = localeconv(); + return (unsigned char) lconv->decimal_point[0]; +#else + return '.'; +#endif +} + +typedef struct +{ + const unsigned char *content; + size_t length; + size_t offset; + size_t depth; /* How deeply nested (in arrays/objects) is the input at the current offset. */ + internal_hooks hooks; +} parse_buffer; + +/* check if the given size is left to read in a given parse buffer (starting with 1) */ +#define can_read(buffer, size) ((buffer != NULL) && (((buffer)->offset + size) <= (buffer)->length)) +/* check if the buffer can be accessed at the given index (starting with 0) */ +#define can_access_at_index(buffer, index) ((buffer != NULL) && (((buffer)->offset + index) < (buffer)->length)) +#define cannot_access_at_index(buffer, index) (!can_access_at_index(buffer, index)) +/* get a pointer to the buffer at the position */ +#define buffer_at_offset(buffer) ((buffer)->content + (buffer)->offset) + +/* Parse the input text to generate a number, and populate the result into item. */ +static cJSON_bool parse_number(cJSON * const item, parse_buffer * const input_buffer) +{ + double number = 0; + unsigned char *after_end = NULL; + unsigned char number_c_string[64]; + unsigned char decimal_point = get_decimal_point(); + size_t i = 0; + + if ((input_buffer == NULL) || (input_buffer->content == NULL)) + { + return false; + } + + /* copy the number into a temporary buffer and replace '.' with the decimal point + * of the current locale (for strtod) + * This also takes care of '\0' not necessarily being available for marking the end of the input */ + for (i = 0; (i < (sizeof(number_c_string) - 1)) && can_access_at_index(input_buffer, i); i++) + { + switch (buffer_at_offset(input_buffer)[i]) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '+': + case '-': + case 'e': + case 'E': + number_c_string[i] = buffer_at_offset(input_buffer)[i]; + break; + + case '.': + number_c_string[i] = decimal_point; + break; + + default: + goto loop_end; + } + } +loop_end: + number_c_string[i] = '\0'; + + number = strtod((const char*)number_c_string, (char**)&after_end); + if (number_c_string == after_end) + { + return false; /* parse_error */ + } + + item->valuedouble = number; + + /* use saturation in case of overflow */ + if (number >= INT_MAX) + { + item->valueint = INT_MAX; + } + else if (number <= (double)INT_MIN) + { + item->valueint = INT_MIN; + } + else + { + item->valueint = (int)number; + } + + item->type = cJSON_Number; + + input_buffer->offset += (size_t)(after_end - number_c_string); + return true; +} + +/* don't ask me, but the original cJSON_SetNumberValue returns an integer or double */ +CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number) +{ + if (number >= INT_MAX) + { + object->valueint = INT_MAX; + } + else if (number <= (double)INT_MIN) + { + object->valueint = INT_MIN; + } + else + { + object->valueint = (int)number; + } + + return object->valuedouble = number; +} + +typedef struct +{ + unsigned char *buffer; + size_t length; + size_t offset; + size_t depth; /* current nesting depth (for formatted printing) */ + cJSON_bool noalloc; + cJSON_bool format; /* is this print a formatted print */ + internal_hooks hooks; +} printbuffer; + +/* realloc printbuffer if necessary to have at least "needed" bytes more */ +static unsigned char* ensure(printbuffer * const p, size_t needed) +{ + unsigned char *newbuffer = NULL; + size_t newsize = 0; + + if ((p == NULL) || (p->buffer == NULL)) + { + return NULL; + } + + if ((p->length > 0) && (p->offset >= p->length)) + { + /* make sure that offset is valid */ + return NULL; + } + + if (needed > INT_MAX) + { + /* sizes bigger than INT_MAX are currently not supported */ + return NULL; + } + + needed += p->offset + 1; + if (needed <= p->length) + { + return p->buffer + p->offset; + } + + if (p->noalloc) { + return NULL; + } + + /* calculate new buffer size */ + if (needed > (INT_MAX / 2)) + { + /* overflow of int, use INT_MAX if possible */ + if (needed <= INT_MAX) + { + newsize = INT_MAX; + } + else + { + return NULL; + } + } + else + { + newsize = needed * 2; + } + + if (p->hooks.reallocate != NULL) + { + /* reallocate with realloc if available */ + newbuffer = (unsigned char*)p->hooks.reallocate(p->buffer, newsize); + if (newbuffer == NULL) + { + p->hooks.deallocate(p->buffer); + p->length = 0; + p->buffer = NULL; + + return NULL; + } + } + else + { + /* otherwise reallocate manually */ + newbuffer = (unsigned char*)p->hooks.allocate(newsize); + if (!newbuffer) + { + p->hooks.deallocate(p->buffer); + p->length = 0; + p->buffer = NULL; + + return NULL; + } + if (newbuffer) + { + memcpy(newbuffer, p->buffer, p->offset + 1); + } + p->hooks.deallocate(p->buffer); + } + p->length = newsize; + p->buffer = newbuffer; + + return newbuffer + p->offset; +} + +/* calculate the new length of the string in a printbuffer and update the offset */ +static void update_offset(printbuffer * const buffer) +{ + const unsigned char *buffer_pointer = NULL; + if ((buffer == NULL) || (buffer->buffer == NULL)) + { + return; + } + buffer_pointer = buffer->buffer + buffer->offset; + + buffer->offset += strlen((const char*)buffer_pointer); +} + +/* securely comparison of floating-point variables */ +static cJSON_bool compare_double(double a, double b) +{ + return (fabs(a - b) <= CJSON_DOUBLE_PRECISION); +} + +/* Render the number nicely from the given item into a string. */ +static cJSON_bool print_number(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output_pointer = NULL; + double d = item->valuedouble; + int length = 0; + size_t i = 0; + unsigned char number_buffer[26] = {0}; /* temporary buffer to print the number into */ + unsigned char decimal_point = get_decimal_point(); + double test = 0.0; + + if (output_buffer == NULL) + { + return false; + } + + /* This checks for NaN and Infinity */ + if ((d * 0) != 0) + { + length = sprintf((char*)number_buffer, "null"); + } + else + { + /* Try 15 decimal places of precision to avoid nonsignificant nonzero digits */ + length = sprintf((char*)number_buffer, "%1.15g", d); + + /* Check whether the original double can be recovered */ + if ((sscanf((char*)number_buffer, "%lg", &test) != 1) || !compare_double((double)test, d)) + { + /* If not, print with 17 decimal places of precision */ + length = sprintf((char*)number_buffer, "%1.17g", d); + } + } + + /* sprintf failed or buffer overrun occurred */ + if ((length < 0) || (length > (int)(sizeof(number_buffer) - 1))) + { + return false; + } + + /* reserve appropriate space in the output */ + output_pointer = ensure(output_buffer, (size_t)length + sizeof("")); + if (output_pointer == NULL) + { + return false; + } + + /* copy the printed number to the output and replace locale + * dependent decimal point with '.' */ + for (i = 0; i < ((size_t)length); i++) + { + if (number_buffer[i] == decimal_point) + { + output_pointer[i] = '.'; + continue; + } + + output_pointer[i] = number_buffer[i]; + } + output_pointer[i] = '\0'; + + output_buffer->offset += (size_t)length; + + return true; +} + +/* parse 4 digit hexadecimal number */ +static unsigned parse_hex4(const unsigned char * const input) +{ + unsigned int h = 0; + size_t i = 0; + + for (i = 0; i < 4; i++) + { + /* parse digit */ + if ((input[i] >= '0') && (input[i] <= '9')) + { + h += (unsigned int) input[i] - '0'; + } + else if ((input[i] >= 'A') && (input[i] <= 'F')) + { + h += (unsigned int) 10 + input[i] - 'A'; + } + else if ((input[i] >= 'a') && (input[i] <= 'f')) + { + h += (unsigned int) 10 + input[i] - 'a'; + } + else /* invalid */ + { + return 0; + } + + if (i < 3) + { + /* shift left to make place for the next nibble */ + h = h << 4; + } + } + + return h; +} + +/* converts a UTF-16 literal to UTF-8 + * A literal can be one or two sequences of the form \uXXXX */ +static unsigned char utf16_literal_to_utf8(const unsigned char * const input_pointer, const unsigned char * const input_end, unsigned char **output_pointer) +{ + long unsigned int codepoint = 0; + unsigned int first_code = 0; + const unsigned char *first_sequence = input_pointer; + unsigned char utf8_length = 0; + unsigned char utf8_position = 0; + unsigned char sequence_length = 0; + unsigned char first_byte_mark = 0; + + if ((input_end - first_sequence) < 6) + { + /* input ends unexpectedly */ + goto fail; + } + + /* get the first utf16 sequence */ + first_code = parse_hex4(first_sequence + 2); + + /* check that the code is valid */ + if (((first_code >= 0xDC00) && (first_code <= 0xDFFF))) + { + goto fail; + } + + /* UTF16 surrogate pair */ + if ((first_code >= 0xD800) && (first_code <= 0xDBFF)) + { + const unsigned char *second_sequence = first_sequence + 6; + unsigned int second_code = 0; + sequence_length = 12; /* \uXXXX\uXXXX */ + + if ((input_end - second_sequence) < 6) + { + /* input ends unexpectedly */ + goto fail; + } + + if ((second_sequence[0] != '\\') || (second_sequence[1] != 'u')) + { + /* missing second half of the surrogate pair */ + goto fail; + } + + /* get the second utf16 sequence */ + second_code = parse_hex4(second_sequence + 2); + /* check that the code is valid */ + if ((second_code < 0xDC00) || (second_code > 0xDFFF)) + { + /* invalid second half of the surrogate pair */ + goto fail; + } + + + /* calculate the unicode codepoint from the surrogate pair */ + codepoint = 0x10000 + (((first_code & 0x3FF) << 10) | (second_code & 0x3FF)); + } + else + { + sequence_length = 6; /* \uXXXX */ + codepoint = first_code; + } + + /* encode as UTF-8 + * takes at maximum 4 bytes to encode: + * 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */ + if (codepoint < 0x80) + { + /* normal ascii, encoding 0xxxxxxx */ + utf8_length = 1; + } + else if (codepoint < 0x800) + { + /* two bytes, encoding 110xxxxx 10xxxxxx */ + utf8_length = 2; + first_byte_mark = 0xC0; /* 11000000 */ + } + else if (codepoint < 0x10000) + { + /* three bytes, encoding 1110xxxx 10xxxxxx 10xxxxxx */ + utf8_length = 3; + first_byte_mark = 0xE0; /* 11100000 */ + } + else if (codepoint <= 0x10FFFF) + { + /* four bytes, encoding 1110xxxx 10xxxxxx 10xxxxxx 10xxxxxx */ + utf8_length = 4; + first_byte_mark = 0xF0; /* 11110000 */ + } + else + { + /* invalid unicode codepoint */ + goto fail; + } + + /* encode as utf8 */ + for (utf8_position = (unsigned char)(utf8_length - 1); utf8_position > 0; utf8_position--) + { + /* 10xxxxxx */ + (*output_pointer)[utf8_position] = (unsigned char)((codepoint | 0x80) & 0xBF); + codepoint >>= 6; + } + /* encode first byte */ + if (utf8_length > 1) + { + (*output_pointer)[0] = (unsigned char)((codepoint | first_byte_mark) & 0xFF); + } + else + { + (*output_pointer)[0] = (unsigned char)(codepoint & 0x7F); + } + + *output_pointer += utf8_length; + + return sequence_length; + +fail: + return 0; +} + +/* Parse the input text into an unescaped cinput, and populate item. */ +static cJSON_bool parse_string(cJSON * const item, parse_buffer * const input_buffer) +{ + const unsigned char *input_pointer = buffer_at_offset(input_buffer) + 1; + const unsigned char *input_end = buffer_at_offset(input_buffer) + 1; + unsigned char *output_pointer = NULL; + unsigned char *output = NULL; + + /* not a string */ + if (buffer_at_offset(input_buffer)[0] != '\"') + { + goto fail; + } + + { + /* calculate approximate size of the output (overestimate) */ + size_t allocation_length = 0; + size_t skipped_bytes = 0; + while (((size_t)(input_end - input_buffer->content) < input_buffer->length) && (*input_end != '\"')) + { + /* is escape sequence */ + if (input_end[0] == '\\') + { + if ((size_t)(input_end + 1 - input_buffer->content) >= input_buffer->length) + { + /* prevent buffer overflow when last input character is a backslash */ + goto fail; + } + skipped_bytes++; + input_end++; + } + input_end++; + } + if (((size_t)(input_end - input_buffer->content) >= input_buffer->length) || (*input_end != '\"')) + { + goto fail; /* string ended unexpectedly */ + } + + /* This is at most how much we need for the output */ + allocation_length = (size_t) (input_end - buffer_at_offset(input_buffer)) - skipped_bytes; + output = (unsigned char*)input_buffer->hooks.allocate(allocation_length + sizeof("")); + if (output == NULL) + { + goto fail; /* allocation failure */ + } + } + + output_pointer = output; + /* loop through the string literal */ + while (input_pointer < input_end) + { + if (*input_pointer != '\\') + { + *output_pointer++ = *input_pointer++; + } + /* escape sequence */ + else + { + unsigned char sequence_length = 2; + if ((input_end - input_pointer) < 1) + { + goto fail; + } + + switch (input_pointer[1]) + { + case 'b': + *output_pointer++ = '\b'; + break; + case 'f': + *output_pointer++ = '\f'; + break; + case 'n': + *output_pointer++ = '\n'; + break; + case 'r': + *output_pointer++ = '\r'; + break; + case 't': + *output_pointer++ = '\t'; + break; + case '\"': + case '\\': + case '/': + *output_pointer++ = input_pointer[1]; + break; + + /* UTF-16 literal */ + case 'u': + sequence_length = utf16_literal_to_utf8(input_pointer, input_end, &output_pointer); + if (sequence_length == 0) + { + /* failed to convert UTF16-literal to UTF-8 */ + goto fail; + } + break; + + default: + goto fail; + } + input_pointer += sequence_length; + } + } + + /* zero terminate the output */ + *output_pointer = '\0'; + + item->type = cJSON_String; + item->valuestring = (char*)output; + + input_buffer->offset = (size_t) (input_end - input_buffer->content); + input_buffer->offset++; + + return true; + +fail: + if (output != NULL) + { + input_buffer->hooks.deallocate(output); + } + + if (input_pointer != NULL) + { + input_buffer->offset = (size_t)(input_pointer - input_buffer->content); + } + + return false; +} + +/* Render the cstring provided to an escaped version that can be printed. */ +static cJSON_bool print_string_ptr(const unsigned char * const input, printbuffer * const output_buffer) +{ + const unsigned char *input_pointer = NULL; + unsigned char *output = NULL; + unsigned char *output_pointer = NULL; + size_t output_length = 0; + /* numbers of additional characters needed for escaping */ + size_t escape_characters = 0; + + if (output_buffer == NULL) + { + return false; + } + + /* empty string */ + if (input == NULL) + { + output = ensure(output_buffer, sizeof("\"\"")); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "\"\""); + + return true; + } + + /* set "flag" to 1 if something needs to be escaped */ + for (input_pointer = input; *input_pointer; input_pointer++) + { + switch (*input_pointer) + { + case '\"': + case '\\': + case '\b': + case '\f': + case '\n': + case '\r': + case '\t': + /* one character escape sequence */ + escape_characters++; + break; + default: + if (*input_pointer < 32) + { + /* UTF-16 escape sequence uXXXX */ + escape_characters += 5; + } + break; + } + } + output_length = (size_t)(input_pointer - input) + escape_characters; + + output = ensure(output_buffer, output_length + sizeof("\"\"")); + if (output == NULL) + { + return false; + } + + /* no characters have to be escaped */ + if (escape_characters == 0) + { + output[0] = '\"'; + memcpy(output + 1, input, output_length); + output[output_length + 1] = '\"'; + output[output_length + 2] = '\0'; + + return true; + } + + output[0] = '\"'; + output_pointer = output + 1; + /* copy the string */ + for (input_pointer = input; *input_pointer != '\0'; (void)input_pointer++, output_pointer++) + { + if ((*input_pointer > 31) && (*input_pointer != '\"') && (*input_pointer != '\\')) + { + /* normal character, copy */ + *output_pointer = *input_pointer; + } + else + { + /* character needs to be escaped */ + *output_pointer++ = '\\'; + switch (*input_pointer) + { + case '\\': + *output_pointer = '\\'; + break; + case '\"': + *output_pointer = '\"'; + break; + case '\b': + *output_pointer = 'b'; + break; + case '\f': + *output_pointer = 'f'; + break; + case '\n': + *output_pointer = 'n'; + break; + case '\r': + *output_pointer = 'r'; + break; + case '\t': + *output_pointer = 't'; + break; + default: + /* escape and print as unicode codepoint */ + sprintf((char*)output_pointer, "u%04x", *input_pointer); + output_pointer += 4; + break; + } + } + } + output[output_length + 1] = '\"'; + output[output_length + 2] = '\0'; + + return true; +} + +/* Invoke print_string_ptr (which is useful) on an item. */ +static cJSON_bool print_string(const cJSON * const item, printbuffer * const p) +{ + return print_string_ptr((unsigned char*)item->valuestring, p); +} + +/* Predeclare these prototypes. */ +static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buffer); +static cJSON_bool print_value(const cJSON * const item, printbuffer * const output_buffer); +static cJSON_bool parse_array(cJSON * const item, parse_buffer * const input_buffer); +static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer); +static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_buffer); +static cJSON_bool print_object(const cJSON * const item, printbuffer * const output_buffer); + +/* Utility to jump whitespace and cr/lf */ +static parse_buffer *buffer_skip_whitespace(parse_buffer * const buffer) +{ + if ((buffer == NULL) || (buffer->content == NULL)) + { + return NULL; + } + + while (can_access_at_index(buffer, 0) && (buffer_at_offset(buffer)[0] <= 32)) + { + buffer->offset++; + } + + if (buffer->offset == buffer->length) + { + buffer->offset--; + } + + return buffer; +} + +/* skip the UTF-8 BOM (byte order mark) if it is at the beginning of a buffer */ +static parse_buffer *skip_utf8_bom(parse_buffer * const buffer) +{ + if ((buffer == NULL) || (buffer->content == NULL) || (buffer->offset != 0)) + { + return NULL; + } + + if (can_access_at_index(buffer, 4) && (strncmp((const char*)buffer_at_offset(buffer), "\xEF\xBB\xBF", 3) == 0)) + { + buffer->offset += 3; + } + + return buffer; +} + +/* Parse an object - create a new root, and populate. */ +CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated) +{ + parse_buffer buffer = { 0, 0, 0, 0, { 0, 0, 0 } }; + cJSON *item = NULL; + + /* reset error position */ + global_error.json = NULL; + global_error.position = 0; + + if (value == NULL) + { + goto fail; + } + + buffer.content = (const unsigned char*)value; + buffer.length = strlen((const char*)value) + sizeof(""); + buffer.offset = 0; + buffer.hooks = global_hooks; + + item = cJSON_New_Item(&global_hooks); + if (item == NULL) /* memory fail */ + { + goto fail; + } + + if (!parse_value(item, buffer_skip_whitespace(skip_utf8_bom(&buffer)))) + { + /* parse failure. ep is set. */ + goto fail; + } + + /* if we require null-terminated JSON without appended garbage, skip and then check for a null terminator */ + if (require_null_terminated) + { + buffer_skip_whitespace(&buffer); + if ((buffer.offset >= buffer.length) || buffer_at_offset(&buffer)[0] != '\0') + { + goto fail; + } + } + if (return_parse_end) + { + *return_parse_end = (const char*)buffer_at_offset(&buffer); + } + + return item; + +fail: + if (item != NULL) + { + cJSON_Delete(item); + } + + if (value != NULL) + { + error local_error; + local_error.json = (const unsigned char*)value; + local_error.position = 0; + + if (buffer.offset < buffer.length) + { + local_error.position = buffer.offset; + } + else if (buffer.length > 0) + { + local_error.position = buffer.length - 1; + } + + if (return_parse_end != NULL) + { + *return_parse_end = (const char*)local_error.json + local_error.position; + } + + global_error = local_error; + } + + return NULL; +} + +/* Default options for cJSON_Parse */ +CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value) +{ + return cJSON_ParseWithOpts(value, 0, 0); +} + +#define cjson_min(a, b) ((a < b) ? a : b) + +static unsigned char *print(const cJSON * const item, cJSON_bool format, const internal_hooks * const hooks) +{ + static const size_t default_buffer_size = 256; + printbuffer buffer[1]; + unsigned char *printed = NULL; + + memset(buffer, 0, sizeof(buffer)); + + /* create buffer */ + buffer->buffer = (unsigned char*) hooks->allocate(default_buffer_size); + buffer->length = default_buffer_size; + buffer->format = format; + buffer->hooks = *hooks; + if (buffer->buffer == NULL) + { + goto fail; + } + + /* print the value */ + if (!print_value(item, buffer)) + { + goto fail; + } + update_offset(buffer); + + /* check if reallocate is available */ + if (hooks->reallocate != NULL) + { + printed = (unsigned char*) hooks->reallocate(buffer->buffer, buffer->offset + 1); + if (printed == NULL) { + goto fail; + } + buffer->buffer = NULL; + } + else /* otherwise copy the JSON over to a new buffer */ + { + printed = (unsigned char*) hooks->allocate(buffer->offset + 1); + if (printed == NULL) + { + goto fail; + } + memcpy(printed, buffer->buffer, cjson_min(buffer->length, buffer->offset + 1)); + printed[buffer->offset] = '\0'; /* just to be sure */ + + /* free the buffer */ + hooks->deallocate(buffer->buffer); + } + + return printed; + +fail: + if (buffer->buffer != NULL) + { + hooks->deallocate(buffer->buffer); + } + + if (printed != NULL) + { + hooks->deallocate(printed); + } + + return NULL; +} + +/* Render a cJSON item/entity/structure to text. */ +CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item) +{ + return (char*)print(item, true, &global_hooks); +} + +CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item) +{ + return (char*)print(item, false, &global_hooks); +} + +CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt) +{ + printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; + + if (prebuffer < 0) + { + return NULL; + } + + p.buffer = (unsigned char*)global_hooks.allocate((size_t)prebuffer); + if (!p.buffer) + { + return NULL; + } + + p.length = (size_t)prebuffer; + p.offset = 0; + p.noalloc = false; + p.format = fmt; + p.hooks = global_hooks; + + if (!print_value(item, &p)) + { + global_hooks.deallocate(p.buffer); + return NULL; + } + + return (char*)p.buffer; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format) +{ + printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; + + if ((length < 0) || (buffer == NULL)) + { + return false; + } + + p.buffer = (unsigned char*)buffer; + p.length = (size_t)length; + p.offset = 0; + p.noalloc = true; + p.format = format; + p.hooks = global_hooks; + + return print_value(item, &p); +} + +/* Parser core - when encountering text, process appropriately. */ +static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buffer) +{ + if ((input_buffer == NULL) || (input_buffer->content == NULL)) + { + return false; /* no input */ + } + + /* parse the different types of values */ + /* null */ + if (can_read(input_buffer, 4) && (strncmp((const char*)buffer_at_offset(input_buffer), "null", 4) == 0)) + { + item->type = cJSON_NULL; + input_buffer->offset += 4; + return true; + } + /* false */ + if (can_read(input_buffer, 5) && (strncmp((const char*)buffer_at_offset(input_buffer), "false", 5) == 0)) + { + item->type = cJSON_False; + input_buffer->offset += 5; + return true; + } + /* true */ + if (can_read(input_buffer, 4) && (strncmp((const char*)buffer_at_offset(input_buffer), "true", 4) == 0)) + { + item->type = cJSON_True; + item->valueint = 1; + input_buffer->offset += 4; + return true; + } + /* string */ + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '\"')) + { + return parse_string(item, input_buffer); + } + /* number */ + if (can_access_at_index(input_buffer, 0) && ((buffer_at_offset(input_buffer)[0] == '-') || ((buffer_at_offset(input_buffer)[0] >= '0') && (buffer_at_offset(input_buffer)[0] <= '9')))) + { + return parse_number(item, input_buffer); + } + /* array */ + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '[')) + { + return parse_array(item, input_buffer); + } + /* object */ + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '{')) + { + return parse_object(item, input_buffer); + } + + return false; +} + +/* Render a value to text. */ +static cJSON_bool print_value(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output = NULL; + + if ((item == NULL) || (output_buffer == NULL)) + { + return false; + } + + switch ((item->type) & 0xFF) + { + case cJSON_NULL: + output = ensure(output_buffer, 5); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "null"); + return true; + + case cJSON_False: + output = ensure(output_buffer, 6); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "false"); + return true; + + case cJSON_True: + output = ensure(output_buffer, 5); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "true"); + return true; + + case cJSON_Number: + return print_number(item, output_buffer); + + case cJSON_Raw: + { + size_t raw_length = 0; + if (item->valuestring == NULL) + { + return false; + } + + raw_length = strlen(item->valuestring) + sizeof(""); + output = ensure(output_buffer, raw_length); + if (output == NULL) + { + return false; + } + memcpy(output, item->valuestring, raw_length); + return true; + } + + case cJSON_String: + return print_string(item, output_buffer); + + case cJSON_Array: + return print_array(item, output_buffer); + + case cJSON_Object: + return print_object(item, output_buffer); + + default: + return false; + } +} + +/* Build an array from input text. */ +static cJSON_bool parse_array(cJSON * const item, parse_buffer * const input_buffer) +{ + cJSON *head = NULL; /* head of the linked list */ + cJSON *current_item = NULL; + + if (input_buffer->depth >= CJSON_NESTING_LIMIT) + { + return false; /* to deeply nested */ + } + input_buffer->depth++; + + if (buffer_at_offset(input_buffer)[0] != '[') + { + /* not an array */ + goto fail; + } + + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ']')) + { + /* empty array */ + goto success; + } + + /* check if we skipped to the end of the buffer */ + if (cannot_access_at_index(input_buffer, 0)) + { + input_buffer->offset--; + goto fail; + } + + /* step back to character in front of the first element */ + input_buffer->offset--; + /* loop through the comma separated array elements */ + do + { + /* allocate next item */ + cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); + if (new_item == NULL) + { + goto fail; /* allocation failure */ + } + + /* attach next item to list */ + if (head == NULL) + { + /* start the linked list */ + current_item = head = new_item; + } + else + { + /* add to the end and advance */ + current_item->next = new_item; + new_item->prev = current_item; + current_item = new_item; + } + + /* parse next value */ + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (!parse_value(current_item, input_buffer)) + { + goto fail; /* failed to parse value */ + } + buffer_skip_whitespace(input_buffer); + } + while (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ',')); + + if (cannot_access_at_index(input_buffer, 0) || buffer_at_offset(input_buffer)[0] != ']') + { + goto fail; /* expected end of array */ + } + +success: + input_buffer->depth--; + + item->type = cJSON_Array; + item->child = head; + + input_buffer->offset++; + + return true; + +fail: + if (head != NULL) + { + cJSON_Delete(head); + } + + return false; +} + +/* Render an array to text */ +static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output_pointer = NULL; + size_t length = 0; + cJSON *current_element = item->child; + + if (output_buffer == NULL) + { + return false; + } + + /* Compose the output array. */ + /* opening square bracket */ + output_pointer = ensure(output_buffer, 1); + if (output_pointer == NULL) + { + return false; + } + + *output_pointer = '['; + output_buffer->offset++; + output_buffer->depth++; + + while (current_element != NULL) + { + if (!print_value(current_element, output_buffer)) + { + return false; + } + update_offset(output_buffer); + if (current_element->next) + { + length = (size_t) (output_buffer->format ? 2 : 1); + output_pointer = ensure(output_buffer, length + 1); + if (output_pointer == NULL) + { + return false; + } + *output_pointer++ = ','; + if(output_buffer->format) + { + *output_pointer++ = ' '; + } + *output_pointer = '\0'; + output_buffer->offset += length; + } + current_element = current_element->next; + } + + output_pointer = ensure(output_buffer, 2); + if (output_pointer == NULL) + { + return false; + } + *output_pointer++ = ']'; + *output_pointer = '\0'; + output_buffer->depth--; + + return true; +} + +/* Build an object from the text. */ +static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_buffer) +{ + cJSON *head = NULL; /* linked list head */ + cJSON *current_item = NULL; + + if (input_buffer->depth >= CJSON_NESTING_LIMIT) + { + return false; /* to deeply nested */ + } + input_buffer->depth++; + + if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != '{')) + { + goto fail; /* not an object */ + } + + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '}')) + { + goto success; /* empty object */ + } + + /* check if we skipped to the end of the buffer */ + if (cannot_access_at_index(input_buffer, 0)) + { + input_buffer->offset--; + goto fail; + } + + /* step back to character in front of the first element */ + input_buffer->offset--; + /* loop through the comma separated array elements */ + do + { + /* allocate next item */ + cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); + if (new_item == NULL) + { + goto fail; /* allocation failure */ + } + + /* attach next item to list */ + if (head == NULL) + { + /* start the linked list */ + current_item = head = new_item; + } + else + { + /* add to the end and advance */ + current_item->next = new_item; + new_item->prev = current_item; + current_item = new_item; + } + + /* parse the name of the child */ + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (!parse_string(current_item, input_buffer)) + { + goto fail; /* failed to parse name */ + } + buffer_skip_whitespace(input_buffer); + + /* swap valuestring and string, because we parsed the name */ + current_item->string = current_item->valuestring; + current_item->valuestring = NULL; + + if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != ':')) + { + goto fail; /* invalid object */ + } + + /* parse the value */ + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (!parse_value(current_item, input_buffer)) + { + goto fail; /* failed to parse value */ + } + buffer_skip_whitespace(input_buffer); + } + while (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ',')); + + if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != '}')) + { + goto fail; /* expected end of object */ + } + +success: + input_buffer->depth--; + + item->type = cJSON_Object; + item->child = head; + + input_buffer->offset++; + return true; + +fail: + if (head != NULL) + { + cJSON_Delete(head); + } + + return false; +} + +/* Render an object to text. */ +static cJSON_bool print_object(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output_pointer = NULL; + size_t length = 0; + cJSON *current_item = item->child; + + if (output_buffer == NULL) + { + return false; + } + + /* Compose the output: */ + length = (size_t) (output_buffer->format ? 2 : 1); /* fmt: {\n */ + output_pointer = ensure(output_buffer, length + 1); + if (output_pointer == NULL) + { + return false; + } + + *output_pointer++ = '{'; + output_buffer->depth++; + if (output_buffer->format) + { + *output_pointer++ = '\n'; + } + output_buffer->offset += length; + + while (current_item) + { + if (output_buffer->format) + { + size_t i; + output_pointer = ensure(output_buffer, output_buffer->depth); + if (output_pointer == NULL) + { + return false; + } + for (i = 0; i < output_buffer->depth; i++) + { + *output_pointer++ = '\t'; + } + output_buffer->offset += output_buffer->depth; + } + + /* print key */ + if (!print_string_ptr((unsigned char*)current_item->string, output_buffer)) + { + return false; + } + update_offset(output_buffer); + + length = (size_t) (output_buffer->format ? 2 : 1); + output_pointer = ensure(output_buffer, length); + if (output_pointer == NULL) + { + return false; + } + *output_pointer++ = ':'; + if (output_buffer->format) + { + *output_pointer++ = '\t'; + } + output_buffer->offset += length; + + /* print value */ + if (!print_value(current_item, output_buffer)) + { + return false; + } + update_offset(output_buffer); + + /* print comma if not last */ + length = ((size_t)(output_buffer->format ? 1 : 0) + (size_t)(current_item->next ? 1 : 0)); + output_pointer = ensure(output_buffer, length + 1); + if (output_pointer == NULL) + { + return false; + } + if (current_item->next) + { + *output_pointer++ = ','; + } + + if (output_buffer->format) + { + *output_pointer++ = '\n'; + } + *output_pointer = '\0'; + output_buffer->offset += length; + + current_item = current_item->next; + } + + output_pointer = ensure(output_buffer, output_buffer->format ? (output_buffer->depth + 1) : 2); + if (output_pointer == NULL) + { + return false; + } + if (output_buffer->format) + { + size_t i; + for (i = 0; i < (output_buffer->depth - 1); i++) + { + *output_pointer++ = '\t'; + } + } + *output_pointer++ = '}'; + *output_pointer = '\0'; + output_buffer->depth--; + + return true; +} + +/* Get Array size/item / object item. */ +CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array) +{ + cJSON *child = NULL; + size_t size = 0; + + if (array == NULL) + { + return 0; + } + + child = array->child; + + while(child != NULL) + { + size++; + child = child->next; + } + + /* FIXME: Can overflow here. Cannot be fixed without breaking the API */ + + return (int)size; +} + +static cJSON* get_array_item(const cJSON *array, size_t index) +{ + cJSON *current_child = NULL; + + if (array == NULL) + { + return NULL; + } + + current_child = array->child; + while ((current_child != NULL) && (index > 0)) + { + index--; + current_child = current_child->next; + } + + return current_child; +} + +CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index) +{ + if (index < 0) + { + return NULL; + } + + return get_array_item(array, (size_t)index); +} + +static cJSON *get_object_item(const cJSON * const object, const char * const name, const cJSON_bool case_sensitive) +{ + cJSON *current_element = NULL; + + if ((object == NULL) || (name == NULL)) + { + return NULL; + } + + current_element = object->child; + if (case_sensitive) + { + while ((current_element != NULL) && (current_element->string != NULL) && (strcmp(name, current_element->string) != 0)) + { + current_element = current_element->next; + } + } + else + { + while ((current_element != NULL) && (case_insensitive_strcmp((const unsigned char*)name, (const unsigned char*)(current_element->string)) != 0)) + { + current_element = current_element->next; + } + } + + if ((current_element == NULL) || (current_element->string == NULL)) { + return NULL; + } + + return current_element; +} + +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string) +{ + return get_object_item(object, string, false); +} + +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string) +{ + return get_object_item(object, string, true); +} + +CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string) +{ + return cJSON_GetObjectItem(object, string) ? 1 : 0; +} + +/* Utility for array list handling. */ +static void suffix_object(cJSON *prev, cJSON *item) +{ + prev->next = item; + item->prev = prev; +} + +/* Utility for handling references. */ +static cJSON *create_reference(const cJSON *item, const internal_hooks * const hooks) +{ + cJSON *reference = NULL; + if (item == NULL) + { + return NULL; + } + + reference = cJSON_New_Item(hooks); + if (reference == NULL) + { + return NULL; + } + + memcpy(reference, item, sizeof(cJSON)); + reference->string = NULL; + reference->type |= cJSON_IsReference; + reference->next = reference->prev = NULL; + return reference; +} + +static cJSON_bool add_item_to_array(cJSON *array, cJSON *item) +{ + cJSON *child = NULL; + + if ((item == NULL) || (array == NULL)) + { + return false; + } + + child = array->child; + /* + * To find the last item int array quickly, we use prev in array + */ + if (child == NULL) + { + /* list is empty, start new one */ + array->child = item; + item->prev = item; + item->next = NULL; + } + else + { + /* append to the end */ + if (child->prev) + { + suffix_object(child->prev, item); + array->child->prev = item; + } + else + { + while (child->next) + { + child = child->next; + } + suffix_object(child, item); + array->child->prev = item; + } + } + return true; +} + +/* Add item to array/object. */ +CJSON_PUBLIC(void) cJSON_AddItemToArray(cJSON *array, cJSON *item) +{ + add_item_to_array(array, item); +} + +#if defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) + #pragma GCC diagnostic push +#endif +#ifdef __GNUC__ +#pragma GCC diagnostic ignored "-Wcast-qual" +#endif +/* helper function to cast away const */ +static void* cast_away_const(const void* string) +{ + return (void*)string; +} +#if defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) + #pragma GCC diagnostic pop +#endif + + +static cJSON_bool add_item_to_object(cJSON * const object, const char * const string, cJSON * const item, const internal_hooks * const hooks, const cJSON_bool constant_key) +{ + char *new_key = NULL; + int new_type = cJSON_Invalid; + + if ((object == NULL) || (string == NULL) || (item == NULL)) + { + return false; + } + + if (constant_key) + { + new_key = (char*)cast_away_const(string); + new_type = item->type | cJSON_StringIsConst; + } + else + { + new_key = (char*)cJSON_strdup((const unsigned char*)string, hooks); + if (new_key == NULL) + { + return false; + } + + new_type = item->type & ~cJSON_StringIsConst; + } + + if (!(item->type & cJSON_StringIsConst) && (item->string != NULL)) + { + hooks->deallocate(item->string); + } + + item->string = new_key; + item->type = new_type; + + return add_item_to_array(object, item); +} + +CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item) +{ + add_item_to_object(object, string, item, &global_hooks, false); +} + +/* Add an item to an object with constant string as key */ +CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item) +{ + add_item_to_object(object, string, item, &global_hooks, true); +} + +CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) +{ + if (array == NULL) + { + return; + } + + add_item_to_array(array, create_reference(item, &global_hooks)); +} + +CJSON_PUBLIC(void) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item) +{ + if ((object == NULL) || (string == NULL)) + { + return; + } + + add_item_to_object(object, string, create_reference(item, &global_hooks), &global_hooks, false); +} + +CJSON_PUBLIC(cJSON*) cJSON_AddNullToObject(cJSON * const object, const char * const name) +{ + cJSON *null = cJSON_CreateNull(); + if (add_item_to_object(object, name, null, &global_hooks, false)) + { + return null; + } + + cJSON_Delete(null); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddTrueToObject(cJSON * const object, const char * const name) +{ + cJSON *true_item = cJSON_CreateTrue(); + if (add_item_to_object(object, name, true_item, &global_hooks, false)) + { + return true_item; + } + + cJSON_Delete(true_item); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddFalseToObject(cJSON * const object, const char * const name) +{ + cJSON *false_item = cJSON_CreateFalse(); + if (add_item_to_object(object, name, false_item, &global_hooks, false)) + { + return false_item; + } + + cJSON_Delete(false_item); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const cJSON_bool boolean) +{ + cJSON *bool_item = cJSON_CreateBool(boolean); + if (add_item_to_object(object, name, bool_item, &global_hooks, false)) + { + return bool_item; + } + + cJSON_Delete(bool_item); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number) +{ + cJSON *number_item = cJSON_CreateNumber(number); + if (add_item_to_object(object, name, number_item, &global_hooks, false)) + { + return number_item; + } + + cJSON_Delete(number_item); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string) +{ + cJSON *string_item = cJSON_CreateString(string); + if (add_item_to_object(object, name, string_item, &global_hooks, false)) + { + return string_item; + } + + cJSON_Delete(string_item); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw) +{ + cJSON *raw_item = cJSON_CreateRaw(raw); + if (add_item_to_object(object, name, raw_item, &global_hooks, false)) + { + return raw_item; + } + + cJSON_Delete(raw_item); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name) +{ + cJSON *object_item = cJSON_CreateObject(); + if (add_item_to_object(object, name, object_item, &global_hooks, false)) + { + return object_item; + } + + cJSON_Delete(object_item); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name) +{ + cJSON *array = cJSON_CreateArray(); + if (add_item_to_object(object, name, array, &global_hooks, false)) + { + return array; + } + + cJSON_Delete(array); + return NULL; +} + +CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item) +{ + if ((parent == NULL) || (item == NULL)) + { + return NULL; + } + + if (item->prev != NULL) + { + /* not the first element */ + item->prev->next = item->next; + } + if (item->next != NULL) + { + /* not the last element */ + item->next->prev = item->prev; + } + + if (item == parent->child) + { + /* first element */ + parent->child = item->next; + } + /* make sure the detached item doesn't point anywhere anymore */ + item->prev = NULL; + item->next = NULL; + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which) +{ + if (which < 0) + { + return NULL; + } + + return cJSON_DetachItemViaPointer(array, get_array_item(array, (size_t)which)); +} + +CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which) +{ + cJSON_Delete(cJSON_DetachItemFromArray(array, which)); +} + +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string) +{ + cJSON *to_detach = cJSON_GetObjectItem(object, string); + + return cJSON_DetachItemViaPointer(object, to_detach); +} + +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string) +{ + cJSON *to_detach = cJSON_GetObjectItemCaseSensitive(object, string); + + return cJSON_DetachItemViaPointer(object, to_detach); +} + +CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string) +{ + cJSON_Delete(cJSON_DetachItemFromObject(object, string)); +} + +CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string) +{ + cJSON_Delete(cJSON_DetachItemFromObjectCaseSensitive(object, string)); +} + +/* Replace array/object items with new ones. */ +CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem) +{ + cJSON *after_inserted = NULL; + + if (which < 0) + { + return; + } + + after_inserted = get_array_item(array, (size_t)which); + if (after_inserted == NULL) + { + add_item_to_array(array, newitem); + return; + } + + newitem->next = after_inserted; + newitem->prev = after_inserted->prev; + after_inserted->prev = newitem; + if (after_inserted == array->child) + { + array->child = newitem; + } + else + { + newitem->prev->next = newitem; + } +} + +CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement) +{ + if ((parent == NULL) || (replacement == NULL) || (item == NULL)) + { + return false; + } + + if (replacement == item) + { + return true; + } + + replacement->next = item->next; + replacement->prev = item->prev; + + if (replacement->next != NULL) + { + replacement->next->prev = replacement; + } + + if (parent->child == item) + { + parent->child = replacement; + } + else + { /* + * To find the last item int array quickly, we use prev in array. + * We can't modify the last item's next pointer where this item was the parent's child + */ + if (replacement->prev != NULL) + { + replacement->prev->next = replacement; + } + } + + item->next = NULL; + item->prev = NULL; + cJSON_Delete(item); + + return true; +} + +CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem) +{ + if (which < 0) + { + return; + } + + cJSON_ReplaceItemViaPointer(array, get_array_item(array, (size_t)which), newitem); +} + +static cJSON_bool replace_item_in_object(cJSON *object, const char *string, cJSON *replacement, cJSON_bool case_sensitive) +{ + if ((replacement == NULL) || (string == NULL)) + { + return false; + } + + /* replace the name in the replacement */ + if (!(replacement->type & cJSON_StringIsConst) && (replacement->string != NULL)) + { + cJSON_free(replacement->string); + } + replacement->string = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); + replacement->type &= ~cJSON_StringIsConst; + + cJSON_ReplaceItemViaPointer(object, get_object_item(object, string, case_sensitive), replacement); + + return true; +} + +CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newitem) +{ + replace_item_in_object(object, string, newitem, false); +} + +CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object, const char *string, cJSON *newitem) +{ + replace_item_in_object(object, string, newitem, true); +} + +/* Create basic types: */ +CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_NULL; + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_True; + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_False; + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool boolean) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = boolean ? cJSON_True : cJSON_False; + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_Number; + item->valuedouble = num; + + /* use saturation in case of overflow */ + if (num >= INT_MAX) + { + item->valueint = INT_MAX; + } + else if (num <= (double)INT_MIN) + { + item->valueint = INT_MIN; + } + else + { + item->valueint = (int)num; + } + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_String; + item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); + if(!item->valuestring) + { + cJSON_Delete(item); + return NULL; + } + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if (item != NULL) + { + item->type = cJSON_String | cJSON_IsReference; + item->valuestring = (char*)cast_away_const(string); + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if (item != NULL) { + item->type = cJSON_Object | cJSON_IsReference; + item->child = (cJSON*)cast_away_const(child); + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child) { + cJSON *item = cJSON_New_Item(&global_hooks); + if (item != NULL) { + item->type = cJSON_Array | cJSON_IsReference; + item->child = (cJSON*)cast_away_const(child); + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_Raw; + item->valuestring = (char*)cJSON_strdup((const unsigned char*)raw, &global_hooks); + if(!item->valuestring) + { + cJSON_Delete(item); + return NULL; + } + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type=cJSON_Array; + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if (item) + { + item->type = cJSON_Object; + } + + return item; +} + +/* Create Arrays: */ +CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count) +{ + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (numbers == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + for(i = 0; a && (i < (size_t)count); i++) + { + n = cJSON_CreateNumber(numbers[i]); + if (!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p, n); + } + p = n; + } + + return a; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count) +{ + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (numbers == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + + for(i = 0; a && (i < (size_t)count); i++) + { + n = cJSON_CreateNumber((double)numbers[i]); + if(!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p, n); + } + p = n; + } + + return a; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count) +{ + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (numbers == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + + for(i = 0;a && (i < (size_t)count); i++) + { + n = cJSON_CreateNumber(numbers[i]); + if(!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p, n); + } + p = n; + } + + return a; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char *const *strings, int count) +{ + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (strings == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + + for (i = 0; a && (i < (size_t)count); i++) + { + n = cJSON_CreateString(strings[i]); + if(!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p,n); + } + p = n; + } + + return a; +} + +/* Duplication */ +CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse) +{ + cJSON *newitem = NULL; + cJSON *child = NULL; + cJSON *next = NULL; + cJSON *newchild = NULL; + + /* Bail on bad ptr */ + if (!item) + { + goto fail; + } + /* Create new item */ + newitem = cJSON_New_Item(&global_hooks); + if (!newitem) + { + goto fail; + } + /* Copy over all vars */ + newitem->type = item->type & (~cJSON_IsReference); + newitem->valueint = item->valueint; + newitem->valuedouble = item->valuedouble; + if (item->valuestring) + { + newitem->valuestring = (char*)cJSON_strdup((unsigned char*)item->valuestring, &global_hooks); + if (!newitem->valuestring) + { + goto fail; + } + } + if (item->string) + { + newitem->string = (item->type&cJSON_StringIsConst) ? item->string : (char*)cJSON_strdup((unsigned char*)item->string, &global_hooks); + if (!newitem->string) + { + goto fail; + } + } + /* If non-recursive, then we're done! */ + if (!recurse) + { + return newitem; + } + /* Walk the ->next chain for the child. */ + child = item->child; + while (child != NULL) + { + newchild = cJSON_Duplicate(child, true); /* Duplicate (with recurse) each item in the ->next chain */ + if (!newchild) + { + goto fail; + } + if (next != NULL) + { + /* If newitem->child already set, then crosswire ->prev and ->next and move on */ + next->next = newchild; + newchild->prev = next; + next = newchild; + } + else + { + /* Set newitem->child and move to it */ + newitem->child = newchild; + next = newchild; + } + child = child->next; + } + + return newitem; + +fail: + if (newitem != NULL) + { + cJSON_Delete(newitem); + } + + return NULL; +} + +static void skip_oneline_comment(char **input) +{ + *input += static_strlen("//"); + + for (; (*input)[0] != '\0'; ++(*input)) + { + if ((*input)[0] == '\n') { + *input += static_strlen("\n"); + return; + } + } +} + +static void skip_multiline_comment(char **input) +{ + *input += static_strlen("/*"); + + for (; (*input)[0] != '\0'; ++(*input)) + { + if (((*input)[0] == '*') && ((*input)[1] == '/')) + { + *input += static_strlen("*/"); + return; + } + } +} + +static void minify_string(char **input, char **output) { + (*output)[0] = (*input)[0]; + *input += static_strlen("\""); + *output += static_strlen("\""); + + + for (; (*input)[0] != '\0'; (void)++(*input), ++(*output)) { + (*output)[0] = (*input)[0]; + + if ((*input)[0] == '\"') { + (*output)[0] = '\"'; + *input += static_strlen("\""); + *output += static_strlen("\""); + return; + } else if (((*input)[0] == '\\') && ((*input)[1] == '\"')) { + (*output)[1] = (*input)[1]; + *input += static_strlen("\""); + *output += static_strlen("\""); + } + } +} + +CJSON_PUBLIC(void) cJSON_Minify(char *json) +{ + char *into = json; + + if (json == NULL) + { + return; + } + + while (json[0] != '\0') + { + switch (json[0]) + { + case ' ': + case '\t': + case '\r': + case '\n': + json++; + break; + + case '/': + if (json[1] == '/') + { + skip_oneline_comment(&json); + } + else if (json[1] == '*') + { + skip_multiline_comment(&json); + } else { + json++; + } + break; + + case '\"': + minify_string(&json, (char**)&into); + break; + + default: + into[0] = json[0]; + json++; + into++; + } + } + + /* and null-terminate. */ + *into = '\0'; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Invalid; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsFalse(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_False; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsTrue(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xff) == cJSON_True; +} + + +CJSON_PUBLIC(cJSON_bool) cJSON_IsBool(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & (cJSON_True | cJSON_False)) != 0; +} +CJSON_PUBLIC(cJSON_bool) cJSON_IsNull(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_NULL; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Number; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsString(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_String; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsArray(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Array; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsObject(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Object; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsRaw(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Raw; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive) +{ + if ((a == NULL) || (b == NULL) || ((a->type & 0xFF) != (b->type & 0xFF)) || cJSON_IsInvalid(a)) + { + return false; + } + + /* check if type is valid */ + switch (a->type & 0xFF) + { + case cJSON_False: + case cJSON_True: + case cJSON_NULL: + case cJSON_Number: + case cJSON_String: + case cJSON_Raw: + case cJSON_Array: + case cJSON_Object: + break; + + default: + return false; + } + + /* identical objects are equal */ + if (a == b) + { + return true; + } + + switch (a->type & 0xFF) + { + /* in these cases and equal type is enough */ + case cJSON_False: + case cJSON_True: + case cJSON_NULL: + return true; + + case cJSON_Number: + if (compare_double(a->valuedouble, b->valuedouble)) + { + return true; + } + return false; + + case cJSON_String: + case cJSON_Raw: + if ((a->valuestring == NULL) || (b->valuestring == NULL)) + { + return false; + } + if (strcmp(a->valuestring, b->valuestring) == 0) + { + return true; + } + + return false; + + case cJSON_Array: + { + cJSON *a_element = a->child; + cJSON *b_element = b->child; + + for (; (a_element != NULL) && (b_element != NULL);) + { + if (!cJSON_Compare(a_element, b_element, case_sensitive)) + { + return false; + } + + a_element = a_element->next; + b_element = b_element->next; + } + + /* one of the arrays is longer than the other */ + if (a_element != b_element) { + return false; + } + + return true; + } + + case cJSON_Object: + { + cJSON *a_element = NULL; + cJSON *b_element = NULL; + cJSON_ArrayForEach(a_element, a) + { + /* TODO This has O(n^2) runtime, which is horrible! */ + b_element = get_object_item(b, a_element->string, case_sensitive); + if (b_element == NULL) + { + return false; + } + + if (!cJSON_Compare(a_element, b_element, case_sensitive)) + { + return false; + } + } + + /* doing this twice, once on a and b to prevent true comparison if a subset of b + * TODO: Do this the proper way, this is just a fix for now */ + cJSON_ArrayForEach(b_element, b) + { + a_element = get_object_item(a, b_element->string, case_sensitive); + if (a_element == NULL) + { + return false; + } + + if (!cJSON_Compare(b_element, a_element, case_sensitive)) + { + return false; + } + } + + return true; + } + + default: + return false; + } +} + +CJSON_PUBLIC(void *) cJSON_malloc(size_t size) +{ + return global_hooks.allocate(size); +} + +CJSON_PUBLIC(void) cJSON_free(void *object) +{ + global_hooks.deallocate(object); +} diff --git a/pkgs/ffigen/third_party/cjson_library/cJSON.h b/pkgs/ffigen/third_party/cjson_library/cJSON.h new file mode 100644 index 0000000000..9d28b24499 --- /dev/null +++ b/pkgs/ffigen/third_party/cjson_library/cJSON.h @@ -0,0 +1,292 @@ +/* + Copyright (c) 2009-2017 Dave Gamble and cJSON contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ +#ifndef cJSON__h +#define cJSON__h + +#ifdef __cplusplus +extern "C" +{ +#endif + +#if !defined(__WINDOWS__) && (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32)) +#define __WINDOWS__ +#endif + +#ifdef __WINDOWS__ + +/* When compiling for windows, we specify a specific calling convention to avoid issues where we are being called from a project with a different default calling convention. For windows you have 3 define options: + +CJSON_HIDE_SYMBOLS - Define this in the case where you don't want to ever dllexport symbols +CJSON_EXPORT_SYMBOLS - Define this on library build when you want to dllexport symbols (default) +CJSON_IMPORT_SYMBOLS - Define this if you want to dllimport symbol + +For *nix builds that support visibility attribute, you can define similar behavior by + +setting default visibility to hidden by adding +-fvisibility=hidden (for gcc) +or +-xldscope=hidden (for sun cc) +to CFLAGS + +then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJSON_EXPORT_SYMBOLS does + +*/ + +#define CJSON_CDECL __cdecl +#define CJSON_STDCALL __stdcall + +/* export symbols by default, this is necessary for copy pasting the C and header file */ +#if !defined(CJSON_HIDE_SYMBOLS) && !defined(CJSON_IMPORT_SYMBOLS) && !defined(CJSON_EXPORT_SYMBOLS) +#define CJSON_EXPORT_SYMBOLS +#endif + +#if defined(CJSON_HIDE_SYMBOLS) +#define CJSON_PUBLIC(type) type CJSON_STDCALL +#elif defined(CJSON_EXPORT_SYMBOLS) +#define CJSON_PUBLIC(type) __declspec(dllexport) type CJSON_STDCALL +#elif defined(CJSON_IMPORT_SYMBOLS) +#define CJSON_PUBLIC(type) __declspec(dllimport) type CJSON_STDCALL +#endif +#else /* !__WINDOWS__ */ +#define CJSON_CDECL +#define CJSON_STDCALL + +#if (defined(__GNUC__) || defined(__SUNPRO_CC) || defined (__SUNPRO_C)) && defined(CJSON_API_VISIBILITY) +#define CJSON_PUBLIC(type) __attribute__((visibility("default"))) type +#else +#define CJSON_PUBLIC(type) type +#endif +#endif + +/* project version */ +#define CJSON_VERSION_MAJOR 1 +#define CJSON_VERSION_MINOR 7 +#define CJSON_VERSION_PATCH 12 + +#include + +/* cJSON Types: */ +#define cJSON_Invalid (0) +#define cJSON_False (1 << 0) +#define cJSON_True (1 << 1) +#define cJSON_NULL (1 << 2) +#define cJSON_Number (1 << 3) +#define cJSON_String (1 << 4) +#define cJSON_Array (1 << 5) +#define cJSON_Object (1 << 6) +#define cJSON_Raw (1 << 7) /* raw json */ + +#define cJSON_IsReference 256 +#define cJSON_StringIsConst 512 + +/* The cJSON structure: */ +typedef struct cJSON +{ + /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */ + struct cJSON *next; + struct cJSON *prev; + /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */ + struct cJSON *child; + + /* The type of the item, as above. */ + int type; + + /* The item's string, if type==cJSON_String and type == cJSON_Raw */ + char *valuestring; + /* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */ + int valueint; + /* The item's number, if type==cJSON_Number */ + double valuedouble; + + /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ + char *string; +} cJSON; + +typedef struct cJSON_Hooks +{ + /* malloc/free are CDECL on Windows regardless of the default calling convention of the compiler, so ensure the hooks allow passing those functions directly. */ + void *(CJSON_CDECL *malloc_fn)(size_t sz); + void (CJSON_CDECL *free_fn)(void *ptr); +} cJSON_Hooks; + +typedef int cJSON_bool; + +/* Limits how deeply nested arrays/objects can be before cJSON rejects to parse them. + * This is to prevent stack overflows. */ +#ifndef CJSON_NESTING_LIMIT +#define CJSON_NESTING_LIMIT 1000 +#endif + +/* Precision of double variables comparison */ +#ifndef CJSON_DOUBLE_PRECISION +#define CJSON_DOUBLE_PRECISION .0000000000000001 +#endif + +/* returns the version of cJSON as a string */ +CJSON_PUBLIC(const char*) cJSON_Version(void); + +/* Supply malloc, realloc and free functions to cJSON */ +CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks); + +/* Memory Management: the caller is always responsible to free the results from all variants of cJSON_Parse (with cJSON_Delete) and cJSON_Print (with stdlib free, cJSON_Hooks.free_fn, or cJSON_free as appropriate). The exception is cJSON_PrintPreallocated, where the caller has full responsibility of the buffer. */ +/* Supply a block of JSON, and this returns a cJSON object you can interrogate. */ +CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value); +/* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */ +/* If you supply a ptr in return_parse_end and parsing fails, then return_parse_end will contain a pointer to the error so will match cJSON_GetErrorPtr(). */ +CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated); + +/* Render a cJSON entity to text for transfer/storage. */ +CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item); +/* Render a cJSON entity to text for transfer/storage without any formatting. */ +CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item); +/* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */ +CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt); +/* Render a cJSON entity to text using a buffer already allocated in memory with given length. Returns 1 on success and 0 on failure. */ +/* NOTE: cJSON is not always 100% accurate in estimating how much memory it will use, so to be safe allocate 5 bytes more than you actually need */ +CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format); +/* Delete a cJSON entity and all subentities. */ +CJSON_PUBLIC(void) cJSON_Delete(cJSON *item); + +/* Returns the number of items in an array (or object). */ +CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array); +/* Retrieve item number "index" from array "array". Returns NULL if unsuccessful. */ +CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index); +/* Get item "string" from object. Case insensitive. */ +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string); +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string); +CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string); +/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */ +CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void); + +/* Check if the item is a string and return its valuestring */ +CJSON_PUBLIC(char *) cJSON_GetStringValue(const cJSON * const item); + +/* These functions check the type of an item */ +CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsFalse(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsTrue(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsBool(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsNull(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsString(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsArray(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsObject(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsRaw(const cJSON * const item); + +/* These calls create a cJSON item of the appropriate type. */ +CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void); +CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void); +CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void); +CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool boolean); +CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num); +CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string); +/* raw json */ +CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw); +CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void); +CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void); + +/* Create a string where valuestring references a string so + * it will not be freed by cJSON_Delete */ +CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string); +/* Create an object/array that only references it's elements so + * they will not be freed by cJSON_Delete */ +CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child); +CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child); + +/* These utilities create an Array of count items. + * The parameter count cannot be greater than the number of elements in the number array, otherwise array access will be out of bounds.*/ +CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count); +CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count); +CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count); +CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char *const *strings, int count); + +/* Append item to the specified array/object. */ +CJSON_PUBLIC(void) cJSON_AddItemToArray(cJSON *array, cJSON *item); +CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item); +/* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object. + * WARNING: When this function was used, make sure to always check that (item->type & cJSON_StringIsConst) is zero before + * writing to `item->string` */ +CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item); +/* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */ +CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item); +CJSON_PUBLIC(void) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item); + +/* Remove/Detach items from Arrays/Objects. */ +CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item); +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which); +CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which); +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string); +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string); +CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string); +CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string); + +/* Update array items. */ +CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem); /* Shifts pre-existing items to the right. */ +CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement); +CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem); +CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem); +CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object,const char *string,cJSON *newitem); + +/* Duplicate a cJSON item */ +CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse); +/* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will + * need to be released. With recurse!=0, it will duplicate any children connected to the item. + * The item->next and ->prev pointers are always zero on return from Duplicate. */ +/* Recursively compare two cJSON items for equality. If either a or b is NULL or invalid, they will be considered unequal. + * case_sensitive determines if object keys are treated case sensitive (1) or case insensitive (0) */ +CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive); + +/* Minify a strings, remove blank characters(such as ' ', '\t', '\r', '\n') from strings. + * The input pointer json cannot point to a read-only address area, such as a string constant, + * but should point to a readable and writable adress area. */ +CJSON_PUBLIC(void) cJSON_Minify(char *json); + +/* Helper functions for creating and adding items to an object at the same time. + * They return the added item or NULL on failure. */ +CJSON_PUBLIC(cJSON*) cJSON_AddNullToObject(cJSON * const object, const char * const name); +CJSON_PUBLIC(cJSON*) cJSON_AddTrueToObject(cJSON * const object, const char * const name); +CJSON_PUBLIC(cJSON*) cJSON_AddFalseToObject(cJSON * const object, const char * const name); +CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const cJSON_bool boolean); +CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number); +CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string); +CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw); +CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name); +CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name); + +/* When assigning an integer value, it needs to be propagated to valuedouble too. */ +#define cJSON_SetIntValue(object, number) ((object) ? (object)->valueint = (object)->valuedouble = (number) : (number)) +/* helper for the cJSON_SetNumberValue macro */ +CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number); +#define cJSON_SetNumberValue(object, number) ((object != NULL) ? cJSON_SetNumberHelper(object, (double)number) : (number)) + +/* Macro for iterating over an array or object */ +#define cJSON_ArrayForEach(element, array) for(element = (array != NULL) ? (array)->child : NULL; element != NULL; element = element->next) + +/* malloc/free objects using the malloc/free functions that have been set with cJSON_InitHooks */ +CJSON_PUBLIC(void *) cJSON_malloc(size_t size); +CJSON_PUBLIC(void) cJSON_free(void *object); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml new file mode 100644 index 0000000000..575a4400af --- /dev/null +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -0,0 +1,76 @@ +# Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +# Config file for generating the libclang bindings used by this package. + +# ===================== GENERATING BINDINGS ===================== +# cd to `tool`, and run - +# dart ../bin/generate.dart --config libclang_config.yaml +# =============================================================== + +output: '../lib/src/header_parser/clang_bindings/clang_bindings.dart' +libclang-dylib-folder: 'wrapped_libclang' +sort: true +compiler-opts: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/' +headers: + - 'wrapped_libclang/wrapper.c' +header-filter: + include: + - wrapper.c + - Index.h + - CXString.h + +enums: + include: + names: + - CXChildVisitResult + - CXCursorKind + - CXTypeKind + - CXDiagnosticDisplayOptions + - CXTranslationUnit_Flags + +structs: + include: + names: + - CXCursor + - CXType + +functions: + include: + names: + - clang_createIndex + - clang_disposeIndex + - clang_getNumDiagnostics + - clang_getDiagnostic + - clang_disposeDiagnostic + - clang_parseTranslationUnit + - clang_disposeTranslationUnit + - clang_getCString_wrap + - clang_disposeString_wrap + - clang_getCursorKind_wrap + - clang_getCursorKindSpelling_wrap + - clang_getCursorType_wrap + - clang_getTypeSpelling_wrap + - clang_getTypeKindSpelling_wrap + - clang_getResultType_wrap + - clang_getPointeeType_wrap + - clang_getCanonicalType_wrap + - clang_Type_getNamedType_wrap + - clang_getTypeDeclaration_wrap + - clang_getTypedefDeclUnderlyingType_wrap + - clang_getCursorSpelling_wrap + - clang_getTranslationUnitCursor_wrap + - clang_formatDiagnostic_wrap + - clang_visitChildren_wrap + - clang_Cursor_getNumArguments_wrap + - clang_Cursor_getArgument_wrap + - clang_getNumArgTypes_wrap + - clang_getArgType_wrap + - clang_getEnumConstantDeclValue_wrap + - clang_Cursor_getBriefCommentText_wrap + - clang_getCursorLocation_wrap + - clang_getFileLocation_wrap + - clang_getFileName_wrap + - clang_getNumElements_wrap + - clang_getArrayElementType_wrap diff --git a/pkgs/ffigen/tool/wrapped_libclang/.gitignore b/pkgs/ffigen/tool/wrapped_libclang/.gitignore new file mode 100644 index 0000000000..2b64ac7f5f --- /dev/null +++ b/pkgs/ffigen/tool/wrapped_libclang/.gitignore @@ -0,0 +1,12 @@ +# general gitignore for CMake. +CMakeLists.txt.user +CMakeCache.txt +CMakeFiles +CMakeScripts +Testing +Makefile +cmake_install.cmake +install_manifest.txt +compile_commands.json +CTestTestfile.cmake +_deps diff --git a/pkgs/ffigen/tool/wrapped_libclang/build.dart b/pkgs/ffigen/tool/wrapped_libclang/build.dart new file mode 100644 index 0000000000..20971b1dad --- /dev/null +++ b/pkgs/ffigen/tool/wrapped_libclang/build.dart @@ -0,0 +1,216 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// ======================================================================= +/// =============== Build script to generate dyamic library =============== +/// ======================================================================= +/// This Script effectively calls the following (but user can provide +/// command line args which will replace the defaults shown below)- +/// +/// Linux: +/// ``` +/// clang -I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -lclang -shared -fpic wrapper.c -o libwrapped_clang.so +/// ``` +/// MacOS: +/// ``` +/// clang -I/usr/local/opt/llvm/include/ -L/usr/local/opt/llvm/lib/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -v -lclang -shared -fpic wrapper.c -o libwrapped_clang.dylib +/// ``` +/// Windows: +/// ``` +/// clang -IC:\Progra~1\LLVM\include -LC:\Progra~1\LLVM\lib -llibclang -shared wrapper.c -o wrapped_clang.dll -Wl,/DEF:wrapper.def +/// del wrapped_clang.exp +/// del wrapped_clang.lib +/// ``` +/// ======================================================================= +/// ======================================================================= +/// ======================================================================= + +import 'dart:io'; +import 'package:args/args.dart'; +import 'package:meta/meta.dart'; + +const MACOS = 'macos'; +const WINDOWS = 'windows'; +const LINUX = 'linux'; + +/// Default platform options. +Map platformOptions = { + LINUX: Options( + outputfilename: 'libwrapped_clang.so', + sharedFlag: '-shared', + inputHeader: 'wrapper.c', + fPIC: '-fpic', + ldLibFlag: '-lclang', + headerIncludes: [ + '-I/usr/lib/llvm-9/include/', + '-I/usr/lib/llvm-10/include/', + ], + ), + WINDOWS: Options( + outputfilename: 'wrapped_clang.dll', + sharedFlag: '-shared', + inputHeader: 'wrapper.c', + moduleDefPath: '-Wl,/DEF:wrapper.def', + ldLibFlag: '-llibclang', + headerIncludes: [ + r'-IC:\Progra~1\LLVM\include', + ], + libIncludes: [ + r'-LC:\Progra~1\LLVM\lib', + ], + ), + MACOS: Options( + outputfilename: 'libwrapped_clang.dylib', + sharedFlag: '-shared', + inputHeader: 'wrapper.c', + fPIC: '-fpic', + ldLibFlag: '-lclang', + headerIncludes: [ + '-I/usr/local/opt/llvm/include/', + '-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/', + ], + libIncludes: [ + '-L/usr/local/opt/llvm/lib/', + ], + ), +}; + +void main(List arguments) { + print('Building Dynamic Library for libclang wrapper... '); + final options = getPlatformOptions(); + + // Updates header/lib includes in platform options. + changeIncludesUsingCmdArgs(arguments, options); + + // Run clang compiler to generate the dynamic library. + final ProcessResult result = runClangProcess(options); + printSuccess(result, options); +} + +/// Calls the clang compiler. +ProcessResult runClangProcess(Options options) { + final result = Process.runSync( + 'clang', + [ + ...options.headerIncludes, + ...options.libIncludes, + options.ldLibFlag, + options.sharedFlag, + options.fPIC, + options.inputHeader, + '-o', + options.outputfilename, + options.moduleDefPath, + ], + ); + return result; +} + +/// Prints success message (or process error if any). +void printSuccess(ProcessResult result, Options options) { + print(result.stdout); + if ((result.stderr as String).isEmpty) { + print('Generated file: ${options.outputfilename}'); + } else { + print(result.stderr); + } +} + +ArgResults getArgResults(List args) { + final parser = ArgParser(allowTrailingOptions: true); + parser.addSeparator( + 'Build Script to generate dynamic library used by this package:'); + parser.addMultiOption('include-header', + abbr: 'I', help: 'Path to header include directories'); + parser.addMultiOption('include-lib', + abbr: 'L', help: 'Path to library include directories'); + parser.addFlag( + 'help', + abbr: 'h', + help: 'prints this usage', + negatable: false, + ); + + ArgResults results; + try { + results = parser.parse(args); + + if (results.wasParsed('help')) { + print(parser.usage); + exit(0); + } + } catch (e) { + print(e); + print(parser.usage); + exit(1); + } + + return results; +} + +/// Use cmd args(if any) to change header/lib include paths. +void changeIncludesUsingCmdArgs(List arguments, Options options) { + final argResult = getArgResults(arguments); + if (argResult.wasParsed('include-header')) { + options.headerIncludes = (argResult['include-header'] as List) + .map((header) => '-I$header') + .toList(); + } + if (argResult.wasParsed('include-lib')) { + options.libIncludes = (argResult['include-lib'] as List) + .map((lib) => '-L$lib') + .toList(); + } +} + +/// Get options based on current platform. +Options getPlatformOptions() { + if (Platform.isMacOS) { + return platformOptions[MACOS]; + } else if (Platform.isWindows) { + return platformOptions[WINDOWS]; + } else if (Platform.isLinux) { + return platformOptions[LINUX]; + } else { + throw Exception('Unknown Platform.'); + } +} + +/// Hold options which would be passed to clang. +class Options { + /// Name of dynamic library to generate. + final String outputfilename; + + /// Tells compiler to generate a shared library. + final String sharedFlag; + + /// Flag for generating Position Independant Code (Not used on windows). + final String fPIC; + + /// Input file. + final String inputHeader; + + /// Path to `.def` file containing symbols to export, windows use only. + final String moduleDefPath; + + /// Path to header files. + List headerIncludes; + + /// Path to dynamic/static libraries + List libIncludes; + + /// Linker flag for linking to libclang. + final String ldLibFlag; + + Options({ + @required this.outputfilename, + @required this.sharedFlag, + @required this.inputHeader, + @required this.ldLibFlag, + this.headerIncludes = const [], + this.libIncludes = const [], + this.fPIC = '', + this.moduleDefPath = '', + }); +} diff --git a/pkgs/ffigen/tool/wrapped_libclang/wrapper.c b/pkgs/ffigen/tool/wrapped_libclang/wrapper.c new file mode 100644 index 0000000000..2e0e375cf2 --- /dev/null +++ b/pkgs/ffigen/tool/wrapped_libclang/wrapper.c @@ -0,0 +1,274 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#include +#include +#include + +// utility. +#define aloc(T) ((T *)malloc(sizeof(T))) +CXCursor *ptrToCXCursor(CXCursor t) +{ + CXCursor *c = aloc(CXCursor); + *c = t; + return c; +} +CXString *ptrToCXString(CXString t) +{ + CXString *c = aloc(CXString); + *c = t; + return c; +} +CXType *ptrToCXType(CXType t) +{ + CXType *c = aloc(CXType); + *c = t; + return c; +} +CXSourceLocation *ptrToCXSourceLocation(CXSourceLocation t) +{ + CXSourceLocation *c = aloc(CXSourceLocation); + *c = t; + return c; +} +// START ===== Functions for testing libclang behavior in C. +enum CXChildVisitResult visitor_for_test_in_c(CXCursor cursor, CXCursor parent, CXClientData clientData) +{ + printf("Cursor- kind: %s, name: %s\n", clang_getCString(clang_getCursorKindSpelling(clang_getCursorKind(cursor))), clang_getCString(clang_getCursorSpelling(cursor))); + return CXChildVisit_Continue; +} +int test_in_c() +{ + printf("==========================run==========================\n"); + CXIndex Index = clang_createIndex(0, 0); + CXTranslationUnit TU = clang_parseTranslationUnit(Index, + "./test.h", 0, 0, NULL, 0, CXTranslationUnit_None); + + if (TU == NULL) + { + printf("Error creating TU\n"); + return 0; + } + + CXCursor root = clang_getTranslationUnitCursor(TU); + + unsigned a = clang_visitChildren(root, visitor_for_test_in_c, NULL); + + clang_disposeTranslationUnit(TU); + clang_disposeIndex(Index); + printf("\n==========================end==========================\n"); + return 0; +} +// END ===== Functions for testing libclang behavior in C ============================ + +// START ===== WRAPPER FUNCTIONS ===================== + +const char *clang_getCString_wrap(CXString *string) +{ + const char *a = clang_getCString(*string); + + return a; +} + +void clang_disposeString_wrap(CXString *string) +{ + clang_disposeString(*string); + free(string); + return; +} + +enum CXCursorKind clang_getCursorKind_wrap(CXCursor *cursor) +{ + return clang_getCursorKind(*cursor); +} + +CXString *clang_getCursorKindSpelling_wrap(enum CXCursorKind kind) +{ + return ptrToCXString(clang_getCursorKindSpelling(kind)); +} + +CXType *clang_getCursorType_wrap(CXCursor *cursor) +{ + return ptrToCXType(clang_getCursorType(*cursor)); +} + +CXString *clang_getTypeSpelling_wrap(CXType *type) +{ + return ptrToCXString(clang_getTypeSpelling(*type)); +} + +CXString *clang_getTypeKindSpelling_wrap(enum CXTypeKind typeKind) +{ + return ptrToCXString(clang_getTypeKindSpelling(typeKind)); +} + +CXType *clang_getResultType_wrap(CXType *functionType) +{ + return ptrToCXType(clang_getResultType(*functionType)); +} + +CXType *clang_getPointeeType_wrap(CXType *pointerType) +{ + return ptrToCXType(clang_getPointeeType(*pointerType)); +} + +CXType *clang_getCanonicalType_wrap(CXType *typerefType) +{ + return ptrToCXType(clang_getCanonicalType(*typerefType)); +} + +CXType *clang_Type_getNamedType_wrap(CXType *elaboratedType) +{ + return ptrToCXType(clang_Type_getNamedType(*elaboratedType)); +} + +CXCursor *clang_getTypeDeclaration_wrap(CXType *cxtype) +{ + return ptrToCXCursor(clang_getTypeDeclaration(*cxtype)); +} + +CXType *clang_getTypedefDeclUnderlyingType_wrap(CXCursor *cxcursor) +{ + return ptrToCXType(clang_getTypedefDeclUnderlyingType(*cxcursor)); +} + +/** The name of parameter, struct, typedef. */ +CXString *clang_getCursorSpelling_wrap(CXCursor *cursor) +{ + return ptrToCXString(clang_getCursorSpelling(*cursor)); +} + +CXCursor *clang_getTranslationUnitCursor_wrap(CXTranslationUnit tu) +{ + return ptrToCXCursor(clang_getTranslationUnitCursor(tu)); +} + +CXString *clang_formatDiagnostic_wrap(CXDiagnostic diag, int opts) +{ + return ptrToCXString(clang_formatDiagnostic(diag, opts)); +} + +// alternative typedef for [CXCursorVisitor] using pointer for passing cursor and parent +// instead of passing by value +typedef enum CXChildVisitResult (*ModifiedCXCursorVisitor)(CXCursor *cursor, + CXCursor *parent, + CXClientData client_data); + +// holds Pointers to Dart function received from [clang_visitChildren_wrap] +// called in [_visitorWrap] +struct _stackForVisitChildren +{ + ModifiedCXCursorVisitor modifiedVisitor; + struct _stackForVisitChildren *link; +} * _visitorTop, *_visitorTemp; +void _push(ModifiedCXCursorVisitor modifiedVisitor) +{ + if (_visitorTop == NULL) + { + _visitorTop = (struct _stackForVisitChildren *)malloc(1 * sizeof(struct _stackForVisitChildren)); + _visitorTop->link = NULL; + _visitorTop->modifiedVisitor = modifiedVisitor; + } + else + { + _visitorTemp = (struct _stackForVisitChildren *)malloc(1 * sizeof(struct _stackForVisitChildren)); + _visitorTemp->link = _visitorTop; + _visitorTemp->modifiedVisitor = modifiedVisitor; + _visitorTop = _visitorTemp; + } +} +void _pop() +{ + _visitorTemp = _visitorTop; + + if (_visitorTemp == NULL) + { + printf("\n Error, Wrapper.C : Trying to pop from empty stack"); + return; + } + else + _visitorTemp = _visitorTop->link; + free(_visitorTop); + _visitorTop = _visitorTemp; +} +ModifiedCXCursorVisitor _top() +{ + return _visitorTop->modifiedVisitor; +} +// Do not write binding for this function. +// used by [clang_visitChildren_wrap]. +enum CXChildVisitResult +_visitorwrap(CXCursor cursor, CXCursor parent, CXClientData clientData) +{ + enum CXChildVisitResult e = (_top()(ptrToCXCursor(cursor), ptrToCXCursor(parent), clientData)); + return e; +} + +/** Visitor is a function pointer with parameters having pointers to cxcursor +* instead of cxcursor by default. */ +unsigned clang_visitChildren_wrap(CXCursor *parent, ModifiedCXCursorVisitor _modifiedVisitor, CXClientData clientData) +{ + _push(_modifiedVisitor); + unsigned a = clang_visitChildren(*parent, _visitorwrap, clientData); + _pop(); + return a; +} + +int clang_Cursor_getNumArguments_wrap(CXCursor *cursor) +{ + return clang_Cursor_getNumArguments(*cursor); +} + +CXCursor *clang_Cursor_getArgument_wrap(CXCursor *cursor, unsigned i) +{ + return ptrToCXCursor(clang_Cursor_getArgument(*cursor, i)); +} + +int clang_getNumArgTypes_wrap(CXType *cxtype) +{ + return clang_getNumArgTypes(*cxtype); +} + +CXType *clang_getArgType_wrap(CXType *cxtype, unsigned i) +{ + return ptrToCXType(clang_getArgType(*cxtype, i)); +} + +long long clang_getEnumConstantDeclValue_wrap(CXCursor *cursor) +{ + return clang_getEnumConstantDeclValue(*cursor); +} + +/** Returns the first paragraph of doxygen doc comment. */ +CXString *clang_Cursor_getBriefCommentText_wrap(CXCursor *cursor) +{ + return ptrToCXString(clang_Cursor_getBriefCommentText(*cursor)); +} + +CXSourceLocation *clang_getCursorLocation_wrap(CXCursor *cursor) +{ + return ptrToCXSourceLocation(clang_getCursorLocation(*cursor)); +} + +void clang_getFileLocation_wrap(CXSourceLocation *location, CXFile *file, unsigned *line, unsigned *column, unsigned *offset) +{ + return clang_getFileLocation(*location, file, line, column, offset); +} + +CXString *clang_getFileName_wrap(CXFile SFile) +{ + return ptrToCXString(clang_getFileName(SFile)); +} + +unsigned long long clang_getNumElements_wrap(CXType *cxtype) +{ + return clang_getNumElements(*cxtype); +} + +CXType *clang_getArrayElementType_wrap(CXType *cxtype) +{ + return ptrToCXType(clang_getArrayElementType(*cxtype)); +} + +// END ===== WRAPPER FUNCTIONS ===================== diff --git a/pkgs/ffigen/tool/wrapped_libclang/wrapper.def b/pkgs/ffigen/tool/wrapped_libclang/wrapper.def new file mode 100644 index 0000000000..36902ae7ba --- /dev/null +++ b/pkgs/ffigen/tool/wrapped_libclang/wrapper.def @@ -0,0 +1,352 @@ +; Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +; for details. All rights reserved. Use of this source code is governed by a +; BSD-style license that can be found in the LICENSE file. + +EXPORTS +clang_getCString +clang_disposeString +clang_disposeStringSet +clang_createIndex +clang_disposeIndex +clang_CXIndex_setGlobalOptions +clang_CXIndex_getGlobalOptions +clang_CXIndex_setInvocationEmissionPathOption +clang_getFileName +clang_getFileTime +clang_getFileUniqueID +clang_isFileMultipleIncludeGuarded +clang_getFile +clang_getFileContents +clang_File_isEqual +clang_File_tryGetRealPathName +clang_getNullLocation +clang_equalLocations +clang_getLocation +clang_getLocationForOffset +clang_Location_isInSystemHeader +clang_Location_isFromMainFile +clang_getNullRange +clang_getRange +clang_equalRanges +clang_Range_isNull +clang_getExpansionLocation +clang_getPresumedLocation +clang_getInstantiationLocation +clang_getSpellingLocation +clang_getFileLocation +clang_getRangeStart +clang_getRangeEnd +clang_getSkippedRanges +clang_getAllSkippedRanges +clang_disposeSourceRangeList +clang_getNumDiagnosticsInSet +clang_getDiagnosticInSet +clang_loadDiagnostics +clang_disposeDiagnosticSet +clang_getChildDiagnostics +clang_getNumDiagnostics +clang_getDiagnostic +clang_getDiagnosticSetFromTU +clang_disposeDiagnostic +clang_formatDiagnostic +clang_defaultDiagnosticDisplayOptions +clang_getDiagnosticSeverity +clang_getDiagnosticLocation +clang_getDiagnosticSpelling +clang_getDiagnosticOption +clang_getDiagnosticCategory +clang_getDiagnosticCategoryName +clang_getDiagnosticCategoryText +clang_getDiagnosticNumRanges +clang_getDiagnosticRange +clang_getDiagnosticNumFixIts +clang_getDiagnosticFixIt +clang_getTranslationUnitSpelling +clang_createTranslationUnitFromSourceFile +clang_createTranslationUnit +clang_createTranslationUnit2 +clang_defaultEditingTranslationUnitOptions +clang_parseTranslationUnit +clang_parseTranslationUnit2 +clang_parseTranslationUnit2FullArgv +clang_defaultSaveOptions +clang_saveTranslationUnit +clang_suspendTranslationUnit +clang_disposeTranslationUnit +clang_defaultReparseOptions +clang_reparseTranslationUnit +clang_getTUResourceUsageName +clang_getCXTUResourceUsage +clang_disposeCXTUResourceUsage +clang_getTranslationUnitTargetInfo +clang_TargetInfo_dispose +clang_TargetInfo_getTriple +clang_TargetInfo_getPointerWidth +clang_getNullCursor +clang_getTranslationUnitCursor +clang_equalCursors +clang_Cursor_isNull +clang_hashCursor +clang_getCursorKind +clang_isDeclaration +clang_isInvalidDeclaration +clang_isReference +clang_isExpression +clang_isStatement +clang_isAttribute +clang_Cursor_hasAttrs +clang_isInvalid +clang_isTranslationUnit +clang_isPreprocessing +clang_isUnexposed +clang_getCursorLinkage +clang_getCursorVisibility +clang_getCursorAvailability +clang_getCursorPlatformAvailability +clang_disposeCXPlatformAvailability +clang_getCursorLanguage +clang_getCursorTLSKind +clang_Cursor_getTranslationUnit +clang_createCXCursorSet +clang_disposeCXCursorSet +clang_CXCursorSet_contains +clang_CXCursorSet_insert +clang_getCursorSemanticParent +clang_getCursorLexicalParent +clang_getOverriddenCursors +clang_disposeOverriddenCursors +clang_getIncludedFile +clang_getCursor +clang_getCursorLocation +clang_getCursorExtent +clang_getCursorType +clang_getTypeSpelling +clang_getTypedefDeclUnderlyingType +clang_getEnumDeclIntegerType +clang_getEnumConstantDeclValue +clang_getEnumConstantDeclUnsignedValue +clang_getFieldDeclBitWidth +clang_Cursor_getNumArguments +clang_Cursor_getArgument +clang_Cursor_getNumTemplateArguments +clang_Cursor_getTemplateArgumentKind +clang_Cursor_getTemplateArgumentType +clang_Cursor_getTemplateArgumentValue +clang_Cursor_getTemplateArgumentUnsignedValue +clang_equalTypes +clang_getCanonicalType +clang_isConstQualifiedType +clang_Cursor_isMacroFunctionLike +clang_Cursor_isMacroBuiltin +clang_Cursor_isFunctionInlined +clang_isVolatileQualifiedType +clang_isRestrictQualifiedType +clang_getAddressSpace +clang_getTypedefName +clang_getPointeeType +clang_getTypeDeclaration +clang_getDeclObjCTypeEncoding +clang_Type_getObjCEncoding +clang_getTypeKindSpelling +clang_getFunctionTypeCallingConv +clang_getResultType +clang_getExceptionSpecificationType +clang_getNumArgTypes +clang_getArgType +clang_Type_getObjCObjectBaseType +clang_Type_getNumObjCProtocolRefs +clang_Type_getObjCProtocolDecl +clang_Type_getNumObjCTypeArgs +clang_Type_getObjCTypeArg +clang_isFunctionTypeVariadic +clang_getCursorResultType +clang_getCursorExceptionSpecificationType +clang_isPODType +clang_getElementType +clang_getNumElements +clang_getArrayElementType +clang_getArraySize +clang_Type_getNamedType +clang_Type_isTransparentTagTypedef +clang_Type_getNullability +clang_Type_getAlignOf +clang_Type_getClassType +clang_Type_getSizeOf +clang_Type_getOffsetOf +clang_Type_getModifiedType +clang_Cursor_getOffsetOfField +clang_Cursor_isAnonymous +clang_Cursor_isAnonymousRecordDecl +clang_Cursor_isInlineNamespace +clang_Type_getNumTemplateArguments +clang_Type_getTemplateArgumentAsType +clang_Type_getCXXRefQualifier +clang_Cursor_isBitField +clang_isVirtualBase +clang_getCXXAccessSpecifier +clang_Cursor_getStorageClass +clang_getNumOverloadedDecls +clang_getOverloadedDecl +clang_getIBOutletCollectionType +clang_visitChildren +clang_getCursorUSR +clang_constructUSR_ObjCClass +clang_constructUSR_ObjCCategory +clang_constructUSR_ObjCProtocol +clang_constructUSR_ObjCIvar +clang_constructUSR_ObjCMethod +clang_constructUSR_ObjCProperty +clang_getCursorSpelling +clang_Cursor_getSpellingNameRange +clang_PrintingPolicy_getProperty +clang_PrintingPolicy_setProperty +clang_getCursorPrintingPolicy +clang_PrintingPolicy_dispose +clang_getCursorPrettyPrinted +clang_getCursorDisplayName +clang_getCursorReferenced +clang_getCursorDefinition +clang_isCursorDefinition +clang_getCanonicalCursor +clang_Cursor_getObjCSelectorIndex +clang_Cursor_isDynamicCall +clang_Cursor_getReceiverType +clang_Cursor_getObjCPropertyAttributes +clang_Cursor_getObjCPropertyGetterName +clang_Cursor_getObjCPropertySetterName +clang_Cursor_getObjCDeclQualifiers +clang_Cursor_isObjCOptional +clang_Cursor_isVariadic +clang_Cursor_isExternalSymbol +clang_Cursor_getCommentRange +clang_Cursor_getRawCommentText +clang_Cursor_getBriefCommentText +clang_Cursor_getMangling +clang_Cursor_getCXXManglings +clang_Cursor_getObjCManglings +clang_Cursor_getModule +clang_getModuleForFile +clang_Module_getASTFile +clang_Module_getParent +clang_Module_getName +clang_Module_getFullName +clang_Module_isSystem +clang_Module_getNumTopLevelHeaders +clang_Module_getTopLevelHeader +clang_CXXConstructor_isConvertingConstructor +clang_CXXConstructor_isCopyConstructor +clang_CXXConstructor_isDefaultConstructor +clang_CXXConstructor_isMoveConstructor +clang_CXXField_isMutable +clang_CXXMethod_isDefaulted +clang_CXXMethod_isPureVirtual +clang_CXXMethod_isStatic +clang_CXXMethod_isVirtual +clang_CXXRecord_isAbstract +clang_EnumDecl_isScoped +clang_CXXMethod_isConst +clang_getTemplateCursorKind +clang_getSpecializedCursorTemplate +clang_getCursorReferenceNameRange +clang_getToken +clang_getTokenKind +clang_getTokenSpelling +clang_getTokenLocation +clang_getTokenExtent +clang_tokenize +clang_annotateTokens +clang_disposeTokens +clang_getCursorKindSpelling +clang_getDefinitionSpellingAndExtent +clang_enableStackTraces +clang_executeOnThread +clang_getCompletionChunkKind +clang_getCompletionChunkText +clang_getCompletionChunkCompletionString +clang_getNumCompletionChunks +clang_getCompletionPriority +clang_getCompletionAvailability +clang_getCompletionNumAnnotations +clang_getCompletionAnnotation +clang_getCompletionParent +clang_getCompletionBriefComment +clang_getCursorCompletionString +clang_getCompletionNumFixIts +clang_getCompletionFixIt +clang_defaultCodeCompleteOptions +clang_codeCompleteAt +clang_sortCodeCompletionResults +clang_disposeCodeCompleteResults +clang_codeCompleteGetNumDiagnostics +clang_codeCompleteGetDiagnostic +clang_codeCompleteGetContexts +clang_codeCompleteGetContainerKind +clang_codeCompleteGetContainerUSR +clang_codeCompleteGetObjCSelector +clang_getClangVersion +clang_toggleCrashRecovery +clang_getInclusions +clang_Cursor_Evaluate +clang_EvalResult_getKind +clang_EvalResult_getAsInt +clang_EvalResult_getAsLongLong +clang_EvalResult_isUnsignedInt +clang_EvalResult_getAsUnsigned +clang_EvalResult_getAsDouble +clang_EvalResult_getAsStr +clang_EvalResult_dispose +clang_getRemappings +clang_getRemappingsFromFileList +clang_remap_getNumFiles +clang_remap_getFilenames +clang_remap_dispose +clang_findReferencesInFile +clang_findIncludesInFile +clang_index_isEntityObjCContainerKind +clang_index_getObjCContainerDeclInfo +clang_index_getObjCInterfaceDeclInfo +clang_index_getObjCCategoryDeclInfo +clang_index_getObjCProtocolRefListInfo +clang_index_getObjCPropertyDeclInfo +clang_index_getIBOutletCollectionAttrInfo +clang_index_getCXXClassDeclInfo +clang_index_getClientContainer +clang_index_setClientContainer +clang_index_getClientEntity +clang_index_setClientEntity +clang_IndexAction_create +clang_IndexAction_dispose +clang_indexSourceFile +clang_indexSourceFileFullArgv +clang_indexTranslationUnit +clang_indexLoc_getFileLocation +clang_indexLoc_getCXSourceLocation +clang_Type_visitFields +clang_getCString_wrap +clang_disposeString_wrap +clang_getCursorKind_wrap +clang_getCursorKindSpelling_wrap +clang_getCursorType_wrap +clang_getTypeSpelling_wrap +clang_getTypeKindSpelling_wrap +clang_getResultType_wrap +clang_getPointeeType_wrap +clang_getCanonicalType_wrap +clang_Type_getNamedType_wrap +clang_getTypeDeclaration_wrap +clang_getTypedefDeclUnderlyingType_wrap +clang_getCursorSpelling_wrap +clang_getTranslationUnitCursor_wrap +clang_formatDiagnostic_wrap +clang_visitChildren_wrap +clang_Cursor_getNumArguments_wrap +clang_Cursor_getArgument_wrap +clang_getNumArgTypes_wrap +clang_getArgType_wrap +clang_getEnumConstantDeclValue_wrap +clang_Cursor_getBriefCommentText_wrap +clang_getCursorLocation_wrap +clang_getFileLocation_wrap +clang_getFileName_wrap +clang_getNumElements_wrap +clang_getArrayElementType_wrap From ee580636e293eddfd1cd5411d6fbafb0cc7539f6 Mon Sep 17 00:00:00 2001 From: Prerak Mann <31154435+mannprerak2@users.noreply.github.com> Date: Fri, 26 Jun 2020 15:48:24 +0530 Subject: [PATCH 006/276] [ffigen] Simplified run command (#15) `pub run ffigen:generate` is now replaced by `pub run ffigen` --- pkgs/ffigen/README.md | 4 ++-- pkgs/ffigen/bin/{generate.dart => ffigen.dart} | 2 +- pkgs/ffigen/example/c_json/README.md | 2 +- pkgs/ffigen/example/libclang-example/readme.md | 2 +- pkgs/ffigen/example/simple/README.md | 2 +- pkgs/ffigen/lib/src/README.md | 4 ++-- pkgs/ffigen/test/native_functions_test/config.yaml | 2 +- pkgs/ffigen/tool/libclang_config.yaml | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) rename pkgs/ffigen/bin/{generate.dart => ffigen.dart} (99%) diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index d85769b6b7..5ac1763d73 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -40,7 +40,7 @@ typedef _dart_sum = int Function(int a,int b); - Build it (see [building](#building)). - Add this package as dev_dependency in your `pubspec.yaml`. - Configurations must be provided in the pubspec.yaml file under the key `ffigen` (or directly under a seperate yaml file which when u specify it passing `--config filename` when running the tool) -- Run the tool- `pub run ffigen:generate`. +- Run the tool- `pub run ffigen`. ## Building A dynamic library for a wrapper to libclang needs to be generated as it is used by the parser submodule. @@ -60,7 +60,7 @@ A dynamic library for a wrapper to libclang needs to be generated as it is used ## Trying out examples 1. `cd examples/`, Run `pub get`. -2. Run `pub run ffigen:generate`. +2. Run `pub run ffigen`. ## Running Tests Dynamic library for some tests need to be built before running the examples. diff --git a/pkgs/ffigen/bin/generate.dart b/pkgs/ffigen/bin/ffigen.dart similarity index 99% rename from pkgs/ffigen/bin/generate.dart rename to pkgs/ffigen/bin/ffigen.dart index 7f29f2a736..26f260572c 100644 --- a/pkgs/ffigen/bin/generate.dart +++ b/pkgs/ffigen/bin/ffigen.dart @@ -11,7 +11,7 @@ import 'package:ffigen/src/header_parser.dart' as parser; import 'package:logging/logging.dart'; import 'package:yaml/yaml.dart' as yaml; -var _logger = Logger('generate.dart'); +var _logger = Logger('ffigen.dart'); void main(List args) { // Parses the cmd args. diff --git a/pkgs/ffigen/example/c_json/README.md b/pkgs/ffigen/example/c_json/README.md index 9ba9d43625..d689ce5ace 100644 --- a/pkgs/ffigen/example/c_json/README.md +++ b/pkgs/ffigen/example/c_json/README.md @@ -15,7 +15,7 @@ make ## Generating bindings At the root of this example (`example/c_json`), run - ``` -pub run ffigen:generate +pub run ffigen ``` This will generate bindings in a file: [cjson_generated_bindings.dart](./cjson_generated_bindings.dart) diff --git a/pkgs/ffigen/example/libclang-example/readme.md b/pkgs/ffigen/example/libclang-example/readme.md index 4918a378bd..33a01efc03 100644 --- a/pkgs/ffigen/example/libclang-example/readme.md +++ b/pkgs/ffigen/example/libclang-example/readme.md @@ -6,6 +6,6 @@ This example actually uses a C file used in this package itself, ([wrapper.c](.. ## Generating bindings At the root of this example (`example/libclang-example`), run - ``` -pub run ffigen:generate +pub run ffigen ``` This will generate bindings in a file: [generated_bindings.dart](./generated_bindings.dart). diff --git a/pkgs/ffigen/example/simple/README.md b/pkgs/ffigen/example/simple/README.md index 6fc5243e16..d286dab2b1 100644 --- a/pkgs/ffigen/example/simple/README.md +++ b/pkgs/ffigen/example/simple/README.md @@ -5,6 +5,6 @@ A very simple example, generates bindings for a very small header file (`headers ## Generating bindings At the root of this example (`example/simple`), run - ``` -pub run ffigen:generate +pub run ffigen ``` This will generate bindings in a file: [generated_bindings.dart](./generated_bindings.dart). diff --git a/pkgs/ffigen/lib/src/README.md b/pkgs/ffigen/lib/src/README.md index 2832400eb5..d999223924 100644 --- a/pkgs/ffigen/lib/src/README.md +++ b/pkgs/ffigen/lib/src/README.md @@ -1,6 +1,6 @@ ## Project Structure -- `bin` - Contains generate.dart script which end user will execute. +- `bin` - Contains ffigen.dart script which end user will execute. - `tool` - Contains script to generate LibClang bindings using Code_Generator submodule (dev use only). - `example` - Example projects which demonstrate generation of bindings for given C header files. - `lib/src/code_generator` - Generates binding files. @@ -38,4 +38,4 @@ Uses libclang to convert the header to a Library which is then used by code_gene - type_extractor (extracts types from variables, function parameters, return types). - includer (tells what should/shouldn't be included depending of config). - parser (Main Entrypoint) (creates translation units for all header files, and sets up parsing them). -- translation_unit_parser (parses header files, splits declarations and feeds them to their respective sub_parsers). \ No newline at end of file +- translation_unit_parser (parses header files, splits declarations and feeds them to their respective sub_parsers). diff --git a/pkgs/ffigen/test/native_functions_test/config.yaml b/pkgs/ffigen/test/native_functions_test/config.yaml index 4af2defbf1..3635c709a6 100644 --- a/pkgs/ffigen/test/native_functions_test/config.yaml +++ b/pkgs/ffigen/test/native_functions_test/config.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. # =================== GENERATING TEST BINDINGS ================== -# dart ../../bin/generate.dart --config config.yaml +# dart ../../bin/ffigen.dart --config config.yaml # =============================================================== output: 'native_functions_bindings.dart' diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index 575a4400af..0e612561d7 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -6,7 +6,7 @@ # ===================== GENERATING BINDINGS ===================== # cd to `tool`, and run - -# dart ../bin/generate.dart --config libclang_config.yaml +# dart ../bin/ffigen.dart --config libclang_config.yaml # =============================================================== output: '../lib/src/header_parser/clang_bindings/clang_bindings.dart' From 01378b8d69ecdf9a4ec2ae2bd32c52fc15f57a3d Mon Sep 17 00:00:00 2001 From: Prerak Mann <31154435+mannprerak2@users.noreply.github.com> Date: Tue, 30 Jun 2020 14:26:51 +0530 Subject: [PATCH 007/276] [ffigen] Improved generated comments (#16) closes #16 - Added comments option to config, Possible options are - {full, brief, none} - Extracting comments for enum values, struct members - Wrap brief comments (see `clang_bindings.dart`) - Removed comment markups from full comments (see `libclang-example/generated_bindings.dart`) --- .../libclang-example/generated_bindings.dart | 878 ++++++++++++++++-- .../example/libclang-example/pubspec.yaml | 4 +- pkgs/ffigen/lib/src/code_generator/struc.dart | 13 +- .../lib/src/config_provider/config.dart | 18 +- .../lib/src/config_provider/spec_utils.dart | 20 +- .../clang_bindings/clang_bindings.dart | 609 +++++++++++- .../sub_parsers/enumdecl_parser.dart | 6 +- .../sub_parsers/structdecl_parser.dart | 4 + pkgs/ffigen/lib/src/header_parser/utils.dart | 104 ++- pkgs/ffigen/lib/src/strings.dart | 9 +- pkgs/ffigen/tool/libclang_config.yaml | 8 + pkgs/ffigen/tool/wrapped_libclang/wrapper.c | 24 + pkgs/ffigen/tool/wrapped_libclang/wrapper.def | 3 + 13 files changed, 1610 insertions(+), 90 deletions(-) diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index f68f632335..8f19852d2f 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -12,22 +12,54 @@ void init(ffi.DynamicLibrary dylib) { } /// 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. ffi.Pointer Results; + /// The number of code-completion results stored in the + /// \c Results array. @ffi.Uint32() int NumResults; } /// 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() int CursorKind; + /// The code-completion string that describes how to insert this + /// code-completion result into the editing buffer. ffi.Pointer CompletionString; } -/// A cursor representing some element in the abstract syntax tree for a translation unit. +/// 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() int kind; @@ -110,7 +142,8 @@ typedef CXFieldVisitor = ffi.Int32 Function( ffi.Pointer, ); -/// Uniquely identifies a CXFile, that refers to the same underlying file, across an indexing session. +/// Uniquely identifies a CXFile, that refers to the same underlying file, +/// across an indexing session. class CXFileUniqueID extends ffi.Struct { @ffi.Uint64() int _data_item_0; @@ -173,9 +206,25 @@ class _ArrayHelper_CXFileUniqueID_data { } 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; } @@ -311,10 +360,15 @@ typedef CXInclusionVisitor = ffi.Void Function( ffi.Pointer, ); -/// 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. +/// 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 {} -/// Identifies a specific source location within a translation unit. +/// 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 { ffi.Pointer _ptr_data_item_0; ffi.Pointer _ptr_data_item_1; @@ -376,6 +430,9 @@ class _ArrayHelper_CXSourceLocation_ptr_data { } /// 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 { ffi.Pointer _ptr_data_item_0; ffi.Pointer _ptr_data_item_1; @@ -441,13 +498,20 @@ class _ArrayHelper_CXSourceRange_ptr_data { /// Identifies an array of ranges. class CXSourceRangeList extends ffi.Struct { + /// The number of ranges in the \c ranges array. @ffi.Uint32() int count; + /// An array of \c CXSourceRanges. ffi.Pointer ranges; } /// 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 { ffi.Pointer data; @@ -610,7 +674,11 @@ class _ArrayHelper_CXType_data { /// Describes the kind of type 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; @@ -670,6 +738,10 @@ class CXTypeKind { 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; @@ -731,43 +803,73 @@ class CXTypeKind { } /// 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. ffi.Pointer Filename; + /// A buffer containing the unsaved contents of this file. ffi.Pointer Contents; + /// The length of the unsaved contents of this buffer. @ffi.Uint64() 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() 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() 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() int Subminor; } -/// A group of callbacks used by #clang_indexSourceFile and #clang_indexTranslationUnit. +/// 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. ffi.Pointer> abortQuery; + /// Called at the end of indexing; passes the complete diagnostic set. ffi.Pointer> diagnostic; ffi.Pointer> enteredMainFile; + /// Called when a file gets \#included/\#imported. 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. ffi.Pointer> importedASTFile; + /// Called at the beginning of indexing a translation unit. ffi.Pointer> startedTranslationUnit; ffi.Pointer> indexDeclaration; + /// Called to index a reference of an entity. ffi.Pointer> indexEntityReference; } @@ -830,6 +932,9 @@ typedef _typedefC_noname_9 = ffi.Void Function( ); /// Gets the general options associated with a CXIndex. +/// +/// \returns A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags that +/// are associated with the given CXIndex object. int clang_CXIndex_getGlobalOptions( ffi.Pointer arg0, ) { @@ -851,6 +956,16 @@ typedef _dart_clang_CXIndex_getGlobalOptions = int Function( ); /// Sets general options associated with a CXIndex. +/// +/// For example: +/// \code +/// CXIndex idx = ...; +/// clang_CXIndex_setGlobalOptions(idx, +/// clang_CXIndex_getGlobalOptions(idx) | +/// CXGlobalOpt_ThreadBackgroundPriorityForIndexing); +/// \endcode +/// +/// \param options A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags. void clang_CXIndex_setGlobalOptions( ffi.Pointer arg0, int options, @@ -876,6 +991,10 @@ typedef _dart_clang_CXIndex_setGlobalOptions = void Function( ); /// Sets the invocation emission path option in a CXIndex. +/// +/// The invocation emission path specifies a path which will contain log +/// files for certain libclang invocations. A null value (default) implies that +/// libclang invocations are not logged.. void clang_CXIndex_setInvocationEmissionPathOption( ffi.Pointer arg0, ffi.Pointer Path, @@ -951,6 +1070,31 @@ typedef _dart_clang_Cursor_getBriefCommentText_wrap = ffi.Pointer ffi.Pointer cursor, ); +/// Returns the comment range. +ffi.Pointer clang_Cursor_getCommentRange_wrap( + ffi.Pointer cursor, +) { + return _clang_Cursor_getCommentRange_wrap( + cursor, + ); +} + +final _dart_clang_Cursor_getCommentRange_wrap + _clang_Cursor_getCommentRange_wrap = _dylib.lookupFunction< + _c_clang_Cursor_getCommentRange_wrap, + _dart_clang_Cursor_getCommentRange_wrap>( + 'clang_Cursor_getCommentRange_wrap'); + +typedef _c_clang_Cursor_getCommentRange_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_Cursor_getCommentRange_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); + int clang_Cursor_getNumArguments_wrap( ffi.Pointer cursor, ) { @@ -973,6 +1117,30 @@ typedef _dart_clang_Cursor_getNumArguments_wrap = int Function( ffi.Pointer cursor, ); +/// Returns the raw comment. +ffi.Pointer clang_Cursor_getRawCommentText_wrap( + ffi.Pointer cursor, +) { + return _clang_Cursor_getRawCommentText_wrap( + cursor, + ); +} + +final _dart_clang_Cursor_getRawCommentText_wrap + _clang_Cursor_getRawCommentText_wrap = _dylib.lookupFunction< + _c_clang_Cursor_getRawCommentText_wrap, + _dart_clang_Cursor_getRawCommentText_wrap>( + 'clang_Cursor_getRawCommentText_wrap'); + +typedef _c_clang_Cursor_getRawCommentText_wrap = ffi.Pointer Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_Cursor_getRawCommentText_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); + /// Disposes the created Eval memory. void clang_EvalResult_dispose( ffi.Pointer E, @@ -994,7 +1162,8 @@ typedef _dart_clang_EvalResult_dispose = void Function( ffi.Pointer E, ); -/// Returns the evaluation result as double if the kind is double. +/// Returns the evaluation result as double if the +/// kind is double. double clang_EvalResult_getAsDouble( ffi.Pointer E, ) { @@ -1015,7 +1184,8 @@ typedef _dart_clang_EvalResult_getAsDouble = double Function( ffi.Pointer E, ); -/// Returns the evaluation result as integer if the kind is Int. +/// Returns the evaluation result as integer if the +/// kind is Int. int clang_EvalResult_getAsInt( ffi.Pointer E, ) { @@ -1036,7 +1206,9 @@ typedef _dart_clang_EvalResult_getAsInt = int Function( ffi.Pointer E, ); -/// 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. +/// 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, ) { @@ -1057,7 +1229,10 @@ typedef _dart_clang_EvalResult_getAsLongLong = int Function( ffi.Pointer E, ); -/// 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. +/// 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, ) { @@ -1078,7 +1253,8 @@ typedef _dart_clang_EvalResult_getAsStr = ffi.Pointer Function( ffi.Pointer E, ); -/// Returns the evaluation result as an unsigned integer if the kind is Int and clang_EvalResult_isUnsignedInt is non-zero. +/// 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, ) { @@ -1120,7 +1296,8 @@ typedef _dart_clang_EvalResult_getKind = int Function( ffi.Pointer E, ); -/// Returns a non-zero value if the kind is Int and the evaluation result resulted in an unsigned integer. +/// 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, ) { @@ -1141,7 +1318,8 @@ typedef _dart_clang_EvalResult_isUnsignedInt = int Function( ffi.Pointer E, ); -/// Returns non-zero if the file1 and file2 point to the same file, or they are both NULL. +/// Returns non-zero if the \c file1 and \c file2 point to the same file, +/// or they are both NULL. int clang_File_isEqual( ffi.Pointer file1, ffi.Pointer file2, @@ -1166,7 +1344,10 @@ typedef _dart_clang_File_isEqual = int Function( ffi.Pointer file2, ); -/// An indexing action/session, to be applied to one or multiple translation units. +/// 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, ) { @@ -1188,6 +1369,9 @@ typedef _dart_clang_IndexAction_create = ffi.Pointer Function( ); /// 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, ) { @@ -1208,7 +1392,9 @@ typedef _dart_clang_IndexAction_dispose = void Function( ffi.Pointer arg0, ); -/// Returns the module file where the provided module object came from. +/// \param Module a module object. +/// +/// \returns the module file where the provided module object came from. ffi.Pointer clang_Module_getASTFile( ffi.Pointer Module, ) { @@ -1229,7 +1415,9 @@ typedef _dart_clang_Module_getASTFile = ffi.Pointer Function( ffi.Pointer Module, ); -/// Returns the number of top level headers associated with this module. +/// \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, @@ -1256,7 +1444,10 @@ typedef _dart_clang_Module_getNumTopLevelHeaders = int Function( ffi.Pointer Module, ); -/// 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. +/// \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, ) { @@ -1277,7 +1468,11 @@ typedef _dart_clang_Module_getParent = ffi.Pointer Function( ffi.Pointer Module, ); -/// Returns the specified top level header associated with the module. +/// \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, @@ -1306,7 +1501,9 @@ typedef _dart_clang_Module_getTopLevelHeader = ffi.Pointer Function( int Index, ); -/// Returns non-zero if the module is a system one. +/// \param Module a module object. +/// +/// \returns non-zero if the module is a system one. int clang_Module_isSystem( ffi.Pointer Module, ) { @@ -1426,6 +1623,8 @@ typedef _dart_clang_TargetInfo_dispose = void Function( ); /// Get the pointer width of the target in bits. +/// +/// Returns -1 in case of error. int clang_TargetInfo_getPointerWidth( ffi.Pointer Info, ) { @@ -1467,7 +1666,34 @@ typedef _dart_clang_Type_getNamedType_wrap = ffi.Pointer Function( ffi.Pointer elaboratedType, ); -/// 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. +/// 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, @@ -1501,6 +1727,71 @@ typedef _dart_clang_annotateTokens = void Function( ); /// 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, @@ -1546,7 +1837,20 @@ typedef _dart_clang_codeCompleteAt = ffi.Pointer int options, ); -/// 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. +/// 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, @@ -1573,7 +1877,13 @@ typedef _dart_clang_codeCompleteGetContainerKind = int Function( ffi.Pointer IsIncomplete, ); -/// Determines what completions are appropriate for the context the given code completion. +/// 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, ) { @@ -1595,6 +1905,12 @@ typedef _dart_clang_codeCompleteGetContexts = int Function( ); /// 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, @@ -1620,7 +1936,8 @@ typedef _dart_clang_codeCompleteGetDiagnostic = ffi.Pointer Function( int Index, ); -/// Determine the number of diagnostics produced prior to the location where code completion was performed. +/// Determine the number of diagnostics produced prior to the +/// location where code completion was performed. int clang_codeCompleteGetNumDiagnostics( ffi.Pointer Results, ) { @@ -1657,6 +1974,43 @@ typedef _c_clang_createCXCursorSet = ffi.Pointer Function(); typedef _dart_clang_createCXCursorSet = ffi.Pointer Function(); /// Provides a shared context for creating translation units. +/// +/// It provides two options: +/// +/// - excludeDeclarationsFromPCH: When non-zero, allows enumeration of "local" +/// declarations (when loading any new translation units). A "local" declaration +/// is one that belongs in the translation unit itself and not in a precompiled +/// header that was used by the translation unit. If zero, all declarations +/// will be enumerated. +/// +/// Here is an example: +/// +/// \code +/// // excludeDeclsFromPCH = 1, displayDiagnostics=1 +/// Idx = clang_createIndex(1, 1); +/// +/// // IndexTest.pch was produced with the following command: +/// // "clang -x c IndexTest.h -emit-ast -o IndexTest.pch" +/// TU = clang_createTranslationUnit(Idx, "IndexTest.pch"); +/// +/// // This will load all the symbols from 'IndexTest.pch' +/// clang_visitChildren(clang_getTranslationUnitCursor(TU), +/// TranslationUnitVisitor, 0); +/// clang_disposeTranslationUnit(TU); +/// +/// // This will load all the symbols from 'IndexTest.c', excluding symbols +/// // from 'IndexTest.pch'. +/// char *args[] = { "-Xclang", "-include-pch=IndexTest.pch" }; +/// TU = clang_createTranslationUnitFromSourceFile(Idx, "IndexTest.c", 2, args, +/// 0, 0); +/// clang_visitChildren(clang_getTranslationUnitCursor(TU), +/// TranslationUnitVisitor, 0); +/// clang_disposeTranslationUnit(TU); +/// \endcode +/// +/// This process of creating the 'pch', loading it separately, and using it (via +/// -include-pch) allows 'excludeDeclsFromPCH' to remove redundant callbacks +/// (which gives the indexer the same performance benefit as the compiler). ffi.Pointer clang_createIndex( int excludeDeclarationsFromPCH, int displayDiagnostics, @@ -1681,7 +2035,10 @@ typedef _dart_clang_createIndex = ffi.Pointer Function( int displayDiagnostics, ); -/// Same as clang_createTranslationUnit2, but returns the CXTranslationUnit instead of an error code. In case of an error this routine returns a NULL CXTranslationUnit, without further detailed error codes. +/// Same as \c clang_createTranslationUnit2, but returns +/// the \c CXTranslationUnit instead of an error code. In case of an error this +/// routine returns a \c NULL \c CXTranslationUnit, without further detailed +/// error codes. ffi.Pointer clang_createTranslationUnit( ffi.Pointer CIdx, ffi.Pointer ast_filename, @@ -1708,7 +2065,12 @@ typedef _dart_clang_createTranslationUnit = ffi.Pointer ffi.Pointer ast_filename, ); -/// Create a translation unit from an AST file ( -emit-ast). +/// Create a translation unit from an AST file (\c -emit-ast). +/// +/// \param[out] out_TU A non-NULL pointer to store the created +/// \c CXTranslationUnit. +/// +/// \returns Zero on success, otherwise returns an error code. int clang_createTranslationUnit2( ffi.Pointer CIdx, ffi.Pointer ast_filename, @@ -1737,7 +2099,44 @@ typedef _dart_clang_createTranslationUnit2 = int Function( ffi.Pointer> out_TU, ); -/// Return the CXTranslationUnit for a given source file and the provided command line arguments one would pass to the compiler. +/// Return the CXTranslationUnit for a given source file and the provided +/// command line arguments one would pass to the compiler. +/// +/// Note: The 'source_filename' argument is optional. If the caller provides a +/// NULL pointer, the name of the source file is expected to reside in the +/// specified command line arguments. +/// +/// Note: When encountered in 'clang_command_line_args', the following options +/// are ignored: +/// +/// '-c' +/// '-emit-ast' +/// '-fsyntax-only' +/// '-o \' (both '-o' and '\' are ignored) +/// +/// \param CIdx The index object with which the translation unit will be +/// associated. +/// +/// \param source_filename The name of the source file to load, or NULL if the +/// source file is included in \p clang_command_line_args. +/// +/// \param num_clang_command_line_args The number of command-line arguments in +/// \p clang_command_line_args. +/// +/// \param clang_command_line_args The command-line arguments that would be +/// passed to the \c clang executable if it were being invoked out-of-process. +/// These command-line options will be parsed and will affect how the translation +/// unit is parsed. Note that the following options are ignored: '-c', +/// '-emit-ast', '-fsyntax-only' (which is the default), and '-o \'. +/// +/// \param num_unsaved_files the number of unsaved file entries in \p +/// unsaved_files. +/// +/// \param unsaved_files the files that have not yet been saved to disk +/// but may be required for 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. ffi.Pointer clang_createTranslationUnitFromSourceFile( ffi.Pointer CIdx, ffi.Pointer source_filename, @@ -1782,7 +2181,8 @@ typedef _dart_clang_createTranslationUnitFromSourceFile ffi.Pointer unsaved_files, ); -/// Returns a default set of code-completion options that can be passed to clang_codeCompleteAt(). +/// Returns a default set of code-completion options that can be +/// passed to\c clang_codeCompleteAt(). int clang_defaultCodeCompleteOptions() { return _clang_defaultCodeCompleteOptions(); } @@ -1796,7 +2196,11 @@ typedef _c_clang_defaultCodeCompleteOptions = ffi.Uint32 Function(); typedef _dart_clang_defaultCodeCompleteOptions = int Function(); -/// Retrieve the set of display options most similar to the default behavior of the clang compiler. +/// Retrieve the set of display options most similar to the +/// default behavior of the clang compiler. +/// +/// \returns A set of display options suitable for use with \c +/// clang_formatDiagnostic(). int clang_defaultDiagnosticDisplayOptions() { return _clang_defaultDiagnosticDisplayOptions(); } @@ -1811,7 +2215,16 @@ typedef _c_clang_defaultDiagnosticDisplayOptions = ffi.Uint32 Function(); typedef _dart_clang_defaultDiagnosticDisplayOptions = int Function(); -/// Returns the set of flags that is suitable for parsing a translation unit that is being edited. +/// Returns the set of flags that is suitable for parsing a translation +/// unit that is being edited. +/// +/// The set of flags returned provide options for \c clang_parseTranslationUnit() +/// to indicate that the translation unit is likely to be reparsed many times, +/// either explicitly (via \c clang_reparseTranslationUnit()) or implicitly +/// (e.g., by code completion (\c clang_codeCompletionAt())). The returned flag +/// set contains an unspecified set of optimizations (e.g., the precompiled +/// preamble) geared toward improving the performance of these routines. The +/// set of optimizations enabled may change from one version to the next. int clang_defaultEditingTranslationUnitOptions() { return _clang_defaultEditingTranslationUnitOptions(); } @@ -1826,7 +2239,14 @@ typedef _c_clang_defaultEditingTranslationUnitOptions = ffi.Uint32 Function(); typedef _dart_clang_defaultEditingTranslationUnitOptions = int Function(); -/// Returns the set of flags that is suitable for reparsing a translation unit. +/// Returns the set of flags that is suitable for reparsing a translation +/// unit. +/// +/// The set of flags returned provide options for +/// \c clang_reparseTranslationUnit() by default. The returned flag +/// set contains an unspecified set of optimizations geared toward common uses +/// of reparsing. The set of optimizations enabled may change from one version +/// to the next. int clang_defaultReparseOptions( ffi.Pointer TU, ) { @@ -1847,7 +2267,13 @@ typedef _dart_clang_defaultReparseOptions = int Function( ffi.Pointer TU, ); -/// Returns the set of flags that is suitable for saving a translation unit. +/// Returns the set of flags that is suitable for saving a translation +/// unit. +/// +/// The set of flags returned provide options for +/// \c clang_saveTranslationUnit() by default. The returned flag +/// set contains an unspecified set of options that save translation units with +/// the most commonly-requested data. int clang_defaultSaveOptions( ffi.Pointer TU, ) { @@ -1889,7 +2315,7 @@ typedef _dart_clang_disposeCXCursorSet = void Function( ffi.Pointer cset, ); -/// Free the memory associated with a CXPlatformAvailability structure. +/// Free the memory associated with a \c CXPlatformAvailability structure. void clang_disposeCXPlatformAvailability( ffi.Pointer availability, ) { @@ -1977,6 +2403,9 @@ typedef _dart_clang_disposeDiagnosticSet = void Function( ); /// Destroy the given index. +/// +/// The index must not be destroyed until all of the translation units created +/// within that index have been destroyed. void clang_disposeIndex( ffi.Pointer index, ) { @@ -1997,7 +2426,8 @@ typedef _dart_clang_disposeIndex = void Function( ffi.Pointer index, ); -/// Free the set of overridden cursors returned by clang_getOverriddenCursors(). +/// Free the set of overridden cursors returned by \c +/// clang_getOverriddenCursors(). void clang_disposeOverriddenCursors( ffi.Pointer overridden, ) { @@ -2018,7 +2448,7 @@ typedef _dart_clang_disposeOverriddenCursors = void Function( ffi.Pointer overridden, ); -/// Destroy the given CXSourceRangeList. +/// Destroy the given \c CXSourceRangeList. void clang_disposeSourceRangeList( ffi.Pointer ranges, ) { @@ -2142,6 +2572,30 @@ typedef _c_clang_enableStackTraces = ffi.Void Function(); typedef _dart_clang_enableStackTraces = void Function(); +int clang_equalRanges_wrap( + ffi.Pointer c1, + ffi.Pointer c2, +) { + return _clang_equalRanges_wrap( + c1, + c2, + ); +} + +final _dart_clang_equalRanges_wrap _clang_equalRanges_wrap = _dylib + .lookupFunction<_c_clang_equalRanges_wrap, _dart_clang_equalRanges_wrap>( + 'clang_equalRanges_wrap'); + +typedef _c_clang_equalRanges_wrap = ffi.Uint32 Function( + ffi.Pointer c1, + ffi.Pointer c2, +); + +typedef _dart_clang_equalRanges_wrap = int Function( + ffi.Pointer c1, + ffi.Pointer c2, +); + void clang_executeOnThread( ffi.Pointer> fn, ffi.Pointer user_data, @@ -2194,7 +2648,11 @@ typedef _dart_clang_formatDiagnostic_wrap = ffi.Pointer Function( int opts, ); -/// Retrieve all ranges from all files that were skipped by the preprocessor. +/// Retrieve all ranges from all files that were skipped by the +/// preprocessor. +/// +/// The preprocessor will skip lines when they are surrounded by an +/// if/ifdef/ifndef directive whose condition does not evaluate to true. ffi.Pointer clang_getAllSkippedRanges( ffi.Pointer tu, ) { @@ -2301,6 +2759,9 @@ typedef _dart_clang_getCanonicalType_wrap = ffi.Pointer Function( ); /// Retrieve the child diagnostics of a CXDiagnostic. +/// +/// This CXDiagnosticSet does not need to be released by +/// clang_disposeDiagnosticSet. ffi.Pointer clang_getChildDiagnostics( ffi.Pointer D, ) { @@ -2321,7 +2782,12 @@ typedef _dart_clang_getChildDiagnostics = ffi.Pointer Function( ffi.Pointer D, ); -/// Determine the availability of the entity that this code-completion string refers to. +/// 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, ) { @@ -2343,7 +2809,15 @@ typedef _dart_clang_getCompletionAvailability = int Function( ffi.Pointer completion_string, ); -/// Retrieve the completion string associated with a particular chunk within a completion string. +/// 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, @@ -2373,6 +2847,12 @@ typedef _dart_clang_getCompletionChunkCompletionString = ffi.Pointer ); /// 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, @@ -2397,7 +2877,13 @@ typedef _dart_clang_getCompletionChunkKind = int Function( int chunk_number, ); -/// Retrieve the number of annotations associated with the given completion string. +/// 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, ) { @@ -2421,6 +2907,16 @@ typedef _dart_clang_getCompletionNumAnnotations = int Function( ); /// 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, @@ -2446,6 +2942,15 @@ typedef _dart_clang_getCompletionNumFixIts = int Function( ); /// 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, ) { @@ -2571,6 +3076,12 @@ typedef _dart_clang_getCursorType_wrap = ffi.Pointer Function( ); /// Retrieve a diagnostic associated with the given translation unit. +/// +/// \param Unit the translation unit 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_getDiagnostic( ffi.Pointer Unit, int Index, @@ -2596,6 +3107,13 @@ typedef _dart_clang_getDiagnostic = ffi.Pointer Function( ); /// Retrieve the category number for this diagnostic. +/// +/// Diagnostics can be categorized into groups along with other, related +/// diagnostics (e.g., diagnostics under the same warning flag). This routine +/// retrieves the category number for the given diagnostic. +/// +/// \returns The number of the category that contains this diagnostic, or zero +/// if this diagnostic is uncategorized. int clang_getDiagnosticCategory( ffi.Pointer arg0, ) { @@ -2617,6 +3135,12 @@ typedef _dart_clang_getDiagnosticCategory = int Function( ); /// Retrieve a diagnostic associated with the given CXDiagnosticSet. +/// +/// \param Diags the CXDiagnosticSet 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_getDiagnosticInSet( ffi.Pointer Diags, int Index, @@ -2641,7 +3165,8 @@ typedef _dart_clang_getDiagnosticInSet = ffi.Pointer Function( int Index, ); -/// Determine the number of fix-it hints associated with the given diagnostic. +/// Determine the number of fix-it hints associated with the +/// given diagnostic. int clang_getDiagnosticNumFixIts( ffi.Pointer Diagnostic, ) { @@ -2662,7 +3187,8 @@ typedef _dart_clang_getDiagnosticNumFixIts = int Function( ffi.Pointer Diagnostic, ); -/// Determine the number of source ranges associated with the given diagnostic. +/// Determine the number of source ranges associated with the given +/// diagnostic. int clang_getDiagnosticNumRanges( ffi.Pointer arg0, ) { @@ -2683,7 +3209,10 @@ typedef _dart_clang_getDiagnosticNumRanges = int Function( ffi.Pointer arg0, ); -/// Retrieve the complete set of diagnostics associated with a translation unit. +/// Retrieve the complete set of diagnostics associated with a +/// translation unit. +/// +/// \param Unit the translation unit to query. ffi.Pointer clang_getDiagnosticSetFromTU( ffi.Pointer Unit, ) { @@ -2748,6 +3277,13 @@ typedef _dart_clang_getEnumConstantDeclValue_wrap = int Function( ); /// Retrieve a file handle within the given translation unit. +/// +/// \param tu the translation unit +/// +/// \param file_name the name of the file. +/// +/// \returns the file handle for the named file in the translation unit \p tu, +/// or a NULL file handle if the file was not a part of this translation unit. ffi.Pointer clang_getFile( ffi.Pointer tu, ffi.Pointer file_name, @@ -2772,6 +3308,15 @@ typedef _dart_clang_getFile = ffi.Pointer Function( ); /// Retrieve the buffer associated with the given file. +/// +/// \param tu the translation unit +/// +/// \param file the file for which to retrieve the buffer. +/// +/// \param size [out] if non-NULL, will be set to the size of the buffer. +/// +/// \returns a pointer to the buffer in memory that holds the contents of +/// \p file, or a NULL pointer when the file is not loaded. ffi.Pointer clang_getFileContents( ffi.Pointer tu, ffi.Pointer file, @@ -2877,7 +3422,12 @@ typedef _dart_clang_getFileTime = int Function( ffi.Pointer SFile, ); -/// Retrieve the unique ID for the given file. +/// Retrieve the unique ID for the given \c file. +/// +/// \param file the file to get the ID for. +/// \param outID stores the returned CXFileUniqueID. +/// \returns If there was a failure getting the unique ID, returns non-zero, +/// otherwise returns 0. int clang_getFileUniqueID( ffi.Pointer file, ffi.Pointer outID, @@ -2902,7 +3452,10 @@ typedef _dart_clang_getFileUniqueID = int Function( ffi.Pointer outID, ); -/// 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). +/// 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, @@ -2931,7 +3484,8 @@ typedef _dart_clang_getInclusions = void Function( ffi.Pointer client_data, ); -/// Given a CXFile header file, return the module that contains it, if one exists. +/// Given a CXFile header file, return the module that contains it, if one +/// exists. ffi.Pointer clang_getModuleForFile( ffi.Pointer arg0, ffi.Pointer arg1, @@ -2997,7 +3551,8 @@ typedef _dart_clang_getNumCompletionChunks = int Function( ffi.Pointer completion_string, ); -/// Determine the number of diagnostics produced for the given translation unit. +/// Determine the number of diagnostics produced for the given +/// translation unit. int clang_getNumDiagnostics( ffi.Pointer Unit, ) { @@ -3080,6 +3635,11 @@ typedef _dart_clang_getPointeeType_wrap = ffi.Pointer Function( ); /// 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, ) { @@ -3101,6 +3661,13 @@ typedef _dart_clang_getRemappings = ffi.Pointer Function( ); /// 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, @@ -3147,6 +3714,9 @@ typedef _dart_clang_getResultType_wrap = ffi.Pointer Function( ); /// Retrieve all ranges that were skipped by the preprocessor. +/// +/// The preprocessor will skip lines when they are surrounded by an +/// if/ifdef/ifndef directive whose condition does not evaluate to true. ffi.Pointer clang_getSkippedRanges( ffi.Pointer tu, ffi.Pointer file, @@ -3171,7 +3741,8 @@ typedef _dart_clang_getSkippedRanges = ffi.Pointer Function( ffi.Pointer file, ); -/// Returns the human-readable null-terminated C string that represents the name of the memory category. This string should never be freed. +/// Returns the human-readable null-terminated C string that represents +/// the name of the memory category. This string should never be freed. ffi.Pointer clang_getTUResourceUsageName( int kind, ) { @@ -3216,6 +3787,8 @@ typedef _dart_clang_getTranslationUnitCursor_wrap = ffi.Pointer ); /// Get target information for this translation unit. +/// +/// The CXTargetInfo object cannot outlive the CXTranslationUnit object. ffi.Pointer clang_getTranslationUnitTargetInfo( ffi.Pointer CTUnit, ) { @@ -3324,7 +3897,29 @@ typedef _dart_clang_getTypedefDeclUnderlyingType_wrap = ffi.Pointer ffi.Pointer cxcursor, ); -/// Index the given source file and the translation unit corresponding to that file via callbacks implemented through #IndexerCallbacks. +/// 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, @@ -3389,7 +3984,9 @@ typedef _dart_clang_indexSourceFile = int Function( int TU_options, ); -/// 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. +/// 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, @@ -3454,7 +4051,20 @@ typedef _dart_clang_indexSourceFileFullArgv = int Function( int TU_options, ); -/// Index the given translation unit via callbacks implemented through #IndexerCallbacks. +/// 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, @@ -3518,7 +4128,8 @@ typedef _dart_clang_index_getCXXClassDeclInfo ffi.Pointer arg0, ); -/// For retrieving a custom CXIdxClientContainer attached to a container. +/// For retrieving a custom CXIdxClientContainer attached to a +/// container. ffi.Pointer clang_index_getClientContainer( ffi.Pointer arg0, ) { @@ -3728,7 +4339,8 @@ typedef _dart_clang_index_isEntityObjCContainerKind = int Function( int arg0, ); -/// For setting a custom CXIdxClientContainer attached to a container. +/// For setting a custom CXIdxClientContainer attached to a +/// container. void clang_index_setClientContainer( ffi.Pointer arg0, ffi.Pointer arg1, @@ -3841,7 +4453,9 @@ typedef _dart_clang_isExpression = int Function( int arg0, ); -/// Determine whether the given header is guarded against multiple inclusions, either with the conventional #ifndef/#define/#endif macro guards or with #pragma once. +/// Determine whether the given header is guarded against +/// multiple inclusions, either with the conventional +/// \#ifndef/\#define/\#endif macro guards or with \#pragma once. int clang_isFileMultipleIncludeGuarded( ffi.Pointer tu, ffi.Pointer file, @@ -3868,7 +4482,8 @@ typedef _dart_clang_isFileMultipleIncludeGuarded = int Function( ffi.Pointer file, ); -/// Determine whether the given cursor kind represents an invalid cursor. +/// Determine whether the given cursor kind represents an invalid +/// cursor. int clang_isInvalid( int arg0, ) { @@ -3889,7 +4504,8 @@ typedef _dart_clang_isInvalid = int Function( int arg0, ); -/// * Determine whether the given cursor represents a preprocessing element, such as a preprocessor directive or macro instantiation. +/// Determine whether the given cursor represents a preprocessing +/// element, such as a preprocessor directive or macro instantiation. int clang_isPreprocessing( int arg0, ) { @@ -3910,7 +4526,12 @@ typedef _dart_clang_isPreprocessing = int Function( int arg0, ); -/// Determine whether the given cursor kind represents a simple reference. +/// Determine whether the given cursor kind represents a simple +/// reference. +/// +/// Note that other kinds of cursors (such as expressions) can also refer to +/// other cursors. Use clang_getCursorReferenced() to determine whether a +/// particular cursor refers to another entity. int clang_isReference( int arg0, ) { @@ -3952,7 +4573,8 @@ typedef _dart_clang_isStatement = int Function( int arg0, ); -/// Determine whether the given cursor kind represents a translation unit. +/// Determine whether the given cursor kind represents a translation +/// unit. int clang_isTranslationUnit( int arg0, ) { @@ -3973,7 +4595,8 @@ typedef _dart_clang_isTranslationUnit = int Function( int arg0, ); -/// * Determine whether the given cursor represents a currently unexposed piece of the AST (e.g., CXCursor_UnexposedStmt). +/// Determine whether the given cursor represents a currently +/// unexposed piece of the AST (e.g., CXCursor_UnexposedStmt). int clang_isUnexposed( int arg0, ) { @@ -3994,7 +4617,17 @@ typedef _dart_clang_isUnexposed = int Function( int arg0, ); -/// Deserialize a set of diagnostics from a Clang diagnostics bitcode file. +/// Deserialize a set of diagnostics from a Clang diagnostics bitcode +/// file. +/// +/// \param file The name of the file to deserialize. +/// \param error A pointer to a enum value recording if there was a problem +/// deserializing the diagnostics. +/// \param errorString A pointer to a CXString for recording the error string +/// if the file was not successfully loaded. +/// +/// \returns A loaded CXDiagnosticSet if successful, and NULL otherwise. These +/// diagnostics should be released using clang_disposeDiagnosticSet(). ffi.Pointer clang_loadDiagnostics( ffi.Pointer file, ffi.Pointer error, @@ -4023,7 +4656,10 @@ typedef _dart_clang_loadDiagnostics = ffi.Pointer Function( ffi.Pointer errorString, ); -/// Same as clang_parseTranslationUnit2, but returns the CXTranslationUnit instead of an error code. In case of an error this routine returns a NULL CXTranslationUnit, without further detailed error codes. +/// Same as \c clang_parseTranslationUnit2, but returns +/// the \c CXTranslationUnit instead of an error code. In case of an error this +/// routine returns a \c NULL \c CXTranslationUnit, without further detailed +/// error codes. ffi.Pointer clang_parseTranslationUnit( ffi.Pointer CIdx, ffi.Pointer source_filename, @@ -4070,7 +4706,48 @@ typedef _dart_clang_parseTranslationUnit = ffi.Pointer int options, ); -/// Parse the given source file and the translation unit corresponding to that file. +/// Parse the given source file and the translation unit corresponding +/// to that file. +/// +/// This routine is the main entry point for the Clang C API, providing the +/// ability to parse a source file into a translation unit that can then be +/// queried by other functions in the API. This routine accepts a set of +/// command-line arguments so that the compilation can be configured in the same +/// way that the compiler is configured on the command line. +/// +/// \param CIdx The index object with which the translation unit will be +/// associated. +/// +/// \param source_filename The name of the source file to load, or NULL if the +/// source file is included in \c command_line_args. +/// +/// \param command_line_args The command-line arguments that would be +/// passed to the \c clang executable if it were being invoked out-of-process. +/// These command-line options will be parsed and will affect how the translation +/// unit is parsed. Note that the following options are ignored: '-c', +/// '-emit-ast', '-fsyntax-only' (which is the default), and '-o \'. +/// +/// \param num_command_line_args The number of command-line arguments in +/// \c command_line_args. +/// +/// \param unsaved_files the files that have not yet been saved to disk +/// but may be required for parsing, 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 A bitmask of options that affects how the translation unit +/// is managed but not its compilation. This should be a bitwise OR of the +/// CXTranslationUnit_XXX flags. +/// +/// \param[out] out_TU A non-NULL pointer to store the created +/// \c CXTranslationUnit, describing the parsed code and containing any +/// diagnostics produced by the compiler. +/// +/// \returns Zero on success, otherwise returns an error code. int clang_parseTranslationUnit2( ffi.Pointer CIdx, ffi.Pointer source_filename, @@ -4119,7 +4796,9 @@ typedef _dart_clang_parseTranslationUnit2 = int Function( ffi.Pointer> out_TU, ); -/// Same as clang_parseTranslationUnit2 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. +/// Same as clang_parseTranslationUnit2 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_parseTranslationUnit2FullArgv( ffi.Pointer CIdx, ffi.Pointer source_filename, @@ -4192,6 +4871,11 @@ typedef _dart_clang_remap_dispose = void Function( ); /// 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, @@ -4246,6 +4930,42 @@ typedef _dart_clang_remap_getNumFiles = int Function( ); /// Reparse the source files that produced this translation unit. +/// +/// This routine can be used to re-parse the source files that originally +/// created the given translation unit, for example because those source files +/// have changed (either on disk or as passed via \p unsaved_files). The +/// source code will be reparsed with the same command-line options as it +/// was originally parsed. +/// +/// Reparsing a translation unit invalidates all cursors and source locations +/// that refer into that translation unit. This makes reparsing a translation +/// unit semantically equivalent to destroying the translation unit and then +/// creating a new translation unit with the same command-line arguments. +/// However, it may be more efficient to reparse a translation +/// unit using this routine. +/// +/// \param TU The translation unit whose contents will be re-parsed. The +/// translation unit must originally have been built with +/// \c clang_createTranslationUnitFromSourceFile(). +/// +/// \param num_unsaved_files The number of unsaved file entries in \p +/// unsaved_files. +/// +/// \param unsaved_files The files that have not yet been saved to disk +/// but may be required for parsing, 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 options A bitset of options composed of the flags in CXReparse_Flags. +/// The function \c clang_defaultReparseOptions() produces a default set of +/// options recommended for most uses, based on the translation unit. +/// +/// \returns 0 if the sources could be reparsed. A non-zero error code will be +/// returned if reparsing was impossible, such that the translation unit is +/// invalid. In such cases, the only valid call for \c TU is +/// \c clang_disposeTranslationUnit(TU). The error codes returned by this +/// routine are described by the \c CXErrorCode enum. int clang_reparseTranslationUnit( ffi.Pointer TU, int num_unsaved_files, @@ -4278,7 +4998,27 @@ typedef _dart_clang_reparseTranslationUnit = int Function( int options, ); -/// Saves a translation unit into a serialized representation of that translation unit on disk. +/// Saves a translation unit into a serialized representation of +/// that translation unit on disk. +/// +/// Any translation unit that was parsed without error can be saved +/// into a file. The translation unit can then be deserialized into a +/// new \c CXTranslationUnit with \c clang_createTranslationUnit() or, +/// if it is an incomplete translation unit that corresponds to a +/// header, used as a precompiled header when parsing other translation +/// units. +/// +/// \param TU The translation unit to save. +/// +/// \param FileName The file to which the translation unit will be saved. +/// +/// \param options A bitmask of options that affects how the translation unit +/// is saved. This should be a bitwise OR of the +/// CXSaveTranslationUnit_XXX flags. +/// +/// \returns A value that will match one of the enumerators of the CXSaveError +/// enumeration. Zero (CXSaveError_None) indicates that the translation unit was +/// saved successfully, while a non-zero value indicates that a problem occurred. int clang_saveTranslationUnit( ffi.Pointer TU, ffi.Pointer FileName, @@ -4307,7 +5047,11 @@ typedef _dart_clang_saveTranslationUnit = int Function( int options, ); -/// Sort the code-completion results in case-insensitive alphabetical order. +/// 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, @@ -4334,6 +5078,10 @@ typedef _dart_clang_sortCodeCompletionResults = void Function( ); /// Suspend a translation unit in order to free memory associated with it. +/// +/// A suspended translation unit uses significantly less memory but on the other +/// side does not support any other calls than \c clang_reparseTranslationUnit +/// to resume it or \c clang_disposeTranslationUnit to dispose it completely. int clang_suspendTranslationUnit( ffi.Pointer arg0, ) { @@ -4355,6 +5103,9 @@ typedef _dart_clang_suspendTranslationUnit = int Function( ); /// 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, ) { @@ -4375,7 +5126,8 @@ typedef _dart_clang_toggleCrashRecovery = void Function( int isEnabled, ); -/// Visitor is a function pointer with parameters having pointers to cxcursor instead of cxcursor by default. +/// Visitor is a function pointer with parameters having pointers to cxcursor +/// instead of cxcursor by default. int clang_visitChildren_wrap( ffi.Pointer parent, ffi.Pointer> _modifiedVisitor, diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index bd000c6934..d4dc2fd22b 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -59,5 +59,5 @@ ffigen: unsigned long long: 8 enum: 4 - # True by default - extract-comments: true + # Doc Comments for generated binings: Can be full, brief(default) or none + comments: full diff --git a/pkgs/ffigen/lib/src/code_generator/struc.dart b/pkgs/ffigen/lib/src/code_generator/struc.dart index 391dc2ed22..4cb515268c 100644 --- a/pkgs/ffigen/lib/src/code_generator/struc.dart +++ b/pkgs/ffigen/lib/src/code_generator/struc.dart @@ -71,10 +71,16 @@ class Struc extends Binding { s.write(arrayHelper.declarationString(w)); helpers.add(arrayHelper); } else { + const depth = ' '; + if (m.dartDoc != null) { + s.write(depth + '/// '); + s.writeAll(m.dartDoc.split('\n'), '\n' + depth + '/// '); + s.write('\n'); + } if (m.type.isPrimitive) { - s.write(' @${m.type.getCType(w)}()\n'); + s.write('$depth@${m.type.getCType(w)}()\n'); } - s.write(' ${m.type.getDartType(w)} ${m.name};\n\n'); + s.write('$depth${m.type.getDartType(w)} ${m.name};\n\n'); } } s.write('}\n\n'); @@ -88,10 +94,11 @@ class Struc extends Binding { } class Member { + final String dartDoc; final String name; final Type type; - const Member({this.name, this.type}); + const Member({this.name, this.type, this.dartDoc}); } // Helper bindings for struct array. diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 89f55c204a..49cda0ca05 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -59,8 +59,8 @@ class Config { /// If typedef of supported types(int8_t) should be directly used. bool useSupportedTypedefs; - /// If tool should extract doc comment from bindings. - bool extractComments; + /// Extracted Doc comment type. + String comment; /// Manually creating configurations. /// @@ -77,7 +77,7 @@ class Config { this.enumClassFilters, this.sort = false, this.useSupportedTypedefs = true, - this.extractComments = true, + this.comment, }); Config._(); @@ -243,13 +243,13 @@ class Config { extractedResult: (dynamic result) => useSupportedTypedefs = result as bool, ), - strings.extractComments: Specification( - description: 'whether or not to extract comments from bindings', + strings.comments: Specification( + description: 'Type of comment to extract', isRequired: false, - validator: booleanValidator, - extractor: booleanExtractor, - defaultValue: true, - extractedResult: (dynamic result) => extractComments = result as bool, + validator: commentValidator, + extractor: commentExtractor, + defaultValue: strings.brief, + extractedResult: (dynamic result) => comment = result as String, ), }; } diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 683d53dd6e..3544330d8e 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -205,7 +205,8 @@ bool filterValidator(String name, dynamic value) { for (final subkey in value[key].keys) { if (subkey == strings.matches || subkey == strings.names) { if (value[key][subkey] is! YamlList) { - _logger.severe("Expected '$name -> $key -> $subkey' to be a List."); + _logger + .severe("Expected '$name -> $key -> $subkey' to be a List."); _result = false; } } else { @@ -239,3 +240,20 @@ SupportedNativeType nativeSupportedType(int value, {bool signed = true}) { 'Unsupported value given to sizemap, Allowed values for sizes are: 1, 2, 4, 8'); } } + +String commentExtractor(dynamic value) => value as String; + +bool commentValidator(String name, dynamic value) { + if (value is! String) { + _logger.severe("Expected value of key '$name' to be a String."); + return false; + } else { + if (strings.commentTypeSet.contains(value as String)) { + return true; + } else { + _logger.severe( + "Value of key '$name' must be one of the following - ${strings.commentTypeSet}."); + return false; + } + } +} diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index f70197106e..1cf40a3019 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -11,14 +11,23 @@ void init(ffi.DynamicLibrary dylib) { _dylib = dylib; } -/// Describes how the traversal of the children of a particular cursor should proceed after visiting a particular child cursor. +/// Describes how the traversal of the children of a particular cursor should +/// proceed after visiting a particular child cursor. 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; } -/// A cursor representing some element in the abstract syntax tree for a translation unit. +/// A cursor representing some element in the abstract syntax tree for a +/// translation unit. class CXCursor extends ffi.Struct { @ffi.Int32() int kind; @@ -84,44 +93,122 @@ class _ArrayHelper_CXCursor_data { /// Describes the kind of entity that a cursor refers to. 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; @@ -129,13 +216,31 @@ class CXCursorKind { 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; @@ -145,149 +250,432 @@ class CXCursorKind { 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 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; @@ -338,22 +726,43 @@ class CXCursorKind { 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; } /// Options to control the display of diagnostics. 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; } @@ -418,6 +827,70 @@ class _ArrayHelper_CXSourceLocation_ptr_data { } } +/// Identifies a half-open character range in the source code. +class CXSourceRange extends ffi.Struct { + ffi.Pointer _ptr_data_item_0; + ffi.Pointer _ptr_data_item_1; + ffi.Pointer _ptr_data_item_2; + + /// helper for array, supports `[]` operator + _ArrayHelper_CXSourceRange_ptr_data get ptr_data => + _ArrayHelper_CXSourceRange_ptr_data(this, 3); + @ffi.Uint32() + int begin_int_data; + + @ffi.Uint32() + int end_int_data; +} + +/// Helper for array ptr_data in struct CXSourceRange +class _ArrayHelper_CXSourceRange_ptr_data { + final CXSourceRange _struct; + final int length; + _ArrayHelper_CXSourceRange_ptr_data(this._struct, this.length); + void operator []=(int index, ffi.Pointer value) { + switch (index) { + case 0: + _struct._ptr_data_item_0 = value; + break; + case 1: + _struct._ptr_data_item_1 = value; + break; + case 2: + _struct._ptr_data_item_2 = value; + break; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + ffi.Pointer operator [](int index) { + switch (index) { + case 0: + return _struct._ptr_data_item_0; + case 1: + return _struct._ptr_data_item_1; + case 2: + return _struct._ptr_data_item_2; + default: + throw RangeError('Index $index must be in the range [0..2].'); + } + } + + @override + String toString() { + if (length == 0) return '[]'; + final sb = StringBuffer('['); + sb.write(this[0]); + for (var i = 1; i < length; i++) { + sb.write(','); + sb.write(this[i]); + } + sb.write(']'); + return sb.toString(); + } +} + /// A character string. class CXString extends ffi.Struct { ffi.Pointer data; @@ -430,22 +903,65 @@ class CXTranslationUnitImpl extends ffi.Struct {} /// Flags that control the creation of translation units. 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; } @@ -512,7 +1028,10 @@ class _ArrayHelper_CXType_data { /// Describes the kind of type 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; @@ -572,6 +1091,8 @@ class CXTypeKind { 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; @@ -634,10 +1155,13 @@ class CXTypeKind { /// 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. ffi.Pointer Filename; + /// A buffer containing the unsaved contents of this file. ffi.Pointer Contents; + /// The length of the unsaved contents of this buffer. @ffi.Uint64() int Length; } @@ -697,6 +1221,31 @@ typedef _dart_clang_Cursor_getBriefCommentText_wrap = ffi.Pointer ffi.Pointer cursor, ); +/// Returns the comment range. +ffi.Pointer clang_Cursor_getCommentRange_wrap( + ffi.Pointer cursor, +) { + return _clang_Cursor_getCommentRange_wrap( + cursor, + ); +} + +final _dart_clang_Cursor_getCommentRange_wrap + _clang_Cursor_getCommentRange_wrap = _dylib.lookupFunction< + _c_clang_Cursor_getCommentRange_wrap, + _dart_clang_Cursor_getCommentRange_wrap>( + 'clang_Cursor_getCommentRange_wrap'); + +typedef _c_clang_Cursor_getCommentRange_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_Cursor_getCommentRange_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); + int clang_Cursor_getNumArguments_wrap( ffi.Pointer cursor, ) { @@ -719,6 +1268,30 @@ typedef _dart_clang_Cursor_getNumArguments_wrap = int Function( ffi.Pointer cursor, ); +/// Returns the raw comment. +ffi.Pointer clang_Cursor_getRawCommentText_wrap( + ffi.Pointer cursor, +) { + return _clang_Cursor_getRawCommentText_wrap( + cursor, + ); +} + +final _dart_clang_Cursor_getRawCommentText_wrap + _clang_Cursor_getRawCommentText_wrap = _dylib.lookupFunction< + _c_clang_Cursor_getRawCommentText_wrap, + _dart_clang_Cursor_getRawCommentText_wrap>( + 'clang_Cursor_getRawCommentText_wrap'); + +typedef _c_clang_Cursor_getRawCommentText_wrap = ffi.Pointer Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_Cursor_getRawCommentText_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); + ffi.Pointer clang_Type_getNamedType_wrap( ffi.Pointer elaboratedType, ) { @@ -847,6 +1420,31 @@ typedef _dart_clang_disposeTranslationUnit = void Function( ffi.Pointer arg0, ); +/// Returns non-zero if the ranges are the same, zero if they differ. +int clang_equalRanges_wrap( + ffi.Pointer c1, + ffi.Pointer c2, +) { + return _clang_equalRanges_wrap( + c1, + c2, + ); +} + +final _dart_clang_equalRanges_wrap _clang_equalRanges_wrap = _dylib + .lookupFunction<_c_clang_equalRanges_wrap, _dart_clang_equalRanges_wrap>( + 'clang_equalRanges_wrap'); + +typedef _c_clang_equalRanges_wrap = ffi.Uint32 Function( + ffi.Pointer c1, + ffi.Pointer c2, +); + +typedef _dart_clang_equalRanges_wrap = int Function( + ffi.Pointer c1, + ffi.Pointer c2, +); + ffi.Pointer clang_formatDiagnostic_wrap( ffi.Pointer diag, int opts, @@ -1370,7 +1968,9 @@ typedef _dart_clang_getTypedefDeclUnderlyingType_wrap = ffi.Pointer ffi.Pointer cxcursor, ); -/// Same as clang_parseTranslationUnit2, but returns the CXTranslationUnit instead of an error code. In case of an error this routine returns a NULL CXTranslationUnit, without further detailed error codes. +/// Same as clang_parseTranslationUnit2, but returns the CXTranslationUnit +/// instead of an error code. In case of an error this routine returns a NULL +/// CXTranslationUnit, without further detailed error codes. ffi.Pointer clang_parseTranslationUnit( ffi.Pointer CIdx, ffi.Pointer source_filename, @@ -1417,7 +2017,8 @@ typedef _dart_clang_parseTranslationUnit = ffi.Pointer int options, ); -/// Visitor is a function pointer with parameters having pointers to cxcursor instead of cxcursor by default. +/// Visitor is a function pointer with parameters having pointers to cxcursor +/// instead of cxcursor by default. int clang_visitChildren_wrap( ffi.Pointer parent, ffi.Pointer> _modifiedVisitor, diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index 19fd1cede3..c3e5a545bc 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -80,8 +80,10 @@ int _enumCursorVisitor(Pointer cursor, void _addEnumConstantToEnumClass(Pointer cursor) { _enumClass.enumConstants.add( EnumConstant( - // Extracting doc comment doesn't always give the right comment - // so we are skipping dartdoc for individual enum constants. + dartDoc: getCursorDocComment( + cursor, + nesting.length + commentPrefix.length, + ), name: cursor.spelling(), value: clang.clang_getEnumConstantDeclValue_wrap(cursor)), ); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index 27d8efddab..0c9dfa33f3 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -113,6 +113,10 @@ int _structMembersVisitor(Pointer cursor, _members.add( Member( + dartDoc: getCursorDocComment( + cursor, + nesting.length + commentPrefix.length, + ), name: cursor.spelling(), type: mt, ), diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index 254a950513..fbc4d316bb 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -8,6 +8,7 @@ import 'package:ffi/ffi.dart'; import 'package:ffigen/src/code_generator.dart'; import 'package:logging/logging.dart'; +import '../strings.dart' as strings; import 'clang_bindings/clang_bindings.dart' as clang; import 'data.dart'; import 'type_extractor/extractor.dart'; @@ -47,6 +48,12 @@ void logTuDiagnostics( } } +extension CXSourceRangeExt on Pointer { + void dispose() { + free(this); + } +} + extension CXCursorExt on Pointer { /// Returns the kind int from [clang.CXCursorKind]. int kind() { @@ -113,11 +120,98 @@ extension CXCursorExt on Pointer { } } -// TODO(13): Improve generated doc comment. -String getCursorDocComment(Pointer cursor) { - return config.extractComments - ? clang.clang_Cursor_getBriefCommentText_wrap(cursor).toStringAndDispose() - : null; +const commentPrefix = '/// '; +const nesting = ' '; + +/// Stores the [clang.CXSourceRange] of the last comment. +Pointer lastCommentRange = nullptr; + +/// Returns a cursor's associated comment. +/// +/// The given string is wrapped at line width = 80 - [indent]. The [indent] is +/// [commentPrefix.length] by default because a comment starts with +/// [commentPrefix]. +String getCursorDocComment(Pointer cursor, + [int indent = commentPrefix.length]) { + String formattedDocComment; + final currentCommentRange = clang.clang_Cursor_getCommentRange_wrap(cursor); + + // See if this comment and the last comment both point to the same source + // range. + if (lastCommentRange != nullptr && + currentCommentRange != nullptr && + clang.clang_equalRanges_wrap(lastCommentRange, currentCommentRange) != + 0) { + formattedDocComment = null; + } else { + switch (config.comment) { + case strings.full: + formattedDocComment = removeRawCommentMarkups(clang + .clang_Cursor_getRawCommentText_wrap(cursor) + .toStringAndDispose()); + break; + case strings.brief: + formattedDocComment = _wrapNoNewLineString( + clang + .clang_Cursor_getBriefCommentText_wrap(cursor) + .toStringAndDispose(), + 80 - indent); + break; + default: + formattedDocComment = null; + } + } + lastCommentRange.dispose(); + lastCommentRange = currentCommentRange; + return formattedDocComment; +} + +/// Wraps [string] according to given [lineWidth]. +/// +/// Wrapping will work properly only when String has no new lines +/// characters(\n). +String _wrapNoNewLineString(String string, int lineWidth) { + if (string == null || string.isEmpty) { + return null; + } + final sb = StringBuffer(); + + final words = string.split(' '); + + sb.write(words[0]); + int trackLineWidth = words[0].length; + for (var i = 1; i < words.length; i++) { + final word = words[i]; + if (trackLineWidth + word.length < lineWidth) { + sb.write(' '); + sb.write(word); + trackLineWidth += word.length + 1; + } else { + sb.write('\n'); + sb.write(word); + trackLineWidth = word.length; + } + } + return sb.toString(); +} + +/// Removes /*, */ and any *'s in the beginning of a line. +String removeRawCommentMarkups(String string) { + if (string == null || string.isEmpty) { + return null; + } + final sb = StringBuffer(); + + // Remove comment identifiers. + string = string.replaceAll('/*', ''); + string = string.replaceAll('*/', ''); + + // Remove any *'s in the beginning of a every line. + string.split('\n').forEach((element) { + element = element.trim().replaceFirst(RegExp(r'\**'), '').trim(); + sb.writeln(element); + }); + return sb.toString().trim(); } extension CXTypeExt on Pointer { diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 9d9ff17ad8..e96ddc13e2 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -58,7 +58,14 @@ const sizemap_native_mapping = { const sort = 'sort'; const useSupportedTypedefs = 'use-supported-typedefs'; const warnWhenRemoving = 'warn-when-removing'; -const extractComments = 'extract-comments'; + +const comments = 'comments'; +// Comment type. +const brief = 'brief'; +const full = 'full'; +const none = 'none'; +// Contains all possibe comment types. +const commentTypeSet = {brief, full, none}; // Dynamic library names. const libclang_dylib_linux = 'libwrapped_clang.so'; diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index 0e612561d7..3fe9bb2792 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -35,6 +35,11 @@ structs: names: - CXCursor - CXType + - CXSourceLocation + - CXString + - CXTranslationUnitImpl + - CXUnsavedFile + - CXSourceRange functions: include: @@ -68,6 +73,9 @@ functions: - clang_getNumArgTypes_wrap - clang_getArgType_wrap - clang_getEnumConstantDeclValue_wrap + - clang_equalRanges_wrap + - clang_Cursor_getCommentRange_wrap + - clang_Cursor_getRawCommentText_wrap - clang_Cursor_getBriefCommentText_wrap - clang_getCursorLocation_wrap - clang_getFileLocation_wrap diff --git a/pkgs/ffigen/tool/wrapped_libclang/wrapper.c b/pkgs/ffigen/tool/wrapped_libclang/wrapper.c index 2e0e375cf2..aa1e94da14 100644 --- a/pkgs/ffigen/tool/wrapped_libclang/wrapper.c +++ b/pkgs/ffigen/tool/wrapped_libclang/wrapper.c @@ -32,6 +32,12 @@ CXSourceLocation *ptrToCXSourceLocation(CXSourceLocation t) *c = t; return c; } +CXSourceRange *ptrToCXSourceRange(CXSourceRange t) +{ + CXSourceRange *c = aloc(CXSourceRange); + *c = t; + return c; +} // START ===== Functions for testing libclang behavior in C. enum CXChildVisitResult visitor_for_test_in_c(CXCursor cursor, CXCursor parent, CXClientData clientData) { @@ -240,6 +246,24 @@ long long clang_getEnumConstantDeclValue_wrap(CXCursor *cursor) return clang_getEnumConstantDeclValue(*cursor); } +/** Returns non-zero if the ranges are the same, zero if they differ. */ +unsigned clang_equalRanges_wrap(CXSourceRange *c1, CXSourceRange *c2) +{ + return clang_equalRanges(*c1, *c2); +} + +/** Returns the comment range. */ +CXSourceRange *clang_Cursor_getCommentRange_wrap(CXCursor *cursor) +{ + return ptrToCXSourceRange(clang_Cursor_getCommentRange(*cursor)); +} + +/** Returns the raw comment. */ +CXString *clang_Cursor_getRawCommentText_wrap(CXCursor *cursor) +{ + return ptrToCXString(clang_Cursor_getRawCommentText(*cursor)); +} + /** Returns the first paragraph of doxygen doc comment. */ CXString *clang_Cursor_getBriefCommentText_wrap(CXCursor *cursor) { diff --git a/pkgs/ffigen/tool/wrapped_libclang/wrapper.def b/pkgs/ffigen/tool/wrapped_libclang/wrapper.def index 36902ae7ba..5a10727eed 100644 --- a/pkgs/ffigen/tool/wrapped_libclang/wrapper.def +++ b/pkgs/ffigen/tool/wrapped_libclang/wrapper.def @@ -344,6 +344,9 @@ clang_Cursor_getArgument_wrap clang_getNumArgTypes_wrap clang_getArgType_wrap clang_getEnumConstantDeclValue_wrap +clang_equalRanges_wrap +clang_Cursor_getCommentRange_wrap +clang_Cursor_getRawCommentText_wrap clang_Cursor_getBriefCommentText_wrap clang_getCursorLocation_wrap clang_getFileLocation_wrap From 5d43897989c3b80ce98ccbec68278546de126fc6 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Wed, 1 Jul 2020 09:37:19 +0200 Subject: [PATCH 008/276] [ffigen] Add gitignores for IDEs and debuggers (#19) --- pkgs/ffigen/.gitignore | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/ffigen/.gitignore b/pkgs/ffigen/.gitignore index 57990d8c7c..96f7b0198e 100644 --- a/pkgs/ffigen/.gitignore +++ b/pkgs/ffigen/.gitignore @@ -5,6 +5,13 @@ .packages pubspec.lock +# IDE and debugger files. +.clangd +.gdb_history +.history +.vscode +compile_commands.json + # Directory created by dartdoc. # If you don't generate documentation locally you can remove this line. doc/api/ From 27d83703cd0aaa9ac38e1bf58e82b7733ce460a6 Mon Sep 17 00:00:00 2001 From: Prerak Mann <31154435+mannprerak2@users.noreply.github.com> Date: Thu, 2 Jul 2020 11:52:16 +0530 Subject: [PATCH 009/276] [ffigen] Support for array parameters in functions, array workarounds in Structs (#18) - Added multi-dimension array support in Struct using array-workaround config flag. - Added support for arrays parameters in functions. --- .../libclang-example/generated_bindings.dart | 454 +++++++++--------- .../example/libclang-example/pubspec.yaml | 5 +- pkgs/ffigen/lib/src/code_generator/struc.dart | 167 ++++--- pkgs/ffigen/lib/src/code_generator/type.dart | 54 ++- .../lib/src/config_provider/config.dart | 14 + .../clang_bindings/clang_bindings.dart | 254 +++++----- .../sub_parsers/functiondecl_parser.dart | 12 - .../sub_parsers/structdecl_parser.dart | 20 +- .../type_extractor/extractor.dart | 5 + pkgs/ffigen/lib/src/header_parser/utils.dart | 2 +- pkgs/ffigen/lib/src/strings.dart | 1 + .../native_functions_test.dart | 61 --- .../build_test_dylib.dart | 24 +- .../config.yaml | 7 +- .../native_test.c} | 21 + pkgs/ffigen/test/native_test/native_test.dart | 105 ++++ .../native_test.def} | 0 .../native_test_bindings.dart} | 150 ++++++ pkgs/ffigen/tool/libclang_config.yaml | 2 + 19 files changed, 824 insertions(+), 534 deletions(-) delete mode 100644 pkgs/ffigen/test/native_functions_test/native_functions_test.dart rename pkgs/ffigen/test/{native_functions_test => native_test}/build_test_dylib.dart (83%) rename pkgs/ffigen/test/{native_functions_test => native_test}/config.yaml (83%) rename pkgs/ffigen/test/{native_functions_test/native_functions.c => native_test/native_test.c} (68%) create mode 100644 pkgs/ffigen/test/native_test/native_test.dart rename pkgs/ffigen/test/{native_functions_test/native_functions.def => native_test/native_test.def} (100%) rename pkgs/ffigen/test/{native_functions_test/native_functions_bindings.dart => native_test/native_test_bindings.dart} (50%) diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index 8f19852d2f..4fbfac37dd 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -71,33 +71,30 @@ class CXCursor extends ffi.Struct { ffi.Pointer _data_item_1; ffi.Pointer _data_item_2; - /// helper for array, supports `[]` operator - _ArrayHelper_CXCursor_data get data => _ArrayHelper_CXCursor_data(this, 3); + /// 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 { +/// Helper for array `data` in struct `CXCursor`. +class ArrayHelper_CXCursor_data_level0 { final CXCursor _struct; - final int length; - _ArrayHelper_CXCursor_data(this._struct, this.length); - void operator []=(int index, ffi.Pointer value) { - switch (index) { - case 0: - _struct._data_item_0 = value; - break; - case 1: - _struct._data_item_1 = value; - break; - case 2: - _struct._data_item_2 = value; - break; - default: - throw RangeError('Index $index must be in the range [0..2].'); + 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) { - switch (index) { + _checkBounds(index); + switch (_absoluteIndex + index) { case 0: return _struct._data_item_0; case 1: @@ -105,21 +102,25 @@ class _ArrayHelper_CXCursor_data { case 2: return _struct._data_item_2; default: - throw RangeError('Index $index must be in the range [0..2].'); + throw Exception('Invalid Array Helper generated.'); } } - @override - String toString() { - if (length == 0) return '[]'; - final sb = StringBuffer('['); - sb.write(this[0]); - for (var i = 1; i < length; i++) { - sb.write(','); - sb.write(this[i]); + void operator []=(int index, ffi.Pointer value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._data_item_0 = value; + break; + case 1: + _struct._data_item_1 = value; + break; + case 2: + _struct._data_item_2 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); } - sb.write(']'); - return sb.toString(); } } @@ -152,34 +153,30 @@ class CXFileUniqueID extends ffi.Struct { @ffi.Uint64() int _data_item_2; - /// helper for array, supports `[]` operator - _ArrayHelper_CXFileUniqueID_data get data => - _ArrayHelper_CXFileUniqueID_data(this, 3); + /// 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 { +/// Helper for array `data` in struct `CXFileUniqueID`. +class ArrayHelper_CXFileUniqueID_data_level0 { final CXFileUniqueID _struct; - final int length; - _ArrayHelper_CXFileUniqueID_data(this._struct, this.length); - void operator []=(int index, int value) { - switch (index) { - case 0: - _struct._data_item_0 = value; - break; - case 1: - _struct._data_item_1 = value; - break; - case 2: - _struct._data_item_2 = value; - break; - default: - throw RangeError('Index $index must be in the range [0..2].'); + 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) { - switch (index) { + _checkBounds(index); + switch (_absoluteIndex + index) { case 0: return _struct._data_item_0; case 1: @@ -187,21 +184,25 @@ class _ArrayHelper_CXFileUniqueID_data { case 2: return _struct._data_item_2; default: - throw RangeError('Index $index must be in the range [0..2].'); + throw Exception('Invalid Array Helper generated.'); } } - @override - String toString() { - if (length == 0) return '[]'; - final sb = StringBuffer('['); - sb.write(this[0]); - for (var i = 1; i < length; i++) { - sb.write(','); - sb.write(this[i]); + void operator []=(int index, int value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._data_item_0 = value; + break; + case 1: + _struct._data_item_1 = value; + break; + case 2: + _struct._data_item_2 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); } - sb.write(']'); - return sb.toString(); } } @@ -262,60 +263,54 @@ class CXIdxIncludedFileInfo extends ffi.Struct {} class CXIdxLoc extends ffi.Struct { ffi.Pointer _ptr_data_item_0; ffi.Pointer _ptr_data_item_1; - ffi.Pointer _ptr_data_item_2; - /// helper for array, supports `[]` operator - _ArrayHelper_CXIdxLoc_ptr_data get ptr_data => - _ArrayHelper_CXIdxLoc_ptr_data(this, 3); + /// Helper for array `ptr_data`. + ArrayHelper_CXIdxLoc_ptr_data_level0 get ptr_data => + ArrayHelper_CXIdxLoc_ptr_data_level0(this, [2], 0, 0); @ffi.Uint32() int int_data; } -/// Helper for array ptr_data in struct CXIdxLoc -class _ArrayHelper_CXIdxLoc_ptr_data { +/// Helper for array `ptr_data` in struct `CXIdxLoc`. +class ArrayHelper_CXIdxLoc_ptr_data_level0 { final CXIdxLoc _struct; - final int length; - _ArrayHelper_CXIdxLoc_ptr_data(this._struct, this.length); - void operator []=(int index, ffi.Pointer value) { - switch (index) { - case 0: - _struct._ptr_data_item_0 = value; - break; - case 1: - _struct._ptr_data_item_1 = value; - break; - case 2: - _struct._ptr_data_item_2 = value; - break; - default: - throw RangeError('Index $index must be in the range [0..2].'); + 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) { - switch (index) { + _checkBounds(index); + switch (_absoluteIndex + index) { case 0: return _struct._ptr_data_item_0; case 1: return _struct._ptr_data_item_1; - case 2: - return _struct._ptr_data_item_2; default: - throw RangeError('Index $index must be in the range [0..2].'); + throw Exception('Invalid Array Helper generated.'); } } - @override - String toString() { - if (length == 0) return '[]'; - final sb = StringBuffer('['); - sb.write(this[0]); - for (var i = 1; i < length; i++) { - sb.write(','); - sb.write(this[i]); + void operator []=(int index, ffi.Pointer value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._ptr_data_item_0 = value; + break; + case 1: + _struct._ptr_data_item_1 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); } - sb.write(']'); - return sb.toString(); } } @@ -372,60 +367,54 @@ class CXPlatformAvailability extends ffi.Struct {} class CXSourceLocation extends ffi.Struct { ffi.Pointer _ptr_data_item_0; ffi.Pointer _ptr_data_item_1; - ffi.Pointer _ptr_data_item_2; - /// helper for array, supports `[]` operator - _ArrayHelper_CXSourceLocation_ptr_data get ptr_data => - _ArrayHelper_CXSourceLocation_ptr_data(this, 3); + /// Helper for array `ptr_data`. + ArrayHelper_CXSourceLocation_ptr_data_level0 get ptr_data => + ArrayHelper_CXSourceLocation_ptr_data_level0(this, [2], 0, 0); @ffi.Uint32() int int_data; } -/// Helper for array ptr_data in struct CXSourceLocation -class _ArrayHelper_CXSourceLocation_ptr_data { +/// Helper for array `ptr_data` in struct `CXSourceLocation`. +class ArrayHelper_CXSourceLocation_ptr_data_level0 { final CXSourceLocation _struct; - final int length; - _ArrayHelper_CXSourceLocation_ptr_data(this._struct, this.length); - void operator []=(int index, ffi.Pointer value) { - switch (index) { - case 0: - _struct._ptr_data_item_0 = value; - break; - case 1: - _struct._ptr_data_item_1 = value; - break; - case 2: - _struct._ptr_data_item_2 = value; - break; - default: - throw RangeError('Index $index must be in the range [0..2].'); + 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) { - switch (index) { + _checkBounds(index); + switch (_absoluteIndex + index) { case 0: return _struct._ptr_data_item_0; case 1: return _struct._ptr_data_item_1; - case 2: - return _struct._ptr_data_item_2; default: - throw RangeError('Index $index must be in the range [0..2].'); + throw Exception('Invalid Array Helper generated.'); } } - @override - String toString() { - if (length == 0) return '[]'; - final sb = StringBuffer('['); - sb.write(this[0]); - for (var i = 1; i < length; i++) { - sb.write(','); - sb.write(this[i]); + void operator []=(int index, ffi.Pointer value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._ptr_data_item_0 = value; + break; + case 1: + _struct._ptr_data_item_1 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); } - sb.write(']'); - return sb.toString(); } } @@ -436,11 +425,10 @@ class _ArrayHelper_CXSourceLocation_ptr_data { class CXSourceRange extends ffi.Struct { ffi.Pointer _ptr_data_item_0; ffi.Pointer _ptr_data_item_1; - ffi.Pointer _ptr_data_item_2; - /// helper for array, supports `[]` operator - _ArrayHelper_CXSourceRange_ptr_data get ptr_data => - _ArrayHelper_CXSourceRange_ptr_data(this, 3); + /// Helper for array `ptr_data`. + ArrayHelper_CXSourceRange_ptr_data_level0 get ptr_data => + ArrayHelper_CXSourceRange_ptr_data_level0(this, [2], 0, 0); @ffi.Uint32() int begin_int_data; @@ -448,51 +436,46 @@ class CXSourceRange extends ffi.Struct { int end_int_data; } -/// Helper for array ptr_data in struct CXSourceRange -class _ArrayHelper_CXSourceRange_ptr_data { +/// Helper for array `ptr_data` in struct `CXSourceRange`. +class ArrayHelper_CXSourceRange_ptr_data_level0 { final CXSourceRange _struct; - final int length; - _ArrayHelper_CXSourceRange_ptr_data(this._struct, this.length); - void operator []=(int index, ffi.Pointer value) { - switch (index) { - case 0: - _struct._ptr_data_item_0 = value; - break; - case 1: - _struct._ptr_data_item_1 = value; - break; - case 2: - _struct._ptr_data_item_2 = value; - break; - default: - throw RangeError('Index $index must be in the range [0..2].'); + 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) { - switch (index) { + _checkBounds(index); + switch (_absoluteIndex + index) { case 0: return _struct._ptr_data_item_0; case 1: return _struct._ptr_data_item_1; - case 2: - return _struct._ptr_data_item_2; default: - throw RangeError('Index $index must be in the range [0..2].'); + throw Exception('Invalid Array Helper generated.'); } } - @override - String toString() { - if (length == 0) return '[]'; - final sb = StringBuffer('['); - sb.write(this[0]); - for (var i = 1; i < length; i++) { - sb.write(','); - sb.write(this[i]); + void operator []=(int index, ffi.Pointer value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._ptr_data_item_0 = value; + break; + case 1: + _struct._ptr_data_item_1 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); } - sb.write(']'); - return sb.toString(); } } @@ -554,58 +537,65 @@ class CXToken extends ffi.Struct { int _int_data_item_1; @ffi.Uint32() int _int_data_item_2; + @ffi.Uint32() + int _int_data_item_3; - /// helper for array, supports `[]` operator - _ArrayHelper_CXToken_int_data get int_data => - _ArrayHelper_CXToken_int_data(this, 3); + /// Helper for array `int_data`. + ArrayHelper_CXToken_int_data_level0 get int_data => + ArrayHelper_CXToken_int_data_level0(this, [4], 0, 0); ffi.Pointer ptr_data; } -/// Helper for array int_data in struct CXToken -class _ArrayHelper_CXToken_int_data { +/// Helper for array `int_data` in struct `CXToken`. +class ArrayHelper_CXToken_int_data_level0 { final CXToken _struct; - final int length; - _ArrayHelper_CXToken_int_data(this._struct, this.length); - void operator []=(int index, int value) { - switch (index) { - case 0: - _struct._int_data_item_0 = value; - break; - case 1: - _struct._int_data_item_1 = value; - break; - case 2: - _struct._int_data_item_2 = value; - break; - default: - throw RangeError('Index $index must be in the range [0..2].'); + 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) { - switch (index) { + _checkBounds(index); + switch (_absoluteIndex + index) { case 0: return _struct._int_data_item_0; case 1: return _struct._int_data_item_1; case 2: return _struct._int_data_item_2; + case 3: + return _struct._int_data_item_3; default: - throw RangeError('Index $index must be in the range [0..2].'); + throw Exception('Invalid Array Helper generated.'); } } - @override - String toString() { - if (length == 0) return '[]'; - final sb = StringBuffer('['); - sb.write(this[0]); - for (var i = 1; i < length; i++) { - sb.write(','); - sb.write(this[i]); + void operator []=(int index, int value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._int_data_item_0 = value; + break; + case 1: + _struct._int_data_item_1 = value; + break; + case 2: + _struct._int_data_item_2 = value; + break; + case 3: + _struct._int_data_item_3 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); } - sb.write(']'); - return sb.toString(); } } @@ -618,57 +608,52 @@ class CXType extends ffi.Struct { ffi.Pointer _data_item_0; ffi.Pointer _data_item_1; - ffi.Pointer _data_item_2; - /// helper for array, supports `[]` operator - _ArrayHelper_CXType_data get data => _ArrayHelper_CXType_data(this, 3); + /// 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 { +/// Helper for array `data` in struct `CXType`. +class ArrayHelper_CXType_data_level0 { final CXType _struct; - final int length; - _ArrayHelper_CXType_data(this._struct, this.length); - void operator []=(int index, ffi.Pointer value) { - switch (index) { - case 0: - _struct._data_item_0 = value; - break; - case 1: - _struct._data_item_1 = value; - break; - case 2: - _struct._data_item_2 = value; - break; - default: - throw RangeError('Index $index must be in the range [0..2].'); + 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) { - switch (index) { + _checkBounds(index); + switch (_absoluteIndex + index) { case 0: return _struct._data_item_0; case 1: return _struct._data_item_1; - case 2: - return _struct._data_item_2; default: - throw RangeError('Index $index must be in the range [0..2].'); + throw Exception('Invalid Array Helper generated.'); } } - @override - String toString() { - if (length == 0) return '[]'; - final sb = StringBuffer('['); - sb.write(this[0]); - for (var i = 1; i < length; i++) { - sb.write(','); - sb.write(this[i]); + void operator []=(int index, ffi.Pointer value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._data_item_0 = value; + break; + case 1: + _struct._data_item_1 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); } - sb.write(']'); - return sb.toString(); } } @@ -2572,6 +2557,7 @@ typedef _c_clang_enableStackTraces = ffi.Void Function(); typedef _dart_clang_enableStackTraces = void Function(); +/// Returns non-zero if the ranges are the same, zero if they differ. int clang_equalRanges_wrap( ffi.Pointer c1, ffi.Pointer c2, diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index d4dc2fd22b..832f111d72 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -59,5 +59,8 @@ ffigen: unsigned long long: 8 enum: 4 - # Doc Comments for generated binings: Can be full, brief(default) or none + # False by default. + array-workaround: true + + # Doc Comments for generated binings: Can be full, brief(default) or none. comments: full diff --git a/pkgs/ffigen/lib/src/code_generator/struc.dart b/pkgs/ffigen/lib/src/code_generator/struc.dart index 4cb515268c..5e2db56c56 100644 --- a/pkgs/ffigen/lib/src/code_generator/struc.dart +++ b/pkgs/ffigen/lib/src/code_generator/struc.dart @@ -43,6 +43,16 @@ class Struc extends Binding { }) : members = members ?? [], super(name: name, dartDoc: dartDoc); + List _getArrayDimensionLengths(Type type) { + final array = []; + var startType = type; + while (startType.broadType == BroadType.ConstantArray) { + array.add(startType.length); + startType = startType.child; + } + return array; + } + @override BindingString toBindingString(Writer w) { final s = StringBuffer(); @@ -61,9 +71,9 @@ class Struc extends Binding { if (m.type.broadType == BroadType.ConstantArray) { // TODO(5): Remove array helpers when inline array support arives. final arrayHelper = ArrayHelper( - helperClassName: '_ArrayHelper_${name}_${m.name}', - elementType: m.type.elementType, - length: 3, + helperClassGroupName: 'ArrayHelper_${name}_${m.name}', + elementType: m.type.getBaseArrayType(), + dimensions: _getArrayDimensionLengths(m.type), name: m.name, structName: name, elementNamePrefix: '_${m.name}_item_', @@ -104,19 +114,30 @@ class Member { // Helper bindings for struct array. class ArrayHelper { final Type elementType; - final int length; + final List dimensions; final String structName; final String name; - final String helperClassName; + final String helperClassGroupName; final String elementNamePrefix; + int _expandedArrayLength; + int get expandedArrayLength { + if (_expandedArrayLength != null) return _expandedArrayLength; + + int arrayLength = 1; + for (final i in dimensions) { + arrayLength = arrayLength * i; + } + return arrayLength; + } + ArrayHelper({ @required this.elementType, - @required this.length, + @required this.dimensions, @required this.structName, @required this.name, - @required this.helperClassName, + @required this.helperClassGroupName, @required this.elementNamePrefix, }); @@ -126,76 +147,100 @@ class ArrayHelper { final arrayDartType = elementType.getDartType(w); final arrayCType = elementType.getCType(w); - for (var i = 0; i < length; i++) { + for (int i = 0; i < expandedArrayLength; i++) { if (elementType.isPrimitive) { s.write(' @${arrayCType}()\n'); } s.write(' ${arrayDartType} ${elementNamePrefix}$i;\n'); } - s.write('/// helper for array, supports `[]` operator\n'); + s.write('/// Helper for array `$name`.\n'); s.write( - '$helperClassName get $name => ${helperClassName}(this, $length);\n'); + '${helperClassGroupName}_level0 get $name => ${helperClassGroupName}_level0(this, $dimensions, 0, 0);\n'); return s.toString(); } - /// Creates an array helper binding for struct array. String helperClassString(Writer w) { final s = StringBuffer(); - final arrayType = elementType.getDartType(w); - - s.write('/// Helper for array $name in struct $structName\n'); - - // Write class declaration. - s.write('class $helperClassName{\n'); - s.write('final $structName _struct;\n'); - s.write('final int length;\n'); - s.write('$helperClassName(this._struct, this.length);\n'); - - // Override []= operator. - s.write('void operator []=(int index, $arrayType value) {\n'); - s.write('switch(index) {\n'); - for (var i = 0; i < length; i++) { - s.write('case $i:\n'); - s.write(' _struct.${elementNamePrefix}$i = value;\n'); - s.write(' break;\n'); + for (int dim = 0; dim < dimensions.length; dim++) { + final helperClassName = '${helperClassGroupName}_level${dim}'; + final structIdentifier = '_struct'; + final dimensionsIdentifier = 'dimensions'; + final levelIdentifier = 'level'; + final absoluteIndexIdentifier = '_absoluteIndex'; + final checkBoundsFunctionIdentifier = '_checkBounds'; + final legthIdentifier = 'length'; + + s.write('/// Helper for array `$name` in struct `$structName`.\n'); + + // Write class declaration. + s.write('class ${helperClassName}{\n'); + s.write('final $structName $structIdentifier;\n'); + s.write('final List $dimensionsIdentifier;\n'); + s.write('final int $levelIdentifier;\n'); + s.write('final int $absoluteIndexIdentifier;\n'); + s.write( + 'int get $legthIdentifier => $dimensionsIdentifier[$levelIdentifier];\n'); + + // Write class constructor. + s.write( + '$helperClassName(this.$structIdentifier, this.$dimensionsIdentifier, this.$levelIdentifier, this.$absoluteIndexIdentifier);\n'); + + // Write checkBoundsFunction. + s.write(''' + void $checkBoundsFunctionIdentifier(int index) { + if (index >= $legthIdentifier || index < 0) { + throw RangeError('Dimension \$$levelIdentifier: index not in range 0..\${$legthIdentifier} exclusive.'); } - s.write('default:\n'); - s.write( - " throw RangeError('Index \$index must be in the range [0..${length - 1}].');"); - s.write('}\n'); - s.write('}\n'); - - // Override [] operator. - s.write('$arrayType operator [](int index) {\n'); - s.write('switch(index) {\n'); - for (var i = 0; i < length; i++) { - s.write('case $i:\n'); - s.write(' return _struct.${elementNamePrefix}$i;\n'); + } + '''); + // If this isn't the last level. + if (dim + 1 != dimensions.length) { + // Override [] operator. + s.write(''' + ${helperClassGroupName}_level${dim + 1} operator [](int index) { + $checkBoundsFunctionIdentifier(index); + int offset = index; + for (int i = level + 1; i < $dimensionsIdentifier.length; i++) { + offset *= $dimensionsIdentifier[i]; + } + return ${helperClassGroupName}_level${dim + 1}( + $structIdentifier, $dimensionsIdentifier, $levelIdentifier + 1, $absoluteIndexIdentifier + offset); + } +'''); + } else { + // This is the last level, add switching logic here. + // Override [] operator. + s.write('$arrayType operator[](int index){\n'); + s.write('$checkBoundsFunctionIdentifier(index);\n'); + s.write('switch($absoluteIndexIdentifier+index){\n'); + for (int i = 0; i < expandedArrayLength; i++) { + s.write('case $i:\n'); + s.write(' return $structIdentifier.${elementNamePrefix}$i;\n'); + } + s.write('default:\n'); + s.write(" throw Exception('Invalid Array Helper generated.');"); + s.write('}\n'); + s.write('}\n'); + + // Override []= operator. + s.write('void operator[]=(int index, $arrayType value){\n'); + s.write('$checkBoundsFunctionIdentifier(index);\n'); + s.write('switch($absoluteIndexIdentifier+index){\n'); + for (int i = 0; i < expandedArrayLength; i++) { + s.write('case $i:\n'); + s.write(' $structIdentifier.${elementNamePrefix}$i = value;\n'); + s.write(' break;\n'); + } + s.write('default:\n'); + s.write(" throw Exception('Invalid Array Helper generated.');\n"); + s.write('}\n'); + s.write('}\n'); + } + s.write('}\n'); } - s.write('default:\n'); - s.write( - " throw RangeError('Index \$index must be in the range [0..${length - 1}].');"); - s.write('}\n'); - s.write('}\n'); - - // Override toString(). - s.write('@override\n'); - s.write('String toString() {\n'); - s.write("if (length == 0) return '[]';\n"); - s.write("final sb = StringBuffer('[');\n"); - s.write('sb.write(this[0]);\n'); - s.write('for (var i = 1; i < length; i++) {\n'); - s.write(" sb.write(',');\n"); - s.write(' sb.write(this[i]);'); - s.write('}\n'); - s.write("sb.write(']');"); - s.write('return sb.toString();\n'); - s.write('}\n'); - - s.write('}\n\n'); return s.toString(); } } diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index b393d34955..dccdec38d5 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -38,6 +38,7 @@ enum BroadType { /// Stores its element type in NativeType as only those are supported. ConstantArray, + IncompleteArray, /// Used as a marker, so that functions/structs having these can exclude them. Unimplemented, @@ -73,12 +74,11 @@ class Type { /// The BroadType of this Type. final BroadType broadType; - /// Child Type, e.g Pointer(Parent) to Int(Child). + /// Child Type, e.g Pointer(Parent) to Int(Child), or Child Type of an Array. final Type child; - /// For ConstantArray type. - final int arrayLength; - final Type elementType; + /// For ConstantArray and IncompleteArray type. + final int length; /// For storing cursor type info for an unimplemented type. String unimplementedReason; @@ -89,8 +89,7 @@ class Type { this.structName, this.nativeType, this.nativeFuncName, - this.arrayLength, - this.elementType, + this.length, this.unimplementedReason, }); @@ -107,8 +106,18 @@ class Type { factory Type.nativeType(SupportedNativeType nativeType) { return Type._(broadType: BroadType.NativeType, nativeType: nativeType); } - factory Type.constantArray(int arrayLength, Type elementType) { - return Type._(broadType: BroadType.ConstantArray, elementType: elementType); + factory Type.constantArray(int length, Type elementType) { + return Type._( + broadType: BroadType.ConstantArray, + child: elementType, + length: length, + ); + } + factory Type.incompleteArray(Type elementType) { + return Type._( + broadType: BroadType.ConstantArray, + child: elementType, + ); } factory Type.unimplemented(String reason) { return Type._( @@ -117,15 +126,28 @@ class Type { /// Get base broad type for any type. /// - /// E.g int** has base Broadtype as NativeType. + /// E.g int** has base Broadtype as NativeType, + /// double[2][3] has base broadtype as double. BroadType getBaseBroadType() { - if (broadType == BroadType.Pointer) { + if (child != null) { return child.getBaseBroadType(); } else { return broadType; } } + /// Get base Array type. + /// + /// Returns itself if it's not an Array Type. + Type getBaseArrayType() { + if (broadType == BroadType.ConstantArray || + broadType == BroadType.IncompleteArray) { + return child.getBaseArrayType(); + } else { + return this; + } + } + bool get isPrimitive => broadType == BroadType.NativeType; String getCType(Writer w) { @@ -138,6 +160,12 @@ class Type { return structName; case BroadType.NativeFunction: return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFuncName}>'; + case BroadType + .IncompleteArray: // Array parameters are treated as Pointers in C. + return '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; + case BroadType + .ConstantArray: // Array parameters are treated as Pointers in C. + return '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; default: throw Exception('cType unknown'); } @@ -153,6 +181,12 @@ class Type { return structName; case BroadType.NativeFunction: return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFuncName}>'; + case BroadType + .IncompleteArray: // Array parameters are treated as Pointers in C. + return '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; + case BroadType + .ConstantArray: // Array parameters are treated as Pointers in C. + return '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; default: throw Exception('dart type unknown for ${broadType.toString()}'); } diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 49cda0ca05..fbd2ae62fb 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -62,6 +62,11 @@ class Config { /// Extracted Doc comment type. String comment; + /// If tool should generate array workarounds. + /// + /// If false(default), structs with inline array members will have all its members removed. + bool arrayWorkaround; + /// Manually creating configurations. /// /// Use [Config.fromYaml] if extracting info from a yaml file. @@ -251,6 +256,15 @@ class Config { defaultValue: strings.brief, extractedResult: (dynamic result) => comment = result as String, ), + strings.arrayWorkaround: Specification( + description: + 'whether or not to generate workarounds for inline arrays in structures', + isRequired: false, + validator: booleanValidator, + extractor: booleanExtractor, + defaultValue: false, + extractedResult: (dynamic result) => arrayWorkaround = result as bool, + ), }; } } diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 1cf40a3019..546c8dca21 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -39,33 +39,30 @@ class CXCursor extends ffi.Struct { ffi.Pointer _data_item_1; ffi.Pointer _data_item_2; - /// helper for array, supports `[]` operator - _ArrayHelper_CXCursor_data get data => _ArrayHelper_CXCursor_data(this, 3); + /// 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 { +/// Helper for array `data` in struct `CXCursor`. +class ArrayHelper_CXCursor_data_level0 { final CXCursor _struct; - final int length; - _ArrayHelper_CXCursor_data(this._struct, this.length); - void operator []=(int index, ffi.Pointer value) { - switch (index) { - case 0: - _struct._data_item_0 = value; - break; - case 1: - _struct._data_item_1 = value; - break; - case 2: - _struct._data_item_2 = value; - break; - default: - throw RangeError('Index $index must be in the range [0..2].'); + 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) { - switch (index) { + _checkBounds(index); + switch (_absoluteIndex + index) { case 0: return _struct._data_item_0; case 1: @@ -73,21 +70,25 @@ class _ArrayHelper_CXCursor_data { case 2: return _struct._data_item_2; default: - throw RangeError('Index $index must be in the range [0..2].'); + throw Exception('Invalid Array Helper generated.'); } } - @override - String toString() { - if (length == 0) return '[]'; - final sb = StringBuffer('['); - sb.write(this[0]); - for (var i = 1; i < length; i++) { - sb.write(','); - sb.write(this[i]); + void operator []=(int index, ffi.Pointer value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._data_item_0 = value; + break; + case 1: + _struct._data_item_1 = value; + break; + case 2: + _struct._data_item_2 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); } - sb.write(']'); - return sb.toString(); } } @@ -770,60 +771,54 @@ class CXDiagnosticDisplayOptions { class CXSourceLocation extends ffi.Struct { ffi.Pointer _ptr_data_item_0; ffi.Pointer _ptr_data_item_1; - ffi.Pointer _ptr_data_item_2; - /// helper for array, supports `[]` operator - _ArrayHelper_CXSourceLocation_ptr_data get ptr_data => - _ArrayHelper_CXSourceLocation_ptr_data(this, 3); + /// Helper for array `ptr_data`. + ArrayHelper_CXSourceLocation_ptr_data_level0 get ptr_data => + ArrayHelper_CXSourceLocation_ptr_data_level0(this, [2], 0, 0); @ffi.Uint32() int int_data; } -/// Helper for array ptr_data in struct CXSourceLocation -class _ArrayHelper_CXSourceLocation_ptr_data { +/// Helper for array `ptr_data` in struct `CXSourceLocation`. +class ArrayHelper_CXSourceLocation_ptr_data_level0 { final CXSourceLocation _struct; - final int length; - _ArrayHelper_CXSourceLocation_ptr_data(this._struct, this.length); - void operator []=(int index, ffi.Pointer value) { - switch (index) { - case 0: - _struct._ptr_data_item_0 = value; - break; - case 1: - _struct._ptr_data_item_1 = value; - break; - case 2: - _struct._ptr_data_item_2 = value; - break; - default: - throw RangeError('Index $index must be in the range [0..2].'); + 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) { - switch (index) { + _checkBounds(index); + switch (_absoluteIndex + index) { case 0: return _struct._ptr_data_item_0; case 1: return _struct._ptr_data_item_1; - case 2: - return _struct._ptr_data_item_2; default: - throw RangeError('Index $index must be in the range [0..2].'); + throw Exception('Invalid Array Helper generated.'); } } - @override - String toString() { - if (length == 0) return '[]'; - final sb = StringBuffer('['); - sb.write(this[0]); - for (var i = 1; i < length; i++) { - sb.write(','); - sb.write(this[i]); + void operator []=(int index, ffi.Pointer value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._ptr_data_item_0 = value; + break; + case 1: + _struct._ptr_data_item_1 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); } - sb.write(']'); - return sb.toString(); } } @@ -831,11 +826,10 @@ class _ArrayHelper_CXSourceLocation_ptr_data { class CXSourceRange extends ffi.Struct { ffi.Pointer _ptr_data_item_0; ffi.Pointer _ptr_data_item_1; - ffi.Pointer _ptr_data_item_2; - /// helper for array, supports `[]` operator - _ArrayHelper_CXSourceRange_ptr_data get ptr_data => - _ArrayHelper_CXSourceRange_ptr_data(this, 3); + /// Helper for array `ptr_data`. + ArrayHelper_CXSourceRange_ptr_data_level0 get ptr_data => + ArrayHelper_CXSourceRange_ptr_data_level0(this, [2], 0, 0); @ffi.Uint32() int begin_int_data; @@ -843,51 +837,46 @@ class CXSourceRange extends ffi.Struct { int end_int_data; } -/// Helper for array ptr_data in struct CXSourceRange -class _ArrayHelper_CXSourceRange_ptr_data { +/// Helper for array `ptr_data` in struct `CXSourceRange`. +class ArrayHelper_CXSourceRange_ptr_data_level0 { final CXSourceRange _struct; - final int length; - _ArrayHelper_CXSourceRange_ptr_data(this._struct, this.length); - void operator []=(int index, ffi.Pointer value) { - switch (index) { - case 0: - _struct._ptr_data_item_0 = value; - break; - case 1: - _struct._ptr_data_item_1 = value; - break; - case 2: - _struct._ptr_data_item_2 = value; - break; - default: - throw RangeError('Index $index must be in the range [0..2].'); + 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) { - switch (index) { + _checkBounds(index); + switch (_absoluteIndex + index) { case 0: return _struct._ptr_data_item_0; case 1: return _struct._ptr_data_item_1; - case 2: - return _struct._ptr_data_item_2; default: - throw RangeError('Index $index must be in the range [0..2].'); + throw Exception('Invalid Array Helper generated.'); } } - @override - String toString() { - if (length == 0) return '[]'; - final sb = StringBuffer('['); - sb.write(this[0]); - for (var i = 1; i < length; i++) { - sb.write(','); - sb.write(this[i]); + void operator []=(int index, ffi.Pointer value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._ptr_data_item_0 = value; + break; + case 1: + _struct._ptr_data_item_1 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); } - sb.write(']'); - return sb.toString(); } } @@ -972,57 +961,52 @@ class CXType extends ffi.Struct { ffi.Pointer _data_item_0; ffi.Pointer _data_item_1; - ffi.Pointer _data_item_2; - /// helper for array, supports `[]` operator - _ArrayHelper_CXType_data get data => _ArrayHelper_CXType_data(this, 3); + /// 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 { +/// Helper for array `data` in struct `CXType`. +class ArrayHelper_CXType_data_level0 { final CXType _struct; - final int length; - _ArrayHelper_CXType_data(this._struct, this.length); - void operator []=(int index, ffi.Pointer value) { - switch (index) { - case 0: - _struct._data_item_0 = value; - break; - case 1: - _struct._data_item_1 = value; - break; - case 2: - _struct._data_item_2 = value; - break; - default: - throw RangeError('Index $index must be in the range [0..2].'); + 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) { - switch (index) { + _checkBounds(index); + switch (_absoluteIndex + index) { case 0: return _struct._data_item_0; case 1: return _struct._data_item_1; - case 2: - return _struct._data_item_2; default: - throw RangeError('Index $index must be in the range [0..2].'); + throw Exception('Invalid Array Helper generated.'); } } - @override - String toString() { - if (length == 0) return '[]'; - final sb = StringBuffer('['); - sb.write(this[0]); - for (var i = 1; i < length; i++) { - sb.write(','); - sb.write(this[i]); + void operator []=(int index, ffi.Pointer value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._data_item_0 = value; + break; + case 1: + _struct._data_item_1 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); } - sb.write(']'); - return sb.toString(); } } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index 62803f6491..3afb7b7926 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -21,7 +21,6 @@ Func parseFunctionDeclaration(Pointer cursor) { _func = null; structByValueParameter = false; unimplementedParameterType = false; - constantArrayParameterType = false; final name = cursor.spelling(); if (shouldIncludeFunc(name)) { @@ -39,14 +38,6 @@ Func parseFunctionDeclaration(Pointer cursor) { return null; // Returning null so that [addToBindings] function excludes this. } - if (constantArrayParameterType) { - _logger.fine( - '---- Removed Function, reason: constant array passed to function parameter: ${cursor.completeStringRepr()}'); - _logger.warning( - "Skipped Function '$name', constant array in function parameter not supported."); - return null; // Returning null so that [addToBindings] function excludes this. - } - if (rt.getBaseBroadType() == BroadType.Unimplemented || unimplementedParameterType) { _logger.fine( @@ -68,7 +59,6 @@ Func parseFunctionDeclaration(Pointer cursor) { } bool structByValueParameter = false; -bool constantArrayParameterType = false; bool unimplementedParameterType = false; Type _getFunctionReturnType(Pointer cursor) { return cursor.returnType().toCodeGenTypeAndDispose(); @@ -87,8 +77,6 @@ List _getParameters(Pointer cursor) { //TODO(3): Remove this when support for Structs by value arrives. if (pt.broadType == BroadType.Struct) { structByValueParameter = true; - } else if (pt.broadType == BroadType.ConstantArray) { - constantArrayParameterType = true; } else if (pt.getBaseBroadType() == BroadType.Unimplemented) { unimplementedParameterType = true; } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index 0c9dfa33f3..d7c9dc43e7 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -8,6 +8,7 @@ import 'package:ffigen/src/code_generator.dart'; import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang; +import '../data.dart'; import '../includer.dart'; import '../utils.dart'; @@ -53,6 +54,7 @@ Struc parseStructDeclaration( List _members; List _getMembers(Pointer cursor, String structName) { _members = []; + arrayMember = false; nestedStructMember = false; unimplementedMemberType = false; @@ -65,7 +67,13 @@ List _getMembers(Pointer cursor, String structName) { visitChildrenResultChecker(resultCode); // Returning null to exclude the struct members as it has a struct by value field. - if (nestedStructMember) { + if (arrayMember && !config.arrayWorkaround) { + _logger.fine( + '---- Removed Struct members, reason: struct has array members ${cursor.completeStringRepr()}'); + _logger.warning( + 'Removed All Struct Members from: $structName, Array members not supported'); + return null; + } else if (nestedStructMember) { _logger.fine( '---- Removed Struct members, reason: struct has struct members ${cursor.completeStringRepr()}'); _logger.warning( @@ -84,6 +92,7 @@ List _getMembers(Pointer cursor, String structName) { bool nestedStructMember = false; bool unimplementedMemberType = false; +bool arrayMember = false; /// Visitor for the struct cursor [CXCursorKind.CXCursor_StructDecl]. /// @@ -98,11 +107,14 @@ int _structMembersVisitor(Pointer cursor, //TODO(4): Remove these when support for Structs by value arrives. if (mt.broadType == BroadType.Struct) { - // Setting this flag will exclude adding members for this struct's bindings. + // Setting this flag will exclude adding members for this struct's + // bindings. nestedStructMember = true; } else if (mt.broadType == BroadType.ConstantArray) { - if (mt.elementType.broadType == BroadType.Struct) { - // Setting this flag will exclude adding members for this struct's bindings. + arrayMember = true; + if (mt.child.broadType == BroadType.Struct) { + // Setting this flag will exclude adding members for this struct's + // bindings. nestedStructMember = true; } } diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index db374876f2..9584ceae9a 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -66,6 +66,11 @@ Type getCodeGenType(Pointer cxtype, {String parentName}) { clang.clang_getNumElements_wrap(cxtype), clang.clang_getArrayElementType_wrap(cxtype).toCodeGenTypeAndDispose(), ); + case clang.CXTypeKind + .CXType_IncompleteArray: // Primarily used for incomplete array in function parameters. + return Type.incompleteArray( + clang.clang_getArrayElementType_wrap(cxtype).toCodeGenTypeAndDispose(), + ); default: if (cxTypeKindToSupportedNativeTypes.containsKey(kind)) { return Type.nativeType( diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index fbc4d316bb..c5b7f5fffc 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -129,7 +129,7 @@ Pointer lastCommentRange = nullptr; /// Returns a cursor's associated comment. /// /// The given string is wrapped at line width = 80 - [indent]. The [indent] is -/// [commentPrefix.length] by default because a comment starts with +/// [commentPrefix.dimensions] by default because a comment starts with /// [commentPrefix]. String getCursorDocComment(Pointer cursor, [int indent = commentPrefix.length]) { diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index e96ddc13e2..a03aa97179 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -58,6 +58,7 @@ const sizemap_native_mapping = { const sort = 'sort'; const useSupportedTypedefs = 'use-supported-typedefs'; const warnWhenRemoving = 'warn-when-removing'; +const arrayWorkaround = 'array-workaround'; const comments = 'comments'; // Comment type. diff --git a/pkgs/ffigen/test/native_functions_test/native_functions_test.dart b/pkgs/ffigen/test/native_functions_test/native_functions_test.dart deleted file mode 100644 index b63fc35e4d..0000000000 --- a/pkgs/ffigen/test/native_functions_test/native_functions_test.dart +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'dart:ffi'; -import 'dart:io'; -import 'dart:math'; - -import 'package:test/test.dart'; -import 'native_functions_bindings.dart' as bindings; - -void main() { - group('Tests for native functions', () { - setUpAll(() { - var dylibName = 'test/native_functions_test/native_functions.so'; - if (Platform.isMacOS) { - dylibName = 'test/native_functions_test/native_functions.dylib'; - } else if (Platform.isWindows) { - dylibName = r'test\native_functions_test\native_functions.dll'; - } - bindings.init(DynamicLibrary.open(dylibName)); - }); - test('uint8_t', () { - expect(bindings.Function1Uint8(pow(2, 8).toInt()), 42); - }); - test('uint16_t', () { - expect(bindings.Function1Uint16(pow(2, 16).toInt()), 42); - }); - test('uint32_t', () { - expect(bindings.Function1Uint32(pow(2, 32).toInt()), 42); - }); - test('uint64_t', () { - expect(bindings.Function1Uint64(pow(2, 64).toInt()), 42); - }); - test('int8_t', () { - expect( - bindings.Function1Int8(pow(2, 7).toInt()), -pow(2, 7).toInt() + 42); - }); - test('int16_t', () { - expect(bindings.Function1Int16(pow(2, 15).toInt()), - -pow(2, 15).toInt() + 42); - }); - test('int32_t', () { - expect(bindings.Function1Int32(pow(2, 31).toInt()), - -pow(2, 31).toInt() + 42); - }); - test('int64_t', () { - expect(bindings.Function1Int64(pow(2, 63).toInt()), - -pow(2, 63).toInt() + 42); - }); - test('intptr_t', () { - expect(bindings.Function1IntPtr(0), 42); - }); - test('float', () { - expect(bindings.Function1Float(0), 42.0); - }); - test('double', () { - expect(bindings.Function1Double(0), 42.0); - }); - }); -} diff --git a/pkgs/ffigen/test/native_functions_test/build_test_dylib.dart b/pkgs/ffigen/test/native_test/build_test_dylib.dart similarity index 83% rename from pkgs/ffigen/test/native_functions_test/build_test_dylib.dart rename to pkgs/ffigen/test/native_test/build_test_dylib.dart index 25258f0512..2fd2c49eed 100644 --- a/pkgs/ffigen/test/native_functions_test/build_test_dylib.dart +++ b/pkgs/ffigen/test/native_test/build_test_dylib.dart @@ -10,17 +10,17 @@ /// /// Linux: /// ``` -/// clang -shared -fpic native_functions.c -o native_functions.so +/// clang -shared -fpic native_test.c -o native_test.so /// ``` /// MacOS: /// ``` -/// clang -shared -fpic native_functions.c -o native_functions.dylib +/// clang -shared -fpic native_test.c -o native_test.dylib /// ``` /// Windows: /// ``` -/// call clang -shared native_functions.c -o native_functions.dll -Wl,"/DEF:native_functions.def" -/// del native_functions.exp -/// del native_functions.lib +/// call clang -shared native_test.c -o native_test.dll -Wl,"/DEF:native_test.def" +/// del native_test.exp +/// del native_test.lib /// ``` /// ======================================================================= /// ======================================================================= @@ -36,21 +36,21 @@ const LINUX = 'linux'; Map platformOptions = { LINUX: Options( - outputfilename: 'native_functions.so', + outputfilename: 'native_test.so', sharedFlag: '-shared', - inputHeader: 'native_functions.c', + inputHeader: 'native_test.c', fPIC: '-fpic', ), WINDOWS: Options( - outputfilename: 'native_functions.dll', + outputfilename: 'native_test.dll', sharedFlag: '-shared', - inputHeader: 'native_functions.c', - moduleDefPath: '-Wl,/DEF:native_functions.def', + inputHeader: 'native_test.c', + moduleDefPath: '-Wl,/DEF:native_test.def', ), MACOS: Options( - outputfilename: 'native_functions.dylib', + outputfilename: 'native_test.dylib', sharedFlag: '-shared', - inputHeader: 'native_functions.c', + inputHeader: 'native_test.c', fPIC: '-fpic', ), }; diff --git a/pkgs/ffigen/test/native_functions_test/config.yaml b/pkgs/ffigen/test/native_test/config.yaml similarity index 83% rename from pkgs/ffigen/test/native_functions_test/config.yaml rename to pkgs/ffigen/test/native_test/config.yaml index 3635c709a6..a25821a463 100644 --- a/pkgs/ffigen/test/native_functions_test/config.yaml +++ b/pkgs/ffigen/test/native_test/config.yaml @@ -6,11 +6,12 @@ # dart ../../bin/ffigen.dart --config config.yaml # =============================================================== -output: 'native_functions_bindings.dart' +output: 'native_test_bindings.dart' libclang-dylib-folder: '../../tool/wrapped_libclang' sort: true headers: - - 'native_functions.c' + - 'native_test.c' header-filter: include: - - 'native_functions.c' + - 'native_test.c' +array-workaround: true diff --git a/pkgs/ffigen/test/native_functions_test/native_functions.c b/pkgs/ffigen/test/native_test/native_test.c similarity index 68% rename from pkgs/ffigen/test/native_functions_test/native_functions.c rename to pkgs/ffigen/test/native_test/native_test.c index 544357e3ac..21c2f16f3e 100644 --- a/pkgs/ffigen/test/native_functions_test/native_functions.c +++ b/pkgs/ffigen/test/native_test/native_test.c @@ -1,8 +1,10 @@ // Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +#define aloc(T) ((T *)malloc(sizeof(T))) #include +#include uint8_t Function1Uint8(uint8_t x) { return x + 42; } @@ -25,3 +27,22 @@ intptr_t Function1IntPtr(intptr_t x) { return x + 42; } float Function1Float(float x) { return x + 42.0f; } double Function1Double(double x) { return x + 42.0; } + +struct Struct1 +{ + int8_t a; + int32_t data[3][1][2]; +}; + +struct Struct1 *getStruct1() +{ + struct Struct1 *s = aloc(struct Struct1); + s->a = 0; + s->data[0][0][0] = 1; + s->data[0][0][1] = 2; + s->data[1][0][0] = 3; + s->data[1][0][1] = 4; + s->data[2][0][0] = 5; + s->data[2][0][1] = 6; + return s; +} diff --git a/pkgs/ffigen/test/native_test/native_test.dart b/pkgs/ffigen/test/native_test/native_test.dart new file mode 100644 index 0000000000..cc4fa2282f --- /dev/null +++ b/pkgs/ffigen/test/native_test/native_test.dart @@ -0,0 +1,105 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:ffi'; +import 'dart:io'; +import 'dart:math'; + +import 'package:test/test.dart'; +import 'native_test_bindings.dart' as bindings; + +void main() { + group('Tests for native functions', () { + setUpAll(() { + var dylibName = 'test/native_test/native_test.so'; + if (Platform.isMacOS) { + dylibName = 'test/native_test/native_test.dylib'; + } else if (Platform.isWindows) { + dylibName = r'test\native_test\native_test.dll'; + } + bindings.init(DynamicLibrary.open(dylibName)); + }); + test('uint8_t', () { + expect(bindings.Function1Uint8(pow(2, 8).toInt()), 42); + }); + test('uint16_t', () { + expect(bindings.Function1Uint16(pow(2, 16).toInt()), 42); + }); + test('uint32_t', () { + expect(bindings.Function1Uint32(pow(2, 32).toInt()), 42); + }); + test('uint64_t', () { + expect(bindings.Function1Uint64(pow(2, 64).toInt()), 42); + }); + test('int8_t', () { + expect( + bindings.Function1Int8(pow(2, 7).toInt()), -pow(2, 7).toInt() + 42); + }); + test('int16_t', () { + expect(bindings.Function1Int16(pow(2, 15).toInt()), + -pow(2, 15).toInt() + 42); + }); + test('int32_t', () { + expect(bindings.Function1Int32(pow(2, 31).toInt()), + -pow(2, 31).toInt() + 42); + }); + test('int64_t', () { + expect(bindings.Function1Int64(pow(2, 63).toInt()), + -pow(2, 63).toInt() + 42); + }); + test('intptr_t', () { + expect(bindings.Function1IntPtr(0), 42); + }); + test('float', () { + expect(bindings.Function1Float(0), 42.0); + }); + test('double', () { + expect(bindings.Function1Double(0), 42.0); + }); + test('array-workaround: Order of access', () { + final struct1 = bindings.getStruct1(); + int expectedValue = 1; + for (int i = 0; i < struct1.ref.data.dimensions[0]; i++) { + for (int j = 0; j < struct1.ref.data.dimensions[1]; j++) { + for (int k = 0; k < struct1.ref.data.dimensions[2]; k++) { + expect(struct1.ref.data[i][j][k], expectedValue); + expectedValue++; + } + } + } + }); + test('array-workaround: Range Errors', () { + final struct1 = bindings.getStruct1(); + // Index (get) above range. + expect( + () => struct1.ref.data[4][0][0], throwsA(TypeMatcher())); + expect( + () => struct1.ref.data[0][2][0], throwsA(TypeMatcher())); + expect( + () => struct1.ref.data[0][0][3], throwsA(TypeMatcher())); + // Index (get) below range. + expect( + () => struct1.ref.data[-1][0][0], throwsA(TypeMatcher())); + expect( + () => struct1.ref.data[-1][0][0], throwsA(TypeMatcher())); + expect( + () => struct1.ref.data[0][0][-1], throwsA(TypeMatcher())); + + // Index (set) above range. + expect(() => struct1.ref.data[4][0][0] = 0, + throwsA(TypeMatcher())); + expect(() => struct1.ref.data[0][2][0] = 0, + throwsA(TypeMatcher())); + expect(() => struct1.ref.data[0][0][3] = 0, + throwsA(TypeMatcher())); + // Index (get) below range. + expect(() => struct1.ref.data[-1][0][0] = 0, + throwsA(TypeMatcher())); + expect(() => struct1.ref.data[-1][0][0] = 0, + throwsA(TypeMatcher())); + expect(() => struct1.ref.data[0][0][-1] = 0, + throwsA(TypeMatcher())); + }); + }); +} diff --git a/pkgs/ffigen/test/native_functions_test/native_functions.def b/pkgs/ffigen/test/native_test/native_test.def similarity index 100% rename from pkgs/ffigen/test/native_functions_test/native_functions.def rename to pkgs/ffigen/test/native_test/native_test.def diff --git a/pkgs/ffigen/test/native_functions_test/native_functions_bindings.dart b/pkgs/ffigen/test/native_test/native_test_bindings.dart similarity index 50% rename from pkgs/ffigen/test/native_functions_test/native_functions_bindings.dart rename to pkgs/ffigen/test/native_test/native_test_bindings.dart index a9eb1e9b75..a9c53096af 100644 --- a/pkgs/ffigen/test/native_functions_test/native_functions_bindings.dart +++ b/pkgs/ffigen/test/native_test/native_test_bindings.dart @@ -224,3 +224,153 @@ typedef _c_Function1Uint8 = ffi.Uint8 Function( typedef _dart_Function1Uint8 = int Function( int x, ); + +class Struct1 extends ffi.Struct { + @ffi.Int8() + int a; + + @ffi.Int32() + int _data_item_0; + @ffi.Int32() + int _data_item_1; + @ffi.Int32() + int _data_item_2; + @ffi.Int32() + int _data_item_3; + @ffi.Int32() + int _data_item_4; + @ffi.Int32() + int _data_item_5; + + /// Helper for array `data`. + ArrayHelper_Struct1_data_level0 get data => + ArrayHelper_Struct1_data_level0(this, [3, 1, 2], 0, 0); +} + +/// Helper for array `data` in struct `Struct1`. +class ArrayHelper_Struct1_data_level0 { + final Struct1 _struct; + final List dimensions; + final int level; + final int _absoluteIndex; + int get length => dimensions[level]; + ArrayHelper_Struct1_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.'); + } + } + + ArrayHelper_Struct1_data_level1 operator [](int index) { + _checkBounds(index); + int offset = index; + for (int i = level + 1; i < dimensions.length; i++) { + offset *= dimensions[i]; + } + return ArrayHelper_Struct1_data_level1( + _struct, dimensions, level + 1, _absoluteIndex + offset); + } +} + +/// Helper for array `data` in struct `Struct1`. +class ArrayHelper_Struct1_data_level1 { + final Struct1 _struct; + final List dimensions; + final int level; + final int _absoluteIndex; + int get length => dimensions[level]; + ArrayHelper_Struct1_data_level1( + 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.'); + } + } + + ArrayHelper_Struct1_data_level2 operator [](int index) { + _checkBounds(index); + int offset = index; + for (int i = level + 1; i < dimensions.length; i++) { + offset *= dimensions[i]; + } + return ArrayHelper_Struct1_data_level2( + _struct, dimensions, level + 1, _absoluteIndex + offset); + } +} + +/// Helper for array `data` in struct `Struct1`. +class ArrayHelper_Struct1_data_level2 { + final Struct1 _struct; + final List dimensions; + final int level; + final int _absoluteIndex; + int get length => dimensions[level]; + ArrayHelper_Struct1_data_level2( + 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._data_item_0; + case 1: + return _struct._data_item_1; + case 2: + return _struct._data_item_2; + case 3: + return _struct._data_item_3; + case 4: + return _struct._data_item_4; + case 5: + return _struct._data_item_5; + default: + throw Exception('Invalid Array Helper generated.'); + } + } + + void operator []=(int index, int value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._data_item_0 = value; + break; + case 1: + _struct._data_item_1 = value; + break; + case 2: + _struct._data_item_2 = value; + break; + case 3: + _struct._data_item_3 = value; + break; + case 4: + _struct._data_item_4 = value; + break; + case 5: + _struct._data_item_5 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); + } + } +} + +ffi.Pointer getStruct1() { + return _getStruct1(); +} + +final _dart_getStruct1 _getStruct1 = + _dylib.lookupFunction<_c_getStruct1, _dart_getStruct1>('getStruct1'); + +typedef _c_getStruct1 = ffi.Pointer Function(); + +typedef _dart_getStruct1 = ffi.Pointer Function(); diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index 3fe9bb2792..9401a00d38 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -21,6 +21,8 @@ header-filter: - Index.h - CXString.h +array-workaround: true + enums: include: names: From d3c91ade756f0fb066f6694a16dc58125021e15e Mon Sep 17 00:00:00 2001 From: Prerak Mann <31154435+mannprerak2@users.noreply.github.com> Date: Wed, 8 Jul 2020 17:57:44 +0530 Subject: [PATCH 010/276] [ffigen] Support for Prefix and Names in config. (#20) - Support for global prefix and prefix replacement in functions/structs/enums - Handles all internal name collisions (such as those between - dylib identifier, ffi import prefix, any typedefs generated, array helper classes, expanded array items, declarations, init function) if a collision occurs its suffixed by `_cr` - Added tests for prefixing and collisions --- .../c_json/cjson_generated_bindings.dart | 12 +- .../libclang-example/generated_bindings.dart | 272 +++++++------- .../example/libclang-example/pubspec.yaml | 9 + .../example/simple/generated_bindings.dart | 4 +- pkgs/ffigen/lib/src/code_generator.dart | 2 +- .../lib/src/code_generator/binding.dart | 4 +- .../lib/src/code_generator/constant.dart | 5 +- .../lib/src/code_generator/enum_class.dart | 12 +- pkgs/ffigen/lib/src/code_generator/func.dart | 26 +- .../ffigen/lib/src/code_generator/global.dart | 8 +- .../lib/src/code_generator/library.dart | 53 +-- pkgs/ffigen/lib/src/code_generator/struc.dart | 53 ++- pkgs/ffigen/lib/src/code_generator/type.dart | 43 +-- .../{typedef.dart => typedefc.dart} | 24 +- pkgs/ffigen/lib/src/code_generator/utils.dart | 37 ++ .../ffigen/lib/src/code_generator/writer.dart | 57 ++- .../lib/src/config_provider/config.dart | 115 +++--- .../{filter.dart => declaration.dart} | 63 +++- .../lib/src/config_provider/spec_utils.dart | 51 ++- .../clang_bindings/clang_bindings.dart | 76 ++-- .../lib/src/header_parser/includer.dart | 84 +++-- pkgs/ffigen/lib/src/header_parser/parser.dart | 8 +- .../sub_parsers/enumdecl_parser.dart | 8 +- .../sub_parsers/functiondecl_parser.dart | 19 +- .../sub_parsers/structdecl_parser.dart | 29 +- .../sub_parsers/typedefdecl_parser.dart | 2 +- .../translation_unit_parser.dart | 2 +- .../type_extractor/extractor.dart | 57 +-- pkgs/ffigen/lib/src/strings.dart | 6 + pkgs/ffigen/test/code_generator_test.dart | 337 ++++++++++++------ .../decl_decl_collision_test.dart | 29 ++ .../header_parser_tests/functions_test.dart | 48 ++- pkgs/ffigen/test/prefix_tests/prefix.h | 26 ++ .../ffigen/test/prefix_tests/prefix_test.dart | 150 ++++++++ 34 files changed, 1159 insertions(+), 572 deletions(-) rename pkgs/ffigen/lib/src/code_generator/{typedef.dart => typedefc.dart} (71%) create mode 100644 pkgs/ffigen/lib/src/code_generator/utils.dart rename pkgs/ffigen/lib/src/config_provider/{filter.dart => declaration.dart} (55%) create mode 100644 pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart create mode 100644 pkgs/ffigen/test/prefix_tests/prefix.h create mode 100644 pkgs/ffigen/test/prefix_tests/prefix_test.dart diff --git a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart index 1cf00a3d90..e26ed6a477 100644 --- a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart +++ b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart @@ -7,8 +7,8 @@ import 'dart:ffi' as ffi; ffi.DynamicLibrary _dylib; /// Initialises the Dynamic library. -void init(ffi.DynamicLibrary dylib) { - _dylib = dylib; +void init(ffi.DynamicLibrary dynamicLibrary) { + _dylib = dynamicLibrary; } class cJSON extends ffi.Struct { @@ -32,18 +32,18 @@ class cJSON extends ffi.Struct { ffi.Pointer string; } -typedef _typedefC_noname_1 = ffi.Pointer Function( +typedef _typedefC_1 = ffi.Pointer Function( ffi.Uint64, ); -typedef _typedefC_noname_2 = ffi.Void Function( +typedef _typedefC_2 = ffi.Void Function( ffi.Pointer, ); class cJSON_Hooks extends ffi.Struct { - ffi.Pointer> malloc_fn; + ffi.Pointer> malloc_fn; - ffi.Pointer> free_fn; + ffi.Pointer> free_fn; } ffi.Pointer cJSON_Version() { diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index 4fbfac37dd..6a0d1d3dbb 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -1,14 +1,15 @@ /// AUTO GENERATED FILE, DO NOT EDIT. /// /// Generated by `package:ffigen`. + import 'dart:ffi' as ffi; /// Holds the Dynamic library. ffi.DynamicLibrary _dylib; /// Initialises the Dynamic library. -void init(ffi.DynamicLibrary dylib) { - _dylib = dylib; +void init(ffi.DynamicLibrary dynamicLibrary) { + _dylib = dynamicLibrary; } /// Contains the results of code-completion. @@ -67,9 +68,9 @@ class CXCursor extends ffi.Struct { @ffi.Int32() int xdata; - ffi.Pointer _data_item_0; - ffi.Pointer _data_item_1; - ffi.Pointer _data_item_2; + ffi.Pointer _exp_workaround_data_item_0; + ffi.Pointer _exp_workaround_data_item_1; + ffi.Pointer _exp_workaround_data_item_2; /// Helper for array `data`. ArrayHelper_CXCursor_data_level0 get data => @@ -96,11 +97,11 @@ class ArrayHelper_CXCursor_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - return _struct._data_item_0; + return _struct._exp_workaround_data_item_0; case 1: - return _struct._data_item_1; + return _struct._exp_workaround_data_item_1; case 2: - return _struct._data_item_2; + return _struct._exp_workaround_data_item_2; default: throw Exception('Invalid Array Helper generated.'); } @@ -110,13 +111,13 @@ class ArrayHelper_CXCursor_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - _struct._data_item_0 = value; + _struct._exp_workaround_data_item_0 = value; break; case 1: - _struct._data_item_1 = value; + _struct._exp_workaround_data_item_1 = value; break; case 2: - _struct._data_item_2 = value; + _struct._exp_workaround_data_item_2 = value; break; default: throw Exception('Invalid Array Helper generated.'); @@ -124,34 +125,19 @@ class ArrayHelper_CXCursor_data_level0 { } } -class CXCursorAndRangeVisitor extends ffi.Struct { - ffi.Pointer context; - - ffi.Pointer> visit; -} +class CXCursorAndRangeVisitor extends ffi.Struct {} class CXCursorSetImpl extends ffi.Struct {} -typedef CXCursorVisitor = ffi.Int32 Function( - CXCursor, - CXCursor, - ffi.Pointer, -); - -typedef CXFieldVisitor = ffi.Int32 Function( - CXCursor, - ffi.Pointer, -); - /// Uniquely identifies a CXFile, that refers to the same underlying file, /// across an indexing session. class CXFileUniqueID extends ffi.Struct { @ffi.Uint64() - int _data_item_0; + int _exp_workaround_data_item_0; @ffi.Uint64() - int _data_item_1; + int _exp_workaround_data_item_1; @ffi.Uint64() - int _data_item_2; + int _exp_workaround_data_item_2; /// Helper for array `data`. ArrayHelper_CXFileUniqueID_data_level0 get data => @@ -178,11 +164,11 @@ class ArrayHelper_CXFileUniqueID_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - return _struct._data_item_0; + return _struct._exp_workaround_data_item_0; case 1: - return _struct._data_item_1; + return _struct._exp_workaround_data_item_1; case 2: - return _struct._data_item_2; + return _struct._exp_workaround_data_item_2; default: throw Exception('Invalid Array Helper generated.'); } @@ -192,13 +178,13 @@ class ArrayHelper_CXFileUniqueID_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - _struct._data_item_0 = value; + _struct._exp_workaround_data_item_0 = value; break; case 1: - _struct._data_item_1 = value; + _struct._exp_workaround_data_item_1 = value; break; case 2: - _struct._data_item_2 = value; + _struct._exp_workaround_data_item_2 = value; break; default: throw Exception('Invalid Array Helper generated.'); @@ -261,8 +247,8 @@ class CXIdxIncludedFileInfo extends ffi.Struct {} /// Source location passed to index callbacks. class CXIdxLoc extends ffi.Struct { - ffi.Pointer _ptr_data_item_0; - ffi.Pointer _ptr_data_item_1; + ffi.Pointer _exp_workaround_ptr_data_item_0; + ffi.Pointer _exp_workaround_ptr_data_item_1; /// Helper for array `ptr_data`. ArrayHelper_CXIdxLoc_ptr_data_level0 get ptr_data => @@ -291,9 +277,9 @@ class ArrayHelper_CXIdxLoc_ptr_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - return _struct._ptr_data_item_0; + return _struct._exp_workaround_ptr_data_item_0; case 1: - return _struct._ptr_data_item_1; + return _struct._exp_workaround_ptr_data_item_1; default: throw Exception('Invalid Array Helper generated.'); } @@ -303,10 +289,10 @@ class ArrayHelper_CXIdxLoc_ptr_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - _struct._ptr_data_item_0 = value; + _struct._exp_workaround_ptr_data_item_0 = value; break; case 1: - _struct._ptr_data_item_1 = value; + _struct._exp_workaround_ptr_data_item_1 = value; break; default: throw Exception('Invalid Array Helper generated.'); @@ -348,13 +334,6 @@ class CXIdxObjCProtocolRefListInfo extends ffi.Struct { int numProtocols; } -typedef CXInclusionVisitor = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Uint32, - ffi.Pointer, -); - /// 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 {} @@ -365,8 +344,8 @@ class CXPlatformAvailability extends ffi.Struct {} /// Use clang_getExpansionLocation() or clang_getSpellingLocation() /// to map a source location to a particular file, line, and column. class CXSourceLocation extends ffi.Struct { - ffi.Pointer _ptr_data_item_0; - ffi.Pointer _ptr_data_item_1; + ffi.Pointer _exp_workaround_ptr_data_item_0; + ffi.Pointer _exp_workaround_ptr_data_item_1; /// Helper for array `ptr_data`. ArrayHelper_CXSourceLocation_ptr_data_level0 get ptr_data => @@ -395,9 +374,9 @@ class ArrayHelper_CXSourceLocation_ptr_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - return _struct._ptr_data_item_0; + return _struct._exp_workaround_ptr_data_item_0; case 1: - return _struct._ptr_data_item_1; + return _struct._exp_workaround_ptr_data_item_1; default: throw Exception('Invalid Array Helper generated.'); } @@ -407,10 +386,10 @@ class ArrayHelper_CXSourceLocation_ptr_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - _struct._ptr_data_item_0 = value; + _struct._exp_workaround_ptr_data_item_0 = value; break; case 1: - _struct._ptr_data_item_1 = value; + _struct._exp_workaround_ptr_data_item_1 = value; break; default: throw Exception('Invalid Array Helper generated.'); @@ -423,8 +402,8 @@ class ArrayHelper_CXSourceLocation_ptr_data_level0 { /// Use clang_getRangeStart() and clang_getRangeEnd() to retrieve the /// starting and end locations from a source range, respectively. class CXSourceRange extends ffi.Struct { - ffi.Pointer _ptr_data_item_0; - ffi.Pointer _ptr_data_item_1; + ffi.Pointer _exp_workaround_ptr_data_item_0; + ffi.Pointer _exp_workaround_ptr_data_item_1; /// Helper for array `ptr_data`. ArrayHelper_CXSourceRange_ptr_data_level0 get ptr_data => @@ -456,9 +435,9 @@ class ArrayHelper_CXSourceRange_ptr_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - return _struct._ptr_data_item_0; + return _struct._exp_workaround_ptr_data_item_0; case 1: - return _struct._ptr_data_item_1; + return _struct._exp_workaround_ptr_data_item_1; default: throw Exception('Invalid Array Helper generated.'); } @@ -468,10 +447,10 @@ class ArrayHelper_CXSourceRange_ptr_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - _struct._ptr_data_item_0 = value; + _struct._exp_workaround_ptr_data_item_0 = value; break; case 1: - _struct._ptr_data_item_1 = value; + _struct._exp_workaround_ptr_data_item_1 = value; break; default: throw Exception('Invalid Array Helper generated.'); @@ -532,13 +511,13 @@ class CXTargetInfoImpl extends ffi.Struct {} /// Describes a single preprocessing token. class CXToken extends ffi.Struct { @ffi.Uint32() - int _int_data_item_0; + int _exp_workaround_int_data_item_0; @ffi.Uint32() - int _int_data_item_1; + int _exp_workaround_int_data_item_1; @ffi.Uint32() - int _int_data_item_2; + int _exp_workaround_int_data_item_2; @ffi.Uint32() - int _int_data_item_3; + int _exp_workaround_int_data_item_3; /// Helper for array `int_data`. ArrayHelper_CXToken_int_data_level0 get int_data => @@ -566,13 +545,13 @@ class ArrayHelper_CXToken_int_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - return _struct._int_data_item_0; + return _struct._exp_workaround_int_data_item_0; case 1: - return _struct._int_data_item_1; + return _struct._exp_workaround_int_data_item_1; case 2: - return _struct._int_data_item_2; + return _struct._exp_workaround_int_data_item_2; case 3: - return _struct._int_data_item_3; + return _struct._exp_workaround_int_data_item_3; default: throw Exception('Invalid Array Helper generated.'); } @@ -582,16 +561,16 @@ class ArrayHelper_CXToken_int_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - _struct._int_data_item_0 = value; + _struct._exp_workaround_int_data_item_0 = value; break; case 1: - _struct._int_data_item_1 = value; + _struct._exp_workaround_int_data_item_1 = value; break; case 2: - _struct._int_data_item_2 = value; + _struct._exp_workaround_int_data_item_2 = value; break; case 3: - _struct._int_data_item_3 = value; + _struct._exp_workaround_int_data_item_3 = value; break; default: throw Exception('Invalid Array Helper generated.'); @@ -606,8 +585,8 @@ class CXType extends ffi.Struct { @ffi.Int32() int kind; - ffi.Pointer _data_item_0; - ffi.Pointer _data_item_1; + ffi.Pointer _exp_workaround_data_item_0; + ffi.Pointer _exp_workaround_data_item_1; /// Helper for array `data`. ArrayHelper_CXType_data_level0 get data => @@ -634,9 +613,9 @@ class ArrayHelper_CXType_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - return _struct._data_item_0; + return _struct._exp_workaround_data_item_0; case 1: - return _struct._data_item_1; + return _struct._exp_workaround_data_item_1; default: throw Exception('Invalid Array Helper generated.'); } @@ -646,10 +625,10 @@ class ArrayHelper_CXType_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - _struct._data_item_0 = value; + _struct._exp_workaround_data_item_0 = value; break; case 1: - _struct._data_item_1 = value; + _struct._exp_workaround_data_item_1 = value; break; default: throw Exception('Invalid Array Helper generated.'); @@ -828,94 +807,78 @@ class CXVersion extends ffi.Struct { /// 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. - ffi.Pointer> abortQuery; - - /// Called at the end of indexing; passes the complete diagnostic set. - ffi.Pointer> diagnostic; - - ffi.Pointer> enteredMainFile; - - /// Called when a file gets \#included/\#imported. - 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. - ffi.Pointer> importedASTFile; - - /// Called at the beginning of indexing a translation unit. - ffi.Pointer> startedTranslationUnit; - - ffi.Pointer> indexDeclaration; - - /// Called to index a reference of an entity. - ffi.Pointer> indexEntityReference; -} - -typedef ModifiedCXCursorVisitor = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_noname_1 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_noname_10 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_noname_2 = ffi.Int32 Function( - ffi.Pointer, - CXCursor, - CXSourceRange, -); - -typedef _typedefC_noname_3 = ffi.Int32 Function( +typedef _typedefC_3 = ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_noname_4 = ffi.Void Function( +typedef _typedefC_4 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_noname_5 = ffi.Pointer Function( +typedef _typedefC_5 = ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_noname_6 = ffi.Pointer Function( +typedef _typedefC_6 = ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_noname_7 = ffi.Pointer Function( +typedef _typedefC_7 = ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_noname_8 = ffi.Pointer Function( +typedef _typedefC_8 = ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_noname_9 = ffi.Void Function( +typedef _typedefC_9 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ); +typedef _typedefC_10 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, +); + +class IndexerCallbacks extends ffi.Struct { + /// Called periodically to check whether indexing should be aborted. + /// Should return 0 to continue, and non-zero to abort. + ffi.Pointer> abortQuery; + + /// Called at the end of indexing; passes the complete diagnostic set. + ffi.Pointer> diagnostic; + + ffi.Pointer> enteredMainFile; + + /// Called when a file gets \#included/\#imported. + 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. + ffi.Pointer> importedASTFile; + + /// Called at the beginning of indexing a translation unit. + ffi.Pointer> startedTranslationUnit; + + ffi.Pointer> indexDeclaration; + + /// Called to index a reference of an entity. + ffi.Pointer> indexEntityReference; +} + /// Gets the general options associated with a CXIndex. /// /// \returns A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags that @@ -2582,8 +2545,12 @@ typedef _dart_clang_equalRanges_wrap = int Function( ffi.Pointer c2, ); +typedef _typedefC_1 = ffi.Void Function( + ffi.Pointer, +); + void clang_executeOnThread( - ffi.Pointer> fn, + ffi.Pointer> fn, ffi.Pointer user_data, int stack_size, ) { @@ -2599,13 +2566,13 @@ final _dart_clang_executeOnThread _clang_executeOnThread = _dylib 'clang_executeOnThread'); typedef _c_clang_executeOnThread = ffi.Void Function( - ffi.Pointer> fn, + ffi.Pointer> fn, ffi.Pointer user_data, ffi.Uint32 stack_size, ); typedef _dart_clang_executeOnThread = void Function( - ffi.Pointer> fn, + ffi.Pointer> fn, ffi.Pointer user_data, int stack_size, ); @@ -3438,13 +3405,20 @@ typedef _dart_clang_getFileUniqueID = int Function( ffi.Pointer outID, ); +typedef CXInclusionVisitor_1 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Uint32, + ffi.Pointer, +); + /// 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> visitor, ffi.Pointer client_data, ) { return _clang_getInclusions( @@ -3460,13 +3434,13 @@ final _dart_clang_getInclusions _clang_getInclusions = typedef _c_clang_getInclusions = ffi.Void Function( ffi.Pointer tu, - ffi.Pointer> visitor, + ffi.Pointer> visitor, ffi.Pointer client_data, ); typedef _dart_clang_getInclusions = void Function( ffi.Pointer tu, - ffi.Pointer> visitor, + ffi.Pointer> visitor, ffi.Pointer client_data, ); @@ -5112,11 +5086,17 @@ typedef _dart_clang_toggleCrashRecovery = void Function( int isEnabled, ); +typedef ModifiedCXCursorVisitor_1 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, +); + /// Visitor is a function pointer with parameters having pointers to cxcursor /// instead of cxcursor by default. int clang_visitChildren_wrap( ffi.Pointer parent, - ffi.Pointer> _modifiedVisitor, + ffi.Pointer> _modifiedVisitor, ffi.Pointer clientData, ) { return _clang_visitChildren_wrap( @@ -5132,12 +5112,12 @@ final _dart_clang_visitChildren_wrap _clang_visitChildren_wrap = typedef _c_clang_visitChildren_wrap = ffi.Uint32 Function( ffi.Pointer parent, - ffi.Pointer> _modifiedVisitor, + ffi.Pointer> _modifiedVisitor, ffi.Pointer clientData, ); typedef _dart_clang_visitChildren_wrap = int Function( ffi.Pointer parent, - ffi.Pointer> _modifiedVisitor, + ffi.Pointer> _modifiedVisitor, ffi.Pointer clientData, ); diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index 832f111d72..c29adb8765 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -59,8 +59,17 @@ ffigen: unsigned long long: 8 enum: 4 + # Default is 'init' + init-function-name: init + # False by default. array-workaround: true + # The header of the file, this is pasted as it is. + preamble: | + /// AUTO GENERATED FILE, DO NOT EDIT. + /// + /// Generated by `package:ffigen`. + # Doc Comments for generated binings: Can be full, brief(default) or none. comments: full diff --git a/pkgs/ffigen/example/simple/generated_bindings.dart b/pkgs/ffigen/example/simple/generated_bindings.dart index 6e3a97b87e..54409b1380 100644 --- a/pkgs/ffigen/example/simple/generated_bindings.dart +++ b/pkgs/ffigen/example/simple/generated_bindings.dart @@ -7,8 +7,8 @@ import 'dart:ffi' as ffi; ffi.DynamicLibrary _dylib; /// Initialises the Dynamic library. -void init(ffi.DynamicLibrary dylib) { - _dylib = dylib; +void init(ffi.DynamicLibrary dynamicLibrary) { + _dylib = dynamicLibrary; } /// Adds 2 integers. diff --git a/pkgs/ffigen/lib/src/code_generator.dart b/pkgs/ffigen/lib/src/code_generator.dart index 9eb01b641f..9af6dbefbf 100644 --- a/pkgs/ffigen/lib/src/code_generator.dart +++ b/pkgs/ffigen/lib/src/code_generator.dart @@ -13,5 +13,5 @@ export 'code_generator/global.dart'; export 'code_generator/library.dart'; export 'code_generator/struc.dart'; export 'code_generator/type.dart'; -export 'code_generator/typedef.dart'; +export 'code_generator/typedefc.dart'; diff --git a/pkgs/ffigen/lib/src/code_generator/binding.dart b/pkgs/ffigen/lib/src/code_generator/binding.dart index 127c0d25f1..f37c72c3bd 100644 --- a/pkgs/ffigen/lib/src/code_generator/binding.dart +++ b/pkgs/ffigen/lib/src/code_generator/binding.dart @@ -9,11 +9,11 @@ import 'writer.dart'; /// Base class for all Bindings. abstract class Binding { - final String name; + String name; final String dartDoc; - const Binding({@required this.name, this.dartDoc}); + Binding({@required this.name, this.dartDoc}); /// Converts a Binding to its actual string representation. BindingString toBindingString(Writer w); diff --git a/pkgs/ffigen/lib/src/code_generator/constant.dart b/pkgs/ffigen/lib/src/code_generator/constant.dart index bef22d8db6..dd5c6570fb 100644 --- a/pkgs/ffigen/lib/src/code_generator/constant.dart +++ b/pkgs/ffigen/lib/src/code_generator/constant.dart @@ -28,7 +28,7 @@ class Constant extends Binding { /// Put quotes if type is a string. final String rawValue; - const Constant({ + Constant({ @required String name, String dartDoc, @required this.type, @@ -38,6 +38,7 @@ class Constant extends Binding { @override BindingString toBindingString(Writer w) { final s = StringBuffer(); + final constantName = name; if (dartDoc != null) { s.write('/// '); @@ -45,7 +46,7 @@ class Constant extends Binding { s.write('\n'); } - s.write('const ${type.getDartType(w)} $name = $rawValue;\n\n'); + s.write('const ${type.getDartType(w)} $constantName = $rawValue;\n\n'); return BindingString( type: BindingStringType.constant, string: s.toString()); diff --git a/pkgs/ffigen/lib/src/code_generator/enum_class.dart b/pkgs/ffigen/lib/src/code_generator/enum_class.dart index 90faf5bef3..1baea1884f 100644 --- a/pkgs/ffigen/lib/src/code_generator/enum_class.dart +++ b/pkgs/ffigen/lib/src/code_generator/enum_class.dart @@ -6,6 +6,7 @@ import 'package:meta/meta.dart'; import 'binding.dart'; import 'binding_string.dart'; +import 'utils.dart'; import 'writer.dart'; /// A binding for enums in C. @@ -35,6 +36,7 @@ class EnumClass extends Binding { @override BindingString toBindingString(Writer w) { final s = StringBuffer(); + final enclosingClassName = name; if (dartDoc != null) { s.write('/// '); @@ -42,16 +44,22 @@ class EnumClass extends Binding { s.write('\n'); } + /// Adding [enclosingClassName] because dart doesn't allow class member + /// to have the same name as the class. + final localUniqueNamer = UniqueNamer({enclosingClassName}); + // Print enclosing class. - s.write('class $name {\n'); + s.write('class $enclosingClassName {\n'); const depth = ' '; for (final ec in enumConstants) { + final enum_value_name = + localUniqueNamer.makeUnique(ec.name); if (ec.dartDoc != null) { s.write(depth + '/// '); s.writeAll(ec.dartDoc.split('\n'), '\n' + depth + '/// '); s.write('\n'); } - s.write(depth + 'static const int ${ec.name} = ${ec.value};\n'); + s.write(depth + 'static const int ${enum_value_name} = ${ec.value};\n'); } s.write('}\n\n'); diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index 688c573cb3..ffc1509ea4 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -28,15 +28,19 @@ import 'writer.dart'; /// typedef _dart_sum = int Function(int a, int b); /// ``` class Func extends Binding { + final String lookupSymbolName; final Type returnType; final List parameters; + /// [lookupSymbolName], if not provided, takes the value of [name]. Func({ @required String name, + String lookupSymbolName, String dartDoc, @required this.returnType, List parameters, }) : parameters = parameters ?? [], + lookupSymbolName = lookupSymbolName ?? name, super(name: name, dartDoc: dartDoc) { for (var i = 0; i < this.parameters.length; i++) { if (this.parameters[i].name == null || @@ -49,10 +53,22 @@ class Func extends Binding { @override BindingString toBindingString(Writer w) { final s = StringBuffer(); + final enclosingFuncName = name; - final funcVarName = '_$name'; - final typedefC = '_c_$name'; - final typedefDart = '_dart_$name'; + // Ensure name conflicts are resolved for typedefs generated. + final funcVarName = w.uniqueNamer.makeUnique('_$name'); + final typedefC = w.uniqueNamer.makeUnique('_c_$name'); + final typedefDart = w.uniqueNamer.makeUnique('_dart_$name'); + + // Write typedef's required by parameters and resolve name conflicts. + for (final p in parameters) { + final base = p.type.getBaseType(); + if (base.broadType == BroadType.NativeFunction) { + base.nativeFunc.name = + w.uniqueNamer.makeUnique(base.nativeFunc.name); + s.write(base.nativeFunc.toTypedefString(w)); + } + } if (dartDoc != null) { s.write('/// '); @@ -61,7 +77,7 @@ class Func extends Binding { } // Write enclosing function. - s.write('${returnType.getDartType(w)} $name(\n'); + s.write('${returnType.getDartType(w)} $enclosingFuncName(\n'); for (final p in parameters) { s.write(' ${p.type.getDartType(w)} ${p.name},\n'); } @@ -75,7 +91,7 @@ class Func extends Binding { // Write function with dylib lookup. s.write( - "final $typedefDart $funcVarName = ${w.dylibIdentifier}.lookupFunction<$typedefC,$typedefDart>('$name');\n\n"); + "final $typedefDart $funcVarName = ${w.dylibIdentifier}.lookupFunction<$typedefC,$typedefDart>('$lookupSymbolName');\n\n"); // Write typdef for C. s.write('typedef $typedefC = ${returnType.getCType(w)} Function(\n'); diff --git a/pkgs/ffigen/lib/src/code_generator/global.dart b/pkgs/ffigen/lib/src/code_generator/global.dart index 8729785f21..2e41d82215 100644 --- a/pkgs/ffigen/lib/src/code_generator/global.dart +++ b/pkgs/ffigen/lib/src/code_generator/global.dart @@ -20,10 +20,12 @@ import 'writer.dart'; /// final int a = _dylib.lookup('a').value; /// ``` class Global extends Binding { + final String lookupSymbolName; final Type type; - const Global({ + Global({ @required String name, + @required this.lookupSymbolName, @required this.type, String dartDoc, }) : super(name: name, dartDoc: dartDoc); @@ -31,7 +33,7 @@ class Global extends Binding { @override BindingString toBindingString(Writer w) { final s = StringBuffer(); - + final globalVarName = name; if (dartDoc != null) { s.write('/// '); s.writeAll(dartDoc.split('\n'), '\n/// '); @@ -39,7 +41,7 @@ class Global extends Binding { } s.write( - "final ${type.getDartType(w)} $name = ${w.dylibIdentifier}.lookup<${type.getCType(w)}>('$name').value;\n\n"); + "final ${type.getDartType(w)} $globalVarName = ${w.dylibIdentifier}.lookup<${type.getCType(w)}>('$lookupSymbolName').value;\n\n"); return BindingString(type: BindingStringType.global, string: s.toString()); } diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index 8ae4a06ebb..027c1f1316 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -8,33 +8,46 @@ import 'package:logging/logging.dart'; import 'package:meta/meta.dart'; import 'binding.dart'; +import 'utils.dart'; import 'writer.dart'; -var _logger = Logger('code_generator'); +var _logger = Logger('code_generator:library.dart'); /// Container for all Bindings. class Library { - /// Variable identifier used for dynamicLibrary. Defaults to `_dylib`, - final String dylibIdentifier; - - /// Init function for providing dynamic library. Defaults to `init`, - /// - /// Can be renamed in case of name conflicts with something else. - final String initFunctionIdentifier; - - /// Header of file. - final String header; - /// List of bindings in this library. final List bindings; + Writer _writer; + Writer get writer => _writer; + Library({ @required this.bindings, - this.dylibIdentifier = '_dylib', - this.initFunctionIdentifier = 'init', - this.header, - }) : assert(dylibIdentifier != null), - assert(initFunctionIdentifier != null); + String header, + String initFunctionIdentifier = 'init', + }) { + // Handle any declaration-declaration name conflict. + final declConflictHandler = UniqueNamer({}); + for (final b in bindings) { + // Print warning if name was conflicting and has been changed. + if (declConflictHandler.isUsed(b.name)) { + final oldName = b.name; + b.name = declConflictHandler.makeUnique(b.name); + + _logger.warning( + "Resolved name conflict: Declaration '$oldName' and has been renamed to '${b.name}'."); + } else { + declConflictHandler.markUsed(b.name); + } + } + + final declarationNames = bindings.map((e) => e.name).toSet(); + _writer = Writer( + usedUpNames: declarationNames, + initFunctionIdentifier: initFunctionIdentifier, + header: header, + ); + } /// Sort all bindings in alphabetical order. void sort() { @@ -53,7 +66,6 @@ class Library { /// Generates bindings and stores it in given [Writer]. void _generate(Writer w) { - w.header = header; for (final b in bindings) { w.addBindingString(b.toBindingString(w)); } @@ -70,10 +82,7 @@ class Library { /// Generates the bindings. String generate() { - final w = Writer( - dylibIdentifier: dylibIdentifier, - initFunctionIdentifier: initFunctionIdentifier, - ); + final w = writer; _generate(w); return w.generate(); } diff --git a/pkgs/ffigen/lib/src/code_generator/struc.dart b/pkgs/ffigen/lib/src/code_generator/struc.dart index 5e2db56c56..949c239bf6 100644 --- a/pkgs/ffigen/lib/src/code_generator/struc.dart +++ b/pkgs/ffigen/lib/src/code_generator/struc.dart @@ -7,6 +7,7 @@ import 'package:meta/meta.dart'; import 'binding.dart'; import 'binding_string.dart'; import 'type.dart'; +import 'utils.dart'; import 'writer.dart'; /// A binding for C Struct. @@ -34,7 +35,7 @@ import 'writer.dart'; /// } /// ``` class Struc extends Binding { - final List members; + List members; Struc({ @required String name, @@ -55,8 +56,9 @@ class Struc extends Binding { @override BindingString toBindingString(Writer w) { + members = members ?? []; final s = StringBuffer(); - + final enclosingClassName = name; if (dartDoc != null) { s.write('/// '); s.writeAll(dartDoc.split('\n'), '\n/// '); @@ -65,18 +67,37 @@ class Struc extends Binding { final helpers = []; + // Write typedef's required by members and resolve name conflicts. + for (final m in members) { + final base = m.type.getBaseType(); + if (base.broadType == BroadType.NativeFunction) { + base.nativeFunc.name = + w.uniqueNamer.makeUnique(base.nativeFunc.name); + s.write(base.nativeFunc.toTypedefString(w)); + } + } + + final expandedArrayItemPrefix = getUniqueExpandedArrayItemPrefix(); + + /// Adding [enclosingClassName] because dart doesn't allow class member + /// to have the same name as the class. + final localUniqueNamer = UniqueNamer({enclosingClassName}); + // Write class declaration. - s.write('class $name extends ${w.ffiLibraryPrefix}.Struct{\n'); + s.write( + 'class $enclosingClassName extends ${w.ffiLibraryPrefix}.Struct{\n'); for (final m in members) { + final memberName = localUniqueNamer.makeUnique(m.name); if (m.type.broadType == BroadType.ConstantArray) { // TODO(5): Remove array helpers when inline array support arives. final arrayHelper = ArrayHelper( - helperClassGroupName: 'ArrayHelper_${name}_${m.name}', + helperClassGroupName: + '${w.arrayHelperClassPrefix}_${enclosingClassName}_${memberName}', elementType: m.type.getBaseArrayType(), dimensions: _getArrayDimensionLengths(m.type), - name: m.name, - structName: name, - elementNamePrefix: '_${m.name}_item_', + name: memberName, + structName: enclosingClassName, + elementNamePrefix: '${expandedArrayItemPrefix}${memberName}_item_', ); s.write(arrayHelper.declarationString(w)); helpers.add(arrayHelper); @@ -90,7 +111,7 @@ class Struc extends Binding { if (m.type.isPrimitive) { s.write('$depth@${m.type.getCType(w)}()\n'); } - s.write('$depth${m.type.getDartType(w)} ${m.name};\n\n'); + s.write('$depth${m.type.getDartType(w)} ${memberName};\n\n'); } } s.write('}\n\n'); @@ -101,6 +122,22 @@ class Struc extends Binding { return BindingString(type: BindingStringType.struc, string: s.toString()); } + + /// Gets a unique prefix in local namespace for expanded array items. + String getUniqueExpandedArrayItemPrefix() { + final base = '_unique'; + String expandedArrayItemPrefix = base; + int suffixInt = 0; + for (int i = 0; i < members.length; i++) { + if (members[i].name.startsWith(expandedArrayItemPrefix)) { + // Not a unique prefix, start over with a new suffix. + i = -1; + suffixInt++; + expandedArrayItemPrefix = '${base}${suffixInt}'; + } + } + return expandedArrayItemPrefix + '_'; + } } class Member { diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index dccdec38d5..a07b776879 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -4,6 +4,8 @@ import 'package:meta/meta.dart'; +import 'struc.dart'; +import 'typedefc.dart'; import 'writer.dart'; class _SubType { @@ -62,11 +64,11 @@ class Type { SupportedNativeType.IntPtr: _SubType(c: 'IntPtr', dart: 'int'), }; - /// For providing name of Struct. - String structName; + /// Reference to the [Struc] binding this type refers to. + Struc struc; - /// For providing name of nativeFunc. - String nativeFuncName; + /// Reference to the [TypedefC] this type refers to. + TypedefC nativeFunc; /// For providing [SupportedNativeType] only. final SupportedNativeType nativeType; @@ -86,9 +88,9 @@ class Type { Type._({ @required this.broadType, this.child, - this.structName, + this.struc, this.nativeType, - this.nativeFuncName, + this.nativeFunc, this.length, this.unimplementedReason, }); @@ -96,12 +98,11 @@ class Type { factory Type.pointer(Type child) { return Type._(broadType: BroadType.Pointer, child: child); } - factory Type.struct(String structName) { - return Type._(broadType: BroadType.Struct, structName: structName); + factory Type.struct(Struc struc) { + return Type._(broadType: BroadType.Struct, struc: struc); } - factory Type.nativeFunc(String nativeFuncName) { - return Type._( - broadType: BroadType.NativeFunction, nativeFuncName: nativeFuncName); + factory Type.nativeFunc(TypedefC nativeFunc) { + return Type._(broadType: BroadType.NativeFunction, nativeFunc: nativeFunc); } factory Type.nativeType(SupportedNativeType nativeType) { return Type._(broadType: BroadType.NativeType, nativeType: nativeType); @@ -124,15 +125,15 @@ class Type { broadType: BroadType.Unimplemented, unimplementedReason: reason); } - /// Get base broad type for any type. + /// Get base type for any type. /// - /// E.g int** has base Broadtype as NativeType, - /// double[2][3] has base broadtype as double. - BroadType getBaseBroadType() { + /// E.g int** has base [Type] with [Broadtype] as NativeType, + /// double[2][3] has base [Type] with [Broadtype] as double. + Type getBaseType() { if (child != null) { - return child.getBaseBroadType(); + return child.getBaseType(); } else { - return broadType; + return this; } } @@ -157,9 +158,9 @@ class Type { case BroadType.Pointer: return '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; case BroadType.Struct: - return structName; + return '${struc.name}'; case BroadType.NativeFunction: - return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFuncName}>'; + return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFunc.name}>'; case BroadType .IncompleteArray: // Array parameters are treated as Pointers in C. return '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; @@ -178,9 +179,9 @@ class Type { case BroadType.Pointer: return '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; case BroadType.Struct: - return structName; + return '${struc.name}'; case BroadType.NativeFunction: - return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFuncName}>'; + return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFunc.name}>'; case BroadType .IncompleteArray: // Array parameters are treated as Pointers in C. return '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; diff --git a/pkgs/ffigen/lib/src/code_generator/typedef.dart b/pkgs/ffigen/lib/src/code_generator/typedefc.dart similarity index 71% rename from pkgs/ffigen/lib/src/code_generator/typedef.dart rename to pkgs/ffigen/lib/src/code_generator/typedefc.dart index ea9568f373..28075aa5e6 100644 --- a/pkgs/ffigen/lib/src/code_generator/typedef.dart +++ b/pkgs/ffigen/lib/src/code_generator/typedefc.dart @@ -4,8 +4,6 @@ import 'package:meta/meta.dart'; -import 'binding.dart'; -import 'binding_string.dart'; import 'func.dart' show Parameter; import 'type.dart'; import 'writer.dart'; @@ -18,23 +16,25 @@ import 'writer.dart'; /// $parameter2..., /// . /// . -/// );` +/// ); /// ``` -/// Note: This doesn't bind with anything. -class TypedefC extends Binding { +/// Used for generating typedefs for `Pointer`. +/// +/// Name conflict resolution must be done before using. +class TypedefC { + String name; + String dartDoc; final Type returnType; final List parameters; TypedefC({ - @required String name, - String dartDoc, + @required this.name, + this.dartDoc, @required this.returnType, List parameters, - }) : parameters = parameters ?? [], - super(name: name, dartDoc: dartDoc); + }) : parameters = parameters ?? []; - @override - BindingString toBindingString(Writer w) { + String toTypedefString(Writer w) { final s = StringBuffer(); if (dartDoc != null) { @@ -49,6 +49,6 @@ class TypedefC extends Binding { } s.write(');\n\n'); - return BindingString(type: BindingStringType.typeDef, string: s.toString()); + return s.toString(); } } diff --git a/pkgs/ffigen/lib/src/code_generator/utils.dart b/pkgs/ffigen/lib/src/code_generator/utils.dart new file mode 100644 index 0000000000..fbb1cce650 --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/utils.dart @@ -0,0 +1,37 @@ +class UniqueNamer { + final Set _usedUpNames; + UniqueNamer(this._usedUpNames); + + /// Returns a unique name by appending `_` to it if necessary. + /// + /// Adds the resulting name to the used names by default. + String makeUnique(String name, [bool addToUsedUpNames = true]) { + String cr_name = name; + int i = 1; + while (_usedUpNames.contains(cr_name)) { + cr_name = '${name}_$i'; + i++; + } + if (addToUsedUpNames) { + _usedUpNames.add(cr_name); + } + return cr_name; + } + + /// Adds a name to used names. + /// + /// Note: [makeUnique] also adds the name by default. + void markUsed(String name) { + _usedUpNames.add(name); + } + + /// Returns true if a name has been used before. + bool isUsed(String name) { + return _usedUpNames.contains(name); + } + + /// Returns true if a name has not been used before. + bool isUnique(String name) { + return !_usedUpNames.contains(name); + } +} diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index cc4496ff9c..aa8129c0b9 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -2,29 +2,62 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:ffigen/src/code_generator/utils.dart'; +import 'package:meta/meta.dart'; + import 'binding_string.dart'; /// To store generated String bindings. class Writer { - String header; - String dylibIdentifier; - String initFunctionIdentifier; + final String header; + String _initFunctionIdentifier; + + final UniqueNamer uniqueNamer; + + String _ffiLibraryPrefix; + String get ffiLibraryPrefix => + _ffiLibraryPrefix ??= uniqueNamer.makeUnique('ffi'); + + String _dylibIdentifier; + String get dylibIdentifier => + _dylibIdentifier ??= uniqueNamer.makeUnique('_dylib'); - /// dart:ffi library import prefix. - String ffiLibraryPrefix; + String _arrayHelperClassPrefix; + + /// Guaranteed to be a unique prefix. + String get arrayHelperClassPrefix => _arrayHelperClassPrefix; final List _bindings = []; + /// [usedUpNames] should contain names of all the declarations which are + /// already used. This is used to avoid name collisions. Writer({ - this.dylibIdentifier = '_dylib', - this.initFunctionIdentifier = 'init', - this.ffiLibraryPrefix = 'ffi', - }); + @required Set usedUpNames, + String initFunctionIdentifier = 'init', + this.header, + }) : uniqueNamer = UniqueNamer(usedUpNames), + assert(initFunctionIdentifier != null) { + _initFunctionIdentifier = + uniqueNamer.makeUnique(initFunctionIdentifier); + /// Finding a unique prefix for Array Helper Classes and store into + /// [_arrayHelperClassPrefix]. + final base = 'ArrayHelper'; + _arrayHelperClassPrefix = base; + int suffixInt = 0; + for (int i = 0; i < usedUpNames.length; i++) { + if (usedUpNames.elementAt(i).startsWith(_arrayHelperClassPrefix)) { + // Not a unique prefix, start over with a new suffix. + i = -1; + suffixInt++; + _arrayHelperClassPrefix = '${base}${suffixInt}'; + } + } + } String generate() { final s = StringBuffer(); - // Write header (if any) + // Write file header (if any). if (header != null) { s.write(header); s.write('\n'); @@ -46,8 +79,8 @@ class Writer { s.write('\n'); s.write('/// Initialises the Dynamic library.\n'); s.write( - 'void $initFunctionIdentifier($ffiLibraryPrefix.DynamicLibrary dylib){\n'); - s.write(' ${dylibIdentifier} = dylib;\n'); + 'void $_initFunctionIdentifier($ffiLibraryPrefix.DynamicLibrary dynamicLibrary){\n'); + s.write(' ${dylibIdentifier} = dynamicLibrary;\n'); s.write('}\n'); // Write bindings. diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index fbd2ae62fb..7abfb66991 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -15,10 +15,10 @@ import 'package:path/path.dart' as path; import 'package:yaml/yaml.dart'; import '../strings.dart' as strings; -import 'filter.dart'; +import 'declaration.dart'; import 'spec_utils.dart'; -var _logger = Logger('config_provider/config'); +var _logger = Logger('config_provider:config.dart'); /// Provides configurations to other modules. /// @@ -44,14 +44,14 @@ class Config { /// CommandLine Arguments to pass to clang_compiler. List compilerOpts; - /// Filter for functions. - Filter functionFilters; + /// Declaration config for Functions. + Declaration functionDecl; - /// Filter for structs. - Filter structFilters; + /// Declaration config for Structs. + Declaration structDecl; - /// Filter for enumClass. - Filter enumClassFilters; + /// Declaration config for Enums. + Declaration enumClassDecl; /// If generated bindings should be sorted alphabetically. bool sort; @@ -67,23 +67,11 @@ class Config { /// If false(default), structs with inline array members will have all its members removed. bool arrayWorkaround; - /// Manually creating configurations. - /// - /// Use [Config.fromYaml] if extracting info from a yaml file. - /// Ensure that log printing is setup before using this. - Config.raw({ - this.output, - @required this.libclang_dylib_path, - @required this.headers, - this.headerFilter, - this.compilerOpts, - this.functionFilters, - this.structFilters, - this.enumClassFilters, - this.sort = false, - this.useSupportedTypedefs = true, - this.comment, - }); + /// Name of the init function used to initialise the dynamic library. + String initFunctionName; + + /// Header of the generated bindings. + String preamble; Config._(); @@ -137,7 +125,7 @@ class Config { if (map.containsKey(key)) { spec.extractedResult(spec.extractor(map[key])); } else { - spec.extractedResult(spec.defaultValue); + spec.extractedResult(spec.defaultValue?.call()); } } } @@ -152,14 +140,13 @@ class Config { isRequired: true, validator: outputValidator, extractor: outputExtractor, - defaultValue: null, extractedResult: (dynamic result) => output = result as String, ), strings.libclang_dylib_folder: Specification( description: 'Path to folder containing libclang dynamic library, used to parse C headers', isRequired: false, - defaultValue: getDylibPath(Platform.script + defaultValue: () => getDylibPath(Platform.script .resolve(path.join('..', 'tool', 'wrapped_libclang')) .toFilePath()), validator: libclangDylibValidator, @@ -178,7 +165,7 @@ class Config { description: 'Include/Exclude inclusion headers', validator: headerFilterValidator, extractor: headerFilterExtractor, - defaultValue: HeaderFilter(), + defaultValue: () => HeaderFilter(), extractedResult: (dynamic result) { return headerFilter = result as HeaderFilter; }, @@ -188,40 +175,47 @@ class Config { isRequired: false, validator: compilerOptsValidator, extractor: compilerOptsExtractor, - defaultValue: null, extractedResult: (dynamic result) => compilerOpts = result as List, ), - strings.functions: Specification( + strings.functions: Specification( description: 'Filter for functions', isRequired: false, - validator: filterValidator, - extractor: filterExtractor, - defaultValue: null, - extractedResult: (dynamic result) => functionFilters = result as Filter, + validator: declarationConfigValidator, + extractor: declarationConfigExtractor, + defaultValue: () => Declaration(declarationTypeName: 'Function'), + extractedResult: (dynamic result) { + functionDecl = result as Declaration; + functionDecl.declarationTypeName = 'Function'; + }, ), - strings.structs: Specification( + strings.structs: Specification( description: 'Filter for Structs', isRequired: false, - validator: filterValidator, - extractor: filterExtractor, - defaultValue: null, - extractedResult: (dynamic result) => structFilters = result as Filter, + validator: declarationConfigValidator, + extractor: declarationConfigExtractor, + defaultValue: () => Declaration(declarationTypeName: 'Struct'), + extractedResult: (dynamic result) { + structDecl = result as Declaration; + structDecl.declarationTypeName = 'Struct'; + }, ), - strings.enums: Specification( + strings.enums: Specification( description: 'Filter for enums', isRequired: false, - validator: filterValidator, - extractor: filterExtractor, - defaultValue: null, - extractedResult: (dynamic result) => - enumClassFilters = result as Filter, + validator: declarationConfigValidator, + extractor: declarationConfigExtractor, + defaultValue: () => Declaration(declarationTypeName: 'Enum'), + extractedResult: (dynamic result) { + enumClassDecl = result as Declaration; + enumClassDecl.declarationTypeName = 'Enum'; + }, ), strings.sizemap: Specification>( description: 'map of types: byte size in int', validator: sizemapValidator, extractor: sizemapExtractor, - defaultValue: {}, + defaultValue: () => {}, extractedResult: (dynamic result) { final map = result as Map; for (final key in map.keys) { @@ -236,7 +230,7 @@ class Config { isRequired: false, validator: booleanValidator, extractor: booleanExtractor, - defaultValue: false, + defaultValue: () => false, extractedResult: (dynamic result) => sort = result as bool, ), strings.useSupportedTypedefs: Specification( @@ -244,7 +238,7 @@ class Config { isRequired: false, validator: booleanValidator, extractor: booleanExtractor, - defaultValue: true, + defaultValue: () => true, extractedResult: (dynamic result) => useSupportedTypedefs = result as bool, ), @@ -253,7 +247,7 @@ class Config { isRequired: false, validator: commentValidator, extractor: commentExtractor, - defaultValue: strings.brief, + defaultValue: () => strings.brief, extractedResult: (dynamic result) => comment = result as String, ), strings.arrayWorkaround: Specification( @@ -262,9 +256,25 @@ class Config { isRequired: false, validator: booleanValidator, extractor: booleanExtractor, - defaultValue: false, + defaultValue: () => false, extractedResult: (dynamic result) => arrayWorkaround = result as bool, ), + strings.initFunctionName: Specification( + description: 'Name of the init function to use', + isRequired: false, + validator: nonEmptyStringValidator, + extractor: stringExtractor, + defaultValue: () => 'init', + extractedResult: (dynamic result) => + initFunctionName = result as String, + ), + strings.preamble: Specification( + description: 'Header String for the generated bindings', + isRequired: false, + validator: nonEmptyStringValidator, + extractor: stringExtractor, + extractedResult: (dynamic result) => preamble = result as String, + ), }; } } @@ -276,7 +286,8 @@ class Specification { final String description; final bool Function(String name, dynamic value) validator; final E Function(dynamic map) extractor; - final E defaultValue; + final E Function() defaultValue; + final bool isRequired; final void Function(dynamic result) extractedResult; diff --git a/pkgs/ffigen/lib/src/config_provider/filter.dart b/pkgs/ffigen/lib/src/config_provider/declaration.dart similarity index 55% rename from pkgs/ffigen/lib/src/config_provider/filter.dart rename to pkgs/ffigen/lib/src/config_provider/declaration.dart index b35dc0b228..4674bc52fc 100644 --- a/pkgs/ffigen/lib/src/config_provider/filter.dart +++ b/pkgs/ffigen/lib/src/config_provider/declaration.dart @@ -1,25 +1,33 @@ // Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:logging/logging.dart'; + +var _logger = Logger('config_provider:declaration.dart'); + +/// A generic declaration config. +class Declaration { + /// Display name of a declaration type. + /// + /// Used for logging and warning purposes. + String declarationTypeName; -/// A generic filter for filtering strings based on regexes and prefixes. -/// -/// Excludes override includes. -/// -/// User can provide fiters for functions, structs, enums and include/exclude -/// them using regexp and full name matching. -class Filter { // matchers List _includeMatchers = []; Set _includeFull = {}; List _excludeMatchers = []; Set _excludeFull = {}; + String _globalPrefix = ''; + Map _prefixReplacement = {}; - Filter({ + Declaration({ + this.declarationTypeName = 'declaration', List includeMatchers, List includeFull, List excludeMatchers, List excludeFull, + String globalPrefix, + Map prefixReplacement, }) { if (includeMatchers != null) { _includeMatchers = @@ -35,6 +43,35 @@ class Filter { if (excludeFull != null) { _excludeFull = excludeFull.map((e) => e).toSet(); } + if (globalPrefix != null) { + _globalPrefix = globalPrefix; + } + if (prefixReplacement != null) { + _prefixReplacement = prefixReplacement; + } + } + + /// Applies prefix and replacement and returns the result. + /// + /// Also logs warnings if declaration starts with '_'. + String getPrefixedName(String name) { + // Apply prefix replacement. + for (final pattern in _prefixReplacement.keys) { + if (name.startsWith(pattern)) { + name = name.replaceFirst(pattern, _prefixReplacement[pattern]); + break; + } + } + + // Apply global prefixes. + name = '${_globalPrefix}$name'; + + // Warn user if a declaration starts with '_'. + if (name.startsWith('_')) { + _logger.warning( + "Generated $declarationTypeName '$name' start's with '_' and therefore will be private."); + } + return name; } /// Checks if a name is allowed by a filter. @@ -67,14 +104,4 @@ class Filter { return true; } } - - @override - String toString() { - return ''' (includeFull, includeMatchers, excludeFull, excludeMatchers) -$_includeFull -$_includeMatchers -$_excludeFull -$_excludeMatchers - '''; - } } diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 3544330d8e..560cc597a2 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -12,9 +12,9 @@ import 'package:yaml/yaml.dart'; import '../strings.dart' as strings; import './config.dart'; -import 'filter.dart'; +import 'declaration.dart'; -var _logger = Logger('config_provider/utils'); +var _logger = Logger('config_provider:spec_utils.dart'); bool booleanExtractor(dynamic value) => value as bool; @@ -166,13 +166,15 @@ bool outputValidator(String name, dynamic value) { if (value is String) { return true; } else { - _logger.severe("Expected value of key '${strings.output}' to be a String."); + _logger.severe("Expected value of key '$name' to be a String."); return false; } } -Filter filterExtractor(dynamic yamlMap) { +Declaration declarationConfigExtractor(dynamic yamlMap) { List includeMatchers, includeFull, excludeMatchers, excludeFull; + String prefix; + Map prefixReplacement; final include = yamlMap[strings.include] as YamlMap; if (include != null) { @@ -186,21 +188,29 @@ Filter filterExtractor(dynamic yamlMap) { excludeFull = (exclude[strings.names] as YamlList)?.cast(); } - return Filter( + prefix = yamlMap[strings.prefix] as String; + + prefixReplacement = + (yamlMap[strings.prefix_replacement] as YamlMap)?.cast(); + + return Declaration( includeMatchers: includeMatchers, includeFull: includeFull, excludeMatchers: excludeMatchers, excludeFull: excludeFull, + globalPrefix: prefix, + prefixReplacement: prefixReplacement, ); } -bool filterValidator(String name, dynamic value) { +bool declarationConfigValidator(String name, dynamic value) { var _result = true; if (value is YamlMap) { for (final key in value.keys) { if (key == strings.include || key == strings.exclude) { if (value[key] is! YamlMap) { _logger.severe("Expected '$name -> $key' to be a Map."); + _result = false; } for (final subkey in value[key].keys) { if (subkey == strings.matches || subkey == strings.names) { @@ -213,6 +223,24 @@ bool filterValidator(String name, dynamic value) { _logger.severe("Unknown key '$subkey' in '$name -> $key'."); } } + } else if (key == strings.prefix) { + if (value[key] is! String) { + _logger.severe("Expected '$name -> $key' to be a String."); + _result = false; + } + } else if (key == strings.prefix_replacement) { + if (value[key] is! YamlMap) { + _logger.severe("Expected '$name -> $key' to be a Map."); + _result = false; + } else { + for (final subkey in value[key].keys) { + if (value[key][subkey] is! String) { + _logger.severe( + "Expected '$name -> $key -> $subkey' to be a String."); + _result = false; + } + } + } } else { _logger.severe("Unknown key '$key' in '$name'."); _result = false; @@ -241,6 +269,17 @@ SupportedNativeType nativeSupportedType(int value, {bool signed = true}) { } } +String stringExtractor(dynamic value) => value as String; + +bool nonEmptyStringValidator(String name, dynamic value) { + if (value is String && value.isNotEmpty) { + return true; + } else { + _logger.severe("Expected value of key '$name' to be a non-empty String."); + return false; + } +} + String commentExtractor(dynamic value) => value as String; bool commentValidator(String name, dynamic value) { diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 546c8dca21..e71a1621bf 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -7,8 +7,8 @@ import 'dart:ffi' as ffi; ffi.DynamicLibrary _dylib; /// Initialises the Dynamic library. -void init(ffi.DynamicLibrary dylib) { - _dylib = dylib; +void init(ffi.DynamicLibrary __dylib) { + _dylib = __dylib; } /// Describes how the traversal of the children of a particular cursor should @@ -35,9 +35,9 @@ class CXCursor extends ffi.Struct { @ffi.Int32() int xdata; - ffi.Pointer _data_item_0; - ffi.Pointer _data_item_1; - ffi.Pointer _data_item_2; + ffi.Pointer _exp_workaround_data_item_0; + ffi.Pointer _exp_workaround_data_item_1; + ffi.Pointer _exp_workaround_data_item_2; /// Helper for array `data`. ArrayHelper_CXCursor_data_level0 get data => @@ -64,11 +64,11 @@ class ArrayHelper_CXCursor_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - return _struct._data_item_0; + return _struct._exp_workaround_data_item_0; case 1: - return _struct._data_item_1; + return _struct._exp_workaround_data_item_1; case 2: - return _struct._data_item_2; + return _struct._exp_workaround_data_item_2; default: throw Exception('Invalid Array Helper generated.'); } @@ -78,13 +78,13 @@ class ArrayHelper_CXCursor_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - _struct._data_item_0 = value; + _struct._exp_workaround_data_item_0 = value; break; case 1: - _struct._data_item_1 = value; + _struct._exp_workaround_data_item_1 = value; break; case 2: - _struct._data_item_2 = value; + _struct._exp_workaround_data_item_2 = value; break; default: throw Exception('Invalid Array Helper generated.'); @@ -769,8 +769,8 @@ class CXDiagnosticDisplayOptions { /// Identifies a specific source location within a translation unit. class CXSourceLocation extends ffi.Struct { - ffi.Pointer _ptr_data_item_0; - ffi.Pointer _ptr_data_item_1; + ffi.Pointer _exp_workaround_ptr_data_item_0; + ffi.Pointer _exp_workaround_ptr_data_item_1; /// Helper for array `ptr_data`. ArrayHelper_CXSourceLocation_ptr_data_level0 get ptr_data => @@ -799,9 +799,9 @@ class ArrayHelper_CXSourceLocation_ptr_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - return _struct._ptr_data_item_0; + return _struct._exp_workaround_ptr_data_item_0; case 1: - return _struct._ptr_data_item_1; + return _struct._exp_workaround_ptr_data_item_1; default: throw Exception('Invalid Array Helper generated.'); } @@ -811,10 +811,10 @@ class ArrayHelper_CXSourceLocation_ptr_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - _struct._ptr_data_item_0 = value; + _struct._exp_workaround_ptr_data_item_0 = value; break; case 1: - _struct._ptr_data_item_1 = value; + _struct._exp_workaround_ptr_data_item_1 = value; break; default: throw Exception('Invalid Array Helper generated.'); @@ -824,8 +824,8 @@ class ArrayHelper_CXSourceLocation_ptr_data_level0 { /// Identifies a half-open character range in the source code. class CXSourceRange extends ffi.Struct { - ffi.Pointer _ptr_data_item_0; - ffi.Pointer _ptr_data_item_1; + ffi.Pointer _exp_workaround_ptr_data_item_0; + ffi.Pointer _exp_workaround_ptr_data_item_1; /// Helper for array `ptr_data`. ArrayHelper_CXSourceRange_ptr_data_level0 get ptr_data => @@ -857,9 +857,9 @@ class ArrayHelper_CXSourceRange_ptr_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - return _struct._ptr_data_item_0; + return _struct._exp_workaround_ptr_data_item_0; case 1: - return _struct._ptr_data_item_1; + return _struct._exp_workaround_ptr_data_item_1; default: throw Exception('Invalid Array Helper generated.'); } @@ -869,10 +869,10 @@ class ArrayHelper_CXSourceRange_ptr_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - _struct._ptr_data_item_0 = value; + _struct._exp_workaround_ptr_data_item_0 = value; break; case 1: - _struct._ptr_data_item_1 = value; + _struct._exp_workaround_ptr_data_item_1 = value; break; default: throw Exception('Invalid Array Helper generated.'); @@ -959,8 +959,8 @@ class CXType extends ffi.Struct { @ffi.Int32() int kind; - ffi.Pointer _data_item_0; - ffi.Pointer _data_item_1; + ffi.Pointer _exp_workaround_data_item_0; + ffi.Pointer _exp_workaround_data_item_1; /// Helper for array `data`. ArrayHelper_CXType_data_level0 get data => @@ -987,9 +987,9 @@ class ArrayHelper_CXType_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - return _struct._data_item_0; + return _struct._exp_workaround_data_item_0; case 1: - return _struct._data_item_1; + return _struct._exp_workaround_data_item_1; default: throw Exception('Invalid Array Helper generated.'); } @@ -999,10 +999,10 @@ class ArrayHelper_CXType_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - _struct._data_item_0 = value; + _struct._exp_workaround_data_item_0 = value; break; case 1: - _struct._data_item_1 = value; + _struct._exp_workaround_data_item_1 = value; break; default: throw Exception('Invalid Array Helper generated.'); @@ -1150,12 +1150,6 @@ class CXUnsavedFile extends ffi.Struct { int Length; } -typedef ModifiedCXCursorVisitor = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - ffi.Pointer clang_Cursor_getArgument_wrap( ffi.Pointer cursor, int i, @@ -2001,11 +1995,17 @@ typedef _dart_clang_parseTranslationUnit = ffi.Pointer int options, ); +typedef ModifiedCXCursorVisitor_1 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, +); + /// Visitor is a function pointer with parameters having pointers to cxcursor /// instead of cxcursor by default. int clang_visitChildren_wrap( ffi.Pointer parent, - ffi.Pointer> _modifiedVisitor, + ffi.Pointer> _modifiedVisitor, ffi.Pointer clientData, ) { return _clang_visitChildren_wrap( @@ -2021,12 +2021,12 @@ final _dart_clang_visitChildren_wrap _clang_visitChildren_wrap = typedef _c_clang_visitChildren_wrap = ffi.Uint32 Function( ffi.Pointer parent, - ffi.Pointer> _modifiedVisitor, + ffi.Pointer> _modifiedVisitor, ffi.Pointer clientData, ); typedef _dart_clang_visitChildren_wrap = int Function( ffi.Pointer parent, - ffi.Pointer> _modifiedVisitor, + ffi.Pointer> _modifiedVisitor, ffi.Pointer clientData, ); diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart index 23698a5f45..f0ab13c1c6 100644 --- a/pkgs/ffigen/lib/src/header_parser/includer.dart +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -2,25 +2,23 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:meta/meta.dart'; +import 'package:ffigen/src/code_generator.dart'; import 'package:path/path.dart' as p; import 'data.dart'; /// Utility functions to check whether a binding should be parsed or not -/// based on filters and if a binding is seen already. +/// based on filters. -// Stores binding names already scene. -Set _structs = {}; -Set _functions = {}; -Set _enumClass = {}; -Set _typedefC = {}; +// Stores binding names already scene. Mp key is same as their original name. +Map _structs = {}; +Map _functions = {}; +Map _enumClass = {}; bool shouldIncludeStruct(String name) { - if (_structs.contains(name) || name == '') { + if (_structs.containsKey(name) || name == '') { return false; - } else if (config.structFilters == null || - config.structFilters.shouldInclude(name)) { - _structs.add(name); + } else if (config.structDecl == null || + config.structDecl.shouldInclude(name)) { return true; } else { return false; @@ -28,11 +26,10 @@ bool shouldIncludeStruct(String name) { } bool shouldIncludeFunc(String name) { - if (_functions.contains(name) || name == '') { + if (_functions.containsKey(name) || name == '') { return false; - } else if (config.functionFilters == null || - config.functionFilters.shouldInclude(name)) { - _functions.add(name); + } else if (config.functionDecl == null || + config.functionDecl.shouldInclude(name)) { return true; } else { return false; @@ -40,11 +37,10 @@ bool shouldIncludeFunc(String name) { } bool shouldIncludeEnumClass(String name) { - if (_enumClass.contains(name) || name == '') { + if (_enumClass.containsKey(name) || name == '') { return false; - } else if (config.enumClassFilters == null || - config.enumClassFilters.shouldInclude(name)) { - _enumClass.add(name); + } else if (config.enumClassDecl == null || + config.enumClassDecl.shouldInclude(name)) { return true; } else { return false; @@ -72,24 +68,38 @@ bool shouldIncludeRootCursor(String sourceFile) { } } -bool isUnseenTypedefC(String name, {@required bool addToSeen}) { - if (_typedefC.contains(name)) { - return false; - } else { - if (addToSeen) { - _typedefC.add(name); - } - return true; - } +bool isSeenStruc(String originalName) { + return _structs.containsKey(originalName); } -bool isUnseenStruct(String name, {@required bool addToSeen}) { - if (_structs.contains(name)) { - return false; - } else { - if (addToSeen) { - _structs.add(name); - } - return true; - } +void addStrucToSeen(String originalName, Struc struc) { + _structs[originalName] = struc; +} + +Struc getSeenStruc(String originalName) { + return _structs[originalName]; +} + +bool isSeenFunc(String originalName) { + return _functions.containsKey(originalName); +} + +void addFuncToSeen(String originalName, Func func) { + _functions[originalName] = func; +} + +Func getSeenFunc(String originalName) { + return _functions[originalName]; +} + +bool isSeenEnumClass(String originalName) { + return _enumClass.containsKey(originalName); +} + +void addEnumClassToSeen(String originalName, EnumClass enumClass) { + _enumClass[originalName] = enumClass; +} + +EnumClass getSeenEnumClass(String originalName) { + return _enumClass[originalName]; } diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index eac3c93c41..f50e2e5c87 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -20,7 +20,11 @@ Library parse(Config conf, {bool sort = false}) { final bindings = parseToBindings(); - final library = Library(bindings: bindings); + final library = Library( + bindings: bindings, + initFunctionIdentifier: data.config.initFunctionName, + header: data.config.preamble, + ); if (sort) { library.sort(); @@ -32,7 +36,7 @@ Library parse(Config conf, {bool sort = false}) { // BELOW FUNCTIONS ARE MEANT FOR INTERNAL USE AND TESTING // =================================================================================== -var _logger = Logger('parser:parser'); +var _logger = Logger('header_parser:parser.dart'); /// initialises parser, clears any previous values. void initParser(Config c) { diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index c3e5a545bc..25266e1f91 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -5,13 +5,14 @@ import 'dart:ffi'; import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser/data.dart'; import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang; import '../includer.dart'; import '../utils.dart'; -var _logger = Logger('parser:enumdecl_parser'); +var _logger = Logger('header_parser:enumdecl_parser.dart'); /// Temporarily holds a enumClass before its returned by [parseEnumDeclaration]. EnumClass _enumClass; @@ -28,12 +29,13 @@ EnumClass parseEnumDeclaration( final enumName = name ?? cursor.spelling(); if (enumName == '') { _logger.finest('unnamed enum declaration'); - } else if (shouldIncludeEnumClass(enumName)) { + } else if (shouldIncludeEnumClass(enumName) && !isSeenEnumClass(enumName)) { _logger.fine('++++ Adding Enum: ${cursor.completeStringRepr()}'); _enumClass = EnumClass( dartDoc: getCursorDocComment(cursor), - name: enumName, + name: config.enumClassDecl.getPrefixedName(enumName), ); + addEnumClassToSeen(enumName, _enumClass); _addEnumConstant(cursor); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index 3afb7b7926..98b93d0b33 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -5,13 +5,14 @@ import 'dart:ffi'; import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser/data.dart'; import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang; import '../includer.dart'; import '../utils.dart'; -var _logger = Logger('parser:functiondecl_parser'); +var _logger = Logger('header_parser:functiondecl_parser.dart'); /// Temporarily holds a function before its returned by [parseFunctionDeclaration]. Func _func; @@ -22,8 +23,8 @@ Func parseFunctionDeclaration(Pointer cursor) { structByValueParameter = false; unimplementedParameterType = false; - final name = cursor.spelling(); - if (shouldIncludeFunc(name)) { + final funcName = cursor.spelling(); + if (shouldIncludeFunc(funcName) && !isSeenFunc(funcName)) { _logger.fine('++++ Adding Function: ${cursor.completeStringRepr()}'); final rt = _getFunctionReturnType(cursor); @@ -34,25 +35,27 @@ Func parseFunctionDeclaration(Pointer cursor) { _logger.fine( '---- Removed Function, reason: struct pass/return by value: ${cursor.completeStringRepr()}'); _logger.warning( - "Skipped Function '$name', struct pass/return by value not supported."); + "Skipped Function '$funcName', struct pass/return by value not supported."); return null; // Returning null so that [addToBindings] function excludes this. } - if (rt.getBaseBroadType() == BroadType.Unimplemented || + if (rt.getBaseType().broadType == BroadType.Unimplemented || unimplementedParameterType) { _logger.fine( '---- Removed Function, reason: unsupported return type or parameter type: ${cursor.completeStringRepr()}'); _logger.warning( - "Skipped Function '$name', function has unsupported return type or parameter type."); + "Skipped Function '$funcName', function has unsupported return type or parameter type."); return null; // Returning null so that [addToBindings] function excludes this. } _func = Func( dartDoc: getCursorDocComment(cursor), - name: name, + name: config.functionDecl.getPrefixedName(funcName), + lookupSymbolName: funcName, returnType: rt, parameters: parameters, ); + addFuncToSeen(funcName, _func); } return _func; @@ -77,7 +80,7 @@ List _getParameters(Pointer cursor) { //TODO(3): Remove this when support for Structs by value arrives. if (pt.broadType == BroadType.Struct) { structByValueParameter = true; - } else if (pt.getBaseBroadType() == BroadType.Unimplemented) { + } else if (pt.getBaseType().broadType == BroadType.Unimplemented) { unimplementedParameterType = true; } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index d7c9dc43e7..a71f69ed61 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -12,7 +12,7 @@ import '../data.dart'; import '../includer.dart'; import '../utils.dart'; -var _logger = Logger('parser:structdecl_parser'); +var _logger = Logger('header_parser:structdecl_parser.dart'); /// Temporarily holds a struc before its returned by [parseStructDeclaration]. Struc _struc; @@ -24,11 +24,9 @@ Struc parseStructDeclaration( /// Optionally provide name (useful in case struct is inside a typedef). String name, - /// Option to override shouldInclude methods. (Useful in case of extracting - /// structs when they are passed/returned by an included function.) - /// - /// Check if binding is not already included before setting this to true. - bool doInclude = false, + /// Option to ignore struct filter (Useful in case of extracting structs + /// when they are passed/returned by an included function.) + bool ignoreFilter = false, }) { _struc = null; final structName = name ?? cursor.spelling(); @@ -36,16 +34,19 @@ Struc parseStructDeclaration( if (structName == '') { _logger.finest('unnamed structure or typedef structure declaration'); return null; - } else if (doInclude || shouldIncludeStruct(structName)) { + } else if ((ignoreFilter || shouldIncludeStruct(structName)) && + (!isSeenStruc(structName))) { _logger.fine( '++++ Adding Structure: structName: ${structName}, ${cursor.completeStringRepr()}'); - final members = _getMembers(cursor, structName); _struc = Struc( + name: config.structDecl.getPrefixedName(structName), dartDoc: getCursorDocComment(cursor), - name: structName, - members: members, ); + // Adding to seen here to stop recursion if a struct has itself as a + // member, members are updated later. + addStrucToSeen(structName, _struc); + _struc.members = _getMembers(cursor, structName); } return _struc; @@ -72,19 +73,19 @@ List _getMembers(Pointer cursor, String structName) { '---- Removed Struct members, reason: struct has array members ${cursor.completeStringRepr()}'); _logger.warning( 'Removed All Struct Members from: $structName, Array members not supported'); - return null; + return []; } else if (nestedStructMember) { _logger.fine( '---- Removed Struct members, reason: struct has struct members ${cursor.completeStringRepr()}'); _logger.warning( "Removed All Struct Members from '$structName', Nested Structures not supported."); - return null; + return []; } else if (unimplementedMemberType) { _logger.fine( '---- Removed Struct members, reason: member with unimplementedtype ${cursor.completeStringRepr()}'); _logger.warning( "Removed All Struct Members from '$structName', struct member has an unsupported type."); - return null; + return []; } return _members; @@ -119,7 +120,7 @@ int _structMembersVisitor(Pointer cursor, } } - if (mt.getBaseBroadType() == BroadType.Unimplemented) { + if (mt.getBaseType().broadType == BroadType.Unimplemented) { unimplementedMemberType = true; } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart index c68b5e3320..30ec2abcbf 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart @@ -12,7 +12,7 @@ import '../sub_parsers/enumdecl_parser.dart'; import '../sub_parsers/structdecl_parser.dart'; import '../utils.dart'; -var _logger = Logger('parser:typedefdecl_parser'); +var _logger = Logger('header_parser:typedefdecl_parser.dart'); /// Temporarily holds a binding before its returned by [parseTypedefDeclaration]. Binding _binding; diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart index 8632b259c0..a1b794b87b 100644 --- a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -15,7 +15,7 @@ import 'sub_parsers/structdecl_parser.dart'; import 'sub_parsers/typedefdecl_parser.dart'; import 'utils.dart'; -var _logger = Logger('parser:root_parser'); +var _logger = Logger('header_parser:translation_unit_parser.dart'); List _bindings; diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 9584ceae9a..65fd6f010b 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -16,7 +16,7 @@ import '../translation_unit_parser.dart'; import '../type_extractor/cxtypekindmap.dart'; import '../utils.dart'; -var _logger = Logger('parser:extractor'); +var _logger = Logger('header_parser:extractor.dart'); const _padding = ' '; /// Converts cxtype to a typestring code_generator can accept. @@ -100,12 +100,20 @@ Type _extractfromRecord(Pointer cxtype) { structName = cxtype.spelling(); } - type = Type.struct(structName); + final fixedStructName = config.structDecl.getPrefixedName(structName); // Also add a struct binding, if its unseen. - if (isUnseenStruct(structName, addToSeen: true)) { - addToBindings( - parseStructDeclaration(cursor, name: structName, doInclude: true)); + // TODO(23): Check if we should auto add struct. + if (isSeenStruc(structName)) { + type = Type.struct(getSeenStruc(structName)); + } else { + final struc = parseStructDeclaration(cursor, + name: fixedStructName, ignoreFilter: true); + type = Type.struct(struc); + // Add to bindings. + addToBindings(struc); + // Add to seen. + addStrucToSeen(structName, struc); } cxtype.dispose(); @@ -127,25 +135,34 @@ Type _extractFromFunctionProto( // Set a name for typedefc incase it was null or empty. if (name == null || name == '') { - name = _getNextUniqueString('_typedefC_noname'); + name = _getNextUniqueString('_typedefC'); + } else { + name = _getNextUniqueString(name); } + final _parameters = []; + final totalArgs = clang.clang_getNumArgTypes_wrap(cxtype); + for (var i = 0; i < totalArgs; i++) { + 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.'); + } else if (pt.broadType == BroadType.Unimplemented) { + return Type.unimplemented('Function parameter has an unsupported type.'); + } - if (isUnseenTypedefC(name, addToSeen: true)) { - final typedefC = TypedefC( - name: name, - returnType: - clang.clang_getResultType_wrap(cxtype).toCodeGenTypeAndDispose(), + _parameters.add( + Parameter(name: '', type: pt), ); - final totalArgs = clang.clang_getNumArgTypes_wrap(cxtype); - for (var i = 0; i < totalArgs; i++) { - final t = clang.clang_getArgType_wrap(cxtype, i); - typedefC.parameters.add( - Parameter(name: '', type: t.toCodeGenTypeAndDispose()), - ); - } - addToBindings(typedefC); } - return Type.nativeFunc(name); + final typedefC = TypedefC( + name: name, + parameters: _parameters, + returnType: + clang.clang_getResultType_wrap(cxtype).toCodeGenTypeAndDispose(), + ); + + return Type.nativeFunc(typedefC); } /// Generate a unique string for naming in [TypedefC]. diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index a03aa97179..27e1d50e75 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -19,6 +19,8 @@ const enums = 'enums'; // Sub-fields of Declarations. const include = 'include'; const exclude = 'exclude'; +const prefix = 'prefix'; +const prefix_replacement = 'prefix-replacement'; // Sub-fields of include/exclude. const matches = 'matches'; // regex @@ -68,6 +70,10 @@ const none = 'none'; // Contains all possibe comment types. const commentTypeSet = {brief, full, none}; +// Library input. +const initFunctionName = 'init-function-name'; +const preamble = 'preamble'; + // Dynamic library names. const libclang_dylib_linux = 'libwrapped_clang.so'; const libclang_dylib_macos = 'libwrapped_clang.dylib'; diff --git a/pkgs/ffigen/test/code_generator_test.dart b/pkgs/ffigen/test/code_generator_test.dart index 431283724e..cddaab4d41 100644 --- a/pkgs/ffigen/test/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_test.dart @@ -14,6 +14,7 @@ void main() { bindings: [ Func( name: 'noParam', + lookupSymbolName: 'noParam', dartDoc: 'Just a test function\nheres another line', returnType: Type.nativeType( SupportedNativeType.Int32, @@ -21,6 +22,7 @@ void main() { ), Func( name: 'withPrimitiveParam', + lookupSymbolName: 'withPrimitiveParam', parameters: [ Parameter( name: 'a', @@ -41,6 +43,7 @@ void main() { ), Func( name: 'withPointerParam', + lookupSymbolName: 'withPointerParam', parameters: [ Parameter( name: 'a', @@ -86,8 +89,8 @@ import 'dart:ffi' as ffi; ffi.DynamicLibrary _dylib; /// Initialises the Dynamic library. -void init(ffi.DynamicLibrary dylib){ - _dylib = dylib; +void init(ffi.DynamicLibrary dynamicLibrary){ + _dylib = dynamicLibrary; } /// Just a test function /// heres another line @@ -237,8 +240,8 @@ import 'dart:ffi' as ffi; ffi.DynamicLibrary _dylib; /// Initialises the Dynamic library. -void init(ffi.DynamicLibrary dylib){ - _dylib = dylib; +void init(ffi.DynamicLibrary dynamicLibrary){ + _dylib = dynamicLibrary; } /// Just a test struct /// heres another line @@ -279,40 +282,42 @@ class WithPointerMember extends ffi.Struct{ }); test('Function and Struct Binding (pointer to Struct)', () { + final struct_some = Struc( + name: 'SomeStruc', + members: [ + Member( + name: 'a', + type: Type.nativeType( + SupportedNativeType.Int32, + ), + ), + Member( + name: 'b', + type: Type.nativeType( + SupportedNativeType.Double, + ), + ), + Member( + name: 'c', + type: Type.nativeType( + SupportedNativeType.Char, + ), + ), + ], + ); final library = Library( bindings: [ - Struc( - name: 'SomeStruc', - members: [ - Member( - name: 'a', - type: Type.nativeType( - SupportedNativeType.Int32, - ), - ), - Member( - name: 'b', - type: Type.nativeType( - SupportedNativeType.Double, - ), - ), - Member( - name: 'c', - type: Type.nativeType( - SupportedNativeType.Char, - ), - ), - ], - ), + struct_some, Func( name: 'someFunc', + lookupSymbolName: 'someFunc', parameters: [ Parameter( name: 'some', type: Type.pointer( Type.pointer( Type.struct( - 'SomeStruc', + struct_some, ), ), ), @@ -320,7 +325,7 @@ class WithPointerMember extends ffi.Struct{ ], returnType: Type.pointer( Type.struct( - 'SomeStruc', + struct_some, ), ), ), @@ -343,8 +348,8 @@ import 'dart:ffi' as ffi; ffi.DynamicLibrary _dylib; /// Initialises the Dynamic library. -void init(ffi.DynamicLibrary dylib){ - _dylib = dylib; +void init(ffi.DynamicLibrary dynamicLibrary){ + _dylib = dynamicLibrary; } class SomeStruc extends ffi.Struct{ @ffi.Int32() @@ -388,30 +393,34 @@ typedef _dart_someFunc = ffi.Pointer Function( }); test('global (primitives, pointers, pointer to struct)', () { + final struc_some = Struc( + name: 'Some', + ); final library = Library( bindings: [ Global( name: 'test1', + lookupSymbolName: 'test1', type: Type.nativeType( SupportedNativeType.Int32, ), ), Global( name: 'test2', + lookupSymbolName: 'test2', type: Type.pointer( Type.nativeType( SupportedNativeType.Float, ), ), ), - Struc( - name: 'Some', - ), + struc_some, Global( name: 'test5', + lookupSymbolName: 'test5', type: Type.pointer( Type.struct( - 'Some', + struc_some, ), ), ), @@ -434,8 +443,8 @@ import 'dart:ffi' as ffi; ffi.DynamicLibrary _dylib; /// Initialises the Dynamic library. -void init(ffi.DynamicLibrary dylib){ - _dylib = dylib; +void init(ffi.DynamicLibrary dynamicLibrary){ + _dylib = dynamicLibrary; } final int test1 = _dylib.lookup('test1').value; @@ -493,8 +502,8 @@ import 'dart:ffi' as ffi; ffi.DynamicLibrary _dylib; /// Initialises the Dynamic library. -void init(ffi.DynamicLibrary dylib){ - _dylib = dylib; +void init(ffi.DynamicLibrary dynamicLibrary){ + _dylib = dynamicLibrary; } const int test1 = 20; @@ -511,37 +520,18 @@ const double test2 = 20.0; } }); - test('TypedefC (primitive, pointers, pointer to struct)', () { + test('enum_class', () { final library = Library( bindings: [ - TypedefC( - dartDoc: 'just a test', - name: 'test1', - returnType: Type.nativeType( - SupportedNativeType.Int32, - ), - ), - Struc(name: 'SomeStruct'), - TypedefC( - name: 'test2', - returnType: Type.pointer( - Type.nativeType( - SupportedNativeType.Int32, - ), - ), - parameters: [ - Parameter( - name: 'param1', - type: Type.pointer( - Type.struct('SomeStruct'), - ), - ), - Parameter( - name: 'param2', - type: Type.nativeType( - SupportedNativeType.Char, - ), + EnumClass( + name: 'Constants', + dartDoc: 'test line 1\ntest line 2', + enumConstants: [ + EnumConstant( + name: 'a', + value: 10, ), + EnumConstant(name: 'b', value: -1, dartDoc: 'negative'), ], ), ], @@ -550,8 +540,9 @@ const double test2 = 20.0; final gen = library.generate(); // Writing to file for debug purpose. - final file = - File('test/debug_generated/typedef-Binding-test-output.dart'); + final file = File( + 'test/debug_generated/enum-class-test-output.dart', + ); try { expect(gen, '''/// AUTO GENERATED FILE, DO NOT EDIT. /// @@ -562,21 +553,17 @@ import 'dart:ffi' as ffi; ffi.DynamicLibrary _dylib; /// Initialises the Dynamic library. -void init(ffi.DynamicLibrary dylib){ - _dylib = dylib; +void init(ffi.DynamicLibrary dynamicLibrary){ + _dylib = dynamicLibrary; } -/// just a test -typedef test1 = ffi.Int32 Function( -); - -class SomeStruct extends ffi.Struct{ +/// test line 1 +/// test line 2 +class Constants { + static const int a = 10; + /// negative + static const int b = -1; } -typedef test2 = ffi.Pointer Function( - ffi.Pointer param1, - ffi.Uint8 param2, -); - '''); if (file.existsSync()) { file.delete(); @@ -587,21 +574,52 @@ typedef test2 = ffi.Pointer Function( rethrow; } }); - - test('enum_class', () { + test('Internal conflict resolution', () { final library = Library( + initFunctionIdentifier: 'init_dylib', bindings: [ - EnumClass( - name: 'Constants', - dartDoc: 'test line 1\ntest line 2', - enumConstants: [ - EnumConstant( - name: 'a', - value: 10, + Func( + name: 'test', + lookupSymbolName: 'test', + returnType: Type.nativeType(SupportedNativeType.Void), + ), + Func( + name: '_test', + lookupSymbolName: '_test', + returnType: Type.nativeType(SupportedNativeType.Void), + ), + Func( + name: '_c_test', + lookupSymbolName: '_c_test', + returnType: Type.nativeType(SupportedNativeType.Void), + ), + Func( + name: '_dart_test', + lookupSymbolName: '_dart_test', + returnType: Type.nativeType(SupportedNativeType.Void), + ), + Struc( + name: '_Test', + members: [ + Member( + name: 'array', + type: Type.constantArray( + 2, + Type.nativeType( + SupportedNativeType.Int8, + ), + ), ), - EnumConstant(name: 'b', value: -1, dartDoc: 'negative'), ], ), + Struc(name: 'ArrayHelperPrefixCollisionTest'), + Func( + name: 'Test', + lookupSymbolName: 'Test', + returnType: Type.nativeType(SupportedNativeType.Void), + ), + EnumClass(name: '_c_Test'), + EnumClass(name: 'init_dylib'), ], ); @@ -609,10 +627,10 @@ typedef test2 = ffi.Pointer Function( // Writing to file for debug purpose. final file = File( - 'test/debug_generated/enum-class-test-output.dart', + 'test/debug_generated/internal-conflict-resolution.dart', ); try { - expect(gen, '''/// AUTO GENERATED FILE, DO NOT EDIT. + expect(gen, r'''/// AUTO GENERATED FILE, DO NOT EDIT. /// /// Generated by `package:ffigen`. import 'dart:ffi' as ffi; @@ -621,15 +639,132 @@ import 'dart:ffi' as ffi; ffi.DynamicLibrary _dylib; /// Initialises the Dynamic library. -void init(ffi.DynamicLibrary dylib){ - _dylib = dylib; +void init_dylib_1(ffi.DynamicLibrary dynamicLibrary){ + _dylib = dynamicLibrary; } -/// test line 1 -/// test line 2 -class Constants { - static const int a = 10; - /// negative - static const int b = -1; +void test( +) { + return _test_1( + ); +} + +final _dart_test_1 _test_1 = _dylib.lookupFunction<_c_test_1,_dart_test_1>('test'); + +typedef _c_test_1 = ffi.Void Function( +); + +typedef _dart_test_1 = void Function( +); + +void _test( +) { + return __test( + ); +} + +final _dart__test __test = _dylib.lookupFunction<_c__test,_dart__test>('_test'); + +typedef _c__test = ffi.Void Function( +); + +typedef _dart__test = void Function( +); + +void _c_test( +) { + return __c_test( + ); +} + +final _dart__c_test __c_test = _dylib.lookupFunction<_c__c_test,_dart__c_test>('_c_test'); + +typedef _c__c_test = ffi.Void Function( +); + +typedef _dart__c_test = void Function( +); + +void _dart_test( +) { + return __dart_test( + ); +} + +final _dart__dart_test __dart_test = _dylib.lookupFunction<_c__dart_test,_dart__dart_test>('_dart_test'); + +typedef _c__dart_test = ffi.Void Function( +); + +typedef _dart__dart_test = void Function( +); + +class _Test extends ffi.Struct{ + @ffi.Int8() + int _exp_workaround_array_item_0; + @ffi.Int8() + int _exp_workaround_array_item_1; +/// Helper for array `array`. +ArrayHelper1__Test_array_level0 get array => ArrayHelper1__Test_array_level0(this, [2], 0, 0); +} + +/// Helper for array `array` in struct `_Test`. +class ArrayHelper1__Test_array_level0{ +final _Test _struct; +final List dimensions; +final int level; +final int _absoluteIndex; +int get length => dimensions[level]; +ArrayHelper1__Test_array_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._exp_workaround_array_item_0; +case 1: + return _struct._exp_workaround_array_item_1; +default: + throw Exception('Invalid Array Helper generated.');} +} +void operator[]=(int index, int value){ +_checkBounds(index); +switch(_absoluteIndex+index){ +case 0: + _struct._exp_workaround_array_item_0 = value; + break; +case 1: + _struct._exp_workaround_array_item_1 = value; + break; +default: + throw Exception('Invalid Array Helper generated.'); +} +} +} +class ArrayHelperPrefixCollisionTest extends ffi.Struct{ +} + +void Test( +) { + return _Test_1( + ); +} + +final _dart_Test _Test_1 = _dylib.lookupFunction<_c_Test_1,_dart_Test>('Test'); + +typedef _c_Test_1 = ffi.Void Function( +); + +typedef _dart_Test = void Function( +); + +class _c_Test { +} + +class init_dylib { } '''); diff --git a/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart new file mode 100644 index 0000000000..a96d763d6c --- /dev/null +++ b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart @@ -0,0 +1,29 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:test/test.dart'; + +void main() { + group('Declaration-Declaration Collision', () { + test('struct-func', () { + final l1 = Library(bindings: [ + Func( + name: 'test', + returnType: Type.nativeType(SupportedNativeType.Void), + ), + Struc(name: 'test'), + ]); + final l2 = Library(bindings: [ + Func( + name: 'test', + returnType: Type.nativeType(SupportedNativeType.Void), + ), + Struc(name: 'test_1'), + ]); + + expect(l1.generate(), l2.generate()); + }); + }); +} diff --git a/pkgs/ffigen/test/header_parser_tests/functions_test.dart b/pkgs/ffigen/test/header_parser_tests/functions_test.dart index f9e261e80d..fa09f9c202 100644 --- a/pkgs/ffigen/test/header_parser_tests/functions_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/functions_test.dart @@ -2,47 +2,37 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'dart:io'; - import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/code_generator/writer.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/config_provider.dart'; import 'package:logging/logging.dart'; import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; +import 'package:ffigen/src/strings.dart' as strings; -final writer = Writer(); +Library actual, expected; void main() { group('header_parser', () { - Library actual, expected; - setUpAll(() { expected = expectedLibrary(); - var dylibPath = 'tool/wrapped_libclang/libwrapped_clang.so'; - if (Platform.isMacOS) { - dylibPath = 'tool/wrapped_libclang/libwrapped_clang.dylib'; - } else if (Platform.isWindows) { - dylibPath = 'tool/wrapped_libclang/wrapped_clang.dll'; - } - Logger.root.onRecord.listen((log) { - print('${log.level.name.padRight(8)}: ${log.message}'); + if (log.level > Level.INFO) { + print( + 'functions_test.dart: ${log.level.name.padRight(8)}: ${log.message}'); + } }); - actual = parser.parse( - Config.raw( - libclang_dylib_path: dylibPath, - headers: [ - 'test/header_parser_tests/functions.h', - ], - headerFilter: HeaderFilter( - includedInclusionHeaders: { - 'functions.h', - }, - ), - ), + Config.fromYaml(yaml.loadYaml(''' +${strings.output}: 'unused' +${strings.libclang_dylib_folder}: 'tool/wrapped_libclang' +${strings.headers}: + - 'test/header_parser_tests/functions.h' +${strings.headerFilter}: + ${strings.include}: + - 'functions.h' + ''') as yaml.YamlMap), ); }); test('Total bindings count', () { @@ -69,7 +59,7 @@ void main() { String binding(Library lib, String name) { return lib.bindings .firstWhere((element) => element.name == name) - .toBindingString(writer) + .toBindingString(lib.writer) .string; } @@ -78,12 +68,14 @@ Library expectedLibrary() { bindings: [ Func( name: 'func1', + lookupSymbolName: 'func1', returnType: Type.nativeType( SupportedNativeType.Void, ), ), Func( name: 'func2', + lookupSymbolName: 'func2', returnType: Type.nativeType( SupportedNativeType.Int32, ), @@ -98,6 +90,7 @@ Library expectedLibrary() { ), Func( name: 'func3', + lookupSymbolName: 'func3', returnType: Type.nativeType( SupportedNativeType.Double, ), @@ -129,6 +122,7 @@ Library expectedLibrary() { ), Func( name: 'func4', + lookupSymbolName: 'func4', returnType: Type.pointer(Type.nativeType(SupportedNativeType.Void)), parameters: [ Parameter( diff --git a/pkgs/ffigen/test/prefix_tests/prefix.h b/pkgs/ffigen/test/prefix_tests/prefix.h new file mode 100644 index 0000000000..1e8b72da3d --- /dev/null +++ b/pkgs/ffigen/test/prefix_tests/prefix.h @@ -0,0 +1,26 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +struct Struct1 +{ +}; +struct Test_Struct2 +{ +}; + +void func1(struct Struct1 *s); +void test_func2(struct Test_Struct2 *s); + +enum Enum1 +{ + a = 0, + b = 1, + c = 2 +}; +enum Test_Enum2 +{ + e = 0, + f = 1, + g = 2 +}; diff --git a/pkgs/ffigen/test/prefix_tests/prefix_test.dart b/pkgs/ffigen/test/prefix_tests/prefix_test.dart new file mode 100644 index 0000000000..d0397e4a38 --- /dev/null +++ b/pkgs/ffigen/test/prefix_tests/prefix_test.dart @@ -0,0 +1,150 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/config_provider.dart'; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; +import 'package:ffigen/src/strings.dart' as strings; + +Library actual, expected; +final functionPrefix = 'fff'; +final structPrefix = 'sss'; +final enumPrefix = 'eee'; + +final functionPrefixReplacedWith = 'rf'; +final structPrefixReplacedWith = 'rs'; +final enumPrefixReplacedWith = 're'; + +void main() { + group('Global Prefix Test', () { + setUpAll(() { + Logger.root.onRecord.listen((log) { + if (log.level > Level.INFO) { + print( + 'prefix_test.dart: ${log.level.name.padRight(8)}: ${log.message}'); + } + }); + expected = expectedLibrary(); + actual = parser.parse(Config.fromYaml(yaml.loadYaml(''' +${strings.output}: 'unused' +${strings.libclang_dylib_folder}: 'tool/wrapped_libclang' +${strings.headers}: + - 'test/prefix_tests/prefix.h' +${strings.headerFilter}: + ${strings.include}: + - 'prefix.h' + +functions: + ${strings.prefix}: $functionPrefix + ${strings.prefix_replacement}: + 'test_': '$functionPrefixReplacedWith' + +structs: + ${strings.prefix}: $structPrefix + ${strings.prefix_replacement}: + 'Test_': '$structPrefixReplacedWith' + +enums: + ${strings.prefix}: $enumPrefix + ${strings.prefix_replacement}: + 'Test_': '$enumPrefixReplacedWith' + + ''') as yaml.YamlMap)); + }); + + test('Function prefix', () { + expect(binding(actual, '${functionPrefix}func1'), + binding(expected, '${functionPrefix}func1')); + }); + test('Struct prefix', () { + expect(binding(actual, '${structPrefix}Struct1'), + binding(expected, '${structPrefix}Struct1')); + }); + test('Enum prefix', () { + expect(binding(actual, '${enumPrefix}Enum1'), + binding(expected, '${enumPrefix}Enum1')); + }); + test('Function prefix-replacement', () { + expect( + binding( + actual, '${functionPrefix}${functionPrefixReplacedWith}func2'), + binding( + expected, '${functionPrefix}${functionPrefixReplacedWith}func2')); + }); + test('Struct prefix-replacement', () { + expect( + binding(actual, '${structPrefix}${structPrefixReplacedWith}Struct2'), + binding( + expected, '${structPrefix}${structPrefixReplacedWith}Struct2')); + }); + test('Enum prefix-replacement', () { + expect(binding(actual, '${enumPrefix}${enumPrefixReplacedWith}Enum2'), + binding(expected, '${enumPrefix}${enumPrefixReplacedWith}Enum2')); + }); + }); +} + +/// Extracts a binding's string with a given name from a library. +String binding(Library lib, String name) { + return lib.bindings + .firstWhere((element) => element.name == name) + .toBindingString(lib.writer) + .string; +} + +Library expectedLibrary() { + final struc1 = Struc(name: '${structPrefix}Struct1'); + final struc2 = + Struc(name: '${structPrefix}${structPrefixReplacedWith}Struct2'); + return Library( + bindings: [ + Func( + name: '${functionPrefix}func1', + lookupSymbolName: 'func1', + returnType: Type.nativeType( + SupportedNativeType.Void, + ), + parameters: [ + Parameter( + name: 's', + type: Type.pointer(Type.struct(struc1)), + ), + ], + ), + Func( + name: '${functionPrefix}${functionPrefixReplacedWith}func2', + lookupSymbolName: 'test_func2', + returnType: Type.nativeType( + SupportedNativeType.Void, + ), + parameters: [ + Parameter( + name: 's', + type: Type.pointer(Type.struct(struc2)), + ), + ], + ), + struc1, + struc2, + EnumClass( + name: '${enumPrefix}Enum1', + enumConstants: [ + EnumConstant(name: 'a', value: 0), + EnumConstant(name: 'b', value: 1), + EnumConstant(name: 'c', value: 2), + ], + ), + EnumClass( + name: '${enumPrefix}${enumPrefixReplacedWith}Enum2', + enumConstants: [ + EnumConstant(name: 'e', value: 0), + EnumConstant(name: 'f', value: 1), + EnumConstant(name: 'g', value: 2), + ], + ), + ], + ); +} From b60cc611b3971edebe36436db82ddf61264b71f9 Mon Sep 17 00:00:00 2001 From: Prerak Mann <31154435+mannprerak2@users.noreply.github.com> Date: Fri, 10 Jul 2020 16:48:31 +0530 Subject: [PATCH 011/276] [ffigen] Added wrapper over lookUpbindings, fixed merge conflicts, migrated code (#25) Closes #10. Moves the functions from toplevel to a class to facilitate being able to use the bindings more flexibly. * Replaced config init-function-name with name and description. * Handled name conflicts - Function-Function, Typedef - Function - Struct/Enum. * Updated examples and clang_bindings, Updated tests. --- .../c_json/cjson_generated_bindings.dart | 2017 ++-- pkgs/ffigen/example/c_json/main.dart | 13 +- pkgs/ffigen/example/c_json/pubspec.yaml | 2 + .../libclang-example/generated_bindings.dart | 8533 +++++++++-------- .../example/libclang-example/pubspec.yaml | 6 +- .../example/simple/generated_bindings.dart | 157 +- pkgs/ffigen/example/simple/pubspec.yaml | 2 + pkgs/ffigen/lib/src/code_generator.dart | 2 +- .../lib/src/code_generator/binding.dart | 21 + .../lib/src/code_generator/constant.dart | 11 +- .../lib/src/code_generator/enum_class.dart | 13 +- pkgs/ffigen/lib/src/code_generator/func.dart | 102 +- .../ffigen/lib/src/code_generator/global.dart | 17 +- .../lib/src/code_generator/library.dart | 49 +- pkgs/ffigen/lib/src/code_generator/struc.dart | 36 +- pkgs/ffigen/lib/src/code_generator/type.dart | 8 +- .../lib/src/code_generator/typedef.dart | 67 + .../lib/src/code_generator/typedefc.dart | 54 - pkgs/ffigen/lib/src/code_generator/utils.dart | 12 + .../ffigen/lib/src/code_generator/writer.dart | 128 +- .../lib/src/config_provider/config.dart | 68 +- .../lib/src/config_provider/spec_utils.dart | 11 + .../clang_bindings/clang_bindings.dart | 2147 +++-- pkgs/ffigen/lib/src/header_parser/data.dart | 5 + pkgs/ffigen/lib/src/header_parser/parser.dart | 29 +- .../sub_parsers/enumdecl_parser.dart | 19 +- .../sub_parsers/functiondecl_parser.dart | 16 +- .../sub_parsers/structdecl_parser.dart | 16 +- .../sub_parsers/typedefdecl_parser.dart | 17 +- .../translation_unit_parser.dart | 22 +- .../type_extractor/extractor.dart | 47 +- pkgs/ffigen/lib/src/header_parser/utils.dart | 42 +- pkgs/ffigen/lib/src/strings.dart | 3 +- pkgs/ffigen/test/code_generator_test.dart | 256 +- .../decl_decl_collision_test.dart | 34 +- .../header_parser_tests/functions_test.dart | 3 + .../ffigen/test/prefix_tests/prefix_test.dart | 3 + pkgs/ffigen/tool/libclang_config.yaml | 2 + 38 files changed, 7220 insertions(+), 6770 deletions(-) create mode 100644 pkgs/ffigen/lib/src/code_generator/typedef.dart delete mode 100644 pkgs/ffigen/lib/src/code_generator/typedefc.dart diff --git a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart index e26ed6a477..25900b1fa3 100644 --- a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart +++ b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart @@ -3,12 +3,1037 @@ /// Generated by `package:ffigen`. import 'dart:ffi' as ffi; -/// Holds the Dynamic library. -ffi.DynamicLibrary _dylib; - -/// Initialises the Dynamic library. -void init(ffi.DynamicLibrary dynamicLibrary) { - _dylib = dynamicLibrary; +/// Holds bindings to cJSON. +class CJson { + /// Holds the Dynamic library. + final ffi.DynamicLibrary _dylib; + + /// The symbols are looked up in [dynamicLibrary]. + CJson(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + + ffi.Pointer cJSON_Version() { + _cJSON_Version ??= _dylib + .lookupFunction<_c_cJSON_Version, _dart_cJSON_Version>('cJSON_Version'); + return _cJSON_Version(); + } + + _dart_cJSON_Version _cJSON_Version; + + void cJSON_InitHooks( + ffi.Pointer hooks, + ) { + _cJSON_InitHooks ??= + _dylib.lookupFunction<_c_cJSON_InitHooks, _dart_cJSON_InitHooks>( + 'cJSON_InitHooks'); + return _cJSON_InitHooks( + hooks, + ); + } + + _dart_cJSON_InitHooks _cJSON_InitHooks; + + ffi.Pointer cJSON_Parse( + ffi.Pointer value, + ) { + _cJSON_Parse ??= + _dylib.lookupFunction<_c_cJSON_Parse, _dart_cJSON_Parse>('cJSON_Parse'); + return _cJSON_Parse( + value, + ); + } + + _dart_cJSON_Parse _cJSON_Parse; + + ffi.Pointer cJSON_ParseWithOpts( + ffi.Pointer value, + ffi.Pointer> return_parse_end, + int require_null_terminated, + ) { + _cJSON_ParseWithOpts ??= _dylib.lookupFunction<_c_cJSON_ParseWithOpts, + _dart_cJSON_ParseWithOpts>('cJSON_ParseWithOpts'); + return _cJSON_ParseWithOpts( + value, + return_parse_end, + require_null_terminated, + ); + } + + _dart_cJSON_ParseWithOpts _cJSON_ParseWithOpts; + + ffi.Pointer cJSON_Print( + ffi.Pointer item, + ) { + _cJSON_Print ??= + _dylib.lookupFunction<_c_cJSON_Print, _dart_cJSON_Print>('cJSON_Print'); + return _cJSON_Print( + item, + ); + } + + _dart_cJSON_Print _cJSON_Print; + + ffi.Pointer cJSON_PrintUnformatted( + ffi.Pointer item, + ) { + _cJSON_PrintUnformatted ??= _dylib.lookupFunction<_c_cJSON_PrintUnformatted, + _dart_cJSON_PrintUnformatted>('cJSON_PrintUnformatted'); + return _cJSON_PrintUnformatted( + item, + ); + } + + _dart_cJSON_PrintUnformatted _cJSON_PrintUnformatted; + + ffi.Pointer cJSON_PrintBuffered( + ffi.Pointer item, + int prebuffer, + int fmt, + ) { + _cJSON_PrintBuffered ??= _dylib.lookupFunction<_c_cJSON_PrintBuffered, + _dart_cJSON_PrintBuffered>('cJSON_PrintBuffered'); + return _cJSON_PrintBuffered( + item, + prebuffer, + fmt, + ); + } + + _dart_cJSON_PrintBuffered _cJSON_PrintBuffered; + + int cJSON_PrintPreallocated( + ffi.Pointer item, + ffi.Pointer buffer, + int length, + int format, + ) { + _cJSON_PrintPreallocated ??= _dylib.lookupFunction< + _c_cJSON_PrintPreallocated, + _dart_cJSON_PrintPreallocated>('cJSON_PrintPreallocated'); + return _cJSON_PrintPreallocated( + item, + buffer, + length, + format, + ); + } + + _dart_cJSON_PrintPreallocated _cJSON_PrintPreallocated; + + void cJSON_Delete( + ffi.Pointer item, + ) { + _cJSON_Delete ??= _dylib + .lookupFunction<_c_cJSON_Delete, _dart_cJSON_Delete>('cJSON_Delete'); + return _cJSON_Delete( + item, + ); + } + + _dart_cJSON_Delete _cJSON_Delete; + + int cJSON_GetArraySize( + ffi.Pointer array, + ) { + _cJSON_GetArraySize ??= + _dylib.lookupFunction<_c_cJSON_GetArraySize, _dart_cJSON_GetArraySize>( + 'cJSON_GetArraySize'); + return _cJSON_GetArraySize( + array, + ); + } + + _dart_cJSON_GetArraySize _cJSON_GetArraySize; + + ffi.Pointer cJSON_GetArrayItem( + ffi.Pointer array, + int index, + ) { + _cJSON_GetArrayItem ??= + _dylib.lookupFunction<_c_cJSON_GetArrayItem, _dart_cJSON_GetArrayItem>( + 'cJSON_GetArrayItem'); + return _cJSON_GetArrayItem( + array, + index, + ); + } + + _dart_cJSON_GetArrayItem _cJSON_GetArrayItem; + + ffi.Pointer cJSON_GetObjectItem( + ffi.Pointer object, + ffi.Pointer string, + ) { + _cJSON_GetObjectItem ??= _dylib.lookupFunction<_c_cJSON_GetObjectItem, + _dart_cJSON_GetObjectItem>('cJSON_GetObjectItem'); + return _cJSON_GetObjectItem( + object, + string, + ); + } + + _dart_cJSON_GetObjectItem _cJSON_GetObjectItem; + + ffi.Pointer cJSON_GetObjectItemCaseSensitive( + ffi.Pointer object, + ffi.Pointer string, + ) { + _cJSON_GetObjectItemCaseSensitive ??= _dylib.lookupFunction< + _c_cJSON_GetObjectItemCaseSensitive, + _dart_cJSON_GetObjectItemCaseSensitive>( + 'cJSON_GetObjectItemCaseSensitive'); + return _cJSON_GetObjectItemCaseSensitive( + object, + string, + ); + } + + _dart_cJSON_GetObjectItemCaseSensitive _cJSON_GetObjectItemCaseSensitive; + + int cJSON_HasObjectItem( + ffi.Pointer object, + ffi.Pointer string, + ) { + _cJSON_HasObjectItem ??= _dylib.lookupFunction<_c_cJSON_HasObjectItem, + _dart_cJSON_HasObjectItem>('cJSON_HasObjectItem'); + return _cJSON_HasObjectItem( + object, + string, + ); + } + + _dart_cJSON_HasObjectItem _cJSON_HasObjectItem; + + ffi.Pointer cJSON_GetErrorPtr() { + _cJSON_GetErrorPtr ??= + _dylib.lookupFunction<_c_cJSON_GetErrorPtr, _dart_cJSON_GetErrorPtr>( + 'cJSON_GetErrorPtr'); + return _cJSON_GetErrorPtr(); + } + + _dart_cJSON_GetErrorPtr _cJSON_GetErrorPtr; + + ffi.Pointer cJSON_GetStringValue( + ffi.Pointer item, + ) { + _cJSON_GetStringValue ??= _dylib.lookupFunction<_c_cJSON_GetStringValue, + _dart_cJSON_GetStringValue>('cJSON_GetStringValue'); + return _cJSON_GetStringValue( + item, + ); + } + + _dart_cJSON_GetStringValue _cJSON_GetStringValue; + + int cJSON_IsInvalid( + ffi.Pointer item, + ) { + _cJSON_IsInvalid ??= + _dylib.lookupFunction<_c_cJSON_IsInvalid, _dart_cJSON_IsInvalid>( + 'cJSON_IsInvalid'); + return _cJSON_IsInvalid( + item, + ); + } + + _dart_cJSON_IsInvalid _cJSON_IsInvalid; + + int cJSON_IsFalse( + ffi.Pointer item, + ) { + _cJSON_IsFalse ??= _dylib + .lookupFunction<_c_cJSON_IsFalse, _dart_cJSON_IsFalse>('cJSON_IsFalse'); + return _cJSON_IsFalse( + item, + ); + } + + _dart_cJSON_IsFalse _cJSON_IsFalse; + + int cJSON_IsTrue( + ffi.Pointer item, + ) { + _cJSON_IsTrue ??= _dylib + .lookupFunction<_c_cJSON_IsTrue, _dart_cJSON_IsTrue>('cJSON_IsTrue'); + return _cJSON_IsTrue( + item, + ); + } + + _dart_cJSON_IsTrue _cJSON_IsTrue; + + int cJSON_IsBool( + ffi.Pointer item, + ) { + _cJSON_IsBool ??= _dylib + .lookupFunction<_c_cJSON_IsBool, _dart_cJSON_IsBool>('cJSON_IsBool'); + return _cJSON_IsBool( + item, + ); + } + + _dart_cJSON_IsBool _cJSON_IsBool; + + int cJSON_IsNull( + ffi.Pointer item, + ) { + _cJSON_IsNull ??= _dylib + .lookupFunction<_c_cJSON_IsNull, _dart_cJSON_IsNull>('cJSON_IsNull'); + return _cJSON_IsNull( + item, + ); + } + + _dart_cJSON_IsNull _cJSON_IsNull; + + int cJSON_IsNumber( + ffi.Pointer item, + ) { + _cJSON_IsNumber ??= + _dylib.lookupFunction<_c_cJSON_IsNumber, _dart_cJSON_IsNumber>( + 'cJSON_IsNumber'); + return _cJSON_IsNumber( + item, + ); + } + + _dart_cJSON_IsNumber _cJSON_IsNumber; + + int cJSON_IsString( + ffi.Pointer item, + ) { + _cJSON_IsString ??= + _dylib.lookupFunction<_c_cJSON_IsString, _dart_cJSON_IsString>( + 'cJSON_IsString'); + return _cJSON_IsString( + item, + ); + } + + _dart_cJSON_IsString _cJSON_IsString; + + int cJSON_IsArray( + ffi.Pointer item, + ) { + _cJSON_IsArray ??= _dylib + .lookupFunction<_c_cJSON_IsArray, _dart_cJSON_IsArray>('cJSON_IsArray'); + return _cJSON_IsArray( + item, + ); + } + + _dart_cJSON_IsArray _cJSON_IsArray; + + int cJSON_IsObject( + ffi.Pointer item, + ) { + _cJSON_IsObject ??= + _dylib.lookupFunction<_c_cJSON_IsObject, _dart_cJSON_IsObject>( + 'cJSON_IsObject'); + return _cJSON_IsObject( + item, + ); + } + + _dart_cJSON_IsObject _cJSON_IsObject; + + int cJSON_IsRaw( + ffi.Pointer item, + ) { + _cJSON_IsRaw ??= + _dylib.lookupFunction<_c_cJSON_IsRaw, _dart_cJSON_IsRaw>('cJSON_IsRaw'); + return _cJSON_IsRaw( + item, + ); + } + + _dart_cJSON_IsRaw _cJSON_IsRaw; + + ffi.Pointer cJSON_CreateNull() { + _cJSON_CreateNull ??= + _dylib.lookupFunction<_c_cJSON_CreateNull, _dart_cJSON_CreateNull>( + 'cJSON_CreateNull'); + return _cJSON_CreateNull(); + } + + _dart_cJSON_CreateNull _cJSON_CreateNull; + + ffi.Pointer cJSON_CreateTrue() { + _cJSON_CreateTrue ??= + _dylib.lookupFunction<_c_cJSON_CreateTrue, _dart_cJSON_CreateTrue>( + 'cJSON_CreateTrue'); + return _cJSON_CreateTrue(); + } + + _dart_cJSON_CreateTrue _cJSON_CreateTrue; + + ffi.Pointer cJSON_CreateFalse() { + _cJSON_CreateFalse ??= + _dylib.lookupFunction<_c_cJSON_CreateFalse, _dart_cJSON_CreateFalse>( + 'cJSON_CreateFalse'); + return _cJSON_CreateFalse(); + } + + _dart_cJSON_CreateFalse _cJSON_CreateFalse; + + ffi.Pointer cJSON_CreateBool( + int boolean, + ) { + _cJSON_CreateBool ??= + _dylib.lookupFunction<_c_cJSON_CreateBool, _dart_cJSON_CreateBool>( + 'cJSON_CreateBool'); + return _cJSON_CreateBool( + boolean, + ); + } + + _dart_cJSON_CreateBool _cJSON_CreateBool; + + ffi.Pointer cJSON_CreateNumber( + double num, + ) { + _cJSON_CreateNumber ??= + _dylib.lookupFunction<_c_cJSON_CreateNumber, _dart_cJSON_CreateNumber>( + 'cJSON_CreateNumber'); + return _cJSON_CreateNumber( + num, + ); + } + + _dart_cJSON_CreateNumber _cJSON_CreateNumber; + + ffi.Pointer cJSON_CreateString( + ffi.Pointer string, + ) { + _cJSON_CreateString ??= + _dylib.lookupFunction<_c_cJSON_CreateString, _dart_cJSON_CreateString>( + 'cJSON_CreateString'); + return _cJSON_CreateString( + string, + ); + } + + _dart_cJSON_CreateString _cJSON_CreateString; + + ffi.Pointer cJSON_CreateRaw( + ffi.Pointer raw, + ) { + _cJSON_CreateRaw ??= + _dylib.lookupFunction<_c_cJSON_CreateRaw, _dart_cJSON_CreateRaw>( + 'cJSON_CreateRaw'); + return _cJSON_CreateRaw( + raw, + ); + } + + _dart_cJSON_CreateRaw _cJSON_CreateRaw; + + ffi.Pointer cJSON_CreateArray() { + _cJSON_CreateArray ??= + _dylib.lookupFunction<_c_cJSON_CreateArray, _dart_cJSON_CreateArray>( + 'cJSON_CreateArray'); + return _cJSON_CreateArray(); + } + + _dart_cJSON_CreateArray _cJSON_CreateArray; + + ffi.Pointer cJSON_CreateObject() { + _cJSON_CreateObject ??= + _dylib.lookupFunction<_c_cJSON_CreateObject, _dart_cJSON_CreateObject>( + 'cJSON_CreateObject'); + return _cJSON_CreateObject(); + } + + _dart_cJSON_CreateObject _cJSON_CreateObject; + + ffi.Pointer cJSON_CreateStringReference( + ffi.Pointer string, + ) { + _cJSON_CreateStringReference ??= _dylib.lookupFunction< + _c_cJSON_CreateStringReference, + _dart_cJSON_CreateStringReference>('cJSON_CreateStringReference'); + return _cJSON_CreateStringReference( + string, + ); + } + + _dart_cJSON_CreateStringReference _cJSON_CreateStringReference; + + ffi.Pointer cJSON_CreateObjectReference( + ffi.Pointer child, + ) { + _cJSON_CreateObjectReference ??= _dylib.lookupFunction< + _c_cJSON_CreateObjectReference, + _dart_cJSON_CreateObjectReference>('cJSON_CreateObjectReference'); + return _cJSON_CreateObjectReference( + child, + ); + } + + _dart_cJSON_CreateObjectReference _cJSON_CreateObjectReference; + + ffi.Pointer cJSON_CreateArrayReference( + ffi.Pointer child, + ) { + _cJSON_CreateArrayReference ??= _dylib.lookupFunction< + _c_cJSON_CreateArrayReference, + _dart_cJSON_CreateArrayReference>('cJSON_CreateArrayReference'); + return _cJSON_CreateArrayReference( + child, + ); + } + + _dart_cJSON_CreateArrayReference _cJSON_CreateArrayReference; + + ffi.Pointer cJSON_CreateIntArray( + ffi.Pointer numbers, + int count, + ) { + _cJSON_CreateIntArray ??= _dylib.lookupFunction<_c_cJSON_CreateIntArray, + _dart_cJSON_CreateIntArray>('cJSON_CreateIntArray'); + return _cJSON_CreateIntArray( + numbers, + count, + ); + } + + _dart_cJSON_CreateIntArray _cJSON_CreateIntArray; + + ffi.Pointer cJSON_CreateFloatArray( + ffi.Pointer numbers, + int count, + ) { + _cJSON_CreateFloatArray ??= _dylib.lookupFunction<_c_cJSON_CreateFloatArray, + _dart_cJSON_CreateFloatArray>('cJSON_CreateFloatArray'); + return _cJSON_CreateFloatArray( + numbers, + count, + ); + } + + _dart_cJSON_CreateFloatArray _cJSON_CreateFloatArray; + + ffi.Pointer cJSON_CreateDoubleArray( + ffi.Pointer numbers, + int count, + ) { + _cJSON_CreateDoubleArray ??= _dylib.lookupFunction< + _c_cJSON_CreateDoubleArray, + _dart_cJSON_CreateDoubleArray>('cJSON_CreateDoubleArray'); + return _cJSON_CreateDoubleArray( + numbers, + count, + ); + } + + _dart_cJSON_CreateDoubleArray _cJSON_CreateDoubleArray; + + ffi.Pointer cJSON_CreateStringArray( + ffi.Pointer> strings, + int count, + ) { + _cJSON_CreateStringArray ??= _dylib.lookupFunction< + _c_cJSON_CreateStringArray, + _dart_cJSON_CreateStringArray>('cJSON_CreateStringArray'); + return _cJSON_CreateStringArray( + strings, + count, + ); + } + + _dart_cJSON_CreateStringArray _cJSON_CreateStringArray; + + void cJSON_AddItemToArray( + ffi.Pointer array, + ffi.Pointer item, + ) { + _cJSON_AddItemToArray ??= _dylib.lookupFunction<_c_cJSON_AddItemToArray, + _dart_cJSON_AddItemToArray>('cJSON_AddItemToArray'); + return _cJSON_AddItemToArray( + array, + item, + ); + } + + _dart_cJSON_AddItemToArray _cJSON_AddItemToArray; + + void cJSON_AddItemToObject( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer item, + ) { + _cJSON_AddItemToObject ??= _dylib.lookupFunction<_c_cJSON_AddItemToObject, + _dart_cJSON_AddItemToObject>('cJSON_AddItemToObject'); + return _cJSON_AddItemToObject( + object, + string, + item, + ); + } + + _dart_cJSON_AddItemToObject _cJSON_AddItemToObject; + + void cJSON_AddItemToObjectCS( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer item, + ) { + _cJSON_AddItemToObjectCS ??= _dylib.lookupFunction< + _c_cJSON_AddItemToObjectCS, + _dart_cJSON_AddItemToObjectCS>('cJSON_AddItemToObjectCS'); + return _cJSON_AddItemToObjectCS( + object, + string, + item, + ); + } + + _dart_cJSON_AddItemToObjectCS _cJSON_AddItemToObjectCS; + + void cJSON_AddItemReferenceToArray( + ffi.Pointer array, + ffi.Pointer item, + ) { + _cJSON_AddItemReferenceToArray ??= _dylib.lookupFunction< + _c_cJSON_AddItemReferenceToArray, + _dart_cJSON_AddItemReferenceToArray>('cJSON_AddItemReferenceToArray'); + return _cJSON_AddItemReferenceToArray( + array, + item, + ); + } + + _dart_cJSON_AddItemReferenceToArray _cJSON_AddItemReferenceToArray; + + void cJSON_AddItemReferenceToObject( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer item, + ) { + _cJSON_AddItemReferenceToObject ??= _dylib.lookupFunction< + _c_cJSON_AddItemReferenceToObject, + _dart_cJSON_AddItemReferenceToObject>('cJSON_AddItemReferenceToObject'); + return _cJSON_AddItemReferenceToObject( + object, + string, + item, + ); + } + + _dart_cJSON_AddItemReferenceToObject _cJSON_AddItemReferenceToObject; + + ffi.Pointer cJSON_DetachItemViaPointer( + ffi.Pointer parent, + ffi.Pointer item, + ) { + _cJSON_DetachItemViaPointer ??= _dylib.lookupFunction< + _c_cJSON_DetachItemViaPointer, + _dart_cJSON_DetachItemViaPointer>('cJSON_DetachItemViaPointer'); + return _cJSON_DetachItemViaPointer( + parent, + item, + ); + } + + _dart_cJSON_DetachItemViaPointer _cJSON_DetachItemViaPointer; + + ffi.Pointer cJSON_DetachItemFromArray( + ffi.Pointer array, + int which, + ) { + _cJSON_DetachItemFromArray ??= _dylib.lookupFunction< + _c_cJSON_DetachItemFromArray, + _dart_cJSON_DetachItemFromArray>('cJSON_DetachItemFromArray'); + return _cJSON_DetachItemFromArray( + array, + which, + ); + } + + _dart_cJSON_DetachItemFromArray _cJSON_DetachItemFromArray; + + void cJSON_DeleteItemFromArray( + ffi.Pointer array, + int which, + ) { + _cJSON_DeleteItemFromArray ??= _dylib.lookupFunction< + _c_cJSON_DeleteItemFromArray, + _dart_cJSON_DeleteItemFromArray>('cJSON_DeleteItemFromArray'); + return _cJSON_DeleteItemFromArray( + array, + which, + ); + } + + _dart_cJSON_DeleteItemFromArray _cJSON_DeleteItemFromArray; + + ffi.Pointer cJSON_DetachItemFromObject( + ffi.Pointer object, + ffi.Pointer string, + ) { + _cJSON_DetachItemFromObject ??= _dylib.lookupFunction< + _c_cJSON_DetachItemFromObject, + _dart_cJSON_DetachItemFromObject>('cJSON_DetachItemFromObject'); + return _cJSON_DetachItemFromObject( + object, + string, + ); + } + + _dart_cJSON_DetachItemFromObject _cJSON_DetachItemFromObject; + + ffi.Pointer cJSON_DetachItemFromObjectCaseSensitive( + ffi.Pointer object, + ffi.Pointer string, + ) { + _cJSON_DetachItemFromObjectCaseSensitive ??= _dylib.lookupFunction< + _c_cJSON_DetachItemFromObjectCaseSensitive, + _dart_cJSON_DetachItemFromObjectCaseSensitive>( + 'cJSON_DetachItemFromObjectCaseSensitive'); + return _cJSON_DetachItemFromObjectCaseSensitive( + object, + string, + ); + } + + _dart_cJSON_DetachItemFromObjectCaseSensitive + _cJSON_DetachItemFromObjectCaseSensitive; + + void cJSON_DeleteItemFromObject( + ffi.Pointer object, + ffi.Pointer string, + ) { + _cJSON_DeleteItemFromObject ??= _dylib.lookupFunction< + _c_cJSON_DeleteItemFromObject, + _dart_cJSON_DeleteItemFromObject>('cJSON_DeleteItemFromObject'); + return _cJSON_DeleteItemFromObject( + object, + string, + ); + } + + _dart_cJSON_DeleteItemFromObject _cJSON_DeleteItemFromObject; + + void cJSON_DeleteItemFromObjectCaseSensitive( + ffi.Pointer object, + ffi.Pointer string, + ) { + _cJSON_DeleteItemFromObjectCaseSensitive ??= _dylib.lookupFunction< + _c_cJSON_DeleteItemFromObjectCaseSensitive, + _dart_cJSON_DeleteItemFromObjectCaseSensitive>( + 'cJSON_DeleteItemFromObjectCaseSensitive'); + return _cJSON_DeleteItemFromObjectCaseSensitive( + object, + string, + ); + } + + _dart_cJSON_DeleteItemFromObjectCaseSensitive + _cJSON_DeleteItemFromObjectCaseSensitive; + + void cJSON_InsertItemInArray( + ffi.Pointer array, + int which, + ffi.Pointer newitem, + ) { + _cJSON_InsertItemInArray ??= _dylib.lookupFunction< + _c_cJSON_InsertItemInArray, + _dart_cJSON_InsertItemInArray>('cJSON_InsertItemInArray'); + return _cJSON_InsertItemInArray( + array, + which, + newitem, + ); + } + + _dart_cJSON_InsertItemInArray _cJSON_InsertItemInArray; + + int cJSON_ReplaceItemViaPointer( + ffi.Pointer parent, + ffi.Pointer item, + ffi.Pointer replacement, + ) { + _cJSON_ReplaceItemViaPointer ??= _dylib.lookupFunction< + _c_cJSON_ReplaceItemViaPointer, + _dart_cJSON_ReplaceItemViaPointer>('cJSON_ReplaceItemViaPointer'); + return _cJSON_ReplaceItemViaPointer( + parent, + item, + replacement, + ); + } + + _dart_cJSON_ReplaceItemViaPointer _cJSON_ReplaceItemViaPointer; + + void cJSON_ReplaceItemInArray( + ffi.Pointer array, + int which, + ffi.Pointer newitem, + ) { + _cJSON_ReplaceItemInArray ??= _dylib.lookupFunction< + _c_cJSON_ReplaceItemInArray, + _dart_cJSON_ReplaceItemInArray>('cJSON_ReplaceItemInArray'); + return _cJSON_ReplaceItemInArray( + array, + which, + newitem, + ); + } + + _dart_cJSON_ReplaceItemInArray _cJSON_ReplaceItemInArray; + + void cJSON_ReplaceItemInObject( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer newitem, + ) { + _cJSON_ReplaceItemInObject ??= _dylib.lookupFunction< + _c_cJSON_ReplaceItemInObject, + _dart_cJSON_ReplaceItemInObject>('cJSON_ReplaceItemInObject'); + return _cJSON_ReplaceItemInObject( + object, + string, + newitem, + ); + } + + _dart_cJSON_ReplaceItemInObject _cJSON_ReplaceItemInObject; + + void cJSON_ReplaceItemInObjectCaseSensitive( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer newitem, + ) { + _cJSON_ReplaceItemInObjectCaseSensitive ??= _dylib.lookupFunction< + _c_cJSON_ReplaceItemInObjectCaseSensitive, + _dart_cJSON_ReplaceItemInObjectCaseSensitive>( + 'cJSON_ReplaceItemInObjectCaseSensitive'); + return _cJSON_ReplaceItemInObjectCaseSensitive( + object, + string, + newitem, + ); + } + + _dart_cJSON_ReplaceItemInObjectCaseSensitive + _cJSON_ReplaceItemInObjectCaseSensitive; + + ffi.Pointer cJSON_Duplicate( + ffi.Pointer item, + int recurse, + ) { + _cJSON_Duplicate ??= + _dylib.lookupFunction<_c_cJSON_Duplicate, _dart_cJSON_Duplicate>( + 'cJSON_Duplicate'); + return _cJSON_Duplicate( + item, + recurse, + ); + } + + _dart_cJSON_Duplicate _cJSON_Duplicate; + + int cJSON_Compare( + ffi.Pointer a, + ffi.Pointer b, + int case_sensitive, + ) { + _cJSON_Compare ??= _dylib + .lookupFunction<_c_cJSON_Compare, _dart_cJSON_Compare>('cJSON_Compare'); + return _cJSON_Compare( + a, + b, + case_sensitive, + ); + } + + _dart_cJSON_Compare _cJSON_Compare; + + void cJSON_Minify( + ffi.Pointer json, + ) { + _cJSON_Minify ??= _dylib + .lookupFunction<_c_cJSON_Minify, _dart_cJSON_Minify>('cJSON_Minify'); + return _cJSON_Minify( + json, + ); + } + + _dart_cJSON_Minify _cJSON_Minify; + + ffi.Pointer cJSON_AddNullToObject( + ffi.Pointer object, + ffi.Pointer name, + ) { + _cJSON_AddNullToObject ??= _dylib.lookupFunction<_c_cJSON_AddNullToObject, + _dart_cJSON_AddNullToObject>('cJSON_AddNullToObject'); + return _cJSON_AddNullToObject( + object, + name, + ); + } + + _dart_cJSON_AddNullToObject _cJSON_AddNullToObject; + + ffi.Pointer cJSON_AddTrueToObject( + ffi.Pointer object, + ffi.Pointer name, + ) { + _cJSON_AddTrueToObject ??= _dylib.lookupFunction<_c_cJSON_AddTrueToObject, + _dart_cJSON_AddTrueToObject>('cJSON_AddTrueToObject'); + return _cJSON_AddTrueToObject( + object, + name, + ); + } + + _dart_cJSON_AddTrueToObject _cJSON_AddTrueToObject; + + ffi.Pointer cJSON_AddFalseToObject( + ffi.Pointer object, + ffi.Pointer name, + ) { + _cJSON_AddFalseToObject ??= _dylib.lookupFunction<_c_cJSON_AddFalseToObject, + _dart_cJSON_AddFalseToObject>('cJSON_AddFalseToObject'); + return _cJSON_AddFalseToObject( + object, + name, + ); + } + + _dart_cJSON_AddFalseToObject _cJSON_AddFalseToObject; + + ffi.Pointer cJSON_AddBoolToObject( + ffi.Pointer object, + ffi.Pointer name, + int boolean, + ) { + _cJSON_AddBoolToObject ??= _dylib.lookupFunction<_c_cJSON_AddBoolToObject, + _dart_cJSON_AddBoolToObject>('cJSON_AddBoolToObject'); + return _cJSON_AddBoolToObject( + object, + name, + boolean, + ); + } + + _dart_cJSON_AddBoolToObject _cJSON_AddBoolToObject; + + ffi.Pointer cJSON_AddNumberToObject( + ffi.Pointer object, + ffi.Pointer name, + double number, + ) { + _cJSON_AddNumberToObject ??= _dylib.lookupFunction< + _c_cJSON_AddNumberToObject, + _dart_cJSON_AddNumberToObject>('cJSON_AddNumberToObject'); + return _cJSON_AddNumberToObject( + object, + name, + number, + ); + } + + _dart_cJSON_AddNumberToObject _cJSON_AddNumberToObject; + + ffi.Pointer cJSON_AddStringToObject( + ffi.Pointer object, + ffi.Pointer name, + ffi.Pointer string, + ) { + _cJSON_AddStringToObject ??= _dylib.lookupFunction< + _c_cJSON_AddStringToObject, + _dart_cJSON_AddStringToObject>('cJSON_AddStringToObject'); + return _cJSON_AddStringToObject( + object, + name, + string, + ); + } + + _dart_cJSON_AddStringToObject _cJSON_AddStringToObject; + + ffi.Pointer cJSON_AddRawToObject( + ffi.Pointer object, + ffi.Pointer name, + ffi.Pointer raw, + ) { + _cJSON_AddRawToObject ??= _dylib.lookupFunction<_c_cJSON_AddRawToObject, + _dart_cJSON_AddRawToObject>('cJSON_AddRawToObject'); + return _cJSON_AddRawToObject( + object, + name, + raw, + ); + } + + _dart_cJSON_AddRawToObject _cJSON_AddRawToObject; + + ffi.Pointer cJSON_AddObjectToObject( + ffi.Pointer object, + ffi.Pointer name, + ) { + _cJSON_AddObjectToObject ??= _dylib.lookupFunction< + _c_cJSON_AddObjectToObject, + _dart_cJSON_AddObjectToObject>('cJSON_AddObjectToObject'); + return _cJSON_AddObjectToObject( + object, + name, + ); + } + + _dart_cJSON_AddObjectToObject _cJSON_AddObjectToObject; + + ffi.Pointer cJSON_AddArrayToObject( + ffi.Pointer object, + ffi.Pointer name, + ) { + _cJSON_AddArrayToObject ??= _dylib.lookupFunction<_c_cJSON_AddArrayToObject, + _dart_cJSON_AddArrayToObject>('cJSON_AddArrayToObject'); + return _cJSON_AddArrayToObject( + object, + name, + ); + } + + _dart_cJSON_AddArrayToObject _cJSON_AddArrayToObject; + + double cJSON_SetNumberHelper( + ffi.Pointer object, + double number, + ) { + _cJSON_SetNumberHelper ??= _dylib.lookupFunction<_c_cJSON_SetNumberHelper, + _dart_cJSON_SetNumberHelper>('cJSON_SetNumberHelper'); + return _cJSON_SetNumberHelper( + object, + number, + ); + } + + _dart_cJSON_SetNumberHelper _cJSON_SetNumberHelper; + + ffi.Pointer cJSON_malloc( + int size, + ) { + _cJSON_malloc ??= _dylib + .lookupFunction<_c_cJSON_malloc, _dart_cJSON_malloc>('cJSON_malloc'); + return _cJSON_malloc( + size, + ); + } + + _dart_cJSON_malloc _cJSON_malloc; + + void cJSON_free( + ffi.Pointer object, + ) { + _cJSON_free ??= + _dylib.lookupFunction<_c_cJSON_free, _dart_cJSON_free>('cJSON_free'); + return _cJSON_free( + object, + ); + } + + _dart_cJSON_free _cJSON_free; } class cJSON extends ffi.Struct { @@ -32,43 +1057,16 @@ class cJSON extends ffi.Struct { ffi.Pointer string; } -typedef _typedefC_1 = ffi.Pointer Function( - ffi.Uint64, -); - -typedef _typedefC_2 = ffi.Void Function( - ffi.Pointer, -); - class cJSON_Hooks extends ffi.Struct { ffi.Pointer> malloc_fn; ffi.Pointer> free_fn; } -ffi.Pointer cJSON_Version() { - return _cJSON_Version(); -} - -final _dart_cJSON_Version _cJSON_Version = _dylib - .lookupFunction<_c_cJSON_Version, _dart_cJSON_Version>('cJSON_Version'); - typedef _c_cJSON_Version = ffi.Pointer Function(); typedef _dart_cJSON_Version = ffi.Pointer Function(); -void cJSON_InitHooks( - ffi.Pointer hooks, -) { - return _cJSON_InitHooks( - hooks, - ); -} - -final _dart_cJSON_InitHooks _cJSON_InitHooks = - _dylib.lookupFunction<_c_cJSON_InitHooks, _dart_cJSON_InitHooks>( - 'cJSON_InitHooks'); - typedef _c_cJSON_InitHooks = ffi.Void Function( ffi.Pointer hooks, ); @@ -77,17 +1075,6 @@ typedef _dart_cJSON_InitHooks = void Function( ffi.Pointer hooks, ); -ffi.Pointer cJSON_Parse( - ffi.Pointer value, -) { - return _cJSON_Parse( - value, - ); -} - -final _dart_cJSON_Parse _cJSON_Parse = - _dylib.lookupFunction<_c_cJSON_Parse, _dart_cJSON_Parse>('cJSON_Parse'); - typedef _c_cJSON_Parse = ffi.Pointer Function( ffi.Pointer value, ); @@ -96,22 +1083,6 @@ typedef _dart_cJSON_Parse = ffi.Pointer Function( ffi.Pointer value, ); -ffi.Pointer cJSON_ParseWithOpts( - ffi.Pointer value, - ffi.Pointer> return_parse_end, - int require_null_terminated, -) { - return _cJSON_ParseWithOpts( - value, - return_parse_end, - require_null_terminated, - ); -} - -final _dart_cJSON_ParseWithOpts _cJSON_ParseWithOpts = - _dylib.lookupFunction<_c_cJSON_ParseWithOpts, _dart_cJSON_ParseWithOpts>( - 'cJSON_ParseWithOpts'); - typedef _c_cJSON_ParseWithOpts = ffi.Pointer Function( ffi.Pointer value, ffi.Pointer> return_parse_end, @@ -124,17 +1095,6 @@ typedef _dart_cJSON_ParseWithOpts = ffi.Pointer Function( int require_null_terminated, ); -ffi.Pointer cJSON_Print( - ffi.Pointer item, -) { - return _cJSON_Print( - item, - ); -} - -final _dart_cJSON_Print _cJSON_Print = - _dylib.lookupFunction<_c_cJSON_Print, _dart_cJSON_Print>('cJSON_Print'); - typedef _c_cJSON_Print = ffi.Pointer Function( ffi.Pointer item, ); @@ -143,18 +1103,6 @@ typedef _dart_cJSON_Print = ffi.Pointer Function( ffi.Pointer item, ); -ffi.Pointer cJSON_PrintUnformatted( - ffi.Pointer item, -) { - return _cJSON_PrintUnformatted( - item, - ); -} - -final _dart_cJSON_PrintUnformatted _cJSON_PrintUnformatted = _dylib - .lookupFunction<_c_cJSON_PrintUnformatted, _dart_cJSON_PrintUnformatted>( - 'cJSON_PrintUnformatted'); - typedef _c_cJSON_PrintUnformatted = ffi.Pointer Function( ffi.Pointer item, ); @@ -163,22 +1111,6 @@ typedef _dart_cJSON_PrintUnformatted = ffi.Pointer Function( ffi.Pointer item, ); -ffi.Pointer cJSON_PrintBuffered( - ffi.Pointer item, - int prebuffer, - int fmt, -) { - return _cJSON_PrintBuffered( - item, - prebuffer, - fmt, - ); -} - -final _dart_cJSON_PrintBuffered _cJSON_PrintBuffered = - _dylib.lookupFunction<_c_cJSON_PrintBuffered, _dart_cJSON_PrintBuffered>( - 'cJSON_PrintBuffered'); - typedef _c_cJSON_PrintBuffered = ffi.Pointer Function( ffi.Pointer item, ffi.Int32 prebuffer, @@ -191,24 +1123,6 @@ typedef _dart_cJSON_PrintBuffered = ffi.Pointer Function( int fmt, ); -int cJSON_PrintPreallocated( - ffi.Pointer item, - ffi.Pointer buffer, - int length, - int format, -) { - return _cJSON_PrintPreallocated( - item, - buffer, - length, - format, - ); -} - -final _dart_cJSON_PrintPreallocated _cJSON_PrintPreallocated = _dylib - .lookupFunction<_c_cJSON_PrintPreallocated, _dart_cJSON_PrintPreallocated>( - 'cJSON_PrintPreallocated'); - typedef _c_cJSON_PrintPreallocated = ffi.Int32 Function( ffi.Pointer item, ffi.Pointer buffer, @@ -223,17 +1137,6 @@ typedef _dart_cJSON_PrintPreallocated = int Function( int format, ); -void cJSON_Delete( - ffi.Pointer item, -) { - return _cJSON_Delete( - item, - ); -} - -final _dart_cJSON_Delete _cJSON_Delete = - _dylib.lookupFunction<_c_cJSON_Delete, _dart_cJSON_Delete>('cJSON_Delete'); - typedef _c_cJSON_Delete = ffi.Void Function( ffi.Pointer item, ); @@ -242,18 +1145,6 @@ typedef _dart_cJSON_Delete = void Function( ffi.Pointer item, ); -int cJSON_GetArraySize( - ffi.Pointer array, -) { - return _cJSON_GetArraySize( - array, - ); -} - -final _dart_cJSON_GetArraySize _cJSON_GetArraySize = - _dylib.lookupFunction<_c_cJSON_GetArraySize, _dart_cJSON_GetArraySize>( - 'cJSON_GetArraySize'); - typedef _c_cJSON_GetArraySize = ffi.Int32 Function( ffi.Pointer array, ); @@ -262,20 +1153,6 @@ typedef _dart_cJSON_GetArraySize = int Function( ffi.Pointer array, ); -ffi.Pointer cJSON_GetArrayItem( - ffi.Pointer array, - int index, -) { - return _cJSON_GetArrayItem( - array, - index, - ); -} - -final _dart_cJSON_GetArrayItem _cJSON_GetArrayItem = - _dylib.lookupFunction<_c_cJSON_GetArrayItem, _dart_cJSON_GetArrayItem>( - 'cJSON_GetArrayItem'); - typedef _c_cJSON_GetArrayItem = ffi.Pointer Function( ffi.Pointer array, ffi.Int32 index, @@ -286,20 +1163,6 @@ typedef _dart_cJSON_GetArrayItem = ffi.Pointer Function( int index, ); -ffi.Pointer cJSON_GetObjectItem( - ffi.Pointer object, - ffi.Pointer string, -) { - return _cJSON_GetObjectItem( - object, - string, - ); -} - -final _dart_cJSON_GetObjectItem _cJSON_GetObjectItem = - _dylib.lookupFunction<_c_cJSON_GetObjectItem, _dart_cJSON_GetObjectItem>( - 'cJSON_GetObjectItem'); - typedef _c_cJSON_GetObjectItem = ffi.Pointer Function( ffi.Pointer object, ffi.Pointer string, @@ -310,21 +1173,6 @@ typedef _dart_cJSON_GetObjectItem = ffi.Pointer Function( ffi.Pointer string, ); -ffi.Pointer cJSON_GetObjectItemCaseSensitive( - ffi.Pointer object, - ffi.Pointer string, -) { - return _cJSON_GetObjectItemCaseSensitive( - object, - string, - ); -} - -final _dart_cJSON_GetObjectItemCaseSensitive _cJSON_GetObjectItemCaseSensitive = - _dylib.lookupFunction<_c_cJSON_GetObjectItemCaseSensitive, - _dart_cJSON_GetObjectItemCaseSensitive>( - 'cJSON_GetObjectItemCaseSensitive'); - typedef _c_cJSON_GetObjectItemCaseSensitive = ffi.Pointer Function( ffi.Pointer object, ffi.Pointer string, @@ -335,20 +1183,6 @@ typedef _dart_cJSON_GetObjectItemCaseSensitive = ffi.Pointer Function( ffi.Pointer string, ); -int cJSON_HasObjectItem( - ffi.Pointer object, - ffi.Pointer string, -) { - return _cJSON_HasObjectItem( - object, - string, - ); -} - -final _dart_cJSON_HasObjectItem _cJSON_HasObjectItem = - _dylib.lookupFunction<_c_cJSON_HasObjectItem, _dart_cJSON_HasObjectItem>( - 'cJSON_HasObjectItem'); - typedef _c_cJSON_HasObjectItem = ffi.Int32 Function( ffi.Pointer object, ffi.Pointer string, @@ -359,30 +1193,10 @@ typedef _dart_cJSON_HasObjectItem = int Function( ffi.Pointer string, ); -ffi.Pointer cJSON_GetErrorPtr() { - return _cJSON_GetErrorPtr(); -} - -final _dart_cJSON_GetErrorPtr _cJSON_GetErrorPtr = - _dylib.lookupFunction<_c_cJSON_GetErrorPtr, _dart_cJSON_GetErrorPtr>( - 'cJSON_GetErrorPtr'); - typedef _c_cJSON_GetErrorPtr = ffi.Pointer Function(); typedef _dart_cJSON_GetErrorPtr = ffi.Pointer Function(); -ffi.Pointer cJSON_GetStringValue( - ffi.Pointer item, -) { - return _cJSON_GetStringValue( - item, - ); -} - -final _dart_cJSON_GetStringValue _cJSON_GetStringValue = - _dylib.lookupFunction<_c_cJSON_GetStringValue, _dart_cJSON_GetStringValue>( - 'cJSON_GetStringValue'); - typedef _c_cJSON_GetStringValue = ffi.Pointer Function( ffi.Pointer item, ); @@ -391,18 +1205,6 @@ typedef _dart_cJSON_GetStringValue = ffi.Pointer Function( ffi.Pointer item, ); -int cJSON_IsInvalid( - ffi.Pointer item, -) { - return _cJSON_IsInvalid( - item, - ); -} - -final _dart_cJSON_IsInvalid _cJSON_IsInvalid = - _dylib.lookupFunction<_c_cJSON_IsInvalid, _dart_cJSON_IsInvalid>( - 'cJSON_IsInvalid'); - typedef _c_cJSON_IsInvalid = ffi.Int32 Function( ffi.Pointer item, ); @@ -411,17 +1213,6 @@ typedef _dart_cJSON_IsInvalid = int Function( ffi.Pointer item, ); -int cJSON_IsFalse( - ffi.Pointer item, -) { - return _cJSON_IsFalse( - item, - ); -} - -final _dart_cJSON_IsFalse _cJSON_IsFalse = _dylib - .lookupFunction<_c_cJSON_IsFalse, _dart_cJSON_IsFalse>('cJSON_IsFalse'); - typedef _c_cJSON_IsFalse = ffi.Int32 Function( ffi.Pointer item, ); @@ -430,17 +1221,6 @@ typedef _dart_cJSON_IsFalse = int Function( ffi.Pointer item, ); -int cJSON_IsTrue( - ffi.Pointer item, -) { - return _cJSON_IsTrue( - item, - ); -} - -final _dart_cJSON_IsTrue _cJSON_IsTrue = - _dylib.lookupFunction<_c_cJSON_IsTrue, _dart_cJSON_IsTrue>('cJSON_IsTrue'); - typedef _c_cJSON_IsTrue = ffi.Int32 Function( ffi.Pointer item, ); @@ -449,17 +1229,6 @@ typedef _dart_cJSON_IsTrue = int Function( ffi.Pointer item, ); -int cJSON_IsBool( - ffi.Pointer item, -) { - return _cJSON_IsBool( - item, - ); -} - -final _dart_cJSON_IsBool _cJSON_IsBool = - _dylib.lookupFunction<_c_cJSON_IsBool, _dart_cJSON_IsBool>('cJSON_IsBool'); - typedef _c_cJSON_IsBool = ffi.Int32 Function( ffi.Pointer item, ); @@ -468,17 +1237,6 @@ typedef _dart_cJSON_IsBool = int Function( ffi.Pointer item, ); -int cJSON_IsNull( - ffi.Pointer item, -) { - return _cJSON_IsNull( - item, - ); -} - -final _dart_cJSON_IsNull _cJSON_IsNull = - _dylib.lookupFunction<_c_cJSON_IsNull, _dart_cJSON_IsNull>('cJSON_IsNull'); - typedef _c_cJSON_IsNull = ffi.Int32 Function( ffi.Pointer item, ); @@ -487,17 +1245,6 @@ typedef _dart_cJSON_IsNull = int Function( ffi.Pointer item, ); -int cJSON_IsNumber( - ffi.Pointer item, -) { - return _cJSON_IsNumber( - item, - ); -} - -final _dart_cJSON_IsNumber _cJSON_IsNumber = _dylib - .lookupFunction<_c_cJSON_IsNumber, _dart_cJSON_IsNumber>('cJSON_IsNumber'); - typedef _c_cJSON_IsNumber = ffi.Int32 Function( ffi.Pointer item, ); @@ -506,17 +1253,6 @@ typedef _dart_cJSON_IsNumber = int Function( ffi.Pointer item, ); -int cJSON_IsString( - ffi.Pointer item, -) { - return _cJSON_IsString( - item, - ); -} - -final _dart_cJSON_IsString _cJSON_IsString = _dylib - .lookupFunction<_c_cJSON_IsString, _dart_cJSON_IsString>('cJSON_IsString'); - typedef _c_cJSON_IsString = ffi.Int32 Function( ffi.Pointer item, ); @@ -525,17 +1261,6 @@ typedef _dart_cJSON_IsString = int Function( ffi.Pointer item, ); -int cJSON_IsArray( - ffi.Pointer item, -) { - return _cJSON_IsArray( - item, - ); -} - -final _dart_cJSON_IsArray _cJSON_IsArray = _dylib - .lookupFunction<_c_cJSON_IsArray, _dart_cJSON_IsArray>('cJSON_IsArray'); - typedef _c_cJSON_IsArray = ffi.Int32 Function( ffi.Pointer item, ); @@ -544,17 +1269,6 @@ typedef _dart_cJSON_IsArray = int Function( ffi.Pointer item, ); -int cJSON_IsObject( - ffi.Pointer item, -) { - return _cJSON_IsObject( - item, - ); -} - -final _dart_cJSON_IsObject _cJSON_IsObject = _dylib - .lookupFunction<_c_cJSON_IsObject, _dart_cJSON_IsObject>('cJSON_IsObject'); - typedef _c_cJSON_IsObject = ffi.Int32 Function( ffi.Pointer item, ); @@ -563,17 +1277,6 @@ typedef _dart_cJSON_IsObject = int Function( ffi.Pointer item, ); -int cJSON_IsRaw( - ffi.Pointer item, -) { - return _cJSON_IsRaw( - item, - ); -} - -final _dart_cJSON_IsRaw _cJSON_IsRaw = - _dylib.lookupFunction<_c_cJSON_IsRaw, _dart_cJSON_IsRaw>('cJSON_IsRaw'); - typedef _c_cJSON_IsRaw = ffi.Int32 Function( ffi.Pointer item, ); @@ -582,54 +1285,18 @@ typedef _dart_cJSON_IsRaw = int Function( ffi.Pointer item, ); -ffi.Pointer cJSON_CreateNull() { - return _cJSON_CreateNull(); -} - -final _dart_cJSON_CreateNull _cJSON_CreateNull = - _dylib.lookupFunction<_c_cJSON_CreateNull, _dart_cJSON_CreateNull>( - 'cJSON_CreateNull'); - typedef _c_cJSON_CreateNull = ffi.Pointer Function(); typedef _dart_cJSON_CreateNull = ffi.Pointer Function(); -ffi.Pointer cJSON_CreateTrue() { - return _cJSON_CreateTrue(); -} - -final _dart_cJSON_CreateTrue _cJSON_CreateTrue = - _dylib.lookupFunction<_c_cJSON_CreateTrue, _dart_cJSON_CreateTrue>( - 'cJSON_CreateTrue'); - typedef _c_cJSON_CreateTrue = ffi.Pointer Function(); typedef _dart_cJSON_CreateTrue = ffi.Pointer Function(); -ffi.Pointer cJSON_CreateFalse() { - return _cJSON_CreateFalse(); -} - -final _dart_cJSON_CreateFalse _cJSON_CreateFalse = - _dylib.lookupFunction<_c_cJSON_CreateFalse, _dart_cJSON_CreateFalse>( - 'cJSON_CreateFalse'); - typedef _c_cJSON_CreateFalse = ffi.Pointer Function(); typedef _dart_cJSON_CreateFalse = ffi.Pointer Function(); -ffi.Pointer cJSON_CreateBool( - int boolean, -) { - return _cJSON_CreateBool( - boolean, - ); -} - -final _dart_cJSON_CreateBool _cJSON_CreateBool = - _dylib.lookupFunction<_c_cJSON_CreateBool, _dart_cJSON_CreateBool>( - 'cJSON_CreateBool'); - typedef _c_cJSON_CreateBool = ffi.Pointer Function( ffi.Int32 boolean, ); @@ -638,18 +1305,6 @@ typedef _dart_cJSON_CreateBool = ffi.Pointer Function( int boolean, ); -ffi.Pointer cJSON_CreateNumber( - double num, -) { - return _cJSON_CreateNumber( - num, - ); -} - -final _dart_cJSON_CreateNumber _cJSON_CreateNumber = - _dylib.lookupFunction<_c_cJSON_CreateNumber, _dart_cJSON_CreateNumber>( - 'cJSON_CreateNumber'); - typedef _c_cJSON_CreateNumber = ffi.Pointer Function( ffi.Double num, ); @@ -658,18 +1313,6 @@ typedef _dart_cJSON_CreateNumber = ffi.Pointer Function( double num, ); -ffi.Pointer cJSON_CreateString( - ffi.Pointer string, -) { - return _cJSON_CreateString( - string, - ); -} - -final _dart_cJSON_CreateString _cJSON_CreateString = - _dylib.lookupFunction<_c_cJSON_CreateString, _dart_cJSON_CreateString>( - 'cJSON_CreateString'); - typedef _c_cJSON_CreateString = ffi.Pointer Function( ffi.Pointer string, ); @@ -678,18 +1321,6 @@ typedef _dart_cJSON_CreateString = ffi.Pointer Function( ffi.Pointer string, ); -ffi.Pointer cJSON_CreateRaw( - ffi.Pointer raw, -) { - return _cJSON_CreateRaw( - raw, - ); -} - -final _dart_cJSON_CreateRaw _cJSON_CreateRaw = - _dylib.lookupFunction<_c_cJSON_CreateRaw, _dart_cJSON_CreateRaw>( - 'cJSON_CreateRaw'); - typedef _c_cJSON_CreateRaw = ffi.Pointer Function( ffi.Pointer raw, ); @@ -698,42 +1329,14 @@ typedef _dart_cJSON_CreateRaw = ffi.Pointer Function( ffi.Pointer raw, ); -ffi.Pointer cJSON_CreateArray() { - return _cJSON_CreateArray(); -} - -final _dart_cJSON_CreateArray _cJSON_CreateArray = - _dylib.lookupFunction<_c_cJSON_CreateArray, _dart_cJSON_CreateArray>( - 'cJSON_CreateArray'); - typedef _c_cJSON_CreateArray = ffi.Pointer Function(); typedef _dart_cJSON_CreateArray = ffi.Pointer Function(); -ffi.Pointer cJSON_CreateObject() { - return _cJSON_CreateObject(); -} - -final _dart_cJSON_CreateObject _cJSON_CreateObject = - _dylib.lookupFunction<_c_cJSON_CreateObject, _dart_cJSON_CreateObject>( - 'cJSON_CreateObject'); - typedef _c_cJSON_CreateObject = ffi.Pointer Function(); typedef _dart_cJSON_CreateObject = ffi.Pointer Function(); -ffi.Pointer cJSON_CreateStringReference( - ffi.Pointer string, -) { - return _cJSON_CreateStringReference( - string, - ); -} - -final _dart_cJSON_CreateStringReference _cJSON_CreateStringReference = - _dylib.lookupFunction<_c_cJSON_CreateStringReference, - _dart_cJSON_CreateStringReference>('cJSON_CreateStringReference'); - typedef _c_cJSON_CreateStringReference = ffi.Pointer Function( ffi.Pointer string, ); @@ -742,18 +1345,6 @@ typedef _dart_cJSON_CreateStringReference = ffi.Pointer Function( ffi.Pointer string, ); -ffi.Pointer cJSON_CreateObjectReference( - ffi.Pointer child, -) { - return _cJSON_CreateObjectReference( - child, - ); -} - -final _dart_cJSON_CreateObjectReference _cJSON_CreateObjectReference = - _dylib.lookupFunction<_c_cJSON_CreateObjectReference, - _dart_cJSON_CreateObjectReference>('cJSON_CreateObjectReference'); - typedef _c_cJSON_CreateObjectReference = ffi.Pointer Function( ffi.Pointer child, ); @@ -762,18 +1353,6 @@ typedef _dart_cJSON_CreateObjectReference = ffi.Pointer Function( ffi.Pointer child, ); -ffi.Pointer cJSON_CreateArrayReference( - ffi.Pointer child, -) { - return _cJSON_CreateArrayReference( - child, - ); -} - -final _dart_cJSON_CreateArrayReference _cJSON_CreateArrayReference = - _dylib.lookupFunction<_c_cJSON_CreateArrayReference, - _dart_cJSON_CreateArrayReference>('cJSON_CreateArrayReference'); - typedef _c_cJSON_CreateArrayReference = ffi.Pointer Function( ffi.Pointer child, ); @@ -782,20 +1361,6 @@ typedef _dart_cJSON_CreateArrayReference = ffi.Pointer Function( ffi.Pointer child, ); -ffi.Pointer cJSON_CreateIntArray( - ffi.Pointer numbers, - int count, -) { - return _cJSON_CreateIntArray( - numbers, - count, - ); -} - -final _dart_cJSON_CreateIntArray _cJSON_CreateIntArray = - _dylib.lookupFunction<_c_cJSON_CreateIntArray, _dart_cJSON_CreateIntArray>( - 'cJSON_CreateIntArray'); - typedef _c_cJSON_CreateIntArray = ffi.Pointer Function( ffi.Pointer numbers, ffi.Int32 count, @@ -806,20 +1371,6 @@ typedef _dart_cJSON_CreateIntArray = ffi.Pointer Function( int count, ); -ffi.Pointer cJSON_CreateFloatArray( - ffi.Pointer numbers, - int count, -) { - return _cJSON_CreateFloatArray( - numbers, - count, - ); -} - -final _dart_cJSON_CreateFloatArray _cJSON_CreateFloatArray = _dylib - .lookupFunction<_c_cJSON_CreateFloatArray, _dart_cJSON_CreateFloatArray>( - 'cJSON_CreateFloatArray'); - typedef _c_cJSON_CreateFloatArray = ffi.Pointer Function( ffi.Pointer numbers, ffi.Int32 count, @@ -830,20 +1381,6 @@ typedef _dart_cJSON_CreateFloatArray = ffi.Pointer Function( int count, ); -ffi.Pointer cJSON_CreateDoubleArray( - ffi.Pointer numbers, - int count, -) { - return _cJSON_CreateDoubleArray( - numbers, - count, - ); -} - -final _dart_cJSON_CreateDoubleArray _cJSON_CreateDoubleArray = _dylib - .lookupFunction<_c_cJSON_CreateDoubleArray, _dart_cJSON_CreateDoubleArray>( - 'cJSON_CreateDoubleArray'); - typedef _c_cJSON_CreateDoubleArray = ffi.Pointer Function( ffi.Pointer numbers, ffi.Int32 count, @@ -854,20 +1391,6 @@ typedef _dart_cJSON_CreateDoubleArray = ffi.Pointer Function( int count, ); -ffi.Pointer cJSON_CreateStringArray( - ffi.Pointer> strings, - int count, -) { - return _cJSON_CreateStringArray( - strings, - count, - ); -} - -final _dart_cJSON_CreateStringArray _cJSON_CreateStringArray = _dylib - .lookupFunction<_c_cJSON_CreateStringArray, _dart_cJSON_CreateStringArray>( - 'cJSON_CreateStringArray'); - typedef _c_cJSON_CreateStringArray = ffi.Pointer Function( ffi.Pointer> strings, ffi.Int32 count, @@ -878,20 +1401,6 @@ typedef _dart_cJSON_CreateStringArray = ffi.Pointer Function( int count, ); -void cJSON_AddItemToArray( - ffi.Pointer array, - ffi.Pointer item, -) { - return _cJSON_AddItemToArray( - array, - item, - ); -} - -final _dart_cJSON_AddItemToArray _cJSON_AddItemToArray = - _dylib.lookupFunction<_c_cJSON_AddItemToArray, _dart_cJSON_AddItemToArray>( - 'cJSON_AddItemToArray'); - typedef _c_cJSON_AddItemToArray = ffi.Void Function( ffi.Pointer array, ffi.Pointer item, @@ -902,22 +1411,6 @@ typedef _dart_cJSON_AddItemToArray = void Function( ffi.Pointer item, ); -void cJSON_AddItemToObject( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -) { - return _cJSON_AddItemToObject( - object, - string, - item, - ); -} - -final _dart_cJSON_AddItemToObject _cJSON_AddItemToObject = _dylib - .lookupFunction<_c_cJSON_AddItemToObject, _dart_cJSON_AddItemToObject>( - 'cJSON_AddItemToObject'); - typedef _c_cJSON_AddItemToObject = ffi.Void Function( ffi.Pointer object, ffi.Pointer string, @@ -930,22 +1423,6 @@ typedef _dart_cJSON_AddItemToObject = void Function( ffi.Pointer item, ); -void cJSON_AddItemToObjectCS( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -) { - return _cJSON_AddItemToObjectCS( - object, - string, - item, - ); -} - -final _dart_cJSON_AddItemToObjectCS _cJSON_AddItemToObjectCS = _dylib - .lookupFunction<_c_cJSON_AddItemToObjectCS, _dart_cJSON_AddItemToObjectCS>( - 'cJSON_AddItemToObjectCS'); - typedef _c_cJSON_AddItemToObjectCS = ffi.Void Function( ffi.Pointer object, ffi.Pointer string, @@ -958,20 +1435,6 @@ typedef _dart_cJSON_AddItemToObjectCS = void Function( ffi.Pointer item, ); -void cJSON_AddItemReferenceToArray( - ffi.Pointer array, - ffi.Pointer item, -) { - return _cJSON_AddItemReferenceToArray( - array, - item, - ); -} - -final _dart_cJSON_AddItemReferenceToArray _cJSON_AddItemReferenceToArray = - _dylib.lookupFunction<_c_cJSON_AddItemReferenceToArray, - _dart_cJSON_AddItemReferenceToArray>('cJSON_AddItemReferenceToArray'); - typedef _c_cJSON_AddItemReferenceToArray = ffi.Void Function( ffi.Pointer array, ffi.Pointer item, @@ -982,22 +1445,6 @@ typedef _dart_cJSON_AddItemReferenceToArray = void Function( ffi.Pointer item, ); -void cJSON_AddItemReferenceToObject( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -) { - return _cJSON_AddItemReferenceToObject( - object, - string, - item, - ); -} - -final _dart_cJSON_AddItemReferenceToObject _cJSON_AddItemReferenceToObject = - _dylib.lookupFunction<_c_cJSON_AddItemReferenceToObject, - _dart_cJSON_AddItemReferenceToObject>('cJSON_AddItemReferenceToObject'); - typedef _c_cJSON_AddItemReferenceToObject = ffi.Void Function( ffi.Pointer object, ffi.Pointer string, @@ -1010,20 +1457,6 @@ typedef _dart_cJSON_AddItemReferenceToObject = void Function( ffi.Pointer item, ); -ffi.Pointer cJSON_DetachItemViaPointer( - ffi.Pointer parent, - ffi.Pointer item, -) { - return _cJSON_DetachItemViaPointer( - parent, - item, - ); -} - -final _dart_cJSON_DetachItemViaPointer _cJSON_DetachItemViaPointer = - _dylib.lookupFunction<_c_cJSON_DetachItemViaPointer, - _dart_cJSON_DetachItemViaPointer>('cJSON_DetachItemViaPointer'); - typedef _c_cJSON_DetachItemViaPointer = ffi.Pointer Function( ffi.Pointer parent, ffi.Pointer item, @@ -1034,20 +1467,6 @@ typedef _dart_cJSON_DetachItemViaPointer = ffi.Pointer Function( ffi.Pointer item, ); -ffi.Pointer cJSON_DetachItemFromArray( - ffi.Pointer array, - int which, -) { - return _cJSON_DetachItemFromArray( - array, - which, - ); -} - -final _dart_cJSON_DetachItemFromArray _cJSON_DetachItemFromArray = - _dylib.lookupFunction<_c_cJSON_DetachItemFromArray, - _dart_cJSON_DetachItemFromArray>('cJSON_DetachItemFromArray'); - typedef _c_cJSON_DetachItemFromArray = ffi.Pointer Function( ffi.Pointer array, ffi.Int32 which, @@ -1058,20 +1477,6 @@ typedef _dart_cJSON_DetachItemFromArray = ffi.Pointer Function( int which, ); -void cJSON_DeleteItemFromArray( - ffi.Pointer array, - int which, -) { - return _cJSON_DeleteItemFromArray( - array, - which, - ); -} - -final _dart_cJSON_DeleteItemFromArray _cJSON_DeleteItemFromArray = - _dylib.lookupFunction<_c_cJSON_DeleteItemFromArray, - _dart_cJSON_DeleteItemFromArray>('cJSON_DeleteItemFromArray'); - typedef _c_cJSON_DeleteItemFromArray = ffi.Void Function( ffi.Pointer array, ffi.Int32 which, @@ -1082,20 +1487,6 @@ typedef _dart_cJSON_DeleteItemFromArray = void Function( int which, ); -ffi.Pointer cJSON_DetachItemFromObject( - ffi.Pointer object, - ffi.Pointer string, -) { - return _cJSON_DetachItemFromObject( - object, - string, - ); -} - -final _dart_cJSON_DetachItemFromObject _cJSON_DetachItemFromObject = - _dylib.lookupFunction<_c_cJSON_DetachItemFromObject, - _dart_cJSON_DetachItemFromObject>('cJSON_DetachItemFromObject'); - typedef _c_cJSON_DetachItemFromObject = ffi.Pointer Function( ffi.Pointer object, ffi.Pointer string, @@ -1106,22 +1497,6 @@ typedef _dart_cJSON_DetachItemFromObject = ffi.Pointer Function( ffi.Pointer string, ); -ffi.Pointer cJSON_DetachItemFromObjectCaseSensitive( - ffi.Pointer object, - ffi.Pointer string, -) { - return _cJSON_DetachItemFromObjectCaseSensitive( - object, - string, - ); -} - -final _dart_cJSON_DetachItemFromObjectCaseSensitive - _cJSON_DetachItemFromObjectCaseSensitive = _dylib.lookupFunction< - _c_cJSON_DetachItemFromObjectCaseSensitive, - _dart_cJSON_DetachItemFromObjectCaseSensitive>( - 'cJSON_DetachItemFromObjectCaseSensitive'); - typedef _c_cJSON_DetachItemFromObjectCaseSensitive = ffi.Pointer Function( ffi.Pointer object, @@ -1134,20 +1509,6 @@ typedef _dart_cJSON_DetachItemFromObjectCaseSensitive = ffi.Pointer ffi.Pointer string, ); -void cJSON_DeleteItemFromObject( - ffi.Pointer object, - ffi.Pointer string, -) { - return _cJSON_DeleteItemFromObject( - object, - string, - ); -} - -final _dart_cJSON_DeleteItemFromObject _cJSON_DeleteItemFromObject = - _dylib.lookupFunction<_c_cJSON_DeleteItemFromObject, - _dart_cJSON_DeleteItemFromObject>('cJSON_DeleteItemFromObject'); - typedef _c_cJSON_DeleteItemFromObject = ffi.Void Function( ffi.Pointer object, ffi.Pointer string, @@ -1158,22 +1519,6 @@ typedef _dart_cJSON_DeleteItemFromObject = void Function( ffi.Pointer string, ); -void cJSON_DeleteItemFromObjectCaseSensitive( - ffi.Pointer object, - ffi.Pointer string, -) { - return _cJSON_DeleteItemFromObjectCaseSensitive( - object, - string, - ); -} - -final _dart_cJSON_DeleteItemFromObjectCaseSensitive - _cJSON_DeleteItemFromObjectCaseSensitive = _dylib.lookupFunction< - _c_cJSON_DeleteItemFromObjectCaseSensitive, - _dart_cJSON_DeleteItemFromObjectCaseSensitive>( - 'cJSON_DeleteItemFromObjectCaseSensitive'); - typedef _c_cJSON_DeleteItemFromObjectCaseSensitive = ffi.Void Function( ffi.Pointer object, ffi.Pointer string, @@ -1184,22 +1529,6 @@ typedef _dart_cJSON_DeleteItemFromObjectCaseSensitive = void Function( ffi.Pointer string, ); -void cJSON_InsertItemInArray( - ffi.Pointer array, - int which, - ffi.Pointer newitem, -) { - return _cJSON_InsertItemInArray( - array, - which, - newitem, - ); -} - -final _dart_cJSON_InsertItemInArray _cJSON_InsertItemInArray = _dylib - .lookupFunction<_c_cJSON_InsertItemInArray, _dart_cJSON_InsertItemInArray>( - 'cJSON_InsertItemInArray'); - typedef _c_cJSON_InsertItemInArray = ffi.Void Function( ffi.Pointer array, ffi.Int32 which, @@ -1212,22 +1541,6 @@ typedef _dart_cJSON_InsertItemInArray = void Function( ffi.Pointer newitem, ); -int cJSON_ReplaceItemViaPointer( - ffi.Pointer parent, - ffi.Pointer item, - ffi.Pointer replacement, -) { - return _cJSON_ReplaceItemViaPointer( - parent, - item, - replacement, - ); -} - -final _dart_cJSON_ReplaceItemViaPointer _cJSON_ReplaceItemViaPointer = - _dylib.lookupFunction<_c_cJSON_ReplaceItemViaPointer, - _dart_cJSON_ReplaceItemViaPointer>('cJSON_ReplaceItemViaPointer'); - typedef _c_cJSON_ReplaceItemViaPointer = ffi.Int32 Function( ffi.Pointer parent, ffi.Pointer item, @@ -1240,22 +1553,6 @@ typedef _dart_cJSON_ReplaceItemViaPointer = int Function( ffi.Pointer replacement, ); -void cJSON_ReplaceItemInArray( - ffi.Pointer array, - int which, - ffi.Pointer newitem, -) { - return _cJSON_ReplaceItemInArray( - array, - which, - newitem, - ); -} - -final _dart_cJSON_ReplaceItemInArray _cJSON_ReplaceItemInArray = - _dylib.lookupFunction<_c_cJSON_ReplaceItemInArray, - _dart_cJSON_ReplaceItemInArray>('cJSON_ReplaceItemInArray'); - typedef _c_cJSON_ReplaceItemInArray = ffi.Void Function( ffi.Pointer array, ffi.Int32 which, @@ -1268,22 +1565,6 @@ typedef _dart_cJSON_ReplaceItemInArray = void Function( ffi.Pointer newitem, ); -void cJSON_ReplaceItemInObject( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer newitem, -) { - return _cJSON_ReplaceItemInObject( - object, - string, - newitem, - ); -} - -final _dart_cJSON_ReplaceItemInObject _cJSON_ReplaceItemInObject = - _dylib.lookupFunction<_c_cJSON_ReplaceItemInObject, - _dart_cJSON_ReplaceItemInObject>('cJSON_ReplaceItemInObject'); - typedef _c_cJSON_ReplaceItemInObject = ffi.Void Function( ffi.Pointer object, ffi.Pointer string, @@ -1296,24 +1577,6 @@ typedef _dart_cJSON_ReplaceItemInObject = void Function( ffi.Pointer newitem, ); -void cJSON_ReplaceItemInObjectCaseSensitive( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer newitem, -) { - return _cJSON_ReplaceItemInObjectCaseSensitive( - object, - string, - newitem, - ); -} - -final _dart_cJSON_ReplaceItemInObjectCaseSensitive - _cJSON_ReplaceItemInObjectCaseSensitive = _dylib.lookupFunction< - _c_cJSON_ReplaceItemInObjectCaseSensitive, - _dart_cJSON_ReplaceItemInObjectCaseSensitive>( - 'cJSON_ReplaceItemInObjectCaseSensitive'); - typedef _c_cJSON_ReplaceItemInObjectCaseSensitive = ffi.Void Function( ffi.Pointer object, ffi.Pointer string, @@ -1326,20 +1589,6 @@ typedef _dart_cJSON_ReplaceItemInObjectCaseSensitive = void Function( ffi.Pointer newitem, ); -ffi.Pointer cJSON_Duplicate( - ffi.Pointer item, - int recurse, -) { - return _cJSON_Duplicate( - item, - recurse, - ); -} - -final _dart_cJSON_Duplicate _cJSON_Duplicate = - _dylib.lookupFunction<_c_cJSON_Duplicate, _dart_cJSON_Duplicate>( - 'cJSON_Duplicate'); - typedef _c_cJSON_Duplicate = ffi.Pointer Function( ffi.Pointer item, ffi.Int32 recurse, @@ -1350,21 +1599,6 @@ typedef _dart_cJSON_Duplicate = ffi.Pointer Function( int recurse, ); -int cJSON_Compare( - ffi.Pointer a, - ffi.Pointer b, - int case_sensitive, -) { - return _cJSON_Compare( - a, - b, - case_sensitive, - ); -} - -final _dart_cJSON_Compare _cJSON_Compare = _dylib - .lookupFunction<_c_cJSON_Compare, _dart_cJSON_Compare>('cJSON_Compare'); - typedef _c_cJSON_Compare = ffi.Int32 Function( ffi.Pointer a, ffi.Pointer b, @@ -1377,17 +1611,6 @@ typedef _dart_cJSON_Compare = int Function( int case_sensitive, ); -void cJSON_Minify( - ffi.Pointer json, -) { - return _cJSON_Minify( - json, - ); -} - -final _dart_cJSON_Minify _cJSON_Minify = - _dylib.lookupFunction<_c_cJSON_Minify, _dart_cJSON_Minify>('cJSON_Minify'); - typedef _c_cJSON_Minify = ffi.Void Function( ffi.Pointer json, ); @@ -1396,20 +1619,6 @@ typedef _dart_cJSON_Minify = void Function( ffi.Pointer json, ); -ffi.Pointer cJSON_AddNullToObject( - ffi.Pointer object, - ffi.Pointer name, -) { - return _cJSON_AddNullToObject( - object, - name, - ); -} - -final _dart_cJSON_AddNullToObject _cJSON_AddNullToObject = _dylib - .lookupFunction<_c_cJSON_AddNullToObject, _dart_cJSON_AddNullToObject>( - 'cJSON_AddNullToObject'); - typedef _c_cJSON_AddNullToObject = ffi.Pointer Function( ffi.Pointer object, ffi.Pointer name, @@ -1420,20 +1629,6 @@ typedef _dart_cJSON_AddNullToObject = ffi.Pointer Function( ffi.Pointer name, ); -ffi.Pointer cJSON_AddTrueToObject( - ffi.Pointer object, - ffi.Pointer name, -) { - return _cJSON_AddTrueToObject( - object, - name, - ); -} - -final _dart_cJSON_AddTrueToObject _cJSON_AddTrueToObject = _dylib - .lookupFunction<_c_cJSON_AddTrueToObject, _dart_cJSON_AddTrueToObject>( - 'cJSON_AddTrueToObject'); - typedef _c_cJSON_AddTrueToObject = ffi.Pointer Function( ffi.Pointer object, ffi.Pointer name, @@ -1444,20 +1639,6 @@ typedef _dart_cJSON_AddTrueToObject = ffi.Pointer Function( ffi.Pointer name, ); -ffi.Pointer cJSON_AddFalseToObject( - ffi.Pointer object, - ffi.Pointer name, -) { - return _cJSON_AddFalseToObject( - object, - name, - ); -} - -final _dart_cJSON_AddFalseToObject _cJSON_AddFalseToObject = _dylib - .lookupFunction<_c_cJSON_AddFalseToObject, _dart_cJSON_AddFalseToObject>( - 'cJSON_AddFalseToObject'); - typedef _c_cJSON_AddFalseToObject = ffi.Pointer Function( ffi.Pointer object, ffi.Pointer name, @@ -1468,22 +1649,6 @@ typedef _dart_cJSON_AddFalseToObject = ffi.Pointer Function( ffi.Pointer name, ); -ffi.Pointer cJSON_AddBoolToObject( - ffi.Pointer object, - ffi.Pointer name, - int boolean, -) { - return _cJSON_AddBoolToObject( - object, - name, - boolean, - ); -} - -final _dart_cJSON_AddBoolToObject _cJSON_AddBoolToObject = _dylib - .lookupFunction<_c_cJSON_AddBoolToObject, _dart_cJSON_AddBoolToObject>( - 'cJSON_AddBoolToObject'); - typedef _c_cJSON_AddBoolToObject = ffi.Pointer Function( ffi.Pointer object, ffi.Pointer name, @@ -1496,22 +1661,6 @@ typedef _dart_cJSON_AddBoolToObject = ffi.Pointer Function( int boolean, ); -ffi.Pointer cJSON_AddNumberToObject( - ffi.Pointer object, - ffi.Pointer name, - double number, -) { - return _cJSON_AddNumberToObject( - object, - name, - number, - ); -} - -final _dart_cJSON_AddNumberToObject _cJSON_AddNumberToObject = _dylib - .lookupFunction<_c_cJSON_AddNumberToObject, _dart_cJSON_AddNumberToObject>( - 'cJSON_AddNumberToObject'); - typedef _c_cJSON_AddNumberToObject = ffi.Pointer Function( ffi.Pointer object, ffi.Pointer name, @@ -1524,22 +1673,6 @@ typedef _dart_cJSON_AddNumberToObject = ffi.Pointer Function( double number, ); -ffi.Pointer cJSON_AddStringToObject( - ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer string, -) { - return _cJSON_AddStringToObject( - object, - name, - string, - ); -} - -final _dart_cJSON_AddStringToObject _cJSON_AddStringToObject = _dylib - .lookupFunction<_c_cJSON_AddStringToObject, _dart_cJSON_AddStringToObject>( - 'cJSON_AddStringToObject'); - typedef _c_cJSON_AddStringToObject = ffi.Pointer Function( ffi.Pointer object, ffi.Pointer name, @@ -1552,22 +1685,6 @@ typedef _dart_cJSON_AddStringToObject = ffi.Pointer Function( ffi.Pointer string, ); -ffi.Pointer cJSON_AddRawToObject( - ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer raw, -) { - return _cJSON_AddRawToObject( - object, - name, - raw, - ); -} - -final _dart_cJSON_AddRawToObject _cJSON_AddRawToObject = - _dylib.lookupFunction<_c_cJSON_AddRawToObject, _dart_cJSON_AddRawToObject>( - 'cJSON_AddRawToObject'); - typedef _c_cJSON_AddRawToObject = ffi.Pointer Function( ffi.Pointer object, ffi.Pointer name, @@ -1580,20 +1697,6 @@ typedef _dart_cJSON_AddRawToObject = ffi.Pointer Function( ffi.Pointer raw, ); -ffi.Pointer cJSON_AddObjectToObject( - ffi.Pointer object, - ffi.Pointer name, -) { - return _cJSON_AddObjectToObject( - object, - name, - ); -} - -final _dart_cJSON_AddObjectToObject _cJSON_AddObjectToObject = _dylib - .lookupFunction<_c_cJSON_AddObjectToObject, _dart_cJSON_AddObjectToObject>( - 'cJSON_AddObjectToObject'); - typedef _c_cJSON_AddObjectToObject = ffi.Pointer Function( ffi.Pointer object, ffi.Pointer name, @@ -1604,20 +1707,6 @@ typedef _dart_cJSON_AddObjectToObject = ffi.Pointer Function( ffi.Pointer name, ); -ffi.Pointer cJSON_AddArrayToObject( - ffi.Pointer object, - ffi.Pointer name, -) { - return _cJSON_AddArrayToObject( - object, - name, - ); -} - -final _dart_cJSON_AddArrayToObject _cJSON_AddArrayToObject = _dylib - .lookupFunction<_c_cJSON_AddArrayToObject, _dart_cJSON_AddArrayToObject>( - 'cJSON_AddArrayToObject'); - typedef _c_cJSON_AddArrayToObject = ffi.Pointer Function( ffi.Pointer object, ffi.Pointer name, @@ -1628,20 +1717,6 @@ typedef _dart_cJSON_AddArrayToObject = ffi.Pointer Function( ffi.Pointer name, ); -double cJSON_SetNumberHelper( - ffi.Pointer object, - double number, -) { - return _cJSON_SetNumberHelper( - object, - number, - ); -} - -final _dart_cJSON_SetNumberHelper _cJSON_SetNumberHelper = _dylib - .lookupFunction<_c_cJSON_SetNumberHelper, _dart_cJSON_SetNumberHelper>( - 'cJSON_SetNumberHelper'); - typedef _c_cJSON_SetNumberHelper = ffi.Double Function( ffi.Pointer object, ffi.Double number, @@ -1652,17 +1727,6 @@ typedef _dart_cJSON_SetNumberHelper = double Function( double number, ); -ffi.Pointer cJSON_malloc( - int size, -) { - return _cJSON_malloc( - size, - ); -} - -final _dart_cJSON_malloc _cJSON_malloc = - _dylib.lookupFunction<_c_cJSON_malloc, _dart_cJSON_malloc>('cJSON_malloc'); - typedef _c_cJSON_malloc = ffi.Pointer Function( ffi.Uint64 size, ); @@ -1671,17 +1735,6 @@ typedef _dart_cJSON_malloc = ffi.Pointer Function( int size, ); -void cJSON_free( - ffi.Pointer object, -) { - return _cJSON_free( - object, - ); -} - -final _dart_cJSON_free _cJSON_free = - _dylib.lookupFunction<_c_cJSON_free, _dart_cJSON_free>('cJSON_free'); - typedef _c_cJSON_free = ffi.Void Function( ffi.Pointer object, ); @@ -1689,3 +1742,11 @@ typedef _c_cJSON_free = ffi.Void Function( typedef _dart_cJSON_free = void Function( ffi.Pointer object, ); + +typedef _typedefC_1 = ffi.Pointer Function( + ffi.Uint64, +); + +typedef _typedefC_2 = ffi.Void Function( + ffi.Pointer, +); diff --git a/pkgs/ffigen/example/c_json/main.dart b/pkgs/ffigen/example/c_json/main.dart index 22db183553..fa4bbbce81 100644 --- a/pkgs/ffigen/example/c_json/main.dart +++ b/pkgs/ffigen/example/c_json/main.dart @@ -8,13 +8,12 @@ import 'dart:io'; import 'package:ffi/ffi.dart'; -import 'cjson_generated_bindings.dart' as cjson; +import 'cjson_generated_bindings.dart' as cj; + +final cjson = cj.CJson(DynamicLibrary.open(_getPath())); /// Using the generated C_JSON bindings. void main() { - // Initialise cjson bindings. - cjson.init(DynamicLibrary.open(_getPath())); - // Load json from [example.json] file. final jsonString = File('./example.json').readAsStringSync(); @@ -56,12 +55,12 @@ String _getPath() { return path; } -dynamic convertCJsonToDartObj(Pointer parsedcjson) { +dynamic convertCJsonToDartObj(Pointer parsedcjson) { dynamic obj; if (cjson.cJSON_IsObject(parsedcjson.cast()) == 1) { obj = {}; - Pointer ptr; + Pointer ptr; ptr = parsedcjson.ref.child; while (ptr != nullptr) { final dynamic o = convertCJsonToDartObj(ptr); @@ -71,7 +70,7 @@ dynamic convertCJsonToDartObj(Pointer parsedcjson) { } else if (cjson.cJSON_IsArray(parsedcjson.cast()) == 1) { obj = []; - Pointer ptr; + Pointer ptr; ptr = parsedcjson.ref.child; while (ptr != nullptr) { final dynamic o = convertCJsonToDartObj(ptr); diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index 7e913b6e9d..22d64ad6e5 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -16,6 +16,8 @@ dev_dependencies: ffigen: output: 'cjson_generated_bindings.dart' + name: 'CJson' + description: 'Holds bindings to cJSON.' headers: - '../../third_party/cjson_library/cJSON.h' header-filter: diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index 6a0d1d3dbb..eee8d524bb 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -4,2432 +4,3734 @@ import 'dart:ffi' as ffi; -/// Holds the Dynamic library. -ffi.DynamicLibrary _dylib; - -/// Initialises the Dynamic library. -void init(ffi.DynamicLibrary dynamicLibrary) { - _dylib = dynamicLibrary; -} - -/// 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. - ffi.Pointer Results; +/// Holds bindings to LibClang. +class LibClang { + /// Holds the Dynamic library. + final ffi.DynamicLibrary _dylib; + + /// The symbols are looked up in [dynamicLibrary]. + LibClang(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + + /// Free the given string set. + void clang_disposeStringSet( + ffi.Pointer set, + ) { + _clang_disposeStringSet ??= _dylib.lookupFunction<_c_clang_disposeStringSet, + _dart_clang_disposeStringSet>('clang_disposeStringSet'); + return _clang_disposeStringSet( + set, + ); + } - /// The number of code-completion results stored in the - /// \c Results array. - @ffi.Uint32() - int NumResults; -} + _dart_clang_disposeStringSet _clang_disposeStringSet; -/// A single result of code completion. -class CXCompletionResult extends ffi.Struct { - /// The kind of entity that this completion refers to. + /// Provides a shared context for creating translation units. /// - /// 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. + /// It provides two options: /// - /// \todo In the future, we would like to provide a full cursor, to allow - /// the client to extract additional information from declaration. - @ffi.Int32() - int CursorKind; + /// - excludeDeclarationsFromPCH: When non-zero, allows enumeration of "local" + /// declarations (when loading any new translation units). A "local" declaration + /// is one that belongs in the translation unit itself and not in a precompiled + /// header that was used by the translation unit. If zero, all declarations + /// will be enumerated. + /// + /// Here is an example: + /// + /// \code + /// // excludeDeclsFromPCH = 1, displayDiagnostics=1 + /// Idx = clang_createIndex(1, 1); + /// + /// // IndexTest.pch was produced with the following command: + /// // "clang -x c IndexTest.h -emit-ast -o IndexTest.pch" + /// TU = clang_createTranslationUnit(Idx, "IndexTest.pch"); + /// + /// // This will load all the symbols from 'IndexTest.pch' + /// clang_visitChildren(clang_getTranslationUnitCursor(TU), + /// TranslationUnitVisitor, 0); + /// clang_disposeTranslationUnit(TU); + /// + /// // This will load all the symbols from 'IndexTest.c', excluding symbols + /// // from 'IndexTest.pch'. + /// char *args[] = { "-Xclang", "-include-pch=IndexTest.pch" }; + /// TU = clang_createTranslationUnitFromSourceFile(Idx, "IndexTest.c", 2, args, + /// 0, 0); + /// clang_visitChildren(clang_getTranslationUnitCursor(TU), + /// TranslationUnitVisitor, 0); + /// clang_disposeTranslationUnit(TU); + /// \endcode + /// + /// This process of creating the 'pch', loading it separately, and using it (via + /// -include-pch) allows 'excludeDeclsFromPCH' to remove redundant callbacks + /// (which gives the indexer the same performance benefit as the compiler). + ffi.Pointer clang_createIndex( + int excludeDeclarationsFromPCH, + int displayDiagnostics, + ) { + _clang_createIndex ??= + _dylib.lookupFunction<_c_clang_createIndex, _dart_clang_createIndex>( + 'clang_createIndex'); + return _clang_createIndex( + excludeDeclarationsFromPCH, + displayDiagnostics, + ); + } - /// The code-completion string that describes how to insert this - /// code-completion result into the editing buffer. - ffi.Pointer CompletionString; -} + _dart_clang_createIndex _clang_createIndex; -/// 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() - int kind; + /// Destroy the given index. + /// + /// The index must not be destroyed until all of the translation units created + /// within that index have been destroyed. + void clang_disposeIndex( + ffi.Pointer index, + ) { + _clang_disposeIndex ??= + _dylib.lookupFunction<_c_clang_disposeIndex, _dart_clang_disposeIndex>( + 'clang_disposeIndex'); + return _clang_disposeIndex( + index, + ); + } - @ffi.Int32() - int xdata; + _dart_clang_disposeIndex _clang_disposeIndex; - ffi.Pointer _exp_workaround_data_item_0; - ffi.Pointer _exp_workaround_data_item_1; - ffi.Pointer _exp_workaround_data_item_2; + /// Sets general options associated with a CXIndex. + /// + /// For example: + /// \code + /// CXIndex idx = ...; + /// clang_CXIndex_setGlobalOptions(idx, + /// clang_CXIndex_getGlobalOptions(idx) | + /// CXGlobalOpt_ThreadBackgroundPriorityForIndexing); + /// \endcode + /// + /// \param options A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags. + void clang_CXIndex_setGlobalOptions( + ffi.Pointer arg0, + int options, + ) { + _clang_CXIndex_setGlobalOptions ??= _dylib.lookupFunction< + _c_clang_CXIndex_setGlobalOptions, + _dart_clang_CXIndex_setGlobalOptions>('clang_CXIndex_setGlobalOptions'); + return _clang_CXIndex_setGlobalOptions( + arg0, + options, + ); + } - /// Helper for array `data`. - ArrayHelper_CXCursor_data_level0 get data => - ArrayHelper_CXCursor_data_level0(this, [3], 0, 0); -} + _dart_clang_CXIndex_setGlobalOptions _clang_CXIndex_setGlobalOptions; -/// 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.'); - } + /// Gets the general options associated with a CXIndex. + /// + /// \returns A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags that + /// are associated with the given CXIndex object. + int clang_CXIndex_getGlobalOptions( + ffi.Pointer arg0, + ) { + _clang_CXIndex_getGlobalOptions ??= _dylib.lookupFunction< + _c_clang_CXIndex_getGlobalOptions, + _dart_clang_CXIndex_getGlobalOptions>('clang_CXIndex_getGlobalOptions'); + return _clang_CXIndex_getGlobalOptions( + arg0, + ); } - ffi.Pointer operator [](int index) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - return _struct._exp_workaround_data_item_0; - case 1: - return _struct._exp_workaround_data_item_1; - case 2: - return _struct._exp_workaround_data_item_2; - default: - throw Exception('Invalid Array Helper generated.'); - } + _dart_clang_CXIndex_getGlobalOptions _clang_CXIndex_getGlobalOptions; + + /// Sets the invocation emission path option in a CXIndex. + /// + /// The invocation emission path specifies a path which will contain log + /// files for certain libclang invocations. A null value (default) implies that + /// libclang invocations are not logged.. + void clang_CXIndex_setInvocationEmissionPathOption( + ffi.Pointer arg0, + ffi.Pointer Path, + ) { + _clang_CXIndex_setInvocationEmissionPathOption ??= _dylib.lookupFunction< + _c_clang_CXIndex_setInvocationEmissionPathOption, + _dart_clang_CXIndex_setInvocationEmissionPathOption>( + 'clang_CXIndex_setInvocationEmissionPathOption'); + return _clang_CXIndex_setInvocationEmissionPathOption( + arg0, + Path, + ); } - void operator []=(int index, ffi.Pointer value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._exp_workaround_data_item_0 = value; - break; - case 1: - _struct._exp_workaround_data_item_1 = value; - break; - case 2: - _struct._exp_workaround_data_item_2 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } + _dart_clang_CXIndex_setInvocationEmissionPathOption + _clang_CXIndex_setInvocationEmissionPathOption; + + /// Retrieve the last modification time of the given file. + int clang_getFileTime( + ffi.Pointer SFile, + ) { + _clang_getFileTime ??= + _dylib.lookupFunction<_c_clang_getFileTime, _dart_clang_getFileTime>( + 'clang_getFileTime'); + return _clang_getFileTime( + SFile, + ); } -} -class CXCursorAndRangeVisitor extends ffi.Struct {} + _dart_clang_getFileTime _clang_getFileTime; -class CXCursorSetImpl extends ffi.Struct {} + /// Retrieve the unique ID for the given \c file. + /// + /// \param file the file to get the ID for. + /// \param outID stores the returned CXFileUniqueID. + /// \returns If there was a failure getting the unique ID, returns non-zero, + /// otherwise returns 0. + int clang_getFileUniqueID( + ffi.Pointer file, + ffi.Pointer outID, + ) { + _clang_getFileUniqueID ??= _dylib.lookupFunction<_c_clang_getFileUniqueID, + _dart_clang_getFileUniqueID>('clang_getFileUniqueID'); + return _clang_getFileUniqueID( + file, + outID, + ); + } -/// Uniquely identifies a CXFile, that refers to the same underlying file, -/// across an indexing session. -class CXFileUniqueID extends ffi.Struct { - @ffi.Uint64() - int _exp_workaround_data_item_0; - @ffi.Uint64() - int _exp_workaround_data_item_1; - @ffi.Uint64() - int _exp_workaround_data_item_2; + _dart_clang_getFileUniqueID _clang_getFileUniqueID; - /// Helper for array `data`. - ArrayHelper_CXFileUniqueID_data_level0 get data => - ArrayHelper_CXFileUniqueID_data_level0(this, [3], 0, 0); -} + /// Determine whether the given header is guarded against + /// multiple inclusions, either with the conventional + /// \#ifndef/\#define/\#endif macro guards or with \#pragma once. + int clang_isFileMultipleIncludeGuarded( + ffi.Pointer tu, + ffi.Pointer file, + ) { + _clang_isFileMultipleIncludeGuarded ??= _dylib.lookupFunction< + _c_clang_isFileMultipleIncludeGuarded, + _dart_clang_isFileMultipleIncludeGuarded>( + 'clang_isFileMultipleIncludeGuarded'); + return _clang_isFileMultipleIncludeGuarded( + tu, + file, + ); + } -/// 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.'); - } + _dart_clang_isFileMultipleIncludeGuarded _clang_isFileMultipleIncludeGuarded; + + /// Retrieve a file handle within the given translation unit. + /// + /// \param tu the translation unit + /// + /// \param file_name the name of the file. + /// + /// \returns the file handle for the named file in the translation unit \p tu, + /// or a NULL file handle if the file was not a part of this translation unit. + ffi.Pointer clang_getFile( + ffi.Pointer tu, + ffi.Pointer file_name, + ) { + _clang_getFile ??= _dylib + .lookupFunction<_c_clang_getFile, _dart_clang_getFile>('clang_getFile'); + return _clang_getFile( + tu, + file_name, + ); } - int operator [](int index) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - return _struct._exp_workaround_data_item_0; - case 1: - return _struct._exp_workaround_data_item_1; - case 2: - return _struct._exp_workaround_data_item_2; - default: - throw Exception('Invalid Array Helper generated.'); - } + _dart_clang_getFile _clang_getFile; + + /// Retrieve the buffer associated with the given file. + /// + /// \param tu the translation unit + /// + /// \param file the file for which to retrieve the buffer. + /// + /// \param size [out] if non-NULL, will be set to the size of the buffer. + /// + /// \returns a pointer to the buffer in memory that holds the contents of + /// \p file, or a NULL pointer when the file is not loaded. + ffi.Pointer clang_getFileContents( + ffi.Pointer tu, + ffi.Pointer file, + ffi.Pointer size, + ) { + _clang_getFileContents ??= _dylib.lookupFunction<_c_clang_getFileContents, + _dart_clang_getFileContents>('clang_getFileContents'); + return _clang_getFileContents( + tu, + file, + size, + ); } - void operator []=(int index, int value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._exp_workaround_data_item_0 = value; - break; - case 1: - _struct._exp_workaround_data_item_1 = value; - break; - case 2: - _struct._exp_workaround_data_item_2 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } + _dart_clang_getFileContents _clang_getFileContents; + + /// Returns non-zero if the \c file1 and \c file2 point to the same file, + /// or they are both NULL. + int clang_File_isEqual( + ffi.Pointer file1, + ffi.Pointer file2, + ) { + _clang_File_isEqual ??= + _dylib.lookupFunction<_c_clang_File_isEqual, _dart_clang_File_isEqual>( + 'clang_File_isEqual'); + return _clang_File_isEqual( + file1, + file2, + ); } -} -class CXGlobalOptFlags { - /// Used to indicate that no special CXIndex options are needed. - static const int CXGlobalOpt_None = 0; + _dart_clang_File_isEqual _clang_File_isEqual; - /// Used to indicate that threads that libclang creates for indexing - /// purposes should use background priority. + /// Retrieve all ranges that were skipped by the preprocessor. /// - /// Affects #clang_indexSourceFile, #clang_indexTranslationUnit, - /// #clang_parseTranslationUnit, #clang_saveTranslationUnit. - static const int CXGlobalOpt_ThreadBackgroundPriorityForIndexing = 1; + /// The preprocessor will skip lines when they are surrounded by an + /// if/ifdef/ifndef directive whose condition does not evaluate to true. + ffi.Pointer clang_getSkippedRanges( + ffi.Pointer tu, + ffi.Pointer file, + ) { + _clang_getSkippedRanges ??= _dylib.lookupFunction<_c_clang_getSkippedRanges, + _dart_clang_getSkippedRanges>('clang_getSkippedRanges'); + return _clang_getSkippedRanges( + tu, + file, + ); + } - /// 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; + _dart_clang_getSkippedRanges _clang_getSkippedRanges; - /// Used to indicate that all threads that libclang creates should use - /// background priority. - static const int CXGlobalOpt_ThreadBackgroundPriorityForAll = 3; -} + /// Retrieve all ranges from all files that were skipped by the + /// preprocessor. + /// + /// The preprocessor will skip lines when they are surrounded by an + /// if/ifdef/ifndef directive whose condition does not evaluate to true. + ffi.Pointer clang_getAllSkippedRanges( + ffi.Pointer tu, + ) { + _clang_getAllSkippedRanges ??= _dylib.lookupFunction< + _c_clang_getAllSkippedRanges, + _dart_clang_getAllSkippedRanges>('clang_getAllSkippedRanges'); + return _clang_getAllSkippedRanges( + tu, + ); + } -class CXIdxAttrInfo extends ffi.Struct {} + _dart_clang_getAllSkippedRanges _clang_getAllSkippedRanges; -class CXIdxBaseClassInfo extends ffi.Struct {} + /// Destroy the given \c CXSourceRangeList. + void clang_disposeSourceRangeList( + ffi.Pointer ranges, + ) { + _clang_disposeSourceRangeList ??= _dylib.lookupFunction< + _c_clang_disposeSourceRangeList, + _dart_clang_disposeSourceRangeList>('clang_disposeSourceRangeList'); + return _clang_disposeSourceRangeList( + ranges, + ); + } -class CXIdxCXXClassDeclInfo extends ffi.Struct { - ffi.Pointer declInfo; + _dart_clang_disposeSourceRangeList _clang_disposeSourceRangeList; - ffi.Pointer> bases; + /// Determine the number of diagnostics in a CXDiagnosticSet. + int clang_getNumDiagnosticsInSet( + ffi.Pointer Diags, + ) { + _clang_getNumDiagnosticsInSet ??= _dylib.lookupFunction< + _c_clang_getNumDiagnosticsInSet, + _dart_clang_getNumDiagnosticsInSet>('clang_getNumDiagnosticsInSet'); + return _clang_getNumDiagnosticsInSet( + Diags, + ); + } - @ffi.Uint32() - int numBases; -} + _dart_clang_getNumDiagnosticsInSet _clang_getNumDiagnosticsInSet; -class CXIdxContainerInfo extends ffi.Struct {} + /// Retrieve a diagnostic associated with the given CXDiagnosticSet. + /// + /// \param Diags the CXDiagnosticSet 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_getDiagnosticInSet( + ffi.Pointer Diags, + int Index, + ) { + _clang_getDiagnosticInSet ??= _dylib.lookupFunction< + _c_clang_getDiagnosticInSet, + _dart_clang_getDiagnosticInSet>('clang_getDiagnosticInSet'); + return _clang_getDiagnosticInSet( + Diags, + Index, + ); + } -class CXIdxDeclInfo extends ffi.Struct {} + _dart_clang_getDiagnosticInSet _clang_getDiagnosticInSet; -class CXIdxEntityInfo extends ffi.Struct {} + /// Deserialize a set of diagnostics from a Clang diagnostics bitcode + /// file. + /// + /// \param file The name of the file to deserialize. + /// \param error A pointer to a enum value recording if there was a problem + /// deserializing the diagnostics. + /// \param errorString A pointer to a CXString for recording the error string + /// if the file was not successfully loaded. + /// + /// \returns A loaded CXDiagnosticSet if successful, and NULL otherwise. These + /// diagnostics should be released using clang_disposeDiagnosticSet(). + ffi.Pointer clang_loadDiagnostics( + ffi.Pointer file, + ffi.Pointer error, + ffi.Pointer errorString, + ) { + _clang_loadDiagnostics ??= _dylib.lookupFunction<_c_clang_loadDiagnostics, + _dart_clang_loadDiagnostics>('clang_loadDiagnostics'); + return _clang_loadDiagnostics( + file, + error, + errorString, + ); + } -/// Data for IndexerCallbacks#indexEntityReference. -class CXIdxEntityRefInfo extends ffi.Struct {} + _dart_clang_loadDiagnostics _clang_loadDiagnostics; -class CXIdxIBOutletCollectionAttrInfo extends ffi.Struct {} + /// Release a CXDiagnosticSet and all of its contained diagnostics. + void clang_disposeDiagnosticSet( + ffi.Pointer Diags, + ) { + _clang_disposeDiagnosticSet ??= _dylib.lookupFunction< + _c_clang_disposeDiagnosticSet, + _dart_clang_disposeDiagnosticSet>('clang_disposeDiagnosticSet'); + return _clang_disposeDiagnosticSet( + Diags, + ); + } -/// Data for IndexerCallbacks#importedASTFile. -class CXIdxImportedASTFileInfo extends ffi.Struct {} + _dart_clang_disposeDiagnosticSet _clang_disposeDiagnosticSet; -/// Data for ppIncludedFile callback. -class CXIdxIncludedFileInfo extends ffi.Struct {} + /// Retrieve the child diagnostics of a CXDiagnostic. + /// + /// This CXDiagnosticSet does not need to be released by + /// clang_disposeDiagnosticSet. + ffi.Pointer clang_getChildDiagnostics( + ffi.Pointer D, + ) { + _clang_getChildDiagnostics ??= _dylib.lookupFunction< + _c_clang_getChildDiagnostics, + _dart_clang_getChildDiagnostics>('clang_getChildDiagnostics'); + return _clang_getChildDiagnostics( + D, + ); + } -/// Source location passed to index callbacks. -class CXIdxLoc extends ffi.Struct { - ffi.Pointer _exp_workaround_ptr_data_item_0; - ffi.Pointer _exp_workaround_ptr_data_item_1; + _dart_clang_getChildDiagnostics _clang_getChildDiagnostics; + + /// Determine the number of diagnostics produced for the given + /// translation unit. + int clang_getNumDiagnostics( + ffi.Pointer Unit, + ) { + _clang_getNumDiagnostics ??= _dylib.lookupFunction< + _c_clang_getNumDiagnostics, + _dart_clang_getNumDiagnostics>('clang_getNumDiagnostics'); + return _clang_getNumDiagnostics( + Unit, + ); + } - /// Helper for array `ptr_data`. - ArrayHelper_CXIdxLoc_ptr_data_level0 get ptr_data => - ArrayHelper_CXIdxLoc_ptr_data_level0(this, [2], 0, 0); - @ffi.Uint32() - int int_data; -} + _dart_clang_getNumDiagnostics _clang_getNumDiagnostics; -/// 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.'); - } + /// Retrieve a diagnostic associated with the given translation unit. + /// + /// \param Unit the translation unit 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_getDiagnostic( + ffi.Pointer Unit, + int Index, + ) { + _clang_getDiagnostic ??= _dylib.lookupFunction<_c_clang_getDiagnostic, + _dart_clang_getDiagnostic>('clang_getDiagnostic'); + return _clang_getDiagnostic( + Unit, + Index, + ); } - ffi.Pointer operator [](int index) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - return _struct._exp_workaround_ptr_data_item_0; - case 1: - return _struct._exp_workaround_ptr_data_item_1; - default: - throw Exception('Invalid Array Helper generated.'); - } - } + _dart_clang_getDiagnostic _clang_getDiagnostic; - void operator []=(int index, ffi.Pointer value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._exp_workaround_ptr_data_item_0 = value; - break; - case 1: - _struct._exp_workaround_ptr_data_item_1 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } + /// Retrieve the complete set of diagnostics associated with a + /// translation unit. + /// + /// \param Unit the translation unit to query. + ffi.Pointer clang_getDiagnosticSetFromTU( + ffi.Pointer Unit, + ) { + _clang_getDiagnosticSetFromTU ??= _dylib.lookupFunction< + _c_clang_getDiagnosticSetFromTU, + _dart_clang_getDiagnosticSetFromTU>('clang_getDiagnosticSetFromTU'); + return _clang_getDiagnosticSetFromTU( + Unit, + ); } -} -class CXIdxObjCCategoryDeclInfo extends ffi.Struct {} + _dart_clang_getDiagnosticSetFromTU _clang_getDiagnosticSetFromTU; + + /// Destroy a diagnostic. + void clang_disposeDiagnostic( + ffi.Pointer Diagnostic, + ) { + _clang_disposeDiagnostic ??= _dylib.lookupFunction< + _c_clang_disposeDiagnostic, + _dart_clang_disposeDiagnostic>('clang_disposeDiagnostic'); + return _clang_disposeDiagnostic( + Diagnostic, + ); + } -class CXIdxObjCContainerDeclInfo extends ffi.Struct { - ffi.Pointer declInfo; + _dart_clang_disposeDiagnostic _clang_disposeDiagnostic; - @ffi.Int32() - int kind; -} + /// Retrieve the set of display options most similar to the + /// default behavior of the clang compiler. + /// + /// \returns A set of display options suitable for use with \c + /// clang_formatDiagnostic(). + int clang_defaultDiagnosticDisplayOptions() { + _clang_defaultDiagnosticDisplayOptions ??= _dylib.lookupFunction< + _c_clang_defaultDiagnosticDisplayOptions, + _dart_clang_defaultDiagnosticDisplayOptions>( + 'clang_defaultDiagnosticDisplayOptions'); + return _clang_defaultDiagnosticDisplayOptions(); + } -class CXIdxObjCInterfaceDeclInfo extends ffi.Struct { - ffi.Pointer containerInfo; + _dart_clang_defaultDiagnosticDisplayOptions + _clang_defaultDiagnosticDisplayOptions; - ffi.Pointer superInfo; + /// Determine the severity of the given diagnostic. + int clang_getDiagnosticSeverity( + ffi.Pointer arg0, + ) { + _clang_getDiagnosticSeverity ??= _dylib.lookupFunction< + _c_clang_getDiagnosticSeverity, + _dart_clang_getDiagnosticSeverity>('clang_getDiagnosticSeverity'); + return _clang_getDiagnosticSeverity( + arg0, + ); + } - ffi.Pointer protocols; -} + _dart_clang_getDiagnosticSeverity _clang_getDiagnosticSeverity; -class CXIdxObjCPropertyDeclInfo extends ffi.Struct { - ffi.Pointer declInfo; + /// Retrieve the category number for this diagnostic. + /// + /// Diagnostics can be categorized into groups along with other, related + /// diagnostics (e.g., diagnostics under the same warning flag). This routine + /// retrieves the category number for the given diagnostic. + /// + /// \returns The number of the category that contains this diagnostic, or zero + /// if this diagnostic is uncategorized. + int clang_getDiagnosticCategory( + ffi.Pointer arg0, + ) { + _clang_getDiagnosticCategory ??= _dylib.lookupFunction< + _c_clang_getDiagnosticCategory, + _dart_clang_getDiagnosticCategory>('clang_getDiagnosticCategory'); + return _clang_getDiagnosticCategory( + arg0, + ); + } - ffi.Pointer getter; + _dart_clang_getDiagnosticCategory _clang_getDiagnosticCategory; - ffi.Pointer setter; -} + /// Determine the number of source ranges associated with the given + /// diagnostic. + int clang_getDiagnosticNumRanges( + ffi.Pointer arg0, + ) { + _clang_getDiagnosticNumRanges ??= _dylib.lookupFunction< + _c_clang_getDiagnosticNumRanges, + _dart_clang_getDiagnosticNumRanges>('clang_getDiagnosticNumRanges'); + return _clang_getDiagnosticNumRanges( + arg0, + ); + } -class CXIdxObjCProtocolRefInfo extends ffi.Struct {} + _dart_clang_getDiagnosticNumRanges _clang_getDiagnosticNumRanges; -class CXIdxObjCProtocolRefListInfo extends ffi.Struct { - ffi.Pointer> protocols; + /// Determine the number of fix-it hints associated with the + /// given diagnostic. + int clang_getDiagnosticNumFixIts( + ffi.Pointer Diagnostic, + ) { + _clang_getDiagnosticNumFixIts ??= _dylib.lookupFunction< + _c_clang_getDiagnosticNumFixIts, + _dart_clang_getDiagnosticNumFixIts>('clang_getDiagnosticNumFixIts'); + return _clang_getDiagnosticNumFixIts( + Diagnostic, + ); + } - @ffi.Uint32() - int numProtocols; -} + _dart_clang_getDiagnosticNumFixIts _clang_getDiagnosticNumFixIts; -/// 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 {} + /// Return the CXTranslationUnit for a given source file and the provided + /// command line arguments one would pass to the compiler. + /// + /// Note: The 'source_filename' argument is optional. If the caller provides a + /// NULL pointer, the name of the source file is expected to reside in the + /// specified command line arguments. + /// + /// Note: When encountered in 'clang_command_line_args', the following options + /// are ignored: + /// + /// '-c' + /// '-emit-ast' + /// '-fsyntax-only' + /// '-o \' (both '-o' and '\' are ignored) + /// + /// \param CIdx The index object with which the translation unit will be + /// associated. + /// + /// \param source_filename The name of the source file to load, or NULL if the + /// source file is included in \p clang_command_line_args. + /// + /// \param num_clang_command_line_args The number of command-line arguments in + /// \p clang_command_line_args. + /// + /// \param clang_command_line_args The command-line arguments that would be + /// passed to the \c clang executable if it were being invoked out-of-process. + /// These command-line options will be parsed and will affect how the translation + /// unit is parsed. Note that the following options are ignored: '-c', + /// '-emit-ast', '-fsyntax-only' (which is the default), and '-o \'. + /// + /// \param num_unsaved_files the number of unsaved file entries in \p + /// unsaved_files. + /// + /// \param unsaved_files the files that have not yet been saved to disk + /// but may be required for 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. + ffi.Pointer clang_createTranslationUnitFromSourceFile( + 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, + ) { + _clang_createTranslationUnitFromSourceFile ??= _dylib.lookupFunction< + _c_clang_createTranslationUnitFromSourceFile, + _dart_clang_createTranslationUnitFromSourceFile>( + 'clang_createTranslationUnitFromSourceFile'); + return _clang_createTranslationUnitFromSourceFile( + CIdx, + source_filename, + num_clang_command_line_args, + clang_command_line_args, + num_unsaved_files, + unsaved_files, + ); + } -/// 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 { - ffi.Pointer _exp_workaround_ptr_data_item_0; - ffi.Pointer _exp_workaround_ptr_data_item_1; + _dart_clang_createTranslationUnitFromSourceFile + _clang_createTranslationUnitFromSourceFile; + + /// Same as \c clang_createTranslationUnit2, but returns + /// the \c CXTranslationUnit instead of an error code. In case of an error this + /// routine returns a \c NULL \c CXTranslationUnit, without further detailed + /// error codes. + ffi.Pointer clang_createTranslationUnit( + ffi.Pointer CIdx, + ffi.Pointer ast_filename, + ) { + _clang_createTranslationUnit ??= _dylib.lookupFunction< + _c_clang_createTranslationUnit, + _dart_clang_createTranslationUnit>('clang_createTranslationUnit'); + return _clang_createTranslationUnit( + CIdx, + ast_filename, + ); + } - /// Helper for array `ptr_data`. - ArrayHelper_CXSourceLocation_ptr_data_level0 get ptr_data => - ArrayHelper_CXSourceLocation_ptr_data_level0(this, [2], 0, 0); - @ffi.Uint32() - int int_data; -} + _dart_clang_createTranslationUnit _clang_createTranslationUnit; -/// 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.'); - } + /// Create a translation unit from an AST file (\c -emit-ast). + /// + /// \param[out] out_TU A non-NULL pointer to store the created + /// \c CXTranslationUnit. + /// + /// \returns Zero on success, otherwise returns an error code. + int clang_createTranslationUnit2( + ffi.Pointer CIdx, + ffi.Pointer ast_filename, + ffi.Pointer> out_TU, + ) { + _clang_createTranslationUnit2 ??= _dylib.lookupFunction< + _c_clang_createTranslationUnit2, + _dart_clang_createTranslationUnit2>('clang_createTranslationUnit2'); + return _clang_createTranslationUnit2( + CIdx, + ast_filename, + out_TU, + ); } - ffi.Pointer operator [](int index) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - return _struct._exp_workaround_ptr_data_item_0; - case 1: - return _struct._exp_workaround_ptr_data_item_1; - default: - throw Exception('Invalid Array Helper generated.'); - } + _dart_clang_createTranslationUnit2 _clang_createTranslationUnit2; + + /// Returns the set of flags that is suitable for parsing a translation + /// unit that is being edited. + /// + /// The set of flags returned provide options for \c clang_parseTranslationUnit() + /// to indicate that the translation unit is likely to be reparsed many times, + /// either explicitly (via \c clang_reparseTranslationUnit()) or implicitly + /// (e.g., by code completion (\c clang_codeCompletionAt())). The returned flag + /// set contains an unspecified set of optimizations (e.g., the precompiled + /// preamble) geared toward improving the performance of these routines. The + /// set of optimizations enabled may change from one version to the next. + int clang_defaultEditingTranslationUnitOptions() { + _clang_defaultEditingTranslationUnitOptions ??= _dylib.lookupFunction< + _c_clang_defaultEditingTranslationUnitOptions, + _dart_clang_defaultEditingTranslationUnitOptions>( + 'clang_defaultEditingTranslationUnitOptions'); + return _clang_defaultEditingTranslationUnitOptions(); } - void operator []=(int index, ffi.Pointer value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._exp_workaround_ptr_data_item_0 = value; - break; - case 1: - _struct._exp_workaround_ptr_data_item_1 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } + _dart_clang_defaultEditingTranslationUnitOptions + _clang_defaultEditingTranslationUnitOptions; + + /// Same as \c clang_parseTranslationUnit2, but returns + /// the \c CXTranslationUnit instead of an error code. In case of an error this + /// routine returns a \c NULL \c CXTranslationUnit, without further detailed + /// error codes. + ffi.Pointer clang_parseTranslationUnit( + 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, + ) { + _clang_parseTranslationUnit ??= _dylib.lookupFunction< + _c_clang_parseTranslationUnit, + _dart_clang_parseTranslationUnit>('clang_parseTranslationUnit'); + return _clang_parseTranslationUnit( + CIdx, + source_filename, + command_line_args, + num_command_line_args, + unsaved_files, + num_unsaved_files, + options, + ); } -} -/// 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 { - ffi.Pointer _exp_workaround_ptr_data_item_0; - ffi.Pointer _exp_workaround_ptr_data_item_1; + _dart_clang_parseTranslationUnit _clang_parseTranslationUnit; - /// Helper for array `ptr_data`. - ArrayHelper_CXSourceRange_ptr_data_level0 get ptr_data => - ArrayHelper_CXSourceRange_ptr_data_level0(this, [2], 0, 0); - @ffi.Uint32() - int begin_int_data; + /// Parse the given source file and the translation unit corresponding + /// to that file. + /// + /// This routine is the main entry point for the Clang C API, providing the + /// ability to parse a source file into a translation unit that can then be + /// queried by other functions in the API. This routine accepts a set of + /// command-line arguments so that the compilation can be configured in the same + /// way that the compiler is configured on the command line. + /// + /// \param CIdx The index object with which the translation unit will be + /// associated. + /// + /// \param source_filename The name of the source file to load, or NULL if the + /// source file is included in \c command_line_args. + /// + /// \param command_line_args The command-line arguments that would be + /// passed to the \c clang executable if it were being invoked out-of-process. + /// These command-line options will be parsed and will affect how the translation + /// unit is parsed. Note that the following options are ignored: '-c', + /// '-emit-ast', '-fsyntax-only' (which is the default), and '-o \'. + /// + /// \param num_command_line_args The number of command-line arguments in + /// \c command_line_args. + /// + /// \param unsaved_files the files that have not yet been saved to disk + /// but may be required for parsing, 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 A bitmask of options that affects how the translation unit + /// is managed but not its compilation. This should be a bitwise OR of the + /// CXTranslationUnit_XXX flags. + /// + /// \param[out] out_TU A non-NULL pointer to store the created + /// \c CXTranslationUnit, describing the parsed code and containing any + /// diagnostics produced by the compiler. + /// + /// \returns Zero on success, otherwise returns an error code. + int clang_parseTranslationUnit2( + 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, + ) { + _clang_parseTranslationUnit2 ??= _dylib.lookupFunction< + _c_clang_parseTranslationUnit2, + _dart_clang_parseTranslationUnit2>('clang_parseTranslationUnit2'); + return _clang_parseTranslationUnit2( + CIdx, + source_filename, + command_line_args, + num_command_line_args, + unsaved_files, + num_unsaved_files, + options, + out_TU, + ); + } - @ffi.Uint32() - int end_int_data; -} + _dart_clang_parseTranslationUnit2 _clang_parseTranslationUnit2; + + /// Same as clang_parseTranslationUnit2 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_parseTranslationUnit2FullArgv( + 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, + ) { + _clang_parseTranslationUnit2FullArgv ??= _dylib.lookupFunction< + _c_clang_parseTranslationUnit2FullArgv, + _dart_clang_parseTranslationUnit2FullArgv>( + 'clang_parseTranslationUnit2FullArgv'); + return _clang_parseTranslationUnit2FullArgv( + CIdx, + source_filename, + command_line_args, + num_command_line_args, + unsaved_files, + num_unsaved_files, + options, + out_TU, + ); + } -/// 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.'); - } + _dart_clang_parseTranslationUnit2FullArgv + _clang_parseTranslationUnit2FullArgv; + + /// Returns the set of flags that is suitable for saving a translation + /// unit. + /// + /// The set of flags returned provide options for + /// \c clang_saveTranslationUnit() by default. The returned flag + /// set contains an unspecified set of options that save translation units with + /// the most commonly-requested data. + int clang_defaultSaveOptions( + ffi.Pointer TU, + ) { + _clang_defaultSaveOptions ??= _dylib.lookupFunction< + _c_clang_defaultSaveOptions, + _dart_clang_defaultSaveOptions>('clang_defaultSaveOptions'); + return _clang_defaultSaveOptions( + TU, + ); } - ffi.Pointer operator [](int index) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - return _struct._exp_workaround_ptr_data_item_0; - case 1: - return _struct._exp_workaround_ptr_data_item_1; - default: - throw Exception('Invalid Array Helper generated.'); - } + _dart_clang_defaultSaveOptions _clang_defaultSaveOptions; + + /// Saves a translation unit into a serialized representation of + /// that translation unit on disk. + /// + /// Any translation unit that was parsed without error can be saved + /// into a file. The translation unit can then be deserialized into a + /// new \c CXTranslationUnit with \c clang_createTranslationUnit() or, + /// if it is an incomplete translation unit that corresponds to a + /// header, used as a precompiled header when parsing other translation + /// units. + /// + /// \param TU The translation unit to save. + /// + /// \param FileName The file to which the translation unit will be saved. + /// + /// \param options A bitmask of options that affects how the translation unit + /// is saved. This should be a bitwise OR of the + /// CXSaveTranslationUnit_XXX flags. + /// + /// \returns A value that will match one of the enumerators of the CXSaveError + /// enumeration. Zero (CXSaveError_None) indicates that the translation unit was + /// saved successfully, while a non-zero value indicates that a problem occurred. + int clang_saveTranslationUnit( + ffi.Pointer TU, + ffi.Pointer FileName, + int options, + ) { + _clang_saveTranslationUnit ??= _dylib.lookupFunction< + _c_clang_saveTranslationUnit, + _dart_clang_saveTranslationUnit>('clang_saveTranslationUnit'); + return _clang_saveTranslationUnit( + TU, + FileName, + options, + ); } - void operator []=(int index, ffi.Pointer value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._exp_workaround_ptr_data_item_0 = value; - break; - case 1: - _struct._exp_workaround_ptr_data_item_1 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } + _dart_clang_saveTranslationUnit _clang_saveTranslationUnit; + + /// Suspend a translation unit in order to free memory associated with it. + /// + /// A suspended translation unit uses significantly less memory but on the other + /// side does not support any other calls than \c clang_reparseTranslationUnit + /// to resume it or \c clang_disposeTranslationUnit to dispose it completely. + int clang_suspendTranslationUnit( + ffi.Pointer arg0, + ) { + _clang_suspendTranslationUnit ??= _dylib.lookupFunction< + _c_clang_suspendTranslationUnit, + _dart_clang_suspendTranslationUnit>('clang_suspendTranslationUnit'); + return _clang_suspendTranslationUnit( + arg0, + ); } -} -/// Identifies an array of ranges. -class CXSourceRangeList extends ffi.Struct { - /// The number of ranges in the \c ranges array. - @ffi.Uint32() - int count; + _dart_clang_suspendTranslationUnit _clang_suspendTranslationUnit; - /// An array of \c CXSourceRanges. - ffi.Pointer ranges; -} + /// Destroy the specified CXTranslationUnit object. + void clang_disposeTranslationUnit( + ffi.Pointer arg0, + ) { + _clang_disposeTranslationUnit ??= _dylib.lookupFunction< + _c_clang_disposeTranslationUnit, + _dart_clang_disposeTranslationUnit>('clang_disposeTranslationUnit'); + return _clang_disposeTranslationUnit( + arg0, + ); + } -/// 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 { - ffi.Pointer data; + _dart_clang_disposeTranslationUnit _clang_disposeTranslationUnit; - @ffi.Uint32() - int private_flags; -} + /// Returns the set of flags that is suitable for reparsing a translation + /// unit. + /// + /// The set of flags returned provide options for + /// \c clang_reparseTranslationUnit() by default. The returned flag + /// set contains an unspecified set of optimizations geared toward common uses + /// of reparsing. The set of optimizations enabled may change from one version + /// to the next. + int clang_defaultReparseOptions( + ffi.Pointer TU, + ) { + _clang_defaultReparseOptions ??= _dylib.lookupFunction< + _c_clang_defaultReparseOptions, + _dart_clang_defaultReparseOptions>('clang_defaultReparseOptions'); + return _clang_defaultReparseOptions( + TU, + ); + } -class CXStringSet extends ffi.Struct { - ffi.Pointer Strings; + _dart_clang_defaultReparseOptions _clang_defaultReparseOptions; - @ffi.Uint32() - int Count; -} + /// Reparse the source files that produced this translation unit. + /// + /// This routine can be used to re-parse the source files that originally + /// created the given translation unit, for example because those source files + /// have changed (either on disk or as passed via \p unsaved_files). The + /// source code will be reparsed with the same command-line options as it + /// was originally parsed. + /// + /// Reparsing a translation unit invalidates all cursors and source locations + /// that refer into that translation unit. This makes reparsing a translation + /// unit semantically equivalent to destroying the translation unit and then + /// creating a new translation unit with the same command-line arguments. + /// However, it may be more efficient to reparse a translation + /// unit using this routine. + /// + /// \param TU The translation unit whose contents will be re-parsed. The + /// translation unit must originally have been built with + /// \c clang_createTranslationUnitFromSourceFile(). + /// + /// \param num_unsaved_files The number of unsaved file entries in \p + /// unsaved_files. + /// + /// \param unsaved_files The files that have not yet been saved to disk + /// but may be required for parsing, 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 options A bitset of options composed of the flags in CXReparse_Flags. + /// The function \c clang_defaultReparseOptions() produces a default set of + /// options recommended for most uses, based on the translation unit. + /// + /// \returns 0 if the sources could be reparsed. A non-zero error code will be + /// returned if reparsing was impossible, such that the translation unit is + /// invalid. In such cases, the only valid call for \c TU is + /// \c clang_disposeTranslationUnit(TU). The error codes returned by this + /// routine are described by the \c CXErrorCode enum. + int clang_reparseTranslationUnit( + ffi.Pointer TU, + int num_unsaved_files, + ffi.Pointer unsaved_files, + int options, + ) { + _clang_reparseTranslationUnit ??= _dylib.lookupFunction< + _c_clang_reparseTranslationUnit, + _dart_clang_reparseTranslationUnit>('clang_reparseTranslationUnit'); + return _clang_reparseTranslationUnit( + TU, + num_unsaved_files, + unsaved_files, + options, + ); + } -/// The memory usage of a CXTranslationUnit, broken into categories. -class CXTUResourceUsage extends ffi.Struct { - ffi.Pointer data; + _dart_clang_reparseTranslationUnit _clang_reparseTranslationUnit; - @ffi.Uint32() - int numEntries; + /// Returns the human-readable null-terminated C string that represents + /// the name of the memory category. This string should never be freed. + ffi.Pointer clang_getTUResourceUsageName( + int kind, + ) { + _clang_getTUResourceUsageName ??= _dylib.lookupFunction< + _c_clang_getTUResourceUsageName, + _dart_clang_getTUResourceUsageName>('clang_getTUResourceUsageName'); + return _clang_getTUResourceUsageName( + kind, + ); + } - ffi.Pointer entries; -} + _dart_clang_getTUResourceUsageName _clang_getTUResourceUsageName; -class CXTUResourceUsageEntry extends ffi.Struct { - @ffi.Int32() - int kind; - - @ffi.Uint64() - int amount; -} + /// Get target information for this translation unit. + /// + /// The CXTargetInfo object cannot outlive the CXTranslationUnit object. + ffi.Pointer clang_getTranslationUnitTargetInfo( + ffi.Pointer CTUnit, + ) { + _clang_getTranslationUnitTargetInfo ??= _dylib.lookupFunction< + _c_clang_getTranslationUnitTargetInfo, + _dart_clang_getTranslationUnitTargetInfo>( + 'clang_getTranslationUnitTargetInfo'); + return _clang_getTranslationUnitTargetInfo( + CTUnit, + ); + } -class CXTargetInfoImpl extends ffi.Struct {} + _dart_clang_getTranslationUnitTargetInfo _clang_getTranslationUnitTargetInfo; -/// Describes a single preprocessing token. -class CXToken extends ffi.Struct { - @ffi.Uint32() - int _exp_workaround_int_data_item_0; - @ffi.Uint32() - int _exp_workaround_int_data_item_1; - @ffi.Uint32() - int _exp_workaround_int_data_item_2; - @ffi.Uint32() - int _exp_workaround_int_data_item_3; + /// Destroy the CXTargetInfo object. + void clang_TargetInfo_dispose( + ffi.Pointer Info, + ) { + _clang_TargetInfo_dispose ??= _dylib.lookupFunction< + _c_clang_TargetInfo_dispose, + _dart_clang_TargetInfo_dispose>('clang_TargetInfo_dispose'); + return _clang_TargetInfo_dispose( + Info, + ); + } - /// Helper for array `int_data`. - ArrayHelper_CXToken_int_data_level0 get int_data => - ArrayHelper_CXToken_int_data_level0(this, [4], 0, 0); - ffi.Pointer ptr_data; -} + _dart_clang_TargetInfo_dispose _clang_TargetInfo_dispose; -/// 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.'); - } + /// Get the pointer width of the target in bits. + /// + /// Returns -1 in case of error. + int clang_TargetInfo_getPointerWidth( + ffi.Pointer Info, + ) { + _clang_TargetInfo_getPointerWidth ??= _dylib.lookupFunction< + _c_clang_TargetInfo_getPointerWidth, + _dart_clang_TargetInfo_getPointerWidth>( + 'clang_TargetInfo_getPointerWidth'); + return _clang_TargetInfo_getPointerWidth( + Info, + ); } - int operator [](int index) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - return _struct._exp_workaround_int_data_item_0; - case 1: - return _struct._exp_workaround_int_data_item_1; - case 2: - return _struct._exp_workaround_int_data_item_2; - case 3: - return _struct._exp_workaround_int_data_item_3; - default: - throw Exception('Invalid Array Helper generated.'); - } + _dart_clang_TargetInfo_getPointerWidth _clang_TargetInfo_getPointerWidth; + + /// Determine whether the given cursor kind represents a declaration. + int clang_isDeclaration( + int arg0, + ) { + _clang_isDeclaration ??= _dylib.lookupFunction<_c_clang_isDeclaration, + _dart_clang_isDeclaration>('clang_isDeclaration'); + return _clang_isDeclaration( + arg0, + ); } - void operator []=(int index, int value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._exp_workaround_int_data_item_0 = value; - break; - case 1: - _struct._exp_workaround_int_data_item_1 = value; - break; - case 2: - _struct._exp_workaround_int_data_item_2 = value; - break; - case 3: - _struct._exp_workaround_int_data_item_3 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } + _dart_clang_isDeclaration _clang_isDeclaration; + + /// Determine whether the given cursor kind represents a simple + /// reference. + /// + /// Note that other kinds of cursors (such as expressions) can also refer to + /// other cursors. Use clang_getCursorReferenced() to determine whether a + /// particular cursor refers to another entity. + int clang_isReference( + int arg0, + ) { + _clang_isReference ??= + _dylib.lookupFunction<_c_clang_isReference, _dart_clang_isReference>( + 'clang_isReference'); + return _clang_isReference( + arg0, + ); } -} -class CXTranslationUnitImpl extends ffi.Struct {} + _dart_clang_isReference _clang_isReference; + + /// Determine whether the given cursor kind represents an expression. + int clang_isExpression( + int arg0, + ) { + _clang_isExpression ??= + _dylib.lookupFunction<_c_clang_isExpression, _dart_clang_isExpression>( + 'clang_isExpression'); + return _clang_isExpression( + arg0, + ); + } -/// The type of an element in the abstract syntax tree. -class CXType extends ffi.Struct { - @ffi.Int32() - int kind; + _dart_clang_isExpression _clang_isExpression; + + /// Determine whether the given cursor kind represents a statement. + int clang_isStatement( + int arg0, + ) { + _clang_isStatement ??= + _dylib.lookupFunction<_c_clang_isStatement, _dart_clang_isStatement>( + 'clang_isStatement'); + return _clang_isStatement( + arg0, + ); + } - ffi.Pointer _exp_workaround_data_item_0; - ffi.Pointer _exp_workaround_data_item_1; + _dart_clang_isStatement _clang_isStatement; + + /// Determine whether the given cursor kind represents an attribute. + int clang_isAttribute( + int arg0, + ) { + _clang_isAttribute ??= + _dylib.lookupFunction<_c_clang_isAttribute, _dart_clang_isAttribute>( + 'clang_isAttribute'); + return _clang_isAttribute( + arg0, + ); + } - /// Helper for array `data`. - ArrayHelper_CXType_data_level0 get data => - ArrayHelper_CXType_data_level0(this, [2], 0, 0); -} + _dart_clang_isAttribute _clang_isAttribute; + + /// Determine whether the given cursor kind represents an invalid + /// cursor. + int clang_isInvalid( + int arg0, + ) { + _clang_isInvalid ??= + _dylib.lookupFunction<_c_clang_isInvalid, _dart_clang_isInvalid>( + 'clang_isInvalid'); + return _clang_isInvalid( + arg0, + ); + } -/// 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.'); - } + _dart_clang_isInvalid _clang_isInvalid; + + /// Determine whether the given cursor kind represents a translation + /// unit. + int clang_isTranslationUnit( + int arg0, + ) { + _clang_isTranslationUnit ??= _dylib.lookupFunction< + _c_clang_isTranslationUnit, + _dart_clang_isTranslationUnit>('clang_isTranslationUnit'); + return _clang_isTranslationUnit( + arg0, + ); } - ffi.Pointer operator [](int index) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - return _struct._exp_workaround_data_item_0; - case 1: - return _struct._exp_workaround_data_item_1; - default: - throw Exception('Invalid Array Helper generated.'); - } + _dart_clang_isTranslationUnit _clang_isTranslationUnit; + + /// Determine whether the given cursor represents a preprocessing + /// element, such as a preprocessor directive or macro instantiation. + int clang_isPreprocessing( + int arg0, + ) { + _clang_isPreprocessing ??= _dylib.lookupFunction<_c_clang_isPreprocessing, + _dart_clang_isPreprocessing>('clang_isPreprocessing'); + return _clang_isPreprocessing( + arg0, + ); } - void operator []=(int index, ffi.Pointer value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._exp_workaround_data_item_0 = value; - break; - case 1: - _struct._exp_workaround_data_item_1 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } + _dart_clang_isPreprocessing _clang_isPreprocessing; + + /// Determine whether the given cursor represents a currently + /// unexposed piece of the AST (e.g., CXCursor_UnexposedStmt). + int clang_isUnexposed( + int arg0, + ) { + _clang_isUnexposed ??= + _dylib.lookupFunction<_c_clang_isUnexposed, _dart_clang_isUnexposed>( + 'clang_isUnexposed'); + return _clang_isUnexposed( + arg0, + ); } -} -/// Describes the kind of type -class CXTypeKind { - /// Represents an invalid type (e.g., where no type is available). - static const int CXType_Invalid = 0; + _dart_clang_isUnexposed _clang_isUnexposed; - /// 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; + /// Free the memory associated with a \c CXPlatformAvailability structure. + void clang_disposeCXPlatformAvailability( + ffi.Pointer availability, + ) { + _clang_disposeCXPlatformAvailability ??= _dylib.lookupFunction< + _c_clang_disposeCXPlatformAvailability, + _dart_clang_disposeCXPlatformAvailability>( + 'clang_disposeCXPlatformAvailability'); + return _clang_disposeCXPlatformAvailability( + availability, + ); + } - /// 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_disposeCXPlatformAvailability + _clang_disposeCXPlatformAvailability; -/// 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. - ffi.Pointer Filename; + /// Creates an empty CXCursorSet. + ffi.Pointer clang_createCXCursorSet() { + _clang_createCXCursorSet ??= _dylib.lookupFunction< + _c_clang_createCXCursorSet, + _dart_clang_createCXCursorSet>('clang_createCXCursorSet'); + return _clang_createCXCursorSet(); + } - /// A buffer containing the unsaved contents of this file. - ffi.Pointer Contents; + _dart_clang_createCXCursorSet _clang_createCXCursorSet; - /// The length of the unsaved contents of this buffer. - @ffi.Uint64() - int Length; -} + /// Disposes a CXCursorSet and releases its associated memory. + void clang_disposeCXCursorSet( + ffi.Pointer cset, + ) { + _clang_disposeCXCursorSet ??= _dylib.lookupFunction< + _c_clang_disposeCXCursorSet, + _dart_clang_disposeCXCursorSet>('clang_disposeCXCursorSet'); + return _clang_disposeCXCursorSet( + cset, + ); + } -/// 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() - int Major; + _dart_clang_disposeCXCursorSet _clang_disposeCXCursorSet; - /// 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() - int Minor; + /// Free the set of overridden cursors returned by \c + /// clang_getOverriddenCursors(). + void clang_disposeOverriddenCursors( + ffi.Pointer overridden, + ) { + _clang_disposeOverriddenCursors ??= _dylib.lookupFunction< + _c_clang_disposeOverriddenCursors, + _dart_clang_disposeOverriddenCursors>('clang_disposeOverriddenCursors'); + return _clang_disposeOverriddenCursors( + overridden, + ); + } - /// 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() - int Subminor; -} + _dart_clang_disposeOverriddenCursors _clang_disposeOverriddenCursors; -/// A group of callbacks used by #clang_indexSourceFile and -/// #clang_indexTranslationUnit. -typedef _typedefC_3 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, -); + /// Get a property value for the given printing policy. + int clang_PrintingPolicy_getProperty( + ffi.Pointer Policy, + int Property, + ) { + _clang_PrintingPolicy_getProperty ??= _dylib.lookupFunction< + _c_clang_PrintingPolicy_getProperty, + _dart_clang_PrintingPolicy_getProperty>( + 'clang_PrintingPolicy_getProperty'); + return _clang_PrintingPolicy_getProperty( + Policy, + Property, + ); + } -typedef _typedefC_4 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); + _dart_clang_PrintingPolicy_getProperty _clang_PrintingPolicy_getProperty; -typedef _typedefC_5 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); + /// Set a property value for the given printing policy. + void clang_PrintingPolicy_setProperty( + ffi.Pointer Policy, + int Property, + int Value, + ) { + _clang_PrintingPolicy_setProperty ??= _dylib.lookupFunction< + _c_clang_PrintingPolicy_setProperty, + _dart_clang_PrintingPolicy_setProperty>( + 'clang_PrintingPolicy_setProperty'); + return _clang_PrintingPolicy_setProperty( + Policy, + Property, + Value, + ); + } -typedef _typedefC_6 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, -); + _dart_clang_PrintingPolicy_setProperty _clang_PrintingPolicy_setProperty; -typedef _typedefC_7 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, -); + /// Release a printing policy. + void clang_PrintingPolicy_dispose( + ffi.Pointer Policy, + ) { + _clang_PrintingPolicy_dispose ??= _dylib.lookupFunction< + _c_clang_PrintingPolicy_dispose, + _dart_clang_PrintingPolicy_dispose>('clang_PrintingPolicy_dispose'); + return _clang_PrintingPolicy_dispose( + Policy, + ); + } -typedef _typedefC_8 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, -); + _dart_clang_PrintingPolicy_dispose _clang_PrintingPolicy_dispose; + + /// Given a CXFile header file, return the module that contains it, if one + /// exists. + ffi.Pointer clang_getModuleForFile( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + _clang_getModuleForFile ??= _dylib.lookupFunction<_c_clang_getModuleForFile, + _dart_clang_getModuleForFile>('clang_getModuleForFile'); + return _clang_getModuleForFile( + arg0, + arg1, + ); + } -typedef _typedefC_9 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, -); + _dart_clang_getModuleForFile _clang_getModuleForFile; -typedef _typedefC_10 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, -); + /// \param Module a module object. + /// + /// \returns the module file where the provided module object came from. + ffi.Pointer clang_Module_getASTFile( + ffi.Pointer Module, + ) { + _clang_Module_getASTFile ??= _dylib.lookupFunction< + _c_clang_Module_getASTFile, + _dart_clang_Module_getASTFile>('clang_Module_getASTFile'); + return _clang_Module_getASTFile( + Module, + ); + } -class IndexerCallbacks extends ffi.Struct { - /// Called periodically to check whether indexing should be aborted. - /// Should return 0 to continue, and non-zero to abort. - ffi.Pointer> abortQuery; + _dart_clang_Module_getASTFile _clang_Module_getASTFile; - /// Called at the end of indexing; passes the complete diagnostic set. - ffi.Pointer> diagnostic; + /// \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, + ) { + _clang_Module_getParent ??= _dylib.lookupFunction<_c_clang_Module_getParent, + _dart_clang_Module_getParent>('clang_Module_getParent'); + return _clang_Module_getParent( + Module, + ); + } - ffi.Pointer> enteredMainFile; + _dart_clang_Module_getParent _clang_Module_getParent; - /// Called when a file gets \#included/\#imported. - ffi.Pointer> ppIncludedFile; + /// \param Module a module object. + /// + /// \returns non-zero if the module is a system one. + int clang_Module_isSystem( + ffi.Pointer Module, + ) { + _clang_Module_isSystem ??= _dylib.lookupFunction<_c_clang_Module_isSystem, + _dart_clang_Module_isSystem>('clang_Module_isSystem'); + return _clang_Module_isSystem( + Module, + ); + } - /// Called when a AST file (PCH or module) gets imported. + _dart_clang_Module_isSystem _clang_Module_isSystem; + + /// \param Module a module object. /// - /// 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. - ffi.Pointer> importedASTFile; + /// \returns the number of top level headers associated with this module. + int clang_Module_getNumTopLevelHeaders( + ffi.Pointer arg0, + ffi.Pointer Module, + ) { + _clang_Module_getNumTopLevelHeaders ??= _dylib.lookupFunction< + _c_clang_Module_getNumTopLevelHeaders, + _dart_clang_Module_getNumTopLevelHeaders>( + 'clang_Module_getNumTopLevelHeaders'); + return _clang_Module_getNumTopLevelHeaders( + arg0, + Module, + ); + } - /// Called at the beginning of indexing a translation unit. - ffi.Pointer> startedTranslationUnit; + _dart_clang_Module_getNumTopLevelHeaders _clang_Module_getNumTopLevelHeaders; - ffi.Pointer> indexDeclaration; + /// \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, + ) { + _clang_Module_getTopLevelHeader ??= _dylib.lookupFunction< + _c_clang_Module_getTopLevelHeader, + _dart_clang_Module_getTopLevelHeader>('clang_Module_getTopLevelHeader'); + return _clang_Module_getTopLevelHeader( + arg0, + Module, + Index, + ); + } - /// Called to index a reference of an entity. - ffi.Pointer> indexEntityReference; -} + _dart_clang_Module_getTopLevelHeader _clang_Module_getTopLevelHeader; -/// Gets the general options associated with a CXIndex. -/// -/// \returns A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags that -/// are associated with the given CXIndex object. -int clang_CXIndex_getGlobalOptions( - ffi.Pointer arg0, -) { - return _clang_CXIndex_getGlobalOptions( - arg0, - ); -} + /// 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, + ) { + _clang_annotateTokens ??= _dylib.lookupFunction<_c_clang_annotateTokens, + _dart_clang_annotateTokens>('clang_annotateTokens'); + return _clang_annotateTokens( + TU, + Tokens, + NumTokens, + Cursors, + ); + } -final _dart_clang_CXIndex_getGlobalOptions _clang_CXIndex_getGlobalOptions = - _dylib.lookupFunction<_c_clang_CXIndex_getGlobalOptions, - _dart_clang_CXIndex_getGlobalOptions>('clang_CXIndex_getGlobalOptions'); + _dart_clang_annotateTokens _clang_annotateTokens; + + /// Free the given set of tokens. + void clang_disposeTokens( + ffi.Pointer TU, + ffi.Pointer Tokens, + int NumTokens, + ) { + _clang_disposeTokens ??= _dylib.lookupFunction<_c_clang_disposeTokens, + _dart_clang_disposeTokens>('clang_disposeTokens'); + return _clang_disposeTokens( + TU, + Tokens, + NumTokens, + ); + } -typedef _c_clang_CXIndex_getGlobalOptions = ffi.Uint32 Function( - ffi.Pointer arg0, -); + _dart_clang_disposeTokens _clang_disposeTokens; -typedef _dart_clang_CXIndex_getGlobalOptions = int Function( - ffi.Pointer arg0, -); + void clang_enableStackTraces() { + _clang_enableStackTraces ??= _dylib.lookupFunction< + _c_clang_enableStackTraces, + _dart_clang_enableStackTraces>('clang_enableStackTraces'); + return _clang_enableStackTraces(); + } -/// Sets general options associated with a CXIndex. -/// -/// For example: -/// \code -/// CXIndex idx = ...; -/// clang_CXIndex_setGlobalOptions(idx, -/// clang_CXIndex_getGlobalOptions(idx) | -/// CXGlobalOpt_ThreadBackgroundPriorityForIndexing); -/// \endcode -/// -/// \param options A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags. -void clang_CXIndex_setGlobalOptions( - ffi.Pointer arg0, - int options, -) { - return _clang_CXIndex_setGlobalOptions( - arg0, - options, - ); -} + _dart_clang_enableStackTraces _clang_enableStackTraces; + + void clang_executeOnThread( + ffi.Pointer> fn, + ffi.Pointer user_data, + int stack_size, + ) { + _clang_executeOnThread ??= _dylib.lookupFunction<_c_clang_executeOnThread, + _dart_clang_executeOnThread>('clang_executeOnThread'); + return _clang_executeOnThread( + fn, + user_data, + stack_size, + ); + } -final _dart_clang_CXIndex_setGlobalOptions _clang_CXIndex_setGlobalOptions = - _dylib.lookupFunction<_c_clang_CXIndex_setGlobalOptions, - _dart_clang_CXIndex_setGlobalOptions>('clang_CXIndex_setGlobalOptions'); + _dart_clang_executeOnThread _clang_executeOnThread; -typedef _c_clang_CXIndex_setGlobalOptions = ffi.Void Function( - ffi.Pointer arg0, - ffi.Uint32 options, -); + /// 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, + ) { + _clang_getCompletionChunkKind ??= _dylib.lookupFunction< + _c_clang_getCompletionChunkKind, + _dart_clang_getCompletionChunkKind>('clang_getCompletionChunkKind'); + return _clang_getCompletionChunkKind( + completion_string, + chunk_number, + ); + } -typedef _dart_clang_CXIndex_setGlobalOptions = void Function( - ffi.Pointer arg0, - int options, -); + _dart_clang_getCompletionChunkKind _clang_getCompletionChunkKind; -/// Sets the invocation emission path option in a CXIndex. -/// -/// The invocation emission path specifies a path which will contain log -/// files for certain libclang invocations. A null value (default) implies that -/// libclang invocations are not logged.. -void clang_CXIndex_setInvocationEmissionPathOption( - ffi.Pointer arg0, - ffi.Pointer Path, -) { - return _clang_CXIndex_setInvocationEmissionPathOption( - arg0, - Path, - ); -} + /// 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, + ) { + _clang_getCompletionChunkCompletionString ??= _dylib.lookupFunction< + _c_clang_getCompletionChunkCompletionString, + _dart_clang_getCompletionChunkCompletionString>( + 'clang_getCompletionChunkCompletionString'); + return _clang_getCompletionChunkCompletionString( + completion_string, + chunk_number, + ); + } -final _dart_clang_CXIndex_setInvocationEmissionPathOption - _clang_CXIndex_setInvocationEmissionPathOption = _dylib.lookupFunction< - _c_clang_CXIndex_setInvocationEmissionPathOption, - _dart_clang_CXIndex_setInvocationEmissionPathOption>( - 'clang_CXIndex_setInvocationEmissionPathOption'); + _dart_clang_getCompletionChunkCompletionString + _clang_getCompletionChunkCompletionString; -typedef _c_clang_CXIndex_setInvocationEmissionPathOption = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer Path, -); + /// Retrieve the number of chunks in the given code-completion string. + int clang_getNumCompletionChunks( + ffi.Pointer completion_string, + ) { + _clang_getNumCompletionChunks ??= _dylib.lookupFunction< + _c_clang_getNumCompletionChunks, + _dart_clang_getNumCompletionChunks>('clang_getNumCompletionChunks'); + return _clang_getNumCompletionChunks( + completion_string, + ); + } -typedef _dart_clang_CXIndex_setInvocationEmissionPathOption = void Function( - ffi.Pointer arg0, - ffi.Pointer Path, -); + _dart_clang_getNumCompletionChunks _clang_getNumCompletionChunks; -ffi.Pointer clang_Cursor_getArgument_wrap( - ffi.Pointer cursor, - int i, -) { - return _clang_Cursor_getArgument_wrap( - cursor, - i, - ); -} + /// 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, + ) { + _clang_getCompletionPriority ??= _dylib.lookupFunction< + _c_clang_getCompletionPriority, + _dart_clang_getCompletionPriority>('clang_getCompletionPriority'); + return _clang_getCompletionPriority( + completion_string, + ); + } -final _dart_clang_Cursor_getArgument_wrap _clang_Cursor_getArgument_wrap = - _dylib.lookupFunction<_c_clang_Cursor_getArgument_wrap, - _dart_clang_Cursor_getArgument_wrap>('clang_Cursor_getArgument_wrap'); + _dart_clang_getCompletionPriority _clang_getCompletionPriority; -typedef _c_clang_Cursor_getArgument_wrap = ffi.Pointer Function( - ffi.Pointer cursor, - ffi.Uint32 i, -); + /// 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, + ) { + _clang_getCompletionAvailability ??= _dylib.lookupFunction< + _c_clang_getCompletionAvailability, + _dart_clang_getCompletionAvailability>( + 'clang_getCompletionAvailability'); + return _clang_getCompletionAvailability( + completion_string, + ); + } -typedef _dart_clang_Cursor_getArgument_wrap = ffi.Pointer Function( - ffi.Pointer cursor, - int i, -); + _dart_clang_getCompletionAvailability _clang_getCompletionAvailability; -/// Returns the first paragraph of doxygen doc comment. -ffi.Pointer clang_Cursor_getBriefCommentText_wrap( - ffi.Pointer cursor, -) { - return _clang_Cursor_getBriefCommentText_wrap( - cursor, - ); -} + /// 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, + ) { + _clang_getCompletionNumAnnotations ??= _dylib.lookupFunction< + _c_clang_getCompletionNumAnnotations, + _dart_clang_getCompletionNumAnnotations>( + 'clang_getCompletionNumAnnotations'); + return _clang_getCompletionNumAnnotations( + completion_string, + ); + } -final _dart_clang_Cursor_getBriefCommentText_wrap - _clang_Cursor_getBriefCommentText_wrap = _dylib.lookupFunction< - _c_clang_Cursor_getBriefCommentText_wrap, - _dart_clang_Cursor_getBriefCommentText_wrap>( - 'clang_Cursor_getBriefCommentText_wrap'); + _dart_clang_getCompletionNumAnnotations _clang_getCompletionNumAnnotations; -typedef _c_clang_Cursor_getBriefCommentText_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, -); + /// 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, + ) { + _clang_getCompletionNumFixIts ??= _dylib.lookupFunction< + _c_clang_getCompletionNumFixIts, + _dart_clang_getCompletionNumFixIts>('clang_getCompletionNumFixIts'); + return _clang_getCompletionNumFixIts( + results, + completion_index, + ); + } -typedef _dart_clang_Cursor_getBriefCommentText_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, -); + _dart_clang_getCompletionNumFixIts _clang_getCompletionNumFixIts; -/// Returns the comment range. -ffi.Pointer clang_Cursor_getCommentRange_wrap( - ffi.Pointer cursor, -) { - return _clang_Cursor_getCommentRange_wrap( - cursor, - ); -} + /// Returns a default set of code-completion options that can be + /// passed to\c clang_codeCompleteAt(). + int clang_defaultCodeCompleteOptions() { + _clang_defaultCodeCompleteOptions ??= _dylib.lookupFunction< + _c_clang_defaultCodeCompleteOptions, + _dart_clang_defaultCodeCompleteOptions>( + 'clang_defaultCodeCompleteOptions'); + return _clang_defaultCodeCompleteOptions(); + } -final _dart_clang_Cursor_getCommentRange_wrap - _clang_Cursor_getCommentRange_wrap = _dylib.lookupFunction< - _c_clang_Cursor_getCommentRange_wrap, - _dart_clang_Cursor_getCommentRange_wrap>( - 'clang_Cursor_getCommentRange_wrap'); + _dart_clang_defaultCodeCompleteOptions _clang_defaultCodeCompleteOptions; -typedef _c_clang_Cursor_getCommentRange_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, -); + /// 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, + ) { + _clang_codeCompleteAt ??= _dylib.lookupFunction<_c_clang_codeCompleteAt, + _dart_clang_codeCompleteAt>('clang_codeCompleteAt'); + return _clang_codeCompleteAt( + TU, + complete_filename, + complete_line, + complete_column, + unsaved_files, + num_unsaved_files, + options, + ); + } -typedef _dart_clang_Cursor_getCommentRange_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, -); + _dart_clang_codeCompleteAt _clang_codeCompleteAt; -int clang_Cursor_getNumArguments_wrap( - ffi.Pointer cursor, -) { - return _clang_Cursor_getNumArguments_wrap( - cursor, - ); -} + /// 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, + ) { + _clang_sortCodeCompletionResults ??= _dylib.lookupFunction< + _c_clang_sortCodeCompletionResults, + _dart_clang_sortCodeCompletionResults>( + 'clang_sortCodeCompletionResults'); + return _clang_sortCodeCompletionResults( + Results, + NumResults, + ); + } -final _dart_clang_Cursor_getNumArguments_wrap - _clang_Cursor_getNumArguments_wrap = _dylib.lookupFunction< - _c_clang_Cursor_getNumArguments_wrap, - _dart_clang_Cursor_getNumArguments_wrap>( - 'clang_Cursor_getNumArguments_wrap'); + _dart_clang_sortCodeCompletionResults _clang_sortCodeCompletionResults; -typedef _c_clang_Cursor_getNumArguments_wrap = ffi.Int32 Function( - ffi.Pointer cursor, -); + /// Free the given set of code-completion results. + void clang_disposeCodeCompleteResults( + ffi.Pointer Results, + ) { + _clang_disposeCodeCompleteResults ??= _dylib.lookupFunction< + _c_clang_disposeCodeCompleteResults, + _dart_clang_disposeCodeCompleteResults>( + 'clang_disposeCodeCompleteResults'); + return _clang_disposeCodeCompleteResults( + Results, + ); + } -typedef _dart_clang_Cursor_getNumArguments_wrap = int Function( - ffi.Pointer cursor, -); + _dart_clang_disposeCodeCompleteResults _clang_disposeCodeCompleteResults; -/// Returns the raw comment. -ffi.Pointer clang_Cursor_getRawCommentText_wrap( - ffi.Pointer cursor, -) { - return _clang_Cursor_getRawCommentText_wrap( - cursor, - ); -} + /// Determine the number of diagnostics produced prior to the + /// location where code completion was performed. + int clang_codeCompleteGetNumDiagnostics( + ffi.Pointer Results, + ) { + _clang_codeCompleteGetNumDiagnostics ??= _dylib.lookupFunction< + _c_clang_codeCompleteGetNumDiagnostics, + _dart_clang_codeCompleteGetNumDiagnostics>( + 'clang_codeCompleteGetNumDiagnostics'); + return _clang_codeCompleteGetNumDiagnostics( + Results, + ); + } -final _dart_clang_Cursor_getRawCommentText_wrap - _clang_Cursor_getRawCommentText_wrap = _dylib.lookupFunction< - _c_clang_Cursor_getRawCommentText_wrap, - _dart_clang_Cursor_getRawCommentText_wrap>( - 'clang_Cursor_getRawCommentText_wrap'); + _dart_clang_codeCompleteGetNumDiagnostics + _clang_codeCompleteGetNumDiagnostics; -typedef _c_clang_Cursor_getRawCommentText_wrap = ffi.Pointer Function( - ffi.Pointer cursor, -); + /// 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, + ) { + _clang_codeCompleteGetDiagnostic ??= _dylib.lookupFunction< + _c_clang_codeCompleteGetDiagnostic, + _dart_clang_codeCompleteGetDiagnostic>( + 'clang_codeCompleteGetDiagnostic'); + return _clang_codeCompleteGetDiagnostic( + Results, + Index, + ); + } -typedef _dart_clang_Cursor_getRawCommentText_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, -); + _dart_clang_codeCompleteGetDiagnostic _clang_codeCompleteGetDiagnostic; -/// Disposes the created Eval memory. -void clang_EvalResult_dispose( - ffi.Pointer E, -) { - return _clang_EvalResult_dispose( - E, - ); -} + /// 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, + ) { + _clang_codeCompleteGetContexts ??= _dylib.lookupFunction< + _c_clang_codeCompleteGetContexts, + _dart_clang_codeCompleteGetContexts>('clang_codeCompleteGetContexts'); + return _clang_codeCompleteGetContexts( + Results, + ); + } -final _dart_clang_EvalResult_dispose _clang_EvalResult_dispose = - _dylib.lookupFunction<_c_clang_EvalResult_dispose, - _dart_clang_EvalResult_dispose>('clang_EvalResult_dispose'); + _dart_clang_codeCompleteGetContexts _clang_codeCompleteGetContexts; -typedef _c_clang_EvalResult_dispose = ffi.Void Function( - ffi.Pointer E, -); + /// 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, + ) { + _clang_codeCompleteGetContainerKind ??= _dylib.lookupFunction< + _c_clang_codeCompleteGetContainerKind, + _dart_clang_codeCompleteGetContainerKind>( + 'clang_codeCompleteGetContainerKind'); + return _clang_codeCompleteGetContainerKind( + Results, + IsIncomplete, + ); + } -typedef _dart_clang_EvalResult_dispose = void Function( - ffi.Pointer E, -); + _dart_clang_codeCompleteGetContainerKind _clang_codeCompleteGetContainerKind; -/// Returns the evaluation result as double if the -/// kind is double. -double clang_EvalResult_getAsDouble( - ffi.Pointer E, -) { - return _clang_EvalResult_getAsDouble( - E, - ); -} + /// 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, + ) { + _clang_toggleCrashRecovery ??= _dylib.lookupFunction< + _c_clang_toggleCrashRecovery, + _dart_clang_toggleCrashRecovery>('clang_toggleCrashRecovery'); + return _clang_toggleCrashRecovery( + isEnabled, + ); + } -final _dart_clang_EvalResult_getAsDouble _clang_EvalResult_getAsDouble = - _dylib.lookupFunction<_c_clang_EvalResult_getAsDouble, - _dart_clang_EvalResult_getAsDouble>('clang_EvalResult_getAsDouble'); + _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, + ) { + _clang_getInclusions ??= _dylib.lookupFunction<_c_clang_getInclusions, + _dart_clang_getInclusions>('clang_getInclusions'); + return _clang_getInclusions( + tu, + visitor, + client_data, + ); + } -typedef _c_clang_EvalResult_getAsDouble = ffi.Double Function( - ffi.Pointer E, -); + _dart_clang_getInclusions _clang_getInclusions; -typedef _dart_clang_EvalResult_getAsDouble = double Function( - ffi.Pointer E, -); + /// Returns the kind of the evaluated result. + int clang_EvalResult_getKind( + ffi.Pointer E, + ) { + _clang_EvalResult_getKind ??= _dylib.lookupFunction< + _c_clang_EvalResult_getKind, + _dart_clang_EvalResult_getKind>('clang_EvalResult_getKind'); + return _clang_EvalResult_getKind( + E, + ); + } -/// Returns the evaluation result as integer if the -/// kind is Int. -int clang_EvalResult_getAsInt( - ffi.Pointer E, -) { - return _clang_EvalResult_getAsInt( - E, - ); -} + _dart_clang_EvalResult_getKind _clang_EvalResult_getKind; -final _dart_clang_EvalResult_getAsInt _clang_EvalResult_getAsInt = - _dylib.lookupFunction<_c_clang_EvalResult_getAsInt, + /// Returns the evaluation result as integer if the + /// kind is Int. + int clang_EvalResult_getAsInt( + ffi.Pointer E, + ) { + _clang_EvalResult_getAsInt ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsInt, _dart_clang_EvalResult_getAsInt>('clang_EvalResult_getAsInt'); + return _clang_EvalResult_getAsInt( + E, + ); + } -typedef _c_clang_EvalResult_getAsInt = ffi.Int32 Function( - ffi.Pointer E, -); + _dart_clang_EvalResult_getAsInt _clang_EvalResult_getAsInt; -typedef _dart_clang_EvalResult_getAsInt = int Function( - ffi.Pointer E, -); + /// 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, + ) { + _clang_EvalResult_getAsLongLong ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsLongLong, + _dart_clang_EvalResult_getAsLongLong>('clang_EvalResult_getAsLongLong'); + return _clang_EvalResult_getAsLongLong( + E, + ); + } -/// 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( - E, - ); -} + _dart_clang_EvalResult_getAsLongLong _clang_EvalResult_getAsLongLong; -final _dart_clang_EvalResult_getAsLongLong _clang_EvalResult_getAsLongLong = - _dylib.lookupFunction<_c_clang_EvalResult_getAsLongLong, - _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, + ) { + _clang_EvalResult_isUnsignedInt ??= _dylib.lookupFunction< + _c_clang_EvalResult_isUnsignedInt, + _dart_clang_EvalResult_isUnsignedInt>('clang_EvalResult_isUnsignedInt'); + return _clang_EvalResult_isUnsignedInt( + E, + ); + } -typedef _c_clang_EvalResult_getAsLongLong = ffi.Int64 Function( - ffi.Pointer E, -); + _dart_clang_EvalResult_isUnsignedInt _clang_EvalResult_isUnsignedInt; -typedef _dart_clang_EvalResult_getAsLongLong = int Function( - ffi.Pointer E, -); + /// 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, + ) { + _clang_EvalResult_getAsUnsigned ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsUnsigned, + _dart_clang_EvalResult_getAsUnsigned>('clang_EvalResult_getAsUnsigned'); + return _clang_EvalResult_getAsUnsigned( + E, + ); + } -/// 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( - 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, + ) { + _clang_EvalResult_getAsDouble ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsDouble, + _dart_clang_EvalResult_getAsDouble>('clang_EvalResult_getAsDouble'); + return _clang_EvalResult_getAsDouble( + E, + ); + } -final _dart_clang_EvalResult_getAsStr _clang_EvalResult_getAsStr = - _dylib.lookupFunction<_c_clang_EvalResult_getAsStr, + _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, + ) { + _clang_EvalResult_getAsStr ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsStr, _dart_clang_EvalResult_getAsStr>('clang_EvalResult_getAsStr'); + return _clang_EvalResult_getAsStr( + E, + ); + } -typedef _c_clang_EvalResult_getAsStr = ffi.Pointer Function( - ffi.Pointer E, -); + _dart_clang_EvalResult_getAsStr _clang_EvalResult_getAsStr; -typedef _dart_clang_EvalResult_getAsStr = ffi.Pointer Function( - ffi.Pointer E, -); + /// Disposes the created Eval memory. + void clang_EvalResult_dispose( + ffi.Pointer E, + ) { + _clang_EvalResult_dispose ??= _dylib.lookupFunction< + _c_clang_EvalResult_dispose, + _dart_clang_EvalResult_dispose>('clang_EvalResult_dispose'); + return _clang_EvalResult_dispose( + E, + ); + } -/// 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( - E, - ); -} + _dart_clang_EvalResult_dispose _clang_EvalResult_dispose; -final _dart_clang_EvalResult_getAsUnsigned _clang_EvalResult_getAsUnsigned = - _dylib.lookupFunction<_c_clang_EvalResult_getAsUnsigned, - _dart_clang_EvalResult_getAsUnsigned>('clang_EvalResult_getAsUnsigned'); + /// 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, + ) { + _clang_getRemappings ??= _dylib.lookupFunction<_c_clang_getRemappings, + _dart_clang_getRemappings>('clang_getRemappings'); + return _clang_getRemappings( + path, + ); + } -typedef _c_clang_EvalResult_getAsUnsigned = ffi.Uint64 Function( - ffi.Pointer E, -); + _dart_clang_getRemappings _clang_getRemappings; -typedef _dart_clang_EvalResult_getAsUnsigned = int Function( - ffi.Pointer E, -); + /// 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, + ) { + _clang_getRemappingsFromFileList ??= _dylib.lookupFunction< + _c_clang_getRemappingsFromFileList, + _dart_clang_getRemappingsFromFileList>( + 'clang_getRemappingsFromFileList'); + return _clang_getRemappingsFromFileList( + filePaths, + numFiles, + ); + } -/// Returns the kind of the evaluated result. -int clang_EvalResult_getKind( - ffi.Pointer E, -) { - return _clang_EvalResult_getKind( - E, - ); -} + _dart_clang_getRemappingsFromFileList _clang_getRemappingsFromFileList; + + /// Determine the number of remappings. + int clang_remap_getNumFiles( + ffi.Pointer arg0, + ) { + _clang_remap_getNumFiles ??= _dylib.lookupFunction< + _c_clang_remap_getNumFiles, + _dart_clang_remap_getNumFiles>('clang_remap_getNumFiles'); + return _clang_remap_getNumFiles( + arg0, + ); + } -final _dart_clang_EvalResult_getKind _clang_EvalResult_getKind = - _dylib.lookupFunction<_c_clang_EvalResult_getKind, - _dart_clang_EvalResult_getKind>('clang_EvalResult_getKind'); + _dart_clang_remap_getNumFiles _clang_remap_getNumFiles; -typedef _c_clang_EvalResult_getKind = ffi.Int32 Function( - ffi.Pointer E, -); + /// 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, + ) { + _clang_remap_getFilenames ??= _dylib.lookupFunction< + _c_clang_remap_getFilenames, + _dart_clang_remap_getFilenames>('clang_remap_getFilenames'); + return _clang_remap_getFilenames( + arg0, + index, + original, + transformed, + ); + } -typedef _dart_clang_EvalResult_getKind = int Function( - ffi.Pointer E, -); + _dart_clang_remap_getFilenames _clang_remap_getFilenames; + + /// Dispose the remapping. + void clang_remap_dispose( + ffi.Pointer arg0, + ) { + _clang_remap_dispose ??= _dylib.lookupFunction<_c_clang_remap_dispose, + _dart_clang_remap_dispose>('clang_remap_dispose'); + return _clang_remap_dispose( + arg0, + ); + } -/// 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( - E, - ); -} + _dart_clang_remap_dispose _clang_remap_dispose; -final _dart_clang_EvalResult_isUnsignedInt _clang_EvalResult_isUnsignedInt = - _dylib.lookupFunction<_c_clang_EvalResult_isUnsignedInt, - _dart_clang_EvalResult_isUnsignedInt>('clang_EvalResult_isUnsignedInt'); + int clang_index_isEntityObjCContainerKind( + int arg0, + ) { + _clang_index_isEntityObjCContainerKind ??= _dylib.lookupFunction< + _c_clang_index_isEntityObjCContainerKind, + _dart_clang_index_isEntityObjCContainerKind>( + 'clang_index_isEntityObjCContainerKind'); + return _clang_index_isEntityObjCContainerKind( + arg0, + ); + } -typedef _c_clang_EvalResult_isUnsignedInt = ffi.Uint32 Function( - ffi.Pointer E, -); + _dart_clang_index_isEntityObjCContainerKind + _clang_index_isEntityObjCContainerKind; -typedef _dart_clang_EvalResult_isUnsignedInt = int Function( - ffi.Pointer E, -); + ffi.Pointer clang_index_getObjCContainerDeclInfo( + ffi.Pointer arg0, + ) { + _clang_index_getObjCContainerDeclInfo ??= _dylib.lookupFunction< + _c_clang_index_getObjCContainerDeclInfo, + _dart_clang_index_getObjCContainerDeclInfo>( + 'clang_index_getObjCContainerDeclInfo'); + return _clang_index_getObjCContainerDeclInfo( + arg0, + ); + } -/// Returns non-zero if the \c file1 and \c file2 point to the same file, -/// or they are both NULL. -int clang_File_isEqual( - ffi.Pointer file1, - ffi.Pointer file2, -) { - return _clang_File_isEqual( - file1, - file2, - ); -} + _dart_clang_index_getObjCContainerDeclInfo + _clang_index_getObjCContainerDeclInfo; -final _dart_clang_File_isEqual _clang_File_isEqual = - _dylib.lookupFunction<_c_clang_File_isEqual, _dart_clang_File_isEqual>( - 'clang_File_isEqual'); + ffi.Pointer clang_index_getObjCInterfaceDeclInfo( + ffi.Pointer arg0, + ) { + _clang_index_getObjCInterfaceDeclInfo ??= _dylib.lookupFunction< + _c_clang_index_getObjCInterfaceDeclInfo, + _dart_clang_index_getObjCInterfaceDeclInfo>( + 'clang_index_getObjCInterfaceDeclInfo'); + return _clang_index_getObjCInterfaceDeclInfo( + arg0, + ); + } -typedef _c_clang_File_isEqual = ffi.Int32 Function( - ffi.Pointer file1, - ffi.Pointer file2, -); + _dart_clang_index_getObjCInterfaceDeclInfo + _clang_index_getObjCInterfaceDeclInfo; -typedef _dart_clang_File_isEqual = int Function( - ffi.Pointer file1, - ffi.Pointer file2, -); + ffi.Pointer clang_index_getObjCCategoryDeclInfo( + ffi.Pointer arg0, + ) { + _clang_index_getObjCCategoryDeclInfo ??= _dylib.lookupFunction< + _c_clang_index_getObjCCategoryDeclInfo, + _dart_clang_index_getObjCCategoryDeclInfo>( + 'clang_index_getObjCCategoryDeclInfo'); + return _clang_index_getObjCCategoryDeclInfo( + arg0, + ); + } -/// 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( - CIdx, - ); -} + _dart_clang_index_getObjCCategoryDeclInfo + _clang_index_getObjCCategoryDeclInfo; -final _dart_clang_IndexAction_create _clang_IndexAction_create = - _dylib.lookupFunction<_c_clang_IndexAction_create, - _dart_clang_IndexAction_create>('clang_IndexAction_create'); + ffi.Pointer + clang_index_getObjCProtocolRefListInfo( + ffi.Pointer arg0, + ) { + _clang_index_getObjCProtocolRefListInfo ??= _dylib.lookupFunction< + _c_clang_index_getObjCProtocolRefListInfo, + _dart_clang_index_getObjCProtocolRefListInfo>( + 'clang_index_getObjCProtocolRefListInfo'); + return _clang_index_getObjCProtocolRefListInfo( + arg0, + ); + } -typedef _c_clang_IndexAction_create = ffi.Pointer Function( - ffi.Pointer CIdx, -); + _dart_clang_index_getObjCProtocolRefListInfo + _clang_index_getObjCProtocolRefListInfo; -typedef _dart_clang_IndexAction_create = ffi.Pointer Function( - ffi.Pointer CIdx, -); + ffi.Pointer clang_index_getObjCPropertyDeclInfo( + ffi.Pointer arg0, + ) { + _clang_index_getObjCPropertyDeclInfo ??= _dylib.lookupFunction< + _c_clang_index_getObjCPropertyDeclInfo, + _dart_clang_index_getObjCPropertyDeclInfo>( + 'clang_index_getObjCPropertyDeclInfo'); + return _clang_index_getObjCPropertyDeclInfo( + arg0, + ); + } -/// 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( - arg0, - ); -} + _dart_clang_index_getObjCPropertyDeclInfo + _clang_index_getObjCPropertyDeclInfo; -final _dart_clang_IndexAction_dispose _clang_IndexAction_dispose = - _dylib.lookupFunction<_c_clang_IndexAction_dispose, - _dart_clang_IndexAction_dispose>('clang_IndexAction_dispose'); + ffi.Pointer + clang_index_getIBOutletCollectionAttrInfo( + ffi.Pointer arg0, + ) { + _clang_index_getIBOutletCollectionAttrInfo ??= _dylib.lookupFunction< + _c_clang_index_getIBOutletCollectionAttrInfo, + _dart_clang_index_getIBOutletCollectionAttrInfo>( + 'clang_index_getIBOutletCollectionAttrInfo'); + return _clang_index_getIBOutletCollectionAttrInfo( + arg0, + ); + } -typedef _c_clang_IndexAction_dispose = ffi.Void Function( - ffi.Pointer arg0, -); + _dart_clang_index_getIBOutletCollectionAttrInfo + _clang_index_getIBOutletCollectionAttrInfo; -typedef _dart_clang_IndexAction_dispose = void Function( - ffi.Pointer arg0, -); + ffi.Pointer clang_index_getCXXClassDeclInfo( + ffi.Pointer arg0, + ) { + _clang_index_getCXXClassDeclInfo ??= _dylib.lookupFunction< + _c_clang_index_getCXXClassDeclInfo, + _dart_clang_index_getCXXClassDeclInfo>( + 'clang_index_getCXXClassDeclInfo'); + return _clang_index_getCXXClassDeclInfo( + arg0, + ); + } -/// \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( - Module, - ); -} + _dart_clang_index_getCXXClassDeclInfo _clang_index_getCXXClassDeclInfo; -final _dart_clang_Module_getASTFile _clang_Module_getASTFile = _dylib - .lookupFunction<_c_clang_Module_getASTFile, _dart_clang_Module_getASTFile>( - 'clang_Module_getASTFile'); + /// For retrieving a custom CXIdxClientContainer attached to a + /// container. + ffi.Pointer clang_index_getClientContainer( + ffi.Pointer arg0, + ) { + _clang_index_getClientContainer ??= _dylib.lookupFunction< + _c_clang_index_getClientContainer, + _dart_clang_index_getClientContainer>('clang_index_getClientContainer'); + return _clang_index_getClientContainer( + arg0, + ); + } -typedef _c_clang_Module_getASTFile = ffi.Pointer Function( - ffi.Pointer Module, -); + _dart_clang_index_getClientContainer _clang_index_getClientContainer; -typedef _dart_clang_Module_getASTFile = ffi.Pointer Function( - ffi.Pointer Module, -); + /// For setting a custom CXIdxClientContainer attached to a + /// container. + void clang_index_setClientContainer( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + _clang_index_setClientContainer ??= _dylib.lookupFunction< + _c_clang_index_setClientContainer, + _dart_clang_index_setClientContainer>('clang_index_setClientContainer'); + return _clang_index_setClientContainer( + arg0, + arg1, + ); + } -/// \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( - arg0, - Module, - ); -} + _dart_clang_index_setClientContainer _clang_index_setClientContainer; -final _dart_clang_Module_getNumTopLevelHeaders - _clang_Module_getNumTopLevelHeaders = _dylib.lookupFunction< - _c_clang_Module_getNumTopLevelHeaders, - _dart_clang_Module_getNumTopLevelHeaders>( - 'clang_Module_getNumTopLevelHeaders'); + /// For retrieving a custom CXIdxClientEntity attached to an entity. + ffi.Pointer clang_index_getClientEntity( + ffi.Pointer arg0, + ) { + _clang_index_getClientEntity ??= _dylib.lookupFunction< + _c_clang_index_getClientEntity, + _dart_clang_index_getClientEntity>('clang_index_getClientEntity'); + return _clang_index_getClientEntity( + arg0, + ); + } -typedef _c_clang_Module_getNumTopLevelHeaders = ffi.Uint32 Function( - ffi.Pointer arg0, - ffi.Pointer Module, -); + _dart_clang_index_getClientEntity _clang_index_getClientEntity; -typedef _dart_clang_Module_getNumTopLevelHeaders = int Function( - ffi.Pointer arg0, - ffi.Pointer Module, -); + /// For setting a custom CXIdxClientEntity attached to an entity. + void clang_index_setClientEntity( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + _clang_index_setClientEntity ??= _dylib.lookupFunction< + _c_clang_index_setClientEntity, + _dart_clang_index_setClientEntity>('clang_index_setClientEntity'); + return _clang_index_setClientEntity( + arg0, + arg1, + ); + } -/// \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( - Module, - ); -} + _dart_clang_index_setClientEntity _clang_index_setClientEntity; -final _dart_clang_Module_getParent _clang_Module_getParent = _dylib - .lookupFunction<_c_clang_Module_getParent, _dart_clang_Module_getParent>( - 'clang_Module_getParent'); + /// 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, + ) { + _clang_IndexAction_create ??= _dylib.lookupFunction< + _c_clang_IndexAction_create, + _dart_clang_IndexAction_create>('clang_IndexAction_create'); + return _clang_IndexAction_create( + CIdx, + ); + } -typedef _c_clang_Module_getParent = ffi.Pointer Function( - ffi.Pointer Module, -); + _dart_clang_IndexAction_create _clang_IndexAction_create; -typedef _dart_clang_Module_getParent = ffi.Pointer Function( - ffi.Pointer Module, -); + /// 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, + ) { + _clang_IndexAction_dispose ??= _dylib.lookupFunction< + _c_clang_IndexAction_dispose, + _dart_clang_IndexAction_dispose>('clang_IndexAction_dispose'); + return _clang_IndexAction_dispose( + arg0, + ); + } -/// \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( - arg0, - Module, - Index, - ); -} - -final _dart_clang_Module_getTopLevelHeader _clang_Module_getTopLevelHeader = - _dylib.lookupFunction<_c_clang_Module_getTopLevelHeader, - _dart_clang_Module_getTopLevelHeader>('clang_Module_getTopLevelHeader'); + _dart_clang_IndexAction_dispose _clang_IndexAction_dispose; -typedef _c_clang_Module_getTopLevelHeader = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer Module, - ffi.Uint32 Index, -); + /// 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, + ) { + _clang_indexSourceFile ??= _dylib.lookupFunction<_c_clang_indexSourceFile, + _dart_clang_indexSourceFile>('clang_indexSourceFile'); + return _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, + ); + } -typedef _dart_clang_Module_getTopLevelHeader = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer Module, - int Index, -); + _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, + ) { + _clang_indexSourceFileFullArgv ??= _dylib.lookupFunction< + _c_clang_indexSourceFileFullArgv, + _dart_clang_indexSourceFileFullArgv>('clang_indexSourceFileFullArgv'); + return _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, + ); + } -/// \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( - Module, - ); -} + _dart_clang_indexSourceFileFullArgv _clang_indexSourceFileFullArgv; -final _dart_clang_Module_isSystem _clang_Module_isSystem = _dylib - .lookupFunction<_c_clang_Module_isSystem, _dart_clang_Module_isSystem>( - 'clang_Module_isSystem'); + /// 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, + ) { + _clang_indexTranslationUnit ??= _dylib.lookupFunction< + _c_clang_indexTranslationUnit, + _dart_clang_indexTranslationUnit>('clang_indexTranslationUnit'); + return _clang_indexTranslationUnit( + arg0, + client_data, + index_callbacks, + index_callbacks_size, + index_options, + arg5, + ); + } -typedef _c_clang_Module_isSystem = ffi.Int32 Function( - ffi.Pointer Module, -); + _dart_clang_indexTranslationUnit _clang_indexTranslationUnit; -typedef _dart_clang_Module_isSystem = int Function( - ffi.Pointer Module, -); + ffi.Pointer clang_getCString_wrap( + ffi.Pointer string, + ) { + _clang_getCString_wrap ??= _dylib.lookupFunction<_c_clang_getCString_wrap, + _dart_clang_getCString_wrap>('clang_getCString_wrap'); + return _clang_getCString_wrap( + string, + ); + } -/// Release a printing policy. -void clang_PrintingPolicy_dispose( - ffi.Pointer Policy, -) { - return _clang_PrintingPolicy_dispose( - Policy, - ); -} + _dart_clang_getCString_wrap _clang_getCString_wrap; -final _dart_clang_PrintingPolicy_dispose _clang_PrintingPolicy_dispose = - _dylib.lookupFunction<_c_clang_PrintingPolicy_dispose, - _dart_clang_PrintingPolicy_dispose>('clang_PrintingPolicy_dispose'); + void clang_disposeString_wrap( + ffi.Pointer string, + ) { + _clang_disposeString_wrap ??= _dylib.lookupFunction< + _c_clang_disposeString_wrap, + _dart_clang_disposeString_wrap>('clang_disposeString_wrap'); + return _clang_disposeString_wrap( + string, + ); + } -typedef _c_clang_PrintingPolicy_dispose = ffi.Void Function( - ffi.Pointer Policy, -); + _dart_clang_disposeString_wrap _clang_disposeString_wrap; -typedef _dart_clang_PrintingPolicy_dispose = void Function( - ffi.Pointer Policy, -); + int clang_getCursorKind_wrap( + ffi.Pointer cursor, + ) { + _clang_getCursorKind_wrap ??= _dylib.lookupFunction< + _c_clang_getCursorKind_wrap, + _dart_clang_getCursorKind_wrap>('clang_getCursorKind_wrap'); + return _clang_getCursorKind_wrap( + cursor, + ); + } -/// Get a property value for the given printing policy. -int clang_PrintingPolicy_getProperty( - ffi.Pointer Policy, - int Property, -) { - return _clang_PrintingPolicy_getProperty( - Policy, - Property, - ); -} + _dart_clang_getCursorKind_wrap _clang_getCursorKind_wrap; -final _dart_clang_PrintingPolicy_getProperty _clang_PrintingPolicy_getProperty = - _dylib.lookupFunction<_c_clang_PrintingPolicy_getProperty, - _dart_clang_PrintingPolicy_getProperty>( - 'clang_PrintingPolicy_getProperty'); + ffi.Pointer clang_getCursorKindSpelling_wrap( + int kind, + ) { + _clang_getCursorKindSpelling_wrap ??= _dylib.lookupFunction< + _c_clang_getCursorKindSpelling_wrap, + _dart_clang_getCursorKindSpelling_wrap>( + 'clang_getCursorKindSpelling_wrap'); + return _clang_getCursorKindSpelling_wrap( + kind, + ); + } -typedef _c_clang_PrintingPolicy_getProperty = ffi.Uint32 Function( - ffi.Pointer Policy, - ffi.Int32 Property, -); + _dart_clang_getCursorKindSpelling_wrap _clang_getCursorKindSpelling_wrap; -typedef _dart_clang_PrintingPolicy_getProperty = int Function( - ffi.Pointer Policy, - int Property, -); + ffi.Pointer clang_getCursorType_wrap( + ffi.Pointer cursor, + ) { + _clang_getCursorType_wrap ??= _dylib.lookupFunction< + _c_clang_getCursorType_wrap, + _dart_clang_getCursorType_wrap>('clang_getCursorType_wrap'); + return _clang_getCursorType_wrap( + cursor, + ); + } -/// Set a property value for the given printing policy. -void clang_PrintingPolicy_setProperty( - ffi.Pointer Policy, - int Property, - int Value, -) { - return _clang_PrintingPolicy_setProperty( - Policy, - Property, - Value, - ); -} + _dart_clang_getCursorType_wrap _clang_getCursorType_wrap; -final _dart_clang_PrintingPolicy_setProperty _clang_PrintingPolicy_setProperty = - _dylib.lookupFunction<_c_clang_PrintingPolicy_setProperty, - _dart_clang_PrintingPolicy_setProperty>( - 'clang_PrintingPolicy_setProperty'); + ffi.Pointer clang_getTypeSpelling_wrap( + ffi.Pointer type, + ) { + _clang_getTypeSpelling_wrap ??= _dylib.lookupFunction< + _c_clang_getTypeSpelling_wrap, + _dart_clang_getTypeSpelling_wrap>('clang_getTypeSpelling_wrap'); + return _clang_getTypeSpelling_wrap( + type, + ); + } -typedef _c_clang_PrintingPolicy_setProperty = ffi.Void Function( - ffi.Pointer Policy, - ffi.Int32 Property, - ffi.Uint32 Value, -); + _dart_clang_getTypeSpelling_wrap _clang_getTypeSpelling_wrap; -typedef _dart_clang_PrintingPolicy_setProperty = void Function( - ffi.Pointer Policy, - int Property, - int Value, -); + ffi.Pointer clang_getTypeKindSpelling_wrap( + int typeKind, + ) { + _clang_getTypeKindSpelling_wrap ??= _dylib.lookupFunction< + _c_clang_getTypeKindSpelling_wrap, + _dart_clang_getTypeKindSpelling_wrap>('clang_getTypeKindSpelling_wrap'); + return _clang_getTypeKindSpelling_wrap( + typeKind, + ); + } -/// Destroy the CXTargetInfo object. -void clang_TargetInfo_dispose( - ffi.Pointer Info, -) { - return _clang_TargetInfo_dispose( - Info, - ); -} + _dart_clang_getTypeKindSpelling_wrap _clang_getTypeKindSpelling_wrap; -final _dart_clang_TargetInfo_dispose _clang_TargetInfo_dispose = - _dylib.lookupFunction<_c_clang_TargetInfo_dispose, - _dart_clang_TargetInfo_dispose>('clang_TargetInfo_dispose'); + ffi.Pointer clang_getResultType_wrap( + ffi.Pointer functionType, + ) { + _clang_getResultType_wrap ??= _dylib.lookupFunction< + _c_clang_getResultType_wrap, + _dart_clang_getResultType_wrap>('clang_getResultType_wrap'); + return _clang_getResultType_wrap( + functionType, + ); + } -typedef _c_clang_TargetInfo_dispose = ffi.Void Function( - ffi.Pointer Info, -); + _dart_clang_getResultType_wrap _clang_getResultType_wrap; -typedef _dart_clang_TargetInfo_dispose = void Function( - ffi.Pointer Info, -); + ffi.Pointer clang_getPointeeType_wrap( + ffi.Pointer pointerType, + ) { + _clang_getPointeeType_wrap ??= _dylib.lookupFunction< + _c_clang_getPointeeType_wrap, + _dart_clang_getPointeeType_wrap>('clang_getPointeeType_wrap'); + return _clang_getPointeeType_wrap( + pointerType, + ); + } -/// Get the pointer width of the target in bits. -/// -/// Returns -1 in case of error. -int clang_TargetInfo_getPointerWidth( - ffi.Pointer Info, -) { - return _clang_TargetInfo_getPointerWidth( - Info, - ); -} + _dart_clang_getPointeeType_wrap _clang_getPointeeType_wrap; -final _dart_clang_TargetInfo_getPointerWidth _clang_TargetInfo_getPointerWidth = - _dylib.lookupFunction<_c_clang_TargetInfo_getPointerWidth, - _dart_clang_TargetInfo_getPointerWidth>( - 'clang_TargetInfo_getPointerWidth'); + ffi.Pointer clang_getCanonicalType_wrap( + ffi.Pointer typerefType, + ) { + _clang_getCanonicalType_wrap ??= _dylib.lookupFunction< + _c_clang_getCanonicalType_wrap, + _dart_clang_getCanonicalType_wrap>('clang_getCanonicalType_wrap'); + return _clang_getCanonicalType_wrap( + typerefType, + ); + } -typedef _c_clang_TargetInfo_getPointerWidth = ffi.Int32 Function( - ffi.Pointer Info, -); + _dart_clang_getCanonicalType_wrap _clang_getCanonicalType_wrap; -typedef _dart_clang_TargetInfo_getPointerWidth = int Function( - ffi.Pointer Info, -); + ffi.Pointer clang_Type_getNamedType_wrap( + ffi.Pointer elaboratedType, + ) { + _clang_Type_getNamedType_wrap ??= _dylib.lookupFunction< + _c_clang_Type_getNamedType_wrap, + _dart_clang_Type_getNamedType_wrap>('clang_Type_getNamedType_wrap'); + return _clang_Type_getNamedType_wrap( + elaboratedType, + ); + } -ffi.Pointer clang_Type_getNamedType_wrap( - ffi.Pointer elaboratedType, -) { - return _clang_Type_getNamedType_wrap( - elaboratedType, - ); -} + _dart_clang_Type_getNamedType_wrap _clang_Type_getNamedType_wrap; -final _dart_clang_Type_getNamedType_wrap _clang_Type_getNamedType_wrap = - _dylib.lookupFunction<_c_clang_Type_getNamedType_wrap, - _dart_clang_Type_getNamedType_wrap>('clang_Type_getNamedType_wrap'); + ffi.Pointer clang_getTypeDeclaration_wrap( + ffi.Pointer cxtype, + ) { + _clang_getTypeDeclaration_wrap ??= _dylib.lookupFunction< + _c_clang_getTypeDeclaration_wrap, + _dart_clang_getTypeDeclaration_wrap>('clang_getTypeDeclaration_wrap'); + return _clang_getTypeDeclaration_wrap( + cxtype, + ); + } -typedef _c_clang_Type_getNamedType_wrap = ffi.Pointer Function( - ffi.Pointer elaboratedType, -); + _dart_clang_getTypeDeclaration_wrap _clang_getTypeDeclaration_wrap; -typedef _dart_clang_Type_getNamedType_wrap = ffi.Pointer Function( - ffi.Pointer elaboratedType, -); + ffi.Pointer clang_getTypedefDeclUnderlyingType_wrap( + ffi.Pointer cxcursor, + ) { + _clang_getTypedefDeclUnderlyingType_wrap ??= _dylib.lookupFunction< + _c_clang_getTypedefDeclUnderlyingType_wrap, + _dart_clang_getTypedefDeclUnderlyingType_wrap>( + 'clang_getTypedefDeclUnderlyingType_wrap'); + return _clang_getTypedefDeclUnderlyingType_wrap( + cxcursor, + ); + } -/// 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( - TU, - Tokens, - NumTokens, - Cursors, - ); -} + _dart_clang_getTypedefDeclUnderlyingType_wrap + _clang_getTypedefDeclUnderlyingType_wrap; -final _dart_clang_annotateTokens _clang_annotateTokens = - _dylib.lookupFunction<_c_clang_annotateTokens, _dart_clang_annotateTokens>( - 'clang_annotateTokens'); + /// The name of parameter, struct, typedef. + ffi.Pointer clang_getCursorSpelling_wrap( + ffi.Pointer cursor, + ) { + _clang_getCursorSpelling_wrap ??= _dylib.lookupFunction< + _c_clang_getCursorSpelling_wrap, + _dart_clang_getCursorSpelling_wrap>('clang_getCursorSpelling_wrap'); + return _clang_getCursorSpelling_wrap( + cursor, + ); + } -typedef _c_clang_annotateTokens = ffi.Void Function( - ffi.Pointer TU, - ffi.Pointer Tokens, - ffi.Uint32 NumTokens, - ffi.Pointer Cursors, -); + _dart_clang_getCursorSpelling_wrap _clang_getCursorSpelling_wrap; -typedef _dart_clang_annotateTokens = void Function( - ffi.Pointer TU, - ffi.Pointer Tokens, - int NumTokens, - ffi.Pointer Cursors, -); + ffi.Pointer clang_getTranslationUnitCursor_wrap( + ffi.Pointer tu, + ) { + _clang_getTranslationUnitCursor_wrap ??= _dylib.lookupFunction< + _c_clang_getTranslationUnitCursor_wrap, + _dart_clang_getTranslationUnitCursor_wrap>( + 'clang_getTranslationUnitCursor_wrap'); + return _clang_getTranslationUnitCursor_wrap( + tu, + ); + } -/// 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( - TU, - complete_filename, - complete_line, - complete_column, - unsaved_files, - num_unsaved_files, - options, - ); -} + _dart_clang_getTranslationUnitCursor_wrap + _clang_getTranslationUnitCursor_wrap; -final _dart_clang_codeCompleteAt _clang_codeCompleteAt = - _dylib.lookupFunction<_c_clang_codeCompleteAt, _dart_clang_codeCompleteAt>( - 'clang_codeCompleteAt'); + ffi.Pointer clang_formatDiagnostic_wrap( + ffi.Pointer diag, + int opts, + ) { + _clang_formatDiagnostic_wrap ??= _dylib.lookupFunction< + _c_clang_formatDiagnostic_wrap, + _dart_clang_formatDiagnostic_wrap>('clang_formatDiagnostic_wrap'); + return _clang_formatDiagnostic_wrap( + diag, + opts, + ); + } -typedef _c_clang_codeCompleteAt = ffi.Pointer Function( - ffi.Pointer TU, - ffi.Pointer complete_filename, - ffi.Uint32 complete_line, - ffi.Uint32 complete_column, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options, -); + _dart_clang_formatDiagnostic_wrap _clang_formatDiagnostic_wrap; + + /// Visitor is a function pointer with parameters having pointers to cxcursor + /// instead of cxcursor by default. + int clang_visitChildren_wrap( + ffi.Pointer parent, + ffi.Pointer> _modifiedVisitor, + ffi.Pointer clientData, + ) { + _clang_visitChildren_wrap ??= _dylib.lookupFunction< + _c_clang_visitChildren_wrap, + _dart_clang_visitChildren_wrap>('clang_visitChildren_wrap'); + return _clang_visitChildren_wrap( + parent, + _modifiedVisitor, + clientData, + ); + } -typedef _dart_clang_codeCompleteAt = ffi.Pointer - Function( - ffi.Pointer TU, - ffi.Pointer complete_filename, - int complete_line, - int complete_column, - ffi.Pointer unsaved_files, - int num_unsaved_files, - int options, -); + _dart_clang_visitChildren_wrap _clang_visitChildren_wrap; -/// 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( - Results, - IsIncomplete, - ); -} + int clang_Cursor_getNumArguments_wrap( + ffi.Pointer cursor, + ) { + _clang_Cursor_getNumArguments_wrap ??= _dylib.lookupFunction< + _c_clang_Cursor_getNumArguments_wrap, + _dart_clang_Cursor_getNumArguments_wrap>( + 'clang_Cursor_getNumArguments_wrap'); + return _clang_Cursor_getNumArguments_wrap( + cursor, + ); + } -final _dart_clang_codeCompleteGetContainerKind - _clang_codeCompleteGetContainerKind = _dylib.lookupFunction< - _c_clang_codeCompleteGetContainerKind, - _dart_clang_codeCompleteGetContainerKind>( - 'clang_codeCompleteGetContainerKind'); + _dart_clang_Cursor_getNumArguments_wrap _clang_Cursor_getNumArguments_wrap; -typedef _c_clang_codeCompleteGetContainerKind = ffi.Int32 Function( - ffi.Pointer Results, - ffi.Pointer IsIncomplete, -); + ffi.Pointer clang_Cursor_getArgument_wrap( + ffi.Pointer cursor, + int i, + ) { + _clang_Cursor_getArgument_wrap ??= _dylib.lookupFunction< + _c_clang_Cursor_getArgument_wrap, + _dart_clang_Cursor_getArgument_wrap>('clang_Cursor_getArgument_wrap'); + return _clang_Cursor_getArgument_wrap( + cursor, + i, + ); + } -typedef _dart_clang_codeCompleteGetContainerKind = int Function( - ffi.Pointer Results, - ffi.Pointer IsIncomplete, -); + _dart_clang_Cursor_getArgument_wrap _clang_Cursor_getArgument_wrap; -/// 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( - Results, - ); -} + int clang_getNumArgTypes_wrap( + ffi.Pointer cxtype, + ) { + _clang_getNumArgTypes_wrap ??= _dylib.lookupFunction< + _c_clang_getNumArgTypes_wrap, + _dart_clang_getNumArgTypes_wrap>('clang_getNumArgTypes_wrap'); + return _clang_getNumArgTypes_wrap( + cxtype, + ); + } -final _dart_clang_codeCompleteGetContexts _clang_codeCompleteGetContexts = - _dylib.lookupFunction<_c_clang_codeCompleteGetContexts, - _dart_clang_codeCompleteGetContexts>('clang_codeCompleteGetContexts'); + _dart_clang_getNumArgTypes_wrap _clang_getNumArgTypes_wrap; + + ffi.Pointer clang_getArgType_wrap( + ffi.Pointer cxtype, + int i, + ) { + _clang_getArgType_wrap ??= _dylib.lookupFunction<_c_clang_getArgType_wrap, + _dart_clang_getArgType_wrap>('clang_getArgType_wrap'); + return _clang_getArgType_wrap( + cxtype, + i, + ); + } -typedef _c_clang_codeCompleteGetContexts = ffi.Uint64 Function( - ffi.Pointer Results, -); + _dart_clang_getArgType_wrap _clang_getArgType_wrap; -typedef _dart_clang_codeCompleteGetContexts = int Function( - ffi.Pointer Results, -); + int clang_getEnumConstantDeclValue_wrap( + ffi.Pointer cursor, + ) { + _clang_getEnumConstantDeclValue_wrap ??= _dylib.lookupFunction< + _c_clang_getEnumConstantDeclValue_wrap, + _dart_clang_getEnumConstantDeclValue_wrap>( + 'clang_getEnumConstantDeclValue_wrap'); + return _clang_getEnumConstantDeclValue_wrap( + cursor, + ); + } -/// 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( - Results, - Index, - ); -} + _dart_clang_getEnumConstantDeclValue_wrap + _clang_getEnumConstantDeclValue_wrap; + + /// Returns non-zero if the ranges are the same, zero if they differ. + int clang_equalRanges_wrap( + ffi.Pointer c1, + ffi.Pointer c2, + ) { + _clang_equalRanges_wrap ??= _dylib.lookupFunction<_c_clang_equalRanges_wrap, + _dart_clang_equalRanges_wrap>('clang_equalRanges_wrap'); + return _clang_equalRanges_wrap( + c1, + c2, + ); + } -final _dart_clang_codeCompleteGetDiagnostic _clang_codeCompleteGetDiagnostic = - _dylib.lookupFunction<_c_clang_codeCompleteGetDiagnostic, - _dart_clang_codeCompleteGetDiagnostic>( - 'clang_codeCompleteGetDiagnostic'); + _dart_clang_equalRanges_wrap _clang_equalRanges_wrap; -typedef _c_clang_codeCompleteGetDiagnostic = ffi.Pointer Function( - ffi.Pointer Results, - ffi.Uint32 Index, -); + /// Returns the comment range. + ffi.Pointer clang_Cursor_getCommentRange_wrap( + ffi.Pointer cursor, + ) { + _clang_Cursor_getCommentRange_wrap ??= _dylib.lookupFunction< + _c_clang_Cursor_getCommentRange_wrap, + _dart_clang_Cursor_getCommentRange_wrap>( + 'clang_Cursor_getCommentRange_wrap'); + return _clang_Cursor_getCommentRange_wrap( + cursor, + ); + } -typedef _dart_clang_codeCompleteGetDiagnostic = ffi.Pointer Function( - ffi.Pointer Results, - int Index, -); + _dart_clang_Cursor_getCommentRange_wrap _clang_Cursor_getCommentRange_wrap; -/// Determine the number of diagnostics produced prior to the -/// location where code completion was performed. -int clang_codeCompleteGetNumDiagnostics( - ffi.Pointer Results, -) { - return _clang_codeCompleteGetNumDiagnostics( - Results, - ); -} + /// Returns the raw comment. + ffi.Pointer clang_Cursor_getRawCommentText_wrap( + ffi.Pointer cursor, + ) { + _clang_Cursor_getRawCommentText_wrap ??= _dylib.lookupFunction< + _c_clang_Cursor_getRawCommentText_wrap, + _dart_clang_Cursor_getRawCommentText_wrap>( + 'clang_Cursor_getRawCommentText_wrap'); + return _clang_Cursor_getRawCommentText_wrap( + cursor, + ); + } -final _dart_clang_codeCompleteGetNumDiagnostics - _clang_codeCompleteGetNumDiagnostics = _dylib.lookupFunction< - _c_clang_codeCompleteGetNumDiagnostics, - _dart_clang_codeCompleteGetNumDiagnostics>( - 'clang_codeCompleteGetNumDiagnostics'); + _dart_clang_Cursor_getRawCommentText_wrap + _clang_Cursor_getRawCommentText_wrap; -typedef _c_clang_codeCompleteGetNumDiagnostics = ffi.Uint32 Function( - ffi.Pointer Results, -); + /// Returns the first paragraph of doxygen doc comment. + ffi.Pointer clang_Cursor_getBriefCommentText_wrap( + ffi.Pointer cursor, + ) { + _clang_Cursor_getBriefCommentText_wrap ??= _dylib.lookupFunction< + _c_clang_Cursor_getBriefCommentText_wrap, + _dart_clang_Cursor_getBriefCommentText_wrap>( + 'clang_Cursor_getBriefCommentText_wrap'); + return _clang_Cursor_getBriefCommentText_wrap( + cursor, + ); + } -typedef _dart_clang_codeCompleteGetNumDiagnostics = int Function( - ffi.Pointer Results, -); + _dart_clang_Cursor_getBriefCommentText_wrap + _clang_Cursor_getBriefCommentText_wrap; -/// Creates an empty CXCursorSet. -ffi.Pointer clang_createCXCursorSet() { - return _clang_createCXCursorSet(); -} + ffi.Pointer clang_getCursorLocation_wrap( + ffi.Pointer cursor, + ) { + _clang_getCursorLocation_wrap ??= _dylib.lookupFunction< + _c_clang_getCursorLocation_wrap, + _dart_clang_getCursorLocation_wrap>('clang_getCursorLocation_wrap'); + return _clang_getCursorLocation_wrap( + cursor, + ); + } -final _dart_clang_createCXCursorSet _clang_createCXCursorSet = _dylib - .lookupFunction<_c_clang_createCXCursorSet, _dart_clang_createCXCursorSet>( - 'clang_createCXCursorSet'); + _dart_clang_getCursorLocation_wrap _clang_getCursorLocation_wrap; + + void clang_getFileLocation_wrap( + ffi.Pointer location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, + ) { + _clang_getFileLocation_wrap ??= _dylib.lookupFunction< + _c_clang_getFileLocation_wrap, + _dart_clang_getFileLocation_wrap>('clang_getFileLocation_wrap'); + return _clang_getFileLocation_wrap( + location, + file, + line, + column, + offset, + ); + } -typedef _c_clang_createCXCursorSet = ffi.Pointer Function(); + _dart_clang_getFileLocation_wrap _clang_getFileLocation_wrap; -typedef _dart_clang_createCXCursorSet = ffi.Pointer Function(); + ffi.Pointer clang_getFileName_wrap( + ffi.Pointer SFile, + ) { + _clang_getFileName_wrap ??= _dylib.lookupFunction<_c_clang_getFileName_wrap, + _dart_clang_getFileName_wrap>('clang_getFileName_wrap'); + return _clang_getFileName_wrap( + SFile, + ); + } -/// Provides a shared context for creating translation units. -/// -/// It provides two options: -/// -/// - excludeDeclarationsFromPCH: When non-zero, allows enumeration of "local" -/// declarations (when loading any new translation units). A "local" declaration -/// is one that belongs in the translation unit itself and not in a precompiled -/// header that was used by the translation unit. If zero, all declarations -/// will be enumerated. -/// -/// Here is an example: -/// -/// \code -/// // excludeDeclsFromPCH = 1, displayDiagnostics=1 -/// Idx = clang_createIndex(1, 1); -/// -/// // IndexTest.pch was produced with the following command: -/// // "clang -x c IndexTest.h -emit-ast -o IndexTest.pch" -/// TU = clang_createTranslationUnit(Idx, "IndexTest.pch"); -/// -/// // This will load all the symbols from 'IndexTest.pch' -/// clang_visitChildren(clang_getTranslationUnitCursor(TU), -/// TranslationUnitVisitor, 0); -/// clang_disposeTranslationUnit(TU); -/// -/// // This will load all the symbols from 'IndexTest.c', excluding symbols -/// // from 'IndexTest.pch'. -/// char *args[] = { "-Xclang", "-include-pch=IndexTest.pch" }; -/// TU = clang_createTranslationUnitFromSourceFile(Idx, "IndexTest.c", 2, args, -/// 0, 0); -/// clang_visitChildren(clang_getTranslationUnitCursor(TU), -/// TranslationUnitVisitor, 0); -/// clang_disposeTranslationUnit(TU); -/// \endcode -/// -/// This process of creating the 'pch', loading it separately, and using it (via -/// -include-pch) allows 'excludeDeclsFromPCH' to remove redundant callbacks -/// (which gives the indexer the same performance benefit as the compiler). -ffi.Pointer clang_createIndex( - int excludeDeclarationsFromPCH, - int displayDiagnostics, -) { - return _clang_createIndex( - excludeDeclarationsFromPCH, - displayDiagnostics, - ); -} + _dart_clang_getFileName_wrap _clang_getFileName_wrap; -final _dart_clang_createIndex _clang_createIndex = - _dylib.lookupFunction<_c_clang_createIndex, _dart_clang_createIndex>( - 'clang_createIndex'); + int clang_getNumElements_wrap( + ffi.Pointer cxtype, + ) { + _clang_getNumElements_wrap ??= _dylib.lookupFunction< + _c_clang_getNumElements_wrap, + _dart_clang_getNumElements_wrap>('clang_getNumElements_wrap'); + return _clang_getNumElements_wrap( + cxtype, + ); + } -typedef _c_clang_createIndex = ffi.Pointer Function( - ffi.Int32 excludeDeclarationsFromPCH, - ffi.Int32 displayDiagnostics, -); + _dart_clang_getNumElements_wrap _clang_getNumElements_wrap; -typedef _dart_clang_createIndex = ffi.Pointer Function( - int excludeDeclarationsFromPCH, - int displayDiagnostics, -); + ffi.Pointer clang_getArrayElementType_wrap( + ffi.Pointer cxtype, + ) { + _clang_getArrayElementType_wrap ??= _dylib.lookupFunction< + _c_clang_getArrayElementType_wrap, + _dart_clang_getArrayElementType_wrap>('clang_getArrayElementType_wrap'); + return _clang_getArrayElementType_wrap( + cxtype, + ); + } -/// Same as \c clang_createTranslationUnit2, but returns -/// the \c CXTranslationUnit instead of an error code. In case of an error this -/// routine returns a \c NULL \c CXTranslationUnit, without further detailed -/// error codes. -ffi.Pointer clang_createTranslationUnit( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, -) { - return _clang_createTranslationUnit( - CIdx, - ast_filename, - ); + _dart_clang_getArrayElementType_wrap _clang_getArrayElementType_wrap; } -final _dart_clang_createTranslationUnit _clang_createTranslationUnit = - _dylib.lookupFunction<_c_clang_createTranslationUnit, - _dart_clang_createTranslationUnit>('clang_createTranslationUnit'); +/// 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 { + ffi.Pointer data; -typedef _c_clang_createTranslationUnit = ffi.Pointer - Function( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, -); + @ffi.Uint32() + int private_flags; +} -typedef _dart_clang_createTranslationUnit = ffi.Pointer - Function( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, -); +class CXStringSet extends ffi.Struct { + ffi.Pointer Strings; -/// Create a translation unit from an AST file (\c -emit-ast). -/// -/// \param[out] out_TU A non-NULL pointer to store the created -/// \c CXTranslationUnit. -/// -/// \returns Zero on success, otherwise returns an error code. -int clang_createTranslationUnit2( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, - ffi.Pointer> out_TU, -) { - return _clang_createTranslationUnit2( - CIdx, - ast_filename, - out_TU, - ); + @ffi.Uint32() + int Count; } -final _dart_clang_createTranslationUnit2 _clang_createTranslationUnit2 = - _dylib.lookupFunction<_c_clang_createTranslationUnit2, - _dart_clang_createTranslationUnit2>('clang_createTranslationUnit2'); - -typedef _c_clang_createTranslationUnit2 = ffi.Int32 Function( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, - ffi.Pointer> out_TU, -); +class CXTargetInfoImpl extends ffi.Struct {} -typedef _dart_clang_createTranslationUnit2 = int Function( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, - ffi.Pointer> out_TU, -); +class CXTranslationUnitImpl extends ffi.Struct {} -/// Return the CXTranslationUnit for a given source file and the provided -/// command line arguments one would pass to the compiler. -/// -/// Note: The 'source_filename' argument is optional. If the caller provides a -/// NULL pointer, the name of the source file is expected to reside in the -/// specified command line arguments. -/// -/// Note: When encountered in 'clang_command_line_args', the following options -/// are ignored: -/// -/// '-c' -/// '-emit-ast' -/// '-fsyntax-only' -/// '-o \' (both '-o' and '\' are ignored) -/// -/// \param CIdx The index object with which the translation unit will be -/// associated. -/// -/// \param source_filename The name of the source file to load, or NULL if the -/// source file is included in \p clang_command_line_args. -/// -/// \param num_clang_command_line_args The number of command-line arguments in -/// \p clang_command_line_args. -/// -/// \param clang_command_line_args The command-line arguments that would be -/// passed to the \c clang executable if it were being invoked out-of-process. -/// These command-line options will be parsed and will affect how the translation -/// unit is parsed. Note that the following options are ignored: '-c', -/// '-emit-ast', '-fsyntax-only' (which is the default), and '-o \'. -/// -/// \param num_unsaved_files the number of unsaved file entries in \p -/// unsaved_files. +/// Provides the contents of a file that has not yet been saved to disk. /// -/// \param unsaved_files the files that have not yet been saved to disk -/// but may be required for 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. -ffi.Pointer clang_createTranslationUnitFromSourceFile( - 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, -) { - return _clang_createTranslationUnitFromSourceFile( - CIdx, - source_filename, - num_clang_command_line_args, - clang_command_line_args, - num_unsaved_files, - unsaved_files, - ); -} +/// 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. + ffi.Pointer Filename; -final _dart_clang_createTranslationUnitFromSourceFile - _clang_createTranslationUnitFromSourceFile = _dylib.lookupFunction< - _c_clang_createTranslationUnitFromSourceFile, - _dart_clang_createTranslationUnitFromSourceFile>( - 'clang_createTranslationUnitFromSourceFile'); + /// A buffer containing the unsaved contents of this file. + ffi.Pointer Contents; -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 length of the unsaved contents of this buffer. + @ffi.Uint64() + int Length; +} -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, -); +/// 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() + 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() + int Minor; -/// Returns a default set of code-completion options that can be -/// passed to\c clang_codeCompleteAt(). -int clang_defaultCodeCompleteOptions() { - return _clang_defaultCodeCompleteOptions(); + /// 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() + int Subminor; } -final _dart_clang_defaultCodeCompleteOptions _clang_defaultCodeCompleteOptions = - _dylib.lookupFunction<_c_clang_defaultCodeCompleteOptions, - _dart_clang_defaultCodeCompleteOptions>( - 'clang_defaultCodeCompleteOptions'); +class CXGlobalOptFlags { + /// Used to indicate that no special CXIndex options are needed. + static const int CXGlobalOpt_None = 0; -typedef _c_clang_defaultCodeCompleteOptions = ffi.Uint32 Function(); + /// 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; -typedef _dart_clang_defaultCodeCompleteOptions = int Function(); + /// 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; -/// Retrieve the set of display options most similar to the -/// default behavior of the clang compiler. -/// -/// \returns A set of display options suitable for use with \c -/// clang_formatDiagnostic(). -int clang_defaultDiagnosticDisplayOptions() { - return _clang_defaultDiagnosticDisplayOptions(); + /// Used to indicate that all threads that libclang creates should use + /// background priority. + static const int CXGlobalOpt_ThreadBackgroundPriorityForAll = 3; } -final _dart_clang_defaultDiagnosticDisplayOptions - _clang_defaultDiagnosticDisplayOptions = _dylib.lookupFunction< - _c_clang_defaultDiagnosticDisplayOptions, - _dart_clang_defaultDiagnosticDisplayOptions>( - 'clang_defaultDiagnosticDisplayOptions'); +/// Uniquely identifies a CXFile, that refers to the same underlying file, +/// across an indexing session. +class CXFileUniqueID extends ffi.Struct { + @ffi.Uint64() + int _unique_data_item_0; + @ffi.Uint64() + int _unique_data_item_1; + @ffi.Uint64() + int _unique_data_item_2; -typedef _c_clang_defaultDiagnosticDisplayOptions = ffi.Uint32 Function(); + /// 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 { + ffi.Pointer _unique_ptr_data_item_0; + 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() + 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 { + ffi.Pointer _unique_ptr_data_item_0; + 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() + int begin_int_data; + + @ffi.Uint32() + 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() + int count; + + /// An array of \c CXSourceRanges. + ffi.Pointer ranges; +} + +class CXTUResourceUsageEntry extends ffi.Struct { + @ffi.Int32() + int kind; + + @ffi.Uint64() + int amount; +} + +/// The memory usage of a CXTranslationUnit, broken into categories. +class CXTUResourceUsage extends ffi.Struct { + ffi.Pointer data; + + @ffi.Uint32() + int numEntries; + + 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() + int kind; + + @ffi.Int32() + int xdata; + + ffi.Pointer _unique_data_item_0; + ffi.Pointer _unique_data_item_1; + 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 {} + +class CXCursorSetImpl extends ffi.Struct {} + +/// Describes the kind of type +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() + int kind; + + ffi.Pointer _unique_data_item_0; + 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() + int _unique_int_data_item_0; + @ffi.Uint32() + int _unique_int_data_item_1; + @ffi.Uint32() + int _unique_int_data_item_2; + @ffi.Uint32() + 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); + 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.'); + } + } -typedef _dart_clang_defaultDiagnosticDisplayOptions = int Function(); + 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.'); + } + } -/// Returns the set of flags that is suitable for parsing a translation -/// unit that is being edited. -/// -/// The set of flags returned provide options for \c clang_parseTranslationUnit() -/// to indicate that the translation unit is likely to be reparsed many times, -/// either explicitly (via \c clang_reparseTranslationUnit()) or implicitly -/// (e.g., by code completion (\c clang_codeCompletionAt())). The returned flag -/// set contains an unspecified set of optimizations (e.g., the precompiled -/// preamble) geared toward improving the performance of these routines. The -/// set of optimizations enabled may change from one version to the next. -int clang_defaultEditingTranslationUnitOptions() { - return _clang_defaultEditingTranslationUnitOptions(); + 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.'); + } + } } -final _dart_clang_defaultEditingTranslationUnitOptions - _clang_defaultEditingTranslationUnitOptions = _dylib.lookupFunction< - _c_clang_defaultEditingTranslationUnitOptions, - _dart_clang_defaultEditingTranslationUnitOptions>( - 'clang_defaultEditingTranslationUnitOptions'); - -typedef _c_clang_defaultEditingTranslationUnitOptions = ffi.Uint32 Function(); +/// 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() + int CursorKind; -typedef _dart_clang_defaultEditingTranslationUnitOptions = int Function(); + /// The code-completion string that describes how to insert this + /// code-completion result into the editing buffer. + ffi.Pointer CompletionString; +} -/// Returns the set of flags that is suitable for reparsing a translation -/// unit. +/// Contains the results of code-completion. /// -/// The set of flags returned provide options for -/// \c clang_reparseTranslationUnit() by default. The returned flag -/// set contains an unspecified set of optimizations geared toward common uses -/// of reparsing. The set of optimizations enabled may change from one version -/// to the next. -int clang_defaultReparseOptions( - ffi.Pointer TU, -) { - return _clang_defaultReparseOptions( - TU, - ); -} +/// 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. + ffi.Pointer Results; -final _dart_clang_defaultReparseOptions _clang_defaultReparseOptions = - _dylib.lookupFunction<_c_clang_defaultReparseOptions, - _dart_clang_defaultReparseOptions>('clang_defaultReparseOptions'); + /// The number of code-completion results stored in the + /// \c Results array. + @ffi.Uint32() + int NumResults; +} -typedef _c_clang_defaultReparseOptions = ffi.Uint32 Function( - ffi.Pointer TU, -); +class CXCursorAndRangeVisitor extends ffi.Struct {} -typedef _dart_clang_defaultReparseOptions = int Function( - ffi.Pointer TU, -); +/// Source location passed to index callbacks. +class CXIdxLoc extends ffi.Struct { + ffi.Pointer _unique_ptr_data_item_0; + ffi.Pointer _unique_ptr_data_item_1; -/// Returns the set of flags that is suitable for saving a translation -/// unit. -/// -/// The set of flags returned provide options for -/// \c clang_saveTranslationUnit() by default. The returned flag -/// set contains an unspecified set of options that save translation units with -/// the most commonly-requested data. -int clang_defaultSaveOptions( - ffi.Pointer TU, -) { - return _clang_defaultSaveOptions( - TU, - ); + /// Helper for array `ptr_data`. + ArrayHelper_CXIdxLoc_ptr_data_level0 get ptr_data => + ArrayHelper_CXIdxLoc_ptr_data_level0(this, [2], 0, 0); + @ffi.Uint32() + int int_data; } -final _dart_clang_defaultSaveOptions _clang_defaultSaveOptions = - _dylib.lookupFunction<_c_clang_defaultSaveOptions, - _dart_clang_defaultSaveOptions>('clang_defaultSaveOptions'); - -typedef _c_clang_defaultSaveOptions = ffi.Uint32 Function( - ffi.Pointer TU, -); +/// 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_defaultSaveOptions = int Function( - ffi.Pointer TU, -); + 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.'); + } + } -/// Disposes a CXCursorSet and releases its associated memory. -void clang_disposeCXCursorSet( - ffi.Pointer cset, -) { - return _clang_disposeCXCursorSet( - cset, - ); + 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.'); + } + } } -final _dart_clang_disposeCXCursorSet _clang_disposeCXCursorSet = - _dylib.lookupFunction<_c_clang_disposeCXCursorSet, - _dart_clang_disposeCXCursorSet>('clang_disposeCXCursorSet'); +/// Data for ppIncludedFile callback. +class CXIdxIncludedFileInfo extends ffi.Struct {} -typedef _c_clang_disposeCXCursorSet = ffi.Void Function( - ffi.Pointer cset, -); +/// Data for IndexerCallbacks#importedASTFile. +class CXIdxImportedASTFileInfo extends ffi.Struct {} -typedef _dart_clang_disposeCXCursorSet = void Function( - ffi.Pointer cset, -); +class CXIdxAttrInfo extends ffi.Struct {} -/// Free the memory associated with a \c CXPlatformAvailability structure. -void clang_disposeCXPlatformAvailability( - ffi.Pointer availability, -) { - return _clang_disposeCXPlatformAvailability( - availability, - ); -} +class CXIdxEntityInfo extends ffi.Struct {} -final _dart_clang_disposeCXPlatformAvailability - _clang_disposeCXPlatformAvailability = _dylib.lookupFunction< - _c_clang_disposeCXPlatformAvailability, - _dart_clang_disposeCXPlatformAvailability>( - 'clang_disposeCXPlatformAvailability'); +class CXIdxContainerInfo extends ffi.Struct {} -typedef _c_clang_disposeCXPlatformAvailability = ffi.Void Function( - ffi.Pointer availability, -); +class CXIdxIBOutletCollectionAttrInfo extends ffi.Struct {} -typedef _dart_clang_disposeCXPlatformAvailability = void Function( - ffi.Pointer availability, -); +class CXIdxDeclInfo extends ffi.Struct {} -/// Free the given set of code-completion results. -void clang_disposeCodeCompleteResults( - ffi.Pointer Results, -) { - return _clang_disposeCodeCompleteResults( - Results, - ); +class CXIdxObjCContainerDeclInfo extends ffi.Struct { + ffi.Pointer declInfo; + + @ffi.Int32() + int kind; } -final _dart_clang_disposeCodeCompleteResults _clang_disposeCodeCompleteResults = - _dylib.lookupFunction<_c_clang_disposeCodeCompleteResults, - _dart_clang_disposeCodeCompleteResults>( - 'clang_disposeCodeCompleteResults'); +class CXIdxBaseClassInfo extends ffi.Struct {} -typedef _c_clang_disposeCodeCompleteResults = ffi.Void Function( - ffi.Pointer Results, -); +class CXIdxObjCProtocolRefInfo extends ffi.Struct {} -typedef _dart_clang_disposeCodeCompleteResults = void Function( - ffi.Pointer Results, -); +class CXIdxObjCProtocolRefListInfo extends ffi.Struct { + ffi.Pointer> protocols; -/// Destroy a diagnostic. -void clang_disposeDiagnostic( - ffi.Pointer Diagnostic, -) { - return _clang_disposeDiagnostic( - Diagnostic, - ); + @ffi.Uint32() + int numProtocols; } -final _dart_clang_disposeDiagnostic _clang_disposeDiagnostic = _dylib - .lookupFunction<_c_clang_disposeDiagnostic, _dart_clang_disposeDiagnostic>( - 'clang_disposeDiagnostic'); - -typedef _c_clang_disposeDiagnostic = ffi.Void Function( - ffi.Pointer Diagnostic, -); +class CXIdxObjCInterfaceDeclInfo extends ffi.Struct { + ffi.Pointer containerInfo; -typedef _dart_clang_disposeDiagnostic = void Function( - ffi.Pointer Diagnostic, -); + ffi.Pointer superInfo; -/// Release a CXDiagnosticSet and all of its contained diagnostics. -void clang_disposeDiagnosticSet( - ffi.Pointer Diags, -) { - return _clang_disposeDiagnosticSet( - Diags, - ); + ffi.Pointer protocols; } -final _dart_clang_disposeDiagnosticSet _clang_disposeDiagnosticSet = - _dylib.lookupFunction<_c_clang_disposeDiagnosticSet, - _dart_clang_disposeDiagnosticSet>('clang_disposeDiagnosticSet'); +class CXIdxObjCCategoryDeclInfo extends ffi.Struct {} -typedef _c_clang_disposeDiagnosticSet = ffi.Void Function( - ffi.Pointer Diags, -); +class CXIdxObjCPropertyDeclInfo extends ffi.Struct { + ffi.Pointer declInfo; -typedef _dart_clang_disposeDiagnosticSet = void Function( - ffi.Pointer Diags, -); + ffi.Pointer getter; -/// Destroy the given index. -/// -/// The index must not be destroyed until all of the translation units created -/// within that index have been destroyed. -void clang_disposeIndex( - ffi.Pointer index, -) { - return _clang_disposeIndex( - index, - ); + ffi.Pointer setter; } -final _dart_clang_disposeIndex _clang_disposeIndex = - _dylib.lookupFunction<_c_clang_disposeIndex, _dart_clang_disposeIndex>( - 'clang_disposeIndex'); - -typedef _c_clang_disposeIndex = ffi.Void Function( - ffi.Pointer index, -); +class CXIdxCXXClassDeclInfo extends ffi.Struct { + ffi.Pointer declInfo; -typedef _dart_clang_disposeIndex = void Function( - ffi.Pointer index, -); + ffi.Pointer> bases; -/// Free the set of overridden cursors returned by \c -/// clang_getOverriddenCursors(). -void clang_disposeOverriddenCursors( - ffi.Pointer overridden, -) { - return _clang_disposeOverriddenCursors( - overridden, - ); + @ffi.Uint32() + int numBases; } -final _dart_clang_disposeOverriddenCursors _clang_disposeOverriddenCursors = - _dylib.lookupFunction<_c_clang_disposeOverriddenCursors, - _dart_clang_disposeOverriddenCursors>('clang_disposeOverriddenCursors'); +/// Data for IndexerCallbacks#indexEntityReference. +class CXIdxEntityRefInfo extends ffi.Struct {} -typedef _c_clang_disposeOverriddenCursors = ffi.Void Function( - ffi.Pointer overridden, -); +/// 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. + ffi.Pointer> abortQuery; -typedef _dart_clang_disposeOverriddenCursors = void Function( - ffi.Pointer overridden, -); + /// Called at the end of indexing; passes the complete diagnostic set. + ffi.Pointer> diagnostic; -/// Destroy the given \c CXSourceRangeList. -void clang_disposeSourceRangeList( - ffi.Pointer ranges, -) { - return _clang_disposeSourceRangeList( - ranges, - ); -} + ffi.Pointer> enteredMainFile; -final _dart_clang_disposeSourceRangeList _clang_disposeSourceRangeList = - _dylib.lookupFunction<_c_clang_disposeSourceRangeList, - _dart_clang_disposeSourceRangeList>('clang_disposeSourceRangeList'); + /// Called when a file gets \#included/\#imported. + ffi.Pointer> ppIncludedFile; -typedef _c_clang_disposeSourceRangeList = ffi.Void Function( - ffi.Pointer ranges, -); + /// 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. + ffi.Pointer> importedASTFile; -typedef _dart_clang_disposeSourceRangeList = void Function( - ffi.Pointer ranges, -); + /// Called at the beginning of indexing a translation unit. + ffi.Pointer> startedTranslationUnit; -/// Free the given string set. -void clang_disposeStringSet( - ffi.Pointer set, -) { - return _clang_disposeStringSet( - set, - ); + ffi.Pointer> indexDeclaration; + + /// Called to index a reference of an entity. + ffi.Pointer> indexEntityReference; } -final _dart_clang_disposeStringSet _clang_disposeStringSet = _dylib - .lookupFunction<_c_clang_disposeStringSet, _dart_clang_disposeStringSet>( - 'clang_disposeStringSet'); - typedef _c_clang_disposeStringSet = ffi.Void Function( ffi.Pointer set, ); @@ -2438,1027 +3740,590 @@ typedef _dart_clang_disposeStringSet = void Function( ffi.Pointer set, ); -void clang_disposeString_wrap( - ffi.Pointer string, -) { - return _clang_disposeString_wrap( - string, - ); -} - -final _dart_clang_disposeString_wrap _clang_disposeString_wrap = - _dylib.lookupFunction<_c_clang_disposeString_wrap, - _dart_clang_disposeString_wrap>('clang_disposeString_wrap'); - -typedef _c_clang_disposeString_wrap = ffi.Void Function( - ffi.Pointer string, +typedef _c_clang_createIndex = ffi.Pointer Function( + ffi.Int32 excludeDeclarationsFromPCH, + ffi.Int32 displayDiagnostics, ); -typedef _dart_clang_disposeString_wrap = void Function( - ffi.Pointer string, +typedef _dart_clang_createIndex = ffi.Pointer Function( + int excludeDeclarationsFromPCH, + int displayDiagnostics, ); -/// Free the given set of tokens. -void clang_disposeTokens( - ffi.Pointer TU, - ffi.Pointer Tokens, - int NumTokens, -) { - return _clang_disposeTokens( - TU, - Tokens, - NumTokens, - ); -} - -final _dart_clang_disposeTokens _clang_disposeTokens = - _dylib.lookupFunction<_c_clang_disposeTokens, _dart_clang_disposeTokens>( - 'clang_disposeTokens'); - -typedef _c_clang_disposeTokens = ffi.Void Function( - ffi.Pointer TU, - ffi.Pointer Tokens, - ffi.Uint32 NumTokens, +typedef _c_clang_disposeIndex = ffi.Void Function( + ffi.Pointer index, ); -typedef _dart_clang_disposeTokens = void Function( - ffi.Pointer TU, - ffi.Pointer Tokens, - int NumTokens, +typedef _dart_clang_disposeIndex = void Function( + ffi.Pointer index, ); -/// Destroy the specified CXTranslationUnit object. -void clang_disposeTranslationUnit( - ffi.Pointer arg0, -) { - return _clang_disposeTranslationUnit( - arg0, - ); -} - -final _dart_clang_disposeTranslationUnit _clang_disposeTranslationUnit = - _dylib.lookupFunction<_c_clang_disposeTranslationUnit, - _dart_clang_disposeTranslationUnit>('clang_disposeTranslationUnit'); - -typedef _c_clang_disposeTranslationUnit = ffi.Void Function( - ffi.Pointer arg0, +typedef _c_clang_CXIndex_setGlobalOptions = ffi.Void Function( + ffi.Pointer arg0, + ffi.Uint32 options, ); -typedef _dart_clang_disposeTranslationUnit = void Function( - ffi.Pointer arg0, +typedef _dart_clang_CXIndex_setGlobalOptions = void Function( + ffi.Pointer arg0, + int options, ); -void clang_enableStackTraces() { - return _clang_enableStackTraces(); -} - -final _dart_clang_enableStackTraces _clang_enableStackTraces = _dylib - .lookupFunction<_c_clang_enableStackTraces, _dart_clang_enableStackTraces>( - 'clang_enableStackTraces'); - -typedef _c_clang_enableStackTraces = ffi.Void Function(); - -typedef _dart_clang_enableStackTraces = void Function(); - -/// Returns non-zero if the ranges are the same, zero if they differ. -int clang_equalRanges_wrap( - ffi.Pointer c1, - ffi.Pointer c2, -) { - return _clang_equalRanges_wrap( - c1, - c2, - ); -} - -final _dart_clang_equalRanges_wrap _clang_equalRanges_wrap = _dylib - .lookupFunction<_c_clang_equalRanges_wrap, _dart_clang_equalRanges_wrap>( - 'clang_equalRanges_wrap'); - -typedef _c_clang_equalRanges_wrap = ffi.Uint32 Function( - ffi.Pointer c1, - ffi.Pointer c2, +typedef _c_clang_CXIndex_getGlobalOptions = ffi.Uint32 Function( + ffi.Pointer arg0, ); -typedef _dart_clang_equalRanges_wrap = int Function( - ffi.Pointer c1, - ffi.Pointer c2, +typedef _dart_clang_CXIndex_getGlobalOptions = int Function( + ffi.Pointer arg0, ); -typedef _typedefC_1 = ffi.Void Function( - ffi.Pointer, +typedef _c_clang_CXIndex_setInvocationEmissionPathOption = ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer Path, ); -void clang_executeOnThread( - ffi.Pointer> fn, - ffi.Pointer user_data, - int stack_size, -) { - return _clang_executeOnThread( - fn, - user_data, - stack_size, - ); -} - -final _dart_clang_executeOnThread _clang_executeOnThread = _dylib - .lookupFunction<_c_clang_executeOnThread, _dart_clang_executeOnThread>( - 'clang_executeOnThread'); - -typedef _c_clang_executeOnThread = ffi.Void Function( - ffi.Pointer> fn, - ffi.Pointer user_data, - ffi.Uint32 stack_size, +typedef _dart_clang_CXIndex_setInvocationEmissionPathOption = void Function( + ffi.Pointer arg0, + ffi.Pointer Path, ); -typedef _dart_clang_executeOnThread = void Function( - ffi.Pointer> fn, - ffi.Pointer user_data, - int stack_size, +typedef _c_clang_getFileTime = ffi.Int64 Function( + ffi.Pointer SFile, ); -ffi.Pointer clang_formatDiagnostic_wrap( - ffi.Pointer diag, - int opts, -) { - return _clang_formatDiagnostic_wrap( - diag, - opts, - ); -} - -final _dart_clang_formatDiagnostic_wrap _clang_formatDiagnostic_wrap = - _dylib.lookupFunction<_c_clang_formatDiagnostic_wrap, - _dart_clang_formatDiagnostic_wrap>('clang_formatDiagnostic_wrap'); +typedef _dart_clang_getFileTime = int Function( + ffi.Pointer SFile, +); -typedef _c_clang_formatDiagnostic_wrap = ffi.Pointer Function( - ffi.Pointer diag, - ffi.Int32 opts, +typedef _c_clang_getFileUniqueID = ffi.Int32 Function( + ffi.Pointer file, + ffi.Pointer outID, ); -typedef _dart_clang_formatDiagnostic_wrap = ffi.Pointer Function( - ffi.Pointer diag, - int opts, +typedef _dart_clang_getFileUniqueID = int Function( + ffi.Pointer file, + ffi.Pointer outID, ); -/// Retrieve all ranges from all files that were skipped by the -/// preprocessor. -/// -/// The preprocessor will skip lines when they are surrounded by an -/// if/ifdef/ifndef directive whose condition does not evaluate to true. -ffi.Pointer clang_getAllSkippedRanges( +typedef _c_clang_isFileMultipleIncludeGuarded = ffi.Uint32 Function( ffi.Pointer tu, -) { - return _clang_getAllSkippedRanges( - tu, - ); -} - -final _dart_clang_getAllSkippedRanges _clang_getAllSkippedRanges = - _dylib.lookupFunction<_c_clang_getAllSkippedRanges, - _dart_clang_getAllSkippedRanges>('clang_getAllSkippedRanges'); + ffi.Pointer file, +); -typedef _c_clang_getAllSkippedRanges = ffi.Pointer Function( +typedef _dart_clang_isFileMultipleIncludeGuarded = int Function( ffi.Pointer tu, + ffi.Pointer file, ); -typedef _dart_clang_getAllSkippedRanges = ffi.Pointer - Function( +typedef _c_clang_getFile = ffi.Pointer Function( ffi.Pointer tu, + ffi.Pointer file_name, ); -ffi.Pointer clang_getArgType_wrap( - ffi.Pointer cxtype, - int i, -) { - return _clang_getArgType_wrap( - cxtype, - i, - ); -} - -final _dart_clang_getArgType_wrap _clang_getArgType_wrap = _dylib - .lookupFunction<_c_clang_getArgType_wrap, _dart_clang_getArgType_wrap>( - 'clang_getArgType_wrap'); - -typedef _c_clang_getArgType_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, - ffi.Uint32 i, +typedef _dart_clang_getFile = ffi.Pointer Function( + ffi.Pointer tu, + ffi.Pointer file_name, ); -typedef _dart_clang_getArgType_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, - int i, +typedef _c_clang_getFileContents = ffi.Pointer Function( + ffi.Pointer tu, + ffi.Pointer file, + ffi.Pointer size, ); -ffi.Pointer clang_getArrayElementType_wrap( - ffi.Pointer cxtype, -) { - return _clang_getArrayElementType_wrap( - cxtype, - ); -} - -final _dart_clang_getArrayElementType_wrap _clang_getArrayElementType_wrap = - _dylib.lookupFunction<_c_clang_getArrayElementType_wrap, - _dart_clang_getArrayElementType_wrap>('clang_getArrayElementType_wrap'); - -typedef _c_clang_getArrayElementType_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, +typedef _dart_clang_getFileContents = ffi.Pointer Function( + ffi.Pointer tu, + ffi.Pointer file, + ffi.Pointer size, ); -typedef _dart_clang_getArrayElementType_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, +typedef _c_clang_File_isEqual = ffi.Int32 Function( + ffi.Pointer file1, + ffi.Pointer file2, ); -ffi.Pointer clang_getCString_wrap( - ffi.Pointer string, -) { - return _clang_getCString_wrap( - string, - ); -} - -final _dart_clang_getCString_wrap _clang_getCString_wrap = _dylib - .lookupFunction<_c_clang_getCString_wrap, _dart_clang_getCString_wrap>( - 'clang_getCString_wrap'); - -typedef _c_clang_getCString_wrap = ffi.Pointer Function( - ffi.Pointer string, +typedef _dart_clang_File_isEqual = int Function( + ffi.Pointer file1, + ffi.Pointer file2, ); -typedef _dart_clang_getCString_wrap = ffi.Pointer Function( - ffi.Pointer string, +typedef _c_clang_getSkippedRanges = ffi.Pointer Function( + ffi.Pointer tu, + ffi.Pointer file, ); -ffi.Pointer clang_getCanonicalType_wrap( - ffi.Pointer typerefType, -) { - return _clang_getCanonicalType_wrap( - typerefType, - ); -} - -final _dart_clang_getCanonicalType_wrap _clang_getCanonicalType_wrap = - _dylib.lookupFunction<_c_clang_getCanonicalType_wrap, - _dart_clang_getCanonicalType_wrap>('clang_getCanonicalType_wrap'); - -typedef _c_clang_getCanonicalType_wrap = ffi.Pointer Function( - ffi.Pointer typerefType, +typedef _dart_clang_getSkippedRanges = ffi.Pointer Function( + ffi.Pointer tu, + ffi.Pointer file, ); -typedef _dart_clang_getCanonicalType_wrap = ffi.Pointer Function( - ffi.Pointer typerefType, +typedef _c_clang_getAllSkippedRanges = ffi.Pointer Function( + ffi.Pointer tu, ); -/// Retrieve the child diagnostics of a CXDiagnostic. -/// -/// This CXDiagnosticSet does not need to be released by -/// clang_disposeDiagnosticSet. -ffi.Pointer clang_getChildDiagnostics( - ffi.Pointer D, -) { - return _clang_getChildDiagnostics( - D, - ); -} - -final _dart_clang_getChildDiagnostics _clang_getChildDiagnostics = - _dylib.lookupFunction<_c_clang_getChildDiagnostics, - _dart_clang_getChildDiagnostics>('clang_getChildDiagnostics'); - -typedef _c_clang_getChildDiagnostics = ffi.Pointer Function( - ffi.Pointer D, +typedef _dart_clang_getAllSkippedRanges = ffi.Pointer + Function( + ffi.Pointer tu, ); -typedef _dart_clang_getChildDiagnostics = ffi.Pointer Function( - ffi.Pointer D, +typedef _c_clang_disposeSourceRangeList = ffi.Void Function( + ffi.Pointer ranges, ); -/// 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( - completion_string, - ); -} - -final _dart_clang_getCompletionAvailability _clang_getCompletionAvailability = - _dylib.lookupFunction<_c_clang_getCompletionAvailability, - _dart_clang_getCompletionAvailability>( - 'clang_getCompletionAvailability'); +typedef _dart_clang_disposeSourceRangeList = void Function( + ffi.Pointer ranges, +); -typedef _c_clang_getCompletionAvailability = ffi.Int32 Function( - ffi.Pointer completion_string, +typedef _c_clang_getNumDiagnosticsInSet = ffi.Uint32 Function( + ffi.Pointer Diags, ); -typedef _dart_clang_getCompletionAvailability = int Function( - ffi.Pointer completion_string, +typedef _dart_clang_getNumDiagnosticsInSet = int Function( + ffi.Pointer Diags, ); -/// 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( - completion_string, - chunk_number, - ); -} +typedef _c_clang_getDiagnosticInSet = ffi.Pointer Function( + ffi.Pointer Diags, + ffi.Uint32 Index, +); -final _dart_clang_getCompletionChunkCompletionString - _clang_getCompletionChunkCompletionString = _dylib.lookupFunction< - _c_clang_getCompletionChunkCompletionString, - _dart_clang_getCompletionChunkCompletionString>( - 'clang_getCompletionChunkCompletionString'); +typedef _dart_clang_getDiagnosticInSet = ffi.Pointer Function( + ffi.Pointer Diags, + int Index, +); -typedef _c_clang_getCompletionChunkCompletionString = ffi.Pointer - Function( - ffi.Pointer completion_string, - ffi.Uint32 chunk_number, +typedef _c_clang_loadDiagnostics = ffi.Pointer Function( + ffi.Pointer file, + ffi.Pointer error, + ffi.Pointer errorString, ); -typedef _dart_clang_getCompletionChunkCompletionString = ffi.Pointer - Function( - ffi.Pointer completion_string, - int chunk_number, +typedef _dart_clang_loadDiagnostics = ffi.Pointer Function( + ffi.Pointer file, + ffi.Pointer error, + ffi.Pointer errorString, ); -/// 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( - completion_string, - chunk_number, - ); -} +typedef _c_clang_disposeDiagnosticSet = ffi.Void Function( + ffi.Pointer Diags, +); -final _dart_clang_getCompletionChunkKind _clang_getCompletionChunkKind = - _dylib.lookupFunction<_c_clang_getCompletionChunkKind, - _dart_clang_getCompletionChunkKind>('clang_getCompletionChunkKind'); +typedef _dart_clang_disposeDiagnosticSet = void Function( + ffi.Pointer Diags, +); -typedef _c_clang_getCompletionChunkKind = ffi.Int32 Function( - ffi.Pointer completion_string, - ffi.Uint32 chunk_number, +typedef _c_clang_getChildDiagnostics = ffi.Pointer Function( + ffi.Pointer D, ); -typedef _dart_clang_getCompletionChunkKind = int Function( - ffi.Pointer completion_string, - int chunk_number, +typedef _dart_clang_getChildDiagnostics = ffi.Pointer Function( + ffi.Pointer D, ); -/// 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( - completion_string, - ); -} +typedef _c_clang_getNumDiagnostics = ffi.Uint32 Function( + ffi.Pointer Unit, +); -final _dart_clang_getCompletionNumAnnotations - _clang_getCompletionNumAnnotations = _dylib.lookupFunction< - _c_clang_getCompletionNumAnnotations, - _dart_clang_getCompletionNumAnnotations>( - 'clang_getCompletionNumAnnotations'); +typedef _dart_clang_getNumDiagnostics = int Function( + ffi.Pointer Unit, +); -typedef _c_clang_getCompletionNumAnnotations = ffi.Uint32 Function( - ffi.Pointer completion_string, +typedef _c_clang_getDiagnostic = ffi.Pointer Function( + ffi.Pointer Unit, + ffi.Uint32 Index, ); -typedef _dart_clang_getCompletionNumAnnotations = int Function( - ffi.Pointer completion_string, +typedef _dart_clang_getDiagnostic = ffi.Pointer Function( + ffi.Pointer Unit, + int Index, ); -/// 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( - results, - completion_index, - ); -} +typedef _c_clang_getDiagnosticSetFromTU = ffi.Pointer Function( + ffi.Pointer Unit, +); -final _dart_clang_getCompletionNumFixIts _clang_getCompletionNumFixIts = - _dylib.lookupFunction<_c_clang_getCompletionNumFixIts, - _dart_clang_getCompletionNumFixIts>('clang_getCompletionNumFixIts'); +typedef _dart_clang_getDiagnosticSetFromTU = ffi.Pointer Function( + ffi.Pointer Unit, +); -typedef _c_clang_getCompletionNumFixIts = ffi.Uint32 Function( - ffi.Pointer results, - ffi.Uint32 completion_index, +typedef _c_clang_disposeDiagnostic = ffi.Void Function( + ffi.Pointer Diagnostic, ); -typedef _dart_clang_getCompletionNumFixIts = int Function( - ffi.Pointer results, - int completion_index, +typedef _dart_clang_disposeDiagnostic = void Function( + ffi.Pointer Diagnostic, ); -/// 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( - completion_string, - ); -} +typedef _c_clang_defaultDiagnosticDisplayOptions = ffi.Uint32 Function(); -final _dart_clang_getCompletionPriority _clang_getCompletionPriority = - _dylib.lookupFunction<_c_clang_getCompletionPriority, - _dart_clang_getCompletionPriority>('clang_getCompletionPriority'); +typedef _dart_clang_defaultDiagnosticDisplayOptions = int Function(); -typedef _c_clang_getCompletionPriority = ffi.Uint32 Function( - ffi.Pointer completion_string, +typedef _c_clang_getDiagnosticSeverity = ffi.Int32 Function( + ffi.Pointer arg0, ); -typedef _dart_clang_getCompletionPriority = int Function( - ffi.Pointer completion_string, +typedef _dart_clang_getDiagnosticSeverity = int Function( + ffi.Pointer arg0, ); -ffi.Pointer clang_getCursorKindSpelling_wrap( - int kind, -) { - return _clang_getCursorKindSpelling_wrap( - kind, - ); -} - -final _dart_clang_getCursorKindSpelling_wrap _clang_getCursorKindSpelling_wrap = - _dylib.lookupFunction<_c_clang_getCursorKindSpelling_wrap, - _dart_clang_getCursorKindSpelling_wrap>( - 'clang_getCursorKindSpelling_wrap'); - -typedef _c_clang_getCursorKindSpelling_wrap = ffi.Pointer Function( - ffi.Int32 kind, +typedef _c_clang_getDiagnosticCategory = ffi.Uint32 Function( + ffi.Pointer arg0, ); -typedef _dart_clang_getCursorKindSpelling_wrap = ffi.Pointer Function( - int kind, +typedef _dart_clang_getDiagnosticCategory = int Function( + ffi.Pointer arg0, ); -int clang_getCursorKind_wrap( - ffi.Pointer cursor, -) { - return _clang_getCursorKind_wrap( - cursor, - ); -} +typedef _c_clang_getDiagnosticNumRanges = ffi.Uint32 Function( + ffi.Pointer arg0, +); -final _dart_clang_getCursorKind_wrap _clang_getCursorKind_wrap = - _dylib.lookupFunction<_c_clang_getCursorKind_wrap, - _dart_clang_getCursorKind_wrap>('clang_getCursorKind_wrap'); +typedef _dart_clang_getDiagnosticNumRanges = int Function( + ffi.Pointer arg0, +); -typedef _c_clang_getCursorKind_wrap = ffi.Int32 Function( - ffi.Pointer cursor, +typedef _c_clang_getDiagnosticNumFixIts = ffi.Uint32 Function( + ffi.Pointer Diagnostic, ); -typedef _dart_clang_getCursorKind_wrap = int Function( - ffi.Pointer cursor, +typedef _dart_clang_getDiagnosticNumFixIts = int Function( + ffi.Pointer Diagnostic, ); -ffi.Pointer clang_getCursorLocation_wrap( - ffi.Pointer cursor, -) { - return _clang_getCursorLocation_wrap( - cursor, - ); -} +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, +); -final _dart_clang_getCursorLocation_wrap _clang_getCursorLocation_wrap = - _dylib.lookupFunction<_c_clang_getCursorLocation_wrap, - _dart_clang_getCursorLocation_wrap>('clang_getCursorLocation_wrap'); +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_getCursorLocation_wrap = ffi.Pointer +typedef _c_clang_createTranslationUnit = ffi.Pointer Function( - ffi.Pointer cursor, + ffi.Pointer CIdx, + ffi.Pointer ast_filename, ); -typedef _dart_clang_getCursorLocation_wrap = ffi.Pointer +typedef _dart_clang_createTranslationUnit = ffi.Pointer Function( - ffi.Pointer cursor, + ffi.Pointer CIdx, + ffi.Pointer ast_filename, ); -/// The name of parameter, struct, typedef. -ffi.Pointer clang_getCursorSpelling_wrap( - ffi.Pointer cursor, -) { - return _clang_getCursorSpelling_wrap( - cursor, - ); -} - -final _dart_clang_getCursorSpelling_wrap _clang_getCursorSpelling_wrap = - _dylib.lookupFunction<_c_clang_getCursorSpelling_wrap, - _dart_clang_getCursorSpelling_wrap>('clang_getCursorSpelling_wrap'); - -typedef _c_clang_getCursorSpelling_wrap = ffi.Pointer Function( - ffi.Pointer cursor, +typedef _c_clang_createTranslationUnit2 = ffi.Int32 Function( + ffi.Pointer CIdx, + ffi.Pointer ast_filename, + ffi.Pointer> out_TU, ); -typedef _dart_clang_getCursorSpelling_wrap = ffi.Pointer Function( - ffi.Pointer cursor, +typedef _dart_clang_createTranslationUnit2 = int Function( + ffi.Pointer CIdx, + ffi.Pointer ast_filename, + ffi.Pointer> out_TU, ); -ffi.Pointer clang_getCursorType_wrap( - ffi.Pointer cursor, -) { - return _clang_getCursorType_wrap( - cursor, - ); -} +typedef _c_clang_defaultEditingTranslationUnitOptions = ffi.Uint32 Function(); -final _dart_clang_getCursorType_wrap _clang_getCursorType_wrap = - _dylib.lookupFunction<_c_clang_getCursorType_wrap, - _dart_clang_getCursorType_wrap>('clang_getCursorType_wrap'); +typedef _dart_clang_defaultEditingTranslationUnitOptions = int Function(); -typedef _c_clang_getCursorType_wrap = ffi.Pointer Function( - ffi.Pointer cursor, +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_getCursorType_wrap = ffi.Pointer Function( - ffi.Pointer cursor, +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, ); -/// Retrieve a diagnostic associated with the given translation unit. -/// -/// \param Unit the translation unit 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_getDiagnostic( - ffi.Pointer Unit, - int Index, -) { - return _clang_getDiagnostic( - Unit, - Index, - ); -} - -final _dart_clang_getDiagnostic _clang_getDiagnostic = - _dylib.lookupFunction<_c_clang_getDiagnostic, _dart_clang_getDiagnostic>( - 'clang_getDiagnostic'); - -typedef _c_clang_getDiagnostic = ffi.Pointer Function( - ffi.Pointer Unit, - ffi.Uint32 Index, +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_getDiagnostic = ffi.Pointer Function( - ffi.Pointer Unit, - int Index, +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, ); -/// Retrieve the category number for this diagnostic. -/// -/// Diagnostics can be categorized into groups along with other, related -/// diagnostics (e.g., diagnostics under the same warning flag). This routine -/// retrieves the category number for the given diagnostic. -/// -/// \returns The number of the category that contains this diagnostic, or zero -/// if this diagnostic is uncategorized. -int clang_getDiagnosticCategory( - ffi.Pointer arg0, -) { - return _clang_getDiagnosticCategory( - arg0, - ); -} - -final _dart_clang_getDiagnosticCategory _clang_getDiagnosticCategory = - _dylib.lookupFunction<_c_clang_getDiagnosticCategory, - _dart_clang_getDiagnosticCategory>('clang_getDiagnosticCategory'); +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 _c_clang_getDiagnosticCategory = ffi.Uint32 Function( - ffi.Pointer arg0, +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 _dart_clang_getDiagnosticCategory = int Function( - ffi.Pointer arg0, +typedef _c_clang_defaultSaveOptions = ffi.Uint32 Function( + ffi.Pointer TU, ); -/// Retrieve a diagnostic associated with the given CXDiagnosticSet. -/// -/// \param Diags the CXDiagnosticSet 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_getDiagnosticInSet( - ffi.Pointer Diags, - int Index, -) { - return _clang_getDiagnosticInSet( - Diags, - Index, - ); -} - -final _dart_clang_getDiagnosticInSet _clang_getDiagnosticInSet = - _dylib.lookupFunction<_c_clang_getDiagnosticInSet, - _dart_clang_getDiagnosticInSet>('clang_getDiagnosticInSet'); +typedef _dart_clang_defaultSaveOptions = int Function( + ffi.Pointer TU, +); -typedef _c_clang_getDiagnosticInSet = ffi.Pointer Function( - ffi.Pointer Diags, - ffi.Uint32 Index, +typedef _c_clang_saveTranslationUnit = ffi.Int32 Function( + ffi.Pointer TU, + ffi.Pointer FileName, + ffi.Uint32 options, ); -typedef _dart_clang_getDiagnosticInSet = ffi.Pointer Function( - ffi.Pointer Diags, - int Index, +typedef _dart_clang_saveTranslationUnit = int Function( + ffi.Pointer TU, + ffi.Pointer FileName, + int options, ); -/// Determine the number of fix-it hints associated with the -/// given diagnostic. -int clang_getDiagnosticNumFixIts( - ffi.Pointer Diagnostic, -) { - return _clang_getDiagnosticNumFixIts( - Diagnostic, - ); -} +typedef _c_clang_suspendTranslationUnit = ffi.Uint32 Function( + ffi.Pointer arg0, +); -final _dart_clang_getDiagnosticNumFixIts _clang_getDiagnosticNumFixIts = - _dylib.lookupFunction<_c_clang_getDiagnosticNumFixIts, - _dart_clang_getDiagnosticNumFixIts>('clang_getDiagnosticNumFixIts'); +typedef _dart_clang_suspendTranslationUnit = int Function( + ffi.Pointer arg0, +); -typedef _c_clang_getDiagnosticNumFixIts = ffi.Uint32 Function( - ffi.Pointer Diagnostic, +typedef _c_clang_disposeTranslationUnit = ffi.Void Function( + ffi.Pointer arg0, ); -typedef _dart_clang_getDiagnosticNumFixIts = int Function( - ffi.Pointer Diagnostic, +typedef _dart_clang_disposeTranslationUnit = void Function( + ffi.Pointer arg0, ); -/// Determine the number of source ranges associated with the given -/// diagnostic. -int clang_getDiagnosticNumRanges( - ffi.Pointer arg0, -) { - return _clang_getDiagnosticNumRanges( - arg0, - ); -} +typedef _c_clang_defaultReparseOptions = ffi.Uint32 Function( + ffi.Pointer TU, +); -final _dart_clang_getDiagnosticNumRanges _clang_getDiagnosticNumRanges = - _dylib.lookupFunction<_c_clang_getDiagnosticNumRanges, - _dart_clang_getDiagnosticNumRanges>('clang_getDiagnosticNumRanges'); +typedef _dart_clang_defaultReparseOptions = int Function( + ffi.Pointer TU, +); -typedef _c_clang_getDiagnosticNumRanges = ffi.Uint32 Function( - ffi.Pointer arg0, +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_getDiagnosticNumRanges = int Function( - ffi.Pointer arg0, +typedef _dart_clang_reparseTranslationUnit = int Function( + ffi.Pointer TU, + int num_unsaved_files, + ffi.Pointer unsaved_files, + int options, ); -/// Retrieve the complete set of diagnostics associated with a -/// translation unit. -/// -/// \param Unit the translation unit to query. -ffi.Pointer clang_getDiagnosticSetFromTU( - ffi.Pointer Unit, -) { - return _clang_getDiagnosticSetFromTU( - Unit, - ); -} +typedef _c_clang_getTUResourceUsageName = ffi.Pointer Function( + ffi.Int32 kind, +); -final _dart_clang_getDiagnosticSetFromTU _clang_getDiagnosticSetFromTU = - _dylib.lookupFunction<_c_clang_getDiagnosticSetFromTU, - _dart_clang_getDiagnosticSetFromTU>('clang_getDiagnosticSetFromTU'); +typedef _dart_clang_getTUResourceUsageName = ffi.Pointer Function( + int kind, +); -typedef _c_clang_getDiagnosticSetFromTU = ffi.Pointer Function( - ffi.Pointer Unit, +typedef _c_clang_getTranslationUnitTargetInfo = ffi.Pointer + Function( + ffi.Pointer CTUnit, ); -typedef _dart_clang_getDiagnosticSetFromTU = ffi.Pointer Function( - ffi.Pointer Unit, +typedef _dart_clang_getTranslationUnitTargetInfo = ffi.Pointer + Function( + ffi.Pointer CTUnit, ); -/// Determine the severity of the given diagnostic. -int clang_getDiagnosticSeverity( - ffi.Pointer arg0, -) { - return _clang_getDiagnosticSeverity( - arg0, - ); -} +typedef _c_clang_TargetInfo_dispose = ffi.Void Function( + ffi.Pointer Info, +); -final _dart_clang_getDiagnosticSeverity _clang_getDiagnosticSeverity = - _dylib.lookupFunction<_c_clang_getDiagnosticSeverity, - _dart_clang_getDiagnosticSeverity>('clang_getDiagnosticSeverity'); +typedef _dart_clang_TargetInfo_dispose = void Function( + ffi.Pointer Info, +); -typedef _c_clang_getDiagnosticSeverity = ffi.Int32 Function( - ffi.Pointer arg0, +typedef _c_clang_TargetInfo_getPointerWidth = ffi.Int32 Function( + ffi.Pointer Info, ); -typedef _dart_clang_getDiagnosticSeverity = int Function( - ffi.Pointer arg0, +typedef _dart_clang_TargetInfo_getPointerWidth = int Function( + ffi.Pointer Info, ); -int clang_getEnumConstantDeclValue_wrap( - ffi.Pointer cursor, -) { - return _clang_getEnumConstantDeclValue_wrap( - cursor, - ); -} +typedef _c_clang_isDeclaration = ffi.Uint32 Function( + ffi.Int32 arg0, +); -final _dart_clang_getEnumConstantDeclValue_wrap - _clang_getEnumConstantDeclValue_wrap = _dylib.lookupFunction< - _c_clang_getEnumConstantDeclValue_wrap, - _dart_clang_getEnumConstantDeclValue_wrap>( - 'clang_getEnumConstantDeclValue_wrap'); +typedef _dart_clang_isDeclaration = int Function( + int arg0, +); -typedef _c_clang_getEnumConstantDeclValue_wrap = ffi.Int64 Function( - ffi.Pointer cursor, +typedef _c_clang_isReference = ffi.Uint32 Function( + ffi.Int32 arg0, ); -typedef _dart_clang_getEnumConstantDeclValue_wrap = int Function( - ffi.Pointer cursor, +typedef _dart_clang_isReference = int Function( + int arg0, ); -/// Retrieve a file handle within the given translation unit. -/// -/// \param tu the translation unit -/// -/// \param file_name the name of the file. -/// -/// \returns the file handle for the named file in the translation unit \p tu, -/// or a NULL file handle if the file was not a part of this translation unit. -ffi.Pointer clang_getFile( - ffi.Pointer tu, - ffi.Pointer file_name, -) { - return _clang_getFile( - tu, - file_name, - ); -} +typedef _c_clang_isExpression = ffi.Uint32 Function( + ffi.Int32 arg0, +); -final _dart_clang_getFile _clang_getFile = _dylib - .lookupFunction<_c_clang_getFile, _dart_clang_getFile>('clang_getFile'); +typedef _dart_clang_isExpression = int Function( + int arg0, +); -typedef _c_clang_getFile = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file_name, +typedef _c_clang_isStatement = ffi.Uint32 Function( + ffi.Int32 arg0, ); -typedef _dart_clang_getFile = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file_name, +typedef _dart_clang_isStatement = int Function( + int arg0, ); -/// Retrieve the buffer associated with the given file. -/// -/// \param tu the translation unit -/// -/// \param file the file for which to retrieve the buffer. -/// -/// \param size [out] if non-NULL, will be set to the size of the buffer. -/// -/// \returns a pointer to the buffer in memory that holds the contents of -/// \p file, or a NULL pointer when the file is not loaded. -ffi.Pointer clang_getFileContents( - ffi.Pointer tu, - ffi.Pointer file, - ffi.Pointer size, -) { - return _clang_getFileContents( - tu, - file, - size, - ); -} +typedef _c_clang_isAttribute = ffi.Uint32 Function( + ffi.Int32 arg0, +); -final _dart_clang_getFileContents _clang_getFileContents = _dylib - .lookupFunction<_c_clang_getFileContents, _dart_clang_getFileContents>( - 'clang_getFileContents'); +typedef _dart_clang_isAttribute = int Function( + int arg0, +); -typedef _c_clang_getFileContents = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file, - ffi.Pointer size, +typedef _c_clang_isInvalid = ffi.Uint32 Function( + ffi.Int32 arg0, ); -typedef _dart_clang_getFileContents = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file, - ffi.Pointer size, +typedef _dart_clang_isInvalid = int Function( + int arg0, ); -void clang_getFileLocation_wrap( - ffi.Pointer location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -) { - return _clang_getFileLocation_wrap( - location, - file, - line, - column, - offset, - ); -} +typedef _c_clang_isTranslationUnit = ffi.Uint32 Function( + ffi.Int32 arg0, +); -final _dart_clang_getFileLocation_wrap _clang_getFileLocation_wrap = - _dylib.lookupFunction<_c_clang_getFileLocation_wrap, - _dart_clang_getFileLocation_wrap>('clang_getFileLocation_wrap'); +typedef _dart_clang_isTranslationUnit = int Function( + int arg0, +); -typedef _c_clang_getFileLocation_wrap = ffi.Void Function( - ffi.Pointer location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, +typedef _c_clang_isPreprocessing = ffi.Uint32 Function( + ffi.Int32 arg0, ); -typedef _dart_clang_getFileLocation_wrap = void Function( - ffi.Pointer location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, +typedef _dart_clang_isPreprocessing = int Function( + int arg0, ); -ffi.Pointer clang_getFileName_wrap( - ffi.Pointer SFile, -) { - return _clang_getFileName_wrap( - SFile, - ); -} +typedef _c_clang_isUnexposed = ffi.Uint32 Function( + ffi.Int32 arg0, +); -final _dart_clang_getFileName_wrap _clang_getFileName_wrap = _dylib - .lookupFunction<_c_clang_getFileName_wrap, _dart_clang_getFileName_wrap>( - 'clang_getFileName_wrap'); +typedef _dart_clang_isUnexposed = int Function( + int arg0, +); -typedef _c_clang_getFileName_wrap = ffi.Pointer Function( - ffi.Pointer SFile, +typedef _c_clang_disposeCXPlatformAvailability = ffi.Void Function( + ffi.Pointer availability, ); -typedef _dart_clang_getFileName_wrap = ffi.Pointer Function( - ffi.Pointer SFile, +typedef _dart_clang_disposeCXPlatformAvailability = void Function( + ffi.Pointer availability, ); -/// Retrieve the last modification time of the given file. -int clang_getFileTime( - ffi.Pointer SFile, -) { - return _clang_getFileTime( - SFile, - ); -} +typedef _c_clang_createCXCursorSet = ffi.Pointer Function(); -final _dart_clang_getFileTime _clang_getFileTime = - _dylib.lookupFunction<_c_clang_getFileTime, _dart_clang_getFileTime>( - 'clang_getFileTime'); +typedef _dart_clang_createCXCursorSet = ffi.Pointer Function(); -typedef _c_clang_getFileTime = ffi.Int64 Function( - ffi.Pointer SFile, +typedef _c_clang_disposeCXCursorSet = ffi.Void Function( + ffi.Pointer cset, ); -typedef _dart_clang_getFileTime = int Function( - ffi.Pointer SFile, +typedef _dart_clang_disposeCXCursorSet = void Function( + ffi.Pointer cset, ); -/// Retrieve the unique ID for the given \c file. -/// -/// \param file the file to get the ID for. -/// \param outID stores the returned CXFileUniqueID. -/// \returns If there was a failure getting the unique ID, returns non-zero, -/// otherwise returns 0. -int clang_getFileUniqueID( - ffi.Pointer file, - ffi.Pointer outID, -) { - return _clang_getFileUniqueID( - file, - outID, - ); -} - -final _dart_clang_getFileUniqueID _clang_getFileUniqueID = _dylib - .lookupFunction<_c_clang_getFileUniqueID, _dart_clang_getFileUniqueID>( - 'clang_getFileUniqueID'); - -typedef _c_clang_getFileUniqueID = ffi.Int32 Function( - ffi.Pointer file, - ffi.Pointer outID, +typedef _c_clang_disposeOverriddenCursors = ffi.Void Function( + ffi.Pointer overridden, ); -typedef _dart_clang_getFileUniqueID = int Function( - ffi.Pointer file, - ffi.Pointer outID, +typedef _dart_clang_disposeOverriddenCursors = void Function( + ffi.Pointer overridden, ); -typedef CXInclusionVisitor_1 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Uint32, - ffi.Pointer, +typedef _c_clang_PrintingPolicy_getProperty = ffi.Uint32 Function( + ffi.Pointer Policy, + ffi.Int32 Property, ); -/// 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( - tu, - visitor, - client_data, - ); -} - -final _dart_clang_getInclusions _clang_getInclusions = - _dylib.lookupFunction<_c_clang_getInclusions, _dart_clang_getInclusions>( - 'clang_getInclusions'); +typedef _dart_clang_PrintingPolicy_getProperty = int Function( + ffi.Pointer Policy, + int Property, +); -typedef _c_clang_getInclusions = ffi.Void Function( - ffi.Pointer tu, - ffi.Pointer> visitor, - ffi.Pointer client_data, +typedef _c_clang_PrintingPolicy_setProperty = ffi.Void Function( + ffi.Pointer Policy, + ffi.Int32 Property, + ffi.Uint32 Value, ); -typedef _dart_clang_getInclusions = void Function( - ffi.Pointer tu, - ffi.Pointer> visitor, - ffi.Pointer client_data, +typedef _dart_clang_PrintingPolicy_setProperty = void Function( + ffi.Pointer Policy, + int Property, + int Value, ); -/// 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( - arg0, - arg1, - ); -} +typedef _c_clang_PrintingPolicy_dispose = ffi.Void Function( + ffi.Pointer Policy, +); -final _dart_clang_getModuleForFile _clang_getModuleForFile = _dylib - .lookupFunction<_c_clang_getModuleForFile, _dart_clang_getModuleForFile>( - 'clang_getModuleForFile'); +typedef _dart_clang_PrintingPolicy_dispose = void Function( + ffi.Pointer Policy, +); typedef _c_clang_getModuleForFile = ffi.Pointer Function( ffi.Pointer arg0, @@ -3470,729 +4335,387 @@ typedef _dart_clang_getModuleForFile = ffi.Pointer Function( ffi.Pointer arg1, ); -int clang_getNumArgTypes_wrap( - ffi.Pointer cxtype, -) { - return _clang_getNumArgTypes_wrap( - cxtype, - ); -} - -final _dart_clang_getNumArgTypes_wrap _clang_getNumArgTypes_wrap = - _dylib.lookupFunction<_c_clang_getNumArgTypes_wrap, - _dart_clang_getNumArgTypes_wrap>('clang_getNumArgTypes_wrap'); - -typedef _c_clang_getNumArgTypes_wrap = ffi.Int32 Function( - ffi.Pointer cxtype, +typedef _c_clang_Module_getASTFile = ffi.Pointer Function( + ffi.Pointer Module, ); -typedef _dart_clang_getNumArgTypes_wrap = int Function( - ffi.Pointer cxtype, +typedef _dart_clang_Module_getASTFile = ffi.Pointer Function( + ffi.Pointer Module, ); -/// Retrieve the number of chunks in the given code-completion string. -int clang_getNumCompletionChunks( - ffi.Pointer completion_string, -) { - return _clang_getNumCompletionChunks( - completion_string, - ); -} - -final _dart_clang_getNumCompletionChunks _clang_getNumCompletionChunks = - _dylib.lookupFunction<_c_clang_getNumCompletionChunks, - _dart_clang_getNumCompletionChunks>('clang_getNumCompletionChunks'); - -typedef _c_clang_getNumCompletionChunks = ffi.Uint32 Function( - ffi.Pointer completion_string, +typedef _c_clang_Module_getParent = ffi.Pointer Function( + ffi.Pointer Module, ); -typedef _dart_clang_getNumCompletionChunks = int Function( - ffi.Pointer completion_string, +typedef _dart_clang_Module_getParent = ffi.Pointer Function( + ffi.Pointer Module, ); -/// Determine the number of diagnostics produced for the given -/// translation unit. -int clang_getNumDiagnostics( - ffi.Pointer Unit, -) { - return _clang_getNumDiagnostics( - Unit, - ); -} - -final _dart_clang_getNumDiagnostics _clang_getNumDiagnostics = _dylib - .lookupFunction<_c_clang_getNumDiagnostics, _dart_clang_getNumDiagnostics>( - 'clang_getNumDiagnostics'); - -typedef _c_clang_getNumDiagnostics = ffi.Uint32 Function( - ffi.Pointer Unit, +typedef _c_clang_Module_isSystem = ffi.Int32 Function( + ffi.Pointer Module, ); -typedef _dart_clang_getNumDiagnostics = int Function( - ffi.Pointer Unit, +typedef _dart_clang_Module_isSystem = int Function( + ffi.Pointer Module, ); -/// Determine the number of diagnostics in a CXDiagnosticSet. -int clang_getNumDiagnosticsInSet( - ffi.Pointer Diags, -) { - return _clang_getNumDiagnosticsInSet( - Diags, - ); -} - -final _dart_clang_getNumDiagnosticsInSet _clang_getNumDiagnosticsInSet = - _dylib.lookupFunction<_c_clang_getNumDiagnosticsInSet, - _dart_clang_getNumDiagnosticsInSet>('clang_getNumDiagnosticsInSet'); - -typedef _c_clang_getNumDiagnosticsInSet = ffi.Uint32 Function( - ffi.Pointer Diags, +typedef _c_clang_Module_getNumTopLevelHeaders = ffi.Uint32 Function( + ffi.Pointer arg0, + ffi.Pointer Module, ); -typedef _dart_clang_getNumDiagnosticsInSet = int Function( - ffi.Pointer Diags, +typedef _dart_clang_Module_getNumTopLevelHeaders = int Function( + ffi.Pointer arg0, + ffi.Pointer Module, ); -int clang_getNumElements_wrap( - ffi.Pointer cxtype, -) { - return _clang_getNumElements_wrap( - cxtype, - ); -} - -final _dart_clang_getNumElements_wrap _clang_getNumElements_wrap = - _dylib.lookupFunction<_c_clang_getNumElements_wrap, - _dart_clang_getNumElements_wrap>('clang_getNumElements_wrap'); - -typedef _c_clang_getNumElements_wrap = ffi.Uint64 Function( - ffi.Pointer cxtype, +typedef _c_clang_Module_getTopLevelHeader = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer Module, + ffi.Uint32 Index, ); -typedef _dart_clang_getNumElements_wrap = int Function( - ffi.Pointer cxtype, +typedef _dart_clang_Module_getTopLevelHeader = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer Module, + int Index, ); -ffi.Pointer clang_getPointeeType_wrap( - ffi.Pointer pointerType, -) { - return _clang_getPointeeType_wrap( - pointerType, - ); -} - -final _dart_clang_getPointeeType_wrap _clang_getPointeeType_wrap = - _dylib.lookupFunction<_c_clang_getPointeeType_wrap, - _dart_clang_getPointeeType_wrap>('clang_getPointeeType_wrap'); - -typedef _c_clang_getPointeeType_wrap = ffi.Pointer Function( - ffi.Pointer pointerType, +typedef _c_clang_annotateTokens = ffi.Void Function( + ffi.Pointer TU, + ffi.Pointer Tokens, + ffi.Uint32 NumTokens, + ffi.Pointer Cursors, ); -typedef _dart_clang_getPointeeType_wrap = ffi.Pointer Function( - ffi.Pointer pointerType, +typedef _dart_clang_annotateTokens = void Function( + ffi.Pointer TU, + ffi.Pointer Tokens, + int NumTokens, + ffi.Pointer Cursors, ); -/// 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( - path, - ); -} - -final _dart_clang_getRemappings _clang_getRemappings = - _dylib.lookupFunction<_c_clang_getRemappings, _dart_clang_getRemappings>( - 'clang_getRemappings'); - -typedef _c_clang_getRemappings = ffi.Pointer Function( - ffi.Pointer path, +typedef _c_clang_disposeTokens = ffi.Void Function( + ffi.Pointer TU, + ffi.Pointer Tokens, + ffi.Uint32 NumTokens, ); -typedef _dart_clang_getRemappings = ffi.Pointer Function( - ffi.Pointer path, +typedef _dart_clang_disposeTokens = void Function( + ffi.Pointer TU, + ffi.Pointer Tokens, + int NumTokens, ); -/// 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( - filePaths, - numFiles, - ); -} +typedef _c_clang_enableStackTraces = ffi.Void Function(); -final _dart_clang_getRemappingsFromFileList _clang_getRemappingsFromFileList = - _dylib.lookupFunction<_c_clang_getRemappingsFromFileList, - _dart_clang_getRemappingsFromFileList>( - 'clang_getRemappingsFromFileList'); +typedef _dart_clang_enableStackTraces = void Function(); -typedef _c_clang_getRemappingsFromFileList = ffi.Pointer Function( - ffi.Pointer> filePaths, - ffi.Uint32 numFiles, +typedef _typedefC_1 = ffi.Void Function( + ffi.Pointer, ); -typedef _dart_clang_getRemappingsFromFileList = ffi.Pointer Function( - ffi.Pointer> filePaths, - int numFiles, +typedef _c_clang_executeOnThread = ffi.Void Function( + ffi.Pointer> fn, + ffi.Pointer user_data, + ffi.Uint32 stack_size, ); -ffi.Pointer clang_getResultType_wrap( - ffi.Pointer functionType, -) { - return _clang_getResultType_wrap( - functionType, - ); -} - -final _dart_clang_getResultType_wrap _clang_getResultType_wrap = - _dylib.lookupFunction<_c_clang_getResultType_wrap, - _dart_clang_getResultType_wrap>('clang_getResultType_wrap'); +typedef _dart_clang_executeOnThread = void Function( + ffi.Pointer> fn, + ffi.Pointer user_data, + int stack_size, +); -typedef _c_clang_getResultType_wrap = ffi.Pointer Function( - ffi.Pointer functionType, +typedef _c_clang_getCompletionChunkKind = ffi.Int32 Function( + ffi.Pointer completion_string, + ffi.Uint32 chunk_number, ); -typedef _dart_clang_getResultType_wrap = ffi.Pointer Function( - ffi.Pointer functionType, +typedef _dart_clang_getCompletionChunkKind = int Function( + ffi.Pointer completion_string, + int chunk_number, ); -/// Retrieve all ranges that were skipped by the preprocessor. -/// -/// The preprocessor will skip lines when they are surrounded by an -/// if/ifdef/ifndef directive whose condition does not evaluate to true. -ffi.Pointer clang_getSkippedRanges( - ffi.Pointer tu, - ffi.Pointer file, -) { - return _clang_getSkippedRanges( - tu, - file, - ); -} +typedef _c_clang_getCompletionChunkCompletionString = ffi.Pointer + Function( + ffi.Pointer completion_string, + ffi.Uint32 chunk_number, +); -final _dart_clang_getSkippedRanges _clang_getSkippedRanges = _dylib - .lookupFunction<_c_clang_getSkippedRanges, _dart_clang_getSkippedRanges>( - 'clang_getSkippedRanges'); +typedef _dart_clang_getCompletionChunkCompletionString = ffi.Pointer + Function( + ffi.Pointer completion_string, + int chunk_number, +); -typedef _c_clang_getSkippedRanges = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file, +typedef _c_clang_getNumCompletionChunks = ffi.Uint32 Function( + ffi.Pointer completion_string, ); -typedef _dart_clang_getSkippedRanges = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file, +typedef _dart_clang_getNumCompletionChunks = int Function( + ffi.Pointer completion_string, ); -/// Returns the human-readable null-terminated C string that represents -/// the name of the memory category. This string should never be freed. -ffi.Pointer clang_getTUResourceUsageName( - int kind, -) { - return _clang_getTUResourceUsageName( - kind, - ); -} +typedef _c_clang_getCompletionPriority = ffi.Uint32 Function( + ffi.Pointer completion_string, +); -final _dart_clang_getTUResourceUsageName _clang_getTUResourceUsageName = - _dylib.lookupFunction<_c_clang_getTUResourceUsageName, - _dart_clang_getTUResourceUsageName>('clang_getTUResourceUsageName'); +typedef _dart_clang_getCompletionPriority = int Function( + ffi.Pointer completion_string, +); -typedef _c_clang_getTUResourceUsageName = ffi.Pointer Function( - ffi.Int32 kind, +typedef _c_clang_getCompletionAvailability = ffi.Int32 Function( + ffi.Pointer completion_string, ); -typedef _dart_clang_getTUResourceUsageName = ffi.Pointer Function( - int kind, +typedef _dart_clang_getCompletionAvailability = int Function( + ffi.Pointer completion_string, ); -ffi.Pointer clang_getTranslationUnitCursor_wrap( - ffi.Pointer tu, -) { - return _clang_getTranslationUnitCursor_wrap( - tu, - ); -} +typedef _c_clang_getCompletionNumAnnotations = ffi.Uint32 Function( + ffi.Pointer completion_string, +); -final _dart_clang_getTranslationUnitCursor_wrap - _clang_getTranslationUnitCursor_wrap = _dylib.lookupFunction< - _c_clang_getTranslationUnitCursor_wrap, - _dart_clang_getTranslationUnitCursor_wrap>( - 'clang_getTranslationUnitCursor_wrap'); +typedef _dart_clang_getCompletionNumAnnotations = int Function( + ffi.Pointer completion_string, +); -typedef _c_clang_getTranslationUnitCursor_wrap = ffi.Pointer Function( - ffi.Pointer tu, +typedef _c_clang_getCompletionNumFixIts = ffi.Uint32 Function( + ffi.Pointer results, + ffi.Uint32 completion_index, ); -typedef _dart_clang_getTranslationUnitCursor_wrap = ffi.Pointer - Function( - ffi.Pointer tu, +typedef _dart_clang_getCompletionNumFixIts = int Function( + ffi.Pointer results, + int completion_index, ); -/// Get target information for this translation unit. -/// -/// The CXTargetInfo object cannot outlive the CXTranslationUnit object. -ffi.Pointer clang_getTranslationUnitTargetInfo( - ffi.Pointer CTUnit, -) { - return _clang_getTranslationUnitTargetInfo( - CTUnit, - ); -} +typedef _c_clang_defaultCodeCompleteOptions = ffi.Uint32 Function(); -final _dart_clang_getTranslationUnitTargetInfo - _clang_getTranslationUnitTargetInfo = _dylib.lookupFunction< - _c_clang_getTranslationUnitTargetInfo, - _dart_clang_getTranslationUnitTargetInfo>( - 'clang_getTranslationUnitTargetInfo'); +typedef _dart_clang_defaultCodeCompleteOptions = int Function(); -typedef _c_clang_getTranslationUnitTargetInfo = ffi.Pointer - Function( - ffi.Pointer CTUnit, +typedef _c_clang_codeCompleteAt = ffi.Pointer Function( + ffi.Pointer TU, + ffi.Pointer complete_filename, + ffi.Uint32 complete_line, + ffi.Uint32 complete_column, + ffi.Pointer unsaved_files, + ffi.Uint32 num_unsaved_files, + ffi.Uint32 options, ); -typedef _dart_clang_getTranslationUnitTargetInfo = ffi.Pointer +typedef _dart_clang_codeCompleteAt = ffi.Pointer Function( - ffi.Pointer CTUnit, + ffi.Pointer TU, + ffi.Pointer complete_filename, + int complete_line, + int complete_column, + ffi.Pointer unsaved_files, + int num_unsaved_files, + int options, ); -ffi.Pointer clang_getTypeDeclaration_wrap( - ffi.Pointer cxtype, -) { - return _clang_getTypeDeclaration_wrap( - cxtype, - ); -} - -final _dart_clang_getTypeDeclaration_wrap _clang_getTypeDeclaration_wrap = - _dylib.lookupFunction<_c_clang_getTypeDeclaration_wrap, - _dart_clang_getTypeDeclaration_wrap>('clang_getTypeDeclaration_wrap'); - -typedef _c_clang_getTypeDeclaration_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, +typedef _c_clang_sortCodeCompletionResults = ffi.Void Function( + ffi.Pointer Results, + ffi.Uint32 NumResults, ); -typedef _dart_clang_getTypeDeclaration_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, +typedef _dart_clang_sortCodeCompletionResults = void Function( + ffi.Pointer Results, + int NumResults, ); -ffi.Pointer clang_getTypeKindSpelling_wrap( - int typeKind, -) { - return _clang_getTypeKindSpelling_wrap( - typeKind, - ); -} - -final _dart_clang_getTypeKindSpelling_wrap _clang_getTypeKindSpelling_wrap = - _dylib.lookupFunction<_c_clang_getTypeKindSpelling_wrap, - _dart_clang_getTypeKindSpelling_wrap>('clang_getTypeKindSpelling_wrap'); - -typedef _c_clang_getTypeKindSpelling_wrap = ffi.Pointer Function( - ffi.Int32 typeKind, +typedef _c_clang_disposeCodeCompleteResults = ffi.Void Function( + ffi.Pointer Results, ); -typedef _dart_clang_getTypeKindSpelling_wrap = ffi.Pointer Function( - int typeKind, +typedef _dart_clang_disposeCodeCompleteResults = void Function( + ffi.Pointer Results, ); -ffi.Pointer clang_getTypeSpelling_wrap( - ffi.Pointer type, -) { - return _clang_getTypeSpelling_wrap( - type, - ); -} - -final _dart_clang_getTypeSpelling_wrap _clang_getTypeSpelling_wrap = - _dylib.lookupFunction<_c_clang_getTypeSpelling_wrap, - _dart_clang_getTypeSpelling_wrap>('clang_getTypeSpelling_wrap'); +typedef _c_clang_codeCompleteGetNumDiagnostics = ffi.Uint32 Function( + ffi.Pointer Results, +); -typedef _c_clang_getTypeSpelling_wrap = ffi.Pointer Function( - ffi.Pointer type, +typedef _dart_clang_codeCompleteGetNumDiagnostics = int Function( + ffi.Pointer Results, ); -typedef _dart_clang_getTypeSpelling_wrap = ffi.Pointer Function( - ffi.Pointer type, +typedef _c_clang_codeCompleteGetDiagnostic = ffi.Pointer Function( + ffi.Pointer Results, + ffi.Uint32 Index, ); -ffi.Pointer clang_getTypedefDeclUnderlyingType_wrap( - ffi.Pointer cxcursor, -) { - return _clang_getTypedefDeclUnderlyingType_wrap( - cxcursor, - ); -} +typedef _dart_clang_codeCompleteGetDiagnostic = ffi.Pointer Function( + ffi.Pointer Results, + int Index, +); -final _dart_clang_getTypedefDeclUnderlyingType_wrap - _clang_getTypedefDeclUnderlyingType_wrap = _dylib.lookupFunction< - _c_clang_getTypedefDeclUnderlyingType_wrap, - _dart_clang_getTypedefDeclUnderlyingType_wrap>( - 'clang_getTypedefDeclUnderlyingType_wrap'); +typedef _c_clang_codeCompleteGetContexts = ffi.Uint64 Function( + ffi.Pointer Results, +); -typedef _c_clang_getTypedefDeclUnderlyingType_wrap = ffi.Pointer - Function( - ffi.Pointer cxcursor, +typedef _dart_clang_codeCompleteGetContexts = int Function( + ffi.Pointer Results, ); -typedef _dart_clang_getTypedefDeclUnderlyingType_wrap = ffi.Pointer - Function( - ffi.Pointer cxcursor, +typedef _c_clang_codeCompleteGetContainerKind = ffi.Int32 Function( + ffi.Pointer Results, + ffi.Pointer IsIncomplete, ); -/// 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( - 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, - ); -} +typedef _dart_clang_codeCompleteGetContainerKind = int Function( + ffi.Pointer Results, + ffi.Pointer IsIncomplete, +); -final _dart_clang_indexSourceFile _clang_indexSourceFile = _dylib - .lookupFunction<_c_clang_indexSourceFile, _dart_clang_indexSourceFile>( - 'clang_indexSourceFile'); +typedef _c_clang_toggleCrashRecovery = ffi.Void Function( + ffi.Uint32 isEnabled, +); -typedef _c_clang_indexSourceFile = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - ffi.Uint32 index_callbacks_size, - ffi.Uint32 index_options, - 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.Pointer> out_TU, - ffi.Uint32 TU_options, +typedef _dart_clang_toggleCrashRecovery = void Function( + int isEnabled, ); -typedef _dart_clang_indexSourceFile = int Function( - 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, +typedef CXInclusionVisitor_1 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Uint32, + ffi.Pointer, ); -/// 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, +typedef _c_clang_getInclusions = ffi.Void Function( + ffi.Pointer tu, + 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_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, - ); -} - -final _dart_clang_indexSourceFileFullArgv _clang_indexSourceFileFullArgv = - _dylib.lookupFunction<_c_clang_indexSourceFileFullArgv, - _dart_clang_indexSourceFileFullArgv>('clang_indexSourceFileFullArgv'); +); -typedef _c_clang_indexSourceFileFullArgv = ffi.Int32 Function( - ffi.Pointer arg0, +typedef _dart_clang_getInclusions = void Function( + ffi.Pointer tu, + ffi.Pointer> visitor, ffi.Pointer client_data, - ffi.Pointer index_callbacks, - ffi.Uint32 index_callbacks_size, - ffi.Uint32 index_options, - 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.Pointer> out_TU, - ffi.Uint32 TU_options, ); -typedef _dart_clang_indexSourceFileFullArgv = int Function( - 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, +typedef _c_clang_EvalResult_getKind = ffi.Int32 Function( + ffi.Pointer E, ); -/// 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( - arg0, - client_data, - index_callbacks, - index_callbacks_size, - index_options, - arg5, - ); -} +typedef _dart_clang_EvalResult_getKind = int Function( + ffi.Pointer E, +); -final _dart_clang_indexTranslationUnit _clang_indexTranslationUnit = - _dylib.lookupFunction<_c_clang_indexTranslationUnit, - _dart_clang_indexTranslationUnit>('clang_indexTranslationUnit'); +typedef _c_clang_EvalResult_getAsInt = ffi.Int32 Function( + ffi.Pointer E, +); -typedef _c_clang_indexTranslationUnit = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - ffi.Uint32 index_callbacks_size, - ffi.Uint32 index_options, - ffi.Pointer arg5, +typedef _dart_clang_EvalResult_getAsInt = int Function( + ffi.Pointer E, ); -typedef _dart_clang_indexTranslationUnit = int Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - int index_callbacks_size, - int index_options, - ffi.Pointer arg5, +typedef _c_clang_EvalResult_getAsLongLong = ffi.Int64 Function( + ffi.Pointer E, ); -ffi.Pointer clang_index_getCXXClassDeclInfo( - ffi.Pointer arg0, -) { - return _clang_index_getCXXClassDeclInfo( - arg0, - ); -} +typedef _dart_clang_EvalResult_getAsLongLong = int Function( + ffi.Pointer E, +); -final _dart_clang_index_getCXXClassDeclInfo _clang_index_getCXXClassDeclInfo = - _dylib.lookupFunction<_c_clang_index_getCXXClassDeclInfo, - _dart_clang_index_getCXXClassDeclInfo>( - 'clang_index_getCXXClassDeclInfo'); +typedef _c_clang_EvalResult_isUnsignedInt = ffi.Uint32 Function( + ffi.Pointer E, +); -typedef _c_clang_index_getCXXClassDeclInfo = ffi.Pointer - Function( - ffi.Pointer arg0, +typedef _dart_clang_EvalResult_isUnsignedInt = int Function( + ffi.Pointer E, ); -typedef _dart_clang_index_getCXXClassDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, +typedef _c_clang_EvalResult_getAsUnsigned = ffi.Uint64 Function( + ffi.Pointer E, ); -/// For retrieving a custom CXIdxClientContainer attached to a -/// container. -ffi.Pointer clang_index_getClientContainer( - ffi.Pointer arg0, -) { - return _clang_index_getClientContainer( - arg0, - ); -} +typedef _dart_clang_EvalResult_getAsUnsigned = int Function( + ffi.Pointer E, +); -final _dart_clang_index_getClientContainer _clang_index_getClientContainer = - _dylib.lookupFunction<_c_clang_index_getClientContainer, - _dart_clang_index_getClientContainer>('clang_index_getClientContainer'); +typedef _c_clang_EvalResult_getAsDouble = ffi.Double Function( + ffi.Pointer E, +); -typedef _c_clang_index_getClientContainer = ffi.Pointer Function( - ffi.Pointer arg0, +typedef _dart_clang_EvalResult_getAsDouble = double Function( + ffi.Pointer E, +); + +typedef _c_clang_EvalResult_getAsStr = ffi.Pointer Function( + ffi.Pointer E, ); -typedef _dart_clang_index_getClientContainer = ffi.Pointer Function( - ffi.Pointer arg0, +typedef _dart_clang_EvalResult_getAsStr = ffi.Pointer Function( + ffi.Pointer E, ); -/// For retrieving a custom CXIdxClientEntity attached to an entity. -ffi.Pointer clang_index_getClientEntity( - ffi.Pointer arg0, -) { - return _clang_index_getClientEntity( - arg0, - ); -} +typedef _c_clang_EvalResult_dispose = ffi.Void Function( + ffi.Pointer E, +); -final _dart_clang_index_getClientEntity _clang_index_getClientEntity = - _dylib.lookupFunction<_c_clang_index_getClientEntity, - _dart_clang_index_getClientEntity>('clang_index_getClientEntity'); +typedef _dart_clang_EvalResult_dispose = void Function( + ffi.Pointer E, +); -typedef _c_clang_index_getClientEntity = ffi.Pointer Function( - ffi.Pointer arg0, +typedef _c_clang_getRemappings = ffi.Pointer Function( + ffi.Pointer path, ); -typedef _dart_clang_index_getClientEntity = ffi.Pointer Function( - ffi.Pointer arg0, +typedef _dart_clang_getRemappings = ffi.Pointer Function( + ffi.Pointer path, ); -ffi.Pointer - clang_index_getIBOutletCollectionAttrInfo( - ffi.Pointer arg0, -) { - return _clang_index_getIBOutletCollectionAttrInfo( - arg0, - ); -} +typedef _c_clang_getRemappingsFromFileList = ffi.Pointer Function( + ffi.Pointer> filePaths, + ffi.Uint32 numFiles, +); -final _dart_clang_index_getIBOutletCollectionAttrInfo - _clang_index_getIBOutletCollectionAttrInfo = _dylib.lookupFunction< - _c_clang_index_getIBOutletCollectionAttrInfo, - _dart_clang_index_getIBOutletCollectionAttrInfo>( - 'clang_index_getIBOutletCollectionAttrInfo'); +typedef _dart_clang_getRemappingsFromFileList = ffi.Pointer Function( + ffi.Pointer> filePaths, + int numFiles, +); -typedef _c_clang_index_getIBOutletCollectionAttrInfo - = ffi.Pointer Function( - ffi.Pointer arg0, +typedef _c_clang_remap_getNumFiles = ffi.Uint32 Function( + ffi.Pointer arg0, ); -typedef _dart_clang_index_getIBOutletCollectionAttrInfo - = ffi.Pointer Function( - ffi.Pointer arg0, +typedef _dart_clang_remap_getNumFiles = int Function( + ffi.Pointer arg0, ); -ffi.Pointer clang_index_getObjCCategoryDeclInfo( - ffi.Pointer arg0, -) { - return _clang_index_getObjCCategoryDeclInfo( - arg0, - ); -} +typedef _c_clang_remap_getFilenames = ffi.Void Function( + ffi.Pointer arg0, + ffi.Uint32 index, + ffi.Pointer original, + ffi.Pointer transformed, +); -final _dart_clang_index_getObjCCategoryDeclInfo - _clang_index_getObjCCategoryDeclInfo = _dylib.lookupFunction< - _c_clang_index_getObjCCategoryDeclInfo, - _dart_clang_index_getObjCCategoryDeclInfo>( - 'clang_index_getObjCCategoryDeclInfo'); +typedef _dart_clang_remap_getFilenames = void Function( + ffi.Pointer arg0, + int index, + ffi.Pointer original, + ffi.Pointer transformed, +); -typedef _c_clang_index_getObjCCategoryDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, +typedef _c_clang_remap_dispose = ffi.Void Function( + ffi.Pointer arg0, ); -typedef _dart_clang_index_getObjCCategoryDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, +typedef _dart_clang_remap_dispose = void Function( + ffi.Pointer arg0, ); -ffi.Pointer clang_index_getObjCContainerDeclInfo( - ffi.Pointer arg0, -) { - return _clang_index_getObjCContainerDeclInfo( - arg0, - ); -} +typedef _c_clang_index_isEntityObjCContainerKind = ffi.Int32 Function( + ffi.Int32 arg0, +); -final _dart_clang_index_getObjCContainerDeclInfo - _clang_index_getObjCContainerDeclInfo = _dylib.lookupFunction< - _c_clang_index_getObjCContainerDeclInfo, - _dart_clang_index_getObjCContainerDeclInfo>( - 'clang_index_getObjCContainerDeclInfo'); +typedef _dart_clang_index_isEntityObjCContainerKind = int Function( + int arg0, +); typedef _c_clang_index_getObjCContainerDeclInfo = ffi.Pointer Function( @@ -4204,20 +4727,6 @@ typedef _dart_clang_index_getObjCContainerDeclInfo ffi.Pointer arg0, ); -ffi.Pointer clang_index_getObjCInterfaceDeclInfo( - ffi.Pointer arg0, -) { - return _clang_index_getObjCInterfaceDeclInfo( - arg0, - ); -} - -final _dart_clang_index_getObjCInterfaceDeclInfo - _clang_index_getObjCInterfaceDeclInfo = _dylib.lookupFunction< - _c_clang_index_getObjCInterfaceDeclInfo, - _dart_clang_index_getObjCInterfaceDeclInfo>( - 'clang_index_getObjCInterfaceDeclInfo'); - typedef _c_clang_index_getObjCInterfaceDeclInfo = ffi.Pointer Function( ffi.Pointer arg0, @@ -4228,45 +4737,16 @@ typedef _dart_clang_index_getObjCInterfaceDeclInfo ffi.Pointer arg0, ); -ffi.Pointer clang_index_getObjCPropertyDeclInfo( - ffi.Pointer arg0, -) { - return _clang_index_getObjCPropertyDeclInfo( - arg0, - ); -} - -final _dart_clang_index_getObjCPropertyDeclInfo - _clang_index_getObjCPropertyDeclInfo = _dylib.lookupFunction< - _c_clang_index_getObjCPropertyDeclInfo, - _dart_clang_index_getObjCPropertyDeclInfo>( - 'clang_index_getObjCPropertyDeclInfo'); - -typedef _c_clang_index_getObjCPropertyDeclInfo - = ffi.Pointer Function( +typedef _c_clang_index_getObjCCategoryDeclInfo + = ffi.Pointer Function( ffi.Pointer arg0, ); -typedef _dart_clang_index_getObjCPropertyDeclInfo - = ffi.Pointer Function( +typedef _dart_clang_index_getObjCCategoryDeclInfo + = ffi.Pointer Function( ffi.Pointer arg0, ); -ffi.Pointer - clang_index_getObjCProtocolRefListInfo( - ffi.Pointer arg0, -) { - return _clang_index_getObjCProtocolRefListInfo( - arg0, - ); -} - -final _dart_clang_index_getObjCProtocolRefListInfo - _clang_index_getObjCProtocolRefListInfo = _dylib.lookupFunction< - _c_clang_index_getObjCProtocolRefListInfo, - _dart_clang_index_getObjCProtocolRefListInfo>( - 'clang_index_getObjCProtocolRefListInfo'); - typedef _c_clang_index_getObjCProtocolRefListInfo = ffi.Pointer Function( ffi.Pointer arg0, @@ -4277,43 +4757,43 @@ typedef _dart_clang_index_getObjCProtocolRefListInfo ffi.Pointer arg0, ); -int clang_index_isEntityObjCContainerKind( - int arg0, -) { - return _clang_index_isEntityObjCContainerKind( - arg0, - ); -} +typedef _c_clang_index_getObjCPropertyDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); -final _dart_clang_index_isEntityObjCContainerKind - _clang_index_isEntityObjCContainerKind = _dylib.lookupFunction< - _c_clang_index_isEntityObjCContainerKind, - _dart_clang_index_isEntityObjCContainerKind>( - 'clang_index_isEntityObjCContainerKind'); +typedef _dart_clang_index_getObjCPropertyDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); -typedef _c_clang_index_isEntityObjCContainerKind = ffi.Int32 Function( - ffi.Int32 arg0, +typedef _c_clang_index_getIBOutletCollectionAttrInfo + = ffi.Pointer Function( + ffi.Pointer arg0, ); -typedef _dart_clang_index_isEntityObjCContainerKind = int Function( - int arg0, +typedef _dart_clang_index_getIBOutletCollectionAttrInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_clang_index_getCXXClassDeclInfo = ffi.Pointer + Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_index_getCXXClassDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0, ); -/// For setting a custom CXIdxClientContainer attached to a -/// container. -void clang_index_setClientContainer( +typedef _c_clang_index_getClientContainer = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer arg1, -) { - return _clang_index_setClientContainer( - arg0, - arg1, - ); -} +); -final _dart_clang_index_setClientContainer _clang_index_setClientContainer = - _dylib.lookupFunction<_c_clang_index_setClientContainer, - _dart_clang_index_setClientContainer>('clang_index_setClientContainer'); +typedef _dart_clang_index_getClientContainer = ffi.Pointer Function( + ffi.Pointer arg0, +); typedef _c_clang_index_setClientContainer = ffi.Void Function( ffi.Pointer arg0, @@ -4325,20 +4805,13 @@ typedef _dart_clang_index_setClientContainer = void Function( ffi.Pointer arg1, ); -/// For setting a custom CXIdxClientEntity attached to an entity. -void clang_index_setClientEntity( +typedef _c_clang_index_getClientEntity = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer arg1, -) { - return _clang_index_setClientEntity( - arg0, - arg1, - ); -} +); -final _dart_clang_index_setClientEntity _clang_index_setClientEntity = - _dylib.lookupFunction<_c_clang_index_setClientEntity, - _dart_clang_index_setClientEntity>('clang_index_setClientEntity'); +typedef _dart_clang_index_getClientEntity = ffi.Pointer Function( + ffi.Pointer arg0, +); typedef _c_clang_index_setClientEntity = ffi.Void Function( ffi.Pointer arg0, @@ -4350,774 +4823,422 @@ typedef _dart_clang_index_setClientEntity = void Function( ffi.Pointer arg1, ); -/// Determine whether the given cursor kind represents an attribute. -int clang_isAttribute( - int arg0, -) { - return _clang_isAttribute( - arg0, - ); -} +typedef _c_clang_IndexAction_create = ffi.Pointer Function( + ffi.Pointer CIdx, +); -final _dart_clang_isAttribute _clang_isAttribute = - _dylib.lookupFunction<_c_clang_isAttribute, _dart_clang_isAttribute>( - 'clang_isAttribute'); +typedef _dart_clang_IndexAction_create = ffi.Pointer Function( + ffi.Pointer CIdx, +); -typedef _c_clang_isAttribute = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _c_clang_IndexAction_dispose = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_IndexAction_dispose = void Function( + ffi.Pointer arg0, +); + +typedef _c_clang_indexSourceFile = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer client_data, + ffi.Pointer index_callbacks, + ffi.Uint32 index_callbacks_size, + ffi.Uint32 index_options, + 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.Pointer> out_TU, + ffi.Uint32 TU_options, +); + +typedef _dart_clang_indexSourceFile = int Function( + 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, +); + +typedef _c_clang_indexSourceFileFullArgv = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer client_data, + ffi.Pointer index_callbacks, + ffi.Uint32 index_callbacks_size, + ffi.Uint32 index_options, + 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.Pointer> out_TU, + ffi.Uint32 TU_options, +); + +typedef _dart_clang_indexSourceFileFullArgv = int Function( + 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, +); + +typedef _c_clang_indexTranslationUnit = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer client_data, + ffi.Pointer index_callbacks, + ffi.Uint32 index_callbacks_size, + ffi.Uint32 index_options, + ffi.Pointer arg5, +); + +typedef _dart_clang_indexTranslationUnit = int Function( + ffi.Pointer arg0, + ffi.Pointer client_data, + ffi.Pointer index_callbacks, + int index_callbacks_size, + int index_options, + ffi.Pointer arg5, ); -typedef _dart_clang_isAttribute = int Function( - int arg0, +typedef _c_clang_getCString_wrap = ffi.Pointer Function( + ffi.Pointer string, ); -/// Determine whether the given cursor kind represents a declaration. -int clang_isDeclaration( - int arg0, -) { - return _clang_isDeclaration( - arg0, - ); -} - -final _dart_clang_isDeclaration _clang_isDeclaration = - _dylib.lookupFunction<_c_clang_isDeclaration, _dart_clang_isDeclaration>( - 'clang_isDeclaration'); - -typedef _c_clang_isDeclaration = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_getCString_wrap = ffi.Pointer Function( + ffi.Pointer string, ); -typedef _dart_clang_isDeclaration = int Function( - int arg0, +typedef _c_clang_disposeString_wrap = ffi.Void Function( + ffi.Pointer string, ); -/// Determine whether the given cursor kind represents an expression. -int clang_isExpression( - int arg0, -) { - return _clang_isExpression( - arg0, - ); -} - -final _dart_clang_isExpression _clang_isExpression = - _dylib.lookupFunction<_c_clang_isExpression, _dart_clang_isExpression>( - 'clang_isExpression'); - -typedef _c_clang_isExpression = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_disposeString_wrap = void Function( + ffi.Pointer string, ); -typedef _dart_clang_isExpression = int Function( - int arg0, +typedef _c_clang_getCursorKind_wrap = ffi.Int32 Function( + ffi.Pointer cursor, ); -/// Determine whether the given header is guarded against -/// multiple inclusions, either with the conventional -/// \#ifndef/\#define/\#endif macro guards or with \#pragma once. -int clang_isFileMultipleIncludeGuarded( - ffi.Pointer tu, - ffi.Pointer file, -) { - return _clang_isFileMultipleIncludeGuarded( - tu, - file, - ); -} - -final _dart_clang_isFileMultipleIncludeGuarded - _clang_isFileMultipleIncludeGuarded = _dylib.lookupFunction< - _c_clang_isFileMultipleIncludeGuarded, - _dart_clang_isFileMultipleIncludeGuarded>( - 'clang_isFileMultipleIncludeGuarded'); - -typedef _c_clang_isFileMultipleIncludeGuarded = ffi.Uint32 Function( - ffi.Pointer tu, - ffi.Pointer file, +typedef _dart_clang_getCursorKind_wrap = int Function( + ffi.Pointer cursor, ); -typedef _dart_clang_isFileMultipleIncludeGuarded = int Function( - ffi.Pointer tu, - ffi.Pointer file, +typedef _c_clang_getCursorKindSpelling_wrap = ffi.Pointer Function( + ffi.Int32 kind, ); -/// Determine whether the given cursor kind represents an invalid -/// cursor. -int clang_isInvalid( - int arg0, -) { - return _clang_isInvalid( - arg0, - ); -} - -final _dart_clang_isInvalid _clang_isInvalid = - _dylib.lookupFunction<_c_clang_isInvalid, _dart_clang_isInvalid>( - 'clang_isInvalid'); - -typedef _c_clang_isInvalid = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_getCursorKindSpelling_wrap = ffi.Pointer Function( + int kind, ); -typedef _dart_clang_isInvalid = int Function( - int arg0, +typedef _c_clang_getCursorType_wrap = ffi.Pointer Function( + ffi.Pointer cursor, ); -/// Determine whether the given cursor represents a preprocessing -/// element, such as a preprocessor directive or macro instantiation. -int clang_isPreprocessing( - int arg0, -) { - return _clang_isPreprocessing( - arg0, - ); -} - -final _dart_clang_isPreprocessing _clang_isPreprocessing = _dylib - .lookupFunction<_c_clang_isPreprocessing, _dart_clang_isPreprocessing>( - 'clang_isPreprocessing'); - -typedef _c_clang_isPreprocessing = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_getCursorType_wrap = ffi.Pointer Function( + ffi.Pointer cursor, ); -typedef _dart_clang_isPreprocessing = int Function( - int arg0, +typedef _c_clang_getTypeSpelling_wrap = ffi.Pointer Function( + ffi.Pointer type, ); -/// Determine whether the given cursor kind represents a simple -/// reference. -/// -/// Note that other kinds of cursors (such as expressions) can also refer to -/// other cursors. Use clang_getCursorReferenced() to determine whether a -/// particular cursor refers to another entity. -int clang_isReference( - int arg0, -) { - return _clang_isReference( - arg0, - ); -} - -final _dart_clang_isReference _clang_isReference = - _dylib.lookupFunction<_c_clang_isReference, _dart_clang_isReference>( - 'clang_isReference'); - -typedef _c_clang_isReference = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_getTypeSpelling_wrap = ffi.Pointer Function( + ffi.Pointer type, ); -typedef _dart_clang_isReference = int Function( - int arg0, +typedef _c_clang_getTypeKindSpelling_wrap = ffi.Pointer Function( + ffi.Int32 typeKind, ); -/// Determine whether the given cursor kind represents a statement. -int clang_isStatement( - int arg0, -) { - return _clang_isStatement( - arg0, - ); -} - -final _dart_clang_isStatement _clang_isStatement = - _dylib.lookupFunction<_c_clang_isStatement, _dart_clang_isStatement>( - 'clang_isStatement'); - -typedef _c_clang_isStatement = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_getTypeKindSpelling_wrap = ffi.Pointer Function( + int typeKind, ); -typedef _dart_clang_isStatement = int Function( - int arg0, +typedef _c_clang_getResultType_wrap = ffi.Pointer Function( + ffi.Pointer functionType, ); -/// Determine whether the given cursor kind represents a translation -/// unit. -int clang_isTranslationUnit( - int arg0, -) { - return _clang_isTranslationUnit( - arg0, - ); -} - -final _dart_clang_isTranslationUnit _clang_isTranslationUnit = _dylib - .lookupFunction<_c_clang_isTranslationUnit, _dart_clang_isTranslationUnit>( - 'clang_isTranslationUnit'); - -typedef _c_clang_isTranslationUnit = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_getResultType_wrap = ffi.Pointer Function( + ffi.Pointer functionType, ); -typedef _dart_clang_isTranslationUnit = int Function( - int arg0, +typedef _c_clang_getPointeeType_wrap = ffi.Pointer Function( + ffi.Pointer pointerType, ); -/// Determine whether the given cursor represents a currently -/// unexposed piece of the AST (e.g., CXCursor_UnexposedStmt). -int clang_isUnexposed( - int arg0, -) { - return _clang_isUnexposed( - arg0, - ); -} - -final _dart_clang_isUnexposed _clang_isUnexposed = - _dylib.lookupFunction<_c_clang_isUnexposed, _dart_clang_isUnexposed>( - 'clang_isUnexposed'); - -typedef _c_clang_isUnexposed = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_getPointeeType_wrap = ffi.Pointer Function( + ffi.Pointer pointerType, ); -typedef _dart_clang_isUnexposed = int Function( - int arg0, +typedef _c_clang_getCanonicalType_wrap = ffi.Pointer Function( + ffi.Pointer typerefType, ); -/// Deserialize a set of diagnostics from a Clang diagnostics bitcode -/// file. -/// -/// \param file The name of the file to deserialize. -/// \param error A pointer to a enum value recording if there was a problem -/// deserializing the diagnostics. -/// \param errorString A pointer to a CXString for recording the error string -/// if the file was not successfully loaded. -/// -/// \returns A loaded CXDiagnosticSet if successful, and NULL otherwise. These -/// diagnostics should be released using clang_disposeDiagnosticSet(). -ffi.Pointer clang_loadDiagnostics( - ffi.Pointer file, - ffi.Pointer error, - ffi.Pointer errorString, -) { - return _clang_loadDiagnostics( - file, - error, - errorString, - ); -} - -final _dart_clang_loadDiagnostics _clang_loadDiagnostics = _dylib - .lookupFunction<_c_clang_loadDiagnostics, _dart_clang_loadDiagnostics>( - 'clang_loadDiagnostics'); +typedef _dart_clang_getCanonicalType_wrap = ffi.Pointer Function( + ffi.Pointer typerefType, +); -typedef _c_clang_loadDiagnostics = ffi.Pointer Function( - ffi.Pointer file, - ffi.Pointer error, - ffi.Pointer errorString, +typedef _c_clang_Type_getNamedType_wrap = ffi.Pointer Function( + ffi.Pointer elaboratedType, ); -typedef _dart_clang_loadDiagnostics = ffi.Pointer Function( - ffi.Pointer file, - ffi.Pointer error, - ffi.Pointer errorString, +typedef _dart_clang_Type_getNamedType_wrap = ffi.Pointer Function( + ffi.Pointer elaboratedType, ); -/// Same as \c clang_parseTranslationUnit2, but returns -/// the \c CXTranslationUnit instead of an error code. In case of an error this -/// routine returns a \c NULL \c CXTranslationUnit, without further detailed -/// error codes. -ffi.Pointer clang_parseTranslationUnit( - 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, -) { - return _clang_parseTranslationUnit( - CIdx, - source_filename, - command_line_args, - num_command_line_args, - unsaved_files, - num_unsaved_files, - options, - ); -} +typedef _c_clang_getTypeDeclaration_wrap = ffi.Pointer Function( + ffi.Pointer cxtype, +); -final _dart_clang_parseTranslationUnit _clang_parseTranslationUnit = - _dylib.lookupFunction<_c_clang_parseTranslationUnit, - _dart_clang_parseTranslationUnit>('clang_parseTranslationUnit'); +typedef _dart_clang_getTypeDeclaration_wrap = ffi.Pointer Function( + ffi.Pointer cxtype, +); -typedef _c_clang_parseTranslationUnit = ffi.Pointer +typedef _c_clang_getTypedefDeclUnderlyingType_wrap = 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, + ffi.Pointer cxcursor, ); -typedef _dart_clang_parseTranslationUnit = ffi.Pointer +typedef _dart_clang_getTypedefDeclUnderlyingType_wrap = 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, + ffi.Pointer cxcursor, ); -/// Parse the given source file and the translation unit corresponding -/// to that file. -/// -/// This routine is the main entry point for the Clang C API, providing the -/// ability to parse a source file into a translation unit that can then be -/// queried by other functions in the API. This routine accepts a set of -/// command-line arguments so that the compilation can be configured in the same -/// way that the compiler is configured on the command line. -/// -/// \param CIdx The index object with which the translation unit will be -/// associated. -/// -/// \param source_filename The name of the source file to load, or NULL if the -/// source file is included in \c command_line_args. -/// -/// \param command_line_args The command-line arguments that would be -/// passed to the \c clang executable if it were being invoked out-of-process. -/// These command-line options will be parsed and will affect how the translation -/// unit is parsed. Note that the following options are ignored: '-c', -/// '-emit-ast', '-fsyntax-only' (which is the default), and '-o \'. -/// -/// \param num_command_line_args The number of command-line arguments in -/// \c command_line_args. -/// -/// \param unsaved_files the files that have not yet been saved to disk -/// but may be required for parsing, 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 A bitmask of options that affects how the translation unit -/// is managed but not its compilation. This should be a bitwise OR of the -/// CXTranslationUnit_XXX flags. -/// -/// \param[out] out_TU A non-NULL pointer to store the created -/// \c CXTranslationUnit, describing the parsed code and containing any -/// diagnostics produced by the compiler. -/// -/// \returns Zero on success, otherwise returns an error code. -int clang_parseTranslationUnit2( - 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, -) { - return _clang_parseTranslationUnit2( - CIdx, - source_filename, - command_line_args, - num_command_line_args, - unsaved_files, - num_unsaved_files, - options, - out_TU, - ); -} +typedef _c_clang_getCursorSpelling_wrap = ffi.Pointer Function( + ffi.Pointer cursor, +); -final _dart_clang_parseTranslationUnit2 _clang_parseTranslationUnit2 = - _dylib.lookupFunction<_c_clang_parseTranslationUnit2, - _dart_clang_parseTranslationUnit2>('clang_parseTranslationUnit2'); +typedef _dart_clang_getCursorSpelling_wrap = ffi.Pointer Function( + ffi.Pointer cursor, +); -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 _c_clang_getTranslationUnitCursor_wrap = ffi.Pointer Function( + ffi.Pointer 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 _dart_clang_getTranslationUnitCursor_wrap = ffi.Pointer + Function( + ffi.Pointer tu, ); -/// Same as clang_parseTranslationUnit2 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_parseTranslationUnit2FullArgv( - 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, -) { - return _clang_parseTranslationUnit2FullArgv( - CIdx, - source_filename, - command_line_args, - num_command_line_args, - unsaved_files, - num_unsaved_files, - options, - out_TU, - ); -} +typedef _c_clang_formatDiagnostic_wrap = ffi.Pointer Function( + ffi.Pointer diag, + ffi.Int32 opts, +); -final _dart_clang_parseTranslationUnit2FullArgv - _clang_parseTranslationUnit2FullArgv = _dylib.lookupFunction< - _c_clang_parseTranslationUnit2FullArgv, - _dart_clang_parseTranslationUnit2FullArgv>( - 'clang_parseTranslationUnit2FullArgv'); +typedef _dart_clang_formatDiagnostic_wrap = ffi.Pointer Function( + ffi.Pointer diag, + int opts, +); -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 ModifiedCXCursorVisitor_1 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ); -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_visitChildren_wrap = ffi.Uint32 Function( + ffi.Pointer parent, + ffi.Pointer> _modifiedVisitor, + ffi.Pointer clientData, ); -/// Dispose the remapping. -void clang_remap_dispose( - ffi.Pointer arg0, -) { - return _clang_remap_dispose( - arg0, - ); -} +typedef _dart_clang_visitChildren_wrap = int Function( + ffi.Pointer parent, + ffi.Pointer> _modifiedVisitor, + ffi.Pointer clientData, +); -final _dart_clang_remap_dispose _clang_remap_dispose = - _dylib.lookupFunction<_c_clang_remap_dispose, _dart_clang_remap_dispose>( - 'clang_remap_dispose'); +typedef _c_clang_Cursor_getNumArguments_wrap = ffi.Int32 Function( + ffi.Pointer cursor, +); -typedef _c_clang_remap_dispose = ffi.Void Function( - ffi.Pointer arg0, +typedef _dart_clang_Cursor_getNumArguments_wrap = int Function( + ffi.Pointer cursor, ); -typedef _dart_clang_remap_dispose = void Function( - ffi.Pointer arg0, +typedef _c_clang_Cursor_getArgument_wrap = ffi.Pointer Function( + ffi.Pointer cursor, + ffi.Uint32 i, ); -/// 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( - arg0, - index, - original, - transformed, - ); -} +typedef _dart_clang_Cursor_getArgument_wrap = ffi.Pointer Function( + ffi.Pointer cursor, + int i, +); -final _dart_clang_remap_getFilenames _clang_remap_getFilenames = - _dylib.lookupFunction<_c_clang_remap_getFilenames, - _dart_clang_remap_getFilenames>('clang_remap_getFilenames'); +typedef _c_clang_getNumArgTypes_wrap = ffi.Int32 Function( + ffi.Pointer cxtype, +); -typedef _c_clang_remap_getFilenames = ffi.Void Function( - ffi.Pointer arg0, - ffi.Uint32 index, - ffi.Pointer original, - ffi.Pointer transformed, +typedef _dart_clang_getNumArgTypes_wrap = int Function( + ffi.Pointer cxtype, ); -typedef _dart_clang_remap_getFilenames = void Function( - ffi.Pointer arg0, - int index, - ffi.Pointer original, - ffi.Pointer transformed, +typedef _c_clang_getArgType_wrap = ffi.Pointer Function( + ffi.Pointer cxtype, + ffi.Uint32 i, ); -/// Determine the number of remappings. -int clang_remap_getNumFiles( - ffi.Pointer arg0, -) { - return _clang_remap_getNumFiles( - arg0, - ); -} +typedef _dart_clang_getArgType_wrap = ffi.Pointer Function( + ffi.Pointer cxtype, + int i, +); -final _dart_clang_remap_getNumFiles _clang_remap_getNumFiles = _dylib - .lookupFunction<_c_clang_remap_getNumFiles, _dart_clang_remap_getNumFiles>( - 'clang_remap_getNumFiles'); +typedef _c_clang_getEnumConstantDeclValue_wrap = ffi.Int64 Function( + ffi.Pointer cursor, +); -typedef _c_clang_remap_getNumFiles = ffi.Uint32 Function( - ffi.Pointer arg0, +typedef _dart_clang_getEnumConstantDeclValue_wrap = int Function( + ffi.Pointer cursor, ); -typedef _dart_clang_remap_getNumFiles = int Function( - ffi.Pointer arg0, +typedef _c_clang_equalRanges_wrap = ffi.Uint32 Function( + ffi.Pointer c1, + ffi.Pointer c2, ); -/// Reparse the source files that produced this translation unit. -/// -/// This routine can be used to re-parse the source files that originally -/// created the given translation unit, for example because those source files -/// have changed (either on disk or as passed via \p unsaved_files). The -/// source code will be reparsed with the same command-line options as it -/// was originally parsed. -/// -/// Reparsing a translation unit invalidates all cursors and source locations -/// that refer into that translation unit. This makes reparsing a translation -/// unit semantically equivalent to destroying the translation unit and then -/// creating a new translation unit with the same command-line arguments. -/// However, it may be more efficient to reparse a translation -/// unit using this routine. -/// -/// \param TU The translation unit whose contents will be re-parsed. The -/// translation unit must originally have been built with -/// \c clang_createTranslationUnitFromSourceFile(). -/// -/// \param num_unsaved_files The number of unsaved file entries in \p -/// unsaved_files. -/// -/// \param unsaved_files The files that have not yet been saved to disk -/// but may be required for parsing, 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 options A bitset of options composed of the flags in CXReparse_Flags. -/// The function \c clang_defaultReparseOptions() produces a default set of -/// options recommended for most uses, based on the translation unit. -/// -/// \returns 0 if the sources could be reparsed. A non-zero error code will be -/// returned if reparsing was impossible, such that the translation unit is -/// invalid. In such cases, the only valid call for \c TU is -/// \c clang_disposeTranslationUnit(TU). The error codes returned by this -/// routine are described by the \c CXErrorCode enum. -int clang_reparseTranslationUnit( - ffi.Pointer TU, - int num_unsaved_files, - ffi.Pointer unsaved_files, - int options, -) { - return _clang_reparseTranslationUnit( - TU, - num_unsaved_files, - unsaved_files, - options, - ); -} +typedef _dart_clang_equalRanges_wrap = int Function( + ffi.Pointer c1, + ffi.Pointer c2, +); -final _dart_clang_reparseTranslationUnit _clang_reparseTranslationUnit = - _dylib.lookupFunction<_c_clang_reparseTranslationUnit, - _dart_clang_reparseTranslationUnit>('clang_reparseTranslationUnit'); +typedef _c_clang_Cursor_getCommentRange_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); -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_Cursor_getCommentRange_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, ); -typedef _dart_clang_reparseTranslationUnit = int Function( - ffi.Pointer TU, - int num_unsaved_files, - ffi.Pointer unsaved_files, - int options, +typedef _c_clang_Cursor_getRawCommentText_wrap = ffi.Pointer Function( + ffi.Pointer cursor, ); -/// Saves a translation unit into a serialized representation of -/// that translation unit on disk. -/// -/// Any translation unit that was parsed without error can be saved -/// into a file. The translation unit can then be deserialized into a -/// new \c CXTranslationUnit with \c clang_createTranslationUnit() or, -/// if it is an incomplete translation unit that corresponds to a -/// header, used as a precompiled header when parsing other translation -/// units. -/// -/// \param TU The translation unit to save. -/// -/// \param FileName The file to which the translation unit will be saved. -/// -/// \param options A bitmask of options that affects how the translation unit -/// is saved. This should be a bitwise OR of the -/// CXSaveTranslationUnit_XXX flags. -/// -/// \returns A value that will match one of the enumerators of the CXSaveError -/// enumeration. Zero (CXSaveError_None) indicates that the translation unit was -/// saved successfully, while a non-zero value indicates that a problem occurred. -int clang_saveTranslationUnit( - ffi.Pointer TU, - ffi.Pointer FileName, - int options, -) { - return _clang_saveTranslationUnit( - TU, - FileName, - options, - ); -} +typedef _dart_clang_Cursor_getRawCommentText_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); -final _dart_clang_saveTranslationUnit _clang_saveTranslationUnit = - _dylib.lookupFunction<_c_clang_saveTranslationUnit, - _dart_clang_saveTranslationUnit>('clang_saveTranslationUnit'); +typedef _c_clang_Cursor_getBriefCommentText_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); -typedef _c_clang_saveTranslationUnit = ffi.Int32 Function( - ffi.Pointer TU, - ffi.Pointer FileName, - ffi.Uint32 options, +typedef _dart_clang_Cursor_getBriefCommentText_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, ); -typedef _dart_clang_saveTranslationUnit = int Function( - ffi.Pointer TU, - ffi.Pointer FileName, - int options, +typedef _c_clang_getCursorLocation_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, ); -/// 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( - Results, - NumResults, - ); -} +typedef _dart_clang_getCursorLocation_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); -final _dart_clang_sortCodeCompletionResults _clang_sortCodeCompletionResults = - _dylib.lookupFunction<_c_clang_sortCodeCompletionResults, - _dart_clang_sortCodeCompletionResults>( - 'clang_sortCodeCompletionResults'); +typedef _c_clang_getFileLocation_wrap = ffi.Void Function( + ffi.Pointer location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); -typedef _c_clang_sortCodeCompletionResults = ffi.Void Function( - ffi.Pointer Results, - ffi.Uint32 NumResults, +typedef _dart_clang_getFileLocation_wrap = void Function( + ffi.Pointer location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ); -typedef _dart_clang_sortCodeCompletionResults = void Function( - ffi.Pointer Results, - int NumResults, +typedef _c_clang_getFileName_wrap = ffi.Pointer Function( + ffi.Pointer SFile, ); -/// Suspend a translation unit in order to free memory associated with it. -/// -/// A suspended translation unit uses significantly less memory but on the other -/// side does not support any other calls than \c clang_reparseTranslationUnit -/// to resume it or \c clang_disposeTranslationUnit to dispose it completely. -int clang_suspendTranslationUnit( - ffi.Pointer arg0, -) { - return _clang_suspendTranslationUnit( - arg0, - ); -} +typedef _dart_clang_getFileName_wrap = ffi.Pointer Function( + ffi.Pointer SFile, +); -final _dart_clang_suspendTranslationUnit _clang_suspendTranslationUnit = - _dylib.lookupFunction<_c_clang_suspendTranslationUnit, - _dart_clang_suspendTranslationUnit>('clang_suspendTranslationUnit'); +typedef _c_clang_getNumElements_wrap = ffi.Uint64 Function( + ffi.Pointer cxtype, +); -typedef _c_clang_suspendTranslationUnit = ffi.Uint32 Function( - ffi.Pointer arg0, +typedef _dart_clang_getNumElements_wrap = int Function( + ffi.Pointer cxtype, ); -typedef _dart_clang_suspendTranslationUnit = int Function( - ffi.Pointer arg0, +typedef _c_clang_getArrayElementType_wrap = ffi.Pointer Function( + ffi.Pointer cxtype, ); -/// 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( - isEnabled, - ); -} +typedef _dart_clang_getArrayElementType_wrap = ffi.Pointer Function( + ffi.Pointer cxtype, +); -final _dart_clang_toggleCrashRecovery _clang_toggleCrashRecovery = - _dylib.lookupFunction<_c_clang_toggleCrashRecovery, - _dart_clang_toggleCrashRecovery>('clang_toggleCrashRecovery'); +typedef _typedefC_3 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, +); -typedef _c_clang_toggleCrashRecovery = ffi.Void Function( - ffi.Uint32 isEnabled, +typedef _typedefC_4 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ); -typedef _dart_clang_toggleCrashRecovery = void Function( - int isEnabled, +typedef _typedefC_5 = ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ); -typedef ModifiedCXCursorVisitor_1 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, +typedef _typedefC_6 = ffi.Pointer Function( ffi.Pointer, + ffi.Pointer, ); -/// Visitor is a function pointer with parameters having pointers to cxcursor -/// instead of cxcursor by default. -int clang_visitChildren_wrap( - ffi.Pointer parent, - ffi.Pointer> _modifiedVisitor, - ffi.Pointer clientData, -) { - return _clang_visitChildren_wrap( - parent, - _modifiedVisitor, - clientData, - ); -} +typedef _typedefC_7 = ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, +); -final _dart_clang_visitChildren_wrap _clang_visitChildren_wrap = - _dylib.lookupFunction<_c_clang_visitChildren_wrap, - _dart_clang_visitChildren_wrap>('clang_visitChildren_wrap'); +typedef _typedefC_8 = ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, +); -typedef _c_clang_visitChildren_wrap = ffi.Uint32 Function( - ffi.Pointer parent, - ffi.Pointer> _modifiedVisitor, - ffi.Pointer clientData, +typedef _typedefC_9 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, ); -typedef _dart_clang_visitChildren_wrap = int Function( - ffi.Pointer parent, - ffi.Pointer> _modifiedVisitor, - ffi.Pointer clientData, +typedef _typedefC_10 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, ); diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index c29adb8765..22acef701c 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -59,8 +59,10 @@ ffigen: unsigned long long: 8 enum: 4 - # Default is 'init' - init-function-name: init + # Default is 'NativeLibrary' + name: 'LibClang' + + description: 'Holds bindings to LibClang.' # False by default. array-workaround: true diff --git a/pkgs/ffigen/example/simple/generated_bindings.dart b/pkgs/ffigen/example/simple/generated_bindings.dart index 54409b1380..1976074b93 100644 --- a/pkgs/ffigen/example/simple/generated_bindings.dart +++ b/pkgs/ffigen/example/simple/generated_bindings.dart @@ -3,27 +3,89 @@ /// Generated by `package:ffigen`. import 'dart:ffi' as ffi; -/// Holds the Dynamic library. -ffi.DynamicLibrary _dylib; - -/// Initialises the Dynamic library. -void init(ffi.DynamicLibrary dynamicLibrary) { - _dylib = dynamicLibrary; +/// Bindings to `headers/example.h`. +class NativeLibrary { + /// Holds the Dynamic library. + final ffi.DynamicLibrary _dylib; + + /// The symbols are looked up in [dynamicLibrary]. + NativeLibrary(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + + /// Adds 2 integers. + int sum( + int a, + int b, + ) { + _sum ??= _dylib.lookupFunction<_c_sum, _dart_sum>('sum'); + return _sum( + a, + b, + ); + } + + _dart_sum _sum; + + /// Subtracts 2 integers. + int subtract( + ffi.Pointer a, + int b, + ) { + _subtract ??= + _dylib.lookupFunction<_c_subtract, _dart_subtract>('subtract'); + return _subtract( + a, + b, + ); + } + + _dart_subtract _subtract; + + /// Multiplies 2 integers, returns pointer to an integer,. + ffi.Pointer multiply( + int a, + int b, + ) { + _multiply ??= + _dylib.lookupFunction<_c_multiply, _dart_multiply>('multiply'); + return _multiply( + a, + b, + ); + } + + _dart_multiply _multiply; + + /// Divides 2 integers, returns pointer to a float. + ffi.Pointer divide( + int a, + int b, + ) { + _divide ??= _dylib.lookupFunction<_c_divide, _dart_divide>('divide'); + return _divide( + a, + b, + ); + } + + _dart_divide _divide; + + /// Divides 2 floats, returns a pointer to double. + ffi.Pointer dividePercision( + ffi.Pointer a, + ffi.Pointer b, + ) { + _dividePercision ??= + _dylib.lookupFunction<_c_dividePercision, _dart_dividePercision>( + 'dividePercision'); + return _dividePercision( + a, + b, + ); + } + + _dart_dividePercision _dividePercision; } -/// Adds 2 integers. -int sum( - int a, - int b, -) { - return _sum( - a, - b, - ); -} - -final _dart_sum _sum = _dylib.lookupFunction<_c_sum, _dart_sum>('sum'); - typedef _c_sum = ffi.Int32 Function( ffi.Int32 a, ffi.Int32 b, @@ -34,20 +96,6 @@ typedef _dart_sum = int Function( int b, ); -/// Subtracts 2 integers. -int subtract( - ffi.Pointer a, - int b, -) { - return _subtract( - a, - b, - ); -} - -final _dart_subtract _subtract = - _dylib.lookupFunction<_c_subtract, _dart_subtract>('subtract'); - typedef _c_subtract = ffi.Int32 Function( ffi.Pointer a, ffi.Int32 b, @@ -58,20 +106,6 @@ typedef _dart_subtract = int Function( int b, ); -/// Multiplies 2 integers, returns pointer to an integer,. -ffi.Pointer multiply( - int a, - int b, -) { - return _multiply( - a, - b, - ); -} - -final _dart_multiply _multiply = - _dylib.lookupFunction<_c_multiply, _dart_multiply>('multiply'); - typedef _c_multiply = ffi.Pointer Function( ffi.Int32 a, ffi.Int32 b, @@ -82,20 +116,6 @@ typedef _dart_multiply = ffi.Pointer Function( int b, ); -/// Divides 2 integers, returns pointer to a float. -ffi.Pointer divide( - int a, - int b, -) { - return _divide( - a, - b, - ); -} - -final _dart_divide _divide = - _dylib.lookupFunction<_c_divide, _dart_divide>('divide'); - typedef _c_divide = ffi.Pointer Function( ffi.Int32 a, ffi.Int32 b, @@ -106,21 +126,6 @@ typedef _dart_divide = ffi.Pointer Function( int b, ); -/// Divides 2 floats, returns a pointer to double. -ffi.Pointer dividePercision( - ffi.Pointer a, - ffi.Pointer b, -) { - return _dividePercision( - a, - b, - ); -} - -final _dart_dividePercision _dividePercision = - _dylib.lookupFunction<_c_dividePercision, _dart_dividePercision>( - 'dividePercision'); - typedef _c_dividePercision = ffi.Pointer Function( ffi.Pointer a, ffi.Pointer b, diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index 454c138f9c..58aaa7e1dc 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -12,6 +12,8 @@ dev_dependencies: path: '../../' ffigen: + name: NativeLibrary + description: Bindings to `headers/example.h`. output: 'generated_bindings.dart' headers: - 'headers/example.h' diff --git a/pkgs/ffigen/lib/src/code_generator.dart b/pkgs/ffigen/lib/src/code_generator.dart index 9af6dbefbf..9eb01b641f 100644 --- a/pkgs/ffigen/lib/src/code_generator.dart +++ b/pkgs/ffigen/lib/src/code_generator.dart @@ -13,5 +13,5 @@ export 'code_generator/global.dart'; export 'code_generator/library.dart'; export 'code_generator/struc.dart'; export 'code_generator/type.dart'; -export 'code_generator/typedefc.dart'; +export 'code_generator/typedef.dart'; diff --git a/pkgs/ffigen/lib/src/code_generator/binding.dart b/pkgs/ffigen/lib/src/code_generator/binding.dart index f37c72c3bd..507de6c020 100644 --- a/pkgs/ffigen/lib/src/code_generator/binding.dart +++ b/pkgs/ffigen/lib/src/code_generator/binding.dart @@ -5,9 +5,12 @@ import 'package:meta/meta.dart'; import 'binding_string.dart'; +import 'typedef.dart'; import 'writer.dart'; /// Base class for all Bindings. +/// +/// Do not extend directly, use [LookUpBinding] or [NoLookUpBinding]. abstract class Binding { String name; @@ -15,6 +18,24 @@ abstract class Binding { Binding({@required this.name, this.dartDoc}); + /// Return typedef dependencies. + List getTypedefDependencies(Writer w); + /// Converts a Binding to its actual string representation. + /// + /// Note: This does not print the typedef dependencies. + /// Must call [getTypedefDependencies] first. BindingString toBindingString(Writer w); } + +/// Base class for bindings which look up symbols in dynamic library. +abstract class LookUpBinding extends Binding { + LookUpBinding({String name, String dartDoc}) + : super(name: name, dartDoc: dartDoc); +} + +/// Base class for bindings which don't look up symbols in dynamic library. +abstract class NoLookUpBinding extends Binding { + NoLookUpBinding({String name, String dartDoc}) + : super(name: name, dartDoc: dartDoc); +} diff --git a/pkgs/ffigen/lib/src/code_generator/constant.dart b/pkgs/ffigen/lib/src/code_generator/constant.dart index dd5c6570fb..d64e7ac5af 100644 --- a/pkgs/ffigen/lib/src/code_generator/constant.dart +++ b/pkgs/ffigen/lib/src/code_generator/constant.dart @@ -2,11 +2,13 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:ffigen/src/code_generator/typedef.dart'; import 'package:meta/meta.dart'; import 'binding.dart'; import 'binding_string.dart'; import 'type.dart'; +import 'utils.dart'; import 'writer.dart'; /// A simple Constant. @@ -20,7 +22,7 @@ import 'writer.dart'; /// ```dart /// const int name = 10; /// ``` -class Constant extends Binding { +class Constant extends NoLookUpBinding { final Type type; /// The rawValue is pasted as it is. @@ -41,9 +43,7 @@ class Constant extends Binding { final constantName = name; if (dartDoc != null) { - s.write('/// '); - s.writeAll(dartDoc.split('\n'), '\n/// '); - s.write('\n'); + s.write(makeDartDoc(dartDoc)); } s.write('const ${type.getDartType(w)} $constantName = $rawValue;\n\n'); @@ -51,4 +51,7 @@ class Constant extends Binding { return BindingString( type: BindingStringType.constant, string: s.toString()); } + + @override + List getTypedefDependencies(Writer w) => const []; } diff --git a/pkgs/ffigen/lib/src/code_generator/enum_class.dart b/pkgs/ffigen/lib/src/code_generator/enum_class.dart index 1baea1884f..f578793f0c 100644 --- a/pkgs/ffigen/lib/src/code_generator/enum_class.dart +++ b/pkgs/ffigen/lib/src/code_generator/enum_class.dart @@ -2,6 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:ffigen/src/code_generator/typedef.dart'; import 'package:meta/meta.dart'; import 'binding.dart'; @@ -23,7 +24,7 @@ import 'writer.dart'; /// static const banana = 10; /// } /// ``` -class EnumClass extends Binding { +class EnumClass extends NoLookUpBinding { final List enumConstants; EnumClass({ @@ -39,9 +40,7 @@ class EnumClass extends Binding { final enclosingClassName = name; if (dartDoc != null) { - s.write('/// '); - s.writeAll(dartDoc.split('\n'), '\n/// '); - s.write('\n'); + s.write(makeDartDoc(dartDoc)); } /// Adding [enclosingClassName] because dart doesn't allow class member @@ -52,8 +51,7 @@ class EnumClass extends Binding { s.write('class $enclosingClassName {\n'); const depth = ' '; for (final ec in enumConstants) { - final enum_value_name = - localUniqueNamer.makeUnique(ec.name); + final enum_value_name = localUniqueNamer.makeUnique(ec.name); if (ec.dartDoc != null) { s.write(depth + '/// '); s.writeAll(ec.dartDoc.split('\n'), '\n' + depth + '/// '); @@ -66,6 +64,9 @@ class EnumClass extends Binding { return BindingString( type: BindingStringType.enumClass, string: s.toString()); } + + @override + List getTypedefDependencies(Writer w) => const []; } /// Represents a single value in an enum. diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index ffc1509ea4..4c321be30e 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -2,11 +2,13 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:ffigen/src/code_generator.dart'; import 'package:meta/meta.dart'; import 'binding.dart'; import 'binding_string.dart'; import 'type.dart'; +import 'utils.dart'; import 'writer.dart'; /// A binding for C function. @@ -27,7 +29,7 @@ import 'writer.dart'; /// /// typedef _dart_sum = int Function(int a, int b); /// ``` -class Func extends Binding { +class Func extends LookUpBinding { final String lookupSymbolName; final Type returnType; final List parameters; @@ -50,30 +52,70 @@ class Func extends Binding { } } + List _typedefDependencies; @override - BindingString toBindingString(Writer w) { - final s = StringBuffer(); - final enclosingFuncName = name; + List getTypedefDependencies(Writer w) { + if (_typedefDependencies == null) { + _typedefDependencies = []; - // Ensure name conflicts are resolved for typedefs generated. - final funcVarName = w.uniqueNamer.makeUnique('_$name'); - final typedefC = w.uniqueNamer.makeUnique('_c_$name'); - final typedefDart = w.uniqueNamer.makeUnique('_dart_$name'); + /// Ensure name conflicts are resolved for [cType] and [dartType] typedefs. + cType.name = _uniqueTypedefName(cType.name, w); + dartType.name = _uniqueTypedefName(dartType.name, w); - // Write typedef's required by parameters and resolve name conflicts. - for (final p in parameters) { - final base = p.type.getBaseType(); - if (base.broadType == BroadType.NativeFunction) { - base.nativeFunc.name = - w.uniqueNamer.makeUnique(base.nativeFunc.name); - s.write(base.nativeFunc.toTypedefString(w)); + // Add typedef's required by parameters. + for (final p in parameters) { + final base = p.type.getBaseType(); + if (base.broadType == BroadType.NativeFunction) { + // Resolve name conflicts in typedef's required by parameters before using. + base.nativeFunc.name = _uniqueTypedefName(base.nativeFunc.name, w); + _typedefDependencies.add(base.nativeFunc); + } } + // Add C function typedef. + _typedefDependencies.add(cType); + // Add Dart function typedef. + _typedefDependencies.add(dartType); + } + return _typedefDependencies; + } + + /// Checks if typedef name is unique in both top level and wrapper level. + /// And only marks it as used at top-level. + String _uniqueTypedefName(String name, Writer w) { + final base = name; + String uniqueName = name; + int suffix = 0; + while (w.topLevelUniqueNamer.isUsed(uniqueName) || + w.wrapperLevelUniqueNamer.isUsed(uniqueName)) { + suffix++; + uniqueName = base + suffix.toString(); } + w.topLevelUniqueNamer.markUsed(uniqueName); + return uniqueName; + } + + Typedef _cType, _dartType; + Typedef get cType => _cType ??= Typedef( + name: '_c_$name', + returnType: returnType, + parameters: parameters, + typedefType: TypedefType.C, + ); + Typedef get dartType => _dartType ??= Typedef( + name: '_dart_$name', + returnType: returnType, + parameters: parameters, + typedefType: TypedefType.Dart, + ); + + @override + BindingString toBindingString(Writer w) { + final s = StringBuffer(); + final enclosingFuncName = name; + final funcVarName = w.wrapperLevelUniqueNamer.makeUnique('_$name'); if (dartDoc != null) { - s.write('/// '); - s.writeAll(dartDoc.split('\n'), '\n/// '); - s.write('\n'); + s.write(makeDartDoc(dartDoc)); } // Write enclosing function. @@ -82,30 +124,18 @@ class Func extends Binding { s.write(' ${p.type.getDartType(w)} ${p.name},\n'); } s.write(') {\n'); + s.write( + "$funcVarName ??= ${w.dylibIdentifier}.lookupFunction<${cType.name},${dartType.name}>('$lookupSymbolName');\n"); + s.write(' return $funcVarName(\n'); for (final p in parameters) { s.write(' ${p.name},\n'); } s.write(' );\n'); - s.write('}\n\n'); - - // Write function with dylib lookup. - s.write( - "final $typedefDart $funcVarName = ${w.dylibIdentifier}.lookupFunction<$typedefC,$typedefDart>('$lookupSymbolName');\n\n"); + s.write('}\n'); - // Write typdef for C. - s.write('typedef $typedefC = ${returnType.getCType(w)} Function(\n'); - for (final p in parameters) { - s.write(' ${p.type.getCType(w)} ${p.name},\n'); - } - s.write(');\n\n'); - - // Write typdef for dart. - s.write('typedef $typedefDart = ${returnType.getDartType(w)} Function(\n'); - for (final p in parameters) { - s.write(' ${p.type.getDartType(w)} ${p.name},\n'); - } - s.write(');\n\n'); + // Write function variable. + s.write('${dartType.name} $funcVarName;\n\n'); return BindingString(type: BindingStringType.func, string: s.toString()); } diff --git a/pkgs/ffigen/lib/src/code_generator/global.dart b/pkgs/ffigen/lib/src/code_generator/global.dart index 2e41d82215..f1f919f088 100644 --- a/pkgs/ffigen/lib/src/code_generator/global.dart +++ b/pkgs/ffigen/lib/src/code_generator/global.dart @@ -2,11 +2,13 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:ffigen/src/code_generator/typedef.dart'; import 'package:meta/meta.dart'; import 'binding.dart'; import 'binding_string.dart'; import 'type.dart'; +import 'utils.dart'; import 'writer.dart'; /// A binding to a global variable @@ -19,7 +21,7 @@ import 'writer.dart'; /// ```dart /// final int a = _dylib.lookup('a').value; /// ``` -class Global extends Binding { +class Global extends LookUpBinding { final String lookupSymbolName; final Type type; @@ -35,14 +37,19 @@ class Global extends Binding { final s = StringBuffer(); final globalVarName = name; if (dartDoc != null) { - s.write('/// '); - s.writeAll(dartDoc.split('\n'), '\n/// '); - s.write('\n'); + s.write(makeDartDoc(dartDoc)); } + final holderVarName = + w.wrapperLevelUniqueNamer.makeUnique('_$globalVarName'); s.write( - "final ${type.getDartType(w)} $globalVarName = ${w.dylibIdentifier}.lookup<${type.getCType(w)}>('$lookupSymbolName').value;\n\n"); + '${w.ffiLibraryPrefix}.Pointer<${type.getCType(w)}> $holderVarName;\n'); + s.write( + "${type.getDartType(w)} get $globalVarName => ($holderVarName ??= ${w.dylibIdentifier}.lookup<${type.getCType(w)}>('$lookupSymbolName')).value;\n\n"); return BindingString(type: BindingStringType.global, string: s.toString()); } + + @override + List getTypedefDependencies(Writer w) => const []; } diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index 027c1f1316..13a7340cf1 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -22,29 +22,50 @@ class Library { Writer get writer => _writer; Library({ + @required String name, + String description, @required this.bindings, String header, - String initFunctionIdentifier = 'init', }) { - // Handle any declaration-declaration name conflict. - final declConflictHandler = UniqueNamer({}); - for (final b in bindings) { + // Seperate bindings which require lookup. + final lookUpBindings = bindings.whereType().toList(); + final noLookUpBindings = bindings.whereType().toList(); + + /// Handle any declaration-declaration name conflict in [lookUpBindings]. + final lookUpDeclConflictHandler = UniqueNamer({}); + for (final b in lookUpBindings) { // Print warning if name was conflicting and has been changed. - if (declConflictHandler.isUsed(b.name)) { + if (lookUpDeclConflictHandler.isUsed(b.name)) { final oldName = b.name; - b.name = declConflictHandler.makeUnique(b.name); + b.name = lookUpDeclConflictHandler.makeUnique(b.name); _logger.warning( "Resolved name conflict: Declaration '$oldName' and has been renamed to '${b.name}'."); } else { - declConflictHandler.markUsed(b.name); + lookUpDeclConflictHandler.markUsed(b.name); + } + } + + /// Handle any declaration-declaration name conflict in [noLookUpBindings]. + final noLookUpDeclConflictHandler = UniqueNamer({}); + for (final b in noLookUpBindings) { + // Print warning if name was conflicting and has been changed. + if (noLookUpDeclConflictHandler.isUsed(b.name)) { + final oldName = b.name; + b.name = noLookUpDeclConflictHandler.makeUnique(b.name); + + _logger.warning( + "Resolved name conflict: Declaration '$oldName' and has been renamed to '${b.name}'."); + } else { + noLookUpDeclConflictHandler.markUsed(b.name); } } - final declarationNames = bindings.map((e) => e.name).toSet(); _writer = Writer( - usedUpNames: declarationNames, - initFunctionIdentifier: initFunctionIdentifier, + lookUpBindings: lookUpBindings, + noLookUpBindings: noLookUpBindings, + className: name, + classDocComment: description, header: header, ); } @@ -64,13 +85,6 @@ class Library { } } - /// Generates bindings and stores it in given [Writer]. - void _generate(Writer w) { - for (final b in bindings) { - w.addBindingString(b.toBindingString(w)); - } - } - /// Formats a file using `dartfmt`. void _dartFmt(String path) { final result = Process.runSync('dartfmt', ['-w', path], @@ -83,7 +97,6 @@ class Library { /// Generates the bindings. String generate() { final w = writer; - _generate(w); return w.generate(); } diff --git a/pkgs/ffigen/lib/src/code_generator/struc.dart b/pkgs/ffigen/lib/src/code_generator/struc.dart index 949c239bf6..7c41a47ce1 100644 --- a/pkgs/ffigen/lib/src/code_generator/struc.dart +++ b/pkgs/ffigen/lib/src/code_generator/struc.dart @@ -2,6 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:ffigen/src/code_generator/typedef.dart'; import 'package:meta/meta.dart'; import 'binding.dart'; @@ -34,7 +35,7 @@ import 'writer.dart'; /// /// } /// ``` -class Struc extends Binding { +class Struc extends NoLookUpBinding { List members; Struc({ @@ -54,29 +55,36 @@ class Struc extends Binding { return array; } + List _typedefDependencies; + @override + List getTypedefDependencies(Writer w) { + if (_typedefDependencies == null) { + _typedefDependencies = []; + + // Write typedef's required by members and resolve name conflicts. + for (final m in members) { + final base = m.type.getBaseType(); + if (base.broadType == BroadType.NativeFunction) { + base.nativeFunc.name = + w.topLevelUniqueNamer.makeUnique(base.nativeFunc.name); + _typedefDependencies.add(base.nativeFunc); + } + } + } + return _typedefDependencies; + } + @override BindingString toBindingString(Writer w) { members = members ?? []; final s = StringBuffer(); final enclosingClassName = name; if (dartDoc != null) { - s.write('/// '); - s.writeAll(dartDoc.split('\n'), '\n/// '); - s.write('\n'); + s.write(makeDartDoc(dartDoc)); } final helpers = []; - // Write typedef's required by members and resolve name conflicts. - for (final m in members) { - final base = m.type.getBaseType(); - if (base.broadType == BroadType.NativeFunction) { - base.nativeFunc.name = - w.uniqueNamer.makeUnique(base.nativeFunc.name); - s.write(base.nativeFunc.toTypedefString(w)); - } - } - final expandedArrayItemPrefix = getUniqueExpandedArrayItemPrefix(); /// Adding [enclosingClassName] because dart doesn't allow class member diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index a07b776879..ad69ea4b71 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -5,7 +5,7 @@ import 'package:meta/meta.dart'; import 'struc.dart'; -import 'typedefc.dart'; +import 'typedef.dart'; import 'writer.dart'; class _SubType { @@ -67,8 +67,8 @@ class Type { /// Reference to the [Struc] binding this type refers to. Struc struc; - /// Reference to the [TypedefC] this type refers to. - TypedefC nativeFunc; + /// Reference to the [Typedef] this type refers to. + Typedef nativeFunc; /// For providing [SupportedNativeType] only. final SupportedNativeType nativeType; @@ -101,7 +101,7 @@ class Type { factory Type.struct(Struc struc) { return Type._(broadType: BroadType.Struct, struc: struc); } - factory Type.nativeFunc(TypedefC nativeFunc) { + factory Type.nativeFunc(Typedef nativeFunc) { return Type._(broadType: BroadType.NativeFunction, nativeFunc: nativeFunc); } factory Type.nativeType(SupportedNativeType nativeType) { diff --git a/pkgs/ffigen/lib/src/code_generator/typedef.dart b/pkgs/ffigen/lib/src/code_generator/typedef.dart new file mode 100644 index 0000000000..17b6deeac1 --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/typedef.dart @@ -0,0 +1,67 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:meta/meta.dart'; + +import 'func.dart' show Parameter; +import 'type.dart'; +import 'utils.dart'; +import 'writer.dart'; + +/// A simple typedef, Expands to - +/// +/// ```dart +/// typedef $name = $returnType Function( +/// $parameter1..., +/// $parameter2..., +/// . +/// . +/// ); +/// ``` +/// Return/Parameter types can be of for C/Dart signarture depending on [typedefType]. +/// +/// Note: re-set [name] after resolving name conflicts. +class Typedef { + String name; + String dartDoc; + final Type returnType; + final TypedefType typedefType; + final List parameters; + + Typedef({ + @required this.name, + this.dartDoc, + @required this.returnType, + @required this.typedefType, + List parameters, + }) : parameters = parameters ?? []; + + String toTypedefString(Writer w) { + final s = StringBuffer(); + if (dartDoc != null) { + s.write(makeDartDoc(dartDoc)); + } + final typedefName = name; + + if (typedefType == TypedefType.C) { + s.write('typedef $typedefName = ${returnType.getCType(w)} Function(\n'); + for (final p in parameters) { + s.write(' ${p.type.getCType(w)} ${p.name},\n'); + } + s.write(');\n\n'); + } else { + s.write( + 'typedef $typedefName = ${returnType.getDartType(w)} Function(\n'); + for (final p in parameters) { + s.write(' ${p.type.getDartType(w)} ${p.name},\n'); + } + s.write(');\n\n'); + } + + return s.toString(); + } +} + +enum TypedefType { C, Dart } diff --git a/pkgs/ffigen/lib/src/code_generator/typedefc.dart b/pkgs/ffigen/lib/src/code_generator/typedefc.dart deleted file mode 100644 index 28075aa5e6..0000000000 --- a/pkgs/ffigen/lib/src/code_generator/typedefc.dart +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'package:meta/meta.dart'; - -import 'func.dart' show Parameter; -import 'type.dart'; -import 'writer.dart'; - -/// A simple typedef function for C functions, Expands to - -/// -/// ```dart -/// typedef $name = $returnType Function( -/// $parameter1..., -/// $parameter2..., -/// . -/// . -/// ); -/// ``` -/// Used for generating typedefs for `Pointer`. -/// -/// Name conflict resolution must be done before using. -class TypedefC { - String name; - String dartDoc; - final Type returnType; - final List parameters; - - TypedefC({ - @required this.name, - this.dartDoc, - @required this.returnType, - List parameters, - }) : parameters = parameters ?? []; - - String toTypedefString(Writer w) { - final s = StringBuffer(); - - if (dartDoc != null) { - s.write('/// '); - s.writeAll(dartDoc.split('\n'), '\n/// '); - s.write('\n'); - } - - s.write('typedef $name = ${returnType.getCType(w)} Function(\n'); - for (final p in parameters) { - s.write(' ${p.type.getCType(w)} ${p.name},\n'); - } - s.write(');\n\n'); - - return s.toString(); - } -} diff --git a/pkgs/ffigen/lib/src/code_generator/utils.dart b/pkgs/ffigen/lib/src/code_generator/utils.dart index fbb1cce650..800b7f897b 100644 --- a/pkgs/ffigen/lib/src/code_generator/utils.dart +++ b/pkgs/ffigen/lib/src/code_generator/utils.dart @@ -35,3 +35,15 @@ class UniqueNamer { return !_usedUpNames.contains(name); } } + +/// Converts [text] to a dart doc comment. +/// +/// Comment is split on new lines only. +String makeDartDoc(String text) { + final s = StringBuffer(); + s.write('/// '); + s.writeAll(text.split('\n'), '\n/// '); + s.write('\n'); + + return s.toString(); +} diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index aa8129c0b9..55a451ac14 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -5,48 +5,74 @@ import 'package:ffigen/src/code_generator/utils.dart'; import 'package:meta/meta.dart'; -import 'binding_string.dart'; +import 'binding.dart'; +import 'typedef.dart'; /// To store generated String bindings. class Writer { final String header; - String _initFunctionIdentifier; - final UniqueNamer uniqueNamer; + /// Holds bindings, which lookup symbols. + final List lookUpBindings; + + /// Holds bindings which don't lookup symbols. + final List noLookUpBindings; + + String _className; + final String classDocComment; String _ffiLibraryPrefix; - String get ffiLibraryPrefix => - _ffiLibraryPrefix ??= uniqueNamer.makeUnique('ffi'); + String get ffiLibraryPrefix => _ffiLibraryPrefix; String _dylibIdentifier; - String get dylibIdentifier => - _dylibIdentifier ??= uniqueNamer.makeUnique('_dylib'); + String get dylibIdentifier => _dylibIdentifier; + + UniqueNamer _topLevelUniqueNamer, _wrapperLevelUniqueNamer; + UniqueNamer get topLevelUniqueNamer => _topLevelUniqueNamer; + UniqueNamer get wrapperLevelUniqueNamer => _wrapperLevelUniqueNamer; String _arrayHelperClassPrefix; /// Guaranteed to be a unique prefix. String get arrayHelperClassPrefix => _arrayHelperClassPrefix; - final List _bindings = []; - - /// [usedUpNames] should contain names of all the declarations which are + /// [_usedUpNames] should contain names of all the declarations which are /// already used. This is used to avoid name collisions. Writer({ - @required Set usedUpNames, - String initFunctionIdentifier = 'init', + @required this.lookUpBindings, + @required this.noLookUpBindings, + @required String className, + this.classDocComment, this.header, - }) : uniqueNamer = UniqueNamer(usedUpNames), - assert(initFunctionIdentifier != null) { - _initFunctionIdentifier = - uniqueNamer.makeUnique(initFunctionIdentifier); + }) : assert(className != null) { + final globalLevelNameSet = noLookUpBindings.map((e) => e.name).toSet(); + final wrapperLevelNameSet = lookUpBindings.map((e) => e.name).toSet(); + final allNameSet = {} + ..addAll(globalLevelNameSet) + ..addAll(wrapperLevelNameSet); + + _topLevelUniqueNamer = UniqueNamer(globalLevelNameSet); + _wrapperLevelUniqueNamer = UniqueNamer(wrapperLevelNameSet); + final allLevelsUniqueNamer = UniqueNamer(allNameSet); + + /// Wrapper class name must be unique among all names. + _className = allLevelsUniqueNamer.makeUnique(className); + wrapperLevelUniqueNamer.markUsed(_className); + topLevelUniqueNamer.markUsed(_className); + + /// [_ffiLibraryPrefix] should be unique in top level. + _ffiLibraryPrefix = topLevelUniqueNamer.makeUnique('ffi'); + + /// [_dylibIdentifier] should be unique in top level. + _dylibIdentifier = wrapperLevelUniqueNamer.makeUnique('_dylib'); /// Finding a unique prefix for Array Helper Classes and store into /// [_arrayHelperClassPrefix]. final base = 'ArrayHelper'; _arrayHelperClassPrefix = base; int suffixInt = 0; - for (int i = 0; i < usedUpNames.length; i++) { - if (usedUpNames.elementAt(i).startsWith(_arrayHelperClassPrefix)) { + for (int i = 0; i < allNameSet.length; i++) { + if (allNameSet.elementAt(i).startsWith(_arrayHelperClassPrefix)) { // Not a unique prefix, start over with a new suffix. i = -1; suffixInt++; @@ -54,6 +80,8 @@ class Writer { } } } + + /// Writes all bindings to a String. String generate() { final s = StringBuffer(); @@ -63,35 +91,57 @@ class Writer { s.write('\n'); } else { // Write default header, in case none was provided. - s.write('''/// AUTO GENERATED FILE, DO NOT EDIT. -/// -/// Generated by `package:ffigen`. -'''); + s.write(makeDartDoc( + 'AUTO GENERATED FILE, DO NOT EDIT.\n\nGenerated by `package:ffigen`.')); } // Write neccesary imports. s.write("import 'dart:ffi' as $ffiLibraryPrefix;\n"); s.write('\n'); - // Write dylib. - s.write('/// Holds the Dynamic library.\n'); - s.write('$ffiLibraryPrefix.DynamicLibrary ${dylibIdentifier};\n'); - s.write('\n'); - s.write('/// Initialises the Dynamic library.\n'); - s.write( - 'void $_initFunctionIdentifier($ffiLibraryPrefix.DynamicLibrary dynamicLibrary){\n'); - s.write(' ${dylibIdentifier} = dynamicLibrary;\n'); - s.write('}\n'); - - // Write bindings. - for (final bs in _bindings) { - s.write(bs.string); + final dependencies = []; + + /// Get typedef dependencies, these will be written at the end. + for (final b in lookUpBindings) { + dependencies.addAll(b.getTypedefDependencies(this)); + } + for (final b in noLookUpBindings) { + dependencies.addAll(b.getTypedefDependencies(this)); } - return s.toString(); - } + /// Write [lookUpBindings]. + if (lookUpBindings.isNotEmpty) { + // Write doc comment for wrapper class. + if (classDocComment != null) { + s.write(makeDartDoc(classDocComment)); + } + // Write wrapper classs. + s.write('class $_className{\n'); + // Write dylib. + s.write('/// Holds the Dynamic library.\n'); + s.write('final $ffiLibraryPrefix.DynamicLibrary ${dylibIdentifier};\n'); + s.write('\n'); + //Write doc comment for wrapper class constructor. + s.write(makeDartDoc('The symbols are looked up in [dynamicLibrary].')); + // Write wrapper class constructor. + s.write( + '${_className}($ffiLibraryPrefix.DynamicLibrary dynamicLibrary): $dylibIdentifier = dynamicLibrary;\n\n'); + for (final b in lookUpBindings) { + s.write(b.toBindingString(this).string); + } + s.write('}\n\n'); + } - void addBindingString(BindingString b) { - _bindings.add(b); + /// Write [noLookUpBindings]. + for (final b in noLookUpBindings) { + s.write(b.toBindingString(this).string); + } + + // Write typedef dependencies. + for (final d in dependencies) { + s.write(d.toTypedefString(this)); + } + + return s.toString(); } } diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 7abfb66991..3e6e336de8 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -64,11 +64,15 @@ class Config { /// If tool should generate array workarounds. /// - /// If false(default), structs with inline array members will have all its members removed. + /// If false(default), structs with inline array members will have all its + /// members removed. bool arrayWorkaround; - /// Name of the init function used to initialise the dynamic library. - String initFunctionName; + /// Name of the wrapper class. + String wrapperName; + + /// Doc comment for the wrapper class. + String wrapperDocComment; /// Header of the generated bindings. String preamble; @@ -99,11 +103,13 @@ class Config { var _result = true; for (final key in specs.keys) { final spec = specs[key]; - if (spec.isRequired && !map.containsKey(key)) { + if (map.containsKey(key)) { + _result = _result && spec.validator(key, map[key]); + } else if (spec.requirement == Requirement.yes) { _logger.severe("Key '${key}' is required."); _result = false; - } else if (map.containsKey(key)) { - _result = _result && spec.validator(key, map[key]); + } else if (spec.requirement == Requirement.prefer) { + _logger.warning("Prefer adding Key '$key' to your config."); } } // Warn about unknown keys. @@ -137,7 +143,7 @@ class Config { return { strings.output: Specification( description: 'Output file name', - isRequired: true, + requirement: Requirement.yes, validator: outputValidator, extractor: outputExtractor, extractedResult: (dynamic result) => output = result as String, @@ -145,7 +151,7 @@ class Config { strings.libclang_dylib_folder: Specification( description: 'Path to folder containing libclang dynamic library, used to parse C headers', - isRequired: false, + requirement: Requirement.no, defaultValue: () => getDylibPath(Platform.script .resolve(path.join('..', 'tool', 'wrapped_libclang')) .toFilePath()), @@ -156,7 +162,7 @@ class Config { ), strings.headers: Specification>( description: 'List of C headers to generate bindings of', - isRequired: true, + requirement: Requirement.yes, validator: headersValidator, extractor: headersExtractor, extractedResult: (dynamic result) => headers = result as List, @@ -172,7 +178,7 @@ class Config { ), strings.compilerOpts: Specification>( description: 'Raw compiler options to pass to clang compiler', - isRequired: false, + requirement: Requirement.no, validator: compilerOptsValidator, extractor: compilerOptsExtractor, extractedResult: (dynamic result) => @@ -180,7 +186,7 @@ class Config { ), strings.functions: Specification( description: 'Filter for functions', - isRequired: false, + requirement: Requirement.no, validator: declarationConfigValidator, extractor: declarationConfigExtractor, defaultValue: () => Declaration(declarationTypeName: 'Function'), @@ -191,7 +197,7 @@ class Config { ), strings.structs: Specification( description: 'Filter for Structs', - isRequired: false, + requirement: Requirement.no, validator: declarationConfigValidator, extractor: declarationConfigExtractor, defaultValue: () => Declaration(declarationTypeName: 'Struct'), @@ -202,7 +208,7 @@ class Config { ), strings.enums: Specification( description: 'Filter for enums', - isRequired: false, + requirement: Requirement.no, validator: declarationConfigValidator, extractor: declarationConfigExtractor, defaultValue: () => Declaration(declarationTypeName: 'Enum'), @@ -227,7 +233,7 @@ class Config { ), strings.sort: Specification( description: 'whether or not to sort the bindings alphabetically', - isRequired: false, + requirement: Requirement.no, validator: booleanValidator, extractor: booleanExtractor, defaultValue: () => false, @@ -235,7 +241,7 @@ class Config { ), strings.useSupportedTypedefs: Specification( description: 'whether or not to directly map supported typedef by name', - isRequired: false, + requirement: Requirement.no, validator: booleanValidator, extractor: booleanExtractor, defaultValue: () => true, @@ -244,7 +250,7 @@ class Config { ), strings.comments: Specification( description: 'Type of comment to extract', - isRequired: false, + requirement: Requirement.no, validator: commentValidator, extractor: commentExtractor, defaultValue: () => strings.brief, @@ -253,24 +259,32 @@ class Config { strings.arrayWorkaround: Specification( description: 'whether or not to generate workarounds for inline arrays in structures', - isRequired: false, + requirement: Requirement.no, validator: booleanValidator, extractor: booleanExtractor, defaultValue: () => false, extractedResult: (dynamic result) => arrayWorkaround = result as bool, ), - strings.initFunctionName: Specification( - description: 'Name of the init function to use', - isRequired: false, + strings.name: Specification( + description: 'Name of the wrapper class', + requirement: Requirement.prefer, + validator: dartClassNameValidator, + extractor: stringExtractor, + defaultValue: () => 'NativeLibrary', + extractedResult: (dynamic result) => wrapperName = result as String, + ), + strings.description: Specification( + description: 'Doc comment for the wrapper class', + requirement: Requirement.prefer, validator: nonEmptyStringValidator, extractor: stringExtractor, - defaultValue: () => 'init', + defaultValue: () => null, extractedResult: (dynamic result) => - initFunctionName = result as String, + wrapperDocComment = result as String, ), strings.preamble: Specification( - description: 'Header String for the generated bindings', - isRequired: false, + description: 'Raw header string for the generated file', + requirement: Requirement.no, validator: nonEmptyStringValidator, extractor: stringExtractor, extractedResult: (dynamic result) => preamble = result as String, @@ -288,7 +302,7 @@ class Specification { final E Function(dynamic map) extractor; final E Function() defaultValue; - final bool isRequired; + final Requirement requirement; final void Function(dynamic result) extractedResult; Specification({ @@ -297,10 +311,12 @@ class Specification { @required this.validator, @required this.extractor, this.defaultValue, - this.isRequired = false, + this.requirement = Requirement.no, }); } +enum Requirement { yes, prefer, no } + class HeaderFilter { Set includedInclusionHeaders; Set excludedInclusionHeaders; diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 560cc597a2..70cccdd30a 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -280,6 +280,17 @@ bool nonEmptyStringValidator(String name, dynamic value) { } } +bool dartClassNameValidator(String name, dynamic value) { + if (value is String && + RegExp('[a-zA-Z]+[_a-zA-Z0-9]*').stringMatch(value) == value) { + return true; + } else { + _logger.severe( + "Expected value of key '$name' to be a valid public class name."); + return false; + } +} + String commentExtractor(dynamic value) => value as String; bool commentValidator(String name, dynamic value) { diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index e71a1621bf..2e6469c132 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -3,55 +3,613 @@ /// Generated by `package:ffigen`. import 'dart:ffi' as ffi; -/// Holds the Dynamic library. -ffi.DynamicLibrary _dylib; +/// Holds bindings to LibClang. +class Clang { + /// Holds the Dynamic library. + final ffi.DynamicLibrary _dylib; + + /// The symbols are looked up in [dynamicLIbrary]. + Clang(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + + /// Provides a shared context for creating translation units. + ffi.Pointer clang_createIndex( + int excludeDeclarationsFromPCH, + int displayDiagnostics, + ) { + _clang_createIndex ??= + _dylib.lookupFunction<_c_clang_createIndex, _dart_clang_createIndex>( + 'clang_createIndex'); + return _clang_createIndex( + excludeDeclarationsFromPCH, + displayDiagnostics, + ); + } -/// Initialises the Dynamic library. -void init(ffi.DynamicLibrary __dylib) { - _dylib = __dylib; -} + _dart_clang_createIndex _clang_createIndex; + + /// Destroy the given index. + void clang_disposeIndex( + ffi.Pointer index, + ) { + _clang_disposeIndex ??= + _dylib.lookupFunction<_c_clang_disposeIndex, _dart_clang_disposeIndex>( + 'clang_disposeIndex'); + return _clang_disposeIndex( + index, + ); + } -/// Describes how the traversal of the children of a particular cursor should -/// proceed after visiting a particular child cursor. -class CXChildVisitResult { - /// Terminates the cursor traversal. - static const int CXChildVisit_Break = 0; + _dart_clang_disposeIndex _clang_disposeIndex; + + /// Determine the number of diagnostics produced for the given translation + /// unit. + int clang_getNumDiagnostics( + ffi.Pointer Unit, + ) { + _clang_getNumDiagnostics ??= _dylib.lookupFunction< + _c_clang_getNumDiagnostics, + _dart_clang_getNumDiagnostics>('clang_getNumDiagnostics'); + return _clang_getNumDiagnostics( + Unit, + ); + } - /// Continues the cursor traversal with the next sibling of the cursor just - /// visited, without visiting its children. - static const int CXChildVisit_Continue = 1; + _dart_clang_getNumDiagnostics _clang_getNumDiagnostics; + + /// Retrieve a diagnostic associated with the given translation unit. + ffi.Pointer clang_getDiagnostic( + ffi.Pointer Unit, + int Index, + ) { + _clang_getDiagnostic ??= _dylib.lookupFunction<_c_clang_getDiagnostic, + _dart_clang_getDiagnostic>('clang_getDiagnostic'); + return _clang_getDiagnostic( + Unit, + Index, + ); + } - /// Recursively traverse the children of this cursor, using the same visitor - /// and client data. - static const int CXChildVisit_Recurse = 2; + _dart_clang_getDiagnostic _clang_getDiagnostic; + + /// Destroy a diagnostic. + void clang_disposeDiagnostic( + ffi.Pointer Diagnostic, + ) { + _clang_disposeDiagnostic ??= _dylib.lookupFunction< + _c_clang_disposeDiagnostic, + _dart_clang_disposeDiagnostic>('clang_disposeDiagnostic'); + return _clang_disposeDiagnostic( + Diagnostic, + ); + } + + _dart_clang_disposeDiagnostic _clang_disposeDiagnostic; + + /// Same as clang_parseTranslationUnit2, but returns the CXTranslationUnit + /// instead of an error code. In case of an error this routine returns a NULL + /// CXTranslationUnit, without further detailed error codes. + ffi.Pointer clang_parseTranslationUnit( + 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, + ) { + _clang_parseTranslationUnit ??= _dylib.lookupFunction< + _c_clang_parseTranslationUnit, + _dart_clang_parseTranslationUnit>('clang_parseTranslationUnit'); + return _clang_parseTranslationUnit( + CIdx, + source_filename, + command_line_args, + num_command_line_args, + unsaved_files, + num_unsaved_files, + options, + ); + } + + _dart_clang_parseTranslationUnit _clang_parseTranslationUnit; + + /// Destroy the specified CXTranslationUnit object. + void clang_disposeTranslationUnit( + ffi.Pointer arg0, + ) { + _clang_disposeTranslationUnit ??= _dylib.lookupFunction< + _c_clang_disposeTranslationUnit, + _dart_clang_disposeTranslationUnit>('clang_disposeTranslationUnit'); + return _clang_disposeTranslationUnit( + arg0, + ); + } + + _dart_clang_disposeTranslationUnit _clang_disposeTranslationUnit; + + ffi.Pointer clang_getCString_wrap( + ffi.Pointer string, + ) { + _clang_getCString_wrap ??= _dylib.lookupFunction<_c_clang_getCString_wrap, + _dart_clang_getCString_wrap>('clang_getCString_wrap'); + return _clang_getCString_wrap( + string, + ); + } + + _dart_clang_getCString_wrap _clang_getCString_wrap; + + void clang_disposeString_wrap( + ffi.Pointer string, + ) { + _clang_disposeString_wrap ??= _dylib.lookupFunction< + _c_clang_disposeString_wrap, + _dart_clang_disposeString_wrap>('clang_disposeString_wrap'); + return _clang_disposeString_wrap( + string, + ); + } + + _dart_clang_disposeString_wrap _clang_disposeString_wrap; + + int clang_getCursorKind_wrap( + ffi.Pointer cursor, + ) { + _clang_getCursorKind_wrap ??= _dylib.lookupFunction< + _c_clang_getCursorKind_wrap, + _dart_clang_getCursorKind_wrap>('clang_getCursorKind_wrap'); + return _clang_getCursorKind_wrap( + cursor, + ); + } + + _dart_clang_getCursorKind_wrap _clang_getCursorKind_wrap; + + ffi.Pointer clang_getCursorKindSpelling_wrap( + int kind, + ) { + _clang_getCursorKindSpelling_wrap ??= _dylib.lookupFunction< + _c_clang_getCursorKindSpelling_wrap, + _dart_clang_getCursorKindSpelling_wrap>( + 'clang_getCursorKindSpelling_wrap'); + return _clang_getCursorKindSpelling_wrap( + kind, + ); + } + + _dart_clang_getCursorKindSpelling_wrap _clang_getCursorKindSpelling_wrap; + + ffi.Pointer clang_getCursorType_wrap( + ffi.Pointer cursor, + ) { + _clang_getCursorType_wrap ??= _dylib.lookupFunction< + _c_clang_getCursorType_wrap, + _dart_clang_getCursorType_wrap>('clang_getCursorType_wrap'); + return _clang_getCursorType_wrap( + cursor, + ); + } + + _dart_clang_getCursorType_wrap _clang_getCursorType_wrap; + + ffi.Pointer clang_getTypeSpelling_wrap( + ffi.Pointer type, + ) { + _clang_getTypeSpelling_wrap ??= _dylib.lookupFunction< + _c_clang_getTypeSpelling_wrap, + _dart_clang_getTypeSpelling_wrap>('clang_getTypeSpelling_wrap'); + return _clang_getTypeSpelling_wrap( + type, + ); + } + + _dart_clang_getTypeSpelling_wrap _clang_getTypeSpelling_wrap; + + ffi.Pointer clang_getTypeKindSpelling_wrap( + int typeKind, + ) { + _clang_getTypeKindSpelling_wrap ??= _dylib.lookupFunction< + _c_clang_getTypeKindSpelling_wrap, + _dart_clang_getTypeKindSpelling_wrap>('clang_getTypeKindSpelling_wrap'); + return _clang_getTypeKindSpelling_wrap( + typeKind, + ); + } + + _dart_clang_getTypeKindSpelling_wrap _clang_getTypeKindSpelling_wrap; + + ffi.Pointer clang_getResultType_wrap( + ffi.Pointer functionType, + ) { + _clang_getResultType_wrap ??= _dylib.lookupFunction< + _c_clang_getResultType_wrap, + _dart_clang_getResultType_wrap>('clang_getResultType_wrap'); + return _clang_getResultType_wrap( + functionType, + ); + } + + _dart_clang_getResultType_wrap _clang_getResultType_wrap; + + ffi.Pointer clang_getPointeeType_wrap( + ffi.Pointer pointerType, + ) { + _clang_getPointeeType_wrap ??= _dylib.lookupFunction< + _c_clang_getPointeeType_wrap, + _dart_clang_getPointeeType_wrap>('clang_getPointeeType_wrap'); + return _clang_getPointeeType_wrap( + pointerType, + ); + } + + _dart_clang_getPointeeType_wrap _clang_getPointeeType_wrap; + + ffi.Pointer clang_getCanonicalType_wrap( + ffi.Pointer typerefType, + ) { + _clang_getCanonicalType_wrap ??= _dylib.lookupFunction< + _c_clang_getCanonicalType_wrap, + _dart_clang_getCanonicalType_wrap>('clang_getCanonicalType_wrap'); + return _clang_getCanonicalType_wrap( + typerefType, + ); + } + + _dart_clang_getCanonicalType_wrap _clang_getCanonicalType_wrap; + + ffi.Pointer clang_Type_getNamedType_wrap( + ffi.Pointer elaboratedType, + ) { + _clang_Type_getNamedType_wrap ??= _dylib.lookupFunction< + _c_clang_Type_getNamedType_wrap, + _dart_clang_Type_getNamedType_wrap>('clang_Type_getNamedType_wrap'); + return _clang_Type_getNamedType_wrap( + elaboratedType, + ); + } + + _dart_clang_Type_getNamedType_wrap _clang_Type_getNamedType_wrap; + + ffi.Pointer clang_getTypeDeclaration_wrap( + ffi.Pointer cxtype, + ) { + _clang_getTypeDeclaration_wrap ??= _dylib.lookupFunction< + _c_clang_getTypeDeclaration_wrap, + _dart_clang_getTypeDeclaration_wrap>('clang_getTypeDeclaration_wrap'); + return _clang_getTypeDeclaration_wrap( + cxtype, + ); + } + + _dart_clang_getTypeDeclaration_wrap _clang_getTypeDeclaration_wrap; + + ffi.Pointer clang_getTypedefDeclUnderlyingType_wrap( + ffi.Pointer cxcursor, + ) { + _clang_getTypedefDeclUnderlyingType_wrap ??= _dylib.lookupFunction< + _c_clang_getTypedefDeclUnderlyingType_wrap, + _dart_clang_getTypedefDeclUnderlyingType_wrap>( + 'clang_getTypedefDeclUnderlyingType_wrap'); + return _clang_getTypedefDeclUnderlyingType_wrap( + cxcursor, + ); + } + + _dart_clang_getTypedefDeclUnderlyingType_wrap + _clang_getTypedefDeclUnderlyingType_wrap; + + /// The name of parameter, struct, typedef. + ffi.Pointer clang_getCursorSpelling_wrap( + ffi.Pointer cursor, + ) { + _clang_getCursorSpelling_wrap ??= _dylib.lookupFunction< + _c_clang_getCursorSpelling_wrap, + _dart_clang_getCursorSpelling_wrap>('clang_getCursorSpelling_wrap'); + return _clang_getCursorSpelling_wrap( + cursor, + ); + } + + _dart_clang_getCursorSpelling_wrap _clang_getCursorSpelling_wrap; + + ffi.Pointer clang_getTranslationUnitCursor_wrap( + ffi.Pointer tu, + ) { + _clang_getTranslationUnitCursor_wrap ??= _dylib.lookupFunction< + _c_clang_getTranslationUnitCursor_wrap, + _dart_clang_getTranslationUnitCursor_wrap>( + 'clang_getTranslationUnitCursor_wrap'); + return _clang_getTranslationUnitCursor_wrap( + tu, + ); + } + + _dart_clang_getTranslationUnitCursor_wrap + _clang_getTranslationUnitCursor_wrap; + + ffi.Pointer clang_formatDiagnostic_wrap( + ffi.Pointer diag, + int opts, + ) { + _clang_formatDiagnostic_wrap ??= _dylib.lookupFunction< + _c_clang_formatDiagnostic_wrap, + _dart_clang_formatDiagnostic_wrap>('clang_formatDiagnostic_wrap'); + return _clang_formatDiagnostic_wrap( + diag, + opts, + ); + } + + _dart_clang_formatDiagnostic_wrap _clang_formatDiagnostic_wrap; + + /// Visitor is a function pointer with parameters having pointers to cxcursor + /// instead of cxcursor by default. + int clang_visitChildren_wrap( + ffi.Pointer parent, + ffi.Pointer> _modifiedVisitor, + ffi.Pointer clientData, + ) { + _clang_visitChildren_wrap ??= _dylib.lookupFunction< + _c_clang_visitChildren_wrap, + _dart_clang_visitChildren_wrap>('clang_visitChildren_wrap'); + return _clang_visitChildren_wrap( + parent, + _modifiedVisitor, + clientData, + ); + } + + _dart_clang_visitChildren_wrap _clang_visitChildren_wrap; + + int clang_Cursor_getNumArguments_wrap( + ffi.Pointer cursor, + ) { + _clang_Cursor_getNumArguments_wrap ??= _dylib.lookupFunction< + _c_clang_Cursor_getNumArguments_wrap, + _dart_clang_Cursor_getNumArguments_wrap>( + 'clang_Cursor_getNumArguments_wrap'); + return _clang_Cursor_getNumArguments_wrap( + cursor, + ); + } + + _dart_clang_Cursor_getNumArguments_wrap _clang_Cursor_getNumArguments_wrap; + + ffi.Pointer clang_Cursor_getArgument_wrap( + ffi.Pointer cursor, + int i, + ) { + _clang_Cursor_getArgument_wrap ??= _dylib.lookupFunction< + _c_clang_Cursor_getArgument_wrap, + _dart_clang_Cursor_getArgument_wrap>('clang_Cursor_getArgument_wrap'); + return _clang_Cursor_getArgument_wrap( + cursor, + i, + ); + } + + _dart_clang_Cursor_getArgument_wrap _clang_Cursor_getArgument_wrap; + + int clang_getNumArgTypes_wrap( + ffi.Pointer cxtype, + ) { + _clang_getNumArgTypes_wrap ??= _dylib.lookupFunction< + _c_clang_getNumArgTypes_wrap, + _dart_clang_getNumArgTypes_wrap>('clang_getNumArgTypes_wrap'); + return _clang_getNumArgTypes_wrap( + cxtype, + ); + } + + _dart_clang_getNumArgTypes_wrap _clang_getNumArgTypes_wrap; + + ffi.Pointer clang_getArgType_wrap( + ffi.Pointer cxtype, + int i, + ) { + _clang_getArgType_wrap ??= _dylib.lookupFunction<_c_clang_getArgType_wrap, + _dart_clang_getArgType_wrap>('clang_getArgType_wrap'); + return _clang_getArgType_wrap( + cxtype, + i, + ); + } + + _dart_clang_getArgType_wrap _clang_getArgType_wrap; + + int clang_getEnumConstantDeclValue_wrap( + ffi.Pointer cursor, + ) { + _clang_getEnumConstantDeclValue_wrap ??= _dylib.lookupFunction< + _c_clang_getEnumConstantDeclValue_wrap, + _dart_clang_getEnumConstantDeclValue_wrap>( + 'clang_getEnumConstantDeclValue_wrap'); + return _clang_getEnumConstantDeclValue_wrap( + cursor, + ); + } + + _dart_clang_getEnumConstantDeclValue_wrap + _clang_getEnumConstantDeclValue_wrap; + + /// Returns non-zero if the ranges are the same, zero if they differ. + int clang_equalRanges_wrap( + ffi.Pointer c1, + ffi.Pointer c2, + ) { + _clang_equalRanges_wrap ??= _dylib.lookupFunction<_c_clang_equalRanges_wrap, + _dart_clang_equalRanges_wrap>('clang_equalRanges_wrap'); + return _clang_equalRanges_wrap( + c1, + c2, + ); + } + + _dart_clang_equalRanges_wrap _clang_equalRanges_wrap; + + /// Returns the comment range. + ffi.Pointer clang_Cursor_getCommentRange_wrap( + ffi.Pointer cursor, + ) { + _clang_Cursor_getCommentRange_wrap ??= _dylib.lookupFunction< + _c_clang_Cursor_getCommentRange_wrap, + _dart_clang_Cursor_getCommentRange_wrap>( + 'clang_Cursor_getCommentRange_wrap'); + return _clang_Cursor_getCommentRange_wrap( + cursor, + ); + } + + _dart_clang_Cursor_getCommentRange_wrap _clang_Cursor_getCommentRange_wrap; + + /// Returns the raw comment. + ffi.Pointer clang_Cursor_getRawCommentText_wrap( + ffi.Pointer cursor, + ) { + _clang_Cursor_getRawCommentText_wrap ??= _dylib.lookupFunction< + _c_clang_Cursor_getRawCommentText_wrap, + _dart_clang_Cursor_getRawCommentText_wrap>( + 'clang_Cursor_getRawCommentText_wrap'); + return _clang_Cursor_getRawCommentText_wrap( + cursor, + ); + } + + _dart_clang_Cursor_getRawCommentText_wrap + _clang_Cursor_getRawCommentText_wrap; + + /// Returns the first paragraph of doxygen doc comment. + ffi.Pointer clang_Cursor_getBriefCommentText_wrap( + ffi.Pointer cursor, + ) { + _clang_Cursor_getBriefCommentText_wrap ??= _dylib.lookupFunction< + _c_clang_Cursor_getBriefCommentText_wrap, + _dart_clang_Cursor_getBriefCommentText_wrap>( + 'clang_Cursor_getBriefCommentText_wrap'); + return _clang_Cursor_getBriefCommentText_wrap( + cursor, + ); + } + + _dart_clang_Cursor_getBriefCommentText_wrap + _clang_Cursor_getBriefCommentText_wrap; + + ffi.Pointer clang_getCursorLocation_wrap( + ffi.Pointer cursor, + ) { + _clang_getCursorLocation_wrap ??= _dylib.lookupFunction< + _c_clang_getCursorLocation_wrap, + _dart_clang_getCursorLocation_wrap>('clang_getCursorLocation_wrap'); + return _clang_getCursorLocation_wrap( + cursor, + ); + } + + _dart_clang_getCursorLocation_wrap _clang_getCursorLocation_wrap; + + void clang_getFileLocation_wrap( + ffi.Pointer location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, + ) { + _clang_getFileLocation_wrap ??= _dylib.lookupFunction< + _c_clang_getFileLocation_wrap, + _dart_clang_getFileLocation_wrap>('clang_getFileLocation_wrap'); + return _clang_getFileLocation_wrap( + location, + file, + line, + column, + offset, + ); + } + + _dart_clang_getFileLocation_wrap _clang_getFileLocation_wrap; + + ffi.Pointer clang_getFileName_wrap( + ffi.Pointer SFile, + ) { + _clang_getFileName_wrap ??= _dylib.lookupFunction<_c_clang_getFileName_wrap, + _dart_clang_getFileName_wrap>('clang_getFileName_wrap'); + return _clang_getFileName_wrap( + SFile, + ); + } + + _dart_clang_getFileName_wrap _clang_getFileName_wrap; + + int clang_getNumElements_wrap( + ffi.Pointer cxtype, + ) { + _clang_getNumElements_wrap ??= _dylib.lookupFunction< + _c_clang_getNumElements_wrap, + _dart_clang_getNumElements_wrap>('clang_getNumElements_wrap'); + return _clang_getNumElements_wrap( + cxtype, + ); + } + + _dart_clang_getNumElements_wrap _clang_getNumElements_wrap; + + ffi.Pointer clang_getArrayElementType_wrap( + ffi.Pointer cxtype, + ) { + _clang_getArrayElementType_wrap ??= _dylib.lookupFunction< + _c_clang_getArrayElementType_wrap, + _dart_clang_getArrayElementType_wrap>('clang_getArrayElementType_wrap'); + return _clang_getArrayElementType_wrap( + cxtype, + ); + } + + _dart_clang_getArrayElementType_wrap _clang_getArrayElementType_wrap; } -/// A cursor representing some element in the abstract syntax tree for a -/// translation unit. -class CXCursor extends ffi.Struct { - @ffi.Int32() - int kind; +/// A character string. +class CXString extends ffi.Struct { + ffi.Pointer data; - @ffi.Int32() - int xdata; + @ffi.Uint32() + int private_flags; +} - ffi.Pointer _exp_workaround_data_item_0; - ffi.Pointer _exp_workaround_data_item_1; - ffi.Pointer _exp_workaround_data_item_2; +class CXTranslationUnitImpl extends ffi.Struct {} - /// Helper for array `data`. - ArrayHelper_CXCursor_data_level0 get data => - ArrayHelper_CXCursor_data_level0(this, [3], 0, 0); +/// 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. + ffi.Pointer Filename; + + /// A buffer containing the unsaved contents of this file. + ffi.Pointer Contents; + + /// The length of the unsaved contents of this buffer. + @ffi.Uint64() + int Length; } -/// Helper for array `data` in struct `CXCursor`. -class ArrayHelper_CXCursor_data_level0 { - final CXCursor _struct; +/// Identifies a specific source location within a translation unit. +class CXSourceLocation extends ffi.Struct { + ffi.Pointer _unique_ptr_data_item_0; + 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() + 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_CXCursor_data_level0( + ArrayHelper_CXSourceLocation_ptr_data_level0( this._struct, this.dimensions, this.level, this._absoluteIndex); void _checkBounds(int index) { if (index >= length || index < 0) { @@ -64,11 +622,9 @@ class ArrayHelper_CXCursor_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - return _struct._exp_workaround_data_item_0; + return _struct._unique_ptr_data_item_0; case 1: - return _struct._exp_workaround_data_item_1; - case 2: - return _struct._exp_workaround_data_item_2; + return _struct._unique_ptr_data_item_1; default: throw Exception('Invalid Array Helper generated.'); } @@ -78,13 +634,68 @@ class ArrayHelper_CXCursor_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - _struct._exp_workaround_data_item_0 = value; + _struct._unique_ptr_data_item_0 = value; break; case 1: - _struct._exp_workaround_data_item_1 = value; + _struct._unique_ptr_data_item_1 = value; break; - case 2: - _struct._exp_workaround_data_item_2 = value; + default: + throw Exception('Invalid Array Helper generated.'); + } + } +} + +/// Identifies a half-open character range in the source code. +class CXSourceRange extends ffi.Struct { + ffi.Pointer _unique_ptr_data_item_0; + 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() + int begin_int_data; + + @ffi.Uint32() + 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.'); @@ -92,6 +703,93 @@ class ArrayHelper_CXCursor_data_level0 { } } +/// Options to control the display of diagnostics. +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. +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; +} + /// Describes the kind of entity that a cursor refers to. class CXCursorKind { /// A declaration whose specific kind is not exposed via this interface. @@ -663,318 +1361,113 @@ class CXCursorKind { 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 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; -} - -/// Options to control the display of diagnostics. -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; -} - -/// Identifies a specific source location within a translation unit. -class CXSourceLocation extends ffi.Struct { - ffi.Pointer _exp_workaround_ptr_data_item_0; - ffi.Pointer _exp_workaround_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() - 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._exp_workaround_ptr_data_item_0; - case 1: - return _struct._exp_workaround_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._exp_workaround_ptr_data_item_0 = value; - break; - case 1: - _struct._exp_workaround_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 { - ffi.Pointer _exp_workaround_ptr_data_item_0; - ffi.Pointer _exp_workaround_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() - int begin_int_data; - - @ffi.Uint32() - 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._exp_workaround_ptr_data_item_0; - case 1: - return _struct._exp_workaround_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._exp_workaround_ptr_data_item_0 = value; - break; - case 1: - _struct._exp_workaround_ptr_data_item_1 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } - } -} - -/// A character string. -class CXString extends ffi.Struct { - ffi.Pointer data; - - @ffi.Uint32() - int private_flags; -} - -class CXTranslationUnitImpl extends ffi.Struct {} - -/// Flags that control the creation of translation units. -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; + static const int CXCursor_OMPMasterTaskLoopSimdDirective = 283; - /// Do not stop processing when fatal errors are encountered. - static const int CXTranslationUnit_KeepGoing = 512; + /// OpenMP parallel master taskloop simd directive. + static const int CXCursor_OMPParallelMasterTaskLoopSimdDirective = 284; - /// Sets the preprocessor in a mode for parsing a single file only. - static const int CXTranslationUnit_SingleFileParse = 1024; + /// OpenMP parallel master directive. + static const int CXCursor_OMPParallelMasterDirective = 285; + static const int CXCursor_LastStmt = 285; - /// Used in combination with CXTranslationUnit_SkipFunctionBodies to constrain - /// the skipping of function bodies to the preamble. - static const int CXTranslationUnit_LimitSkipFunctionBodiesToPreamble = 2048; + /// Cursor that represents the translation unit itself. + static const int CXCursor_TranslationUnit = 300; + static const int CXCursor_FirstAttr = 400; - /// Used to indicate that attributed types should be included in CXType. - static const int CXTranslationUnit_IncludeAttributedTypes = 4096; + /// 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; - /// Used to indicate that implicit attributes should be visited. - static const int CXTranslationUnit_VisitImplicitAttributes = 8192; + /// A module import declaration. + static const int CXCursor_ModuleImportDecl = 600; + static const int CXCursor_TypeAliasTemplateDecl = 601; - /// Used to indicate that non-errors from included files should be ignored. - static const int CXTranslationUnit_IgnoreNonErrorsFromIncludedFiles = 16384; + /// A static_assert or _Static_assert node + static const int CXCursor_StaticAssert = 602; - /// Tells the preprocessor not to skip excluded conditional blocks. - static const int CXTranslationUnit_RetainExcludedConditionalBlocks = 32768; + /// 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; } -/// The type of an element in the abstract syntax tree. -class CXType extends ffi.Struct { +/// A cursor representing some element in the abstract syntax tree for a +/// translation unit. +class CXCursor extends ffi.Struct { @ffi.Int32() int kind; - ffi.Pointer _exp_workaround_data_item_0; - ffi.Pointer _exp_workaround_data_item_1; + @ffi.Int32() + int xdata; + + ffi.Pointer _unique_data_item_0; + ffi.Pointer _unique_data_item_1; + ffi.Pointer _unique_data_item_2; /// Helper for array `data`. - ArrayHelper_CXType_data_level0 get data => - ArrayHelper_CXType_data_level0(this, [2], 0, 0); + ArrayHelper_CXCursor_data_level0 get data => + ArrayHelper_CXCursor_data_level0(this, [3], 0, 0); } -/// Helper for array `data` in struct `CXType`. -class ArrayHelper_CXType_data_level0 { - final CXType _struct; +/// 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_CXType_data_level0( + ArrayHelper_CXCursor_data_level0( this._struct, this.dimensions, this.level, this._absoluteIndex); void _checkBounds(int index) { if (index >= length || index < 0) { @@ -987,9 +1480,11 @@ class ArrayHelper_CXType_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - return _struct._exp_workaround_data_item_0; + return _struct._unique_data_item_0; case 1: - return _struct._exp_workaround_data_item_1; + return _struct._unique_data_item_1; + case 2: + return _struct._unique_data_item_2; default: throw Exception('Invalid Array Helper generated.'); } @@ -999,10 +1494,13 @@ class ArrayHelper_CXType_data_level0 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - _struct._exp_workaround_data_item_0 = value; + _struct._unique_data_item_0 = value; break; case 1: - _struct._exp_workaround_data_item_1 = value; + _struct._unique_data_item_1 = value; + break; + case 2: + _struct._unique_data_item_2 = value; break; default: throw Exception('Invalid Array Helper generated.'); @@ -1137,174 +1635,77 @@ class CXTypeKind { static const int CXType_ExtVector = 176; } -/// 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. - ffi.Pointer Filename; - - /// A buffer containing the unsaved contents of this file. - ffi.Pointer Contents; - - /// The length of the unsaved contents of this buffer. - @ffi.Uint64() - int Length; -} - -ffi.Pointer clang_Cursor_getArgument_wrap( - ffi.Pointer cursor, - int i, -) { - return _clang_Cursor_getArgument_wrap( - cursor, - i, - ); -} - -final _dart_clang_Cursor_getArgument_wrap _clang_Cursor_getArgument_wrap = - _dylib.lookupFunction<_c_clang_Cursor_getArgument_wrap, - _dart_clang_Cursor_getArgument_wrap>('clang_Cursor_getArgument_wrap'); - -typedef _c_clang_Cursor_getArgument_wrap = ffi.Pointer Function( - ffi.Pointer cursor, - ffi.Uint32 i, -); - -typedef _dart_clang_Cursor_getArgument_wrap = ffi.Pointer Function( - ffi.Pointer cursor, - int i, -); - -/// Returns the first paragraph of doxygen doc comment. -ffi.Pointer clang_Cursor_getBriefCommentText_wrap( - ffi.Pointer cursor, -) { - return _clang_Cursor_getBriefCommentText_wrap( - cursor, - ); -} - -final _dart_clang_Cursor_getBriefCommentText_wrap - _clang_Cursor_getBriefCommentText_wrap = _dylib.lookupFunction< - _c_clang_Cursor_getBriefCommentText_wrap, - _dart_clang_Cursor_getBriefCommentText_wrap>( - 'clang_Cursor_getBriefCommentText_wrap'); - -typedef _c_clang_Cursor_getBriefCommentText_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, -); - -typedef _dart_clang_Cursor_getBriefCommentText_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, -); - -/// Returns the comment range. -ffi.Pointer clang_Cursor_getCommentRange_wrap( - ffi.Pointer cursor, -) { - return _clang_Cursor_getCommentRange_wrap( - cursor, - ); -} - -final _dart_clang_Cursor_getCommentRange_wrap - _clang_Cursor_getCommentRange_wrap = _dylib.lookupFunction< - _c_clang_Cursor_getCommentRange_wrap, - _dart_clang_Cursor_getCommentRange_wrap>( - 'clang_Cursor_getCommentRange_wrap'); - -typedef _c_clang_Cursor_getCommentRange_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, -); - -typedef _dart_clang_Cursor_getCommentRange_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, -); - -int clang_Cursor_getNumArguments_wrap( - ffi.Pointer cursor, -) { - return _clang_Cursor_getNumArguments_wrap( - cursor, - ); -} - -final _dart_clang_Cursor_getNumArguments_wrap - _clang_Cursor_getNumArguments_wrap = _dylib.lookupFunction< - _c_clang_Cursor_getNumArguments_wrap, - _dart_clang_Cursor_getNumArguments_wrap>( - 'clang_Cursor_getNumArguments_wrap'); - -typedef _c_clang_Cursor_getNumArguments_wrap = ffi.Int32 Function( - ffi.Pointer cursor, -); +/// The type of an element in the abstract syntax tree. +class CXType extends ffi.Struct { + @ffi.Int32() + int kind; -typedef _dart_clang_Cursor_getNumArguments_wrap = int Function( - ffi.Pointer cursor, -); + ffi.Pointer _unique_data_item_0; + ffi.Pointer _unique_data_item_1; -/// Returns the raw comment. -ffi.Pointer clang_Cursor_getRawCommentText_wrap( - ffi.Pointer cursor, -) { - return _clang_Cursor_getRawCommentText_wrap( - cursor, - ); + /// Helper for array `data`. + ArrayHelper_CXType_data_level0 get data => + ArrayHelper_CXType_data_level0(this, [2], 0, 0); } -final _dart_clang_Cursor_getRawCommentText_wrap - _clang_Cursor_getRawCommentText_wrap = _dylib.lookupFunction< - _c_clang_Cursor_getRawCommentText_wrap, - _dart_clang_Cursor_getRawCommentText_wrap>( - 'clang_Cursor_getRawCommentText_wrap'); - -typedef _c_clang_Cursor_getRawCommentText_wrap = ffi.Pointer Function( - ffi.Pointer cursor, -); +/// 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_Cursor_getRawCommentText_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, -); + 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.'); + } + } -ffi.Pointer clang_Type_getNamedType_wrap( - ffi.Pointer elaboratedType, -) { - return _clang_Type_getNamedType_wrap( - elaboratedType, - ); + 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.'); + } + } } -final _dart_clang_Type_getNamedType_wrap _clang_Type_getNamedType_wrap = - _dylib.lookupFunction<_c_clang_Type_getNamedType_wrap, - _dart_clang_Type_getNamedType_wrap>('clang_Type_getNamedType_wrap'); - -typedef _c_clang_Type_getNamedType_wrap = ffi.Pointer Function( - ffi.Pointer elaboratedType, -); +/// Describes how the traversal of the children of a particular cursor should +/// proceed after visiting a particular child cursor. +class CXChildVisitResult { + /// Terminates the cursor traversal. + static const int CXChildVisit_Break = 0; -typedef _dart_clang_Type_getNamedType_wrap = ffi.Pointer Function( - ffi.Pointer elaboratedType, -); + /// Continues the cursor traversal with the next sibling of the cursor just + /// visited, without visiting its children. + static const int CXChildVisit_Continue = 1; -/// Provides a shared context for creating translation units. -ffi.Pointer clang_createIndex( - int excludeDeclarationsFromPCH, - int displayDiagnostics, -) { - return _clang_createIndex( - excludeDeclarationsFromPCH, - displayDiagnostics, - ); + /// Recursively traverse the children of this cursor, using the same visitor + /// and client data. + static const int CXChildVisit_Recurse = 2; } -final _dart_clang_createIndex _clang_createIndex = - _dylib.lookupFunction<_c_clang_createIndex, _dart_clang_createIndex>( - 'clang_createIndex'); - typedef _c_clang_createIndex = ffi.Pointer Function( ffi.Int32 excludeDeclarationsFromPCH, ffi.Int32 displayDiagnostics, @@ -1315,40 +1716,6 @@ typedef _dart_clang_createIndex = ffi.Pointer Function( int displayDiagnostics, ); -/// Destroy a diagnostic. -void clang_disposeDiagnostic( - ffi.Pointer Diagnostic, -) { - return _clang_disposeDiagnostic( - Diagnostic, - ); -} - -final _dart_clang_disposeDiagnostic _clang_disposeDiagnostic = _dylib - .lookupFunction<_c_clang_disposeDiagnostic, _dart_clang_disposeDiagnostic>( - 'clang_disposeDiagnostic'); - -typedef _c_clang_disposeDiagnostic = ffi.Void Function( - ffi.Pointer Diagnostic, -); - -typedef _dart_clang_disposeDiagnostic = void Function( - ffi.Pointer Diagnostic, -); - -/// Destroy the given index. -void clang_disposeIndex( - ffi.Pointer index, -) { - return _clang_disposeIndex( - index, - ); -} - -final _dart_clang_disposeIndex _clang_disposeIndex = - _dylib.lookupFunction<_c_clang_disposeIndex, _dart_clang_disposeIndex>( - 'clang_disposeIndex'); - typedef _c_clang_disposeIndex = ffi.Void Function( ffi.Pointer index, ); @@ -1357,152 +1724,62 @@ typedef _dart_clang_disposeIndex = void Function( ffi.Pointer index, ); -void clang_disposeString_wrap( - ffi.Pointer string, -) { - return _clang_disposeString_wrap( - string, - ); -} - -final _dart_clang_disposeString_wrap _clang_disposeString_wrap = - _dylib.lookupFunction<_c_clang_disposeString_wrap, - _dart_clang_disposeString_wrap>('clang_disposeString_wrap'); - -typedef _c_clang_disposeString_wrap = ffi.Void Function( - ffi.Pointer string, -); - -typedef _dart_clang_disposeString_wrap = void Function( - ffi.Pointer string, -); - -/// Destroy the specified CXTranslationUnit object. -void clang_disposeTranslationUnit( - ffi.Pointer arg0, -) { - return _clang_disposeTranslationUnit( - arg0, - ); -} - -final _dart_clang_disposeTranslationUnit _clang_disposeTranslationUnit = - _dylib.lookupFunction<_c_clang_disposeTranslationUnit, - _dart_clang_disposeTranslationUnit>('clang_disposeTranslationUnit'); - -typedef _c_clang_disposeTranslationUnit = ffi.Void Function( - ffi.Pointer arg0, +typedef _c_clang_getNumDiagnostics = ffi.Uint32 Function( + ffi.Pointer Unit, ); -typedef _dart_clang_disposeTranslationUnit = void Function( - ffi.Pointer arg0, +typedef _dart_clang_getNumDiagnostics = int Function( + ffi.Pointer Unit, ); -/// Returns non-zero if the ranges are the same, zero if they differ. -int clang_equalRanges_wrap( - ffi.Pointer c1, - ffi.Pointer c2, -) { - return _clang_equalRanges_wrap( - c1, - c2, - ); -} - -final _dart_clang_equalRanges_wrap _clang_equalRanges_wrap = _dylib - .lookupFunction<_c_clang_equalRanges_wrap, _dart_clang_equalRanges_wrap>( - 'clang_equalRanges_wrap'); - -typedef _c_clang_equalRanges_wrap = ffi.Uint32 Function( - ffi.Pointer c1, - ffi.Pointer c2, +typedef _c_clang_getDiagnostic = ffi.Pointer Function( + ffi.Pointer Unit, + ffi.Uint32 Index, ); -typedef _dart_clang_equalRanges_wrap = int Function( - ffi.Pointer c1, - ffi.Pointer c2, +typedef _dart_clang_getDiagnostic = ffi.Pointer Function( + ffi.Pointer Unit, + int Index, ); -ffi.Pointer clang_formatDiagnostic_wrap( - ffi.Pointer diag, - int opts, -) { - return _clang_formatDiagnostic_wrap( - diag, - opts, - ); -} - -final _dart_clang_formatDiagnostic_wrap _clang_formatDiagnostic_wrap = - _dylib.lookupFunction<_c_clang_formatDiagnostic_wrap, - _dart_clang_formatDiagnostic_wrap>('clang_formatDiagnostic_wrap'); - -typedef _c_clang_formatDiagnostic_wrap = ffi.Pointer Function( - ffi.Pointer diag, - ffi.Int32 opts, +typedef _c_clang_disposeDiagnostic = ffi.Void Function( + ffi.Pointer Diagnostic, ); -typedef _dart_clang_formatDiagnostic_wrap = ffi.Pointer Function( - ffi.Pointer diag, - int opts, +typedef _dart_clang_disposeDiagnostic = void Function( + ffi.Pointer Diagnostic, ); -ffi.Pointer clang_getArgType_wrap( - ffi.Pointer cxtype, - int i, -) { - return _clang_getArgType_wrap( - cxtype, - i, - ); -} - -final _dart_clang_getArgType_wrap _clang_getArgType_wrap = _dylib - .lookupFunction<_c_clang_getArgType_wrap, _dart_clang_getArgType_wrap>( - 'clang_getArgType_wrap'); - -typedef _c_clang_getArgType_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, - ffi.Uint32 i, +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_getArgType_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, - int i, +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, ); -ffi.Pointer clang_getArrayElementType_wrap( - ffi.Pointer cxtype, -) { - return _clang_getArrayElementType_wrap( - cxtype, - ); -} - -final _dart_clang_getArrayElementType_wrap _clang_getArrayElementType_wrap = - _dylib.lookupFunction<_c_clang_getArrayElementType_wrap, - _dart_clang_getArrayElementType_wrap>('clang_getArrayElementType_wrap'); - -typedef _c_clang_getArrayElementType_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, +typedef _c_clang_disposeTranslationUnit = ffi.Void Function( + ffi.Pointer arg0, ); -typedef _dart_clang_getArrayElementType_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, +typedef _dart_clang_disposeTranslationUnit = void Function( + ffi.Pointer arg0, ); -ffi.Pointer clang_getCString_wrap( - ffi.Pointer string, -) { - return _clang_getCString_wrap( - string, - ); -} - -final _dart_clang_getCString_wrap _clang_getCString_wrap = _dylib - .lookupFunction<_c_clang_getCString_wrap, _dart_clang_getCString_wrap>( - 'clang_getCString_wrap'); - typedef _c_clang_getCString_wrap = ffi.Pointer Function( ffi.Pointer string, ); @@ -1511,59 +1788,14 @@ typedef _dart_clang_getCString_wrap = ffi.Pointer Function( ffi.Pointer string, ); -ffi.Pointer clang_getCanonicalType_wrap( - ffi.Pointer typerefType, -) { - return _clang_getCanonicalType_wrap( - typerefType, - ); -} - -final _dart_clang_getCanonicalType_wrap _clang_getCanonicalType_wrap = - _dylib.lookupFunction<_c_clang_getCanonicalType_wrap, - _dart_clang_getCanonicalType_wrap>('clang_getCanonicalType_wrap'); - -typedef _c_clang_getCanonicalType_wrap = ffi.Pointer Function( - ffi.Pointer typerefType, -); - -typedef _dart_clang_getCanonicalType_wrap = ffi.Pointer Function( - ffi.Pointer typerefType, -); - -ffi.Pointer clang_getCursorKindSpelling_wrap( - int kind, -) { - return _clang_getCursorKindSpelling_wrap( - kind, - ); -} - -final _dart_clang_getCursorKindSpelling_wrap _clang_getCursorKindSpelling_wrap = - _dylib.lookupFunction<_c_clang_getCursorKindSpelling_wrap, - _dart_clang_getCursorKindSpelling_wrap>( - 'clang_getCursorKindSpelling_wrap'); - -typedef _c_clang_getCursorKindSpelling_wrap = ffi.Pointer Function( - ffi.Int32 kind, +typedef _c_clang_disposeString_wrap = ffi.Void Function( + ffi.Pointer string, ); -typedef _dart_clang_getCursorKindSpelling_wrap = ffi.Pointer Function( - int kind, +typedef _dart_clang_disposeString_wrap = void Function( + ffi.Pointer string, ); -int clang_getCursorKind_wrap( - ffi.Pointer cursor, -) { - return _clang_getCursorKind_wrap( - cursor, - ); -} - -final _dart_clang_getCursorKind_wrap _clang_getCursorKind_wrap = - _dylib.lookupFunction<_c_clang_getCursorKind_wrap, - _dart_clang_getCursorKind_wrap>('clang_getCursorKind_wrap'); - typedef _c_clang_getCursorKind_wrap = ffi.Int32 Function( ffi.Pointer cursor, ); @@ -1572,61 +1804,14 @@ typedef _dart_clang_getCursorKind_wrap = int Function( ffi.Pointer cursor, ); -ffi.Pointer clang_getCursorLocation_wrap( - ffi.Pointer cursor, -) { - return _clang_getCursorLocation_wrap( - cursor, - ); -} - -final _dart_clang_getCursorLocation_wrap _clang_getCursorLocation_wrap = - _dylib.lookupFunction<_c_clang_getCursorLocation_wrap, - _dart_clang_getCursorLocation_wrap>('clang_getCursorLocation_wrap'); - -typedef _c_clang_getCursorLocation_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, -); - -typedef _dart_clang_getCursorLocation_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, -); - -/// The name of parameter, struct, typedef. -ffi.Pointer clang_getCursorSpelling_wrap( - ffi.Pointer cursor, -) { - return _clang_getCursorSpelling_wrap( - cursor, - ); -} - -final _dart_clang_getCursorSpelling_wrap _clang_getCursorSpelling_wrap = - _dylib.lookupFunction<_c_clang_getCursorSpelling_wrap, - _dart_clang_getCursorSpelling_wrap>('clang_getCursorSpelling_wrap'); - -typedef _c_clang_getCursorSpelling_wrap = ffi.Pointer Function( - ffi.Pointer cursor, +typedef _c_clang_getCursorKindSpelling_wrap = ffi.Pointer Function( + ffi.Int32 kind, ); -typedef _dart_clang_getCursorSpelling_wrap = ffi.Pointer Function( - ffi.Pointer cursor, +typedef _dart_clang_getCursorKindSpelling_wrap = ffi.Pointer Function( + int kind, ); -ffi.Pointer clang_getCursorType_wrap( - ffi.Pointer cursor, -) { - return _clang_getCursorType_wrap( - cursor, - ); -} - -final _dart_clang_getCursorType_wrap _clang_getCursorType_wrap = - _dylib.lookupFunction<_c_clang_getCursorType_wrap, - _dart_clang_getCursorType_wrap>('clang_getCursorType_wrap'); - typedef _c_clang_getCursorType_wrap = ffi.Pointer Function( ffi.Pointer cursor, ); @@ -1635,398 +1820,246 @@ typedef _dart_clang_getCursorType_wrap = ffi.Pointer Function( ffi.Pointer cursor, ); -/// Retrieve a diagnostic associated with the given translation unit. -ffi.Pointer clang_getDiagnostic( - ffi.Pointer Unit, - int Index, -) { - return _clang_getDiagnostic( - Unit, - Index, - ); -} - -final _dart_clang_getDiagnostic _clang_getDiagnostic = - _dylib.lookupFunction<_c_clang_getDiagnostic, _dart_clang_getDiagnostic>( - 'clang_getDiagnostic'); - -typedef _c_clang_getDiagnostic = ffi.Pointer Function( - ffi.Pointer Unit, - ffi.Uint32 Index, +typedef _c_clang_getTypeSpelling_wrap = ffi.Pointer Function( + ffi.Pointer type, ); -typedef _dart_clang_getDiagnostic = ffi.Pointer Function( - ffi.Pointer Unit, - int Index, +typedef _dart_clang_getTypeSpelling_wrap = ffi.Pointer Function( + ffi.Pointer type, ); -int clang_getEnumConstantDeclValue_wrap( - ffi.Pointer cursor, -) { - return _clang_getEnumConstantDeclValue_wrap( - cursor, - ); -} - -final _dart_clang_getEnumConstantDeclValue_wrap - _clang_getEnumConstantDeclValue_wrap = _dylib.lookupFunction< - _c_clang_getEnumConstantDeclValue_wrap, - _dart_clang_getEnumConstantDeclValue_wrap>( - 'clang_getEnumConstantDeclValue_wrap'); - -typedef _c_clang_getEnumConstantDeclValue_wrap = ffi.Int64 Function( - ffi.Pointer cursor, +typedef _c_clang_getTypeKindSpelling_wrap = ffi.Pointer Function( + ffi.Int32 typeKind, ); -typedef _dart_clang_getEnumConstantDeclValue_wrap = int Function( - ffi.Pointer cursor, +typedef _dart_clang_getTypeKindSpelling_wrap = ffi.Pointer Function( + int typeKind, ); -void clang_getFileLocation_wrap( - ffi.Pointer location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -) { - return _clang_getFileLocation_wrap( - location, - file, - line, - column, - offset, - ); -} - -final _dart_clang_getFileLocation_wrap _clang_getFileLocation_wrap = - _dylib.lookupFunction<_c_clang_getFileLocation_wrap, - _dart_clang_getFileLocation_wrap>('clang_getFileLocation_wrap'); - -typedef _c_clang_getFileLocation_wrap = ffi.Void Function( - ffi.Pointer location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, +typedef _c_clang_getResultType_wrap = ffi.Pointer Function( + ffi.Pointer functionType, ); -typedef _dart_clang_getFileLocation_wrap = void Function( - ffi.Pointer location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, +typedef _dart_clang_getResultType_wrap = ffi.Pointer Function( + ffi.Pointer functionType, ); -ffi.Pointer clang_getFileName_wrap( - ffi.Pointer SFile, -) { - return _clang_getFileName_wrap( - SFile, - ); -} +typedef _c_clang_getPointeeType_wrap = ffi.Pointer Function( + ffi.Pointer pointerType, +); -final _dart_clang_getFileName_wrap _clang_getFileName_wrap = _dylib - .lookupFunction<_c_clang_getFileName_wrap, _dart_clang_getFileName_wrap>( - 'clang_getFileName_wrap'); +typedef _dart_clang_getPointeeType_wrap = ffi.Pointer Function( + ffi.Pointer pointerType, +); -typedef _c_clang_getFileName_wrap = ffi.Pointer Function( - ffi.Pointer SFile, +typedef _c_clang_getCanonicalType_wrap = ffi.Pointer Function( + ffi.Pointer typerefType, ); -typedef _dart_clang_getFileName_wrap = ffi.Pointer Function( - ffi.Pointer SFile, +typedef _dart_clang_getCanonicalType_wrap = ffi.Pointer Function( + ffi.Pointer typerefType, ); -int clang_getNumArgTypes_wrap( - ffi.Pointer cxtype, -) { - return _clang_getNumArgTypes_wrap( - cxtype, - ); -} +typedef _c_clang_Type_getNamedType_wrap = ffi.Pointer Function( + ffi.Pointer elaboratedType, +); -final _dart_clang_getNumArgTypes_wrap _clang_getNumArgTypes_wrap = - _dylib.lookupFunction<_c_clang_getNumArgTypes_wrap, - _dart_clang_getNumArgTypes_wrap>('clang_getNumArgTypes_wrap'); +typedef _dart_clang_Type_getNamedType_wrap = ffi.Pointer Function( + ffi.Pointer elaboratedType, +); -typedef _c_clang_getNumArgTypes_wrap = ffi.Int32 Function( +typedef _c_clang_getTypeDeclaration_wrap = ffi.Pointer Function( ffi.Pointer cxtype, ); -typedef _dart_clang_getNumArgTypes_wrap = int Function( +typedef _dart_clang_getTypeDeclaration_wrap = ffi.Pointer Function( ffi.Pointer cxtype, ); -/// Determine the number of diagnostics produced for the given translation unit. -int clang_getNumDiagnostics( - ffi.Pointer Unit, -) { - return _clang_getNumDiagnostics( - Unit, - ); -} - -final _dart_clang_getNumDiagnostics _clang_getNumDiagnostics = _dylib - .lookupFunction<_c_clang_getNumDiagnostics, _dart_clang_getNumDiagnostics>( - 'clang_getNumDiagnostics'); - -typedef _c_clang_getNumDiagnostics = ffi.Uint32 Function( - ffi.Pointer Unit, +typedef _c_clang_getTypedefDeclUnderlyingType_wrap = ffi.Pointer + Function( + ffi.Pointer cxcursor, ); -typedef _dart_clang_getNumDiagnostics = int Function( - ffi.Pointer Unit, +typedef _dart_clang_getTypedefDeclUnderlyingType_wrap = ffi.Pointer + Function( + ffi.Pointer cxcursor, ); -int clang_getNumElements_wrap( - ffi.Pointer cxtype, -) { - return _clang_getNumElements_wrap( - cxtype, - ); -} - -final _dart_clang_getNumElements_wrap _clang_getNumElements_wrap = - _dylib.lookupFunction<_c_clang_getNumElements_wrap, - _dart_clang_getNumElements_wrap>('clang_getNumElements_wrap'); - -typedef _c_clang_getNumElements_wrap = ffi.Uint64 Function( - ffi.Pointer cxtype, +typedef _c_clang_getCursorSpelling_wrap = ffi.Pointer Function( + ffi.Pointer cursor, ); -typedef _dart_clang_getNumElements_wrap = int Function( - ffi.Pointer cxtype, +typedef _dart_clang_getCursorSpelling_wrap = ffi.Pointer Function( + ffi.Pointer cursor, ); -ffi.Pointer clang_getPointeeType_wrap( - ffi.Pointer pointerType, -) { - return _clang_getPointeeType_wrap( - pointerType, - ); -} - -final _dart_clang_getPointeeType_wrap _clang_getPointeeType_wrap = - _dylib.lookupFunction<_c_clang_getPointeeType_wrap, - _dart_clang_getPointeeType_wrap>('clang_getPointeeType_wrap'); +typedef _c_clang_getTranslationUnitCursor_wrap = ffi.Pointer Function( + ffi.Pointer tu, +); -typedef _c_clang_getPointeeType_wrap = ffi.Pointer Function( - ffi.Pointer pointerType, +typedef _dart_clang_getTranslationUnitCursor_wrap = ffi.Pointer + Function( + ffi.Pointer tu, ); -typedef _dart_clang_getPointeeType_wrap = ffi.Pointer Function( - ffi.Pointer pointerType, +typedef _c_clang_formatDiagnostic_wrap = ffi.Pointer Function( + ffi.Pointer diag, + ffi.Int32 opts, ); -ffi.Pointer clang_getResultType_wrap( - ffi.Pointer functionType, -) { - return _clang_getResultType_wrap( - functionType, - ); -} +typedef _dart_clang_formatDiagnostic_wrap = ffi.Pointer Function( + ffi.Pointer diag, + int opts, +); -final _dart_clang_getResultType_wrap _clang_getResultType_wrap = - _dylib.lookupFunction<_c_clang_getResultType_wrap, - _dart_clang_getResultType_wrap>('clang_getResultType_wrap'); +typedef ModifiedCXCursorVisitor_1 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, +); -typedef _c_clang_getResultType_wrap = ffi.Pointer Function( - ffi.Pointer functionType, +typedef _c_clang_visitChildren_wrap = ffi.Uint32 Function( + ffi.Pointer parent, + ffi.Pointer> _modifiedVisitor, + ffi.Pointer clientData, ); -typedef _dart_clang_getResultType_wrap = ffi.Pointer Function( - ffi.Pointer functionType, +typedef _dart_clang_visitChildren_wrap = int Function( + ffi.Pointer parent, + ffi.Pointer> _modifiedVisitor, + ffi.Pointer clientData, ); -ffi.Pointer clang_getTranslationUnitCursor_wrap( - ffi.Pointer tu, -) { - return _clang_getTranslationUnitCursor_wrap( - tu, - ); -} +typedef _c_clang_Cursor_getNumArguments_wrap = ffi.Int32 Function( + ffi.Pointer cursor, +); -final _dart_clang_getTranslationUnitCursor_wrap - _clang_getTranslationUnitCursor_wrap = _dylib.lookupFunction< - _c_clang_getTranslationUnitCursor_wrap, - _dart_clang_getTranslationUnitCursor_wrap>( - 'clang_getTranslationUnitCursor_wrap'); +typedef _dart_clang_Cursor_getNumArguments_wrap = int Function( + ffi.Pointer cursor, +); -typedef _c_clang_getTranslationUnitCursor_wrap = ffi.Pointer Function( - ffi.Pointer tu, +typedef _c_clang_Cursor_getArgument_wrap = ffi.Pointer Function( + ffi.Pointer cursor, + ffi.Uint32 i, ); -typedef _dart_clang_getTranslationUnitCursor_wrap = ffi.Pointer - Function( - ffi.Pointer tu, +typedef _dart_clang_Cursor_getArgument_wrap = ffi.Pointer Function( + ffi.Pointer cursor, + int i, ); -ffi.Pointer clang_getTypeDeclaration_wrap( +typedef _c_clang_getNumArgTypes_wrap = ffi.Int32 Function( ffi.Pointer cxtype, -) { - return _clang_getTypeDeclaration_wrap( - cxtype, - ); -} - -final _dart_clang_getTypeDeclaration_wrap _clang_getTypeDeclaration_wrap = - _dylib.lookupFunction<_c_clang_getTypeDeclaration_wrap, - _dart_clang_getTypeDeclaration_wrap>('clang_getTypeDeclaration_wrap'); +); -typedef _c_clang_getTypeDeclaration_wrap = ffi.Pointer Function( +typedef _dart_clang_getNumArgTypes_wrap = int Function( ffi.Pointer cxtype, ); -typedef _dart_clang_getTypeDeclaration_wrap = ffi.Pointer Function( +typedef _c_clang_getArgType_wrap = ffi.Pointer Function( ffi.Pointer cxtype, + ffi.Uint32 i, ); -ffi.Pointer clang_getTypeKindSpelling_wrap( - int typeKind, -) { - return _clang_getTypeKindSpelling_wrap( - typeKind, - ); -} +typedef _dart_clang_getArgType_wrap = ffi.Pointer Function( + ffi.Pointer cxtype, + int i, +); -final _dart_clang_getTypeKindSpelling_wrap _clang_getTypeKindSpelling_wrap = - _dylib.lookupFunction<_c_clang_getTypeKindSpelling_wrap, - _dart_clang_getTypeKindSpelling_wrap>('clang_getTypeKindSpelling_wrap'); +typedef _c_clang_getEnumConstantDeclValue_wrap = ffi.Int64 Function( + ffi.Pointer cursor, +); -typedef _c_clang_getTypeKindSpelling_wrap = ffi.Pointer Function( - ffi.Int32 typeKind, +typedef _dart_clang_getEnumConstantDeclValue_wrap = int Function( + ffi.Pointer cursor, ); -typedef _dart_clang_getTypeKindSpelling_wrap = ffi.Pointer Function( - int typeKind, +typedef _c_clang_equalRanges_wrap = ffi.Uint32 Function( + ffi.Pointer c1, + ffi.Pointer c2, ); -ffi.Pointer clang_getTypeSpelling_wrap( - ffi.Pointer type, -) { - return _clang_getTypeSpelling_wrap( - type, - ); -} +typedef _dart_clang_equalRanges_wrap = int Function( + ffi.Pointer c1, + ffi.Pointer c2, +); -final _dart_clang_getTypeSpelling_wrap _clang_getTypeSpelling_wrap = - _dylib.lookupFunction<_c_clang_getTypeSpelling_wrap, - _dart_clang_getTypeSpelling_wrap>('clang_getTypeSpelling_wrap'); +typedef _c_clang_Cursor_getCommentRange_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); -typedef _c_clang_getTypeSpelling_wrap = ffi.Pointer Function( - ffi.Pointer type, +typedef _dart_clang_Cursor_getCommentRange_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, ); -typedef _dart_clang_getTypeSpelling_wrap = ffi.Pointer Function( - ffi.Pointer type, +typedef _c_clang_Cursor_getRawCommentText_wrap = ffi.Pointer Function( + ffi.Pointer cursor, ); -ffi.Pointer clang_getTypedefDeclUnderlyingType_wrap( - ffi.Pointer cxcursor, -) { - return _clang_getTypedefDeclUnderlyingType_wrap( - cxcursor, - ); -} +typedef _dart_clang_Cursor_getRawCommentText_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); -final _dart_clang_getTypedefDeclUnderlyingType_wrap - _clang_getTypedefDeclUnderlyingType_wrap = _dylib.lookupFunction< - _c_clang_getTypedefDeclUnderlyingType_wrap, - _dart_clang_getTypedefDeclUnderlyingType_wrap>( - 'clang_getTypedefDeclUnderlyingType_wrap'); +typedef _c_clang_Cursor_getBriefCommentText_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); -typedef _c_clang_getTypedefDeclUnderlyingType_wrap = ffi.Pointer +typedef _dart_clang_Cursor_getBriefCommentText_wrap = ffi.Pointer Function( - ffi.Pointer cxcursor, + ffi.Pointer cursor, ); -typedef _dart_clang_getTypedefDeclUnderlyingType_wrap = ffi.Pointer +typedef _c_clang_getCursorLocation_wrap = ffi.Pointer Function( - ffi.Pointer cxcursor, + ffi.Pointer cursor, ); -/// Same as clang_parseTranslationUnit2, but returns the CXTranslationUnit -/// instead of an error code. In case of an error this routine returns a NULL -/// CXTranslationUnit, without further detailed error codes. -ffi.Pointer clang_parseTranslationUnit( - 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, -) { - return _clang_parseTranslationUnit( - CIdx, - source_filename, - command_line_args, - num_command_line_args, - unsaved_files, - num_unsaved_files, - options, - ); -} +typedef _dart_clang_getCursorLocation_wrap = ffi.Pointer + Function( + ffi.Pointer cursor, +); -final _dart_clang_parseTranslationUnit _clang_parseTranslationUnit = - _dylib.lookupFunction<_c_clang_parseTranslationUnit, - _dart_clang_parseTranslationUnit>('clang_parseTranslationUnit'); +typedef _c_clang_getFileLocation_wrap = ffi.Void Function( + ffi.Pointer location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); -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_getFileLocation_wrap = void Function( + ffi.Pointer location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ); -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_getFileName_wrap = ffi.Pointer Function( + ffi.Pointer SFile, ); -typedef ModifiedCXCursorVisitor_1 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, +typedef _dart_clang_getFileName_wrap = ffi.Pointer Function( + ffi.Pointer SFile, ); -/// Visitor is a function pointer with parameters having pointers to cxcursor -/// instead of cxcursor by default. -int clang_visitChildren_wrap( - ffi.Pointer parent, - ffi.Pointer> _modifiedVisitor, - ffi.Pointer clientData, -) { - return _clang_visitChildren_wrap( - parent, - _modifiedVisitor, - clientData, - ); -} +typedef _c_clang_getNumElements_wrap = ffi.Uint64 Function( + ffi.Pointer cxtype, +); -final _dart_clang_visitChildren_wrap _clang_visitChildren_wrap = - _dylib.lookupFunction<_c_clang_visitChildren_wrap, - _dart_clang_visitChildren_wrap>('clang_visitChildren_wrap'); +typedef _dart_clang_getNumElements_wrap = int Function( + ffi.Pointer cxtype, +); -typedef _c_clang_visitChildren_wrap = ffi.Uint32 Function( - ffi.Pointer parent, - ffi.Pointer> _modifiedVisitor, - ffi.Pointer clientData, +typedef _c_clang_getArrayElementType_wrap = ffi.Pointer Function( + ffi.Pointer cxtype, ); -typedef _dart_clang_visitChildren_wrap = int Function( - ffi.Pointer parent, - ffi.Pointer> _modifiedVisitor, - ffi.Pointer clientData, +typedef _dart_clang_getArrayElementType_wrap = ffi.Pointer Function( + ffi.Pointer cxtype, ); diff --git a/pkgs/ffigen/lib/src/header_parser/data.dart b/pkgs/ffigen/lib/src/header_parser/data.dart index 900c0ff5f4..c1b57bf9fa 100644 --- a/pkgs/ffigen/lib/src/header_parser/data.dart +++ b/pkgs/ffigen/lib/src/header_parser/data.dart @@ -3,7 +3,12 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/config_provider.dart'; +import 'clang_bindings/clang_bindings.dart' show Clang; + /// Holds all Global shared variables. /// Holds configurations. Config config; + +/// Holds clang functions. +Clang clang; diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index f50e2e5c87..c35dd3c7fa 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -10,8 +10,8 @@ import 'package:ffigen/src/config_provider.dart'; import 'package:ffigen/src/header_parser/translation_unit_parser.dart'; import 'package:logging/logging.dart'; -import 'clang_bindings/clang_bindings.dart' as clang; -import 'data.dart' as data; +import 'clang_bindings/clang_bindings.dart' as clang_types; +import 'data.dart'; import 'utils.dart'; /// Main entrypoint for header_parser. @@ -22,8 +22,9 @@ Library parse(Config conf, {bool sort = false}) { final library = Library( bindings: bindings, - initFunctionIdentifier: data.config.initFunctionName, - header: data.config.preamble, + name: config.wrapperName, + description: config.wrapperDocComment, + header: config.preamble, ); if (sort) { @@ -40,9 +41,9 @@ var _logger = Logger('header_parser:parser.dart'); /// initialises parser, clears any previous values. void initParser(Config c) { - data.config = c; + config = c; - clang.init(DynamicLibrary.open(data.config.libclang_dylib_path)); + clang = clang_types.Clang(DynamicLibrary.open(config.libclang_dylib_path)); } /// Parses source files and adds generated bindings to [bindings]. @@ -51,18 +52,18 @@ List parseToBindings() { Pointer> clangCmdArgs = nullptr; var cmdLen = 0; - if (data.config.compilerOpts != null) { - clangCmdArgs = createDynamicStringArray(data.config.compilerOpts); - cmdLen = data.config.compilerOpts.length; + if (config.compilerOpts != null) { + clangCmdArgs = createDynamicStringArray(config.compilerOpts); + cmdLen = config.compilerOpts.length; } // Contains all bindings. final bindings = []; // Log all headers for user. - _logger.info('Input Headers: ${data.config.headers}'); + _logger.info('Input Headers: ${config.headers}'); - for (final headerLocation in data.config.headers) { + for (final headerLocation in config.headers) { _logger.fine('Creating TranslationUnit for header: $headerLocation'); final tu = clang.clang_parseTranslationUnit( @@ -72,7 +73,7 @@ List parseToBindings() { cmdLen, nullptr, 0, - clang.CXTranslationUnit_Flags.CXTranslationUnit_SkipFunctionBodies, + clang_types.CXTranslationUnit_Flags.CXTranslationUnit_SkipFunctionBodies, ); if (tu == nullptr) { @@ -92,8 +93,8 @@ List parseToBindings() { clang.clang_disposeTranslationUnit(tu); } - if (data.config.compilerOpts != null) { - clangCmdArgs.dispose(data.config.compilerOpts.length); + if (config.compilerOpts != null) { + clangCmdArgs.dispose(config.compilerOpts.length); } clang.clang_disposeIndex(index); return bindings; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index 25266e1f91..a98738b5e4 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -8,7 +8,8 @@ import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/header_parser/data.dart'; import 'package:logging/logging.dart'; -import '../clang_bindings/clang_bindings.dart' as clang; +import '../clang_bindings/clang_bindings.dart' as clang_types; +import '../data.dart' show clang; import '../includer.dart'; import '../utils.dart'; @@ -19,7 +20,7 @@ EnumClass _enumClass; /// Parses a function declaration. EnumClass parseEnumDeclaration( - Pointer cursor, { + Pointer cursor, { /// Optionally provide name to use (useful in case struct is inside a typedef). String name, @@ -42,11 +43,11 @@ EnumClass parseEnumDeclaration( return _enumClass; } -void _addEnumConstant(Pointer cursor) { +void _addEnumConstant(Pointer cursor) { final resultCode = clang.clang_visitChildren_wrap( cursor, Pointer.fromFunction( - _enumCursorVisitor, clang.CXChildVisitResult.CXChildVisit_Break), + _enumCursorVisitor, clang_types.CXChildVisitResult.CXChildVisit_Break), nullptr, ); @@ -57,12 +58,12 @@ void _addEnumConstant(Pointer cursor) { /// /// Invoked on every enum directly under rootCursor. /// Used for for extracting enum values. -int _enumCursorVisitor(Pointer cursor, - Pointer parent, Pointer clientData) { +int _enumCursorVisitor(Pointer cursor, + Pointer parent, Pointer clientData) { try { _logger.finest(' enumCursorVisitor: ${cursor.completeStringRepr()}'); switch (clang.clang_getCursorKind_wrap(cursor)) { - case clang.CXCursorKind.CXCursor_EnumConstantDecl: + case clang_types.CXCursorKind.CXCursor_EnumConstantDecl: _addEnumConstantToEnumClass(cursor); break; default: @@ -75,11 +76,11 @@ int _enumCursorVisitor(Pointer cursor, _logger.severe(s); rethrow; } - return clang.CXChildVisitResult.CXChildVisit_Continue; + return clang_types.CXChildVisitResult.CXChildVisit_Continue; } /// Adds the parameter to func in [functiondecl_parser.dart]. -void _addEnumConstantToEnumClass(Pointer cursor) { +void _addEnumConstantToEnumClass(Pointer cursor) { _enumClass.enumConstants.add( EnumConstant( dartDoc: getCursorDocComment( diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index 98b93d0b33..18c341b881 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -8,7 +8,8 @@ import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/header_parser/data.dart'; import 'package:logging/logging.dart'; -import '../clang_bindings/clang_bindings.dart' as clang; +import '../clang_bindings/clang_bindings.dart' as clang_types; +import '../data.dart' show clang; import '../includer.dart'; import '../utils.dart'; @@ -18,7 +19,7 @@ var _logger = Logger('header_parser:functiondecl_parser.dart'); Func _func; /// Parses a function declaration. -Func parseFunctionDeclaration(Pointer cursor) { +Func parseFunctionDeclaration(Pointer cursor) { _func = null; structByValueParameter = false; unimplementedParameterType = false; @@ -49,7 +50,10 @@ Func parseFunctionDeclaration(Pointer cursor) { } _func = Func( - dartDoc: getCursorDocComment(cursor), + dartDoc: getCursorDocComment( + cursor, + nesting.length + commentPrefix.length, + ), name: config.functionDecl.getPrefixedName(funcName), lookupSymbolName: funcName, returnType: rt, @@ -63,11 +67,11 @@ Func parseFunctionDeclaration(Pointer cursor) { bool structByValueParameter = false; bool unimplementedParameterType = false; -Type _getFunctionReturnType(Pointer cursor) { +Type _getFunctionReturnType(Pointer cursor) { return cursor.returnType().toCodeGenTypeAndDispose(); } -List _getParameters(Pointer cursor) { +List _getParameters(Pointer cursor) { final parameters = []; final totalArgs = clang.clang_Cursor_getNumArguments_wrap(cursor); @@ -99,6 +103,6 @@ List _getParameters(Pointer cursor) { return parameters; } -Type _getParameterType(Pointer cursor) { +Type _getParameterType(Pointer cursor) { return cursor.type().toCodeGenTypeAndDispose(); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index a71f69ed61..309ab39477 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -7,7 +7,7 @@ import 'dart:ffi'; import 'package:ffigen/src/code_generator.dart'; import 'package:logging/logging.dart'; -import '../clang_bindings/clang_bindings.dart' as clang; +import '../clang_bindings/clang_bindings.dart' as clang_types; import '../data.dart'; import '../includer.dart'; import '../utils.dart'; @@ -19,7 +19,7 @@ Struc _struc; /// Parses a struct declaration. Struc parseStructDeclaration( - Pointer cursor, { + Pointer cursor, { /// Optionally provide name (useful in case struct is inside a typedef). String name, @@ -53,7 +53,7 @@ Struc parseStructDeclaration( } List _members; -List _getMembers(Pointer cursor, String structName) { +List _getMembers(Pointer cursor, String structName) { _members = []; arrayMember = false; nestedStructMember = false; @@ -62,7 +62,7 @@ List _getMembers(Pointer cursor, String structName) { final resultCode = clang.clang_visitChildren_wrap( cursor, Pointer.fromFunction( - _structMembersVisitor, clang.CXChildVisitResult.CXChildVisit_Break), + _structMembersVisitor, clang_types.CXChildVisitResult.CXChildVisit_Break), nullptr); visitChildrenResultChecker(resultCode); @@ -98,10 +98,10 @@ bool arrayMember = false; /// Visitor for the struct cursor [CXCursorKind.CXCursor_StructDecl]. /// /// Child visitor invoked on struct cursor. -int _structMembersVisitor(Pointer cursor, - Pointer parent, Pointer clientData) { +int _structMembersVisitor(Pointer cursor, + Pointer parent, Pointer clientData) { try { - if (cursor.kind() == clang.CXCursorKind.CXCursor_FieldDecl) { + if (cursor.kind() == clang_types.CXCursorKind.CXCursor_FieldDecl) { _logger.finer('===== member: ${cursor.completeStringRepr()}'); final mt = cursor.type().toCodeGenTypeAndDispose(); @@ -142,5 +142,5 @@ int _structMembersVisitor(Pointer cursor, _logger.severe(s); rethrow; } - return clang.CXChildVisitResult.CXChildVisit_Continue; + return clang_types.CXChildVisitResult.CXChildVisit_Continue; } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart index 30ec2abcbf..8d2a8310b4 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart @@ -7,7 +7,8 @@ import 'dart:ffi'; import 'package:ffigen/src/code_generator.dart'; import 'package:logging/logging.dart'; -import '../clang_bindings/clang_bindings.dart' as clang; +import '../clang_bindings/clang_bindings.dart' as clang_types; +import '../data.dart' show clang; import '../sub_parsers/enumdecl_parser.dart'; import '../sub_parsers/structdecl_parser.dart'; import '../utils.dart'; @@ -21,7 +22,7 @@ Binding _binding; String _typedefName; /// Parses a typedef declaration. -Binding parseTypedefDeclaration(Pointer cursor) { +Binding parseTypedefDeclaration(Pointer cursor) { _binding = null; // Name of typedef. _typedefName = cursor.spelling(); @@ -29,7 +30,7 @@ Binding parseTypedefDeclaration(Pointer cursor) { final resultCode = clang.clang_visitChildren_wrap( cursor, Pointer.fromFunction(_typedefdeclarationCursorVisitor, - clang.CXChildVisitResult.CXChildVisit_Break), + clang_types.CXChildVisitResult.CXChildVisit_Break), nullptr, ); @@ -43,17 +44,17 @@ Binding parseTypedefDeclaration(Pointer cursor) { /// /// Visitor invoked on cursor of type declaration returned by /// [clang.clang_getTypeDeclaration_wrap]. -int _typedefdeclarationCursorVisitor(Pointer cursor, - Pointer parent, Pointer clientData) { +int _typedefdeclarationCursorVisitor(Pointer cursor, + Pointer parent, Pointer clientData) { try { _logger.finest( 'typedefdeclarationCursorVisitor: ${cursor.completeStringRepr()}'); switch (clang.clang_getCursorKind_wrap(cursor)) { - case clang.CXCursorKind.CXCursor_StructDecl: + case clang_types.CXCursorKind.CXCursor_StructDecl: _binding = parseStructDeclaration(cursor, name: _typedefName); break; - case clang.CXCursorKind.CXCursor_EnumDecl: + case clang_types.CXCursorKind.CXCursor_EnumDecl: _binding = parseEnumDeclaration(cursor, name: _typedefName); break; default: @@ -67,5 +68,5 @@ int _typedefdeclarationCursorVisitor(Pointer cursor, _logger.severe(s); rethrow; } - return clang.CXChildVisitResult.CXChildVisit_Continue; + return clang_types.CXChildVisitResult.CXChildVisit_Continue; } diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart index a1b794b87b..73c8880af4 100644 --- a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -7,7 +7,8 @@ import 'dart:ffi'; import 'package:ffigen/src/code_generator.dart'; import 'package:logging/logging.dart'; -import 'clang_bindings/clang_bindings.dart' as clang; +import 'clang_bindings/clang_bindings.dart' as clang_types; +import 'data.dart' show clang; import 'includer.dart'; import 'sub_parsers/enumdecl_parser.dart'; import 'sub_parsers/functiondecl_parser.dart'; @@ -20,13 +21,14 @@ var _logger = Logger('header_parser:translation_unit_parser.dart'); List _bindings; /// Parses the translation unit and returns the generated bindings. -List parseTranslationUnit(Pointer translationUnitCursor) { +List parseTranslationUnit( + Pointer translationUnitCursor) { _bindings = []; final resultCode = clang.clang_visitChildren_wrap( translationUnitCursor, Pointer.fromFunction( - _rootCursorVisitor, clang.CXChildVisitResult.CXChildVisit_Break), + _rootCursorVisitor, clang_types.CXChildVisitResult.CXChildVisit_Break), nullptr, ); @@ -36,22 +38,22 @@ List parseTranslationUnit(Pointer translationUnitCursor } /// Child visitor invoked on translationUnitCursor [CXCursorKind.CXCursor_TranslationUnit]. -int _rootCursorVisitor(Pointer cursor, - Pointer parent, Pointer clientData) { +int _rootCursorVisitor(Pointer cursor, + Pointer parent, Pointer clientData) { try { if (shouldIncludeRootCursor(cursor.sourceFileName())) { _logger.finest('rootCursorVisitor: ${cursor.completeStringRepr()}'); switch (clang.clang_getCursorKind_wrap(cursor)) { - case clang.CXCursorKind.CXCursor_FunctionDecl: + case clang_types.CXCursorKind.CXCursor_FunctionDecl: addToBindings(parseFunctionDeclaration(cursor)); break; - case clang.CXCursorKind.CXCursor_TypedefDecl: + case clang_types.CXCursorKind.CXCursor_TypedefDecl: addToBindings(parseTypedefDeclaration(cursor)); break; - case clang.CXCursorKind.CXCursor_StructDecl: + case clang_types.CXCursorKind.CXCursor_StructDecl: addToBindings(parseStructDeclaration(cursor)); break; - case clang.CXCursorKind.CXCursor_EnumDecl: + case clang_types.CXCursorKind.CXCursor_EnumDecl: addToBindings(parseEnumDeclaration(cursor)); break; default: @@ -69,7 +71,7 @@ int _rootCursorVisitor(Pointer cursor, _logger.severe(s); rethrow; } - return clang.CXChildVisitResult.CXChildVisit_Continue; + return clang_types.CXChildVisitResult.CXChildVisit_Continue; } /// Adds to binding if not null. diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 65fd6f010b..6c59dd6084 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -8,7 +8,7 @@ import 'dart:ffi'; import 'package:ffigen/src/code_generator.dart'; import 'package:logging/logging.dart'; -import '../clang_bindings/clang_bindings.dart' as clang; +import '../clang_bindings/clang_bindings.dart' as clang_types; import '../data.dart'; import '../includer.dart'; import '../sub_parsers/structdecl_parser.dart'; @@ -20,17 +20,17 @@ var _logger = Logger('header_parser:extractor.dart'); const _padding = ' '; /// Converts cxtype to a typestring code_generator can accept. -Type getCodeGenType(Pointer cxtype, {String parentName}) { +Type getCodeGenType(Pointer cxtype, {String parentName}) { _logger.fine('${_padding}getCodeGenType ${cxtype.completeStringRepr()}'); final kind = cxtype.kind(); switch (kind) { - case clang.CXTypeKind.CXType_Pointer: + case clang_types.CXTypeKind.CXType_Pointer: final pt = clang.clang_getPointeeType_wrap(cxtype); final s = getCodeGenType(pt, parentName: parentName); pt.dispose(); return Type.pointer(s); - case clang.CXTypeKind.CXType_Typedef: + case clang_types.CXTypeKind.CXType_Typedef: // Get name from typedef name if config allows. if (config.useSupportedTypedefs) { final spelling = cxtype.spelling(); @@ -46,30 +46,34 @@ Type getCodeGenType(Pointer cxtype, {String parentName}) { final s = getCodeGenType(ct, parentName: parentName ?? cxtype.spelling()); ct.dispose(); return s; - case clang.CXTypeKind.CXType_Elaborated: + case clang_types.CXTypeKind.CXType_Elaborated: final et = clang.clang_Type_getNamedType_wrap(cxtype); final s = getCodeGenType(et, parentName: parentName); et.dispose(); return s; - case clang.CXTypeKind.CXType_Record: + case clang_types.CXTypeKind.CXType_Record: return _extractfromRecord(cxtype); - case clang.CXTypeKind.CXType_Enum: + case clang_types.CXTypeKind.CXType_Enum: return Type.nativeType( enumNativeType, ); - case clang.CXTypeKind + case clang_types.CXTypeKind .CXType_FunctionProto: // Primarily used for function pointers. return _extractFromFunctionProto(cxtype, parentName); - case clang.CXTypeKind + case clang_types.CXTypeKind .CXType_ConstantArray: // Primarily used for constant array in struct members. return Type.constantArray( clang.clang_getNumElements_wrap(cxtype), - clang.clang_getArrayElementType_wrap(cxtype).toCodeGenTypeAndDispose(), + clang + .clang_getArrayElementType_wrap(cxtype) + .toCodeGenTypeAndDispose(), ); - case clang.CXTypeKind + case clang_types.CXTypeKind .CXType_IncompleteArray: // Primarily used for incomplete array in function parameters. return Type.incompleteArray( - clang.clang_getArrayElementType_wrap(cxtype).toCodeGenTypeAndDispose(), + clang + .clang_getArrayElementType_wrap(cxtype) + .toCodeGenTypeAndDispose(), ); default: if (cxTypeKindToSupportedNativeTypes.containsKey(kind)) { @@ -85,14 +89,14 @@ Type getCodeGenType(Pointer cxtype, {String parentName}) { } } -Type _extractfromRecord(Pointer cxtype) { +Type _extractfromRecord(Pointer cxtype) { Type type; final cursor = clang.clang_getTypeDeclaration_wrap(cxtype); _logger.fine('${_padding}_extractfromRecord: ${cursor.completeStringRepr()}'); switch (clang.clang_getCursorKind_wrap(cursor)) { - case clang.CXCursorKind.CXCursor_StructDecl: + case clang_types.CXCursorKind.CXCursor_StructDecl: final cxtype = cursor.type(); var structName = cursor.spelling(); if (structName == '') { @@ -100,7 +104,8 @@ Type _extractfromRecord(Pointer cxtype) { structName = cxtype.spelling(); } - final fixedStructName = config.structDecl.getPrefixedName(structName); + final fixedStructName = + config.structDecl.getPrefixedName(structName); // Also add a struct binding, if its unseen. // TODO(23): Check if we should auto add struct. @@ -130,7 +135,7 @@ Type _extractfromRecord(Pointer cxtype) { // Used for function pointer arguments. Type _extractFromFunctionProto( - Pointer cxtype, String parentName) { + Pointer cxtype, String parentName) { var name = parentName; // Set a name for typedefc incase it was null or empty. @@ -155,17 +160,19 @@ Type _extractFromFunctionProto( Parameter(name: '', type: pt), ); } - final typedefC = TypedefC( + final typedefC = Typedef( name: name, + typedefType: TypedefType.C, parameters: _parameters, - returnType: - clang.clang_getResultType_wrap(cxtype).toCodeGenTypeAndDispose(), + returnType: clang + .clang_getResultType_wrap(cxtype) + .toCodeGenTypeAndDispose(), ); return Type.nativeFunc(typedefC); } -/// Generate a unique string for naming in [TypedefC]. +/// Generate a unique string for naming in [Typedef]. String _getNextUniqueString(String prefix) { int i = _uniqueStringCounters[prefix] ?? 0; i++; diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index c5b7f5fffc..dc7efcf8da 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -9,7 +9,7 @@ import 'package:ffigen/src/code_generator.dart'; import 'package:logging/logging.dart'; import '../strings.dart' as strings; -import 'clang_bindings/clang_bindings.dart' as clang; +import 'clang_bindings/clang_bindings.dart' as clang_types; import 'data.dart'; import 'type_extractor/extractor.dart'; @@ -25,7 +25,7 @@ void visitChildrenResultChecker(int resultCode) { /// Logs the warnings/errors returned by clang for a translation unit. void logTuDiagnostics( - Pointer tu, + Pointer tu, Logger logger, String header, ) { @@ -39,23 +39,25 @@ void logTuDiagnostics( final diag = clang.clang_getDiagnostic(tu, i); final cxstring = clang.clang_formatDiagnostic_wrap( diag, - clang.CXDiagnosticDisplayOptions.CXDiagnostic_DisplaySourceLocation | - clang.CXDiagnosticDisplayOptions.CXDiagnostic_DisplayColumn | - clang.CXDiagnosticDisplayOptions.CXDiagnostic_DisplayCategoryName, + clang_types + .CXDiagnosticDisplayOptions.CXDiagnostic_DisplaySourceLocation | + clang_types.CXDiagnosticDisplayOptions.CXDiagnostic_DisplayColumn | + clang_types + .CXDiagnosticDisplayOptions.CXDiagnostic_DisplayCategoryName, ); logger.warning(' ' + cxstring.toStringAndDispose()); clang.clang_disposeDiagnostic(diag); } } -extension CXSourceRangeExt on Pointer { +extension CXSourceRangeExt on Pointer { void dispose() { free(this); } } -extension CXCursorExt on Pointer { - /// Returns the kind int from [clang.CXCursorKind]. +extension CXCursorExt on Pointer { + /// Returns the kind int from [clang_types.CXCursorKind]. int kind() { return clang.clang_getCursorKind_wrap(this); } @@ -65,7 +67,7 @@ extension CXCursorExt on Pointer { return clang.clang_getCursorSpelling_wrap(this).toStringAndDispose(); } - /// Spelling for a [clang.CXCursorKind], useful for debug purposes. + /// Spelling for a [clang_types.CXCursorKind], useful for debug purposes. String kindSpelling() { return clang .clang_getCursorKindSpelling_wrap(clang.clang_getCursorKind_wrap(this)) @@ -82,14 +84,14 @@ extension CXCursorExt on Pointer { } /// Dispose type using [type.dispose]. - Pointer type() { + Pointer type() { return clang.clang_getCursorType_wrap(this); } /// Only valid for [clang.CXCursorKind.CXCursor_FunctionDecl]. /// /// Dispose type using [type.dispose]. - Pointer returnType() { + Pointer returnType() { final t = type(); final r = clang.clang_getResultType_wrap(t); t.dispose(); @@ -123,15 +125,15 @@ extension CXCursorExt on Pointer { const commentPrefix = '/// '; const nesting = ' '; -/// Stores the [clang.CXSourceRange] of the last comment. -Pointer lastCommentRange = nullptr; +/// Stores the [clang_types.CXSourceRange] of the last comment. +Pointer lastCommentRange = nullptr; /// Returns a cursor's associated comment. /// /// The given string is wrapped at line width = 80 - [indent]. The [indent] is /// [commentPrefix.dimensions] by default because a comment starts with /// [commentPrefix]. -String getCursorDocComment(Pointer cursor, +String getCursorDocComment(Pointer cursor, [int indent = commentPrefix.length]) { String formattedDocComment; final currentCommentRange = clang.clang_Cursor_getCommentRange_wrap(cursor); @@ -214,25 +216,25 @@ String removeRawCommentMarkups(String string) { return sb.toString().trim(); } -extension CXTypeExt on Pointer { - /// Get code_gen [Type] representation of [clang.CXType]. +extension CXTypeExt on Pointer { + /// Get code_gen [Type] representation of [clang_types.CXType]. Type toCodeGenType() { return getCodeGenType(this); } - /// Get code_gen [Type] representation of [clang.CXType] and dispose the type. + /// Get code_gen [Type] representation of [clang_types.CXType] and dispose the type. Type toCodeGenTypeAndDispose() { final t = getCodeGenType(this); dispose(); return t; } - /// Spelling for a [clang.CXTypeKind], useful for debug purposes. + /// Spelling for a [clang_types.CXTypeKind], useful for debug purposes. String spelling() { return clang.clang_getTypeSpelling_wrap(this).toStringAndDispose(); } - /// Returns the typeKind int from [clang.CXTypeKind]. + /// Returns the typeKind int from [clang_types.CXTypeKind]. int kind() { return ref.kind; } @@ -253,7 +255,7 @@ extension CXTypeExt on Pointer { } } -extension CXStringExt on Pointer { +extension CXStringExt on Pointer { /// Convert CXString to a Dart string /// /// Make sure to dispose CXstring using dispose method, or use the diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 27e1d50e75..5951ef5946 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -71,7 +71,8 @@ const none = 'none'; const commentTypeSet = {brief, full, none}; // Library input. -const initFunctionName = 'init-function-name'; +const name = 'name'; +const description = 'description'; const preamble = 'preamble'; // Dynamic library names. diff --git a/pkgs/ffigen/test/code_generator_test.dart b/pkgs/ffigen/test/code_generator_test.dart index cddaab4d41..a7a66c9633 100644 --- a/pkgs/ffigen/test/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_test.dart @@ -11,6 +11,7 @@ void main() { group('code_generator: ', () { test('Function Binding (primitives, pointers)', () { final library = Library( + name: 'Bindings', bindings: [ Func( name: 'noParam', @@ -81,66 +82,68 @@ void main() { ); try { expect(gen, '''/// AUTO GENERATED FILE, DO NOT EDIT. -/// +/// /// Generated by `package:ffigen`. import 'dart:ffi' as ffi; +class Bindings{ /// Holds the Dynamic library. -ffi.DynamicLibrary _dylib; +final ffi.DynamicLibrary _dylib; + +/// The symbols are looked up in [dynamicLibrary]. +Bindings(ffi.DynamicLibrary dynamicLibrary): _dylib = dynamicLibrary; -/// Initialises the Dynamic library. -void init(ffi.DynamicLibrary dynamicLibrary){ - _dylib = dynamicLibrary; -} /// Just a test function /// heres another line int noParam( ) { +_noParam ??= _dylib.lookupFunction<_c_noParam,_dart_noParam>('noParam'); return _noParam( ); } - -final _dart_noParam _noParam = _dylib.lookupFunction<_c_noParam,_dart_noParam>('noParam'); - -typedef _c_noParam = ffi.Int32 Function( -); - -typedef _dart_noParam = int Function( -); +_dart_noParam _noParam; int withPrimitiveParam( int a, int b, ) { +_withPrimitiveParam ??= _dylib.lookupFunction<_c_withPrimitiveParam,_dart_withPrimitiveParam>('withPrimitiveParam'); return _withPrimitiveParam( a, b, ); } - -final _dart_withPrimitiveParam _withPrimitiveParam = _dylib.lookupFunction<_c_withPrimitiveParam,_dart_withPrimitiveParam>('withPrimitiveParam'); - -typedef _c_withPrimitiveParam = ffi.Uint8 Function( - ffi.Int32 a, - ffi.Uint8 b, -); - -typedef _dart_withPrimitiveParam = int Function( - int a, - int b, -); +_dart_withPrimitiveParam _withPrimitiveParam; ffi.Pointer withPointerParam( ffi.Pointer a, ffi.Pointer> b, ) { +_withPointerParam ??= _dylib.lookupFunction<_c_withPointerParam,_dart_withPointerParam>('withPointerParam'); return _withPointerParam( a, b, ); } +_dart_withPointerParam _withPointerParam; -final _dart_withPointerParam _withPointerParam = _dylib.lookupFunction<_c_withPointerParam,_dart_withPointerParam>('withPointerParam'); +} + +typedef _c_noParam = ffi.Int32 Function( +); + +typedef _dart_noParam = int Function( +); + +typedef _c_withPrimitiveParam = ffi.Uint8 Function( + ffi.Int32 a, + ffi.Uint8 b, +); + +typedef _dart_withPrimitiveParam = int Function( + int a, + int b, +); typedef _c_withPointerParam = ffi.Pointer Function( ffi.Pointer a, @@ -165,6 +168,7 @@ typedef _dart_withPointerParam = ffi.Pointer Function( test('Struct Binding (primitives, pointers)', () { final library = Library( + name: 'Bindings', bindings: [ Struc( name: 'NoMember', @@ -232,17 +236,10 @@ typedef _dart_withPointerParam = ffi.Pointer Function( try { expect(gen, '''/// AUTO GENERATED FILE, DO NOT EDIT. -/// +/// /// Generated by `package:ffigen`. import 'dart:ffi' as ffi; -/// Holds the Dynamic library. -ffi.DynamicLibrary _dylib; - -/// Initialises the Dynamic library. -void init(ffi.DynamicLibrary dynamicLibrary){ - _dylib = dynamicLibrary; -} /// Just a test struct /// heres another line class NoMember extends ffi.Struct{ @@ -306,6 +303,7 @@ class WithPointerMember extends ffi.Struct{ ], ); final library = Library( + name: 'Bindings', bindings: [ struct_some, Func( @@ -340,17 +338,29 @@ class WithPointerMember extends ffi.Struct{ try { //expect expect(gen, '''/// AUTO GENERATED FILE, DO NOT EDIT. -/// +/// /// Generated by `package:ffigen`. import 'dart:ffi' as ffi; +class Bindings{ /// Holds the Dynamic library. -ffi.DynamicLibrary _dylib; +final ffi.DynamicLibrary _dylib; + +/// The symbols are looked up in [dynamicLibrary]. +Bindings(ffi.DynamicLibrary dynamicLibrary): _dylib = dynamicLibrary; -/// Initialises the Dynamic library. -void init(ffi.DynamicLibrary dynamicLibrary){ - _dylib = dynamicLibrary; +ffi.Pointer someFunc( + ffi.Pointer> some, +) { +_someFunc ??= _dylib.lookupFunction<_c_someFunc,_dart_someFunc>('someFunc'); + return _someFunc( + some, + ); } +_dart_someFunc _someFunc; + +} + class SomeStruc extends ffi.Struct{ @ffi.Int32() int a; @@ -363,16 +373,6 @@ class SomeStruc extends ffi.Struct{ } -ffi.Pointer someFunc( - ffi.Pointer> some, -) { - return _someFunc( - some, - ); -} - -final _dart_someFunc _someFunc = _dylib.lookupFunction<_c_someFunc,_dart_someFunc>('someFunc'); - typedef _c_someFunc = ffi.Pointer Function( ffi.Pointer> some, ); @@ -397,6 +397,7 @@ typedef _dart_someFunc = ffi.Pointer Function( name: 'Some', ); final library = Library( + name: 'Bindings', bindings: [ Global( name: 'test1', @@ -435,25 +436,30 @@ typedef _dart_someFunc = ffi.Pointer Function( ); try { expect(gen, '''/// AUTO GENERATED FILE, DO NOT EDIT. -/// +/// /// Generated by `package:ffigen`. import 'dart:ffi' as ffi; +class Bindings{ /// Holds the Dynamic library. -ffi.DynamicLibrary _dylib; +final ffi.DynamicLibrary _dylib; -/// Initialises the Dynamic library. -void init(ffi.DynamicLibrary dynamicLibrary){ - _dylib = dynamicLibrary; -} -final int test1 = _dylib.lookup('test1').value; +/// The symbols are looked up in [dynamicLibrary]. +Bindings(ffi.DynamicLibrary dynamicLibrary): _dylib = dynamicLibrary; -final ffi.Pointer test2 = _dylib.lookup>('test2').value; +ffi.Pointer _test1; +int get test1 => (_test1 ??= _dylib.lookup('test1')).value; + +ffi.Pointer> _test2; +ffi.Pointer get test2 => (_test2 ??= _dylib.lookup>('test2')).value; + +ffi.Pointer> _test5; +ffi.Pointer get test5 => (_test5 ??= _dylib.lookup>('test5')).value; -class Some extends ffi.Struct{ } -final ffi.Pointer test5 = _dylib.lookup>('test5').value; +class Some extends ffi.Struct{ +} '''); if (file.existsSync()) { @@ -468,6 +474,7 @@ final ffi.Pointer test5 = _dylib.lookup>('test5').value; test('constant', () { final library = Library( + name: 'Bindings', bindings: [ Constant( name: 'test1', @@ -494,17 +501,10 @@ final ffi.Pointer test5 = _dylib.lookup>('test5').value; ); try { expect(gen, '''/// AUTO GENERATED FILE, DO NOT EDIT. -/// +/// /// Generated by `package:ffigen`. import 'dart:ffi' as ffi; -/// Holds the Dynamic library. -ffi.DynamicLibrary _dylib; - -/// Initialises the Dynamic library. -void init(ffi.DynamicLibrary dynamicLibrary){ - _dylib = dynamicLibrary; -} const int test1 = 20; const double test2 = 20.0; @@ -522,6 +522,7 @@ const double test2 = 20.0; test('enum_class', () { final library = Library( + name: 'Bindings', bindings: [ EnumClass( name: 'Constants', @@ -545,17 +546,10 @@ const double test2 = 20.0; ); try { expect(gen, '''/// AUTO GENERATED FILE, DO NOT EDIT. -/// +/// /// Generated by `package:ffigen`. import 'dart:ffi' as ffi; -/// Holds the Dynamic library. -ffi.DynamicLibrary _dylib; - -/// Initialises the Dynamic library. -void init(ffi.DynamicLibrary dynamicLibrary){ - _dylib = dynamicLibrary; -} /// test line 1 /// test line 2 class Constants { @@ -576,7 +570,7 @@ class Constants { }); test('Internal conflict resolution', () { final library = Library( - initFunctionIdentifier: 'init_dylib', + name: 'init_dylib', bindings: [ Func( name: 'test', @@ -631,78 +625,64 @@ class Constants { ); try { expect(gen, r'''/// AUTO GENERATED FILE, DO NOT EDIT. -/// +/// /// Generated by `package:ffigen`. import 'dart:ffi' as ffi; +class init_dylib_1{ /// Holds the Dynamic library. -ffi.DynamicLibrary _dylib; +final ffi.DynamicLibrary _dylib; + +/// The symbols are looked up in [dynamicLibrary]. +init_dylib_1(ffi.DynamicLibrary dynamicLibrary): _dylib = dynamicLibrary; -/// Initialises the Dynamic library. -void init_dylib_1(ffi.DynamicLibrary dynamicLibrary){ - _dylib = dynamicLibrary; -} void test( ) { +_test_1 ??= _dylib.lookupFunction<_c_test1,_dart_test1>('test'); return _test_1( ); } - -final _dart_test_1 _test_1 = _dylib.lookupFunction<_c_test_1,_dart_test_1>('test'); - -typedef _c_test_1 = ffi.Void Function( -); - -typedef _dart_test_1 = void Function( -); +_dart_test1 _test_1; void _test( ) { +__test ??= _dylib.lookupFunction<_c__test,_dart__test>('_test'); return __test( ); } - -final _dart__test __test = _dylib.lookupFunction<_c__test,_dart__test>('_test'); - -typedef _c__test = ffi.Void Function( -); - -typedef _dart__test = void Function( -); +_dart__test __test; void _c_test( ) { +__c_test ??= _dylib.lookupFunction<_c__c_test,_dart__c_test>('_c_test'); return __c_test( ); } - -final _dart__c_test __c_test = _dylib.lookupFunction<_c__c_test,_dart__c_test>('_c_test'); - -typedef _c__c_test = ffi.Void Function( -); - -typedef _dart__c_test = void Function( -); +_dart__c_test __c_test; void _dart_test( ) { +__dart_test ??= _dylib.lookupFunction<_c__dart_test,_dart__dart_test>('_dart_test'); return __dart_test( ); } +_dart__dart_test __dart_test; -final _dart__dart_test __dart_test = _dylib.lookupFunction<_c__dart_test,_dart__dart_test>('_dart_test'); - -typedef _c__dart_test = ffi.Void Function( -); +void Test( +) { +_Test ??= _dylib.lookupFunction<_c_Test1,_dart_Test>('Test'); + return _Test( + ); +} +_dart_Test _Test; -typedef _dart__dart_test = void Function( -); +} class _Test extends ffi.Struct{ @ffi.Int8() - int _exp_workaround_array_item_0; + int _unique_array_item_0; @ffi.Int8() - int _exp_workaround_array_item_1; + int _unique_array_item_1; /// Helper for array `array`. ArrayHelper1__Test_array_level0 get array => ArrayHelper1__Test_array_level0(this, [2], 0, 0); } @@ -724,9 +704,9 @@ ArrayHelper1__Test_array_level0(this._struct, this.dimensions, this.level, this. _checkBounds(index); switch(_absoluteIndex+index){ case 0: - return _struct._exp_workaround_array_item_0; + return _struct._unique_array_item_0; case 1: - return _struct._exp_workaround_array_item_1; + return _struct._unique_array_item_1; default: throw Exception('Invalid Array Helper generated.');} } @@ -734,10 +714,10 @@ void operator[]=(int index, int value){ _checkBounds(index); switch(_absoluteIndex+index){ case 0: - _struct._exp_workaround_array_item_0 = value; + _struct._unique_array_item_0 = value; break; case 1: - _struct._exp_workaround_array_item_1 = value; + _struct._unique_array_item_1 = value; break; default: throw Exception('Invalid Array Helper generated.'); @@ -747,25 +727,41 @@ default: class ArrayHelperPrefixCollisionTest extends ffi.Struct{ } -void Test( -) { - return _Test_1( - ); +class _c_Test { } -final _dart_Test _Test_1 = _dylib.lookupFunction<_c_Test_1,_dart_Test>('Test'); +class init_dylib { +} -typedef _c_Test_1 = ffi.Void Function( +typedef _c_test1 = ffi.Void Function( ); -typedef _dart_Test = void Function( +typedef _dart_test1 = void Function( ); -class _c_Test { -} +typedef _c__test = ffi.Void Function( +); -class init_dylib { -} +typedef _dart__test = void Function( +); + +typedef _c__c_test = ffi.Void Function( +); + +typedef _dart__c_test = void Function( +); + +typedef _c__dart_test = ffi.Void Function( +); + +typedef _dart__dart_test = void Function( +); + +typedef _c_Test1 = ffi.Void Function( +); + +typedef _dart_Test = void Function( +); '''); if (file.existsSync()) { diff --git a/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart index a96d763d6c..7e1bfd0146 100644 --- a/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart @@ -7,20 +7,32 @@ import 'package:test/test.dart'; void main() { group('Declaration-Declaration Collision', () { - test('struct-func', () { - final l1 = Library(bindings: [ + test('declaration conflict', () { + final l1 = Library(name: 'Bindings', bindings: [ + Struc(name: 'TestStruc'), + Struc(name: 'TestStruc'), + EnumClass(name: 'TestEnum'), + EnumClass(name: 'TestEnum'), Func( - name: 'test', - returnType: Type.nativeType(SupportedNativeType.Void), - ), - Struc(name: 'test'), + name: 'testFunc', + returnType: Type.nativeType(SupportedNativeType.Void)), + Func( + name: 'testFunc', + returnType: Type.nativeType(SupportedNativeType.Void)), ]); - final l2 = Library(bindings: [ + final l2 = Library(name: 'Bindings', bindings: [ + Struc(name: 'TestStruc'), + Struc(name: 'TestStruc_1'), + EnumClass(name: 'TestEnum'), + EnumClass(name: 'TestEnum_1'), + Func( + name: 'testFunc', + lookupSymbolName: 'testFunc', + returnType: Type.nativeType(SupportedNativeType.Void)), Func( - name: 'test', - returnType: Type.nativeType(SupportedNativeType.Void), - ), - Struc(name: 'test_1'), + name: 'testFunc_1', + lookupSymbolName: 'testFunc', + returnType: Type.nativeType(SupportedNativeType.Void)), ]); expect(l1.generate(), l2.generate()); diff --git a/pkgs/ffigen/test/header_parser_tests/functions_test.dart b/pkgs/ffigen/test/header_parser_tests/functions_test.dart index fa09f9c202..b566fb4bb5 100644 --- a/pkgs/ffigen/test/header_parser_tests/functions_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/functions_test.dart @@ -25,6 +25,8 @@ void main() { }); actual = parser.parse( Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Prefix Test' ${strings.output}: 'unused' ${strings.libclang_dylib_folder}: 'tool/wrapped_libclang' ${strings.headers}: @@ -65,6 +67,7 @@ String binding(Library lib, String name) { Library expectedLibrary() { return Library( + name: 'Bindings', bindings: [ Func( name: 'func1', diff --git a/pkgs/ffigen/test/prefix_tests/prefix_test.dart b/pkgs/ffigen/test/prefix_tests/prefix_test.dart index d0397e4a38..0f913278f0 100644 --- a/pkgs/ffigen/test/prefix_tests/prefix_test.dart +++ b/pkgs/ffigen/test/prefix_tests/prefix_test.dart @@ -29,6 +29,8 @@ void main() { }); expected = expectedLibrary(); actual = parser.parse(Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Prefix Test' ${strings.output}: 'unused' ${strings.libclang_dylib_folder}: 'tool/wrapped_libclang' ${strings.headers}: @@ -100,6 +102,7 @@ Library expectedLibrary() { final struc2 = Struc(name: '${structPrefix}${structPrefixReplacedWith}Struct2'); return Library( + name: 'Bindings', bindings: [ Func( name: '${functionPrefix}func1', diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index 9401a00d38..c9f5876f16 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -9,6 +9,8 @@ # dart ../bin/ffigen.dart --config libclang_config.yaml # =============================================================== +name: Clang +description: Holds bindings to LibClang. output: '../lib/src/header_parser/clang_bindings/clang_bindings.dart' libclang-dylib-folder: 'wrapped_libclang' sort: true From 2b7eb311f52be1d77f8de6185e87c0d4725c5a63 Mon Sep 17 00:00:00 2001 From: Prerak Mann <31154435+mannprerak2@users.noreply.github.com> Date: Tue, 14 Jul 2020 16:38:45 +0530 Subject: [PATCH 012/276] [ffigen] Update readme (#31) * Updated code snippets. * Added configurations section with complete details. * Added array workaround section with example. --- pkgs/ffigen/README.md | 264 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 250 insertions(+), 14 deletions(-) diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 5ac1763d73..31dd16ba86 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -18,28 +18,25 @@ ffigen: ``` Output (_generated_bindings.dart_). ```dart -DynamicLibrary _dylib; +class NativeLibrary { + final DynamicLibrary _dylib; -/// Initialises dynamic library -void init(DynamicLibrary dylib) { - _dylib = dylib; -} + NativeLibrary(DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; -int sum(int a,int b) { - return _sum(a,b); + int sum(int a, int b) { + _sum ??= _dylib.lookupFunction<_c_sum, _dart_sum>('sum'); + return _sum(a, b); + } + _dart_sum _sum;; } - -final _dart_sum _sum = _dylib.lookupFunction<_c_sum, _dart_sum>('sum'); - -typedef _c_sum = Int32 Function(Int32 a,Int32 b); - +typedef _c_sum = ffi.Int32 Function(Int32 a, Int32 b); typedef _dart_sum = int Function(int a,int b); ``` ## Using this package - clone/download this repository. - Build it (see [building](#building)). - Add this package as dev_dependency in your `pubspec.yaml`. -- Configurations must be provided in the pubspec.yaml file under the key `ffigen` (or directly under a seperate yaml file which when u specify it passing `--config filename` when running the tool) +- Configurations must be provided in `pubspec.yaml` or in a custom YAML file (see [configurations](#configurations)). - Run the tool- `pub run ffigen`. ## Building @@ -58,13 +55,252 @@ A dynamic library for a wrapper to libclang needs to be generated as it is used 1. Install LLVM. 2. `cd tool/wrapped_libclang`, then run `dart build.dart`. +## Configurations +Configurations can be provided in 2 ways- +1. In the project's `pubspec.yaml` file under the key `ffigen`. +2. Via a custom YAML file, then specify this file while running - +`pub run ffigen --config config.yaml` + +The following configuration options are available- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyRequiredExplainationExample
outputyesOutput path of the generated bindings.
output: 'generated_bindings.dart'
headersyesList of C headers to use. Glob syntax is allowed.
+headers:
+  - 'folder/**.h'
+  - 'folder/specific_header.h'
header-filternoName of headers to include/exclude.
+header-filter:
+  include:
+    - 'index.h'
+    - 'platform.h'
namepreferName of generated class.
name: 'SQLite'
descriptionpreferDart Doc for generated class.
description: 'Bindings to SQLite'
compiler-optsnoPass compiler options to clang.
compiler-opts: '-I/usr/lib/llvm-9/include/'
functions
structs
enums
noFilters for declarations.
Default: all are included
+functions:
+  include: # Exclude is also available.
+    names: # Matches with exact name.
+      - someFuncName
+      - anotherName
+    matches: # Matches using regexp.
+      - prefix.*
+      - [a-z][a-zA-Z0-9]*
+  prefix: 'cx_' # Prefix added to all functions.
+  prefix-replacement: # Replaces a functions's prefix.
+    'clang_': ''
+    '_': 'C'
array-workaroundnoShould generate workaround for fixed arrays in Structs. See Array Workaround
+ Default: false +
array-workaround: true
commentsnoExtract documentation comments for declarations.
+ Options: brief/full/none
+ Default: brief
+ By default clang only parses documentation comments. To enable + ordinary comments (starting with // or /*) add
+ -fparse-all-comments to compiler-opts. +
comments: 'full'
libclang-dylib-foldernoPath to the folder containing dynamic library for libclang wrapper.
+ Note: This is meant for programatic use of this package, and isn't required + when using it via the pub run ffigen command.
+ Default: tool/wrapped_libclang +
libclang-dylib-folder: 'tool/wrapped_libclang'
sortnoSort the bindings according to name.
+ Default: false, i.e keep the order as in the source files. +
sort: true
use-supported-typedefsnoShould automatically map typedefs, E.g uint8_t => Uint8, int16_t => Int16 etc.
+ Default: true +
use-supported-typedefs: true
preamblenoRaw header of the file, pasted as-it-is.
+preamble: |
+  /// AUTO GENERATED FILE, DO NOT EDIT.
+  ///
+  /// Generated by `package:ffigen`.
size-mapnoSize of integers to use (in bytes).
+ The defaults (see example) may not be portable on all OS. + Do not change these unless absolutely sure. +
+# These are optional and also default,
+# Omitting any and the default will be used.
+size-map:
+  char: 1
+  unsigned char: 1
+  short: 2
+  unsigned short: 2
+  int: 4
+  unsigned int: 4
+  long: 8
+  unsigned long: 8
+  long long: 8
+  unsigned long long: 8
+  enum: 4
+ +## Array-Workaround +Fixed size array's in structs aren't currently supported by Dart. However we provide +a workaround, using which array items can now be accessed using `[]` operator. + +Here's a C structure from libclang- +```c +typedef struct { + unsigned long long data[3]; +} CXFileUniqueID; +``` +The generated code is - +```dart +class CXFileUniqueID extends ffi.Struct { + @ffi.Uint64() + int _unique_data_item_0; + @ffi.Uint64() + int _unique_data_item_1; + @ffi.Uint64() + 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.'); + } + } +} +``` + +## 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`. 2. Run `pub run ffigen`. ## Running Tests Dynamic library for some tests need to be built before running the examples. -1. `cd test/native_functions_test`. +1. `cd test/native_test`. 2. Run `dart build_test_dylib.dart`. Run tests from the root of the package with `pub run test`. From e8034cc5c82c1f0553acd2f6d67dae04597e8ee1 Mon Sep 17 00:00:00 2001 From: Prerak Mann <31154435+mannprerak2@users.noreply.github.com> Date: Thu, 16 Jul 2020 13:19:28 +0530 Subject: [PATCH 013/276] [ffigen] Fixes for running on MacOS (#32) * Fixed null completeness warning by clang by adding `-Wno-nullability-completeness` to compiler-opts in examples and wrapper build. * Fixed relative path not allowed in hardened programs error by using absolute path for loading dynamic library if available. --- .../example/libclang-example/pubspec.yaml | 2 +- .../clang_bindings/clang_bindings.dart | 2 +- pkgs/ffigen/lib/src/header_parser/parser.dart | 5 ++++- .../test/native_test/build_test_dylib.dart | 19 ++++++++++--------- pkgs/ffigen/test/native_test/native_test.dart | 3 ++- pkgs/ffigen/tool/libclang_config.yaml | 2 +- pkgs/ffigen/tool/wrapped_libclang/build.dart | 19 ++++++++++--------- 7 files changed, 29 insertions(+), 23 deletions(-) diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index 22acef701c..f6acbebcfc 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -27,7 +27,7 @@ ffigen: - 'CXString.h' - 'Index.h' - compiler-opts: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -IC:\Progra~1\LLVM\include -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/' + compiler-opts: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -IC:\Progra~1\LLVM\include -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' functions: include: matches: diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 2e6469c132..809109f1b6 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -8,7 +8,7 @@ class Clang { /// Holds the Dynamic library. final ffi.DynamicLibrary _dylib; - /// The symbols are looked up in [dynamicLIbrary]. + /// The symbols are looked up in [dynamicLibrary]. Clang(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; /// Provides a shared context for creating translation units. diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index c35dd3c7fa..48944df2aa 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:ffi'; +import 'dart:io'; import 'package:ffi/ffi.dart'; import 'package:ffigen/src/code_generator.dart'; @@ -43,7 +44,9 @@ var _logger = Logger('header_parser:parser.dart'); void initParser(Config c) { config = c; - clang = clang_types.Clang(DynamicLibrary.open(config.libclang_dylib_path)); + clang = clang_types.Clang(DynamicLibrary.open( + File(config.libclang_dylib_path).absolute?.path ?? + config.libclang_dylib_path)); } /// Parses source files and adds generated bindings to [bindings]. diff --git a/pkgs/ffigen/test/native_test/build_test_dylib.dart b/pkgs/ffigen/test/native_test/build_test_dylib.dart index 2fd2c49eed..a41f8748c0 100644 --- a/pkgs/ffigen/test/native_test/build_test_dylib.dart +++ b/pkgs/ffigen/test/native_test/build_test_dylib.dart @@ -30,24 +30,24 @@ import 'dart:io'; import 'package:meta/meta.dart'; -const MACOS = 'macos'; -const WINDOWS = 'windows'; -const LINUX = 'linux'; +const macOS = 'macos'; +const windows = 'windows'; +const linux = 'linux'; Map platformOptions = { - LINUX: Options( + linux: Options( outputfilename: 'native_test.so', sharedFlag: '-shared', inputHeader: 'native_test.c', fPIC: '-fpic', ), - WINDOWS: Options( + windows: Options( outputfilename: 'native_test.dll', sharedFlag: '-shared', inputHeader: 'native_test.c', moduleDefPath: '-Wl,/DEF:native_test.def', ), - MACOS: Options( + macOS: Options( outputfilename: 'native_test.dylib', sharedFlag: '-shared', inputHeader: 'native_test.c', @@ -75,6 +75,7 @@ ProcessResult runClangProcess(Options options) { '-o', options.outputfilename, options.moduleDefPath, + '-Wno-nullability-completeness', ], ); return result; @@ -93,11 +94,11 @@ void printSuccess(ProcessResult result, Options options) { /// Get options based on current platform. Options getPlatformOptions() { if (Platform.isMacOS) { - return platformOptions[MACOS]; + return platformOptions[macOS]; } else if (Platform.isWindows) { - return platformOptions[WINDOWS]; + return platformOptions[windows]; } else if (Platform.isLinux) { - return platformOptions[LINUX]; + return platformOptions[linux]; } else { throw Exception('Unknown Platform.'); } diff --git a/pkgs/ffigen/test/native_test/native_test.dart b/pkgs/ffigen/test/native_test/native_test.dart index cc4fa2282f..11e18a8692 100644 --- a/pkgs/ffigen/test/native_test/native_test.dart +++ b/pkgs/ffigen/test/native_test/native_test.dart @@ -18,7 +18,8 @@ void main() { } else if (Platform.isWindows) { dylibName = r'test\native_test\native_test.dll'; } - bindings.init(DynamicLibrary.open(dylibName)); + bindings.init( + DynamicLibrary.open(File(dylibName).absolute?.path ?? dylibName)); }); test('uint8_t', () { expect(bindings.Function1Uint8(pow(2, 8).toInt()), 42); diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index c9f5876f16..fe10d98078 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -14,7 +14,7 @@ description: Holds bindings to LibClang. output: '../lib/src/header_parser/clang_bindings/clang_bindings.dart' libclang-dylib-folder: 'wrapped_libclang' sort: true -compiler-opts: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/' +compiler-opts: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' headers: - 'wrapped_libclang/wrapper.c' header-filter: diff --git a/pkgs/ffigen/tool/wrapped_libclang/build.dart b/pkgs/ffigen/tool/wrapped_libclang/build.dart index 20971b1dad..3e1eff4859 100644 --- a/pkgs/ffigen/tool/wrapped_libclang/build.dart +++ b/pkgs/ffigen/tool/wrapped_libclang/build.dart @@ -30,13 +30,13 @@ import 'dart:io'; import 'package:args/args.dart'; import 'package:meta/meta.dart'; -const MACOS = 'macos'; -const WINDOWS = 'windows'; -const LINUX = 'linux'; +const macOS = 'macos'; +const windows = 'windows'; +const linux = 'linux'; /// Default platform options. Map platformOptions = { - LINUX: Options( + linux: Options( outputfilename: 'libwrapped_clang.so', sharedFlag: '-shared', inputHeader: 'wrapper.c', @@ -47,7 +47,7 @@ Map platformOptions = { '-I/usr/lib/llvm-10/include/', ], ), - WINDOWS: Options( + windows: Options( outputfilename: 'wrapped_clang.dll', sharedFlag: '-shared', inputHeader: 'wrapper.c', @@ -60,7 +60,7 @@ Map platformOptions = { r'-LC:\Progra~1\LLVM\lib', ], ), - MACOS: Options( + macOS: Options( outputfilename: 'libwrapped_clang.dylib', sharedFlag: '-shared', inputHeader: 'wrapper.c', @@ -102,6 +102,7 @@ ProcessResult runClangProcess(Options options) { '-o', options.outputfilename, options.moduleDefPath, + '-Wno-nullability-completeness', ], ); return result; @@ -167,11 +168,11 @@ void changeIncludesUsingCmdArgs(List arguments, Options options) { /// Get options based on current platform. Options getPlatformOptions() { if (Platform.isMacOS) { - return platformOptions[MACOS]; + return platformOptions[macOS]; } else if (Platform.isWindows) { - return platformOptions[WINDOWS]; + return platformOptions[windows]; } else if (Platform.isLinux) { - return platformOptions[LINUX]; + return platformOptions[linux]; } else { throw Exception('Unknown Platform.'); } From c499fe52e90dae538d7a00539c8238a85d058195 Mon Sep 17 00:00:00 2001 From: Prerak Mann <31154435+mannprerak2@users.noreply.github.com> Date: Fri, 17 Jul 2020 15:00:57 +0530 Subject: [PATCH 014/276] [ffigen] Added large tests, bug fixes (#33) closes #29, closes #17 - Added large tests for Libclang, cJSON and SQLite #17. - Bug fix: Nested parsing, added tests for nested parsing. Sub parsers now use a stack to hold information about current declaration. - Bug fix: Unsupported operation error when finding dynamic library path on windows #29. - Added property originalName to Binding. - Config provider now throws ConfigError if a required config is missing. This fixes tests not running previously due to exit call in config provider. - Updated libclang wrapper to support running from multiple isolates (fixes concurrent test running). --- pkgs/ffigen/bin/ffigen.dart | 10 +- .../libclang-example/generated_bindings.dart | 723 - .../example/libclang-example/pubspec.yaml | 3 +- .../lib/src/code_generator/binding.dart | 18 +- .../lib/src/code_generator/constant.dart | 3 +- .../lib/src/code_generator/enum_class.dart | 3 +- pkgs/ffigen/lib/src/code_generator/func.dart | 9 +- .../ffigen/lib/src/code_generator/global.dart | 7 +- .../lib/src/code_generator/library.dart | 49 +- pkgs/ffigen/lib/src/code_generator/struc.dart | 5 +- .../lib/src/config_provider/config.dart | 34 +- .../lib/src/config_provider/declaration.dart | 14 - .../lib/src/config_provider/spec_utils.dart | 27 +- .../clang_bindings/clang_bindings.dart | 8 +- pkgs/ffigen/lib/src/header_parser/data.dart | 9 + pkgs/ffigen/lib/src/header_parser/parser.dart | 4 +- .../sub_parsers/enumdecl_parser.dart | 26 +- .../sub_parsers/functiondecl_parser.dart | 45 +- .../sub_parsers/structdecl_parser.dart | 82 +- .../sub_parsers/typedefdecl_parser.dart | 32 +- .../translation_unit_parser.dart | 7 +- .../type_extractor/extractor.dart | 30 +- pkgs/ffigen/lib/src/header_parser/utils.dart | 8 + pkgs/ffigen/test/code_generator_test.dart | 12 - .../decl_decl_collision_test.dart | 11 +- pkgs/ffigen/test/debug_generated/README.md | 3 + .../header_parser_tests/function_n_struct.h | 15 + .../function_n_struct_.dart | 66 + .../header_parser_tests/functions_test.dart | 39 +- .../test/header_parser_tests/nested_parsing.h | 16 + .../nested_parsing_test.dart | 83 + .../_expected_cjson_bindings.dart | 1752 +++ .../_expected_libclang_bindings.dart | 5765 ++++++++ .../_expected_sqlite_bindings.dart | 7751 ++++++++++ .../large_integration_tests/large_test.dart | 135 + pkgs/ffigen/test/native_test/native_test.dart | 2 +- pkgs/ffigen/test/native_test/native_test.def | 3 +- .../ffigen/test/prefix_tests/prefix_test.dart | 58 +- pkgs/ffigen/test/test_utils.dart | 49 + .../libclang/include/clang-c/BuildSystem.h | 153 + .../include/clang-c/CXCompilationDatabase.h | 174 + .../libclang/include/clang-c/CXErrorCode.h | 62 + .../libclang/include/clang-c/CXString.h | 69 + .../libclang/include/clang-c/Documentation.h | 555 + .../libclang/include/clang-c/ExternC.h | 39 + .../include/clang-c/FatalErrorHandler.h | 32 + .../libclang/include/clang-c/Index.h | 6782 +++++++++ .../libclang/include/clang-c/Platform.h | 44 + pkgs/ffigen/third_party/sqlite/sqlite3.h | 12168 ++++++++++++++++ pkgs/ffigen/tool/wrapped_libclang/wrapper.c | 84 +- 50 files changed, 36067 insertions(+), 1011 deletions(-) create mode 100644 pkgs/ffigen/test/debug_generated/README.md create mode 100644 pkgs/ffigen/test/header_parser_tests/function_n_struct.h create mode 100644 pkgs/ffigen/test/header_parser_tests/function_n_struct_.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/nested_parsing.h create mode 100644 pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart create mode 100644 pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart create mode 100644 pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart create mode 100644 pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart create mode 100644 pkgs/ffigen/test/large_integration_tests/large_test.dart create mode 100644 pkgs/ffigen/test/test_utils.dart create mode 100644 pkgs/ffigen/third_party/libclang/include/clang-c/BuildSystem.h create mode 100644 pkgs/ffigen/third_party/libclang/include/clang-c/CXCompilationDatabase.h create mode 100644 pkgs/ffigen/third_party/libclang/include/clang-c/CXErrorCode.h create mode 100644 pkgs/ffigen/third_party/libclang/include/clang-c/CXString.h create mode 100644 pkgs/ffigen/third_party/libclang/include/clang-c/Documentation.h create mode 100644 pkgs/ffigen/third_party/libclang/include/clang-c/ExternC.h create mode 100644 pkgs/ffigen/third_party/libclang/include/clang-c/FatalErrorHandler.h create mode 100644 pkgs/ffigen/third_party/libclang/include/clang-c/Index.h create mode 100644 pkgs/ffigen/third_party/libclang/include/clang-c/Platform.h create mode 100644 pkgs/ffigen/third_party/sqlite/sqlite3.h diff --git a/pkgs/ffigen/bin/ffigen.dart b/pkgs/ffigen/bin/ffigen.dart index 26f260572c..4a321ee65c 100644 --- a/pkgs/ffigen/bin/ffigen.dart +++ b/pkgs/ffigen/bin/ffigen.dart @@ -11,7 +11,7 @@ import 'package:ffigen/src/header_parser.dart' as parser; import 'package:logging/logging.dart'; import 'package:yaml/yaml.dart' as yaml; -var _logger = Logger('ffigen.dart'); +var _logger = Logger('ffigen.ffigen'); void main(List args) { // Parses the cmd args. @@ -21,7 +21,13 @@ void main(List args) { setupLogger(result); // Create a config object. - final config = getConfig(result); + Config config; + try { + config = getConfig(result); + } on ConfigError { + print('Please fix configuration errors and re-run the tool.'); + exit(1); + } // Parse the bindings according to config object provided. final library = parser.parse(config); diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index eee8d524bb..924da2a174 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -2466,445 +2466,6 @@ class LibClang { } _dart_clang_indexTranslationUnit _clang_indexTranslationUnit; - - ffi.Pointer clang_getCString_wrap( - ffi.Pointer string, - ) { - _clang_getCString_wrap ??= _dylib.lookupFunction<_c_clang_getCString_wrap, - _dart_clang_getCString_wrap>('clang_getCString_wrap'); - return _clang_getCString_wrap( - string, - ); - } - - _dart_clang_getCString_wrap _clang_getCString_wrap; - - void clang_disposeString_wrap( - ffi.Pointer string, - ) { - _clang_disposeString_wrap ??= _dylib.lookupFunction< - _c_clang_disposeString_wrap, - _dart_clang_disposeString_wrap>('clang_disposeString_wrap'); - return _clang_disposeString_wrap( - string, - ); - } - - _dart_clang_disposeString_wrap _clang_disposeString_wrap; - - int clang_getCursorKind_wrap( - ffi.Pointer cursor, - ) { - _clang_getCursorKind_wrap ??= _dylib.lookupFunction< - _c_clang_getCursorKind_wrap, - _dart_clang_getCursorKind_wrap>('clang_getCursorKind_wrap'); - return _clang_getCursorKind_wrap( - cursor, - ); - } - - _dart_clang_getCursorKind_wrap _clang_getCursorKind_wrap; - - ffi.Pointer clang_getCursorKindSpelling_wrap( - int kind, - ) { - _clang_getCursorKindSpelling_wrap ??= _dylib.lookupFunction< - _c_clang_getCursorKindSpelling_wrap, - _dart_clang_getCursorKindSpelling_wrap>( - 'clang_getCursorKindSpelling_wrap'); - return _clang_getCursorKindSpelling_wrap( - kind, - ); - } - - _dart_clang_getCursorKindSpelling_wrap _clang_getCursorKindSpelling_wrap; - - ffi.Pointer clang_getCursorType_wrap( - ffi.Pointer cursor, - ) { - _clang_getCursorType_wrap ??= _dylib.lookupFunction< - _c_clang_getCursorType_wrap, - _dart_clang_getCursorType_wrap>('clang_getCursorType_wrap'); - return _clang_getCursorType_wrap( - cursor, - ); - } - - _dart_clang_getCursorType_wrap _clang_getCursorType_wrap; - - ffi.Pointer clang_getTypeSpelling_wrap( - ffi.Pointer type, - ) { - _clang_getTypeSpelling_wrap ??= _dylib.lookupFunction< - _c_clang_getTypeSpelling_wrap, - _dart_clang_getTypeSpelling_wrap>('clang_getTypeSpelling_wrap'); - return _clang_getTypeSpelling_wrap( - type, - ); - } - - _dart_clang_getTypeSpelling_wrap _clang_getTypeSpelling_wrap; - - ffi.Pointer clang_getTypeKindSpelling_wrap( - int typeKind, - ) { - _clang_getTypeKindSpelling_wrap ??= _dylib.lookupFunction< - _c_clang_getTypeKindSpelling_wrap, - _dart_clang_getTypeKindSpelling_wrap>('clang_getTypeKindSpelling_wrap'); - return _clang_getTypeKindSpelling_wrap( - typeKind, - ); - } - - _dart_clang_getTypeKindSpelling_wrap _clang_getTypeKindSpelling_wrap; - - ffi.Pointer clang_getResultType_wrap( - ffi.Pointer functionType, - ) { - _clang_getResultType_wrap ??= _dylib.lookupFunction< - _c_clang_getResultType_wrap, - _dart_clang_getResultType_wrap>('clang_getResultType_wrap'); - return _clang_getResultType_wrap( - functionType, - ); - } - - _dart_clang_getResultType_wrap _clang_getResultType_wrap; - - ffi.Pointer clang_getPointeeType_wrap( - ffi.Pointer pointerType, - ) { - _clang_getPointeeType_wrap ??= _dylib.lookupFunction< - _c_clang_getPointeeType_wrap, - _dart_clang_getPointeeType_wrap>('clang_getPointeeType_wrap'); - return _clang_getPointeeType_wrap( - pointerType, - ); - } - - _dart_clang_getPointeeType_wrap _clang_getPointeeType_wrap; - - ffi.Pointer clang_getCanonicalType_wrap( - ffi.Pointer typerefType, - ) { - _clang_getCanonicalType_wrap ??= _dylib.lookupFunction< - _c_clang_getCanonicalType_wrap, - _dart_clang_getCanonicalType_wrap>('clang_getCanonicalType_wrap'); - return _clang_getCanonicalType_wrap( - typerefType, - ); - } - - _dart_clang_getCanonicalType_wrap _clang_getCanonicalType_wrap; - - ffi.Pointer clang_Type_getNamedType_wrap( - ffi.Pointer elaboratedType, - ) { - _clang_Type_getNamedType_wrap ??= _dylib.lookupFunction< - _c_clang_Type_getNamedType_wrap, - _dart_clang_Type_getNamedType_wrap>('clang_Type_getNamedType_wrap'); - return _clang_Type_getNamedType_wrap( - elaboratedType, - ); - } - - _dart_clang_Type_getNamedType_wrap _clang_Type_getNamedType_wrap; - - ffi.Pointer clang_getTypeDeclaration_wrap( - ffi.Pointer cxtype, - ) { - _clang_getTypeDeclaration_wrap ??= _dylib.lookupFunction< - _c_clang_getTypeDeclaration_wrap, - _dart_clang_getTypeDeclaration_wrap>('clang_getTypeDeclaration_wrap'); - return _clang_getTypeDeclaration_wrap( - cxtype, - ); - } - - _dart_clang_getTypeDeclaration_wrap _clang_getTypeDeclaration_wrap; - - ffi.Pointer clang_getTypedefDeclUnderlyingType_wrap( - ffi.Pointer cxcursor, - ) { - _clang_getTypedefDeclUnderlyingType_wrap ??= _dylib.lookupFunction< - _c_clang_getTypedefDeclUnderlyingType_wrap, - _dart_clang_getTypedefDeclUnderlyingType_wrap>( - 'clang_getTypedefDeclUnderlyingType_wrap'); - return _clang_getTypedefDeclUnderlyingType_wrap( - cxcursor, - ); - } - - _dart_clang_getTypedefDeclUnderlyingType_wrap - _clang_getTypedefDeclUnderlyingType_wrap; - - /// The name of parameter, struct, typedef. - ffi.Pointer clang_getCursorSpelling_wrap( - ffi.Pointer cursor, - ) { - _clang_getCursorSpelling_wrap ??= _dylib.lookupFunction< - _c_clang_getCursorSpelling_wrap, - _dart_clang_getCursorSpelling_wrap>('clang_getCursorSpelling_wrap'); - return _clang_getCursorSpelling_wrap( - cursor, - ); - } - - _dart_clang_getCursorSpelling_wrap _clang_getCursorSpelling_wrap; - - ffi.Pointer clang_getTranslationUnitCursor_wrap( - ffi.Pointer tu, - ) { - _clang_getTranslationUnitCursor_wrap ??= _dylib.lookupFunction< - _c_clang_getTranslationUnitCursor_wrap, - _dart_clang_getTranslationUnitCursor_wrap>( - 'clang_getTranslationUnitCursor_wrap'); - return _clang_getTranslationUnitCursor_wrap( - tu, - ); - } - - _dart_clang_getTranslationUnitCursor_wrap - _clang_getTranslationUnitCursor_wrap; - - ffi.Pointer clang_formatDiagnostic_wrap( - ffi.Pointer diag, - int opts, - ) { - _clang_formatDiagnostic_wrap ??= _dylib.lookupFunction< - _c_clang_formatDiagnostic_wrap, - _dart_clang_formatDiagnostic_wrap>('clang_formatDiagnostic_wrap'); - return _clang_formatDiagnostic_wrap( - diag, - opts, - ); - } - - _dart_clang_formatDiagnostic_wrap _clang_formatDiagnostic_wrap; - - /// Visitor is a function pointer with parameters having pointers to cxcursor - /// instead of cxcursor by default. - int clang_visitChildren_wrap( - ffi.Pointer parent, - ffi.Pointer> _modifiedVisitor, - ffi.Pointer clientData, - ) { - _clang_visitChildren_wrap ??= _dylib.lookupFunction< - _c_clang_visitChildren_wrap, - _dart_clang_visitChildren_wrap>('clang_visitChildren_wrap'); - return _clang_visitChildren_wrap( - parent, - _modifiedVisitor, - clientData, - ); - } - - _dart_clang_visitChildren_wrap _clang_visitChildren_wrap; - - int clang_Cursor_getNumArguments_wrap( - ffi.Pointer cursor, - ) { - _clang_Cursor_getNumArguments_wrap ??= _dylib.lookupFunction< - _c_clang_Cursor_getNumArguments_wrap, - _dart_clang_Cursor_getNumArguments_wrap>( - 'clang_Cursor_getNumArguments_wrap'); - return _clang_Cursor_getNumArguments_wrap( - cursor, - ); - } - - _dart_clang_Cursor_getNumArguments_wrap _clang_Cursor_getNumArguments_wrap; - - ffi.Pointer clang_Cursor_getArgument_wrap( - ffi.Pointer cursor, - int i, - ) { - _clang_Cursor_getArgument_wrap ??= _dylib.lookupFunction< - _c_clang_Cursor_getArgument_wrap, - _dart_clang_Cursor_getArgument_wrap>('clang_Cursor_getArgument_wrap'); - return _clang_Cursor_getArgument_wrap( - cursor, - i, - ); - } - - _dart_clang_Cursor_getArgument_wrap _clang_Cursor_getArgument_wrap; - - int clang_getNumArgTypes_wrap( - ffi.Pointer cxtype, - ) { - _clang_getNumArgTypes_wrap ??= _dylib.lookupFunction< - _c_clang_getNumArgTypes_wrap, - _dart_clang_getNumArgTypes_wrap>('clang_getNumArgTypes_wrap'); - return _clang_getNumArgTypes_wrap( - cxtype, - ); - } - - _dart_clang_getNumArgTypes_wrap _clang_getNumArgTypes_wrap; - - ffi.Pointer clang_getArgType_wrap( - ffi.Pointer cxtype, - int i, - ) { - _clang_getArgType_wrap ??= _dylib.lookupFunction<_c_clang_getArgType_wrap, - _dart_clang_getArgType_wrap>('clang_getArgType_wrap'); - return _clang_getArgType_wrap( - cxtype, - i, - ); - } - - _dart_clang_getArgType_wrap _clang_getArgType_wrap; - - int clang_getEnumConstantDeclValue_wrap( - ffi.Pointer cursor, - ) { - _clang_getEnumConstantDeclValue_wrap ??= _dylib.lookupFunction< - _c_clang_getEnumConstantDeclValue_wrap, - _dart_clang_getEnumConstantDeclValue_wrap>( - 'clang_getEnumConstantDeclValue_wrap'); - return _clang_getEnumConstantDeclValue_wrap( - cursor, - ); - } - - _dart_clang_getEnumConstantDeclValue_wrap - _clang_getEnumConstantDeclValue_wrap; - - /// Returns non-zero if the ranges are the same, zero if they differ. - int clang_equalRanges_wrap( - ffi.Pointer c1, - ffi.Pointer c2, - ) { - _clang_equalRanges_wrap ??= _dylib.lookupFunction<_c_clang_equalRanges_wrap, - _dart_clang_equalRanges_wrap>('clang_equalRanges_wrap'); - return _clang_equalRanges_wrap( - c1, - c2, - ); - } - - _dart_clang_equalRanges_wrap _clang_equalRanges_wrap; - - /// Returns the comment range. - ffi.Pointer clang_Cursor_getCommentRange_wrap( - ffi.Pointer cursor, - ) { - _clang_Cursor_getCommentRange_wrap ??= _dylib.lookupFunction< - _c_clang_Cursor_getCommentRange_wrap, - _dart_clang_Cursor_getCommentRange_wrap>( - 'clang_Cursor_getCommentRange_wrap'); - return _clang_Cursor_getCommentRange_wrap( - cursor, - ); - } - - _dart_clang_Cursor_getCommentRange_wrap _clang_Cursor_getCommentRange_wrap; - - /// Returns the raw comment. - ffi.Pointer clang_Cursor_getRawCommentText_wrap( - ffi.Pointer cursor, - ) { - _clang_Cursor_getRawCommentText_wrap ??= _dylib.lookupFunction< - _c_clang_Cursor_getRawCommentText_wrap, - _dart_clang_Cursor_getRawCommentText_wrap>( - 'clang_Cursor_getRawCommentText_wrap'); - return _clang_Cursor_getRawCommentText_wrap( - cursor, - ); - } - - _dart_clang_Cursor_getRawCommentText_wrap - _clang_Cursor_getRawCommentText_wrap; - - /// Returns the first paragraph of doxygen doc comment. - ffi.Pointer clang_Cursor_getBriefCommentText_wrap( - ffi.Pointer cursor, - ) { - _clang_Cursor_getBriefCommentText_wrap ??= _dylib.lookupFunction< - _c_clang_Cursor_getBriefCommentText_wrap, - _dart_clang_Cursor_getBriefCommentText_wrap>( - 'clang_Cursor_getBriefCommentText_wrap'); - return _clang_Cursor_getBriefCommentText_wrap( - cursor, - ); - } - - _dart_clang_Cursor_getBriefCommentText_wrap - _clang_Cursor_getBriefCommentText_wrap; - - ffi.Pointer clang_getCursorLocation_wrap( - ffi.Pointer cursor, - ) { - _clang_getCursorLocation_wrap ??= _dylib.lookupFunction< - _c_clang_getCursorLocation_wrap, - _dart_clang_getCursorLocation_wrap>('clang_getCursorLocation_wrap'); - return _clang_getCursorLocation_wrap( - cursor, - ); - } - - _dart_clang_getCursorLocation_wrap _clang_getCursorLocation_wrap; - - void clang_getFileLocation_wrap( - ffi.Pointer location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, - ) { - _clang_getFileLocation_wrap ??= _dylib.lookupFunction< - _c_clang_getFileLocation_wrap, - _dart_clang_getFileLocation_wrap>('clang_getFileLocation_wrap'); - return _clang_getFileLocation_wrap( - location, - file, - line, - column, - offset, - ); - } - - _dart_clang_getFileLocation_wrap _clang_getFileLocation_wrap; - - ffi.Pointer clang_getFileName_wrap( - ffi.Pointer SFile, - ) { - _clang_getFileName_wrap ??= _dylib.lookupFunction<_c_clang_getFileName_wrap, - _dart_clang_getFileName_wrap>('clang_getFileName_wrap'); - return _clang_getFileName_wrap( - SFile, - ); - } - - _dart_clang_getFileName_wrap _clang_getFileName_wrap; - - int clang_getNumElements_wrap( - ffi.Pointer cxtype, - ) { - _clang_getNumElements_wrap ??= _dylib.lookupFunction< - _c_clang_getNumElements_wrap, - _dart_clang_getNumElements_wrap>('clang_getNumElements_wrap'); - return _clang_getNumElements_wrap( - cxtype, - ); - } - - _dart_clang_getNumElements_wrap _clang_getNumElements_wrap; - - ffi.Pointer clang_getArrayElementType_wrap( - ffi.Pointer cxtype, - ) { - _clang_getArrayElementType_wrap ??= _dylib.lookupFunction< - _c_clang_getArrayElementType_wrap, - _dart_clang_getArrayElementType_wrap>('clang_getArrayElementType_wrap'); - return _clang_getArrayElementType_wrap( - cxtype, - ); - } - - _dart_clang_getArrayElementType_wrap _clang_getArrayElementType_wrap; } /// A character string. @@ -4917,290 +4478,6 @@ typedef _dart_clang_indexTranslationUnit = int Function( ffi.Pointer arg5, ); -typedef _c_clang_getCString_wrap = ffi.Pointer Function( - ffi.Pointer string, -); - -typedef _dart_clang_getCString_wrap = ffi.Pointer Function( - ffi.Pointer string, -); - -typedef _c_clang_disposeString_wrap = ffi.Void Function( - ffi.Pointer string, -); - -typedef _dart_clang_disposeString_wrap = void Function( - ffi.Pointer string, -); - -typedef _c_clang_getCursorKind_wrap = ffi.Int32 Function( - ffi.Pointer cursor, -); - -typedef _dart_clang_getCursorKind_wrap = int Function( - ffi.Pointer cursor, -); - -typedef _c_clang_getCursorKindSpelling_wrap = ffi.Pointer Function( - ffi.Int32 kind, -); - -typedef _dart_clang_getCursorKindSpelling_wrap = ffi.Pointer Function( - int kind, -); - -typedef _c_clang_getCursorType_wrap = ffi.Pointer Function( - ffi.Pointer cursor, -); - -typedef _dart_clang_getCursorType_wrap = ffi.Pointer Function( - ffi.Pointer cursor, -); - -typedef _c_clang_getTypeSpelling_wrap = ffi.Pointer Function( - ffi.Pointer type, -); - -typedef _dart_clang_getTypeSpelling_wrap = ffi.Pointer Function( - ffi.Pointer type, -); - -typedef _c_clang_getTypeKindSpelling_wrap = ffi.Pointer Function( - ffi.Int32 typeKind, -); - -typedef _dart_clang_getTypeKindSpelling_wrap = ffi.Pointer Function( - int typeKind, -); - -typedef _c_clang_getResultType_wrap = ffi.Pointer Function( - ffi.Pointer functionType, -); - -typedef _dart_clang_getResultType_wrap = ffi.Pointer Function( - ffi.Pointer functionType, -); - -typedef _c_clang_getPointeeType_wrap = ffi.Pointer Function( - ffi.Pointer pointerType, -); - -typedef _dart_clang_getPointeeType_wrap = ffi.Pointer Function( - ffi.Pointer pointerType, -); - -typedef _c_clang_getCanonicalType_wrap = ffi.Pointer Function( - ffi.Pointer typerefType, -); - -typedef _dart_clang_getCanonicalType_wrap = ffi.Pointer Function( - ffi.Pointer typerefType, -); - -typedef _c_clang_Type_getNamedType_wrap = ffi.Pointer Function( - ffi.Pointer elaboratedType, -); - -typedef _dart_clang_Type_getNamedType_wrap = ffi.Pointer Function( - ffi.Pointer elaboratedType, -); - -typedef _c_clang_getTypeDeclaration_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, -); - -typedef _dart_clang_getTypeDeclaration_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, -); - -typedef _c_clang_getTypedefDeclUnderlyingType_wrap = ffi.Pointer - Function( - ffi.Pointer cxcursor, -); - -typedef _dart_clang_getTypedefDeclUnderlyingType_wrap = ffi.Pointer - Function( - ffi.Pointer cxcursor, -); - -typedef _c_clang_getCursorSpelling_wrap = ffi.Pointer Function( - ffi.Pointer cursor, -); - -typedef _dart_clang_getCursorSpelling_wrap = ffi.Pointer Function( - ffi.Pointer cursor, -); - -typedef _c_clang_getTranslationUnitCursor_wrap = ffi.Pointer Function( - ffi.Pointer tu, -); - -typedef _dart_clang_getTranslationUnitCursor_wrap = ffi.Pointer - Function( - ffi.Pointer tu, -); - -typedef _c_clang_formatDiagnostic_wrap = ffi.Pointer Function( - ffi.Pointer diag, - ffi.Int32 opts, -); - -typedef _dart_clang_formatDiagnostic_wrap = ffi.Pointer Function( - ffi.Pointer diag, - int opts, -); - -typedef ModifiedCXCursorVisitor_1 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _c_clang_visitChildren_wrap = ffi.Uint32 Function( - ffi.Pointer parent, - ffi.Pointer> _modifiedVisitor, - ffi.Pointer clientData, -); - -typedef _dart_clang_visitChildren_wrap = int Function( - ffi.Pointer parent, - ffi.Pointer> _modifiedVisitor, - ffi.Pointer clientData, -); - -typedef _c_clang_Cursor_getNumArguments_wrap = ffi.Int32 Function( - ffi.Pointer cursor, -); - -typedef _dart_clang_Cursor_getNumArguments_wrap = int Function( - ffi.Pointer cursor, -); - -typedef _c_clang_Cursor_getArgument_wrap = ffi.Pointer Function( - ffi.Pointer cursor, - ffi.Uint32 i, -); - -typedef _dart_clang_Cursor_getArgument_wrap = ffi.Pointer Function( - ffi.Pointer cursor, - int i, -); - -typedef _c_clang_getNumArgTypes_wrap = ffi.Int32 Function( - ffi.Pointer cxtype, -); - -typedef _dart_clang_getNumArgTypes_wrap = int Function( - ffi.Pointer cxtype, -); - -typedef _c_clang_getArgType_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, - ffi.Uint32 i, -); - -typedef _dart_clang_getArgType_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, - int i, -); - -typedef _c_clang_getEnumConstantDeclValue_wrap = ffi.Int64 Function( - ffi.Pointer cursor, -); - -typedef _dart_clang_getEnumConstantDeclValue_wrap = int Function( - ffi.Pointer cursor, -); - -typedef _c_clang_equalRanges_wrap = ffi.Uint32 Function( - ffi.Pointer c1, - ffi.Pointer c2, -); - -typedef _dart_clang_equalRanges_wrap = int Function( - ffi.Pointer c1, - ffi.Pointer c2, -); - -typedef _c_clang_Cursor_getCommentRange_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, -); - -typedef _dart_clang_Cursor_getCommentRange_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, -); - -typedef _c_clang_Cursor_getRawCommentText_wrap = ffi.Pointer Function( - ffi.Pointer cursor, -); - -typedef _dart_clang_Cursor_getRawCommentText_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, -); - -typedef _c_clang_Cursor_getBriefCommentText_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, -); - -typedef _dart_clang_Cursor_getBriefCommentText_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, -); - -typedef _c_clang_getCursorLocation_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, -); - -typedef _dart_clang_getCursorLocation_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, -); - -typedef _c_clang_getFileLocation_wrap = ffi.Void Function( - ffi.Pointer location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef _dart_clang_getFileLocation_wrap = void Function( - ffi.Pointer location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef _c_clang_getFileName_wrap = ffi.Pointer Function( - ffi.Pointer SFile, -); - -typedef _dart_clang_getFileName_wrap = ffi.Pointer Function( - ffi.Pointer SFile, -); - -typedef _c_clang_getNumElements_wrap = ffi.Uint64 Function( - ffi.Pointer cxtype, -); - -typedef _dart_clang_getNumElements_wrap = int Function( - ffi.Pointer cxtype, -); - -typedef _c_clang_getArrayElementType_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, -); - -typedef _dart_clang_getArrayElementType_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, -); - typedef _typedefC_3 = ffi.Int32 Function( ffi.Pointer, ffi.Pointer, diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index f6acbebcfc..bc02bad7dc 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -18,12 +18,11 @@ ffigen: # Bash style Glob matching is also supported. # TODO(11): Globs dont work on windows if they begin with '.' or '..'. headers: - - '../../tool/wrapped_libclang/wrapper.c' + - ../../third_party/libclang/include/clang-c/Index.h # Excludes included headers based on their names (not fullpath name). header-filter: include: - - 'wrapper.c' - 'CXString.h' - 'Index.h' diff --git a/pkgs/ffigen/lib/src/code_generator/binding.dart b/pkgs/ffigen/lib/src/code_generator/binding.dart index 507de6c020..5a10c06f15 100644 --- a/pkgs/ffigen/lib/src/code_generator/binding.dart +++ b/pkgs/ffigen/lib/src/code_generator/binding.dart @@ -12,11 +12,13 @@ import 'writer.dart'; /// /// Do not extend directly, use [LookUpBinding] or [NoLookUpBinding]. abstract class Binding { + final String originalName; + String name; final String dartDoc; - Binding({@required this.name, this.dartDoc}); + Binding({@required this.originalName, @required this.name, this.dartDoc}); /// Return typedef dependencies. List getTypedefDependencies(Writer w); @@ -30,12 +32,18 @@ abstract class Binding { /// Base class for bindings which look up symbols in dynamic library. abstract class LookUpBinding extends Binding { - LookUpBinding({String name, String dartDoc}) - : super(name: name, dartDoc: dartDoc); + LookUpBinding({ + @required String originalName, + @required String name, + String dartDoc, + }) : super(originalName: originalName, name: name, dartDoc: dartDoc); } /// Base class for bindings which don't look up symbols in dynamic library. abstract class NoLookUpBinding extends Binding { - NoLookUpBinding({String name, String dartDoc}) - : super(name: name, dartDoc: dartDoc); + NoLookUpBinding({ + @required String originalName, + @required String name, + String dartDoc, + }) : super(originalName: originalName, name: name, dartDoc: dartDoc); } diff --git a/pkgs/ffigen/lib/src/code_generator/constant.dart b/pkgs/ffigen/lib/src/code_generator/constant.dart index d64e7ac5af..6af8a6de23 100644 --- a/pkgs/ffigen/lib/src/code_generator/constant.dart +++ b/pkgs/ffigen/lib/src/code_generator/constant.dart @@ -31,11 +31,12 @@ class Constant extends NoLookUpBinding { final String rawValue; Constant({ + String originalName, @required String name, String dartDoc, @required this.type, @required this.rawValue, - }) : super(name: name, dartDoc: dartDoc); + }) : super(originalName: originalName ?? name, name: name, dartDoc: dartDoc); @override BindingString toBindingString(Writer w) { diff --git a/pkgs/ffigen/lib/src/code_generator/enum_class.dart b/pkgs/ffigen/lib/src/code_generator/enum_class.dart index f578793f0c..8232ccb188 100644 --- a/pkgs/ffigen/lib/src/code_generator/enum_class.dart +++ b/pkgs/ffigen/lib/src/code_generator/enum_class.dart @@ -28,11 +28,12 @@ class EnumClass extends NoLookUpBinding { final List enumConstants; EnumClass({ + String originalName, @required String name, String dartDoc, List enumConstants, }) : enumConstants = enumConstants ?? [], - super(name: name, dartDoc: dartDoc); + super(originalName: originalName ?? name, name: name, dartDoc: dartDoc); @override BindingString toBindingString(Writer w) { diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index 4c321be30e..f0f317ee8a 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -30,20 +30,19 @@ import 'writer.dart'; /// typedef _dart_sum = int Function(int a, int b); /// ``` class Func extends LookUpBinding { - final String lookupSymbolName; final Type returnType; final List parameters; /// [lookupSymbolName], if not provided, takes the value of [name]. Func({ @required String name, - String lookupSymbolName, + String originalName, String dartDoc, @required this.returnType, List parameters, }) : parameters = parameters ?? [], - lookupSymbolName = lookupSymbolName ?? name, - super(name: name, dartDoc: dartDoc) { + super( + originalName: originalName ?? name, name: name, dartDoc: dartDoc) { for (var i = 0; i < this.parameters.length; i++) { if (this.parameters[i].name == null || this.parameters[i].name.trim() == '') { @@ -125,7 +124,7 @@ class Func extends LookUpBinding { } s.write(') {\n'); s.write( - "$funcVarName ??= ${w.dylibIdentifier}.lookupFunction<${cType.name},${dartType.name}>('$lookupSymbolName');\n"); + "$funcVarName ??= ${w.dylibIdentifier}.lookupFunction<${cType.name},${dartType.name}>('$originalName');\n"); s.write(' return $funcVarName(\n'); for (final p in parameters) { diff --git a/pkgs/ffigen/lib/src/code_generator/global.dart b/pkgs/ffigen/lib/src/code_generator/global.dart index f1f919f088..d0e67cf37d 100644 --- a/pkgs/ffigen/lib/src/code_generator/global.dart +++ b/pkgs/ffigen/lib/src/code_generator/global.dart @@ -22,15 +22,14 @@ import 'writer.dart'; /// final int a = _dylib.lookup('a').value; /// ``` class Global extends LookUpBinding { - final String lookupSymbolName; final Type type; Global({ + String originalName, @required String name, - @required this.lookupSymbolName, @required this.type, String dartDoc, - }) : super(name: name, dartDoc: dartDoc); + }) : super(originalName: originalName ?? name, name: name, dartDoc: dartDoc); @override BindingString toBindingString(Writer w) { @@ -45,7 +44,7 @@ class Global extends LookUpBinding { s.write( '${w.ffiLibraryPrefix}.Pointer<${type.getCType(w)}> $holderVarName;\n'); s.write( - "${type.getDartType(w)} get $globalVarName => ($holderVarName ??= ${w.dylibIdentifier}.lookup<${type.getCType(w)}>('$lookupSymbolName')).value;\n\n"); + "${type.getDartType(w)} get $globalVarName => ($holderVarName ??= ${w.dylibIdentifier}.lookup<${type.getCType(w)}>('$originalName')).value;\n\n"); return BindingString(type: BindingStringType.global, string: s.toString()); } diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index 13a7340cf1..6c292fd6b1 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -11,7 +11,7 @@ import 'binding.dart'; import 'utils.dart'; import 'writer.dart'; -var _logger = Logger('code_generator:library.dart'); +var _logger = Logger('ffigen.code_generator.library'); /// Container for all Bindings. class Library { @@ -31,34 +31,19 @@ class Library { final lookUpBindings = bindings.whereType().toList(); final noLookUpBindings = bindings.whereType().toList(); + //TODO(21): Resolve dart keyword as identifiers. /// Handle any declaration-declaration name conflict in [lookUpBindings]. final lookUpDeclConflictHandler = UniqueNamer({}); for (final b in lookUpBindings) { - // Print warning if name was conflicting and has been changed. - if (lookUpDeclConflictHandler.isUsed(b.name)) { - final oldName = b.name; - b.name = lookUpDeclConflictHandler.makeUnique(b.name); - - _logger.warning( - "Resolved name conflict: Declaration '$oldName' and has been renamed to '${b.name}'."); - } else { - lookUpDeclConflictHandler.markUsed(b.name); - } + _warnPrivateDeclaration(b); + _resolveNameConflict(lookUpDeclConflictHandler, b); } /// Handle any declaration-declaration name conflict in [noLookUpBindings]. final noLookUpDeclConflictHandler = UniqueNamer({}); for (final b in noLookUpBindings) { - // Print warning if name was conflicting and has been changed. - if (noLookUpDeclConflictHandler.isUsed(b.name)) { - final oldName = b.name; - b.name = noLookUpDeclConflictHandler.makeUnique(b.name); - - _logger.warning( - "Resolved name conflict: Declaration '$oldName' and has been renamed to '${b.name}'."); - } else { - noLookUpDeclConflictHandler.markUsed(b.name); - } + _warnPrivateDeclaration(b); + _resolveNameConflict(noLookUpDeclConflictHandler, b); } _writer = Writer( @@ -70,6 +55,28 @@ class Library { ); } + /// Logs a warning if generated declaration will be private. + void _warnPrivateDeclaration(Binding b) { + if (b.name.startsWith('_')) { + _logger.warning( + "Generated declaration '${b.name}' start's with '_' and therefore will be private."); + } + } + + /// LResolves name conflict(if any) and logs a warning. + void _resolveNameConflict(UniqueNamer namer, Binding b) { + // Print warning if name was conflicting and has been changed. + if (namer.isUsed(b.name)) { + final oldName = b.name; + b.name = namer.makeUnique(b.name); + + _logger.warning( + "Resolved name conflict: Declaration '$oldName' and has been renamed to '${b.name}'."); + } else { + namer.markUsed(b.name); + } + } + /// Sort all bindings in alphabetical order. void sort() { bindings.sort((b1, b2) => b1.name.compareTo(b2.name)); diff --git a/pkgs/ffigen/lib/src/code_generator/struc.dart b/pkgs/ffigen/lib/src/code_generator/struc.dart index 7c41a47ce1..11bae3dac8 100644 --- a/pkgs/ffigen/lib/src/code_generator/struc.dart +++ b/pkgs/ffigen/lib/src/code_generator/struc.dart @@ -39,11 +39,12 @@ class Struc extends NoLookUpBinding { List members; Struc({ + String originalName, @required String name, String dartDoc, List members, }) : members = members ?? [], - super(name: name, dartDoc: dartDoc); + super(originalName: originalName ?? name, name: name, dartDoc: dartDoc); List _getArrayDimensionLengths(Type type) { final array = []; @@ -153,7 +154,7 @@ class Member { final String name; final Type type; - const Member({this.name, this.type, this.dartDoc}); + const Member({@required this.name, @required this.type, this.dartDoc}); } // Helper bindings for struct array. diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 3e6e336de8..b0abcc0406 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -18,7 +18,7 @@ import '../strings.dart' as strings; import 'declaration.dart'; import 'spec_utils.dart'; -var _logger = Logger('config_provider:config.dart'); +var _logger = Logger('ffigen.config_provider.config'); /// Provides configurations to other modules. /// @@ -80,8 +80,6 @@ class Config { Config._(); /// Create config from Yaml map. - /// - /// Ensure that log printing is setup before using this. factory Config.fromYaml(YamlMap map) { final configspecs = Config._(); _logger.finest('Config Map: ' + map.toString()); @@ -90,8 +88,7 @@ class Config { final result = configspecs._checkConfigs(map, specs); if (!result) { - _logger.info('Please fix errors in Configurations and re-run the tool'); - exit(1); + throw ConfigError(); } configspecs._extract(map, specs); @@ -153,7 +150,9 @@ class Config { 'Path to folder containing libclang dynamic library, used to parse C headers', requirement: Requirement.no, defaultValue: () => getDylibPath(Platform.script - .resolve(path.join('..', 'tool', 'wrapped_libclang')) + .resolve(path.posix.join('..', 'tool', 'wrapped_libclang')) + // Path needs to be in posix style here or an illegal character + // error is thrown on windows. .toFilePath()), validator: libclangDylibValidator, extractor: libclangDylibExtractor, @@ -189,10 +188,9 @@ class Config { requirement: Requirement.no, validator: declarationConfigValidator, extractor: declarationConfigExtractor, - defaultValue: () => Declaration(declarationTypeName: 'Function'), + defaultValue: () => Declaration(), extractedResult: (dynamic result) { functionDecl = result as Declaration; - functionDecl.declarationTypeName = 'Function'; }, ), strings.structs: Specification( @@ -200,10 +198,9 @@ class Config { requirement: Requirement.no, validator: declarationConfigValidator, extractor: declarationConfigExtractor, - defaultValue: () => Declaration(declarationTypeName: 'Struct'), + defaultValue: () => Declaration(), extractedResult: (dynamic result) { structDecl = result as Declaration; - structDecl.declarationTypeName = 'Struct'; }, ), strings.enums: Specification( @@ -211,10 +208,9 @@ class Config { requirement: Requirement.no, validator: declarationConfigValidator, extractor: declarationConfigExtractor, - defaultValue: () => Declaration(declarationTypeName: 'Enum'), + defaultValue: () => Declaration(), extractedResult: (dynamic result) { enumClassDecl = result as Declaration; - enumClassDecl.declarationTypeName = 'Enum'; }, ), strings.sizemap: Specification>( @@ -326,3 +322,17 @@ class HeaderFilter { this.excludedInclusionHeaders = const {}, }); } + +class ConfigError implements Exception { + final String message; + ConfigError([this.message]); + + @override + String toString() { + if (message == null) { + return 'ConfigError: Invalid configurations provided.'; + } else { + return 'ConfigError: $message'; + } + } +} diff --git a/pkgs/ffigen/lib/src/config_provider/declaration.dart b/pkgs/ffigen/lib/src/config_provider/declaration.dart index 4674bc52fc..f808f13273 100644 --- a/pkgs/ffigen/lib/src/config_provider/declaration.dart +++ b/pkgs/ffigen/lib/src/config_provider/declaration.dart @@ -1,17 +1,9 @@ // Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:logging/logging.dart'; - -var _logger = Logger('config_provider:declaration.dart'); /// A generic declaration config. class Declaration { - /// Display name of a declaration type. - /// - /// Used for logging and warning purposes. - String declarationTypeName; - // matchers List _includeMatchers = []; Set _includeFull = {}; @@ -21,7 +13,6 @@ class Declaration { Map _prefixReplacement = {}; Declaration({ - this.declarationTypeName = 'declaration', List includeMatchers, List includeFull, List excludeMatchers, @@ -66,11 +57,6 @@ class Declaration { // Apply global prefixes. name = '${_globalPrefix}$name'; - // Warn user if a declaration starts with '_'. - if (name.startsWith('_')) { - _logger.warning( - "Generated $declarationTypeName '$name' start's with '_' and therefore will be private."); - } return name; } diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 70cccdd30a..0dff6e43b4 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -14,7 +14,16 @@ import '../strings.dart' as strings; import './config.dart'; import 'declaration.dart'; -var _logger = Logger('config_provider:spec_utils.dart'); +var _logger = Logger('ffigen.config_provider.spec_utils'); + +/// Replaces the path separators according to current platform. +String _replaceSeparators(String path) { + if (Platform.isWindows) { + return path.replaceAll(p.posix.separator, p.windows.separator); + } else { + return path.replaceAll(p.windows.separator, p.posix.separator); + } +} bool booleanExtractor(dynamic value) => value as bool; @@ -104,13 +113,15 @@ List headersExtractor(dynamic yamlConfig) { final headerGlob = h as String; // Add file directly to header if it's not a Glob but a File. if (File(headerGlob).existsSync()) { - headers.add(headerGlob); + final osSpecificPath = _replaceSeparators(headerGlob); + headers.add(osSpecificPath); _logger.fine('Adding header/file: $headerGlob'); } else { final glob = Glob(headerGlob); for (final file in glob.listSync(followLinks: true)) { - headers.add(file.path); - _logger.fine('Adding header/file: ${file.path}'); + final fixedPath = _replaceSeparators(file.path); + headers.add(fixedPath); + _logger.fine('Adding header/file: ${fixedPath}'); } } } @@ -146,21 +157,19 @@ bool libclangDylibValidator(String name, dynamic value) { } String getDylibPath(String dylibParentFoler) { + dylibParentFoler = _replaceSeparators(dylibParentFoler); String dylibPath; if (Platform.isMacOS) { dylibPath = p.join(dylibParentFoler, strings.libclang_dylib_macos); } else if (Platform.isWindows) { - // Fix path for windows if '/' is used as seperator instead of '\' - // because our examples input path like this. - final newValue = dylibParentFoler.replaceAll('/', r'\'); - dylibPath = p.join(newValue, strings.libclang_dylib_windows); + dylibPath = p.join(dylibParentFoler, strings.libclang_dylib_windows); } else { dylibPath = p.join(dylibParentFoler, strings.libclang_dylib_linux); } return dylibPath; } -String outputExtractor(dynamic value) => value as String; +String outputExtractor(dynamic value) => _replaceSeparators(value as String); bool outputValidator(String name, dynamic value) { if (value is String) { diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 809109f1b6..7040fb5461 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -347,7 +347,7 @@ class Clang { int clang_visitChildren_wrap( ffi.Pointer parent, ffi.Pointer> _modifiedVisitor, - ffi.Pointer clientData, + int uid, ) { _clang_visitChildren_wrap ??= _dylib.lookupFunction< _c_clang_visitChildren_wrap, @@ -355,7 +355,7 @@ class Clang { return _clang_visitChildren_wrap( parent, _modifiedVisitor, - clientData, + uid, ); } @@ -1922,13 +1922,13 @@ typedef ModifiedCXCursorVisitor_1 = ffi.Int32 Function( typedef _c_clang_visitChildren_wrap = ffi.Uint32 Function( ffi.Pointer parent, ffi.Pointer> _modifiedVisitor, - ffi.Pointer clientData, + ffi.Int64 uid, ); typedef _dart_clang_visitChildren_wrap = int Function( ffi.Pointer parent, ffi.Pointer> _modifiedVisitor, - ffi.Pointer clientData, + int uid, ); typedef _c_clang_Cursor_getNumArguments_wrap = ffi.Int32 Function( diff --git a/pkgs/ffigen/lib/src/header_parser/data.dart b/pkgs/ffigen/lib/src/header_parser/data.dart index c1b57bf9fa..ebda2dc84c 100644 --- a/pkgs/ffigen/lib/src/header_parser/data.dart +++ b/pkgs/ffigen/lib/src/header_parser/data.dart @@ -2,6 +2,9 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'dart:ffi'; +import 'dart:isolate'; + import 'package:ffigen/src/config_provider.dart'; import 'clang_bindings/clang_bindings.dart' show Clang; @@ -12,3 +15,9 @@ Config config; /// Holds clang functions. Clang clang; + +/// Holds the unique id refering to this isolate. +/// +/// Used by visitChildren_wrap to call the correct dart function from C. +// int get uid => Isolate.current.controlPort.; +final uid = Isolate.current.controlPort.nativePort; diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index 48944df2aa..bc3c7f8ad0 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -38,9 +38,9 @@ Library parse(Config conf, {bool sort = false}) { // BELOW FUNCTIONS ARE MEANT FOR INTERNAL USE AND TESTING // =================================================================================== -var _logger = Logger('header_parser:parser.dart'); +var _logger = Logger('ffigen.header_parser.parser'); -/// initialises parser, clears any previous values. +/// Initialises parser, clears any previous values. void initParser(Config c) { config = c; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index a98738b5e4..8cba1c99cd 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -9,14 +9,19 @@ import 'package:ffigen/src/header_parser/data.dart'; import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang_types; -import '../data.dart' show clang; +import '../data.dart'; import '../includer.dart'; import '../utils.dart'; -var _logger = Logger('header_parser:enumdecl_parser.dart'); +var _logger = Logger('ffigen.header_parser.enumdecl_parser'); -/// Temporarily holds a enumClass before its returned by [parseEnumDeclaration]. -EnumClass _enumClass; +/// Holds temporary information regarding [EnumClass] while parsing. +class _ParsedEnum { + EnumClass enumClass; + _ParsedEnum(); +} + +final _stack = Stack<_ParsedEnum>(); /// Parses a function declaration. EnumClass parseEnumDeclaration( @@ -25,22 +30,23 @@ EnumClass parseEnumDeclaration( /// Optionally provide name to use (useful in case struct is inside a typedef). String name, }) { - _enumClass = null; + _stack.push(_ParsedEnum()); final enumName = name ?? cursor.spelling(); if (enumName == '') { _logger.finest('unnamed enum declaration'); } else if (shouldIncludeEnumClass(enumName) && !isSeenEnumClass(enumName)) { _logger.fine('++++ Adding Enum: ${cursor.completeStringRepr()}'); - _enumClass = EnumClass( + _stack.top.enumClass = EnumClass( dartDoc: getCursorDocComment(cursor), + originalName: enumName, name: config.enumClassDecl.getPrefixedName(enumName), ); - addEnumClassToSeen(enumName, _enumClass); + addEnumClassToSeen(enumName, _stack.top.enumClass); _addEnumConstant(cursor); } - return _enumClass; + return _stack.pop().enumClass; } void _addEnumConstant(Pointer cursor) { @@ -48,7 +54,7 @@ void _addEnumConstant(Pointer cursor) { cursor, Pointer.fromFunction( _enumCursorVisitor, clang_types.CXChildVisitResult.CXChildVisit_Break), - nullptr, + uid, ); visitChildrenResultChecker(resultCode); @@ -81,7 +87,7 @@ int _enumCursorVisitor(Pointer cursor, /// Adds the parameter to func in [functiondecl_parser.dart]. void _addEnumConstantToEnumClass(Pointer cursor) { - _enumClass.enumConstants.add( + _stack.top.enumClass.enumConstants.add( EnumConstant( dartDoc: getCursorDocComment( cursor, diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index 18c341b881..8f35c24a01 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -13,16 +13,23 @@ import '../data.dart' show clang; import '../includer.dart'; import '../utils.dart'; -var _logger = Logger('header_parser:functiondecl_parser.dart'); +var _logger = Logger('ffigen.header_parser.functiondecl_parser'); + +/// Holds temporary information regarding [Func] while parsing. +class _ParserFunc { + Func func; + bool structByValueParameter = false; + bool unimplementedParameterType = false; + _ParserFunc(); +} -/// Temporarily holds a function before its returned by [parseFunctionDeclaration]. -Func _func; +final _stack = Stack<_ParserFunc>(); /// Parses a function declaration. Func parseFunctionDeclaration(Pointer cursor) { - _func = null; - structByValueParameter = false; - unimplementedParameterType = false; + _stack.push(_ParserFunc()); + _stack.top.structByValueParameter = false; + _stack.top.unimplementedParameterType = false; final funcName = cursor.spelling(); if (shouldIncludeFunc(funcName) && !isSeenFunc(funcName)) { @@ -32,41 +39,43 @@ Func parseFunctionDeclaration(Pointer cursor) { final parameters = _getParameters(cursor); //TODO(3): Remove this when support for Structs by value arrives. - if (rt.broadType == BroadType.Struct || structByValueParameter) { + if (rt.broadType == BroadType.Struct || _stack.top.structByValueParameter) { _logger.fine( '---- Removed Function, reason: struct pass/return by value: ${cursor.completeStringRepr()}'); _logger.warning( "Skipped Function '$funcName', struct pass/return by value not supported."); - return null; // Returning null so that [addToBindings] function excludes this. + return _stack + .pop() + .func; // Returning null so that [addToBindings] function excludes this. } if (rt.getBaseType().broadType == BroadType.Unimplemented || - unimplementedParameterType) { + _stack.top.unimplementedParameterType) { _logger.fine( '---- Removed Function, reason: unsupported return type or parameter type: ${cursor.completeStringRepr()}'); _logger.warning( "Skipped Function '$funcName', function has unsupported return type or parameter type."); - return null; // Returning null so that [addToBindings] function excludes this. + return _stack + .pop() + .func; // Returning null so that [addToBindings] function excludes this. } - _func = Func( + _stack.top.func = Func( dartDoc: getCursorDocComment( cursor, nesting.length + commentPrefix.length, ), name: config.functionDecl.getPrefixedName(funcName), - lookupSymbolName: funcName, + originalName: funcName, returnType: rt, parameters: parameters, ); - addFuncToSeen(funcName, _func); + addFuncToSeen(funcName, _stack.top.func); } - return _func; + return _stack.pop().func; } -bool structByValueParameter = false; -bool unimplementedParameterType = false; Type _getFunctionReturnType(Pointer cursor) { return cursor.returnType().toCodeGenTypeAndDispose(); } @@ -83,9 +92,9 @@ List _getParameters(Pointer cursor) { final pt = _getParameterType(paramCursor); //TODO(3): Remove this when support for Structs by value arrives. if (pt.broadType == BroadType.Struct) { - structByValueParameter = true; + _stack.top.structByValueParameter = true; } else if (pt.getBaseType().broadType == BroadType.Unimplemented) { - unimplementedParameterType = true; + _stack.top.unimplementedParameterType = true; } final pn = paramCursor.spelling(); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index 309ab39477..32e2fd780a 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -12,10 +12,18 @@ import '../data.dart'; import '../includer.dart'; import '../utils.dart'; -var _logger = Logger('header_parser:structdecl_parser.dart'); +var _logger = Logger('ffigen.header_parser.structdecl_parser'); + +/// Holds temporary information regarding [struc] while parsing. +class _ParsedStruc { + Struc struc; + bool nestedStructMember = false; + bool unimplementedMemberType = false; + bool arrayMember = false; + _ParsedStruc(); +} -/// Temporarily holds a struc before its returned by [parseStructDeclaration]. -Struc _struc; +final _stack = Stack<_ParsedStruc>(); /// Parses a struct declaration. Struc parseStructDeclaration( @@ -28,73 +36,65 @@ Struc parseStructDeclaration( /// when they are passed/returned by an included function.) bool ignoreFilter = false, }) { - _struc = null; + _stack.push(_ParsedStruc()); final structName = name ?? cursor.spelling(); - if (structName == '') { + if (structName.isEmpty) { _logger.finest('unnamed structure or typedef structure declaration'); - return null; } else if ((ignoreFilter || shouldIncludeStruct(structName)) && (!isSeenStruc(structName))) { _logger.fine( '++++ Adding Structure: structName: ${structName}, ${cursor.completeStringRepr()}'); - - _struc = Struc( + _stack.top.struc = Struc( + originalName: structName, name: config.structDecl.getPrefixedName(structName), dartDoc: getCursorDocComment(cursor), ); // Adding to seen here to stop recursion if a struct has itself as a // member, members are updated later. - addStrucToSeen(structName, _struc); - _struc.members = _getMembers(cursor, structName); + addStrucToSeen(structName, _stack.top.struc); + _setStructMembers(cursor); } - return _struc; + return _stack.pop().struc; } -List _members; -List _getMembers(Pointer cursor, String structName) { - _members = []; - arrayMember = false; - nestedStructMember = false; - unimplementedMemberType = false; +void _setStructMembers(Pointer cursor) { + _stack.top.arrayMember = false; + _stack.top.nestedStructMember = false; + _stack.top.unimplementedMemberType = false; final resultCode = clang.clang_visitChildren_wrap( - cursor, - Pointer.fromFunction( - _structMembersVisitor, clang_types.CXChildVisitResult.CXChildVisit_Break), - nullptr); + cursor, + Pointer.fromFunction(_structMembersVisitor, + clang_types.CXChildVisitResult.CXChildVisit_Break), + uid, + ); visitChildrenResultChecker(resultCode); // Returning null to exclude the struct members as it has a struct by value field. - if (arrayMember && !config.arrayWorkaround) { + 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: $structName, Array members not supported'); - return []; - } else if (nestedStructMember) { + '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.nestedStructMember) { _logger.fine( '---- Removed Struct members, reason: struct has struct members ${cursor.completeStringRepr()}'); _logger.warning( - "Removed All Struct Members from '$structName', Nested Structures not supported."); - return []; - } else if (unimplementedMemberType) { + 'Removed All Struct Members from ${_stack.top.struc.name}(${_stack.top.struc.originalName}), Nested Structures 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 '$structName', struct member has an unsupported type."); - return []; + '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(); } - - return _members; } -bool nestedStructMember = false; -bool unimplementedMemberType = false; -bool arrayMember = false; - /// Visitor for the struct cursor [CXCursorKind.CXCursor_StructDecl]. /// /// Child visitor invoked on struct cursor. @@ -110,21 +110,21 @@ int _structMembersVisitor(Pointer cursor, if (mt.broadType == BroadType.Struct) { // Setting this flag will exclude adding members for this struct's // bindings. - nestedStructMember = true; + _stack.top.nestedStructMember = true; } else if (mt.broadType == BroadType.ConstantArray) { - arrayMember = true; + _stack.top.arrayMember = true; if (mt.child.broadType == BroadType.Struct) { // Setting this flag will exclude adding members for this struct's // bindings. - nestedStructMember = true; + _stack.top.nestedStructMember = true; } } if (mt.getBaseType().broadType == BroadType.Unimplemented) { - unimplementedMemberType = true; + _stack.top.unimplementedMemberType = true; } - _members.add( + _stack.top.struc.members.add( Member( dartDoc: getCursorDocComment( cursor, diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart index 8d2a8310b4..558fce335e 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart @@ -8,35 +8,37 @@ import 'package:ffigen/src/code_generator.dart'; import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang_types; -import '../data.dart' show clang; +import '../data.dart'; import '../sub_parsers/enumdecl_parser.dart'; import '../sub_parsers/structdecl_parser.dart'; import '../utils.dart'; -var _logger = Logger('header_parser:typedefdecl_parser.dart'); +var _logger = Logger('ffigen.header_parser.typedefdecl_parser'); -/// Temporarily holds a binding before its returned by [parseTypedefDeclaration]. -Binding _binding; +/// Holds temporary information regarding a typedef referenced [Binding] +/// while parsing. +class _ParsedTypedef { + Binding binding; + String typedefName; + _ParsedTypedef(); +} -/// Temporarily holds parent cursor name. -String _typedefName; +final _stack = Stack<_ParsedTypedef>(); /// Parses a typedef declaration. Binding parseTypedefDeclaration(Pointer cursor) { - _binding = null; + _stack.push(_ParsedTypedef()); // Name of typedef. - _typedefName = cursor.spelling(); - + _stack.top.typedefName = cursor.spelling(); final resultCode = clang.clang_visitChildren_wrap( cursor, Pointer.fromFunction(_typedefdeclarationCursorVisitor, clang_types.CXChildVisitResult.CXChildVisit_Break), - nullptr, + uid, ); visitChildrenResultChecker(resultCode); - - return _binding; + return _stack.pop().binding; } /// Visitor for extracting binding for a TypedefDeclarations of a @@ -52,10 +54,12 @@ int _typedefdeclarationCursorVisitor(Pointer cursor, switch (clang.clang_getCursorKind_wrap(cursor)) { case clang_types.CXCursorKind.CXCursor_StructDecl: - _binding = parseStructDeclaration(cursor, name: _typedefName); + _stack.top.binding = + parseStructDeclaration(cursor, name: _stack.top.typedefName); break; case clang_types.CXCursorKind.CXCursor_EnumDecl: - _binding = parseEnumDeclaration(cursor, name: _typedefName); + _stack.top.binding = + parseEnumDeclaration(cursor, name: _stack.top.typedefName); break; default: _logger.finest('typedefdeclarationCursorVisitor: Ignored'); diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart index 73c8880af4..987254e2b3 100644 --- a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -8,7 +8,7 @@ import 'package:ffigen/src/code_generator.dart'; import 'package:logging/logging.dart'; import 'clang_bindings/clang_bindings.dart' as clang_types; -import 'data.dart' show clang; +import 'data.dart'; import 'includer.dart'; import 'sub_parsers/enumdecl_parser.dart'; import 'sub_parsers/functiondecl_parser.dart'; @@ -16,7 +16,7 @@ import 'sub_parsers/structdecl_parser.dart'; import 'sub_parsers/typedefdecl_parser.dart'; import 'utils.dart'; -var _logger = Logger('header_parser:translation_unit_parser.dart'); +var _logger = Logger('ffigen.header_parser.translation_unit_parser'); List _bindings; @@ -24,12 +24,11 @@ List _bindings; List parseTranslationUnit( Pointer translationUnitCursor) { _bindings = []; - final resultCode = clang.clang_visitChildren_wrap( translationUnitCursor, Pointer.fromFunction( _rootCursorVisitor, clang_types.CXChildVisitResult.CXChildVisit_Break), - nullptr, + uid, ); visitChildrenResultChecker(resultCode); diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 6c59dd6084..2c0f6665b4 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -16,7 +16,7 @@ import '../translation_unit_parser.dart'; import '../type_extractor/cxtypekindmap.dart'; import '../utils.dart'; -var _logger = Logger('header_parser:extractor.dart'); +var _logger = Logger('ffigen.header_parser.extractor'); const _padding = ' '; /// Converts cxtype to a typestring code_generator can accept. @@ -64,16 +64,12 @@ Type getCodeGenType(Pointer cxtype, {String parentName}) { .CXType_ConstantArray: // Primarily used for constant array in struct members. return Type.constantArray( clang.clang_getNumElements_wrap(cxtype), - clang - .clang_getArrayElementType_wrap(cxtype) - .toCodeGenTypeAndDispose(), + clang.clang_getArrayElementType_wrap(cxtype).toCodeGenTypeAndDispose(), ); case clang_types.CXTypeKind .CXType_IncompleteArray: // Primarily used for incomplete array in function parameters. return Type.incompleteArray( - clang - .clang_getArrayElementType_wrap(cxtype) - .toCodeGenTypeAndDispose(), + clang.clang_getArrayElementType_wrap(cxtype).toCodeGenTypeAndDispose(), ); default: if (cxTypeKindToSupportedNativeTypes.containsKey(kind)) { @@ -104,8 +100,7 @@ Type _extractfromRecord(Pointer cxtype) { structName = cxtype.spelling(); } - final fixedStructName = - config.structDecl.getPrefixedName(structName); + final fixedStructName = config.structDecl.getPrefixedName(structName); // Also add a struct binding, if its unseen. // TODO(23): Check if we should auto add struct. @@ -140,9 +135,9 @@ Type _extractFromFunctionProto( // Set a name for typedefc incase it was null or empty. if (name == null || name == '') { - name = _getNextUniqueString('_typedefC'); + name = _getNextIncrementedString('_typedefC'); } else { - name = _getNextUniqueString(name); + name = _getNextIncrementedString(name); } final _parameters = []; final totalArgs = clang.clang_getNumArgTypes_wrap(cxtype); @@ -164,20 +159,19 @@ Type _extractFromFunctionProto( name: name, typedefType: TypedefType.C, parameters: _parameters, - returnType: clang - .clang_getResultType_wrap(cxtype) - .toCodeGenTypeAndDispose(), + returnType: + clang.clang_getResultType_wrap(cxtype).toCodeGenTypeAndDispose(), ); return Type.nativeFunc(typedefC); } /// Generate a unique string for naming in [Typedef]. -String _getNextUniqueString(String prefix) { - int i = _uniqueStringCounters[prefix] ?? 0; +String _getNextIncrementedString(String prefix) { + int i = _incrementedStringCounters[prefix] ?? 0; i++; - _uniqueStringCounters[prefix] = i; + _incrementedStringCounters[prefix] = i; return '${prefix}_$i'; } -Map _uniqueStringCounters = {}; +Map _incrementedStringCounters = {}; diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index dc7efcf8da..052ea5f685 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -302,3 +302,11 @@ extension DynamicCStringArray on Pointer> { free(this); } } + +class Stack { + final _stack = []; + + T get top => _stack.last; + T pop() => _stack.removeLast(); + void push(T item) => _stack.add(item); +} diff --git a/pkgs/ffigen/test/code_generator_test.dart b/pkgs/ffigen/test/code_generator_test.dart index a7a66c9633..4fd5aea4e1 100644 --- a/pkgs/ffigen/test/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_test.dart @@ -15,7 +15,6 @@ void main() { bindings: [ Func( name: 'noParam', - lookupSymbolName: 'noParam', dartDoc: 'Just a test function\nheres another line', returnType: Type.nativeType( SupportedNativeType.Int32, @@ -23,7 +22,6 @@ void main() { ), Func( name: 'withPrimitiveParam', - lookupSymbolName: 'withPrimitiveParam', parameters: [ Parameter( name: 'a', @@ -44,7 +42,6 @@ void main() { ), Func( name: 'withPointerParam', - lookupSymbolName: 'withPointerParam', parameters: [ Parameter( name: 'a', @@ -308,7 +305,6 @@ class WithPointerMember extends ffi.Struct{ struct_some, Func( name: 'someFunc', - lookupSymbolName: 'someFunc', parameters: [ Parameter( name: 'some', @@ -401,14 +397,12 @@ typedef _dart_someFunc = ffi.Pointer Function( bindings: [ Global( name: 'test1', - lookupSymbolName: 'test1', type: Type.nativeType( SupportedNativeType.Int32, ), ), Global( name: 'test2', - lookupSymbolName: 'test2', type: Type.pointer( Type.nativeType( SupportedNativeType.Float, @@ -418,7 +412,6 @@ typedef _dart_someFunc = ffi.Pointer Function( struc_some, Global( name: 'test5', - lookupSymbolName: 'test5', type: Type.pointer( Type.struct( struc_some, @@ -574,22 +567,18 @@ class Constants { bindings: [ Func( name: 'test', - lookupSymbolName: 'test', returnType: Type.nativeType(SupportedNativeType.Void), ), Func( name: '_test', - lookupSymbolName: '_test', returnType: Type.nativeType(SupportedNativeType.Void), ), Func( name: '_c_test', - lookupSymbolName: '_c_test', returnType: Type.nativeType(SupportedNativeType.Void), ), Func( name: '_dart_test', - lookupSymbolName: '_dart_test', returnType: Type.nativeType(SupportedNativeType.Void), ), Struc( @@ -609,7 +598,6 @@ class Constants { Struc(name: 'ArrayHelperPrefixCollisionTest'), Func( name: 'Test', - lookupSymbolName: 'Test', returnType: Type.nativeType(SupportedNativeType.Void), ), EnumClass(name: '_c_Test'), diff --git a/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart index 7e1bfd0146..3b09841dca 100644 --- a/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart @@ -5,8 +5,13 @@ import 'package:ffigen/src/code_generator.dart'; import 'package:test/test.dart'; +import '../test_utils.dart'; + void main() { - group('Declaration-Declaration Collision', () { + group('decl_decl_collision_test', () { + setUpAll(() { + logWarnings(); + }); test('declaration conflict', () { final l1 = Library(name: 'Bindings', bindings: [ Struc(name: 'TestStruc'), @@ -27,11 +32,11 @@ void main() { EnumClass(name: 'TestEnum_1'), Func( name: 'testFunc', - lookupSymbolName: 'testFunc', + originalName: 'testFunc', returnType: Type.nativeType(SupportedNativeType.Void)), Func( name: 'testFunc_1', - lookupSymbolName: 'testFunc', + originalName: 'testFunc', returnType: Type.nativeType(SupportedNativeType.Void)), ]); diff --git a/pkgs/ffigen/test/debug_generated/README.md b/pkgs/ffigen/test/debug_generated/README.md new file mode 100644 index 0000000000..f8fe72f638 --- /dev/null +++ b/pkgs/ffigen/test/debug_generated/README.md @@ -0,0 +1,3 @@ +This folder is used in tests. +These files are deleted if tests are successful, but +will contain debug files from failed tests. diff --git a/pkgs/ffigen/test/header_parser_tests/function_n_struct.h b/pkgs/ffigen/test/header_parser_tests/function_n_struct.h new file mode 100644 index 0000000000..e779d5fb54 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/function_n_struct.h @@ -0,0 +1,15 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +struct Struct1 +{ + int a; +}; + +struct Struct2 +{ + struct Struct1 a; +}; + +void func1(struct Struct2 *s); diff --git a/pkgs/ffigen/test/header_parser_tests/function_n_struct_.dart b/pkgs/ffigen/test/header_parser_tests/function_n_struct_.dart new file mode 100644 index 0000000000..e99faf0181 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/function_n_struct_.dart @@ -0,0 +1,66 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/config_provider.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; +import 'package:ffigen/src/strings.dart' as strings; + +import '../test_utils.dart'; + +Library actual, expected; + +void main() { + group('function_n_struct_test', () { + setUpAll(() { + logWarnings(); + expected = expectedLibrary(); + actual = parser.parse( + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Function And Struct Test' +${strings.output}: 'unused' +${strings.libclang_dylib_folder}: 'tool/wrapped_libclang' +${strings.headers}: + - 'test/header_parser_tests/function_n_struct.h' + ''') as yaml.YamlMap), + ); + }); + + test('func1', () { + expect(actual.getBindingAsString('func1'), + expected.getBindingAsString('func1')); + }); + test('Struct2', () { + expect((actual.getBinding('Struct2') as Struc).members.isEmpty, true); + }); + }); +} + +Library expectedLibrary() { + final struc2 = Struc(name: 'Struct2', members: []); + return Library( + name: 'Bindings', + bindings: [ + struc2, + Struc(name: 'Struct1', members: [ + Member( + name: 'a', + type: Type.nativeType(SupportedNativeType.Int32), + ), + ]), + Func( + name: 'func1', + parameters: [ + Parameter(name: 's', type: Type.pointer(Type.struct(struc2))), + ], + returnType: Type.nativeType( + SupportedNativeType.Void, + ), + ), + ], + ); +} diff --git a/pkgs/ffigen/test/header_parser_tests/functions_test.dart b/pkgs/ffigen/test/header_parser_tests/functions_test.dart index b566fb4bb5..67a147a4c8 100644 --- a/pkgs/ffigen/test/header_parser_tests/functions_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/functions_test.dart @@ -5,28 +5,23 @@ import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/config_provider.dart'; -import 'package:logging/logging.dart'; import 'package:test/test.dart'; import 'package:yaml/yaml.dart' as yaml; import 'package:ffigen/src/strings.dart' as strings; +import '../test_utils.dart'; + Library actual, expected; void main() { - group('header_parser', () { + group('functions_test', () { setUpAll(() { + logWarnings(); expected = expectedLibrary(); - - Logger.root.onRecord.listen((log) { - if (log.level > Level.INFO) { - print( - 'functions_test.dart: ${log.level.name.padRight(8)}: ${log.message}'); - } - }); actual = parser.parse( Config.fromYaml(yaml.loadYaml(''' ${strings.name}: 'NativeLibrary' -${strings.description}: 'Prefix Test' +${strings.description}: 'Functions Test' ${strings.output}: 'unused' ${strings.libclang_dylib_folder}: 'tool/wrapped_libclang' ${strings.headers}: @@ -42,43 +37,37 @@ ${strings.headerFilter}: }); test('func1', () { - expect(binding(actual, 'func1'), binding(expected, 'func1')); + expect(actual.getBindingAsString('func1'), + expected.getBindingAsString('func1')); }); test('func2', () { - expect(binding(actual, 'func2'), binding(expected, 'func2')); + expect(actual.getBindingAsString('func2'), + expected.getBindingAsString('func2')); }); test('func3', () { - expect(binding(actual, 'func3'), binding(expected, 'func3')); + expect(actual.getBindingAsString('func3'), + expected.getBindingAsString('func3')); }); test('func4', () { - expect(binding(actual, 'func4'), binding(expected, 'func4')); + expect(actual.getBindingAsString('func4'), + expected.getBindingAsString('func4')); }); }); } -/// Extracts a binding's string from a library. -String binding(Library lib, String name) { - return lib.bindings - .firstWhere((element) => element.name == name) - .toBindingString(lib.writer) - .string; -} - Library expectedLibrary() { return Library( name: 'Bindings', bindings: [ Func( name: 'func1', - lookupSymbolName: 'func1', returnType: Type.nativeType( SupportedNativeType.Void, ), ), Func( name: 'func2', - lookupSymbolName: 'func2', returnType: Type.nativeType( SupportedNativeType.Int32, ), @@ -93,7 +82,6 @@ Library expectedLibrary() { ), Func( name: 'func3', - lookupSymbolName: 'func3', returnType: Type.nativeType( SupportedNativeType.Double, ), @@ -125,7 +113,6 @@ Library expectedLibrary() { ), Func( name: 'func4', - lookupSymbolName: 'func4', returnType: Type.pointer(Type.nativeType(SupportedNativeType.Void)), parameters: [ Parameter( diff --git a/pkgs/ffigen/test/header_parser_tests/nested_parsing.h b/pkgs/ffigen/test/header_parser_tests/nested_parsing.h new file mode 100644 index 0000000000..29ad832c6d --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/nested_parsing.h @@ -0,0 +1,16 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +struct Struct2 +{ + int e; + int f; +}; + +struct Struct1 +{ + int a; + int b; + struct Struct2 *struct2; +}; diff --git a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart new file mode 100644 index 0000000000..8783f46166 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart @@ -0,0 +1,83 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/config_provider.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; +import 'package:ffigen/src/strings.dart' as strings; + +import '../test_utils.dart'; + +Library actual, expected; + +void main() { + group('nested_parsing_test', () { + setUpAll(() { + logWarnings(); + expected = expectedLibrary(); + actual = parser.parse( + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Nested Parsing Test' +${strings.output}: 'unused' +${strings.libclang_dylib_folder}: 'tool/wrapped_libclang' +${strings.headers}: + - 'test/header_parser_tests/nested_parsing.h' +structs: + include: + names: + - Struct1 +${strings.headerFilter}: + ${strings.include}: + - 'nested_parsing.h' + ''') as yaml.YamlMap), + ); + }); + + test('Total bindings count', () { + expect(actual.bindings.length, expected.bindings.length); + }); + + test('Struct1', () { + expect(actual.getBindingAsString('Struct1'), + expected.getBindingAsString('Struct1')); + }); + test('Struct2', () { + expect(actual.getBindingAsString('Struct2'), + expected.getBindingAsString('Struct2')); + }); + }); +} + +Library expectedLibrary() { + final struc2 = Struc(name: 'Struct2', members: [ + Member( + name: 'e', + type: Type.nativeType(SupportedNativeType.Int32), + ), + Member( + name: 'f', + type: Type.nativeType(SupportedNativeType.Int32), + ), + ]); + return Library( + name: 'Bindings', + bindings: [ + struc2, + Struc(name: 'Struct1', members: [ + Member( + name: 'a', + type: Type.nativeType(SupportedNativeType.Int32), + ), + Member( + name: 'b', + type: Type.nativeType(SupportedNativeType.Int32), + ), + Member(name: 'struct2', type: Type.pointer(Type.struct(struc2))), + ]), + ], + ); +} diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart new file mode 100644 index 0000000000..e7766d2ac9 --- /dev/null +++ b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart @@ -0,0 +1,1752 @@ +/// AUTO GENERATED FILE, DO NOT EDIT. +/// +/// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Bindings to Cjson. +class CJson { + /// Holds the Dynamic library. + final ffi.DynamicLibrary _dylib; + + /// The symbols are looked up in [dynamicLibrary]. + CJson(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + + ffi.Pointer cJSON_Version() { + _cJSON_Version ??= _dylib + .lookupFunction<_c_cJSON_Version, _dart_cJSON_Version>('cJSON_Version'); + return _cJSON_Version(); + } + + _dart_cJSON_Version _cJSON_Version; + + void cJSON_InitHooks( + ffi.Pointer hooks, + ) { + _cJSON_InitHooks ??= + _dylib.lookupFunction<_c_cJSON_InitHooks, _dart_cJSON_InitHooks>( + 'cJSON_InitHooks'); + return _cJSON_InitHooks( + hooks, + ); + } + + _dart_cJSON_InitHooks _cJSON_InitHooks; + + ffi.Pointer cJSON_Parse( + ffi.Pointer value, + ) { + _cJSON_Parse ??= + _dylib.lookupFunction<_c_cJSON_Parse, _dart_cJSON_Parse>('cJSON_Parse'); + return _cJSON_Parse( + value, + ); + } + + _dart_cJSON_Parse _cJSON_Parse; + + ffi.Pointer cJSON_ParseWithOpts( + ffi.Pointer value, + ffi.Pointer> return_parse_end, + int require_null_terminated, + ) { + _cJSON_ParseWithOpts ??= _dylib.lookupFunction<_c_cJSON_ParseWithOpts, + _dart_cJSON_ParseWithOpts>('cJSON_ParseWithOpts'); + return _cJSON_ParseWithOpts( + value, + return_parse_end, + require_null_terminated, + ); + } + + _dart_cJSON_ParseWithOpts _cJSON_ParseWithOpts; + + ffi.Pointer cJSON_Print( + ffi.Pointer item, + ) { + _cJSON_Print ??= + _dylib.lookupFunction<_c_cJSON_Print, _dart_cJSON_Print>('cJSON_Print'); + return _cJSON_Print( + item, + ); + } + + _dart_cJSON_Print _cJSON_Print; + + ffi.Pointer cJSON_PrintUnformatted( + ffi.Pointer item, + ) { + _cJSON_PrintUnformatted ??= _dylib.lookupFunction<_c_cJSON_PrintUnformatted, + _dart_cJSON_PrintUnformatted>('cJSON_PrintUnformatted'); + return _cJSON_PrintUnformatted( + item, + ); + } + + _dart_cJSON_PrintUnformatted _cJSON_PrintUnformatted; + + ffi.Pointer cJSON_PrintBuffered( + ffi.Pointer item, + int prebuffer, + int fmt, + ) { + _cJSON_PrintBuffered ??= _dylib.lookupFunction<_c_cJSON_PrintBuffered, + _dart_cJSON_PrintBuffered>('cJSON_PrintBuffered'); + return _cJSON_PrintBuffered( + item, + prebuffer, + fmt, + ); + } + + _dart_cJSON_PrintBuffered _cJSON_PrintBuffered; + + int cJSON_PrintPreallocated( + ffi.Pointer item, + ffi.Pointer buffer, + int length, + int format, + ) { + _cJSON_PrintPreallocated ??= _dylib.lookupFunction< + _c_cJSON_PrintPreallocated, + _dart_cJSON_PrintPreallocated>('cJSON_PrintPreallocated'); + return _cJSON_PrintPreallocated( + item, + buffer, + length, + format, + ); + } + + _dart_cJSON_PrintPreallocated _cJSON_PrintPreallocated; + + void cJSON_Delete( + ffi.Pointer item, + ) { + _cJSON_Delete ??= _dylib + .lookupFunction<_c_cJSON_Delete, _dart_cJSON_Delete>('cJSON_Delete'); + return _cJSON_Delete( + item, + ); + } + + _dart_cJSON_Delete _cJSON_Delete; + + int cJSON_GetArraySize( + ffi.Pointer array, + ) { + _cJSON_GetArraySize ??= + _dylib.lookupFunction<_c_cJSON_GetArraySize, _dart_cJSON_GetArraySize>( + 'cJSON_GetArraySize'); + return _cJSON_GetArraySize( + array, + ); + } + + _dart_cJSON_GetArraySize _cJSON_GetArraySize; + + ffi.Pointer cJSON_GetArrayItem( + ffi.Pointer array, + int index, + ) { + _cJSON_GetArrayItem ??= + _dylib.lookupFunction<_c_cJSON_GetArrayItem, _dart_cJSON_GetArrayItem>( + 'cJSON_GetArrayItem'); + return _cJSON_GetArrayItem( + array, + index, + ); + } + + _dart_cJSON_GetArrayItem _cJSON_GetArrayItem; + + ffi.Pointer cJSON_GetObjectItem( + ffi.Pointer object, + ffi.Pointer string, + ) { + _cJSON_GetObjectItem ??= _dylib.lookupFunction<_c_cJSON_GetObjectItem, + _dart_cJSON_GetObjectItem>('cJSON_GetObjectItem'); + return _cJSON_GetObjectItem( + object, + string, + ); + } + + _dart_cJSON_GetObjectItem _cJSON_GetObjectItem; + + ffi.Pointer cJSON_GetObjectItemCaseSensitive( + ffi.Pointer object, + ffi.Pointer string, + ) { + _cJSON_GetObjectItemCaseSensitive ??= _dylib.lookupFunction< + _c_cJSON_GetObjectItemCaseSensitive, + _dart_cJSON_GetObjectItemCaseSensitive>( + 'cJSON_GetObjectItemCaseSensitive'); + return _cJSON_GetObjectItemCaseSensitive( + object, + string, + ); + } + + _dart_cJSON_GetObjectItemCaseSensitive _cJSON_GetObjectItemCaseSensitive; + + int cJSON_HasObjectItem( + ffi.Pointer object, + ffi.Pointer string, + ) { + _cJSON_HasObjectItem ??= _dylib.lookupFunction<_c_cJSON_HasObjectItem, + _dart_cJSON_HasObjectItem>('cJSON_HasObjectItem'); + return _cJSON_HasObjectItem( + object, + string, + ); + } + + _dart_cJSON_HasObjectItem _cJSON_HasObjectItem; + + ffi.Pointer cJSON_GetErrorPtr() { + _cJSON_GetErrorPtr ??= + _dylib.lookupFunction<_c_cJSON_GetErrorPtr, _dart_cJSON_GetErrorPtr>( + 'cJSON_GetErrorPtr'); + return _cJSON_GetErrorPtr(); + } + + _dart_cJSON_GetErrorPtr _cJSON_GetErrorPtr; + + ffi.Pointer cJSON_GetStringValue( + ffi.Pointer item, + ) { + _cJSON_GetStringValue ??= _dylib.lookupFunction<_c_cJSON_GetStringValue, + _dart_cJSON_GetStringValue>('cJSON_GetStringValue'); + return _cJSON_GetStringValue( + item, + ); + } + + _dart_cJSON_GetStringValue _cJSON_GetStringValue; + + int cJSON_IsInvalid( + ffi.Pointer item, + ) { + _cJSON_IsInvalid ??= + _dylib.lookupFunction<_c_cJSON_IsInvalid, _dart_cJSON_IsInvalid>( + 'cJSON_IsInvalid'); + return _cJSON_IsInvalid( + item, + ); + } + + _dart_cJSON_IsInvalid _cJSON_IsInvalid; + + int cJSON_IsFalse( + ffi.Pointer item, + ) { + _cJSON_IsFalse ??= _dylib + .lookupFunction<_c_cJSON_IsFalse, _dart_cJSON_IsFalse>('cJSON_IsFalse'); + return _cJSON_IsFalse( + item, + ); + } + + _dart_cJSON_IsFalse _cJSON_IsFalse; + + int cJSON_IsTrue( + ffi.Pointer item, + ) { + _cJSON_IsTrue ??= _dylib + .lookupFunction<_c_cJSON_IsTrue, _dart_cJSON_IsTrue>('cJSON_IsTrue'); + return _cJSON_IsTrue( + item, + ); + } + + _dart_cJSON_IsTrue _cJSON_IsTrue; + + int cJSON_IsBool( + ffi.Pointer item, + ) { + _cJSON_IsBool ??= _dylib + .lookupFunction<_c_cJSON_IsBool, _dart_cJSON_IsBool>('cJSON_IsBool'); + return _cJSON_IsBool( + item, + ); + } + + _dart_cJSON_IsBool _cJSON_IsBool; + + int cJSON_IsNull( + ffi.Pointer item, + ) { + _cJSON_IsNull ??= _dylib + .lookupFunction<_c_cJSON_IsNull, _dart_cJSON_IsNull>('cJSON_IsNull'); + return _cJSON_IsNull( + item, + ); + } + + _dart_cJSON_IsNull _cJSON_IsNull; + + int cJSON_IsNumber( + ffi.Pointer item, + ) { + _cJSON_IsNumber ??= + _dylib.lookupFunction<_c_cJSON_IsNumber, _dart_cJSON_IsNumber>( + 'cJSON_IsNumber'); + return _cJSON_IsNumber( + item, + ); + } + + _dart_cJSON_IsNumber _cJSON_IsNumber; + + int cJSON_IsString( + ffi.Pointer item, + ) { + _cJSON_IsString ??= + _dylib.lookupFunction<_c_cJSON_IsString, _dart_cJSON_IsString>( + 'cJSON_IsString'); + return _cJSON_IsString( + item, + ); + } + + _dart_cJSON_IsString _cJSON_IsString; + + int cJSON_IsArray( + ffi.Pointer item, + ) { + _cJSON_IsArray ??= _dylib + .lookupFunction<_c_cJSON_IsArray, _dart_cJSON_IsArray>('cJSON_IsArray'); + return _cJSON_IsArray( + item, + ); + } + + _dart_cJSON_IsArray _cJSON_IsArray; + + int cJSON_IsObject( + ffi.Pointer item, + ) { + _cJSON_IsObject ??= + _dylib.lookupFunction<_c_cJSON_IsObject, _dart_cJSON_IsObject>( + 'cJSON_IsObject'); + return _cJSON_IsObject( + item, + ); + } + + _dart_cJSON_IsObject _cJSON_IsObject; + + int cJSON_IsRaw( + ffi.Pointer item, + ) { + _cJSON_IsRaw ??= + _dylib.lookupFunction<_c_cJSON_IsRaw, _dart_cJSON_IsRaw>('cJSON_IsRaw'); + return _cJSON_IsRaw( + item, + ); + } + + _dart_cJSON_IsRaw _cJSON_IsRaw; + + ffi.Pointer cJSON_CreateNull() { + _cJSON_CreateNull ??= + _dylib.lookupFunction<_c_cJSON_CreateNull, _dart_cJSON_CreateNull>( + 'cJSON_CreateNull'); + return _cJSON_CreateNull(); + } + + _dart_cJSON_CreateNull _cJSON_CreateNull; + + ffi.Pointer cJSON_CreateTrue() { + _cJSON_CreateTrue ??= + _dylib.lookupFunction<_c_cJSON_CreateTrue, _dart_cJSON_CreateTrue>( + 'cJSON_CreateTrue'); + return _cJSON_CreateTrue(); + } + + _dart_cJSON_CreateTrue _cJSON_CreateTrue; + + ffi.Pointer cJSON_CreateFalse() { + _cJSON_CreateFalse ??= + _dylib.lookupFunction<_c_cJSON_CreateFalse, _dart_cJSON_CreateFalse>( + 'cJSON_CreateFalse'); + return _cJSON_CreateFalse(); + } + + _dart_cJSON_CreateFalse _cJSON_CreateFalse; + + ffi.Pointer cJSON_CreateBool( + int boolean, + ) { + _cJSON_CreateBool ??= + _dylib.lookupFunction<_c_cJSON_CreateBool, _dart_cJSON_CreateBool>( + 'cJSON_CreateBool'); + return _cJSON_CreateBool( + boolean, + ); + } + + _dart_cJSON_CreateBool _cJSON_CreateBool; + + ffi.Pointer cJSON_CreateNumber( + double num, + ) { + _cJSON_CreateNumber ??= + _dylib.lookupFunction<_c_cJSON_CreateNumber, _dart_cJSON_CreateNumber>( + 'cJSON_CreateNumber'); + return _cJSON_CreateNumber( + num, + ); + } + + _dart_cJSON_CreateNumber _cJSON_CreateNumber; + + ffi.Pointer cJSON_CreateString( + ffi.Pointer string, + ) { + _cJSON_CreateString ??= + _dylib.lookupFunction<_c_cJSON_CreateString, _dart_cJSON_CreateString>( + 'cJSON_CreateString'); + return _cJSON_CreateString( + string, + ); + } + + _dart_cJSON_CreateString _cJSON_CreateString; + + ffi.Pointer cJSON_CreateRaw( + ffi.Pointer raw, + ) { + _cJSON_CreateRaw ??= + _dylib.lookupFunction<_c_cJSON_CreateRaw, _dart_cJSON_CreateRaw>( + 'cJSON_CreateRaw'); + return _cJSON_CreateRaw( + raw, + ); + } + + _dart_cJSON_CreateRaw _cJSON_CreateRaw; + + ffi.Pointer cJSON_CreateArray() { + _cJSON_CreateArray ??= + _dylib.lookupFunction<_c_cJSON_CreateArray, _dart_cJSON_CreateArray>( + 'cJSON_CreateArray'); + return _cJSON_CreateArray(); + } + + _dart_cJSON_CreateArray _cJSON_CreateArray; + + ffi.Pointer cJSON_CreateObject() { + _cJSON_CreateObject ??= + _dylib.lookupFunction<_c_cJSON_CreateObject, _dart_cJSON_CreateObject>( + 'cJSON_CreateObject'); + return _cJSON_CreateObject(); + } + + _dart_cJSON_CreateObject _cJSON_CreateObject; + + ffi.Pointer cJSON_CreateStringReference( + ffi.Pointer string, + ) { + _cJSON_CreateStringReference ??= _dylib.lookupFunction< + _c_cJSON_CreateStringReference, + _dart_cJSON_CreateStringReference>('cJSON_CreateStringReference'); + return _cJSON_CreateStringReference( + string, + ); + } + + _dart_cJSON_CreateStringReference _cJSON_CreateStringReference; + + ffi.Pointer cJSON_CreateObjectReference( + ffi.Pointer child, + ) { + _cJSON_CreateObjectReference ??= _dylib.lookupFunction< + _c_cJSON_CreateObjectReference, + _dart_cJSON_CreateObjectReference>('cJSON_CreateObjectReference'); + return _cJSON_CreateObjectReference( + child, + ); + } + + _dart_cJSON_CreateObjectReference _cJSON_CreateObjectReference; + + ffi.Pointer cJSON_CreateArrayReference( + ffi.Pointer child, + ) { + _cJSON_CreateArrayReference ??= _dylib.lookupFunction< + _c_cJSON_CreateArrayReference, + _dart_cJSON_CreateArrayReference>('cJSON_CreateArrayReference'); + return _cJSON_CreateArrayReference( + child, + ); + } + + _dart_cJSON_CreateArrayReference _cJSON_CreateArrayReference; + + ffi.Pointer cJSON_CreateIntArray( + ffi.Pointer numbers, + int count, + ) { + _cJSON_CreateIntArray ??= _dylib.lookupFunction<_c_cJSON_CreateIntArray, + _dart_cJSON_CreateIntArray>('cJSON_CreateIntArray'); + return _cJSON_CreateIntArray( + numbers, + count, + ); + } + + _dart_cJSON_CreateIntArray _cJSON_CreateIntArray; + + ffi.Pointer cJSON_CreateFloatArray( + ffi.Pointer numbers, + int count, + ) { + _cJSON_CreateFloatArray ??= _dylib.lookupFunction<_c_cJSON_CreateFloatArray, + _dart_cJSON_CreateFloatArray>('cJSON_CreateFloatArray'); + return _cJSON_CreateFloatArray( + numbers, + count, + ); + } + + _dart_cJSON_CreateFloatArray _cJSON_CreateFloatArray; + + ffi.Pointer cJSON_CreateDoubleArray( + ffi.Pointer numbers, + int count, + ) { + _cJSON_CreateDoubleArray ??= _dylib.lookupFunction< + _c_cJSON_CreateDoubleArray, + _dart_cJSON_CreateDoubleArray>('cJSON_CreateDoubleArray'); + return _cJSON_CreateDoubleArray( + numbers, + count, + ); + } + + _dart_cJSON_CreateDoubleArray _cJSON_CreateDoubleArray; + + ffi.Pointer cJSON_CreateStringArray( + ffi.Pointer> strings, + int count, + ) { + _cJSON_CreateStringArray ??= _dylib.lookupFunction< + _c_cJSON_CreateStringArray, + _dart_cJSON_CreateStringArray>('cJSON_CreateStringArray'); + return _cJSON_CreateStringArray( + strings, + count, + ); + } + + _dart_cJSON_CreateStringArray _cJSON_CreateStringArray; + + void cJSON_AddItemToArray( + ffi.Pointer array, + ffi.Pointer item, + ) { + _cJSON_AddItemToArray ??= _dylib.lookupFunction<_c_cJSON_AddItemToArray, + _dart_cJSON_AddItemToArray>('cJSON_AddItemToArray'); + return _cJSON_AddItemToArray( + array, + item, + ); + } + + _dart_cJSON_AddItemToArray _cJSON_AddItemToArray; + + void cJSON_AddItemToObject( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer item, + ) { + _cJSON_AddItemToObject ??= _dylib.lookupFunction<_c_cJSON_AddItemToObject, + _dart_cJSON_AddItemToObject>('cJSON_AddItemToObject'); + return _cJSON_AddItemToObject( + object, + string, + item, + ); + } + + _dart_cJSON_AddItemToObject _cJSON_AddItemToObject; + + void cJSON_AddItemToObjectCS( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer item, + ) { + _cJSON_AddItemToObjectCS ??= _dylib.lookupFunction< + _c_cJSON_AddItemToObjectCS, + _dart_cJSON_AddItemToObjectCS>('cJSON_AddItemToObjectCS'); + return _cJSON_AddItemToObjectCS( + object, + string, + item, + ); + } + + _dart_cJSON_AddItemToObjectCS _cJSON_AddItemToObjectCS; + + void cJSON_AddItemReferenceToArray( + ffi.Pointer array, + ffi.Pointer item, + ) { + _cJSON_AddItemReferenceToArray ??= _dylib.lookupFunction< + _c_cJSON_AddItemReferenceToArray, + _dart_cJSON_AddItemReferenceToArray>('cJSON_AddItemReferenceToArray'); + return _cJSON_AddItemReferenceToArray( + array, + item, + ); + } + + _dart_cJSON_AddItemReferenceToArray _cJSON_AddItemReferenceToArray; + + void cJSON_AddItemReferenceToObject( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer item, + ) { + _cJSON_AddItemReferenceToObject ??= _dylib.lookupFunction< + _c_cJSON_AddItemReferenceToObject, + _dart_cJSON_AddItemReferenceToObject>('cJSON_AddItemReferenceToObject'); + return _cJSON_AddItemReferenceToObject( + object, + string, + item, + ); + } + + _dart_cJSON_AddItemReferenceToObject _cJSON_AddItemReferenceToObject; + + ffi.Pointer cJSON_DetachItemViaPointer( + ffi.Pointer parent, + ffi.Pointer item, + ) { + _cJSON_DetachItemViaPointer ??= _dylib.lookupFunction< + _c_cJSON_DetachItemViaPointer, + _dart_cJSON_DetachItemViaPointer>('cJSON_DetachItemViaPointer'); + return _cJSON_DetachItemViaPointer( + parent, + item, + ); + } + + _dart_cJSON_DetachItemViaPointer _cJSON_DetachItemViaPointer; + + ffi.Pointer cJSON_DetachItemFromArray( + ffi.Pointer array, + int which, + ) { + _cJSON_DetachItemFromArray ??= _dylib.lookupFunction< + _c_cJSON_DetachItemFromArray, + _dart_cJSON_DetachItemFromArray>('cJSON_DetachItemFromArray'); + return _cJSON_DetachItemFromArray( + array, + which, + ); + } + + _dart_cJSON_DetachItemFromArray _cJSON_DetachItemFromArray; + + void cJSON_DeleteItemFromArray( + ffi.Pointer array, + int which, + ) { + _cJSON_DeleteItemFromArray ??= _dylib.lookupFunction< + _c_cJSON_DeleteItemFromArray, + _dart_cJSON_DeleteItemFromArray>('cJSON_DeleteItemFromArray'); + return _cJSON_DeleteItemFromArray( + array, + which, + ); + } + + _dart_cJSON_DeleteItemFromArray _cJSON_DeleteItemFromArray; + + ffi.Pointer cJSON_DetachItemFromObject( + ffi.Pointer object, + ffi.Pointer string, + ) { + _cJSON_DetachItemFromObject ??= _dylib.lookupFunction< + _c_cJSON_DetachItemFromObject, + _dart_cJSON_DetachItemFromObject>('cJSON_DetachItemFromObject'); + return _cJSON_DetachItemFromObject( + object, + string, + ); + } + + _dart_cJSON_DetachItemFromObject _cJSON_DetachItemFromObject; + + ffi.Pointer cJSON_DetachItemFromObjectCaseSensitive( + ffi.Pointer object, + ffi.Pointer string, + ) { + _cJSON_DetachItemFromObjectCaseSensitive ??= _dylib.lookupFunction< + _c_cJSON_DetachItemFromObjectCaseSensitive, + _dart_cJSON_DetachItemFromObjectCaseSensitive>( + 'cJSON_DetachItemFromObjectCaseSensitive'); + return _cJSON_DetachItemFromObjectCaseSensitive( + object, + string, + ); + } + + _dart_cJSON_DetachItemFromObjectCaseSensitive + _cJSON_DetachItemFromObjectCaseSensitive; + + void cJSON_DeleteItemFromObject( + ffi.Pointer object, + ffi.Pointer string, + ) { + _cJSON_DeleteItemFromObject ??= _dylib.lookupFunction< + _c_cJSON_DeleteItemFromObject, + _dart_cJSON_DeleteItemFromObject>('cJSON_DeleteItemFromObject'); + return _cJSON_DeleteItemFromObject( + object, + string, + ); + } + + _dart_cJSON_DeleteItemFromObject _cJSON_DeleteItemFromObject; + + void cJSON_DeleteItemFromObjectCaseSensitive( + ffi.Pointer object, + ffi.Pointer string, + ) { + _cJSON_DeleteItemFromObjectCaseSensitive ??= _dylib.lookupFunction< + _c_cJSON_DeleteItemFromObjectCaseSensitive, + _dart_cJSON_DeleteItemFromObjectCaseSensitive>( + 'cJSON_DeleteItemFromObjectCaseSensitive'); + return _cJSON_DeleteItemFromObjectCaseSensitive( + object, + string, + ); + } + + _dart_cJSON_DeleteItemFromObjectCaseSensitive + _cJSON_DeleteItemFromObjectCaseSensitive; + + void cJSON_InsertItemInArray( + ffi.Pointer array, + int which, + ffi.Pointer newitem, + ) { + _cJSON_InsertItemInArray ??= _dylib.lookupFunction< + _c_cJSON_InsertItemInArray, + _dart_cJSON_InsertItemInArray>('cJSON_InsertItemInArray'); + return _cJSON_InsertItemInArray( + array, + which, + newitem, + ); + } + + _dart_cJSON_InsertItemInArray _cJSON_InsertItemInArray; + + int cJSON_ReplaceItemViaPointer( + ffi.Pointer parent, + ffi.Pointer item, + ffi.Pointer replacement, + ) { + _cJSON_ReplaceItemViaPointer ??= _dylib.lookupFunction< + _c_cJSON_ReplaceItemViaPointer, + _dart_cJSON_ReplaceItemViaPointer>('cJSON_ReplaceItemViaPointer'); + return _cJSON_ReplaceItemViaPointer( + parent, + item, + replacement, + ); + } + + _dart_cJSON_ReplaceItemViaPointer _cJSON_ReplaceItemViaPointer; + + void cJSON_ReplaceItemInArray( + ffi.Pointer array, + int which, + ffi.Pointer newitem, + ) { + _cJSON_ReplaceItemInArray ??= _dylib.lookupFunction< + _c_cJSON_ReplaceItemInArray, + _dart_cJSON_ReplaceItemInArray>('cJSON_ReplaceItemInArray'); + return _cJSON_ReplaceItemInArray( + array, + which, + newitem, + ); + } + + _dart_cJSON_ReplaceItemInArray _cJSON_ReplaceItemInArray; + + void cJSON_ReplaceItemInObject( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer newitem, + ) { + _cJSON_ReplaceItemInObject ??= _dylib.lookupFunction< + _c_cJSON_ReplaceItemInObject, + _dart_cJSON_ReplaceItemInObject>('cJSON_ReplaceItemInObject'); + return _cJSON_ReplaceItemInObject( + object, + string, + newitem, + ); + } + + _dart_cJSON_ReplaceItemInObject _cJSON_ReplaceItemInObject; + + void cJSON_ReplaceItemInObjectCaseSensitive( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer newitem, + ) { + _cJSON_ReplaceItemInObjectCaseSensitive ??= _dylib.lookupFunction< + _c_cJSON_ReplaceItemInObjectCaseSensitive, + _dart_cJSON_ReplaceItemInObjectCaseSensitive>( + 'cJSON_ReplaceItemInObjectCaseSensitive'); + return _cJSON_ReplaceItemInObjectCaseSensitive( + object, + string, + newitem, + ); + } + + _dart_cJSON_ReplaceItemInObjectCaseSensitive + _cJSON_ReplaceItemInObjectCaseSensitive; + + ffi.Pointer cJSON_Duplicate( + ffi.Pointer item, + int recurse, + ) { + _cJSON_Duplicate ??= + _dylib.lookupFunction<_c_cJSON_Duplicate, _dart_cJSON_Duplicate>( + 'cJSON_Duplicate'); + return _cJSON_Duplicate( + item, + recurse, + ); + } + + _dart_cJSON_Duplicate _cJSON_Duplicate; + + int cJSON_Compare( + ffi.Pointer a, + ffi.Pointer b, + int case_sensitive, + ) { + _cJSON_Compare ??= _dylib + .lookupFunction<_c_cJSON_Compare, _dart_cJSON_Compare>('cJSON_Compare'); + return _cJSON_Compare( + a, + b, + case_sensitive, + ); + } + + _dart_cJSON_Compare _cJSON_Compare; + + void cJSON_Minify( + ffi.Pointer json, + ) { + _cJSON_Minify ??= _dylib + .lookupFunction<_c_cJSON_Minify, _dart_cJSON_Minify>('cJSON_Minify'); + return _cJSON_Minify( + json, + ); + } + + _dart_cJSON_Minify _cJSON_Minify; + + ffi.Pointer cJSON_AddNullToObject( + ffi.Pointer object, + ffi.Pointer name, + ) { + _cJSON_AddNullToObject ??= _dylib.lookupFunction<_c_cJSON_AddNullToObject, + _dart_cJSON_AddNullToObject>('cJSON_AddNullToObject'); + return _cJSON_AddNullToObject( + object, + name, + ); + } + + _dart_cJSON_AddNullToObject _cJSON_AddNullToObject; + + ffi.Pointer cJSON_AddTrueToObject( + ffi.Pointer object, + ffi.Pointer name, + ) { + _cJSON_AddTrueToObject ??= _dylib.lookupFunction<_c_cJSON_AddTrueToObject, + _dart_cJSON_AddTrueToObject>('cJSON_AddTrueToObject'); + return _cJSON_AddTrueToObject( + object, + name, + ); + } + + _dart_cJSON_AddTrueToObject _cJSON_AddTrueToObject; + + ffi.Pointer cJSON_AddFalseToObject( + ffi.Pointer object, + ffi.Pointer name, + ) { + _cJSON_AddFalseToObject ??= _dylib.lookupFunction<_c_cJSON_AddFalseToObject, + _dart_cJSON_AddFalseToObject>('cJSON_AddFalseToObject'); + return _cJSON_AddFalseToObject( + object, + name, + ); + } + + _dart_cJSON_AddFalseToObject _cJSON_AddFalseToObject; + + ffi.Pointer cJSON_AddBoolToObject( + ffi.Pointer object, + ffi.Pointer name, + int boolean, + ) { + _cJSON_AddBoolToObject ??= _dylib.lookupFunction<_c_cJSON_AddBoolToObject, + _dart_cJSON_AddBoolToObject>('cJSON_AddBoolToObject'); + return _cJSON_AddBoolToObject( + object, + name, + boolean, + ); + } + + _dart_cJSON_AddBoolToObject _cJSON_AddBoolToObject; + + ffi.Pointer cJSON_AddNumberToObject( + ffi.Pointer object, + ffi.Pointer name, + double number, + ) { + _cJSON_AddNumberToObject ??= _dylib.lookupFunction< + _c_cJSON_AddNumberToObject, + _dart_cJSON_AddNumberToObject>('cJSON_AddNumberToObject'); + return _cJSON_AddNumberToObject( + object, + name, + number, + ); + } + + _dart_cJSON_AddNumberToObject _cJSON_AddNumberToObject; + + ffi.Pointer cJSON_AddStringToObject( + ffi.Pointer object, + ffi.Pointer name, + ffi.Pointer string, + ) { + _cJSON_AddStringToObject ??= _dylib.lookupFunction< + _c_cJSON_AddStringToObject, + _dart_cJSON_AddStringToObject>('cJSON_AddStringToObject'); + return _cJSON_AddStringToObject( + object, + name, + string, + ); + } + + _dart_cJSON_AddStringToObject _cJSON_AddStringToObject; + + ffi.Pointer cJSON_AddRawToObject( + ffi.Pointer object, + ffi.Pointer name, + ffi.Pointer raw, + ) { + _cJSON_AddRawToObject ??= _dylib.lookupFunction<_c_cJSON_AddRawToObject, + _dart_cJSON_AddRawToObject>('cJSON_AddRawToObject'); + return _cJSON_AddRawToObject( + object, + name, + raw, + ); + } + + _dart_cJSON_AddRawToObject _cJSON_AddRawToObject; + + ffi.Pointer cJSON_AddObjectToObject( + ffi.Pointer object, + ffi.Pointer name, + ) { + _cJSON_AddObjectToObject ??= _dylib.lookupFunction< + _c_cJSON_AddObjectToObject, + _dart_cJSON_AddObjectToObject>('cJSON_AddObjectToObject'); + return _cJSON_AddObjectToObject( + object, + name, + ); + } + + _dart_cJSON_AddObjectToObject _cJSON_AddObjectToObject; + + ffi.Pointer cJSON_AddArrayToObject( + ffi.Pointer object, + ffi.Pointer name, + ) { + _cJSON_AddArrayToObject ??= _dylib.lookupFunction<_c_cJSON_AddArrayToObject, + _dart_cJSON_AddArrayToObject>('cJSON_AddArrayToObject'); + return _cJSON_AddArrayToObject( + object, + name, + ); + } + + _dart_cJSON_AddArrayToObject _cJSON_AddArrayToObject; + + double cJSON_SetNumberHelper( + ffi.Pointer object, + double number, + ) { + _cJSON_SetNumberHelper ??= _dylib.lookupFunction<_c_cJSON_SetNumberHelper, + _dart_cJSON_SetNumberHelper>('cJSON_SetNumberHelper'); + return _cJSON_SetNumberHelper( + object, + number, + ); + } + + _dart_cJSON_SetNumberHelper _cJSON_SetNumberHelper; + + ffi.Pointer cJSON_malloc( + int size, + ) { + _cJSON_malloc ??= _dylib + .lookupFunction<_c_cJSON_malloc, _dart_cJSON_malloc>('cJSON_malloc'); + return _cJSON_malloc( + size, + ); + } + + _dart_cJSON_malloc _cJSON_malloc; + + void cJSON_free( + ffi.Pointer object, + ) { + _cJSON_free ??= + _dylib.lookupFunction<_c_cJSON_free, _dart_cJSON_free>('cJSON_free'); + return _cJSON_free( + object, + ); + } + + _dart_cJSON_free _cJSON_free; +} + +class cJSON extends ffi.Struct { + ffi.Pointer next; + + ffi.Pointer prev; + + ffi.Pointer child; + + @ffi.Int32() + int type; + + ffi.Pointer valuestring; + + @ffi.Int32() + int valueint; + + @ffi.Double() + double valuedouble; + + ffi.Pointer string; +} + +class cJSON_Hooks extends ffi.Struct { + ffi.Pointer> malloc_fn; + + ffi.Pointer> free_fn; +} + +typedef _c_cJSON_Version = ffi.Pointer Function(); + +typedef _dart_cJSON_Version = ffi.Pointer Function(); + +typedef _c_cJSON_InitHooks = ffi.Void Function( + ffi.Pointer hooks, +); + +typedef _dart_cJSON_InitHooks = void Function( + ffi.Pointer hooks, +); + +typedef _c_cJSON_Parse = ffi.Pointer Function( + ffi.Pointer value, +); + +typedef _dart_cJSON_Parse = ffi.Pointer Function( + ffi.Pointer value, +); + +typedef _c_cJSON_ParseWithOpts = ffi.Pointer Function( + ffi.Pointer value, + ffi.Pointer> return_parse_end, + ffi.Int32 require_null_terminated, +); + +typedef _dart_cJSON_ParseWithOpts = ffi.Pointer Function( + ffi.Pointer value, + ffi.Pointer> return_parse_end, + int require_null_terminated, +); + +typedef _c_cJSON_Print = ffi.Pointer Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_Print = ffi.Pointer Function( + ffi.Pointer item, +); + +typedef _c_cJSON_PrintUnformatted = ffi.Pointer Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_PrintUnformatted = ffi.Pointer Function( + ffi.Pointer item, +); + +typedef _c_cJSON_PrintBuffered = ffi.Pointer Function( + ffi.Pointer item, + ffi.Int32 prebuffer, + ffi.Int32 fmt, +); + +typedef _dart_cJSON_PrintBuffered = ffi.Pointer Function( + ffi.Pointer item, + int prebuffer, + int fmt, +); + +typedef _c_cJSON_PrintPreallocated = ffi.Int32 Function( + ffi.Pointer item, + ffi.Pointer buffer, + ffi.Int32 length, + ffi.Int32 format, +); + +typedef _dart_cJSON_PrintPreallocated = int Function( + ffi.Pointer item, + ffi.Pointer buffer, + int length, + int format, +); + +typedef _c_cJSON_Delete = ffi.Void Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_Delete = void Function( + ffi.Pointer item, +); + +typedef _c_cJSON_GetArraySize = ffi.Int32 Function( + ffi.Pointer array, +); + +typedef _dart_cJSON_GetArraySize = int Function( + ffi.Pointer array, +); + +typedef _c_cJSON_GetArrayItem = ffi.Pointer Function( + ffi.Pointer array, + ffi.Int32 index, +); + +typedef _dart_cJSON_GetArrayItem = ffi.Pointer Function( + ffi.Pointer array, + int index, +); + +typedef _c_cJSON_GetObjectItem = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer string, +); + +typedef _dart_cJSON_GetObjectItem = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer string, +); + +typedef _c_cJSON_GetObjectItemCaseSensitive = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer string, +); + +typedef _dart_cJSON_GetObjectItemCaseSensitive = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer string, +); + +typedef _c_cJSON_HasObjectItem = ffi.Int32 Function( + ffi.Pointer object, + ffi.Pointer string, +); + +typedef _dart_cJSON_HasObjectItem = int Function( + ffi.Pointer object, + ffi.Pointer string, +); + +typedef _c_cJSON_GetErrorPtr = ffi.Pointer Function(); + +typedef _dart_cJSON_GetErrorPtr = ffi.Pointer Function(); + +typedef _c_cJSON_GetStringValue = ffi.Pointer Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_GetStringValue = ffi.Pointer Function( + ffi.Pointer item, +); + +typedef _c_cJSON_IsInvalid = ffi.Int32 Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_IsInvalid = int Function( + ffi.Pointer item, +); + +typedef _c_cJSON_IsFalse = ffi.Int32 Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_IsFalse = int Function( + ffi.Pointer item, +); + +typedef _c_cJSON_IsTrue = ffi.Int32 Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_IsTrue = int Function( + ffi.Pointer item, +); + +typedef _c_cJSON_IsBool = ffi.Int32 Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_IsBool = int Function( + ffi.Pointer item, +); + +typedef _c_cJSON_IsNull = ffi.Int32 Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_IsNull = int Function( + ffi.Pointer item, +); + +typedef _c_cJSON_IsNumber = ffi.Int32 Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_IsNumber = int Function( + ffi.Pointer item, +); + +typedef _c_cJSON_IsString = ffi.Int32 Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_IsString = int Function( + ffi.Pointer item, +); + +typedef _c_cJSON_IsArray = ffi.Int32 Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_IsArray = int Function( + ffi.Pointer item, +); + +typedef _c_cJSON_IsObject = ffi.Int32 Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_IsObject = int Function( + ffi.Pointer item, +); + +typedef _c_cJSON_IsRaw = ffi.Int32 Function( + ffi.Pointer item, +); + +typedef _dart_cJSON_IsRaw = int Function( + ffi.Pointer item, +); + +typedef _c_cJSON_CreateNull = ffi.Pointer Function(); + +typedef _dart_cJSON_CreateNull = ffi.Pointer Function(); + +typedef _c_cJSON_CreateTrue = ffi.Pointer Function(); + +typedef _dart_cJSON_CreateTrue = ffi.Pointer Function(); + +typedef _c_cJSON_CreateFalse = ffi.Pointer Function(); + +typedef _dart_cJSON_CreateFalse = ffi.Pointer Function(); + +typedef _c_cJSON_CreateBool = ffi.Pointer Function( + ffi.Int32 boolean, +); + +typedef _dart_cJSON_CreateBool = ffi.Pointer Function( + int boolean, +); + +typedef _c_cJSON_CreateNumber = ffi.Pointer Function( + ffi.Double num, +); + +typedef _dart_cJSON_CreateNumber = ffi.Pointer Function( + double num, +); + +typedef _c_cJSON_CreateString = ffi.Pointer Function( + ffi.Pointer string, +); + +typedef _dart_cJSON_CreateString = ffi.Pointer Function( + ffi.Pointer string, +); + +typedef _c_cJSON_CreateRaw = ffi.Pointer Function( + ffi.Pointer raw, +); + +typedef _dart_cJSON_CreateRaw = ffi.Pointer Function( + ffi.Pointer raw, +); + +typedef _c_cJSON_CreateArray = ffi.Pointer Function(); + +typedef _dart_cJSON_CreateArray = ffi.Pointer Function(); + +typedef _c_cJSON_CreateObject = ffi.Pointer Function(); + +typedef _dart_cJSON_CreateObject = ffi.Pointer Function(); + +typedef _c_cJSON_CreateStringReference = ffi.Pointer Function( + ffi.Pointer string, +); + +typedef _dart_cJSON_CreateStringReference = ffi.Pointer Function( + ffi.Pointer string, +); + +typedef _c_cJSON_CreateObjectReference = ffi.Pointer Function( + ffi.Pointer child, +); + +typedef _dart_cJSON_CreateObjectReference = ffi.Pointer Function( + ffi.Pointer child, +); + +typedef _c_cJSON_CreateArrayReference = ffi.Pointer Function( + ffi.Pointer child, +); + +typedef _dart_cJSON_CreateArrayReference = ffi.Pointer Function( + ffi.Pointer child, +); + +typedef _c_cJSON_CreateIntArray = ffi.Pointer Function( + ffi.Pointer numbers, + ffi.Int32 count, +); + +typedef _dart_cJSON_CreateIntArray = ffi.Pointer Function( + ffi.Pointer numbers, + int count, +); + +typedef _c_cJSON_CreateFloatArray = ffi.Pointer Function( + ffi.Pointer numbers, + ffi.Int32 count, +); + +typedef _dart_cJSON_CreateFloatArray = ffi.Pointer Function( + ffi.Pointer numbers, + int count, +); + +typedef _c_cJSON_CreateDoubleArray = ffi.Pointer Function( + ffi.Pointer numbers, + ffi.Int32 count, +); + +typedef _dart_cJSON_CreateDoubleArray = ffi.Pointer Function( + ffi.Pointer numbers, + int count, +); + +typedef _c_cJSON_CreateStringArray = ffi.Pointer Function( + ffi.Pointer> strings, + ffi.Int32 count, +); + +typedef _dart_cJSON_CreateStringArray = ffi.Pointer Function( + ffi.Pointer> strings, + int count, +); + +typedef _c_cJSON_AddItemToArray = ffi.Void Function( + ffi.Pointer array, + ffi.Pointer item, +); + +typedef _dart_cJSON_AddItemToArray = void Function( + ffi.Pointer array, + ffi.Pointer item, +); + +typedef _c_cJSON_AddItemToObject = ffi.Void Function( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer item, +); + +typedef _dart_cJSON_AddItemToObject = void Function( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer item, +); + +typedef _c_cJSON_AddItemToObjectCS = ffi.Void Function( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer item, +); + +typedef _dart_cJSON_AddItemToObjectCS = void Function( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer item, +); + +typedef _c_cJSON_AddItemReferenceToArray = ffi.Void Function( + ffi.Pointer array, + ffi.Pointer item, +); + +typedef _dart_cJSON_AddItemReferenceToArray = void Function( + ffi.Pointer array, + ffi.Pointer item, +); + +typedef _c_cJSON_AddItemReferenceToObject = ffi.Void Function( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer item, +); + +typedef _dart_cJSON_AddItemReferenceToObject = void Function( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer item, +); + +typedef _c_cJSON_DetachItemViaPointer = ffi.Pointer Function( + ffi.Pointer parent, + ffi.Pointer item, +); + +typedef _dart_cJSON_DetachItemViaPointer = ffi.Pointer Function( + ffi.Pointer parent, + ffi.Pointer item, +); + +typedef _c_cJSON_DetachItemFromArray = ffi.Pointer Function( + ffi.Pointer array, + ffi.Int32 which, +); + +typedef _dart_cJSON_DetachItemFromArray = ffi.Pointer Function( + ffi.Pointer array, + int which, +); + +typedef _c_cJSON_DeleteItemFromArray = ffi.Void Function( + ffi.Pointer array, + ffi.Int32 which, +); + +typedef _dart_cJSON_DeleteItemFromArray = void Function( + ffi.Pointer array, + int which, +); + +typedef _c_cJSON_DetachItemFromObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer string, +); + +typedef _dart_cJSON_DetachItemFromObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer string, +); + +typedef _c_cJSON_DetachItemFromObjectCaseSensitive = ffi.Pointer + Function( + ffi.Pointer object, + ffi.Pointer string, +); + +typedef _dart_cJSON_DetachItemFromObjectCaseSensitive = ffi.Pointer + Function( + ffi.Pointer object, + ffi.Pointer string, +); + +typedef _c_cJSON_DeleteItemFromObject = ffi.Void Function( + ffi.Pointer object, + ffi.Pointer string, +); + +typedef _dart_cJSON_DeleteItemFromObject = void Function( + ffi.Pointer object, + ffi.Pointer string, +); + +typedef _c_cJSON_DeleteItemFromObjectCaseSensitive = ffi.Void Function( + ffi.Pointer object, + ffi.Pointer string, +); + +typedef _dart_cJSON_DeleteItemFromObjectCaseSensitive = void Function( + ffi.Pointer object, + ffi.Pointer string, +); + +typedef _c_cJSON_InsertItemInArray = ffi.Void Function( + ffi.Pointer array, + ffi.Int32 which, + ffi.Pointer newitem, +); + +typedef _dart_cJSON_InsertItemInArray = void Function( + ffi.Pointer array, + int which, + ffi.Pointer newitem, +); + +typedef _c_cJSON_ReplaceItemViaPointer = ffi.Int32 Function( + ffi.Pointer parent, + ffi.Pointer item, + ffi.Pointer replacement, +); + +typedef _dart_cJSON_ReplaceItemViaPointer = int Function( + ffi.Pointer parent, + ffi.Pointer item, + ffi.Pointer replacement, +); + +typedef _c_cJSON_ReplaceItemInArray = ffi.Void Function( + ffi.Pointer array, + ffi.Int32 which, + ffi.Pointer newitem, +); + +typedef _dart_cJSON_ReplaceItemInArray = void Function( + ffi.Pointer array, + int which, + ffi.Pointer newitem, +); + +typedef _c_cJSON_ReplaceItemInObject = ffi.Void Function( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer newitem, +); + +typedef _dart_cJSON_ReplaceItemInObject = void Function( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer newitem, +); + +typedef _c_cJSON_ReplaceItemInObjectCaseSensitive = ffi.Void Function( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer newitem, +); + +typedef _dart_cJSON_ReplaceItemInObjectCaseSensitive = void Function( + ffi.Pointer object, + ffi.Pointer string, + ffi.Pointer newitem, +); + +typedef _c_cJSON_Duplicate = ffi.Pointer Function( + ffi.Pointer item, + ffi.Int32 recurse, +); + +typedef _dart_cJSON_Duplicate = ffi.Pointer Function( + ffi.Pointer item, + int recurse, +); + +typedef _c_cJSON_Compare = ffi.Int32 Function( + ffi.Pointer a, + ffi.Pointer b, + ffi.Int32 case_sensitive, +); + +typedef _dart_cJSON_Compare = int Function( + ffi.Pointer a, + ffi.Pointer b, + int case_sensitive, +); + +typedef _c_cJSON_Minify = ffi.Void Function( + ffi.Pointer json, +); + +typedef _dart_cJSON_Minify = void Function( + ffi.Pointer json, +); + +typedef _c_cJSON_AddNullToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, +); + +typedef _dart_cJSON_AddNullToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, +); + +typedef _c_cJSON_AddTrueToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, +); + +typedef _dart_cJSON_AddTrueToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, +); + +typedef _c_cJSON_AddFalseToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, +); + +typedef _dart_cJSON_AddFalseToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, +); + +typedef _c_cJSON_AddBoolToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, + ffi.Int32 boolean, +); + +typedef _dart_cJSON_AddBoolToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, + int boolean, +); + +typedef _c_cJSON_AddNumberToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, + ffi.Double number, +); + +typedef _dart_cJSON_AddNumberToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, + double number, +); + +typedef _c_cJSON_AddStringToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, + ffi.Pointer string, +); + +typedef _dart_cJSON_AddStringToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, + ffi.Pointer string, +); + +typedef _c_cJSON_AddRawToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, + ffi.Pointer raw, +); + +typedef _dart_cJSON_AddRawToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, + ffi.Pointer raw, +); + +typedef _c_cJSON_AddObjectToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, +); + +typedef _dart_cJSON_AddObjectToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, +); + +typedef _c_cJSON_AddArrayToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, +); + +typedef _dart_cJSON_AddArrayToObject = ffi.Pointer Function( + ffi.Pointer object, + ffi.Pointer name, +); + +typedef _c_cJSON_SetNumberHelper = ffi.Double Function( + ffi.Pointer object, + ffi.Double number, +); + +typedef _dart_cJSON_SetNumberHelper = double Function( + ffi.Pointer object, + double number, +); + +typedef _c_cJSON_malloc = ffi.Pointer Function( + ffi.Uint64 size, +); + +typedef _dart_cJSON_malloc = ffi.Pointer Function( + int size, +); + +typedef _c_cJSON_free = ffi.Void Function( + ffi.Pointer object, +); + +typedef _dart_cJSON_free = void Function( + ffi.Pointer object, +); + +typedef _typedefC_11 = ffi.Pointer Function( + ffi.Uint64, +); + +typedef _typedefC_12 = ffi.Void Function( + ffi.Pointer, +); diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart new file mode 100644 index 0000000000..1aa4cb5af9 --- /dev/null +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -0,0 +1,5765 @@ +/// AUTO GENERATED FILE, DO NOT EDIT. +/// +/// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Bindings to LibClang. +class LibClang { + /// Holds the Dynamic library. + final ffi.DynamicLibrary _dylib; + + /// The symbols are looked up in [dynamicLibrary]. + LibClang(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + + /// Free the given string set. + void clang_disposeStringSet( + ffi.Pointer set, + ) { + _clang_disposeStringSet ??= _dylib.lookupFunction<_c_clang_disposeStringSet, + _dart_clang_disposeStringSet>('clang_disposeStringSet'); + return _clang_disposeStringSet( + set, + ); + } + + _dart_clang_disposeStringSet _clang_disposeStringSet; + + /// Return the timestamp for use with Clang's -fbuild-session-timestamp= + /// option. + int clang_getBuildSessionTimestamp() { + _clang_getBuildSessionTimestamp ??= _dylib.lookupFunction< + _c_clang_getBuildSessionTimestamp, + _dart_clang_getBuildSessionTimestamp>('clang_getBuildSessionTimestamp'); + return _clang_getBuildSessionTimestamp(); + } + + _dart_clang_getBuildSessionTimestamp _clang_getBuildSessionTimestamp; + + /// Create a CXVirtualFileOverlay object. Must be disposed with + /// clang_VirtualFileOverlay_dispose(). + ffi.Pointer clang_VirtualFileOverlay_create( + int options, + ) { + _clang_VirtualFileOverlay_create ??= _dylib.lookupFunction< + _c_clang_VirtualFileOverlay_create, + _dart_clang_VirtualFileOverlay_create>( + 'clang_VirtualFileOverlay_create'); + return _clang_VirtualFileOverlay_create( + options, + ); + } + + _dart_clang_VirtualFileOverlay_create _clang_VirtualFileOverlay_create; + + /// Map an absolute virtual file path to an absolute real one. The virtual + /// path must be canonicalized (not contain "."/".."). + int clang_VirtualFileOverlay_addFileMapping( + ffi.Pointer arg0, + ffi.Pointer virtualPath, + ffi.Pointer realPath, + ) { + _clang_VirtualFileOverlay_addFileMapping ??= _dylib.lookupFunction< + _c_clang_VirtualFileOverlay_addFileMapping, + _dart_clang_VirtualFileOverlay_addFileMapping>( + 'clang_VirtualFileOverlay_addFileMapping'); + return _clang_VirtualFileOverlay_addFileMapping( + arg0, + virtualPath, + realPath, + ); + } + + _dart_clang_VirtualFileOverlay_addFileMapping + _clang_VirtualFileOverlay_addFileMapping; + + /// Set the case sensitivity for the CXVirtualFileOverlay object. The + /// CXVirtualFileOverlay object is case-sensitive by default, this option can + /// be used to override the default. + int clang_VirtualFileOverlay_setCaseSensitivity( + ffi.Pointer arg0, + int caseSensitive, + ) { + _clang_VirtualFileOverlay_setCaseSensitivity ??= _dylib.lookupFunction< + _c_clang_VirtualFileOverlay_setCaseSensitivity, + _dart_clang_VirtualFileOverlay_setCaseSensitivity>( + 'clang_VirtualFileOverlay_setCaseSensitivity'); + return _clang_VirtualFileOverlay_setCaseSensitivity( + arg0, + caseSensitive, + ); + } + + _dart_clang_VirtualFileOverlay_setCaseSensitivity + _clang_VirtualFileOverlay_setCaseSensitivity; + + /// Write out the CXVirtualFileOverlay object to a char buffer. + int clang_VirtualFileOverlay_writeToBuffer( + ffi.Pointer arg0, + int options, + ffi.Pointer> out_buffer_ptr, + ffi.Pointer out_buffer_size, + ) { + _clang_VirtualFileOverlay_writeToBuffer ??= _dylib.lookupFunction< + _c_clang_VirtualFileOverlay_writeToBuffer, + _dart_clang_VirtualFileOverlay_writeToBuffer>( + 'clang_VirtualFileOverlay_writeToBuffer'); + return _clang_VirtualFileOverlay_writeToBuffer( + arg0, + options, + out_buffer_ptr, + out_buffer_size, + ); + } + + _dart_clang_VirtualFileOverlay_writeToBuffer + _clang_VirtualFileOverlay_writeToBuffer; + + /// free memory allocated by libclang, such as the buffer returned by + /// CXVirtualFileOverlay() or clang_ModuleMapDescriptor_writeToBuffer(). + void clang_free( + ffi.Pointer buffer, + ) { + _clang_free ??= + _dylib.lookupFunction<_c_clang_free, _dart_clang_free>('clang_free'); + return _clang_free( + buffer, + ); + } + + _dart_clang_free _clang_free; + + /// Dispose a CXVirtualFileOverlay object. + void clang_VirtualFileOverlay_dispose( + ffi.Pointer arg0, + ) { + _clang_VirtualFileOverlay_dispose ??= _dylib.lookupFunction< + _c_clang_VirtualFileOverlay_dispose, + _dart_clang_VirtualFileOverlay_dispose>( + 'clang_VirtualFileOverlay_dispose'); + return _clang_VirtualFileOverlay_dispose( + arg0, + ); + } + + _dart_clang_VirtualFileOverlay_dispose _clang_VirtualFileOverlay_dispose; + + /// Create a CXModuleMapDescriptor object. Must be disposed with + /// clang_ModuleMapDescriptor_dispose(). + ffi.Pointer clang_ModuleMapDescriptor_create( + int options, + ) { + _clang_ModuleMapDescriptor_create ??= _dylib.lookupFunction< + _c_clang_ModuleMapDescriptor_create, + _dart_clang_ModuleMapDescriptor_create>( + 'clang_ModuleMapDescriptor_create'); + return _clang_ModuleMapDescriptor_create( + options, + ); + } + + _dart_clang_ModuleMapDescriptor_create _clang_ModuleMapDescriptor_create; + + /// Sets the framework module name that the module.map describes. + int clang_ModuleMapDescriptor_setFrameworkModuleName( + ffi.Pointer arg0, + ffi.Pointer name, + ) { + _clang_ModuleMapDescriptor_setFrameworkModuleName ??= _dylib.lookupFunction< + _c_clang_ModuleMapDescriptor_setFrameworkModuleName, + _dart_clang_ModuleMapDescriptor_setFrameworkModuleName>( + 'clang_ModuleMapDescriptor_setFrameworkModuleName'); + return _clang_ModuleMapDescriptor_setFrameworkModuleName( + arg0, + name, + ); + } + + _dart_clang_ModuleMapDescriptor_setFrameworkModuleName + _clang_ModuleMapDescriptor_setFrameworkModuleName; + + /// Sets the umbrealla header name that the module.map describes. + int clang_ModuleMapDescriptor_setUmbrellaHeader( + ffi.Pointer arg0, + ffi.Pointer name, + ) { + _clang_ModuleMapDescriptor_setUmbrellaHeader ??= _dylib.lookupFunction< + _c_clang_ModuleMapDescriptor_setUmbrellaHeader, + _dart_clang_ModuleMapDescriptor_setUmbrellaHeader>( + 'clang_ModuleMapDescriptor_setUmbrellaHeader'); + return _clang_ModuleMapDescriptor_setUmbrellaHeader( + arg0, + name, + ); + } + + _dart_clang_ModuleMapDescriptor_setUmbrellaHeader + _clang_ModuleMapDescriptor_setUmbrellaHeader; + + /// Write out the CXModuleMapDescriptor object to a char buffer. + int clang_ModuleMapDescriptor_writeToBuffer( + ffi.Pointer arg0, + int options, + ffi.Pointer> out_buffer_ptr, + ffi.Pointer out_buffer_size, + ) { + _clang_ModuleMapDescriptor_writeToBuffer ??= _dylib.lookupFunction< + _c_clang_ModuleMapDescriptor_writeToBuffer, + _dart_clang_ModuleMapDescriptor_writeToBuffer>( + 'clang_ModuleMapDescriptor_writeToBuffer'); + return _clang_ModuleMapDescriptor_writeToBuffer( + arg0, + options, + out_buffer_ptr, + out_buffer_size, + ); + } + + _dart_clang_ModuleMapDescriptor_writeToBuffer + _clang_ModuleMapDescriptor_writeToBuffer; + + /// Dispose a CXModuleMapDescriptor object. + void clang_ModuleMapDescriptor_dispose( + ffi.Pointer arg0, + ) { + _clang_ModuleMapDescriptor_dispose ??= _dylib.lookupFunction< + _c_clang_ModuleMapDescriptor_dispose, + _dart_clang_ModuleMapDescriptor_dispose>( + 'clang_ModuleMapDescriptor_dispose'); + return _clang_ModuleMapDescriptor_dispose( + arg0, + ); + } + + _dart_clang_ModuleMapDescriptor_dispose _clang_ModuleMapDescriptor_dispose; + + /// Provides a shared context for creating translation units. + ffi.Pointer clang_createIndex( + int excludeDeclarationsFromPCH, + int displayDiagnostics, + ) { + _clang_createIndex ??= + _dylib.lookupFunction<_c_clang_createIndex, _dart_clang_createIndex>( + 'clang_createIndex'); + return _clang_createIndex( + excludeDeclarationsFromPCH, + displayDiagnostics, + ); + } + + _dart_clang_createIndex _clang_createIndex; + + /// Destroy the given index. + void clang_disposeIndex( + ffi.Pointer index, + ) { + _clang_disposeIndex ??= + _dylib.lookupFunction<_c_clang_disposeIndex, _dart_clang_disposeIndex>( + 'clang_disposeIndex'); + return _clang_disposeIndex( + index, + ); + } + + _dart_clang_disposeIndex _clang_disposeIndex; + + /// Sets general options associated with a CXIndex. + void clang_CXIndex_setGlobalOptions( + ffi.Pointer arg0, + int options, + ) { + _clang_CXIndex_setGlobalOptions ??= _dylib.lookupFunction< + _c_clang_CXIndex_setGlobalOptions, + _dart_clang_CXIndex_setGlobalOptions>('clang_CXIndex_setGlobalOptions'); + return _clang_CXIndex_setGlobalOptions( + arg0, + options, + ); + } + + _dart_clang_CXIndex_setGlobalOptions _clang_CXIndex_setGlobalOptions; + + /// Gets the general options associated with a CXIndex. + int clang_CXIndex_getGlobalOptions( + ffi.Pointer arg0, + ) { + _clang_CXIndex_getGlobalOptions ??= _dylib.lookupFunction< + _c_clang_CXIndex_getGlobalOptions, + _dart_clang_CXIndex_getGlobalOptions>('clang_CXIndex_getGlobalOptions'); + return _clang_CXIndex_getGlobalOptions( + arg0, + ); + } + + _dart_clang_CXIndex_getGlobalOptions _clang_CXIndex_getGlobalOptions; + + /// Sets the invocation emission path option in a CXIndex. + void clang_CXIndex_setInvocationEmissionPathOption( + ffi.Pointer arg0, + ffi.Pointer Path, + ) { + _clang_CXIndex_setInvocationEmissionPathOption ??= _dylib.lookupFunction< + _c_clang_CXIndex_setInvocationEmissionPathOption, + _dart_clang_CXIndex_setInvocationEmissionPathOption>( + 'clang_CXIndex_setInvocationEmissionPathOption'); + return _clang_CXIndex_setInvocationEmissionPathOption( + arg0, + Path, + ); + } + + _dart_clang_CXIndex_setInvocationEmissionPathOption + _clang_CXIndex_setInvocationEmissionPathOption; + + /// Retrieve the last modification time of the given file. + int clang_getFileTime( + ffi.Pointer SFile, + ) { + _clang_getFileTime ??= + _dylib.lookupFunction<_c_clang_getFileTime, _dart_clang_getFileTime>( + 'clang_getFileTime'); + return _clang_getFileTime( + SFile, + ); + } + + _dart_clang_getFileTime _clang_getFileTime; + + /// Retrieve the unique ID for the given file. + int clang_getFileUniqueID( + ffi.Pointer file, + ffi.Pointer outID, + ) { + _clang_getFileUniqueID ??= _dylib.lookupFunction<_c_clang_getFileUniqueID, + _dart_clang_getFileUniqueID>('clang_getFileUniqueID'); + return _clang_getFileUniqueID( + file, + outID, + ); + } + + _dart_clang_getFileUniqueID _clang_getFileUniqueID; + + /// Determine whether the given header is guarded against multiple inclusions, + /// either with the conventional #ifndef/#define/#endif macro guards or with + /// #pragma once. + int clang_isFileMultipleIncludeGuarded( + ffi.Pointer tu, + ffi.Pointer file, + ) { + _clang_isFileMultipleIncludeGuarded ??= _dylib.lookupFunction< + _c_clang_isFileMultipleIncludeGuarded, + _dart_clang_isFileMultipleIncludeGuarded>( + 'clang_isFileMultipleIncludeGuarded'); + return _clang_isFileMultipleIncludeGuarded( + tu, + file, + ); + } + + _dart_clang_isFileMultipleIncludeGuarded _clang_isFileMultipleIncludeGuarded; + + /// Retrieve a file handle within the given translation unit. + ffi.Pointer clang_getFile( + ffi.Pointer tu, + ffi.Pointer file_name, + ) { + _clang_getFile ??= _dylib + .lookupFunction<_c_clang_getFile, _dart_clang_getFile>('clang_getFile'); + return _clang_getFile( + tu, + file_name, + ); + } + + _dart_clang_getFile _clang_getFile; + + /// Retrieve the buffer associated with the given file. + ffi.Pointer clang_getFileContents( + ffi.Pointer tu, + ffi.Pointer file, + ffi.Pointer size, + ) { + _clang_getFileContents ??= _dylib.lookupFunction<_c_clang_getFileContents, + _dart_clang_getFileContents>('clang_getFileContents'); + return _clang_getFileContents( + tu, + file, + size, + ); + } + + _dart_clang_getFileContents _clang_getFileContents; + + /// Returns non-zero if the file1 and file2 point to the same file, or they + /// are both NULL. + int clang_File_isEqual( + ffi.Pointer file1, + ffi.Pointer file2, + ) { + _clang_File_isEqual ??= + _dylib.lookupFunction<_c_clang_File_isEqual, _dart_clang_File_isEqual>( + 'clang_File_isEqual'); + return _clang_File_isEqual( + file1, + file2, + ); + } + + _dart_clang_File_isEqual _clang_File_isEqual; + + /// Retrieve all ranges that were skipped by the preprocessor. + ffi.Pointer clang_getSkippedRanges( + ffi.Pointer tu, + ffi.Pointer file, + ) { + _clang_getSkippedRanges ??= _dylib.lookupFunction<_c_clang_getSkippedRanges, + _dart_clang_getSkippedRanges>('clang_getSkippedRanges'); + return _clang_getSkippedRanges( + tu, + file, + ); + } + + _dart_clang_getSkippedRanges _clang_getSkippedRanges; + + /// Retrieve all ranges from all files that were skipped by the preprocessor. + ffi.Pointer clang_getAllSkippedRanges( + ffi.Pointer tu, + ) { + _clang_getAllSkippedRanges ??= _dylib.lookupFunction< + _c_clang_getAllSkippedRanges, + _dart_clang_getAllSkippedRanges>('clang_getAllSkippedRanges'); + return _clang_getAllSkippedRanges( + tu, + ); + } + + _dart_clang_getAllSkippedRanges _clang_getAllSkippedRanges; + + /// Destroy the given CXSourceRangeList. + void clang_disposeSourceRangeList( + ffi.Pointer ranges, + ) { + _clang_disposeSourceRangeList ??= _dylib.lookupFunction< + _c_clang_disposeSourceRangeList, + _dart_clang_disposeSourceRangeList>('clang_disposeSourceRangeList'); + return _clang_disposeSourceRangeList( + ranges, + ); + } + + _dart_clang_disposeSourceRangeList _clang_disposeSourceRangeList; + + /// Determine the number of diagnostics in a CXDiagnosticSet. + int clang_getNumDiagnosticsInSet( + ffi.Pointer Diags, + ) { + _clang_getNumDiagnosticsInSet ??= _dylib.lookupFunction< + _c_clang_getNumDiagnosticsInSet, + _dart_clang_getNumDiagnosticsInSet>('clang_getNumDiagnosticsInSet'); + return _clang_getNumDiagnosticsInSet( + Diags, + ); + } + + _dart_clang_getNumDiagnosticsInSet _clang_getNumDiagnosticsInSet; + + /// Retrieve a diagnostic associated with the given CXDiagnosticSet. + ffi.Pointer clang_getDiagnosticInSet( + ffi.Pointer Diags, + int Index, + ) { + _clang_getDiagnosticInSet ??= _dylib.lookupFunction< + _c_clang_getDiagnosticInSet, + _dart_clang_getDiagnosticInSet>('clang_getDiagnosticInSet'); + return _clang_getDiagnosticInSet( + Diags, + Index, + ); + } + + _dart_clang_getDiagnosticInSet _clang_getDiagnosticInSet; + + /// Deserialize a set of diagnostics from a Clang diagnostics bitcode file. + ffi.Pointer clang_loadDiagnostics( + ffi.Pointer file, + ffi.Pointer error, + ffi.Pointer errorString, + ) { + _clang_loadDiagnostics ??= _dylib.lookupFunction<_c_clang_loadDiagnostics, + _dart_clang_loadDiagnostics>('clang_loadDiagnostics'); + return _clang_loadDiagnostics( + file, + error, + errorString, + ); + } + + _dart_clang_loadDiagnostics _clang_loadDiagnostics; + + /// Release a CXDiagnosticSet and all of its contained diagnostics. + void clang_disposeDiagnosticSet( + ffi.Pointer Diags, + ) { + _clang_disposeDiagnosticSet ??= _dylib.lookupFunction< + _c_clang_disposeDiagnosticSet, + _dart_clang_disposeDiagnosticSet>('clang_disposeDiagnosticSet'); + return _clang_disposeDiagnosticSet( + Diags, + ); + } + + _dart_clang_disposeDiagnosticSet _clang_disposeDiagnosticSet; + + /// Retrieve the child diagnostics of a CXDiagnostic. + ffi.Pointer clang_getChildDiagnostics( + ffi.Pointer D, + ) { + _clang_getChildDiagnostics ??= _dylib.lookupFunction< + _c_clang_getChildDiagnostics, + _dart_clang_getChildDiagnostics>('clang_getChildDiagnostics'); + return _clang_getChildDiagnostics( + D, + ); + } + + _dart_clang_getChildDiagnostics _clang_getChildDiagnostics; + + /// Determine the number of diagnostics produced for the given translation + /// unit. + int clang_getNumDiagnostics( + ffi.Pointer Unit, + ) { + _clang_getNumDiagnostics ??= _dylib.lookupFunction< + _c_clang_getNumDiagnostics, + _dart_clang_getNumDiagnostics>('clang_getNumDiagnostics'); + return _clang_getNumDiagnostics( + Unit, + ); + } + + _dart_clang_getNumDiagnostics _clang_getNumDiagnostics; + + /// Retrieve a diagnostic associated with the given translation unit. + ffi.Pointer clang_getDiagnostic( + ffi.Pointer Unit, + int Index, + ) { + _clang_getDiagnostic ??= _dylib.lookupFunction<_c_clang_getDiagnostic, + _dart_clang_getDiagnostic>('clang_getDiagnostic'); + return _clang_getDiagnostic( + Unit, + Index, + ); + } + + _dart_clang_getDiagnostic _clang_getDiagnostic; + + /// Retrieve the complete set of diagnostics associated with a translation + /// unit. + ffi.Pointer clang_getDiagnosticSetFromTU( + ffi.Pointer Unit, + ) { + _clang_getDiagnosticSetFromTU ??= _dylib.lookupFunction< + _c_clang_getDiagnosticSetFromTU, + _dart_clang_getDiagnosticSetFromTU>('clang_getDiagnosticSetFromTU'); + return _clang_getDiagnosticSetFromTU( + Unit, + ); + } + + _dart_clang_getDiagnosticSetFromTU _clang_getDiagnosticSetFromTU; + + /// Destroy a diagnostic. + void clang_disposeDiagnostic( + ffi.Pointer Diagnostic, + ) { + _clang_disposeDiagnostic ??= _dylib.lookupFunction< + _c_clang_disposeDiagnostic, + _dart_clang_disposeDiagnostic>('clang_disposeDiagnostic'); + return _clang_disposeDiagnostic( + Diagnostic, + ); + } + + _dart_clang_disposeDiagnostic _clang_disposeDiagnostic; + + /// Retrieve the set of display options most similar to the default behavior + /// of the clang compiler. + int clang_defaultDiagnosticDisplayOptions() { + _clang_defaultDiagnosticDisplayOptions ??= _dylib.lookupFunction< + _c_clang_defaultDiagnosticDisplayOptions, + _dart_clang_defaultDiagnosticDisplayOptions>( + 'clang_defaultDiagnosticDisplayOptions'); + return _clang_defaultDiagnosticDisplayOptions(); + } + + _dart_clang_defaultDiagnosticDisplayOptions + _clang_defaultDiagnosticDisplayOptions; + + /// Determine the severity of the given diagnostic. + int clang_getDiagnosticSeverity( + ffi.Pointer arg0, + ) { + _clang_getDiagnosticSeverity ??= _dylib.lookupFunction< + _c_clang_getDiagnosticSeverity, + _dart_clang_getDiagnosticSeverity>('clang_getDiagnosticSeverity'); + return _clang_getDiagnosticSeverity( + arg0, + ); + } + + _dart_clang_getDiagnosticSeverity _clang_getDiagnosticSeverity; + + /// Retrieve the category number for this diagnostic. + int clang_getDiagnosticCategory( + ffi.Pointer arg0, + ) { + _clang_getDiagnosticCategory ??= _dylib.lookupFunction< + _c_clang_getDiagnosticCategory, + _dart_clang_getDiagnosticCategory>('clang_getDiagnosticCategory'); + return _clang_getDiagnosticCategory( + arg0, + ); + } + + _dart_clang_getDiagnosticCategory _clang_getDiagnosticCategory; + + /// Determine the number of source ranges associated with the given + /// diagnostic. + int clang_getDiagnosticNumRanges( + ffi.Pointer arg0, + ) { + _clang_getDiagnosticNumRanges ??= _dylib.lookupFunction< + _c_clang_getDiagnosticNumRanges, + _dart_clang_getDiagnosticNumRanges>('clang_getDiagnosticNumRanges'); + return _clang_getDiagnosticNumRanges( + arg0, + ); + } + + _dart_clang_getDiagnosticNumRanges _clang_getDiagnosticNumRanges; + + /// Determine the number of fix-it hints associated with the given diagnostic. + int clang_getDiagnosticNumFixIts( + ffi.Pointer Diagnostic, + ) { + _clang_getDiagnosticNumFixIts ??= _dylib.lookupFunction< + _c_clang_getDiagnosticNumFixIts, + _dart_clang_getDiagnosticNumFixIts>('clang_getDiagnosticNumFixIts'); + return _clang_getDiagnosticNumFixIts( + Diagnostic, + ); + } + + _dart_clang_getDiagnosticNumFixIts _clang_getDiagnosticNumFixIts; + + /// Return the CXTranslationUnit for a given source file and the provided + /// command line arguments one would pass to the compiler. + ffi.Pointer clang_createTranslationUnitFromSourceFile( + 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, + ) { + _clang_createTranslationUnitFromSourceFile ??= _dylib.lookupFunction< + _c_clang_createTranslationUnitFromSourceFile, + _dart_clang_createTranslationUnitFromSourceFile>( + 'clang_createTranslationUnitFromSourceFile'); + return _clang_createTranslationUnitFromSourceFile( + CIdx, + source_filename, + num_clang_command_line_args, + clang_command_line_args, + num_unsaved_files, + unsaved_files, + ); + } + + _dart_clang_createTranslationUnitFromSourceFile + _clang_createTranslationUnitFromSourceFile; + + /// Same as clang_createTranslationUnit2, but returns the CXTranslationUnit + /// instead of an error code. In case of an error this routine returns a NULL + /// CXTranslationUnit, without further detailed error codes. + ffi.Pointer clang_createTranslationUnit( + ffi.Pointer CIdx, + ffi.Pointer ast_filename, + ) { + _clang_createTranslationUnit ??= _dylib.lookupFunction< + _c_clang_createTranslationUnit, + _dart_clang_createTranslationUnit>('clang_createTranslationUnit'); + return _clang_createTranslationUnit( + CIdx, + ast_filename, + ); + } + + _dart_clang_createTranslationUnit _clang_createTranslationUnit; + + /// Create a translation unit from an AST file ( -emit-ast). + int clang_createTranslationUnit2( + ffi.Pointer CIdx, + ffi.Pointer ast_filename, + ffi.Pointer> out_TU, + ) { + _clang_createTranslationUnit2 ??= _dylib.lookupFunction< + _c_clang_createTranslationUnit2, + _dart_clang_createTranslationUnit2>('clang_createTranslationUnit2'); + return _clang_createTranslationUnit2( + CIdx, + ast_filename, + out_TU, + ); + } + + _dart_clang_createTranslationUnit2 _clang_createTranslationUnit2; + + /// Returns the set of flags that is suitable for parsing a translation unit + /// that is being edited. + int clang_defaultEditingTranslationUnitOptions() { + _clang_defaultEditingTranslationUnitOptions ??= _dylib.lookupFunction< + _c_clang_defaultEditingTranslationUnitOptions, + _dart_clang_defaultEditingTranslationUnitOptions>( + 'clang_defaultEditingTranslationUnitOptions'); + return _clang_defaultEditingTranslationUnitOptions(); + } + + _dart_clang_defaultEditingTranslationUnitOptions + _clang_defaultEditingTranslationUnitOptions; + + /// Same as clang_parseTranslationUnit2, but returns the CXTranslationUnit + /// instead of an error code. In case of an error this routine returns a NULL + /// CXTranslationUnit, without further detailed error codes. + ffi.Pointer clang_parseTranslationUnit( + 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, + ) { + _clang_parseTranslationUnit ??= _dylib.lookupFunction< + _c_clang_parseTranslationUnit, + _dart_clang_parseTranslationUnit>('clang_parseTranslationUnit'); + return _clang_parseTranslationUnit( + CIdx, + source_filename, + command_line_args, + num_command_line_args, + unsaved_files, + num_unsaved_files, + options, + ); + } + + _dart_clang_parseTranslationUnit _clang_parseTranslationUnit; + + /// Parse the given source file and the translation unit corresponding to that + /// file. + int clang_parseTranslationUnit2( + 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, + ) { + _clang_parseTranslationUnit2 ??= _dylib.lookupFunction< + _c_clang_parseTranslationUnit2, + _dart_clang_parseTranslationUnit2>('clang_parseTranslationUnit2'); + return _clang_parseTranslationUnit2( + CIdx, + source_filename, + command_line_args, + num_command_line_args, + unsaved_files, + num_unsaved_files, + options, + out_TU, + ); + } + + _dart_clang_parseTranslationUnit2 _clang_parseTranslationUnit2; + + /// Same as clang_parseTranslationUnit2 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_parseTranslationUnit2FullArgv( + 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, + ) { + _clang_parseTranslationUnit2FullArgv ??= _dylib.lookupFunction< + _c_clang_parseTranslationUnit2FullArgv, + _dart_clang_parseTranslationUnit2FullArgv>( + 'clang_parseTranslationUnit2FullArgv'); + return _clang_parseTranslationUnit2FullArgv( + CIdx, + source_filename, + command_line_args, + num_command_line_args, + unsaved_files, + num_unsaved_files, + options, + out_TU, + ); + } + + _dart_clang_parseTranslationUnit2FullArgv + _clang_parseTranslationUnit2FullArgv; + + /// Returns the set of flags that is suitable for saving a translation unit. + int clang_defaultSaveOptions( + ffi.Pointer TU, + ) { + _clang_defaultSaveOptions ??= _dylib.lookupFunction< + _c_clang_defaultSaveOptions, + _dart_clang_defaultSaveOptions>('clang_defaultSaveOptions'); + return _clang_defaultSaveOptions( + TU, + ); + } + + _dart_clang_defaultSaveOptions _clang_defaultSaveOptions; + + /// Saves a translation unit into a serialized representation of that + /// translation unit on disk. + int clang_saveTranslationUnit( + ffi.Pointer TU, + ffi.Pointer FileName, + int options, + ) { + _clang_saveTranslationUnit ??= _dylib.lookupFunction< + _c_clang_saveTranslationUnit, + _dart_clang_saveTranslationUnit>('clang_saveTranslationUnit'); + return _clang_saveTranslationUnit( + TU, + FileName, + options, + ); + } + + _dart_clang_saveTranslationUnit _clang_saveTranslationUnit; + + /// Suspend a translation unit in order to free memory associated with it. + int clang_suspendTranslationUnit( + ffi.Pointer arg0, + ) { + _clang_suspendTranslationUnit ??= _dylib.lookupFunction< + _c_clang_suspendTranslationUnit, + _dart_clang_suspendTranslationUnit>('clang_suspendTranslationUnit'); + return _clang_suspendTranslationUnit( + arg0, + ); + } + + _dart_clang_suspendTranslationUnit _clang_suspendTranslationUnit; + + /// Destroy the specified CXTranslationUnit object. + void clang_disposeTranslationUnit( + ffi.Pointer arg0, + ) { + _clang_disposeTranslationUnit ??= _dylib.lookupFunction< + _c_clang_disposeTranslationUnit, + _dart_clang_disposeTranslationUnit>('clang_disposeTranslationUnit'); + return _clang_disposeTranslationUnit( + arg0, + ); + } + + _dart_clang_disposeTranslationUnit _clang_disposeTranslationUnit; + + /// Returns the set of flags that is suitable for reparsing a translation + /// unit. + int clang_defaultReparseOptions( + ffi.Pointer TU, + ) { + _clang_defaultReparseOptions ??= _dylib.lookupFunction< + _c_clang_defaultReparseOptions, + _dart_clang_defaultReparseOptions>('clang_defaultReparseOptions'); + return _clang_defaultReparseOptions( + TU, + ); + } + + _dart_clang_defaultReparseOptions _clang_defaultReparseOptions; + + /// Reparse the source files that produced this translation unit. + int clang_reparseTranslationUnit( + ffi.Pointer TU, + int num_unsaved_files, + ffi.Pointer unsaved_files, + int options, + ) { + _clang_reparseTranslationUnit ??= _dylib.lookupFunction< + _c_clang_reparseTranslationUnit, + _dart_clang_reparseTranslationUnit>('clang_reparseTranslationUnit'); + return _clang_reparseTranslationUnit( + TU, + num_unsaved_files, + unsaved_files, + options, + ); + } + + _dart_clang_reparseTranslationUnit _clang_reparseTranslationUnit; + + /// Returns the human-readable null-terminated C string that represents the + /// name of the memory category. This string should never be freed. + ffi.Pointer clang_getTUResourceUsageName( + int kind, + ) { + _clang_getTUResourceUsageName ??= _dylib.lookupFunction< + _c_clang_getTUResourceUsageName, + _dart_clang_getTUResourceUsageName>('clang_getTUResourceUsageName'); + return _clang_getTUResourceUsageName( + kind, + ); + } + + _dart_clang_getTUResourceUsageName _clang_getTUResourceUsageName; + + /// Get target information for this translation unit. + ffi.Pointer clang_getTranslationUnitTargetInfo( + ffi.Pointer CTUnit, + ) { + _clang_getTranslationUnitTargetInfo ??= _dylib.lookupFunction< + _c_clang_getTranslationUnitTargetInfo, + _dart_clang_getTranslationUnitTargetInfo>( + 'clang_getTranslationUnitTargetInfo'); + return _clang_getTranslationUnitTargetInfo( + CTUnit, + ); + } + + _dart_clang_getTranslationUnitTargetInfo _clang_getTranslationUnitTargetInfo; + + /// Destroy the CXTargetInfo object. + void clang_TargetInfo_dispose( + ffi.Pointer Info, + ) { + _clang_TargetInfo_dispose ??= _dylib.lookupFunction< + _c_clang_TargetInfo_dispose, + _dart_clang_TargetInfo_dispose>('clang_TargetInfo_dispose'); + return _clang_TargetInfo_dispose( + Info, + ); + } + + _dart_clang_TargetInfo_dispose _clang_TargetInfo_dispose; + + /// Get the pointer width of the target in bits. + int clang_TargetInfo_getPointerWidth( + ffi.Pointer Info, + ) { + _clang_TargetInfo_getPointerWidth ??= _dylib.lookupFunction< + _c_clang_TargetInfo_getPointerWidth, + _dart_clang_TargetInfo_getPointerWidth>( + 'clang_TargetInfo_getPointerWidth'); + return _clang_TargetInfo_getPointerWidth( + Info, + ); + } + + _dart_clang_TargetInfo_getPointerWidth _clang_TargetInfo_getPointerWidth; + + /// Determine whether the given cursor kind represents a declaration. + int clang_isDeclaration( + int arg0, + ) { + _clang_isDeclaration ??= _dylib.lookupFunction<_c_clang_isDeclaration, + _dart_clang_isDeclaration>('clang_isDeclaration'); + return _clang_isDeclaration( + arg0, + ); + } + + _dart_clang_isDeclaration _clang_isDeclaration; + + /// Determine whether the given cursor kind represents a simple reference. + int clang_isReference( + int arg0, + ) { + _clang_isReference ??= + _dylib.lookupFunction<_c_clang_isReference, _dart_clang_isReference>( + 'clang_isReference'); + return _clang_isReference( + arg0, + ); + } + + _dart_clang_isReference _clang_isReference; + + /// Determine whether the given cursor kind represents an expression. + int clang_isExpression( + int arg0, + ) { + _clang_isExpression ??= + _dylib.lookupFunction<_c_clang_isExpression, _dart_clang_isExpression>( + 'clang_isExpression'); + return _clang_isExpression( + arg0, + ); + } + + _dart_clang_isExpression _clang_isExpression; + + /// Determine whether the given cursor kind represents a statement. + int clang_isStatement( + int arg0, + ) { + _clang_isStatement ??= + _dylib.lookupFunction<_c_clang_isStatement, _dart_clang_isStatement>( + 'clang_isStatement'); + return _clang_isStatement( + arg0, + ); + } + + _dart_clang_isStatement _clang_isStatement; + + /// Determine whether the given cursor kind represents an attribute. + int clang_isAttribute( + int arg0, + ) { + _clang_isAttribute ??= + _dylib.lookupFunction<_c_clang_isAttribute, _dart_clang_isAttribute>( + 'clang_isAttribute'); + return _clang_isAttribute( + arg0, + ); + } + + _dart_clang_isAttribute _clang_isAttribute; + + /// Determine whether the given cursor kind represents an invalid cursor. + int clang_isInvalid( + int arg0, + ) { + _clang_isInvalid ??= + _dylib.lookupFunction<_c_clang_isInvalid, _dart_clang_isInvalid>( + 'clang_isInvalid'); + return _clang_isInvalid( + arg0, + ); + } + + _dart_clang_isInvalid _clang_isInvalid; + + /// Determine whether the given cursor kind represents a translation unit. + int clang_isTranslationUnit( + int arg0, + ) { + _clang_isTranslationUnit ??= _dylib.lookupFunction< + _c_clang_isTranslationUnit, + _dart_clang_isTranslationUnit>('clang_isTranslationUnit'); + return _clang_isTranslationUnit( + arg0, + ); + } + + _dart_clang_isTranslationUnit _clang_isTranslationUnit; + + /// * Determine whether the given cursor represents a preprocessing element, + /// such as a preprocessor directive or macro instantiation. + int clang_isPreprocessing( + int arg0, + ) { + _clang_isPreprocessing ??= _dylib.lookupFunction<_c_clang_isPreprocessing, + _dart_clang_isPreprocessing>('clang_isPreprocessing'); + return _clang_isPreprocessing( + arg0, + ); + } + + _dart_clang_isPreprocessing _clang_isPreprocessing; + + /// * Determine whether the given cursor represents a currently unexposed + /// piece of the AST (e.g., CXCursor_UnexposedStmt). + int clang_isUnexposed( + int arg0, + ) { + _clang_isUnexposed ??= + _dylib.lookupFunction<_c_clang_isUnexposed, _dart_clang_isUnexposed>( + 'clang_isUnexposed'); + return _clang_isUnexposed( + arg0, + ); + } + + _dart_clang_isUnexposed _clang_isUnexposed; + + /// Free the memory associated with a CXPlatformAvailability structure. + void clang_disposeCXPlatformAvailability( + ffi.Pointer availability, + ) { + _clang_disposeCXPlatformAvailability ??= _dylib.lookupFunction< + _c_clang_disposeCXPlatformAvailability, + _dart_clang_disposeCXPlatformAvailability>( + 'clang_disposeCXPlatformAvailability'); + return _clang_disposeCXPlatformAvailability( + availability, + ); + } + + _dart_clang_disposeCXPlatformAvailability + _clang_disposeCXPlatformAvailability; + + /// Creates an empty CXCursorSet. + ffi.Pointer clang_createCXCursorSet() { + _clang_createCXCursorSet ??= _dylib.lookupFunction< + _c_clang_createCXCursorSet, + _dart_clang_createCXCursorSet>('clang_createCXCursorSet'); + return _clang_createCXCursorSet(); + } + + _dart_clang_createCXCursorSet _clang_createCXCursorSet; + + /// Disposes a CXCursorSet and releases its associated memory. + void clang_disposeCXCursorSet( + ffi.Pointer cset, + ) { + _clang_disposeCXCursorSet ??= _dylib.lookupFunction< + _c_clang_disposeCXCursorSet, + _dart_clang_disposeCXCursorSet>('clang_disposeCXCursorSet'); + return _clang_disposeCXCursorSet( + cset, + ); + } + + _dart_clang_disposeCXCursorSet _clang_disposeCXCursorSet; + + /// Free the set of overridden cursors returned by + /// clang_getOverriddenCursors(). + void clang_disposeOverriddenCursors( + ffi.Pointer overridden, + ) { + _clang_disposeOverriddenCursors ??= _dylib.lookupFunction< + _c_clang_disposeOverriddenCursors, + _dart_clang_disposeOverriddenCursors>('clang_disposeOverriddenCursors'); + return _clang_disposeOverriddenCursors( + overridden, + ); + } + + _dart_clang_disposeOverriddenCursors _clang_disposeOverriddenCursors; + + /// Get a property value for the given printing policy. + int clang_PrintingPolicy_getProperty( + ffi.Pointer Policy, + int Property, + ) { + _clang_PrintingPolicy_getProperty ??= _dylib.lookupFunction< + _c_clang_PrintingPolicy_getProperty, + _dart_clang_PrintingPolicy_getProperty>( + 'clang_PrintingPolicy_getProperty'); + return _clang_PrintingPolicy_getProperty( + Policy, + Property, + ); + } + + _dart_clang_PrintingPolicy_getProperty _clang_PrintingPolicy_getProperty; + + /// Set a property value for the given printing policy. + void clang_PrintingPolicy_setProperty( + ffi.Pointer Policy, + int Property, + int Value, + ) { + _clang_PrintingPolicy_setProperty ??= _dylib.lookupFunction< + _c_clang_PrintingPolicy_setProperty, + _dart_clang_PrintingPolicy_setProperty>( + 'clang_PrintingPolicy_setProperty'); + return _clang_PrintingPolicy_setProperty( + Policy, + Property, + Value, + ); + } + + _dart_clang_PrintingPolicy_setProperty _clang_PrintingPolicy_setProperty; + + /// Release a printing policy. + void clang_PrintingPolicy_dispose( + ffi.Pointer Policy, + ) { + _clang_PrintingPolicy_dispose ??= _dylib.lookupFunction< + _c_clang_PrintingPolicy_dispose, + _dart_clang_PrintingPolicy_dispose>('clang_PrintingPolicy_dispose'); + return _clang_PrintingPolicy_dispose( + Policy, + ); + } + + _dart_clang_PrintingPolicy_dispose _clang_PrintingPolicy_dispose; + + /// Given a CXFile header file, return the module that contains it, if one + /// exists. + ffi.Pointer clang_getModuleForFile( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + _clang_getModuleForFile ??= _dylib.lookupFunction<_c_clang_getModuleForFile, + _dart_clang_getModuleForFile>('clang_getModuleForFile'); + return _clang_getModuleForFile( + arg0, + arg1, + ); + } + + _dart_clang_getModuleForFile _clang_getModuleForFile; + + /// Returns the module file where the provided module object came from. + ffi.Pointer clang_Module_getASTFile( + ffi.Pointer Module, + ) { + _clang_Module_getASTFile ??= _dylib.lookupFunction< + _c_clang_Module_getASTFile, + _dart_clang_Module_getASTFile>('clang_Module_getASTFile'); + return _clang_Module_getASTFile( + Module, + ); + } + + _dart_clang_Module_getASTFile _clang_Module_getASTFile; + + /// 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, + ) { + _clang_Module_getParent ??= _dylib.lookupFunction<_c_clang_Module_getParent, + _dart_clang_Module_getParent>('clang_Module_getParent'); + return _clang_Module_getParent( + Module, + ); + } + + _dart_clang_Module_getParent _clang_Module_getParent; + + /// Returns non-zero if the module is a system one. + int clang_Module_isSystem( + ffi.Pointer Module, + ) { + _clang_Module_isSystem ??= _dylib.lookupFunction<_c_clang_Module_isSystem, + _dart_clang_Module_isSystem>('clang_Module_isSystem'); + return _clang_Module_isSystem( + Module, + ); + } + + _dart_clang_Module_isSystem _clang_Module_isSystem; + + /// Returns the number of top level headers associated with this module. + int clang_Module_getNumTopLevelHeaders( + ffi.Pointer arg0, + ffi.Pointer Module, + ) { + _clang_Module_getNumTopLevelHeaders ??= _dylib.lookupFunction< + _c_clang_Module_getNumTopLevelHeaders, + _dart_clang_Module_getNumTopLevelHeaders>( + 'clang_Module_getNumTopLevelHeaders'); + return _clang_Module_getNumTopLevelHeaders( + arg0, + Module, + ); + } + + _dart_clang_Module_getNumTopLevelHeaders _clang_Module_getNumTopLevelHeaders; + + /// Returns the specified top level header associated with the module. + ffi.Pointer clang_Module_getTopLevelHeader( + ffi.Pointer arg0, + ffi.Pointer Module, + int Index, + ) { + _clang_Module_getTopLevelHeader ??= _dylib.lookupFunction< + _c_clang_Module_getTopLevelHeader, + _dart_clang_Module_getTopLevelHeader>('clang_Module_getTopLevelHeader'); + return _clang_Module_getTopLevelHeader( + arg0, + Module, + Index, + ); + } + + _dart_clang_Module_getTopLevelHeader _clang_Module_getTopLevelHeader; + + /// 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, + ) { + _clang_annotateTokens ??= _dylib.lookupFunction<_c_clang_annotateTokens, + _dart_clang_annotateTokens>('clang_annotateTokens'); + return _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, + ) { + _clang_disposeTokens ??= _dylib.lookupFunction<_c_clang_disposeTokens, + _dart_clang_disposeTokens>('clang_disposeTokens'); + return _clang_disposeTokens( + TU, + Tokens, + NumTokens, + ); + } + + _dart_clang_disposeTokens _clang_disposeTokens; + + void clang_enableStackTraces() { + _clang_enableStackTraces ??= _dylib.lookupFunction< + _c_clang_enableStackTraces, + _dart_clang_enableStackTraces>('clang_enableStackTraces'); + return _clang_enableStackTraces(); + } + + _dart_clang_enableStackTraces _clang_enableStackTraces; + + void clang_executeOnThread( + ffi.Pointer> fn, + ffi.Pointer user_data, + int stack_size, + ) { + _clang_executeOnThread ??= _dylib.lookupFunction<_c_clang_executeOnThread, + _dart_clang_executeOnThread>('clang_executeOnThread'); + return _clang_executeOnThread( + fn, + user_data, + stack_size, + ); + } + + _dart_clang_executeOnThread _clang_executeOnThread; + + /// Determine the kind of a particular chunk within a completion string. + int clang_getCompletionChunkKind( + ffi.Pointer completion_string, + int chunk_number, + ) { + _clang_getCompletionChunkKind ??= _dylib.lookupFunction< + _c_clang_getCompletionChunkKind, + _dart_clang_getCompletionChunkKind>('clang_getCompletionChunkKind'); + return _clang_getCompletionChunkKind( + completion_string, + chunk_number, + ); + } + + _dart_clang_getCompletionChunkKind _clang_getCompletionChunkKind; + + /// Retrieve the completion string associated with a particular chunk within a + /// completion string. + ffi.Pointer clang_getCompletionChunkCompletionString( + ffi.Pointer completion_string, + int chunk_number, + ) { + _clang_getCompletionChunkCompletionString ??= _dylib.lookupFunction< + _c_clang_getCompletionChunkCompletionString, + _dart_clang_getCompletionChunkCompletionString>( + 'clang_getCompletionChunkCompletionString'); + return _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, + ) { + _clang_getNumCompletionChunks ??= _dylib.lookupFunction< + _c_clang_getNumCompletionChunks, + _dart_clang_getNumCompletionChunks>('clang_getNumCompletionChunks'); + return _clang_getNumCompletionChunks( + completion_string, + ); + } + + _dart_clang_getNumCompletionChunks _clang_getNumCompletionChunks; + + /// Determine the priority of this code completion. + int clang_getCompletionPriority( + ffi.Pointer completion_string, + ) { + _clang_getCompletionPriority ??= _dylib.lookupFunction< + _c_clang_getCompletionPriority, + _dart_clang_getCompletionPriority>('clang_getCompletionPriority'); + return _clang_getCompletionPriority( + completion_string, + ); + } + + _dart_clang_getCompletionPriority _clang_getCompletionPriority; + + /// Determine the availability of the entity that this code-completion string + /// refers to. + int clang_getCompletionAvailability( + ffi.Pointer completion_string, + ) { + _clang_getCompletionAvailability ??= _dylib.lookupFunction< + _c_clang_getCompletionAvailability, + _dart_clang_getCompletionAvailability>( + 'clang_getCompletionAvailability'); + return _clang_getCompletionAvailability( + completion_string, + ); + } + + _dart_clang_getCompletionAvailability _clang_getCompletionAvailability; + + /// Retrieve the number of annotations associated with the given completion + /// string. + int clang_getCompletionNumAnnotations( + ffi.Pointer completion_string, + ) { + _clang_getCompletionNumAnnotations ??= _dylib.lookupFunction< + _c_clang_getCompletionNumAnnotations, + _dart_clang_getCompletionNumAnnotations>( + 'clang_getCompletionNumAnnotations'); + return _clang_getCompletionNumAnnotations( + completion_string, + ); + } + + _dart_clang_getCompletionNumAnnotations _clang_getCompletionNumAnnotations; + + /// Retrieve the number of fix-its for the given completion index. + int clang_getCompletionNumFixIts( + ffi.Pointer results, + int completion_index, + ) { + _clang_getCompletionNumFixIts ??= _dylib.lookupFunction< + _c_clang_getCompletionNumFixIts, + _dart_clang_getCompletionNumFixIts>('clang_getCompletionNumFixIts'); + return _clang_getCompletionNumFixIts( + results, + completion_index, + ); + } + + _dart_clang_getCompletionNumFixIts _clang_getCompletionNumFixIts; + + /// Returns a default set of code-completion options that can be passed to + /// clang_codeCompleteAt(). + int clang_defaultCodeCompleteOptions() { + _clang_defaultCodeCompleteOptions ??= _dylib.lookupFunction< + _c_clang_defaultCodeCompleteOptions, + _dart_clang_defaultCodeCompleteOptions>( + 'clang_defaultCodeCompleteOptions'); + return _clang_defaultCodeCompleteOptions(); + } + + _dart_clang_defaultCodeCompleteOptions _clang_defaultCodeCompleteOptions; + + /// 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, + ) { + _clang_codeCompleteAt ??= _dylib.lookupFunction<_c_clang_codeCompleteAt, + _dart_clang_codeCompleteAt>('clang_codeCompleteAt'); + return _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. + void clang_sortCodeCompletionResults( + ffi.Pointer Results, + int NumResults, + ) { + _clang_sortCodeCompletionResults ??= _dylib.lookupFunction< + _c_clang_sortCodeCompletionResults, + _dart_clang_sortCodeCompletionResults>( + 'clang_sortCodeCompletionResults'); + return _clang_sortCodeCompletionResults( + Results, + NumResults, + ); + } + + _dart_clang_sortCodeCompletionResults _clang_sortCodeCompletionResults; + + /// Free the given set of code-completion results. + void clang_disposeCodeCompleteResults( + ffi.Pointer Results, + ) { + _clang_disposeCodeCompleteResults ??= _dylib.lookupFunction< + _c_clang_disposeCodeCompleteResults, + _dart_clang_disposeCodeCompleteResults>( + 'clang_disposeCodeCompleteResults'); + return _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, + ) { + _clang_codeCompleteGetNumDiagnostics ??= _dylib.lookupFunction< + _c_clang_codeCompleteGetNumDiagnostics, + _dart_clang_codeCompleteGetNumDiagnostics>( + 'clang_codeCompleteGetNumDiagnostics'); + return _clang_codeCompleteGetNumDiagnostics( + Results, + ); + } + + _dart_clang_codeCompleteGetNumDiagnostics + _clang_codeCompleteGetNumDiagnostics; + + /// Retrieve a diagnostic associated with the given code completion. + ffi.Pointer clang_codeCompleteGetDiagnostic( + ffi.Pointer Results, + int Index, + ) { + _clang_codeCompleteGetDiagnostic ??= _dylib.lookupFunction< + _c_clang_codeCompleteGetDiagnostic, + _dart_clang_codeCompleteGetDiagnostic>( + 'clang_codeCompleteGetDiagnostic'); + return _clang_codeCompleteGetDiagnostic( + Results, + Index, + ); + } + + _dart_clang_codeCompleteGetDiagnostic _clang_codeCompleteGetDiagnostic; + + /// Determines what completions are appropriate for the context the given code + /// completion. + int clang_codeCompleteGetContexts( + ffi.Pointer Results, + ) { + _clang_codeCompleteGetContexts ??= _dylib.lookupFunction< + _c_clang_codeCompleteGetContexts, + _dart_clang_codeCompleteGetContexts>('clang_codeCompleteGetContexts'); + return _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. + int clang_codeCompleteGetContainerKind( + ffi.Pointer Results, + ffi.Pointer IsIncomplete, + ) { + _clang_codeCompleteGetContainerKind ??= _dylib.lookupFunction< + _c_clang_codeCompleteGetContainerKind, + _dart_clang_codeCompleteGetContainerKind>( + 'clang_codeCompleteGetContainerKind'); + return _clang_codeCompleteGetContainerKind( + Results, + IsIncomplete, + ); + } + + _dart_clang_codeCompleteGetContainerKind _clang_codeCompleteGetContainerKind; + + /// Enable/disable crash recovery. + void clang_toggleCrashRecovery( + int isEnabled, + ) { + _clang_toggleCrashRecovery ??= _dylib.lookupFunction< + _c_clang_toggleCrashRecovery, + _dart_clang_toggleCrashRecovery>('clang_toggleCrashRecovery'); + return _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, + ) { + _clang_getInclusions ??= _dylib.lookupFunction<_c_clang_getInclusions, + _dart_clang_getInclusions>('clang_getInclusions'); + return _clang_getInclusions( + tu, + visitor, + client_data, + ); + } + + _dart_clang_getInclusions _clang_getInclusions; + + /// Returns the kind of the evaluated result. + int clang_EvalResult_getKind( + ffi.Pointer E, + ) { + _clang_EvalResult_getKind ??= _dylib.lookupFunction< + _c_clang_EvalResult_getKind, + _dart_clang_EvalResult_getKind>('clang_EvalResult_getKind'); + return _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, + ) { + _clang_EvalResult_getAsInt ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsInt, + _dart_clang_EvalResult_getAsInt>('clang_EvalResult_getAsInt'); + return _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, + ) { + _clang_EvalResult_getAsLongLong ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsLongLong, + _dart_clang_EvalResult_getAsLongLong>('clang_EvalResult_getAsLongLong'); + return _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, + ) { + _clang_EvalResult_isUnsignedInt ??= _dylib.lookupFunction< + _c_clang_EvalResult_isUnsignedInt, + _dart_clang_EvalResult_isUnsignedInt>('clang_EvalResult_isUnsignedInt'); + return _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, + ) { + _clang_EvalResult_getAsUnsigned ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsUnsigned, + _dart_clang_EvalResult_getAsUnsigned>('clang_EvalResult_getAsUnsigned'); + return _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, + ) { + _clang_EvalResult_getAsDouble ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsDouble, + _dart_clang_EvalResult_getAsDouble>('clang_EvalResult_getAsDouble'); + return _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, + ) { + _clang_EvalResult_getAsStr ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsStr, + _dart_clang_EvalResult_getAsStr>('clang_EvalResult_getAsStr'); + return _clang_EvalResult_getAsStr( + E, + ); + } + + _dart_clang_EvalResult_getAsStr _clang_EvalResult_getAsStr; + + /// Disposes the created Eval memory. + void clang_EvalResult_dispose( + ffi.Pointer E, + ) { + _clang_EvalResult_dispose ??= _dylib.lookupFunction< + _c_clang_EvalResult_dispose, + _dart_clang_EvalResult_dispose>('clang_EvalResult_dispose'); + return _clang_EvalResult_dispose( + E, + ); + } + + _dart_clang_EvalResult_dispose _clang_EvalResult_dispose; + + /// Retrieve a remapping. + ffi.Pointer clang_getRemappings( + ffi.Pointer path, + ) { + _clang_getRemappings ??= _dylib.lookupFunction<_c_clang_getRemappings, + _dart_clang_getRemappings>('clang_getRemappings'); + return _clang_getRemappings( + path, + ); + } + + _dart_clang_getRemappings _clang_getRemappings; + + /// Retrieve a remapping. + ffi.Pointer clang_getRemappingsFromFileList( + ffi.Pointer> filePaths, + int numFiles, + ) { + _clang_getRemappingsFromFileList ??= _dylib.lookupFunction< + _c_clang_getRemappingsFromFileList, + _dart_clang_getRemappingsFromFileList>( + 'clang_getRemappingsFromFileList'); + return _clang_getRemappingsFromFileList( + filePaths, + numFiles, + ); + } + + _dart_clang_getRemappingsFromFileList _clang_getRemappingsFromFileList; + + /// Determine the number of remappings. + int clang_remap_getNumFiles( + ffi.Pointer arg0, + ) { + _clang_remap_getNumFiles ??= _dylib.lookupFunction< + _c_clang_remap_getNumFiles, + _dart_clang_remap_getNumFiles>('clang_remap_getNumFiles'); + return _clang_remap_getNumFiles( + arg0, + ); + } + + _dart_clang_remap_getNumFiles _clang_remap_getNumFiles; + + /// 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, + ) { + _clang_remap_getFilenames ??= _dylib.lookupFunction< + _c_clang_remap_getFilenames, + _dart_clang_remap_getFilenames>('clang_remap_getFilenames'); + return _clang_remap_getFilenames( + arg0, + index, + original, + transformed, + ); + } + + _dart_clang_remap_getFilenames _clang_remap_getFilenames; + + /// Dispose the remapping. + void clang_remap_dispose( + ffi.Pointer arg0, + ) { + _clang_remap_dispose ??= _dylib.lookupFunction<_c_clang_remap_dispose, + _dart_clang_remap_dispose>('clang_remap_dispose'); + return _clang_remap_dispose( + arg0, + ); + } + + _dart_clang_remap_dispose _clang_remap_dispose; + + int clang_index_isEntityObjCContainerKind( + int arg0, + ) { + _clang_index_isEntityObjCContainerKind ??= _dylib.lookupFunction< + _c_clang_index_isEntityObjCContainerKind, + _dart_clang_index_isEntityObjCContainerKind>( + 'clang_index_isEntityObjCContainerKind'); + return _clang_index_isEntityObjCContainerKind( + arg0, + ); + } + + _dart_clang_index_isEntityObjCContainerKind + _clang_index_isEntityObjCContainerKind; + + ffi.Pointer clang_index_getObjCContainerDeclInfo( + ffi.Pointer arg0, + ) { + _clang_index_getObjCContainerDeclInfo ??= _dylib.lookupFunction< + _c_clang_index_getObjCContainerDeclInfo, + _dart_clang_index_getObjCContainerDeclInfo>( + 'clang_index_getObjCContainerDeclInfo'); + return _clang_index_getObjCContainerDeclInfo( + arg0, + ); + } + + _dart_clang_index_getObjCContainerDeclInfo + _clang_index_getObjCContainerDeclInfo; + + ffi.Pointer clang_index_getObjCInterfaceDeclInfo( + ffi.Pointer arg0, + ) { + _clang_index_getObjCInterfaceDeclInfo ??= _dylib.lookupFunction< + _c_clang_index_getObjCInterfaceDeclInfo, + _dart_clang_index_getObjCInterfaceDeclInfo>( + 'clang_index_getObjCInterfaceDeclInfo'); + return _clang_index_getObjCInterfaceDeclInfo( + arg0, + ); + } + + _dart_clang_index_getObjCInterfaceDeclInfo + _clang_index_getObjCInterfaceDeclInfo; + + ffi.Pointer clang_index_getObjCCategoryDeclInfo( + ffi.Pointer arg0, + ) { + _clang_index_getObjCCategoryDeclInfo ??= _dylib.lookupFunction< + _c_clang_index_getObjCCategoryDeclInfo, + _dart_clang_index_getObjCCategoryDeclInfo>( + 'clang_index_getObjCCategoryDeclInfo'); + return _clang_index_getObjCCategoryDeclInfo( + arg0, + ); + } + + _dart_clang_index_getObjCCategoryDeclInfo + _clang_index_getObjCCategoryDeclInfo; + + ffi.Pointer + clang_index_getObjCProtocolRefListInfo( + ffi.Pointer arg0, + ) { + _clang_index_getObjCProtocolRefListInfo ??= _dylib.lookupFunction< + _c_clang_index_getObjCProtocolRefListInfo, + _dart_clang_index_getObjCProtocolRefListInfo>( + 'clang_index_getObjCProtocolRefListInfo'); + return _clang_index_getObjCProtocolRefListInfo( + arg0, + ); + } + + _dart_clang_index_getObjCProtocolRefListInfo + _clang_index_getObjCProtocolRefListInfo; + + ffi.Pointer clang_index_getObjCPropertyDeclInfo( + ffi.Pointer arg0, + ) { + _clang_index_getObjCPropertyDeclInfo ??= _dylib.lookupFunction< + _c_clang_index_getObjCPropertyDeclInfo, + _dart_clang_index_getObjCPropertyDeclInfo>( + 'clang_index_getObjCPropertyDeclInfo'); + return _clang_index_getObjCPropertyDeclInfo( + arg0, + ); + } + + _dart_clang_index_getObjCPropertyDeclInfo + _clang_index_getObjCPropertyDeclInfo; + + ffi.Pointer + clang_index_getIBOutletCollectionAttrInfo( + ffi.Pointer arg0, + ) { + _clang_index_getIBOutletCollectionAttrInfo ??= _dylib.lookupFunction< + _c_clang_index_getIBOutletCollectionAttrInfo, + _dart_clang_index_getIBOutletCollectionAttrInfo>( + 'clang_index_getIBOutletCollectionAttrInfo'); + return _clang_index_getIBOutletCollectionAttrInfo( + arg0, + ); + } + + _dart_clang_index_getIBOutletCollectionAttrInfo + _clang_index_getIBOutletCollectionAttrInfo; + + ffi.Pointer clang_index_getCXXClassDeclInfo( + ffi.Pointer arg0, + ) { + _clang_index_getCXXClassDeclInfo ??= _dylib.lookupFunction< + _c_clang_index_getCXXClassDeclInfo, + _dart_clang_index_getCXXClassDeclInfo>( + 'clang_index_getCXXClassDeclInfo'); + return _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, + ) { + _clang_index_getClientContainer ??= _dylib.lookupFunction< + _c_clang_index_getClientContainer, + _dart_clang_index_getClientContainer>('clang_index_getClientContainer'); + return _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, + ) { + _clang_index_setClientContainer ??= _dylib.lookupFunction< + _c_clang_index_setClientContainer, + _dart_clang_index_setClientContainer>('clang_index_setClientContainer'); + return _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, + ) { + _clang_index_getClientEntity ??= _dylib.lookupFunction< + _c_clang_index_getClientEntity, + _dart_clang_index_getClientEntity>('clang_index_getClientEntity'); + return _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, + ) { + _clang_index_setClientEntity ??= _dylib.lookupFunction< + _c_clang_index_setClientEntity, + _dart_clang_index_setClientEntity>('clang_index_setClientEntity'); + return _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, + ) { + _clang_IndexAction_create ??= _dylib.lookupFunction< + _c_clang_IndexAction_create, + _dart_clang_IndexAction_create>('clang_IndexAction_create'); + return _clang_IndexAction_create( + CIdx, + ); + } + + _dart_clang_IndexAction_create _clang_IndexAction_create; + + /// Destroy the given index action. + void clang_IndexAction_dispose( + ffi.Pointer arg0, + ) { + _clang_IndexAction_dispose ??= _dylib.lookupFunction< + _c_clang_IndexAction_dispose, + _dart_clang_IndexAction_dispose>('clang_IndexAction_dispose'); + return _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, + ) { + _clang_indexSourceFile ??= _dylib.lookupFunction<_c_clang_indexSourceFile, + _dart_clang_indexSourceFile>('clang_indexSourceFile'); + return _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, + ) { + _clang_indexSourceFileFullArgv ??= _dylib.lookupFunction< + _c_clang_indexSourceFileFullArgv, + _dart_clang_indexSourceFileFullArgv>('clang_indexSourceFileFullArgv'); + return _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, + ) { + _clang_indexTranslationUnit ??= _dylib.lookupFunction< + _c_clang_indexTranslationUnit, + _dart_clang_indexTranslationUnit>('clang_indexTranslationUnit'); + return _clang_indexTranslationUnit( + arg0, + client_data, + index_callbacks, + index_callbacks_size, + index_options, + arg5, + ); + } + + _dart_clang_indexTranslationUnit _clang_indexTranslationUnit; +} + +/// Error codes returned by libclang routines. +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 { + ffi.Pointer data; + + @ffi.Uint32() + int private_flags; +} + +class CXStringSet extends ffi.Struct { + ffi.Pointer Strings; + + @ffi.Uint32() + 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. + ffi.Pointer Filename; + + /// A buffer containing the unsaved contents of this file. + ffi.Pointer Contents; + + /// The length of the unsaved contents of this buffer. + @ffi.Uint64() + 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. +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() + 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() + 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() + int Subminor; +} + +/// Describes the exception specification of a cursor. +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; +} + +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() + int _unique_data_item_0; + @ffi.Uint64() + int _unique_data_item_1; + @ffi.Uint64() + 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 { + ffi.Pointer _unique_ptr_data_item_0; + 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() + 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 { + ffi.Pointer _unique_ptr_data_item_0; + 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() + int begin_int_data; + + @ffi.Uint32() + 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() + int count; + + /// An array of CXSourceRanges. + ffi.Pointer ranges; +} + +/// Describes the severity of a particular diagnostic. +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. +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. +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. +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. +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(). +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. +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. +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() + int kind; + + @ffi.Uint64() + int amount; +} + +/// The memory usage of a CXTranslationUnit, broken into categories. +class CXTUResourceUsage extends ffi.Struct { + ffi.Pointer data; + + @ffi.Uint32() + int numEntries; + + ffi.Pointer entries; +} + +/// Describes the kind of entity that a cursor refers to. +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 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() + int kind; + + @ffi.Int32() + int xdata; + + ffi.Pointer _unique_data_item_0; + ffi.Pointer _unique_data_item_1; + 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. +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; +} + +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 {} + +/// Describe the "language" of the entity referred to by a cursor. +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. +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 +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 +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() + int kind; + + ffi.Pointer _unique_data_item_0; + 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. +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; +} + +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. +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; +} + +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. +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. +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. +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. +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. +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. +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; +} + +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. +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() + int _unique_int_data_item_0; + @ffi.Uint32() + int _unique_int_data_item_1; + @ffi.Uint32() + int _unique_int_data_item_2; + @ffi.Uint32() + 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); + 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() + int CursorKind; + + /// The code-completion string that describes how to insert this + /// code-completion result into the editing buffer. + ffi.Pointer CompletionString; +} + +/// Describes a single piece of text within a code-completion string. +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. + ffi.Pointer Results; + + /// The number of code-completion results stored in the Results array. + @ffi.Uint32() + int NumResults; +} + +/// Flags that can be passed to clang_codeCompleteAt() to modify its behavior. +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. +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; +} + +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; +} + +/// @{ +class CXVisitorResult { + static const int CXVisit_Break = 0; + static const int CXVisit_Continue = 1; +} + +class CXCursorAndRangeVisitor extends ffi.Struct {} + +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 { + ffi.Pointer _unique_ptr_data_item_0; + 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() + 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 {} + +/// Data for IndexerCallbacks#importedASTFile. +class CXIdxImportedASTFileInfo extends ffi.Struct {} + +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; +} + +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 +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; +} + +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 {} + +class CXIdxEntityInfo extends ffi.Struct {} + +class CXIdxContainerInfo extends ffi.Struct {} + +class CXIdxIBOutletCollectionAttrInfo extends ffi.Struct {} + +class CXIdxDeclInfoFlags { + static const int CXIdxDeclFlag_Skipped = 1; +} + +class CXIdxDeclInfo extends ffi.Struct {} + +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 { + ffi.Pointer declInfo; + + @ffi.Int32() + int kind; +} + +class CXIdxBaseClassInfo extends ffi.Struct {} + +class CXIdxObjCProtocolRefInfo extends ffi.Struct {} + +class CXIdxObjCProtocolRefListInfo extends ffi.Struct { + ffi.Pointer> protocols; + + @ffi.Uint32() + int numProtocols; +} + +class CXIdxObjCInterfaceDeclInfo extends ffi.Struct { + ffi.Pointer containerInfo; + + ffi.Pointer superInfo; + + ffi.Pointer protocols; +} + +class CXIdxObjCCategoryDeclInfo extends ffi.Struct {} + +class CXIdxObjCPropertyDeclInfo extends ffi.Struct { + ffi.Pointer declInfo; + + ffi.Pointer getter; + + ffi.Pointer setter; +} + +class CXIdxCXXClassDeclInfo extends ffi.Struct { + ffi.Pointer declInfo; + + ffi.Pointer> bases; + + @ffi.Uint32() + int numBases; +} + +/// Data for IndexerCallbacks#indexEntityReference. +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. +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 {} + +/// 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. + ffi.Pointer> abortQuery; + + /// Called at the end of indexing; passes the complete diagnostic set. + ffi.Pointer> diagnostic; + + ffi.Pointer> enteredMainFile; + + /// Called when a file gets #included/#imported. + ffi.Pointer> ppIncludedFile; + + /// Called when a AST file (PCH or module) gets imported. + ffi.Pointer> importedASTFile; + + /// Called at the beginning of indexing a translation unit. + ffi.Pointer> startedTranslationUnit; + + ffi.Pointer> indexDeclaration; + + /// Called to index a reference of an entity. + ffi.Pointer> indexEntityReference; +} + +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; +} + +typedef _c_clang_disposeStringSet = ffi.Void Function( + ffi.Pointer set, +); + +typedef _dart_clang_disposeStringSet = void Function( + ffi.Pointer set, +); + +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_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_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_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_getDiagnosticCategory = ffi.Uint32 Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_getDiagnosticCategory = int 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_getDiagnosticNumFixIts = ffi.Uint32 Function( + ffi.Pointer Diagnostic, +); + +typedef _dart_clang_getDiagnosticNumFixIts = int Function( + ffi.Pointer Diagnostic, +); + +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_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_getPointerWidth = ffi.Int32 Function( + ffi.Pointer Info, +); + +typedef _dart_clang_TargetInfo_getPointerWidth = int Function( + ffi.Pointer Info, +); + +typedef _c_clang_isDeclaration = ffi.Uint32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_isDeclaration = int Function( + int 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_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_disposeCXPlatformAvailability = ffi.Void Function( + ffi.Pointer availability, +); + +typedef _dart_clang_disposeCXPlatformAvailability = void Function( + ffi.Pointer availability, +); + +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_disposeOverriddenCursors = ffi.Void Function( + ffi.Pointer overridden, +); + +typedef _dart_clang_disposeOverriddenCursors = void Function( + ffi.Pointer overridden, +); + +typedef _c_clang_PrintingPolicy_getProperty = ffi.Uint32 Function( + ffi.Pointer Policy, + ffi.Int32 Property, +); + +typedef _dart_clang_PrintingPolicy_getProperty = int Function( + ffi.Pointer Policy, + int Property, +); + +typedef _c_clang_PrintingPolicy_setProperty = ffi.Void Function( + ffi.Pointer Policy, + ffi.Int32 Property, + ffi.Uint32 Value, +); + +typedef _dart_clang_PrintingPolicy_setProperty = void Function( + ffi.Pointer Policy, + int Property, + int Value, +); + +typedef _c_clang_PrintingPolicy_dispose = ffi.Void Function( + ffi.Pointer Policy, +); + +typedef _dart_clang_PrintingPolicy_dispose = void Function( + ffi.Pointer Policy, +); + +typedef _c_clang_getModuleForFile = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +typedef _dart_clang_getModuleForFile = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +typedef _c_clang_Module_getASTFile = ffi.Pointer Function( + ffi.Pointer Module, +); + +typedef _dart_clang_Module_getASTFile = ffi.Pointer Function( + ffi.Pointer Module, +); + +typedef _c_clang_Module_getParent = ffi.Pointer Function( + ffi.Pointer Module, +); + +typedef _dart_clang_Module_getParent = ffi.Pointer Function( + ffi.Pointer Module, +); + +typedef _c_clang_Module_isSystem = ffi.Int32 Function( + ffi.Pointer Module, +); + +typedef _dart_clang_Module_isSystem = int Function( + ffi.Pointer Module, +); + +typedef _c_clang_Module_getNumTopLevelHeaders = ffi.Uint32 Function( + ffi.Pointer arg0, + ffi.Pointer Module, +); + +typedef _dart_clang_Module_getNumTopLevelHeaders = int Function( + ffi.Pointer arg0, + ffi.Pointer Module, +); + +typedef _c_clang_Module_getTopLevelHeader = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer Module, + ffi.Uint32 Index, +); + +typedef _dart_clang_Module_getTopLevelHeader = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer Module, + int Index, +); + +typedef _c_clang_annotateTokens = ffi.Void Function( + ffi.Pointer TU, + ffi.Pointer Tokens, + ffi.Uint32 NumTokens, + ffi.Pointer Cursors, +); + +typedef _dart_clang_annotateTokens = void Function( + ffi.Pointer TU, + ffi.Pointer Tokens, + int NumTokens, + ffi.Pointer Cursors, +); + +typedef _c_clang_disposeTokens = ffi.Void Function( + ffi.Pointer TU, + ffi.Pointer Tokens, + ffi.Uint32 NumTokens, +); + +typedef _dart_clang_disposeTokens = void Function( + ffi.Pointer TU, + ffi.Pointer Tokens, + int NumTokens, +); + +typedef _c_clang_enableStackTraces = ffi.Void Function(); + +typedef _dart_clang_enableStackTraces = void Function(); + +typedef _typedefC_1 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_clang_executeOnThread = ffi.Void Function( + ffi.Pointer> fn, + ffi.Pointer user_data, + ffi.Uint32 stack_size, +); + +typedef _dart_clang_executeOnThread = void Function( + ffi.Pointer> fn, + ffi.Pointer user_data, + int stack_size, +); + +typedef _c_clang_getCompletionChunkKind = ffi.Int32 Function( + ffi.Pointer completion_string, + ffi.Uint32 chunk_number, +); + +typedef _dart_clang_getCompletionChunkKind = int Function( + ffi.Pointer completion_string, + int chunk_number, +); + +typedef _c_clang_getCompletionChunkCompletionString = ffi.Pointer + Function( + ffi.Pointer completion_string, + ffi.Uint32 chunk_number, +); + +typedef _dart_clang_getCompletionChunkCompletionString = ffi.Pointer + Function( + ffi.Pointer completion_string, + int chunk_number, +); + +typedef _c_clang_getNumCompletionChunks = ffi.Uint32 Function( + ffi.Pointer completion_string, +); + +typedef _dart_clang_getNumCompletionChunks = int Function( + ffi.Pointer completion_string, +); + +typedef _c_clang_getCompletionPriority = ffi.Uint32 Function( + ffi.Pointer completion_string, +); + +typedef _dart_clang_getCompletionPriority = int Function( + ffi.Pointer completion_string, +); + +typedef _c_clang_getCompletionAvailability = ffi.Int32 Function( + ffi.Pointer completion_string, +); + +typedef _dart_clang_getCompletionAvailability = int Function( + ffi.Pointer completion_string, +); + +typedef _c_clang_getCompletionNumAnnotations = ffi.Uint32 Function( + ffi.Pointer completion_string, +); + +typedef _dart_clang_getCompletionNumAnnotations = int Function( + ffi.Pointer completion_string, +); + +typedef _c_clang_getCompletionNumFixIts = ffi.Uint32 Function( + ffi.Pointer results, + ffi.Uint32 completion_index, +); + +typedef _dart_clang_getCompletionNumFixIts = int Function( + ffi.Pointer results, + int completion_index, +); + +typedef _c_clang_defaultCodeCompleteOptions = ffi.Uint32 Function(); + +typedef _dart_clang_defaultCodeCompleteOptions = int Function(); + +typedef _c_clang_codeCompleteAt = ffi.Pointer Function( + ffi.Pointer TU, + ffi.Pointer complete_filename, + ffi.Uint32 complete_line, + ffi.Uint32 complete_column, + ffi.Pointer unsaved_files, + ffi.Uint32 num_unsaved_files, + ffi.Uint32 options, +); + +typedef _dart_clang_codeCompleteAt = ffi.Pointer + Function( + ffi.Pointer TU, + ffi.Pointer complete_filename, + int complete_line, + int complete_column, + ffi.Pointer unsaved_files, + int num_unsaved_files, + int options, +); + +typedef _c_clang_sortCodeCompletionResults = ffi.Void Function( + ffi.Pointer Results, + ffi.Uint32 NumResults, +); + +typedef _dart_clang_sortCodeCompletionResults = void Function( + ffi.Pointer Results, + int NumResults, +); + +typedef _c_clang_disposeCodeCompleteResults = ffi.Void Function( + ffi.Pointer Results, +); + +typedef _dart_clang_disposeCodeCompleteResults = void Function( + ffi.Pointer Results, +); + +typedef _c_clang_codeCompleteGetNumDiagnostics = ffi.Uint32 Function( + ffi.Pointer Results, +); + +typedef _dart_clang_codeCompleteGetNumDiagnostics = int Function( + ffi.Pointer Results, +); + +typedef _c_clang_codeCompleteGetDiagnostic = ffi.Pointer Function( + ffi.Pointer Results, + ffi.Uint32 Index, +); + +typedef _dart_clang_codeCompleteGetDiagnostic = ffi.Pointer Function( + ffi.Pointer Results, + int Index, +); + +typedef _c_clang_codeCompleteGetContexts = ffi.Uint64 Function( + ffi.Pointer Results, +); + +typedef _dart_clang_codeCompleteGetContexts = int Function( + ffi.Pointer Results, +); + +typedef _c_clang_codeCompleteGetContainerKind = ffi.Int32 Function( + ffi.Pointer Results, + ffi.Pointer IsIncomplete, +); + +typedef _dart_clang_codeCompleteGetContainerKind = int Function( + ffi.Pointer Results, + ffi.Pointer IsIncomplete, +); + +typedef _c_clang_toggleCrashRecovery = ffi.Void Function( + ffi.Uint32 isEnabled, +); + +typedef _dart_clang_toggleCrashRecovery = void Function( + int isEnabled, +); + +typedef CXInclusionVisitor_1 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Uint32, + ffi.Pointer, +); + +typedef _c_clang_getInclusions = ffi.Void Function( + ffi.Pointer tu, + ffi.Pointer> visitor, + ffi.Pointer client_data, +); + +typedef _dart_clang_getInclusions = void Function( + ffi.Pointer tu, + ffi.Pointer> visitor, + ffi.Pointer client_data, +); + +typedef _c_clang_EvalResult_getKind = ffi.Int32 Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_getKind = int Function( + ffi.Pointer E, +); + +typedef _c_clang_EvalResult_getAsInt = ffi.Int32 Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_getAsInt = int Function( + ffi.Pointer E, +); + +typedef _c_clang_EvalResult_getAsLongLong = ffi.Int64 Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_getAsLongLong = int Function( + ffi.Pointer E, +); + +typedef _c_clang_EvalResult_isUnsignedInt = ffi.Uint32 Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_isUnsignedInt = int Function( + ffi.Pointer E, +); + +typedef _c_clang_EvalResult_getAsUnsigned = ffi.Uint64 Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_getAsUnsigned = int Function( + ffi.Pointer E, +); + +typedef _c_clang_EvalResult_getAsDouble = ffi.Double Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_getAsDouble = double Function( + ffi.Pointer E, +); + +typedef _c_clang_EvalResult_getAsStr = ffi.Pointer Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_getAsStr = ffi.Pointer Function( + ffi.Pointer E, +); + +typedef _c_clang_EvalResult_dispose = ffi.Void Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_dispose = void Function( + ffi.Pointer E, +); + +typedef _c_clang_getRemappings = ffi.Pointer Function( + ffi.Pointer path, +); + +typedef _dart_clang_getRemappings = ffi.Pointer Function( + ffi.Pointer path, +); + +typedef _c_clang_getRemappingsFromFileList = ffi.Pointer Function( + ffi.Pointer> filePaths, + ffi.Uint32 numFiles, +); + +typedef _dart_clang_getRemappingsFromFileList = ffi.Pointer Function( + ffi.Pointer> filePaths, + int numFiles, +); + +typedef _c_clang_remap_getNumFiles = ffi.Uint32 Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_remap_getNumFiles = int Function( + ffi.Pointer arg0, +); + +typedef _c_clang_remap_getFilenames = ffi.Void Function( + ffi.Pointer arg0, + ffi.Uint32 index, + ffi.Pointer original, + ffi.Pointer transformed, +); + +typedef _dart_clang_remap_getFilenames = void Function( + ffi.Pointer arg0, + int index, + ffi.Pointer original, + ffi.Pointer transformed, +); + +typedef _c_clang_remap_dispose = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_remap_dispose = void Function( + ffi.Pointer arg0, +); + +typedef _c_clang_index_isEntityObjCContainerKind = ffi.Int32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_index_isEntityObjCContainerKind = int Function( + int arg0, +); + +typedef _c_clang_index_getObjCContainerDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_index_getObjCContainerDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_clang_index_getObjCInterfaceDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_index_getObjCInterfaceDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_clang_index_getObjCCategoryDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_index_getObjCCategoryDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_clang_index_getObjCProtocolRefListInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_index_getObjCProtocolRefListInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_clang_index_getObjCPropertyDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_index_getObjCPropertyDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_clang_index_getIBOutletCollectionAttrInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_index_getIBOutletCollectionAttrInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_clang_index_getCXXClassDeclInfo = ffi.Pointer + Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_index_getCXXClassDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_clang_index_getClientContainer = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_index_getClientContainer = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_clang_index_setClientContainer = ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +typedef _dart_clang_index_setClientContainer = void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +typedef _c_clang_index_getClientEntity = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_index_getClientEntity = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_clang_index_setClientEntity = ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +typedef _dart_clang_index_setClientEntity = void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +typedef _c_clang_IndexAction_create = ffi.Pointer Function( + ffi.Pointer CIdx, +); + +typedef _dart_clang_IndexAction_create = ffi.Pointer Function( + ffi.Pointer CIdx, +); + +typedef _c_clang_IndexAction_dispose = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_IndexAction_dispose = void Function( + ffi.Pointer arg0, +); + +typedef _c_clang_indexSourceFile = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer client_data, + ffi.Pointer index_callbacks, + ffi.Uint32 index_callbacks_size, + ffi.Uint32 index_options, + 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.Pointer> out_TU, + ffi.Uint32 TU_options, +); + +typedef _dart_clang_indexSourceFile = int Function( + 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, +); + +typedef _c_clang_indexSourceFileFullArgv = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer client_data, + ffi.Pointer index_callbacks, + ffi.Uint32 index_callbacks_size, + ffi.Uint32 index_options, + 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.Pointer> out_TU, + ffi.Uint32 TU_options, +); + +typedef _dart_clang_indexSourceFileFullArgv = int Function( + 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, +); + +typedef _c_clang_indexTranslationUnit = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer client_data, + ffi.Pointer index_callbacks, + ffi.Uint32 index_callbacks_size, + ffi.Uint32 index_options, + ffi.Pointer arg5, +); + +typedef _dart_clang_indexTranslationUnit = int Function( + ffi.Pointer arg0, + ffi.Pointer client_data, + ffi.Pointer index_callbacks, + int index_callbacks_size, + int index_options, + ffi.Pointer arg5, +); + +typedef _typedefC_3 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_4 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_5 = ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_6 = ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_7 = ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_8 = ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_9 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_10 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, +); diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart new file mode 100644 index 0000000000..4f8ef6eb5c --- /dev/null +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -0,0 +1,7751 @@ +/// AUTO GENERATED FILE, DO NOT EDIT. +/// +/// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Bindings to SQLite. +class SQLite { + /// Holds the Dynamic library. + final ffi.DynamicLibrary _dylib; + + /// The symbols are looked up in [dynamicLibrary]. + SQLite(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + + ffi.Pointer sqlite3_libversion() { + _sqlite3_libversion ??= + _dylib.lookupFunction<_c_sqlite3_libversion, _dart_sqlite3_libversion>( + 'sqlite3_libversion'); + return _sqlite3_libversion(); + } + + _dart_sqlite3_libversion _sqlite3_libversion; + + ffi.Pointer sqlite3_sourceid() { + _sqlite3_sourceid ??= + _dylib.lookupFunction<_c_sqlite3_sourceid, _dart_sqlite3_sourceid>( + 'sqlite3_sourceid'); + return _sqlite3_sourceid(); + } + + _dart_sqlite3_sourceid _sqlite3_sourceid; + + int sqlite3_libversion_number() { + _sqlite3_libversion_number ??= _dylib.lookupFunction< + _c_sqlite3_libversion_number, + _dart_sqlite3_libversion_number>('sqlite3_libversion_number'); + return _sqlite3_libversion_number(); + } + + _dart_sqlite3_libversion_number _sqlite3_libversion_number; + + int sqlite3_compileoption_used( + ffi.Pointer zOptName, + ) { + _sqlite3_compileoption_used ??= _dylib.lookupFunction< + _c_sqlite3_compileoption_used, + _dart_sqlite3_compileoption_used>('sqlite3_compileoption_used'); + return _sqlite3_compileoption_used( + zOptName, + ); + } + + _dart_sqlite3_compileoption_used _sqlite3_compileoption_used; + + ffi.Pointer sqlite3_compileoption_get( + int N, + ) { + _sqlite3_compileoption_get ??= _dylib.lookupFunction< + _c_sqlite3_compileoption_get, + _dart_sqlite3_compileoption_get>('sqlite3_compileoption_get'); + return _sqlite3_compileoption_get( + N, + ); + } + + _dart_sqlite3_compileoption_get _sqlite3_compileoption_get; + + int sqlite3_threadsafe() { + _sqlite3_threadsafe ??= + _dylib.lookupFunction<_c_sqlite3_threadsafe, _dart_sqlite3_threadsafe>( + 'sqlite3_threadsafe'); + return _sqlite3_threadsafe(); + } + + _dart_sqlite3_threadsafe _sqlite3_threadsafe; + + int sqlite3_close( + ffi.Pointer arg0, + ) { + _sqlite3_close ??= _dylib + .lookupFunction<_c_sqlite3_close, _dart_sqlite3_close>('sqlite3_close'); + return _sqlite3_close( + arg0, + ); + } + + _dart_sqlite3_close _sqlite3_close; + + int sqlite3_close_v2( + ffi.Pointer arg0, + ) { + _sqlite3_close_v2 ??= + _dylib.lookupFunction<_c_sqlite3_close_v2, _dart_sqlite3_close_v2>( + 'sqlite3_close_v2'); + return _sqlite3_close_v2( + arg0, + ); + } + + _dart_sqlite3_close_v2 _sqlite3_close_v2; + + int sqlite3_exec( + ffi.Pointer arg0, + ffi.Pointer sql, + ffi.Pointer> callback, + ffi.Pointer arg3, + ffi.Pointer> errmsg, + ) { + _sqlite3_exec ??= _dylib + .lookupFunction<_c_sqlite3_exec, _dart_sqlite3_exec>('sqlite3_exec'); + return _sqlite3_exec( + arg0, + sql, + callback, + arg3, + errmsg, + ); + } + + _dart_sqlite3_exec _sqlite3_exec; + + int sqlite3_initialize() { + _sqlite3_initialize ??= + _dylib.lookupFunction<_c_sqlite3_initialize, _dart_sqlite3_initialize>( + 'sqlite3_initialize'); + return _sqlite3_initialize(); + } + + _dart_sqlite3_initialize _sqlite3_initialize; + + int sqlite3_shutdown() { + _sqlite3_shutdown ??= + _dylib.lookupFunction<_c_sqlite3_shutdown, _dart_sqlite3_shutdown>( + 'sqlite3_shutdown'); + return _sqlite3_shutdown(); + } + + _dart_sqlite3_shutdown _sqlite3_shutdown; + + int sqlite3_os_init() { + _sqlite3_os_init ??= + _dylib.lookupFunction<_c_sqlite3_os_init, _dart_sqlite3_os_init>( + 'sqlite3_os_init'); + return _sqlite3_os_init(); + } + + _dart_sqlite3_os_init _sqlite3_os_init; + + int sqlite3_os_end() { + _sqlite3_os_end ??= + _dylib.lookupFunction<_c_sqlite3_os_end, _dart_sqlite3_os_end>( + 'sqlite3_os_end'); + return _sqlite3_os_end(); + } + + _dart_sqlite3_os_end _sqlite3_os_end; + + int sqlite3_config( + int arg0, + ) { + _sqlite3_config ??= + _dylib.lookupFunction<_c_sqlite3_config, _dart_sqlite3_config>( + 'sqlite3_config'); + return _sqlite3_config( + arg0, + ); + } + + _dart_sqlite3_config _sqlite3_config; + + int sqlite3_db_config( + ffi.Pointer arg0, + int op, + ) { + _sqlite3_db_config ??= + _dylib.lookupFunction<_c_sqlite3_db_config, _dart_sqlite3_db_config>( + 'sqlite3_db_config'); + return _sqlite3_db_config( + arg0, + op, + ); + } + + _dart_sqlite3_db_config _sqlite3_db_config; + + int sqlite3_extended_result_codes( + ffi.Pointer arg0, + int onoff, + ) { + _sqlite3_extended_result_codes ??= _dylib.lookupFunction< + _c_sqlite3_extended_result_codes, + _dart_sqlite3_extended_result_codes>('sqlite3_extended_result_codes'); + return _sqlite3_extended_result_codes( + arg0, + onoff, + ); + } + + _dart_sqlite3_extended_result_codes _sqlite3_extended_result_codes; + + int sqlite3_last_insert_rowid( + ffi.Pointer arg0, + ) { + _sqlite3_last_insert_rowid ??= _dylib.lookupFunction< + _c_sqlite3_last_insert_rowid, + _dart_sqlite3_last_insert_rowid>('sqlite3_last_insert_rowid'); + return _sqlite3_last_insert_rowid( + arg0, + ); + } + + _dart_sqlite3_last_insert_rowid _sqlite3_last_insert_rowid; + + void sqlite3_set_last_insert_rowid( + ffi.Pointer arg0, + int arg1, + ) { + _sqlite3_set_last_insert_rowid ??= _dylib.lookupFunction< + _c_sqlite3_set_last_insert_rowid, + _dart_sqlite3_set_last_insert_rowid>('sqlite3_set_last_insert_rowid'); + return _sqlite3_set_last_insert_rowid( + arg0, + arg1, + ); + } + + _dart_sqlite3_set_last_insert_rowid _sqlite3_set_last_insert_rowid; + + int sqlite3_changes( + ffi.Pointer arg0, + ) { + _sqlite3_changes ??= + _dylib.lookupFunction<_c_sqlite3_changes, _dart_sqlite3_changes>( + 'sqlite3_changes'); + return _sqlite3_changes( + arg0, + ); + } + + _dart_sqlite3_changes _sqlite3_changes; + + int sqlite3_total_changes( + ffi.Pointer arg0, + ) { + _sqlite3_total_changes ??= _dylib.lookupFunction<_c_sqlite3_total_changes, + _dart_sqlite3_total_changes>('sqlite3_total_changes'); + return _sqlite3_total_changes( + arg0, + ); + } + + _dart_sqlite3_total_changes _sqlite3_total_changes; + + void sqlite3_interrupt( + ffi.Pointer arg0, + ) { + _sqlite3_interrupt ??= + _dylib.lookupFunction<_c_sqlite3_interrupt, _dart_sqlite3_interrupt>( + 'sqlite3_interrupt'); + return _sqlite3_interrupt( + arg0, + ); + } + + _dart_sqlite3_interrupt _sqlite3_interrupt; + + int sqlite3_complete( + ffi.Pointer sql, + ) { + _sqlite3_complete ??= + _dylib.lookupFunction<_c_sqlite3_complete, _dart_sqlite3_complete>( + 'sqlite3_complete'); + return _sqlite3_complete( + sql, + ); + } + + _dart_sqlite3_complete _sqlite3_complete; + + int sqlite3_complete16( + ffi.Pointer sql, + ) { + _sqlite3_complete16 ??= + _dylib.lookupFunction<_c_sqlite3_complete16, _dart_sqlite3_complete16>( + 'sqlite3_complete16'); + return _sqlite3_complete16( + sql, + ); + } + + _dart_sqlite3_complete16 _sqlite3_complete16; + + int sqlite3_busy_handler( + ffi.Pointer arg0, + ffi.Pointer> arg1, + ffi.Pointer arg2, + ) { + _sqlite3_busy_handler ??= _dylib.lookupFunction<_c_sqlite3_busy_handler, + _dart_sqlite3_busy_handler>('sqlite3_busy_handler'); + return _sqlite3_busy_handler( + arg0, + arg1, + arg2, + ); + } + + _dart_sqlite3_busy_handler _sqlite3_busy_handler; + + int sqlite3_busy_timeout( + ffi.Pointer arg0, + int ms, + ) { + _sqlite3_busy_timeout ??= _dylib.lookupFunction<_c_sqlite3_busy_timeout, + _dart_sqlite3_busy_timeout>('sqlite3_busy_timeout'); + return _sqlite3_busy_timeout( + arg0, + ms, + ); + } + + _dart_sqlite3_busy_timeout _sqlite3_busy_timeout; + + int sqlite3_get_table( + ffi.Pointer db, + ffi.Pointer zSql, + ffi.Pointer>> pazResult, + ffi.Pointer pnRow, + ffi.Pointer pnColumn, + ffi.Pointer> pzErrmsg, + ) { + _sqlite3_get_table ??= + _dylib.lookupFunction<_c_sqlite3_get_table, _dart_sqlite3_get_table>( + 'sqlite3_get_table'); + return _sqlite3_get_table( + db, + zSql, + pazResult, + pnRow, + pnColumn, + pzErrmsg, + ); + } + + _dart_sqlite3_get_table _sqlite3_get_table; + + void sqlite3_free_table( + ffi.Pointer> result, + ) { + _sqlite3_free_table ??= + _dylib.lookupFunction<_c_sqlite3_free_table, _dart_sqlite3_free_table>( + 'sqlite3_free_table'); + return _sqlite3_free_table( + result, + ); + } + + _dart_sqlite3_free_table _sqlite3_free_table; + + ffi.Pointer sqlite3_mprintf( + ffi.Pointer arg0, + ) { + _sqlite3_mprintf ??= + _dylib.lookupFunction<_c_sqlite3_mprintf, _dart_sqlite3_mprintf>( + 'sqlite3_mprintf'); + return _sqlite3_mprintf( + arg0, + ); + } + + _dart_sqlite3_mprintf _sqlite3_mprintf; + + ffi.Pointer sqlite3_snprintf( + int arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) { + _sqlite3_snprintf ??= + _dylib.lookupFunction<_c_sqlite3_snprintf, _dart_sqlite3_snprintf>( + 'sqlite3_snprintf'); + return _sqlite3_snprintf( + arg0, + arg1, + arg2, + ); + } + + _dart_sqlite3_snprintf _sqlite3_snprintf; + + ffi.Pointer sqlite3_malloc( + int arg0, + ) { + _sqlite3_malloc ??= + _dylib.lookupFunction<_c_sqlite3_malloc, _dart_sqlite3_malloc>( + 'sqlite3_malloc'); + return _sqlite3_malloc( + arg0, + ); + } + + _dart_sqlite3_malloc _sqlite3_malloc; + + ffi.Pointer sqlite3_malloc64( + int arg0, + ) { + _sqlite3_malloc64 ??= + _dylib.lookupFunction<_c_sqlite3_malloc64, _dart_sqlite3_malloc64>( + 'sqlite3_malloc64'); + return _sqlite3_malloc64( + arg0, + ); + } + + _dart_sqlite3_malloc64 _sqlite3_malloc64; + + ffi.Pointer sqlite3_realloc( + ffi.Pointer arg0, + int arg1, + ) { + _sqlite3_realloc ??= + _dylib.lookupFunction<_c_sqlite3_realloc, _dart_sqlite3_realloc>( + 'sqlite3_realloc'); + return _sqlite3_realloc( + arg0, + arg1, + ); + } + + _dart_sqlite3_realloc _sqlite3_realloc; + + ffi.Pointer sqlite3_realloc64( + ffi.Pointer arg0, + int arg1, + ) { + _sqlite3_realloc64 ??= + _dylib.lookupFunction<_c_sqlite3_realloc64, _dart_sqlite3_realloc64>( + 'sqlite3_realloc64'); + return _sqlite3_realloc64( + arg0, + arg1, + ); + } + + _dart_sqlite3_realloc64 _sqlite3_realloc64; + + void sqlite3_free( + ffi.Pointer arg0, + ) { + _sqlite3_free ??= _dylib + .lookupFunction<_c_sqlite3_free, _dart_sqlite3_free>('sqlite3_free'); + return _sqlite3_free( + arg0, + ); + } + + _dart_sqlite3_free _sqlite3_free; + + int sqlite3_msize( + ffi.Pointer arg0, + ) { + _sqlite3_msize ??= _dylib + .lookupFunction<_c_sqlite3_msize, _dart_sqlite3_msize>('sqlite3_msize'); + return _sqlite3_msize( + arg0, + ); + } + + _dart_sqlite3_msize _sqlite3_msize; + + int sqlite3_memory_used() { + _sqlite3_memory_used ??= _dylib.lookupFunction<_c_sqlite3_memory_used, + _dart_sqlite3_memory_used>('sqlite3_memory_used'); + return _sqlite3_memory_used(); + } + + _dart_sqlite3_memory_used _sqlite3_memory_used; + + int sqlite3_memory_highwater( + int resetFlag, + ) { + _sqlite3_memory_highwater ??= _dylib.lookupFunction< + _c_sqlite3_memory_highwater, + _dart_sqlite3_memory_highwater>('sqlite3_memory_highwater'); + return _sqlite3_memory_highwater( + resetFlag, + ); + } + + _dart_sqlite3_memory_highwater _sqlite3_memory_highwater; + + void sqlite3_randomness( + int N, + ffi.Pointer P, + ) { + _sqlite3_randomness ??= + _dylib.lookupFunction<_c_sqlite3_randomness, _dart_sqlite3_randomness>( + 'sqlite3_randomness'); + return _sqlite3_randomness( + N, + P, + ); + } + + _dart_sqlite3_randomness _sqlite3_randomness; + + int sqlite3_set_authorizer( + ffi.Pointer arg0, + ffi.Pointer> xAuth, + ffi.Pointer pUserData, + ) { + _sqlite3_set_authorizer ??= _dylib.lookupFunction<_c_sqlite3_set_authorizer, + _dart_sqlite3_set_authorizer>('sqlite3_set_authorizer'); + return _sqlite3_set_authorizer( + arg0, + xAuth, + pUserData, + ); + } + + _dart_sqlite3_set_authorizer _sqlite3_set_authorizer; + + ffi.Pointer sqlite3_trace( + ffi.Pointer arg0, + ffi.Pointer> xTrace, + ffi.Pointer arg2, + ) { + _sqlite3_trace ??= _dylib + .lookupFunction<_c_sqlite3_trace, _dart_sqlite3_trace>('sqlite3_trace'); + return _sqlite3_trace( + arg0, + xTrace, + arg2, + ); + } + + _dart_sqlite3_trace _sqlite3_trace; + + ffi.Pointer sqlite3_profile( + ffi.Pointer arg0, + ffi.Pointer> xProfile, + ffi.Pointer arg2, + ) { + _sqlite3_profile ??= + _dylib.lookupFunction<_c_sqlite3_profile, _dart_sqlite3_profile>( + 'sqlite3_profile'); + return _sqlite3_profile( + arg0, + xProfile, + arg2, + ); + } + + _dart_sqlite3_profile _sqlite3_profile; + + int sqlite3_trace_v2( + ffi.Pointer arg0, + int uMask, + ffi.Pointer> xCallback, + ffi.Pointer pCtx, + ) { + _sqlite3_trace_v2 ??= + _dylib.lookupFunction<_c_sqlite3_trace_v2, _dart_sqlite3_trace_v2>( + 'sqlite3_trace_v2'); + return _sqlite3_trace_v2( + arg0, + uMask, + xCallback, + pCtx, + ); + } + + _dart_sqlite3_trace_v2 _sqlite3_trace_v2; + + void sqlite3_progress_handler( + ffi.Pointer arg0, + int arg1, + ffi.Pointer> arg2, + ffi.Pointer arg3, + ) { + _sqlite3_progress_handler ??= _dylib.lookupFunction< + _c_sqlite3_progress_handler, + _dart_sqlite3_progress_handler>('sqlite3_progress_handler'); + return _sqlite3_progress_handler( + arg0, + arg1, + arg2, + arg3, + ); + } + + _dart_sqlite3_progress_handler _sqlite3_progress_handler; + + int sqlite3_open( + ffi.Pointer filename, + ffi.Pointer> ppDb, + ) { + _sqlite3_open ??= _dylib + .lookupFunction<_c_sqlite3_open, _dart_sqlite3_open>('sqlite3_open'); + return _sqlite3_open( + filename, + ppDb, + ); + } + + _dart_sqlite3_open _sqlite3_open; + + int sqlite3_open16( + ffi.Pointer filename, + ffi.Pointer> ppDb, + ) { + _sqlite3_open16 ??= + _dylib.lookupFunction<_c_sqlite3_open16, _dart_sqlite3_open16>( + 'sqlite3_open16'); + return _sqlite3_open16( + filename, + ppDb, + ); + } + + _dart_sqlite3_open16 _sqlite3_open16; + + int sqlite3_open_v2( + ffi.Pointer filename, + ffi.Pointer> ppDb, + int flags, + ffi.Pointer zVfs, + ) { + _sqlite3_open_v2 ??= + _dylib.lookupFunction<_c_sqlite3_open_v2, _dart_sqlite3_open_v2>( + 'sqlite3_open_v2'); + return _sqlite3_open_v2( + filename, + ppDb, + flags, + zVfs, + ); + } + + _dart_sqlite3_open_v2 _sqlite3_open_v2; + + ffi.Pointer sqlite3_uri_parameter( + ffi.Pointer zFilename, + ffi.Pointer zParam, + ) { + _sqlite3_uri_parameter ??= _dylib.lookupFunction<_c_sqlite3_uri_parameter, + _dart_sqlite3_uri_parameter>('sqlite3_uri_parameter'); + return _sqlite3_uri_parameter( + zFilename, + zParam, + ); + } + + _dart_sqlite3_uri_parameter _sqlite3_uri_parameter; + + int sqlite3_uri_boolean( + ffi.Pointer zFile, + ffi.Pointer zParam, + int bDefault, + ) { + _sqlite3_uri_boolean ??= _dylib.lookupFunction<_c_sqlite3_uri_boolean, + _dart_sqlite3_uri_boolean>('sqlite3_uri_boolean'); + return _sqlite3_uri_boolean( + zFile, + zParam, + bDefault, + ); + } + + _dart_sqlite3_uri_boolean _sqlite3_uri_boolean; + + int sqlite3_uri_int64( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, + ) { + _sqlite3_uri_int64 ??= + _dylib.lookupFunction<_c_sqlite3_uri_int64, _dart_sqlite3_uri_int64>( + 'sqlite3_uri_int64'); + return _sqlite3_uri_int64( + arg0, + arg1, + arg2, + ); + } + + _dart_sqlite3_uri_int64 _sqlite3_uri_int64; + + ffi.Pointer sqlite3_uri_key( + ffi.Pointer zFilename, + int N, + ) { + _sqlite3_uri_key ??= + _dylib.lookupFunction<_c_sqlite3_uri_key, _dart_sqlite3_uri_key>( + 'sqlite3_uri_key'); + return _sqlite3_uri_key( + zFilename, + N, + ); + } + + _dart_sqlite3_uri_key _sqlite3_uri_key; + + ffi.Pointer sqlite3_filename_database( + ffi.Pointer arg0, + ) { + _sqlite3_filename_database ??= _dylib.lookupFunction< + _c_sqlite3_filename_database, + _dart_sqlite3_filename_database>('sqlite3_filename_database'); + return _sqlite3_filename_database( + arg0, + ); + } + + _dart_sqlite3_filename_database _sqlite3_filename_database; + + ffi.Pointer sqlite3_filename_journal( + ffi.Pointer arg0, + ) { + _sqlite3_filename_journal ??= _dylib.lookupFunction< + _c_sqlite3_filename_journal, + _dart_sqlite3_filename_journal>('sqlite3_filename_journal'); + return _sqlite3_filename_journal( + arg0, + ); + } + + _dart_sqlite3_filename_journal _sqlite3_filename_journal; + + ffi.Pointer sqlite3_filename_wal( + ffi.Pointer arg0, + ) { + _sqlite3_filename_wal ??= _dylib.lookupFunction<_c_sqlite3_filename_wal, + _dart_sqlite3_filename_wal>('sqlite3_filename_wal'); + return _sqlite3_filename_wal( + arg0, + ); + } + + _dart_sqlite3_filename_wal _sqlite3_filename_wal; + + ffi.Pointer sqlite3_database_file_object( + ffi.Pointer arg0, + ) { + _sqlite3_database_file_object ??= _dylib.lookupFunction< + _c_sqlite3_database_file_object, + _dart_sqlite3_database_file_object>('sqlite3_database_file_object'); + return _sqlite3_database_file_object( + arg0, + ); + } + + _dart_sqlite3_database_file_object _sqlite3_database_file_object; + + ffi.Pointer sqlite3_create_filename( + ffi.Pointer zDatabase, + ffi.Pointer zJournal, + ffi.Pointer zWal, + int nParam, + ffi.Pointer> azParam, + ) { + _sqlite3_create_filename ??= _dylib.lookupFunction< + _c_sqlite3_create_filename, + _dart_sqlite3_create_filename>('sqlite3_create_filename'); + return _sqlite3_create_filename( + zDatabase, + zJournal, + zWal, + nParam, + azParam, + ); + } + + _dart_sqlite3_create_filename _sqlite3_create_filename; + + void sqlite3_free_filename( + ffi.Pointer arg0, + ) { + _sqlite3_free_filename ??= _dylib.lookupFunction<_c_sqlite3_free_filename, + _dart_sqlite3_free_filename>('sqlite3_free_filename'); + return _sqlite3_free_filename( + arg0, + ); + } + + _dart_sqlite3_free_filename _sqlite3_free_filename; + + int sqlite3_errcode( + ffi.Pointer db, + ) { + _sqlite3_errcode ??= + _dylib.lookupFunction<_c_sqlite3_errcode, _dart_sqlite3_errcode>( + 'sqlite3_errcode'); + return _sqlite3_errcode( + db, + ); + } + + _dart_sqlite3_errcode _sqlite3_errcode; + + int sqlite3_extended_errcode( + ffi.Pointer db, + ) { + _sqlite3_extended_errcode ??= _dylib.lookupFunction< + _c_sqlite3_extended_errcode, + _dart_sqlite3_extended_errcode>('sqlite3_extended_errcode'); + return _sqlite3_extended_errcode( + db, + ); + } + + _dart_sqlite3_extended_errcode _sqlite3_extended_errcode; + + ffi.Pointer sqlite3_errmsg( + ffi.Pointer arg0, + ) { + _sqlite3_errmsg ??= + _dylib.lookupFunction<_c_sqlite3_errmsg, _dart_sqlite3_errmsg>( + 'sqlite3_errmsg'); + return _sqlite3_errmsg( + arg0, + ); + } + + _dart_sqlite3_errmsg _sqlite3_errmsg; + + ffi.Pointer sqlite3_errmsg16( + ffi.Pointer arg0, + ) { + _sqlite3_errmsg16 ??= + _dylib.lookupFunction<_c_sqlite3_errmsg16, _dart_sqlite3_errmsg16>( + 'sqlite3_errmsg16'); + return _sqlite3_errmsg16( + arg0, + ); + } + + _dart_sqlite3_errmsg16 _sqlite3_errmsg16; + + ffi.Pointer sqlite3_errstr( + int arg0, + ) { + _sqlite3_errstr ??= + _dylib.lookupFunction<_c_sqlite3_errstr, _dart_sqlite3_errstr>( + 'sqlite3_errstr'); + return _sqlite3_errstr( + arg0, + ); + } + + _dart_sqlite3_errstr _sqlite3_errstr; + + int sqlite3_limit( + ffi.Pointer arg0, + int id, + int newVal, + ) { + _sqlite3_limit ??= _dylib + .lookupFunction<_c_sqlite3_limit, _dart_sqlite3_limit>('sqlite3_limit'); + return _sqlite3_limit( + arg0, + id, + newVal, + ); + } + + _dart_sqlite3_limit _sqlite3_limit; + + int sqlite3_prepare( + ffi.Pointer db, + ffi.Pointer zSql, + int nByte, + ffi.Pointer> ppStmt, + ffi.Pointer> pzTail, + ) { + _sqlite3_prepare ??= + _dylib.lookupFunction<_c_sqlite3_prepare, _dart_sqlite3_prepare>( + 'sqlite3_prepare'); + return _sqlite3_prepare( + db, + zSql, + nByte, + ppStmt, + pzTail, + ); + } + + _dart_sqlite3_prepare _sqlite3_prepare; + + int sqlite3_prepare_v2( + ffi.Pointer db, + ffi.Pointer zSql, + int nByte, + ffi.Pointer> ppStmt, + ffi.Pointer> pzTail, + ) { + _sqlite3_prepare_v2 ??= + _dylib.lookupFunction<_c_sqlite3_prepare_v2, _dart_sqlite3_prepare_v2>( + 'sqlite3_prepare_v2'); + return _sqlite3_prepare_v2( + db, + zSql, + nByte, + ppStmt, + pzTail, + ); + } + + _dart_sqlite3_prepare_v2 _sqlite3_prepare_v2; + + int sqlite3_prepare_v3( + ffi.Pointer db, + ffi.Pointer zSql, + int nByte, + int prepFlags, + ffi.Pointer> ppStmt, + ffi.Pointer> pzTail, + ) { + _sqlite3_prepare_v3 ??= + _dylib.lookupFunction<_c_sqlite3_prepare_v3, _dart_sqlite3_prepare_v3>( + 'sqlite3_prepare_v3'); + return _sqlite3_prepare_v3( + db, + zSql, + nByte, + prepFlags, + ppStmt, + pzTail, + ); + } + + _dart_sqlite3_prepare_v3 _sqlite3_prepare_v3; + + int sqlite3_prepare16( + ffi.Pointer db, + ffi.Pointer zSql, + int nByte, + ffi.Pointer> ppStmt, + ffi.Pointer> pzTail, + ) { + _sqlite3_prepare16 ??= + _dylib.lookupFunction<_c_sqlite3_prepare16, _dart_sqlite3_prepare16>( + 'sqlite3_prepare16'); + return _sqlite3_prepare16( + db, + zSql, + nByte, + ppStmt, + pzTail, + ); + } + + _dart_sqlite3_prepare16 _sqlite3_prepare16; + + int sqlite3_prepare16_v2( + ffi.Pointer db, + ffi.Pointer zSql, + int nByte, + ffi.Pointer> ppStmt, + ffi.Pointer> pzTail, + ) { + _sqlite3_prepare16_v2 ??= _dylib.lookupFunction<_c_sqlite3_prepare16_v2, + _dart_sqlite3_prepare16_v2>('sqlite3_prepare16_v2'); + return _sqlite3_prepare16_v2( + db, + zSql, + nByte, + ppStmt, + pzTail, + ); + } + + _dart_sqlite3_prepare16_v2 _sqlite3_prepare16_v2; + + int sqlite3_prepare16_v3( + ffi.Pointer db, + ffi.Pointer zSql, + int nByte, + int prepFlags, + ffi.Pointer> ppStmt, + ffi.Pointer> pzTail, + ) { + _sqlite3_prepare16_v3 ??= _dylib.lookupFunction<_c_sqlite3_prepare16_v3, + _dart_sqlite3_prepare16_v3>('sqlite3_prepare16_v3'); + return _sqlite3_prepare16_v3( + db, + zSql, + nByte, + prepFlags, + ppStmt, + pzTail, + ); + } + + _dart_sqlite3_prepare16_v3 _sqlite3_prepare16_v3; + + ffi.Pointer sqlite3_sql( + ffi.Pointer pStmt, + ) { + _sqlite3_sql ??= + _dylib.lookupFunction<_c_sqlite3_sql, _dart_sqlite3_sql>('sqlite3_sql'); + return _sqlite3_sql( + pStmt, + ); + } + + _dart_sqlite3_sql _sqlite3_sql; + + ffi.Pointer sqlite3_expanded_sql( + ffi.Pointer pStmt, + ) { + _sqlite3_expanded_sql ??= _dylib.lookupFunction<_c_sqlite3_expanded_sql, + _dart_sqlite3_expanded_sql>('sqlite3_expanded_sql'); + return _sqlite3_expanded_sql( + pStmt, + ); + } + + _dart_sqlite3_expanded_sql _sqlite3_expanded_sql; + + ffi.Pointer sqlite3_normalized_sql( + ffi.Pointer pStmt, + ) { + _sqlite3_normalized_sql ??= _dylib.lookupFunction<_c_sqlite3_normalized_sql, + _dart_sqlite3_normalized_sql>('sqlite3_normalized_sql'); + return _sqlite3_normalized_sql( + pStmt, + ); + } + + _dart_sqlite3_normalized_sql _sqlite3_normalized_sql; + + int sqlite3_stmt_readonly( + ffi.Pointer pStmt, + ) { + _sqlite3_stmt_readonly ??= _dylib.lookupFunction<_c_sqlite3_stmt_readonly, + _dart_sqlite3_stmt_readonly>('sqlite3_stmt_readonly'); + return _sqlite3_stmt_readonly( + pStmt, + ); + } + + _dart_sqlite3_stmt_readonly _sqlite3_stmt_readonly; + + int sqlite3_stmt_isexplain( + ffi.Pointer pStmt, + ) { + _sqlite3_stmt_isexplain ??= _dylib.lookupFunction<_c_sqlite3_stmt_isexplain, + _dart_sqlite3_stmt_isexplain>('sqlite3_stmt_isexplain'); + return _sqlite3_stmt_isexplain( + pStmt, + ); + } + + _dart_sqlite3_stmt_isexplain _sqlite3_stmt_isexplain; + + int sqlite3_stmt_busy( + ffi.Pointer arg0, + ) { + _sqlite3_stmt_busy ??= + _dylib.lookupFunction<_c_sqlite3_stmt_busy, _dart_sqlite3_stmt_busy>( + 'sqlite3_stmt_busy'); + return _sqlite3_stmt_busy( + arg0, + ); + } + + _dart_sqlite3_stmt_busy _sqlite3_stmt_busy; + + int sqlite3_bind_blob( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, + int n, + ffi.Pointer> arg4, + ) { + _sqlite3_bind_blob ??= + _dylib.lookupFunction<_c_sqlite3_bind_blob, _dart_sqlite3_bind_blob>( + 'sqlite3_bind_blob'); + return _sqlite3_bind_blob( + arg0, + arg1, + arg2, + n, + arg4, + ); + } + + _dart_sqlite3_bind_blob _sqlite3_bind_blob; + + int sqlite3_bind_blob64( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer> arg4, + ) { + _sqlite3_bind_blob64 ??= _dylib.lookupFunction<_c_sqlite3_bind_blob64, + _dart_sqlite3_bind_blob64>('sqlite3_bind_blob64'); + return _sqlite3_bind_blob64( + arg0, + arg1, + arg2, + arg3, + arg4, + ); + } + + _dart_sqlite3_bind_blob64 _sqlite3_bind_blob64; + + int sqlite3_bind_double( + ffi.Pointer arg0, + int arg1, + double arg2, + ) { + _sqlite3_bind_double ??= _dylib.lookupFunction<_c_sqlite3_bind_double, + _dart_sqlite3_bind_double>('sqlite3_bind_double'); + return _sqlite3_bind_double( + arg0, + arg1, + arg2, + ); + } + + _dart_sqlite3_bind_double _sqlite3_bind_double; + + int sqlite3_bind_int( + ffi.Pointer arg0, + int arg1, + int arg2, + ) { + _sqlite3_bind_int ??= + _dylib.lookupFunction<_c_sqlite3_bind_int, _dart_sqlite3_bind_int>( + 'sqlite3_bind_int'); + return _sqlite3_bind_int( + arg0, + arg1, + arg2, + ); + } + + _dart_sqlite3_bind_int _sqlite3_bind_int; + + int sqlite3_bind_int64( + ffi.Pointer arg0, + int arg1, + int arg2, + ) { + _sqlite3_bind_int64 ??= + _dylib.lookupFunction<_c_sqlite3_bind_int64, _dart_sqlite3_bind_int64>( + 'sqlite3_bind_int64'); + return _sqlite3_bind_int64( + arg0, + arg1, + arg2, + ); + } + + _dart_sqlite3_bind_int64 _sqlite3_bind_int64; + + int sqlite3_bind_null( + ffi.Pointer arg0, + int arg1, + ) { + _sqlite3_bind_null ??= + _dylib.lookupFunction<_c_sqlite3_bind_null, _dart_sqlite3_bind_null>( + 'sqlite3_bind_null'); + return _sqlite3_bind_null( + arg0, + arg1, + ); + } + + _dart_sqlite3_bind_null _sqlite3_bind_null; + + int sqlite3_bind_text( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer> arg4, + ) { + _sqlite3_bind_text ??= + _dylib.lookupFunction<_c_sqlite3_bind_text, _dart_sqlite3_bind_text>( + 'sqlite3_bind_text'); + return _sqlite3_bind_text( + arg0, + arg1, + arg2, + arg3, + arg4, + ); + } + + _dart_sqlite3_bind_text _sqlite3_bind_text; + + int sqlite3_bind_text16( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer> arg4, + ) { + _sqlite3_bind_text16 ??= _dylib.lookupFunction<_c_sqlite3_bind_text16, + _dart_sqlite3_bind_text16>('sqlite3_bind_text16'); + return _sqlite3_bind_text16( + arg0, + arg1, + arg2, + arg3, + arg4, + ); + } + + _dart_sqlite3_bind_text16 _sqlite3_bind_text16; + + int sqlite3_bind_text64( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer> arg4, + int encoding, + ) { + _sqlite3_bind_text64 ??= _dylib.lookupFunction<_c_sqlite3_bind_text64, + _dart_sqlite3_bind_text64>('sqlite3_bind_text64'); + return _sqlite3_bind_text64( + arg0, + arg1, + arg2, + arg3, + arg4, + encoding, + ); + } + + _dart_sqlite3_bind_text64 _sqlite3_bind_text64; + + int sqlite3_bind_value( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, + ) { + _sqlite3_bind_value ??= + _dylib.lookupFunction<_c_sqlite3_bind_value, _dart_sqlite3_bind_value>( + 'sqlite3_bind_value'); + return _sqlite3_bind_value( + arg0, + arg1, + arg2, + ); + } + + _dart_sqlite3_bind_value _sqlite3_bind_value; + + int sqlite3_bind_pointer( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer> arg4, + ) { + _sqlite3_bind_pointer ??= _dylib.lookupFunction<_c_sqlite3_bind_pointer, + _dart_sqlite3_bind_pointer>('sqlite3_bind_pointer'); + return _sqlite3_bind_pointer( + arg0, + arg1, + arg2, + arg3, + arg4, + ); + } + + _dart_sqlite3_bind_pointer _sqlite3_bind_pointer; + + int sqlite3_bind_zeroblob( + ffi.Pointer arg0, + int arg1, + int n, + ) { + _sqlite3_bind_zeroblob ??= _dylib.lookupFunction<_c_sqlite3_bind_zeroblob, + _dart_sqlite3_bind_zeroblob>('sqlite3_bind_zeroblob'); + return _sqlite3_bind_zeroblob( + arg0, + arg1, + n, + ); + } + + _dart_sqlite3_bind_zeroblob _sqlite3_bind_zeroblob; + + int sqlite3_bind_zeroblob64( + ffi.Pointer arg0, + int arg1, + int arg2, + ) { + _sqlite3_bind_zeroblob64 ??= _dylib.lookupFunction< + _c_sqlite3_bind_zeroblob64, + _dart_sqlite3_bind_zeroblob64>('sqlite3_bind_zeroblob64'); + return _sqlite3_bind_zeroblob64( + arg0, + arg1, + arg2, + ); + } + + _dart_sqlite3_bind_zeroblob64 _sqlite3_bind_zeroblob64; + + int sqlite3_bind_parameter_count( + ffi.Pointer arg0, + ) { + _sqlite3_bind_parameter_count ??= _dylib.lookupFunction< + _c_sqlite3_bind_parameter_count, + _dart_sqlite3_bind_parameter_count>('sqlite3_bind_parameter_count'); + return _sqlite3_bind_parameter_count( + arg0, + ); + } + + _dart_sqlite3_bind_parameter_count _sqlite3_bind_parameter_count; + + ffi.Pointer sqlite3_bind_parameter_name( + ffi.Pointer arg0, + int arg1, + ) { + _sqlite3_bind_parameter_name ??= _dylib.lookupFunction< + _c_sqlite3_bind_parameter_name, + _dart_sqlite3_bind_parameter_name>('sqlite3_bind_parameter_name'); + return _sqlite3_bind_parameter_name( + arg0, + arg1, + ); + } + + _dart_sqlite3_bind_parameter_name _sqlite3_bind_parameter_name; + + int sqlite3_bind_parameter_index( + ffi.Pointer arg0, + ffi.Pointer zName, + ) { + _sqlite3_bind_parameter_index ??= _dylib.lookupFunction< + _c_sqlite3_bind_parameter_index, + _dart_sqlite3_bind_parameter_index>('sqlite3_bind_parameter_index'); + return _sqlite3_bind_parameter_index( + arg0, + zName, + ); + } + + _dart_sqlite3_bind_parameter_index _sqlite3_bind_parameter_index; + + int sqlite3_clear_bindings( + ffi.Pointer arg0, + ) { + _sqlite3_clear_bindings ??= _dylib.lookupFunction<_c_sqlite3_clear_bindings, + _dart_sqlite3_clear_bindings>('sqlite3_clear_bindings'); + return _sqlite3_clear_bindings( + arg0, + ); + } + + _dart_sqlite3_clear_bindings _sqlite3_clear_bindings; + + int sqlite3_column_count( + ffi.Pointer pStmt, + ) { + _sqlite3_column_count ??= _dylib.lookupFunction<_c_sqlite3_column_count, + _dart_sqlite3_column_count>('sqlite3_column_count'); + return _sqlite3_column_count( + pStmt, + ); + } + + _dart_sqlite3_column_count _sqlite3_column_count; + + ffi.Pointer sqlite3_column_name( + ffi.Pointer arg0, + int N, + ) { + _sqlite3_column_name ??= _dylib.lookupFunction<_c_sqlite3_column_name, + _dart_sqlite3_column_name>('sqlite3_column_name'); + return _sqlite3_column_name( + arg0, + N, + ); + } + + _dart_sqlite3_column_name _sqlite3_column_name; + + ffi.Pointer sqlite3_column_name16( + ffi.Pointer arg0, + int N, + ) { + _sqlite3_column_name16 ??= _dylib.lookupFunction<_c_sqlite3_column_name16, + _dart_sqlite3_column_name16>('sqlite3_column_name16'); + return _sqlite3_column_name16( + arg0, + N, + ); + } + + _dart_sqlite3_column_name16 _sqlite3_column_name16; + + ffi.Pointer sqlite3_column_database_name( + ffi.Pointer arg0, + int arg1, + ) { + _sqlite3_column_database_name ??= _dylib.lookupFunction< + _c_sqlite3_column_database_name, + _dart_sqlite3_column_database_name>('sqlite3_column_database_name'); + return _sqlite3_column_database_name( + arg0, + arg1, + ); + } + + _dart_sqlite3_column_database_name _sqlite3_column_database_name; + + ffi.Pointer sqlite3_column_database_name16( + ffi.Pointer arg0, + int arg1, + ) { + _sqlite3_column_database_name16 ??= _dylib.lookupFunction< + _c_sqlite3_column_database_name16, + _dart_sqlite3_column_database_name16>('sqlite3_column_database_name16'); + return _sqlite3_column_database_name16( + arg0, + arg1, + ); + } + + _dart_sqlite3_column_database_name16 _sqlite3_column_database_name16; + + ffi.Pointer sqlite3_column_table_name( + ffi.Pointer arg0, + int arg1, + ) { + _sqlite3_column_table_name ??= _dylib.lookupFunction< + _c_sqlite3_column_table_name, + _dart_sqlite3_column_table_name>('sqlite3_column_table_name'); + return _sqlite3_column_table_name( + arg0, + arg1, + ); + } + + _dart_sqlite3_column_table_name _sqlite3_column_table_name; + + ffi.Pointer sqlite3_column_table_name16( + ffi.Pointer arg0, + int arg1, + ) { + _sqlite3_column_table_name16 ??= _dylib.lookupFunction< + _c_sqlite3_column_table_name16, + _dart_sqlite3_column_table_name16>('sqlite3_column_table_name16'); + return _sqlite3_column_table_name16( + arg0, + arg1, + ); + } + + _dart_sqlite3_column_table_name16 _sqlite3_column_table_name16; + + ffi.Pointer sqlite3_column_origin_name( + ffi.Pointer arg0, + int arg1, + ) { + _sqlite3_column_origin_name ??= _dylib.lookupFunction< + _c_sqlite3_column_origin_name, + _dart_sqlite3_column_origin_name>('sqlite3_column_origin_name'); + return _sqlite3_column_origin_name( + arg0, + arg1, + ); + } + + _dart_sqlite3_column_origin_name _sqlite3_column_origin_name; + + ffi.Pointer sqlite3_column_origin_name16( + ffi.Pointer arg0, + int arg1, + ) { + _sqlite3_column_origin_name16 ??= _dylib.lookupFunction< + _c_sqlite3_column_origin_name16, + _dart_sqlite3_column_origin_name16>('sqlite3_column_origin_name16'); + return _sqlite3_column_origin_name16( + arg0, + arg1, + ); + } + + _dart_sqlite3_column_origin_name16 _sqlite3_column_origin_name16; + + ffi.Pointer sqlite3_column_decltype( + ffi.Pointer arg0, + int arg1, + ) { + _sqlite3_column_decltype ??= _dylib.lookupFunction< + _c_sqlite3_column_decltype, + _dart_sqlite3_column_decltype>('sqlite3_column_decltype'); + return _sqlite3_column_decltype( + arg0, + arg1, + ); + } + + _dart_sqlite3_column_decltype _sqlite3_column_decltype; + + ffi.Pointer sqlite3_column_decltype16( + ffi.Pointer arg0, + int arg1, + ) { + _sqlite3_column_decltype16 ??= _dylib.lookupFunction< + _c_sqlite3_column_decltype16, + _dart_sqlite3_column_decltype16>('sqlite3_column_decltype16'); + return _sqlite3_column_decltype16( + arg0, + arg1, + ); + } + + _dart_sqlite3_column_decltype16 _sqlite3_column_decltype16; + + int sqlite3_step( + ffi.Pointer arg0, + ) { + _sqlite3_step ??= _dylib + .lookupFunction<_c_sqlite3_step, _dart_sqlite3_step>('sqlite3_step'); + return _sqlite3_step( + arg0, + ); + } + + _dart_sqlite3_step _sqlite3_step; + + int sqlite3_data_count( + ffi.Pointer pStmt, + ) { + _sqlite3_data_count ??= + _dylib.lookupFunction<_c_sqlite3_data_count, _dart_sqlite3_data_count>( + 'sqlite3_data_count'); + return _sqlite3_data_count( + pStmt, + ); + } + + _dart_sqlite3_data_count _sqlite3_data_count; + + ffi.Pointer sqlite3_column_blob( + ffi.Pointer arg0, + int iCol, + ) { + _sqlite3_column_blob ??= _dylib.lookupFunction<_c_sqlite3_column_blob, + _dart_sqlite3_column_blob>('sqlite3_column_blob'); + return _sqlite3_column_blob( + arg0, + iCol, + ); + } + + _dart_sqlite3_column_blob _sqlite3_column_blob; + + double sqlite3_column_double( + ffi.Pointer arg0, + int iCol, + ) { + _sqlite3_column_double ??= _dylib.lookupFunction<_c_sqlite3_column_double, + _dart_sqlite3_column_double>('sqlite3_column_double'); + return _sqlite3_column_double( + arg0, + iCol, + ); + } + + _dart_sqlite3_column_double _sqlite3_column_double; + + int sqlite3_column_int( + ffi.Pointer arg0, + int iCol, + ) { + _sqlite3_column_int ??= + _dylib.lookupFunction<_c_sqlite3_column_int, _dart_sqlite3_column_int>( + 'sqlite3_column_int'); + return _sqlite3_column_int( + arg0, + iCol, + ); + } + + _dart_sqlite3_column_int _sqlite3_column_int; + + int sqlite3_column_int64( + ffi.Pointer arg0, + int iCol, + ) { + _sqlite3_column_int64 ??= _dylib.lookupFunction<_c_sqlite3_column_int64, + _dart_sqlite3_column_int64>('sqlite3_column_int64'); + return _sqlite3_column_int64( + arg0, + iCol, + ); + } + + _dart_sqlite3_column_int64 _sqlite3_column_int64; + + ffi.Pointer sqlite3_column_text( + ffi.Pointer arg0, + int iCol, + ) { + _sqlite3_column_text ??= _dylib.lookupFunction<_c_sqlite3_column_text, + _dart_sqlite3_column_text>('sqlite3_column_text'); + return _sqlite3_column_text( + arg0, + iCol, + ); + } + + _dart_sqlite3_column_text _sqlite3_column_text; + + ffi.Pointer sqlite3_column_text16( + ffi.Pointer arg0, + int iCol, + ) { + _sqlite3_column_text16 ??= _dylib.lookupFunction<_c_sqlite3_column_text16, + _dart_sqlite3_column_text16>('sqlite3_column_text16'); + return _sqlite3_column_text16( + arg0, + iCol, + ); + } + + _dart_sqlite3_column_text16 _sqlite3_column_text16; + + ffi.Pointer sqlite3_column_value( + ffi.Pointer arg0, + int iCol, + ) { + _sqlite3_column_value ??= _dylib.lookupFunction<_c_sqlite3_column_value, + _dart_sqlite3_column_value>('sqlite3_column_value'); + return _sqlite3_column_value( + arg0, + iCol, + ); + } + + _dart_sqlite3_column_value _sqlite3_column_value; + + int sqlite3_column_bytes( + ffi.Pointer arg0, + int iCol, + ) { + _sqlite3_column_bytes ??= _dylib.lookupFunction<_c_sqlite3_column_bytes, + _dart_sqlite3_column_bytes>('sqlite3_column_bytes'); + return _sqlite3_column_bytes( + arg0, + iCol, + ); + } + + _dart_sqlite3_column_bytes _sqlite3_column_bytes; + + int sqlite3_column_bytes16( + ffi.Pointer arg0, + int iCol, + ) { + _sqlite3_column_bytes16 ??= _dylib.lookupFunction<_c_sqlite3_column_bytes16, + _dart_sqlite3_column_bytes16>('sqlite3_column_bytes16'); + return _sqlite3_column_bytes16( + arg0, + iCol, + ); + } + + _dart_sqlite3_column_bytes16 _sqlite3_column_bytes16; + + int sqlite3_column_type( + ffi.Pointer arg0, + int iCol, + ) { + _sqlite3_column_type ??= _dylib.lookupFunction<_c_sqlite3_column_type, + _dart_sqlite3_column_type>('sqlite3_column_type'); + return _sqlite3_column_type( + arg0, + iCol, + ); + } + + _dart_sqlite3_column_type _sqlite3_column_type; + + int sqlite3_finalize( + ffi.Pointer pStmt, + ) { + _sqlite3_finalize ??= + _dylib.lookupFunction<_c_sqlite3_finalize, _dart_sqlite3_finalize>( + 'sqlite3_finalize'); + return _sqlite3_finalize( + pStmt, + ); + } + + _dart_sqlite3_finalize _sqlite3_finalize; + + int sqlite3_reset( + ffi.Pointer pStmt, + ) { + _sqlite3_reset ??= _dylib + .lookupFunction<_c_sqlite3_reset, _dart_sqlite3_reset>('sqlite3_reset'); + return _sqlite3_reset( + pStmt, + ); + } + + _dart_sqlite3_reset _sqlite3_reset; + + int sqlite3_create_function( + ffi.Pointer db, + ffi.Pointer zFunctionName, + int nArg, + int eTextRep, + ffi.Pointer pApp, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, + ) { + _sqlite3_create_function ??= _dylib.lookupFunction< + _c_sqlite3_create_function, + _dart_sqlite3_create_function>('sqlite3_create_function'); + return _sqlite3_create_function( + db, + zFunctionName, + nArg, + eTextRep, + pApp, + xFunc, + xStep, + xFinal, + ); + } + + _dart_sqlite3_create_function _sqlite3_create_function; + + int sqlite3_create_function16( + ffi.Pointer db, + ffi.Pointer zFunctionName, + int nArg, + int eTextRep, + ffi.Pointer pApp, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, + ) { + _sqlite3_create_function16 ??= _dylib.lookupFunction< + _c_sqlite3_create_function16, + _dart_sqlite3_create_function16>('sqlite3_create_function16'); + return _sqlite3_create_function16( + db, + zFunctionName, + nArg, + eTextRep, + pApp, + xFunc, + xStep, + xFinal, + ); + } + + _dart_sqlite3_create_function16 _sqlite3_create_function16; + + int sqlite3_create_function_v2( + ffi.Pointer db, + ffi.Pointer zFunctionName, + int nArg, + int eTextRep, + ffi.Pointer pApp, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, + ffi.Pointer> xDestroy, + ) { + _sqlite3_create_function_v2 ??= _dylib.lookupFunction< + _c_sqlite3_create_function_v2, + _dart_sqlite3_create_function_v2>('sqlite3_create_function_v2'); + return _sqlite3_create_function_v2( + db, + zFunctionName, + nArg, + eTextRep, + pApp, + xFunc, + xStep, + xFinal, + xDestroy, + ); + } + + _dart_sqlite3_create_function_v2 _sqlite3_create_function_v2; + + int sqlite3_create_window_function( + ffi.Pointer db, + ffi.Pointer zFunctionName, + int nArg, + int eTextRep, + ffi.Pointer pApp, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, + ffi.Pointer> xValue, + ffi.Pointer> xInverse, + ffi.Pointer> xDestroy, + ) { + _sqlite3_create_window_function ??= _dylib.lookupFunction< + _c_sqlite3_create_window_function, + _dart_sqlite3_create_window_function>('sqlite3_create_window_function'); + return _sqlite3_create_window_function( + db, + zFunctionName, + nArg, + eTextRep, + pApp, + xStep, + xFinal, + xValue, + xInverse, + xDestroy, + ); + } + + _dart_sqlite3_create_window_function _sqlite3_create_window_function; + + int sqlite3_aggregate_count( + ffi.Pointer arg0, + ) { + _sqlite3_aggregate_count ??= _dylib.lookupFunction< + _c_sqlite3_aggregate_count, + _dart_sqlite3_aggregate_count>('sqlite3_aggregate_count'); + return _sqlite3_aggregate_count( + arg0, + ); + } + + _dart_sqlite3_aggregate_count _sqlite3_aggregate_count; + + int sqlite3_expired( + ffi.Pointer arg0, + ) { + _sqlite3_expired ??= + _dylib.lookupFunction<_c_sqlite3_expired, _dart_sqlite3_expired>( + 'sqlite3_expired'); + return _sqlite3_expired( + arg0, + ); + } + + _dart_sqlite3_expired _sqlite3_expired; + + int sqlite3_transfer_bindings( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + _sqlite3_transfer_bindings ??= _dylib.lookupFunction< + _c_sqlite3_transfer_bindings, + _dart_sqlite3_transfer_bindings>('sqlite3_transfer_bindings'); + return _sqlite3_transfer_bindings( + arg0, + arg1, + ); + } + + _dart_sqlite3_transfer_bindings _sqlite3_transfer_bindings; + + int sqlite3_global_recover() { + _sqlite3_global_recover ??= _dylib.lookupFunction<_c_sqlite3_global_recover, + _dart_sqlite3_global_recover>('sqlite3_global_recover'); + return _sqlite3_global_recover(); + } + + _dart_sqlite3_global_recover _sqlite3_global_recover; + + void sqlite3_thread_cleanup() { + _sqlite3_thread_cleanup ??= _dylib.lookupFunction<_c_sqlite3_thread_cleanup, + _dart_sqlite3_thread_cleanup>('sqlite3_thread_cleanup'); + return _sqlite3_thread_cleanup(); + } + + _dart_sqlite3_thread_cleanup _sqlite3_thread_cleanup; + + int sqlite3_memory_alarm( + ffi.Pointer> arg0, + ffi.Pointer arg1, + int arg2, + ) { + _sqlite3_memory_alarm ??= _dylib.lookupFunction<_c_sqlite3_memory_alarm, + _dart_sqlite3_memory_alarm>('sqlite3_memory_alarm'); + return _sqlite3_memory_alarm( + arg0, + arg1, + arg2, + ); + } + + _dart_sqlite3_memory_alarm _sqlite3_memory_alarm; + + ffi.Pointer sqlite3_value_blob( + ffi.Pointer arg0, + ) { + _sqlite3_value_blob ??= + _dylib.lookupFunction<_c_sqlite3_value_blob, _dart_sqlite3_value_blob>( + 'sqlite3_value_blob'); + return _sqlite3_value_blob( + arg0, + ); + } + + _dart_sqlite3_value_blob _sqlite3_value_blob; + + double sqlite3_value_double( + ffi.Pointer arg0, + ) { + _sqlite3_value_double ??= _dylib.lookupFunction<_c_sqlite3_value_double, + _dart_sqlite3_value_double>('sqlite3_value_double'); + return _sqlite3_value_double( + arg0, + ); + } + + _dart_sqlite3_value_double _sqlite3_value_double; + + int sqlite3_value_int( + ffi.Pointer arg0, + ) { + _sqlite3_value_int ??= + _dylib.lookupFunction<_c_sqlite3_value_int, _dart_sqlite3_value_int>( + 'sqlite3_value_int'); + return _sqlite3_value_int( + arg0, + ); + } + + _dart_sqlite3_value_int _sqlite3_value_int; + + int sqlite3_value_int64( + ffi.Pointer arg0, + ) { + _sqlite3_value_int64 ??= _dylib.lookupFunction<_c_sqlite3_value_int64, + _dart_sqlite3_value_int64>('sqlite3_value_int64'); + return _sqlite3_value_int64( + arg0, + ); + } + + _dart_sqlite3_value_int64 _sqlite3_value_int64; + + ffi.Pointer sqlite3_value_pointer( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + _sqlite3_value_pointer ??= _dylib.lookupFunction<_c_sqlite3_value_pointer, + _dart_sqlite3_value_pointer>('sqlite3_value_pointer'); + return _sqlite3_value_pointer( + arg0, + arg1, + ); + } + + _dart_sqlite3_value_pointer _sqlite3_value_pointer; + + ffi.Pointer sqlite3_value_text( + ffi.Pointer arg0, + ) { + _sqlite3_value_text ??= + _dylib.lookupFunction<_c_sqlite3_value_text, _dart_sqlite3_value_text>( + 'sqlite3_value_text'); + return _sqlite3_value_text( + arg0, + ); + } + + _dart_sqlite3_value_text _sqlite3_value_text; + + ffi.Pointer sqlite3_value_text16( + ffi.Pointer arg0, + ) { + _sqlite3_value_text16 ??= _dylib.lookupFunction<_c_sqlite3_value_text16, + _dart_sqlite3_value_text16>('sqlite3_value_text16'); + return _sqlite3_value_text16( + arg0, + ); + } + + _dart_sqlite3_value_text16 _sqlite3_value_text16; + + ffi.Pointer sqlite3_value_text16le( + ffi.Pointer arg0, + ) { + _sqlite3_value_text16le ??= _dylib.lookupFunction<_c_sqlite3_value_text16le, + _dart_sqlite3_value_text16le>('sqlite3_value_text16le'); + return _sqlite3_value_text16le( + arg0, + ); + } + + _dart_sqlite3_value_text16le _sqlite3_value_text16le; + + ffi.Pointer sqlite3_value_text16be( + ffi.Pointer arg0, + ) { + _sqlite3_value_text16be ??= _dylib.lookupFunction<_c_sqlite3_value_text16be, + _dart_sqlite3_value_text16be>('sqlite3_value_text16be'); + return _sqlite3_value_text16be( + arg0, + ); + } + + _dart_sqlite3_value_text16be _sqlite3_value_text16be; + + int sqlite3_value_bytes( + ffi.Pointer arg0, + ) { + _sqlite3_value_bytes ??= _dylib.lookupFunction<_c_sqlite3_value_bytes, + _dart_sqlite3_value_bytes>('sqlite3_value_bytes'); + return _sqlite3_value_bytes( + arg0, + ); + } + + _dart_sqlite3_value_bytes _sqlite3_value_bytes; + + int sqlite3_value_bytes16( + ffi.Pointer arg0, + ) { + _sqlite3_value_bytes16 ??= _dylib.lookupFunction<_c_sqlite3_value_bytes16, + _dart_sqlite3_value_bytes16>('sqlite3_value_bytes16'); + return _sqlite3_value_bytes16( + arg0, + ); + } + + _dart_sqlite3_value_bytes16 _sqlite3_value_bytes16; + + int sqlite3_value_type( + ffi.Pointer arg0, + ) { + _sqlite3_value_type ??= + _dylib.lookupFunction<_c_sqlite3_value_type, _dart_sqlite3_value_type>( + 'sqlite3_value_type'); + return _sqlite3_value_type( + arg0, + ); + } + + _dart_sqlite3_value_type _sqlite3_value_type; + + int sqlite3_value_numeric_type( + ffi.Pointer arg0, + ) { + _sqlite3_value_numeric_type ??= _dylib.lookupFunction< + _c_sqlite3_value_numeric_type, + _dart_sqlite3_value_numeric_type>('sqlite3_value_numeric_type'); + return _sqlite3_value_numeric_type( + arg0, + ); + } + + _dart_sqlite3_value_numeric_type _sqlite3_value_numeric_type; + + int sqlite3_value_nochange( + ffi.Pointer arg0, + ) { + _sqlite3_value_nochange ??= _dylib.lookupFunction<_c_sqlite3_value_nochange, + _dart_sqlite3_value_nochange>('sqlite3_value_nochange'); + return _sqlite3_value_nochange( + arg0, + ); + } + + _dart_sqlite3_value_nochange _sqlite3_value_nochange; + + int sqlite3_value_frombind( + ffi.Pointer arg0, + ) { + _sqlite3_value_frombind ??= _dylib.lookupFunction<_c_sqlite3_value_frombind, + _dart_sqlite3_value_frombind>('sqlite3_value_frombind'); + return _sqlite3_value_frombind( + arg0, + ); + } + + _dart_sqlite3_value_frombind _sqlite3_value_frombind; + + int sqlite3_value_subtype( + ffi.Pointer arg0, + ) { + _sqlite3_value_subtype ??= _dylib.lookupFunction<_c_sqlite3_value_subtype, + _dart_sqlite3_value_subtype>('sqlite3_value_subtype'); + return _sqlite3_value_subtype( + arg0, + ); + } + + _dart_sqlite3_value_subtype _sqlite3_value_subtype; + + ffi.Pointer sqlite3_value_dup( + ffi.Pointer arg0, + ) { + _sqlite3_value_dup ??= + _dylib.lookupFunction<_c_sqlite3_value_dup, _dart_sqlite3_value_dup>( + 'sqlite3_value_dup'); + return _sqlite3_value_dup( + arg0, + ); + } + + _dart_sqlite3_value_dup _sqlite3_value_dup; + + void sqlite3_value_free( + ffi.Pointer arg0, + ) { + _sqlite3_value_free ??= + _dylib.lookupFunction<_c_sqlite3_value_free, _dart_sqlite3_value_free>( + 'sqlite3_value_free'); + return _sqlite3_value_free( + arg0, + ); + } + + _dart_sqlite3_value_free _sqlite3_value_free; + + ffi.Pointer sqlite3_aggregate_context( + ffi.Pointer arg0, + int nBytes, + ) { + _sqlite3_aggregate_context ??= _dylib.lookupFunction< + _c_sqlite3_aggregate_context, + _dart_sqlite3_aggregate_context>('sqlite3_aggregate_context'); + return _sqlite3_aggregate_context( + arg0, + nBytes, + ); + } + + _dart_sqlite3_aggregate_context _sqlite3_aggregate_context; + + ffi.Pointer sqlite3_user_data( + ffi.Pointer arg0, + ) { + _sqlite3_user_data ??= + _dylib.lookupFunction<_c_sqlite3_user_data, _dart_sqlite3_user_data>( + 'sqlite3_user_data'); + return _sqlite3_user_data( + arg0, + ); + } + + _dart_sqlite3_user_data _sqlite3_user_data; + + ffi.Pointer sqlite3_context_db_handle( + ffi.Pointer arg0, + ) { + _sqlite3_context_db_handle ??= _dylib.lookupFunction< + _c_sqlite3_context_db_handle, + _dart_sqlite3_context_db_handle>('sqlite3_context_db_handle'); + return _sqlite3_context_db_handle( + arg0, + ); + } + + _dart_sqlite3_context_db_handle _sqlite3_context_db_handle; + + ffi.Pointer sqlite3_get_auxdata( + ffi.Pointer arg0, + int N, + ) { + _sqlite3_get_auxdata ??= _dylib.lookupFunction<_c_sqlite3_get_auxdata, + _dart_sqlite3_get_auxdata>('sqlite3_get_auxdata'); + return _sqlite3_get_auxdata( + arg0, + N, + ); + } + + _dart_sqlite3_get_auxdata _sqlite3_get_auxdata; + + void sqlite3_set_auxdata( + ffi.Pointer arg0, + int N, + ffi.Pointer arg2, + ffi.Pointer> arg3, + ) { + _sqlite3_set_auxdata ??= _dylib.lookupFunction<_c_sqlite3_set_auxdata, + _dart_sqlite3_set_auxdata>('sqlite3_set_auxdata'); + return _sqlite3_set_auxdata( + arg0, + N, + arg2, + arg3, + ); + } + + _dart_sqlite3_set_auxdata _sqlite3_set_auxdata; + + void sqlite3_result_blob( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, + ffi.Pointer> arg3, + ) { + _sqlite3_result_blob ??= _dylib.lookupFunction<_c_sqlite3_result_blob, + _dart_sqlite3_result_blob>('sqlite3_result_blob'); + return _sqlite3_result_blob( + arg0, + arg1, + arg2, + arg3, + ); + } + + _dart_sqlite3_result_blob _sqlite3_result_blob; + + void sqlite3_result_blob64( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, + ffi.Pointer> arg3, + ) { + _sqlite3_result_blob64 ??= _dylib.lookupFunction<_c_sqlite3_result_blob64, + _dart_sqlite3_result_blob64>('sqlite3_result_blob64'); + return _sqlite3_result_blob64( + arg0, + arg1, + arg2, + arg3, + ); + } + + _dart_sqlite3_result_blob64 _sqlite3_result_blob64; + + void sqlite3_result_double( + ffi.Pointer arg0, + double arg1, + ) { + _sqlite3_result_double ??= _dylib.lookupFunction<_c_sqlite3_result_double, + _dart_sqlite3_result_double>('sqlite3_result_double'); + return _sqlite3_result_double( + arg0, + arg1, + ); + } + + _dart_sqlite3_result_double _sqlite3_result_double; + + void sqlite3_result_error( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, + ) { + _sqlite3_result_error ??= _dylib.lookupFunction<_c_sqlite3_result_error, + _dart_sqlite3_result_error>('sqlite3_result_error'); + return _sqlite3_result_error( + arg0, + arg1, + arg2, + ); + } + + _dart_sqlite3_result_error _sqlite3_result_error; + + void sqlite3_result_error16( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, + ) { + _sqlite3_result_error16 ??= _dylib.lookupFunction<_c_sqlite3_result_error16, + _dart_sqlite3_result_error16>('sqlite3_result_error16'); + return _sqlite3_result_error16( + arg0, + arg1, + arg2, + ); + } + + _dart_sqlite3_result_error16 _sqlite3_result_error16; + + void sqlite3_result_error_toobig( + ffi.Pointer arg0, + ) { + _sqlite3_result_error_toobig ??= _dylib.lookupFunction< + _c_sqlite3_result_error_toobig, + _dart_sqlite3_result_error_toobig>('sqlite3_result_error_toobig'); + return _sqlite3_result_error_toobig( + arg0, + ); + } + + _dart_sqlite3_result_error_toobig _sqlite3_result_error_toobig; + + void sqlite3_result_error_nomem( + ffi.Pointer arg0, + ) { + _sqlite3_result_error_nomem ??= _dylib.lookupFunction< + _c_sqlite3_result_error_nomem, + _dart_sqlite3_result_error_nomem>('sqlite3_result_error_nomem'); + return _sqlite3_result_error_nomem( + arg0, + ); + } + + _dart_sqlite3_result_error_nomem _sqlite3_result_error_nomem; + + void sqlite3_result_error_code( + ffi.Pointer arg0, + int arg1, + ) { + _sqlite3_result_error_code ??= _dylib.lookupFunction< + _c_sqlite3_result_error_code, + _dart_sqlite3_result_error_code>('sqlite3_result_error_code'); + return _sqlite3_result_error_code( + arg0, + arg1, + ); + } + + _dart_sqlite3_result_error_code _sqlite3_result_error_code; + + void sqlite3_result_int( + ffi.Pointer arg0, + int arg1, + ) { + _sqlite3_result_int ??= + _dylib.lookupFunction<_c_sqlite3_result_int, _dart_sqlite3_result_int>( + 'sqlite3_result_int'); + return _sqlite3_result_int( + arg0, + arg1, + ); + } + + _dart_sqlite3_result_int _sqlite3_result_int; + + void sqlite3_result_int64( + ffi.Pointer arg0, + int arg1, + ) { + _sqlite3_result_int64 ??= _dylib.lookupFunction<_c_sqlite3_result_int64, + _dart_sqlite3_result_int64>('sqlite3_result_int64'); + return _sqlite3_result_int64( + arg0, + arg1, + ); + } + + _dart_sqlite3_result_int64 _sqlite3_result_int64; + + void sqlite3_result_null( + ffi.Pointer arg0, + ) { + _sqlite3_result_null ??= _dylib.lookupFunction<_c_sqlite3_result_null, + _dart_sqlite3_result_null>('sqlite3_result_null'); + return _sqlite3_result_null( + arg0, + ); + } + + _dart_sqlite3_result_null _sqlite3_result_null; + + void sqlite3_result_text( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, + ffi.Pointer> arg3, + ) { + _sqlite3_result_text ??= _dylib.lookupFunction<_c_sqlite3_result_text, + _dart_sqlite3_result_text>('sqlite3_result_text'); + return _sqlite3_result_text( + arg0, + arg1, + arg2, + arg3, + ); + } + + _dart_sqlite3_result_text _sqlite3_result_text; + + void sqlite3_result_text64( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, + ffi.Pointer> arg3, + int encoding, + ) { + _sqlite3_result_text64 ??= _dylib.lookupFunction<_c_sqlite3_result_text64, + _dart_sqlite3_result_text64>('sqlite3_result_text64'); + return _sqlite3_result_text64( + arg0, + arg1, + arg2, + arg3, + encoding, + ); + } + + _dart_sqlite3_result_text64 _sqlite3_result_text64; + + void sqlite3_result_text16( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, + ffi.Pointer> arg3, + ) { + _sqlite3_result_text16 ??= _dylib.lookupFunction<_c_sqlite3_result_text16, + _dart_sqlite3_result_text16>('sqlite3_result_text16'); + return _sqlite3_result_text16( + arg0, + arg1, + arg2, + arg3, + ); + } + + _dart_sqlite3_result_text16 _sqlite3_result_text16; + + void sqlite3_result_text16le( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, + ffi.Pointer> arg3, + ) { + _sqlite3_result_text16le ??= _dylib.lookupFunction< + _c_sqlite3_result_text16le, + _dart_sqlite3_result_text16le>('sqlite3_result_text16le'); + return _sqlite3_result_text16le( + arg0, + arg1, + arg2, + arg3, + ); + } + + _dart_sqlite3_result_text16le _sqlite3_result_text16le; + + void sqlite3_result_text16be( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, + ffi.Pointer> arg3, + ) { + _sqlite3_result_text16be ??= _dylib.lookupFunction< + _c_sqlite3_result_text16be, + _dart_sqlite3_result_text16be>('sqlite3_result_text16be'); + return _sqlite3_result_text16be( + arg0, + arg1, + arg2, + arg3, + ); + } + + _dart_sqlite3_result_text16be _sqlite3_result_text16be; + + void sqlite3_result_value( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + _sqlite3_result_value ??= _dylib.lookupFunction<_c_sqlite3_result_value, + _dart_sqlite3_result_value>('sqlite3_result_value'); + return _sqlite3_result_value( + arg0, + arg1, + ); + } + + _dart_sqlite3_result_value _sqlite3_result_value; + + void sqlite3_result_pointer( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3, + ) { + _sqlite3_result_pointer ??= _dylib.lookupFunction<_c_sqlite3_result_pointer, + _dart_sqlite3_result_pointer>('sqlite3_result_pointer'); + return _sqlite3_result_pointer( + arg0, + arg1, + arg2, + arg3, + ); + } + + _dart_sqlite3_result_pointer _sqlite3_result_pointer; + + void sqlite3_result_zeroblob( + ffi.Pointer arg0, + int n, + ) { + _sqlite3_result_zeroblob ??= _dylib.lookupFunction< + _c_sqlite3_result_zeroblob, + _dart_sqlite3_result_zeroblob>('sqlite3_result_zeroblob'); + return _sqlite3_result_zeroblob( + arg0, + n, + ); + } + + _dart_sqlite3_result_zeroblob _sqlite3_result_zeroblob; + + int sqlite3_result_zeroblob64( + ffi.Pointer arg0, + int n, + ) { + _sqlite3_result_zeroblob64 ??= _dylib.lookupFunction< + _c_sqlite3_result_zeroblob64, + _dart_sqlite3_result_zeroblob64>('sqlite3_result_zeroblob64'); + return _sqlite3_result_zeroblob64( + arg0, + n, + ); + } + + _dart_sqlite3_result_zeroblob64 _sqlite3_result_zeroblob64; + + void sqlite3_result_subtype( + ffi.Pointer arg0, + int arg1, + ) { + _sqlite3_result_subtype ??= _dylib.lookupFunction<_c_sqlite3_result_subtype, + _dart_sqlite3_result_subtype>('sqlite3_result_subtype'); + return _sqlite3_result_subtype( + arg0, + arg1, + ); + } + + _dart_sqlite3_result_subtype _sqlite3_result_subtype; + + int sqlite3_create_collation( + ffi.Pointer arg0, + ffi.Pointer zName, + int eTextRep, + ffi.Pointer pArg, + ffi.Pointer> xCompare, + ) { + _sqlite3_create_collation ??= _dylib.lookupFunction< + _c_sqlite3_create_collation, + _dart_sqlite3_create_collation>('sqlite3_create_collation'); + return _sqlite3_create_collation( + arg0, + zName, + eTextRep, + pArg, + xCompare, + ); + } + + _dart_sqlite3_create_collation _sqlite3_create_collation; + + int sqlite3_create_collation_v2( + ffi.Pointer arg0, + ffi.Pointer zName, + int eTextRep, + ffi.Pointer pArg, + ffi.Pointer> xCompare, + ffi.Pointer> xDestroy, + ) { + _sqlite3_create_collation_v2 ??= _dylib.lookupFunction< + _c_sqlite3_create_collation_v2, + _dart_sqlite3_create_collation_v2>('sqlite3_create_collation_v2'); + return _sqlite3_create_collation_v2( + arg0, + zName, + eTextRep, + pArg, + xCompare, + xDestroy, + ); + } + + _dart_sqlite3_create_collation_v2 _sqlite3_create_collation_v2; + + int sqlite3_create_collation16( + ffi.Pointer arg0, + ffi.Pointer zName, + int eTextRep, + ffi.Pointer pArg, + ffi.Pointer> xCompare, + ) { + _sqlite3_create_collation16 ??= _dylib.lookupFunction< + _c_sqlite3_create_collation16, + _dart_sqlite3_create_collation16>('sqlite3_create_collation16'); + return _sqlite3_create_collation16( + arg0, + zName, + eTextRep, + pArg, + xCompare, + ); + } + + _dart_sqlite3_create_collation16 _sqlite3_create_collation16; + + int sqlite3_collation_needed( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer> arg2, + ) { + _sqlite3_collation_needed ??= _dylib.lookupFunction< + _c_sqlite3_collation_needed, + _dart_sqlite3_collation_needed>('sqlite3_collation_needed'); + return _sqlite3_collation_needed( + arg0, + arg1, + arg2, + ); + } + + _dart_sqlite3_collation_needed _sqlite3_collation_needed; + + int sqlite3_collation_needed16( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer> arg2, + ) { + _sqlite3_collation_needed16 ??= _dylib.lookupFunction< + _c_sqlite3_collation_needed16, + _dart_sqlite3_collation_needed16>('sqlite3_collation_needed16'); + return _sqlite3_collation_needed16( + arg0, + arg1, + arg2, + ); + } + + _dart_sqlite3_collation_needed16 _sqlite3_collation_needed16; + + int sqlite3_sleep( + int arg0, + ) { + _sqlite3_sleep ??= _dylib + .lookupFunction<_c_sqlite3_sleep, _dart_sqlite3_sleep>('sqlite3_sleep'); + return _sqlite3_sleep( + arg0, + ); + } + + _dart_sqlite3_sleep _sqlite3_sleep; + + int sqlite3_win32_set_directory( + int type, + ffi.Pointer zValue, + ) { + _sqlite3_win32_set_directory ??= _dylib.lookupFunction< + _c_sqlite3_win32_set_directory, + _dart_sqlite3_win32_set_directory>('sqlite3_win32_set_directory'); + return _sqlite3_win32_set_directory( + type, + zValue, + ); + } + + _dart_sqlite3_win32_set_directory _sqlite3_win32_set_directory; + + int sqlite3_win32_set_directory8( + int type, + ffi.Pointer zValue, + ) { + _sqlite3_win32_set_directory8 ??= _dylib.lookupFunction< + _c_sqlite3_win32_set_directory8, + _dart_sqlite3_win32_set_directory8>('sqlite3_win32_set_directory8'); + return _sqlite3_win32_set_directory8( + type, + zValue, + ); + } + + _dart_sqlite3_win32_set_directory8 _sqlite3_win32_set_directory8; + + int sqlite3_win32_set_directory16( + int type, + ffi.Pointer zValue, + ) { + _sqlite3_win32_set_directory16 ??= _dylib.lookupFunction< + _c_sqlite3_win32_set_directory16, + _dart_sqlite3_win32_set_directory16>('sqlite3_win32_set_directory16'); + return _sqlite3_win32_set_directory16( + type, + zValue, + ); + } + + _dart_sqlite3_win32_set_directory16 _sqlite3_win32_set_directory16; + + int sqlite3_get_autocommit( + ffi.Pointer arg0, + ) { + _sqlite3_get_autocommit ??= _dylib.lookupFunction<_c_sqlite3_get_autocommit, + _dart_sqlite3_get_autocommit>('sqlite3_get_autocommit'); + return _sqlite3_get_autocommit( + arg0, + ); + } + + _dart_sqlite3_get_autocommit _sqlite3_get_autocommit; + + ffi.Pointer sqlite3_db_handle( + ffi.Pointer arg0, + ) { + _sqlite3_db_handle ??= + _dylib.lookupFunction<_c_sqlite3_db_handle, _dart_sqlite3_db_handle>( + 'sqlite3_db_handle'); + return _sqlite3_db_handle( + arg0, + ); + } + + _dart_sqlite3_db_handle _sqlite3_db_handle; + + ffi.Pointer sqlite3_db_filename( + ffi.Pointer db, + ffi.Pointer zDbName, + ) { + _sqlite3_db_filename ??= _dylib.lookupFunction<_c_sqlite3_db_filename, + _dart_sqlite3_db_filename>('sqlite3_db_filename'); + return _sqlite3_db_filename( + db, + zDbName, + ); + } + + _dart_sqlite3_db_filename _sqlite3_db_filename; + + int sqlite3_db_readonly( + ffi.Pointer db, + ffi.Pointer zDbName, + ) { + _sqlite3_db_readonly ??= _dylib.lookupFunction<_c_sqlite3_db_readonly, + _dart_sqlite3_db_readonly>('sqlite3_db_readonly'); + return _sqlite3_db_readonly( + db, + zDbName, + ); + } + + _dart_sqlite3_db_readonly _sqlite3_db_readonly; + + ffi.Pointer sqlite3_next_stmt( + ffi.Pointer pDb, + ffi.Pointer pStmt, + ) { + _sqlite3_next_stmt ??= + _dylib.lookupFunction<_c_sqlite3_next_stmt, _dart_sqlite3_next_stmt>( + 'sqlite3_next_stmt'); + return _sqlite3_next_stmt( + pDb, + pStmt, + ); + } + + _dart_sqlite3_next_stmt _sqlite3_next_stmt; + + ffi.Pointer sqlite3_commit_hook( + ffi.Pointer arg0, + ffi.Pointer> arg1, + ffi.Pointer arg2, + ) { + _sqlite3_commit_hook ??= _dylib.lookupFunction<_c_sqlite3_commit_hook, + _dart_sqlite3_commit_hook>('sqlite3_commit_hook'); + return _sqlite3_commit_hook( + arg0, + arg1, + arg2, + ); + } + + _dart_sqlite3_commit_hook _sqlite3_commit_hook; + + ffi.Pointer sqlite3_rollback_hook( + ffi.Pointer arg0, + ffi.Pointer> arg1, + ffi.Pointer arg2, + ) { + _sqlite3_rollback_hook ??= _dylib.lookupFunction<_c_sqlite3_rollback_hook, + _dart_sqlite3_rollback_hook>('sqlite3_rollback_hook'); + return _sqlite3_rollback_hook( + arg0, + arg1, + arg2, + ); + } + + _dart_sqlite3_rollback_hook _sqlite3_rollback_hook; + + ffi.Pointer sqlite3_update_hook( + ffi.Pointer arg0, + ffi.Pointer> arg1, + ffi.Pointer arg2, + ) { + _sqlite3_update_hook ??= _dylib.lookupFunction<_c_sqlite3_update_hook, + _dart_sqlite3_update_hook>('sqlite3_update_hook'); + return _sqlite3_update_hook( + arg0, + arg1, + arg2, + ); + } + + _dart_sqlite3_update_hook _sqlite3_update_hook; + + int sqlite3_enable_shared_cache( + int arg0, + ) { + _sqlite3_enable_shared_cache ??= _dylib.lookupFunction< + _c_sqlite3_enable_shared_cache, + _dart_sqlite3_enable_shared_cache>('sqlite3_enable_shared_cache'); + return _sqlite3_enable_shared_cache( + arg0, + ); + } + + _dart_sqlite3_enable_shared_cache _sqlite3_enable_shared_cache; + + int sqlite3_release_memory( + int arg0, + ) { + _sqlite3_release_memory ??= _dylib.lookupFunction<_c_sqlite3_release_memory, + _dart_sqlite3_release_memory>('sqlite3_release_memory'); + return _sqlite3_release_memory( + arg0, + ); + } + + _dart_sqlite3_release_memory _sqlite3_release_memory; + + int sqlite3_db_release_memory( + ffi.Pointer arg0, + ) { + _sqlite3_db_release_memory ??= _dylib.lookupFunction< + _c_sqlite3_db_release_memory, + _dart_sqlite3_db_release_memory>('sqlite3_db_release_memory'); + return _sqlite3_db_release_memory( + arg0, + ); + } + + _dart_sqlite3_db_release_memory _sqlite3_db_release_memory; + + int sqlite3_soft_heap_limit64( + int N, + ) { + _sqlite3_soft_heap_limit64 ??= _dylib.lookupFunction< + _c_sqlite3_soft_heap_limit64, + _dart_sqlite3_soft_heap_limit64>('sqlite3_soft_heap_limit64'); + return _sqlite3_soft_heap_limit64( + N, + ); + } + + _dart_sqlite3_soft_heap_limit64 _sqlite3_soft_heap_limit64; + + int sqlite3_hard_heap_limit64( + int N, + ) { + _sqlite3_hard_heap_limit64 ??= _dylib.lookupFunction< + _c_sqlite3_hard_heap_limit64, + _dart_sqlite3_hard_heap_limit64>('sqlite3_hard_heap_limit64'); + return _sqlite3_hard_heap_limit64( + N, + ); + } + + _dart_sqlite3_hard_heap_limit64 _sqlite3_hard_heap_limit64; + + void sqlite3_soft_heap_limit( + int N, + ) { + _sqlite3_soft_heap_limit ??= _dylib.lookupFunction< + _c_sqlite3_soft_heap_limit, + _dart_sqlite3_soft_heap_limit>('sqlite3_soft_heap_limit'); + return _sqlite3_soft_heap_limit( + N, + ); + } + + _dart_sqlite3_soft_heap_limit _sqlite3_soft_heap_limit; + + int sqlite3_table_column_metadata( + ffi.Pointer db, + ffi.Pointer zDbName, + ffi.Pointer zTableName, + ffi.Pointer zColumnName, + ffi.Pointer> pzDataType, + ffi.Pointer> pzCollSeq, + ffi.Pointer pNotNull, + ffi.Pointer pPrimaryKey, + ffi.Pointer pAutoinc, + ) { + _sqlite3_table_column_metadata ??= _dylib.lookupFunction< + _c_sqlite3_table_column_metadata, + _dart_sqlite3_table_column_metadata>('sqlite3_table_column_metadata'); + return _sqlite3_table_column_metadata( + db, + zDbName, + zTableName, + zColumnName, + pzDataType, + pzCollSeq, + pNotNull, + pPrimaryKey, + pAutoinc, + ); + } + + _dart_sqlite3_table_column_metadata _sqlite3_table_column_metadata; + + int sqlite3_load_extension( + ffi.Pointer db, + ffi.Pointer zFile, + ffi.Pointer zProc, + ffi.Pointer> pzErrMsg, + ) { + _sqlite3_load_extension ??= _dylib.lookupFunction<_c_sqlite3_load_extension, + _dart_sqlite3_load_extension>('sqlite3_load_extension'); + return _sqlite3_load_extension( + db, + zFile, + zProc, + pzErrMsg, + ); + } + + _dart_sqlite3_load_extension _sqlite3_load_extension; + + int sqlite3_enable_load_extension( + ffi.Pointer db, + int onoff, + ) { + _sqlite3_enable_load_extension ??= _dylib.lookupFunction< + _c_sqlite3_enable_load_extension, + _dart_sqlite3_enable_load_extension>('sqlite3_enable_load_extension'); + return _sqlite3_enable_load_extension( + db, + onoff, + ); + } + + _dart_sqlite3_enable_load_extension _sqlite3_enable_load_extension; + + int sqlite3_auto_extension( + ffi.Pointer> xEntryPoint, + ) { + _sqlite3_auto_extension ??= _dylib.lookupFunction<_c_sqlite3_auto_extension, + _dart_sqlite3_auto_extension>('sqlite3_auto_extension'); + return _sqlite3_auto_extension( + xEntryPoint, + ); + } + + _dart_sqlite3_auto_extension _sqlite3_auto_extension; + + int sqlite3_cancel_auto_extension( + ffi.Pointer> xEntryPoint, + ) { + _sqlite3_cancel_auto_extension ??= _dylib.lookupFunction< + _c_sqlite3_cancel_auto_extension, + _dart_sqlite3_cancel_auto_extension>('sqlite3_cancel_auto_extension'); + return _sqlite3_cancel_auto_extension( + xEntryPoint, + ); + } + + _dart_sqlite3_cancel_auto_extension _sqlite3_cancel_auto_extension; + + void sqlite3_reset_auto_extension() { + _sqlite3_reset_auto_extension ??= _dylib.lookupFunction< + _c_sqlite3_reset_auto_extension, + _dart_sqlite3_reset_auto_extension>('sqlite3_reset_auto_extension'); + return _sqlite3_reset_auto_extension(); + } + + _dart_sqlite3_reset_auto_extension _sqlite3_reset_auto_extension; + + int sqlite3_create_module( + ffi.Pointer db, + ffi.Pointer zName, + ffi.Pointer p, + ffi.Pointer pClientData, + ) { + _sqlite3_create_module ??= _dylib.lookupFunction<_c_sqlite3_create_module, + _dart_sqlite3_create_module>('sqlite3_create_module'); + return _sqlite3_create_module( + db, + zName, + p, + pClientData, + ); + } + + _dart_sqlite3_create_module _sqlite3_create_module; + + int sqlite3_create_module_v2( + ffi.Pointer db, + ffi.Pointer zName, + ffi.Pointer p, + ffi.Pointer pClientData, + ffi.Pointer> xDestroy, + ) { + _sqlite3_create_module_v2 ??= _dylib.lookupFunction< + _c_sqlite3_create_module_v2, + _dart_sqlite3_create_module_v2>('sqlite3_create_module_v2'); + return _sqlite3_create_module_v2( + db, + zName, + p, + pClientData, + xDestroy, + ); + } + + _dart_sqlite3_create_module_v2 _sqlite3_create_module_v2; + + int sqlite3_drop_modules( + ffi.Pointer db, + ffi.Pointer> azKeep, + ) { + _sqlite3_drop_modules ??= _dylib.lookupFunction<_c_sqlite3_drop_modules, + _dart_sqlite3_drop_modules>('sqlite3_drop_modules'); + return _sqlite3_drop_modules( + db, + azKeep, + ); + } + + _dart_sqlite3_drop_modules _sqlite3_drop_modules; + + int sqlite3_declare_vtab( + ffi.Pointer arg0, + ffi.Pointer zSQL, + ) { + _sqlite3_declare_vtab ??= _dylib.lookupFunction<_c_sqlite3_declare_vtab, + _dart_sqlite3_declare_vtab>('sqlite3_declare_vtab'); + return _sqlite3_declare_vtab( + arg0, + zSQL, + ); + } + + _dart_sqlite3_declare_vtab _sqlite3_declare_vtab; + + int sqlite3_overload_function( + ffi.Pointer arg0, + ffi.Pointer zFuncName, + int nArg, + ) { + _sqlite3_overload_function ??= _dylib.lookupFunction< + _c_sqlite3_overload_function, + _dart_sqlite3_overload_function>('sqlite3_overload_function'); + return _sqlite3_overload_function( + arg0, + zFuncName, + nArg, + ); + } + + _dart_sqlite3_overload_function _sqlite3_overload_function; + + int sqlite3_blob_open( + ffi.Pointer arg0, + ffi.Pointer zDb, + ffi.Pointer zTable, + ffi.Pointer zColumn, + int iRow, + int flags, + ffi.Pointer> ppBlob, + ) { + _sqlite3_blob_open ??= + _dylib.lookupFunction<_c_sqlite3_blob_open, _dart_sqlite3_blob_open>( + 'sqlite3_blob_open'); + return _sqlite3_blob_open( + arg0, + zDb, + zTable, + zColumn, + iRow, + flags, + ppBlob, + ); + } + + _dart_sqlite3_blob_open _sqlite3_blob_open; + + int sqlite3_blob_reopen( + ffi.Pointer arg0, + int arg1, + ) { + _sqlite3_blob_reopen ??= _dylib.lookupFunction<_c_sqlite3_blob_reopen, + _dart_sqlite3_blob_reopen>('sqlite3_blob_reopen'); + return _sqlite3_blob_reopen( + arg0, + arg1, + ); + } + + _dart_sqlite3_blob_reopen _sqlite3_blob_reopen; + + int sqlite3_blob_close( + ffi.Pointer arg0, + ) { + _sqlite3_blob_close ??= + _dylib.lookupFunction<_c_sqlite3_blob_close, _dart_sqlite3_blob_close>( + 'sqlite3_blob_close'); + return _sqlite3_blob_close( + arg0, + ); + } + + _dart_sqlite3_blob_close _sqlite3_blob_close; + + int sqlite3_blob_bytes( + ffi.Pointer arg0, + ) { + _sqlite3_blob_bytes ??= + _dylib.lookupFunction<_c_sqlite3_blob_bytes, _dart_sqlite3_blob_bytes>( + 'sqlite3_blob_bytes'); + return _sqlite3_blob_bytes( + arg0, + ); + } + + _dart_sqlite3_blob_bytes _sqlite3_blob_bytes; + + int sqlite3_blob_read( + ffi.Pointer arg0, + ffi.Pointer Z, + int N, + int iOffset, + ) { + _sqlite3_blob_read ??= + _dylib.lookupFunction<_c_sqlite3_blob_read, _dart_sqlite3_blob_read>( + 'sqlite3_blob_read'); + return _sqlite3_blob_read( + arg0, + Z, + N, + iOffset, + ); + } + + _dart_sqlite3_blob_read _sqlite3_blob_read; + + int sqlite3_blob_write( + ffi.Pointer arg0, + ffi.Pointer z, + int n, + int iOffset, + ) { + _sqlite3_blob_write ??= + _dylib.lookupFunction<_c_sqlite3_blob_write, _dart_sqlite3_blob_write>( + 'sqlite3_blob_write'); + return _sqlite3_blob_write( + arg0, + z, + n, + iOffset, + ); + } + + _dart_sqlite3_blob_write _sqlite3_blob_write; + + ffi.Pointer sqlite3_vfs_find( + ffi.Pointer zVfsName, + ) { + _sqlite3_vfs_find ??= + _dylib.lookupFunction<_c_sqlite3_vfs_find, _dart_sqlite3_vfs_find>( + 'sqlite3_vfs_find'); + return _sqlite3_vfs_find( + zVfsName, + ); + } + + _dart_sqlite3_vfs_find _sqlite3_vfs_find; + + int sqlite3_vfs_register( + ffi.Pointer arg0, + int makeDflt, + ) { + _sqlite3_vfs_register ??= _dylib.lookupFunction<_c_sqlite3_vfs_register, + _dart_sqlite3_vfs_register>('sqlite3_vfs_register'); + return _sqlite3_vfs_register( + arg0, + makeDflt, + ); + } + + _dart_sqlite3_vfs_register _sqlite3_vfs_register; + + int sqlite3_vfs_unregister( + ffi.Pointer arg0, + ) { + _sqlite3_vfs_unregister ??= _dylib.lookupFunction<_c_sqlite3_vfs_unregister, + _dart_sqlite3_vfs_unregister>('sqlite3_vfs_unregister'); + return _sqlite3_vfs_unregister( + arg0, + ); + } + + _dart_sqlite3_vfs_unregister _sqlite3_vfs_unregister; + + ffi.Pointer sqlite3_mutex_alloc( + int arg0, + ) { + _sqlite3_mutex_alloc ??= _dylib.lookupFunction<_c_sqlite3_mutex_alloc, + _dart_sqlite3_mutex_alloc>('sqlite3_mutex_alloc'); + return _sqlite3_mutex_alloc( + arg0, + ); + } + + _dart_sqlite3_mutex_alloc _sqlite3_mutex_alloc; + + void sqlite3_mutex_free( + ffi.Pointer arg0, + ) { + _sqlite3_mutex_free ??= + _dylib.lookupFunction<_c_sqlite3_mutex_free, _dart_sqlite3_mutex_free>( + 'sqlite3_mutex_free'); + return _sqlite3_mutex_free( + arg0, + ); + } + + _dart_sqlite3_mutex_free _sqlite3_mutex_free; + + void sqlite3_mutex_enter( + ffi.Pointer arg0, + ) { + _sqlite3_mutex_enter ??= _dylib.lookupFunction<_c_sqlite3_mutex_enter, + _dart_sqlite3_mutex_enter>('sqlite3_mutex_enter'); + return _sqlite3_mutex_enter( + arg0, + ); + } + + _dart_sqlite3_mutex_enter _sqlite3_mutex_enter; + + int sqlite3_mutex_try( + ffi.Pointer arg0, + ) { + _sqlite3_mutex_try ??= + _dylib.lookupFunction<_c_sqlite3_mutex_try, _dart_sqlite3_mutex_try>( + 'sqlite3_mutex_try'); + return _sqlite3_mutex_try( + arg0, + ); + } + + _dart_sqlite3_mutex_try _sqlite3_mutex_try; + + void sqlite3_mutex_leave( + ffi.Pointer arg0, + ) { + _sqlite3_mutex_leave ??= _dylib.lookupFunction<_c_sqlite3_mutex_leave, + _dart_sqlite3_mutex_leave>('sqlite3_mutex_leave'); + return _sqlite3_mutex_leave( + arg0, + ); + } + + _dart_sqlite3_mutex_leave _sqlite3_mutex_leave; + + int sqlite3_mutex_held( + ffi.Pointer arg0, + ) { + _sqlite3_mutex_held ??= + _dylib.lookupFunction<_c_sqlite3_mutex_held, _dart_sqlite3_mutex_held>( + 'sqlite3_mutex_held'); + return _sqlite3_mutex_held( + arg0, + ); + } + + _dart_sqlite3_mutex_held _sqlite3_mutex_held; + + int sqlite3_mutex_notheld( + ffi.Pointer arg0, + ) { + _sqlite3_mutex_notheld ??= _dylib.lookupFunction<_c_sqlite3_mutex_notheld, + _dart_sqlite3_mutex_notheld>('sqlite3_mutex_notheld'); + return _sqlite3_mutex_notheld( + arg0, + ); + } + + _dart_sqlite3_mutex_notheld _sqlite3_mutex_notheld; + + ffi.Pointer sqlite3_db_mutex( + ffi.Pointer arg0, + ) { + _sqlite3_db_mutex ??= + _dylib.lookupFunction<_c_sqlite3_db_mutex, _dart_sqlite3_db_mutex>( + 'sqlite3_db_mutex'); + return _sqlite3_db_mutex( + arg0, + ); + } + + _dart_sqlite3_db_mutex _sqlite3_db_mutex; + + int sqlite3_file_control( + ffi.Pointer arg0, + ffi.Pointer zDbName, + int op, + ffi.Pointer arg3, + ) { + _sqlite3_file_control ??= _dylib.lookupFunction<_c_sqlite3_file_control, + _dart_sqlite3_file_control>('sqlite3_file_control'); + return _sqlite3_file_control( + arg0, + zDbName, + op, + arg3, + ); + } + + _dart_sqlite3_file_control _sqlite3_file_control; + + int sqlite3_test_control( + int op, + ) { + _sqlite3_test_control ??= _dylib.lookupFunction<_c_sqlite3_test_control, + _dart_sqlite3_test_control>('sqlite3_test_control'); + return _sqlite3_test_control( + op, + ); + } + + _dart_sqlite3_test_control _sqlite3_test_control; + + int sqlite3_keyword_count() { + _sqlite3_keyword_count ??= _dylib.lookupFunction<_c_sqlite3_keyword_count, + _dart_sqlite3_keyword_count>('sqlite3_keyword_count'); + return _sqlite3_keyword_count(); + } + + _dart_sqlite3_keyword_count _sqlite3_keyword_count; + + int sqlite3_keyword_name( + int arg0, + ffi.Pointer> arg1, + ffi.Pointer arg2, + ) { + _sqlite3_keyword_name ??= _dylib.lookupFunction<_c_sqlite3_keyword_name, + _dart_sqlite3_keyword_name>('sqlite3_keyword_name'); + return _sqlite3_keyword_name( + arg0, + arg1, + arg2, + ); + } + + _dart_sqlite3_keyword_name _sqlite3_keyword_name; + + int sqlite3_keyword_check( + ffi.Pointer arg0, + int arg1, + ) { + _sqlite3_keyword_check ??= _dylib.lookupFunction<_c_sqlite3_keyword_check, + _dart_sqlite3_keyword_check>('sqlite3_keyword_check'); + return _sqlite3_keyword_check( + arg0, + arg1, + ); + } + + _dart_sqlite3_keyword_check _sqlite3_keyword_check; + + ffi.Pointer sqlite3_str_new( + ffi.Pointer arg0, + ) { + _sqlite3_str_new ??= + _dylib.lookupFunction<_c_sqlite3_str_new, _dart_sqlite3_str_new>( + 'sqlite3_str_new'); + return _sqlite3_str_new( + arg0, + ); + } + + _dart_sqlite3_str_new _sqlite3_str_new; + + ffi.Pointer sqlite3_str_finish( + ffi.Pointer arg0, + ) { + _sqlite3_str_finish ??= + _dylib.lookupFunction<_c_sqlite3_str_finish, _dart_sqlite3_str_finish>( + 'sqlite3_str_finish'); + return _sqlite3_str_finish( + arg0, + ); + } + + _dart_sqlite3_str_finish _sqlite3_str_finish; + + void sqlite3_str_appendf( + ffi.Pointer arg0, + ffi.Pointer zFormat, + ) { + _sqlite3_str_appendf ??= _dylib.lookupFunction<_c_sqlite3_str_appendf, + _dart_sqlite3_str_appendf>('sqlite3_str_appendf'); + return _sqlite3_str_appendf( + arg0, + zFormat, + ); + } + + _dart_sqlite3_str_appendf _sqlite3_str_appendf; + + void sqlite3_str_append( + ffi.Pointer arg0, + ffi.Pointer zIn, + int N, + ) { + _sqlite3_str_append ??= + _dylib.lookupFunction<_c_sqlite3_str_append, _dart_sqlite3_str_append>( + 'sqlite3_str_append'); + return _sqlite3_str_append( + arg0, + zIn, + N, + ); + } + + _dart_sqlite3_str_append _sqlite3_str_append; + + void sqlite3_str_appendall( + ffi.Pointer arg0, + ffi.Pointer zIn, + ) { + _sqlite3_str_appendall ??= _dylib.lookupFunction<_c_sqlite3_str_appendall, + _dart_sqlite3_str_appendall>('sqlite3_str_appendall'); + return _sqlite3_str_appendall( + arg0, + zIn, + ); + } + + _dart_sqlite3_str_appendall _sqlite3_str_appendall; + + void sqlite3_str_appendchar( + ffi.Pointer arg0, + int N, + int C, + ) { + _sqlite3_str_appendchar ??= _dylib.lookupFunction<_c_sqlite3_str_appendchar, + _dart_sqlite3_str_appendchar>('sqlite3_str_appendchar'); + return _sqlite3_str_appendchar( + arg0, + N, + C, + ); + } + + _dart_sqlite3_str_appendchar _sqlite3_str_appendchar; + + void sqlite3_str_reset( + ffi.Pointer arg0, + ) { + _sqlite3_str_reset ??= + _dylib.lookupFunction<_c_sqlite3_str_reset, _dart_sqlite3_str_reset>( + 'sqlite3_str_reset'); + return _sqlite3_str_reset( + arg0, + ); + } + + _dart_sqlite3_str_reset _sqlite3_str_reset; + + int sqlite3_str_errcode( + ffi.Pointer arg0, + ) { + _sqlite3_str_errcode ??= _dylib.lookupFunction<_c_sqlite3_str_errcode, + _dart_sqlite3_str_errcode>('sqlite3_str_errcode'); + return _sqlite3_str_errcode( + arg0, + ); + } + + _dart_sqlite3_str_errcode _sqlite3_str_errcode; + + int sqlite3_str_length( + ffi.Pointer arg0, + ) { + _sqlite3_str_length ??= + _dylib.lookupFunction<_c_sqlite3_str_length, _dart_sqlite3_str_length>( + 'sqlite3_str_length'); + return _sqlite3_str_length( + arg0, + ); + } + + _dart_sqlite3_str_length _sqlite3_str_length; + + ffi.Pointer sqlite3_str_value( + ffi.Pointer arg0, + ) { + _sqlite3_str_value ??= + _dylib.lookupFunction<_c_sqlite3_str_value, _dart_sqlite3_str_value>( + 'sqlite3_str_value'); + return _sqlite3_str_value( + arg0, + ); + } + + _dart_sqlite3_str_value _sqlite3_str_value; + + int sqlite3_status( + int op, + ffi.Pointer pCurrent, + ffi.Pointer pHighwater, + int resetFlag, + ) { + _sqlite3_status ??= + _dylib.lookupFunction<_c_sqlite3_status, _dart_sqlite3_status>( + 'sqlite3_status'); + return _sqlite3_status( + op, + pCurrent, + pHighwater, + resetFlag, + ); + } + + _dart_sqlite3_status _sqlite3_status; + + int sqlite3_status64( + int op, + ffi.Pointer pCurrent, + ffi.Pointer pHighwater, + int resetFlag, + ) { + _sqlite3_status64 ??= + _dylib.lookupFunction<_c_sqlite3_status64, _dart_sqlite3_status64>( + 'sqlite3_status64'); + return _sqlite3_status64( + op, + pCurrent, + pHighwater, + resetFlag, + ); + } + + _dart_sqlite3_status64 _sqlite3_status64; + + int sqlite3_db_status( + ffi.Pointer arg0, + int op, + ffi.Pointer pCur, + ffi.Pointer pHiwtr, + int resetFlg, + ) { + _sqlite3_db_status ??= + _dylib.lookupFunction<_c_sqlite3_db_status, _dart_sqlite3_db_status>( + 'sqlite3_db_status'); + return _sqlite3_db_status( + arg0, + op, + pCur, + pHiwtr, + resetFlg, + ); + } + + _dart_sqlite3_db_status _sqlite3_db_status; + + int sqlite3_stmt_status( + ffi.Pointer arg0, + int op, + int resetFlg, + ) { + _sqlite3_stmt_status ??= _dylib.lookupFunction<_c_sqlite3_stmt_status, + _dart_sqlite3_stmt_status>('sqlite3_stmt_status'); + return _sqlite3_stmt_status( + arg0, + op, + resetFlg, + ); + } + + _dart_sqlite3_stmt_status _sqlite3_stmt_status; + + ffi.Pointer sqlite3_backup_init( + ffi.Pointer pDest, + ffi.Pointer zDestName, + ffi.Pointer pSource, + ffi.Pointer zSourceName, + ) { + _sqlite3_backup_init ??= _dylib.lookupFunction<_c_sqlite3_backup_init, + _dart_sqlite3_backup_init>('sqlite3_backup_init'); + return _sqlite3_backup_init( + pDest, + zDestName, + pSource, + zSourceName, + ); + } + + _dart_sqlite3_backup_init _sqlite3_backup_init; + + int sqlite3_backup_step( + ffi.Pointer p, + int nPage, + ) { + _sqlite3_backup_step ??= _dylib.lookupFunction<_c_sqlite3_backup_step, + _dart_sqlite3_backup_step>('sqlite3_backup_step'); + return _sqlite3_backup_step( + p, + nPage, + ); + } + + _dart_sqlite3_backup_step _sqlite3_backup_step; + + int sqlite3_backup_finish( + ffi.Pointer p, + ) { + _sqlite3_backup_finish ??= _dylib.lookupFunction<_c_sqlite3_backup_finish, + _dart_sqlite3_backup_finish>('sqlite3_backup_finish'); + return _sqlite3_backup_finish( + p, + ); + } + + _dart_sqlite3_backup_finish _sqlite3_backup_finish; + + int sqlite3_backup_remaining( + ffi.Pointer p, + ) { + _sqlite3_backup_remaining ??= _dylib.lookupFunction< + _c_sqlite3_backup_remaining, + _dart_sqlite3_backup_remaining>('sqlite3_backup_remaining'); + return _sqlite3_backup_remaining( + p, + ); + } + + _dart_sqlite3_backup_remaining _sqlite3_backup_remaining; + + int sqlite3_backup_pagecount( + ffi.Pointer p, + ) { + _sqlite3_backup_pagecount ??= _dylib.lookupFunction< + _c_sqlite3_backup_pagecount, + _dart_sqlite3_backup_pagecount>('sqlite3_backup_pagecount'); + return _sqlite3_backup_pagecount( + p, + ); + } + + _dart_sqlite3_backup_pagecount _sqlite3_backup_pagecount; + + int sqlite3_unlock_notify( + ffi.Pointer pBlocked, + ffi.Pointer> xNotify, + ffi.Pointer pNotifyArg, + ) { + _sqlite3_unlock_notify ??= _dylib.lookupFunction<_c_sqlite3_unlock_notify, + _dart_sqlite3_unlock_notify>('sqlite3_unlock_notify'); + return _sqlite3_unlock_notify( + pBlocked, + xNotify, + pNotifyArg, + ); + } + + _dart_sqlite3_unlock_notify _sqlite3_unlock_notify; + + int sqlite3_stricmp( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + _sqlite3_stricmp ??= + _dylib.lookupFunction<_c_sqlite3_stricmp, _dart_sqlite3_stricmp>( + 'sqlite3_stricmp'); + return _sqlite3_stricmp( + arg0, + arg1, + ); + } + + _dart_sqlite3_stricmp _sqlite3_stricmp; + + int sqlite3_strnicmp( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, + ) { + _sqlite3_strnicmp ??= + _dylib.lookupFunction<_c_sqlite3_strnicmp, _dart_sqlite3_strnicmp>( + 'sqlite3_strnicmp'); + return _sqlite3_strnicmp( + arg0, + arg1, + arg2, + ); + } + + _dart_sqlite3_strnicmp _sqlite3_strnicmp; + + int sqlite3_strglob( + ffi.Pointer zGlob, + ffi.Pointer zStr, + ) { + _sqlite3_strglob ??= + _dylib.lookupFunction<_c_sqlite3_strglob, _dart_sqlite3_strglob>( + 'sqlite3_strglob'); + return _sqlite3_strglob( + zGlob, + zStr, + ); + } + + _dart_sqlite3_strglob _sqlite3_strglob; + + int sqlite3_strlike( + ffi.Pointer zGlob, + ffi.Pointer zStr, + int cEsc, + ) { + _sqlite3_strlike ??= + _dylib.lookupFunction<_c_sqlite3_strlike, _dart_sqlite3_strlike>( + 'sqlite3_strlike'); + return _sqlite3_strlike( + zGlob, + zStr, + cEsc, + ); + } + + _dart_sqlite3_strlike _sqlite3_strlike; + + void sqlite3_log( + int iErrCode, + ffi.Pointer zFormat, + ) { + _sqlite3_log ??= + _dylib.lookupFunction<_c_sqlite3_log, _dart_sqlite3_log>('sqlite3_log'); + return _sqlite3_log( + iErrCode, + zFormat, + ); + } + + _dart_sqlite3_log _sqlite3_log; + + ffi.Pointer sqlite3_wal_hook( + ffi.Pointer arg0, + ffi.Pointer> arg1, + ffi.Pointer arg2, + ) { + _sqlite3_wal_hook ??= + _dylib.lookupFunction<_c_sqlite3_wal_hook, _dart_sqlite3_wal_hook>( + 'sqlite3_wal_hook'); + return _sqlite3_wal_hook( + arg0, + arg1, + arg2, + ); + } + + _dart_sqlite3_wal_hook _sqlite3_wal_hook; + + int sqlite3_wal_autocheckpoint( + ffi.Pointer db, + int N, + ) { + _sqlite3_wal_autocheckpoint ??= _dylib.lookupFunction< + _c_sqlite3_wal_autocheckpoint, + _dart_sqlite3_wal_autocheckpoint>('sqlite3_wal_autocheckpoint'); + return _sqlite3_wal_autocheckpoint( + db, + N, + ); + } + + _dart_sqlite3_wal_autocheckpoint _sqlite3_wal_autocheckpoint; + + int sqlite3_wal_checkpoint( + ffi.Pointer db, + ffi.Pointer zDb, + ) { + _sqlite3_wal_checkpoint ??= _dylib.lookupFunction<_c_sqlite3_wal_checkpoint, + _dart_sqlite3_wal_checkpoint>('sqlite3_wal_checkpoint'); + return _sqlite3_wal_checkpoint( + db, + zDb, + ); + } + + _dart_sqlite3_wal_checkpoint _sqlite3_wal_checkpoint; + + int sqlite3_wal_checkpoint_v2( + ffi.Pointer db, + ffi.Pointer zDb, + int eMode, + ffi.Pointer pnLog, + ffi.Pointer pnCkpt, + ) { + _sqlite3_wal_checkpoint_v2 ??= _dylib.lookupFunction< + _c_sqlite3_wal_checkpoint_v2, + _dart_sqlite3_wal_checkpoint_v2>('sqlite3_wal_checkpoint_v2'); + return _sqlite3_wal_checkpoint_v2( + db, + zDb, + eMode, + pnLog, + pnCkpt, + ); + } + + _dart_sqlite3_wal_checkpoint_v2 _sqlite3_wal_checkpoint_v2; + + int sqlite3_vtab_config( + ffi.Pointer arg0, + int op, + ) { + _sqlite3_vtab_config ??= _dylib.lookupFunction<_c_sqlite3_vtab_config, + _dart_sqlite3_vtab_config>('sqlite3_vtab_config'); + return _sqlite3_vtab_config( + arg0, + op, + ); + } + + _dart_sqlite3_vtab_config _sqlite3_vtab_config; + + int sqlite3_vtab_on_conflict( + ffi.Pointer arg0, + ) { + _sqlite3_vtab_on_conflict ??= _dylib.lookupFunction< + _c_sqlite3_vtab_on_conflict, + _dart_sqlite3_vtab_on_conflict>('sqlite3_vtab_on_conflict'); + return _sqlite3_vtab_on_conflict( + arg0, + ); + } + + _dart_sqlite3_vtab_on_conflict _sqlite3_vtab_on_conflict; + + int sqlite3_vtab_nochange( + ffi.Pointer arg0, + ) { + _sqlite3_vtab_nochange ??= _dylib.lookupFunction<_c_sqlite3_vtab_nochange, + _dart_sqlite3_vtab_nochange>('sqlite3_vtab_nochange'); + return _sqlite3_vtab_nochange( + arg0, + ); + } + + _dart_sqlite3_vtab_nochange _sqlite3_vtab_nochange; + + ffi.Pointer sqlite3_vtab_collation( + ffi.Pointer arg0, + int arg1, + ) { + _sqlite3_vtab_collation ??= _dylib.lookupFunction<_c_sqlite3_vtab_collation, + _dart_sqlite3_vtab_collation>('sqlite3_vtab_collation'); + return _sqlite3_vtab_collation( + arg0, + arg1, + ); + } + + _dart_sqlite3_vtab_collation _sqlite3_vtab_collation; + + int sqlite3_stmt_scanstatus( + ffi.Pointer pStmt, + int idx, + int iScanStatusOp, + ffi.Pointer pOut, + ) { + _sqlite3_stmt_scanstatus ??= _dylib.lookupFunction< + _c_sqlite3_stmt_scanstatus, + _dart_sqlite3_stmt_scanstatus>('sqlite3_stmt_scanstatus'); + return _sqlite3_stmt_scanstatus( + pStmt, + idx, + iScanStatusOp, + pOut, + ); + } + + _dart_sqlite3_stmt_scanstatus _sqlite3_stmt_scanstatus; + + void sqlite3_stmt_scanstatus_reset( + ffi.Pointer arg0, + ) { + _sqlite3_stmt_scanstatus_reset ??= _dylib.lookupFunction< + _c_sqlite3_stmt_scanstatus_reset, + _dart_sqlite3_stmt_scanstatus_reset>('sqlite3_stmt_scanstatus_reset'); + return _sqlite3_stmt_scanstatus_reset( + arg0, + ); + } + + _dart_sqlite3_stmt_scanstatus_reset _sqlite3_stmt_scanstatus_reset; + + int sqlite3_db_cacheflush( + ffi.Pointer arg0, + ) { + _sqlite3_db_cacheflush ??= _dylib.lookupFunction<_c_sqlite3_db_cacheflush, + _dart_sqlite3_db_cacheflush>('sqlite3_db_cacheflush'); + return _sqlite3_db_cacheflush( + arg0, + ); + } + + _dart_sqlite3_db_cacheflush _sqlite3_db_cacheflush; + + int sqlite3_system_errno( + ffi.Pointer arg0, + ) { + _sqlite3_system_errno ??= _dylib.lookupFunction<_c_sqlite3_system_errno, + _dart_sqlite3_system_errno>('sqlite3_system_errno'); + return _sqlite3_system_errno( + arg0, + ); + } + + _dart_sqlite3_system_errno _sqlite3_system_errno; + + int sqlite3_snapshot_get( + ffi.Pointer db, + ffi.Pointer zSchema, + ffi.Pointer> ppSnapshot, + ) { + _sqlite3_snapshot_get ??= _dylib.lookupFunction<_c_sqlite3_snapshot_get, + _dart_sqlite3_snapshot_get>('sqlite3_snapshot_get'); + return _sqlite3_snapshot_get( + db, + zSchema, + ppSnapshot, + ); + } + + _dart_sqlite3_snapshot_get _sqlite3_snapshot_get; + + int sqlite3_snapshot_open( + ffi.Pointer db, + ffi.Pointer zSchema, + ffi.Pointer pSnapshot, + ) { + _sqlite3_snapshot_open ??= _dylib.lookupFunction<_c_sqlite3_snapshot_open, + _dart_sqlite3_snapshot_open>('sqlite3_snapshot_open'); + return _sqlite3_snapshot_open( + db, + zSchema, + pSnapshot, + ); + } + + _dart_sqlite3_snapshot_open _sqlite3_snapshot_open; + + void sqlite3_snapshot_free( + ffi.Pointer arg0, + ) { + _sqlite3_snapshot_free ??= _dylib.lookupFunction<_c_sqlite3_snapshot_free, + _dart_sqlite3_snapshot_free>('sqlite3_snapshot_free'); + return _sqlite3_snapshot_free( + arg0, + ); + } + + _dart_sqlite3_snapshot_free _sqlite3_snapshot_free; + + int sqlite3_snapshot_cmp( + ffi.Pointer p1, + ffi.Pointer p2, + ) { + _sqlite3_snapshot_cmp ??= _dylib.lookupFunction<_c_sqlite3_snapshot_cmp, + _dart_sqlite3_snapshot_cmp>('sqlite3_snapshot_cmp'); + return _sqlite3_snapshot_cmp( + p1, + p2, + ); + } + + _dart_sqlite3_snapshot_cmp _sqlite3_snapshot_cmp; + + int sqlite3_snapshot_recover( + ffi.Pointer db, + ffi.Pointer zDb, + ) { + _sqlite3_snapshot_recover ??= _dylib.lookupFunction< + _c_sqlite3_snapshot_recover, + _dart_sqlite3_snapshot_recover>('sqlite3_snapshot_recover'); + return _sqlite3_snapshot_recover( + db, + zDb, + ); + } + + _dart_sqlite3_snapshot_recover _sqlite3_snapshot_recover; + + ffi.Pointer sqlite3_serialize( + ffi.Pointer db, + ffi.Pointer zSchema, + ffi.Pointer piSize, + int mFlags, + ) { + _sqlite3_serialize ??= + _dylib.lookupFunction<_c_sqlite3_serialize, _dart_sqlite3_serialize>( + 'sqlite3_serialize'); + return _sqlite3_serialize( + db, + zSchema, + piSize, + mFlags, + ); + } + + _dart_sqlite3_serialize _sqlite3_serialize; + + int sqlite3_deserialize( + ffi.Pointer db, + ffi.Pointer zSchema, + ffi.Pointer pData, + int szDb, + int szBuf, + int mFlags, + ) { + _sqlite3_deserialize ??= _dylib.lookupFunction<_c_sqlite3_deserialize, + _dart_sqlite3_deserialize>('sqlite3_deserialize'); + return _sqlite3_deserialize( + db, + zSchema, + pData, + szDb, + szBuf, + mFlags, + ); + } + + _dart_sqlite3_deserialize _sqlite3_deserialize; + + int sqlite3_rtree_geometry_callback( + ffi.Pointer db, + ffi.Pointer zGeom, + ffi.Pointer> xGeom, + ffi.Pointer pContext, + ) { + _sqlite3_rtree_geometry_callback ??= _dylib.lookupFunction< + _c_sqlite3_rtree_geometry_callback, + _dart_sqlite3_rtree_geometry_callback>( + 'sqlite3_rtree_geometry_callback'); + return _sqlite3_rtree_geometry_callback( + db, + zGeom, + xGeom, + pContext, + ); + } + + _dart_sqlite3_rtree_geometry_callback _sqlite3_rtree_geometry_callback; + + int sqlite3_rtree_query_callback( + ffi.Pointer db, + ffi.Pointer zQueryFunc, + ffi.Pointer> xQueryFunc, + ffi.Pointer pContext, + ffi.Pointer> xDestructor, + ) { + _sqlite3_rtree_query_callback ??= _dylib.lookupFunction< + _c_sqlite3_rtree_query_callback, + _dart_sqlite3_rtree_query_callback>('sqlite3_rtree_query_callback'); + return _sqlite3_rtree_query_callback( + db, + zQueryFunc, + xQueryFunc, + pContext, + xDestructor, + ); + } + + _dart_sqlite3_rtree_query_callback _sqlite3_rtree_query_callback; +} + +class sqlite3 extends ffi.Struct {} + +class sqlite3_file extends ffi.Struct {} + +class sqlite3_io_methods extends ffi.Struct { + @ffi.Int32() + int iVersion; + + ffi.Pointer> xClose; + + ffi.Pointer> xRead; + + ffi.Pointer> xWrite; + + ffi.Pointer> xTruncate; + + ffi.Pointer> xSync; + + ffi.Pointer> xFileSize; + + ffi.Pointer> xLock; + + ffi.Pointer> xUnlock; + + ffi.Pointer> xCheckReservedLock; + + ffi.Pointer> xFileControl; + + ffi.Pointer> xSectorSize; + + ffi.Pointer> xDeviceCharacteristics; + + ffi.Pointer> xShmMap; + + ffi.Pointer> xShmLock; + + ffi.Pointer> xShmBarrier; + + ffi.Pointer> xShmUnmap; + + ffi.Pointer> xFetch; + + ffi.Pointer> xUnfetch; +} + +class sqlite3_mutex extends ffi.Struct {} + +class sqlite3_api_routines extends ffi.Struct {} + +class sqlite3_vfs extends ffi.Struct {} + +class sqlite3_mem_methods extends ffi.Struct {} + +class sqlite3_stmt extends ffi.Struct {} + +class sqlite3_value extends ffi.Struct {} + +class sqlite3_context extends ffi.Struct {} + +class sqlite3_vtab extends ffi.Struct {} + +class sqlite3_index_info extends ffi.Struct {} + +class sqlite3_vtab_cursor extends ffi.Struct {} + +class sqlite3_module extends ffi.Struct {} + +class sqlite3_blob extends ffi.Struct {} + +class sqlite3_mutex_methods extends ffi.Struct {} + +class sqlite3_str extends ffi.Struct {} + +class sqlite3_pcache extends ffi.Struct {} + +class sqlite3_pcache_page extends ffi.Struct {} + +class sqlite3_pcache_methods2 extends ffi.Struct {} + +class sqlite3_pcache_methods extends ffi.Struct {} + +class sqlite3_backup extends ffi.Struct {} + +class sqlite3_snapshot extends ffi.Struct { + @ffi.Uint8() + int _unique_hidden_item_0; + @ffi.Uint8() + int _unique_hidden_item_1; + @ffi.Uint8() + int _unique_hidden_item_2; + @ffi.Uint8() + int _unique_hidden_item_3; + @ffi.Uint8() + int _unique_hidden_item_4; + @ffi.Uint8() + int _unique_hidden_item_5; + @ffi.Uint8() + int _unique_hidden_item_6; + @ffi.Uint8() + int _unique_hidden_item_7; + @ffi.Uint8() + int _unique_hidden_item_8; + @ffi.Uint8() + int _unique_hidden_item_9; + @ffi.Uint8() + int _unique_hidden_item_10; + @ffi.Uint8() + int _unique_hidden_item_11; + @ffi.Uint8() + int _unique_hidden_item_12; + @ffi.Uint8() + int _unique_hidden_item_13; + @ffi.Uint8() + int _unique_hidden_item_14; + @ffi.Uint8() + int _unique_hidden_item_15; + @ffi.Uint8() + int _unique_hidden_item_16; + @ffi.Uint8() + int _unique_hidden_item_17; + @ffi.Uint8() + int _unique_hidden_item_18; + @ffi.Uint8() + int _unique_hidden_item_19; + @ffi.Uint8() + int _unique_hidden_item_20; + @ffi.Uint8() + int _unique_hidden_item_21; + @ffi.Uint8() + int _unique_hidden_item_22; + @ffi.Uint8() + int _unique_hidden_item_23; + @ffi.Uint8() + int _unique_hidden_item_24; + @ffi.Uint8() + int _unique_hidden_item_25; + @ffi.Uint8() + int _unique_hidden_item_26; + @ffi.Uint8() + int _unique_hidden_item_27; + @ffi.Uint8() + int _unique_hidden_item_28; + @ffi.Uint8() + int _unique_hidden_item_29; + @ffi.Uint8() + int _unique_hidden_item_30; + @ffi.Uint8() + int _unique_hidden_item_31; + @ffi.Uint8() + int _unique_hidden_item_32; + @ffi.Uint8() + int _unique_hidden_item_33; + @ffi.Uint8() + int _unique_hidden_item_34; + @ffi.Uint8() + int _unique_hidden_item_35; + @ffi.Uint8() + int _unique_hidden_item_36; + @ffi.Uint8() + int _unique_hidden_item_37; + @ffi.Uint8() + int _unique_hidden_item_38; + @ffi.Uint8() + int _unique_hidden_item_39; + @ffi.Uint8() + int _unique_hidden_item_40; + @ffi.Uint8() + int _unique_hidden_item_41; + @ffi.Uint8() + int _unique_hidden_item_42; + @ffi.Uint8() + int _unique_hidden_item_43; + @ffi.Uint8() + int _unique_hidden_item_44; + @ffi.Uint8() + int _unique_hidden_item_45; + @ffi.Uint8() + int _unique_hidden_item_46; + @ffi.Uint8() + int _unique_hidden_item_47; + + /// Helper for array `hidden`. + ArrayHelper_sqlite3_snapshot_hidden_level0 get hidden => + ArrayHelper_sqlite3_snapshot_hidden_level0(this, [48], 0, 0); +} + +/// Helper for array `hidden` in struct `sqlite3_snapshot`. +class ArrayHelper_sqlite3_snapshot_hidden_level0 { + final sqlite3_snapshot _struct; + final List dimensions; + final int level; + final int _absoluteIndex; + int get length => dimensions[level]; + ArrayHelper_sqlite3_snapshot_hidden_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_hidden_item_0; + case 1: + return _struct._unique_hidden_item_1; + case 2: + return _struct._unique_hidden_item_2; + case 3: + return _struct._unique_hidden_item_3; + case 4: + return _struct._unique_hidden_item_4; + case 5: + return _struct._unique_hidden_item_5; + case 6: + return _struct._unique_hidden_item_6; + case 7: + return _struct._unique_hidden_item_7; + case 8: + return _struct._unique_hidden_item_8; + case 9: + return _struct._unique_hidden_item_9; + case 10: + return _struct._unique_hidden_item_10; + case 11: + return _struct._unique_hidden_item_11; + case 12: + return _struct._unique_hidden_item_12; + case 13: + return _struct._unique_hidden_item_13; + case 14: + return _struct._unique_hidden_item_14; + case 15: + return _struct._unique_hidden_item_15; + case 16: + return _struct._unique_hidden_item_16; + case 17: + return _struct._unique_hidden_item_17; + case 18: + return _struct._unique_hidden_item_18; + case 19: + return _struct._unique_hidden_item_19; + case 20: + return _struct._unique_hidden_item_20; + case 21: + return _struct._unique_hidden_item_21; + case 22: + return _struct._unique_hidden_item_22; + case 23: + return _struct._unique_hidden_item_23; + case 24: + return _struct._unique_hidden_item_24; + case 25: + return _struct._unique_hidden_item_25; + case 26: + return _struct._unique_hidden_item_26; + case 27: + return _struct._unique_hidden_item_27; + case 28: + return _struct._unique_hidden_item_28; + case 29: + return _struct._unique_hidden_item_29; + case 30: + return _struct._unique_hidden_item_30; + case 31: + return _struct._unique_hidden_item_31; + case 32: + return _struct._unique_hidden_item_32; + case 33: + return _struct._unique_hidden_item_33; + case 34: + return _struct._unique_hidden_item_34; + case 35: + return _struct._unique_hidden_item_35; + case 36: + return _struct._unique_hidden_item_36; + case 37: + return _struct._unique_hidden_item_37; + case 38: + return _struct._unique_hidden_item_38; + case 39: + return _struct._unique_hidden_item_39; + case 40: + return _struct._unique_hidden_item_40; + case 41: + return _struct._unique_hidden_item_41; + case 42: + return _struct._unique_hidden_item_42; + case 43: + return _struct._unique_hidden_item_43; + case 44: + return _struct._unique_hidden_item_44; + case 45: + return _struct._unique_hidden_item_45; + case 46: + return _struct._unique_hidden_item_46; + case 47: + return _struct._unique_hidden_item_47; + default: + throw Exception('Invalid Array Helper generated.'); + } + } + + void operator []=(int index, int value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._unique_hidden_item_0 = value; + break; + case 1: + _struct._unique_hidden_item_1 = value; + break; + case 2: + _struct._unique_hidden_item_2 = value; + break; + case 3: + _struct._unique_hidden_item_3 = value; + break; + case 4: + _struct._unique_hidden_item_4 = value; + break; + case 5: + _struct._unique_hidden_item_5 = value; + break; + case 6: + _struct._unique_hidden_item_6 = value; + break; + case 7: + _struct._unique_hidden_item_7 = value; + break; + case 8: + _struct._unique_hidden_item_8 = value; + break; + case 9: + _struct._unique_hidden_item_9 = value; + break; + case 10: + _struct._unique_hidden_item_10 = value; + break; + case 11: + _struct._unique_hidden_item_11 = value; + break; + case 12: + _struct._unique_hidden_item_12 = value; + break; + case 13: + _struct._unique_hidden_item_13 = value; + break; + case 14: + _struct._unique_hidden_item_14 = value; + break; + case 15: + _struct._unique_hidden_item_15 = value; + break; + case 16: + _struct._unique_hidden_item_16 = value; + break; + case 17: + _struct._unique_hidden_item_17 = value; + break; + case 18: + _struct._unique_hidden_item_18 = value; + break; + case 19: + _struct._unique_hidden_item_19 = value; + break; + case 20: + _struct._unique_hidden_item_20 = value; + break; + case 21: + _struct._unique_hidden_item_21 = value; + break; + case 22: + _struct._unique_hidden_item_22 = value; + break; + case 23: + _struct._unique_hidden_item_23 = value; + break; + case 24: + _struct._unique_hidden_item_24 = value; + break; + case 25: + _struct._unique_hidden_item_25 = value; + break; + case 26: + _struct._unique_hidden_item_26 = value; + break; + case 27: + _struct._unique_hidden_item_27 = value; + break; + case 28: + _struct._unique_hidden_item_28 = value; + break; + case 29: + _struct._unique_hidden_item_29 = value; + break; + case 30: + _struct._unique_hidden_item_30 = value; + break; + case 31: + _struct._unique_hidden_item_31 = value; + break; + case 32: + _struct._unique_hidden_item_32 = value; + break; + case 33: + _struct._unique_hidden_item_33 = value; + break; + case 34: + _struct._unique_hidden_item_34 = value; + break; + case 35: + _struct._unique_hidden_item_35 = value; + break; + case 36: + _struct._unique_hidden_item_36 = value; + break; + case 37: + _struct._unique_hidden_item_37 = value; + break; + case 38: + _struct._unique_hidden_item_38 = value; + break; + case 39: + _struct._unique_hidden_item_39 = value; + break; + case 40: + _struct._unique_hidden_item_40 = value; + break; + case 41: + _struct._unique_hidden_item_41 = value; + break; + case 42: + _struct._unique_hidden_item_42 = value; + break; + case 43: + _struct._unique_hidden_item_43 = value; + break; + case 44: + _struct._unique_hidden_item_44 = value; + break; + case 45: + _struct._unique_hidden_item_45 = value; + break; + case 46: + _struct._unique_hidden_item_46 = value; + break; + case 47: + _struct._unique_hidden_item_47 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); + } + } +} + +class sqlite3_rtree_geometry extends ffi.Struct {} + +class sqlite3_rtree_query_info extends ffi.Struct {} + +class Fts5ExtensionApi extends ffi.Struct {} + +class Fts5Context extends ffi.Struct {} + +class Fts5PhraseIter extends ffi.Struct {} + +class Fts5Tokenizer extends ffi.Struct {} + +class fts5_tokenizer extends ffi.Struct {} + +class fts5_api extends ffi.Struct {} + +typedef _c_sqlite3_libversion = ffi.Pointer Function(); + +typedef _dart_sqlite3_libversion = ffi.Pointer Function(); + +typedef _c_sqlite3_sourceid = ffi.Pointer Function(); + +typedef _dart_sqlite3_sourceid = ffi.Pointer Function(); + +typedef _c_sqlite3_libversion_number = ffi.Int32 Function(); + +typedef _dart_sqlite3_libversion_number = int Function(); + +typedef _c_sqlite3_compileoption_used = ffi.Int32 Function( + ffi.Pointer zOptName, +); + +typedef _dart_sqlite3_compileoption_used = int Function( + ffi.Pointer zOptName, +); + +typedef _c_sqlite3_compileoption_get = ffi.Pointer Function( + ffi.Int32 N, +); + +typedef _dart_sqlite3_compileoption_get = ffi.Pointer Function( + int N, +); + +typedef _c_sqlite3_threadsafe = ffi.Int32 Function(); + +typedef _dart_sqlite3_threadsafe = int Function(); + +typedef _c_sqlite3_close = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_close = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_close_v2 = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_close_v2 = int Function( + ffi.Pointer arg0, +); + +typedef _typedefC_13 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>, +); + +typedef _c_sqlite3_exec = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer sql, + ffi.Pointer> callback, + ffi.Pointer arg3, + ffi.Pointer> errmsg, +); + +typedef _dart_sqlite3_exec = int Function( + ffi.Pointer arg0, + ffi.Pointer sql, + ffi.Pointer> callback, + ffi.Pointer arg3, + ffi.Pointer> errmsg, +); + +typedef _c_sqlite3_initialize = ffi.Int32 Function(); + +typedef _dart_sqlite3_initialize = int Function(); + +typedef _c_sqlite3_shutdown = ffi.Int32 Function(); + +typedef _dart_sqlite3_shutdown = int Function(); + +typedef _c_sqlite3_os_init = ffi.Int32 Function(); + +typedef _dart_sqlite3_os_init = int Function(); + +typedef _c_sqlite3_os_end = ffi.Int32 Function(); + +typedef _dart_sqlite3_os_end = int Function(); + +typedef _c_sqlite3_config = ffi.Int32 Function( + ffi.Int32 arg0, +); + +typedef _dart_sqlite3_config = int Function( + int arg0, +); + +typedef _c_sqlite3_db_config = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 op, +); + +typedef _dart_sqlite3_db_config = int Function( + ffi.Pointer arg0, + int op, +); + +typedef _c_sqlite3_extended_result_codes = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 onoff, +); + +typedef _dart_sqlite3_extended_result_codes = int Function( + ffi.Pointer arg0, + int onoff, +); + +typedef _c_sqlite3_last_insert_rowid = ffi.Int64 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_last_insert_rowid = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_set_last_insert_rowid = ffi.Void Function( + ffi.Pointer arg0, + ffi.Int64 arg1, +); + +typedef _dart_sqlite3_set_last_insert_rowid = void Function( + ffi.Pointer arg0, + int arg1, +); + +typedef _c_sqlite3_changes = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_changes = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_total_changes = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_total_changes = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_interrupt = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_interrupt = void Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_complete = ffi.Int32 Function( + ffi.Pointer sql, +); + +typedef _dart_sqlite3_complete = int Function( + ffi.Pointer sql, +); + +typedef _c_sqlite3_complete16 = ffi.Int32 Function( + ffi.Pointer sql, +); + +typedef _dart_sqlite3_complete16 = int Function( + ffi.Pointer sql, +); + +typedef _typedefC_32 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, +); + +typedef _c_sqlite3_busy_handler = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer> arg1, + ffi.Pointer arg2, +); + +typedef _dart_sqlite3_busy_handler = int Function( + ffi.Pointer arg0, + ffi.Pointer> arg1, + ffi.Pointer arg2, +); + +typedef _c_sqlite3_busy_timeout = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 ms, +); + +typedef _dart_sqlite3_busy_timeout = int Function( + ffi.Pointer arg0, + int ms, +); + +typedef _c_sqlite3_get_table = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zSql, + ffi.Pointer>> pazResult, + ffi.Pointer pnRow, + ffi.Pointer pnColumn, + ffi.Pointer> pzErrmsg, +); + +typedef _dart_sqlite3_get_table = int Function( + ffi.Pointer db, + ffi.Pointer zSql, + ffi.Pointer>> pazResult, + ffi.Pointer pnRow, + ffi.Pointer pnColumn, + ffi.Pointer> pzErrmsg, +); + +typedef _c_sqlite3_free_table = ffi.Void Function( + ffi.Pointer> result, +); + +typedef _dart_sqlite3_free_table = void Function( + ffi.Pointer> result, +); + +typedef _c_sqlite3_mprintf = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_mprintf = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_snprintf = ffi.Pointer Function( + ffi.Int32 arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, +); + +typedef _dart_sqlite3_snprintf = ffi.Pointer Function( + int arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, +); + +typedef _c_sqlite3_malloc = ffi.Pointer Function( + ffi.Int32 arg0, +); + +typedef _dart_sqlite3_malloc = ffi.Pointer Function( + int arg0, +); + +typedef _c_sqlite3_malloc64 = ffi.Pointer Function( + ffi.Uint64 arg0, +); + +typedef _dart_sqlite3_malloc64 = ffi.Pointer Function( + int arg0, +); + +typedef _c_sqlite3_realloc = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Int32 arg1, +); + +typedef _dart_sqlite3_realloc = ffi.Pointer Function( + ffi.Pointer arg0, + int arg1, +); + +typedef _c_sqlite3_realloc64 = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Uint64 arg1, +); + +typedef _dart_sqlite3_realloc64 = ffi.Pointer Function( + ffi.Pointer arg0, + int arg1, +); + +typedef _c_sqlite3_free = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_free = void Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_msize = ffi.Uint64 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_msize = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_memory_used = ffi.Int64 Function(); + +typedef _dart_sqlite3_memory_used = int Function(); + +typedef _c_sqlite3_memory_highwater = ffi.Int64 Function( + ffi.Int32 resetFlag, +); + +typedef _dart_sqlite3_memory_highwater = int Function( + int resetFlag, +); + +typedef _c_sqlite3_randomness = ffi.Void Function( + ffi.Int32 N, + ffi.Pointer P, +); + +typedef _dart_sqlite3_randomness = void Function( + int N, + ffi.Pointer P, +); + +typedef _typedefC_33 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, +); + +typedef _c_sqlite3_set_authorizer = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer> xAuth, + ffi.Pointer pUserData, +); + +typedef _dart_sqlite3_set_authorizer = int Function( + ffi.Pointer arg0, + ffi.Pointer> xAuth, + ffi.Pointer pUserData, +); + +typedef _typedefC_34 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _c_sqlite3_trace = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer> xTrace, + ffi.Pointer arg2, +); + +typedef _dart_sqlite3_trace = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer> xTrace, + ffi.Pointer arg2, +); + +typedef _typedefC_35 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Uint64, +); + +typedef _c_sqlite3_profile = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer> xProfile, + ffi.Pointer arg2, +); + +typedef _dart_sqlite3_profile = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer> xProfile, + ffi.Pointer arg2, +); + +typedef _typedefC_36 = ffi.Int32 Function( + ffi.Uint32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, +); + +typedef _c_sqlite3_trace_v2 = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Uint32 uMask, + ffi.Pointer> xCallback, + ffi.Pointer pCtx, +); + +typedef _dart_sqlite3_trace_v2 = int Function( + ffi.Pointer arg0, + int uMask, + ffi.Pointer> xCallback, + ffi.Pointer pCtx, +); + +typedef _typedefC_37 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _c_sqlite3_progress_handler = ffi.Void Function( + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Pointer> arg2, + ffi.Pointer arg3, +); + +typedef _dart_sqlite3_progress_handler = void Function( + ffi.Pointer arg0, + int arg1, + ffi.Pointer> arg2, + ffi.Pointer arg3, +); + +typedef _c_sqlite3_open = ffi.Int32 Function( + ffi.Pointer filename, + ffi.Pointer> ppDb, +); + +typedef _dart_sqlite3_open = int Function( + ffi.Pointer filename, + ffi.Pointer> ppDb, +); + +typedef _c_sqlite3_open16 = ffi.Int32 Function( + ffi.Pointer filename, + ffi.Pointer> ppDb, +); + +typedef _dart_sqlite3_open16 = int Function( + ffi.Pointer filename, + ffi.Pointer> ppDb, +); + +typedef _c_sqlite3_open_v2 = ffi.Int32 Function( + ffi.Pointer filename, + ffi.Pointer> ppDb, + ffi.Int32 flags, + ffi.Pointer zVfs, +); + +typedef _dart_sqlite3_open_v2 = int Function( + ffi.Pointer filename, + ffi.Pointer> ppDb, + int flags, + ffi.Pointer zVfs, +); + +typedef _c_sqlite3_uri_parameter = ffi.Pointer Function( + ffi.Pointer zFilename, + ffi.Pointer zParam, +); + +typedef _dart_sqlite3_uri_parameter = ffi.Pointer Function( + ffi.Pointer zFilename, + ffi.Pointer zParam, +); + +typedef _c_sqlite3_uri_boolean = ffi.Int32 Function( + ffi.Pointer zFile, + ffi.Pointer zParam, + ffi.Int32 bDefault, +); + +typedef _dart_sqlite3_uri_boolean = int Function( + ffi.Pointer zFile, + ffi.Pointer zParam, + int bDefault, +); + +typedef _c_sqlite3_uri_int64 = ffi.Int64 Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Int64 arg2, +); + +typedef _dart_sqlite3_uri_int64 = int Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, +); + +typedef _c_sqlite3_uri_key = ffi.Pointer Function( + ffi.Pointer zFilename, + ffi.Int32 N, +); + +typedef _dart_sqlite3_uri_key = ffi.Pointer Function( + ffi.Pointer zFilename, + int N, +); + +typedef _c_sqlite3_filename_database = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_filename_database = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_filename_journal = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_filename_journal = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_filename_wal = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_filename_wal = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_database_file_object = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_database_file_object = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_create_filename = ffi.Pointer Function( + ffi.Pointer zDatabase, + ffi.Pointer zJournal, + ffi.Pointer zWal, + ffi.Int32 nParam, + ffi.Pointer> azParam, +); + +typedef _dart_sqlite3_create_filename = ffi.Pointer Function( + ffi.Pointer zDatabase, + ffi.Pointer zJournal, + ffi.Pointer zWal, + int nParam, + ffi.Pointer> azParam, +); + +typedef _c_sqlite3_free_filename = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_free_filename = void Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_errcode = ffi.Int32 Function( + ffi.Pointer db, +); + +typedef _dart_sqlite3_errcode = int Function( + ffi.Pointer db, +); + +typedef _c_sqlite3_extended_errcode = ffi.Int32 Function( + ffi.Pointer db, +); + +typedef _dart_sqlite3_extended_errcode = int Function( + ffi.Pointer db, +); + +typedef _c_sqlite3_errmsg = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_errmsg = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_errmsg16 = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_errmsg16 = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_errstr = ffi.Pointer Function( + ffi.Int32 arg0, +); + +typedef _dart_sqlite3_errstr = ffi.Pointer Function( + int arg0, +); + +typedef _c_sqlite3_limit = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 id, + ffi.Int32 newVal, +); + +typedef _dart_sqlite3_limit = int Function( + ffi.Pointer arg0, + int id, + int newVal, +); + +typedef _c_sqlite3_prepare = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zSql, + ffi.Int32 nByte, + ffi.Pointer> ppStmt, + ffi.Pointer> pzTail, +); + +typedef _dart_sqlite3_prepare = int Function( + ffi.Pointer db, + ffi.Pointer zSql, + int nByte, + ffi.Pointer> ppStmt, + ffi.Pointer> pzTail, +); + +typedef _c_sqlite3_prepare_v2 = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zSql, + ffi.Int32 nByte, + ffi.Pointer> ppStmt, + ffi.Pointer> pzTail, +); + +typedef _dart_sqlite3_prepare_v2 = int Function( + ffi.Pointer db, + ffi.Pointer zSql, + int nByte, + ffi.Pointer> ppStmt, + ffi.Pointer> pzTail, +); + +typedef _c_sqlite3_prepare_v3 = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zSql, + ffi.Int32 nByte, + ffi.Uint32 prepFlags, + ffi.Pointer> ppStmt, + ffi.Pointer> pzTail, +); + +typedef _dart_sqlite3_prepare_v3 = int Function( + ffi.Pointer db, + ffi.Pointer zSql, + int nByte, + int prepFlags, + ffi.Pointer> ppStmt, + ffi.Pointer> pzTail, +); + +typedef _c_sqlite3_prepare16 = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zSql, + ffi.Int32 nByte, + ffi.Pointer> ppStmt, + ffi.Pointer> pzTail, +); + +typedef _dart_sqlite3_prepare16 = int Function( + ffi.Pointer db, + ffi.Pointer zSql, + int nByte, + ffi.Pointer> ppStmt, + ffi.Pointer> pzTail, +); + +typedef _c_sqlite3_prepare16_v2 = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zSql, + ffi.Int32 nByte, + ffi.Pointer> ppStmt, + ffi.Pointer> pzTail, +); + +typedef _dart_sqlite3_prepare16_v2 = int Function( + ffi.Pointer db, + ffi.Pointer zSql, + int nByte, + ffi.Pointer> ppStmt, + ffi.Pointer> pzTail, +); + +typedef _c_sqlite3_prepare16_v3 = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zSql, + ffi.Int32 nByte, + ffi.Uint32 prepFlags, + ffi.Pointer> ppStmt, + ffi.Pointer> pzTail, +); + +typedef _dart_sqlite3_prepare16_v3 = int Function( + ffi.Pointer db, + ffi.Pointer zSql, + int nByte, + int prepFlags, + ffi.Pointer> ppStmt, + ffi.Pointer> pzTail, +); + +typedef _c_sqlite3_sql = ffi.Pointer Function( + ffi.Pointer pStmt, +); + +typedef _dart_sqlite3_sql = ffi.Pointer Function( + ffi.Pointer pStmt, +); + +typedef _c_sqlite3_expanded_sql = ffi.Pointer Function( + ffi.Pointer pStmt, +); + +typedef _dart_sqlite3_expanded_sql = ffi.Pointer Function( + ffi.Pointer pStmt, +); + +typedef _c_sqlite3_normalized_sql = ffi.Pointer Function( + ffi.Pointer pStmt, +); + +typedef _dart_sqlite3_normalized_sql = ffi.Pointer Function( + ffi.Pointer pStmt, +); + +typedef _c_sqlite3_stmt_readonly = ffi.Int32 Function( + ffi.Pointer pStmt, +); + +typedef _dart_sqlite3_stmt_readonly = int Function( + ffi.Pointer pStmt, +); + +typedef _c_sqlite3_stmt_isexplain = ffi.Int32 Function( + ffi.Pointer pStmt, +); + +typedef _dart_sqlite3_stmt_isexplain = int Function( + ffi.Pointer pStmt, +); + +typedef _c_sqlite3_stmt_busy = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_stmt_busy = int Function( + ffi.Pointer arg0, +); + +typedef _typedefC_38 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_bind_blob = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Pointer arg2, + ffi.Int32 n, + ffi.Pointer> arg4, +); + +typedef _dart_sqlite3_bind_blob = int Function( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, + int n, + ffi.Pointer> arg4, +); + +typedef _typedefC_39 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_bind_blob64 = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Pointer arg2, + ffi.Uint64 arg3, + ffi.Pointer> arg4, +); + +typedef _dart_sqlite3_bind_blob64 = int Function( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer> arg4, +); + +typedef _c_sqlite3_bind_double = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Double arg2, +); + +typedef _dart_sqlite3_bind_double = int Function( + ffi.Pointer arg0, + int arg1, + double arg2, +); + +typedef _c_sqlite3_bind_int = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Int32 arg2, +); + +typedef _dart_sqlite3_bind_int = int Function( + ffi.Pointer arg0, + int arg1, + int arg2, +); + +typedef _c_sqlite3_bind_int64 = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Int64 arg2, +); + +typedef _dart_sqlite3_bind_int64 = int Function( + ffi.Pointer arg0, + int arg1, + int arg2, +); + +typedef _c_sqlite3_bind_null = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 arg1, +); + +typedef _dart_sqlite3_bind_null = int Function( + ffi.Pointer arg0, + int arg1, +); + +typedef _typedefC_40 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_bind_text = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Pointer arg2, + ffi.Int32 arg3, + ffi.Pointer> arg4, +); + +typedef _dart_sqlite3_bind_text = int Function( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer> arg4, +); + +typedef _typedefC_41 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_bind_text16 = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Pointer arg2, + ffi.Int32 arg3, + ffi.Pointer> arg4, +); + +typedef _dart_sqlite3_bind_text16 = int Function( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer> arg4, +); + +typedef _typedefC_42 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_bind_text64 = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Pointer arg2, + ffi.Uint64 arg3, + ffi.Pointer> arg4, + ffi.Uint8 encoding, +); + +typedef _dart_sqlite3_bind_text64 = int Function( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer> arg4, + int encoding, +); + +typedef _c_sqlite3_bind_value = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Pointer arg2, +); + +typedef _dart_sqlite3_bind_value = int Function( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, +); + +typedef _typedefC_43 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_bind_pointer = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer> arg4, +); + +typedef _dart_sqlite3_bind_pointer = int Function( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer> arg4, +); + +typedef _c_sqlite3_bind_zeroblob = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Int32 n, +); + +typedef _dart_sqlite3_bind_zeroblob = int Function( + ffi.Pointer arg0, + int arg1, + int n, +); + +typedef _c_sqlite3_bind_zeroblob64 = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Uint64 arg2, +); + +typedef _dart_sqlite3_bind_zeroblob64 = int Function( + ffi.Pointer arg0, + int arg1, + int arg2, +); + +typedef _c_sqlite3_bind_parameter_count = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_bind_parameter_count = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_bind_parameter_name = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Int32 arg1, +); + +typedef _dart_sqlite3_bind_parameter_name = ffi.Pointer Function( + ffi.Pointer arg0, + int arg1, +); + +typedef _c_sqlite3_bind_parameter_index = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer zName, +); + +typedef _dart_sqlite3_bind_parameter_index = int Function( + ffi.Pointer arg0, + ffi.Pointer zName, +); + +typedef _c_sqlite3_clear_bindings = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_clear_bindings = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_column_count = ffi.Int32 Function( + ffi.Pointer pStmt, +); + +typedef _dart_sqlite3_column_count = int Function( + ffi.Pointer pStmt, +); + +typedef _c_sqlite3_column_name = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Int32 N, +); + +typedef _dart_sqlite3_column_name = ffi.Pointer Function( + ffi.Pointer arg0, + int N, +); + +typedef _c_sqlite3_column_name16 = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Int32 N, +); + +typedef _dart_sqlite3_column_name16 = ffi.Pointer Function( + ffi.Pointer arg0, + int N, +); + +typedef _c_sqlite3_column_database_name = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Int32 arg1, +); + +typedef _dart_sqlite3_column_database_name = ffi.Pointer Function( + ffi.Pointer arg0, + int arg1, +); + +typedef _c_sqlite3_column_database_name16 = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Int32 arg1, +); + +typedef _dart_sqlite3_column_database_name16 = ffi.Pointer Function( + ffi.Pointer arg0, + int arg1, +); + +typedef _c_sqlite3_column_table_name = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Int32 arg1, +); + +typedef _dart_sqlite3_column_table_name = ffi.Pointer Function( + ffi.Pointer arg0, + int arg1, +); + +typedef _c_sqlite3_column_table_name16 = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Int32 arg1, +); + +typedef _dart_sqlite3_column_table_name16 = ffi.Pointer Function( + ffi.Pointer arg0, + int arg1, +); + +typedef _c_sqlite3_column_origin_name = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Int32 arg1, +); + +typedef _dart_sqlite3_column_origin_name = ffi.Pointer Function( + ffi.Pointer arg0, + int arg1, +); + +typedef _c_sqlite3_column_origin_name16 = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Int32 arg1, +); + +typedef _dart_sqlite3_column_origin_name16 = ffi.Pointer Function( + ffi.Pointer arg0, + int arg1, +); + +typedef _c_sqlite3_column_decltype = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Int32 arg1, +); + +typedef _dart_sqlite3_column_decltype = ffi.Pointer Function( + ffi.Pointer arg0, + int arg1, +); + +typedef _c_sqlite3_column_decltype16 = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Int32 arg1, +); + +typedef _dart_sqlite3_column_decltype16 = ffi.Pointer Function( + ffi.Pointer arg0, + int arg1, +); + +typedef _c_sqlite3_step = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_step = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_data_count = ffi.Int32 Function( + ffi.Pointer pStmt, +); + +typedef _dart_sqlite3_data_count = int Function( + ffi.Pointer pStmt, +); + +typedef _c_sqlite3_column_blob = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Int32 iCol, +); + +typedef _dart_sqlite3_column_blob = ffi.Pointer Function( + ffi.Pointer arg0, + int iCol, +); + +typedef _c_sqlite3_column_double = ffi.Double Function( + ffi.Pointer arg0, + ffi.Int32 iCol, +); + +typedef _dart_sqlite3_column_double = double Function( + ffi.Pointer arg0, + int iCol, +); + +typedef _c_sqlite3_column_int = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 iCol, +); + +typedef _dart_sqlite3_column_int = int Function( + ffi.Pointer arg0, + int iCol, +); + +typedef _c_sqlite3_column_int64 = ffi.Int64 Function( + ffi.Pointer arg0, + ffi.Int32 iCol, +); + +typedef _dart_sqlite3_column_int64 = int Function( + ffi.Pointer arg0, + int iCol, +); + +typedef _c_sqlite3_column_text = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Int32 iCol, +); + +typedef _dart_sqlite3_column_text = ffi.Pointer Function( + ffi.Pointer arg0, + int iCol, +); + +typedef _c_sqlite3_column_text16 = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Int32 iCol, +); + +typedef _dart_sqlite3_column_text16 = ffi.Pointer Function( + ffi.Pointer arg0, + int iCol, +); + +typedef _c_sqlite3_column_value = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Int32 iCol, +); + +typedef _dart_sqlite3_column_value = ffi.Pointer Function( + ffi.Pointer arg0, + int iCol, +); + +typedef _c_sqlite3_column_bytes = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 iCol, +); + +typedef _dart_sqlite3_column_bytes = int Function( + ffi.Pointer arg0, + int iCol, +); + +typedef _c_sqlite3_column_bytes16 = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 iCol, +); + +typedef _dart_sqlite3_column_bytes16 = int Function( + ffi.Pointer arg0, + int iCol, +); + +typedef _c_sqlite3_column_type = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 iCol, +); + +typedef _dart_sqlite3_column_type = int Function( + ffi.Pointer arg0, + int iCol, +); + +typedef _c_sqlite3_finalize = ffi.Int32 Function( + ffi.Pointer pStmt, +); + +typedef _dart_sqlite3_finalize = int Function( + ffi.Pointer pStmt, +); + +typedef _c_sqlite3_reset = ffi.Int32 Function( + ffi.Pointer pStmt, +); + +typedef _dart_sqlite3_reset = int Function( + ffi.Pointer pStmt, +); + +typedef _typedefC_44 = ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, +); + +typedef _typedefC_45 = ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, +); + +typedef _typedefC_46 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_create_function = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zFunctionName, + ffi.Int32 nArg, + ffi.Int32 eTextRep, + ffi.Pointer pApp, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, +); + +typedef _dart_sqlite3_create_function = int Function( + ffi.Pointer db, + ffi.Pointer zFunctionName, + int nArg, + int eTextRep, + ffi.Pointer pApp, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, +); + +typedef _typedefC_47 = ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, +); + +typedef _typedefC_48 = ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, +); + +typedef _typedefC_49 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_create_function16 = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zFunctionName, + ffi.Int32 nArg, + ffi.Int32 eTextRep, + ffi.Pointer pApp, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, +); + +typedef _dart_sqlite3_create_function16 = int Function( + ffi.Pointer db, + ffi.Pointer zFunctionName, + int nArg, + int eTextRep, + ffi.Pointer pApp, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, +); + +typedef _typedefC_50 = ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, +); + +typedef _typedefC_51 = ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, +); + +typedef _typedefC_52 = ffi.Void Function( + ffi.Pointer, +); + +typedef _typedefC_53 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_create_function_v2 = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zFunctionName, + ffi.Int32 nArg, + ffi.Int32 eTextRep, + ffi.Pointer pApp, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, + ffi.Pointer> xDestroy, +); + +typedef _dart_sqlite3_create_function_v2 = int Function( + ffi.Pointer db, + ffi.Pointer zFunctionName, + int nArg, + int eTextRep, + ffi.Pointer pApp, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, + ffi.Pointer> xDestroy, +); + +typedef _typedefC_54 = ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, +); + +typedef _typedefC_55 = ffi.Void Function( + ffi.Pointer, +); + +typedef _typedefC_56 = ffi.Void Function( + ffi.Pointer, +); + +typedef _typedefC_57 = ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, +); + +typedef _typedefC_58 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_create_window_function = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zFunctionName, + ffi.Int32 nArg, + ffi.Int32 eTextRep, + ffi.Pointer pApp, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, + ffi.Pointer> xValue, + ffi.Pointer> xInverse, + ffi.Pointer> xDestroy, +); + +typedef _dart_sqlite3_create_window_function = int Function( + ffi.Pointer db, + ffi.Pointer zFunctionName, + int nArg, + int eTextRep, + ffi.Pointer pApp, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, + ffi.Pointer> xValue, + ffi.Pointer> xInverse, + ffi.Pointer> xDestroy, +); + +typedef _c_sqlite3_aggregate_count = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_aggregate_count = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_expired = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_expired = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_transfer_bindings = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +typedef _dart_sqlite3_transfer_bindings = int Function( + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +typedef _c_sqlite3_global_recover = ffi.Int32 Function(); + +typedef _dart_sqlite3_global_recover = int Function(); + +typedef _c_sqlite3_thread_cleanup = ffi.Void Function(); + +typedef _dart_sqlite3_thread_cleanup = void Function(); + +typedef _typedefC_59 = ffi.Void Function( + ffi.Pointer, + ffi.Int64, + ffi.Int32, +); + +typedef _c_sqlite3_memory_alarm = ffi.Int32 Function( + ffi.Pointer> arg0, + ffi.Pointer arg1, + ffi.Int64 arg2, +); + +typedef _dart_sqlite3_memory_alarm = int Function( + ffi.Pointer> arg0, + ffi.Pointer arg1, + int arg2, +); + +typedef _c_sqlite3_value_blob = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_value_blob = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_value_double = ffi.Double Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_value_double = double Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_value_int = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_value_int = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_value_int64 = ffi.Int64 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_value_int64 = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_value_pointer = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +typedef _dart_sqlite3_value_pointer = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +typedef _c_sqlite3_value_text = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_value_text = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_value_text16 = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_value_text16 = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_value_text16le = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_value_text16le = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_value_text16be = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_value_text16be = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_value_bytes = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_value_bytes = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_value_bytes16 = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_value_bytes16 = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_value_type = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_value_type = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_value_numeric_type = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_value_numeric_type = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_value_nochange = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_value_nochange = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_value_frombind = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_value_frombind = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_value_subtype = ffi.Uint32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_value_subtype = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_value_dup = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_value_dup = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_value_free = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_value_free = void Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_aggregate_context = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Int32 nBytes, +); + +typedef _dart_sqlite3_aggregate_context = ffi.Pointer Function( + ffi.Pointer arg0, + int nBytes, +); + +typedef _c_sqlite3_user_data = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_user_data = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_context_db_handle = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_context_db_handle = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_get_auxdata = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Int32 N, +); + +typedef _dart_sqlite3_get_auxdata = ffi.Pointer Function( + ffi.Pointer arg0, + int N, +); + +typedef _typedefC_60 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_set_auxdata = ffi.Void Function( + ffi.Pointer arg0, + ffi.Int32 N, + ffi.Pointer arg2, + ffi.Pointer> arg3, +); + +typedef _dart_sqlite3_set_auxdata = void Function( + ffi.Pointer arg0, + int N, + ffi.Pointer arg2, + ffi.Pointer> arg3, +); + +typedef _typedefC_61 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_result_blob = ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Int32 arg2, + ffi.Pointer> arg3, +); + +typedef _dart_sqlite3_result_blob = void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, + ffi.Pointer> arg3, +); + +typedef _typedefC_62 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_result_blob64 = ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Uint64 arg2, + ffi.Pointer> arg3, +); + +typedef _dart_sqlite3_result_blob64 = void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, + ffi.Pointer> arg3, +); + +typedef _c_sqlite3_result_double = ffi.Void Function( + ffi.Pointer arg0, + ffi.Double arg1, +); + +typedef _dart_sqlite3_result_double = void Function( + ffi.Pointer arg0, + double arg1, +); + +typedef _c_sqlite3_result_error = ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Int32 arg2, +); + +typedef _dart_sqlite3_result_error = void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, +); + +typedef _c_sqlite3_result_error16 = ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Int32 arg2, +); + +typedef _dart_sqlite3_result_error16 = void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, +); + +typedef _c_sqlite3_result_error_toobig = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_result_error_toobig = void Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_result_error_nomem = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_result_error_nomem = void Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_result_error_code = ffi.Void Function( + ffi.Pointer arg0, + ffi.Int32 arg1, +); + +typedef _dart_sqlite3_result_error_code = void Function( + ffi.Pointer arg0, + int arg1, +); + +typedef _c_sqlite3_result_int = ffi.Void Function( + ffi.Pointer arg0, + ffi.Int32 arg1, +); + +typedef _dart_sqlite3_result_int = void Function( + ffi.Pointer arg0, + int arg1, +); + +typedef _c_sqlite3_result_int64 = ffi.Void Function( + ffi.Pointer arg0, + ffi.Int64 arg1, +); + +typedef _dart_sqlite3_result_int64 = void Function( + ffi.Pointer arg0, + int arg1, +); + +typedef _c_sqlite3_result_null = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_result_null = void Function( + ffi.Pointer arg0, +); + +typedef _typedefC_63 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_result_text = ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Int32 arg2, + ffi.Pointer> arg3, +); + +typedef _dart_sqlite3_result_text = void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, + ffi.Pointer> arg3, +); + +typedef _typedefC_64 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_result_text64 = ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Uint64 arg2, + ffi.Pointer> arg3, + ffi.Uint8 encoding, +); + +typedef _dart_sqlite3_result_text64 = void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, + ffi.Pointer> arg3, + int encoding, +); + +typedef _typedefC_65 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_result_text16 = ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Int32 arg2, + ffi.Pointer> arg3, +); + +typedef _dart_sqlite3_result_text16 = void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, + ffi.Pointer> arg3, +); + +typedef _typedefC_66 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_result_text16le = ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Int32 arg2, + ffi.Pointer> arg3, +); + +typedef _dart_sqlite3_result_text16le = void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, + ffi.Pointer> arg3, +); + +typedef _typedefC_67 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_result_text16be = ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Int32 arg2, + ffi.Pointer> arg3, +); + +typedef _dart_sqlite3_result_text16be = void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, + ffi.Pointer> arg3, +); + +typedef _c_sqlite3_result_value = ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +typedef _dart_sqlite3_result_value = void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +typedef _typedefC_68 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_result_pointer = ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3, +); + +typedef _dart_sqlite3_result_pointer = void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3, +); + +typedef _c_sqlite3_result_zeroblob = ffi.Void Function( + ffi.Pointer arg0, + ffi.Int32 n, +); + +typedef _dart_sqlite3_result_zeroblob = void Function( + ffi.Pointer arg0, + int n, +); + +typedef _c_sqlite3_result_zeroblob64 = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Uint64 n, +); + +typedef _dart_sqlite3_result_zeroblob64 = int Function( + ffi.Pointer arg0, + int n, +); + +typedef _c_sqlite3_result_subtype = ffi.Void Function( + ffi.Pointer arg0, + ffi.Uint32 arg1, +); + +typedef _dart_sqlite3_result_subtype = void Function( + ffi.Pointer arg0, + int arg1, +); + +typedef _typedefC_69 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, +); + +typedef _c_sqlite3_create_collation = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer zName, + ffi.Int32 eTextRep, + ffi.Pointer pArg, + ffi.Pointer> xCompare, +); + +typedef _dart_sqlite3_create_collation = int Function( + ffi.Pointer arg0, + ffi.Pointer zName, + int eTextRep, + ffi.Pointer pArg, + ffi.Pointer> xCompare, +); + +typedef _typedefC_70 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, +); + +typedef _typedefC_71 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_create_collation_v2 = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer zName, + ffi.Int32 eTextRep, + ffi.Pointer pArg, + ffi.Pointer> xCompare, + ffi.Pointer> xDestroy, +); + +typedef _dart_sqlite3_create_collation_v2 = int Function( + ffi.Pointer arg0, + ffi.Pointer zName, + int eTextRep, + ffi.Pointer pArg, + ffi.Pointer> xCompare, + ffi.Pointer> xDestroy, +); + +typedef _typedefC_72 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, +); + +typedef _c_sqlite3_create_collation16 = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer zName, + ffi.Int32 eTextRep, + ffi.Pointer pArg, + ffi.Pointer> xCompare, +); + +typedef _dart_sqlite3_create_collation16 = int Function( + ffi.Pointer arg0, + ffi.Pointer zName, + int eTextRep, + ffi.Pointer pArg, + ffi.Pointer> xCompare, +); + +typedef _typedefC_73 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, +); + +typedef _c_sqlite3_collation_needed = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer> arg2, +); + +typedef _dart_sqlite3_collation_needed = int Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer> arg2, +); + +typedef _typedefC_74 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, +); + +typedef _c_sqlite3_collation_needed16 = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer> arg2, +); + +typedef _dart_sqlite3_collation_needed16 = int Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer> arg2, +); + +typedef _c_sqlite3_sleep = ffi.Int32 Function( + ffi.Int32 arg0, +); + +typedef _dart_sqlite3_sleep = int Function( + int arg0, +); + +typedef _c_sqlite3_win32_set_directory = ffi.Int32 Function( + ffi.Uint64 type, + ffi.Pointer zValue, +); + +typedef _dart_sqlite3_win32_set_directory = int Function( + int type, + ffi.Pointer zValue, +); + +typedef _c_sqlite3_win32_set_directory8 = ffi.Int32 Function( + ffi.Uint64 type, + ffi.Pointer zValue, +); + +typedef _dart_sqlite3_win32_set_directory8 = int Function( + int type, + ffi.Pointer zValue, +); + +typedef _c_sqlite3_win32_set_directory16 = ffi.Int32 Function( + ffi.Uint64 type, + ffi.Pointer zValue, +); + +typedef _dart_sqlite3_win32_set_directory16 = int Function( + int type, + ffi.Pointer zValue, +); + +typedef _c_sqlite3_get_autocommit = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_get_autocommit = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_db_handle = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_db_handle = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_db_filename = ffi.Pointer Function( + ffi.Pointer db, + ffi.Pointer zDbName, +); + +typedef _dart_sqlite3_db_filename = ffi.Pointer Function( + ffi.Pointer db, + ffi.Pointer zDbName, +); + +typedef _c_sqlite3_db_readonly = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zDbName, +); + +typedef _dart_sqlite3_db_readonly = int Function( + ffi.Pointer db, + ffi.Pointer zDbName, +); + +typedef _c_sqlite3_next_stmt = ffi.Pointer Function( + ffi.Pointer pDb, + ffi.Pointer pStmt, +); + +typedef _dart_sqlite3_next_stmt = ffi.Pointer Function( + ffi.Pointer pDb, + ffi.Pointer pStmt, +); + +typedef _typedefC_75 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _c_sqlite3_commit_hook = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer> arg1, + ffi.Pointer arg2, +); + +typedef _dart_sqlite3_commit_hook = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer> arg1, + ffi.Pointer arg2, +); + +typedef _typedefC_76 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_rollback_hook = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer> arg1, + ffi.Pointer arg2, +); + +typedef _dart_sqlite3_rollback_hook = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer> arg1, + ffi.Pointer arg2, +); + +typedef _typedefC_77 = ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, +); + +typedef _c_sqlite3_update_hook = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer> arg1, + ffi.Pointer arg2, +); + +typedef _dart_sqlite3_update_hook = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer> arg1, + ffi.Pointer arg2, +); + +typedef _c_sqlite3_enable_shared_cache = ffi.Int32 Function( + ffi.Int32 arg0, +); + +typedef _dart_sqlite3_enable_shared_cache = int Function( + int arg0, +); + +typedef _c_sqlite3_release_memory = ffi.Int32 Function( + ffi.Int32 arg0, +); + +typedef _dart_sqlite3_release_memory = int Function( + int arg0, +); + +typedef _c_sqlite3_db_release_memory = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_db_release_memory = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_soft_heap_limit64 = ffi.Int64 Function( + ffi.Int64 N, +); + +typedef _dart_sqlite3_soft_heap_limit64 = int Function( + int N, +); + +typedef _c_sqlite3_hard_heap_limit64 = ffi.Int64 Function( + ffi.Int64 N, +); + +typedef _dart_sqlite3_hard_heap_limit64 = int Function( + int N, +); + +typedef _c_sqlite3_soft_heap_limit = ffi.Void Function( + ffi.Int32 N, +); + +typedef _dart_sqlite3_soft_heap_limit = void Function( + int N, +); + +typedef _c_sqlite3_table_column_metadata = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zDbName, + ffi.Pointer zTableName, + ffi.Pointer zColumnName, + ffi.Pointer> pzDataType, + ffi.Pointer> pzCollSeq, + ffi.Pointer pNotNull, + ffi.Pointer pPrimaryKey, + ffi.Pointer pAutoinc, +); + +typedef _dart_sqlite3_table_column_metadata = int Function( + ffi.Pointer db, + ffi.Pointer zDbName, + ffi.Pointer zTableName, + ffi.Pointer zColumnName, + ffi.Pointer> pzDataType, + ffi.Pointer> pzCollSeq, + ffi.Pointer pNotNull, + ffi.Pointer pPrimaryKey, + ffi.Pointer pAutoinc, +); + +typedef _c_sqlite3_load_extension = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zFile, + ffi.Pointer zProc, + ffi.Pointer> pzErrMsg, +); + +typedef _dart_sqlite3_load_extension = int Function( + ffi.Pointer db, + ffi.Pointer zFile, + ffi.Pointer zProc, + ffi.Pointer> pzErrMsg, +); + +typedef _c_sqlite3_enable_load_extension = ffi.Int32 Function( + ffi.Pointer db, + ffi.Int32 onoff, +); + +typedef _dart_sqlite3_enable_load_extension = int Function( + ffi.Pointer db, + int onoff, +); + +typedef _typedefC_78 = ffi.Void Function(); + +typedef _c_sqlite3_auto_extension = ffi.Int32 Function( + ffi.Pointer> xEntryPoint, +); + +typedef _dart_sqlite3_auto_extension = int Function( + ffi.Pointer> xEntryPoint, +); + +typedef _typedefC_79 = ffi.Void Function(); + +typedef _c_sqlite3_cancel_auto_extension = ffi.Int32 Function( + ffi.Pointer> xEntryPoint, +); + +typedef _dart_sqlite3_cancel_auto_extension = int Function( + ffi.Pointer> xEntryPoint, +); + +typedef _c_sqlite3_reset_auto_extension = ffi.Void Function(); + +typedef _dart_sqlite3_reset_auto_extension = void Function(); + +typedef _c_sqlite3_create_module = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zName, + ffi.Pointer p, + ffi.Pointer pClientData, +); + +typedef _dart_sqlite3_create_module = int Function( + ffi.Pointer db, + ffi.Pointer zName, + ffi.Pointer p, + ffi.Pointer pClientData, +); + +typedef _typedefC_80 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_create_module_v2 = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zName, + ffi.Pointer p, + ffi.Pointer pClientData, + ffi.Pointer> xDestroy, +); + +typedef _dart_sqlite3_create_module_v2 = int Function( + ffi.Pointer db, + ffi.Pointer zName, + ffi.Pointer p, + ffi.Pointer pClientData, + ffi.Pointer> xDestroy, +); + +typedef _c_sqlite3_drop_modules = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer> azKeep, +); + +typedef _dart_sqlite3_drop_modules = int Function( + ffi.Pointer db, + ffi.Pointer> azKeep, +); + +typedef _c_sqlite3_declare_vtab = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer zSQL, +); + +typedef _dart_sqlite3_declare_vtab = int Function( + ffi.Pointer arg0, + ffi.Pointer zSQL, +); + +typedef _c_sqlite3_overload_function = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer zFuncName, + ffi.Int32 nArg, +); + +typedef _dart_sqlite3_overload_function = int Function( + ffi.Pointer arg0, + ffi.Pointer zFuncName, + int nArg, +); + +typedef _c_sqlite3_blob_open = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer zDb, + ffi.Pointer zTable, + ffi.Pointer zColumn, + ffi.Int64 iRow, + ffi.Int32 flags, + ffi.Pointer> ppBlob, +); + +typedef _dart_sqlite3_blob_open = int Function( + ffi.Pointer arg0, + ffi.Pointer zDb, + ffi.Pointer zTable, + ffi.Pointer zColumn, + int iRow, + int flags, + ffi.Pointer> ppBlob, +); + +typedef _c_sqlite3_blob_reopen = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int64 arg1, +); + +typedef _dart_sqlite3_blob_reopen = int Function( + ffi.Pointer arg0, + int arg1, +); + +typedef _c_sqlite3_blob_close = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_blob_close = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_blob_bytes = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_blob_bytes = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_blob_read = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer Z, + ffi.Int32 N, + ffi.Int32 iOffset, +); + +typedef _dart_sqlite3_blob_read = int Function( + ffi.Pointer arg0, + ffi.Pointer Z, + int N, + int iOffset, +); + +typedef _c_sqlite3_blob_write = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer z, + ffi.Int32 n, + ffi.Int32 iOffset, +); + +typedef _dart_sqlite3_blob_write = int Function( + ffi.Pointer arg0, + ffi.Pointer z, + int n, + int iOffset, +); + +typedef _c_sqlite3_vfs_find = ffi.Pointer Function( + ffi.Pointer zVfsName, +); + +typedef _dart_sqlite3_vfs_find = ffi.Pointer Function( + ffi.Pointer zVfsName, +); + +typedef _c_sqlite3_vfs_register = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 makeDflt, +); + +typedef _dart_sqlite3_vfs_register = int Function( + ffi.Pointer arg0, + int makeDflt, +); + +typedef _c_sqlite3_vfs_unregister = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_vfs_unregister = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_mutex_alloc = ffi.Pointer Function( + ffi.Int32 arg0, +); + +typedef _dart_sqlite3_mutex_alloc = ffi.Pointer Function( + int arg0, +); + +typedef _c_sqlite3_mutex_free = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_mutex_free = void Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_mutex_enter = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_mutex_enter = void Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_mutex_try = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_mutex_try = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_mutex_leave = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_mutex_leave = void Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_mutex_held = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_mutex_held = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_mutex_notheld = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_mutex_notheld = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_db_mutex = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_db_mutex = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_file_control = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer zDbName, + ffi.Int32 op, + ffi.Pointer arg3, +); + +typedef _dart_sqlite3_file_control = int Function( + ffi.Pointer arg0, + ffi.Pointer zDbName, + int op, + ffi.Pointer arg3, +); + +typedef _c_sqlite3_test_control = ffi.Int32 Function( + ffi.Int32 op, +); + +typedef _dart_sqlite3_test_control = int Function( + int op, +); + +typedef _c_sqlite3_keyword_count = ffi.Int32 Function(); + +typedef _dart_sqlite3_keyword_count = int Function(); + +typedef _c_sqlite3_keyword_name = ffi.Int32 Function( + ffi.Int32 arg0, + ffi.Pointer> arg1, + ffi.Pointer arg2, +); + +typedef _dart_sqlite3_keyword_name = int Function( + int arg0, + ffi.Pointer> arg1, + ffi.Pointer arg2, +); + +typedef _c_sqlite3_keyword_check = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 arg1, +); + +typedef _dart_sqlite3_keyword_check = int Function( + ffi.Pointer arg0, + int arg1, +); + +typedef _c_sqlite3_str_new = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_str_new = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_str_finish = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_str_finish = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_str_appendf = ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer zFormat, +); + +typedef _dart_sqlite3_str_appendf = void Function( + ffi.Pointer arg0, + ffi.Pointer zFormat, +); + +typedef _c_sqlite3_str_append = ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer zIn, + ffi.Int32 N, +); + +typedef _dart_sqlite3_str_append = void Function( + ffi.Pointer arg0, + ffi.Pointer zIn, + int N, +); + +typedef _c_sqlite3_str_appendall = ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer zIn, +); + +typedef _dart_sqlite3_str_appendall = void Function( + ffi.Pointer arg0, + ffi.Pointer zIn, +); + +typedef _c_sqlite3_str_appendchar = ffi.Void Function( + ffi.Pointer arg0, + ffi.Int32 N, + ffi.Int8 C, +); + +typedef _dart_sqlite3_str_appendchar = void Function( + ffi.Pointer arg0, + int N, + int C, +); + +typedef _c_sqlite3_str_reset = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_str_reset = void Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_str_errcode = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_str_errcode = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_str_length = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_str_length = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_str_value = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_str_value = ffi.Pointer Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_status = ffi.Int32 Function( + ffi.Int32 op, + ffi.Pointer pCurrent, + ffi.Pointer pHighwater, + ffi.Int32 resetFlag, +); + +typedef _dart_sqlite3_status = int Function( + int op, + ffi.Pointer pCurrent, + ffi.Pointer pHighwater, + int resetFlag, +); + +typedef _c_sqlite3_status64 = ffi.Int32 Function( + ffi.Int32 op, + ffi.Pointer pCurrent, + ffi.Pointer pHighwater, + ffi.Int32 resetFlag, +); + +typedef _dart_sqlite3_status64 = int Function( + int op, + ffi.Pointer pCurrent, + ffi.Pointer pHighwater, + int resetFlag, +); + +typedef _c_sqlite3_db_status = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 op, + ffi.Pointer pCur, + ffi.Pointer pHiwtr, + ffi.Int32 resetFlg, +); + +typedef _dart_sqlite3_db_status = int Function( + ffi.Pointer arg0, + int op, + ffi.Pointer pCur, + ffi.Pointer pHiwtr, + int resetFlg, +); + +typedef _c_sqlite3_stmt_status = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 op, + ffi.Int32 resetFlg, +); + +typedef _dart_sqlite3_stmt_status = int Function( + ffi.Pointer arg0, + int op, + int resetFlg, +); + +typedef _c_sqlite3_backup_init = ffi.Pointer Function( + ffi.Pointer pDest, + ffi.Pointer zDestName, + ffi.Pointer pSource, + ffi.Pointer zSourceName, +); + +typedef _dart_sqlite3_backup_init = ffi.Pointer Function( + ffi.Pointer pDest, + ffi.Pointer zDestName, + ffi.Pointer pSource, + ffi.Pointer zSourceName, +); + +typedef _c_sqlite3_backup_step = ffi.Int32 Function( + ffi.Pointer p, + ffi.Int32 nPage, +); + +typedef _dart_sqlite3_backup_step = int Function( + ffi.Pointer p, + int nPage, +); + +typedef _c_sqlite3_backup_finish = ffi.Int32 Function( + ffi.Pointer p, +); + +typedef _dart_sqlite3_backup_finish = int Function( + ffi.Pointer p, +); + +typedef _c_sqlite3_backup_remaining = ffi.Int32 Function( + ffi.Pointer p, +); + +typedef _dart_sqlite3_backup_remaining = int Function( + ffi.Pointer p, +); + +typedef _c_sqlite3_backup_pagecount = ffi.Int32 Function( + ffi.Pointer p, +); + +typedef _dart_sqlite3_backup_pagecount = int Function( + ffi.Pointer p, +); + +typedef _typedefC_81 = ffi.Void Function( + ffi.Pointer>, + ffi.Int32, +); + +typedef _c_sqlite3_unlock_notify = ffi.Int32 Function( + ffi.Pointer pBlocked, + ffi.Pointer> xNotify, + ffi.Pointer pNotifyArg, +); + +typedef _dart_sqlite3_unlock_notify = int Function( + ffi.Pointer pBlocked, + ffi.Pointer> xNotify, + ffi.Pointer pNotifyArg, +); + +typedef _c_sqlite3_stricmp = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +typedef _dart_sqlite3_stricmp = int Function( + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +typedef _c_sqlite3_strnicmp = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Int32 arg2, +); + +typedef _dart_sqlite3_strnicmp = int Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, +); + +typedef _c_sqlite3_strglob = ffi.Int32 Function( + ffi.Pointer zGlob, + ffi.Pointer zStr, +); + +typedef _dart_sqlite3_strglob = int Function( + ffi.Pointer zGlob, + ffi.Pointer zStr, +); + +typedef _c_sqlite3_strlike = ffi.Int32 Function( + ffi.Pointer zGlob, + ffi.Pointer zStr, + ffi.Uint32 cEsc, +); + +typedef _dart_sqlite3_strlike = int Function( + ffi.Pointer zGlob, + ffi.Pointer zStr, + int cEsc, +); + +typedef _c_sqlite3_log = ffi.Void Function( + ffi.Int32 iErrCode, + ffi.Pointer zFormat, +); + +typedef _dart_sqlite3_log = void Function( + int iErrCode, + ffi.Pointer zFormat, +); + +typedef _typedefC_82 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, +); + +typedef _c_sqlite3_wal_hook = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer> arg1, + ffi.Pointer arg2, +); + +typedef _dart_sqlite3_wal_hook = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer> arg1, + ffi.Pointer arg2, +); + +typedef _c_sqlite3_wal_autocheckpoint = ffi.Int32 Function( + ffi.Pointer db, + ffi.Int32 N, +); + +typedef _dart_sqlite3_wal_autocheckpoint = int Function( + ffi.Pointer db, + int N, +); + +typedef _c_sqlite3_wal_checkpoint = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zDb, +); + +typedef _dart_sqlite3_wal_checkpoint = int Function( + ffi.Pointer db, + ffi.Pointer zDb, +); + +typedef _c_sqlite3_wal_checkpoint_v2 = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zDb, + ffi.Int32 eMode, + ffi.Pointer pnLog, + ffi.Pointer pnCkpt, +); + +typedef _dart_sqlite3_wal_checkpoint_v2 = int Function( + ffi.Pointer db, + ffi.Pointer zDb, + int eMode, + ffi.Pointer pnLog, + ffi.Pointer pnCkpt, +); + +typedef _c_sqlite3_vtab_config = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 op, +); + +typedef _dart_sqlite3_vtab_config = int Function( + ffi.Pointer arg0, + int op, +); + +typedef _c_sqlite3_vtab_on_conflict = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_vtab_on_conflict = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_vtab_nochange = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_vtab_nochange = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_vtab_collation = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Int32 arg1, +); + +typedef _dart_sqlite3_vtab_collation = ffi.Pointer Function( + ffi.Pointer arg0, + int arg1, +); + +typedef _c_sqlite3_stmt_scanstatus = ffi.Int32 Function( + ffi.Pointer pStmt, + ffi.Int32 idx, + ffi.Int32 iScanStatusOp, + ffi.Pointer pOut, +); + +typedef _dart_sqlite3_stmt_scanstatus = int Function( + ffi.Pointer pStmt, + int idx, + int iScanStatusOp, + ffi.Pointer pOut, +); + +typedef _c_sqlite3_stmt_scanstatus_reset = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_stmt_scanstatus_reset = void Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_db_cacheflush = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_db_cacheflush = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_system_errno = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_system_errno = int Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_snapshot_get = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zSchema, + ffi.Pointer> ppSnapshot, +); + +typedef _dart_sqlite3_snapshot_get = int Function( + ffi.Pointer db, + ffi.Pointer zSchema, + ffi.Pointer> ppSnapshot, +); + +typedef _c_sqlite3_snapshot_open = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zSchema, + ffi.Pointer pSnapshot, +); + +typedef _dart_sqlite3_snapshot_open = int Function( + ffi.Pointer db, + ffi.Pointer zSchema, + ffi.Pointer pSnapshot, +); + +typedef _c_sqlite3_snapshot_free = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_sqlite3_snapshot_free = void Function( + ffi.Pointer arg0, +); + +typedef _c_sqlite3_snapshot_cmp = ffi.Int32 Function( + ffi.Pointer p1, + ffi.Pointer p2, +); + +typedef _dart_sqlite3_snapshot_cmp = int Function( + ffi.Pointer p1, + ffi.Pointer p2, +); + +typedef _c_sqlite3_snapshot_recover = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zDb, +); + +typedef _dart_sqlite3_snapshot_recover = int Function( + ffi.Pointer db, + ffi.Pointer zDb, +); + +typedef _c_sqlite3_serialize = ffi.Pointer Function( + ffi.Pointer db, + ffi.Pointer zSchema, + ffi.Pointer piSize, + ffi.Uint32 mFlags, +); + +typedef _dart_sqlite3_serialize = ffi.Pointer Function( + ffi.Pointer db, + ffi.Pointer zSchema, + ffi.Pointer piSize, + int mFlags, +); + +typedef _c_sqlite3_deserialize = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zSchema, + ffi.Pointer pData, + ffi.Int64 szDb, + ffi.Int64 szBuf, + ffi.Uint32 mFlags, +); + +typedef _dart_sqlite3_deserialize = int Function( + ffi.Pointer db, + ffi.Pointer zSchema, + ffi.Pointer pData, + int szDb, + int szBuf, + int mFlags, +); + +typedef _typedefC_83 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, +); + +typedef _c_sqlite3_rtree_geometry_callback = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zGeom, + ffi.Pointer> xGeom, + ffi.Pointer pContext, +); + +typedef _dart_sqlite3_rtree_geometry_callback = int Function( + ffi.Pointer db, + ffi.Pointer zGeom, + ffi.Pointer> xGeom, + ffi.Pointer pContext, +); + +typedef _typedefC_84 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_85 = ffi.Void Function( + ffi.Pointer, +); + +typedef _c_sqlite3_rtree_query_callback = ffi.Int32 Function( + ffi.Pointer db, + ffi.Pointer zQueryFunc, + ffi.Pointer> xQueryFunc, + ffi.Pointer pContext, + ffi.Pointer> xDestructor, +); + +typedef _dart_sqlite3_rtree_query_callback = int Function( + ffi.Pointer db, + ffi.Pointer zQueryFunc, + ffi.Pointer> xQueryFunc, + ffi.Pointer pContext, + ffi.Pointer> xDestructor, +); + +typedef _typedefC_14 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_15 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int64, +); + +typedef _typedefC_16 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int64, +); + +typedef _typedefC_17 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int64, +); + +typedef _typedefC_18 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, +); + +typedef _typedefC_19 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_20 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, +); + +typedef _typedefC_21 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, +); + +typedef _typedefC_22 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_23 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, +); + +typedef _typedefC_24 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_25 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_26 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Int32, + ffi.Pointer>, +); + +typedef _typedefC_27 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Int32, +); + +typedef _typedefC_28 = ffi.Void Function( + ffi.Pointer, +); + +typedef _typedefC_29 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, +); + +typedef _typedefC_30 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int64, + ffi.Int32, + ffi.Pointer>, +); + +typedef _typedefC_31 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int64, + ffi.Pointer, +); diff --git a/pkgs/ffigen/test/large_integration_tests/large_test.dart b/pkgs/ffigen/test/large_integration_tests/large_test.dart new file mode 100644 index 0000000000..87d9f2e441 --- /dev/null +++ b/pkgs/ffigen/test/large_integration_tests/large_test.dart @@ -0,0 +1,135 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:io'; + +import 'package:ffigen/src/header_parser.dart'; +import 'package:yaml/yaml.dart'; +import 'package:ffigen/src/config_provider/config.dart'; +import 'package:test/test.dart'; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:path/path.dart' as path; + +void main() { + group('large_test', () { + test('Libclang test', () { + final config = Config.fromYaml(loadYaml(''' +${strings.name}: LibClang +${strings.description}: Bindings to LibClang. +${strings.output}: unused +${strings.libclang_dylib_folder}: tool/wrapped_libclang +${strings.compilerOpts}: -I${path.join('third_party', 'libclang', 'include')} +${strings.arrayWorkaround}: true +${strings.headers}: + - third_party/libclang/include/clang-c/Index.h +${strings.headerFilter}: + include: + - 'BuildSystem.h' + - 'CXCompilationDatabase.h' + - 'CXErrorCode.h' + - 'CXString.h' + - 'Documentation.h' + - 'FataErrorHandler.h' + - 'Index.h' + ''') as YamlMap); + final library = parse(config); + final file = File( + path.join('test', 'debug_generated', 'large_test_libclang.dart'), + ); + library.generateFile(file); + + try { + final actual = file.readAsStringSync(); + final expected = File(path.join('test', 'large_integration_tests', + '_expected_libclang_bindings.dart')) + .readAsStringSync(); + expect(actual, expected); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + print('Failed test: Debug generated file: ${file.absolute?.path}'); + rethrow; + } + }); + + test('CJSON test', () { + final config = Config.fromYaml(loadYaml(''' +${strings.name}: CJson +${strings.description}: Bindings to Cjson. +${strings.output}: unused +${strings.comments}: full +${strings.libclang_dylib_folder}: tool/wrapped_libclang +${strings.arrayWorkaround}: true +${strings.headers}: + - third_party/cjson_library/cJSON.h +${strings.headerFilter}: + include: + - 'cJSON.h' + ''') as YamlMap); + final library = parse(config); + final file = File( + path.join('test', 'debug_generated', 'large_test_cjson.dart'), + ); + library.generateFile(file); + + try { + final actual = file.readAsStringSync(); + final expected = File(path.join('test', 'large_integration_tests', + '_expected_cjson_bindings.dart')) + .readAsStringSync(); + expect(actual, expected); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + print('Failed test: Debug generated file: ${file.absolute?.path}'); + rethrow; + } + }); + + test('SQLite test', () { + // Excluding functions that use 'va_list' because it can either be a + // Pointer<__va_list_tag> or int depending on the OS. + final config = Config.fromYaml(loadYaml(''' +${strings.name}: SQLite +${strings.description}: Bindings to SQLite. +${strings.output}: unused +${strings.libclang_dylib_folder}: tool/wrapped_libclang +${strings.arrayWorkaround}: true +${strings.comments}: full +${strings.headers}: + - third_party/sqlite/sqlite3.h +${strings.headerFilter}: + ${strings.include}: + - 'sqlite3.h' +${strings.functions}: + ${strings.exclude}: + ${strings.names}: + - sqlite3_vmprintf + - sqlite3_vsnprintf + - sqlite3_str_vappendf + ''') as YamlMap); + final library = parse(config); + final file = File( + path.join('test', 'debug_generated', 'large_test_sqlite.dart'), + ); + library.generateFile(file); + + try { + final actual = file.readAsStringSync(); + final expected = File(path.join('test', 'large_integration_tests', + '_expected_sqlite_bindings.dart')) + .readAsStringSync(); + expect(actual, expected); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + print('Failed test: Debug generated file: ${file.absolute?.path}'); + rethrow; + } + }); + }); +} diff --git a/pkgs/ffigen/test/native_test/native_test.dart b/pkgs/ffigen/test/native_test/native_test.dart index 11e18a8692..eab5dfe29e 100644 --- a/pkgs/ffigen/test/native_test/native_test.dart +++ b/pkgs/ffigen/test/native_test/native_test.dart @@ -10,7 +10,7 @@ import 'package:test/test.dart'; import 'native_test_bindings.dart' as bindings; void main() { - group('Tests for native functions', () { + group('native_test', () { setUpAll(() { var dylibName = 'test/native_test/native_test.so'; if (Platform.isMacOS) { diff --git a/pkgs/ffigen/test/native_test/native_test.def b/pkgs/ffigen/test/native_test/native_test.def index f2d6f914a8..f6853d167b 100644 --- a/pkgs/ffigen/test/native_test/native_test.def +++ b/pkgs/ffigen/test/native_test/native_test.def @@ -13,4 +13,5 @@ Function1Int32 Function1Int64 Function1IntPtr Function1Float -Function1Double \ No newline at end of file +Function1Double +getStruct1 diff --git a/pkgs/ffigen/test/prefix_tests/prefix_test.dart b/pkgs/ffigen/test/prefix_tests/prefix_test.dart index 0f913278f0..0031c3b6ec 100644 --- a/pkgs/ffigen/test/prefix_tests/prefix_test.dart +++ b/pkgs/ffigen/test/prefix_tests/prefix_test.dart @@ -1,14 +1,16 @@ // Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. + import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/config_provider.dart'; -import 'package:logging/logging.dart'; import 'package:test/test.dart'; import 'package:yaml/yaml.dart' as yaml; import 'package:ffigen/src/strings.dart' as strings; +import '../test_utils.dart'; + Library actual, expected; final functionPrefix = 'fff'; final structPrefix = 'sss'; @@ -19,14 +21,8 @@ final structPrefixReplacedWith = 'rs'; final enumPrefixReplacedWith = 're'; void main() { - group('Global Prefix Test', () { + group('prefix_test', () { setUpAll(() { - Logger.root.onRecord.listen((log) { - if (log.level > Level.INFO) { - print( - 'prefix_test.dart: ${log.level.name.padRight(8)}: ${log.message}'); - } - }); expected = expectedLibrary(); actual = parser.parse(Config.fromYaml(yaml.loadYaml(''' ${strings.name}: 'NativeLibrary' @@ -58,45 +54,41 @@ enums: }); test('Function prefix', () { - expect(binding(actual, '${functionPrefix}func1'), - binding(expected, '${functionPrefix}func1')); + expect(actual.getBindingAsString('${functionPrefix}func1'), + expected.getBindingAsString('${functionPrefix}func1')); }); test('Struct prefix', () { - expect(binding(actual, '${structPrefix}Struct1'), - binding(expected, '${structPrefix}Struct1')); + expect(actual.getBindingAsString('${structPrefix}Struct1'), + expected.getBindingAsString('${structPrefix}Struct1')); }); test('Enum prefix', () { - expect(binding(actual, '${enumPrefix}Enum1'), - binding(expected, '${enumPrefix}Enum1')); + expect(actual.getBindingAsString('${enumPrefix}Enum1'), + expected.getBindingAsString('${enumPrefix}Enum1')); }); test('Function prefix-replacement', () { expect( - binding( - actual, '${functionPrefix}${functionPrefixReplacedWith}func2'), - binding( - expected, '${functionPrefix}${functionPrefixReplacedWith}func2')); + actual.getBindingAsString( + '${functionPrefix}${functionPrefixReplacedWith}func2'), + expected.getBindingAsString( + '${functionPrefix}${functionPrefixReplacedWith}func2')); }); test('Struct prefix-replacement', () { expect( - binding(actual, '${structPrefix}${structPrefixReplacedWith}Struct2'), - binding( - expected, '${structPrefix}${structPrefixReplacedWith}Struct2')); + actual.getBindingAsString( + '${structPrefix}${structPrefixReplacedWith}Struct2'), + expected.getBindingAsString( + '${structPrefix}${structPrefixReplacedWith}Struct2')); }); test('Enum prefix-replacement', () { - expect(binding(actual, '${enumPrefix}${enumPrefixReplacedWith}Enum2'), - binding(expected, '${enumPrefix}${enumPrefixReplacedWith}Enum2')); + expect( + actual.getBindingAsString( + '${enumPrefix}${enumPrefixReplacedWith}Enum2'), + expected.getBindingAsString( + '${enumPrefix}${enumPrefixReplacedWith}Enum2')); }); }); } -/// Extracts a binding's string with a given name from a library. -String binding(Library lib, String name) { - return lib.bindings - .firstWhere((element) => element.name == name) - .toBindingString(lib.writer) - .string; -} - Library expectedLibrary() { final struc1 = Struc(name: '${structPrefix}Struct1'); final struc2 = @@ -106,7 +98,7 @@ Library expectedLibrary() { bindings: [ Func( name: '${functionPrefix}func1', - lookupSymbolName: 'func1', + originalName: 'func1', returnType: Type.nativeType( SupportedNativeType.Void, ), @@ -119,7 +111,7 @@ Library expectedLibrary() { ), Func( name: '${functionPrefix}${functionPrefixReplacedWith}func2', - lookupSymbolName: 'test_func2', + originalName: 'test_func2', returnType: Type.nativeType( SupportedNativeType.Void, ), diff --git a/pkgs/ffigen/test/test_utils.dart b/pkgs/ffigen/test/test_utils.dart new file mode 100644 index 0000000000..4b9d9ebc98 --- /dev/null +++ b/pkgs/ffigen/test/test_utils.dart @@ -0,0 +1,49 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:logging/logging.dart'; + +/// Extracts a binding's string from a library. + +extension LibraryTestExt on Library { + /// Get a [Binding]'s generated string with a given name. + String getBindingAsString(String name) { + final b = bindings.firstWhere((element) => element.name == name, + orElse: () => null); + if (b == null) { + throw NotFoundException("Binding '$name' not found."); + } else { + return b.toBindingString(writer).string; + } + } + + /// Get a [Binding] with a given name. + Binding getBinding(String name) { + final b = bindings.firstWhere((element) => element.name == name, + orElse: () => null); + if (b == null) { + throw NotFoundException("Binding '$name' not found."); + } else { + return b; + } + } +} + +class NotFoundException implements Exception { + final String message; + NotFoundException(this.message); + + @override + String toString() { + return message; + } +} + +void logWarnings() { + Logger.root.level = Level.WARNING; + Logger.root.onRecord.listen((record) { + print('${record.level.name.padRight(8)}: ${record.message}'); + }); +} diff --git a/pkgs/ffigen/third_party/libclang/include/clang-c/BuildSystem.h b/pkgs/ffigen/third_party/libclang/include/clang-c/BuildSystem.h new file mode 100644 index 0000000000..4e9f6dee02 --- /dev/null +++ b/pkgs/ffigen/third_party/libclang/include/clang-c/BuildSystem.h @@ -0,0 +1,153 @@ +/*==-- clang-c/BuildSystem.h - Utilities for use by build systems -*- C -*-===*\ +|* *| +|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *| +|* Exceptions. *| +|* See https://llvm.org/LICENSE.txt for license information. *| +|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *| +|* *| +|*===----------------------------------------------------------------------===*| +|* *| +|* This header provides various utilities for use by build systems. *| +|* *| +\*===----------------------------------------------------------------------===*/ + +#ifndef LLVM_CLANG_C_BUILDSYSTEM_H +#define LLVM_CLANG_C_BUILDSYSTEM_H + +#include "clang-c/CXErrorCode.h" +#include "clang-c/CXString.h" +#include "clang-c/ExternC.h" +#include "clang-c/Platform.h" + +LLVM_CLANG_C_EXTERN_C_BEGIN + +/** + * \defgroup BUILD_SYSTEM Build system utilities + * @{ + */ + +/** + * Return the timestamp for use with Clang's + * \c -fbuild-session-timestamp= option. + */ +CINDEX_LINKAGE unsigned long long clang_getBuildSessionTimestamp(void); + +/** + * Object encapsulating information about overlaying virtual + * file/directories over the real file system. + */ +typedef struct CXVirtualFileOverlayImpl *CXVirtualFileOverlay; + +/** + * Create a \c CXVirtualFileOverlay object. + * Must be disposed with \c clang_VirtualFileOverlay_dispose(). + * + * \param options is reserved, always pass 0. + */ +CINDEX_LINKAGE CXVirtualFileOverlay +clang_VirtualFileOverlay_create(unsigned options); + +/** + * Map an absolute virtual file path to an absolute real one. + * The virtual path must be canonicalized (not contain "."/".."). + * \returns 0 for success, non-zero to indicate an error. + */ +CINDEX_LINKAGE enum CXErrorCode +clang_VirtualFileOverlay_addFileMapping(CXVirtualFileOverlay, + const char *virtualPath, + const char *realPath); + +/** + * Set the case sensitivity for the \c CXVirtualFileOverlay object. + * The \c CXVirtualFileOverlay object is case-sensitive by default, this + * option can be used to override the default. + * \returns 0 for success, non-zero to indicate an error. + */ +CINDEX_LINKAGE enum CXErrorCode +clang_VirtualFileOverlay_setCaseSensitivity(CXVirtualFileOverlay, + int caseSensitive); + +/** + * Write out the \c CXVirtualFileOverlay object to a char buffer. + * + * \param options is reserved, always pass 0. + * \param out_buffer_ptr pointer to receive the buffer pointer, which should be + * disposed using \c clang_free(). + * \param out_buffer_size pointer to receive the buffer size. + * \returns 0 for success, non-zero to indicate an error. + */ +CINDEX_LINKAGE enum CXErrorCode +clang_VirtualFileOverlay_writeToBuffer(CXVirtualFileOverlay, unsigned options, + char **out_buffer_ptr, + unsigned *out_buffer_size); + +/** + * free memory allocated by libclang, such as the buffer returned by + * \c CXVirtualFileOverlay() or \c clang_ModuleMapDescriptor_writeToBuffer(). + * + * \param buffer memory pointer to free. + */ +CINDEX_LINKAGE void clang_free(void *buffer); + +/** + * Dispose a \c CXVirtualFileOverlay object. + */ +CINDEX_LINKAGE void clang_VirtualFileOverlay_dispose(CXVirtualFileOverlay); + +/** + * Object encapsulating information about a module.map file. + */ +typedef struct CXModuleMapDescriptorImpl *CXModuleMapDescriptor; + +/** + * Create a \c CXModuleMapDescriptor object. + * Must be disposed with \c clang_ModuleMapDescriptor_dispose(). + * + * \param options is reserved, always pass 0. + */ +CINDEX_LINKAGE CXModuleMapDescriptor +clang_ModuleMapDescriptor_create(unsigned options); + +/** + * Sets the framework module name that the module.map describes. + * \returns 0 for success, non-zero to indicate an error. + */ +CINDEX_LINKAGE enum CXErrorCode +clang_ModuleMapDescriptor_setFrameworkModuleName(CXModuleMapDescriptor, + const char *name); + +/** + * Sets the umbrealla header name that the module.map describes. + * \returns 0 for success, non-zero to indicate an error. + */ +CINDEX_LINKAGE enum CXErrorCode +clang_ModuleMapDescriptor_setUmbrellaHeader(CXModuleMapDescriptor, + const char *name); + +/** + * Write out the \c CXModuleMapDescriptor object to a char buffer. + * + * \param options is reserved, always pass 0. + * \param out_buffer_ptr pointer to receive the buffer pointer, which should be + * disposed using \c clang_free(). + * \param out_buffer_size pointer to receive the buffer size. + * \returns 0 for success, non-zero to indicate an error. + */ +CINDEX_LINKAGE enum CXErrorCode +clang_ModuleMapDescriptor_writeToBuffer(CXModuleMapDescriptor, unsigned options, + char **out_buffer_ptr, + unsigned *out_buffer_size); + +/** + * Dispose a \c CXModuleMapDescriptor object. + */ +CINDEX_LINKAGE void clang_ModuleMapDescriptor_dispose(CXModuleMapDescriptor); + +/** + * @} + */ + +LLVM_CLANG_C_EXTERN_C_END + +#endif /* CLANG_C_BUILD_SYSTEM_H */ + diff --git a/pkgs/ffigen/third_party/libclang/include/clang-c/CXCompilationDatabase.h b/pkgs/ffigen/third_party/libclang/include/clang-c/CXCompilationDatabase.h new file mode 100644 index 0000000000..2b336e5464 --- /dev/null +++ b/pkgs/ffigen/third_party/libclang/include/clang-c/CXCompilationDatabase.h @@ -0,0 +1,174 @@ +/*===-- clang-c/CXCompilationDatabase.h - Compilation database ---*- C -*-===*\ +|* *| +|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *| +|* Exceptions. *| +|* See https://llvm.org/LICENSE.txt for license information. *| +|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *| +|* *| +|*===----------------------------------------------------------------------===*| +|* *| +|* This header provides a public interface to use CompilationDatabase without *| +|* the full Clang C++ API. *| +|* *| +\*===----------------------------------------------------------------------===*/ + +#ifndef LLVM_CLANG_C_CXCOMPILATIONDATABASE_H +#define LLVM_CLANG_C_CXCOMPILATIONDATABASE_H + +#include "clang-c/CXString.h" +#include "clang-c/ExternC.h" +#include "clang-c/Platform.h" + +LLVM_CLANG_C_EXTERN_C_BEGIN + +/** \defgroup COMPILATIONDB CompilationDatabase functions + * \ingroup CINDEX + * + * @{ + */ + +/** + * A compilation database holds all information used to compile files in a + * project. For each file in the database, it can be queried for the working + * directory or the command line used for the compiler invocation. + * + * Must be freed by \c clang_CompilationDatabase_dispose + */ +typedef void * CXCompilationDatabase; + +/** + * Contains the results of a search in the compilation database + * + * When searching for the compile command for a file, the compilation db can + * return several commands, as the file may have been compiled with + * different options in different places of the project. This choice of compile + * commands is wrapped in this opaque data structure. It must be freed by + * \c clang_CompileCommands_dispose. + */ +typedef void * CXCompileCommands; + +/** + * Represents the command line invocation to compile a specific file. + */ +typedef void * CXCompileCommand; + +/** + * Error codes for Compilation Database + */ +typedef enum { + /* + * No error occurred + */ + CXCompilationDatabase_NoError = 0, + + /* + * Database can not be loaded + */ + CXCompilationDatabase_CanNotLoadDatabase = 1 + +} CXCompilationDatabase_Error; + +/** + * Creates a compilation database from the database found in directory + * buildDir. For example, CMake can output a compile_commands.json which can + * be used to build the database. + * + * It must be freed by \c clang_CompilationDatabase_dispose. + */ +CINDEX_LINKAGE CXCompilationDatabase +clang_CompilationDatabase_fromDirectory(const char *BuildDir, + CXCompilationDatabase_Error *ErrorCode); + +/** + * Free the given compilation database + */ +CINDEX_LINKAGE void +clang_CompilationDatabase_dispose(CXCompilationDatabase); + +/** + * Find the compile commands used for a file. The compile commands + * must be freed by \c clang_CompileCommands_dispose. + */ +CINDEX_LINKAGE CXCompileCommands +clang_CompilationDatabase_getCompileCommands(CXCompilationDatabase, + const char *CompleteFileName); + +/** + * Get all the compile commands in the given compilation database. + */ +CINDEX_LINKAGE CXCompileCommands +clang_CompilationDatabase_getAllCompileCommands(CXCompilationDatabase); + +/** + * Free the given CompileCommands + */ +CINDEX_LINKAGE void clang_CompileCommands_dispose(CXCompileCommands); + +/** + * Get the number of CompileCommand we have for a file + */ +CINDEX_LINKAGE unsigned +clang_CompileCommands_getSize(CXCompileCommands); + +/** + * Get the I'th CompileCommand for a file + * + * Note : 0 <= i < clang_CompileCommands_getSize(CXCompileCommands) + */ +CINDEX_LINKAGE CXCompileCommand +clang_CompileCommands_getCommand(CXCompileCommands, unsigned I); + +/** + * Get the working directory where the CompileCommand was executed from + */ +CINDEX_LINKAGE CXString +clang_CompileCommand_getDirectory(CXCompileCommand); + +/** + * Get the filename associated with the CompileCommand. + */ +CINDEX_LINKAGE CXString +clang_CompileCommand_getFilename(CXCompileCommand); + +/** + * Get the number of arguments in the compiler invocation. + * + */ +CINDEX_LINKAGE unsigned +clang_CompileCommand_getNumArgs(CXCompileCommand); + +/** + * Get the I'th argument value in the compiler invocations + * + * Invariant : + * - argument 0 is the compiler executable + */ +CINDEX_LINKAGE CXString +clang_CompileCommand_getArg(CXCompileCommand, unsigned I); + +/** + * Get the number of source mappings for the compiler invocation. + */ +CINDEX_LINKAGE unsigned +clang_CompileCommand_getNumMappedSources(CXCompileCommand); + +/** + * Get the I'th mapped source path for the compiler invocation. + */ +CINDEX_LINKAGE CXString +clang_CompileCommand_getMappedSourcePath(CXCompileCommand, unsigned I); + +/** + * Get the I'th mapped source content for the compiler invocation. + */ +CINDEX_LINKAGE CXString +clang_CompileCommand_getMappedSourceContent(CXCompileCommand, unsigned I); + +/** + * @} + */ + +LLVM_CLANG_C_EXTERN_C_END + +#endif + diff --git a/pkgs/ffigen/third_party/libclang/include/clang-c/CXErrorCode.h b/pkgs/ffigen/third_party/libclang/include/clang-c/CXErrorCode.h new file mode 100644 index 0000000000..b3a0b9d66d --- /dev/null +++ b/pkgs/ffigen/third_party/libclang/include/clang-c/CXErrorCode.h @@ -0,0 +1,62 @@ +/*===-- clang-c/CXErrorCode.h - C Index Error Codes --------------*- C -*-===*\ +|* *| +|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *| +|* Exceptions. *| +|* See https://llvm.org/LICENSE.txt for license information. *| +|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *| +|* *| +|*===----------------------------------------------------------------------===*| +|* *| +|* This header provides the CXErrorCode enumerators. *| +|* *| +\*===----------------------------------------------------------------------===*/ + +#ifndef LLVM_CLANG_C_CXERRORCODE_H +#define LLVM_CLANG_C_CXERRORCODE_H + +#include "clang-c/ExternC.h" +#include "clang-c/Platform.h" + +LLVM_CLANG_C_EXTERN_C_BEGIN + +/** + * Error codes returned by libclang routines. + * + * Zero (\c CXError_Success) is the only error code indicating success. Other + * error codes, including not yet assigned non-zero values, indicate errors. + */ +enum CXErrorCode { + /** + * No error. + */ + CXError_Success = 0, + + /** + * A generic error code, no further details are available. + * + * Errors of this kind can get their own specific error codes in future + * libclang versions. + */ + CXError_Failure = 1, + + /** + * libclang crashed while performing the requested operation. + */ + CXError_Crashed = 2, + + /** + * The function detected that the arguments violate the function + * contract. + */ + CXError_InvalidArguments = 3, + + /** + * An AST deserialization error has occurred. + */ + CXError_ASTReadError = 4 +}; + +LLVM_CLANG_C_EXTERN_C_END + +#endif + diff --git a/pkgs/ffigen/third_party/libclang/include/clang-c/CXString.h b/pkgs/ffigen/third_party/libclang/include/clang-c/CXString.h new file mode 100644 index 0000000000..f117010c71 --- /dev/null +++ b/pkgs/ffigen/third_party/libclang/include/clang-c/CXString.h @@ -0,0 +1,69 @@ +/*===-- clang-c/CXString.h - C Index strings --------------------*- C -*-===*\ +|* *| +|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *| +|* Exceptions. *| +|* See https://llvm.org/LICENSE.txt for license information. *| +|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *| +|* *| +|*===----------------------------------------------------------------------===*| +|* *| +|* This header provides the interface to C Index strings. *| +|* *| +\*===----------------------------------------------------------------------===*/ + +#ifndef LLVM_CLANG_C_CXSTRING_H +#define LLVM_CLANG_C_CXSTRING_H + +#include "clang-c/ExternC.h" +#include "clang-c/Platform.h" + +LLVM_CLANG_C_EXTERN_C_BEGIN + +/** + * \defgroup CINDEX_STRING String manipulation routines + * \ingroup CINDEX + * + * @{ + */ + +/** + * 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. + */ +typedef struct { + const void *data; + unsigned private_flags; +} CXString; + +typedef struct { + CXString *Strings; + unsigned Count; +} CXStringSet; + +/** + * Retrieve the character data associated with the given string. + */ +CINDEX_LINKAGE const char *clang_getCString(CXString string); + +/** + * Free the given string. + */ +CINDEX_LINKAGE void clang_disposeString(CXString string); + +/** + * Free the given string set. + */ +CINDEX_LINKAGE void clang_disposeStringSet(CXStringSet *set); + +/** + * @} + */ + +LLVM_CLANG_C_EXTERN_C_END + +#endif + diff --git a/pkgs/ffigen/third_party/libclang/include/clang-c/Documentation.h b/pkgs/ffigen/third_party/libclang/include/clang-c/Documentation.h new file mode 100644 index 0000000000..5bece2cb67 --- /dev/null +++ b/pkgs/ffigen/third_party/libclang/include/clang-c/Documentation.h @@ -0,0 +1,555 @@ +/*==-- clang-c/Documentation.h - Utilities for comment processing -*- C -*-===*\ +|* *| +|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *| +|* Exceptions. *| +|* See https://llvm.org/LICENSE.txt for license information. *| +|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *| +|* *| +|*===----------------------------------------------------------------------===*| +|* *| +|* This header provides a supplementary interface for inspecting *| +|* documentation comments. *| +|* *| +\*===----------------------------------------------------------------------===*/ + +#ifndef LLVM_CLANG_C_DOCUMENTATION_H +#define LLVM_CLANG_C_DOCUMENTATION_H + +#include "clang-c/ExternC.h" +#include "clang-c/Index.h" + +LLVM_CLANG_C_EXTERN_C_BEGIN + +/** + * \defgroup CINDEX_COMMENT Comment introspection + * + * The routines in this group provide access to information in documentation + * comments. These facilities are distinct from the core and may be subject to + * their own schedule of stability and deprecation. + * + * @{ + */ + +/** + * A parsed comment. + */ +typedef struct { + const void *ASTNode; + CXTranslationUnit TranslationUnit; +} CXComment; + +/** + * Given a cursor that represents a documentable entity (e.g., + * declaration), return the associated parsed comment as a + * \c CXComment_FullComment AST node. + */ +CINDEX_LINKAGE CXComment clang_Cursor_getParsedComment(CXCursor C); + +/** + * Describes the type of the comment AST node (\c CXComment). A comment + * node can be considered block content (e. g., paragraph), inline content + * (plain text) or neither (the root AST node). + */ +enum CXCommentKind { + /** + * Null comment. No AST node is constructed at the requested location + * because there is no text or a syntax error. + */ + CXComment_Null = 0, + + /** + * Plain text. Inline content. + */ + CXComment_Text = 1, + + /** + * A command with word-like arguments that is considered inline content. + * + * For example: \\c command. + */ + CXComment_InlineCommand = 2, + + /** + * HTML start tag with attributes (name-value pairs). Considered + * inline content. + * + * For example: + * \verbatim + *

+ * \endverbatim + */ + CXComment_HTMLStartTag = 3, + + /** + * HTML end tag. Considered inline content. + * + * For example: + * \verbatim + * + * \endverbatim + */ + CXComment_HTMLEndTag = 4, + + /** + * A paragraph, contains inline comment. The paragraph itself is + * block content. + */ + CXComment_Paragraph = 5, + + /** + * A command that has zero or more word-like arguments (number of + * word-like arguments depends on command name) and a paragraph as an + * argument. Block command is block content. + * + * Paragraph argument is also a child of the block command. + * + * For example: \has 0 word-like arguments and a paragraph argument. + * + * AST nodes of special kinds that parser knows about (e. g., \\param + * command) have their own node kinds. + */ + CXComment_BlockCommand = 6, + + /** + * A \\param or \\arg command that describes the function parameter + * (name, passing direction, description). + * + * For example: \\param [in] ParamName description. + */ + CXComment_ParamCommand = 7, + + /** + * A \\tparam command that describes a template parameter (name and + * description). + * + * For example: \\tparam T description. + */ + CXComment_TParamCommand = 8, + + /** + * A verbatim block command (e. g., preformatted code). Verbatim + * block has an opening and a closing command and contains multiple lines of + * text (\c CXComment_VerbatimBlockLine child nodes). + * + * For example: + * \\verbatim + * aaa + * \\endverbatim + */ + CXComment_VerbatimBlockCommand = 9, + + /** + * A line of text that is contained within a + * CXComment_VerbatimBlockCommand node. + */ + CXComment_VerbatimBlockLine = 10, + + /** + * A verbatim line command. Verbatim line has an opening command, + * a single line of text (up to the newline after the opening command) and + * has no closing command. + */ + CXComment_VerbatimLine = 11, + + /** + * A full comment attached to a declaration, contains block content. + */ + CXComment_FullComment = 12 +}; + +/** + * The most appropriate rendering mode for an inline command, chosen on + * command semantics in Doxygen. + */ +enum CXCommentInlineCommandRenderKind { + /** + * Command argument should be rendered in a normal font. + */ + CXCommentInlineCommandRenderKind_Normal, + + /** + * Command argument should be rendered in a bold font. + */ + CXCommentInlineCommandRenderKind_Bold, + + /** + * Command argument should be rendered in a monospaced font. + */ + CXCommentInlineCommandRenderKind_Monospaced, + + /** + * Command argument should be rendered emphasized (typically italic + * font). + */ + CXCommentInlineCommandRenderKind_Emphasized, + + /** + * Command argument should not be rendered (since it only defines an anchor). + */ + CXCommentInlineCommandRenderKind_Anchor +}; + +/** + * Describes parameter passing direction for \\param or \\arg command. + */ +enum CXCommentParamPassDirection { + /** + * The parameter is an input parameter. + */ + CXCommentParamPassDirection_In, + + /** + * The parameter is an output parameter. + */ + CXCommentParamPassDirection_Out, + + /** + * The parameter is an input and output parameter. + */ + CXCommentParamPassDirection_InOut +}; + +/** + * \param Comment AST node of any kind. + * + * \returns the type of the AST node. + */ +CINDEX_LINKAGE enum CXCommentKind clang_Comment_getKind(CXComment Comment); + +/** + * \param Comment AST node of any kind. + * + * \returns number of children of the AST node. + */ +CINDEX_LINKAGE unsigned clang_Comment_getNumChildren(CXComment Comment); + +/** + * \param Comment AST node of any kind. + * + * \param ChildIdx child index (zero-based). + * + * \returns the specified child of the AST node. + */ +CINDEX_LINKAGE +CXComment clang_Comment_getChild(CXComment Comment, unsigned ChildIdx); + +/** + * A \c CXComment_Paragraph node is considered whitespace if it contains + * only \c CXComment_Text nodes that are empty or whitespace. + * + * Other AST nodes (except \c CXComment_Paragraph and \c CXComment_Text) are + * never considered whitespace. + * + * \returns non-zero if \c Comment is whitespace. + */ +CINDEX_LINKAGE unsigned clang_Comment_isWhitespace(CXComment Comment); + +/** + * \returns non-zero if \c Comment is inline content and has a newline + * immediately following it in the comment text. Newlines between paragraphs + * do not count. + */ +CINDEX_LINKAGE +unsigned clang_InlineContentComment_hasTrailingNewline(CXComment Comment); + +/** + * \param Comment a \c CXComment_Text AST node. + * + * \returns text contained in the AST node. + */ +CINDEX_LINKAGE CXString clang_TextComment_getText(CXComment Comment); + +/** + * \param Comment a \c CXComment_InlineCommand AST node. + * + * \returns name of the inline command. + */ +CINDEX_LINKAGE +CXString clang_InlineCommandComment_getCommandName(CXComment Comment); + +/** + * \param Comment a \c CXComment_InlineCommand AST node. + * + * \returns the most appropriate rendering mode, chosen on command + * semantics in Doxygen. + */ +CINDEX_LINKAGE enum CXCommentInlineCommandRenderKind +clang_InlineCommandComment_getRenderKind(CXComment Comment); + +/** + * \param Comment a \c CXComment_InlineCommand AST node. + * + * \returns number of command arguments. + */ +CINDEX_LINKAGE +unsigned clang_InlineCommandComment_getNumArgs(CXComment Comment); + +/** + * \param Comment a \c CXComment_InlineCommand AST node. + * + * \param ArgIdx argument index (zero-based). + * + * \returns text of the specified argument. + */ +CINDEX_LINKAGE +CXString clang_InlineCommandComment_getArgText(CXComment Comment, + unsigned ArgIdx); + +/** + * \param Comment a \c CXComment_HTMLStartTag or \c CXComment_HTMLEndTag AST + * node. + * + * \returns HTML tag name. + */ +CINDEX_LINKAGE CXString clang_HTMLTagComment_getTagName(CXComment Comment); + +/** + * \param Comment a \c CXComment_HTMLStartTag AST node. + * + * \returns non-zero if tag is self-closing (for example, <br />). + */ +CINDEX_LINKAGE +unsigned clang_HTMLStartTagComment_isSelfClosing(CXComment Comment); + +/** + * \param Comment a \c CXComment_HTMLStartTag AST node. + * + * \returns number of attributes (name-value pairs) attached to the start tag. + */ +CINDEX_LINKAGE unsigned clang_HTMLStartTag_getNumAttrs(CXComment Comment); + +/** + * \param Comment a \c CXComment_HTMLStartTag AST node. + * + * \param AttrIdx attribute index (zero-based). + * + * \returns name of the specified attribute. + */ +CINDEX_LINKAGE +CXString clang_HTMLStartTag_getAttrName(CXComment Comment, unsigned AttrIdx); + +/** + * \param Comment a \c CXComment_HTMLStartTag AST node. + * + * \param AttrIdx attribute index (zero-based). + * + * \returns value of the specified attribute. + */ +CINDEX_LINKAGE +CXString clang_HTMLStartTag_getAttrValue(CXComment Comment, unsigned AttrIdx); + +/** + * \param Comment a \c CXComment_BlockCommand AST node. + * + * \returns name of the block command. + */ +CINDEX_LINKAGE +CXString clang_BlockCommandComment_getCommandName(CXComment Comment); + +/** + * \param Comment a \c CXComment_BlockCommand AST node. + * + * \returns number of word-like arguments. + */ +CINDEX_LINKAGE +unsigned clang_BlockCommandComment_getNumArgs(CXComment Comment); + +/** + * \param Comment a \c CXComment_BlockCommand AST node. + * + * \param ArgIdx argument index (zero-based). + * + * \returns text of the specified word-like argument. + */ +CINDEX_LINKAGE +CXString clang_BlockCommandComment_getArgText(CXComment Comment, + unsigned ArgIdx); + +/** + * \param Comment a \c CXComment_BlockCommand or + * \c CXComment_VerbatimBlockCommand AST node. + * + * \returns paragraph argument of the block command. + */ +CINDEX_LINKAGE +CXComment clang_BlockCommandComment_getParagraph(CXComment Comment); + +/** + * \param Comment a \c CXComment_ParamCommand AST node. + * + * \returns parameter name. + */ +CINDEX_LINKAGE +CXString clang_ParamCommandComment_getParamName(CXComment Comment); + +/** + * \param Comment a \c CXComment_ParamCommand AST node. + * + * \returns non-zero if the parameter that this AST node represents was found + * in the function prototype and \c clang_ParamCommandComment_getParamIndex + * function will return a meaningful value. + */ +CINDEX_LINKAGE +unsigned clang_ParamCommandComment_isParamIndexValid(CXComment Comment); + +/** + * \param Comment a \c CXComment_ParamCommand AST node. + * + * \returns zero-based parameter index in function prototype. + */ +CINDEX_LINKAGE +unsigned clang_ParamCommandComment_getParamIndex(CXComment Comment); + +/** + * \param Comment a \c CXComment_ParamCommand AST node. + * + * \returns non-zero if parameter passing direction was specified explicitly in + * the comment. + */ +CINDEX_LINKAGE +unsigned clang_ParamCommandComment_isDirectionExplicit(CXComment Comment); + +/** + * \param Comment a \c CXComment_ParamCommand AST node. + * + * \returns parameter passing direction. + */ +CINDEX_LINKAGE +enum CXCommentParamPassDirection clang_ParamCommandComment_getDirection( + CXComment Comment); + +/** + * \param Comment a \c CXComment_TParamCommand AST node. + * + * \returns template parameter name. + */ +CINDEX_LINKAGE +CXString clang_TParamCommandComment_getParamName(CXComment Comment); + +/** + * \param Comment a \c CXComment_TParamCommand AST node. + * + * \returns non-zero if the parameter that this AST node represents was found + * in the template parameter list and + * \c clang_TParamCommandComment_getDepth and + * \c clang_TParamCommandComment_getIndex functions will return a meaningful + * value. + */ +CINDEX_LINKAGE +unsigned clang_TParamCommandComment_isParamPositionValid(CXComment Comment); + +/** + * \param Comment a \c CXComment_TParamCommand AST node. + * + * \returns zero-based nesting depth of this parameter in the template parameter list. + * + * For example, + * \verbatim + * template class TT> + * void test(TT aaa); + * \endverbatim + * for C and TT nesting depth is 0, + * for T nesting depth is 1. + */ +CINDEX_LINKAGE +unsigned clang_TParamCommandComment_getDepth(CXComment Comment); + +/** + * \param Comment a \c CXComment_TParamCommand AST node. + * + * \returns zero-based parameter index in the template parameter list at a + * given nesting depth. + * + * For example, + * \verbatim + * template class TT> + * void test(TT aaa); + * \endverbatim + * for C and TT nesting depth is 0, so we can ask for index at depth 0: + * at depth 0 C's index is 0, TT's index is 1. + * + * For T nesting depth is 1, so we can ask for index at depth 0 and 1: + * at depth 0 T's index is 1 (same as TT's), + * at depth 1 T's index is 0. + */ +CINDEX_LINKAGE +unsigned clang_TParamCommandComment_getIndex(CXComment Comment, unsigned Depth); + +/** + * \param Comment a \c CXComment_VerbatimBlockLine AST node. + * + * \returns text contained in the AST node. + */ +CINDEX_LINKAGE +CXString clang_VerbatimBlockLineComment_getText(CXComment Comment); + +/** + * \param Comment a \c CXComment_VerbatimLine AST node. + * + * \returns text contained in the AST node. + */ +CINDEX_LINKAGE CXString clang_VerbatimLineComment_getText(CXComment Comment); + +/** + * Convert an HTML tag AST node to string. + * + * \param Comment a \c CXComment_HTMLStartTag or \c CXComment_HTMLEndTag AST + * node. + * + * \returns string containing an HTML tag. + */ +CINDEX_LINKAGE CXString clang_HTMLTagComment_getAsString(CXComment Comment); + +/** + * Convert a given full parsed comment to an HTML fragment. + * + * Specific details of HTML layout are subject to change. Don't try to parse + * this HTML back into an AST, use other APIs instead. + * + * Currently the following CSS classes are used: + * \li "para-brief" for \paragraph and equivalent commands; + * \li "para-returns" for \\returns paragraph and equivalent commands; + * \li "word-returns" for the "Returns" word in \\returns paragraph. + * + * Function argument documentation is rendered as a \ list with arguments + * sorted in function prototype order. CSS classes used: + * \li "param-name-index-NUMBER" for parameter name (\); + * \li "param-descr-index-NUMBER" for parameter description (\); + * \li "param-name-index-invalid" and "param-descr-index-invalid" are used if + * parameter index is invalid. + * + * Template parameter documentation is rendered as a \ list with + * parameters sorted in template parameter list order. CSS classes used: + * \li "tparam-name-index-NUMBER" for parameter name (\); + * \li "tparam-descr-index-NUMBER" for parameter description (\); + * \li "tparam-name-index-other" and "tparam-descr-index-other" are used for + * names inside template template parameters; + * \li "tparam-name-index-invalid" and "tparam-descr-index-invalid" are used if + * parameter position is invalid. + * + * \param Comment a \c CXComment_FullComment AST node. + * + * \returns string containing an HTML fragment. + */ +CINDEX_LINKAGE CXString clang_FullComment_getAsHTML(CXComment Comment); + +/** + * Convert a given full parsed comment to an XML document. + * + * A Relax NG schema for the XML can be found in comment-xml-schema.rng file + * inside clang source tree. + * + * \param Comment a \c CXComment_FullComment AST node. + * + * \returns string containing an XML document. + */ +CINDEX_LINKAGE CXString clang_FullComment_getAsXML(CXComment Comment); + +/** + * @} + */ + +LLVM_CLANG_C_EXTERN_C_END + +#endif /* CLANG_C_DOCUMENTATION_H */ + diff --git a/pkgs/ffigen/third_party/libclang/include/clang-c/ExternC.h b/pkgs/ffigen/third_party/libclang/include/clang-c/ExternC.h new file mode 100644 index 0000000000..384f24d47b --- /dev/null +++ b/pkgs/ffigen/third_party/libclang/include/clang-c/ExternC.h @@ -0,0 +1,39 @@ +/*===- clang-c/ExternC.h - Wrapper for 'extern "C"' ---------------*- C -*-===*\ +|* *| +|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *| +|* Exceptions. *| +|* See https://llvm.org/LICENSE.txt for license information. *| +|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *| +|* *| +|*===----------------------------------------------------------------------===*| +|* *| +|* This file defines an 'extern "C"' wrapper. *| +|* *| +\*===----------------------------------------------------------------------===*/ + +#ifndef LLVM_CLANG_C_EXTERN_C_H +#define LLVM_CLANG_C_EXTERN_C_H + +#ifdef __clang__ +#define LLVM_CLANG_C_STRICT_PROTOTYPES_BEGIN \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic error \"-Wstrict-prototypes\"") +#define LLVM_CLANG_C_STRICT_PROTOTYPES_END _Pragma("clang diagnostic pop") +#else +#define LLVM_CLANG_C_STRICT_PROTOTYPES_BEGIN +#define LLVM_CLANG_C_STRICT_PROTOTYPES_END +#endif + +#ifdef __cplusplus +#define LLVM_CLANG_C_EXTERN_C_BEGIN \ + extern "C" { \ + LLVM_CLANG_C_STRICT_PROTOTYPES_BEGIN +#define LLVM_CLANG_C_EXTERN_C_END \ + LLVM_CLANG_C_STRICT_PROTOTYPES_END \ + } +#else +#define LLVM_CLANG_C_EXTERN_C_BEGIN LLVM_CLANG_C_STRICT_PROTOTYPES_BEGIN +#define LLVM_CLANG_C_EXTERN_C_END LLVM_CLANG_C_STRICT_PROTOTYPES_END +#endif + +#endif diff --git a/pkgs/ffigen/third_party/libclang/include/clang-c/FatalErrorHandler.h b/pkgs/ffigen/third_party/libclang/include/clang-c/FatalErrorHandler.h new file mode 100644 index 0000000000..22f34fa815 --- /dev/null +++ b/pkgs/ffigen/third_party/libclang/include/clang-c/FatalErrorHandler.h @@ -0,0 +1,32 @@ +/*===-- clang-c/FatalErrorHandler.h - Fatal Error Handling --------*- C -*-===*\ +|* *| +|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *| +|* Exceptions. *| +|* See https://llvm.org/LICENSE.txt for license information. *| +|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *| +|* *| +\*===----------------------------------------------------------------------===*/ + +#ifndef LLVM_CLANG_C_FATAL_ERROR_HANDLER_H +#define LLVM_CLANG_C_FATAL_ERROR_HANDLER_H + +#include "clang-c/ExternC.h" + +LLVM_CLANG_C_EXTERN_C_BEGIN + +/** + * Installs error handler that prints error message to stderr and calls abort(). + * Replaces currently installed error handler (if any). + */ +void clang_install_aborting_llvm_fatal_error_handler(void); + +/** + * Removes currently installed error handler (if any). + * If no error handler is intalled, the default strategy is to print error + * message to stderr and call exit(1). + */ +void clang_uninstall_llvm_fatal_error_handler(void); + +LLVM_CLANG_C_EXTERN_C_END + +#endif diff --git a/pkgs/ffigen/third_party/libclang/include/clang-c/Index.h b/pkgs/ffigen/third_party/libclang/include/clang-c/Index.h new file mode 100644 index 0000000000..b653995ebb --- /dev/null +++ b/pkgs/ffigen/third_party/libclang/include/clang-c/Index.h @@ -0,0 +1,6782 @@ +/*===-- clang-c/Index.h - Indexing Public C Interface -------------*- C -*-===*\ +|* *| +|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *| +|* Exceptions. *| +|* See https://llvm.org/LICENSE.txt for license information. *| +|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *| +|* *| +|*===----------------------------------------------------------------------===*| +|* *| +|* This header provides a public interface to a Clang library for extracting *| +|* high-level symbol information from source files without exposing the full *| +|* Clang C++ API. *| +|* *| +\*===----------------------------------------------------------------------===*/ + +#ifndef LLVM_CLANG_C_INDEX_H +#define LLVM_CLANG_C_INDEX_H + +#include + +#include "clang-c/BuildSystem.h" +#include "clang-c/CXErrorCode.h" +#include "clang-c/CXString.h" +#include "clang-c/ExternC.h" +#include "clang-c/Platform.h" + +/** + * The version constants for the libclang API. + * CINDEX_VERSION_MINOR should increase when there are API additions. + * CINDEX_VERSION_MAJOR is intended for "major" source/ABI breaking changes. + * + * The policy about the libclang API was always to keep it source and ABI + * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable. + */ +#define CINDEX_VERSION_MAJOR 0 +#define CINDEX_VERSION_MINOR 59 + +#define CINDEX_VERSION_ENCODE(major, minor) ( \ + ((major) * 10000) \ + + ((minor) * 1)) + +#define CINDEX_VERSION CINDEX_VERSION_ENCODE( \ + CINDEX_VERSION_MAJOR, \ + CINDEX_VERSION_MINOR ) + +#define CINDEX_VERSION_STRINGIZE_(major, minor) \ + #major"."#minor +#define CINDEX_VERSION_STRINGIZE(major, minor) \ + CINDEX_VERSION_STRINGIZE_(major, minor) + +#define CINDEX_VERSION_STRING CINDEX_VERSION_STRINGIZE( \ + CINDEX_VERSION_MAJOR, \ + CINDEX_VERSION_MINOR) + +LLVM_CLANG_C_EXTERN_C_BEGIN + +/** \defgroup CINDEX libclang: C Interface to Clang + * + * The C Interface to Clang provides a relatively small API that exposes + * facilities for parsing source code into an abstract syntax tree (AST), + * loading already-parsed ASTs, traversing the AST, associating + * physical source locations with elements within the AST, and other + * facilities that support Clang-based development tools. + * + * This C interface to Clang will never provide all of the information + * representation stored in Clang's C++ AST, nor should it: the intent is to + * maintain an API that is relatively stable from one release to the next, + * providing only the basic functionality needed to support development tools. + * + * To avoid namespace pollution, data types are prefixed with "CX" and + * functions are prefixed with "clang_". + * + * @{ + */ + +/** + * An "index" that consists of a set of translation units that would + * typically be linked together into an executable or library. + */ +typedef void *CXIndex; + +/** + * An opaque type representing target information for a given translation + * unit. + */ +typedef struct CXTargetInfoImpl *CXTargetInfo; + +/** + * A single translation unit, which resides in an index. + */ +typedef struct CXTranslationUnitImpl *CXTranslationUnit; + +/** + * Opaque pointer representing client data that will be passed through + * to various callbacks and visitors. + */ +typedef void *CXClientData; + +/** + * 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. + */ +struct CXUnsavedFile { + /** + * The file whose contents have not yet been saved. + * + * This file must already exist in the file system. + */ + const char *Filename; + + /** + * A buffer containing the unsaved contents of this file. + */ + const char *Contents; + + /** + * The length of the unsaved contents of this buffer. + */ + unsigned long 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. + */ +enum CXAvailabilityKind { + /** + * The entity is available. + */ + CXAvailability_Available, + /** + * The entity is available, but has been deprecated (and its use is + * not recommended). + */ + CXAvailability_Deprecated, + /** + * The entity is not available; any use of it will be an error. + */ + CXAvailability_NotAvailable, + /** + * The entity is available, but not accessible; any use of it will be + * an error. + */ + CXAvailability_NotAccessible +}; + +/** + * Describes a version number of the form major.minor.subminor. + */ +typedef struct CXVersion { + /** + * The major version number, e.g., the '10' in '10.7.3'. A negative + * value indicates that there is no version number at all. + */ + 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'. + */ + 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'. + */ + int Subminor; +} CXVersion; + +/** + * Describes the exception specification of a cursor. + * + * A negative value indicates that the cursor is not a function declaration. + */ +enum CXCursor_ExceptionSpecificationKind { + /** + * The cursor has no exception specification. + */ + CXCursor_ExceptionSpecificationKind_None, + + /** + * The cursor has exception specification throw() + */ + CXCursor_ExceptionSpecificationKind_DynamicNone, + + /** + * The cursor has exception specification throw(T1, T2) + */ + CXCursor_ExceptionSpecificationKind_Dynamic, + + /** + * The cursor has exception specification throw(...). + */ + CXCursor_ExceptionSpecificationKind_MSAny, + + /** + * The cursor has exception specification basic noexcept. + */ + CXCursor_ExceptionSpecificationKind_BasicNoexcept, + + /** + * The cursor has exception specification computed noexcept. + */ + CXCursor_ExceptionSpecificationKind_ComputedNoexcept, + + /** + * The exception specification has not yet been evaluated. + */ + CXCursor_ExceptionSpecificationKind_Unevaluated, + + /** + * The exception specification has not yet been instantiated. + */ + CXCursor_ExceptionSpecificationKind_Uninstantiated, + + /** + * The exception specification has not been parsed yet. + */ + CXCursor_ExceptionSpecificationKind_Unparsed, + + /** + * The cursor has a __declspec(nothrow) exception specification. + */ + CXCursor_ExceptionSpecificationKind_NoThrow +}; + +/** + * Provides a shared context for creating translation units. + * + * It provides two options: + * + * - excludeDeclarationsFromPCH: When non-zero, allows enumeration of "local" + * declarations (when loading any new translation units). A "local" declaration + * is one that belongs in the translation unit itself and not in a precompiled + * header that was used by the translation unit. If zero, all declarations + * will be enumerated. + * + * Here is an example: + * + * \code + * // excludeDeclsFromPCH = 1, displayDiagnostics=1 + * Idx = clang_createIndex(1, 1); + * + * // IndexTest.pch was produced with the following command: + * // "clang -x c IndexTest.h -emit-ast -o IndexTest.pch" + * TU = clang_createTranslationUnit(Idx, "IndexTest.pch"); + * + * // This will load all the symbols from 'IndexTest.pch' + * clang_visitChildren(clang_getTranslationUnitCursor(TU), + * TranslationUnitVisitor, 0); + * clang_disposeTranslationUnit(TU); + * + * // This will load all the symbols from 'IndexTest.c', excluding symbols + * // from 'IndexTest.pch'. + * char *args[] = { "-Xclang", "-include-pch=IndexTest.pch" }; + * TU = clang_createTranslationUnitFromSourceFile(Idx, "IndexTest.c", 2, args, + * 0, 0); + * clang_visitChildren(clang_getTranslationUnitCursor(TU), + * TranslationUnitVisitor, 0); + * clang_disposeTranslationUnit(TU); + * \endcode + * + * This process of creating the 'pch', loading it separately, and using it (via + * -include-pch) allows 'excludeDeclsFromPCH' to remove redundant callbacks + * (which gives the indexer the same performance benefit as the compiler). + */ +CINDEX_LINKAGE CXIndex clang_createIndex(int excludeDeclarationsFromPCH, + int displayDiagnostics); + +/** + * Destroy the given index. + * + * The index must not be destroyed until all of the translation units created + * within that index have been destroyed. + */ +CINDEX_LINKAGE void clang_disposeIndex(CXIndex index); + +typedef enum { + /** + * Used to indicate that no special CXIndex options are needed. + */ + CXGlobalOpt_None = 0x0, + + /** + * Used to indicate that threads that libclang creates for indexing + * purposes should use background priority. + * + * Affects #clang_indexSourceFile, #clang_indexTranslationUnit, + * #clang_parseTranslationUnit, #clang_saveTranslationUnit. + */ + CXGlobalOpt_ThreadBackgroundPriorityForIndexing = 0x1, + + /** + * Used to indicate that threads that libclang creates for editing + * purposes should use background priority. + * + * Affects #clang_reparseTranslationUnit, #clang_codeCompleteAt, + * #clang_annotateTokens + */ + CXGlobalOpt_ThreadBackgroundPriorityForEditing = 0x2, + + /** + * Used to indicate that all threads that libclang creates should use + * background priority. + */ + CXGlobalOpt_ThreadBackgroundPriorityForAll = + CXGlobalOpt_ThreadBackgroundPriorityForIndexing | + CXGlobalOpt_ThreadBackgroundPriorityForEditing + +} CXGlobalOptFlags; + +/** + * Sets general options associated with a CXIndex. + * + * For example: + * \code + * CXIndex idx = ...; + * clang_CXIndex_setGlobalOptions(idx, + * clang_CXIndex_getGlobalOptions(idx) | + * CXGlobalOpt_ThreadBackgroundPriorityForIndexing); + * \endcode + * + * \param options A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags. + */ +CINDEX_LINKAGE void clang_CXIndex_setGlobalOptions(CXIndex, unsigned options); + +/** + * Gets the general options associated with a CXIndex. + * + * \returns A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags that + * are associated with the given CXIndex object. + */ +CINDEX_LINKAGE unsigned clang_CXIndex_getGlobalOptions(CXIndex); + +/** + * Sets the invocation emission path option in a CXIndex. + * + * The invocation emission path specifies a path which will contain log + * files for certain libclang invocations. A null value (default) implies that + * libclang invocations are not logged.. + */ +CINDEX_LINKAGE void +clang_CXIndex_setInvocationEmissionPathOption(CXIndex, const char *Path); + +/** + * \defgroup CINDEX_FILES File manipulation routines + * + * @{ + */ + +/** + * A particular source file that is part of a translation unit. + */ +typedef void *CXFile; + +/** + * Retrieve the complete file and path name of the given file. + */ +CINDEX_LINKAGE CXString clang_getFileName(CXFile SFile); + +/** + * Retrieve the last modification time of the given file. + */ +CINDEX_LINKAGE time_t clang_getFileTime(CXFile SFile); + +/** + * Uniquely identifies a CXFile, that refers to the same underlying file, + * across an indexing session. + */ +typedef struct { + unsigned long long data[3]; +} CXFileUniqueID; + +/** + * Retrieve the unique ID for the given \c file. + * + * \param file the file to get the ID for. + * \param outID stores the returned CXFileUniqueID. + * \returns If there was a failure getting the unique ID, returns non-zero, + * otherwise returns 0. +*/ +CINDEX_LINKAGE int clang_getFileUniqueID(CXFile file, CXFileUniqueID *outID); + +/** + * Determine whether the given header is guarded against + * multiple inclusions, either with the conventional + * \#ifndef/\#define/\#endif macro guards or with \#pragma once. + */ +CINDEX_LINKAGE unsigned +clang_isFileMultipleIncludeGuarded(CXTranslationUnit tu, CXFile file); + +/** + * Retrieve a file handle within the given translation unit. + * + * \param tu the translation unit + * + * \param file_name the name of the file. + * + * \returns the file handle for the named file in the translation unit \p tu, + * or a NULL file handle if the file was not a part of this translation unit. + */ +CINDEX_LINKAGE CXFile clang_getFile(CXTranslationUnit tu, + const char *file_name); + +/** + * Retrieve the buffer associated with the given file. + * + * \param tu the translation unit + * + * \param file the file for which to retrieve the buffer. + * + * \param size [out] if non-NULL, will be set to the size of the buffer. + * + * \returns a pointer to the buffer in memory that holds the contents of + * \p file, or a NULL pointer when the file is not loaded. + */ +CINDEX_LINKAGE const char *clang_getFileContents(CXTranslationUnit tu, + CXFile file, size_t *size); + +/** + * Returns non-zero if the \c file1 and \c file2 point to the same file, + * or they are both NULL. + */ +CINDEX_LINKAGE int clang_File_isEqual(CXFile file1, CXFile file2); + +/** + * Returns the real path name of \c file. + * + * An empty string may be returned. Use \c clang_getFileName() in that case. + */ +CINDEX_LINKAGE CXString clang_File_tryGetRealPathName(CXFile file); + +/** + * @} + */ + +/** + * \defgroup CINDEX_LOCATIONS Physical source locations + * + * Clang represents physical source locations in its abstract syntax tree in + * great detail, with file, line, and column information for the majority of + * the tokens parsed in the source code. These data types and functions are + * used to represent source location information, either for a particular + * point in the program or for a range of points in the program, and extract + * specific location information from those data types. + * + * @{ + */ + +/** + * 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. + */ +typedef struct { + const void *ptr_data[2]; + unsigned int_data; +} CXSourceLocation; + +/** + * 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. + */ +typedef struct { + const void *ptr_data[2]; + unsigned begin_int_data; + unsigned end_int_data; +} CXSourceRange; + +/** + * Retrieve a NULL (invalid) source location. + */ +CINDEX_LINKAGE CXSourceLocation clang_getNullLocation(void); + +/** + * 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. + */ +CINDEX_LINKAGE unsigned clang_equalLocations(CXSourceLocation loc1, + CXSourceLocation loc2); + +/** + * Retrieves the source location associated with a given file/line/column + * in a particular translation unit. + */ +CINDEX_LINKAGE CXSourceLocation clang_getLocation(CXTranslationUnit tu, + CXFile file, + unsigned line, + unsigned column); +/** + * Retrieves the source location associated with a given character offset + * in a particular translation unit. + */ +CINDEX_LINKAGE CXSourceLocation clang_getLocationForOffset(CXTranslationUnit tu, + CXFile file, + unsigned offset); + +/** + * Returns non-zero if the given source location is in a system header. + */ +CINDEX_LINKAGE int clang_Location_isInSystemHeader(CXSourceLocation location); + +/** + * Returns non-zero if the given source location is in the main file of + * the corresponding translation unit. + */ +CINDEX_LINKAGE int clang_Location_isFromMainFile(CXSourceLocation location); + +/** + * Retrieve a NULL (invalid) source range. + */ +CINDEX_LINKAGE CXSourceRange clang_getNullRange(void); + +/** + * Retrieve a source range given the beginning and ending source + * locations. + */ +CINDEX_LINKAGE CXSourceRange clang_getRange(CXSourceLocation begin, + CXSourceLocation end); + +/** + * Determine whether two ranges are equivalent. + * + * \returns non-zero if the ranges are the same, zero if they differ. + */ +CINDEX_LINKAGE unsigned clang_equalRanges(CXSourceRange range1, + CXSourceRange range2); + +/** + * Returns non-zero if \p range is null. + */ +CINDEX_LINKAGE int clang_Range_isNull(CXSourceRange range); + +/** + * 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. + */ +CINDEX_LINKAGE void clang_getExpansionLocation(CXSourceLocation location, + CXFile *file, + unsigned *line, + unsigned *column, + unsigned *offset); + +/** + * 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. + */ +CINDEX_LINKAGE void clang_getPresumedLocation(CXSourceLocation location, + CXString *filename, + unsigned *line, + unsigned *column); + +/** + * 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. + */ +CINDEX_LINKAGE void clang_getInstantiationLocation(CXSourceLocation location, + CXFile *file, + unsigned *line, + unsigned *column, + unsigned *offset); + +/** + * 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. + */ +CINDEX_LINKAGE void clang_getSpellingLocation(CXSourceLocation location, + CXFile *file, + unsigned *line, + unsigned *column, + unsigned *offset); + +/** + * 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. + */ +CINDEX_LINKAGE void clang_getFileLocation(CXSourceLocation location, + CXFile *file, + unsigned *line, + unsigned *column, + unsigned *offset); + +/** + * Retrieve a source location representing the first character within a + * source range. + */ +CINDEX_LINKAGE CXSourceLocation clang_getRangeStart(CXSourceRange range); + +/** + * Retrieve a source location representing the last character within a + * source range. + */ +CINDEX_LINKAGE CXSourceLocation clang_getRangeEnd(CXSourceRange range); + +/** + * Identifies an array of ranges. + */ +typedef struct { + /** The number of ranges in the \c ranges array. */ + unsigned count; + /** + * An array of \c CXSourceRanges. + */ + CXSourceRange *ranges; +} CXSourceRangeList; + +/** + * Retrieve all ranges that were skipped by the preprocessor. + * + * The preprocessor will skip lines when they are surrounded by an + * if/ifdef/ifndef directive whose condition does not evaluate to true. + */ +CINDEX_LINKAGE CXSourceRangeList *clang_getSkippedRanges(CXTranslationUnit tu, + CXFile file); + +/** + * Retrieve all ranges from all files that were skipped by the + * preprocessor. + * + * The preprocessor will skip lines when they are surrounded by an + * if/ifdef/ifndef directive whose condition does not evaluate to true. + */ +CINDEX_LINKAGE CXSourceRangeList *clang_getAllSkippedRanges(CXTranslationUnit tu); + +/** + * Destroy the given \c CXSourceRangeList. + */ +CINDEX_LINKAGE void clang_disposeSourceRangeList(CXSourceRangeList *ranges); + +/** + * @} + */ + +/** + * \defgroup CINDEX_DIAG Diagnostic reporting + * + * @{ + */ + +/** + * Describes the severity of a particular diagnostic. + */ +enum CXDiagnosticSeverity { + /** + * A diagnostic that has been suppressed, e.g., by a command-line + * option. + */ + CXDiagnostic_Ignored = 0, + + /** + * This diagnostic is a note that should be attached to the + * previous (non-note) diagnostic. + */ + CXDiagnostic_Note = 1, + + /** + * This diagnostic indicates suspicious code that may not be + * wrong. + */ + CXDiagnostic_Warning = 2, + + /** + * This diagnostic indicates that the code is ill-formed. + */ + CXDiagnostic_Error = 3, + + /** + * This diagnostic indicates that the code is ill-formed such + * that future parser recovery is unlikely to produce useful + * results. + */ + CXDiagnostic_Fatal = 4 +}; + +/** + * A single diagnostic, containing the diagnostic's severity, + * location, text, source ranges, and fix-it hints. + */ +typedef void *CXDiagnostic; + +/** + * A group of CXDiagnostics. + */ +typedef void *CXDiagnosticSet; + +/** + * Determine the number of diagnostics in a CXDiagnosticSet. + */ +CINDEX_LINKAGE unsigned clang_getNumDiagnosticsInSet(CXDiagnosticSet Diags); + +/** + * Retrieve a diagnostic associated with the given CXDiagnosticSet. + * + * \param Diags the CXDiagnosticSet 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(). + */ +CINDEX_LINKAGE CXDiagnostic clang_getDiagnosticInSet(CXDiagnosticSet Diags, + unsigned Index); + +/** + * Describes the kind of error that occurred (if any) in a call to + * \c clang_loadDiagnostics. + */ +enum CXLoadDiag_Error { + /** + * Indicates that no error occurred. + */ + CXLoadDiag_None = 0, + + /** + * Indicates that an unknown error occurred while attempting to + * deserialize diagnostics. + */ + CXLoadDiag_Unknown = 1, + + /** + * Indicates that the file containing the serialized diagnostics + * could not be opened. + */ + CXLoadDiag_CannotLoad = 2, + + /** + * Indicates that the serialized diagnostics file is invalid or + * corrupt. + */ + CXLoadDiag_InvalidFile = 3 +}; + +/** + * Deserialize a set of diagnostics from a Clang diagnostics bitcode + * file. + * + * \param file The name of the file to deserialize. + * \param error A pointer to a enum value recording if there was a problem + * deserializing the diagnostics. + * \param errorString A pointer to a CXString for recording the error string + * if the file was not successfully loaded. + * + * \returns A loaded CXDiagnosticSet if successful, and NULL otherwise. These + * diagnostics should be released using clang_disposeDiagnosticSet(). + */ +CINDEX_LINKAGE CXDiagnosticSet clang_loadDiagnostics(const char *file, + enum CXLoadDiag_Error *error, + CXString *errorString); + +/** + * Release a CXDiagnosticSet and all of its contained diagnostics. + */ +CINDEX_LINKAGE void clang_disposeDiagnosticSet(CXDiagnosticSet Diags); + +/** + * Retrieve the child diagnostics of a CXDiagnostic. + * + * This CXDiagnosticSet does not need to be released by + * clang_disposeDiagnosticSet. + */ +CINDEX_LINKAGE CXDiagnosticSet clang_getChildDiagnostics(CXDiagnostic D); + +/** + * Determine the number of diagnostics produced for the given + * translation unit. + */ +CINDEX_LINKAGE unsigned clang_getNumDiagnostics(CXTranslationUnit Unit); + +/** + * Retrieve a diagnostic associated with the given translation unit. + * + * \param Unit the translation unit 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(). + */ +CINDEX_LINKAGE CXDiagnostic clang_getDiagnostic(CXTranslationUnit Unit, + unsigned Index); + +/** + * Retrieve the complete set of diagnostics associated with a + * translation unit. + * + * \param Unit the translation unit to query. + */ +CINDEX_LINKAGE CXDiagnosticSet + clang_getDiagnosticSetFromTU(CXTranslationUnit Unit); + +/** + * Destroy a diagnostic. + */ +CINDEX_LINKAGE void clang_disposeDiagnostic(CXDiagnostic Diagnostic); + +/** + * Options to control the display of diagnostics. + * + * The values in this enum are meant to be combined to customize the + * behavior of \c clang_formatDiagnostic(). + */ +enum CXDiagnosticDisplayOptions { + /** + * Display the source-location information where the + * diagnostic was located. + * + * When set, diagnostics will be prefixed by the file, line, and + * (optionally) column to which the diagnostic refers. For example, + * + * \code + * test.c:28: warning: extra tokens at end of #endif directive + * \endcode + * + * This option corresponds to the clang flag \c -fshow-source-location. + */ + CXDiagnostic_DisplaySourceLocation = 0x01, + + /** + * If displaying the source-location information of the + * diagnostic, also include the column number. + * + * This option corresponds to the clang flag \c -fshow-column. + */ + CXDiagnostic_DisplayColumn = 0x02, + + /** + * If displaying the source-location information of the + * diagnostic, also include information about source ranges in a + * machine-parsable format. + * + * This option corresponds to the clang flag + * \c -fdiagnostics-print-source-range-info. + */ + CXDiagnostic_DisplaySourceRanges = 0x04, + + /** + * Display the option name associated with this diagnostic, if any. + * + * The option name displayed (e.g., -Wconversion) will be placed in brackets + * after the diagnostic text. This option corresponds to the clang flag + * \c -fdiagnostics-show-option. + */ + CXDiagnostic_DisplayOption = 0x08, + + /** + * Display the category number associated with this diagnostic, if any. + * + * The category number is displayed within brackets after the diagnostic text. + * This option corresponds to the clang flag + * \c -fdiagnostics-show-category=id. + */ + CXDiagnostic_DisplayCategoryId = 0x10, + + /** + * Display the category name associated with this diagnostic, if any. + * + * The category name is displayed within brackets after the diagnostic text. + * This option corresponds to the clang flag + * \c -fdiagnostics-show-category=name. + */ + CXDiagnostic_DisplayCategoryName = 0x20 +}; + +/** + * 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. + */ +CINDEX_LINKAGE CXString clang_formatDiagnostic(CXDiagnostic Diagnostic, + unsigned Options); + +/** + * Retrieve the set of display options most similar to the + * default behavior of the clang compiler. + * + * \returns A set of display options suitable for use with \c + * clang_formatDiagnostic(). + */ +CINDEX_LINKAGE unsigned clang_defaultDiagnosticDisplayOptions(void); + +/** + * Determine the severity of the given diagnostic. + */ +CINDEX_LINKAGE enum CXDiagnosticSeverity +clang_getDiagnosticSeverity(CXDiagnostic); + +/** + * 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. + */ +CINDEX_LINKAGE CXSourceLocation clang_getDiagnosticLocation(CXDiagnostic); + +/** + * Retrieve the text of the given diagnostic. + */ +CINDEX_LINKAGE CXString clang_getDiagnosticSpelling(CXDiagnostic); + +/** + * 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". + */ +CINDEX_LINKAGE CXString clang_getDiagnosticOption(CXDiagnostic Diag, + CXString *Disable); + +/** + * Retrieve the category number for this diagnostic. + * + * Diagnostics can be categorized into groups along with other, related + * diagnostics (e.g., diagnostics under the same warning flag). This routine + * retrieves the category number for the given diagnostic. + * + * \returns The number of the category that contains this diagnostic, or zero + * if this diagnostic is uncategorized. + */ +CINDEX_LINKAGE unsigned clang_getDiagnosticCategory(CXDiagnostic); + +/** + * 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. + */ +CINDEX_DEPRECATED CINDEX_LINKAGE +CXString clang_getDiagnosticCategoryName(unsigned Category); + +/** + * Retrieve the diagnostic category text for a given diagnostic. + * + * \returns The text of the given diagnostic category. + */ +CINDEX_LINKAGE CXString clang_getDiagnosticCategoryText(CXDiagnostic); + +/** + * Determine the number of source ranges associated with the given + * diagnostic. + */ +CINDEX_LINKAGE unsigned clang_getDiagnosticNumRanges(CXDiagnostic); + +/** + * 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. + */ +CINDEX_LINKAGE CXSourceRange clang_getDiagnosticRange(CXDiagnostic Diagnostic, + unsigned Range); + +/** + * Determine the number of fix-it hints associated with the + * given diagnostic. + */ +CINDEX_LINKAGE unsigned clang_getDiagnosticNumFixIts(CXDiagnostic Diagnostic); + +/** + * 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. + */ +CINDEX_LINKAGE CXString clang_getDiagnosticFixIt(CXDiagnostic Diagnostic, + unsigned FixIt, + CXSourceRange *ReplacementRange); + +/** + * @} + */ + +/** + * \defgroup CINDEX_TRANSLATION_UNIT Translation unit manipulation + * + * The routines in this group provide the ability to create and destroy + * translation units from files, either by parsing the contents of the files or + * by reading in a serialized representation of a translation unit. + * + * @{ + */ + +/** + * Get the original translation unit source file name. + */ +CINDEX_LINKAGE CXString +clang_getTranslationUnitSpelling(CXTranslationUnit CTUnit); + +/** + * Return the CXTranslationUnit for a given source file and the provided + * command line arguments one would pass to the compiler. + * + * Note: The 'source_filename' argument is optional. If the caller provides a + * NULL pointer, the name of the source file is expected to reside in the + * specified command line arguments. + * + * Note: When encountered in 'clang_command_line_args', the following options + * are ignored: + * + * '-c' + * '-emit-ast' + * '-fsyntax-only' + * '-o \' (both '-o' and '\' are ignored) + * + * \param CIdx The index object with which the translation unit will be + * associated. + * + * \param source_filename The name of the source file to load, or NULL if the + * source file is included in \p clang_command_line_args. + * + * \param num_clang_command_line_args The number of command-line arguments in + * \p clang_command_line_args. + * + * \param clang_command_line_args The command-line arguments that would be + * passed to the \c clang executable if it were being invoked out-of-process. + * These command-line options will be parsed and will affect how the translation + * unit is parsed. Note that the following options are ignored: '-c', + * '-emit-ast', '-fsyntax-only' (which is the default), and '-o \'. + * + * \param num_unsaved_files the number of unsaved file entries in \p + * unsaved_files. + * + * \param unsaved_files the files that have not yet been saved to disk + * but may be required for 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. + */ +CINDEX_LINKAGE CXTranslationUnit clang_createTranslationUnitFromSourceFile( + CXIndex CIdx, + const char *source_filename, + int num_clang_command_line_args, + const char * const *clang_command_line_args, + unsigned num_unsaved_files, + struct CXUnsavedFile *unsaved_files); + +/** + * Same as \c clang_createTranslationUnit2, but returns + * the \c CXTranslationUnit instead of an error code. In case of an error this + * routine returns a \c NULL \c CXTranslationUnit, without further detailed + * error codes. + */ +CINDEX_LINKAGE CXTranslationUnit clang_createTranslationUnit( + CXIndex CIdx, + const char *ast_filename); + +/** + * Create a translation unit from an AST file (\c -emit-ast). + * + * \param[out] out_TU A non-NULL pointer to store the created + * \c CXTranslationUnit. + * + * \returns Zero on success, otherwise returns an error code. + */ +CINDEX_LINKAGE enum CXErrorCode clang_createTranslationUnit2( + CXIndex CIdx, + const char *ast_filename, + CXTranslationUnit *out_TU); + +/** + * Flags that control the creation of translation units. + * + * The enumerators in this enumeration type are meant to be bitwise + * ORed together to specify which options should be used when + * constructing the translation unit. + */ +enum CXTranslationUnit_Flags { + /** + * Used to indicate that no special translation-unit options are + * needed. + */ + CXTranslationUnit_None = 0x0, + + /** + * Used to indicate that the parser should construct a "detailed" + * preprocessing record, including all macro definitions and instantiations. + * + * Constructing a detailed preprocessing record requires more memory + * and time to parse, since the information contained in the record + * is usually not retained. However, it can be useful for + * applications that require more detailed information about the + * behavior of the preprocessor. + */ + CXTranslationUnit_DetailedPreprocessingRecord = 0x01, + + /** + * Used to indicate that the translation unit is incomplete. + * + * When a translation unit is considered "incomplete", semantic + * analysis that is typically performed at the end of the + * translation unit will be suppressed. For example, this suppresses + * the completion of tentative declarations in C and of + * instantiation of implicitly-instantiation function templates in + * C++. This option is typically used when parsing a header with the + * intent of producing a precompiled header. + */ + CXTranslationUnit_Incomplete = 0x02, + + /** + * Used to indicate that the translation unit should be built with an + * implicit precompiled header for the preamble. + * + * An implicit precompiled header is used as an optimization when a + * particular translation unit is likely to be reparsed many times + * when the sources aren't changing that often. In this case, an + * implicit precompiled header will be built containing all of the + * initial includes at the top of the main file (what we refer to as + * the "preamble" of the file). In subsequent parses, if the + * preamble or the files in it have not changed, \c + * clang_reparseTranslationUnit() will re-use the implicit + * precompiled header to improve parsing performance. + */ + CXTranslationUnit_PrecompiledPreamble = 0x04, + + /** + * Used to indicate that the translation unit should cache some + * code-completion results with each reparse of the source file. + * + * Caching of code-completion results is a performance optimization that + * introduces some overhead to reparsing but improves the performance of + * code-completion operations. + */ + CXTranslationUnit_CacheCompletionResults = 0x08, + + /** + * Used to indicate that the translation unit will be serialized with + * \c clang_saveTranslationUnit. + * + * This option is typically used when parsing a header with the intent of + * producing a precompiled header. + */ + CXTranslationUnit_ForSerialization = 0x10, + + /** + * DEPRECATED: Enabled chained precompiled preambles in C++. + * + * Note: this is a *temporary* option that is available only while + * we are testing C++ precompiled preamble support. It is deprecated. + */ + CXTranslationUnit_CXXChainedPCH = 0x20, + + /** + * Used to indicate that function/method bodies should be skipped while + * parsing. + * + * This option can be used to search for declarations/definitions while + * ignoring the usages. + */ + CXTranslationUnit_SkipFunctionBodies = 0x40, + + /** + * Used to indicate that brief documentation comments should be + * included into the set of code completions returned from this translation + * unit. + */ + CXTranslationUnit_IncludeBriefCommentsInCodeCompletion = 0x80, + + /** + * 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). + */ + CXTranslationUnit_CreatePreambleOnFirstParse = 0x100, + + /** + * Do not stop processing when fatal errors are encountered. + * + * When fatal errors are encountered while parsing a translation unit, + * semantic analysis is typically stopped early when compiling code. A common + * source for fatal errors are unresolvable include files. For the + * purposes of an IDE, this is undesirable behavior and as much information + * as possible should be reported. Use this flag to enable this behavior. + */ + CXTranslationUnit_KeepGoing = 0x200, + + /** + * Sets the preprocessor in a mode for parsing a single file only. + */ + CXTranslationUnit_SingleFileParse = 0x400, + + /** + * Used in combination with CXTranslationUnit_SkipFunctionBodies to + * constrain the skipping of function bodies to the preamble. + * + * The function bodies of the main file are not skipped. + */ + CXTranslationUnit_LimitSkipFunctionBodiesToPreamble = 0x800, + + /** + * Used to indicate that attributed types should be included in CXType. + */ + CXTranslationUnit_IncludeAttributedTypes = 0x1000, + + /** + * Used to indicate that implicit attributes should be visited. + */ + CXTranslationUnit_VisitImplicitAttributes = 0x2000, + + /** + * Used to indicate that non-errors from included files should be ignored. + * + * If set, clang_getDiagnosticSetFromTU() will not report e.g. warnings from + * included files anymore. This speeds up clang_getDiagnosticSetFromTU() for + * the case where these warnings are not of interest, as for an IDE for + * example, which typically shows only the diagnostics in the main file. + */ + CXTranslationUnit_IgnoreNonErrorsFromIncludedFiles = 0x4000, + + /** + * Tells the preprocessor not to skip excluded conditional blocks. + */ + CXTranslationUnit_RetainExcludedConditionalBlocks = 0x8000 +}; + +/** + * Returns the set of flags that is suitable for parsing a translation + * unit that is being edited. + * + * The set of flags returned provide options for \c clang_parseTranslationUnit() + * to indicate that the translation unit is likely to be reparsed many times, + * either explicitly (via \c clang_reparseTranslationUnit()) or implicitly + * (e.g., by code completion (\c clang_codeCompletionAt())). The returned flag + * set contains an unspecified set of optimizations (e.g., the precompiled + * preamble) geared toward improving the performance of these routines. The + * set of optimizations enabled may change from one version to the next. + */ +CINDEX_LINKAGE unsigned clang_defaultEditingTranslationUnitOptions(void); + +/** + * Same as \c clang_parseTranslationUnit2, but returns + * the \c CXTranslationUnit instead of an error code. In case of an error this + * routine returns a \c NULL \c CXTranslationUnit, without further detailed + * error codes. + */ +CINDEX_LINKAGE CXTranslationUnit +clang_parseTranslationUnit(CXIndex CIdx, + const char *source_filename, + const char *const *command_line_args, + int num_command_line_args, + struct CXUnsavedFile *unsaved_files, + unsigned num_unsaved_files, + unsigned options); + +/** + * Parse the given source file and the translation unit corresponding + * to that file. + * + * This routine is the main entry point for the Clang C API, providing the + * ability to parse a source file into a translation unit that can then be + * queried by other functions in the API. This routine accepts a set of + * command-line arguments so that the compilation can be configured in the same + * way that the compiler is configured on the command line. + * + * \param CIdx The index object with which the translation unit will be + * associated. + * + * \param source_filename The name of the source file to load, or NULL if the + * source file is included in \c command_line_args. + * + * \param command_line_args The command-line arguments that would be + * passed to the \c clang executable if it were being invoked out-of-process. + * These command-line options will be parsed and will affect how the translation + * unit is parsed. Note that the following options are ignored: '-c', + * '-emit-ast', '-fsyntax-only' (which is the default), and '-o \'. + * + * \param num_command_line_args The number of command-line arguments in + * \c command_line_args. + * + * \param unsaved_files the files that have not yet been saved to disk + * but may be required for parsing, 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 A bitmask of options that affects how the translation unit + * is managed but not its compilation. This should be a bitwise OR of the + * CXTranslationUnit_XXX flags. + * + * \param[out] out_TU A non-NULL pointer to store the created + * \c CXTranslationUnit, describing the parsed code and containing any + * diagnostics produced by the compiler. + * + * \returns Zero on success, otherwise returns an error code. + */ +CINDEX_LINKAGE enum CXErrorCode +clang_parseTranslationUnit2(CXIndex CIdx, + const char *source_filename, + const char *const *command_line_args, + int num_command_line_args, + struct CXUnsavedFile *unsaved_files, + unsigned num_unsaved_files, + unsigned options, + CXTranslationUnit *out_TU); + +/** + * Same as clang_parseTranslationUnit2 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. + */ +CINDEX_LINKAGE enum CXErrorCode clang_parseTranslationUnit2FullArgv( + CXIndex CIdx, const char *source_filename, + const char *const *command_line_args, int num_command_line_args, + struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files, + unsigned options, CXTranslationUnit *out_TU); + +/** + * Flags that control how translation units are saved. + * + * The enumerators in this enumeration type are meant to be bitwise + * ORed together to specify which options should be used when + * saving the translation unit. + */ +enum CXSaveTranslationUnit_Flags { + /** + * Used to indicate that no special saving options are needed. + */ + CXSaveTranslationUnit_None = 0x0 +}; + +/** + * Returns the set of flags that is suitable for saving a translation + * unit. + * + * The set of flags returned provide options for + * \c clang_saveTranslationUnit() by default. The returned flag + * set contains an unspecified set of options that save translation units with + * the most commonly-requested data. + */ +CINDEX_LINKAGE unsigned clang_defaultSaveOptions(CXTranslationUnit TU); + +/** + * Describes the kind of error that occurred (if any) in a call to + * \c clang_saveTranslationUnit(). + */ +enum CXSaveError { + /** + * Indicates that no error occurred while saving a translation unit. + */ + CXSaveError_None = 0, + + /** + * Indicates that an unknown error occurred while attempting to save + * the file. + * + * This error typically indicates that file I/O failed when attempting to + * write the file. + */ + CXSaveError_Unknown = 1, + + /** + * Indicates that errors during translation prevented this attempt + * to save the translation unit. + * + * Errors that prevent the translation unit from being saved can be + * extracted using \c clang_getNumDiagnostics() and \c clang_getDiagnostic(). + */ + CXSaveError_TranslationErrors = 2, + + /** + * Indicates that the translation unit to be saved was somehow + * invalid (e.g., NULL). + */ + CXSaveError_InvalidTU = 3 +}; + +/** + * Saves a translation unit into a serialized representation of + * that translation unit on disk. + * + * Any translation unit that was parsed without error can be saved + * into a file. The translation unit can then be deserialized into a + * new \c CXTranslationUnit with \c clang_createTranslationUnit() or, + * if it is an incomplete translation unit that corresponds to a + * header, used as a precompiled header when parsing other translation + * units. + * + * \param TU The translation unit to save. + * + * \param FileName The file to which the translation unit will be saved. + * + * \param options A bitmask of options that affects how the translation unit + * is saved. This should be a bitwise OR of the + * CXSaveTranslationUnit_XXX flags. + * + * \returns A value that will match one of the enumerators of the CXSaveError + * enumeration. Zero (CXSaveError_None) indicates that the translation unit was + * saved successfully, while a non-zero value indicates that a problem occurred. + */ +CINDEX_LINKAGE int clang_saveTranslationUnit(CXTranslationUnit TU, + const char *FileName, + unsigned options); + +/** + * Suspend a translation unit in order to free memory associated with it. + * + * A suspended translation unit uses significantly less memory but on the other + * side does not support any other calls than \c clang_reparseTranslationUnit + * to resume it or \c clang_disposeTranslationUnit to dispose it completely. + */ +CINDEX_LINKAGE unsigned clang_suspendTranslationUnit(CXTranslationUnit); + +/** + * Destroy the specified CXTranslationUnit object. + */ +CINDEX_LINKAGE void clang_disposeTranslationUnit(CXTranslationUnit); + +/** + * Flags that control the reparsing of translation units. + * + * The enumerators in this enumeration type are meant to be bitwise + * ORed together to specify which options should be used when + * reparsing the translation unit. + */ +enum CXReparse_Flags { + /** + * Used to indicate that no special reparsing options are needed. + */ + CXReparse_None = 0x0 +}; + +/** + * Returns the set of flags that is suitable for reparsing a translation + * unit. + * + * The set of flags returned provide options for + * \c clang_reparseTranslationUnit() by default. The returned flag + * set contains an unspecified set of optimizations geared toward common uses + * of reparsing. The set of optimizations enabled may change from one version + * to the next. + */ +CINDEX_LINKAGE unsigned clang_defaultReparseOptions(CXTranslationUnit TU); + +/** + * Reparse the source files that produced this translation unit. + * + * This routine can be used to re-parse the source files that originally + * created the given translation unit, for example because those source files + * have changed (either on disk or as passed via \p unsaved_files). The + * source code will be reparsed with the same command-line options as it + * was originally parsed. + * + * Reparsing a translation unit invalidates all cursors and source locations + * that refer into that translation unit. This makes reparsing a translation + * unit semantically equivalent to destroying the translation unit and then + * creating a new translation unit with the same command-line arguments. + * However, it may be more efficient to reparse a translation + * unit using this routine. + * + * \param TU The translation unit whose contents will be re-parsed. The + * translation unit must originally have been built with + * \c clang_createTranslationUnitFromSourceFile(). + * + * \param num_unsaved_files The number of unsaved file entries in \p + * unsaved_files. + * + * \param unsaved_files The files that have not yet been saved to disk + * but may be required for parsing, 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 options A bitset of options composed of the flags in CXReparse_Flags. + * The function \c clang_defaultReparseOptions() produces a default set of + * options recommended for most uses, based on the translation unit. + * + * \returns 0 if the sources could be reparsed. A non-zero error code will be + * returned if reparsing was impossible, such that the translation unit is + * invalid. In such cases, the only valid call for \c TU is + * \c clang_disposeTranslationUnit(TU). The error codes returned by this + * routine are described by the \c CXErrorCode enum. + */ +CINDEX_LINKAGE int clang_reparseTranslationUnit(CXTranslationUnit TU, + unsigned num_unsaved_files, + struct CXUnsavedFile *unsaved_files, + unsigned options); + +/** + * Categorizes how memory is being used by a translation unit. + */ +enum CXTUResourceUsageKind { + CXTUResourceUsage_AST = 1, + CXTUResourceUsage_Identifiers = 2, + CXTUResourceUsage_Selectors = 3, + CXTUResourceUsage_GlobalCompletionResults = 4, + CXTUResourceUsage_SourceManagerContentCache = 5, + CXTUResourceUsage_AST_SideTables = 6, + CXTUResourceUsage_SourceManager_Membuffer_Malloc = 7, + CXTUResourceUsage_SourceManager_Membuffer_MMap = 8, + CXTUResourceUsage_ExternalASTSource_Membuffer_Malloc = 9, + CXTUResourceUsage_ExternalASTSource_Membuffer_MMap = 10, + CXTUResourceUsage_Preprocessor = 11, + CXTUResourceUsage_PreprocessingRecord = 12, + CXTUResourceUsage_SourceManager_DataStructures = 13, + CXTUResourceUsage_Preprocessor_HeaderSearch = 14, + CXTUResourceUsage_MEMORY_IN_BYTES_BEGIN = CXTUResourceUsage_AST, + CXTUResourceUsage_MEMORY_IN_BYTES_END = + CXTUResourceUsage_Preprocessor_HeaderSearch, + + CXTUResourceUsage_First = CXTUResourceUsage_AST, + CXTUResourceUsage_Last = CXTUResourceUsage_Preprocessor_HeaderSearch +}; + +/** + * Returns the human-readable null-terminated C string that represents + * the name of the memory category. This string should never be freed. + */ +CINDEX_LINKAGE +const char *clang_getTUResourceUsageName(enum CXTUResourceUsageKind kind); + +typedef struct CXTUResourceUsageEntry { + /* The memory usage category. */ + enum CXTUResourceUsageKind kind; + /* Amount of resources used. + The units will depend on the resource kind. */ + unsigned long amount; +} CXTUResourceUsageEntry; + +/** + * The memory usage of a CXTranslationUnit, broken into categories. + */ +typedef struct CXTUResourceUsage { + /* Private data member, used for queries. */ + void *data; + + /* The number of entries in the 'entries' array. */ + unsigned numEntries; + + /* An array of key-value pairs, representing the breakdown of memory + usage. */ + CXTUResourceUsageEntry *entries; + +} CXTUResourceUsage; + +/** + * Return the memory usage of a translation unit. This object + * should be released with clang_disposeCXTUResourceUsage(). + */ +CINDEX_LINKAGE CXTUResourceUsage clang_getCXTUResourceUsage(CXTranslationUnit TU); + +CINDEX_LINKAGE void clang_disposeCXTUResourceUsage(CXTUResourceUsage usage); + +/** + * Get target information for this translation unit. + * + * The CXTargetInfo object cannot outlive the CXTranslationUnit object. + */ +CINDEX_LINKAGE CXTargetInfo +clang_getTranslationUnitTargetInfo(CXTranslationUnit CTUnit); + +/** + * Destroy the CXTargetInfo object. + */ +CINDEX_LINKAGE void +clang_TargetInfo_dispose(CXTargetInfo Info); + +/** + * Get the normalized target triple as a string. + * + * Returns the empty string in case of any error. + */ +CINDEX_LINKAGE CXString +clang_TargetInfo_getTriple(CXTargetInfo Info); + +/** + * Get the pointer width of the target in bits. + * + * Returns -1 in case of error. + */ +CINDEX_LINKAGE int +clang_TargetInfo_getPointerWidth(CXTargetInfo Info); + +/** + * @} + */ + +/** + * Describes the kind of entity that a cursor refers to. + */ +enum CXCursorKind { + /* Declarations */ + /** + * A declaration whose specific kind is not exposed via this + * interface. + * + * Unexposed declarations have the same operations as any other kind + * of declaration; one can extract their location information, + * spelling, find their definitions, etc. However, the specific kind + * of the declaration is not reported. + */ + CXCursor_UnexposedDecl = 1, + /** A C or C++ struct. */ + CXCursor_StructDecl = 2, + /** A C or C++ union. */ + CXCursor_UnionDecl = 3, + /** A C++ class. */ + CXCursor_ClassDecl = 4, + /** An enumeration. */ + CXCursor_EnumDecl = 5, + /** + * A field (in C) or non-static data member (in C++) in a + * struct, union, or C++ class. + */ + CXCursor_FieldDecl = 6, + /** An enumerator constant. */ + CXCursor_EnumConstantDecl = 7, + /** A function. */ + CXCursor_FunctionDecl = 8, + /** A variable. */ + CXCursor_VarDecl = 9, + /** A function or method parameter. */ + CXCursor_ParmDecl = 10, + /** An Objective-C \@interface. */ + CXCursor_ObjCInterfaceDecl = 11, + /** An Objective-C \@interface for a category. */ + CXCursor_ObjCCategoryDecl = 12, + /** An Objective-C \@protocol declaration. */ + CXCursor_ObjCProtocolDecl = 13, + /** An Objective-C \@property declaration. */ + CXCursor_ObjCPropertyDecl = 14, + /** An Objective-C instance variable. */ + CXCursor_ObjCIvarDecl = 15, + /** An Objective-C instance method. */ + CXCursor_ObjCInstanceMethodDecl = 16, + /** An Objective-C class method. */ + CXCursor_ObjCClassMethodDecl = 17, + /** An Objective-C \@implementation. */ + CXCursor_ObjCImplementationDecl = 18, + /** An Objective-C \@implementation for a category. */ + CXCursor_ObjCCategoryImplDecl = 19, + /** A typedef. */ + CXCursor_TypedefDecl = 20, + /** A C++ class method. */ + CXCursor_CXXMethod = 21, + /** A C++ namespace. */ + CXCursor_Namespace = 22, + /** A linkage specification, e.g. 'extern "C"'. */ + CXCursor_LinkageSpec = 23, + /** A C++ constructor. */ + CXCursor_Constructor = 24, + /** A C++ destructor. */ + CXCursor_Destructor = 25, + /** A C++ conversion function. */ + CXCursor_ConversionFunction = 26, + /** A C++ template type parameter. */ + CXCursor_TemplateTypeParameter = 27, + /** A C++ non-type template parameter. */ + CXCursor_NonTypeTemplateParameter = 28, + /** A C++ template template parameter. */ + CXCursor_TemplateTemplateParameter = 29, + /** A C++ function template. */ + CXCursor_FunctionTemplate = 30, + /** A C++ class template. */ + CXCursor_ClassTemplate = 31, + /** A C++ class template partial specialization. */ + CXCursor_ClassTemplatePartialSpecialization = 32, + /** A C++ namespace alias declaration. */ + CXCursor_NamespaceAlias = 33, + /** A C++ using directive. */ + CXCursor_UsingDirective = 34, + /** A C++ using declaration. */ + CXCursor_UsingDeclaration = 35, + /** A C++ alias declaration */ + CXCursor_TypeAliasDecl = 36, + /** An Objective-C \@synthesize definition. */ + CXCursor_ObjCSynthesizeDecl = 37, + /** An Objective-C \@dynamic definition. */ + CXCursor_ObjCDynamicDecl = 38, + /** An access specifier. */ + CXCursor_CXXAccessSpecifier = 39, + + CXCursor_FirstDecl = CXCursor_UnexposedDecl, + CXCursor_LastDecl = CXCursor_CXXAccessSpecifier, + + /* References */ + CXCursor_FirstRef = 40, /* Decl references */ + CXCursor_ObjCSuperClassRef = 40, + CXCursor_ObjCProtocolRef = 41, + CXCursor_ObjCClassRef = 42, + /** + * A reference to a type declaration. + * + * A type reference occurs anywhere where a type is named but not + * declared. For example, given: + * + * \code + * typedef unsigned size_type; + * size_type size; + * \endcode + * + * The typedef is a declaration of size_type (CXCursor_TypedefDecl), + * while the type of the variable "size" is referenced. The cursor + * referenced by the type of size is the typedef for size_type. + */ + CXCursor_TypeRef = 43, + CXCursor_CXXBaseSpecifier = 44, + /** + * A reference to a class template, function template, template + * template parameter, or class template partial specialization. + */ + CXCursor_TemplateRef = 45, + /** + * A reference to a namespace or namespace alias. + */ + 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. + */ + CXCursor_MemberRef = 47, + /** + * A reference to a labeled statement. + * + * This cursor kind is used to describe the jump to "start_over" in the + * goto statement in the following example: + * + * \code + * start_over: + * ++counter; + * + * goto start_over; + * \endcode + * + * A label reference cursor refers to a label statement. + */ + 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. + * + * An overloaded declaration reference cursor occurs in C++ templates where + * a dependent name refers to a function. For example: + * + * \code + * template void swap(T&, T&); + * + * struct X { ... }; + * void swap(X&, X&); + * + * template + * void reverse(T* first, T* last) { + * while (first < last - 1) { + * swap(*first, *--last); + * ++first; + * } + * } + * + * struct Y { }; + * void swap(Y&, Y&); + * \endcode + * + * Here, the identifier "swap" is associated with an overloaded declaration + * reference. In the template definition, "swap" refers to either of the two + * "swap" functions declared above, so both results will be available. At + * instantiation time, "swap" may also refer to other functions found via + * argument-dependent lookup (e.g., the "swap" function at the end of the + * example). + * + * The functions \c clang_getNumOverloadedDecls() and + * \c clang_getOverloadedDecl() can be used to retrieve the definitions + * referenced by this cursor. + */ + CXCursor_OverloadedDeclRef = 49, + + /** + * A reference to a variable that occurs in some non-expression + * context, e.g., a C++ lambda capture list. + */ + CXCursor_VariableRef = 50, + + CXCursor_LastRef = CXCursor_VariableRef, + + /* Error conditions */ + CXCursor_FirstInvalid = 70, + CXCursor_InvalidFile = 70, + CXCursor_NoDeclFound = 71, + CXCursor_NotImplemented = 72, + CXCursor_InvalidCode = 73, + CXCursor_LastInvalid = CXCursor_InvalidCode, + + /* Expressions */ + CXCursor_FirstExpr = 100, + + /** + * An expression whose specific kind is not exposed via this + * interface. + * + * Unexposed expressions have the same operations as any other kind + * of expression; one can extract their location information, + * spelling, children, etc. However, the specific kind of the + * expression is not reported. + */ + CXCursor_UnexposedExpr = 100, + + /** + * An expression that refers to some value declaration, such + * as a function, variable, or enumerator. + */ + CXCursor_DeclRefExpr = 101, + + /** + * An expression that refers to a member of a struct, union, + * class, Objective-C class, etc. + */ + CXCursor_MemberRefExpr = 102, + + /** An expression that calls a function. */ + CXCursor_CallExpr = 103, + + /** An expression that sends a message to an Objective-C + object or class. */ + CXCursor_ObjCMessageExpr = 104, + + /** An expression that represents a block literal. */ + CXCursor_BlockExpr = 105, + + /** An integer literal. + */ + CXCursor_IntegerLiteral = 106, + + /** A floating point number literal. + */ + CXCursor_FloatingLiteral = 107, + + /** An imaginary number literal. + */ + CXCursor_ImaginaryLiteral = 108, + + /** A string literal. + */ + CXCursor_StringLiteral = 109, + + /** A character literal. + */ + CXCursor_CharacterLiteral = 110, + + /** A parenthesized expression, e.g. "(1)". + * + * This AST node is only formed if full location information is requested. + */ + CXCursor_ParenExpr = 111, + + /** This represents the unary-expression's (except sizeof and + * alignof). + */ + CXCursor_UnaryOperator = 112, + + /** [C99 6.5.2.1] Array Subscripting. + */ + CXCursor_ArraySubscriptExpr = 113, + + /** A builtin binary operation expression such as "x + y" or + * "x <= y". + */ + CXCursor_BinaryOperator = 114, + + /** Compound assignment such as "+=". + */ + CXCursor_CompoundAssignOperator = 115, + + /** The ?: ternary operator. + */ + 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. + * + * For example: (int)f. + */ + CXCursor_CStyleCastExpr = 117, + + /** [C99 6.5.2.5] + */ + CXCursor_CompoundLiteralExpr = 118, + + /** Describes an C or C++ initializer list. + */ + CXCursor_InitListExpr = 119, + + /** The GNU address of label extension, representing &&label. + */ + CXCursor_AddrLabelExpr = 120, + + /** This is the GNU Statement Expression extension: ({int X=4; X;}) + */ + CXCursor_StmtExpr = 121, + + /** Represents a C11 generic selection. + */ + 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. + * + * The __null extension is typically only used by system headers, which define + * NULL as __null in C++ rather than using 0 (which is an integer that may not + * match the size of a pointer). + */ + CXCursor_GNUNullExpr = 123, + + /** C++'s static_cast<> expression. + */ + CXCursor_CXXStaticCastExpr = 124, + + /** C++'s dynamic_cast<> expression. + */ + CXCursor_CXXDynamicCastExpr = 125, + + /** C++'s reinterpret_cast<> expression. + */ + CXCursor_CXXReinterpretCastExpr = 126, + + /** C++'s const_cast<> expression. + */ + CXCursor_CXXConstCastExpr = 127, + + /** Represents an explicit C++ type conversion that uses "functional" + * notion (C++ [expr.type.conv]). + * + * Example: + * \code + * x = int(0.5); + * \endcode + */ + CXCursor_CXXFunctionalCastExpr = 128, + + /** A C++ typeid expression (C++ [expr.typeid]). + */ + CXCursor_CXXTypeidExpr = 129, + + /** [C++ 2.13.5] C++ Boolean Literal. + */ + CXCursor_CXXBoolLiteralExpr = 130, + + /** [C++0x 2.14.7] C++ Pointer Literal. + */ + CXCursor_CXXNullPtrLiteralExpr = 131, + + /** Represents the "this" expression in C++ + */ + CXCursor_CXXThisExpr = 132, + + /** [C++ 15] C++ Throw Expression. + * + * This handles 'throw' and 'throw' assignment-expression. When + * assignment-expression isn't present, Op will be null. + */ + CXCursor_CXXThrowExpr = 133, + + /** A new expression for memory allocation and constructor calls, e.g: + * "new CXXNewExpr(foo)". + */ + CXCursor_CXXNewExpr = 134, + + /** A delete expression for memory deallocation and destructor calls, + * e.g. "delete[] pArray". + */ + CXCursor_CXXDeleteExpr = 135, + + /** A unary expression. (noexcept, sizeof, or other traits) + */ + CXCursor_UnaryExpr = 136, + + /** An Objective-C string literal i.e. @"foo". + */ + CXCursor_ObjCStringLiteral = 137, + + /** An Objective-C \@encode expression. + */ + CXCursor_ObjCEncodeExpr = 138, + + /** An Objective-C \@selector expression. + */ + CXCursor_ObjCSelectorExpr = 139, + + /** An Objective-C \@protocol expression. + */ + CXCursor_ObjCProtocolExpr = 140, + + /** An Objective-C "bridged" cast expression, which casts between + * Objective-C pointers and C pointers, transferring ownership in the process. + * + * \code + * NSString *str = (__bridge_transfer NSString *)CFCreateString(); + * \endcode + */ + CXCursor_ObjCBridgedCastExpr = 141, + + /** Represents a C++0x pack expansion that produces a sequence of + * expressions. + * + * A pack expansion expression contains a pattern (which itself is an + * expression) followed by an ellipsis. For example: + * + * \code + * template + * void forward(F f, Types &&...args) { + * f(static_cast(args)...); + * } + * \endcode + */ + CXCursor_PackExpansionExpr = 142, + + /** Represents an expression that computes the length of a parameter + * pack. + * + * \code + * template + * struct count { + * static const unsigned value = sizeof...(Types); + * }; + * \endcode + */ + CXCursor_SizeOfPackExpr = 143, + + /* Represents a C++ lambda expression that produces a local function + * object. + * + * \code + * void abssort(float *x, unsigned N) { + * std::sort(x, x + N, + * [](float a, float b) { + * return std::abs(a) < std::abs(b); + * }); + * } + * \endcode + */ + CXCursor_LambdaExpr = 144, + + /** Objective-c Boolean Literal. + */ + CXCursor_ObjCBoolLiteralExpr = 145, + + /** Represents the "self" expression in an Objective-C method. + */ + CXCursor_ObjCSelfExpr = 146, + + /** OpenMP 4.0 [2.4, Array Section]. + */ + CXCursor_OMPArraySectionExpr = 147, + + /** Represents an @available(...) check. + */ + CXCursor_ObjCAvailabilityCheckExpr = 148, + + /** + * Fixed point literal + */ + CXCursor_FixedPointLiteral = 149, + + CXCursor_LastExpr = CXCursor_FixedPointLiteral, + + /* Statements */ + CXCursor_FirstStmt = 200, + /** + * A statement whose specific kind is not exposed via this + * interface. + * + * Unexposed statements have the same operations as any other kind of + * statement; one can extract their location information, spelling, + * children, etc. However, the specific kind of the statement is not + * reported. + */ + CXCursor_UnexposedStmt = 200, + + /** A labelled statement in a function. + * + * This cursor kind is used to describe the "start_over:" label statement in + * the following example: + * + * \code + * start_over: + * ++counter; + * \endcode + * + */ + CXCursor_LabelStmt = 201, + + /** A group of statements like { stmt stmt }. + * + * This cursor kind is used to describe compound statements, e.g. function + * bodies. + */ + CXCursor_CompoundStmt = 202, + + /** A case statement. + */ + CXCursor_CaseStmt = 203, + + /** A default statement. + */ + CXCursor_DefaultStmt = 204, + + /** An if statement + */ + CXCursor_IfStmt = 205, + + /** A switch statement. + */ + CXCursor_SwitchStmt = 206, + + /** A while statement. + */ + CXCursor_WhileStmt = 207, + + /** A do statement. + */ + CXCursor_DoStmt = 208, + + /** A for statement. + */ + CXCursor_ForStmt = 209, + + /** A goto statement. + */ + CXCursor_GotoStmt = 210, + + /** An indirect goto statement. + */ + CXCursor_IndirectGotoStmt = 211, + + /** A continue statement. + */ + CXCursor_ContinueStmt = 212, + + /** A break statement. + */ + CXCursor_BreakStmt = 213, + + /** A return statement. + */ + CXCursor_ReturnStmt = 214, + + /** A GCC inline assembly statement extension. + */ + CXCursor_GCCAsmStmt = 215, + CXCursor_AsmStmt = CXCursor_GCCAsmStmt, + + /** Objective-C's overall \@try-\@catch-\@finally statement. + */ + CXCursor_ObjCAtTryStmt = 216, + + /** Objective-C's \@catch statement. + */ + CXCursor_ObjCAtCatchStmt = 217, + + /** Objective-C's \@finally statement. + */ + CXCursor_ObjCAtFinallyStmt = 218, + + /** Objective-C's \@throw statement. + */ + CXCursor_ObjCAtThrowStmt = 219, + + /** Objective-C's \@synchronized statement. + */ + CXCursor_ObjCAtSynchronizedStmt = 220, + + /** Objective-C's autorelease pool statement. + */ + CXCursor_ObjCAutoreleasePoolStmt = 221, + + /** Objective-C's collection statement. + */ + CXCursor_ObjCForCollectionStmt = 222, + + /** C++'s catch statement. + */ + CXCursor_CXXCatchStmt = 223, + + /** C++'s try statement. + */ + CXCursor_CXXTryStmt = 224, + + /** C++'s for (* : *) statement. + */ + CXCursor_CXXForRangeStmt = 225, + + /** Windows Structured Exception Handling's try statement. + */ + CXCursor_SEHTryStmt = 226, + + /** Windows Structured Exception Handling's except statement. + */ + CXCursor_SEHExceptStmt = 227, + + /** Windows Structured Exception Handling's finally statement. + */ + CXCursor_SEHFinallyStmt = 228, + + /** A MS inline assembly statement extension. + */ + CXCursor_MSAsmStmt = 229, + + /** The null statement ";": C99 6.8.3p3. + * + * This cursor kind is used to describe the null statement. + */ + CXCursor_NullStmt = 230, + + /** Adaptor class for mixing declarations with statements and + * expressions. + */ + CXCursor_DeclStmt = 231, + + /** OpenMP parallel directive. + */ + CXCursor_OMPParallelDirective = 232, + + /** OpenMP SIMD directive. + */ + CXCursor_OMPSimdDirective = 233, + + /** OpenMP for directive. + */ + CXCursor_OMPForDirective = 234, + + /** OpenMP sections directive. + */ + CXCursor_OMPSectionsDirective = 235, + + /** OpenMP section directive. + */ + CXCursor_OMPSectionDirective = 236, + + /** OpenMP single directive. + */ + CXCursor_OMPSingleDirective = 237, + + /** OpenMP parallel for directive. + */ + CXCursor_OMPParallelForDirective = 238, + + /** OpenMP parallel sections directive. + */ + CXCursor_OMPParallelSectionsDirective = 239, + + /** OpenMP task directive. + */ + CXCursor_OMPTaskDirective = 240, + + /** OpenMP master directive. + */ + CXCursor_OMPMasterDirective = 241, + + /** OpenMP critical directive. + */ + CXCursor_OMPCriticalDirective = 242, + + /** OpenMP taskyield directive. + */ + CXCursor_OMPTaskyieldDirective = 243, + + /** OpenMP barrier directive. + */ + CXCursor_OMPBarrierDirective = 244, + + /** OpenMP taskwait directive. + */ + CXCursor_OMPTaskwaitDirective = 245, + + /** OpenMP flush directive. + */ + CXCursor_OMPFlushDirective = 246, + + /** Windows Structured Exception Handling's leave statement. + */ + CXCursor_SEHLeaveStmt = 247, + + /** OpenMP ordered directive. + */ + CXCursor_OMPOrderedDirective = 248, + + /** OpenMP atomic directive. + */ + CXCursor_OMPAtomicDirective = 249, + + /** OpenMP for SIMD directive. + */ + CXCursor_OMPForSimdDirective = 250, + + /** OpenMP parallel for SIMD directive. + */ + CXCursor_OMPParallelForSimdDirective = 251, + + /** OpenMP target directive. + */ + CXCursor_OMPTargetDirective = 252, + + /** OpenMP teams directive. + */ + CXCursor_OMPTeamsDirective = 253, + + /** OpenMP taskgroup directive. + */ + CXCursor_OMPTaskgroupDirective = 254, + + /** OpenMP cancellation point directive. + */ + CXCursor_OMPCancellationPointDirective = 255, + + /** OpenMP cancel directive. + */ + CXCursor_OMPCancelDirective = 256, + + /** OpenMP target data directive. + */ + CXCursor_OMPTargetDataDirective = 257, + + /** OpenMP taskloop directive. + */ + CXCursor_OMPTaskLoopDirective = 258, + + /** OpenMP taskloop simd directive. + */ + CXCursor_OMPTaskLoopSimdDirective = 259, + + /** OpenMP distribute directive. + */ + CXCursor_OMPDistributeDirective = 260, + + /** OpenMP target enter data directive. + */ + CXCursor_OMPTargetEnterDataDirective = 261, + + /** OpenMP target exit data directive. + */ + CXCursor_OMPTargetExitDataDirective = 262, + + /** OpenMP target parallel directive. + */ + CXCursor_OMPTargetParallelDirective = 263, + + /** OpenMP target parallel for directive. + */ + CXCursor_OMPTargetParallelForDirective = 264, + + /** OpenMP target update directive. + */ + CXCursor_OMPTargetUpdateDirective = 265, + + /** OpenMP distribute parallel for directive. + */ + CXCursor_OMPDistributeParallelForDirective = 266, + + /** OpenMP distribute parallel for simd directive. + */ + CXCursor_OMPDistributeParallelForSimdDirective = 267, + + /** OpenMP distribute simd directive. + */ + CXCursor_OMPDistributeSimdDirective = 268, + + /** OpenMP target parallel for simd directive. + */ + CXCursor_OMPTargetParallelForSimdDirective = 269, + + /** OpenMP target simd directive. + */ + CXCursor_OMPTargetSimdDirective = 270, + + /** OpenMP teams distribute directive. + */ + CXCursor_OMPTeamsDistributeDirective = 271, + + /** OpenMP teams distribute simd directive. + */ + CXCursor_OMPTeamsDistributeSimdDirective = 272, + + /** OpenMP teams distribute parallel for simd directive. + */ + CXCursor_OMPTeamsDistributeParallelForSimdDirective = 273, + + /** OpenMP teams distribute parallel for directive. + */ + CXCursor_OMPTeamsDistributeParallelForDirective = 274, + + /** OpenMP target teams directive. + */ + CXCursor_OMPTargetTeamsDirective = 275, + + /** OpenMP target teams distribute directive. + */ + CXCursor_OMPTargetTeamsDistributeDirective = 276, + + /** OpenMP target teams distribute parallel for directive. + */ + CXCursor_OMPTargetTeamsDistributeParallelForDirective = 277, + + /** OpenMP target teams distribute parallel for simd directive. + */ + CXCursor_OMPTargetTeamsDistributeParallelForSimdDirective = 278, + + /** OpenMP target teams distribute simd directive. + */ + CXCursor_OMPTargetTeamsDistributeSimdDirective = 279, + + /** C++2a std::bit_cast expression. + */ + CXCursor_BuiltinBitCastExpr = 280, + + /** OpenMP master taskloop directive. + */ + CXCursor_OMPMasterTaskLoopDirective = 281, + + /** OpenMP parallel master taskloop directive. + */ + CXCursor_OMPParallelMasterTaskLoopDirective = 282, + + /** OpenMP master taskloop simd directive. + */ + CXCursor_OMPMasterTaskLoopSimdDirective = 283, + + /** OpenMP parallel master taskloop simd directive. + */ + CXCursor_OMPParallelMasterTaskLoopSimdDirective = 284, + + /** OpenMP parallel master directive. + */ + CXCursor_OMPParallelMasterDirective = 285, + + CXCursor_LastStmt = CXCursor_OMPParallelMasterDirective, + + /** + * Cursor that represents the translation unit itself. + * + * The translation unit cursor exists primarily to act as the root + * cursor for traversing the contents of a translation unit. + */ + CXCursor_TranslationUnit = 300, + + /* Attributes */ + CXCursor_FirstAttr = 400, + /** + * An attribute whose specific kind is not exposed via this + * interface. + */ + CXCursor_UnexposedAttr = 400, + + CXCursor_IBActionAttr = 401, + CXCursor_IBOutletAttr = 402, + CXCursor_IBOutletCollectionAttr = 403, + CXCursor_CXXFinalAttr = 404, + CXCursor_CXXOverrideAttr = 405, + CXCursor_AnnotateAttr = 406, + CXCursor_AsmLabelAttr = 407, + CXCursor_PackedAttr = 408, + CXCursor_PureAttr = 409, + CXCursor_ConstAttr = 410, + CXCursor_NoDuplicateAttr = 411, + CXCursor_CUDAConstantAttr = 412, + CXCursor_CUDADeviceAttr = 413, + CXCursor_CUDAGlobalAttr = 414, + CXCursor_CUDAHostAttr = 415, + CXCursor_CUDASharedAttr = 416, + CXCursor_VisibilityAttr = 417, + CXCursor_DLLExport = 418, + CXCursor_DLLImport = 419, + CXCursor_NSReturnsRetained = 420, + CXCursor_NSReturnsNotRetained = 421, + CXCursor_NSReturnsAutoreleased = 422, + CXCursor_NSConsumesSelf = 423, + CXCursor_NSConsumed = 424, + CXCursor_ObjCException = 425, + CXCursor_ObjCNSObject = 426, + CXCursor_ObjCIndependentClass = 427, + CXCursor_ObjCPreciseLifetime = 428, + CXCursor_ObjCReturnsInnerPointer = 429, + CXCursor_ObjCRequiresSuper = 430, + CXCursor_ObjCRootClass = 431, + CXCursor_ObjCSubclassingRestricted = 432, + CXCursor_ObjCExplicitProtocolImpl = 433, + CXCursor_ObjCDesignatedInitializer = 434, + CXCursor_ObjCRuntimeVisible = 435, + CXCursor_ObjCBoxable = 436, + CXCursor_FlagEnum = 437, + CXCursor_ConvergentAttr = 438, + CXCursor_WarnUnusedAttr = 439, + CXCursor_WarnUnusedResultAttr = 440, + CXCursor_AlignedAttr = 441, + CXCursor_LastAttr = CXCursor_AlignedAttr, + + /* Preprocessing */ + CXCursor_PreprocessingDirective = 500, + CXCursor_MacroDefinition = 501, + CXCursor_MacroExpansion = 502, + CXCursor_MacroInstantiation = CXCursor_MacroExpansion, + CXCursor_InclusionDirective = 503, + CXCursor_FirstPreprocessing = CXCursor_PreprocessingDirective, + CXCursor_LastPreprocessing = CXCursor_InclusionDirective, + + /* Extra Declarations */ + /** + * A module import declaration. + */ + CXCursor_ModuleImportDecl = 600, + CXCursor_TypeAliasTemplateDecl = 601, + /** + * A static_assert or _Static_assert node + */ + CXCursor_StaticAssert = 602, + /** + * a friend declaration. + */ + CXCursor_FriendDecl = 603, + CXCursor_FirstExtraDecl = CXCursor_ModuleImportDecl, + CXCursor_LastExtraDecl = CXCursor_FriendDecl, + + /** + * A code completion overload candidate. + */ + CXCursor_OverloadCandidate = 700 +}; + +/** + * 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. + */ +typedef struct { + enum CXCursorKind kind; + int xdata; + const void *data[3]; +} CXCursor; + +/** + * \defgroup CINDEX_CURSOR_MANIP Cursor manipulations + * + * @{ + */ + +/** + * Retrieve the NULL cursor, which represents no entity. + */ +CINDEX_LINKAGE CXCursor clang_getNullCursor(void); + +/** + * 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. + */ +CINDEX_LINKAGE CXCursor clang_getTranslationUnitCursor(CXTranslationUnit); + +/** + * Determine whether two cursors are equivalent. + */ +CINDEX_LINKAGE unsigned clang_equalCursors(CXCursor, CXCursor); + +/** + * Returns non-zero if \p cursor is null. + */ +CINDEX_LINKAGE int clang_Cursor_isNull(CXCursor cursor); + +/** + * Compute a hash value for the given cursor. + */ +CINDEX_LINKAGE unsigned clang_hashCursor(CXCursor); + +/** + * Retrieve the kind of the given cursor. + */ +CINDEX_LINKAGE enum CXCursorKind clang_getCursorKind(CXCursor); + +/** + * Determine whether the given cursor kind represents a declaration. + */ +CINDEX_LINKAGE unsigned clang_isDeclaration(enum CXCursorKind); + +/** + * 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. + */ +CINDEX_LINKAGE unsigned clang_isInvalidDeclaration(CXCursor); + +/** + * Determine whether the given cursor kind represents a simple + * reference. + * + * Note that other kinds of cursors (such as expressions) can also refer to + * other cursors. Use clang_getCursorReferenced() to determine whether a + * particular cursor refers to another entity. + */ +CINDEX_LINKAGE unsigned clang_isReference(enum CXCursorKind); + +/** + * Determine whether the given cursor kind represents an expression. + */ +CINDEX_LINKAGE unsigned clang_isExpression(enum CXCursorKind); + +/** + * Determine whether the given cursor kind represents a statement. + */ +CINDEX_LINKAGE unsigned clang_isStatement(enum CXCursorKind); + +/** + * Determine whether the given cursor kind represents an attribute. + */ +CINDEX_LINKAGE unsigned clang_isAttribute(enum CXCursorKind); + +/** + * Determine whether the given cursor has any attributes. + */ +CINDEX_LINKAGE unsigned clang_Cursor_hasAttrs(CXCursor C); + +/** + * Determine whether the given cursor kind represents an invalid + * cursor. + */ +CINDEX_LINKAGE unsigned clang_isInvalid(enum CXCursorKind); + +/** + * Determine whether the given cursor kind represents a translation + * unit. + */ +CINDEX_LINKAGE unsigned clang_isTranslationUnit(enum CXCursorKind); + +/*** + * Determine whether the given cursor represents a preprocessing + * element, such as a preprocessor directive or macro instantiation. + */ +CINDEX_LINKAGE unsigned clang_isPreprocessing(enum CXCursorKind); + +/*** + * Determine whether the given cursor represents a currently + * unexposed piece of the AST (e.g., CXCursor_UnexposedStmt). + */ +CINDEX_LINKAGE unsigned clang_isUnexposed(enum CXCursorKind); + +/** + * Describe the linkage of the entity referred to by a cursor. + */ +enum CXLinkageKind { + /** This value indicates that no linkage information is available + * for a provided CXCursor. */ + CXLinkage_Invalid, + /** + * This is the linkage for variables, parameters, and so on that + * have automatic storage. This covers normal (non-extern) local variables. + */ + CXLinkage_NoLinkage, + /** This is the linkage for static variables and static functions. */ + CXLinkage_Internal, + /** This is the linkage for entities with external linkage that live + * in C++ anonymous namespaces.*/ + CXLinkage_UniqueExternal, + /** This is the linkage for entities with true, external linkage. */ + CXLinkage_External +}; + +/** + * Determine the linkage of the entity referred to by a given cursor. + */ +CINDEX_LINKAGE enum CXLinkageKind clang_getCursorLinkage(CXCursor cursor); + +enum CXVisibilityKind { + /** This value indicates that no visibility information is available + * for a provided CXCursor. */ + CXVisibility_Invalid, + + /** Symbol not seen by the linker. */ + CXVisibility_Hidden, + /** Symbol seen by the linker but resolves to a symbol inside this object. */ + CXVisibility_Protected, + /** Symbol seen by the linker and acts like a normal symbol. */ + CXVisibility_Default +}; + +/** + * 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. + */ +CINDEX_LINKAGE enum CXVisibilityKind clang_getCursorVisibility(CXCursor cursor); + +/** + * 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. + */ +CINDEX_LINKAGE enum CXAvailabilityKind +clang_getCursorAvailability(CXCursor cursor); + +/** + * 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. + */ +typedef struct CXPlatformAvailability { + /** + * A string that describes the platform for which this structure + * provides availability information. + * + * Possible values are "ios" or "macos". + */ + CXString Platform; + /** + * The version number in which this entity was introduced. + */ + CXVersion Introduced; + /** + * The version number in which this entity was deprecated (but is + * still available). + */ + CXVersion Deprecated; + /** + * The version number in which this entity was obsoleted, and therefore + * is no longer available. + */ + CXVersion Obsoleted; + /** + * Whether the entity is unconditionally unavailable on this platform. + */ + int Unavailable; + /** + * An optional message to provide to a user of this API, e.g., to + * suggest replacement APIs. + */ + CXString Message; +} CXPlatformAvailability; + +/** + * 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. + */ +CINDEX_LINKAGE int +clang_getCursorPlatformAvailability(CXCursor cursor, + int *always_deprecated, + CXString *deprecated_message, + int *always_unavailable, + CXString *unavailable_message, + CXPlatformAvailability *availability, + int availability_size); + +/** + * Free the memory associated with a \c CXPlatformAvailability structure. + */ +CINDEX_LINKAGE void +clang_disposeCXPlatformAvailability(CXPlatformAvailability *availability); + +/** + * Describe the "language" of the entity referred to by a cursor. + */ +enum CXLanguageKind { + CXLanguage_Invalid = 0, + CXLanguage_C, + CXLanguage_ObjC, + CXLanguage_CPlusPlus +}; + +/** + * Determine the "language" of the entity referred to by a given cursor. + */ +CINDEX_LINKAGE enum CXLanguageKind clang_getCursorLanguage(CXCursor cursor); + +/** + * Describe the "thread-local storage (TLS) kind" of the declaration + * referred to by a cursor. + */ +enum CXTLSKind { + CXTLS_None = 0, + CXTLS_Dynamic, + CXTLS_Static +}; + +/** + * Determine the "thread-local storage (TLS) kind" of the declaration + * referred to by a cursor. + */ +CINDEX_LINKAGE enum CXTLSKind clang_getCursorTLSKind(CXCursor cursor); + +/** + * Returns the translation unit that a cursor originated from. + */ +CINDEX_LINKAGE CXTranslationUnit clang_Cursor_getTranslationUnit(CXCursor); + +/** + * A fast container representing a set of CXCursors. + */ +typedef struct CXCursorSetImpl *CXCursorSet; + +/** + * Creates an empty CXCursorSet. + */ +CINDEX_LINKAGE CXCursorSet clang_createCXCursorSet(void); + +/** + * Disposes a CXCursorSet and releases its associated memory. + */ +CINDEX_LINKAGE void clang_disposeCXCursorSet(CXCursorSet cset); + +/** + * Queries a CXCursorSet to see if it contains a specific CXCursor. + * + * \returns non-zero if the set contains the specified cursor. +*/ +CINDEX_LINKAGE unsigned clang_CXCursorSet_contains(CXCursorSet cset, + CXCursor cursor); + +/** + * Inserts a CXCursor into a CXCursorSet. + * + * \returns zero if the CXCursor was already in the set, and non-zero otherwise. +*/ +CINDEX_LINKAGE unsigned clang_CXCursorSet_insert(CXCursorSet cset, + CXCursor cursor); + +/** + * 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. + */ +CINDEX_LINKAGE CXCursor clang_getCursorSemanticParent(CXCursor cursor); + +/** + * 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. + */ +CINDEX_LINKAGE CXCursor clang_getCursorLexicalParent(CXCursor cursor); + +/** + * 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. + */ +CINDEX_LINKAGE void clang_getOverriddenCursors(CXCursor cursor, + CXCursor **overridden, + unsigned *num_overridden); + +/** + * Free the set of overridden cursors returned by \c + * clang_getOverriddenCursors(). + */ +CINDEX_LINKAGE void clang_disposeOverriddenCursors(CXCursor *overridden); + +/** + * Retrieve the file that is included by the given inclusion directive + * cursor. + */ +CINDEX_LINKAGE CXFile clang_getIncludedFile(CXCursor cursor); + +/** + * @} + */ + +/** + * \defgroup CINDEX_CURSOR_SOURCE Mapping between cursors and source code + * + * Cursors represent a location within the Abstract Syntax Tree (AST). These + * routines help map between cursors and the physical locations where the + * described entities occur in the source code. The mapping is provided in + * both directions, so one can map from source code to the AST and back. + * + * @{ + */ + +/** + * 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. + */ +CINDEX_LINKAGE CXCursor clang_getCursor(CXTranslationUnit, CXSourceLocation); + +/** + * 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. + */ +CINDEX_LINKAGE CXSourceLocation clang_getCursorLocation(CXCursor); + +/** + * 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). + */ +CINDEX_LINKAGE CXSourceRange clang_getCursorExtent(CXCursor); + +/** + * @} + */ + +/** + * \defgroup CINDEX_TYPES Type information for CXCursors + * + * @{ + */ + +/** + * Describes the kind of type + */ +enum CXTypeKind { + /** + * Represents an invalid type (e.g., where no type is available). + */ + CXType_Invalid = 0, + + /** + * A type whose specific kind is not exposed via this + * interface. + */ + CXType_Unexposed = 1, + + /* Builtin types */ + CXType_Void = 2, + CXType_Bool = 3, + CXType_Char_U = 4, + CXType_UChar = 5, + CXType_Char16 = 6, + CXType_Char32 = 7, + CXType_UShort = 8, + CXType_UInt = 9, + CXType_ULong = 10, + CXType_ULongLong = 11, + CXType_UInt128 = 12, + CXType_Char_S = 13, + CXType_SChar = 14, + CXType_WChar = 15, + CXType_Short = 16, + CXType_Int = 17, + CXType_Long = 18, + CXType_LongLong = 19, + CXType_Int128 = 20, + CXType_Float = 21, + CXType_Double = 22, + CXType_LongDouble = 23, + CXType_NullPtr = 24, + CXType_Overload = 25, + CXType_Dependent = 26, + CXType_ObjCId = 27, + CXType_ObjCClass = 28, + CXType_ObjCSel = 29, + CXType_Float128 = 30, + CXType_Half = 31, + CXType_Float16 = 32, + CXType_ShortAccum = 33, + CXType_Accum = 34, + CXType_LongAccum = 35, + CXType_UShortAccum = 36, + CXType_UAccum = 37, + CXType_ULongAccum = 38, + CXType_FirstBuiltin = CXType_Void, + CXType_LastBuiltin = CXType_ULongAccum, + + CXType_Complex = 100, + CXType_Pointer = 101, + CXType_BlockPointer = 102, + CXType_LValueReference = 103, + CXType_RValueReference = 104, + CXType_Record = 105, + CXType_Enum = 106, + CXType_Typedef = 107, + CXType_ObjCInterface = 108, + CXType_ObjCObjectPointer = 109, + CXType_FunctionNoProto = 110, + CXType_FunctionProto = 111, + CXType_ConstantArray = 112, + CXType_Vector = 113, + CXType_IncompleteArray = 114, + CXType_VariableArray = 115, + CXType_DependentSizedArray = 116, + CXType_MemberPointer = 117, + 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. + */ + CXType_Elaborated = 119, + + /* OpenCL PipeType. */ + CXType_Pipe = 120, + + /* OpenCL builtin types. */ + CXType_OCLImage1dRO = 121, + CXType_OCLImage1dArrayRO = 122, + CXType_OCLImage1dBufferRO = 123, + CXType_OCLImage2dRO = 124, + CXType_OCLImage2dArrayRO = 125, + CXType_OCLImage2dDepthRO = 126, + CXType_OCLImage2dArrayDepthRO = 127, + CXType_OCLImage2dMSAARO = 128, + CXType_OCLImage2dArrayMSAARO = 129, + CXType_OCLImage2dMSAADepthRO = 130, + CXType_OCLImage2dArrayMSAADepthRO = 131, + CXType_OCLImage3dRO = 132, + CXType_OCLImage1dWO = 133, + CXType_OCLImage1dArrayWO = 134, + CXType_OCLImage1dBufferWO = 135, + CXType_OCLImage2dWO = 136, + CXType_OCLImage2dArrayWO = 137, + CXType_OCLImage2dDepthWO = 138, + CXType_OCLImage2dArrayDepthWO = 139, + CXType_OCLImage2dMSAAWO = 140, + CXType_OCLImage2dArrayMSAAWO = 141, + CXType_OCLImage2dMSAADepthWO = 142, + CXType_OCLImage2dArrayMSAADepthWO = 143, + CXType_OCLImage3dWO = 144, + CXType_OCLImage1dRW = 145, + CXType_OCLImage1dArrayRW = 146, + CXType_OCLImage1dBufferRW = 147, + CXType_OCLImage2dRW = 148, + CXType_OCLImage2dArrayRW = 149, + CXType_OCLImage2dDepthRW = 150, + CXType_OCLImage2dArrayDepthRW = 151, + CXType_OCLImage2dMSAARW = 152, + CXType_OCLImage2dArrayMSAARW = 153, + CXType_OCLImage2dMSAADepthRW = 154, + CXType_OCLImage2dArrayMSAADepthRW = 155, + CXType_OCLImage3dRW = 156, + CXType_OCLSampler = 157, + CXType_OCLEvent = 158, + CXType_OCLQueue = 159, + CXType_OCLReserveID = 160, + + CXType_ObjCObject = 161, + CXType_ObjCTypeParam = 162, + CXType_Attributed = 163, + + CXType_OCLIntelSubgroupAVCMcePayload = 164, + CXType_OCLIntelSubgroupAVCImePayload = 165, + CXType_OCLIntelSubgroupAVCRefPayload = 166, + CXType_OCLIntelSubgroupAVCSicPayload = 167, + CXType_OCLIntelSubgroupAVCMceResult = 168, + CXType_OCLIntelSubgroupAVCImeResult = 169, + CXType_OCLIntelSubgroupAVCRefResult = 170, + CXType_OCLIntelSubgroupAVCSicResult = 171, + CXType_OCLIntelSubgroupAVCImeResultSingleRefStreamout = 172, + CXType_OCLIntelSubgroupAVCImeResultDualRefStreamout = 173, + CXType_OCLIntelSubgroupAVCImeSingleRefStreamin = 174, + + CXType_OCLIntelSubgroupAVCImeDualRefStreamin = 175, + + CXType_ExtVector = 176 +}; + +/** + * Describes the calling convention of a function type + */ +enum CXCallingConv { + CXCallingConv_Default = 0, + CXCallingConv_C = 1, + CXCallingConv_X86StdCall = 2, + CXCallingConv_X86FastCall = 3, + CXCallingConv_X86ThisCall = 4, + CXCallingConv_X86Pascal = 5, + CXCallingConv_AAPCS = 6, + CXCallingConv_AAPCS_VFP = 7, + CXCallingConv_X86RegCall = 8, + CXCallingConv_IntelOclBicc = 9, + CXCallingConv_Win64 = 10, + /* Alias for compatibility with older versions of API. */ + CXCallingConv_X86_64Win64 = CXCallingConv_Win64, + CXCallingConv_X86_64SysV = 11, + CXCallingConv_X86VectorCall = 12, + CXCallingConv_Swift = 13, + CXCallingConv_PreserveMost = 14, + CXCallingConv_PreserveAll = 15, + CXCallingConv_AArch64VectorCall = 16, + + CXCallingConv_Invalid = 100, + CXCallingConv_Unexposed = 200 +}; + +/** + * The type of an element in the abstract syntax tree. + * + */ +typedef struct { + enum CXTypeKind kind; + void *data[2]; +} CXType; + +/** + * Retrieve the type of a CXCursor (if any). + */ +CINDEX_LINKAGE CXType clang_getCursorType(CXCursor C); + +/** + * Pretty-print the underlying type using the rules of the + * language of the translation unit from which it came. + * + * If the type is invalid, an empty string is returned. + */ +CINDEX_LINKAGE CXString clang_getTypeSpelling(CXType CT); + +/** + * Retrieve the underlying type of a typedef declaration. + * + * If the cursor does not reference a typedef declaration, an invalid type is + * returned. + */ +CINDEX_LINKAGE CXType clang_getTypedefDeclUnderlyingType(CXCursor C); + +/** + * Retrieve the integer type of an enum declaration. + * + * If the cursor does not reference an enum declaration, an invalid type is + * returned. + */ +CINDEX_LINKAGE CXType clang_getEnumDeclIntegerType(CXCursor C); + +/** + * Retrieve the integer value of an enum constant declaration as a signed + * long long. + * + * 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. + */ +CINDEX_LINKAGE long long clang_getEnumConstantDeclValue(CXCursor C); + +/** + * Retrieve the integer value of an enum constant declaration as an unsigned + * long long. + * + * 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. + */ +CINDEX_LINKAGE unsigned long long clang_getEnumConstantDeclUnsignedValue(CXCursor C); + +/** + * 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. + */ +CINDEX_LINKAGE int clang_getFieldDeclBitWidth(CXCursor C); + +/** + * 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. + */ +CINDEX_LINKAGE int clang_Cursor_getNumArguments(CXCursor C); + +/** + * 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. + */ +CINDEX_LINKAGE CXCursor clang_Cursor_getArgument(CXCursor C, unsigned i); + +/** + * Describes the kind of a template argument. + * + * See the definition of llvm::clang::TemplateArgument::ArgKind for full + * element descriptions. + */ +enum CXTemplateArgumentKind { + CXTemplateArgumentKind_Null, + CXTemplateArgumentKind_Type, + CXTemplateArgumentKind_Declaration, + CXTemplateArgumentKind_NullPtr, + CXTemplateArgumentKind_Integral, + CXTemplateArgumentKind_Template, + CXTemplateArgumentKind_TemplateExpansion, + CXTemplateArgumentKind_Expression, + CXTemplateArgumentKind_Pack, + /* Indicates an error case, preventing the kind from being deduced. */ + CXTemplateArgumentKind_Invalid +}; + +/** + *Returns the number of template args of a function decl representing a + * template specialization. + * + * If the argument cursor cannot be converted into a template function + * declaration, -1 is returned. + * + * For example, for the following declaration and specialization: + * template + * void foo() { ... } + * + * template <> + * void foo(); + * + * The value 3 would be returned from this call. + */ +CINDEX_LINKAGE int clang_Cursor_getNumTemplateArguments(CXCursor C); + +/** + * Retrieve the kind of the I'th template argument of the CXCursor C. + * + * If the argument CXCursor does not represent a FunctionDecl, an invalid + * template argument kind is returned. + * + * For example, for the following declaration and specialization: + * template + * void foo() { ... } + * + * template <> + * void foo(); + * + * For I = 0, 1, and 2, Type, Integral, and Integral will be returned, + * respectively. + */ +CINDEX_LINKAGE enum CXTemplateArgumentKind clang_Cursor_getTemplateArgumentKind( + CXCursor C, unsigned I); + +/** + * 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. + */ +CINDEX_LINKAGE CXType clang_Cursor_getTemplateArgumentType(CXCursor C, + unsigned I); + +/** + * Retrieve the value of an Integral TemplateArgument (of a function + * decl representing a template specialization) as a signed long long. + * + * 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. + * + * For example, for the following declaration and specialization: + * template + * void foo() { ... } + * + * 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. + */ +CINDEX_LINKAGE long long clang_Cursor_getTemplateArgumentValue(CXCursor C, + unsigned I); + +/** + * Retrieve the value of an Integral TemplateArgument (of a function + * decl representing a template specialization) as an unsigned long long. + * + * 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. + * + * 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. + */ +CINDEX_LINKAGE unsigned long long clang_Cursor_getTemplateArgumentUnsignedValue( + CXCursor C, unsigned I); + +/** + * Determine whether two CXTypes represent the same type. + * + * \returns non-zero if the CXTypes represent the same type and + * zero otherwise. + */ +CINDEX_LINKAGE unsigned clang_equalTypes(CXType A, CXType B); + +/** + * Return the canonical type for a CXType. + * + * 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'. + */ +CINDEX_LINKAGE CXType clang_getCanonicalType(CXType T); + +/** + * Determine whether a CXType has the "const" qualifier set, + * without looking through typedefs that may have added "const" at a + * different level. + */ +CINDEX_LINKAGE unsigned clang_isConstQualifiedType(CXType T); + +/** + * Determine whether a CXCursor that is a macro, is + * function like. + */ +CINDEX_LINKAGE unsigned clang_Cursor_isMacroFunctionLike(CXCursor C); + +/** + * Determine whether a CXCursor that is a macro, is a + * builtin one. + */ +CINDEX_LINKAGE unsigned clang_Cursor_isMacroBuiltin(CXCursor C); + +/** + * Determine whether a CXCursor that is a function declaration, is an + * inline declaration. + */ +CINDEX_LINKAGE unsigned clang_Cursor_isFunctionInlined(CXCursor C); + +/** + * Determine whether a CXType has the "volatile" qualifier set, + * without looking through typedefs that may have added "volatile" at + * a different level. + */ +CINDEX_LINKAGE unsigned clang_isVolatileQualifiedType(CXType T); + +/** + * Determine whether a CXType has the "restrict" qualifier set, + * without looking through typedefs that may have added "restrict" at a + * different level. + */ +CINDEX_LINKAGE unsigned clang_isRestrictQualifiedType(CXType T); + +/** + * Returns the address space of the given type. + */ +CINDEX_LINKAGE unsigned clang_getAddressSpace(CXType T); + +/** + * Returns the typedef name of the given type. + */ +CINDEX_LINKAGE CXString clang_getTypedefName(CXType CT); + +/** + * For pointer types, returns the type of the pointee. + */ +CINDEX_LINKAGE CXType clang_getPointeeType(CXType T); + +/** + * Return the cursor for the declaration of the given type. + */ +CINDEX_LINKAGE CXCursor clang_getTypeDeclaration(CXType T); + +/** + * Returns the Objective-C type encoding for the specified declaration. + */ +CINDEX_LINKAGE CXString clang_getDeclObjCTypeEncoding(CXCursor C); + +/** + * Returns the Objective-C type encoding for the specified CXType. + */ +CINDEX_LINKAGE CXString clang_Type_getObjCEncoding(CXType type); + +/** + * Retrieve the spelling of a given CXTypeKind. + */ +CINDEX_LINKAGE CXString clang_getTypeKindSpelling(enum CXTypeKind K); + +/** + * Retrieve the calling convention associated with a function type. + * + * If a non-function type is passed in, CXCallingConv_Invalid is returned. + */ +CINDEX_LINKAGE enum CXCallingConv clang_getFunctionTypeCallingConv(CXType T); + +/** + * Retrieve the return type associated with a function type. + * + * If a non-function type is passed in, an invalid type is returned. + */ +CINDEX_LINKAGE CXType clang_getResultType(CXType T); + +/** + * 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. + */ +CINDEX_LINKAGE int clang_getExceptionSpecificationType(CXType T); + +/** + * Retrieve the number of non-variadic parameters associated with a + * function type. + * + * If a non-function type is passed in, -1 is returned. + */ +CINDEX_LINKAGE int clang_getNumArgTypes(CXType T); + +/** + * Retrieve the type of a parameter of a function type. + * + * If a non-function type is passed in or the function does not have enough + * parameters, an invalid type is returned. + */ +CINDEX_LINKAGE CXType clang_getArgType(CXType T, unsigned i); + +/** + * Retrieves the base type of the ObjCObjectType. + * + * If the type is not an ObjC object, an invalid type is returned. + */ +CINDEX_LINKAGE CXType clang_Type_getObjCObjectBaseType(CXType T); + +/** + * Retrieve the number of protocol references associated with an ObjC object/id. + * + * If the type is not an ObjC object, 0 is returned. + */ +CINDEX_LINKAGE unsigned clang_Type_getNumObjCProtocolRefs(CXType T); + +/** + * Retrieve the decl for a protocol reference for an ObjC object/id. + * + * If the type is not an ObjC object or there are not enough protocol + * references, an invalid cursor is returned. + */ +CINDEX_LINKAGE CXCursor clang_Type_getObjCProtocolDecl(CXType T, unsigned i); + +/** + * Retreive the number of type arguments associated with an ObjC object. + * + * If the type is not an ObjC object, 0 is returned. + */ +CINDEX_LINKAGE unsigned clang_Type_getNumObjCTypeArgs(CXType T); + +/** + * 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. + */ +CINDEX_LINKAGE CXType clang_Type_getObjCTypeArg(CXType T, unsigned i); + +/** + * Return 1 if the CXType is a variadic function type, and 0 otherwise. + */ +CINDEX_LINKAGE unsigned clang_isFunctionTypeVariadic(CXType T); + +/** + * Retrieve the return type associated with a given cursor. + * + * This only returns a valid type if the cursor refers to a function or method. + */ +CINDEX_LINKAGE CXType clang_getCursorResultType(CXCursor C); + +/** + * 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. + */ +CINDEX_LINKAGE int clang_getCursorExceptionSpecificationType(CXCursor C); + +/** + * Return 1 if the CXType is a POD (plain old data) type, and 0 + * otherwise. + */ +CINDEX_LINKAGE unsigned clang_isPODType(CXType T); + +/** + * 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. + */ +CINDEX_LINKAGE CXType clang_getElementType(CXType T); + +/** + * 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. + */ +CINDEX_LINKAGE long long clang_getNumElements(CXType T); + +/** + * Return the element type of an array type. + * + * If a non-array type is passed in, an invalid type is returned. + */ +CINDEX_LINKAGE CXType clang_getArrayElementType(CXType T); + +/** + * Return the array size of a constant array. + * + * If a non-array type is passed in, -1 is returned. + */ +CINDEX_LINKAGE long long clang_getArraySize(CXType T); + +/** + * Retrieve the type named by the qualified-id. + * + * If a non-elaborated type is passed in, an invalid type is returned. + */ +CINDEX_LINKAGE CXType clang_Type_getNamedType(CXType T); + +/** + * Determine if a typedef is 'transparent' tag. + * + * 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 non-zero if transparent and zero otherwise. + */ +CINDEX_LINKAGE unsigned clang_Type_isTransparentTagTypedef(CXType T); + +enum CXTypeNullabilityKind { + /** + * Values of this type can never be null. + */ + CXTypeNullability_NonNull = 0, + /** + * Values of this type can be null. + */ + 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. + */ + CXTypeNullability_Unspecified = 2, + /** + * Nullability is not applicable to this type. + */ + CXTypeNullability_Invalid = 3 +}; + +/** + * Retrieve the nullability kind of a pointer type. + */ +CINDEX_LINKAGE enum CXTypeNullabilityKind clang_Type_getNullability(CXType T); + +/** + * List the possible error codes for \c clang_Type_getSizeOf, + * \c clang_Type_getAlignOf, \c clang_Type_getOffsetOf and + * \c clang_Cursor_getOffsetOf. + * + * A value of this enumeration type can be returned if the target type is not + * a valid argument to sizeof, alignof or offsetof. + */ +enum CXTypeLayoutError { + /** + * Type is of kind CXType_Invalid. + */ + CXTypeLayoutError_Invalid = -1, + /** + * The type is an incomplete Type. + */ + CXTypeLayoutError_Incomplete = -2, + /** + * The type is a dependent Type. + */ + CXTypeLayoutError_Dependent = -3, + /** + * The type is not a constant size type. + */ + CXTypeLayoutError_NotConstantSize = -4, + /** + * The Field name is not valid for this record. + */ + CXTypeLayoutError_InvalidFieldName = -5, + /** + * The type is undeduced. + */ + CXTypeLayoutError_Undeduced = -6 +}; + +/** + * Return the alignment of a type in bytes as per C++[expr.alignof] + * 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. + * If the type declaration is not a constant size type, + * CXTypeLayoutError_NotConstantSize is returned. + */ +CINDEX_LINKAGE long long clang_Type_getAlignOf(CXType T); + +/** + * Return the class type of an member pointer type. + * + * If a non-member-pointer type is passed in, an invalid type is returned. + */ +CINDEX_LINKAGE CXType clang_Type_getClassType(CXType T); + +/** + * 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. + */ +CINDEX_LINKAGE long long clang_Type_getSizeOf(CXType T); + +/** + * 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. + */ +CINDEX_LINKAGE long long clang_Type_getOffsetOf(CXType T, const char *S); + +/** + * Return the type that was modified by this attributed type. + * + * If the type is not an attributed type, an invalid type is returned. + */ +CINDEX_LINKAGE CXType clang_Type_getModifiedType(CXType T); + +/** + * 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. + */ +CINDEX_LINKAGE long long clang_Cursor_getOffsetOfField(CXCursor C); + +/** + * Determine whether the given cursor represents an anonymous + * tag or namespace + */ +CINDEX_LINKAGE unsigned clang_Cursor_isAnonymous(CXCursor C); + +/** + * Determine whether the given cursor represents an anonymous record + * declaration. + */ +CINDEX_LINKAGE unsigned clang_Cursor_isAnonymousRecordDecl(CXCursor C); + +/** + * Determine whether the given cursor represents an inline namespace + * declaration. + */ +CINDEX_LINKAGE unsigned clang_Cursor_isInlineNamespace(CXCursor C); + +enum CXRefQualifierKind { + /** No ref-qualifier was provided. */ + CXRefQualifier_None = 0, + /** An lvalue ref-qualifier was provided (\c &). */ + CXRefQualifier_LValue, + /** An rvalue ref-qualifier was provided (\c &&). */ + CXRefQualifier_RValue +}; + +/** + * Returns the number of template arguments for given template + * specialization, or -1 if type \c T is not a template specialization. + */ +CINDEX_LINKAGE int clang_Type_getNumTemplateArguments(CXType T); + +/** + * 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. + */ +CINDEX_LINKAGE CXType clang_Type_getTemplateArgumentAsType(CXType T, unsigned i); + +/** + * 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. + */ +CINDEX_LINKAGE enum CXRefQualifierKind clang_Type_getCXXRefQualifier(CXType T); + +/** + * Returns non-zero if the cursor specifies a Record member that is a + * bitfield. + */ +CINDEX_LINKAGE unsigned clang_Cursor_isBitField(CXCursor C); + +/** + * Returns 1 if the base class specified by the cursor with kind + * CX_CXXBaseSpecifier is virtual. + */ +CINDEX_LINKAGE unsigned clang_isVirtualBase(CXCursor); + +/** + * Represents the C++ access control level to a base class for a + * cursor with kind CX_CXXBaseSpecifier. + */ +enum CX_CXXAccessSpecifier { + CX_CXXInvalidAccessSpecifier, + CX_CXXPublic, + CX_CXXProtected, + CX_CXXPrivate +}; + +/** + * 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. + */ +CINDEX_LINKAGE enum CX_CXXAccessSpecifier clang_getCXXAccessSpecifier(CXCursor); + +/** + * 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. + */ +enum CX_StorageClass { + CX_SC_Invalid, + CX_SC_None, + CX_SC_Extern, + CX_SC_Static, + CX_SC_PrivateExtern, + CX_SC_OpenCLWorkGroupLocal, + CX_SC_Auto, + CX_SC_Register +}; + +/** + * Returns the storage class for a function or variable declaration. + * + * If the passed in Cursor is not a function or variable declaration, + * CX_SC_Invalid is returned else the storage class. + */ +CINDEX_LINKAGE enum CX_StorageClass clang_Cursor_getStorageClass(CXCursor); + +/** + * Determine the number of overloaded declarations referenced by a + * \c CXCursor_OverloadedDeclRef cursor. + * + * \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. + */ +CINDEX_LINKAGE unsigned clang_getNumOverloadedDecls(CXCursor cursor); + +/** + * Retrieve a cursor for one of the overloaded declarations referenced + * by a \c CXCursor_OverloadedDeclRef cursor. + * + * \param cursor The cursor whose overloaded declarations are being queried. + * + * \param index The zero-based index into the set of overloaded declarations in + * the cursor. + * + * \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(); + */ +CINDEX_LINKAGE CXCursor clang_getOverloadedDecl(CXCursor cursor, + unsigned index); + +/** + * @} + */ + +/** + * \defgroup CINDEX_ATTRIBUTES Information for attributes + * + * @{ + */ + +/** + * For cursors representing an iboutletcollection attribute, + * this function returns the collection element type. + * + */ +CINDEX_LINKAGE CXType clang_getIBOutletCollectionType(CXCursor); + +/** + * @} + */ + +/** + * \defgroup CINDEX_CURSOR_TRAVERSAL Traversing the AST with cursors + * + * These routines provide the ability to traverse the abstract syntax tree + * using cursors. + * + * @{ + */ + +/** + * Describes how the traversal of the children of a particular + * cursor should proceed after visiting a particular child cursor. + * + * A value of this enumeration type should be returned by each + * \c CXCursorVisitor to indicate how clang_visitChildren() proceed. + */ +enum CXChildVisitResult { + /** + * Terminates the cursor traversal. + */ + CXChildVisit_Break, + /** + * Continues the cursor traversal with the next sibling of + * the cursor just visited, without visiting its children. + */ + CXChildVisit_Continue, + /** + * Recursively traverse the children of this cursor, using + * the same visitor and client data. + */ + CXChildVisit_Recurse +}; + +/** + * Visitor invoked for each cursor found by a traversal. + * + * This visitor function will be invoked for each cursor found by + * clang_visitCursorChildren(). Its first argument is the cursor being + * visited, its second argument is the parent visitor for that cursor, + * and its third argument is the client data provided to + * clang_visitCursorChildren(). + * + * The visitor should return one of the \c CXChildVisitResult values + * to direct clang_visitCursorChildren(). + */ +typedef enum CXChildVisitResult (*CXCursorVisitor)(CXCursor cursor, + CXCursor parent, + CXClientData client_data); + +/** + * Visit the children of a particular cursor. + * + * 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 parent the cursor whose child may be visited. All kinds of + * cursors can be visited, including invalid cursors (which, by + * definition, have no children). + * + * \param visitor the visitor function that will be invoked for each + * child of \p parent. + * + * \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. + */ +CINDEX_LINKAGE unsigned clang_visitChildren(CXCursor parent, + CXCursorVisitor visitor, + CXClientData client_data); +#ifdef __has_feature +# if __has_feature(blocks) +/** + * Visitor invoked for each cursor found by a traversal. + * + * This visitor block will be invoked for each cursor found by + * clang_visitChildrenWithBlock(). Its first argument is the cursor being + * visited, its second argument is the parent visitor for that cursor. + * + * The visitor should return one of the \c CXChildVisitResult values + * to direct clang_visitChildrenWithBlock(). + */ +typedef enum CXChildVisitResult + (^CXCursorVisitorBlock)(CXCursor cursor, CXCursor parent); + +/** + * Visits the children of a cursor using the specified block. Behaves + * identically to clang_visitChildren() in all other respects. + */ +CINDEX_LINKAGE unsigned clang_visitChildrenWithBlock(CXCursor parent, + CXCursorVisitorBlock block); +# endif +#endif + +/** + * @} + */ + +/** + * \defgroup CINDEX_CURSOR_XREF Cross-referencing in the AST + * + * These routines provide the ability to determine references within and + * across translation units, by providing the names of the entities referenced + * by cursors, follow reference cursors to the declarations they reference, + * and associate declarations with their definitions. + * + * @{ + */ + +/** + * 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. + */ +CINDEX_LINKAGE CXString clang_getCursorUSR(CXCursor); + +/** + * Construct a USR for a specified Objective-C class. + */ +CINDEX_LINKAGE CXString clang_constructUSR_ObjCClass(const char *class_name); + +/** + * Construct a USR for a specified Objective-C category. + */ +CINDEX_LINKAGE CXString + clang_constructUSR_ObjCCategory(const char *class_name, + const char *category_name); + +/** + * Construct a USR for a specified Objective-C protocol. + */ +CINDEX_LINKAGE CXString + clang_constructUSR_ObjCProtocol(const char *protocol_name); + +/** + * Construct a USR for a specified Objective-C instance variable and + * the USR for its containing class. + */ +CINDEX_LINKAGE CXString clang_constructUSR_ObjCIvar(const char *name, + CXString classUSR); + +/** + * Construct a USR for a specified Objective-C method and + * the USR for its containing class. + */ +CINDEX_LINKAGE CXString clang_constructUSR_ObjCMethod(const char *name, + unsigned isInstanceMethod, + CXString classUSR); + +/** + * Construct a USR for a specified Objective-C property and the USR + * for its containing class. + */ +CINDEX_LINKAGE CXString clang_constructUSR_ObjCProperty(const char *property, + CXString classUSR); + +/** + * Retrieve a name for the entity referenced by this cursor. + */ +CINDEX_LINKAGE CXString clang_getCursorSpelling(CXCursor); + +/** + * 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. + * + * \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. + * + * \param options Reserved. + */ +CINDEX_LINKAGE CXSourceRange clang_Cursor_getSpellingNameRange(CXCursor, + unsigned pieceIndex, + unsigned options); + +/** + * Opaque pointer representing a policy that controls pretty printing + * for \c clang_getCursorPrettyPrinted. + */ +typedef void *CXPrintingPolicy; + +/** + * Properties for the printing policy. + * + * See \c clang::PrintingPolicy for more information. + */ +enum CXPrintingPolicyProperty { + CXPrintingPolicy_Indentation, + CXPrintingPolicy_SuppressSpecifiers, + CXPrintingPolicy_SuppressTagKeyword, + CXPrintingPolicy_IncludeTagDefinition, + CXPrintingPolicy_SuppressScope, + CXPrintingPolicy_SuppressUnwrittenScope, + CXPrintingPolicy_SuppressInitializers, + CXPrintingPolicy_ConstantArraySizeAsWritten, + CXPrintingPolicy_AnonymousTagLocations, + CXPrintingPolicy_SuppressStrongLifetime, + CXPrintingPolicy_SuppressLifetimeQualifiers, + CXPrintingPolicy_SuppressTemplateArgsInCXXConstructors, + CXPrintingPolicy_Bool, + CXPrintingPolicy_Restrict, + CXPrintingPolicy_Alignof, + CXPrintingPolicy_UnderscoreAlignof, + CXPrintingPolicy_UseVoidForZeroParams, + CXPrintingPolicy_TerseOutput, + CXPrintingPolicy_PolishForDeclaration, + CXPrintingPolicy_Half, + CXPrintingPolicy_MSWChar, + CXPrintingPolicy_IncludeNewlines, + CXPrintingPolicy_MSVCFormatting, + CXPrintingPolicy_ConstantsAsWritten, + CXPrintingPolicy_SuppressImplicitBase, + CXPrintingPolicy_FullyQualifiedName, + + CXPrintingPolicy_LastProperty = CXPrintingPolicy_FullyQualifiedName +}; + +/** + * Get a property value for the given printing policy. + */ +CINDEX_LINKAGE unsigned +clang_PrintingPolicy_getProperty(CXPrintingPolicy Policy, + enum CXPrintingPolicyProperty Property); + +/** + * Set a property value for the given printing policy. + */ +CINDEX_LINKAGE void clang_PrintingPolicy_setProperty(CXPrintingPolicy Policy, + enum CXPrintingPolicyProperty Property, + unsigned Value); + +/** + * Retrieve the default policy for the cursor. + * + * The policy should be released after use with \c + * clang_PrintingPolicy_dispose. + */ +CINDEX_LINKAGE CXPrintingPolicy clang_getCursorPrintingPolicy(CXCursor); + +/** + * Release a printing policy. + */ +CINDEX_LINKAGE void clang_PrintingPolicy_dispose(CXPrintingPolicy Policy); + +/** + * 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. + */ +CINDEX_LINKAGE CXString clang_getCursorPrettyPrinted(CXCursor Cursor, + CXPrintingPolicy Policy); + +/** + * 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. + */ +CINDEX_LINKAGE CXString clang_getCursorDisplayName(CXCursor); + +/** 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. + */ +CINDEX_LINKAGE CXCursor clang_getCursorReferenced(CXCursor); + +/** + * 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. + */ +CINDEX_LINKAGE CXCursor clang_getCursorDefinition(CXCursor); + +/** + * Determine whether the declaration pointed to by this cursor + * is also a definition of that entity. + */ +CINDEX_LINKAGE unsigned clang_isCursorDefinition(CXCursor); + +/** + * 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. + */ +CINDEX_LINKAGE CXCursor clang_getCanonicalCursor(CXCursor); + +/** + * 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. + */ +CINDEX_LINKAGE int clang_Cursor_getObjCSelectorIndex(CXCursor); + +/** + * 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. + */ +CINDEX_LINKAGE int clang_Cursor_isDynamicCall(CXCursor C); + +/** + * Given a cursor pointing to an Objective-C message or property + * reference, or C++ method call, returns the CXType of the receiver. + */ +CINDEX_LINKAGE CXType clang_Cursor_getReceiverType(CXCursor C); + +/** + * Property attributes for a \c CXCursor_ObjCPropertyDecl. + */ +typedef enum { + CXObjCPropertyAttr_noattr = 0x00, + CXObjCPropertyAttr_readonly = 0x01, + CXObjCPropertyAttr_getter = 0x02, + CXObjCPropertyAttr_assign = 0x04, + CXObjCPropertyAttr_readwrite = 0x08, + CXObjCPropertyAttr_retain = 0x10, + CXObjCPropertyAttr_copy = 0x20, + CXObjCPropertyAttr_nonatomic = 0x40, + CXObjCPropertyAttr_setter = 0x80, + CXObjCPropertyAttr_atomic = 0x100, + CXObjCPropertyAttr_weak = 0x200, + CXObjCPropertyAttr_strong = 0x400, + CXObjCPropertyAttr_unsafe_unretained = 0x800, + CXObjCPropertyAttr_class = 0x1000 +} CXObjCPropertyAttrKind; + +/** + * 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. + */ +CINDEX_LINKAGE unsigned clang_Cursor_getObjCPropertyAttributes(CXCursor C, + unsigned reserved); + +/** + * Given a cursor that represents a property declaration, return the + * name of the method that implements the getter. + */ +CINDEX_LINKAGE CXString clang_Cursor_getObjCPropertyGetterName(CXCursor C); + +/** + * Given a cursor that represents a property declaration, return the + * name of the method that implements the setter, if any. + */ +CINDEX_LINKAGE CXString clang_Cursor_getObjCPropertySetterName(CXCursor C); + +/** + * 'Qualifiers' written next to the return and parameter types in + * Objective-C method declarations. + */ +typedef enum { + CXObjCDeclQualifier_None = 0x0, + CXObjCDeclQualifier_In = 0x1, + CXObjCDeclQualifier_Inout = 0x2, + CXObjCDeclQualifier_Out = 0x4, + CXObjCDeclQualifier_Bycopy = 0x8, + CXObjCDeclQualifier_Byref = 0x10, + CXObjCDeclQualifier_Oneway = 0x20 +} CXObjCDeclQualifierKind; + +/** + * 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. + */ +CINDEX_LINKAGE unsigned clang_Cursor_getObjCDeclQualifiers(CXCursor C); + +/** + * 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". + */ +CINDEX_LINKAGE unsigned clang_Cursor_isObjCOptional(CXCursor C); + +/** + * Returns non-zero if the given cursor is a variadic function or method. + */ +CINDEX_LINKAGE unsigned clang_Cursor_isVariadic(CXCursor C); + +/** + * Returns non-zero if the given cursor points to a symbol marked with + * external_source_symbol attribute. + * + * \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. + */ +CINDEX_LINKAGE unsigned clang_Cursor_isExternalSymbol(CXCursor C, + CXString *language, CXString *definedIn, + unsigned *isGenerated); + +/** + * 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. + */ +CINDEX_LINKAGE CXSourceRange clang_Cursor_getCommentRange(CXCursor C); + +/** + * Given a cursor that represents a declaration, return the associated + * comment text, including comment markers. + */ +CINDEX_LINKAGE CXString clang_Cursor_getRawCommentText(CXCursor C); + +/** + * Given a cursor that represents a documentable entity (e.g., + * declaration), return the associated \paragraph; otherwise return the + * first paragraph. + */ +CINDEX_LINKAGE CXString clang_Cursor_getBriefCommentText(CXCursor C); + +/** + * @} + */ + +/** \defgroup CINDEX_MANGLE Name Mangling API Functions + * + * @{ + */ + +/** + * Retrieve the CXString representing the mangled name of the cursor. + */ +CINDEX_LINKAGE CXString clang_Cursor_getMangling(CXCursor); + +/** + * Retrieve the CXStrings representing the mangled symbols of the C++ + * constructor or destructor at the cursor. + */ +CINDEX_LINKAGE CXStringSet *clang_Cursor_getCXXManglings(CXCursor); + +/** + * Retrieve the CXStrings representing the mangled symbols of the ObjC + * class interface or implementation at the cursor. + */ +CINDEX_LINKAGE CXStringSet *clang_Cursor_getObjCManglings(CXCursor); + +/** + * @} + */ + +/** + * \defgroup CINDEX_MODULE Module introspection + * + * The functions in this group provide access to information about modules. + * + * @{ + */ + +typedef void *CXModule; + +/** + * Given a CXCursor_ModuleImportDecl cursor, return the associated module. + */ +CINDEX_LINKAGE CXModule clang_Cursor_getModule(CXCursor C); + +/** + * Given a CXFile header file, return the module that contains it, if one + * exists. + */ +CINDEX_LINKAGE CXModule clang_getModuleForFile(CXTranslationUnit, CXFile); + +/** + * \param Module a module object. + * + * \returns the module file where the provided module object came from. + */ +CINDEX_LINKAGE CXFile clang_Module_getASTFile(CXModule Module); + +/** + * \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. + */ +CINDEX_LINKAGE CXModule clang_Module_getParent(CXModule Module); + +/** + * \param Module a module object. + * + * \returns the name of the module, e.g. for the 'std.vector' sub-module it + * will return "vector". + */ +CINDEX_LINKAGE CXString clang_Module_getName(CXModule Module); + +/** + * \param Module a module object. + * + * \returns the full name of the module, e.g. "std.vector". + */ +CINDEX_LINKAGE CXString clang_Module_getFullName(CXModule Module); + +/** + * \param Module a module object. + * + * \returns non-zero if the module is a system one. + */ +CINDEX_LINKAGE int clang_Module_isSystem(CXModule Module); + +/** + * \param Module a module object. + * + * \returns the number of top level headers associated with this module. + */ +CINDEX_LINKAGE unsigned clang_Module_getNumTopLevelHeaders(CXTranslationUnit, + CXModule Module); + +/** + * \param Module a module object. + * + * \param Index top level header index (zero-based). + * + * \returns the specified top level header associated with the module. + */ +CINDEX_LINKAGE +CXFile clang_Module_getTopLevelHeader(CXTranslationUnit, + CXModule Module, unsigned Index); + +/** + * @} + */ + +/** + * \defgroup CINDEX_CPP C++ AST introspection + * + * The routines in this group provide access information in the ASTs specific + * to C++ language features. + * + * @{ + */ + +/** + * Determine if a C++ constructor is a converting constructor. + */ +CINDEX_LINKAGE unsigned clang_CXXConstructor_isConvertingConstructor(CXCursor C); + +/** + * Determine if a C++ constructor is a copy constructor. + */ +CINDEX_LINKAGE unsigned clang_CXXConstructor_isCopyConstructor(CXCursor C); + +/** + * Determine if a C++ constructor is the default constructor. + */ +CINDEX_LINKAGE unsigned clang_CXXConstructor_isDefaultConstructor(CXCursor C); + +/** + * Determine if a C++ constructor is a move constructor. + */ +CINDEX_LINKAGE unsigned clang_CXXConstructor_isMoveConstructor(CXCursor C); + +/** + * Determine if a C++ field is declared 'mutable'. + */ +CINDEX_LINKAGE unsigned clang_CXXField_isMutable(CXCursor C); + +/** + * Determine if a C++ method is declared '= default'. + */ +CINDEX_LINKAGE unsigned clang_CXXMethod_isDefaulted(CXCursor C); + +/** + * Determine if a C++ member function or member function template is + * pure virtual. + */ +CINDEX_LINKAGE unsigned clang_CXXMethod_isPureVirtual(CXCursor C); + +/** + * Determine if a C++ member function or member function template is + * declared 'static'. + */ +CINDEX_LINKAGE unsigned clang_CXXMethod_isStatic(CXCursor C); + +/** + * 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. + */ +CINDEX_LINKAGE unsigned clang_CXXMethod_isVirtual(CXCursor C); + +/** + * Determine if a C++ record is abstract, i.e. whether a class or struct + * has a pure virtual member function. + */ +CINDEX_LINKAGE unsigned clang_CXXRecord_isAbstract(CXCursor C); + +/** + * Determine if an enum declaration refers to a scoped enum. + */ +CINDEX_LINKAGE unsigned clang_EnumDecl_isScoped(CXCursor C); + +/** + * Determine if a C++ member function or member function template is + * declared 'const'. + */ +CINDEX_LINKAGE unsigned clang_CXXMethod_isConst(CXCursor C); + +/** + * 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. + */ +CINDEX_LINKAGE enum CXCursorKind clang_getTemplateCursorKind(CXCursor C); + +/** + * 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. + */ +CINDEX_LINKAGE CXCursor clang_getSpecializedCursorTemplate(CXCursor C); + +/** + * 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. + */ +CINDEX_LINKAGE CXSourceRange clang_getCursorReferenceNameRange(CXCursor C, + unsigned NameFlags, + unsigned PieceIndex); + +enum CXNameRefFlags { + /** + * Include the nested-name-specifier, e.g. Foo:: in x.Foo::y, in the + * range. + */ + CXNameRange_WantQualifier = 0x1, + + /** + * Include the explicit template arguments, e.g. \ in x.f, + * in the range. + */ + CXNameRange_WantTemplateArgs = 0x2, + + /** + * If the name is non-contiguous, return the full spanning range. + * + * Non-contiguous names occur in Objective-C when a selector with two or more + * parameters is used, or in C++ when using an operator: + * \code + * [object doSomething:here withValue:there]; // Objective-C + * return some_vector[1]; // C++ + * \endcode + */ + CXNameRange_WantSinglePiece = 0x4 +}; + +/** + * @} + */ + +/** + * \defgroup CINDEX_LEX Token extraction and manipulation + * + * The routines in this group provide access to the tokens within a + * translation unit, along with a semantic mapping of those tokens to + * their corresponding cursors. + * + * @{ + */ + +/** + * Describes a kind of token. + */ +typedef enum CXTokenKind { + /** + * A token that contains some kind of punctuation. + */ + CXToken_Punctuation, + + /** + * A language keyword. + */ + CXToken_Keyword, + + /** + * An identifier (that is not a keyword). + */ + CXToken_Identifier, + + /** + * A numeric, string, or character literal. + */ + CXToken_Literal, + + /** + * A comment. + */ + CXToken_Comment +} CXTokenKind; + +/** + * Describes a single preprocessing token. + */ +typedef struct { + unsigned int_data[4]; + void *ptr_data; +} CXToken; + +/** + * 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. + */ +CINDEX_LINKAGE CXToken *clang_getToken(CXTranslationUnit TU, + CXSourceLocation Location); + +/** + * Determine the kind of the given token. + */ +CINDEX_LINKAGE CXTokenKind clang_getTokenKind(CXToken); + +/** + * 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. + */ +CINDEX_LINKAGE CXString clang_getTokenSpelling(CXTranslationUnit, CXToken); + +/** + * Retrieve the source location of the given token. + */ +CINDEX_LINKAGE CXSourceLocation clang_getTokenLocation(CXTranslationUnit, + CXToken); + +/** + * Retrieve a source range that covers the given token. + */ +CINDEX_LINKAGE CXSourceRange clang_getTokenExtent(CXTranslationUnit, CXToken); + +/** + * 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. + * + */ +CINDEX_LINKAGE void clang_tokenize(CXTranslationUnit TU, CXSourceRange Range, + CXToken **Tokens, unsigned *NumTokens); + +/** + * 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. + */ +CINDEX_LINKAGE void clang_annotateTokens(CXTranslationUnit TU, + CXToken *Tokens, unsigned NumTokens, + CXCursor *Cursors); + +/** + * Free the given set of tokens. + */ +CINDEX_LINKAGE void clang_disposeTokens(CXTranslationUnit TU, + CXToken *Tokens, unsigned NumTokens); + +/** + * @} + */ + +/** + * \defgroup CINDEX_DEBUG Debugging facilities + * + * These routines are used for testing and debugging, only, and should not + * be relied upon. + * + * @{ + */ + +/* for debug/testing */ +CINDEX_LINKAGE CXString clang_getCursorKindSpelling(enum CXCursorKind Kind); +CINDEX_LINKAGE void clang_getDefinitionSpellingAndExtent(CXCursor, + const char **startBuf, + const char **endBuf, + unsigned *startLine, + unsigned *startColumn, + unsigned *endLine, + unsigned *endColumn); +CINDEX_LINKAGE void clang_enableStackTraces(void); +CINDEX_LINKAGE void clang_executeOnThread(void (*fn)(void*), void *user_data, + unsigned stack_size); + +/** + * @} + */ + +/** + * \defgroup CINDEX_CODE_COMPLET Code completion + * + * Code completion involves taking an (incomplete) source file, along with + * knowledge of where the user is actively editing that file, and suggesting + * syntactically- and semantically-valid constructs that the user might want to + * use at that particular point in the source code. These data structures and + * routines provide support for code completion. + * + * @{ + */ + +/** + * A semantic string that describes a code-completion result. + * + * A semantic string that describes the formatting of a code-completion + * result as a single "template" of text that should be inserted into the + * source buffer when a particular code-completion result is selected. + * Each semantic string is made up of some number of "chunks", each of which + * contains some text along with a description of what that text means, e.g., + * the name of the entity being referenced, whether the text chunk is part of + * the template, or whether it is a "placeholder" that the user should replace + * with actual code,of a specific kind. See \c CXCompletionChunkKind for a + * description of the different kinds of chunks. + */ +typedef void *CXCompletionString; + +/** + * A single result of code completion. + */ +typedef 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. + */ + enum CXCursorKind CursorKind; + + /** + * The code-completion string that describes how to insert this + * code-completion result into the editing buffer. + */ + CXCompletionString CompletionString; +} CXCompletionResult; + +/** + * Describes a single piece of text within a code-completion string. + * + * Each "chunk" within a code-completion string (\c CXCompletionString) is + * either a piece of text with a specific "kind" that describes how that text + * should be interpreted by the client or is another completion string. + */ +enum CXCompletionChunkKind { + /** + * A code-completion string that describes "optional" text that + * could be a part of the template (but is not required). + * + * The Optional chunk is the only kind of chunk that has a code-completion + * string for its representation, which is accessible via + * \c clang_getCompletionChunkCompletionString(). The code-completion string + * describes an additional part of the template that is completely optional. + * For example, optional chunks can be used to describe the placeholders for + * arguments that match up with defaulted function parameters, e.g. given: + * + * \code + * void f(int x, float y = 3.14, double z = 2.71828); + * \endcode + * + * The code-completion string for this function would contain: + * - a TypedText chunk for "f". + * - a LeftParen chunk for "(". + * - a Placeholder chunk for "int x" + * - an Optional chunk containing the remaining defaulted arguments, e.g., + * - a Comma chunk for "," + * - a Placeholder chunk for "float y" + * - an Optional chunk containing the last defaulted argument: + * - a Comma chunk for "," + * - a Placeholder chunk for "double z" + * - a RightParen chunk for ")" + * + * There are many ways to handle Optional chunks. Two simple approaches are: + * - Completely ignore optional chunks, in which case the template for the + * function "f" would only include the first parameter ("int x"). + * - Fully expand all optional chunks, in which case the template for the + * function "f" would have all of the parameters. + */ + CXCompletionChunk_Optional, + /** + * Text that a user would be expected to type to get this + * code-completion result. + * + * There will be exactly one "typed text" chunk in a semantic string, which + * will typically provide the spelling of a keyword or the name of a + * declaration that could be used at the current code point. Clients are + * expected to filter the code-completion results based on the text in this + * chunk. + */ + CXCompletionChunk_TypedText, + /** + * Text that should be inserted as part of a code-completion result. + * + * A "text" chunk represents text that is part of the template to be + * inserted into user code should this particular code-completion result + * be selected. + */ + CXCompletionChunk_Text, + /** + * Placeholder text that should be replaced by the user. + * + * A "placeholder" chunk marks a place where the user should insert text + * into the code-completion template. For example, placeholders might mark + * the function parameters for a function declaration, to indicate that the + * user should provide arguments for each of those parameters. The actual + * text in a placeholder is a suggestion for the text to display before + * the user replaces the placeholder with real code. + */ + CXCompletionChunk_Placeholder, + /** + * Informative text that should be displayed but never inserted as + * part of the template. + * + * An "informative" chunk contains annotations that can be displayed to + * help the user decide whether a particular code-completion result is the + * right option, but which is not part of the actual template to be inserted + * by code completion. + */ + CXCompletionChunk_Informative, + /** + * Text that describes the current parameter when code-completion is + * referring to function call, message send, or template specialization. + * + * A "current parameter" chunk occurs when code-completion is providing + * information about a parameter corresponding to the argument at the + * code-completion point. For example, given a function + * + * \code + * int add(int x, int y); + * \endcode + * + * and the source code \c add(, where the code-completion point is after the + * "(", the code-completion string will contain a "current parameter" chunk + * for "int x", indicating that the current argument will initialize that + * parameter. After typing further, to \c add(17, (where the code-completion + * point is after the ","), the code-completion string will contain a + * "current parameter" chunk to "int y". + */ + CXCompletionChunk_CurrentParameter, + /** + * A left parenthesis ('('), used to initiate a function call or + * signal the beginning of a function parameter list. + */ + CXCompletionChunk_LeftParen, + /** + * A right parenthesis (')'), used to finish a function call or + * signal the end of a function parameter list. + */ + CXCompletionChunk_RightParen, + /** + * A left bracket ('['). + */ + CXCompletionChunk_LeftBracket, + /** + * A right bracket (']'). + */ + CXCompletionChunk_RightBracket, + /** + * A left brace ('{'). + */ + CXCompletionChunk_LeftBrace, + /** + * A right brace ('}'). + */ + CXCompletionChunk_RightBrace, + /** + * A left angle bracket ('<'). + */ + CXCompletionChunk_LeftAngle, + /** + * A right angle bracket ('>'). + */ + CXCompletionChunk_RightAngle, + /** + * A comma separator (','). + */ + CXCompletionChunk_Comma, + /** + * Text that specifies the result type of a given result. + * + * This special kind of informative chunk is not meant to be inserted into + * the text buffer. Rather, it is meant to illustrate the type that an + * expression using the given completion string would have. + */ + CXCompletionChunk_ResultType, + /** + * A colon (':'). + */ + CXCompletionChunk_Colon, + /** + * A semicolon (';'). + */ + CXCompletionChunk_SemiColon, + /** + * An '=' sign. + */ + CXCompletionChunk_Equal, + /** + * Horizontal space (' '). + */ + CXCompletionChunk_HorizontalSpace, + /** + * Vertical space ('\\n'), after which it is generally a good idea to + * perform indentation. + */ + CXCompletionChunk_VerticalSpace +}; + +/** + * 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. + */ +CINDEX_LINKAGE enum CXCompletionChunkKind +clang_getCompletionChunkKind(CXCompletionString completion_string, + unsigned chunk_number); + +/** + * 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. + */ +CINDEX_LINKAGE CXString +clang_getCompletionChunkText(CXCompletionString completion_string, + unsigned chunk_number); + +/** + * 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. + */ +CINDEX_LINKAGE CXCompletionString +clang_getCompletionChunkCompletionString(CXCompletionString completion_string, + unsigned chunk_number); + +/** + * Retrieve the number of chunks in the given code-completion string. + */ +CINDEX_LINKAGE unsigned +clang_getNumCompletionChunks(CXCompletionString completion_string); + +/** + * 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. + */ +CINDEX_LINKAGE unsigned +clang_getCompletionPriority(CXCompletionString completion_string); + +/** + * 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. + */ +CINDEX_LINKAGE enum CXAvailabilityKind +clang_getCompletionAvailability(CXCompletionString completion_string); + +/** + * 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. + */ +CINDEX_LINKAGE unsigned +clang_getCompletionNumAnnotations(CXCompletionString completion_string); + +/** + * 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. + */ +CINDEX_LINKAGE CXString +clang_getCompletionAnnotation(CXCompletionString completion_string, + unsigned annotation_number); + +/** + * 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. + */ +CINDEX_LINKAGE CXString +clang_getCompletionParent(CXCompletionString completion_string, + enum CXCursorKind *kind); + +/** + * Retrieve the brief documentation comment attached to the declaration + * that corresponds to the given completion string. + */ +CINDEX_LINKAGE CXString +clang_getCompletionBriefComment(CXCompletionString completion_string); + +/** + * 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. + */ +CINDEX_LINKAGE CXCompletionString +clang_getCursorCompletionString(CXCursor cursor); + +/** + * 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. + */ +typedef struct { + /** + * The code-completion results. + */ + CXCompletionResult *Results; + + /** + * The number of code-completion results stored in the + * \c Results array. + */ + unsigned NumResults; +} CXCodeCompleteResults; + +/** + * 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 + */ +CINDEX_LINKAGE unsigned +clang_getCompletionNumFixIts(CXCodeCompleteResults *results, + unsigned completion_index); + +/** + * 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 + */ +CINDEX_LINKAGE CXString clang_getCompletionFixIt( + CXCodeCompleteResults *results, unsigned completion_index, + unsigned fixit_index, CXSourceRange *replacement_range); + +/** + * Flags that can be passed to \c clang_codeCompleteAt() to + * modify its behavior. + * + * The enumerators in this enumeration can be bitwise-OR'd together to + * provide multiple options to \c clang_codeCompleteAt(). + */ +enum CXCodeComplete_Flags { + /** + * Whether to include macros within the set of code + * completions returned. + */ + CXCodeComplete_IncludeMacros = 0x01, + + /** + * Whether to include code patterns for language constructs + * within the set of code completions, e.g., for loops. + */ + CXCodeComplete_IncludeCodePatterns = 0x02, + + /** + * Whether to include brief documentation within the set of code + * completions returned. + */ + CXCodeComplete_IncludeBriefComments = 0x04, + + /** + * 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. + */ + CXCodeComplete_SkipPreamble = 0x08, + + /** + * Whether to include completions with small + * fix-its, e.g. change '.' to '->' on member access, etc. + */ + CXCodeComplete_IncludeCompletionsWithFixIts = 0x10 +}; + +/** + * Bits that represent the context under which completion is occurring. + * + * The enumerators in this enumeration may be bitwise-OR'd together if multiple + * contexts are occurring simultaneously. + */ +enum CXCompletionContext { + /** + * The context for completions is unexposed, as only Clang results + * should be included. (This is equivalent to having no context bits set.) + */ + CXCompletionContext_Unexposed = 0, + + /** + * Completions for any possible type should be included in the results. + */ + CXCompletionContext_AnyType = 1 << 0, + + /** + * Completions for any possible value (variables, function calls, etc.) + * should be included in the results. + */ + CXCompletionContext_AnyValue = 1 << 1, + /** + * Completions for values that resolve to an Objective-C object should + * be included in the results. + */ + CXCompletionContext_ObjCObjectValue = 1 << 2, + /** + * Completions for values that resolve to an Objective-C selector + * should be included in the results. + */ + CXCompletionContext_ObjCSelectorValue = 1 << 3, + /** + * Completions for values that resolve to a C++ class type should be + * included in the results. + */ + CXCompletionContext_CXXClassTypeValue = 1 << 4, + + /** + * Completions for fields of the member being accessed using the dot + * operator should be included in the results. + */ + CXCompletionContext_DotMemberAccess = 1 << 5, + /** + * Completions for fields of the member being accessed using the arrow + * operator should be included in the results. + */ + CXCompletionContext_ArrowMemberAccess = 1 << 6, + /** + * Completions for properties of the Objective-C object being accessed + * using the dot operator should be included in the results. + */ + CXCompletionContext_ObjCPropertyAccess = 1 << 7, + + /** + * Completions for enum tags should be included in the results. + */ + CXCompletionContext_EnumTag = 1 << 8, + /** + * Completions for union tags should be included in the results. + */ + CXCompletionContext_UnionTag = 1 << 9, + /** + * Completions for struct tags should be included in the results. + */ + CXCompletionContext_StructTag = 1 << 10, + + /** + * Completions for C++ class names should be included in the results. + */ + CXCompletionContext_ClassTag = 1 << 11, + /** + * Completions for C++ namespaces and namespace aliases should be + * included in the results. + */ + CXCompletionContext_Namespace = 1 << 12, + /** + * Completions for C++ nested name specifiers should be included in + * the results. + */ + CXCompletionContext_NestedNameSpecifier = 1 << 13, + + /** + * Completions for Objective-C interfaces (classes) should be included + * in the results. + */ + CXCompletionContext_ObjCInterface = 1 << 14, + /** + * Completions for Objective-C protocols should be included in + * the results. + */ + CXCompletionContext_ObjCProtocol = 1 << 15, + /** + * Completions for Objective-C categories should be included in + * the results. + */ + CXCompletionContext_ObjCCategory = 1 << 16, + /** + * Completions for Objective-C instance messages should be included + * in the results. + */ + CXCompletionContext_ObjCInstanceMessage = 1 << 17, + /** + * Completions for Objective-C class messages should be included in + * the results. + */ + CXCompletionContext_ObjCClassMessage = 1 << 18, + /** + * Completions for Objective-C selector names should be included in + * the results. + */ + CXCompletionContext_ObjCSelectorName = 1 << 19, + + /** + * Completions for preprocessor macro names should be included in + * the results. + */ + CXCompletionContext_MacroName = 1 << 20, + + /** + * Natural language completions should be included in the results. + */ + CXCompletionContext_NaturalLanguage = 1 << 21, + + /** + * #include file completions should be included in the results. + */ + CXCompletionContext_IncludedFile = 1 << 22, + + /** + * The current context is unknown, so set all contexts. + */ + CXCompletionContext_Unknown = ((1 << 23) - 1) +}; + +/** + * Returns a default set of code-completion options that can be + * passed to\c clang_codeCompleteAt(). + */ +CINDEX_LINKAGE unsigned clang_defaultCodeCompleteOptions(void); + +/** + * 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. + */ +CINDEX_LINKAGE +CXCodeCompleteResults *clang_codeCompleteAt(CXTranslationUnit TU, + const char *complete_filename, + unsigned complete_line, + unsigned complete_column, + struct CXUnsavedFile *unsaved_files, + unsigned num_unsaved_files, + unsigned options); + +/** + * 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. + */ +CINDEX_LINKAGE +void clang_sortCodeCompletionResults(CXCompletionResult *Results, + unsigned NumResults); + +/** + * Free the given set of code-completion results. + */ +CINDEX_LINKAGE +void clang_disposeCodeCompleteResults(CXCodeCompleteResults *Results); + +/** + * Determine the number of diagnostics produced prior to the + * location where code completion was performed. + */ +CINDEX_LINKAGE +unsigned clang_codeCompleteGetNumDiagnostics(CXCodeCompleteResults *Results); + +/** + * 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(). + */ +CINDEX_LINKAGE +CXDiagnostic clang_codeCompleteGetDiagnostic(CXCodeCompleteResults *Results, + unsigned Index); + +/** + * 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. + */ +CINDEX_LINKAGE +unsigned long long clang_codeCompleteGetContexts( + CXCodeCompleteResults *Results); + +/** + * 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 + */ +CINDEX_LINKAGE +enum CXCursorKind clang_codeCompleteGetContainerKind( + CXCodeCompleteResults *Results, + unsigned *IsIncomplete); + +/** + * 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 + */ +CINDEX_LINKAGE +CXString clang_codeCompleteGetContainerUSR(CXCodeCompleteResults *Results); + +/** + * 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. + */ +CINDEX_LINKAGE +CXString clang_codeCompleteGetObjCSelector(CXCodeCompleteResults *Results); + +/** + * @} + */ + +/** + * \defgroup CINDEX_MISC Miscellaneous utility functions + * + * @{ + */ + +/** + * Return a version string, suitable for showing to a user, but not + * intended to be parsed (the format is not guaranteed to be stable). + */ +CINDEX_LINKAGE CXString clang_getClangVersion(void); + +/** + * 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. + */ +CINDEX_LINKAGE void clang_toggleCrashRecovery(unsigned isEnabled); + + /** + * Visitor invoked for each file in a translation unit + * (used with clang_getInclusions()). + * + * This visitor function will be invoked by clang_getInclusions() for each + * file included (either at the top-level or by \#include directives) within + * a translation unit. The first argument is the file being included, and + * the second and third arguments provide the inclusion stack. The + * array is sorted in order of immediate inclusion. For example, + * the first element refers to the location that included 'included_file'. + */ +typedef void (*CXInclusionVisitor)(CXFile included_file, + CXSourceLocation* inclusion_stack, + unsigned include_len, + CXClientData client_data); + +/** + * 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). + */ +CINDEX_LINKAGE void clang_getInclusions(CXTranslationUnit tu, + CXInclusionVisitor visitor, + CXClientData client_data); + +typedef enum { + CXEval_Int = 1 , + CXEval_Float = 2, + CXEval_ObjCStrLiteral = 3, + CXEval_StrLiteral = 4, + CXEval_CFStr = 5, + CXEval_Other = 6, + + CXEval_UnExposed = 0 + +} CXEvalResultKind ; + +/** + * Evaluation result of a cursor + */ +typedef void * CXEvalResult; + +/** + * If cursor is a statement declaration tries to evaluate the + * statement and if its variable, tries to evaluate its initializer, + * into its corresponding type. + */ +CINDEX_LINKAGE CXEvalResult clang_Cursor_Evaluate(CXCursor C); + +/** + * Returns the kind of the evaluated result. + */ +CINDEX_LINKAGE CXEvalResultKind clang_EvalResult_getKind(CXEvalResult E); + +/** + * Returns the evaluation result as integer if the + * kind is Int. + */ +CINDEX_LINKAGE int clang_EvalResult_getAsInt(CXEvalResult E); + +/** + * 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. + */ +CINDEX_LINKAGE long long clang_EvalResult_getAsLongLong(CXEvalResult E); + +/** + * Returns a non-zero value if the kind is Int and the evaluation + * result resulted in an unsigned integer. + */ +CINDEX_LINKAGE unsigned clang_EvalResult_isUnsignedInt(CXEvalResult E); + +/** + * Returns the evaluation result as an unsigned integer if + * the kind is Int and clang_EvalResult_isUnsignedInt is non-zero. + */ +CINDEX_LINKAGE unsigned long long clang_EvalResult_getAsUnsigned(CXEvalResult E); + +/** + * Returns the evaluation result as double if the + * kind is double. + */ +CINDEX_LINKAGE double clang_EvalResult_getAsDouble(CXEvalResult E); + +/** + * 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. + */ +CINDEX_LINKAGE const char* clang_EvalResult_getAsStr(CXEvalResult E); + +/** + * Disposes the created Eval memory. + */ +CINDEX_LINKAGE void clang_EvalResult_dispose(CXEvalResult E); +/** + * @} + */ + +/** \defgroup CINDEX_REMAPPING Remapping functions + * + * @{ + */ + +/** + * A remapping of original source files and their translated files. + */ +typedef void *CXRemapping; + +/** + * 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. + */ +CINDEX_LINKAGE CXRemapping clang_getRemappings(const char *path); + +/** + * 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. + */ +CINDEX_LINKAGE +CXRemapping clang_getRemappingsFromFileList(const char **filePaths, + unsigned numFiles); + +/** + * Determine the number of remappings. + */ +CINDEX_LINKAGE unsigned clang_remap_getNumFiles(CXRemapping); + +/** + * 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. + */ +CINDEX_LINKAGE void clang_remap_getFilenames(CXRemapping, unsigned index, + CXString *original, CXString *transformed); + +/** + * Dispose the remapping. + */ +CINDEX_LINKAGE void clang_remap_dispose(CXRemapping); + +/** + * @} + */ + +/** \defgroup CINDEX_HIGH Higher level API functions + * + * @{ + */ + +enum CXVisitorResult { + CXVisit_Break, + CXVisit_Continue +}; + +typedef struct CXCursorAndRangeVisitor { + void *context; + enum CXVisitorResult (*visit)(void *context, CXCursor, CXSourceRange); +} CXCursorAndRangeVisitor; + +typedef enum { + /** + * Function returned successfully. + */ + CXResult_Success = 0, + /** + * One of the parameters was invalid for the function. + */ + CXResult_Invalid = 1, + /** + * The function was terminated by a callback (e.g. it returned + * CXVisit_Break) + */ + CXResult_VisitBreak = 2 + +} CXResult; + +/** + * 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. + */ +CINDEX_LINKAGE CXResult clang_findReferencesInFile(CXCursor cursor, CXFile file, + CXCursorAndRangeVisitor visitor); + +/** + * 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. + */ +CINDEX_LINKAGE CXResult clang_findIncludesInFile(CXTranslationUnit TU, + CXFile file, + CXCursorAndRangeVisitor visitor); + +#ifdef __has_feature +# if __has_feature(blocks) + +typedef enum CXVisitorResult + (^CXCursorAndRangeVisitorBlock)(CXCursor, CXSourceRange); + +CINDEX_LINKAGE +CXResult clang_findReferencesInFileWithBlock(CXCursor, CXFile, + CXCursorAndRangeVisitorBlock); + +CINDEX_LINKAGE +CXResult clang_findIncludesInFileWithBlock(CXTranslationUnit, CXFile, + CXCursorAndRangeVisitorBlock); + +# endif +#endif + +/** + * The client's data object that is associated with a CXFile. + */ +typedef void *CXIdxClientFile; + +/** + * The client's data object that is associated with a semantic entity. + */ +typedef void *CXIdxClientEntity; + +/** + * The client's data object that is associated with a semantic container + * of entities. + */ +typedef void *CXIdxClientContainer; + +/** + * The client's data object that is associated with an AST file (PCH + * or module). + */ +typedef void *CXIdxClientASTFile; + +/** + * Source location passed to index callbacks. + */ +typedef struct { + void *ptr_data[2]; + unsigned int_data; +} CXIdxLoc; + +/** + * Data for ppIncludedFile callback. + */ +typedef struct { + /** + * Location of '#' in the \#include/\#import directive. + */ + CXIdxLoc hashLoc; + /** + * Filename as written in the \#include/\#import directive. + */ + const char *filename; + /** + * The actual file that the \#include/\#import directive resolved to. + */ + CXFile file; + int isImport; + int isAngled; + /** + * Non-zero if the directive was automatically turned into a module + * import. + */ + int isModuleImport; +} CXIdxIncludedFileInfo; + +/** + * Data for IndexerCallbacks#importedASTFile. + */ +typedef struct { + /** + * Top level AST file containing the imported PCH, module or submodule. + */ + CXFile file; + /** + * The imported module or NULL if the AST file is a PCH. + */ + CXModule module; + /** + * Location where the file is imported. Applicable only for modules. + */ + CXIdxLoc loc; + /** + * Non-zero if an inclusion directive was automatically turned into + * a module import. Applicable only for modules. + */ + int isImplicit; + +} CXIdxImportedASTFileInfo; + +typedef enum { + CXIdxEntity_Unexposed = 0, + CXIdxEntity_Typedef = 1, + CXIdxEntity_Function = 2, + CXIdxEntity_Variable = 3, + CXIdxEntity_Field = 4, + CXIdxEntity_EnumConstant = 5, + + CXIdxEntity_ObjCClass = 6, + CXIdxEntity_ObjCProtocol = 7, + CXIdxEntity_ObjCCategory = 8, + + CXIdxEntity_ObjCInstanceMethod = 9, + CXIdxEntity_ObjCClassMethod = 10, + CXIdxEntity_ObjCProperty = 11, + CXIdxEntity_ObjCIvar = 12, + + CXIdxEntity_Enum = 13, + CXIdxEntity_Struct = 14, + CXIdxEntity_Union = 15, + + CXIdxEntity_CXXClass = 16, + CXIdxEntity_CXXNamespace = 17, + CXIdxEntity_CXXNamespaceAlias = 18, + CXIdxEntity_CXXStaticVariable = 19, + CXIdxEntity_CXXStaticMethod = 20, + CXIdxEntity_CXXInstanceMethod = 21, + CXIdxEntity_CXXConstructor = 22, + CXIdxEntity_CXXDestructor = 23, + CXIdxEntity_CXXConversionFunction = 24, + CXIdxEntity_CXXTypeAlias = 25, + CXIdxEntity_CXXInterface = 26 + +} CXIdxEntityKind; + +typedef enum { + CXIdxEntityLang_None = 0, + CXIdxEntityLang_C = 1, + CXIdxEntityLang_ObjC = 2, + CXIdxEntityLang_CXX = 3, + CXIdxEntityLang_Swift = 4 +} CXIdxEntityLanguage; + +/** + * 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 + */ +typedef enum { + CXIdxEntity_NonTemplate = 0, + CXIdxEntity_Template = 1, + CXIdxEntity_TemplatePartialSpecialization = 2, + CXIdxEntity_TemplateSpecialization = 3 +} CXIdxEntityCXXTemplateKind; + +typedef enum { + CXIdxAttr_Unexposed = 0, + CXIdxAttr_IBAction = 1, + CXIdxAttr_IBOutlet = 2, + CXIdxAttr_IBOutletCollection = 3 +} CXIdxAttrKind; + +typedef struct { + CXIdxAttrKind kind; + CXCursor cursor; + CXIdxLoc loc; +} CXIdxAttrInfo; + +typedef struct { + CXIdxEntityKind kind; + CXIdxEntityCXXTemplateKind templateKind; + CXIdxEntityLanguage lang; + const char *name; + const char *USR; + CXCursor cursor; + const CXIdxAttrInfo *const *attributes; + unsigned numAttributes; +} CXIdxEntityInfo; + +typedef struct { + CXCursor cursor; +} CXIdxContainerInfo; + +typedef struct { + const CXIdxAttrInfo *attrInfo; + const CXIdxEntityInfo *objcClass; + CXCursor classCursor; + CXIdxLoc classLoc; +} CXIdxIBOutletCollectionAttrInfo; + +typedef enum { + CXIdxDeclFlag_Skipped = 0x1 +} CXIdxDeclInfoFlags; + +typedef struct { + const CXIdxEntityInfo *entityInfo; + CXCursor cursor; + CXIdxLoc loc; + const CXIdxContainerInfo *semanticContainer; + /** + * Generally same as #semanticContainer but can be different in + * cases like out-of-line C++ member functions. + */ + const CXIdxContainerInfo *lexicalContainer; + int isRedeclaration; + int isDefinition; + int isContainer; + const CXIdxContainerInfo *declAsContainer; + /** + * Whether the declaration exists in code or was created implicitly + * by the compiler, e.g. implicit Objective-C methods for properties. + */ + int isImplicit; + const CXIdxAttrInfo *const *attributes; + unsigned numAttributes; + + unsigned flags; + +} CXIdxDeclInfo; + +typedef enum { + CXIdxObjCContainer_ForwardRef = 0, + CXIdxObjCContainer_Interface = 1, + CXIdxObjCContainer_Implementation = 2 +} CXIdxObjCContainerKind; + +typedef struct { + const CXIdxDeclInfo *declInfo; + CXIdxObjCContainerKind kind; +} CXIdxObjCContainerDeclInfo; + +typedef struct { + const CXIdxEntityInfo *base; + CXCursor cursor; + CXIdxLoc loc; +} CXIdxBaseClassInfo; + +typedef struct { + const CXIdxEntityInfo *protocol; + CXCursor cursor; + CXIdxLoc loc; +} CXIdxObjCProtocolRefInfo; + +typedef struct { + const CXIdxObjCProtocolRefInfo *const *protocols; + unsigned numProtocols; +} CXIdxObjCProtocolRefListInfo; + +typedef struct { + const CXIdxObjCContainerDeclInfo *containerInfo; + const CXIdxBaseClassInfo *superInfo; + const CXIdxObjCProtocolRefListInfo *protocols; +} CXIdxObjCInterfaceDeclInfo; + +typedef struct { + const CXIdxObjCContainerDeclInfo *containerInfo; + const CXIdxEntityInfo *objcClass; + CXCursor classCursor; + CXIdxLoc classLoc; + const CXIdxObjCProtocolRefListInfo *protocols; +} CXIdxObjCCategoryDeclInfo; + +typedef struct { + const CXIdxDeclInfo *declInfo; + const CXIdxEntityInfo *getter; + const CXIdxEntityInfo *setter; +} CXIdxObjCPropertyDeclInfo; + +typedef struct { + const CXIdxDeclInfo *declInfo; + const CXIdxBaseClassInfo *const *bases; + unsigned numBases; +} CXIdxCXXClassDeclInfo; + +/** + * Data for IndexerCallbacks#indexEntityReference. + * + * This may be deprecated in a future version as this duplicates + * the \c CXSymbolRole_Implicit bit in \c CXSymbolRole. + */ +typedef enum { + /** + * The entity is referenced directly in user's code. + */ + CXIdxEntityRef_Direct = 1, + /** + * An implicit reference, e.g. a reference of an Objective-C method + * via the dot syntax. + */ + CXIdxEntityRef_Implicit = 2 +} CXIdxEntityRefKind; + +/** + * Roles that are attributed to symbol occurrences. + * + * Internal: this currently mirrors low 9 bits of clang::index::SymbolRole with + * higher bits zeroed. These high bits may be exposed in the future. + */ +typedef enum { + CXSymbolRole_None = 0, + CXSymbolRole_Declaration = 1 << 0, + CXSymbolRole_Definition = 1 << 1, + CXSymbolRole_Reference = 1 << 2, + CXSymbolRole_Read = 1 << 3, + CXSymbolRole_Write = 1 << 4, + CXSymbolRole_Call = 1 << 5, + CXSymbolRole_Dynamic = 1 << 6, + CXSymbolRole_AddressOf = 1 << 7, + CXSymbolRole_Implicit = 1 << 8 +} CXSymbolRole; + +/** + * Data for IndexerCallbacks#indexEntityReference. + */ +typedef struct { + CXIdxEntityRefKind kind; + /** + * Reference cursor. + */ + CXCursor cursor; + CXIdxLoc loc; + /** + * The entity that gets referenced. + */ + const CXIdxEntityInfo *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. + */ + const CXIdxEntityInfo *parentEntity; + /** + * Lexical container context of the reference. + */ + const CXIdxContainerInfo *container; + /** + * Sets of symbol roles of the reference. + */ + CXSymbolRole role; +} CXIdxEntityRefInfo; + +/** + * A group of callbacks used by #clang_indexSourceFile and + * #clang_indexTranslationUnit. + */ +typedef struct { + /** + * Called periodically to check whether indexing should be aborted. + * Should return 0 to continue, and non-zero to abort. + */ + int (*abortQuery)(CXClientData client_data, void *reserved); + + /** + * Called at the end of indexing; passes the complete diagnostic set. + */ + void (*diagnostic)(CXClientData client_data, + CXDiagnosticSet, void *reserved); + + CXIdxClientFile (*enteredMainFile)(CXClientData client_data, + CXFile mainFile, void *reserved); + + /** + * Called when a file gets \#included/\#imported. + */ + CXIdxClientFile (*ppIncludedFile)(CXClientData client_data, + const CXIdxIncludedFileInfo *); + + /** + * 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. + */ + CXIdxClientASTFile (*importedASTFile)(CXClientData client_data, + const CXIdxImportedASTFileInfo *); + + /** + * Called at the beginning of indexing a translation unit. + */ + CXIdxClientContainer (*startedTranslationUnit)(CXClientData client_data, + void *reserved); + + void (*indexDeclaration)(CXClientData client_data, + const CXIdxDeclInfo *); + + /** + * Called to index a reference of an entity. + */ + void (*indexEntityReference)(CXClientData client_data, + const CXIdxEntityRefInfo *); + +} IndexerCallbacks; + +CINDEX_LINKAGE int clang_index_isEntityObjCContainerKind(CXIdxEntityKind); +CINDEX_LINKAGE const CXIdxObjCContainerDeclInfo * +clang_index_getObjCContainerDeclInfo(const CXIdxDeclInfo *); + +CINDEX_LINKAGE const CXIdxObjCInterfaceDeclInfo * +clang_index_getObjCInterfaceDeclInfo(const CXIdxDeclInfo *); + +CINDEX_LINKAGE +const CXIdxObjCCategoryDeclInfo * +clang_index_getObjCCategoryDeclInfo(const CXIdxDeclInfo *); + +CINDEX_LINKAGE const CXIdxObjCProtocolRefListInfo * +clang_index_getObjCProtocolRefListInfo(const CXIdxDeclInfo *); + +CINDEX_LINKAGE const CXIdxObjCPropertyDeclInfo * +clang_index_getObjCPropertyDeclInfo(const CXIdxDeclInfo *); + +CINDEX_LINKAGE const CXIdxIBOutletCollectionAttrInfo * +clang_index_getIBOutletCollectionAttrInfo(const CXIdxAttrInfo *); + +CINDEX_LINKAGE const CXIdxCXXClassDeclInfo * +clang_index_getCXXClassDeclInfo(const CXIdxDeclInfo *); + +/** + * For retrieving a custom CXIdxClientContainer attached to a + * container. + */ +CINDEX_LINKAGE CXIdxClientContainer +clang_index_getClientContainer(const CXIdxContainerInfo *); + +/** + * For setting a custom CXIdxClientContainer attached to a + * container. + */ +CINDEX_LINKAGE void +clang_index_setClientContainer(const CXIdxContainerInfo *,CXIdxClientContainer); + +/** + * For retrieving a custom CXIdxClientEntity attached to an entity. + */ +CINDEX_LINKAGE CXIdxClientEntity +clang_index_getClientEntity(const CXIdxEntityInfo *); + +/** + * For setting a custom CXIdxClientEntity attached to an entity. + */ +CINDEX_LINKAGE void +clang_index_setClientEntity(const CXIdxEntityInfo *, CXIdxClientEntity); + +/** + * An indexing action/session, to be applied to one or multiple + * translation units. + */ +typedef void *CXIndexAction; + +/** + * 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. + */ +CINDEX_LINKAGE CXIndexAction clang_IndexAction_create(CXIndex CIdx); + +/** + * 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. + */ +CINDEX_LINKAGE void clang_IndexAction_dispose(CXIndexAction); + +typedef enum { + /** + * Used to indicate that no special indexing options are needed. + */ + CXIndexOpt_None = 0x0, + + /** + * 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. + */ + CXIndexOpt_SuppressRedundantRefs = 0x1, + + /** + * Function-local symbols should be indexed. If this is not set + * function-local symbols will be ignored. + */ + CXIndexOpt_IndexFunctionLocalSymbols = 0x2, + + /** + * Implicit function/class template instantiations should be indexed. + * If this is not set, implicit instantiations will be ignored. + */ + CXIndexOpt_IndexImplicitTemplateInstantiations = 0x4, + + /** + * Suppress all compiler warnings when parsing for indexing. + */ + CXIndexOpt_SuppressWarnings = 0x8, + + /** + * Skip a function/method body that was already parsed during an + * indexing session associated with a \c CXIndexAction object. + * Bodies in system headers are always skipped. + */ + CXIndexOpt_SkipParsedBodiesInSession = 0x10 + +} CXIndexOptFlags; + +/** + * 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. + */ +CINDEX_LINKAGE int clang_indexSourceFile(CXIndexAction, + CXClientData client_data, + IndexerCallbacks *index_callbacks, + unsigned index_callbacks_size, + unsigned index_options, + const char *source_filename, + const char * const *command_line_args, + int num_command_line_args, + struct CXUnsavedFile *unsaved_files, + unsigned num_unsaved_files, + CXTranslationUnit *out_TU, + unsigned TU_options); + +/** + * 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. + */ +CINDEX_LINKAGE int clang_indexSourceFileFullArgv( + CXIndexAction, CXClientData client_data, IndexerCallbacks *index_callbacks, + unsigned index_callbacks_size, unsigned index_options, + const char *source_filename, const char *const *command_line_args, + int num_command_line_args, struct CXUnsavedFile *unsaved_files, + unsigned num_unsaved_files, CXTranslationUnit *out_TU, unsigned TU_options); + +/** + * 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. + */ +CINDEX_LINKAGE int clang_indexTranslationUnit(CXIndexAction, + CXClientData client_data, + IndexerCallbacks *index_callbacks, + unsigned index_callbacks_size, + unsigned index_options, + CXTranslationUnit); + +/** + * 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. + */ +CINDEX_LINKAGE void clang_indexLoc_getFileLocation(CXIdxLoc loc, + CXIdxClientFile *indexFile, + CXFile *file, + unsigned *line, + unsigned *column, + unsigned *offset); + +/** + * Retrieve the CXSourceLocation represented by the given CXIdxLoc. + */ +CINDEX_LINKAGE +CXSourceLocation clang_indexLoc_getCXSourceLocation(CXIdxLoc loc); + +/** + * Visitor invoked for each field found by a traversal. + * + * This visitor function will be invoked for each field found by + * \c clang_Type_visitFields. Its first argument is the cursor being + * visited, its second argument is the client data provided to + * \c clang_Type_visitFields. + * + * The visitor should return one of the \c CXVisitorResult values + * to direct \c clang_Type_visitFields. + */ +typedef enum CXVisitorResult (*CXFieldVisitor)(CXCursor C, + CXClientData client_data); + +/** + * 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. + */ +CINDEX_LINKAGE unsigned clang_Type_visitFields(CXType T, + CXFieldVisitor visitor, + CXClientData client_data); + +/** + * @} + */ + +/** + * @} + */ + +LLVM_CLANG_C_EXTERN_C_END + +#endif diff --git a/pkgs/ffigen/third_party/libclang/include/clang-c/Platform.h b/pkgs/ffigen/third_party/libclang/include/clang-c/Platform.h new file mode 100644 index 0000000000..3bb66bb0df --- /dev/null +++ b/pkgs/ffigen/third_party/libclang/include/clang-c/Platform.h @@ -0,0 +1,44 @@ +/*===-- clang-c/Platform.h - C Index platform decls -------------*- C -*-===*\ +|* *| +|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *| +|* Exceptions. *| +|* See https://llvm.org/LICENSE.txt for license information. *| +|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *| +|* *| +|*===----------------------------------------------------------------------===*| +|* *| +|* This header provides platform specific macros (dllimport, deprecated, ...) *| +|* *| +\*===----------------------------------------------------------------------===*/ + +#ifndef LLVM_CLANG_C_PLATFORM_H +#define LLVM_CLANG_C_PLATFORM_H + +#include "clang-c/ExternC.h" + +LLVM_CLANG_C_EXTERN_C_BEGIN + +/* MSVC DLL import/export. */ +#ifdef _MSC_VER + #ifdef _CINDEX_LIB_ + #define CINDEX_LINKAGE __declspec(dllexport) + #else + #define CINDEX_LINKAGE __declspec(dllimport) + #endif +#else + #define CINDEX_LINKAGE +#endif + +#ifdef __GNUC__ + #define CINDEX_DEPRECATED __attribute__((deprecated)) +#else + #ifdef _MSC_VER + #define CINDEX_DEPRECATED __declspec(deprecated) + #else + #define CINDEX_DEPRECATED + #endif +#endif + +LLVM_CLANG_C_EXTERN_C_END + +#endif diff --git a/pkgs/ffigen/third_party/sqlite/sqlite3.h b/pkgs/ffigen/third_party/sqlite/sqlite3.h new file mode 100644 index 0000000000..f34a7b5f2c --- /dev/null +++ b/pkgs/ffigen/third_party/sqlite/sqlite3.h @@ -0,0 +1,12168 @@ +/* +** 2001-09-15 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** This header file defines the interface that the SQLite library +** presents to client programs. If a C-function, structure, datatype, +** or constant definition does not appear in this file, then it is +** not a published API of SQLite, is subject to change without +** notice, and should not be referenced by programs that use SQLite. +** +** Some of the definitions that are in this file are marked as +** "experimental". Experimental interfaces are normally new +** features recently added to SQLite. We do not anticipate changes +** to experimental interfaces but reserve the right to make minor changes +** if experience from use "in the wild" suggest such changes are prudent. +** +** The official C-language API documentation for SQLite is derived +** from comments in this file. This file is the authoritative source +** on how SQLite interfaces are supposed to operate. +** +** The name of this file under configuration management is "sqlite.h.in". +** The makefile makes some minor changes to this file (such as inserting +** the version number) and changes its name to "sqlite3.h" as +** part of the build process. +*/ +#ifndef SQLITE3_H +#define SQLITE3_H +#include /* Needed for the definition of va_list */ + +/* +** Make sure we can call this stuff from C++. +*/ +#ifdef __cplusplus +extern "C" { +#endif + + +/* +** Provide the ability to override linkage features of the interface. +*/ +#ifndef SQLITE_EXTERN +# define SQLITE_EXTERN extern +#endif +#ifndef SQLITE_API +# define SQLITE_API +#endif +#ifndef SQLITE_CDECL +# define SQLITE_CDECL +#endif +#ifndef SQLITE_APICALL +# define SQLITE_APICALL +#endif +#ifndef SQLITE_STDCALL +# define SQLITE_STDCALL SQLITE_APICALL +#endif +#ifndef SQLITE_CALLBACK +# define SQLITE_CALLBACK +#endif +#ifndef SQLITE_SYSAPI +# define SQLITE_SYSAPI +#endif + +/* +** These no-op macros are used in front of interfaces to mark those +** interfaces as either deprecated or experimental. New applications +** should not use deprecated interfaces - they are supported for backwards +** compatibility only. Application writers should be aware that +** experimental interfaces are subject to change in point releases. +** +** These macros used to resolve to various kinds of compiler magic that +** would generate warning messages when they were used. But that +** compiler magic ended up generating such a flurry of bug reports +** that we have taken it all out and gone back to using simple +** noop macros. +*/ +#define SQLITE_DEPRECATED +#define SQLITE_EXPERIMENTAL + +/* +** Ensure these symbols were not defined by some previous header file. +*/ +#ifdef SQLITE_VERSION +# undef SQLITE_VERSION +#endif +#ifdef SQLITE_VERSION_NUMBER +# undef SQLITE_VERSION_NUMBER +#endif + +/* +** CAPI3REF: Compile-Time Library Version Numbers +** +** ^(The [SQLITE_VERSION] C preprocessor macro in the sqlite3.h header +** evaluates to a string literal that is the SQLite version in the +** format "X.Y.Z" where X is the major version number (always 3 for +** SQLite3) and Y is the minor version number and Z is the release number.)^ +** ^(The [SQLITE_VERSION_NUMBER] C preprocessor macro resolves to an integer +** with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z are the same +** numbers used in [SQLITE_VERSION].)^ +** The SQLITE_VERSION_NUMBER for any given release of SQLite will also +** be larger than the release from which it is derived. Either Y will +** be held constant and Z will be incremented or else Y will be incremented +** and Z will be reset to zero. +** +** Since [version 3.6.18] ([dateof:3.6.18]), +** SQLite source code has been stored in the +** Fossil configuration management +** system. ^The SQLITE_SOURCE_ID macro evaluates to +** a string which identifies a particular check-in of SQLite +** within its configuration management system. ^The SQLITE_SOURCE_ID +** string contains the date and time of the check-in (UTC) and a SHA1 +** or SHA3-256 hash of the entire source tree. If the source code has +** been edited in any way since it was last checked in, then the last +** four hexadecimal digits of the hash may be modified. +** +** See also: [sqlite3_libversion()], +** [sqlite3_libversion_number()], [sqlite3_sourceid()], +** [sqlite_version()] and [sqlite_source_id()]. +*/ +#define SQLITE_VERSION "3.32.3" +#define SQLITE_VERSION_NUMBER 3032003 +#define SQLITE_SOURCE_ID "2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd" + +/* +** CAPI3REF: Run-Time Library Version Numbers +** KEYWORDS: sqlite3_version sqlite3_sourceid +** +** These interfaces provide the same information as the [SQLITE_VERSION], +** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros +** but are associated with the library instead of the header file. ^(Cautious +** programmers might include assert() statements in their application to +** verify that values returned by these interfaces match the macros in +** the header, and thus ensure that the application is +** compiled with matching library and header files. +** +**
+** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
+** assert( strncmp(sqlite3_sourceid(),SQLITE_SOURCE_ID,80)==0 );
+** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );
+** 
)^ +** +** ^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION] +** macro. ^The sqlite3_libversion() function returns a pointer to the +** to the sqlite3_version[] string constant. The sqlite3_libversion() +** function is provided for use in DLLs since DLL users usually do not have +** direct access to string constants within the DLL. ^The +** sqlite3_libversion_number() function returns an integer equal to +** [SQLITE_VERSION_NUMBER]. ^(The sqlite3_sourceid() function returns +** a pointer to a string constant whose value is the same as the +** [SQLITE_SOURCE_ID] C preprocessor macro. Except if SQLite is built +** using an edited copy of [the amalgamation], then the last four characters +** of the hash might be different from [SQLITE_SOURCE_ID].)^ +** +** See also: [sqlite_version()] and [sqlite_source_id()]. +*/ +SQLITE_API SQLITE_EXTERN const char sqlite3_version[]; +SQLITE_API const char *sqlite3_libversion(void); +SQLITE_API const char *sqlite3_sourceid(void); +SQLITE_API int sqlite3_libversion_number(void); + +/* +** CAPI3REF: Run-Time Library Compilation Options Diagnostics +** +** ^The sqlite3_compileoption_used() function returns 0 or 1 +** indicating whether the specified option was defined at +** compile time. ^The SQLITE_ prefix may be omitted from the +** option name passed to sqlite3_compileoption_used(). +** +** ^The sqlite3_compileoption_get() function allows iterating +** over the list of options that were defined at compile time by +** returning the N-th compile time option string. ^If N is out of range, +** sqlite3_compileoption_get() returns a NULL pointer. ^The SQLITE_ +** prefix is omitted from any strings returned by +** sqlite3_compileoption_get(). +** +** ^Support for the diagnostic functions sqlite3_compileoption_used() +** and sqlite3_compileoption_get() may be omitted by specifying the +** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time. +** +** See also: SQL functions [sqlite_compileoption_used()] and +** [sqlite_compileoption_get()] and the [compile_options pragma]. +*/ +#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS +SQLITE_API int sqlite3_compileoption_used(const char *zOptName); +SQLITE_API const char *sqlite3_compileoption_get(int N); +#else +# define sqlite3_compileoption_used(X) 0 +# define sqlite3_compileoption_get(X) ((void*)0) +#endif + +/* +** CAPI3REF: Test To See If The Library Is Threadsafe +** +** ^The sqlite3_threadsafe() function returns zero if and only if +** SQLite was compiled with mutexing code omitted due to the +** [SQLITE_THREADSAFE] compile-time option being set to 0. +** +** SQLite can be compiled with or without mutexes. When +** the [SQLITE_THREADSAFE] C preprocessor macro is 1 or 2, mutexes +** are enabled and SQLite is threadsafe. When the +** [SQLITE_THREADSAFE] macro is 0, +** the mutexes are omitted. Without the mutexes, it is not safe +** to use SQLite concurrently from more than one thread. +** +** Enabling mutexes incurs a measurable performance penalty. +** So if speed is of utmost importance, it makes sense to disable +** the mutexes. But for maximum safety, mutexes should be enabled. +** ^The default behavior is for mutexes to be enabled. +** +** This interface can be used by an application to make sure that the +** version of SQLite that it is linking against was compiled with +** the desired setting of the [SQLITE_THREADSAFE] macro. +** +** This interface only reports on the compile-time mutex setting +** of the [SQLITE_THREADSAFE] flag. If SQLite is compiled with +** SQLITE_THREADSAFE=1 or =2 then mutexes are enabled by default but +** can be fully or partially disabled using a call to [sqlite3_config()] +** with the verbs [SQLITE_CONFIG_SINGLETHREAD], [SQLITE_CONFIG_MULTITHREAD], +** or [SQLITE_CONFIG_SERIALIZED]. ^(The return value of the +** sqlite3_threadsafe() function shows only the compile-time setting of +** thread safety, not any run-time changes to that setting made by +** sqlite3_config(). In other words, the return value from sqlite3_threadsafe() +** is unchanged by calls to sqlite3_config().)^ +** +** See the [threading mode] documentation for additional information. +*/ +SQLITE_API int sqlite3_threadsafe(void); + +/* +** CAPI3REF: Database Connection Handle +** KEYWORDS: {database connection} {database connections} +** +** Each open SQLite database is represented by a pointer to an instance of +** the opaque structure named "sqlite3". It is useful to think of an sqlite3 +** pointer as an object. The [sqlite3_open()], [sqlite3_open16()], and +** [sqlite3_open_v2()] interfaces are its constructors, and [sqlite3_close()] +** and [sqlite3_close_v2()] are its destructors. There are many other +** interfaces (such as +** [sqlite3_prepare_v2()], [sqlite3_create_function()], and +** [sqlite3_busy_timeout()] to name but three) that are methods on an +** sqlite3 object. +*/ +typedef struct sqlite3 sqlite3; + +/* +** CAPI3REF: 64-Bit Integer Types +** KEYWORDS: sqlite_int64 sqlite_uint64 +** +** Because there is no cross-platform way to specify 64-bit integer types +** SQLite includes typedefs for 64-bit signed and unsigned integers. +** +** The sqlite3_int64 and sqlite3_uint64 are the preferred type definitions. +** The sqlite_int64 and sqlite_uint64 types are supported for backwards +** compatibility only. +** +** ^The sqlite3_int64 and sqlite_int64 types can store integer values +** between -9223372036854775808 and +9223372036854775807 inclusive. ^The +** sqlite3_uint64 and sqlite_uint64 types can store integer values +** between 0 and +18446744073709551615 inclusive. +*/ +#ifdef SQLITE_INT64_TYPE + typedef SQLITE_INT64_TYPE sqlite_int64; +# ifdef SQLITE_UINT64_TYPE + typedef SQLITE_UINT64_TYPE sqlite_uint64; +# else + typedef unsigned SQLITE_INT64_TYPE sqlite_uint64; +# endif +#elif defined(_MSC_VER) || defined(__BORLANDC__) + typedef __int64 sqlite_int64; + typedef unsigned __int64 sqlite_uint64; +#else + typedef long long int sqlite_int64; + typedef unsigned long long int sqlite_uint64; +#endif +typedef sqlite_int64 sqlite3_int64; +typedef sqlite_uint64 sqlite3_uint64; + +/* +** If compiling for a processor that lacks floating point support, +** substitute integer for floating-point. +*/ +#ifdef SQLITE_OMIT_FLOATING_POINT +# define double sqlite3_int64 +#endif + +/* +** CAPI3REF: Closing A Database Connection +** DESTRUCTOR: sqlite3 +** +** ^The sqlite3_close() and sqlite3_close_v2() routines are destructors +** for the [sqlite3] object. +** ^Calls to sqlite3_close() and sqlite3_close_v2() return [SQLITE_OK] if +** the [sqlite3] object is successfully destroyed and all associated +** resources are deallocated. +** +** Ideally, applications should [sqlite3_finalize | finalize] all +** [prepared statements], [sqlite3_blob_close | close] all [BLOB handles], and +** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated +** with the [sqlite3] object prior to attempting to close the object. +** ^If the database connection is associated with unfinalized prepared +** statements, BLOB handlers, and/or unfinished sqlite3_backup objects then +** sqlite3_close() will leave the database connection open and return +** [SQLITE_BUSY]. ^If sqlite3_close_v2() is called with unfinalized prepared +** statements, unclosed BLOB handlers, and/or unfinished sqlite3_backups, +** it returns [SQLITE_OK] regardless, but instead of deallocating the database +** connection immediately, it marks the database connection as an unusable +** "zombie" and makes arrangements to automatically deallocate the database +** connection after all prepared statements are finalized, all BLOB handles +** are closed, and all backups have finished. The sqlite3_close_v2() interface +** is intended for use with host languages that are garbage collected, and +** where the order in which destructors are called is arbitrary. +** +** ^If an [sqlite3] object is destroyed while a transaction is open, +** the transaction is automatically rolled back. +** +** The C parameter to [sqlite3_close(C)] and [sqlite3_close_v2(C)] +** must be either a NULL +** pointer or an [sqlite3] object pointer obtained +** from [sqlite3_open()], [sqlite3_open16()], or +** [sqlite3_open_v2()], and not previously closed. +** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer +** argument is a harmless no-op. +*/ +SQLITE_API int sqlite3_close(sqlite3*); +SQLITE_API int sqlite3_close_v2(sqlite3*); + +/* +** The type for a callback function. +** This is legacy and deprecated. It is included for historical +** compatibility and is not documented. +*/ +typedef int (*sqlite3_callback)(void*,int,char**, char**); + +/* +** CAPI3REF: One-Step Query Execution Interface +** METHOD: sqlite3 +** +** The sqlite3_exec() interface is a convenience wrapper around +** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()], +** that allows an application to run multiple statements of SQL +** without having to use a lot of C code. +** +** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded, +** semicolon-separate SQL statements passed into its 2nd argument, +** in the context of the [database connection] passed in as its 1st +** argument. ^If the callback function of the 3rd argument to +** sqlite3_exec() is not NULL, then it is invoked for each result row +** coming out of the evaluated SQL statements. ^The 4th argument to +** sqlite3_exec() is relayed through to the 1st argument of each +** callback invocation. ^If the callback pointer to sqlite3_exec() +** is NULL, then no callback is ever invoked and result rows are +** ignored. +** +** ^If an error occurs while evaluating the SQL statements passed into +** sqlite3_exec(), then execution of the current statement stops and +** subsequent statements are skipped. ^If the 5th parameter to sqlite3_exec() +** is not NULL then any error message is written into memory obtained +** from [sqlite3_malloc()] and passed back through the 5th parameter. +** To avoid memory leaks, the application should invoke [sqlite3_free()] +** on error message strings returned through the 5th parameter of +** sqlite3_exec() after the error message string is no longer needed. +** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors +** occur, then sqlite3_exec() sets the pointer in its 5th parameter to +** NULL before returning. +** +** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec() +** routine returns SQLITE_ABORT without invoking the callback again and +** without running any subsequent SQL statements. +** +** ^The 2nd argument to the sqlite3_exec() callback function is the +** number of columns in the result. ^The 3rd argument to the sqlite3_exec() +** callback is an array of pointers to strings obtained as if from +** [sqlite3_column_text()], one for each column. ^If an element of a +** result row is NULL then the corresponding string pointer for the +** sqlite3_exec() callback is a NULL pointer. ^The 4th argument to the +** sqlite3_exec() callback is an array of pointers to strings where each +** entry represents the name of corresponding result column as obtained +** from [sqlite3_column_name()]. +** +** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer +** to an empty string, or a pointer that contains only whitespace and/or +** SQL comments, then no SQL statements are evaluated and the database +** is not changed. +** +** Restrictions: +** +**
    +**
  • The application must ensure that the 1st parameter to sqlite3_exec() +** is a valid and open [database connection]. +**
  • The application must not close the [database connection] specified by +** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running. +**
  • The application must not modify the SQL statement text passed into +** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running. +**
+*/ +SQLITE_API int sqlite3_exec( + sqlite3*, /* An open database */ + const char *sql, /* SQL to be evaluated */ + int (*callback)(void*,int,char**,char**), /* Callback function */ + void *, /* 1st argument to callback */ + char **errmsg /* Error msg written here */ +); + +/* +** CAPI3REF: Result Codes +** KEYWORDS: {result code definitions} +** +** Many SQLite functions return an integer result code from the set shown +** here in order to indicate success or failure. +** +** New error codes may be added in future versions of SQLite. +** +** See also: [extended result code definitions] +*/ +#define SQLITE_OK 0 /* Successful result */ +/* beginning-of-error-codes */ +#define SQLITE_ERROR 1 /* Generic error */ +#define SQLITE_INTERNAL 2 /* Internal logic error in SQLite */ +#define SQLITE_PERM 3 /* Access permission denied */ +#define SQLITE_ABORT 4 /* Callback routine requested an abort */ +#define SQLITE_BUSY 5 /* The database file is locked */ +#define SQLITE_LOCKED 6 /* A table in the database is locked */ +#define SQLITE_NOMEM 7 /* A malloc() failed */ +#define SQLITE_READONLY 8 /* Attempt to write a readonly database */ +#define SQLITE_INTERRUPT 9 /* Operation terminated by sqlite3_interrupt()*/ +#define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */ +#define SQLITE_CORRUPT 11 /* The database disk image is malformed */ +#define SQLITE_NOTFOUND 12 /* Unknown opcode in sqlite3_file_control() */ +#define SQLITE_FULL 13 /* Insertion failed because database is full */ +#define SQLITE_CANTOPEN 14 /* Unable to open the database file */ +#define SQLITE_PROTOCOL 15 /* Database lock protocol error */ +#define SQLITE_EMPTY 16 /* Internal use only */ +#define SQLITE_SCHEMA 17 /* The database schema changed */ +#define SQLITE_TOOBIG 18 /* String or BLOB exceeds size limit */ +#define SQLITE_CONSTRAINT 19 /* Abort due to constraint violation */ +#define SQLITE_MISMATCH 20 /* Data type mismatch */ +#define SQLITE_MISUSE 21 /* Library used incorrectly */ +#define SQLITE_NOLFS 22 /* Uses OS features not supported on host */ +#define SQLITE_AUTH 23 /* Authorization denied */ +#define SQLITE_FORMAT 24 /* Not used */ +#define SQLITE_RANGE 25 /* 2nd parameter to sqlite3_bind out of range */ +#define SQLITE_NOTADB 26 /* File opened that is not a database file */ +#define SQLITE_NOTICE 27 /* Notifications from sqlite3_log() */ +#define SQLITE_WARNING 28 /* Warnings from sqlite3_log() */ +#define SQLITE_ROW 100 /* sqlite3_step() has another row ready */ +#define SQLITE_DONE 101 /* sqlite3_step() has finished executing */ +/* end-of-error-codes */ + +/* +** CAPI3REF: Extended Result Codes +** KEYWORDS: {extended result code definitions} +** +** In its default configuration, SQLite API routines return one of 30 integer +** [result codes]. However, experience has shown that many of +** these result codes are too coarse-grained. They do not provide as +** much information about problems as programmers might like. In an effort to +** address this, newer versions of SQLite (version 3.3.8 [dateof:3.3.8] +** and later) include +** support for additional result codes that provide more detailed information +** about errors. These [extended result codes] are enabled or disabled +** on a per database connection basis using the +** [sqlite3_extended_result_codes()] API. Or, the extended code for +** the most recent error can be obtained using +** [sqlite3_extended_errcode()]. +*/ +#define SQLITE_ERROR_MISSING_COLLSEQ (SQLITE_ERROR | (1<<8)) +#define SQLITE_ERROR_RETRY (SQLITE_ERROR | (2<<8)) +#define SQLITE_ERROR_SNAPSHOT (SQLITE_ERROR | (3<<8)) +#define SQLITE_IOERR_READ (SQLITE_IOERR | (1<<8)) +#define SQLITE_IOERR_SHORT_READ (SQLITE_IOERR | (2<<8)) +#define SQLITE_IOERR_WRITE (SQLITE_IOERR | (3<<8)) +#define SQLITE_IOERR_FSYNC (SQLITE_IOERR | (4<<8)) +#define SQLITE_IOERR_DIR_FSYNC (SQLITE_IOERR | (5<<8)) +#define SQLITE_IOERR_TRUNCATE (SQLITE_IOERR | (6<<8)) +#define SQLITE_IOERR_FSTAT (SQLITE_IOERR | (7<<8)) +#define SQLITE_IOERR_UNLOCK (SQLITE_IOERR | (8<<8)) +#define SQLITE_IOERR_RDLOCK (SQLITE_IOERR | (9<<8)) +#define SQLITE_IOERR_DELETE (SQLITE_IOERR | (10<<8)) +#define SQLITE_IOERR_BLOCKED (SQLITE_IOERR | (11<<8)) +#define SQLITE_IOERR_NOMEM (SQLITE_IOERR | (12<<8)) +#define SQLITE_IOERR_ACCESS (SQLITE_IOERR | (13<<8)) +#define SQLITE_IOERR_CHECKRESERVEDLOCK (SQLITE_IOERR | (14<<8)) +#define SQLITE_IOERR_LOCK (SQLITE_IOERR | (15<<8)) +#define SQLITE_IOERR_CLOSE (SQLITE_IOERR | (16<<8)) +#define SQLITE_IOERR_DIR_CLOSE (SQLITE_IOERR | (17<<8)) +#define SQLITE_IOERR_SHMOPEN (SQLITE_IOERR | (18<<8)) +#define SQLITE_IOERR_SHMSIZE (SQLITE_IOERR | (19<<8)) +#define SQLITE_IOERR_SHMLOCK (SQLITE_IOERR | (20<<8)) +#define SQLITE_IOERR_SHMMAP (SQLITE_IOERR | (21<<8)) +#define SQLITE_IOERR_SEEK (SQLITE_IOERR | (22<<8)) +#define SQLITE_IOERR_DELETE_NOENT (SQLITE_IOERR | (23<<8)) +#define SQLITE_IOERR_MMAP (SQLITE_IOERR | (24<<8)) +#define SQLITE_IOERR_GETTEMPPATH (SQLITE_IOERR | (25<<8)) +#define SQLITE_IOERR_CONVPATH (SQLITE_IOERR | (26<<8)) +#define SQLITE_IOERR_VNODE (SQLITE_IOERR | (27<<8)) +#define SQLITE_IOERR_AUTH (SQLITE_IOERR | (28<<8)) +#define SQLITE_IOERR_BEGIN_ATOMIC (SQLITE_IOERR | (29<<8)) +#define SQLITE_IOERR_COMMIT_ATOMIC (SQLITE_IOERR | (30<<8)) +#define SQLITE_IOERR_ROLLBACK_ATOMIC (SQLITE_IOERR | (31<<8)) +#define SQLITE_IOERR_DATA (SQLITE_IOERR | (32<<8)) +#define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8)) +#define SQLITE_LOCKED_VTAB (SQLITE_LOCKED | (2<<8)) +#define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8)) +#define SQLITE_BUSY_SNAPSHOT (SQLITE_BUSY | (2<<8)) +#define SQLITE_BUSY_TIMEOUT (SQLITE_BUSY | (3<<8)) +#define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8)) +#define SQLITE_CANTOPEN_ISDIR (SQLITE_CANTOPEN | (2<<8)) +#define SQLITE_CANTOPEN_FULLPATH (SQLITE_CANTOPEN | (3<<8)) +#define SQLITE_CANTOPEN_CONVPATH (SQLITE_CANTOPEN | (4<<8)) +#define SQLITE_CANTOPEN_DIRTYWAL (SQLITE_CANTOPEN | (5<<8)) /* Not Used */ +#define SQLITE_CANTOPEN_SYMLINK (SQLITE_CANTOPEN | (6<<8)) +#define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1<<8)) +#define SQLITE_CORRUPT_SEQUENCE (SQLITE_CORRUPT | (2<<8)) +#define SQLITE_CORRUPT_INDEX (SQLITE_CORRUPT | (3<<8)) +#define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1<<8)) +#define SQLITE_READONLY_CANTLOCK (SQLITE_READONLY | (2<<8)) +#define SQLITE_READONLY_ROLLBACK (SQLITE_READONLY | (3<<8)) +#define SQLITE_READONLY_DBMOVED (SQLITE_READONLY | (4<<8)) +#define SQLITE_READONLY_CANTINIT (SQLITE_READONLY | (5<<8)) +#define SQLITE_READONLY_DIRECTORY (SQLITE_READONLY | (6<<8)) +#define SQLITE_ABORT_ROLLBACK (SQLITE_ABORT | (2<<8)) +#define SQLITE_CONSTRAINT_CHECK (SQLITE_CONSTRAINT | (1<<8)) +#define SQLITE_CONSTRAINT_COMMITHOOK (SQLITE_CONSTRAINT | (2<<8)) +#define SQLITE_CONSTRAINT_FOREIGNKEY (SQLITE_CONSTRAINT | (3<<8)) +#define SQLITE_CONSTRAINT_FUNCTION (SQLITE_CONSTRAINT | (4<<8)) +#define SQLITE_CONSTRAINT_NOTNULL (SQLITE_CONSTRAINT | (5<<8)) +#define SQLITE_CONSTRAINT_PRIMARYKEY (SQLITE_CONSTRAINT | (6<<8)) +#define SQLITE_CONSTRAINT_TRIGGER (SQLITE_CONSTRAINT | (7<<8)) +#define SQLITE_CONSTRAINT_UNIQUE (SQLITE_CONSTRAINT | (8<<8)) +#define SQLITE_CONSTRAINT_VTAB (SQLITE_CONSTRAINT | (9<<8)) +#define SQLITE_CONSTRAINT_ROWID (SQLITE_CONSTRAINT |(10<<8)) +#define SQLITE_CONSTRAINT_PINNED (SQLITE_CONSTRAINT |(11<<8)) +#define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8)) +#define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8)) +#define SQLITE_WARNING_AUTOINDEX (SQLITE_WARNING | (1<<8)) +#define SQLITE_AUTH_USER (SQLITE_AUTH | (1<<8)) +#define SQLITE_OK_LOAD_PERMANENTLY (SQLITE_OK | (1<<8)) +#define SQLITE_OK_SYMLINK (SQLITE_OK | (2<<8)) + +/* +** CAPI3REF: Flags For File Open Operations +** +** These bit values are intended for use in the +** 3rd parameter to the [sqlite3_open_v2()] interface and +** in the 4th parameter to the [sqlite3_vfs.xOpen] method. +*/ +#define SQLITE_OPEN_READONLY 0x00000001 /* Ok for sqlite3_open_v2() */ +#define SQLITE_OPEN_READWRITE 0x00000002 /* Ok for sqlite3_open_v2() */ +#define SQLITE_OPEN_CREATE 0x00000004 /* Ok for sqlite3_open_v2() */ +#define SQLITE_OPEN_DELETEONCLOSE 0x00000008 /* VFS only */ +#define SQLITE_OPEN_EXCLUSIVE 0x00000010 /* VFS only */ +#define SQLITE_OPEN_AUTOPROXY 0x00000020 /* VFS only */ +#define SQLITE_OPEN_URI 0x00000040 /* Ok for sqlite3_open_v2() */ +#define SQLITE_OPEN_MEMORY 0x00000080 /* Ok for sqlite3_open_v2() */ +#define SQLITE_OPEN_MAIN_DB 0x00000100 /* VFS only */ +#define SQLITE_OPEN_TEMP_DB 0x00000200 /* VFS only */ +#define SQLITE_OPEN_TRANSIENT_DB 0x00000400 /* VFS only */ +#define SQLITE_OPEN_MAIN_JOURNAL 0x00000800 /* VFS only */ +#define SQLITE_OPEN_TEMP_JOURNAL 0x00001000 /* VFS only */ +#define SQLITE_OPEN_SUBJOURNAL 0x00002000 /* VFS only */ +#define SQLITE_OPEN_MASTER_JOURNAL 0x00004000 /* VFS only */ +#define SQLITE_OPEN_NOMUTEX 0x00008000 /* Ok for sqlite3_open_v2() */ +#define SQLITE_OPEN_FULLMUTEX 0x00010000 /* Ok for sqlite3_open_v2() */ +#define SQLITE_OPEN_SHAREDCACHE 0x00020000 /* Ok for sqlite3_open_v2() */ +#define SQLITE_OPEN_PRIVATECACHE 0x00040000 /* Ok for sqlite3_open_v2() */ +#define SQLITE_OPEN_WAL 0x00080000 /* VFS only */ +#define SQLITE_OPEN_NOFOLLOW 0x01000000 /* Ok for sqlite3_open_v2() */ + +/* Reserved: 0x00F00000 */ + +/* +** CAPI3REF: Device Characteristics +** +** The xDeviceCharacteristics method of the [sqlite3_io_methods] +** object returns an integer which is a vector of these +** bit values expressing I/O characteristics of the mass storage +** device that holds the file that the [sqlite3_io_methods] +** refers to. +** +** The SQLITE_IOCAP_ATOMIC property means that all writes of +** any size are atomic. The SQLITE_IOCAP_ATOMICnnn values +** mean that writes of blocks that are nnn bytes in size and +** are aligned to an address which is an integer multiple of +** nnn are atomic. The SQLITE_IOCAP_SAFE_APPEND value means +** that when data is appended to a file, the data is appended +** first then the size of the file is extended, never the other +** way around. The SQLITE_IOCAP_SEQUENTIAL property means that +** information is written to disk in the same order as calls +** to xWrite(). The SQLITE_IOCAP_POWERSAFE_OVERWRITE property means that +** after reboot following a crash or power loss, the only bytes in a +** file that were written at the application level might have changed +** and that adjacent bytes, even bytes within the same sector are +** guaranteed to be unchanged. The SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN +** flag indicates that a file cannot be deleted when open. The +** SQLITE_IOCAP_IMMUTABLE flag indicates that the file is on +** read-only media and cannot be changed even by processes with +** elevated privileges. +** +** The SQLITE_IOCAP_BATCH_ATOMIC property means that the underlying +** filesystem supports doing multiple write operations atomically when those +** write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and +** [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]. +*/ +#define SQLITE_IOCAP_ATOMIC 0x00000001 +#define SQLITE_IOCAP_ATOMIC512 0x00000002 +#define SQLITE_IOCAP_ATOMIC1K 0x00000004 +#define SQLITE_IOCAP_ATOMIC2K 0x00000008 +#define SQLITE_IOCAP_ATOMIC4K 0x00000010 +#define SQLITE_IOCAP_ATOMIC8K 0x00000020 +#define SQLITE_IOCAP_ATOMIC16K 0x00000040 +#define SQLITE_IOCAP_ATOMIC32K 0x00000080 +#define SQLITE_IOCAP_ATOMIC64K 0x00000100 +#define SQLITE_IOCAP_SAFE_APPEND 0x00000200 +#define SQLITE_IOCAP_SEQUENTIAL 0x00000400 +#define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN 0x00000800 +#define SQLITE_IOCAP_POWERSAFE_OVERWRITE 0x00001000 +#define SQLITE_IOCAP_IMMUTABLE 0x00002000 +#define SQLITE_IOCAP_BATCH_ATOMIC 0x00004000 + +/* +** CAPI3REF: File Locking Levels +** +** SQLite uses one of these integer values as the second +** argument to calls it makes to the xLock() and xUnlock() methods +** of an [sqlite3_io_methods] object. +*/ +#define SQLITE_LOCK_NONE 0 +#define SQLITE_LOCK_SHARED 1 +#define SQLITE_LOCK_RESERVED 2 +#define SQLITE_LOCK_PENDING 3 +#define SQLITE_LOCK_EXCLUSIVE 4 + +/* +** CAPI3REF: Synchronization Type Flags +** +** When SQLite invokes the xSync() method of an +** [sqlite3_io_methods] object it uses a combination of +** these integer values as the second argument. +** +** When the SQLITE_SYNC_DATAONLY flag is used, it means that the +** sync operation only needs to flush data to mass storage. Inode +** information need not be flushed. If the lower four bits of the flag +** equal SQLITE_SYNC_NORMAL, that means to use normal fsync() semantics. +** If the lower four bits equal SQLITE_SYNC_FULL, that means +** to use Mac OS X style fullsync instead of fsync(). +** +** Do not confuse the SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags +** with the [PRAGMA synchronous]=NORMAL and [PRAGMA synchronous]=FULL +** settings. The [synchronous pragma] determines when calls to the +** xSync VFS method occur and applies uniformly across all platforms. +** The SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags determine how +** energetic or rigorous or forceful the sync operations are and +** only make a difference on Mac OSX for the default SQLite code. +** (Third-party VFS implementations might also make the distinction +** between SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL, but among the +** operating systems natively supported by SQLite, only Mac OSX +** cares about the difference.) +*/ +#define SQLITE_SYNC_NORMAL 0x00002 +#define SQLITE_SYNC_FULL 0x00003 +#define SQLITE_SYNC_DATAONLY 0x00010 + +/* +** CAPI3REF: OS Interface Open File Handle +** +** An [sqlite3_file] object represents an open file in the +** [sqlite3_vfs | OS interface layer]. Individual OS interface +** implementations will +** want to subclass this object by appending additional fields +** for their own use. The pMethods entry is a pointer to an +** [sqlite3_io_methods] object that defines methods for performing +** I/O operations on the open file. +*/ +typedef struct sqlite3_file sqlite3_file; +struct sqlite3_file { + const struct sqlite3_io_methods *pMethods; /* Methods for an open file */ +}; + +/* +** CAPI3REF: OS Interface File Virtual Methods Object +** +** Every file opened by the [sqlite3_vfs.xOpen] method populates an +** [sqlite3_file] object (or, more commonly, a subclass of the +** [sqlite3_file] object) with a pointer to an instance of this object. +** This object defines the methods used to perform various operations +** against the open file represented by the [sqlite3_file] object. +** +** If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element +** to a non-NULL pointer, then the sqlite3_io_methods.xClose method +** may be invoked even if the [sqlite3_vfs.xOpen] reported that it failed. The +** only way to prevent a call to xClose following a failed [sqlite3_vfs.xOpen] +** is for the [sqlite3_vfs.xOpen] to set the sqlite3_file.pMethods element +** to NULL. +** +** The flags argument to xSync may be one of [SQLITE_SYNC_NORMAL] or +** [SQLITE_SYNC_FULL]. The first choice is the normal fsync(). +** The second choice is a Mac OS X style fullsync. The [SQLITE_SYNC_DATAONLY] +** flag may be ORed in to indicate that only the data of the file +** and not its inode needs to be synced. +** +** The integer values to xLock() and xUnlock() are one of +**
    +**
  • [SQLITE_LOCK_NONE], +**
  • [SQLITE_LOCK_SHARED], +**
  • [SQLITE_LOCK_RESERVED], +**
  • [SQLITE_LOCK_PENDING], or +**
  • [SQLITE_LOCK_EXCLUSIVE]. +**
+** xLock() increases the lock. xUnlock() decreases the lock. +** The xCheckReservedLock() method checks whether any database connection, +** either in this process or in some other process, is holding a RESERVED, +** PENDING, or EXCLUSIVE lock on the file. It returns true +** if such a lock exists and false otherwise. +** +** The xFileControl() method is a generic interface that allows custom +** VFS implementations to directly control an open file using the +** [sqlite3_file_control()] interface. The second "op" argument is an +** integer opcode. The third argument is a generic pointer intended to +** point to a structure that may contain arguments or space in which to +** write return values. Potential uses for xFileControl() might be +** functions to enable blocking locks with timeouts, to change the +** locking strategy (for example to use dot-file locks), to inquire +** about the status of a lock, or to break stale locks. The SQLite +** core reserves all opcodes less than 100 for its own use. +** A [file control opcodes | list of opcodes] less than 100 is available. +** Applications that define a custom xFileControl method should use opcodes +** greater than 100 to avoid conflicts. VFS implementations should +** return [SQLITE_NOTFOUND] for file control opcodes that they do not +** recognize. +** +** The xSectorSize() method returns the sector size of the +** device that underlies the file. The sector size is the +** minimum write that can be performed without disturbing +** other bytes in the file. The xDeviceCharacteristics() +** method returns a bit vector describing behaviors of the +** underlying device: +** +**
    +**
  • [SQLITE_IOCAP_ATOMIC] +**
  • [SQLITE_IOCAP_ATOMIC512] +**
  • [SQLITE_IOCAP_ATOMIC1K] +**
  • [SQLITE_IOCAP_ATOMIC2K] +**
  • [SQLITE_IOCAP_ATOMIC4K] +**
  • [SQLITE_IOCAP_ATOMIC8K] +**
  • [SQLITE_IOCAP_ATOMIC16K] +**
  • [SQLITE_IOCAP_ATOMIC32K] +**
  • [SQLITE_IOCAP_ATOMIC64K] +**
  • [SQLITE_IOCAP_SAFE_APPEND] +**
  • [SQLITE_IOCAP_SEQUENTIAL] +**
  • [SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN] +**
  • [SQLITE_IOCAP_POWERSAFE_OVERWRITE] +**
  • [SQLITE_IOCAP_IMMUTABLE] +**
  • [SQLITE_IOCAP_BATCH_ATOMIC] +**
+** +** The SQLITE_IOCAP_ATOMIC property means that all writes of +** any size are atomic. The SQLITE_IOCAP_ATOMICnnn values +** mean that writes of blocks that are nnn bytes in size and +** are aligned to an address which is an integer multiple of +** nnn are atomic. The SQLITE_IOCAP_SAFE_APPEND value means +** that when data is appended to a file, the data is appended +** first then the size of the file is extended, never the other +** way around. The SQLITE_IOCAP_SEQUENTIAL property means that +** information is written to disk in the same order as calls +** to xWrite(). +** +** If xRead() returns SQLITE_IOERR_SHORT_READ it must also fill +** in the unread portions of the buffer with zeros. A VFS that +** fails to zero-fill short reads might seem to work. However, +** failure to zero-fill short reads will eventually lead to +** database corruption. +*/ +typedef struct sqlite3_io_methods sqlite3_io_methods; +struct sqlite3_io_methods { + int iVersion; + int (*xClose)(sqlite3_file*); + int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst); + int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst); + int (*xTruncate)(sqlite3_file*, sqlite3_int64 size); + int (*xSync)(sqlite3_file*, int flags); + int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize); + int (*xLock)(sqlite3_file*, int); + int (*xUnlock)(sqlite3_file*, int); + int (*xCheckReservedLock)(sqlite3_file*, int *pResOut); + int (*xFileControl)(sqlite3_file*, int op, void *pArg); + int (*xSectorSize)(sqlite3_file*); + int (*xDeviceCharacteristics)(sqlite3_file*); + /* Methods above are valid for version 1 */ + int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**); + int (*xShmLock)(sqlite3_file*, int offset, int n, int flags); + void (*xShmBarrier)(sqlite3_file*); + int (*xShmUnmap)(sqlite3_file*, int deleteFlag); + /* Methods above are valid for version 2 */ + int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp); + int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p); + /* Methods above are valid for version 3 */ + /* Additional methods may be added in future releases */ +}; + +/* +** CAPI3REF: Standard File Control Opcodes +** KEYWORDS: {file control opcodes} {file control opcode} +** +** These integer constants are opcodes for the xFileControl method +** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()] +** interface. +** +**
    +**
  • [[SQLITE_FCNTL_LOCKSTATE]] +** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging. This +** opcode causes the xFileControl method to write the current state of +** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED], +** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE]) +** into an integer that the pArg argument points to. This capability +** is used during testing and is only available when the SQLITE_TEST +** compile-time option is used. +** +**
  • [[SQLITE_FCNTL_SIZE_HINT]] +** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS +** layer a hint of how large the database file will grow to be during the +** current transaction. This hint is not guaranteed to be accurate but it +** is often close. The underlying VFS might choose to preallocate database +** file space based on this hint in order to help writes to the database +** file run faster. +** +**
  • [[SQLITE_FCNTL_SIZE_LIMIT]] +** The [SQLITE_FCNTL_SIZE_LIMIT] opcode is used by in-memory VFS that +** implements [sqlite3_deserialize()] to set an upper bound on the size +** of the in-memory database. The argument is a pointer to a [sqlite3_int64]. +** If the integer pointed to is negative, then it is filled in with the +** current limit. Otherwise the limit is set to the larger of the value +** of the integer pointed to and the current database size. The integer +** pointed to is set to the new limit. +** +**
  • [[SQLITE_FCNTL_CHUNK_SIZE]] +** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS +** extends and truncates the database file in chunks of a size specified +** by the user. The fourth argument to [sqlite3_file_control()] should +** point to an integer (type int) containing the new chunk-size to use +** for the nominated database. Allocating database file space in large +** chunks (say 1MB at a time), may reduce file-system fragmentation and +** improve performance on some systems. +** +**
  • [[SQLITE_FCNTL_FILE_POINTER]] +** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer +** to the [sqlite3_file] object associated with a particular database +** connection. See also [SQLITE_FCNTL_JOURNAL_POINTER]. +** +**
  • [[SQLITE_FCNTL_JOURNAL_POINTER]] +** The [SQLITE_FCNTL_JOURNAL_POINTER] opcode is used to obtain a pointer +** to the [sqlite3_file] object associated with the journal file (either +** the [rollback journal] or the [write-ahead log]) for a particular database +** connection. See also [SQLITE_FCNTL_FILE_POINTER]. +** +**
  • [[SQLITE_FCNTL_SYNC_OMITTED]] +** No longer in use. +** +**
  • [[SQLITE_FCNTL_SYNC]] +** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and +** sent to the VFS immediately before the xSync method is invoked on a +** database file descriptor. Or, if the xSync method is not invoked +** because the user has configured SQLite with +** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place +** of the xSync method. In most cases, the pointer argument passed with +** this file-control is NULL. However, if the database file is being synced +** as part of a multi-database commit, the argument points to a nul-terminated +** string containing the transactions master-journal file name. VFSes that +** do not need this signal should silently ignore this opcode. Applications +** should not call [sqlite3_file_control()] with this opcode as doing so may +** disrupt the operation of the specialized VFSes that do require it. +** +**
  • [[SQLITE_FCNTL_COMMIT_PHASETWO]] +** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite +** and sent to the VFS after a transaction has been committed immediately +** but before the database is unlocked. VFSes that do not need this signal +** should silently ignore this opcode. Applications should not call +** [sqlite3_file_control()] with this opcode as doing so may disrupt the +** operation of the specialized VFSes that do require it. +** +**
  • [[SQLITE_FCNTL_WIN32_AV_RETRY]] +** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic +** retry counts and intervals for certain disk I/O operations for the +** windows [VFS] in order to provide robustness in the presence of +** anti-virus programs. By default, the windows VFS will retry file read, +** file write, and file delete operations up to 10 times, with a delay +** of 25 milliseconds before the first retry and with the delay increasing +** by an additional 25 milliseconds with each subsequent retry. This +** opcode allows these two values (10 retries and 25 milliseconds of delay) +** to be adjusted. The values are changed for all database connections +** within the same process. The argument is a pointer to an array of two +** integers where the first integer is the new retry count and the second +** integer is the delay. If either integer is negative, then the setting +** is not changed but instead the prior value of that setting is written +** into the array entry, allowing the current retry settings to be +** interrogated. The zDbName parameter is ignored. +** +**
  • [[SQLITE_FCNTL_PERSIST_WAL]] +** ^The [SQLITE_FCNTL_PERSIST_WAL] opcode is used to set or query the +** persistent [WAL | Write Ahead Log] setting. By default, the auxiliary +** write ahead log ([WAL file]) and shared memory +** files used for transaction control +** are automatically deleted when the latest connection to the database +** closes. Setting persistent WAL mode causes those files to persist after +** close. Persisting the files is useful when other processes that do not +** have write permission on the directory containing the database file want +** to read the database file, as the WAL and shared memory files must exist +** in order for the database to be readable. The fourth parameter to +** [sqlite3_file_control()] for this opcode should be a pointer to an integer. +** That integer is 0 to disable persistent WAL mode or 1 to enable persistent +** WAL mode. If the integer is -1, then it is overwritten with the current +** WAL persistence setting. +** +**
  • [[SQLITE_FCNTL_POWERSAFE_OVERWRITE]] +** ^The [SQLITE_FCNTL_POWERSAFE_OVERWRITE] opcode is used to set or query the +** persistent "powersafe-overwrite" or "PSOW" setting. The PSOW setting +** determines the [SQLITE_IOCAP_POWERSAFE_OVERWRITE] bit of the +** xDeviceCharacteristics methods. The fourth parameter to +** [sqlite3_file_control()] for this opcode should be a pointer to an integer. +** That integer is 0 to disable zero-damage mode or 1 to enable zero-damage +** mode. If the integer is -1, then it is overwritten with the current +** zero-damage mode setting. +** +**
  • [[SQLITE_FCNTL_OVERWRITE]] +** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening +** a write transaction to indicate that, unless it is rolled back for some +** reason, the entire database file will be overwritten by the current +** transaction. This is used by VACUUM operations. +** +**
  • [[SQLITE_FCNTL_VFSNAME]] +** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of +** all [VFSes] in the VFS stack. The names are of all VFS shims and the +** final bottom-level VFS are written into memory obtained from +** [sqlite3_malloc()] and the result is stored in the char* variable +** that the fourth parameter of [sqlite3_file_control()] points to. +** The caller is responsible for freeing the memory when done. As with +** all file-control actions, there is no guarantee that this will actually +** do anything. Callers should initialize the char* variable to a NULL +** pointer in case this file-control is not implemented. This file-control +** is intended for diagnostic use only. +** +**
  • [[SQLITE_FCNTL_VFS_POINTER]] +** ^The [SQLITE_FCNTL_VFS_POINTER] opcode finds a pointer to the top-level +** [VFSes] currently in use. ^(The argument X in +** sqlite3_file_control(db,SQLITE_FCNTL_VFS_POINTER,X) must be +** of type "[sqlite3_vfs] **". This opcodes will set *X +** to a pointer to the top-level VFS.)^ +** ^When there are multiple VFS shims in the stack, this opcode finds the +** upper-most shim only. +** +**
  • [[SQLITE_FCNTL_PRAGMA]] +** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] +** file control is sent to the open [sqlite3_file] object corresponding +** to the database file to which the pragma statement refers. ^The argument +** to the [SQLITE_FCNTL_PRAGMA] file control is an array of +** pointers to strings (char**) in which the second element of the array +** is the name of the pragma and the third element is the argument to the +** pragma or NULL if the pragma has no argument. ^The handler for an +** [SQLITE_FCNTL_PRAGMA] file control can optionally make the first element +** of the char** argument point to a string obtained from [sqlite3_mprintf()] +** or the equivalent and that string will become the result of the pragma or +** the error message if the pragma fails. ^If the +** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal +** [PRAGMA] processing continues. ^If the [SQLITE_FCNTL_PRAGMA] +** file control returns [SQLITE_OK], then the parser assumes that the +** VFS has handled the PRAGMA itself and the parser generates a no-op +** prepared statement if result string is NULL, or that returns a copy +** of the result string if the string is non-NULL. +** ^If the [SQLITE_FCNTL_PRAGMA] file control returns +** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means +** that the VFS encountered an error while handling the [PRAGMA] and the +** compilation of the PRAGMA fails with an error. ^The [SQLITE_FCNTL_PRAGMA] +** file control occurs at the beginning of pragma statement analysis and so +** it is able to override built-in [PRAGMA] statements. +** +**
  • [[SQLITE_FCNTL_BUSYHANDLER]] +** ^The [SQLITE_FCNTL_BUSYHANDLER] +** file-control may be invoked by SQLite on the database file handle +** shortly after it is opened in order to provide a custom VFS with access +** to the connection's busy-handler callback. The argument is of type (void**) +** - an array of two (void *) values. The first (void *) actually points +** to a function of type (int (*)(void *)). In order to invoke the connection's +** busy-handler, this function should be invoked with the second (void *) in +** the array as the only argument. If it returns non-zero, then the operation +** should be retried. If it returns zero, the custom VFS should abandon the +** current operation. +** +**
  • [[SQLITE_FCNTL_TEMPFILENAME]] +** ^Applications can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control +** to have SQLite generate a +** temporary filename using the same algorithm that is followed to generate +** temporary filenames for TEMP tables and other internal uses. The +** argument should be a char** which will be filled with the filename +** written into memory obtained from [sqlite3_malloc()]. The caller should +** invoke [sqlite3_free()] on the result to avoid a memory leak. +** +**
  • [[SQLITE_FCNTL_MMAP_SIZE]] +** The [SQLITE_FCNTL_MMAP_SIZE] file control is used to query or set the +** maximum number of bytes that will be used for memory-mapped I/O. +** The argument is a pointer to a value of type sqlite3_int64 that +** is an advisory maximum number of bytes in the file to memory map. The +** pointer is overwritten with the old value. The limit is not changed if +** the value originally pointed to is negative, and so the current limit +** can be queried by passing in a pointer to a negative number. This +** file-control is used internally to implement [PRAGMA mmap_size]. +** +**
  • [[SQLITE_FCNTL_TRACE]] +** The [SQLITE_FCNTL_TRACE] file control provides advisory information +** to the VFS about what the higher layers of the SQLite stack are doing. +** This file control is used by some VFS activity tracing [shims]. +** The argument is a zero-terminated string. Higher layers in the +** SQLite stack may generate instances of this file control if +** the [SQLITE_USE_FCNTL_TRACE] compile-time option is enabled. +** +**
  • [[SQLITE_FCNTL_HAS_MOVED]] +** The [SQLITE_FCNTL_HAS_MOVED] file control interprets its argument as a +** pointer to an integer and it writes a boolean into that integer depending +** on whether or not the file has been renamed, moved, or deleted since it +** was first opened. +** +**
  • [[SQLITE_FCNTL_WIN32_GET_HANDLE]] +** The [SQLITE_FCNTL_WIN32_GET_HANDLE] opcode can be used to obtain the +** underlying native file handle associated with a file handle. This file +** control interprets its argument as a pointer to a native file handle and +** writes the resulting value there. +** +**
  • [[SQLITE_FCNTL_WIN32_SET_HANDLE]] +** The [SQLITE_FCNTL_WIN32_SET_HANDLE] opcode is used for debugging. This +** opcode causes the xFileControl method to swap the file handle with the one +** pointed to by the pArg argument. This capability is used during testing +** and only needs to be supported when SQLITE_TEST is defined. +** +**
  • [[SQLITE_FCNTL_WAL_BLOCK]] +** The [SQLITE_FCNTL_WAL_BLOCK] is a signal to the VFS layer that it might +** be advantageous to block on the next WAL lock if the lock is not immediately +** available. The WAL subsystem issues this signal during rare +** circumstances in order to fix a problem with priority inversion. +** Applications should not use this file-control. +** +**
  • [[SQLITE_FCNTL_ZIPVFS]] +** The [SQLITE_FCNTL_ZIPVFS] opcode is implemented by zipvfs only. All other +** VFS should return SQLITE_NOTFOUND for this opcode. +** +**
  • [[SQLITE_FCNTL_RBU]] +** The [SQLITE_FCNTL_RBU] opcode is implemented by the special VFS used by +** the RBU extension only. All other VFS should return SQLITE_NOTFOUND for +** this opcode. +** +**
  • [[SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]] +** If the [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] opcode returns SQLITE_OK, then +** the file descriptor is placed in "batch write mode", which +** means all subsequent write operations will be deferred and done +** atomically at the next [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]. Systems +** that do not support batch atomic writes will return SQLITE_NOTFOUND. +** ^Following a successful SQLITE_FCNTL_BEGIN_ATOMIC_WRITE and prior to +** the closing [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] or +** [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE], SQLite will make +** no VFS interface calls on the same [sqlite3_file] file descriptor +** except for calls to the xWrite method and the xFileControl method +** with [SQLITE_FCNTL_SIZE_HINT]. +** +**
  • [[SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]] +** The [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] opcode causes all write +** operations since the previous successful call to +** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be performed atomically. +** This file control returns [SQLITE_OK] if and only if the writes were +** all performed successfully and have been committed to persistent storage. +** ^Regardless of whether or not it is successful, this file control takes +** the file descriptor out of batch write mode so that all subsequent +** write operations are independent. +** ^SQLite will never invoke SQLITE_FCNTL_COMMIT_ATOMIC_WRITE without +** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. +** +**
  • [[SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE]] +** The [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE] opcode causes all write +** operations since the previous successful call to +** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rolled back. +** ^This file control takes the file descriptor out of batch write mode +** so that all subsequent write operations are independent. +** ^SQLite will never invoke SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE without +** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. +** +**
  • [[SQLITE_FCNTL_LOCK_TIMEOUT]] +** The [SQLITE_FCNTL_LOCK_TIMEOUT] opcode is used to configure a VFS +** to block for up to M milliseconds before failing when attempting to +** obtain a file lock using the xLock or xShmLock methods of the VFS. +** The parameter is a pointer to a 32-bit signed integer that contains +** the value that M is to be set to. Before returning, the 32-bit signed +** integer is overwritten with the previous value of M. +** +**
  • [[SQLITE_FCNTL_DATA_VERSION]] +** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to +** a database file. The argument is a pointer to a 32-bit unsigned integer. +** The "data version" for the pager is written into the pointer. The +** "data version" changes whenever any change occurs to the corresponding +** database file, either through SQL statements on the same database +** connection or through transactions committed by separate database +** connections possibly in other processes. The [sqlite3_total_changes()] +** interface can be used to find if any database on the connection has changed, +** but that interface responds to changes on TEMP as well as MAIN and does +** not provide a mechanism to detect changes to MAIN only. Also, the +** [sqlite3_total_changes()] interface responds to internal changes only and +** omits changes made by other database connections. The +** [PRAGMA data_version] command provides a mechanism to detect changes to +** a single attached database that occur due to other database connections, +** but omits changes implemented by the database connection on which it is +** called. This file control is the only mechanism to detect changes that +** happen either internally or externally and that are associated with +** a particular attached database. +** +**
  • [[SQLITE_FCNTL_CKPT_START]] +** The [SQLITE_FCNTL_CKPT_START] opcode is invoked from within a checkpoint +** in wal mode before the client starts to copy pages from the wal +** file to the database file. +** +**
  • [[SQLITE_FCNTL_CKPT_DONE]] +** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint +** in wal mode after the client has finished copying pages from the wal +** file to the database file, but before the *-shm file is updated to +** record the fact that the pages have been checkpointed. +**
+*/ +#define SQLITE_FCNTL_LOCKSTATE 1 +#define SQLITE_FCNTL_GET_LOCKPROXYFILE 2 +#define SQLITE_FCNTL_SET_LOCKPROXYFILE 3 +#define SQLITE_FCNTL_LAST_ERRNO 4 +#define SQLITE_FCNTL_SIZE_HINT 5 +#define SQLITE_FCNTL_CHUNK_SIZE 6 +#define SQLITE_FCNTL_FILE_POINTER 7 +#define SQLITE_FCNTL_SYNC_OMITTED 8 +#define SQLITE_FCNTL_WIN32_AV_RETRY 9 +#define SQLITE_FCNTL_PERSIST_WAL 10 +#define SQLITE_FCNTL_OVERWRITE 11 +#define SQLITE_FCNTL_VFSNAME 12 +#define SQLITE_FCNTL_POWERSAFE_OVERWRITE 13 +#define SQLITE_FCNTL_PRAGMA 14 +#define SQLITE_FCNTL_BUSYHANDLER 15 +#define SQLITE_FCNTL_TEMPFILENAME 16 +#define SQLITE_FCNTL_MMAP_SIZE 18 +#define SQLITE_FCNTL_TRACE 19 +#define SQLITE_FCNTL_HAS_MOVED 20 +#define SQLITE_FCNTL_SYNC 21 +#define SQLITE_FCNTL_COMMIT_PHASETWO 22 +#define SQLITE_FCNTL_WIN32_SET_HANDLE 23 +#define SQLITE_FCNTL_WAL_BLOCK 24 +#define SQLITE_FCNTL_ZIPVFS 25 +#define SQLITE_FCNTL_RBU 26 +#define SQLITE_FCNTL_VFS_POINTER 27 +#define SQLITE_FCNTL_JOURNAL_POINTER 28 +#define SQLITE_FCNTL_WIN32_GET_HANDLE 29 +#define SQLITE_FCNTL_PDB 30 +#define SQLITE_FCNTL_BEGIN_ATOMIC_WRITE 31 +#define SQLITE_FCNTL_COMMIT_ATOMIC_WRITE 32 +#define SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE 33 +#define SQLITE_FCNTL_LOCK_TIMEOUT 34 +#define SQLITE_FCNTL_DATA_VERSION 35 +#define SQLITE_FCNTL_SIZE_LIMIT 36 +#define SQLITE_FCNTL_CKPT_DONE 37 +#define SQLITE_FCNTL_RESERVE_BYTES 38 +#define SQLITE_FCNTL_CKPT_START 39 + +/* deprecated names */ +#define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE +#define SQLITE_SET_LOCKPROXYFILE SQLITE_FCNTL_SET_LOCKPROXYFILE +#define SQLITE_LAST_ERRNO SQLITE_FCNTL_LAST_ERRNO + + +/* +** CAPI3REF: Mutex Handle +** +** The mutex module within SQLite defines [sqlite3_mutex] to be an +** abstract type for a mutex object. The SQLite core never looks +** at the internal representation of an [sqlite3_mutex]. It only +** deals with pointers to the [sqlite3_mutex] object. +** +** Mutexes are created using [sqlite3_mutex_alloc()]. +*/ +typedef struct sqlite3_mutex sqlite3_mutex; + +/* +** CAPI3REF: Loadable Extension Thunk +** +** A pointer to the opaque sqlite3_api_routines structure is passed as +** the third parameter to entry points of [loadable extensions]. This +** structure must be typedefed in order to work around compiler warnings +** on some platforms. +*/ +typedef struct sqlite3_api_routines sqlite3_api_routines; + +/* +** CAPI3REF: OS Interface Object +** +** An instance of the sqlite3_vfs object defines the interface between +** the SQLite core and the underlying operating system. The "vfs" +** in the name of the object stands for "virtual file system". See +** the [VFS | VFS documentation] for further information. +** +** The VFS interface is sometimes extended by adding new methods onto +** the end. Each time such an extension occurs, the iVersion field +** is incremented. The iVersion value started out as 1 in +** SQLite [version 3.5.0] on [dateof:3.5.0], then increased to 2 +** with SQLite [version 3.7.0] on [dateof:3.7.0], and then increased +** to 3 with SQLite [version 3.7.6] on [dateof:3.7.6]. Additional fields +** may be appended to the sqlite3_vfs object and the iVersion value +** may increase again in future versions of SQLite. +** Note that due to an oversight, the structure +** of the sqlite3_vfs object changed in the transition from +** SQLite [version 3.5.9] to [version 3.6.0] on [dateof:3.6.0] +** and yet the iVersion field was not increased. +** +** The szOsFile field is the size of the subclassed [sqlite3_file] +** structure used by this VFS. mxPathname is the maximum length of +** a pathname in this VFS. +** +** Registered sqlite3_vfs objects are kept on a linked list formed by +** the pNext pointer. The [sqlite3_vfs_register()] +** and [sqlite3_vfs_unregister()] interfaces manage this list +** in a thread-safe way. The [sqlite3_vfs_find()] interface +** searches the list. Neither the application code nor the VFS +** implementation should use the pNext pointer. +** +** The pNext field is the only field in the sqlite3_vfs +** structure that SQLite will ever modify. SQLite will only access +** or modify this field while holding a particular static mutex. +** The application should never modify anything within the sqlite3_vfs +** object once the object has been registered. +** +** The zName field holds the name of the VFS module. The name must +** be unique across all VFS modules. +** +** [[sqlite3_vfs.xOpen]] +** ^SQLite guarantees that the zFilename parameter to xOpen +** is either a NULL pointer or string obtained +** from xFullPathname() with an optional suffix added. +** ^If a suffix is added to the zFilename parameter, it will +** consist of a single "-" character followed by no more than +** 11 alphanumeric and/or "-" characters. +** ^SQLite further guarantees that +** the string will be valid and unchanged until xClose() is +** called. Because of the previous sentence, +** the [sqlite3_file] can safely store a pointer to the +** filename if it needs to remember the filename for some reason. +** If the zFilename parameter to xOpen is a NULL pointer then xOpen +** must invent its own temporary name for the file. ^Whenever the +** xFilename parameter is NULL it will also be the case that the +** flags parameter will include [SQLITE_OPEN_DELETEONCLOSE]. +** +** The flags argument to xOpen() includes all bits set in +** the flags argument to [sqlite3_open_v2()]. Or if [sqlite3_open()] +** or [sqlite3_open16()] is used, then flags includes at least +** [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]. +** If xOpen() opens a file read-only then it sets *pOutFlags to +** include [SQLITE_OPEN_READONLY]. Other bits in *pOutFlags may be set. +** +** ^(SQLite will also add one of the following flags to the xOpen() +** call, depending on the object being opened: +** +**
    +**
  • [SQLITE_OPEN_MAIN_DB] +**
  • [SQLITE_OPEN_MAIN_JOURNAL] +**
  • [SQLITE_OPEN_TEMP_DB] +**
  • [SQLITE_OPEN_TEMP_JOURNAL] +**
  • [SQLITE_OPEN_TRANSIENT_DB] +**
  • [SQLITE_OPEN_SUBJOURNAL] +**
  • [SQLITE_OPEN_MASTER_JOURNAL] +**
  • [SQLITE_OPEN_WAL] +**
)^ +** +** The file I/O implementation can use the object type flags to +** change the way it deals with files. For example, an application +** that does not care about crash recovery or rollback might make +** the open of a journal file a no-op. Writes to this journal would +** also be no-ops, and any attempt to read the journal would return +** SQLITE_IOERR. Or the implementation might recognize that a database +** file will be doing page-aligned sector reads and writes in a random +** order and set up its I/O subsystem accordingly. +** +** SQLite might also add one of the following flags to the xOpen method: +** +**
    +**
  • [SQLITE_OPEN_DELETEONCLOSE] +**
  • [SQLITE_OPEN_EXCLUSIVE] +**
+** +** The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be +** deleted when it is closed. ^The [SQLITE_OPEN_DELETEONCLOSE] +** will be set for TEMP databases and their journals, transient +** databases, and subjournals. +** +** ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction +** with the [SQLITE_OPEN_CREATE] flag, which are both directly +** analogous to the O_EXCL and O_CREAT flags of the POSIX open() +** API. The SQLITE_OPEN_EXCLUSIVE flag, when paired with the +** SQLITE_OPEN_CREATE, is used to indicate that file should always +** be created, and that it is an error if it already exists. +** It is not used to indicate the file should be opened +** for exclusive access. +** +** ^At least szOsFile bytes of memory are allocated by SQLite +** to hold the [sqlite3_file] structure passed as the third +** argument to xOpen. The xOpen method does not have to +** allocate the structure; it should just fill it in. Note that +** the xOpen method must set the sqlite3_file.pMethods to either +** a valid [sqlite3_io_methods] object or to NULL. xOpen must do +** this even if the open fails. SQLite expects that the sqlite3_file.pMethods +** element will be valid after xOpen returns regardless of the success +** or failure of the xOpen call. +** +** [[sqlite3_vfs.xAccess]] +** ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS] +** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to +** test whether a file is readable and writable, or [SQLITE_ACCESS_READ] +** to test whether a file is at least readable. The SQLITE_ACCESS_READ +** flag is never actually used and is not implemented in the built-in +** VFSes of SQLite. The file is named by the second argument and can be a +** directory. The xAccess method returns [SQLITE_OK] on success or some +** non-zero error code if there is an I/O error or if the name of +** the file given in the second argument is illegal. If SQLITE_OK +** is returned, then non-zero or zero is written into *pResOut to indicate +** whether or not the file is accessible. +** +** ^SQLite will always allocate at least mxPathname+1 bytes for the +** output buffer xFullPathname. The exact size of the output buffer +** is also passed as a parameter to both methods. If the output buffer +** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is +** handled as a fatal error by SQLite, vfs implementations should endeavor +** to prevent this by setting mxPathname to a sufficiently large value. +** +** The xRandomness(), xSleep(), xCurrentTime(), and xCurrentTimeInt64() +** interfaces are not strictly a part of the filesystem, but they are +** included in the VFS structure for completeness. +** The xRandomness() function attempts to return nBytes bytes +** of good-quality randomness into zOut. The return value is +** the actual number of bytes of randomness obtained. +** The xSleep() method causes the calling thread to sleep for at +** least the number of microseconds given. ^The xCurrentTime() +** method returns a Julian Day Number for the current date and time as +** a floating point value. +** ^The xCurrentTimeInt64() method returns, as an integer, the Julian +** Day Number multiplied by 86400000 (the number of milliseconds in +** a 24-hour day). +** ^SQLite will use the xCurrentTimeInt64() method to get the current +** date and time if that method is available (if iVersion is 2 or +** greater and the function pointer is not NULL) and will fall back +** to xCurrentTime() if xCurrentTimeInt64() is unavailable. +** +** ^The xSetSystemCall(), xGetSystemCall(), and xNestSystemCall() interfaces +** are not used by the SQLite core. These optional interfaces are provided +** by some VFSes to facilitate testing of the VFS code. By overriding +** system calls with functions under its control, a test program can +** simulate faults and error conditions that would otherwise be difficult +** or impossible to induce. The set of system calls that can be overridden +** varies from one VFS to another, and from one version of the same VFS to the +** next. Applications that use these interfaces must be prepared for any +** or all of these interfaces to be NULL or for their behavior to change +** from one release to the next. Applications must not attempt to access +** any of these methods if the iVersion of the VFS is less than 3. +*/ +typedef struct sqlite3_vfs sqlite3_vfs; +typedef void (*sqlite3_syscall_ptr)(void); +struct sqlite3_vfs { + int iVersion; /* Structure version number (currently 3) */ + int szOsFile; /* Size of subclassed sqlite3_file */ + int mxPathname; /* Maximum file pathname length */ + sqlite3_vfs *pNext; /* Next registered VFS */ + const char *zName; /* Name of this virtual file system */ + void *pAppData; /* Pointer to application-specific data */ + int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*, + int flags, int *pOutFlags); + int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir); + int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut); + int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut); + void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename); + void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg); + void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void); + void (*xDlClose)(sqlite3_vfs*, void*); + int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut); + int (*xSleep)(sqlite3_vfs*, int microseconds); + int (*xCurrentTime)(sqlite3_vfs*, double*); + int (*xGetLastError)(sqlite3_vfs*, int, char *); + /* + ** The methods above are in version 1 of the sqlite_vfs object + ** definition. Those that follow are added in version 2 or later + */ + int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*); + /* + ** The methods above are in versions 1 and 2 of the sqlite_vfs object. + ** Those below are for version 3 and greater. + */ + int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr); + sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName); + const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName); + /* + ** The methods above are in versions 1 through 3 of the sqlite_vfs object. + ** New fields may be appended in future versions. The iVersion + ** value will increment whenever this happens. + */ +}; + +/* +** CAPI3REF: Flags for the xAccess VFS method +** +** These integer constants can be used as the third parameter to +** the xAccess method of an [sqlite3_vfs] object. They determine +** what kind of permissions the xAccess method is looking for. +** With SQLITE_ACCESS_EXISTS, the xAccess method +** simply checks whether the file exists. +** With SQLITE_ACCESS_READWRITE, the xAccess method +** checks whether the named directory is both readable and writable +** (in other words, if files can be added, removed, and renamed within +** the directory). +** The SQLITE_ACCESS_READWRITE constant is currently used only by the +** [temp_store_directory pragma], though this could change in a future +** release of SQLite. +** With SQLITE_ACCESS_READ, the xAccess method +** checks whether the file is readable. The SQLITE_ACCESS_READ constant is +** currently unused, though it might be used in a future release of +** SQLite. +*/ +#define SQLITE_ACCESS_EXISTS 0 +#define SQLITE_ACCESS_READWRITE 1 /* Used by PRAGMA temp_store_directory */ +#define SQLITE_ACCESS_READ 2 /* Unused */ + +/* +** CAPI3REF: Flags for the xShmLock VFS method +** +** These integer constants define the various locking operations +** allowed by the xShmLock method of [sqlite3_io_methods]. The +** following are the only legal combinations of flags to the +** xShmLock method: +** +**
    +**
  • SQLITE_SHM_LOCK | SQLITE_SHM_SHARED +**
  • SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE +**
  • SQLITE_SHM_UNLOCK | SQLITE_SHM_SHARED +**
  • SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE +**
+** +** When unlocking, the same SHARED or EXCLUSIVE flag must be supplied as +** was given on the corresponding lock. +** +** The xShmLock method can transition between unlocked and SHARED or +** between unlocked and EXCLUSIVE. It cannot transition between SHARED +** and EXCLUSIVE. +*/ +#define SQLITE_SHM_UNLOCK 1 +#define SQLITE_SHM_LOCK 2 +#define SQLITE_SHM_SHARED 4 +#define SQLITE_SHM_EXCLUSIVE 8 + +/* +** CAPI3REF: Maximum xShmLock index +** +** The xShmLock method on [sqlite3_io_methods] may use values +** between 0 and this upper bound as its "offset" argument. +** The SQLite core will never attempt to acquire or release a +** lock outside of this range +*/ +#define SQLITE_SHM_NLOCK 8 + + +/* +** CAPI3REF: Initialize The SQLite Library +** +** ^The sqlite3_initialize() routine initializes the +** SQLite library. ^The sqlite3_shutdown() routine +** deallocates any resources that were allocated by sqlite3_initialize(). +** These routines are designed to aid in process initialization and +** shutdown on embedded systems. Workstation applications using +** SQLite normally do not need to invoke either of these routines. +** +** A call to sqlite3_initialize() is an "effective" call if it is +** the first time sqlite3_initialize() is invoked during the lifetime of +** the process, or if it is the first time sqlite3_initialize() is invoked +** following a call to sqlite3_shutdown(). ^(Only an effective call +** of sqlite3_initialize() does any initialization. All other calls +** are harmless no-ops.)^ +** +** A call to sqlite3_shutdown() is an "effective" call if it is the first +** call to sqlite3_shutdown() since the last sqlite3_initialize(). ^(Only +** an effective call to sqlite3_shutdown() does any deinitialization. +** All other valid calls to sqlite3_shutdown() are harmless no-ops.)^ +** +** The sqlite3_initialize() interface is threadsafe, but sqlite3_shutdown() +** is not. The sqlite3_shutdown() interface must only be called from a +** single thread. All open [database connections] must be closed and all +** other SQLite resources must be deallocated prior to invoking +** sqlite3_shutdown(). +** +** Among other things, ^sqlite3_initialize() will invoke +** sqlite3_os_init(). Similarly, ^sqlite3_shutdown() +** will invoke sqlite3_os_end(). +** +** ^The sqlite3_initialize() routine returns [SQLITE_OK] on success. +** ^If for some reason, sqlite3_initialize() is unable to initialize +** the library (perhaps it is unable to allocate a needed resource such +** as a mutex) it returns an [error code] other than [SQLITE_OK]. +** +** ^The sqlite3_initialize() routine is called internally by many other +** SQLite interfaces so that an application usually does not need to +** invoke sqlite3_initialize() directly. For example, [sqlite3_open()] +** calls sqlite3_initialize() so the SQLite library will be automatically +** initialized when [sqlite3_open()] is called if it has not be initialized +** already. ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT] +** compile-time option, then the automatic calls to sqlite3_initialize() +** are omitted and the application must call sqlite3_initialize() directly +** prior to using any other SQLite interface. For maximum portability, +** it is recommended that applications always invoke sqlite3_initialize() +** directly prior to using any other SQLite interface. Future releases +** of SQLite may require this. In other words, the behavior exhibited +** when SQLite is compiled with [SQLITE_OMIT_AUTOINIT] might become the +** default behavior in some future release of SQLite. +** +** The sqlite3_os_init() routine does operating-system specific +** initialization of the SQLite library. The sqlite3_os_end() +** routine undoes the effect of sqlite3_os_init(). Typical tasks +** performed by these routines include allocation or deallocation +** of static resources, initialization of global variables, +** setting up a default [sqlite3_vfs] module, or setting up +** a default configuration using [sqlite3_config()]. +** +** The application should never invoke either sqlite3_os_init() +** or sqlite3_os_end() directly. The application should only invoke +** sqlite3_initialize() and sqlite3_shutdown(). The sqlite3_os_init() +** interface is called automatically by sqlite3_initialize() and +** sqlite3_os_end() is called by sqlite3_shutdown(). Appropriate +** implementations for sqlite3_os_init() and sqlite3_os_end() +** are built into SQLite when it is compiled for Unix, Windows, or OS/2. +** When [custom builds | built for other platforms] +** (using the [SQLITE_OS_OTHER=1] compile-time +** option) the application must supply a suitable implementation for +** sqlite3_os_init() and sqlite3_os_end(). An application-supplied +** implementation of sqlite3_os_init() or sqlite3_os_end() +** must return [SQLITE_OK] on success and some other [error code] upon +** failure. +*/ +SQLITE_API int sqlite3_initialize(void); +SQLITE_API int sqlite3_shutdown(void); +SQLITE_API int sqlite3_os_init(void); +SQLITE_API int sqlite3_os_end(void); + +/* +** CAPI3REF: Configuring The SQLite Library +** +** The sqlite3_config() interface is used to make global configuration +** changes to SQLite in order to tune SQLite to the specific needs of +** the application. The default configuration is recommended for most +** applications and so this routine is usually not necessary. It is +** provided to support rare applications with unusual needs. +** +** The sqlite3_config() interface is not threadsafe. The application +** must ensure that no other SQLite interfaces are invoked by other +** threads while sqlite3_config() is running. +** +** The sqlite3_config() interface +** may only be invoked prior to library initialization using +** [sqlite3_initialize()] or after shutdown by [sqlite3_shutdown()]. +** ^If sqlite3_config() is called after [sqlite3_initialize()] and before +** [sqlite3_shutdown()] then it will return SQLITE_MISUSE. +** Note, however, that ^sqlite3_config() can be called as part of the +** implementation of an application-defined [sqlite3_os_init()]. +** +** The first argument to sqlite3_config() is an integer +** [configuration option] that determines +** what property of SQLite is to be configured. Subsequent arguments +** vary depending on the [configuration option] +** in the first argument. +** +** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK]. +** ^If the option is unknown or SQLite is unable to set the option +** then this routine returns a non-zero [error code]. +*/ +SQLITE_API int sqlite3_config(int, ...); + +/* +** CAPI3REF: Configure database connections +** METHOD: sqlite3 +** +** The sqlite3_db_config() interface is used to make configuration +** changes to a [database connection]. The interface is similar to +** [sqlite3_config()] except that the changes apply to a single +** [database connection] (specified in the first argument). +** +** The second argument to sqlite3_db_config(D,V,...) is the +** [SQLITE_DBCONFIG_LOOKASIDE | configuration verb] - an integer code +** that indicates what aspect of the [database connection] is being configured. +** Subsequent arguments vary depending on the configuration verb. +** +** ^Calls to sqlite3_db_config() return SQLITE_OK if and only if +** the call is considered successful. +*/ +SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...); + +/* +** CAPI3REF: Memory Allocation Routines +** +** An instance of this object defines the interface between SQLite +** and low-level memory allocation routines. +** +** This object is used in only one place in the SQLite interface. +** A pointer to an instance of this object is the argument to +** [sqlite3_config()] when the configuration option is +** [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC]. +** By creating an instance of this object +** and passing it to [sqlite3_config]([SQLITE_CONFIG_MALLOC]) +** during configuration, an application can specify an alternative +** memory allocation subsystem for SQLite to use for all of its +** dynamic memory needs. +** +** Note that SQLite comes with several [built-in memory allocators] +** that are perfectly adequate for the overwhelming majority of applications +** and that this object is only useful to a tiny minority of applications +** with specialized memory allocation requirements. This object is +** also used during testing of SQLite in order to specify an alternative +** memory allocator that simulates memory out-of-memory conditions in +** order to verify that SQLite recovers gracefully from such +** conditions. +** +** The xMalloc, xRealloc, and xFree methods must work like the +** malloc(), realloc() and free() functions from the standard C library. +** ^SQLite guarantees that the second argument to +** xRealloc is always a value returned by a prior call to xRoundup. +** +** xSize should return the allocated size of a memory allocation +** previously obtained from xMalloc or xRealloc. The allocated size +** is always at least as big as the requested size but may be larger. +** +** The xRoundup method returns what would be the allocated size of +** a memory allocation given a particular requested size. Most memory +** allocators round up memory allocations at least to the next multiple +** of 8. Some allocators round up to a larger multiple or to a power of 2. +** Every memory allocation request coming in through [sqlite3_malloc()] +** or [sqlite3_realloc()] first calls xRoundup. If xRoundup returns 0, +** that causes the corresponding memory allocation to fail. +** +** The xInit method initializes the memory allocator. For example, +** it might allocate any required mutexes or initialize internal data +** structures. The xShutdown method is invoked (indirectly) by +** [sqlite3_shutdown()] and should deallocate any resources acquired +** by xInit. The pAppData pointer is used as the only parameter to +** xInit and xShutdown. +** +** SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes +** the xInit method, so the xInit method need not be threadsafe. The +** xShutdown method is only called from [sqlite3_shutdown()] so it does +** not need to be threadsafe either. For all other methods, SQLite +** holds the [SQLITE_MUTEX_STATIC_MEM] mutex as long as the +** [SQLITE_CONFIG_MEMSTATUS] configuration option is turned on (which +** it is by default) and so the methods are automatically serialized. +** However, if [SQLITE_CONFIG_MEMSTATUS] is disabled, then the other +** methods must be threadsafe or else make their own arrangements for +** serialization. +** +** SQLite will never invoke xInit() more than once without an intervening +** call to xShutdown(). +*/ +typedef struct sqlite3_mem_methods sqlite3_mem_methods; +struct sqlite3_mem_methods { + void *(*xMalloc)(int); /* Memory allocation function */ + void (*xFree)(void*); /* Free a prior allocation */ + void *(*xRealloc)(void*,int); /* Resize an allocation */ + int (*xSize)(void*); /* Return the size of an allocation */ + int (*xRoundup)(int); /* Round up request size to allocation size */ + int (*xInit)(void*); /* Initialize the memory allocator */ + void (*xShutdown)(void*); /* Deinitialize the memory allocator */ + void *pAppData; /* Argument to xInit() and xShutdown() */ +}; + +/* +** CAPI3REF: Configuration Options +** KEYWORDS: {configuration option} +** +** These constants are the available integer configuration options that +** can be passed as the first argument to the [sqlite3_config()] interface. +** +** New configuration options may be added in future releases of SQLite. +** Existing configuration options might be discontinued. Applications +** should check the return code from [sqlite3_config()] to make sure that +** the call worked. The [sqlite3_config()] interface will return a +** non-zero [error code] if a discontinued or unsupported configuration option +** is invoked. +** +**
+** [[SQLITE_CONFIG_SINGLETHREAD]]
SQLITE_CONFIG_SINGLETHREAD
+**
There are no arguments to this option. ^This option sets the +** [threading mode] to Single-thread. In other words, it disables +** all mutexing and puts SQLite into a mode where it can only be used +** by a single thread. ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** it is not possible to change the [threading mode] from its default +** value of Single-thread and so [sqlite3_config()] will return +** [SQLITE_ERROR] if called with the SQLITE_CONFIG_SINGLETHREAD +** configuration option.
+** +** [[SQLITE_CONFIG_MULTITHREAD]]
SQLITE_CONFIG_MULTITHREAD
+**
There are no arguments to this option. ^This option sets the +** [threading mode] to Multi-thread. In other words, it disables +** mutexing on [database connection] and [prepared statement] objects. +** The application is responsible for serializing access to +** [database connections] and [prepared statements]. But other mutexes +** are enabled so that SQLite will be safe to use in a multi-threaded +** environment as long as no two threads attempt to use the same +** [database connection] at the same time. ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** it is not possible to set the Multi-thread [threading mode] and +** [sqlite3_config()] will return [SQLITE_ERROR] if called with the +** SQLITE_CONFIG_MULTITHREAD configuration option.
+** +** [[SQLITE_CONFIG_SERIALIZED]]
SQLITE_CONFIG_SERIALIZED
+**
There are no arguments to this option. ^This option sets the +** [threading mode] to Serialized. In other words, this option enables +** all mutexes including the recursive +** mutexes on [database connection] and [prepared statement] objects. +** In this mode (which is the default when SQLite is compiled with +** [SQLITE_THREADSAFE=1]) the SQLite library will itself serialize access +** to [database connections] and [prepared statements] so that the +** application is free to use the same [database connection] or the +** same [prepared statement] in different threads at the same time. +** ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** it is not possible to set the Serialized [threading mode] and +** [sqlite3_config()] will return [SQLITE_ERROR] if called with the +** SQLITE_CONFIG_SERIALIZED configuration option.
+** +** [[SQLITE_CONFIG_MALLOC]]
SQLITE_CONFIG_MALLOC
+**
^(The SQLITE_CONFIG_MALLOC option takes a single argument which is +** a pointer to an instance of the [sqlite3_mem_methods] structure. +** The argument specifies +** alternative low-level memory allocation routines to be used in place of +** the memory allocation routines built into SQLite.)^ ^SQLite makes +** its own private copy of the content of the [sqlite3_mem_methods] structure +** before the [sqlite3_config()] call returns.
+** +** [[SQLITE_CONFIG_GETMALLOC]]
SQLITE_CONFIG_GETMALLOC
+**
^(The SQLITE_CONFIG_GETMALLOC option takes a single argument which +** is a pointer to an instance of the [sqlite3_mem_methods] structure. +** The [sqlite3_mem_methods] +** structure is filled with the currently defined memory allocation routines.)^ +** This option can be used to overload the default memory allocation +** routines with a wrapper that simulations memory allocation failure or +** tracks memory usage, for example.
+** +** [[SQLITE_CONFIG_SMALL_MALLOC]]
SQLITE_CONFIG_SMALL_MALLOC
+**
^The SQLITE_CONFIG_SMALL_MALLOC option takes single argument of +** type int, interpreted as a boolean, which if true provides a hint to +** SQLite that it should avoid large memory allocations if possible. +** SQLite will run faster if it is free to make large memory allocations, +** but some application might prefer to run slower in exchange for +** guarantees about memory fragmentation that are possible if large +** allocations are avoided. This hint is normally off. +**
+** +** [[SQLITE_CONFIG_MEMSTATUS]]
SQLITE_CONFIG_MEMSTATUS
+**
^The SQLITE_CONFIG_MEMSTATUS option takes single argument of type int, +** interpreted as a boolean, which enables or disables the collection of +** memory allocation statistics. ^(When memory allocation statistics are +** disabled, the following SQLite interfaces become non-operational: +**
    +**
  • [sqlite3_hard_heap_limit64()] +**
  • [sqlite3_memory_used()] +**
  • [sqlite3_memory_highwater()] +**
  • [sqlite3_soft_heap_limit64()] +**
  • [sqlite3_status64()] +**
)^ +** ^Memory allocation statistics are enabled by default unless SQLite is +** compiled with [SQLITE_DEFAULT_MEMSTATUS]=0 in which case memory +** allocation statistics are disabled by default. +**
+** +** [[SQLITE_CONFIG_SCRATCH]]
SQLITE_CONFIG_SCRATCH
+**
The SQLITE_CONFIG_SCRATCH option is no longer used. +**
+** +** [[SQLITE_CONFIG_PAGECACHE]]
SQLITE_CONFIG_PAGECACHE
+**
^The SQLITE_CONFIG_PAGECACHE option specifies a memory pool +** that SQLite can use for the database page cache with the default page +** cache implementation. +** This configuration option is a no-op if an application-defined page +** cache implementation is loaded using the [SQLITE_CONFIG_PCACHE2]. +** ^There are three arguments to SQLITE_CONFIG_PAGECACHE: A pointer to +** 8-byte aligned memory (pMem), the size of each page cache line (sz), +** and the number of cache lines (N). +** The sz argument should be the size of the largest database page +** (a power of two between 512 and 65536) plus some extra bytes for each +** page header. ^The number of extra bytes needed by the page header +** can be determined using [SQLITE_CONFIG_PCACHE_HDRSZ]. +** ^It is harmless, apart from the wasted memory, +** for the sz parameter to be larger than necessary. The pMem +** argument must be either a NULL pointer or a pointer to an 8-byte +** aligned block of memory of at least sz*N bytes, otherwise +** subsequent behavior is undefined. +** ^When pMem is not NULL, SQLite will strive to use the memory provided +** to satisfy page cache needs, falling back to [sqlite3_malloc()] if +** a page cache line is larger than sz bytes or if all of the pMem buffer +** is exhausted. +** ^If pMem is NULL and N is non-zero, then each database connection +** does an initial bulk allocation for page cache memory +** from [sqlite3_malloc()] sufficient for N cache lines if N is positive or +** of -1024*N bytes if N is negative, . ^If additional +** page cache memory is needed beyond what is provided by the initial +** allocation, then SQLite goes to [sqlite3_malloc()] separately for each +** additional cache line.
+** +** [[SQLITE_CONFIG_HEAP]]
SQLITE_CONFIG_HEAP
+**
^The SQLITE_CONFIG_HEAP option specifies a static memory buffer +** that SQLite will use for all of its dynamic memory allocation needs +** beyond those provided for by [SQLITE_CONFIG_PAGECACHE]. +** ^The SQLITE_CONFIG_HEAP option is only available if SQLite is compiled +** with either [SQLITE_ENABLE_MEMSYS3] or [SQLITE_ENABLE_MEMSYS5] and returns +** [SQLITE_ERROR] if invoked otherwise. +** ^There are three arguments to SQLITE_CONFIG_HEAP: +** An 8-byte aligned pointer to the memory, +** the number of bytes in the memory buffer, and the minimum allocation size. +** ^If the first pointer (the memory pointer) is NULL, then SQLite reverts +** to using its default memory allocator (the system malloc() implementation), +** undoing any prior invocation of [SQLITE_CONFIG_MALLOC]. ^If the +** memory pointer is not NULL then the alternative memory +** allocator is engaged to handle all of SQLites memory allocation needs. +** The first pointer (the memory pointer) must be aligned to an 8-byte +** boundary or subsequent behavior of SQLite will be undefined. +** The minimum allocation size is capped at 2**12. Reasonable values +** for the minimum allocation size are 2**5 through 2**8.
+** +** [[SQLITE_CONFIG_MUTEX]]
SQLITE_CONFIG_MUTEX
+**
^(The SQLITE_CONFIG_MUTEX option takes a single argument which is a +** pointer to an instance of the [sqlite3_mutex_methods] structure. +** The argument specifies alternative low-level mutex routines to be used +** in place the mutex routines built into SQLite.)^ ^SQLite makes a copy of +** the content of the [sqlite3_mutex_methods] structure before the call to +** [sqlite3_config()] returns. ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** the entire mutexing subsystem is omitted from the build and hence calls to +** [sqlite3_config()] with the SQLITE_CONFIG_MUTEX configuration option will +** return [SQLITE_ERROR].
+** +** [[SQLITE_CONFIG_GETMUTEX]]
SQLITE_CONFIG_GETMUTEX
+**
^(The SQLITE_CONFIG_GETMUTEX option takes a single argument which +** is a pointer to an instance of the [sqlite3_mutex_methods] structure. The +** [sqlite3_mutex_methods] +** structure is filled with the currently defined mutex routines.)^ +** This option can be used to overload the default mutex allocation +** routines with a wrapper used to track mutex usage for performance +** profiling or testing, for example. ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** the entire mutexing subsystem is omitted from the build and hence calls to +** [sqlite3_config()] with the SQLITE_CONFIG_GETMUTEX configuration option will +** return [SQLITE_ERROR].
+** +** [[SQLITE_CONFIG_LOOKASIDE]]
SQLITE_CONFIG_LOOKASIDE
+**
^(The SQLITE_CONFIG_LOOKASIDE option takes two arguments that determine +** the default size of lookaside memory on each [database connection]. +** The first argument is the +** size of each lookaside buffer slot and the second is the number of +** slots allocated to each database connection.)^ ^(SQLITE_CONFIG_LOOKASIDE +** sets the default lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE] +** option to [sqlite3_db_config()] can be used to change the lookaside +** configuration on individual connections.)^
+** +** [[SQLITE_CONFIG_PCACHE2]]
SQLITE_CONFIG_PCACHE2
+**
^(The SQLITE_CONFIG_PCACHE2 option takes a single argument which is +** a pointer to an [sqlite3_pcache_methods2] object. This object specifies +** the interface to a custom page cache implementation.)^ +** ^SQLite makes a copy of the [sqlite3_pcache_methods2] object.
+** +** [[SQLITE_CONFIG_GETPCACHE2]]
SQLITE_CONFIG_GETPCACHE2
+**
^(The SQLITE_CONFIG_GETPCACHE2 option takes a single argument which +** is a pointer to an [sqlite3_pcache_methods2] object. SQLite copies of +** the current page cache implementation into that object.)^
+** +** [[SQLITE_CONFIG_LOG]]
SQLITE_CONFIG_LOG
+**
The SQLITE_CONFIG_LOG option is used to configure the SQLite +** global [error log]. +** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a +** function with a call signature of void(*)(void*,int,const char*), +** and a pointer to void. ^If the function pointer is not NULL, it is +** invoked by [sqlite3_log()] to process each logging event. ^If the +** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op. +** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is +** passed through as the first parameter to the application-defined logger +** function whenever that function is invoked. ^The second parameter to +** the logger function is a copy of the first parameter to the corresponding +** [sqlite3_log()] call and is intended to be a [result code] or an +** [extended result code]. ^The third parameter passed to the logger is +** log message after formatting via [sqlite3_snprintf()]. +** The SQLite logging interface is not reentrant; the logger function +** supplied by the application must not invoke any SQLite interface. +** In a multi-threaded application, the application-defined logger +** function must be threadsafe.
+** +** [[SQLITE_CONFIG_URI]]
SQLITE_CONFIG_URI +**
^(The SQLITE_CONFIG_URI option takes a single argument of type int. +** If non-zero, then URI handling is globally enabled. If the parameter is zero, +** then URI handling is globally disabled.)^ ^If URI handling is globally +** enabled, all filenames passed to [sqlite3_open()], [sqlite3_open_v2()], +** [sqlite3_open16()] or +** specified as part of [ATTACH] commands are interpreted as URIs, regardless +** of whether or not the [SQLITE_OPEN_URI] flag is set when the database +** connection is opened. ^If it is globally disabled, filenames are +** only interpreted as URIs if the SQLITE_OPEN_URI flag is set when the +** database connection is opened. ^(By default, URI handling is globally +** disabled. The default value may be changed by compiling with the +** [SQLITE_USE_URI] symbol defined.)^ +** +** [[SQLITE_CONFIG_COVERING_INDEX_SCAN]]
SQLITE_CONFIG_COVERING_INDEX_SCAN +**
^The SQLITE_CONFIG_COVERING_INDEX_SCAN option takes a single integer +** argument which is interpreted as a boolean in order to enable or disable +** the use of covering indices for full table scans in the query optimizer. +** ^The default setting is determined +** by the [SQLITE_ALLOW_COVERING_INDEX_SCAN] compile-time option, or is "on" +** if that compile-time option is omitted. +** The ability to disable the use of covering indices for full table scans +** is because some incorrectly coded legacy applications might malfunction +** when the optimization is enabled. Providing the ability to +** disable the optimization allows the older, buggy application code to work +** without change even with newer versions of SQLite. +** +** [[SQLITE_CONFIG_PCACHE]] [[SQLITE_CONFIG_GETPCACHE]] +**
SQLITE_CONFIG_PCACHE and SQLITE_CONFIG_GETPCACHE +**
These options are obsolete and should not be used by new code. +** They are retained for backwards compatibility but are now no-ops. +**
+** +** [[SQLITE_CONFIG_SQLLOG]] +**
SQLITE_CONFIG_SQLLOG +**
This option is only available if sqlite is compiled with the +** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should +** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int). +** The second should be of type (void*). The callback is invoked by the library +** in three separate circumstances, identified by the value passed as the +** fourth parameter. If the fourth parameter is 0, then the database connection +** passed as the second argument has just been opened. The third argument +** points to a buffer containing the name of the main database file. If the +** fourth parameter is 1, then the SQL statement that the third parameter +** points to has just been executed. Or, if the fourth parameter is 2, then +** the connection being passed as the second parameter is being closed. The +** third parameter is passed NULL In this case. An example of using this +** configuration option can be seen in the "test_sqllog.c" source file in +** the canonical SQLite source tree.
+** +** [[SQLITE_CONFIG_MMAP_SIZE]] +**
SQLITE_CONFIG_MMAP_SIZE +**
^SQLITE_CONFIG_MMAP_SIZE takes two 64-bit integer (sqlite3_int64) values +** that are the default mmap size limit (the default setting for +** [PRAGMA mmap_size]) and the maximum allowed mmap size limit. +** ^The default setting can be overridden by each database connection using +** either the [PRAGMA mmap_size] command, or by using the +** [SQLITE_FCNTL_MMAP_SIZE] file control. ^(The maximum allowed mmap size +** will be silently truncated if necessary so that it does not exceed the +** compile-time maximum mmap size set by the +** [SQLITE_MAX_MMAP_SIZE] compile-time option.)^ +** ^If either argument to this option is negative, then that argument is +** changed to its compile-time default. +** +** [[SQLITE_CONFIG_WIN32_HEAPSIZE]] +**
SQLITE_CONFIG_WIN32_HEAPSIZE +**
^The SQLITE_CONFIG_WIN32_HEAPSIZE option is only available if SQLite is +** compiled for Windows with the [SQLITE_WIN32_MALLOC] pre-processor macro +** defined. ^SQLITE_CONFIG_WIN32_HEAPSIZE takes a 32-bit unsigned integer value +** that specifies the maximum size of the created heap. +** +** [[SQLITE_CONFIG_PCACHE_HDRSZ]] +**
SQLITE_CONFIG_PCACHE_HDRSZ +**
^The SQLITE_CONFIG_PCACHE_HDRSZ option takes a single parameter which +** is a pointer to an integer and writes into that integer the number of extra +** bytes per page required for each page in [SQLITE_CONFIG_PAGECACHE]. +** The amount of extra space required can change depending on the compiler, +** target platform, and SQLite version. +** +** [[SQLITE_CONFIG_PMASZ]] +**
SQLITE_CONFIG_PMASZ +**
^The SQLITE_CONFIG_PMASZ option takes a single parameter which +** is an unsigned integer and sets the "Minimum PMA Size" for the multithreaded +** sorter to that integer. The default minimum PMA Size is set by the +** [SQLITE_SORTER_PMASZ] compile-time option. New threads are launched +** to help with sort operations when multithreaded sorting +** is enabled (using the [PRAGMA threads] command) and the amount of content +** to be sorted exceeds the page size times the minimum of the +** [PRAGMA cache_size] setting and this value. +** +** [[SQLITE_CONFIG_STMTJRNL_SPILL]] +**
SQLITE_CONFIG_STMTJRNL_SPILL +**
^The SQLITE_CONFIG_STMTJRNL_SPILL option takes a single parameter which +** becomes the [statement journal] spill-to-disk threshold. +** [Statement journals] are held in memory until their size (in bytes) +** exceeds this threshold, at which point they are written to disk. +** Or if the threshold is -1, statement journals are always held +** exclusively in memory. +** Since many statement journals never become large, setting the spill +** threshold to a value such as 64KiB can greatly reduce the amount of +** I/O required to support statement rollback. +** The default value for this setting is controlled by the +** [SQLITE_STMTJRNL_SPILL] compile-time option. +** +** [[SQLITE_CONFIG_SORTERREF_SIZE]] +**
SQLITE_CONFIG_SORTERREF_SIZE +**
The SQLITE_CONFIG_SORTERREF_SIZE option accepts a single parameter +** of type (int) - the new value of the sorter-reference size threshold. +** Usually, when SQLite uses an external sort to order records according +** to an ORDER BY clause, all fields required by the caller are present in the +** sorted records. However, if SQLite determines based on the declared type +** of a table column that its values are likely to be very large - larger +** than the configured sorter-reference size threshold - then a reference +** is stored in each sorted record and the required column values loaded +** from the database as records are returned in sorted order. The default +** value for this option is to never use this optimization. Specifying a +** negative value for this option restores the default behaviour. +** This option is only available if SQLite is compiled with the +** [SQLITE_ENABLE_SORTER_REFERENCES] compile-time option. +** +** [[SQLITE_CONFIG_MEMDB_MAXSIZE]] +**
SQLITE_CONFIG_MEMDB_MAXSIZE +**
The SQLITE_CONFIG_MEMDB_MAXSIZE option accepts a single parameter +** [sqlite3_int64] parameter which is the default maximum size for an in-memory +** database created using [sqlite3_deserialize()]. This default maximum +** size can be adjusted up or down for individual databases using the +** [SQLITE_FCNTL_SIZE_LIMIT] [sqlite3_file_control|file-control]. If this +** configuration setting is never used, then the default maximum is determined +** by the [SQLITE_MEMDB_DEFAULT_MAXSIZE] compile-time option. If that +** compile-time option is not set, then the default maximum is 1073741824. +**
+*/ +#define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */ +#define SQLITE_CONFIG_MULTITHREAD 2 /* nil */ +#define SQLITE_CONFIG_SERIALIZED 3 /* nil */ +#define SQLITE_CONFIG_MALLOC 4 /* sqlite3_mem_methods* */ +#define SQLITE_CONFIG_GETMALLOC 5 /* sqlite3_mem_methods* */ +#define SQLITE_CONFIG_SCRATCH 6 /* No longer used */ +#define SQLITE_CONFIG_PAGECACHE 7 /* void*, int sz, int N */ +#define SQLITE_CONFIG_HEAP 8 /* void*, int nByte, int min */ +#define SQLITE_CONFIG_MEMSTATUS 9 /* boolean */ +#define SQLITE_CONFIG_MUTEX 10 /* sqlite3_mutex_methods* */ +#define SQLITE_CONFIG_GETMUTEX 11 /* sqlite3_mutex_methods* */ +/* previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. */ +#define SQLITE_CONFIG_LOOKASIDE 13 /* int int */ +#define SQLITE_CONFIG_PCACHE 14 /* no-op */ +#define SQLITE_CONFIG_GETPCACHE 15 /* no-op */ +#define SQLITE_CONFIG_LOG 16 /* xFunc, void* */ +#define SQLITE_CONFIG_URI 17 /* int */ +#define SQLITE_CONFIG_PCACHE2 18 /* sqlite3_pcache_methods2* */ +#define SQLITE_CONFIG_GETPCACHE2 19 /* sqlite3_pcache_methods2* */ +#define SQLITE_CONFIG_COVERING_INDEX_SCAN 20 /* int */ +#define SQLITE_CONFIG_SQLLOG 21 /* xSqllog, void* */ +#define SQLITE_CONFIG_MMAP_SIZE 22 /* sqlite3_int64, sqlite3_int64 */ +#define SQLITE_CONFIG_WIN32_HEAPSIZE 23 /* int nByte */ +#define SQLITE_CONFIG_PCACHE_HDRSZ 24 /* int *psz */ +#define SQLITE_CONFIG_PMASZ 25 /* unsigned int szPma */ +#define SQLITE_CONFIG_STMTJRNL_SPILL 26 /* int nByte */ +#define SQLITE_CONFIG_SMALL_MALLOC 27 /* boolean */ +#define SQLITE_CONFIG_SORTERREF_SIZE 28 /* int nByte */ +#define SQLITE_CONFIG_MEMDB_MAXSIZE 29 /* sqlite3_int64 */ + +/* +** CAPI3REF: Database Connection Configuration Options +** +** These constants are the available integer configuration options that +** can be passed as the second argument to the [sqlite3_db_config()] interface. +** +** New configuration options may be added in future releases of SQLite. +** Existing configuration options might be discontinued. Applications +** should check the return code from [sqlite3_db_config()] to make sure that +** the call worked. ^The [sqlite3_db_config()] interface will return a +** non-zero [error code] if a discontinued or unsupported configuration option +** is invoked. +** +**
+** [[SQLITE_DBCONFIG_LOOKASIDE]] +**
SQLITE_DBCONFIG_LOOKASIDE
+**
^This option takes three additional arguments that determine the +** [lookaside memory allocator] configuration for the [database connection]. +** ^The first argument (the third parameter to [sqlite3_db_config()] is a +** pointer to a memory buffer to use for lookaside memory. +** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb +** may be NULL in which case SQLite will allocate the +** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the +** size of each lookaside buffer slot. ^The third argument is the number of +** slots. The size of the buffer in the first argument must be greater than +** or equal to the product of the second and third arguments. The buffer +** must be aligned to an 8-byte boundary. ^If the second argument to +** SQLITE_DBCONFIG_LOOKASIDE is not a multiple of 8, it is internally +** rounded down to the next smaller multiple of 8. ^(The lookaside memory +** configuration for a database connection can only be changed when that +** connection is not currently using lookaside memory, or in other words +** when the "current value" returned by +** [sqlite3_db_status](D,[SQLITE_CONFIG_LOOKASIDE],...) is zero. +** Any attempt to change the lookaside memory configuration when lookaside +** memory is in use leaves the configuration unchanged and returns +** [SQLITE_BUSY].)^
+** +** [[SQLITE_DBCONFIG_ENABLE_FKEY]] +**
SQLITE_DBCONFIG_ENABLE_FKEY
+**
^This option is used to enable or disable the enforcement of +** [foreign key constraints]. There should be two additional arguments. +** The first argument is an integer which is 0 to disable FK enforcement, +** positive to enable FK enforcement or negative to leave FK enforcement +** unchanged. The second parameter is a pointer to an integer into which +** is written 0 or 1 to indicate whether FK enforcement is off or on +** following this call. The second parameter may be a NULL pointer, in +** which case the FK enforcement setting is not reported back.
+** +** [[SQLITE_DBCONFIG_ENABLE_TRIGGER]] +**
SQLITE_DBCONFIG_ENABLE_TRIGGER
+**
^This option is used to enable or disable [CREATE TRIGGER | triggers]. +** There should be two additional arguments. +** The first argument is an integer which is 0 to disable triggers, +** positive to enable triggers or negative to leave the setting unchanged. +** The second parameter is a pointer to an integer into which +** is written 0 or 1 to indicate whether triggers are disabled or enabled +** following this call. The second parameter may be a NULL pointer, in +** which case the trigger setting is not reported back.
+** +** [[SQLITE_DBCONFIG_ENABLE_VIEW]] +**
SQLITE_DBCONFIG_ENABLE_VIEW
+**
^This option is used to enable or disable [CREATE VIEW | views]. +** There should be two additional arguments. +** The first argument is an integer which is 0 to disable views, +** positive to enable views or negative to leave the setting unchanged. +** The second parameter is a pointer to an integer into which +** is written 0 or 1 to indicate whether views are disabled or enabled +** following this call. The second parameter may be a NULL pointer, in +** which case the view setting is not reported back.
+** +** [[SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER]] +**
SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
+**
^This option is used to enable or disable the +** [fts3_tokenizer()] function which is part of the +** [FTS3] full-text search engine extension. +** There should be two additional arguments. +** The first argument is an integer which is 0 to disable fts3_tokenizer() or +** positive to enable fts3_tokenizer() or negative to leave the setting +** unchanged. +** The second parameter is a pointer to an integer into which +** is written 0 or 1 to indicate whether fts3_tokenizer is disabled or enabled +** following this call. The second parameter may be a NULL pointer, in +** which case the new setting is not reported back.
+** +** [[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION]] +**
SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION
+**
^This option is used to enable or disable the [sqlite3_load_extension()] +** interface independently of the [load_extension()] SQL function. +** The [sqlite3_enable_load_extension()] API enables or disables both the +** C-API [sqlite3_load_extension()] and the SQL function [load_extension()]. +** There should be two additional arguments. +** When the first argument to this interface is 1, then only the C-API is +** enabled and the SQL function remains disabled. If the first argument to +** this interface is 0, then both the C-API and the SQL function are disabled. +** If the first argument is -1, then no changes are made to state of either the +** C-API or the SQL function. +** The second parameter is a pointer to an integer into which +** is written 0 or 1 to indicate whether [sqlite3_load_extension()] interface +** is disabled or enabled following this call. The second parameter may +** be a NULL pointer, in which case the new setting is not reported back. +**
+** +** [[SQLITE_DBCONFIG_MAINDBNAME]]
SQLITE_DBCONFIG_MAINDBNAME
+**
^This option is used to change the name of the "main" database +** schema. ^The sole argument is a pointer to a constant UTF8 string +** which will become the new schema name in place of "main". ^SQLite +** does not make a copy of the new main schema name string, so the application +** must ensure that the argument passed into this DBCONFIG option is unchanged +** until after the database connection closes. +**
+** +** [[SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE]] +**
SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE
+**
Usually, when a database in wal mode is closed or detached from a +** database handle, SQLite checks if this will mean that there are now no +** connections at all to the database. If so, it performs a checkpoint +** operation before closing the connection. This option may be used to +** override this behaviour. The first parameter passed to this operation +** is an integer - positive to disable checkpoints-on-close, or zero (the +** default) to enable them, and negative to leave the setting unchanged. +** The second parameter is a pointer to an integer +** into which is written 0 or 1 to indicate whether checkpoints-on-close +** have been disabled - 0 if they are not disabled, 1 if they are. +**
+** +** [[SQLITE_DBCONFIG_ENABLE_QPSG]]
SQLITE_DBCONFIG_ENABLE_QPSG
+**
^(The SQLITE_DBCONFIG_ENABLE_QPSG option activates or deactivates +** the [query planner stability guarantee] (QPSG). When the QPSG is active, +** a single SQL query statement will always use the same algorithm regardless +** of values of [bound parameters].)^ The QPSG disables some query optimizations +** that look at the values of bound parameters, which can make some queries +** slower. But the QPSG has the advantage of more predictable behavior. With +** the QPSG active, SQLite will always use the same query plan in the field as +** was used during testing in the lab. +** The first argument to this setting is an integer which is 0 to disable +** the QPSG, positive to enable QPSG, or negative to leave the setting +** unchanged. The second parameter is a pointer to an integer into which +** is written 0 or 1 to indicate whether the QPSG is disabled or enabled +** following this call. +**
+** +** [[SQLITE_DBCONFIG_TRIGGER_EQP]]
SQLITE_DBCONFIG_TRIGGER_EQP
+**
By default, the output of EXPLAIN QUERY PLAN commands does not +** include output for any operations performed by trigger programs. This +** option is used to set or clear (the default) a flag that governs this +** behavior. The first parameter passed to this operation is an integer - +** positive to enable output for trigger programs, or zero to disable it, +** or negative to leave the setting unchanged. +** The second parameter is a pointer to an integer into which is written +** 0 or 1 to indicate whether output-for-triggers has been disabled - 0 if +** it is not disabled, 1 if it is. +**
+** +** [[SQLITE_DBCONFIG_RESET_DATABASE]]
SQLITE_DBCONFIG_RESET_DATABASE
+**
Set the SQLITE_DBCONFIG_RESET_DATABASE flag and then run +** [VACUUM] in order to reset a database back to an empty database +** with no schema and no content. The following process works even for +** a badly corrupted database file: +**
    +**
  1. If the database connection is newly opened, make sure it has read the +** database schema by preparing then discarding some query against the +** database, or calling sqlite3_table_column_metadata(), ignoring any +** errors. This step is only necessary if the application desires to keep +** the database in WAL mode after the reset if it was in WAL mode before +** the reset. +**
  2. sqlite3_db_config(db, SQLITE_DBCONFIG_RESET_DATABASE, 1, 0); +**
  3. [sqlite3_exec](db, "[VACUUM]", 0, 0, 0); +**
  4. sqlite3_db_config(db, SQLITE_DBCONFIG_RESET_DATABASE, 0, 0); +**
+** Because resetting a database is destructive and irreversible, the +** process requires the use of this obscure API and multiple steps to help +** ensure that it does not happen by accident. +** +** [[SQLITE_DBCONFIG_DEFENSIVE]]
SQLITE_DBCONFIG_DEFENSIVE
+**
The SQLITE_DBCONFIG_DEFENSIVE option activates or deactivates the +** "defensive" flag for a database connection. When the defensive +** flag is enabled, language features that allow ordinary SQL to +** deliberately corrupt the database file are disabled. The disabled +** features include but are not limited to the following: +**
    +**
  • The [PRAGMA writable_schema=ON] statement. +**
  • The [PRAGMA journal_mode=OFF] statement. +**
  • Writes to the [sqlite_dbpage] virtual table. +**
  • Direct writes to [shadow tables]. +**
+**
+** +** [[SQLITE_DBCONFIG_WRITABLE_SCHEMA]]
SQLITE_DBCONFIG_WRITABLE_SCHEMA
+**
The SQLITE_DBCONFIG_WRITABLE_SCHEMA option activates or deactivates the +** "writable_schema" flag. This has the same effect and is logically equivalent +** to setting [PRAGMA writable_schema=ON] or [PRAGMA writable_schema=OFF]. +** The first argument to this setting is an integer which is 0 to disable +** the writable_schema, positive to enable writable_schema, or negative to +** leave the setting unchanged. The second parameter is a pointer to an +** integer into which is written 0 or 1 to indicate whether the writable_schema +** is enabled or disabled following this call. +**
+** +** [[SQLITE_DBCONFIG_LEGACY_ALTER_TABLE]] +**
SQLITE_DBCONFIG_LEGACY_ALTER_TABLE
+**
The SQLITE_DBCONFIG_LEGACY_ALTER_TABLE option activates or deactivates +** the legacy behavior of the [ALTER TABLE RENAME] command such it +** behaves as it did prior to [version 3.24.0] (2018-06-04). See the +** "Compatibility Notice" on the [ALTER TABLE RENAME documentation] for +** additional information. This feature can also be turned on and off +** using the [PRAGMA legacy_alter_table] statement. +**
+** +** [[SQLITE_DBCONFIG_DQS_DML]] +**
SQLITE_DBCONFIG_DQS_DML +**
The SQLITE_DBCONFIG_DQS_DML option activates or deactivates +** the legacy [double-quoted string literal] misfeature for DML statements +** only, that is DELETE, INSERT, SELECT, and UPDATE statements. The +** default value of this setting is determined by the [-DSQLITE_DQS] +** compile-time option. +**
+** +** [[SQLITE_DBCONFIG_DQS_DDL]] +**
SQLITE_DBCONFIG_DQS_DDL +**
The SQLITE_DBCONFIG_DQS option activates or deactivates +** the legacy [double-quoted string literal] misfeature for DDL statements, +** such as CREATE TABLE and CREATE INDEX. The +** default value of this setting is determined by the [-DSQLITE_DQS] +** compile-time option. +**
+** +** [[SQLITE_DBCONFIG_TRUSTED_SCHEMA]] +**
SQLITE_DBCONFIG_TRUSTED_SCHEMA +**
The SQLITE_DBCONFIG_TRUSTED_SCHEMA option tells SQLite to +** assume that database schemas (the contents of the [sqlite_master] tables) +** are untainted by malicious content. +** When the SQLITE_DBCONFIG_TRUSTED_SCHEMA option is disabled, SQLite +** takes additional defensive steps to protect the application from harm +** including: +**
    +**
  • Prohibit the use of SQL functions inside triggers, views, +** CHECK constraints, DEFAULT clauses, expression indexes, +** partial indexes, or generated columns +** unless those functions are tagged with [SQLITE_INNOCUOUS]. +**
  • Prohibit the use of virtual tables inside of triggers or views +** unless those virtual tables are tagged with [SQLITE_VTAB_INNOCUOUS]. +**
+** This setting defaults to "on" for legacy compatibility, however +** all applications are advised to turn it off if possible. This setting +** can also be controlled using the [PRAGMA trusted_schema] statement. +**
+** +** [[SQLITE_DBCONFIG_LEGACY_FILE_FORMAT]] +**
SQLITE_DBCONFIG_LEGACY_FILE_FORMAT +**
The SQLITE_DBCONFIG_LEGACY_FILE_FORMAT option activates or deactivates +** the legacy file format flag. When activated, this flag causes all newly +** created database file to have a schema format version number (the 4-byte +** integer found at offset 44 into the database header) of 1. This in turn +** means that the resulting database file will be readable and writable by +** any SQLite version back to 3.0.0 ([dateof:3.0.0]). Without this setting, +** newly created databases are generally not understandable by SQLite versions +** prior to 3.3.0 ([dateof:3.3.0]). As these words are written, there +** is now scarcely any need to generated database files that are compatible +** all the way back to version 3.0.0, and so this setting is of little +** practical use, but is provided so that SQLite can continue to claim the +** ability to generate new database files that are compatible with version +** 3.0.0. +**

Note that when the SQLITE_DBCONFIG_LEGACY_FILE_FORMAT setting is on, +** the [VACUUM] command will fail with an obscure error when attempting to +** process a table with generated columns and a descending index. This is +** not considered a bug since SQLite versions 3.3.0 and earlier do not support +** either generated columns or decending indexes. +**

+**
+*/ +#define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */ +#define SQLITE_DBCONFIG_LOOKASIDE 1001 /* void* int int */ +#define SQLITE_DBCONFIG_ENABLE_FKEY 1002 /* int int* */ +#define SQLITE_DBCONFIG_ENABLE_TRIGGER 1003 /* int int* */ +#define SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER 1004 /* int int* */ +#define SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION 1005 /* int int* */ +#define SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE 1006 /* int int* */ +#define SQLITE_DBCONFIG_ENABLE_QPSG 1007 /* int int* */ +#define SQLITE_DBCONFIG_TRIGGER_EQP 1008 /* int int* */ +#define SQLITE_DBCONFIG_RESET_DATABASE 1009 /* int int* */ +#define SQLITE_DBCONFIG_DEFENSIVE 1010 /* int int* */ +#define SQLITE_DBCONFIG_WRITABLE_SCHEMA 1011 /* int int* */ +#define SQLITE_DBCONFIG_LEGACY_ALTER_TABLE 1012 /* int int* */ +#define SQLITE_DBCONFIG_DQS_DML 1013 /* int int* */ +#define SQLITE_DBCONFIG_DQS_DDL 1014 /* int int* */ +#define SQLITE_DBCONFIG_ENABLE_VIEW 1015 /* int int* */ +#define SQLITE_DBCONFIG_LEGACY_FILE_FORMAT 1016 /* int int* */ +#define SQLITE_DBCONFIG_TRUSTED_SCHEMA 1017 /* int int* */ +#define SQLITE_DBCONFIG_MAX 1017 /* Largest DBCONFIG */ + +/* +** CAPI3REF: Enable Or Disable Extended Result Codes +** METHOD: sqlite3 +** +** ^The sqlite3_extended_result_codes() routine enables or disables the +** [extended result codes] feature of SQLite. ^The extended result +** codes are disabled by default for historical compatibility. +*/ +SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff); + +/* +** CAPI3REF: Last Insert Rowid +** METHOD: sqlite3 +** +** ^Each entry in most SQLite tables (except for [WITHOUT ROWID] tables) +** has a unique 64-bit signed +** integer key called the [ROWID | "rowid"]. ^The rowid is always available +** as an undeclared column named ROWID, OID, or _ROWID_ as long as those +** names are not also used by explicitly declared columns. ^If +** the table has a column of type [INTEGER PRIMARY KEY] then that column +** is another alias for the rowid. +** +** ^The sqlite3_last_insert_rowid(D) interface usually returns the [rowid] of +** the most recent successful [INSERT] into a rowid table or [virtual table] +** on database connection D. ^Inserts into [WITHOUT ROWID] tables are not +** recorded. ^If no successful [INSERT]s into rowid tables have ever occurred +** on the database connection D, then sqlite3_last_insert_rowid(D) returns +** zero. +** +** As well as being set automatically as rows are inserted into database +** tables, the value returned by this function may be set explicitly by +** [sqlite3_set_last_insert_rowid()] +** +** Some virtual table implementations may INSERT rows into rowid tables as +** part of committing a transaction (e.g. to flush data accumulated in memory +** to disk). In this case subsequent calls to this function return the rowid +** associated with these internal INSERT operations, which leads to +** unintuitive results. Virtual table implementations that do write to rowid +** tables in this way can avoid this problem by restoring the original +** rowid value using [sqlite3_set_last_insert_rowid()] before returning +** control to the user. +** +** ^(If an [INSERT] occurs within a trigger then this routine will +** return the [rowid] of the inserted row as long as the trigger is +** running. Once the trigger program ends, the value returned +** by this routine reverts to what it was before the trigger was fired.)^ +** +** ^An [INSERT] that fails due to a constraint violation is not a +** successful [INSERT] and does not change the value returned by this +** routine. ^Thus INSERT OR FAIL, INSERT OR IGNORE, INSERT OR ROLLBACK, +** and INSERT OR ABORT make no changes to the return value of this +** routine when their insertion fails. ^(When INSERT OR REPLACE +** encounters a constraint violation, it does not fail. The +** INSERT continues to completion after deleting rows that caused +** the constraint problem so INSERT OR REPLACE will always change +** the return value of this interface.)^ +** +** ^For the purposes of this routine, an [INSERT] is considered to +** be successful even if it is subsequently rolled back. +** +** This function is accessible to SQL statements via the +** [last_insert_rowid() SQL function]. +** +** If a separate thread performs a new [INSERT] on the same +** database connection while the [sqlite3_last_insert_rowid()] +** function is running and thus changes the last insert [rowid], +** then the value returned by [sqlite3_last_insert_rowid()] is +** unpredictable and might not equal either the old or the new +** last insert [rowid]. +*/ +SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*); + +/* +** CAPI3REF: Set the Last Insert Rowid value. +** METHOD: sqlite3 +** +** The sqlite3_set_last_insert_rowid(D, R) method allows the application to +** set the value returned by calling sqlite3_last_insert_rowid(D) to R +** without inserting a row into the database. +*/ +SQLITE_API void sqlite3_set_last_insert_rowid(sqlite3*,sqlite3_int64); + +/* +** CAPI3REF: Count The Number Of Rows Modified +** METHOD: sqlite3 +** +** ^This function returns the number of rows modified, inserted or +** deleted by the most recently completed INSERT, UPDATE or DELETE +** statement on the database connection specified by the only parameter. +** ^Executing any other type of SQL statement does not modify the value +** returned by this function. +** +** ^Only changes made directly by the INSERT, UPDATE or DELETE statement are +** considered - auxiliary changes caused by [CREATE TRIGGER | triggers], +** [foreign key actions] or [REPLACE] constraint resolution are not counted. +** +** Changes to a view that are intercepted by +** [INSTEAD OF trigger | INSTEAD OF triggers] are not counted. ^The value +** returned by sqlite3_changes() immediately after an INSERT, UPDATE or +** DELETE statement run on a view is always zero. Only changes made to real +** tables are counted. +** +** Things are more complicated if the sqlite3_changes() function is +** executed while a trigger program is running. This may happen if the +** program uses the [changes() SQL function], or if some other callback +** function invokes sqlite3_changes() directly. Essentially: +** +**
    +**
  • ^(Before entering a trigger program the value returned by +** sqlite3_changes() function is saved. After the trigger program +** has finished, the original value is restored.)^ +** +**
  • ^(Within a trigger program each INSERT, UPDATE and DELETE +** statement sets the value returned by sqlite3_changes() +** upon completion as normal. Of course, this value will not include +** any changes performed by sub-triggers, as the sqlite3_changes() +** value will be saved and restored after each sub-trigger has run.)^ +**
+** +** ^This means that if the changes() SQL function (or similar) is used +** by the first INSERT, UPDATE or DELETE statement within a trigger, it +** returns the value as set when the calling statement began executing. +** ^If it is used by the second or subsequent such statement within a trigger +** program, the value returned reflects the number of rows modified by the +** previous INSERT, UPDATE or DELETE statement within the same trigger. +** +** If a separate thread makes changes on the same database connection +** while [sqlite3_changes()] is running then the value returned +** is unpredictable and not meaningful. +** +** See also: +**
    +**
  • the [sqlite3_total_changes()] interface +**
  • the [count_changes pragma] +**
  • the [changes() SQL function] +**
  • the [data_version pragma] +**
+*/ +SQLITE_API int sqlite3_changes(sqlite3*); + +/* +** CAPI3REF: Total Number Of Rows Modified +** METHOD: sqlite3 +** +** ^This function returns the total number of rows inserted, modified or +** deleted by all [INSERT], [UPDATE] or [DELETE] statements completed +** since the database connection was opened, including those executed as +** part of trigger programs. ^Executing any other type of SQL statement +** does not affect the value returned by sqlite3_total_changes(). +** +** ^Changes made as part of [foreign key actions] are included in the +** count, but those made as part of REPLACE constraint resolution are +** not. ^Changes to a view that are intercepted by INSTEAD OF triggers +** are not counted. +** +** The [sqlite3_total_changes(D)] interface only reports the number +** of rows that changed due to SQL statement run against database +** connection D. Any changes by other database connections are ignored. +** To detect changes against a database file from other database +** connections use the [PRAGMA data_version] command or the +** [SQLITE_FCNTL_DATA_VERSION] [file control]. +** +** If a separate thread makes changes on the same database connection +** while [sqlite3_total_changes()] is running then the value +** returned is unpredictable and not meaningful. +** +** See also: +**
    +**
  • the [sqlite3_changes()] interface +**
  • the [count_changes pragma] +**
  • the [changes() SQL function] +**
  • the [data_version pragma] +**
  • the [SQLITE_FCNTL_DATA_VERSION] [file control] +**
+*/ +SQLITE_API int sqlite3_total_changes(sqlite3*); + +/* +** CAPI3REF: Interrupt A Long-Running Query +** METHOD: sqlite3 +** +** ^This function causes any pending database operation to abort and +** return at its earliest opportunity. This routine is typically +** called in response to a user action such as pressing "Cancel" +** or Ctrl-C where the user wants a long query operation to halt +** immediately. +** +** ^It is safe to call this routine from a thread different from the +** thread that is currently running the database operation. But it +** is not safe to call this routine with a [database connection] that +** is closed or might close before sqlite3_interrupt() returns. +** +** ^If an SQL operation is very nearly finished at the time when +** sqlite3_interrupt() is called, then it might not have an opportunity +** to be interrupted and might continue to completion. +** +** ^An SQL operation that is interrupted will return [SQLITE_INTERRUPT]. +** ^If the interrupted SQL operation is an INSERT, UPDATE, or DELETE +** that is inside an explicit transaction, then the entire transaction +** will be rolled back automatically. +** +** ^The sqlite3_interrupt(D) call is in effect until all currently running +** SQL statements on [database connection] D complete. ^Any new SQL statements +** that are started after the sqlite3_interrupt() call and before the +** running statement count reaches zero are interrupted as if they had been +** running prior to the sqlite3_interrupt() call. ^New SQL statements +** that are started after the running statement count reaches zero are +** not effected by the sqlite3_interrupt(). +** ^A call to sqlite3_interrupt(D) that occurs when there are no running +** SQL statements is a no-op and has no effect on SQL statements +** that are started after the sqlite3_interrupt() call returns. +*/ +SQLITE_API void sqlite3_interrupt(sqlite3*); + +/* +** CAPI3REF: Determine If An SQL Statement Is Complete +** +** These routines are useful during command-line input to determine if the +** currently entered text seems to form a complete SQL statement or +** if additional input is needed before sending the text into +** SQLite for parsing. ^These routines return 1 if the input string +** appears to be a complete SQL statement. ^A statement is judged to be +** complete if it ends with a semicolon token and is not a prefix of a +** well-formed CREATE TRIGGER statement. ^Semicolons that are embedded within +** string literals or quoted identifier names or comments are not +** independent tokens (they are part of the token in which they are +** embedded) and thus do not count as a statement terminator. ^Whitespace +** and comments that follow the final semicolon are ignored. +** +** ^These routines return 0 if the statement is incomplete. ^If a +** memory allocation fails, then SQLITE_NOMEM is returned. +** +** ^These routines do not parse the SQL statements thus +** will not detect syntactically incorrect SQL. +** +** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior +** to invoking sqlite3_complete16() then sqlite3_initialize() is invoked +** automatically by sqlite3_complete16(). If that initialization fails, +** then the return value from sqlite3_complete16() will be non-zero +** regardless of whether or not the input SQL is complete.)^ +** +** The input to [sqlite3_complete()] must be a zero-terminated +** UTF-8 string. +** +** The input to [sqlite3_complete16()] must be a zero-terminated +** UTF-16 string in native byte order. +*/ +SQLITE_API int sqlite3_complete(const char *sql); +SQLITE_API int sqlite3_complete16(const void *sql); + +/* +** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors +** KEYWORDS: {busy-handler callback} {busy handler} +** METHOD: sqlite3 +** +** ^The sqlite3_busy_handler(D,X,P) routine sets a callback function X +** that might be invoked with argument P whenever +** an attempt is made to access a database table associated with +** [database connection] D when another thread +** or process has the table locked. +** The sqlite3_busy_handler() interface is used to implement +** [sqlite3_busy_timeout()] and [PRAGMA busy_timeout]. +** +** ^If the busy callback is NULL, then [SQLITE_BUSY] +** is returned immediately upon encountering the lock. ^If the busy callback +** is not NULL, then the callback might be invoked with two arguments. +** +** ^The first argument to the busy handler is a copy of the void* pointer which +** is the third argument to sqlite3_busy_handler(). ^The second argument to +** the busy handler callback is the number of times that the busy handler has +** been invoked previously for the same locking event. ^If the +** busy callback returns 0, then no additional attempts are made to +** access the database and [SQLITE_BUSY] is returned +** to the application. +** ^If the callback returns non-zero, then another attempt +** is made to access the database and the cycle repeats. +** +** The presence of a busy handler does not guarantee that it will be invoked +** when there is lock contention. ^If SQLite determines that invoking the busy +** handler could result in a deadlock, it will go ahead and return [SQLITE_BUSY] +** to the application instead of invoking the +** busy handler. +** Consider a scenario where one process is holding a read lock that +** it is trying to promote to a reserved lock and +** a second process is holding a reserved lock that it is trying +** to promote to an exclusive lock. The first process cannot proceed +** because it is blocked by the second and the second process cannot +** proceed because it is blocked by the first. If both processes +** invoke the busy handlers, neither will make any progress. Therefore, +** SQLite returns [SQLITE_BUSY] for the first process, hoping that this +** will induce the first process to release its read lock and allow +** the second process to proceed. +** +** ^The default busy callback is NULL. +** +** ^(There can only be a single busy handler defined for each +** [database connection]. Setting a new busy handler clears any +** previously set handler.)^ ^Note that calling [sqlite3_busy_timeout()] +** or evaluating [PRAGMA busy_timeout=N] will change the +** busy handler and thus clear any previously set busy handler. +** +** The busy callback should not take any actions which modify the +** database connection that invoked the busy handler. In other words, +** the busy handler is not reentrant. Any such actions +** result in undefined behavior. +** +** A busy handler must not close the database connection +** or [prepared statement] that invoked the busy handler. +*/ +SQLITE_API int sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*); + +/* +** CAPI3REF: Set A Busy Timeout +** METHOD: sqlite3 +** +** ^This routine sets a [sqlite3_busy_handler | busy handler] that sleeps +** for a specified amount of time when a table is locked. ^The handler +** will sleep multiple times until at least "ms" milliseconds of sleeping +** have accumulated. ^After at least "ms" milliseconds of sleeping, +** the handler returns 0 which causes [sqlite3_step()] to return +** [SQLITE_BUSY]. +** +** ^Calling this routine with an argument less than or equal to zero +** turns off all busy handlers. +** +** ^(There can only be a single busy handler for a particular +** [database connection] at any given moment. If another busy handler +** was defined (using [sqlite3_busy_handler()]) prior to calling +** this routine, that other busy handler is cleared.)^ +** +** See also: [PRAGMA busy_timeout] +*/ +SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms); + +/* +** CAPI3REF: Convenience Routines For Running Queries +** METHOD: sqlite3 +** +** This is a legacy interface that is preserved for backwards compatibility. +** Use of this interface is not recommended. +** +** Definition: A result table is memory data structure created by the +** [sqlite3_get_table()] interface. A result table records the +** complete query results from one or more queries. +** +** The table conceptually has a number of rows and columns. But +** these numbers are not part of the result table itself. These +** numbers are obtained separately. Let N be the number of rows +** and M be the number of columns. +** +** A result table is an array of pointers to zero-terminated UTF-8 strings. +** There are (N+1)*M elements in the array. The first M pointers point +** to zero-terminated strings that contain the names of the columns. +** The remaining entries all point to query results. NULL values result +** in NULL pointers. All other values are in their UTF-8 zero-terminated +** string representation as returned by [sqlite3_column_text()]. +** +** A result table might consist of one or more memory allocations. +** It is not safe to pass a result table directly to [sqlite3_free()]. +** A result table should be deallocated using [sqlite3_free_table()]. +** +** ^(As an example of the result table format, suppose a query result +** is as follows: +** +**
+**        Name        | Age
+**        -----------------------
+**        Alice       | 43
+**        Bob         | 28
+**        Cindy       | 21
+** 
+** +** There are two columns (M==2) and three rows (N==3). Thus the +** result table has 8 entries. Suppose the result table is stored +** in an array named azResult. Then azResult holds this content: +** +**
+**        azResult[0] = "Name";
+**        azResult[1] = "Age";
+**        azResult[2] = "Alice";
+**        azResult[3] = "43";
+**        azResult[4] = "Bob";
+**        azResult[5] = "28";
+**        azResult[6] = "Cindy";
+**        azResult[7] = "21";
+** 
)^ +** +** ^The sqlite3_get_table() function evaluates one or more +** semicolon-separated SQL statements in the zero-terminated UTF-8 +** string of its 2nd parameter and returns a result table to the +** pointer given in its 3rd parameter. +** +** After the application has finished with the result from sqlite3_get_table(), +** it must pass the result table pointer to sqlite3_free_table() in order to +** release the memory that was malloced. Because of the way the +** [sqlite3_malloc()] happens within sqlite3_get_table(), the calling +** function must not try to call [sqlite3_free()] directly. Only +** [sqlite3_free_table()] is able to release the memory properly and safely. +** +** The sqlite3_get_table() interface is implemented as a wrapper around +** [sqlite3_exec()]. The sqlite3_get_table() routine does not have access +** to any internal data structures of SQLite. It uses only the public +** interface defined here. As a consequence, errors that occur in the +** wrapper layer outside of the internal [sqlite3_exec()] call are not +** reflected in subsequent calls to [sqlite3_errcode()] or +** [sqlite3_errmsg()]. +*/ +SQLITE_API int sqlite3_get_table( + sqlite3 *db, /* An open database */ + const char *zSql, /* SQL to be evaluated */ + char ***pazResult, /* Results of the query */ + int *pnRow, /* Number of result rows written here */ + int *pnColumn, /* Number of result columns written here */ + char **pzErrmsg /* Error msg written here */ +); +SQLITE_API void sqlite3_free_table(char **result); + +/* +** CAPI3REF: Formatted String Printing Functions +** +** These routines are work-alikes of the "printf()" family of functions +** from the standard C library. +** These routines understand most of the common formatting options from +** the standard library printf() +** plus some additional non-standard formats ([%q], [%Q], [%w], and [%z]). +** See the [built-in printf()] documentation for details. +** +** ^The sqlite3_mprintf() and sqlite3_vmprintf() routines write their +** results into memory obtained from [sqlite3_malloc64()]. +** The strings returned by these two routines should be +** released by [sqlite3_free()]. ^Both routines return a +** NULL pointer if [sqlite3_malloc64()] is unable to allocate enough +** memory to hold the resulting string. +** +** ^(The sqlite3_snprintf() routine is similar to "snprintf()" from +** the standard C library. The result is written into the +** buffer supplied as the second parameter whose size is given by +** the first parameter. Note that the order of the +** first two parameters is reversed from snprintf().)^ This is an +** historical accident that cannot be fixed without breaking +** backwards compatibility. ^(Note also that sqlite3_snprintf() +** returns a pointer to its buffer instead of the number of +** characters actually written into the buffer.)^ We admit that +** the number of characters written would be a more useful return +** value but we cannot change the implementation of sqlite3_snprintf() +** now without breaking compatibility. +** +** ^As long as the buffer size is greater than zero, sqlite3_snprintf() +** guarantees that the buffer is always zero-terminated. ^The first +** parameter "n" is the total size of the buffer, including space for +** the zero terminator. So the longest string that can be completely +** written will be n-1 characters. +** +** ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf(). +** +** See also: [built-in printf()], [printf() SQL function] +*/ +SQLITE_API char *sqlite3_mprintf(const char*,...); +SQLITE_API char *sqlite3_vmprintf(const char*, va_list); +SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); +SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list); + +/* +** CAPI3REF: Memory Allocation Subsystem +** +** The SQLite core uses these three routines for all of its own +** internal memory allocation needs. "Core" in the previous sentence +** does not include operating-system specific [VFS] implementation. The +** Windows VFS uses native malloc() and free() for some operations. +** +** ^The sqlite3_malloc() routine returns a pointer to a block +** of memory at least N bytes in length, where N is the parameter. +** ^If sqlite3_malloc() is unable to obtain sufficient free +** memory, it returns a NULL pointer. ^If the parameter N to +** sqlite3_malloc() is zero or negative then sqlite3_malloc() returns +** a NULL pointer. +** +** ^The sqlite3_malloc64(N) routine works just like +** sqlite3_malloc(N) except that N is an unsigned 64-bit integer instead +** of a signed 32-bit integer. +** +** ^Calling sqlite3_free() with a pointer previously returned +** by sqlite3_malloc() or sqlite3_realloc() releases that memory so +** that it might be reused. ^The sqlite3_free() routine is +** a no-op if is called with a NULL pointer. Passing a NULL pointer +** to sqlite3_free() is harmless. After being freed, memory +** should neither be read nor written. Even reading previously freed +** memory might result in a segmentation fault or other severe error. +** Memory corruption, a segmentation fault, or other severe error +** might result if sqlite3_free() is called with a non-NULL pointer that +** was not obtained from sqlite3_malloc() or sqlite3_realloc(). +** +** ^The sqlite3_realloc(X,N) interface attempts to resize a +** prior memory allocation X to be at least N bytes. +** ^If the X parameter to sqlite3_realloc(X,N) +** is a NULL pointer then its behavior is identical to calling +** sqlite3_malloc(N). +** ^If the N parameter to sqlite3_realloc(X,N) is zero or +** negative then the behavior is exactly the same as calling +** sqlite3_free(X). +** ^sqlite3_realloc(X,N) returns a pointer to a memory allocation +** of at least N bytes in size or NULL if insufficient memory is available. +** ^If M is the size of the prior allocation, then min(N,M) bytes +** of the prior allocation are copied into the beginning of buffer returned +** by sqlite3_realloc(X,N) and the prior allocation is freed. +** ^If sqlite3_realloc(X,N) returns NULL and N is positive, then the +** prior allocation is not freed. +** +** ^The sqlite3_realloc64(X,N) interfaces works the same as +** sqlite3_realloc(X,N) except that N is a 64-bit unsigned integer instead +** of a 32-bit signed integer. +** +** ^If X is a memory allocation previously obtained from sqlite3_malloc(), +** sqlite3_malloc64(), sqlite3_realloc(), or sqlite3_realloc64(), then +** sqlite3_msize(X) returns the size of that memory allocation in bytes. +** ^The value returned by sqlite3_msize(X) might be larger than the number +** of bytes requested when X was allocated. ^If X is a NULL pointer then +** sqlite3_msize(X) returns zero. If X points to something that is not +** the beginning of memory allocation, or if it points to a formerly +** valid memory allocation that has now been freed, then the behavior +** of sqlite3_msize(X) is undefined and possibly harmful. +** +** ^The memory returned by sqlite3_malloc(), sqlite3_realloc(), +** sqlite3_malloc64(), and sqlite3_realloc64() +** is always aligned to at least an 8 byte boundary, or to a +** 4 byte boundary if the [SQLITE_4_BYTE_ALIGNED_MALLOC] compile-time +** option is used. +** +** The pointer arguments to [sqlite3_free()] and [sqlite3_realloc()] +** must be either NULL or else pointers obtained from a prior +** invocation of [sqlite3_malloc()] or [sqlite3_realloc()] that have +** not yet been released. +** +** The application must not read or write any part of +** a block of memory after it has been released using +** [sqlite3_free()] or [sqlite3_realloc()]. +*/ +SQLITE_API void *sqlite3_malloc(int); +SQLITE_API void *sqlite3_malloc64(sqlite3_uint64); +SQLITE_API void *sqlite3_realloc(void*, int); +SQLITE_API void *sqlite3_realloc64(void*, sqlite3_uint64); +SQLITE_API void sqlite3_free(void*); +SQLITE_API sqlite3_uint64 sqlite3_msize(void*); + +/* +** CAPI3REF: Memory Allocator Statistics +** +** SQLite provides these two interfaces for reporting on the status +** of the [sqlite3_malloc()], [sqlite3_free()], and [sqlite3_realloc()] +** routines, which form the built-in memory allocation subsystem. +** +** ^The [sqlite3_memory_used()] routine returns the number of bytes +** of memory currently outstanding (malloced but not freed). +** ^The [sqlite3_memory_highwater()] routine returns the maximum +** value of [sqlite3_memory_used()] since the high-water mark +** was last reset. ^The values returned by [sqlite3_memory_used()] and +** [sqlite3_memory_highwater()] include any overhead +** added by SQLite in its implementation of [sqlite3_malloc()], +** but not overhead added by the any underlying system library +** routines that [sqlite3_malloc()] may call. +** +** ^The memory high-water mark is reset to the current value of +** [sqlite3_memory_used()] if and only if the parameter to +** [sqlite3_memory_highwater()] is true. ^The value returned +** by [sqlite3_memory_highwater(1)] is the high-water mark +** prior to the reset. +*/ +SQLITE_API sqlite3_int64 sqlite3_memory_used(void); +SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag); + +/* +** CAPI3REF: Pseudo-Random Number Generator +** +** SQLite contains a high-quality pseudo-random number generator (PRNG) used to +** select random [ROWID | ROWIDs] when inserting new records into a table that +** already uses the largest possible [ROWID]. The PRNG is also used for +** the built-in random() and randomblob() SQL functions. This interface allows +** applications to access the same PRNG for other purposes. +** +** ^A call to this routine stores N bytes of randomness into buffer P. +** ^The P parameter can be a NULL pointer. +** +** ^If this routine has not been previously called or if the previous +** call had N less than one or a NULL pointer for P, then the PRNG is +** seeded using randomness obtained from the xRandomness method of +** the default [sqlite3_vfs] object. +** ^If the previous call to this routine had an N of 1 or more and a +** non-NULL P then the pseudo-randomness is generated +** internally and without recourse to the [sqlite3_vfs] xRandomness +** method. +*/ +SQLITE_API void sqlite3_randomness(int N, void *P); + +/* +** CAPI3REF: Compile-Time Authorization Callbacks +** METHOD: sqlite3 +** KEYWORDS: {authorizer callback} +** +** ^This routine registers an authorizer callback with a particular +** [database connection], supplied in the first argument. +** ^The authorizer callback is invoked as SQL statements are being compiled +** by [sqlite3_prepare()] or its variants [sqlite3_prepare_v2()], +** [sqlite3_prepare_v3()], [sqlite3_prepare16()], [sqlite3_prepare16_v2()], +** and [sqlite3_prepare16_v3()]. ^At various +** points during the compilation process, as logic is being created +** to perform various actions, the authorizer callback is invoked to +** see if those actions are allowed. ^The authorizer callback should +** return [SQLITE_OK] to allow the action, [SQLITE_IGNORE] to disallow the +** specific action but allow the SQL statement to continue to be +** compiled, or [SQLITE_DENY] to cause the entire SQL statement to be +** rejected with an error. ^If the authorizer callback returns +** any value other than [SQLITE_IGNORE], [SQLITE_OK], or [SQLITE_DENY] +** then the [sqlite3_prepare_v2()] or equivalent call that triggered +** the authorizer will fail with an error message. +** +** When the callback returns [SQLITE_OK], that means the operation +** requested is ok. ^When the callback returns [SQLITE_DENY], the +** [sqlite3_prepare_v2()] or equivalent call that triggered the +** authorizer will fail with an error message explaining that +** access is denied. +** +** ^The first parameter to the authorizer callback is a copy of the third +** parameter to the sqlite3_set_authorizer() interface. ^The second parameter +** to the callback is an integer [SQLITE_COPY | action code] that specifies +** the particular action to be authorized. ^The third through sixth parameters +** to the callback are either NULL pointers or zero-terminated strings +** that contain additional details about the action to be authorized. +** Applications must always be prepared to encounter a NULL pointer in any +** of the third through the sixth parameters of the authorization callback. +** +** ^If the action code is [SQLITE_READ] +** and the callback returns [SQLITE_IGNORE] then the +** [prepared statement] statement is constructed to substitute +** a NULL value in place of the table column that would have +** been read if [SQLITE_OK] had been returned. The [SQLITE_IGNORE] +** return can be used to deny an untrusted user access to individual +** columns of a table. +** ^When a table is referenced by a [SELECT] but no column values are +** extracted from that table (for example in a query like +** "SELECT count(*) FROM tab") then the [SQLITE_READ] authorizer callback +** is invoked once for that table with a column name that is an empty string. +** ^If the action code is [SQLITE_DELETE] and the callback returns +** [SQLITE_IGNORE] then the [DELETE] operation proceeds but the +** [truncate optimization] is disabled and all rows are deleted individually. +** +** An authorizer is used when [sqlite3_prepare | preparing] +** SQL statements from an untrusted source, to ensure that the SQL statements +** do not try to access data they are not allowed to see, or that they do not +** try to execute malicious statements that damage the database. For +** example, an application may allow a user to enter arbitrary +** SQL queries for evaluation by a database. But the application does +** not want the user to be able to make arbitrary changes to the +** database. An authorizer could then be put in place while the +** user-entered SQL is being [sqlite3_prepare | prepared] that +** disallows everything except [SELECT] statements. +** +** Applications that need to process SQL from untrusted sources +** might also consider lowering resource limits using [sqlite3_limit()] +** and limiting database size using the [max_page_count] [PRAGMA] +** in addition to using an authorizer. +** +** ^(Only a single authorizer can be in place on a database connection +** at a time. Each call to sqlite3_set_authorizer overrides the +** previous call.)^ ^Disable the authorizer by installing a NULL callback. +** The authorizer is disabled by default. +** +** The authorizer callback must not do anything that will modify +** the database connection that invoked the authorizer callback. +** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their +** database connections for the meaning of "modify" in this paragraph. +** +** ^When [sqlite3_prepare_v2()] is used to prepare a statement, the +** statement might be re-prepared during [sqlite3_step()] due to a +** schema change. Hence, the application should ensure that the +** correct authorizer callback remains in place during the [sqlite3_step()]. +** +** ^Note that the authorizer callback is invoked only during +** [sqlite3_prepare()] or its variants. Authorization is not +** performed during statement evaluation in [sqlite3_step()], unless +** as stated in the previous paragraph, sqlite3_step() invokes +** sqlite3_prepare_v2() to reprepare a statement after a schema change. +*/ +SQLITE_API int sqlite3_set_authorizer( + sqlite3*, + int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), + void *pUserData +); + +/* +** CAPI3REF: Authorizer Return Codes +** +** The [sqlite3_set_authorizer | authorizer callback function] must +** return either [SQLITE_OK] or one of these two constants in order +** to signal SQLite whether or not the action is permitted. See the +** [sqlite3_set_authorizer | authorizer documentation] for additional +** information. +** +** Note that SQLITE_IGNORE is also used as a [conflict resolution mode] +** returned from the [sqlite3_vtab_on_conflict()] interface. +*/ +#define SQLITE_DENY 1 /* Abort the SQL statement with an error */ +#define SQLITE_IGNORE 2 /* Don't allow access, but don't generate an error */ + +/* +** CAPI3REF: Authorizer Action Codes +** +** The [sqlite3_set_authorizer()] interface registers a callback function +** that is invoked to authorize certain SQL statement actions. The +** second parameter to the callback is an integer code that specifies +** what action is being authorized. These are the integer action codes that +** the authorizer callback may be passed. +** +** These action code values signify what kind of operation is to be +** authorized. The 3rd and 4th parameters to the authorization +** callback function will be parameters or NULL depending on which of these +** codes is used as the second parameter. ^(The 5th parameter to the +** authorizer callback is the name of the database ("main", "temp", +** etc.) if applicable.)^ ^The 6th parameter to the authorizer callback +** is the name of the inner-most trigger or view that is responsible for +** the access attempt or NULL if this access attempt is directly from +** top-level SQL code. +*/ +/******************************************* 3rd ************ 4th ***********/ +#define SQLITE_CREATE_INDEX 1 /* Index Name Table Name */ +#define SQLITE_CREATE_TABLE 2 /* Table Name NULL */ +#define SQLITE_CREATE_TEMP_INDEX 3 /* Index Name Table Name */ +#define SQLITE_CREATE_TEMP_TABLE 4 /* Table Name NULL */ +#define SQLITE_CREATE_TEMP_TRIGGER 5 /* Trigger Name Table Name */ +#define SQLITE_CREATE_TEMP_VIEW 6 /* View Name NULL */ +#define SQLITE_CREATE_TRIGGER 7 /* Trigger Name Table Name */ +#define SQLITE_CREATE_VIEW 8 /* View Name NULL */ +#define SQLITE_DELETE 9 /* Table Name NULL */ +#define SQLITE_DROP_INDEX 10 /* Index Name Table Name */ +#define SQLITE_DROP_TABLE 11 /* Table Name NULL */ +#define SQLITE_DROP_TEMP_INDEX 12 /* Index Name Table Name */ +#define SQLITE_DROP_TEMP_TABLE 13 /* Table Name NULL */ +#define SQLITE_DROP_TEMP_TRIGGER 14 /* Trigger Name Table Name */ +#define SQLITE_DROP_TEMP_VIEW 15 /* View Name NULL */ +#define SQLITE_DROP_TRIGGER 16 /* Trigger Name Table Name */ +#define SQLITE_DROP_VIEW 17 /* View Name NULL */ +#define SQLITE_INSERT 18 /* Table Name NULL */ +#define SQLITE_PRAGMA 19 /* Pragma Name 1st arg or NULL */ +#define SQLITE_READ 20 /* Table Name Column Name */ +#define SQLITE_SELECT 21 /* NULL NULL */ +#define SQLITE_TRANSACTION 22 /* Operation NULL */ +#define SQLITE_UPDATE 23 /* Table Name Column Name */ +#define SQLITE_ATTACH 24 /* Filename NULL */ +#define SQLITE_DETACH 25 /* Database Name NULL */ +#define SQLITE_ALTER_TABLE 26 /* Database Name Table Name */ +#define SQLITE_REINDEX 27 /* Index Name NULL */ +#define SQLITE_ANALYZE 28 /* Table Name NULL */ +#define SQLITE_CREATE_VTABLE 29 /* Table Name Module Name */ +#define SQLITE_DROP_VTABLE 30 /* Table Name Module Name */ +#define SQLITE_FUNCTION 31 /* NULL Function Name */ +#define SQLITE_SAVEPOINT 32 /* Operation Savepoint Name */ +#define SQLITE_COPY 0 /* No longer used */ +#define SQLITE_RECURSIVE 33 /* NULL NULL */ + +/* +** CAPI3REF: Tracing And Profiling Functions +** METHOD: sqlite3 +** +** These routines are deprecated. Use the [sqlite3_trace_v2()] interface +** instead of the routines described here. +** +** These routines register callback functions that can be used for +** tracing and profiling the execution of SQL statements. +** +** ^The callback function registered by sqlite3_trace() is invoked at +** various times when an SQL statement is being run by [sqlite3_step()]. +** ^The sqlite3_trace() callback is invoked with a UTF-8 rendering of the +** SQL statement text as the statement first begins executing. +** ^(Additional sqlite3_trace() callbacks might occur +** as each triggered subprogram is entered. The callbacks for triggers +** contain a UTF-8 SQL comment that identifies the trigger.)^ +** +** The [SQLITE_TRACE_SIZE_LIMIT] compile-time option can be used to limit +** the length of [bound parameter] expansion in the output of sqlite3_trace(). +** +** ^The callback function registered by sqlite3_profile() is invoked +** as each SQL statement finishes. ^The profile callback contains +** the original statement text and an estimate of wall-clock time +** of how long that statement took to run. ^The profile callback +** time is in units of nanoseconds, however the current implementation +** is only capable of millisecond resolution so the six least significant +** digits in the time are meaningless. Future versions of SQLite +** might provide greater resolution on the profiler callback. Invoking +** either [sqlite3_trace()] or [sqlite3_trace_v2()] will cancel the +** profile callback. +*/ +SQLITE_API SQLITE_DEPRECATED void *sqlite3_trace(sqlite3*, + void(*xTrace)(void*,const char*), void*); +SQLITE_API SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*, + void(*xProfile)(void*,const char*,sqlite3_uint64), void*); + +/* +** CAPI3REF: SQL Trace Event Codes +** KEYWORDS: SQLITE_TRACE +** +** These constants identify classes of events that can be monitored +** using the [sqlite3_trace_v2()] tracing logic. The M argument +** to [sqlite3_trace_v2(D,M,X,P)] is an OR-ed combination of one or more of +** the following constants. ^The first argument to the trace callback +** is one of the following constants. +** +** New tracing constants may be added in future releases. +** +** ^A trace callback has four arguments: xCallback(T,C,P,X). +** ^The T argument is one of the integer type codes above. +** ^The C argument is a copy of the context pointer passed in as the +** fourth argument to [sqlite3_trace_v2()]. +** The P and X arguments are pointers whose meanings depend on T. +** +**
+** [[SQLITE_TRACE_STMT]]
SQLITE_TRACE_STMT
+**
^An SQLITE_TRACE_STMT callback is invoked when a prepared statement +** first begins running and possibly at other times during the +** execution of the prepared statement, such as at the start of each +** trigger subprogram. ^The P argument is a pointer to the +** [prepared statement]. ^The X argument is a pointer to a string which +** is the unexpanded SQL text of the prepared statement or an SQL comment +** that indicates the invocation of a trigger. ^The callback can compute +** the same text that would have been returned by the legacy [sqlite3_trace()] +** interface by using the X argument when X begins with "--" and invoking +** [sqlite3_expanded_sql(P)] otherwise. +** +** [[SQLITE_TRACE_PROFILE]]
SQLITE_TRACE_PROFILE
+**
^An SQLITE_TRACE_PROFILE callback provides approximately the same +** information as is provided by the [sqlite3_profile()] callback. +** ^The P argument is a pointer to the [prepared statement] and the +** X argument points to a 64-bit integer which is the estimated of +** the number of nanosecond that the prepared statement took to run. +** ^The SQLITE_TRACE_PROFILE callback is invoked when the statement finishes. +** +** [[SQLITE_TRACE_ROW]]
SQLITE_TRACE_ROW
+**
^An SQLITE_TRACE_ROW callback is invoked whenever a prepared +** statement generates a single row of result. +** ^The P argument is a pointer to the [prepared statement] and the +** X argument is unused. +** +** [[SQLITE_TRACE_CLOSE]]
SQLITE_TRACE_CLOSE
+**
^An SQLITE_TRACE_CLOSE callback is invoked when a database +** connection closes. +** ^The P argument is a pointer to the [database connection] object +** and the X argument is unused. +**
+*/ +#define SQLITE_TRACE_STMT 0x01 +#define SQLITE_TRACE_PROFILE 0x02 +#define SQLITE_TRACE_ROW 0x04 +#define SQLITE_TRACE_CLOSE 0x08 + +/* +** CAPI3REF: SQL Trace Hook +** METHOD: sqlite3 +** +** ^The sqlite3_trace_v2(D,M,X,P) interface registers a trace callback +** function X against [database connection] D, using property mask M +** and context pointer P. ^If the X callback is +** NULL or if the M mask is zero, then tracing is disabled. The +** M argument should be the bitwise OR-ed combination of +** zero or more [SQLITE_TRACE] constants. +** +** ^Each call to either sqlite3_trace() or sqlite3_trace_v2() overrides +** (cancels) any prior calls to sqlite3_trace() or sqlite3_trace_v2(). +** +** ^The X callback is invoked whenever any of the events identified by +** mask M occur. ^The integer return value from the callback is currently +** ignored, though this may change in future releases. Callback +** implementations should return zero to ensure future compatibility. +** +** ^A trace callback is invoked with four arguments: callback(T,C,P,X). +** ^The T argument is one of the [SQLITE_TRACE] +** constants to indicate why the callback was invoked. +** ^The C argument is a copy of the context pointer. +** The P and X arguments are pointers whose meanings depend on T. +** +** The sqlite3_trace_v2() interface is intended to replace the legacy +** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which +** are deprecated. +*/ +SQLITE_API int sqlite3_trace_v2( + sqlite3*, + unsigned uMask, + int(*xCallback)(unsigned,void*,void*,void*), + void *pCtx +); + +/* +** CAPI3REF: Query Progress Callbacks +** METHOD: sqlite3 +** +** ^The sqlite3_progress_handler(D,N,X,P) interface causes the callback +** function X to be invoked periodically during long running calls to +** [sqlite3_exec()], [sqlite3_step()] and [sqlite3_get_table()] for +** database connection D. An example use for this +** interface is to keep a GUI updated during a large query. +** +** ^The parameter P is passed through as the only parameter to the +** callback function X. ^The parameter N is the approximate number of +** [virtual machine instructions] that are evaluated between successive +** invocations of the callback X. ^If N is less than one then the progress +** handler is disabled. +** +** ^Only a single progress handler may be defined at one time per +** [database connection]; setting a new progress handler cancels the +** old one. ^Setting parameter X to NULL disables the progress handler. +** ^The progress handler is also disabled by setting N to a value less +** than 1. +** +** ^If the progress callback returns non-zero, the operation is +** interrupted. This feature can be used to implement a +** "Cancel" button on a GUI progress dialog box. +** +** The progress handler callback must not do anything that will modify +** the database connection that invoked the progress handler. +** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their +** database connections for the meaning of "modify" in this paragraph. +** +*/ +SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); + +/* +** CAPI3REF: Opening A New Database Connection +** CONSTRUCTOR: sqlite3 +** +** ^These routines open an SQLite database file as specified by the +** filename argument. ^The filename argument is interpreted as UTF-8 for +** sqlite3_open() and sqlite3_open_v2() and as UTF-16 in the native byte +** order for sqlite3_open16(). ^(A [database connection] handle is usually +** returned in *ppDb, even if an error occurs. The only exception is that +** if SQLite is unable to allocate memory to hold the [sqlite3] object, +** a NULL will be written into *ppDb instead of a pointer to the [sqlite3] +** object.)^ ^(If the database is opened (and/or created) successfully, then +** [SQLITE_OK] is returned. Otherwise an [error code] is returned.)^ ^The +** [sqlite3_errmsg()] or [sqlite3_errmsg16()] routines can be used to obtain +** an English language description of the error following a failure of any +** of the sqlite3_open() routines. +** +** ^The default encoding will be UTF-8 for databases created using +** sqlite3_open() or sqlite3_open_v2(). ^The default encoding for databases +** created using sqlite3_open16() will be UTF-16 in the native byte order. +** +** Whether or not an error occurs when it is opened, resources +** associated with the [database connection] handle should be released by +** passing it to [sqlite3_close()] when it is no longer required. +** +** The sqlite3_open_v2() interface works like sqlite3_open() +** except that it accepts two additional parameters for additional control +** over the new database connection. ^(The flags parameter to +** sqlite3_open_v2() must include, at a minimum, one of the following +** three flag combinations:)^ +** +**
+** ^(
[SQLITE_OPEN_READONLY]
+**
The database is opened in read-only mode. If the database does not +** already exist, an error is returned.
)^ +** +** ^(
[SQLITE_OPEN_READWRITE]
+**
The database is opened for reading and writing if possible, or reading +** only if the file is write protected by the operating system. In either +** case the database must already exist, otherwise an error is returned.
)^ +** +** ^(
[SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]
+**
The database is opened for reading and writing, and is created if +** it does not already exist. This is the behavior that is always used for +** sqlite3_open() and sqlite3_open16().
)^ +**
+** +** In addition to the required flags, the following optional flags are +** also supported: +** +**
+** ^(
[SQLITE_OPEN_URI]
+**
The filename can be interpreted as a URI if this flag is set.
)^ +** +** ^(
[SQLITE_OPEN_MEMORY]
+**
The database will be opened as an in-memory database. The database +** is named by the "filename" argument for the purposes of cache-sharing, +** if shared cache mode is enabled, but the "filename" is otherwise ignored. +**
)^ +** +** ^(
[SQLITE_OPEN_NOMUTEX]
+**
The new database connection will use the "multi-thread" +** [threading mode].)^ This means that separate threads are allowed +** to use SQLite at the same time, as long as each thread is using +** a different [database connection]. +** +** ^(
[SQLITE_OPEN_FULLMUTEX]
+**
The new database connection will use the "serialized" +** [threading mode].)^ This means the multiple threads can safely +** attempt to use the same database connection at the same time. +** (Mutexes will block any actual concurrency, but in this mode +** there is no harm in trying.) +** +** ^(
[SQLITE_OPEN_SHAREDCACHE]
+**
The database is opened [shared cache] enabled, overriding +** the default shared cache setting provided by +** [sqlite3_enable_shared_cache()].)^ +** +** ^(
[SQLITE_OPEN_PRIVATECACHE]
+**
The database is opened [shared cache] disabled, overriding +** the default shared cache setting provided by +** [sqlite3_enable_shared_cache()].)^ +** +** [[OPEN_NOFOLLOW]] ^(
[SQLITE_OPEN_NOFOLLOW]
+**
The database filename is not allowed to be a symbolic link
+**
)^ +** +** If the 3rd parameter to sqlite3_open_v2() is not one of the +** required combinations shown above optionally combined with other +** [SQLITE_OPEN_READONLY | SQLITE_OPEN_* bits] +** then the behavior is undefined. +** +** ^The fourth parameter to sqlite3_open_v2() is the name of the +** [sqlite3_vfs] object that defines the operating system interface that +** the new database connection should use. ^If the fourth parameter is +** a NULL pointer then the default [sqlite3_vfs] object is used. +** +** ^If the filename is ":memory:", then a private, temporary in-memory database +** is created for the connection. ^This in-memory database will vanish when +** the database connection is closed. Future versions of SQLite might +** make use of additional special filenames that begin with the ":" character. +** It is recommended that when a database filename actually does begin with +** a ":" character you should prefix the filename with a pathname such as +** "./" to avoid ambiguity. +** +** ^If the filename is an empty string, then a private, temporary +** on-disk database will be created. ^This private database will be +** automatically deleted as soon as the database connection is closed. +** +** [[URI filenames in sqlite3_open()]]

URI Filenames

+** +** ^If [URI filename] interpretation is enabled, and the filename argument +** begins with "file:", then the filename is interpreted as a URI. ^URI +** filename interpretation is enabled if the [SQLITE_OPEN_URI] flag is +** set in the third argument to sqlite3_open_v2(), or if it has +** been enabled globally using the [SQLITE_CONFIG_URI] option with the +** [sqlite3_config()] method or by the [SQLITE_USE_URI] compile-time option. +** URI filename interpretation is turned off +** by default, but future releases of SQLite might enable URI filename +** interpretation by default. See "[URI filenames]" for additional +** information. +** +** URI filenames are parsed according to RFC 3986. ^If the URI contains an +** authority, then it must be either an empty string or the string +** "localhost". ^If the authority is not an empty string or "localhost", an +** error is returned to the caller. ^The fragment component of a URI, if +** present, is ignored. +** +** ^SQLite uses the path component of the URI as the name of the disk file +** which contains the database. ^If the path begins with a '/' character, +** then it is interpreted as an absolute path. ^If the path does not begin +** with a '/' (meaning that the authority section is omitted from the URI) +** then the path is interpreted as a relative path. +** ^(On windows, the first component of an absolute path +** is a drive specification (e.g. "C:").)^ +** +** [[core URI query parameters]] +** The query component of a URI may contain parameters that are interpreted +** either by SQLite itself, or by a [VFS | custom VFS implementation]. +** SQLite and its built-in [VFSes] interpret the +** following query parameters: +** +**
    +**
  • vfs: ^The "vfs" parameter may be used to specify the name of +** a VFS object that provides the operating system interface that should +** be used to access the database file on disk. ^If this option is set to +** an empty string the default VFS object is used. ^Specifying an unknown +** VFS is an error. ^If sqlite3_open_v2() is used and the vfs option is +** present, then the VFS specified by the option takes precedence over +** the value passed as the fourth parameter to sqlite3_open_v2(). +** +**
  • mode: ^(The mode parameter may be set to either "ro", "rw", +** "rwc", or "memory". Attempting to set it to any other value is +** an error)^. +** ^If "ro" is specified, then the database is opened for read-only +** access, just as if the [SQLITE_OPEN_READONLY] flag had been set in the +** third argument to sqlite3_open_v2(). ^If the mode option is set to +** "rw", then the database is opened for read-write (but not create) +** access, as if SQLITE_OPEN_READWRITE (but not SQLITE_OPEN_CREATE) had +** been set. ^Value "rwc" is equivalent to setting both +** SQLITE_OPEN_READWRITE and SQLITE_OPEN_CREATE. ^If the mode option is +** set to "memory" then a pure [in-memory database] that never reads +** or writes from disk is used. ^It is an error to specify a value for +** the mode parameter that is less restrictive than that specified by +** the flags passed in the third parameter to sqlite3_open_v2(). +** +**
  • cache: ^The cache parameter may be set to either "shared" or +** "private". ^Setting it to "shared" is equivalent to setting the +** SQLITE_OPEN_SHAREDCACHE bit in the flags argument passed to +** sqlite3_open_v2(). ^Setting the cache parameter to "private" is +** equivalent to setting the SQLITE_OPEN_PRIVATECACHE bit. +** ^If sqlite3_open_v2() is used and the "cache" parameter is present in +** a URI filename, its value overrides any behavior requested by setting +** SQLITE_OPEN_PRIVATECACHE or SQLITE_OPEN_SHAREDCACHE flag. +** +**
  • psow: ^The psow parameter indicates whether or not the +** [powersafe overwrite] property does or does not apply to the +** storage media on which the database file resides. +** +**
  • nolock: ^The nolock parameter is a boolean query parameter +** which if set disables file locking in rollback journal modes. This +** is useful for accessing a database on a filesystem that does not +** support locking. Caution: Database corruption might result if two +** or more processes write to the same database and any one of those +** processes uses nolock=1. +** +**
  • immutable: ^The immutable parameter is a boolean query +** parameter that indicates that the database file is stored on +** read-only media. ^When immutable is set, SQLite assumes that the +** database file cannot be changed, even by a process with higher +** privilege, and so the database is opened read-only and all locking +** and change detection is disabled. Caution: Setting the immutable +** property on a database file that does in fact change can result +** in incorrect query results and/or [SQLITE_CORRUPT] errors. +** See also: [SQLITE_IOCAP_IMMUTABLE]. +** +**
+** +** ^Specifying an unknown parameter in the query component of a URI is not an +** error. Future versions of SQLite might understand additional query +** parameters. See "[query parameters with special meaning to SQLite]" for +** additional information. +** +** [[URI filename examples]]

URI filename examples

+** +** +**
URI filenames Results +**
file:data.db +** Open the file "data.db" in the current directory. +**
file:/home/fred/data.db
+** file:///home/fred/data.db
+** file://localhost/home/fred/data.db
+** Open the database file "/home/fred/data.db". +**
file://darkstar/home/fred/data.db +** An error. "darkstar" is not a recognized authority. +**
+** file:///C:/Documents%20and%20Settings/fred/Desktop/data.db +** Windows only: Open the file "data.db" on fred's desktop on drive +** C:. Note that the %20 escaping in this example is not strictly +** necessary - space characters can be used literally +** in URI filenames. +**
file:data.db?mode=ro&cache=private +** Open file "data.db" in the current directory for read-only access. +** Regardless of whether or not shared-cache mode is enabled by +** default, use a private cache. +**
file:/home/fred/data.db?vfs=unix-dotfile +** Open file "/home/fred/data.db". Use the special VFS "unix-dotfile" +** that uses dot-files in place of posix advisory locking. +**
file:data.db?mode=readonly +** An error. "readonly" is not a valid option for the "mode" parameter. +**
+** +** ^URI hexadecimal escape sequences (%HH) are supported within the path and +** query components of a URI. A hexadecimal escape sequence consists of a +** percent sign - "%" - followed by exactly two hexadecimal digits +** specifying an octet value. ^Before the path or query components of a +** URI filename are interpreted, they are encoded using UTF-8 and all +** hexadecimal escape sequences replaced by a single byte containing the +** corresponding octet. If this process generates an invalid UTF-8 encoding, +** the results are undefined. +** +** Note to Windows users: The encoding used for the filename argument +** of sqlite3_open() and sqlite3_open_v2() must be UTF-8, not whatever +** codepage is currently defined. Filenames containing international +** characters must be converted to UTF-8 prior to passing them into +** sqlite3_open() or sqlite3_open_v2(). +** +** Note to Windows Runtime users: The temporary directory must be set +** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various +** features that require the use of temporary files may fail. +** +** See also: [sqlite3_temp_directory] +*/ +SQLITE_API int sqlite3_open( + const char *filename, /* Database filename (UTF-8) */ + sqlite3 **ppDb /* OUT: SQLite db handle */ +); +SQLITE_API int sqlite3_open16( + const void *filename, /* Database filename (UTF-16) */ + sqlite3 **ppDb /* OUT: SQLite db handle */ +); +SQLITE_API int sqlite3_open_v2( + const char *filename, /* Database filename (UTF-8) */ + sqlite3 **ppDb, /* OUT: SQLite db handle */ + int flags, /* Flags */ + const char *zVfs /* Name of VFS module to use */ +); + +/* +** CAPI3REF: Obtain Values For URI Parameters +** +** These are utility routines, useful to [VFS|custom VFS implementations], +** that check if a database file was a URI that contained a specific query +** parameter, and if so obtains the value of that query parameter. +** +** The first parameter to these interfaces (hereafter referred to +** as F) must be one of: +**
    +**
  • A database filename pointer created by the SQLite core and +** passed into the xOpen() method of a VFS implemention, or +**
  • A filename obtained from [sqlite3_db_filename()], or +**
  • A new filename constructed using [sqlite3_create_filename()]. +**
+** If the F parameter is not one of the above, then the behavior is +** undefined and probably undesirable. Older versions of SQLite were +** more tolerant of invalid F parameters than newer versions. +** +** If F is a suitable filename (as described in the previous paragraph) +** and if P is the name of the query parameter, then +** sqlite3_uri_parameter(F,P) returns the value of the P +** parameter if it exists or a NULL pointer if P does not appear as a +** query parameter on F. If P is a query parameter of F and it +** has no explicit value, then sqlite3_uri_parameter(F,P) returns +** a pointer to an empty string. +** +** The sqlite3_uri_boolean(F,P,B) routine assumes that P is a boolean +** parameter and returns true (1) or false (0) according to the value +** of P. The sqlite3_uri_boolean(F,P,B) routine returns true (1) if the +** value of query parameter P is one of "yes", "true", or "on" in any +** case or if the value begins with a non-zero number. The +** sqlite3_uri_boolean(F,P,B) routines returns false (0) if the value of +** query parameter P is one of "no", "false", or "off" in any case or +** if the value begins with a numeric zero. If P is not a query +** parameter on F or if the value of P does not match any of the +** above, then sqlite3_uri_boolean(F,P,B) returns (B!=0). +** +** The sqlite3_uri_int64(F,P,D) routine converts the value of P into a +** 64-bit signed integer and returns that integer, or D if P does not +** exist. If the value of P is something other than an integer, then +** zero is returned. +** +** The sqlite3_uri_key(F,N) returns a pointer to the name (not +** the value) of the N-th query parameter for filename F, or a NULL +** pointer if N is less than zero or greater than the number of query +** parameters minus 1. The N value is zero-based so N should be 0 to obtain +** the name of the first query parameter, 1 for the second parameter, and +** so forth. +** +** If F is a NULL pointer, then sqlite3_uri_parameter(F,P) returns NULL and +** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and +** is not a database file pathname pointer that the SQLite core passed +** into the xOpen VFS method, then the behavior of this routine is undefined +** and probably undesirable. +** +** Beginning with SQLite [version 3.31.0] ([dateof:3.31.0]) the input F +** parameter can also be the name of a rollback journal file or WAL file +** in addition to the main database file. Prior to version 3.31.0, these +** routines would only work if F was the name of the main database file. +** When the F parameter is the name of the rollback journal or WAL file, +** it has access to all the same query parameters as were found on the +** main database file. +** +** See the [URI filename] documentation for additional information. +*/ +SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam); +SQLITE_API int sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault); +SQLITE_API sqlite3_int64 sqlite3_uri_int64(const char*, const char*, sqlite3_int64); +SQLITE_API const char *sqlite3_uri_key(const char *zFilename, int N); + +/* +** CAPI3REF: Translate filenames +** +** These routines are available to [VFS|custom VFS implementations] for +** translating filenames between the main database file, the journal file, +** and the WAL file. +** +** If F is the name of an sqlite database file, journal file, or WAL file +** passed by the SQLite core into the VFS, then sqlite3_filename_database(F) +** returns the name of the corresponding database file. +** +** If F is the name of an sqlite database file, journal file, or WAL file +** passed by the SQLite core into the VFS, or if F is a database filename +** obtained from [sqlite3_db_filename()], then sqlite3_filename_journal(F) +** returns the name of the corresponding rollback journal file. +** +** If F is the name of an sqlite database file, journal file, or WAL file +** that was passed by the SQLite core into the VFS, or if F is a database +** filename obtained from [sqlite3_db_filename()], then +** sqlite3_filename_wal(F) returns the name of the corresponding +** WAL file. +** +** In all of the above, if F is not the name of a database, journal or WAL +** filename passed into the VFS from the SQLite core and F is not the +** return value from [sqlite3_db_filename()], then the result is +** undefined and is likely a memory access violation. +*/ +SQLITE_API const char *sqlite3_filename_database(const char*); +SQLITE_API const char *sqlite3_filename_journal(const char*); +SQLITE_API const char *sqlite3_filename_wal(const char*); + +/* +** CAPI3REF: Database File Corresponding To A Journal +** +** ^If X is the name of a rollback or WAL-mode journal file that is +** passed into the xOpen method of [sqlite3_vfs], then +** sqlite3_database_file_object(X) returns a pointer to the [sqlite3_file] +** object that represents the main database file. +** +** This routine is intended for use in custom [VFS] implementations +** only. It is not a general-purpose interface. +** The argument sqlite3_file_object(X) must be a filename pointer that +** has been passed into [sqlite3_vfs].xOpen method where the +** flags parameter to xOpen contains one of the bits +** [SQLITE_OPEN_MAIN_JOURNAL] or [SQLITE_OPEN_WAL]. Any other use +** of this routine results in undefined and probably undesirable +** behavior. +*/ +SQLITE_API sqlite3_file *sqlite3_database_file_object(const char*); + +/* +** CAPI3REF: Create and Destroy VFS Filenames +** +** These interfces are provided for use by [VFS shim] implementations and +** are not useful outside of that context. +** +** The sqlite3_create_filename(D,J,W,N,P) allocates memory to hold a version of +** database filename D with corresponding journal file J and WAL file W and +** with N URI parameters key/values pairs in the array P. The result from +** sqlite3_create_filename(D,J,W,N,P) is a pointer to a database filename that +** is safe to pass to routines like: +**
    +**
  • [sqlite3_uri_parameter()], +**
  • [sqlite3_uri_boolean()], +**
  • [sqlite3_uri_int64()], +**
  • [sqlite3_uri_key()], +**
  • [sqlite3_filename_database()], +**
  • [sqlite3_filename_journal()], or +**
  • [sqlite3_filename_wal()]. +**
+** If a memory allocation error occurs, sqlite3_create_filename() might +** return a NULL pointer. The memory obtained from sqlite3_create_filename(X) +** must be released by a corresponding call to sqlite3_free_filename(Y). +** +** The P parameter in sqlite3_create_filename(D,J,W,N,P) should be an array +** of 2*N pointers to strings. Each pair of pointers in this array corresponds +** to a key and value for a query parameter. The P parameter may be a NULL +** pointer if N is zero. None of the 2*N pointers in the P array may be +** NULL pointers and key pointers should not be empty strings. +** None of the D, J, or W parameters to sqlite3_create_filename(D,J,W,N,P) may +** be NULL pointers, though they can be empty strings. +** +** The sqlite3_free_filename(Y) routine releases a memory allocation +** previously obtained from sqlite3_create_filename(). Invoking +** sqlite3_free_filename(Y) where Y is a NULL pointer is a harmless no-op. +** +** If the Y parameter to sqlite3_free_filename(Y) is anything other +** than a NULL pointer or a pointer previously acquired from +** sqlite3_create_filename(), then bad things such as heap +** corruption or segfaults may occur. The value Y should be +** used again after sqlite3_free_filename(Y) has been called. This means +** that if the [sqlite3_vfs.xOpen()] method of a VFS has been called using Y, +** then the corresponding [sqlite3_module.xClose() method should also be +** invoked prior to calling sqlite3_free_filename(Y). +*/ +SQLITE_API char *sqlite3_create_filename( + const char *zDatabase, + const char *zJournal, + const char *zWal, + int nParam, + const char **azParam +); +SQLITE_API void sqlite3_free_filename(char*); + +/* +** CAPI3REF: Error Codes And Messages +** METHOD: sqlite3 +** +** ^If the most recent sqlite3_* API call associated with +** [database connection] D failed, then the sqlite3_errcode(D) interface +** returns the numeric [result code] or [extended result code] for that +** API call. +** ^The sqlite3_extended_errcode() +** interface is the same except that it always returns the +** [extended result code] even when extended result codes are +** disabled. +** +** The values returned by sqlite3_errcode() and/or +** sqlite3_extended_errcode() might change with each API call. +** Except, there are some interfaces that are guaranteed to never +** change the value of the error code. The error-code preserving +** interfaces are: +** +**
    +**
  • sqlite3_errcode() +**
  • sqlite3_extended_errcode() +**
  • sqlite3_errmsg() +**
  • sqlite3_errmsg16() +**
+** +** ^The sqlite3_errmsg() and sqlite3_errmsg16() return English-language +** text that describes the error, as either UTF-8 or UTF-16 respectively. +** ^(Memory to hold the error message string is managed internally. +** The application does not need to worry about freeing the result. +** However, the error string might be overwritten or deallocated by +** subsequent calls to other SQLite interface functions.)^ +** +** ^The sqlite3_errstr() interface returns the English-language text +** that describes the [result code], as UTF-8. +** ^(Memory to hold the error message string is managed internally +** and must not be freed by the application)^. +** +** When the serialized [threading mode] is in use, it might be the +** case that a second error occurs on a separate thread in between +** the time of the first error and the call to these interfaces. +** When that happens, the second error will be reported since these +** interfaces always report the most recent result. To avoid +** this, each thread can obtain exclusive use of the [database connection] D +** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning +** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after +** all calls to the interfaces listed here are completed. +** +** If an interface fails with SQLITE_MISUSE, that means the interface +** was invoked incorrectly by the application. In that case, the +** error code and message may or may not be set. +*/ +SQLITE_API int sqlite3_errcode(sqlite3 *db); +SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); +SQLITE_API const char *sqlite3_errmsg(sqlite3*); +SQLITE_API const void *sqlite3_errmsg16(sqlite3*); +SQLITE_API const char *sqlite3_errstr(int); + +/* +** CAPI3REF: Prepared Statement Object +** KEYWORDS: {prepared statement} {prepared statements} +** +** An instance of this object represents a single SQL statement that +** has been compiled into binary form and is ready to be evaluated. +** +** Think of each SQL statement as a separate computer program. The +** original SQL text is source code. A prepared statement object +** is the compiled object code. All SQL must be converted into a +** prepared statement before it can be run. +** +** The life-cycle of a prepared statement object usually goes like this: +** +**
    +**
  1. Create the prepared statement object using [sqlite3_prepare_v2()]. +**
  2. Bind values to [parameters] using the sqlite3_bind_*() +** interfaces. +**
  3. Run the SQL by calling [sqlite3_step()] one or more times. +**
  4. Reset the prepared statement using [sqlite3_reset()] then go back +** to step 2. Do this zero or more times. +**
  5. Destroy the object using [sqlite3_finalize()]. +**
+*/ +typedef struct sqlite3_stmt sqlite3_stmt; + +/* +** CAPI3REF: Run-time Limits +** METHOD: sqlite3 +** +** ^(This interface allows the size of various constructs to be limited +** on a connection by connection basis. The first parameter is the +** [database connection] whose limit is to be set or queried. The +** second parameter is one of the [limit categories] that define a +** class of constructs to be size limited. The third parameter is the +** new limit for that construct.)^ +** +** ^If the new limit is a negative number, the limit is unchanged. +** ^(For each limit category SQLITE_LIMIT_NAME there is a +** [limits | hard upper bound] +** set at compile-time by a C preprocessor macro called +** [limits | SQLITE_MAX_NAME]. +** (The "_LIMIT_" in the name is changed to "_MAX_".))^ +** ^Attempts to increase a limit above its hard upper bound are +** silently truncated to the hard upper bound. +** +** ^Regardless of whether or not the limit was changed, the +** [sqlite3_limit()] interface returns the prior value of the limit. +** ^Hence, to find the current value of a limit without changing it, +** simply invoke this interface with the third parameter set to -1. +** +** Run-time limits are intended for use in applications that manage +** both their own internal database and also databases that are controlled +** by untrusted external sources. An example application might be a +** web browser that has its own databases for storing history and +** separate databases controlled by JavaScript applications downloaded +** off the Internet. The internal databases can be given the +** large, default limits. Databases managed by external sources can +** be given much smaller limits designed to prevent a denial of service +** attack. Developers might also want to use the [sqlite3_set_authorizer()] +** interface to further control untrusted SQL. The size of the database +** created by an untrusted script can be contained using the +** [max_page_count] [PRAGMA]. +** +** New run-time limit categories may be added in future releases. +*/ +SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); + +/* +** CAPI3REF: Run-Time Limit Categories +** KEYWORDS: {limit category} {*limit categories} +** +** These constants define various performance limits +** that can be lowered at run-time using [sqlite3_limit()]. +** The synopsis of the meanings of the various limits is shown below. +** Additional information is available at [limits | Limits in SQLite]. +** +**
+** [[SQLITE_LIMIT_LENGTH]] ^(
SQLITE_LIMIT_LENGTH
+**
The maximum size of any string or BLOB or table row, in bytes.
)^ +** +** [[SQLITE_LIMIT_SQL_LENGTH]] ^(
SQLITE_LIMIT_SQL_LENGTH
+**
The maximum length of an SQL statement, in bytes.
)^ +** +** [[SQLITE_LIMIT_COLUMN]] ^(
SQLITE_LIMIT_COLUMN
+**
The maximum number of columns in a table definition or in the +** result set of a [SELECT] or the maximum number of columns in an index +** or in an ORDER BY or GROUP BY clause.
)^ +** +** [[SQLITE_LIMIT_EXPR_DEPTH]] ^(
SQLITE_LIMIT_EXPR_DEPTH
+**
The maximum depth of the parse tree on any expression.
)^ +** +** [[SQLITE_LIMIT_COMPOUND_SELECT]] ^(
SQLITE_LIMIT_COMPOUND_SELECT
+**
The maximum number of terms in a compound SELECT statement.
)^ +** +** [[SQLITE_LIMIT_VDBE_OP]] ^(
SQLITE_LIMIT_VDBE_OP
+**
The maximum number of instructions in a virtual machine program +** used to implement an SQL statement. If [sqlite3_prepare_v2()] or +** the equivalent tries to allocate space for more than this many opcodes +** in a single prepared statement, an SQLITE_NOMEM error is returned.
)^ +** +** [[SQLITE_LIMIT_FUNCTION_ARG]] ^(
SQLITE_LIMIT_FUNCTION_ARG
+**
The maximum number of arguments on a function.
)^ +** +** [[SQLITE_LIMIT_ATTACHED]] ^(
SQLITE_LIMIT_ATTACHED
+**
The maximum number of [ATTACH | attached databases].)^
+** +** [[SQLITE_LIMIT_LIKE_PATTERN_LENGTH]] +** ^(
SQLITE_LIMIT_LIKE_PATTERN_LENGTH
+**
The maximum length of the pattern argument to the [LIKE] or +** [GLOB] operators.
)^ +** +** [[SQLITE_LIMIT_VARIABLE_NUMBER]] +** ^(
SQLITE_LIMIT_VARIABLE_NUMBER
+**
The maximum index number of any [parameter] in an SQL statement.)^ +** +** [[SQLITE_LIMIT_TRIGGER_DEPTH]] ^(
SQLITE_LIMIT_TRIGGER_DEPTH
+**
The maximum depth of recursion for triggers.
)^ +** +** [[SQLITE_LIMIT_WORKER_THREADS]] ^(
SQLITE_LIMIT_WORKER_THREADS
+**
The maximum number of auxiliary worker threads that a single +** [prepared statement] may start.
)^ +**
+*/ +#define SQLITE_LIMIT_LENGTH 0 +#define SQLITE_LIMIT_SQL_LENGTH 1 +#define SQLITE_LIMIT_COLUMN 2 +#define SQLITE_LIMIT_EXPR_DEPTH 3 +#define SQLITE_LIMIT_COMPOUND_SELECT 4 +#define SQLITE_LIMIT_VDBE_OP 5 +#define SQLITE_LIMIT_FUNCTION_ARG 6 +#define SQLITE_LIMIT_ATTACHED 7 +#define SQLITE_LIMIT_LIKE_PATTERN_LENGTH 8 +#define SQLITE_LIMIT_VARIABLE_NUMBER 9 +#define SQLITE_LIMIT_TRIGGER_DEPTH 10 +#define SQLITE_LIMIT_WORKER_THREADS 11 + +/* +** CAPI3REF: Prepare Flags +** +** These constants define various flags that can be passed into +** "prepFlags" parameter of the [sqlite3_prepare_v3()] and +** [sqlite3_prepare16_v3()] interfaces. +** +** New flags may be added in future releases of SQLite. +** +**
+** [[SQLITE_PREPARE_PERSISTENT]] ^(
SQLITE_PREPARE_PERSISTENT
+**
The SQLITE_PREPARE_PERSISTENT flag is a hint to the query planner +** that the prepared statement will be retained for a long time and +** probably reused many times.)^ ^Without this flag, [sqlite3_prepare_v3()] +** and [sqlite3_prepare16_v3()] assume that the prepared statement will +** be used just once or at most a few times and then destroyed using +** [sqlite3_finalize()] relatively soon. The current implementation acts +** on this hint by avoiding the use of [lookaside memory] so as not to +** deplete the limited store of lookaside memory. Future versions of +** SQLite may act on this hint differently. +** +** [[SQLITE_PREPARE_NORMALIZE]]
SQLITE_PREPARE_NORMALIZE
+**
The SQLITE_PREPARE_NORMALIZE flag is a no-op. This flag used +** to be required for any prepared statement that wanted to use the +** [sqlite3_normalized_sql()] interface. However, the +** [sqlite3_normalized_sql()] interface is now available to all +** prepared statements, regardless of whether or not they use this +** flag. +** +** [[SQLITE_PREPARE_NO_VTAB]]
SQLITE_PREPARE_NO_VTAB
+**
The SQLITE_PREPARE_NO_VTAB flag causes the SQL compiler +** to return an error (error code SQLITE_ERROR) if the statement uses +** any virtual tables. +**
+*/ +#define SQLITE_PREPARE_PERSISTENT 0x01 +#define SQLITE_PREPARE_NORMALIZE 0x02 +#define SQLITE_PREPARE_NO_VTAB 0x04 + +/* +** CAPI3REF: Compiling An SQL Statement +** KEYWORDS: {SQL statement compiler} +** METHOD: sqlite3 +** CONSTRUCTOR: sqlite3_stmt +** +** To execute an SQL statement, it must first be compiled into a byte-code +** program using one of these routines. Or, in other words, these routines +** are constructors for the [prepared statement] object. +** +** The preferred routine to use is [sqlite3_prepare_v2()]. The +** [sqlite3_prepare()] interface is legacy and should be avoided. +** [sqlite3_prepare_v3()] has an extra "prepFlags" option that is used +** for special purposes. +** +** The use of the UTF-8 interfaces is preferred, as SQLite currently +** does all parsing using UTF-8. The UTF-16 interfaces are provided +** as a convenience. The UTF-16 interfaces work by converting the +** input text into UTF-8, then invoking the corresponding UTF-8 interface. +** +** The first argument, "db", is a [database connection] obtained from a +** prior successful call to [sqlite3_open()], [sqlite3_open_v2()] or +** [sqlite3_open16()]. The database connection must not have been closed. +** +** The second argument, "zSql", is the statement to be compiled, encoded +** as either UTF-8 or UTF-16. The sqlite3_prepare(), sqlite3_prepare_v2(), +** and sqlite3_prepare_v3() +** interfaces use UTF-8, and sqlite3_prepare16(), sqlite3_prepare16_v2(), +** and sqlite3_prepare16_v3() use UTF-16. +** +** ^If the nByte argument is negative, then zSql is read up to the +** first zero terminator. ^If nByte is positive, then it is the +** number of bytes read from zSql. ^If nByte is zero, then no prepared +** statement is generated. +** If the caller knows that the supplied string is nul-terminated, then +** there is a small performance advantage to passing an nByte parameter that +** is the number of bytes in the input string including +** the nul-terminator. +** +** ^If pzTail is not NULL then *pzTail is made to point to the first byte +** past the end of the first SQL statement in zSql. These routines only +** compile the first statement in zSql, so *pzTail is left pointing to +** what remains uncompiled. +** +** ^*ppStmt is left pointing to a compiled [prepared statement] that can be +** executed using [sqlite3_step()]. ^If there is an error, *ppStmt is set +** to NULL. ^If the input text contains no SQL (if the input is an empty +** string or a comment) then *ppStmt is set to NULL. +** The calling procedure is responsible for deleting the compiled +** SQL statement using [sqlite3_finalize()] after it has finished with it. +** ppStmt may not be NULL. +** +** ^On success, the sqlite3_prepare() family of routines return [SQLITE_OK]; +** otherwise an [error code] is returned. +** +** The sqlite3_prepare_v2(), sqlite3_prepare_v3(), sqlite3_prepare16_v2(), +** and sqlite3_prepare16_v3() interfaces are recommended for all new programs. +** The older interfaces (sqlite3_prepare() and sqlite3_prepare16()) +** are retained for backwards compatibility, but their use is discouraged. +** ^In the "vX" interfaces, the prepared statement +** that is returned (the [sqlite3_stmt] object) contains a copy of the +** original SQL text. This causes the [sqlite3_step()] interface to +** behave differently in three ways: +** +**
    +**
  1. +** ^If the database schema changes, instead of returning [SQLITE_SCHEMA] as it +** always used to do, [sqlite3_step()] will automatically recompile the SQL +** statement and try to run it again. As many as [SQLITE_MAX_SCHEMA_RETRY] +** retries will occur before sqlite3_step() gives up and returns an error. +**
  2. +** +**
  3. +** ^When an error occurs, [sqlite3_step()] will return one of the detailed +** [error codes] or [extended error codes]. ^The legacy behavior was that +** [sqlite3_step()] would only return a generic [SQLITE_ERROR] result code +** and the application would have to make a second call to [sqlite3_reset()] +** in order to find the underlying cause of the problem. With the "v2" prepare +** interfaces, the underlying reason for the error is returned immediately. +**
  4. +** +**
  5. +** ^If the specific value bound to a [parameter | host parameter] in the +** WHERE clause might influence the choice of query plan for a statement, +** then the statement will be automatically recompiled, as if there had been +** a schema change, on the first [sqlite3_step()] call following any change +** to the [sqlite3_bind_text | bindings] of that [parameter]. +** ^The specific value of a WHERE-clause [parameter] might influence the +** choice of query plan if the parameter is the left-hand side of a [LIKE] +** or [GLOB] operator or if the parameter is compared to an indexed column +** and the [SQLITE_ENABLE_STAT4] compile-time option is enabled. +**
  6. +**
+** +**

^sqlite3_prepare_v3() differs from sqlite3_prepare_v2() only in having +** the extra prepFlags parameter, which is a bit array consisting of zero or +** more of the [SQLITE_PREPARE_PERSISTENT|SQLITE_PREPARE_*] flags. ^The +** sqlite3_prepare_v2() interface works exactly the same as +** sqlite3_prepare_v3() with a zero prepFlags parameter. +*/ +SQLITE_API int sqlite3_prepare( + sqlite3 *db, /* Database handle */ + const char *zSql, /* SQL statement, UTF-8 encoded */ + int nByte, /* Maximum length of zSql in bytes. */ + sqlite3_stmt **ppStmt, /* OUT: Statement handle */ + const char **pzTail /* OUT: Pointer to unused portion of zSql */ +); +SQLITE_API int sqlite3_prepare_v2( + sqlite3 *db, /* Database handle */ + const char *zSql, /* SQL statement, UTF-8 encoded */ + int nByte, /* Maximum length of zSql in bytes. */ + sqlite3_stmt **ppStmt, /* OUT: Statement handle */ + const char **pzTail /* OUT: Pointer to unused portion of zSql */ +); +SQLITE_API int sqlite3_prepare_v3( + sqlite3 *db, /* Database handle */ + const char *zSql, /* SQL statement, UTF-8 encoded */ + int nByte, /* Maximum length of zSql in bytes. */ + unsigned int prepFlags, /* Zero or more SQLITE_PREPARE_ flags */ + sqlite3_stmt **ppStmt, /* OUT: Statement handle */ + const char **pzTail /* OUT: Pointer to unused portion of zSql */ +); +SQLITE_API int sqlite3_prepare16( + sqlite3 *db, /* Database handle */ + const void *zSql, /* SQL statement, UTF-16 encoded */ + int nByte, /* Maximum length of zSql in bytes. */ + sqlite3_stmt **ppStmt, /* OUT: Statement handle */ + const void **pzTail /* OUT: Pointer to unused portion of zSql */ +); +SQLITE_API int sqlite3_prepare16_v2( + sqlite3 *db, /* Database handle */ + const void *zSql, /* SQL statement, UTF-16 encoded */ + int nByte, /* Maximum length of zSql in bytes. */ + sqlite3_stmt **ppStmt, /* OUT: Statement handle */ + const void **pzTail /* OUT: Pointer to unused portion of zSql */ +); +SQLITE_API int sqlite3_prepare16_v3( + sqlite3 *db, /* Database handle */ + const void *zSql, /* SQL statement, UTF-16 encoded */ + int nByte, /* Maximum length of zSql in bytes. */ + unsigned int prepFlags, /* Zero or more SQLITE_PREPARE_ flags */ + sqlite3_stmt **ppStmt, /* OUT: Statement handle */ + const void **pzTail /* OUT: Pointer to unused portion of zSql */ +); + +/* +** CAPI3REF: Retrieving Statement SQL +** METHOD: sqlite3_stmt +** +** ^The sqlite3_sql(P) interface returns a pointer to a copy of the UTF-8 +** SQL text used to create [prepared statement] P if P was +** created by [sqlite3_prepare_v2()], [sqlite3_prepare_v3()], +** [sqlite3_prepare16_v2()], or [sqlite3_prepare16_v3()]. +** ^The sqlite3_expanded_sql(P) interface returns a pointer to a UTF-8 +** string containing the SQL text of prepared statement P with +** [bound parameters] expanded. +** ^The sqlite3_normalized_sql(P) interface returns a pointer to a UTF-8 +** string containing the normalized SQL text of prepared statement P. The +** semantics used to normalize a SQL statement are unspecified and subject +** to change. At a minimum, literal values will be replaced with suitable +** placeholders. +** +** ^(For example, if a prepared statement is created using the SQL +** text "SELECT $abc,:xyz" and if parameter $abc is bound to integer 2345 +** and parameter :xyz is unbound, then sqlite3_sql() will return +** the original string, "SELECT $abc,:xyz" but sqlite3_expanded_sql() +** will return "SELECT 2345,NULL".)^ +** +** ^The sqlite3_expanded_sql() interface returns NULL if insufficient memory +** is available to hold the result, or if the result would exceed the +** the maximum string length determined by the [SQLITE_LIMIT_LENGTH]. +** +** ^The [SQLITE_TRACE_SIZE_LIMIT] compile-time option limits the size of +** bound parameter expansions. ^The [SQLITE_OMIT_TRACE] compile-time +** option causes sqlite3_expanded_sql() to always return NULL. +** +** ^The strings returned by sqlite3_sql(P) and sqlite3_normalized_sql(P) +** are managed by SQLite and are automatically freed when the prepared +** statement is finalized. +** ^The string returned by sqlite3_expanded_sql(P), on the other hand, +** is obtained from [sqlite3_malloc()] and must be free by the application +** by passing it to [sqlite3_free()]. +*/ +SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt); +SQLITE_API char *sqlite3_expanded_sql(sqlite3_stmt *pStmt); +SQLITE_API const char *sqlite3_normalized_sql(sqlite3_stmt *pStmt); + +/* +** CAPI3REF: Determine If An SQL Statement Writes The Database +** METHOD: sqlite3_stmt +** +** ^The sqlite3_stmt_readonly(X) interface returns true (non-zero) if +** and only if the [prepared statement] X makes no direct changes to +** the content of the database file. +** +** Note that [application-defined SQL functions] or +** [virtual tables] might change the database indirectly as a side effect. +** ^(For example, if an application defines a function "eval()" that +** calls [sqlite3_exec()], then the following SQL statement would +** change the database file through side-effects: +** +**

+**    SELECT eval('DELETE FROM t1') FROM t2;
+** 
+** +** But because the [SELECT] statement does not change the database file +** directly, sqlite3_stmt_readonly() would still return true.)^ +** +** ^Transaction control statements such as [BEGIN], [COMMIT], [ROLLBACK], +** [SAVEPOINT], and [RELEASE] cause sqlite3_stmt_readonly() to return true, +** since the statements themselves do not actually modify the database but +** rather they control the timing of when other statements modify the +** database. ^The [ATTACH] and [DETACH] statements also cause +** sqlite3_stmt_readonly() to return true since, while those statements +** change the configuration of a database connection, they do not make +** changes to the content of the database files on disk. +** ^The sqlite3_stmt_readonly() interface returns true for [BEGIN] since +** [BEGIN] merely sets internal flags, but the [BEGIN|BEGIN IMMEDIATE] and +** [BEGIN|BEGIN EXCLUSIVE] commands do touch the database and so +** sqlite3_stmt_readonly() returns false for those commands. +*/ +SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt); + +/* +** CAPI3REF: Query The EXPLAIN Setting For A Prepared Statement +** METHOD: sqlite3_stmt +** +** ^The sqlite3_stmt_isexplain(S) interface returns 1 if the +** prepared statement S is an EXPLAIN statement, or 2 if the +** statement S is an EXPLAIN QUERY PLAN. +** ^The sqlite3_stmt_isexplain(S) interface returns 0 if S is +** an ordinary statement or a NULL pointer. +*/ +SQLITE_API int sqlite3_stmt_isexplain(sqlite3_stmt *pStmt); + +/* +** CAPI3REF: Determine If A Prepared Statement Has Been Reset +** METHOD: sqlite3_stmt +** +** ^The sqlite3_stmt_busy(S) interface returns true (non-zero) if the +** [prepared statement] S has been stepped at least once using +** [sqlite3_step(S)] but has neither run to completion (returned +** [SQLITE_DONE] from [sqlite3_step(S)]) nor +** been reset using [sqlite3_reset(S)]. ^The sqlite3_stmt_busy(S) +** interface returns false if S is a NULL pointer. If S is not a +** NULL pointer and is not a pointer to a valid [prepared statement] +** object, then the behavior is undefined and probably undesirable. +** +** This interface can be used in combination [sqlite3_next_stmt()] +** to locate all prepared statements associated with a database +** connection that are in need of being reset. This can be used, +** for example, in diagnostic routines to search for prepared +** statements that are holding a transaction open. +*/ +SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt*); + +/* +** CAPI3REF: Dynamically Typed Value Object +** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value} +** +** SQLite uses the sqlite3_value object to represent all values +** that can be stored in a database table. SQLite uses dynamic typing +** for the values it stores. ^Values stored in sqlite3_value objects +** can be integers, floating point values, strings, BLOBs, or NULL. +** +** An sqlite3_value object may be either "protected" or "unprotected". +** Some interfaces require a protected sqlite3_value. Other interfaces +** will accept either a protected or an unprotected sqlite3_value. +** Every interface that accepts sqlite3_value arguments specifies +** whether or not it requires a protected sqlite3_value. The +** [sqlite3_value_dup()] interface can be used to construct a new +** protected sqlite3_value from an unprotected sqlite3_value. +** +** The terms "protected" and "unprotected" refer to whether or not +** a mutex is held. An internal mutex is held for a protected +** sqlite3_value object but no mutex is held for an unprotected +** sqlite3_value object. If SQLite is compiled to be single-threaded +** (with [SQLITE_THREADSAFE=0] and with [sqlite3_threadsafe()] returning 0) +** or if SQLite is run in one of reduced mutex modes +** [SQLITE_CONFIG_SINGLETHREAD] or [SQLITE_CONFIG_MULTITHREAD] +** then there is no distinction between protected and unprotected +** sqlite3_value objects and they can be used interchangeably. However, +** for maximum code portability it is recommended that applications +** still make the distinction between protected and unprotected +** sqlite3_value objects even when not strictly required. +** +** ^The sqlite3_value objects that are passed as parameters into the +** implementation of [application-defined SQL functions] are protected. +** ^The sqlite3_value object returned by +** [sqlite3_column_value()] is unprotected. +** Unprotected sqlite3_value objects may only be used as arguments +** to [sqlite3_result_value()], [sqlite3_bind_value()], and +** [sqlite3_value_dup()]. +** The [sqlite3_value_blob | sqlite3_value_type()] family of +** interfaces require protected sqlite3_value objects. +*/ +typedef struct sqlite3_value sqlite3_value; + +/* +** CAPI3REF: SQL Function Context Object +** +** The context in which an SQL function executes is stored in an +** sqlite3_context object. ^A pointer to an sqlite3_context object +** is always first parameter to [application-defined SQL functions]. +** The application-defined SQL function implementation will pass this +** pointer through into calls to [sqlite3_result_int | sqlite3_result()], +** [sqlite3_aggregate_context()], [sqlite3_user_data()], +** [sqlite3_context_db_handle()], [sqlite3_get_auxdata()], +** and/or [sqlite3_set_auxdata()]. +*/ +typedef struct sqlite3_context sqlite3_context; + +/* +** CAPI3REF: Binding Values To Prepared Statements +** KEYWORDS: {host parameter} {host parameters} {host parameter name} +** KEYWORDS: {SQL parameter} {SQL parameters} {parameter binding} +** METHOD: sqlite3_stmt +** +** ^(In the SQL statement text input to [sqlite3_prepare_v2()] and its variants, +** literals may be replaced by a [parameter] that matches one of following +** templates: +** +**
    +**
  • ? +**
  • ?NNN +**
  • :VVV +**
  • @VVV +**
  • $VVV +**
+** +** In the templates above, NNN represents an integer literal, +** and VVV represents an alphanumeric identifier.)^ ^The values of these +** parameters (also called "host parameter names" or "SQL parameters") +** can be set using the sqlite3_bind_*() routines defined here. +** +** ^The first argument to the sqlite3_bind_*() routines is always +** a pointer to the [sqlite3_stmt] object returned from +** [sqlite3_prepare_v2()] or its variants. +** +** ^The second argument is the index of the SQL parameter to be set. +** ^The leftmost SQL parameter has an index of 1. ^When the same named +** SQL parameter is used more than once, second and subsequent +** occurrences have the same index as the first occurrence. +** ^The index for named parameters can be looked up using the +** [sqlite3_bind_parameter_index()] API if desired. ^The index +** for "?NNN" parameters is the value of NNN. +** ^The NNN value must be between 1 and the [sqlite3_limit()] +** parameter [SQLITE_LIMIT_VARIABLE_NUMBER] (default value: 32766). +** +** ^The third argument is the value to bind to the parameter. +** ^If the third parameter to sqlite3_bind_text() or sqlite3_bind_text16() +** or sqlite3_bind_blob() is a NULL pointer then the fourth parameter +** is ignored and the end result is the same as sqlite3_bind_null(). +** ^If the third parameter to sqlite3_bind_text() is not NULL, then +** it should be a pointer to well-formed UTF8 text. +** ^If the third parameter to sqlite3_bind_text16() is not NULL, then +** it should be a pointer to well-formed UTF16 text. +** ^If the third parameter to sqlite3_bind_text64() is not NULL, then +** it should be a pointer to a well-formed unicode string that is +** either UTF8 if the sixth parameter is SQLITE_UTF8, or UTF16 +** otherwise. +** +** [[byte-order determination rules]] ^The byte-order of +** UTF16 input text is determined by the byte-order mark (BOM, U+FEFF) +** found in first character, which is removed, or in the absence of a BOM +** the byte order is the native byte order of the host +** machine for sqlite3_bind_text16() or the byte order specified in +** the 6th parameter for sqlite3_bind_text64().)^ +** ^If UTF16 input text contains invalid unicode +** characters, then SQLite might change those invalid characters +** into the unicode replacement character: U+FFFD. +** +** ^(In those routines that have a fourth argument, its value is the +** number of bytes in the parameter. To be clear: the value is the +** number of bytes in the value, not the number of characters.)^ +** ^If the fourth parameter to sqlite3_bind_text() or sqlite3_bind_text16() +** is negative, then the length of the string is +** the number of bytes up to the first zero terminator. +** If the fourth parameter to sqlite3_bind_blob() is negative, then +** the behavior is undefined. +** If a non-negative fourth parameter is provided to sqlite3_bind_text() +** or sqlite3_bind_text16() or sqlite3_bind_text64() then +** that parameter must be the byte offset +** where the NUL terminator would occur assuming the string were NUL +** terminated. If any NUL characters occurs at byte offsets less than +** the value of the fourth parameter then the resulting string value will +** contain embedded NULs. The result of expressions involving strings +** with embedded NULs is undefined. +** +** ^The fifth argument to the BLOB and string binding interfaces +** is a destructor used to dispose of the BLOB or +** string after SQLite has finished with it. ^The destructor is called +** to dispose of the BLOB or string even if the call to the bind API fails, +** except the destructor is not called if the third parameter is a NULL +** pointer or the fourth parameter is negative. +** ^If the fifth argument is +** the special value [SQLITE_STATIC], then SQLite assumes that the +** information is in static, unmanaged space and does not need to be freed. +** ^If the fifth argument has the value [SQLITE_TRANSIENT], then +** SQLite makes its own private copy of the data immediately, before +** the sqlite3_bind_*() routine returns. +** +** ^The sixth argument to sqlite3_bind_text64() must be one of +** [SQLITE_UTF8], [SQLITE_UTF16], [SQLITE_UTF16BE], or [SQLITE_UTF16LE] +** to specify the encoding of the text in the third parameter. If +** the sixth argument to sqlite3_bind_text64() is not one of the +** allowed values shown above, or if the text encoding is different +** from the encoding specified by the sixth parameter, then the behavior +** is undefined. +** +** ^The sqlite3_bind_zeroblob() routine binds a BLOB of length N that +** is filled with zeroes. ^A zeroblob uses a fixed amount of memory +** (just an integer to hold its size) while it is being processed. +** Zeroblobs are intended to serve as placeholders for BLOBs whose +** content is later written using +** [sqlite3_blob_open | incremental BLOB I/O] routines. +** ^A negative value for the zeroblob results in a zero-length BLOB. +** +** ^The sqlite3_bind_pointer(S,I,P,T,D) routine causes the I-th parameter in +** [prepared statement] S to have an SQL value of NULL, but to also be +** associated with the pointer P of type T. ^D is either a NULL pointer or +** a pointer to a destructor function for P. ^SQLite will invoke the +** destructor D with a single argument of P when it is finished using +** P. The T parameter should be a static string, preferably a string +** literal. The sqlite3_bind_pointer() routine is part of the +** [pointer passing interface] added for SQLite 3.20.0. +** +** ^If any of the sqlite3_bind_*() routines are called with a NULL pointer +** for the [prepared statement] or with a prepared statement for which +** [sqlite3_step()] has been called more recently than [sqlite3_reset()], +** then the call will return [SQLITE_MISUSE]. If any sqlite3_bind_() +** routine is passed a [prepared statement] that has been finalized, the +** result is undefined and probably harmful. +** +** ^Bindings are not cleared by the [sqlite3_reset()] routine. +** ^Unbound parameters are interpreted as NULL. +** +** ^The sqlite3_bind_* routines return [SQLITE_OK] on success or an +** [error code] if anything goes wrong. +** ^[SQLITE_TOOBIG] might be returned if the size of a string or BLOB +** exceeds limits imposed by [sqlite3_limit]([SQLITE_LIMIT_LENGTH]) or +** [SQLITE_MAX_LENGTH]. +** ^[SQLITE_RANGE] is returned if the parameter +** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails. +** +** See also: [sqlite3_bind_parameter_count()], +** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()]. +*/ +SQLITE_API int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)); +SQLITE_API int sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64, + void(*)(void*)); +SQLITE_API int sqlite3_bind_double(sqlite3_stmt*, int, double); +SQLITE_API int sqlite3_bind_int(sqlite3_stmt*, int, int); +SQLITE_API int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64); +SQLITE_API int sqlite3_bind_null(sqlite3_stmt*, int); +SQLITE_API int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*)); +SQLITE_API int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*)); +SQLITE_API int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64, + void(*)(void*), unsigned char encoding); +SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); +SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt*, int, void*, const char*,void(*)(void*)); +SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n); +SQLITE_API int sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64); + +/* +** CAPI3REF: Number Of SQL Parameters +** METHOD: sqlite3_stmt +** +** ^This routine can be used to find the number of [SQL parameters] +** in a [prepared statement]. SQL parameters are tokens of the +** form "?", "?NNN", ":AAA", "$AAA", or "@AAA" that serve as +** placeholders for values that are [sqlite3_bind_blob | bound] +** to the parameters at a later time. +** +** ^(This routine actually returns the index of the largest (rightmost) +** parameter. For all forms except ?NNN, this will correspond to the +** number of unique parameters. If parameters of the ?NNN form are used, +** there may be gaps in the list.)^ +** +** See also: [sqlite3_bind_blob|sqlite3_bind()], +** [sqlite3_bind_parameter_name()], and +** [sqlite3_bind_parameter_index()]. +*/ +SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt*); + +/* +** CAPI3REF: Name Of A Host Parameter +** METHOD: sqlite3_stmt +** +** ^The sqlite3_bind_parameter_name(P,N) interface returns +** the name of the N-th [SQL parameter] in the [prepared statement] P. +** ^(SQL parameters of the form "?NNN" or ":AAA" or "@AAA" or "$AAA" +** have a name which is the string "?NNN" or ":AAA" or "@AAA" or "$AAA" +** respectively. +** In other words, the initial ":" or "$" or "@" or "?" +** is included as part of the name.)^ +** ^Parameters of the form "?" without a following integer have no name +** and are referred to as "nameless" or "anonymous parameters". +** +** ^The first host parameter has an index of 1, not 0. +** +** ^If the value N is out of range or if the N-th parameter is +** nameless, then NULL is returned. ^The returned string is +** always in UTF-8 encoding even if the named parameter was +** originally specified as UTF-16 in [sqlite3_prepare16()], +** [sqlite3_prepare16_v2()], or [sqlite3_prepare16_v3()]. +** +** See also: [sqlite3_bind_blob|sqlite3_bind()], +** [sqlite3_bind_parameter_count()], and +** [sqlite3_bind_parameter_index()]. +*/ +SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int); + +/* +** CAPI3REF: Index Of A Parameter With A Given Name +** METHOD: sqlite3_stmt +** +** ^Return the index of an SQL parameter given its name. ^The +** index value returned is suitable for use as the second +** parameter to [sqlite3_bind_blob|sqlite3_bind()]. ^A zero +** is returned if no matching parameter is found. ^The parameter +** name must be given in UTF-8 even if the original statement +** was prepared from UTF-16 text using [sqlite3_prepare16_v2()] or +** [sqlite3_prepare16_v3()]. +** +** See also: [sqlite3_bind_blob|sqlite3_bind()], +** [sqlite3_bind_parameter_count()], and +** [sqlite3_bind_parameter_name()]. +*/ +SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName); + +/* +** CAPI3REF: Reset All Bindings On A Prepared Statement +** METHOD: sqlite3_stmt +** +** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset +** the [sqlite3_bind_blob | bindings] on a [prepared statement]. +** ^Use this routine to reset all host parameters to NULL. +*/ +SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt*); + +/* +** CAPI3REF: Number Of Columns In A Result Set +** METHOD: sqlite3_stmt +** +** ^Return the number of columns in the result set returned by the +** [prepared statement]. ^If this routine returns 0, that means the +** [prepared statement] returns no data (for example an [UPDATE]). +** ^However, just because this routine returns a positive number does not +** mean that one or more rows of data will be returned. ^A SELECT statement +** will always have a positive sqlite3_column_count() but depending on the +** WHERE clause constraints and the table content, it might return no rows. +** +** See also: [sqlite3_data_count()] +*/ +SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt); + +/* +** CAPI3REF: Column Names In A Result Set +** METHOD: sqlite3_stmt +** +** ^These routines return the name assigned to a particular column +** in the result set of a [SELECT] statement. ^The sqlite3_column_name() +** interface returns a pointer to a zero-terminated UTF-8 string +** and sqlite3_column_name16() returns a pointer to a zero-terminated +** UTF-16 string. ^The first parameter is the [prepared statement] +** that implements the [SELECT] statement. ^The second parameter is the +** column number. ^The leftmost column is number 0. +** +** ^The returned string pointer is valid until either the [prepared statement] +** is destroyed by [sqlite3_finalize()] or until the statement is automatically +** reprepared by the first call to [sqlite3_step()] for a particular run +** or until the next call to +** sqlite3_column_name() or sqlite3_column_name16() on the same column. +** +** ^If sqlite3_malloc() fails during the processing of either routine +** (for example during a conversion from UTF-8 to UTF-16) then a +** NULL pointer is returned. +** +** ^The name of a result column is the value of the "AS" clause for +** that column, if there is an AS clause. If there is no AS clause +** then the name of the column is unspecified and may change from +** one release of SQLite to the next. +*/ +SQLITE_API const char *sqlite3_column_name(sqlite3_stmt*, int N); +SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt*, int N); + +/* +** CAPI3REF: Source Of Data In A Query Result +** METHOD: sqlite3_stmt +** +** ^These routines provide a means to determine the database, table, and +** table column that is the origin of a particular result column in +** [SELECT] statement. +** ^The name of the database or table or column can be returned as +** either a UTF-8 or UTF-16 string. ^The _database_ routines return +** the database name, the _table_ routines return the table name, and +** the origin_ routines return the column name. +** ^The returned string is valid until the [prepared statement] is destroyed +** using [sqlite3_finalize()] or until the statement is automatically +** reprepared by the first call to [sqlite3_step()] for a particular run +** or until the same information is requested +** again in a different encoding. +** +** ^The names returned are the original un-aliased names of the +** database, table, and column. +** +** ^The first argument to these interfaces is a [prepared statement]. +** ^These functions return information about the Nth result column returned by +** the statement, where N is the second function argument. +** ^The left-most column is column 0 for these routines. +** +** ^If the Nth column returned by the statement is an expression or +** subquery and is not a column value, then all of these functions return +** NULL. ^These routines might also return NULL if a memory allocation error +** occurs. ^Otherwise, they return the name of the attached database, table, +** or column that query result column was extracted from. +** +** ^As with all other SQLite APIs, those whose names end with "16" return +** UTF-16 encoded strings and the other functions return UTF-8. +** +** ^These APIs are only available if the library was compiled with the +** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. +** +** If two or more threads call one or more +** [sqlite3_column_database_name | column metadata interfaces] +** for the same [prepared statement] and result column +** at the same time then the results are undefined. +*/ +SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); +SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); +SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); +SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); +SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); +SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int); + +/* +** CAPI3REF: Declared Datatype Of A Query Result +** METHOD: sqlite3_stmt +** +** ^(The first parameter is a [prepared statement]. +** If this statement is a [SELECT] statement and the Nth column of the +** returned result set of that [SELECT] is a table column (not an +** expression or subquery) then the declared type of the table +** column is returned.)^ ^If the Nth column of the result set is an +** expression or subquery, then a NULL pointer is returned. +** ^The returned string is always UTF-8 encoded. +** +** ^(For example, given the database schema: +** +** CREATE TABLE t1(c1 VARIANT); +** +** and the following statement to be compiled: +** +** SELECT c1 + 1, c1 FROM t1; +** +** this routine would return the string "VARIANT" for the second result +** column (i==1), and a NULL pointer for the first result column (i==0).)^ +** +** ^SQLite uses dynamic run-time typing. ^So just because a column +** is declared to contain a particular type does not mean that the +** data stored in that column is of the declared type. SQLite is +** strongly typed, but the typing is dynamic not static. ^Type +** is associated with individual values, not with the containers +** used to hold those values. +*/ +SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt*,int); +SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int); + +/* +** CAPI3REF: Evaluate An SQL Statement +** METHOD: sqlite3_stmt +** +** After a [prepared statement] has been prepared using any of +** [sqlite3_prepare_v2()], [sqlite3_prepare_v3()], [sqlite3_prepare16_v2()], +** or [sqlite3_prepare16_v3()] or one of the legacy +** interfaces [sqlite3_prepare()] or [sqlite3_prepare16()], this function +** must be called one or more times to evaluate the statement. +** +** The details of the behavior of the sqlite3_step() interface depend +** on whether the statement was prepared using the newer "vX" interfaces +** [sqlite3_prepare_v3()], [sqlite3_prepare_v2()], [sqlite3_prepare16_v3()], +** [sqlite3_prepare16_v2()] or the older legacy +** interfaces [sqlite3_prepare()] and [sqlite3_prepare16()]. The use of the +** new "vX" interface is recommended for new applications but the legacy +** interface will continue to be supported. +** +** ^In the legacy interface, the return value will be either [SQLITE_BUSY], +** [SQLITE_DONE], [SQLITE_ROW], [SQLITE_ERROR], or [SQLITE_MISUSE]. +** ^With the "v2" interface, any of the other [result codes] or +** [extended result codes] might be returned as well. +** +** ^[SQLITE_BUSY] means that the database engine was unable to acquire the +** database locks it needs to do its job. ^If the statement is a [COMMIT] +** or occurs outside of an explicit transaction, then you can retry the +** statement. If the statement is not a [COMMIT] and occurs within an +** explicit transaction then you should rollback the transaction before +** continuing. +** +** ^[SQLITE_DONE] means that the statement has finished executing +** successfully. sqlite3_step() should not be called again on this virtual +** machine without first calling [sqlite3_reset()] to reset the virtual +** machine back to its initial state. +** +** ^If the SQL statement being executed returns any data, then [SQLITE_ROW] +** is returned each time a new row of data is ready for processing by the +** caller. The values may be accessed using the [column access functions]. +** sqlite3_step() is called again to retrieve the next row of data. +** +** ^[SQLITE_ERROR] means that a run-time error (such as a constraint +** violation) has occurred. sqlite3_step() should not be called again on +** the VM. More information may be found by calling [sqlite3_errmsg()]. +** ^With the legacy interface, a more specific error code (for example, +** [SQLITE_INTERRUPT], [SQLITE_SCHEMA], [SQLITE_CORRUPT], and so forth) +** can be obtained by calling [sqlite3_reset()] on the +** [prepared statement]. ^In the "v2" interface, +** the more specific error code is returned directly by sqlite3_step(). +** +** [SQLITE_MISUSE] means that the this routine was called inappropriately. +** Perhaps it was called on a [prepared statement] that has +** already been [sqlite3_finalize | finalized] or on one that had +** previously returned [SQLITE_ERROR] or [SQLITE_DONE]. Or it could +** be the case that the same database connection is being used by two or +** more threads at the same moment in time. +** +** For all versions of SQLite up to and including 3.6.23.1, a call to +** [sqlite3_reset()] was required after sqlite3_step() returned anything +** other than [SQLITE_ROW] before any subsequent invocation of +** sqlite3_step(). Failure to reset the prepared statement using +** [sqlite3_reset()] would result in an [SQLITE_MISUSE] return from +** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1], +** sqlite3_step() began +** calling [sqlite3_reset()] automatically in this circumstance rather +** than returning [SQLITE_MISUSE]. This is not considered a compatibility +** break because any application that ever receives an SQLITE_MISUSE error +** is broken by definition. The [SQLITE_OMIT_AUTORESET] compile-time option +** can be used to restore the legacy behavior. +** +** Goofy Interface Alert: In the legacy interface, the sqlite3_step() +** API always returns a generic error code, [SQLITE_ERROR], following any +** error other than [SQLITE_BUSY] and [SQLITE_MISUSE]. You must call +** [sqlite3_reset()] or [sqlite3_finalize()] in order to find one of the +** specific [error codes] that better describes the error. +** We admit that this is a goofy design. The problem has been fixed +** with the "v2" interface. If you prepare all of your SQL statements +** using [sqlite3_prepare_v3()] or [sqlite3_prepare_v2()] +** or [sqlite3_prepare16_v2()] or [sqlite3_prepare16_v3()] instead +** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces, +** then the more specific [error codes] are returned directly +** by sqlite3_step(). The use of the "vX" interfaces is recommended. +*/ +SQLITE_API int sqlite3_step(sqlite3_stmt*); + +/* +** CAPI3REF: Number of columns in a result set +** METHOD: sqlite3_stmt +** +** ^The sqlite3_data_count(P) interface returns the number of columns in the +** current row of the result set of [prepared statement] P. +** ^If prepared statement P does not have results ready to return +** (via calls to the [sqlite3_column_int | sqlite3_column()] family of +** interfaces) then sqlite3_data_count(P) returns 0. +** ^The sqlite3_data_count(P) routine also returns 0 if P is a NULL pointer. +** ^The sqlite3_data_count(P) routine returns 0 if the previous call to +** [sqlite3_step](P) returned [SQLITE_DONE]. ^The sqlite3_data_count(P) +** will return non-zero if previous call to [sqlite3_step](P) returned +** [SQLITE_ROW], except in the case of the [PRAGMA incremental_vacuum] +** where it always returns zero since each step of that multi-step +** pragma returns 0 columns of data. +** +** See also: [sqlite3_column_count()] +*/ +SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); + +/* +** CAPI3REF: Fundamental Datatypes +** KEYWORDS: SQLITE_TEXT +** +** ^(Every value in SQLite has one of five fundamental datatypes: +** +**
    +**
  • 64-bit signed integer +**
  • 64-bit IEEE floating point number +**
  • string +**
  • BLOB +**
  • NULL +**
)^ +** +** These constants are codes for each of those types. +** +** Note that the SQLITE_TEXT constant was also used in SQLite version 2 +** for a completely different meaning. Software that links against both +** SQLite version 2 and SQLite version 3 should use SQLITE3_TEXT, not +** SQLITE_TEXT. +*/ +#define SQLITE_INTEGER 1 +#define SQLITE_FLOAT 2 +#define SQLITE_BLOB 4 +#define SQLITE_NULL 5 +#ifdef SQLITE_TEXT +# undef SQLITE_TEXT +#else +# define SQLITE_TEXT 3 +#endif +#define SQLITE3_TEXT 3 + +/* +** CAPI3REF: Result Values From A Query +** KEYWORDS: {column access functions} +** METHOD: sqlite3_stmt +** +** Summary: +**
+**
sqlite3_column_blobBLOB result +**
sqlite3_column_doubleREAL result +**
sqlite3_column_int32-bit INTEGER result +**
sqlite3_column_int6464-bit INTEGER result +**
sqlite3_column_textUTF-8 TEXT result +**
sqlite3_column_text16UTF-16 TEXT result +**
sqlite3_column_valueThe result as an +** [sqlite3_value|unprotected sqlite3_value] object. +**
    +**
sqlite3_column_bytesSize of a BLOB +** or a UTF-8 TEXT result in bytes +**
sqlite3_column_bytes16   +** →  Size of UTF-16 +** TEXT in bytes +**
sqlite3_column_typeDefault +** datatype of the result +**
+** +** Details: +** +** ^These routines return information about a single column of the current +** result row of a query. ^In every case the first argument is a pointer +** to the [prepared statement] that is being evaluated (the [sqlite3_stmt*] +** that was returned from [sqlite3_prepare_v2()] or one of its variants) +** and the second argument is the index of the column for which information +** should be returned. ^The leftmost column of the result set has the index 0. +** ^The number of columns in the result can be determined using +** [sqlite3_column_count()]. +** +** If the SQL statement does not currently point to a valid row, or if the +** column index is out of range, the result is undefined. +** These routines may only be called when the most recent call to +** [sqlite3_step()] has returned [SQLITE_ROW] and neither +** [sqlite3_reset()] nor [sqlite3_finalize()] have been called subsequently. +** If any of these routines are called after [sqlite3_reset()] or +** [sqlite3_finalize()] or after [sqlite3_step()] has returned +** something other than [SQLITE_ROW], the results are undefined. +** If [sqlite3_step()] or [sqlite3_reset()] or [sqlite3_finalize()] +** are called from a different thread while any of these routines +** are pending, then the results are undefined. +** +** The first six interfaces (_blob, _double, _int, _int64, _text, and _text16) +** each return the value of a result column in a specific data format. If +** the result column is not initially in the requested format (for example, +** if the query returns an integer but the sqlite3_column_text() interface +** is used to extract the value) then an automatic type conversion is performed. +** +** ^The sqlite3_column_type() routine returns the +** [SQLITE_INTEGER | datatype code] for the initial data type +** of the result column. ^The returned value is one of [SQLITE_INTEGER], +** [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL]. +** The return value of sqlite3_column_type() can be used to decide which +** of the first six interface should be used to extract the column value. +** The value returned by sqlite3_column_type() is only meaningful if no +** automatic type conversions have occurred for the value in question. +** After a type conversion, the result of calling sqlite3_column_type() +** is undefined, though harmless. Future +** versions of SQLite may change the behavior of sqlite3_column_type() +** following a type conversion. +** +** If the result is a BLOB or a TEXT string, then the sqlite3_column_bytes() +** or sqlite3_column_bytes16() interfaces can be used to determine the size +** of that BLOB or string. +** +** ^If the result is a BLOB or UTF-8 string then the sqlite3_column_bytes() +** routine returns the number of bytes in that BLOB or string. +** ^If the result is a UTF-16 string, then sqlite3_column_bytes() converts +** the string to UTF-8 and then returns the number of bytes. +** ^If the result is a numeric value then sqlite3_column_bytes() uses +** [sqlite3_snprintf()] to convert that value to a UTF-8 string and returns +** the number of bytes in that string. +** ^If the result is NULL, then sqlite3_column_bytes() returns zero. +** +** ^If the result is a BLOB or UTF-16 string then the sqlite3_column_bytes16() +** routine returns the number of bytes in that BLOB or string. +** ^If the result is a UTF-8 string, then sqlite3_column_bytes16() converts +** the string to UTF-16 and then returns the number of bytes. +** ^If the result is a numeric value then sqlite3_column_bytes16() uses +** [sqlite3_snprintf()] to convert that value to a UTF-16 string and returns +** the number of bytes in that string. +** ^If the result is NULL, then sqlite3_column_bytes16() returns zero. +** +** ^The values returned by [sqlite3_column_bytes()] and +** [sqlite3_column_bytes16()] do not include the zero terminators at the end +** of the string. ^For clarity: the values returned by +** [sqlite3_column_bytes()] and [sqlite3_column_bytes16()] are the number of +** bytes in the string, not the number of characters. +** +** ^Strings returned by sqlite3_column_text() and sqlite3_column_text16(), +** even empty strings, are always zero-terminated. ^The return +** value from sqlite3_column_blob() for a zero-length BLOB is a NULL pointer. +** +** Warning: ^The object returned by [sqlite3_column_value()] is an +** [unprotected sqlite3_value] object. In a multithreaded environment, +** an unprotected sqlite3_value object may only be used safely with +** [sqlite3_bind_value()] and [sqlite3_result_value()]. +** If the [unprotected sqlite3_value] object returned by +** [sqlite3_column_value()] is used in any other way, including calls +** to routines like [sqlite3_value_int()], [sqlite3_value_text()], +** or [sqlite3_value_bytes()], the behavior is not threadsafe. +** Hence, the sqlite3_column_value() interface +** is normally only useful within the implementation of +** [application-defined SQL functions] or [virtual tables], not within +** top-level application code. +** +** The these routines may attempt to convert the datatype of the result. +** ^For example, if the internal representation is FLOAT and a text result +** is requested, [sqlite3_snprintf()] is used internally to perform the +** conversion automatically. ^(The following table details the conversions +** that are applied: +** +**
+** +**
Internal
Type
Requested
Type
Conversion +** +**
NULL INTEGER Result is 0 +**
NULL FLOAT Result is 0.0 +**
NULL TEXT Result is a NULL pointer +**
NULL BLOB Result is a NULL pointer +**
INTEGER FLOAT Convert from integer to float +**
INTEGER TEXT ASCII rendering of the integer +**
INTEGER BLOB Same as INTEGER->TEXT +**
FLOAT INTEGER [CAST] to INTEGER +**
FLOAT TEXT ASCII rendering of the float +**
FLOAT BLOB [CAST] to BLOB +**
TEXT INTEGER [CAST] to INTEGER +**
TEXT FLOAT [CAST] to REAL +**
TEXT BLOB No change +**
BLOB INTEGER [CAST] to INTEGER +**
BLOB FLOAT [CAST] to REAL +**
BLOB TEXT Add a zero terminator if needed +**
+**
)^ +** +** Note that when type conversions occur, pointers returned by prior +** calls to sqlite3_column_blob(), sqlite3_column_text(), and/or +** sqlite3_column_text16() may be invalidated. +** Type conversions and pointer invalidations might occur +** in the following cases: +** +**
    +**
  • The initial content is a BLOB and sqlite3_column_text() or +** sqlite3_column_text16() is called. A zero-terminator might +** need to be added to the string.
  • +**
  • The initial content is UTF-8 text and sqlite3_column_bytes16() or +** sqlite3_column_text16() is called. The content must be converted +** to UTF-16.
  • +**
  • The initial content is UTF-16 text and sqlite3_column_bytes() or +** sqlite3_column_text() is called. The content must be converted +** to UTF-8.
  • +**
+** +** ^Conversions between UTF-16be and UTF-16le are always done in place and do +** not invalidate a prior pointer, though of course the content of the buffer +** that the prior pointer references will have been modified. Other kinds +** of conversion are done in place when it is possible, but sometimes they +** are not possible and in those cases prior pointers are invalidated. +** +** The safest policy is to invoke these routines +** in one of the following ways: +** +**
    +**
  • sqlite3_column_text() followed by sqlite3_column_bytes()
  • +**
  • sqlite3_column_blob() followed by sqlite3_column_bytes()
  • +**
  • sqlite3_column_text16() followed by sqlite3_column_bytes16()
  • +**
+** +** In other words, you should call sqlite3_column_text(), +** sqlite3_column_blob(), or sqlite3_column_text16() first to force the result +** into the desired format, then invoke sqlite3_column_bytes() or +** sqlite3_column_bytes16() to find the size of the result. Do not mix calls +** to sqlite3_column_text() or sqlite3_column_blob() with calls to +** sqlite3_column_bytes16(), and do not mix calls to sqlite3_column_text16() +** with calls to sqlite3_column_bytes(). +** +** ^The pointers returned are valid until a type conversion occurs as +** described above, or until [sqlite3_step()] or [sqlite3_reset()] or +** [sqlite3_finalize()] is called. ^The memory space used to hold strings +** and BLOBs is freed automatically. Do not pass the pointers returned +** from [sqlite3_column_blob()], [sqlite3_column_text()], etc. into +** [sqlite3_free()]. +** +** As long as the input parameters are correct, these routines will only +** fail if an out-of-memory error occurs during a format conversion. +** Only the following subset of interfaces are subject to out-of-memory +** errors: +** +**
    +**
  • sqlite3_column_blob() +**
  • sqlite3_column_text() +**
  • sqlite3_column_text16() +**
  • sqlite3_column_bytes() +**
  • sqlite3_column_bytes16() +**
+** +** If an out-of-memory error occurs, then the return value from these +** routines is the same as if the column had contained an SQL NULL value. +** Valid SQL NULL returns can be distinguished from out-of-memory errors +** by invoking the [sqlite3_errcode()] immediately after the suspect +** return value is obtained and before any +** other SQLite interface is called on the same [database connection]. +*/ +SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt*, int iCol); +SQLITE_API double sqlite3_column_double(sqlite3_stmt*, int iCol); +SQLITE_API int sqlite3_column_int(sqlite3_stmt*, int iCol); +SQLITE_API sqlite3_int64 sqlite3_column_int64(sqlite3_stmt*, int iCol); +SQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol); +SQLITE_API const void *sqlite3_column_text16(sqlite3_stmt*, int iCol); +SQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol); +SQLITE_API int sqlite3_column_bytes(sqlite3_stmt*, int iCol); +SQLITE_API int sqlite3_column_bytes16(sqlite3_stmt*, int iCol); +SQLITE_API int sqlite3_column_type(sqlite3_stmt*, int iCol); + +/* +** CAPI3REF: Destroy A Prepared Statement Object +** DESTRUCTOR: sqlite3_stmt +** +** ^The sqlite3_finalize() function is called to delete a [prepared statement]. +** ^If the most recent evaluation of the statement encountered no errors +** or if the statement is never been evaluated, then sqlite3_finalize() returns +** SQLITE_OK. ^If the most recent evaluation of statement S failed, then +** sqlite3_finalize(S) returns the appropriate [error code] or +** [extended error code]. +** +** ^The sqlite3_finalize(S) routine can be called at any point during +** the life cycle of [prepared statement] S: +** before statement S is ever evaluated, after +** one or more calls to [sqlite3_reset()], or after any call +** to [sqlite3_step()] regardless of whether or not the statement has +** completed execution. +** +** ^Invoking sqlite3_finalize() on a NULL pointer is a harmless no-op. +** +** The application must finalize every [prepared statement] in order to avoid +** resource leaks. It is a grievous error for the application to try to use +** a prepared statement after it has been finalized. Any use of a prepared +** statement after it has been finalized can result in undefined and +** undesirable behavior such as segfaults and heap corruption. +*/ +SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt); + +/* +** CAPI3REF: Reset A Prepared Statement Object +** METHOD: sqlite3_stmt +** +** The sqlite3_reset() function is called to reset a [prepared statement] +** object back to its initial state, ready to be re-executed. +** ^Any SQL statement variables that had values bound to them using +** the [sqlite3_bind_blob | sqlite3_bind_*() API] retain their values. +** Use [sqlite3_clear_bindings()] to reset the bindings. +** +** ^The [sqlite3_reset(S)] interface resets the [prepared statement] S +** back to the beginning of its program. +** +** ^If the most recent call to [sqlite3_step(S)] for the +** [prepared statement] S returned [SQLITE_ROW] or [SQLITE_DONE], +** or if [sqlite3_step(S)] has never before been called on S, +** then [sqlite3_reset(S)] returns [SQLITE_OK]. +** +** ^If the most recent call to [sqlite3_step(S)] for the +** [prepared statement] S indicated an error, then +** [sqlite3_reset(S)] returns an appropriate [error code]. +** +** ^The [sqlite3_reset(S)] interface does not change the values +** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S. +*/ +SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); + +/* +** CAPI3REF: Create Or Redefine SQL Functions +** KEYWORDS: {function creation routines} +** METHOD: sqlite3 +** +** ^These functions (collectively known as "function creation routines") +** are used to add SQL functions or aggregates or to redefine the behavior +** of existing SQL functions or aggregates. The only differences between +** the three "sqlite3_create_function*" routines are the text encoding +** expected for the second parameter (the name of the function being +** created) and the presence or absence of a destructor callback for +** the application data pointer. Function sqlite3_create_window_function() +** is similar, but allows the user to supply the extra callback functions +** needed by [aggregate window functions]. +** +** ^The first parameter is the [database connection] to which the SQL +** function is to be added. ^If an application uses more than one database +** connection then application-defined SQL functions must be added +** to each database connection separately. +** +** ^The second parameter is the name of the SQL function to be created or +** redefined. ^The length of the name is limited to 255 bytes in a UTF-8 +** representation, exclusive of the zero-terminator. ^Note that the name +** length limit is in UTF-8 bytes, not characters nor UTF-16 bytes. +** ^Any attempt to create a function with a longer name +** will result in [SQLITE_MISUSE] being returned. +** +** ^The third parameter (nArg) +** is the number of arguments that the SQL function or +** aggregate takes. ^If this parameter is -1, then the SQL function or +** aggregate may take any number of arguments between 0 and the limit +** set by [sqlite3_limit]([SQLITE_LIMIT_FUNCTION_ARG]). If the third +** parameter is less than -1 or greater than 127 then the behavior is +** undefined. +** +** ^The fourth parameter, eTextRep, specifies what +** [SQLITE_UTF8 | text encoding] this SQL function prefers for +** its parameters. The application should set this parameter to +** [SQLITE_UTF16LE] if the function implementation invokes +** [sqlite3_value_text16le()] on an input, or [SQLITE_UTF16BE] if the +** implementation invokes [sqlite3_value_text16be()] on an input, or +** [SQLITE_UTF16] if [sqlite3_value_text16()] is used, or [SQLITE_UTF8] +** otherwise. ^The same SQL function may be registered multiple times using +** different preferred text encodings, with different implementations for +** each encoding. +** ^When multiple implementations of the same function are available, SQLite +** will pick the one that involves the least amount of data conversion. +** +** ^The fourth parameter may optionally be ORed with [SQLITE_DETERMINISTIC] +** to signal that the function will always return the same result given +** the same inputs within a single SQL statement. Most SQL functions are +** deterministic. The built-in [random()] SQL function is an example of a +** function that is not deterministic. The SQLite query planner is able to +** perform additional optimizations on deterministic functions, so use +** of the [SQLITE_DETERMINISTIC] flag is recommended where possible. +** +** ^The fourth parameter may also optionally include the [SQLITE_DIRECTONLY] +** flag, which if present prevents the function from being invoked from +** within VIEWs, TRIGGERs, CHECK constraints, generated column expressions, +** index expressions, or the WHERE clause of partial indexes. +** +** +** For best security, the [SQLITE_DIRECTONLY] flag is recommended for +** all application-defined SQL functions that do not need to be +** used inside of triggers, view, CHECK constraints, or other elements of +** the database schema. This flags is especially recommended for SQL +** functions that have side effects or reveal internal application state. +** Without this flag, an attacker might be able to modify the schema of +** a database file to include invocations of the function with parameters +** chosen by the attacker, which the application will then execute when +** the database file is opened and read. +** +** +** ^(The fifth parameter is an arbitrary pointer. The implementation of the +** function can gain access to this pointer using [sqlite3_user_data()].)^ +** +** ^The sixth, seventh and eighth parameters passed to the three +** "sqlite3_create_function*" functions, xFunc, xStep and xFinal, are +** pointers to C-language functions that implement the SQL function or +** aggregate. ^A scalar SQL function requires an implementation of the xFunc +** callback only; NULL pointers must be passed as the xStep and xFinal +** parameters. ^An aggregate SQL function requires an implementation of xStep +** and xFinal and NULL pointer must be passed for xFunc. ^To delete an existing +** SQL function or aggregate, pass NULL pointers for all three function +** callbacks. +** +** ^The sixth, seventh, eighth and ninth parameters (xStep, xFinal, xValue +** and xInverse) passed to sqlite3_create_window_function are pointers to +** C-language callbacks that implement the new function. xStep and xFinal +** must both be non-NULL. xValue and xInverse may either both be NULL, in +** which case a regular aggregate function is created, or must both be +** non-NULL, in which case the new function may be used as either an aggregate +** or aggregate window function. More details regarding the implementation +** of aggregate window functions are +** [user-defined window functions|available here]. +** +** ^(If the final parameter to sqlite3_create_function_v2() or +** sqlite3_create_window_function() is not NULL, then it is destructor for +** the application data pointer. The destructor is invoked when the function +** is deleted, either by being overloaded or when the database connection +** closes.)^ ^The destructor is also invoked if the call to +** sqlite3_create_function_v2() fails. ^When the destructor callback is +** invoked, it is passed a single argument which is a copy of the application +** data pointer which was the fifth parameter to sqlite3_create_function_v2(). +** +** ^It is permitted to register multiple implementations of the same +** functions with the same name but with either differing numbers of +** arguments or differing preferred text encodings. ^SQLite will use +** the implementation that most closely matches the way in which the +** SQL function is used. ^A function implementation with a non-negative +** nArg parameter is a better match than a function implementation with +** a negative nArg. ^A function where the preferred text encoding +** matches the database encoding is a better +** match than a function where the encoding is different. +** ^A function where the encoding difference is between UTF16le and UTF16be +** is a closer match than a function where the encoding difference is +** between UTF8 and UTF16. +** +** ^Built-in functions may be overloaded by new application-defined functions. +** +** ^An application-defined function is permitted to call other +** SQLite interfaces. However, such calls must not +** close the database connection nor finalize or reset the prepared +** statement in which the function is running. +*/ +SQLITE_API int sqlite3_create_function( + sqlite3 *db, + const char *zFunctionName, + int nArg, + int eTextRep, + void *pApp, + void (*xFunc)(sqlite3_context*,int,sqlite3_value**), + void (*xStep)(sqlite3_context*,int,sqlite3_value**), + void (*xFinal)(sqlite3_context*) +); +SQLITE_API int sqlite3_create_function16( + sqlite3 *db, + const void *zFunctionName, + int nArg, + int eTextRep, + void *pApp, + void (*xFunc)(sqlite3_context*,int,sqlite3_value**), + void (*xStep)(sqlite3_context*,int,sqlite3_value**), + void (*xFinal)(sqlite3_context*) +); +SQLITE_API int sqlite3_create_function_v2( + sqlite3 *db, + const char *zFunctionName, + int nArg, + int eTextRep, + void *pApp, + void (*xFunc)(sqlite3_context*,int,sqlite3_value**), + void (*xStep)(sqlite3_context*,int,sqlite3_value**), + void (*xFinal)(sqlite3_context*), + void(*xDestroy)(void*) +); +SQLITE_API int sqlite3_create_window_function( + sqlite3 *db, + const char *zFunctionName, + int nArg, + int eTextRep, + void *pApp, + void (*xStep)(sqlite3_context*,int,sqlite3_value**), + void (*xFinal)(sqlite3_context*), + void (*xValue)(sqlite3_context*), + void (*xInverse)(sqlite3_context*,int,sqlite3_value**), + void(*xDestroy)(void*) +); + +/* +** CAPI3REF: Text Encodings +** +** These constant define integer codes that represent the various +** text encodings supported by SQLite. +*/ +#define SQLITE_UTF8 1 /* IMP: R-37514-35566 */ +#define SQLITE_UTF16LE 2 /* IMP: R-03371-37637 */ +#define SQLITE_UTF16BE 3 /* IMP: R-51971-34154 */ +#define SQLITE_UTF16 4 /* Use native byte order */ +#define SQLITE_ANY 5 /* Deprecated */ +#define SQLITE_UTF16_ALIGNED 8 /* sqlite3_create_collation only */ + +/* +** CAPI3REF: Function Flags +** +** These constants may be ORed together with the +** [SQLITE_UTF8 | preferred text encoding] as the fourth argument +** to [sqlite3_create_function()], [sqlite3_create_function16()], or +** [sqlite3_create_function_v2()]. +** +**
+** [[SQLITE_DETERMINISTIC]]
SQLITE_DETERMINISTIC
+** The SQLITE_DETERMINISTIC flag means that the new function always gives +** the same output when the input parameters are the same. +** The [abs|abs() function] is deterministic, for example, but +** [randomblob|randomblob()] is not. Functions must +** be deterministic in order to be used in certain contexts such as +** with the WHERE clause of [partial indexes] or in [generated columns]. +** SQLite might also optimize deterministic functions by factoring them +** out of inner loops. +**
+** +** [[SQLITE_DIRECTONLY]]
SQLITE_DIRECTONLY
+** The SQLITE_DIRECTONLY flag means that the function may only be invoked +** from top-level SQL, and cannot be used in VIEWs or TRIGGERs nor in +** schema structures such as [CHECK constraints], [DEFAULT clauses], +** [expression indexes], [partial indexes], or [generated columns]. +** The SQLITE_DIRECTONLY flags is a security feature which is recommended +** for all [application-defined SQL functions], and especially for functions +** that have side-effects or that could potentially leak sensitive +** information. +**
+** +** [[SQLITE_INNOCUOUS]]
SQLITE_INNOCUOUS
+** The SQLITE_INNOCUOUS flag means that the function is unlikely +** to cause problems even if misused. An innocuous function should have +** no side effects and should not depend on any values other than its +** input parameters. The [abs|abs() function] is an example of an +** innocuous function. +** The [load_extension() SQL function] is not innocuous because of its +** side effects. +**

SQLITE_INNOCUOUS is similar to SQLITE_DETERMINISTIC, but is not +** exactly the same. The [random|random() function] is an example of a +** function that is innocuous but not deterministic. +**

Some heightened security settings +** ([SQLITE_DBCONFIG_TRUSTED_SCHEMA] and [PRAGMA trusted_schema=OFF]) +** disable the use of SQL functions inside views and triggers and in +** schema structures such as [CHECK constraints], [DEFAULT clauses], +** [expression indexes], [partial indexes], and [generated columns] unless +** the function is tagged with SQLITE_INNOCUOUS. Most built-in functions +** are innocuous. Developers are advised to avoid using the +** SQLITE_INNOCUOUS flag for application-defined functions unless the +** function has been carefully audited and found to be free of potentially +** security-adverse side-effects and information-leaks. +**

+** +** [[SQLITE_SUBTYPE]]
SQLITE_SUBTYPE
+** The SQLITE_SUBTYPE flag indicates to SQLite that a function may call +** [sqlite3_value_subtype()] to inspect the sub-types of its arguments. +** Specifying this flag makes no difference for scalar or aggregate user +** functions. However, if it is not specified for a user-defined window +** function, then any sub-types belonging to arguments passed to the window +** function may be discarded before the window function is called (i.e. +** sqlite3_value_subtype() will always return 0). +**
+**
+*/ +#define SQLITE_DETERMINISTIC 0x000000800 +#define SQLITE_DIRECTONLY 0x000080000 +#define SQLITE_SUBTYPE 0x000100000 +#define SQLITE_INNOCUOUS 0x000200000 + +/* +** CAPI3REF: Deprecated Functions +** DEPRECATED +** +** These functions are [deprecated]. In order to maintain +** backwards compatibility with older code, these functions continue +** to be supported. However, new applications should avoid +** the use of these functions. To encourage programmers to avoid +** these functions, we will not explain what they do. +*/ +#ifndef SQLITE_OMIT_DEPRECATED +SQLITE_API SQLITE_DEPRECATED int sqlite3_aggregate_count(sqlite3_context*); +SQLITE_API SQLITE_DEPRECATED int sqlite3_expired(sqlite3_stmt*); +SQLITE_API SQLITE_DEPRECATED int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*); +SQLITE_API SQLITE_DEPRECATED int sqlite3_global_recover(void); +SQLITE_API SQLITE_DEPRECATED void sqlite3_thread_cleanup(void); +SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int), + void*,sqlite3_int64); +#endif + +/* +** CAPI3REF: Obtaining SQL Values +** METHOD: sqlite3_value +** +** Summary: +**
+**
sqlite3_value_blobBLOB value +**
sqlite3_value_doubleREAL value +**
sqlite3_value_int32-bit INTEGER value +**
sqlite3_value_int6464-bit INTEGER value +**
sqlite3_value_pointerPointer value +**
sqlite3_value_textUTF-8 TEXT value +**
sqlite3_value_text16UTF-16 TEXT value in +** the native byteorder +**
sqlite3_value_text16beUTF-16be TEXT value +**
sqlite3_value_text16leUTF-16le TEXT value +**
    +**
sqlite3_value_bytesSize of a BLOB +** or a UTF-8 TEXT in bytes +**
sqlite3_value_bytes16   +** →  Size of UTF-16 +** TEXT in bytes +**
sqlite3_value_typeDefault +** datatype of the value +**
sqlite3_value_numeric_type   +** →  Best numeric datatype of the value +**
sqlite3_value_nochange   +** →  True if the column is unchanged in an UPDATE +** against a virtual table. +**
sqlite3_value_frombind   +** →  True if value originated from a [bound parameter] +**
+** +** Details: +** +** These routines extract type, size, and content information from +** [protected sqlite3_value] objects. Protected sqlite3_value objects +** are used to pass parameter information into the functions that +** implement [application-defined SQL functions] and [virtual tables]. +** +** These routines work only with [protected sqlite3_value] objects. +** Any attempt to use these routines on an [unprotected sqlite3_value] +** is not threadsafe. +** +** ^These routines work just like the corresponding [column access functions] +** except that these routines take a single [protected sqlite3_value] object +** pointer instead of a [sqlite3_stmt*] pointer and an integer column number. +** +** ^The sqlite3_value_text16() interface extracts a UTF-16 string +** in the native byte-order of the host machine. ^The +** sqlite3_value_text16be() and sqlite3_value_text16le() interfaces +** extract UTF-16 strings as big-endian and little-endian respectively. +** +** ^If [sqlite3_value] object V was initialized +** using [sqlite3_bind_pointer(S,I,P,X,D)] or [sqlite3_result_pointer(C,P,X,D)] +** and if X and Y are strings that compare equal according to strcmp(X,Y), +** then sqlite3_value_pointer(V,Y) will return the pointer P. ^Otherwise, +** sqlite3_value_pointer(V,Y) returns a NULL. The sqlite3_bind_pointer() +** routine is part of the [pointer passing interface] added for SQLite 3.20.0. +** +** ^(The sqlite3_value_type(V) interface returns the +** [SQLITE_INTEGER | datatype code] for the initial datatype of the +** [sqlite3_value] object V. The returned value is one of [SQLITE_INTEGER], +** [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL].)^ +** Other interfaces might change the datatype for an sqlite3_value object. +** For example, if the datatype is initially SQLITE_INTEGER and +** sqlite3_value_text(V) is called to extract a text value for that +** integer, then subsequent calls to sqlite3_value_type(V) might return +** SQLITE_TEXT. Whether or not a persistent internal datatype conversion +** occurs is undefined and may change from one release of SQLite to the next. +** +** ^(The sqlite3_value_numeric_type() interface attempts to apply +** numeric affinity to the value. This means that an attempt is +** made to convert the value to an integer or floating point. If +** such a conversion is possible without loss of information (in other +** words, if the value is a string that looks like a number) +** then the conversion is performed. Otherwise no conversion occurs. +** The [SQLITE_INTEGER | datatype] after conversion is returned.)^ +** +** ^Within the [xUpdate] method of a [virtual table], the +** sqlite3_value_nochange(X) interface returns true if and only if +** the column corresponding to X is unchanged by the UPDATE operation +** that the xUpdate method call was invoked to implement and if +** and the prior [xColumn] method call that was invoked to extracted +** the value for that column returned without setting a result (probably +** because it queried [sqlite3_vtab_nochange()] and found that the column +** was unchanging). ^Within an [xUpdate] method, any value for which +** sqlite3_value_nochange(X) is true will in all other respects appear +** to be a NULL value. If sqlite3_value_nochange(X) is invoked anywhere other +** than within an [xUpdate] method call for an UPDATE statement, then +** the return value is arbitrary and meaningless. +** +** ^The sqlite3_value_frombind(X) interface returns non-zero if the +** value X originated from one of the [sqlite3_bind_int|sqlite3_bind()] +** interfaces. ^If X comes from an SQL literal value, or a table column, +** or an expression, then sqlite3_value_frombind(X) returns zero. +** +** Please pay particular attention to the fact that the pointer returned +** from [sqlite3_value_blob()], [sqlite3_value_text()], or +** [sqlite3_value_text16()] can be invalidated by a subsequent call to +** [sqlite3_value_bytes()], [sqlite3_value_bytes16()], [sqlite3_value_text()], +** or [sqlite3_value_text16()]. +** +** These routines must be called from the same thread as +** the SQL function that supplied the [sqlite3_value*] parameters. +** +** As long as the input parameter is correct, these routines can only +** fail if an out-of-memory error occurs during a format conversion. +** Only the following subset of interfaces are subject to out-of-memory +** errors: +** +**
    +**
  • sqlite3_value_blob() +**
  • sqlite3_value_text() +**
  • sqlite3_value_text16() +**
  • sqlite3_value_text16le() +**
  • sqlite3_value_text16be() +**
  • sqlite3_value_bytes() +**
  • sqlite3_value_bytes16() +**
+** +** If an out-of-memory error occurs, then the return value from these +** routines is the same as if the column had contained an SQL NULL value. +** Valid SQL NULL returns can be distinguished from out-of-memory errors +** by invoking the [sqlite3_errcode()] immediately after the suspect +** return value is obtained and before any +** other SQLite interface is called on the same [database connection]. +*/ +SQLITE_API const void *sqlite3_value_blob(sqlite3_value*); +SQLITE_API double sqlite3_value_double(sqlite3_value*); +SQLITE_API int sqlite3_value_int(sqlite3_value*); +SQLITE_API sqlite3_int64 sqlite3_value_int64(sqlite3_value*); +SQLITE_API void *sqlite3_value_pointer(sqlite3_value*, const char*); +SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value*); +SQLITE_API const void *sqlite3_value_text16(sqlite3_value*); +SQLITE_API const void *sqlite3_value_text16le(sqlite3_value*); +SQLITE_API const void *sqlite3_value_text16be(sqlite3_value*); +SQLITE_API int sqlite3_value_bytes(sqlite3_value*); +SQLITE_API int sqlite3_value_bytes16(sqlite3_value*); +SQLITE_API int sqlite3_value_type(sqlite3_value*); +SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*); +SQLITE_API int sqlite3_value_nochange(sqlite3_value*); +SQLITE_API int sqlite3_value_frombind(sqlite3_value*); + +/* +** CAPI3REF: Finding The Subtype Of SQL Values +** METHOD: sqlite3_value +** +** The sqlite3_value_subtype(V) function returns the subtype for +** an [application-defined SQL function] argument V. The subtype +** information can be used to pass a limited amount of context from +** one SQL function to another. Use the [sqlite3_result_subtype()] +** routine to set the subtype for the return value of an SQL function. +*/ +SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value*); + +/* +** CAPI3REF: Copy And Free SQL Values +** METHOD: sqlite3_value +** +** ^The sqlite3_value_dup(V) interface makes a copy of the [sqlite3_value] +** object D and returns a pointer to that copy. ^The [sqlite3_value] returned +** is a [protected sqlite3_value] object even if the input is not. +** ^The sqlite3_value_dup(V) interface returns NULL if V is NULL or if a +** memory allocation fails. +** +** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object +** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer +** then sqlite3_value_free(V) is a harmless no-op. +*/ +SQLITE_API sqlite3_value *sqlite3_value_dup(const sqlite3_value*); +SQLITE_API void sqlite3_value_free(sqlite3_value*); + +/* +** CAPI3REF: Obtain Aggregate Function Context +** METHOD: sqlite3_context +** +** Implementations of aggregate SQL functions use this +** routine to allocate memory for storing their state. +** +** ^The first time the sqlite3_aggregate_context(C,N) routine is called +** for a particular aggregate function, SQLite allocates +** N bytes of memory, zeroes out that memory, and returns a pointer +** to the new memory. ^On second and subsequent calls to +** sqlite3_aggregate_context() for the same aggregate function instance, +** the same buffer is returned. Sqlite3_aggregate_context() is normally +** called once for each invocation of the xStep callback and then one +** last time when the xFinal callback is invoked. ^(When no rows match +** an aggregate query, the xStep() callback of the aggregate function +** implementation is never called and xFinal() is called exactly once. +** In those cases, sqlite3_aggregate_context() might be called for the +** first time from within xFinal().)^ +** +** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer +** when first called if N is less than or equal to zero or if a memory +** allocate error occurs. +** +** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is +** determined by the N parameter on first successful call. Changing the +** value of N in any subsequent call to sqlite3_aggregate_context() within +** the same aggregate function instance will not resize the memory +** allocation.)^ Within the xFinal callback, it is customary to set +** N=0 in calls to sqlite3_aggregate_context(C,N) so that no +** pointless memory allocations occur. +** +** ^SQLite automatically frees the memory allocated by +** sqlite3_aggregate_context() when the aggregate query concludes. +** +** The first parameter must be a copy of the +** [sqlite3_context | SQL function context] that is the first parameter +** to the xStep or xFinal callback routine that implements the aggregate +** function. +** +** This routine must be called from the same thread in which +** the aggregate SQL function is running. +*/ +SQLITE_API void *sqlite3_aggregate_context(sqlite3_context*, int nBytes); + +/* +** CAPI3REF: User Data For Functions +** METHOD: sqlite3_context +** +** ^The sqlite3_user_data() interface returns a copy of +** the pointer that was the pUserData parameter (the 5th parameter) +** of the [sqlite3_create_function()] +** and [sqlite3_create_function16()] routines that originally +** registered the application defined function. +** +** This routine must be called from the same thread in which +** the application-defined function is running. +*/ +SQLITE_API void *sqlite3_user_data(sqlite3_context*); + +/* +** CAPI3REF: Database Connection For Functions +** METHOD: sqlite3_context +** +** ^The sqlite3_context_db_handle() interface returns a copy of +** the pointer to the [database connection] (the 1st parameter) +** of the [sqlite3_create_function()] +** and [sqlite3_create_function16()] routines that originally +** registered the application defined function. +*/ +SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*); + +/* +** CAPI3REF: Function Auxiliary Data +** METHOD: sqlite3_context +** +** These functions may be used by (non-aggregate) SQL functions to +** associate metadata with argument values. If the same value is passed to +** multiple invocations of the same SQL function during query execution, under +** some circumstances the associated metadata may be preserved. An example +** of where this might be useful is in a regular-expression matching +** function. The compiled version of the regular expression can be stored as +** metadata associated with the pattern string. +** Then as long as the pattern string remains the same, +** the compiled regular expression can be reused on multiple +** invocations of the same function. +** +** ^The sqlite3_get_auxdata(C,N) interface returns a pointer to the metadata +** associated by the sqlite3_set_auxdata(C,N,P,X) function with the Nth argument +** value to the application-defined function. ^N is zero for the left-most +** function argument. ^If there is no metadata +** associated with the function argument, the sqlite3_get_auxdata(C,N) interface +** returns a NULL pointer. +** +** ^The sqlite3_set_auxdata(C,N,P,X) interface saves P as metadata for the N-th +** argument of the application-defined function. ^Subsequent +** calls to sqlite3_get_auxdata(C,N) return P from the most recent +** sqlite3_set_auxdata(C,N,P,X) call if the metadata is still valid or +** NULL if the metadata has been discarded. +** ^After each call to sqlite3_set_auxdata(C,N,P,X) where X is not NULL, +** SQLite will invoke the destructor function X with parameter P exactly +** once, when the metadata is discarded. +** SQLite is free to discard the metadata at any time, including:
    +**
  • ^(when the corresponding function parameter changes)^, or +**
  • ^(when [sqlite3_reset()] or [sqlite3_finalize()] is called for the +** SQL statement)^, or +**
  • ^(when sqlite3_set_auxdata() is invoked again on the same +** parameter)^, or +**
  • ^(during the original sqlite3_set_auxdata() call when a memory +** allocation error occurs.)^
+** +** Note the last bullet in particular. The destructor X in +** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the +** sqlite3_set_auxdata() interface even returns. Hence sqlite3_set_auxdata() +** should be called near the end of the function implementation and the +** function implementation should not make any use of P after +** sqlite3_set_auxdata() has been called. +** +** ^(In practice, metadata is preserved between function calls for +** function parameters that are compile-time constants, including literal +** values and [parameters] and expressions composed from the same.)^ +** +** The value of the N parameter to these interfaces should be non-negative. +** Future enhancements may make use of negative N values to define new +** kinds of function caching behavior. +** +** These routines must be called from the same thread in which +** the SQL function is running. +*/ +SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N); +SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*)); + + +/* +** CAPI3REF: Constants Defining Special Destructor Behavior +** +** These are special values for the destructor that is passed in as the +** final argument to routines like [sqlite3_result_blob()]. ^If the destructor +** argument is SQLITE_STATIC, it means that the content pointer is constant +** and will never change. It does not need to be destroyed. ^The +** SQLITE_TRANSIENT value means that the content will likely change in +** the near future and that SQLite should make its own private copy of +** the content before returning. +** +** The typedef is necessary to work around problems in certain +** C++ compilers. +*/ +typedef void (*sqlite3_destructor_type)(void*); +#define SQLITE_STATIC ((sqlite3_destructor_type)0) +#define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1) + +/* +** CAPI3REF: Setting The Result Of An SQL Function +** METHOD: sqlite3_context +** +** These routines are used by the xFunc or xFinal callbacks that +** implement SQL functions and aggregates. See +** [sqlite3_create_function()] and [sqlite3_create_function16()] +** for additional information. +** +** These functions work very much like the [parameter binding] family of +** functions used to bind values to host parameters in prepared statements. +** Refer to the [SQL parameter] documentation for additional information. +** +** ^The sqlite3_result_blob() interface sets the result from +** an application-defined function to be the BLOB whose content is pointed +** to by the second parameter and which is N bytes long where N is the +** third parameter. +** +** ^The sqlite3_result_zeroblob(C,N) and sqlite3_result_zeroblob64(C,N) +** interfaces set the result of the application-defined function to be +** a BLOB containing all zero bytes and N bytes in size. +** +** ^The sqlite3_result_double() interface sets the result from +** an application-defined function to be a floating point value specified +** by its 2nd argument. +** +** ^The sqlite3_result_error() and sqlite3_result_error16() functions +** cause the implemented SQL function to throw an exception. +** ^SQLite uses the string pointed to by the +** 2nd parameter of sqlite3_result_error() or sqlite3_result_error16() +** as the text of an error message. ^SQLite interprets the error +** message string from sqlite3_result_error() as UTF-8. ^SQLite +** interprets the string from sqlite3_result_error16() as UTF-16 using +** the same [byte-order determination rules] as [sqlite3_bind_text16()]. +** ^If the third parameter to sqlite3_result_error() +** or sqlite3_result_error16() is negative then SQLite takes as the error +** message all text up through the first zero character. +** ^If the third parameter to sqlite3_result_error() or +** sqlite3_result_error16() is non-negative then SQLite takes that many +** bytes (not characters) from the 2nd parameter as the error message. +** ^The sqlite3_result_error() and sqlite3_result_error16() +** routines make a private copy of the error message text before +** they return. Hence, the calling function can deallocate or +** modify the text after they return without harm. +** ^The sqlite3_result_error_code() function changes the error code +** returned by SQLite as a result of an error in a function. ^By default, +** the error code is SQLITE_ERROR. ^A subsequent call to sqlite3_result_error() +** or sqlite3_result_error16() resets the error code to SQLITE_ERROR. +** +** ^The sqlite3_result_error_toobig() interface causes SQLite to throw an +** error indicating that a string or BLOB is too long to represent. +** +** ^The sqlite3_result_error_nomem() interface causes SQLite to throw an +** error indicating that a memory allocation failed. +** +** ^The sqlite3_result_int() interface sets the return value +** of the application-defined function to be the 32-bit signed integer +** value given in the 2nd argument. +** ^The sqlite3_result_int64() interface sets the return value +** of the application-defined function to be the 64-bit signed integer +** value given in the 2nd argument. +** +** ^The sqlite3_result_null() interface sets the return value +** of the application-defined function to be NULL. +** +** ^The sqlite3_result_text(), sqlite3_result_text16(), +** sqlite3_result_text16le(), and sqlite3_result_text16be() interfaces +** set the return value of the application-defined function to be +** a text string which is represented as UTF-8, UTF-16 native byte order, +** UTF-16 little endian, or UTF-16 big endian, respectively. +** ^The sqlite3_result_text64() interface sets the return value of an +** application-defined function to be a text string in an encoding +** specified by the fifth (and last) parameter, which must be one +** of [SQLITE_UTF8], [SQLITE_UTF16], [SQLITE_UTF16BE], or [SQLITE_UTF16LE]. +** ^SQLite takes the text result from the application from +** the 2nd parameter of the sqlite3_result_text* interfaces. +** ^If the 3rd parameter to the sqlite3_result_text* interfaces +** is negative, then SQLite takes result text from the 2nd parameter +** through the first zero character. +** ^If the 3rd parameter to the sqlite3_result_text* interfaces +** is non-negative, then as many bytes (not characters) of the text +** pointed to by the 2nd parameter are taken as the application-defined +** function result. If the 3rd parameter is non-negative, then it +** must be the byte offset into the string where the NUL terminator would +** appear if the string where NUL terminated. If any NUL characters occur +** in the string at a byte offset that is less than the value of the 3rd +** parameter, then the resulting string will contain embedded NULs and the +** result of expressions operating on strings with embedded NULs is undefined. +** ^If the 4th parameter to the sqlite3_result_text* interfaces +** or sqlite3_result_blob is a non-NULL pointer, then SQLite calls that +** function as the destructor on the text or BLOB result when it has +** finished using that result. +** ^If the 4th parameter to the sqlite3_result_text* interfaces or to +** sqlite3_result_blob is the special constant SQLITE_STATIC, then SQLite +** assumes that the text or BLOB result is in constant space and does not +** copy the content of the parameter nor call a destructor on the content +** when it has finished using that result. +** ^If the 4th parameter to the sqlite3_result_text* interfaces +** or sqlite3_result_blob is the special constant SQLITE_TRANSIENT +** then SQLite makes a copy of the result into space obtained +** from [sqlite3_malloc()] before it returns. +** +** ^For the sqlite3_result_text16(), sqlite3_result_text16le(), and +** sqlite3_result_text16be() routines, and for sqlite3_result_text64() +** when the encoding is not UTF8, if the input UTF16 begins with a +** byte-order mark (BOM, U+FEFF) then the BOM is removed from the +** string and the rest of the string is interpreted according to the +** byte-order specified by the BOM. ^The byte-order specified by +** the BOM at the beginning of the text overrides the byte-order +** specified by the interface procedure. ^So, for example, if +** sqlite3_result_text16le() is invoked with text that begins +** with bytes 0xfe, 0xff (a big-endian byte-order mark) then the +** first two bytes of input are skipped and the remaining input +** is interpreted as UTF16BE text. +** +** ^For UTF16 input text to the sqlite3_result_text16(), +** sqlite3_result_text16be(), sqlite3_result_text16le(), and +** sqlite3_result_text64() routines, if the text contains invalid +** UTF16 characters, the invalid characters might be converted +** into the unicode replacement character, U+FFFD. +** +** ^The sqlite3_result_value() interface sets the result of +** the application-defined function to be a copy of the +** [unprotected sqlite3_value] object specified by the 2nd parameter. ^The +** sqlite3_result_value() interface makes a copy of the [sqlite3_value] +** so that the [sqlite3_value] specified in the parameter may change or +** be deallocated after sqlite3_result_value() returns without harm. +** ^A [protected sqlite3_value] object may always be used where an +** [unprotected sqlite3_value] object is required, so either +** kind of [sqlite3_value] object can be used with this interface. +** +** ^The sqlite3_result_pointer(C,P,T,D) interface sets the result to an +** SQL NULL value, just like [sqlite3_result_null(C)], except that it +** also associates the host-language pointer P or type T with that +** NULL value such that the pointer can be retrieved within an +** [application-defined SQL function] using [sqlite3_value_pointer()]. +** ^If the D parameter is not NULL, then it is a pointer to a destructor +** for the P parameter. ^SQLite invokes D with P as its only argument +** when SQLite is finished with P. The T parameter should be a static +** string and preferably a string literal. The sqlite3_result_pointer() +** routine is part of the [pointer passing interface] added for SQLite 3.20.0. +** +** If these routines are called from within the different thread +** than the one containing the application-defined function that received +** the [sqlite3_context] pointer, the results are undefined. +*/ +SQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*)); +SQLITE_API void sqlite3_result_blob64(sqlite3_context*,const void*, + sqlite3_uint64,void(*)(void*)); +SQLITE_API void sqlite3_result_double(sqlite3_context*, double); +SQLITE_API void sqlite3_result_error(sqlite3_context*, const char*, int); +SQLITE_API void sqlite3_result_error16(sqlite3_context*, const void*, int); +SQLITE_API void sqlite3_result_error_toobig(sqlite3_context*); +SQLITE_API void sqlite3_result_error_nomem(sqlite3_context*); +SQLITE_API void sqlite3_result_error_code(sqlite3_context*, int); +SQLITE_API void sqlite3_result_int(sqlite3_context*, int); +SQLITE_API void sqlite3_result_int64(sqlite3_context*, sqlite3_int64); +SQLITE_API void sqlite3_result_null(sqlite3_context*); +SQLITE_API void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*)); +SQLITE_API void sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64, + void(*)(void*), unsigned char encoding); +SQLITE_API void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*)); +SQLITE_API void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*)); +SQLITE_API void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*)); +SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*); +SQLITE_API void sqlite3_result_pointer(sqlite3_context*, void*,const char*,void(*)(void*)); +SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n); +SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n); + + +/* +** CAPI3REF: Setting The Subtype Of An SQL Function +** METHOD: sqlite3_context +** +** The sqlite3_result_subtype(C,T) function causes the subtype of +** the result from the [application-defined SQL function] with +** [sqlite3_context] C to be the value T. Only the lower 8 bits +** of the subtype T are preserved in current versions of SQLite; +** higher order bits are discarded. +** The number of subtype bytes preserved by SQLite might increase +** in future releases of SQLite. +*/ +SQLITE_API void sqlite3_result_subtype(sqlite3_context*,unsigned int); + +/* +** CAPI3REF: Define New Collating Sequences +** METHOD: sqlite3 +** +** ^These functions add, remove, or modify a [collation] associated +** with the [database connection] specified as the first argument. +** +** ^The name of the collation is a UTF-8 string +** for sqlite3_create_collation() and sqlite3_create_collation_v2() +** and a UTF-16 string in native byte order for sqlite3_create_collation16(). +** ^Collation names that compare equal according to [sqlite3_strnicmp()] are +** considered to be the same name. +** +** ^(The third argument (eTextRep) must be one of the constants: +**
    +**
  • [SQLITE_UTF8], +**
  • [SQLITE_UTF16LE], +**
  • [SQLITE_UTF16BE], +**
  • [SQLITE_UTF16], or +**
  • [SQLITE_UTF16_ALIGNED]. +**
)^ +** ^The eTextRep argument determines the encoding of strings passed +** to the collating function callback, xCompare. +** ^The [SQLITE_UTF16] and [SQLITE_UTF16_ALIGNED] values for eTextRep +** force strings to be UTF16 with native byte order. +** ^The [SQLITE_UTF16_ALIGNED] value for eTextRep forces strings to begin +** on an even byte address. +** +** ^The fourth argument, pArg, is an application data pointer that is passed +** through as the first argument to the collating function callback. +** +** ^The fifth argument, xCompare, is a pointer to the collating function. +** ^Multiple collating functions can be registered using the same name but +** with different eTextRep parameters and SQLite will use whichever +** function requires the least amount of data transformation. +** ^If the xCompare argument is NULL then the collating function is +** deleted. ^When all collating functions having the same name are deleted, +** that collation is no longer usable. +** +** ^The collating function callback is invoked with a copy of the pArg +** application data pointer and with two strings in the encoding specified +** by the eTextRep argument. The two integer parameters to the collating +** function callback are the length of the two strings, in bytes. The collating +** function must return an integer that is negative, zero, or positive +** if the first string is less than, equal to, or greater than the second, +** respectively. A collating function must always return the same answer +** given the same inputs. If two or more collating functions are registered +** to the same collation name (using different eTextRep values) then all +** must give an equivalent answer when invoked with equivalent strings. +** The collating function must obey the following properties for all +** strings A, B, and C: +** +**
    +**
  1. If A==B then B==A. +**
  2. If A==B and B==C then A==C. +**
  3. If A<B THEN B>A. +**
  4. If A<B and B<C then A<C. +**
+** +** If a collating function fails any of the above constraints and that +** collating function is registered and used, then the behavior of SQLite +** is undefined. +** +** ^The sqlite3_create_collation_v2() works like sqlite3_create_collation() +** with the addition that the xDestroy callback is invoked on pArg when +** the collating function is deleted. +** ^Collating functions are deleted when they are overridden by later +** calls to the collation creation functions or when the +** [database connection] is closed using [sqlite3_close()]. +** +** ^The xDestroy callback is not called if the +** sqlite3_create_collation_v2() function fails. Applications that invoke +** sqlite3_create_collation_v2() with a non-NULL xDestroy argument should +** check the return code and dispose of the application data pointer +** themselves rather than expecting SQLite to deal with it for them. +** This is different from every other SQLite interface. The inconsistency +** is unfortunate but cannot be changed without breaking backwards +** compatibility. +** +** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()]. +*/ +SQLITE_API int sqlite3_create_collation( + sqlite3*, + const char *zName, + int eTextRep, + void *pArg, + int(*xCompare)(void*,int,const void*,int,const void*) +); +SQLITE_API int sqlite3_create_collation_v2( + sqlite3*, + const char *zName, + int eTextRep, + void *pArg, + int(*xCompare)(void*,int,const void*,int,const void*), + void(*xDestroy)(void*) +); +SQLITE_API int sqlite3_create_collation16( + sqlite3*, + const void *zName, + int eTextRep, + void *pArg, + int(*xCompare)(void*,int,const void*,int,const void*) +); + +/* +** CAPI3REF: Collation Needed Callbacks +** METHOD: sqlite3 +** +** ^To avoid having to register all collation sequences before a database +** can be used, a single callback function may be registered with the +** [database connection] to be invoked whenever an undefined collation +** sequence is required. +** +** ^If the function is registered using the sqlite3_collation_needed() API, +** then it is passed the names of undefined collation sequences as strings +** encoded in UTF-8. ^If sqlite3_collation_needed16() is used, +** the names are passed as UTF-16 in machine native byte order. +** ^A call to either function replaces the existing collation-needed callback. +** +** ^(When the callback is invoked, the first argument passed is a copy +** of the second argument to sqlite3_collation_needed() or +** sqlite3_collation_needed16(). The second argument is the database +** connection. The third argument is one of [SQLITE_UTF8], [SQLITE_UTF16BE], +** or [SQLITE_UTF16LE], indicating the most desirable form of the collation +** sequence function required. The fourth parameter is the name of the +** required collation sequence.)^ +** +** The callback function should register the desired collation using +** [sqlite3_create_collation()], [sqlite3_create_collation16()], or +** [sqlite3_create_collation_v2()]. +*/ +SQLITE_API int sqlite3_collation_needed( + sqlite3*, + void*, + void(*)(void*,sqlite3*,int eTextRep,const char*) +); +SQLITE_API int sqlite3_collation_needed16( + sqlite3*, + void*, + void(*)(void*,sqlite3*,int eTextRep,const void*) +); + +#ifdef SQLITE_ENABLE_CEROD +/* +** Specify the activation key for a CEROD database. Unless +** activated, none of the CEROD routines will work. +*/ +SQLITE_API void sqlite3_activate_cerod( + const char *zPassPhrase /* Activation phrase */ +); +#endif + +/* +** CAPI3REF: Suspend Execution For A Short Time +** +** The sqlite3_sleep() function causes the current thread to suspend execution +** for at least a number of milliseconds specified in its parameter. +** +** If the operating system does not support sleep requests with +** millisecond time resolution, then the time will be rounded up to +** the nearest second. The number of milliseconds of sleep actually +** requested from the operating system is returned. +** +** ^SQLite implements this interface by calling the xSleep() +** method of the default [sqlite3_vfs] object. If the xSleep() method +** of the default VFS is not implemented correctly, or not implemented at +** all, then the behavior of sqlite3_sleep() may deviate from the description +** in the previous paragraphs. +*/ +SQLITE_API int sqlite3_sleep(int); + +/* +** CAPI3REF: Name Of The Folder Holding Temporary Files +** +** ^(If this global variable is made to point to a string which is +** the name of a folder (a.k.a. directory), then all temporary files +** created by SQLite when using a built-in [sqlite3_vfs | VFS] +** will be placed in that directory.)^ ^If this variable +** is a NULL pointer, then SQLite performs a search for an appropriate +** temporary file directory. +** +** Applications are strongly discouraged from using this global variable. +** It is required to set a temporary folder on Windows Runtime (WinRT). +** But for all other platforms, it is highly recommended that applications +** neither read nor write this variable. This global variable is a relic +** that exists for backwards compatibility of legacy applications and should +** be avoided in new projects. +** +** It is not safe to read or modify this variable in more than one +** thread at a time. It is not safe to read or modify this variable +** if a [database connection] is being used at the same time in a separate +** thread. +** It is intended that this variable be set once +** as part of process initialization and before any SQLite interface +** routines have been called and that this variable remain unchanged +** thereafter. +** +** ^The [temp_store_directory pragma] may modify this variable and cause +** it to point to memory obtained from [sqlite3_malloc]. ^Furthermore, +** the [temp_store_directory pragma] always assumes that any string +** that this variable points to is held in memory obtained from +** [sqlite3_malloc] and the pragma may attempt to free that memory +** using [sqlite3_free]. +** Hence, if this variable is modified directly, either it should be +** made NULL or made to point to memory obtained from [sqlite3_malloc] +** or else the use of the [temp_store_directory pragma] should be avoided. +** Except when requested by the [temp_store_directory pragma], SQLite +** does not free the memory that sqlite3_temp_directory points to. If +** the application wants that memory to be freed, it must do +** so itself, taking care to only do so after all [database connection] +** objects have been destroyed. +** +** Note to Windows Runtime users: The temporary directory must be set +** prior to calling [sqlite3_open] or [sqlite3_open_v2]. Otherwise, various +** features that require the use of temporary files may fail. Here is an +** example of how to do this using C++ with the Windows Runtime: +** +**
+** LPCWSTR zPath = Windows::Storage::ApplicationData::Current->
+**       TemporaryFolder->Path->Data();
+** char zPathBuf[MAX_PATH + 1];
+** memset(zPathBuf, 0, sizeof(zPathBuf));
+** WideCharToMultiByte(CP_UTF8, 0, zPath, -1, zPathBuf, sizeof(zPathBuf),
+**       NULL, NULL);
+** sqlite3_temp_directory = sqlite3_mprintf("%s", zPathBuf);
+** 
+*/ +SQLITE_API SQLITE_EXTERN char *sqlite3_temp_directory; + +/* +** CAPI3REF: Name Of The Folder Holding Database Files +** +** ^(If this global variable is made to point to a string which is +** the name of a folder (a.k.a. directory), then all database files +** specified with a relative pathname and created or accessed by +** SQLite when using a built-in windows [sqlite3_vfs | VFS] will be assumed +** to be relative to that directory.)^ ^If this variable is a NULL +** pointer, then SQLite assumes that all database files specified +** with a relative pathname are relative to the current directory +** for the process. Only the windows VFS makes use of this global +** variable; it is ignored by the unix VFS. +** +** Changing the value of this variable while a database connection is +** open can result in a corrupt database. +** +** It is not safe to read or modify this variable in more than one +** thread at a time. It is not safe to read or modify this variable +** if a [database connection] is being used at the same time in a separate +** thread. +** It is intended that this variable be set once +** as part of process initialization and before any SQLite interface +** routines have been called and that this variable remain unchanged +** thereafter. +** +** ^The [data_store_directory pragma] may modify this variable and cause +** it to point to memory obtained from [sqlite3_malloc]. ^Furthermore, +** the [data_store_directory pragma] always assumes that any string +** that this variable points to is held in memory obtained from +** [sqlite3_malloc] and the pragma may attempt to free that memory +** using [sqlite3_free]. +** Hence, if this variable is modified directly, either it should be +** made NULL or made to point to memory obtained from [sqlite3_malloc] +** or else the use of the [data_store_directory pragma] should be avoided. +*/ +SQLITE_API SQLITE_EXTERN char *sqlite3_data_directory; + +/* +** CAPI3REF: Win32 Specific Interface +** +** These interfaces are available only on Windows. The +** [sqlite3_win32_set_directory] interface is used to set the value associated +** with the [sqlite3_temp_directory] or [sqlite3_data_directory] variable, to +** zValue, depending on the value of the type parameter. The zValue parameter +** should be NULL to cause the previous value to be freed via [sqlite3_free]; +** a non-NULL value will be copied into memory obtained from [sqlite3_malloc] +** prior to being used. The [sqlite3_win32_set_directory] interface returns +** [SQLITE_OK] to indicate success, [SQLITE_ERROR] if the type is unsupported, +** or [SQLITE_NOMEM] if memory could not be allocated. The value of the +** [sqlite3_data_directory] variable is intended to act as a replacement for +** the current directory on the sub-platforms of Win32 where that concept is +** not present, e.g. WinRT and UWP. The [sqlite3_win32_set_directory8] and +** [sqlite3_win32_set_directory16] interfaces behave exactly the same as the +** sqlite3_win32_set_directory interface except the string parameter must be +** UTF-8 or UTF-16, respectively. +*/ +SQLITE_API int sqlite3_win32_set_directory( + unsigned long type, /* Identifier for directory being set or reset */ + void *zValue /* New value for directory being set or reset */ +); +SQLITE_API int sqlite3_win32_set_directory8(unsigned long type, const char *zValue); +SQLITE_API int sqlite3_win32_set_directory16(unsigned long type, const void *zValue); + +/* +** CAPI3REF: Win32 Directory Types +** +** These macros are only available on Windows. They define the allowed values +** for the type argument to the [sqlite3_win32_set_directory] interface. +*/ +#define SQLITE_WIN32_DATA_DIRECTORY_TYPE 1 +#define SQLITE_WIN32_TEMP_DIRECTORY_TYPE 2 + +/* +** CAPI3REF: Test For Auto-Commit Mode +** KEYWORDS: {autocommit mode} +** METHOD: sqlite3 +** +** ^The sqlite3_get_autocommit() interface returns non-zero or +** zero if the given database connection is or is not in autocommit mode, +** respectively. ^Autocommit mode is on by default. +** ^Autocommit mode is disabled by a [BEGIN] statement. +** ^Autocommit mode is re-enabled by a [COMMIT] or [ROLLBACK]. +** +** If certain kinds of errors occur on a statement within a multi-statement +** transaction (errors including [SQLITE_FULL], [SQLITE_IOERR], +** [SQLITE_NOMEM], [SQLITE_BUSY], and [SQLITE_INTERRUPT]) then the +** transaction might be rolled back automatically. The only way to +** find out whether SQLite automatically rolled back the transaction after +** an error is to use this function. +** +** If another thread changes the autocommit status of the database +** connection while this routine is running, then the return value +** is undefined. +*/ +SQLITE_API int sqlite3_get_autocommit(sqlite3*); + +/* +** CAPI3REF: Find The Database Handle Of A Prepared Statement +** METHOD: sqlite3_stmt +** +** ^The sqlite3_db_handle interface returns the [database connection] handle +** to which a [prepared statement] belongs. ^The [database connection] +** returned by sqlite3_db_handle is the same [database connection] +** that was the first argument +** to the [sqlite3_prepare_v2()] call (or its variants) that was used to +** create the statement in the first place. +*/ +SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*); + +/* +** CAPI3REF: Return The Filename For A Database Connection +** METHOD: sqlite3 +** +** ^The sqlite3_db_filename(D,N) interface returns a pointer to the filename +** associated with database N of connection D. +** ^If there is no attached database N on the database +** connection D, or if database N is a temporary or in-memory database, then +** this function will return either a NULL pointer or an empty string. +** +** ^The string value returned by this routine is owned and managed by +** the database connection. ^The value will be valid until the database N +** is [DETACH]-ed or until the database connection closes. +** +** ^The filename returned by this function is the output of the +** xFullPathname method of the [VFS]. ^In other words, the filename +** will be an absolute pathname, even if the filename used +** to open the database originally was a URI or relative pathname. +** +** If the filename pointer returned by this routine is not NULL, then it +** can be used as the filename input parameter to these routines: +**
    +**
  • [sqlite3_uri_parameter()] +**
  • [sqlite3_uri_boolean()] +**
  • [sqlite3_uri_int64()] +**
  • [sqlite3_filename_database()] +**
  • [sqlite3_filename_journal()] +**
  • [sqlite3_filename_wal()] +**
+*/ +SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName); + +/* +** CAPI3REF: Determine if a database is read-only +** METHOD: sqlite3 +** +** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N +** of connection D is read-only, 0 if it is read/write, or -1 if N is not +** the name of a database on connection D. +*/ +SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName); + +/* +** CAPI3REF: Find the next prepared statement +** METHOD: sqlite3 +** +** ^This interface returns a pointer to the next [prepared statement] after +** pStmt associated with the [database connection] pDb. ^If pStmt is NULL +** then this interface returns a pointer to the first prepared statement +** associated with the database connection pDb. ^If no prepared statement +** satisfies the conditions of this routine, it returns NULL. +** +** The [database connection] pointer D in a call to +** [sqlite3_next_stmt(D,S)] must refer to an open database +** connection and in particular must not be a NULL pointer. +*/ +SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt); + +/* +** CAPI3REF: Commit And Rollback Notification Callbacks +** METHOD: sqlite3 +** +** ^The sqlite3_commit_hook() interface registers a callback +** function to be invoked whenever a transaction is [COMMIT | committed]. +** ^Any callback set by a previous call to sqlite3_commit_hook() +** for the same database connection is overridden. +** ^The sqlite3_rollback_hook() interface registers a callback +** function to be invoked whenever a transaction is [ROLLBACK | rolled back]. +** ^Any callback set by a previous call to sqlite3_rollback_hook() +** for the same database connection is overridden. +** ^The pArg argument is passed through to the callback. +** ^If the callback on a commit hook function returns non-zero, +** then the commit is converted into a rollback. +** +** ^The sqlite3_commit_hook(D,C,P) and sqlite3_rollback_hook(D,C,P) functions +** return the P argument from the previous call of the same function +** on the same [database connection] D, or NULL for +** the first call for each function on D. +** +** The commit and rollback hook callbacks are not reentrant. +** The callback implementation must not do anything that will modify +** the database connection that invoked the callback. Any actions +** to modify the database connection must be deferred until after the +** completion of the [sqlite3_step()] call that triggered the commit +** or rollback hook in the first place. +** Note that running any other SQL statements, including SELECT statements, +** or merely calling [sqlite3_prepare_v2()] and [sqlite3_step()] will modify +** the database connections for the meaning of "modify" in this paragraph. +** +** ^Registering a NULL function disables the callback. +** +** ^When the commit hook callback routine returns zero, the [COMMIT] +** operation is allowed to continue normally. ^If the commit hook +** returns non-zero, then the [COMMIT] is converted into a [ROLLBACK]. +** ^The rollback hook is invoked on a rollback that results from a commit +** hook returning non-zero, just as it would be with any other rollback. +** +** ^For the purposes of this API, a transaction is said to have been +** rolled back if an explicit "ROLLBACK" statement is executed, or +** an error or constraint causes an implicit rollback to occur. +** ^The rollback callback is not invoked if a transaction is +** automatically rolled back because the database connection is closed. +** +** See also the [sqlite3_update_hook()] interface. +*/ +SQLITE_API void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*); +SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); + +/* +** CAPI3REF: Data Change Notification Callbacks +** METHOD: sqlite3 +** +** ^The sqlite3_update_hook() interface registers a callback function +** with the [database connection] identified by the first argument +** to be invoked whenever a row is updated, inserted or deleted in +** a [rowid table]. +** ^Any callback set by a previous call to this function +** for the same database connection is overridden. +** +** ^The second argument is a pointer to the function to invoke when a +** row is updated, inserted or deleted in a rowid table. +** ^The first argument to the callback is a copy of the third argument +** to sqlite3_update_hook(). +** ^The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE], +** or [SQLITE_UPDATE], depending on the operation that caused the callback +** to be invoked. +** ^The third and fourth arguments to the callback contain pointers to the +** database and table name containing the affected row. +** ^The final callback parameter is the [rowid] of the row. +** ^In the case of an update, this is the [rowid] after the update takes place. +** +** ^(The update hook is not invoked when internal system tables are +** modified (i.e. sqlite_master and sqlite_sequence).)^ +** ^The update hook is not invoked when [WITHOUT ROWID] tables are modified. +** +** ^In the current implementation, the update hook +** is not invoked when conflicting rows are deleted because of an +** [ON CONFLICT | ON CONFLICT REPLACE] clause. ^Nor is the update hook +** invoked when rows are deleted using the [truncate optimization]. +** The exceptions defined in this paragraph might change in a future +** release of SQLite. +** +** The update hook implementation must not do anything that will modify +** the database connection that invoked the update hook. Any actions +** to modify the database connection must be deferred until after the +** completion of the [sqlite3_step()] call that triggered the update hook. +** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their +** database connections for the meaning of "modify" in this paragraph. +** +** ^The sqlite3_update_hook(D,C,P) function +** returns the P argument from the previous call +** on the same [database connection] D, or NULL for +** the first call on D. +** +** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()], +** and [sqlite3_preupdate_hook()] interfaces. +*/ +SQLITE_API void *sqlite3_update_hook( + sqlite3*, + void(*)(void *,int ,char const *,char const *,sqlite3_int64), + void* +); + +/* +** CAPI3REF: Enable Or Disable Shared Pager Cache +** +** ^(This routine enables or disables the sharing of the database cache +** and schema data structures between [database connection | connections] +** to the same database. Sharing is enabled if the argument is true +** and disabled if the argument is false.)^ +** +** ^Cache sharing is enabled and disabled for an entire process. +** This is a change as of SQLite [version 3.5.0] ([dateof:3.5.0]). +** In prior versions of SQLite, +** sharing was enabled or disabled for each thread separately. +** +** ^(The cache sharing mode set by this interface effects all subsequent +** calls to [sqlite3_open()], [sqlite3_open_v2()], and [sqlite3_open16()]. +** Existing database connections continue to use the sharing mode +** that was in effect at the time they were opened.)^ +** +** ^(This routine returns [SQLITE_OK] if shared cache was enabled or disabled +** successfully. An [error code] is returned otherwise.)^ +** +** ^Shared cache is disabled by default. It is recommended that it stay +** that way. In other words, do not use this routine. This interface +** continues to be provided for historical compatibility, but its use is +** discouraged. Any use of shared cache is discouraged. If shared cache +** must be used, it is recommended that shared cache only be enabled for +** individual database connections using the [sqlite3_open_v2()] interface +** with the [SQLITE_OPEN_SHAREDCACHE] flag. +** +** Note: This method is disabled on MacOS X 10.7 and iOS version 5.0 +** and will always return SQLITE_MISUSE. On those systems, +** shared cache mode should be enabled per-database connection via +** [sqlite3_open_v2()] with [SQLITE_OPEN_SHAREDCACHE]. +** +** This interface is threadsafe on processors where writing a +** 32-bit integer is atomic. +** +** See Also: [SQLite Shared-Cache Mode] +*/ +SQLITE_API int sqlite3_enable_shared_cache(int); + +/* +** CAPI3REF: Attempt To Free Heap Memory +** +** ^The sqlite3_release_memory() interface attempts to free N bytes +** of heap memory by deallocating non-essential memory allocations +** held by the database library. Memory used to cache database +** pages to improve performance is an example of non-essential memory. +** ^sqlite3_release_memory() returns the number of bytes actually freed, +** which might be more or less than the amount requested. +** ^The sqlite3_release_memory() routine is a no-op returning zero +** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT]. +** +** See also: [sqlite3_db_release_memory()] +*/ +SQLITE_API int sqlite3_release_memory(int); + +/* +** CAPI3REF: Free Memory Used By A Database Connection +** METHOD: sqlite3 +** +** ^The sqlite3_db_release_memory(D) interface attempts to free as much heap +** memory as possible from database connection D. Unlike the +** [sqlite3_release_memory()] interface, this interface is in effect even +** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is +** omitted. +** +** See also: [sqlite3_release_memory()] +*/ +SQLITE_API int sqlite3_db_release_memory(sqlite3*); + +/* +** CAPI3REF: Impose A Limit On Heap Size +** +** These interfaces impose limits on the amount of heap memory that will be +** by all database connections within a single process. +** +** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the +** soft limit on the amount of heap memory that may be allocated by SQLite. +** ^SQLite strives to keep heap memory utilization below the soft heap +** limit by reducing the number of pages held in the page cache +** as heap memory usages approaches the limit. +** ^The soft heap limit is "soft" because even though SQLite strives to stay +** below the limit, it will exceed the limit rather than generate +** an [SQLITE_NOMEM] error. In other words, the soft heap limit +** is advisory only. +** +** ^The sqlite3_hard_heap_limit64(N) interface sets a hard upper bound of +** N bytes on the amount of memory that will be allocated. ^The +** sqlite3_hard_heap_limit64(N) interface is similar to +** sqlite3_soft_heap_limit64(N) except that memory allocations will fail +** when the hard heap limit is reached. +** +** ^The return value from both sqlite3_soft_heap_limit64() and +** sqlite3_hard_heap_limit64() is the size of +** the heap limit prior to the call, or negative in the case of an +** error. ^If the argument N is negative +** then no change is made to the heap limit. Hence, the current +** size of heap limits can be determined by invoking +** sqlite3_soft_heap_limit64(-1) or sqlite3_hard_heap_limit(-1). +** +** ^Setting the heap limits to zero disables the heap limiter mechanism. +** +** ^The soft heap limit may not be greater than the hard heap limit. +** ^If the hard heap limit is enabled and if sqlite3_soft_heap_limit(N) +** is invoked with a value of N that is greater than the hard heap limit, +** the the soft heap limit is set to the value of the hard heap limit. +** ^The soft heap limit is automatically enabled whenever the hard heap +** limit is enabled. ^When sqlite3_hard_heap_limit64(N) is invoked and +** the soft heap limit is outside the range of 1..N, then the soft heap +** limit is set to N. ^Invoking sqlite3_soft_heap_limit64(0) when the +** hard heap limit is enabled makes the soft heap limit equal to the +** hard heap limit. +** +** The memory allocation limits can also be adjusted using +** [PRAGMA soft_heap_limit] and [PRAGMA hard_heap_limit]. +** +** ^(The heap limits are not enforced in the current implementation +** if one or more of following conditions are true: +** +**
    +**
  • The limit value is set to zero. +**
  • Memory accounting is disabled using a combination of the +** [sqlite3_config]([SQLITE_CONFIG_MEMSTATUS],...) start-time option and +** the [SQLITE_DEFAULT_MEMSTATUS] compile-time option. +**
  • An alternative page cache implementation is specified using +** [sqlite3_config]([SQLITE_CONFIG_PCACHE2],...). +**
  • The page cache allocates from its own memory pool supplied +** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than +** from the heap. +**
)^ +** +** The circumstances under which SQLite will enforce the heap limits may +** changes in future releases of SQLite. +*/ +SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N); +SQLITE_API sqlite3_int64 sqlite3_hard_heap_limit64(sqlite3_int64 N); + +/* +** CAPI3REF: Deprecated Soft Heap Limit Interface +** DEPRECATED +** +** This is a deprecated version of the [sqlite3_soft_heap_limit64()] +** interface. This routine is provided for historical compatibility +** only. All new applications should use the +** [sqlite3_soft_heap_limit64()] interface rather than this one. +*/ +SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N); + + +/* +** CAPI3REF: Extract Metadata About A Column Of A Table +** METHOD: sqlite3 +** +** ^(The sqlite3_table_column_metadata(X,D,T,C,....) routine returns +** information about column C of table T in database D +** on [database connection] X.)^ ^The sqlite3_table_column_metadata() +** interface returns SQLITE_OK and fills in the non-NULL pointers in +** the final five arguments with appropriate values if the specified +** column exists. ^The sqlite3_table_column_metadata() interface returns +** SQLITE_ERROR if the specified column does not exist. +** ^If the column-name parameter to sqlite3_table_column_metadata() is a +** NULL pointer, then this routine simply checks for the existence of the +** table and returns SQLITE_OK if the table exists and SQLITE_ERROR if it +** does not. If the table name parameter T in a call to +** sqlite3_table_column_metadata(X,D,T,C,...) is NULL then the result is +** undefined behavior. +** +** ^The column is identified by the second, third and fourth parameters to +** this function. ^(The second parameter is either the name of the database +** (i.e. "main", "temp", or an attached database) containing the specified +** table or NULL.)^ ^If it is NULL, then all attached databases are searched +** for the table using the same algorithm used by the database engine to +** resolve unqualified table references. +** +** ^The third and fourth parameters to this function are the table and column +** name of the desired column, respectively. +** +** ^Metadata is returned by writing to the memory locations passed as the 5th +** and subsequent parameters to this function. ^Any of these arguments may be +** NULL, in which case the corresponding element of metadata is omitted. +** +** ^(
+** +**
Parameter Output
Type
Description +** +**
5th const char* Data type +**
6th const char* Name of default collation sequence +**
7th int True if column has a NOT NULL constraint +**
8th int True if column is part of the PRIMARY KEY +**
9th int True if column is [AUTOINCREMENT] +**
+**
)^ +** +** ^The memory pointed to by the character pointers returned for the +** declaration type and collation sequence is valid until the next +** call to any SQLite API function. +** +** ^If the specified table is actually a view, an [error code] is returned. +** +** ^If the specified column is "rowid", "oid" or "_rowid_" and the table +** is not a [WITHOUT ROWID] table and an +** [INTEGER PRIMARY KEY] column has been explicitly declared, then the output +** parameters are set for the explicitly declared column. ^(If there is no +** [INTEGER PRIMARY KEY] column, then the outputs +** for the [rowid] are set as follows: +** +**
+**     data type: "INTEGER"
+**     collation sequence: "BINARY"
+**     not null: 0
+**     primary key: 1
+**     auto increment: 0
+** 
)^ +** +** ^This function causes all database schemas to be read from disk and +** parsed, if that has not already been done, and returns an error if +** any errors are encountered while loading the schema. +*/ +SQLITE_API int sqlite3_table_column_metadata( + sqlite3 *db, /* Connection handle */ + const char *zDbName, /* Database name or NULL */ + const char *zTableName, /* Table name */ + const char *zColumnName, /* Column name */ + char const **pzDataType, /* OUTPUT: Declared data type */ + char const **pzCollSeq, /* OUTPUT: Collation sequence name */ + int *pNotNull, /* OUTPUT: True if NOT NULL constraint exists */ + int *pPrimaryKey, /* OUTPUT: True if column part of PK */ + int *pAutoinc /* OUTPUT: True if column is auto-increment */ +); + +/* +** CAPI3REF: Load An Extension +** METHOD: sqlite3 +** +** ^This interface loads an SQLite extension library from the named file. +** +** ^The sqlite3_load_extension() interface attempts to load an +** [SQLite extension] library contained in the file zFile. If +** the file cannot be loaded directly, attempts are made to load +** with various operating-system specific extensions added. +** So for example, if "samplelib" cannot be loaded, then names like +** "samplelib.so" or "samplelib.dylib" or "samplelib.dll" might +** be tried also. +** +** ^The entry point is zProc. +** ^(zProc may be 0, in which case SQLite will try to come up with an +** entry point name on its own. It first tries "sqlite3_extension_init". +** If that does not work, it constructs a name "sqlite3_X_init" where the +** X is consists of the lower-case equivalent of all ASCII alphabetic +** characters in the filename from the last "/" to the first following +** "." and omitting any initial "lib".)^ +** ^The sqlite3_load_extension() interface returns +** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong. +** ^If an error occurs and pzErrMsg is not 0, then the +** [sqlite3_load_extension()] interface shall attempt to +** fill *pzErrMsg with error message text stored in memory +** obtained from [sqlite3_malloc()]. The calling function +** should free this memory by calling [sqlite3_free()]. +** +** ^Extension loading must be enabled using +** [sqlite3_enable_load_extension()] or +** [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],1,NULL) +** prior to calling this API, +** otherwise an error will be returned. +** +** Security warning: It is recommended that the +** [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method be used to enable only this +** interface. The use of the [sqlite3_enable_load_extension()] interface +** should be avoided. This will keep the SQL function [load_extension()] +** disabled and prevent SQL injections from giving attackers +** access to extension loading capabilities. +** +** See also the [load_extension() SQL function]. +*/ +SQLITE_API int sqlite3_load_extension( + sqlite3 *db, /* Load the extension into this database connection */ + const char *zFile, /* Name of the shared library containing extension */ + const char *zProc, /* Entry point. Derived from zFile if 0 */ + char **pzErrMsg /* Put error message here if not 0 */ +); + +/* +** CAPI3REF: Enable Or Disable Extension Loading +** METHOD: sqlite3 +** +** ^So as not to open security holes in older applications that are +** unprepared to deal with [extension loading], and as a means of disabling +** [extension loading] while evaluating user-entered SQL, the following API +** is provided to turn the [sqlite3_load_extension()] mechanism on and off. +** +** ^Extension loading is off by default. +** ^Call the sqlite3_enable_load_extension() routine with onoff==1 +** to turn extension loading on and call it with onoff==0 to turn +** it back off again. +** +** ^This interface enables or disables both the C-API +** [sqlite3_load_extension()] and the SQL function [load_extension()]. +** ^(Use [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],..) +** to enable or disable only the C-API.)^ +** +** Security warning: It is recommended that extension loading +** be enabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method +** rather than this interface, so the [load_extension()] SQL function +** remains disabled. This will prevent SQL injections from giving attackers +** access to extension loading capabilities. +*/ +SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff); + +/* +** CAPI3REF: Automatically Load Statically Linked Extensions +** +** ^This interface causes the xEntryPoint() function to be invoked for +** each new [database connection] that is created. The idea here is that +** xEntryPoint() is the entry point for a statically linked [SQLite extension] +** that is to be automatically loaded into all new database connections. +** +** ^(Even though the function prototype shows that xEntryPoint() takes +** no arguments and returns void, SQLite invokes xEntryPoint() with three +** arguments and expects an integer result as if the signature of the +** entry point where as follows: +** +**
+**    int xEntryPoint(
+**      sqlite3 *db,
+**      const char **pzErrMsg,
+**      const struct sqlite3_api_routines *pThunk
+**    );
+** 
)^ +** +** If the xEntryPoint routine encounters an error, it should make *pzErrMsg +** point to an appropriate error message (obtained from [sqlite3_mprintf()]) +** and return an appropriate [error code]. ^SQLite ensures that *pzErrMsg +** is NULL before calling the xEntryPoint(). ^SQLite will invoke +** [sqlite3_free()] on *pzErrMsg after xEntryPoint() returns. ^If any +** xEntryPoint() returns an error, the [sqlite3_open()], [sqlite3_open16()], +** or [sqlite3_open_v2()] call that provoked the xEntryPoint() will fail. +** +** ^Calling sqlite3_auto_extension(X) with an entry point X that is already +** on the list of automatic extensions is a harmless no-op. ^No entry point +** will be called more than once for each database connection that is opened. +** +** See also: [sqlite3_reset_auto_extension()] +** and [sqlite3_cancel_auto_extension()] +*/ +SQLITE_API int sqlite3_auto_extension(void(*xEntryPoint)(void)); + +/* +** CAPI3REF: Cancel Automatic Extension Loading +** +** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the +** initialization routine X that was registered using a prior call to +** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)] +** routine returns 1 if initialization routine X was successfully +** unregistered and it returns 0 if X was not on the list of initialization +** routines. +*/ +SQLITE_API int sqlite3_cancel_auto_extension(void(*xEntryPoint)(void)); + +/* +** CAPI3REF: Reset Automatic Extension Loading +** +** ^This interface disables all automatic extensions previously +** registered using [sqlite3_auto_extension()]. +*/ +SQLITE_API void sqlite3_reset_auto_extension(void); + +/* +** The interface to the virtual-table mechanism is currently considered +** to be experimental. The interface might change in incompatible ways. +** If this is a problem for you, do not use the interface at this time. +** +** When the virtual-table mechanism stabilizes, we will declare the +** interface fixed, support it indefinitely, and remove this comment. +*/ + +/* +** Structures used by the virtual table interface +*/ +typedef struct sqlite3_vtab sqlite3_vtab; +typedef struct sqlite3_index_info sqlite3_index_info; +typedef struct sqlite3_vtab_cursor sqlite3_vtab_cursor; +typedef struct sqlite3_module sqlite3_module; + +/* +** CAPI3REF: Virtual Table Object +** KEYWORDS: sqlite3_module {virtual table module} +** +** This structure, sometimes called a "virtual table module", +** defines the implementation of a [virtual table]. +** This structure consists mostly of methods for the module. +** +** ^A virtual table module is created by filling in a persistent +** instance of this structure and passing a pointer to that instance +** to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. +** ^The registration remains valid until it is replaced by a different +** module or until the [database connection] closes. The content +** of this structure must not change while it is registered with +** any database connection. +*/ +struct sqlite3_module { + int iVersion; + int (*xCreate)(sqlite3*, void *pAux, + int argc, const char *const*argv, + sqlite3_vtab **ppVTab, char**); + int (*xConnect)(sqlite3*, void *pAux, + int argc, const char *const*argv, + sqlite3_vtab **ppVTab, char**); + int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*); + int (*xDisconnect)(sqlite3_vtab *pVTab); + int (*xDestroy)(sqlite3_vtab *pVTab); + int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor); + int (*xClose)(sqlite3_vtab_cursor*); + int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr, + int argc, sqlite3_value **argv); + int (*xNext)(sqlite3_vtab_cursor*); + int (*xEof)(sqlite3_vtab_cursor*); + int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int); + int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid); + int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *); + int (*xBegin)(sqlite3_vtab *pVTab); + int (*xSync)(sqlite3_vtab *pVTab); + int (*xCommit)(sqlite3_vtab *pVTab); + int (*xRollback)(sqlite3_vtab *pVTab); + int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName, + void (**pxFunc)(sqlite3_context*,int,sqlite3_value**), + void **ppArg); + int (*xRename)(sqlite3_vtab *pVtab, const char *zNew); + /* The methods above are in version 1 of the sqlite_module object. Those + ** below are for version 2 and greater. */ + int (*xSavepoint)(sqlite3_vtab *pVTab, int); + int (*xRelease)(sqlite3_vtab *pVTab, int); + int (*xRollbackTo)(sqlite3_vtab *pVTab, int); + /* The methods above are in versions 1 and 2 of the sqlite_module object. + ** Those below are for version 3 and greater. */ + int (*xShadowName)(const char*); +}; + +/* +** CAPI3REF: Virtual Table Indexing Information +** KEYWORDS: sqlite3_index_info +** +** The sqlite3_index_info structure and its substructures is used as part +** of the [virtual table] interface to +** pass information into and receive the reply from the [xBestIndex] +** method of a [virtual table module]. The fields under **Inputs** are the +** inputs to xBestIndex and are read-only. xBestIndex inserts its +** results into the **Outputs** fields. +** +** ^(The aConstraint[] array records WHERE clause constraints of the form: +** +**
column OP expr
+** +** where OP is =, <, <=, >, or >=.)^ ^(The particular operator is +** stored in aConstraint[].op using one of the +** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ +** ^(The index of the column is stored in +** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the +** expr on the right-hand side can be evaluated (and thus the constraint +** is usable) and false if it cannot.)^ +** +** ^The optimizer automatically inverts terms of the form "expr OP column" +** and makes other simplifications to the WHERE clause in an attempt to +** get as many WHERE clause terms into the form shown above as possible. +** ^The aConstraint[] array only reports WHERE clause terms that are +** relevant to the particular virtual table being queried. +** +** ^Information about the ORDER BY clause is stored in aOrderBy[]. +** ^Each term of aOrderBy records a column of the ORDER BY clause. +** +** The colUsed field indicates which columns of the virtual table may be +** required by the current scan. Virtual table columns are numbered from +** zero in the order in which they appear within the CREATE TABLE statement +** passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), +** the corresponding bit is set within the colUsed mask if the column may be +** required by SQLite. If the table has at least 64 columns and any column +** to the right of the first 63 is required, then bit 63 of colUsed is also +** set. In other words, column iCol may be required if the expression +** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to +** non-zero. +** +** The [xBestIndex] method must fill aConstraintUsage[] with information +** about what parameters to pass to xFilter. ^If argvIndex>0 then +** the right-hand side of the corresponding aConstraint[] is evaluated +** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit +** is true, then the constraint is assumed to be fully handled by the +** virtual table and might not be checked again by the byte code.)^ ^(The +** aConstraintUsage[].omit flag is an optimization hint. When the omit flag +** is left in its default setting of false, the constraint will always be +** checked separately in byte code. If the omit flag is change to true, then +** the constraint may or may not be checked in byte code. In other words, +** when the omit flag is true there is no guarantee that the constraint will +** not be checked again using byte code.)^ +** +** ^The idxNum and idxPtr values are recorded and passed into the +** [xFilter] method. +** ^[sqlite3_free()] is used to free idxPtr if and only if +** needToFreeIdxPtr is true. +** +** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in +** the correct order to satisfy the ORDER BY clause so that no separate +** sorting step is required. +** +** ^The estimatedCost value is an estimate of the cost of a particular +** strategy. A cost of N indicates that the cost of the strategy is similar +** to a linear scan of an SQLite table with N rows. A cost of log(N) +** indicates that the expense of the operation is similar to that of a +** binary search on a unique indexed field of an SQLite table with N rows. +** +** ^The estimatedRows value is an estimate of the number of rows that +** will be returned by the strategy. +** +** The xBestIndex method may optionally populate the idxFlags field with a +** mask of SQLITE_INDEX_SCAN_* flags. Currently there is only one such flag - +** SQLITE_INDEX_SCAN_UNIQUE. If the xBestIndex method sets this flag, SQLite +** assumes that the strategy may visit at most one row. +** +** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then +** SQLite also assumes that if a call to the xUpdate() method is made as +** part of the same statement to delete or update a virtual table row and the +** implementation returns SQLITE_CONSTRAINT, then there is no need to rollback +** any database changes. In other words, if the xUpdate() returns +** SQLITE_CONSTRAINT, the database contents must be exactly as they were +** before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not +** set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by +** the xUpdate method are automatically rolled back by SQLite. +** +** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info +** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). +** If a virtual table extension is +** used with an SQLite version earlier than 3.8.2, the results of attempting +** to read or write the estimatedRows field are undefined (but are likely +** to include crashing the application). The estimatedRows field should +** therefore only be used if [sqlite3_libversion_number()] returns a +** value greater than or equal to 3008002. Similarly, the idxFlags field +** was added for [version 3.9.0] ([dateof:3.9.0]). +** It may therefore only be used if +** sqlite3_libversion_number() returns a value greater than or equal to +** 3009000. +*/ +struct sqlite3_index_info { + /* Inputs */ + int nConstraint; /* Number of entries in aConstraint */ + struct sqlite3_index_constraint { + int iColumn; /* Column constrained. -1 for ROWID */ + unsigned char op; /* Constraint operator */ + unsigned char usable; /* True if this constraint is usable */ + int iTermOffset; /* Used internally - xBestIndex should ignore */ + } *aConstraint; /* Table of WHERE clause constraints */ + int nOrderBy; /* Number of terms in the ORDER BY clause */ + struct sqlite3_index_orderby { + int iColumn; /* Column number */ + unsigned char desc; /* True for DESC. False for ASC. */ + } *aOrderBy; /* The ORDER BY clause */ + /* Outputs */ + struct sqlite3_index_constraint_usage { + int argvIndex; /* if >0, constraint is part of argv to xFilter */ + unsigned char omit; /* Do not code a test for this constraint */ + } *aConstraintUsage; + int idxNum; /* Number used to identify the index */ + char *idxStr; /* String, possibly obtained from sqlite3_malloc */ + int needToFreeIdxStr; /* Free idxStr using sqlite3_free() if true */ + int orderByConsumed; /* True if output is already ordered */ + double estimatedCost; /* Estimated cost of using this index */ + /* Fields below are only available in SQLite 3.8.2 and later */ + sqlite3_int64 estimatedRows; /* Estimated number of rows returned */ + /* Fields below are only available in SQLite 3.9.0 and later */ + int idxFlags; /* Mask of SQLITE_INDEX_SCAN_* flags */ + /* Fields below are only available in SQLite 3.10.0 and later */ + sqlite3_uint64 colUsed; /* Input: Mask of columns used by statement */ +}; + +/* +** CAPI3REF: Virtual Table Scan Flags +** +** Virtual table implementations are allowed to set the +** [sqlite3_index_info].idxFlags field to some combination of +** these bits. +*/ +#define SQLITE_INDEX_SCAN_UNIQUE 1 /* Scan visits at most 1 row */ + +/* +** CAPI3REF: Virtual Table Constraint Operator Codes +** +** These macros define the allowed values for the +** [sqlite3_index_info].aConstraint[].op field. Each value represents +** an operator that is part of a constraint term in the wHERE clause of +** a query that uses a [virtual table]. +*/ +#define SQLITE_INDEX_CONSTRAINT_EQ 2 +#define SQLITE_INDEX_CONSTRAINT_GT 4 +#define SQLITE_INDEX_CONSTRAINT_LE 8 +#define SQLITE_INDEX_CONSTRAINT_LT 16 +#define SQLITE_INDEX_CONSTRAINT_GE 32 +#define SQLITE_INDEX_CONSTRAINT_MATCH 64 +#define SQLITE_INDEX_CONSTRAINT_LIKE 65 +#define SQLITE_INDEX_CONSTRAINT_GLOB 66 +#define SQLITE_INDEX_CONSTRAINT_REGEXP 67 +#define SQLITE_INDEX_CONSTRAINT_NE 68 +#define SQLITE_INDEX_CONSTRAINT_ISNOT 69 +#define SQLITE_INDEX_CONSTRAINT_ISNOTNULL 70 +#define SQLITE_INDEX_CONSTRAINT_ISNULL 71 +#define SQLITE_INDEX_CONSTRAINT_IS 72 +#define SQLITE_INDEX_CONSTRAINT_FUNCTION 150 + +/* +** CAPI3REF: Register A Virtual Table Implementation +** METHOD: sqlite3 +** +** ^These routines are used to register a new [virtual table module] name. +** ^Module names must be registered before +** creating a new [virtual table] using the module and before using a +** preexisting [virtual table] for the module. +** +** ^The module name is registered on the [database connection] specified +** by the first parameter. ^The name of the module is given by the +** second parameter. ^The third parameter is a pointer to +** the implementation of the [virtual table module]. ^The fourth +** parameter is an arbitrary client data pointer that is passed through +** into the [xCreate] and [xConnect] methods of the virtual table module +** when a new virtual table is be being created or reinitialized. +** +** ^The sqlite3_create_module_v2() interface has a fifth parameter which +** is a pointer to a destructor for the pClientData. ^SQLite will +** invoke the destructor function (if it is not NULL) when SQLite +** no longer needs the pClientData pointer. ^The destructor will also +** be invoked if the call to sqlite3_create_module_v2() fails. +** ^The sqlite3_create_module() +** interface is equivalent to sqlite3_create_module_v2() with a NULL +** destructor. +** +** ^If the third parameter (the pointer to the sqlite3_module object) is +** NULL then no new module is create and any existing modules with the +** same name are dropped. +** +** See also: [sqlite3_drop_modules()] +*/ +SQLITE_API int sqlite3_create_module( + sqlite3 *db, /* SQLite connection to register module with */ + const char *zName, /* Name of the module */ + const sqlite3_module *p, /* Methods for the module */ + void *pClientData /* Client data for xCreate/xConnect */ +); +SQLITE_API int sqlite3_create_module_v2( + sqlite3 *db, /* SQLite connection to register module with */ + const char *zName, /* Name of the module */ + const sqlite3_module *p, /* Methods for the module */ + void *pClientData, /* Client data for xCreate/xConnect */ + void(*xDestroy)(void*) /* Module destructor function */ +); + +/* +** CAPI3REF: Remove Unnecessary Virtual Table Implementations +** METHOD: sqlite3 +** +** ^The sqlite3_drop_modules(D,L) interface removes all virtual +** table modules from database connection D except those named on list L. +** The L parameter must be either NULL or a pointer to an array of pointers +** to strings where the array is terminated by a single NULL pointer. +** ^If the L parameter is NULL, then all virtual table modules are removed. +** +** See also: [sqlite3_create_module()] +*/ +SQLITE_API int sqlite3_drop_modules( + sqlite3 *db, /* Remove modules from this connection */ + const char **azKeep /* Except, do not remove the ones named here */ +); + +/* +** CAPI3REF: Virtual Table Instance Object +** KEYWORDS: sqlite3_vtab +** +** Every [virtual table module] implementation uses a subclass +** of this object to describe a particular instance +** of the [virtual table]. Each subclass will +** be tailored to the specific needs of the module implementation. +** The purpose of this superclass is to define certain fields that are +** common to all module implementations. +** +** ^Virtual tables methods can set an error message by assigning a +** string obtained from [sqlite3_mprintf()] to zErrMsg. The method should +** take care that any prior string is freed by a call to [sqlite3_free()] +** prior to assigning a new string to zErrMsg. ^After the error message +** is delivered up to the client application, the string will be automatically +** freed by sqlite3_free() and the zErrMsg field will be zeroed. +*/ +struct sqlite3_vtab { + const sqlite3_module *pModule; /* The module for this virtual table */ + int nRef; /* Number of open cursors */ + char *zErrMsg; /* Error message from sqlite3_mprintf() */ + /* Virtual table implementations will typically add additional fields */ +}; + +/* +** CAPI3REF: Virtual Table Cursor Object +** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} +** +** Every [virtual table module] implementation uses a subclass of the +** following structure to describe cursors that point into the +** [virtual table] and are used +** to loop through the virtual table. Cursors are created using the +** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed +** by the [sqlite3_module.xClose | xClose] method. Cursors are used +** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods +** of the module. Each module implementation will define +** the content of a cursor structure to suit its own needs. +** +** This superclass exists in order to define fields of the cursor that +** are common to all implementations. +*/ +struct sqlite3_vtab_cursor { + sqlite3_vtab *pVtab; /* Virtual table of this cursor */ + /* Virtual table implementations will typically add additional fields */ +}; + +/* +** CAPI3REF: Declare The Schema Of A Virtual Table +** +** ^The [xCreate] and [xConnect] methods of a +** [virtual table module] call this interface +** to declare the format (the names and datatypes of the columns) of +** the virtual tables they implement. +*/ +SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL); + +/* +** CAPI3REF: Overload A Function For A Virtual Table +** METHOD: sqlite3 +** +** ^(Virtual tables can provide alternative implementations of functions +** using the [xFindFunction] method of the [virtual table module]. +** But global versions of those functions +** must exist in order to be overloaded.)^ +** +** ^(This API makes sure a global version of a function with a particular +** name and number of parameters exists. If no such function exists +** before this API is called, a new function is created.)^ ^The implementation +** of the new function always causes an exception to be thrown. So +** the new function is not good for anything by itself. Its only +** purpose is to be a placeholder function that can be overloaded +** by a [virtual table]. +*/ +SQLITE_API int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); + +/* +** The interface to the virtual-table mechanism defined above (back up +** to a comment remarkably similar to this one) is currently considered +** to be experimental. The interface might change in incompatible ways. +** If this is a problem for you, do not use the interface at this time. +** +** When the virtual-table mechanism stabilizes, we will declare the +** interface fixed, support it indefinitely, and remove this comment. +*/ + +/* +** CAPI3REF: A Handle To An Open BLOB +** KEYWORDS: {BLOB handle} {BLOB handles} +** +** An instance of this object represents an open BLOB on which +** [sqlite3_blob_open | incremental BLOB I/O] can be performed. +** ^Objects of this type are created by [sqlite3_blob_open()] +** and destroyed by [sqlite3_blob_close()]. +** ^The [sqlite3_blob_read()] and [sqlite3_blob_write()] interfaces +** can be used to read or write small subsections of the BLOB. +** ^The [sqlite3_blob_bytes()] interface returns the size of the BLOB in bytes. +*/ +typedef struct sqlite3_blob sqlite3_blob; + +/* +** CAPI3REF: Open A BLOB For Incremental I/O +** METHOD: sqlite3 +** CONSTRUCTOR: sqlite3_blob +** +** ^(This interfaces opens a [BLOB handle | handle] to the BLOB located +** in row iRow, column zColumn, table zTable in database zDb; +** in other words, the same BLOB that would be selected by: +** +**
+**     SELECT zColumn FROM zDb.zTable WHERE [rowid] = iRow;
+** 
)^ +** +** ^(Parameter zDb is not the filename that contains the database, but +** rather the symbolic name of the database. For attached databases, this is +** the name that appears after the AS keyword in the [ATTACH] statement. +** For the main database file, the database name is "main". For TEMP +** tables, the database name is "temp".)^ +** +** ^If the flags parameter is non-zero, then the BLOB is opened for read +** and write access. ^If the flags parameter is zero, the BLOB is opened for +** read-only access. +** +** ^(On success, [SQLITE_OK] is returned and the new [BLOB handle] is stored +** in *ppBlob. Otherwise an [error code] is returned and, unless the error +** code is SQLITE_MISUSE, *ppBlob is set to NULL.)^ ^This means that, provided +** the API is not misused, it is always safe to call [sqlite3_blob_close()] +** on *ppBlob after this function it returns. +** +** This function fails with SQLITE_ERROR if any of the following are true: +**
    +**
  • ^(Database zDb does not exist)^, +**
  • ^(Table zTable does not exist within database zDb)^, +**
  • ^(Table zTable is a WITHOUT ROWID table)^, +**
  • ^(Column zColumn does not exist)^, +**
  • ^(Row iRow is not present in the table)^, +**
  • ^(The specified column of row iRow contains a value that is not +** a TEXT or BLOB value)^, +**
  • ^(Column zColumn is part of an index, PRIMARY KEY or UNIQUE +** constraint and the blob is being opened for read/write access)^, +**
  • ^([foreign key constraints | Foreign key constraints] are enabled, +** column zColumn is part of a [child key] definition and the blob is +** being opened for read/write access)^. +**
+** +** ^Unless it returns SQLITE_MISUSE, this function sets the +** [database connection] error code and message accessible via +** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. +** +** A BLOB referenced by sqlite3_blob_open() may be read using the +** [sqlite3_blob_read()] interface and modified by using +** [sqlite3_blob_write()]. The [BLOB handle] can be moved to a +** different row of the same table using the [sqlite3_blob_reopen()] +** interface. However, the column, table, or database of a [BLOB handle] +** cannot be changed after the [BLOB handle] is opened. +** +** ^(If the row that a BLOB handle points to is modified by an +** [UPDATE], [DELETE], or by [ON CONFLICT] side-effects +** then the BLOB handle is marked as "expired". +** This is true if any column of the row is changed, even a column +** other than the one the BLOB handle is open on.)^ +** ^Calls to [sqlite3_blob_read()] and [sqlite3_blob_write()] for +** an expired BLOB handle fail with a return code of [SQLITE_ABORT]. +** ^(Changes written into a BLOB prior to the BLOB expiring are not +** rolled back by the expiration of the BLOB. Such changes will eventually +** commit if the transaction continues to completion.)^ +** +** ^Use the [sqlite3_blob_bytes()] interface to determine the size of +** the opened blob. ^The size of a blob may not be changed by this +** interface. Use the [UPDATE] SQL command to change the size of a +** blob. +** +** ^The [sqlite3_bind_zeroblob()] and [sqlite3_result_zeroblob()] interfaces +** and the built-in [zeroblob] SQL function may be used to create a +** zero-filled blob to read or write using the incremental-blob interface. +** +** To avoid a resource leak, every open [BLOB handle] should eventually +** be released by a call to [sqlite3_blob_close()]. +** +** See also: [sqlite3_blob_close()], +** [sqlite3_blob_reopen()], [sqlite3_blob_read()], +** [sqlite3_blob_bytes()], [sqlite3_blob_write()]. +*/ +SQLITE_API int sqlite3_blob_open( + sqlite3*, + const char *zDb, + const char *zTable, + const char *zColumn, + sqlite3_int64 iRow, + int flags, + sqlite3_blob **ppBlob +); + +/* +** CAPI3REF: Move a BLOB Handle to a New Row +** METHOD: sqlite3_blob +** +** ^This function is used to move an existing [BLOB handle] so that it points +** to a different row of the same database table. ^The new row is identified +** by the rowid value passed as the second argument. Only the row can be +** changed. ^The database, table and column on which the blob handle is open +** remain the same. Moving an existing [BLOB handle] to a new row is +** faster than closing the existing handle and opening a new one. +** +** ^(The new row must meet the same criteria as for [sqlite3_blob_open()] - +** it must exist and there must be either a blob or text value stored in +** the nominated column.)^ ^If the new row is not present in the table, or if +** it does not contain a blob or text value, or if another error occurs, an +** SQLite error code is returned and the blob handle is considered aborted. +** ^All subsequent calls to [sqlite3_blob_read()], [sqlite3_blob_write()] or +** [sqlite3_blob_reopen()] on an aborted blob handle immediately return +** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle +** always returns zero. +** +** ^This function sets the database handle error code and message. +*/ +SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64); + +/* +** CAPI3REF: Close A BLOB Handle +** DESTRUCTOR: sqlite3_blob +** +** ^This function closes an open [BLOB handle]. ^(The BLOB handle is closed +** unconditionally. Even if this routine returns an error code, the +** handle is still closed.)^ +** +** ^If the blob handle being closed was opened for read-write access, and if +** the database is in auto-commit mode and there are no other open read-write +** blob handles or active write statements, the current transaction is +** committed. ^If an error occurs while committing the transaction, an error +** code is returned and the transaction rolled back. +** +** Calling this function with an argument that is not a NULL pointer or an +** open blob handle results in undefined behaviour. ^Calling this routine +** with a null pointer (such as would be returned by a failed call to +** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function +** is passed a valid open blob handle, the values returned by the +** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning. +*/ +SQLITE_API int sqlite3_blob_close(sqlite3_blob *); + +/* +** CAPI3REF: Return The Size Of An Open BLOB +** METHOD: sqlite3_blob +** +** ^Returns the size in bytes of the BLOB accessible via the +** successfully opened [BLOB handle] in its only argument. ^The +** incremental blob I/O routines can only read or overwriting existing +** blob content; they cannot change the size of a blob. +** +** This routine only works on a [BLOB handle] which has been created +** by a prior successful call to [sqlite3_blob_open()] and which has not +** been closed by [sqlite3_blob_close()]. Passing any other pointer in +** to this routine results in undefined and probably undesirable behavior. +*/ +SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *); + +/* +** CAPI3REF: Read Data From A BLOB Incrementally +** METHOD: sqlite3_blob +** +** ^(This function is used to read data from an open [BLOB handle] into a +** caller-supplied buffer. N bytes of data are copied into buffer Z +** from the open BLOB, starting at offset iOffset.)^ +** +** ^If offset iOffset is less than N bytes from the end of the BLOB, +** [SQLITE_ERROR] is returned and no data is read. ^If N or iOffset is +** less than zero, [SQLITE_ERROR] is returned and no data is read. +** ^The size of the blob (and hence the maximum value of N+iOffset) +** can be determined using the [sqlite3_blob_bytes()] interface. +** +** ^An attempt to read from an expired [BLOB handle] fails with an +** error code of [SQLITE_ABORT]. +** +** ^(On success, sqlite3_blob_read() returns SQLITE_OK. +** Otherwise, an [error code] or an [extended error code] is returned.)^ +** +** This routine only works on a [BLOB handle] which has been created +** by a prior successful call to [sqlite3_blob_open()] and which has not +** been closed by [sqlite3_blob_close()]. Passing any other pointer in +** to this routine results in undefined and probably undesirable behavior. +** +** See also: [sqlite3_blob_write()]. +*/ +SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); + +/* +** CAPI3REF: Write Data Into A BLOB Incrementally +** METHOD: sqlite3_blob +** +** ^(This function is used to write data into an open [BLOB handle] from a +** caller-supplied buffer. N bytes of data are copied from the buffer Z +** into the open BLOB, starting at offset iOffset.)^ +** +** ^(On success, sqlite3_blob_write() returns SQLITE_OK. +** Otherwise, an [error code] or an [extended error code] is returned.)^ +** ^Unless SQLITE_MISUSE is returned, this function sets the +** [database connection] error code and message accessible via +** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. +** +** ^If the [BLOB handle] passed as the first argument was not opened for +** writing (the flags parameter to [sqlite3_blob_open()] was zero), +** this function returns [SQLITE_READONLY]. +** +** This function may only modify the contents of the BLOB; it is +** not possible to increase the size of a BLOB using this API. +** ^If offset iOffset is less than N bytes from the end of the BLOB, +** [SQLITE_ERROR] is returned and no data is written. The size of the +** BLOB (and hence the maximum value of N+iOffset) can be determined +** using the [sqlite3_blob_bytes()] interface. ^If N or iOffset are less +** than zero [SQLITE_ERROR] is returned and no data is written. +** +** ^An attempt to write to an expired [BLOB handle] fails with an +** error code of [SQLITE_ABORT]. ^Writes to the BLOB that occurred +** before the [BLOB handle] expired are not rolled back by the +** expiration of the handle, though of course those changes might +** have been overwritten by the statement that expired the BLOB handle +** or by other independent statements. +** +** This routine only works on a [BLOB handle] which has been created +** by a prior successful call to [sqlite3_blob_open()] and which has not +** been closed by [sqlite3_blob_close()]. Passing any other pointer in +** to this routine results in undefined and probably undesirable behavior. +** +** See also: [sqlite3_blob_read()]. +*/ +SQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset); + +/* +** CAPI3REF: Virtual File System Objects +** +** A virtual filesystem (VFS) is an [sqlite3_vfs] object +** that SQLite uses to interact +** with the underlying operating system. Most SQLite builds come with a +** single default VFS that is appropriate for the host computer. +** New VFSes can be registered and existing VFSes can be unregistered. +** The following interfaces are provided. +** +** ^The sqlite3_vfs_find() interface returns a pointer to a VFS given its name. +** ^Names are case sensitive. +** ^Names are zero-terminated UTF-8 strings. +** ^If there is no match, a NULL pointer is returned. +** ^If zVfsName is NULL then the default VFS is returned. +** +** ^New VFSes are registered with sqlite3_vfs_register(). +** ^Each new VFS becomes the default VFS if the makeDflt flag is set. +** ^The same VFS can be registered multiple times without injury. +** ^To make an existing VFS into the default VFS, register it again +** with the makeDflt flag set. If two different VFSes with the +** same name are registered, the behavior is undefined. If a +** VFS is registered with a name that is NULL or an empty string, +** then the behavior is undefined. +** +** ^Unregister a VFS with the sqlite3_vfs_unregister() interface. +** ^(If the default VFS is unregistered, another VFS is chosen as +** the default. The choice for the new VFS is arbitrary.)^ +*/ +SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfsName); +SQLITE_API int sqlite3_vfs_register(sqlite3_vfs*, int makeDflt); +SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); + +/* +** CAPI3REF: Mutexes +** +** The SQLite core uses these routines for thread +** synchronization. Though they are intended for internal +** use by SQLite, code that links against SQLite is +** permitted to use any of these routines. +** +** The SQLite source code contains multiple implementations +** of these mutex routines. An appropriate implementation +** is selected automatically at compile-time. The following +** implementations are available in the SQLite core: +** +**
    +**
  • SQLITE_MUTEX_PTHREADS +**
  • SQLITE_MUTEX_W32 +**
  • SQLITE_MUTEX_NOOP +**
+** +** The SQLITE_MUTEX_NOOP implementation is a set of routines +** that does no real locking and is appropriate for use in +** a single-threaded application. The SQLITE_MUTEX_PTHREADS and +** SQLITE_MUTEX_W32 implementations are appropriate for use on Unix +** and Windows. +** +** If SQLite is compiled with the SQLITE_MUTEX_APPDEF preprocessor +** macro defined (with "-DSQLITE_MUTEX_APPDEF=1"), then no mutex +** implementation is included with the library. In this case the +** application must supply a custom mutex implementation using the +** [SQLITE_CONFIG_MUTEX] option of the sqlite3_config() function +** before calling sqlite3_initialize() or any other public sqlite3_ +** function that calls sqlite3_initialize(). +** +** ^The sqlite3_mutex_alloc() routine allocates a new +** mutex and returns a pointer to it. ^The sqlite3_mutex_alloc() +** routine returns NULL if it is unable to allocate the requested +** mutex. The argument to sqlite3_mutex_alloc() must one of these +** integer constants: +** +**
    +**
  • SQLITE_MUTEX_FAST +**
  • SQLITE_MUTEX_RECURSIVE +**
  • SQLITE_MUTEX_STATIC_MASTER +**
  • SQLITE_MUTEX_STATIC_MEM +**
  • SQLITE_MUTEX_STATIC_OPEN +**
  • SQLITE_MUTEX_STATIC_PRNG +**
  • SQLITE_MUTEX_STATIC_LRU +**
  • SQLITE_MUTEX_STATIC_PMEM +**
  • SQLITE_MUTEX_STATIC_APP1 +**
  • SQLITE_MUTEX_STATIC_APP2 +**
  • SQLITE_MUTEX_STATIC_APP3 +**
  • SQLITE_MUTEX_STATIC_VFS1 +**
  • SQLITE_MUTEX_STATIC_VFS2 +**
  • SQLITE_MUTEX_STATIC_VFS3 +**
+** +** ^The first two constants (SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE) +** cause sqlite3_mutex_alloc() to create +** a new mutex. ^The new mutex is recursive when SQLITE_MUTEX_RECURSIVE +** is used but not necessarily so when SQLITE_MUTEX_FAST is used. +** The mutex implementation does not need to make a distinction +** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does +** not want to. SQLite will only request a recursive mutex in +** cases where it really needs one. If a faster non-recursive mutex +** implementation is available on the host platform, the mutex subsystem +** might return such a mutex in response to SQLITE_MUTEX_FAST. +** +** ^The other allowed parameters to sqlite3_mutex_alloc() (anything other +** than SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE) each return +** a pointer to a static preexisting mutex. ^Nine static mutexes are +** used by the current version of SQLite. Future versions of SQLite +** may add additional static mutexes. Static mutexes are for internal +** use by SQLite only. Applications that use SQLite mutexes should +** use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or +** SQLITE_MUTEX_RECURSIVE. +** +** ^Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST +** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() +** returns a different mutex on every call. ^For the static +** mutex types, the same mutex is returned on every call that has +** the same type number. +** +** ^The sqlite3_mutex_free() routine deallocates a previously +** allocated dynamic mutex. Attempting to deallocate a static +** mutex results in undefined behavior. +** +** ^The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt +** to enter a mutex. ^If another thread is already within the mutex, +** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return +** SQLITE_BUSY. ^The sqlite3_mutex_try() interface returns [SQLITE_OK] +** upon successful entry. ^(Mutexes created using +** SQLITE_MUTEX_RECURSIVE can be entered multiple times by the same thread. +** In such cases, the +** mutex must be exited an equal number of times before another thread +** can enter.)^ If the same thread tries to enter any mutex other +** than an SQLITE_MUTEX_RECURSIVE more than once, the behavior is undefined. +** +** ^(Some systems (for example, Windows 95) do not support the operation +** implemented by sqlite3_mutex_try(). On those systems, sqlite3_mutex_try() +** will always return SQLITE_BUSY. The SQLite core only ever uses +** sqlite3_mutex_try() as an optimization so this is acceptable +** behavior.)^ +** +** ^The sqlite3_mutex_leave() routine exits a mutex that was +** previously entered by the same thread. The behavior +** is undefined if the mutex is not currently entered by the +** calling thread or is not currently allocated. +** +** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or +** sqlite3_mutex_leave() is a NULL pointer, then all three routines +** behave as no-ops. +** +** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. +*/ +SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); +SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); +SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); +SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); +SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*); + +/* +** CAPI3REF: Mutex Methods Object +** +** An instance of this structure defines the low-level routines +** used to allocate and use mutexes. +** +** Usually, the default mutex implementations provided by SQLite are +** sufficient, however the application has the option of substituting a custom +** implementation for specialized deployments or systems for which SQLite +** does not provide a suitable implementation. In this case, the application +** creates and populates an instance of this structure to pass +** to sqlite3_config() along with the [SQLITE_CONFIG_MUTEX] option. +** Additionally, an instance of this structure can be used as an +** output variable when querying the system for the current mutex +** implementation, using the [SQLITE_CONFIG_GETMUTEX] option. +** +** ^The xMutexInit method defined by this structure is invoked as +** part of system initialization by the sqlite3_initialize() function. +** ^The xMutexInit routine is called by SQLite exactly once for each +** effective call to [sqlite3_initialize()]. +** +** ^The xMutexEnd method defined by this structure is invoked as +** part of system shutdown by the sqlite3_shutdown() function. The +** implementation of this method is expected to release all outstanding +** resources obtained by the mutex methods implementation, especially +** those obtained by the xMutexInit method. ^The xMutexEnd() +** interface is invoked exactly once for each call to [sqlite3_shutdown()]. +** +** ^(The remaining seven methods defined by this structure (xMutexAlloc, +** xMutexFree, xMutexEnter, xMutexTry, xMutexLeave, xMutexHeld and +** xMutexNotheld) implement the following interfaces (respectively): +** +**
    +**
  • [sqlite3_mutex_alloc()]
  • +**
  • [sqlite3_mutex_free()]
  • +**
  • [sqlite3_mutex_enter()]
  • +**
  • [sqlite3_mutex_try()]
  • +**
  • [sqlite3_mutex_leave()]
  • +**
  • [sqlite3_mutex_held()]
  • +**
  • [sqlite3_mutex_notheld()]
  • +**
)^ +** +** The only difference is that the public sqlite3_XXX functions enumerated +** above silently ignore any invocations that pass a NULL pointer instead +** of a valid mutex handle. The implementations of the methods defined +** by this structure are not required to handle this case. The results +** of passing a NULL pointer instead of a valid mutex handle are undefined +** (i.e. it is acceptable to provide an implementation that segfaults if +** it is passed a NULL pointer). +** +** The xMutexInit() method must be threadsafe. It must be harmless to +** invoke xMutexInit() multiple times within the same process and without +** intervening calls to xMutexEnd(). Second and subsequent calls to +** xMutexInit() must be no-ops. +** +** xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()] +** and its associates). Similarly, xMutexAlloc() must not use SQLite memory +** allocation for a static mutex. ^However xMutexAlloc() may use SQLite +** memory allocation for a fast or recursive mutex. +** +** ^SQLite will invoke the xMutexEnd() method when [sqlite3_shutdown()] is +** called, but only if the prior call to xMutexInit returned SQLITE_OK. +** If xMutexInit fails in any way, it is expected to clean up after itself +** prior to returning. +*/ +typedef struct sqlite3_mutex_methods sqlite3_mutex_methods; +struct sqlite3_mutex_methods { + int (*xMutexInit)(void); + int (*xMutexEnd)(void); + sqlite3_mutex *(*xMutexAlloc)(int); + void (*xMutexFree)(sqlite3_mutex *); + void (*xMutexEnter)(sqlite3_mutex *); + int (*xMutexTry)(sqlite3_mutex *); + void (*xMutexLeave)(sqlite3_mutex *); + int (*xMutexHeld)(sqlite3_mutex *); + int (*xMutexNotheld)(sqlite3_mutex *); +}; + +/* +** CAPI3REF: Mutex Verification Routines +** +** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routines +** are intended for use inside assert() statements. The SQLite core +** never uses these routines except inside an assert() and applications +** are advised to follow the lead of the core. The SQLite core only +** provides implementations for these routines when it is compiled +** with the SQLITE_DEBUG flag. External mutex implementations +** are only required to provide these routines if SQLITE_DEBUG is +** defined and if NDEBUG is not defined. +** +** These routines should return true if the mutex in their argument +** is held or not held, respectively, by the calling thread. +** +** The implementation is not required to provide versions of these +** routines that actually work. If the implementation does not provide working +** versions of these routines, it should at least provide stubs that always +** return true so that one does not get spurious assertion failures. +** +** If the argument to sqlite3_mutex_held() is a NULL pointer then +** the routine should return 1. This seems counter-intuitive since +** clearly the mutex cannot be held if it does not exist. But +** the reason the mutex does not exist is because the build is not +** using mutexes. And we do not want the assert() containing the +** call to sqlite3_mutex_held() to fail, so a non-zero return is +** the appropriate thing to do. The sqlite3_mutex_notheld() +** interface should also return 1 when given a NULL pointer. +*/ +#ifndef NDEBUG +SQLITE_API int sqlite3_mutex_held(sqlite3_mutex*); +SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*); +#endif + +/* +** CAPI3REF: Mutex Types +** +** The [sqlite3_mutex_alloc()] interface takes a single argument +** which is one of these integer constants. +** +** The set of static mutexes may change from one SQLite release to the +** next. Applications that override the built-in mutex logic must be +** prepared to accommodate additional static mutexes. +*/ +#define SQLITE_MUTEX_FAST 0 +#define SQLITE_MUTEX_RECURSIVE 1 +#define SQLITE_MUTEX_STATIC_MASTER 2 +#define SQLITE_MUTEX_STATIC_MEM 3 /* sqlite3_malloc() */ +#define SQLITE_MUTEX_STATIC_MEM2 4 /* NOT USED */ +#define SQLITE_MUTEX_STATIC_OPEN 4 /* sqlite3BtreeOpen() */ +#define SQLITE_MUTEX_STATIC_PRNG 5 /* sqlite3_randomness() */ +#define SQLITE_MUTEX_STATIC_LRU 6 /* lru page list */ +#define SQLITE_MUTEX_STATIC_LRU2 7 /* NOT USED */ +#define SQLITE_MUTEX_STATIC_PMEM 7 /* sqlite3PageMalloc() */ +#define SQLITE_MUTEX_STATIC_APP1 8 /* For use by application */ +#define SQLITE_MUTEX_STATIC_APP2 9 /* For use by application */ +#define SQLITE_MUTEX_STATIC_APP3 10 /* For use by application */ +#define SQLITE_MUTEX_STATIC_VFS1 11 /* For use by built-in VFS */ +#define SQLITE_MUTEX_STATIC_VFS2 12 /* For use by extension VFS */ +#define SQLITE_MUTEX_STATIC_VFS3 13 /* For use by application VFS */ + +/* +** CAPI3REF: Retrieve the mutex for a database connection +** METHOD: sqlite3 +** +** ^This interface returns a pointer the [sqlite3_mutex] object that +** serializes access to the [database connection] given in the argument +** when the [threading mode] is Serialized. +** ^If the [threading mode] is Single-thread or Multi-thread then this +** routine returns a NULL pointer. +*/ +SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3*); + +/* +** CAPI3REF: Low-Level Control Of Database Files +** METHOD: sqlite3 +** KEYWORDS: {file control} +** +** ^The [sqlite3_file_control()] interface makes a direct call to the +** xFileControl method for the [sqlite3_io_methods] object associated +** with a particular database identified by the second argument. ^The +** name of the database is "main" for the main database or "temp" for the +** TEMP database, or the name that appears after the AS keyword for +** databases that are added using the [ATTACH] SQL command. +** ^A NULL pointer can be used in place of "main" to refer to the +** main database file. +** ^The third and fourth parameters to this routine +** are passed directly through to the second and third parameters of +** the xFileControl method. ^The return value of the xFileControl +** method becomes the return value of this routine. +** +** A few opcodes for [sqlite3_file_control()] are handled directly +** by the SQLite core and never invoke the +** sqlite3_io_methods.xFileControl method. +** ^The [SQLITE_FCNTL_FILE_POINTER] value for the op parameter causes +** a pointer to the underlying [sqlite3_file] object to be written into +** the space pointed to by the 4th parameter. The +** [SQLITE_FCNTL_JOURNAL_POINTER] works similarly except that it returns +** the [sqlite3_file] object associated with the journal file instead of +** the main database. The [SQLITE_FCNTL_VFS_POINTER] opcode returns +** a pointer to the underlying [sqlite3_vfs] object for the file. +** The [SQLITE_FCNTL_DATA_VERSION] returns the data version counter +** from the pager. +** +** ^If the second parameter (zDbName) does not match the name of any +** open database file, then SQLITE_ERROR is returned. ^This error +** code is not remembered and will not be recalled by [sqlite3_errcode()] +** or [sqlite3_errmsg()]. The underlying xFileControl method might +** also return SQLITE_ERROR. There is no way to distinguish between +** an incorrect zDbName and an SQLITE_ERROR return from the underlying +** xFileControl method. +** +** See also: [file control opcodes] +*/ +SQLITE_API int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*); + +/* +** CAPI3REF: Testing Interface +** +** ^The sqlite3_test_control() interface is used to read out internal +** state of SQLite and to inject faults into SQLite for testing +** purposes. ^The first parameter is an operation code that determines +** the number, meaning, and operation of all subsequent parameters. +** +** This interface is not for use by applications. It exists solely +** for verifying the correct operation of the SQLite library. Depending +** on how the SQLite library is compiled, this interface might not exist. +** +** The details of the operation codes, their meanings, the parameters +** they take, and what they do are all subject to change without notice. +** Unlike most of the SQLite API, this function is not guaranteed to +** operate consistently from one release to the next. +*/ +SQLITE_API int sqlite3_test_control(int op, ...); + +/* +** CAPI3REF: Testing Interface Operation Codes +** +** These constants are the valid operation code parameters used +** as the first argument to [sqlite3_test_control()]. +** +** These parameters and their meanings are subject to change +** without notice. These values are for testing purposes only. +** Applications should not use any of these parameters or the +** [sqlite3_test_control()] interface. +*/ +#define SQLITE_TESTCTRL_FIRST 5 +#define SQLITE_TESTCTRL_PRNG_SAVE 5 +#define SQLITE_TESTCTRL_PRNG_RESTORE 6 +#define SQLITE_TESTCTRL_PRNG_RESET 7 /* NOT USED */ +#define SQLITE_TESTCTRL_BITVEC_TEST 8 +#define SQLITE_TESTCTRL_FAULT_INSTALL 9 +#define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS 10 +#define SQLITE_TESTCTRL_PENDING_BYTE 11 +#define SQLITE_TESTCTRL_ASSERT 12 +#define SQLITE_TESTCTRL_ALWAYS 13 +#define SQLITE_TESTCTRL_RESERVE 14 /* NOT USED */ +#define SQLITE_TESTCTRL_OPTIMIZATIONS 15 +#define SQLITE_TESTCTRL_ISKEYWORD 16 /* NOT USED */ +#define SQLITE_TESTCTRL_SCRATCHMALLOC 17 /* NOT USED */ +#define SQLITE_TESTCTRL_INTERNAL_FUNCTIONS 17 +#define SQLITE_TESTCTRL_LOCALTIME_FAULT 18 +#define SQLITE_TESTCTRL_EXPLAIN_STMT 19 /* NOT USED */ +#define SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD 19 +#define SQLITE_TESTCTRL_NEVER_CORRUPT 20 +#define SQLITE_TESTCTRL_VDBE_COVERAGE 21 +#define SQLITE_TESTCTRL_BYTEORDER 22 +#define SQLITE_TESTCTRL_ISINIT 23 +#define SQLITE_TESTCTRL_SORTER_MMAP 24 +#define SQLITE_TESTCTRL_IMPOSTER 25 +#define SQLITE_TESTCTRL_PARSER_COVERAGE 26 +#define SQLITE_TESTCTRL_RESULT_INTREAL 27 +#define SQLITE_TESTCTRL_PRNG_SEED 28 +#define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29 +#define SQLITE_TESTCTRL_LAST 29 /* Largest TESTCTRL */ + +/* +** CAPI3REF: SQL Keyword Checking +** +** These routines provide access to the set of SQL language keywords +** recognized by SQLite. Applications can uses these routines to determine +** whether or not a specific identifier needs to be escaped (for example, +** by enclosing in double-quotes) so as not to confuse the parser. +** +** The sqlite3_keyword_count() interface returns the number of distinct +** keywords understood by SQLite. +** +** The sqlite3_keyword_name(N,Z,L) interface finds the N-th keyword and +** makes *Z point to that keyword expressed as UTF8 and writes the number +** of bytes in the keyword into *L. The string that *Z points to is not +** zero-terminated. The sqlite3_keyword_name(N,Z,L) routine returns +** SQLITE_OK if N is within bounds and SQLITE_ERROR if not. If either Z +** or L are NULL or invalid pointers then calls to +** sqlite3_keyword_name(N,Z,L) result in undefined behavior. +** +** The sqlite3_keyword_check(Z,L) interface checks to see whether or not +** the L-byte UTF8 identifier that Z points to is a keyword, returning non-zero +** if it is and zero if not. +** +** The parser used by SQLite is forgiving. It is often possible to use +** a keyword as an identifier as long as such use does not result in a +** parsing ambiguity. For example, the statement +** "CREATE TABLE BEGIN(REPLACE,PRAGMA,END);" is accepted by SQLite, and +** creates a new table named "BEGIN" with three columns named +** "REPLACE", "PRAGMA", and "END". Nevertheless, best practice is to avoid +** using keywords as identifiers. Common techniques used to avoid keyword +** name collisions include: +**
    +**
  • Put all identifier names inside double-quotes. This is the official +** SQL way to escape identifier names. +**
  • Put identifier names inside [...]. This is not standard SQL, +** but it is what SQL Server does and so lots of programmers use this +** technique. +**
  • Begin every identifier with the letter "Z" as no SQL keywords start +** with "Z". +**
  • Include a digit somewhere in every identifier name. +**
+** +** Note that the number of keywords understood by SQLite can depend on +** compile-time options. For example, "VACUUM" is not a keyword if +** SQLite is compiled with the [-DSQLITE_OMIT_VACUUM] option. Also, +** new keywords may be added to future releases of SQLite. +*/ +SQLITE_API int sqlite3_keyword_count(void); +SQLITE_API int sqlite3_keyword_name(int,const char**,int*); +SQLITE_API int sqlite3_keyword_check(const char*,int); + +/* +** CAPI3REF: Dynamic String Object +** KEYWORDS: {dynamic string} +** +** An instance of the sqlite3_str object contains a dynamically-sized +** string under construction. +** +** The lifecycle of an sqlite3_str object is as follows: +**
    +**
  1. ^The sqlite3_str object is created using [sqlite3_str_new()]. +**
  2. ^Text is appended to the sqlite3_str object using various +** methods, such as [sqlite3_str_appendf()]. +**
  3. ^The sqlite3_str object is destroyed and the string it created +** is returned using the [sqlite3_str_finish()] interface. +**
+*/ +typedef struct sqlite3_str sqlite3_str; + +/* +** CAPI3REF: Create A New Dynamic String Object +** CONSTRUCTOR: sqlite3_str +** +** ^The [sqlite3_str_new(D)] interface allocates and initializes +** a new [sqlite3_str] object. To avoid memory leaks, the object returned by +** [sqlite3_str_new()] must be freed by a subsequent call to +** [sqlite3_str_finish(X)]. +** +** ^The [sqlite3_str_new(D)] interface always returns a pointer to a +** valid [sqlite3_str] object, though in the event of an out-of-memory +** error the returned object might be a special singleton that will +** silently reject new text, always return SQLITE_NOMEM from +** [sqlite3_str_errcode()], always return 0 for +** [sqlite3_str_length()], and always return NULL from +** [sqlite3_str_finish(X)]. It is always safe to use the value +** returned by [sqlite3_str_new(D)] as the sqlite3_str parameter +** to any of the other [sqlite3_str] methods. +** +** The D parameter to [sqlite3_str_new(D)] may be NULL. If the +** D parameter in [sqlite3_str_new(D)] is not NULL, then the maximum +** length of the string contained in the [sqlite3_str] object will be +** the value set for [sqlite3_limit](D,[SQLITE_LIMIT_LENGTH]) instead +** of [SQLITE_MAX_LENGTH]. +*/ +SQLITE_API sqlite3_str *sqlite3_str_new(sqlite3*); + +/* +** CAPI3REF: Finalize A Dynamic String +** DESTRUCTOR: sqlite3_str +** +** ^The [sqlite3_str_finish(X)] interface destroys the sqlite3_str object X +** and returns a pointer to a memory buffer obtained from [sqlite3_malloc64()] +** that contains the constructed string. The calling application should +** pass the returned value to [sqlite3_free()] to avoid a memory leak. +** ^The [sqlite3_str_finish(X)] interface may return a NULL pointer if any +** errors were encountered during construction of the string. ^The +** [sqlite3_str_finish(X)] interface will also return a NULL pointer if the +** string in [sqlite3_str] object X is zero bytes long. +*/ +SQLITE_API char *sqlite3_str_finish(sqlite3_str*); + +/* +** CAPI3REF: Add Content To A Dynamic String +** METHOD: sqlite3_str +** +** These interfaces add content to an sqlite3_str object previously obtained +** from [sqlite3_str_new()]. +** +** ^The [sqlite3_str_appendf(X,F,...)] and +** [sqlite3_str_vappendf(X,F,V)] interfaces uses the [built-in printf] +** functionality of SQLite to append formatted text onto the end of +** [sqlite3_str] object X. +** +** ^The [sqlite3_str_append(X,S,N)] method appends exactly N bytes from string S +** onto the end of the [sqlite3_str] object X. N must be non-negative. +** S must contain at least N non-zero bytes of content. To append a +** zero-terminated string in its entirety, use the [sqlite3_str_appendall()] +** method instead. +** +** ^The [sqlite3_str_appendall(X,S)] method appends the complete content of +** zero-terminated string S onto the end of [sqlite3_str] object X. +** +** ^The [sqlite3_str_appendchar(X,N,C)] method appends N copies of the +** single-byte character C onto the end of [sqlite3_str] object X. +** ^This method can be used, for example, to add whitespace indentation. +** +** ^The [sqlite3_str_reset(X)] method resets the string under construction +** inside [sqlite3_str] object X back to zero bytes in length. +** +** These methods do not return a result code. ^If an error occurs, that fact +** is recorded in the [sqlite3_str] object and can be recovered by a +** subsequent call to [sqlite3_str_errcode(X)]. +*/ +SQLITE_API void sqlite3_str_appendf(sqlite3_str*, const char *zFormat, ...); +SQLITE_API void sqlite3_str_vappendf(sqlite3_str*, const char *zFormat, va_list); +SQLITE_API void sqlite3_str_append(sqlite3_str*, const char *zIn, int N); +SQLITE_API void sqlite3_str_appendall(sqlite3_str*, const char *zIn); +SQLITE_API void sqlite3_str_appendchar(sqlite3_str*, int N, char C); +SQLITE_API void sqlite3_str_reset(sqlite3_str*); + +/* +** CAPI3REF: Status Of A Dynamic String +** METHOD: sqlite3_str +** +** These interfaces return the current status of an [sqlite3_str] object. +** +** ^If any prior errors have occurred while constructing the dynamic string +** in sqlite3_str X, then the [sqlite3_str_errcode(X)] method will return +** an appropriate error code. ^The [sqlite3_str_errcode(X)] method returns +** [SQLITE_NOMEM] following any out-of-memory error, or +** [SQLITE_TOOBIG] if the size of the dynamic string exceeds +** [SQLITE_MAX_LENGTH], or [SQLITE_OK] if there have been no errors. +** +** ^The [sqlite3_str_length(X)] method returns the current length, in bytes, +** of the dynamic string under construction in [sqlite3_str] object X. +** ^The length returned by [sqlite3_str_length(X)] does not include the +** zero-termination byte. +** +** ^The [sqlite3_str_value(X)] method returns a pointer to the current +** content of the dynamic string under construction in X. The value +** returned by [sqlite3_str_value(X)] is managed by the sqlite3_str object X +** and might be freed or altered by any subsequent method on the same +** [sqlite3_str] object. Applications must not used the pointer returned +** [sqlite3_str_value(X)] after any subsequent method call on the same +** object. ^Applications may change the content of the string returned +** by [sqlite3_str_value(X)] as long as they do not write into any bytes +** outside the range of 0 to [sqlite3_str_length(X)] and do not read or +** write any byte after any subsequent sqlite3_str method call. +*/ +SQLITE_API int sqlite3_str_errcode(sqlite3_str*); +SQLITE_API int sqlite3_str_length(sqlite3_str*); +SQLITE_API char *sqlite3_str_value(sqlite3_str*); + +/* +** CAPI3REF: SQLite Runtime Status +** +** ^These interfaces are used to retrieve runtime status information +** about the performance of SQLite, and optionally to reset various +** highwater marks. ^The first argument is an integer code for +** the specific parameter to measure. ^(Recognized integer codes +** are of the form [status parameters | SQLITE_STATUS_...].)^ +** ^The current value of the parameter is returned into *pCurrent. +** ^The highest recorded value is returned in *pHighwater. ^If the +** resetFlag is true, then the highest record value is reset after +** *pHighwater is written. ^(Some parameters do not record the highest +** value. For those parameters +** nothing is written into *pHighwater and the resetFlag is ignored.)^ +** ^(Other parameters record only the highwater mark and not the current +** value. For these latter parameters nothing is written into *pCurrent.)^ +** +** ^The sqlite3_status() and sqlite3_status64() routines return +** SQLITE_OK on success and a non-zero [error code] on failure. +** +** If either the current value or the highwater mark is too large to +** be represented by a 32-bit integer, then the values returned by +** sqlite3_status() are undefined. +** +** See also: [sqlite3_db_status()] +*/ +SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag); +SQLITE_API int sqlite3_status64( + int op, + sqlite3_int64 *pCurrent, + sqlite3_int64 *pHighwater, + int resetFlag +); + + +/* +** CAPI3REF: Status Parameters +** KEYWORDS: {status parameters} +** +** These integer constants designate various run-time status parameters +** that can be returned by [sqlite3_status()]. +** +**
+** [[SQLITE_STATUS_MEMORY_USED]] ^(
SQLITE_STATUS_MEMORY_USED
+**
This parameter is the current amount of memory checked out +** using [sqlite3_malloc()], either directly or indirectly. The +** figure includes calls made to [sqlite3_malloc()] by the application +** and internal memory usage by the SQLite library. Auxiliary page-cache +** memory controlled by [SQLITE_CONFIG_PAGECACHE] is not included in +** this parameter. The amount returned is the sum of the allocation +** sizes as reported by the xSize method in [sqlite3_mem_methods].
)^ +** +** [[SQLITE_STATUS_MALLOC_SIZE]] ^(
SQLITE_STATUS_MALLOC_SIZE
+**
This parameter records the largest memory allocation request +** handed to [sqlite3_malloc()] or [sqlite3_realloc()] (or their +** internal equivalents). Only the value returned in the +** *pHighwater parameter to [sqlite3_status()] is of interest. +** The value written into the *pCurrent parameter is undefined.
)^ +** +** [[SQLITE_STATUS_MALLOC_COUNT]] ^(
SQLITE_STATUS_MALLOC_COUNT
+**
This parameter records the number of separate memory allocations +** currently checked out.
)^ +** +** [[SQLITE_STATUS_PAGECACHE_USED]] ^(
SQLITE_STATUS_PAGECACHE_USED
+**
This parameter returns the number of pages used out of the +** [pagecache memory allocator] that was configured using +** [SQLITE_CONFIG_PAGECACHE]. The +** value returned is in pages, not in bytes.
)^ +** +** [[SQLITE_STATUS_PAGECACHE_OVERFLOW]] +** ^(
SQLITE_STATUS_PAGECACHE_OVERFLOW
+**
This parameter returns the number of bytes of page cache +** allocation which could not be satisfied by the [SQLITE_CONFIG_PAGECACHE] +** buffer and where forced to overflow to [sqlite3_malloc()]. The +** returned value includes allocations that overflowed because they +** where too large (they were larger than the "sz" parameter to +** [SQLITE_CONFIG_PAGECACHE]) and allocations that overflowed because +** no space was left in the page cache.
)^ +** +** [[SQLITE_STATUS_PAGECACHE_SIZE]] ^(
SQLITE_STATUS_PAGECACHE_SIZE
+**
This parameter records the largest memory allocation request +** handed to the [pagecache memory allocator]. Only the value returned in the +** *pHighwater parameter to [sqlite3_status()] is of interest. +** The value written into the *pCurrent parameter is undefined.
)^ +** +** [[SQLITE_STATUS_SCRATCH_USED]]
SQLITE_STATUS_SCRATCH_USED
+**
No longer used.
+** +** [[SQLITE_STATUS_SCRATCH_OVERFLOW]] ^(
SQLITE_STATUS_SCRATCH_OVERFLOW
+**
No longer used.
+** +** [[SQLITE_STATUS_SCRATCH_SIZE]]
SQLITE_STATUS_SCRATCH_SIZE
+**
No longer used.
+** +** [[SQLITE_STATUS_PARSER_STACK]] ^(
SQLITE_STATUS_PARSER_STACK
+**
The *pHighwater parameter records the deepest parser stack. +** The *pCurrent value is undefined. The *pHighwater value is only +** meaningful if SQLite is compiled with [YYTRACKMAXSTACKDEPTH].
)^ +**
+** +** New status parameters may be added from time to time. +*/ +#define SQLITE_STATUS_MEMORY_USED 0 +#define SQLITE_STATUS_PAGECACHE_USED 1 +#define SQLITE_STATUS_PAGECACHE_OVERFLOW 2 +#define SQLITE_STATUS_SCRATCH_USED 3 /* NOT USED */ +#define SQLITE_STATUS_SCRATCH_OVERFLOW 4 /* NOT USED */ +#define SQLITE_STATUS_MALLOC_SIZE 5 +#define SQLITE_STATUS_PARSER_STACK 6 +#define SQLITE_STATUS_PAGECACHE_SIZE 7 +#define SQLITE_STATUS_SCRATCH_SIZE 8 /* NOT USED */ +#define SQLITE_STATUS_MALLOC_COUNT 9 + +/* +** CAPI3REF: Database Connection Status +** METHOD: sqlite3 +** +** ^This interface is used to retrieve runtime status information +** about a single [database connection]. ^The first argument is the +** database connection object to be interrogated. ^The second argument +** is an integer constant, taken from the set of +** [SQLITE_DBSTATUS options], that +** determines the parameter to interrogate. The set of +** [SQLITE_DBSTATUS options] is likely +** to grow in future releases of SQLite. +** +** ^The current value of the requested parameter is written into *pCur +** and the highest instantaneous value is written into *pHiwtr. ^If +** the resetFlg is true, then the highest instantaneous value is +** reset back down to the current value. +** +** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a +** non-zero [error code] on failure. +** +** See also: [sqlite3_status()] and [sqlite3_stmt_status()]. +*/ +SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); + +/* +** CAPI3REF: Status Parameters for database connections +** KEYWORDS: {SQLITE_DBSTATUS options} +** +** These constants are the available integer "verbs" that can be passed as +** the second argument to the [sqlite3_db_status()] interface. +** +** New verbs may be added in future releases of SQLite. Existing verbs +** might be discontinued. Applications should check the return code from +** [sqlite3_db_status()] to make sure that the call worked. +** The [sqlite3_db_status()] interface will return a non-zero error code +** if a discontinued or unsupported verb is invoked. +** +**
+** [[SQLITE_DBSTATUS_LOOKASIDE_USED]] ^(
SQLITE_DBSTATUS_LOOKASIDE_USED
+**
This parameter returns the number of lookaside memory slots currently +** checked out.
)^ +** +** [[SQLITE_DBSTATUS_LOOKASIDE_HIT]] ^(
SQLITE_DBSTATUS_LOOKASIDE_HIT
+**
This parameter returns the number of malloc attempts that were +** satisfied using lookaside memory. Only the high-water value is meaningful; +** the current value is always zero.)^ +** +** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE]] +** ^(
SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE
+**
This parameter returns the number malloc attempts that might have +** been satisfied using lookaside memory but failed due to the amount of +** memory requested being larger than the lookaside slot size. +** Only the high-water value is meaningful; +** the current value is always zero.)^ +** +** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL]] +** ^(
SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL
+**
This parameter returns the number malloc attempts that might have +** been satisfied using lookaside memory but failed due to all lookaside +** memory already being in use. +** Only the high-water value is meaningful; +** the current value is always zero.)^ +** +** [[SQLITE_DBSTATUS_CACHE_USED]] ^(
SQLITE_DBSTATUS_CACHE_USED
+**
This parameter returns the approximate number of bytes of heap +** memory used by all pager caches associated with the database connection.)^ +** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0. +** +** [[SQLITE_DBSTATUS_CACHE_USED_SHARED]] +** ^(
SQLITE_DBSTATUS_CACHE_USED_SHARED
+**
This parameter is similar to DBSTATUS_CACHE_USED, except that if a +** pager cache is shared between two or more connections the bytes of heap +** memory used by that pager cache is divided evenly between the attached +** connections.)^ In other words, if none of the pager caches associated +** with the database connection are shared, this request returns the same +** value as DBSTATUS_CACHE_USED. Or, if one or more or the pager caches are +** shared, the value returned by this call will be smaller than that returned +** by DBSTATUS_CACHE_USED. ^The highwater mark associated with +** SQLITE_DBSTATUS_CACHE_USED_SHARED is always 0. +** +** [[SQLITE_DBSTATUS_SCHEMA_USED]] ^(
SQLITE_DBSTATUS_SCHEMA_USED
+**
This parameter returns the approximate number of bytes of heap +** memory used to store the schema for all databases associated +** with the connection - main, temp, and any [ATTACH]-ed databases.)^ +** ^The full amount of memory used by the schemas is reported, even if the +** schema memory is shared with other database connections due to +** [shared cache mode] being enabled. +** ^The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED is always 0. +** +** [[SQLITE_DBSTATUS_STMT_USED]] ^(
SQLITE_DBSTATUS_STMT_USED
+**
This parameter returns the approximate number of bytes of heap +** and lookaside memory used by all prepared statements associated with +** the database connection.)^ +** ^The highwater mark associated with SQLITE_DBSTATUS_STMT_USED is always 0. +**
+** +** [[SQLITE_DBSTATUS_CACHE_HIT]] ^(
SQLITE_DBSTATUS_CACHE_HIT
+**
This parameter returns the number of pager cache hits that have +** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT +** is always 0. +**
+** +** [[SQLITE_DBSTATUS_CACHE_MISS]] ^(
SQLITE_DBSTATUS_CACHE_MISS
+**
This parameter returns the number of pager cache misses that have +** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS +** is always 0. +**
+** +** [[SQLITE_DBSTATUS_CACHE_WRITE]] ^(
SQLITE_DBSTATUS_CACHE_WRITE
+**
This parameter returns the number of dirty cache entries that have +** been written to disk. Specifically, the number of pages written to the +** wal file in wal mode databases, or the number of pages written to the +** database file in rollback mode databases. Any pages written as part of +** transaction rollback or database recovery operations are not included. +** If an IO or other error occurs while writing a page to disk, the effect +** on subsequent SQLITE_DBSTATUS_CACHE_WRITE requests is undefined.)^ ^The +** highwater mark associated with SQLITE_DBSTATUS_CACHE_WRITE is always 0. +**
+** +** [[SQLITE_DBSTATUS_CACHE_SPILL]] ^(
SQLITE_DBSTATUS_CACHE_SPILL
+**
This parameter returns the number of dirty cache entries that have +** been written to disk in the middle of a transaction due to the page +** cache overflowing. Transactions are more efficient if they are written +** to disk all at once. When pages spill mid-transaction, that introduces +** additional overhead. This parameter can be used help identify +** inefficiencies that can be resolved by increasing the cache size. +**
+** +** [[SQLITE_DBSTATUS_DEFERRED_FKS]] ^(
SQLITE_DBSTATUS_DEFERRED_FKS
+**
This parameter returns zero for the current value if and only if +** all foreign key constraints (deferred or immediate) have been +** resolved.)^ ^The highwater mark is always 0. +**
+**
+*/ +#define SQLITE_DBSTATUS_LOOKASIDE_USED 0 +#define SQLITE_DBSTATUS_CACHE_USED 1 +#define SQLITE_DBSTATUS_SCHEMA_USED 2 +#define SQLITE_DBSTATUS_STMT_USED 3 +#define SQLITE_DBSTATUS_LOOKASIDE_HIT 4 +#define SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE 5 +#define SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL 6 +#define SQLITE_DBSTATUS_CACHE_HIT 7 +#define SQLITE_DBSTATUS_CACHE_MISS 8 +#define SQLITE_DBSTATUS_CACHE_WRITE 9 +#define SQLITE_DBSTATUS_DEFERRED_FKS 10 +#define SQLITE_DBSTATUS_CACHE_USED_SHARED 11 +#define SQLITE_DBSTATUS_CACHE_SPILL 12 +#define SQLITE_DBSTATUS_MAX 12 /* Largest defined DBSTATUS */ + + +/* +** CAPI3REF: Prepared Statement Status +** METHOD: sqlite3_stmt +** +** ^(Each prepared statement maintains various +** [SQLITE_STMTSTATUS counters] that measure the number +** of times it has performed specific operations.)^ These counters can +** be used to monitor the performance characteristics of the prepared +** statements. For example, if the number of table steps greatly exceeds +** the number of table searches or result rows, that would tend to indicate +** that the prepared statement is using a full table scan rather than +** an index. +** +** ^(This interface is used to retrieve and reset counter values from +** a [prepared statement]. The first argument is the prepared statement +** object to be interrogated. The second argument +** is an integer code for a specific [SQLITE_STMTSTATUS counter] +** to be interrogated.)^ +** ^The current value of the requested counter is returned. +** ^If the resetFlg is true, then the counter is reset to zero after this +** interface call returns. +** +** See also: [sqlite3_status()] and [sqlite3_db_status()]. +*/ +SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); + +/* +** CAPI3REF: Status Parameters for prepared statements +** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters} +** +** These preprocessor macros define integer codes that name counter +** values associated with the [sqlite3_stmt_status()] interface. +** The meanings of the various counters are as follows: +** +**
+** [[SQLITE_STMTSTATUS_FULLSCAN_STEP]]
SQLITE_STMTSTATUS_FULLSCAN_STEP
+**
^This is the number of times that SQLite has stepped forward in +** a table as part of a full table scan. Large numbers for this counter +** may indicate opportunities for performance improvement through +** careful use of indices.
+** +** [[SQLITE_STMTSTATUS_SORT]]
SQLITE_STMTSTATUS_SORT
+**
^This is the number of sort operations that have occurred. +** A non-zero value in this counter may indicate an opportunity to +** improvement performance through careful use of indices.
+** +** [[SQLITE_STMTSTATUS_AUTOINDEX]]
SQLITE_STMTSTATUS_AUTOINDEX
+**
^This is the number of rows inserted into transient indices that +** were created automatically in order to help joins run faster. +** A non-zero value in this counter may indicate an opportunity to +** improvement performance by adding permanent indices that do not +** need to be reinitialized each time the statement is run.
+** +** [[SQLITE_STMTSTATUS_VM_STEP]]
SQLITE_STMTSTATUS_VM_STEP
+**
^This is the number of virtual machine operations executed +** by the prepared statement if that number is less than or equal +** to 2147483647. The number of virtual machine operations can be +** used as a proxy for the total work done by the prepared statement. +** If the number of virtual machine operations exceeds 2147483647 +** then the value returned by this statement status code is undefined. +** +** [[SQLITE_STMTSTATUS_REPREPARE]]
SQLITE_STMTSTATUS_REPREPARE
+**
^This is the number of times that the prepare statement has been +** automatically regenerated due to schema changes or changes to +** [bound parameters] that might affect the query plan. +** +** [[SQLITE_STMTSTATUS_RUN]]
SQLITE_STMTSTATUS_RUN
+**
^This is the number of times that the prepared statement has +** been run. A single "run" for the purposes of this counter is one +** or more calls to [sqlite3_step()] followed by a call to [sqlite3_reset()]. +** The counter is incremented on the first [sqlite3_step()] call of each +** cycle. +** +** [[SQLITE_STMTSTATUS_MEMUSED]]
SQLITE_STMTSTATUS_MEMUSED
+**
^This is the approximate number of bytes of heap memory +** used to store the prepared statement. ^This value is not actually +** a counter, and so the resetFlg parameter to sqlite3_stmt_status() +** is ignored when the opcode is SQLITE_STMTSTATUS_MEMUSED. +**
+**
+*/ +#define SQLITE_STMTSTATUS_FULLSCAN_STEP 1 +#define SQLITE_STMTSTATUS_SORT 2 +#define SQLITE_STMTSTATUS_AUTOINDEX 3 +#define SQLITE_STMTSTATUS_VM_STEP 4 +#define SQLITE_STMTSTATUS_REPREPARE 5 +#define SQLITE_STMTSTATUS_RUN 6 +#define SQLITE_STMTSTATUS_MEMUSED 99 + +/* +** CAPI3REF: Custom Page Cache Object +** +** The sqlite3_pcache type is opaque. It is implemented by +** the pluggable module. The SQLite core has no knowledge of +** its size or internal structure and never deals with the +** sqlite3_pcache object except by holding and passing pointers +** to the object. +** +** See [sqlite3_pcache_methods2] for additional information. +*/ +typedef struct sqlite3_pcache sqlite3_pcache; + +/* +** CAPI3REF: Custom Page Cache Object +** +** The sqlite3_pcache_page object represents a single page in the +** page cache. The page cache will allocate instances of this +** object. Various methods of the page cache use pointers to instances +** of this object as parameters or as their return value. +** +** See [sqlite3_pcache_methods2] for additional information. +*/ +typedef struct sqlite3_pcache_page sqlite3_pcache_page; +struct sqlite3_pcache_page { + void *pBuf; /* The content of the page */ + void *pExtra; /* Extra information associated with the page */ +}; + +/* +** CAPI3REF: Application Defined Page Cache. +** KEYWORDS: {page cache} +** +** ^(The [sqlite3_config]([SQLITE_CONFIG_PCACHE2], ...) interface can +** register an alternative page cache implementation by passing in an +** instance of the sqlite3_pcache_methods2 structure.)^ +** In many applications, most of the heap memory allocated by +** SQLite is used for the page cache. +** By implementing a +** custom page cache using this API, an application can better control +** the amount of memory consumed by SQLite, the way in which +** that memory is allocated and released, and the policies used to +** determine exactly which parts of a database file are cached and for +** how long. +** +** The alternative page cache mechanism is an +** extreme measure that is only needed by the most demanding applications. +** The built-in page cache is recommended for most uses. +** +** ^(The contents of the sqlite3_pcache_methods2 structure are copied to an +** internal buffer by SQLite within the call to [sqlite3_config]. Hence +** the application may discard the parameter after the call to +** [sqlite3_config()] returns.)^ +** +** [[the xInit() page cache method]] +** ^(The xInit() method is called once for each effective +** call to [sqlite3_initialize()])^ +** (usually only once during the lifetime of the process). ^(The xInit() +** method is passed a copy of the sqlite3_pcache_methods2.pArg value.)^ +** The intent of the xInit() method is to set up global data structures +** required by the custom page cache implementation. +** ^(If the xInit() method is NULL, then the +** built-in default page cache is used instead of the application defined +** page cache.)^ +** +** [[the xShutdown() page cache method]] +** ^The xShutdown() method is called by [sqlite3_shutdown()]. +** It can be used to clean up +** any outstanding resources before process shutdown, if required. +** ^The xShutdown() method may be NULL. +** +** ^SQLite automatically serializes calls to the xInit method, +** so the xInit method need not be threadsafe. ^The +** xShutdown method is only called from [sqlite3_shutdown()] so it does +** not need to be threadsafe either. All other methods must be threadsafe +** in multithreaded applications. +** +** ^SQLite will never invoke xInit() more than once without an intervening +** call to xShutdown(). +** +** [[the xCreate() page cache methods]] +** ^SQLite invokes the xCreate() method to construct a new cache instance. +** SQLite will typically create one cache instance for each open database file, +** though this is not guaranteed. ^The +** first parameter, szPage, is the size in bytes of the pages that must +** be allocated by the cache. ^szPage will always a power of two. ^The +** second parameter szExtra is a number of bytes of extra storage +** associated with each page cache entry. ^The szExtra parameter will +** a number less than 250. SQLite will use the +** extra szExtra bytes on each page to store metadata about the underlying +** database page on disk. The value passed into szExtra depends +** on the SQLite version, the target platform, and how SQLite was compiled. +** ^The third argument to xCreate(), bPurgeable, is true if the cache being +** created will be used to cache database pages of a file stored on disk, or +** false if it is used for an in-memory database. The cache implementation +** does not have to do anything special based with the value of bPurgeable; +** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will +** never invoke xUnpin() except to deliberately delete a page. +** ^In other words, calls to xUnpin() on a cache with bPurgeable set to +** false will always have the "discard" flag set to true. +** ^Hence, a cache created with bPurgeable false will +** never contain any unpinned pages. +** +** [[the xCachesize() page cache method]] +** ^(The xCachesize() method may be called at any time by SQLite to set the +** suggested maximum cache-size (number of pages stored by) the cache +** instance passed as the first argument. This is the value configured using +** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable +** parameter, the implementation is not required to do anything with this +** value; it is advisory only. +** +** [[the xPagecount() page cache methods]] +** The xPagecount() method must return the number of pages currently +** stored in the cache, both pinned and unpinned. +** +** [[the xFetch() page cache methods]] +** The xFetch() method locates a page in the cache and returns a pointer to +** an sqlite3_pcache_page object associated with that page, or a NULL pointer. +** The pBuf element of the returned sqlite3_pcache_page object will be a +** pointer to a buffer of szPage bytes used to store the content of a +** single database page. The pExtra element of sqlite3_pcache_page will be +** a pointer to the szExtra bytes of extra storage that SQLite has requested +** for each entry in the page cache. +** +** The page to be fetched is determined by the key. ^The minimum key value +** is 1. After it has been retrieved using xFetch, the page is considered +** to be "pinned". +** +** If the requested page is already in the page cache, then the page cache +** implementation must return a pointer to the page buffer with its content +** intact. If the requested page is not already in the cache, then the +** cache implementation should use the value of the createFlag +** parameter to help it determined what action to take: +** +** +**
createFlag Behavior when page is not already in cache +**
0 Do not allocate a new page. Return NULL. +**
1 Allocate a new page if it easy and convenient to do so. +** Otherwise return NULL. +**
2 Make every effort to allocate a new page. Only return +** NULL if allocating a new page is effectively impossible. +**
+** +** ^(SQLite will normally invoke xFetch() with a createFlag of 0 or 1. SQLite +** will only use a createFlag of 2 after a prior call with a createFlag of 1 +** failed.)^ In between the xFetch() calls, SQLite may +** attempt to unpin one or more cache pages by spilling the content of +** pinned pages to disk and synching the operating system disk cache. +** +** [[the xUnpin() page cache method]] +** ^xUnpin() is called by SQLite with a pointer to a currently pinned page +** as its second argument. If the third parameter, discard, is non-zero, +** then the page must be evicted from the cache. +** ^If the discard parameter is +** zero, then the page may be discarded or retained at the discretion of +** page cache implementation. ^The page cache implementation +** may choose to evict unpinned pages at any time. +** +** The cache must not perform any reference counting. A single +** call to xUnpin() unpins the page regardless of the number of prior calls +** to xFetch(). +** +** [[the xRekey() page cache methods]] +** The xRekey() method is used to change the key value associated with the +** page passed as the second argument. If the cache +** previously contains an entry associated with newKey, it must be +** discarded. ^Any prior cache entry associated with newKey is guaranteed not +** to be pinned. +** +** When SQLite calls the xTruncate() method, the cache must discard all +** existing cache entries with page numbers (keys) greater than or equal +** to the value of the iLimit parameter passed to xTruncate(). If any +** of these pages are pinned, they are implicitly unpinned, meaning that +** they can be safely discarded. +** +** [[the xDestroy() page cache method]] +** ^The xDestroy() method is used to delete a cache allocated by xCreate(). +** All resources associated with the specified cache should be freed. ^After +** calling the xDestroy() method, SQLite considers the [sqlite3_pcache*] +** handle invalid, and will not use it with any other sqlite3_pcache_methods2 +** functions. +** +** [[the xShrink() page cache method]] +** ^SQLite invokes the xShrink() method when it wants the page cache to +** free up as much of heap memory as possible. The page cache implementation +** is not obligated to free any memory, but well-behaved implementations should +** do their best. +*/ +typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2; +struct sqlite3_pcache_methods2 { + int iVersion; + void *pArg; + int (*xInit)(void*); + void (*xShutdown)(void*); + sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable); + void (*xCachesize)(sqlite3_pcache*, int nCachesize); + int (*xPagecount)(sqlite3_pcache*); + sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); + void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard); + void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, + unsigned oldKey, unsigned newKey); + void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); + void (*xDestroy)(sqlite3_pcache*); + void (*xShrink)(sqlite3_pcache*); +}; + +/* +** This is the obsolete pcache_methods object that has now been replaced +** by sqlite3_pcache_methods2. This object is not used by SQLite. It is +** retained in the header file for backwards compatibility only. +*/ +typedef struct sqlite3_pcache_methods sqlite3_pcache_methods; +struct sqlite3_pcache_methods { + void *pArg; + int (*xInit)(void*); + void (*xShutdown)(void*); + sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable); + void (*xCachesize)(sqlite3_pcache*, int nCachesize); + int (*xPagecount)(sqlite3_pcache*); + void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); + void (*xUnpin)(sqlite3_pcache*, void*, int discard); + void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey); + void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); + void (*xDestroy)(sqlite3_pcache*); +}; + + +/* +** CAPI3REF: Online Backup Object +** +** The sqlite3_backup object records state information about an ongoing +** online backup operation. ^The sqlite3_backup object is created by +** a call to [sqlite3_backup_init()] and is destroyed by a call to +** [sqlite3_backup_finish()]. +** +** See Also: [Using the SQLite Online Backup API] +*/ +typedef struct sqlite3_backup sqlite3_backup; + +/* +** CAPI3REF: Online Backup API. +** +** The backup API copies the content of one database into another. +** It is useful either for creating backups of databases or +** for copying in-memory databases to or from persistent files. +** +** See Also: [Using the SQLite Online Backup API] +** +** ^SQLite holds a write transaction open on the destination database file +** for the duration of the backup operation. +** ^The source database is read-locked only while it is being read; +** it is not locked continuously for the entire backup operation. +** ^Thus, the backup may be performed on a live source database without +** preventing other database connections from +** reading or writing to the source database while the backup is underway. +** +** ^(To perform a backup operation: +**
    +**
  1. sqlite3_backup_init() is called once to initialize the +** backup, +**
  2. sqlite3_backup_step() is called one or more times to transfer +** the data between the two databases, and finally +**
  3. sqlite3_backup_finish() is called to release all resources +** associated with the backup operation. +**
)^ +** There should be exactly one call to sqlite3_backup_finish() for each +** successful call to sqlite3_backup_init(). +** +** [[sqlite3_backup_init()]] sqlite3_backup_init() +** +** ^The D and N arguments to sqlite3_backup_init(D,N,S,M) are the +** [database connection] associated with the destination database +** and the database name, respectively. +** ^The database name is "main" for the main database, "temp" for the +** temporary database, or the name specified after the AS keyword in +** an [ATTACH] statement for an attached database. +** ^The S and M arguments passed to +** sqlite3_backup_init(D,N,S,M) identify the [database connection] +** and database name of the source database, respectively. +** ^The source and destination [database connections] (parameters S and D) +** must be different or else sqlite3_backup_init(D,N,S,M) will fail with +** an error. +** +** ^A call to sqlite3_backup_init() will fail, returning NULL, if +** there is already a read or read-write transaction open on the +** destination database. +** +** ^If an error occurs within sqlite3_backup_init(D,N,S,M), then NULL is +** returned and an error code and error message are stored in the +** destination [database connection] D. +** ^The error code and message for the failed call to sqlite3_backup_init() +** can be retrieved using the [sqlite3_errcode()], [sqlite3_errmsg()], and/or +** [sqlite3_errmsg16()] functions. +** ^A successful call to sqlite3_backup_init() returns a pointer to an +** [sqlite3_backup] object. +** ^The [sqlite3_backup] object may be used with the sqlite3_backup_step() and +** sqlite3_backup_finish() functions to perform the specified backup +** operation. +** +** [[sqlite3_backup_step()]] sqlite3_backup_step() +** +** ^Function sqlite3_backup_step(B,N) will copy up to N pages between +** the source and destination databases specified by [sqlite3_backup] object B. +** ^If N is negative, all remaining source pages are copied. +** ^If sqlite3_backup_step(B,N) successfully copies N pages and there +** are still more pages to be copied, then the function returns [SQLITE_OK]. +** ^If sqlite3_backup_step(B,N) successfully finishes copying all pages +** from source to destination, then it returns [SQLITE_DONE]. +** ^If an error occurs while running sqlite3_backup_step(B,N), +** then an [error code] is returned. ^As well as [SQLITE_OK] and +** [SQLITE_DONE], a call to sqlite3_backup_step() may return [SQLITE_READONLY], +** [SQLITE_NOMEM], [SQLITE_BUSY], [SQLITE_LOCKED], or an +** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX] extended error code. +** +** ^(The sqlite3_backup_step() might return [SQLITE_READONLY] if +**
    +**
  1. the destination database was opened read-only, or +**
  2. the destination database is using write-ahead-log journaling +** and the destination and source page sizes differ, or +**
  3. the destination database is an in-memory database and the +** destination and source page sizes differ. +**
)^ +** +** ^If sqlite3_backup_step() cannot obtain a required file-system lock, then +** the [sqlite3_busy_handler | busy-handler function] +** is invoked (if one is specified). ^If the +** busy-handler returns non-zero before the lock is available, then +** [SQLITE_BUSY] is returned to the caller. ^In this case the call to +** sqlite3_backup_step() can be retried later. ^If the source +** [database connection] +** is being used to write to the source database when sqlite3_backup_step() +** is called, then [SQLITE_LOCKED] is returned immediately. ^Again, in this +** case the call to sqlite3_backup_step() can be retried later on. ^(If +** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX], [SQLITE_NOMEM], or +** [SQLITE_READONLY] is returned, then +** there is no point in retrying the call to sqlite3_backup_step(). These +** errors are considered fatal.)^ The application must accept +** that the backup operation has failed and pass the backup operation handle +** to the sqlite3_backup_finish() to release associated resources. +** +** ^The first call to sqlite3_backup_step() obtains an exclusive lock +** on the destination file. ^The exclusive lock is not released until either +** sqlite3_backup_finish() is called or the backup operation is complete +** and sqlite3_backup_step() returns [SQLITE_DONE]. ^Every call to +** sqlite3_backup_step() obtains a [shared lock] on the source database that +** lasts for the duration of the sqlite3_backup_step() call. +** ^Because the source database is not locked between calls to +** sqlite3_backup_step(), the source database may be modified mid-way +** through the backup process. ^If the source database is modified by an +** external process or via a database connection other than the one being +** used by the backup operation, then the backup will be automatically +** restarted by the next call to sqlite3_backup_step(). ^If the source +** database is modified by the using the same database connection as is used +** by the backup operation, then the backup database is automatically +** updated at the same time. +** +** [[sqlite3_backup_finish()]] sqlite3_backup_finish() +** +** When sqlite3_backup_step() has returned [SQLITE_DONE], or when the +** application wishes to abandon the backup operation, the application +** should destroy the [sqlite3_backup] by passing it to sqlite3_backup_finish(). +** ^The sqlite3_backup_finish() interfaces releases all +** resources associated with the [sqlite3_backup] object. +** ^If sqlite3_backup_step() has not yet returned [SQLITE_DONE], then any +** active write-transaction on the destination database is rolled back. +** The [sqlite3_backup] object is invalid +** and may not be used following a call to sqlite3_backup_finish(). +** +** ^The value returned by sqlite3_backup_finish is [SQLITE_OK] if no +** sqlite3_backup_step() errors occurred, regardless or whether or not +** sqlite3_backup_step() completed. +** ^If an out-of-memory condition or IO error occurred during any prior +** sqlite3_backup_step() call on the same [sqlite3_backup] object, then +** sqlite3_backup_finish() returns the corresponding [error code]. +** +** ^A return of [SQLITE_BUSY] or [SQLITE_LOCKED] from sqlite3_backup_step() +** is not a permanent error and does not affect the return value of +** sqlite3_backup_finish(). +** +** [[sqlite3_backup_remaining()]] [[sqlite3_backup_pagecount()]] +** sqlite3_backup_remaining() and sqlite3_backup_pagecount() +** +** ^The sqlite3_backup_remaining() routine returns the number of pages still +** to be backed up at the conclusion of the most recent sqlite3_backup_step(). +** ^The sqlite3_backup_pagecount() routine returns the total number of pages +** in the source database at the conclusion of the most recent +** sqlite3_backup_step(). +** ^(The values returned by these functions are only updated by +** sqlite3_backup_step(). If the source database is modified in a way that +** changes the size of the source database or the number of pages remaining, +** those changes are not reflected in the output of sqlite3_backup_pagecount() +** and sqlite3_backup_remaining() until after the next +** sqlite3_backup_step().)^ +** +** Concurrent Usage of Database Handles +** +** ^The source [database connection] may be used by the application for other +** purposes while a backup operation is underway or being initialized. +** ^If SQLite is compiled and configured to support threadsafe database +** connections, then the source database connection may be used concurrently +** from within other threads. +** +** However, the application must guarantee that the destination +** [database connection] is not passed to any other API (by any thread) after +** sqlite3_backup_init() is called and before the corresponding call to +** sqlite3_backup_finish(). SQLite does not currently check to see +** if the application incorrectly accesses the destination [database connection] +** and so no error code is reported, but the operations may malfunction +** nevertheless. Use of the destination database connection while a +** backup is in progress might also also cause a mutex deadlock. +** +** If running in [shared cache mode], the application must +** guarantee that the shared cache used by the destination database +** is not accessed while the backup is running. In practice this means +** that the application must guarantee that the disk file being +** backed up to is not accessed by any connection within the process, +** not just the specific connection that was passed to sqlite3_backup_init(). +** +** The [sqlite3_backup] object itself is partially threadsafe. Multiple +** threads may safely make multiple concurrent calls to sqlite3_backup_step(). +** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount() +** APIs are not strictly speaking threadsafe. If they are invoked at the +** same time as another thread is invoking sqlite3_backup_step() it is +** possible that they return invalid values. +*/ +SQLITE_API sqlite3_backup *sqlite3_backup_init( + sqlite3 *pDest, /* Destination database handle */ + const char *zDestName, /* Destination database name */ + sqlite3 *pSource, /* Source database handle */ + const char *zSourceName /* Source database name */ +); +SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage); +SQLITE_API int sqlite3_backup_finish(sqlite3_backup *p); +SQLITE_API int sqlite3_backup_remaining(sqlite3_backup *p); +SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); + +/* +** CAPI3REF: Unlock Notification +** METHOD: sqlite3 +** +** ^When running in shared-cache mode, a database operation may fail with +** an [SQLITE_LOCKED] error if the required locks on the shared-cache or +** individual tables within the shared-cache cannot be obtained. See +** [SQLite Shared-Cache Mode] for a description of shared-cache locking. +** ^This API may be used to register a callback that SQLite will invoke +** when the connection currently holding the required lock relinquishes it. +** ^This API is only available if the library was compiled with the +** [SQLITE_ENABLE_UNLOCK_NOTIFY] C-preprocessor symbol defined. +** +** See Also: [Using the SQLite Unlock Notification Feature]. +** +** ^Shared-cache locks are released when a database connection concludes +** its current transaction, either by committing it or rolling it back. +** +** ^When a connection (known as the blocked connection) fails to obtain a +** shared-cache lock and SQLITE_LOCKED is returned to the caller, the +** identity of the database connection (the blocking connection) that +** has locked the required resource is stored internally. ^After an +** application receives an SQLITE_LOCKED error, it may call the +** sqlite3_unlock_notify() method with the blocked connection handle as +** the first argument to register for a callback that will be invoked +** when the blocking connections current transaction is concluded. ^The +** callback is invoked from within the [sqlite3_step] or [sqlite3_close] +** call that concludes the blocking connection's transaction. +** +** ^(If sqlite3_unlock_notify() is called in a multi-threaded application, +** there is a chance that the blocking connection will have already +** concluded its transaction by the time sqlite3_unlock_notify() is invoked. +** If this happens, then the specified callback is invoked immediately, +** from within the call to sqlite3_unlock_notify().)^ +** +** ^If the blocked connection is attempting to obtain a write-lock on a +** shared-cache table, and more than one other connection currently holds +** a read-lock on the same table, then SQLite arbitrarily selects one of +** the other connections to use as the blocking connection. +** +** ^(There may be at most one unlock-notify callback registered by a +** blocked connection. If sqlite3_unlock_notify() is called when the +** blocked connection already has a registered unlock-notify callback, +** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is +** called with a NULL pointer as its second argument, then any existing +** unlock-notify callback is canceled. ^The blocked connections +** unlock-notify callback may also be canceled by closing the blocked +** connection using [sqlite3_close()]. +** +** The unlock-notify callback is not reentrant. If an application invokes +** any sqlite3_xxx API functions from within an unlock-notify callback, a +** crash or deadlock may be the result. +** +** ^Unless deadlock is detected (see below), sqlite3_unlock_notify() always +** returns SQLITE_OK. +** +** Callback Invocation Details +** +** When an unlock-notify callback is registered, the application provides a +** single void* pointer that is passed to the callback when it is invoked. +** However, the signature of the callback function allows SQLite to pass +** it an array of void* context pointers. The first argument passed to +** an unlock-notify callback is a pointer to an array of void* pointers, +** and the second is the number of entries in the array. +** +** When a blocking connection's transaction is concluded, there may be +** more than one blocked connection that has registered for an unlock-notify +** callback. ^If two or more such blocked connections have specified the +** same callback function, then instead of invoking the callback function +** multiple times, it is invoked once with the set of void* context pointers +** specified by the blocked connections bundled together into an array. +** This gives the application an opportunity to prioritize any actions +** related to the set of unblocked database connections. +** +** Deadlock Detection +** +** Assuming that after registering for an unlock-notify callback a +** database waits for the callback to be issued before taking any further +** action (a reasonable assumption), then using this API may cause the +** application to deadlock. For example, if connection X is waiting for +** connection Y's transaction to be concluded, and similarly connection +** Y is waiting on connection X's transaction, then neither connection +** will proceed and the system may remain deadlocked indefinitely. +** +** To avoid this scenario, the sqlite3_unlock_notify() performs deadlock +** detection. ^If a given call to sqlite3_unlock_notify() would put the +** system in a deadlocked state, then SQLITE_LOCKED is returned and no +** unlock-notify callback is registered. The system is said to be in +** a deadlocked state if connection A has registered for an unlock-notify +** callback on the conclusion of connection B's transaction, and connection +** B has itself registered for an unlock-notify callback when connection +** A's transaction is concluded. ^Indirect deadlock is also detected, so +** the system is also considered to be deadlocked if connection B has +** registered for an unlock-notify callback on the conclusion of connection +** C's transaction, where connection C is waiting on connection A. ^Any +** number of levels of indirection are allowed. +** +** The "DROP TABLE" Exception +** +** When a call to [sqlite3_step()] returns SQLITE_LOCKED, it is almost +** always appropriate to call sqlite3_unlock_notify(). There is however, +** one exception. When executing a "DROP TABLE" or "DROP INDEX" statement, +** SQLite checks if there are any currently executing SELECT statements +** that belong to the same connection. If there are, SQLITE_LOCKED is +** returned. In this case there is no "blocking connection", so invoking +** sqlite3_unlock_notify() results in the unlock-notify callback being +** invoked immediately. If the application then re-attempts the "DROP TABLE" +** or "DROP INDEX" query, an infinite loop might be the result. +** +** One way around this problem is to check the extended error code returned +** by an sqlite3_step() call. ^(If there is a blocking connection, then the +** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in +** the special "DROP TABLE/INDEX" case, the extended error code is just +** SQLITE_LOCKED.)^ +*/ +SQLITE_API int sqlite3_unlock_notify( + sqlite3 *pBlocked, /* Waiting connection */ + void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */ + void *pNotifyArg /* Argument to pass to xNotify */ +); + + +/* +** CAPI3REF: String Comparison +** +** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications +** and extensions to compare the contents of two buffers containing UTF-8 +** strings in a case-independent fashion, using the same definition of "case +** independence" that SQLite uses internally when comparing identifiers. +*/ +SQLITE_API int sqlite3_stricmp(const char *, const char *); +SQLITE_API int sqlite3_strnicmp(const char *, const char *, int); + +/* +** CAPI3REF: String Globbing +* +** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if +** string X matches the [GLOB] pattern P. +** ^The definition of [GLOB] pattern matching used in +** [sqlite3_strglob(P,X)] is the same as for the "X GLOB P" operator in the +** SQL dialect understood by SQLite. ^The [sqlite3_strglob(P,X)] function +** is case sensitive. +** +** Note that this routine returns zero on a match and non-zero if the strings +** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()]. +** +** See also: [sqlite3_strlike()]. +*/ +SQLITE_API int sqlite3_strglob(const char *zGlob, const char *zStr); + +/* +** CAPI3REF: String LIKE Matching +* +** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if +** string X matches the [LIKE] pattern P with escape character E. +** ^The definition of [LIKE] pattern matching used in +** [sqlite3_strlike(P,X,E)] is the same as for the "X LIKE P ESCAPE E" +** operator in the SQL dialect understood by SQLite. ^For "X LIKE P" without +** the ESCAPE clause, set the E parameter of [sqlite3_strlike(P,X,E)] to 0. +** ^As with the LIKE operator, the [sqlite3_strlike(P,X,E)] function is case +** insensitive - equivalent upper and lower case ASCII characters match +** one another. +** +** ^The [sqlite3_strlike(P,X,E)] function matches Unicode characters, though +** only ASCII characters are case folded. +** +** Note that this routine returns zero on a match and non-zero if the strings +** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()]. +** +** See also: [sqlite3_strglob()]. +*/ +SQLITE_API int sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc); + +/* +** CAPI3REF: Error Logging Interface +** +** ^The [sqlite3_log()] interface writes a message into the [error log] +** established by the [SQLITE_CONFIG_LOG] option to [sqlite3_config()]. +** ^If logging is enabled, the zFormat string and subsequent arguments are +** used with [sqlite3_snprintf()] to generate the final output string. +** +** The sqlite3_log() interface is intended for use by extensions such as +** virtual tables, collating functions, and SQL functions. While there is +** nothing to prevent an application from calling sqlite3_log(), doing so +** is considered bad form. +** +** The zFormat string must not be NULL. +** +** To avoid deadlocks and other threading problems, the sqlite3_log() routine +** will not use dynamically allocated memory. The log message is stored in +** a fixed-length buffer on the stack. If the log message is longer than +** a few hundred characters, it will be truncated to the length of the +** buffer. +*/ +SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...); + +/* +** CAPI3REF: Write-Ahead Log Commit Hook +** METHOD: sqlite3 +** +** ^The [sqlite3_wal_hook()] function is used to register a callback that +** is invoked each time data is committed to a database in wal mode. +** +** ^(The callback is invoked by SQLite after the commit has taken place and +** the associated write-lock on the database released)^, so the implementation +** may read, write or [checkpoint] the database as required. +** +** ^The first parameter passed to the callback function when it is invoked +** is a copy of the third parameter passed to sqlite3_wal_hook() when +** registering the callback. ^The second is a copy of the database handle. +** ^The third parameter is the name of the database that was written to - +** either "main" or the name of an [ATTACH]-ed database. ^The fourth parameter +** is the number of pages currently in the write-ahead log file, +** including those that were just committed. +** +** The callback function should normally return [SQLITE_OK]. ^If an error +** code is returned, that error will propagate back up through the +** SQLite code base to cause the statement that provoked the callback +** to report an error, though the commit will have still occurred. If the +** callback returns [SQLITE_ROW] or [SQLITE_DONE], or if it returns a value +** that does not correspond to any valid SQLite error code, the results +** are undefined. +** +** A single database handle may have at most a single write-ahead log callback +** registered at one time. ^Calling [sqlite3_wal_hook()] replaces any +** previously registered write-ahead log callback. ^Note that the +** [sqlite3_wal_autocheckpoint()] interface and the +** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will +** overwrite any prior [sqlite3_wal_hook()] settings. +*/ +SQLITE_API void *sqlite3_wal_hook( + sqlite3*, + int(*)(void *,sqlite3*,const char*,int), + void* +); + +/* +** CAPI3REF: Configure an auto-checkpoint +** METHOD: sqlite3 +** +** ^The [sqlite3_wal_autocheckpoint(D,N)] is a wrapper around +** [sqlite3_wal_hook()] that causes any database on [database connection] D +** to automatically [checkpoint] +** after committing a transaction if there are N or +** more frames in the [write-ahead log] file. ^Passing zero or +** a negative value as the nFrame parameter disables automatic +** checkpoints entirely. +** +** ^The callback registered by this function replaces any existing callback +** registered using [sqlite3_wal_hook()]. ^Likewise, registering a callback +** using [sqlite3_wal_hook()] disables the automatic checkpoint mechanism +** configured by this function. +** +** ^The [wal_autocheckpoint pragma] can be used to invoke this interface +** from SQL. +** +** ^Checkpoints initiated by this mechanism are +** [sqlite3_wal_checkpoint_v2|PASSIVE]. +** +** ^Every new [database connection] defaults to having the auto-checkpoint +** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT] +** pages. The use of this interface +** is only necessary if the default setting is found to be suboptimal +** for a particular application. +*/ +SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int N); + +/* +** CAPI3REF: Checkpoint a database +** METHOD: sqlite3 +** +** ^(The sqlite3_wal_checkpoint(D,X) is equivalent to +** [sqlite3_wal_checkpoint_v2](D,X,[SQLITE_CHECKPOINT_PASSIVE],0,0).)^ +** +** In brief, sqlite3_wal_checkpoint(D,X) causes the content in the +** [write-ahead log] for database X on [database connection] D to be +** transferred into the database file and for the write-ahead log to +** be reset. See the [checkpointing] documentation for addition +** information. +** +** This interface used to be the only way to cause a checkpoint to +** occur. But then the newer and more powerful [sqlite3_wal_checkpoint_v2()] +** interface was added. This interface is retained for backwards +** compatibility and as a convenience for applications that need to manually +** start a callback but which do not need the full power (and corresponding +** complication) of [sqlite3_wal_checkpoint_v2()]. +*/ +SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); + +/* +** CAPI3REF: Checkpoint a database +** METHOD: sqlite3 +** +** ^(The sqlite3_wal_checkpoint_v2(D,X,M,L,C) interface runs a checkpoint +** operation on database X of [database connection] D in mode M. Status +** information is written back into integers pointed to by L and C.)^ +** ^(The M parameter must be a valid [checkpoint mode]:)^ +** +**
+**
SQLITE_CHECKPOINT_PASSIVE
+** ^Checkpoint as many frames as possible without waiting for any database +** readers or writers to finish, then sync the database file if all frames +** in the log were checkpointed. ^The [busy-handler callback] +** is never invoked in the SQLITE_CHECKPOINT_PASSIVE mode. +** ^On the other hand, passive mode might leave the checkpoint unfinished +** if there are concurrent readers or writers. +** +**
SQLITE_CHECKPOINT_FULL
+** ^This mode blocks (it invokes the +** [sqlite3_busy_handler|busy-handler callback]) until there is no +** database writer and all readers are reading from the most recent database +** snapshot. ^It then checkpoints all frames in the log file and syncs the +** database file. ^This mode blocks new database writers while it is pending, +** but new database readers are allowed to continue unimpeded. +** +**
SQLITE_CHECKPOINT_RESTART
+** ^This mode works the same way as SQLITE_CHECKPOINT_FULL with the addition +** that after checkpointing the log file it blocks (calls the +** [busy-handler callback]) +** until all readers are reading from the database file only. ^This ensures +** that the next writer will restart the log file from the beginning. +** ^Like SQLITE_CHECKPOINT_FULL, this mode blocks new +** database writer attempts while it is pending, but does not impede readers. +** +**
SQLITE_CHECKPOINT_TRUNCATE
+** ^This mode works the same way as SQLITE_CHECKPOINT_RESTART with the +** addition that it also truncates the log file to zero bytes just prior +** to a successful return. +**
+** +** ^If pnLog is not NULL, then *pnLog is set to the total number of frames in +** the log file or to -1 if the checkpoint could not run because +** of an error or because the database is not in [WAL mode]. ^If pnCkpt is not +** NULL,then *pnCkpt is set to the total number of checkpointed frames in the +** log file (including any that were already checkpointed before the function +** was called) or to -1 if the checkpoint could not run due to an error or +** because the database is not in WAL mode. ^Note that upon successful +** completion of an SQLITE_CHECKPOINT_TRUNCATE, the log file will have been +** truncated to zero bytes and so both *pnLog and *pnCkpt will be set to zero. +** +** ^All calls obtain an exclusive "checkpoint" lock on the database file. ^If +** any other process is running a checkpoint operation at the same time, the +** lock cannot be obtained and SQLITE_BUSY is returned. ^Even if there is a +** busy-handler configured, it will not be invoked in this case. +** +** ^The SQLITE_CHECKPOINT_FULL, RESTART and TRUNCATE modes also obtain the +** exclusive "writer" lock on the database file. ^If the writer lock cannot be +** obtained immediately, and a busy-handler is configured, it is invoked and +** the writer lock retried until either the busy-handler returns 0 or the lock +** is successfully obtained. ^The busy-handler is also invoked while waiting for +** database readers as described above. ^If the busy-handler returns 0 before +** the writer lock is obtained or while waiting for database readers, the +** checkpoint operation proceeds from that point in the same way as +** SQLITE_CHECKPOINT_PASSIVE - checkpointing as many frames as possible +** without blocking any further. ^SQLITE_BUSY is returned in this case. +** +** ^If parameter zDb is NULL or points to a zero length string, then the +** specified operation is attempted on all WAL databases [attached] to +** [database connection] db. In this case the +** values written to output parameters *pnLog and *pnCkpt are undefined. ^If +** an SQLITE_BUSY error is encountered when processing one or more of the +** attached WAL databases, the operation is still attempted on any remaining +** attached databases and SQLITE_BUSY is returned at the end. ^If any other +** error occurs while processing an attached database, processing is abandoned +** and the error code is returned to the caller immediately. ^If no error +** (SQLITE_BUSY or otherwise) is encountered while processing the attached +** databases, SQLITE_OK is returned. +** +** ^If database zDb is the name of an attached database that is not in WAL +** mode, SQLITE_OK is returned and both *pnLog and *pnCkpt set to -1. ^If +** zDb is not NULL (or a zero length string) and is not the name of any +** attached database, SQLITE_ERROR is returned to the caller. +** +** ^Unless it returns SQLITE_MISUSE, +** the sqlite3_wal_checkpoint_v2() interface +** sets the error information that is queried by +** [sqlite3_errcode()] and [sqlite3_errmsg()]. +** +** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface +** from SQL. +*/ +SQLITE_API int sqlite3_wal_checkpoint_v2( + sqlite3 *db, /* Database handle */ + const char *zDb, /* Name of attached database (or NULL) */ + int eMode, /* SQLITE_CHECKPOINT_* value */ + int *pnLog, /* OUT: Size of WAL log in frames */ + int *pnCkpt /* OUT: Total number of frames checkpointed */ +); + +/* +** CAPI3REF: Checkpoint Mode Values +** KEYWORDS: {checkpoint mode} +** +** These constants define all valid values for the "checkpoint mode" passed +** as the third parameter to the [sqlite3_wal_checkpoint_v2()] interface. +** See the [sqlite3_wal_checkpoint_v2()] documentation for details on the +** meaning of each of these checkpoint modes. +*/ +#define SQLITE_CHECKPOINT_PASSIVE 0 /* Do as much as possible w/o blocking */ +#define SQLITE_CHECKPOINT_FULL 1 /* Wait for writers, then checkpoint */ +#define SQLITE_CHECKPOINT_RESTART 2 /* Like FULL but wait for for readers */ +#define SQLITE_CHECKPOINT_TRUNCATE 3 /* Like RESTART but also truncate WAL */ + +/* +** CAPI3REF: Virtual Table Interface Configuration +** +** This function may be called by either the [xConnect] or [xCreate] method +** of a [virtual table] implementation to configure +** various facets of the virtual table interface. +** +** If this interface is invoked outside the context of an xConnect or +** xCreate virtual table method then the behavior is undefined. +** +** In the call sqlite3_vtab_config(D,C,...) the D parameter is the +** [database connection] in which the virtual table is being created and +** which is passed in as the first argument to the [xConnect] or [xCreate] +** method that is invoking sqlite3_vtab_config(). The C parameter is one +** of the [virtual table configuration options]. The presence and meaning +** of parameters after C depend on which [virtual table configuration option] +** is used. +*/ +SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); + +/* +** CAPI3REF: Virtual Table Configuration Options +** KEYWORDS: {virtual table configuration options} +** KEYWORDS: {virtual table configuration option} +** +** These macros define the various options to the +** [sqlite3_vtab_config()] interface that [virtual table] implementations +** can use to customize and optimize their behavior. +** +**
+** [[SQLITE_VTAB_CONSTRAINT_SUPPORT]] +**
SQLITE_VTAB_CONSTRAINT_SUPPORT
+**
Calls of the form +** [sqlite3_vtab_config](db,SQLITE_VTAB_CONSTRAINT_SUPPORT,X) are supported, +** where X is an integer. If X is zero, then the [virtual table] whose +** [xCreate] or [xConnect] method invoked [sqlite3_vtab_config()] does not +** support constraints. In this configuration (which is the default) if +** a call to the [xUpdate] method returns [SQLITE_CONSTRAINT], then the entire +** statement is rolled back as if [ON CONFLICT | OR ABORT] had been +** specified as part of the users SQL statement, regardless of the actual +** ON CONFLICT mode specified. +** +** If X is non-zero, then the virtual table implementation guarantees +** that if [xUpdate] returns [SQLITE_CONSTRAINT], it will do so before +** any modifications to internal or persistent data structures have been made. +** If the [ON CONFLICT] mode is ABORT, FAIL, IGNORE or ROLLBACK, SQLite +** is able to roll back a statement or database transaction, and abandon +** or continue processing the current SQL statement as appropriate. +** If the ON CONFLICT mode is REPLACE and the [xUpdate] method returns +** [SQLITE_CONSTRAINT], SQLite handles this as if the ON CONFLICT mode +** had been ABORT. +** +** Virtual table implementations that are required to handle OR REPLACE +** must do so within the [xUpdate] method. If a call to the +** [sqlite3_vtab_on_conflict()] function indicates that the current ON +** CONFLICT policy is REPLACE, the virtual table implementation should +** silently replace the appropriate rows within the xUpdate callback and +** return SQLITE_OK. Or, if this is not possible, it may return +** SQLITE_CONSTRAINT, in which case SQLite falls back to OR ABORT +** constraint handling. +**
+** +** [[SQLITE_VTAB_DIRECTONLY]]
SQLITE_VTAB_DIRECTONLY
+**
Calls of the form +** [sqlite3_vtab_config](db,SQLITE_VTAB_DIRECTONLY) from within the +** the [xConnect] or [xCreate] methods of a [virtual table] implmentation +** prohibits that virtual table from being used from within triggers and +** views. +**
+** +** [[SQLITE_VTAB_INNOCUOUS]]
SQLITE_VTAB_INNOCUOUS
+**
Calls of the form +** [sqlite3_vtab_config](db,SQLITE_VTAB_INNOCUOUS) from within the +** the [xConnect] or [xCreate] methods of a [virtual table] implmentation +** identify that virtual table as being safe to use from within triggers +** and views. Conceptually, the SQLITE_VTAB_INNOCUOUS tag means that the +** virtual table can do no serious harm even if it is controlled by a +** malicious hacker. Developers should avoid setting the SQLITE_VTAB_INNOCUOUS +** flag unless absolutely necessary. +**
+**
+*/ +#define SQLITE_VTAB_CONSTRAINT_SUPPORT 1 +#define SQLITE_VTAB_INNOCUOUS 2 +#define SQLITE_VTAB_DIRECTONLY 3 + +/* +** CAPI3REF: Determine The Virtual Table Conflict Policy +** +** This function may only be called from within a call to the [xUpdate] method +** of a [virtual table] implementation for an INSERT or UPDATE operation. ^The +** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL], +** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode +** of the SQL statement that triggered the call to the [xUpdate] method of the +** [virtual table]. +*/ +SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *); + +/* +** CAPI3REF: Determine If Virtual Table Column Access Is For UPDATE +** +** If the sqlite3_vtab_nochange(X) routine is called within the [xColumn] +** method of a [virtual table], then it returns true if and only if the +** column is being fetched as part of an UPDATE operation during which the +** column value will not change. Applications might use this to substitute +** a return value that is less expensive to compute and that the corresponding +** [xUpdate] method understands as a "no-change" value. +** +** If the [xColumn] method calls sqlite3_vtab_nochange() and finds that +** the column is not changed by the UPDATE statement, then the xColumn +** method can optionally return without setting a result, without calling +** any of the [sqlite3_result_int|sqlite3_result_xxxxx() interfaces]. +** In that case, [sqlite3_value_nochange(X)] will return true for the +** same column in the [xUpdate] method. +*/ +SQLITE_API int sqlite3_vtab_nochange(sqlite3_context*); + +/* +** CAPI3REF: Determine The Collation For a Virtual Table Constraint +** +** This function may only be called from within a call to the [xBestIndex] +** method of a [virtual table]. +** +** The first argument must be the sqlite3_index_info object that is the +** first parameter to the xBestIndex() method. The second argument must be +** an index into the aConstraint[] array belonging to the sqlite3_index_info +** structure passed to xBestIndex. This function returns a pointer to a buffer +** containing the name of the collation sequence for the corresponding +** constraint. +*/ +SQLITE_API SQLITE_EXPERIMENTAL const char *sqlite3_vtab_collation(sqlite3_index_info*,int); + +/* +** CAPI3REF: Conflict resolution modes +** KEYWORDS: {conflict resolution mode} +** +** These constants are returned by [sqlite3_vtab_on_conflict()] to +** inform a [virtual table] implementation what the [ON CONFLICT] mode +** is for the SQL statement being evaluated. +** +** Note that the [SQLITE_IGNORE] constant is also used as a potential +** return value from the [sqlite3_set_authorizer()] callback and that +** [SQLITE_ABORT] is also a [result code]. +*/ +#define SQLITE_ROLLBACK 1 +/* #define SQLITE_IGNORE 2 // Also used by sqlite3_authorizer() callback */ +#define SQLITE_FAIL 3 +/* #define SQLITE_ABORT 4 // Also an error code */ +#define SQLITE_REPLACE 5 + +/* +** CAPI3REF: Prepared Statement Scan Status Opcodes +** KEYWORDS: {scanstatus options} +** +** The following constants can be used for the T parameter to the +** [sqlite3_stmt_scanstatus(S,X,T,V)] interface. Each constant designates a +** different metric for sqlite3_stmt_scanstatus() to return. +** +** When the value returned to V is a string, space to hold that string is +** managed by the prepared statement S and will be automatically freed when +** S is finalized. +** +**
+** [[SQLITE_SCANSTAT_NLOOP]]
SQLITE_SCANSTAT_NLOOP
+**
^The [sqlite3_int64] variable pointed to by the V parameter will be +** set to the total number of times that the X-th loop has run.
+** +** [[SQLITE_SCANSTAT_NVISIT]]
SQLITE_SCANSTAT_NVISIT
+**
^The [sqlite3_int64] variable pointed to by the V parameter will be set +** to the total number of rows examined by all iterations of the X-th loop.
+** +** [[SQLITE_SCANSTAT_EST]]
SQLITE_SCANSTAT_EST
+**
^The "double" variable pointed to by the V parameter will be set to the +** query planner's estimate for the average number of rows output from each +** iteration of the X-th loop. If the query planner's estimates was accurate, +** then this value will approximate the quotient NVISIT/NLOOP and the +** product of this value for all prior loops with the same SELECTID will +** be the NLOOP value for the current loop. +** +** [[SQLITE_SCANSTAT_NAME]]
SQLITE_SCANSTAT_NAME
+**
^The "const char *" variable pointed to by the V parameter will be set +** to a zero-terminated UTF-8 string containing the name of the index or table +** used for the X-th loop. +** +** [[SQLITE_SCANSTAT_EXPLAIN]]
SQLITE_SCANSTAT_EXPLAIN
+**
^The "const char *" variable pointed to by the V parameter will be set +** to a zero-terminated UTF-8 string containing the [EXPLAIN QUERY PLAN] +** description for the X-th loop. +** +** [[SQLITE_SCANSTAT_SELECTID]]
SQLITE_SCANSTAT_SELECT
+**
^The "int" variable pointed to by the V parameter will be set to the +** "select-id" for the X-th loop. The select-id identifies which query or +** subquery the loop is part of. The main query has a select-id of zero. +** The select-id is the same value as is output in the first column +** of an [EXPLAIN QUERY PLAN] query. +**
+*/ +#define SQLITE_SCANSTAT_NLOOP 0 +#define SQLITE_SCANSTAT_NVISIT 1 +#define SQLITE_SCANSTAT_EST 2 +#define SQLITE_SCANSTAT_NAME 3 +#define SQLITE_SCANSTAT_EXPLAIN 4 +#define SQLITE_SCANSTAT_SELECTID 5 + +/* +** CAPI3REF: Prepared Statement Scan Status +** METHOD: sqlite3_stmt +** +** This interface returns information about the predicted and measured +** performance for pStmt. Advanced applications can use this +** interface to compare the predicted and the measured performance and +** issue warnings and/or rerun [ANALYZE] if discrepancies are found. +** +** Since this interface is expected to be rarely used, it is only +** available if SQLite is compiled using the [SQLITE_ENABLE_STMT_SCANSTATUS] +** compile-time option. +** +** The "iScanStatusOp" parameter determines which status information to return. +** The "iScanStatusOp" must be one of the [scanstatus options] or the behavior +** of this interface is undefined. +** ^The requested measurement is written into a variable pointed to by +** the "pOut" parameter. +** Parameter "idx" identifies the specific loop to retrieve statistics for. +** Loops are numbered starting from zero. ^If idx is out of range - less than +** zero or greater than or equal to the total number of loops used to implement +** the statement - a non-zero value is returned and the variable that pOut +** points to is unchanged. +** +** ^Statistics might not be available for all loops in all statements. ^In cases +** where there exist loops with no available statistics, this function behaves +** as if the loop did not exist - it returns non-zero and leave the variable +** that pOut points to unchanged. +** +** See also: [sqlite3_stmt_scanstatus_reset()] +*/ +SQLITE_API int sqlite3_stmt_scanstatus( + sqlite3_stmt *pStmt, /* Prepared statement for which info desired */ + int idx, /* Index of loop to report on */ + int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */ + void *pOut /* Result written here */ +); + +/* +** CAPI3REF: Zero Scan-Status Counters +** METHOD: sqlite3_stmt +** +** ^Zero all [sqlite3_stmt_scanstatus()] related event counters. +** +** This API is only available if the library is built with pre-processor +** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined. +*/ +SQLITE_API void sqlite3_stmt_scanstatus_reset(sqlite3_stmt*); + +/* +** CAPI3REF: Flush caches to disk mid-transaction +** +** ^If a write-transaction is open on [database connection] D when the +** [sqlite3_db_cacheflush(D)] interface invoked, any dirty +** pages in the pager-cache that are not currently in use are written out +** to disk. A dirty page may be in use if a database cursor created by an +** active SQL statement is reading from it, or if it is page 1 of a database +** file (page 1 is always "in use"). ^The [sqlite3_db_cacheflush(D)] +** interface flushes caches for all schemas - "main", "temp", and +** any [attached] databases. +** +** ^If this function needs to obtain extra database locks before dirty pages +** can be flushed to disk, it does so. ^If those locks cannot be obtained +** immediately and there is a busy-handler callback configured, it is invoked +** in the usual manner. ^If the required lock still cannot be obtained, then +** the database is skipped and an attempt made to flush any dirty pages +** belonging to the next (if any) database. ^If any databases are skipped +** because locks cannot be obtained, but no other error occurs, this +** function returns SQLITE_BUSY. +** +** ^If any other error occurs while flushing dirty pages to disk (for +** example an IO error or out-of-memory condition), then processing is +** abandoned and an SQLite [error code] is returned to the caller immediately. +** +** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK. +** +** ^This function does not set the database handle error code or message +** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions. +*/ +SQLITE_API int sqlite3_db_cacheflush(sqlite3*); + +/* +** CAPI3REF: The pre-update hook. +** +** ^These interfaces are only available if SQLite is compiled using the +** [SQLITE_ENABLE_PREUPDATE_HOOK] compile-time option. +** +** ^The [sqlite3_preupdate_hook()] interface registers a callback function +** that is invoked prior to each [INSERT], [UPDATE], and [DELETE] operation +** on a database table. +** ^At most one preupdate hook may be registered at a time on a single +** [database connection]; each call to [sqlite3_preupdate_hook()] overrides +** the previous setting. +** ^The preupdate hook is disabled by invoking [sqlite3_preupdate_hook()] +** with a NULL pointer as the second parameter. +** ^The third parameter to [sqlite3_preupdate_hook()] is passed through as +** the first parameter to callbacks. +** +** ^The preupdate hook only fires for changes to real database tables; the +** preupdate hook is not invoked for changes to [virtual tables] or to +** system tables like sqlite_master or sqlite_stat1. +** +** ^The second parameter to the preupdate callback is a pointer to +** the [database connection] that registered the preupdate hook. +** ^The third parameter to the preupdate callback is one of the constants +** [SQLITE_INSERT], [SQLITE_DELETE], or [SQLITE_UPDATE] to identify the +** kind of update operation that is about to occur. +** ^(The fourth parameter to the preupdate callback is the name of the +** database within the database connection that is being modified. This +** will be "main" for the main database or "temp" for TEMP tables or +** the name given after the AS keyword in the [ATTACH] statement for attached +** databases.)^ +** ^The fifth parameter to the preupdate callback is the name of the +** table that is being modified. +** +** For an UPDATE or DELETE operation on a [rowid table], the sixth +** parameter passed to the preupdate callback is the initial [rowid] of the +** row being modified or deleted. For an INSERT operation on a rowid table, +** or any operation on a WITHOUT ROWID table, the value of the sixth +** parameter is undefined. For an INSERT or UPDATE on a rowid table the +** seventh parameter is the final rowid value of the row being inserted +** or updated. The value of the seventh parameter passed to the callback +** function is not defined for operations on WITHOUT ROWID tables, or for +** INSERT operations on rowid tables. +** +** The [sqlite3_preupdate_old()], [sqlite3_preupdate_new()], +** [sqlite3_preupdate_count()], and [sqlite3_preupdate_depth()] interfaces +** provide additional information about a preupdate event. These routines +** may only be called from within a preupdate callback. Invoking any of +** these routines from outside of a preupdate callback or with a +** [database connection] pointer that is different from the one supplied +** to the preupdate callback results in undefined and probably undesirable +** behavior. +** +** ^The [sqlite3_preupdate_count(D)] interface returns the number of columns +** in the row that is being inserted, updated, or deleted. +** +** ^The [sqlite3_preupdate_old(D,N,P)] interface writes into P a pointer to +** a [protected sqlite3_value] that contains the value of the Nth column of +** the table row before it is updated. The N parameter must be between 0 +** and one less than the number of columns or the behavior will be +** undefined. This must only be used within SQLITE_UPDATE and SQLITE_DELETE +** preupdate callbacks; if it is used by an SQLITE_INSERT callback then the +** behavior is undefined. The [sqlite3_value] that P points to +** will be destroyed when the preupdate callback returns. +** +** ^The [sqlite3_preupdate_new(D,N,P)] interface writes into P a pointer to +** a [protected sqlite3_value] that contains the value of the Nth column of +** the table row after it is updated. The N parameter must be between 0 +** and one less than the number of columns or the behavior will be +** undefined. This must only be used within SQLITE_INSERT and SQLITE_UPDATE +** preupdate callbacks; if it is used by an SQLITE_DELETE callback then the +** behavior is undefined. The [sqlite3_value] that P points to +** will be destroyed when the preupdate callback returns. +** +** ^The [sqlite3_preupdate_depth(D)] interface returns 0 if the preupdate +** callback was invoked as a result of a direct insert, update, or delete +** operation; or 1 for inserts, updates, or deletes invoked by top-level +** triggers; or 2 for changes resulting from triggers called by top-level +** triggers; and so forth. +** +** See also: [sqlite3_update_hook()] +*/ +#if defined(SQLITE_ENABLE_PREUPDATE_HOOK) +SQLITE_API void *sqlite3_preupdate_hook( + sqlite3 *db, + void(*xPreUpdate)( + void *pCtx, /* Copy of third arg to preupdate_hook() */ + sqlite3 *db, /* Database handle */ + int op, /* SQLITE_UPDATE, DELETE or INSERT */ + char const *zDb, /* Database name */ + char const *zName, /* Table name */ + sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */ + sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */ + ), + void* +); +SQLITE_API int sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **); +SQLITE_API int sqlite3_preupdate_count(sqlite3 *); +SQLITE_API int sqlite3_preupdate_depth(sqlite3 *); +SQLITE_API int sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **); +#endif + +/* +** CAPI3REF: Low-level system error code +** +** ^Attempt to return the underlying operating system error code or error +** number that caused the most recent I/O error or failure to open a file. +** The return value is OS-dependent. For example, on unix systems, after +** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be +** called to get back the underlying "errno" that caused the problem, such +** as ENOSPC, EAUTH, EISDIR, and so forth. +*/ +SQLITE_API int sqlite3_system_errno(sqlite3*); + +/* +** CAPI3REF: Database Snapshot +** KEYWORDS: {snapshot} {sqlite3_snapshot} +** +** An instance of the snapshot object records the state of a [WAL mode] +** database for some specific point in history. +** +** In [WAL mode], multiple [database connections] that are open on the +** same database file can each be reading a different historical version +** of the database file. When a [database connection] begins a read +** transaction, that connection sees an unchanging copy of the database +** as it existed for the point in time when the transaction first started. +** Subsequent changes to the database from other connections are not seen +** by the reader until a new read transaction is started. +** +** The sqlite3_snapshot object records state information about an historical +** version of the database file so that it is possible to later open a new read +** transaction that sees that historical version of the database rather than +** the most recent version. +*/ +typedef struct sqlite3_snapshot { + unsigned char hidden[48]; +} sqlite3_snapshot; + +/* +** CAPI3REF: Record A Database Snapshot +** CONSTRUCTOR: sqlite3_snapshot +** +** ^The [sqlite3_snapshot_get(D,S,P)] interface attempts to make a +** new [sqlite3_snapshot] object that records the current state of +** schema S in database connection D. ^On success, the +** [sqlite3_snapshot_get(D,S,P)] interface writes a pointer to the newly +** created [sqlite3_snapshot] object into *P and returns SQLITE_OK. +** If there is not already a read-transaction open on schema S when +** this function is called, one is opened automatically. +** +** The following must be true for this function to succeed. If any of +** the following statements are false when sqlite3_snapshot_get() is +** called, SQLITE_ERROR is returned. The final value of *P is undefined +** in this case. +** +**
    +**
  • The database handle must not be in [autocommit mode]. +** +**
  • Schema S of [database connection] D must be a [WAL mode] database. +** +**
  • There must not be a write transaction open on schema S of database +** connection D. +** +**
  • One or more transactions must have been written to the current wal +** file since it was created on disk (by any connection). This means +** that a snapshot cannot be taken on a wal mode database with no wal +** file immediately after it is first opened. At least one transaction +** must be written to it first. +**
+** +** This function may also return SQLITE_NOMEM. If it is called with the +** database handle in autocommit mode but fails for some other reason, +** whether or not a read transaction is opened on schema S is undefined. +** +** The [sqlite3_snapshot] object returned from a successful call to +** [sqlite3_snapshot_get()] must be freed using [sqlite3_snapshot_free()] +** to avoid a memory leak. +** +** The [sqlite3_snapshot_get()] interface is only available when the +** [SQLITE_ENABLE_SNAPSHOT] compile-time option is used. +*/ +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_get( + sqlite3 *db, + const char *zSchema, + sqlite3_snapshot **ppSnapshot +); + +/* +** CAPI3REF: Start a read transaction on an historical snapshot +** METHOD: sqlite3_snapshot +** +** ^The [sqlite3_snapshot_open(D,S,P)] interface either starts a new read +** transaction or upgrades an existing one for schema S of +** [database connection] D such that the read transaction refers to +** historical [snapshot] P, rather than the most recent change to the +** database. ^The [sqlite3_snapshot_open()] interface returns SQLITE_OK +** on success or an appropriate [error code] if it fails. +** +** ^In order to succeed, the database connection must not be in +** [autocommit mode] when [sqlite3_snapshot_open(D,S,P)] is called. If there +** is already a read transaction open on schema S, then the database handle +** must have no active statements (SELECT statements that have been passed +** to sqlite3_step() but not sqlite3_reset() or sqlite3_finalize()). +** SQLITE_ERROR is returned if either of these conditions is violated, or +** if schema S does not exist, or if the snapshot object is invalid. +** +** ^A call to sqlite3_snapshot_open() will fail to open if the specified +** snapshot has been overwritten by a [checkpoint]. In this case +** SQLITE_ERROR_SNAPSHOT is returned. +** +** If there is already a read transaction open when this function is +** invoked, then the same read transaction remains open (on the same +** database snapshot) if SQLITE_ERROR, SQLITE_BUSY or SQLITE_ERROR_SNAPSHOT +** is returned. If another error code - for example SQLITE_PROTOCOL or an +** SQLITE_IOERR error code - is returned, then the final state of the +** read transaction is undefined. If SQLITE_OK is returned, then the +** read transaction is now open on database snapshot P. +** +** ^(A call to [sqlite3_snapshot_open(D,S,P)] will fail if the +** database connection D does not know that the database file for +** schema S is in [WAL mode]. A database connection might not know +** that the database file is in [WAL mode] if there has been no prior +** I/O on that database connection, or if the database entered [WAL mode] +** after the most recent I/O on the database connection.)^ +** (Hint: Run "[PRAGMA application_id]" against a newly opened +** database connection in order to make it ready to use snapshots.) +** +** The [sqlite3_snapshot_open()] interface is only available when the +** [SQLITE_ENABLE_SNAPSHOT] compile-time option is used. +*/ +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_open( + sqlite3 *db, + const char *zSchema, + sqlite3_snapshot *pSnapshot +); + +/* +** CAPI3REF: Destroy a snapshot +** DESTRUCTOR: sqlite3_snapshot +** +** ^The [sqlite3_snapshot_free(P)] interface destroys [sqlite3_snapshot] P. +** The application must eventually free every [sqlite3_snapshot] object +** using this routine to avoid a memory leak. +** +** The [sqlite3_snapshot_free()] interface is only available when the +** [SQLITE_ENABLE_SNAPSHOT] compile-time option is used. +*/ +SQLITE_API SQLITE_EXPERIMENTAL void sqlite3_snapshot_free(sqlite3_snapshot*); + +/* +** CAPI3REF: Compare the ages of two snapshot handles. +** METHOD: sqlite3_snapshot +** +** The sqlite3_snapshot_cmp(P1, P2) interface is used to compare the ages +** of two valid snapshot handles. +** +** If the two snapshot handles are not associated with the same database +** file, the result of the comparison is undefined. +** +** Additionally, the result of the comparison is only valid if both of the +** snapshot handles were obtained by calling sqlite3_snapshot_get() since the +** last time the wal file was deleted. The wal file is deleted when the +** database is changed back to rollback mode or when the number of database +** clients drops to zero. If either snapshot handle was obtained before the +** wal file was last deleted, the value returned by this function +** is undefined. +** +** Otherwise, this API returns a negative value if P1 refers to an older +** snapshot than P2, zero if the two handles refer to the same database +** snapshot, and a positive value if P1 is a newer snapshot than P2. +** +** This interface is only available if SQLite is compiled with the +** [SQLITE_ENABLE_SNAPSHOT] option. +*/ +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_cmp( + sqlite3_snapshot *p1, + sqlite3_snapshot *p2 +); + +/* +** CAPI3REF: Recover snapshots from a wal file +** METHOD: sqlite3_snapshot +** +** If a [WAL file] remains on disk after all database connections close +** (either through the use of the [SQLITE_FCNTL_PERSIST_WAL] [file control] +** or because the last process to have the database opened exited without +** calling [sqlite3_close()]) and a new connection is subsequently opened +** on that database and [WAL file], the [sqlite3_snapshot_open()] interface +** will only be able to open the last transaction added to the WAL file +** even though the WAL file contains other valid transactions. +** +** This function attempts to scan the WAL file associated with database zDb +** of database handle db and make all valid snapshots available to +** sqlite3_snapshot_open(). It is an error if there is already a read +** transaction open on the database, or if the database is not a WAL mode +** database. +** +** SQLITE_OK is returned if successful, or an SQLite error code otherwise. +** +** This interface is only available if SQLite is compiled with the +** [SQLITE_ENABLE_SNAPSHOT] option. +*/ +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const char *zDb); + +/* +** CAPI3REF: Serialize a database +** +** The sqlite3_serialize(D,S,P,F) interface returns a pointer to memory +** that is a serialization of the S database on [database connection] D. +** If P is not a NULL pointer, then the size of the database in bytes +** is written into *P. +** +** For an ordinary on-disk database file, the serialization is just a +** copy of the disk file. For an in-memory database or a "TEMP" database, +** the serialization is the same sequence of bytes which would be written +** to disk if that database where backed up to disk. +** +** The usual case is that sqlite3_serialize() copies the serialization of +** the database into memory obtained from [sqlite3_malloc64()] and returns +** a pointer to that memory. The caller is responsible for freeing the +** returned value to avoid a memory leak. However, if the F argument +** contains the SQLITE_SERIALIZE_NOCOPY bit, then no memory allocations +** are made, and the sqlite3_serialize() function will return a pointer +** to the contiguous memory representation of the database that SQLite +** is currently using for that database, or NULL if the no such contiguous +** memory representation of the database exists. A contiguous memory +** representation of the database will usually only exist if there has +** been a prior call to [sqlite3_deserialize(D,S,...)] with the same +** values of D and S. +** The size of the database is written into *P even if the +** SQLITE_SERIALIZE_NOCOPY bit is set but no contiguous copy +** of the database exists. +** +** A call to sqlite3_serialize(D,S,P,F) might return NULL even if the +** SQLITE_SERIALIZE_NOCOPY bit is omitted from argument F if a memory +** allocation error occurs. +** +** This interface is only available if SQLite is compiled with the +** [SQLITE_ENABLE_DESERIALIZE] option. +*/ +SQLITE_API unsigned char *sqlite3_serialize( + sqlite3 *db, /* The database connection */ + const char *zSchema, /* Which DB to serialize. ex: "main", "temp", ... */ + sqlite3_int64 *piSize, /* Write size of the DB here, if not NULL */ + unsigned int mFlags /* Zero or more SQLITE_SERIALIZE_* flags */ +); + +/* +** CAPI3REF: Flags for sqlite3_serialize +** +** Zero or more of the following constants can be OR-ed together for +** the F argument to [sqlite3_serialize(D,S,P,F)]. +** +** SQLITE_SERIALIZE_NOCOPY means that [sqlite3_serialize()] will return +** a pointer to contiguous in-memory database that it is currently using, +** without making a copy of the database. If SQLite is not currently using +** a contiguous in-memory database, then this option causes +** [sqlite3_serialize()] to return a NULL pointer. SQLite will only be +** using a contiguous in-memory database if it has been initialized by a +** prior call to [sqlite3_deserialize()]. +*/ +#define SQLITE_SERIALIZE_NOCOPY 0x001 /* Do no memory allocations */ + +/* +** CAPI3REF: Deserialize a database +** +** The sqlite3_deserialize(D,S,P,N,M,F) interface causes the +** [database connection] D to disconnect from database S and then +** reopen S as an in-memory database based on the serialization contained +** in P. The serialized database P is N bytes in size. M is the size of +** the buffer P, which might be larger than N. If M is larger than N, and +** the SQLITE_DESERIALIZE_READONLY bit is not set in F, then SQLite is +** permitted to add content to the in-memory database as long as the total +** size does not exceed M bytes. +** +** If the SQLITE_DESERIALIZE_FREEONCLOSE bit is set in F, then SQLite will +** invoke sqlite3_free() on the serialization buffer when the database +** connection closes. If the SQLITE_DESERIALIZE_RESIZEABLE bit is set, then +** SQLite will try to increase the buffer size using sqlite3_realloc64() +** if writes on the database cause it to grow larger than M bytes. +** +** The sqlite3_deserialize() interface will fail with SQLITE_BUSY if the +** database is currently in a read transaction or is involved in a backup +** operation. +** +** If sqlite3_deserialize(D,S,P,N,M,F) fails for any reason and if the +** SQLITE_DESERIALIZE_FREEONCLOSE bit is set in argument F, then +** [sqlite3_free()] is invoked on argument P prior to returning. +** +** This interface is only available if SQLite is compiled with the +** [SQLITE_ENABLE_DESERIALIZE] option. +*/ +SQLITE_API int sqlite3_deserialize( + sqlite3 *db, /* The database connection */ + const char *zSchema, /* Which DB to reopen with the deserialization */ + unsigned char *pData, /* The serialized database content */ + sqlite3_int64 szDb, /* Number bytes in the deserialization */ + sqlite3_int64 szBuf, /* Total size of buffer pData[] */ + unsigned mFlags /* Zero or more SQLITE_DESERIALIZE_* flags */ +); + +/* +** CAPI3REF: Flags for sqlite3_deserialize() +** +** The following are allowed values for 6th argument (the F argument) to +** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. +** +** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization +** in the P argument is held in memory obtained from [sqlite3_malloc64()] +** and that SQLite should take ownership of this memory and automatically +** free it when it has finished using it. Without this flag, the caller +** is responsible for freeing any dynamically allocated memory. +** +** The SQLITE_DESERIALIZE_RESIZEABLE flag means that SQLite is allowed to +** grow the size of the database using calls to [sqlite3_realloc64()]. This +** flag should only be used if SQLITE_DESERIALIZE_FREEONCLOSE is also used. +** Without this flag, the deserialized database cannot increase in size beyond +** the number of bytes specified by the M parameter. +** +** The SQLITE_DESERIALIZE_READONLY flag means that the deserialized database +** should be treated as read-only. +*/ +#define SQLITE_DESERIALIZE_FREEONCLOSE 1 /* Call sqlite3_free() on close */ +#define SQLITE_DESERIALIZE_RESIZEABLE 2 /* Resize using sqlite3_realloc64() */ +#define SQLITE_DESERIALIZE_READONLY 4 /* Database is read-only */ + +/* +** Undo the hack that converts floating point types to integer for +** builds on processors without floating point support. +*/ +#ifdef SQLITE_OMIT_FLOATING_POINT +# undef double +#endif + +#ifdef __cplusplus +} /* End of the 'extern "C"' block */ +#endif +#endif /* SQLITE3_H */ + +/******** Begin file sqlite3rtree.h *********/ +/* +** 2010 August 30 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +*/ + +#ifndef _SQLITE3RTREE_H_ +#define _SQLITE3RTREE_H_ + + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct sqlite3_rtree_geometry sqlite3_rtree_geometry; +typedef struct sqlite3_rtree_query_info sqlite3_rtree_query_info; + +/* The double-precision datatype used by RTree depends on the +** SQLITE_RTREE_INT_ONLY compile-time option. +*/ +#ifdef SQLITE_RTREE_INT_ONLY + typedef sqlite3_int64 sqlite3_rtree_dbl; +#else + typedef double sqlite3_rtree_dbl; +#endif + +/* +** Register a geometry callback named zGeom that can be used as part of an +** R-Tree geometry query as follows: +** +** SELECT ... FROM WHERE MATCH $zGeom(... params ...) +*/ +SQLITE_API int sqlite3_rtree_geometry_callback( + sqlite3 *db, + const char *zGeom, + int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*), + void *pContext +); + + +/* +** A pointer to a structure of the following type is passed as the first +** argument to callbacks registered using rtree_geometry_callback(). +*/ +struct sqlite3_rtree_geometry { + void *pContext; /* Copy of pContext passed to s_r_g_c() */ + int nParam; /* Size of array aParam[] */ + sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */ + void *pUser; /* Callback implementation user data */ + void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */ +}; + +/* +** Register a 2nd-generation geometry callback named zScore that can be +** used as part of an R-Tree geometry query as follows: +** +** SELECT ... FROM WHERE MATCH $zQueryFunc(... params ...) +*/ +SQLITE_API int sqlite3_rtree_query_callback( + sqlite3 *db, + const char *zQueryFunc, + int (*xQueryFunc)(sqlite3_rtree_query_info*), + void *pContext, + void (*xDestructor)(void*) +); + + +/* +** A pointer to a structure of the following type is passed as the +** argument to scored geometry callback registered using +** sqlite3_rtree_query_callback(). +** +** Note that the first 5 fields of this structure are identical to +** sqlite3_rtree_geometry. This structure is a subclass of +** sqlite3_rtree_geometry. +*/ +struct sqlite3_rtree_query_info { + void *pContext; /* pContext from when function registered */ + int nParam; /* Number of function parameters */ + sqlite3_rtree_dbl *aParam; /* value of function parameters */ + void *pUser; /* callback can use this, if desired */ + void (*xDelUser)(void*); /* function to free pUser */ + sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */ + unsigned int *anQueue; /* Number of pending entries in the queue */ + int nCoord; /* Number of coordinates */ + int iLevel; /* Level of current node or entry */ + int mxLevel; /* The largest iLevel value in the tree */ + sqlite3_int64 iRowid; /* Rowid for current entry */ + sqlite3_rtree_dbl rParentScore; /* Score of parent node */ + int eParentWithin; /* Visibility of parent node */ + int eWithin; /* OUT: Visibility */ + sqlite3_rtree_dbl rScore; /* OUT: Write the score here */ + /* The following fields are only available in 3.8.11 and later */ + sqlite3_value **apSqlParam; /* Original SQL values of parameters */ +}; + +/* +** Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. +*/ +#define NOT_WITHIN 0 /* Object completely outside of query region */ +#define PARTLY_WITHIN 1 /* Object partially overlaps query region */ +#define FULLY_WITHIN 2 /* Object fully contained within query region */ + + +#ifdef __cplusplus +} /* end of the 'extern "C"' block */ +#endif + +#endif /* ifndef _SQLITE3RTREE_H_ */ + +/******** End of sqlite3rtree.h *********/ +/******** Begin file sqlite3session.h *********/ + +#if !defined(__SQLITESESSION_H_) && defined(SQLITE_ENABLE_SESSION) +#define __SQLITESESSION_H_ 1 + +/* +** Make sure we can call this stuff from C++. +*/ +#ifdef __cplusplus +extern "C" { +#endif + + +/* +** CAPI3REF: Session Object Handle +** +** An instance of this object is a [session] that can be used to +** record changes to a database. +*/ +typedef struct sqlite3_session sqlite3_session; + +/* +** CAPI3REF: Changeset Iterator Handle +** +** An instance of this object acts as a cursor for iterating +** over the elements of a [changeset] or [patchset]. +*/ +typedef struct sqlite3_changeset_iter sqlite3_changeset_iter; + +/* +** CAPI3REF: Create A New Session Object +** CONSTRUCTOR: sqlite3_session +** +** Create a new session object attached to database handle db. If successful, +** a pointer to the new object is written to *ppSession and SQLITE_OK is +** returned. If an error occurs, *ppSession is set to NULL and an SQLite +** error code (e.g. SQLITE_NOMEM) is returned. +** +** It is possible to create multiple session objects attached to a single +** database handle. +** +** Session objects created using this function should be deleted using the +** [sqlite3session_delete()] function before the database handle that they +** are attached to is itself closed. If the database handle is closed before +** the session object is deleted, then the results of calling any session +** module function, including [sqlite3session_delete()] on the session object +** are undefined. +** +** Because the session module uses the [sqlite3_preupdate_hook()] API, it +** is not possible for an application to register a pre-update hook on a +** database handle that has one or more session objects attached. Nor is +** it possible to create a session object attached to a database handle for +** which a pre-update hook is already defined. The results of attempting +** either of these things are undefined. +** +** The session object will be used to create changesets for tables in +** database zDb, where zDb is either "main", or "temp", or the name of an +** attached database. It is not an error if database zDb is not attached +** to the database when the session object is created. +*/ +SQLITE_API int sqlite3session_create( + sqlite3 *db, /* Database handle */ + const char *zDb, /* Name of db (e.g. "main") */ + sqlite3_session **ppSession /* OUT: New session object */ +); + +/* +** CAPI3REF: Delete A Session Object +** DESTRUCTOR: sqlite3_session +** +** Delete a session object previously allocated using +** [sqlite3session_create()]. Once a session object has been deleted, the +** results of attempting to use pSession with any other session module +** function are undefined. +** +** Session objects must be deleted before the database handle to which they +** are attached is closed. Refer to the documentation for +** [sqlite3session_create()] for details. +*/ +SQLITE_API void sqlite3session_delete(sqlite3_session *pSession); + + +/* +** CAPI3REF: Enable Or Disable A Session Object +** METHOD: sqlite3_session +** +** Enable or disable the recording of changes by a session object. When +** enabled, a session object records changes made to the database. When +** disabled - it does not. A newly created session object is enabled. +** Refer to the documentation for [sqlite3session_changeset()] for further +** details regarding how enabling and disabling a session object affects +** the eventual changesets. +** +** Passing zero to this function disables the session. Passing a value +** greater than zero enables it. Passing a value less than zero is a +** no-op, and may be used to query the current state of the session. +** +** The return value indicates the final state of the session object: 0 if +** the session is disabled, or 1 if it is enabled. +*/ +SQLITE_API int sqlite3session_enable(sqlite3_session *pSession, int bEnable); + +/* +** CAPI3REF: Set Or Clear the Indirect Change Flag +** METHOD: sqlite3_session +** +** Each change recorded by a session object is marked as either direct or +** indirect. A change is marked as indirect if either: +** +**
    +**
  • The session object "indirect" flag is set when the change is +** made, or +**
  • The change is made by an SQL trigger or foreign key action +** instead of directly as a result of a users SQL statement. +**
+** +** If a single row is affected by more than one operation within a session, +** then the change is considered indirect if all operations meet the criteria +** for an indirect change above, or direct otherwise. +** +** This function is used to set, clear or query the session object indirect +** flag. If the second argument passed to this function is zero, then the +** indirect flag is cleared. If it is greater than zero, the indirect flag +** is set. Passing a value less than zero does not modify the current value +** of the indirect flag, and may be used to query the current state of the +** indirect flag for the specified session object. +** +** The return value indicates the final state of the indirect flag: 0 if +** it is clear, or 1 if it is set. +*/ +SQLITE_API int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect); + +/* +** CAPI3REF: Attach A Table To A Session Object +** METHOD: sqlite3_session +** +** If argument zTab is not NULL, then it is the name of a table to attach +** to the session object passed as the first argument. All subsequent changes +** made to the table while the session object is enabled will be recorded. See +** documentation for [sqlite3session_changeset()] for further details. +** +** Or, if argument zTab is NULL, then changes are recorded for all tables +** in the database. If additional tables are added to the database (by +** executing "CREATE TABLE" statements) after this call is made, changes for +** the new tables are also recorded. +** +** Changes can only be recorded for tables that have a PRIMARY KEY explicitly +** defined as part of their CREATE TABLE statement. It does not matter if the +** PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias) or not. The PRIMARY +** KEY may consist of a single column, or may be a composite key. +** +** It is not an error if the named table does not exist in the database. Nor +** is it an error if the named table does not have a PRIMARY KEY. However, +** no changes will be recorded in either of these scenarios. +** +** Changes are not recorded for individual rows that have NULL values stored +** in one or more of their PRIMARY KEY columns. +** +** SQLITE_OK is returned if the call completes without error. Or, if an error +** occurs, an SQLite error code (e.g. SQLITE_NOMEM) is returned. +** +**

Special sqlite_stat1 Handling

+** +** As of SQLite version 3.22.0, the "sqlite_stat1" table is an exception to +** some of the rules above. In SQLite, the schema of sqlite_stat1 is: +**
+**        CREATE TABLE sqlite_stat1(tbl,idx,stat)  
+**  
+** +** Even though sqlite_stat1 does not have a PRIMARY KEY, changes are +** recorded for it as if the PRIMARY KEY is (tbl,idx). Additionally, changes +** are recorded for rows for which (idx IS NULL) is true. However, for such +** rows a zero-length blob (SQL value X'') is stored in the changeset or +** patchset instead of a NULL value. This allows such changesets to be +** manipulated by legacy implementations of sqlite3changeset_invert(), +** concat() and similar. +** +** The sqlite3changeset_apply() function automatically converts the +** zero-length blob back to a NULL value when updating the sqlite_stat1 +** table. However, if the application calls sqlite3changeset_new(), +** sqlite3changeset_old() or sqlite3changeset_conflict on a changeset +** iterator directly (including on a changeset iterator passed to a +** conflict-handler callback) then the X'' value is returned. The application +** must translate X'' to NULL itself if required. +** +** Legacy (older than 3.22.0) versions of the sessions module cannot capture +** changes made to the sqlite_stat1 table. Legacy versions of the +** sqlite3changeset_apply() function silently ignore any modifications to the +** sqlite_stat1 table that are part of a changeset or patchset. +*/ +SQLITE_API int sqlite3session_attach( + sqlite3_session *pSession, /* Session object */ + const char *zTab /* Table name */ +); + +/* +** CAPI3REF: Set a table filter on a Session Object. +** METHOD: sqlite3_session +** +** The second argument (xFilter) is the "filter callback". For changes to rows +** in tables that are not attached to the Session object, the filter is called +** to determine whether changes to the table's rows should be tracked or not. +** If xFilter returns 0, changes are not tracked. Note that once a table is +** attached, xFilter will not be called again. +*/ +SQLITE_API void sqlite3session_table_filter( + sqlite3_session *pSession, /* Session object */ + int(*xFilter)( + void *pCtx, /* Copy of third arg to _filter_table() */ + const char *zTab /* Table name */ + ), + void *pCtx /* First argument passed to xFilter */ +); + +/* +** CAPI3REF: Generate A Changeset From A Session Object +** METHOD: sqlite3_session +** +** Obtain a changeset containing changes to the tables attached to the +** session object passed as the first argument. If successful, +** set *ppChangeset to point to a buffer containing the changeset +** and *pnChangeset to the size of the changeset in bytes before returning +** SQLITE_OK. If an error occurs, set both *ppChangeset and *pnChangeset to +** zero and return an SQLite error code. +** +** A changeset consists of zero or more INSERT, UPDATE and/or DELETE changes, +** each representing a change to a single row of an attached table. An INSERT +** change contains the values of each field of a new database row. A DELETE +** contains the original values of each field of a deleted database row. An +** UPDATE change contains the original values of each field of an updated +** database row along with the updated values for each updated non-primary-key +** column. It is not possible for an UPDATE change to represent a change that +** modifies the values of primary key columns. If such a change is made, it +** is represented in a changeset as a DELETE followed by an INSERT. +** +** Changes are not recorded for rows that have NULL values stored in one or +** more of their PRIMARY KEY columns. If such a row is inserted or deleted, +** no corresponding change is present in the changesets returned by this +** function. If an existing row with one or more NULL values stored in +** PRIMARY KEY columns is updated so that all PRIMARY KEY columns are non-NULL, +** only an INSERT is appears in the changeset. Similarly, if an existing row +** with non-NULL PRIMARY KEY values is updated so that one or more of its +** PRIMARY KEY columns are set to NULL, the resulting changeset contains a +** DELETE change only. +** +** The contents of a changeset may be traversed using an iterator created +** using the [sqlite3changeset_start()] API. A changeset may be applied to +** a database with a compatible schema using the [sqlite3changeset_apply()] +** API. +** +** Within a changeset generated by this function, all changes related to a +** single table are grouped together. In other words, when iterating through +** a changeset or when applying a changeset to a database, all changes related +** to a single table are processed before moving on to the next table. Tables +** are sorted in the same order in which they were attached (or auto-attached) +** to the sqlite3_session object. The order in which the changes related to +** a single table are stored is undefined. +** +** Following a successful call to this function, it is the responsibility of +** the caller to eventually free the buffer that *ppChangeset points to using +** [sqlite3_free()]. +** +**

Changeset Generation

+** +** Once a table has been attached to a session object, the session object +** records the primary key values of all new rows inserted into the table. +** It also records the original primary key and other column values of any +** deleted or updated rows. For each unique primary key value, data is only +** recorded once - the first time a row with said primary key is inserted, +** updated or deleted in the lifetime of the session. +** +** There is one exception to the previous paragraph: when a row is inserted, +** updated or deleted, if one or more of its primary key columns contain a +** NULL value, no record of the change is made. +** +** The session object therefore accumulates two types of records - those +** that consist of primary key values only (created when the user inserts +** a new record) and those that consist of the primary key values and the +** original values of other table columns (created when the users deletes +** or updates a record). +** +** When this function is called, the requested changeset is created using +** both the accumulated records and the current contents of the database +** file. Specifically: +** +**
    +**
  • For each record generated by an insert, the database is queried +** for a row with a matching primary key. If one is found, an INSERT +** change is added to the changeset. If no such row is found, no change +** is added to the changeset. +** +**
  • For each record generated by an update or delete, the database is +** queried for a row with a matching primary key. If such a row is +** found and one or more of the non-primary key fields have been +** modified from their original values, an UPDATE change is added to +** the changeset. Or, if no such row is found in the table, a DELETE +** change is added to the changeset. If there is a row with a matching +** primary key in the database, but all fields contain their original +** values, no change is added to the changeset. +**
+** +** This means, amongst other things, that if a row is inserted and then later +** deleted while a session object is active, neither the insert nor the delete +** will be present in the changeset. Or if a row is deleted and then later a +** row with the same primary key values inserted while a session object is +** active, the resulting changeset will contain an UPDATE change instead of +** a DELETE and an INSERT. +** +** When a session object is disabled (see the [sqlite3session_enable()] API), +** it does not accumulate records when rows are inserted, updated or deleted. +** This may appear to have some counter-intuitive effects if a single row +** is written to more than once during a session. For example, if a row +** is inserted while a session object is enabled, then later deleted while +** the same session object is disabled, no INSERT record will appear in the +** changeset, even though the delete took place while the session was disabled. +** Or, if one field of a row is updated while a session is disabled, and +** another field of the same row is updated while the session is enabled, the +** resulting changeset will contain an UPDATE change that updates both fields. +*/ +SQLITE_API int sqlite3session_changeset( + sqlite3_session *pSession, /* Session object */ + int *pnChangeset, /* OUT: Size of buffer at *ppChangeset */ + void **ppChangeset /* OUT: Buffer containing changeset */ +); + +/* +** CAPI3REF: Load The Difference Between Tables Into A Session +** METHOD: sqlite3_session +** +** If it is not already attached to the session object passed as the first +** argument, this function attaches table zTbl in the same manner as the +** [sqlite3session_attach()] function. If zTbl does not exist, or if it +** does not have a primary key, this function is a no-op (but does not return +** an error). +** +** Argument zFromDb must be the name of a database ("main", "temp" etc.) +** attached to the same database handle as the session object that contains +** a table compatible with the table attached to the session by this function. +** A table is considered compatible if it: +** +**
    +**
  • Has the same name, +**
  • Has the same set of columns declared in the same order, and +**
  • Has the same PRIMARY KEY definition. +**
+** +** If the tables are not compatible, SQLITE_SCHEMA is returned. If the tables +** are compatible but do not have any PRIMARY KEY columns, it is not an error +** but no changes are added to the session object. As with other session +** APIs, tables without PRIMARY KEYs are simply ignored. +** +** This function adds a set of changes to the session object that could be +** used to update the table in database zFrom (call this the "from-table") +** so that its content is the same as the table attached to the session +** object (call this the "to-table"). Specifically: +** +**
    +**
  • For each row (primary key) that exists in the to-table but not in +** the from-table, an INSERT record is added to the session object. +** +**
  • For each row (primary key) that exists in the to-table but not in +** the from-table, a DELETE record is added to the session object. +** +**
  • For each row (primary key) that exists in both tables, but features +** different non-PK values in each, an UPDATE record is added to the +** session. +**
+** +** To clarify, if this function is called and then a changeset constructed +** using [sqlite3session_changeset()], then after applying that changeset to +** database zFrom the contents of the two compatible tables would be +** identical. +** +** It an error if database zFrom does not exist or does not contain the +** required compatible table. +** +** If the operation is successful, SQLITE_OK is returned. Otherwise, an SQLite +** error code. In this case, if argument pzErrMsg is not NULL, *pzErrMsg +** may be set to point to a buffer containing an English language error +** message. It is the responsibility of the caller to free this buffer using +** sqlite3_free(). +*/ +SQLITE_API int sqlite3session_diff( + sqlite3_session *pSession, + const char *zFromDb, + const char *zTbl, + char **pzErrMsg +); + + +/* +** CAPI3REF: Generate A Patchset From A Session Object +** METHOD: sqlite3_session +** +** The differences between a patchset and a changeset are that: +** +**
    +**
  • DELETE records consist of the primary key fields only. The +** original values of other fields are omitted. +**
  • The original values of any modified fields are omitted from +** UPDATE records. +**
+** +** A patchset blob may be used with up to date versions of all +** sqlite3changeset_xxx API functions except for sqlite3changeset_invert(), +** which returns SQLITE_CORRUPT if it is passed a patchset. Similarly, +** attempting to use a patchset blob with old versions of the +** sqlite3changeset_xxx APIs also provokes an SQLITE_CORRUPT error. +** +** Because the non-primary key "old.*" fields are omitted, no +** SQLITE_CHANGESET_DATA conflicts can be detected or reported if a patchset +** is passed to the sqlite3changeset_apply() API. Other conflict types work +** in the same way as for changesets. +** +** Changes within a patchset are ordered in the same way as for changesets +** generated by the sqlite3session_changeset() function (i.e. all changes for +** a single table are grouped together, tables appear in the order in which +** they were attached to the session object). +*/ +SQLITE_API int sqlite3session_patchset( + sqlite3_session *pSession, /* Session object */ + int *pnPatchset, /* OUT: Size of buffer at *ppPatchset */ + void **ppPatchset /* OUT: Buffer containing patchset */ +); + +/* +** CAPI3REF: Test if a changeset has recorded any changes. +** +** Return non-zero if no changes to attached tables have been recorded by +** the session object passed as the first argument. Otherwise, if one or +** more changes have been recorded, return zero. +** +** Even if this function returns zero, it is possible that calling +** [sqlite3session_changeset()] on the session handle may still return a +** changeset that contains no changes. This can happen when a row in +** an attached table is modified and then later on the original values +** are restored. However, if this function returns non-zero, then it is +** guaranteed that a call to sqlite3session_changeset() will return a +** changeset containing zero changes. +*/ +SQLITE_API int sqlite3session_isempty(sqlite3_session *pSession); + +/* +** CAPI3REF: Create An Iterator To Traverse A Changeset +** CONSTRUCTOR: sqlite3_changeset_iter +** +** Create an iterator used to iterate through the contents of a changeset. +** If successful, *pp is set to point to the iterator handle and SQLITE_OK +** is returned. Otherwise, if an error occurs, *pp is set to zero and an +** SQLite error code is returned. +** +** The following functions can be used to advance and query a changeset +** iterator created by this function: +** +**
    +**
  • [sqlite3changeset_next()] +**
  • [sqlite3changeset_op()] +**
  • [sqlite3changeset_new()] +**
  • [sqlite3changeset_old()] +**
+** +** It is the responsibility of the caller to eventually destroy the iterator +** by passing it to [sqlite3changeset_finalize()]. The buffer containing the +** changeset (pChangeset) must remain valid until after the iterator is +** destroyed. +** +** Assuming the changeset blob was created by one of the +** [sqlite3session_changeset()], [sqlite3changeset_concat()] or +** [sqlite3changeset_invert()] functions, all changes within the changeset +** that apply to a single table are grouped together. This means that when +** an application iterates through a changeset using an iterator created by +** this function, all changes that relate to a single table are visited +** consecutively. There is no chance that the iterator will visit a change +** the applies to table X, then one for table Y, and then later on visit +** another change for table X. +** +** The behavior of sqlite3changeset_start_v2() and its streaming equivalent +** may be modified by passing a combination of +** [SQLITE_CHANGESETSTART_INVERT | supported flags] as the 4th parameter. +** +** Note that the sqlite3changeset_start_v2() API is still experimental +** and therefore subject to change. +*/ +SQLITE_API int sqlite3changeset_start( + sqlite3_changeset_iter **pp, /* OUT: New changeset iterator handle */ + int nChangeset, /* Size of changeset blob in bytes */ + void *pChangeset /* Pointer to blob containing changeset */ +); +SQLITE_API int sqlite3changeset_start_v2( + sqlite3_changeset_iter **pp, /* OUT: New changeset iterator handle */ + int nChangeset, /* Size of changeset blob in bytes */ + void *pChangeset, /* Pointer to blob containing changeset */ + int flags /* SESSION_CHANGESETSTART_* flags */ +); + +/* +** CAPI3REF: Flags for sqlite3changeset_start_v2 +** +** The following flags may passed via the 4th parameter to +** [sqlite3changeset_start_v2] and [sqlite3changeset_start_v2_strm]: +** +**
SQLITE_CHANGESETAPPLY_INVERT
+** Invert the changeset while iterating through it. This is equivalent to +** inverting a changeset using sqlite3changeset_invert() before applying it. +** It is an error to specify this flag with a patchset. +*/ +#define SQLITE_CHANGESETSTART_INVERT 0x0002 + + +/* +** CAPI3REF: Advance A Changeset Iterator +** METHOD: sqlite3_changeset_iter +** +** This function may only be used with iterators created by the function +** [sqlite3changeset_start()]. If it is called on an iterator passed to +** a conflict-handler callback by [sqlite3changeset_apply()], SQLITE_MISUSE +** is returned and the call has no effect. +** +** Immediately after an iterator is created by sqlite3changeset_start(), it +** does not point to any change in the changeset. Assuming the changeset +** is not empty, the first call to this function advances the iterator to +** point to the first change in the changeset. Each subsequent call advances +** the iterator to point to the next change in the changeset (if any). If +** no error occurs and the iterator points to a valid change after a call +** to sqlite3changeset_next() has advanced it, SQLITE_ROW is returned. +** Otherwise, if all changes in the changeset have already been visited, +** SQLITE_DONE is returned. +** +** If an error occurs, an SQLite error code is returned. Possible error +** codes include SQLITE_CORRUPT (if the changeset buffer is corrupt) or +** SQLITE_NOMEM. +*/ +SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter *pIter); + +/* +** CAPI3REF: Obtain The Current Operation From A Changeset Iterator +** METHOD: sqlite3_changeset_iter +** +** The pIter argument passed to this function may either be an iterator +** passed to a conflict-handler by [sqlite3changeset_apply()], or an iterator +** created by [sqlite3changeset_start()]. In the latter case, the most recent +** call to [sqlite3changeset_next()] must have returned [SQLITE_ROW]. If this +** is not the case, this function returns [SQLITE_MISUSE]. +** +** If argument pzTab is not NULL, then *pzTab is set to point to a +** nul-terminated utf-8 encoded string containing the name of the table +** affected by the current change. The buffer remains valid until either +** sqlite3changeset_next() is called on the iterator or until the +** conflict-handler function returns. If pnCol is not NULL, then *pnCol is +** set to the number of columns in the table affected by the change. If +** pbIndirect is not NULL, then *pbIndirect is set to true (1) if the change +** is an indirect change, or false (0) otherwise. See the documentation for +** [sqlite3session_indirect()] for a description of direct and indirect +** changes. Finally, if pOp is not NULL, then *pOp is set to one of +** [SQLITE_INSERT], [SQLITE_DELETE] or [SQLITE_UPDATE], depending on the +** type of change that the iterator currently points to. +** +** If no error occurs, SQLITE_OK is returned. If an error does occur, an +** SQLite error code is returned. The values of the output variables may not +** be trusted in this case. +*/ +SQLITE_API int sqlite3changeset_op( + sqlite3_changeset_iter *pIter, /* Iterator object */ + const char **pzTab, /* OUT: Pointer to table name */ + int *pnCol, /* OUT: Number of columns in table */ + int *pOp, /* OUT: SQLITE_INSERT, DELETE or UPDATE */ + int *pbIndirect /* OUT: True for an 'indirect' change */ +); + +/* +** CAPI3REF: Obtain The Primary Key Definition Of A Table +** METHOD: sqlite3_changeset_iter +** +** For each modified table, a changeset includes the following: +** +**
    +**
  • The number of columns in the table, and +**
  • Which of those columns make up the tables PRIMARY KEY. +**
+** +** This function is used to find which columns comprise the PRIMARY KEY of +** the table modified by the change that iterator pIter currently points to. +** If successful, *pabPK is set to point to an array of nCol entries, where +** nCol is the number of columns in the table. Elements of *pabPK are set to +** 0x01 if the corresponding column is part of the tables primary key, or +** 0x00 if it is not. +** +** If argument pnCol is not NULL, then *pnCol is set to the number of columns +** in the table. +** +** If this function is called when the iterator does not point to a valid +** entry, SQLITE_MISUSE is returned and the output variables zeroed. Otherwise, +** SQLITE_OK is returned and the output variables populated as described +** above. +*/ +SQLITE_API int sqlite3changeset_pk( + sqlite3_changeset_iter *pIter, /* Iterator object */ + unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */ + int *pnCol /* OUT: Number of entries in output array */ +); + +/* +** CAPI3REF: Obtain old.* Values From A Changeset Iterator +** METHOD: sqlite3_changeset_iter +** +** The pIter argument passed to this function may either be an iterator +** passed to a conflict-handler by [sqlite3changeset_apply()], or an iterator +** created by [sqlite3changeset_start()]. In the latter case, the most recent +** call to [sqlite3changeset_next()] must have returned SQLITE_ROW. +** Furthermore, it may only be called if the type of change that the iterator +** currently points to is either [SQLITE_DELETE] or [SQLITE_UPDATE]. Otherwise, +** this function returns [SQLITE_MISUSE] and sets *ppValue to NULL. +** +** Argument iVal must be greater than or equal to 0, and less than the number +** of columns in the table affected by the current change. Otherwise, +** [SQLITE_RANGE] is returned and *ppValue is set to NULL. +** +** If successful, this function sets *ppValue to point to a protected +** sqlite3_value object containing the iVal'th value from the vector of +** original row values stored as part of the UPDATE or DELETE change and +** returns SQLITE_OK. The name of the function comes from the fact that this +** is similar to the "old.*" columns available to update or delete triggers. +** +** If some other error occurs (e.g. an OOM condition), an SQLite error code +** is returned and *ppValue is set to NULL. +*/ +SQLITE_API int sqlite3changeset_old( + sqlite3_changeset_iter *pIter, /* Changeset iterator */ + int iVal, /* Column number */ + sqlite3_value **ppValue /* OUT: Old value (or NULL pointer) */ +); + +/* +** CAPI3REF: Obtain new.* Values From A Changeset Iterator +** METHOD: sqlite3_changeset_iter +** +** The pIter argument passed to this function may either be an iterator +** passed to a conflict-handler by [sqlite3changeset_apply()], or an iterator +** created by [sqlite3changeset_start()]. In the latter case, the most recent +** call to [sqlite3changeset_next()] must have returned SQLITE_ROW. +** Furthermore, it may only be called if the type of change that the iterator +** currently points to is either [SQLITE_UPDATE] or [SQLITE_INSERT]. Otherwise, +** this function returns [SQLITE_MISUSE] and sets *ppValue to NULL. +** +** Argument iVal must be greater than or equal to 0, and less than the number +** of columns in the table affected by the current change. Otherwise, +** [SQLITE_RANGE] is returned and *ppValue is set to NULL. +** +** If successful, this function sets *ppValue to point to a protected +** sqlite3_value object containing the iVal'th value from the vector of +** new row values stored as part of the UPDATE or INSERT change and +** returns SQLITE_OK. If the change is an UPDATE and does not include +** a new value for the requested column, *ppValue is set to NULL and +** SQLITE_OK returned. The name of the function comes from the fact that +** this is similar to the "new.*" columns available to update or delete +** triggers. +** +** If some other error occurs (e.g. an OOM condition), an SQLite error code +** is returned and *ppValue is set to NULL. +*/ +SQLITE_API int sqlite3changeset_new( + sqlite3_changeset_iter *pIter, /* Changeset iterator */ + int iVal, /* Column number */ + sqlite3_value **ppValue /* OUT: New value (or NULL pointer) */ +); + +/* +** CAPI3REF: Obtain Conflicting Row Values From A Changeset Iterator +** METHOD: sqlite3_changeset_iter +** +** This function should only be used with iterator objects passed to a +** conflict-handler callback by [sqlite3changeset_apply()] with either +** [SQLITE_CHANGESET_DATA] or [SQLITE_CHANGESET_CONFLICT]. If this function +** is called on any other iterator, [SQLITE_MISUSE] is returned and *ppValue +** is set to NULL. +** +** Argument iVal must be greater than or equal to 0, and less than the number +** of columns in the table affected by the current change. Otherwise, +** [SQLITE_RANGE] is returned and *ppValue is set to NULL. +** +** If successful, this function sets *ppValue to point to a protected +** sqlite3_value object containing the iVal'th value from the +** "conflicting row" associated with the current conflict-handler callback +** and returns SQLITE_OK. +** +** If some other error occurs (e.g. an OOM condition), an SQLite error code +** is returned and *ppValue is set to NULL. +*/ +SQLITE_API int sqlite3changeset_conflict( + sqlite3_changeset_iter *pIter, /* Changeset iterator */ + int iVal, /* Column number */ + sqlite3_value **ppValue /* OUT: Value from conflicting row */ +); + +/* +** CAPI3REF: Determine The Number Of Foreign Key Constraint Violations +** METHOD: sqlite3_changeset_iter +** +** This function may only be called with an iterator passed to an +** SQLITE_CHANGESET_FOREIGN_KEY conflict handler callback. In this case +** it sets the output variable to the total number of known foreign key +** violations in the destination database and returns SQLITE_OK. +** +** In all other cases this function returns SQLITE_MISUSE. +*/ +SQLITE_API int sqlite3changeset_fk_conflicts( + sqlite3_changeset_iter *pIter, /* Changeset iterator */ + int *pnOut /* OUT: Number of FK violations */ +); + + +/* +** CAPI3REF: Finalize A Changeset Iterator +** METHOD: sqlite3_changeset_iter +** +** This function is used to finalize an iterator allocated with +** [sqlite3changeset_start()]. +** +** This function should only be called on iterators created using the +** [sqlite3changeset_start()] function. If an application calls this +** function with an iterator passed to a conflict-handler by +** [sqlite3changeset_apply()], [SQLITE_MISUSE] is immediately returned and the +** call has no effect. +** +** If an error was encountered within a call to an sqlite3changeset_xxx() +** function (for example an [SQLITE_CORRUPT] in [sqlite3changeset_next()] or an +** [SQLITE_NOMEM] in [sqlite3changeset_new()]) then an error code corresponding +** to that error is returned by this function. Otherwise, SQLITE_OK is +** returned. This is to allow the following pattern (pseudo-code): +** +**
+**   sqlite3changeset_start();
+**   while( SQLITE_ROW==sqlite3changeset_next() ){
+**     // Do something with change.
+**   }
+**   rc = sqlite3changeset_finalize();
+**   if( rc!=SQLITE_OK ){
+**     // An error has occurred 
+**   }
+** 
+*/ +SQLITE_API int sqlite3changeset_finalize(sqlite3_changeset_iter *pIter); + +/* +** CAPI3REF: Invert A Changeset +** +** This function is used to "invert" a changeset object. Applying an inverted +** changeset to a database reverses the effects of applying the uninverted +** changeset. Specifically: +** +**
    +**
  • Each DELETE change is changed to an INSERT, and +**
  • Each INSERT change is changed to a DELETE, and +**
  • For each UPDATE change, the old.* and new.* values are exchanged. +**
+** +** This function does not change the order in which changes appear within +** the changeset. It merely reverses the sense of each individual change. +** +** If successful, a pointer to a buffer containing the inverted changeset +** is stored in *ppOut, the size of the same buffer is stored in *pnOut, and +** SQLITE_OK is returned. If an error occurs, both *pnOut and *ppOut are +** zeroed and an SQLite error code returned. +** +** It is the responsibility of the caller to eventually call sqlite3_free() +** on the *ppOut pointer to free the buffer allocation following a successful +** call to this function. +** +** WARNING/TODO: This function currently assumes that the input is a valid +** changeset. If it is not, the results are undefined. +*/ +SQLITE_API int sqlite3changeset_invert( + int nIn, const void *pIn, /* Input changeset */ + int *pnOut, void **ppOut /* OUT: Inverse of input */ +); + +/* +** CAPI3REF: Concatenate Two Changeset Objects +** +** This function is used to concatenate two changesets, A and B, into a +** single changeset. The result is a changeset equivalent to applying +** changeset A followed by changeset B. +** +** This function combines the two input changesets using an +** sqlite3_changegroup object. Calling it produces similar results as the +** following code fragment: +** +**
+**   sqlite3_changegroup *pGrp;
+**   rc = sqlite3_changegroup_new(&pGrp);
+**   if( rc==SQLITE_OK ) rc = sqlite3changegroup_add(pGrp, nA, pA);
+**   if( rc==SQLITE_OK ) rc = sqlite3changegroup_add(pGrp, nB, pB);
+**   if( rc==SQLITE_OK ){
+**     rc = sqlite3changegroup_output(pGrp, pnOut, ppOut);
+**   }else{
+**     *ppOut = 0;
+**     *pnOut = 0;
+**   }
+** 
+** +** Refer to the sqlite3_changegroup documentation below for details. +*/ +SQLITE_API int sqlite3changeset_concat( + int nA, /* Number of bytes in buffer pA */ + void *pA, /* Pointer to buffer containing changeset A */ + int nB, /* Number of bytes in buffer pB */ + void *pB, /* Pointer to buffer containing changeset B */ + int *pnOut, /* OUT: Number of bytes in output changeset */ + void **ppOut /* OUT: Buffer containing output changeset */ +); + + +/* +** CAPI3REF: Changegroup Handle +** +** A changegroup is an object used to combine two or more +** [changesets] or [patchsets] +*/ +typedef struct sqlite3_changegroup sqlite3_changegroup; + +/* +** CAPI3REF: Create A New Changegroup Object +** CONSTRUCTOR: sqlite3_changegroup +** +** An sqlite3_changegroup object is used to combine two or more changesets +** (or patchsets) into a single changeset (or patchset). A single changegroup +** object may combine changesets or patchsets, but not both. The output is +** always in the same format as the input. +** +** If successful, this function returns SQLITE_OK and populates (*pp) with +** a pointer to a new sqlite3_changegroup object before returning. The caller +** should eventually free the returned object using a call to +** sqlite3changegroup_delete(). If an error occurs, an SQLite error code +** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL. +** +** The usual usage pattern for an sqlite3_changegroup object is as follows: +** +**
    +**
  • It is created using a call to sqlite3changegroup_new(). +** +**
  • Zero or more changesets (or patchsets) are added to the object +** by calling sqlite3changegroup_add(). +** +**
  • The result of combining all input changesets together is obtained +** by the application via a call to sqlite3changegroup_output(). +** +**
  • The object is deleted using a call to sqlite3changegroup_delete(). +**
+** +** Any number of calls to add() and output() may be made between the calls to +** new() and delete(), and in any order. +** +** As well as the regular sqlite3changegroup_add() and +** sqlite3changegroup_output() functions, also available are the streaming +** versions sqlite3changegroup_add_strm() and sqlite3changegroup_output_strm(). +*/ +SQLITE_API int sqlite3changegroup_new(sqlite3_changegroup **pp); + +/* +** CAPI3REF: Add A Changeset To A Changegroup +** METHOD: sqlite3_changegroup +** +** Add all changes within the changeset (or patchset) in buffer pData (size +** nData bytes) to the changegroup. +** +** If the buffer contains a patchset, then all prior calls to this function +** on the same changegroup object must also have specified patchsets. Or, if +** the buffer contains a changeset, so must have the earlier calls to this +** function. Otherwise, SQLITE_ERROR is returned and no changes are added +** to the changegroup. +** +** Rows within the changeset and changegroup are identified by the values in +** their PRIMARY KEY columns. A change in the changeset is considered to +** apply to the same row as a change already present in the changegroup if +** the two rows have the same primary key. +** +** Changes to rows that do not already appear in the changegroup are +** simply copied into it. Or, if both the new changeset and the changegroup +** contain changes that apply to a single row, the final contents of the +** changegroup depends on the type of each change, as follows: +** +** +** +** +**
Existing Change New Change Output Change +**
INSERT INSERT +** The new change is ignored. This case does not occur if the new +** changeset was recorded immediately after the changesets already +** added to the changegroup. +**
INSERT UPDATE +** The INSERT change remains in the changegroup. The values in the +** INSERT change are modified as if the row was inserted by the +** existing change and then updated according to the new change. +**
INSERT DELETE +** The existing INSERT is removed from the changegroup. The DELETE is +** not added. +**
UPDATE INSERT +** The new change is ignored. This case does not occur if the new +** changeset was recorded immediately after the changesets already +** added to the changegroup. +**
UPDATE UPDATE +** The existing UPDATE remains within the changegroup. It is amended +** so that the accompanying values are as if the row was updated once +** by the existing change and then again by the new change. +**
UPDATE DELETE +** The existing UPDATE is replaced by the new DELETE within the +** changegroup. +**
DELETE INSERT +** If one or more of the column values in the row inserted by the +** new change differ from those in the row deleted by the existing +** change, the existing DELETE is replaced by an UPDATE within the +** changegroup. Otherwise, if the inserted row is exactly the same +** as the deleted row, the existing DELETE is simply discarded. +**
DELETE UPDATE +** The new change is ignored. This case does not occur if the new +** changeset was recorded immediately after the changesets already +** added to the changegroup. +**
DELETE DELETE +** The new change is ignored. This case does not occur if the new +** changeset was recorded immediately after the changesets already +** added to the changegroup. +**
+** +** If the new changeset contains changes to a table that is already present +** in the changegroup, then the number of columns and the position of the +** primary key columns for the table must be consistent. If this is not the +** case, this function fails with SQLITE_SCHEMA. If the input changeset +** appears to be corrupt and the corruption is detected, SQLITE_CORRUPT is +** returned. Or, if an out-of-memory condition occurs during processing, this +** function returns SQLITE_NOMEM. In all cases, if an error occurs the state +** of the final contents of the changegroup is undefined. +** +** If no error occurs, SQLITE_OK is returned. +*/ +SQLITE_API int sqlite3changegroup_add(sqlite3_changegroup*, int nData, void *pData); + +/* +** CAPI3REF: Obtain A Composite Changeset From A Changegroup +** METHOD: sqlite3_changegroup +** +** Obtain a buffer containing a changeset (or patchset) representing the +** current contents of the changegroup. If the inputs to the changegroup +** were themselves changesets, the output is a changeset. Or, if the +** inputs were patchsets, the output is also a patchset. +** +** As with the output of the sqlite3session_changeset() and +** sqlite3session_patchset() functions, all changes related to a single +** table are grouped together in the output of this function. Tables appear +** in the same order as for the very first changeset added to the changegroup. +** If the second or subsequent changesets added to the changegroup contain +** changes for tables that do not appear in the first changeset, they are +** appended onto the end of the output changeset, again in the order in +** which they are first encountered. +** +** If an error occurs, an SQLite error code is returned and the output +** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK +** is returned and the output variables are set to the size of and a +** pointer to the output buffer, respectively. In this case it is the +** responsibility of the caller to eventually free the buffer using a +** call to sqlite3_free(). +*/ +SQLITE_API int sqlite3changegroup_output( + sqlite3_changegroup*, + int *pnData, /* OUT: Size of output buffer in bytes */ + void **ppData /* OUT: Pointer to output buffer */ +); + +/* +** CAPI3REF: Delete A Changegroup Object +** DESTRUCTOR: sqlite3_changegroup +*/ +SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*); + +/* +** CAPI3REF: Apply A Changeset To A Database +** +** Apply a changeset or patchset to a database. These functions attempt to +** update the "main" database attached to handle db with the changes found in +** the changeset passed via the second and third arguments. +** +** The fourth argument (xFilter) passed to these functions is the "filter +** callback". If it is not NULL, then for each table affected by at least one +** change in the changeset, the filter callback is invoked with +** the table name as the second argument, and a copy of the context pointer +** passed as the sixth argument as the first. If the "filter callback" +** returns zero, then no attempt is made to apply any changes to the table. +** Otherwise, if the return value is non-zero or the xFilter argument to +** is NULL, all changes related to the table are attempted. +** +** For each table that is not excluded by the filter callback, this function +** tests that the target database contains a compatible table. A table is +** considered compatible if all of the following are true: +** +**
    +**
  • The table has the same name as the name recorded in the +** changeset, and +**
  • The table has at least as many columns as recorded in the +** changeset, and +**
  • The table has primary key columns in the same position as +** recorded in the changeset. +**
+** +** If there is no compatible table, it is not an error, but none of the +** changes associated with the table are applied. A warning message is issued +** via the sqlite3_log() mechanism with the error code SQLITE_SCHEMA. At most +** one such warning is issued for each table in the changeset. +** +** For each change for which there is a compatible table, an attempt is made +** to modify the table contents according to the UPDATE, INSERT or DELETE +** change. If a change cannot be applied cleanly, the conflict handler +** function passed as the fifth argument to sqlite3changeset_apply() may be +** invoked. A description of exactly when the conflict handler is invoked for +** each type of change is below. +** +** Unlike the xFilter argument, xConflict may not be passed NULL. The results +** of passing anything other than a valid function pointer as the xConflict +** argument are undefined. +** +** Each time the conflict handler function is invoked, it must return one +** of [SQLITE_CHANGESET_OMIT], [SQLITE_CHANGESET_ABORT] or +** [SQLITE_CHANGESET_REPLACE]. SQLITE_CHANGESET_REPLACE may only be returned +** if the second argument passed to the conflict handler is either +** SQLITE_CHANGESET_DATA or SQLITE_CHANGESET_CONFLICT. If the conflict-handler +** returns an illegal value, any changes already made are rolled back and +** the call to sqlite3changeset_apply() returns SQLITE_MISUSE. Different +** actions are taken by sqlite3changeset_apply() depending on the value +** returned by each invocation of the conflict-handler function. Refer to +** the documentation for the three +** [SQLITE_CHANGESET_OMIT|available return values] for details. +** +**
+**
DELETE Changes
+** For each DELETE change, the function checks if the target database +** contains a row with the same primary key value (or values) as the +** original row values stored in the changeset. If it does, and the values +** stored in all non-primary key columns also match the values stored in +** the changeset the row is deleted from the target database. +** +** If a row with matching primary key values is found, but one or more of +** the non-primary key fields contains a value different from the original +** row value stored in the changeset, the conflict-handler function is +** invoked with [SQLITE_CHANGESET_DATA] as the second argument. If the +** database table has more columns than are recorded in the changeset, +** only the values of those non-primary key fields are compared against +** the current database contents - any trailing database table columns +** are ignored. +** +** If no row with matching primary key values is found in the database, +** the conflict-handler function is invoked with [SQLITE_CHANGESET_NOTFOUND] +** passed as the second argument. +** +** If the DELETE operation is attempted, but SQLite returns SQLITE_CONSTRAINT +** (which can only happen if a foreign key constraint is violated), the +** conflict-handler function is invoked with [SQLITE_CHANGESET_CONSTRAINT] +** passed as the second argument. This includes the case where the DELETE +** operation is attempted because an earlier call to the conflict handler +** function returned [SQLITE_CHANGESET_REPLACE]. +** +**
INSERT Changes
+** For each INSERT change, an attempt is made to insert the new row into +** the database. If the changeset row contains fewer fields than the +** database table, the trailing fields are populated with their default +** values. +** +** If the attempt to insert the row fails because the database already +** contains a row with the same primary key values, the conflict handler +** function is invoked with the second argument set to +** [SQLITE_CHANGESET_CONFLICT]. +** +** If the attempt to insert the row fails because of some other constraint +** violation (e.g. NOT NULL or UNIQUE), the conflict handler function is +** invoked with the second argument set to [SQLITE_CHANGESET_CONSTRAINT]. +** This includes the case where the INSERT operation is re-attempted because +** an earlier call to the conflict handler function returned +** [SQLITE_CHANGESET_REPLACE]. +** +**
UPDATE Changes
+** For each UPDATE change, the function checks if the target database +** contains a row with the same primary key value (or values) as the +** original row values stored in the changeset. If it does, and the values +** stored in all modified non-primary key columns also match the values +** stored in the changeset the row is updated within the target database. +** +** If a row with matching primary key values is found, but one or more of +** the modified non-primary key fields contains a value different from an +** original row value stored in the changeset, the conflict-handler function +** is invoked with [SQLITE_CHANGESET_DATA] as the second argument. Since +** UPDATE changes only contain values for non-primary key fields that are +** to be modified, only those fields need to match the original values to +** avoid the SQLITE_CHANGESET_DATA conflict-handler callback. +** +** If no row with matching primary key values is found in the database, +** the conflict-handler function is invoked with [SQLITE_CHANGESET_NOTFOUND] +** passed as the second argument. +** +** If the UPDATE operation is attempted, but SQLite returns +** SQLITE_CONSTRAINT, the conflict-handler function is invoked with +** [SQLITE_CHANGESET_CONSTRAINT] passed as the second argument. +** This includes the case where the UPDATE operation is attempted after +** an earlier call to the conflict handler function returned +** [SQLITE_CHANGESET_REPLACE]. +**
+** +** It is safe to execute SQL statements, including those that write to the +** table that the callback related to, from within the xConflict callback. +** This can be used to further customize the application's conflict +** resolution strategy. +** +** All changes made by these functions are enclosed in a savepoint transaction. +** If any other error (aside from a constraint failure when attempting to +** write to the target database) occurs, then the savepoint transaction is +** rolled back, restoring the target database to its original state, and an +** SQLite error code returned. +** +** If the output parameters (ppRebase) and (pnRebase) are non-NULL and +** the input is a changeset (not a patchset), then sqlite3changeset_apply_v2() +** may set (*ppRebase) to point to a "rebase" that may be used with the +** sqlite3_rebaser APIs buffer before returning. In this case (*pnRebase) +** is set to the size of the buffer in bytes. It is the responsibility of the +** caller to eventually free any such buffer using sqlite3_free(). The buffer +** is only allocated and populated if one or more conflicts were encountered +** while applying the patchset. See comments surrounding the sqlite3_rebaser +** APIs for further details. +** +** The behavior of sqlite3changeset_apply_v2() and its streaming equivalent +** may be modified by passing a combination of +** [SQLITE_CHANGESETAPPLY_NOSAVEPOINT | supported flags] as the 9th parameter. +** +** Note that the sqlite3changeset_apply_v2() API is still experimental +** and therefore subject to change. +*/ +SQLITE_API int sqlite3changeset_apply( + sqlite3 *db, /* Apply change to "main" db of this handle */ + int nChangeset, /* Size of changeset in bytes */ + void *pChangeset, /* Changeset blob */ + int(*xFilter)( + void *pCtx, /* Copy of sixth arg to _apply() */ + const char *zTab /* Table name */ + ), + int(*xConflict)( + void *pCtx, /* Copy of sixth arg to _apply() */ + int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ + sqlite3_changeset_iter *p /* Handle describing change and conflict */ + ), + void *pCtx /* First argument passed to xConflict */ +); +SQLITE_API int sqlite3changeset_apply_v2( + sqlite3 *db, /* Apply change to "main" db of this handle */ + int nChangeset, /* Size of changeset in bytes */ + void *pChangeset, /* Changeset blob */ + int(*xFilter)( + void *pCtx, /* Copy of sixth arg to _apply() */ + const char *zTab /* Table name */ + ), + int(*xConflict)( + void *pCtx, /* Copy of sixth arg to _apply() */ + int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ + sqlite3_changeset_iter *p /* Handle describing change and conflict */ + ), + void *pCtx, /* First argument passed to xConflict */ + void **ppRebase, int *pnRebase, /* OUT: Rebase data */ + int flags /* SESSION_CHANGESETAPPLY_* flags */ +); + +/* +** CAPI3REF: Flags for sqlite3changeset_apply_v2 +** +** The following flags may passed via the 9th parameter to +** [sqlite3changeset_apply_v2] and [sqlite3changeset_apply_v2_strm]: +** +**
+**
SQLITE_CHANGESETAPPLY_NOSAVEPOINT
+** Usually, the sessions module encloses all operations performed by +** a single call to apply_v2() or apply_v2_strm() in a [SAVEPOINT]. The +** SAVEPOINT is committed if the changeset or patchset is successfully +** applied, or rolled back if an error occurs. Specifying this flag +** causes the sessions module to omit this savepoint. In this case, if the +** caller has an open transaction or savepoint when apply_v2() is called, +** it may revert the partially applied changeset by rolling it back. +** +**
SQLITE_CHANGESETAPPLY_INVERT
+** Invert the changeset before applying it. This is equivalent to inverting +** a changeset using sqlite3changeset_invert() before applying it. It is +** an error to specify this flag with a patchset. +*/ +#define SQLITE_CHANGESETAPPLY_NOSAVEPOINT 0x0001 +#define SQLITE_CHANGESETAPPLY_INVERT 0x0002 + +/* +** CAPI3REF: Constants Passed To The Conflict Handler +** +** Values that may be passed as the second argument to a conflict-handler. +** +**
+**
SQLITE_CHANGESET_DATA
+** The conflict handler is invoked with CHANGESET_DATA as the second argument +** when processing a DELETE or UPDATE change if a row with the required +** PRIMARY KEY fields is present in the database, but one or more other +** (non primary-key) fields modified by the update do not contain the +** expected "before" values. +** +** The conflicting row, in this case, is the database row with the matching +** primary key. +** +**
SQLITE_CHANGESET_NOTFOUND
+** The conflict handler is invoked with CHANGESET_NOTFOUND as the second +** argument when processing a DELETE or UPDATE change if a row with the +** required PRIMARY KEY fields is not present in the database. +** +** There is no conflicting row in this case. The results of invoking the +** sqlite3changeset_conflict() API are undefined. +** +**
SQLITE_CHANGESET_CONFLICT
+** CHANGESET_CONFLICT is passed as the second argument to the conflict +** handler while processing an INSERT change if the operation would result +** in duplicate primary key values. +** +** The conflicting row in this case is the database row with the matching +** primary key. +** +**
SQLITE_CHANGESET_FOREIGN_KEY
+** If foreign key handling is enabled, and applying a changeset leaves the +** database in a state containing foreign key violations, the conflict +** handler is invoked with CHANGESET_FOREIGN_KEY as the second argument +** exactly once before the changeset is committed. If the conflict handler +** returns CHANGESET_OMIT, the changes, including those that caused the +** foreign key constraint violation, are committed. Or, if it returns +** CHANGESET_ABORT, the changeset is rolled back. +** +** No current or conflicting row information is provided. The only function +** it is possible to call on the supplied sqlite3_changeset_iter handle +** is sqlite3changeset_fk_conflicts(). +** +**
SQLITE_CHANGESET_CONSTRAINT
+** If any other constraint violation occurs while applying a change (i.e. +** a UNIQUE, CHECK or NOT NULL constraint), the conflict handler is +** invoked with CHANGESET_CONSTRAINT as the second argument. +** +** There is no conflicting row in this case. The results of invoking the +** sqlite3changeset_conflict() API are undefined. +** +**
+*/ +#define SQLITE_CHANGESET_DATA 1 +#define SQLITE_CHANGESET_NOTFOUND 2 +#define SQLITE_CHANGESET_CONFLICT 3 +#define SQLITE_CHANGESET_CONSTRAINT 4 +#define SQLITE_CHANGESET_FOREIGN_KEY 5 + +/* +** CAPI3REF: Constants Returned By The Conflict Handler +** +** A conflict handler callback must return one of the following three values. +** +**
+**
SQLITE_CHANGESET_OMIT
+** If a conflict handler returns this value no special action is taken. The +** change that caused the conflict is not applied. The session module +** continues to the next change in the changeset. +** +**
SQLITE_CHANGESET_REPLACE
+** This value may only be returned if the second argument to the conflict +** handler was SQLITE_CHANGESET_DATA or SQLITE_CHANGESET_CONFLICT. If this +** is not the case, any changes applied so far are rolled back and the +** call to sqlite3changeset_apply() returns SQLITE_MISUSE. +** +** If CHANGESET_REPLACE is returned by an SQLITE_CHANGESET_DATA conflict +** handler, then the conflicting row is either updated or deleted, depending +** on the type of change. +** +** If CHANGESET_REPLACE is returned by an SQLITE_CHANGESET_CONFLICT conflict +** handler, then the conflicting row is removed from the database and a +** second attempt to apply the change is made. If this second attempt fails, +** the original row is restored to the database before continuing. +** +**
SQLITE_CHANGESET_ABORT
+** If this value is returned, any changes applied so far are rolled back +** and the call to sqlite3changeset_apply() returns SQLITE_ABORT. +**
+*/ +#define SQLITE_CHANGESET_OMIT 0 +#define SQLITE_CHANGESET_REPLACE 1 +#define SQLITE_CHANGESET_ABORT 2 + +/* +** CAPI3REF: Rebasing changesets +** EXPERIMENTAL +** +** Suppose there is a site hosting a database in state S0. And that +** modifications are made that move that database to state S1 and a +** changeset recorded (the "local" changeset). Then, a changeset based +** on S0 is received from another site (the "remote" changeset) and +** applied to the database. The database is then in state +** (S1+"remote"), where the exact state depends on any conflict +** resolution decisions (OMIT or REPLACE) made while applying "remote". +** Rebasing a changeset is to update it to take those conflict +** resolution decisions into account, so that the same conflicts +** do not have to be resolved elsewhere in the network. +** +** For example, if both the local and remote changesets contain an +** INSERT of the same key on "CREATE TABLE t1(a PRIMARY KEY, b)": +** +** local: INSERT INTO t1 VALUES(1, 'v1'); +** remote: INSERT INTO t1 VALUES(1, 'v2'); +** +** and the conflict resolution is REPLACE, then the INSERT change is +** removed from the local changeset (it was overridden). Or, if the +** conflict resolution was "OMIT", then the local changeset is modified +** to instead contain: +** +** UPDATE t1 SET b = 'v2' WHERE a=1; +** +** Changes within the local changeset are rebased as follows: +** +**
+**
Local INSERT
+** This may only conflict with a remote INSERT. If the conflict +** resolution was OMIT, then add an UPDATE change to the rebased +** changeset. Or, if the conflict resolution was REPLACE, add +** nothing to the rebased changeset. +** +**
Local DELETE
+** This may conflict with a remote UPDATE or DELETE. In both cases the +** only possible resolution is OMIT. If the remote operation was a +** DELETE, then add no change to the rebased changeset. If the remote +** operation was an UPDATE, then the old.* fields of change are updated +** to reflect the new.* values in the UPDATE. +** +**
Local UPDATE
+** This may conflict with a remote UPDATE or DELETE. If it conflicts +** with a DELETE, and the conflict resolution was OMIT, then the update +** is changed into an INSERT. Any undefined values in the new.* record +** from the update change are filled in using the old.* values from +** the conflicting DELETE. Or, if the conflict resolution was REPLACE, +** the UPDATE change is simply omitted from the rebased changeset. +** +** If conflict is with a remote UPDATE and the resolution is OMIT, then +** the old.* values are rebased using the new.* values in the remote +** change. Or, if the resolution is REPLACE, then the change is copied +** into the rebased changeset with updates to columns also updated by +** the conflicting remote UPDATE removed. If this means no columns would +** be updated, the change is omitted. +**
+** +** A local change may be rebased against multiple remote changes +** simultaneously. If a single key is modified by multiple remote +** changesets, they are combined as follows before the local changeset +** is rebased: +** +**
    +**
  • If there has been one or more REPLACE resolutions on a +** key, it is rebased according to a REPLACE. +** +**
  • If there have been no REPLACE resolutions on a key, then +** the local changeset is rebased according to the most recent +** of the OMIT resolutions. +**
+** +** Note that conflict resolutions from multiple remote changesets are +** combined on a per-field basis, not per-row. This means that in the +** case of multiple remote UPDATE operations, some fields of a single +** local change may be rebased for REPLACE while others are rebased for +** OMIT. +** +** In order to rebase a local changeset, the remote changeset must first +** be applied to the local database using sqlite3changeset_apply_v2() and +** the buffer of rebase information captured. Then: +** +**
    +**
  1. An sqlite3_rebaser object is created by calling +** sqlite3rebaser_create(). +**
  2. The new object is configured with the rebase buffer obtained from +** sqlite3changeset_apply_v2() by calling sqlite3rebaser_configure(). +** If the local changeset is to be rebased against multiple remote +** changesets, then sqlite3rebaser_configure() should be called +** multiple times, in the same order that the multiple +** sqlite3changeset_apply_v2() calls were made. +**
  3. Each local changeset is rebased by calling sqlite3rebaser_rebase(). +**
  4. The sqlite3_rebaser object is deleted by calling +** sqlite3rebaser_delete(). +**
+*/ +typedef struct sqlite3_rebaser sqlite3_rebaser; + +/* +** CAPI3REF: Create a changeset rebaser object. +** EXPERIMENTAL +** +** Allocate a new changeset rebaser object. If successful, set (*ppNew) to +** point to the new object and return SQLITE_OK. Otherwise, if an error +** occurs, return an SQLite error code (e.g. SQLITE_NOMEM) and set (*ppNew) +** to NULL. +*/ +SQLITE_API int sqlite3rebaser_create(sqlite3_rebaser **ppNew); + +/* +** CAPI3REF: Configure a changeset rebaser object. +** EXPERIMENTAL +** +** Configure the changeset rebaser object to rebase changesets according +** to the conflict resolutions described by buffer pRebase (size nRebase +** bytes), which must have been obtained from a previous call to +** sqlite3changeset_apply_v2(). +*/ +SQLITE_API int sqlite3rebaser_configure( + sqlite3_rebaser*, + int nRebase, const void *pRebase +); + +/* +** CAPI3REF: Rebase a changeset +** EXPERIMENTAL +** +** Argument pIn must point to a buffer containing a changeset nIn bytes +** in size. This function allocates and populates a buffer with a copy +** of the changeset rebased according to the configuration of the +** rebaser object passed as the first argument. If successful, (*ppOut) +** is set to point to the new buffer containing the rebased changeset and +** (*pnOut) to its size in bytes and SQLITE_OK returned. It is the +** responsibility of the caller to eventually free the new buffer using +** sqlite3_free(). Otherwise, if an error occurs, (*ppOut) and (*pnOut) +** are set to zero and an SQLite error code returned. +*/ +SQLITE_API int sqlite3rebaser_rebase( + sqlite3_rebaser*, + int nIn, const void *pIn, + int *pnOut, void **ppOut +); + +/* +** CAPI3REF: Delete a changeset rebaser object. +** EXPERIMENTAL +** +** Delete the changeset rebaser object and all associated resources. There +** should be one call to this function for each successful invocation +** of sqlite3rebaser_create(). +*/ +SQLITE_API void sqlite3rebaser_delete(sqlite3_rebaser *p); + +/* +** CAPI3REF: Streaming Versions of API functions. +** +** The six streaming API xxx_strm() functions serve similar purposes to the +** corresponding non-streaming API functions: +** +** +** +**
Streaming functionNon-streaming equivalent
sqlite3changeset_apply_strm[sqlite3changeset_apply] +**
sqlite3changeset_apply_strm_v2[sqlite3changeset_apply_v2] +**
sqlite3changeset_concat_strm[sqlite3changeset_concat] +**
sqlite3changeset_invert_strm[sqlite3changeset_invert] +**
sqlite3changeset_start_strm[sqlite3changeset_start] +**
sqlite3session_changeset_strm[sqlite3session_changeset] +**
sqlite3session_patchset_strm[sqlite3session_patchset] +**
+** +** Non-streaming functions that accept changesets (or patchsets) as input +** require that the entire changeset be stored in a single buffer in memory. +** Similarly, those that return a changeset or patchset do so by returning +** a pointer to a single large buffer allocated using sqlite3_malloc(). +** Normally this is convenient. However, if an application running in a +** low-memory environment is required to handle very large changesets, the +** large contiguous memory allocations required can become onerous. +** +** In order to avoid this problem, instead of a single large buffer, input +** is passed to a streaming API functions by way of a callback function that +** the sessions module invokes to incrementally request input data as it is +** required. In all cases, a pair of API function parameters such as +** +**
+**        int nChangeset,
+**        void *pChangeset,
+**  
+** +** Is replaced by: +** +**
+**        int (*xInput)(void *pIn, void *pData, int *pnData),
+**        void *pIn,
+**  
+** +** Each time the xInput callback is invoked by the sessions module, the first +** argument passed is a copy of the supplied pIn context pointer. The second +** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no +** error occurs the xInput method should copy up to (*pnData) bytes of data +** into the buffer and set (*pnData) to the actual number of bytes copied +** before returning SQLITE_OK. If the input is completely exhausted, (*pnData) +** should be set to zero to indicate this. Or, if an error occurs, an SQLite +** error code should be returned. In all cases, if an xInput callback returns +** an error, all processing is abandoned and the streaming API function +** returns a copy of the error code to the caller. +** +** In the case of sqlite3changeset_start_strm(), the xInput callback may be +** invoked by the sessions module at any point during the lifetime of the +** iterator. If such an xInput callback returns an error, the iterator enters +** an error state, whereby all subsequent calls to iterator functions +** immediately fail with the same error code as returned by xInput. +** +** Similarly, streaming API functions that return changesets (or patchsets) +** return them in chunks by way of a callback function instead of via a +** pointer to a single large buffer. In this case, a pair of parameters such +** as: +** +**
+**        int *pnChangeset,
+**        void **ppChangeset,
+**  
+** +** Is replaced by: +** +**
+**        int (*xOutput)(void *pOut, const void *pData, int nData),
+**        void *pOut
+**  
+** +** The xOutput callback is invoked zero or more times to return data to +** the application. The first parameter passed to each call is a copy of the +** pOut pointer supplied by the application. The second parameter, pData, +** points to a buffer nData bytes in size containing the chunk of output +** data being returned. If the xOutput callback successfully processes the +** supplied data, it should return SQLITE_OK to indicate success. Otherwise, +** it should return some other SQLite error code. In this case processing +** is immediately abandoned and the streaming API function returns a copy +** of the xOutput error code to the application. +** +** The sessions module never invokes an xOutput callback with the third +** parameter set to a value less than or equal to zero. Other than this, +** no guarantees are made as to the size of the chunks of data returned. +*/ +SQLITE_API int sqlite3changeset_apply_strm( + sqlite3 *db, /* Apply change to "main" db of this handle */ + int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */ + void *pIn, /* First arg for xInput */ + int(*xFilter)( + void *pCtx, /* Copy of sixth arg to _apply() */ + const char *zTab /* Table name */ + ), + int(*xConflict)( + void *pCtx, /* Copy of sixth arg to _apply() */ + int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ + sqlite3_changeset_iter *p /* Handle describing change and conflict */ + ), + void *pCtx /* First argument passed to xConflict */ +); +SQLITE_API int sqlite3changeset_apply_v2_strm( + sqlite3 *db, /* Apply change to "main" db of this handle */ + int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */ + void *pIn, /* First arg for xInput */ + int(*xFilter)( + void *pCtx, /* Copy of sixth arg to _apply() */ + const char *zTab /* Table name */ + ), + int(*xConflict)( + void *pCtx, /* Copy of sixth arg to _apply() */ + int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ + sqlite3_changeset_iter *p /* Handle describing change and conflict */ + ), + void *pCtx, /* First argument passed to xConflict */ + void **ppRebase, int *pnRebase, + int flags +); +SQLITE_API int sqlite3changeset_concat_strm( + int (*xInputA)(void *pIn, void *pData, int *pnData), + void *pInA, + int (*xInputB)(void *pIn, void *pData, int *pnData), + void *pInB, + int (*xOutput)(void *pOut, const void *pData, int nData), + void *pOut +); +SQLITE_API int sqlite3changeset_invert_strm( + int (*xInput)(void *pIn, void *pData, int *pnData), + void *pIn, + int (*xOutput)(void *pOut, const void *pData, int nData), + void *pOut +); +SQLITE_API int sqlite3changeset_start_strm( + sqlite3_changeset_iter **pp, + int (*xInput)(void *pIn, void *pData, int *pnData), + void *pIn +); +SQLITE_API int sqlite3changeset_start_v2_strm( + sqlite3_changeset_iter **pp, + int (*xInput)(void *pIn, void *pData, int *pnData), + void *pIn, + int flags +); +SQLITE_API int sqlite3session_changeset_strm( + sqlite3_session *pSession, + int (*xOutput)(void *pOut, const void *pData, int nData), + void *pOut +); +SQLITE_API int sqlite3session_patchset_strm( + sqlite3_session *pSession, + int (*xOutput)(void *pOut, const void *pData, int nData), + void *pOut +); +SQLITE_API int sqlite3changegroup_add_strm(sqlite3_changegroup*, + int (*xInput)(void *pIn, void *pData, int *pnData), + void *pIn +); +SQLITE_API int sqlite3changegroup_output_strm(sqlite3_changegroup*, + int (*xOutput)(void *pOut, const void *pData, int nData), + void *pOut +); +SQLITE_API int sqlite3rebaser_rebase_strm( + sqlite3_rebaser *pRebaser, + int (*xInput)(void *pIn, void *pData, int *pnData), + void *pIn, + int (*xOutput)(void *pOut, const void *pData, int nData), + void *pOut +); + +/* +** CAPI3REF: Configure global parameters +** +** The sqlite3session_config() interface is used to make global configuration +** changes to the sessions module in order to tune it to the specific needs +** of the application. +** +** The sqlite3session_config() interface is not threadsafe. If it is invoked +** while any other thread is inside any other sessions method then the +** results are undefined. Furthermore, if it is invoked after any sessions +** related objects have been created, the results are also undefined. +** +** The first argument to the sqlite3session_config() function must be one +** of the SQLITE_SESSION_CONFIG_XXX constants defined below. The +** interpretation of the (void*) value passed as the second parameter and +** the effect of calling this function depends on the value of the first +** parameter. +** +**
+**
SQLITE_SESSION_CONFIG_STRMSIZE
+** By default, the sessions module streaming interfaces attempt to input +** and output data in approximately 1 KiB chunks. This operand may be used +** to set and query the value of this configuration setting. The pointer +** passed as the second argument must point to a value of type (int). +** If this value is greater than 0, it is used as the new streaming data +** chunk size for both input and output. Before returning, the (int) value +** pointed to by pArg is set to the final value of the streaming interface +** chunk size. +**
+** +** This function returns SQLITE_OK if successful, or an SQLite error code +** otherwise. +*/ +SQLITE_API int sqlite3session_config(int op, void *pArg); + +/* +** CAPI3REF: Values for sqlite3session_config(). +*/ +#define SQLITE_SESSION_CONFIG_STRMSIZE 1 + +/* +** Make sure we can call this stuff from C++. +*/ +#ifdef __cplusplus +} +#endif + +#endif /* !defined(__SQLITESESSION_H_) && defined(SQLITE_ENABLE_SESSION) */ + +/******** End of sqlite3session.h *********/ +/******** Begin file fts5.h *********/ +/* +** 2014 May 31 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +****************************************************************************** +** +** Interfaces to extend FTS5. Using the interfaces defined in this file, +** FTS5 may be extended with: +** +** * custom tokenizers, and +** * custom auxiliary functions. +*/ + + +#ifndef _FTS5_H +#define _FTS5_H + + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************* +** CUSTOM AUXILIARY FUNCTIONS +** +** Virtual table implementations may overload SQL functions by implementing +** the sqlite3_module.xFindFunction() method. +*/ + +typedef struct Fts5ExtensionApi Fts5ExtensionApi; +typedef struct Fts5Context Fts5Context; +typedef struct Fts5PhraseIter Fts5PhraseIter; + +typedef void (*fts5_extension_function)( + const Fts5ExtensionApi *pApi, /* API offered by current FTS version */ + Fts5Context *pFts, /* First arg to pass to pApi functions */ + sqlite3_context *pCtx, /* Context for returning result/error */ + int nVal, /* Number of values in apVal[] array */ + sqlite3_value **apVal /* Array of trailing arguments */ +); + +struct Fts5PhraseIter { + const unsigned char *a; + const unsigned char *b; +}; + +/* +** EXTENSION API FUNCTIONS +** +** xUserData(pFts): +** Return a copy of the context pointer the extension function was +** registered with. +** +** xColumnTotalSize(pFts, iCol, pnToken): +** If parameter iCol is less than zero, set output variable *pnToken +** to the total number of tokens in the FTS5 table. Or, if iCol is +** non-negative but less than the number of columns in the table, return +** the total number of tokens in column iCol, considering all rows in +** the FTS5 table. +** +** If parameter iCol is greater than or equal to the number of columns +** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. +** an OOM condition or IO error), an appropriate SQLite error code is +** returned. +** +** xColumnCount(pFts): +** Return the number of columns in the table. +** +** xColumnSize(pFts, iCol, pnToken): +** If parameter iCol is less than zero, set output variable *pnToken +** to the total number of tokens in the current row. Or, if iCol is +** non-negative but less than the number of columns in the table, set +** *pnToken to the number of tokens in column iCol of the current row. +** +** If parameter iCol is greater than or equal to the number of columns +** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. +** an OOM condition or IO error), an appropriate SQLite error code is +** returned. +** +** This function may be quite inefficient if used with an FTS5 table +** created with the "columnsize=0" option. +** +** xColumnText: +** This function attempts to retrieve the text of column iCol of the +** current document. If successful, (*pz) is set to point to a buffer +** containing the text in utf-8 encoding, (*pn) is set to the size in bytes +** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, +** if an error occurs, an SQLite error code is returned and the final values +** of (*pz) and (*pn) are undefined. +** +** xPhraseCount: +** Returns the number of phrases in the current query expression. +** +** xPhraseSize: +** Returns the number of tokens in phrase iPhrase of the query. Phrases +** are numbered starting from zero. +** +** xInstCount: +** Set *pnInst to the total number of occurrences of all phrases within +** the query within the current row. Return SQLITE_OK if successful, or +** an error code (i.e. SQLITE_NOMEM) if an error occurs. +** +** This API can be quite slow if used with an FTS5 table created with the +** "detail=none" or "detail=column" option. If the FTS5 table is created +** with either "detail=none" or "detail=column" and "content=" option +** (i.e. if it is a contentless table), then this API always returns 0. +** +** xInst: +** Query for the details of phrase match iIdx within the current row. +** Phrase matches are numbered starting from zero, so the iIdx argument +** should be greater than or equal to zero and smaller than the value +** output by xInstCount(). +** +** Usually, output parameter *piPhrase is set to the phrase number, *piCol +** to the column in which it occurs and *piOff the token offset of the +** first token of the phrase. Returns SQLITE_OK if successful, or an error +** code (i.e. SQLITE_NOMEM) if an error occurs. +** +** This API can be quite slow if used with an FTS5 table created with the +** "detail=none" or "detail=column" option. +** +** xRowid: +** Returns the rowid of the current row. +** +** xTokenize: +** Tokenize text using the tokenizer belonging to the FTS5 table. +** +** xQueryPhrase(pFts5, iPhrase, pUserData, xCallback): +** This API function is used to query the FTS table for phrase iPhrase +** of the current query. Specifically, a query equivalent to: +** +** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid +** +** with $p set to a phrase equivalent to the phrase iPhrase of the +** current query is executed. Any column filter that applies to +** phrase iPhrase of the current query is included in $p. For each +** row visited, the callback function passed as the fourth argument +** is invoked. The context and API objects passed to the callback +** function may be used to access the properties of each matched row. +** Invoking Api.xUserData() returns a copy of the pointer passed as +** the third argument to pUserData. +** +** If the callback function returns any value other than SQLITE_OK, the +** query is abandoned and the xQueryPhrase function returns immediately. +** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK. +** Otherwise, the error code is propagated upwards. +** +** If the query runs to completion without incident, SQLITE_OK is returned. +** Or, if some error occurs before the query completes or is aborted by +** the callback, an SQLite error code is returned. +** +** +** xSetAuxdata(pFts5, pAux, xDelete) +** +** Save the pointer passed as the second argument as the extension function's +** "auxiliary data". The pointer may then be retrieved by the current or any +** future invocation of the same fts5 extension function made as part of +** the same MATCH query using the xGetAuxdata() API. +** +** Each extension function is allocated a single auxiliary data slot for +** each FTS query (MATCH expression). If the extension function is invoked +** more than once for a single FTS query, then all invocations share a +** single auxiliary data context. +** +** If there is already an auxiliary data pointer when this function is +** invoked, then it is replaced by the new pointer. If an xDelete callback +** was specified along with the original pointer, it is invoked at this +** point. +** +** The xDelete callback, if one is specified, is also invoked on the +** auxiliary data pointer after the FTS5 query has finished. +** +** If an error (e.g. an OOM condition) occurs within this function, +** the auxiliary data is set to NULL and an error code returned. If the +** xDelete parameter was not NULL, it is invoked on the auxiliary data +** pointer before returning. +** +** +** xGetAuxdata(pFts5, bClear) +** +** Returns the current auxiliary data pointer for the fts5 extension +** function. See the xSetAuxdata() method for details. +** +** If the bClear argument is non-zero, then the auxiliary data is cleared +** (set to NULL) before this function returns. In this case the xDelete, +** if any, is not invoked. +** +** +** xRowCount(pFts5, pnRow) +** +** This function is used to retrieve the total number of rows in the table. +** In other words, the same value that would be returned by: +** +** SELECT count(*) FROM ftstable; +** +** xPhraseFirst() +** This function is used, along with type Fts5PhraseIter and the xPhraseNext +** method, to iterate through all instances of a single query phrase within +** the current row. This is the same information as is accessible via the +** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient +** to use, this API may be faster under some circumstances. To iterate +** through instances of phrase iPhrase, use the following code: +** +** Fts5PhraseIter iter; +** int iCol, iOff; +** for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff); +** iCol>=0; +** pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) +** ){ +** // An instance of phrase iPhrase at offset iOff of column iCol +** } +** +** The Fts5PhraseIter structure is defined above. Applications should not +** modify this structure directly - it should only be used as shown above +** with the xPhraseFirst() and xPhraseNext() API methods (and by +** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). +** +** This API can be quite slow if used with an FTS5 table created with the +** "detail=none" or "detail=column" option. If the FTS5 table is created +** with either "detail=none" or "detail=column" and "content=" option +** (i.e. if it is a contentless table), then this API always iterates +** through an empty set (all calls to xPhraseFirst() set iCol to -1). +** +** xPhraseNext() +** See xPhraseFirst above. +** +** xPhraseFirstColumn() +** This function and xPhraseNextColumn() are similar to the xPhraseFirst() +** and xPhraseNext() APIs described above. The difference is that instead +** of iterating through all instances of a phrase in the current row, these +** APIs are used to iterate through the set of columns in the current row +** that contain one or more instances of a specified phrase. For example: +** +** Fts5PhraseIter iter; +** int iCol; +** for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol); +** iCol>=0; +** pApi->xPhraseNextColumn(pFts, &iter, &iCol) +** ){ +** // Column iCol contains at least one instance of phrase iPhrase +** } +** +** This API can be quite slow if used with an FTS5 table created with the +** "detail=none" option. If the FTS5 table is created with either +** "detail=none" "content=" option (i.e. if it is a contentless table), +** then this API always iterates through an empty set (all calls to +** xPhraseFirstColumn() set iCol to -1). +** +** The information accessed using this API and its companion +** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext +** (or xInst/xInstCount). The chief advantage of this API is that it is +** significantly more efficient than those alternatives when used with +** "detail=column" tables. +** +** xPhraseNextColumn() +** See xPhraseFirstColumn above. +*/ +struct Fts5ExtensionApi { + int iVersion; /* Currently always set to 3 */ + + void *(*xUserData)(Fts5Context*); + + int (*xColumnCount)(Fts5Context*); + int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); + int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken); + + int (*xTokenize)(Fts5Context*, + const char *pText, int nText, /* Text to tokenize */ + void *pCtx, /* Context passed to xToken() */ + int (*xToken)(void*, int, const char*, int, int, int) /* Callback */ + ); + + int (*xPhraseCount)(Fts5Context*); + int (*xPhraseSize)(Fts5Context*, int iPhrase); + + int (*xInstCount)(Fts5Context*, int *pnInst); + int (*xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff); + + sqlite3_int64 (*xRowid)(Fts5Context*); + int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn); + int (*xColumnSize)(Fts5Context*, int iCol, int *pnToken); + + int (*xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData, + int(*)(const Fts5ExtensionApi*,Fts5Context*,void*) + ); + int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*)); + void *(*xGetAuxdata)(Fts5Context*, int bClear); + + int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*); + void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff); + + int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*); + void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol); +}; + +/* +** CUSTOM AUXILIARY FUNCTIONS +*************************************************************************/ + +/************************************************************************* +** CUSTOM TOKENIZERS +** +** Applications may also register custom tokenizer types. A tokenizer +** is registered by providing fts5 with a populated instance of the +** following structure. All structure methods must be defined, setting +** any member of the fts5_tokenizer struct to NULL leads to undefined +** behaviour. The structure methods are expected to function as follows: +** +** xCreate: +** This function is used to allocate and initialize a tokenizer instance. +** A tokenizer instance is required to actually tokenize text. +** +** The first argument passed to this function is a copy of the (void*) +** pointer provided by the application when the fts5_tokenizer object +** was registered with FTS5 (the third argument to xCreateTokenizer()). +** The second and third arguments are an array of nul-terminated strings +** containing the tokenizer arguments, if any, specified following the +** tokenizer name as part of the CREATE VIRTUAL TABLE statement used +** to create the FTS5 table. +** +** The final argument is an output variable. If successful, (*ppOut) +** should be set to point to the new tokenizer handle and SQLITE_OK +** returned. If an error occurs, some value other than SQLITE_OK should +** be returned. In this case, fts5 assumes that the final value of *ppOut +** is undefined. +** +** xDelete: +** This function is invoked to delete a tokenizer handle previously +** allocated using xCreate(). Fts5 guarantees that this function will +** be invoked exactly once for each successful call to xCreate(). +** +** xTokenize: +** This function is expected to tokenize the nText byte string indicated +** by argument pText. pText may or may not be nul-terminated. The first +** argument passed to this function is a pointer to an Fts5Tokenizer object +** returned by an earlier call to xCreate(). +** +** The second argument indicates the reason that FTS5 is requesting +** tokenization of the supplied text. This is always one of the following +** four values: +** +**
  • FTS5_TOKENIZE_DOCUMENT - A document is being inserted into +** or removed from the FTS table. The tokenizer is being invoked to +** determine the set of tokens to add to (or delete from) the +** FTS index. +** +**
  • FTS5_TOKENIZE_QUERY - A MATCH query is being executed +** against the FTS index. The tokenizer is being called to tokenize +** a bareword or quoted string specified as part of the query. +** +**
  • (FTS5_TOKENIZE_QUERY | FTS5_TOKENIZE_PREFIX) - Same as +** FTS5_TOKENIZE_QUERY, except that the bareword or quoted string is +** followed by a "*" character, indicating that the last token +** returned by the tokenizer will be treated as a token prefix. +** +**
  • FTS5_TOKENIZE_AUX - The tokenizer is being invoked to +** satisfy an fts5_api.xTokenize() request made by an auxiliary +** function. Or an fts5_api.xColumnSize() request made by the same +** on a columnsize=0 database. +**
+** +** For each token in the input string, the supplied callback xToken() must +** be invoked. The first argument to it should be a copy of the pointer +** passed as the second argument to xTokenize(). The third and fourth +** arguments are a pointer to a buffer containing the token text, and the +** size of the token in bytes. The 4th and 5th arguments are the byte offsets +** of the first byte of and first byte immediately following the text from +** which the token is derived within the input. +** +** The second argument passed to the xToken() callback ("tflags") should +** normally be set to 0. The exception is if the tokenizer supports +** synonyms. In this case see the discussion below for details. +** +** FTS5 assumes the xToken() callback is invoked for each token in the +** order that they occur within the input text. +** +** If an xToken() callback returns any value other than SQLITE_OK, then +** the tokenization should be abandoned and the xTokenize() method should +** immediately return a copy of the xToken() return value. Or, if the +** input buffer is exhausted, xTokenize() should return SQLITE_OK. Finally, +** if an error occurs with the xTokenize() implementation itself, it +** may abandon the tokenization and return any error code other than +** SQLITE_OK or SQLITE_DONE. +** +** SYNONYM SUPPORT +** +** Custom tokenizers may also support synonyms. Consider a case in which a +** user wishes to query for a phrase such as "first place". Using the +** built-in tokenizers, the FTS5 query 'first + place' will match instances +** of "first place" within the document set, but not alternative forms +** such as "1st place". In some applications, it would be better to match +** all instances of "first place" or "1st place" regardless of which form +** the user specified in the MATCH query text. +** +** There are several ways to approach this in FTS5: +** +**
  1. By mapping all synonyms to a single token. In this case, using +** the above example, this means that the tokenizer returns the +** same token for inputs "first" and "1st". Say that token is in +** fact "first", so that when the user inserts the document "I won +** 1st place" entries are added to the index for tokens "i", "won", +** "first" and "place". If the user then queries for '1st + place', +** the tokenizer substitutes "first" for "1st" and the query works +** as expected. +** +**
  2. By querying the index for all synonyms of each query term +** separately. In this case, when tokenizing query text, the +** tokenizer may provide multiple synonyms for a single term +** within the document. FTS5 then queries the index for each +** synonym individually. For example, faced with the query: +** +** +** ... MATCH 'first place' +** +** the tokenizer offers both "1st" and "first" as synonyms for the +** first token in the MATCH query and FTS5 effectively runs a query +** similar to: +** +** +** ... MATCH '(first OR 1st) place' +** +** except that, for the purposes of auxiliary functions, the query +** still appears to contain just two phrases - "(first OR 1st)" +** being treated as a single phrase. +** +**
  3. By adding multiple synonyms for a single term to the FTS index. +** Using this method, when tokenizing document text, the tokenizer +** provides multiple synonyms for each token. So that when a +** document such as "I won first place" is tokenized, entries are +** added to the FTS index for "i", "won", "first", "1st" and +** "place". +** +** This way, even if the tokenizer does not provide synonyms +** when tokenizing query text (it should not - to do so would be +** inefficient), it doesn't matter if the user queries for +** 'first + place' or '1st + place', as there are entries in the +** FTS index corresponding to both forms of the first token. +**
+** +** Whether it is parsing document or query text, any call to xToken that +** specifies a tflags argument with the FTS5_TOKEN_COLOCATED bit +** is considered to supply a synonym for the previous token. For example, +** when parsing the document "I won first place", a tokenizer that supports +** synonyms would call xToken() 5 times, as follows: +** +** +** xToken(pCtx, 0, "i", 1, 0, 1); +** xToken(pCtx, 0, "won", 3, 2, 5); +** xToken(pCtx, 0, "first", 5, 6, 11); +** xToken(pCtx, FTS5_TOKEN_COLOCATED, "1st", 3, 6, 11); +** xToken(pCtx, 0, "place", 5, 12, 17); +** +** +** It is an error to specify the FTS5_TOKEN_COLOCATED flag the first time +** xToken() is called. Multiple synonyms may be specified for a single token +** by making multiple calls to xToken(FTS5_TOKEN_COLOCATED) in sequence. +** There is no limit to the number of synonyms that may be provided for a +** single token. +** +** In many cases, method (1) above is the best approach. It does not add +** extra data to the FTS index or require FTS5 to query for multiple terms, +** so it is efficient in terms of disk space and query speed. However, it +** does not support prefix queries very well. If, as suggested above, the +** token "first" is substituted for "1st" by the tokenizer, then the query: +** +** +** ... MATCH '1s*' +** +** will not match documents that contain the token "1st" (as the tokenizer +** will probably not map "1s" to any prefix of "first"). +** +** For full prefix support, method (3) may be preferred. In this case, +** because the index contains entries for both "first" and "1st", prefix +** queries such as 'fi*' or '1s*' will match correctly. However, because +** extra entries are added to the FTS index, this method uses more space +** within the database. +** +** Method (2) offers a midpoint between (1) and (3). Using this method, +** a query such as '1s*' will match documents that contain the literal +** token "1st", but not "first" (assuming the tokenizer is not able to +** provide synonyms for prefixes). However, a non-prefix query like '1st' +** will match against "1st" and "first". This method does not require +** extra disk space, as no extra entries are added to the FTS index. +** On the other hand, it may require more CPU cycles to run MATCH queries, +** as separate queries of the FTS index are required for each synonym. +** +** When using methods (2) or (3), it is important that the tokenizer only +** provide synonyms when tokenizing document text (method (2)) or query +** text (method (3)), not both. Doing so will not cause any errors, but is +** inefficient. +*/ +typedef struct Fts5Tokenizer Fts5Tokenizer; +typedef struct fts5_tokenizer fts5_tokenizer; +struct fts5_tokenizer { + int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut); + void (*xDelete)(Fts5Tokenizer*); + int (*xTokenize)(Fts5Tokenizer*, + void *pCtx, + int flags, /* Mask of FTS5_TOKENIZE_* flags */ + const char *pText, int nText, + int (*xToken)( + void *pCtx, /* Copy of 2nd argument to xTokenize() */ + int tflags, /* Mask of FTS5_TOKEN_* flags */ + const char *pToken, /* Pointer to buffer containing token */ + int nToken, /* Size of token in bytes */ + int iStart, /* Byte offset of token within input text */ + int iEnd /* Byte offset of end of token within input text */ + ) + ); +}; + +/* Flags that may be passed as the third argument to xTokenize() */ +#define FTS5_TOKENIZE_QUERY 0x0001 +#define FTS5_TOKENIZE_PREFIX 0x0002 +#define FTS5_TOKENIZE_DOCUMENT 0x0004 +#define FTS5_TOKENIZE_AUX 0x0008 + +/* Flags that may be passed by the tokenizer implementation back to FTS5 +** as the third argument to the supplied xToken callback. */ +#define FTS5_TOKEN_COLOCATED 0x0001 /* Same position as prev. token */ + +/* +** END OF CUSTOM TOKENIZERS +*************************************************************************/ + +/************************************************************************* +** FTS5 EXTENSION REGISTRATION API +*/ +typedef struct fts5_api fts5_api; +struct fts5_api { + int iVersion; /* Currently always set to 2 */ + + /* Create a new tokenizer */ + int (*xCreateTokenizer)( + fts5_api *pApi, + const char *zName, + void *pContext, + fts5_tokenizer *pTokenizer, + void (*xDestroy)(void*) + ); + + /* Find an existing tokenizer */ + int (*xFindTokenizer)( + fts5_api *pApi, + const char *zName, + void **ppContext, + fts5_tokenizer *pTokenizer + ); + + /* Create a new auxiliary function */ + int (*xCreateFunction)( + fts5_api *pApi, + const char *zName, + void *pContext, + fts5_extension_function xFunction, + void (*xDestroy)(void*) + ); +}; + +/* +** END OF REGISTRATION API +*************************************************************************/ + +#ifdef __cplusplus +} /* end of the 'extern "C"' block */ +#endif + +#endif /* _FTS5_H */ + +/******** End of fts5.h *********/ diff --git a/pkgs/ffigen/tool/wrapped_libclang/wrapper.c b/pkgs/ffigen/tool/wrapped_libclang/wrapper.c index aa1e94da14..978b7e76be 100644 --- a/pkgs/ffigen/tool/wrapped_libclang/wrapper.c +++ b/pkgs/ffigen/tool/wrapped_libclang/wrapper.c @@ -155,38 +155,70 @@ CXString *clang_formatDiagnostic_wrap(CXDiagnostic diag, int opts) return ptrToCXString(clang_formatDiagnostic(diag, opts)); } -// alternative typedef for [CXCursorVisitor] using pointer for passing cursor and parent +// Alternative typedef for [CXCursorVisitor] using pointer for passing cursor and parent // instead of passing by value typedef enum CXChildVisitResult (*ModifiedCXCursorVisitor)(CXCursor *cursor, CXCursor *parent, CXClientData client_data); -// holds Pointers to Dart function received from [clang_visitChildren_wrap] -// called in [_visitorWrap] struct _stackForVisitChildren { ModifiedCXCursorVisitor modifiedVisitor; struct _stackForVisitChildren *link; -} * _visitorTop, *_visitorTemp; -void _push(ModifiedCXCursorVisitor modifiedVisitor) +} * _visitorTemp; + +// Holds list of Isolate-Processor pairs, each having their own stack +// to hold the vistorFunctions. +struct _listForIsolateProcessPair +{ + long long uid; + struct _listForIsolateProcessPair *next; + struct _stackForVisitChildren *_visitorTop; +} ipHead, *ipTemp; +// `ipHead` is used only as head marker and will not contain any information. + +// Finds/Creates an Isolate-Processor pair from/in the linkedlist. +struct _listForIsolateProcessPair *_findIP(long long uid) { - if (_visitorTop == NULL) + struct _listForIsolateProcessPair *temp = ipHead.next; + while (temp != NULL) { - _visitorTop = (struct _stackForVisitChildren *)malloc(1 * sizeof(struct _stackForVisitChildren)); - _visitorTop->link = NULL; - _visitorTop->modifiedVisitor = modifiedVisitor; + if (temp->uid == uid) + { + return temp; + } + temp = temp->next; + } + // If we reach here this means no IP pair was found and we should create one + // and add it to the head of our list. + temp = aloc(struct _listForIsolateProcessPair); + temp->next = ipHead.next; + temp->uid = uid; + temp->_visitorTop = NULL; + ipHead.next = temp; + return temp; +} +void _push(ModifiedCXCursorVisitor modifiedVisitor, long long uid) +{ + struct _listForIsolateProcessPair *current = _findIP(uid); + if (current->_visitorTop == NULL) + { + current->_visitorTop = aloc(struct _stackForVisitChildren); + current->_visitorTop->link = NULL; + current->_visitorTop->modifiedVisitor = modifiedVisitor; } else { - _visitorTemp = (struct _stackForVisitChildren *)malloc(1 * sizeof(struct _stackForVisitChildren)); - _visitorTemp->link = _visitorTop; + _visitorTemp = aloc(struct _stackForVisitChildren); + _visitorTemp->link = current->_visitorTop; _visitorTemp->modifiedVisitor = modifiedVisitor; - _visitorTop = _visitorTemp; + current->_visitorTop = _visitorTemp; } } -void _pop() +void _pop(long long uid) { - _visitorTemp = _visitorTop; + struct _listForIsolateProcessPair *current = _findIP(uid); + _visitorTemp = current->_visitorTop; if (_visitorTemp == NULL) { @@ -194,30 +226,36 @@ void _pop() return; } else - _visitorTemp = _visitorTop->link; - free(_visitorTop); - _visitorTop = _visitorTemp; + _visitorTemp = current->_visitorTop->link; + free(current->_visitorTop); + current->_visitorTop = _visitorTemp; } -ModifiedCXCursorVisitor _top() +ModifiedCXCursorVisitor _top(long long uid) { - return _visitorTop->modifiedVisitor; + return _findIP(uid)->_visitorTop->modifiedVisitor; } + // Do not write binding for this function. // used by [clang_visitChildren_wrap]. enum CXChildVisitResult _visitorwrap(CXCursor cursor, CXCursor parent, CXClientData clientData) { - enum CXChildVisitResult e = (_top()(ptrToCXCursor(cursor), ptrToCXCursor(parent), clientData)); + // Use clientData (which is a unique ID) to get reference to the stack which + // this particular process-isolate pair uses. + long long uid = *((long long *)clientData); + enum CXChildVisitResult e = (_top(uid)(ptrToCXCursor(cursor), ptrToCXCursor(parent), clientData)); return e; } /** Visitor is a function pointer with parameters having pointers to cxcursor * instead of cxcursor by default. */ -unsigned clang_visitChildren_wrap(CXCursor *parent, ModifiedCXCursorVisitor _modifiedVisitor, CXClientData clientData) +unsigned clang_visitChildren_wrap(CXCursor *parent, ModifiedCXCursorVisitor _modifiedVisitor, long long uid) { - _push(_modifiedVisitor); + long long *clientData = aloc(long long); + *clientData = uid; + _push(_modifiedVisitor, uid); unsigned a = clang_visitChildren(*parent, _visitorwrap, clientData); - _pop(); + _pop(uid); return a; } From 832458d34e4d5a12053de01b47ddc07aa07c17f9 Mon Sep 17 00:00:00 2001 From: Prerak Mann <31154435+mannprerak2@users.noreply.github.com> Date: Mon, 20 Jul 2020 14:01:50 +0530 Subject: [PATCH 015/276] [ffigen] Name conflict resolution with reserved Dart Keywords (#34) Closes #21. - Added reserved keyword conflict resolution to `UniqueNamer`. - Added tests (`collision_tests/reserved_word_collision_test.dart`) - Bug fix: UniqueNamers used by declarations are now reset to initial state before generating code. This ensures multiple calls to Library.generate will produce the same results --- .../lib/src/code_generator/dart_keywords.dart | 70 +++++++++++++++++++ .../lib/src/code_generator/library.dart | 1 - pkgs/ffigen/lib/src/code_generator/utils.dart | 13 +++- .../ffigen/lib/src/code_generator/writer.dart | 28 ++++++-- .../decl_decl_collision_test.dart | 3 +- .../reserved_keyword_collision_test.dart | 47 +++++++++++++ ...ruct_.dart => function_n_struct_test.dart} | 3 +- .../large_integration_tests/large_test.dart | 6 ++ pkgs/ffigen/test/native_test/native_test.dart | 2 + .../ffigen/test/prefix_tests/prefix_test.dart | 1 + pkgs/ffigen/test/test_utils.dart | 4 +- 11 files changed, 166 insertions(+), 12 deletions(-) create mode 100644 pkgs/ffigen/lib/src/code_generator/dart_keywords.dart create mode 100644 pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart rename pkgs/ffigen/test/header_parser_tests/{function_n_struct_.dart => function_n_struct_test.dart} (96%) diff --git a/pkgs/ffigen/lib/src/code_generator/dart_keywords.dart b/pkgs/ffigen/lib/src/code_generator/dart_keywords.dart new file mode 100644 index 0000000000..2f3d4d61f7 --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/dart_keywords.dart @@ -0,0 +1,70 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// Dart reserved keywords, used for resolving conflict with a name. +/// +/// Source: https://dart.dev/guides/language/language-tour#keywords. +const keywords = { + 'abstract', + 'else', + 'import', + 'super', + 'as', + 'enum', + 'in', + 'switch', + 'assert', + 'export', + 'interface', + 'sync', + 'async', + 'extends', + 'is', + 'this', + 'await', + 'extension', + 'library', + 'throw', + 'break', + 'external', + 'mixin', + 'true', + 'case', + 'factory', + 'new', + 'try', + 'catch', + 'false', + 'null', + 'typedef', + 'class', + 'final', + 'on', + 'var', + 'const', + 'finally', + 'operator', + 'void', + 'continue', + 'for', + 'part', + 'while', + 'covariant', + 'Function', + 'rethrow', + 'with', + 'default', + 'get', + 'return', + 'yield', + 'deferred', + 'hide', + 'set', + 'do', + 'if', + 'show', + 'dynamic', + 'implements', + 'static' +}; diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index 6c292fd6b1..10b73a9bcd 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -31,7 +31,6 @@ class Library { final lookUpBindings = bindings.whereType().toList(); final noLookUpBindings = bindings.whereType().toList(); - //TODO(21): Resolve dart keyword as identifiers. /// Handle any declaration-declaration name conflict in [lookUpBindings]. final lookUpDeclConflictHandler = UniqueNamer({}); for (final b in lookUpBindings) { diff --git a/pkgs/ffigen/lib/src/code_generator/utils.dart b/pkgs/ffigen/lib/src/code_generator/utils.dart index 800b7f897b..6bc9f2c0a1 100644 --- a/pkgs/ffigen/lib/src/code_generator/utils.dart +++ b/pkgs/ffigen/lib/src/code_generator/utils.dart @@ -1,6 +1,15 @@ +import 'dart_keywords.dart'; + class UniqueNamer { final Set _usedUpNames; - UniqueNamer(this._usedUpNames); + + /// Creates a UniqueNamer with given [usedUpNames] and Dart reserved keywords. + UniqueNamer(Set usedUpNames) + : assert(keywords.intersection(usedUpNames).isEmpty), + _usedUpNames = {...keywords, ...usedUpNames}; + + /// Creates a UniqueNamer with given [usedUpNames] only. + UniqueNamer._raw(this._usedUpNames); /// Returns a unique name by appending `_` to it if necessary. /// @@ -34,6 +43,8 @@ class UniqueNamer { bool isUnique(String name) { return !_usedUpNames.contains(name); } + + UniqueNamer clone() => UniqueNamer._raw({..._usedUpNames}); } /// Converts [text] to a dart doc comment. diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index 55a451ac14..b46c4f979c 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -27,6 +27,11 @@ class Writer { String _dylibIdentifier; String get dylibIdentifier => _dylibIdentifier; + /// Initial namers set after running constructor. Namers are reset to this + /// initial state everytime [generate] is called. + UniqueNamer _initialTopLevelUniqueNamer, _initialWrapperLevelUniqueNamer; + + /// Used by [Binding]s for generating required code. UniqueNamer _topLevelUniqueNamer, _wrapperLevelUniqueNamer; UniqueNamer get topLevelUniqueNamer => _topLevelUniqueNamer; UniqueNamer get wrapperLevelUniqueNamer => _wrapperLevelUniqueNamer; @@ -51,20 +56,20 @@ class Writer { ..addAll(globalLevelNameSet) ..addAll(wrapperLevelNameSet); - _topLevelUniqueNamer = UniqueNamer(globalLevelNameSet); - _wrapperLevelUniqueNamer = UniqueNamer(wrapperLevelNameSet); + _initialTopLevelUniqueNamer = UniqueNamer(globalLevelNameSet); + _initialWrapperLevelUniqueNamer = UniqueNamer(wrapperLevelNameSet); final allLevelsUniqueNamer = UniqueNamer(allNameSet); /// Wrapper class name must be unique among all names. _className = allLevelsUniqueNamer.makeUnique(className); - wrapperLevelUniqueNamer.markUsed(_className); - topLevelUniqueNamer.markUsed(_className); + _initialWrapperLevelUniqueNamer.markUsed(_className); + _initialTopLevelUniqueNamer.markUsed(_className); /// [_ffiLibraryPrefix] should be unique in top level. - _ffiLibraryPrefix = topLevelUniqueNamer.makeUnique('ffi'); + _ffiLibraryPrefix = _initialTopLevelUniqueNamer.makeUnique('ffi'); /// [_dylibIdentifier] should be unique in top level. - _dylibIdentifier = wrapperLevelUniqueNamer.makeUnique('_dylib'); + _dylibIdentifier = _initialTopLevelUniqueNamer.makeUnique('_dylib'); /// Finding a unique prefix for Array Helper Classes and store into /// [_arrayHelperClassPrefix]. @@ -79,12 +84,23 @@ class Writer { _arrayHelperClassPrefix = '${base}${suffixInt}'; } } + + _resetUniqueNamersNamers(); + } + + /// Resets the namers to initial state. Namers are reset before generating. + void _resetUniqueNamersNamers() { + _topLevelUniqueNamer = _initialTopLevelUniqueNamer.clone(); + _wrapperLevelUniqueNamer = _initialWrapperLevelUniqueNamer.clone(); } /// Writes all bindings to a String. String generate() { final s = StringBuffer(); + // Reset unique namers to initial state. + _resetUniqueNamersNamers(); + // Write file header (if any). if (header != null) { s.write(header); diff --git a/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart index 3b09841dca..24bd079886 100644 --- a/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; +import 'package:logging/logging.dart'; import 'package:test/test.dart'; import '../test_utils.dart'; @@ -10,7 +11,7 @@ import '../test_utils.dart'; void main() { group('decl_decl_collision_test', () { setUpAll(() { - logWarnings(); + logWarnings(Level.SEVERE); }); test('declaration conflict', () { final l1 = Library(name: 'Bindings', bindings: [ diff --git a/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart b/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart new file mode 100644 index 0000000000..a41e939f46 --- /dev/null +++ b/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart @@ -0,0 +1,47 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; + +import '../test_utils.dart'; + +void main() { + group('reserved_keyword_collision_test', () { + setUpAll(() { + logWarnings(Level.SEVERE); + }); + test('reserved keyword collision', () { + final l1 = Library(name: 'Bindings', bindings: [ + Struc(name: 'abstract'), + Struc(name: 'if'), + EnumClass(name: 'return'), + EnumClass(name: 'export'), + Func( + name: 'show', + returnType: Type.nativeType(SupportedNativeType.Void)), + Func( + name: 'implements', + returnType: Type.nativeType(SupportedNativeType.Void)), + ]); + final l2 = Library(name: 'Bindings', bindings: [ + Struc(name: 'abstract_1'), + Struc(name: 'if_1'), + EnumClass(name: 'return_1'), + EnumClass(name: 'export_1'), + Func( + name: 'show_1', + originalName: 'show', + returnType: Type.nativeType(SupportedNativeType.Void)), + Func( + name: 'implements_1', + originalName: 'implements', + returnType: Type.nativeType(SupportedNativeType.Void)), + ]); + + expect(l1.generate(), l2.generate()); + }); + }); +} diff --git a/pkgs/ffigen/test/header_parser_tests/function_n_struct_.dart b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart similarity index 96% rename from pkgs/ffigen/test/header_parser_tests/function_n_struct_.dart rename to pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart index e99faf0181..f3c7fe1a11 100644 --- a/pkgs/ffigen/test/header_parser_tests/function_n_struct_.dart +++ b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart @@ -5,6 +5,7 @@ import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/config_provider.dart'; +import 'package:logging/logging.dart'; import 'package:test/test.dart'; import 'package:yaml/yaml.dart' as yaml; import 'package:ffigen/src/strings.dart' as strings; @@ -16,7 +17,7 @@ Library actual, expected; void main() { group('function_n_struct_test', () { setUpAll(() { - logWarnings(); + logWarnings(Level.SEVERE); expected = expectedLibrary(); actual = parser.parse( Config.fromYaml(yaml.loadYaml(''' diff --git a/pkgs/ffigen/test/large_integration_tests/large_test.dart b/pkgs/ffigen/test/large_integration_tests/large_test.dart index 87d9f2e441..a78d903f6b 100644 --- a/pkgs/ffigen/test/large_integration_tests/large_test.dart +++ b/pkgs/ffigen/test/large_integration_tests/large_test.dart @@ -5,14 +5,20 @@ import 'dart:io'; import 'package:ffigen/src/header_parser.dart'; +import 'package:logging/logging.dart'; import 'package:yaml/yaml.dart'; import 'package:ffigen/src/config_provider/config.dart'; import 'package:test/test.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:path/path.dart' as path; +import '../test_utils.dart'; + void main() { group('large_test', () { + setUpAll(() { + logWarnings(Level.SEVERE); + }); test('Libclang test', () { final config = Config.fromYaml(loadYaml(''' ${strings.name}: LibClang diff --git a/pkgs/ffigen/test/native_test/native_test.dart b/pkgs/ffigen/test/native_test/native_test.dart index eab5dfe29e..c829a59037 100644 --- a/pkgs/ffigen/test/native_test/native_test.dart +++ b/pkgs/ffigen/test/native_test/native_test.dart @@ -7,11 +7,13 @@ import 'dart:io'; import 'dart:math'; import 'package:test/test.dart'; +import '../test_utils.dart'; import 'native_test_bindings.dart' as bindings; void main() { group('native_test', () { setUpAll(() { + logWarnings(); var dylibName = 'test/native_test/native_test.so'; if (Platform.isMacOS) { dylibName = 'test/native_test/native_test.dylib'; diff --git a/pkgs/ffigen/test/prefix_tests/prefix_test.dart b/pkgs/ffigen/test/prefix_tests/prefix_test.dart index 0031c3b6ec..dea22fc4b5 100644 --- a/pkgs/ffigen/test/prefix_tests/prefix_test.dart +++ b/pkgs/ffigen/test/prefix_tests/prefix_test.dart @@ -23,6 +23,7 @@ final enumPrefixReplacedWith = 're'; void main() { group('prefix_test', () { setUpAll(() { + logWarnings(); expected = expectedLibrary(); actual = parser.parse(Config.fromYaml(yaml.loadYaml(''' ${strings.name}: 'NativeLibrary' diff --git a/pkgs/ffigen/test/test_utils.dart b/pkgs/ffigen/test/test_utils.dart index 4b9d9ebc98..8d49c18f46 100644 --- a/pkgs/ffigen/test/test_utils.dart +++ b/pkgs/ffigen/test/test_utils.dart @@ -41,8 +41,8 @@ class NotFoundException implements Exception { } } -void logWarnings() { - Logger.root.level = Level.WARNING; +void logWarnings([Level level = Level.WARNING]) { + Logger.root.level = level; Logger.root.onRecord.listen((record) { print('${record.level.name.padRight(8)}: ${record.message}'); }); From 5f8de9fd932fca904c524c81226fe5cf1fa16ab7 Mon Sep 17 00:00:00 2001 From: Prerak Mann <31154435+mannprerak2@users.noreply.github.com> Date: Thu, 23 Jul 2020 14:35:18 +0530 Subject: [PATCH 016/276] [ffigen] Prepare for pub release (#36) - Updated version, changelog, readme, tests - Dynamic library is now created at `.dart_tool/ffigen` in user's project. - Added `bin/setup.dart` to load dynamic library (custom header/lib includes can be specified using `-I` / `-L` respectively. - Generated classes for enums are now abstract. --- pkgs/ffigen/CHANGELOG.md | 10 +- pkgs/ffigen/README.md | 32 ++-- pkgs/ffigen/bin/ffigen.dart | 11 ++ .../build.dart => bin/setup.dart} | 157 +++++++++++++----- .../libclang-example/generated_bindings.dart | 4 +- .../ffigen/example/libclang-example/readme.md | 2 +- .../src/clang_library}/wrapper.c | 0 .../src/clang_library}/wrapper.def | 0 .../lib/src/code_generator/enum_class.dart | 2 +- .../lib/src/config_provider/config.dart | 23 --- pkgs/ffigen/lib/src/find_dot_dart_tool.dart | 8 + .../finddotdarttool_cli.dart | 29 ++++ .../finddotdarttool_fallback.dart | 26 +++ .../clang_bindings/clang_bindings.dart | 10 +- pkgs/ffigen/lib/src/header_parser/parser.dart | 19 ++- pkgs/ffigen/lib/src/strings.dart | 23 ++- pkgs/ffigen/pubspec.yaml | 2 +- pkgs/ffigen/test/code_generator_test.dart | 6 +- .../function_n_struct_test.dart | 2 +- .../header_parser_tests/functions_test.dart | 2 +- .../nested_parsing_test.dart | 2 +- .../_expected_libclang_bindings.dart | 92 +++++----- .../large_integration_tests/large_test.dart | 3 - pkgs/ffigen/test/native_test/.gitignore | 3 + pkgs/ffigen/test/native_test/config.yaml | 1 - .../ffigen/test/prefix_tests/prefix_test.dart | 2 +- pkgs/ffigen/tool/libclang_config.yaml | 9 +- pkgs/ffigen/tool/wrapped_libclang/.gitignore | 12 -- 28 files changed, 313 insertions(+), 179 deletions(-) rename pkgs/ffigen/{tool/wrapped_libclang/build.dart => bin/setup.dart} (55%) rename pkgs/ffigen/{tool/wrapped_libclang => lib/src/clang_library}/wrapper.c (100%) rename pkgs/ffigen/{tool/wrapped_libclang => lib/src/clang_library}/wrapper.def (100%) create mode 100644 pkgs/ffigen/lib/src/find_dot_dart_tool.dart create mode 100644 pkgs/ffigen/lib/src/find_dot_dart_tool/finddotdarttool_cli.dart create mode 100644 pkgs/ffigen/lib/src/find_dot_dart_tool/finddotdarttool_fallback.dart create mode 100644 pkgs/ffigen/test/native_test/.gitignore delete mode 100644 pkgs/ffigen/tool/wrapped_libclang/.gitignore diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 8fcd296854..40872de3aa 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,5 +1,11 @@ # 0.1.0 -- Initial release supporing binding generation for Functions, Structs, Enums. +- Support for Functions, Structs and Enums. - Glob support for specifying headers. -- HeaderFilter - Include/Exclude declarations from specific header files. +- HeaderFilter - Include/Exclude declarations from specific header files using name matching. - Filters - Include/Exclude function, structs and enum declarations using Regexp or Name matching. +- Prefixing - function, structs and enums can have a global prefix. Individual prefix Replacement support using Regexp. +- Comment extraction: full/brief/none +- Support for fixed size arrays in struct. `array-workaround` (if enabled) will generate helpers for accessing fixed size arrays in structs. +- Size for ints can be specified using `size-map` in config. +- Options to disable using supported typedefs (e.g `uint8_t => Uint8`), sort bindings. +- Option to add a raw `preamble` which is included as is in the generated file. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 31dd16ba86..14053ce881 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -33,27 +33,24 @@ typedef _c_sum = ffi.Int32 Function(Int32 a, Int32 b); typedef _dart_sum = int Function(int a,int b); ``` ## Using this package -- clone/download this repository. -- Build it (see [building](#building)). - Add this package as dev_dependency in your `pubspec.yaml`. +- Setup for use (see [Setup](#Setup)). - Configurations must be provided in `pubspec.yaml` or in a custom YAML file (see [configurations](#configurations)). - Run the tool- `pub run ffigen`. -## Building -A dynamic library for a wrapper to libclang needs to be generated as it is used by the parser submodule. +## Setup +`package:ffigen` uses LLVM. Install LLVM in the following way. #### ubuntu/linux 1. Install libclangdev - `sudo apt-get install libclang-dev`. -2. `cd tool/wrapped_libclang`, then run `dart build.dart`. #### Windows 1. Install Visual Studio with C++ development support. -2. Install LLVM. -3. `cd tool\wrapped_libclang`, then run `dart build.dart`. +2. Install [LLVM](https://releases.llvm.org/download.html). #### MacOS -1. Install LLVM. -2. `cd tool/wrapped_libclang`, then run `dart build.dart`. +1. Install Xcode. +2. Install LLVM - `brew install llvm`. ## Configurations Configurations can be provided in 2 ways- @@ -153,16 +150,6 @@ functions:
comments: 'full'
- - libclang-dylib-folder - no - Path to the folder containing dynamic library for libclang wrapper.
- Note: This is meant for programatic use of this package, and isn't required - when using it via the pub run ffigen command.
- Default: tool/wrapped_libclang - -
libclang-dylib-folder: 'tool/wrapped_libclang'
- sort no @@ -299,8 +286,9 @@ class ArrayHelper_CXFileUniqueID_data_level0 { 2. Run `pub run ffigen`. ## Running Tests -Dynamic library for some tests need to be built before running the examples. -1. `cd test/native_test`. -2. Run `dart build_test_dylib.dart`. +1. Run setup to build the LLVM wrapper - `pub run ffigen:setup`. +2. Dynamic library for some tests also need to be built before running the examples. + 1. `cd test/native_test`. + 2. Run `dart build_test_dylib.dart`. Run tests from the root of the package with `pub run test`. diff --git a/pkgs/ffigen/bin/ffigen.dart b/pkgs/ffigen/bin/ffigen.dart index 4a321ee65c..2f0a07ff16 100644 --- a/pkgs/ffigen/bin/ffigen.dart +++ b/pkgs/ffigen/bin/ffigen.dart @@ -11,9 +11,20 @@ import 'package:ffigen/src/header_parser.dart' as parser; import 'package:logging/logging.dart'; import 'package:yaml/yaml.dart' as yaml; +import 'setup.dart'; + var _logger = Logger('ffigen.ffigen'); void main(List args) { + /// Prompt user if dylib doesn't exist and cannot be auto created to run + /// `pub run ffigen:setup -Ipath/to/llvm/include -Lpath/to/llvm/lib`. + if (!checkDylibExist() && !autoCreateDylib()) { + print('Unable to create dynamic library automatically.'); + print('If LLVM is installed, try running:'); + print(' pub run ffigen:setup -Ipath/to/llvm/include -Lpath/to/llvm/lib'); + exit(1); + } + // Parses the cmd args. final result = getArgResults(args); diff --git a/pkgs/ffigen/tool/wrapped_libclang/build.dart b/pkgs/ffigen/bin/setup.dart similarity index 55% rename from pkgs/ffigen/tool/wrapped_libclang/build.dart rename to pkgs/ffigen/bin/setup.dart index 3e1eff4859..ee524127fd 100644 --- a/pkgs/ffigen/tool/wrapped_libclang/build.dart +++ b/pkgs/ffigen/bin/setup.dart @@ -10,17 +10,15 @@ /// /// Linux: /// ``` -/// clang -I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -lclang -shared -fpic wrapper.c -o libwrapped_clang.so +/// clang -I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -lclang -shared -fpic path/to/wrapper.c -o path/to/libwrapped_clang.so /// ``` /// MacOS: /// ``` -/// clang -I/usr/local/opt/llvm/include/ -L/usr/local/opt/llvm/lib/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -v -lclang -shared -fpic wrapper.c -o libwrapped_clang.dylib +/// clang -I/usr/local/opt/llvm/include/ -L/usr/local/opt/llvm/lib/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -v -lclang -shared -fpic path/to/wrapper.c -o path/to/libwrapped_clang.dylib /// ``` /// Windows: /// ``` -/// clang -IC:\Progra~1\LLVM\include -LC:\Progra~1\LLVM\lib -llibclang -shared wrapper.c -o wrapped_clang.dll -Wl,/DEF:wrapper.def -/// del wrapped_clang.exp -/// del wrapped_clang.lib +/// clang -IC:\Progra~1\LLVM\include -LC:\Progra~1\LLVM\lib -llibclang -shared path/to/wrapper.c -o path/to/wrapped_clang.dll -Wl,/DEF:path/to/wrapper.def /// ``` /// ======================================================================= /// ======================================================================= @@ -29,17 +27,19 @@ import 'dart:io'; import 'package:args/args.dart'; import 'package:meta/meta.dart'; +import 'package:ffigen/src/find_dot_dart_tool.dart'; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:path/path.dart' as path; -const macOS = 'macos'; -const windows = 'windows'; -const linux = 'linux'; +const _macOS = 'macos'; +const _windows = 'windows'; +const _linux = 'linux'; /// Default platform options. -Map platformOptions = { - linux: Options( - outputfilename: 'libwrapped_clang.so', +Map _platformOptions = { + _linux: _Options( sharedFlag: '-shared', - inputHeader: 'wrapper.c', + inputHeader: _getWrapperPath('wrapper.c'), fPIC: '-fpic', ldLibFlag: '-lclang', headerIncludes: [ @@ -47,11 +47,10 @@ Map platformOptions = { '-I/usr/lib/llvm-10/include/', ], ), - windows: Options( - outputfilename: 'wrapped_clang.dll', + _windows: _Options( sharedFlag: '-shared', - inputHeader: 'wrapper.c', - moduleDefPath: '-Wl,/DEF:wrapper.def', + inputHeader: _getWrapperPath('wrapper.c'), + moduleDefPath: '-Wl,/DEF:${_getWrapperPath("wrapper.def")}', ldLibFlag: '-llibclang', headerIncludes: [ r'-IC:\Progra~1\LLVM\include', @@ -60,10 +59,9 @@ Map platformOptions = { r'-LC:\Progra~1\LLVM\lib', ], ), - macOS: Options( - outputfilename: 'libwrapped_clang.dylib', + _macOS: _Options( sharedFlag: '-shared', - inputHeader: 'wrapper.c', + inputHeader: _getWrapperPath('wrapper.c'), fPIC: '-fpic', ldLibFlag: '-lclang', headerIncludes: [ @@ -76,20 +74,97 @@ Map platformOptions = { ), }; +/// If main is called directly we always re-create the dynamic library. void main(List arguments) { - print('Building Dynamic Library for libclang wrapper... '); - final options = getPlatformOptions(); + print('Building Dynamic Library for libclang wrapper...'); + final options = _getPlatformOptions(); + _deleteOldDylib(); // Updates header/lib includes in platform options. - changeIncludesUsingCmdArgs(arguments, options); + _changeIncludesUsingCmdArgs(arguments, options); // Run clang compiler to generate the dynamic library. - final ProcessResult result = runClangProcess(options); - printSuccess(result, options); + final ProcessResult result = _runClangProcess(options); + _printDetails(result, options); +} + +/// Returns true if auto creating dylib was successful. +/// +/// This will fail if llvm is not in default directories or if .dart_tool +/// doesn't exist. +bool autoCreateDylib() { + _deleteOldDylib(); + final options = _getPlatformOptions(); + final ProcessResult result = _runClangProcess(options); + if ((result.stderr as String).isNotEmpty) { + print(stderr); + } + return checkDylibExist(); +} + +bool checkDylibExist() { + return File(path.join( + _getDotDartToolPath(), + strings.ffigenFolderName, + strings.dylibFileName, + )).existsSync(); +} + +/// Removes old dynamic libraries(if any) by deleting .dart_tool/ffigen. +/// +/// Throws error if '.dart_tool' is not found. +void _deleteOldDylib() { + // Find .dart_tool. + final dtpath = _getDotDartToolPath(); + // Find .dart_tool/ffigen and delete recursively if it exists. + final ffigenDir = Directory(path.join(dtpath, strings.ffigenFolderName)); + if (ffigenDir.existsSync()) ffigenDir.deleteSync(recursive: true); +} + +/// Creates necesarry parent folders and return full path to dylib. +String _dylibPath() { + // Find .dart_tool. + final dtpath = _getDotDartToolPath(); + // Create .dart_tool/ffigen if it doesn't exists. + final ffigenDir = Directory(path.join(dtpath, strings.ffigenFolderName)); + if (!ffigenDir.existsSync()) ffigenDir.createSync(); + + // Return dylib path + return path.join(ffigenDir.absolute.path, strings.dylibFileName); +} + +/// Returns full path of the wrapper files. +/// +/// Throws error if not found. +String _getWrapperPath(String wrapperName) { + final file = File(path.join( + Platform.script + .resolve(path.posix.join('..', 'lib', 'src', 'clang_library')) + // This needs to be in posix style or illegal character exception is + // thrown on windows. + .toFilePath(), + wrapperName, + )); + if (file.existsSync()) { + return file.absolute.path; + } else { + throw Exception('Unable to find $wrapperName file.'); + } +} + +/// Gets full path to .dart_tool. +/// +/// Throws Exception if not found. +String _getDotDartToolPath() { + final dtpath = findDotDartTool()?.toFilePath(); + if (dtpath == null) { + throw Exception('.dart_tool not found.'); + } + return dtpath; } /// Calls the clang compiler. -ProcessResult runClangProcess(Options options) { +ProcessResult _runClangProcess(_Options options) { final result = Process.runSync( 'clang', [ @@ -100,7 +175,7 @@ ProcessResult runClangProcess(Options options) { options.fPIC, options.inputHeader, '-o', - options.outputfilename, + _dylibPath(), options.moduleDefPath, '-Wno-nullability-completeness', ], @@ -109,16 +184,16 @@ ProcessResult runClangProcess(Options options) { } /// Prints success message (or process error if any). -void printSuccess(ProcessResult result, Options options) { +void _printDetails(ProcessResult result, _Options options) { print(result.stdout); - if ((result.stderr as String).isEmpty) { - print('Generated file: ${options.outputfilename}'); - } else { + if ((result.stderr as String).isNotEmpty) { print(result.stderr); + } else { + print('Created dynamic library.'); } } -ArgResults getArgResults(List args) { +ArgResults _getArgResults(List args) { final parser = ArgParser(allowTrailingOptions: true); parser.addSeparator( 'Build Script to generate dynamic library used by this package:'); @@ -151,8 +226,8 @@ ArgResults getArgResults(List args) { } /// Use cmd args(if any) to change header/lib include paths. -void changeIncludesUsingCmdArgs(List arguments, Options options) { - final argResult = getArgResults(arguments); +void _changeIncludesUsingCmdArgs(List arguments, _Options options) { + final argResult = _getArgResults(arguments); if (argResult.wasParsed('include-header')) { options.headerIncludes = (argResult['include-header'] as List) .map((header) => '-I$header') @@ -166,23 +241,20 @@ void changeIncludesUsingCmdArgs(List arguments, Options options) { } /// Get options based on current platform. -Options getPlatformOptions() { +_Options _getPlatformOptions() { if (Platform.isMacOS) { - return platformOptions[macOS]; + return _platformOptions[_macOS]; } else if (Platform.isWindows) { - return platformOptions[windows]; + return _platformOptions[_windows]; } else if (Platform.isLinux) { - return platformOptions[linux]; + return _platformOptions[_linux]; } else { throw Exception('Unknown Platform.'); } } /// Hold options which would be passed to clang. -class Options { - /// Name of dynamic library to generate. - final String outputfilename; - +class _Options { /// Tells compiler to generate a shared library. final String sharedFlag; @@ -204,8 +276,7 @@ class Options { /// Linker flag for linking to libclang. final String ldLibFlag; - Options({ - @required this.outputfilename, + _Options({ @required this.sharedFlag, @required this.inputHeader, @required this.ldLibFlag, diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index 924da2a174..b58ac84e4a 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -2531,7 +2531,7 @@ class CXVersion extends ffi.Struct { int Subminor; } -class CXGlobalOptFlags { +abstract class CXGlobalOptFlags { /// Used to indicate that no special CXIndex options are needed. static const int CXGlobalOpt_None = 0; @@ -2852,7 +2852,7 @@ class CXPlatformAvailability extends ffi.Struct {} class CXCursorSetImpl extends ffi.Struct {} /// Describes the kind of type -class CXTypeKind { +abstract class CXTypeKind { /// Represents an invalid type (e.g., where no type is available). static const int CXType_Invalid = 0; diff --git a/pkgs/ffigen/example/libclang-example/readme.md b/pkgs/ffigen/example/libclang-example/readme.md index 33a01efc03..0b8da390ad 100644 --- a/pkgs/ffigen/example/libclang-example/readme.md +++ b/pkgs/ffigen/example/libclang-example/readme.md @@ -1,7 +1,7 @@ # Libclang example Demonstrates generating bindings for [Libclang](https://clang.llvm.org/doxygen/group__CINDEX.html). -This example actually uses a C file used in this package itself, ([wrapper.c](../../tool/wrapped_libclang/wrapper.c)), which adds a few more wrapper functions atop Libclang. +The C header source files for libclang are in [third_party/libclang](/third_party/libclang). ## Generating bindings At the root of this example (`example/libclang-example`), run - diff --git a/pkgs/ffigen/tool/wrapped_libclang/wrapper.c b/pkgs/ffigen/lib/src/clang_library/wrapper.c similarity index 100% rename from pkgs/ffigen/tool/wrapped_libclang/wrapper.c rename to pkgs/ffigen/lib/src/clang_library/wrapper.c diff --git a/pkgs/ffigen/tool/wrapped_libclang/wrapper.def b/pkgs/ffigen/lib/src/clang_library/wrapper.def similarity index 100% rename from pkgs/ffigen/tool/wrapped_libclang/wrapper.def rename to pkgs/ffigen/lib/src/clang_library/wrapper.def diff --git a/pkgs/ffigen/lib/src/code_generator/enum_class.dart b/pkgs/ffigen/lib/src/code_generator/enum_class.dart index 8232ccb188..5a96c392bf 100644 --- a/pkgs/ffigen/lib/src/code_generator/enum_class.dart +++ b/pkgs/ffigen/lib/src/code_generator/enum_class.dart @@ -49,7 +49,7 @@ class EnumClass extends NoLookUpBinding { final localUniqueNamer = UniqueNamer({enclosingClassName}); // Print enclosing class. - s.write('class $enclosingClassName {\n'); + s.write('abstract class $enclosingClassName {\n'); const depth = ' '; for (final ec in enumConstants) { final enum_value_name = localUniqueNamer.makeUnique(ec.name); diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index b0abcc0406..054087bc15 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -2,8 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'dart:io'; - /// Validates the yaml input by the user, prints useful info for the user import 'package:ffigen/src/code_generator.dart'; @@ -11,7 +9,6 @@ import 'package:ffigen/src/header_parser/type_extractor/cxtypekindmap.dart'; import 'package:logging/logging.dart'; import 'package:meta/meta.dart'; -import 'package:path/path.dart' as path; import 'package:yaml/yaml.dart'; import '../strings.dart' as strings; @@ -27,12 +24,6 @@ class Config { /// output file name. String output; - /// libclang path (in accordance with the platform). - /// - /// File may have the following extensions - `.so` / `.dll` / `.dylib` - /// as extracted by configspec. - String libclang_dylib_path; - /// Path to headers. /// /// This contains all the headers, after extraction from Globs. @@ -145,20 +136,6 @@ class Config { extractor: outputExtractor, extractedResult: (dynamic result) => output = result as String, ), - strings.libclang_dylib_folder: Specification( - description: - 'Path to folder containing libclang dynamic library, used to parse C headers', - requirement: Requirement.no, - defaultValue: () => getDylibPath(Platform.script - .resolve(path.posix.join('..', 'tool', 'wrapped_libclang')) - // Path needs to be in posix style here or an illegal character - // error is thrown on windows. - .toFilePath()), - validator: libclangDylibValidator, - extractor: libclangDylibExtractor, - extractedResult: (dynamic result) => - libclang_dylib_path = result as String, - ), strings.headers: Specification>( description: 'List of C headers to generate bindings of', requirement: Requirement.yes, diff --git a/pkgs/ffigen/lib/src/find_dot_dart_tool.dart b/pkgs/ffigen/lib/src/find_dot_dart_tool.dart new file mode 100644 index 0000000000..07c4a98e21 --- /dev/null +++ b/pkgs/ffigen/lib/src/find_dot_dart_tool.dart @@ -0,0 +1,8 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +library finddotdarttool; + +export 'find_dot_dart_tool/finddotdarttool_fallback.dart' + if (dart.library.cli) 'find_dot_dart_tool/finddotdarttool_cli.dart'; diff --git a/pkgs/ffigen/lib/src/find_dot_dart_tool/finddotdarttool_cli.dart b/pkgs/ffigen/lib/src/find_dot_dart_tool/finddotdarttool_cli.dart new file mode 100644 index 0000000000..077341013b --- /dev/null +++ b/pkgs/ffigen/lib/src/find_dot_dart_tool/finddotdarttool_cli.dart @@ -0,0 +1,29 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:cli' as cli; +import 'dart:io' show File; +import 'dart:isolate' show Isolate; +import 'finddotdarttool_fallback.dart' as fallback; + +/// Find the `.dart_tool/` folder, returns `null` if unable to find it. +Uri findDotDartTool() { + // Find [Isolate.packageConfig] and check if contains: + // * `package_config.json`, or, + // * `.dart_tool/package_config.json`. + // If either is the case we know the path to `.dart_tool/`. + final packageConfig = cli.waitFor(Isolate.packageConfig); + if (packageConfig != null && + File.fromUri(packageConfig.resolve('package_config.json')).existsSync()) { + return packageConfig.resolve('./'); + } + if (packageConfig != null && + File.fromUri(packageConfig.resolve('.dart_tool/package_config.json')) + .existsSync()) { + return packageConfig.resolve('.dart_tool/'); + } + // If [Isolate.packageConfig] isn't helpful we fallback to looking at the + // current script location and traverse up from there. + return fallback.findDotDartTool(); +} diff --git a/pkgs/ffigen/lib/src/find_dot_dart_tool/finddotdarttool_fallback.dart b/pkgs/ffigen/lib/src/find_dot_dart_tool/finddotdarttool_fallback.dart new file mode 100644 index 0000000000..50e2c4c774 --- /dev/null +++ b/pkgs/ffigen/lib/src/find_dot_dart_tool/finddotdarttool_fallback.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:io' show Platform, File; + +/// Find the `.dart_tool/` folder, returns `null` if unable to find it. +Uri findDotDartTool() { + // HACK: Because 'dart:isolate' is unavailable in Flutter we have no means + // by which we can find the location of the package_config.json file. + // Which we need, because the binary library created by: + // flutter pub run ffigen:setup + // is located relative to this path. As a workaround we use + // `Platform.script` and traverse level-up until we find a + // `.dart_tool/package_config.json` file. + // Find script directory + var root = Platform.script.resolve('./'); + // Traverse up until we see a `.dart_tool/package_config.json` file. + do { + if (File.fromUri(root.resolve('.dart_tool/package_config.json')) + .existsSync()) { + return root.resolve('.dart_tool/'); + } + } while (root != (root = root.resolve('..'))); + return null; +} diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 7040fb5461..975c9ad530 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -704,7 +704,7 @@ class ArrayHelper_CXSourceRange_ptr_data_level0 { } /// Options to control the display of diagnostics. -class CXDiagnosticDisplayOptions { +abstract class CXDiagnosticDisplayOptions { /// Display the source-location information where the diagnostic was located. static const int CXDiagnostic_DisplaySourceLocation = 1; @@ -727,7 +727,7 @@ class CXDiagnosticDisplayOptions { } /// Flags that control the creation of translation units. -class CXTranslationUnit_Flags { +abstract class CXTranslationUnit_Flags { /// Used to indicate that no special translation-unit options are needed. static const int CXTranslationUnit_None = 0; @@ -791,7 +791,7 @@ class CXTranslationUnit_Flags { } /// Describes the kind of entity that a cursor refers to. -class CXCursorKind { +abstract class CXCursorKind { /// A declaration whose specific kind is not exposed via this interface. static const int CXCursor_UnexposedDecl = 1; @@ -1509,7 +1509,7 @@ class ArrayHelper_CXCursor_data_level0 { } /// Describes the kind of type -class CXTypeKind { +abstract class CXTypeKind { /// Represents an invalid type (e.g., where no type is available). static const int CXType_Invalid = 0; @@ -1693,7 +1693,7 @@ class ArrayHelper_CXType_data_level0 { /// Describes how the traversal of the children of a particular cursor should /// proceed after visiting a particular child cursor. -class CXChildVisitResult { +abstract class CXChildVisitResult { /// Terminates the cursor traversal. static const int CXChildVisit_Break = 0; diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index bc3c7f8ad0..a2b1593ce2 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -3,13 +3,15 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:ffi'; -import 'dart:io'; import 'package:ffi/ffi.dart'; import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/find_dot_dart_tool.dart'; import 'package:ffigen/src/header_parser/translation_unit_parser.dart'; +import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; +import 'package:path/path.dart' as path; import 'clang_bindings/clang_bindings.dart' as clang_types; import 'data.dart'; @@ -42,11 +44,20 @@ var _logger = Logger('ffigen.header_parser.parser'); /// Initialises parser, clears any previous values. void initParser(Config c) { + // Set global configurations. config = c; - clang = clang_types.Clang(DynamicLibrary.open( - File(config.libclang_dylib_path).absolute?.path ?? - config.libclang_dylib_path)); + // Find full path of dynamic library and initialise bindings. + if (findDotDartTool() == null) { + throw Exception('Unable to find .dart_tool.'); + } else { + final fullDylibPath = path.join( + findDotDartTool().toFilePath(), + strings.ffigenFolderName, + strings.dylibFileName, + ); + clang = clang_types.Clang(DynamicLibrary.open(fullDylibPath)); + } } /// Parses source files and adds generated bindings to [bindings]. diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 5951ef5946..6bc47cdf2d 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -1,11 +1,32 @@ // Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'dart:io'; + import 'package:ffigen/src/header_parser/clang_bindings/clang_bindings.dart' as clang; +// This version must be updated whenever we update the libclang wrapper. +const dylibVersion = 'v1'; + +/// Name of the dynamic library file according to current platform. +String get dylibFileName { + String name; + if (Platform.isLinux) { + name = libclang_dylib_linux; + } else if (Platform.isMacOS) { + name = libclang_dylib_macos; + } else if (Platform.isWindows) { + name = libclang_dylib_windows; + } else { + throw Exception('Unsupported Platform.'); + } + return '_${dylibVersion}_$name'; +} + +const ffigenFolderName = 'ffigen'; + const output = 'output'; -const libclang_dylib_folder = 'libclang-dylib-folder'; const headers = 'headers'; const headerFilter = 'header-filter'; const compilerOpts = 'compiler-opts'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 64ecfbde7f..c412a924df 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 0.0.1 +version: 0.1.0 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings. diff --git a/pkgs/ffigen/test/code_generator_test.dart b/pkgs/ffigen/test/code_generator_test.dart index 4fd5aea4e1..a67f41ef2d 100644 --- a/pkgs/ffigen/test/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_test.dart @@ -545,7 +545,7 @@ import 'dart:ffi' as ffi; /// test line 1 /// test line 2 -class Constants { +abstract class Constants { static const int a = 10; /// negative static const int b = -1; @@ -715,10 +715,10 @@ default: class ArrayHelperPrefixCollisionTest extends ffi.Struct{ } -class _c_Test { +abstract class _c_Test { } -class init_dylib { +abstract class init_dylib { } typedef _c_test1 = ffi.Void Function( diff --git a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart index f3c7fe1a11..872bf1b114 100644 --- a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart @@ -24,7 +24,7 @@ void main() { ${strings.name}: 'NativeLibrary' ${strings.description}: 'Function And Struct Test' ${strings.output}: 'unused' -${strings.libclang_dylib_folder}: 'tool/wrapped_libclang' + ${strings.headers}: - 'test/header_parser_tests/function_n_struct.h' ''') as yaml.YamlMap), diff --git a/pkgs/ffigen/test/header_parser_tests/functions_test.dart b/pkgs/ffigen/test/header_parser_tests/functions_test.dart index 67a147a4c8..c88fd55e65 100644 --- a/pkgs/ffigen/test/header_parser_tests/functions_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/functions_test.dart @@ -23,7 +23,7 @@ void main() { ${strings.name}: 'NativeLibrary' ${strings.description}: 'Functions Test' ${strings.output}: 'unused' -${strings.libclang_dylib_folder}: 'tool/wrapped_libclang' + ${strings.headers}: - 'test/header_parser_tests/functions.h' ${strings.headerFilter}: diff --git a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart index 8783f46166..073623136f 100644 --- a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart @@ -23,7 +23,7 @@ void main() { ${strings.name}: 'NativeLibrary' ${strings.description}: 'Nested Parsing Test' ${strings.output}: 'unused' -${strings.libclang_dylib_folder}: 'tool/wrapped_libclang' + ${strings.headers}: - 'test/header_parser_tests/nested_parsing.h' structs: diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index 1aa4cb5af9..7cb48a19b2 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -2149,7 +2149,7 @@ class LibClang { } /// Error codes returned by libclang routines. -class CXErrorCode { +abstract class CXErrorCode { /// No error. static const int CXError_Success = 0; @@ -2205,7 +2205,7 @@ class CXUnsavedFile extends ffi.Struct { /// 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. -class CXAvailabilityKind { +abstract class CXAvailabilityKind { /// The entity is available. static const int CXAvailability_Available = 0; @@ -2241,7 +2241,7 @@ class CXVersion extends ffi.Struct { } /// Describes the exception specification of a cursor. -class CXCursor_ExceptionSpecificationKind { +abstract class CXCursor_ExceptionSpecificationKind { /// The cursor has no exception specification. static const int CXCursor_ExceptionSpecificationKind_None = 0; @@ -2273,7 +2273,7 @@ class CXCursor_ExceptionSpecificationKind { static const int CXCursor_ExceptionSpecificationKind_NoThrow = 9; } -class CXGlobalOptFlags { +abstract class CXGlobalOptFlags { /// Used to indicate that no special CXIndex options are needed. static const int CXGlobalOpt_None = 0; @@ -2477,7 +2477,7 @@ class CXSourceRangeList extends ffi.Struct { } /// Describes the severity of a particular diagnostic. -class CXDiagnosticSeverity { +abstract class CXDiagnosticSeverity { /// A diagnostic that has been suppressed, e.g., by a command-line option. static const int CXDiagnostic_Ignored = 0; @@ -2498,7 +2498,7 @@ class CXDiagnosticSeverity { /// Describes the kind of error that occurred (if any) in a call to /// clang_loadDiagnostics. -class CXLoadDiag_Error { +abstract class CXLoadDiag_Error { /// Indicates that no error occurred. static const int CXLoadDiag_None = 0; @@ -2515,7 +2515,7 @@ class CXLoadDiag_Error { } /// Options to control the display of diagnostics. -class CXDiagnosticDisplayOptions { +abstract class CXDiagnosticDisplayOptions { /// Display the source-location information where the diagnostic was located. static const int CXDiagnostic_DisplaySourceLocation = 1; @@ -2538,7 +2538,7 @@ class CXDiagnosticDisplayOptions { } /// Flags that control the creation of translation units. -class CXTranslationUnit_Flags { +abstract class CXTranslationUnit_Flags { /// Used to indicate that no special translation-unit options are needed. static const int CXTranslationUnit_None = 0; @@ -2602,14 +2602,14 @@ class CXTranslationUnit_Flags { } /// Flags that control how translation units are saved. -class CXSaveTranslationUnit_Flags { +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(). -class CXSaveError { +abstract class CXSaveError { /// Indicates that no error occurred while saving a translation unit. static const int CXSaveError_None = 0; @@ -2627,13 +2627,13 @@ class CXSaveError { } /// Flags that control the reparsing of translation units. -class CXReparse_Flags { +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. -class CXTUResourceUsageKind { +abstract class CXTUResourceUsageKind { static const int CXTUResourceUsage_AST = 1; static const int CXTUResourceUsage_Identifiers = 2; static const int CXTUResourceUsage_Selectors = 3; @@ -2673,7 +2673,7 @@ class CXTUResourceUsage extends ffi.Struct { } /// Describes the kind of entity that a cursor refers to. -class CXCursorKind { +abstract class CXCursorKind { /// A declaration whose specific kind is not exposed via this interface. static const int CXCursor_UnexposedDecl = 1; @@ -3391,7 +3391,7 @@ class ArrayHelper_CXCursor_data_level0 { } /// Describe the linkage of the entity referred to by a cursor. -class CXLinkageKind { +abstract class CXLinkageKind { /// This value indicates that no linkage information is available for a /// provided CXCursor. static const int CXLinkage_Invalid = 0; @@ -3411,7 +3411,7 @@ class CXLinkageKind { static const int CXLinkage_External = 4; } -class CXVisibilityKind { +abstract class CXVisibilityKind { /// This value indicates that no visibility information is available for a /// provided CXCursor. static const int CXVisibility_Invalid = 0; @@ -3431,7 +3431,7 @@ class CXVisibilityKind { class CXPlatformAvailability extends ffi.Struct {} /// Describe the "language" of the entity referred to by a cursor. -class CXLanguageKind { +abstract class CXLanguageKind { static const int CXLanguage_Invalid = 0; static const int CXLanguage_C = 1; static const int CXLanguage_ObjC = 2; @@ -3440,7 +3440,7 @@ class CXLanguageKind { /// Describe the "thread-local storage (TLS) kind" of the declaration referred /// to by a cursor. -class CXTLSKind { +abstract class CXTLSKind { static const int CXTLS_None = 0; static const int CXTLS_Dynamic = 1; static const int CXTLS_Static = 2; @@ -3449,7 +3449,7 @@ class CXTLSKind { class CXCursorSetImpl extends ffi.Struct {} /// Describes the kind of type -class CXTypeKind { +abstract class CXTypeKind { /// Represents an invalid type (e.g., where no type is available). static const int CXType_Invalid = 0; @@ -3576,7 +3576,7 @@ class CXTypeKind { } /// Describes the calling convention of a function type -class CXCallingConv { +abstract class CXCallingConv { static const int CXCallingConv_Default = 0; static const int CXCallingConv_C = 1; static const int CXCallingConv_X86StdCall = 2; @@ -3656,7 +3656,7 @@ class ArrayHelper_CXType_data_level0 { } /// Describes the kind of a template argument. -class CXTemplateArgumentKind { +abstract class CXTemplateArgumentKind { static const int CXTemplateArgumentKind_Null = 0; static const int CXTemplateArgumentKind_Type = 1; static const int CXTemplateArgumentKind_Declaration = 2; @@ -3669,7 +3669,7 @@ class CXTemplateArgumentKind { static const int CXTemplateArgumentKind_Invalid = 9; } -class CXTypeNullabilityKind { +abstract class CXTypeNullabilityKind { /// Values of this type can never be null. static const int CXTypeNullability_NonNull = 0; @@ -3687,7 +3687,7 @@ class CXTypeNullabilityKind { /// List the possible error codes for clang_Type_getSizeOf, /// clang_Type_getAlignOf, clang_Type_getOffsetOf and clang_Cursor_getOffsetOf. -class CXTypeLayoutError { +abstract class CXTypeLayoutError { /// Type is of kind CXType_Invalid. static const int CXTypeLayoutError_Invalid = -1; @@ -3707,7 +3707,7 @@ class CXTypeLayoutError { static const int CXTypeLayoutError_Undeduced = -6; } -class CXRefQualifierKind { +abstract class CXRefQualifierKind { /// No ref-qualifier was provided. static const int CXRefQualifier_None = 0; @@ -3720,7 +3720,7 @@ class CXRefQualifierKind { /// Represents the C++ access control level to a base class for a cursor with /// kind CX_CXXBaseSpecifier. -class CX_CXXAccessSpecifier { +abstract class CX_CXXAccessSpecifier { static const int CX_CXXInvalidAccessSpecifier = 0; static const int CX_CXXPublic = 1; static const int CX_CXXProtected = 2; @@ -3729,7 +3729,7 @@ class CX_CXXAccessSpecifier { /// 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. -class CX_StorageClass { +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; @@ -3742,7 +3742,7 @@ class CX_StorageClass { /// Describes how the traversal of the children of a particular cursor should /// proceed after visiting a particular child cursor. -class CXChildVisitResult { +abstract class CXChildVisitResult { /// Terminates the cursor traversal. static const int CXChildVisit_Break = 0; @@ -3756,7 +3756,7 @@ class CXChildVisitResult { } /// Properties for the printing policy. -class CXPrintingPolicyProperty { +abstract class CXPrintingPolicyProperty { static const int CXPrintingPolicy_Indentation = 0; static const int CXPrintingPolicy_SuppressSpecifiers = 1; static const int CXPrintingPolicy_SuppressTagKeyword = 2; @@ -3787,7 +3787,7 @@ class CXPrintingPolicyProperty { } /// Property attributes for a CXCursor_ObjCPropertyDecl. -class CXObjCPropertyAttrKind { +abstract class CXObjCPropertyAttrKind { static const int CXObjCPropertyAttr_noattr = 0; static const int CXObjCPropertyAttr_readonly = 1; static const int CXObjCPropertyAttr_getter = 2; @@ -3806,7 +3806,7 @@ class CXObjCPropertyAttrKind { /// 'Qualifiers' written next to the return and parameter types in Objective-C /// method declarations. -class CXObjCDeclQualifierKind { +abstract class CXObjCDeclQualifierKind { static const int CXObjCDeclQualifier_None = 0; static const int CXObjCDeclQualifier_In = 1; static const int CXObjCDeclQualifier_Inout = 2; @@ -3816,7 +3816,7 @@ class CXObjCDeclQualifierKind { static const int CXObjCDeclQualifier_Oneway = 32; } -class CXNameRefFlags { +abstract class CXNameRefFlags { /// Include the nested-name-specifier, e.g. Foo:: in x.Foo::y, in the range. static const int CXNameRange_WantQualifier = 1; @@ -3829,7 +3829,7 @@ class CXNameRefFlags { } /// Describes a kind of token. -class CXTokenKind { +abstract class CXTokenKind { /// A token that contains some kind of punctuation. static const int CXToken_Punctuation = 0; @@ -3928,7 +3928,7 @@ class CXCompletionResult extends ffi.Struct { } /// Describes a single piece of text within a code-completion string. -class CXCompletionChunkKind { +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; @@ -4011,7 +4011,7 @@ class CXCodeCompleteResults extends ffi.Struct { } /// Flags that can be passed to clang_codeCompleteAt() to modify its behavior. -class CXCodeComplete_Flags { +abstract class CXCodeComplete_Flags { /// Whether to include macros within the set of code completions returned. static const int CXCodeComplete_IncludeMacros = 1; @@ -4035,7 +4035,7 @@ class CXCodeComplete_Flags { } /// Bits that represent the context under which completion is occurring. -class CXCompletionContext { +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; @@ -4127,7 +4127,7 @@ class CXCompletionContext { static const int CXCompletionContext_Unknown = 8388607; } -class CXEvalResultKind { +abstract class CXEvalResultKind { static const int CXEval_Int = 1; static const int CXEval_Float = 2; static const int CXEval_ObjCStrLiteral = 3; @@ -4138,14 +4138,14 @@ class CXEvalResultKind { } /// @{ -class CXVisitorResult { +abstract class CXVisitorResult { static const int CXVisit_Break = 0; static const int CXVisit_Continue = 1; } class CXCursorAndRangeVisitor extends ffi.Struct {} -class CXResult { +abstract class CXResult { /// Function returned successfully. static const int CXResult_Success = 0; @@ -4217,7 +4217,7 @@ class CXIdxIncludedFileInfo extends ffi.Struct {} /// Data for IndexerCallbacks#importedASTFile. class CXIdxImportedASTFileInfo extends ffi.Struct {} -class CXIdxEntityKind { +abstract class CXIdxEntityKind { static const int CXIdxEntity_Unexposed = 0; static const int CXIdxEntity_Typedef = 1; static const int CXIdxEntity_Function = 2; @@ -4247,7 +4247,7 @@ class CXIdxEntityKind { static const int CXIdxEntity_CXXInterface = 26; } -class CXIdxEntityLanguage { +abstract class CXIdxEntityLanguage { static const int CXIdxEntityLang_None = 0; static const int CXIdxEntityLang_C = 1; static const int CXIdxEntityLang_ObjC = 2; @@ -4259,14 +4259,14 @@ class CXIdxEntityLanguage { /// CXIdxEntity_Function CXIdxEntity_CXXClass CXIdxEntity_CXXStaticMethod /// CXIdxEntity_CXXInstanceMethod CXIdxEntity_CXXConstructor /// CXIdxEntity_CXXConversionFunction CXIdxEntity_CXXTypeAlias -class CXIdxEntityCXXTemplateKind { +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; } -class CXIdxAttrKind { +abstract class CXIdxAttrKind { static const int CXIdxAttr_Unexposed = 0; static const int CXIdxAttr_IBAction = 1; static const int CXIdxAttr_IBOutlet = 2; @@ -4281,13 +4281,13 @@ class CXIdxContainerInfo extends ffi.Struct {} class CXIdxIBOutletCollectionAttrInfo extends ffi.Struct {} -class CXIdxDeclInfoFlags { +abstract class CXIdxDeclInfoFlags { static const int CXIdxDeclFlag_Skipped = 1; } class CXIdxDeclInfo extends ffi.Struct {} -class CXIdxObjCContainerKind { +abstract class CXIdxObjCContainerKind { static const int CXIdxObjCContainer_ForwardRef = 0; static const int CXIdxObjCContainer_Interface = 1; static const int CXIdxObjCContainer_Implementation = 2; @@ -4339,7 +4339,7 @@ class CXIdxCXXClassDeclInfo extends ffi.Struct { } /// Data for IndexerCallbacks#indexEntityReference. -class CXIdxEntityRefKind { +abstract class CXIdxEntityRefKind { /// The entity is referenced directly in user's code. static const int CXIdxEntityRef_Direct = 1; @@ -4349,7 +4349,7 @@ class CXIdxEntityRefKind { } /// Roles that are attributed to symbol occurrences. -class CXSymbolRole { +abstract class CXSymbolRole { static const int CXSymbolRole_None = 0; static const int CXSymbolRole_Declaration = 1; static const int CXSymbolRole_Definition = 2; @@ -4392,7 +4392,7 @@ class IndexerCallbacks extends ffi.Struct { ffi.Pointer> indexEntityReference; } -class CXIndexOptFlags { +abstract class CXIndexOptFlags { /// Used to indicate that no special indexing options are needed. static const int CXIndexOpt_None = 0; diff --git a/pkgs/ffigen/test/large_integration_tests/large_test.dart b/pkgs/ffigen/test/large_integration_tests/large_test.dart index a78d903f6b..79d4a888dc 100644 --- a/pkgs/ffigen/test/large_integration_tests/large_test.dart +++ b/pkgs/ffigen/test/large_integration_tests/large_test.dart @@ -24,7 +24,6 @@ void main() { ${strings.name}: LibClang ${strings.description}: Bindings to LibClang. ${strings.output}: unused -${strings.libclang_dylib_folder}: tool/wrapped_libclang ${strings.compilerOpts}: -I${path.join('third_party', 'libclang', 'include')} ${strings.arrayWorkaround}: true ${strings.headers}: @@ -66,7 +65,6 @@ ${strings.name}: CJson ${strings.description}: Bindings to Cjson. ${strings.output}: unused ${strings.comments}: full -${strings.libclang_dylib_folder}: tool/wrapped_libclang ${strings.arrayWorkaround}: true ${strings.headers}: - third_party/cjson_library/cJSON.h @@ -102,7 +100,6 @@ ${strings.headerFilter}: ${strings.name}: SQLite ${strings.description}: Bindings to SQLite. ${strings.output}: unused -${strings.libclang_dylib_folder}: tool/wrapped_libclang ${strings.arrayWorkaround}: true ${strings.comments}: full ${strings.headers}: diff --git a/pkgs/ffigen/test/native_test/.gitignore b/pkgs/ffigen/test/native_test/.gitignore new file mode 100644 index 0000000000..d97e2fcb0c --- /dev/null +++ b/pkgs/ffigen/test/native_test/.gitignore @@ -0,0 +1,3 @@ +# Ignore files generated by clang on windows. +native_test.exp +native_test.lib diff --git a/pkgs/ffigen/test/native_test/config.yaml b/pkgs/ffigen/test/native_test/config.yaml index a25821a463..479988d596 100644 --- a/pkgs/ffigen/test/native_test/config.yaml +++ b/pkgs/ffigen/test/native_test/config.yaml @@ -7,7 +7,6 @@ # =============================================================== output: 'native_test_bindings.dart' -libclang-dylib-folder: '../../tool/wrapped_libclang' sort: true headers: - 'native_test.c' diff --git a/pkgs/ffigen/test/prefix_tests/prefix_test.dart b/pkgs/ffigen/test/prefix_tests/prefix_test.dart index dea22fc4b5..abbe2b4c3f 100644 --- a/pkgs/ffigen/test/prefix_tests/prefix_test.dart +++ b/pkgs/ffigen/test/prefix_tests/prefix_test.dart @@ -29,7 +29,7 @@ void main() { ${strings.name}: 'NativeLibrary' ${strings.description}: 'Prefix Test' ${strings.output}: 'unused' -${strings.libclang_dylib_folder}: 'tool/wrapped_libclang' + ${strings.headers}: - 'test/prefix_tests/prefix.h' ${strings.headerFilter}: diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index fe10d98078..aec307152f 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -5,18 +5,17 @@ # Config file for generating the libclang bindings used by this package. # ===================== GENERATING BINDINGS ===================== -# cd to `tool`, and run - -# dart ../bin/ffigen.dart --config libclang_config.yaml +# cd to project's root, and run - +# pub run ffigen --config libclang_config.yaml # =============================================================== name: Clang description: Holds bindings to LibClang. -output: '../lib/src/header_parser/clang_bindings/clang_bindings.dart' -libclang-dylib-folder: 'wrapped_libclang' +output: 'lib/src/header_parser/clang_bindings/clang_bindings.dart' sort: true compiler-opts: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' headers: - - 'wrapped_libclang/wrapper.c' + - 'lib/src/clang_library/wrapper.c' header-filter: include: - wrapper.c diff --git a/pkgs/ffigen/tool/wrapped_libclang/.gitignore b/pkgs/ffigen/tool/wrapped_libclang/.gitignore deleted file mode 100644 index 2b64ac7f5f..0000000000 --- a/pkgs/ffigen/tool/wrapped_libclang/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -# general gitignore for CMake. -CMakeLists.txt.user -CMakeCache.txt -CMakeFiles -CMakeScripts -Testing -Makefile -cmake_install.cmake -install_manifest.txt -compile_commands.json -CTestTestfile.cmake -_deps From f2f4eb436ef0ba3edcb2b73d80b59dc1fab21228 Mon Sep 17 00:00:00 2001 From: Prerak Mann <31154435+mannprerak2@users.noreply.github.com> Date: Thu, 23 Jul 2020 18:20:12 +0530 Subject: [PATCH 017/276] [ffigen] Address pub score (#37) Address pub score: follow dart File conventions, provide documentation, and pass static analysis. --- pkgs/ffigen/CHANGELOG.md | 3 +++ pkgs/ffigen/analysis_options.yaml | 2 -- pkgs/ffigen/bin/ffigen.dart | 15 +++++++-------- pkgs/ffigen/bin/setup.dart | 19 ++++++++++--------- pkgs/ffigen/example/README.md | 5 +++++ pkgs/ffigen/lib/ffigen.dart | 12 ++++++++++++ pkgs/ffigen/lib/src/code_generator/func.dart | 7 ++++--- pkgs/ffigen/lib/src/code_generator/struc.dart | 16 ++++++++-------- pkgs/ffigen/lib/src/code_generator/type.dart | 4 ++-- pkgs/ffigen/lib/src/code_generator/utils.dart | 4 ++-- .../ffigen/lib/src/code_generator/writer.dart | 4 ++-- .../type_extractor/extractor.dart | 2 +- pkgs/ffigen/lib/src/header_parser/utils.dart | 2 +- pkgs/ffigen/pubspec.yaml | 10 +++++----- .../test/native_test/build_test_dylib.dart | 5 +++-- pkgs/ffigen/test/native_test/native_test.dart | 8 ++++---- .../native_test/native_test_bindings.dart | 8 ++++---- pkgs/ffigen/tool/libclang_config.yaml | 2 +- 18 files changed, 74 insertions(+), 54 deletions(-) create mode 100644 pkgs/ffigen/example/README.md create mode 100644 pkgs/ffigen/lib/ffigen.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 40872de3aa..2d65c3418c 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.1.1 +- Address pub score: follow dart File conventions, provide documentation, and pass static analysis. + # 0.1.0 - Support for Functions, Structs and Enums. - Glob support for specifying headers. diff --git a/pkgs/ffigen/analysis_options.yaml b/pkgs/ffigen/analysis_options.yaml index fb0e867893..4113a7cd2c 100644 --- a/pkgs/ffigen/analysis_options.yaml +++ b/pkgs/ffigen/analysis_options.yaml @@ -8,8 +8,6 @@ analyzer: strong-mode: implicit-casts: false implicit-dynamic: false - errors: - omit_local_variable_types: ignore linter: rules: diff --git a/pkgs/ffigen/bin/ffigen.dart b/pkgs/ffigen/bin/ffigen.dart index 2f0a07ff16..9328b2873a 100644 --- a/pkgs/ffigen/bin/ffigen.dart +++ b/pkgs/ffigen/bin/ffigen.dart @@ -6,8 +6,7 @@ import 'dart:io'; import 'package:args/args.dart'; -import 'package:ffigen/src/config_provider.dart'; -import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/ffigen.dart'; import 'package:logging/logging.dart'; import 'package:yaml/yaml.dart' as yaml; @@ -16,6 +15,9 @@ import 'setup.dart'; var _logger = Logger('ffigen.ffigen'); void main(List args) { + // Parses the cmd args. This will print usage and exit if --help was passed. + final argResult = getArgResults(args); + /// Prompt user if dylib doesn't exist and cannot be auto created to run /// `pub run ffigen:setup -Ipath/to/llvm/include -Lpath/to/llvm/lib`. if (!checkDylibExist() && !autoCreateDylib()) { @@ -25,23 +27,20 @@ void main(List args) { exit(1); } - // Parses the cmd args. - final result = getArgResults(args); - // Setup logging level and printing. - setupLogger(result); + setupLogger(argResult); // Create a config object. Config config; try { - config = getConfig(result); + config = getConfig(argResult); } on ConfigError { print('Please fix configuration errors and re-run the tool.'); exit(1); } // Parse the bindings according to config object provided. - final library = parser.parse(config); + final library = parse(config); if (config.sort) { library.sort(); diff --git a/pkgs/ffigen/bin/setup.dart b/pkgs/ffigen/bin/setup.dart index ee524127fd..e9336915be 100644 --- a/pkgs/ffigen/bin/setup.dart +++ b/pkgs/ffigen/bin/setup.dart @@ -76,16 +76,19 @@ Map _platformOptions = { /// If main is called directly we always re-create the dynamic library. void main(List arguments) { + // Parses the cmd args. This will print usage and exit if --help was passed. + final argResults = _getArgResults(arguments); + print('Building Dynamic Library for libclang wrapper...'); final options = _getPlatformOptions(); _deleteOldDylib(); // Updates header/lib includes in platform options. - _changeIncludesUsingCmdArgs(arguments, options); + _changeIncludesUsingCmdArgs(argResults, options); // Run clang compiler to generate the dynamic library. - final ProcessResult result = _runClangProcess(options); - _printDetails(result, options); + final processResult = _runClangProcess(options); + _printDetails(processResult, options); } /// Returns true if auto creating dylib was successful. @@ -95,8 +98,8 @@ void main(List arguments) { bool autoCreateDylib() { _deleteOldDylib(); final options = _getPlatformOptions(); - final ProcessResult result = _runClangProcess(options); - if ((result.stderr as String).isNotEmpty) { + final processResult = _runClangProcess(options); + if ((processResult.stderr as String).isNotEmpty) { print(stderr); } return checkDylibExist(); @@ -195,8 +198,7 @@ void _printDetails(ProcessResult result, _Options options) { ArgResults _getArgResults(List args) { final parser = ArgParser(allowTrailingOptions: true); - parser.addSeparator( - 'Build Script to generate dynamic library used by this package:'); + parser.addSeparator('Generates LLVM Wrapper used by this package:'); parser.addMultiOption('include-header', abbr: 'I', help: 'Path to header include directories'); parser.addMultiOption('include-lib', @@ -226,8 +228,7 @@ ArgResults _getArgResults(List args) { } /// Use cmd args(if any) to change header/lib include paths. -void _changeIncludesUsingCmdArgs(List arguments, _Options options) { - final argResult = _getArgResults(arguments); +void _changeIncludesUsingCmdArgs(ArgResults argResult, _Options options) { if (argResult.wasParsed('include-header')) { options.headerIncludes = (argResult['include-header'] as List) .map((header) => '-I$header') diff --git a/pkgs/ffigen/example/README.md b/pkgs/ffigen/example/README.md new file mode 100644 index 0000000000..954249dda0 --- /dev/null +++ b/pkgs/ffigen/example/README.md @@ -0,0 +1,5 @@ +## Examples + +- [Simple](https://github.com/dart-lang/ffigen/tree/master/example/simple) +- [cJSON](https://github.com/dart-lang/ffigen/tree/master/example/c_json) +- [LibClang](https://github.com/dart-lang/ffigen/tree/master/example/libclang-example) diff --git a/pkgs/ffigen/lib/ffigen.dart b/pkgs/ffigen/lib/ffigen.dart new file mode 100644 index 0000000000..2b0a304a4e --- /dev/null +++ b/pkgs/ffigen/lib/ffigen.dart @@ -0,0 +1,12 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// A bindings generator for dart. +/// +/// See complete usage at - https://pub.dev/packages/ffigen. +library ffigen; + +export 'src/code_generator.dart' show Library; +export 'src/config_provider.dart' show Config, ConfigError; +export 'src/header_parser.dart' show parse; diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index f0f317ee8a..c6e6e83631 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -33,7 +33,8 @@ class Func extends LookUpBinding { final Type returnType; final List parameters; - /// [lookupSymbolName], if not provided, takes the value of [name]. + /// [originalName] is looked up in dynamic library, if not + /// provided, takes the value of [name]. Func({ @required String name, String originalName, @@ -82,8 +83,8 @@ class Func extends LookUpBinding { /// And only marks it as used at top-level. String _uniqueTypedefName(String name, Writer w) { final base = name; - String uniqueName = name; - int suffix = 0; + var uniqueName = name; + var suffix = 0; while (w.topLevelUniqueNamer.isUsed(uniqueName) || w.wrapperLevelUniqueNamer.isUsed(uniqueName)) { suffix++; diff --git a/pkgs/ffigen/lib/src/code_generator/struc.dart b/pkgs/ffigen/lib/src/code_generator/struc.dart index 11bae3dac8..9fd8d05f59 100644 --- a/pkgs/ffigen/lib/src/code_generator/struc.dart +++ b/pkgs/ffigen/lib/src/code_generator/struc.dart @@ -135,9 +135,9 @@ class Struc extends NoLookUpBinding { /// Gets a unique prefix in local namespace for expanded array items. String getUniqueExpandedArrayItemPrefix() { final base = '_unique'; - String expandedArrayItemPrefix = base; - int suffixInt = 0; - for (int i = 0; i < members.length; i++) { + var expandedArrayItemPrefix = base; + var suffixInt = 0; + for (var i = 0; i < members.length; i++) { if (members[i].name.startsWith(expandedArrayItemPrefix)) { // Not a unique prefix, start over with a new suffix. i = -1; @@ -171,7 +171,7 @@ class ArrayHelper { int get expandedArrayLength { if (_expandedArrayLength != null) return _expandedArrayLength; - int arrayLength = 1; + var arrayLength = 1; for (final i in dimensions) { arrayLength = arrayLength * i; } @@ -193,7 +193,7 @@ class ArrayHelper { final arrayDartType = elementType.getDartType(w); final arrayCType = elementType.getCType(w); - for (int i = 0; i < expandedArrayLength; i++) { + for (var i = 0; i < expandedArrayLength; i++) { if (elementType.isPrimitive) { s.write(' @${arrayCType}()\n'); } @@ -210,7 +210,7 @@ class ArrayHelper { String helperClassString(Writer w) { final s = StringBuffer(); final arrayType = elementType.getDartType(w); - for (int dim = 0; dim < dimensions.length; dim++) { + for (var dim = 0; dim < dimensions.length; dim++) { final helperClassName = '${helperClassGroupName}_level${dim}'; final structIdentifier = '_struct'; final dimensionsIdentifier = 'dimensions'; @@ -262,7 +262,7 @@ class ArrayHelper { s.write('$arrayType operator[](int index){\n'); s.write('$checkBoundsFunctionIdentifier(index);\n'); s.write('switch($absoluteIndexIdentifier+index){\n'); - for (int i = 0; i < expandedArrayLength; i++) { + for (var i = 0; i < expandedArrayLength; i++) { s.write('case $i:\n'); s.write(' return $structIdentifier.${elementNamePrefix}$i;\n'); } @@ -275,7 +275,7 @@ class ArrayHelper { s.write('void operator[]=(int index, $arrayType value){\n'); s.write('$checkBoundsFunctionIdentifier(index);\n'); s.write('switch($absoluteIndexIdentifier+index){\n'); - for (int i = 0; i < expandedArrayLength; i++) { + for (var i = 0; i < expandedArrayLength; i++) { s.write('case $i:\n'); s.write(' $structIdentifier.${elementNamePrefix}$i = value;\n'); s.write(' break;\n'); diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index ad69ea4b71..9622ee47f7 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -127,8 +127,8 @@ class Type { /// Get base type for any type. /// - /// E.g int** has base [Type] with [Broadtype] as NativeType, - /// double[2][3] has base [Type] with [Broadtype] as double. + /// E.g int** has base [Type] of int. + /// double[2][3] has base [Type] of double. Type getBaseType() { if (child != null) { return child.getBaseType(); diff --git a/pkgs/ffigen/lib/src/code_generator/utils.dart b/pkgs/ffigen/lib/src/code_generator/utils.dart index 6bc9f2c0a1..e91b5ee4a6 100644 --- a/pkgs/ffigen/lib/src/code_generator/utils.dart +++ b/pkgs/ffigen/lib/src/code_generator/utils.dart @@ -15,8 +15,8 @@ class UniqueNamer { /// /// Adds the resulting name to the used names by default. String makeUnique(String name, [bool addToUsedUpNames = true]) { - String cr_name = name; - int i = 1; + var cr_name = name; + var i = 1; while (_usedUpNames.contains(cr_name)) { cr_name = '${name}_$i'; i++; diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index b46c4f979c..06ea9d77ea 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -75,8 +75,8 @@ class Writer { /// [_arrayHelperClassPrefix]. final base = 'ArrayHelper'; _arrayHelperClassPrefix = base; - int suffixInt = 0; - for (int i = 0; i < allNameSet.length; i++) { + var suffixInt = 0; + for (var i = 0; i < allNameSet.length; i++) { if (allNameSet.elementAt(i).startsWith(_arrayHelperClassPrefix)) { // Not a unique prefix, start over with a new suffix. i = -1; diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 2c0f6665b4..d95b7717a6 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -168,7 +168,7 @@ Type _extractFromFunctionProto( /// Generate a unique string for naming in [Typedef]. String _getNextIncrementedString(String prefix) { - int i = _incrementedStringCounters[prefix] ?? 0; + var i = _incrementedStringCounters[prefix] ?? 0; i++; _incrementedStringCounters[prefix] = i; return '${prefix}_$i'; diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index 052ea5f685..f8c9507a79 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -181,7 +181,7 @@ String _wrapNoNewLineString(String string, int lineWidth) { final words = string.split(' '); sb.write(words[0]); - int trackLineWidth = words[0].length; + var trackLineWidth = words[0].length; for (var i = 1; i < words.length; i++) { final word = words[i]; if (trackLineWidth + word.length < lineWidth) { diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index c412a924df..201cf67154 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,9 +3,9 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 0.1.0 +version: 0.1.1 homepage: https://github.com/dart-lang/ffigen -description: Experimental generator for FFI bindings. +description: Experimental generator for FFI bindings, using LibClang to parse C/C++ header files. environment: sdk: '>=2.7.0 <3.0.0' @@ -13,12 +13,12 @@ environment: dependencies: ffi: ^0.1.3 yaml: ^2.2.1 - meta: ^1.1.8 + meta: ^1.2.2 args: ^1.6.0 logging: ^0.11.4 glob: ^1.2.0 path: ^1.7.0 dev_dependencies: - pedantic: ^1.9.0 - test: ^1.14.3 + pedantic: ^1.9.2 + test: ^1.15.3 diff --git a/pkgs/ffigen/test/native_test/build_test_dylib.dart b/pkgs/ffigen/test/native_test/build_test_dylib.dart index a41f8748c0..e829231ed1 100644 --- a/pkgs/ffigen/test/native_test/build_test_dylib.dart +++ b/pkgs/ffigen/test/native_test/build_test_dylib.dart @@ -60,8 +60,9 @@ void main(List arguments) { final options = getPlatformOptions(); // Run clang compiler to generate the dynamic library. - final ProcessResult result = runClangProcess(options); - printSuccess(result, options); + // ignore: omit_local_variable_types + final processResult = runClangProcess(options); + printSuccess(processResult, options); } /// Calls the clang compiler. diff --git a/pkgs/ffigen/test/native_test/native_test.dart b/pkgs/ffigen/test/native_test/native_test.dart index c829a59037..efb4ead5bc 100644 --- a/pkgs/ffigen/test/native_test/native_test.dart +++ b/pkgs/ffigen/test/native_test/native_test.dart @@ -62,10 +62,10 @@ void main() { }); test('array-workaround: Order of access', () { final struct1 = bindings.getStruct1(); - int expectedValue = 1; - for (int i = 0; i < struct1.ref.data.dimensions[0]; i++) { - for (int j = 0; j < struct1.ref.data.dimensions[1]; j++) { - for (int k = 0; k < struct1.ref.data.dimensions[2]; k++) { + var expectedValue = 1; + for (var i = 0; i < struct1.ref.data.dimensions[0]; i++) { + for (var j = 0; j < struct1.ref.data.dimensions[1]; j++) { + for (var k = 0; k < struct1.ref.data.dimensions[2]; k++) { expect(struct1.ref.data[i][j][k], expectedValue); expectedValue++; } diff --git a/pkgs/ffigen/test/native_test/native_test_bindings.dart b/pkgs/ffigen/test/native_test/native_test_bindings.dart index a9c53096af..a49d622893 100644 --- a/pkgs/ffigen/test/native_test/native_test_bindings.dart +++ b/pkgs/ffigen/test/native_test/native_test_bindings.dart @@ -265,8 +265,8 @@ class ArrayHelper_Struct1_data_level0 { ArrayHelper_Struct1_data_level1 operator [](int index) { _checkBounds(index); - int offset = index; - for (int i = level + 1; i < dimensions.length; i++) { + var offset = index; + for (var i = level + 1; i < dimensions.length; i++) { offset *= dimensions[i]; } return ArrayHelper_Struct1_data_level1( @@ -292,8 +292,8 @@ class ArrayHelper_Struct1_data_level1 { ArrayHelper_Struct1_data_level2 operator [](int index) { _checkBounds(index); - int offset = index; - for (int i = level + 1; i < dimensions.length; i++) { + var offset = index; + for (var i = level + 1; i < dimensions.length; i++) { offset *= dimensions[i]; } return ArrayHelper_Struct1_data_level2( diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index aec307152f..81598701eb 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -6,7 +6,7 @@ # ===================== GENERATING BINDINGS ===================== # cd to project's root, and run - -# pub run ffigen --config libclang_config.yaml +# pub run ffigen --config tool/libclang_config.yaml # =============================================================== name: Clang From 6afbceb5b57941cbd06677e40c19535c64e3e7ea Mon Sep 17 00:00:00 2001 From: Prerak Mann <31154435+mannprerak2@users.noreply.github.com> Date: Fri, 24 Jul 2020 15:07:55 +0530 Subject: [PATCH 018/276] [ffigen] Fixed wrapper not found error when running pub run ffigen (#42) Possibly fixes #41 (Needs to be tested after publishing). - Using `dart:cli` to resolve package uri and get wrapper.c for running `pub run ffigen:setup`. - If `dart:cli` is unavailable, fallback tries to work up the current directory to find `.dart_tool/package_config.json` and get rootUri of `package:ffigen` and find wrapper.c from there. --- pkgs/ffigen/CHANGELOG.md | 3 + pkgs/ffigen/bin/setup.dart | 11 +--- pkgs/ffigen/lib/src/code_generator.dart | 1 - .../finddotdarttool_fallback.dart | 26 -------- ..._dot_dart_tool.dart => find_resource.dart} | 6 +- .../find_resource_cli.dart} | 10 ++- .../find_resource/find_resource_fallback.dart | 62 +++++++++++++++++++ pkgs/ffigen/lib/src/header_parser/parser.dart | 2 +- pkgs/ffigen/pubspec.yaml | 2 +- 9 files changed, 81 insertions(+), 42 deletions(-) delete mode 100644 pkgs/ffigen/lib/src/find_dot_dart_tool/finddotdarttool_fallback.dart rename pkgs/ffigen/lib/src/{find_dot_dart_tool.dart => find_resource.dart} (58%) rename pkgs/ffigen/lib/src/{find_dot_dart_tool/finddotdarttool_cli.dart => find_resource/find_resource_cli.dart} (74%) create mode 100644 pkgs/ffigen/lib/src/find_resource/find_resource_fallback.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 2d65c3418c..83afb0b44e 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.1.2 +- Fixed wrapper not found error when running `pub run ffigen`. + # 0.1.1 - Address pub score: follow dart File conventions, provide documentation, and pass static analysis. diff --git a/pkgs/ffigen/bin/setup.dart b/pkgs/ffigen/bin/setup.dart index e9336915be..ef618fc7b4 100644 --- a/pkgs/ffigen/bin/setup.dart +++ b/pkgs/ffigen/bin/setup.dart @@ -27,7 +27,7 @@ import 'dart:io'; import 'package:args/args.dart'; import 'package:meta/meta.dart'; -import 'package:ffigen/src/find_dot_dart_tool.dart'; +import 'package:ffigen/src/find_resource.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:path/path.dart' as path; @@ -140,14 +140,7 @@ String _dylibPath() { /// /// Throws error if not found. String _getWrapperPath(String wrapperName) { - final file = File(path.join( - Platform.script - .resolve(path.posix.join('..', 'lib', 'src', 'clang_library')) - // This needs to be in posix style or illegal character exception is - // thrown on windows. - .toFilePath(), - wrapperName, - )); + final file = File.fromUri(findWrapper(wrapperName)); if (file.existsSync()) { return file.absolute.path; } else { diff --git a/pkgs/ffigen/lib/src/code_generator.dart b/pkgs/ffigen/lib/src/code_generator.dart index 9eb01b641f..efbb1a2843 100644 --- a/pkgs/ffigen/lib/src/code_generator.dart +++ b/pkgs/ffigen/lib/src/code_generator.dart @@ -14,4 +14,3 @@ export 'code_generator/library.dart'; export 'code_generator/struc.dart'; export 'code_generator/type.dart'; export 'code_generator/typedef.dart'; - diff --git a/pkgs/ffigen/lib/src/find_dot_dart_tool/finddotdarttool_fallback.dart b/pkgs/ffigen/lib/src/find_dot_dart_tool/finddotdarttool_fallback.dart deleted file mode 100644 index 50e2c4c774..0000000000 --- a/pkgs/ffigen/lib/src/find_dot_dart_tool/finddotdarttool_fallback.dart +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'dart:io' show Platform, File; - -/// Find the `.dart_tool/` folder, returns `null` if unable to find it. -Uri findDotDartTool() { - // HACK: Because 'dart:isolate' is unavailable in Flutter we have no means - // by which we can find the location of the package_config.json file. - // Which we need, because the binary library created by: - // flutter pub run ffigen:setup - // is located relative to this path. As a workaround we use - // `Platform.script` and traverse level-up until we find a - // `.dart_tool/package_config.json` file. - // Find script directory - var root = Platform.script.resolve('./'); - // Traverse up until we see a `.dart_tool/package_config.json` file. - do { - if (File.fromUri(root.resolve('.dart_tool/package_config.json')) - .existsSync()) { - return root.resolve('.dart_tool/'); - } - } while (root != (root = root.resolve('..'))); - return null; -} diff --git a/pkgs/ffigen/lib/src/find_dot_dart_tool.dart b/pkgs/ffigen/lib/src/find_resource.dart similarity index 58% rename from pkgs/ffigen/lib/src/find_dot_dart_tool.dart rename to pkgs/ffigen/lib/src/find_resource.dart index 07c4a98e21..e9a9dae55f 100644 --- a/pkgs/ffigen/lib/src/find_dot_dart_tool.dart +++ b/pkgs/ffigen/lib/src/find_resource.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -library finddotdarttool; +library find_resource; -export 'find_dot_dart_tool/finddotdarttool_fallback.dart' - if (dart.library.cli) 'find_dot_dart_tool/finddotdarttool_cli.dart'; +export 'find_resource/find_resource_fallback.dart' + if (dart.library.cli) 'find_resource/find_resource_cli.dart'; diff --git a/pkgs/ffigen/lib/src/find_dot_dart_tool/finddotdarttool_cli.dart b/pkgs/ffigen/lib/src/find_resource/find_resource_cli.dart similarity index 74% rename from pkgs/ffigen/lib/src/find_dot_dart_tool/finddotdarttool_cli.dart rename to pkgs/ffigen/lib/src/find_resource/find_resource_cli.dart index 077341013b..d3885b5f08 100644 --- a/pkgs/ffigen/lib/src/find_dot_dart_tool/finddotdarttool_cli.dart +++ b/pkgs/ffigen/lib/src/find_resource/find_resource_cli.dart @@ -5,7 +5,7 @@ import 'dart:cli' as cli; import 'dart:io' show File; import 'dart:isolate' show Isolate; -import 'finddotdarttool_fallback.dart' as fallback; +import 'find_resource_fallback.dart' as fallback; /// Find the `.dart_tool/` folder, returns `null` if unable to find it. Uri findDotDartTool() { @@ -27,3 +27,11 @@ Uri findDotDartTool() { // current script location and traverse up from there. return fallback.findDotDartTool(); } + +Uri findWrapper(String wrapperName) { + final wrapperUri = cli.waitFor(Isolate.resolvePackageUri( + Uri.parse('package:ffigen/src/clang_library/$wrapperName'))); + // If [Isolate.packageConfig] isn't helpful we fallback to looking at the + // current script location and traverse up from there. + return wrapperUri ?? fallback.findWrapper(wrapperName); +} diff --git a/pkgs/ffigen/lib/src/find_resource/find_resource_fallback.dart b/pkgs/ffigen/lib/src/find_resource/find_resource_fallback.dart new file mode 100644 index 0000000000..0db61eeff0 --- /dev/null +++ b/pkgs/ffigen/lib/src/find_resource/find_resource_fallback.dart @@ -0,0 +1,62 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:convert' show jsonDecode; +import 'dart:io' show File, Directory; + +/// Find the `.dart_tool/` folder, returns `null` if unable to find it. +Uri findDotDartTool() { + // HACK: Because 'dart:isolate' is unavailable in Flutter we have no means + // by which we can find the location of the package_config.json file. + // Which we need, because the binary library created by: + // flutter pub run ffigen:setup + // is located relative to this path. As a workaround we use + // `Platform.script` and traverse level-up until we find a + // `.dart_tool/package_config.json` file. + // Find script directory + var root = Directory.current.uri; + // Traverse up until we see a `.dart_tool/package_config.json` file. + do { + if (File.fromUri(root.resolve('.dart_tool/package_config.json')) + .existsSync()) { + return root.resolve('.dart_tool/'); + } + } while (root != (root = root.resolve('..'))); + return null; +} + +Uri findWrapper(String wrapperName) { + var root = Directory.current.uri; + // Traverse up until we see a `.dart_tool/package_config.json` file. + do { + final file = File.fromUri(root.resolve('.dart_tool/package_config.json')); + if (file.existsSync()) { + /// Read the package_config.json file to extract path of wrapper. + try { + final packageMap = + jsonDecode(file.readAsStringSync()) as Map; + if (packageMap['configVersion'] == 2) { + var ffigenRootUriString = ((packageMap['packages'] as List) + .cast>() + .firstWhere( + (element) => element['name'] == 'ffigen')['rootUri'] + as String); + ffigenRootUriString = ffigenRootUriString.endsWith('/') + ? ffigenRootUriString + : ffigenRootUriString + '/'; + + /// [ffigenRootUri] can be relative to .dart_tool if its from + /// filesystem so we need to resolve it from .dart_tool first. + return file.parent.uri + .resolve(ffigenRootUriString) + .resolve('lib/src/clang_library/$wrapperName'); + } + } catch (e, s) { + print(s); + throw Exception('Cannot resolve package:ffigen\'s rootUri.'); + } + } + } while (root != (root = root.resolve('..'))); + return null; +} diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index a2b1593ce2..832127aa35 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -7,7 +7,7 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/config_provider.dart'; -import 'package:ffigen/src/find_dot_dart_tool.dart'; +import 'package:ffigen/src/find_resource.dart'; import 'package:ffigen/src/header_parser/translation_unit_parser.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 201cf67154..8da3a6aad9 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 0.1.1 +version: 0.1.2 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C/C++ header files. From 4439a4eef449ef070242fcf6f1aeb5460d22efd5 Mon Sep 17 00:00:00 2001 From: Ivan Date: Fri, 24 Jul 2020 15:15:11 +0300 Subject: [PATCH 019/276] [ffigen] Update README.md (#46) --- pkgs/ffigen/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 14053ce881..ce829cf020 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -46,7 +46,7 @@ typedef _dart_sum = int Function(int a,int b); #### Windows 1. Install Visual Studio with C++ development support. -2. Install [LLVM](https://releases.llvm.org/download.html). +2. Install [LLVM](https://releases.llvm.org/download.html) or `winget install -e --id LLVM.LLVM`. #### MacOS 1. Install Xcode. From c07219b816735e58d695d7b25c418e1c1113801f Mon Sep 17 00:00:00 2001 From: Prerak Mann <31154435+mannprerak2@users.noreply.github.com> Date: Mon, 27 Jul 2020 13:07:59 +0530 Subject: [PATCH 020/276] [ffigen] Handle function argument dart keywords and setup travis (#49) Closes #47 , closes #44 - Fixed function argument name conflicts with dart keywords. - Updated tests, examples - Updated Travis: libclang-dev and clang are installed, `pub run ffigen:setup` is called before running tasks. --- pkgs/ffigen/.travis.yml | 12 +++++++ pkgs/ffigen/CHANGELOG.md | 4 +++ .../libclang-example/generated_bindings.dart | 8 ++--- pkgs/ffigen/lib/src/code_generator/func.dart | 6 +++- .../lib/src/code_generator/typedef.dart | 9 ++++-- pkgs/ffigen/pubspec.yaml | 2 +- .../decl_decl_collision_test.dart | 1 - .../reserved_keyword_collision_test.dart | 31 ++++++++++++++++++- .../_expected_libclang_bindings.dart | 8 ++--- pkgs/ffigen/test/native_test/native_test.dart | 1 + 10 files changed, 67 insertions(+), 15 deletions(-) diff --git a/pkgs/ffigen/.travis.yml b/pkgs/ffigen/.travis.yml index 6ec14e5902..fe0efef222 100644 --- a/pkgs/ffigen/.travis.yml +++ b/pkgs/ffigen/.travis.yml @@ -11,3 +11,15 @@ branches: cache: directories: - $HOME/.pub-cache +before_install: + # install libclang-dev + - sudo add-apt-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main" + - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - + - sudo apt-get update + - sudo apt-get install clang-10 libclang-10-dev + # use clang from installed llvm + - export PATH="/usr/lib/llvm-10/bin:$PATH" + +before_script: + - 'pub run ffigen:setup' + - cd test/native_test && dart build_test_dylib.dart && cd ../.. diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 83afb0b44e..bd81e15695 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.1.3 +- Handled function arguments - dart keyword name collision +- Fix travis tests: the dynamic library is created using `pub run ffigen:setup` before running the tests. + # 0.1.2 - Fixed wrapper not found error when running `pub run ffigen`. diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index b58ac84e4a..bd5b8cec57 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -14,12 +14,12 @@ class LibClang { /// Free the given string set. void clang_disposeStringSet( - ffi.Pointer set, + ffi.Pointer set_1, ) { _clang_disposeStringSet ??= _dylib.lookupFunction<_c_clang_disposeStringSet, _dart_clang_disposeStringSet>('clang_disposeStringSet'); return _clang_disposeStringSet( - set, + set_1, ); } @@ -3294,11 +3294,11 @@ class IndexerCallbacks extends ffi.Struct { } typedef _c_clang_disposeStringSet = ffi.Void Function( - ffi.Pointer set, + ffi.Pointer set_1, ); typedef _dart_clang_disposeStringSet = void Function( - ffi.Pointer set, + ffi.Pointer set_1, ); typedef _c_clang_createIndex = ffi.Pointer Function( diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index c6e6e83631..62194c1f9a 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -117,7 +117,11 @@ class Func extends LookUpBinding { if (dartDoc != null) { s.write(makeDartDoc(dartDoc)); } - + // Resolve name conflicts in function parameter names. + final paramNamer = UniqueNamer({}); + for (final p in parameters) { + p.name = paramNamer.makeUnique(p.name); + } // Write enclosing function. s.write('${returnType.getDartType(w)} $enclosingFuncName(\n'); for (final p in parameters) { diff --git a/pkgs/ffigen/lib/src/code_generator/typedef.dart b/pkgs/ffigen/lib/src/code_generator/typedef.dart index 17b6deeac1..0cf7f84249 100644 --- a/pkgs/ffigen/lib/src/code_generator/typedef.dart +++ b/pkgs/ffigen/lib/src/code_generator/typedef.dart @@ -44,18 +44,21 @@ class Typedef { s.write(makeDartDoc(dartDoc)); } final typedefName = name; - + final paramNamer = UniqueNamer({}); if (typedefType == TypedefType.C) { s.write('typedef $typedefName = ${returnType.getCType(w)} Function(\n'); for (final p in parameters) { - s.write(' ${p.type.getCType(w)} ${p.name},\n'); + final name = p.name.isNotEmpty ? paramNamer.makeUnique(p.name) : p.name; + s.write(' ${p.type.getCType(w)} ${name},\n'); } s.write(');\n\n'); } else { s.write( 'typedef $typedefName = ${returnType.getDartType(w)} Function(\n'); for (final p in parameters) { - s.write(' ${p.type.getDartType(w)} ${p.name},\n'); + final name = p.name.isNotEmpty ? paramNamer.makeUnique(p.name) : p.name; + + s.write(' ${p.type.getDartType(w)} ${name},\n'); } s.write(');\n\n'); } diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 8da3a6aad9..be2b32e5bd 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 0.1.2 +version: 0.1.3 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C/C++ header files. diff --git a/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart index 24bd079886..e0ebb25525 100644 --- a/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart @@ -5,7 +5,6 @@ import 'package:ffigen/src/code_generator.dart'; import 'package:logging/logging.dart'; import 'package:test/test.dart'; - import '../test_utils.dart'; void main() { diff --git a/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart b/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart index a41e939f46..964d7eaf1a 100644 --- a/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart @@ -15,6 +15,7 @@ void main() { }); test('reserved keyword collision', () { final l1 = Library(name: 'Bindings', bindings: [ + Struc(name: 'abstract'), Struc(name: 'abstract'), Struc(name: 'if'), EnumClass(name: 'return'), @@ -24,10 +25,25 @@ void main() { returnType: Type.nativeType(SupportedNativeType.Void)), Func( name: 'implements', + parameters: [ + Parameter( + type: Type.nativeType(SupportedNativeType.Int32), + name: 'if', + ), + Parameter( + type: Type.nativeType(SupportedNativeType.Int32), + name: 'abstract', + ), + Parameter( + type: Type.nativeType(SupportedNativeType.Int32), + name: 'in', + ), + ], returnType: Type.nativeType(SupportedNativeType.Void)), ]); final l2 = Library(name: 'Bindings', bindings: [ Struc(name: 'abstract_1'), + Struc(name: 'abstract_2'), Struc(name: 'if_1'), EnumClass(name: 'return_1'), EnumClass(name: 'export_1'), @@ -38,9 +54,22 @@ void main() { Func( name: 'implements_1', originalName: 'implements', + parameters: [ + Parameter( + type: Type.nativeType(SupportedNativeType.Int32), + name: 'if_1', + ), + Parameter( + type: Type.nativeType(SupportedNativeType.Int32), + name: 'abstract_1', + ), + Parameter( + type: Type.nativeType(SupportedNativeType.Int32), + name: 'in_1', + ), + ], returnType: Type.nativeType(SupportedNativeType.Void)), ]); - expect(l1.generate(), l2.generate()); }); }); diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index 7cb48a19b2..c6642d8dfc 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -13,12 +13,12 @@ class LibClang { /// Free the given string set. void clang_disposeStringSet( - ffi.Pointer set, + ffi.Pointer set_1, ) { _clang_disposeStringSet ??= _dylib.lookupFunction<_c_clang_disposeStringSet, _dart_clang_disposeStringSet>('clang_disposeStringSet'); return _clang_disposeStringSet( - set, + set_1, ); } @@ -4419,11 +4419,11 @@ abstract class CXIndexOptFlags { } typedef _c_clang_disposeStringSet = ffi.Void Function( - ffi.Pointer set, + ffi.Pointer set_1, ); typedef _dart_clang_disposeStringSet = void Function( - ffi.Pointer set, + ffi.Pointer set_1, ); typedef _c_clang_getBuildSessionTimestamp = ffi.Uint64 Function(); diff --git a/pkgs/ffigen/test/native_test/native_test.dart b/pkgs/ffigen/test/native_test/native_test.dart index efb4ead5bc..0cec0cccbb 100644 --- a/pkgs/ffigen/test/native_test/native_test.dart +++ b/pkgs/ffigen/test/native_test/native_test.dart @@ -7,6 +7,7 @@ import 'dart:io'; import 'dart:math'; import 'package:test/test.dart'; + import '../test_utils.dart'; import 'native_test_bindings.dart' as bindings; From c1048a0cae9614ff88b769a5f319b77c4b164e62 Mon Sep 17 00:00:00 2001 From: Prerak Mann <31154435+mannprerak2@users.noreply.github.com> Date: Mon, 27 Jul 2020 15:42:45 +0530 Subject: [PATCH 021/276] [ffigen] Update config specification for Comments (#48) Closes #38 - Comments config now has a style and length sub keys - `style: doxygen(default) | any`, `length: brief | full(default)`, and can be disabled by passing `comments: false`. - Updated comment type in config. - Updated readme to use `code` tag inside `pre` tag in config options. --- pkgs/ffigen/CHANGELOG.md | 3 + pkgs/ffigen/README.md | 50 +- pkgs/ffigen/example/c_json/pubspec.yaml | 1 + .../example/libclang-example/pubspec.yaml | 7 +- .../lib/src/config_provider/config.dart | 46 +- .../{declaration.dart => config_types.dart} | 58 + .../lib/src/config_provider/spec_utils.dart | 69 +- .../clang_bindings/clang_bindings.dart | 476 +- pkgs/ffigen/lib/src/header_parser/parser.dart | 9 + pkgs/ffigen/lib/src/header_parser/utils.dart | 8 +- pkgs/ffigen/lib/src/strings.dart | 14 +- pkgs/ffigen/pubspec.yaml | 2 +- .../_expected_sqlite_bindings.dart | 5305 +++++++++++++++++ .../large_integration_tests/large_test.dart | 10 +- 14 files changed, 5884 insertions(+), 174 deletions(-) rename pkgs/ffigen/lib/src/config_provider/{declaration.dart => config_types.dart} (63%) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index bd81e15695..bf34d90d50 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.1.4 +- Comments config now has a style and length sub keys - `style: doxygen(default) | any`, `length: brief | full(default)`, and can be disabled by passing `comments: false`. + # 0.1.3 - Handled function arguments - dart keyword name collision - Fix travis tests: the dynamic library is created using `pub run ffigen:setup` before running the tests. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index ce829cf020..4bf4abd67e 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -73,50 +73,50 @@ The following configuration options are available- output yes Output path of the generated bindings. -
output: 'generated_bindings.dart'
+
output: 'generated_bindings.dart'
headers yes List of C headers to use. Glob syntax is allowed. -
+    

 headers:
   - 'folder/**.h'
-  - 'folder/specific_header.h'
+ - 'folder/specific_header.h'
header-filter no Name of headers to include/exclude. -
+    

 header-filter:
   include:
     - 'index.h'
-    - 'platform.h'
+ - 'platform.h'
name prefer Name of generated class. -
name: 'SQLite'
+
name: 'SQLite'
description prefer Dart Doc for generated class. -
description: 'Bindings to SQLite'
+
description: 'Bindings to SQLite'
compiler-opts no Pass compiler options to clang. -
compiler-opts: '-I/usr/lib/llvm-9/include/'
+
compiler-opts: '-I/usr/lib/llvm-9/include/'
functions
structs
enums no Filters for declarations.
Default: all are included -
+    

 functions:
   include: # Exclude is also available.
     names: # Matches with exact name.
@@ -128,7 +128,7 @@ functions:
   prefix: 'cx_' # Prefix added to all functions.
   prefix-replacement: # Replaces a functions's prefix.
     'clang_': ''
-    '_': 'C'
+ '_': 'C'
array-workaround @@ -136,19 +136,23 @@ functions: Should generate workaround for fixed arrays in Structs. See Array Workaround
Default: false -
array-workaround: true
+
array-workaround: true
comments no Extract documentation comments for declarations.
- Options: brief/full/none
- Default: brief
- By default clang only parses documentation comments. To enable - ordinary comments (starting with // or /*) add
- -fparse-all-comments to compiler-opts. + The style and length of the comments can be specified with the following options.
+ style: doxygen(default) | any
+ length: brief | full(default)
+ If you want to disable all comments you can also pass
+ comments: false. -
comments: 'full'
+

+comments:
+  style: doxygen
+  length: full
+    
sort @@ -156,7 +160,7 @@ functions: Sort the bindings according to name.
Default: false, i.e keep the order as in the source files. -
sort: true
+
sort: true
use-supported-typedefs @@ -164,17 +168,17 @@ functions: Should automatically map typedefs, E.g uint8_t => Uint8, int16_t => Int16 etc.
Default: true -
use-supported-typedefs: true
+
use-supported-typedefs: true
preamble no Raw header of the file, pasted as-it-is. -
+    

 preamble: |
   /// AUTO GENERATED FILE, DO NOT EDIT.
   ///
-  /// Generated by `package:ffigen`.
+ /// Generated by `package:ffigen`.
size-map @@ -183,7 +187,7 @@ preamble: | The defaults (see example) may not be portable on all OS. Do not change these unless absolutely sure. -
+    

 # These are optional and also default,
 # Omitting any and the default will be used.
 size-map:
@@ -197,7 +201,7 @@ size-map:
   unsigned long: 8
   long long: 8
   unsigned long long: 8
-  enum: 4
+ enum: 4
diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index 22d64ad6e5..ef1f484d15 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -23,3 +23,4 @@ ffigen: header-filter: include: - 'cJSON.h' + comments: false diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index bc02bad7dc..7cb89dbf62 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -72,5 +72,8 @@ ffigen: /// /// Generated by `package:ffigen`. - # Doc Comments for generated binings: Can be full, brief(default) or none. - comments: full + # Doc Comments for generated binings. + # Comments can be disabled by using comments: false + comments: + style: doxygen # Options - doxygen(default) / any. + length: full # Options - brief / full(default). diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 054087bc15..0f872f9489 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -8,11 +8,10 @@ import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/header_parser/type_extractor/cxtypekindmap.dart'; import 'package:logging/logging.dart'; -import 'package:meta/meta.dart'; import 'package:yaml/yaml.dart'; import '../strings.dart' as strings; -import 'declaration.dart'; +import 'config_types.dart'; import 'spec_utils.dart'; var _logger = Logger('ffigen.config_provider.config'); @@ -51,7 +50,7 @@ class Config { bool useSupportedTypedefs; /// Extracted Doc comment type. - String comment; + CommentType commentType; /// If tool should generate array workarounds. /// @@ -221,13 +220,14 @@ class Config { extractedResult: (dynamic result) => useSupportedTypedefs = result as bool, ), - strings.comments: Specification( + strings.comments: Specification( description: 'Type of comment to extract', requirement: Requirement.no, validator: commentValidator, extractor: commentExtractor, - defaultValue: () => strings.brief, - extractedResult: (dynamic result) => comment = result as String, + defaultValue: () => CommentType.def(), + extractedResult: (dynamic result) => + commentType = result as CommentType, ), strings.arrayWorkaround: Specification( description: @@ -266,40 +266,6 @@ class Config { } } -/// Represents a single specification in configurations. -/// -/// [E] is the return type of the extractedResult. -class Specification { - final String description; - final bool Function(String name, dynamic value) validator; - final E Function(dynamic map) extractor; - final E Function() defaultValue; - - final Requirement requirement; - final void Function(dynamic result) extractedResult; - - Specification({ - @required this.extractedResult, - @required this.description, - @required this.validator, - @required this.extractor, - this.defaultValue, - this.requirement = Requirement.no, - }); -} - -enum Requirement { yes, prefer, no } - -class HeaderFilter { - Set includedInclusionHeaders; - Set excludedInclusionHeaders; - - HeaderFilter({ - this.includedInclusionHeaders = const {}, - this.excludedInclusionHeaders = const {}, - }); -} - class ConfigError implements Exception { final String message; ConfigError([this.message]); diff --git a/pkgs/ffigen/lib/src/config_provider/declaration.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart similarity index 63% rename from pkgs/ffigen/lib/src/config_provider/declaration.dart rename to pkgs/ffigen/lib/src/config_provider/config_types.dart index f808f13273..c44a72bbd4 100644 --- a/pkgs/ffigen/lib/src/config_provider/declaration.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart @@ -2,6 +2,64 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +/// Contains all the neccesary classes required by config. + +import 'package:meta/meta.dart'; + +class CommentType { + CommentStyle style; + CommentLength length; + CommentType(this.style, this.length); + + /// Sets default style as [CommentStyle.doxygen], default length as + /// [CommentLength.full]. + CommentType.def() + : style = CommentStyle.doxygen, + length = CommentLength.full; + + /// Disables any comments. + CommentType.none() + : style = CommentStyle.doxygen, + length = CommentLength.none; +} + +enum CommentStyle { doxygen, any } +enum CommentLength { none, brief, full } + +/// Represents a single specification in configurations. +/// +/// [E] is the return type of the extractedResult. +class Specification { + final String description; + final bool Function(String name, dynamic value) validator; + final E Function(dynamic map) extractor; + final E Function() defaultValue; + + final Requirement requirement; + final void Function(dynamic result) extractedResult; + + Specification({ + @required this.extractedResult, + @required this.description, + @required this.validator, + @required this.extractor, + this.defaultValue, + this.requirement = Requirement.no, + }); +} + +enum Requirement { yes, prefer, no } + +class HeaderFilter { + Set includedInclusionHeaders; + Set excludedInclusionHeaders; + + HeaderFilter({ + this.includedInclusionHeaders = const {}, + this.excludedInclusionHeaders = const {}, + }); +} + /// A generic declaration config. class Declaration { // matchers diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 0dff6e43b4..5170e5ff1f 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -11,8 +11,7 @@ import 'package:path/path.dart' as p; import 'package:yaml/yaml.dart'; import '../strings.dart' as strings; -import './config.dart'; -import 'declaration.dart'; +import 'config_types.dart'; var _logger = Logger('ffigen.config_provider.spec_utils'); @@ -300,19 +299,63 @@ bool dartClassNameValidator(String name, dynamic value) { } } -String commentExtractor(dynamic value) => value as String; +CommentType commentExtractor(dynamic value) { + if (value is bool) { + if (value) { + return CommentType.def(); + } else { + return CommentType.none(); + } + } + final ct = CommentType.def(); + if (value is YamlMap) { + for (final key in value.keys) { + if (key == strings.style) { + if (value[key] == strings.any) { + ct.style = CommentStyle.any; + } else if (value[key] == strings.doxygen) { + ct.style = CommentStyle.doxygen; + } + } else if (key == strings.length) { + if (value[key] == strings.full) { + ct.length = CommentLength.full; + } else if (value[key] == strings.brief) { + ct.length = CommentLength.brief; + } + } + } + } + return ct; +} bool commentValidator(String name, dynamic value) { - if (value is! String) { - _logger.severe("Expected value of key '$name' to be a String."); - return false; - } else { - if (strings.commentTypeSet.contains(value as String)) { - return true; - } else { - _logger.severe( - "Value of key '$name' must be one of the following - ${strings.commentTypeSet}."); - return false; + if (value is bool) { + return true; + } else if (value is YamlMap) { + var result = true; + for (final key in value.keys) { + if (key == strings.style) { + if (value[key] is! String || + !(value[key] == strings.doxygen || value[key] == strings.any)) { + _logger.severe( + "'$name'>'${strings.style}' must be one of the following - {${strings.doxygen}, ${strings.any}}"); + result = false; + } + } else if (key == strings.length) { + if (value[key] is! String || + !(value[key] == strings.brief || value[key] == strings.full)) { + _logger.severe( + "'$name'>'${strings.length}' must be one of the following - {${strings.brief}, ${strings.full}}"); + result = false; + } + } else { + _logger.severe("Unknown key '$key' in '$name'."); + result = false; + } } + return result; + } else { + _logger.severe("Expected value of key '$name' to be a bool or a Map."); + return false; } } diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 975c9ad530..afdf041b70 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -12,6 +12,43 @@ class Clang { Clang(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; /// Provides a shared context for creating translation units. + /// + /// It provides two options: + /// + /// - excludeDeclarationsFromPCH: When non-zero, allows enumeration of "local" + /// declarations (when loading any new translation units). A "local" declaration + /// is one that belongs in the translation unit itself and not in a precompiled + /// header that was used by the translation unit. If zero, all declarations + /// will be enumerated. + /// + /// Here is an example: + /// + /// \code + /// // excludeDeclsFromPCH = 1, displayDiagnostics=1 + /// Idx = clang_createIndex(1, 1); + /// + /// // IndexTest.pch was produced with the following command: + /// // "clang -x c IndexTest.h -emit-ast -o IndexTest.pch" + /// TU = clang_createTranslationUnit(Idx, "IndexTest.pch"); + /// + /// // This will load all the symbols from 'IndexTest.pch' + /// clang_visitChildren(clang_getTranslationUnitCursor(TU), + /// TranslationUnitVisitor, 0); + /// clang_disposeTranslationUnit(TU); + /// + /// // This will load all the symbols from 'IndexTest.c', excluding symbols + /// // from 'IndexTest.pch'. + /// char *args[] = { "-Xclang", "-include-pch=IndexTest.pch" }; + /// TU = clang_createTranslationUnitFromSourceFile(Idx, "IndexTest.c", 2, args, + /// 0, 0); + /// clang_visitChildren(clang_getTranslationUnitCursor(TU), + /// TranslationUnitVisitor, 0); + /// clang_disposeTranslationUnit(TU); + /// \endcode + /// + /// This process of creating the 'pch', loading it separately, and using it (via + /// -include-pch) allows 'excludeDeclsFromPCH' to remove redundant callbacks + /// (which gives the indexer the same performance benefit as the compiler). ffi.Pointer clang_createIndex( int excludeDeclarationsFromPCH, int displayDiagnostics, @@ -28,6 +65,9 @@ class Clang { _dart_clang_createIndex _clang_createIndex; /// Destroy the given index. + /// + /// The index must not be destroyed until all of the translation units created + /// within that index have been destroyed. void clang_disposeIndex( ffi.Pointer index, ) { @@ -41,8 +81,8 @@ class Clang { _dart_clang_disposeIndex _clang_disposeIndex; - /// Determine the number of diagnostics produced for the given translation - /// unit. + /// Determine the number of diagnostics produced for the given + /// translation unit. int clang_getNumDiagnostics( ffi.Pointer Unit, ) { @@ -57,6 +97,12 @@ class Clang { _dart_clang_getNumDiagnostics _clang_getNumDiagnostics; /// Retrieve a diagnostic associated with the given translation unit. + /// + /// \param Unit the translation unit 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_getDiagnostic( ffi.Pointer Unit, int Index, @@ -85,9 +131,10 @@ class Clang { _dart_clang_disposeDiagnostic _clang_disposeDiagnostic; - /// Same as clang_parseTranslationUnit2, but returns the CXTranslationUnit - /// instead of an error code. In case of an error this routine returns a NULL - /// CXTranslationUnit, without further detailed error codes. + /// Same as \c clang_parseTranslationUnit2, but returns + /// the \c CXTranslationUnit instead of an error code. In case of an error this + /// routine returns a \c NULL \c CXTranslationUnit, without further detailed + /// error codes. ffi.Pointer clang_parseTranslationUnit( ffi.Pointer CIdx, ffi.Pointer source_filename, @@ -568,6 +615,11 @@ class Clang { } /// 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 { ffi.Pointer data; @@ -578,8 +630,14 @@ class CXString 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. ffi.Pointer Filename; /// A buffer containing the unsaved contents of this file. @@ -590,7 +648,11 @@ class CXUnsavedFile extends ffi.Struct { int Length; } -/// Identifies a specific source location within a translation unit. +/// 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 { ffi.Pointer _unique_ptr_data_item_0; ffi.Pointer _unique_ptr_data_item_1; @@ -646,6 +708,9 @@ class ArrayHelper_CXSourceLocation_ptr_data_level0 { } /// 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 { ffi.Pointer _unique_ptr_data_item_0; ffi.Pointer _unique_ptr_data_item_1; @@ -704,77 +769,159 @@ class ArrayHelper_CXSourceRange_ptr_data_level0 { } /// Options to control the display of diagnostics. +/// +/// The values in this enum are meant to be combined to customize the +/// behavior of \c clang_formatDiagnostic(). abstract class CXDiagnosticDisplayOptions { - /// Display the source-location information where the diagnostic was located. + /// Display the source-location information where the + /// diagnostic was located. + /// + /// When set, diagnostics will be prefixed by the file, line, and + /// (optionally) column to which the diagnostic refers. For example, + /// + /// \code + /// test.c:28: warning: extra tokens at end of #endif directive + /// \endcode + /// + /// This option corresponds to the clang flag \c -fshow-source-location. static const int CXDiagnostic_DisplaySourceLocation = 1; - /// If displaying the source-location information of the diagnostic, also - /// include the column number. + /// If displaying the source-location information of the + /// diagnostic, also include the column number. + /// + /// This option corresponds to the clang flag \c -fshow-column. 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. + /// If displaying the source-location information of the + /// diagnostic, also include information about source ranges in a + /// machine-parsable format. + /// + /// This option corresponds to the clang flag + /// \c -fdiagnostics-print-source-range-info. static const int CXDiagnostic_DisplaySourceRanges = 4; /// Display the option name associated with this diagnostic, if any. + /// + /// The option name displayed (e.g., -Wconversion) will be placed in brackets + /// after the diagnostic text. This option corresponds to the clang flag + /// \c -fdiagnostics-show-option. static const int CXDiagnostic_DisplayOption = 8; /// Display the category number associated with this diagnostic, if any. + /// + /// The category number is displayed within brackets after the diagnostic text. + /// This option corresponds to the clang flag + /// \c -fdiagnostics-show-category=id. static const int CXDiagnostic_DisplayCategoryId = 16; /// Display the category name associated with this diagnostic, if any. + /// + /// The category name is displayed within brackets after the diagnostic text. + /// This option corresponds to the clang flag + /// \c -fdiagnostics-show-category=name. static const int CXDiagnostic_DisplayCategoryName = 32; } /// Flags that control the creation of translation units. +/// +/// The enumerators in this enumeration type are meant to be bitwise +/// ORed together to specify which options should be used when +/// constructing the translation unit. abstract class CXTranslationUnit_Flags { - /// Used to indicate that no special translation-unit options are needed. + /// 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. + /// + /// Constructing a detailed preprocessing record requires more memory + /// and time to parse, since the information contained in the record + /// is usually not retained. However, it can be useful for + /// applications that require more detailed information about the + /// behavior of the preprocessor. static const int CXTranslationUnit_DetailedPreprocessingRecord = 1; /// Used to indicate that the translation unit is incomplete. + /// + /// When a translation unit is considered "incomplete", semantic + /// analysis that is typically performed at the end of the + /// translation unit will be suppressed. For example, this suppresses + /// the completion of tentative declarations in C and of + /// instantiation of implicitly-instantiation function templates in + /// C++. This option is typically used when parsing a header with the + /// intent of producing a precompiled header. static const int CXTranslationUnit_Incomplete = 2; /// Used to indicate that the translation unit should be built with an /// implicit precompiled header for the preamble. + /// + /// An implicit precompiled header is used as an optimization when a + /// particular translation unit is likely to be reparsed many times + /// when the sources aren't changing that often. In this case, an + /// implicit precompiled header will be built containing all of the + /// initial includes at the top of the main file (what we refer to as + /// the "preamble" of the file). In subsequent parses, if the + /// preamble or the files in it have not changed, \c + /// clang_reparseTranslationUnit() will re-use the implicit + /// precompiled header to improve parsing performance. 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. + /// + /// Caching of code-completion results is a performance optimization that + /// introduces some overhead to reparsing but improves the performance of + /// code-completion operations. static const int CXTranslationUnit_CacheCompletionResults = 8; /// Used to indicate that the translation unit will be serialized with - /// clang_saveTranslationUnit. + /// \c clang_saveTranslationUnit. + /// + /// This option is typically used when parsing a header with the intent of + /// producing a precompiled header. static const int CXTranslationUnit_ForSerialization = 16; /// DEPRECATED: Enabled chained precompiled preambles in C++. + /// + /// Note: this is a *temporary* option that is available only while + /// we are testing C++ precompiled preamble support. It is deprecated. static const int CXTranslationUnit_CXXChainedPCH = 32; /// Used to indicate that function/method bodies should be skipped while /// parsing. + /// + /// This option can be used to search for declarations/definitions while + /// ignoring the usages. 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. + /// 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). + /// 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. + /// + /// When fatal errors are encountered while parsing a translation unit, + /// semantic analysis is typically stopped early when compiling code. A common + /// source for fatal errors are unresolvable include files. For the + /// purposes of an IDE, this is undesirable behavior and as much information + /// as possible should be reported. Use this flag to enable this behavior. 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. + /// Used in combination with CXTranslationUnit_SkipFunctionBodies to + /// constrain the skipping of function bodies to the preamble. + /// + /// The function bodies of the main file are not skipped. static const int CXTranslationUnit_LimitSkipFunctionBodiesToPreamble = 2048; /// Used to indicate that attributed types should be included in CXType. @@ -784,6 +931,11 @@ abstract class CXTranslationUnit_Flags { static const int CXTranslationUnit_VisitImplicitAttributes = 8192; /// Used to indicate that non-errors from included files should be ignored. + /// + /// If set, clang_getDiagnosticSetFromTU() will not report e.g. warnings from + /// included files anymore. This speeds up clang_getDiagnosticSetFromTU() for + /// the case where these warnings are not of interest, as for an IDE for + /// example, which typically shows only the diagnostics in the main file. static const int CXTranslationUnit_IgnoreNonErrorsFromIncludedFiles = 16384; /// Tells the preprocessor not to skip excluded conditional blocks. @@ -792,7 +944,13 @@ abstract class CXTranslationUnit_Flags { /// Describes the kind of entity that a cursor refers to. abstract class CXCursorKind { - /// A declaration whose specific kind is not exposed via this interface. + /// A declaration whose specific kind is not exposed via this + /// interface. + /// + /// Unexposed declarations have the same operations as any other kind + /// of declaration; one can extract their location information, + /// spelling, find their definitions, etc. However, the specific kind + /// of the declaration is not reported. static const int CXCursor_UnexposedDecl = 1; /// A C or C++ struct. @@ -807,8 +965,8 @@ abstract class CXCursorKind { /// 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. + /// 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. @@ -823,16 +981,16 @@ abstract class CXCursorKind { /// A function or method parameter. static const int CXCursor_ParmDecl = 10; - /// An Objective-C @interface. + /// An Objective-C \@interface. static const int CXCursor_ObjCInterfaceDecl = 11; - /// An Objective-C @interface for a category. + /// An Objective-C \@interface for a category. static const int CXCursor_ObjCCategoryDecl = 12; - /// An Objective-C @protocol declaration. + /// An Objective-C \@protocol declaration. static const int CXCursor_ObjCProtocolDecl = 13; - /// An Objective-C @property declaration. + /// An Objective-C \@property declaration. static const int CXCursor_ObjCPropertyDecl = 14; /// An Objective-C instance variable. @@ -844,10 +1002,10 @@ abstract class CXCursorKind { /// An Objective-C class method. static const int CXCursor_ObjCClassMethodDecl = 17; - /// An Objective-C @implementation. + /// An Objective-C \@implementation. static const int CXCursor_ObjCImplementationDecl = 18; - /// An Objective-C @implementation for a category. + /// An Objective-C \@implementation for a category. static const int CXCursor_ObjCCategoryImplDecl = 19; /// A typedef. @@ -901,10 +1059,10 @@ abstract class CXCursorKind { /// A C++ alias declaration static const int CXCursor_TypeAliasDecl = 36; - /// An Objective-C @synthesize definition. + /// An Objective-C \@synthesize definition. static const int CXCursor_ObjCSynthesizeDecl = 37; - /// An Objective-C @dynamic definition. + /// An Objective-C \@dynamic definition. static const int CXCursor_ObjCDynamicDecl = 38; /// An access specifier. @@ -917,29 +1075,85 @@ abstract class CXCursorKind { static const int CXCursor_ObjCClassRef = 42; /// A reference to a type declaration. + /// + /// A type reference occurs anywhere where a type is named but not + /// declared. For example, given: + /// + /// \code + /// typedef unsigned size_type; + /// size_type size; + /// \endcode + /// + /// The typedef is a declaration of size_type (CXCursor_TypedefDecl), + /// while the type of the variable "size" is referenced. The cursor + /// referenced by the type of size is the typedef for size_type. 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. + /// 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. + /// 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. + /// + /// This cursor kind is used to describe the jump to "start_over" in the + /// goto statement in the following example: + /// + /// \code + /// start_over: + /// ++counter; + /// + /// goto start_over; + /// \endcode + /// + /// A label reference cursor refers to a label 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. + /// A reference to a set of overloaded functions or function templates + /// that has not yet been resolved to a specific function or function template. + /// + /// An overloaded declaration reference cursor occurs in C++ templates where + /// a dependent name refers to a function. For example: + /// + /// \code + /// template void swap(T&, T&); + /// + /// struct X { ... }; + /// void swap(X&, X&); + /// + /// template + /// void reverse(T* first, T* last) { + /// while (first < last - 1) { + /// swap(*first, *--last); + /// ++first; + /// } + /// } + /// + /// struct Y { }; + /// void swap(Y&, Y&); + /// \endcode + /// + /// Here, the identifier "swap" is associated with an overloaded declaration + /// reference. In the template definition, "swap" refers to either of the two + /// "swap" functions declared above, so both results will be available. At + /// instantiation time, "swap" may also refer to other functions found via + /// argument-dependent lookup (e.g., the "swap" function at the end of the + /// example). + /// + /// The functions \c clang_getNumOverloadedDecls() and + /// \c clang_getOverloadedDecl() can be used to retrieve the definitions + /// referenced by this cursor. 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. + /// 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; @@ -950,21 +1164,28 @@ abstract class CXCursorKind { static const int CXCursor_LastInvalid = 73; static const int CXCursor_FirstExpr = 100; - /// An expression whose specific kind is not exposed via this interface. + /// An expression whose specific kind is not exposed via this + /// interface. + /// + /// Unexposed expressions have the same operations as any other kind + /// of expression; one can extract their location information, + /// spelling, children, etc. However, the specific kind of the + /// expression is not reported. static const int CXCursor_UnexposedExpr = 100; - /// An expression that refers to some value declaration, such as a function, - /// variable, or enumerator. + /// 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. + /// 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. + /// 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. @@ -986,15 +1207,19 @@ abstract class CXCursorKind { static const int CXCursor_CharacterLiteral = 110; /// A parenthesized expression, e.g. "(1)". + /// + /// This AST node is only formed if full location information is requested. static const int CXCursor_ParenExpr = 111; - /// This represents the unary-expression's (except sizeof and alignof). + /// 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". + /// A builtin binary operation expression such as "x + y" or + /// "x <= y". static const int CXCursor_BinaryOperator = 114; /// Compound assignment such as "+=". @@ -1003,8 +1228,10 @@ abstract class CXCursorKind { /// 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. + /// 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. + /// + /// For example: (int)f. static const int CXCursor_CStyleCastExpr = 117; /// [C99 6.5.2.5] @@ -1022,9 +1249,13 @@ abstract class CXCursorKind { /// 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. + /// 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. + /// + /// The __null extension is typically only used by system headers, which define + /// NULL as __null in C++ rather than using 0 (which is an integer that may not + /// match the size of a pointer). static const int CXCursor_GNUNullExpr = 123; /// C++'s static_cast<> expression. @@ -1039,8 +1270,13 @@ abstract class CXCursorKind { /// 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]). + /// Represents an explicit C++ type conversion that uses "functional" + /// notion (C++ [expr.type.conv]). + /// + /// Example: + /// \code + /// x = int(0.5); + /// \endcode static const int CXCursor_CXXFunctionalCastExpr = 128; /// A C++ typeid expression (C++ [expr.typeid]). @@ -1056,39 +1292,65 @@ abstract class CXCursorKind { static const int CXCursor_CXXThisExpr = 132; /// [C++ 15] C++ Throw Expression. + /// + /// This handles 'throw' and 'throw' assignment-expression. When + /// assignment-expression isn't present, Op will be null. static const int CXCursor_CXXThrowExpr = 133; - /// A new expression for memory allocation and constructor calls, e.g: "new - /// CXXNewExpr(foo)". + /// 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". + /// 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". + /// An Objective-C string literal i.e. @"foo". static const int CXCursor_ObjCStringLiteral = 137; - /// An Objective-C @encode expression. + /// An Objective-C \@encode expression. static const int CXCursor_ObjCEncodeExpr = 138; - /// An Objective-C @selector expression. + /// An Objective-C \@selector expression. static const int CXCursor_ObjCSelectorExpr = 139; - /// An Objective-C @protocol expression. + /// 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. + /// An Objective-C "bridged" cast expression, which casts between + /// Objective-C pointers and C pointers, transferring ownership in the process. + /// + /// \code + /// NSString *str = (__bridge_transfer NSString *)CFCreateString(); + /// \endcode static const int CXCursor_ObjCBridgedCastExpr = 141; - /// Represents a C++0x pack expansion that produces a sequence of expressions. + /// Represents a C++0x pack expansion that produces a sequence of + /// expressions. + /// + /// A pack expansion expression contains a pattern (which itself is an + /// expression) followed by an ellipsis. For example: + /// + /// \code + /// template + /// void forward(F f, Types &&...args) { + /// f(static_cast(args)...); + /// } + /// \endcode static const int CXCursor_PackExpansionExpr = 142; - /// Represents an expression that computes the length of a parameter pack. + /// Represents an expression that computes the length of a parameter + /// pack. + /// + /// \code + /// template + /// struct count { + /// static const unsigned value = sizeof...(Types); + /// }; + /// \endcode static const int CXCursor_SizeOfPackExpr = 143; static const int CXCursor_LambdaExpr = 144; @@ -1101,7 +1363,7 @@ abstract class CXCursorKind { /// OpenMP 4.0 [2.4, Array Section]. static const int CXCursor_OMPArraySectionExpr = 147; - /// Represents an (...) check. + /// Represents an @available(...) check. static const int CXCursor_ObjCAvailabilityCheckExpr = 148; /// Fixed point literal @@ -1109,13 +1371,30 @@ abstract class CXCursorKind { static const int CXCursor_LastExpr = 149; static const int CXCursor_FirstStmt = 200; - /// A statement whose specific kind is not exposed via this interface. + /// A statement whose specific kind is not exposed via this + /// interface. + /// + /// Unexposed statements have the same operations as any other kind of + /// statement; one can extract their location information, spelling, + /// children, etc. However, the specific kind of the statement is not + /// reported. static const int CXCursor_UnexposedStmt = 200; /// A labelled statement in a function. + /// + /// This cursor kind is used to describe the "start_over:" label statement in + /// the following example: + /// + /// \code + /// start_over: + /// ++counter; + /// \endcode static const int CXCursor_LabelStmt = 201; /// A group of statements like { stmt stmt }. + /// + /// This cursor kind is used to describe compound statements, e.g. function + /// bodies. static const int CXCursor_CompoundStmt = 202; /// A case statement. @@ -1158,19 +1437,19 @@ abstract class CXCursorKind { static const int CXCursor_GCCAsmStmt = 215; static const int CXCursor_AsmStmt = 215; - /// Objective-C's overall @try-@catch-@finally statement. + /// Objective-C's overall \@try-\@catch-\@finally statement. static const int CXCursor_ObjCAtTryStmt = 216; - /// Objective-C's @catch statement. + /// Objective-C's \@catch statement. static const int CXCursor_ObjCAtCatchStmt = 217; - /// Objective-C's @finally statement. + /// Objective-C's \@finally statement. static const int CXCursor_ObjCAtFinallyStmt = 218; - /// Objective-C's @throw statement. + /// Objective-C's \@throw statement. static const int CXCursor_ObjCAtThrowStmt = 219; - /// Objective-C's @synchronized statement. + /// Objective-C's \@synchronized statement. static const int CXCursor_ObjCAtSynchronizedStmt = 220; /// Objective-C's autorelease pool statement. @@ -1201,9 +1480,12 @@ abstract class CXCursorKind { static const int CXCursor_MSAsmStmt = 229; /// The null statement ";": C99 6.8.3p3. + /// + /// This cursor kind is used to describe the null statement. static const int CXCursor_NullStmt = 230; - /// Adaptor class for mixing declarations with statements and expressions. + /// Adaptor class for mixing declarations with statements and + /// expressions. static const int CXCursor_DeclStmt = 231; /// OpenMP parallel directive. @@ -1371,10 +1653,14 @@ abstract class CXCursorKind { static const int CXCursor_LastStmt = 285; /// Cursor that represents the translation unit itself. + /// + /// The translation unit cursor exists primarily to act as the root + /// cursor for traversing the contents of a translation unit. static const int CXCursor_TranslationUnit = 300; static const int CXCursor_FirstAttr = 400; - /// An attribute whose specific kind is not exposed via this interface. + /// 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; @@ -1442,8 +1728,22 @@ abstract class CXCursorKind { static const int CXCursor_OverloadCandidate = 700; } -/// A cursor representing some element in the abstract syntax tree for a -/// translation unit. +/// 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() int kind; @@ -1513,7 +1813,8 @@ 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. + /// 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; @@ -1575,6 +1876,8 @@ abstract class CXTypeKind { 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; @@ -1691,18 +1994,21 @@ class ArrayHelper_CXType_data_level0 { } } -/// Describes how the traversal of the children of a particular cursor should -/// proceed after visiting a particular child cursor. +/// Describes how the traversal of the children of a particular +/// cursor should proceed after visiting a particular child cursor. +/// +/// A value of this enumeration type should be returned by each +/// \c CXCursorVisitor to indicate how clang_visitChildren() proceed. 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. + /// 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. + /// Recursively traverse the children of this cursor, using + /// the same visitor and client data. static const int CXChildVisit_Recurse = 2; } diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index 832127aa35..bb171b35d0 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -7,6 +7,7 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/config_provider/config_types.dart'; import 'package:ffigen/src/find_resource.dart'; import 'package:ffigen/src/header_parser/translation_unit_parser.dart'; import 'package:ffigen/src/strings.dart' as strings; @@ -66,6 +67,14 @@ List parseToBindings() { Pointer> clangCmdArgs = nullptr; var cmdLen = 0; + + /// Add compiler opt for comment parsing for clang based on config. + if (config.commentType.length != CommentLength.none && + config.commentType.style == CommentStyle.any) { + config.compilerOpts ??= []; + config.compilerOpts.add(strings.fparseAllComments); + } + if (config.compilerOpts != null) { clangCmdArgs = createDynamicStringArray(config.compilerOpts); cmdLen = config.compilerOpts.length; diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index f8c9507a79..3591e88897 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -6,9 +6,9 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/config_provider/config_types.dart'; import 'package:logging/logging.dart'; -import '../strings.dart' as strings; import 'clang_bindings/clang_bindings.dart' as clang_types; import 'data.dart'; import 'type_extractor/extractor.dart'; @@ -146,13 +146,13 @@ String getCursorDocComment(Pointer cursor, 0) { formattedDocComment = null; } else { - switch (config.comment) { - case strings.full: + switch (config.commentType.length) { + case CommentLength.full: formattedDocComment = removeRawCommentMarkups(clang .clang_Cursor_getRawCommentText_wrap(cursor) .toStringAndDispose()); break; - case strings.brief: + case CommentLength.brief: formattedDocComment = _wrapNoNewLineString( clang .clang_Cursor_getBriefCommentText_wrap(cursor) diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 6bc47cdf2d..963f84c3f7 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -84,12 +84,18 @@ const warnWhenRemoving = 'warn-when-removing'; const arrayWorkaround = 'array-workaround'; const comments = 'comments'; -// Comment type. +// Sub-fields of comments +const style = 'style'; +const length = 'length'; + +// Sub-fields of style +const doxygen = 'doxygen'; +const any = 'any'; +// Sub-fields of length const brief = 'brief'; const full = 'full'; -const none = 'none'; -// Contains all possibe comment types. -const commentTypeSet = {brief, full, none}; +// Cmd line comment option +const fparseAllComments = '-fparse-all-comments'; // Library input. const name = 'name'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index be2b32e5bd..e4f34cf25e 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 0.1.3 +version: 0.1.4 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C/C++ header files. diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index 4f8ef6eb5c..ba750ec99d 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -64,6 +64,40 @@ class SQLite { _dart_sqlite3_compileoption_get _sqlite3_compileoption_get; + /// CAPI3REF: Test To See If The Library Is Threadsafe + /// + /// ^The sqlite3_threadsafe() function returns zero if and only if + /// SQLite was compiled with mutexing code omitted due to the + /// [SQLITE_THREADSAFE] compile-time option being set to 0. + /// + /// SQLite can be compiled with or without mutexes. When + /// the [SQLITE_THREADSAFE] C preprocessor macro is 1 or 2, mutexes + /// are enabled and SQLite is threadsafe. When the + /// [SQLITE_THREADSAFE] macro is 0, + /// the mutexes are omitted. Without the mutexes, it is not safe + /// to use SQLite concurrently from more than one thread. + /// + /// Enabling mutexes incurs a measurable performance penalty. + /// So if speed is of utmost importance, it makes sense to disable + /// the mutexes. But for maximum safety, mutexes should be enabled. + /// ^The default behavior is for mutexes to be enabled. + /// + /// This interface can be used by an application to make sure that the + /// version of SQLite that it is linking against was compiled with + /// the desired setting of the [SQLITE_THREADSAFE] macro. + /// + /// This interface only reports on the compile-time mutex setting + /// of the [SQLITE_THREADSAFE] flag. If SQLite is compiled with + /// SQLITE_THREADSAFE=1 or =2 then mutexes are enabled by default but + /// can be fully or partially disabled using a call to [sqlite3_config()] + /// with the verbs [SQLITE_CONFIG_SINGLETHREAD], [SQLITE_CONFIG_MULTITHREAD], + /// or [SQLITE_CONFIG_SERIALIZED]. ^(The return value of the + /// sqlite3_threadsafe() function shows only the compile-time setting of + /// thread safety, not any run-time changes to that setting made by + /// sqlite3_config(). In other words, the return value from sqlite3_threadsafe() + /// is unchanged by calls to sqlite3_config().)^ + /// + /// See the [threading mode] documentation for additional information. int sqlite3_threadsafe() { _sqlite3_threadsafe ??= _dylib.lookupFunction<_c_sqlite3_threadsafe, _dart_sqlite3_threadsafe>( @@ -73,6 +107,42 @@ class SQLite { _dart_sqlite3_threadsafe _sqlite3_threadsafe; + /// CAPI3REF: Closing A Database Connection + /// DESTRUCTOR: sqlite3 + /// + /// ^The sqlite3_close() and sqlite3_close_v2() routines are destructors + /// for the [sqlite3] object. + /// ^Calls to sqlite3_close() and sqlite3_close_v2() return [SQLITE_OK] if + /// the [sqlite3] object is successfully destroyed and all associated + /// resources are deallocated. + /// + /// Ideally, applications should [sqlite3_finalize | finalize] all + /// [prepared statements], [sqlite3_blob_close | close] all [BLOB handles], and + /// [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated + /// with the [sqlite3] object prior to attempting to close the object. + /// ^If the database connection is associated with unfinalized prepared + /// statements, BLOB handlers, and/or unfinished sqlite3_backup objects then + /// sqlite3_close() will leave the database connection open and return + /// [SQLITE_BUSY]. ^If sqlite3_close_v2() is called with unfinalized prepared + /// statements, unclosed BLOB handlers, and/or unfinished sqlite3_backups, + /// it returns [SQLITE_OK] regardless, but instead of deallocating the database + /// connection immediately, it marks the database connection as an unusable + /// "zombie" and makes arrangements to automatically deallocate the database + /// connection after all prepared statements are finalized, all BLOB handles + /// are closed, and all backups have finished. The sqlite3_close_v2() interface + /// is intended for use with host languages that are garbage collected, and + /// where the order in which destructors are called is arbitrary. + /// + /// ^If an [sqlite3] object is destroyed while a transaction is open, + /// the transaction is automatically rolled back. + /// + /// The C parameter to [sqlite3_close(C)] and [sqlite3_close_v2(C)] + /// must be either a NULL + /// pointer or an [sqlite3] object pointer obtained + /// from [sqlite3_open()], [sqlite3_open16()], or + /// [sqlite3_open_v2()], and not previously closed. + /// ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer + /// argument is a harmless no-op. int sqlite3_close( ffi.Pointer arg0, ) { @@ -98,6 +168,66 @@ class SQLite { _dart_sqlite3_close_v2 _sqlite3_close_v2; + /// CAPI3REF: One-Step Query Execution Interface + /// METHOD: sqlite3 + /// + /// The sqlite3_exec() interface is a convenience wrapper around + /// [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()], + /// that allows an application to run multiple statements of SQL + /// without having to use a lot of C code. + /// + /// ^The sqlite3_exec() interface runs zero or more UTF-8 encoded, + /// semicolon-separate SQL statements passed into its 2nd argument, + /// in the context of the [database connection] passed in as its 1st + /// argument. ^If the callback function of the 3rd argument to + /// sqlite3_exec() is not NULL, then it is invoked for each result row + /// coming out of the evaluated SQL statements. ^The 4th argument to + /// sqlite3_exec() is relayed through to the 1st argument of each + /// callback invocation. ^If the callback pointer to sqlite3_exec() + /// is NULL, then no callback is ever invoked and result rows are + /// ignored. + /// + /// ^If an error occurs while evaluating the SQL statements passed into + /// sqlite3_exec(), then execution of the current statement stops and + /// subsequent statements are skipped. ^If the 5th parameter to sqlite3_exec() + /// is not NULL then any error message is written into memory obtained + /// from [sqlite3_malloc()] and passed back through the 5th parameter. + /// To avoid memory leaks, the application should invoke [sqlite3_free()] + /// on error message strings returned through the 5th parameter of + /// sqlite3_exec() after the error message string is no longer needed. + /// ^If the 5th parameter to sqlite3_exec() is not NULL and no errors + /// occur, then sqlite3_exec() sets the pointer in its 5th parameter to + /// NULL before returning. + /// + /// ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec() + /// routine returns SQLITE_ABORT without invoking the callback again and + /// without running any subsequent SQL statements. + /// + /// ^The 2nd argument to the sqlite3_exec() callback function is the + /// number of columns in the result. ^The 3rd argument to the sqlite3_exec() + /// callback is an array of pointers to strings obtained as if from + /// [sqlite3_column_text()], one for each column. ^If an element of a + /// result row is NULL then the corresponding string pointer for the + /// sqlite3_exec() callback is a NULL pointer. ^The 4th argument to the + /// sqlite3_exec() callback is an array of pointers to strings where each + /// entry represents the name of corresponding result column as obtained + /// from [sqlite3_column_name()]. + /// + /// ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer + /// to an empty string, or a pointer that contains only whitespace and/or + /// SQL comments, then no SQL statements are evaluated and the database + /// is not changed. + /// + /// Restrictions: + /// + ///
    + ///
  • The application must ensure that the 1st parameter to sqlite3_exec() + /// is a valid and open [database connection]. + ///
  • The application must not close the [database connection] specified by + /// the 1st parameter to sqlite3_exec() while sqlite3_exec() is running. + ///
  • The application must not modify the SQL statement text passed into + /// the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running. + ///
int sqlite3_exec( ffi.Pointer arg0, ffi.Pointer sql, @@ -118,6 +248,79 @@ class SQLite { _dart_sqlite3_exec _sqlite3_exec; + /// CAPI3REF: Initialize The SQLite Library + /// + /// ^The sqlite3_initialize() routine initializes the + /// SQLite library. ^The sqlite3_shutdown() routine + /// deallocates any resources that were allocated by sqlite3_initialize(). + /// These routines are designed to aid in process initialization and + /// shutdown on embedded systems. Workstation applications using + /// SQLite normally do not need to invoke either of these routines. + /// + /// A call to sqlite3_initialize() is an "effective" call if it is + /// the first time sqlite3_initialize() is invoked during the lifetime of + /// the process, or if it is the first time sqlite3_initialize() is invoked + /// following a call to sqlite3_shutdown(). ^(Only an effective call + /// of sqlite3_initialize() does any initialization. All other calls + /// are harmless no-ops.)^ + /// + /// A call to sqlite3_shutdown() is an "effective" call if it is the first + /// call to sqlite3_shutdown() since the last sqlite3_initialize(). ^(Only + /// an effective call to sqlite3_shutdown() does any deinitialization. + /// All other valid calls to sqlite3_shutdown() are harmless no-ops.)^ + /// + /// The sqlite3_initialize() interface is threadsafe, but sqlite3_shutdown() + /// is not. The sqlite3_shutdown() interface must only be called from a + /// single thread. All open [database connections] must be closed and all + /// other SQLite resources must be deallocated prior to invoking + /// sqlite3_shutdown(). + /// + /// Among other things, ^sqlite3_initialize() will invoke + /// sqlite3_os_init(). Similarly, ^sqlite3_shutdown() + /// will invoke sqlite3_os_end(). + /// + /// ^The sqlite3_initialize() routine returns [SQLITE_OK] on success. + /// ^If for some reason, sqlite3_initialize() is unable to initialize + /// the library (perhaps it is unable to allocate a needed resource such + /// as a mutex) it returns an [error code] other than [SQLITE_OK]. + /// + /// ^The sqlite3_initialize() routine is called internally by many other + /// SQLite interfaces so that an application usually does not need to + /// invoke sqlite3_initialize() directly. For example, [sqlite3_open()] + /// calls sqlite3_initialize() so the SQLite library will be automatically + /// initialized when [sqlite3_open()] is called if it has not be initialized + /// already. ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT] + /// compile-time option, then the automatic calls to sqlite3_initialize() + /// are omitted and the application must call sqlite3_initialize() directly + /// prior to using any other SQLite interface. For maximum portability, + /// it is recommended that applications always invoke sqlite3_initialize() + /// directly prior to using any other SQLite interface. Future releases + /// of SQLite may require this. In other words, the behavior exhibited + /// when SQLite is compiled with [SQLITE_OMIT_AUTOINIT] might become the + /// default behavior in some future release of SQLite. + /// + /// The sqlite3_os_init() routine does operating-system specific + /// initialization of the SQLite library. The sqlite3_os_end() + /// routine undoes the effect of sqlite3_os_init(). Typical tasks + /// performed by these routines include allocation or deallocation + /// of static resources, initialization of global variables, + /// setting up a default [sqlite3_vfs] module, or setting up + /// a default configuration using [sqlite3_config()]. + /// + /// The application should never invoke either sqlite3_os_init() + /// or sqlite3_os_end() directly. The application should only invoke + /// sqlite3_initialize() and sqlite3_shutdown(). The sqlite3_os_init() + /// interface is called automatically by sqlite3_initialize() and + /// sqlite3_os_end() is called by sqlite3_shutdown(). Appropriate + /// implementations for sqlite3_os_init() and sqlite3_os_end() + /// are built into SQLite when it is compiled for Unix, Windows, or OS/2. + /// When [custom builds | built for other platforms] + /// (using the [SQLITE_OS_OTHER=1] compile-time + /// option) the application must supply a suitable implementation for + /// sqlite3_os_init() and sqlite3_os_end(). An application-supplied + /// implementation of sqlite3_os_init() or sqlite3_os_end() + /// must return [SQLITE_OK] on success and some other [error code] upon + /// failure. int sqlite3_initialize() { _sqlite3_initialize ??= _dylib.lookupFunction<_c_sqlite3_initialize, _dart_sqlite3_initialize>( @@ -154,6 +357,35 @@ class SQLite { _dart_sqlite3_os_end _sqlite3_os_end; + /// CAPI3REF: Configuring The SQLite Library + /// + /// The sqlite3_config() interface is used to make global configuration + /// changes to SQLite in order to tune SQLite to the specific needs of + /// the application. The default configuration is recommended for most + /// applications and so this routine is usually not necessary. It is + /// provided to support rare applications with unusual needs. + /// + /// The sqlite3_config() interface is not threadsafe. The application + /// must ensure that no other SQLite interfaces are invoked by other + /// threads while sqlite3_config() is running. + /// + /// The sqlite3_config() interface + /// may only be invoked prior to library initialization using + /// [sqlite3_initialize()] or after shutdown by [sqlite3_shutdown()]. + /// ^If sqlite3_config() is called after [sqlite3_initialize()] and before + /// [sqlite3_shutdown()] then it will return SQLITE_MISUSE. + /// Note, however, that ^sqlite3_config() can be called as part of the + /// implementation of an application-defined [sqlite3_os_init()]. + /// + /// The first argument to sqlite3_config() is an integer + /// [configuration option] that determines + /// what property of SQLite is to be configured. Subsequent arguments + /// vary depending on the [configuration option] + /// in the first argument. + /// + /// ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK]. + /// ^If the option is unknown or SQLite is unable to set the option + /// then this routine returns a non-zero [error code]. int sqlite3_config( int arg0, ) { @@ -167,6 +399,21 @@ class SQLite { _dart_sqlite3_config _sqlite3_config; + /// CAPI3REF: Configure database connections + /// METHOD: sqlite3 + /// + /// The sqlite3_db_config() interface is used to make configuration + /// changes to a [database connection]. The interface is similar to + /// [sqlite3_config()] except that the changes apply to a single + /// [database connection] (specified in the first argument). + /// + /// The second argument to sqlite3_db_config(D,V,...) is the + /// [SQLITE_DBCONFIG_LOOKASIDE | configuration verb] - an integer code + /// that indicates what aspect of the [database connection] is being configured. + /// Subsequent arguments vary depending on the configuration verb. + /// + /// ^Calls to sqlite3_db_config() return SQLITE_OK if and only if + /// the call is considered successful. int sqlite3_db_config( ffi.Pointer arg0, int op, @@ -182,6 +429,12 @@ class SQLite { _dart_sqlite3_db_config _sqlite3_db_config; + /// CAPI3REF: Enable Or Disable Extended Result Codes + /// METHOD: sqlite3 + /// + /// ^The sqlite3_extended_result_codes() routine enables or disables the + /// [extended result codes] feature of SQLite. ^The extended result + /// codes are disabled by default for historical compatibility. int sqlite3_extended_result_codes( ffi.Pointer arg0, int onoff, @@ -197,6 +450,64 @@ class SQLite { _dart_sqlite3_extended_result_codes _sqlite3_extended_result_codes; + /// CAPI3REF: Last Insert Rowid + /// METHOD: sqlite3 + /// + /// ^Each entry in most SQLite tables (except for [WITHOUT ROWID] tables) + /// has a unique 64-bit signed + /// integer key called the [ROWID | "rowid"]. ^The rowid is always available + /// as an undeclared column named ROWID, OID, or _ROWID_ as long as those + /// names are not also used by explicitly declared columns. ^If + /// the table has a column of type [INTEGER PRIMARY KEY] then that column + /// is another alias for the rowid. + /// + /// ^The sqlite3_last_insert_rowid(D) interface usually returns the [rowid] of + /// the most recent successful [INSERT] into a rowid table or [virtual table] + /// on database connection D. ^Inserts into [WITHOUT ROWID] tables are not + /// recorded. ^If no successful [INSERT]s into rowid tables have ever occurred + /// on the database connection D, then sqlite3_last_insert_rowid(D) returns + /// zero. + /// + /// As well as being set automatically as rows are inserted into database + /// tables, the value returned by this function may be set explicitly by + /// [sqlite3_set_last_insert_rowid()] + /// + /// Some virtual table implementations may INSERT rows into rowid tables as + /// part of committing a transaction (e.g. to flush data accumulated in memory + /// to disk). In this case subsequent calls to this function return the rowid + /// associated with these internal INSERT operations, which leads to + /// unintuitive results. Virtual table implementations that do write to rowid + /// tables in this way can avoid this problem by restoring the original + /// rowid value using [sqlite3_set_last_insert_rowid()] before returning + /// control to the user. + /// + /// ^(If an [INSERT] occurs within a trigger then this routine will + /// return the [rowid] of the inserted row as long as the trigger is + /// running. Once the trigger program ends, the value returned + /// by this routine reverts to what it was before the trigger was fired.)^ + /// + /// ^An [INSERT] that fails due to a constraint violation is not a + /// successful [INSERT] and does not change the value returned by this + /// routine. ^Thus INSERT OR FAIL, INSERT OR IGNORE, INSERT OR ROLLBACK, + /// and INSERT OR ABORT make no changes to the return value of this + /// routine when their insertion fails. ^(When INSERT OR REPLACE + /// encounters a constraint violation, it does not fail. The + /// INSERT continues to completion after deleting rows that caused + /// the constraint problem so INSERT OR REPLACE will always change + /// the return value of this interface.)^ + /// + /// ^For the purposes of this routine, an [INSERT] is considered to + /// be successful even if it is subsequently rolled back. + /// + /// This function is accessible to SQL statements via the + /// [last_insert_rowid() SQL function]. + /// + /// If a separate thread performs a new [INSERT] on the same + /// database connection while the [sqlite3_last_insert_rowid()] + /// function is running and thus changes the last insert [rowid], + /// then the value returned by [sqlite3_last_insert_rowid()] is + /// unpredictable and might not equal either the old or the new + /// last insert [rowid]. int sqlite3_last_insert_rowid( ffi.Pointer arg0, ) { @@ -210,6 +521,12 @@ class SQLite { _dart_sqlite3_last_insert_rowid _sqlite3_last_insert_rowid; + /// CAPI3REF: Set the Last Insert Rowid value. + /// METHOD: sqlite3 + /// + /// The sqlite3_set_last_insert_rowid(D, R) method allows the application to + /// set the value returned by calling sqlite3_last_insert_rowid(D) to R + /// without inserting a row into the database. void sqlite3_set_last_insert_rowid( ffi.Pointer arg0, int arg1, @@ -225,6 +542,60 @@ class SQLite { _dart_sqlite3_set_last_insert_rowid _sqlite3_set_last_insert_rowid; + /// CAPI3REF: Count The Number Of Rows Modified + /// METHOD: sqlite3 + /// + /// ^This function returns the number of rows modified, inserted or + /// deleted by the most recently completed INSERT, UPDATE or DELETE + /// statement on the database connection specified by the only parameter. + /// ^Executing any other type of SQL statement does not modify the value + /// returned by this function. + /// + /// ^Only changes made directly by the INSERT, UPDATE or DELETE statement are + /// considered - auxiliary changes caused by [CREATE TRIGGER | triggers], + /// [foreign key actions] or [REPLACE] constraint resolution are not counted. + /// + /// Changes to a view that are intercepted by + /// [INSTEAD OF trigger | INSTEAD OF triggers] are not counted. ^The value + /// returned by sqlite3_changes() immediately after an INSERT, UPDATE or + /// DELETE statement run on a view is always zero. Only changes made to real + /// tables are counted. + /// + /// Things are more complicated if the sqlite3_changes() function is + /// executed while a trigger program is running. This may happen if the + /// program uses the [changes() SQL function], or if some other callback + /// function invokes sqlite3_changes() directly. Essentially: + /// + ///
    + ///
  • ^(Before entering a trigger program the value returned by + /// sqlite3_changes() function is saved. After the trigger program + /// has finished, the original value is restored.)^ + /// + ///
  • ^(Within a trigger program each INSERT, UPDATE and DELETE + /// statement sets the value returned by sqlite3_changes() + /// upon completion as normal. Of course, this value will not include + /// any changes performed by sub-triggers, as the sqlite3_changes() + /// value will be saved and restored after each sub-trigger has run.)^ + ///
+ /// + /// ^This means that if the changes() SQL function (or similar) is used + /// by the first INSERT, UPDATE or DELETE statement within a trigger, it + /// returns the value as set when the calling statement began executing. + /// ^If it is used by the second or subsequent such statement within a trigger + /// program, the value returned reflects the number of rows modified by the + /// previous INSERT, UPDATE or DELETE statement within the same trigger. + /// + /// If a separate thread makes changes on the same database connection + /// while [sqlite3_changes()] is running then the value returned + /// is unpredictable and not meaningful. + /// + /// See also: + ///
    + ///
  • the [sqlite3_total_changes()] interface + ///
  • the [count_changes pragma] + ///
  • the [changes() SQL function] + ///
  • the [data_version pragma] + ///
int sqlite3_changes( ffi.Pointer arg0, ) { @@ -238,6 +609,39 @@ class SQLite { _dart_sqlite3_changes _sqlite3_changes; + /// CAPI3REF: Total Number Of Rows Modified + /// METHOD: sqlite3 + /// + /// ^This function returns the total number of rows inserted, modified or + /// deleted by all [INSERT], [UPDATE] or [DELETE] statements completed + /// since the database connection was opened, including those executed as + /// part of trigger programs. ^Executing any other type of SQL statement + /// does not affect the value returned by sqlite3_total_changes(). + /// + /// ^Changes made as part of [foreign key actions] are included in the + /// count, but those made as part of REPLACE constraint resolution are + /// not. ^Changes to a view that are intercepted by INSTEAD OF triggers + /// are not counted. + /// + /// The [sqlite3_total_changes(D)] interface only reports the number + /// of rows that changed due to SQL statement run against database + /// connection D. Any changes by other database connections are ignored. + /// To detect changes against a database file from other database + /// connections use the [PRAGMA data_version] command or the + /// [SQLITE_FCNTL_DATA_VERSION] [file control]. + /// + /// If a separate thread makes changes on the same database connection + /// while [sqlite3_total_changes()] is running then the value + /// returned is unpredictable and not meaningful. + /// + /// See also: + ///
    + ///
  • the [sqlite3_changes()] interface + ///
  • the [count_changes pragma] + ///
  • the [changes() SQL function] + ///
  • the [data_version pragma] + ///
  • the [SQLITE_FCNTL_DATA_VERSION] [file control] + ///
int sqlite3_total_changes( ffi.Pointer arg0, ) { @@ -250,6 +654,39 @@ class SQLite { _dart_sqlite3_total_changes _sqlite3_total_changes; + /// CAPI3REF: Interrupt A Long-Running Query + /// METHOD: sqlite3 + /// + /// ^This function causes any pending database operation to abort and + /// return at its earliest opportunity. This routine is typically + /// called in response to a user action such as pressing "Cancel" + /// or Ctrl-C where the user wants a long query operation to halt + /// immediately. + /// + /// ^It is safe to call this routine from a thread different from the + /// thread that is currently running the database operation. But it + /// is not safe to call this routine with a [database connection] that + /// is closed or might close before sqlite3_interrupt() returns. + /// + /// ^If an SQL operation is very nearly finished at the time when + /// sqlite3_interrupt() is called, then it might not have an opportunity + /// to be interrupted and might continue to completion. + /// + /// ^An SQL operation that is interrupted will return [SQLITE_INTERRUPT]. + /// ^If the interrupted SQL operation is an INSERT, UPDATE, or DELETE + /// that is inside an explicit transaction, then the entire transaction + /// will be rolled back automatically. + /// + /// ^The sqlite3_interrupt(D) call is in effect until all currently running + /// SQL statements on [database connection] D complete. ^Any new SQL statements + /// that are started after the sqlite3_interrupt() call and before the + /// running statement count reaches zero are interrupted as if they had been + /// running prior to the sqlite3_interrupt() call. ^New SQL statements + /// that are started after the running statement count reaches zero are + /// not effected by the sqlite3_interrupt(). + /// ^A call to sqlite3_interrupt(D) that occurs when there are no running + /// SQL statements is a no-op and has no effect on SQL statements + /// that are started after the sqlite3_interrupt() call returns. void sqlite3_interrupt( ffi.Pointer arg0, ) { @@ -263,6 +700,37 @@ class SQLite { _dart_sqlite3_interrupt _sqlite3_interrupt; + /// CAPI3REF: Determine If An SQL Statement Is Complete + /// + /// These routines are useful during command-line input to determine if the + /// currently entered text seems to form a complete SQL statement or + /// if additional input is needed before sending the text into + /// SQLite for parsing. ^These routines return 1 if the input string + /// appears to be a complete SQL statement. ^A statement is judged to be + /// complete if it ends with a semicolon token and is not a prefix of a + /// well-formed CREATE TRIGGER statement. ^Semicolons that are embedded within + /// string literals or quoted identifier names or comments are not + /// independent tokens (they are part of the token in which they are + /// embedded) and thus do not count as a statement terminator. ^Whitespace + /// and comments that follow the final semicolon are ignored. + /// + /// ^These routines return 0 if the statement is incomplete. ^If a + /// memory allocation fails, then SQLITE_NOMEM is returned. + /// + /// ^These routines do not parse the SQL statements thus + /// will not detect syntactically incorrect SQL. + /// + /// ^(If SQLite has not been initialized using [sqlite3_initialize()] prior + /// to invoking sqlite3_complete16() then sqlite3_initialize() is invoked + /// automatically by sqlite3_complete16(). If that initialization fails, + /// then the return value from sqlite3_complete16() will be non-zero + /// regardless of whether or not the input SQL is complete.)^ + /// + /// The input to [sqlite3_complete()] must be a zero-terminated + /// UTF-8 string. + /// + /// The input to [sqlite3_complete16()] must be a zero-terminated + /// UTF-16 string in native byte order. int sqlite3_complete( ffi.Pointer sql, ) { @@ -289,6 +757,63 @@ class SQLite { _dart_sqlite3_complete16 _sqlite3_complete16; + /// CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors + /// KEYWORDS: {busy-handler callback} {busy handler} + /// METHOD: sqlite3 + /// + /// ^The sqlite3_busy_handler(D,X,P) routine sets a callback function X + /// that might be invoked with argument P whenever + /// an attempt is made to access a database table associated with + /// [database connection] D when another thread + /// or process has the table locked. + /// The sqlite3_busy_handler() interface is used to implement + /// [sqlite3_busy_timeout()] and [PRAGMA busy_timeout]. + /// + /// ^If the busy callback is NULL, then [SQLITE_BUSY] + /// is returned immediately upon encountering the lock. ^If the busy callback + /// is not NULL, then the callback might be invoked with two arguments. + /// + /// ^The first argument to the busy handler is a copy of the void* pointer which + /// is the third argument to sqlite3_busy_handler(). ^The second argument to + /// the busy handler callback is the number of times that the busy handler has + /// been invoked previously for the same locking event. ^If the + /// busy callback returns 0, then no additional attempts are made to + /// access the database and [SQLITE_BUSY] is returned + /// to the application. + /// ^If the callback returns non-zero, then another attempt + /// is made to access the database and the cycle repeats. + /// + /// The presence of a busy handler does not guarantee that it will be invoked + /// when there is lock contention. ^If SQLite determines that invoking the busy + /// handler could result in a deadlock, it will go ahead and return [SQLITE_BUSY] + /// to the application instead of invoking the + /// busy handler. + /// Consider a scenario where one process is holding a read lock that + /// it is trying to promote to a reserved lock and + /// a second process is holding a reserved lock that it is trying + /// to promote to an exclusive lock. The first process cannot proceed + /// because it is blocked by the second and the second process cannot + /// proceed because it is blocked by the first. If both processes + /// invoke the busy handlers, neither will make any progress. Therefore, + /// SQLite returns [SQLITE_BUSY] for the first process, hoping that this + /// will induce the first process to release its read lock and allow + /// the second process to proceed. + /// + /// ^The default busy callback is NULL. + /// + /// ^(There can only be a single busy handler defined for each + /// [database connection]. Setting a new busy handler clears any + /// previously set handler.)^ ^Note that calling [sqlite3_busy_timeout()] + /// or evaluating [PRAGMA busy_timeout=N] will change the + /// busy handler and thus clear any previously set busy handler. + /// + /// The busy callback should not take any actions which modify the + /// database connection that invoked the busy handler. In other words, + /// the busy handler is not reentrant. Any such actions + /// result in undefined behavior. + /// + /// A busy handler must not close the database connection + /// or [prepared statement] that invoked the busy handler. int sqlite3_busy_handler( ffi.Pointer arg0, ffi.Pointer> arg1, @@ -305,6 +830,25 @@ class SQLite { _dart_sqlite3_busy_handler _sqlite3_busy_handler; + /// CAPI3REF: Set A Busy Timeout + /// METHOD: sqlite3 + /// + /// ^This routine sets a [sqlite3_busy_handler | busy handler] that sleeps + /// for a specified amount of time when a table is locked. ^The handler + /// will sleep multiple times until at least "ms" milliseconds of sleeping + /// have accumulated. ^After at least "ms" milliseconds of sleeping, + /// the handler returns 0 which causes [sqlite3_step()] to return + /// [SQLITE_BUSY]. + /// + /// ^Calling this routine with an argument less than or equal to zero + /// turns off all busy handlers. + /// + /// ^(There can only be a single busy handler for a particular + /// [database connection] at any given moment. If another busy handler + /// was defined (using [sqlite3_busy_handler()]) prior to calling + /// this routine, that other busy handler is cleared.)^ + /// + /// See also: [PRAGMA busy_timeout] int sqlite3_busy_timeout( ffi.Pointer arg0, int ms, @@ -319,6 +863,77 @@ class SQLite { _dart_sqlite3_busy_timeout _sqlite3_busy_timeout; + /// CAPI3REF: Convenience Routines For Running Queries + /// METHOD: sqlite3 + /// + /// This is a legacy interface that is preserved for backwards compatibility. + /// Use of this interface is not recommended. + /// + /// Definition: A result table is memory data structure created by the + /// [sqlite3_get_table()] interface. A result table records the + /// complete query results from one or more queries. + /// + /// The table conceptually has a number of rows and columns. But + /// these numbers are not part of the result table itself. These + /// numbers are obtained separately. Let N be the number of rows + /// and M be the number of columns. + /// + /// A result table is an array of pointers to zero-terminated UTF-8 strings. + /// There are (N+1)*M elements in the array. The first M pointers point + /// to zero-terminated strings that contain the names of the columns. + /// The remaining entries all point to query results. NULL values result + /// in NULL pointers. All other values are in their UTF-8 zero-terminated + /// string representation as returned by [sqlite3_column_text()]. + /// + /// A result table might consist of one or more memory allocations. + /// It is not safe to pass a result table directly to [sqlite3_free()]. + /// A result table should be deallocated using [sqlite3_free_table()]. + /// + /// ^(As an example of the result table format, suppose a query result + /// is as follows: + /// + ///
+  /// Name        | Age
+  /// -----------------------
+  /// Alice       | 43
+  /// Bob         | 28
+  /// Cindy       | 21
+  /// 
+ /// + /// There are two columns (M==2) and three rows (N==3). Thus the + /// result table has 8 entries. Suppose the result table is stored + /// in an array named azResult. Then azResult holds this content: + /// + ///
+  /// azResult[0] = "Name";
+  /// azResult[1] = "Age";
+  /// azResult[2] = "Alice";
+  /// azResult[3] = "43";
+  /// azResult[4] = "Bob";
+  /// azResult[5] = "28";
+  /// azResult[6] = "Cindy";
+  /// azResult[7] = "21";
+  /// 
)^ + /// + /// ^The sqlite3_get_table() function evaluates one or more + /// semicolon-separated SQL statements in the zero-terminated UTF-8 + /// string of its 2nd parameter and returns a result table to the + /// pointer given in its 3rd parameter. + /// + /// After the application has finished with the result from sqlite3_get_table(), + /// it must pass the result table pointer to sqlite3_free_table() in order to + /// release the memory that was malloced. Because of the way the + /// [sqlite3_malloc()] happens within sqlite3_get_table(), the calling + /// function must not try to call [sqlite3_free()] directly. Only + /// [sqlite3_free_table()] is able to release the memory properly and safely. + /// + /// The sqlite3_get_table() interface is implemented as a wrapper around + /// [sqlite3_exec()]. The sqlite3_get_table() routine does not have access + /// to any internal data structures of SQLite. It uses only the public + /// interface defined here. As a consequence, errors that occur in the + /// wrapper layer outside of the internal [sqlite3_exec()] call are not + /// reflected in subsequent calls to [sqlite3_errcode()] or + /// [sqlite3_errmsg()]. int sqlite3_get_table( ffi.Pointer db, ffi.Pointer zSql, @@ -355,6 +970,44 @@ class SQLite { _dart_sqlite3_free_table _sqlite3_free_table; + /// CAPI3REF: Formatted String Printing Functions + /// + /// These routines are work-alikes of the "printf()" family of functions + /// from the standard C library. + /// These routines understand most of the common formatting options from + /// the standard library printf() + /// plus some additional non-standard formats ([%q], [%Q], [%w], and [%z]). + /// See the [built-in printf()] documentation for details. + /// + /// ^The sqlite3_mprintf() and sqlite3_vmprintf() routines write their + /// results into memory obtained from [sqlite3_malloc64()]. + /// The strings returned by these two routines should be + /// released by [sqlite3_free()]. ^Both routines return a + /// NULL pointer if [sqlite3_malloc64()] is unable to allocate enough + /// memory to hold the resulting string. + /// + /// ^(The sqlite3_snprintf() routine is similar to "snprintf()" from + /// the standard C library. The result is written into the + /// buffer supplied as the second parameter whose size is given by + /// the first parameter. Note that the order of the + /// first two parameters is reversed from snprintf().)^ This is an + /// historical accident that cannot be fixed without breaking + /// backwards compatibility. ^(Note also that sqlite3_snprintf() + /// returns a pointer to its buffer instead of the number of + /// characters actually written into the buffer.)^ We admit that + /// the number of characters written would be a more useful return + /// value but we cannot change the implementation of sqlite3_snprintf() + /// now without breaking compatibility. + /// + /// ^As long as the buffer size is greater than zero, sqlite3_snprintf() + /// guarantees that the buffer is always zero-terminated. ^The first + /// parameter "n" is the total size of the buffer, including space for + /// the zero terminator. So the longest string that can be completely + /// written will be n-1 characters. + /// + /// ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf(). + /// + /// See also: [built-in printf()], [printf() SQL function] ffi.Pointer sqlite3_mprintf( ffi.Pointer arg0, ) { @@ -385,6 +1038,79 @@ class SQLite { _dart_sqlite3_snprintf _sqlite3_snprintf; + /// CAPI3REF: Memory Allocation Subsystem + /// + /// The SQLite core uses these three routines for all of its own + /// internal memory allocation needs. "Core" in the previous sentence + /// does not include operating-system specific [VFS] implementation. The + /// Windows VFS uses native malloc() and free() for some operations. + /// + /// ^The sqlite3_malloc() routine returns a pointer to a block + /// of memory at least N bytes in length, where N is the parameter. + /// ^If sqlite3_malloc() is unable to obtain sufficient free + /// memory, it returns a NULL pointer. ^If the parameter N to + /// sqlite3_malloc() is zero or negative then sqlite3_malloc() returns + /// a NULL pointer. + /// + /// ^The sqlite3_malloc64(N) routine works just like + /// sqlite3_malloc(N) except that N is an unsigned 64-bit integer instead + /// of a signed 32-bit integer. + /// + /// ^Calling sqlite3_free() with a pointer previously returned + /// by sqlite3_malloc() or sqlite3_realloc() releases that memory so + /// that it might be reused. ^The sqlite3_free() routine is + /// a no-op if is called with a NULL pointer. Passing a NULL pointer + /// to sqlite3_free() is harmless. After being freed, memory + /// should neither be read nor written. Even reading previously freed + /// memory might result in a segmentation fault or other severe error. + /// Memory corruption, a segmentation fault, or other severe error + /// might result if sqlite3_free() is called with a non-NULL pointer that + /// was not obtained from sqlite3_malloc() or sqlite3_realloc(). + /// + /// ^The sqlite3_realloc(X,N) interface attempts to resize a + /// prior memory allocation X to be at least N bytes. + /// ^If the X parameter to sqlite3_realloc(X,N) + /// is a NULL pointer then its behavior is identical to calling + /// sqlite3_malloc(N). + /// ^If the N parameter to sqlite3_realloc(X,N) is zero or + /// negative then the behavior is exactly the same as calling + /// sqlite3_free(X). + /// ^sqlite3_realloc(X,N) returns a pointer to a memory allocation + /// of at least N bytes in size or NULL if insufficient memory is available. + /// ^If M is the size of the prior allocation, then min(N,M) bytes + /// of the prior allocation are copied into the beginning of buffer returned + /// by sqlite3_realloc(X,N) and the prior allocation is freed. + /// ^If sqlite3_realloc(X,N) returns NULL and N is positive, then the + /// prior allocation is not freed. + /// + /// ^The sqlite3_realloc64(X,N) interfaces works the same as + /// sqlite3_realloc(X,N) except that N is a 64-bit unsigned integer instead + /// of a 32-bit signed integer. + /// + /// ^If X is a memory allocation previously obtained from sqlite3_malloc(), + /// sqlite3_malloc64(), sqlite3_realloc(), or sqlite3_realloc64(), then + /// sqlite3_msize(X) returns the size of that memory allocation in bytes. + /// ^The value returned by sqlite3_msize(X) might be larger than the number + /// of bytes requested when X was allocated. ^If X is a NULL pointer then + /// sqlite3_msize(X) returns zero. If X points to something that is not + /// the beginning of memory allocation, or if it points to a formerly + /// valid memory allocation that has now been freed, then the behavior + /// of sqlite3_msize(X) is undefined and possibly harmful. + /// + /// ^The memory returned by sqlite3_malloc(), sqlite3_realloc(), + /// sqlite3_malloc64(), and sqlite3_realloc64() + /// is always aligned to at least an 8 byte boundary, or to a + /// 4 byte boundary if the [SQLITE_4_BYTE_ALIGNED_MALLOC] compile-time + /// option is used. + /// + /// The pointer arguments to [sqlite3_free()] and [sqlite3_realloc()] + /// must be either NULL or else pointers obtained from a prior + /// invocation of [sqlite3_malloc()] or [sqlite3_realloc()] that have + /// not yet been released. + /// + /// The application must not read or write any part of + /// a block of memory after it has been released using + /// [sqlite3_free()] or [sqlite3_realloc()]. ffi.Pointer sqlite3_malloc( int arg0, ) { @@ -465,6 +1191,27 @@ class SQLite { _dart_sqlite3_msize _sqlite3_msize; + /// CAPI3REF: Memory Allocator Statistics + /// + /// SQLite provides these two interfaces for reporting on the status + /// of the [sqlite3_malloc()], [sqlite3_free()], and [sqlite3_realloc()] + /// routines, which form the built-in memory allocation subsystem. + /// + /// ^The [sqlite3_memory_used()] routine returns the number of bytes + /// of memory currently outstanding (malloced but not freed). + /// ^The [sqlite3_memory_highwater()] routine returns the maximum + /// value of [sqlite3_memory_used()] since the high-water mark + /// was last reset. ^The values returned by [sqlite3_memory_used()] and + /// [sqlite3_memory_highwater()] include any overhead + /// added by SQLite in its implementation of [sqlite3_malloc()], + /// but not overhead added by the any underlying system library + /// routines that [sqlite3_malloc()] may call. + /// + /// ^The memory high-water mark is reset to the current value of + /// [sqlite3_memory_used()] if and only if the parameter to + /// [sqlite3_memory_highwater()] is true. ^The value returned + /// by [sqlite3_memory_highwater(1)] is the high-water mark + /// prior to the reset. int sqlite3_memory_used() { _sqlite3_memory_used ??= _dylib.lookupFunction<_c_sqlite3_memory_used, _dart_sqlite3_memory_used>('sqlite3_memory_used'); @@ -486,6 +1233,25 @@ class SQLite { _dart_sqlite3_memory_highwater _sqlite3_memory_highwater; + /// CAPI3REF: Pseudo-Random Number Generator + /// + /// SQLite contains a high-quality pseudo-random number generator (PRNG) used to + /// select random [ROWID | ROWIDs] when inserting new records into a table that + /// already uses the largest possible [ROWID]. The PRNG is also used for + /// the built-in random() and randomblob() SQL functions. This interface allows + /// applications to access the same PRNG for other purposes. + /// + /// ^A call to this routine stores N bytes of randomness into buffer P. + /// ^The P parameter can be a NULL pointer. + /// + /// ^If this routine has not been previously called or if the previous + /// call had N less than one or a NULL pointer for P, then the PRNG is + /// seeded using randomness obtained from the xRandomness method of + /// the default [sqlite3_vfs] object. + /// ^If the previous call to this routine had an N of 1 or more and a + /// non-NULL P then the pseudo-randomness is generated + /// internally and without recourse to the [sqlite3_vfs] xRandomness + /// method. void sqlite3_randomness( int N, ffi.Pointer P, @@ -501,6 +1267,93 @@ class SQLite { _dart_sqlite3_randomness _sqlite3_randomness; + /// CAPI3REF: Compile-Time Authorization Callbacks + /// METHOD: sqlite3 + /// KEYWORDS: {authorizer callback} + /// + /// ^This routine registers an authorizer callback with a particular + /// [database connection], supplied in the first argument. + /// ^The authorizer callback is invoked as SQL statements are being compiled + /// by [sqlite3_prepare()] or its variants [sqlite3_prepare_v2()], + /// [sqlite3_prepare_v3()], [sqlite3_prepare16()], [sqlite3_prepare16_v2()], + /// and [sqlite3_prepare16_v3()]. ^At various + /// points during the compilation process, as logic is being created + /// to perform various actions, the authorizer callback is invoked to + /// see if those actions are allowed. ^The authorizer callback should + /// return [SQLITE_OK] to allow the action, [SQLITE_IGNORE] to disallow the + /// specific action but allow the SQL statement to continue to be + /// compiled, or [SQLITE_DENY] to cause the entire SQL statement to be + /// rejected with an error. ^If the authorizer callback returns + /// any value other than [SQLITE_IGNORE], [SQLITE_OK], or [SQLITE_DENY] + /// then the [sqlite3_prepare_v2()] or equivalent call that triggered + /// the authorizer will fail with an error message. + /// + /// When the callback returns [SQLITE_OK], that means the operation + /// requested is ok. ^When the callback returns [SQLITE_DENY], the + /// [sqlite3_prepare_v2()] or equivalent call that triggered the + /// authorizer will fail with an error message explaining that + /// access is denied. + /// + /// ^The first parameter to the authorizer callback is a copy of the third + /// parameter to the sqlite3_set_authorizer() interface. ^The second parameter + /// to the callback is an integer [SQLITE_COPY | action code] that specifies + /// the particular action to be authorized. ^The third through sixth parameters + /// to the callback are either NULL pointers or zero-terminated strings + /// that contain additional details about the action to be authorized. + /// Applications must always be prepared to encounter a NULL pointer in any + /// of the third through the sixth parameters of the authorization callback. + /// + /// ^If the action code is [SQLITE_READ] + /// and the callback returns [SQLITE_IGNORE] then the + /// [prepared statement] statement is constructed to substitute + /// a NULL value in place of the table column that would have + /// been read if [SQLITE_OK] had been returned. The [SQLITE_IGNORE] + /// return can be used to deny an untrusted user access to individual + /// columns of a table. + /// ^When a table is referenced by a [SELECT] but no column values are + /// extracted from that table (for example in a query like + /// "SELECT count(*) FROM tab") then the [SQLITE_READ] authorizer callback + /// is invoked once for that table with a column name that is an empty string. + /// ^If the action code is [SQLITE_DELETE] and the callback returns + /// [SQLITE_IGNORE] then the [DELETE] operation proceeds but the + /// [truncate optimization] is disabled and all rows are deleted individually. + /// + /// An authorizer is used when [sqlite3_prepare | preparing] + /// SQL statements from an untrusted source, to ensure that the SQL statements + /// do not try to access data they are not allowed to see, or that they do not + /// try to execute malicious statements that damage the database. For + /// example, an application may allow a user to enter arbitrary + /// SQL queries for evaluation by a database. But the application does + /// not want the user to be able to make arbitrary changes to the + /// database. An authorizer could then be put in place while the + /// user-entered SQL is being [sqlite3_prepare | prepared] that + /// disallows everything except [SELECT] statements. + /// + /// Applications that need to process SQL from untrusted sources + /// might also consider lowering resource limits using [sqlite3_limit()] + /// and limiting database size using the [max_page_count] [PRAGMA] + /// in addition to using an authorizer. + /// + /// ^(Only a single authorizer can be in place on a database connection + /// at a time. Each call to sqlite3_set_authorizer overrides the + /// previous call.)^ ^Disable the authorizer by installing a NULL callback. + /// The authorizer is disabled by default. + /// + /// The authorizer callback must not do anything that will modify + /// the database connection that invoked the authorizer callback. + /// Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their + /// database connections for the meaning of "modify" in this paragraph. + /// + /// ^When [sqlite3_prepare_v2()] is used to prepare a statement, the + /// statement might be re-prepared during [sqlite3_step()] due to a + /// schema change. Hence, the application should ensure that the + /// correct authorizer callback remains in place during the [sqlite3_step()]. + /// + /// ^Note that the authorizer callback is invoked only during + /// [sqlite3_prepare()] or its variants. Authorization is not + /// performed during statement evaluation in [sqlite3_step()], unless + /// as stated in the previous paragraph, sqlite3_step() invokes + /// sqlite3_prepare_v2() to reprepare a statement after a schema change. int sqlite3_set_authorizer( ffi.Pointer arg0, ffi.Pointer> xAuth, @@ -517,6 +1370,36 @@ class SQLite { _dart_sqlite3_set_authorizer _sqlite3_set_authorizer; + /// CAPI3REF: Tracing And Profiling Functions + /// METHOD: sqlite3 + /// + /// These routines are deprecated. Use the [sqlite3_trace_v2()] interface + /// instead of the routines described here. + /// + /// These routines register callback functions that can be used for + /// tracing and profiling the execution of SQL statements. + /// + /// ^The callback function registered by sqlite3_trace() is invoked at + /// various times when an SQL statement is being run by [sqlite3_step()]. + /// ^The sqlite3_trace() callback is invoked with a UTF-8 rendering of the + /// SQL statement text as the statement first begins executing. + /// ^(Additional sqlite3_trace() callbacks might occur + /// as each triggered subprogram is entered. The callbacks for triggers + /// contain a UTF-8 SQL comment that identifies the trigger.)^ + /// + /// The [SQLITE_TRACE_SIZE_LIMIT] compile-time option can be used to limit + /// the length of [bound parameter] expansion in the output of sqlite3_trace(). + /// + /// ^The callback function registered by sqlite3_profile() is invoked + /// as each SQL statement finishes. ^The profile callback contains + /// the original statement text and an estimate of wall-clock time + /// of how long that statement took to run. ^The profile callback + /// time is in units of nanoseconds, however the current implementation + /// is only capable of millisecond resolution so the six least significant + /// digits in the time are meaningless. Future versions of SQLite + /// might provide greater resolution on the profiler callback. Invoking + /// either [sqlite3_trace()] or [sqlite3_trace_v2()] will cancel the + /// profile callback. ffi.Pointer sqlite3_trace( ffi.Pointer arg0, ffi.Pointer> xTrace, @@ -550,6 +1433,33 @@ class SQLite { _dart_sqlite3_profile _sqlite3_profile; + /// CAPI3REF: SQL Trace Hook + /// METHOD: sqlite3 + /// + /// ^The sqlite3_trace_v2(D,M,X,P) interface registers a trace callback + /// function X against [database connection] D, using property mask M + /// and context pointer P. ^If the X callback is + /// NULL or if the M mask is zero, then tracing is disabled. The + /// M argument should be the bitwise OR-ed combination of + /// zero or more [SQLITE_TRACE] constants. + /// + /// ^Each call to either sqlite3_trace() or sqlite3_trace_v2() overrides + /// (cancels) any prior calls to sqlite3_trace() or sqlite3_trace_v2(). + /// + /// ^The X callback is invoked whenever any of the events identified by + /// mask M occur. ^The integer return value from the callback is currently + /// ignored, though this may change in future releases. Callback + /// implementations should return zero to ensure future compatibility. + /// + /// ^A trace callback is invoked with four arguments: callback(T,C,P,X). + /// ^The T argument is one of the [SQLITE_TRACE] + /// constants to indicate why the callback was invoked. + /// ^The C argument is a copy of the context pointer. + /// The P and X arguments are pointers whose meanings depend on T. + /// + /// The sqlite3_trace_v2() interface is intended to replace the legacy + /// interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which + /// are deprecated. int sqlite3_trace_v2( ffi.Pointer arg0, int uMask, @@ -569,6 +1479,35 @@ class SQLite { _dart_sqlite3_trace_v2 _sqlite3_trace_v2; + /// CAPI3REF: Query Progress Callbacks + /// METHOD: sqlite3 + /// + /// ^The sqlite3_progress_handler(D,N,X,P) interface causes the callback + /// function X to be invoked periodically during long running calls to + /// [sqlite3_exec()], [sqlite3_step()] and [sqlite3_get_table()] for + /// database connection D. An example use for this + /// interface is to keep a GUI updated during a large query. + /// + /// ^The parameter P is passed through as the only parameter to the + /// callback function X. ^The parameter N is the approximate number of + /// [virtual machine instructions] that are evaluated between successive + /// invocations of the callback X. ^If N is less than one then the progress + /// handler is disabled. + /// + /// ^Only a single progress handler may be defined at one time per + /// [database connection]; setting a new progress handler cancels the + /// old one. ^Setting parameter X to NULL disables the progress handler. + /// ^The progress handler is also disabled by setting N to a value less + /// than 1. + /// + /// ^If the progress callback returns non-zero, the operation is + /// interrupted. This feature can be used to implement a + /// "Cancel" button on a GUI progress dialog box. + /// + /// The progress handler callback must not do anything that will modify + /// the database connection that invoked the progress handler. + /// Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their + /// database connections for the meaning of "modify" in this paragraph. void sqlite3_progress_handler( ffi.Pointer arg0, int arg1, @@ -588,6 +1527,257 @@ class SQLite { _dart_sqlite3_progress_handler _sqlite3_progress_handler; + /// CAPI3REF: Opening A New Database Connection + /// CONSTRUCTOR: sqlite3 + /// + /// ^These routines open an SQLite database file as specified by the + /// filename argument. ^The filename argument is interpreted as UTF-8 for + /// sqlite3_open() and sqlite3_open_v2() and as UTF-16 in the native byte + /// order for sqlite3_open16(). ^(A [database connection] handle is usually + /// returned in *ppDb, even if an error occurs. The only exception is that + /// if SQLite is unable to allocate memory to hold the [sqlite3] object, + /// a NULL will be written into *ppDb instead of a pointer to the [sqlite3] + /// object.)^ ^(If the database is opened (and/or created) successfully, then + /// [SQLITE_OK] is returned. Otherwise an [error code] is returned.)^ ^The + /// [sqlite3_errmsg()] or [sqlite3_errmsg16()] routines can be used to obtain + /// an English language description of the error following a failure of any + /// of the sqlite3_open() routines. + /// + /// ^The default encoding will be UTF-8 for databases created using + /// sqlite3_open() or sqlite3_open_v2(). ^The default encoding for databases + /// created using sqlite3_open16() will be UTF-16 in the native byte order. + /// + /// Whether or not an error occurs when it is opened, resources + /// associated with the [database connection] handle should be released by + /// passing it to [sqlite3_close()] when it is no longer required. + /// + /// The sqlite3_open_v2() interface works like sqlite3_open() + /// except that it accepts two additional parameters for additional control + /// over the new database connection. ^(The flags parameter to + /// sqlite3_open_v2() must include, at a minimum, one of the following + /// three flag combinations:)^ + /// + ///
+ /// ^(
[SQLITE_OPEN_READONLY]
+ ///
The database is opened in read-only mode. If the database does not + /// already exist, an error is returned.
)^ + /// + /// ^(
[SQLITE_OPEN_READWRITE]
+ ///
The database is opened for reading and writing if possible, or reading + /// only if the file is write protected by the operating system. In either + /// case the database must already exist, otherwise an error is returned.
)^ + /// + /// ^(
[SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]
+ ///
The database is opened for reading and writing, and is created if + /// it does not already exist. This is the behavior that is always used for + /// sqlite3_open() and sqlite3_open16().
)^ + ///
+ /// + /// In addition to the required flags, the following optional flags are + /// also supported: + /// + ///
+ /// ^(
[SQLITE_OPEN_URI]
+ ///
The filename can be interpreted as a URI if this flag is set.
)^ + /// + /// ^(
[SQLITE_OPEN_MEMORY]
+ ///
The database will be opened as an in-memory database. The database + /// is named by the "filename" argument for the purposes of cache-sharing, + /// if shared cache mode is enabled, but the "filename" is otherwise ignored. + ///
)^ + /// + /// ^(
[SQLITE_OPEN_NOMUTEX]
+ ///
The new database connection will use the "multi-thread" + /// [threading mode].)^ This means that separate threads are allowed + /// to use SQLite at the same time, as long as each thread is using + /// a different [database connection]. + /// + /// ^(
[SQLITE_OPEN_FULLMUTEX]
+ ///
The new database connection will use the "serialized" + /// [threading mode].)^ This means the multiple threads can safely + /// attempt to use the same database connection at the same time. + /// (Mutexes will block any actual concurrency, but in this mode + /// there is no harm in trying.) + /// + /// ^(
[SQLITE_OPEN_SHAREDCACHE]
+ ///
The database is opened [shared cache] enabled, overriding + /// the default shared cache setting provided by + /// [sqlite3_enable_shared_cache()].)^ + /// + /// ^(
[SQLITE_OPEN_PRIVATECACHE]
+ ///
The database is opened [shared cache] disabled, overriding + /// the default shared cache setting provided by + /// [sqlite3_enable_shared_cache()].)^ + /// + /// [[OPEN_NOFOLLOW]] ^(
[SQLITE_OPEN_NOFOLLOW]
+ ///
The database filename is not allowed to be a symbolic link
+ ///
)^ + /// + /// If the 3rd parameter to sqlite3_open_v2() is not one of the + /// required combinations shown above optionally combined with other + /// [SQLITE_OPEN_READONLY | SQLITE_OPEN_* bits] + /// then the behavior is undefined. + /// + /// ^The fourth parameter to sqlite3_open_v2() is the name of the + /// [sqlite3_vfs] object that defines the operating system interface that + /// the new database connection should use. ^If the fourth parameter is + /// a NULL pointer then the default [sqlite3_vfs] object is used. + /// + /// ^If the filename is ":memory:", then a private, temporary in-memory database + /// is created for the connection. ^This in-memory database will vanish when + /// the database connection is closed. Future versions of SQLite might + /// make use of additional special filenames that begin with the ":" character. + /// It is recommended that when a database filename actually does begin with + /// a ":" character you should prefix the filename with a pathname such as + /// "./" to avoid ambiguity. + /// + /// ^If the filename is an empty string, then a private, temporary + /// on-disk database will be created. ^This private database will be + /// automatically deleted as soon as the database connection is closed. + /// + /// [[URI filenames in sqlite3_open()]]

URI Filenames

+ /// + /// ^If [URI filename] interpretation is enabled, and the filename argument + /// begins with "file:", then the filename is interpreted as a URI. ^URI + /// filename interpretation is enabled if the [SQLITE_OPEN_URI] flag is + /// set in the third argument to sqlite3_open_v2(), or if it has + /// been enabled globally using the [SQLITE_CONFIG_URI] option with the + /// [sqlite3_config()] method or by the [SQLITE_USE_URI] compile-time option. + /// URI filename interpretation is turned off + /// by default, but future releases of SQLite might enable URI filename + /// interpretation by default. See "[URI filenames]" for additional + /// information. + /// + /// URI filenames are parsed according to RFC 3986. ^If the URI contains an + /// authority, then it must be either an empty string or the string + /// "localhost". ^If the authority is not an empty string or "localhost", an + /// error is returned to the caller. ^The fragment component of a URI, if + /// present, is ignored. + /// + /// ^SQLite uses the path component of the URI as the name of the disk file + /// which contains the database. ^If the path begins with a '/' character, + /// then it is interpreted as an absolute path. ^If the path does not begin + /// with a '/' (meaning that the authority section is omitted from the URI) + /// then the path is interpreted as a relative path. + /// ^(On windows, the first component of an absolute path + /// is a drive specification (e.g. "C:").)^ + /// + /// [[core URI query parameters]] + /// The query component of a URI may contain parameters that are interpreted + /// either by SQLite itself, or by a [VFS | custom VFS implementation]. + /// SQLite and its built-in [VFSes] interpret the + /// following query parameters: + /// + ///
    + ///
  • vfs: ^The "vfs" parameter may be used to specify the name of + /// a VFS object that provides the operating system interface that should + /// be used to access the database file on disk. ^If this option is set to + /// an empty string the default VFS object is used. ^Specifying an unknown + /// VFS is an error. ^If sqlite3_open_v2() is used and the vfs option is + /// present, then the VFS specified by the option takes precedence over + /// the value passed as the fourth parameter to sqlite3_open_v2(). + /// + ///
  • mode: ^(The mode parameter may be set to either "ro", "rw", + /// "rwc", or "memory". Attempting to set it to any other value is + /// an error)^. + /// ^If "ro" is specified, then the database is opened for read-only + /// access, just as if the [SQLITE_OPEN_READONLY] flag had been set in the + /// third argument to sqlite3_open_v2(). ^If the mode option is set to + /// "rw", then the database is opened for read-write (but not create) + /// access, as if SQLITE_OPEN_READWRITE (but not SQLITE_OPEN_CREATE) had + /// been set. ^Value "rwc" is equivalent to setting both + /// SQLITE_OPEN_READWRITE and SQLITE_OPEN_CREATE. ^If the mode option is + /// set to "memory" then a pure [in-memory database] that never reads + /// or writes from disk is used. ^It is an error to specify a value for + /// the mode parameter that is less restrictive than that specified by + /// the flags passed in the third parameter to sqlite3_open_v2(). + /// + ///
  • cache: ^The cache parameter may be set to either "shared" or + /// "private". ^Setting it to "shared" is equivalent to setting the + /// SQLITE_OPEN_SHAREDCACHE bit in the flags argument passed to + /// sqlite3_open_v2(). ^Setting the cache parameter to "private" is + /// equivalent to setting the SQLITE_OPEN_PRIVATECACHE bit. + /// ^If sqlite3_open_v2() is used and the "cache" parameter is present in + /// a URI filename, its value overrides any behavior requested by setting + /// SQLITE_OPEN_PRIVATECACHE or SQLITE_OPEN_SHAREDCACHE flag. + /// + ///
  • psow: ^The psow parameter indicates whether or not the + /// [powersafe overwrite] property does or does not apply to the + /// storage media on which the database file resides. + /// + ///
  • nolock: ^The nolock parameter is a boolean query parameter + /// which if set disables file locking in rollback journal modes. This + /// is useful for accessing a database on a filesystem that does not + /// support locking. Caution: Database corruption might result if two + /// or more processes write to the same database and any one of those + /// processes uses nolock=1. + /// + ///
  • immutable: ^The immutable parameter is a boolean query + /// parameter that indicates that the database file is stored on + /// read-only media. ^When immutable is set, SQLite assumes that the + /// database file cannot be changed, even by a process with higher + /// privilege, and so the database is opened read-only and all locking + /// and change detection is disabled. Caution: Setting the immutable + /// property on a database file that does in fact change can result + /// in incorrect query results and/or [SQLITE_CORRUPT] errors. + /// See also: [SQLITE_IOCAP_IMMUTABLE]. + /// + ///
+ /// + /// ^Specifying an unknown parameter in the query component of a URI is not an + /// error. Future versions of SQLite might understand additional query + /// parameters. See "[query parameters with special meaning to SQLite]" for + /// additional information. + /// + /// [[URI filename examples]]

URI filename examples

+ /// + /// + ///
URI filenames Results + ///
file:data.db + /// Open the file "data.db" in the current directory. + ///
file:/home/fred/data.db
+ /// file:///home/fred/data.db
+ /// file://localhost/home/fred/data.db
+ /// Open the database file "/home/fred/data.db". + ///
file://darkstar/home/fred/data.db + /// An error. "darkstar" is not a recognized authority. + ///
+ /// file:///C:/Documents%20and%20Settings/fred/Desktop/data.db + /// Windows only: Open the file "data.db" on fred's desktop on drive + /// C:. Note that the %20 escaping in this example is not strictly + /// necessary - space characters can be used literally + /// in URI filenames. + ///
file:data.db?mode=ro&cache=private + /// Open file "data.db" in the current directory for read-only access. + /// Regardless of whether or not shared-cache mode is enabled by + /// default, use a private cache. + ///
file:/home/fred/data.db?vfs=unix-dotfile + /// Open file "/home/fred/data.db". Use the special VFS "unix-dotfile" + /// that uses dot-files in place of posix advisory locking. + ///
file:data.db?mode=readonly + /// An error. "readonly" is not a valid option for the "mode" parameter. + ///
+ /// + /// ^URI hexadecimal escape sequences (%HH) are supported within the path and + /// query components of a URI. A hexadecimal escape sequence consists of a + /// percent sign - "%" - followed by exactly two hexadecimal digits + /// specifying an octet value. ^Before the path or query components of a + /// URI filename are interpreted, they are encoded using UTF-8 and all + /// hexadecimal escape sequences replaced by a single byte containing the + /// corresponding octet. If this process generates an invalid UTF-8 encoding, + /// the results are undefined. + /// + /// Note to Windows users: The encoding used for the filename argument + /// of sqlite3_open() and sqlite3_open_v2() must be UTF-8, not whatever + /// codepage is currently defined. Filenames containing international + /// characters must be converted to UTF-8 prior to passing them into + /// sqlite3_open() or sqlite3_open_v2(). + /// + /// Note to Windows Runtime users: The temporary directory must be set + /// prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various + /// features that require the use of temporary files may fail. + /// + /// See also: [sqlite3_temp_directory] int sqlite3_open( ffi.Pointer filename, ffi.Pointer> ppDb, @@ -636,6 +1826,70 @@ class SQLite { _dart_sqlite3_open_v2 _sqlite3_open_v2; + /// CAPI3REF: Obtain Values For URI Parameters + /// + /// These are utility routines, useful to [VFS|custom VFS implementations], + /// that check if a database file was a URI that contained a specific query + /// parameter, and if so obtains the value of that query parameter. + /// + /// The first parameter to these interfaces (hereafter referred to + /// as F) must be one of: + ///
    + ///
  • A database filename pointer created by the SQLite core and + /// passed into the xOpen() method of a VFS implemention, or + ///
  • A filename obtained from [sqlite3_db_filename()], or + ///
  • A new filename constructed using [sqlite3_create_filename()]. + ///
+ /// If the F parameter is not one of the above, then the behavior is + /// undefined and probably undesirable. Older versions of SQLite were + /// more tolerant of invalid F parameters than newer versions. + /// + /// If F is a suitable filename (as described in the previous paragraph) + /// and if P is the name of the query parameter, then + /// sqlite3_uri_parameter(F,P) returns the value of the P + /// parameter if it exists or a NULL pointer if P does not appear as a + /// query parameter on F. If P is a query parameter of F and it + /// has no explicit value, then sqlite3_uri_parameter(F,P) returns + /// a pointer to an empty string. + /// + /// The sqlite3_uri_boolean(F,P,B) routine assumes that P is a boolean + /// parameter and returns true (1) or false (0) according to the value + /// of P. The sqlite3_uri_boolean(F,P,B) routine returns true (1) if the + /// value of query parameter P is one of "yes", "true", or "on" in any + /// case or if the value begins with a non-zero number. The + /// sqlite3_uri_boolean(F,P,B) routines returns false (0) if the value of + /// query parameter P is one of "no", "false", or "off" in any case or + /// if the value begins with a numeric zero. If P is not a query + /// parameter on F or if the value of P does not match any of the + /// above, then sqlite3_uri_boolean(F,P,B) returns (B!=0). + /// + /// The sqlite3_uri_int64(F,P,D) routine converts the value of P into a + /// 64-bit signed integer and returns that integer, or D if P does not + /// exist. If the value of P is something other than an integer, then + /// zero is returned. + /// + /// The sqlite3_uri_key(F,N) returns a pointer to the name (not + /// the value) of the N-th query parameter for filename F, or a NULL + /// pointer if N is less than zero or greater than the number of query + /// parameters minus 1. The N value is zero-based so N should be 0 to obtain + /// the name of the first query parameter, 1 for the second parameter, and + /// so forth. + /// + /// If F is a NULL pointer, then sqlite3_uri_parameter(F,P) returns NULL and + /// sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and + /// is not a database file pathname pointer that the SQLite core passed + /// into the xOpen VFS method, then the behavior of this routine is undefined + /// and probably undesirable. + /// + /// Beginning with SQLite [version 3.31.0] ([dateof:3.31.0]) the input F + /// parameter can also be the name of a rollback journal file or WAL file + /// in addition to the main database file. Prior to version 3.31.0, these + /// routines would only work if F was the name of the main database file. + /// When the F parameter is the name of the rollback journal or WAL file, + /// it has access to all the same query parameters as were found on the + /// main database file. + /// + /// See the [URI filename] documentation for additional information. ffi.Pointer sqlite3_uri_parameter( ffi.Pointer zFilename, ffi.Pointer zParam, @@ -698,6 +1952,31 @@ class SQLite { _dart_sqlite3_uri_key _sqlite3_uri_key; + /// CAPI3REF: Translate filenames + /// + /// These routines are available to [VFS|custom VFS implementations] for + /// translating filenames between the main database file, the journal file, + /// and the WAL file. + /// + /// If F is the name of an sqlite database file, journal file, or WAL file + /// passed by the SQLite core into the VFS, then sqlite3_filename_database(F) + /// returns the name of the corresponding database file. + /// + /// If F is the name of an sqlite database file, journal file, or WAL file + /// passed by the SQLite core into the VFS, or if F is a database filename + /// obtained from [sqlite3_db_filename()], then sqlite3_filename_journal(F) + /// returns the name of the corresponding rollback journal file. + /// + /// If F is the name of an sqlite database file, journal file, or WAL file + /// that was passed by the SQLite core into the VFS, or if F is a database + /// filename obtained from [sqlite3_db_filename()], then + /// sqlite3_filename_wal(F) returns the name of the corresponding + /// WAL file. + /// + /// In all of the above, if F is not the name of a database, journal or WAL + /// filename passed into the VFS from the SQLite core and F is not the + /// return value from [sqlite3_db_filename()], then the result is + /// undefined and is likely a memory access violation. ffi.Pointer sqlite3_filename_database( ffi.Pointer arg0, ) { @@ -736,6 +2015,21 @@ class SQLite { _dart_sqlite3_filename_wal _sqlite3_filename_wal; + /// CAPI3REF: Database File Corresponding To A Journal + /// + /// ^If X is the name of a rollback or WAL-mode journal file that is + /// passed into the xOpen method of [sqlite3_vfs], then + /// sqlite3_database_file_object(X) returns a pointer to the [sqlite3_file] + /// object that represents the main database file. + /// + /// This routine is intended for use in custom [VFS] implementations + /// only. It is not a general-purpose interface. + /// The argument sqlite3_file_object(X) must be a filename pointer that + /// has been passed into [sqlite3_vfs].xOpen method where the + /// flags parameter to xOpen contains one of the bits + /// [SQLITE_OPEN_MAIN_JOURNAL] or [SQLITE_OPEN_WAL]. Any other use + /// of this routine results in undefined and probably undesirable + /// behavior. ffi.Pointer sqlite3_database_file_object( ffi.Pointer arg0, ) { @@ -749,6 +2043,49 @@ class SQLite { _dart_sqlite3_database_file_object _sqlite3_database_file_object; + /// CAPI3REF: Create and Destroy VFS Filenames + /// + /// These interfces are provided for use by [VFS shim] implementations and + /// are not useful outside of that context. + /// + /// The sqlite3_create_filename(D,J,W,N,P) allocates memory to hold a version of + /// database filename D with corresponding journal file J and WAL file W and + /// with N URI parameters key/values pairs in the array P. The result from + /// sqlite3_create_filename(D,J,W,N,P) is a pointer to a database filename that + /// is safe to pass to routines like: + ///
    + ///
  • [sqlite3_uri_parameter()], + ///
  • [sqlite3_uri_boolean()], + ///
  • [sqlite3_uri_int64()], + ///
  • [sqlite3_uri_key()], + ///
  • [sqlite3_filename_database()], + ///
  • [sqlite3_filename_journal()], or + ///
  • [sqlite3_filename_wal()]. + ///
+ /// If a memory allocation error occurs, sqlite3_create_filename() might + /// return a NULL pointer. The memory obtained from sqlite3_create_filename(X) + /// must be released by a corresponding call to sqlite3_free_filename(Y). + /// + /// The P parameter in sqlite3_create_filename(D,J,W,N,P) should be an array + /// of 2*N pointers to strings. Each pair of pointers in this array corresponds + /// to a key and value for a query parameter. The P parameter may be a NULL + /// pointer if N is zero. None of the 2*N pointers in the P array may be + /// NULL pointers and key pointers should not be empty strings. + /// None of the D, J, or W parameters to sqlite3_create_filename(D,J,W,N,P) may + /// be NULL pointers, though they can be empty strings. + /// + /// The sqlite3_free_filename(Y) routine releases a memory allocation + /// previously obtained from sqlite3_create_filename(). Invoking + /// sqlite3_free_filename(Y) where Y is a NULL pointer is a harmless no-op. + /// + /// If the Y parameter to sqlite3_free_filename(Y) is anything other + /// than a NULL pointer or a pointer previously acquired from + /// sqlite3_create_filename(), then bad things such as heap + /// corruption or segfaults may occur. The value Y should be + /// used again after sqlite3_free_filename(Y) has been called. This means + /// that if the [sqlite3_vfs.xOpen()] method of a VFS has been called using Y, + /// then the corresponding [sqlite3_module.xClose() method should also be + /// invoked prior to calling sqlite3_free_filename(Y). ffi.Pointer sqlite3_create_filename( ffi.Pointer zDatabase, ffi.Pointer zJournal, @@ -782,6 +2119,56 @@ class SQLite { _dart_sqlite3_free_filename _sqlite3_free_filename; + /// CAPI3REF: Error Codes And Messages + /// METHOD: sqlite3 + /// + /// ^If the most recent sqlite3_* API call associated with + /// [database connection] D failed, then the sqlite3_errcode(D) interface + /// returns the numeric [result code] or [extended result code] for that + /// API call. + /// ^The sqlite3_extended_errcode() + /// interface is the same except that it always returns the + /// [extended result code] even when extended result codes are + /// disabled. + /// + /// The values returned by sqlite3_errcode() and/or + /// sqlite3_extended_errcode() might change with each API call. + /// Except, there are some interfaces that are guaranteed to never + /// change the value of the error code. The error-code preserving + /// interfaces are: + /// + ///
    + ///
  • sqlite3_errcode() + ///
  • sqlite3_extended_errcode() + ///
  • sqlite3_errmsg() + ///
  • sqlite3_errmsg16() + ///
+ /// + /// ^The sqlite3_errmsg() and sqlite3_errmsg16() return English-language + /// text that describes the error, as either UTF-8 or UTF-16 respectively. + /// ^(Memory to hold the error message string is managed internally. + /// The application does not need to worry about freeing the result. + /// However, the error string might be overwritten or deallocated by + /// subsequent calls to other SQLite interface functions.)^ + /// + /// ^The sqlite3_errstr() interface returns the English-language text + /// that describes the [result code], as UTF-8. + /// ^(Memory to hold the error message string is managed internally + /// and must not be freed by the application)^. + /// + /// When the serialized [threading mode] is in use, it might be the + /// case that a second error occurs on a separate thread in between + /// the time of the first error and the call to these interfaces. + /// When that happens, the second error will be reported since these + /// interfaces always report the most recent result. To avoid + /// this, each thread can obtain exclusive use of the [database connection] D + /// by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning + /// to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after + /// all calls to the interfaces listed here are completed. + /// + /// If an interface fails with SQLITE_MISUSE, that means the interface + /// was invoked incorrectly by the application. In that case, the + /// error code and message may or may not be set. int sqlite3_errcode( ffi.Pointer db, ) { @@ -847,6 +2234,44 @@ class SQLite { _dart_sqlite3_errstr _sqlite3_errstr; + /// CAPI3REF: Run-time Limits + /// METHOD: sqlite3 + /// + /// ^(This interface allows the size of various constructs to be limited + /// on a connection by connection basis. The first parameter is the + /// [database connection] whose limit is to be set or queried. The + /// second parameter is one of the [limit categories] that define a + /// class of constructs to be size limited. The third parameter is the + /// new limit for that construct.)^ + /// + /// ^If the new limit is a negative number, the limit is unchanged. + /// ^(For each limit category SQLITE_LIMIT_NAME there is a + /// [limits | hard upper bound] + /// set at compile-time by a C preprocessor macro called + /// [limits | SQLITE_MAX_NAME]. + /// (The "_LIMIT_" in the name is changed to "_MAX_".))^ + /// ^Attempts to increase a limit above its hard upper bound are + /// silently truncated to the hard upper bound. + /// + /// ^Regardless of whether or not the limit was changed, the + /// [sqlite3_limit()] interface returns the prior value of the limit. + /// ^Hence, to find the current value of a limit without changing it, + /// simply invoke this interface with the third parameter set to -1. + /// + /// Run-time limits are intended for use in applications that manage + /// both their own internal database and also databases that are controlled + /// by untrusted external sources. An example application might be a + /// web browser that has its own databases for storing history and + /// separate databases controlled by JavaScript applications downloaded + /// off the Internet. The internal databases can be given the + /// large, default limits. Databases managed by external sources can + /// be given much smaller limits designed to prevent a denial of service + /// attack. Developers might also want to use the [sqlite3_set_authorizer()] + /// interface to further control untrusted SQL. The size of the database + /// created by an untrusted script can be contained using the + /// [max_page_count] [PRAGMA]. + /// + /// New run-time limit categories may be added in future releases. int sqlite3_limit( ffi.Pointer arg0, int id, @@ -863,6 +2288,104 @@ class SQLite { _dart_sqlite3_limit _sqlite3_limit; + /// CAPI3REF: Compiling An SQL Statement + /// KEYWORDS: {SQL statement compiler} + /// METHOD: sqlite3 + /// CONSTRUCTOR: sqlite3_stmt + /// + /// To execute an SQL statement, it must first be compiled into a byte-code + /// program using one of these routines. Or, in other words, these routines + /// are constructors for the [prepared statement] object. + /// + /// The preferred routine to use is [sqlite3_prepare_v2()]. The + /// [sqlite3_prepare()] interface is legacy and should be avoided. + /// [sqlite3_prepare_v3()] has an extra "prepFlags" option that is used + /// for special purposes. + /// + /// The use of the UTF-8 interfaces is preferred, as SQLite currently + /// does all parsing using UTF-8. The UTF-16 interfaces are provided + /// as a convenience. The UTF-16 interfaces work by converting the + /// input text into UTF-8, then invoking the corresponding UTF-8 interface. + /// + /// The first argument, "db", is a [database connection] obtained from a + /// prior successful call to [sqlite3_open()], [sqlite3_open_v2()] or + /// [sqlite3_open16()]. The database connection must not have been closed. + /// + /// The second argument, "zSql", is the statement to be compiled, encoded + /// as either UTF-8 or UTF-16. The sqlite3_prepare(), sqlite3_prepare_v2(), + /// and sqlite3_prepare_v3() + /// interfaces use UTF-8, and sqlite3_prepare16(), sqlite3_prepare16_v2(), + /// and sqlite3_prepare16_v3() use UTF-16. + /// + /// ^If the nByte argument is negative, then zSql is read up to the + /// first zero terminator. ^If nByte is positive, then it is the + /// number of bytes read from zSql. ^If nByte is zero, then no prepared + /// statement is generated. + /// If the caller knows that the supplied string is nul-terminated, then + /// there is a small performance advantage to passing an nByte parameter that + /// is the number of bytes in the input string including + /// the nul-terminator. + /// + /// ^If pzTail is not NULL then *pzTail is made to point to the first byte + /// past the end of the first SQL statement in zSql. These routines only + /// compile the first statement in zSql, so *pzTail is left pointing to + /// what remains uncompiled. + /// + /// ^*ppStmt is left pointing to a compiled [prepared statement] that can be + /// executed using [sqlite3_step()]. ^If there is an error, *ppStmt is set + /// to NULL. ^If the input text contains no SQL (if the input is an empty + /// string or a comment) then *ppStmt is set to NULL. + /// The calling procedure is responsible for deleting the compiled + /// SQL statement using [sqlite3_finalize()] after it has finished with it. + /// ppStmt may not be NULL. + /// + /// ^On success, the sqlite3_prepare() family of routines return [SQLITE_OK]; + /// otherwise an [error code] is returned. + /// + /// The sqlite3_prepare_v2(), sqlite3_prepare_v3(), sqlite3_prepare16_v2(), + /// and sqlite3_prepare16_v3() interfaces are recommended for all new programs. + /// The older interfaces (sqlite3_prepare() and sqlite3_prepare16()) + /// are retained for backwards compatibility, but their use is discouraged. + /// ^In the "vX" interfaces, the prepared statement + /// that is returned (the [sqlite3_stmt] object) contains a copy of the + /// original SQL text. This causes the [sqlite3_step()] interface to + /// behave differently in three ways: + /// + ///
    + ///
  1. + /// ^If the database schema changes, instead of returning [SQLITE_SCHEMA] as it + /// always used to do, [sqlite3_step()] will automatically recompile the SQL + /// statement and try to run it again. As many as [SQLITE_MAX_SCHEMA_RETRY] + /// retries will occur before sqlite3_step() gives up and returns an error. + ///
  2. + /// + ///
  3. + /// ^When an error occurs, [sqlite3_step()] will return one of the detailed + /// [error codes] or [extended error codes]. ^The legacy behavior was that + /// [sqlite3_step()] would only return a generic [SQLITE_ERROR] result code + /// and the application would have to make a second call to [sqlite3_reset()] + /// in order to find the underlying cause of the problem. With the "v2" prepare + /// interfaces, the underlying reason for the error is returned immediately. + ///
  4. + /// + ///
  5. + /// ^If the specific value bound to a [parameter | host parameter] in the + /// WHERE clause might influence the choice of query plan for a statement, + /// then the statement will be automatically recompiled, as if there had been + /// a schema change, on the first [sqlite3_step()] call following any change + /// to the [sqlite3_bind_text | bindings] of that [parameter]. + /// ^The specific value of a WHERE-clause [parameter] might influence the + /// choice of query plan if the parameter is the left-hand side of a [LIKE] + /// or [GLOB] operator or if the parameter is compared to an indexed column + /// and the [SQLITE_ENABLE_STAT4] compile-time option is enabled. + ///
  6. + ///
+ /// + ///

^sqlite3_prepare_v3() differs from sqlite3_prepare_v2() only in having + /// the extra prepFlags parameter, which is a bit array consisting of zero or + /// more of the [SQLITE_PREPARE_PERSISTENT|SQLITE_PREPARE_*] flags. ^The + /// sqlite3_prepare_v2() interface works exactly the same as + /// sqlite3_prepare_v3() with a zero prepFlags parameter. int sqlite3_prepare( ffi.Pointer db, ffi.Pointer zSql, @@ -991,6 +2514,42 @@ class SQLite { _dart_sqlite3_prepare16_v3 _sqlite3_prepare16_v3; + /// CAPI3REF: Retrieving Statement SQL + /// METHOD: sqlite3_stmt + /// + /// ^The sqlite3_sql(P) interface returns a pointer to a copy of the UTF-8 + /// SQL text used to create [prepared statement] P if P was + /// created by [sqlite3_prepare_v2()], [sqlite3_prepare_v3()], + /// [sqlite3_prepare16_v2()], or [sqlite3_prepare16_v3()]. + /// ^The sqlite3_expanded_sql(P) interface returns a pointer to a UTF-8 + /// string containing the SQL text of prepared statement P with + /// [bound parameters] expanded. + /// ^The sqlite3_normalized_sql(P) interface returns a pointer to a UTF-8 + /// string containing the normalized SQL text of prepared statement P. The + /// semantics used to normalize a SQL statement are unspecified and subject + /// to change. At a minimum, literal values will be replaced with suitable + /// placeholders. + /// + /// ^(For example, if a prepared statement is created using the SQL + /// text "SELECT $abc,:xyz" and if parameter $abc is bound to integer 2345 + /// and parameter :xyz is unbound, then sqlite3_sql() will return + /// the original string, "SELECT $abc,:xyz" but sqlite3_expanded_sql() + /// will return "SELECT 2345,NULL".)^ + /// + /// ^The sqlite3_expanded_sql() interface returns NULL if insufficient memory + /// is available to hold the result, or if the result would exceed the + /// the maximum string length determined by the [SQLITE_LIMIT_LENGTH]. + /// + /// ^The [SQLITE_TRACE_SIZE_LIMIT] compile-time option limits the size of + /// bound parameter expansions. ^The [SQLITE_OMIT_TRACE] compile-time + /// option causes sqlite3_expanded_sql() to always return NULL. + /// + /// ^The strings returned by sqlite3_sql(P) and sqlite3_normalized_sql(P) + /// are managed by SQLite and are automatically freed when the prepared + /// statement is finalized. + /// ^The string returned by sqlite3_expanded_sql(P), on the other hand, + /// is obtained from [sqlite3_malloc()] and must be free by the application + /// by passing it to [sqlite3_free()]. ffi.Pointer sqlite3_sql( ffi.Pointer pStmt, ) { @@ -1027,6 +2586,38 @@ class SQLite { _dart_sqlite3_normalized_sql _sqlite3_normalized_sql; + /// CAPI3REF: Determine If An SQL Statement Writes The Database + /// METHOD: sqlite3_stmt + /// + /// ^The sqlite3_stmt_readonly(X) interface returns true (non-zero) if + /// and only if the [prepared statement] X makes no direct changes to + /// the content of the database file. + /// + /// Note that [application-defined SQL functions] or + /// [virtual tables] might change the database indirectly as a side effect. + /// ^(For example, if an application defines a function "eval()" that + /// calls [sqlite3_exec()], then the following SQL statement would + /// change the database file through side-effects: + /// + ///

+  /// SELECT eval('DELETE FROM t1') FROM t2;
+  /// 
+ /// + /// But because the [SELECT] statement does not change the database file + /// directly, sqlite3_stmt_readonly() would still return true.)^ + /// + /// ^Transaction control statements such as [BEGIN], [COMMIT], [ROLLBACK], + /// [SAVEPOINT], and [RELEASE] cause sqlite3_stmt_readonly() to return true, + /// since the statements themselves do not actually modify the database but + /// rather they control the timing of when other statements modify the + /// database. ^The [ATTACH] and [DETACH] statements also cause + /// sqlite3_stmt_readonly() to return true since, while those statements + /// change the configuration of a database connection, they do not make + /// changes to the content of the database files on disk. + /// ^The sqlite3_stmt_readonly() interface returns true for [BEGIN] since + /// [BEGIN] merely sets internal flags, but the [BEGIN|BEGIN IMMEDIATE] and + /// [BEGIN|BEGIN EXCLUSIVE] commands do touch the database and so + /// sqlite3_stmt_readonly() returns false for those commands. int sqlite3_stmt_readonly( ffi.Pointer pStmt, ) { @@ -1039,6 +2630,14 @@ class SQLite { _dart_sqlite3_stmt_readonly _sqlite3_stmt_readonly; + /// CAPI3REF: Query The EXPLAIN Setting For A Prepared Statement + /// METHOD: sqlite3_stmt + /// + /// ^The sqlite3_stmt_isexplain(S) interface returns 1 if the + /// prepared statement S is an EXPLAIN statement, or 2 if the + /// statement S is an EXPLAIN QUERY PLAN. + /// ^The sqlite3_stmt_isexplain(S) interface returns 0 if S is + /// an ordinary statement or a NULL pointer. int sqlite3_stmt_isexplain( ffi.Pointer pStmt, ) { @@ -1051,6 +2650,23 @@ class SQLite { _dart_sqlite3_stmt_isexplain _sqlite3_stmt_isexplain; + /// CAPI3REF: Determine If A Prepared Statement Has Been Reset + /// METHOD: sqlite3_stmt + /// + /// ^The sqlite3_stmt_busy(S) interface returns true (non-zero) if the + /// [prepared statement] S has been stepped at least once using + /// [sqlite3_step(S)] but has neither run to completion (returned + /// [SQLITE_DONE] from [sqlite3_step(S)]) nor + /// been reset using [sqlite3_reset(S)]. ^The sqlite3_stmt_busy(S) + /// interface returns false if S is a NULL pointer. If S is not a + /// NULL pointer and is not a pointer to a valid [prepared statement] + /// object, then the behavior is undefined and probably undesirable. + /// + /// This interface can be used in combination [sqlite3_next_stmt()] + /// to locate all prepared statements associated with a database + /// connection that are in need of being reset. This can be used, + /// for example, in diagnostic routines to search for prepared + /// statements that are holding a transaction open. int sqlite3_stmt_busy( ffi.Pointer arg0, ) { @@ -1064,6 +2680,140 @@ class SQLite { _dart_sqlite3_stmt_busy _sqlite3_stmt_busy; + /// CAPI3REF: Binding Values To Prepared Statements + /// KEYWORDS: {host parameter} {host parameters} {host parameter name} + /// KEYWORDS: {SQL parameter} {SQL parameters} {parameter binding} + /// METHOD: sqlite3_stmt + /// + /// ^(In the SQL statement text input to [sqlite3_prepare_v2()] and its variants, + /// literals may be replaced by a [parameter] that matches one of following + /// templates: + /// + ///
    + ///
  • ? + ///
  • ?NNN + ///
  • :VVV + ///
  • @VVV + ///
  • $VVV + ///
+ /// + /// In the templates above, NNN represents an integer literal, + /// and VVV represents an alphanumeric identifier.)^ ^The values of these + /// parameters (also called "host parameter names" or "SQL parameters") + /// can be set using the sqlite3_bind_*() routines defined here. + /// + /// ^The first argument to the sqlite3_bind_*() routines is always + /// a pointer to the [sqlite3_stmt] object returned from + /// [sqlite3_prepare_v2()] or its variants. + /// + /// ^The second argument is the index of the SQL parameter to be set. + /// ^The leftmost SQL parameter has an index of 1. ^When the same named + /// SQL parameter is used more than once, second and subsequent + /// occurrences have the same index as the first occurrence. + /// ^The index for named parameters can be looked up using the + /// [sqlite3_bind_parameter_index()] API if desired. ^The index + /// for "?NNN" parameters is the value of NNN. + /// ^The NNN value must be between 1 and the [sqlite3_limit()] + /// parameter [SQLITE_LIMIT_VARIABLE_NUMBER] (default value: 32766). + /// + /// ^The third argument is the value to bind to the parameter. + /// ^If the third parameter to sqlite3_bind_text() or sqlite3_bind_text16() + /// or sqlite3_bind_blob() is a NULL pointer then the fourth parameter + /// is ignored and the end result is the same as sqlite3_bind_null(). + /// ^If the third parameter to sqlite3_bind_text() is not NULL, then + /// it should be a pointer to well-formed UTF8 text. + /// ^If the third parameter to sqlite3_bind_text16() is not NULL, then + /// it should be a pointer to well-formed UTF16 text. + /// ^If the third parameter to sqlite3_bind_text64() is not NULL, then + /// it should be a pointer to a well-formed unicode string that is + /// either UTF8 if the sixth parameter is SQLITE_UTF8, or UTF16 + /// otherwise. + /// + /// [[byte-order determination rules]] ^The byte-order of + /// UTF16 input text is determined by the byte-order mark (BOM, U+FEFF) + /// found in first character, which is removed, or in the absence of a BOM + /// the byte order is the native byte order of the host + /// machine for sqlite3_bind_text16() or the byte order specified in + /// the 6th parameter for sqlite3_bind_text64().)^ + /// ^If UTF16 input text contains invalid unicode + /// characters, then SQLite might change those invalid characters + /// into the unicode replacement character: U+FFFD. + /// + /// ^(In those routines that have a fourth argument, its value is the + /// number of bytes in the parameter. To be clear: the value is the + /// number of bytes in the value, not the number of characters.)^ + /// ^If the fourth parameter to sqlite3_bind_text() or sqlite3_bind_text16() + /// is negative, then the length of the string is + /// the number of bytes up to the first zero terminator. + /// If the fourth parameter to sqlite3_bind_blob() is negative, then + /// the behavior is undefined. + /// If a non-negative fourth parameter is provided to sqlite3_bind_text() + /// or sqlite3_bind_text16() or sqlite3_bind_text64() then + /// that parameter must be the byte offset + /// where the NUL terminator would occur assuming the string were NUL + /// terminated. If any NUL characters occurs at byte offsets less than + /// the value of the fourth parameter then the resulting string value will + /// contain embedded NULs. The result of expressions involving strings + /// with embedded NULs is undefined. + /// + /// ^The fifth argument to the BLOB and string binding interfaces + /// is a destructor used to dispose of the BLOB or + /// string after SQLite has finished with it. ^The destructor is called + /// to dispose of the BLOB or string even if the call to the bind API fails, + /// except the destructor is not called if the third parameter is a NULL + /// pointer or the fourth parameter is negative. + /// ^If the fifth argument is + /// the special value [SQLITE_STATIC], then SQLite assumes that the + /// information is in static, unmanaged space and does not need to be freed. + /// ^If the fifth argument has the value [SQLITE_TRANSIENT], then + /// SQLite makes its own private copy of the data immediately, before + /// the sqlite3_bind_*() routine returns. + /// + /// ^The sixth argument to sqlite3_bind_text64() must be one of + /// [SQLITE_UTF8], [SQLITE_UTF16], [SQLITE_UTF16BE], or [SQLITE_UTF16LE] + /// to specify the encoding of the text in the third parameter. If + /// the sixth argument to sqlite3_bind_text64() is not one of the + /// allowed values shown above, or if the text encoding is different + /// from the encoding specified by the sixth parameter, then the behavior + /// is undefined. + /// + /// ^The sqlite3_bind_zeroblob() routine binds a BLOB of length N that + /// is filled with zeroes. ^A zeroblob uses a fixed amount of memory + /// (just an integer to hold its size) while it is being processed. + /// Zeroblobs are intended to serve as placeholders for BLOBs whose + /// content is later written using + /// [sqlite3_blob_open | incremental BLOB I/O] routines. + /// ^A negative value for the zeroblob results in a zero-length BLOB. + /// + /// ^The sqlite3_bind_pointer(S,I,P,T,D) routine causes the I-th parameter in + /// [prepared statement] S to have an SQL value of NULL, but to also be + /// associated with the pointer P of type T. ^D is either a NULL pointer or + /// a pointer to a destructor function for P. ^SQLite will invoke the + /// destructor D with a single argument of P when it is finished using + /// P. The T parameter should be a static string, preferably a string + /// literal. The sqlite3_bind_pointer() routine is part of the + /// [pointer passing interface] added for SQLite 3.20.0. + /// + /// ^If any of the sqlite3_bind_*() routines are called with a NULL pointer + /// for the [prepared statement] or with a prepared statement for which + /// [sqlite3_step()] has been called more recently than [sqlite3_reset()], + /// then the call will return [SQLITE_MISUSE]. If any sqlite3_bind_() + /// routine is passed a [prepared statement] that has been finalized, the + /// result is undefined and probably harmful. + /// + /// ^Bindings are not cleared by the [sqlite3_reset()] routine. + /// ^Unbound parameters are interpreted as NULL. + /// + /// ^The sqlite3_bind_* routines return [SQLITE_OK] on success or an + /// [error code] if anything goes wrong. + /// ^[SQLITE_TOOBIG] might be returned if the size of a string or BLOB + /// exceeds limits imposed by [sqlite3_limit]([SQLITE_LIMIT_LENGTH]) or + /// [SQLITE_MAX_LENGTH]. + /// ^[SQLITE_RANGE] is returned if the parameter + /// index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails. + /// + /// See also: [sqlite3_bind_parameter_count()], + /// [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()]. int sqlite3_bind_blob( ffi.Pointer arg0, int arg1, @@ -1303,6 +3053,23 @@ class SQLite { _dart_sqlite3_bind_zeroblob64 _sqlite3_bind_zeroblob64; + /// CAPI3REF: Number Of SQL Parameters + /// METHOD: sqlite3_stmt + /// + /// ^This routine can be used to find the number of [SQL parameters] + /// in a [prepared statement]. SQL parameters are tokens of the + /// form "?", "?NNN", ":AAA", "$AAA", or "@AAA" that serve as + /// placeholders for values that are [sqlite3_bind_blob | bound] + /// to the parameters at a later time. + /// + /// ^(This routine actually returns the index of the largest (rightmost) + /// parameter. For all forms except ?NNN, this will correspond to the + /// number of unique parameters. If parameters of the ?NNN form are used, + /// there may be gaps in the list.)^ + /// + /// See also: [sqlite3_bind_blob|sqlite3_bind()], + /// [sqlite3_bind_parameter_name()], and + /// [sqlite3_bind_parameter_index()]. int sqlite3_bind_parameter_count( ffi.Pointer arg0, ) { @@ -1316,6 +3083,30 @@ class SQLite { _dart_sqlite3_bind_parameter_count _sqlite3_bind_parameter_count; + /// CAPI3REF: Name Of A Host Parameter + /// METHOD: sqlite3_stmt + /// + /// ^The sqlite3_bind_parameter_name(P,N) interface returns + /// the name of the N-th [SQL parameter] in the [prepared statement] P. + /// ^(SQL parameters of the form "?NNN" or ":AAA" or "@AAA" or "$AAA" + /// have a name which is the string "?NNN" or ":AAA" or "@AAA" or "$AAA" + /// respectively. + /// In other words, the initial ":" or "$" or "@" or "?" + /// is included as part of the name.)^ + /// ^Parameters of the form "?" without a following integer have no name + /// and are referred to as "nameless" or "anonymous parameters". + /// + /// ^The first host parameter has an index of 1, not 0. + /// + /// ^If the value N is out of range or if the N-th parameter is + /// nameless, then NULL is returned. ^The returned string is + /// always in UTF-8 encoding even if the named parameter was + /// originally specified as UTF-16 in [sqlite3_prepare16()], + /// [sqlite3_prepare16_v2()], or [sqlite3_prepare16_v3()]. + /// + /// See also: [sqlite3_bind_blob|sqlite3_bind()], + /// [sqlite3_bind_parameter_count()], and + /// [sqlite3_bind_parameter_index()]. ffi.Pointer sqlite3_bind_parameter_name( ffi.Pointer arg0, int arg1, @@ -1331,6 +3122,20 @@ class SQLite { _dart_sqlite3_bind_parameter_name _sqlite3_bind_parameter_name; + /// CAPI3REF: Index Of A Parameter With A Given Name + /// METHOD: sqlite3_stmt + /// + /// ^Return the index of an SQL parameter given its name. ^The + /// index value returned is suitable for use as the second + /// parameter to [sqlite3_bind_blob|sqlite3_bind()]. ^A zero + /// is returned if no matching parameter is found. ^The parameter + /// name must be given in UTF-8 even if the original statement + /// was prepared from UTF-16 text using [sqlite3_prepare16_v2()] or + /// [sqlite3_prepare16_v3()]. + /// + /// See also: [sqlite3_bind_blob|sqlite3_bind()], + /// [sqlite3_bind_parameter_count()], and + /// [sqlite3_bind_parameter_name()]. int sqlite3_bind_parameter_index( ffi.Pointer arg0, ffi.Pointer zName, @@ -1346,6 +3151,12 @@ class SQLite { _dart_sqlite3_bind_parameter_index _sqlite3_bind_parameter_index; + /// CAPI3REF: Reset All Bindings On A Prepared Statement + /// METHOD: sqlite3_stmt + /// + /// ^Contrary to the intuition of many, [sqlite3_reset()] does not reset + /// the [sqlite3_bind_blob | bindings] on a [prepared statement]. + /// ^Use this routine to reset all host parameters to NULL. int sqlite3_clear_bindings( ffi.Pointer arg0, ) { @@ -1358,6 +3169,18 @@ class SQLite { _dart_sqlite3_clear_bindings _sqlite3_clear_bindings; + /// CAPI3REF: Number Of Columns In A Result Set + /// METHOD: sqlite3_stmt + /// + /// ^Return the number of columns in the result set returned by the + /// [prepared statement]. ^If this routine returns 0, that means the + /// [prepared statement] returns no data (for example an [UPDATE]). + /// ^However, just because this routine returns a positive number does not + /// mean that one or more rows of data will be returned. ^A SELECT statement + /// will always have a positive sqlite3_column_count() but depending on the + /// WHERE clause constraints and the table content, it might return no rows. + /// + /// See also: [sqlite3_data_count()] int sqlite3_column_count( ffi.Pointer pStmt, ) { @@ -1370,6 +3193,31 @@ class SQLite { _dart_sqlite3_column_count _sqlite3_column_count; + /// CAPI3REF: Column Names In A Result Set + /// METHOD: sqlite3_stmt + /// + /// ^These routines return the name assigned to a particular column + /// in the result set of a [SELECT] statement. ^The sqlite3_column_name() + /// interface returns a pointer to a zero-terminated UTF-8 string + /// and sqlite3_column_name16() returns a pointer to a zero-terminated + /// UTF-16 string. ^The first parameter is the [prepared statement] + /// that implements the [SELECT] statement. ^The second parameter is the + /// column number. ^The leftmost column is number 0. + /// + /// ^The returned string pointer is valid until either the [prepared statement] + /// is destroyed by [sqlite3_finalize()] or until the statement is automatically + /// reprepared by the first call to [sqlite3_step()] for a particular run + /// or until the next call to + /// sqlite3_column_name() or sqlite3_column_name16() on the same column. + /// + /// ^If sqlite3_malloc() fails during the processing of either routine + /// (for example during a conversion from UTF-8 to UTF-16) then a + /// NULL pointer is returned. + /// + /// ^The name of a result column is the value of the "AS" clause for + /// that column, if there is an AS clause. If there is no AS clause + /// then the name of the column is unspecified and may change from + /// one release of SQLite to the next. ffi.Pointer sqlite3_column_name( ffi.Pointer arg0, int N, @@ -1398,6 +3246,46 @@ class SQLite { _dart_sqlite3_column_name16 _sqlite3_column_name16; + /// CAPI3REF: Source Of Data In A Query Result + /// METHOD: sqlite3_stmt + /// + /// ^These routines provide a means to determine the database, table, and + /// table column that is the origin of a particular result column in + /// [SELECT] statement. + /// ^The name of the database or table or column can be returned as + /// either a UTF-8 or UTF-16 string. ^The _database_ routines return + /// the database name, the _table_ routines return the table name, and + /// the origin_ routines return the column name. + /// ^The returned string is valid until the [prepared statement] is destroyed + /// using [sqlite3_finalize()] or until the statement is automatically + /// reprepared by the first call to [sqlite3_step()] for a particular run + /// or until the same information is requested + /// again in a different encoding. + /// + /// ^The names returned are the original un-aliased names of the + /// database, table, and column. + /// + /// ^The first argument to these interfaces is a [prepared statement]. + /// ^These functions return information about the Nth result column returned by + /// the statement, where N is the second function argument. + /// ^The left-most column is column 0 for these routines. + /// + /// ^If the Nth column returned by the statement is an expression or + /// subquery and is not a column value, then all of these functions return + /// NULL. ^These routines might also return NULL if a memory allocation error + /// occurs. ^Otherwise, they return the name of the attached database, table, + /// or column that query result column was extracted from. + /// + /// ^As with all other SQLite APIs, those whose names end with "16" return + /// UTF-16 encoded strings and the other functions return UTF-8. + /// + /// ^These APIs are only available if the library was compiled with the + /// [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. + /// + /// If two or more threads call one or more + /// [sqlite3_column_database_name | column metadata interfaces] + /// for the same [prepared statement] and result column + /// at the same time then the results are undefined. ffi.Pointer sqlite3_column_database_name( ffi.Pointer arg0, int arg1, @@ -1488,6 +3376,34 @@ class SQLite { _dart_sqlite3_column_origin_name16 _sqlite3_column_origin_name16; + /// CAPI3REF: Declared Datatype Of A Query Result + /// METHOD: sqlite3_stmt + /// + /// ^(The first parameter is a [prepared statement]. + /// If this statement is a [SELECT] statement and the Nth column of the + /// returned result set of that [SELECT] is a table column (not an + /// expression or subquery) then the declared type of the table + /// column is returned.)^ ^If the Nth column of the result set is an + /// expression or subquery, then a NULL pointer is returned. + /// ^The returned string is always UTF-8 encoded. + /// + /// ^(For example, given the database schema: + /// + /// CREATE TABLE t1(c1 VARIANT); + /// + /// and the following statement to be compiled: + /// + /// SELECT c1 + 1, c1 FROM t1; + /// + /// this routine would return the string "VARIANT" for the second result + /// column (i==1), and a NULL pointer for the first result column (i==0).)^ + /// + /// ^SQLite uses dynamic run-time typing. ^So just because a column + /// is declared to contain a particular type does not mean that the + /// data stored in that column is of the declared type. SQLite is + /// strongly typed, but the typing is dynamic not static. ^Type + /// is associated with individual values, not with the containers + /// used to hold those values. ffi.Pointer sqlite3_column_decltype( ffi.Pointer arg0, int arg1, @@ -1518,6 +3434,86 @@ class SQLite { _dart_sqlite3_column_decltype16 _sqlite3_column_decltype16; + /// CAPI3REF: Evaluate An SQL Statement + /// METHOD: sqlite3_stmt + /// + /// After a [prepared statement] has been prepared using any of + /// [sqlite3_prepare_v2()], [sqlite3_prepare_v3()], [sqlite3_prepare16_v2()], + /// or [sqlite3_prepare16_v3()] or one of the legacy + /// interfaces [sqlite3_prepare()] or [sqlite3_prepare16()], this function + /// must be called one or more times to evaluate the statement. + /// + /// The details of the behavior of the sqlite3_step() interface depend + /// on whether the statement was prepared using the newer "vX" interfaces + /// [sqlite3_prepare_v3()], [sqlite3_prepare_v2()], [sqlite3_prepare16_v3()], + /// [sqlite3_prepare16_v2()] or the older legacy + /// interfaces [sqlite3_prepare()] and [sqlite3_prepare16()]. The use of the + /// new "vX" interface is recommended for new applications but the legacy + /// interface will continue to be supported. + /// + /// ^In the legacy interface, the return value will be either [SQLITE_BUSY], + /// [SQLITE_DONE], [SQLITE_ROW], [SQLITE_ERROR], or [SQLITE_MISUSE]. + /// ^With the "v2" interface, any of the other [result codes] or + /// [extended result codes] might be returned as well. + /// + /// ^[SQLITE_BUSY] means that the database engine was unable to acquire the + /// database locks it needs to do its job. ^If the statement is a [COMMIT] + /// or occurs outside of an explicit transaction, then you can retry the + /// statement. If the statement is not a [COMMIT] and occurs within an + /// explicit transaction then you should rollback the transaction before + /// continuing. + /// + /// ^[SQLITE_DONE] means that the statement has finished executing + /// successfully. sqlite3_step() should not be called again on this virtual + /// machine without first calling [sqlite3_reset()] to reset the virtual + /// machine back to its initial state. + /// + /// ^If the SQL statement being executed returns any data, then [SQLITE_ROW] + /// is returned each time a new row of data is ready for processing by the + /// caller. The values may be accessed using the [column access functions]. + /// sqlite3_step() is called again to retrieve the next row of data. + /// + /// ^[SQLITE_ERROR] means that a run-time error (such as a constraint + /// violation) has occurred. sqlite3_step() should not be called again on + /// the VM. More information may be found by calling [sqlite3_errmsg()]. + /// ^With the legacy interface, a more specific error code (for example, + /// [SQLITE_INTERRUPT], [SQLITE_SCHEMA], [SQLITE_CORRUPT], and so forth) + /// can be obtained by calling [sqlite3_reset()] on the + /// [prepared statement]. ^In the "v2" interface, + /// the more specific error code is returned directly by sqlite3_step(). + /// + /// [SQLITE_MISUSE] means that the this routine was called inappropriately. + /// Perhaps it was called on a [prepared statement] that has + /// already been [sqlite3_finalize | finalized] or on one that had + /// previously returned [SQLITE_ERROR] or [SQLITE_DONE]. Or it could + /// be the case that the same database connection is being used by two or + /// more threads at the same moment in time. + /// + /// For all versions of SQLite up to and including 3.6.23.1, a call to + /// [sqlite3_reset()] was required after sqlite3_step() returned anything + /// other than [SQLITE_ROW] before any subsequent invocation of + /// sqlite3_step(). Failure to reset the prepared statement using + /// [sqlite3_reset()] would result in an [SQLITE_MISUSE] return from + /// sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1], + /// sqlite3_step() began + /// calling [sqlite3_reset()] automatically in this circumstance rather + /// than returning [SQLITE_MISUSE]. This is not considered a compatibility + /// break because any application that ever receives an SQLITE_MISUSE error + /// is broken by definition. The [SQLITE_OMIT_AUTORESET] compile-time option + /// can be used to restore the legacy behavior. + /// + /// Goofy Interface Alert: In the legacy interface, the sqlite3_step() + /// API always returns a generic error code, [SQLITE_ERROR], following any + /// error other than [SQLITE_BUSY] and [SQLITE_MISUSE]. You must call + /// [sqlite3_reset()] or [sqlite3_finalize()] in order to find one of the + /// specific [error codes] that better describes the error. + /// We admit that this is a goofy design. The problem has been fixed + /// with the "v2" interface. If you prepare all of your SQL statements + /// using [sqlite3_prepare_v3()] or [sqlite3_prepare_v2()] + /// or [sqlite3_prepare16_v2()] or [sqlite3_prepare16_v3()] instead + /// of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces, + /// then the more specific [error codes] are returned directly + /// by sqlite3_step(). The use of the "vX" interfaces is recommended. int sqlite3_step( ffi.Pointer arg0, ) { @@ -1530,6 +3526,23 @@ class SQLite { _dart_sqlite3_step _sqlite3_step; + /// CAPI3REF: Number of columns in a result set + /// METHOD: sqlite3_stmt + /// + /// ^The sqlite3_data_count(P) interface returns the number of columns in the + /// current row of the result set of [prepared statement] P. + /// ^If prepared statement P does not have results ready to return + /// (via calls to the [sqlite3_column_int | sqlite3_column()] family of + /// interfaces) then sqlite3_data_count(P) returns 0. + /// ^The sqlite3_data_count(P) routine also returns 0 if P is a NULL pointer. + /// ^The sqlite3_data_count(P) routine returns 0 if the previous call to + /// [sqlite3_step](P) returned [SQLITE_DONE]. ^The sqlite3_data_count(P) + /// will return non-zero if previous call to [sqlite3_step](P) returned + /// [SQLITE_ROW], except in the case of the [PRAGMA incremental_vacuum] + /// where it always returns zero since each step of that multi-step + /// pragma returns 0 columns of data. + /// + /// See also: [sqlite3_column_count()] int sqlite3_data_count( ffi.Pointer pStmt, ) { @@ -1543,6 +3556,213 @@ class SQLite { _dart_sqlite3_data_count _sqlite3_data_count; + /// CAPI3REF: Result Values From A Query + /// KEYWORDS: {column access functions} + /// METHOD: sqlite3_stmt + /// + /// Summary: + ///
+ ///
sqlite3_column_blobBLOB result + ///
sqlite3_column_doubleREAL result + ///
sqlite3_column_int32-bit INTEGER result + ///
sqlite3_column_int6464-bit INTEGER result + ///
sqlite3_column_textUTF-8 TEXT result + ///
sqlite3_column_text16UTF-16 TEXT result + ///
sqlite3_column_valueThe result as an + /// [sqlite3_value|unprotected sqlite3_value] object. + ///
    + ///
sqlite3_column_bytesSize of a BLOB + /// or a UTF-8 TEXT result in bytes + ///
sqlite3_column_bytes16   + /// →  Size of UTF-16 + /// TEXT in bytes + ///
sqlite3_column_typeDefault + /// datatype of the result + ///
+ /// + /// Details: + /// + /// ^These routines return information about a single column of the current + /// result row of a query. ^In every case the first argument is a pointer + /// to the [prepared statement] that is being evaluated (the [sqlite3_stmt*] + /// that was returned from [sqlite3_prepare_v2()] or one of its variants) + /// and the second argument is the index of the column for which information + /// should be returned. ^The leftmost column of the result set has the index 0. + /// ^The number of columns in the result can be determined using + /// [sqlite3_column_count()]. + /// + /// If the SQL statement does not currently point to a valid row, or if the + /// column index is out of range, the result is undefined. + /// These routines may only be called when the most recent call to + /// [sqlite3_step()] has returned [SQLITE_ROW] and neither + /// [sqlite3_reset()] nor [sqlite3_finalize()] have been called subsequently. + /// If any of these routines are called after [sqlite3_reset()] or + /// [sqlite3_finalize()] or after [sqlite3_step()] has returned + /// something other than [SQLITE_ROW], the results are undefined. + /// If [sqlite3_step()] or [sqlite3_reset()] or [sqlite3_finalize()] + /// are called from a different thread while any of these routines + /// are pending, then the results are undefined. + /// + /// The first six interfaces (_blob, _double, _int, _int64, _text, and _text16) + /// each return the value of a result column in a specific data format. If + /// the result column is not initially in the requested format (for example, + /// if the query returns an integer but the sqlite3_column_text() interface + /// is used to extract the value) then an automatic type conversion is performed. + /// + /// ^The sqlite3_column_type() routine returns the + /// [SQLITE_INTEGER | datatype code] for the initial data type + /// of the result column. ^The returned value is one of [SQLITE_INTEGER], + /// [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL]. + /// The return value of sqlite3_column_type() can be used to decide which + /// of the first six interface should be used to extract the column value. + /// The value returned by sqlite3_column_type() is only meaningful if no + /// automatic type conversions have occurred for the value in question. + /// After a type conversion, the result of calling sqlite3_column_type() + /// is undefined, though harmless. Future + /// versions of SQLite may change the behavior of sqlite3_column_type() + /// following a type conversion. + /// + /// If the result is a BLOB or a TEXT string, then the sqlite3_column_bytes() + /// or sqlite3_column_bytes16() interfaces can be used to determine the size + /// of that BLOB or string. + /// + /// ^If the result is a BLOB or UTF-8 string then the sqlite3_column_bytes() + /// routine returns the number of bytes in that BLOB or string. + /// ^If the result is a UTF-16 string, then sqlite3_column_bytes() converts + /// the string to UTF-8 and then returns the number of bytes. + /// ^If the result is a numeric value then sqlite3_column_bytes() uses + /// [sqlite3_snprintf()] to convert that value to a UTF-8 string and returns + /// the number of bytes in that string. + /// ^If the result is NULL, then sqlite3_column_bytes() returns zero. + /// + /// ^If the result is a BLOB or UTF-16 string then the sqlite3_column_bytes16() + /// routine returns the number of bytes in that BLOB or string. + /// ^If the result is a UTF-8 string, then sqlite3_column_bytes16() converts + /// the string to UTF-16 and then returns the number of bytes. + /// ^If the result is a numeric value then sqlite3_column_bytes16() uses + /// [sqlite3_snprintf()] to convert that value to a UTF-16 string and returns + /// the number of bytes in that string. + /// ^If the result is NULL, then sqlite3_column_bytes16() returns zero. + /// + /// ^The values returned by [sqlite3_column_bytes()] and + /// [sqlite3_column_bytes16()] do not include the zero terminators at the end + /// of the string. ^For clarity: the values returned by + /// [sqlite3_column_bytes()] and [sqlite3_column_bytes16()] are the number of + /// bytes in the string, not the number of characters. + /// + /// ^Strings returned by sqlite3_column_text() and sqlite3_column_text16(), + /// even empty strings, are always zero-terminated. ^The return + /// value from sqlite3_column_blob() for a zero-length BLOB is a NULL pointer. + /// + /// Warning: ^The object returned by [sqlite3_column_value()] is an + /// [unprotected sqlite3_value] object. In a multithreaded environment, + /// an unprotected sqlite3_value object may only be used safely with + /// [sqlite3_bind_value()] and [sqlite3_result_value()]. + /// If the [unprotected sqlite3_value] object returned by + /// [sqlite3_column_value()] is used in any other way, including calls + /// to routines like [sqlite3_value_int()], [sqlite3_value_text()], + /// or [sqlite3_value_bytes()], the behavior is not threadsafe. + /// Hence, the sqlite3_column_value() interface + /// is normally only useful within the implementation of + /// [application-defined SQL functions] or [virtual tables], not within + /// top-level application code. + /// + /// The these routines may attempt to convert the datatype of the result. + /// ^For example, if the internal representation is FLOAT and a text result + /// is requested, [sqlite3_snprintf()] is used internally to perform the + /// conversion automatically. ^(The following table details the conversions + /// that are applied: + /// + ///
+ /// + ///
Internal
Type
Requested
Type
Conversion + /// + ///
NULL INTEGER Result is 0 + ///
NULL FLOAT Result is 0.0 + ///
NULL TEXT Result is a NULL pointer + ///
NULL BLOB Result is a NULL pointer + ///
INTEGER FLOAT Convert from integer to float + ///
INTEGER TEXT ASCII rendering of the integer + ///
INTEGER BLOB Same as INTEGER->TEXT + ///
FLOAT INTEGER [CAST] to INTEGER + ///
FLOAT TEXT ASCII rendering of the float + ///
FLOAT BLOB [CAST] to BLOB + ///
TEXT INTEGER [CAST] to INTEGER + ///
TEXT FLOAT [CAST] to REAL + ///
TEXT BLOB No change + ///
BLOB INTEGER [CAST] to INTEGER + ///
BLOB FLOAT [CAST] to REAL + ///
BLOB TEXT Add a zero terminator if needed + ///
+ ///
)^ + /// + /// Note that when type conversions occur, pointers returned by prior + /// calls to sqlite3_column_blob(), sqlite3_column_text(), and/or + /// sqlite3_column_text16() may be invalidated. + /// Type conversions and pointer invalidations might occur + /// in the following cases: + /// + ///
    + ///
  • The initial content is a BLOB and sqlite3_column_text() or + /// sqlite3_column_text16() is called. A zero-terminator might + /// need to be added to the string.
  • + ///
  • The initial content is UTF-8 text and sqlite3_column_bytes16() or + /// sqlite3_column_text16() is called. The content must be converted + /// to UTF-16.
  • + ///
  • The initial content is UTF-16 text and sqlite3_column_bytes() or + /// sqlite3_column_text() is called. The content must be converted + /// to UTF-8.
  • + ///
+ /// + /// ^Conversions between UTF-16be and UTF-16le are always done in place and do + /// not invalidate a prior pointer, though of course the content of the buffer + /// that the prior pointer references will have been modified. Other kinds + /// of conversion are done in place when it is possible, but sometimes they + /// are not possible and in those cases prior pointers are invalidated. + /// + /// The safest policy is to invoke these routines + /// in one of the following ways: + /// + ///
    + ///
  • sqlite3_column_text() followed by sqlite3_column_bytes()
  • + ///
  • sqlite3_column_blob() followed by sqlite3_column_bytes()
  • + ///
  • sqlite3_column_text16() followed by sqlite3_column_bytes16()
  • + ///
+ /// + /// In other words, you should call sqlite3_column_text(), + /// sqlite3_column_blob(), or sqlite3_column_text16() first to force the result + /// into the desired format, then invoke sqlite3_column_bytes() or + /// sqlite3_column_bytes16() to find the size of the result. Do not mix calls + /// to sqlite3_column_text() or sqlite3_column_blob() with calls to + /// sqlite3_column_bytes16(), and do not mix calls to sqlite3_column_text16() + /// with calls to sqlite3_column_bytes(). + /// + /// ^The pointers returned are valid until a type conversion occurs as + /// described above, or until [sqlite3_step()] or [sqlite3_reset()] or + /// [sqlite3_finalize()] is called. ^The memory space used to hold strings + /// and BLOBs is freed automatically. Do not pass the pointers returned + /// from [sqlite3_column_blob()], [sqlite3_column_text()], etc. into + /// [sqlite3_free()]. + /// + /// As long as the input parameters are correct, these routines will only + /// fail if an out-of-memory error occurs during a format conversion. + /// Only the following subset of interfaces are subject to out-of-memory + /// errors: + /// + ///
    + ///
  • sqlite3_column_blob() + ///
  • sqlite3_column_text() + ///
  • sqlite3_column_text16() + ///
  • sqlite3_column_bytes() + ///
  • sqlite3_column_bytes16() + ///
+ /// + /// If an out-of-memory error occurs, then the return value from these + /// routines is the same as if the column had contained an SQL NULL value. + /// Valid SQL NULL returns can be distinguished from out-of-memory errors + /// by invoking the [sqlite3_errcode()] immediately after the suspect + /// return value is obtained and before any + /// other SQLite interface is called on the same [database connection]. ffi.Pointer sqlite3_column_blob( ffi.Pointer arg0, int iCol, @@ -1684,6 +3904,30 @@ class SQLite { _dart_sqlite3_column_type _sqlite3_column_type; + /// CAPI3REF: Destroy A Prepared Statement Object + /// DESTRUCTOR: sqlite3_stmt + /// + /// ^The sqlite3_finalize() function is called to delete a [prepared statement]. + /// ^If the most recent evaluation of the statement encountered no errors + /// or if the statement is never been evaluated, then sqlite3_finalize() returns + /// SQLITE_OK. ^If the most recent evaluation of statement S failed, then + /// sqlite3_finalize(S) returns the appropriate [error code] or + /// [extended error code]. + /// + /// ^The sqlite3_finalize(S) routine can be called at any point during + /// the life cycle of [prepared statement] S: + /// before statement S is ever evaluated, after + /// one or more calls to [sqlite3_reset()], or after any call + /// to [sqlite3_step()] regardless of whether or not the statement has + /// completed execution. + /// + /// ^Invoking sqlite3_finalize() on a NULL pointer is a harmless no-op. + /// + /// The application must finalize every [prepared statement] in order to avoid + /// resource leaks. It is a grievous error for the application to try to use + /// a prepared statement after it has been finalized. Any use of a prepared + /// statement after it has been finalized can result in undefined and + /// undesirable behavior such as segfaults and heap corruption. int sqlite3_finalize( ffi.Pointer pStmt, ) { @@ -1697,6 +3941,29 @@ class SQLite { _dart_sqlite3_finalize _sqlite3_finalize; + /// CAPI3REF: Reset A Prepared Statement Object + /// METHOD: sqlite3_stmt + /// + /// The sqlite3_reset() function is called to reset a [prepared statement] + /// object back to its initial state, ready to be re-executed. + /// ^Any SQL statement variables that had values bound to them using + /// the [sqlite3_bind_blob | sqlite3_bind_*() API] retain their values. + /// Use [sqlite3_clear_bindings()] to reset the bindings. + /// + /// ^The [sqlite3_reset(S)] interface resets the [prepared statement] S + /// back to the beginning of its program. + /// + /// ^If the most recent call to [sqlite3_step(S)] for the + /// [prepared statement] S returned [SQLITE_ROW] or [SQLITE_DONE], + /// or if [sqlite3_step(S)] has never before been called on S, + /// then [sqlite3_reset(S)] returns [SQLITE_OK]. + /// + /// ^If the most recent call to [sqlite3_step(S)] for the + /// [prepared statement] S indicated an error, then + /// [sqlite3_reset(S)] returns an appropriate [error code]. + /// + /// ^The [sqlite3_reset(S)] interface does not change the values + /// of any [sqlite3_bind_blob|bindings] on the [prepared statement] S. int sqlite3_reset( ffi.Pointer pStmt, ) { @@ -1709,6 +3976,129 @@ class SQLite { _dart_sqlite3_reset _sqlite3_reset; + /// CAPI3REF: Create Or Redefine SQL Functions + /// KEYWORDS: {function creation routines} + /// METHOD: sqlite3 + /// + /// ^These functions (collectively known as "function creation routines") + /// are used to add SQL functions or aggregates or to redefine the behavior + /// of existing SQL functions or aggregates. The only differences between + /// the three "sqlite3_create_function*" routines are the text encoding + /// expected for the second parameter (the name of the function being + /// created) and the presence or absence of a destructor callback for + /// the application data pointer. Function sqlite3_create_window_function() + /// is similar, but allows the user to supply the extra callback functions + /// needed by [aggregate window functions]. + /// + /// ^The first parameter is the [database connection] to which the SQL + /// function is to be added. ^If an application uses more than one database + /// connection then application-defined SQL functions must be added + /// to each database connection separately. + /// + /// ^The second parameter is the name of the SQL function to be created or + /// redefined. ^The length of the name is limited to 255 bytes in a UTF-8 + /// representation, exclusive of the zero-terminator. ^Note that the name + /// length limit is in UTF-8 bytes, not characters nor UTF-16 bytes. + /// ^Any attempt to create a function with a longer name + /// will result in [SQLITE_MISUSE] being returned. + /// + /// ^The third parameter (nArg) + /// is the number of arguments that the SQL function or + /// aggregate takes. ^If this parameter is -1, then the SQL function or + /// aggregate may take any number of arguments between 0 and the limit + /// set by [sqlite3_limit]([SQLITE_LIMIT_FUNCTION_ARG]). If the third + /// parameter is less than -1 or greater than 127 then the behavior is + /// undefined. + /// + /// ^The fourth parameter, eTextRep, specifies what + /// [SQLITE_UTF8 | text encoding] this SQL function prefers for + /// its parameters. The application should set this parameter to + /// [SQLITE_UTF16LE] if the function implementation invokes + /// [sqlite3_value_text16le()] on an input, or [SQLITE_UTF16BE] if the + /// implementation invokes [sqlite3_value_text16be()] on an input, or + /// [SQLITE_UTF16] if [sqlite3_value_text16()] is used, or [SQLITE_UTF8] + /// otherwise. ^The same SQL function may be registered multiple times using + /// different preferred text encodings, with different implementations for + /// each encoding. + /// ^When multiple implementations of the same function are available, SQLite + /// will pick the one that involves the least amount of data conversion. + /// + /// ^The fourth parameter may optionally be ORed with [SQLITE_DETERMINISTIC] + /// to signal that the function will always return the same result given + /// the same inputs within a single SQL statement. Most SQL functions are + /// deterministic. The built-in [random()] SQL function is an example of a + /// function that is not deterministic. The SQLite query planner is able to + /// perform additional optimizations on deterministic functions, so use + /// of the [SQLITE_DETERMINISTIC] flag is recommended where possible. + /// + /// ^The fourth parameter may also optionally include the [SQLITE_DIRECTONLY] + /// flag, which if present prevents the function from being invoked from + /// within VIEWs, TRIGGERs, CHECK constraints, generated column expressions, + /// index expressions, or the WHERE clause of partial indexes. + /// + /// + /// For best security, the [SQLITE_DIRECTONLY] flag is recommended for + /// all application-defined SQL functions that do not need to be + /// used inside of triggers, view, CHECK constraints, or other elements of + /// the database schema. This flags is especially recommended for SQL + /// functions that have side effects or reveal internal application state. + /// Without this flag, an attacker might be able to modify the schema of + /// a database file to include invocations of the function with parameters + /// chosen by the attacker, which the application will then execute when + /// the database file is opened and read. + /// + /// + /// ^(The fifth parameter is an arbitrary pointer. The implementation of the + /// function can gain access to this pointer using [sqlite3_user_data()].)^ + /// + /// ^The sixth, seventh and eighth parameters passed to the three + /// "sqlite3_create_function*" functions, xFunc, xStep and xFinal, are + /// pointers to C-language functions that implement the SQL function or + /// aggregate. ^A scalar SQL function requires an implementation of the xFunc + /// callback only; NULL pointers must be passed as the xStep and xFinal + /// parameters. ^An aggregate SQL function requires an implementation of xStep + /// and xFinal and NULL pointer must be passed for xFunc. ^To delete an existing + /// SQL function or aggregate, pass NULL pointers for all three function + /// callbacks. + /// + /// ^The sixth, seventh, eighth and ninth parameters (xStep, xFinal, xValue + /// and xInverse) passed to sqlite3_create_window_function are pointers to + /// C-language callbacks that implement the new function. xStep and xFinal + /// must both be non-NULL. xValue and xInverse may either both be NULL, in + /// which case a regular aggregate function is created, or must both be + /// non-NULL, in which case the new function may be used as either an aggregate + /// or aggregate window function. More details regarding the implementation + /// of aggregate window functions are + /// [user-defined window functions|available here]. + /// + /// ^(If the final parameter to sqlite3_create_function_v2() or + /// sqlite3_create_window_function() is not NULL, then it is destructor for + /// the application data pointer. The destructor is invoked when the function + /// is deleted, either by being overloaded or when the database connection + /// closes.)^ ^The destructor is also invoked if the call to + /// sqlite3_create_function_v2() fails. ^When the destructor callback is + /// invoked, it is passed a single argument which is a copy of the application + /// data pointer which was the fifth parameter to sqlite3_create_function_v2(). + /// + /// ^It is permitted to register multiple implementations of the same + /// functions with the same name but with either differing numbers of + /// arguments or differing preferred text encodings. ^SQLite will use + /// the implementation that most closely matches the way in which the + /// SQL function is used. ^A function implementation with a non-negative + /// nArg parameter is a better match than a function implementation with + /// a negative nArg. ^A function where the preferred text encoding + /// matches the database encoding is a better + /// match than a function where the encoding is different. + /// ^A function where the encoding difference is between UTF16le and UTF16be + /// is a closer match than a function where the encoding difference is + /// between UTF8 and UTF16. + /// + /// ^Built-in functions may be overloaded by new application-defined functions. + /// + /// ^An application-defined function is permitted to call other + /// SQLite interfaces. However, such calls must not + /// close the database connection nor finalize or reset the prepared + /// statement in which the function is running. int sqlite3_create_function( ffi.Pointer db, ffi.Pointer zFunctionName, @@ -1896,6 +4286,132 @@ class SQLite { _dart_sqlite3_memory_alarm _sqlite3_memory_alarm; + /// CAPI3REF: Obtaining SQL Values + /// METHOD: sqlite3_value + /// + /// Summary: + ///
+ ///
sqlite3_value_blobBLOB value + ///
sqlite3_value_doubleREAL value + ///
sqlite3_value_int32-bit INTEGER value + ///
sqlite3_value_int6464-bit INTEGER value + ///
sqlite3_value_pointerPointer value + ///
sqlite3_value_textUTF-8 TEXT value + ///
sqlite3_value_text16UTF-16 TEXT value in + /// the native byteorder + ///
sqlite3_value_text16beUTF-16be TEXT value + ///
sqlite3_value_text16leUTF-16le TEXT value + ///
    + ///
sqlite3_value_bytesSize of a BLOB + /// or a UTF-8 TEXT in bytes + ///
sqlite3_value_bytes16   + /// →  Size of UTF-16 + /// TEXT in bytes + ///
sqlite3_value_typeDefault + /// datatype of the value + ///
sqlite3_value_numeric_type   + /// →  Best numeric datatype of the value + ///
sqlite3_value_nochange   + /// →  True if the column is unchanged in an UPDATE + /// against a virtual table. + ///
sqlite3_value_frombind   + /// →  True if value originated from a [bound parameter] + ///
+ /// + /// Details: + /// + /// These routines extract type, size, and content information from + /// [protected sqlite3_value] objects. Protected sqlite3_value objects + /// are used to pass parameter information into the functions that + /// implement [application-defined SQL functions] and [virtual tables]. + /// + /// These routines work only with [protected sqlite3_value] objects. + /// Any attempt to use these routines on an [unprotected sqlite3_value] + /// is not threadsafe. + /// + /// ^These routines work just like the corresponding [column access functions] + /// except that these routines take a single [protected sqlite3_value] object + /// pointer instead of a [sqlite3_stmt*] pointer and an integer column number. + /// + /// ^The sqlite3_value_text16() interface extracts a UTF-16 string + /// in the native byte-order of the host machine. ^The + /// sqlite3_value_text16be() and sqlite3_value_text16le() interfaces + /// extract UTF-16 strings as big-endian and little-endian respectively. + /// + /// ^If [sqlite3_value] object V was initialized + /// using [sqlite3_bind_pointer(S,I,P,X,D)] or [sqlite3_result_pointer(C,P,X,D)] + /// and if X and Y are strings that compare equal according to strcmp(X,Y), + /// then sqlite3_value_pointer(V,Y) will return the pointer P. ^Otherwise, + /// sqlite3_value_pointer(V,Y) returns a NULL. The sqlite3_bind_pointer() + /// routine is part of the [pointer passing interface] added for SQLite 3.20.0. + /// + /// ^(The sqlite3_value_type(V) interface returns the + /// [SQLITE_INTEGER | datatype code] for the initial datatype of the + /// [sqlite3_value] object V. The returned value is one of [SQLITE_INTEGER], + /// [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL].)^ + /// Other interfaces might change the datatype for an sqlite3_value object. + /// For example, if the datatype is initially SQLITE_INTEGER and + /// sqlite3_value_text(V) is called to extract a text value for that + /// integer, then subsequent calls to sqlite3_value_type(V) might return + /// SQLITE_TEXT. Whether or not a persistent internal datatype conversion + /// occurs is undefined and may change from one release of SQLite to the next. + /// + /// ^(The sqlite3_value_numeric_type() interface attempts to apply + /// numeric affinity to the value. This means that an attempt is + /// made to convert the value to an integer or floating point. If + /// such a conversion is possible without loss of information (in other + /// words, if the value is a string that looks like a number) + /// then the conversion is performed. Otherwise no conversion occurs. + /// The [SQLITE_INTEGER | datatype] after conversion is returned.)^ + /// + /// ^Within the [xUpdate] method of a [virtual table], the + /// sqlite3_value_nochange(X) interface returns true if and only if + /// the column corresponding to X is unchanged by the UPDATE operation + /// that the xUpdate method call was invoked to implement and if + /// and the prior [xColumn] method call that was invoked to extracted + /// the value for that column returned without setting a result (probably + /// because it queried [sqlite3_vtab_nochange()] and found that the column + /// was unchanging). ^Within an [xUpdate] method, any value for which + /// sqlite3_value_nochange(X) is true will in all other respects appear + /// to be a NULL value. If sqlite3_value_nochange(X) is invoked anywhere other + /// than within an [xUpdate] method call for an UPDATE statement, then + /// the return value is arbitrary and meaningless. + /// + /// ^The sqlite3_value_frombind(X) interface returns non-zero if the + /// value X originated from one of the [sqlite3_bind_int|sqlite3_bind()] + /// interfaces. ^If X comes from an SQL literal value, or a table column, + /// or an expression, then sqlite3_value_frombind(X) returns zero. + /// + /// Please pay particular attention to the fact that the pointer returned + /// from [sqlite3_value_blob()], [sqlite3_value_text()], or + /// [sqlite3_value_text16()] can be invalidated by a subsequent call to + /// [sqlite3_value_bytes()], [sqlite3_value_bytes16()], [sqlite3_value_text()], + /// or [sqlite3_value_text16()]. + /// + /// These routines must be called from the same thread as + /// the SQL function that supplied the [sqlite3_value*] parameters. + /// + /// As long as the input parameter is correct, these routines can only + /// fail if an out-of-memory error occurs during a format conversion. + /// Only the following subset of interfaces are subject to out-of-memory + /// errors: + /// + ///
    + ///
  • sqlite3_value_blob() + ///
  • sqlite3_value_text() + ///
  • sqlite3_value_text16() + ///
  • sqlite3_value_text16le() + ///
  • sqlite3_value_text16be() + ///
  • sqlite3_value_bytes() + ///
  • sqlite3_value_bytes16() + ///
+ /// + /// If an out-of-memory error occurs, then the return value from these + /// routines is the same as if the column had contained an SQL NULL value. + /// Valid SQL NULL returns can be distinguished from out-of-memory errors + /// by invoking the [sqlite3_errcode()] immediately after the suspect + /// return value is obtained and before any + /// other SQLite interface is called on the same [database connection]. ffi.Pointer sqlite3_value_blob( ffi.Pointer arg0, ) { @@ -2083,6 +4599,14 @@ class SQLite { _dart_sqlite3_value_frombind _sqlite3_value_frombind; + /// CAPI3REF: Finding The Subtype Of SQL Values + /// METHOD: sqlite3_value + /// + /// The sqlite3_value_subtype(V) function returns the subtype for + /// an [application-defined SQL function] argument V. The subtype + /// information can be used to pass a limited amount of context from + /// one SQL function to another. Use the [sqlite3_result_subtype()] + /// routine to set the subtype for the return value of an SQL function. int sqlite3_value_subtype( ffi.Pointer arg0, ) { @@ -2095,6 +4619,18 @@ class SQLite { _dart_sqlite3_value_subtype _sqlite3_value_subtype; + /// CAPI3REF: Copy And Free SQL Values + /// METHOD: sqlite3_value + /// + /// ^The sqlite3_value_dup(V) interface makes a copy of the [sqlite3_value] + /// object D and returns a pointer to that copy. ^The [sqlite3_value] returned + /// is a [protected sqlite3_value] object even if the input is not. + /// ^The sqlite3_value_dup(V) interface returns NULL if V is NULL or if a + /// memory allocation fails. + /// + /// ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object + /// previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer + /// then sqlite3_value_free(V) is a harmless no-op. ffi.Pointer sqlite3_value_dup( ffi.Pointer arg0, ) { @@ -2121,6 +4657,47 @@ class SQLite { _dart_sqlite3_value_free _sqlite3_value_free; + /// CAPI3REF: Obtain Aggregate Function Context + /// METHOD: sqlite3_context + /// + /// Implementations of aggregate SQL functions use this + /// routine to allocate memory for storing their state. + /// + /// ^The first time the sqlite3_aggregate_context(C,N) routine is called + /// for a particular aggregate function, SQLite allocates + /// N bytes of memory, zeroes out that memory, and returns a pointer + /// to the new memory. ^On second and subsequent calls to + /// sqlite3_aggregate_context() for the same aggregate function instance, + /// the same buffer is returned. Sqlite3_aggregate_context() is normally + /// called once for each invocation of the xStep callback and then one + /// last time when the xFinal callback is invoked. ^(When no rows match + /// an aggregate query, the xStep() callback of the aggregate function + /// implementation is never called and xFinal() is called exactly once. + /// In those cases, sqlite3_aggregate_context() might be called for the + /// first time from within xFinal().)^ + /// + /// ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer + /// when first called if N is less than or equal to zero or if a memory + /// allocate error occurs. + /// + /// ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is + /// determined by the N parameter on first successful call. Changing the + /// value of N in any subsequent call to sqlite3_aggregate_context() within + /// the same aggregate function instance will not resize the memory + /// allocation.)^ Within the xFinal callback, it is customary to set + /// N=0 in calls to sqlite3_aggregate_context(C,N) so that no + /// pointless memory allocations occur. + /// + /// ^SQLite automatically frees the memory allocated by + /// sqlite3_aggregate_context() when the aggregate query concludes. + /// + /// The first parameter must be a copy of the + /// [sqlite3_context | SQL function context] that is the first parameter + /// to the xStep or xFinal callback routine that implements the aggregate + /// function. + /// + /// This routine must be called from the same thread in which + /// the aggregate SQL function is running. ffi.Pointer sqlite3_aggregate_context( ffi.Pointer arg0, int nBytes, @@ -2136,6 +4713,17 @@ class SQLite { _dart_sqlite3_aggregate_context _sqlite3_aggregate_context; + /// CAPI3REF: User Data For Functions + /// METHOD: sqlite3_context + /// + /// ^The sqlite3_user_data() interface returns a copy of + /// the pointer that was the pUserData parameter (the 5th parameter) + /// of the [sqlite3_create_function()] + /// and [sqlite3_create_function16()] routines that originally + /// registered the application defined function. + /// + /// This routine must be called from the same thread in which + /// the application-defined function is running. ffi.Pointer sqlite3_user_data( ffi.Pointer arg0, ) { @@ -2149,6 +4737,14 @@ class SQLite { _dart_sqlite3_user_data _sqlite3_user_data; + /// CAPI3REF: Database Connection For Functions + /// METHOD: sqlite3_context + /// + /// ^The sqlite3_context_db_handle() interface returns a copy of + /// the pointer to the [database connection] (the 1st parameter) + /// of the [sqlite3_create_function()] + /// and [sqlite3_create_function16()] routines that originally + /// registered the application defined function. ffi.Pointer sqlite3_context_db_handle( ffi.Pointer arg0, ) { @@ -2162,6 +4758,61 @@ class SQLite { _dart_sqlite3_context_db_handle _sqlite3_context_db_handle; + /// CAPI3REF: Function Auxiliary Data + /// METHOD: sqlite3_context + /// + /// These functions may be used by (non-aggregate) SQL functions to + /// associate metadata with argument values. If the same value is passed to + /// multiple invocations of the same SQL function during query execution, under + /// some circumstances the associated metadata may be preserved. An example + /// of where this might be useful is in a regular-expression matching + /// function. The compiled version of the regular expression can be stored as + /// metadata associated with the pattern string. + /// Then as long as the pattern string remains the same, + /// the compiled regular expression can be reused on multiple + /// invocations of the same function. + /// + /// ^The sqlite3_get_auxdata(C,N) interface returns a pointer to the metadata + /// associated by the sqlite3_set_auxdata(C,N,P,X) function with the Nth argument + /// value to the application-defined function. ^N is zero for the left-most + /// function argument. ^If there is no metadata + /// associated with the function argument, the sqlite3_get_auxdata(C,N) interface + /// returns a NULL pointer. + /// + /// ^The sqlite3_set_auxdata(C,N,P,X) interface saves P as metadata for the N-th + /// argument of the application-defined function. ^Subsequent + /// calls to sqlite3_get_auxdata(C,N) return P from the most recent + /// sqlite3_set_auxdata(C,N,P,X) call if the metadata is still valid or + /// NULL if the metadata has been discarded. + /// ^After each call to sqlite3_set_auxdata(C,N,P,X) where X is not NULL, + /// SQLite will invoke the destructor function X with parameter P exactly + /// once, when the metadata is discarded. + /// SQLite is free to discard the metadata at any time, including:
    + ///
  • ^(when the corresponding function parameter changes)^, or + ///
  • ^(when [sqlite3_reset()] or [sqlite3_finalize()] is called for the + /// SQL statement)^, or + ///
  • ^(when sqlite3_set_auxdata() is invoked again on the same + /// parameter)^, or + ///
  • ^(during the original sqlite3_set_auxdata() call when a memory + /// allocation error occurs.)^
+ /// + /// Note the last bullet in particular. The destructor X in + /// sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the + /// sqlite3_set_auxdata() interface even returns. Hence sqlite3_set_auxdata() + /// should be called near the end of the function implementation and the + /// function implementation should not make any use of P after + /// sqlite3_set_auxdata() has been called. + /// + /// ^(In practice, metadata is preserved between function calls for + /// function parameters that are compile-time constants, including literal + /// values and [parameters] and expressions composed from the same.)^ + /// + /// The value of the N parameter to these interfaces should be non-negative. + /// Future enhancements may make use of negative N values to define new + /// kinds of function caching behavior. + /// + /// These routines must be called from the same thread in which + /// the SQL function is running. ffi.Pointer sqlite3_get_auxdata( ffi.Pointer arg0, int N, @@ -2194,6 +4845,150 @@ class SQLite { _dart_sqlite3_set_auxdata _sqlite3_set_auxdata; + /// CAPI3REF: Setting The Result Of An SQL Function + /// METHOD: sqlite3_context + /// + /// These routines are used by the xFunc or xFinal callbacks that + /// implement SQL functions and aggregates. See + /// [sqlite3_create_function()] and [sqlite3_create_function16()] + /// for additional information. + /// + /// These functions work very much like the [parameter binding] family of + /// functions used to bind values to host parameters in prepared statements. + /// Refer to the [SQL parameter] documentation for additional information. + /// + /// ^The sqlite3_result_blob() interface sets the result from + /// an application-defined function to be the BLOB whose content is pointed + /// to by the second parameter and which is N bytes long where N is the + /// third parameter. + /// + /// ^The sqlite3_result_zeroblob(C,N) and sqlite3_result_zeroblob64(C,N) + /// interfaces set the result of the application-defined function to be + /// a BLOB containing all zero bytes and N bytes in size. + /// + /// ^The sqlite3_result_double() interface sets the result from + /// an application-defined function to be a floating point value specified + /// by its 2nd argument. + /// + /// ^The sqlite3_result_error() and sqlite3_result_error16() functions + /// cause the implemented SQL function to throw an exception. + /// ^SQLite uses the string pointed to by the + /// 2nd parameter of sqlite3_result_error() or sqlite3_result_error16() + /// as the text of an error message. ^SQLite interprets the error + /// message string from sqlite3_result_error() as UTF-8. ^SQLite + /// interprets the string from sqlite3_result_error16() as UTF-16 using + /// the same [byte-order determination rules] as [sqlite3_bind_text16()]. + /// ^If the third parameter to sqlite3_result_error() + /// or sqlite3_result_error16() is negative then SQLite takes as the error + /// message all text up through the first zero character. + /// ^If the third parameter to sqlite3_result_error() or + /// sqlite3_result_error16() is non-negative then SQLite takes that many + /// bytes (not characters) from the 2nd parameter as the error message. + /// ^The sqlite3_result_error() and sqlite3_result_error16() + /// routines make a private copy of the error message text before + /// they return. Hence, the calling function can deallocate or + /// modify the text after they return without harm. + /// ^The sqlite3_result_error_code() function changes the error code + /// returned by SQLite as a result of an error in a function. ^By default, + /// the error code is SQLITE_ERROR. ^A subsequent call to sqlite3_result_error() + /// or sqlite3_result_error16() resets the error code to SQLITE_ERROR. + /// + /// ^The sqlite3_result_error_toobig() interface causes SQLite to throw an + /// error indicating that a string or BLOB is too long to represent. + /// + /// ^The sqlite3_result_error_nomem() interface causes SQLite to throw an + /// error indicating that a memory allocation failed. + /// + /// ^The sqlite3_result_int() interface sets the return value + /// of the application-defined function to be the 32-bit signed integer + /// value given in the 2nd argument. + /// ^The sqlite3_result_int64() interface sets the return value + /// of the application-defined function to be the 64-bit signed integer + /// value given in the 2nd argument. + /// + /// ^The sqlite3_result_null() interface sets the return value + /// of the application-defined function to be NULL. + /// + /// ^The sqlite3_result_text(), sqlite3_result_text16(), + /// sqlite3_result_text16le(), and sqlite3_result_text16be() interfaces + /// set the return value of the application-defined function to be + /// a text string which is represented as UTF-8, UTF-16 native byte order, + /// UTF-16 little endian, or UTF-16 big endian, respectively. + /// ^The sqlite3_result_text64() interface sets the return value of an + /// application-defined function to be a text string in an encoding + /// specified by the fifth (and last) parameter, which must be one + /// of [SQLITE_UTF8], [SQLITE_UTF16], [SQLITE_UTF16BE], or [SQLITE_UTF16LE]. + /// ^SQLite takes the text result from the application from + /// the 2nd parameter of the sqlite3_result_text* interfaces. + /// ^If the 3rd parameter to the sqlite3_result_text* interfaces + /// is negative, then SQLite takes result text from the 2nd parameter + /// through the first zero character. + /// ^If the 3rd parameter to the sqlite3_result_text* interfaces + /// is non-negative, then as many bytes (not characters) of the text + /// pointed to by the 2nd parameter are taken as the application-defined + /// function result. If the 3rd parameter is non-negative, then it + /// must be the byte offset into the string where the NUL terminator would + /// appear if the string where NUL terminated. If any NUL characters occur + /// in the string at a byte offset that is less than the value of the 3rd + /// parameter, then the resulting string will contain embedded NULs and the + /// result of expressions operating on strings with embedded NULs is undefined. + /// ^If the 4th parameter to the sqlite3_result_text* interfaces + /// or sqlite3_result_blob is a non-NULL pointer, then SQLite calls that + /// function as the destructor on the text or BLOB result when it has + /// finished using that result. + /// ^If the 4th parameter to the sqlite3_result_text* interfaces or to + /// sqlite3_result_blob is the special constant SQLITE_STATIC, then SQLite + /// assumes that the text or BLOB result is in constant space and does not + /// copy the content of the parameter nor call a destructor on the content + /// when it has finished using that result. + /// ^If the 4th parameter to the sqlite3_result_text* interfaces + /// or sqlite3_result_blob is the special constant SQLITE_TRANSIENT + /// then SQLite makes a copy of the result into space obtained + /// from [sqlite3_malloc()] before it returns. + /// + /// ^For the sqlite3_result_text16(), sqlite3_result_text16le(), and + /// sqlite3_result_text16be() routines, and for sqlite3_result_text64() + /// when the encoding is not UTF8, if the input UTF16 begins with a + /// byte-order mark (BOM, U+FEFF) then the BOM is removed from the + /// string and the rest of the string is interpreted according to the + /// byte-order specified by the BOM. ^The byte-order specified by + /// the BOM at the beginning of the text overrides the byte-order + /// specified by the interface procedure. ^So, for example, if + /// sqlite3_result_text16le() is invoked with text that begins + /// with bytes 0xfe, 0xff (a big-endian byte-order mark) then the + /// first two bytes of input are skipped and the remaining input + /// is interpreted as UTF16BE text. + /// + /// ^For UTF16 input text to the sqlite3_result_text16(), + /// sqlite3_result_text16be(), sqlite3_result_text16le(), and + /// sqlite3_result_text64() routines, if the text contains invalid + /// UTF16 characters, the invalid characters might be converted + /// into the unicode replacement character, U+FFFD. + /// + /// ^The sqlite3_result_value() interface sets the result of + /// the application-defined function to be a copy of the + /// [unprotected sqlite3_value] object specified by the 2nd parameter. ^The + /// sqlite3_result_value() interface makes a copy of the [sqlite3_value] + /// so that the [sqlite3_value] specified in the parameter may change or + /// be deallocated after sqlite3_result_value() returns without harm. + /// ^A [protected sqlite3_value] object may always be used where an + /// [unprotected sqlite3_value] object is required, so either + /// kind of [sqlite3_value] object can be used with this interface. + /// + /// ^The sqlite3_result_pointer(C,P,T,D) interface sets the result to an + /// SQL NULL value, just like [sqlite3_result_null(C)], except that it + /// also associates the host-language pointer P or type T with that + /// NULL value such that the pointer can be retrieved within an + /// [application-defined SQL function] using [sqlite3_value_pointer()]. + /// ^If the D parameter is not NULL, then it is a pointer to a destructor + /// for the P parameter. ^SQLite invokes D with P as its only argument + /// when SQLite is finished with P. The T parameter should be a static + /// string and preferably a string literal. The sqlite3_result_pointer() + /// routine is part of the [pointer passing interface] added for SQLite 3.20.0. + /// + /// If these routines are called from within the different thread + /// than the one containing the application-defined function that received + /// the [sqlite3_context] pointer, the results are undefined. void sqlite3_result_blob( ffi.Pointer arg0, ffi.Pointer arg1, @@ -2514,6 +5309,16 @@ class SQLite { _dart_sqlite3_result_zeroblob64 _sqlite3_result_zeroblob64; + /// CAPI3REF: Setting The Subtype Of An SQL Function + /// METHOD: sqlite3_context + /// + /// The sqlite3_result_subtype(C,T) function causes the subtype of + /// the result from the [application-defined SQL function] with + /// [sqlite3_context] C to be the value T. Only the lower 8 bits + /// of the subtype T are preserved in current versions of SQLite; + /// higher order bits are discarded. + /// The number of subtype bytes preserved by SQLite might increase + /// in future releases of SQLite. void sqlite3_result_subtype( ffi.Pointer arg0, int arg1, @@ -2528,6 +5333,85 @@ class SQLite { _dart_sqlite3_result_subtype _sqlite3_result_subtype; + /// CAPI3REF: Define New Collating Sequences + /// METHOD: sqlite3 + /// + /// ^These functions add, remove, or modify a [collation] associated + /// with the [database connection] specified as the first argument. + /// + /// ^The name of the collation is a UTF-8 string + /// for sqlite3_create_collation() and sqlite3_create_collation_v2() + /// and a UTF-16 string in native byte order for sqlite3_create_collation16(). + /// ^Collation names that compare equal according to [sqlite3_strnicmp()] are + /// considered to be the same name. + /// + /// ^(The third argument (eTextRep) must be one of the constants: + ///
    + ///
  • [SQLITE_UTF8], + ///
  • [SQLITE_UTF16LE], + ///
  • [SQLITE_UTF16BE], + ///
  • [SQLITE_UTF16], or + ///
  • [SQLITE_UTF16_ALIGNED]. + ///
)^ + /// ^The eTextRep argument determines the encoding of strings passed + /// to the collating function callback, xCompare. + /// ^The [SQLITE_UTF16] and [SQLITE_UTF16_ALIGNED] values for eTextRep + /// force strings to be UTF16 with native byte order. + /// ^The [SQLITE_UTF16_ALIGNED] value for eTextRep forces strings to begin + /// on an even byte address. + /// + /// ^The fourth argument, pArg, is an application data pointer that is passed + /// through as the first argument to the collating function callback. + /// + /// ^The fifth argument, xCompare, is a pointer to the collating function. + /// ^Multiple collating functions can be registered using the same name but + /// with different eTextRep parameters and SQLite will use whichever + /// function requires the least amount of data transformation. + /// ^If the xCompare argument is NULL then the collating function is + /// deleted. ^When all collating functions having the same name are deleted, + /// that collation is no longer usable. + /// + /// ^The collating function callback is invoked with a copy of the pArg + /// application data pointer and with two strings in the encoding specified + /// by the eTextRep argument. The two integer parameters to the collating + /// function callback are the length of the two strings, in bytes. The collating + /// function must return an integer that is negative, zero, or positive + /// if the first string is less than, equal to, or greater than the second, + /// respectively. A collating function must always return the same answer + /// given the same inputs. If two or more collating functions are registered + /// to the same collation name (using different eTextRep values) then all + /// must give an equivalent answer when invoked with equivalent strings. + /// The collating function must obey the following properties for all + /// strings A, B, and C: + /// + ///
    + ///
  1. If A==B then B==A. + ///
  2. If A==B and B==C then A==C. + ///
  3. If A<B THEN B>A. + ///
  4. If A<B and B<C then A<C. + ///
+ /// + /// If a collating function fails any of the above constraints and that + /// collating function is registered and used, then the behavior of SQLite + /// is undefined. + /// + /// ^The sqlite3_create_collation_v2() works like sqlite3_create_collation() + /// with the addition that the xDestroy callback is invoked on pArg when + /// the collating function is deleted. + /// ^Collating functions are deleted when they are overridden by later + /// calls to the collation creation functions or when the + /// [database connection] is closed using [sqlite3_close()]. + /// + /// ^The xDestroy callback is not called if the + /// sqlite3_create_collation_v2() function fails. Applications that invoke + /// sqlite3_create_collation_v2() with a non-NULL xDestroy argument should + /// check the return code and dispose of the application data pointer + /// themselves rather than expecting SQLite to deal with it for them. + /// This is different from every other SQLite interface. The inconsistency + /// is unfortunate but cannot be changed without breaking backwards + /// compatibility. + /// + /// See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()]. int sqlite3_create_collation( ffi.Pointer arg0, ffi.Pointer zName, @@ -2593,6 +5477,31 @@ class SQLite { _dart_sqlite3_create_collation16 _sqlite3_create_collation16; + /// CAPI3REF: Collation Needed Callbacks + /// METHOD: sqlite3 + /// + /// ^To avoid having to register all collation sequences before a database + /// can be used, a single callback function may be registered with the + /// [database connection] to be invoked whenever an undefined collation + /// sequence is required. + /// + /// ^If the function is registered using the sqlite3_collation_needed() API, + /// then it is passed the names of undefined collation sequences as strings + /// encoded in UTF-8. ^If sqlite3_collation_needed16() is used, + /// the names are passed as UTF-16 in machine native byte order. + /// ^A call to either function replaces the existing collation-needed callback. + /// + /// ^(When the callback is invoked, the first argument passed is a copy + /// of the second argument to sqlite3_collation_needed() or + /// sqlite3_collation_needed16(). The second argument is the database + /// connection. The third argument is one of [SQLITE_UTF8], [SQLITE_UTF16BE], + /// or [SQLITE_UTF16LE], indicating the most desirable form of the collation + /// sequence function required. The fourth parameter is the name of the + /// required collation sequence.)^ + /// + /// The callback function should register the desired collation using + /// [sqlite3_create_collation()], [sqlite3_create_collation16()], or + /// [sqlite3_create_collation_v2()]. int sqlite3_collation_needed( ffi.Pointer arg0, ffi.Pointer arg1, @@ -2627,6 +5536,21 @@ class SQLite { _dart_sqlite3_collation_needed16 _sqlite3_collation_needed16; + /// CAPI3REF: Suspend Execution For A Short Time + /// + /// The sqlite3_sleep() function causes the current thread to suspend execution + /// for at least a number of milliseconds specified in its parameter. + /// + /// If the operating system does not support sleep requests with + /// millisecond time resolution, then the time will be rounded up to + /// the nearest second. The number of milliseconds of sleep actually + /// requested from the operating system is returned. + /// + /// ^SQLite implements this interface by calling the xSleep() + /// method of the default [sqlite3_vfs] object. If the xSleep() method + /// of the default VFS is not implemented correctly, or not implemented at + /// all, then the behavior of sqlite3_sleep() may deviate from the description + /// in the previous paragraphs. int sqlite3_sleep( int arg0, ) { @@ -2639,6 +5563,23 @@ class SQLite { _dart_sqlite3_sleep _sqlite3_sleep; + /// CAPI3REF: Win32 Specific Interface + /// + /// These interfaces are available only on Windows. The + /// [sqlite3_win32_set_directory] interface is used to set the value associated + /// with the [sqlite3_temp_directory] or [sqlite3_data_directory] variable, to + /// zValue, depending on the value of the type parameter. The zValue parameter + /// should be NULL to cause the previous value to be freed via [sqlite3_free]; + /// a non-NULL value will be copied into memory obtained from [sqlite3_malloc] + /// prior to being used. The [sqlite3_win32_set_directory] interface returns + /// [SQLITE_OK] to indicate success, [SQLITE_ERROR] if the type is unsupported, + /// or [SQLITE_NOMEM] if memory could not be allocated. The value of the + /// [sqlite3_data_directory] variable is intended to act as a replacement for + /// the current directory on the sub-platforms of Win32 where that concept is + /// not present, e.g. WinRT and UWP. The [sqlite3_win32_set_directory8] and + /// [sqlite3_win32_set_directory16] interfaces behave exactly the same as the + /// sqlite3_win32_set_directory interface except the string parameter must be + /// UTF-8 or UTF-16, respectively. int sqlite3_win32_set_directory( int type, ffi.Pointer zValue, @@ -2684,6 +5625,26 @@ class SQLite { _dart_sqlite3_win32_set_directory16 _sqlite3_win32_set_directory16; + /// CAPI3REF: Test For Auto-Commit Mode + /// KEYWORDS: {autocommit mode} + /// METHOD: sqlite3 + /// + /// ^The sqlite3_get_autocommit() interface returns non-zero or + /// zero if the given database connection is or is not in autocommit mode, + /// respectively. ^Autocommit mode is on by default. + /// ^Autocommit mode is disabled by a [BEGIN] statement. + /// ^Autocommit mode is re-enabled by a [COMMIT] or [ROLLBACK]. + /// + /// If certain kinds of errors occur on a statement within a multi-statement + /// transaction (errors including [SQLITE_FULL], [SQLITE_IOERR], + /// [SQLITE_NOMEM], [SQLITE_BUSY], and [SQLITE_INTERRUPT]) then the + /// transaction might be rolled back automatically. The only way to + /// find out whether SQLite automatically rolled back the transaction after + /// an error is to use this function. + /// + /// If another thread changes the autocommit status of the database + /// connection while this routine is running, then the return value + /// is undefined. int sqlite3_get_autocommit( ffi.Pointer arg0, ) { @@ -2696,6 +5657,15 @@ class SQLite { _dart_sqlite3_get_autocommit _sqlite3_get_autocommit; + /// CAPI3REF: Find The Database Handle Of A Prepared Statement + /// METHOD: sqlite3_stmt + /// + /// ^The sqlite3_db_handle interface returns the [database connection] handle + /// to which a [prepared statement] belongs. ^The [database connection] + /// returned by sqlite3_db_handle is the same [database connection] + /// that was the first argument + /// to the [sqlite3_prepare_v2()] call (or its variants) that was used to + /// create the statement in the first place. ffi.Pointer sqlite3_db_handle( ffi.Pointer arg0, ) { @@ -2709,6 +5679,34 @@ class SQLite { _dart_sqlite3_db_handle _sqlite3_db_handle; + /// CAPI3REF: Return The Filename For A Database Connection + /// METHOD: sqlite3 + /// + /// ^The sqlite3_db_filename(D,N) interface returns a pointer to the filename + /// associated with database N of connection D. + /// ^If there is no attached database N on the database + /// connection D, or if database N is a temporary or in-memory database, then + /// this function will return either a NULL pointer or an empty string. + /// + /// ^The string value returned by this routine is owned and managed by + /// the database connection. ^The value will be valid until the database N + /// is [DETACH]-ed or until the database connection closes. + /// + /// ^The filename returned by this function is the output of the + /// xFullPathname method of the [VFS]. ^In other words, the filename + /// will be an absolute pathname, even if the filename used + /// to open the database originally was a URI or relative pathname. + /// + /// If the filename pointer returned by this routine is not NULL, then it + /// can be used as the filename input parameter to these routines: + ///
    + ///
  • [sqlite3_uri_parameter()] + ///
  • [sqlite3_uri_boolean()] + ///
  • [sqlite3_uri_int64()] + ///
  • [sqlite3_filename_database()] + ///
  • [sqlite3_filename_journal()] + ///
  • [sqlite3_filename_wal()] + ///
ffi.Pointer sqlite3_db_filename( ffi.Pointer db, ffi.Pointer zDbName, @@ -2723,6 +5721,12 @@ class SQLite { _dart_sqlite3_db_filename _sqlite3_db_filename; + /// CAPI3REF: Determine if a database is read-only + /// METHOD: sqlite3 + /// + /// ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N + /// of connection D is read-only, 0 if it is read/write, or -1 if N is not + /// the name of a database on connection D. int sqlite3_db_readonly( ffi.Pointer db, ffi.Pointer zDbName, @@ -2737,6 +5741,18 @@ class SQLite { _dart_sqlite3_db_readonly _sqlite3_db_readonly; + /// CAPI3REF: Find the next prepared statement + /// METHOD: sqlite3 + /// + /// ^This interface returns a pointer to the next [prepared statement] after + /// pStmt associated with the [database connection] pDb. ^If pStmt is NULL + /// then this interface returns a pointer to the first prepared statement + /// associated with the database connection pDb. ^If no prepared statement + /// satisfies the conditions of this routine, it returns NULL. + /// + /// The [database connection] pointer D in a call to + /// [sqlite3_next_stmt(D,S)] must refer to an open database + /// connection and in particular must not be a NULL pointer. ffi.Pointer sqlite3_next_stmt( ffi.Pointer pDb, ffi.Pointer pStmt, @@ -2752,6 +5768,51 @@ class SQLite { _dart_sqlite3_next_stmt _sqlite3_next_stmt; + /// CAPI3REF: Commit And Rollback Notification Callbacks + /// METHOD: sqlite3 + /// + /// ^The sqlite3_commit_hook() interface registers a callback + /// function to be invoked whenever a transaction is [COMMIT | committed]. + /// ^Any callback set by a previous call to sqlite3_commit_hook() + /// for the same database connection is overridden. + /// ^The sqlite3_rollback_hook() interface registers a callback + /// function to be invoked whenever a transaction is [ROLLBACK | rolled back]. + /// ^Any callback set by a previous call to sqlite3_rollback_hook() + /// for the same database connection is overridden. + /// ^The pArg argument is passed through to the callback. + /// ^If the callback on a commit hook function returns non-zero, + /// then the commit is converted into a rollback. + /// + /// ^The sqlite3_commit_hook(D,C,P) and sqlite3_rollback_hook(D,C,P) functions + /// return the P argument from the previous call of the same function + /// on the same [database connection] D, or NULL for + /// the first call for each function on D. + /// + /// The commit and rollback hook callbacks are not reentrant. + /// The callback implementation must not do anything that will modify + /// the database connection that invoked the callback. Any actions + /// to modify the database connection must be deferred until after the + /// completion of the [sqlite3_step()] call that triggered the commit + /// or rollback hook in the first place. + /// Note that running any other SQL statements, including SELECT statements, + /// or merely calling [sqlite3_prepare_v2()] and [sqlite3_step()] will modify + /// the database connections for the meaning of "modify" in this paragraph. + /// + /// ^Registering a NULL function disables the callback. + /// + /// ^When the commit hook callback routine returns zero, the [COMMIT] + /// operation is allowed to continue normally. ^If the commit hook + /// returns non-zero, then the [COMMIT] is converted into a [ROLLBACK]. + /// ^The rollback hook is invoked on a rollback that results from a commit + /// hook returning non-zero, just as it would be with any other rollback. + /// + /// ^For the purposes of this API, a transaction is said to have been + /// rolled back if an explicit "ROLLBACK" statement is executed, or + /// an error or constraint causes an implicit rollback to occur. + /// ^The rollback callback is not invoked if a transaction is + /// automatically rolled back because the database connection is closed. + /// + /// See also the [sqlite3_update_hook()] interface. ffi.Pointer sqlite3_commit_hook( ffi.Pointer arg0, ffi.Pointer> arg1, @@ -2784,6 +5845,53 @@ class SQLite { _dart_sqlite3_rollback_hook _sqlite3_rollback_hook; + /// CAPI3REF: Data Change Notification Callbacks + /// METHOD: sqlite3 + /// + /// ^The sqlite3_update_hook() interface registers a callback function + /// with the [database connection] identified by the first argument + /// to be invoked whenever a row is updated, inserted or deleted in + /// a [rowid table]. + /// ^Any callback set by a previous call to this function + /// for the same database connection is overridden. + /// + /// ^The second argument is a pointer to the function to invoke when a + /// row is updated, inserted or deleted in a rowid table. + /// ^The first argument to the callback is a copy of the third argument + /// to sqlite3_update_hook(). + /// ^The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE], + /// or [SQLITE_UPDATE], depending on the operation that caused the callback + /// to be invoked. + /// ^The third and fourth arguments to the callback contain pointers to the + /// database and table name containing the affected row. + /// ^The final callback parameter is the [rowid] of the row. + /// ^In the case of an update, this is the [rowid] after the update takes place. + /// + /// ^(The update hook is not invoked when internal system tables are + /// modified (i.e. sqlite_master and sqlite_sequence).)^ + /// ^The update hook is not invoked when [WITHOUT ROWID] tables are modified. + /// + /// ^In the current implementation, the update hook + /// is not invoked when conflicting rows are deleted because of an + /// [ON CONFLICT | ON CONFLICT REPLACE] clause. ^Nor is the update hook + /// invoked when rows are deleted using the [truncate optimization]. + /// The exceptions defined in this paragraph might change in a future + /// release of SQLite. + /// + /// The update hook implementation must not do anything that will modify + /// the database connection that invoked the update hook. Any actions + /// to modify the database connection must be deferred until after the + /// completion of the [sqlite3_step()] call that triggered the update hook. + /// Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their + /// database connections for the meaning of "modify" in this paragraph. + /// + /// ^The sqlite3_update_hook(D,C,P) function + /// returns the P argument from the previous call + /// on the same [database connection] D, or NULL for + /// the first call on D. + /// + /// See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()], + /// and [sqlite3_preupdate_hook()] interfaces. ffi.Pointer sqlite3_update_hook( ffi.Pointer arg0, ffi.Pointer> arg1, @@ -2800,6 +5908,43 @@ class SQLite { _dart_sqlite3_update_hook _sqlite3_update_hook; + /// CAPI3REF: Enable Or Disable Shared Pager Cache + /// + /// ^(This routine enables or disables the sharing of the database cache + /// and schema data structures between [database connection | connections] + /// to the same database. Sharing is enabled if the argument is true + /// and disabled if the argument is false.)^ + /// + /// ^Cache sharing is enabled and disabled for an entire process. + /// This is a change as of SQLite [version 3.5.0] ([dateof:3.5.0]). + /// In prior versions of SQLite, + /// sharing was enabled or disabled for each thread separately. + /// + /// ^(The cache sharing mode set by this interface effects all subsequent + /// calls to [sqlite3_open()], [sqlite3_open_v2()], and [sqlite3_open16()]. + /// Existing database connections continue to use the sharing mode + /// that was in effect at the time they were opened.)^ + /// + /// ^(This routine returns [SQLITE_OK] if shared cache was enabled or disabled + /// successfully. An [error code] is returned otherwise.)^ + /// + /// ^Shared cache is disabled by default. It is recommended that it stay + /// that way. In other words, do not use this routine. This interface + /// continues to be provided for historical compatibility, but its use is + /// discouraged. Any use of shared cache is discouraged. If shared cache + /// must be used, it is recommended that shared cache only be enabled for + /// individual database connections using the [sqlite3_open_v2()] interface + /// with the [SQLITE_OPEN_SHAREDCACHE] flag. + /// + /// Note: This method is disabled on MacOS X 10.7 and iOS version 5.0 + /// and will always return SQLITE_MISUSE. On those systems, + /// shared cache mode should be enabled per-database connection via + /// [sqlite3_open_v2()] with [SQLITE_OPEN_SHAREDCACHE]. + /// + /// This interface is threadsafe on processors where writing a + /// 32-bit integer is atomic. + /// + /// See Also: [SQLite Shared-Cache Mode] int sqlite3_enable_shared_cache( int arg0, ) { @@ -2813,6 +5958,18 @@ class SQLite { _dart_sqlite3_enable_shared_cache _sqlite3_enable_shared_cache; + /// CAPI3REF: Attempt To Free Heap Memory + /// + /// ^The sqlite3_release_memory() interface attempts to free N bytes + /// of heap memory by deallocating non-essential memory allocations + /// held by the database library. Memory used to cache database + /// pages to improve performance is an example of non-essential memory. + /// ^sqlite3_release_memory() returns the number of bytes actually freed, + /// which might be more or less than the amount requested. + /// ^The sqlite3_release_memory() routine is a no-op returning zero + /// if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT]. + /// + /// See also: [sqlite3_db_release_memory()] int sqlite3_release_memory( int arg0, ) { @@ -2825,6 +5982,16 @@ class SQLite { _dart_sqlite3_release_memory _sqlite3_release_memory; + /// CAPI3REF: Free Memory Used By A Database Connection + /// METHOD: sqlite3 + /// + /// ^The sqlite3_db_release_memory(D) interface attempts to free as much heap + /// memory as possible from database connection D. Unlike the + /// [sqlite3_release_memory()] interface, this interface is in effect even + /// when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is + /// omitted. + /// + /// See also: [sqlite3_release_memory()] int sqlite3_db_release_memory( ffi.Pointer arg0, ) { @@ -2838,6 +6005,68 @@ class SQLite { _dart_sqlite3_db_release_memory _sqlite3_db_release_memory; + /// CAPI3REF: Impose A Limit On Heap Size + /// + /// These interfaces impose limits on the amount of heap memory that will be + /// by all database connections within a single process. + /// + /// ^The sqlite3_soft_heap_limit64() interface sets and/or queries the + /// soft limit on the amount of heap memory that may be allocated by SQLite. + /// ^SQLite strives to keep heap memory utilization below the soft heap + /// limit by reducing the number of pages held in the page cache + /// as heap memory usages approaches the limit. + /// ^The soft heap limit is "soft" because even though SQLite strives to stay + /// below the limit, it will exceed the limit rather than generate + /// an [SQLITE_NOMEM] error. In other words, the soft heap limit + /// is advisory only. + /// + /// ^The sqlite3_hard_heap_limit64(N) interface sets a hard upper bound of + /// N bytes on the amount of memory that will be allocated. ^The + /// sqlite3_hard_heap_limit64(N) interface is similar to + /// sqlite3_soft_heap_limit64(N) except that memory allocations will fail + /// when the hard heap limit is reached. + /// + /// ^The return value from both sqlite3_soft_heap_limit64() and + /// sqlite3_hard_heap_limit64() is the size of + /// the heap limit prior to the call, or negative in the case of an + /// error. ^If the argument N is negative + /// then no change is made to the heap limit. Hence, the current + /// size of heap limits can be determined by invoking + /// sqlite3_soft_heap_limit64(-1) or sqlite3_hard_heap_limit(-1). + /// + /// ^Setting the heap limits to zero disables the heap limiter mechanism. + /// + /// ^The soft heap limit may not be greater than the hard heap limit. + /// ^If the hard heap limit is enabled and if sqlite3_soft_heap_limit(N) + /// is invoked with a value of N that is greater than the hard heap limit, + /// the the soft heap limit is set to the value of the hard heap limit. + /// ^The soft heap limit is automatically enabled whenever the hard heap + /// limit is enabled. ^When sqlite3_hard_heap_limit64(N) is invoked and + /// the soft heap limit is outside the range of 1..N, then the soft heap + /// limit is set to N. ^Invoking sqlite3_soft_heap_limit64(0) when the + /// hard heap limit is enabled makes the soft heap limit equal to the + /// hard heap limit. + /// + /// The memory allocation limits can also be adjusted using + /// [PRAGMA soft_heap_limit] and [PRAGMA hard_heap_limit]. + /// + /// ^(The heap limits are not enforced in the current implementation + /// if one or more of following conditions are true: + /// + ///
    + ///
  • The limit value is set to zero. + ///
  • Memory accounting is disabled using a combination of the + /// [sqlite3_config]([SQLITE_CONFIG_MEMSTATUS],...) start-time option and + /// the [SQLITE_DEFAULT_MEMSTATUS] compile-time option. + ///
  • An alternative page cache implementation is specified using + /// [sqlite3_config]([SQLITE_CONFIG_PCACHE2],...). + ///
  • The page cache allocates from its own memory pool supplied + /// by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than + /// from the heap. + ///
)^ + /// + /// The circumstances under which SQLite will enforce the heap limits may + /// changes in future releases of SQLite. int sqlite3_soft_heap_limit64( int N, ) { @@ -2864,6 +6093,13 @@ class SQLite { _dart_sqlite3_hard_heap_limit64 _sqlite3_hard_heap_limit64; + /// CAPI3REF: Deprecated Soft Heap Limit Interface + /// DEPRECATED + /// + /// This is a deprecated version of the [sqlite3_soft_heap_limit64()] + /// interface. This routine is provided for historical compatibility + /// only. All new applications should use the + /// [sqlite3_soft_heap_limit64()] interface rather than this one. void sqlite3_soft_heap_limit( int N, ) { @@ -2877,6 +6113,73 @@ class SQLite { _dart_sqlite3_soft_heap_limit _sqlite3_soft_heap_limit; + /// CAPI3REF: Extract Metadata About A Column Of A Table + /// METHOD: sqlite3 + /// + /// ^(The sqlite3_table_column_metadata(X,D,T,C,....) routine returns + /// information about column C of table T in database D + /// on [database connection] X.)^ ^The sqlite3_table_column_metadata() + /// interface returns SQLITE_OK and fills in the non-NULL pointers in + /// the final five arguments with appropriate values if the specified + /// column exists. ^The sqlite3_table_column_metadata() interface returns + /// SQLITE_ERROR if the specified column does not exist. + /// ^If the column-name parameter to sqlite3_table_column_metadata() is a + /// NULL pointer, then this routine simply checks for the existence of the + /// table and returns SQLITE_OK if the table exists and SQLITE_ERROR if it + /// does not. If the table name parameter T in a call to + /// sqlite3_table_column_metadata(X,D,T,C,...) is NULL then the result is + /// undefined behavior. + /// + /// ^The column is identified by the second, third and fourth parameters to + /// this function. ^(The second parameter is either the name of the database + /// (i.e. "main", "temp", or an attached database) containing the specified + /// table or NULL.)^ ^If it is NULL, then all attached databases are searched + /// for the table using the same algorithm used by the database engine to + /// resolve unqualified table references. + /// + /// ^The third and fourth parameters to this function are the table and column + /// name of the desired column, respectively. + /// + /// ^Metadata is returned by writing to the memory locations passed as the 5th + /// and subsequent parameters to this function. ^Any of these arguments may be + /// NULL, in which case the corresponding element of metadata is omitted. + /// + /// ^(
+ /// + ///
Parameter Output
Type
Description + /// + ///
5th const char* Data type + ///
6th const char* Name of default collation sequence + ///
7th int True if column has a NOT NULL constraint + ///
8th int True if column is part of the PRIMARY KEY + ///
9th int True if column is [AUTOINCREMENT] + ///
+ ///
)^ + /// + /// ^The memory pointed to by the character pointers returned for the + /// declaration type and collation sequence is valid until the next + /// call to any SQLite API function. + /// + /// ^If the specified table is actually a view, an [error code] is returned. + /// + /// ^If the specified column is "rowid", "oid" or "_rowid_" and the table + /// is not a [WITHOUT ROWID] table and an + /// [INTEGER PRIMARY KEY] column has been explicitly declared, then the output + /// parameters are set for the explicitly declared column. ^(If there is no + /// [INTEGER PRIMARY KEY] column, then the outputs + /// for the [rowid] are set as follows: + /// + ///
+  /// data type: "INTEGER"
+  /// collation sequence: "BINARY"
+  /// not null: 0
+  /// primary key: 1
+  /// auto increment: 0
+  /// 
)^ + /// + /// ^This function causes all database schemas to be read from disk and + /// parsed, if that has not already been done, and returns an error if + /// any errors are encountered while loading the schema. int sqlite3_table_column_metadata( ffi.Pointer db, ffi.Pointer zDbName, @@ -2906,6 +6209,48 @@ class SQLite { _dart_sqlite3_table_column_metadata _sqlite3_table_column_metadata; + /// CAPI3REF: Load An Extension + /// METHOD: sqlite3 + /// + /// ^This interface loads an SQLite extension library from the named file. + /// + /// ^The sqlite3_load_extension() interface attempts to load an + /// [SQLite extension] library contained in the file zFile. If + /// the file cannot be loaded directly, attempts are made to load + /// with various operating-system specific extensions added. + /// So for example, if "samplelib" cannot be loaded, then names like + /// "samplelib.so" or "samplelib.dylib" or "samplelib.dll" might + /// be tried also. + /// + /// ^The entry point is zProc. + /// ^(zProc may be 0, in which case SQLite will try to come up with an + /// entry point name on its own. It first tries "sqlite3_extension_init". + /// If that does not work, it constructs a name "sqlite3_X_init" where the + /// X is consists of the lower-case equivalent of all ASCII alphabetic + /// characters in the filename from the last "/" to the first following + /// "." and omitting any initial "lib".)^ + /// ^The sqlite3_load_extension() interface returns + /// [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong. + /// ^If an error occurs and pzErrMsg is not 0, then the + /// [sqlite3_load_extension()] interface shall attempt to + /// fill *pzErrMsg with error message text stored in memory + /// obtained from [sqlite3_malloc()]. The calling function + /// should free this memory by calling [sqlite3_free()]. + /// + /// ^Extension loading must be enabled using + /// [sqlite3_enable_load_extension()] or + /// [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],1,NULL) + /// prior to calling this API, + /// otherwise an error will be returned. + /// + /// Security warning: It is recommended that the + /// [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method be used to enable only this + /// interface. The use of the [sqlite3_enable_load_extension()] interface + /// should be avoided. This will keep the SQL function [load_extension()] + /// disabled and prevent SQL injections from giving attackers + /// access to extension loading capabilities. + /// + /// See also the [load_extension() SQL function]. int sqlite3_load_extension( ffi.Pointer db, ffi.Pointer zFile, @@ -2924,6 +6269,29 @@ class SQLite { _dart_sqlite3_load_extension _sqlite3_load_extension; + /// CAPI3REF: Enable Or Disable Extension Loading + /// METHOD: sqlite3 + /// + /// ^So as not to open security holes in older applications that are + /// unprepared to deal with [extension loading], and as a means of disabling + /// [extension loading] while evaluating user-entered SQL, the following API + /// is provided to turn the [sqlite3_load_extension()] mechanism on and off. + /// + /// ^Extension loading is off by default. + /// ^Call the sqlite3_enable_load_extension() routine with onoff==1 + /// to turn extension loading on and call it with onoff==0 to turn + /// it back off again. + /// + /// ^This interface enables or disables both the C-API + /// [sqlite3_load_extension()] and the SQL function [load_extension()]. + /// ^(Use [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],..) + /// to enable or disable only the C-API.)^ + /// + /// Security warning: It is recommended that extension loading + /// be enabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method + /// rather than this interface, so the [load_extension()] SQL function + /// remains disabled. This will prevent SQL injections from giving attackers + /// access to extension loading capabilities. int sqlite3_enable_load_extension( ffi.Pointer db, int onoff, @@ -2939,6 +6307,40 @@ class SQLite { _dart_sqlite3_enable_load_extension _sqlite3_enable_load_extension; + /// CAPI3REF: Automatically Load Statically Linked Extensions + /// + /// ^This interface causes the xEntryPoint() function to be invoked for + /// each new [database connection] that is created. The idea here is that + /// xEntryPoint() is the entry point for a statically linked [SQLite extension] + /// that is to be automatically loaded into all new database connections. + /// + /// ^(Even though the function prototype shows that xEntryPoint() takes + /// no arguments and returns void, SQLite invokes xEntryPoint() with three + /// arguments and expects an integer result as if the signature of the + /// entry point where as follows: + /// + ///
+  ///    int xEntryPoint(
+  ///      sqlite3 *db,
+  ///      const char **pzErrMsg,
+  ///      const struct sqlite3_api_routines *pThunk
+  ///    );
+  /// 
)^ + /// + /// If the xEntryPoint routine encounters an error, it should make *pzErrMsg + /// point to an appropriate error message (obtained from [sqlite3_mprintf()]) + /// and return an appropriate [error code]. ^SQLite ensures that *pzErrMsg + /// is NULL before calling the xEntryPoint(). ^SQLite will invoke + /// [sqlite3_free()] on *pzErrMsg after xEntryPoint() returns. ^If any + /// xEntryPoint() returns an error, the [sqlite3_open()], [sqlite3_open16()], + /// or [sqlite3_open_v2()] call that provoked the xEntryPoint() will fail. + /// + /// ^Calling sqlite3_auto_extension(X) with an entry point X that is already + /// on the list of automatic extensions is a harmless no-op. ^No entry point + /// will be called more than once for each database connection that is opened. + /// + /// See also: [sqlite3_reset_auto_extension()] + /// and [sqlite3_cancel_auto_extension()] int sqlite3_auto_extension( ffi.Pointer> xEntryPoint, ) { @@ -2951,6 +6353,14 @@ class SQLite { _dart_sqlite3_auto_extension _sqlite3_auto_extension; + /// CAPI3REF: Cancel Automatic Extension Loading + /// + /// ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the + /// initialization routine X that was registered using a prior call to + /// [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)] + /// routine returns 1 if initialization routine X was successfully + /// unregistered and it returns 0 if X was not on the list of initialization + /// routines. int sqlite3_cancel_auto_extension( ffi.Pointer> xEntryPoint, ) { @@ -2964,6 +6374,10 @@ class SQLite { _dart_sqlite3_cancel_auto_extension _sqlite3_cancel_auto_extension; + /// CAPI3REF: Reset Automatic Extension Loading + /// + /// ^This interface disables all automatic extensions previously + /// registered using [sqlite3_auto_extension()]. void sqlite3_reset_auto_extension() { _sqlite3_reset_auto_extension ??= _dylib.lookupFunction< _c_sqlite3_reset_auto_extension, @@ -2973,6 +6387,36 @@ class SQLite { _dart_sqlite3_reset_auto_extension _sqlite3_reset_auto_extension; + /// CAPI3REF: Register A Virtual Table Implementation + /// METHOD: sqlite3 + /// + /// ^These routines are used to register a new [virtual table module] name. + /// ^Module names must be registered before + /// creating a new [virtual table] using the module and before using a + /// preexisting [virtual table] for the module. + /// + /// ^The module name is registered on the [database connection] specified + /// by the first parameter. ^The name of the module is given by the + /// second parameter. ^The third parameter is a pointer to + /// the implementation of the [virtual table module]. ^The fourth + /// parameter is an arbitrary client data pointer that is passed through + /// into the [xCreate] and [xConnect] methods of the virtual table module + /// when a new virtual table is be being created or reinitialized. + /// + /// ^The sqlite3_create_module_v2() interface has a fifth parameter which + /// is a pointer to a destructor for the pClientData. ^SQLite will + /// invoke the destructor function (if it is not NULL) when SQLite + /// no longer needs the pClientData pointer. ^The destructor will also + /// be invoked if the call to sqlite3_create_module_v2() fails. + /// ^The sqlite3_create_module() + /// interface is equivalent to sqlite3_create_module_v2() with a NULL + /// destructor. + /// + /// ^If the third parameter (the pointer to the sqlite3_module object) is + /// NULL then no new module is create and any existing modules with the + /// same name are dropped. + /// + /// See also: [sqlite3_drop_modules()] int sqlite3_create_module( ffi.Pointer db, ffi.Pointer zName, @@ -3012,6 +6456,16 @@ class SQLite { _dart_sqlite3_create_module_v2 _sqlite3_create_module_v2; + /// CAPI3REF: Remove Unnecessary Virtual Table Implementations + /// METHOD: sqlite3 + /// + /// ^The sqlite3_drop_modules(D,L) interface removes all virtual + /// table modules from database connection D except those named on list L. + /// The L parameter must be either NULL or a pointer to an array of pointers + /// to strings where the array is terminated by a single NULL pointer. + /// ^If the L parameter is NULL, then all virtual table modules are removed. + /// + /// See also: [sqlite3_create_module()] int sqlite3_drop_modules( ffi.Pointer db, ffi.Pointer> azKeep, @@ -3026,6 +6480,12 @@ class SQLite { _dart_sqlite3_drop_modules _sqlite3_drop_modules; + /// CAPI3REF: Declare The Schema Of A Virtual Table + /// + /// ^The [xCreate] and [xConnect] methods of a + /// [virtual table module] call this interface + /// to declare the format (the names and datatypes of the columns) of + /// the virtual tables they implement. int sqlite3_declare_vtab( ffi.Pointer arg0, ffi.Pointer zSQL, @@ -3040,6 +6500,21 @@ class SQLite { _dart_sqlite3_declare_vtab _sqlite3_declare_vtab; + /// CAPI3REF: Overload A Function For A Virtual Table + /// METHOD: sqlite3 + /// + /// ^(Virtual tables can provide alternative implementations of functions + /// using the [xFindFunction] method of the [virtual table module]. + /// But global versions of those functions + /// must exist in order to be overloaded.)^ + /// + /// ^(This API makes sure a global version of a function with a particular + /// name and number of parameters exists. If no such function exists + /// before this API is called, a new function is created.)^ ^The implementation + /// of the new function always causes an exception to be thrown. So + /// the new function is not good for anything by itself. Its only + /// purpose is to be a placeholder function that can be overloaded + /// by a [virtual table]. int sqlite3_overload_function( ffi.Pointer arg0, ffi.Pointer zFuncName, @@ -3057,6 +6532,87 @@ class SQLite { _dart_sqlite3_overload_function _sqlite3_overload_function; + /// CAPI3REF: Open A BLOB For Incremental I/O + /// METHOD: sqlite3 + /// CONSTRUCTOR: sqlite3_blob + /// + /// ^(This interfaces opens a [BLOB handle | handle] to the BLOB located + /// in row iRow, column zColumn, table zTable in database zDb; + /// in other words, the same BLOB that would be selected by: + /// + ///
+  /// SELECT zColumn FROM zDb.zTable WHERE [rowid] = iRow;
+  /// 
)^ + /// + /// ^(Parameter zDb is not the filename that contains the database, but + /// rather the symbolic name of the database. For attached databases, this is + /// the name that appears after the AS keyword in the [ATTACH] statement. + /// For the main database file, the database name is "main". For TEMP + /// tables, the database name is "temp".)^ + /// + /// ^If the flags parameter is non-zero, then the BLOB is opened for read + /// and write access. ^If the flags parameter is zero, the BLOB is opened for + /// read-only access. + /// + /// ^(On success, [SQLITE_OK] is returned and the new [BLOB handle] is stored + /// in *ppBlob. Otherwise an [error code] is returned and, unless the error + /// code is SQLITE_MISUSE, *ppBlob is set to NULL.)^ ^This means that, provided + /// the API is not misused, it is always safe to call [sqlite3_blob_close()] + /// on *ppBlob after this function it returns. + /// + /// This function fails with SQLITE_ERROR if any of the following are true: + ///
    + ///
  • ^(Database zDb does not exist)^, + ///
  • ^(Table zTable does not exist within database zDb)^, + ///
  • ^(Table zTable is a WITHOUT ROWID table)^, + ///
  • ^(Column zColumn does not exist)^, + ///
  • ^(Row iRow is not present in the table)^, + ///
  • ^(The specified column of row iRow contains a value that is not + /// a TEXT or BLOB value)^, + ///
  • ^(Column zColumn is part of an index, PRIMARY KEY or UNIQUE + /// constraint and the blob is being opened for read/write access)^, + ///
  • ^([foreign key constraints | Foreign key constraints] are enabled, + /// column zColumn is part of a [child key] definition and the blob is + /// being opened for read/write access)^. + ///
+ /// + /// ^Unless it returns SQLITE_MISUSE, this function sets the + /// [database connection] error code and message accessible via + /// [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. + /// + /// A BLOB referenced by sqlite3_blob_open() may be read using the + /// [sqlite3_blob_read()] interface and modified by using + /// [sqlite3_blob_write()]. The [BLOB handle] can be moved to a + /// different row of the same table using the [sqlite3_blob_reopen()] + /// interface. However, the column, table, or database of a [BLOB handle] + /// cannot be changed after the [BLOB handle] is opened. + /// + /// ^(If the row that a BLOB handle points to is modified by an + /// [UPDATE], [DELETE], or by [ON CONFLICT] side-effects + /// then the BLOB handle is marked as "expired". + /// This is true if any column of the row is changed, even a column + /// other than the one the BLOB handle is open on.)^ + /// ^Calls to [sqlite3_blob_read()] and [sqlite3_blob_write()] for + /// an expired BLOB handle fail with a return code of [SQLITE_ABORT]. + /// ^(Changes written into a BLOB prior to the BLOB expiring are not + /// rolled back by the expiration of the BLOB. Such changes will eventually + /// commit if the transaction continues to completion.)^ + /// + /// ^Use the [sqlite3_blob_bytes()] interface to determine the size of + /// the opened blob. ^The size of a blob may not be changed by this + /// interface. Use the [UPDATE] SQL command to change the size of a + /// blob. + /// + /// ^The [sqlite3_bind_zeroblob()] and [sqlite3_result_zeroblob()] interfaces + /// and the built-in [zeroblob] SQL function may be used to create a + /// zero-filled blob to read or write using the incremental-blob interface. + /// + /// To avoid a resource leak, every open [BLOB handle] should eventually + /// be released by a call to [sqlite3_blob_close()]. + /// + /// See also: [sqlite3_blob_close()], + /// [sqlite3_blob_reopen()], [sqlite3_blob_read()], + /// [sqlite3_blob_bytes()], [sqlite3_blob_write()]. int sqlite3_blob_open( ffi.Pointer arg0, ffi.Pointer zDb, @@ -3082,6 +6638,27 @@ class SQLite { _dart_sqlite3_blob_open _sqlite3_blob_open; + /// CAPI3REF: Move a BLOB Handle to a New Row + /// METHOD: sqlite3_blob + /// + /// ^This function is used to move an existing [BLOB handle] so that it points + /// to a different row of the same database table. ^The new row is identified + /// by the rowid value passed as the second argument. Only the row can be + /// changed. ^The database, table and column on which the blob handle is open + /// remain the same. Moving an existing [BLOB handle] to a new row is + /// faster than closing the existing handle and opening a new one. + /// + /// ^(The new row must meet the same criteria as for [sqlite3_blob_open()] - + /// it must exist and there must be either a blob or text value stored in + /// the nominated column.)^ ^If the new row is not present in the table, or if + /// it does not contain a blob or text value, or if another error occurs, an + /// SQLite error code is returned and the blob handle is considered aborted. + /// ^All subsequent calls to [sqlite3_blob_read()], [sqlite3_blob_write()] or + /// [sqlite3_blob_reopen()] on an aborted blob handle immediately return + /// SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle + /// always returns zero. + /// + /// ^This function sets the database handle error code and message. int sqlite3_blob_reopen( ffi.Pointer arg0, int arg1, @@ -3096,6 +6673,25 @@ class SQLite { _dart_sqlite3_blob_reopen _sqlite3_blob_reopen; + /// CAPI3REF: Close A BLOB Handle + /// DESTRUCTOR: sqlite3_blob + /// + /// ^This function closes an open [BLOB handle]. ^(The BLOB handle is closed + /// unconditionally. Even if this routine returns an error code, the + /// handle is still closed.)^ + /// + /// ^If the blob handle being closed was opened for read-write access, and if + /// the database is in auto-commit mode and there are no other open read-write + /// blob handles or active write statements, the current transaction is + /// committed. ^If an error occurs while committing the transaction, an error + /// code is returned and the transaction rolled back. + /// + /// Calling this function with an argument that is not a NULL pointer or an + /// open blob handle results in undefined behaviour. ^Calling this routine + /// with a null pointer (such as would be returned by a failed call to + /// [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function + /// is passed a valid open blob handle, the values returned by the + /// sqlite3_errcode() and sqlite3_errmsg() functions are set before returning. int sqlite3_blob_close( ffi.Pointer arg0, ) { @@ -3109,6 +6705,18 @@ class SQLite { _dart_sqlite3_blob_close _sqlite3_blob_close; + /// CAPI3REF: Return The Size Of An Open BLOB + /// METHOD: sqlite3_blob + /// + /// ^Returns the size in bytes of the BLOB accessible via the + /// successfully opened [BLOB handle] in its only argument. ^The + /// incremental blob I/O routines can only read or overwriting existing + /// blob content; they cannot change the size of a blob. + /// + /// This routine only works on a [BLOB handle] which has been created + /// by a prior successful call to [sqlite3_blob_open()] and which has not + /// been closed by [sqlite3_blob_close()]. Passing any other pointer in + /// to this routine results in undefined and probably undesirable behavior. int sqlite3_blob_bytes( ffi.Pointer arg0, ) { @@ -3122,6 +6730,31 @@ class SQLite { _dart_sqlite3_blob_bytes _sqlite3_blob_bytes; + /// CAPI3REF: Read Data From A BLOB Incrementally + /// METHOD: sqlite3_blob + /// + /// ^(This function is used to read data from an open [BLOB handle] into a + /// caller-supplied buffer. N bytes of data are copied into buffer Z + /// from the open BLOB, starting at offset iOffset.)^ + /// + /// ^If offset iOffset is less than N bytes from the end of the BLOB, + /// [SQLITE_ERROR] is returned and no data is read. ^If N or iOffset is + /// less than zero, [SQLITE_ERROR] is returned and no data is read. + /// ^The size of the blob (and hence the maximum value of N+iOffset) + /// can be determined using the [sqlite3_blob_bytes()] interface. + /// + /// ^An attempt to read from an expired [BLOB handle] fails with an + /// error code of [SQLITE_ABORT]. + /// + /// ^(On success, sqlite3_blob_read() returns SQLITE_OK. + /// Otherwise, an [error code] or an [extended error code] is returned.)^ + /// + /// This routine only works on a [BLOB handle] which has been created + /// by a prior successful call to [sqlite3_blob_open()] and which has not + /// been closed by [sqlite3_blob_close()]. Passing any other pointer in + /// to this routine results in undefined and probably undesirable behavior. + /// + /// See also: [sqlite3_blob_write()]. int sqlite3_blob_read( ffi.Pointer arg0, ffi.Pointer Z, @@ -3141,6 +6774,44 @@ class SQLite { _dart_sqlite3_blob_read _sqlite3_blob_read; + /// CAPI3REF: Write Data Into A BLOB Incrementally + /// METHOD: sqlite3_blob + /// + /// ^(This function is used to write data into an open [BLOB handle] from a + /// caller-supplied buffer. N bytes of data are copied from the buffer Z + /// into the open BLOB, starting at offset iOffset.)^ + /// + /// ^(On success, sqlite3_blob_write() returns SQLITE_OK. + /// Otherwise, an [error code] or an [extended error code] is returned.)^ + /// ^Unless SQLITE_MISUSE is returned, this function sets the + /// [database connection] error code and message accessible via + /// [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. + /// + /// ^If the [BLOB handle] passed as the first argument was not opened for + /// writing (the flags parameter to [sqlite3_blob_open()] was zero), + /// this function returns [SQLITE_READONLY]. + /// + /// This function may only modify the contents of the BLOB; it is + /// not possible to increase the size of a BLOB using this API. + /// ^If offset iOffset is less than N bytes from the end of the BLOB, + /// [SQLITE_ERROR] is returned and no data is written. The size of the + /// BLOB (and hence the maximum value of N+iOffset) can be determined + /// using the [sqlite3_blob_bytes()] interface. ^If N or iOffset are less + /// than zero [SQLITE_ERROR] is returned and no data is written. + /// + /// ^An attempt to write to an expired [BLOB handle] fails with an + /// error code of [SQLITE_ABORT]. ^Writes to the BLOB that occurred + /// before the [BLOB handle] expired are not rolled back by the + /// expiration of the handle, though of course those changes might + /// have been overwritten by the statement that expired the BLOB handle + /// or by other independent statements. + /// + /// This routine only works on a [BLOB handle] which has been created + /// by a prior successful call to [sqlite3_blob_open()] and which has not + /// been closed by [sqlite3_blob_close()]. Passing any other pointer in + /// to this routine results in undefined and probably undesirable behavior. + /// + /// See also: [sqlite3_blob_read()]. int sqlite3_blob_write( ffi.Pointer arg0, ffi.Pointer z, @@ -3160,6 +6831,33 @@ class SQLite { _dart_sqlite3_blob_write _sqlite3_blob_write; + /// CAPI3REF: Virtual File System Objects + /// + /// A virtual filesystem (VFS) is an [sqlite3_vfs] object + /// that SQLite uses to interact + /// with the underlying operating system. Most SQLite builds come with a + /// single default VFS that is appropriate for the host computer. + /// New VFSes can be registered and existing VFSes can be unregistered. + /// The following interfaces are provided. + /// + /// ^The sqlite3_vfs_find() interface returns a pointer to a VFS given its name. + /// ^Names are case sensitive. + /// ^Names are zero-terminated UTF-8 strings. + /// ^If there is no match, a NULL pointer is returned. + /// ^If zVfsName is NULL then the default VFS is returned. + /// + /// ^New VFSes are registered with sqlite3_vfs_register(). + /// ^Each new VFS becomes the default VFS if the makeDflt flag is set. + /// ^The same VFS can be registered multiple times without injury. + /// ^To make an existing VFS into the default VFS, register it again + /// with the makeDflt flag set. If two different VFSes with the + /// same name are registered, the behavior is undefined. If a + /// VFS is registered with a name that is NULL or an empty string, + /// then the behavior is undefined. + /// + /// ^Unregister a VFS with the sqlite3_vfs_unregister() interface. + /// ^(If the default VFS is unregistered, another VFS is chosen as + /// the default. The choice for the new VFS is arbitrary.)^ ffi.Pointer sqlite3_vfs_find( ffi.Pointer zVfsName, ) { @@ -3199,6 +6897,118 @@ class SQLite { _dart_sqlite3_vfs_unregister _sqlite3_vfs_unregister; + /// CAPI3REF: Mutexes + /// + /// The SQLite core uses these routines for thread + /// synchronization. Though they are intended for internal + /// use by SQLite, code that links against SQLite is + /// permitted to use any of these routines. + /// + /// The SQLite source code contains multiple implementations + /// of these mutex routines. An appropriate implementation + /// is selected automatically at compile-time. The following + /// implementations are available in the SQLite core: + /// + ///
    + ///
  • SQLITE_MUTEX_PTHREADS + ///
  • SQLITE_MUTEX_W32 + ///
  • SQLITE_MUTEX_NOOP + ///
+ /// + /// The SQLITE_MUTEX_NOOP implementation is a set of routines + /// that does no real locking and is appropriate for use in + /// a single-threaded application. The SQLITE_MUTEX_PTHREADS and + /// SQLITE_MUTEX_W32 implementations are appropriate for use on Unix + /// and Windows. + /// + /// If SQLite is compiled with the SQLITE_MUTEX_APPDEF preprocessor + /// macro defined (with "-DSQLITE_MUTEX_APPDEF=1"), then no mutex + /// implementation is included with the library. In this case the + /// application must supply a custom mutex implementation using the + /// [SQLITE_CONFIG_MUTEX] option of the sqlite3_config() function + /// before calling sqlite3_initialize() or any other public sqlite3_ + /// function that calls sqlite3_initialize(). + /// + /// ^The sqlite3_mutex_alloc() routine allocates a new + /// mutex and returns a pointer to it. ^The sqlite3_mutex_alloc() + /// routine returns NULL if it is unable to allocate the requested + /// mutex. The argument to sqlite3_mutex_alloc() must one of these + /// integer constants: + /// + ///
    + ///
  • SQLITE_MUTEX_FAST + ///
  • SQLITE_MUTEX_RECURSIVE + ///
  • SQLITE_MUTEX_STATIC_MASTER + ///
  • SQLITE_MUTEX_STATIC_MEM + ///
  • SQLITE_MUTEX_STATIC_OPEN + ///
  • SQLITE_MUTEX_STATIC_PRNG + ///
  • SQLITE_MUTEX_STATIC_LRU + ///
  • SQLITE_MUTEX_STATIC_PMEM + ///
  • SQLITE_MUTEX_STATIC_APP1 + ///
  • SQLITE_MUTEX_STATIC_APP2 + ///
  • SQLITE_MUTEX_STATIC_APP3 + ///
  • SQLITE_MUTEX_STATIC_VFS1 + ///
  • SQLITE_MUTEX_STATIC_VFS2 + ///
  • SQLITE_MUTEX_STATIC_VFS3 + ///
+ /// + /// ^The first two constants (SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE) + /// cause sqlite3_mutex_alloc() to create + /// a new mutex. ^The new mutex is recursive when SQLITE_MUTEX_RECURSIVE + /// is used but not necessarily so when SQLITE_MUTEX_FAST is used. + /// The mutex implementation does not need to make a distinction + /// between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does + /// not want to. SQLite will only request a recursive mutex in + /// cases where it really needs one. If a faster non-recursive mutex + /// implementation is available on the host platform, the mutex subsystem + /// might return such a mutex in response to SQLITE_MUTEX_FAST. + /// + /// ^The other allowed parameters to sqlite3_mutex_alloc() (anything other + /// than SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE) each return + /// a pointer to a static preexisting mutex. ^Nine static mutexes are + /// used by the current version of SQLite. Future versions of SQLite + /// may add additional static mutexes. Static mutexes are for internal + /// use by SQLite only. Applications that use SQLite mutexes should + /// use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or + /// SQLITE_MUTEX_RECURSIVE. + /// + /// ^Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST + /// or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() + /// returns a different mutex on every call. ^For the static + /// mutex types, the same mutex is returned on every call that has + /// the same type number. + /// + /// ^The sqlite3_mutex_free() routine deallocates a previously + /// allocated dynamic mutex. Attempting to deallocate a static + /// mutex results in undefined behavior. + /// + /// ^The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt + /// to enter a mutex. ^If another thread is already within the mutex, + /// sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return + /// SQLITE_BUSY. ^The sqlite3_mutex_try() interface returns [SQLITE_OK] + /// upon successful entry. ^(Mutexes created using + /// SQLITE_MUTEX_RECURSIVE can be entered multiple times by the same thread. + /// In such cases, the + /// mutex must be exited an equal number of times before another thread + /// can enter.)^ If the same thread tries to enter any mutex other + /// than an SQLITE_MUTEX_RECURSIVE more than once, the behavior is undefined. + /// + /// ^(Some systems (for example, Windows 95) do not support the operation + /// implemented by sqlite3_mutex_try(). On those systems, sqlite3_mutex_try() + /// will always return SQLITE_BUSY. The SQLite core only ever uses + /// sqlite3_mutex_try() as an optimization so this is acceptable + /// behavior.)^ + /// + /// ^The sqlite3_mutex_leave() routine exits a mutex that was + /// previously entered by the same thread. The behavior + /// is undefined if the mutex is not currently entered by the + /// calling thread or is not currently allocated. + /// + /// ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or + /// sqlite3_mutex_leave() is a NULL pointer, then all three routines + /// behave as no-ops. + /// + /// See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. ffi.Pointer sqlite3_mutex_alloc( int arg0, ) { @@ -3286,6 +7096,14 @@ class SQLite { _dart_sqlite3_mutex_notheld _sqlite3_mutex_notheld; + /// CAPI3REF: Retrieve the mutex for a database connection + /// METHOD: sqlite3 + /// + /// ^This interface returns a pointer the [sqlite3_mutex] object that + /// serializes access to the [database connection] given in the argument + /// when the [threading mode] is Serialized. + /// ^If the [threading mode] is Single-thread or Multi-thread then this + /// routine returns a NULL pointer. ffi.Pointer sqlite3_db_mutex( ffi.Pointer arg0, ) { @@ -3299,6 +7117,45 @@ class SQLite { _dart_sqlite3_db_mutex _sqlite3_db_mutex; + /// CAPI3REF: Low-Level Control Of Database Files + /// METHOD: sqlite3 + /// KEYWORDS: {file control} + /// + /// ^The [sqlite3_file_control()] interface makes a direct call to the + /// xFileControl method for the [sqlite3_io_methods] object associated + /// with a particular database identified by the second argument. ^The + /// name of the database is "main" for the main database or "temp" for the + /// TEMP database, or the name that appears after the AS keyword for + /// databases that are added using the [ATTACH] SQL command. + /// ^A NULL pointer can be used in place of "main" to refer to the + /// main database file. + /// ^The third and fourth parameters to this routine + /// are passed directly through to the second and third parameters of + /// the xFileControl method. ^The return value of the xFileControl + /// method becomes the return value of this routine. + /// + /// A few opcodes for [sqlite3_file_control()] are handled directly + /// by the SQLite core and never invoke the + /// sqlite3_io_methods.xFileControl method. + /// ^The [SQLITE_FCNTL_FILE_POINTER] value for the op parameter causes + /// a pointer to the underlying [sqlite3_file] object to be written into + /// the space pointed to by the 4th parameter. The + /// [SQLITE_FCNTL_JOURNAL_POINTER] works similarly except that it returns + /// the [sqlite3_file] object associated with the journal file instead of + /// the main database. The [SQLITE_FCNTL_VFS_POINTER] opcode returns + /// a pointer to the underlying [sqlite3_vfs] object for the file. + /// The [SQLITE_FCNTL_DATA_VERSION] returns the data version counter + /// from the pager. + /// + /// ^If the second parameter (zDbName) does not match the name of any + /// open database file, then SQLITE_ERROR is returned. ^This error + /// code is not remembered and will not be recalled by [sqlite3_errcode()] + /// or [sqlite3_errmsg()]. The underlying xFileControl method might + /// also return SQLITE_ERROR. There is no way to distinguish between + /// an incorrect zDbName and an SQLITE_ERROR return from the underlying + /// xFileControl method. + /// + /// See also: [file control opcodes] int sqlite3_file_control( ffi.Pointer arg0, ffi.Pointer zDbName, @@ -3317,6 +7174,21 @@ class SQLite { _dart_sqlite3_file_control _sqlite3_file_control; + /// CAPI3REF: Testing Interface + /// + /// ^The sqlite3_test_control() interface is used to read out internal + /// state of SQLite and to inject faults into SQLite for testing + /// purposes. ^The first parameter is an operation code that determines + /// the number, meaning, and operation of all subsequent parameters. + /// + /// This interface is not for use by applications. It exists solely + /// for verifying the correct operation of the SQLite library. Depending + /// on how the SQLite library is compiled, this interface might not exist. + /// + /// The details of the operation codes, their meanings, the parameters + /// they take, and what they do are all subject to change without notice. + /// Unlike most of the SQLite API, this function is not guaranteed to + /// operate consistently from one release to the next. int sqlite3_test_control( int op, ) { @@ -3329,6 +7201,51 @@ class SQLite { _dart_sqlite3_test_control _sqlite3_test_control; + /// CAPI3REF: SQL Keyword Checking + /// + /// These routines provide access to the set of SQL language keywords + /// recognized by SQLite. Applications can uses these routines to determine + /// whether or not a specific identifier needs to be escaped (for example, + /// by enclosing in double-quotes) so as not to confuse the parser. + /// + /// The sqlite3_keyword_count() interface returns the number of distinct + /// keywords understood by SQLite. + /// + /// The sqlite3_keyword_name(N,Z,L) interface finds the N-th keyword and + /// makes *Z point to that keyword expressed as UTF8 and writes the number + /// of bytes in the keyword into *L. The string that *Z points to is not + /// zero-terminated. The sqlite3_keyword_name(N,Z,L) routine returns + /// SQLITE_OK if N is within bounds and SQLITE_ERROR if not. If either Z + /// or L are NULL or invalid pointers then calls to + /// sqlite3_keyword_name(N,Z,L) result in undefined behavior. + /// + /// The sqlite3_keyword_check(Z,L) interface checks to see whether or not + /// the L-byte UTF8 identifier that Z points to is a keyword, returning non-zero + /// if it is and zero if not. + /// + /// The parser used by SQLite is forgiving. It is often possible to use + /// a keyword as an identifier as long as such use does not result in a + /// parsing ambiguity. For example, the statement + /// "CREATE TABLE BEGIN(REPLACE,PRAGMA,END);" is accepted by SQLite, and + /// creates a new table named "BEGIN" with three columns named + /// "REPLACE", "PRAGMA", and "END". Nevertheless, best practice is to avoid + /// using keywords as identifiers. Common techniques used to avoid keyword + /// name collisions include: + ///
    + ///
  • Put all identifier names inside double-quotes. This is the official + /// SQL way to escape identifier names. + ///
  • Put identifier names inside [...]. This is not standard SQL, + /// but it is what SQL Server does and so lots of programmers use this + /// technique. + ///
  • Begin every identifier with the letter "Z" as no SQL keywords start + /// with "Z". + ///
  • Include a digit somewhere in every identifier name. + ///
+ /// + /// Note that the number of keywords understood by SQLite can depend on + /// compile-time options. For example, "VACUUM" is not a keyword if + /// SQLite is compiled with the [-DSQLITE_OMIT_VACUUM] option. Also, + /// new keywords may be added to future releases of SQLite. int sqlite3_keyword_count() { _sqlite3_keyword_count ??= _dylib.lookupFunction<_c_sqlite3_keyword_count, _dart_sqlite3_keyword_count>('sqlite3_keyword_count'); @@ -3367,6 +7284,29 @@ class SQLite { _dart_sqlite3_keyword_check _sqlite3_keyword_check; + /// CAPI3REF: Create A New Dynamic String Object + /// CONSTRUCTOR: sqlite3_str + /// + /// ^The [sqlite3_str_new(D)] interface allocates and initializes + /// a new [sqlite3_str] object. To avoid memory leaks, the object returned by + /// [sqlite3_str_new()] must be freed by a subsequent call to + /// [sqlite3_str_finish(X)]. + /// + /// ^The [sqlite3_str_new(D)] interface always returns a pointer to a + /// valid [sqlite3_str] object, though in the event of an out-of-memory + /// error the returned object might be a special singleton that will + /// silently reject new text, always return SQLITE_NOMEM from + /// [sqlite3_str_errcode()], always return 0 for + /// [sqlite3_str_length()], and always return NULL from + /// [sqlite3_str_finish(X)]. It is always safe to use the value + /// returned by [sqlite3_str_new(D)] as the sqlite3_str parameter + /// to any of the other [sqlite3_str] methods. + /// + /// The D parameter to [sqlite3_str_new(D)] may be NULL. If the + /// D parameter in [sqlite3_str_new(D)] is not NULL, then the maximum + /// length of the string contained in the [sqlite3_str] object will be + /// the value set for [sqlite3_limit](D,[SQLITE_LIMIT_LENGTH]) instead + /// of [SQLITE_MAX_LENGTH]. ffi.Pointer sqlite3_str_new( ffi.Pointer arg0, ) { @@ -3380,6 +7320,17 @@ class SQLite { _dart_sqlite3_str_new _sqlite3_str_new; + /// CAPI3REF: Finalize A Dynamic String + /// DESTRUCTOR: sqlite3_str + /// + /// ^The [sqlite3_str_finish(X)] interface destroys the sqlite3_str object X + /// and returns a pointer to a memory buffer obtained from [sqlite3_malloc64()] + /// that contains the constructed string. The calling application should + /// pass the returned value to [sqlite3_free()] to avoid a memory leak. + /// ^The [sqlite3_str_finish(X)] interface may return a NULL pointer if any + /// errors were encountered during construction of the string. ^The + /// [sqlite3_str_finish(X)] interface will also return a NULL pointer if the + /// string in [sqlite3_str] object X is zero bytes long. ffi.Pointer sqlite3_str_finish( ffi.Pointer arg0, ) { @@ -3393,6 +7344,36 @@ class SQLite { _dart_sqlite3_str_finish _sqlite3_str_finish; + /// CAPI3REF: Add Content To A Dynamic String + /// METHOD: sqlite3_str + /// + /// These interfaces add content to an sqlite3_str object previously obtained + /// from [sqlite3_str_new()]. + /// + /// ^The [sqlite3_str_appendf(X,F,...)] and + /// [sqlite3_str_vappendf(X,F,V)] interfaces uses the [built-in printf] + /// functionality of SQLite to append formatted text onto the end of + /// [sqlite3_str] object X. + /// + /// ^The [sqlite3_str_append(X,S,N)] method appends exactly N bytes from string S + /// onto the end of the [sqlite3_str] object X. N must be non-negative. + /// S must contain at least N non-zero bytes of content. To append a + /// zero-terminated string in its entirety, use the [sqlite3_str_appendall()] + /// method instead. + /// + /// ^The [sqlite3_str_appendall(X,S)] method appends the complete content of + /// zero-terminated string S onto the end of [sqlite3_str] object X. + /// + /// ^The [sqlite3_str_appendchar(X,N,C)] method appends N copies of the + /// single-byte character C onto the end of [sqlite3_str] object X. + /// ^This method can be used, for example, to add whitespace indentation. + /// + /// ^The [sqlite3_str_reset(X)] method resets the string under construction + /// inside [sqlite3_str] object X back to zero bytes in length. + /// + /// These methods do not return a result code. ^If an error occurs, that fact + /// is recorded in the [sqlite3_str] object and can be recovered by a + /// subsequent call to [sqlite3_str_errcode(X)]. void sqlite3_str_appendf( ffi.Pointer arg0, ffi.Pointer zFormat, @@ -3467,6 +7448,33 @@ class SQLite { _dart_sqlite3_str_reset _sqlite3_str_reset; + /// CAPI3REF: Status Of A Dynamic String + /// METHOD: sqlite3_str + /// + /// These interfaces return the current status of an [sqlite3_str] object. + /// + /// ^If any prior errors have occurred while constructing the dynamic string + /// in sqlite3_str X, then the [sqlite3_str_errcode(X)] method will return + /// an appropriate error code. ^The [sqlite3_str_errcode(X)] method returns + /// [SQLITE_NOMEM] following any out-of-memory error, or + /// [SQLITE_TOOBIG] if the size of the dynamic string exceeds + /// [SQLITE_MAX_LENGTH], or [SQLITE_OK] if there have been no errors. + /// + /// ^The [sqlite3_str_length(X)] method returns the current length, in bytes, + /// of the dynamic string under construction in [sqlite3_str] object X. + /// ^The length returned by [sqlite3_str_length(X)] does not include the + /// zero-termination byte. + /// + /// ^The [sqlite3_str_value(X)] method returns a pointer to the current + /// content of the dynamic string under construction in X. The value + /// returned by [sqlite3_str_value(X)] is managed by the sqlite3_str object X + /// and might be freed or altered by any subsequent method on the same + /// [sqlite3_str] object. Applications must not used the pointer returned + /// [sqlite3_str_value(X)] after any subsequent method call on the same + /// object. ^Applications may change the content of the string returned + /// by [sqlite3_str_value(X)] as long as they do not write into any bytes + /// outside the range of 0 to [sqlite3_str_length(X)] and do not read or + /// write any byte after any subsequent sqlite3_str method call. int sqlite3_str_errcode( ffi.Pointer arg0, ) { @@ -3505,6 +7513,30 @@ class SQLite { _dart_sqlite3_str_value _sqlite3_str_value; + /// CAPI3REF: SQLite Runtime Status + /// + /// ^These interfaces are used to retrieve runtime status information + /// about the performance of SQLite, and optionally to reset various + /// highwater marks. ^The first argument is an integer code for + /// the specific parameter to measure. ^(Recognized integer codes + /// are of the form [status parameters | SQLITE_STATUS_...].)^ + /// ^The current value of the parameter is returned into *pCurrent. + /// ^The highest recorded value is returned in *pHighwater. ^If the + /// resetFlag is true, then the highest record value is reset after + /// *pHighwater is written. ^(Some parameters do not record the highest + /// value. For those parameters + /// nothing is written into *pHighwater and the resetFlag is ignored.)^ + /// ^(Other parameters record only the highwater mark and not the current + /// value. For these latter parameters nothing is written into *pCurrent.)^ + /// + /// ^The sqlite3_status() and sqlite3_status64() routines return + /// SQLITE_OK on success and a non-zero [error code] on failure. + /// + /// If either the current value or the highwater mark is too large to + /// be represented by a 32-bit integer, then the values returned by + /// sqlite3_status() are undefined. + /// + /// See also: [sqlite3_db_status()] int sqlite3_status( int op, ffi.Pointer pCurrent, @@ -3543,6 +7575,27 @@ class SQLite { _dart_sqlite3_status64 _sqlite3_status64; + /// CAPI3REF: Database Connection Status + /// METHOD: sqlite3 + /// + /// ^This interface is used to retrieve runtime status information + /// about a single [database connection]. ^The first argument is the + /// database connection object to be interrogated. ^The second argument + /// is an integer constant, taken from the set of + /// [SQLITE_DBSTATUS options], that + /// determines the parameter to interrogate. The set of + /// [SQLITE_DBSTATUS options] is likely + /// to grow in future releases of SQLite. + /// + /// ^The current value of the requested parameter is written into *pCur + /// and the highest instantaneous value is written into *pHiwtr. ^If + /// the resetFlg is true, then the highest instantaneous value is + /// reset back down to the current value. + /// + /// ^The sqlite3_db_status() routine returns SQLITE_OK on success and a + /// non-zero [error code] on failure. + /// + /// See also: [sqlite3_status()] and [sqlite3_stmt_status()]. int sqlite3_db_status( ffi.Pointer arg0, int op, @@ -3564,6 +7617,28 @@ class SQLite { _dart_sqlite3_db_status _sqlite3_db_status; + /// CAPI3REF: Prepared Statement Status + /// METHOD: sqlite3_stmt + /// + /// ^(Each prepared statement maintains various + /// [SQLITE_STMTSTATUS counters] that measure the number + /// of times it has performed specific operations.)^ These counters can + /// be used to monitor the performance characteristics of the prepared + /// statements. For example, if the number of table steps greatly exceeds + /// the number of table searches or result rows, that would tend to indicate + /// that the prepared statement is using a full table scan rather than + /// an index. + /// + /// ^(This interface is used to retrieve and reset counter values from + /// a [prepared statement]. The first argument is the prepared statement + /// object to be interrogated. The second argument + /// is an integer code for a specific [SQLITE_STMTSTATUS counter] + /// to be interrogated.)^ + /// ^The current value of the requested counter is returned. + /// ^If the resetFlg is true, then the counter is reset to zero after this + /// interface call returns. + /// + /// See also: [sqlite3_status()] and [sqlite3_db_status()]. int sqlite3_stmt_status( ffi.Pointer arg0, int op, @@ -3580,6 +7655,190 @@ class SQLite { _dart_sqlite3_stmt_status _sqlite3_stmt_status; + /// CAPI3REF: Online Backup API. + /// + /// The backup API copies the content of one database into another. + /// It is useful either for creating backups of databases or + /// for copying in-memory databases to or from persistent files. + /// + /// See Also: [Using the SQLite Online Backup API] + /// + /// ^SQLite holds a write transaction open on the destination database file + /// for the duration of the backup operation. + /// ^The source database is read-locked only while it is being read; + /// it is not locked continuously for the entire backup operation. + /// ^Thus, the backup may be performed on a live source database without + /// preventing other database connections from + /// reading or writing to the source database while the backup is underway. + /// + /// ^(To perform a backup operation: + ///
    + ///
  1. sqlite3_backup_init() is called once to initialize the + /// backup, + ///
  2. sqlite3_backup_step() is called one or more times to transfer + /// the data between the two databases, and finally + ///
  3. sqlite3_backup_finish() is called to release all resources + /// associated with the backup operation. + ///
)^ + /// There should be exactly one call to sqlite3_backup_finish() for each + /// successful call to sqlite3_backup_init(). + /// + /// [[sqlite3_backup_init()]] sqlite3_backup_init() + /// + /// ^The D and N arguments to sqlite3_backup_init(D,N,S,M) are the + /// [database connection] associated with the destination database + /// and the database name, respectively. + /// ^The database name is "main" for the main database, "temp" for the + /// temporary database, or the name specified after the AS keyword in + /// an [ATTACH] statement for an attached database. + /// ^The S and M arguments passed to + /// sqlite3_backup_init(D,N,S,M) identify the [database connection] + /// and database name of the source database, respectively. + /// ^The source and destination [database connections] (parameters S and D) + /// must be different or else sqlite3_backup_init(D,N,S,M) will fail with + /// an error. + /// + /// ^A call to sqlite3_backup_init() will fail, returning NULL, if + /// there is already a read or read-write transaction open on the + /// destination database. + /// + /// ^If an error occurs within sqlite3_backup_init(D,N,S,M), then NULL is + /// returned and an error code and error message are stored in the + /// destination [database connection] D. + /// ^The error code and message for the failed call to sqlite3_backup_init() + /// can be retrieved using the [sqlite3_errcode()], [sqlite3_errmsg()], and/or + /// [sqlite3_errmsg16()] functions. + /// ^A successful call to sqlite3_backup_init() returns a pointer to an + /// [sqlite3_backup] object. + /// ^The [sqlite3_backup] object may be used with the sqlite3_backup_step() and + /// sqlite3_backup_finish() functions to perform the specified backup + /// operation. + /// + /// [[sqlite3_backup_step()]] sqlite3_backup_step() + /// + /// ^Function sqlite3_backup_step(B,N) will copy up to N pages between + /// the source and destination databases specified by [sqlite3_backup] object B. + /// ^If N is negative, all remaining source pages are copied. + /// ^If sqlite3_backup_step(B,N) successfully copies N pages and there + /// are still more pages to be copied, then the function returns [SQLITE_OK]. + /// ^If sqlite3_backup_step(B,N) successfully finishes copying all pages + /// from source to destination, then it returns [SQLITE_DONE]. + /// ^If an error occurs while running sqlite3_backup_step(B,N), + /// then an [error code] is returned. ^As well as [SQLITE_OK] and + /// [SQLITE_DONE], a call to sqlite3_backup_step() may return [SQLITE_READONLY], + /// [SQLITE_NOMEM], [SQLITE_BUSY], [SQLITE_LOCKED], or an + /// [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX] extended error code. + /// + /// ^(The sqlite3_backup_step() might return [SQLITE_READONLY] if + ///
    + ///
  1. the destination database was opened read-only, or + ///
  2. the destination database is using write-ahead-log journaling + /// and the destination and source page sizes differ, or + ///
  3. the destination database is an in-memory database and the + /// destination and source page sizes differ. + ///
)^ + /// + /// ^If sqlite3_backup_step() cannot obtain a required file-system lock, then + /// the [sqlite3_busy_handler | busy-handler function] + /// is invoked (if one is specified). ^If the + /// busy-handler returns non-zero before the lock is available, then + /// [SQLITE_BUSY] is returned to the caller. ^In this case the call to + /// sqlite3_backup_step() can be retried later. ^If the source + /// [database connection] + /// is being used to write to the source database when sqlite3_backup_step() + /// is called, then [SQLITE_LOCKED] is returned immediately. ^Again, in this + /// case the call to sqlite3_backup_step() can be retried later on. ^(If + /// [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX], [SQLITE_NOMEM], or + /// [SQLITE_READONLY] is returned, then + /// there is no point in retrying the call to sqlite3_backup_step(). These + /// errors are considered fatal.)^ The application must accept + /// that the backup operation has failed and pass the backup operation handle + /// to the sqlite3_backup_finish() to release associated resources. + /// + /// ^The first call to sqlite3_backup_step() obtains an exclusive lock + /// on the destination file. ^The exclusive lock is not released until either + /// sqlite3_backup_finish() is called or the backup operation is complete + /// and sqlite3_backup_step() returns [SQLITE_DONE]. ^Every call to + /// sqlite3_backup_step() obtains a [shared lock] on the source database that + /// lasts for the duration of the sqlite3_backup_step() call. + /// ^Because the source database is not locked between calls to + /// sqlite3_backup_step(), the source database may be modified mid-way + /// through the backup process. ^If the source database is modified by an + /// external process or via a database connection other than the one being + /// used by the backup operation, then the backup will be automatically + /// restarted by the next call to sqlite3_backup_step(). ^If the source + /// database is modified by the using the same database connection as is used + /// by the backup operation, then the backup database is automatically + /// updated at the same time. + /// + /// [[sqlite3_backup_finish()]] sqlite3_backup_finish() + /// + /// When sqlite3_backup_step() has returned [SQLITE_DONE], or when the + /// application wishes to abandon the backup operation, the application + /// should destroy the [sqlite3_backup] by passing it to sqlite3_backup_finish(). + /// ^The sqlite3_backup_finish() interfaces releases all + /// resources associated with the [sqlite3_backup] object. + /// ^If sqlite3_backup_step() has not yet returned [SQLITE_DONE], then any + /// active write-transaction on the destination database is rolled back. + /// The [sqlite3_backup] object is invalid + /// and may not be used following a call to sqlite3_backup_finish(). + /// + /// ^The value returned by sqlite3_backup_finish is [SQLITE_OK] if no + /// sqlite3_backup_step() errors occurred, regardless or whether or not + /// sqlite3_backup_step() completed. + /// ^If an out-of-memory condition or IO error occurred during any prior + /// sqlite3_backup_step() call on the same [sqlite3_backup] object, then + /// sqlite3_backup_finish() returns the corresponding [error code]. + /// + /// ^A return of [SQLITE_BUSY] or [SQLITE_LOCKED] from sqlite3_backup_step() + /// is not a permanent error and does not affect the return value of + /// sqlite3_backup_finish(). + /// + /// [[sqlite3_backup_remaining()]] [[sqlite3_backup_pagecount()]] + /// sqlite3_backup_remaining() and sqlite3_backup_pagecount() + /// + /// ^The sqlite3_backup_remaining() routine returns the number of pages still + /// to be backed up at the conclusion of the most recent sqlite3_backup_step(). + /// ^The sqlite3_backup_pagecount() routine returns the total number of pages + /// in the source database at the conclusion of the most recent + /// sqlite3_backup_step(). + /// ^(The values returned by these functions are only updated by + /// sqlite3_backup_step(). If the source database is modified in a way that + /// changes the size of the source database or the number of pages remaining, + /// those changes are not reflected in the output of sqlite3_backup_pagecount() + /// and sqlite3_backup_remaining() until after the next + /// sqlite3_backup_step().)^ + /// + /// Concurrent Usage of Database Handles + /// + /// ^The source [database connection] may be used by the application for other + /// purposes while a backup operation is underway or being initialized. + /// ^If SQLite is compiled and configured to support threadsafe database + /// connections, then the source database connection may be used concurrently + /// from within other threads. + /// + /// However, the application must guarantee that the destination + /// [database connection] is not passed to any other API (by any thread) after + /// sqlite3_backup_init() is called and before the corresponding call to + /// sqlite3_backup_finish(). SQLite does not currently check to see + /// if the application incorrectly accesses the destination [database connection] + /// and so no error code is reported, but the operations may malfunction + /// nevertheless. Use of the destination database connection while a + /// backup is in progress might also also cause a mutex deadlock. + /// + /// If running in [shared cache mode], the application must + /// guarantee that the shared cache used by the destination database + /// is not accessed while the backup is running. In practice this means + /// that the application must guarantee that the disk file being + /// backed up to is not accessed by any connection within the process, + /// not just the specific connection that was passed to sqlite3_backup_init(). + /// + /// The [sqlite3_backup] object itself is partially threadsafe. Multiple + /// threads may safely make multiple concurrent calls to sqlite3_backup_step(). + /// However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount() + /// APIs are not strictly speaking threadsafe. If they are invoked at the + /// same time as another thread is invoking sqlite3_backup_step() it is + /// possible that they return invalid values. ffi.Pointer sqlite3_backup_init( ffi.Pointer pDest, ffi.Pointer zDestName, @@ -3650,6 +7909,119 @@ class SQLite { _dart_sqlite3_backup_pagecount _sqlite3_backup_pagecount; + /// CAPI3REF: Unlock Notification + /// METHOD: sqlite3 + /// + /// ^When running in shared-cache mode, a database operation may fail with + /// an [SQLITE_LOCKED] error if the required locks on the shared-cache or + /// individual tables within the shared-cache cannot be obtained. See + /// [SQLite Shared-Cache Mode] for a description of shared-cache locking. + /// ^This API may be used to register a callback that SQLite will invoke + /// when the connection currently holding the required lock relinquishes it. + /// ^This API is only available if the library was compiled with the + /// [SQLITE_ENABLE_UNLOCK_NOTIFY] C-preprocessor symbol defined. + /// + /// See Also: [Using the SQLite Unlock Notification Feature]. + /// + /// ^Shared-cache locks are released when a database connection concludes + /// its current transaction, either by committing it or rolling it back. + /// + /// ^When a connection (known as the blocked connection) fails to obtain a + /// shared-cache lock and SQLITE_LOCKED is returned to the caller, the + /// identity of the database connection (the blocking connection) that + /// has locked the required resource is stored internally. ^After an + /// application receives an SQLITE_LOCKED error, it may call the + /// sqlite3_unlock_notify() method with the blocked connection handle as + /// the first argument to register for a callback that will be invoked + /// when the blocking connections current transaction is concluded. ^The + /// callback is invoked from within the [sqlite3_step] or [sqlite3_close] + /// call that concludes the blocking connection's transaction. + /// + /// ^(If sqlite3_unlock_notify() is called in a multi-threaded application, + /// there is a chance that the blocking connection will have already + /// concluded its transaction by the time sqlite3_unlock_notify() is invoked. + /// If this happens, then the specified callback is invoked immediately, + /// from within the call to sqlite3_unlock_notify().)^ + /// + /// ^If the blocked connection is attempting to obtain a write-lock on a + /// shared-cache table, and more than one other connection currently holds + /// a read-lock on the same table, then SQLite arbitrarily selects one of + /// the other connections to use as the blocking connection. + /// + /// ^(There may be at most one unlock-notify callback registered by a + /// blocked connection. If sqlite3_unlock_notify() is called when the + /// blocked connection already has a registered unlock-notify callback, + /// then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is + /// called with a NULL pointer as its second argument, then any existing + /// unlock-notify callback is canceled. ^The blocked connections + /// unlock-notify callback may also be canceled by closing the blocked + /// connection using [sqlite3_close()]. + /// + /// The unlock-notify callback is not reentrant. If an application invokes + /// any sqlite3_xxx API functions from within an unlock-notify callback, a + /// crash or deadlock may be the result. + /// + /// ^Unless deadlock is detected (see below), sqlite3_unlock_notify() always + /// returns SQLITE_OK. + /// + /// Callback Invocation Details + /// + /// When an unlock-notify callback is registered, the application provides a + /// single void* pointer that is passed to the callback when it is invoked. + /// However, the signature of the callback function allows SQLite to pass + /// it an array of void* context pointers. The first argument passed to + /// an unlock-notify callback is a pointer to an array of void* pointers, + /// and the second is the number of entries in the array. + /// + /// When a blocking connection's transaction is concluded, there may be + /// more than one blocked connection that has registered for an unlock-notify + /// callback. ^If two or more such blocked connections have specified the + /// same callback function, then instead of invoking the callback function + /// multiple times, it is invoked once with the set of void* context pointers + /// specified by the blocked connections bundled together into an array. + /// This gives the application an opportunity to prioritize any actions + /// related to the set of unblocked database connections. + /// + /// Deadlock Detection + /// + /// Assuming that after registering for an unlock-notify callback a + /// database waits for the callback to be issued before taking any further + /// action (a reasonable assumption), then using this API may cause the + /// application to deadlock. For example, if connection X is waiting for + /// connection Y's transaction to be concluded, and similarly connection + /// Y is waiting on connection X's transaction, then neither connection + /// will proceed and the system may remain deadlocked indefinitely. + /// + /// To avoid this scenario, the sqlite3_unlock_notify() performs deadlock + /// detection. ^If a given call to sqlite3_unlock_notify() would put the + /// system in a deadlocked state, then SQLITE_LOCKED is returned and no + /// unlock-notify callback is registered. The system is said to be in + /// a deadlocked state if connection A has registered for an unlock-notify + /// callback on the conclusion of connection B's transaction, and connection + /// B has itself registered for an unlock-notify callback when connection + /// A's transaction is concluded. ^Indirect deadlock is also detected, so + /// the system is also considered to be deadlocked if connection B has + /// registered for an unlock-notify callback on the conclusion of connection + /// C's transaction, where connection C is waiting on connection A. ^Any + /// number of levels of indirection are allowed. + /// + /// The "DROP TABLE" Exception + /// + /// When a call to [sqlite3_step()] returns SQLITE_LOCKED, it is almost + /// always appropriate to call sqlite3_unlock_notify(). There is however, + /// one exception. When executing a "DROP TABLE" or "DROP INDEX" statement, + /// SQLite checks if there are any currently executing SELECT statements + /// that belong to the same connection. If there are, SQLITE_LOCKED is + /// returned. In this case there is no "blocking connection", so invoking + /// sqlite3_unlock_notify() results in the unlock-notify callback being + /// invoked immediately. If the application then re-attempts the "DROP TABLE" + /// or "DROP INDEX" query, an infinite loop might be the result. + /// + /// One way around this problem is to check the extended error code returned + /// by an sqlite3_step() call. ^(If there is a blocking connection, then the + /// extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in + /// the special "DROP TABLE/INDEX" case, the extended error code is just + /// SQLITE_LOCKED.)^ int sqlite3_unlock_notify( ffi.Pointer pBlocked, ffi.Pointer> xNotify, @@ -3666,6 +8038,12 @@ class SQLite { _dart_sqlite3_unlock_notify _sqlite3_unlock_notify; + /// CAPI3REF: String Comparison + /// + /// ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications + /// and extensions to compare the contents of two buffers containing UTF-8 + /// strings in a case-independent fashion, using the same definition of "case + /// independence" that SQLite uses internally when comparing identifiers. int sqlite3_stricmp( ffi.Pointer arg0, ffi.Pointer arg1, @@ -3698,6 +8076,19 @@ class SQLite { _dart_sqlite3_strnicmp _sqlite3_strnicmp; + /// CAPI3REF: String Globbing + /// + /// ^The [sqlite3_strglob(P,X)] interface returns zero if and only if + /// string X matches the [GLOB] pattern P. + /// ^The definition of [GLOB] pattern matching used in + /// [sqlite3_strglob(P,X)] is the same as for the "X GLOB P" operator in the + /// SQL dialect understood by SQLite. ^The [sqlite3_strglob(P,X)] function + /// is case sensitive. + /// + /// Note that this routine returns zero on a match and non-zero if the strings + /// do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()]. + /// + /// See also: [sqlite3_strlike()]. int sqlite3_strglob( ffi.Pointer zGlob, ffi.Pointer zStr, @@ -3713,6 +8104,25 @@ class SQLite { _dart_sqlite3_strglob _sqlite3_strglob; + /// CAPI3REF: String LIKE Matching + /// + /// ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if + /// string X matches the [LIKE] pattern P with escape character E. + /// ^The definition of [LIKE] pattern matching used in + /// [sqlite3_strlike(P,X,E)] is the same as for the "X LIKE P ESCAPE E" + /// operator in the SQL dialect understood by SQLite. ^For "X LIKE P" without + /// the ESCAPE clause, set the E parameter of [sqlite3_strlike(P,X,E)] to 0. + /// ^As with the LIKE operator, the [sqlite3_strlike(P,X,E)] function is case + /// insensitive - equivalent upper and lower case ASCII characters match + /// one another. + /// + /// ^The [sqlite3_strlike(P,X,E)] function matches Unicode characters, though + /// only ASCII characters are case folded. + /// + /// Note that this routine returns zero on a match and non-zero if the strings + /// do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()]. + /// + /// See also: [sqlite3_strglob()]. int sqlite3_strlike( ffi.Pointer zGlob, ffi.Pointer zStr, @@ -3730,6 +8140,25 @@ class SQLite { _dart_sqlite3_strlike _sqlite3_strlike; + /// CAPI3REF: Error Logging Interface + /// + /// ^The [sqlite3_log()] interface writes a message into the [error log] + /// established by the [SQLITE_CONFIG_LOG] option to [sqlite3_config()]. + /// ^If logging is enabled, the zFormat string and subsequent arguments are + /// used with [sqlite3_snprintf()] to generate the final output string. + /// + /// The sqlite3_log() interface is intended for use by extensions such as + /// virtual tables, collating functions, and SQL functions. While there is + /// nothing to prevent an application from calling sqlite3_log(), doing so + /// is considered bad form. + /// + /// The zFormat string must not be NULL. + /// + /// To avoid deadlocks and other threading problems, the sqlite3_log() routine + /// will not use dynamically allocated memory. The log message is stored in + /// a fixed-length buffer on the stack. If the log message is longer than + /// a few hundred characters, it will be truncated to the length of the + /// buffer. void sqlite3_log( int iErrCode, ffi.Pointer zFormat, @@ -3744,6 +8173,38 @@ class SQLite { _dart_sqlite3_log _sqlite3_log; + /// CAPI3REF: Write-Ahead Log Commit Hook + /// METHOD: sqlite3 + /// + /// ^The [sqlite3_wal_hook()] function is used to register a callback that + /// is invoked each time data is committed to a database in wal mode. + /// + /// ^(The callback is invoked by SQLite after the commit has taken place and + /// the associated write-lock on the database released)^, so the implementation + /// may read, write or [checkpoint] the database as required. + /// + /// ^The first parameter passed to the callback function when it is invoked + /// is a copy of the third parameter passed to sqlite3_wal_hook() when + /// registering the callback. ^The second is a copy of the database handle. + /// ^The third parameter is the name of the database that was written to - + /// either "main" or the name of an [ATTACH]-ed database. ^The fourth parameter + /// is the number of pages currently in the write-ahead log file, + /// including those that were just committed. + /// + /// The callback function should normally return [SQLITE_OK]. ^If an error + /// code is returned, that error will propagate back up through the + /// SQLite code base to cause the statement that provoked the callback + /// to report an error, though the commit will have still occurred. If the + /// callback returns [SQLITE_ROW] or [SQLITE_DONE], or if it returns a value + /// that does not correspond to any valid SQLite error code, the results + /// are undefined. + /// + /// A single database handle may have at most a single write-ahead log callback + /// registered at one time. ^Calling [sqlite3_wal_hook()] replaces any + /// previously registered write-ahead log callback. ^Note that the + /// [sqlite3_wal_autocheckpoint()] interface and the + /// [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will + /// overwrite any prior [sqlite3_wal_hook()] settings. ffi.Pointer sqlite3_wal_hook( ffi.Pointer arg0, ffi.Pointer> arg1, @@ -3761,6 +8222,33 @@ class SQLite { _dart_sqlite3_wal_hook _sqlite3_wal_hook; + /// CAPI3REF: Configure an auto-checkpoint + /// METHOD: sqlite3 + /// + /// ^The [sqlite3_wal_autocheckpoint(D,N)] is a wrapper around + /// [sqlite3_wal_hook()] that causes any database on [database connection] D + /// to automatically [checkpoint] + /// after committing a transaction if there are N or + /// more frames in the [write-ahead log] file. ^Passing zero or + /// a negative value as the nFrame parameter disables automatic + /// checkpoints entirely. + /// + /// ^The callback registered by this function replaces any existing callback + /// registered using [sqlite3_wal_hook()]. ^Likewise, registering a callback + /// using [sqlite3_wal_hook()] disables the automatic checkpoint mechanism + /// configured by this function. + /// + /// ^The [wal_autocheckpoint pragma] can be used to invoke this interface + /// from SQL. + /// + /// ^Checkpoints initiated by this mechanism are + /// [sqlite3_wal_checkpoint_v2|PASSIVE]. + /// + /// ^Every new [database connection] defaults to having the auto-checkpoint + /// enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT] + /// pages. The use of this interface + /// is only necessary if the default setting is found to be suboptimal + /// for a particular application. int sqlite3_wal_autocheckpoint( ffi.Pointer db, int N, @@ -3776,6 +8264,24 @@ class SQLite { _dart_sqlite3_wal_autocheckpoint _sqlite3_wal_autocheckpoint; + /// CAPI3REF: Checkpoint a database + /// METHOD: sqlite3 + /// + /// ^(The sqlite3_wal_checkpoint(D,X) is equivalent to + /// [sqlite3_wal_checkpoint_v2](D,X,[SQLITE_CHECKPOINT_PASSIVE],0,0).)^ + /// + /// In brief, sqlite3_wal_checkpoint(D,X) causes the content in the + /// [write-ahead log] for database X on [database connection] D to be + /// transferred into the database file and for the write-ahead log to + /// be reset. See the [checkpointing] documentation for addition + /// information. + /// + /// This interface used to be the only way to cause a checkpoint to + /// occur. But then the newer and more powerful [sqlite3_wal_checkpoint_v2()] + /// interface was added. This interface is retained for backwards + /// compatibility and as a convenience for applications that need to manually + /// start a callback but which do not need the full power (and corresponding + /// complication) of [sqlite3_wal_checkpoint_v2()]. int sqlite3_wal_checkpoint( ffi.Pointer db, ffi.Pointer zDb, @@ -3790,6 +8296,96 @@ class SQLite { _dart_sqlite3_wal_checkpoint _sqlite3_wal_checkpoint; + /// CAPI3REF: Checkpoint a database + /// METHOD: sqlite3 + /// + /// ^(The sqlite3_wal_checkpoint_v2(D,X,M,L,C) interface runs a checkpoint + /// operation on database X of [database connection] D in mode M. Status + /// information is written back into integers pointed to by L and C.)^ + /// ^(The M parameter must be a valid [checkpoint mode]:)^ + /// + ///
+ ///
SQLITE_CHECKPOINT_PASSIVE
+ /// ^Checkpoint as many frames as possible without waiting for any database + /// readers or writers to finish, then sync the database file if all frames + /// in the log were checkpointed. ^The [busy-handler callback] + /// is never invoked in the SQLITE_CHECKPOINT_PASSIVE mode. + /// ^On the other hand, passive mode might leave the checkpoint unfinished + /// if there are concurrent readers or writers. + /// + ///
SQLITE_CHECKPOINT_FULL
+ /// ^This mode blocks (it invokes the + /// [sqlite3_busy_handler|busy-handler callback]) until there is no + /// database writer and all readers are reading from the most recent database + /// snapshot. ^It then checkpoints all frames in the log file and syncs the + /// database file. ^This mode blocks new database writers while it is pending, + /// but new database readers are allowed to continue unimpeded. + /// + ///
SQLITE_CHECKPOINT_RESTART
+ /// ^This mode works the same way as SQLITE_CHECKPOINT_FULL with the addition + /// that after checkpointing the log file it blocks (calls the + /// [busy-handler callback]) + /// until all readers are reading from the database file only. ^This ensures + /// that the next writer will restart the log file from the beginning. + /// ^Like SQLITE_CHECKPOINT_FULL, this mode blocks new + /// database writer attempts while it is pending, but does not impede readers. + /// + ///
SQLITE_CHECKPOINT_TRUNCATE
+ /// ^This mode works the same way as SQLITE_CHECKPOINT_RESTART with the + /// addition that it also truncates the log file to zero bytes just prior + /// to a successful return. + ///
+ /// + /// ^If pnLog is not NULL, then *pnLog is set to the total number of frames in + /// the log file or to -1 if the checkpoint could not run because + /// of an error or because the database is not in [WAL mode]. ^If pnCkpt is not + /// NULL,then *pnCkpt is set to the total number of checkpointed frames in the + /// log file (including any that were already checkpointed before the function + /// was called) or to -1 if the checkpoint could not run due to an error or + /// because the database is not in WAL mode. ^Note that upon successful + /// completion of an SQLITE_CHECKPOINT_TRUNCATE, the log file will have been + /// truncated to zero bytes and so both *pnLog and *pnCkpt will be set to zero. + /// + /// ^All calls obtain an exclusive "checkpoint" lock on the database file. ^If + /// any other process is running a checkpoint operation at the same time, the + /// lock cannot be obtained and SQLITE_BUSY is returned. ^Even if there is a + /// busy-handler configured, it will not be invoked in this case. + /// + /// ^The SQLITE_CHECKPOINT_FULL, RESTART and TRUNCATE modes also obtain the + /// exclusive "writer" lock on the database file. ^If the writer lock cannot be + /// obtained immediately, and a busy-handler is configured, it is invoked and + /// the writer lock retried until either the busy-handler returns 0 or the lock + /// is successfully obtained. ^The busy-handler is also invoked while waiting for + /// database readers as described above. ^If the busy-handler returns 0 before + /// the writer lock is obtained or while waiting for database readers, the + /// checkpoint operation proceeds from that point in the same way as + /// SQLITE_CHECKPOINT_PASSIVE - checkpointing as many frames as possible + /// without blocking any further. ^SQLITE_BUSY is returned in this case. + /// + /// ^If parameter zDb is NULL or points to a zero length string, then the + /// specified operation is attempted on all WAL databases [attached] to + /// [database connection] db. In this case the + /// values written to output parameters *pnLog and *pnCkpt are undefined. ^If + /// an SQLITE_BUSY error is encountered when processing one or more of the + /// attached WAL databases, the operation is still attempted on any remaining + /// attached databases and SQLITE_BUSY is returned at the end. ^If any other + /// error occurs while processing an attached database, processing is abandoned + /// and the error code is returned to the caller immediately. ^If no error + /// (SQLITE_BUSY or otherwise) is encountered while processing the attached + /// databases, SQLITE_OK is returned. + /// + /// ^If database zDb is the name of an attached database that is not in WAL + /// mode, SQLITE_OK is returned and both *pnLog and *pnCkpt set to -1. ^If + /// zDb is not NULL (or a zero length string) and is not the name of any + /// attached database, SQLITE_ERROR is returned to the caller. + /// + /// ^Unless it returns SQLITE_MISUSE, + /// the sqlite3_wal_checkpoint_v2() interface + /// sets the error information that is queried by + /// [sqlite3_errcode()] and [sqlite3_errmsg()]. + /// + /// ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface + /// from SQL. int sqlite3_wal_checkpoint_v2( ffi.Pointer db, ffi.Pointer zDb, @@ -3811,6 +8407,22 @@ class SQLite { _dart_sqlite3_wal_checkpoint_v2 _sqlite3_wal_checkpoint_v2; + /// CAPI3REF: Virtual Table Interface Configuration + /// + /// This function may be called by either the [xConnect] or [xCreate] method + /// of a [virtual table] implementation to configure + /// various facets of the virtual table interface. + /// + /// If this interface is invoked outside the context of an xConnect or + /// xCreate virtual table method then the behavior is undefined. + /// + /// In the call sqlite3_vtab_config(D,C,...) the D parameter is the + /// [database connection] in which the virtual table is being created and + /// which is passed in as the first argument to the [xConnect] or [xCreate] + /// method that is invoking sqlite3_vtab_config(). The C parameter is one + /// of the [virtual table configuration options]. The presence and meaning + /// of parameters after C depend on which [virtual table configuration option] + /// is used. int sqlite3_vtab_config( ffi.Pointer arg0, int op, @@ -3825,6 +8437,14 @@ class SQLite { _dart_sqlite3_vtab_config _sqlite3_vtab_config; + /// CAPI3REF: Determine The Virtual Table Conflict Policy + /// + /// This function may only be called from within a call to the [xUpdate] method + /// of a [virtual table] implementation for an INSERT or UPDATE operation. ^The + /// value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL], + /// [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode + /// of the SQL statement that triggered the call to the [xUpdate] method of the + /// [virtual table]. int sqlite3_vtab_on_conflict( ffi.Pointer arg0, ) { @@ -3838,6 +8458,21 @@ class SQLite { _dart_sqlite3_vtab_on_conflict _sqlite3_vtab_on_conflict; + /// CAPI3REF: Determine If Virtual Table Column Access Is For UPDATE + /// + /// If the sqlite3_vtab_nochange(X) routine is called within the [xColumn] + /// method of a [virtual table], then it returns true if and only if the + /// column is being fetched as part of an UPDATE operation during which the + /// column value will not change. Applications might use this to substitute + /// a return value that is less expensive to compute and that the corresponding + /// [xUpdate] method understands as a "no-change" value. + /// + /// If the [xColumn] method calls sqlite3_vtab_nochange() and finds that + /// the column is not changed by the UPDATE statement, then the xColumn + /// method can optionally return without setting a result, without calling + /// any of the [sqlite3_result_int|sqlite3_result_xxxxx() interfaces]. + /// In that case, [sqlite3_value_nochange(X)] will return true for the + /// same column in the [xUpdate] method. int sqlite3_vtab_nochange( ffi.Pointer arg0, ) { @@ -3850,6 +8485,17 @@ class SQLite { _dart_sqlite3_vtab_nochange _sqlite3_vtab_nochange; + /// CAPI3REF: Determine The Collation For a Virtual Table Constraint + /// + /// This function may only be called from within a call to the [xBestIndex] + /// method of a [virtual table]. + /// + /// The first argument must be the sqlite3_index_info object that is the + /// first parameter to the xBestIndex() method. The second argument must be + /// an index into the aConstraint[] array belonging to the sqlite3_index_info + /// structure passed to xBestIndex. This function returns a pointer to a buffer + /// containing the name of the collation sequence for the corresponding + /// constraint. ffi.Pointer sqlite3_vtab_collation( ffi.Pointer arg0, int arg1, @@ -3864,6 +8510,35 @@ class SQLite { _dart_sqlite3_vtab_collation _sqlite3_vtab_collation; + /// CAPI3REF: Prepared Statement Scan Status + /// METHOD: sqlite3_stmt + /// + /// This interface returns information about the predicted and measured + /// performance for pStmt. Advanced applications can use this + /// interface to compare the predicted and the measured performance and + /// issue warnings and/or rerun [ANALYZE] if discrepancies are found. + /// + /// Since this interface is expected to be rarely used, it is only + /// available if SQLite is compiled using the [SQLITE_ENABLE_STMT_SCANSTATUS] + /// compile-time option. + /// + /// The "iScanStatusOp" parameter determines which status information to return. + /// The "iScanStatusOp" must be one of the [scanstatus options] or the behavior + /// of this interface is undefined. + /// ^The requested measurement is written into a variable pointed to by + /// the "pOut" parameter. + /// Parameter "idx" identifies the specific loop to retrieve statistics for. + /// Loops are numbered starting from zero. ^If idx is out of range - less than + /// zero or greater than or equal to the total number of loops used to implement + /// the statement - a non-zero value is returned and the variable that pOut + /// points to is unchanged. + /// + /// ^Statistics might not be available for all loops in all statements. ^In cases + /// where there exist loops with no available statistics, this function behaves + /// as if the loop did not exist - it returns non-zero and leave the variable + /// that pOut points to unchanged. + /// + /// See also: [sqlite3_stmt_scanstatus_reset()] int sqlite3_stmt_scanstatus( ffi.Pointer pStmt, int idx, @@ -3883,6 +8558,13 @@ class SQLite { _dart_sqlite3_stmt_scanstatus _sqlite3_stmt_scanstatus; + /// CAPI3REF: Zero Scan-Status Counters + /// METHOD: sqlite3_stmt + /// + /// ^Zero all [sqlite3_stmt_scanstatus()] related event counters. + /// + /// This API is only available if the library is built with pre-processor + /// symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined. void sqlite3_stmt_scanstatus_reset( ffi.Pointer arg0, ) { @@ -3896,6 +8578,34 @@ class SQLite { _dart_sqlite3_stmt_scanstatus_reset _sqlite3_stmt_scanstatus_reset; + /// CAPI3REF: Flush caches to disk mid-transaction + /// + /// ^If a write-transaction is open on [database connection] D when the + /// [sqlite3_db_cacheflush(D)] interface invoked, any dirty + /// pages in the pager-cache that are not currently in use are written out + /// to disk. A dirty page may be in use if a database cursor created by an + /// active SQL statement is reading from it, or if it is page 1 of a database + /// file (page 1 is always "in use"). ^The [sqlite3_db_cacheflush(D)] + /// interface flushes caches for all schemas - "main", "temp", and + /// any [attached] databases. + /// + /// ^If this function needs to obtain extra database locks before dirty pages + /// can be flushed to disk, it does so. ^If those locks cannot be obtained + /// immediately and there is a busy-handler callback configured, it is invoked + /// in the usual manner. ^If the required lock still cannot be obtained, then + /// the database is skipped and an attempt made to flush any dirty pages + /// belonging to the next (if any) database. ^If any databases are skipped + /// because locks cannot be obtained, but no other error occurs, this + /// function returns SQLITE_BUSY. + /// + /// ^If any other error occurs while flushing dirty pages to disk (for + /// example an IO error or out-of-memory condition), then processing is + /// abandoned and an SQLite [error code] is returned to the caller immediately. + /// + /// ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK. + /// + /// ^This function does not set the database handle error code or message + /// returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions. int sqlite3_db_cacheflush( ffi.Pointer arg0, ) { @@ -3908,6 +8618,14 @@ class SQLite { _dart_sqlite3_db_cacheflush _sqlite3_db_cacheflush; + /// CAPI3REF: Low-level system error code + /// + /// ^Attempt to return the underlying operating system error code or error + /// number that caused the most recent I/O error or failure to open a file. + /// The return value is OS-dependent. For example, on unix systems, after + /// [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be + /// called to get back the underlying "errno" that caused the problem, such + /// as ENOSPC, EAUTH, EISDIR, and so forth. int sqlite3_system_errno( ffi.Pointer arg0, ) { @@ -3920,6 +8638,47 @@ class SQLite { _dart_sqlite3_system_errno _sqlite3_system_errno; + /// CAPI3REF: Record A Database Snapshot + /// CONSTRUCTOR: sqlite3_snapshot + /// + /// ^The [sqlite3_snapshot_get(D,S,P)] interface attempts to make a + /// new [sqlite3_snapshot] object that records the current state of + /// schema S in database connection D. ^On success, the + /// [sqlite3_snapshot_get(D,S,P)] interface writes a pointer to the newly + /// created [sqlite3_snapshot] object into *P and returns SQLITE_OK. + /// If there is not already a read-transaction open on schema S when + /// this function is called, one is opened automatically. + /// + /// The following must be true for this function to succeed. If any of + /// the following statements are false when sqlite3_snapshot_get() is + /// called, SQLITE_ERROR is returned. The final value of *P is undefined + /// in this case. + /// + ///
    + ///
  • The database handle must not be in [autocommit mode]. + /// + ///
  • Schema S of [database connection] D must be a [WAL mode] database. + /// + ///
  • There must not be a write transaction open on schema S of database + /// connection D. + /// + ///
  • One or more transactions must have been written to the current wal + /// file since it was created on disk (by any connection). This means + /// that a snapshot cannot be taken on a wal mode database with no wal + /// file immediately after it is first opened. At least one transaction + /// must be written to it first. + ///
+ /// + /// This function may also return SQLITE_NOMEM. If it is called with the + /// database handle in autocommit mode but fails for some other reason, + /// whether or not a read transaction is opened on schema S is undefined. + /// + /// The [sqlite3_snapshot] object returned from a successful call to + /// [sqlite3_snapshot_get()] must be freed using [sqlite3_snapshot_free()] + /// to avoid a memory leak. + /// + /// The [sqlite3_snapshot_get()] interface is only available when the + /// [SQLITE_ENABLE_SNAPSHOT] compile-time option is used. int sqlite3_snapshot_get( ffi.Pointer db, ffi.Pointer zSchema, @@ -3936,6 +8695,47 @@ class SQLite { _dart_sqlite3_snapshot_get _sqlite3_snapshot_get; + /// CAPI3REF: Start a read transaction on an historical snapshot + /// METHOD: sqlite3_snapshot + /// + /// ^The [sqlite3_snapshot_open(D,S,P)] interface either starts a new read + /// transaction or upgrades an existing one for schema S of + /// [database connection] D such that the read transaction refers to + /// historical [snapshot] P, rather than the most recent change to the + /// database. ^The [sqlite3_snapshot_open()] interface returns SQLITE_OK + /// on success or an appropriate [error code] if it fails. + /// + /// ^In order to succeed, the database connection must not be in + /// [autocommit mode] when [sqlite3_snapshot_open(D,S,P)] is called. If there + /// is already a read transaction open on schema S, then the database handle + /// must have no active statements (SELECT statements that have been passed + /// to sqlite3_step() but not sqlite3_reset() or sqlite3_finalize()). + /// SQLITE_ERROR is returned if either of these conditions is violated, or + /// if schema S does not exist, or if the snapshot object is invalid. + /// + /// ^A call to sqlite3_snapshot_open() will fail to open if the specified + /// snapshot has been overwritten by a [checkpoint]. In this case + /// SQLITE_ERROR_SNAPSHOT is returned. + /// + /// If there is already a read transaction open when this function is + /// invoked, then the same read transaction remains open (on the same + /// database snapshot) if SQLITE_ERROR, SQLITE_BUSY or SQLITE_ERROR_SNAPSHOT + /// is returned. If another error code - for example SQLITE_PROTOCOL or an + /// SQLITE_IOERR error code - is returned, then the final state of the + /// read transaction is undefined. If SQLITE_OK is returned, then the + /// read transaction is now open on database snapshot P. + /// + /// ^(A call to [sqlite3_snapshot_open(D,S,P)] will fail if the + /// database connection D does not know that the database file for + /// schema S is in [WAL mode]. A database connection might not know + /// that the database file is in [WAL mode] if there has been no prior + /// I/O on that database connection, or if the database entered [WAL mode] + /// after the most recent I/O on the database connection.)^ + /// (Hint: Run "[PRAGMA application_id]" against a newly opened + /// database connection in order to make it ready to use snapshots.) + /// + /// The [sqlite3_snapshot_open()] interface is only available when the + /// [SQLITE_ENABLE_SNAPSHOT] compile-time option is used. int sqlite3_snapshot_open( ffi.Pointer db, ffi.Pointer zSchema, @@ -3952,6 +8752,15 @@ class SQLite { _dart_sqlite3_snapshot_open _sqlite3_snapshot_open; + /// CAPI3REF: Destroy a snapshot + /// DESTRUCTOR: sqlite3_snapshot + /// + /// ^The [sqlite3_snapshot_free(P)] interface destroys [sqlite3_snapshot] P. + /// The application must eventually free every [sqlite3_snapshot] object + /// using this routine to avoid a memory leak. + /// + /// The [sqlite3_snapshot_free()] interface is only available when the + /// [SQLITE_ENABLE_SNAPSHOT] compile-time option is used. void sqlite3_snapshot_free( ffi.Pointer arg0, ) { @@ -3964,6 +8773,29 @@ class SQLite { _dart_sqlite3_snapshot_free _sqlite3_snapshot_free; + /// CAPI3REF: Compare the ages of two snapshot handles. + /// METHOD: sqlite3_snapshot + /// + /// The sqlite3_snapshot_cmp(P1, P2) interface is used to compare the ages + /// of two valid snapshot handles. + /// + /// If the two snapshot handles are not associated with the same database + /// file, the result of the comparison is undefined. + /// + /// Additionally, the result of the comparison is only valid if both of the + /// snapshot handles were obtained by calling sqlite3_snapshot_get() since the + /// last time the wal file was deleted. The wal file is deleted when the + /// database is changed back to rollback mode or when the number of database + /// clients drops to zero. If either snapshot handle was obtained before the + /// wal file was last deleted, the value returned by this function + /// is undefined. + /// + /// Otherwise, this API returns a negative value if P1 refers to an older + /// snapshot than P2, zero if the two handles refer to the same database + /// snapshot, and a positive value if P1 is a newer snapshot than P2. + /// + /// This interface is only available if SQLite is compiled with the + /// [SQLITE_ENABLE_SNAPSHOT] option. int sqlite3_snapshot_cmp( ffi.Pointer p1, ffi.Pointer p2, @@ -3978,6 +8810,27 @@ class SQLite { _dart_sqlite3_snapshot_cmp _sqlite3_snapshot_cmp; + /// CAPI3REF: Recover snapshots from a wal file + /// METHOD: sqlite3_snapshot + /// + /// If a [WAL file] remains on disk after all database connections close + /// (either through the use of the [SQLITE_FCNTL_PERSIST_WAL] [file control] + /// or because the last process to have the database opened exited without + /// calling [sqlite3_close()]) and a new connection is subsequently opened + /// on that database and [WAL file], the [sqlite3_snapshot_open()] interface + /// will only be able to open the last transaction added to the WAL file + /// even though the WAL file contains other valid transactions. + /// + /// This function attempts to scan the WAL file associated with database zDb + /// of database handle db and make all valid snapshots available to + /// sqlite3_snapshot_open(). It is an error if there is already a read + /// transaction open on the database, or if the database is not a WAL mode + /// database. + /// + /// SQLITE_OK is returned if successful, or an SQLite error code otherwise. + /// + /// This interface is only available if SQLite is compiled with the + /// [SQLITE_ENABLE_SNAPSHOT] option. int sqlite3_snapshot_recover( ffi.Pointer db, ffi.Pointer zDb, @@ -3993,6 +8846,40 @@ class SQLite { _dart_sqlite3_snapshot_recover _sqlite3_snapshot_recover; + /// CAPI3REF: Serialize a database + /// + /// The sqlite3_serialize(D,S,P,F) interface returns a pointer to memory + /// that is a serialization of the S database on [database connection] D. + /// If P is not a NULL pointer, then the size of the database in bytes + /// is written into *P. + /// + /// For an ordinary on-disk database file, the serialization is just a + /// copy of the disk file. For an in-memory database or a "TEMP" database, + /// the serialization is the same sequence of bytes which would be written + /// to disk if that database where backed up to disk. + /// + /// The usual case is that sqlite3_serialize() copies the serialization of + /// the database into memory obtained from [sqlite3_malloc64()] and returns + /// a pointer to that memory. The caller is responsible for freeing the + /// returned value to avoid a memory leak. However, if the F argument + /// contains the SQLITE_SERIALIZE_NOCOPY bit, then no memory allocations + /// are made, and the sqlite3_serialize() function will return a pointer + /// to the contiguous memory representation of the database that SQLite + /// is currently using for that database, or NULL if the no such contiguous + /// memory representation of the database exists. A contiguous memory + /// representation of the database will usually only exist if there has + /// been a prior call to [sqlite3_deserialize(D,S,...)] with the same + /// values of D and S. + /// The size of the database is written into *P even if the + /// SQLITE_SERIALIZE_NOCOPY bit is set but no contiguous copy + /// of the database exists. + /// + /// A call to sqlite3_serialize(D,S,P,F) might return NULL even if the + /// SQLITE_SERIALIZE_NOCOPY bit is omitted from argument F if a memory + /// allocation error occurs. + /// + /// This interface is only available if SQLite is compiled with the + /// [SQLITE_ENABLE_DESERIALIZE] option. ffi.Pointer sqlite3_serialize( ffi.Pointer db, ffi.Pointer zSchema, @@ -4012,6 +8899,33 @@ class SQLite { _dart_sqlite3_serialize _sqlite3_serialize; + /// CAPI3REF: Deserialize a database + /// + /// The sqlite3_deserialize(D,S,P,N,M,F) interface causes the + /// [database connection] D to disconnect from database S and then + /// reopen S as an in-memory database based on the serialization contained + /// in P. The serialized database P is N bytes in size. M is the size of + /// the buffer P, which might be larger than N. If M is larger than N, and + /// the SQLITE_DESERIALIZE_READONLY bit is not set in F, then SQLite is + /// permitted to add content to the in-memory database as long as the total + /// size does not exceed M bytes. + /// + /// If the SQLITE_DESERIALIZE_FREEONCLOSE bit is set in F, then SQLite will + /// invoke sqlite3_free() on the serialization buffer when the database + /// connection closes. If the SQLITE_DESERIALIZE_RESIZEABLE bit is set, then + /// SQLite will try to increase the buffer size using sqlite3_realloc64() + /// if writes on the database cause it to grow larger than M bytes. + /// + /// The sqlite3_deserialize() interface will fail with SQLITE_BUSY if the + /// database is currently in a read transaction or is involved in a backup + /// operation. + /// + /// If sqlite3_deserialize(D,S,P,N,M,F) fails for any reason and if the + /// SQLITE_DESERIALIZE_FREEONCLOSE bit is set in argument F, then + /// [sqlite3_free()] is invoked on argument P prior to returning. + /// + /// This interface is only available if SQLite is compiled with the + /// [SQLITE_ENABLE_DESERIALIZE] option. int sqlite3_deserialize( ffi.Pointer db, ffi.Pointer zSchema, @@ -4034,6 +8948,10 @@ class SQLite { _dart_sqlite3_deserialize _sqlite3_deserialize; + /// Register a geometry callback named zGeom that can be used as part of an + /// R-Tree geometry query as follows: + /// + /// SELECT ... FROM WHERE MATCH $zGeom(... params ...) int sqlite3_rtree_geometry_callback( ffi.Pointer db, ffi.Pointer zGeom, @@ -4054,6 +8972,10 @@ class SQLite { _dart_sqlite3_rtree_geometry_callback _sqlite3_rtree_geometry_callback; + /// Register a 2nd-generation geometry callback named zScore that can be + /// used as part of an R-Tree geometry query as follows: + /// + /// SELECT ... FROM WHERE MATCH $zQueryFunc(... params ...) int sqlite3_rtree_query_callback( ffi.Pointer db, ffi.Pointer zQueryFunc, @@ -4108,6 +9030,7 @@ class sqlite3_io_methods extends ffi.Struct { ffi.Pointer> xDeviceCharacteristics; + /// Methods above are valid for version 1 ffi.Pointer> xShmMap; ffi.Pointer> xShmLock; @@ -4116,6 +9039,7 @@ class sqlite3_io_methods extends ffi.Struct { ffi.Pointer> xShmUnmap; + /// Methods above are valid for version 2 ffi.Pointer> xFetch; ffi.Pointer> xUnfetch; @@ -4135,12 +9059,157 @@ class sqlite3_value extends ffi.Struct {} class sqlite3_context extends ffi.Struct {} +/// CAPI3REF: Virtual Table Instance Object +/// KEYWORDS: sqlite3_vtab +/// +/// Every [virtual table module] implementation uses a subclass +/// of this object to describe a particular instance +/// of the [virtual table]. Each subclass will +/// be tailored to the specific needs of the module implementation. +/// The purpose of this superclass is to define certain fields that are +/// common to all module implementations. +/// +/// ^Virtual tables methods can set an error message by assigning a +/// string obtained from [sqlite3_mprintf()] to zErrMsg. The method should +/// take care that any prior string is freed by a call to [sqlite3_free()] +/// prior to assigning a new string to zErrMsg. ^After the error message +/// is delivered up to the client application, the string will be automatically +/// freed by sqlite3_free() and the zErrMsg field will be zeroed. class sqlite3_vtab extends ffi.Struct {} +/// CAPI3REF: Virtual Table Indexing Information +/// KEYWORDS: sqlite3_index_info +/// +/// The sqlite3_index_info structure and its substructures is used as part +/// of the [virtual table] interface to +/// pass information into and receive the reply from the [xBestIndex] +/// method of a [virtual table module]. The fields under **Inputs** are the +/// inputs to xBestIndex and are read-only. xBestIndex inserts its +/// results into the **Outputs** fields. +/// +/// ^(The aConstraint[] array records WHERE clause constraints of the form: +/// +///
column OP expr
+/// +/// where OP is =, <, <=, >, or >=.)^ ^(The particular operator is +/// stored in aConstraint[].op using one of the +/// [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ +/// ^(The index of the column is stored in +/// aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the +/// expr on the right-hand side can be evaluated (and thus the constraint +/// is usable) and false if it cannot.)^ +/// +/// ^The optimizer automatically inverts terms of the form "expr OP column" +/// and makes other simplifications to the WHERE clause in an attempt to +/// get as many WHERE clause terms into the form shown above as possible. +/// ^The aConstraint[] array only reports WHERE clause terms that are +/// relevant to the particular virtual table being queried. +/// +/// ^Information about the ORDER BY clause is stored in aOrderBy[]. +/// ^Each term of aOrderBy records a column of the ORDER BY clause. +/// +/// The colUsed field indicates which columns of the virtual table may be +/// required by the current scan. Virtual table columns are numbered from +/// zero in the order in which they appear within the CREATE TABLE statement +/// passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), +/// the corresponding bit is set within the colUsed mask if the column may be +/// required by SQLite. If the table has at least 64 columns and any column +/// to the right of the first 63 is required, then bit 63 of colUsed is also +/// set. In other words, column iCol may be required if the expression +/// (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to +/// non-zero. +/// +/// The [xBestIndex] method must fill aConstraintUsage[] with information +/// about what parameters to pass to xFilter. ^If argvIndex>0 then +/// the right-hand side of the corresponding aConstraint[] is evaluated +/// and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit +/// is true, then the constraint is assumed to be fully handled by the +/// virtual table and might not be checked again by the byte code.)^ ^(The +/// aConstraintUsage[].omit flag is an optimization hint. When the omit flag +/// is left in its default setting of false, the constraint will always be +/// checked separately in byte code. If the omit flag is change to true, then +/// the constraint may or may not be checked in byte code. In other words, +/// when the omit flag is true there is no guarantee that the constraint will +/// not be checked again using byte code.)^ +/// +/// ^The idxNum and idxPtr values are recorded and passed into the +/// [xFilter] method. +/// ^[sqlite3_free()] is used to free idxPtr if and only if +/// needToFreeIdxPtr is true. +/// +/// ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in +/// the correct order to satisfy the ORDER BY clause so that no separate +/// sorting step is required. +/// +/// ^The estimatedCost value is an estimate of the cost of a particular +/// strategy. A cost of N indicates that the cost of the strategy is similar +/// to a linear scan of an SQLite table with N rows. A cost of log(N) +/// indicates that the expense of the operation is similar to that of a +/// binary search on a unique indexed field of an SQLite table with N rows. +/// +/// ^The estimatedRows value is an estimate of the number of rows that +/// will be returned by the strategy. +/// +/// The xBestIndex method may optionally populate the idxFlags field with a +/// mask of SQLITE_INDEX_SCAN_* flags. Currently there is only one such flag - +/// SQLITE_INDEX_SCAN_UNIQUE. If the xBestIndex method sets this flag, SQLite +/// assumes that the strategy may visit at most one row. +/// +/// Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then +/// SQLite also assumes that if a call to the xUpdate() method is made as +/// part of the same statement to delete or update a virtual table row and the +/// implementation returns SQLITE_CONSTRAINT, then there is no need to rollback +/// any database changes. In other words, if the xUpdate() returns +/// SQLITE_CONSTRAINT, the database contents must be exactly as they were +/// before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not +/// set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by +/// the xUpdate method are automatically rolled back by SQLite. +/// +/// IMPORTANT: The estimatedRows field was added to the sqlite3_index_info +/// structure for SQLite [version 3.8.2] ([dateof:3.8.2]). +/// If a virtual table extension is +/// used with an SQLite version earlier than 3.8.2, the results of attempting +/// to read or write the estimatedRows field are undefined (but are likely +/// to include crashing the application). The estimatedRows field should +/// therefore only be used if [sqlite3_libversion_number()] returns a +/// value greater than or equal to 3008002. Similarly, the idxFlags field +/// was added for [version 3.9.0] ([dateof:3.9.0]). +/// It may therefore only be used if +/// sqlite3_libversion_number() returns a value greater than or equal to +/// 3009000. class sqlite3_index_info extends ffi.Struct {} +/// CAPI3REF: Virtual Table Cursor Object +/// KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} +/// +/// Every [virtual table module] implementation uses a subclass of the +/// following structure to describe cursors that point into the +/// [virtual table] and are used +/// to loop through the virtual table. Cursors are created using the +/// [sqlite3_module.xOpen | xOpen] method of the module and are destroyed +/// by the [sqlite3_module.xClose | xClose] method. Cursors are used +/// by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods +/// of the module. Each module implementation will define +/// the content of a cursor structure to suit its own needs. +/// +/// This superclass exists in order to define fields of the cursor that +/// are common to all implementations. class sqlite3_vtab_cursor extends ffi.Struct {} +/// CAPI3REF: Virtual Table Object +/// KEYWORDS: sqlite3_module {virtual table module} +/// +/// This structure, sometimes called a "virtual table module", +/// defines the implementation of a [virtual table]. +/// This structure consists mostly of methods for the module. +/// +/// ^A virtual table module is created by filling in a persistent +/// instance of this structure and passing a pointer to that instance +/// to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. +/// ^The registration remains valid until it is replaced by a different +/// module or until the [database connection] closes. The content +/// of this structure must not change while it is registered with +/// any database connection. class sqlite3_module extends ffi.Struct {} class sqlite3_blob extends ffi.Struct {} @@ -4159,6 +9228,24 @@ class sqlite3_pcache_methods extends ffi.Struct {} class sqlite3_backup extends ffi.Struct {} +/// CAPI3REF: Database Snapshot +/// KEYWORDS: {snapshot} {sqlite3_snapshot} +/// +/// An instance of the snapshot object records the state of a [WAL mode] +/// database for some specific point in history. +/// +/// In [WAL mode], multiple [database connections] that are open on the +/// same database file can each be reading a different historical version +/// of the database file. When a [database connection] begins a read +/// transaction, that connection sees an unchanging copy of the database +/// as it existed for the point in time when the transaction first started. +/// Subsequent changes to the database from other connections are not seen +/// by the reader until a new read transaction is started. +/// +/// The sqlite3_snapshot object records state information about an historical +/// version of the database file so that it is possible to later open a new read +/// transaction that sees that historical version of the database rather than +/// the most recent version. class sqlite3_snapshot extends ffi.Struct { @ffi.Uint8() int _unique_hidden_item_0; @@ -4535,10 +9622,228 @@ class ArrayHelper_sqlite3_snapshot_hidden_level0 { } } +/// A pointer to a structure of the following type is passed as the first +/// argument to callbacks registered using rtree_geometry_callback(). class sqlite3_rtree_geometry extends ffi.Struct {} +/// A pointer to a structure of the following type is passed as the +/// argument to scored geometry callback registered using +/// sqlite3_rtree_query_callback(). +/// +/// Note that the first 5 fields of this structure are identical to +/// sqlite3_rtree_geometry. This structure is a subclass of +/// sqlite3_rtree_geometry. class sqlite3_rtree_query_info extends ffi.Struct {} +/// EXTENSION API FUNCTIONS +/// +/// xUserData(pFts): +/// Return a copy of the context pointer the extension function was +/// registered with. +/// +/// xColumnTotalSize(pFts, iCol, pnToken): +/// If parameter iCol is less than zero, set output variable *pnToken +/// to the total number of tokens in the FTS5 table. Or, if iCol is +/// non-negative but less than the number of columns in the table, return +/// the total number of tokens in column iCol, considering all rows in +/// the FTS5 table. +/// +/// If parameter iCol is greater than or equal to the number of columns +/// in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. +/// an OOM condition or IO error), an appropriate SQLite error code is +/// returned. +/// +/// xColumnCount(pFts): +/// Return the number of columns in the table. +/// +/// xColumnSize(pFts, iCol, pnToken): +/// If parameter iCol is less than zero, set output variable *pnToken +/// to the total number of tokens in the current row. Or, if iCol is +/// non-negative but less than the number of columns in the table, set +/// *pnToken to the number of tokens in column iCol of the current row. +/// +/// If parameter iCol is greater than or equal to the number of columns +/// in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. +/// an OOM condition or IO error), an appropriate SQLite error code is +/// returned. +/// +/// This function may be quite inefficient if used with an FTS5 table +/// created with the "columnsize=0" option. +/// +/// xColumnText: +/// This function attempts to retrieve the text of column iCol of the +/// current document. If successful, (*pz) is set to point to a buffer +/// containing the text in utf-8 encoding, (*pn) is set to the size in bytes +/// (not characters) of the buffer and SQLITE_OK is returned. Otherwise, +/// if an error occurs, an SQLite error code is returned and the final values +/// of (*pz) and (*pn) are undefined. +/// +/// xPhraseCount: +/// Returns the number of phrases in the current query expression. +/// +/// xPhraseSize: +/// Returns the number of tokens in phrase iPhrase of the query. Phrases +/// are numbered starting from zero. +/// +/// xInstCount: +/// Set *pnInst to the total number of occurrences of all phrases within +/// the query within the current row. Return SQLITE_OK if successful, or +/// an error code (i.e. SQLITE_NOMEM) if an error occurs. +/// +/// This API can be quite slow if used with an FTS5 table created with the +/// "detail=none" or "detail=column" option. If the FTS5 table is created +/// with either "detail=none" or "detail=column" and "content=" option +/// (i.e. if it is a contentless table), then this API always returns 0. +/// +/// xInst: +/// Query for the details of phrase match iIdx within the current row. +/// Phrase matches are numbered starting from zero, so the iIdx argument +/// should be greater than or equal to zero and smaller than the value +/// output by xInstCount(). +/// +/// Usually, output parameter *piPhrase is set to the phrase number, *piCol +/// to the column in which it occurs and *piOff the token offset of the +/// first token of the phrase. Returns SQLITE_OK if successful, or an error +/// code (i.e. SQLITE_NOMEM) if an error occurs. +/// +/// This API can be quite slow if used with an FTS5 table created with the +/// "detail=none" or "detail=column" option. +/// +/// xRowid: +/// Returns the rowid of the current row. +/// +/// xTokenize: +/// Tokenize text using the tokenizer belonging to the FTS5 table. +/// +/// xQueryPhrase(pFts5, iPhrase, pUserData, xCallback): +/// This API function is used to query the FTS table for phrase iPhrase +/// of the current query. Specifically, a query equivalent to: +/// +/// ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid +/// +/// with $p set to a phrase equivalent to the phrase iPhrase of the +/// current query is executed. Any column filter that applies to +/// phrase iPhrase of the current query is included in $p. For each +/// row visited, the callback function passed as the fourth argument +/// is invoked. The context and API objects passed to the callback +/// function may be used to access the properties of each matched row. +/// Invoking Api.xUserData() returns a copy of the pointer passed as +/// the third argument to pUserData. +/// +/// If the callback function returns any value other than SQLITE_OK, the +/// query is abandoned and the xQueryPhrase function returns immediately. +/// If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK. +/// Otherwise, the error code is propagated upwards. +/// +/// If the query runs to completion without incident, SQLITE_OK is returned. +/// Or, if some error occurs before the query completes or is aborted by +/// the callback, an SQLite error code is returned. +/// +/// +/// xSetAuxdata(pFts5, pAux, xDelete) +/// +/// Save the pointer passed as the second argument as the extension function's +/// "auxiliary data". The pointer may then be retrieved by the current or any +/// future invocation of the same fts5 extension function made as part of +/// the same MATCH query using the xGetAuxdata() API. +/// +/// Each extension function is allocated a single auxiliary data slot for +/// each FTS query (MATCH expression). If the extension function is invoked +/// more than once for a single FTS query, then all invocations share a +/// single auxiliary data context. +/// +/// If there is already an auxiliary data pointer when this function is +/// invoked, then it is replaced by the new pointer. If an xDelete callback +/// was specified along with the original pointer, it is invoked at this +/// point. +/// +/// The xDelete callback, if one is specified, is also invoked on the +/// auxiliary data pointer after the FTS5 query has finished. +/// +/// If an error (e.g. an OOM condition) occurs within this function, +/// the auxiliary data is set to NULL and an error code returned. If the +/// xDelete parameter was not NULL, it is invoked on the auxiliary data +/// pointer before returning. +/// +/// +/// xGetAuxdata(pFts5, bClear) +/// +/// Returns the current auxiliary data pointer for the fts5 extension +/// function. See the xSetAuxdata() method for details. +/// +/// If the bClear argument is non-zero, then the auxiliary data is cleared +/// (set to NULL) before this function returns. In this case the xDelete, +/// if any, is not invoked. +/// +/// +/// xRowCount(pFts5, pnRow) +/// +/// This function is used to retrieve the total number of rows in the table. +/// In other words, the same value that would be returned by: +/// +/// SELECT count(*) FROM ftstable; +/// +/// xPhraseFirst() +/// This function is used, along with type Fts5PhraseIter and the xPhraseNext +/// method, to iterate through all instances of a single query phrase within +/// the current row. This is the same information as is accessible via the +/// xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient +/// to use, this API may be faster under some circumstances. To iterate +/// through instances of phrase iPhrase, use the following code: +/// +/// Fts5PhraseIter iter; +/// int iCol, iOff; +/// for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff); +/// iCol>=0; +/// pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) +/// ){ +/// // An instance of phrase iPhrase at offset iOff of column iCol +/// } +/// +/// The Fts5PhraseIter structure is defined above. Applications should not +/// modify this structure directly - it should only be used as shown above +/// with the xPhraseFirst() and xPhraseNext() API methods (and by +/// xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). +/// +/// This API can be quite slow if used with an FTS5 table created with the +/// "detail=none" or "detail=column" option. If the FTS5 table is created +/// with either "detail=none" or "detail=column" and "content=" option +/// (i.e. if it is a contentless table), then this API always iterates +/// through an empty set (all calls to xPhraseFirst() set iCol to -1). +/// +/// xPhraseNext() +/// See xPhraseFirst above. +/// +/// xPhraseFirstColumn() +/// This function and xPhraseNextColumn() are similar to the xPhraseFirst() +/// and xPhraseNext() APIs described above. The difference is that instead +/// of iterating through all instances of a phrase in the current row, these +/// APIs are used to iterate through the set of columns in the current row +/// that contain one or more instances of a specified phrase. For example: +/// +/// Fts5PhraseIter iter; +/// int iCol; +/// for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol); +/// iCol>=0; +/// pApi->xPhraseNextColumn(pFts, &iter, &iCol) +/// ){ +/// // Column iCol contains at least one instance of phrase iPhrase +/// } +/// +/// This API can be quite slow if used with an FTS5 table created with the +/// "detail=none" option. If the FTS5 table is created with either +/// "detail=none" "content=" option (i.e. if it is a contentless table), +/// then this API always iterates through an empty set (all calls to +/// xPhraseFirstColumn() set iCol to -1). +/// +/// The information accessed using this API and its companion +/// xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext +/// (or xInst/xInstCount). The chief advantage of this API is that it is +/// significantly more efficient than those alternatives when used with +/// "detail=column" tables. +/// +/// xPhraseNextColumn() +/// See xPhraseFirstColumn above. class Fts5ExtensionApi extends ffi.Struct {} class Fts5Context extends ffi.Struct {} diff --git a/pkgs/ffigen/test/large_integration_tests/large_test.dart b/pkgs/ffigen/test/large_integration_tests/large_test.dart index 79d4a888dc..542b3ce72a 100644 --- a/pkgs/ffigen/test/large_integration_tests/large_test.dart +++ b/pkgs/ffigen/test/large_integration_tests/large_test.dart @@ -26,6 +26,9 @@ ${strings.description}: Bindings to LibClang. ${strings.output}: unused ${strings.compilerOpts}: -I${path.join('third_party', 'libclang', 'include')} ${strings.arrayWorkaround}: true +${strings.comments}: + ${strings.style}: ${strings.doxygen} + ${strings.length}: ${strings.brief} ${strings.headers}: - third_party/libclang/include/clang-c/Index.h ${strings.headerFilter}: @@ -64,7 +67,8 @@ ${strings.headerFilter}: ${strings.name}: CJson ${strings.description}: Bindings to Cjson. ${strings.output}: unused -${strings.comments}: full +${strings.comments}: + ${strings.length}: ${strings.full} ${strings.arrayWorkaround}: true ${strings.headers}: - third_party/cjson_library/cJSON.h @@ -101,7 +105,9 @@ ${strings.name}: SQLite ${strings.description}: Bindings to SQLite. ${strings.output}: unused ${strings.arrayWorkaround}: true -${strings.comments}: full +${strings.comments}: + ${strings.style}: ${strings.any} + ${strings.length}: ${strings.full} ${strings.headers}: - third_party/sqlite/sqlite3.h ${strings.headerFilter}: From be939f4bf6be929dcdebcfa94bd81e0c934d0605 Mon Sep 17 00:00:00 2001 From: Prerak Mann <31154435+mannprerak2@users.noreply.github.com> Date: Tue, 28 Jul 2020 16:57:28 +0530 Subject: [PATCH 022/276] [ffigen] Added support for parsing macros and anonymous unnamed enums (#35) closes #12, closes #50 - Support for parsing macros and anonymous unnamed enums. - These are generated as top-level constants. - unnamed enums can be disabled by using `unnamed-enums: false`, default is `true`. --- pkgs/ffigen/CHANGELOG.md | 3 + pkgs/ffigen/README.md | 31 +- .../c_json/cjson_generated_bindings.dart | 32 + .../libclang-example/generated_bindings.dart | 8 + pkgs/ffigen/lib/src/clang_library/wrapper.c | 25 + pkgs/ffigen/lib/src/clang_library/wrapper.def | 5 + .../lib/src/code_generator/constant.dart | 8 +- .../lib/src/config_provider/config.dart | 24 + .../clang_bindings/clang_bindings.dart | 267 ++++++ .../lib/src/header_parser/includer.dart | 28 + pkgs/ffigen/lib/src/header_parser/parser.dart | 12 +- .../sub_parsers/enumdecl_parser.dart | 11 +- .../sub_parsers/macro_parser.dart | 238 +++++ .../sub_parsers/unnamed_enumdecl_parser.dart | 68 ++ .../translation_unit_parser.dart | 4 + pkgs/ffigen/lib/src/strings.dart | 4 +- pkgs/ffigen/pubspec.yaml | 2 +- pkgs/ffigen/test/code_generator_test.dart | 8 +- .../decl_decl_collision_test.dart | 24 + .../reserved_keyword_collision_test.dart | 10 + pkgs/ffigen/test/header_parser_tests/macros.h | 16 + .../test/header_parser_tests/macros_test.dart | 85 ++ .../test/header_parser_tests/unnamed_enums.h | 13 + .../unnamed_enums_test.dart | 81 ++ .../_expected_cjson_bindings.dart | 32 + .../_expected_libclang_bindings.dart | 8 + .../_expected_sqlite_bindings.dart | 881 ++++++++++++++++++ pkgs/ffigen/test/prefix_tests/prefix.h | 3 + .../ffigen/test/prefix_tests/prefix_test.dart | 29 + pkgs/ffigen/tool/libclang_config.yaml | 12 + 30 files changed, 1938 insertions(+), 34 deletions(-) create mode 100644 pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart create mode 100644 pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/macros.h create mode 100644 pkgs/ffigen/test/header_parser_tests/macros_test.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/unnamed_enums.h create mode 100644 pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index bf34d90d50..9a327920bb 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.1.5 +- Added support for parsing macros and anonymous unnamed enums. These are generated as top level constants. + # 0.1.4 - Comments config now has a style and length sub keys - `style: doxygen(default) | any`, `length: brief | full(default)`, and can be disabled by passing `comments: false`. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 4bf4abd67e..604a1bc182 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -63,21 +63,18 @@ The following configuration options are available- Key - Required Explaination Example - output - yes + output
(Required) Output path of the generated bindings.
output: 'generated_bindings.dart'
- headers - yes + headers
(Required) List of C headers to use. Glob syntax is allowed.

 headers:
@@ -86,7 +83,6 @@ headers:
   
   
     header-filter
-    no
     Name of headers to include/exclude.
     

 header-filter:
@@ -95,26 +91,22 @@ header-filter:
     - 'platform.h'
- name - prefer + name
(Prefer) Name of generated class.
name: 'SQLite'
- description - prefer + description
(Prefer) Dart Doc for generated class.
description: 'Bindings to SQLite'
compiler-opts - no Pass compiler options to clang.
compiler-opts: '-I/usr/lib/llvm-9/include/'
- functions
structs
enums - no + functions
structs
enums
macros Filters for declarations.
Default: all are included

 functions:
@@ -132,7 +124,6 @@ functions:
   
   
     array-workaround
-    no
     Should generate workaround for fixed arrays in Structs. See Array Workaround
Default: false @@ -140,7 +131,6 @@ functions: comments - no Extract documentation comments for declarations.
The style and length of the comments can be specified with the following options.
style: doxygen(default) | any
@@ -156,7 +146,6 @@ comments: sort - no Sort the bindings according to name.
Default: false, i.e keep the order as in the source files. @@ -164,15 +153,20 @@ comments: use-supported-typedefs - no Should automatically map typedefs, E.g uint8_t => Uint8, int16_t => Int16 etc.
Default: true
use-supported-typedefs: true
+ + + unnamed-enums + Should generate constants for anonymous unnamed enums.
+ Default: true + +
unnamed-enums: true
preamble - no Raw header of the file, pasted as-it-is.

 preamble: |
@@ -182,7 +176,6 @@ preamble: |
   
   
     size-map
-    no
     Size of integers to use (in bytes).
The defaults (see example) may not be portable on all OS. Do not change these unless absolutely sure. diff --git a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart index 25900b1fa3..7c41b0fbbc 100644 --- a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart +++ b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart @@ -1063,6 +1063,38 @@ class cJSON_Hooks extends ffi.Struct { ffi.Pointer> free_fn; } +const int CJSON_VERSION_MAJOR = 1; + +const int CJSON_VERSION_MINOR = 7; + +const int CJSON_VERSION_PATCH = 12; + +const int cJSON_Invalid = 0; + +const int cJSON_False = 1; + +const int cJSON_True = 2; + +const int cJSON_NULL = 4; + +const int cJSON_Number = 8; + +const int cJSON_String = 16; + +const int cJSON_Array = 32; + +const int cJSON_Object = 64; + +const int cJSON_Raw = 128; + +const int cJSON_IsReference = 256; + +const int cJSON_StringIsConst = 512; + +const int CJSON_NESTING_LIMIT = 1000; + +const double CJSON_DOUBLE_PRECISION = 1e-16; + typedef _c_cJSON_Version = ffi.Pointer Function(); typedef _dart_cJSON_Version = ffi.Pointer Function(); diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index bd5b8cec57..61483316c4 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -3293,6 +3293,14 @@ class IndexerCallbacks extends ffi.Struct { 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_disposeStringSet = ffi.Void Function( ffi.Pointer set_1, ); diff --git a/pkgs/ffigen/lib/src/clang_library/wrapper.c b/pkgs/ffigen/lib/src/clang_library/wrapper.c index 978b7e76be..c43c7f60eb 100644 --- a/pkgs/ffigen/lib/src/clang_library/wrapper.c +++ b/pkgs/ffigen/lib/src/clang_library/wrapper.c @@ -333,4 +333,29 @@ CXType *clang_getArrayElementType_wrap(CXType *cxtype) return ptrToCXType(clang_getArrayElementType(*cxtype)); } +unsigned clang_Cursor_isMacroFunctionLike_wrap(CXCursor *cursor) +{ + return clang_Cursor_isMacroFunctionLike(*cursor); +} + +unsigned clang_Cursor_isMacroBuiltin_wrap(CXCursor *cursor) +{ + return clang_Cursor_isMacroBuiltin(*cursor); +} + +CXEvalResult clang_Cursor_Evaluate_wrap(CXCursor *cursor) +{ + return clang_Cursor_Evaluate(*cursor); +} + +unsigned clang_Cursor_isAnonymous_wrap(CXCursor *cursor) +{ + return clang_Cursor_isAnonymous(*cursor); +} + +unsigned clang_Cursor_isAnonymousRecordDecl_wrap(CXCursor *cursor) +{ + return clang_Cursor_isAnonymousRecordDecl(*cursor); +} + // END ===== WRAPPER FUNCTIONS ===================== diff --git a/pkgs/ffigen/lib/src/clang_library/wrapper.def b/pkgs/ffigen/lib/src/clang_library/wrapper.def index 5a10727eed..c82231ff36 100644 --- a/pkgs/ffigen/lib/src/clang_library/wrapper.def +++ b/pkgs/ffigen/lib/src/clang_library/wrapper.def @@ -353,3 +353,8 @@ clang_getFileLocation_wrap clang_getFileName_wrap clang_getNumElements_wrap clang_getArrayElementType_wrap +clang_Cursor_isMacroFunctionLike_wrap +clang_Cursor_isMacroBuiltin_wrap +clang_Cursor_Evaluate_wrap +clang_Cursor_isAnonymous_wrap +clang_Cursor_isAnonymousRecordDecl_wrap diff --git a/pkgs/ffigen/lib/src/code_generator/constant.dart b/pkgs/ffigen/lib/src/code_generator/constant.dart index 6af8a6de23..b5521adfce 100644 --- a/pkgs/ffigen/lib/src/code_generator/constant.dart +++ b/pkgs/ffigen/lib/src/code_generator/constant.dart @@ -7,7 +7,6 @@ import 'package:meta/meta.dart'; import 'binding.dart'; import 'binding_string.dart'; -import 'type.dart'; import 'utils.dart'; import 'writer.dart'; @@ -23,7 +22,8 @@ import 'writer.dart'; /// const int name = 10; /// ``` class Constant extends NoLookUpBinding { - final Type type; + /// The rawType is pasted as it is. E.g 'int', 'String', 'double' + final String rawType; /// The rawValue is pasted as it is. /// @@ -34,7 +34,7 @@ class Constant extends NoLookUpBinding { String originalName, @required String name, String dartDoc, - @required this.type, + @required this.rawType, @required this.rawValue, }) : super(originalName: originalName ?? name, name: name, dartDoc: dartDoc); @@ -47,7 +47,7 @@ class Constant extends NoLookUpBinding { s.write(makeDartDoc(dartDoc)); } - s.write('const ${type.getDartType(w)} $constantName = $rawValue;\n\n'); + s.write('const ${rawType} $constantName = $rawValue;\n\n'); return BindingString( type: BindingStringType.constant, string: s.toString()); diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 0f872f9489..eb75b8068b 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -43,6 +43,9 @@ class Config { /// Declaration config for Enums. Declaration enumClassDecl; + /// Declaration config for Enums. + Declaration macroDecl; + /// If generated bindings should be sorted alphabetically. bool sort; @@ -58,6 +61,9 @@ class Config { /// members removed. bool arrayWorkaround; + /// If constants should be generated for unnamed enums. + bool unnamedEnums; + /// Name of the wrapper class. String wrapperName; @@ -189,6 +195,16 @@ class Config { enumClassDecl = result as Declaration; }, ), + strings.macros: Specification( + description: 'Filter for macros', + requirement: Requirement.no, + validator: declarationConfigValidator, + extractor: declarationConfigExtractor, + defaultValue: () => Declaration(), + extractedResult: (dynamic result) { + macroDecl = result as Declaration; + }, + ), strings.sizemap: Specification>( description: 'map of types: byte size in int', validator: sizemapValidator, @@ -238,6 +254,14 @@ class Config { defaultValue: () => false, extractedResult: (dynamic result) => arrayWorkaround = result as bool, ), + strings.unnamedEnums: Specification( + description: 'whether or not to generate constants for unnamed enums.', + requirement: Requirement.no, + validator: booleanValidator, + extractor: booleanExtractor, + defaultValue: () => true, + extractedResult: (dynamic result) => unnamedEnums = result as bool, + ), strings.name: Specification( description: 'Name of the wrapper class', requirement: Requirement.prefer, diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index afdf041b70..61fe3d866b 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -174,6 +174,97 @@ class Clang { _dart_clang_disposeTranslationUnit _clang_disposeTranslationUnit; + /// Returns the kind of the evaluated result. + int clang_EvalResult_getKind( + ffi.Pointer E, + ) { + _clang_EvalResult_getKind ??= _dylib.lookupFunction< + _c_clang_EvalResult_getKind, + _dart_clang_EvalResult_getKind>('clang_EvalResult_getKind'); + return _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, + ) { + _clang_EvalResult_getAsInt ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsInt, + _dart_clang_EvalResult_getAsInt>('clang_EvalResult_getAsInt'); + return _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, + ) { + _clang_EvalResult_getAsLongLong ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsLongLong, + _dart_clang_EvalResult_getAsLongLong>('clang_EvalResult_getAsLongLong'); + return _clang_EvalResult_getAsLongLong( + E, + ); + } + + _dart_clang_EvalResult_getAsLongLong _clang_EvalResult_getAsLongLong; + + /// Returns the evaluation result as double if the + /// kind is double. + double clang_EvalResult_getAsDouble( + ffi.Pointer E, + ) { + _clang_EvalResult_getAsDouble ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsDouble, + _dart_clang_EvalResult_getAsDouble>('clang_EvalResult_getAsDouble'); + return _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, + ) { + _clang_EvalResult_getAsStr ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsStr, + _dart_clang_EvalResult_getAsStr>('clang_EvalResult_getAsStr'); + return _clang_EvalResult_getAsStr( + E, + ); + } + + _dart_clang_EvalResult_getAsStr _clang_EvalResult_getAsStr; + + /// Disposes the created Eval memory. + void clang_EvalResult_dispose( + ffi.Pointer E, + ) { + _clang_EvalResult_dispose ??= _dylib.lookupFunction< + _c_clang_EvalResult_dispose, + _dart_clang_EvalResult_dispose>('clang_EvalResult_dispose'); + return _clang_EvalResult_dispose( + E, + ); + } + + _dart_clang_EvalResult_dispose _clang_EvalResult_dispose; + ffi.Pointer clang_getCString_wrap( ffi.Pointer string, ) { @@ -612,6 +703,76 @@ class Clang { } _dart_clang_getArrayElementType_wrap _clang_getArrayElementType_wrap; + + int clang_Cursor_isMacroFunctionLike_wrap( + ffi.Pointer cursor, + ) { + _clang_Cursor_isMacroFunctionLike_wrap ??= _dylib.lookupFunction< + _c_clang_Cursor_isMacroFunctionLike_wrap, + _dart_clang_Cursor_isMacroFunctionLike_wrap>( + 'clang_Cursor_isMacroFunctionLike_wrap'); + return _clang_Cursor_isMacroFunctionLike_wrap( + cursor, + ); + } + + _dart_clang_Cursor_isMacroFunctionLike_wrap + _clang_Cursor_isMacroFunctionLike_wrap; + + int clang_Cursor_isMacroBuiltin_wrap( + ffi.Pointer cursor, + ) { + _clang_Cursor_isMacroBuiltin_wrap ??= _dylib.lookupFunction< + _c_clang_Cursor_isMacroBuiltin_wrap, + _dart_clang_Cursor_isMacroBuiltin_wrap>( + 'clang_Cursor_isMacroBuiltin_wrap'); + return _clang_Cursor_isMacroBuiltin_wrap( + cursor, + ); + } + + _dart_clang_Cursor_isMacroBuiltin_wrap _clang_Cursor_isMacroBuiltin_wrap; + + ffi.Pointer clang_Cursor_Evaluate_wrap( + ffi.Pointer cursor, + ) { + _clang_Cursor_Evaluate_wrap ??= _dylib.lookupFunction< + _c_clang_Cursor_Evaluate_wrap, + _dart_clang_Cursor_Evaluate_wrap>('clang_Cursor_Evaluate_wrap'); + return _clang_Cursor_Evaluate_wrap( + cursor, + ); + } + + _dart_clang_Cursor_Evaluate_wrap _clang_Cursor_Evaluate_wrap; + + int clang_Cursor_isAnonymous_wrap( + ffi.Pointer cursor, + ) { + _clang_Cursor_isAnonymous_wrap ??= _dylib.lookupFunction< + _c_clang_Cursor_isAnonymous_wrap, + _dart_clang_Cursor_isAnonymous_wrap>('clang_Cursor_isAnonymous_wrap'); + return _clang_Cursor_isAnonymous_wrap( + cursor, + ); + } + + _dart_clang_Cursor_isAnonymous_wrap _clang_Cursor_isAnonymous_wrap; + + int clang_Cursor_isAnonymousRecordDecl_wrap( + ffi.Pointer cursor, + ) { + _clang_Cursor_isAnonymousRecordDecl_wrap ??= _dylib.lookupFunction< + _c_clang_Cursor_isAnonymousRecordDecl_wrap, + _dart_clang_Cursor_isAnonymousRecordDecl_wrap>( + 'clang_Cursor_isAnonymousRecordDecl_wrap'); + return _clang_Cursor_isAnonymousRecordDecl_wrap( + cursor, + ); + } + + _dart_clang_Cursor_isAnonymousRecordDecl_wrap + _clang_Cursor_isAnonymousRecordDecl_wrap; } /// A character string. @@ -2012,6 +2173,24 @@ abstract class CXChildVisitResult { static const int CXChildVisit_Recurse = 2; } +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; +} + +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_createIndex = ffi.Pointer Function( ffi.Int32 excludeDeclarationsFromPCH, ffi.Int32 displayDiagnostics, @@ -2086,6 +2265,54 @@ typedef _dart_clang_disposeTranslationUnit = void Function( ffi.Pointer arg0, ); +typedef _c_clang_EvalResult_getKind = ffi.Int32 Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_getKind = int Function( + ffi.Pointer E, +); + +typedef _c_clang_EvalResult_getAsInt = ffi.Int32 Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_getAsInt = int Function( + ffi.Pointer E, +); + +typedef _c_clang_EvalResult_getAsLongLong = ffi.Int64 Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_getAsLongLong = int Function( + ffi.Pointer E, +); + +typedef _c_clang_EvalResult_getAsDouble = ffi.Double Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_getAsDouble = double Function( + ffi.Pointer E, +); + +typedef _c_clang_EvalResult_getAsStr = ffi.Pointer Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_getAsStr = ffi.Pointer Function( + ffi.Pointer E, +); + +typedef _c_clang_EvalResult_dispose = ffi.Void Function( + ffi.Pointer E, +); + +typedef _dart_clang_EvalResult_dispose = void Function( + ffi.Pointer E, +); + typedef _c_clang_getCString_wrap = ffi.Pointer Function( ffi.Pointer string, ); @@ -2369,3 +2596,43 @@ typedef _c_clang_getArrayElementType_wrap = ffi.Pointer Function( typedef _dart_clang_getArrayElementType_wrap = ffi.Pointer Function( ffi.Pointer cxtype, ); + +typedef _c_clang_Cursor_isMacroFunctionLike_wrap = ffi.Uint32 Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_Cursor_isMacroFunctionLike_wrap = int Function( + ffi.Pointer cursor, +); + +typedef _c_clang_Cursor_isMacroBuiltin_wrap = ffi.Uint32 Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_Cursor_isMacroBuiltin_wrap = int Function( + ffi.Pointer cursor, +); + +typedef _c_clang_Cursor_Evaluate_wrap = ffi.Pointer Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_Cursor_Evaluate_wrap = ffi.Pointer Function( + ffi.Pointer cursor, +); + +typedef _c_clang_Cursor_isAnonymous_wrap = ffi.Uint32 Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_Cursor_isAnonymous_wrap = int Function( + ffi.Pointer cursor, +); + +typedef _c_clang_Cursor_isAnonymousRecordDecl_wrap = ffi.Uint32 Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_Cursor_isAnonymousRecordDecl_wrap = int Function( + ffi.Pointer cursor, +); diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart index f0ab13c1c6..b00fa4f95f 100644 --- a/pkgs/ffigen/lib/src/header_parser/includer.dart +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -13,6 +13,7 @@ import 'data.dart'; Map _structs = {}; Map _functions = {}; Map _enumClass = {}; +Map _macros = {}; bool shouldIncludeStruct(String name) { if (_structs.containsKey(name) || name == '') { @@ -47,9 +48,24 @@ bool shouldIncludeEnumClass(String name) { } } +bool shouldIncludeMacro(String name) { + if (_macros.containsKey(name) || name == '') { + return false; + } else if (config.macroDecl == null || config.macroDecl.shouldInclude(name)) { + return true; + } else { + return false; + } +} + /// True if a cursor should be included based on header-filter, use for root /// declarations. bool shouldIncludeRootCursor(String sourceFile) { + // Handle null in case of system headers or macros. + if (sourceFile == null) { + return false; + } + final name = p.basename(sourceFile); if (config.headerFilter.excludedInclusionHeaders.contains(name)) { @@ -103,3 +119,15 @@ void addEnumClassToSeen(String originalName, EnumClass enumClass) { EnumClass getSeenEnumClass(String originalName) { return _enumClass[originalName]; } + +bool isSeenMacro(String originalName) { + return _macros.containsKey(originalName); +} + +void addMacroToSeen(String originalName, String macro) { + _macros[originalName] = macro; +} + +String getSeenMacro(String originalName) { + return _macros[originalName]; +} diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index bb171b35d0..6730d22708 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -7,8 +7,10 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser/sub_parsers/macro_parser.dart'; import 'package:ffigen/src/config_provider/config_types.dart'; import 'package:ffigen/src/find_resource.dart'; +import 'package:ffigen/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart'; import 'package:ffigen/src/header_parser/translation_unit_parser.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; @@ -96,7 +98,9 @@ List parseToBindings() { cmdLen, nullptr, 0, - clang_types.CXTranslationUnit_Flags.CXTranslationUnit_SkipFunctionBodies, + clang_types.CXTranslationUnit_Flags.CXTranslationUnit_SkipFunctionBodies | + clang_types.CXTranslationUnit_Flags + .CXTranslationUnit_DetailedPreprocessingRecord, ); if (tu == nullptr) { @@ -116,6 +120,12 @@ List parseToBindings() { clang.clang_disposeTranslationUnit(tu); } + // Add all saved unnamed enums. + bindings.addAll(getSavedUnNamedEnums()); + + // Parse all saved macros. + bindings.addAll(parseSavedMacros()); + if (config.compilerOpts != null) { clangCmdArgs.dispose(config.compilerOpts.length); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index 8cba1c99cd..293fa2287c 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -6,6 +6,7 @@ import 'dart:ffi'; import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/header_parser/data.dart'; +import 'package:ffigen/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart'; import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang_types; @@ -31,10 +32,16 @@ EnumClass parseEnumDeclaration( String name, }) { _stack.push(_ParsedEnum()); - final enumName = name ?? cursor.spelling(); if (enumName == '') { - _logger.finest('unnamed enum declaration'); + // Save this unnamed enum if it is anonymous (therefore not in a typedef). + if (config.unnamedEnums && + clang.clang_Cursor_isAnonymous_wrap(cursor) != 0) { + _logger.fine('Saving anonymous enum.'); + saveUnNamedEnum(cursor); + } else { + _logger.fine('Unnamed enum inside a typedef.'); + } } else if (shouldIncludeEnumClass(enumName) && !isSeenEnumClass(enumName)) { _logger.fine('++++ Adding Enum: ${cursor.completeStringRepr()}'); _stack.top.enumClass = EnumClass( diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart new file mode 100644 index 0000000000..4da1b04f46 --- /dev/null +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart @@ -0,0 +1,238 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:path/path.dart' as p; +import 'package:ffi/ffi.dart'; +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser/data.dart'; +import 'package:ffigen/src/header_parser/includer.dart'; +import 'package:logging/logging.dart'; + +import '../clang_bindings/clang_bindings.dart' as clang_types; +import '../data.dart'; +import '../utils.dart'; + +var _logger = Logger('ffigen.header_parser.macro_parser'); + +/// Saved macros, Key: prefixedName, Value originalName. +final _savedMacros = {}; + +/// Adds a macro definition to be parsed later. +void saveMacroDefinition(Pointer cursor) { + final originalMacroName = cursor.spelling(); + if (shouldIncludeMacro(originalMacroName) && + !isSeenMacro(originalMacroName) && + clang.clang_Cursor_isMacroBuiltin_wrap(cursor) == 0 && + clang.clang_Cursor_isMacroFunctionLike_wrap(cursor) == 0) { + // Parse macro only if it's not builtin or function-like. + _logger.fine( + "++++ Saved Macro '$originalMacroName' for later : ${cursor.completeStringRepr()}"); + final prefixedName = config.macroDecl.getPrefixedName(originalMacroName); + addMacroToSeen(originalMacroName, prefixedName); + _saveMacro(prefixedName, originalMacroName); + } +} + +/// Saves a macro to be parsed later. +/// +/// Macros are parsed later in [parseSavedMacros()]. +void _saveMacro(String name, String originalName) { + _savedMacros[name] = originalName; +} + +List _bindings; + +/// Macros cannot be parsed directly, so we create a new `.hpp` file in which +/// they are assigned to a variable after which their value can be determined +/// by evaluating the value of the variable. +List parseSavedMacros() { + _bindings = []; + + if (_savedMacros.keys.isEmpty) { + return _bindings; + } + + // Create a file for parsing macros; + final file = createFileForMacros(); + + final index = clang.clang_createIndex(0, 0); + Pointer> clangCmdArgs = nullptr; + var cmdLen = 0; + if (config.compilerOpts != null) { + clangCmdArgs = createDynamicStringArray(config.compilerOpts); + cmdLen = config.compilerOpts.length; + } + final tu = clang.clang_parseTranslationUnit( + index, + Utf8.toUtf8(file.path).cast(), + clangCmdArgs.cast(), + cmdLen, + nullptr, + 0, + clang_types.CXTranslationUnit_Flags.CXTranslationUnit_KeepGoing, + ); + + if (tu == nullptr) { + _logger.severe('Unable to parse Macros.'); + } else { + final rootCursor = clang.clang_getTranslationUnitCursor_wrap(tu); + + final resultCode = clang.clang_visitChildren_wrap( + rootCursor, + Pointer.fromFunction(_macroVariablevisitor, + clang_types.CXChildVisitResult.CXChildVisit_Break), + uid, + ); + + visitChildrenResultChecker(resultCode); + rootCursor.dispose(); + } + + clang.clang_disposeTranslationUnit(tu); + clang.clang_disposeIndex(index); + // Delete the temp file created for macros. + file.deleteSync(); + + return _bindings; +} + +/// Child visitor invoked on translationUnitCursor for parsing macroVariables. +int _macroVariablevisitor(Pointer cursor, + Pointer parent, Pointer clientData) { + Constant constant; + try { + if (isFromGeneratedFile(cursor) && + _macroVarNames.contains(cursor.spelling()) && + cursor.kind() == clang_types.CXCursorKind.CXCursor_VarDecl) { + final e = clang.clang_Cursor_Evaluate_wrap(cursor); + final k = clang.clang_EvalResult_getKind(e); + _logger.fine('macroVariablevisitor: ${cursor.completeStringRepr()}'); + + /// Get macro name, the variable name starts with '_'. + final macroName = MacroVariableString.decode(cursor.spelling()); + switch (k) { + case clang_types.CXEvalResultKind.CXEval_Int: + constant = Constant( + originalName: _savedMacros[macroName], + name: macroName, + rawType: 'int', + rawValue: clang.clang_EvalResult_getAsLongLong(e).toString(), + ); + break; + case clang_types.CXEvalResultKind.CXEval_Float: + constant = Constant( + originalName: _savedMacros[macroName], + name: macroName, + rawType: 'double', + rawValue: clang.clang_EvalResult_getAsDouble(e).toString(), + ); + break; + case clang_types.CXEvalResultKind.CXEval_StrLiteral: + constant = Constant( + originalName: _savedMacros[macroName], + name: macroName, + rawType: 'String', + rawValue: + "'${Utf8.fromUtf8(clang.clang_EvalResult_getAsStr(e).cast())}'", + ); + break; + } + clang.clang_EvalResult_dispose(e); + + if (constant != null) { + _bindings.add(constant); + } + } + cursor.dispose(); + parent.dispose(); + } catch (e, s) { + _logger.severe(e); + _logger.severe(s); + rethrow; + } + return clang_types.CXChildVisitResult.CXChildVisit_Continue; +} + +/// Returns true if cursor is from generated file. +bool isFromGeneratedFile(Pointer cursor) { + final s = cursor.sourceFileName(); + if (s == null || s.isEmpty) { + return false; + } else { + return p.basename(s) == _generatedFileBaseName; + } +} + +/// Base name of generated file. +String _generatedFileBaseName; + +/// Generated macro variable names. +/// +/// Used to determine if macro should be included in bindings or not. +Set _macroVarNames = {}; + +/// Creates a temporary file for parsing macros in current directory. +File createFileForMacros() { + final fileNameBase = 'temp_for_macros'; + final fileExt = 'hpp'; + + // Find a filename which doesn't already exist. + var file = File('$fileNameBase.$fileExt'); + var i = 0; + while (file.existsSync()) { + i++; + file = File('${fileNameBase.split('.')[0]}_$i.$fileExt'); + } + + // Create file. + file.createSync(); + // Save generted name. + _generatedFileBaseName = p.basename(file.path); + + // Write file contents. + final sb = StringBuffer(); + for (final h in config.headers) { + sb.writeln('#include "$h"'); + } + + _macroVarNames = {}; + for (final prefixedMacroName in _savedMacros.keys) { + // Write macro. + final macroVarName = MacroVariableString.encode(prefixedMacroName); + sb.writeln('auto ${macroVarName} = ${_savedMacros[prefixedMacroName]};'); + // Add to _macroVarNames. + _macroVarNames.add(macroVarName); + } + final macroFileContent = sb.toString(); + // Log this generated file for debugging purpose. + // We use the finest log because this file may be very big. + _logger.finest('=====FILE FOR MACROS===='); + _logger.finest(macroFileContent); + _logger.finest('========================'); + + file.writeAsStringSync(macroFileContent); + return file; +} + +/// Deals with encoding/decoding name of the variable generated for a Macro. +class MacroVariableString { + static String encode(String s) { + return '_${s.length}_${s}_generated_macro_variable'; + } + + static String decode(String s) { + // Remove underscore. + s = s.substring(1); + final intReg = RegExp('[0-9]+'); + final lengthEnd = intReg.matchAsPrefix(s).end; + final len = int.parse(s.substring(0, lengthEnd)); + + // Name starts after an unerscore. + final nameStart = lengthEnd + 1; + return s.substring(nameStart, nameStart + len); + } +} diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart new file mode 100644 index 0000000000..8f8487bef4 --- /dev/null +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart @@ -0,0 +1,68 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:ffi'; + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser/data.dart'; +import 'package:logging/logging.dart'; + +import '../clang_bindings/clang_bindings.dart' as clang_types; +import '../data.dart'; +import '../utils.dart'; + +var _logger = Logger('ffigen.header_parser.unnamed_enumdecl_parser'); + +List _constants = []; + +List getSavedUnNamedEnums() => _constants; + +/// Saves unnamed enums. +void saveUnNamedEnum(Pointer cursor) { + final resultCode = clang.clang_visitChildren_wrap( + cursor, + Pointer.fromFunction(_unnamedenumCursorVisitor, + clang_types.CXChildVisitResult.CXChildVisit_Break), + uid, + ); + + visitChildrenResultChecker(resultCode); +} + +/// Visitor for a enum cursor [clang.CXCursorKind.CXCursor_EnumDecl]. +/// +/// Invoked on every enum directly under rootCursor. +/// Used for for extracting enum values. +int _unnamedenumCursorVisitor(Pointer cursor, + Pointer parent, Pointer clientData) { + try { + _logger + .finest(' unnamedenumCursorVisitor: ${cursor.completeStringRepr()}'); + switch (clang.clang_getCursorKind_wrap(cursor)) { + case clang_types.CXCursorKind.CXCursor_EnumConstantDecl: + _addUnNamedEnumConstant(cursor); + break; + default: + _logger.severe('Invalid enum constant.'); + } + cursor.dispose(); + parent.dispose(); + } catch (e, s) { + _logger.severe(e); + _logger.severe(s); + rethrow; + } + return clang_types.CXChildVisitResult.CXChildVisit_Continue; +} + +/// Adds the parameter to func in [functiondecl_parser.dart]. +void _addUnNamedEnumConstant(Pointer cursor) { + _constants.add( + Constant( + name: cursor.spelling(), + rawType: 'int', + rawValue: clang.clang_getEnumConstantDeclValue_wrap(cursor).toString(), + ), + ); +} diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart index 987254e2b3..4723fe44e9 100644 --- a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -5,6 +5,7 @@ import 'dart:ffi'; import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser/sub_parsers/macro_parser.dart'; import 'package:logging/logging.dart'; import 'clang_bindings/clang_bindings.dart' as clang_types; @@ -55,6 +56,9 @@ int _rootCursorVisitor(Pointer cursor, case clang_types.CXCursorKind.CXCursor_EnumDecl: addToBindings(parseEnumDeclaration(cursor)); break; + case clang_types.CXCursorKind.CXCursor_MacroDefinition: + saveMacroDefinition(cursor); + break; default: _logger.finer('rootCursorVisitor: CursorKind not implemented'); } diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 963f84c3f7..cfa1f5d247 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -7,7 +7,7 @@ import 'package:ffigen/src/header_parser/clang_bindings/clang_bindings.dart' as clang; // This version must be updated whenever we update the libclang wrapper. -const dylibVersion = 'v1'; +const dylibVersion = 'v2'; /// Name of the dynamic library file according to current platform. String get dylibFileName { @@ -36,6 +36,7 @@ const filters = 'filters'; const functions = 'functions'; const structs = 'structs'; const enums = 'enums'; +const macros = 'macros'; // Sub-fields of Declarations. const include = 'include'; @@ -82,6 +83,7 @@ const sort = 'sort'; const useSupportedTypedefs = 'use-supported-typedefs'; const warnWhenRemoving = 'warn-when-removing'; const arrayWorkaround = 'array-workaround'; +const unnamedEnums = 'unnamed-enums'; const comments = 'comments'; // Sub-fields of comments diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index e4f34cf25e..fb8ad1253c 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 0.1.4 +version: 0.1.5 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C/C++ header files. diff --git a/pkgs/ffigen/test/code_generator_test.dart b/pkgs/ffigen/test/code_generator_test.dart index a67f41ef2d..47c0ac7730 100644 --- a/pkgs/ffigen/test/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_test.dart @@ -471,16 +471,12 @@ class Some extends ffi.Struct{ bindings: [ Constant( name: 'test1', - type: Type.nativeType( - SupportedNativeType.Int32, - ), + rawType: 'int', rawValue: '20', ), Constant( name: 'test2', - type: Type.nativeType( - SupportedNativeType.Float, - ), + rawType: 'double', rawValue: '20.0', ), ], diff --git a/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart index e0ebb25525..554795ecc8 100644 --- a/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart @@ -24,6 +24,18 @@ void main() { Func( name: 'testFunc', returnType: Type.nativeType(SupportedNativeType.Void)), + Constant( + originalName: 'Test_Macro', + name: 'Test_Macro', + rawType: 'int', + rawValue: '0', + ), + Constant( + originalName: 'Test_Macro', + name: 'Test_Macro', + rawType: 'int', + rawValue: '0', + ), ]); final l2 = Library(name: 'Bindings', bindings: [ Struc(name: 'TestStruc'), @@ -38,6 +50,18 @@ void main() { name: 'testFunc_1', originalName: 'testFunc', returnType: Type.nativeType(SupportedNativeType.Void)), + Constant( + originalName: 'Test_Macro', + name: 'Test_Macro', + rawType: 'int', + rawValue: '0', + ), + Constant( + originalName: 'Test_Macro', + name: 'Test_Macro_1', + rawType: 'int', + rawValue: '0', + ), ]); expect(l1.generate(), l2.generate()); diff --git a/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart b/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart index 964d7eaf1a..b5b6931739 100644 --- a/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart @@ -40,6 +40,11 @@ void main() { ), ], returnType: Type.nativeType(SupportedNativeType.Void)), + Constant( + name: 'else', + rawType: 'int', + rawValue: '0', + ), ]); final l2 = Library(name: 'Bindings', bindings: [ Struc(name: 'abstract_1'), @@ -69,6 +74,11 @@ void main() { ), ], returnType: Type.nativeType(SupportedNativeType.Void)), + Constant( + name: 'else_1', + rawType: 'int', + rawValue: '0', + ), ]); expect(l1.generate(), l2.generate()); }); diff --git a/pkgs/ffigen/test/header_parser_tests/macros.h b/pkgs/ffigen/test/header_parser_tests/macros.h new file mode 100644 index 0000000000..b405db4a68 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/macros.h @@ -0,0 +1,16 @@ +#define TEST1 1.1 +#define TEST2 10 +#define TEST3 (TEST1 + TEST2) +#define TEST4 "test" + +// The comma operator should actually return the last value (3), +// when returned by a function. This value, however, when assigned to a variable +// will not compile and so libclang tries to fix it and assigns the first +// value (4) to the generated macro variable. +#define TEST5 4, \ + 2, \ + 3 +#define TEST6 (1 == 1); +#define TEST7(x, y) x *y + +#define TEST8 5,2,3 diff --git a/pkgs/ffigen/test/header_parser_tests/macros_test.dart b/pkgs/ffigen/test/header_parser_tests/macros_test.dart new file mode 100644 index 0000000000..b912f78ad9 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/macros_test.dart @@ -0,0 +1,85 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/config_provider.dart'; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; +import 'package:ffigen/src/strings.dart' as strings; + +import '../test_utils.dart'; + +Library actual, expected; + +void main() { + group('macros_test', () { + setUpAll(() { + logWarnings(Level.WARNING); + expected = expectedLibrary(); + actual = parser.parse( + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Macros Test' +${strings.output}: 'unused' +${strings.headers}: + - 'test/header_parser_tests/macros.h' +${strings.headerFilter}: + ${strings.include}: + - 'macros.h' + ''') as yaml.YamlMap), + ); + }); + test('Total bindings count', () { + expect(actual.bindings.length, expected.bindings.length); + }); + + test('TEST1', () { + expect(actual.getBindingAsString('TEST1'), + expected.getBindingAsString('TEST1')); + }); + test('TEST2', () { + expect(actual.getBindingAsString('TEST2'), + expected.getBindingAsString('TEST2')); + }); + test('TEST3', () { + expect(actual.getBindingAsString('TEST3'), + expected.getBindingAsString('TEST3')); + }); + + test('TEST4', () { + expect(actual.getBindingAsString('TEST4'), + expected.getBindingAsString('TEST4')); + }); + + test('TEST5', () { + expect(actual.getBindingAsString('TEST5'), + expected.getBindingAsString('TEST5')); + }); + test('TEST6', () { + expect(actual.getBindingAsString('TEST6'), + expected.getBindingAsString('TEST6')); + }); + test('TEST8', () { + expect(actual.getBindingAsString('TEST8'), + expected.getBindingAsString('TEST8')); + }); + }); +} + +Library expectedLibrary() { + return Library( + name: 'NativeLibrary', + bindings: [ + Constant(name: 'TEST1', rawType: 'double', rawValue: '1.1'), + Constant(name: 'TEST2', rawType: 'int', rawValue: '10'), + Constant(name: 'TEST3', rawType: 'double', rawValue: '11.1'), + Constant(name: 'TEST4', rawType: 'String', rawValue: "'test'"), + Constant(name: 'TEST5', rawType: 'int', rawValue: '4'), + Constant(name: 'TEST6', rawType: 'int', rawValue: '1'), + Constant(name: 'TEST8', rawType: 'int', rawValue: '5'), + ], + ); +} diff --git a/pkgs/ffigen/test/header_parser_tests/unnamed_enums.h b/pkgs/ffigen/test/header_parser_tests/unnamed_enums.h new file mode 100644 index 0000000000..ecb4a85153 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/unnamed_enums.h @@ -0,0 +1,13 @@ +// Only this should be parsed. +enum{ + A=1, + B=2, + C=3 +}; + +// Shouldn't be parsed. +typedef enum{ + E, + F, + G +} Named; diff --git a/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart b/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart new file mode 100644 index 0000000000..7c0760216c --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart @@ -0,0 +1,81 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/config_provider.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; +import 'package:ffigen/src/strings.dart' as strings; + +import '../test_utils.dart'; + +Library actual, expected; + +void main() { + group('unnamed_enums_test', () { + setUpAll(() { + logWarnings(); + expected = expectedLibrary(); + actual = parser.parse( + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Unnamed Enums Test' +${strings.output}: 'unused' +${strings.headers}: + - 'test/header_parser_tests/unnamed_enums.h' +${strings.headerFilter}: + ${strings.include}: + - 'unnamed_enums.h' +${strings.enums}: + ${strings.exclude}: + ${strings.names}: + - Named + ''') as yaml.YamlMap), + ); + }); + + test('Total bindings count', () { + expect(actual.bindings.length, expected.bindings.length); + }); + + test('Parse unnamed enum Values', () { + expect(actual.getBindingAsString('A'), expected.getBindingAsString('A')); + expect(actual.getBindingAsString('B'), expected.getBindingAsString('B')); + expect(actual.getBindingAsString('C'), expected.getBindingAsString('C')); + }); + + test('Ignore unnamed enums inside typedefs', () { + expect(() => actual.getBindingAsString('E'), + throwsA(TypeMatcher())); + expect(() => actual.getBindingAsString('F'), + throwsA(TypeMatcher())); + expect(() => actual.getBindingAsString('G'), + throwsA(TypeMatcher())); + }); + }); +} + +Library expectedLibrary() { + return Library( + name: 'Bindings', + bindings: [ + Constant( + name: 'A', + rawType: 'int', + rawValue: '1', + ), + Constant( + name: 'B', + rawType: 'int', + rawValue: '2', + ), + Constant( + name: 'C', + rawType: 'int', + rawValue: '3', + ), + ], + ); +} diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart index e7766d2ac9..7beb2efa09 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart @@ -1063,6 +1063,38 @@ class cJSON_Hooks extends ffi.Struct { ffi.Pointer> free_fn; } +const int CJSON_VERSION_MAJOR = 1; + +const int CJSON_VERSION_MINOR = 7; + +const int CJSON_VERSION_PATCH = 12; + +const int cJSON_Invalid = 0; + +const int cJSON_False = 1; + +const int cJSON_True = 2; + +const int cJSON_NULL = 4; + +const int cJSON_Number = 8; + +const int cJSON_String = 16; + +const int cJSON_Array = 32; + +const int cJSON_Object = 64; + +const int cJSON_Raw = 128; + +const int cJSON_IsReference = 256; + +const int cJSON_StringIsConst = 512; + +const int CJSON_NESTING_LIMIT = 1000; + +const double CJSON_DOUBLE_PRECISION = 1e-16; + typedef _c_cJSON_Version = ffi.Pointer Function(); typedef _dart_cJSON_Version = ffi.Pointer Function(); diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index c6642d8dfc..f857457c0d 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -4418,6 +4418,14 @@ abstract class CXIndexOptFlags { 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_disposeStringSet = ffi.Void Function( ffi.Pointer set_1, ); diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index ba750ec99d..ad214b3006 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -9856,6 +9856,887 @@ class fts5_tokenizer extends ffi.Struct {} class fts5_api extends ffi.Struct {} +const String SQLITE_VERSION = '3.32.3'; + +const int SQLITE_VERSION_NUMBER = 3032003; + +const String SQLITE_SOURCE_ID = + '2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd'; + +const int SQLITE_OK = 0; + +const int SQLITE_ERROR = 1; + +const int SQLITE_INTERNAL = 2; + +const int SQLITE_PERM = 3; + +const int SQLITE_ABORT = 4; + +const int SQLITE_BUSY = 5; + +const int SQLITE_LOCKED = 6; + +const int SQLITE_NOMEM = 7; + +const int SQLITE_READONLY = 8; + +const int SQLITE_INTERRUPT = 9; + +const int SQLITE_IOERR = 10; + +const int SQLITE_CORRUPT = 11; + +const int SQLITE_NOTFOUND = 12; + +const int SQLITE_FULL = 13; + +const int SQLITE_CANTOPEN = 14; + +const int SQLITE_PROTOCOL = 15; + +const int SQLITE_EMPTY = 16; + +const int SQLITE_SCHEMA = 17; + +const int SQLITE_TOOBIG = 18; + +const int SQLITE_CONSTRAINT = 19; + +const int SQLITE_MISMATCH = 20; + +const int SQLITE_MISUSE = 21; + +const int SQLITE_NOLFS = 22; + +const int SQLITE_AUTH = 23; + +const int SQLITE_FORMAT = 24; + +const int SQLITE_RANGE = 25; + +const int SQLITE_NOTADB = 26; + +const int SQLITE_NOTICE = 27; + +const int SQLITE_WARNING = 28; + +const int SQLITE_ROW = 100; + +const int SQLITE_DONE = 101; + +const int SQLITE_ERROR_MISSING_COLLSEQ = 257; + +const int SQLITE_ERROR_RETRY = 513; + +const int SQLITE_ERROR_SNAPSHOT = 769; + +const int SQLITE_IOERR_READ = 266; + +const int SQLITE_IOERR_SHORT_READ = 522; + +const int SQLITE_IOERR_WRITE = 778; + +const int SQLITE_IOERR_FSYNC = 1034; + +const int SQLITE_IOERR_DIR_FSYNC = 1290; + +const int SQLITE_IOERR_TRUNCATE = 1546; + +const int SQLITE_IOERR_FSTAT = 1802; + +const int SQLITE_IOERR_UNLOCK = 2058; + +const int SQLITE_IOERR_RDLOCK = 2314; + +const int SQLITE_IOERR_DELETE = 2570; + +const int SQLITE_IOERR_BLOCKED = 2826; + +const int SQLITE_IOERR_NOMEM = 3082; + +const int SQLITE_IOERR_ACCESS = 3338; + +const int SQLITE_IOERR_CHECKRESERVEDLOCK = 3594; + +const int SQLITE_IOERR_LOCK = 3850; + +const int SQLITE_IOERR_CLOSE = 4106; + +const int SQLITE_IOERR_DIR_CLOSE = 4362; + +const int SQLITE_IOERR_SHMOPEN = 4618; + +const int SQLITE_IOERR_SHMSIZE = 4874; + +const int SQLITE_IOERR_SHMLOCK = 5130; + +const int SQLITE_IOERR_SHMMAP = 5386; + +const int SQLITE_IOERR_SEEK = 5642; + +const int SQLITE_IOERR_DELETE_NOENT = 5898; + +const int SQLITE_IOERR_MMAP = 6154; + +const int SQLITE_IOERR_GETTEMPPATH = 6410; + +const int SQLITE_IOERR_CONVPATH = 6666; + +const int SQLITE_IOERR_VNODE = 6922; + +const int SQLITE_IOERR_AUTH = 7178; + +const int SQLITE_IOERR_BEGIN_ATOMIC = 7434; + +const int SQLITE_IOERR_COMMIT_ATOMIC = 7690; + +const int SQLITE_IOERR_ROLLBACK_ATOMIC = 7946; + +const int SQLITE_IOERR_DATA = 8202; + +const int SQLITE_LOCKED_SHAREDCACHE = 262; + +const int SQLITE_LOCKED_VTAB = 518; + +const int SQLITE_BUSY_RECOVERY = 261; + +const int SQLITE_BUSY_SNAPSHOT = 517; + +const int SQLITE_BUSY_TIMEOUT = 773; + +const int SQLITE_CANTOPEN_NOTEMPDIR = 270; + +const int SQLITE_CANTOPEN_ISDIR = 526; + +const int SQLITE_CANTOPEN_FULLPATH = 782; + +const int SQLITE_CANTOPEN_CONVPATH = 1038; + +const int SQLITE_CANTOPEN_DIRTYWAL = 1294; + +const int SQLITE_CANTOPEN_SYMLINK = 1550; + +const int SQLITE_CORRUPT_VTAB = 267; + +const int SQLITE_CORRUPT_SEQUENCE = 523; + +const int SQLITE_CORRUPT_INDEX = 779; + +const int SQLITE_READONLY_RECOVERY = 264; + +const int SQLITE_READONLY_CANTLOCK = 520; + +const int SQLITE_READONLY_ROLLBACK = 776; + +const int SQLITE_READONLY_DBMOVED = 1032; + +const int SQLITE_READONLY_CANTINIT = 1288; + +const int SQLITE_READONLY_DIRECTORY = 1544; + +const int SQLITE_ABORT_ROLLBACK = 516; + +const int SQLITE_CONSTRAINT_CHECK = 275; + +const int SQLITE_CONSTRAINT_COMMITHOOK = 531; + +const int SQLITE_CONSTRAINT_FOREIGNKEY = 787; + +const int SQLITE_CONSTRAINT_FUNCTION = 1043; + +const int SQLITE_CONSTRAINT_NOTNULL = 1299; + +const int SQLITE_CONSTRAINT_PRIMARYKEY = 1555; + +const int SQLITE_CONSTRAINT_TRIGGER = 1811; + +const int SQLITE_CONSTRAINT_UNIQUE = 2067; + +const int SQLITE_CONSTRAINT_VTAB = 2323; + +const int SQLITE_CONSTRAINT_ROWID = 2579; + +const int SQLITE_CONSTRAINT_PINNED = 2835; + +const int SQLITE_NOTICE_RECOVER_WAL = 283; + +const int SQLITE_NOTICE_RECOVER_ROLLBACK = 539; + +const int SQLITE_WARNING_AUTOINDEX = 284; + +const int SQLITE_AUTH_USER = 279; + +const int SQLITE_OK_LOAD_PERMANENTLY = 256; + +const int SQLITE_OK_SYMLINK = 512; + +const int SQLITE_OPEN_READONLY = 1; + +const int SQLITE_OPEN_READWRITE = 2; + +const int SQLITE_OPEN_CREATE = 4; + +const int SQLITE_OPEN_DELETEONCLOSE = 8; + +const int SQLITE_OPEN_EXCLUSIVE = 16; + +const int SQLITE_OPEN_AUTOPROXY = 32; + +const int SQLITE_OPEN_URI = 64; + +const int SQLITE_OPEN_MEMORY = 128; + +const int SQLITE_OPEN_MAIN_DB = 256; + +const int SQLITE_OPEN_TEMP_DB = 512; + +const int SQLITE_OPEN_TRANSIENT_DB = 1024; + +const int SQLITE_OPEN_MAIN_JOURNAL = 2048; + +const int SQLITE_OPEN_TEMP_JOURNAL = 4096; + +const int SQLITE_OPEN_SUBJOURNAL = 8192; + +const int SQLITE_OPEN_MASTER_JOURNAL = 16384; + +const int SQLITE_OPEN_NOMUTEX = 32768; + +const int SQLITE_OPEN_FULLMUTEX = 65536; + +const int SQLITE_OPEN_SHAREDCACHE = 131072; + +const int SQLITE_OPEN_PRIVATECACHE = 262144; + +const int SQLITE_OPEN_WAL = 524288; + +const int SQLITE_OPEN_NOFOLLOW = 16777216; + +const int SQLITE_IOCAP_ATOMIC = 1; + +const int SQLITE_IOCAP_ATOMIC512 = 2; + +const int SQLITE_IOCAP_ATOMIC1K = 4; + +const int SQLITE_IOCAP_ATOMIC2K = 8; + +const int SQLITE_IOCAP_ATOMIC4K = 16; + +const int SQLITE_IOCAP_ATOMIC8K = 32; + +const int SQLITE_IOCAP_ATOMIC16K = 64; + +const int SQLITE_IOCAP_ATOMIC32K = 128; + +const int SQLITE_IOCAP_ATOMIC64K = 256; + +const int SQLITE_IOCAP_SAFE_APPEND = 512; + +const int SQLITE_IOCAP_SEQUENTIAL = 1024; + +const int SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN = 2048; + +const int SQLITE_IOCAP_POWERSAFE_OVERWRITE = 4096; + +const int SQLITE_IOCAP_IMMUTABLE = 8192; + +const int SQLITE_IOCAP_BATCH_ATOMIC = 16384; + +const int SQLITE_LOCK_NONE = 0; + +const int SQLITE_LOCK_SHARED = 1; + +const int SQLITE_LOCK_RESERVED = 2; + +const int SQLITE_LOCK_PENDING = 3; + +const int SQLITE_LOCK_EXCLUSIVE = 4; + +const int SQLITE_SYNC_NORMAL = 2; + +const int SQLITE_SYNC_FULL = 3; + +const int SQLITE_SYNC_DATAONLY = 16; + +const int SQLITE_FCNTL_LOCKSTATE = 1; + +const int SQLITE_FCNTL_GET_LOCKPROXYFILE = 2; + +const int SQLITE_FCNTL_SET_LOCKPROXYFILE = 3; + +const int SQLITE_FCNTL_LAST_ERRNO = 4; + +const int SQLITE_FCNTL_SIZE_HINT = 5; + +const int SQLITE_FCNTL_CHUNK_SIZE = 6; + +const int SQLITE_FCNTL_FILE_POINTER = 7; + +const int SQLITE_FCNTL_SYNC_OMITTED = 8; + +const int SQLITE_FCNTL_WIN32_AV_RETRY = 9; + +const int SQLITE_FCNTL_PERSIST_WAL = 10; + +const int SQLITE_FCNTL_OVERWRITE = 11; + +const int SQLITE_FCNTL_VFSNAME = 12; + +const int SQLITE_FCNTL_POWERSAFE_OVERWRITE = 13; + +const int SQLITE_FCNTL_PRAGMA = 14; + +const int SQLITE_FCNTL_BUSYHANDLER = 15; + +const int SQLITE_FCNTL_TEMPFILENAME = 16; + +const int SQLITE_FCNTL_MMAP_SIZE = 18; + +const int SQLITE_FCNTL_TRACE = 19; + +const int SQLITE_FCNTL_HAS_MOVED = 20; + +const int SQLITE_FCNTL_SYNC = 21; + +const int SQLITE_FCNTL_COMMIT_PHASETWO = 22; + +const int SQLITE_FCNTL_WIN32_SET_HANDLE = 23; + +const int SQLITE_FCNTL_WAL_BLOCK = 24; + +const int SQLITE_FCNTL_ZIPVFS = 25; + +const int SQLITE_FCNTL_RBU = 26; + +const int SQLITE_FCNTL_VFS_POINTER = 27; + +const int SQLITE_FCNTL_JOURNAL_POINTER = 28; + +const int SQLITE_FCNTL_WIN32_GET_HANDLE = 29; + +const int SQLITE_FCNTL_PDB = 30; + +const int SQLITE_FCNTL_BEGIN_ATOMIC_WRITE = 31; + +const int SQLITE_FCNTL_COMMIT_ATOMIC_WRITE = 32; + +const int SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE = 33; + +const int SQLITE_FCNTL_LOCK_TIMEOUT = 34; + +const int SQLITE_FCNTL_DATA_VERSION = 35; + +const int SQLITE_FCNTL_SIZE_LIMIT = 36; + +const int SQLITE_FCNTL_CKPT_DONE = 37; + +const int SQLITE_FCNTL_RESERVE_BYTES = 38; + +const int SQLITE_FCNTL_CKPT_START = 39; + +const int SQLITE_GET_LOCKPROXYFILE = 2; + +const int SQLITE_SET_LOCKPROXYFILE = 3; + +const int SQLITE_LAST_ERRNO = 4; + +const int SQLITE_ACCESS_EXISTS = 0; + +const int SQLITE_ACCESS_READWRITE = 1; + +const int SQLITE_ACCESS_READ = 2; + +const int SQLITE_SHM_UNLOCK = 1; + +const int SQLITE_SHM_LOCK = 2; + +const int SQLITE_SHM_SHARED = 4; + +const int SQLITE_SHM_EXCLUSIVE = 8; + +const int SQLITE_SHM_NLOCK = 8; + +const int SQLITE_CONFIG_SINGLETHREAD = 1; + +const int SQLITE_CONFIG_MULTITHREAD = 2; + +const int SQLITE_CONFIG_SERIALIZED = 3; + +const int SQLITE_CONFIG_MALLOC = 4; + +const int SQLITE_CONFIG_GETMALLOC = 5; + +const int SQLITE_CONFIG_SCRATCH = 6; + +const int SQLITE_CONFIG_PAGECACHE = 7; + +const int SQLITE_CONFIG_HEAP = 8; + +const int SQLITE_CONFIG_MEMSTATUS = 9; + +const int SQLITE_CONFIG_MUTEX = 10; + +const int SQLITE_CONFIG_GETMUTEX = 11; + +const int SQLITE_CONFIG_LOOKASIDE = 13; + +const int SQLITE_CONFIG_PCACHE = 14; + +const int SQLITE_CONFIG_GETPCACHE = 15; + +const int SQLITE_CONFIG_LOG = 16; + +const int SQLITE_CONFIG_URI = 17; + +const int SQLITE_CONFIG_PCACHE2 = 18; + +const int SQLITE_CONFIG_GETPCACHE2 = 19; + +const int SQLITE_CONFIG_COVERING_INDEX_SCAN = 20; + +const int SQLITE_CONFIG_SQLLOG = 21; + +const int SQLITE_CONFIG_MMAP_SIZE = 22; + +const int SQLITE_CONFIG_WIN32_HEAPSIZE = 23; + +const int SQLITE_CONFIG_PCACHE_HDRSZ = 24; + +const int SQLITE_CONFIG_PMASZ = 25; + +const int SQLITE_CONFIG_STMTJRNL_SPILL = 26; + +const int SQLITE_CONFIG_SMALL_MALLOC = 27; + +const int SQLITE_CONFIG_SORTERREF_SIZE = 28; + +const int SQLITE_CONFIG_MEMDB_MAXSIZE = 29; + +const int SQLITE_DBCONFIG_MAINDBNAME = 1000; + +const int SQLITE_DBCONFIG_LOOKASIDE = 1001; + +const int SQLITE_DBCONFIG_ENABLE_FKEY = 1002; + +const int SQLITE_DBCONFIG_ENABLE_TRIGGER = 1003; + +const int SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER = 1004; + +const int SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION = 1005; + +const int SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE = 1006; + +const int SQLITE_DBCONFIG_ENABLE_QPSG = 1007; + +const int SQLITE_DBCONFIG_TRIGGER_EQP = 1008; + +const int SQLITE_DBCONFIG_RESET_DATABASE = 1009; + +const int SQLITE_DBCONFIG_DEFENSIVE = 1010; + +const int SQLITE_DBCONFIG_WRITABLE_SCHEMA = 1011; + +const int SQLITE_DBCONFIG_LEGACY_ALTER_TABLE = 1012; + +const int SQLITE_DBCONFIG_DQS_DML = 1013; + +const int SQLITE_DBCONFIG_DQS_DDL = 1014; + +const int SQLITE_DBCONFIG_ENABLE_VIEW = 1015; + +const int SQLITE_DBCONFIG_LEGACY_FILE_FORMAT = 1016; + +const int SQLITE_DBCONFIG_TRUSTED_SCHEMA = 1017; + +const int SQLITE_DBCONFIG_MAX = 1017; + +const int SQLITE_DENY = 1; + +const int SQLITE_IGNORE = 2; + +const int SQLITE_CREATE_INDEX = 1; + +const int SQLITE_CREATE_TABLE = 2; + +const int SQLITE_CREATE_TEMP_INDEX = 3; + +const int SQLITE_CREATE_TEMP_TABLE = 4; + +const int SQLITE_CREATE_TEMP_TRIGGER = 5; + +const int SQLITE_CREATE_TEMP_VIEW = 6; + +const int SQLITE_CREATE_TRIGGER = 7; + +const int SQLITE_CREATE_VIEW = 8; + +const int SQLITE_DELETE = 9; + +const int SQLITE_DROP_INDEX = 10; + +const int SQLITE_DROP_TABLE = 11; + +const int SQLITE_DROP_TEMP_INDEX = 12; + +const int SQLITE_DROP_TEMP_TABLE = 13; + +const int SQLITE_DROP_TEMP_TRIGGER = 14; + +const int SQLITE_DROP_TEMP_VIEW = 15; + +const int SQLITE_DROP_TRIGGER = 16; + +const int SQLITE_DROP_VIEW = 17; + +const int SQLITE_INSERT = 18; + +const int SQLITE_PRAGMA = 19; + +const int SQLITE_READ = 20; + +const int SQLITE_SELECT = 21; + +const int SQLITE_TRANSACTION = 22; + +const int SQLITE_UPDATE = 23; + +const int SQLITE_ATTACH = 24; + +const int SQLITE_DETACH = 25; + +const int SQLITE_ALTER_TABLE = 26; + +const int SQLITE_REINDEX = 27; + +const int SQLITE_ANALYZE = 28; + +const int SQLITE_CREATE_VTABLE = 29; + +const int SQLITE_DROP_VTABLE = 30; + +const int SQLITE_FUNCTION = 31; + +const int SQLITE_SAVEPOINT = 32; + +const int SQLITE_COPY = 0; + +const int SQLITE_RECURSIVE = 33; + +const int SQLITE_TRACE_STMT = 1; + +const int SQLITE_TRACE_PROFILE = 2; + +const int SQLITE_TRACE_ROW = 4; + +const int SQLITE_TRACE_CLOSE = 8; + +const int SQLITE_LIMIT_LENGTH = 0; + +const int SQLITE_LIMIT_SQL_LENGTH = 1; + +const int SQLITE_LIMIT_COLUMN = 2; + +const int SQLITE_LIMIT_EXPR_DEPTH = 3; + +const int SQLITE_LIMIT_COMPOUND_SELECT = 4; + +const int SQLITE_LIMIT_VDBE_OP = 5; + +const int SQLITE_LIMIT_FUNCTION_ARG = 6; + +const int SQLITE_LIMIT_ATTACHED = 7; + +const int SQLITE_LIMIT_LIKE_PATTERN_LENGTH = 8; + +const int SQLITE_LIMIT_VARIABLE_NUMBER = 9; + +const int SQLITE_LIMIT_TRIGGER_DEPTH = 10; + +const int SQLITE_LIMIT_WORKER_THREADS = 11; + +const int SQLITE_PREPARE_PERSISTENT = 1; + +const int SQLITE_PREPARE_NORMALIZE = 2; + +const int SQLITE_PREPARE_NO_VTAB = 4; + +const int SQLITE_INTEGER = 1; + +const int SQLITE_FLOAT = 2; + +const int SQLITE_BLOB = 4; + +const int SQLITE_NULL = 5; + +const int SQLITE_TEXT = 3; + +const int SQLITE3_TEXT = 3; + +const int SQLITE_UTF8 = 1; + +const int SQLITE_UTF16LE = 2; + +const int SQLITE_UTF16BE = 3; + +const int SQLITE_UTF16 = 4; + +const int SQLITE_ANY = 5; + +const int SQLITE_UTF16_ALIGNED = 8; + +const int SQLITE_DETERMINISTIC = 2048; + +const int SQLITE_DIRECTONLY = 524288; + +const int SQLITE_SUBTYPE = 1048576; + +const int SQLITE_INNOCUOUS = 2097152; + +const int SQLITE_WIN32_DATA_DIRECTORY_TYPE = 1; + +const int SQLITE_WIN32_TEMP_DIRECTORY_TYPE = 2; + +const int SQLITE_INDEX_SCAN_UNIQUE = 1; + +const int SQLITE_INDEX_CONSTRAINT_EQ = 2; + +const int SQLITE_INDEX_CONSTRAINT_GT = 4; + +const int SQLITE_INDEX_CONSTRAINT_LE = 8; + +const int SQLITE_INDEX_CONSTRAINT_LT = 16; + +const int SQLITE_INDEX_CONSTRAINT_GE = 32; + +const int SQLITE_INDEX_CONSTRAINT_MATCH = 64; + +const int SQLITE_INDEX_CONSTRAINT_LIKE = 65; + +const int SQLITE_INDEX_CONSTRAINT_GLOB = 66; + +const int SQLITE_INDEX_CONSTRAINT_REGEXP = 67; + +const int SQLITE_INDEX_CONSTRAINT_NE = 68; + +const int SQLITE_INDEX_CONSTRAINT_ISNOT = 69; + +const int SQLITE_INDEX_CONSTRAINT_ISNOTNULL = 70; + +const int SQLITE_INDEX_CONSTRAINT_ISNULL = 71; + +const int SQLITE_INDEX_CONSTRAINT_IS = 72; + +const int SQLITE_INDEX_CONSTRAINT_FUNCTION = 150; + +const int SQLITE_MUTEX_FAST = 0; + +const int SQLITE_MUTEX_RECURSIVE = 1; + +const int SQLITE_MUTEX_STATIC_MASTER = 2; + +const int SQLITE_MUTEX_STATIC_MEM = 3; + +const int SQLITE_MUTEX_STATIC_MEM2 = 4; + +const int SQLITE_MUTEX_STATIC_OPEN = 4; + +const int SQLITE_MUTEX_STATIC_PRNG = 5; + +const int SQLITE_MUTEX_STATIC_LRU = 6; + +const int SQLITE_MUTEX_STATIC_LRU2 = 7; + +const int SQLITE_MUTEX_STATIC_PMEM = 7; + +const int SQLITE_MUTEX_STATIC_APP1 = 8; + +const int SQLITE_MUTEX_STATIC_APP2 = 9; + +const int SQLITE_MUTEX_STATIC_APP3 = 10; + +const int SQLITE_MUTEX_STATIC_VFS1 = 11; + +const int SQLITE_MUTEX_STATIC_VFS2 = 12; + +const int SQLITE_MUTEX_STATIC_VFS3 = 13; + +const int SQLITE_TESTCTRL_FIRST = 5; + +const int SQLITE_TESTCTRL_PRNG_SAVE = 5; + +const int SQLITE_TESTCTRL_PRNG_RESTORE = 6; + +const int SQLITE_TESTCTRL_PRNG_RESET = 7; + +const int SQLITE_TESTCTRL_BITVEC_TEST = 8; + +const int SQLITE_TESTCTRL_FAULT_INSTALL = 9; + +const int SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS = 10; + +const int SQLITE_TESTCTRL_PENDING_BYTE = 11; + +const int SQLITE_TESTCTRL_ASSERT = 12; + +const int SQLITE_TESTCTRL_ALWAYS = 13; + +const int SQLITE_TESTCTRL_RESERVE = 14; + +const int SQLITE_TESTCTRL_OPTIMIZATIONS = 15; + +const int SQLITE_TESTCTRL_ISKEYWORD = 16; + +const int SQLITE_TESTCTRL_SCRATCHMALLOC = 17; + +const int SQLITE_TESTCTRL_INTERNAL_FUNCTIONS = 17; + +const int SQLITE_TESTCTRL_LOCALTIME_FAULT = 18; + +const int SQLITE_TESTCTRL_EXPLAIN_STMT = 19; + +const int SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD = 19; + +const int SQLITE_TESTCTRL_NEVER_CORRUPT = 20; + +const int SQLITE_TESTCTRL_VDBE_COVERAGE = 21; + +const int SQLITE_TESTCTRL_BYTEORDER = 22; + +const int SQLITE_TESTCTRL_ISINIT = 23; + +const int SQLITE_TESTCTRL_SORTER_MMAP = 24; + +const int SQLITE_TESTCTRL_IMPOSTER = 25; + +const int SQLITE_TESTCTRL_PARSER_COVERAGE = 26; + +const int SQLITE_TESTCTRL_RESULT_INTREAL = 27; + +const int SQLITE_TESTCTRL_PRNG_SEED = 28; + +const int SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS = 29; + +const int SQLITE_TESTCTRL_LAST = 29; + +const int SQLITE_STATUS_MEMORY_USED = 0; + +const int SQLITE_STATUS_PAGECACHE_USED = 1; + +const int SQLITE_STATUS_PAGECACHE_OVERFLOW = 2; + +const int SQLITE_STATUS_SCRATCH_USED = 3; + +const int SQLITE_STATUS_SCRATCH_OVERFLOW = 4; + +const int SQLITE_STATUS_MALLOC_SIZE = 5; + +const int SQLITE_STATUS_PARSER_STACK = 6; + +const int SQLITE_STATUS_PAGECACHE_SIZE = 7; + +const int SQLITE_STATUS_SCRATCH_SIZE = 8; + +const int SQLITE_STATUS_MALLOC_COUNT = 9; + +const int SQLITE_DBSTATUS_LOOKASIDE_USED = 0; + +const int SQLITE_DBSTATUS_CACHE_USED = 1; + +const int SQLITE_DBSTATUS_SCHEMA_USED = 2; + +const int SQLITE_DBSTATUS_STMT_USED = 3; + +const int SQLITE_DBSTATUS_LOOKASIDE_HIT = 4; + +const int SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE = 5; + +const int SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL = 6; + +const int SQLITE_DBSTATUS_CACHE_HIT = 7; + +const int SQLITE_DBSTATUS_CACHE_MISS = 8; + +const int SQLITE_DBSTATUS_CACHE_WRITE = 9; + +const int SQLITE_DBSTATUS_DEFERRED_FKS = 10; + +const int SQLITE_DBSTATUS_CACHE_USED_SHARED = 11; + +const int SQLITE_DBSTATUS_CACHE_SPILL = 12; + +const int SQLITE_DBSTATUS_MAX = 12; + +const int SQLITE_STMTSTATUS_FULLSCAN_STEP = 1; + +const int SQLITE_STMTSTATUS_SORT = 2; + +const int SQLITE_STMTSTATUS_AUTOINDEX = 3; + +const int SQLITE_STMTSTATUS_VM_STEP = 4; + +const int SQLITE_STMTSTATUS_REPREPARE = 5; + +const int SQLITE_STMTSTATUS_RUN = 6; + +const int SQLITE_STMTSTATUS_MEMUSED = 99; + +const int SQLITE_CHECKPOINT_PASSIVE = 0; + +const int SQLITE_CHECKPOINT_FULL = 1; + +const int SQLITE_CHECKPOINT_RESTART = 2; + +const int SQLITE_CHECKPOINT_TRUNCATE = 3; + +const int SQLITE_VTAB_CONSTRAINT_SUPPORT = 1; + +const int SQLITE_VTAB_INNOCUOUS = 2; + +const int SQLITE_VTAB_DIRECTONLY = 3; + +const int SQLITE_ROLLBACK = 1; + +const int SQLITE_FAIL = 3; + +const int SQLITE_REPLACE = 5; + +const int SQLITE_SCANSTAT_NLOOP = 0; + +const int SQLITE_SCANSTAT_NVISIT = 1; + +const int SQLITE_SCANSTAT_EST = 2; + +const int SQLITE_SCANSTAT_NAME = 3; + +const int SQLITE_SCANSTAT_EXPLAIN = 4; + +const int SQLITE_SCANSTAT_SELECTID = 5; + +const int SQLITE_SERIALIZE_NOCOPY = 1; + +const int SQLITE_DESERIALIZE_FREEONCLOSE = 1; + +const int SQLITE_DESERIALIZE_RESIZEABLE = 2; + +const int SQLITE_DESERIALIZE_READONLY = 4; + +const int NOT_WITHIN = 0; + +const int PARTLY_WITHIN = 1; + +const int FULLY_WITHIN = 2; + +const int FTS5_TOKENIZE_QUERY = 1; + +const int FTS5_TOKENIZE_PREFIX = 2; + +const int FTS5_TOKENIZE_DOCUMENT = 4; + +const int FTS5_TOKENIZE_AUX = 8; + +const int FTS5_TOKEN_COLOCATED = 1; + typedef _c_sqlite3_libversion = ffi.Pointer Function(); typedef _dart_sqlite3_libversion = ffi.Pointer Function(); diff --git a/pkgs/ffigen/test/prefix_tests/prefix.h b/pkgs/ffigen/test/prefix_tests/prefix.h index 1e8b72da3d..d63d92ad4b 100644 --- a/pkgs/ffigen/test/prefix_tests/prefix.h +++ b/pkgs/ffigen/test/prefix_tests/prefix.h @@ -2,6 +2,9 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +#define Macro1 1 +#define Test_Macro2 2 + struct Struct1 { }; diff --git a/pkgs/ffigen/test/prefix_tests/prefix_test.dart b/pkgs/ffigen/test/prefix_tests/prefix_test.dart index abbe2b4c3f..ba1e56d4df 100644 --- a/pkgs/ffigen/test/prefix_tests/prefix_test.dart +++ b/pkgs/ffigen/test/prefix_tests/prefix_test.dart @@ -15,10 +15,12 @@ Library actual, expected; final functionPrefix = 'fff'; final structPrefix = 'sss'; final enumPrefix = 'eee'; +final macroPrefix = 'mmm'; final functionPrefixReplacedWith = 'rf'; final structPrefixReplacedWith = 'rs'; final enumPrefixReplacedWith = 're'; +final macroPrefixReplacedWith = 'rm'; void main() { group('prefix_test', () { @@ -51,6 +53,10 @@ enums: ${strings.prefix_replacement}: 'Test_': '$enumPrefixReplacedWith' +macros: + ${strings.prefix}: $macroPrefix + ${strings.prefix_replacement}: + 'Test_': '$macroPrefixReplacedWith' ''') as yaml.YamlMap)); }); @@ -66,6 +72,10 @@ enums: expect(actual.getBindingAsString('${enumPrefix}Enum1'), expected.getBindingAsString('${enumPrefix}Enum1')); }); + test('Macro prefix', () { + expect(actual.getBindingAsString('${macroPrefix}Macro1'), + expected.getBindingAsString('${macroPrefix}Macro1')); + }); test('Function prefix-replacement', () { expect( actual.getBindingAsString( @@ -87,6 +97,13 @@ enums: expected.getBindingAsString( '${enumPrefix}${enumPrefixReplacedWith}Enum2')); }); + test('Macro prefix-replacement', () { + expect( + actual.getBindingAsString( + '${macroPrefix}${macroPrefixReplacedWith}Macro2'), + expected.getBindingAsString( + '${macroPrefix}${macroPrefixReplacedWith}Macro2')); + }); }); } @@ -141,6 +158,18 @@ Library expectedLibrary() { EnumConstant(name: 'g', value: 2), ], ), + Constant( + originalName: 'Macro1', + name: '${macroPrefix}Macro1', + rawType: 'int', + rawValue: '1', + ), + Constant( + originalName: 'TestMacro2', + name: '${macroPrefix}${macroPrefixReplacedWith}Macro2', + rawType: 'int', + rawValue: '2', + ), ], ); } diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index 81598701eb..bc0754c222 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -32,6 +32,7 @@ enums: - CXTypeKind - CXDiagnosticDisplayOptions - CXTranslationUnit_Flags + - CXEvalResultKind structs: include: @@ -54,6 +55,12 @@ functions: - clang_disposeDiagnostic - clang_parseTranslationUnit - clang_disposeTranslationUnit + - clang_EvalResult_getKind + - clang_EvalResult_getAsInt + - clang_EvalResult_getAsLongLong + - clang_EvalResult_getAsDouble + - clang_EvalResult_getAsStr + - clang_EvalResult_dispose - clang_getCString_wrap - clang_disposeString_wrap - clang_getCursorKind_wrap @@ -85,3 +92,8 @@ functions: - clang_getFileName_wrap - clang_getNumElements_wrap - clang_getArrayElementType_wrap + - clang_Cursor_isMacroFunctionLike_wrap + - clang_Cursor_isMacroBuiltin_wrap + - clang_Cursor_Evaluate_wrap + - clang_Cursor_isAnonymous_wrap + - clang_Cursor_isAnonymousRecordDecl_wrap From d80fa0ae008e029221588ce092814f841a444293 Mon Sep 17 00:00:00 2001 From: Prerak Mann <31154435+mannprerak2@users.noreply.github.com> Date: Thu, 30 Jul 2020 18:47:52 +0530 Subject: [PATCH 023/276] [ffigen] Update headers config. (#60) Closes #52 - Updated headers config to have sub-fields `entry-points` and `include-directives`, removed `header-filter` config. - Globs are supported by both subkeys. - Updated tests, examples, readme, changelog. --- pkgs/ffigen/CHANGELOG.md | 3 + pkgs/ffigen/README.md | 21 +- pkgs/ffigen/example/c_json/pubspec.yaml | 8 +- .../example/libclang-example/pubspec.yaml | 12 +- pkgs/ffigen/example/simple/pubspec.yaml | 3 +- pkgs/ffigen/lib/src/code_generator/struc.dart | 4 +- .../lib/src/config_provider/config.dart | 39 +- .../lib/src/config_provider/config_types.dart | 47 +- .../lib/src/config_provider/spec_utils.dart | 140 +++--- .../lib/src/header_parser/includer.dart | 25 +- pkgs/ffigen/lib/src/header_parser/parser.dart | 4 +- .../sub_parsers/macro_parser.dart | 2 +- .../translation_unit_parser.dart | 2 +- pkgs/ffigen/lib/src/strings.dart | 8 +- pkgs/ffigen/pubspec.yaml | 3 +- .../example_tests/cjson_example_test.dart | 40 ++ .../example_tests/libclang_example_test.dart | 65 +++ .../example_tests/simple_example_test.dart | 38 ++ .../function_n_struct_test.dart | 3 +- .../header_parser_tests/functions_test.dart | 8 +- .../test/header_parser_tests/macros_test.dart | 6 +- .../nested_parsing_test.dart | 12 +- .../unnamed_enums_test.dart | 6 +- .../large_integration_tests/large_test.dart | 104 ++-- pkgs/ffigen/test/native_test/config.yaml | 14 +- pkgs/ffigen/test/native_test/native_test.dart | 32 +- .../native_test/native_test_bindings.dart | 476 +++++++++--------- .../ffigen/test/prefix_tests/prefix_test.dart | 6 +- pkgs/ffigen/test/test_utils.dart | 27 + pkgs/ffigen/tool/libclang_config.yaml | 12 +- 30 files changed, 664 insertions(+), 506 deletions(-) create mode 100644 pkgs/ffigen/test/example_tests/cjson_example_test.dart create mode 100644 pkgs/ffigen/test/example_tests/libclang_example_test.dart create mode 100644 pkgs/ffigen/test/example_tests/simple_example_test.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 9a327920bb..bcd11c7aef 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.2.0-dev +- Updated header config. Header `entry-points` and `include-directives` are now specified under `headers` key. Glob syntax is allowed. + # 0.1.5 - Added support for parsing macros and anonymous unnamed enums. These are generated as top level constants. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 604a1bc182..7cee8231a2 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -75,20 +75,17 @@ The following configuration options are available- headers
(Required) - List of C headers to use. Glob syntax is allowed. + The header entry-points and include-directives. Glob syntax is allowed.

 headers:
-  - 'folder/**.h'
-  - 'folder/specific_header.h'
- - - header-filter - Name of headers to include/exclude. -

-header-filter:
-  include:
-    - 'index.h'
-    - 'platform.h'
+ entry-points: + - 'folder/**.h' + - 'folder/specific_header.h' + include-directives: + - '**index.h' + - '**/clang-c/**' + - '/full/path/to/a/header.h' +
name
(Prefer) diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index ef1f484d15..1058579275 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -19,8 +19,8 @@ ffigen: name: 'CJson' description: 'Holds bindings to cJSON.' headers: - - '../../third_party/cjson_library/cJSON.h' - header-filter: - include: - - 'cJSON.h' + entry-points: + - '../../third_party/cjson_library/cJSON.h' + include-directives: + - '**cJSON.h' comments: false diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index 7cb89dbf62..b05796f264 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -18,13 +18,11 @@ ffigen: # Bash style Glob matching is also supported. # TODO(11): Globs dont work on windows if they begin with '.' or '..'. headers: - - ../../third_party/libclang/include/clang-c/Index.h - - # Excludes included headers based on their names (not fullpath name). - header-filter: - include: - - 'CXString.h' - - 'Index.h' + entry-points: + - ../../third_party/libclang/include/clang-c/Index.h + include-directives: # use glob syntax to match with header file path. + - '**CXString.h' + - '**Index.h' compiler-opts: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -IC:\Progra~1\LLVM\include -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' functions: diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index 58aaa7e1dc..c742a26001 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -16,4 +16,5 @@ ffigen: description: Bindings to `headers/example.h`. output: 'generated_bindings.dart' headers: - - 'headers/example.h' + entry-points: + - 'headers/example.h' diff --git a/pkgs/ffigen/lib/src/code_generator/struc.dart b/pkgs/ffigen/lib/src/code_generator/struc.dart index 9fd8d05f59..dec4c2c967 100644 --- a/pkgs/ffigen/lib/src/code_generator/struc.dart +++ b/pkgs/ffigen/lib/src/code_generator/struc.dart @@ -248,8 +248,8 @@ class ArrayHelper { s.write(''' ${helperClassGroupName}_level${dim + 1} operator [](int index) { $checkBoundsFunctionIdentifier(index); - int offset = index; - for (int i = level + 1; i < $dimensionsIdentifier.length; i++) { + var offset = index; + for (var i = level + 1; i < $dimensionsIdentifier.length; i++) { offset *= $dimensionsIdentifier[i]; } return ${helperClassGroupName}_level${dim + 1}( diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index eb75b8068b..583287db0a 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -23,13 +23,8 @@ class Config { /// output file name. String output; - /// Path to headers. - /// - /// This contains all the headers, after extraction from Globs. - List headers; - - /// Filter for headers. - HeaderFilter headerFilter; + // Holds headers and filters for header. + Headers headers; /// CommandLine Arguments to pass to clang_compiler. List compilerOpts; @@ -135,30 +130,18 @@ class Config { Map _getSpecs() { return { strings.output: Specification( - description: 'Output file name', requirement: Requirement.yes, validator: outputValidator, extractor: outputExtractor, extractedResult: (dynamic result) => output = result as String, ), - strings.headers: Specification>( - description: 'List of C headers to generate bindings of', + strings.headers: Specification( requirement: Requirement.yes, validator: headersValidator, extractor: headersExtractor, - extractedResult: (dynamic result) => headers = result as List, - ), - strings.headerFilter: Specification( - description: 'Include/Exclude inclusion headers', - validator: headerFilterValidator, - extractor: headerFilterExtractor, - defaultValue: () => HeaderFilter(), - extractedResult: (dynamic result) { - return headerFilter = result as HeaderFilter; - }, + extractedResult: (dynamic result) => headers = result as Headers, ), strings.compilerOpts: Specification>( - description: 'Raw compiler options to pass to clang compiler', requirement: Requirement.no, validator: compilerOptsValidator, extractor: compilerOptsExtractor, @@ -166,7 +149,6 @@ class Config { compilerOpts = result as List, ), strings.functions: Specification( - description: 'Filter for functions', requirement: Requirement.no, validator: declarationConfigValidator, extractor: declarationConfigExtractor, @@ -176,7 +158,6 @@ class Config { }, ), strings.structs: Specification( - description: 'Filter for Structs', requirement: Requirement.no, validator: declarationConfigValidator, extractor: declarationConfigExtractor, @@ -186,7 +167,6 @@ class Config { }, ), strings.enums: Specification( - description: 'Filter for enums', requirement: Requirement.no, validator: declarationConfigValidator, extractor: declarationConfigExtractor, @@ -196,7 +176,6 @@ class Config { }, ), strings.macros: Specification( - description: 'Filter for macros', requirement: Requirement.no, validator: declarationConfigValidator, extractor: declarationConfigExtractor, @@ -206,7 +185,6 @@ class Config { }, ), strings.sizemap: Specification>( - description: 'map of types: byte size in int', validator: sizemapValidator, extractor: sizemapExtractor, defaultValue: () => {}, @@ -220,7 +198,6 @@ class Config { }, ), strings.sort: Specification( - description: 'whether or not to sort the bindings alphabetically', requirement: Requirement.no, validator: booleanValidator, extractor: booleanExtractor, @@ -228,7 +205,6 @@ class Config { extractedResult: (dynamic result) => sort = result as bool, ), strings.useSupportedTypedefs: Specification( - description: 'whether or not to directly map supported typedef by name', requirement: Requirement.no, validator: booleanValidator, extractor: booleanExtractor, @@ -237,7 +213,6 @@ class Config { useSupportedTypedefs = result as bool, ), strings.comments: Specification( - description: 'Type of comment to extract', requirement: Requirement.no, validator: commentValidator, extractor: commentExtractor, @@ -246,8 +221,6 @@ class Config { commentType = result as CommentType, ), strings.arrayWorkaround: Specification( - description: - 'whether or not to generate workarounds for inline arrays in structures', requirement: Requirement.no, validator: booleanValidator, extractor: booleanExtractor, @@ -255,7 +228,6 @@ class Config { extractedResult: (dynamic result) => arrayWorkaround = result as bool, ), strings.unnamedEnums: Specification( - description: 'whether or not to generate constants for unnamed enums.', requirement: Requirement.no, validator: booleanValidator, extractor: booleanExtractor, @@ -263,7 +235,6 @@ class Config { extractedResult: (dynamic result) => unnamedEnums = result as bool, ), strings.name: Specification( - description: 'Name of the wrapper class', requirement: Requirement.prefer, validator: dartClassNameValidator, extractor: stringExtractor, @@ -271,7 +242,6 @@ class Config { extractedResult: (dynamic result) => wrapperName = result as String, ), strings.description: Specification( - description: 'Doc comment for the wrapper class', requirement: Requirement.prefer, validator: nonEmptyStringValidator, extractor: stringExtractor, @@ -280,7 +250,6 @@ class Config { wrapperDocComment = result as String, ), strings.preamble: Specification( - description: 'Raw header string for the generated file', requirement: Requirement.no, validator: nonEmptyStringValidator, extractor: stringExtractor, diff --git a/pkgs/ffigen/lib/src/config_provider/config_types.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart index c44a72bbd4..a417a182fc 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_types.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart @@ -5,6 +5,7 @@ /// Contains all the neccesary classes required by config. import 'package:meta/meta.dart'; +import 'package:quiver/pattern.dart' as quiver; class CommentType { CommentStyle style; @@ -30,7 +31,6 @@ enum CommentLength { none, brief, full } /// /// [E] is the return type of the extractedResult. class Specification { - final String description; final bool Function(String name, dynamic value) validator; final E Function(dynamic map) extractor; final E Function() defaultValue; @@ -40,7 +40,6 @@ class Specification { Specification({ @required this.extractedResult, - @required this.description, @required this.validator, @required this.extractor, this.defaultValue, @@ -50,14 +49,46 @@ class Specification { enum Requirement { yes, prefer, no } -class HeaderFilter { - Set includedInclusionHeaders; - Set excludedInclusionHeaders; +// Holds headers and filters for header. +class Headers { + /// Path to headers. + /// + /// This contains all the headers, after extraction from Globs. + List entryPoints = []; + + /// Include filter for headers. + HeaderIncludeFilter includeFilter = GlobHeaderFilter(); - HeaderFilter({ - this.includedInclusionHeaders = const {}, - this.excludedInclusionHeaders = const {}, + Headers({this.entryPoints, this.includeFilter}); +} + +abstract class HeaderIncludeFilter { + bool shouldInclude(String headerSourceFile); +} + +class GlobHeaderFilter extends HeaderIncludeFilter { + List includeGlobs = []; + + GlobHeaderFilter({ + this.includeGlobs, }); + + @override + bool shouldInclude(String header) { + // Return true if header was included. + for (final globPattern in includeGlobs) { + if (quiver.matchesFull(globPattern, header)) { + return true; + } + } + + // If any includedInclusionHeaders is provided, return false. + if (includeGlobs.isNotEmpty) { + return false; + } else { + return true; + } + } } /// A generic declaration config. diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 5170e5ff1f..d6d08cf20e 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -9,6 +9,7 @@ import 'package:glob/glob.dart'; import 'package:logging/logging.dart'; import 'package:path/path.dart' as p; import 'package:yaml/yaml.dart'; +import 'package:quiver/pattern.dart' as quiver; import '../strings.dart' as strings; import 'config_types.dart'; @@ -24,17 +25,20 @@ String _replaceSeparators(String path) { } } -bool booleanExtractor(dynamic value) => value as bool; - -bool booleanValidator(String name, dynamic value) { - if (value is! bool) { - _logger.severe("Expected value of key '$name' to be a bool."); +/// Checks if type of value is [T], logs an error if it's not. +bool checkType(String key, dynamic value) { + if (value is! T) { + _logger.severe("Expected value of key '$key' to be of type '${T}'."); return false; - } else { - return true; } + return true; } +bool booleanExtractor(dynamic value) => value as bool; + +bool booleanValidator(String name, dynamic value) => + checkType(name, value); + Map sizemapExtractor(dynamic yamlConfig) { final resultMap = {}; final sizemap = yamlConfig as YamlMap; @@ -52,8 +56,7 @@ Map sizemapExtractor(dynamic yamlConfig) { } bool sizemapValidator(String name, dynamic yamlConfig) { - if (yamlConfig is! YamlMap) { - _logger.severe("Expected value of key '$name' to be a Map."); + if (!checkType(name, yamlConfig)) { return false; } for (final key in (yamlConfig as YamlMap).keys) { @@ -68,71 +71,65 @@ bool sizemapValidator(String name, dynamic yamlConfig) { List compilerOptsExtractor(dynamic value) => (value as String)?.split(' '); -bool compilerOptsValidator(String name, dynamic value) { - if (value is! String) { - _logger.severe("Expected value of key '$name' to be a string."); - return false; - } else { - return true; - } -} - -HeaderFilter headerFilterExtractor(dynamic yamlConfig) { - final includedInclusionHeaders = {}; - final excludedInclusionHeaders = {}; - - final headerFilter = yamlConfig as YamlMap; - if (headerFilter != null) { - // Add include/excluded header-filter from Yaml. - final include = headerFilter[strings.include] as YamlList; - include?.cast()?.forEach(includedInclusionHeaders.add); - - final exclude = headerFilter[strings.exclude] as YamlList; - exclude?.cast()?.forEach(excludedInclusionHeaders.add); - } - - return HeaderFilter( - includedInclusionHeaders: includedInclusionHeaders, - excludedInclusionHeaders: excludedInclusionHeaders, - ); -} - -bool headerFilterValidator(String name, dynamic value) { - if (value is! YamlMap) { - _logger.severe("Expected value of key '$name' to be a Map."); - return false; - } else { - return true; - } -} +bool compilerOptsValidator(String name, dynamic value) => + checkType(name, value); -List headersExtractor(dynamic yamlConfig) { - final headers = []; - for (final h in (yamlConfig as YamlList)) { - final headerGlob = h as String; - // Add file directly to header if it's not a Glob but a File. - if (File(headerGlob).existsSync()) { - final osSpecificPath = _replaceSeparators(headerGlob); - headers.add(osSpecificPath); - _logger.fine('Adding header/file: $headerGlob'); - } else { - final glob = Glob(headerGlob); - for (final file in glob.listSync(followLinks: true)) { - final fixedPath = _replaceSeparators(file.path); - headers.add(fixedPath); - _logger.fine('Adding header/file: ${fixedPath}'); +Headers headersExtractor(dynamic yamlConfig) { + final entryPoints = []; + final includeGlobs = []; + for (final key in (yamlConfig as YamlMap).keys) { + if (key == strings.entryPoints) { + for (final h in (yamlConfig[key] as YamlList)) { + final headerGlob = h as String; + // Add file directly to header if it's not a Glob but a File. + if (File(headerGlob).existsSync()) { + final osSpecificPath = _replaceSeparators(headerGlob); + entryPoints.add(osSpecificPath); + _logger.fine('Adding header/file: $headerGlob'); + } else { + final glob = Glob(headerGlob); + for (final file in glob.listSync(followLinks: true)) { + final fixedPath = _replaceSeparators(file.path); + entryPoints.add(fixedPath); + _logger.fine('Adding header/file: ${fixedPath}'); + } + } + } + } + if (key == strings.includeDirectives) { + for (final h in (yamlConfig[key] as YamlList)) { + final headerGlob = h as String; + includeGlobs.add(quiver.Glob(headerGlob)); } } } - return headers; + return Headers( + entryPoints: entryPoints, + includeFilter: GlobHeaderFilter( + includeGlobs: includeGlobs, + ), + ); } bool headersValidator(String name, dynamic value) { - if (value is! YamlList) { - _logger.severe( - "Expected value of key '${strings.headers}' to be a List of String."); + if (!checkType(name, value)) { + return false; + } + if (!(value as YamlMap).containsKey(strings.entryPoints)) { + _logger.severe("Expected '$name -> ${strings.entryPoints}' to be a Map."); return false; } else { + for (final key in (value as YamlMap).keys) { + if (key == strings.entryPoints || key == strings.includeDirectives) { + if (!checkType(key as String, value[key])) { + _logger.severe("Expected '$name -> $key' to be a Map."); + return false; + } + } else { + _logger.severe("Unknown key '$key' in '$name'."); + return false; + } + } return true; } } @@ -140,8 +137,7 @@ bool headersValidator(String name, dynamic value) { String libclangDylibExtractor(dynamic value) => getDylibPath(value as String); bool libclangDylibValidator(String name, dynamic value) { - if (value is! String) { - _logger.severe("Expected value of key '$name' to be a string."); + if (!checkType(name, value)) { return false; } else { final dylibPath = getDylibPath(value as String); @@ -170,14 +166,8 @@ String getDylibPath(String dylibParentFoler) { String outputExtractor(dynamic value) => _replaceSeparators(value as String); -bool outputValidator(String name, dynamic value) { - if (value is String) { - return true; - } else { - _logger.severe("Expected value of key '$name' to be a String."); - return false; - } -} +bool outputValidator(String name, dynamic value) => + checkType(name, value); Declaration declarationConfigExtractor(dynamic yamlMap) { List includeMatchers, includeFull, excludeMatchers, excludeFull; diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart index b00fa4f95f..c17b13ef44 100644 --- a/pkgs/ffigen/lib/src/header_parser/includer.dart +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -3,7 +3,6 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:path/path.dart' as p; import 'data.dart'; /// Utility functions to check whether a binding should be parsed or not @@ -58,7 +57,10 @@ bool shouldIncludeMacro(String name) { } } -/// True if a cursor should be included based on header-filter, use for root +/// Cache for headers. +final _headerCache = {}; + +/// True if a cursor should be included based on headers config, used on root /// declarations. bool shouldIncludeRootCursor(String sourceFile) { // Handle null in case of system headers or macros. @@ -66,22 +68,13 @@ bool shouldIncludeRootCursor(String sourceFile) { return false; } - final name = p.basename(sourceFile); - - if (config.headerFilter.excludedInclusionHeaders.contains(name)) { - return false; - } - - if (config.headerFilter.includedInclusionHeaders.contains(name)) { - return true; + // Add header to cache if its not. + if (!_headerCache.containsKey(sourceFile)) { + _headerCache[sourceFile] = + config.headers.includeFilter.shouldInclude(sourceFile); } - // If any includedInclusionHeaders is provided, return false. - if (config.headerFilter.includedInclusionHeaders.isNotEmpty) { - return false; - } else { - return true; - } + return _headerCache[sourceFile]; } bool isSeenStruc(String originalName) { diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index 6730d22708..29a86e5031 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -86,9 +86,9 @@ List parseToBindings() { final bindings = []; // Log all headers for user. - _logger.info('Input Headers: ${config.headers}'); + _logger.info('Input Headers: ${config.headers.entryPoints}'); - for (final headerLocation in config.headers) { + for (final headerLocation in config.headers.entryPoints) { _logger.fine('Creating TranslationUnit for header: $headerLocation'); final tu = clang.clang_parseTranslationUnit( diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart index 4da1b04f46..3971daf726 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart @@ -195,7 +195,7 @@ File createFileForMacros() { // Write file contents. final sb = StringBuffer(); - for (final h in config.headers) { + for (final h in config.headers.entryPoints) { sb.writeln('#include "$h"'); } diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart index 4723fe44e9..4c1f36cf22 100644 --- a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -64,7 +64,7 @@ int _rootCursorVisitor(Pointer cursor, } } else { _logger.finest( - 'rootCursorVisitor:(excluded in header-filter) ${cursor.completeStringRepr()}'); + 'rootCursorVisitor:(not included) ${cursor.completeStringRepr()}'); } cursor.dispose(); diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index cfa1f5d247..619607572f 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -27,10 +27,14 @@ String get dylibFileName { const ffigenFolderName = 'ffigen'; const output = 'output'; + const headers = 'headers'; -const headerFilter = 'header-filter'; + +// Sub-fields of headers +const entryPoints = 'entry-points'; +const includeDirectives = 'include-directives'; + const compilerOpts = 'compiler-opts'; -const filters = 'filters'; // Declarations. const functions = 'functions'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index fb8ad1253c..3151c7dce6 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 0.1.5 +version: 0.2.0-dev homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C/C++ header files. @@ -18,6 +18,7 @@ dependencies: logging: ^0.11.4 glob: ^1.2.0 path: ^1.7.0 + quiver: ^2.1.3 dev_dependencies: pedantic: ^1.9.2 diff --git a/pkgs/ffigen/test/example_tests/cjson_example_test.dart b/pkgs/ffigen/test/example_tests/cjson_example_test.dart new file mode 100644 index 0000000000..b4093a89a1 --- /dev/null +++ b/pkgs/ffigen/test/example_tests/cjson_example_test.dart @@ -0,0 +1,40 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/header_parser.dart'; +import 'package:logging/logging.dart'; +import 'package:yaml/yaml.dart'; +import 'package:ffigen/src/config_provider/config.dart'; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:test/test.dart'; + +import '../test_utils.dart'; + +void main() { + group('cjson_example_test', () { + setUpAll(() { + logWarnings(Level.SEVERE); + }); + test('c_json', () { + final config = Config.fromYaml(loadYaml(''' +${strings.output}: 'cjson_generated_bindings.dart' +${strings.name}: 'CJson' +${strings.description}: 'Holds bindings to cJSON.' +${strings.headers}: + ${strings.entryPoints}: + - 'third_party/cjson_library/cJSON.h' + ${strings.includeDirectives}: + - '**cJSON.h' +${strings.comments}: false +''') as YamlMap); + final library = parse(config); + + matchLibraryWithExpected( + library, + ['test', 'debug_generated', 'c_json.dart'], + ['example', 'c_json', config.output], + ); + }); + }); +} diff --git a/pkgs/ffigen/test/example_tests/libclang_example_test.dart b/pkgs/ffigen/test/example_tests/libclang_example_test.dart new file mode 100644 index 0000000000..761dddc007 --- /dev/null +++ b/pkgs/ffigen/test/example_tests/libclang_example_test.dart @@ -0,0 +1,65 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/header_parser.dart'; +import 'package:logging/logging.dart'; +import 'package:yaml/yaml.dart'; +import 'package:ffigen/src/config_provider/config.dart'; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:test/test.dart'; + +import '../test_utils.dart'; + +void main() { + group('example_test', () { + setUpAll(() { + logWarnings(Level.SEVERE); + }); + test('libclang-example', () { + final config = Config.fromYaml(loadYaml(''' +${strings.output}: 'generated_bindings.dart' +${strings.sort}: true +${strings.headers}: + ${strings.entryPoints}: + - third_party/libclang/include/clang-c/Index.h + ${strings.include}-directives: + - '**CXString.h' + - '**Index.h' + +${strings.compilerOpts}: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -IC:\Progra~1\LLVM\include -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' +${strings.functions}: + ${strings.include}: + ${strings.matches}: + - 'clang_.*' +${strings.structs}: + ${strings.include}: + ${strings.matches}: + - 'CX.*' +${strings.enums}: + ${strings.include}: + ${strings.names}: + - 'CXTypeKind' + - 'CXGlobalOptFlags' + +${strings.name}: 'LibClang' +${strings.description}: 'Holds bindings to LibClang.' +${strings.arrayWorkaround}: true +${strings.preamble}: | + /// AUTO GENERATED FILE, DO NOT EDIT. + /// + /// Generated by `package:ffigen`. +${strings.comments}: + ${strings.style}: ${strings.doxygen} + ${strings.length}: ${strings.full} +''') as YamlMap); + final library = parse(config); + + matchLibraryWithExpected( + library, + ['test', 'debug_generated', 'libclang-example.dart'], + ['example', 'libclang-example', config.output], + ); + }); + }); +} diff --git a/pkgs/ffigen/test/example_tests/simple_example_test.dart b/pkgs/ffigen/test/example_tests/simple_example_test.dart new file mode 100644 index 0000000000..5b22de7d5f --- /dev/null +++ b/pkgs/ffigen/test/example_tests/simple_example_test.dart @@ -0,0 +1,38 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/header_parser.dart'; +import 'package:logging/logging.dart'; +import 'package:yaml/yaml.dart'; +import 'package:ffigen/src/config_provider/config.dart'; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:test/test.dart'; + +import '../test_utils.dart'; + +void main() { + group('simple_example_test', () { + setUpAll(() { + logWarnings(Level.SEVERE); + }); + + test('simple', () { + final config = Config.fromYaml(loadYaml(''' +${strings.name}: NativeLibrary +${strings.description}: Bindings to `headers/example.h`. +${strings.output}: 'generated_bindings.dart' +${strings.headers}: + ${strings.entryPoints}: + - 'example/simple/headers/example.h' +''') as YamlMap); + final library = parse(config); + + matchLibraryWithExpected( + library, + ['test', 'debug_generated', 'simple.dart'], + ['example', 'simple', config.output], + ); + }); + }); +} diff --git a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart index 872bf1b114..b3da1d8941 100644 --- a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart @@ -26,7 +26,8 @@ ${strings.description}: 'Function And Struct Test' ${strings.output}: 'unused' ${strings.headers}: - - 'test/header_parser_tests/function_n_struct.h' + ${strings.entryPoints}: + - 'test/header_parser_tests/function_n_struct.h' ''') as yaml.YamlMap), ); }); diff --git a/pkgs/ffigen/test/header_parser_tests/functions_test.dart b/pkgs/ffigen/test/header_parser_tests/functions_test.dart index c88fd55e65..aba98e61d2 100644 --- a/pkgs/ffigen/test/header_parser_tests/functions_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/functions_test.dart @@ -25,10 +25,10 @@ ${strings.description}: 'Functions Test' ${strings.output}: 'unused' ${strings.headers}: - - 'test/header_parser_tests/functions.h' -${strings.headerFilter}: - ${strings.include}: - - 'functions.h' + ${strings.entryPoints}: + - 'test/header_parser_tests/functions.h' + ${strings.includeDirectives}: + - '**functions.h' ''') as yaml.YamlMap), ); }); diff --git a/pkgs/ffigen/test/header_parser_tests/macros_test.dart b/pkgs/ffigen/test/header_parser_tests/macros_test.dart index b912f78ad9..74bbcfc615 100644 --- a/pkgs/ffigen/test/header_parser_tests/macros_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/macros_test.dart @@ -25,10 +25,8 @@ ${strings.name}: 'NativeLibrary' ${strings.description}: 'Macros Test' ${strings.output}: 'unused' ${strings.headers}: - - 'test/header_parser_tests/macros.h' -${strings.headerFilter}: - ${strings.include}: - - 'macros.h' + ${strings.entryPoints}: + - 'test/header_parser_tests/macros.h' ''') as yaml.YamlMap), ); }); diff --git a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart index 073623136f..ed1bacfa2b 100644 --- a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart @@ -25,14 +25,12 @@ ${strings.description}: 'Nested Parsing Test' ${strings.output}: 'unused' ${strings.headers}: - - 'test/header_parser_tests/nested_parsing.h' -structs: - include: - names: - - Struct1 -${strings.headerFilter}: + ${strings.entryPoints}: + - 'test/header_parser_tests/nested_parsing.h' +${strings.structs}: ${strings.include}: - - 'nested_parsing.h' + ${strings.names}: + - Struct1 ''') as yaml.YamlMap), ); }); diff --git a/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart b/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart index 7c0760216c..a7ee4c4201 100644 --- a/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart @@ -24,10 +24,8 @@ ${strings.name}: 'NativeLibrary' ${strings.description}: 'Unnamed Enums Test' ${strings.output}: 'unused' ${strings.headers}: - - 'test/header_parser_tests/unnamed_enums.h' -${strings.headerFilter}: - ${strings.include}: - - 'unnamed_enums.h' + ${strings.entryPoints}: + - 'test/header_parser_tests/unnamed_enums.h' ${strings.enums}: ${strings.exclude}: ${strings.names}: diff --git a/pkgs/ffigen/test/large_integration_tests/large_test.dart b/pkgs/ffigen/test/large_integration_tests/large_test.dart index 542b3ce72a..b18f52b5c6 100644 --- a/pkgs/ffigen/test/large_integration_tests/large_test.dart +++ b/pkgs/ffigen/test/large_integration_tests/large_test.dart @@ -2,8 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'dart:io'; - import 'package:ffigen/src/header_parser.dart'; import 'package:logging/logging.dart'; import 'package:yaml/yaml.dart'; @@ -30,36 +28,24 @@ ${strings.comments}: ${strings.style}: ${strings.doxygen} ${strings.length}: ${strings.brief} ${strings.headers}: - - third_party/libclang/include/clang-c/Index.h -${strings.headerFilter}: - include: - - 'BuildSystem.h' - - 'CXCompilationDatabase.h' - - 'CXErrorCode.h' - - 'CXString.h' - - 'Documentation.h' - - 'FataErrorHandler.h' - - 'Index.h' + ${strings.entryPoints}: + - third_party/libclang/include/clang-c/Index.h + ${strings.includeDirectives}: + - '**BuildSystem.h' + - '**CXCompilationDatabase.h' + - '**CXErrorCode.h' + - '**CXString.h' + - '**Documentation.h' + - '**FataErrorHandler.h' + - '**Index.h' ''') as YamlMap); final library = parse(config); - final file = File( - path.join('test', 'debug_generated', 'large_test_libclang.dart'), - ); - library.generateFile(file); - try { - final actual = file.readAsStringSync(); - final expected = File(path.join('test', 'large_integration_tests', - '_expected_libclang_bindings.dart')) - .readAsStringSync(); - expect(actual, expected); - if (file.existsSync()) { - file.delete(); - } - } catch (e) { - print('Failed test: Debug generated file: ${file.absolute?.path}'); - rethrow; - } + matchLibraryWithExpected( + library, + ['test', 'debug_generated', 'large_test_libclang.dart'], + ['test', 'large_integration_tests', '_expected_libclang_bindings.dart'], + ); }); test('CJSON test', () { @@ -71,30 +57,18 @@ ${strings.comments}: ${strings.length}: ${strings.full} ${strings.arrayWorkaround}: true ${strings.headers}: - - third_party/cjson_library/cJSON.h -${strings.headerFilter}: - include: - - 'cJSON.h' + ${strings.entryPoints}: + - third_party/cjson_library/cJSON.h + ${strings.includeDirectives}: + - '**cJSON.h' ''') as YamlMap); final library = parse(config); - final file = File( - path.join('test', 'debug_generated', 'large_test_cjson.dart'), - ); - library.generateFile(file); - try { - final actual = file.readAsStringSync(); - final expected = File(path.join('test', 'large_integration_tests', - '_expected_cjson_bindings.dart')) - .readAsStringSync(); - expect(actual, expected); - if (file.existsSync()) { - file.delete(); - } - } catch (e) { - print('Failed test: Debug generated file: ${file.absolute?.path}'); - rethrow; - } + matchLibraryWithExpected( + library, + ['test', 'debug_generated', 'large_test_cjson.dart'], + ['test', 'large_integration_tests', '_expected_cjson_bindings.dart'], + ); }); test('SQLite test', () { @@ -109,10 +83,10 @@ ${strings.comments}: ${strings.style}: ${strings.any} ${strings.length}: ${strings.full} ${strings.headers}: - - third_party/sqlite/sqlite3.h -${strings.headerFilter}: - ${strings.include}: - - 'sqlite3.h' + ${strings.entryPoints}: + - third_party/sqlite/sqlite3.h + ${strings.includeDirectives}: + - '**sqlite3.h' ${strings.functions}: ${strings.exclude}: ${strings.names}: @@ -121,24 +95,12 @@ ${strings.functions}: - sqlite3_str_vappendf ''') as YamlMap); final library = parse(config); - final file = File( - path.join('test', 'debug_generated', 'large_test_sqlite.dart'), - ); - library.generateFile(file); - try { - final actual = file.readAsStringSync(); - final expected = File(path.join('test', 'large_integration_tests', - '_expected_sqlite_bindings.dart')) - .readAsStringSync(); - expect(actual, expected); - if (file.existsSync()) { - file.delete(); - } - } catch (e) { - print('Failed test: Debug generated file: ${file.absolute?.path}'); - rethrow; - } + matchLibraryWithExpected( + library, + ['test', 'debug_generated', 'large_test_sqlite.dart'], + ['test', 'large_integration_tests', '_expected_sqlite_bindings.dart'], + ); }); }); } diff --git a/pkgs/ffigen/test/native_test/config.yaml b/pkgs/ffigen/test/native_test/config.yaml index 479988d596..a81d932c4e 100644 --- a/pkgs/ffigen/test/native_test/config.yaml +++ b/pkgs/ffigen/test/native_test/config.yaml @@ -3,14 +3,16 @@ # BSD-style license that can be found in the LICENSE file. # =================== GENERATING TEST BINDINGS ================== -# dart ../../bin/ffigen.dart --config config.yaml +# pub run ffigen --config test/native_test/config.yaml # =============================================================== -output: 'native_test_bindings.dart' +name: NativeLibrary +description: 'Native tests.' +output: 'test/native_test/native_test_bindings.dart' sort: true headers: - - 'native_test.c' -header-filter: - include: - - 'native_test.c' + entry-points: + - 'test/native_test/native_test.c' + include-directives: + - '**native_test.c' array-workaround: true diff --git a/pkgs/ffigen/test/native_test/native_test.dart b/pkgs/ffigen/test/native_test/native_test.dart index 0cec0cccbb..63d1824cc3 100644 --- a/pkgs/ffigen/test/native_test/native_test.dart +++ b/pkgs/ffigen/test/native_test/native_test.dart @@ -6,12 +6,15 @@ import 'dart:ffi'; import 'dart:io'; import 'dart:math'; +import 'package:ffigen/ffigen.dart'; +import 'package:path/path.dart' as path; import 'package:test/test.dart'; - +import 'package:yaml/yaml.dart'; import '../test_utils.dart'; -import 'native_test_bindings.dart' as bindings; +import 'native_test_bindings.dart'; void main() { + NativeLibrary bindings; group('native_test', () { setUpAll(() { logWarnings(); @@ -21,9 +24,32 @@ void main() { } else if (Platform.isWindows) { dylibName = r'test\native_test\native_test.dll'; } - bindings.init( + bindings = NativeLibrary( DynamicLibrary.open(File(dylibName).absolute?.path ?? dylibName)); }); + + test('generate_bindings', () { + final config = Config.fromYaml(loadYaml( + File(path.join('test', 'native_test', 'config.yaml')) + .readAsStringSync()) as YamlMap); + final library = parse(config); + final file = File( + path.join('test', 'debug_generated', 'native_test_bindings.dart'), + ); + library.generateFile(file); + + try { + final actual = file.readAsStringSync(); + final expected = File(path.join(config.output)).readAsStringSync(); + expect(actual, expected); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + print('Failed test: Debug generated file: ${file.absolute?.path}'); + rethrow; + } + }); test('uint8_t', () { expect(bindings.Function1Uint8(pow(2, 8).toInt()), 42); }); diff --git a/pkgs/ffigen/test/native_test/native_test_bindings.dart b/pkgs/ffigen/test/native_test/native_test_bindings.dart index a49d622893..fe4c94527b 100644 --- a/pkgs/ffigen/test/native_test/native_test_bindings.dart +++ b/pkgs/ffigen/test/native_test/native_test_bindings.dart @@ -3,244 +3,181 @@ /// Generated by `package:ffigen`. import 'dart:ffi' as ffi; -/// Holds the Dynamic library. -ffi.DynamicLibrary _dylib; - -/// Initialises the Dynamic library. -void init(ffi.DynamicLibrary dylib) { - _dylib = dylib; -} - -double Function1Double( - double x, -) { - return _Function1Double( - x, - ); -} - -final _dart_Function1Double _Function1Double = - _dylib.lookupFunction<_c_Function1Double, _dart_Function1Double>( - 'Function1Double'); - -typedef _c_Function1Double = ffi.Double Function( - ffi.Double x, -); - -typedef _dart_Function1Double = double Function( - double x, -); - -double Function1Float( - double x, -) { - return _Function1Float( - x, - ); -} - -final _dart_Function1Float _Function1Float = _dylib - .lookupFunction<_c_Function1Float, _dart_Function1Float>('Function1Float'); - -typedef _c_Function1Float = ffi.Float Function( - ffi.Float x, -); - -typedef _dart_Function1Float = double Function( - double x, -); - -int Function1Int16( - int x, -) { - return _Function1Int16( - x, - ); -} - -final _dart_Function1Int16 _Function1Int16 = _dylib - .lookupFunction<_c_Function1Int16, _dart_Function1Int16>('Function1Int16'); - -typedef _c_Function1Int16 = ffi.Int16 Function( - ffi.Int16 x, -); - -typedef _dart_Function1Int16 = int Function( - int x, -); - -int Function1Int32( - int x, -) { - return _Function1Int32( - x, - ); -} - -final _dart_Function1Int32 _Function1Int32 = _dylib - .lookupFunction<_c_Function1Int32, _dart_Function1Int32>('Function1Int32'); - -typedef _c_Function1Int32 = ffi.Int32 Function( - ffi.Int32 x, -); - -typedef _dart_Function1Int32 = int Function( - int x, -); - -int Function1Int64( - int x, -) { - return _Function1Int64( - x, - ); -} - -final _dart_Function1Int64 _Function1Int64 = _dylib - .lookupFunction<_c_Function1Int64, _dart_Function1Int64>('Function1Int64'); - -typedef _c_Function1Int64 = ffi.Int64 Function( - ffi.Int64 x, -); - -typedef _dart_Function1Int64 = int Function( - int x, -); - -int Function1Int8( - int x, -) { - return _Function1Int8( - x, - ); -} - -final _dart_Function1Int8 _Function1Int8 = _dylib - .lookupFunction<_c_Function1Int8, _dart_Function1Int8>('Function1Int8'); - -typedef _c_Function1Int8 = ffi.Int8 Function( - ffi.Int8 x, -); - -typedef _dart_Function1Int8 = int Function( - int x, -); - -int Function1IntPtr( - int x, -) { - return _Function1IntPtr( - x, - ); -} - -final _dart_Function1IntPtr _Function1IntPtr = - _dylib.lookupFunction<_c_Function1IntPtr, _dart_Function1IntPtr>( - 'Function1IntPtr'); - -typedef _c_Function1IntPtr = ffi.IntPtr Function( - ffi.IntPtr x, -); +/// Native tests. +class NativeLibrary { + /// Holds the Dynamic library. + final ffi.DynamicLibrary _dylib; + + /// The symbols are looked up in [dynamicLibrary]. + NativeLibrary(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + + int Function1Uint8( + int x, + ) { + _Function1Uint8 ??= + _dylib.lookupFunction<_c_Function1Uint8, _dart_Function1Uint8>( + 'Function1Uint8'); + return _Function1Uint8( + x, + ); + } -typedef _dart_Function1IntPtr = int Function( - int x, -); + _dart_Function1Uint8 _Function1Uint8; + + int Function1Uint16( + int x, + ) { + _Function1Uint16 ??= + _dylib.lookupFunction<_c_Function1Uint16, _dart_Function1Uint16>( + 'Function1Uint16'); + return _Function1Uint16( + x, + ); + } -int Function1Uint16( - int x, -) { - return _Function1Uint16( - x, - ); -} + _dart_Function1Uint16 _Function1Uint16; + + int Function1Uint32( + int x, + ) { + _Function1Uint32 ??= + _dylib.lookupFunction<_c_Function1Uint32, _dart_Function1Uint32>( + 'Function1Uint32'); + return _Function1Uint32( + x, + ); + } -final _dart_Function1Uint16 _Function1Uint16 = - _dylib.lookupFunction<_c_Function1Uint16, _dart_Function1Uint16>( - 'Function1Uint16'); + _dart_Function1Uint32 _Function1Uint32; + + int Function1Uint64( + int x, + ) { + _Function1Uint64 ??= + _dylib.lookupFunction<_c_Function1Uint64, _dart_Function1Uint64>( + 'Function1Uint64'); + return _Function1Uint64( + x, + ); + } -typedef _c_Function1Uint16 = ffi.Uint16 Function( - ffi.Uint16 x, -); + _dart_Function1Uint64 _Function1Uint64; -typedef _dart_Function1Uint16 = int Function( - int x, -); + int Function1Int8( + int x, + ) { + _Function1Int8 ??= _dylib + .lookupFunction<_c_Function1Int8, _dart_Function1Int8>('Function1Int8'); + return _Function1Int8( + x, + ); + } -int Function1Uint32( - int x, -) { - return _Function1Uint32( - x, - ); -} + _dart_Function1Int8 _Function1Int8; + + int Function1Int16( + int x, + ) { + _Function1Int16 ??= + _dylib.lookupFunction<_c_Function1Int16, _dart_Function1Int16>( + 'Function1Int16'); + return _Function1Int16( + x, + ); + } -final _dart_Function1Uint32 _Function1Uint32 = - _dylib.lookupFunction<_c_Function1Uint32, _dart_Function1Uint32>( - 'Function1Uint32'); + _dart_Function1Int16 _Function1Int16; + + int Function1Int32( + int x, + ) { + _Function1Int32 ??= + _dylib.lookupFunction<_c_Function1Int32, _dart_Function1Int32>( + 'Function1Int32'); + return _Function1Int32( + x, + ); + } -typedef _c_Function1Uint32 = ffi.Uint32 Function( - ffi.Uint32 x, -); + _dart_Function1Int32 _Function1Int32; + + int Function1Int64( + int x, + ) { + _Function1Int64 ??= + _dylib.lookupFunction<_c_Function1Int64, _dart_Function1Int64>( + 'Function1Int64'); + return _Function1Int64( + x, + ); + } -typedef _dart_Function1Uint32 = int Function( - int x, -); + _dart_Function1Int64 _Function1Int64; + + int Function1IntPtr( + int x, + ) { + _Function1IntPtr ??= + _dylib.lookupFunction<_c_Function1IntPtr, _dart_Function1IntPtr>( + 'Function1IntPtr'); + return _Function1IntPtr( + x, + ); + } -int Function1Uint64( - int x, -) { - return _Function1Uint64( - x, - ); -} + _dart_Function1IntPtr _Function1IntPtr; + + double Function1Float( + double x, + ) { + _Function1Float ??= + _dylib.lookupFunction<_c_Function1Float, _dart_Function1Float>( + 'Function1Float'); + return _Function1Float( + x, + ); + } -final _dart_Function1Uint64 _Function1Uint64 = - _dylib.lookupFunction<_c_Function1Uint64, _dart_Function1Uint64>( - 'Function1Uint64'); + _dart_Function1Float _Function1Float; + + double Function1Double( + double x, + ) { + _Function1Double ??= + _dylib.lookupFunction<_c_Function1Double, _dart_Function1Double>( + 'Function1Double'); + return _Function1Double( + x, + ); + } -typedef _c_Function1Uint64 = ffi.Uint64 Function( - ffi.Uint64 x, -); + _dart_Function1Double _Function1Double; -typedef _dart_Function1Uint64 = int Function( - int x, -); + ffi.Pointer getStruct1() { + _getStruct1 ??= + _dylib.lookupFunction<_c_getStruct1, _dart_getStruct1>('getStruct1'); + return _getStruct1(); + } -int Function1Uint8( - int x, -) { - return _Function1Uint8( - x, - ); + _dart_getStruct1 _getStruct1; } -final _dart_Function1Uint8 _Function1Uint8 = _dylib - .lookupFunction<_c_Function1Uint8, _dart_Function1Uint8>('Function1Uint8'); - -typedef _c_Function1Uint8 = ffi.Uint8 Function( - ffi.Uint8 x, -); - -typedef _dart_Function1Uint8 = int Function( - int x, -); - class Struct1 extends ffi.Struct { @ffi.Int8() int a; @ffi.Int32() - int _data_item_0; + int _unique_data_item_0; @ffi.Int32() - int _data_item_1; + int _unique_data_item_1; @ffi.Int32() - int _data_item_2; + int _unique_data_item_2; @ffi.Int32() - int _data_item_3; + int _unique_data_item_3; @ffi.Int32() - int _data_item_4; + int _unique_data_item_4; @ffi.Int32() - int _data_item_5; + int _unique_data_item_5; /// Helper for array `data`. ArrayHelper_Struct1_data_level0 get data => @@ -321,17 +258,17 @@ class ArrayHelper_Struct1_data_level2 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - return _struct._data_item_0; + return _struct._unique_data_item_0; case 1: - return _struct._data_item_1; + return _struct._unique_data_item_1; case 2: - return _struct._data_item_2; + return _struct._unique_data_item_2; case 3: - return _struct._data_item_3; + return _struct._unique_data_item_3; case 4: - return _struct._data_item_4; + return _struct._unique_data_item_4; case 5: - return _struct._data_item_5; + return _struct._unique_data_item_5; default: throw Exception('Invalid Array Helper generated.'); } @@ -341,22 +278,22 @@ class ArrayHelper_Struct1_data_level2 { _checkBounds(index); switch (_absoluteIndex + index) { case 0: - _struct._data_item_0 = value; + _struct._unique_data_item_0 = value; break; case 1: - _struct._data_item_1 = value; + _struct._unique_data_item_1 = value; break; case 2: - _struct._data_item_2 = value; + _struct._unique_data_item_2 = value; break; case 3: - _struct._data_item_3 = value; + _struct._unique_data_item_3 = value; break; case 4: - _struct._data_item_4 = value; + _struct._unique_data_item_4 = value; break; case 5: - _struct._data_item_5 = value; + _struct._unique_data_item_5 = value; break; default: throw Exception('Invalid Array Helper generated.'); @@ -364,12 +301,93 @@ class ArrayHelper_Struct1_data_level2 { } } -ffi.Pointer getStruct1() { - return _getStruct1(); -} +typedef _c_Function1Uint8 = ffi.Uint8 Function( + ffi.Uint8 x, +); -final _dart_getStruct1 _getStruct1 = - _dylib.lookupFunction<_c_getStruct1, _dart_getStruct1>('getStruct1'); +typedef _dart_Function1Uint8 = int Function( + int x, +); + +typedef _c_Function1Uint16 = ffi.Uint16 Function( + ffi.Uint16 x, +); + +typedef _dart_Function1Uint16 = int Function( + int x, +); + +typedef _c_Function1Uint32 = ffi.Uint32 Function( + ffi.Uint32 x, +); + +typedef _dart_Function1Uint32 = int Function( + int x, +); + +typedef _c_Function1Uint64 = ffi.Uint64 Function( + ffi.Uint64 x, +); + +typedef _dart_Function1Uint64 = int Function( + int x, +); + +typedef _c_Function1Int8 = ffi.Int8 Function( + ffi.Int8 x, +); + +typedef _dart_Function1Int8 = int Function( + int x, +); + +typedef _c_Function1Int16 = ffi.Int16 Function( + ffi.Int16 x, +); + +typedef _dart_Function1Int16 = int Function( + int x, +); + +typedef _c_Function1Int32 = ffi.Int32 Function( + ffi.Int32 x, +); + +typedef _dart_Function1Int32 = int Function( + int x, +); + +typedef _c_Function1Int64 = ffi.Int64 Function( + ffi.Int64 x, +); + +typedef _dart_Function1Int64 = int Function( + int x, +); + +typedef _c_Function1IntPtr = ffi.IntPtr Function( + ffi.IntPtr x, +); + +typedef _dart_Function1IntPtr = int Function( + int x, +); + +typedef _c_Function1Float = ffi.Float Function( + ffi.Float x, +); + +typedef _dart_Function1Float = double Function( + double x, +); + +typedef _c_Function1Double = ffi.Double Function( + ffi.Double x, +); + +typedef _dart_Function1Double = double Function( + double x, +); typedef _c_getStruct1 = ffi.Pointer Function(); diff --git a/pkgs/ffigen/test/prefix_tests/prefix_test.dart b/pkgs/ffigen/test/prefix_tests/prefix_test.dart index ba1e56d4df..55ebc8affc 100644 --- a/pkgs/ffigen/test/prefix_tests/prefix_test.dart +++ b/pkgs/ffigen/test/prefix_tests/prefix_test.dart @@ -33,10 +33,8 @@ ${strings.description}: 'Prefix Test' ${strings.output}: 'unused' ${strings.headers}: - - 'test/prefix_tests/prefix.h' -${strings.headerFilter}: - ${strings.include}: - - 'prefix.h' + ${strings.entryPoints}: + - 'test/prefix_tests/prefix.h' functions: ${strings.prefix}: $functionPrefix diff --git a/pkgs/ffigen/test/test_utils.dart b/pkgs/ffigen/test/test_utils.dart index 8d49c18f46..0d94d29de5 100644 --- a/pkgs/ffigen/test/test_utils.dart +++ b/pkgs/ffigen/test/test_utils.dart @@ -2,8 +2,12 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'dart:io'; + import 'package:ffigen/src/code_generator.dart'; import 'package:logging/logging.dart'; +import 'package:path/path.dart' as path; +import 'package:test/test.dart'; /// Extracts a binding's string from a library. @@ -31,6 +35,29 @@ extension LibraryTestExt on Library { } } +/// Generates actual file using library and tests using [expect] with expected +/// +/// This will not delete the actual debug file incase [expect] throws an error. +void matchLibraryWithExpected( + Library library, List pathForActual, List pathToExpected) { + final file = File( + path.joinAll(pathForActual), + ); + library.generateFile(file); + + try { + final actual = file.readAsStringSync(); + final expected = File(path.joinAll(pathToExpected)).readAsStringSync(); + expect(actual, expected); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + print('Failed test: Debug generated file: ${file.absolute?.path}'); + rethrow; + } +} + class NotFoundException implements Exception { final String message; NotFoundException(this.message); diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index bc0754c222..852631790d 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -15,12 +15,12 @@ output: 'lib/src/header_parser/clang_bindings/clang_bindings.dart' sort: true compiler-opts: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' headers: - - 'lib/src/clang_library/wrapper.c' -header-filter: - include: - - wrapper.c - - Index.h - - CXString.h + entry-points: + - 'lib/src/clang_library/wrapper.c' + include-directives: + - '**wrapper.c' + - '**Index.h' + - '**CXString.h' array-workaround: true From 09af0376f34767a0552ca2d8f32991ca495ac9fa Mon Sep 17 00:00:00 2001 From: Prerak Mann <31154435+mannprerak2@users.noreply.github.com> Date: Mon, 3 Aug 2020 14:22:50 +0530 Subject: [PATCH 024/276] [ffigen] Escaped special characters $ and ' from string macros. (#64) --- .../src/header_parser/sub_parsers/macro_parser.dart | 8 ++++++-- pkgs/ffigen/test/header_parser_tests/macros.h | 4 ++++ pkgs/ffigen/test/header_parser_tests/macros_test.dart | 10 ++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart index 3971daf726..87bb642a36 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart @@ -132,12 +132,16 @@ int _macroVariablevisitor(Pointer cursor, ); break; case clang_types.CXEvalResultKind.CXEval_StrLiteral: + var value = Utf8.fromUtf8(clang.clang_EvalResult_getAsStr(e).cast()); + // Escape $ character. + value = value.replaceAll(r'$', r'\$'); + // Escape ' character, because our strings are enclosed with '. + value = value.replaceAll("'", r"\'"); constant = Constant( originalName: _savedMacros[macroName], name: macroName, rawType: 'String', - rawValue: - "'${Utf8.fromUtf8(clang.clang_EvalResult_getAsStr(e).cast())}'", + rawValue: "'${value}'", ); break; } diff --git a/pkgs/ffigen/test/header_parser_tests/macros.h b/pkgs/ffigen/test/header_parser_tests/macros.h index b405db4a68..d75bcca76f 100644 --- a/pkgs/ffigen/test/header_parser_tests/macros.h +++ b/pkgs/ffigen/test/header_parser_tests/macros.h @@ -14,3 +14,7 @@ #define TEST7(x, y) x *y #define TEST8 5,2,3 + +// These tests that special characters are escaped properly. +#define TEST9 "$dollar" +#define TEST10 "test's" diff --git a/pkgs/ffigen/test/header_parser_tests/macros_test.dart b/pkgs/ffigen/test/header_parser_tests/macros_test.dart index 74bbcfc615..e3588738ab 100644 --- a/pkgs/ffigen/test/header_parser_tests/macros_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/macros_test.dart @@ -64,6 +64,14 @@ ${strings.headers}: expect(actual.getBindingAsString('TEST8'), expected.getBindingAsString('TEST8')); }); + test('TEST9', () { + expect(actual.getBindingAsString('TEST9'), + expected.getBindingAsString('TEST9')); + }); + test('TEST10', () { + expect(actual.getBindingAsString('TEST10'), + expected.getBindingAsString('TEST10')); + }); }); } @@ -78,6 +86,8 @@ Library expectedLibrary() { Constant(name: 'TEST5', rawType: 'int', rawValue: '4'), Constant(name: 'TEST6', rawType: 'int', rawValue: '1'), Constant(name: 'TEST8', rawType: 'int', rawValue: '5'), + Constant(name: 'TEST9', rawType: 'String', rawValue: r"'\$dollar'"), + Constant(name: 'TEST10', rawType: 'String', rawValue: r"'test\'s'"), ], ); } From f6b924746bec7ef882c8e19565e348a03b2d4aa6 Mon Sep 17 00:00:00 2001 From: Prerak Mann <31154435+mannprerak2@users.noreply.github.com> Date: Tue, 4 Aug 2020 15:40:56 +0530 Subject: [PATCH 025/276] [ffigen] Simpler include/exclude, regexp based renaming for declarations (#62) * Removes names/matches from include/exclude. Updated examples. Removed typedef incremental renaming. * restored incremental typedef naming using IncrementalNamer, (this improves UniqueNamer's performance because there are less clashes * added declaration renaming * minor changes * updated readme, changelog * readme fix * added to changelog * simplified declaration using includer and renamer * Includer: replaced firstMatch and end comparision with quiver.matchesFull --- pkgs/ffigen/CHANGELOG.md | 2 + pkgs/ffigen/README.md | 26 +- .../example/libclang-example/pubspec.yaml | 13 +- .../lib/src/config_provider/config_types.dart | 148 +++-- .../lib/src/config_provider/spec_utils.dart | 122 +++-- pkgs/ffigen/lib/src/header_parser/data.dart | 5 + pkgs/ffigen/lib/src/header_parser/parser.dart | 1 + .../sub_parsers/enumdecl_parser.dart | 2 +- .../sub_parsers/functiondecl_parser.dart | 2 +- .../sub_parsers/macro_parser.dart | 2 +- .../sub_parsers/structdecl_parser.dart | 2 +- .../type_extractor/extractor.dart | 16 +- pkgs/ffigen/lib/src/header_parser/utils.dart | 12 + pkgs/ffigen/lib/src/strings.dart | 8 +- .../example_tests/libclang_example_test.dart | 13 +- .../nested_parsing_test.dart | 3 +- .../unnamed_enums_test.dart | 3 +- .../_expected_cjson_bindings.dart | 8 +- .../_expected_sqlite_bindings.dart | 512 +++++++++--------- .../large_integration_tests/large_test.dart | 7 +- .../prefix.h => rename_tests/rename.h} | 11 + .../rename_test.dart} | 140 +++-- pkgs/ffigen/tool/libclang_config.yaml | 127 +++-- 23 files changed, 636 insertions(+), 549 deletions(-) rename pkgs/ffigen/test/{prefix_tests/prefix.h => rename_tests/rename.h} (74%) rename pkgs/ffigen/test/{prefix_tests/prefix_test.dart => rename_tests/rename_test.dart} (53%) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index bcd11c7aef..ba4e38451f 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,5 +1,7 @@ # 0.2.0-dev - Updated header config. Header `entry-points` and `include-directives` are now specified under `headers` key. Glob syntax is allowed. +- Updated declaration `include`/`exclude` config. These are now specified as a list. +- Added Regexp based declaration renaming using `rename` subkey. # 0.1.5 - Added support for parsing macros and anonymous unnamed enums. These are generated as top level constants. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 7cee8231a2..ed8ff8239e 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -14,7 +14,8 @@ Add configurations to Pubspec File: ffigen: output: 'generated_bindings.dart' headers: - - 'example.h' + entry-points: + - 'example.h' ``` Output (_generated_bindings.dart_). ```dart @@ -39,7 +40,7 @@ typedef _dart_sum = int Function(int a,int b); - Run the tool- `pub run ffigen`. ## Setup -`package:ffigen` uses LLVM. Install LLVM in the following way. +`package:ffigen` uses LLVM. Install LLVM (9+) in the following way. #### ubuntu/linux 1. Install libclangdev - `sudo apt-get install libclang-dev`. @@ -107,17 +108,16 @@ headers: Filters for declarations.
Default: all are included

 functions:
-  include: # Exclude is also available.
-    names: # Matches with exact name.
-      - someFuncName
-      - anotherName
-    matches: # Matches using regexp.
-      - prefix.*
-      - [a-z][a-zA-Z0-9]*
-  prefix: 'cx_' # Prefix added to all functions.
-  prefix-replacement: # Replaces a functions's prefix.
-    'clang_': ''
-    '_': 'C'
+ include: # 'exclude' is also available. + - [a-z][a-zA-Z0-9]* # Matches using regexp. + - prefix.* # '.' matches any character. + - someFuncName # Matches with exact name + - anotherName # full names have higher priority. + rename: + 'clang_(.*)': '$1' # Regexp groups based replacement. + 'clang_dispose': 'dispose' # full name matches have higher priority. + '_(.*)': '$1' # Removes '_' from beginning of a name. +
array-workaround diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index b05796f264..246400a489 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -27,19 +27,14 @@ ffigen: compiler-opts: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -IC:\Progra~1\LLVM\include -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' functions: include: - matches: - # Should be valid regexp. - - 'clang_.*' + - 'clang_.*' # Can be a regexp, '.' matches any character. structs: include: - matches: - - 'CX.*' + - 'CX.*' enums: include: - # Compares the exact name. - names: - - 'CXTypeKind' - - 'CXGlobalOptFlags' + - 'CXTypeKind' # Full names are given higher priority than regexp. + - 'CXGlobalOptFlags' # These are optional and also default, # Omitting any and the default will be used. diff --git a/pkgs/ffigen/lib/src/config_provider/config_types.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart index a417a182fc..302e69a307 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_types.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart @@ -91,72 +91,86 @@ class GlobHeaderFilter extends HeaderIncludeFilter { } } -/// A generic declaration config. +/// A generic declaration config, used for Functions, Structs and Enums. class Declaration { - // matchers - List _includeMatchers = []; - Set _includeFull = {}; - List _excludeMatchers = []; - Set _excludeFull = {}; - String _globalPrefix = ''; - Map _prefixReplacement = {}; + final Includer _includer; + final Renamer _renamer; Declaration({ - List includeMatchers, - List includeFull, - List excludeMatchers, - List excludeFull, - String globalPrefix, - Map prefixReplacement, - }) { - if (includeMatchers != null) { - _includeMatchers = - includeMatchers.map((e) => RegExp(e, dotAll: true)).toList(); - } - if (includeFull != null) { - _includeFull = includeFull.map((e) => e).toSet(); - } - if (excludeMatchers != null) { - _excludeMatchers = - excludeMatchers.map((e) => RegExp(e, dotAll: true)).toList(); - } - if (excludeFull != null) { - _excludeFull = excludeFull.map((e) => e).toSet(); - } - if (globalPrefix != null) { - _globalPrefix = globalPrefix; - } - if (prefixReplacement != null) { - _prefixReplacement = prefixReplacement; - } - } + Includer includer, + Renamer renamer, + }) : _includer = includer ?? Includer(), + _renamer = renamer ?? Renamer(); - /// Applies prefix and replacement and returns the result. - /// - /// Also logs warnings if declaration starts with '_'. - String getPrefixedName(String name) { - // Apply prefix replacement. - for (final pattern in _prefixReplacement.keys) { - if (name.startsWith(pattern)) { - name = name.replaceFirst(pattern, _prefixReplacement[pattern]); - break; - } - } + /// Applies renaming and returns the result. + String renameUsingConfig(String name) => _renamer.renameUsingConfig(name); - // Apply global prefixes. - name = '${_globalPrefix}$name'; + /// Checks if a name is allowed by a filter. + bool shouldInclude(String name) => _includer.shouldInclude(name); +} - return name; +/// Matches `$`, value can be accessed in group 1 of match. +final replaceGroupRegexp = RegExp(r'\$([0-9])'); + +class RenamePattern { + final RegExp regExp; + final String replacementPattern; + + RenamePattern(this.regExp, this.replacementPattern); + + /// Returns true if [str] has a full match with [regExp]. + bool matches(String str) => quiver.matchesFull(regExp, str); + + /// Renames [str] according to [replacementPattern]. + String rename(String str) { + if (quiver.matchesFull(regExp, str)) { + final regExpMatch = regExp.firstMatch(str); + final groups = regExpMatch.groups( + List.generate(regExpMatch.groupCount, (index) => index) + + [regExpMatch.groupCount]); + + final result = + replacementPattern.replaceAllMapped(replaceGroupRegexp, (match) { + final groupInt = int.parse(match.group(1)); + return groups[groupInt]; + }); + return result; + } else { + /// We return [str] if pattern doesn't have a full match. + return str; + } } - /// Checks if a name is allowed by a filter. + @override + String toString() { + return 'Regexp: $regExp, ReplacementPattern: $replacementPattern'; + } +} + +class Includer { + // matchers + final List _includeMatchers; + final Set _includeFull; + final List _excludeMatchers; + final Set _excludeFull; + + Includer({ + List includeMatchers, + Set includeFull, + List excludeMatchers, + Set excludeFull, + }) : _includeMatchers = includeMatchers ?? [], + _includeFull = includeFull ?? {}, + _excludeMatchers = excludeMatchers ?? [], + _excludeFull = excludeFull ?? {}; + bool shouldInclude(String name) { if (_excludeFull.contains(name)) { return false; } for (final em in _excludeMatchers) { - if (em.firstMatch(name)?.end == name.length) { + if (quiver.matchesFull(em, name)) { return false; } } @@ -166,7 +180,7 @@ class Declaration { } for (final im in _includeMatchers) { - if (im.firstMatch(name)?.end == name.length) { + if (quiver.matchesFull(im, name)) { return true; } } @@ -180,3 +194,31 @@ class Declaration { } } } + +class Renamer { + final Map _renameFull; + final List _renameMatchers; + + Renamer({ + List renamePatterns, + Map renameFull, + }) : _renameMatchers = renamePatterns ?? [], + _renameFull = renameFull ?? {}; + + String renameUsingConfig(String name) { + // Apply full rename (if any). + if (_renameFull.containsKey(name)) { + return _renameFull[name]; + } + + // Apply rename regexp (if matches). + for (final renamer in _renameMatchers) { + if (renamer.matches(name)) { + return renamer.rename(name); + } + } + + // No renaming is provided for this declaration, return unchanged. + return name; + } +} diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index d6d08cf20e..8b29d9de33 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -26,9 +26,12 @@ String _replaceSeparators(String path) { } /// Checks if type of value is [T], logs an error if it's not. -bool checkType(String key, dynamic value) { +/// +/// [key] is printed as `'item1 -> item2 => item3'` in log message. +bool checkType(List keys, dynamic value) { if (value is! T) { - _logger.severe("Expected value of key '$key' to be of type '${T}'."); + _logger.severe( + "Expected value of key '${keys.join(' -> ')}' to be of type '${T}'."); return false; } return true; @@ -37,7 +40,7 @@ bool checkType(String key, dynamic value) { bool booleanExtractor(dynamic value) => value as bool; bool booleanValidator(String name, dynamic value) => - checkType(name, value); + checkType([name], value); Map sizemapExtractor(dynamic yamlConfig) { final resultMap = {}; @@ -56,7 +59,7 @@ Map sizemapExtractor(dynamic yamlConfig) { } bool sizemapValidator(String name, dynamic yamlConfig) { - if (!checkType(name, yamlConfig)) { + if (!checkType([name], yamlConfig)) { return false; } for (final key in (yamlConfig as YamlMap).keys) { @@ -72,7 +75,7 @@ List compilerOptsExtractor(dynamic value) => (value as String)?.split(' '); bool compilerOptsValidator(String name, dynamic value) => - checkType(name, value); + checkType([name], value); Headers headersExtractor(dynamic yamlConfig) { final entryPoints = []; @@ -112,7 +115,7 @@ Headers headersExtractor(dynamic yamlConfig) { } bool headersValidator(String name, dynamic value) { - if (!checkType(name, value)) { + if (!checkType([name], value)) { return false; } if (!(value as YamlMap).containsKey(strings.entryPoints)) { @@ -121,8 +124,7 @@ bool headersValidator(String name, dynamic value) { } else { for (final key in (value as YamlMap).keys) { if (key == strings.entryPoints || key == strings.includeDirectives) { - if (!checkType(key as String, value[key])) { - _logger.severe("Expected '$name -> $key' to be a Map."); + if (!checkType([name, key as String], value[key])) { return false; } } else { @@ -137,7 +139,7 @@ bool headersValidator(String name, dynamic value) { String libclangDylibExtractor(dynamic value) => getDylibPath(value as String); bool libclangDylibValidator(String name, dynamic value) { - if (!checkType(name, value)) { + if (!checkType([name], value)) { return false; } else { final dylibPath = getDylibPath(value as String); @@ -167,37 +169,68 @@ String getDylibPath(String dylibParentFoler) { String outputExtractor(dynamic value) => _replaceSeparators(value as String); bool outputValidator(String name, dynamic value) => - checkType(name, value); + checkType([name], value); -Declaration declarationConfigExtractor(dynamic yamlMap) { - List includeMatchers, includeFull, excludeMatchers, excludeFull; - String prefix; - Map prefixReplacement; +/// Returns true if [str] is not a full name. +/// +/// E.g `abc` is a full name, `abc.*` is not. +bool isFullDeclarationName(String str) => + quiver.matchesFull(RegExp('[a-zA-Z_0-9]*'), str); - final include = yamlMap[strings.include] as YamlMap; +Declaration declarationConfigExtractor(dynamic yamlMap) { + final includeMatchers = [], + includeFull = {}, + excludeMatchers = [], + excludeFull = {}; + final renamePatterns = []; + final renameFull = {}; + + final include = (yamlMap[strings.include] as YamlList)?.cast(); if (include != null) { - includeMatchers = (include[strings.matches] as YamlList)?.cast(); - includeFull = (include[strings.names] as YamlList)?.cast(); + for (final str in include) { + if (isFullDeclarationName(str)) { + includeFull.add(str); + } else { + includeMatchers.add(RegExp(str, dotAll: true)); + } + } } - final exclude = yamlMap[strings.exclude] as YamlMap; + final exclude = (yamlMap[strings.exclude] as YamlList)?.cast(); if (exclude != null) { - excludeMatchers = (exclude[strings.matches] as YamlList)?.cast(); - excludeFull = (exclude[strings.names] as YamlList)?.cast(); + for (final str in exclude) { + if (isFullDeclarationName(str)) { + excludeFull.add(str); + } else { + excludeMatchers.add(RegExp(str, dotAll: true)); + } + } } - prefix = yamlMap[strings.prefix] as String; + final rename = (yamlMap[strings.rename] as YamlMap)?.cast(); - prefixReplacement = - (yamlMap[strings.prefix_replacement] as YamlMap)?.cast(); + if (rename != null) { + for (final str in rename.keys) { + if (isFullDeclarationName(str)) { + renameFull[str] = rename[str]; + } else { + renamePatterns + .add(RenamePattern(RegExp(str, dotAll: true), rename[str])); + } + } + } return Declaration( - includeMatchers: includeMatchers, - includeFull: includeFull, - excludeMatchers: excludeMatchers, - excludeFull: excludeFull, - globalPrefix: prefix, - prefixReplacement: prefixReplacement, + includer: Includer( + includeMatchers: includeMatchers, + includeFull: includeFull, + excludeMatchers: excludeMatchers, + excludeFull: excludeFull, + ), + renamer: Renamer( + renameFull: renameFull, + renamePatterns: renamePatterns, + ), ); } @@ -206,35 +239,16 @@ bool declarationConfigValidator(String name, dynamic value) { if (value is YamlMap) { for (final key in value.keys) { if (key == strings.include || key == strings.exclude) { - if (value[key] is! YamlMap) { - _logger.severe("Expected '$name -> $key' to be a Map."); - _result = false; - } - for (final subkey in value[key].keys) { - if (subkey == strings.matches || subkey == strings.names) { - if (value[key][subkey] is! YamlList) { - _logger - .severe("Expected '$name -> $key -> $subkey' to be a List."); - _result = false; - } - } else { - _logger.severe("Unknown key '$subkey' in '$name -> $key'."); - } - } - } else if (key == strings.prefix) { - if (value[key] is! String) { - _logger.severe("Expected '$name -> $key' to be a String."); + if (!checkType([name, key as String], value[key])) { _result = false; } - } else if (key == strings.prefix_replacement) { - if (value[key] is! YamlMap) { - _logger.severe("Expected '$name -> $key' to be a Map."); + } else if (key == strings.rename) { + if (!checkType([name, key as String], value[key])) { _result = false; } else { for (final subkey in value[key].keys) { - if (value[key][subkey] is! String) { - _logger.severe( - "Expected '$name -> $key -> $subkey' to be a String."); + if (!checkType( + [name, key as String, subkey as String], value[key][subkey])) { _result = false; } } @@ -280,7 +294,7 @@ bool nonEmptyStringValidator(String name, dynamic value) { bool dartClassNameValidator(String name, dynamic value) { if (value is String && - RegExp('[a-zA-Z]+[_a-zA-Z0-9]*').stringMatch(value) == value) { + quiver.matchesFull(RegExp('[a-zA-Z]+[_a-zA-Z0-9]*'), value)) { return true; } else { _logger.severe( diff --git a/pkgs/ffigen/lib/src/header_parser/data.dart b/pkgs/ffigen/lib/src/header_parser/data.dart index ebda2dc84c..87551cb221 100644 --- a/pkgs/ffigen/lib/src/header_parser/data.dart +++ b/pkgs/ffigen/lib/src/header_parser/data.dart @@ -8,6 +8,8 @@ import 'dart:isolate'; import 'package:ffigen/src/config_provider.dart'; import 'clang_bindings/clang_bindings.dart' show Clang; +import 'utils.dart'; + /// Holds all Global shared variables. /// Holds configurations. @@ -16,6 +18,9 @@ Config config; /// Holds clang functions. Clang clang; +/// Used for naming typedefs. +IncrementalNamer incrementalNamer; + /// Holds the unique id refering to this isolate. /// /// Used by visitChildren_wrap to call the correct dart function from C. diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index 29a86e5031..87e14ef1f7 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -49,6 +49,7 @@ var _logger = Logger('ffigen.header_parser.parser'); void initParser(Config c) { // Set global configurations. config = c; + incrementalNamer = IncrementalNamer(); // Find full path of dynamic library and initialise bindings. if (findDotDartTool() == null) { diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index 293fa2287c..99b6b57ae3 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -47,7 +47,7 @@ EnumClass parseEnumDeclaration( _stack.top.enumClass = EnumClass( dartDoc: getCursorDocComment(cursor), originalName: enumName, - name: config.enumClassDecl.getPrefixedName(enumName), + name: config.enumClassDecl.renameUsingConfig(enumName), ); addEnumClassToSeen(enumName, _stack.top.enumClass); _addEnumConstant(cursor); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index 8f35c24a01..f3e15074c4 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -65,7 +65,7 @@ Func parseFunctionDeclaration(Pointer cursor) { cursor, nesting.length + commentPrefix.length, ), - name: config.functionDecl.getPrefixedName(funcName), + name: config.functionDecl.renameUsingConfig(funcName), originalName: funcName, returnType: rt, parameters: parameters, diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart index 87bb642a36..27a7b30c0f 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart @@ -31,7 +31,7 @@ void saveMacroDefinition(Pointer cursor) { // Parse macro only if it's not builtin or function-like. _logger.fine( "++++ Saved Macro '$originalMacroName' for later : ${cursor.completeStringRepr()}"); - final prefixedName = config.macroDecl.getPrefixedName(originalMacroName); + final prefixedName = config.macroDecl.renameUsingConfig(originalMacroName); addMacroToSeen(originalMacroName, prefixedName); _saveMacro(prefixedName, originalMacroName); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index 32e2fd780a..32e3a76187 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -47,7 +47,7 @@ Struc parseStructDeclaration( '++++ Adding Structure: structName: ${structName}, ${cursor.completeStringRepr()}'); _stack.top.struc = Struc( originalName: structName, - name: config.structDecl.getPrefixedName(structName), + name: config.structDecl.renameUsingConfig(structName), dartDoc: getCursorDocComment(cursor), ); // Adding to seen here to stop recursion if a struct has itself as a diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index d95b7717a6..1336d7ee85 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -100,7 +100,7 @@ Type _extractfromRecord(Pointer cxtype) { structName = cxtype.spelling(); } - final fixedStructName = config.structDecl.getPrefixedName(structName); + final fixedStructName = config.structDecl.renameUsingConfig(structName); // Also add a struct binding, if its unseen. // TODO(23): Check if we should auto add struct. @@ -135,9 +135,9 @@ Type _extractFromFunctionProto( // Set a name for typedefc incase it was null or empty. if (name == null || name == '') { - name = _getNextIncrementedString('_typedefC'); + name = incrementalNamer.name('_typedefC'); } else { - name = _getNextIncrementedString(name); + name = incrementalNamer.name(name); } final _parameters = []; final totalArgs = clang.clang_getNumArgTypes_wrap(cxtype); @@ -165,13 +165,3 @@ Type _extractFromFunctionProto( return Type.nativeFunc(typedefC); } - -/// Generate a unique string for naming in [Typedef]. -String _getNextIncrementedString(String prefix) { - var i = _incrementedStringCounters[prefix] ?? 0; - i++; - _incrementedStringCounters[prefix] = i; - return '${prefix}_$i'; -} - -Map _incrementedStringCounters = {}; diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index 3591e88897..e8190bf3a5 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -310,3 +310,15 @@ class Stack { T pop() => _stack.removeLast(); void push(T item) => _stack.add(item); } + +class IncrementalNamer { + final _incrementedStringCounters = {}; + + /// Appends `_` to base. is incremented on every call. + String name(String base) { + var i = _incrementedStringCounters[base] ?? 0; + i++; + _incrementedStringCounters[base] = i; + return '${base}_$i'; + } +} diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 619607572f..b432442fed 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -45,13 +45,7 @@ const macros = 'macros'; // Sub-fields of Declarations. const include = 'include'; const exclude = 'exclude'; -const prefix = 'prefix'; -const prefix_replacement = 'prefix-replacement'; - -// Sub-fields of include/exclude. -const matches = 'matches'; // regex -const names = 'names'; // hashset - +const rename = 'rename'; const sizemap = 'size-map'; // Sizemap values. diff --git a/pkgs/ffigen/test/example_tests/libclang_example_test.dart b/pkgs/ffigen/test/example_tests/libclang_example_test.dart index 761dddc007..80cd96dc90 100644 --- a/pkgs/ffigen/test/example_tests/libclang_example_test.dart +++ b/pkgs/ffigen/test/example_tests/libclang_example_test.dart @@ -23,24 +23,21 @@ ${strings.sort}: true ${strings.headers}: ${strings.entryPoints}: - third_party/libclang/include/clang-c/Index.h - ${strings.include}-directives: + ${strings.includeDirectives}: - '**CXString.h' - '**Index.h' ${strings.compilerOpts}: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -IC:\Progra~1\LLVM\include -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' ${strings.functions}: ${strings.include}: - ${strings.matches}: - - 'clang_.*' + - 'clang_.*' ${strings.structs}: ${strings.include}: - ${strings.matches}: - - 'CX.*' + - 'CX.*' ${strings.enums}: ${strings.include}: - ${strings.names}: - - 'CXTypeKind' - - 'CXGlobalOptFlags' + - 'CXTypeKind' + - 'CXGlobalOptFlags' ${strings.name}: 'LibClang' ${strings.description}: 'Holds bindings to LibClang.' diff --git a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart index ed1bacfa2b..c4c01a7aa4 100644 --- a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart @@ -29,8 +29,7 @@ ${strings.headers}: - 'test/header_parser_tests/nested_parsing.h' ${strings.structs}: ${strings.include}: - ${strings.names}: - - Struct1 + - Struct1 ''') as yaml.YamlMap), ); }); diff --git a/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart b/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart index a7ee4c4201..99456f309a 100644 --- a/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart @@ -28,8 +28,7 @@ ${strings.headers}: - 'test/header_parser_tests/unnamed_enums.h' ${strings.enums}: ${strings.exclude}: - ${strings.names}: - - Named + - Named ''') as yaml.YamlMap), ); }); diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart index 7beb2efa09..2a33af35ad 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart @@ -1058,9 +1058,9 @@ class cJSON extends ffi.Struct { } class cJSON_Hooks extends ffi.Struct { - ffi.Pointer> malloc_fn; + ffi.Pointer> malloc_fn; - ffi.Pointer> free_fn; + ffi.Pointer> free_fn; } const int CJSON_VERSION_MAJOR = 1; @@ -1775,10 +1775,10 @@ typedef _dart_cJSON_free = void Function( ffi.Pointer object, ); -typedef _typedefC_11 = ffi.Pointer Function( +typedef _typedefC_1 = ffi.Pointer Function( ffi.Uint64, ); -typedef _typedefC_12 = ffi.Void Function( +typedef _typedefC_2 = ffi.Void Function( ffi.Pointer, ); diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index ad214b3006..f2f0a2350e 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -231,7 +231,7 @@ class SQLite { int sqlite3_exec( ffi.Pointer arg0, ffi.Pointer sql, - ffi.Pointer> callback, + ffi.Pointer> callback, ffi.Pointer arg3, ffi.Pointer> errmsg, ) { @@ -816,7 +816,7 @@ class SQLite { /// or [prepared statement] that invoked the busy handler. int sqlite3_busy_handler( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ) { _sqlite3_busy_handler ??= _dylib.lookupFunction<_c_sqlite3_busy_handler, @@ -1356,7 +1356,7 @@ class SQLite { /// sqlite3_prepare_v2() to reprepare a statement after a schema change. int sqlite3_set_authorizer( ffi.Pointer arg0, - ffi.Pointer> xAuth, + ffi.Pointer> xAuth, ffi.Pointer pUserData, ) { _sqlite3_set_authorizer ??= _dylib.lookupFunction<_c_sqlite3_set_authorizer, @@ -1402,7 +1402,7 @@ class SQLite { /// profile callback. ffi.Pointer sqlite3_trace( ffi.Pointer arg0, - ffi.Pointer> xTrace, + ffi.Pointer> xTrace, ffi.Pointer arg2, ) { _sqlite3_trace ??= _dylib @@ -1418,7 +1418,7 @@ class SQLite { ffi.Pointer sqlite3_profile( ffi.Pointer arg0, - ffi.Pointer> xProfile, + ffi.Pointer> xProfile, ffi.Pointer arg2, ) { _sqlite3_profile ??= @@ -1463,7 +1463,7 @@ class SQLite { int sqlite3_trace_v2( ffi.Pointer arg0, int uMask, - ffi.Pointer> xCallback, + ffi.Pointer> xCallback, ffi.Pointer pCtx, ) { _sqlite3_trace_v2 ??= @@ -1511,7 +1511,7 @@ class SQLite { void sqlite3_progress_handler( ffi.Pointer arg0, int arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, ffi.Pointer arg3, ) { _sqlite3_progress_handler ??= _dylib.lookupFunction< @@ -2819,7 +2819,7 @@ class SQLite { int arg1, ffi.Pointer arg2, int n, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ) { _sqlite3_bind_blob ??= _dylib.lookupFunction<_c_sqlite3_bind_blob, _dart_sqlite3_bind_blob>( @@ -2840,7 +2840,7 @@ class SQLite { int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ) { _sqlite3_bind_blob64 ??= _dylib.lookupFunction<_c_sqlite3_bind_blob64, _dart_sqlite3_bind_blob64>('sqlite3_bind_blob64'); @@ -2925,7 +2925,7 @@ class SQLite { int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ) { _sqlite3_bind_text ??= _dylib.lookupFunction<_c_sqlite3_bind_text, _dart_sqlite3_bind_text>( @@ -2946,7 +2946,7 @@ class SQLite { int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ) { _sqlite3_bind_text16 ??= _dylib.lookupFunction<_c_sqlite3_bind_text16, _dart_sqlite3_bind_text16>('sqlite3_bind_text16'); @@ -2966,7 +2966,7 @@ class SQLite { int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, int encoding, ) { _sqlite3_bind_text64 ??= _dylib.lookupFunction<_c_sqlite3_bind_text64, @@ -3005,7 +3005,7 @@ class SQLite { int arg1, ffi.Pointer arg2, ffi.Pointer arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ) { _sqlite3_bind_pointer ??= _dylib.lookupFunction<_c_sqlite3_bind_pointer, _dart_sqlite3_bind_pointer>('sqlite3_bind_pointer'); @@ -4105,9 +4105,9 @@ class SQLite { int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, ) { _sqlite3_create_function ??= _dylib.lookupFunction< _c_sqlite3_create_function, @@ -4132,9 +4132,9 @@ class SQLite { int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, ) { _sqlite3_create_function16 ??= _dylib.lookupFunction< _c_sqlite3_create_function16, @@ -4159,10 +4159,10 @@ class SQLite { int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xDestroy, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, + ffi.Pointer> xDestroy, ) { _sqlite3_create_function_v2 ??= _dylib.lookupFunction< _c_sqlite3_create_function_v2, @@ -4188,11 +4188,11 @@ class SQLite { int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xValue, - ffi.Pointer> xInverse, - ffi.Pointer> xDestroy, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, + ffi.Pointer> xValue, + ffi.Pointer> xInverse, + ffi.Pointer> xDestroy, ) { _sqlite3_create_window_function ??= _dylib.lookupFunction< _c_sqlite3_create_window_function, @@ -4271,7 +4271,7 @@ class SQLite { _dart_sqlite3_thread_cleanup _sqlite3_thread_cleanup; int sqlite3_memory_alarm( - ffi.Pointer> arg0, + ffi.Pointer> arg0, ffi.Pointer arg1, int arg2, ) { @@ -4831,7 +4831,7 @@ class SQLite { ffi.Pointer arg0, int N, ffi.Pointer arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ) { _sqlite3_set_auxdata ??= _dylib.lookupFunction<_c_sqlite3_set_auxdata, _dart_sqlite3_set_auxdata>('sqlite3_set_auxdata'); @@ -4993,7 +4993,7 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ) { _sqlite3_result_blob ??= _dylib.lookupFunction<_c_sqlite3_result_blob, _dart_sqlite3_result_blob>('sqlite3_result_blob'); @@ -5011,7 +5011,7 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ) { _sqlite3_result_blob64 ??= _dylib.lookupFunction<_c_sqlite3_result_blob64, _dart_sqlite3_result_blob64>('sqlite3_result_blob64'); @@ -5157,7 +5157,7 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ) { _sqlite3_result_text ??= _dylib.lookupFunction<_c_sqlite3_result_text, _dart_sqlite3_result_text>('sqlite3_result_text'); @@ -5175,7 +5175,7 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, int encoding, ) { _sqlite3_result_text64 ??= _dylib.lookupFunction<_c_sqlite3_result_text64, @@ -5195,7 +5195,7 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ) { _sqlite3_result_text16 ??= _dylib.lookupFunction<_c_sqlite3_result_text16, _dart_sqlite3_result_text16>('sqlite3_result_text16'); @@ -5213,7 +5213,7 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ) { _sqlite3_result_text16le ??= _dylib.lookupFunction< _c_sqlite3_result_text16le, @@ -5232,7 +5232,7 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ) { _sqlite3_result_text16be ??= _dylib.lookupFunction< _c_sqlite3_result_text16be, @@ -5265,7 +5265,7 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ) { _sqlite3_result_pointer ??= _dylib.lookupFunction<_c_sqlite3_result_pointer, _dart_sqlite3_result_pointer>('sqlite3_result_pointer'); @@ -5417,7 +5417,7 @@ class SQLite { ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, + ffi.Pointer> xCompare, ) { _sqlite3_create_collation ??= _dylib.lookupFunction< _c_sqlite3_create_collation, @@ -5438,8 +5438,8 @@ class SQLite { ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, - ffi.Pointer> xDestroy, + ffi.Pointer> xCompare, + ffi.Pointer> xDestroy, ) { _sqlite3_create_collation_v2 ??= _dylib.lookupFunction< _c_sqlite3_create_collation_v2, @@ -5461,7 +5461,7 @@ class SQLite { ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, + ffi.Pointer> xCompare, ) { _sqlite3_create_collation16 ??= _dylib.lookupFunction< _c_sqlite3_create_collation16, @@ -5505,7 +5505,7 @@ class SQLite { int sqlite3_collation_needed( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, ) { _sqlite3_collation_needed ??= _dylib.lookupFunction< _c_sqlite3_collation_needed, @@ -5522,7 +5522,7 @@ class SQLite { int sqlite3_collation_needed16( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, ) { _sqlite3_collation_needed16 ??= _dylib.lookupFunction< _c_sqlite3_collation_needed16, @@ -5815,7 +5815,7 @@ class SQLite { /// See also the [sqlite3_update_hook()] interface. ffi.Pointer sqlite3_commit_hook( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ) { _sqlite3_commit_hook ??= _dylib.lookupFunction<_c_sqlite3_commit_hook, @@ -5831,7 +5831,7 @@ class SQLite { ffi.Pointer sqlite3_rollback_hook( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ) { _sqlite3_rollback_hook ??= _dylib.lookupFunction<_c_sqlite3_rollback_hook, @@ -5894,7 +5894,7 @@ class SQLite { /// and [sqlite3_preupdate_hook()] interfaces. ffi.Pointer sqlite3_update_hook( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ) { _sqlite3_update_hook ??= _dylib.lookupFunction<_c_sqlite3_update_hook, @@ -6342,7 +6342,7 @@ class SQLite { /// See also: [sqlite3_reset_auto_extension()] /// and [sqlite3_cancel_auto_extension()] int sqlite3_auto_extension( - ffi.Pointer> xEntryPoint, + ffi.Pointer> xEntryPoint, ) { _sqlite3_auto_extension ??= _dylib.lookupFunction<_c_sqlite3_auto_extension, _dart_sqlite3_auto_extension>('sqlite3_auto_extension'); @@ -6362,7 +6362,7 @@ class SQLite { /// unregistered and it returns 0 if X was not on the list of initialization /// routines. int sqlite3_cancel_auto_extension( - ffi.Pointer> xEntryPoint, + ffi.Pointer> xEntryPoint, ) { _sqlite3_cancel_auto_extension ??= _dylib.lookupFunction< _c_sqlite3_cancel_auto_extension, @@ -6440,7 +6440,7 @@ class SQLite { ffi.Pointer zName, ffi.Pointer p, ffi.Pointer pClientData, - ffi.Pointer> xDestroy, + ffi.Pointer> xDestroy, ) { _sqlite3_create_module_v2 ??= _dylib.lookupFunction< _c_sqlite3_create_module_v2, @@ -8024,7 +8024,7 @@ class SQLite { /// SQLITE_LOCKED.)^ int sqlite3_unlock_notify( ffi.Pointer pBlocked, - ffi.Pointer> xNotify, + ffi.Pointer> xNotify, ffi.Pointer pNotifyArg, ) { _sqlite3_unlock_notify ??= _dylib.lookupFunction<_c_sqlite3_unlock_notify, @@ -8207,7 +8207,7 @@ class SQLite { /// overwrite any prior [sqlite3_wal_hook()] settings. ffi.Pointer sqlite3_wal_hook( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ) { _sqlite3_wal_hook ??= @@ -8955,7 +8955,7 @@ class SQLite { int sqlite3_rtree_geometry_callback( ffi.Pointer db, ffi.Pointer zGeom, - ffi.Pointer> xGeom, + ffi.Pointer> xGeom, ffi.Pointer pContext, ) { _sqlite3_rtree_geometry_callback ??= _dylib.lookupFunction< @@ -8979,9 +8979,9 @@ class SQLite { int sqlite3_rtree_query_callback( ffi.Pointer db, ffi.Pointer zQueryFunc, - ffi.Pointer> xQueryFunc, + ffi.Pointer> xQueryFunc, ffi.Pointer pContext, - ffi.Pointer> xDestructor, + ffi.Pointer> xDestructor, ) { _sqlite3_rtree_query_callback ??= _dylib.lookupFunction< _c_sqlite3_rtree_query_callback, @@ -9006,43 +9006,43 @@ class sqlite3_io_methods extends ffi.Struct { @ffi.Int32() int iVersion; - ffi.Pointer> xClose; + ffi.Pointer> xClose; - ffi.Pointer> xRead; + ffi.Pointer> xRead; - ffi.Pointer> xWrite; + ffi.Pointer> xWrite; - ffi.Pointer> xTruncate; + ffi.Pointer> xTruncate; - ffi.Pointer> xSync; + ffi.Pointer> xSync; - ffi.Pointer> xFileSize; + ffi.Pointer> xFileSize; - ffi.Pointer> xLock; + ffi.Pointer> xLock; - ffi.Pointer> xUnlock; + ffi.Pointer> xUnlock; - ffi.Pointer> xCheckReservedLock; + ffi.Pointer> xCheckReservedLock; - ffi.Pointer> xFileControl; + ffi.Pointer> xFileControl; - ffi.Pointer> xSectorSize; + ffi.Pointer> xSectorSize; - ffi.Pointer> xDeviceCharacteristics; + ffi.Pointer> xDeviceCharacteristics; /// Methods above are valid for version 1 - ffi.Pointer> xShmMap; + ffi.Pointer> xShmMap; - ffi.Pointer> xShmLock; + ffi.Pointer> xShmLock; - ffi.Pointer> xShmBarrier; + ffi.Pointer> xShmBarrier; - ffi.Pointer> xShmUnmap; + ffi.Pointer> xShmUnmap; /// Methods above are valid for version 2 - ffi.Pointer> xFetch; + ffi.Pointer> xFetch; - ffi.Pointer> xUnfetch; + ffi.Pointer> xUnfetch; } class sqlite3_mutex extends ffi.Struct {} @@ -10785,7 +10785,7 @@ typedef _dart_sqlite3_close_v2 = int Function( ffi.Pointer arg0, ); -typedef _typedefC_13 = ffi.Int32 Function( +typedef _typedefC_1 = ffi.Int32 Function( ffi.Pointer, ffi.Int32, ffi.Pointer>, @@ -10795,7 +10795,7 @@ typedef _typedefC_13 = ffi.Int32 Function( typedef _c_sqlite3_exec = ffi.Int32 Function( ffi.Pointer arg0, ffi.Pointer sql, - ffi.Pointer> callback, + ffi.Pointer> callback, ffi.Pointer arg3, ffi.Pointer> errmsg, ); @@ -10803,7 +10803,7 @@ typedef _c_sqlite3_exec = ffi.Int32 Function( typedef _dart_sqlite3_exec = int Function( ffi.Pointer arg0, ffi.Pointer sql, - ffi.Pointer> callback, + ffi.Pointer> callback, ffi.Pointer arg3, ffi.Pointer> errmsg, ); @@ -10910,20 +10910,20 @@ typedef _dart_sqlite3_complete16 = int Function( ffi.Pointer sql, ); -typedef _typedefC_32 = ffi.Int32 Function( +typedef _typedefC_20 = ffi.Int32 Function( ffi.Pointer, ffi.Int32, ); typedef _c_sqlite3_busy_handler = ffi.Int32 Function( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ); typedef _dart_sqlite3_busy_handler = int Function( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ); @@ -11057,7 +11057,7 @@ typedef _dart_sqlite3_randomness = void Function( ffi.Pointer P, ); -typedef _typedefC_33 = ffi.Int32 Function( +typedef _typedefC_21 = ffi.Int32 Function( ffi.Pointer, ffi.Int32, ffi.Pointer, @@ -11068,34 +11068,34 @@ typedef _typedefC_33 = ffi.Int32 Function( typedef _c_sqlite3_set_authorizer = ffi.Int32 Function( ffi.Pointer arg0, - ffi.Pointer> xAuth, + ffi.Pointer> xAuth, ffi.Pointer pUserData, ); typedef _dart_sqlite3_set_authorizer = int Function( ffi.Pointer arg0, - ffi.Pointer> xAuth, + ffi.Pointer> xAuth, ffi.Pointer pUserData, ); -typedef _typedefC_34 = ffi.Void Function( +typedef _typedefC_22 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ); typedef _c_sqlite3_trace = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> xTrace, + ffi.Pointer> xTrace, ffi.Pointer arg2, ); typedef _dart_sqlite3_trace = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> xTrace, + ffi.Pointer> xTrace, ffi.Pointer arg2, ); -typedef _typedefC_35 = ffi.Void Function( +typedef _typedefC_23 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Uint64, @@ -11103,17 +11103,17 @@ typedef _typedefC_35 = ffi.Void Function( typedef _c_sqlite3_profile = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> xProfile, + ffi.Pointer> xProfile, ffi.Pointer arg2, ); typedef _dart_sqlite3_profile = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> xProfile, + ffi.Pointer> xProfile, ffi.Pointer arg2, ); -typedef _typedefC_36 = ffi.Int32 Function( +typedef _typedefC_24 = ffi.Int32 Function( ffi.Uint32, ffi.Pointer, ffi.Pointer, @@ -11123,32 +11123,32 @@ typedef _typedefC_36 = ffi.Int32 Function( typedef _c_sqlite3_trace_v2 = ffi.Int32 Function( ffi.Pointer arg0, ffi.Uint32 uMask, - ffi.Pointer> xCallback, + ffi.Pointer> xCallback, ffi.Pointer pCtx, ); typedef _dart_sqlite3_trace_v2 = int Function( ffi.Pointer arg0, int uMask, - ffi.Pointer> xCallback, + ffi.Pointer> xCallback, ffi.Pointer pCtx, ); -typedef _typedefC_37 = ffi.Int32 Function( +typedef _typedefC_25 = ffi.Int32 Function( ffi.Pointer, ); typedef _c_sqlite3_progress_handler = ffi.Void Function( ffi.Pointer arg0, ffi.Int32 arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, ffi.Pointer arg3, ); typedef _dart_sqlite3_progress_handler = void Function( ffi.Pointer arg0, int arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, ffi.Pointer arg3, ); @@ -11486,7 +11486,7 @@ typedef _dart_sqlite3_stmt_busy = int Function( ffi.Pointer arg0, ); -typedef _typedefC_38 = ffi.Void Function( +typedef _typedefC_26 = ffi.Void Function( ffi.Pointer, ); @@ -11495,7 +11495,7 @@ typedef _c_sqlite3_bind_blob = ffi.Int32 Function( ffi.Int32 arg1, ffi.Pointer arg2, ffi.Int32 n, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ); typedef _dart_sqlite3_bind_blob = int Function( @@ -11503,10 +11503,10 @@ typedef _dart_sqlite3_bind_blob = int Function( int arg1, ffi.Pointer arg2, int n, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ); -typedef _typedefC_39 = ffi.Void Function( +typedef _typedefC_27 = ffi.Void Function( ffi.Pointer, ); @@ -11515,7 +11515,7 @@ typedef _c_sqlite3_bind_blob64 = ffi.Int32 Function( ffi.Int32 arg1, ffi.Pointer arg2, ffi.Uint64 arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ); typedef _dart_sqlite3_bind_blob64 = int Function( @@ -11523,7 +11523,7 @@ typedef _dart_sqlite3_bind_blob64 = int Function( int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ); typedef _c_sqlite3_bind_double = ffi.Int32 Function( @@ -11572,7 +11572,7 @@ typedef _dart_sqlite3_bind_null = int Function( int arg1, ); -typedef _typedefC_40 = ffi.Void Function( +typedef _typedefC_28 = ffi.Void Function( ffi.Pointer, ); @@ -11581,7 +11581,7 @@ typedef _c_sqlite3_bind_text = ffi.Int32 Function( ffi.Int32 arg1, ffi.Pointer arg2, ffi.Int32 arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ); typedef _dart_sqlite3_bind_text = int Function( @@ -11589,10 +11589,10 @@ typedef _dart_sqlite3_bind_text = int Function( int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ); -typedef _typedefC_41 = ffi.Void Function( +typedef _typedefC_29 = ffi.Void Function( ffi.Pointer, ); @@ -11601,7 +11601,7 @@ typedef _c_sqlite3_bind_text16 = ffi.Int32 Function( ffi.Int32 arg1, ffi.Pointer arg2, ffi.Int32 arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ); typedef _dart_sqlite3_bind_text16 = int Function( @@ -11609,10 +11609,10 @@ typedef _dart_sqlite3_bind_text16 = int Function( int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ); -typedef _typedefC_42 = ffi.Void Function( +typedef _typedefC_30 = ffi.Void Function( ffi.Pointer, ); @@ -11621,7 +11621,7 @@ typedef _c_sqlite3_bind_text64 = ffi.Int32 Function( ffi.Int32 arg1, ffi.Pointer arg2, ffi.Uint64 arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ffi.Uint8 encoding, ); @@ -11630,7 +11630,7 @@ typedef _dart_sqlite3_bind_text64 = int Function( int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, int encoding, ); @@ -11646,7 +11646,7 @@ typedef _dart_sqlite3_bind_value = int Function( ffi.Pointer arg2, ); -typedef _typedefC_43 = ffi.Void Function( +typedef _typedefC_31 = ffi.Void Function( ffi.Pointer, ); @@ -11655,7 +11655,7 @@ typedef _c_sqlite3_bind_pointer = ffi.Int32 Function( ffi.Int32 arg1, ffi.Pointer arg2, ffi.Pointer arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ); typedef _dart_sqlite3_bind_pointer = int Function( @@ -11663,7 +11663,7 @@ typedef _dart_sqlite3_bind_pointer = int Function( int arg1, ffi.Pointer arg2, ffi.Pointer arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ); typedef _c_sqlite3_bind_zeroblob = ffi.Int32 Function( @@ -11966,19 +11966,19 @@ typedef _dart_sqlite3_reset = int Function( ffi.Pointer pStmt, ); -typedef _typedefC_44 = ffi.Void Function( +typedef _typedefC_32 = ffi.Void Function( ffi.Pointer, ffi.Int32, ffi.Pointer>, ); -typedef _typedefC_45 = ffi.Void Function( +typedef _typedefC_33 = ffi.Void Function( ffi.Pointer, ffi.Int32, ffi.Pointer>, ); -typedef _typedefC_46 = ffi.Void Function( +typedef _typedefC_34 = ffi.Void Function( ffi.Pointer, ); @@ -11988,9 +11988,9 @@ typedef _c_sqlite3_create_function = ffi.Int32 Function( ffi.Int32 nArg, ffi.Int32 eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, ); typedef _dart_sqlite3_create_function = int Function( @@ -11999,24 +11999,24 @@ typedef _dart_sqlite3_create_function = int Function( int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, ); -typedef _typedefC_47 = ffi.Void Function( +typedef _typedefC_35 = ffi.Void Function( ffi.Pointer, ffi.Int32, ffi.Pointer>, ); -typedef _typedefC_48 = ffi.Void Function( +typedef _typedefC_36 = ffi.Void Function( ffi.Pointer, ffi.Int32, ffi.Pointer>, ); -typedef _typedefC_49 = ffi.Void Function( +typedef _typedefC_37 = ffi.Void Function( ffi.Pointer, ); @@ -12026,9 +12026,9 @@ typedef _c_sqlite3_create_function16 = ffi.Int32 Function( ffi.Int32 nArg, ffi.Int32 eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, ); typedef _dart_sqlite3_create_function16 = int Function( @@ -12037,28 +12037,28 @@ typedef _dart_sqlite3_create_function16 = int Function( int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, ); -typedef _typedefC_50 = ffi.Void Function( +typedef _typedefC_38 = ffi.Void Function( ffi.Pointer, ffi.Int32, ffi.Pointer>, ); -typedef _typedefC_51 = ffi.Void Function( +typedef _typedefC_39 = ffi.Void Function( ffi.Pointer, ffi.Int32, ffi.Pointer>, ); -typedef _typedefC_52 = ffi.Void Function( +typedef _typedefC_40 = ffi.Void Function( ffi.Pointer, ); -typedef _typedefC_53 = ffi.Void Function( +typedef _typedefC_41 = ffi.Void Function( ffi.Pointer, ); @@ -12068,10 +12068,10 @@ typedef _c_sqlite3_create_function_v2 = ffi.Int32 Function( ffi.Int32 nArg, ffi.Int32 eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xDestroy, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, + ffi.Pointer> xDestroy, ); typedef _dart_sqlite3_create_function_v2 = int Function( @@ -12080,33 +12080,33 @@ typedef _dart_sqlite3_create_function_v2 = int Function( int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xDestroy, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, + ffi.Pointer> xDestroy, ); -typedef _typedefC_54 = ffi.Void Function( +typedef _typedefC_42 = ffi.Void Function( ffi.Pointer, ffi.Int32, ffi.Pointer>, ); -typedef _typedefC_55 = ffi.Void Function( +typedef _typedefC_43 = ffi.Void Function( ffi.Pointer, ); -typedef _typedefC_56 = ffi.Void Function( +typedef _typedefC_44 = ffi.Void Function( ffi.Pointer, ); -typedef _typedefC_57 = ffi.Void Function( +typedef _typedefC_45 = ffi.Void Function( ffi.Pointer, ffi.Int32, ffi.Pointer>, ); -typedef _typedefC_58 = ffi.Void Function( +typedef _typedefC_46 = ffi.Void Function( ffi.Pointer, ); @@ -12116,11 +12116,11 @@ typedef _c_sqlite3_create_window_function = ffi.Int32 Function( ffi.Int32 nArg, ffi.Int32 eTextRep, ffi.Pointer pApp, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xValue, - ffi.Pointer> xInverse, - ffi.Pointer> xDestroy, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, + ffi.Pointer> xValue, + ffi.Pointer> xInverse, + ffi.Pointer> xDestroy, ); typedef _dart_sqlite3_create_window_function = int Function( @@ -12129,11 +12129,11 @@ typedef _dart_sqlite3_create_window_function = int Function( int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xValue, - ffi.Pointer> xInverse, - ffi.Pointer> xDestroy, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, + ffi.Pointer> xValue, + ffi.Pointer> xInverse, + ffi.Pointer> xDestroy, ); typedef _c_sqlite3_aggregate_count = ffi.Int32 Function( @@ -12170,20 +12170,20 @@ typedef _c_sqlite3_thread_cleanup = ffi.Void Function(); typedef _dart_sqlite3_thread_cleanup = void Function(); -typedef _typedefC_59 = ffi.Void Function( +typedef _typedefC_47 = ffi.Void Function( ffi.Pointer, ffi.Int64, ffi.Int32, ); typedef _c_sqlite3_memory_alarm = ffi.Int32 Function( - ffi.Pointer> arg0, + ffi.Pointer> arg0, ffi.Pointer arg1, ffi.Int64 arg2, ); typedef _dart_sqlite3_memory_alarm = int Function( - ffi.Pointer> arg0, + ffi.Pointer> arg0, ffi.Pointer arg1, int arg2, ); @@ -12370,7 +12370,7 @@ typedef _dart_sqlite3_get_auxdata = ffi.Pointer Function( int N, ); -typedef _typedefC_60 = ffi.Void Function( +typedef _typedefC_48 = ffi.Void Function( ffi.Pointer, ); @@ -12378,17 +12378,17 @@ typedef _c_sqlite3_set_auxdata = ffi.Void Function( ffi.Pointer arg0, ffi.Int32 N, ffi.Pointer arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _dart_sqlite3_set_auxdata = void Function( ffi.Pointer arg0, int N, ffi.Pointer arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); -typedef _typedefC_61 = ffi.Void Function( +typedef _typedefC_49 = ffi.Void Function( ffi.Pointer, ); @@ -12396,17 +12396,17 @@ typedef _c_sqlite3_result_blob = ffi.Void Function( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Int32 arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _dart_sqlite3_result_blob = void Function( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); -typedef _typedefC_62 = ffi.Void Function( +typedef _typedefC_50 = ffi.Void Function( ffi.Pointer, ); @@ -12414,14 +12414,14 @@ typedef _c_sqlite3_result_blob64 = ffi.Void Function( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Uint64 arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _dart_sqlite3_result_blob64 = void Function( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _c_sqlite3_result_double = ffi.Void Function( @@ -12512,7 +12512,7 @@ typedef _dart_sqlite3_result_null = void Function( ffi.Pointer arg0, ); -typedef _typedefC_63 = ffi.Void Function( +typedef _typedefC_51 = ffi.Void Function( ffi.Pointer, ); @@ -12520,17 +12520,17 @@ typedef _c_sqlite3_result_text = ffi.Void Function( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Int32 arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _dart_sqlite3_result_text = void Function( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); -typedef _typedefC_64 = ffi.Void Function( +typedef _typedefC_52 = ffi.Void Function( ffi.Pointer, ); @@ -12538,7 +12538,7 @@ typedef _c_sqlite3_result_text64 = ffi.Void Function( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Uint64 arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ffi.Uint8 encoding, ); @@ -12546,11 +12546,11 @@ typedef _dart_sqlite3_result_text64 = void Function( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, int encoding, ); -typedef _typedefC_65 = ffi.Void Function( +typedef _typedefC_53 = ffi.Void Function( ffi.Pointer, ); @@ -12558,17 +12558,17 @@ typedef _c_sqlite3_result_text16 = ffi.Void Function( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Int32 arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _dart_sqlite3_result_text16 = void Function( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); -typedef _typedefC_66 = ffi.Void Function( +typedef _typedefC_54 = ffi.Void Function( ffi.Pointer, ); @@ -12576,17 +12576,17 @@ typedef _c_sqlite3_result_text16le = ffi.Void Function( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Int32 arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _dart_sqlite3_result_text16le = void Function( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); -typedef _typedefC_67 = ffi.Void Function( +typedef _typedefC_55 = ffi.Void Function( ffi.Pointer, ); @@ -12594,14 +12594,14 @@ typedef _c_sqlite3_result_text16be = ffi.Void Function( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Int32 arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _dart_sqlite3_result_text16be = void Function( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _c_sqlite3_result_value = ffi.Void Function( @@ -12614,7 +12614,7 @@ typedef _dart_sqlite3_result_value = void Function( ffi.Pointer arg1, ); -typedef _typedefC_68 = ffi.Void Function( +typedef _typedefC_56 = ffi.Void Function( ffi.Pointer, ); @@ -12622,14 +12622,14 @@ typedef _c_sqlite3_result_pointer = ffi.Void Function( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _dart_sqlite3_result_pointer = void Function( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _c_sqlite3_result_zeroblob = ffi.Void Function( @@ -12662,7 +12662,7 @@ typedef _dart_sqlite3_result_subtype = void Function( int arg1, ); -typedef _typedefC_69 = ffi.Int32 Function( +typedef _typedefC_57 = ffi.Int32 Function( ffi.Pointer, ffi.Int32, ffi.Pointer, @@ -12675,7 +12675,7 @@ typedef _c_sqlite3_create_collation = ffi.Int32 Function( ffi.Pointer zName, ffi.Int32 eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, + ffi.Pointer> xCompare, ); typedef _dart_sqlite3_create_collation = int Function( @@ -12683,10 +12683,10 @@ typedef _dart_sqlite3_create_collation = int Function( ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, + ffi.Pointer> xCompare, ); -typedef _typedefC_70 = ffi.Int32 Function( +typedef _typedefC_58 = ffi.Int32 Function( ffi.Pointer, ffi.Int32, ffi.Pointer, @@ -12694,7 +12694,7 @@ typedef _typedefC_70 = ffi.Int32 Function( ffi.Pointer, ); -typedef _typedefC_71 = ffi.Void Function( +typedef _typedefC_59 = ffi.Void Function( ffi.Pointer, ); @@ -12703,8 +12703,8 @@ typedef _c_sqlite3_create_collation_v2 = ffi.Int32 Function( ffi.Pointer zName, ffi.Int32 eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, - ffi.Pointer> xDestroy, + ffi.Pointer> xCompare, + ffi.Pointer> xDestroy, ); typedef _dart_sqlite3_create_collation_v2 = int Function( @@ -12712,11 +12712,11 @@ typedef _dart_sqlite3_create_collation_v2 = int Function( ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, - ffi.Pointer> xDestroy, + ffi.Pointer> xCompare, + ffi.Pointer> xDestroy, ); -typedef _typedefC_72 = ffi.Int32 Function( +typedef _typedefC_60 = ffi.Int32 Function( ffi.Pointer, ffi.Int32, ffi.Pointer, @@ -12729,7 +12729,7 @@ typedef _c_sqlite3_create_collation16 = ffi.Int32 Function( ffi.Pointer zName, ffi.Int32 eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, + ffi.Pointer> xCompare, ); typedef _dart_sqlite3_create_collation16 = int Function( @@ -12737,10 +12737,10 @@ typedef _dart_sqlite3_create_collation16 = int Function( ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, + ffi.Pointer> xCompare, ); -typedef _typedefC_73 = ffi.Void Function( +typedef _typedefC_61 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Int32, @@ -12750,16 +12750,16 @@ typedef _typedefC_73 = ffi.Void Function( typedef _c_sqlite3_collation_needed = ffi.Int32 Function( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, ); typedef _dart_sqlite3_collation_needed = int Function( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, ); -typedef _typedefC_74 = ffi.Void Function( +typedef _typedefC_62 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Int32, @@ -12769,13 +12769,13 @@ typedef _typedefC_74 = ffi.Void Function( typedef _c_sqlite3_collation_needed16 = ffi.Int32 Function( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, ); typedef _dart_sqlite3_collation_needed16 = int Function( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, ); typedef _c_sqlite3_sleep = ffi.Int32 Function( @@ -12862,39 +12862,39 @@ typedef _dart_sqlite3_next_stmt = ffi.Pointer Function( ffi.Pointer pStmt, ); -typedef _typedefC_75 = ffi.Int32 Function( +typedef _typedefC_63 = ffi.Int32 Function( ffi.Pointer, ); typedef _c_sqlite3_commit_hook = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ); typedef _dart_sqlite3_commit_hook = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ); -typedef _typedefC_76 = ffi.Void Function( +typedef _typedefC_64 = ffi.Void Function( ffi.Pointer, ); typedef _c_sqlite3_rollback_hook = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ); typedef _dart_sqlite3_rollback_hook = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ); -typedef _typedefC_77 = ffi.Void Function( +typedef _typedefC_65 = ffi.Void Function( ffi.Pointer, ffi.Int32, ffi.Pointer, @@ -12904,13 +12904,13 @@ typedef _typedefC_77 = ffi.Void Function( typedef _c_sqlite3_update_hook = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ); typedef _dart_sqlite3_update_hook = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ); @@ -13010,24 +13010,24 @@ typedef _dart_sqlite3_enable_load_extension = int Function( int onoff, ); -typedef _typedefC_78 = ffi.Void Function(); +typedef _typedefC_66 = ffi.Void Function(); typedef _c_sqlite3_auto_extension = ffi.Int32 Function( - ffi.Pointer> xEntryPoint, + ffi.Pointer> xEntryPoint, ); typedef _dart_sqlite3_auto_extension = int Function( - ffi.Pointer> xEntryPoint, + ffi.Pointer> xEntryPoint, ); -typedef _typedefC_79 = ffi.Void Function(); +typedef _typedefC_67 = ffi.Void Function(); typedef _c_sqlite3_cancel_auto_extension = ffi.Int32 Function( - ffi.Pointer> xEntryPoint, + ffi.Pointer> xEntryPoint, ); typedef _dart_sqlite3_cancel_auto_extension = int Function( - ffi.Pointer> xEntryPoint, + ffi.Pointer> xEntryPoint, ); typedef _c_sqlite3_reset_auto_extension = ffi.Void Function(); @@ -13048,7 +13048,7 @@ typedef _dart_sqlite3_create_module = int Function( ffi.Pointer pClientData, ); -typedef _typedefC_80 = ffi.Void Function( +typedef _typedefC_68 = ffi.Void Function( ffi.Pointer, ); @@ -13057,7 +13057,7 @@ typedef _c_sqlite3_create_module_v2 = ffi.Int32 Function( ffi.Pointer zName, ffi.Pointer p, ffi.Pointer pClientData, - ffi.Pointer> xDestroy, + ffi.Pointer> xDestroy, ); typedef _dart_sqlite3_create_module_v2 = int Function( @@ -13065,7 +13065,7 @@ typedef _dart_sqlite3_create_module_v2 = int Function( ffi.Pointer zName, ffi.Pointer p, ffi.Pointer pClientData, - ffi.Pointer> xDestroy, + ffi.Pointer> xDestroy, ); typedef _c_sqlite3_drop_modules = ffi.Int32 Function( @@ -13508,20 +13508,20 @@ typedef _dart_sqlite3_backup_pagecount = int Function( ffi.Pointer p, ); -typedef _typedefC_81 = ffi.Void Function( +typedef _typedefC_69 = ffi.Void Function( ffi.Pointer>, ffi.Int32, ); typedef _c_sqlite3_unlock_notify = ffi.Int32 Function( ffi.Pointer pBlocked, - ffi.Pointer> xNotify, + ffi.Pointer> xNotify, ffi.Pointer pNotifyArg, ); typedef _dart_sqlite3_unlock_notify = int Function( ffi.Pointer pBlocked, - ffi.Pointer> xNotify, + ffi.Pointer> xNotify, ffi.Pointer pNotifyArg, ); @@ -13579,7 +13579,7 @@ typedef _dart_sqlite3_log = void Function( ffi.Pointer zFormat, ); -typedef _typedefC_82 = ffi.Int32 Function( +typedef _typedefC_70 = ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, @@ -13588,13 +13588,13 @@ typedef _typedefC_82 = ffi.Int32 Function( typedef _c_sqlite3_wal_hook = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ); typedef _dart_sqlite3_wal_hook = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ); @@ -13792,7 +13792,7 @@ typedef _dart_sqlite3_deserialize = int Function( int mFlags, ); -typedef _typedefC_83 = ffi.Int32 Function( +typedef _typedefC_71 = ffi.Int32 Function( ffi.Pointer, ffi.Int32, ffi.Pointer, @@ -13802,104 +13802,104 @@ typedef _typedefC_83 = ffi.Int32 Function( typedef _c_sqlite3_rtree_geometry_callback = ffi.Int32 Function( ffi.Pointer db, ffi.Pointer zGeom, - ffi.Pointer> xGeom, + ffi.Pointer> xGeom, ffi.Pointer pContext, ); typedef _dart_sqlite3_rtree_geometry_callback = int Function( ffi.Pointer db, ffi.Pointer zGeom, - ffi.Pointer> xGeom, + ffi.Pointer> xGeom, ffi.Pointer pContext, ); -typedef _typedefC_84 = ffi.Int32 Function( +typedef _typedefC_72 = ffi.Int32 Function( ffi.Pointer, ); -typedef _typedefC_85 = ffi.Void Function( +typedef _typedefC_73 = ffi.Void Function( ffi.Pointer, ); typedef _c_sqlite3_rtree_query_callback = ffi.Int32 Function( ffi.Pointer db, ffi.Pointer zQueryFunc, - ffi.Pointer> xQueryFunc, + ffi.Pointer> xQueryFunc, ffi.Pointer pContext, - ffi.Pointer> xDestructor, + ffi.Pointer> xDestructor, ); typedef _dart_sqlite3_rtree_query_callback = int Function( ffi.Pointer db, ffi.Pointer zQueryFunc, - ffi.Pointer> xQueryFunc, + ffi.Pointer> xQueryFunc, ffi.Pointer pContext, - ffi.Pointer> xDestructor, + ffi.Pointer> xDestructor, ); -typedef _typedefC_14 = ffi.Int32 Function( +typedef _typedefC_2 = ffi.Int32 Function( ffi.Pointer, ); -typedef _typedefC_15 = ffi.Int32 Function( +typedef _typedefC_3 = ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Int64, ); -typedef _typedefC_16 = ffi.Int32 Function( +typedef _typedefC_4 = ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Int64, ); -typedef _typedefC_17 = ffi.Int32 Function( +typedef _typedefC_5 = ffi.Int32 Function( ffi.Pointer, ffi.Int64, ); -typedef _typedefC_18 = ffi.Int32 Function( +typedef _typedefC_6 = ffi.Int32 Function( ffi.Pointer, ffi.Int32, ); -typedef _typedefC_19 = ffi.Int32 Function( +typedef _typedefC_7 = ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_20 = ffi.Int32 Function( +typedef _typedefC_8 = ffi.Int32 Function( ffi.Pointer, ffi.Int32, ); -typedef _typedefC_21 = ffi.Int32 Function( +typedef _typedefC_9 = ffi.Int32 Function( ffi.Pointer, ffi.Int32, ); -typedef _typedefC_22 = ffi.Int32 Function( +typedef _typedefC_10 = ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_23 = ffi.Int32 Function( +typedef _typedefC_11 = ffi.Int32 Function( ffi.Pointer, ffi.Int32, ffi.Pointer, ); -typedef _typedefC_24 = ffi.Int32 Function( +typedef _typedefC_12 = ffi.Int32 Function( ffi.Pointer, ); -typedef _typedefC_25 = ffi.Int32 Function( +typedef _typedefC_13 = ffi.Int32 Function( ffi.Pointer, ); -typedef _typedefC_26 = ffi.Int32 Function( +typedef _typedefC_14 = ffi.Int32 Function( ffi.Pointer, ffi.Int32, ffi.Int32, @@ -13907,30 +13907,30 @@ typedef _typedefC_26 = ffi.Int32 Function( ffi.Pointer>, ); -typedef _typedefC_27 = ffi.Int32 Function( +typedef _typedefC_15 = ffi.Int32 Function( ffi.Pointer, ffi.Int32, ffi.Int32, ffi.Int32, ); -typedef _typedefC_28 = ffi.Void Function( +typedef _typedefC_16 = ffi.Void Function( ffi.Pointer, ); -typedef _typedefC_29 = ffi.Int32 Function( +typedef _typedefC_17 = ffi.Int32 Function( ffi.Pointer, ffi.Int32, ); -typedef _typedefC_30 = ffi.Int32 Function( +typedef _typedefC_18 = ffi.Int32 Function( ffi.Pointer, ffi.Int64, ffi.Int32, ffi.Pointer>, ); -typedef _typedefC_31 = ffi.Int32 Function( +typedef _typedefC_19 = ffi.Int32 Function( ffi.Pointer, ffi.Int64, ffi.Pointer, diff --git a/pkgs/ffigen/test/large_integration_tests/large_test.dart b/pkgs/ffigen/test/large_integration_tests/large_test.dart index b18f52b5c6..2815a1fc5e 100644 --- a/pkgs/ffigen/test/large_integration_tests/large_test.dart +++ b/pkgs/ffigen/test/large_integration_tests/large_test.dart @@ -89,10 +89,9 @@ ${strings.headers}: - '**sqlite3.h' ${strings.functions}: ${strings.exclude}: - ${strings.names}: - - sqlite3_vmprintf - - sqlite3_vsnprintf - - sqlite3_str_vappendf + - sqlite3_vmprintf + - sqlite3_vsnprintf + - sqlite3_str_vappendf ''') as YamlMap); final library = parse(config); diff --git a/pkgs/ffigen/test/prefix_tests/prefix.h b/pkgs/ffigen/test/rename_tests/rename.h similarity index 74% rename from pkgs/ffigen/test/prefix_tests/prefix.h rename to pkgs/ffigen/test/rename_tests/rename.h index d63d92ad4b..8ef04e8ff0 100644 --- a/pkgs/ffigen/test/prefix_tests/prefix.h +++ b/pkgs/ffigen/test/rename_tests/rename.h @@ -4,6 +4,7 @@ #define Macro1 1 #define Test_Macro2 2 +#define FullMatchMacro3 3 struct Struct1 { @@ -11,9 +12,13 @@ struct Struct1 struct Test_Struct2 { }; +struct FullMatchStruct3 +{ +}; void func1(struct Struct1 *s); void test_func2(struct Test_Struct2 *s); +void fullMatch_func3(struct FullMatchStruct3 *s); enum Enum1 { @@ -27,3 +32,9 @@ enum Test_Enum2 f = 1, g = 2 }; +enum FullMatchEnum3 +{ + i = 0, + j = 1, + k = 2 +}; diff --git a/pkgs/ffigen/test/prefix_tests/prefix_test.dart b/pkgs/ffigen/test/rename_tests/rename_test.dart similarity index 53% rename from pkgs/ffigen/test/prefix_tests/prefix_test.dart rename to pkgs/ffigen/test/rename_tests/rename_test.dart index 55ebc8affc..3461cb61a5 100644 --- a/pkgs/ffigen/test/prefix_tests/prefix_test.dart +++ b/pkgs/ffigen/test/rename_tests/rename_test.dart @@ -17,98 +17,103 @@ final structPrefix = 'sss'; final enumPrefix = 'eee'; final macroPrefix = 'mmm'; -final functionPrefixReplacedWith = 'rf'; -final structPrefixReplacedWith = 'rs'; -final enumPrefixReplacedWith = 're'; -final macroPrefixReplacedWith = 'rm'; - void main() { - group('prefix_test', () { + group('rename_test', () { setUpAll(() { logWarnings(); expected = expectedLibrary(); actual = parser.parse(Config.fromYaml(yaml.loadYaml(''' ${strings.name}: 'NativeLibrary' -${strings.description}: 'Prefix Test' +${strings.description}: 'Rename Test' ${strings.output}: 'unused' ${strings.headers}: ${strings.entryPoints}: - - 'test/prefix_tests/prefix.h' + - 'test/rename_tests/rename.h' functions: - ${strings.prefix}: $functionPrefix - ${strings.prefix_replacement}: - 'test_': '$functionPrefixReplacedWith' + ${strings.rename}: + 'test_(.*)': '\$1' + '.*': '$functionPrefix\$0' + 'fullMatch_func3': 'func3' + structs: - ${strings.prefix}: $structPrefix - ${strings.prefix_replacement}: - 'Test_': '$structPrefixReplacedWith' + ${strings.rename}: + 'Test_(.*)': '\$1' + '.*': '$structPrefix\$0' + 'FullMatchStruct3': 'Struct3' enums: - ${strings.prefix}: $enumPrefix - ${strings.prefix_replacement}: - 'Test_': '$enumPrefixReplacedWith' + ${strings.rename}: + 'Test_(.*)': '\$1' + '.*': '$enumPrefix\$0' + 'FullMatchEnum3': 'Enum3' macros: - ${strings.prefix}: $macroPrefix - ${strings.prefix_replacement}: - 'Test_': '$macroPrefixReplacedWith' + ${strings.rename}: + 'Test_(.*)': '\$1' + '.*': '$macroPrefix\$0' + 'FullMatchMacro3': 'Macro3' + ''') as yaml.YamlMap)); }); - test('Function prefix', () { + test('Function addPrefix', () { expect(actual.getBindingAsString('${functionPrefix}func1'), expected.getBindingAsString('${functionPrefix}func1')); }); - test('Struct prefix', () { + test('Struct addPrefix', () { expect(actual.getBindingAsString('${structPrefix}Struct1'), expected.getBindingAsString('${structPrefix}Struct1')); }); - test('Enum prefix', () { + test('Enum addPrefix', () { expect(actual.getBindingAsString('${enumPrefix}Enum1'), expected.getBindingAsString('${enumPrefix}Enum1')); }); - test('Macro prefix', () { + test('Macro addPrefix', () { expect(actual.getBindingAsString('${macroPrefix}Macro1'), expected.getBindingAsString('${macroPrefix}Macro1')); }); - test('Function prefix-replacement', () { - expect( - actual.getBindingAsString( - '${functionPrefix}${functionPrefixReplacedWith}func2'), - expected.getBindingAsString( - '${functionPrefix}${functionPrefixReplacedWith}func2')); + test('Function rename with pattern', () { + expect(actual.getBindingAsString('func2'), + expected.getBindingAsString('func2')); + }); + test('Struct rename with pattern', () { + expect(actual.getBindingAsString('Struct2'), + expected.getBindingAsString('Struct2')); + }); + test('Enum rename with pattern', () { + expect(actual.getBindingAsString('Enum2'), + expected.getBindingAsString('Enum2')); + }); + test('Macro rename with pattern', () { + expect(actual.getBindingAsString('Macro2'), + expected.getBindingAsString('Macro2')); }); - test('Struct prefix-replacement', () { - expect( - actual.getBindingAsString( - '${structPrefix}${structPrefixReplacedWith}Struct2'), - expected.getBindingAsString( - '${structPrefix}${structPrefixReplacedWith}Struct2')); + test('Function full match rename', () { + expect(actual.getBindingAsString('func3'), + expected.getBindingAsString('func3')); }); - test('Enum prefix-replacement', () { - expect( - actual.getBindingAsString( - '${enumPrefix}${enumPrefixReplacedWith}Enum2'), - expected.getBindingAsString( - '${enumPrefix}${enumPrefixReplacedWith}Enum2')); + test('Struct full match rename', () { + expect(actual.getBindingAsString('Struct3'), + expected.getBindingAsString('Struct3')); }); - test('Macro prefix-replacement', () { - expect( - actual.getBindingAsString( - '${macroPrefix}${macroPrefixReplacedWith}Macro2'), - expected.getBindingAsString( - '${macroPrefix}${macroPrefixReplacedWith}Macro2')); + test('Enum full match rename', () { + expect(actual.getBindingAsString('Enum3'), + expected.getBindingAsString('Enum3')); + }); + test('Macro full match rename', () { + expect(actual.getBindingAsString('Macro3'), + expected.getBindingAsString('Macro3')); }); }); } Library expectedLibrary() { final struc1 = Struc(name: '${structPrefix}Struct1'); - final struc2 = - Struc(name: '${structPrefix}${structPrefixReplacedWith}Struct2'); + final struc2 = Struc(name: 'Struct2'); + final struc3 = Struc(name: 'Struct3'); return Library( name: 'Bindings', bindings: [ @@ -126,7 +131,7 @@ Library expectedLibrary() { ], ), Func( - name: '${functionPrefix}${functionPrefixReplacedWith}func2', + name: 'func2', originalName: 'test_func2', returnType: Type.nativeType( SupportedNativeType.Void, @@ -138,8 +143,22 @@ Library expectedLibrary() { ), ], ), + Func( + name: 'func3', + originalName: 'fullMatch_func3', + returnType: Type.nativeType( + SupportedNativeType.Void, + ), + parameters: [ + Parameter( + name: 's', + type: Type.pointer(Type.struct(struc3)), + ), + ], + ), struc1, struc2, + struc3, EnumClass( name: '${enumPrefix}Enum1', enumConstants: [ @@ -149,25 +168,36 @@ Library expectedLibrary() { ], ), EnumClass( - name: '${enumPrefix}${enumPrefixReplacedWith}Enum2', + name: 'Enum2', enumConstants: [ EnumConstant(name: 'e', value: 0), EnumConstant(name: 'f', value: 1), EnumConstant(name: 'g', value: 2), ], ), + EnumClass( + name: 'Enum3', + enumConstants: [ + EnumConstant(name: 'i', value: 0), + EnumConstant(name: 'j', value: 1), + EnumConstant(name: 'k', value: 2), + ], + ), Constant( - originalName: 'Macro1', name: '${macroPrefix}Macro1', rawType: 'int', rawValue: '1', ), Constant( - originalName: 'TestMacro2', - name: '${macroPrefix}${macroPrefixReplacedWith}Macro2', + name: 'Macro2', rawType: 'int', rawValue: '2', ), + Constant( + name: 'Macro3', + rawType: 'int', + rawValue: '3', + ), ], ); } diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index 852631790d..a6db37616d 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -26,74 +26,71 @@ array-workaround: true enums: include: - names: - - CXChildVisitResult - - CXCursorKind - - CXTypeKind - - CXDiagnosticDisplayOptions - - CXTranslationUnit_Flags - - CXEvalResultKind + - CXChildVisitResult + - CXCursorKind + - CXTypeKind + - CXDiagnosticDisplayOptions + - CXTranslationUnit_Flags + - CXEvalResultKind structs: include: - names: - - CXCursor - - CXType - - CXSourceLocation - - CXString - - CXTranslationUnitImpl - - CXUnsavedFile - - CXSourceRange + - CXCursor + - CXType + - CXSourceLocation + - CXString + - CXTranslationUnitImpl + - CXUnsavedFile + - CXSourceRange functions: include: - names: - - clang_createIndex - - clang_disposeIndex - - clang_getNumDiagnostics - - clang_getDiagnostic - - clang_disposeDiagnostic - - clang_parseTranslationUnit - - clang_disposeTranslationUnit - - clang_EvalResult_getKind - - clang_EvalResult_getAsInt - - clang_EvalResult_getAsLongLong - - clang_EvalResult_getAsDouble - - clang_EvalResult_getAsStr - - clang_EvalResult_dispose - - clang_getCString_wrap - - clang_disposeString_wrap - - clang_getCursorKind_wrap - - clang_getCursorKindSpelling_wrap - - clang_getCursorType_wrap - - clang_getTypeSpelling_wrap - - clang_getTypeKindSpelling_wrap - - clang_getResultType_wrap - - clang_getPointeeType_wrap - - clang_getCanonicalType_wrap - - clang_Type_getNamedType_wrap - - clang_getTypeDeclaration_wrap - - clang_getTypedefDeclUnderlyingType_wrap - - clang_getCursorSpelling_wrap - - clang_getTranslationUnitCursor_wrap - - clang_formatDiagnostic_wrap - - clang_visitChildren_wrap - - clang_Cursor_getNumArguments_wrap - - clang_Cursor_getArgument_wrap - - clang_getNumArgTypes_wrap - - clang_getArgType_wrap - - clang_getEnumConstantDeclValue_wrap - - clang_equalRanges_wrap - - clang_Cursor_getCommentRange_wrap - - clang_Cursor_getRawCommentText_wrap - - clang_Cursor_getBriefCommentText_wrap - - clang_getCursorLocation_wrap - - clang_getFileLocation_wrap - - clang_getFileName_wrap - - clang_getNumElements_wrap - - clang_getArrayElementType_wrap - - clang_Cursor_isMacroFunctionLike_wrap - - clang_Cursor_isMacroBuiltin_wrap - - clang_Cursor_Evaluate_wrap - - clang_Cursor_isAnonymous_wrap - - clang_Cursor_isAnonymousRecordDecl_wrap + - clang_createIndex + - clang_disposeIndex + - clang_getNumDiagnostics + - clang_getDiagnostic + - clang_disposeDiagnostic + - clang_parseTranslationUnit + - clang_disposeTranslationUnit + - clang_EvalResult_getKind + - clang_EvalResult_getAsInt + - clang_EvalResult_getAsLongLong + - clang_EvalResult_getAsDouble + - clang_EvalResult_getAsStr + - clang_EvalResult_dispose + - clang_getCString_wrap + - clang_disposeString_wrap + - clang_getCursorKind_wrap + - clang_getCursorKindSpelling_wrap + - clang_getCursorType_wrap + - clang_getTypeSpelling_wrap + - clang_getTypeKindSpelling_wrap + - clang_getResultType_wrap + - clang_getPointeeType_wrap + - clang_getCanonicalType_wrap + - clang_Type_getNamedType_wrap + - clang_getTypeDeclaration_wrap + - clang_getTypedefDeclUnderlyingType_wrap + - clang_getCursorSpelling_wrap + - clang_getTranslationUnitCursor_wrap + - clang_formatDiagnostic_wrap + - clang_visitChildren_wrap + - clang_Cursor_getNumArguments_wrap + - clang_Cursor_getArgument_wrap + - clang_getNumArgTypes_wrap + - clang_getArgType_wrap + - clang_getEnumConstantDeclValue_wrap + - clang_equalRanges_wrap + - clang_Cursor_getCommentRange_wrap + - clang_Cursor_getRawCommentText_wrap + - clang_Cursor_getBriefCommentText_wrap + - clang_getCursorLocation_wrap + - clang_getFileLocation_wrap + - clang_getFileName_wrap + - clang_getNumElements_wrap + - clang_getArrayElementType_wrap + - clang_Cursor_isMacroFunctionLike_wrap + - clang_Cursor_isMacroBuiltin_wrap + - clang_Cursor_Evaluate_wrap + - clang_Cursor_isAnonymous_wrap + - clang_Cursor_isAnonymousRecordDecl_wrap From a8551680be801ec23986cd3c887b2854a6c3e1a4 Mon Sep 17 00:00:00 2001 From: Prerak Mann <31154435+mannprerak2@users.noreply.github.com> Date: Thu, 6 Aug 2020 17:36:43 +0530 Subject: [PATCH 026/276] [ffigen] Regexp based Member renaming (#66) Closes #28 - Added Member renaming using `member-rename` subkey in declarations. - Renames struct/enum members and function parameter names using regexp/full matching. - Added/Updated renaming tests. --- pkgs/ffigen/CHANGELOG.md | 1 + pkgs/ffigen/README.md | 8 +- .../lib/src/code_generator/enum_class.dart | 8 +- pkgs/ffigen/lib/src/code_generator/func.dart | 4 +- pkgs/ffigen/lib/src/code_generator/struc.dart | 8 +- .../lib/src/config_provider/config_types.dart | 99 +++++++++++++++-- .../lib/src/config_provider/spec_utils.dart | 69 +++++++++++- .../sub_parsers/enumdecl_parser.dart | 6 +- .../sub_parsers/functiondecl_parser.dart | 8 +- .../sub_parsers/structdecl_parser.dart | 6 +- .../sub_parsers/unnamed_enumdecl_parser.dart | 6 +- pkgs/ffigen/lib/src/strings.dart | 1 + pkgs/ffigen/test/rename_tests/rename.h | 21 ++++ .../ffigen/test/rename_tests/rename_test.dart | 103 +++++++++++++++++- 14 files changed, 325 insertions(+), 23 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index ba4e38451f..21853fbc67 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -2,6 +2,7 @@ - Updated header config. Header `entry-points` and `include-directives` are now specified under `headers` key. Glob syntax is allowed. - Updated declaration `include`/`exclude` config. These are now specified as a list. - Added Regexp based declaration renaming using `rename` subkey. +- Added Regexp based member renaming for structs, enums and functions using `member-rename` subkey. `prefix` and `prefix-replacement` subkeys have been removed. # 0.1.5 - Added support for parsing macros and anonymous unnamed enums. These are generated as top level constants. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index ed8ff8239e..477a0e9e7c 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -112,11 +112,17 @@ functions: - [a-z][a-zA-Z0-9]* # Matches using regexp. - prefix.* # '.' matches any character. - someFuncName # Matches with exact name - - anotherName # full names have higher priority. + - anotherName # Full names have higher priority. rename: 'clang_(.*)': '$1' # Regexp groups based replacement. 'clang_dispose': 'dispose' # full name matches have higher priority. '_(.*)': '$1' # Removes '_' from beginning of a name. +enums: + member-rename: + '(.*)': # Matches any enum. + '_(.*)': '$1' # Removes '_' from beginning enum member name. + 'CXTypeKind': # Full names have higher priority. + 'CXType(.*)': '$1' # $1 keeps only the 1st group i.e '(.*)'.
diff --git a/pkgs/ffigen/lib/src/code_generator/enum_class.dart b/pkgs/ffigen/lib/src/code_generator/enum_class.dart index 5a96c392bf..1a383ce814 100644 --- a/pkgs/ffigen/lib/src/code_generator/enum_class.dart +++ b/pkgs/ffigen/lib/src/code_generator/enum_class.dart @@ -72,8 +72,14 @@ class EnumClass extends NoLookUpBinding { /// Represents a single value in an enum. class EnumConstant { + final String originalName; final String dartDoc; final String name; final int value; - const EnumConstant({@required this.name, @required this.value, this.dartDoc}); + const EnumConstant({ + String originalName, + @required this.name, + @required this.value, + this.dartDoc, + }) : originalName = originalName ?? name; } diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index 62194c1f9a..0e24fb1227 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -147,8 +147,10 @@ class Func extends LookUpBinding { /// Represents a Function's parameter. class Parameter { + final String originalName; String name; final Type type; - Parameter({this.name, @required this.type}); + Parameter({String originalName, this.name, @required this.type}) + : originalName = originalName ?? name; } diff --git a/pkgs/ffigen/lib/src/code_generator/struc.dart b/pkgs/ffigen/lib/src/code_generator/struc.dart index dec4c2c967..24e67270a3 100644 --- a/pkgs/ffigen/lib/src/code_generator/struc.dart +++ b/pkgs/ffigen/lib/src/code_generator/struc.dart @@ -151,10 +151,16 @@ class Struc extends NoLookUpBinding { class Member { final String dartDoc; + final String originalName; final String name; final Type type; - const Member({@required this.name, @required this.type, this.dartDoc}); + const Member({ + String originalName, + @required this.name, + @required this.type, + this.dartDoc, + }) : originalName = originalName ?? name; } // Helper bindings for struct array. diff --git a/pkgs/ffigen/lib/src/config_provider/config_types.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart index 302e69a307..b699239a35 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_types.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart @@ -95,15 +95,22 @@ class GlobHeaderFilter extends HeaderIncludeFilter { class Declaration { final Includer _includer; final Renamer _renamer; + final MemberRenamer _memberRenamer; Declaration({ Includer includer, Renamer renamer, + MemberRenamer memberRenamer, }) : _includer = includer ?? Includer(), - _renamer = renamer ?? Renamer(); + _renamer = renamer ?? Renamer(), + _memberRenamer = memberRenamer ?? MemberRenamer(); /// Applies renaming and returns the result. - String renameUsingConfig(String name) => _renamer.renameUsingConfig(name); + String renameUsingConfig(String name) => _renamer.rename(name); + + /// Applies member renaming and returns the result. + String renameMemberUsingConfig(String declaration, String member) => + _memberRenamer.rename(declaration, member); /// Checks if a name is allowed by a filter. bool shouldInclude(String name) => _includer.shouldInclude(name); @@ -112,23 +119,32 @@ class Declaration { /// Matches `$`, value can be accessed in group 1 of match. final replaceGroupRegexp = RegExp(r'\$([0-9])'); -class RenamePattern { +/// Match/rename using [regExp]. +class RegExpRenamer { final RegExp regExp; final String replacementPattern; - RenamePattern(this.regExp, this.replacementPattern); + RegExpRenamer(this.regExp, this.replacementPattern); /// Returns true if [str] has a full match with [regExp]. bool matches(String str) => quiver.matchesFull(regExp, str); /// Renames [str] according to [replacementPattern]. + /// + /// Returns [str] if [regExp] doesn't have a full match. String rename(String str) { - if (quiver.matchesFull(regExp, str)) { + if (matches(str)) { + // Get match. final regExpMatch = regExp.firstMatch(str); + + /// Get group values. + /// E.g for `str`: `clang_dispose` and `regExp`: `clang_(.*)` + /// groups will be `0`: `clang_disponse`, `1`: `dispose`. final groups = regExpMatch.groups( List.generate(regExpMatch.groupCount, (index) => index) + [regExpMatch.groupCount]); + /// Replace all `$` symbols with respective groups (if any). final result = replacementPattern.replaceAllMapped(replaceGroupRegexp, (match) { final groupInt = int.parse(match.group(1)); @@ -136,7 +152,6 @@ class RenamePattern { }); return result; } else { - /// We return [str] if pattern doesn't have a full match. return str; } } @@ -147,8 +162,8 @@ class RenamePattern { } } +/// Handles `include/exclude` logic for a declaration. class Includer { - // matchers final List _includeMatchers; final Set _includeFull; final List _excludeMatchers; @@ -164,6 +179,9 @@ class Includer { _excludeMatchers = excludeMatchers ?? [], _excludeFull = excludeFull ?? {}; + /// Returns true if [name] is allowed. + /// + /// Exclude overrides include. bool shouldInclude(String name) { if (_excludeFull.contains(name)) { return false; @@ -195,17 +213,22 @@ class Includer { } } +/// Handles `full/regexp` renaming logic. class Renamer { final Map _renameFull; - final List _renameMatchers; + final List _renameMatchers; Renamer({ - List renamePatterns, + List renamePatterns, Map renameFull, }) : _renameMatchers = renamePatterns ?? [], _renameFull = renameFull ?? {}; - String renameUsingConfig(String name) { + Renamer.noRename() + : _renameMatchers = [], + _renameFull = {}; + + String rename(String name) { // Apply full rename (if any). if (_renameFull.containsKey(name)) { return _renameFull[name]; @@ -222,3 +245,59 @@ class Renamer { return name; } } + +/// Match declaration name using [declarationRegExp]. +class RegExpMemberRenamer { + final RegExp declarationRegExp; + final Renamer memberRenamer; + + RegExpMemberRenamer(this.declarationRegExp, this.memberRenamer); + + /// Returns true if [declaration] has a full match with [regExp]. + bool matchesDeclarationName(String declaration) => + quiver.matchesFull(declarationRegExp, declaration); + + @override + String toString() { + return 'DeclarationRegExp: $declarationRegExp, MemberRenamer: $memberRenamer'; + } +} + +/// Handles `full/regexp` member renaming. +class MemberRenamer { + final Map _memberRenameFull; + final List _memberRenameMatchers; + + final Map _cache = {}; + + MemberRenamer({ + Map memberRenameFull, + List memberRenamePattern, + }) : _memberRenameFull = memberRenameFull ?? {}, + _memberRenameMatchers = memberRenamePattern ?? []; + + String rename(String declaration, String member) { + if (_cache.containsKey(declaration)) { + return _cache[declaration].rename(member); + } + + // Apply full rename (if any). + if (_memberRenameFull.containsKey(declaration)) { + // Add to cache. + _cache[declaration] = _memberRenameFull[declaration]; + return _cache[declaration].rename(member); + } + + // Apply rename regexp (if matches). + for (final renamer in _memberRenameMatchers) { + if (renamer.matchesDeclarationName(declaration)) { + // Add to cache. + _cache[declaration] = renamer.memberRenamer; + return _cache[declaration].rename(member); + } + } + + // No renaming is provided for this declaration, return unchanged. + return member; + } +} diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 8b29d9de33..ddf6b8994e 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -182,8 +182,10 @@ Declaration declarationConfigExtractor(dynamic yamlMap) { includeFull = {}, excludeMatchers = [], excludeFull = {}; - final renamePatterns = []; + final renamePatterns = []; final renameFull = {}; + final memberRenamePatterns = []; + final memberRenamerFull = {}; final include = (yamlMap[strings.include] as YamlList)?.cast(); if (include != null) { @@ -215,7 +217,43 @@ Declaration declarationConfigExtractor(dynamic yamlMap) { renameFull[str] = rename[str]; } else { renamePatterns - .add(RenamePattern(RegExp(str, dotAll: true), rename[str])); + .add(RegExpRenamer(RegExp(str, dotAll: true), rename[str])); + } + } + } + + final memberRename = + (yamlMap[strings.memberRename] as YamlMap)?.cast(); + + if (memberRename != null) { + for (final decl in memberRename.keys) { + final renamePatterns = []; + final renameFull = {}; + + final memberRenameMap = memberRename[decl].cast(); + for (final member in memberRenameMap.keys) { + if (isFullDeclarationName(member)) { + renameFull[member] = memberRenameMap[member]; + } else { + renamePatterns.add(RegExpRenamer( + RegExp(member, dotAll: true), memberRenameMap[member])); + } + } + if (isFullDeclarationName(decl)) { + memberRenamerFull[decl] = Renamer( + renameFull: renameFull, + renamePatterns: renamePatterns, + ); + } else { + memberRenamePatterns.add( + RegExpMemberRenamer( + RegExp(decl, dotAll: true), + Renamer( + renameFull: renameFull, + renamePatterns: renamePatterns, + ), + ), + ); } } } @@ -231,6 +269,10 @@ Declaration declarationConfigExtractor(dynamic yamlMap) { renameFull: renameFull, renamePatterns: renamePatterns, ), + memberRenamer: MemberRenamer( + memberRenameFull: memberRenamerFull, + memberRenamePattern: memberRenamePatterns, + ), ); } @@ -253,6 +295,29 @@ bool declarationConfigValidator(String name, dynamic value) { } } } + } else if (key == strings.memberRename) { + if (!checkType([name, key as String], value[key])) { + _result = false; + } else { + for (final declNameKey in value[key].keys) { + if (!checkType( + [name, key as String, declNameKey as String], + value[key][declNameKey])) { + _result = false; + } else { + for (final memberNameKey in value[key][declNameKey].keys) { + if (!checkType([ + name, + key as String, + declNameKey as String, + memberNameKey as String, + ], value[key][declNameKey][memberNameKey])) { + _result = false; + } + } + } + } + } } else { _logger.severe("Unknown key '$key' in '$name'."); _result = false; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index 99b6b57ae3..0fbb9e8de0 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -100,7 +100,11 @@ void _addEnumConstantToEnumClass(Pointer cursor) { cursor, nesting.length + commentPrefix.length, ), - name: cursor.spelling(), + originalName: cursor.spelling(), + name: config.enumClassDecl.renameMemberUsingConfig( + _stack.top.enumClass.originalName, + cursor.spelling(), + ), value: clang.clang_getEnumConstantDeclValue_wrap(cursor)), ); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index f3e15074c4..d958c57ab5 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -36,7 +36,7 @@ Func parseFunctionDeclaration(Pointer cursor) { _logger.fine('++++ Adding Function: ${cursor.completeStringRepr()}'); final rt = _getFunctionReturnType(cursor); - final parameters = _getParameters(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) { @@ -80,7 +80,8 @@ Type _getFunctionReturnType(Pointer cursor) { return cursor.returnType().toCodeGenTypeAndDispose(); } -List _getParameters(Pointer cursor) { +List _getParameters( + Pointer cursor, String funcName) { final parameters = []; final totalArgs = clang.clang_Cursor_getNumArguments_wrap(cursor); @@ -102,7 +103,8 @@ List _getParameters(Pointer cursor) { /// If [pn] is null or empty, its set to `arg$i` by code_generator. parameters.add( Parameter( - name: pn, + originalName: pn, + name: config.functionDecl.renameMemberUsingConfig(funcName, pn), type: pt, ), ); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index 32e3a76187..5081aeddcb 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -130,7 +130,11 @@ int _structMembersVisitor(Pointer cursor, cursor, nesting.length + commentPrefix.length, ), - name: cursor.spelling(), + originalName: cursor.spelling(), + name: config.structDecl.renameMemberUsingConfig( + _stack.top.struc.originalName, + cursor.spelling(), + ), type: mt, ), ); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart index 8f8487bef4..fedeb7e88a 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart @@ -60,7 +60,11 @@ int _unnamedenumCursorVisitor(Pointer cursor, void _addUnNamedEnumConstant(Pointer cursor) { _constants.add( Constant( - name: cursor.spelling(), + originalName: cursor.spelling(), + name: config.enumClassDecl.renameMemberUsingConfig( + '', // Un-named enum constants have an empty declaration name. + cursor.spelling(), + ), rawType: 'int', rawValue: clang.clang_getEnumConstantDeclValue_wrap(cursor).toString(), ), diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index b432442fed..e05534703c 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -46,6 +46,7 @@ const macros = 'macros'; const include = 'include'; const exclude = 'exclude'; const rename = 'rename'; +const memberRename = 'member-rename'; const sizemap = 'size-map'; // Sizemap values. diff --git a/pkgs/ffigen/test/rename_tests/rename.h b/pkgs/ffigen/test/rename_tests/rename.h index 8ef04e8ff0..8ff6d88c65 100644 --- a/pkgs/ffigen/test/rename_tests/rename.h +++ b/pkgs/ffigen/test/rename_tests/rename.h @@ -15,10 +15,21 @@ struct Test_Struct2 struct FullMatchStruct3 { }; +struct MemberRenameStruct4 +{ + int _underscore; + float fullMatch; +}; + +struct AnyMatchStruct5 +{ + int _underscore; +}; void func1(struct Struct1 *s); void test_func2(struct Test_Struct2 *s); void fullMatch_func3(struct FullMatchStruct3 *s); +void memberRename_func4(int _underscore, float fullMatch, int); enum Enum1 { @@ -38,3 +49,13 @@ enum FullMatchEnum3 j = 1, k = 2 }; +enum MemberRenameEnum4 +{ + _underscore = 0, + fullMatch = 1 +}; +enum +{ + _unnamed_underscore = 0, + unnamedFullMatch = 1 +}; diff --git a/pkgs/ffigen/test/rename_tests/rename_test.dart b/pkgs/ffigen/test/rename_tests/rename_test.dart index 3461cb61a5..c3425cc596 100644 --- a/pkgs/ffigen/test/rename_tests/rename_test.dart +++ b/pkgs/ffigen/test/rename_tests/rename_test.dart @@ -36,19 +36,36 @@ functions: 'test_(.*)': '\$1' '.*': '$functionPrefix\$0' 'fullMatch_func3': 'func3' - + ${strings.memberRename}: + 'memberRename_.*': + '_(.*)': '\$1' + 'fullMatch': 'fullMatchSuccess' + '': 'unnamed' structs: ${strings.rename}: 'Test_(.*)': '\$1' '.*': '$structPrefix\$0' 'FullMatchStruct3': 'Struct3' + ${strings.memberRename}: + 'MemberRenameStruct4': + '_(.*)': '\$1' + 'fullMatch': 'fullMatchSuccess' + '.*': + '_(.*)': '\$1' enums: ${strings.rename}: 'Test_(.*)': '\$1' '.*': '$enumPrefix\$0' 'FullMatchEnum3': 'Enum3' + ${strings.memberRename}: + 'MemberRenameEnum4': + '_(.*)': '\$1' + 'fullMatch': 'fullMatchSuccess' + '': + '_(.*)': '\$1' + 'unnamedFullMatch': 'unnamedFullMatchSuccess' macros: ${strings.rename}: @@ -107,6 +124,30 @@ macros: expect(actual.getBindingAsString('Macro3'), expected.getBindingAsString('Macro3')); }); + test('Struct member rename', () { + expect(actual.getBindingAsString('${structPrefix}MemberRenameStruct4'), + expected.getBindingAsString('${structPrefix}MemberRenameStruct4')); + }); + test('Any Struct member rename', () { + expect(actual.getBindingAsString('${structPrefix}AnyMatchStruct5'), + expected.getBindingAsString('${structPrefix}AnyMatchStruct5')); + }); + test('Function member rename', () { + expect(actual.getBindingAsString('${functionPrefix}memberRename_func4'), + expected.getBindingAsString('${functionPrefix}memberRename_func4')); + }); + test('Enum member rename', () { + expect(actual.getBindingAsString('${enumPrefix}MemberRenameEnum4'), + expected.getBindingAsString('${enumPrefix}MemberRenameEnum4')); + }); + test('unnamed Enum regexp rename', () { + expect(actual.getBindingAsString('unnamed_underscore'), + expected.getBindingAsString('unnamed_underscore')); + }); + test('unnamed Enum full match rename', () { + expect(actual.getBindingAsString('unnamedFullMatchSuccess'), + expected.getBindingAsString('unnamedFullMatchSuccess')); + }); }); } @@ -156,9 +197,52 @@ Library expectedLibrary() { ), ], ), + Func( + name: '${functionPrefix}memberRename_func4', + originalName: 'memberRename_func4', + returnType: Type.nativeType( + SupportedNativeType.Void, + ), + parameters: [ + Parameter( + name: 'underscore', + type: Type.nativeType(SupportedNativeType.Int32), + ), + Parameter( + name: 'fullMatchSuccess', + type: Type.nativeType(SupportedNativeType.Float), + ), + Parameter( + name: 'unnamed', + type: Type.nativeType(SupportedNativeType.Int32), + ), + ], + ), struc1, struc2, struc3, + Struc( + name: '${structPrefix}MemberRenameStruct4', + members: [ + Member( + name: 'underscore', + type: Type.nativeType(SupportedNativeType.Int32), + ), + Member( + name: 'fullMatchSuccess', + type: Type.nativeType(SupportedNativeType.Float), + ), + ], + ), + Struc( + name: '${structPrefix}AnyMatchStruct5', + members: [ + Member( + name: 'underscore', + type: Type.nativeType(SupportedNativeType.Int32), + ), + ], + ), EnumClass( name: '${enumPrefix}Enum1', enumConstants: [ @@ -183,6 +267,13 @@ Library expectedLibrary() { EnumConstant(name: 'k', value: 2), ], ), + EnumClass( + name: '${enumPrefix}MemberRenameEnum4', + enumConstants: [ + EnumConstant(name: 'underscore', value: 0), + EnumConstant(name: 'fullMatchSuccess', value: 1), + ], + ), Constant( name: '${macroPrefix}Macro1', rawType: 'int', @@ -198,6 +289,16 @@ Library expectedLibrary() { rawType: 'int', rawValue: '3', ), + Constant( + name: 'unnamed_underscore', + rawType: 'int', + rawValue: '0', + ), + Constant( + name: 'unnamedFullMatchSuccess', + rawType: 'int', + rawValue: '1', + ), ], ); } From 1596489c3dcf86acbddc9fdf08e6d7b6a50ed282 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Fri, 7 Aug 2020 16:02:09 +0530 Subject: [PATCH 027/276] [ffigen] Handled flexible array members in structs (#69) --- pkgs/ffigen/lib/src/code_generator/type.dart | 2 +- .../sub_parsers/structdecl_parser.dart | 10 +++++++++ .../header_parser_tests/function_n_struct.h | 9 ++++++++ .../function_n_struct_test.dart | 22 +++++++++++++++++-- 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index 9622ee47f7..694bacf0ba 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -116,7 +116,7 @@ class Type { } factory Type.incompleteArray(Type elementType) { return Type._( - broadType: BroadType.ConstantArray, + broadType: BroadType.IncompleteArray, child: elementType, ); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index 5081aeddcb..39c56deac9 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -19,6 +19,7 @@ class _ParsedStruc { Struc struc; bool nestedStructMember = false; bool unimplementedMemberType = false; + bool flexibleArrayMember = false; bool arrayMember = false; _ParsedStruc(); } @@ -92,6 +93,12 @@ void _setStructMembers(Pointer cursor) { _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(); } } @@ -118,6 +125,9 @@ int _structMembersVisitor(Pointer cursor, // bindings. _stack.top.nestedStructMember = true; } + } else if (mt.broadType == BroadType.IncompleteArray) { + // TODO(68): Structs with flexible Array Members are not supported. + _stack.top.flexibleArrayMember = true; } if (mt.getBaseType().broadType == BroadType.Unimplemented) { diff --git a/pkgs/ffigen/test/header_parser_tests/function_n_struct.h b/pkgs/ffigen/test/header_parser_tests/function_n_struct.h index e779d5fb54..3ee27b8aae 100644 --- a/pkgs/ffigen/test/header_parser_tests/function_n_struct.h +++ b/pkgs/ffigen/test/header_parser_tests/function_n_struct.h @@ -12,4 +12,13 @@ struct Struct2 struct Struct1 a; }; +struct Struct3 +{ + int a; + int b[]; // Flexible array member. +}; + void func1(struct Struct2 *s); + +// Incomplete array parameter will be treated as a pointer. +void func2(struct Struct3 s[]); diff --git a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart index b3da1d8941..38951f19e0 100644 --- a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart @@ -32,22 +32,31 @@ ${strings.headers}: ); }); - test('func1', () { + test('func1 struct pointer parameter', () { expect(actual.getBindingAsString('func1'), expected.getBindingAsString('func1')); }); - test('Struct2', () { + test('func2 incomplete array parameter', () { + expect(actual.getBindingAsString('func2'), + expected.getBindingAsString('func2')); + }); + test('Struct2 nested struct member', () { expect((actual.getBinding('Struct2') as Struc).members.isEmpty, true); }); + test('Struct3 flexible array member', () { + expect((actual.getBinding('Struct3') as Struc).members.isEmpty, true); + }); }); } Library expectedLibrary() { final struc2 = Struc(name: 'Struct2', members: []); + final struc3 = Struc(name: 'Struct3', members: []); return Library( name: 'Bindings', bindings: [ struc2, + struc3, Struc(name: 'Struct1', members: [ Member( name: 'a', @@ -63,6 +72,15 @@ Library expectedLibrary() { SupportedNativeType.Void, ), ), + Func( + name: 'func2', + parameters: [ + Parameter(name: 's', type: Type.pointer(Type.struct(struc3))), + ], + returnType: Type.nativeType( + SupportedNativeType.Void, + ), + ), ], ); } From cad06e0a73a3d13a8ec99e0a4477f94a2e549054 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 10 Aug 2020 21:26:24 +0530 Subject: [PATCH 028/276] [ffigen] Update public API (#70) - Updated `Config`'s class members to use public getter, private variable pattern. - Replaced ConfigError with FormatException. - Refactored all shared global variables to data.dart. - Send test coverage to coveralls in travis. --- pkgs/ffigen/.travis.yml | 10 +- pkgs/ffigen/CHANGELOG.md | 2 +- pkgs/ffigen/README.md | 2 + pkgs/ffigen/bin/ffigen.dart | 6 +- pkgs/ffigen/lib/ffigen.dart | 2 +- .../lib/src/config_provider/config.dart | 94 +++++++++---------- .../lib/src/config_provider/config_types.dart | 8 +- pkgs/ffigen/lib/src/header_parser/data.dart | 34 ++++++- .../lib/src/header_parser/includer.dart | 63 +------------ pkgs/ffigen/lib/src/header_parser/parser.dart | 25 +++-- .../sub_parsers/enumdecl_parser.dart | 5 +- .../sub_parsers/functiondecl_parser.dart | 4 +- .../sub_parsers/macro_parser.dart | 23 ++--- .../sub_parsers/structdecl_parser.dart | 4 +- .../sub_parsers/unnamed_enumdecl_parser.dart | 6 +- .../type_extractor/extractor.dart | 7 +- pkgs/ffigen/lib/src/header_parser/utils.dart | 57 +++++++++++ pkgs/ffigen/pubspec.yaml | 2 +- pkgs/ffigen/test/test_coverage.dart | 46 +++++++++ pkgs/ffigen/tool/travis.sh | 19 ++++ 20 files changed, 255 insertions(+), 164 deletions(-) create mode 100644 pkgs/ffigen/test/test_coverage.dart create mode 100755 pkgs/ffigen/tool/travis.sh diff --git a/pkgs/ffigen/.travis.yml b/pkgs/ffigen/.travis.yml index fe0efef222..cd062299dd 100644 --- a/pkgs/ffigen/.travis.yml +++ b/pkgs/ffigen/.travis.yml @@ -12,14 +12,20 @@ cache: directories: - $HOME/.pub-cache before_install: - # install libclang-dev + # Install libclang-dev. - sudo add-apt-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main" - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - - sudo apt-get update - sudo apt-get install clang-10 libclang-10-dev - # use clang from installed llvm + # Use clang from installed llvm. - export PATH="/usr/lib/llvm-10/bin:$PATH" before_script: - 'pub run ffigen:setup' - cd test/native_test && dart build_test_dylib.dart && cd ../.. + +matrix: + include: + - dart: dev + script: ./tool/travis.sh + name: Collect and report coverage. diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 21853fbc67..b773ee013b 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.2.0-dev +# 0.2.0 - Updated header config. Header `entry-points` and `include-directives` are now specified under `headers` key. Glob syntax is allowed. - Updated declaration `include`/`exclude` config. These are now specified as a list. - Added Regexp based declaration renaming using `rename` subkey. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 477a0e9e7c..f97ab70246 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -1,4 +1,6 @@ +[![pub package](https://img.shields.io/pub/v/ffigen.svg)](https://pub.dev/packages/ffigen) [![Build Status](https://travis-ci.org/dart-lang/ffigen.svg?branch=master)](https://travis-ci.org/dart-lang/ffigen) +[![Coverage Status](https://coveralls.io/repos/github/dart-lang/ffigen/badge.svg?branch=master)](https://coveralls.io/github/dart-lang/ffigen?branch=master) Experimental binding generator for [FFI](https://dart.dev/guides/libraries/c-interop) bindings. diff --git a/pkgs/ffigen/bin/ffigen.dart b/pkgs/ffigen/bin/ffigen.dart index 9328b2873a..d0b2ee1257 100644 --- a/pkgs/ffigen/bin/ffigen.dart +++ b/pkgs/ffigen/bin/ffigen.dart @@ -34,7 +34,7 @@ void main(List args) { Config config; try { config = getConfig(argResult); - } on ConfigError { + } on FormatException { print('Please fix configuration errors and re-run the tool.'); exit(1); } @@ -42,10 +42,6 @@ void main(List args) { // Parse the bindings according to config object provided. final library = parse(config); - if (config.sort) { - library.sort(); - } - // Generate file for the parsed bindings. final gen = File(config.output); library.generateFile(gen); diff --git a/pkgs/ffigen/lib/ffigen.dart b/pkgs/ffigen/lib/ffigen.dart index 2b0a304a4e..3425eecb7f 100644 --- a/pkgs/ffigen/lib/ffigen.dart +++ b/pkgs/ffigen/lib/ffigen.dart @@ -8,5 +8,5 @@ library ffigen; export 'src/code_generator.dart' show Library; -export 'src/config_provider.dart' show Config, ConfigError; +export 'src/config_provider.dart' show Config; export 'src/header_parser.dart' show parse; diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 583287db0a..0a913adaa4 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -21,53 +21,66 @@ var _logger = Logger('ffigen.config_provider.config'); /// Handles validation, extraction of confiurations from yaml file. class Config { /// output file name. - String output; - + String get output => _output; + String _output; // Holds headers and filters for header. - Headers headers; + Headers get headers => _headers; + Headers _headers; /// CommandLine Arguments to pass to clang_compiler. - List compilerOpts; + List get compilerOpts => _compilerOpts; + List _compilerOpts; /// Declaration config for Functions. - Declaration functionDecl; + Declaration get functionDecl => _functionDecl; + Declaration _functionDecl; /// Declaration config for Structs. - Declaration structDecl; + Declaration get structDecl => _structDecl; + Declaration _structDecl; /// Declaration config for Enums. - Declaration enumClassDecl; + Declaration get enumClassDecl => _enumClassDecl; + Declaration _enumClassDecl; /// Declaration config for Enums. - Declaration macroDecl; + Declaration get macroDecl => _macroDecl; + Declaration _macroDecl; /// If generated bindings should be sorted alphabetically. - bool sort; + bool get sort => _sort; + bool _sort; /// If typedef of supported types(int8_t) should be directly used. - bool useSupportedTypedefs; + bool get useSupportedTypedefs => _useSupportedTypedefs; + bool _useSupportedTypedefs; /// Extracted Doc comment type. - CommentType commentType; + CommentType get commentType => _commentType; + CommentType _commentType; /// If tool should generate array workarounds. /// /// If false(default), structs with inline array members will have all its /// members removed. - bool arrayWorkaround; + bool get arrayWorkaround => _arrayWorkaround; + bool _arrayWorkaround; /// If constants should be generated for unnamed enums. - bool unnamedEnums; + bool get unnamedEnums => _unnamedEnums; + bool _unnamedEnums; /// Name of the wrapper class. - String wrapperName; + String get wrapperName => _wrapperName; + String _wrapperName; /// Doc comment for the wrapper class. - String wrapperDocComment; + String get wrapperDocComment => _wrapperDocComment; + String _wrapperDocComment; /// Header of the generated bindings. - String preamble; - + String get preamble => _preamble; + String _preamble; Config._(); /// Create config from Yaml map. @@ -79,7 +92,7 @@ class Config { final result = configspecs._checkConfigs(map, specs); if (!result) { - throw ConfigError(); + throw FormatException('Invalid configurations provided.'); } configspecs._extract(map, specs); @@ -133,20 +146,21 @@ class Config { requirement: Requirement.yes, validator: outputValidator, extractor: outputExtractor, - extractedResult: (dynamic result) => output = result as String, + extractedResult: (dynamic result) => _output = result as String, ), strings.headers: Specification( requirement: Requirement.yes, validator: headersValidator, extractor: headersExtractor, - extractedResult: (dynamic result) => headers = result as Headers, + extractedResult: (dynamic result) => _headers = result as Headers, ), strings.compilerOpts: Specification>( requirement: Requirement.no, validator: compilerOptsValidator, extractor: compilerOptsExtractor, + defaultValue: () => [], extractedResult: (dynamic result) => - compilerOpts = result as List, + _compilerOpts = result as List, ), strings.functions: Specification( requirement: Requirement.no, @@ -154,7 +168,7 @@ class Config { extractor: declarationConfigExtractor, defaultValue: () => Declaration(), extractedResult: (dynamic result) { - functionDecl = result as Declaration; + _functionDecl = result as Declaration; }, ), strings.structs: Specification( @@ -163,7 +177,7 @@ class Config { extractor: declarationConfigExtractor, defaultValue: () => Declaration(), extractedResult: (dynamic result) { - structDecl = result as Declaration; + _structDecl = result as Declaration; }, ), strings.enums: Specification( @@ -172,7 +186,7 @@ class Config { extractor: declarationConfigExtractor, defaultValue: () => Declaration(), extractedResult: (dynamic result) { - enumClassDecl = result as Declaration; + _enumClassDecl = result as Declaration; }, ), strings.macros: Specification( @@ -181,7 +195,7 @@ class Config { extractor: declarationConfigExtractor, defaultValue: () => Declaration(), extractedResult: (dynamic result) { - macroDecl = result as Declaration; + _macroDecl = result as Declaration; }, ), strings.sizemap: Specification>( @@ -202,7 +216,7 @@ class Config { validator: booleanValidator, extractor: booleanExtractor, defaultValue: () => false, - extractedResult: (dynamic result) => sort = result as bool, + extractedResult: (dynamic result) => _sort = result as bool, ), strings.useSupportedTypedefs: Specification( requirement: Requirement.no, @@ -210,7 +224,7 @@ class Config { extractor: booleanExtractor, defaultValue: () => true, extractedResult: (dynamic result) => - useSupportedTypedefs = result as bool, + _useSupportedTypedefs = result as bool, ), strings.comments: Specification( requirement: Requirement.no, @@ -218,28 +232,28 @@ class Config { extractor: commentExtractor, defaultValue: () => CommentType.def(), extractedResult: (dynamic result) => - commentType = result as CommentType, + _commentType = result as CommentType, ), strings.arrayWorkaround: Specification( requirement: Requirement.no, validator: booleanValidator, extractor: booleanExtractor, defaultValue: () => false, - extractedResult: (dynamic result) => arrayWorkaround = result as bool, + extractedResult: (dynamic result) => _arrayWorkaround = result as bool, ), strings.unnamedEnums: Specification( requirement: Requirement.no, validator: booleanValidator, extractor: booleanExtractor, defaultValue: () => true, - extractedResult: (dynamic result) => unnamedEnums = result as bool, + extractedResult: (dynamic result) => _unnamedEnums = result as bool, ), strings.name: Specification( requirement: Requirement.prefer, validator: dartClassNameValidator, extractor: stringExtractor, defaultValue: () => 'NativeLibrary', - extractedResult: (dynamic result) => wrapperName = result as String, + extractedResult: (dynamic result) => _wrapperName = result as String, ), strings.description: Specification( requirement: Requirement.prefer, @@ -247,28 +261,14 @@ class Config { extractor: stringExtractor, defaultValue: () => null, extractedResult: (dynamic result) => - wrapperDocComment = result as String, + _wrapperDocComment = result as String, ), strings.preamble: Specification( requirement: Requirement.no, validator: nonEmptyStringValidator, extractor: stringExtractor, - extractedResult: (dynamic result) => preamble = result as String, + extractedResult: (dynamic result) => _preamble = result as String, ), }; } } - -class ConfigError implements Exception { - final String message; - ConfigError([this.message]); - - @override - String toString() { - if (message == null) { - return 'ConfigError: Invalid configurations provided.'; - } else { - return 'ConfigError: $message'; - } - } -} diff --git a/pkgs/ffigen/lib/src/config_provider/config_types.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart index b699239a35..fa5974530a 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_types.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart @@ -54,12 +54,14 @@ class Headers { /// Path to headers. /// /// This contains all the headers, after extraction from Globs. - List entryPoints = []; + final List entryPoints; /// Include filter for headers. - HeaderIncludeFilter includeFilter = GlobHeaderFilter(); + final HeaderIncludeFilter includeFilter; - Headers({this.entryPoints, this.includeFilter}); + Headers({List entryPoints, HeaderIncludeFilter includeFilter}) + : entryPoints = entryPoints ?? [], + includeFilter = includeFilter ?? GlobHeaderFilter(); } abstract class HeaderIncludeFilter { diff --git a/pkgs/ffigen/lib/src/header_parser/data.dart b/pkgs/ffigen/lib/src/header_parser/data.dart index 87551cb221..6c21338602 100644 --- a/pkgs/ffigen/lib/src/header_parser/data.dart +++ b/pkgs/ffigen/lib/src/header_parser/data.dart @@ -5,7 +5,9 @@ import 'dart:ffi'; import 'dart:isolate'; -import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/code_generator.dart' show Constant; +import 'package:ffigen/src/config_provider.dart' show Config; +import 'package:meta/meta.dart'; import 'clang_bindings/clang_bindings.dart' show Clang; import 'utils.dart'; @@ -13,16 +15,40 @@ import 'utils.dart'; /// Holds all Global shared variables. /// Holds configurations. -Config config; +Config get config => _config; +Config _config; /// Holds clang functions. -Clang clang; +Clang get clang => _clang; +Clang _clang; + +// Tracks seen status for bindings +BindingsIndex get bindingsIndex => _bindingsIndex; +BindingsIndex _bindingsIndex; /// Used for naming typedefs. -IncrementalNamer incrementalNamer; +IncrementalNamer get incrementalNamer => _incrementalNamer; +IncrementalNamer _incrementalNamer; /// Holds the unique id refering to this isolate. /// /// Used by visitChildren_wrap to call the correct dart function from C. // int get uid => Isolate.current.controlPort.; final uid = Isolate.current.controlPort.nativePort; + +/// Saved macros, Key: prefixedName, Value originalName. +Map get savedMacros => _savedMacros; +Map _savedMacros; + +/// Saved unnamed EnumConstants. +List get unnamedEnumConstants => _unnamedEnumConstants; +List _unnamedEnumConstants; + +void initializeGlobals({@required Config config, @required Clang clang}) { + _config = config; + _clang = clang; + _incrementalNamer = IncrementalNamer(); + _savedMacros = {}; + _unnamedEnumConstants = []; + _bindingsIndex = BindingsIndex(); +} diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart index c17b13ef44..a4766e1bd5 100644 --- a/pkgs/ffigen/lib/src/header_parser/includer.dart +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -2,20 +2,13 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:ffigen/src/code_generator.dart'; import 'data.dart'; /// Utility functions to check whether a binding should be parsed or not /// based on filters. -// Stores binding names already scene. Mp key is same as their original name. -Map _structs = {}; -Map _functions = {}; -Map _enumClass = {}; -Map _macros = {}; - bool shouldIncludeStruct(String name) { - if (_structs.containsKey(name) || name == '') { + if (bindingsIndex.isSeenStruct(name) || name == '') { return false; } else if (config.structDecl == null || config.structDecl.shouldInclude(name)) { @@ -26,7 +19,7 @@ bool shouldIncludeStruct(String name) { } bool shouldIncludeFunc(String name) { - if (_functions.containsKey(name) || name == '') { + if (bindingsIndex.isSeenFunc(name) || name == '') { return false; } else if (config.functionDecl == null || config.functionDecl.shouldInclude(name)) { @@ -37,7 +30,7 @@ bool shouldIncludeFunc(String name) { } bool shouldIncludeEnumClass(String name) { - if (_enumClass.containsKey(name) || name == '') { + if (bindingsIndex.isSeenEnumClass(name) || name == '') { return false; } else if (config.enumClassDecl == null || config.enumClassDecl.shouldInclude(name)) { @@ -48,7 +41,7 @@ bool shouldIncludeEnumClass(String name) { } bool shouldIncludeMacro(String name) { - if (_macros.containsKey(name) || name == '') { + if (bindingsIndex.isSeenMacro(name) || name == '') { return false; } else if (config.macroDecl == null || config.macroDecl.shouldInclude(name)) { return true; @@ -76,51 +69,3 @@ bool shouldIncludeRootCursor(String sourceFile) { return _headerCache[sourceFile]; } - -bool isSeenStruc(String originalName) { - return _structs.containsKey(originalName); -} - -void addStrucToSeen(String originalName, Struc struc) { - _structs[originalName] = struc; -} - -Struc getSeenStruc(String originalName) { - return _structs[originalName]; -} - -bool isSeenFunc(String originalName) { - return _functions.containsKey(originalName); -} - -void addFuncToSeen(String originalName, Func func) { - _functions[originalName] = func; -} - -Func getSeenFunc(String originalName) { - return _functions[originalName]; -} - -bool isSeenEnumClass(String originalName) { - return _enumClass.containsKey(originalName); -} - -void addEnumClassToSeen(String originalName, EnumClass enumClass) { - _enumClass[originalName] = enumClass; -} - -EnumClass getSeenEnumClass(String originalName) { - return _enumClass[originalName]; -} - -bool isSeenMacro(String originalName) { - return _macros.containsKey(originalName); -} - -void addMacroToSeen(String originalName, String macro) { - _macros[originalName] = macro; -} - -String getSeenMacro(String originalName) { - return _macros[originalName]; -} diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index 87e14ef1f7..177157407f 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -10,7 +10,6 @@ import 'package:ffigen/src/config_provider.dart'; import 'package:ffigen/src/header_parser/sub_parsers/macro_parser.dart'; import 'package:ffigen/src/config_provider/config_types.dart'; import 'package:ffigen/src/find_resource.dart'; -import 'package:ffigen/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart'; import 'package:ffigen/src/header_parser/translation_unit_parser.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; @@ -21,8 +20,8 @@ import 'data.dart'; import 'utils.dart'; /// Main entrypoint for header_parser. -Library parse(Config conf, {bool sort = false}) { - initParser(conf); +Library parse(Config c) { + initParser(c); final bindings = parseToBindings(); @@ -33,7 +32,7 @@ Library parse(Config conf, {bool sort = false}) { header: config.preamble, ); - if (sort) { + if (config.sort) { library.sort(); } return library; @@ -45,13 +44,9 @@ Library parse(Config conf, {bool sort = false}) { var _logger = Logger('ffigen.header_parser.parser'); -/// Initialises parser, clears any previous values. +/// Initializes parser, clears any previous values. void initParser(Config c) { - // Set global configurations. - config = c; - incrementalNamer = IncrementalNamer(); - - // Find full path of dynamic library and initialise bindings. + // Find full path of dynamic library and initialize bindings. if (findDotDartTool() == null) { throw Exception('Unable to find .dart_tool.'); } else { @@ -60,7 +55,12 @@ void initParser(Config c) { strings.ffigenFolderName, strings.dylibFileName, ); - clang = clang_types.Clang(DynamicLibrary.open(fullDylibPath)); + + // Initialize global variables. + initializeGlobals( + config: c, + clang: clang_types.Clang(DynamicLibrary.open(fullDylibPath)), + ); } } @@ -74,7 +74,6 @@ List parseToBindings() { /// Add compiler opt for comment parsing for clang based on config. if (config.commentType.length != CommentLength.none && config.commentType.style == CommentStyle.any) { - config.compilerOpts ??= []; config.compilerOpts.add(strings.fparseAllComments); } @@ -122,7 +121,7 @@ List parseToBindings() { } // Add all saved unnamed enums. - bindings.addAll(getSavedUnNamedEnums()); + bindings.addAll(unnamedEnumConstants); // Parse all saved macros. bindings.addAll(parseSavedMacros()); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index 0fbb9e8de0..3460e28426 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -42,14 +42,15 @@ EnumClass parseEnumDeclaration( } else { _logger.fine('Unnamed enum inside a typedef.'); } - } else if (shouldIncludeEnumClass(enumName) && !isSeenEnumClass(enumName)) { + } else if (shouldIncludeEnumClass(enumName) && + !bindingsIndex.isSeenEnumClass(enumName)) { _logger.fine('++++ Adding Enum: ${cursor.completeStringRepr()}'); _stack.top.enumClass = EnumClass( dartDoc: getCursorDocComment(cursor), originalName: enumName, name: config.enumClassDecl.renameUsingConfig(enumName), ); - addEnumClassToSeen(enumName, _stack.top.enumClass); + bindingsIndex.addEnumClassToSeen(enumName, _stack.top.enumClass); _addEnumConstant(cursor); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index d958c57ab5..9137c7386d 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -32,7 +32,7 @@ Func parseFunctionDeclaration(Pointer cursor) { _stack.top.unimplementedParameterType = false; final funcName = cursor.spelling(); - if (shouldIncludeFunc(funcName) && !isSeenFunc(funcName)) { + if (shouldIncludeFunc(funcName) && !bindingsIndex.isSeenFunc(funcName)) { _logger.fine('++++ Adding Function: ${cursor.completeStringRepr()}'); final rt = _getFunctionReturnType(cursor); @@ -70,7 +70,7 @@ Func parseFunctionDeclaration(Pointer cursor) { returnType: rt, parameters: parameters, ); - addFuncToSeen(funcName, _stack.top.func); + bindingsIndex.addFuncToSeen(funcName, _stack.top.func); } return _stack.pop().func; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart index 27a7b30c0f..dd35b78e3c 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart @@ -18,21 +18,18 @@ import '../utils.dart'; var _logger = Logger('ffigen.header_parser.macro_parser'); -/// Saved macros, Key: prefixedName, Value originalName. -final _savedMacros = {}; - /// Adds a macro definition to be parsed later. void saveMacroDefinition(Pointer cursor) { final originalMacroName = cursor.spelling(); if (shouldIncludeMacro(originalMacroName) && - !isSeenMacro(originalMacroName) && + !bindingsIndex.isSeenMacro(originalMacroName) && clang.clang_Cursor_isMacroBuiltin_wrap(cursor) == 0 && clang.clang_Cursor_isMacroFunctionLike_wrap(cursor) == 0) { // Parse macro only if it's not builtin or function-like. _logger.fine( "++++ Saved Macro '$originalMacroName' for later : ${cursor.completeStringRepr()}"); final prefixedName = config.macroDecl.renameUsingConfig(originalMacroName); - addMacroToSeen(originalMacroName, prefixedName); + bindingsIndex.addMacroToSeen(originalMacroName, prefixedName); _saveMacro(prefixedName, originalMacroName); } } @@ -41,7 +38,7 @@ void saveMacroDefinition(Pointer cursor) { /// /// Macros are parsed later in [parseSavedMacros()]. void _saveMacro(String name, String originalName) { - _savedMacros[name] = originalName; + savedMacros[name] = originalName; } List _bindings; @@ -52,7 +49,7 @@ List _bindings; List parseSavedMacros() { _bindings = []; - if (_savedMacros.keys.isEmpty) { + if (savedMacros.keys.isEmpty) { return _bindings; } @@ -117,7 +114,7 @@ int _macroVariablevisitor(Pointer cursor, switch (k) { case clang_types.CXEvalResultKind.CXEval_Int: constant = Constant( - originalName: _savedMacros[macroName], + originalName: savedMacros[macroName], name: macroName, rawType: 'int', rawValue: clang.clang_EvalResult_getAsLongLong(e).toString(), @@ -125,7 +122,7 @@ int _macroVariablevisitor(Pointer cursor, break; case clang_types.CXEvalResultKind.CXEval_Float: constant = Constant( - originalName: _savedMacros[macroName], + originalName: savedMacros[macroName], name: macroName, rawType: 'double', rawValue: clang.clang_EvalResult_getAsDouble(e).toString(), @@ -138,7 +135,7 @@ int _macroVariablevisitor(Pointer cursor, // Escape ' character, because our strings are enclosed with '. value = value.replaceAll("'", r"\'"); constant = Constant( - originalName: _savedMacros[macroName], + originalName: savedMacros[macroName], name: macroName, rawType: 'String', rawValue: "'${value}'", @@ -177,7 +174,7 @@ String _generatedFileBaseName; /// Generated macro variable names. /// /// Used to determine if macro should be included in bindings or not. -Set _macroVarNames = {}; +Set _macroVarNames; /// Creates a temporary file for parsing macros in current directory. File createFileForMacros() { @@ -204,10 +201,10 @@ File createFileForMacros() { } _macroVarNames = {}; - for (final prefixedMacroName in _savedMacros.keys) { + for (final prefixedMacroName in savedMacros.keys) { // Write macro. final macroVarName = MacroVariableString.encode(prefixedMacroName); - sb.writeln('auto ${macroVarName} = ${_savedMacros[prefixedMacroName]};'); + sb.writeln('auto ${macroVarName} = ${savedMacros[prefixedMacroName]};'); // Add to _macroVarNames. _macroVarNames.add(macroVarName); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index 39c56deac9..3b6212337f 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -43,7 +43,7 @@ Struc parseStructDeclaration( if (structName.isEmpty) { _logger.finest('unnamed structure or typedef structure declaration'); } else if ((ignoreFilter || shouldIncludeStruct(structName)) && - (!isSeenStruc(structName))) { + (!bindingsIndex.isSeenStruct(structName))) { _logger.fine( '++++ Adding Structure: structName: ${structName}, ${cursor.completeStringRepr()}'); _stack.top.struc = Struc( @@ -53,7 +53,7 @@ Struc parseStructDeclaration( ); // Adding to seen here to stop recursion if a struct has itself as a // member, members are updated later. - addStrucToSeen(structName, _stack.top.struc); + bindingsIndex.addStructToSeen(structName, _stack.top.struc); _setStructMembers(cursor); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart index fedeb7e88a..b5039c4b4d 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart @@ -14,10 +14,6 @@ import '../utils.dart'; var _logger = Logger('ffigen.header_parser.unnamed_enumdecl_parser'); -List _constants = []; - -List getSavedUnNamedEnums() => _constants; - /// Saves unnamed enums. void saveUnNamedEnum(Pointer cursor) { final resultCode = clang.clang_visitChildren_wrap( @@ -58,7 +54,7 @@ int _unnamedenumCursorVisitor(Pointer cursor, /// Adds the parameter to func in [functiondecl_parser.dart]. void _addUnNamedEnumConstant(Pointer cursor) { - _constants.add( + unnamedEnumConstants.add( Constant( originalName: cursor.spelling(), name: config.enumClassDecl.renameMemberUsingConfig( diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 1336d7ee85..c76c8ea17e 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -10,7 +10,6 @@ import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang_types; import '../data.dart'; -import '../includer.dart'; import '../sub_parsers/structdecl_parser.dart'; import '../translation_unit_parser.dart'; import '../type_extractor/cxtypekindmap.dart'; @@ -104,8 +103,8 @@ Type _extractfromRecord(Pointer cxtype) { // Also add a struct binding, if its unseen. // TODO(23): Check if we should auto add struct. - if (isSeenStruc(structName)) { - type = Type.struct(getSeenStruc(structName)); + if (bindingsIndex.isSeenStruct(structName)) { + type = Type.struct(bindingsIndex.getSeenStruct(structName)); } else { final struc = parseStructDeclaration(cursor, name: fixedStructName, ignoreFilter: true); @@ -113,7 +112,7 @@ Type _extractfromRecord(Pointer cxtype) { // Add to bindings. addToBindings(struc); // Add to seen. - addStrucToSeen(structName, struc); + bindingsIndex.addStructToSeen(structName, struc); } cxtype.dispose(); diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index e8190bf3a5..6d8e159d9c 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -322,3 +322,60 @@ class IncrementalNamer { return '${base}_$i'; } } + +/// Tracks if a binding is 'seen' or not. +class BindingsIndex { + // Stores binding names already seen. Map key is same as their original name. + final Map _structs = {}; + final Map _functions = {}; + final Map _enumClass = {}; + final Map _macros = {}; + + bool isSeenStruct(String originalName) { + return _structs.containsKey(originalName); + } + + void addStructToSeen(String originalName, Struc struc) { + _structs[originalName] = struc; + } + + Struc getSeenStruct(String originalName) { + return _structs[originalName]; + } + + bool isSeenFunc(String originalName) { + return _functions.containsKey(originalName); + } + + void addFuncToSeen(String originalName, Func func) { + _functions[originalName] = func; + } + + Func getSeenFunc(String originalName) { + return _functions[originalName]; + } + + bool isSeenEnumClass(String originalName) { + return _enumClass.containsKey(originalName); + } + + void addEnumClassToSeen(String originalName, EnumClass enumClass) { + _enumClass[originalName] = enumClass; + } + + EnumClass getSeenEnumClass(String originalName) { + return _enumClass[originalName]; + } + + bool isSeenMacro(String originalName) { + return _macros.containsKey(originalName); + } + + void addMacroToSeen(String originalName, String macro) { + _macros[originalName] = macro; + } + + String getSeenMacro(String originalName) { + return _macros[originalName]; + } +} diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 3151c7dce6..5659a9d194 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 0.2.0-dev +version: 0.2.0 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C/C++ header files. diff --git a/pkgs/ffigen/test/test_coverage.dart b/pkgs/ffigen/test/test_coverage.dart new file mode 100644 index 0000000000..812105f1d3 --- /dev/null +++ b/pkgs/ffigen/test/test_coverage.dart @@ -0,0 +1,46 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'code_generator_test.dart' as code_generator_test; +import 'collision_tests/decl_decl_collision_test.dart' + as collision_tests_decl_decl_collision_test; +import 'collision_tests/reserved_keyword_collision_test.dart' + as collision_tests_reserved_keyword_collision_test; +import 'example_tests/cjson_example_test.dart' + as example_tests_cjson_example_test; +import 'example_tests/libclang_example_test.dart' + as example_tests_libclang_example_test; +import 'example_tests/simple_example_test.dart' + as example_tests_simple_example_test; +import 'header_parser_tests/function_n_struct_test.dart' + as header_parser_tests_function_n_struct_test; +import 'header_parser_tests/functions_test.dart' + as header_parser_tests_functions_test; +import 'header_parser_tests/macros_test.dart' + as header_parser_tests_macros_test; +import 'header_parser_tests/nested_parsing_test.dart' + as header_parser_tests_nested_parsing_test; +import 'header_parser_tests/unnamed_enums_test.dart' + as header_parser_tests_unnamed_enums_test; +import 'large_integration_tests/large_test.dart' + as large_integration_tests_large_test; +import 'native_test/native_test.dart' as native_test_native_test; +import 'rename_tests/rename_test.dart' as rename_tests_rename_test; + +void main() { + large_integration_tests_large_test.main(); + example_tests_cjson_example_test.main(); + example_tests_simple_example_test.main(); + example_tests_libclang_example_test.main(); + collision_tests_decl_decl_collision_test.main(); + collision_tests_reserved_keyword_collision_test.main(); + header_parser_tests_functions_test.main(); + header_parser_tests_macros_test.main(); + header_parser_tests_function_n_struct_test.main(); + header_parser_tests_nested_parsing_test.main(); + header_parser_tests_unnamed_enums_test.main(); + native_test_native_test.main(); + rename_tests_rename_test.main(); + code_generator_test.main(); +} diff --git a/pkgs/ffigen/tool/travis.sh b/pkgs/ffigen/tool/travis.sh new file mode 100755 index 0000000000..987955b1db --- /dev/null +++ b/pkgs/ffigen/tool/travis.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +# Fast fail the script on failures. +set -e + +# Gather coverage and upload to Coveralls. +pub global activate remove_from_coverage +pub global activate dart_coveralls +# Generate coverage report. +pub global run dart_coveralls calc test/test_coverage.dart > lcov.info +# Remove extra files from coverage report. +pub global run remove_from_coverage -f lcov.info -r ".pub-cache" +# Upload to coveralls. +gem install coveralls-lcov +coveralls-lcov lcov.info From c6f7ec4951dad8cc29301853f3470627de649e69 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Wed, 12 Aug 2020 15:15:09 +0530 Subject: [PATCH 029/276] [ffigen] Fixes for typedefs (#75) closes #71. * Fixed missing typedef used in function's return type. * Named function typedefs are now reused. * Added tests for typedef generation. --- pkgs/ffigen/CHANGELOG.md | 3 + .../libclang-example/generated_bindings.dart | 40 ++++----- pkgs/ffigen/lib/src/code_generator/func.dart | 27 ++---- pkgs/ffigen/lib/src/code_generator/struc.dart | 2 - .../ffigen/lib/src/code_generator/writer.dart | 35 +++++++- .../type_extractor/extractor.dart | 40 +++++---- pkgs/ffigen/lib/src/header_parser/utils.dart | 14 +++ pkgs/ffigen/pubspec.yaml | 2 +- .../ffigen/test/header_parser_tests/typedef.h | 13 +++ .../header_parser_tests/typedef_test.dart | 86 +++++++++++++++++++ .../_expected_libclang_bindings.dart | 40 ++++----- 11 files changed, 220 insertions(+), 82 deletions(-) create mode 100644 pkgs/ffigen/test/header_parser_tests/typedef.h create mode 100644 pkgs/ffigen/test/header_parser_tests/typedef_test.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index b773ee013b..705ba586d5 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.2.1 +- Fixed missing/duplicate typedef generation. + # 0.2.0 - Updated header config. Header `entry-points` and `include-directives` are now specified under `headers` key. Glob syntax is allowed. - Updated declaration `include`/`exclude` config. These are now specified as a list. diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index 61483316c4..34a5cd293f 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -1889,7 +1889,7 @@ class LibClang { /// is inspecting the inclusions in the PCH file itself). void clang_getInclusions( ffi.Pointer tu, - ffi.Pointer> visitor, + ffi.Pointer> visitor, ffi.Pointer client_data, ) { _clang_getInclusions ??= _dylib.lookupFunction<_c_clang_getInclusions, @@ -3266,15 +3266,15 @@ class CXIdxEntityRefInfo extends ffi.Struct {} class IndexerCallbacks extends ffi.Struct { /// Called periodically to check whether indexing should be aborted. /// Should return 0 to continue, and non-zero to abort. - ffi.Pointer> abortQuery; + ffi.Pointer> abortQuery; /// Called at the end of indexing; passes the complete diagnostic set. - ffi.Pointer> diagnostic; + ffi.Pointer> diagnostic; - ffi.Pointer> enteredMainFile; + ffi.Pointer> enteredMainFile; /// Called when a file gets \#included/\#imported. - ffi.Pointer> ppIncludedFile; + ffi.Pointer> ppIncludedFile; /// Called when a AST file (PCH or module) gets imported. /// @@ -3282,15 +3282,15 @@ class IndexerCallbacks extends ffi.Struct { /// 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. - ffi.Pointer> importedASTFile; + ffi.Pointer> importedASTFile; /// Called at the beginning of indexing a translation unit. - ffi.Pointer> startedTranslationUnit; + ffi.Pointer> startedTranslationUnit; - ffi.Pointer> indexDeclaration; + ffi.Pointer> indexDeclaration; /// Called to index a reference of an entity. - ffi.Pointer> indexEntityReference; + ffi.Pointer> indexEntityReference; } const int CINDEX_VERSION_MAJOR = 0; @@ -4147,7 +4147,7 @@ typedef _dart_clang_toggleCrashRecovery = void Function( int isEnabled, ); -typedef CXInclusionVisitor_1 = ffi.Void Function( +typedef CXInclusionVisitor = ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Uint32, @@ -4156,13 +4156,13 @@ typedef CXInclusionVisitor_1 = ffi.Void Function( typedef _c_clang_getInclusions = ffi.Void Function( ffi.Pointer tu, - ffi.Pointer> visitor, + ffi.Pointer> visitor, ffi.Pointer client_data, ); typedef _dart_clang_getInclusions = void Function( ffi.Pointer tu, - ffi.Pointer> visitor, + ffi.Pointer> visitor, ffi.Pointer client_data, ); @@ -4486,44 +4486,44 @@ typedef _dart_clang_indexTranslationUnit = int Function( ffi.Pointer arg5, ); -typedef _typedefC_3 = ffi.Int32 Function( +typedef _typedefC_2 = ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_4 = ffi.Void Function( +typedef _typedefC_3 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_5 = ffi.Pointer Function( +typedef _typedefC_4 = ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_6 = ffi.Pointer Function( +typedef _typedefC_5 = ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_7 = ffi.Pointer Function( +typedef _typedefC_6 = ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_8 = ffi.Pointer Function( +typedef _typedefC_7 = ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_9 = ffi.Void Function( +typedef _typedefC_8 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_10 = ffi.Void Function( +typedef _typedefC_9 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ); diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index 0e24fb1227..551dae96c1 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -58,16 +58,16 @@ class Func extends LookUpBinding { if (_typedefDependencies == null) { _typedefDependencies = []; - /// Ensure name conflicts are resolved for [cType] and [dartType] typedefs. - cType.name = _uniqueTypedefName(cType.name, w); - dartType.name = _uniqueTypedefName(dartType.name, w); + // Add typedef's required by return type. + final returnTypeBase = returnType.getBaseType(); + if (returnTypeBase.broadType == BroadType.NativeFunction) { + _typedefDependencies.add(returnTypeBase.nativeFunc); + } // Add typedef's required by parameters. for (final p in parameters) { final base = p.type.getBaseType(); if (base.broadType == BroadType.NativeFunction) { - // Resolve name conflicts in typedef's required by parameters before using. - base.nativeFunc.name = _uniqueTypedefName(base.nativeFunc.name, w); _typedefDependencies.add(base.nativeFunc); } } @@ -79,21 +79,6 @@ class Func extends LookUpBinding { return _typedefDependencies; } - /// Checks if typedef name is unique in both top level and wrapper level. - /// And only marks it as used at top-level. - String _uniqueTypedefName(String name, Writer w) { - final base = name; - var uniqueName = name; - var suffix = 0; - while (w.topLevelUniqueNamer.isUsed(uniqueName) || - w.wrapperLevelUniqueNamer.isUsed(uniqueName)) { - suffix++; - uniqueName = base + suffix.toString(); - } - w.topLevelUniqueNamer.markUsed(uniqueName); - return uniqueName; - } - Typedef _cType, _dartType; Typedef get cType => _cType ??= Typedef( name: '_c_$name', @@ -151,6 +136,6 @@ class Parameter { String name; final Type type; - Parameter({String originalName, this.name, @required this.type}) + Parameter({String originalName, this.name = '', @required this.type}) : originalName = originalName ?? name; } diff --git a/pkgs/ffigen/lib/src/code_generator/struc.dart b/pkgs/ffigen/lib/src/code_generator/struc.dart index 24e67270a3..f241fd7a42 100644 --- a/pkgs/ffigen/lib/src/code_generator/struc.dart +++ b/pkgs/ffigen/lib/src/code_generator/struc.dart @@ -66,8 +66,6 @@ class Struc extends NoLookUpBinding { for (final m in members) { final base = m.type.getBaseType(); if (base.broadType == BroadType.NativeFunction) { - base.nativeFunc.name = - w.topLevelUniqueNamer.makeUnique(base.nativeFunc.name); _typedefDependencies.add(base.nativeFunc); } } diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index 06ea9d77ea..e09b9ed8d4 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -115,16 +115,20 @@ class Writer { s.write("import 'dart:ffi' as $ffiLibraryPrefix;\n"); s.write('\n'); - final dependencies = []; + // Will contain duplicates, must be processed. + final rawDependencies = []; /// Get typedef dependencies, these will be written at the end. for (final b in lookUpBindings) { - dependencies.addAll(b.getTypedefDependencies(this)); + rawDependencies.addAll(b.getTypedefDependencies(this)); } for (final b in noLookUpBindings) { - dependencies.addAll(b.getTypedefDependencies(this)); + rawDependencies.addAll(b.getTypedefDependencies(this)); } + // Dependencies, processed to remove duplicates and resolve name conflicts. + final dependencies = processDependencies(rawDependencies); + /// Write [lookUpBindings]. if (lookUpBindings.isNotEmpty) { // Write doc comment for wrapper class. @@ -160,4 +164,29 @@ class Writer { return s.toString(); } + + /// Removes duplicates and resolves all name conflicts. + Set processDependencies(List dependencies) { + final processedDependencies = dependencies.toSet(); + + for (final d in processedDependencies) { + d.name = _makeUniqueTypedefName(d.name); + } + return processedDependencies; + } + + /// Returns a typedef name that is unique in both top level and wrapper level, + /// ans only marks it as used at top-level. + String _makeUniqueTypedefName(String name) { + final base = name; + var uniqueName = name; + var suffix = 0; + while (topLevelUniqueNamer.isUsed(uniqueName) || + wrapperLevelUniqueNamer.isUsed(uniqueName)) { + suffix++; + uniqueName = base + suffix.toString(); + } + topLevelUniqueNamer.markUsed(uniqueName); + return uniqueName; + } } diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index c76c8ea17e..d73e0297ed 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -56,8 +56,11 @@ Type getCodeGenType(Pointer cxtype, {String parentName}) { return Type.nativeType( enumNativeType, ); - case clang_types.CXTypeKind - .CXType_FunctionProto: // Primarily used for function pointers. + case clang_types.CXTypeKind.CXType_FunctionProto: + // Primarily used for function pointers. + return _extractFromFunctionProto(cxtype, parentName); + case clang_types.CXTypeKind.CXType_FunctionNoProto: + // Primarily used for function types with zero arguments. return _extractFromFunctionProto(cxtype, parentName); case clang_types.CXTypeKind .CXType_ConstantArray: // Primarily used for constant array in struct members. @@ -132,12 +135,9 @@ Type _extractFromFunctionProto( Pointer cxtype, String parentName) { var name = parentName; - // Set a name for typedefc incase it was null or empty. - if (name == null || name == '') { - name = incrementalNamer.name('_typedefC'); - } else { - name = incrementalNamer.name(name); - } + // An empty name means the function prototype was declared in-place, instead + // of using a typedef. + name = name ?? ''; final _parameters = []; final totalArgs = clang.clang_getNumArgTypes_wrap(cxtype); for (var i = 0; i < totalArgs; i++) { @@ -154,13 +154,23 @@ Type _extractFromFunctionProto( Parameter(name: '', type: pt), ); } - final typedefC = Typedef( - name: name, - typedefType: TypedefType.C, - parameters: _parameters, - returnType: - clang.clang_getResultType_wrap(cxtype).toCodeGenTypeAndDispose(), - ); + + Typedef typedefC; + if (bindingsIndex.isSeenFunctionTypedef(name)) { + typedefC = bindingsIndex.getSeenFunctionTypedef(name); + } else { + typedefC = Typedef( + name: name.isNotEmpty ? name : incrementalNamer.name('_typedefC'), + typedefType: TypedefType.C, + parameters: _parameters, + returnType: + clang.clang_getResultType_wrap(cxtype).toCodeGenTypeAndDispose(), + ); + // Add to seen, if name isn't empty. + if (name.isNotEmpty) { + bindingsIndex.addFunctionTypedefToSeen(name, typedefC); + } + } return Type.nativeFunc(typedefC); } diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index 6d8e159d9c..54fcc8bd3e 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -330,6 +330,8 @@ class BindingsIndex { final Map _functions = {}; final Map _enumClass = {}; final Map _macros = {}; + // Stores only named typedefC used in NativeFunc. + final Map _functionTypedefs = {}; bool isSeenStruct(String originalName) { return _structs.containsKey(originalName); @@ -378,4 +380,16 @@ class BindingsIndex { String getSeenMacro(String originalName) { return _macros[originalName]; } + + bool isSeenFunctionTypedef(String originalName) { + return _functionTypedefs.containsKey(originalName); + } + + void addFunctionTypedefToSeen(String originalName, Typedef t) { + _functionTypedefs[originalName] = t; + } + + Typedef getSeenFunctionTypedef(String originalName) { + return _functionTypedefs[originalName]; + } } diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 5659a9d194..aca4a49e42 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 0.2.0 +version: 0.2.1 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C/C++ header files. diff --git a/pkgs/ffigen/test/header_parser_tests/typedef.h b/pkgs/ffigen/test/header_parser_tests/typedef.h new file mode 100644 index 0000000000..f9aa357b29 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/typedef.h @@ -0,0 +1,13 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +typedef void (*NamedFunctionProto)(); + +struct Struct1 +{ + NamedFunctionProto named; + void (*unnamed)(); +}; + +extern NamedFunctionProto func1(NamedFunctionProto named, void (*unnamed)(int)); diff --git a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart new file mode 100644 index 0000000000..8480acd4f9 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart @@ -0,0 +1,86 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/config_provider.dart'; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; +import 'package:ffigen/src/strings.dart' as strings; + +import '../test_utils.dart'; + +Library actual, expected; + +void main() { + group('typedef_test', () { + setUpAll(() { + logWarnings(Level.SEVERE); + expected = expectedLibrary(); + actual = parser.parse( + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'Bindings' +${strings.output}: 'unused' + +${strings.headers}: + ${strings.entryPoints}: + - 'test/header_parser_tests/typedef.h' + ''') as yaml.YamlMap), + ); + }); + + test('Library output', () { + expect(actual.generate(), expected.generate()); + }); + }); +} + +Library expectedLibrary() { + final namedTypedef = Typedef( + name: 'NamedFunctionProto', + typedefType: TypedefType.C, + returnType: Type.nativeType(SupportedNativeType.Void), + ); + return Library( + name: 'Bindings', + bindings: [ + Struc(name: 'Struct1', members: [ + Member( + name: 'named', + type: Type.pointer(Type.nativeFunc(namedTypedef)), + ), + Member( + name: 'unnamed', + type: Type.pointer(Type.nativeFunc(Typedef( + name: '_typedefC_1', + typedefType: TypedefType.C, + returnType: Type.nativeType(SupportedNativeType.Void), + ))), + ), + ]), + Func( + name: 'func1', + parameters: [ + Parameter( + name: 'named', + type: Type.pointer(Type.nativeFunc(namedTypedef)), + ), + Parameter( + name: 'unnamed', + type: Type.pointer(Type.nativeFunc(Typedef( + name: '_typedefC_2', + typedefType: TypedefType.C, + parameters: [ + Parameter(type: Type.nativeType(SupportedNativeType.Int32)), + ], + returnType: Type.nativeType(SupportedNativeType.Void), + ))), + ), + ], + returnType: Type.pointer(Type.nativeFunc(namedTypedef)), + ), + ], + ); +} diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index f857457c0d..1cbd2a2a10 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -1628,7 +1628,7 @@ class LibClang { /// inspecting the inclusions in the PCH file itself). void clang_getInclusions( ffi.Pointer tu, - ffi.Pointer> visitor, + ffi.Pointer> visitor, ffi.Pointer client_data, ) { _clang_getInclusions ??= _dylib.lookupFunction<_c_clang_getInclusions, @@ -4370,26 +4370,26 @@ class CXIdxEntityRefInfo extends ffi.Struct {} class IndexerCallbacks extends ffi.Struct { /// Called periodically to check whether indexing should be aborted. Should /// return 0 to continue, and non-zero to abort. - ffi.Pointer> abortQuery; + ffi.Pointer> abortQuery; /// Called at the end of indexing; passes the complete diagnostic set. - ffi.Pointer> diagnostic; + ffi.Pointer> diagnostic; - ffi.Pointer> enteredMainFile; + ffi.Pointer> enteredMainFile; /// Called when a file gets #included/#imported. - ffi.Pointer> ppIncludedFile; + ffi.Pointer> ppIncludedFile; /// Called when a AST file (PCH or module) gets imported. - ffi.Pointer> importedASTFile; + ffi.Pointer> importedASTFile; /// Called at the beginning of indexing a translation unit. - ffi.Pointer> startedTranslationUnit; + ffi.Pointer> startedTranslationUnit; - ffi.Pointer> indexDeclaration; + ffi.Pointer> indexDeclaration; /// Called to index a reference of an entity. - ffi.Pointer> indexEntityReference; + ffi.Pointer> indexEntityReference; } abstract class CXIndexOptFlags { @@ -5391,7 +5391,7 @@ typedef _dart_clang_toggleCrashRecovery = void Function( int isEnabled, ); -typedef CXInclusionVisitor_1 = ffi.Void Function( +typedef CXInclusionVisitor = ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Uint32, @@ -5400,13 +5400,13 @@ typedef CXInclusionVisitor_1 = ffi.Void Function( typedef _c_clang_getInclusions = ffi.Void Function( ffi.Pointer tu, - ffi.Pointer> visitor, + ffi.Pointer> visitor, ffi.Pointer client_data, ); typedef _dart_clang_getInclusions = void Function( ffi.Pointer tu, - ffi.Pointer> visitor, + ffi.Pointer> visitor, ffi.Pointer client_data, ); @@ -5730,44 +5730,44 @@ typedef _dart_clang_indexTranslationUnit = int Function( ffi.Pointer arg5, ); -typedef _typedefC_3 = ffi.Int32 Function( +typedef _typedefC_2 = ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_4 = ffi.Void Function( +typedef _typedefC_3 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_5 = ffi.Pointer Function( +typedef _typedefC_4 = ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_6 = ffi.Pointer Function( +typedef _typedefC_5 = ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_7 = ffi.Pointer Function( +typedef _typedefC_6 = ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_8 = ffi.Pointer Function( +typedef _typedefC_7 = ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_9 = ffi.Void Function( +typedef _typedefC_8 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_10 = ffi.Void Function( +typedef _typedefC_9 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ); From ece2197cab714153c8fc9f9cc82b0ab246c33560 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Wed, 12 Aug 2020 16:31:27 +0530 Subject: [PATCH 030/276] [ffigen] Update licenses for third_party (#76) Closes #43. * Added licenses to third_party with reference to generated files. * Updated preambles for third-party code. --- .../c_json/cjson_generated_bindings.dart | 26 +- pkgs/ffigen/example/c_json/pubspec.yaml | 21 ++ .../libclang-example/generated_bindings.dart | 12 +- .../example/libclang-example/pubspec.yaml | 13 +- .../example/simple/generated_bindings.dart | 6 +- pkgs/ffigen/lib/src/code_generator/utils.dart | 14 +- .../ffigen/lib/src/code_generator/writer.dart | 8 +- .../clang_bindings/clang_bindings.dart | 11 +- pkgs/ffigen/test/code_generator_test.dart | 42 ++-- .../example_tests/cjson_example_test.dart | 20 ++ .../example_tests/libclang_example_test.dart | 10 +- .../_expected_cjson_bindings.dart | 6 +- .../_expected_libclang_bindings.dart | 6 +- .../_expected_sqlite_bindings.dart | 6 +- .../native_test/native_test_bindings.dart | 6 +- .../third_party/cjson_library/license.txt | 24 ++ pkgs/ffigen/third_party/libclang/license.txt | 224 ++++++++++++++++++ pkgs/ffigen/third_party/sqlite/license.txt | 11 + pkgs/ffigen/tool/libclang_config.yaml | 5 + 19 files changed, 410 insertions(+), 61 deletions(-) create mode 100644 pkgs/ffigen/third_party/cjson_library/license.txt create mode 100644 pkgs/ffigen/third_party/libclang/license.txt create mode 100644 pkgs/ffigen/third_party/sqlite/license.txt diff --git a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart index 7c41b0fbbc..ada20c001d 100644 --- a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart +++ b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart @@ -1,6 +1,26 @@ -/// AUTO GENERATED FILE, DO NOT EDIT. -/// -/// Generated by `package:ffigen`. +// Copyright (c) 2009-2017 Dave Gamble and cJSON contributors +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. import 'dart:ffi' as ffi; /// Holds bindings to cJSON. diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index 1058579275..1b53211e94 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -24,3 +24,24 @@ ffigen: include-directives: - '**cJSON.h' comments: false + + preamble: | + // Copyright (c) 2009-2017 Dave Gamble and cJSON contributors + // + // Permission is hereby granted, free of charge, to any person obtaining a copy + // of this software and associated documentation files (the "Software"), to deal + // in the Software without restriction, including without limitation the rights + // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + // copies of the Software, and to permit persons to whom the Software is + // furnished to do so, subject to the following conditions: + // + // The above copyright notice and this permission notice shall be included in + // all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + // THE SOFTWARE. diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index 34a5cd293f..3b2fc26774 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -1,7 +1,11 @@ -/// AUTO GENERATED FILE, DO NOT EDIT. -/// -/// Generated by `package:ffigen`. - +// Part of the LLVM Project, under the Apache License v2.0 with LLVM +// Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. import 'dart:ffi' as ffi; /// Holds bindings to LibClang. diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index 246400a489..ba3067fb63 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -59,14 +59,15 @@ ffigen: # False by default. array-workaround: true - # The header of the file, this is pasted as it is. - preamble: | - /// AUTO GENERATED FILE, DO NOT EDIT. - /// - /// Generated by `package:ffigen`. - # Doc Comments for generated binings. # Comments can be disabled by using comments: false comments: style: doxygen # Options - doxygen(default) / any. length: full # Options - brief / full(default). + + # The header of the file, this is pasted as it is. + preamble: | + // Part of the LLVM Project, under the Apache License v2.0 with LLVM + // Exceptions. + // See https://llvm.org/LICENSE.txt for license information. + // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception diff --git a/pkgs/ffigen/example/simple/generated_bindings.dart b/pkgs/ffigen/example/simple/generated_bindings.dart index 1976074b93..9b0b3a2f19 100644 --- a/pkgs/ffigen/example/simple/generated_bindings.dart +++ b/pkgs/ffigen/example/simple/generated_bindings.dart @@ -1,6 +1,6 @@ -/// AUTO GENERATED FILE, DO NOT EDIT. -/// -/// Generated by `package:ffigen`. +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. import 'dart:ffi' as ffi; /// Bindings to `headers/example.h`. diff --git a/pkgs/ffigen/lib/src/code_generator/utils.dart b/pkgs/ffigen/lib/src/code_generator/utils.dart index e91b5ee4a6..5ee0e302db 100644 --- a/pkgs/ffigen/lib/src/code_generator/utils.dart +++ b/pkgs/ffigen/lib/src/code_generator/utils.dart @@ -47,7 +47,7 @@ class UniqueNamer { UniqueNamer clone() => UniqueNamer._raw({..._usedUpNames}); } -/// Converts [text] to a dart doc comment. +/// Converts [text] to a dart doc comment(`///`). /// /// Comment is split on new lines only. String makeDartDoc(String text) { @@ -58,3 +58,15 @@ String makeDartDoc(String text) { return s.toString(); } + +/// Converts [text] to a dart comment (`//`). +/// +/// Comment is split on new lines only. +String makeDoc(String text) { + final s = StringBuffer(); + s.write('// '); + s.writeAll(text.split('\n'), '\n// '); + s.write('\n'); + + return s.toString(); +} diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index e09b9ed8d4..41be178162 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -105,12 +105,12 @@ class Writer { if (header != null) { s.write(header); s.write('\n'); - } else { - // Write default header, in case none was provided. - s.write(makeDartDoc( - 'AUTO GENERATED FILE, DO NOT EDIT.\n\nGenerated by `package:ffigen`.')); } + // Write auto generated declaration. + s.write(makeDoc( + 'AUTO GENERATED FILE, DO NOT EDIT.\n\nGenerated by `package:ffigen`.')); + // Write neccesary imports. s.write("import 'dart:ffi' as $ffiLibraryPrefix;\n"); s.write('\n'); diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 61fe3d866b..55c1903ed0 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -1,6 +1,11 @@ -/// AUTO GENERATED FILE, DO NOT EDIT. -/// -/// Generated by `package:ffigen`. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM +// Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. import 'dart:ffi' as ffi; /// Holds bindings to LibClang. diff --git a/pkgs/ffigen/test/code_generator_test.dart b/pkgs/ffigen/test/code_generator_test.dart index 47c0ac7730..7abf5df1bd 100644 --- a/pkgs/ffigen/test/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_test.dart @@ -78,9 +78,9 @@ void main() { 'test/debug_generated/Function-Binding-test-output.dart', ); try { - expect(gen, '''/// AUTO GENERATED FILE, DO NOT EDIT. -/// -/// Generated by `package:ffigen`. + expect(gen, '''// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. import 'dart:ffi' as ffi; class Bindings{ @@ -232,9 +232,9 @@ typedef _dart_withPointerParam = ffi.Pointer Function( final file = File('test/debug_generated/Struct-Binding-test-output.dart'); try { - expect(gen, '''/// AUTO GENERATED FILE, DO NOT EDIT. -/// -/// Generated by `package:ffigen`. + expect(gen, '''// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. import 'dart:ffi' as ffi; /// Just a test struct @@ -333,9 +333,9 @@ class WithPointerMember extends ffi.Struct{ File('test/debug_generated/Func-n-Struct-Binding-test-output.dart'); try { //expect - expect(gen, '''/// AUTO GENERATED FILE, DO NOT EDIT. -/// -/// Generated by `package:ffigen`. + expect(gen, '''// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. import 'dart:ffi' as ffi; class Bindings{ @@ -428,9 +428,9 @@ typedef _dart_someFunc = ffi.Pointer Function( 'test/debug_generated/Global-Binding-test-output.dart', ); try { - expect(gen, '''/// AUTO GENERATED FILE, DO NOT EDIT. -/// -/// Generated by `package:ffigen`. + expect(gen, '''// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. import 'dart:ffi' as ffi; class Bindings{ @@ -489,9 +489,9 @@ class Some extends ffi.Struct{ 'test/debug_generated/Constant-test-output.dart', ); try { - expect(gen, '''/// AUTO GENERATED FILE, DO NOT EDIT. -/// -/// Generated by `package:ffigen`. + expect(gen, '''// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. import 'dart:ffi' as ffi; const int test1 = 20; @@ -534,9 +534,9 @@ const double test2 = 20.0; 'test/debug_generated/enum-class-test-output.dart', ); try { - expect(gen, '''/// AUTO GENERATED FILE, DO NOT EDIT. -/// -/// Generated by `package:ffigen`. + expect(gen, '''// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. import 'dart:ffi' as ffi; /// test line 1 @@ -608,9 +608,9 @@ abstract class Constants { 'test/debug_generated/internal-conflict-resolution.dart', ); try { - expect(gen, r'''/// AUTO GENERATED FILE, DO NOT EDIT. -/// -/// Generated by `package:ffigen`. + expect(gen, r'''// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. import 'dart:ffi' as ffi; class init_dylib_1{ diff --git a/pkgs/ffigen/test/example_tests/cjson_example_test.dart b/pkgs/ffigen/test/example_tests/cjson_example_test.dart index b4093a89a1..3d4536f479 100644 --- a/pkgs/ffigen/test/example_tests/cjson_example_test.dart +++ b/pkgs/ffigen/test/example_tests/cjson_example_test.dart @@ -27,6 +27,26 @@ ${strings.headers}: ${strings.includeDirectives}: - '**cJSON.h' ${strings.comments}: false +${strings.preamble}: | + // Copyright (c) 2009-2017 Dave Gamble and cJSON contributors + // + // Permission is hereby granted, free of charge, to any person obtaining a copy + // of this software and associated documentation files (the "Software"), to deal + // in the Software without restriction, including without limitation the rights + // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + // copies of the Software, and to permit persons to whom the Software is + // furnished to do so, subject to the following conditions: + // + // The above copyright notice and this permission notice shall be included in + // all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + // THE SOFTWARE. ''') as YamlMap); final library = parse(config); diff --git a/pkgs/ffigen/test/example_tests/libclang_example_test.dart b/pkgs/ffigen/test/example_tests/libclang_example_test.dart index 80cd96dc90..ac3feab293 100644 --- a/pkgs/ffigen/test/example_tests/libclang_example_test.dart +++ b/pkgs/ffigen/test/example_tests/libclang_example_test.dart @@ -42,13 +42,15 @@ ${strings.enums}: ${strings.name}: 'LibClang' ${strings.description}: 'Holds bindings to LibClang.' ${strings.arrayWorkaround}: true -${strings.preamble}: | - /// AUTO GENERATED FILE, DO NOT EDIT. - /// - /// Generated by `package:ffigen`. ${strings.comments}: ${strings.style}: ${strings.doxygen} ${strings.length}: ${strings.full} + +${strings.preamble}: | + // Part of the LLVM Project, under the Apache License v2.0 with LLVM + // Exceptions. + // See https://llvm.org/LICENSE.txt for license information. + // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception ''') as YamlMap); final library = parse(config); diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart index 2a33af35ad..a22dd73601 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart @@ -1,6 +1,6 @@ -/// AUTO GENERATED FILE, DO NOT EDIT. -/// -/// Generated by `package:ffigen`. +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. import 'dart:ffi' as ffi; /// Bindings to Cjson. diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index 1cbd2a2a10..4b6325bd83 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -1,6 +1,6 @@ -/// AUTO GENERATED FILE, DO NOT EDIT. -/// -/// Generated by `package:ffigen`. +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. import 'dart:ffi' as ffi; /// Bindings to LibClang. diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index f2f0a2350e..7ca15ad870 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -1,6 +1,6 @@ -/// AUTO GENERATED FILE, DO NOT EDIT. -/// -/// Generated by `package:ffigen`. +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. import 'dart:ffi' as ffi; /// Bindings to SQLite. diff --git a/pkgs/ffigen/test/native_test/native_test_bindings.dart b/pkgs/ffigen/test/native_test/native_test_bindings.dart index fe4c94527b..28a2bce280 100644 --- a/pkgs/ffigen/test/native_test/native_test_bindings.dart +++ b/pkgs/ffigen/test/native_test/native_test_bindings.dart @@ -1,6 +1,6 @@ -/// AUTO GENERATED FILE, DO NOT EDIT. -/// -/// Generated by `package:ffigen`. +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. import 'dart:ffi' as ffi; /// Native tests. diff --git a/pkgs/ffigen/third_party/cjson_library/license.txt b/pkgs/ffigen/third_party/cjson_library/license.txt new file mode 100644 index 0000000000..287ef35e0c --- /dev/null +++ b/pkgs/ffigen/third_party/cjson_library/license.txt @@ -0,0 +1,24 @@ +Copyright (c) 2009-2017 Dave Gamble and cJSON contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + + +Files generated from cJSON source code are +- example/c_json/cjson_generated_bindings.dart +- test/large_integration_tests/_expected_cjson_bindings.dart diff --git a/pkgs/ffigen/third_party/libclang/license.txt b/pkgs/ffigen/third_party/libclang/license.txt new file mode 100644 index 0000000000..428da30d69 --- /dev/null +++ b/pkgs/ffigen/third_party/libclang/license.txt @@ -0,0 +1,224 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +--- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. + + +Files generated from libclang source code are +- example/libclang-example/generated_bindings.dart +- lib/src/header_parser/clang_bindings/clang_bindings.dart +- test/large_integration_tests/_expected_libclang_bindings.dart diff --git a/pkgs/ffigen/third_party/sqlite/license.txt b/pkgs/ffigen/third_party/sqlite/license.txt new file mode 100644 index 0000000000..d1a956a05c --- /dev/null +++ b/pkgs/ffigen/third_party/sqlite/license.txt @@ -0,0 +1,11 @@ +2001-09-15 + +The author disclaims copyright to this source code. In place of +a legal notice, here is a blessing: + + May you do good and not evil. + May you find forgiveness for yourself and forgive others. + May you share freely, never taking more than you give. + +Files generated from sqlite source code are +- test/large_integration_tests/_expected_sqlite_bindings.dart diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index a6db37616d..1f93991ed7 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -23,6 +23,11 @@ headers: - '**CXString.h' array-workaround: true +preamble: | + // Part of the LLVM Project, under the Apache License v2.0 with LLVM + // Exceptions. + // See https://llvm.org/LICENSE.txt for license information. + // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception enums: include: From 5a96775bbecd47b799105ff253b5ef94bd27c39f Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Wed, 12 Aug 2020 21:39:50 +0530 Subject: [PATCH 031/276] [ffigen] Update readme - added FAQ, fixed config table (#78) * Added FAQ section. * Fixed config table width of columns 2. * Removed element from
 causing indentation error on pub.
---
 pkgs/ffigen/CHANGELOG.md |   3 ++
 pkgs/ffigen/README.md    | 109 ++++++++++++++++++++++++++++++---------
 pkgs/ffigen/pubspec.yaml |   2 +-
 3 files changed, 89 insertions(+), 25 deletions(-)

diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md
index 705ba586d5..ebc9c26112 100644
--- a/pkgs/ffigen/CHANGELOG.md
+++ b/pkgs/ffigen/CHANGELOG.md
@@ -1,3 +1,6 @@
+# 0.2.1+1
+- Added FAQ to readme.
+
 # 0.2.1
 - Fixed missing/duplicate typedef generation.
 
diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md
index f97ab70246..6896b87383 100644
--- a/pkgs/ffigen/README.md
+++ b/pkgs/ffigen/README.md
@@ -41,6 +41,8 @@ typedef _dart_sum = int Function(int a,int b);
 - Configurations must be provided in `pubspec.yaml` or in a custom YAML file (see [configurations](#configurations)).
 - Run the tool- `pub run ffigen`.
 
+Jump to [FAQ](#faq).
+
 ## Setup
 `package:ffigen` uses LLVM. Install LLVM (9+) in the following way.
 
@@ -69,17 +71,21 @@ The following configuration options are available-
     Explaination
     Example
   
+  
+      
+      
+  
 
 
   
     output
(Required) Output path of the generated bindings. -
output: 'generated_bindings.dart'
+
output: 'generated_bindings.dart'
headers
(Required) The header entry-points and include-directives. Glob syntax is allowed. -

+    
 headers:
   entry-points:
     - 'folder/**.h'
@@ -88,27 +94,27 @@ headers:
     - '**index.h'
     - '**/clang-c/**'
     - '/full/path/to/a/header.h'
-  
+
name
(Prefer) Name of generated class. -
name: 'SQLite'
+
name: 'SQLite'
description
(Prefer) Dart Doc for generated class. -
description: 'Bindings to SQLite'
+
description: 'Bindings to SQLite'
compiler-opts Pass compiler options to clang. -
compiler-opts: '-I/usr/lib/llvm-9/include/'
+
compiler-opts: '-I/usr/lib/llvm-9/include/'
functions
structs
enums
macros Filters for declarations.
Default: all are included -

+    
 functions:
   include: # 'exclude' is also available.
     - [a-z][a-zA-Z0-9]* # Matches using regexp.
@@ -116,23 +122,28 @@ functions:
     - someFuncName # Matches with exact name
     - anotherName # Full names have higher priority.
   rename:
-    'clang_(.*)': '$1' # Regexp groups based replacement.
-    'clang_dispose': 'dispose' # full name matches have higher priority.
-    '_(.*)': '$1' # Removes '_' from beginning of a name.
+    # Regexp groups based replacement.
+    'clang_(.*)': '$1'
+    # full name matches have higher priority.
+    'clang_dispose': 'dispose'
+    # Removes '_' from beginning of a name.
+    '_(.*)': '$1'
 enums:
   member-rename:
     '(.*)': # Matches any enum.
-      '_(.*)': '$1' # Removes '_' from beginning enum member name.
+      # Removes '_' from beginning enum member name.
+      '_(.*)': '$1'
     'CXTypeKind': # Full names have higher priority.
-      'CXType(.*)': '$1' # $1 keeps only the 1st group i.e '(.*)'.
-    
+ # $1 keeps only the 1st group i.e '(.*)'. + 'CXType(.*)': '$1' +
array-workaround Should generate workaround for fixed arrays in Structs. See Array Workaround
Default: false -
array-workaround: true
+
array-workaround: true
comments @@ -141,43 +152,43 @@ enums: style: doxygen(default) | any
length: brief | full(default)
If you want to disable all comments you can also pass
- comments: false. + comments: false. -

+    
 comments:
   style: doxygen
   length: full
-    
+
sort Sort the bindings according to name.
Default: false, i.e keep the order as in the source files. -
sort: true
+
sort: true
use-supported-typedefs Should automatically map typedefs, E.g uint8_t => Uint8, int16_t => Int16 etc.
Default: true -
use-supported-typedefs: true
+
use-supported-typedefs: true
unnamed-enums Should generate constants for anonymous unnamed enums.
Default: true -
unnamed-enums: true
+
unnamed-enums: true
preamble Raw header of the file, pasted as-it-is. -

+    
 preamble: |
   /// AUTO GENERATED FILE, DO NOT EDIT.
   ///
-  /// Generated by `package:ffigen`.
+ /// Generated by `package:ffigen`.
size-map @@ -185,7 +196,7 @@ preamble: | The defaults (see example) may not be portable on all OS. Do not change these unless absolutely sure. -

+    
 # These are optional and also default,
 # Omitting any and the default will be used.
 size-map:
@@ -199,7 +210,7 @@ size-map:
   unsigned long: 8
   long long: 8
   unsigned long long: 8
-  enum: 4
+ enum: 4
@@ -294,3 +305,53 @@ class ArrayHelper_CXFileUniqueID_data_level0 { 2. Run `dart build_test_dylib.dart`. Run tests from the root of the package with `pub run test`. + +## FAQ +### Can ffigen be used for removing underscores or renaming declarations? +Ffigen supports **regexp based renaming**, the regexp must be a +full match, for renaming you can use regexp groups (`$1` means group 1). + +E.g - For renaming `clang_dispose_string` to `string_dispose`. +We can can match it using `clang_(.*)_(.*)` and rename with `$2_$1`. + +Here's an example of how to remove prefix underscores from any struct and its members. +```yaml +structs: + ... + rename: + '_(.*)': '$1' # Removes prefix underscores from all structures. + member-rename: + '.*': # Matches any struct. + '_(.*)': '$1' # Removes prefix underscores from members. +``` +### How to generate declarations only from particular headers? +The default behaviour is to include everything directly/transitively under +each of the `entry-points` specified. + +If you only want to have declarations directly particular header you can do so +using `include-directives`. You can use **glob matching** to match header paths. +```yaml +headers: + entry-points: + - 'path/to/my_header.h' + include-directives: + - '**my_header.h' # This glob pattern matches the header path. +``` +### Can ffigen filter declarations by name? +Ffigen supports including/excluding declarations using full regexp matching. + +Here's an example to filter functions using names +```yaml +functions: + include: + - 'clang.*' # Include all functions starting with clang. + exclude: + - '.*dispose': # Exclude all functions ending with dispose. +``` +This will include `clang_help`. But will exclude `clang_dispose`. + +Note: exclude overrides include. +### How does ffigen handle C Strings? + +Ffigen treats `char*` just as any other pointer,(`Pointer`). +To convert these to/from `String`, you can use [package:ffi](https://pub.dev/packages/ffi) and use `Utf8.fromUtf8(ptr.cast())` to convert `char*` to dart `string`. diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index aca4a49e42..1820277730 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 0.2.1 +version: 0.2.1+1 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C/C++ header files. From 1a260ce38b2b62cc441f4ad5dcf8b593429b5470 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 17 Aug 2020 17:20:57 +0530 Subject: [PATCH 032/276] [ffigen] Updated parsing of typedef enclosed declarations (#83) * added getCursorUSR_wrap method to wrapper, and bindings * Updated code to use libclang's USR for identification * Struct's typedef name will be used now (if it is only used in 1 typedef) * parseXXX now returns seen binding instead of null * added tests and removed obsolete code * updated version, changelog, test_coverage.dart * added PR ref to changelog * minor changes --- pkgs/ffigen/CHANGELOG.md | 4 ++ pkgs/ffigen/lib/src/clang_library/wrapper.c | 5 ++ pkgs/ffigen/lib/src/clang_library/wrapper.def | 1 + .../lib/src/code_generator/binding.dart | 32 ++++++++-- .../lib/src/code_generator/constant.dart | 8 ++- .../lib/src/code_generator/enum_class.dart | 8 ++- pkgs/ffigen/lib/src/code_generator/func.dart | 7 ++- .../ffigen/lib/src/code_generator/global.dart | 8 ++- pkgs/ffigen/lib/src/code_generator/struc.dart | 8 ++- .../clang_bindings/clang_bindings.dart | 29 +++++++-- pkgs/ffigen/lib/src/header_parser/data.dart | 4 +- .../lib/src/header_parser/includer.dart | 16 ++--- pkgs/ffigen/lib/src/header_parser/parser.dart | 6 +- .../sub_parsers/enumdecl_parser.dart | 16 +++-- .../sub_parsers/functiondecl_parser.dart | 8 ++- .../sub_parsers/macro_parser.dart | 28 +++++---- .../sub_parsers/structdecl_parser.dart | 15 ++++- .../sub_parsers/unnamed_enumdecl_parser.dart | 1 + .../translation_unit_parser.dart | 9 +-- .../type_extractor/extractor.dart | 21 +++---- pkgs/ffigen/lib/src/header_parser/utils.dart | 63 +++++++++++-------- pkgs/ffigen/lib/src/strings.dart | 2 +- pkgs/ffigen/pubspec.yaml | 2 +- .../ffigen/test/header_parser_tests/typedef.h | 40 ++++++++++++ .../header_parser_tests/typedef_test.dart | 18 ++++++ pkgs/ffigen/test/test_coverage.dart | 3 + pkgs/ffigen/tool/libclang_config.yaml | 1 + 27 files changed, 270 insertions(+), 93 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index ebc9c26112..0c54f0a02a 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.2.2 +- Fixed multiple generation/skipping of typedef enclosed declarations. +- Typedef names are now given higher preference over inner names, See [#83](https://github.com/dart-lang/ffigen/pull/83). + # 0.2.1+1 - Added FAQ to readme. diff --git a/pkgs/ffigen/lib/src/clang_library/wrapper.c b/pkgs/ffigen/lib/src/clang_library/wrapper.c index c43c7f60eb..2482e36bee 100644 --- a/pkgs/ffigen/lib/src/clang_library/wrapper.c +++ b/pkgs/ffigen/lib/src/clang_library/wrapper.c @@ -358,4 +358,9 @@ unsigned clang_Cursor_isAnonymousRecordDecl_wrap(CXCursor *cursor) return clang_Cursor_isAnonymousRecordDecl(*cursor); } +CXString *clang_getCursorUSR_wrap(CXCursor *cursor) +{ + return ptrToCXString(clang_getCursorUSR(*cursor)); +} + // END ===== WRAPPER FUNCTIONS ===================== diff --git a/pkgs/ffigen/lib/src/clang_library/wrapper.def b/pkgs/ffigen/lib/src/clang_library/wrapper.def index c82231ff36..5cb8a5c117 100644 --- a/pkgs/ffigen/lib/src/clang_library/wrapper.def +++ b/pkgs/ffigen/lib/src/clang_library/wrapper.def @@ -358,3 +358,4 @@ clang_Cursor_isMacroBuiltin_wrap clang_Cursor_Evaluate_wrap clang_Cursor_isAnonymous_wrap clang_Cursor_isAnonymousRecordDecl_wrap +clang_getCursorUSR_wrap diff --git a/pkgs/ffigen/lib/src/code_generator/binding.dart b/pkgs/ffigen/lib/src/code_generator/binding.dart index 5a10c06f15..b4267b8244 100644 --- a/pkgs/ffigen/lib/src/code_generator/binding.dart +++ b/pkgs/ffigen/lib/src/code_generator/binding.dart @@ -12,13 +12,23 @@ import 'writer.dart'; /// /// Do not extend directly, use [LookUpBinding] or [NoLookUpBinding]. abstract class Binding { + /// Holds the Unified Symbol Resolution string obtained from libclang. + final String usr; + + /// The name as it was in C. final String originalName; + /// Binding name to generate, may get changed to resolve name conflicts. String name; final String dartDoc; - Binding({@required this.originalName, @required this.name, this.dartDoc}); + Binding({ + @required this.usr, + @required this.originalName, + @required this.name, + this.dartDoc, + }); /// Return typedef dependencies. List getTypedefDependencies(Writer w); @@ -33,17 +43,29 @@ abstract class Binding { /// Base class for bindings which look up symbols in dynamic library. abstract class LookUpBinding extends Binding { LookUpBinding({ - @required String originalName, + String usr, + String originalName, @required String name, String dartDoc, - }) : super(originalName: originalName, name: name, dartDoc: dartDoc); + }) : super( + usr: usr ?? name, + originalName: originalName ?? name, + name: name, + dartDoc: dartDoc, + ); } /// Base class for bindings which don't look up symbols in dynamic library. abstract class NoLookUpBinding extends Binding { NoLookUpBinding({ - @required String originalName, + String usr, + String originalName, @required String name, String dartDoc, - }) : super(originalName: originalName, name: name, dartDoc: dartDoc); + }) : super( + usr: usr ?? name, + originalName: originalName ?? name, + name: name, + dartDoc: dartDoc, + ); } diff --git a/pkgs/ffigen/lib/src/code_generator/constant.dart b/pkgs/ffigen/lib/src/code_generator/constant.dart index b5521adfce..41572abb83 100644 --- a/pkgs/ffigen/lib/src/code_generator/constant.dart +++ b/pkgs/ffigen/lib/src/code_generator/constant.dart @@ -31,12 +31,18 @@ class Constant extends NoLookUpBinding { final String rawValue; Constant({ + String usr, String originalName, @required String name, String dartDoc, @required this.rawType, @required this.rawValue, - }) : super(originalName: originalName ?? name, name: name, dartDoc: dartDoc); + }) : super( + usr: usr, + originalName: originalName, + name: name, + dartDoc: dartDoc, + ); @override BindingString toBindingString(Writer w) { diff --git a/pkgs/ffigen/lib/src/code_generator/enum_class.dart b/pkgs/ffigen/lib/src/code_generator/enum_class.dart index 1a383ce814..9404c4becf 100644 --- a/pkgs/ffigen/lib/src/code_generator/enum_class.dart +++ b/pkgs/ffigen/lib/src/code_generator/enum_class.dart @@ -28,12 +28,18 @@ class EnumClass extends NoLookUpBinding { final List enumConstants; EnumClass({ + String usr, String originalName, @required String name, String dartDoc, List enumConstants, }) : enumConstants = enumConstants ?? [], - super(originalName: originalName ?? name, name: name, dartDoc: dartDoc); + super( + usr: usr, + originalName: originalName, + name: name, + dartDoc: dartDoc, + ); @override BindingString toBindingString(Writer w) { diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index 551dae96c1..d29abcb944 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -36,6 +36,7 @@ class Func extends LookUpBinding { /// [originalName] is looked up in dynamic library, if not /// provided, takes the value of [name]. Func({ + String usr, @required String name, String originalName, String dartDoc, @@ -43,7 +44,11 @@ class Func extends LookUpBinding { List parameters, }) : parameters = parameters ?? [], super( - originalName: originalName ?? name, name: name, dartDoc: dartDoc) { + usr: usr, + originalName: originalName, + name: name, + dartDoc: dartDoc, + ) { for (var i = 0; i < this.parameters.length; i++) { if (this.parameters[i].name == null || this.parameters[i].name.trim() == '') { diff --git a/pkgs/ffigen/lib/src/code_generator/global.dart b/pkgs/ffigen/lib/src/code_generator/global.dart index d0e67cf37d..79478fa444 100644 --- a/pkgs/ffigen/lib/src/code_generator/global.dart +++ b/pkgs/ffigen/lib/src/code_generator/global.dart @@ -25,11 +25,17 @@ class Global extends LookUpBinding { final Type type; Global({ + String usr, String originalName, @required String name, @required this.type, String dartDoc, - }) : super(originalName: originalName ?? name, name: name, dartDoc: dartDoc); + }) : super( + usr: usr, + originalName: originalName, + name: name, + dartDoc: dartDoc, + ); @override BindingString toBindingString(Writer w) { diff --git a/pkgs/ffigen/lib/src/code_generator/struc.dart b/pkgs/ffigen/lib/src/code_generator/struc.dart index f241fd7a42..8cd6df3fcc 100644 --- a/pkgs/ffigen/lib/src/code_generator/struc.dart +++ b/pkgs/ffigen/lib/src/code_generator/struc.dart @@ -39,12 +39,18 @@ class Struc extends NoLookUpBinding { List members; Struc({ + String usr, String originalName, @required String name, String dartDoc, List members, }) : members = members ?? [], - super(originalName: originalName ?? name, name: name, dartDoc: dartDoc); + super( + usr: usr, + originalName: originalName, + name: name, + dartDoc: dartDoc, + ); List _getArrayDimensionLengths(Type type) { final array = []; diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 55c1903ed0..82222c78d9 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -489,7 +489,7 @@ class Clang { /// instead of cxcursor by default. int clang_visitChildren_wrap( ffi.Pointer parent, - ffi.Pointer> _modifiedVisitor, + ffi.Pointer> _modifiedVisitor, int uid, ) { _clang_visitChildren_wrap ??= _dylib.lookupFunction< @@ -778,6 +778,19 @@ class Clang { _dart_clang_Cursor_isAnonymousRecordDecl_wrap _clang_Cursor_isAnonymousRecordDecl_wrap; + + ffi.Pointer clang_getCursorUSR_wrap( + ffi.Pointer cursor, + ) { + _clang_getCursorUSR_wrap ??= _dylib.lookupFunction< + _c_clang_getCursorUSR_wrap, + _dart_clang_getCursorUSR_wrap>('clang_getCursorUSR_wrap'); + return _clang_getCursorUSR_wrap( + cursor, + ); + } + + _dart_clang_getCursorUSR_wrap _clang_getCursorUSR_wrap; } /// A character string. @@ -2451,7 +2464,7 @@ typedef _dart_clang_formatDiagnostic_wrap = ffi.Pointer Function( int opts, ); -typedef ModifiedCXCursorVisitor_1 = ffi.Int32 Function( +typedef ModifiedCXCursorVisitor = ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, @@ -2459,13 +2472,13 @@ typedef ModifiedCXCursorVisitor_1 = ffi.Int32 Function( typedef _c_clang_visitChildren_wrap = ffi.Uint32 Function( ffi.Pointer parent, - ffi.Pointer> _modifiedVisitor, + ffi.Pointer> _modifiedVisitor, ffi.Int64 uid, ); typedef _dart_clang_visitChildren_wrap = int Function( ffi.Pointer parent, - ffi.Pointer> _modifiedVisitor, + ffi.Pointer> _modifiedVisitor, int uid, ); @@ -2641,3 +2654,11 @@ typedef _c_clang_Cursor_isAnonymousRecordDecl_wrap = ffi.Uint32 Function( typedef _dart_clang_Cursor_isAnonymousRecordDecl_wrap = int Function( ffi.Pointer cursor, ); + +typedef _c_clang_getCursorUSR_wrap = ffi.Pointer Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_getCursorUSR_wrap = ffi.Pointer Function( + ffi.Pointer cursor, +); diff --git a/pkgs/ffigen/lib/src/header_parser/data.dart b/pkgs/ffigen/lib/src/header_parser/data.dart index 6c21338602..c307a26614 100644 --- a/pkgs/ffigen/lib/src/header_parser/data.dart +++ b/pkgs/ffigen/lib/src/header_parser/data.dart @@ -37,8 +37,8 @@ IncrementalNamer _incrementalNamer; final uid = Isolate.current.controlPort.nativePort; /// Saved macros, Key: prefixedName, Value originalName. -Map get savedMacros => _savedMacros; -Map _savedMacros; +Map get savedMacros => _savedMacros; +Map _savedMacros; /// Saved unnamed EnumConstants. List get unnamedEnumConstants => _unnamedEnumConstants; diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart index a4766e1bd5..5c534a7cc6 100644 --- a/pkgs/ffigen/lib/src/header_parser/includer.dart +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -7,8 +7,8 @@ import 'data.dart'; /// Utility functions to check whether a binding should be parsed or not /// based on filters. -bool shouldIncludeStruct(String name) { - if (bindingsIndex.isSeenStruct(name) || name == '') { +bool shouldIncludeStruct(String usr, String name) { + if (bindingsIndex.isSeenStruct(usr) || name == '') { return false; } else if (config.structDecl == null || config.structDecl.shouldInclude(name)) { @@ -18,8 +18,8 @@ bool shouldIncludeStruct(String name) { } } -bool shouldIncludeFunc(String name) { - if (bindingsIndex.isSeenFunc(name) || name == '') { +bool shouldIncludeFunc(String usr, String name) { + if (bindingsIndex.isSeenFunc(usr) || name == '') { return false; } else if (config.functionDecl == null || config.functionDecl.shouldInclude(name)) { @@ -29,8 +29,8 @@ bool shouldIncludeFunc(String name) { } } -bool shouldIncludeEnumClass(String name) { - if (bindingsIndex.isSeenEnumClass(name) || name == '') { +bool shouldIncludeEnumClass(String usr, String name) { + if (bindingsIndex.isSeenEnumClass(usr) || name == '') { return false; } else if (config.enumClassDecl == null || config.enumClassDecl.shouldInclude(name)) { @@ -40,8 +40,8 @@ bool shouldIncludeEnumClass(String name) { } } -bool shouldIncludeMacro(String name) { - if (bindingsIndex.isSeenMacro(name) || name == '') { +bool shouldIncludeMacro(String usr, String name) { + if (bindingsIndex.isSeenMacro(usr) || name == '') { return false; } else if (config.macroDecl == null || config.macroDecl.shouldInclude(name)) { return true; diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index 177157407f..c5698b0fd3 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -82,8 +82,8 @@ List parseToBindings() { cmdLen = config.compilerOpts.length; } - // Contains all bindings. - final bindings = []; + // Contains all bindings. A set ensures we never have duplicates. + final bindings = {}; // Log all headers for user. _logger.info('Input Headers: ${config.headers.entryPoints}'); @@ -130,5 +130,5 @@ List parseToBindings() { clangCmdArgs.dispose(config.compilerOpts.length); } clang.clang_disposeIndex(index); - return bindings; + return bindings.toList(); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index 3460e28426..50248a68e4 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -28,10 +28,11 @@ final _stack = Stack<_ParsedEnum>(); EnumClass parseEnumDeclaration( Pointer cursor, { - /// Optionally provide name to use (useful in case struct is inside a typedef). + /// Optionally provide name to use (useful in case enum is inside a typedef). String name, }) { _stack.push(_ParsedEnum()); + final enumUsr = cursor.usr(); final enumName = name ?? cursor.spelling(); if (enumName == '') { // Save this unnamed enum if it is anonymous (therefore not in a typedef). @@ -42,17 +43,24 @@ EnumClass parseEnumDeclaration( } else { _logger.fine('Unnamed enum inside a typedef.'); } - } else if (shouldIncludeEnumClass(enumName) && - !bindingsIndex.isSeenEnumClass(enumName)) { + } else if (shouldIncludeEnumClass(enumUsr, enumName)) { _logger.fine('++++ Adding Enum: ${cursor.completeStringRepr()}'); _stack.top.enumClass = EnumClass( + usr: enumUsr, dartDoc: getCursorDocComment(cursor), originalName: enumName, name: config.enumClassDecl.renameUsingConfig(enumName), ); - bindingsIndex.addEnumClassToSeen(enumName, _stack.top.enumClass); + bindingsIndex.addEnumClassToSeen(enumUsr, _stack.top.enumClass); _addEnumConstant(cursor); } + if (bindingsIndex.isSeenEnumClass(enumUsr)) { + _stack.top.enumClass = bindingsIndex.getSeenEnumClass(enumUsr); + + // If enum is seen, update it's name. + _stack.top.enumClass.name = + config.enumClassDecl.renameUsingConfig(enumName); + } return _stack.pop().enumClass; } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index 9137c7386d..78d52b4cee 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -31,8 +31,9 @@ Func parseFunctionDeclaration(Pointer cursor) { _stack.top.structByValueParameter = false; _stack.top.unimplementedParameterType = false; + final funcUsr = cursor.usr(); final funcName = cursor.spelling(); - if (shouldIncludeFunc(funcName) && !bindingsIndex.isSeenFunc(funcName)) { + if (shouldIncludeFunc(funcUsr, funcName)) { _logger.fine('++++ Adding Function: ${cursor.completeStringRepr()}'); final rt = _getFunctionReturnType(cursor); @@ -65,12 +66,15 @@ Func parseFunctionDeclaration(Pointer cursor) { cursor, nesting.length + commentPrefix.length, ), + usr: funcUsr, name: config.functionDecl.renameUsingConfig(funcName), originalName: funcName, returnType: rt, parameters: parameters, ); - bindingsIndex.addFuncToSeen(funcName, _stack.top.func); + bindingsIndex.addFuncToSeen(funcUsr, _stack.top.func); + } else if (bindingsIndex.isSeenFunc(funcUsr)) { + _stack.top.func = bindingsIndex.getSeenFunc(funcUsr); } return _stack.pop().func; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart index dd35b78e3c..ad9df5664c 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart @@ -20,25 +20,25 @@ var _logger = Logger('ffigen.header_parser.macro_parser'); /// Adds a macro definition to be parsed later. void saveMacroDefinition(Pointer cursor) { + final macroUsr = cursor.usr(); final originalMacroName = cursor.spelling(); - if (shouldIncludeMacro(originalMacroName) && - !bindingsIndex.isSeenMacro(originalMacroName) && - clang.clang_Cursor_isMacroBuiltin_wrap(cursor) == 0 && - clang.clang_Cursor_isMacroFunctionLike_wrap(cursor) == 0) { + if (clang.clang_Cursor_isMacroBuiltin_wrap(cursor) == 0 && + clang.clang_Cursor_isMacroFunctionLike_wrap(cursor) == 0 && + shouldIncludeMacro(macroUsr, originalMacroName)) { // Parse macro only if it's not builtin or function-like. _logger.fine( "++++ Saved Macro '$originalMacroName' for later : ${cursor.completeStringRepr()}"); final prefixedName = config.macroDecl.renameUsingConfig(originalMacroName); - bindingsIndex.addMacroToSeen(originalMacroName, prefixedName); - _saveMacro(prefixedName, originalMacroName); + bindingsIndex.addMacroToSeen(macroUsr, prefixedName); + _saveMacro(prefixedName, macroUsr, originalMacroName); } } /// Saves a macro to be parsed later. /// /// Macros are parsed later in [parseSavedMacros()]. -void _saveMacro(String name, String originalName) { - savedMacros[name] = originalName; +void _saveMacro(String name, String usr, String originalName) { + savedMacros[name] = Macro(usr, originalName); } List _bindings; @@ -114,7 +114,8 @@ int _macroVariablevisitor(Pointer cursor, switch (k) { case clang_types.CXEvalResultKind.CXEval_Int: constant = Constant( - originalName: savedMacros[macroName], + usr: savedMacros[macroName].usr, + originalName: savedMacros[macroName].originalName, name: macroName, rawType: 'int', rawValue: clang.clang_EvalResult_getAsLongLong(e).toString(), @@ -122,7 +123,8 @@ int _macroVariablevisitor(Pointer cursor, break; case clang_types.CXEvalResultKind.CXEval_Float: constant = Constant( - originalName: savedMacros[macroName], + usr: savedMacros[macroName].usr, + originalName: savedMacros[macroName].originalName, name: macroName, rawType: 'double', rawValue: clang.clang_EvalResult_getAsDouble(e).toString(), @@ -135,7 +137,8 @@ int _macroVariablevisitor(Pointer cursor, // Escape ' character, because our strings are enclosed with '. value = value.replaceAll("'", r"\'"); constant = Constant( - originalName: savedMacros[macroName], + usr: savedMacros[macroName].usr, + originalName: savedMacros[macroName].originalName, name: macroName, rawType: 'String', rawValue: "'${value}'", @@ -204,7 +207,8 @@ File createFileForMacros() { for (final prefixedMacroName in savedMacros.keys) { // Write macro. final macroVarName = MacroVariableString.encode(prefixedMacroName); - sb.writeln('auto ${macroVarName} = ${savedMacros[prefixedMacroName]};'); + sb.writeln( + 'auto ${macroVarName} = ${savedMacros[prefixedMacroName].originalName};'); // Add to _macroVarNames. _macroVarNames.add(macroVarName); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index 3b6212337f..6ae4c80f16 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -38,25 +38,34 @@ Struc parseStructDeclaration( bool ignoreFilter = false, }) { _stack.push(_ParsedStruc()); + + final structUsr = cursor.usr(); final structName = name ?? cursor.spelling(); if (structName.isEmpty) { _logger.finest('unnamed structure or typedef structure declaration'); - } else if ((ignoreFilter || shouldIncludeStruct(structName)) && - (!bindingsIndex.isSeenStruct(structName))) { + } else if ((ignoreFilter || shouldIncludeStruct(structUsr, structName)) && + (!bindingsIndex.isSeenStruct(structUsr))) { _logger.fine( '++++ Adding Structure: structName: ${structName}, ${cursor.completeStringRepr()}'); _stack.top.struc = Struc( + usr: structUsr, originalName: structName, name: config.structDecl.renameUsingConfig(structName), dartDoc: getCursorDocComment(cursor), ); // Adding to seen here to stop recursion if a struct has itself as a // member, members are updated later. - bindingsIndex.addStructToSeen(structName, _stack.top.struc); + bindingsIndex.addStructToSeen(structUsr, _stack.top.struc); _setStructMembers(cursor); } + if (bindingsIndex.isSeenStruct(structUsr)) { + _stack.top.struc = bindingsIndex.getSeenStruct(structUsr); + + // If struct is seen, update it's name. + _stack.top.struc.name = config.structDecl.renameUsingConfig(structName); + } return _stack.pop().struc; } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart index b5039c4b4d..713fae08c7 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart @@ -56,6 +56,7 @@ int _unnamedenumCursorVisitor(Pointer cursor, void _addUnNamedEnumConstant(Pointer cursor) { unnamedEnumConstants.add( Constant( + usr: cursor.usr(), originalName: cursor.spelling(), name: config.enumClassDecl.renameMemberUsingConfig( '', // Un-named enum constants have an empty declaration name. diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart index 4c1f36cf22..f576faecc9 100644 --- a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -19,12 +19,12 @@ import 'utils.dart'; var _logger = Logger('ffigen.header_parser.translation_unit_parser'); -List _bindings; +Set _bindings; /// Parses the translation unit and returns the generated bindings. -List parseTranslationUnit( +Set parseTranslationUnit( Pointer translationUnitCursor) { - _bindings = []; + _bindings = {}; final resultCode = clang.clang_visitChildren_wrap( translationUnitCursor, Pointer.fromFunction( @@ -77,9 +77,10 @@ int _rootCursorVisitor(Pointer cursor, return clang_types.CXChildVisitResult.CXChildVisit_Continue; } -/// Adds to binding if not null. +/// Adds to binding if unseen and not null. void addToBindings(Binding b) { if (b != null) { + // This is a set, and hence will not have duplicates. _bindings.add(b); } } diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index d73e0297ed..a198420cfe 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -51,7 +51,7 @@ Type getCodeGenType(Pointer cxtype, {String parentName}) { et.dispose(); return s; case clang_types.CXTypeKind.CXType_Record: - return _extractfromRecord(cxtype); + return _extractfromRecord(cxtype, parentName); case clang_types.CXTypeKind.CXType_Enum: return Type.nativeType( enumNativeType, @@ -87,7 +87,7 @@ Type getCodeGenType(Pointer cxtype, {String parentName}) { } } -Type _extractfromRecord(Pointer cxtype) { +Type _extractfromRecord(Pointer cxtype, String parentName) { Type type; final cursor = clang.clang_getTypeDeclaration_wrap(cxtype); @@ -96,26 +96,21 @@ Type _extractfromRecord(Pointer cxtype) { switch (clang.clang_getCursorKind_wrap(cursor)) { case clang_types.CXCursorKind.CXCursor_StructDecl: final cxtype = cursor.type(); - var structName = cursor.spelling(); - if (structName == '') { - // Incase of anonymous structs defined inside a typedef. - structName = cxtype.spelling(); - } + final structUsr = cursor.usr(); - final fixedStructName = config.structDecl.renameUsingConfig(structName); + // Name of typedef (parentName) is used if available. + final structName = parentName ?? cursor.spelling(); // Also add a struct binding, if its unseen. // TODO(23): Check if we should auto add struct. - if (bindingsIndex.isSeenStruct(structName)) { - type = Type.struct(bindingsIndex.getSeenStruct(structName)); + if (bindingsIndex.isSeenStruct(structUsr)) { + type = Type.struct(bindingsIndex.getSeenStruct(structUsr)); } else { final struc = parseStructDeclaration(cursor, - name: fixedStructName, ignoreFilter: true); + name: structName, ignoreFilter: true); type = Type.struct(struc); // Add to bindings. addToBindings(struc); - // Add to seen. - bindingsIndex.addStructToSeen(structName, struc); } cxtype.dispose(); diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index 54fcc8bd3e..d578b00287 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -57,6 +57,10 @@ extension CXSourceRangeExt on Pointer { } extension CXCursorExt on Pointer { + String usr() { + return clang.clang_getCursorUSR_wrap(this).toStringAndDispose(); + } + /// Returns the kind int from [clang_types.CXCursorKind]. int kind() { return clang.clang_getCursorKind_wrap(this); @@ -78,7 +82,7 @@ extension CXCursorExt on Pointer { String completeStringRepr() { final cxtype = type(); final s = - '(Cursor) spelling: ${spelling()}, kind: ${kind()}, kindSpelling: ${kindSpelling()}, type: ${cxtype.kind()}, typeSpelling: ${cxtype.spelling()}'; + '(Cursor) spelling: ${spelling()}, kind: ${kind()}, kindSpelling: ${kindSpelling()}, type: ${cxtype.kind()}, typeSpelling: ${cxtype.spelling()}, usr: ${usr()}'; cxtype.dispose(); return s; } @@ -323,9 +327,16 @@ class IncrementalNamer { } } +class Macro { + final String usr; + final String originalName; + + Macro(this.usr, this.originalName); +} + /// Tracks if a binding is 'seen' or not. class BindingsIndex { - // Stores binding names already seen. Map key is same as their original name. + // Tracks if bindings are already seen, Map key is USR obtained from libclang. final Map _structs = {}; final Map _functions = {}; final Map _enumClass = {}; @@ -333,52 +344,52 @@ class BindingsIndex { // Stores only named typedefC used in NativeFunc. final Map _functionTypedefs = {}; - bool isSeenStruct(String originalName) { - return _structs.containsKey(originalName); + bool isSeenStruct(String usr) { + return _structs.containsKey(usr); } - void addStructToSeen(String originalName, Struc struc) { - _structs[originalName] = struc; + void addStructToSeen(String usr, Struc struc) { + _structs[usr] = struc; } - Struc getSeenStruct(String originalName) { - return _structs[originalName]; + Struc getSeenStruct(String usr) { + return _structs[usr]; } - bool isSeenFunc(String originalName) { - return _functions.containsKey(originalName); + bool isSeenFunc(String usr) { + return _functions.containsKey(usr); } - void addFuncToSeen(String originalName, Func func) { - _functions[originalName] = func; + void addFuncToSeen(String usr, Func func) { + _functions[usr] = func; } - Func getSeenFunc(String originalName) { - return _functions[originalName]; + Func getSeenFunc(String usr) { + return _functions[usr]; } - bool isSeenEnumClass(String originalName) { - return _enumClass.containsKey(originalName); + bool isSeenEnumClass(String usr) { + return _enumClass.containsKey(usr); } - void addEnumClassToSeen(String originalName, EnumClass enumClass) { - _enumClass[originalName] = enumClass; + void addEnumClassToSeen(String usr, EnumClass enumClass) { + _enumClass[usr] = enumClass; } - EnumClass getSeenEnumClass(String originalName) { - return _enumClass[originalName]; + EnumClass getSeenEnumClass(String usr) { + return _enumClass[usr]; } - bool isSeenMacro(String originalName) { - return _macros.containsKey(originalName); + bool isSeenMacro(String usr) { + return _macros.containsKey(usr); } - void addMacroToSeen(String originalName, String macro) { - _macros[originalName] = macro; + void addMacroToSeen(String usr, String macro) { + _macros[usr] = macro; } - String getSeenMacro(String originalName) { - return _macros[originalName]; + String getSeenMacro(String usr) { + return _macros[usr]; } bool isSeenFunctionTypedef(String originalName) { diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index e05534703c..726e2f50d8 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -7,7 +7,7 @@ import 'package:ffigen/src/header_parser/clang_bindings/clang_bindings.dart' as clang; // This version must be updated whenever we update the libclang wrapper. -const dylibVersion = 'v2'; +const dylibVersion = 'v3'; /// Name of the dynamic library file according to current platform. String get dylibFileName { diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 1820277730..13ee6db426 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 0.2.1+1 +version: 0.2.2 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C/C++ header files. diff --git a/pkgs/ffigen/test/header_parser_tests/typedef.h b/pkgs/ffigen/test/header_parser_tests/typedef.h index f9aa357b29..3e9d996be8 100644 --- a/pkgs/ffigen/test/header_parser_tests/typedef.h +++ b/pkgs/ffigen/test/header_parser_tests/typedef.h @@ -11,3 +11,43 @@ struct Struct1 }; extern NamedFunctionProto func1(NamedFunctionProto named, void (*unnamed)(int)); + +typedef struct +{ + +} AnonymousStructInTypedef; +// These typerefs do not affect the name of AnonymousStructInTypedef. +typedef AnonymousStructInTypedef Typeref1; +typedef AnonymousStructInTypedef Typeref2; + +// Name from global namespace is used. +typedef struct _NamedStructInTypedef +{ + +} NamedStructInTypedef; + +// Both these names must be exlucded or this struct will be generated. +typedef struct _ExcludedStruct +{ + +} ExcludedStruct; +typedef ExcludedStruct NTyperef1; + +// Because `struct _ExcludedStruct` is excluded, the type name used +// in this function (the first function) will be used. +// Therefore, _ExcludedStruct will be generated as NTyperef1. +void func2(NTyperef1 *); + +typedef enum +{ + +} AnonymousEnumInTypedef; +// These typerefs do not affect the name of AnonymousEnumInTypedef. +typedef AnonymousEnumInTypedef Typeref1; +typedef AnonymousEnumInTypedef Typeref2; + +// Name from global namespace is used. +typedef enum _NamedEnumInTypedef +{ + +} NamedEnumInTypedef; diff --git a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart index 8480acd4f9..7f7646cfdc 100644 --- a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart @@ -27,6 +27,10 @@ ${strings.output}: 'unused' ${strings.headers}: ${strings.entryPoints}: - 'test/header_parser_tests/typedef.h' +${strings.structs}: + ${strings.exclude}: + - ExcludedStruct + - _ExcludedStruct ''') as yaml.YamlMap), ); }); @@ -43,6 +47,8 @@ Library expectedLibrary() { typedefType: TypedefType.C, returnType: Type.nativeType(SupportedNativeType.Void), ); + + final excludedNtyperef = Struc(name: 'NTyperef1'); return Library( name: 'Bindings', bindings: [ @@ -81,6 +87,18 @@ Library expectedLibrary() { ], returnType: Type.pointer(Type.nativeFunc(namedTypedef)), ), + Struc(name: 'AnonymousStructInTypedef'), + Struc(name: 'NamedStructInTypedef'), + excludedNtyperef, + Func( + name: 'func2', + returnType: Type.nativeType(SupportedNativeType.Void), + parameters: [ + Parameter(type: Type.pointer(Type.struct(excludedNtyperef))) + ], + ), + EnumClass(name: 'AnonymousEnumInTypedef'), + EnumClass(name: 'NamedEnumInTypedef'), ], ); } diff --git a/pkgs/ffigen/test/test_coverage.dart b/pkgs/ffigen/test/test_coverage.dart index 812105f1d3..a35f0f724d 100644 --- a/pkgs/ffigen/test/test_coverage.dart +++ b/pkgs/ffigen/test/test_coverage.dart @@ -21,6 +21,8 @@ import 'header_parser_tests/macros_test.dart' as header_parser_tests_macros_test; import 'header_parser_tests/nested_parsing_test.dart' as header_parser_tests_nested_parsing_test; +import 'header_parser_tests/typedef_test.dart' + as header_parser_tests_typedef_test; import 'header_parser_tests/unnamed_enums_test.dart' as header_parser_tests_unnamed_enums_test; import 'large_integration_tests/large_test.dart' @@ -39,6 +41,7 @@ void main() { header_parser_tests_macros_test.main(); header_parser_tests_function_n_struct_test.main(); header_parser_tests_nested_parsing_test.main(); + header_parser_tests_typedef_test.main(); header_parser_tests_unnamed_enums_test.main(); native_test_native_test.main(); rename_tests_rename_test.main(); diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index 1f93991ed7..c6baf25e34 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -99,3 +99,4 @@ functions: - clang_Cursor_Evaluate_wrap - clang_Cursor_isAnonymous_wrap - clang_Cursor_isAnonymousRecordDecl_wrap + - clang_getCursorUSR_wrap From 12f79c8c43da8c871a145261979094a6538966b2 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Wed, 19 Aug 2020 15:13:19 +0530 Subject: [PATCH 033/276] [ffigen] update meta (#82) --- pkgs/ffigen/CHANGELOG.md | 3 +++ pkgs/ffigen/pubspec.yaml | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 0c54f0a02a..12fe1b50f7 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.2.2+1 +- Updated `package:meta` version to `^1.1.8` for compatibility with flutter sdk. + # 0.2.2 - Fixed multiple generation/skipping of typedef enclosed declarations. - Typedef names are now given higher preference over inner names, See [#83](https://github.com/dart-lang/ffigen/pull/83). diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 13ee6db426..ca0fb44e56 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 0.2.2 +version: 0.2.2+1 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C/C++ header files. @@ -13,7 +13,7 @@ environment: dependencies: ffi: ^0.1.3 yaml: ^2.2.1 - meta: ^1.2.2 + meta: ^1.1.8 args: ^1.6.0 logging: ^0.11.4 glob: ^1.2.0 From e07937e021aff6b3d0b25d8ae4dc1db5a80bdff9 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Thu, 20 Aug 2020 15:54:43 +0530 Subject: [PATCH 034/276] [ffigen] Remove structs members for bit field members, Added tests (#85) --- pkgs/ffigen/CHANGELOG.md | 3 +++ pkgs/ffigen/lib/src/clang_library/wrapper.c | 4 ++++ pkgs/ffigen/lib/src/clang_library/wrapper.def | 1 + .../clang_bindings/clang_bindings.dart | 22 +++++++++++++++++++ .../sub_parsers/structdecl_parser.dart | 11 +++++++++- pkgs/ffigen/lib/src/strings.dart | 2 +- pkgs/ffigen/pubspec.yaml | 2 +- .../header_parser_tests/function_n_struct.h | 7 ++++++ .../function_n_struct_test.dart | 4 ++++ pkgs/ffigen/tool/libclang_config.yaml | 1 + 10 files changed, 54 insertions(+), 3 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 12fe1b50f7..f496c70465 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.2.3 +- Fixed parsing structs with bitfields, all members of structs with bit field members will now be removed. See [#84](https://github.com/dart-lang/ffigen/issues/84) + # 0.2.2+1 - Updated `package:meta` version to `^1.1.8` for compatibility with flutter sdk. diff --git a/pkgs/ffigen/lib/src/clang_library/wrapper.c b/pkgs/ffigen/lib/src/clang_library/wrapper.c index 2482e36bee..96f64baea1 100644 --- a/pkgs/ffigen/lib/src/clang_library/wrapper.c +++ b/pkgs/ffigen/lib/src/clang_library/wrapper.c @@ -363,4 +363,8 @@ CXString *clang_getCursorUSR_wrap(CXCursor *cursor) return ptrToCXString(clang_getCursorUSR(*cursor)); } +int clang_getFieldDeclBitWidth_wrap(CXCursor *cursor){ + return clang_getFieldDeclBitWidth(*cursor); +} + // END ===== WRAPPER FUNCTIONS ===================== diff --git a/pkgs/ffigen/lib/src/clang_library/wrapper.def b/pkgs/ffigen/lib/src/clang_library/wrapper.def index 5cb8a5c117..8a984b026a 100644 --- a/pkgs/ffigen/lib/src/clang_library/wrapper.def +++ b/pkgs/ffigen/lib/src/clang_library/wrapper.def @@ -359,3 +359,4 @@ clang_Cursor_Evaluate_wrap clang_Cursor_isAnonymous_wrap clang_Cursor_isAnonymousRecordDecl_wrap clang_getCursorUSR_wrap +clang_getFieldDeclBitWidth_wrap diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 82222c78d9..b10830201f 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -791,6 +791,20 @@ class Clang { } _dart_clang_getCursorUSR_wrap _clang_getCursorUSR_wrap; + + int clang_getFieldDeclBitWidth_wrap( + ffi.Pointer cursor, + ) { + _clang_getFieldDeclBitWidth_wrap ??= _dylib.lookupFunction< + _c_clang_getFieldDeclBitWidth_wrap, + _dart_clang_getFieldDeclBitWidth_wrap>( + 'clang_getFieldDeclBitWidth_wrap'); + return _clang_getFieldDeclBitWidth_wrap( + cursor, + ); + } + + _dart_clang_getFieldDeclBitWidth_wrap _clang_getFieldDeclBitWidth_wrap; } /// A character string. @@ -2662,3 +2676,11 @@ typedef _c_clang_getCursorUSR_wrap = ffi.Pointer Function( typedef _dart_clang_getCursorUSR_wrap = ffi.Pointer Function( ffi.Pointer cursor, ); + +typedef _c_clang_getFieldDeclBitWidth_wrap = ffi.Int32 Function( + ffi.Pointer cursor, +); + +typedef _dart_clang_getFieldDeclBitWidth_wrap = int Function( + ffi.Pointer cursor, +); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index 6ae4c80f16..44ece8d4eb 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -21,6 +21,7 @@ class _ParsedStruc { bool unimplementedMemberType = false; bool flexibleArrayMember = false; bool arrayMember = false; + bool bitFieldMember = false; _ParsedStruc(); } @@ -108,6 +109,12 @@ void _setStructMembers(Pointer cursor) { _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(); } } @@ -121,7 +128,6 @@ int _structMembersVisitor(Pointer cursor, _logger.finer('===== member: ${cursor.completeStringRepr()}'); final mt = cursor.type().toCodeGenTypeAndDispose(); - //TODO(4): Remove these when support for Structs by value arrives. if (mt.broadType == BroadType.Struct) { // Setting this flag will exclude adding members for this struct's @@ -137,6 +143,9 @@ int _structMembersVisitor(Pointer cursor, } else if (mt.broadType == BroadType.IncompleteArray) { // TODO(68): Structs with flexible Array Members are not supported. _stack.top.flexibleArrayMember = true; + } else if (clang.clang_getFieldDeclBitWidth_wrap(cursor) != -1) { + // TODO(84): Struct with bitfields are not suppoorted. + _stack.top.bitFieldMember = true; } if (mt.getBaseType().broadType == BroadType.Unimplemented) { diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 726e2f50d8..9337fa1caf 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -7,7 +7,7 @@ import 'package:ffigen/src/header_parser/clang_bindings/clang_bindings.dart' as clang; // This version must be updated whenever we update the libclang wrapper. -const dylibVersion = 'v3'; +const dylibVersion = 'v4'; /// Name of the dynamic library file according to current platform. String get dylibFileName { diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index ca0fb44e56..9695da5a76 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 0.2.2+1 +version: 0.2.3 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C/C++ header files. diff --git a/pkgs/ffigen/test/header_parser_tests/function_n_struct.h b/pkgs/ffigen/test/header_parser_tests/function_n_struct.h index 3ee27b8aae..629c0ba8bb 100644 --- a/pkgs/ffigen/test/header_parser_tests/function_n_struct.h +++ b/pkgs/ffigen/test/header_parser_tests/function_n_struct.h @@ -18,6 +18,13 @@ struct Struct3 int b[]; // Flexible array member. }; +// All members should be removed, Bit fields are not supported. +struct Struct4 +{ + int a:3; + int :2; // Unnamed bit field. +}; + void func1(struct Struct2 *s); // Incomplete array parameter will be treated as a pointer. diff --git a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart index 38951f19e0..909c13a597 100644 --- a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart @@ -46,6 +46,9 @@ ${strings.headers}: test('Struct3 flexible array member', () { expect((actual.getBinding('Struct3') as Struc).members.isEmpty, true); }); + test('Struct4 bit field member', () { + expect((actual.getBinding('Struct4') as Struc).members.isEmpty, true); + }); }); } @@ -81,6 +84,7 @@ Library expectedLibrary() { SupportedNativeType.Void, ), ), + Struc(name: 'Struct4'), ], ); } diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index c6baf25e34..4262736aca 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -100,3 +100,4 @@ functions: - clang_Cursor_isAnonymous_wrap - clang_Cursor_isAnonymousRecordDecl_wrap - clang_getCursorUSR_wrap + - clang_getFieldDeclBitWidth_wrap From 74a808bbe107e8b14eaf4f3400303c77e9364a80 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 24 Aug 2020 13:28:59 +0530 Subject: [PATCH 035/276] [ffigen] Fix missing typedef dependencies (#90) * Fix missing typedef dependencies of func and struct * added tests * update version, changelog --- pkgs/ffigen/CHANGELOG.md | 3 + .../lib/src/code_generator/binding.dart | 2 +- .../lib/src/code_generator/constant.dart | 4 - .../lib/src/code_generator/enum_class.dart | 4 - pkgs/ffigen/lib/src/code_generator/func.dart | 5 +- .../ffigen/lib/src/code_generator/global.dart | 4 - pkgs/ffigen/lib/src/code_generator/struc.dart | 2 +- .../lib/src/code_generator/typedef.dart | 13 +++ pkgs/ffigen/pubspec.yaml | 2 +- .../header_parser_tests/native_func_typedef.h | 10 ++ .../native_func_typedef_test.dart | 103 ++++++++++++++++++ 11 files changed, 135 insertions(+), 17 deletions(-) create mode 100644 pkgs/ffigen/test/header_parser_tests/native_func_typedef.h create mode 100644 pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index f496c70465..5db8023472 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.2.3+1 +- Fixed missing typedefs of nested function pointers. + # 0.2.3 - Fixed parsing structs with bitfields, all members of structs with bit field members will now be removed. See [#84](https://github.com/dart-lang/ffigen/issues/84) diff --git a/pkgs/ffigen/lib/src/code_generator/binding.dart b/pkgs/ffigen/lib/src/code_generator/binding.dart index b4267b8244..4f24d58163 100644 --- a/pkgs/ffigen/lib/src/code_generator/binding.dart +++ b/pkgs/ffigen/lib/src/code_generator/binding.dart @@ -31,7 +31,7 @@ abstract class Binding { }); /// Return typedef dependencies. - List getTypedefDependencies(Writer w); + List getTypedefDependencies(Writer w) => const []; /// Converts a Binding to its actual string representation. /// diff --git a/pkgs/ffigen/lib/src/code_generator/constant.dart b/pkgs/ffigen/lib/src/code_generator/constant.dart index 41572abb83..617f2d75bf 100644 --- a/pkgs/ffigen/lib/src/code_generator/constant.dart +++ b/pkgs/ffigen/lib/src/code_generator/constant.dart @@ -2,7 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:ffigen/src/code_generator/typedef.dart'; import 'package:meta/meta.dart'; import 'binding.dart'; @@ -58,7 +57,4 @@ class Constant extends NoLookUpBinding { return BindingString( type: BindingStringType.constant, string: s.toString()); } - - @override - List getTypedefDependencies(Writer w) => const []; } diff --git a/pkgs/ffigen/lib/src/code_generator/enum_class.dart b/pkgs/ffigen/lib/src/code_generator/enum_class.dart index 9404c4becf..867133a106 100644 --- a/pkgs/ffigen/lib/src/code_generator/enum_class.dart +++ b/pkgs/ffigen/lib/src/code_generator/enum_class.dart @@ -2,7 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:ffigen/src/code_generator/typedef.dart'; import 'package:meta/meta.dart'; import 'binding.dart'; @@ -71,9 +70,6 @@ class EnumClass extends NoLookUpBinding { return BindingString( type: BindingStringType.enumClass, string: s.toString()); } - - @override - List getTypedefDependencies(Writer w) => const []; } /// Represents a single value in an enum. diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index d29abcb944..c1f444b9f4 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -66,14 +66,15 @@ class Func extends LookUpBinding { // Add typedef's required by return type. final returnTypeBase = returnType.getBaseType(); if (returnTypeBase.broadType == BroadType.NativeFunction) { - _typedefDependencies.add(returnTypeBase.nativeFunc); + _typedefDependencies + .addAll(returnTypeBase.nativeFunc.getDependencies()); } // Add typedef's required by parameters. for (final p in parameters) { final base = p.type.getBaseType(); if (base.broadType == BroadType.NativeFunction) { - _typedefDependencies.add(base.nativeFunc); + _typedefDependencies.addAll(base.nativeFunc.getDependencies()); } } // Add C function typedef. diff --git a/pkgs/ffigen/lib/src/code_generator/global.dart b/pkgs/ffigen/lib/src/code_generator/global.dart index 79478fa444..817844df50 100644 --- a/pkgs/ffigen/lib/src/code_generator/global.dart +++ b/pkgs/ffigen/lib/src/code_generator/global.dart @@ -2,7 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:ffigen/src/code_generator/typedef.dart'; import 'package:meta/meta.dart'; import 'binding.dart'; @@ -54,7 +53,4 @@ class Global extends LookUpBinding { return BindingString(type: BindingStringType.global, string: s.toString()); } - - @override - List getTypedefDependencies(Writer w) => const []; } diff --git a/pkgs/ffigen/lib/src/code_generator/struc.dart b/pkgs/ffigen/lib/src/code_generator/struc.dart index 8cd6df3fcc..a17649beba 100644 --- a/pkgs/ffigen/lib/src/code_generator/struc.dart +++ b/pkgs/ffigen/lib/src/code_generator/struc.dart @@ -72,7 +72,7 @@ class Struc extends NoLookUpBinding { for (final m in members) { final base = m.type.getBaseType(); if (base.broadType == BroadType.NativeFunction) { - _typedefDependencies.add(base.nativeFunc); + _typedefDependencies.addAll(base.nativeFunc.getDependencies()); } } } diff --git a/pkgs/ffigen/lib/src/code_generator/typedef.dart b/pkgs/ffigen/lib/src/code_generator/typedef.dart index 0cf7f84249..e0c3c7a8c8 100644 --- a/pkgs/ffigen/lib/src/code_generator/typedef.dart +++ b/pkgs/ffigen/lib/src/code_generator/typedef.dart @@ -38,6 +38,19 @@ class Typedef { List parameters, }) : parameters = parameters ?? []; + /// Returns the [Typedef] dependencies required by this typedef including itself. + List getDependencies() { + final dep = []; + for (final p in parameters) { + final base = p.type.getBaseType(); + if (base.broadType == BroadType.NativeFunction) { + dep.addAll(base.nativeFunc.getDependencies()); + } + } + dep.add(this); + return dep; + } + String toTypedefString(Writer w) { final s = StringBuffer(); if (dartDoc != null) { diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 9695da5a76..f87d8ebff9 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 0.2.3 +version: 0.2.3+1 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C/C++ header files. diff --git a/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h b/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h new file mode 100644 index 0000000000..38551e991c --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h @@ -0,0 +1,10 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +struct struc +{ + void (*unnamed1)(void (*unnamed2)()); +}; + +void func(void (*unnamed1)(void (*unnamed2)())); diff --git a/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart new file mode 100644 index 0000000000..c2826d4dda --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart @@ -0,0 +1,103 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:io'; + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/config_provider.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; +import 'package:ffigen/src/strings.dart' as strings; + +import '../test_utils.dart'; + +Library actual; +void main() { + group('unnamed_enums_test', () { + setUpAll(() { + logWarnings(); + actual = parser.parse( + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Unnamed Enums Test' +${strings.output}: 'unused' +${strings.headers}: + ${strings.entryPoints}: + - 'test/header_parser_tests/native_func_typedef.h' + ''') as yaml.YamlMap), + ); + }); + + test('Expected bindings', () { + final gen = actual.generate(); + // Writing to file for debug purpose. + final file = + File('test/debug_generated/native_func_typedef_test-output.dart'); + + try { + expect(gen, '''// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Unnamed Enums Test +class NativeLibrary{ +/// Holds the Dynamic library. +final ffi.DynamicLibrary _dylib; + +/// The symbols are looked up in [dynamicLibrary]. +NativeLibrary(ffi.DynamicLibrary dynamicLibrary): _dylib = dynamicLibrary; + +void func( + ffi.Pointer> unnamed1, +) { +_func ??= _dylib.lookupFunction<_c_func,_dart_func>('func'); + return _func( + unnamed1, + ); +} +_dart_func _func; + +} + +class struc extends ffi.Struct{ + ffi.Pointer> unnamed1; + +} + +typedef _typedefC_3 = ffi.Void Function( +); + +typedef _typedefC_4 = ffi.Void Function( + ffi.Pointer> , +); + +typedef _c_func = ffi.Void Function( + ffi.Pointer> unnamed1, +); + +typedef _dart_func = void Function( + ffi.Pointer> unnamed1, +); + +typedef _typedefC_1 = ffi.Void Function( +); + +typedef _typedefC_2 = ffi.Void Function( + ffi.Pointer> , +); + +'''); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + file.writeAsStringSync(gen); + print('Failed test, Debug output: ${file.absolute?.path}'); + rethrow; + } + }); + }); +} From 82875d4ccc7b2210ce90e58a4d14750aabf5d5f4 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 24 Aug 2020 14:35:42 +0530 Subject: [PATCH 036/276] [ffigen] Improve logs (#87) * Added fallback to flutter format if dartfmt is not found * added red color for severe, green for success in log printing * Only catch ProcessException when calling dartfmt * used package:cli_utils for finding dart_sdk and ansi colors * use path.join --- pkgs/ffigen/CHANGELOG.md | 3 ++ pkgs/ffigen/bin/ffigen.dart | 30 ++++++++++++++++--- .../lib/src/code_generator/library.dart | 16 ++++++---- pkgs/ffigen/pubspec.yaml | 3 +- 4 files changed, 42 insertions(+), 10 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 5db8023472..5fc842d32e 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.2.3+2 +- Handle code formatting using dartfmt by finding dart-sdk. + # 0.2.3+1 - Fixed missing typedefs of nested function pointers. diff --git a/pkgs/ffigen/bin/ffigen.dart b/pkgs/ffigen/bin/ffigen.dart index d0b2ee1257..74021be8e9 100644 --- a/pkgs/ffigen/bin/ffigen.dart +++ b/pkgs/ffigen/bin/ffigen.dart @@ -6,6 +6,7 @@ import 'dart:io'; import 'package:args/args.dart'; +import 'package:cli_util/cli_logging.dart' show Ansi; import 'package:ffigen/ffigen.dart'; import 'package:logging/logging.dart'; import 'package:yaml/yaml.dart' as yaml; @@ -13,6 +14,15 @@ import 'package:yaml/yaml.dart' as yaml; import 'setup.dart'; var _logger = Logger('ffigen.ffigen'); +final _ansi = Ansi(Ansi.terminalSupportsAnsi); + +String successPen(String str) { + return '${_ansi.green}$str${_ansi.none}'; +} + +String errorPen(String str) { + return '${_ansi.red}$str${_ansi.none}'; +} void main(List args) { // Parses the cmd args. This will print usage and exit if --help was passed. @@ -45,7 +55,8 @@ void main(List args) { // Generate file for the parsed bindings. final gen = File(config.output); library.generateFile(gen); - _logger.info('Finished, Bindings generated in ${gen?.absolute?.path}'); + _logger.info( + successPen('Finished, Bindings generated in ${gen?.absolute?.path}')); } Config getConfig(ArgResults result) { @@ -173,16 +184,27 @@ void setupLogger(ArgResults result) { } // Setup logger for printing (if verbosity was set by user). Logger.root.onRecord.listen((record) { - print('${record.level.name.padRight(8)}: ${record.message}'); + final level = '[${record.level.name}]'.padRight(9); + printLog('${level}: ${record.message}', record.level); }); } else { // Setup logger for printing (if verbosity was not set by user). Logger.root.onRecord.listen((record) { if (record.level.value > Level.INFO.value) { - print(' ${record.level.name.padRight(8)}: ${record.message}'); + final level = '[${record.level.name}]'.padRight(9); + printLog('${level}: ${record.message}', record.level); } else { - print(record.message); + printLog(record.message, record.level); } }); } } + +void printLog(String log, Level level) { + // Prints text in red for Severe logs only. + if (level < Level.SEVERE) { + print(log); + } else { + print(errorPen(log)); + } +} diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index 10b73a9bcd..9503ee6479 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -4,9 +4,10 @@ import 'dart:io'; +import 'package:cli_util/cli_util.dart'; import 'package:logging/logging.dart'; import 'package:meta/meta.dart'; - +import 'package:path/path.dart' as p; import 'binding.dart'; import 'utils.dart'; import 'writer.dart'; @@ -93,10 +94,15 @@ class Library { /// Formats a file using `dartfmt`. void _dartFmt(String path) { - final result = Process.runSync('dartfmt', ['-w', path], - runInShell: Platform.isWindows); - if (result.stderr.toString().isNotEmpty) { - _logger.severe(result.stderr); + final dartFmt = p.join(getSdkPath(), 'bin', 'dartfmt'); + try { + final result = Process.runSync(dartFmt, ['-w', path], + runInShell: Platform.isWindows); + if (result.stderr.toString().isNotEmpty) { + _logger.severe(result.stderr); + } + } on ProcessException { + _logger.severe("Couldn't format bindings, unable to call $dartFmt."); } } diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index f87d8ebff9..1db827c2af 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 0.2.3+1 +version: 0.2.3+2 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C/C++ header files. @@ -16,6 +16,7 @@ dependencies: meta: ^1.1.8 args: ^1.6.0 logging: ^0.11.4 + cli_util: ^0.2.0 glob: ^1.2.0 path: ^1.7.0 quiver: ^2.1.3 From 9566c7e4baef15dfc66e53e1e3c989cff12c35c4 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 24 Aug 2020 20:04:19 +0530 Subject: [PATCH 037/276] [ffigen] Removed dart:cli usage, use dylib version from ffigen's pubspec.yaml (#88) * removed dart:cli usage, use dylib version from pubspec.lock --- pkgs/ffigen/CHANGELOG.md | 3 + pkgs/ffigen/bin/ffigen.dart | 17 ++-- .../lib/src/code_generator/library.dart | 2 +- .../lib/src/config_provider/config.dart | 2 +- .../lib/src/config_provider/spec_utils.dart | 2 +- pkgs/ffigen/lib/src/find_resource.dart | 94 ++++++++++++++++++- .../src/find_resource/find_resource_cli.dart | 37 -------- .../find_resource/find_resource_fallback.dart | 62 ------------ pkgs/ffigen/lib/src/header_parser/parser.dart | 2 +- .../sub_parsers/enumdecl_parser.dart | 4 +- .../sub_parsers/functiondecl_parser.dart | 2 +- .../sub_parsers/macro_parser.dart | 2 +- .../sub_parsers/structdecl_parser.dart | 2 +- .../sub_parsers/typedefdecl_parser.dart | 2 +- .../sub_parsers/unnamed_enumdecl_parser.dart | 2 +- .../translation_unit_parser.dart | 2 +- .../type_extractor/extractor.dart | 2 +- pkgs/ffigen/lib/src/strings.dart | 4 +- pkgs/ffigen/pubspec.yaml | 2 +- 19 files changed, 119 insertions(+), 126 deletions(-) delete mode 100644 pkgs/ffigen/lib/src/find_resource/find_resource_cli.dart delete mode 100644 pkgs/ffigen/lib/src/find_resource/find_resource_fallback.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 5fc842d32e..6dfc92d601 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.2.3+3 +- Wrapper dynamic library version now uses ffigen version from its pubspec.yaml file. + # 0.2.3+2 - Handle code formatting using dartfmt by finding dart-sdk. diff --git a/pkgs/ffigen/bin/ffigen.dart b/pkgs/ffigen/bin/ffigen.dart index 74021be8e9..d096914d88 100644 --- a/pkgs/ffigen/bin/ffigen.dart +++ b/pkgs/ffigen/bin/ffigen.dart @@ -13,7 +13,7 @@ import 'package:yaml/yaml.dart' as yaml; import 'setup.dart'; -var _logger = Logger('ffigen.ffigen'); +final _logger = Logger('ffigen.ffigen'); final _ansi = Ansi(Ansi.terminalSupportsAnsi); String successPen(String str) { @@ -28,24 +28,25 @@ void main(List args) { // Parses the cmd args. This will print usage and exit if --help was passed. final argResult = getArgResults(args); + // Setup logging level and printing. + setupLogger(argResult); + /// Prompt user if dylib doesn't exist and cannot be auto created to run /// `pub run ffigen:setup -Ipath/to/llvm/include -Lpath/to/llvm/lib`. if (!checkDylibExist() && !autoCreateDylib()) { - print('Unable to create dynamic library automatically.'); - print('If LLVM is installed, try running:'); - print(' pub run ffigen:setup -Ipath/to/llvm/include -Lpath/to/llvm/lib'); + _logger.severe('Unable to create dynamic library automatically.'); + _logger.severe('If LLVM is installed, try running:'); + _logger.severe( + ' pub run ffigen:setup -Ipath/to/llvm/include -Lpath/to/llvm/lib'); exit(1); } - // Setup logging level and printing. - setupLogger(argResult); - // Create a config object. Config config; try { config = getConfig(argResult); } on FormatException { - print('Please fix configuration errors and re-run the tool.'); + _logger.severe('Please fix configuration errors and re-run the tool.'); exit(1); } diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index 9503ee6479..2daa009b8e 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -12,7 +12,7 @@ import 'binding.dart'; import 'utils.dart'; import 'writer.dart'; -var _logger = Logger('ffigen.code_generator.library'); +final _logger = Logger('ffigen.code_generator.library'); /// Container for all Bindings. class Library { diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 0a913adaa4..2b9df49252 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -14,7 +14,7 @@ import '../strings.dart' as strings; import 'config_types.dart'; import 'spec_utils.dart'; -var _logger = Logger('ffigen.config_provider.config'); +final _logger = Logger('ffigen.config_provider.config'); /// Provides configurations to other modules. /// diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index ddf6b8994e..1400c2f959 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -14,7 +14,7 @@ import 'package:quiver/pattern.dart' as quiver; import '../strings.dart' as strings; import 'config_types.dart'; -var _logger = Logger('ffigen.config_provider.spec_utils'); +final _logger = Logger('ffigen.config_provider.spec_utils'); /// Replaces the path separators according to current platform. String _replaceSeparators(String path) { diff --git a/pkgs/ffigen/lib/src/find_resource.dart b/pkgs/ffigen/lib/src/find_resource.dart index e9a9dae55f..7a8df1ab0b 100644 --- a/pkgs/ffigen/lib/src/find_resource.dart +++ b/pkgs/ffigen/lib/src/find_resource.dart @@ -2,7 +2,95 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -library find_resource; +import 'dart:convert' show jsonDecode; +import 'dart:io' show File, Directory; -export 'find_resource/find_resource_fallback.dart' - if (dart.library.cli) 'find_resource/find_resource_cli.dart'; +import 'package:logging/logging.dart'; +import 'package:yaml/yaml.dart'; + +final _logger = Logger('ffigen.find_resource'); + +/// Find the `.dart_tool/` folder, returns `null` if unable to find it. +Uri findDotDartTool() { + // HACK: Because 'dart:isolate' is unavailable in Flutter we have no means + // by which we can find the location of the package_config.json file. + // Which we need, because the binary library created by: + // flutter pub run ffigen:setup + // is located relative to this path. As a workaround we use + // `Platform.script` and traverse level-up until we find a + // `.dart_tool/package_config.json` file. + // Find script directory + var root = Directory.current.uri; + // Traverse up until we see a `.dart_tool/package_config.json` file. + do { + if (File.fromUri(root.resolve('.dart_tool/package_config.json')) + .existsSync()) { + return root.resolve('.dart_tool/'); + } + } while (root != (root = root.resolve('..'))); + return null; +} + +/// Get [Uri] for [posixPath] inside ffigen's rootUri. +Uri _findInPackageRoot(String posixPath) { + var root = Directory.current.uri; + // Traverse up until we see a `.dart_tool/package_config.json` file. + do { + final file = File.fromUri(root.resolve('.dart_tool/package_config.json')); + if (file.existsSync()) { + /// Read the package_config.json file to extract path of wrapper. + try { + final packageMap = + jsonDecode(file.readAsStringSync()) as Map; + if (packageMap['configVersion'] == 2) { + var ffigenRootUriString = ((packageMap['packages'] as List) + .cast>() + .firstWhere( + (element) => element['name'] == 'ffigen')['rootUri'] + as String); + ffigenRootUriString = ffigenRootUriString.endsWith('/') + ? ffigenRootUriString + : ffigenRootUriString + '/'; + + /// [ffigenRootUri] can be relative to .dart_tool if its from + /// filesystem so we need to resolve it from .dart_tool first. + return file.parent.uri + .resolve(ffigenRootUriString) + .resolve(posixPath); + } + } catch (e, s) { + print(s); + throw Exception('Cannot resolve package:ffigen\'s rootUri.'); + } + } + } while (root != (root = root.resolve('..'))); + return null; +} + +Uri findWrapper(String wrapperName) { + return _findInPackageRoot('lib/src/clang_library/$wrapperName'); +} + +Uri _findFfigenPubspecYaml() { + return _findInPackageRoot('pubspec.yaml'); +} + +String _ffigenVersion; + +/// Gets ffigen version from ffigen's pubspec.yaml +String get ffigenVersion { + if (_ffigenVersion == null) { + try { + final yaml = + loadYaml(File.fromUri(_findFfigenPubspecYaml()).readAsStringSync()) + as YamlMap; + final rawVersion = yaml['version'] as String; + // Sanitize name to be used as a file name. + _ffigenVersion = + 'v_${rawVersion.replaceAll('.', '_').replaceAll('+', '_')}'; + } catch (e) { + _logger.severe('Unable to extract ffigen version.'); + } + } + return _ffigenVersion; +} diff --git a/pkgs/ffigen/lib/src/find_resource/find_resource_cli.dart b/pkgs/ffigen/lib/src/find_resource/find_resource_cli.dart deleted file mode 100644 index d3885b5f08..0000000000 --- a/pkgs/ffigen/lib/src/find_resource/find_resource_cli.dart +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'dart:cli' as cli; -import 'dart:io' show File; -import 'dart:isolate' show Isolate; -import 'find_resource_fallback.dart' as fallback; - -/// Find the `.dart_tool/` folder, returns `null` if unable to find it. -Uri findDotDartTool() { - // Find [Isolate.packageConfig] and check if contains: - // * `package_config.json`, or, - // * `.dart_tool/package_config.json`. - // If either is the case we know the path to `.dart_tool/`. - final packageConfig = cli.waitFor(Isolate.packageConfig); - if (packageConfig != null && - File.fromUri(packageConfig.resolve('package_config.json')).existsSync()) { - return packageConfig.resolve('./'); - } - if (packageConfig != null && - File.fromUri(packageConfig.resolve('.dart_tool/package_config.json')) - .existsSync()) { - return packageConfig.resolve('.dart_tool/'); - } - // If [Isolate.packageConfig] isn't helpful we fallback to looking at the - // current script location and traverse up from there. - return fallback.findDotDartTool(); -} - -Uri findWrapper(String wrapperName) { - final wrapperUri = cli.waitFor(Isolate.resolvePackageUri( - Uri.parse('package:ffigen/src/clang_library/$wrapperName'))); - // If [Isolate.packageConfig] isn't helpful we fallback to looking at the - // current script location and traverse up from there. - return wrapperUri ?? fallback.findWrapper(wrapperName); -} diff --git a/pkgs/ffigen/lib/src/find_resource/find_resource_fallback.dart b/pkgs/ffigen/lib/src/find_resource/find_resource_fallback.dart deleted file mode 100644 index 0db61eeff0..0000000000 --- a/pkgs/ffigen/lib/src/find_resource/find_resource_fallback.dart +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'dart:convert' show jsonDecode; -import 'dart:io' show File, Directory; - -/// Find the `.dart_tool/` folder, returns `null` if unable to find it. -Uri findDotDartTool() { - // HACK: Because 'dart:isolate' is unavailable in Flutter we have no means - // by which we can find the location of the package_config.json file. - // Which we need, because the binary library created by: - // flutter pub run ffigen:setup - // is located relative to this path. As a workaround we use - // `Platform.script` and traverse level-up until we find a - // `.dart_tool/package_config.json` file. - // Find script directory - var root = Directory.current.uri; - // Traverse up until we see a `.dart_tool/package_config.json` file. - do { - if (File.fromUri(root.resolve('.dart_tool/package_config.json')) - .existsSync()) { - return root.resolve('.dart_tool/'); - } - } while (root != (root = root.resolve('..'))); - return null; -} - -Uri findWrapper(String wrapperName) { - var root = Directory.current.uri; - // Traverse up until we see a `.dart_tool/package_config.json` file. - do { - final file = File.fromUri(root.resolve('.dart_tool/package_config.json')); - if (file.existsSync()) { - /// Read the package_config.json file to extract path of wrapper. - try { - final packageMap = - jsonDecode(file.readAsStringSync()) as Map; - if (packageMap['configVersion'] == 2) { - var ffigenRootUriString = ((packageMap['packages'] as List) - .cast>() - .firstWhere( - (element) => element['name'] == 'ffigen')['rootUri'] - as String); - ffigenRootUriString = ffigenRootUriString.endsWith('/') - ? ffigenRootUriString - : ffigenRootUriString + '/'; - - /// [ffigenRootUri] can be relative to .dart_tool if its from - /// filesystem so we need to resolve it from .dart_tool first. - return file.parent.uri - .resolve(ffigenRootUriString) - .resolve('lib/src/clang_library/$wrapperName'); - } - } catch (e, s) { - print(s); - throw Exception('Cannot resolve package:ffigen\'s rootUri.'); - } - } - } while (root != (root = root.resolve('..'))); - return null; -} diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index c5698b0fd3..4036a4c74b 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -42,7 +42,7 @@ Library parse(Config c) { // BELOW FUNCTIONS ARE MEANT FOR INTERNAL USE AND TESTING // =================================================================================== -var _logger = Logger('ffigen.header_parser.parser'); +final _logger = Logger('ffigen.header_parser.parser'); /// Initializes parser, clears any previous values. void initParser(Config c) { diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index 50248a68e4..49e4b1af9d 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -14,7 +14,7 @@ import '../data.dart'; import '../includer.dart'; import '../utils.dart'; -var _logger = Logger('ffigen.header_parser.enumdecl_parser'); +final _logger = Logger('ffigen.header_parser.enumdecl_parser'); /// Holds temporary information regarding [EnumClass] while parsing. class _ParsedEnum { @@ -89,7 +89,7 @@ int _enumCursorVisitor(Pointer cursor, _addEnumConstantToEnumClass(cursor); break; default: - print('invalid enum constant'); + _logger.fine('invalid enum constant'); } cursor.dispose(); parent.dispose(); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index 78d52b4cee..3be5c1ed98 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -13,7 +13,7 @@ import '../data.dart' show clang; import '../includer.dart'; import '../utils.dart'; -var _logger = Logger('ffigen.header_parser.functiondecl_parser'); +final _logger = Logger('ffigen.header_parser.functiondecl_parser'); /// Holds temporary information regarding [Func] while parsing. class _ParserFunc { diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart index ad9df5664c..8884dd54e0 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart @@ -16,7 +16,7 @@ import '../clang_bindings/clang_bindings.dart' as clang_types; import '../data.dart'; import '../utils.dart'; -var _logger = Logger('ffigen.header_parser.macro_parser'); +final _logger = Logger('ffigen.header_parser.macro_parser'); /// Adds a macro definition to be parsed later. void saveMacroDefinition(Pointer cursor) { diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index 44ece8d4eb..9b19d54492 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -12,7 +12,7 @@ import '../data.dart'; import '../includer.dart'; import '../utils.dart'; -var _logger = Logger('ffigen.header_parser.structdecl_parser'); +final _logger = Logger('ffigen.header_parser.structdecl_parser'); /// Holds temporary information regarding [struc] while parsing. class _ParsedStruc { diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart index 558fce335e..3801dded87 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart @@ -13,7 +13,7 @@ import '../sub_parsers/enumdecl_parser.dart'; import '../sub_parsers/structdecl_parser.dart'; import '../utils.dart'; -var _logger = Logger('ffigen.header_parser.typedefdecl_parser'); +final _logger = Logger('ffigen.header_parser.typedefdecl_parser'); /// Holds temporary information regarding a typedef referenced [Binding] /// while parsing. diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart index 713fae08c7..729f791d1d 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart @@ -12,7 +12,7 @@ import '../clang_bindings/clang_bindings.dart' as clang_types; import '../data.dart'; import '../utils.dart'; -var _logger = Logger('ffigen.header_parser.unnamed_enumdecl_parser'); +final _logger = Logger('ffigen.header_parser.unnamed_enumdecl_parser'); /// Saves unnamed enums. void saveUnNamedEnum(Pointer cursor) { diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart index f576faecc9..5ca8997d53 100644 --- a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -17,7 +17,7 @@ import 'sub_parsers/structdecl_parser.dart'; import 'sub_parsers/typedefdecl_parser.dart'; import 'utils.dart'; -var _logger = Logger('ffigen.header_parser.translation_unit_parser'); +final _logger = Logger('ffigen.header_parser.translation_unit_parser'); Set _bindings; diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index a198420cfe..0e6ec0f200 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -15,7 +15,7 @@ import '../translation_unit_parser.dart'; import '../type_extractor/cxtypekindmap.dart'; import '../utils.dart'; -var _logger = Logger('ffigen.header_parser.extractor'); +final _logger = Logger('ffigen.header_parser.extractor'); const _padding = ' '; /// Converts cxtype to a typestring code_generator can accept. diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 9337fa1caf..53bd07f075 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -3,11 +3,11 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:io'; +import 'package:ffigen/src/find_resource.dart'; import 'package:ffigen/src/header_parser/clang_bindings/clang_bindings.dart' as clang; -// This version must be updated whenever we update the libclang wrapper. -const dylibVersion = 'v4'; +String get dylibVersion => ffigenVersion; /// Name of the dynamic library file according to current platform. String get dylibFileName { diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 1db827c2af..57443c8b60 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 0.2.3+2 +version: 0.2.3+3 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C/C++ header files. From eb3cae2327beea1a8043cb93d66dce31faa45f7d Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 24 Aug 2020 20:17:13 +0530 Subject: [PATCH 038/276] [ffigen] Added support for c99 bool (#86) * Bool datatype is now mapped to Uint8, Added test in native_test * Added dart-bool to config, bools in function parameters and return type now use dart bool instead of int by default --- pkgs/ffigen/CHANGELOG.md | 4 + pkgs/ffigen/README.md | 12 ++ pkgs/ffigen/lib/src/code_generator/func.dart | 28 ++- .../lib/src/code_generator/library.dart | 16 +- pkgs/ffigen/lib/src/code_generator/type.dart | 13 +- .../ffigen/lib/src/code_generator/writer.dart | 6 +- .../lib/src/config_provider/config.dart | 11 ++ pkgs/ffigen/lib/src/header_parser/parser.dart | 1 + .../type_extractor/extractor.dart | 2 + pkgs/ffigen/lib/src/strings.dart | 1 + pkgs/ffigen/pubspec.yaml | 4 +- pkgs/ffigen/test/code_generator_test.dart | 162 ++++++++++++++++++ pkgs/ffigen/test/native_test/config.yaml | 3 + pkgs/ffigen/test/native_test/native_test.c | 3 + pkgs/ffigen/test/native_test/native_test.dart | 4 + .../native_test/native_test_bindings.dart | 21 +++ 16 files changed, 276 insertions(+), 15 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 6dfc92d601..38fcaa2432 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.2.4 +- Added support for C booleans as Uint8. +- Added config `dart-bool` (default: true) to use dart bool instead of int in function parameters and return type. + # 0.2.3+3 - Wrapper dynamic library version now uses ffigen version from its pubspec.yaml file. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 6896b87383..7fa1a1bf6a 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -174,6 +174,13 @@ comments:
use-supported-typedefs: true
+ + dart-bool + Should generate dart `bool` for c99 bool in functions.
+ Default: true + +
dart-bool: true
+ unnamed-enums Should generate constants for anonymous unnamed enums.
@@ -355,3 +362,8 @@ Note: exclude overrides include. Ffigen treats `char*` just as any other pointer,(`Pointer`). To convert these to/from `String`, you can use [package:ffi](https://pub.dev/packages/ffi) and use `Utf8.fromUtf8(ptr.cast())` to convert `char*` to dart `string`. +### How does ffigen handle C99 bool data type? + +Although `dart:ffi` doesn't have a NativeType for `bool`, they can be implemented as `Uint8`. +Ffigen generates dart `bool` for function parameters and return type by default. +To disable this, and use `int` instead, set `dart-bool: false` in configurations. diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index c1f444b9f4..6498ff7d14 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -114,9 +114,19 @@ class Func extends LookUpBinding { p.name = paramNamer.makeUnique(p.name); } // Write enclosing function. - s.write('${returnType.getDartType(w)} $enclosingFuncName(\n'); + if (w.dartBool && returnType.broadType == BroadType.Boolean) { + // Use bool return type in enclosing function. + s.write('bool $enclosingFuncName(\n'); + } else { + s.write('${returnType.getDartType(w)} $enclosingFuncName(\n'); + } for (final p in parameters) { - s.write(' ${p.type.getDartType(w)} ${p.name},\n'); + if (w.dartBool && p.type.broadType == BroadType.Boolean) { + // Use bool parameter type in enclosing function. + s.write(' bool ${p.name},\n'); + } else { + s.write(' ${p.type.getDartType(w)} ${p.name},\n'); + } } s.write(') {\n'); s.write( @@ -124,9 +134,19 @@ class Func extends LookUpBinding { s.write(' return $funcVarName(\n'); for (final p in parameters) { - s.write(' ${p.name},\n'); + if (w.dartBool && p.type.broadType == BroadType.Boolean) { + // Convert bool parameter to int before calling. + s.write(' ${p.name}?1:0,\n'); + } else { + s.write(' ${p.name},\n'); + } + } + if (w.dartBool && returnType.broadType == BroadType.Boolean) { + // Convert int return type to bool. + s.write(' )!=0;\n'); + } else { + s.write(' );\n'); } - s.write(' );\n'); s.write('}\n'); // Write function variable. diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index 2daa009b8e..978105e4d6 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -27,6 +27,7 @@ class Library { String description, @required this.bindings, String header, + bool dartBool = true, }) { // Seperate bindings which require lookup. final lookUpBindings = bindings.whereType().toList(); @@ -35,15 +36,15 @@ class Library { /// Handle any declaration-declaration name conflict in [lookUpBindings]. final lookUpDeclConflictHandler = UniqueNamer({}); for (final b in lookUpBindings) { - _warnPrivateDeclaration(b); - _resolveNameConflict(lookUpDeclConflictHandler, b); + _warnIfPrivateDeclaration(b); + _resolveIfNameConflicts(lookUpDeclConflictHandler, b); } /// Handle any declaration-declaration name conflict in [noLookUpBindings]. final noLookUpDeclConflictHandler = UniqueNamer({}); for (final b in noLookUpBindings) { - _warnPrivateDeclaration(b); - _resolveNameConflict(noLookUpDeclConflictHandler, b); + _warnIfPrivateDeclaration(b); + _resolveIfNameConflicts(noLookUpDeclConflictHandler, b); } _writer = Writer( @@ -52,19 +53,20 @@ class Library { className: name, classDocComment: description, header: header, + dartBool: dartBool, ); } /// Logs a warning if generated declaration will be private. - void _warnPrivateDeclaration(Binding b) { + void _warnIfPrivateDeclaration(Binding b) { if (b.name.startsWith('_')) { _logger.warning( "Generated declaration '${b.name}' start's with '_' and therefore will be private."); } } - /// LResolves name conflict(if any) and logs a warning. - void _resolveNameConflict(UniqueNamer namer, Binding b) { + /// Resolves name conflict(if any) and logs a warning. + void _resolveIfNameConflicts(UniqueNamer namer, Binding b) { // Print warning if name was conflicting and has been changed. if (namer.isUsed(b.name)) { final oldName = b.name; diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index 694bacf0ba..9ccc2b1a89 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -33,6 +33,7 @@ enum SupportedNativeType { /// The basic types in which all types can be broadly classified into. enum BroadType { + Boolean, NativeType, Pointer, Struct, @@ -120,6 +121,11 @@ class Type { child: elementType, ); } + factory Type.boolean() { + return Type._( + broadType: BroadType.Boolean, + ); + } factory Type.unimplemented(String reason) { return Type._( broadType: BroadType.Unimplemented, unimplementedReason: reason); @@ -149,7 +155,8 @@ class Type { } } - bool get isPrimitive => broadType == BroadType.NativeType; + bool get isPrimitive => + (broadType == BroadType.NativeType || broadType == BroadType.Boolean); String getCType(Writer w) { switch (broadType) { @@ -167,6 +174,8 @@ class Type { case BroadType .ConstantArray: // Array parameters are treated as Pointers in C. return '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; + case BroadType.Boolean: // Booleans are treated as uint8. + return '${w.ffiLibraryPrefix}.${_primitives[SupportedNativeType.Uint8].c}'; default: throw Exception('cType unknown'); } @@ -188,6 +197,8 @@ class Type { case BroadType .ConstantArray: // Array parameters are treated as Pointers in C. return '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; + case BroadType.Boolean: // Booleans are treated as uint8. + return _primitives[SupportedNativeType.Uint8].dart; default: throw Exception('dart type unknown for ${broadType.toString()}'); } diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index 41be178162..0a02ed0701 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -27,6 +27,8 @@ class Writer { String _dylibIdentifier; String get dylibIdentifier => _dylibIdentifier; + final bool dartBool; + /// Initial namers set after running constructor. Namers are reset to this /// initial state everytime [generate] is called. UniqueNamer _initialTopLevelUniqueNamer, _initialWrapperLevelUniqueNamer; @@ -47,9 +49,11 @@ class Writer { @required this.lookUpBindings, @required this.noLookUpBindings, @required String className, + @required this.dartBool, this.classDocComment, this.header, - }) : assert(className != null) { + }) : assert(className != null), + assert(dartBool != null) { final globalLevelNameSet = noLookUpBindings.map((e) => e.name).toSet(); final wrapperLevelNameSet = lookUpBindings.map((e) => e.name).toSet(); final allNameSet = {} diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 2b9df49252..55ff5709d7 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -70,6 +70,10 @@ class Config { bool get unnamedEnums => _unnamedEnums; bool _unnamedEnums; + /// If dart bool should be generated for C booleans. + bool get dartBool => _dartBool; + bool _dartBool; + /// Name of the wrapper class. String get wrapperName => _wrapperName; String _wrapperName; @@ -248,6 +252,13 @@ class Config { defaultValue: () => true, extractedResult: (dynamic result) => _unnamedEnums = result as bool, ), + strings.dartBool: Specification( + requirement: Requirement.no, + validator: booleanValidator, + extractor: booleanExtractor, + defaultValue: () => true, + extractedResult: (dynamic result) => _dartBool = result as bool, + ), strings.name: Specification( requirement: Requirement.prefer, validator: dartClassNameValidator, diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index 4036a4c74b..0cbe3c8049 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -30,6 +30,7 @@ Library parse(Config c) { name: config.wrapperName, description: config.wrapperDocComment, header: config.preamble, + dartBool: config.dartBool, ); if (config.sort) { diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 0e6ec0f200..3e74ea6605 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -73,6 +73,8 @@ Type getCodeGenType(Pointer cxtype, {String parentName}) { return Type.incompleteArray( clang.clang_getArrayElementType_wrap(cxtype).toCodeGenTypeAndDispose(), ); + case clang_types.CXTypeKind.CXType_Bool: + return Type.boolean(); default: if (cxTypeKindToSupportedNativeTypes.containsKey(kind)) { return Type.nativeType( diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 53bd07f075..0749dbeb95 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -83,6 +83,7 @@ const useSupportedTypedefs = 'use-supported-typedefs'; const warnWhenRemoving = 'warn-when-removing'; const arrayWorkaround = 'array-workaround'; const unnamedEnums = 'unnamed-enums'; +const dartBool = 'dart-bool'; const comments = 'comments'; // Sub-fields of comments diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 57443c8b60..0d52538c9d 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,9 +3,9 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 0.2.3+3 +version: 0.2.4 homepage: https://github.com/dart-lang/ffigen -description: Experimental generator for FFI bindings, using LibClang to parse C/C++ header files. +description: Experimental generator for FFI bindings, using LibClang to parse C header files. environment: sdk: '>=2.7.0 <3.0.0' diff --git a/pkgs/ffigen/test/code_generator_test.dart b/pkgs/ffigen/test/code_generator_test.dart index 7abf5df1bd..05dceb1a27 100644 --- a/pkgs/ffigen/test/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_test.dart @@ -758,4 +758,166 @@ typedef _dart_Test = void Function( } }); }); + test('boolean_dartBool', () { + final library = Library( + name: 'Bindings', + dartBool: true, + bindings: [ + Func( + name: 'test1', + returnType: Type.boolean(), + parameters: [ + Parameter(name: 'a', type: Type.boolean()), + Parameter(name: 'b', type: Type.pointer(Type.boolean())), + ], + ), + Struc( + name: 'test2', + members: [ + Member(name: 'a', type: Type.boolean()), + ], + ), + ], + ); + + final gen = library.generate(); + + // Writing to file for debug purpose. + final file = File( + 'test/debug_generated/boolean-dartbool-output.dart', + ); + try { + expect(gen, '''// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +class Bindings{ +/// Holds the Dynamic library. +final ffi.DynamicLibrary _dylib; + +/// The symbols are looked up in [dynamicLibrary]. +Bindings(ffi.DynamicLibrary dynamicLibrary): _dylib = dynamicLibrary; + +bool test1( + bool a, + ffi.Pointer b, +) { +_test1 ??= _dylib.lookupFunction<_c_test1,_dart_test1>('test1'); + return _test1( + a?1:0, + b, + )!=0; +} +_dart_test1 _test1; + +} + +class test2 extends ffi.Struct{ + @ffi.Uint8() + int a; + +} + +typedef _c_test1 = ffi.Uint8 Function( + ffi.Uint8 a, + ffi.Pointer b, +); + +typedef _dart_test1 = int Function( + int a, + ffi.Pointer b, +); + +'''); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + file.writeAsStringSync(gen); + print('Failed test, Debug output: ${file.absolute?.path}'); + rethrow; + } + }); + test('boolean_no_dartBool', () { + final library = Library( + name: 'Bindings', + dartBool: false, + bindings: [ + Func( + name: 'test1', + returnType: Type.boolean(), + parameters: [ + Parameter(name: 'a', type: Type.boolean()), + Parameter(name: 'b', type: Type.pointer(Type.boolean())), + ], + ), + Struc( + name: 'test2', + members: [ + Member(name: 'a', type: Type.boolean()), + ], + ), + ], + ); + + final gen = library.generate(); + + // Writing to file for debug purpose. + final file = File( + 'test/debug_generated/boolean-no-dartBool-output.dart', + ); + try { + expect(gen, '''// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +class Bindings{ +/// Holds the Dynamic library. +final ffi.DynamicLibrary _dylib; + +/// The symbols are looked up in [dynamicLibrary]. +Bindings(ffi.DynamicLibrary dynamicLibrary): _dylib = dynamicLibrary; + +int test1( + int a, + ffi.Pointer b, +) { +_test1 ??= _dylib.lookupFunction<_c_test1,_dart_test1>('test1'); + return _test1( + a, + b, + ); +} +_dart_test1 _test1; + +} + +class test2 extends ffi.Struct{ + @ffi.Uint8() + int a; + +} + +typedef _c_test1 = ffi.Uint8 Function( + ffi.Uint8 a, + ffi.Pointer b, +); + +typedef _dart_test1 = int Function( + int a, + ffi.Pointer b, +); + +'''); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + file.writeAsStringSync(gen); + print('Failed test, Debug output: ${file.absolute?.path}'); + rethrow; + } + }); } diff --git a/pkgs/ffigen/test/native_test/config.yaml b/pkgs/ffigen/test/native_test/config.yaml index a81d932c4e..55b0b0b53a 100644 --- a/pkgs/ffigen/test/native_test/config.yaml +++ b/pkgs/ffigen/test/native_test/config.yaml @@ -16,3 +16,6 @@ headers: include-directives: - '**native_test.c' array-workaround: true + +# Needed for stdbool.h in MacOS +compiler-opts: '-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Headers/' diff --git a/pkgs/ffigen/test/native_test/native_test.c b/pkgs/ffigen/test/native_test/native_test.c index 21c2f16f3e..57b23c0238 100644 --- a/pkgs/ffigen/test/native_test/native_test.c +++ b/pkgs/ffigen/test/native_test/native_test.c @@ -5,6 +5,9 @@ #include #include +#include + +bool Function1Bool(bool x) { return !x; } uint8_t Function1Uint8(uint8_t x) { return x + 42; } diff --git a/pkgs/ffigen/test/native_test/native_test.dart b/pkgs/ffigen/test/native_test/native_test.dart index 63d1824cc3..baa1bacb6f 100644 --- a/pkgs/ffigen/test/native_test/native_test.dart +++ b/pkgs/ffigen/test/native_test/native_test.dart @@ -50,6 +50,10 @@ void main() { rethrow; } }); + test('bool', () { + expect(bindings.Function1Bool(true), false); + expect(bindings.Function1Bool(false), true); + }); test('uint8_t', () { expect(bindings.Function1Uint8(pow(2, 8).toInt()), 42); }); diff --git a/pkgs/ffigen/test/native_test/native_test_bindings.dart b/pkgs/ffigen/test/native_test/native_test_bindings.dart index 28a2bce280..c5cdd818a4 100644 --- a/pkgs/ffigen/test/native_test/native_test_bindings.dart +++ b/pkgs/ffigen/test/native_test/native_test_bindings.dart @@ -11,6 +11,19 @@ class NativeLibrary { /// The symbols are looked up in [dynamicLibrary]. NativeLibrary(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + bool Function1Bool( + bool x, + ) { + _Function1Bool ??= _dylib + .lookupFunction<_c_Function1Bool, _dart_Function1Bool>('Function1Bool'); + return _Function1Bool( + x ? 1 : 0, + ) != + 0; + } + + _dart_Function1Bool _Function1Bool; + int Function1Uint8( int x, ) { @@ -301,6 +314,14 @@ class ArrayHelper_Struct1_data_level2 { } } +typedef _c_Function1Bool = ffi.Uint8 Function( + ffi.Uint8 x, +); + +typedef _dart_Function1Bool = int Function( + int x, +); + typedef _c_Function1Uint8 = ffi.Uint8 Function( ffi.Uint8 x, ); From f760287e58291f2732a69b7abbfbd59f170c99cc Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 24 Aug 2020 22:12:55 +0530 Subject: [PATCH 039/276] [ffigen] Clarify LLVM error messages (#93) --- pkgs/ffigen/CHANGELOG.md | 3 +++ pkgs/ffigen/bin/ffigen.dart | 2 +- pkgs/ffigen/bin/setup.dart | 2 +- pkgs/ffigen/pubspec.yaml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 38fcaa2432..95e0eff5e1 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.2.4+1 +- Minor changes to dylib creation error log. + # 0.2.4 - Added support for C booleans as Uint8. - Added config `dart-bool` (default: true) to use dart bool instead of int in function parameters and return type. diff --git a/pkgs/ffigen/bin/ffigen.dart b/pkgs/ffigen/bin/ffigen.dart index d096914d88..a49040dc35 100644 --- a/pkgs/ffigen/bin/ffigen.dart +++ b/pkgs/ffigen/bin/ffigen.dart @@ -35,7 +35,7 @@ void main(List args) { /// `pub run ffigen:setup -Ipath/to/llvm/include -Lpath/to/llvm/lib`. if (!checkDylibExist() && !autoCreateDylib()) { _logger.severe('Unable to create dynamic library automatically.'); - _logger.severe('If LLVM is installed, try running:'); + _logger.severe('If LLVM (9+) is installed, try running:'); _logger.severe( ' pub run ffigen:setup -Ipath/to/llvm/include -Lpath/to/llvm/lib'); exit(1); diff --git a/pkgs/ffigen/bin/setup.dart b/pkgs/ffigen/bin/setup.dart index ef618fc7b4..4c7517d05a 100644 --- a/pkgs/ffigen/bin/setup.dart +++ b/pkgs/ffigen/bin/setup.dart @@ -100,7 +100,7 @@ bool autoCreateDylib() { final options = _getPlatformOptions(); final processResult = _runClangProcess(options); if ((processResult.stderr as String).isNotEmpty) { - print(stderr); + print(processResult.stderr); } return checkDylibExist(); } diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 0d52538c9d..ae53603af3 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 0.2.4 +version: 0.2.4+1 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C header files. From 8e287ce59c970ee7c94c5478d23e09ba089137fd Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Thu, 27 Aug 2020 16:43:43 +0530 Subject: [PATCH 040/276] [ffigen] Added support for including/excluding/renaming unnamed_enums (#96) * added support for including/excluding/renaming unnamed_enums added faq, update version, changelog, update test * fix typo --- pkgs/ffigen/CHANGELOG.md | 3 ++ pkgs/ffigen/README.md | 29 ++++++++++++++----- .../lib/src/config_provider/config.dart | 25 ++++++++-------- .../lib/src/header_parser/includer.dart | 11 +++++++ .../sub_parsers/enumdecl_parser.dart | 3 +- .../sub_parsers/unnamed_enumdecl_parser.dart | 8 +++-- pkgs/ffigen/lib/src/header_parser/utils.dart | 13 +++++++++ pkgs/ffigen/lib/src/strings.dart | 2 +- pkgs/ffigen/pubspec.yaml | 2 +- .../test/header_parser_tests/unnamed_enums.h | 2 +- .../unnamed_enums_test.dart | 9 ++---- .../ffigen/test/rename_tests/rename_test.dart | 8 +++-- 12 files changed, 78 insertions(+), 37 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 95e0eff5e1..6d143e5969 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.3.0 +- Added support for including/excluding/renaming _un-named enums_ using key `unnamed_enums`. + # 0.2.4+1 - Minor changes to dylib creation error log. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 7fa1a1bf6a..4309bfc7c2 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -112,7 +112,7 @@ headers:
compiler-opts: '-I/usr/lib/llvm-9/include/'
- functions
structs
enums
macros + functions
structs
enums
unnamed-enums
macros Filters for declarations.
Default: all are included
 functions:
@@ -180,13 +180,6 @@ comments:
     Default: true
     
     
dart-bool: true
- - - unnamed-enums - Should generate constants for anonymous unnamed enums.
- Default: true - -
unnamed-enums: true
preamble @@ -367,3 +360,23 @@ To convert these to/from `String`, you can use [package:ffi](https://pub.dev/pac Although `dart:ffi` doesn't have a NativeType for `bool`, they can be implemented as `Uint8`. Ffigen generates dart `bool` for function parameters and return type by default. To disable this, and use `int` instead, set `dart-bool: false` in configurations. + +### How are unnamed enums handled? + +Unnamed enums are handled separately, under the key `unnamed-enums`, and are generated as top level constants. + +Here's an example that shows how to include/exclude/rename unnamed enums +```yaml +unnamed-enums: + include: + - 'CX_.*' + exclude: + - '.*Flag' + rename: + 'CXType_(.*)': '$1' +``` + +### Why are some struct declarations generated even after excluded them in config? + +This happens when an excluded struct is a dependency to some included declaration. +(A dependency means a struct is being passed/returned by a function or is member of another struct in some way) diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 55ff5709d7..ad8db21c5a 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -43,7 +43,11 @@ class Config { Declaration get enumClassDecl => _enumClassDecl; Declaration _enumClassDecl; - /// Declaration config for Enums. + /// Declaration config for Unnamed enum constants. + Declaration get unnamedEnumConstants => _unnamedEnumConstants; + Declaration _unnamedEnumConstants; + + /// Declaration config for Macro constants. Declaration get macroDecl => _macroDecl; Declaration _macroDecl; @@ -66,10 +70,6 @@ class Config { bool get arrayWorkaround => _arrayWorkaround; bool _arrayWorkaround; - /// If constants should be generated for unnamed enums. - bool get unnamedEnums => _unnamedEnums; - bool _unnamedEnums; - /// If dart bool should be generated for C booleans. bool get dartBool => _dartBool; bool _dartBool; @@ -193,6 +193,14 @@ class Config { _enumClassDecl = result as Declaration; }, ), + strings.unnamedEnums: Specification( + requirement: Requirement.no, + validator: declarationConfigValidator, + extractor: declarationConfigExtractor, + defaultValue: () => Declaration(), + extractedResult: (dynamic result) => + _unnamedEnumConstants = result as Declaration, + ), strings.macros: Specification( requirement: Requirement.no, validator: declarationConfigValidator, @@ -245,13 +253,6 @@ class Config { defaultValue: () => false, extractedResult: (dynamic result) => _arrayWorkaround = result as bool, ), - strings.unnamedEnums: Specification( - requirement: Requirement.no, - validator: booleanValidator, - extractor: booleanExtractor, - defaultValue: () => true, - extractedResult: (dynamic result) => _unnamedEnums = result as bool, - ), strings.dartBool: Specification( requirement: Requirement.no, validator: booleanValidator, diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart index 5c534a7cc6..5c8775bbca 100644 --- a/pkgs/ffigen/lib/src/header_parser/includer.dart +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -40,6 +40,17 @@ bool shouldIncludeEnumClass(String usr, String name) { } } +bool shouldIncludeUnnamedEnumConstant(String usr, String name) { + if (bindingsIndex.isSeenUnnamedEnumConstant(usr) || name == '') { + return false; + } else if (config.unnamedEnumConstants == null || + config.unnamedEnumConstants.shouldInclude(name)) { + return true; + } else { + return false; + } +} + bool shouldIncludeMacro(String usr, String name) { if (bindingsIndex.isSeenMacro(usr) || name == '') { return false; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index 49e4b1af9d..06ce22553b 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -36,8 +36,7 @@ EnumClass parseEnumDeclaration( final enumName = name ?? cursor.spelling(); if (enumName == '') { // Save this unnamed enum if it is anonymous (therefore not in a typedef). - if (config.unnamedEnums && - clang.clang_Cursor_isAnonymous_wrap(cursor) != 0) { + if (clang.clang_Cursor_isAnonymous_wrap(cursor) != 0) { _logger.fine('Saving anonymous enum.'); saveUnNamedEnum(cursor); } else { diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart index 729f791d1d..4c1e244d87 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart @@ -6,6 +6,7 @@ import 'dart:ffi'; import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/header_parser/data.dart'; +import 'package:ffigen/src/header_parser/includer.dart'; import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang_types; @@ -37,7 +38,9 @@ int _unnamedenumCursorVisitor(Pointer cursor, .finest(' unnamedenumCursorVisitor: ${cursor.completeStringRepr()}'); switch (clang.clang_getCursorKind_wrap(cursor)) { case clang_types.CXCursorKind.CXCursor_EnumConstantDecl: - _addUnNamedEnumConstant(cursor); + if (shouldIncludeUnnamedEnumConstant(cursor.usr(), cursor.spelling())) { + _addUnNamedEnumConstant(cursor); + } break; default: _logger.severe('Invalid enum constant.'); @@ -58,8 +61,7 @@ void _addUnNamedEnumConstant(Pointer cursor) { Constant( usr: cursor.usr(), originalName: cursor.spelling(), - name: config.enumClassDecl.renameMemberUsingConfig( - '', // Un-named enum constants have an empty declaration name. + name: config.unnamedEnumConstants.renameUsingConfig( cursor.spelling(), ), rawType: 'int', diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index d578b00287..171113d45a 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -340,6 +340,7 @@ class BindingsIndex { final Map _structs = {}; final Map _functions = {}; final Map _enumClass = {}; + final Map _unnamedEnumConstants = {}; final Map _macros = {}; // Stores only named typedefC used in NativeFunc. final Map _functionTypedefs = {}; @@ -380,6 +381,18 @@ class BindingsIndex { return _enumClass[usr]; } + bool isSeenUnnamedEnumConstant(String usr) { + return _unnamedEnumConstants.containsKey(usr); + } + + void addUnnamedEnumConstantToSeen(String usr, Constant enumConstant) { + _unnamedEnumConstants[usr] = enumConstant; + } + + Constant getSeenUnnamedEnumConstant(String usr) { + return _unnamedEnumConstants[usr]; + } + bool isSeenMacro(String usr) { return _macros.containsKey(usr); } diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 0749dbeb95..2cd2697c61 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -40,6 +40,7 @@ const compilerOpts = 'compiler-opts'; const functions = 'functions'; const structs = 'structs'; const enums = 'enums'; +const unnamedEnums = 'unnamed-enums'; const macros = 'macros'; // Sub-fields of Declarations. @@ -82,7 +83,6 @@ const sort = 'sort'; const useSupportedTypedefs = 'use-supported-typedefs'; const warnWhenRemoving = 'warn-when-removing'; const arrayWorkaround = 'array-workaround'; -const unnamedEnums = 'unnamed-enums'; const dartBool = 'dart-bool'; const comments = 'comments'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index ae53603af3..7aa11336c3 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 0.2.4+1 +version: 0.3.0 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/header_parser_tests/unnamed_enums.h b/pkgs/ffigen/test/header_parser_tests/unnamed_enums.h index ecb4a85153..8b6455512d 100644 --- a/pkgs/ffigen/test/header_parser_tests/unnamed_enums.h +++ b/pkgs/ffigen/test/header_parser_tests/unnamed_enums.h @@ -1,7 +1,7 @@ // Only this should be parsed. enum{ A=1, - B=2, + B=2, // This will be excluded by config. C=3 }; diff --git a/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart b/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart index 99456f309a..fa753929e3 100644 --- a/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart @@ -29,6 +29,9 @@ ${strings.headers}: ${strings.enums}: ${strings.exclude}: - Named +${strings.unnamedEnums}: + ${strings.exclude}: + - B ''') as yaml.YamlMap), ); }); @@ -39,7 +42,6 @@ ${strings.enums}: test('Parse unnamed enum Values', () { expect(actual.getBindingAsString('A'), expected.getBindingAsString('A')); - expect(actual.getBindingAsString('B'), expected.getBindingAsString('B')); expect(actual.getBindingAsString('C'), expected.getBindingAsString('C')); }); @@ -63,11 +65,6 @@ Library expectedLibrary() { rawType: 'int', rawValue: '1', ), - Constant( - name: 'B', - rawType: 'int', - rawValue: '2', - ), Constant( name: 'C', rawType: 'int', diff --git a/pkgs/ffigen/test/rename_tests/rename_test.dart b/pkgs/ffigen/test/rename_tests/rename_test.dart index c3425cc596..962e545b3b 100644 --- a/pkgs/ffigen/test/rename_tests/rename_test.dart +++ b/pkgs/ffigen/test/rename_tests/rename_test.dart @@ -63,9 +63,11 @@ enums: 'MemberRenameEnum4': '_(.*)': '\$1' 'fullMatch': 'fullMatchSuccess' - '': - '_(.*)': '\$1' - 'unnamedFullMatch': 'unnamedFullMatchSuccess' + +unnamed-enums: + ${strings.rename}: + '_(.*)': '\$1' + 'unnamedFullMatch': 'unnamedFullMatchSuccess' macros: ${strings.rename}: From 4a17f0dee863562313321c695a3b6c4e18eda8ce Mon Sep 17 00:00:00 2001 From: Michael Thomsen Date: Thu, 27 Aug 2020 14:54:36 +0200 Subject: [PATCH 041/276] [ffigen] Update README.md (#97) --- pkgs/ffigen/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 4309bfc7c2..20ff335673 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -36,7 +36,7 @@ typedef _c_sum = ffi.Int32 Function(Int32 a, Int32 b); typedef _dart_sum = int Function(int a,int b); ``` ## Using this package -- Add this package as dev_dependency in your `pubspec.yaml`. +- Add `ffigen` under `dev_dependencies` in your `pubspec.yaml`. - Setup for use (see [Setup](#Setup)). - Configurations must be provided in `pubspec.yaml` or in a custom YAML file (see [configurations](#configurations)). - Run the tool- `pub run ffigen`. From 74a89af371dcd1c80ceb036a1703a0f0193daddf Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 31 Aug 2020 17:07:01 +0530 Subject: [PATCH 042/276] [ffigen] Update lib/src/README.md (#100) --- pkgs/ffigen/lib/src/README.md | 101 +++++++++++++++++++++------------- 1 file changed, 63 insertions(+), 38 deletions(-) diff --git a/pkgs/ffigen/lib/src/README.md b/pkgs/ffigen/lib/src/README.md index d999223924..900c9f7f72 100644 --- a/pkgs/ffigen/lib/src/README.md +++ b/pkgs/ffigen/lib/src/README.md @@ -1,41 +1,66 @@ -## Project Structure +# **_package:ffigen_**: Internal Working +## Table of Contents - +1. [Overview](#overview) +2. [LibClang](#LibClang) + 1. [The Wrapper library](#The-Wrapper-library) + 2. [Generation and Usage](#Generation-and-Usage) + 3. [Bindings](#Bindings) +3. [Scripts](#scripts) + 1. [ffigen.dart](#ffigen.dart) + 2. [setup.dart](#setup.dart) +4. [Components](#components) + 1. [Config Provider](#Config-Provider) + 2. [Header Parser](#Header-Parser) + 3. [Code Generator](#Code-Generator) +# Overview +`package:ffigen` simplifies the process of generating `dart:ffi` bindings from C header files. It is simple to use, with the input being a small YAML config file. It requires LLVM (9+) to work. This document tries to give a complete overview of every component without going into too many details about every single class/file. +# LibClang +`package:ffigen` binds to LibClang using `dart:ffi` for parsing C header files. A wrapper library must be generated to use it, as `dart:ffi` currently [doesn't support structs by value](https://github.com/dart-lang/ffigen/issues/3). +## The Wrapper library +> Note: The wrapper is only needed because `dart:ffi` currently doesn't support Structs by value. -- `bin` - Contains ffigen.dart script which end user will execute. -- `tool` - Contains script to generate LibClang bindings using Code_Generator submodule (dev use only). -- `example` - Example projects which demonstrate generation of bindings for given C header files. -- `lib/src/code_generator` - Generates binding files. -- `lib/src/config_provider` - Holds configurations to be passed to other modules. -- `lib/src/header_parser` - Parses header files, utilises clang_bindings. +The `wrapper.c` file consists of functions that wrap LibClang functions. Most of them simply convert structs by value to pointers. Except - +- `clang_visitChildren_wrap` - The bindings for this function internally uses a **list** of **stack** for maintaining the supplied visitor functions. This is required because this function takes a function pointer which itself passes a struct by value. All this effort makes `clang_visitChildren_wrap` behave exactly like `clang_visitChildren`. +## Generation and Usage +The files needed for generating the wrapper are in `lib/src/clang_library`. +> The `wrapper.def` file is only needed on windows because the symbols are otherwise hidden. -## Basic Workflow -1. The User provides the location all the header files (as a list of globs or filepaths), -For each header file, we create a translation unit and parse the `declarations` in it -to the bindings. -2. User can provide `header filters` to select which declaration from a particular header file should be added to the generated bindings. The can provide a list of header 'names' to include/exclude. -We compare the header file name (not the exact path) to decide. -The default behaviour is to include everything that's included when parsing a header. -3. Use can provide Compiler options, which are passed to clang compiler as it is. -4. All bindings are generated in a single file. +The libclang wrapper can be _manually_ generated using `pub run ffigen:setup`. See [setup.dart](#setup.dart) for details. -# Code Details -## Modules -We are using libclang to parse header files. -This project is roughly divided in 3 major modules - -### code_generator -Converts a library(all bindings) to an actual string representation. -- Library (output of the header parser). -- Writer (provides configurations for generating bindings). -- Binding (base class for all bindings - Func, Struc, Global, EnumClass, etc). -### config_provider -This takes care of validating user config files, printing config warnings and errors, -converting config.yaml to a format the header_parser can use. -- Spec (represents a single config, which a user can provide in the config file). -- Config (holds all the config which will be required by header parser). -### header_parser -Uses libclang to convert the header to a Library which is then used by code_generator. -- clang_bindings (bindings to libclang which are used for parsing). -- sub_parsers (each sub-parser parses a particular kind of declaration - struct, function, typedef, enum). -- type_extractor (extracts types from variables, function parameters, return types). -- includer (tells what should/shouldn't be included depending of config). -- parser (Main Entrypoint) (creates translation units for all header files, and sets up parsing them). -- translation_unit_parser (parses header files, splits declarations and feeds them to their respective sub_parsers). +The generated file is placed in the project's `.dart_tool/ffigen` folder, the file name also specifies the ffigen version (E.g - `_v0_2_4_libclang_wrapper.dylib`), this helps ensure the correct wrapper is being used for its corresponding version. + +This dynamic library is then used by [Header Parser](#header-parser) for parsing C files. +## Bindings +The config file for generating bindings is `tool/libclang_config.yaml`. The bindings are generated to `lib/src/header_parser/clang_bindings/clang_bindings.dart`. These are used by [Header Parser](#header-parser) for calling libclang functions. +# Scripts +## ffigen.dart +This is the main entry point for the user- `pub run ffigen`. +- Command-line options: + - `--verbose`: Sets log level. + - `--config`: Specifies a config file. +- `ffigen.dart` will first check if a dynamic library already exists and is up to date. If not, it tries to auto-create it. If that fails, user must excplicitly call [setup.dart](#setup.dart). +- The internal modules are called by `ffigen.dart` in the following way: + - It first creates a `Config` object from an input Yaml file. This is used by other modules. + - The `parse` method is then invoked to generate a `Library` object. + - Finally, the code is generated from the `Library` object to the specified file. +## setup.dart +Used to generate the wrapper dynamic library. Users will need to explicitly call this if `pub run ffigen` is unable to auto-create the dynamic library. +> `clang` must be on user's path for `setup.dart` to work. + +- Command-line options: + - `-I`: Specifies header includes. + - `-L`: Specifies library includes. +- `setup.dart` generates the dynamic library to the project's `.dart_tool/ffigen` folder using `clang`. +# Components +## Config Provider +The Config Provider holds all the configurations required by other modules. +- Config Provider handles validation and extraction of configurations from YAML files. +- Config Provider converts configurations to the format required by other modules. This object is passed around to every other module. +## Header Parser +The Header Parser parses C header files and converts them into a `Library` object. +- Header Parser handles including/excluding/renaming of declarations. +- Header Parser also filters out any _unimplemented_ or _unsupported_ declarations before generating a `Library` object. +## Code Generator +The Code Generator generates the actual string bindings. +- Code generator handles all external name collisions, while internal name conflicts are handled by each specific `Binding`. +- Code Generator also handles how workarounds for arrays and bools are generated. From ad5610438ec48be8da214681ea1758f6d14fa8c5 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 31 Aug 2020 17:07:22 +0530 Subject: [PATCH 043/276] [ffigen] Bump version to 1.0.0, minor fixes (#101) --- pkgs/ffigen/CHANGELOG.md | 5 +++++ .../header_parser/type_extractor/extractor.dart | 2 +- pkgs/ffigen/lib/src/header_parser/utils.dart | 4 ++-- pkgs/ffigen/pubspec.yaml | 2 +- .../test/header_parser_tests/native_func_typedef.h | 3 +++ .../native_func_typedef_test.dart | 8 +++++++- pkgs/ffigen/test/header_parser_tests/typedef.h | 7 ++----- .../test/header_parser_tests/typedef_test.dart | 14 ++++++++++++-- .../test/large_integration_tests/large_test.dart | 2 ++ 9 files changed, 35 insertions(+), 12 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 6d143e5969..c04cf391e0 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,8 @@ +# 1.0.0 +- Bump version to 1.0.0. +- Handle unimplememnted function pointers causing errors. +- Log lexical/semantic issues in headers as SEVERE. + # 0.3.0 - Added support for including/excluding/renaming _un-named enums_ using key `unnamed_enums`. diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 3e74ea6605..f2ec345e71 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -143,7 +143,7 @@ Type _extractFromFunctionProto( if (pt.broadType == BroadType.Struct) { return Type.unimplemented('Struct by value in function parameter.'); - } else if (pt.broadType == BroadType.Unimplemented) { + } else if (pt.getBaseType().broadType == BroadType.Unimplemented) { return Type.unimplemented('Function parameter has an unsupported type.'); } diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index 171113d45a..df41d6fa8f 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -34,7 +34,7 @@ void logTuDiagnostics( return; } - logger.warning('Header $header: Total errors/warnings: $total.'); + logger.severe('Header $header: Total errors/warnings: $total.'); for (var i = 0; i < total; i++) { final diag = clang.clang_getDiagnostic(tu, i); final cxstring = clang.clang_formatDiagnostic_wrap( @@ -45,7 +45,7 @@ void logTuDiagnostics( clang_types .CXDiagnosticDisplayOptions.CXDiagnostic_DisplayCategoryName, ); - logger.warning(' ' + cxstring.toStringAndDispose()); + logger.severe(' ' + cxstring.toStringAndDispose()); clang.clang_disposeDiagnostic(diag); } } diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 7aa11336c3..36302e6299 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 0.3.0 +version: 1.0.0 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h b/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h index 38551e991c..f799b9dce1 100644 --- a/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h +++ b/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h @@ -8,3 +8,6 @@ struct struc }; void func(void (*unnamed1)(void (*unnamed2)())); + +// This will be removed because 'long double' is unsupported. +void funcNestedUnimplemented(void (*unnamed1)(void (*unnamed2)(long double))); diff --git a/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart index c2826d4dda..7409609503 100644 --- a/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart @@ -7,6 +7,7 @@ import 'dart:io'; import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/config_provider.dart'; +import 'package:logging/logging.dart'; import 'package:test/test.dart'; import 'package:yaml/yaml.dart' as yaml; import 'package:ffigen/src/strings.dart' as strings; @@ -17,7 +18,7 @@ Library actual; void main() { group('unnamed_enums_test', () { setUpAll(() { - logWarnings(); + logWarnings(Level.SEVERE); actual = parser.parse( Config.fromYaml(yaml.loadYaml(''' ${strings.name}: 'NativeLibrary' @@ -30,6 +31,11 @@ ${strings.headers}: ); }); + test('Remove deeply nested unsupported types', () { + expect(() => actual.getBindingAsString('funcNestedUnimplemented'), + throwsA(TypeMatcher())); + }); + test('Expected bindings', () { final gen = actual.generate(); // Writing to file for debug purpose. diff --git a/pkgs/ffigen/test/header_parser_tests/typedef.h b/pkgs/ffigen/test/header_parser_tests/typedef.h index 3e9d996be8..9dda096531 100644 --- a/pkgs/ffigen/test/header_parser_tests/typedef.h +++ b/pkgs/ffigen/test/header_parser_tests/typedef.h @@ -40,14 +40,11 @@ void func2(NTyperef1 *); typedef enum { - + a=0 } AnonymousEnumInTypedef; -// These typerefs do not affect the name of AnonymousEnumInTypedef. -typedef AnonymousEnumInTypedef Typeref1; -typedef AnonymousEnumInTypedef Typeref2; // Name from global namespace is used. typedef enum _NamedEnumInTypedef { - + b=0 } NamedEnumInTypedef; diff --git a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart index 7f7646cfdc..6b3b971bc9 100644 --- a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart @@ -97,8 +97,18 @@ Library expectedLibrary() { Parameter(type: Type.pointer(Type.struct(excludedNtyperef))) ], ), - EnumClass(name: 'AnonymousEnumInTypedef'), - EnumClass(name: 'NamedEnumInTypedef'), + EnumClass( + name: 'AnonymousEnumInTypedef', + enumConstants: [ + EnumConstant(name: 'a', value: 0), + ], + ), + EnumClass( + name: 'NamedEnumInTypedef', + enumConstants: [ + EnumConstant(name: 'b', value: 0), + ], + ), ], ); } diff --git a/pkgs/ffigen/test/large_integration_tests/large_test.dart b/pkgs/ffigen/test/large_integration_tests/large_test.dart index 2815a1fc5e..697ea920fb 100644 --- a/pkgs/ffigen/test/large_integration_tests/large_test.dart +++ b/pkgs/ffigen/test/large_integration_tests/large_test.dart @@ -79,6 +79,8 @@ ${strings.name}: SQLite ${strings.description}: Bindings to SQLite. ${strings.output}: unused ${strings.arrayWorkaround}: true +# Needed for stdarg.h in MacOS +${strings.compilerOpts}: '-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Headers/' ${strings.comments}: ${strings.style}: ${strings.any} ${strings.length}: ${strings.full} From 026ffe19e950fc197ddde9757d0db5a2bdd4d37d Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 7 Sep 2020 13:47:44 +0530 Subject: [PATCH 044/276] [ffigen] Handle function types in functions/typedefs as function pointers (#103) --- pkgs/ffigen/CHANGELOG.md | 3 ++ pkgs/ffigen/lib/src/code_generator/func.dart | 11 ++++-- pkgs/ffigen/pubspec.yaml | 2 +- .../test/header_parser_tests/functions.h | 5 +++ .../header_parser_tests/functions_test.dart | 35 ++++++++++++++++++- 5 files changed, 51 insertions(+), 5 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index c04cf391e0..2c2b156fde 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.0.1 +- Fixed generation of `NativeFunction` parameters instead of `Pointer` in type signatures. + # 1.0.0 - Bump version to 1.0.0. - Handle unimplememnted function pointers causing errors. diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index 6498ff7d14..a55f6d2234 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -156,12 +156,17 @@ class Func extends LookUpBinding { } } -/// Represents a Function's parameter. +/// Represents a Parameter, used in [Func] and [Typedef]. class Parameter { final String originalName; String name; final Type type; - Parameter({String originalName, this.name = '', @required this.type}) - : originalName = originalName ?? name; + Parameter({String originalName, this.name = '', @required Type type}) + : originalName = originalName ?? name, + // A type with broadtype [BroadType.NativeFunction] is wrapped with a + // pointer because this is a shorthand used in C for Pointer to function. + type = type.broadType == BroadType.NativeFunction + ? Type.pointer(type) + : type; } diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 36302e6299..fa95439f42 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 1.0.0 +version: 1.0.1 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/header_parser_tests/functions.h b/pkgs/ffigen/test/header_parser_tests/functions.h index 306ff0f934..5c00b33c93 100644 --- a/pkgs/ffigen/test/header_parser_tests/functions.h +++ b/pkgs/ffigen/test/header_parser_tests/functions.h @@ -11,3 +11,8 @@ double func3(float, int8_t a, int64_t, int32_t b); // Tests with pointers to primitives. void *func4(int8_t **, double, int32_t ***); + +// Would be treated as `typedef void shortHand(void (*b)())`. +typedef void shortHand(void(b)()); +// Would be treated as `void func5(shortHand *a, void (*b)())`. +void func5(shortHand a, void(b)()); diff --git a/pkgs/ffigen/test/header_parser_tests/functions_test.dart b/pkgs/ffigen/test/header_parser_tests/functions_test.dart index aba98e61d2..2c898bc5ec 100644 --- a/pkgs/ffigen/test/header_parser_tests/functions_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/functions_test.dart @@ -53,6 +53,11 @@ ${strings.headers}: expect(actual.getBindingAsString('func4'), expected.getBindingAsString('func4')); }); + + test('func5', () { + expect(actual.getBindingAsString('func5'), + expected.getBindingAsString('func5')); + }); }); } @@ -122,8 +127,36 @@ Library expectedLibrary() { Parameter( type: Type.pointer(Type.pointer( Type.pointer(Type.nativeType(SupportedNativeType.Int32)))), - ) + ), ]), + Func( + name: 'func5', + returnType: Type.nativeType(SupportedNativeType.Void), + parameters: [ + Parameter( + name: 'a', + type: Type.pointer(Type.nativeFunc(Typedef( + name: 'shortHand', + returnType: Type.nativeType(SupportedNativeType.Void), + typedefType: TypedefType.C, + parameters: [ + Parameter( + type: Type.pointer(Type.nativeFunc(Typedef( + name: 'b', + returnType: Type.nativeType(SupportedNativeType.Void), + typedefType: TypedefType.C, + )))), + ], + )))), + Parameter( + name: 'b', + type: Type.pointer(Type.nativeFunc(Typedef( + name: '_typedefC_2', + returnType: Type.nativeType(SupportedNativeType.Void), + typedefType: TypedefType.C, + )))), + ], + ), ], ); } From ed2cf4d0aed223c41611c4c4c512faef0f48a244 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Tue, 15 Sep 2020 15:16:10 +0530 Subject: [PATCH 045/276] [ffigen] Update readme (#104) Fixed code block indentation issue in configuration table. --- pkgs/ffigen/CHANGELOG.md | 3 ++ pkgs/ffigen/README.md | 93 ++++++++++++++++++++++++++++++++-------- pkgs/ffigen/pubspec.yaml | 2 +- 3 files changed, 79 insertions(+), 19 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 2c2b156fde..2ae8d466aa 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.0.2 +- Fix indentation for pub's readme. + # 1.0.1 - Fixed generation of `NativeFunction` parameters instead of `Pointer` in type signatures. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 20ff335673..4c5f3358d7 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -80,12 +80,19 @@ The following configuration options are available- output
(Required) Output path of the generated bindings. -
output: 'generated_bindings.dart'
+ + +```yaml +output: 'generated_bindings.dart' +``` + headers
(Required) The header entry-points and include-directives. Glob syntax is allowed. -
+    
+
+```yaml
 headers:
   entry-points:
     - 'folder/**.h'
@@ -94,27 +101,45 @@ headers:
     - '**index.h'
     - '**/clang-c/**'
     - '/full/path/to/a/header.h'
-  
+``` + name
(Prefer) Name of generated class. -
name: 'SQLite'
+ + +```yaml +name: 'SQLite' +``` + description
(Prefer) Dart Doc for generated class. -
description: 'Bindings to SQLite'
+ + +```yaml +description: 'Bindings to SQLite' +``` + compiler-opts Pass compiler options to clang. -
compiler-opts: '-I/usr/lib/llvm-9/include/'
+ + +```yaml +compiler-opts: '-I/usr/lib/llvm-9/include/' +``` + functions
structs
enums
unnamed-enums
macros Filters for declarations.
Default: all are included -
+    
+
+```yaml
 functions:
   include: # 'exclude' is also available.
     - [a-z][a-zA-Z0-9]* # Matches using regexp.
@@ -136,14 +161,20 @@ enums:
     'CXTypeKind': # Full names have higher priority.
       # $1 keeps only the 1st group i.e '(.*)'.
       'CXType(.*)': '$1'
-    
+``` + array-workaround Should generate workaround for fixed arrays in Structs. See Array Workaround
Default: false -
array-workaround: true
+ + +```yaml +array-workaround: true +``` + comments @@ -154,41 +185,63 @@ enums: If you want to disable all comments you can also pass
comments: false. -
+    
+
+```yaml
 comments:
   style: doxygen
   length: full
-    
+``` + sort Sort the bindings according to name.
Default: false, i.e keep the order as in the source files. -
sort: true
+ + +```yaml +sort: true +``` + use-supported-typedefs Should automatically map typedefs, E.g uint8_t => Uint8, int16_t => Int16 etc.
Default: true -
use-supported-typedefs: true
+ + +```yaml +use-supported-typedefs: true +``` + dart-bool Should generate dart `bool` for c99 bool in functions.
Default: true -
dart-bool: true
+ + +```yaml +dart-bool: true +``` + preamble Raw header of the file, pasted as-it-is. -
+    
+
+```yaml
 preamble: |
   /// AUTO GENERATED FILE, DO NOT EDIT.
   ///
-  /// Generated by `package:ffigen`.
+ /// Generated by `package:ffigen`. +``` + size-map @@ -196,7 +249,9 @@ preamble: | The defaults (see example) may not be portable on all OS. Do not change these unless absolutely sure. -
+    
+
+```yaml
 # These are optional and also default,
 # Omitting any and the default will be used.
 size-map:
@@ -210,7 +265,9 @@ size-map:
   unsigned long: 8
   long long: 8
   unsigned long long: 8
-  enum: 4
+ enum: 4 +``` + diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index fa95439f42..04ca960adb 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 1.0.1 +version: 1.0.2 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C header files. From 46dc62442fb3a9efea035448c2b7f2d38ef06f8e Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Tue, 22 Sep 2020 15:05:40 +0530 Subject: [PATCH 046/276] [ffigen] Fixed errors due to extended ASCII and control characters in macros (#106) --- pkgs/ffigen/CHANGELOG.md | 3 + .../sub_parsers/macro_parser.dart | 93 +++++++++++++++++-- pkgs/ffigen/pubspec.yaml | 2 +- pkgs/ffigen/test/header_parser_tests/macros.h | 7 +- .../test/header_parser_tests/macros_test.dart | 16 ++++ 5 files changed, 113 insertions(+), 8 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 2ae8d466aa..a59311bed8 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.0.3 +- Fixed errors due to extended ASCII and control characters in macro strings. + # 1.0.2 - Fix indentation for pub's readme. diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart index 8884dd54e0..16cf4a194e 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart @@ -4,6 +4,7 @@ import 'dart:ffi'; import 'dart:io'; +import 'dart:typed_data'; import 'package:path/path.dart' as p; import 'package:ffi/ffi.dart'; @@ -131,17 +132,16 @@ int _macroVariablevisitor(Pointer cursor, ); break; case clang_types.CXEvalResultKind.CXEval_StrLiteral: - var value = Utf8.fromUtf8(clang.clang_EvalResult_getAsStr(e).cast()); - // Escape $ character. - value = value.replaceAll(r'$', r'\$'); - // Escape ' character, because our strings are enclosed with '. - value = value.replaceAll("'", r"\'"); + final rawValue = _getWrittenRepresentation( + macroName, + clang.clang_EvalResult_getAsStr(e), + ); constant = Constant( usr: savedMacros[macroName].usr, originalName: savedMacros[macroName].originalName, name: macroName, rawType: 'String', - rawValue: "'${value}'", + rawValue: "'${rawValue}'", ); break; } @@ -241,3 +241,84 @@ class MacroVariableString { return s.substring(nameStart, nameStart + len); } } + +/// Gets a written representation string of a C string. +/// +/// E.g- For a string "Hello\nWorld", The new line character is converted to \n. +/// Note: The string is considered to be Utf8, but is treated as Extended ASCII, +/// if the conversion fails. +String _getWrittenRepresentation(String macroName, Pointer strPtr) { + final sb = StringBuffer(); + try { + // Consider string to be Utf8 encoded by default. + sb.clear(); + // This throws a Format Exception if string isn't Utf8 so that we handle it + // in the catch block. + final result = Utf8.fromUtf8(strPtr.cast()); + for (final s in result.runes) { + sb.write(_getWritableChar(s)); + } + } catch (e) { + // Handle string if it isn't Utf8. String is considered to be + // Extended ASCII in this case. + _logger.warning( + "Couldn't decode Macro string '$macroName' as Utf8, using ASCII instead."); + sb.clear(); + final length = Utf8.strlen(strPtr.cast()); + final charList = Uint8List.view( + strPtr.cast().asTypedList(length).buffer, 0, length); + + for (final char in charList) { + sb.write(_getWritableChar(char, utf8: false)); + } + } + + return sb.toString(); +} + +/// Creates a writable char from [char] code. +/// +/// E.g- `\` is converted to `\\`. +String _getWritableChar(int char, {bool utf8 = true}) { + /// Handle control characters. + if (char >= 0 && char < 32 || char == 127) { + /// Handle these - `\b \t \n \v \f \r` as special cases. + switch (char) { + case 8: // \b + return r'\b'; + case 9: // \t + return r'\t'; + case 10: // \n + return r'\n'; + case 11: // \v + return r'\v'; + case 12: // \f + return r'\f'; + case 13: // \r + return r'\r'; + default: + final h = char.toRadixString(16).toUpperCase().padLeft(2, '0'); + return '\\x${h}'; + } + } + + /// Handle characters - `$ ' \` these need to be escaped when writing to file. + switch (char) { + case 36: // $ + return r'\$'; + case 39: // ' + return r"\'"; + case 92: // \ + return r'\\'; + } + + /// In case encoding is not Utf8, we know all characters will fall in [0..255] + /// Print range [128..255] as `\xHH`. + if (!utf8) { + final h = char.toRadixString(16).toUpperCase().padLeft(2, '0'); + return '\\x${h}'; + } + + /// In all other cases, simply convert to string. + return String.fromCharCode(char); +} diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 04ca960adb..578efe992b 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 1.0.2 +version: 1.0.3 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/header_parser_tests/macros.h b/pkgs/ffigen/test/header_parser_tests/macros.h index d75bcca76f..e58d4ac8f9 100644 --- a/pkgs/ffigen/test/header_parser_tests/macros.h +++ b/pkgs/ffigen/test/header_parser_tests/macros.h @@ -15,6 +15,11 @@ #define TEST8 5,2,3 -// These tests that special characters are escaped properly. +// These test that special characters are escaped properly. #define TEST9 "$dollar" #define TEST10 "test's" + +// These test that extended ASCII and control characters are handled properly. +#define TEST11 "\x80" +#define TEST12 "hello\n\t\r\v\b" +#define TEST13 "test\\" diff --git a/pkgs/ffigen/test/header_parser_tests/macros_test.dart b/pkgs/ffigen/test/header_parser_tests/macros_test.dart index e3588738ab..9b279e74e5 100644 --- a/pkgs/ffigen/test/header_parser_tests/macros_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/macros_test.dart @@ -72,6 +72,18 @@ ${strings.headers}: expect(actual.getBindingAsString('TEST10'), expected.getBindingAsString('TEST10')); }); + test('TEST11', () { + expect(actual.getBindingAsString('TEST11'), + expected.getBindingAsString('TEST11')); + }); + test('TEST12', () { + expect(actual.getBindingAsString('TEST12'), + expected.getBindingAsString('TEST12')); + }); + test('TEST13', () { + expect(actual.getBindingAsString('TEST13'), + expected.getBindingAsString('TEST13')); + }); }); } @@ -88,6 +100,10 @@ Library expectedLibrary() { Constant(name: 'TEST8', rawType: 'int', rawValue: '5'), Constant(name: 'TEST9', rawType: 'String', rawValue: r"'\$dollar'"), Constant(name: 'TEST10', rawType: 'String', rawValue: r"'test\'s'"), + Constant(name: 'TEST11', rawType: 'String', rawValue: r"'\x80'"), + Constant( + name: 'TEST12', rawType: 'String', rawValue: r"'hello\n\t\r\v\b'"), + Constant(name: 'TEST13', rawType: 'String', rawValue: r"'test\\'"), ], ); } From a4923ab3aab0ff0a171baf5fe5c8c51994c8fa32 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Fri, 2 Oct 2020 15:28:14 +0530 Subject: [PATCH 047/276] [ffigen] Updated tool to use dart format when sdk >=2.10.0 (#110) --- pkgs/ffigen/.travis.yml | 2 +- pkgs/ffigen/CHANGELOG.md | 3 +++ .../lib/src/code_generator/library.dart | 24 ++++++++++++------- pkgs/ffigen/pubspec.yaml | 3 ++- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/pkgs/ffigen/.travis.yml b/pkgs/ffigen/.travis.yml index cd062299dd..e535a1a978 100644 --- a/pkgs/ffigen/.travis.yml +++ b/pkgs/ffigen/.travis.yml @@ -21,7 +21,7 @@ before_install: - export PATH="/usr/lib/llvm-10/bin:$PATH" before_script: - - 'pub run ffigen:setup' + - 'dart pub run ffigen:setup' - cd test/native_test && dart build_test_dylib.dart && cd ../.. matrix: diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index a59311bed8..7b452c5956 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.0.4 +- Updated code to use `dart format` instead of `dartfmt` for sdk version `>= 2.10.0`. + # 1.0.3 - Fixed errors due to extended ASCII and control characters in macro strings. diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index 978105e4d6..e1d239040b 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -8,6 +8,7 @@ import 'package:cli_util/cli_util.dart'; import 'package:logging/logging.dart'; import 'package:meta/meta.dart'; import 'package:path/path.dart' as p; +import 'package:pub_semver/pub_semver.dart'; import 'binding.dart'; import 'utils.dart'; import 'writer.dart'; @@ -96,15 +97,20 @@ class Library { /// Formats a file using `dartfmt`. void _dartFmt(String path) { - final dartFmt = p.join(getSdkPath(), 'bin', 'dartfmt'); - try { - final result = Process.runSync(dartFmt, ['-w', path], - runInShell: Platform.isWindows); - if (result.stderr.toString().isNotEmpty) { - _logger.severe(result.stderr); - } - } on ProcessException { - _logger.severe("Couldn't format bindings, unable to call $dartFmt."); + final sdkPath = getSdkPath(); + final versionAtleast2dot10 = Version.parse( + File(p.join(sdkPath, 'version')).readAsStringSync().trim()) >= + Version(2, 10, 0); + + /// Starting from version `>=2.10.0` the dart sdk has a unified `dart` tool + /// So we call `dart format` instead of `dartfmt`. + final result = versionAtleast2dot10 + ? Process.runSync(p.join(sdkPath, 'bin', 'dart'), ['format', path], + runInShell: Platform.isWindows) + : Process.runSync(p.join(sdkPath, 'bin', 'dartfmt'), ['-w', path], + runInShell: Platform.isWindows); + if (result.stderr.toString().isNotEmpty) { + _logger.severe(result.stderr); } } diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 578efe992b..a03c62edc2 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 1.0.3 +version: 1.0.4 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C header files. @@ -20,6 +20,7 @@ dependencies: glob: ^1.2.0 path: ^1.7.0 quiver: ^2.1.3 + pub_semver: ^1.4.4 dev_dependencies: pedantic: ^1.9.2 From 13a64f3de8f8c8d443ca23d3752e1439cfee9b99 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 12 Oct 2020 14:13:47 +0530 Subject: [PATCH 048/276] [ffigen] Handled proper conversion of macro doubles. (#113) * Fixed issues with macros with value double.infinity and double.NaN --- pkgs/ffigen/CHANGELOG.md | 3 +++ .../sub_parsers/macro_parser.dart | 19 ++++++++++++++++- pkgs/ffigen/lib/src/strings.dart | 5 +++++ pkgs/ffigen/pubspec.yaml | 2 +- pkgs/ffigen/test/header_parser_tests/macros.h | 7 +++++++ .../test/header_parser_tests/macros_test.dart | 21 +++++++++++++++++++ 6 files changed, 55 insertions(+), 2 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 7b452c5956..b452cb9008 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.0.5 +- Fixed issues with generating macros of type `double.Infinity` and `double.NaN`. + # 1.0.4 - Updated code to use `dart format` instead of `dartfmt` for sdk version `>= 2.10.0`. diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart index 16cf4a194e..6c13ada060 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart @@ -6,6 +6,7 @@ import 'dart:ffi'; import 'dart:io'; import 'dart:typed_data'; +import 'package:ffigen/src/strings.dart' as strings; import 'package:path/path.dart' as p; import 'package:ffi/ffi.dart'; import 'package:ffigen/src/code_generator.dart'; @@ -128,7 +129,8 @@ int _macroVariablevisitor(Pointer cursor, originalName: savedMacros[macroName].originalName, name: macroName, rawType: 'double', - rawValue: clang.clang_EvalResult_getAsDouble(e).toString(), + rawValue: + _writeDoubleAsString(clang.clang_EvalResult_getAsDouble(e)), ); break; case clang_types.CXEvalResultKind.CXEval_StrLiteral: @@ -322,3 +324,18 @@ String _getWritableChar(int char, {bool utf8 = true}) { /// In all other cases, simply convert to string. return String.fromCharCode(char); } + +/// Converts a double to a string, handling cases like Infinity and NaN. +String _writeDoubleAsString(double d) { + if (d.isFinite) { + return d.toString(); + } else { + // The only Non-Finite numbers are Infinity, NegativeInfinity and NaN. + if (d.isInfinite) { + return d.isNegative + ? strings.doubleNegativeInfinity + : strings.doubleInfinity; + } + return strings.doubleNaN; + } +} diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 2cd2697c61..5a81450954 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -108,3 +108,8 @@ const preamble = 'preamble'; const libclang_dylib_linux = 'libwrapped_clang.so'; const libclang_dylib_macos = 'libwrapped_clang.dylib'; const libclang_dylib_windows = 'wrapped_clang.dll'; + +// Writen doubles +const doubleInfinity = 'double.infinity'; +const doubleNegativeInfinity = 'double.negativeInfinity'; +const doubleNaN = 'double.nan'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index a03c62edc2..7b1185b563 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 1.0.4 +version: 1.0.5 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/header_parser_tests/macros.h b/pkgs/ffigen/test/header_parser_tests/macros.h index e58d4ac8f9..90bbd453d3 100644 --- a/pkgs/ffigen/test/header_parser_tests/macros.h +++ b/pkgs/ffigen/test/header_parser_tests/macros.h @@ -1,3 +1,5 @@ +#include + #define TEST1 1.1 #define TEST2 10 #define TEST3 (TEST1 + TEST2) @@ -23,3 +25,8 @@ #define TEST11 "\x80" #define TEST12 "hello\n\t\r\v\b" #define TEST13 "test\\" + +// Infinity, NaN and Negative Infinity. +#define TEST14 INFINITY +#define TEST15 -INFINITY +#define TEST16 NAN diff --git a/pkgs/ffigen/test/header_parser_tests/macros_test.dart b/pkgs/ffigen/test/header_parser_tests/macros_test.dart index 9b279e74e5..6ad50903d7 100644 --- a/pkgs/ffigen/test/header_parser_tests/macros_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/macros_test.dart @@ -27,6 +27,8 @@ ${strings.output}: 'unused' ${strings.headers}: ${strings.entryPoints}: - 'test/header_parser_tests/macros.h' + ${strings.includeDirectives}: + - '**macros.h' ''') as yaml.YamlMap), ); }); @@ -84,6 +86,18 @@ ${strings.headers}: expect(actual.getBindingAsString('TEST13'), expected.getBindingAsString('TEST13')); }); + test('TEST14', () { + expect(actual.getBindingAsString('TEST14'), + expected.getBindingAsString('TEST14')); + }); + test('TEST15', () { + expect(actual.getBindingAsString('TEST15'), + expected.getBindingAsString('TEST15')); + }); + test('TEST16', () { + expect(actual.getBindingAsString('TEST16'), + expected.getBindingAsString('TEST16')); + }); }); } @@ -104,6 +118,13 @@ Library expectedLibrary() { Constant( name: 'TEST12', rawType: 'String', rawValue: r"'hello\n\t\r\v\b'"), Constant(name: 'TEST13', rawType: 'String', rawValue: r"'test\\'"), + Constant( + name: 'TEST14', rawType: 'double', rawValue: strings.doubleInfinity), + Constant( + name: 'TEST15', + rawType: 'double', + rawValue: strings.doubleNegativeInfinity), + Constant(name: 'TEST16', rawType: 'double', rawValue: strings.doubleNaN), ], ); } From 7a7a823a43ff34aebce1d52afd5ba3fd0cf5adeb Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Fri, 30 Oct 2020 20:05:03 +0530 Subject: [PATCH 049/276] [ffigen] Fixed missing typedefs nested under return type of another typedef (#116) --- pkgs/ffigen/.travis.yml | 4 ++-- pkgs/ffigen/CHANGELOG.md | 3 +++ .../lib/src/code_generator/typedef.dart | 4 ++++ pkgs/ffigen/pubspec.yaml | 2 +- .../header_parser_tests/native_func_typedef.h | 4 ++++ .../native_func_typedef_test.dart | 24 +++++++++++++++++++ 6 files changed, 38 insertions(+), 3 deletions(-) diff --git a/pkgs/ffigen/.travis.yml b/pkgs/ffigen/.travis.yml index e535a1a978..6f311a4ca6 100644 --- a/pkgs/ffigen/.travis.yml +++ b/pkgs/ffigen/.travis.yml @@ -1,6 +1,6 @@ language: dart dart: -- dev +- stable # Only building master means that we don't run two builds for each pull request. dart_task: - test: --platform vm @@ -26,6 +26,6 @@ before_script: matrix: include: - - dart: dev + - dart: stable script: ./tool/travis.sh name: Collect and report coverage. diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index b452cb9008..d24647f451 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.0.6 +- Fixed missing typedefs nested in another typedef's return types. + # 1.0.5 - Fixed issues with generating macros of type `double.Infinity` and `double.NaN`. diff --git a/pkgs/ffigen/lib/src/code_generator/typedef.dart b/pkgs/ffigen/lib/src/code_generator/typedef.dart index e0c3c7a8c8..7f3c6840ce 100644 --- a/pkgs/ffigen/lib/src/code_generator/typedef.dart +++ b/pkgs/ffigen/lib/src/code_generator/typedef.dart @@ -47,6 +47,10 @@ class Typedef { dep.addAll(base.nativeFunc.getDependencies()); } } + final returnTypeBase = returnType.getBaseType(); + if (returnTypeBase.broadType == BroadType.NativeFunction) { + dep.addAll(returnTypeBase.nativeFunc.getDependencies()); + } dep.add(this); return dep; } diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 7b1185b563..2d21dc51df 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 1.0.5 +version: 1.0.6 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h b/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h index f799b9dce1..da2f3c0727 100644 --- a/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h +++ b/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h @@ -11,3 +11,7 @@ void func(void (*unnamed1)(void (*unnamed2)())); // This will be removed because 'long double' is unsupported. void funcNestedUnimplemented(void (*unnamed1)(void (*unnamed2)(long double))); + +typedef void (*insideReturnType)(); +typedef insideReturnType (*withTypedefReturnType)(); +void funcWithNativeFunc(withTypedefReturnType named); diff --git a/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart index 7409609503..16768173ca 100644 --- a/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart @@ -66,6 +66,16 @@ _func ??= _dylib.lookupFunction<_c_func,_dart_func>('func'); } _dart_func _func; +void funcWithNativeFunc( + ffi.Pointer> named, +) { +_funcWithNativeFunc ??= _dylib.lookupFunction<_c_funcWithNativeFunc,_dart_funcWithNativeFunc>('funcWithNativeFunc'); + return _funcWithNativeFunc( + named, + ); +} +_dart_funcWithNativeFunc _funcWithNativeFunc; + } class struc extends ffi.Struct{ @@ -88,6 +98,20 @@ typedef _dart_func = void Function( ffi.Pointer> unnamed1, ); +typedef _typedefC_5 = ffi.Void Function( +); + +typedef withTypedefReturnType = ffi.Pointer> Function( +); + +typedef _c_funcWithNativeFunc = ffi.Void Function( + ffi.Pointer> named, +); + +typedef _dart_funcWithNativeFunc = void Function( + ffi.Pointer> named, +); + typedef _typedefC_1 = ffi.Void Function( ); From 59708c615aeb9005ba4a383065ab9da60bb08ea9 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Thu, 12 Nov 2020 14:15:46 +0530 Subject: [PATCH 050/276] [ffigen] Added workaround to map typedef names to a NativeType. (#119) * Iterate over all typedefs rather than jumping to the base type. * Added typedef-map to config. * Updated version, changelog, and readme. --- pkgs/ffigen/CHANGELOG.md | 3 ++ pkgs/ffigen/README.md | 14 +++++++++ .../lib/src/config_provider/config.dart | 12 +++++++ .../lib/src/config_provider/spec_utils.dart | 31 +++++++++++++++++++ .../type_extractor/extractor.dart | 11 +++++-- pkgs/ffigen/lib/src/strings.dart | 17 ++++++++++ pkgs/ffigen/pubspec.yaml | 2 +- .../native_func_typedef_test.dart | 4 +-- .../ffigen/test/header_parser_tests/typedef.h | 6 ++++ .../header_parser_tests/typedef_test.dart | 13 ++++++++ 10 files changed, 107 insertions(+), 6 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index d24647f451..38c346e4ee 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.1.0 +- `typedef-map` can now be used to map a typedef name to a native type directly. + # 1.0.6 - Fixed missing typedefs nested in another typedef's return types. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 4c5f3358d7..2bc7aa6c59 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -242,6 +242,20 @@ preamble: | /// Generated by `package:ffigen`. ``` + + + typedef-map + Map typedefs to Native Types.
Values can only be + Void, Uint8, Int8, Uint16, Int16, Uint32, Int32, Uint64, Int64, IntPtr, Float and Double. + + + +```yaml +typedef-map: + 'my_custom_type': 'IntPtr' + 'size_t': 'Int64' +``` + size-map diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index ad8db21c5a..eae3edc4ce 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -59,6 +59,11 @@ class Config { bool get useSupportedTypedefs => _useSupportedTypedefs; bool _useSupportedTypedefs; + /// Stores typedef name to NativeType mappings specified by user. + Map get typedefNativeTypeMappings => + _typedefNativeTypeMappings; + Map _typedefNativeTypeMappings; + /// Extracted Doc comment type. CommentType get commentType => _commentType; CommentType _commentType; @@ -223,6 +228,13 @@ class Config { } }, ), + strings.typedefmap: Specification>( + validator: typedefmapValidator, + extractor: typedefmapExtractor, + defaultValue: () => {}, + extractedResult: (dynamic result) => _typedefNativeTypeMappings = + result as Map, + ), strings.sort: Specification( requirement: Requirement.no, validator: booleanValidator, diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 1400c2f959..3ed5767b42 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -71,6 +71,37 @@ bool sizemapValidator(String name, dynamic yamlConfig) { return true; } +Map typedefmapExtractor(dynamic yamlConfig) { + final resultMap = {}; + final typedefmap = yamlConfig as YamlMap; + if (typedefmap != null) { + for (final typeName in typedefmap.keys) { + if (typedefmap[typeName] is String && + strings.supportedNativeType_mappings + .containsKey(typedefmap[typeName])) { + // Map this typename to specified supportedNativeType. + resultMap[typeName as String] = + strings.supportedNativeType_mappings[typedefmap[typeName]]; + } + } + } + return resultMap; +} + +bool typedefmapValidator(String name, dynamic yamlConfig) { + if (!checkType([name], yamlConfig)) { + return false; + } + for (final value in (yamlConfig as YamlMap).values) { + if (value is! String || + !strings.supportedNativeType_mappings.containsKey(value)) { + _logger.severe("Unknown value of subkey '$value' in '$name'."); + } + } + + return true; +} + List compilerOptsExtractor(dynamic value) => (value as String)?.split(' '); diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index f2ec345e71..eedb119863 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -30,9 +30,13 @@ Type getCodeGenType(Pointer cxtype, {String parentName}) { pt.dispose(); return Type.pointer(s); case clang_types.CXTypeKind.CXType_Typedef: - // Get name from typedef name if config allows. + final spelling = cxtype.spelling(); + if (config.typedefNativeTypeMappings.containsKey(spelling)) { + _logger.fine(' Type Mapped from typedef-map'); + return Type.nativeType(config.typedefNativeTypeMappings[spelling]); + } + // Get name from supported typedef name if config allows. if (config.useSupportedTypedefs) { - final spelling = cxtype.spelling(); if (suportedTypedefToSuportedNativeType.containsKey(spelling)) { _logger.fine(' Type Mapped from supported typedef'); return Type.nativeType(suportedTypedefToSuportedNativeType[spelling]); @@ -40,7 +44,8 @@ Type getCodeGenType(Pointer cxtype, {String parentName}) { } // This is important or we get stuck in infinite recursion. - final ct = clang.clang_getCanonicalType_wrap(cxtype); + final ct = clang.clang_getTypedefDeclUnderlyingType_wrap( + clang.clang_getTypeDeclaration_wrap(cxtype)); final s = getCodeGenType(ct, parentName: parentName ?? cxtype.spelling()); ct.dispose(); diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 5a81450954..60981bc7d2 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:io'; +import 'package:ffigen/src/code_generator/type.dart'; import 'package:ffigen/src/find_resource.dart'; import 'package:ffigen/src/header_parser/clang_bindings/clang_bindings.dart' as clang; @@ -49,6 +50,7 @@ const exclude = 'exclude'; const rename = 'rename'; const memberRename = 'member-rename'; const sizemap = 'size-map'; +const typedefmap = 'typedef-map'; // Sizemap values. const SChar = 'char'; @@ -78,6 +80,21 @@ const sizemap_native_mapping = { Enum: clang.CXTypeKind.CXType_Enum }; +const supportedNativeType_mappings = { + 'Void': SupportedNativeType.Void, + 'Uint8': SupportedNativeType.Uint8, + 'Uint16': SupportedNativeType.Uint16, + 'Uint32': SupportedNativeType.Uint32, + 'Uint64': SupportedNativeType.Uint64, + 'Int8': SupportedNativeType.Int8, + 'Int16': SupportedNativeType.Int16, + 'Int32': SupportedNativeType.Int32, + 'Int64': SupportedNativeType.Int64, + 'IntPtr': SupportedNativeType.IntPtr, + 'Float': SupportedNativeType.Float, + 'Double': SupportedNativeType.Double, +}; + // Boolean flags. const sort = 'sort'; const useSupportedTypedefs = 'use-supported-typedefs'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 2d21dc51df..b0f6b4b9c2 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 1.0.6 +version: 1.1.0 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart index 16768173ca..c1f2d37d67 100644 --- a/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart @@ -98,10 +98,10 @@ typedef _dart_func = void Function( ffi.Pointer> unnamed1, ); -typedef _typedefC_5 = ffi.Void Function( +typedef insideReturnType = ffi.Void Function( ); -typedef withTypedefReturnType = ffi.Pointer> Function( +typedef withTypedefReturnType = ffi.Pointer> Function( ); typedef _c_funcWithNativeFunc = ffi.Void Function( diff --git a/pkgs/ffigen/test/header_parser_tests/typedef.h b/pkgs/ffigen/test/header_parser_tests/typedef.h index 9dda096531..68ad426f99 100644 --- a/pkgs/ffigen/test/header_parser_tests/typedef.h +++ b/pkgs/ffigen/test/header_parser_tests/typedef.h @@ -48,3 +48,9 @@ typedef enum _NamedEnumInTypedef { b=0 } NamedEnumInTypedef; + +// Should be treated as IntPtr when used. +typedef char specified_type_as_IntPtr; +typedef specified_type_as_IntPtr nesting_a_specified_type; + +void func3(specified_type_as_IntPtr, nesting_a_specified_type b); diff --git a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart index 6b3b971bc9..eeeb37c377 100644 --- a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart @@ -31,6 +31,8 @@ ${strings.structs}: ${strings.exclude}: - ExcludedStruct - _ExcludedStruct +${strings.typedefmap}: + 'specified_type_as_IntPtr': 'IntPtr' ''') as yaml.YamlMap), ); }); @@ -109,6 +111,17 @@ Library expectedLibrary() { EnumConstant(name: 'b', value: 0), ], ), + Func( + name: 'func3', + returnType: Type.nativeType(SupportedNativeType.Void), + parameters: [ + Parameter(type: Type.nativeType(SupportedNativeType.IntPtr)), + Parameter( + type: Type.nativeType(SupportedNativeType.IntPtr), + name: 'b', + ), + ], + ), ], ); } From 3f867137948a37f773abef281c8147d7505ec5ec Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 23 Nov 2020 14:06:19 +0530 Subject: [PATCH 051/276] [ffigen] Added support for Dart_Handle to be generated as Handle (#121) --- pkgs/ffigen/CHANGELOG.md | 3 + pkgs/ffigen/README.md | 14 +- pkgs/ffigen/lib/src/code_generator/type.dart | 10 ++ .../lib/src/config_provider/config.dart | 11 ++ .../sub_parsers/structdecl_parser.dart | 9 ++ .../type_extractor/extractor.dart | 15 ++- pkgs/ffigen/lib/src/strings.dart | 14 +- pkgs/ffigen/pubspec.yaml | 2 +- .../test/header_parser_tests/dart_handle.h | 25 ++++ .../header_parser_tests/dart_handle_test.dart | 120 ++++++++++++++++++ pkgs/ffigen/test/native_test/config.yaml | 2 +- 11 files changed, 215 insertions(+), 10 deletions(-) create mode 100644 pkgs/ffigen/test/header_parser_tests/dart_handle.h create mode 100644 pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 38c346e4ee..a919a1a9dc 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.2.0 +- Added support for `Dart_Handle` from `dart_api.h`. + # 1.1.0 - `typedef-map` can now be used to map a typedef name to a native type directly. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 2bc7aa6c59..a48185cbe6 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -230,7 +230,19 @@ dart-bool: true ``` - + + use-dart-handle + Should map `Dart_Handle` to `Handle`.
+ Default: true + + + +```yaml +use-dart-handle: true +``` + + + preamble Raw header of the file, pasted as-it-is. diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index 9ccc2b1a89..5922b38ceb 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -39,6 +39,9 @@ enum BroadType { Struct, NativeFunction, + /// Represents a Dart_Handle. + Handle, + /// Stores its element type in NativeType as only those are supported. ConstantArray, IncompleteArray, @@ -130,6 +133,9 @@ class Type { return Type._( broadType: BroadType.Unimplemented, unimplementedReason: reason); } + factory Type.handle() { + return Type._(broadType: BroadType.Handle); + } /// Get base type for any type. /// @@ -176,6 +182,8 @@ class Type { return '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; case BroadType.Boolean: // Booleans are treated as uint8. return '${w.ffiLibraryPrefix}.${_primitives[SupportedNativeType.Uint8].c}'; + case BroadType.Handle: + return '${w.ffiLibraryPrefix}.Handle'; default: throw Exception('cType unknown'); } @@ -199,6 +207,8 @@ class Type { return '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; case BroadType.Boolean: // Booleans are treated as uint8. return _primitives[SupportedNativeType.Uint8].dart; + case BroadType.Handle: + return 'Object'; default: throw Exception('dart type unknown for ${broadType.toString()}'); } diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index eae3edc4ce..04ae2a9692 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -92,6 +92,10 @@ class Config { String _preamble; Config._(); + /// If `Dart_Handle` should be mapped with Handle/Object. + bool get useDartHandle => _useDartHandle; + bool _useDartHandle; + /// Create config from Yaml map. factory Config.fromYaml(YamlMap map) { final configspecs = Config._(); @@ -293,6 +297,13 @@ class Config { extractor: stringExtractor, extractedResult: (dynamic result) => _preamble = result as String, ), + strings.useDartHandle: Specification( + requirement: Requirement.no, + validator: booleanValidator, + extractor: booleanExtractor, + defaultValue: () => true, + extractedResult: (dynamic result) => _useDartHandle = result as bool, + ), }; } } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index 9b19d54492..334349c892 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -22,6 +22,7 @@ class _ParsedStruc { bool flexibleArrayMember = false; bool arrayMember = false; bool bitFieldMember = false; + bool dartHandleMember = false; _ParsedStruc(); } @@ -115,6 +116,12 @@ void _setStructMembers(Pointer cursor) { _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) { + _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(); } } @@ -146,6 +153,8 @@ int _structMembersVisitor(Pointer cursor, } else if (clang.clang_getFieldDeclBitWidth_wrap(cursor) != -1) { // TODO(84): Struct with bitfields are not suppoorted. _stack.top.bitFieldMember = true; + } else if (mt.broadType == BroadType.Handle) { + _stack.top.dartHandleMember = true; } if (mt.getBaseType().broadType == BroadType.Unimplemented) { diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index eedb119863..4137e77b72 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -6,6 +6,7 @@ import 'dart:ffi'; import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang_types; @@ -28,6 +29,13 @@ Type getCodeGenType(Pointer cxtype, {String parentName}) { final pt = clang.clang_getPointeeType_wrap(cxtype); final s = getCodeGenType(pt, parentName: parentName); pt.dispose(); + + // Replace Pointer<_Dart_Handle> with Handle. + if (config.useDartHandle && + s.broadType == BroadType.Struct && + s.struc.usr == strings.dartHandleUsr) { + return Type.handle(); + } return Type.pointer(s); case clang_types.CXTypeKind.CXType_Typedef: final spelling = cxtype.spelling(); @@ -116,8 +124,11 @@ Type _extractfromRecord(Pointer cxtype, String parentName) { final struc = parseStructDeclaration(cursor, name: structName, ignoreFilter: true); type = Type.struct(struc); - // Add to bindings. - addToBindings(struc); + + // Add to bindings if it's not Dart_Handle. + if (!(config.useDartHandle && structUsr == strings.dartHandleUsr)) { + addToBindings(struc); + } } cxtype.dispose(); diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 60981bc7d2..74dc0faeaa 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -101,19 +101,20 @@ const useSupportedTypedefs = 'use-supported-typedefs'; const warnWhenRemoving = 'warn-when-removing'; const arrayWorkaround = 'array-workaround'; const dartBool = 'dart-bool'; +const useDartHandle = 'use-dart-handle'; const comments = 'comments'; -// Sub-fields of comments +// Sub-fields of comments. const style = 'style'; const length = 'length'; -// Sub-fields of style +// Sub-fields of style. const doxygen = 'doxygen'; const any = 'any'; -// Sub-fields of length +// Sub-fields of length. const brief = 'brief'; const full = 'full'; -// Cmd line comment option +// Cmd line comment option. const fparseAllComments = '-fparse-all-comments'; // Library input. @@ -126,7 +127,10 @@ const libclang_dylib_linux = 'libwrapped_clang.so'; const libclang_dylib_macos = 'libwrapped_clang.dylib'; const libclang_dylib_windows = 'wrapped_clang.dll'; -// Writen doubles +// Writen doubles. const doubleInfinity = 'double.infinity'; const doubleNegativeInfinity = 'double.negativeInfinity'; const doubleNaN = 'double.nan'; + +/// USR for struct `_Dart_Handle`. +const dartHandleUsr = 'c:@S@_Dart_Handle'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index b0f6b4b9c2..80feda7e5b 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 1.1.0 +version: 1.2.0 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/header_parser_tests/dart_handle.h b/pkgs/ffigen/test/header_parser_tests/dart_handle.h new file mode 100644 index 0000000000..72fa445708 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/dart_handle.h @@ -0,0 +1,25 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#include + +void func1(Dart_Handle); +Dart_Handle func2(); +Dart_Handle **func3(Dart_Handle *); + +typedef void (*typedef1)(Dart_Handle); +void func4(typedef1); + +// Dart_Handle isn't supported directly, so all members are removed. +struct struc1 +{ + Dart_Handle h; + int a; +}; + +// Pointer works. +struct struc2 +{ + Dart_Handle *h; +}; diff --git a/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart b/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart new file mode 100644 index 0000000000..3fdc12ce3a --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart @@ -0,0 +1,120 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:cli_util/cli_util.dart'; +import 'package:path/path.dart' as path; +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/config_provider.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; +import 'package:ffigen/src/strings.dart' as strings; + +import '../test_utils.dart'; + +Library actual, expected; + +void main() { + group('dart_handle_test', () { + setUpAll(() { + logWarnings(); + expected = expectedLibrary(); + actual = parser.parse( + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Dart_Handle Test' +${strings.output}: 'unused' +${strings.compilerOpts}: '-I${path.join(getSdkPath(), "include")} -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Headers/' + +${strings.headers}: + ${strings.entryPoints}: + - 'test/header_parser_tests/dart_handle.h' + ${strings.includeDirectives}: + - '**dart_handle.h' + ''') as yaml.YamlMap), + ); + }); + test('Total bindings count', () { + expect(actual.bindings.length, expected.bindings.length); + }); + + test('func1', () { + expect(actual.getBindingAsString('func1'), + expected.getBindingAsString('func1')); + }); + test('func2', () { + expect(actual.getBindingAsString('func2'), + expected.getBindingAsString('func2')); + }); + test('func3', () { + expect(actual.getBindingAsString('func3'), + expected.getBindingAsString('func3')); + }); + test('func4', () { + expect(actual.getBindingAsString('func4'), + expected.getBindingAsString('func4')); + }); + test('struc1', () { + expect(actual.getBindingAsString('struc1'), + expected.getBindingAsString('struc1')); + }); + test('struc2', () { + expect(actual.getBindingAsString('struc2'), + expected.getBindingAsString('struc2')); + }); + }); +} + +Library expectedLibrary() { + final namedTypedef = Typedef( + name: 'typedef1', + typedefType: TypedefType.C, + returnType: Type.nativeType(SupportedNativeType.Void), + parameters: [Parameter(type: Type.handle())], + ); + return Library( + name: 'NativeLibrary', + bindings: [ + Func( + name: 'func1', + returnType: Type.nativeType( + SupportedNativeType.Void, + ), + parameters: [ + Parameter(type: Type.handle()), + ], + ), + Func( + name: 'func2', + returnType: Type.handle(), + ), + Func( + name: 'func3', + returnType: Type.pointer(Type.pointer(Type.handle())), + parameters: [ + Parameter( + type: Type.pointer(Type.handle()), + ), + ], + ), + Func( + name: 'func4', + returnType: Type.nativeType(SupportedNativeType.Void), + parameters: [ + Parameter( + type: Type.pointer(Type.nativeFunc(namedTypedef)), + ), + ], + ), + // struc1 should have no members. + Struc(name: 'struc1'), + Struc( + name: 'struc2', + members: [ + Member(name: 'h', type: Type.pointer(Type.handle())), + ], + ), + ], + ); +} diff --git a/pkgs/ffigen/test/native_test/config.yaml b/pkgs/ffigen/test/native_test/config.yaml index 55b0b0b53a..2b2ded28cd 100644 --- a/pkgs/ffigen/test/native_test/config.yaml +++ b/pkgs/ffigen/test/native_test/config.yaml @@ -18,4 +18,4 @@ headers: array-workaround: true # Needed for stdbool.h in MacOS -compiler-opts: '-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Headers/' +compiler-opts: '-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Headers/ -Wno-nullability-completeness' From 68e4fa0474c49bb5272eea211970fba35a9633f6 Mon Sep 17 00:00:00 2001 From: Alexander Thomas Date: Mon, 21 Dec 2020 22:24:54 +0100 Subject: [PATCH 052/276] [ffigen] Migrate to GitHub Actions (#124) --- .../ffigen/.github/workflows/test-package.yml | 64 +++++++++++++++++++ pkgs/ffigen/.travis.yml | 31 --------- pkgs/ffigen/README.md | 2 +- pkgs/ffigen/tool/travis.sh | 5 +- 4 files changed, 66 insertions(+), 36 deletions(-) create mode 100644 pkgs/ffigen/.github/workflows/test-package.yml delete mode 100644 pkgs/ffigen/.travis.yml diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml new file mode 100644 index 0000000000..c4f98d23dc --- /dev/null +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -0,0 +1,64 @@ +name: Dart CI + +on: + # Run on PRs and pushes to the default branch. + push: + branches: [ master ] + pull_request: + branches: [ master ] + schedule: + - cron: "0 0 * * 0" + +env: + PUB_ENVIRONMENT: bot.github + +jobs: + # Check code formatting and static analysis on a single OS (linux) + # against Dart stable. + analyze: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sdk: [stable] + steps: + - uses: actions/checkout@v2 + - uses: dart-lang/setup-dart@v0.1 + with: + channel: ${{ matrix.sdk }} + - id: install + name: Install dependencies + run: dart pub get + - name: Check formatting + run: dart format --output=none --set-exit-if-changed . + if: always() && steps.install.outcome == 'success' + - name: Analyze code + run: dart analyze --fatal-infos + if: always() && steps.install.outcome == 'success' + + test: + needs: analyze + # This job requires clang-10 which is the default on 20.04 + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: dart-lang/setup-dart@v0.1 + with: + channel: stable + - name: Install dependencies + run: dart pub get + - name: Install libclang-10-dev + run: sudo apt-get install libclang-10-dev + - name: Setup ffigen + run: dart pub run ffigen:setup + - name: Build test dylib + run: cd test/native_test && dart build_test_dylib.dart && cd ../.. + - name: Run VM tests + run: dart test --platform vm + - name: Collect coverage + run: ./tool/travis.sh + - name: Upload coverage + uses: coverallsapp/github-action@v1.1.2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: lcov.info diff --git a/pkgs/ffigen/.travis.yml b/pkgs/ffigen/.travis.yml deleted file mode 100644 index 6f311a4ca6..0000000000 --- a/pkgs/ffigen/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -language: dart -dart: -- stable -# Only building master means that we don't run two builds for each pull request. -dart_task: -- test: --platform vm -- dartanalyzer -- dartfmt -branches: - only: [master] -cache: - directories: - - $HOME/.pub-cache -before_install: - # Install libclang-dev. - - sudo add-apt-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main" - - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - - - sudo apt-get update - - sudo apt-get install clang-10 libclang-10-dev - # Use clang from installed llvm. - - export PATH="/usr/lib/llvm-10/bin:$PATH" - -before_script: - - 'dart pub run ffigen:setup' - - cd test/native_test && dart build_test_dylib.dart && cd ../.. - -matrix: - include: - - dart: stable - script: ./tool/travis.sh - name: Collect and report coverage. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index a48185cbe6..625acd2d00 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -1,5 +1,5 @@ [![pub package](https://img.shields.io/pub/v/ffigen.svg)](https://pub.dev/packages/ffigen) -[![Build Status](https://travis-ci.org/dart-lang/ffigen.svg?branch=master)](https://travis-ci.org/dart-lang/ffigen) +[![Build Status](https://github.com/dart-lang/ffigen/workflows/Dart%20CI/badge.svg)](https://github.com/dart-lang/ffigen/actions?query=workflow%3A"Dart+CI") [![Coverage Status](https://coveralls.io/repos/github/dart-lang/ffigen/badge.svg?branch=master)](https://coveralls.io/github/dart-lang/ffigen?branch=master) Experimental binding generator for [FFI](https://dart.dev/guides/libraries/c-interop) diff --git a/pkgs/ffigen/tool/travis.sh b/pkgs/ffigen/tool/travis.sh index 987955b1db..341aadacb2 100755 --- a/pkgs/ffigen/tool/travis.sh +++ b/pkgs/ffigen/tool/travis.sh @@ -7,13 +7,10 @@ # Fast fail the script on failures. set -e -# Gather coverage and upload to Coveralls. +# Gather coverage. pub global activate remove_from_coverage pub global activate dart_coveralls # Generate coverage report. pub global run dart_coveralls calc test/test_coverage.dart > lcov.info # Remove extra files from coverage report. pub global run remove_from_coverage -f lcov.info -r ".pub-cache" -# Upload to coveralls. -gem install coveralls-lcov -coveralls-lcov lcov.info From d98fee1a8f4c028f49e61cf4da01d06b5ae6dc0c Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Tue, 5 Jan 2021 15:59:19 +0530 Subject: [PATCH 053/276] [ffigen] Null safety migration (#122) * Migrated code to pass the null safe syntax. * Generating null safe code. --- .../ffigen/.github/workflows/test-package.yml | 16 +- pkgs/ffigen/CHANGELOG.md | 3 + pkgs/ffigen/README.md | 21 +- pkgs/ffigen/bin/ffigen.dart | 8 +- pkgs/ffigen/bin/setup.dart | 91 +- .../c_json/cjson_generated_bindings.dart | 562 ++--- pkgs/ffigen/example/c_json/main.dart | 12 +- pkgs/ffigen/example/c_json/pubspec.yaml | 4 +- .../libclang-example/generated_bindings.dart | 1032 ++++---- .../example/libclang-example/pubspec.yaml | 2 +- .../example/simple/generated_bindings.dart | 32 +- pkgs/ffigen/example/simple/pubspec.yaml | 2 +- .../lib/src/code_generator/binding.dart | 26 +- .../src/code_generator/binding_string.dart | 4 +- .../lib/src/code_generator/constant.dart | 16 +- .../lib/src/code_generator/enum_class.dart | 26 +- pkgs/ffigen/lib/src/code_generator/func.dart | 44 +- .../ffigen/lib/src/code_generator/global.dart | 14 +- .../lib/src/code_generator/library.dart | 14 +- pkgs/ffigen/lib/src/code_generator/struc.dart | 58 +- pkgs/ffigen/lib/src/code_generator/type.dart | 58 +- .../lib/src/code_generator/typedef.dart | 17 +- .../ffigen/lib/src/code_generator/writer.dart | 42 +- .../lib/src/config_provider/config.dart | 51 +- .../lib/src/config_provider/config_types.dart | 55 +- .../lib/src/config_provider/spec_utils.dart | 39 +- pkgs/ffigen/lib/src/find_resource.dart | 14 +- .../clang_bindings/clang_bindings.dart | 256 +- pkgs/ffigen/lib/src/header_parser/data.dart | 15 +- .../lib/src/header_parser/includer.dart | 18 +- pkgs/ffigen/lib/src/header_parser/parser.dart | 19 +- .../sub_parsers/enumdecl_parser.dart | 14 +- .../sub_parsers/functiondecl_parser.dart | 6 +- .../sub_parsers/macro_parser.dart | 28 +- .../sub_parsers/structdecl_parser.dart | 40 +- .../sub_parsers/typedefdecl_parser.dart | 6 +- .../translation_unit_parser.dart | 8 +- .../type_extractor/cxtypekindmap.dart | 2 +- .../type_extractor/extractor.dart | 18 +- pkgs/ffigen/lib/src/header_parser/utils.dart | 44 +- pkgs/ffigen/lib/src/strings.dart | 2 +- pkgs/ffigen/pubspec.yaml | 27 +- pkgs/ffigen/test/code_generator_test.dart | 99 +- .../header_parser_tests/dart_handle_test.dart | 2 +- .../function_n_struct_test.dart | 2 +- .../header_parser_tests/functions_test.dart | 2 +- .../test/header_parser_tests/macros_test.dart | 2 +- .../native_func_typedef_test.dart | 16 +- .../nested_parsing_test.dart | 2 +- .../header_parser_tests/typedef_test.dart | 2 +- .../unnamed_enums_test.dart | 2 +- .../_expected_cjson_bindings.dart | 562 ++--- .../_expected_libclang_bindings.dart | 1132 ++++----- .../_expected_sqlite_bindings.dart | 2157 ++++++++--------- .../test/native_test/build_test_dylib.dart | 12 +- pkgs/ffigen/test/native_test/native_test.dart | 8 +- .../native_test/native_test_bindings.dart | 107 +- .../ffigen/test/rename_tests/rename_test.dart | 2 +- pkgs/ffigen/test/test_coverage.dart | 6 + pkgs/ffigen/test/test_utils.dart | 9 +- pkgs/ffigen/tool/{travis.sh => coverage.sh} | 7 +- 61 files changed, 3197 insertions(+), 3700 deletions(-) rename pkgs/ffigen/tool/{travis.sh => coverage.sh} (55%) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index c4f98d23dc..102683409a 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -20,7 +20,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: [stable] + sdk: [beta] # TODO(127):Revert to stable when null safety reaches stable branch. steps: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v0.1 @@ -33,30 +33,30 @@ jobs: run: dart format --output=none --set-exit-if-changed . if: always() && steps.install.outcome == 'success' - name: Analyze code - run: dart analyze --fatal-infos + run: dart analyze # --fatal-infos # Removed till we stop using legacy libraries. if: always() && steps.install.outcome == 'success' test: needs: analyze # This job requires clang-10 which is the default on 20.04 - runs-on: ubuntu-20.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v0.1 with: - channel: stable + channel: beta # TODO(127):Revert to stable when null safety reaches stable branch. - name: Install dependencies - run: dart pub get + run: dart pub get - name: Install libclang-10-dev run: sudo apt-get install libclang-10-dev - name: Setup ffigen - run: dart pub run ffigen:setup + run: dart --no-sound-null-safety run ffigen:setup - name: Build test dylib run: cd test/native_test && dart build_test_dylib.dart && cd ../.. - name: Run VM tests - run: dart test --platform vm + run: dart --no-sound-null-safety test --platform vm - name: Collect coverage - run: ./tool/travis.sh + run: ./tool/coverage.sh - name: Upload coverage uses: coverallsapp/github-action@v1.1.2 with: diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index a919a1a9dc..2697d97dca 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.0.0-nullsafety.0 +- Migrated to (unsound) null safety. + # 1.2.0 - Added support for `Dart_Handle` from `dart_api.h`. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 625acd2d00..3b56033b3a 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -5,6 +5,9 @@ Experimental binding generator for [FFI](https://dart.dev/guides/libraries/c-interop) bindings. + +> Due to a few unmigrated dependencies, ffigen currently runs in unsound null safety, run using `dart --no-sound-null-safety run ffigen`. + ## Example For some header file _example.h_: @@ -27,19 +30,19 @@ class NativeLibrary { NativeLibrary(DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; int sum(int a, int b) { - _sum ??= _dylib.lookupFunction<_c_sum, _dart_sum>('sum'); - return _sum(a, b); + return (_sum ??= _dylib.lookupFunction<_c_sum, _dart_sum>('sum'))(a, b); } - _dart_sum _sum;; + + _dart_sum? _sum; } -typedef _c_sum = ffi.Int32 Function(Int32 a, Int32 b); -typedef _dart_sum = int Function(int a,int b); +typedef _c_sum = Int32 Function(Int32 a, Int32 b); +typedef _dart_sum = int Function(int a, int b); ``` ## Using this package - Add `ffigen` under `dev_dependencies` in your `pubspec.yaml`. - Setup for use (see [Setup](#Setup)). - Configurations must be provided in `pubspec.yaml` or in a custom YAML file (see [configurations](#configurations)). -- Run the tool- `pub run ffigen`. +- Run the tool- `dart run ffigen`. Jump to [FAQ](#faq). @@ -312,11 +315,11 @@ The generated code is - ```dart class CXFileUniqueID extends ffi.Struct { @ffi.Uint64() - int _unique_data_item_0; + external int _unique_data_item_0; @ffi.Uint64() - int _unique_data_item_1; + external int _unique_data_item_1; @ffi.Uint64() - int _unique_data_item_2; + external int _unique_data_item_2; /// Helper for array `data`. ArrayHelper_CXFileUniqueID_data_level0 get data => diff --git a/pkgs/ffigen/bin/ffigen.dart b/pkgs/ffigen/bin/ffigen.dart index a49040dc35..82abac5bb3 100644 --- a/pkgs/ffigen/bin/ffigen.dart +++ b/pkgs/ffigen/bin/ffigen.dart @@ -56,8 +56,8 @@ void main(List args) { // Generate file for the parsed bindings. final gen = File(config.output); library.generateFile(gen); - _logger.info( - successPen('Finished, Bindings generated in ${gen?.absolute?.path}')); + _logger + .info(successPen('Finished, Bindings generated in ${gen.absolute.path}')); } Config getConfig(ArgResults result) { @@ -87,7 +87,7 @@ Config getConfigFromPubspec() { // Throws a [YamlException] if it's unable to parse the Yaml. final bindingsConfigMap = - yaml.loadYaml(pubspecFile.readAsStringSync())[configKey] as yaml.YamlMap; + yaml.loadYaml(pubspecFile.readAsStringSync())[configKey] as yaml.YamlMap?; if (bindingsConfigMap == null) { _logger.severe("Couldn't find an entry for '$configKey' in $pubspecName."); @@ -161,7 +161,7 @@ ArgResults getArgResults(List args) { /// Sets up the logging level and printing. void setupLogger(ArgResults result) { if (result.wasParsed('verbose')) { - switch (result['verbose'] as String) { + switch (result['verbose'] as String?) { case 'all': // Logs everything, the entire AST touched by our parser. Logger.root.level = Level.ALL; diff --git a/pkgs/ffigen/bin/setup.dart b/pkgs/ffigen/bin/setup.dart index 4c7517d05a..edc79e215a 100644 --- a/pkgs/ffigen/bin/setup.dart +++ b/pkgs/ffigen/bin/setup.dart @@ -26,53 +26,46 @@ import 'dart:io'; import 'package:args/args.dart'; -import 'package:meta/meta.dart'; import 'package:ffigen/src/find_resource.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:path/path.dart' as path; -const _macOS = 'macos'; -const _windows = 'windows'; -const _linux = 'linux'; - /// Default platform options. -Map _platformOptions = { - _linux: _Options( - sharedFlag: '-shared', - inputHeader: _getWrapperPath('wrapper.c'), - fPIC: '-fpic', - ldLibFlag: '-lclang', - headerIncludes: [ - '-I/usr/lib/llvm-9/include/', - '-I/usr/lib/llvm-10/include/', - ], - ), - _windows: _Options( - sharedFlag: '-shared', - inputHeader: _getWrapperPath('wrapper.c'), - moduleDefPath: '-Wl,/DEF:${_getWrapperPath("wrapper.def")}', - ldLibFlag: '-llibclang', - headerIncludes: [ - r'-IC:\Progra~1\LLVM\include', - ], - libIncludes: [ - r'-LC:\Progra~1\LLVM\lib', - ], - ), - _macOS: _Options( - sharedFlag: '-shared', - inputHeader: _getWrapperPath('wrapper.c'), - fPIC: '-fpic', - ldLibFlag: '-lclang', - headerIncludes: [ - '-I/usr/local/opt/llvm/include/', - '-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/', - ], - libIncludes: [ - '-L/usr/local/opt/llvm/lib/', - ], - ), -}; +final _linuxOpts = _Options( + sharedFlag: '-shared', + inputHeader: _getWrapperPath('wrapper.c'), + fPIC: '-fpic', + ldLibFlag: '-lclang', + headerIncludes: [ + '-I/usr/lib/llvm-9/include/', + '-I/usr/lib/llvm-10/include/', + ], +); +final _windowsOpts = _Options( + sharedFlag: '-shared', + inputHeader: _getWrapperPath('wrapper.c'), + moduleDefPath: '-Wl,/DEF:${_getWrapperPath("wrapper.def")}', + ldLibFlag: '-llibclang', + headerIncludes: [ + r'-IC:\Progra~1\LLVM\include', + ], + libIncludes: [ + r'-LC:\Progra~1\LLVM\lib', + ], +); +final _macOSOpts = _Options( + sharedFlag: '-shared', + inputHeader: _getWrapperPath('wrapper.c'), + fPIC: '-fpic', + ldLibFlag: '-lclang', + headerIncludes: [ + '-I/usr/local/opt/llvm/include/', + '-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/', + ], + libIncludes: [ + '-L/usr/local/opt/llvm/lib/', + ], +); /// If main is called directly we always re-create the dynamic library. void main(List arguments) { @@ -140,7 +133,7 @@ String _dylibPath() { /// /// Throws error if not found. String _getWrapperPath(String wrapperName) { - final file = File.fromUri(findWrapper(wrapperName)); + final file = File.fromUri(findWrapper(wrapperName)!); if (file.existsSync()) { return file.absolute.path; } else { @@ -237,11 +230,11 @@ void _changeIncludesUsingCmdArgs(ArgResults argResult, _Options options) { /// Get options based on current platform. _Options _getPlatformOptions() { if (Platform.isMacOS) { - return _platformOptions[_macOS]; + return _macOSOpts; } else if (Platform.isWindows) { - return _platformOptions[_windows]; + return _windowsOpts; } else if (Platform.isLinux) { - return _platformOptions[_linux]; + return _linuxOpts; } else { throw Exception('Unknown Platform.'); } @@ -271,9 +264,9 @@ class _Options { final String ldLibFlag; _Options({ - @required this.sharedFlag, - @required this.inputHeader, - @required this.ldLibFlag, + required this.sharedFlag, + required this.inputHeader, + required this.ldLibFlag, this.headerIncludes = const [], this.libIncludes = const [], this.fPIC = '', diff --git a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart index ada20c001d..f71f586c35 100644 --- a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart +++ b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart @@ -32,93 +32,90 @@ class CJson { CJson(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; ffi.Pointer cJSON_Version() { - _cJSON_Version ??= _dylib - .lookupFunction<_c_cJSON_Version, _dart_cJSON_Version>('cJSON_Version'); - return _cJSON_Version(); + return (_cJSON_Version ??= + _dylib.lookupFunction<_c_cJSON_Version, _dart_cJSON_Version>( + 'cJSON_Version'))(); } - _dart_cJSON_Version _cJSON_Version; + _dart_cJSON_Version? _cJSON_Version; void cJSON_InitHooks( ffi.Pointer hooks, ) { - _cJSON_InitHooks ??= + return (_cJSON_InitHooks ??= _dylib.lookupFunction<_c_cJSON_InitHooks, _dart_cJSON_InitHooks>( - 'cJSON_InitHooks'); - return _cJSON_InitHooks( + 'cJSON_InitHooks'))( hooks, ); } - _dart_cJSON_InitHooks _cJSON_InitHooks; + _dart_cJSON_InitHooks? _cJSON_InitHooks; ffi.Pointer cJSON_Parse( ffi.Pointer value, ) { - _cJSON_Parse ??= - _dylib.lookupFunction<_c_cJSON_Parse, _dart_cJSON_Parse>('cJSON_Parse'); - return _cJSON_Parse( + return (_cJSON_Parse ??= _dylib + .lookupFunction<_c_cJSON_Parse, _dart_cJSON_Parse>('cJSON_Parse'))( value, ); } - _dart_cJSON_Parse _cJSON_Parse; + _dart_cJSON_Parse? _cJSON_Parse; ffi.Pointer cJSON_ParseWithOpts( ffi.Pointer value, ffi.Pointer> return_parse_end, int require_null_terminated, ) { - _cJSON_ParseWithOpts ??= _dylib.lookupFunction<_c_cJSON_ParseWithOpts, - _dart_cJSON_ParseWithOpts>('cJSON_ParseWithOpts'); - return _cJSON_ParseWithOpts( + return (_cJSON_ParseWithOpts ??= _dylib.lookupFunction< + _c_cJSON_ParseWithOpts, + _dart_cJSON_ParseWithOpts>('cJSON_ParseWithOpts'))( value, return_parse_end, require_null_terminated, ); } - _dart_cJSON_ParseWithOpts _cJSON_ParseWithOpts; + _dart_cJSON_ParseWithOpts? _cJSON_ParseWithOpts; ffi.Pointer cJSON_Print( ffi.Pointer item, ) { - _cJSON_Print ??= - _dylib.lookupFunction<_c_cJSON_Print, _dart_cJSON_Print>('cJSON_Print'); - return _cJSON_Print( + return (_cJSON_Print ??= _dylib + .lookupFunction<_c_cJSON_Print, _dart_cJSON_Print>('cJSON_Print'))( item, ); } - _dart_cJSON_Print _cJSON_Print; + _dart_cJSON_Print? _cJSON_Print; ffi.Pointer cJSON_PrintUnformatted( ffi.Pointer item, ) { - _cJSON_PrintUnformatted ??= _dylib.lookupFunction<_c_cJSON_PrintUnformatted, - _dart_cJSON_PrintUnformatted>('cJSON_PrintUnformatted'); - return _cJSON_PrintUnformatted( + return (_cJSON_PrintUnformatted ??= _dylib.lookupFunction< + _c_cJSON_PrintUnformatted, + _dart_cJSON_PrintUnformatted>('cJSON_PrintUnformatted'))( item, ); } - _dart_cJSON_PrintUnformatted _cJSON_PrintUnformatted; + _dart_cJSON_PrintUnformatted? _cJSON_PrintUnformatted; ffi.Pointer cJSON_PrintBuffered( ffi.Pointer item, int prebuffer, int fmt, ) { - _cJSON_PrintBuffered ??= _dylib.lookupFunction<_c_cJSON_PrintBuffered, - _dart_cJSON_PrintBuffered>('cJSON_PrintBuffered'); - return _cJSON_PrintBuffered( + return (_cJSON_PrintBuffered ??= _dylib.lookupFunction< + _c_cJSON_PrintBuffered, + _dart_cJSON_PrintBuffered>('cJSON_PrintBuffered'))( item, prebuffer, fmt, ); } - _dart_cJSON_PrintBuffered _cJSON_PrintBuffered; + _dart_cJSON_PrintBuffered? _cJSON_PrintBuffered; int cJSON_PrintPreallocated( ffi.Pointer item, @@ -126,10 +123,9 @@ class CJson { int length, int format, ) { - _cJSON_PrintPreallocated ??= _dylib.lookupFunction< + return (_cJSON_PrintPreallocated ??= _dylib.lookupFunction< _c_cJSON_PrintPreallocated, - _dart_cJSON_PrintPreallocated>('cJSON_PrintPreallocated'); - return _cJSON_PrintPreallocated( + _dart_cJSON_PrintPreallocated>('cJSON_PrintPreallocated'))( item, buffer, length, @@ -137,617 +133,581 @@ class CJson { ); } - _dart_cJSON_PrintPreallocated _cJSON_PrintPreallocated; + _dart_cJSON_PrintPreallocated? _cJSON_PrintPreallocated; void cJSON_Delete( ffi.Pointer item, ) { - _cJSON_Delete ??= _dylib - .lookupFunction<_c_cJSON_Delete, _dart_cJSON_Delete>('cJSON_Delete'); - return _cJSON_Delete( + return (_cJSON_Delete ??= _dylib + .lookupFunction<_c_cJSON_Delete, _dart_cJSON_Delete>('cJSON_Delete'))( item, ); } - _dart_cJSON_Delete _cJSON_Delete; + _dart_cJSON_Delete? _cJSON_Delete; int cJSON_GetArraySize( ffi.Pointer array, ) { - _cJSON_GetArraySize ??= + return (_cJSON_GetArraySize ??= _dylib.lookupFunction<_c_cJSON_GetArraySize, _dart_cJSON_GetArraySize>( - 'cJSON_GetArraySize'); - return _cJSON_GetArraySize( + 'cJSON_GetArraySize'))( array, ); } - _dart_cJSON_GetArraySize _cJSON_GetArraySize; + _dart_cJSON_GetArraySize? _cJSON_GetArraySize; ffi.Pointer cJSON_GetArrayItem( ffi.Pointer array, int index, ) { - _cJSON_GetArrayItem ??= + return (_cJSON_GetArrayItem ??= _dylib.lookupFunction<_c_cJSON_GetArrayItem, _dart_cJSON_GetArrayItem>( - 'cJSON_GetArrayItem'); - return _cJSON_GetArrayItem( + 'cJSON_GetArrayItem'))( array, index, ); } - _dart_cJSON_GetArrayItem _cJSON_GetArrayItem; + _dart_cJSON_GetArrayItem? _cJSON_GetArrayItem; ffi.Pointer cJSON_GetObjectItem( ffi.Pointer object, ffi.Pointer string, ) { - _cJSON_GetObjectItem ??= _dylib.lookupFunction<_c_cJSON_GetObjectItem, - _dart_cJSON_GetObjectItem>('cJSON_GetObjectItem'); - return _cJSON_GetObjectItem( + return (_cJSON_GetObjectItem ??= _dylib.lookupFunction< + _c_cJSON_GetObjectItem, + _dart_cJSON_GetObjectItem>('cJSON_GetObjectItem'))( object, string, ); } - _dart_cJSON_GetObjectItem _cJSON_GetObjectItem; + _dart_cJSON_GetObjectItem? _cJSON_GetObjectItem; ffi.Pointer cJSON_GetObjectItemCaseSensitive( ffi.Pointer object, ffi.Pointer string, ) { - _cJSON_GetObjectItemCaseSensitive ??= _dylib.lookupFunction< + return (_cJSON_GetObjectItemCaseSensitive ??= _dylib.lookupFunction< _c_cJSON_GetObjectItemCaseSensitive, _dart_cJSON_GetObjectItemCaseSensitive>( - 'cJSON_GetObjectItemCaseSensitive'); - return _cJSON_GetObjectItemCaseSensitive( + 'cJSON_GetObjectItemCaseSensitive'))( object, string, ); } - _dart_cJSON_GetObjectItemCaseSensitive _cJSON_GetObjectItemCaseSensitive; + _dart_cJSON_GetObjectItemCaseSensitive? _cJSON_GetObjectItemCaseSensitive; int cJSON_HasObjectItem( ffi.Pointer object, ffi.Pointer string, ) { - _cJSON_HasObjectItem ??= _dylib.lookupFunction<_c_cJSON_HasObjectItem, - _dart_cJSON_HasObjectItem>('cJSON_HasObjectItem'); - return _cJSON_HasObjectItem( + return (_cJSON_HasObjectItem ??= _dylib.lookupFunction< + _c_cJSON_HasObjectItem, + _dart_cJSON_HasObjectItem>('cJSON_HasObjectItem'))( object, string, ); } - _dart_cJSON_HasObjectItem _cJSON_HasObjectItem; + _dart_cJSON_HasObjectItem? _cJSON_HasObjectItem; ffi.Pointer cJSON_GetErrorPtr() { - _cJSON_GetErrorPtr ??= + return (_cJSON_GetErrorPtr ??= _dylib.lookupFunction<_c_cJSON_GetErrorPtr, _dart_cJSON_GetErrorPtr>( - 'cJSON_GetErrorPtr'); - return _cJSON_GetErrorPtr(); + 'cJSON_GetErrorPtr'))(); } - _dart_cJSON_GetErrorPtr _cJSON_GetErrorPtr; + _dart_cJSON_GetErrorPtr? _cJSON_GetErrorPtr; ffi.Pointer cJSON_GetStringValue( ffi.Pointer item, ) { - _cJSON_GetStringValue ??= _dylib.lookupFunction<_c_cJSON_GetStringValue, - _dart_cJSON_GetStringValue>('cJSON_GetStringValue'); - return _cJSON_GetStringValue( + return (_cJSON_GetStringValue ??= _dylib.lookupFunction< + _c_cJSON_GetStringValue, + _dart_cJSON_GetStringValue>('cJSON_GetStringValue'))( item, ); } - _dart_cJSON_GetStringValue _cJSON_GetStringValue; + _dart_cJSON_GetStringValue? _cJSON_GetStringValue; int cJSON_IsInvalid( ffi.Pointer item, ) { - _cJSON_IsInvalid ??= + return (_cJSON_IsInvalid ??= _dylib.lookupFunction<_c_cJSON_IsInvalid, _dart_cJSON_IsInvalid>( - 'cJSON_IsInvalid'); - return _cJSON_IsInvalid( + 'cJSON_IsInvalid'))( item, ); } - _dart_cJSON_IsInvalid _cJSON_IsInvalid; + _dart_cJSON_IsInvalid? _cJSON_IsInvalid; int cJSON_IsFalse( ffi.Pointer item, ) { - _cJSON_IsFalse ??= _dylib - .lookupFunction<_c_cJSON_IsFalse, _dart_cJSON_IsFalse>('cJSON_IsFalse'); - return _cJSON_IsFalse( + return (_cJSON_IsFalse ??= + _dylib.lookupFunction<_c_cJSON_IsFalse, _dart_cJSON_IsFalse>( + 'cJSON_IsFalse'))( item, ); } - _dart_cJSON_IsFalse _cJSON_IsFalse; + _dart_cJSON_IsFalse? _cJSON_IsFalse; int cJSON_IsTrue( ffi.Pointer item, ) { - _cJSON_IsTrue ??= _dylib - .lookupFunction<_c_cJSON_IsTrue, _dart_cJSON_IsTrue>('cJSON_IsTrue'); - return _cJSON_IsTrue( + return (_cJSON_IsTrue ??= _dylib + .lookupFunction<_c_cJSON_IsTrue, _dart_cJSON_IsTrue>('cJSON_IsTrue'))( item, ); } - _dart_cJSON_IsTrue _cJSON_IsTrue; + _dart_cJSON_IsTrue? _cJSON_IsTrue; int cJSON_IsBool( ffi.Pointer item, ) { - _cJSON_IsBool ??= _dylib - .lookupFunction<_c_cJSON_IsBool, _dart_cJSON_IsBool>('cJSON_IsBool'); - return _cJSON_IsBool( + return (_cJSON_IsBool ??= _dylib + .lookupFunction<_c_cJSON_IsBool, _dart_cJSON_IsBool>('cJSON_IsBool'))( item, ); } - _dart_cJSON_IsBool _cJSON_IsBool; + _dart_cJSON_IsBool? _cJSON_IsBool; int cJSON_IsNull( ffi.Pointer item, ) { - _cJSON_IsNull ??= _dylib - .lookupFunction<_c_cJSON_IsNull, _dart_cJSON_IsNull>('cJSON_IsNull'); - return _cJSON_IsNull( + return (_cJSON_IsNull ??= _dylib + .lookupFunction<_c_cJSON_IsNull, _dart_cJSON_IsNull>('cJSON_IsNull'))( item, ); } - _dart_cJSON_IsNull _cJSON_IsNull; + _dart_cJSON_IsNull? _cJSON_IsNull; int cJSON_IsNumber( ffi.Pointer item, ) { - _cJSON_IsNumber ??= + return (_cJSON_IsNumber ??= _dylib.lookupFunction<_c_cJSON_IsNumber, _dart_cJSON_IsNumber>( - 'cJSON_IsNumber'); - return _cJSON_IsNumber( + 'cJSON_IsNumber'))( item, ); } - _dart_cJSON_IsNumber _cJSON_IsNumber; + _dart_cJSON_IsNumber? _cJSON_IsNumber; int cJSON_IsString( ffi.Pointer item, ) { - _cJSON_IsString ??= + return (_cJSON_IsString ??= _dylib.lookupFunction<_c_cJSON_IsString, _dart_cJSON_IsString>( - 'cJSON_IsString'); - return _cJSON_IsString( + 'cJSON_IsString'))( item, ); } - _dart_cJSON_IsString _cJSON_IsString; + _dart_cJSON_IsString? _cJSON_IsString; int cJSON_IsArray( ffi.Pointer item, ) { - _cJSON_IsArray ??= _dylib - .lookupFunction<_c_cJSON_IsArray, _dart_cJSON_IsArray>('cJSON_IsArray'); - return _cJSON_IsArray( + return (_cJSON_IsArray ??= + _dylib.lookupFunction<_c_cJSON_IsArray, _dart_cJSON_IsArray>( + 'cJSON_IsArray'))( item, ); } - _dart_cJSON_IsArray _cJSON_IsArray; + _dart_cJSON_IsArray? _cJSON_IsArray; int cJSON_IsObject( ffi.Pointer item, ) { - _cJSON_IsObject ??= + return (_cJSON_IsObject ??= _dylib.lookupFunction<_c_cJSON_IsObject, _dart_cJSON_IsObject>( - 'cJSON_IsObject'); - return _cJSON_IsObject( + 'cJSON_IsObject'))( item, ); } - _dart_cJSON_IsObject _cJSON_IsObject; + _dart_cJSON_IsObject? _cJSON_IsObject; int cJSON_IsRaw( ffi.Pointer item, ) { - _cJSON_IsRaw ??= - _dylib.lookupFunction<_c_cJSON_IsRaw, _dart_cJSON_IsRaw>('cJSON_IsRaw'); - return _cJSON_IsRaw( + return (_cJSON_IsRaw ??= _dylib + .lookupFunction<_c_cJSON_IsRaw, _dart_cJSON_IsRaw>('cJSON_IsRaw'))( item, ); } - _dart_cJSON_IsRaw _cJSON_IsRaw; + _dart_cJSON_IsRaw? _cJSON_IsRaw; ffi.Pointer cJSON_CreateNull() { - _cJSON_CreateNull ??= + return (_cJSON_CreateNull ??= _dylib.lookupFunction<_c_cJSON_CreateNull, _dart_cJSON_CreateNull>( - 'cJSON_CreateNull'); - return _cJSON_CreateNull(); + 'cJSON_CreateNull'))(); } - _dart_cJSON_CreateNull _cJSON_CreateNull; + _dart_cJSON_CreateNull? _cJSON_CreateNull; ffi.Pointer cJSON_CreateTrue() { - _cJSON_CreateTrue ??= + return (_cJSON_CreateTrue ??= _dylib.lookupFunction<_c_cJSON_CreateTrue, _dart_cJSON_CreateTrue>( - 'cJSON_CreateTrue'); - return _cJSON_CreateTrue(); + 'cJSON_CreateTrue'))(); } - _dart_cJSON_CreateTrue _cJSON_CreateTrue; + _dart_cJSON_CreateTrue? _cJSON_CreateTrue; ffi.Pointer cJSON_CreateFalse() { - _cJSON_CreateFalse ??= + return (_cJSON_CreateFalse ??= _dylib.lookupFunction<_c_cJSON_CreateFalse, _dart_cJSON_CreateFalse>( - 'cJSON_CreateFalse'); - return _cJSON_CreateFalse(); + 'cJSON_CreateFalse'))(); } - _dart_cJSON_CreateFalse _cJSON_CreateFalse; + _dart_cJSON_CreateFalse? _cJSON_CreateFalse; ffi.Pointer cJSON_CreateBool( int boolean, ) { - _cJSON_CreateBool ??= + return (_cJSON_CreateBool ??= _dylib.lookupFunction<_c_cJSON_CreateBool, _dart_cJSON_CreateBool>( - 'cJSON_CreateBool'); - return _cJSON_CreateBool( + 'cJSON_CreateBool'))( boolean, ); } - _dart_cJSON_CreateBool _cJSON_CreateBool; + _dart_cJSON_CreateBool? _cJSON_CreateBool; ffi.Pointer cJSON_CreateNumber( double num, ) { - _cJSON_CreateNumber ??= + return (_cJSON_CreateNumber ??= _dylib.lookupFunction<_c_cJSON_CreateNumber, _dart_cJSON_CreateNumber>( - 'cJSON_CreateNumber'); - return _cJSON_CreateNumber( + 'cJSON_CreateNumber'))( num, ); } - _dart_cJSON_CreateNumber _cJSON_CreateNumber; + _dart_cJSON_CreateNumber? _cJSON_CreateNumber; ffi.Pointer cJSON_CreateString( ffi.Pointer string, ) { - _cJSON_CreateString ??= + return (_cJSON_CreateString ??= _dylib.lookupFunction<_c_cJSON_CreateString, _dart_cJSON_CreateString>( - 'cJSON_CreateString'); - return _cJSON_CreateString( + 'cJSON_CreateString'))( string, ); } - _dart_cJSON_CreateString _cJSON_CreateString; + _dart_cJSON_CreateString? _cJSON_CreateString; ffi.Pointer cJSON_CreateRaw( ffi.Pointer raw, ) { - _cJSON_CreateRaw ??= + return (_cJSON_CreateRaw ??= _dylib.lookupFunction<_c_cJSON_CreateRaw, _dart_cJSON_CreateRaw>( - 'cJSON_CreateRaw'); - return _cJSON_CreateRaw( + 'cJSON_CreateRaw'))( raw, ); } - _dart_cJSON_CreateRaw _cJSON_CreateRaw; + _dart_cJSON_CreateRaw? _cJSON_CreateRaw; ffi.Pointer cJSON_CreateArray() { - _cJSON_CreateArray ??= + return (_cJSON_CreateArray ??= _dylib.lookupFunction<_c_cJSON_CreateArray, _dart_cJSON_CreateArray>( - 'cJSON_CreateArray'); - return _cJSON_CreateArray(); + 'cJSON_CreateArray'))(); } - _dart_cJSON_CreateArray _cJSON_CreateArray; + _dart_cJSON_CreateArray? _cJSON_CreateArray; ffi.Pointer cJSON_CreateObject() { - _cJSON_CreateObject ??= + return (_cJSON_CreateObject ??= _dylib.lookupFunction<_c_cJSON_CreateObject, _dart_cJSON_CreateObject>( - 'cJSON_CreateObject'); - return _cJSON_CreateObject(); + 'cJSON_CreateObject'))(); } - _dart_cJSON_CreateObject _cJSON_CreateObject; + _dart_cJSON_CreateObject? _cJSON_CreateObject; ffi.Pointer cJSON_CreateStringReference( ffi.Pointer string, ) { - _cJSON_CreateStringReference ??= _dylib.lookupFunction< + return (_cJSON_CreateStringReference ??= _dylib.lookupFunction< _c_cJSON_CreateStringReference, - _dart_cJSON_CreateStringReference>('cJSON_CreateStringReference'); - return _cJSON_CreateStringReference( + _dart_cJSON_CreateStringReference>('cJSON_CreateStringReference'))( string, ); } - _dart_cJSON_CreateStringReference _cJSON_CreateStringReference; + _dart_cJSON_CreateStringReference? _cJSON_CreateStringReference; ffi.Pointer cJSON_CreateObjectReference( ffi.Pointer child, ) { - _cJSON_CreateObjectReference ??= _dylib.lookupFunction< + return (_cJSON_CreateObjectReference ??= _dylib.lookupFunction< _c_cJSON_CreateObjectReference, - _dart_cJSON_CreateObjectReference>('cJSON_CreateObjectReference'); - return _cJSON_CreateObjectReference( + _dart_cJSON_CreateObjectReference>('cJSON_CreateObjectReference'))( child, ); } - _dart_cJSON_CreateObjectReference _cJSON_CreateObjectReference; + _dart_cJSON_CreateObjectReference? _cJSON_CreateObjectReference; ffi.Pointer cJSON_CreateArrayReference( ffi.Pointer child, ) { - _cJSON_CreateArrayReference ??= _dylib.lookupFunction< + return (_cJSON_CreateArrayReference ??= _dylib.lookupFunction< _c_cJSON_CreateArrayReference, - _dart_cJSON_CreateArrayReference>('cJSON_CreateArrayReference'); - return _cJSON_CreateArrayReference( + _dart_cJSON_CreateArrayReference>('cJSON_CreateArrayReference'))( child, ); } - _dart_cJSON_CreateArrayReference _cJSON_CreateArrayReference; + _dart_cJSON_CreateArrayReference? _cJSON_CreateArrayReference; ffi.Pointer cJSON_CreateIntArray( ffi.Pointer numbers, int count, ) { - _cJSON_CreateIntArray ??= _dylib.lookupFunction<_c_cJSON_CreateIntArray, - _dart_cJSON_CreateIntArray>('cJSON_CreateIntArray'); - return _cJSON_CreateIntArray( + return (_cJSON_CreateIntArray ??= _dylib.lookupFunction< + _c_cJSON_CreateIntArray, + _dart_cJSON_CreateIntArray>('cJSON_CreateIntArray'))( numbers, count, ); } - _dart_cJSON_CreateIntArray _cJSON_CreateIntArray; + _dart_cJSON_CreateIntArray? _cJSON_CreateIntArray; ffi.Pointer cJSON_CreateFloatArray( ffi.Pointer numbers, int count, ) { - _cJSON_CreateFloatArray ??= _dylib.lookupFunction<_c_cJSON_CreateFloatArray, - _dart_cJSON_CreateFloatArray>('cJSON_CreateFloatArray'); - return _cJSON_CreateFloatArray( + return (_cJSON_CreateFloatArray ??= _dylib.lookupFunction< + _c_cJSON_CreateFloatArray, + _dart_cJSON_CreateFloatArray>('cJSON_CreateFloatArray'))( numbers, count, ); } - _dart_cJSON_CreateFloatArray _cJSON_CreateFloatArray; + _dart_cJSON_CreateFloatArray? _cJSON_CreateFloatArray; ffi.Pointer cJSON_CreateDoubleArray( ffi.Pointer numbers, int count, ) { - _cJSON_CreateDoubleArray ??= _dylib.lookupFunction< + return (_cJSON_CreateDoubleArray ??= _dylib.lookupFunction< _c_cJSON_CreateDoubleArray, - _dart_cJSON_CreateDoubleArray>('cJSON_CreateDoubleArray'); - return _cJSON_CreateDoubleArray( + _dart_cJSON_CreateDoubleArray>('cJSON_CreateDoubleArray'))( numbers, count, ); } - _dart_cJSON_CreateDoubleArray _cJSON_CreateDoubleArray; + _dart_cJSON_CreateDoubleArray? _cJSON_CreateDoubleArray; ffi.Pointer cJSON_CreateStringArray( ffi.Pointer> strings, int count, ) { - _cJSON_CreateStringArray ??= _dylib.lookupFunction< + return (_cJSON_CreateStringArray ??= _dylib.lookupFunction< _c_cJSON_CreateStringArray, - _dart_cJSON_CreateStringArray>('cJSON_CreateStringArray'); - return _cJSON_CreateStringArray( + _dart_cJSON_CreateStringArray>('cJSON_CreateStringArray'))( strings, count, ); } - _dart_cJSON_CreateStringArray _cJSON_CreateStringArray; + _dart_cJSON_CreateStringArray? _cJSON_CreateStringArray; void cJSON_AddItemToArray( ffi.Pointer array, ffi.Pointer item, ) { - _cJSON_AddItemToArray ??= _dylib.lookupFunction<_c_cJSON_AddItemToArray, - _dart_cJSON_AddItemToArray>('cJSON_AddItemToArray'); - return _cJSON_AddItemToArray( + return (_cJSON_AddItemToArray ??= _dylib.lookupFunction< + _c_cJSON_AddItemToArray, + _dart_cJSON_AddItemToArray>('cJSON_AddItemToArray'))( array, item, ); } - _dart_cJSON_AddItemToArray _cJSON_AddItemToArray; + _dart_cJSON_AddItemToArray? _cJSON_AddItemToArray; void cJSON_AddItemToObject( ffi.Pointer object, ffi.Pointer string, ffi.Pointer item, ) { - _cJSON_AddItemToObject ??= _dylib.lookupFunction<_c_cJSON_AddItemToObject, - _dart_cJSON_AddItemToObject>('cJSON_AddItemToObject'); - return _cJSON_AddItemToObject( + return (_cJSON_AddItemToObject ??= _dylib.lookupFunction< + _c_cJSON_AddItemToObject, + _dart_cJSON_AddItemToObject>('cJSON_AddItemToObject'))( object, string, item, ); } - _dart_cJSON_AddItemToObject _cJSON_AddItemToObject; + _dart_cJSON_AddItemToObject? _cJSON_AddItemToObject; void cJSON_AddItemToObjectCS( ffi.Pointer object, ffi.Pointer string, ffi.Pointer item, ) { - _cJSON_AddItemToObjectCS ??= _dylib.lookupFunction< + return (_cJSON_AddItemToObjectCS ??= _dylib.lookupFunction< _c_cJSON_AddItemToObjectCS, - _dart_cJSON_AddItemToObjectCS>('cJSON_AddItemToObjectCS'); - return _cJSON_AddItemToObjectCS( + _dart_cJSON_AddItemToObjectCS>('cJSON_AddItemToObjectCS'))( object, string, item, ); } - _dart_cJSON_AddItemToObjectCS _cJSON_AddItemToObjectCS; + _dart_cJSON_AddItemToObjectCS? _cJSON_AddItemToObjectCS; void cJSON_AddItemReferenceToArray( ffi.Pointer array, ffi.Pointer item, ) { - _cJSON_AddItemReferenceToArray ??= _dylib.lookupFunction< + return (_cJSON_AddItemReferenceToArray ??= _dylib.lookupFunction< _c_cJSON_AddItemReferenceToArray, - _dart_cJSON_AddItemReferenceToArray>('cJSON_AddItemReferenceToArray'); - return _cJSON_AddItemReferenceToArray( + _dart_cJSON_AddItemReferenceToArray>('cJSON_AddItemReferenceToArray'))( array, item, ); } - _dart_cJSON_AddItemReferenceToArray _cJSON_AddItemReferenceToArray; + _dart_cJSON_AddItemReferenceToArray? _cJSON_AddItemReferenceToArray; void cJSON_AddItemReferenceToObject( ffi.Pointer object, ffi.Pointer string, ffi.Pointer item, ) { - _cJSON_AddItemReferenceToObject ??= _dylib.lookupFunction< - _c_cJSON_AddItemReferenceToObject, - _dart_cJSON_AddItemReferenceToObject>('cJSON_AddItemReferenceToObject'); - return _cJSON_AddItemReferenceToObject( + return (_cJSON_AddItemReferenceToObject ??= _dylib.lookupFunction< + _c_cJSON_AddItemReferenceToObject, + _dart_cJSON_AddItemReferenceToObject>( + 'cJSON_AddItemReferenceToObject'))( object, string, item, ); } - _dart_cJSON_AddItemReferenceToObject _cJSON_AddItemReferenceToObject; + _dart_cJSON_AddItemReferenceToObject? _cJSON_AddItemReferenceToObject; ffi.Pointer cJSON_DetachItemViaPointer( ffi.Pointer parent, ffi.Pointer item, ) { - _cJSON_DetachItemViaPointer ??= _dylib.lookupFunction< + return (_cJSON_DetachItemViaPointer ??= _dylib.lookupFunction< _c_cJSON_DetachItemViaPointer, - _dart_cJSON_DetachItemViaPointer>('cJSON_DetachItemViaPointer'); - return _cJSON_DetachItemViaPointer( + _dart_cJSON_DetachItemViaPointer>('cJSON_DetachItemViaPointer'))( parent, item, ); } - _dart_cJSON_DetachItemViaPointer _cJSON_DetachItemViaPointer; + _dart_cJSON_DetachItemViaPointer? _cJSON_DetachItemViaPointer; ffi.Pointer cJSON_DetachItemFromArray( ffi.Pointer array, int which, ) { - _cJSON_DetachItemFromArray ??= _dylib.lookupFunction< + return (_cJSON_DetachItemFromArray ??= _dylib.lookupFunction< _c_cJSON_DetachItemFromArray, - _dart_cJSON_DetachItemFromArray>('cJSON_DetachItemFromArray'); - return _cJSON_DetachItemFromArray( + _dart_cJSON_DetachItemFromArray>('cJSON_DetachItemFromArray'))( array, which, ); } - _dart_cJSON_DetachItemFromArray _cJSON_DetachItemFromArray; + _dart_cJSON_DetachItemFromArray? _cJSON_DetachItemFromArray; void cJSON_DeleteItemFromArray( ffi.Pointer array, int which, ) { - _cJSON_DeleteItemFromArray ??= _dylib.lookupFunction< + return (_cJSON_DeleteItemFromArray ??= _dylib.lookupFunction< _c_cJSON_DeleteItemFromArray, - _dart_cJSON_DeleteItemFromArray>('cJSON_DeleteItemFromArray'); - return _cJSON_DeleteItemFromArray( + _dart_cJSON_DeleteItemFromArray>('cJSON_DeleteItemFromArray'))( array, which, ); } - _dart_cJSON_DeleteItemFromArray _cJSON_DeleteItemFromArray; + _dart_cJSON_DeleteItemFromArray? _cJSON_DeleteItemFromArray; ffi.Pointer cJSON_DetachItemFromObject( ffi.Pointer object, ffi.Pointer string, ) { - _cJSON_DetachItemFromObject ??= _dylib.lookupFunction< + return (_cJSON_DetachItemFromObject ??= _dylib.lookupFunction< _c_cJSON_DetachItemFromObject, - _dart_cJSON_DetachItemFromObject>('cJSON_DetachItemFromObject'); - return _cJSON_DetachItemFromObject( + _dart_cJSON_DetachItemFromObject>('cJSON_DetachItemFromObject'))( object, string, ); } - _dart_cJSON_DetachItemFromObject _cJSON_DetachItemFromObject; + _dart_cJSON_DetachItemFromObject? _cJSON_DetachItemFromObject; ffi.Pointer cJSON_DetachItemFromObjectCaseSensitive( ffi.Pointer object, ffi.Pointer string, ) { - _cJSON_DetachItemFromObjectCaseSensitive ??= _dylib.lookupFunction< + return (_cJSON_DetachItemFromObjectCaseSensitive ??= _dylib.lookupFunction< _c_cJSON_DetachItemFromObjectCaseSensitive, _dart_cJSON_DetachItemFromObjectCaseSensitive>( - 'cJSON_DetachItemFromObjectCaseSensitive'); - return _cJSON_DetachItemFromObjectCaseSensitive( + 'cJSON_DetachItemFromObjectCaseSensitive'))( object, string, ); } - _dart_cJSON_DetachItemFromObjectCaseSensitive + _dart_cJSON_DetachItemFromObjectCaseSensitive? _cJSON_DetachItemFromObjectCaseSensitive; void cJSON_DeleteItemFromObject( ffi.Pointer object, ffi.Pointer string, ) { - _cJSON_DeleteItemFromObject ??= _dylib.lookupFunction< + return (_cJSON_DeleteItemFromObject ??= _dylib.lookupFunction< _c_cJSON_DeleteItemFromObject, - _dart_cJSON_DeleteItemFromObject>('cJSON_DeleteItemFromObject'); - return _cJSON_DeleteItemFromObject( + _dart_cJSON_DeleteItemFromObject>('cJSON_DeleteItemFromObject'))( object, string, ); } - _dart_cJSON_DeleteItemFromObject _cJSON_DeleteItemFromObject; + _dart_cJSON_DeleteItemFromObject? _cJSON_DeleteItemFromObject; void cJSON_DeleteItemFromObjectCaseSensitive( ffi.Pointer object, ffi.Pointer string, ) { - _cJSON_DeleteItemFromObjectCaseSensitive ??= _dylib.lookupFunction< + return (_cJSON_DeleteItemFromObjectCaseSensitive ??= _dylib.lookupFunction< _c_cJSON_DeleteItemFromObjectCaseSensitive, _dart_cJSON_DeleteItemFromObjectCaseSensitive>( - 'cJSON_DeleteItemFromObjectCaseSensitive'); - return _cJSON_DeleteItemFromObjectCaseSensitive( + 'cJSON_DeleteItemFromObjectCaseSensitive'))( object, string, ); } - _dart_cJSON_DeleteItemFromObjectCaseSensitive + _dart_cJSON_DeleteItemFromObjectCaseSensitive? _cJSON_DeleteItemFromObjectCaseSensitive; void cJSON_InsertItemInArray( @@ -755,332 +715,320 @@ class CJson { int which, ffi.Pointer newitem, ) { - _cJSON_InsertItemInArray ??= _dylib.lookupFunction< + return (_cJSON_InsertItemInArray ??= _dylib.lookupFunction< _c_cJSON_InsertItemInArray, - _dart_cJSON_InsertItemInArray>('cJSON_InsertItemInArray'); - return _cJSON_InsertItemInArray( + _dart_cJSON_InsertItemInArray>('cJSON_InsertItemInArray'))( array, which, newitem, ); } - _dart_cJSON_InsertItemInArray _cJSON_InsertItemInArray; + _dart_cJSON_InsertItemInArray? _cJSON_InsertItemInArray; int cJSON_ReplaceItemViaPointer( ffi.Pointer parent, ffi.Pointer item, ffi.Pointer replacement, ) { - _cJSON_ReplaceItemViaPointer ??= _dylib.lookupFunction< + return (_cJSON_ReplaceItemViaPointer ??= _dylib.lookupFunction< _c_cJSON_ReplaceItemViaPointer, - _dart_cJSON_ReplaceItemViaPointer>('cJSON_ReplaceItemViaPointer'); - return _cJSON_ReplaceItemViaPointer( + _dart_cJSON_ReplaceItemViaPointer>('cJSON_ReplaceItemViaPointer'))( parent, item, replacement, ); } - _dart_cJSON_ReplaceItemViaPointer _cJSON_ReplaceItemViaPointer; + _dart_cJSON_ReplaceItemViaPointer? _cJSON_ReplaceItemViaPointer; void cJSON_ReplaceItemInArray( ffi.Pointer array, int which, ffi.Pointer newitem, ) { - _cJSON_ReplaceItemInArray ??= _dylib.lookupFunction< + return (_cJSON_ReplaceItemInArray ??= _dylib.lookupFunction< _c_cJSON_ReplaceItemInArray, - _dart_cJSON_ReplaceItemInArray>('cJSON_ReplaceItemInArray'); - return _cJSON_ReplaceItemInArray( + _dart_cJSON_ReplaceItemInArray>('cJSON_ReplaceItemInArray'))( array, which, newitem, ); } - _dart_cJSON_ReplaceItemInArray _cJSON_ReplaceItemInArray; + _dart_cJSON_ReplaceItemInArray? _cJSON_ReplaceItemInArray; void cJSON_ReplaceItemInObject( ffi.Pointer object, ffi.Pointer string, ffi.Pointer newitem, ) { - _cJSON_ReplaceItemInObject ??= _dylib.lookupFunction< + return (_cJSON_ReplaceItemInObject ??= _dylib.lookupFunction< _c_cJSON_ReplaceItemInObject, - _dart_cJSON_ReplaceItemInObject>('cJSON_ReplaceItemInObject'); - return _cJSON_ReplaceItemInObject( + _dart_cJSON_ReplaceItemInObject>('cJSON_ReplaceItemInObject'))( object, string, newitem, ); } - _dart_cJSON_ReplaceItemInObject _cJSON_ReplaceItemInObject; + _dart_cJSON_ReplaceItemInObject? _cJSON_ReplaceItemInObject; void cJSON_ReplaceItemInObjectCaseSensitive( ffi.Pointer object, ffi.Pointer string, ffi.Pointer newitem, ) { - _cJSON_ReplaceItemInObjectCaseSensitive ??= _dylib.lookupFunction< + return (_cJSON_ReplaceItemInObjectCaseSensitive ??= _dylib.lookupFunction< _c_cJSON_ReplaceItemInObjectCaseSensitive, _dart_cJSON_ReplaceItemInObjectCaseSensitive>( - 'cJSON_ReplaceItemInObjectCaseSensitive'); - return _cJSON_ReplaceItemInObjectCaseSensitive( + 'cJSON_ReplaceItemInObjectCaseSensitive'))( object, string, newitem, ); } - _dart_cJSON_ReplaceItemInObjectCaseSensitive + _dart_cJSON_ReplaceItemInObjectCaseSensitive? _cJSON_ReplaceItemInObjectCaseSensitive; ffi.Pointer cJSON_Duplicate( ffi.Pointer item, int recurse, ) { - _cJSON_Duplicate ??= + return (_cJSON_Duplicate ??= _dylib.lookupFunction<_c_cJSON_Duplicate, _dart_cJSON_Duplicate>( - 'cJSON_Duplicate'); - return _cJSON_Duplicate( + 'cJSON_Duplicate'))( item, recurse, ); } - _dart_cJSON_Duplicate _cJSON_Duplicate; + _dart_cJSON_Duplicate? _cJSON_Duplicate; int cJSON_Compare( ffi.Pointer a, ffi.Pointer b, int case_sensitive, ) { - _cJSON_Compare ??= _dylib - .lookupFunction<_c_cJSON_Compare, _dart_cJSON_Compare>('cJSON_Compare'); - return _cJSON_Compare( + return (_cJSON_Compare ??= + _dylib.lookupFunction<_c_cJSON_Compare, _dart_cJSON_Compare>( + 'cJSON_Compare'))( a, b, case_sensitive, ); } - _dart_cJSON_Compare _cJSON_Compare; + _dart_cJSON_Compare? _cJSON_Compare; void cJSON_Minify( ffi.Pointer json, ) { - _cJSON_Minify ??= _dylib - .lookupFunction<_c_cJSON_Minify, _dart_cJSON_Minify>('cJSON_Minify'); - return _cJSON_Minify( + return (_cJSON_Minify ??= _dylib + .lookupFunction<_c_cJSON_Minify, _dart_cJSON_Minify>('cJSON_Minify'))( json, ); } - _dart_cJSON_Minify _cJSON_Minify; + _dart_cJSON_Minify? _cJSON_Minify; ffi.Pointer cJSON_AddNullToObject( ffi.Pointer object, ffi.Pointer name, ) { - _cJSON_AddNullToObject ??= _dylib.lookupFunction<_c_cJSON_AddNullToObject, - _dart_cJSON_AddNullToObject>('cJSON_AddNullToObject'); - return _cJSON_AddNullToObject( + return (_cJSON_AddNullToObject ??= _dylib.lookupFunction< + _c_cJSON_AddNullToObject, + _dart_cJSON_AddNullToObject>('cJSON_AddNullToObject'))( object, name, ); } - _dart_cJSON_AddNullToObject _cJSON_AddNullToObject; + _dart_cJSON_AddNullToObject? _cJSON_AddNullToObject; ffi.Pointer cJSON_AddTrueToObject( ffi.Pointer object, ffi.Pointer name, ) { - _cJSON_AddTrueToObject ??= _dylib.lookupFunction<_c_cJSON_AddTrueToObject, - _dart_cJSON_AddTrueToObject>('cJSON_AddTrueToObject'); - return _cJSON_AddTrueToObject( + return (_cJSON_AddTrueToObject ??= _dylib.lookupFunction< + _c_cJSON_AddTrueToObject, + _dart_cJSON_AddTrueToObject>('cJSON_AddTrueToObject'))( object, name, ); } - _dart_cJSON_AddTrueToObject _cJSON_AddTrueToObject; + _dart_cJSON_AddTrueToObject? _cJSON_AddTrueToObject; ffi.Pointer cJSON_AddFalseToObject( ffi.Pointer object, ffi.Pointer name, ) { - _cJSON_AddFalseToObject ??= _dylib.lookupFunction<_c_cJSON_AddFalseToObject, - _dart_cJSON_AddFalseToObject>('cJSON_AddFalseToObject'); - return _cJSON_AddFalseToObject( + return (_cJSON_AddFalseToObject ??= _dylib.lookupFunction< + _c_cJSON_AddFalseToObject, + _dart_cJSON_AddFalseToObject>('cJSON_AddFalseToObject'))( object, name, ); } - _dart_cJSON_AddFalseToObject _cJSON_AddFalseToObject; + _dart_cJSON_AddFalseToObject? _cJSON_AddFalseToObject; ffi.Pointer cJSON_AddBoolToObject( ffi.Pointer object, ffi.Pointer name, int boolean, ) { - _cJSON_AddBoolToObject ??= _dylib.lookupFunction<_c_cJSON_AddBoolToObject, - _dart_cJSON_AddBoolToObject>('cJSON_AddBoolToObject'); - return _cJSON_AddBoolToObject( + return (_cJSON_AddBoolToObject ??= _dylib.lookupFunction< + _c_cJSON_AddBoolToObject, + _dart_cJSON_AddBoolToObject>('cJSON_AddBoolToObject'))( object, name, boolean, ); } - _dart_cJSON_AddBoolToObject _cJSON_AddBoolToObject; + _dart_cJSON_AddBoolToObject? _cJSON_AddBoolToObject; ffi.Pointer cJSON_AddNumberToObject( ffi.Pointer object, ffi.Pointer name, double number, ) { - _cJSON_AddNumberToObject ??= _dylib.lookupFunction< + return (_cJSON_AddNumberToObject ??= _dylib.lookupFunction< _c_cJSON_AddNumberToObject, - _dart_cJSON_AddNumberToObject>('cJSON_AddNumberToObject'); - return _cJSON_AddNumberToObject( + _dart_cJSON_AddNumberToObject>('cJSON_AddNumberToObject'))( object, name, number, ); } - _dart_cJSON_AddNumberToObject _cJSON_AddNumberToObject; + _dart_cJSON_AddNumberToObject? _cJSON_AddNumberToObject; ffi.Pointer cJSON_AddStringToObject( ffi.Pointer object, ffi.Pointer name, ffi.Pointer string, ) { - _cJSON_AddStringToObject ??= _dylib.lookupFunction< + return (_cJSON_AddStringToObject ??= _dylib.lookupFunction< _c_cJSON_AddStringToObject, - _dart_cJSON_AddStringToObject>('cJSON_AddStringToObject'); - return _cJSON_AddStringToObject( + _dart_cJSON_AddStringToObject>('cJSON_AddStringToObject'))( object, name, string, ); } - _dart_cJSON_AddStringToObject _cJSON_AddStringToObject; + _dart_cJSON_AddStringToObject? _cJSON_AddStringToObject; ffi.Pointer cJSON_AddRawToObject( ffi.Pointer object, ffi.Pointer name, ffi.Pointer raw, ) { - _cJSON_AddRawToObject ??= _dylib.lookupFunction<_c_cJSON_AddRawToObject, - _dart_cJSON_AddRawToObject>('cJSON_AddRawToObject'); - return _cJSON_AddRawToObject( + return (_cJSON_AddRawToObject ??= _dylib.lookupFunction< + _c_cJSON_AddRawToObject, + _dart_cJSON_AddRawToObject>('cJSON_AddRawToObject'))( object, name, raw, ); } - _dart_cJSON_AddRawToObject _cJSON_AddRawToObject; + _dart_cJSON_AddRawToObject? _cJSON_AddRawToObject; ffi.Pointer cJSON_AddObjectToObject( ffi.Pointer object, ffi.Pointer name, ) { - _cJSON_AddObjectToObject ??= _dylib.lookupFunction< + return (_cJSON_AddObjectToObject ??= _dylib.lookupFunction< _c_cJSON_AddObjectToObject, - _dart_cJSON_AddObjectToObject>('cJSON_AddObjectToObject'); - return _cJSON_AddObjectToObject( + _dart_cJSON_AddObjectToObject>('cJSON_AddObjectToObject'))( object, name, ); } - _dart_cJSON_AddObjectToObject _cJSON_AddObjectToObject; + _dart_cJSON_AddObjectToObject? _cJSON_AddObjectToObject; ffi.Pointer cJSON_AddArrayToObject( ffi.Pointer object, ffi.Pointer name, ) { - _cJSON_AddArrayToObject ??= _dylib.lookupFunction<_c_cJSON_AddArrayToObject, - _dart_cJSON_AddArrayToObject>('cJSON_AddArrayToObject'); - return _cJSON_AddArrayToObject( + return (_cJSON_AddArrayToObject ??= _dylib.lookupFunction< + _c_cJSON_AddArrayToObject, + _dart_cJSON_AddArrayToObject>('cJSON_AddArrayToObject'))( object, name, ); } - _dart_cJSON_AddArrayToObject _cJSON_AddArrayToObject; + _dart_cJSON_AddArrayToObject? _cJSON_AddArrayToObject; double cJSON_SetNumberHelper( ffi.Pointer object, double number, ) { - _cJSON_SetNumberHelper ??= _dylib.lookupFunction<_c_cJSON_SetNumberHelper, - _dart_cJSON_SetNumberHelper>('cJSON_SetNumberHelper'); - return _cJSON_SetNumberHelper( + return (_cJSON_SetNumberHelper ??= _dylib.lookupFunction< + _c_cJSON_SetNumberHelper, + _dart_cJSON_SetNumberHelper>('cJSON_SetNumberHelper'))( object, number, ); } - _dart_cJSON_SetNumberHelper _cJSON_SetNumberHelper; + _dart_cJSON_SetNumberHelper? _cJSON_SetNumberHelper; ffi.Pointer cJSON_malloc( int size, ) { - _cJSON_malloc ??= _dylib - .lookupFunction<_c_cJSON_malloc, _dart_cJSON_malloc>('cJSON_malloc'); - return _cJSON_malloc( + return (_cJSON_malloc ??= _dylib + .lookupFunction<_c_cJSON_malloc, _dart_cJSON_malloc>('cJSON_malloc'))( size, ); } - _dart_cJSON_malloc _cJSON_malloc; + _dart_cJSON_malloc? _cJSON_malloc; void cJSON_free( ffi.Pointer object, ) { - _cJSON_free ??= - _dylib.lookupFunction<_c_cJSON_free, _dart_cJSON_free>('cJSON_free'); - return _cJSON_free( + return (_cJSON_free ??= + _dylib.lookupFunction<_c_cJSON_free, _dart_cJSON_free>('cJSON_free'))( object, ); } - _dart_cJSON_free _cJSON_free; + _dart_cJSON_free? _cJSON_free; } class cJSON extends ffi.Struct { - ffi.Pointer next; + external ffi.Pointer next; - ffi.Pointer prev; + external ffi.Pointer prev; - ffi.Pointer child; + external ffi.Pointer child; @ffi.Int32() - int type; + external int type; - ffi.Pointer valuestring; + external ffi.Pointer valuestring; @ffi.Int32() - int valueint; + external int valueint; @ffi.Double() - double valuedouble; + external double valuedouble; - ffi.Pointer string; + external ffi.Pointer string; } class cJSON_Hooks extends ffi.Struct { - ffi.Pointer> malloc_fn; + external ffi.Pointer> malloc_fn; - ffi.Pointer> free_fn; + external ffi.Pointer> free_fn; } const int CJSON_VERSION_MAJOR = 1; diff --git a/pkgs/ffigen/example/c_json/main.dart b/pkgs/ffigen/example/c_json/main.dart index fa4bbbce81..fbd6f69f32 100644 --- a/pkgs/ffigen/example/c_json/main.dart +++ b/pkgs/ffigen/example/c_json/main.dart @@ -60,20 +60,20 @@ dynamic convertCJsonToDartObj(Pointer parsedcjson) { if (cjson.cJSON_IsObject(parsedcjson.cast()) == 1) { obj = {}; - Pointer ptr; + Pointer? ptr; ptr = parsedcjson.ref.child; while (ptr != nullptr) { - final dynamic o = convertCJsonToDartObj(ptr); + final dynamic o = convertCJsonToDartObj(ptr!); _addToObj(obj, o, ptr.ref.string.cast()); ptr = ptr.ref.next; } } else if (cjson.cJSON_IsArray(parsedcjson.cast()) == 1) { obj = []; - Pointer ptr; + Pointer? ptr; ptr = parsedcjson.ref.child; while (ptr != nullptr) { - final dynamic o = convertCJsonToDartObj(ptr); + final dynamic o = convertCJsonToDartObj(ptr!); _addToObj(obj, o); ptr = ptr.ref.next; } @@ -88,9 +88,9 @@ dynamic convertCJsonToDartObj(Pointer parsedcjson) { return obj; } -void _addToObj(dynamic obj, dynamic o, [Pointer name]) { +void _addToObj(dynamic obj, dynamic o, [Pointer? name]) { if (obj is Map) { - obj[Utf8.fromUtf8(name)] = o; + obj[Utf8.fromUtf8(name!)] = o; } else if (obj is List) { obj.add(o); } diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index 1b53211e94..dd99e63218 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -5,10 +5,10 @@ name: c_json_example environment: - sdk: '>=2.8.1 <3.0.0' + sdk: '>=2.12.0-29.10.beta <3.0.0' dependencies: - ffi: ^0.1.3 + ffi: ^0.2.0-nullsafety.1 dev_dependencies: ffigen: diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index 3b2fc26774..d694962d18 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -20,14 +20,14 @@ class LibClang { void clang_disposeStringSet( ffi.Pointer set_1, ) { - _clang_disposeStringSet ??= _dylib.lookupFunction<_c_clang_disposeStringSet, - _dart_clang_disposeStringSet>('clang_disposeStringSet'); - return _clang_disposeStringSet( + return (_clang_disposeStringSet ??= _dylib.lookupFunction< + _c_clang_disposeStringSet, + _dart_clang_disposeStringSet>('clang_disposeStringSet'))( set_1, ); } - _dart_clang_disposeStringSet _clang_disposeStringSet; + _dart_clang_disposeStringSet? _clang_disposeStringSet; /// Provides a shared context for creating translation units. /// @@ -71,16 +71,15 @@ class LibClang { int excludeDeclarationsFromPCH, int displayDiagnostics, ) { - _clang_createIndex ??= + return (_clang_createIndex ??= _dylib.lookupFunction<_c_clang_createIndex, _dart_clang_createIndex>( - 'clang_createIndex'); - return _clang_createIndex( + 'clang_createIndex'))( excludeDeclarationsFromPCH, displayDiagnostics, ); } - _dart_clang_createIndex _clang_createIndex; + _dart_clang_createIndex? _clang_createIndex; /// Destroy the given index. /// @@ -89,15 +88,14 @@ class LibClang { void clang_disposeIndex( ffi.Pointer index, ) { - _clang_disposeIndex ??= + return (_clang_disposeIndex ??= _dylib.lookupFunction<_c_clang_disposeIndex, _dart_clang_disposeIndex>( - 'clang_disposeIndex'); - return _clang_disposeIndex( + 'clang_disposeIndex'))( index, ); } - _dart_clang_disposeIndex _clang_disposeIndex; + _dart_clang_disposeIndex? _clang_disposeIndex; /// Sets general options associated with a CXIndex. /// @@ -114,16 +112,16 @@ class LibClang { ffi.Pointer arg0, int options, ) { - _clang_CXIndex_setGlobalOptions ??= _dylib.lookupFunction< - _c_clang_CXIndex_setGlobalOptions, - _dart_clang_CXIndex_setGlobalOptions>('clang_CXIndex_setGlobalOptions'); - return _clang_CXIndex_setGlobalOptions( + return (_clang_CXIndex_setGlobalOptions ??= _dylib.lookupFunction< + _c_clang_CXIndex_setGlobalOptions, + _dart_clang_CXIndex_setGlobalOptions>( + 'clang_CXIndex_setGlobalOptions'))( arg0, options, ); } - _dart_clang_CXIndex_setGlobalOptions _clang_CXIndex_setGlobalOptions; + _dart_clang_CXIndex_setGlobalOptions? _clang_CXIndex_setGlobalOptions; /// Gets the general options associated with a CXIndex. /// @@ -132,15 +130,15 @@ class LibClang { int clang_CXIndex_getGlobalOptions( ffi.Pointer arg0, ) { - _clang_CXIndex_getGlobalOptions ??= _dylib.lookupFunction< - _c_clang_CXIndex_getGlobalOptions, - _dart_clang_CXIndex_getGlobalOptions>('clang_CXIndex_getGlobalOptions'); - return _clang_CXIndex_getGlobalOptions( + return (_clang_CXIndex_getGlobalOptions ??= _dylib.lookupFunction< + _c_clang_CXIndex_getGlobalOptions, + _dart_clang_CXIndex_getGlobalOptions>( + 'clang_CXIndex_getGlobalOptions'))( arg0, ); } - _dart_clang_CXIndex_getGlobalOptions _clang_CXIndex_getGlobalOptions; + _dart_clang_CXIndex_getGlobalOptions? _clang_CXIndex_getGlobalOptions; /// Sets the invocation emission path option in a CXIndex. /// @@ -151,32 +149,30 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer Path, ) { - _clang_CXIndex_setInvocationEmissionPathOption ??= _dylib.lookupFunction< - _c_clang_CXIndex_setInvocationEmissionPathOption, - _dart_clang_CXIndex_setInvocationEmissionPathOption>( - 'clang_CXIndex_setInvocationEmissionPathOption'); - return _clang_CXIndex_setInvocationEmissionPathOption( + return (_clang_CXIndex_setInvocationEmissionPathOption ??= + _dylib.lookupFunction<_c_clang_CXIndex_setInvocationEmissionPathOption, + _dart_clang_CXIndex_setInvocationEmissionPathOption>( + 'clang_CXIndex_setInvocationEmissionPathOption'))( arg0, Path, ); } - _dart_clang_CXIndex_setInvocationEmissionPathOption + _dart_clang_CXIndex_setInvocationEmissionPathOption? _clang_CXIndex_setInvocationEmissionPathOption; /// Retrieve the last modification time of the given file. int clang_getFileTime( ffi.Pointer SFile, ) { - _clang_getFileTime ??= + return (_clang_getFileTime ??= _dylib.lookupFunction<_c_clang_getFileTime, _dart_clang_getFileTime>( - 'clang_getFileTime'); - return _clang_getFileTime( + 'clang_getFileTime'))( SFile, ); } - _dart_clang_getFileTime _clang_getFileTime; + _dart_clang_getFileTime? _clang_getFileTime; /// Retrieve the unique ID for the given \c file. /// @@ -188,15 +184,15 @@ class LibClang { ffi.Pointer file, ffi.Pointer outID, ) { - _clang_getFileUniqueID ??= _dylib.lookupFunction<_c_clang_getFileUniqueID, - _dart_clang_getFileUniqueID>('clang_getFileUniqueID'); - return _clang_getFileUniqueID( + return (_clang_getFileUniqueID ??= _dylib.lookupFunction< + _c_clang_getFileUniqueID, + _dart_clang_getFileUniqueID>('clang_getFileUniqueID'))( file, outID, ); } - _dart_clang_getFileUniqueID _clang_getFileUniqueID; + _dart_clang_getFileUniqueID? _clang_getFileUniqueID; /// Determine whether the given header is guarded against /// multiple inclusions, either with the conventional @@ -205,17 +201,16 @@ class LibClang { ffi.Pointer tu, ffi.Pointer file, ) { - _clang_isFileMultipleIncludeGuarded ??= _dylib.lookupFunction< + return (_clang_isFileMultipleIncludeGuarded ??= _dylib.lookupFunction< _c_clang_isFileMultipleIncludeGuarded, _dart_clang_isFileMultipleIncludeGuarded>( - 'clang_isFileMultipleIncludeGuarded'); - return _clang_isFileMultipleIncludeGuarded( + 'clang_isFileMultipleIncludeGuarded'))( tu, file, ); } - _dart_clang_isFileMultipleIncludeGuarded _clang_isFileMultipleIncludeGuarded; + _dart_clang_isFileMultipleIncludeGuarded? _clang_isFileMultipleIncludeGuarded; /// Retrieve a file handle within the given translation unit. /// @@ -229,15 +224,15 @@ class LibClang { ffi.Pointer tu, ffi.Pointer file_name, ) { - _clang_getFile ??= _dylib - .lookupFunction<_c_clang_getFile, _dart_clang_getFile>('clang_getFile'); - return _clang_getFile( + return (_clang_getFile ??= + _dylib.lookupFunction<_c_clang_getFile, _dart_clang_getFile>( + 'clang_getFile'))( tu, file_name, ); } - _dart_clang_getFile _clang_getFile; + _dart_clang_getFile? _clang_getFile; /// Retrieve the buffer associated with the given file. /// @@ -254,16 +249,16 @@ class LibClang { ffi.Pointer file, ffi.Pointer size, ) { - _clang_getFileContents ??= _dylib.lookupFunction<_c_clang_getFileContents, - _dart_clang_getFileContents>('clang_getFileContents'); - return _clang_getFileContents( + return (_clang_getFileContents ??= _dylib.lookupFunction< + _c_clang_getFileContents, + _dart_clang_getFileContents>('clang_getFileContents'))( tu, file, size, ); } - _dart_clang_getFileContents _clang_getFileContents; + _dart_clang_getFileContents? _clang_getFileContents; /// Returns non-zero if the \c file1 and \c file2 point to the same file, /// or they are both NULL. @@ -271,16 +266,15 @@ class LibClang { ffi.Pointer file1, ffi.Pointer file2, ) { - _clang_File_isEqual ??= + return (_clang_File_isEqual ??= _dylib.lookupFunction<_c_clang_File_isEqual, _dart_clang_File_isEqual>( - 'clang_File_isEqual'); - return _clang_File_isEqual( + 'clang_File_isEqual'))( file1, file2, ); } - _dart_clang_File_isEqual _clang_File_isEqual; + _dart_clang_File_isEqual? _clang_File_isEqual; /// Retrieve all ranges that were skipped by the preprocessor. /// @@ -290,15 +284,15 @@ class LibClang { ffi.Pointer tu, ffi.Pointer file, ) { - _clang_getSkippedRanges ??= _dylib.lookupFunction<_c_clang_getSkippedRanges, - _dart_clang_getSkippedRanges>('clang_getSkippedRanges'); - return _clang_getSkippedRanges( + return (_clang_getSkippedRanges ??= _dylib.lookupFunction< + _c_clang_getSkippedRanges, + _dart_clang_getSkippedRanges>('clang_getSkippedRanges'))( tu, file, ); } - _dart_clang_getSkippedRanges _clang_getSkippedRanges; + _dart_clang_getSkippedRanges? _clang_getSkippedRanges; /// Retrieve all ranges from all files that were skipped by the /// preprocessor. @@ -308,43 +302,40 @@ class LibClang { ffi.Pointer clang_getAllSkippedRanges( ffi.Pointer tu, ) { - _clang_getAllSkippedRanges ??= _dylib.lookupFunction< + return (_clang_getAllSkippedRanges ??= _dylib.lookupFunction< _c_clang_getAllSkippedRanges, - _dart_clang_getAllSkippedRanges>('clang_getAllSkippedRanges'); - return _clang_getAllSkippedRanges( + _dart_clang_getAllSkippedRanges>('clang_getAllSkippedRanges'))( tu, ); } - _dart_clang_getAllSkippedRanges _clang_getAllSkippedRanges; + _dart_clang_getAllSkippedRanges? _clang_getAllSkippedRanges; /// Destroy the given \c CXSourceRangeList. void clang_disposeSourceRangeList( ffi.Pointer ranges, ) { - _clang_disposeSourceRangeList ??= _dylib.lookupFunction< + return (_clang_disposeSourceRangeList ??= _dylib.lookupFunction< _c_clang_disposeSourceRangeList, - _dart_clang_disposeSourceRangeList>('clang_disposeSourceRangeList'); - return _clang_disposeSourceRangeList( + _dart_clang_disposeSourceRangeList>('clang_disposeSourceRangeList'))( ranges, ); } - _dart_clang_disposeSourceRangeList _clang_disposeSourceRangeList; + _dart_clang_disposeSourceRangeList? _clang_disposeSourceRangeList; /// Determine the number of diagnostics in a CXDiagnosticSet. int clang_getNumDiagnosticsInSet( ffi.Pointer Diags, ) { - _clang_getNumDiagnosticsInSet ??= _dylib.lookupFunction< + return (_clang_getNumDiagnosticsInSet ??= _dylib.lookupFunction< _c_clang_getNumDiagnosticsInSet, - _dart_clang_getNumDiagnosticsInSet>('clang_getNumDiagnosticsInSet'); - return _clang_getNumDiagnosticsInSet( + _dart_clang_getNumDiagnosticsInSet>('clang_getNumDiagnosticsInSet'))( Diags, ); } - _dart_clang_getNumDiagnosticsInSet _clang_getNumDiagnosticsInSet; + _dart_clang_getNumDiagnosticsInSet? _clang_getNumDiagnosticsInSet; /// Retrieve a diagnostic associated with the given CXDiagnosticSet. /// @@ -357,16 +348,15 @@ class LibClang { ffi.Pointer Diags, int Index, ) { - _clang_getDiagnosticInSet ??= _dylib.lookupFunction< + return (_clang_getDiagnosticInSet ??= _dylib.lookupFunction< _c_clang_getDiagnosticInSet, - _dart_clang_getDiagnosticInSet>('clang_getDiagnosticInSet'); - return _clang_getDiagnosticInSet( + _dart_clang_getDiagnosticInSet>('clang_getDiagnosticInSet'))( Diags, Index, ); } - _dart_clang_getDiagnosticInSet _clang_getDiagnosticInSet; + _dart_clang_getDiagnosticInSet? _clang_getDiagnosticInSet; /// Deserialize a set of diagnostics from a Clang diagnostics bitcode /// file. @@ -384,30 +374,29 @@ class LibClang { ffi.Pointer error, ffi.Pointer errorString, ) { - _clang_loadDiagnostics ??= _dylib.lookupFunction<_c_clang_loadDiagnostics, - _dart_clang_loadDiagnostics>('clang_loadDiagnostics'); - return _clang_loadDiagnostics( + return (_clang_loadDiagnostics ??= _dylib.lookupFunction< + _c_clang_loadDiagnostics, + _dart_clang_loadDiagnostics>('clang_loadDiagnostics'))( file, error, errorString, ); } - _dart_clang_loadDiagnostics _clang_loadDiagnostics; + _dart_clang_loadDiagnostics? _clang_loadDiagnostics; /// Release a CXDiagnosticSet and all of its contained diagnostics. void clang_disposeDiagnosticSet( ffi.Pointer Diags, ) { - _clang_disposeDiagnosticSet ??= _dylib.lookupFunction< + return (_clang_disposeDiagnosticSet ??= _dylib.lookupFunction< _c_clang_disposeDiagnosticSet, - _dart_clang_disposeDiagnosticSet>('clang_disposeDiagnosticSet'); - return _clang_disposeDiagnosticSet( + _dart_clang_disposeDiagnosticSet>('clang_disposeDiagnosticSet'))( Diags, ); } - _dart_clang_disposeDiagnosticSet _clang_disposeDiagnosticSet; + _dart_clang_disposeDiagnosticSet? _clang_disposeDiagnosticSet; /// Retrieve the child diagnostics of a CXDiagnostic. /// @@ -416,30 +405,28 @@ class LibClang { ffi.Pointer clang_getChildDiagnostics( ffi.Pointer D, ) { - _clang_getChildDiagnostics ??= _dylib.lookupFunction< + return (_clang_getChildDiagnostics ??= _dylib.lookupFunction< _c_clang_getChildDiagnostics, - _dart_clang_getChildDiagnostics>('clang_getChildDiagnostics'); - return _clang_getChildDiagnostics( + _dart_clang_getChildDiagnostics>('clang_getChildDiagnostics'))( D, ); } - _dart_clang_getChildDiagnostics _clang_getChildDiagnostics; + _dart_clang_getChildDiagnostics? _clang_getChildDiagnostics; /// Determine the number of diagnostics produced for the given /// translation unit. int clang_getNumDiagnostics( ffi.Pointer Unit, ) { - _clang_getNumDiagnostics ??= _dylib.lookupFunction< + return (_clang_getNumDiagnostics ??= _dylib.lookupFunction< _c_clang_getNumDiagnostics, - _dart_clang_getNumDiagnostics>('clang_getNumDiagnostics'); - return _clang_getNumDiagnostics( + _dart_clang_getNumDiagnostics>('clang_getNumDiagnostics'))( Unit, ); } - _dart_clang_getNumDiagnostics _clang_getNumDiagnostics; + _dart_clang_getNumDiagnostics? _clang_getNumDiagnostics; /// Retrieve a diagnostic associated with the given translation unit. /// @@ -452,15 +439,15 @@ class LibClang { ffi.Pointer Unit, int Index, ) { - _clang_getDiagnostic ??= _dylib.lookupFunction<_c_clang_getDiagnostic, - _dart_clang_getDiagnostic>('clang_getDiagnostic'); - return _clang_getDiagnostic( + return (_clang_getDiagnostic ??= _dylib.lookupFunction< + _c_clang_getDiagnostic, + _dart_clang_getDiagnostic>('clang_getDiagnostic'))( Unit, Index, ); } - _dart_clang_getDiagnostic _clang_getDiagnostic; + _dart_clang_getDiagnostic? _clang_getDiagnostic; /// Retrieve the complete set of diagnostics associated with a /// translation unit. @@ -469,29 +456,27 @@ class LibClang { ffi.Pointer clang_getDiagnosticSetFromTU( ffi.Pointer Unit, ) { - _clang_getDiagnosticSetFromTU ??= _dylib.lookupFunction< + return (_clang_getDiagnosticSetFromTU ??= _dylib.lookupFunction< _c_clang_getDiagnosticSetFromTU, - _dart_clang_getDiagnosticSetFromTU>('clang_getDiagnosticSetFromTU'); - return _clang_getDiagnosticSetFromTU( + _dart_clang_getDiagnosticSetFromTU>('clang_getDiagnosticSetFromTU'))( Unit, ); } - _dart_clang_getDiagnosticSetFromTU _clang_getDiagnosticSetFromTU; + _dart_clang_getDiagnosticSetFromTU? _clang_getDiagnosticSetFromTU; /// Destroy a diagnostic. void clang_disposeDiagnostic( ffi.Pointer Diagnostic, ) { - _clang_disposeDiagnostic ??= _dylib.lookupFunction< + return (_clang_disposeDiagnostic ??= _dylib.lookupFunction< _c_clang_disposeDiagnostic, - _dart_clang_disposeDiagnostic>('clang_disposeDiagnostic'); - return _clang_disposeDiagnostic( + _dart_clang_disposeDiagnostic>('clang_disposeDiagnostic'))( Diagnostic, ); } - _dart_clang_disposeDiagnostic _clang_disposeDiagnostic; + _dart_clang_disposeDiagnostic? _clang_disposeDiagnostic; /// Retrieve the set of display options most similar to the /// default behavior of the clang compiler. @@ -499,29 +484,27 @@ class LibClang { /// \returns A set of display options suitable for use with \c /// clang_formatDiagnostic(). int clang_defaultDiagnosticDisplayOptions() { - _clang_defaultDiagnosticDisplayOptions ??= _dylib.lookupFunction< + return (_clang_defaultDiagnosticDisplayOptions ??= _dylib.lookupFunction< _c_clang_defaultDiagnosticDisplayOptions, _dart_clang_defaultDiagnosticDisplayOptions>( - 'clang_defaultDiagnosticDisplayOptions'); - return _clang_defaultDiagnosticDisplayOptions(); + 'clang_defaultDiagnosticDisplayOptions'))(); } - _dart_clang_defaultDiagnosticDisplayOptions + _dart_clang_defaultDiagnosticDisplayOptions? _clang_defaultDiagnosticDisplayOptions; /// Determine the severity of the given diagnostic. int clang_getDiagnosticSeverity( ffi.Pointer arg0, ) { - _clang_getDiagnosticSeverity ??= _dylib.lookupFunction< + return (_clang_getDiagnosticSeverity ??= _dylib.lookupFunction< _c_clang_getDiagnosticSeverity, - _dart_clang_getDiagnosticSeverity>('clang_getDiagnosticSeverity'); - return _clang_getDiagnosticSeverity( + _dart_clang_getDiagnosticSeverity>('clang_getDiagnosticSeverity'))( arg0, ); } - _dart_clang_getDiagnosticSeverity _clang_getDiagnosticSeverity; + _dart_clang_getDiagnosticSeverity? _clang_getDiagnosticSeverity; /// Retrieve the category number for this diagnostic. /// @@ -534,45 +517,42 @@ class LibClang { int clang_getDiagnosticCategory( ffi.Pointer arg0, ) { - _clang_getDiagnosticCategory ??= _dylib.lookupFunction< + return (_clang_getDiagnosticCategory ??= _dylib.lookupFunction< _c_clang_getDiagnosticCategory, - _dart_clang_getDiagnosticCategory>('clang_getDiagnosticCategory'); - return _clang_getDiagnosticCategory( + _dart_clang_getDiagnosticCategory>('clang_getDiagnosticCategory'))( arg0, ); } - _dart_clang_getDiagnosticCategory _clang_getDiagnosticCategory; + _dart_clang_getDiagnosticCategory? _clang_getDiagnosticCategory; /// Determine the number of source ranges associated with the given /// diagnostic. int clang_getDiagnosticNumRanges( ffi.Pointer arg0, ) { - _clang_getDiagnosticNumRanges ??= _dylib.lookupFunction< + return (_clang_getDiagnosticNumRanges ??= _dylib.lookupFunction< _c_clang_getDiagnosticNumRanges, - _dart_clang_getDiagnosticNumRanges>('clang_getDiagnosticNumRanges'); - return _clang_getDiagnosticNumRanges( + _dart_clang_getDiagnosticNumRanges>('clang_getDiagnosticNumRanges'))( arg0, ); } - _dart_clang_getDiagnosticNumRanges _clang_getDiagnosticNumRanges; + _dart_clang_getDiagnosticNumRanges? _clang_getDiagnosticNumRanges; /// Determine the number of fix-it hints associated with the /// given diagnostic. int clang_getDiagnosticNumFixIts( ffi.Pointer Diagnostic, ) { - _clang_getDiagnosticNumFixIts ??= _dylib.lookupFunction< + return (_clang_getDiagnosticNumFixIts ??= _dylib.lookupFunction< _c_clang_getDiagnosticNumFixIts, - _dart_clang_getDiagnosticNumFixIts>('clang_getDiagnosticNumFixIts'); - return _clang_getDiagnosticNumFixIts( + _dart_clang_getDiagnosticNumFixIts>('clang_getDiagnosticNumFixIts'))( Diagnostic, ); } - _dart_clang_getDiagnosticNumFixIts _clang_getDiagnosticNumFixIts; + _dart_clang_getDiagnosticNumFixIts? _clang_getDiagnosticNumFixIts; /// Return the CXTranslationUnit for a given source file and the provided /// command line arguments one would pass to the compiler. @@ -620,11 +600,10 @@ class LibClang { int num_unsaved_files, ffi.Pointer unsaved_files, ) { - _clang_createTranslationUnitFromSourceFile ??= _dylib.lookupFunction< - _c_clang_createTranslationUnitFromSourceFile, - _dart_clang_createTranslationUnitFromSourceFile>( - 'clang_createTranslationUnitFromSourceFile'); - return _clang_createTranslationUnitFromSourceFile( + return (_clang_createTranslationUnitFromSourceFile ??= + _dylib.lookupFunction<_c_clang_createTranslationUnitFromSourceFile, + _dart_clang_createTranslationUnitFromSourceFile>( + 'clang_createTranslationUnitFromSourceFile'))( CIdx, source_filename, num_clang_command_line_args, @@ -634,7 +613,7 @@ class LibClang { ); } - _dart_clang_createTranslationUnitFromSourceFile + _dart_clang_createTranslationUnitFromSourceFile? _clang_createTranslationUnitFromSourceFile; /// Same as \c clang_createTranslationUnit2, but returns @@ -645,16 +624,15 @@ class LibClang { ffi.Pointer CIdx, ffi.Pointer ast_filename, ) { - _clang_createTranslationUnit ??= _dylib.lookupFunction< + return (_clang_createTranslationUnit ??= _dylib.lookupFunction< _c_clang_createTranslationUnit, - _dart_clang_createTranslationUnit>('clang_createTranslationUnit'); - return _clang_createTranslationUnit( + _dart_clang_createTranslationUnit>('clang_createTranslationUnit'))( CIdx, ast_filename, ); } - _dart_clang_createTranslationUnit _clang_createTranslationUnit; + _dart_clang_createTranslationUnit? _clang_createTranslationUnit; /// Create a translation unit from an AST file (\c -emit-ast). /// @@ -667,17 +645,16 @@ class LibClang { ffi.Pointer ast_filename, ffi.Pointer> out_TU, ) { - _clang_createTranslationUnit2 ??= _dylib.lookupFunction< + return (_clang_createTranslationUnit2 ??= _dylib.lookupFunction< _c_clang_createTranslationUnit2, - _dart_clang_createTranslationUnit2>('clang_createTranslationUnit2'); - return _clang_createTranslationUnit2( + _dart_clang_createTranslationUnit2>('clang_createTranslationUnit2'))( CIdx, ast_filename, out_TU, ); } - _dart_clang_createTranslationUnit2 _clang_createTranslationUnit2; + _dart_clang_createTranslationUnit2? _clang_createTranslationUnit2; /// Returns the set of flags that is suitable for parsing a translation /// unit that is being edited. @@ -690,14 +667,13 @@ class LibClang { /// preamble) geared toward improving the performance of these routines. The /// set of optimizations enabled may change from one version to the next. int clang_defaultEditingTranslationUnitOptions() { - _clang_defaultEditingTranslationUnitOptions ??= _dylib.lookupFunction< - _c_clang_defaultEditingTranslationUnitOptions, - _dart_clang_defaultEditingTranslationUnitOptions>( - 'clang_defaultEditingTranslationUnitOptions'); - return _clang_defaultEditingTranslationUnitOptions(); + return (_clang_defaultEditingTranslationUnitOptions ??= + _dylib.lookupFunction<_c_clang_defaultEditingTranslationUnitOptions, + _dart_clang_defaultEditingTranslationUnitOptions>( + 'clang_defaultEditingTranslationUnitOptions'))(); } - _dart_clang_defaultEditingTranslationUnitOptions + _dart_clang_defaultEditingTranslationUnitOptions? _clang_defaultEditingTranslationUnitOptions; /// Same as \c clang_parseTranslationUnit2, but returns @@ -713,10 +689,9 @@ class LibClang { int num_unsaved_files, int options, ) { - _clang_parseTranslationUnit ??= _dylib.lookupFunction< + return (_clang_parseTranslationUnit ??= _dylib.lookupFunction< _c_clang_parseTranslationUnit, - _dart_clang_parseTranslationUnit>('clang_parseTranslationUnit'); - return _clang_parseTranslationUnit( + _dart_clang_parseTranslationUnit>('clang_parseTranslationUnit'))( CIdx, source_filename, command_line_args, @@ -727,7 +702,7 @@ class LibClang { ); } - _dart_clang_parseTranslationUnit _clang_parseTranslationUnit; + _dart_clang_parseTranslationUnit? _clang_parseTranslationUnit; /// Parse the given source file and the translation unit corresponding /// to that file. @@ -781,10 +756,9 @@ class LibClang { int options, ffi.Pointer> out_TU, ) { - _clang_parseTranslationUnit2 ??= _dylib.lookupFunction< + return (_clang_parseTranslationUnit2 ??= _dylib.lookupFunction< _c_clang_parseTranslationUnit2, - _dart_clang_parseTranslationUnit2>('clang_parseTranslationUnit2'); - return _clang_parseTranslationUnit2( + _dart_clang_parseTranslationUnit2>('clang_parseTranslationUnit2'))( CIdx, source_filename, command_line_args, @@ -796,7 +770,7 @@ class LibClang { ); } - _dart_clang_parseTranslationUnit2 _clang_parseTranslationUnit2; + _dart_clang_parseTranslationUnit2? _clang_parseTranslationUnit2; /// Same as clang_parseTranslationUnit2 but requires a full command line /// for \c command_line_args including argv[0]. This is useful if the standard @@ -811,11 +785,10 @@ class LibClang { int options, ffi.Pointer> out_TU, ) { - _clang_parseTranslationUnit2FullArgv ??= _dylib.lookupFunction< + return (_clang_parseTranslationUnit2FullArgv ??= _dylib.lookupFunction< _c_clang_parseTranslationUnit2FullArgv, _dart_clang_parseTranslationUnit2FullArgv>( - 'clang_parseTranslationUnit2FullArgv'); - return _clang_parseTranslationUnit2FullArgv( + 'clang_parseTranslationUnit2FullArgv'))( CIdx, source_filename, command_line_args, @@ -827,7 +800,7 @@ class LibClang { ); } - _dart_clang_parseTranslationUnit2FullArgv + _dart_clang_parseTranslationUnit2FullArgv? _clang_parseTranslationUnit2FullArgv; /// Returns the set of flags that is suitable for saving a translation @@ -840,15 +813,14 @@ class LibClang { int clang_defaultSaveOptions( ffi.Pointer TU, ) { - _clang_defaultSaveOptions ??= _dylib.lookupFunction< + return (_clang_defaultSaveOptions ??= _dylib.lookupFunction< _c_clang_defaultSaveOptions, - _dart_clang_defaultSaveOptions>('clang_defaultSaveOptions'); - return _clang_defaultSaveOptions( + _dart_clang_defaultSaveOptions>('clang_defaultSaveOptions'))( TU, ); } - _dart_clang_defaultSaveOptions _clang_defaultSaveOptions; + _dart_clang_defaultSaveOptions? _clang_defaultSaveOptions; /// Saves a translation unit into a serialized representation of /// that translation unit on disk. @@ -876,17 +848,16 @@ class LibClang { ffi.Pointer FileName, int options, ) { - _clang_saveTranslationUnit ??= _dylib.lookupFunction< + return (_clang_saveTranslationUnit ??= _dylib.lookupFunction< _c_clang_saveTranslationUnit, - _dart_clang_saveTranslationUnit>('clang_saveTranslationUnit'); - return _clang_saveTranslationUnit( + _dart_clang_saveTranslationUnit>('clang_saveTranslationUnit'))( TU, FileName, options, ); } - _dart_clang_saveTranslationUnit _clang_saveTranslationUnit; + _dart_clang_saveTranslationUnit? _clang_saveTranslationUnit; /// Suspend a translation unit in order to free memory associated with it. /// @@ -896,29 +867,27 @@ class LibClang { int clang_suspendTranslationUnit( ffi.Pointer arg0, ) { - _clang_suspendTranslationUnit ??= _dylib.lookupFunction< + return (_clang_suspendTranslationUnit ??= _dylib.lookupFunction< _c_clang_suspendTranslationUnit, - _dart_clang_suspendTranslationUnit>('clang_suspendTranslationUnit'); - return _clang_suspendTranslationUnit( + _dart_clang_suspendTranslationUnit>('clang_suspendTranslationUnit'))( arg0, ); } - _dart_clang_suspendTranslationUnit _clang_suspendTranslationUnit; + _dart_clang_suspendTranslationUnit? _clang_suspendTranslationUnit; /// Destroy the specified CXTranslationUnit object. void clang_disposeTranslationUnit( ffi.Pointer arg0, ) { - _clang_disposeTranslationUnit ??= _dylib.lookupFunction< + return (_clang_disposeTranslationUnit ??= _dylib.lookupFunction< _c_clang_disposeTranslationUnit, - _dart_clang_disposeTranslationUnit>('clang_disposeTranslationUnit'); - return _clang_disposeTranslationUnit( + _dart_clang_disposeTranslationUnit>('clang_disposeTranslationUnit'))( arg0, ); } - _dart_clang_disposeTranslationUnit _clang_disposeTranslationUnit; + _dart_clang_disposeTranslationUnit? _clang_disposeTranslationUnit; /// Returns the set of flags that is suitable for reparsing a translation /// unit. @@ -931,15 +900,14 @@ class LibClang { int clang_defaultReparseOptions( ffi.Pointer TU, ) { - _clang_defaultReparseOptions ??= _dylib.lookupFunction< + return (_clang_defaultReparseOptions ??= _dylib.lookupFunction< _c_clang_defaultReparseOptions, - _dart_clang_defaultReparseOptions>('clang_defaultReparseOptions'); - return _clang_defaultReparseOptions( + _dart_clang_defaultReparseOptions>('clang_defaultReparseOptions'))( TU, ); } - _dart_clang_defaultReparseOptions _clang_defaultReparseOptions; + _dart_clang_defaultReparseOptions? _clang_defaultReparseOptions; /// Reparse the source files that produced this translation unit. /// @@ -984,10 +952,9 @@ class LibClang { ffi.Pointer unsaved_files, int options, ) { - _clang_reparseTranslationUnit ??= _dylib.lookupFunction< + return (_clang_reparseTranslationUnit ??= _dylib.lookupFunction< _c_clang_reparseTranslationUnit, - _dart_clang_reparseTranslationUnit>('clang_reparseTranslationUnit'); - return _clang_reparseTranslationUnit( + _dart_clang_reparseTranslationUnit>('clang_reparseTranslationUnit'))( TU, num_unsaved_files, unsaved_files, @@ -995,22 +962,21 @@ class LibClang { ); } - _dart_clang_reparseTranslationUnit _clang_reparseTranslationUnit; + _dart_clang_reparseTranslationUnit? _clang_reparseTranslationUnit; /// Returns the human-readable null-terminated C string that represents /// the name of the memory category. This string should never be freed. ffi.Pointer clang_getTUResourceUsageName( int kind, ) { - _clang_getTUResourceUsageName ??= _dylib.lookupFunction< + return (_clang_getTUResourceUsageName ??= _dylib.lookupFunction< _c_clang_getTUResourceUsageName, - _dart_clang_getTUResourceUsageName>('clang_getTUResourceUsageName'); - return _clang_getTUResourceUsageName( + _dart_clang_getTUResourceUsageName>('clang_getTUResourceUsageName'))( kind, ); } - _dart_clang_getTUResourceUsageName _clang_getTUResourceUsageName; + _dart_clang_getTUResourceUsageName? _clang_getTUResourceUsageName; /// Get target information for this translation unit. /// @@ -1018,30 +984,28 @@ class LibClang { ffi.Pointer clang_getTranslationUnitTargetInfo( ffi.Pointer CTUnit, ) { - _clang_getTranslationUnitTargetInfo ??= _dylib.lookupFunction< + return (_clang_getTranslationUnitTargetInfo ??= _dylib.lookupFunction< _c_clang_getTranslationUnitTargetInfo, _dart_clang_getTranslationUnitTargetInfo>( - 'clang_getTranslationUnitTargetInfo'); - return _clang_getTranslationUnitTargetInfo( + 'clang_getTranslationUnitTargetInfo'))( CTUnit, ); } - _dart_clang_getTranslationUnitTargetInfo _clang_getTranslationUnitTargetInfo; + _dart_clang_getTranslationUnitTargetInfo? _clang_getTranslationUnitTargetInfo; /// Destroy the CXTargetInfo object. void clang_TargetInfo_dispose( ffi.Pointer Info, ) { - _clang_TargetInfo_dispose ??= _dylib.lookupFunction< + return (_clang_TargetInfo_dispose ??= _dylib.lookupFunction< _c_clang_TargetInfo_dispose, - _dart_clang_TargetInfo_dispose>('clang_TargetInfo_dispose'); - return _clang_TargetInfo_dispose( + _dart_clang_TargetInfo_dispose>('clang_TargetInfo_dispose'))( Info, ); } - _dart_clang_TargetInfo_dispose _clang_TargetInfo_dispose; + _dart_clang_TargetInfo_dispose? _clang_TargetInfo_dispose; /// Get the pointer width of the target in bits. /// @@ -1049,29 +1013,28 @@ class LibClang { int clang_TargetInfo_getPointerWidth( ffi.Pointer Info, ) { - _clang_TargetInfo_getPointerWidth ??= _dylib.lookupFunction< + return (_clang_TargetInfo_getPointerWidth ??= _dylib.lookupFunction< _c_clang_TargetInfo_getPointerWidth, _dart_clang_TargetInfo_getPointerWidth>( - 'clang_TargetInfo_getPointerWidth'); - return _clang_TargetInfo_getPointerWidth( + 'clang_TargetInfo_getPointerWidth'))( Info, ); } - _dart_clang_TargetInfo_getPointerWidth _clang_TargetInfo_getPointerWidth; + _dart_clang_TargetInfo_getPointerWidth? _clang_TargetInfo_getPointerWidth; /// Determine whether the given cursor kind represents a declaration. int clang_isDeclaration( int arg0, ) { - _clang_isDeclaration ??= _dylib.lookupFunction<_c_clang_isDeclaration, - _dart_clang_isDeclaration>('clang_isDeclaration'); - return _clang_isDeclaration( + return (_clang_isDeclaration ??= _dylib.lookupFunction< + _c_clang_isDeclaration, + _dart_clang_isDeclaration>('clang_isDeclaration'))( arg0, ); } - _dart_clang_isDeclaration _clang_isDeclaration; + _dart_clang_isDeclaration? _clang_isDeclaration; /// Determine whether the given cursor kind represents a simple /// reference. @@ -1082,188 +1045,177 @@ class LibClang { int clang_isReference( int arg0, ) { - _clang_isReference ??= + return (_clang_isReference ??= _dylib.lookupFunction<_c_clang_isReference, _dart_clang_isReference>( - 'clang_isReference'); - return _clang_isReference( + 'clang_isReference'))( arg0, ); } - _dart_clang_isReference _clang_isReference; + _dart_clang_isReference? _clang_isReference; /// Determine whether the given cursor kind represents an expression. int clang_isExpression( int arg0, ) { - _clang_isExpression ??= + return (_clang_isExpression ??= _dylib.lookupFunction<_c_clang_isExpression, _dart_clang_isExpression>( - 'clang_isExpression'); - return _clang_isExpression( + 'clang_isExpression'))( arg0, ); } - _dart_clang_isExpression _clang_isExpression; + _dart_clang_isExpression? _clang_isExpression; /// Determine whether the given cursor kind represents a statement. int clang_isStatement( int arg0, ) { - _clang_isStatement ??= + return (_clang_isStatement ??= _dylib.lookupFunction<_c_clang_isStatement, _dart_clang_isStatement>( - 'clang_isStatement'); - return _clang_isStatement( + 'clang_isStatement'))( arg0, ); } - _dart_clang_isStatement _clang_isStatement; + _dart_clang_isStatement? _clang_isStatement; /// Determine whether the given cursor kind represents an attribute. int clang_isAttribute( int arg0, ) { - _clang_isAttribute ??= + return (_clang_isAttribute ??= _dylib.lookupFunction<_c_clang_isAttribute, _dart_clang_isAttribute>( - 'clang_isAttribute'); - return _clang_isAttribute( + 'clang_isAttribute'))( arg0, ); } - _dart_clang_isAttribute _clang_isAttribute; + _dart_clang_isAttribute? _clang_isAttribute; /// Determine whether the given cursor kind represents an invalid /// cursor. int clang_isInvalid( int arg0, ) { - _clang_isInvalid ??= + return (_clang_isInvalid ??= _dylib.lookupFunction<_c_clang_isInvalid, _dart_clang_isInvalid>( - 'clang_isInvalid'); - return _clang_isInvalid( + 'clang_isInvalid'))( arg0, ); } - _dart_clang_isInvalid _clang_isInvalid; + _dart_clang_isInvalid? _clang_isInvalid; /// Determine whether the given cursor kind represents a translation /// unit. int clang_isTranslationUnit( int arg0, ) { - _clang_isTranslationUnit ??= _dylib.lookupFunction< + return (_clang_isTranslationUnit ??= _dylib.lookupFunction< _c_clang_isTranslationUnit, - _dart_clang_isTranslationUnit>('clang_isTranslationUnit'); - return _clang_isTranslationUnit( + _dart_clang_isTranslationUnit>('clang_isTranslationUnit'))( arg0, ); } - _dart_clang_isTranslationUnit _clang_isTranslationUnit; + _dart_clang_isTranslationUnit? _clang_isTranslationUnit; /// Determine whether the given cursor represents a preprocessing /// element, such as a preprocessor directive or macro instantiation. int clang_isPreprocessing( int arg0, ) { - _clang_isPreprocessing ??= _dylib.lookupFunction<_c_clang_isPreprocessing, - _dart_clang_isPreprocessing>('clang_isPreprocessing'); - return _clang_isPreprocessing( + return (_clang_isPreprocessing ??= _dylib.lookupFunction< + _c_clang_isPreprocessing, + _dart_clang_isPreprocessing>('clang_isPreprocessing'))( arg0, ); } - _dart_clang_isPreprocessing _clang_isPreprocessing; + _dart_clang_isPreprocessing? _clang_isPreprocessing; /// Determine whether the given cursor represents a currently /// unexposed piece of the AST (e.g., CXCursor_UnexposedStmt). int clang_isUnexposed( int arg0, ) { - _clang_isUnexposed ??= + return (_clang_isUnexposed ??= _dylib.lookupFunction<_c_clang_isUnexposed, _dart_clang_isUnexposed>( - 'clang_isUnexposed'); - return _clang_isUnexposed( + 'clang_isUnexposed'))( arg0, ); } - _dart_clang_isUnexposed _clang_isUnexposed; + _dart_clang_isUnexposed? _clang_isUnexposed; /// Free the memory associated with a \c CXPlatformAvailability structure. void clang_disposeCXPlatformAvailability( ffi.Pointer availability, ) { - _clang_disposeCXPlatformAvailability ??= _dylib.lookupFunction< + return (_clang_disposeCXPlatformAvailability ??= _dylib.lookupFunction< _c_clang_disposeCXPlatformAvailability, _dart_clang_disposeCXPlatformAvailability>( - 'clang_disposeCXPlatformAvailability'); - return _clang_disposeCXPlatformAvailability( + 'clang_disposeCXPlatformAvailability'))( availability, ); } - _dart_clang_disposeCXPlatformAvailability + _dart_clang_disposeCXPlatformAvailability? _clang_disposeCXPlatformAvailability; /// Creates an empty CXCursorSet. ffi.Pointer clang_createCXCursorSet() { - _clang_createCXCursorSet ??= _dylib.lookupFunction< + return (_clang_createCXCursorSet ??= _dylib.lookupFunction< _c_clang_createCXCursorSet, - _dart_clang_createCXCursorSet>('clang_createCXCursorSet'); - return _clang_createCXCursorSet(); + _dart_clang_createCXCursorSet>('clang_createCXCursorSet'))(); } - _dart_clang_createCXCursorSet _clang_createCXCursorSet; + _dart_clang_createCXCursorSet? _clang_createCXCursorSet; /// Disposes a CXCursorSet and releases its associated memory. void clang_disposeCXCursorSet( ffi.Pointer cset, ) { - _clang_disposeCXCursorSet ??= _dylib.lookupFunction< + return (_clang_disposeCXCursorSet ??= _dylib.lookupFunction< _c_clang_disposeCXCursorSet, - _dart_clang_disposeCXCursorSet>('clang_disposeCXCursorSet'); - return _clang_disposeCXCursorSet( + _dart_clang_disposeCXCursorSet>('clang_disposeCXCursorSet'))( cset, ); } - _dart_clang_disposeCXCursorSet _clang_disposeCXCursorSet; + _dart_clang_disposeCXCursorSet? _clang_disposeCXCursorSet; /// Free the set of overridden cursors returned by \c /// clang_getOverriddenCursors(). void clang_disposeOverriddenCursors( ffi.Pointer overridden, ) { - _clang_disposeOverriddenCursors ??= _dylib.lookupFunction< - _c_clang_disposeOverriddenCursors, - _dart_clang_disposeOverriddenCursors>('clang_disposeOverriddenCursors'); - return _clang_disposeOverriddenCursors( + return (_clang_disposeOverriddenCursors ??= _dylib.lookupFunction< + _c_clang_disposeOverriddenCursors, + _dart_clang_disposeOverriddenCursors>( + 'clang_disposeOverriddenCursors'))( overridden, ); } - _dart_clang_disposeOverriddenCursors _clang_disposeOverriddenCursors; + _dart_clang_disposeOverriddenCursors? _clang_disposeOverriddenCursors; /// Get a property value for the given printing policy. int clang_PrintingPolicy_getProperty( ffi.Pointer Policy, int Property, ) { - _clang_PrintingPolicy_getProperty ??= _dylib.lookupFunction< + return (_clang_PrintingPolicy_getProperty ??= _dylib.lookupFunction< _c_clang_PrintingPolicy_getProperty, _dart_clang_PrintingPolicy_getProperty>( - 'clang_PrintingPolicy_getProperty'); - return _clang_PrintingPolicy_getProperty( + 'clang_PrintingPolicy_getProperty'))( Policy, Property, ); } - _dart_clang_PrintingPolicy_getProperty _clang_PrintingPolicy_getProperty; + _dart_clang_PrintingPolicy_getProperty? _clang_PrintingPolicy_getProperty; /// Set a property value for the given printing policy. void clang_PrintingPolicy_setProperty( @@ -1271,32 +1223,30 @@ class LibClang { int Property, int Value, ) { - _clang_PrintingPolicy_setProperty ??= _dylib.lookupFunction< + return (_clang_PrintingPolicy_setProperty ??= _dylib.lookupFunction< _c_clang_PrintingPolicy_setProperty, _dart_clang_PrintingPolicy_setProperty>( - 'clang_PrintingPolicy_setProperty'); - return _clang_PrintingPolicy_setProperty( + 'clang_PrintingPolicy_setProperty'))( Policy, Property, Value, ); } - _dart_clang_PrintingPolicy_setProperty _clang_PrintingPolicy_setProperty; + _dart_clang_PrintingPolicy_setProperty? _clang_PrintingPolicy_setProperty; /// Release a printing policy. void clang_PrintingPolicy_dispose( ffi.Pointer Policy, ) { - _clang_PrintingPolicy_dispose ??= _dylib.lookupFunction< + return (_clang_PrintingPolicy_dispose ??= _dylib.lookupFunction< _c_clang_PrintingPolicy_dispose, - _dart_clang_PrintingPolicy_dispose>('clang_PrintingPolicy_dispose'); - return _clang_PrintingPolicy_dispose( + _dart_clang_PrintingPolicy_dispose>('clang_PrintingPolicy_dispose'))( Policy, ); } - _dart_clang_PrintingPolicy_dispose _clang_PrintingPolicy_dispose; + _dart_clang_PrintingPolicy_dispose? _clang_PrintingPolicy_dispose; /// Given a CXFile header file, return the module that contains it, if one /// exists. @@ -1304,15 +1254,15 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer arg1, ) { - _clang_getModuleForFile ??= _dylib.lookupFunction<_c_clang_getModuleForFile, - _dart_clang_getModuleForFile>('clang_getModuleForFile'); - return _clang_getModuleForFile( + return (_clang_getModuleForFile ??= _dylib.lookupFunction< + _c_clang_getModuleForFile, + _dart_clang_getModuleForFile>('clang_getModuleForFile'))( arg0, arg1, ); } - _dart_clang_getModuleForFile _clang_getModuleForFile; + _dart_clang_getModuleForFile? _clang_getModuleForFile; /// \param Module a module object. /// @@ -1320,15 +1270,14 @@ class LibClang { ffi.Pointer clang_Module_getASTFile( ffi.Pointer Module, ) { - _clang_Module_getASTFile ??= _dylib.lookupFunction< + return (_clang_Module_getASTFile ??= _dylib.lookupFunction< _c_clang_Module_getASTFile, - _dart_clang_Module_getASTFile>('clang_Module_getASTFile'); - return _clang_Module_getASTFile( + _dart_clang_Module_getASTFile>('clang_Module_getASTFile'))( Module, ); } - _dart_clang_Module_getASTFile _clang_Module_getASTFile; + _dart_clang_Module_getASTFile? _clang_Module_getASTFile; /// \param Module a module object. /// @@ -1337,14 +1286,14 @@ class LibClang { ffi.Pointer clang_Module_getParent( ffi.Pointer Module, ) { - _clang_Module_getParent ??= _dylib.lookupFunction<_c_clang_Module_getParent, - _dart_clang_Module_getParent>('clang_Module_getParent'); - return _clang_Module_getParent( + 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; + _dart_clang_Module_getParent? _clang_Module_getParent; /// \param Module a module object. /// @@ -1352,14 +1301,14 @@ class LibClang { int clang_Module_isSystem( ffi.Pointer Module, ) { - _clang_Module_isSystem ??= _dylib.lookupFunction<_c_clang_Module_isSystem, - _dart_clang_Module_isSystem>('clang_Module_isSystem'); - return _clang_Module_isSystem( + 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; + _dart_clang_Module_isSystem? _clang_Module_isSystem; /// \param Module a module object. /// @@ -1368,17 +1317,16 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer Module, ) { - _clang_Module_getNumTopLevelHeaders ??= _dylib.lookupFunction< + return (_clang_Module_getNumTopLevelHeaders ??= _dylib.lookupFunction< _c_clang_Module_getNumTopLevelHeaders, _dart_clang_Module_getNumTopLevelHeaders>( - 'clang_Module_getNumTopLevelHeaders'); - return _clang_Module_getNumTopLevelHeaders( + 'clang_Module_getNumTopLevelHeaders'))( arg0, Module, ); } - _dart_clang_Module_getNumTopLevelHeaders _clang_Module_getNumTopLevelHeaders; + _dart_clang_Module_getNumTopLevelHeaders? _clang_Module_getNumTopLevelHeaders; /// \param Module a module object. /// @@ -1390,17 +1338,17 @@ class LibClang { ffi.Pointer Module, int Index, ) { - _clang_Module_getTopLevelHeader ??= _dylib.lookupFunction< - _c_clang_Module_getTopLevelHeader, - _dart_clang_Module_getTopLevelHeader>('clang_Module_getTopLevelHeader'); - return _clang_Module_getTopLevelHeader( + 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; + _dart_clang_Module_getTopLevelHeader? _clang_Module_getTopLevelHeader; /// 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. @@ -1436,9 +1384,9 @@ class LibClang { int NumTokens, ffi.Pointer Cursors, ) { - _clang_annotateTokens ??= _dylib.lookupFunction<_c_clang_annotateTokens, - _dart_clang_annotateTokens>('clang_annotateTokens'); - return _clang_annotateTokens( + return (_clang_annotateTokens ??= _dylib.lookupFunction< + _c_clang_annotateTokens, + _dart_clang_annotateTokens>('clang_annotateTokens'))( TU, Tokens, NumTokens, @@ -1446,7 +1394,7 @@ class LibClang { ); } - _dart_clang_annotateTokens _clang_annotateTokens; + _dart_clang_annotateTokens? _clang_annotateTokens; /// Free the given set of tokens. void clang_disposeTokens( @@ -1454,41 +1402,40 @@ class LibClang { ffi.Pointer Tokens, int NumTokens, ) { - _clang_disposeTokens ??= _dylib.lookupFunction<_c_clang_disposeTokens, - _dart_clang_disposeTokens>('clang_disposeTokens'); - return _clang_disposeTokens( + return (_clang_disposeTokens ??= _dylib.lookupFunction< + _c_clang_disposeTokens, + _dart_clang_disposeTokens>('clang_disposeTokens'))( TU, Tokens, NumTokens, ); } - _dart_clang_disposeTokens _clang_disposeTokens; + _dart_clang_disposeTokens? _clang_disposeTokens; void clang_enableStackTraces() { - _clang_enableStackTraces ??= _dylib.lookupFunction< + return (_clang_enableStackTraces ??= _dylib.lookupFunction< _c_clang_enableStackTraces, - _dart_clang_enableStackTraces>('clang_enableStackTraces'); - return _clang_enableStackTraces(); + _dart_clang_enableStackTraces>('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, ) { - _clang_executeOnThread ??= _dylib.lookupFunction<_c_clang_executeOnThread, - _dart_clang_executeOnThread>('clang_executeOnThread'); - return _clang_executeOnThread( + return (_clang_executeOnThread ??= _dylib.lookupFunction< + _c_clang_executeOnThread, + _dart_clang_executeOnThread>('clang_executeOnThread'))( fn, user_data, stack_size, ); } - _dart_clang_executeOnThread _clang_executeOnThread; + _dart_clang_executeOnThread? _clang_executeOnThread; /// Determine the kind of a particular chunk within a completion string. /// @@ -1501,16 +1448,15 @@ class LibClang { ffi.Pointer completion_string, int chunk_number, ) { - _clang_getCompletionChunkKind ??= _dylib.lookupFunction< + return (_clang_getCompletionChunkKind ??= _dylib.lookupFunction< _c_clang_getCompletionChunkKind, - _dart_clang_getCompletionChunkKind>('clang_getCompletionChunkKind'); - return _clang_getCompletionChunkKind( + _dart_clang_getCompletionChunkKind>('clang_getCompletionChunkKind'))( completion_string, chunk_number, ); } - _dart_clang_getCompletionChunkKind _clang_getCompletionChunkKind; + _dart_clang_getCompletionChunkKind? _clang_getCompletionChunkKind; /// Retrieve the completion string associated with a particular chunk /// within a completion string. @@ -1525,32 +1471,30 @@ class LibClang { ffi.Pointer completion_string, int chunk_number, ) { - _clang_getCompletionChunkCompletionString ??= _dylib.lookupFunction< + return (_clang_getCompletionChunkCompletionString ??= _dylib.lookupFunction< _c_clang_getCompletionChunkCompletionString, _dart_clang_getCompletionChunkCompletionString>( - 'clang_getCompletionChunkCompletionString'); - return _clang_getCompletionChunkCompletionString( + 'clang_getCompletionChunkCompletionString'))( completion_string, chunk_number, ); } - _dart_clang_getCompletionChunkCompletionString + _dart_clang_getCompletionChunkCompletionString? _clang_getCompletionChunkCompletionString; /// Retrieve the number of chunks in the given code-completion string. int clang_getNumCompletionChunks( ffi.Pointer completion_string, ) { - _clang_getNumCompletionChunks ??= _dylib.lookupFunction< + return (_clang_getNumCompletionChunks ??= _dylib.lookupFunction< _c_clang_getNumCompletionChunks, - _dart_clang_getNumCompletionChunks>('clang_getNumCompletionChunks'); - return _clang_getNumCompletionChunks( + _dart_clang_getNumCompletionChunks>('clang_getNumCompletionChunks'))( completion_string, ); } - _dart_clang_getNumCompletionChunks _clang_getNumCompletionChunks; + _dart_clang_getNumCompletionChunks? _clang_getNumCompletionChunks; /// Determine the priority of this code completion. /// @@ -1565,15 +1509,14 @@ class LibClang { int clang_getCompletionPriority( ffi.Pointer completion_string, ) { - _clang_getCompletionPriority ??= _dylib.lookupFunction< + return (_clang_getCompletionPriority ??= _dylib.lookupFunction< _c_clang_getCompletionPriority, - _dart_clang_getCompletionPriority>('clang_getCompletionPriority'); - return _clang_getCompletionPriority( + _dart_clang_getCompletionPriority>('clang_getCompletionPriority'))( completion_string, ); } - _dart_clang_getCompletionPriority _clang_getCompletionPriority; + _dart_clang_getCompletionPriority? _clang_getCompletionPriority; /// Determine the availability of the entity that this code-completion /// string refers to. @@ -1584,16 +1527,15 @@ class LibClang { int clang_getCompletionAvailability( ffi.Pointer completion_string, ) { - _clang_getCompletionAvailability ??= _dylib.lookupFunction< + return (_clang_getCompletionAvailability ??= _dylib.lookupFunction< _c_clang_getCompletionAvailability, _dart_clang_getCompletionAvailability>( - 'clang_getCompletionAvailability'); - return _clang_getCompletionAvailability( + 'clang_getCompletionAvailability'))( completion_string, ); } - _dart_clang_getCompletionAvailability _clang_getCompletionAvailability; + _dart_clang_getCompletionAvailability? _clang_getCompletionAvailability; /// Retrieve the number of annotations associated with the given /// completion string. @@ -1605,16 +1547,15 @@ class LibClang { int clang_getCompletionNumAnnotations( ffi.Pointer completion_string, ) { - _clang_getCompletionNumAnnotations ??= _dylib.lookupFunction< + return (_clang_getCompletionNumAnnotations ??= _dylib.lookupFunction< _c_clang_getCompletionNumAnnotations, _dart_clang_getCompletionNumAnnotations>( - 'clang_getCompletionNumAnnotations'); - return _clang_getCompletionNumAnnotations( + 'clang_getCompletionNumAnnotations'))( completion_string, ); } - _dart_clang_getCompletionNumAnnotations _clang_getCompletionNumAnnotations; + _dart_clang_getCompletionNumAnnotations? _clang_getCompletionNumAnnotations; /// Retrieve the number of fix-its for the given completion index. /// @@ -1631,28 +1572,26 @@ class LibClang { ffi.Pointer results, int completion_index, ) { - _clang_getCompletionNumFixIts ??= _dylib.lookupFunction< + return (_clang_getCompletionNumFixIts ??= _dylib.lookupFunction< _c_clang_getCompletionNumFixIts, - _dart_clang_getCompletionNumFixIts>('clang_getCompletionNumFixIts'); - return _clang_getCompletionNumFixIts( + _dart_clang_getCompletionNumFixIts>('clang_getCompletionNumFixIts'))( results, completion_index, ); } - _dart_clang_getCompletionNumFixIts _clang_getCompletionNumFixIts; + _dart_clang_getCompletionNumFixIts? _clang_getCompletionNumFixIts; /// Returns a default set of code-completion options that can be /// passed to\c clang_codeCompleteAt(). int clang_defaultCodeCompleteOptions() { - _clang_defaultCodeCompleteOptions ??= _dylib.lookupFunction< + return (_clang_defaultCodeCompleteOptions ??= _dylib.lookupFunction< _c_clang_defaultCodeCompleteOptions, _dart_clang_defaultCodeCompleteOptions>( - 'clang_defaultCodeCompleteOptions'); - return _clang_defaultCodeCompleteOptions(); + 'clang_defaultCodeCompleteOptions'))(); } - _dart_clang_defaultCodeCompleteOptions _clang_defaultCodeCompleteOptions; + _dart_clang_defaultCodeCompleteOptions? _clang_defaultCodeCompleteOptions; /// Perform code completion at a given location in a translation unit. /// @@ -1729,9 +1668,9 @@ class LibClang { int num_unsaved_files, int options, ) { - _clang_codeCompleteAt ??= _dylib.lookupFunction<_c_clang_codeCompleteAt, - _dart_clang_codeCompleteAt>('clang_codeCompleteAt'); - return _clang_codeCompleteAt( + return (_clang_codeCompleteAt ??= _dylib.lookupFunction< + _c_clang_codeCompleteAt, + _dart_clang_codeCompleteAt>('clang_codeCompleteAt'))( TU, complete_filename, complete_line, @@ -1742,7 +1681,7 @@ class LibClang { ); } - _dart_clang_codeCompleteAt _clang_codeCompleteAt; + _dart_clang_codeCompleteAt? _clang_codeCompleteAt; /// Sort the code-completion results in case-insensitive alphabetical /// order. @@ -1753,48 +1692,45 @@ class LibClang { ffi.Pointer Results, int NumResults, ) { - _clang_sortCodeCompletionResults ??= _dylib.lookupFunction< + return (_clang_sortCodeCompletionResults ??= _dylib.lookupFunction< _c_clang_sortCodeCompletionResults, _dart_clang_sortCodeCompletionResults>( - 'clang_sortCodeCompletionResults'); - return _clang_sortCodeCompletionResults( + 'clang_sortCodeCompletionResults'))( Results, NumResults, ); } - _dart_clang_sortCodeCompletionResults _clang_sortCodeCompletionResults; + _dart_clang_sortCodeCompletionResults? _clang_sortCodeCompletionResults; /// Free the given set of code-completion results. void clang_disposeCodeCompleteResults( ffi.Pointer Results, ) { - _clang_disposeCodeCompleteResults ??= _dylib.lookupFunction< + return (_clang_disposeCodeCompleteResults ??= _dylib.lookupFunction< _c_clang_disposeCodeCompleteResults, _dart_clang_disposeCodeCompleteResults>( - 'clang_disposeCodeCompleteResults'); - return _clang_disposeCodeCompleteResults( + 'clang_disposeCodeCompleteResults'))( Results, ); } - _dart_clang_disposeCodeCompleteResults _clang_disposeCodeCompleteResults; + _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, ) { - _clang_codeCompleteGetNumDiagnostics ??= _dylib.lookupFunction< + return (_clang_codeCompleteGetNumDiagnostics ??= _dylib.lookupFunction< _c_clang_codeCompleteGetNumDiagnostics, _dart_clang_codeCompleteGetNumDiagnostics>( - 'clang_codeCompleteGetNumDiagnostics'); - return _clang_codeCompleteGetNumDiagnostics( + 'clang_codeCompleteGetNumDiagnostics'))( Results, ); } - _dart_clang_codeCompleteGetNumDiagnostics + _dart_clang_codeCompleteGetNumDiagnostics? _clang_codeCompleteGetNumDiagnostics; /// Retrieve a diagnostic associated with the given code completion. @@ -1808,17 +1744,16 @@ class LibClang { ffi.Pointer Results, int Index, ) { - _clang_codeCompleteGetDiagnostic ??= _dylib.lookupFunction< + return (_clang_codeCompleteGetDiagnostic ??= _dylib.lookupFunction< _c_clang_codeCompleteGetDiagnostic, _dart_clang_codeCompleteGetDiagnostic>( - 'clang_codeCompleteGetDiagnostic'); - return _clang_codeCompleteGetDiagnostic( + 'clang_codeCompleteGetDiagnostic'))( Results, Index, ); } - _dart_clang_codeCompleteGetDiagnostic _clang_codeCompleteGetDiagnostic; + _dart_clang_codeCompleteGetDiagnostic? _clang_codeCompleteGetDiagnostic; /// Determines what completions are appropriate for the context /// the given code completion. @@ -1830,15 +1765,14 @@ class LibClang { int clang_codeCompleteGetContexts( ffi.Pointer Results, ) { - _clang_codeCompleteGetContexts ??= _dylib.lookupFunction< + return (_clang_codeCompleteGetContexts ??= _dylib.lookupFunction< _c_clang_codeCompleteGetContexts, - _dart_clang_codeCompleteGetContexts>('clang_codeCompleteGetContexts'); - return _clang_codeCompleteGetContexts( + _dart_clang_codeCompleteGetContexts>('clang_codeCompleteGetContexts'))( Results, ); } - _dart_clang_codeCompleteGetContexts _clang_codeCompleteGetContexts; + _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 @@ -1858,17 +1792,16 @@ class LibClang { ffi.Pointer Results, ffi.Pointer IsIncomplete, ) { - _clang_codeCompleteGetContainerKind ??= _dylib.lookupFunction< + return (_clang_codeCompleteGetContainerKind ??= _dylib.lookupFunction< _c_clang_codeCompleteGetContainerKind, _dart_clang_codeCompleteGetContainerKind>( - 'clang_codeCompleteGetContainerKind'); - return _clang_codeCompleteGetContainerKind( + 'clang_codeCompleteGetContainerKind'))( Results, IsIncomplete, ); } - _dart_clang_codeCompleteGetContainerKind _clang_codeCompleteGetContainerKind; + _dart_clang_codeCompleteGetContainerKind? _clang_codeCompleteGetContainerKind; /// Enable/disable crash recovery. /// @@ -1877,15 +1810,14 @@ class LibClang { void clang_toggleCrashRecovery( int isEnabled, ) { - _clang_toggleCrashRecovery ??= _dylib.lookupFunction< + return (_clang_toggleCrashRecovery ??= _dylib.lookupFunction< _c_clang_toggleCrashRecovery, - _dart_clang_toggleCrashRecovery>('clang_toggleCrashRecovery'); - return _clang_toggleCrashRecovery( + _dart_clang_toggleCrashRecovery>('clang_toggleCrashRecovery'))( isEnabled, ); } - _dart_clang_toggleCrashRecovery _clang_toggleCrashRecovery; + _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 @@ -1896,45 +1828,43 @@ class LibClang { ffi.Pointer> visitor, ffi.Pointer client_data, ) { - _clang_getInclusions ??= _dylib.lookupFunction<_c_clang_getInclusions, - _dart_clang_getInclusions>('clang_getInclusions'); - return _clang_getInclusions( + return (_clang_getInclusions ??= _dylib.lookupFunction< + _c_clang_getInclusions, + _dart_clang_getInclusions>('clang_getInclusions'))( tu, visitor, client_data, ); } - _dart_clang_getInclusions _clang_getInclusions; + _dart_clang_getInclusions? _clang_getInclusions; /// Returns the kind of the evaluated result. int clang_EvalResult_getKind( ffi.Pointer E, ) { - _clang_EvalResult_getKind ??= _dylib.lookupFunction< + return (_clang_EvalResult_getKind ??= _dylib.lookupFunction< _c_clang_EvalResult_getKind, - _dart_clang_EvalResult_getKind>('clang_EvalResult_getKind'); - return _clang_EvalResult_getKind( + _dart_clang_EvalResult_getKind>('clang_EvalResult_getKind'))( E, ); } - _dart_clang_EvalResult_getKind _clang_EvalResult_getKind; + _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, ) { - _clang_EvalResult_getAsInt ??= _dylib.lookupFunction< + return (_clang_EvalResult_getAsInt ??= _dylib.lookupFunction< _c_clang_EvalResult_getAsInt, - _dart_clang_EvalResult_getAsInt>('clang_EvalResult_getAsInt'); - return _clang_EvalResult_getAsInt( + _dart_clang_EvalResult_getAsInt>('clang_EvalResult_getAsInt'))( E, ); } - _dart_clang_EvalResult_getAsInt _clang_EvalResult_getAsInt; + _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 @@ -1942,60 +1872,59 @@ class LibClang { int clang_EvalResult_getAsLongLong( ffi.Pointer E, ) { - _clang_EvalResult_getAsLongLong ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsLongLong, - _dart_clang_EvalResult_getAsLongLong>('clang_EvalResult_getAsLongLong'); - return _clang_EvalResult_getAsLongLong( + 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; + _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, ) { - _clang_EvalResult_isUnsignedInt ??= _dylib.lookupFunction< - _c_clang_EvalResult_isUnsignedInt, - _dart_clang_EvalResult_isUnsignedInt>('clang_EvalResult_isUnsignedInt'); - return _clang_EvalResult_isUnsignedInt( + 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; + _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, ) { - _clang_EvalResult_getAsUnsigned ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsUnsigned, - _dart_clang_EvalResult_getAsUnsigned>('clang_EvalResult_getAsUnsigned'); - return _clang_EvalResult_getAsUnsigned( + 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; + _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, ) { - _clang_EvalResult_getAsDouble ??= _dylib.lookupFunction< + return (_clang_EvalResult_getAsDouble ??= _dylib.lookupFunction< _c_clang_EvalResult_getAsDouble, - _dart_clang_EvalResult_getAsDouble>('clang_EvalResult_getAsDouble'); - return _clang_EvalResult_getAsDouble( + _dart_clang_EvalResult_getAsDouble>('clang_EvalResult_getAsDouble'))( E, ); } - _dart_clang_EvalResult_getAsDouble _clang_EvalResult_getAsDouble; + _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, @@ -2004,29 +1933,27 @@ class LibClang { ffi.Pointer clang_EvalResult_getAsStr( ffi.Pointer E, ) { - _clang_EvalResult_getAsStr ??= _dylib.lookupFunction< + return (_clang_EvalResult_getAsStr ??= _dylib.lookupFunction< _c_clang_EvalResult_getAsStr, - _dart_clang_EvalResult_getAsStr>('clang_EvalResult_getAsStr'); - return _clang_EvalResult_getAsStr( + _dart_clang_EvalResult_getAsStr>('clang_EvalResult_getAsStr'))( E, ); } - _dart_clang_EvalResult_getAsStr _clang_EvalResult_getAsStr; + _dart_clang_EvalResult_getAsStr? _clang_EvalResult_getAsStr; /// Disposes the created Eval memory. void clang_EvalResult_dispose( ffi.Pointer E, ) { - _clang_EvalResult_dispose ??= _dylib.lookupFunction< + return (_clang_EvalResult_dispose ??= _dylib.lookupFunction< _c_clang_EvalResult_dispose, - _dart_clang_EvalResult_dispose>('clang_EvalResult_dispose'); - return _clang_EvalResult_dispose( + _dart_clang_EvalResult_dispose>('clang_EvalResult_dispose'))( E, ); } - _dart_clang_EvalResult_dispose _clang_EvalResult_dispose; + _dart_clang_EvalResult_dispose? _clang_EvalResult_dispose; /// Retrieve a remapping. /// @@ -2037,14 +1964,14 @@ class LibClang { ffi.Pointer clang_getRemappings( ffi.Pointer path, ) { - _clang_getRemappings ??= _dylib.lookupFunction<_c_clang_getRemappings, - _dart_clang_getRemappings>('clang_getRemappings'); - return _clang_getRemappings( + return (_clang_getRemappings ??= _dylib.lookupFunction< + _c_clang_getRemappings, + _dart_clang_getRemappings>('clang_getRemappings'))( path, ); } - _dart_clang_getRemappings _clang_getRemappings; + _dart_clang_getRemappings? _clang_getRemappings; /// Retrieve a remapping. /// @@ -2058,31 +1985,29 @@ class LibClang { ffi.Pointer> filePaths, int numFiles, ) { - _clang_getRemappingsFromFileList ??= _dylib.lookupFunction< + return (_clang_getRemappingsFromFileList ??= _dylib.lookupFunction< _c_clang_getRemappingsFromFileList, _dart_clang_getRemappingsFromFileList>( - 'clang_getRemappingsFromFileList'); - return _clang_getRemappingsFromFileList( + 'clang_getRemappingsFromFileList'))( filePaths, numFiles, ); } - _dart_clang_getRemappingsFromFileList _clang_getRemappingsFromFileList; + _dart_clang_getRemappingsFromFileList? _clang_getRemappingsFromFileList; /// Determine the number of remappings. int clang_remap_getNumFiles( ffi.Pointer arg0, ) { - _clang_remap_getNumFiles ??= _dylib.lookupFunction< + return (_clang_remap_getNumFiles ??= _dylib.lookupFunction< _c_clang_remap_getNumFiles, - _dart_clang_remap_getNumFiles>('clang_remap_getNumFiles'); - return _clang_remap_getNumFiles( + _dart_clang_remap_getNumFiles>('clang_remap_getNumFiles'))( arg0, ); } - _dart_clang_remap_getNumFiles _clang_remap_getNumFiles; + _dart_clang_remap_getNumFiles? _clang_remap_getNumFiles; /// Get the original and the associated filename from the remapping. /// @@ -2096,10 +2021,9 @@ class LibClang { ffi.Pointer original, ffi.Pointer transformed, ) { - _clang_remap_getFilenames ??= _dylib.lookupFunction< + return (_clang_remap_getFilenames ??= _dylib.lookupFunction< _c_clang_remap_getFilenames, - _dart_clang_remap_getFilenames>('clang_remap_getFilenames'); - return _clang_remap_getFilenames( + _dart_clang_remap_getFilenames>('clang_remap_getFilenames'))( arg0, index, original, @@ -2107,156 +2031,148 @@ class LibClang { ); } - _dart_clang_remap_getFilenames _clang_remap_getFilenames; + _dart_clang_remap_getFilenames? _clang_remap_getFilenames; /// Dispose the remapping. void clang_remap_dispose( ffi.Pointer arg0, ) { - _clang_remap_dispose ??= _dylib.lookupFunction<_c_clang_remap_dispose, - _dart_clang_remap_dispose>('clang_remap_dispose'); - return _clang_remap_dispose( + 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; + _dart_clang_remap_dispose? _clang_remap_dispose; int clang_index_isEntityObjCContainerKind( int arg0, ) { - _clang_index_isEntityObjCContainerKind ??= _dylib.lookupFunction< + return (_clang_index_isEntityObjCContainerKind ??= _dylib.lookupFunction< _c_clang_index_isEntityObjCContainerKind, _dart_clang_index_isEntityObjCContainerKind>( - 'clang_index_isEntityObjCContainerKind'); - return _clang_index_isEntityObjCContainerKind( + 'clang_index_isEntityObjCContainerKind'))( arg0, ); } - _dart_clang_index_isEntityObjCContainerKind + _dart_clang_index_isEntityObjCContainerKind? _clang_index_isEntityObjCContainerKind; ffi.Pointer clang_index_getObjCContainerDeclInfo( ffi.Pointer arg0, ) { - _clang_index_getObjCContainerDeclInfo ??= _dylib.lookupFunction< + return (_clang_index_getObjCContainerDeclInfo ??= _dylib.lookupFunction< _c_clang_index_getObjCContainerDeclInfo, _dart_clang_index_getObjCContainerDeclInfo>( - 'clang_index_getObjCContainerDeclInfo'); - return _clang_index_getObjCContainerDeclInfo( + 'clang_index_getObjCContainerDeclInfo'))( arg0, ); } - _dart_clang_index_getObjCContainerDeclInfo + _dart_clang_index_getObjCContainerDeclInfo? _clang_index_getObjCContainerDeclInfo; ffi.Pointer clang_index_getObjCInterfaceDeclInfo( ffi.Pointer arg0, ) { - _clang_index_getObjCInterfaceDeclInfo ??= _dylib.lookupFunction< + return (_clang_index_getObjCInterfaceDeclInfo ??= _dylib.lookupFunction< _c_clang_index_getObjCInterfaceDeclInfo, _dart_clang_index_getObjCInterfaceDeclInfo>( - 'clang_index_getObjCInterfaceDeclInfo'); - return _clang_index_getObjCInterfaceDeclInfo( + 'clang_index_getObjCInterfaceDeclInfo'))( arg0, ); } - _dart_clang_index_getObjCInterfaceDeclInfo + _dart_clang_index_getObjCInterfaceDeclInfo? _clang_index_getObjCInterfaceDeclInfo; ffi.Pointer clang_index_getObjCCategoryDeclInfo( ffi.Pointer arg0, ) { - _clang_index_getObjCCategoryDeclInfo ??= _dylib.lookupFunction< + return (_clang_index_getObjCCategoryDeclInfo ??= _dylib.lookupFunction< _c_clang_index_getObjCCategoryDeclInfo, _dart_clang_index_getObjCCategoryDeclInfo>( - 'clang_index_getObjCCategoryDeclInfo'); - return _clang_index_getObjCCategoryDeclInfo( + 'clang_index_getObjCCategoryDeclInfo'))( arg0, ); } - _dart_clang_index_getObjCCategoryDeclInfo + _dart_clang_index_getObjCCategoryDeclInfo? _clang_index_getObjCCategoryDeclInfo; ffi.Pointer clang_index_getObjCProtocolRefListInfo( ffi.Pointer arg0, ) { - _clang_index_getObjCProtocolRefListInfo ??= _dylib.lookupFunction< + return (_clang_index_getObjCProtocolRefListInfo ??= _dylib.lookupFunction< _c_clang_index_getObjCProtocolRefListInfo, _dart_clang_index_getObjCProtocolRefListInfo>( - 'clang_index_getObjCProtocolRefListInfo'); - return _clang_index_getObjCProtocolRefListInfo( + 'clang_index_getObjCProtocolRefListInfo'))( arg0, ); } - _dart_clang_index_getObjCProtocolRefListInfo + _dart_clang_index_getObjCProtocolRefListInfo? _clang_index_getObjCProtocolRefListInfo; ffi.Pointer clang_index_getObjCPropertyDeclInfo( ffi.Pointer arg0, ) { - _clang_index_getObjCPropertyDeclInfo ??= _dylib.lookupFunction< + return (_clang_index_getObjCPropertyDeclInfo ??= _dylib.lookupFunction< _c_clang_index_getObjCPropertyDeclInfo, _dart_clang_index_getObjCPropertyDeclInfo>( - 'clang_index_getObjCPropertyDeclInfo'); - return _clang_index_getObjCPropertyDeclInfo( + 'clang_index_getObjCPropertyDeclInfo'))( arg0, ); } - _dart_clang_index_getObjCPropertyDeclInfo + _dart_clang_index_getObjCPropertyDeclInfo? _clang_index_getObjCPropertyDeclInfo; ffi.Pointer clang_index_getIBOutletCollectionAttrInfo( ffi.Pointer arg0, ) { - _clang_index_getIBOutletCollectionAttrInfo ??= _dylib.lookupFunction< - _c_clang_index_getIBOutletCollectionAttrInfo, - _dart_clang_index_getIBOutletCollectionAttrInfo>( - 'clang_index_getIBOutletCollectionAttrInfo'); - return _clang_index_getIBOutletCollectionAttrInfo( + return (_clang_index_getIBOutletCollectionAttrInfo ??= + _dylib.lookupFunction<_c_clang_index_getIBOutletCollectionAttrInfo, + _dart_clang_index_getIBOutletCollectionAttrInfo>( + 'clang_index_getIBOutletCollectionAttrInfo'))( arg0, ); } - _dart_clang_index_getIBOutletCollectionAttrInfo + _dart_clang_index_getIBOutletCollectionAttrInfo? _clang_index_getIBOutletCollectionAttrInfo; ffi.Pointer clang_index_getCXXClassDeclInfo( ffi.Pointer arg0, ) { - _clang_index_getCXXClassDeclInfo ??= _dylib.lookupFunction< + return (_clang_index_getCXXClassDeclInfo ??= _dylib.lookupFunction< _c_clang_index_getCXXClassDeclInfo, _dart_clang_index_getCXXClassDeclInfo>( - 'clang_index_getCXXClassDeclInfo'); - return _clang_index_getCXXClassDeclInfo( + 'clang_index_getCXXClassDeclInfo'))( arg0, ); } - _dart_clang_index_getCXXClassDeclInfo _clang_index_getCXXClassDeclInfo; + _dart_clang_index_getCXXClassDeclInfo? _clang_index_getCXXClassDeclInfo; /// For retrieving a custom CXIdxClientContainer attached to a /// container. ffi.Pointer clang_index_getClientContainer( ffi.Pointer arg0, ) { - _clang_index_getClientContainer ??= _dylib.lookupFunction< - _c_clang_index_getClientContainer, - _dart_clang_index_getClientContainer>('clang_index_getClientContainer'); - return _clang_index_getClientContainer( + 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; + _dart_clang_index_getClientContainer? _clang_index_getClientContainer; /// For setting a custom CXIdxClientContainer attached to a /// container. @@ -2264,46 +2180,44 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer arg1, ) { - _clang_index_setClientContainer ??= _dylib.lookupFunction< - _c_clang_index_setClientContainer, - _dart_clang_index_setClientContainer>('clang_index_setClientContainer'); - return _clang_index_setClientContainer( + 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; + _dart_clang_index_setClientContainer? _clang_index_setClientContainer; /// For retrieving a custom CXIdxClientEntity attached to an entity. ffi.Pointer clang_index_getClientEntity( ffi.Pointer arg0, ) { - _clang_index_getClientEntity ??= _dylib.lookupFunction< + return (_clang_index_getClientEntity ??= _dylib.lookupFunction< _c_clang_index_getClientEntity, - _dart_clang_index_getClientEntity>('clang_index_getClientEntity'); - return _clang_index_getClientEntity( + _dart_clang_index_getClientEntity>('clang_index_getClientEntity'))( arg0, ); } - _dart_clang_index_getClientEntity _clang_index_getClientEntity; + _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, ) { - _clang_index_setClientEntity ??= _dylib.lookupFunction< + return (_clang_index_setClientEntity ??= _dylib.lookupFunction< _c_clang_index_setClientEntity, - _dart_clang_index_setClientEntity>('clang_index_setClientEntity'); - return _clang_index_setClientEntity( + _dart_clang_index_setClientEntity>('clang_index_setClientEntity'))( arg0, arg1, ); } - _dart_clang_index_setClientEntity _clang_index_setClientEntity; + _dart_clang_index_setClientEntity? _clang_index_setClientEntity; /// An indexing action/session, to be applied to one or multiple /// translation units. @@ -2312,15 +2226,14 @@ class LibClang { ffi.Pointer clang_IndexAction_create( ffi.Pointer CIdx, ) { - _clang_IndexAction_create ??= _dylib.lookupFunction< + return (_clang_IndexAction_create ??= _dylib.lookupFunction< _c_clang_IndexAction_create, - _dart_clang_IndexAction_create>('clang_IndexAction_create'); - return _clang_IndexAction_create( + _dart_clang_IndexAction_create>('clang_IndexAction_create'))( CIdx, ); } - _dart_clang_IndexAction_create _clang_IndexAction_create; + _dart_clang_IndexAction_create? _clang_IndexAction_create; /// Destroy the given index action. /// @@ -2329,15 +2242,14 @@ class LibClang { void clang_IndexAction_dispose( ffi.Pointer arg0, ) { - _clang_IndexAction_dispose ??= _dylib.lookupFunction< + return (_clang_IndexAction_dispose ??= _dylib.lookupFunction< _c_clang_IndexAction_dispose, - _dart_clang_IndexAction_dispose>('clang_IndexAction_dispose'); - return _clang_IndexAction_dispose( + _dart_clang_IndexAction_dispose>('clang_IndexAction_dispose'))( arg0, ); } - _dart_clang_IndexAction_dispose _clang_IndexAction_dispose; + _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. @@ -2376,9 +2288,9 @@ class LibClang { ffi.Pointer> out_TU, int TU_options, ) { - _clang_indexSourceFile ??= _dylib.lookupFunction<_c_clang_indexSourceFile, - _dart_clang_indexSourceFile>('clang_indexSourceFile'); - return _clang_indexSourceFile( + return (_clang_indexSourceFile ??= _dylib.lookupFunction< + _c_clang_indexSourceFile, + _dart_clang_indexSourceFile>('clang_indexSourceFile'))( arg0, client_data, index_callbacks, @@ -2394,7 +2306,7 @@ class LibClang { ); } - _dart_clang_indexSourceFile _clang_indexSourceFile; + _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 @@ -2413,10 +2325,9 @@ class LibClang { ffi.Pointer> out_TU, int TU_options, ) { - _clang_indexSourceFileFullArgv ??= _dylib.lookupFunction< + return (_clang_indexSourceFileFullArgv ??= _dylib.lookupFunction< _c_clang_indexSourceFileFullArgv, - _dart_clang_indexSourceFileFullArgv>('clang_indexSourceFileFullArgv'); - return _clang_indexSourceFileFullArgv( + _dart_clang_indexSourceFileFullArgv>('clang_indexSourceFileFullArgv'))( arg0, client_data, index_callbacks, @@ -2432,7 +2343,7 @@ class LibClang { ); } - _dart_clang_indexSourceFileFullArgv _clang_indexSourceFileFullArgv; + _dart_clang_indexSourceFileFullArgv? _clang_indexSourceFileFullArgv; /// Index the given translation unit via callbacks implemented through /// #IndexerCallbacks. @@ -2456,10 +2367,9 @@ class LibClang { int index_options, ffi.Pointer arg5, ) { - _clang_indexTranslationUnit ??= _dylib.lookupFunction< + return (_clang_indexTranslationUnit ??= _dylib.lookupFunction< _c_clang_indexTranslationUnit, - _dart_clang_indexTranslationUnit>('clang_indexTranslationUnit'); - return _clang_indexTranslationUnit( + _dart_clang_indexTranslationUnit>('clang_indexTranslationUnit'))( arg0, client_data, index_callbacks, @@ -2469,7 +2379,7 @@ class LibClang { ); } - _dart_clang_indexTranslationUnit _clang_indexTranslationUnit; + _dart_clang_indexTranslationUnit? _clang_indexTranslationUnit; } /// A character string. @@ -2479,17 +2389,17 @@ class LibClang { /// 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 { - ffi.Pointer data; + external ffi.Pointer data; @ffi.Uint32() - int private_flags; + external int private_flags; } class CXStringSet extends ffi.Struct { - ffi.Pointer Strings; + external ffi.Pointer Strings; @ffi.Uint32() - int Count; + external int Count; } class CXTargetInfoImpl extends ffi.Struct {} @@ -2505,14 +2415,14 @@ class CXUnsavedFile extends ffi.Struct { /// The file whose contents have not yet been saved. /// /// This file must already exist in the file system. - ffi.Pointer Filename; + external ffi.Pointer Filename; /// A buffer containing the unsaved contents of this file. - ffi.Pointer Contents; + external ffi.Pointer Contents; /// The length of the unsaved contents of this buffer. @ffi.Uint64() - int Length; + external int Length; } /// Describes a version number of the form major.minor.subminor. @@ -2520,19 +2430,19 @@ 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() - int Major; + 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() - int Minor; + 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() - int Subminor; + external int Subminor; } abstract class CXGlobalOptFlags { @@ -2562,11 +2472,11 @@ abstract class CXGlobalOptFlags { /// across an indexing session. class CXFileUniqueID extends ffi.Struct { @ffi.Uint64() - int _unique_data_item_0; + external int _unique_data_item_0; @ffi.Uint64() - int _unique_data_item_1; + external int _unique_data_item_1; @ffi.Uint64() - int _unique_data_item_2; + external int _unique_data_item_2; /// Helper for array `data`. ArrayHelper_CXFileUniqueID_data_level0 get data => @@ -2627,14 +2537,14 @@ class ArrayHelper_CXFileUniqueID_data_level0 { /// Use clang_getExpansionLocation() or clang_getSpellingLocation() /// to map a source location to a particular file, line, and column. class CXSourceLocation extends ffi.Struct { - ffi.Pointer _unique_ptr_data_item_0; - ffi.Pointer _unique_ptr_data_item_1; + 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() - int int_data; + external int int_data; } /// Helper for array `ptr_data` in struct `CXSourceLocation`. @@ -2685,17 +2595,17 @@ class ArrayHelper_CXSourceLocation_ptr_data_level0 { /// Use clang_getRangeStart() and clang_getRangeEnd() to retrieve the /// starting and end locations from a source range, respectively. class CXSourceRange extends ffi.Struct { - ffi.Pointer _unique_ptr_data_item_0; - ffi.Pointer _unique_ptr_data_item_1; + 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() - int begin_int_data; + external int begin_int_data; @ffi.Uint32() - int end_int_data; + external int end_int_data; } /// Helper for array `ptr_data` in struct `CXSourceRange`. @@ -2745,28 +2655,28 @@ class ArrayHelper_CXSourceRange_ptr_data_level0 { class CXSourceRangeList extends ffi.Struct { /// The number of ranges in the \c ranges array. @ffi.Uint32() - int count; + external int count; /// An array of \c CXSourceRanges. - ffi.Pointer ranges; + external ffi.Pointer ranges; } class CXTUResourceUsageEntry extends ffi.Struct { @ffi.Int32() - int kind; + external int kind; @ffi.Uint64() - int amount; + external int amount; } /// The memory usage of a CXTranslationUnit, broken into categories. class CXTUResourceUsage extends ffi.Struct { - ffi.Pointer data; + external ffi.Pointer data; @ffi.Uint32() - int numEntries; + external int numEntries; - ffi.Pointer entries; + external ffi.Pointer entries; } /// A cursor representing some element in the abstract syntax tree for @@ -2787,14 +2697,14 @@ class CXTUResourceUsage extends ffi.Struct { /// source code into the AST. class CXCursor extends ffi.Struct { @ffi.Int32() - int kind; + external int kind; @ffi.Int32() - int xdata; + external int xdata; - ffi.Pointer _unique_data_item_0; - ffi.Pointer _unique_data_item_1; - ffi.Pointer _unique_data_item_2; + 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 => @@ -2988,10 +2898,10 @@ abstract class CXTypeKind { /// The type of an element in the abstract syntax tree. class CXType extends ffi.Struct { @ffi.Int32() - int kind; + external int kind; - ffi.Pointer _unique_data_item_0; - ffi.Pointer _unique_data_item_1; + external ffi.Pointer _unique_data_item_0; + external ffi.Pointer _unique_data_item_1; /// Helper for array `data`. ArrayHelper_CXType_data_level0 get data => @@ -3044,18 +2954,18 @@ class ArrayHelper_CXType_data_level0 { /// Describes a single preprocessing token. class CXToken extends ffi.Struct { @ffi.Uint32() - int _unique_int_data_item_0; + external int _unique_int_data_item_0; @ffi.Uint32() - int _unique_int_data_item_1; + external int _unique_int_data_item_1; @ffi.Uint32() - int _unique_int_data_item_2; + external int _unique_int_data_item_2; @ffi.Uint32() - int _unique_int_data_item_3; + 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); - ffi.Pointer ptr_data; + external ffi.Pointer ptr_data; } /// Helper for array `int_data` in struct `CXToken`. @@ -3122,11 +3032,11 @@ class CXCompletionResult extends ffi.Struct { /// \todo In the future, we would like to provide a full cursor, to allow /// the client to extract additional information from declaration. @ffi.Int32() - int CursorKind; + external int CursorKind; /// The code-completion string that describes how to insert this /// code-completion result into the editing buffer. - ffi.Pointer CompletionString; + external ffi.Pointer CompletionString; } /// Contains the results of code-completion. @@ -3136,26 +3046,26 @@ class CXCompletionResult extends ffi.Struct { /// \c clang_disposeCodeCompleteResults. class CXCodeCompleteResults extends ffi.Struct { /// The code-completion results. - ffi.Pointer Results; + external ffi.Pointer Results; /// The number of code-completion results stored in the /// \c Results array. @ffi.Uint32() - int NumResults; + external int NumResults; } class CXCursorAndRangeVisitor extends ffi.Struct {} /// Source location passed to index callbacks. class CXIdxLoc extends ffi.Struct { - ffi.Pointer _unique_ptr_data_item_0; - ffi.Pointer _unique_ptr_data_item_1; + 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() - int int_data; + external int int_data; } /// Helper for array `ptr_data` in struct `CXIdxLoc`. @@ -3218,10 +3128,10 @@ class CXIdxIBOutletCollectionAttrInfo extends ffi.Struct {} class CXIdxDeclInfo extends ffi.Struct {} class CXIdxObjCContainerDeclInfo extends ffi.Struct { - ffi.Pointer declInfo; + external ffi.Pointer declInfo; @ffi.Int32() - int kind; + external int kind; } class CXIdxBaseClassInfo extends ffi.Struct {} @@ -3229,37 +3139,37 @@ class CXIdxBaseClassInfo extends ffi.Struct {} class CXIdxObjCProtocolRefInfo extends ffi.Struct {} class CXIdxObjCProtocolRefListInfo extends ffi.Struct { - ffi.Pointer> protocols; + external ffi.Pointer> protocols; @ffi.Uint32() - int numProtocols; + external int numProtocols; } class CXIdxObjCInterfaceDeclInfo extends ffi.Struct { - ffi.Pointer containerInfo; + external ffi.Pointer containerInfo; - ffi.Pointer superInfo; + external ffi.Pointer superInfo; - ffi.Pointer protocols; + external ffi.Pointer protocols; } class CXIdxObjCCategoryDeclInfo extends ffi.Struct {} class CXIdxObjCPropertyDeclInfo extends ffi.Struct { - ffi.Pointer declInfo; + external ffi.Pointer declInfo; - ffi.Pointer getter; + external ffi.Pointer getter; - ffi.Pointer setter; + external ffi.Pointer setter; } class CXIdxCXXClassDeclInfo extends ffi.Struct { - ffi.Pointer declInfo; + external ffi.Pointer declInfo; - ffi.Pointer> bases; + external ffi.Pointer> bases; @ffi.Uint32() - int numBases; + external int numBases; } /// Data for IndexerCallbacks#indexEntityReference. @@ -3270,15 +3180,15 @@ class CXIdxEntityRefInfo extends ffi.Struct {} class IndexerCallbacks extends ffi.Struct { /// Called periodically to check whether indexing should be aborted. /// Should return 0 to continue, and non-zero to abort. - ffi.Pointer> abortQuery; + external ffi.Pointer> abortQuery; /// Called at the end of indexing; passes the complete diagnostic set. - ffi.Pointer> diagnostic; + external ffi.Pointer> diagnostic; - ffi.Pointer> enteredMainFile; + external ffi.Pointer> enteredMainFile; /// Called when a file gets \#included/\#imported. - ffi.Pointer> ppIncludedFile; + external ffi.Pointer> ppIncludedFile; /// Called when a AST file (PCH or module) gets imported. /// @@ -3286,15 +3196,15 @@ class IndexerCallbacks extends ffi.Struct { /// 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. - ffi.Pointer> importedASTFile; + external ffi.Pointer> importedASTFile; /// Called at the beginning of indexing a translation unit. - ffi.Pointer> startedTranslationUnit; + external ffi.Pointer> startedTranslationUnit; - ffi.Pointer> indexDeclaration; + external ffi.Pointer> indexDeclaration; /// Called to index a reference of an entity. - ffi.Pointer> indexEntityReference; + external ffi.Pointer> indexEntityReference; } const int CINDEX_VERSION_MAJOR = 0; diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index ba3067fb63..e1a3cfc064 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -5,7 +5,7 @@ name: libclang_example environment: - sdk: '>=2.8.1 <3.0.0' + sdk: '>=2.12.0-29.10.beta <3.0.0' dev_dependencies: ffigen: diff --git a/pkgs/ffigen/example/simple/generated_bindings.dart b/pkgs/ffigen/example/simple/generated_bindings.dart index 9b0b3a2f19..9a94f0d7e1 100644 --- a/pkgs/ffigen/example/simple/generated_bindings.dart +++ b/pkgs/ffigen/example/simple/generated_bindings.dart @@ -16,74 +16,70 @@ class NativeLibrary { int a, int b, ) { - _sum ??= _dylib.lookupFunction<_c_sum, _dart_sum>('sum'); - return _sum( + return (_sum ??= _dylib.lookupFunction<_c_sum, _dart_sum>('sum'))( a, b, ); } - _dart_sum _sum; + _dart_sum? _sum; /// Subtracts 2 integers. int subtract( ffi.Pointer a, int b, ) { - _subtract ??= - _dylib.lookupFunction<_c_subtract, _dart_subtract>('subtract'); - return _subtract( + return (_subtract ??= + _dylib.lookupFunction<_c_subtract, _dart_subtract>('subtract'))( a, b, ); } - _dart_subtract _subtract; + _dart_subtract? _subtract; /// Multiplies 2 integers, returns pointer to an integer,. ffi.Pointer multiply( int a, int b, ) { - _multiply ??= - _dylib.lookupFunction<_c_multiply, _dart_multiply>('multiply'); - return _multiply( + return (_multiply ??= + _dylib.lookupFunction<_c_multiply, _dart_multiply>('multiply'))( a, b, ); } - _dart_multiply _multiply; + _dart_multiply? _multiply; /// Divides 2 integers, returns pointer to a float. ffi.Pointer divide( int a, int b, ) { - _divide ??= _dylib.lookupFunction<_c_divide, _dart_divide>('divide'); - return _divide( + return (_divide ??= + _dylib.lookupFunction<_c_divide, _dart_divide>('divide'))( a, b, ); } - _dart_divide _divide; + _dart_divide? _divide; /// Divides 2 floats, returns a pointer to double. ffi.Pointer dividePercision( ffi.Pointer a, ffi.Pointer b, ) { - _dividePercision ??= + return (_dividePercision ??= _dylib.lookupFunction<_c_dividePercision, _dart_dividePercision>( - 'dividePercision'); - return _dividePercision( + 'dividePercision'))( a, b, ); } - _dart_dividePercision _dividePercision; + _dart_dividePercision? _dividePercision; } typedef _c_sum = ffi.Int32 Function( diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index c742a26001..9e461ecc2d 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -5,7 +5,7 @@ name: simple_example environment: - sdk: '>=2.8.1 <3.0.0' + sdk: '>=2.12.0-29.10.beta <3.0.0' dev_dependencies: ffigen: diff --git a/pkgs/ffigen/lib/src/code_generator/binding.dart b/pkgs/ffigen/lib/src/code_generator/binding.dart index 4f24d58163..877f243eee 100644 --- a/pkgs/ffigen/lib/src/code_generator/binding.dart +++ b/pkgs/ffigen/lib/src/code_generator/binding.dart @@ -2,8 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:meta/meta.dart'; - import 'binding_string.dart'; import 'typedef.dart'; import 'writer.dart'; @@ -21,12 +19,12 @@ abstract class Binding { /// Binding name to generate, may get changed to resolve name conflicts. String name; - final String dartDoc; + final String? dartDoc; Binding({ - @required this.usr, - @required this.originalName, - @required this.name, + required this.usr, + required this.originalName, + required this.name, this.dartDoc, }); @@ -43,10 +41,10 @@ abstract class Binding { /// Base class for bindings which look up symbols in dynamic library. abstract class LookUpBinding extends Binding { LookUpBinding({ - String usr, - String originalName, - @required String name, - String dartDoc, + String? usr, + String? originalName, + required String name, + String? dartDoc, }) : super( usr: usr ?? name, originalName: originalName ?? name, @@ -58,10 +56,10 @@ abstract class LookUpBinding extends Binding { /// Base class for bindings which don't look up symbols in dynamic library. abstract class NoLookUpBinding extends Binding { NoLookUpBinding({ - String usr, - String originalName, - @required String name, - String dartDoc, + String? usr, + String? originalName, + required String name, + String? dartDoc, }) : super( usr: usr ?? name, originalName: originalName ?? name, diff --git a/pkgs/ffigen/lib/src/code_generator/binding_string.dart b/pkgs/ffigen/lib/src/code_generator/binding_string.dart index c0d4325fe2..a2b721ea38 100644 --- a/pkgs/ffigen/lib/src/code_generator/binding_string.dart +++ b/pkgs/ffigen/lib/src/code_generator/binding_string.dart @@ -2,15 +2,13 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:meta/meta.dart'; - /// A Binding's String representation. class BindingString { // Meta data, (not used for generation). final BindingStringType type; final String string; - const BindingString({@required this.type, @required this.string}); + const BindingString({required this.type, required this.string}); @override String toString() => string; diff --git a/pkgs/ffigen/lib/src/code_generator/constant.dart b/pkgs/ffigen/lib/src/code_generator/constant.dart index 617f2d75bf..41a996147d 100644 --- a/pkgs/ffigen/lib/src/code_generator/constant.dart +++ b/pkgs/ffigen/lib/src/code_generator/constant.dart @@ -2,8 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:meta/meta.dart'; - import 'binding.dart'; import 'binding_string.dart'; import 'utils.dart'; @@ -30,12 +28,12 @@ class Constant extends NoLookUpBinding { final String rawValue; Constant({ - String usr, - String originalName, - @required String name, - String dartDoc, - @required this.rawType, - @required this.rawValue, + String? usr, + String? originalName, + required String name, + String? dartDoc, + required this.rawType, + required this.rawValue, }) : super( usr: usr, originalName: originalName, @@ -49,7 +47,7 @@ class Constant extends NoLookUpBinding { final constantName = name; if (dartDoc != null) { - s.write(makeDartDoc(dartDoc)); + s.write(makeDartDoc(dartDoc!)); } s.write('const ${rawType} $constantName = $rawValue;\n\n'); diff --git a/pkgs/ffigen/lib/src/code_generator/enum_class.dart b/pkgs/ffigen/lib/src/code_generator/enum_class.dart index 867133a106..249ab8c776 100644 --- a/pkgs/ffigen/lib/src/code_generator/enum_class.dart +++ b/pkgs/ffigen/lib/src/code_generator/enum_class.dart @@ -2,8 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:meta/meta.dart'; - import 'binding.dart'; import 'binding_string.dart'; import 'utils.dart'; @@ -27,11 +25,11 @@ class EnumClass extends NoLookUpBinding { final List enumConstants; EnumClass({ - String usr, - String originalName, - @required String name, - String dartDoc, - List enumConstants, + String? usr, + String? originalName, + required String name, + String? dartDoc, + List? enumConstants, }) : enumConstants = enumConstants ?? [], super( usr: usr, @@ -46,7 +44,7 @@ class EnumClass extends NoLookUpBinding { final enclosingClassName = name; if (dartDoc != null) { - s.write(makeDartDoc(dartDoc)); + s.write(makeDartDoc(dartDoc!)); } /// Adding [enclosingClassName] because dart doesn't allow class member @@ -60,7 +58,7 @@ class EnumClass extends NoLookUpBinding { final enum_value_name = localUniqueNamer.makeUnique(ec.name); if (ec.dartDoc != null) { s.write(depth + '/// '); - s.writeAll(ec.dartDoc.split('\n'), '\n' + depth + '/// '); + s.writeAll(ec.dartDoc!.split('\n'), '\n' + depth + '/// '); s.write('\n'); } s.write(depth + 'static const int ${enum_value_name} = ${ec.value};\n'); @@ -74,14 +72,14 @@ class EnumClass extends NoLookUpBinding { /// Represents a single value in an enum. class EnumConstant { - final String originalName; - final String dartDoc; + final String? originalName; + final String? dartDoc; final String name; final int value; const EnumConstant({ - String originalName, - @required this.name, - @required this.value, + String? originalName, + required this.name, + required this.value, this.dartDoc, }) : originalName = originalName ?? name; } diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index a55f6d2234..5a526a5ae5 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -3,7 +3,6 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:meta/meta.dart'; import 'binding.dart'; import 'binding_string.dart'; @@ -36,12 +35,12 @@ class Func extends LookUpBinding { /// [originalName] is looked up in dynamic library, if not /// provided, takes the value of [name]. Func({ - String usr, - @required String name, - String originalName, - String dartDoc, - @required this.returnType, - List parameters, + String? usr, + required String name, + String? originalName, + String? dartDoc, + required this.returnType, + List? parameters, }) : parameters = parameters ?? [], super( usr: usr, @@ -50,14 +49,13 @@ class Func extends LookUpBinding { dartDoc: dartDoc, ) { for (var i = 0; i < this.parameters.length; i++) { - if (this.parameters[i].name == null || - this.parameters[i].name.trim() == '') { + if (this.parameters[i].name.trim() == '') { this.parameters[i].name = 'arg$i'; } } } - List _typedefDependencies; + List? _typedefDependencies; @override List getTypedefDependencies(Writer w) { if (_typedefDependencies == null) { @@ -66,26 +64,26 @@ class Func extends LookUpBinding { // Add typedef's required by return type. final returnTypeBase = returnType.getBaseType(); if (returnTypeBase.broadType == BroadType.NativeFunction) { - _typedefDependencies - .addAll(returnTypeBase.nativeFunc.getDependencies()); + _typedefDependencies! + .addAll(returnTypeBase.nativeFunc!.getDependencies()); } // Add typedef's required by parameters. for (final p in parameters) { final base = p.type.getBaseType(); if (base.broadType == BroadType.NativeFunction) { - _typedefDependencies.addAll(base.nativeFunc.getDependencies()); + _typedefDependencies!.addAll(base.nativeFunc!.getDependencies()); } } // Add C function typedef. - _typedefDependencies.add(cType); + _typedefDependencies!.add(cType); // Add Dart function typedef. - _typedefDependencies.add(dartType); + _typedefDependencies!.add(dartType); } - return _typedefDependencies; + return _typedefDependencies!; } - Typedef _cType, _dartType; + Typedef? _cType, _dartType; Typedef get cType => _cType ??= Typedef( name: '_c_$name', returnType: returnType, @@ -106,7 +104,7 @@ class Func extends LookUpBinding { final funcVarName = w.wrapperLevelUniqueNamer.makeUnique('_$name'); if (dartDoc != null) { - s.write(makeDartDoc(dartDoc)); + s.write(makeDartDoc(dartDoc!)); } // Resolve name conflicts in function parameter names. final paramNamer = UniqueNamer({}); @@ -130,9 +128,9 @@ class Func extends LookUpBinding { } s.write(') {\n'); s.write( - "$funcVarName ??= ${w.dylibIdentifier}.lookupFunction<${cType.name},${dartType.name}>('$originalName');\n"); + "return ($funcVarName ??= ${w.dylibIdentifier}.lookupFunction<${cType.name},${dartType.name}>('$originalName'))"); - s.write(' return $funcVarName(\n'); + s.write('(\n'); for (final p in parameters) { if (w.dartBool && p.type.broadType == BroadType.Boolean) { // Convert bool parameter to int before calling. @@ -150,7 +148,7 @@ class Func extends LookUpBinding { s.write('}\n'); // Write function variable. - s.write('${dartType.name} $funcVarName;\n\n'); + s.write('${dartType.name}? $funcVarName;\n\n'); return BindingString(type: BindingStringType.func, string: s.toString()); } @@ -158,11 +156,11 @@ class Func extends LookUpBinding { /// Represents a Parameter, used in [Func] and [Typedef]. class Parameter { - final String originalName; + final String? originalName; String name; final Type type; - Parameter({String originalName, this.name = '', @required Type type}) + Parameter({String? originalName, this.name = '', required Type type}) : originalName = originalName ?? name, // A type with broadtype [BroadType.NativeFunction] is wrapped with a // pointer because this is a shorthand used in C for Pointer to function. diff --git a/pkgs/ffigen/lib/src/code_generator/global.dart b/pkgs/ffigen/lib/src/code_generator/global.dart index 817844df50..b52fa7023d 100644 --- a/pkgs/ffigen/lib/src/code_generator/global.dart +++ b/pkgs/ffigen/lib/src/code_generator/global.dart @@ -2,8 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:meta/meta.dart'; - import 'binding.dart'; import 'binding_string.dart'; import 'type.dart'; @@ -24,11 +22,11 @@ class Global extends LookUpBinding { final Type type; Global({ - String usr, - String originalName, - @required String name, - @required this.type, - String dartDoc, + String? usr, + String? originalName, + required String name, + required this.type, + String? dartDoc, }) : super( usr: usr, originalName: originalName, @@ -41,7 +39,7 @@ class Global extends LookUpBinding { final s = StringBuffer(); final globalVarName = name; if (dartDoc != null) { - s.write(makeDartDoc(dartDoc)); + s.write(makeDartDoc(dartDoc!)); } final holderVarName = diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index e1d239040b..4ea8e654b6 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -6,7 +6,6 @@ import 'dart:io'; import 'package:cli_util/cli_util.dart'; import 'package:logging/logging.dart'; -import 'package:meta/meta.dart'; import 'package:path/path.dart' as p; import 'package:pub_semver/pub_semver.dart'; import 'binding.dart'; @@ -20,14 +19,14 @@ class Library { /// List of bindings in this library. final List bindings; - Writer _writer; + late Writer _writer; Writer get writer => _writer; Library({ - @required String name, - String description, - @required this.bindings, - String header, + required String name, + String? description, + required this.bindings, + String? header, bool dartBool = true, }) { // Seperate bindings which require lookup. @@ -116,8 +115,7 @@ class Library { /// Generates the bindings. String generate() { - final w = writer; - return w.generate(); + return writer.generate(); } @override diff --git a/pkgs/ffigen/lib/src/code_generator/struc.dart b/pkgs/ffigen/lib/src/code_generator/struc.dart index a17649beba..ee8a52329d 100644 --- a/pkgs/ffigen/lib/src/code_generator/struc.dart +++ b/pkgs/ffigen/lib/src/code_generator/struc.dart @@ -3,7 +3,6 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator/typedef.dart'; -import 'package:meta/meta.dart'; import 'binding.dart'; import 'binding_string.dart'; @@ -39,11 +38,11 @@ class Struc extends NoLookUpBinding { List members; Struc({ - String usr, - String originalName, - @required String name, - String dartDoc, - List members, + String? usr, + String? originalName, + required String name, + String? dartDoc, + List? members, }) : members = members ?? [], super( usr: usr, @@ -56,13 +55,13 @@ class Struc extends NoLookUpBinding { final array = []; var startType = type; while (startType.broadType == BroadType.ConstantArray) { - array.add(startType.length); - startType = startType.child; + array.add(startType.length!); + startType = startType.child!; } return array; } - List _typedefDependencies; + List? _typedefDependencies; @override List getTypedefDependencies(Writer w) { if (_typedefDependencies == null) { @@ -72,20 +71,19 @@ class Struc extends NoLookUpBinding { for (final m in members) { final base = m.type.getBaseType(); if (base.broadType == BroadType.NativeFunction) { - _typedefDependencies.addAll(base.nativeFunc.getDependencies()); + _typedefDependencies!.addAll(base.nativeFunc!.getDependencies()); } } } - return _typedefDependencies; + return _typedefDependencies ?? []; } @override BindingString toBindingString(Writer w) { - members = members ?? []; final s = StringBuffer(); final enclosingClassName = name; if (dartDoc != null) { - s.write(makeDartDoc(dartDoc)); + s.write(makeDartDoc(dartDoc!)); } final helpers = []; @@ -118,13 +116,13 @@ class Struc extends NoLookUpBinding { const depth = ' '; if (m.dartDoc != null) { s.write(depth + '/// '); - s.writeAll(m.dartDoc.split('\n'), '\n' + depth + '/// '); + s.writeAll(m.dartDoc!.split('\n'), '\n' + depth + '/// '); s.write('\n'); } if (m.type.isPrimitive) { s.write('$depth@${m.type.getCType(w)}()\n'); } - s.write('$depth${m.type.getDartType(w)} ${memberName};\n\n'); + s.write('${depth}external ${m.type.getDartType(w)} ${memberName};\n\n'); } } s.write('}\n\n'); @@ -154,15 +152,15 @@ class Struc extends NoLookUpBinding { } class Member { - final String dartDoc; + final String? dartDoc; final String originalName; final String name; final Type type; const Member({ - String originalName, - @required this.name, - @required this.type, + String? originalName, + required this.name, + required this.type, this.dartDoc, }) : originalName = originalName ?? name; } @@ -171,15 +169,15 @@ class Member { class ArrayHelper { final Type elementType; final List dimensions; - final String structName; + final String? structName; - final String name; + final String? name; final String helperClassGroupName; final String elementNamePrefix; - int _expandedArrayLength; + int? _expandedArrayLength; int get expandedArrayLength { - if (_expandedArrayLength != null) return _expandedArrayLength; + if (_expandedArrayLength != null) return _expandedArrayLength!; var arrayLength = 1; for (final i in dimensions) { @@ -189,12 +187,12 @@ class ArrayHelper { } ArrayHelper({ - @required this.elementType, - @required this.dimensions, - @required this.structName, - @required this.name, - @required this.helperClassGroupName, - @required this.elementNamePrefix, + required this.elementType, + required this.dimensions, + required this.structName, + required this.name, + required this.helperClassGroupName, + required this.elementNamePrefix, }); /// Create declaration binding, added inside the struct binding. @@ -207,7 +205,7 @@ class ArrayHelper { if (elementType.isPrimitive) { s.write(' @${arrayCType}()\n'); } - s.write(' ${arrayDartType} ${elementNamePrefix}$i;\n'); + s.write(' external ${arrayDartType} ${elementNamePrefix}$i;\n'); } s.write('/// Helper for array `$name`.\n'); diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index 5922b38ceb..0f2071e296 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -2,8 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:meta/meta.dart'; - import 'struc.dart'; import 'typedef.dart'; import 'writer.dart'; @@ -12,7 +10,7 @@ class _SubType { final String c; final String dart; - const _SubType({this.c, this.dart}); + const _SubType({required this.c, required this.dart}); } enum SupportedNativeType { @@ -69,28 +67,28 @@ class Type { }; /// Reference to the [Struc] binding this type refers to. - Struc struc; + Struc? struc; /// Reference to the [Typedef] this type refers to. - Typedef nativeFunc; + Typedef? nativeFunc; /// For providing [SupportedNativeType] only. - final SupportedNativeType nativeType; + final SupportedNativeType? nativeType; /// The BroadType of this Type. final BroadType broadType; /// Child Type, e.g Pointer(Parent) to Int(Child), or Child Type of an Array. - final Type child; + final Type? child; /// For ConstantArray and IncompleteArray type. - final int length; + final int? length; /// For storing cursor type info for an unimplemented type. - String unimplementedReason; + String? unimplementedReason; Type._({ - @required this.broadType, + required this.broadType, this.child, this.struc, this.nativeType, @@ -102,13 +100,13 @@ class Type { factory Type.pointer(Type child) { return Type._(broadType: BroadType.Pointer, child: child); } - factory Type.struct(Struc struc) { + factory Type.struct(Struc? struc) { return Type._(broadType: BroadType.Struct, struc: struc); } - factory Type.nativeFunc(Typedef nativeFunc) { + factory Type.nativeFunc(Typedef? nativeFunc) { return Type._(broadType: BroadType.NativeFunction, nativeFunc: nativeFunc); } - factory Type.nativeType(SupportedNativeType nativeType) { + factory Type.nativeType(SupportedNativeType? nativeType) { return Type._(broadType: BroadType.NativeType, nativeType: nativeType); } factory Type.constantArray(int length, Type elementType) { @@ -143,7 +141,7 @@ class Type { /// double[2][3] has base [Type] of double. Type getBaseType() { if (child != null) { - return child.getBaseType(); + return child!.getBaseType(); } else { return this; } @@ -155,7 +153,7 @@ class Type { Type getBaseArrayType() { if (broadType == BroadType.ConstantArray || broadType == BroadType.IncompleteArray) { - return child.getBaseArrayType(); + return child!.getBaseArrayType(); } else { return this; } @@ -167,21 +165,21 @@ class Type { String getCType(Writer w) { switch (broadType) { case BroadType.NativeType: - return '${w.ffiLibraryPrefix}.${_primitives[nativeType].c}'; + return '${w.ffiLibraryPrefix}.${_primitives[nativeType!]!.c}'; case BroadType.Pointer: - return '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; + return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; case BroadType.Struct: - return '${struc.name}'; + return '${struc!.name}'; case BroadType.NativeFunction: - return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFunc.name}>'; + return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFunc!.name}>'; case BroadType .IncompleteArray: // Array parameters are treated as Pointers in C. - return '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; + return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; case BroadType .ConstantArray: // Array parameters are treated as Pointers in C. - return '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; + return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; case BroadType.Boolean: // Booleans are treated as uint8. - return '${w.ffiLibraryPrefix}.${_primitives[SupportedNativeType.Uint8].c}'; + return '${w.ffiLibraryPrefix}.${_primitives[SupportedNativeType.Uint8]!.c}'; case BroadType.Handle: return '${w.ffiLibraryPrefix}.Handle'; default: @@ -189,24 +187,24 @@ class Type { } } - String getDartType(Writer w) { + String? getDartType(Writer w) { switch (broadType) { case BroadType.NativeType: - return _primitives[nativeType].dart; + return _primitives[nativeType!]!.dart; case BroadType.Pointer: - return '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; + return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; case BroadType.Struct: - return '${struc.name}'; + return '${struc!.name}'; case BroadType.NativeFunction: - return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFunc.name}>'; + return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFunc!.name}>'; case BroadType .IncompleteArray: // Array parameters are treated as Pointers in C. - return '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; + return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; case BroadType .ConstantArray: // Array parameters are treated as Pointers in C. - return '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; + return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; case BroadType.Boolean: // Booleans are treated as uint8. - return _primitives[SupportedNativeType.Uint8].dart; + return _primitives[SupportedNativeType.Uint8]!.dart; case BroadType.Handle: return 'Object'; default: diff --git a/pkgs/ffigen/lib/src/code_generator/typedef.dart b/pkgs/ffigen/lib/src/code_generator/typedef.dart index 7f3c6840ce..f1ba5adc2b 100644 --- a/pkgs/ffigen/lib/src/code_generator/typedef.dart +++ b/pkgs/ffigen/lib/src/code_generator/typedef.dart @@ -3,7 +3,6 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:meta/meta.dart'; import 'func.dart' show Parameter; import 'type.dart'; @@ -25,17 +24,17 @@ import 'writer.dart'; /// Note: re-set [name] after resolving name conflicts. class Typedef { String name; - String dartDoc; + String? dartDoc; final Type returnType; final TypedefType typedefType; final List parameters; Typedef({ - @required this.name, + required this.name, this.dartDoc, - @required this.returnType, - @required this.typedefType, - List parameters, + required this.returnType, + required this.typedefType, + List? parameters, }) : parameters = parameters ?? []; /// Returns the [Typedef] dependencies required by this typedef including itself. @@ -44,12 +43,12 @@ class Typedef { for (final p in parameters) { final base = p.type.getBaseType(); if (base.broadType == BroadType.NativeFunction) { - dep.addAll(base.nativeFunc.getDependencies()); + dep.addAll(base.nativeFunc!.getDependencies()); } } final returnTypeBase = returnType.getBaseType(); if (returnTypeBase.broadType == BroadType.NativeFunction) { - dep.addAll(returnTypeBase.nativeFunc.getDependencies()); + dep.addAll(returnTypeBase.nativeFunc!.getDependencies()); } dep.add(this); return dep; @@ -58,7 +57,7 @@ class Typedef { String toTypedefString(Writer w) { final s = StringBuffer(); if (dartDoc != null) { - s.write(makeDartDoc(dartDoc)); + s.write(makeDartDoc(dartDoc!)); } final typedefName = name; final paramNamer = UniqueNamer({}); diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index 0a02ed0701..9e91099eac 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -3,14 +3,13 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator/utils.dart'; -import 'package:meta/meta.dart'; import 'binding.dart'; import 'typedef.dart'; /// To store generated String bindings. class Writer { - final String header; + final String? header; /// Holds bindings, which lookup symbols. final List lookUpBindings; @@ -18,42 +17,41 @@ class Writer { /// Holds bindings which don't lookup symbols. final List noLookUpBindings; - String _className; - final String classDocComment; + String? _className; + final String? classDocComment; - String _ffiLibraryPrefix; - String get ffiLibraryPrefix => _ffiLibraryPrefix; + String? _ffiLibraryPrefix; + String? get ffiLibraryPrefix => _ffiLibraryPrefix; - String _dylibIdentifier; - String get dylibIdentifier => _dylibIdentifier; + String? _dylibIdentifier; + String? get dylibIdentifier => _dylibIdentifier; final bool dartBool; /// Initial namers set after running constructor. Namers are reset to this /// initial state everytime [generate] is called. - UniqueNamer _initialTopLevelUniqueNamer, _initialWrapperLevelUniqueNamer; + late UniqueNamer _initialTopLevelUniqueNamer, _initialWrapperLevelUniqueNamer; /// Used by [Binding]s for generating required code. - UniqueNamer _topLevelUniqueNamer, _wrapperLevelUniqueNamer; + late UniqueNamer _topLevelUniqueNamer, _wrapperLevelUniqueNamer; UniqueNamer get topLevelUniqueNamer => _topLevelUniqueNamer; UniqueNamer get wrapperLevelUniqueNamer => _wrapperLevelUniqueNamer; - String _arrayHelperClassPrefix; + String? _arrayHelperClassPrefix; /// Guaranteed to be a unique prefix. - String get arrayHelperClassPrefix => _arrayHelperClassPrefix; + String? get arrayHelperClassPrefix => _arrayHelperClassPrefix; /// [_usedUpNames] should contain names of all the declarations which are /// already used. This is used to avoid name collisions. Writer({ - @required this.lookUpBindings, - @required this.noLookUpBindings, - @required String className, - @required this.dartBool, + required this.lookUpBindings, + required this.noLookUpBindings, + required String className, + required this.dartBool, this.classDocComment, this.header, - }) : assert(className != null), - assert(dartBool != null) { + }) { final globalLevelNameSet = noLookUpBindings.map((e) => e.name).toSet(); final wrapperLevelNameSet = lookUpBindings.map((e) => e.name).toSet(); final allNameSet = {} @@ -66,8 +64,8 @@ class Writer { /// Wrapper class name must be unique among all names. _className = allLevelsUniqueNamer.makeUnique(className); - _initialWrapperLevelUniqueNamer.markUsed(_className); - _initialTopLevelUniqueNamer.markUsed(_className); + _initialWrapperLevelUniqueNamer.markUsed(_className!); + _initialTopLevelUniqueNamer.markUsed(_className!); /// [_ffiLibraryPrefix] should be unique in top level. _ffiLibraryPrefix = _initialTopLevelUniqueNamer.makeUnique('ffi'); @@ -81,7 +79,7 @@ class Writer { _arrayHelperClassPrefix = base; var suffixInt = 0; for (var i = 0; i < allNameSet.length; i++) { - if (allNameSet.elementAt(i).startsWith(_arrayHelperClassPrefix)) { + if (allNameSet.elementAt(i).startsWith(_arrayHelperClassPrefix!)) { // Not a unique prefix, start over with a new suffix. i = -1; suffixInt++; @@ -137,7 +135,7 @@ class Writer { if (lookUpBindings.isNotEmpty) { // Write doc comment for wrapper class. if (classDocComment != null) { - s.write(makeDartDoc(classDocComment)); + s.write(makeDartDoc(classDocComment!)); } // Write wrapper classs. s.write('class $_className{\n'); diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 04ae2a9692..0649de57bf 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -22,79 +22,80 @@ final _logger = Logger('ffigen.config_provider.config'); class Config { /// output file name. String get output => _output; - String _output; + late String _output; // Holds headers and filters for header. Headers get headers => _headers; - Headers _headers; + late Headers _headers; /// CommandLine Arguments to pass to clang_compiler. List get compilerOpts => _compilerOpts; - List _compilerOpts; + late List _compilerOpts; /// Declaration config for Functions. Declaration get functionDecl => _functionDecl; - Declaration _functionDecl; + late Declaration _functionDecl; /// Declaration config for Structs. Declaration get structDecl => _structDecl; - Declaration _structDecl; + late Declaration _structDecl; /// Declaration config for Enums. Declaration get enumClassDecl => _enumClassDecl; - Declaration _enumClassDecl; + late Declaration _enumClassDecl; /// Declaration config for Unnamed enum constants. Declaration get unnamedEnumConstants => _unnamedEnumConstants; - Declaration _unnamedEnumConstants; + late Declaration _unnamedEnumConstants; /// Declaration config for Macro constants. Declaration get macroDecl => _macroDecl; - Declaration _macroDecl; + late Declaration _macroDecl; /// If generated bindings should be sorted alphabetically. bool get sort => _sort; - bool _sort; + late bool _sort; /// If typedef of supported types(int8_t) should be directly used. bool get useSupportedTypedefs => _useSupportedTypedefs; - bool _useSupportedTypedefs; + late bool _useSupportedTypedefs; /// Stores typedef name to NativeType mappings specified by user. Map get typedefNativeTypeMappings => _typedefNativeTypeMappings; - Map _typedefNativeTypeMappings; + late Map _typedefNativeTypeMappings; /// Extracted Doc comment type. CommentType get commentType => _commentType; - CommentType _commentType; + late CommentType _commentType; /// If tool should generate array workarounds. /// /// If false(default), structs with inline array members will have all its /// members removed. bool get arrayWorkaround => _arrayWorkaround; - bool _arrayWorkaround; + late bool _arrayWorkaround; /// If dart bool should be generated for C booleans. bool get dartBool => _dartBool; - bool _dartBool; + late bool _dartBool; /// Name of the wrapper class. String get wrapperName => _wrapperName; - String _wrapperName; + late String _wrapperName; /// Doc comment for the wrapper class. String get wrapperDocComment => _wrapperDocComment; - String _wrapperDocComment; + late String _wrapperDocComment; /// Header of the generated bindings. String get preamble => _preamble; - String _preamble; - Config._(); + late String _preamble; /// If `Dart_Handle` should be mapped with Handle/Object. bool get useDartHandle => _useDartHandle; - bool _useDartHandle; + late bool _useDartHandle; + + Config._(); /// Create config from Yaml map. factory Config.fromYaml(YamlMap map) { @@ -118,8 +119,8 @@ class Config { for (final key in specs.keys) { final spec = specs[key]; if (map.containsKey(key)) { - _result = _result && spec.validator(key, map[key]); - } else if (spec.requirement == Requirement.yes) { + _result = _result && spec!.validator(key, map[key]); + } else if (spec!.requirement == Requirement.yes) { _logger.severe("Key '${key}' is required."); _result = false; } else if (spec.requirement == Requirement.prefer) { @@ -143,9 +144,9 @@ class Config { for (final key in specs.keys) { final spec = specs[key]; if (map.containsKey(key)) { - spec.extractedResult(spec.extractor(map[key])); + spec!.extractedResult(spec.extractor(map[key])); } else { - spec.extractedResult(spec.defaultValue?.call()); + spec!.extractedResult(spec.defaultValue?.call()); } } } @@ -227,7 +228,7 @@ class Config { final map = result as Map; for (final key in map.keys) { if (cxTypeKindToSupportedNativeTypes.containsKey(key)) { - cxTypeKindToSupportedNativeTypes[key] = map[key]; + cxTypeKindToSupportedNativeTypes[key] = map[key]!; } } }, @@ -283,7 +284,7 @@ class Config { defaultValue: () => 'NativeLibrary', extractedResult: (dynamic result) => _wrapperName = result as String, ), - strings.description: Specification( + strings.description: Specification( requirement: Requirement.prefer, validator: nonEmptyStringValidator, extractor: stringExtractor, diff --git a/pkgs/ffigen/lib/src/config_provider/config_types.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart index fa5974530a..9ce215c3ec 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_types.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart @@ -4,7 +4,6 @@ /// Contains all the neccesary classes required by config. -import 'package:meta/meta.dart'; import 'package:quiver/pattern.dart' as quiver; class CommentType { @@ -33,15 +32,15 @@ enum CommentLength { none, brief, full } class Specification { final bool Function(String name, dynamic value) validator; final E Function(dynamic map) extractor; - final E Function() defaultValue; + final E Function()? defaultValue; final Requirement requirement; final void Function(dynamic result) extractedResult; Specification({ - @required this.extractedResult, - @required this.validator, - @required this.extractor, + required this.extractedResult, + required this.validator, + required this.extractor, this.defaultValue, this.requirement = Requirement.no, }); @@ -59,7 +58,7 @@ class Headers { /// Include filter for headers. final HeaderIncludeFilter includeFilter; - Headers({List entryPoints, HeaderIncludeFilter includeFilter}) + Headers({List? entryPoints, HeaderIncludeFilter? includeFilter}) : entryPoints = entryPoints ?? [], includeFilter = includeFilter ?? GlobHeaderFilter(); } @@ -69,7 +68,7 @@ abstract class HeaderIncludeFilter { } class GlobHeaderFilter extends HeaderIncludeFilter { - List includeGlobs = []; + List? includeGlobs = []; GlobHeaderFilter({ this.includeGlobs, @@ -78,14 +77,14 @@ class GlobHeaderFilter extends HeaderIncludeFilter { @override bool shouldInclude(String header) { // Return true if header was included. - for (final globPattern in includeGlobs) { + for (final globPattern in includeGlobs!) { if (quiver.matchesFull(globPattern, header)) { return true; } } // If any includedInclusionHeaders is provided, return false. - if (includeGlobs.isNotEmpty) { + if (includeGlobs!.isNotEmpty) { return false; } else { return true; @@ -100,9 +99,9 @@ class Declaration { final MemberRenamer _memberRenamer; Declaration({ - Includer includer, - Renamer renamer, - MemberRenamer memberRenamer, + Includer? includer, + Renamer? renamer, + MemberRenamer? memberRenamer, }) : _includer = includer ?? Includer(), _renamer = renamer ?? Renamer(), _memberRenamer = memberRenamer ?? MemberRenamer(); @@ -137,7 +136,7 @@ class RegExpRenamer { String rename(String str) { if (matches(str)) { // Get match. - final regExpMatch = regExp.firstMatch(str); + final regExpMatch = regExp.firstMatch(str)!; /// Get group values. /// E.g for `str`: `clang_dispose` and `regExp`: `clang_(.*)` @@ -149,8 +148,8 @@ class RegExpRenamer { /// Replace all `$` symbols with respective groups (if any). final result = replacementPattern.replaceAllMapped(replaceGroupRegexp, (match) { - final groupInt = int.parse(match.group(1)); - return groups[groupInt]; + final groupInt = int.parse(match.group(1)!); + return groups[groupInt]!; }); return result; } else { @@ -172,10 +171,10 @@ class Includer { final Set _excludeFull; Includer({ - List includeMatchers, - Set includeFull, - List excludeMatchers, - Set excludeFull, + List? includeMatchers, + Set? includeFull, + List? excludeMatchers, + Set? excludeFull, }) : _includeMatchers = includeMatchers ?? [], _includeFull = includeFull ?? {}, _excludeMatchers = excludeMatchers ?? [], @@ -221,8 +220,8 @@ class Renamer { final List _renameMatchers; Renamer({ - List renamePatterns, - Map renameFull, + List? renamePatterns, + Map? renameFull, }) : _renameMatchers = renamePatterns ?? [], _renameFull = renameFull ?? {}; @@ -233,7 +232,7 @@ class Renamer { String rename(String name) { // Apply full rename (if any). if (_renameFull.containsKey(name)) { - return _renameFull[name]; + return _renameFull[name]!; } // Apply rename regexp (if matches). @@ -273,21 +272,21 @@ class MemberRenamer { final Map _cache = {}; MemberRenamer({ - Map memberRenameFull, - List memberRenamePattern, + Map? memberRenameFull, + List? memberRenamePattern, }) : _memberRenameFull = memberRenameFull ?? {}, _memberRenameMatchers = memberRenamePattern ?? []; String rename(String declaration, String member) { if (_cache.containsKey(declaration)) { - return _cache[declaration].rename(member); + return _cache[declaration]!.rename(member); } // Apply full rename (if any). if (_memberRenameFull.containsKey(declaration)) { // Add to cache. - _cache[declaration] = _memberRenameFull[declaration]; - return _cache[declaration].rename(member); + _cache[declaration] = _memberRenameFull[declaration]!; + return _cache[declaration]!.rename(member); } // Apply rename regexp (if matches). @@ -295,7 +294,7 @@ class MemberRenamer { if (renamer.matchesDeclarationName(declaration)) { // Add to cache. _cache[declaration] = renamer.memberRenamer; - return _cache[declaration].rename(member); + return _cache[declaration]!.rename(member); } } diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 3ed5767b42..2df7939127 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -44,11 +44,11 @@ bool booleanValidator(String name, dynamic value) => Map sizemapExtractor(dynamic yamlConfig) { final resultMap = {}; - final sizemap = yamlConfig as YamlMap; + final sizemap = yamlConfig as YamlMap?; if (sizemap != null) { for (final typeName in strings.sizemap_native_mapping.keys) { if (sizemap.containsKey(typeName)) { - final cxTypeInt = strings.sizemap_native_mapping[typeName]; + final cxTypeInt = strings.sizemap_native_mapping[typeName] as int; final byteSize = sizemap[typeName] as int; resultMap[cxTypeInt] = nativeSupportedType(byteSize, signed: typeName.contains('unsigned') ? false : true); @@ -73,7 +73,7 @@ bool sizemapValidator(String name, dynamic yamlConfig) { Map typedefmapExtractor(dynamic yamlConfig) { final resultMap = {}; - final typedefmap = yamlConfig as YamlMap; + final typedefmap = yamlConfig as YamlMap?; if (typedefmap != null) { for (final typeName in typedefmap.keys) { if (typedefmap[typeName] is String && @@ -81,7 +81,7 @@ Map typedefmapExtractor(dynamic yamlConfig) { .containsKey(typedefmap[typeName])) { // Map this typename to specified supportedNativeType. resultMap[typeName as String] = - strings.supportedNativeType_mappings[typedefmap[typeName]]; + strings.supportedNativeType_mappings[typedefmap[typeName]]!; } } } @@ -103,7 +103,7 @@ bool typedefmapValidator(String name, dynamic yamlConfig) { } List compilerOptsExtractor(dynamic value) => - (value as String)?.split(' '); + (value as String).split(' '); bool compilerOptsValidator(String name, dynamic value) => checkType([name], value); @@ -153,7 +153,7 @@ bool headersValidator(String name, dynamic value) { _logger.severe("Expected '$name -> ${strings.entryPoints}' to be a Map."); return false; } else { - for (final key in (value as YamlMap).keys) { + for (final key in value.keys) { if (key == strings.entryPoints || key == strings.includeDirectives) { if (!checkType([name, key as String], value[key])) { return false; @@ -218,7 +218,7 @@ Declaration declarationConfigExtractor(dynamic yamlMap) { final memberRenamePatterns = []; final memberRenamerFull = {}; - final include = (yamlMap[strings.include] as YamlList)?.cast(); + final include = (yamlMap[strings.include] as YamlList?)?.cast(); if (include != null) { for (final str in include) { if (isFullDeclarationName(str)) { @@ -229,7 +229,7 @@ Declaration declarationConfigExtractor(dynamic yamlMap) { } } - final exclude = (yamlMap[strings.exclude] as YamlList)?.cast(); + final exclude = (yamlMap[strings.exclude] as YamlList?)?.cast(); if (exclude != null) { for (final str in exclude) { if (isFullDeclarationName(str)) { @@ -240,34 +240,34 @@ Declaration declarationConfigExtractor(dynamic yamlMap) { } } - final rename = (yamlMap[strings.rename] as YamlMap)?.cast(); + final rename = (yamlMap[strings.rename] as YamlMap?)?.cast(); if (rename != null) { for (final str in rename.keys) { if (isFullDeclarationName(str)) { - renameFull[str] = rename[str]; + renameFull[str] = rename[str]!; } else { renamePatterns - .add(RegExpRenamer(RegExp(str, dotAll: true), rename[str])); + .add(RegExpRenamer(RegExp(str, dotAll: true), rename[str]!)); } } } final memberRename = - (yamlMap[strings.memberRename] as YamlMap)?.cast(); + (yamlMap[strings.memberRename] as YamlMap?)?.cast(); if (memberRename != null) { for (final decl in memberRename.keys) { final renamePatterns = []; final renameFull = {}; - final memberRenameMap = memberRename[decl].cast(); + final memberRenameMap = memberRename[decl]!.cast(); for (final member in memberRenameMap.keys) { if (isFullDeclarationName(member)) { - renameFull[member] = memberRenameMap[member]; + renameFull[member] = memberRenameMap[member]!; } else { renamePatterns.add(RegExpRenamer( - RegExp(member, dotAll: true), memberRenameMap[member])); + RegExp(member, dotAll: true), memberRenameMap[member]!)); } } if (isFullDeclarationName(decl)) { @@ -321,7 +321,7 @@ bool declarationConfigValidator(String name, dynamic value) { } else { for (final subkey in value[key].keys) { if (!checkType( - [name, key as String, subkey as String], value[key][subkey])) { + [name, key, subkey as String], value[key][subkey])) { _result = false; } } @@ -332,15 +332,14 @@ bool declarationConfigValidator(String name, dynamic value) { } else { for (final declNameKey in value[key].keys) { if (!checkType( - [name, key as String, declNameKey as String], - value[key][declNameKey])) { + [name, key, declNameKey as String], value[key][declNameKey])) { _result = false; } else { for (final memberNameKey in value[key][declNameKey].keys) { if (!checkType([ name, - key as String, - declNameKey as String, + key, + declNameKey, memberNameKey as String, ], value[key][declNameKey][memberNameKey])) { _result = false; diff --git a/pkgs/ffigen/lib/src/find_resource.dart b/pkgs/ffigen/lib/src/find_resource.dart index 7a8df1ab0b..c16d47ff12 100644 --- a/pkgs/ffigen/lib/src/find_resource.dart +++ b/pkgs/ffigen/lib/src/find_resource.dart @@ -11,7 +11,7 @@ import 'package:yaml/yaml.dart'; final _logger = Logger('ffigen.find_resource'); /// Find the `.dart_tool/` folder, returns `null` if unable to find it. -Uri findDotDartTool() { +Uri? findDotDartTool() { // HACK: Because 'dart:isolate' is unavailable in Flutter we have no means // by which we can find the location of the package_config.json file. // Which we need, because the binary library created by: @@ -32,7 +32,7 @@ Uri findDotDartTool() { } /// Get [Uri] for [posixPath] inside ffigen's rootUri. -Uri _findInPackageRoot(String posixPath) { +Uri? _findInPackageRoot(String posixPath) { var root = Directory.current.uri; // Traverse up until we see a `.dart_tool/package_config.json` file. do { @@ -67,22 +67,22 @@ Uri _findInPackageRoot(String posixPath) { return null; } -Uri findWrapper(String wrapperName) { +Uri? findWrapper(String wrapperName) { return _findInPackageRoot('lib/src/clang_library/$wrapperName'); } -Uri _findFfigenPubspecYaml() { +Uri? _findFfigenPubspecYaml() { return _findInPackageRoot('pubspec.yaml'); } -String _ffigenVersion; +String? _ffigenVersion; /// Gets ffigen version from ffigen's pubspec.yaml -String get ffigenVersion { +String? get ffigenVersion { if (_ffigenVersion == null) { try { final yaml = - loadYaml(File.fromUri(_findFfigenPubspecYaml()).readAsStringSync()) + loadYaml(File.fromUri(_findFfigenPubspecYaml()!).readAsStringSync()) as YamlMap; final rawVersion = yaml['version'] as String; // Sanitize name to be used as a file name. diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index b10830201f..db8439863b 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -61,13 +61,13 @@ class Clang { _clang_createIndex ??= _dylib.lookupFunction<_c_clang_createIndex, _dart_clang_createIndex>( 'clang_createIndex'); - return _clang_createIndex( + return _clang_createIndex!( excludeDeclarationsFromPCH, displayDiagnostics, ); } - _dart_clang_createIndex _clang_createIndex; + _dart_clang_createIndex? _clang_createIndex; /// Destroy the given index. /// @@ -79,12 +79,12 @@ class Clang { _clang_disposeIndex ??= _dylib.lookupFunction<_c_clang_disposeIndex, _dart_clang_disposeIndex>( 'clang_disposeIndex'); - return _clang_disposeIndex( + return _clang_disposeIndex!( index, ); } - _dart_clang_disposeIndex _clang_disposeIndex; + _dart_clang_disposeIndex? _clang_disposeIndex; /// Determine the number of diagnostics produced for the given /// translation unit. @@ -94,12 +94,12 @@ class Clang { _clang_getNumDiagnostics ??= _dylib.lookupFunction< _c_clang_getNumDiagnostics, _dart_clang_getNumDiagnostics>('clang_getNumDiagnostics'); - return _clang_getNumDiagnostics( + return _clang_getNumDiagnostics!( Unit, ); } - _dart_clang_getNumDiagnostics _clang_getNumDiagnostics; + _dart_clang_getNumDiagnostics? _clang_getNumDiagnostics; /// Retrieve a diagnostic associated with the given translation unit. /// @@ -114,13 +114,13 @@ class Clang { ) { _clang_getDiagnostic ??= _dylib.lookupFunction<_c_clang_getDiagnostic, _dart_clang_getDiagnostic>('clang_getDiagnostic'); - return _clang_getDiagnostic( + return _clang_getDiagnostic!( Unit, Index, ); } - _dart_clang_getDiagnostic _clang_getDiagnostic; + _dart_clang_getDiagnostic? _clang_getDiagnostic; /// Destroy a diagnostic. void clang_disposeDiagnostic( @@ -129,12 +129,12 @@ class Clang { _clang_disposeDiagnostic ??= _dylib.lookupFunction< _c_clang_disposeDiagnostic, _dart_clang_disposeDiagnostic>('clang_disposeDiagnostic'); - return _clang_disposeDiagnostic( + return _clang_disposeDiagnostic!( Diagnostic, ); } - _dart_clang_disposeDiagnostic _clang_disposeDiagnostic; + _dart_clang_disposeDiagnostic? _clang_disposeDiagnostic; /// Same as \c clang_parseTranslationUnit2, but returns /// the \c CXTranslationUnit instead of an error code. In case of an error this @@ -152,7 +152,7 @@ class Clang { _clang_parseTranslationUnit ??= _dylib.lookupFunction< _c_clang_parseTranslationUnit, _dart_clang_parseTranslationUnit>('clang_parseTranslationUnit'); - return _clang_parseTranslationUnit( + return _clang_parseTranslationUnit!( CIdx, source_filename, command_line_args, @@ -163,7 +163,7 @@ class Clang { ); } - _dart_clang_parseTranslationUnit _clang_parseTranslationUnit; + _dart_clang_parseTranslationUnit? _clang_parseTranslationUnit; /// Destroy the specified CXTranslationUnit object. void clang_disposeTranslationUnit( @@ -172,12 +172,12 @@ class Clang { _clang_disposeTranslationUnit ??= _dylib.lookupFunction< _c_clang_disposeTranslationUnit, _dart_clang_disposeTranslationUnit>('clang_disposeTranslationUnit'); - return _clang_disposeTranslationUnit( + return _clang_disposeTranslationUnit!( arg0, ); } - _dart_clang_disposeTranslationUnit _clang_disposeTranslationUnit; + _dart_clang_disposeTranslationUnit? _clang_disposeTranslationUnit; /// Returns the kind of the evaluated result. int clang_EvalResult_getKind( @@ -186,12 +186,12 @@ class Clang { _clang_EvalResult_getKind ??= _dylib.lookupFunction< _c_clang_EvalResult_getKind, _dart_clang_EvalResult_getKind>('clang_EvalResult_getKind'); - return _clang_EvalResult_getKind( + return _clang_EvalResult_getKind!( E, ); } - _dart_clang_EvalResult_getKind _clang_EvalResult_getKind; + _dart_clang_EvalResult_getKind? _clang_EvalResult_getKind; /// Returns the evaluation result as integer if the /// kind is Int. @@ -201,12 +201,12 @@ class Clang { _clang_EvalResult_getAsInt ??= _dylib.lookupFunction< _c_clang_EvalResult_getAsInt, _dart_clang_EvalResult_getAsInt>('clang_EvalResult_getAsInt'); - return _clang_EvalResult_getAsInt( + return _clang_EvalResult_getAsInt!( E, ); } - _dart_clang_EvalResult_getAsInt _clang_EvalResult_getAsInt; + _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 @@ -217,12 +217,12 @@ class Clang { _clang_EvalResult_getAsLongLong ??= _dylib.lookupFunction< _c_clang_EvalResult_getAsLongLong, _dart_clang_EvalResult_getAsLongLong>('clang_EvalResult_getAsLongLong'); - return _clang_EvalResult_getAsLongLong( + return _clang_EvalResult_getAsLongLong!( E, ); } - _dart_clang_EvalResult_getAsLongLong _clang_EvalResult_getAsLongLong; + _dart_clang_EvalResult_getAsLongLong? _clang_EvalResult_getAsLongLong; /// Returns the evaluation result as double if the /// kind is double. @@ -232,12 +232,12 @@ class Clang { _clang_EvalResult_getAsDouble ??= _dylib.lookupFunction< _c_clang_EvalResult_getAsDouble, _dart_clang_EvalResult_getAsDouble>('clang_EvalResult_getAsDouble'); - return _clang_EvalResult_getAsDouble( + return _clang_EvalResult_getAsDouble!( E, ); } - _dart_clang_EvalResult_getAsDouble _clang_EvalResult_getAsDouble; + _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, @@ -249,12 +249,12 @@ class Clang { _clang_EvalResult_getAsStr ??= _dylib.lookupFunction< _c_clang_EvalResult_getAsStr, _dart_clang_EvalResult_getAsStr>('clang_EvalResult_getAsStr'); - return _clang_EvalResult_getAsStr( + return _clang_EvalResult_getAsStr!( E, ); } - _dart_clang_EvalResult_getAsStr _clang_EvalResult_getAsStr; + _dart_clang_EvalResult_getAsStr? _clang_EvalResult_getAsStr; /// Disposes the created Eval memory. void clang_EvalResult_dispose( @@ -263,24 +263,24 @@ class Clang { _clang_EvalResult_dispose ??= _dylib.lookupFunction< _c_clang_EvalResult_dispose, _dart_clang_EvalResult_dispose>('clang_EvalResult_dispose'); - return _clang_EvalResult_dispose( + return _clang_EvalResult_dispose!( E, ); } - _dart_clang_EvalResult_dispose _clang_EvalResult_dispose; + _dart_clang_EvalResult_dispose? _clang_EvalResult_dispose; ffi.Pointer clang_getCString_wrap( ffi.Pointer string, ) { _clang_getCString_wrap ??= _dylib.lookupFunction<_c_clang_getCString_wrap, _dart_clang_getCString_wrap>('clang_getCString_wrap'); - return _clang_getCString_wrap( + return _clang_getCString_wrap!( string, ); } - _dart_clang_getCString_wrap _clang_getCString_wrap; + _dart_clang_getCString_wrap? _clang_getCString_wrap; void clang_disposeString_wrap( ffi.Pointer string, @@ -288,12 +288,12 @@ class Clang { _clang_disposeString_wrap ??= _dylib.lookupFunction< _c_clang_disposeString_wrap, _dart_clang_disposeString_wrap>('clang_disposeString_wrap'); - return _clang_disposeString_wrap( + return _clang_disposeString_wrap!( string, ); } - _dart_clang_disposeString_wrap _clang_disposeString_wrap; + _dart_clang_disposeString_wrap? _clang_disposeString_wrap; int clang_getCursorKind_wrap( ffi.Pointer cursor, @@ -301,12 +301,12 @@ class Clang { _clang_getCursorKind_wrap ??= _dylib.lookupFunction< _c_clang_getCursorKind_wrap, _dart_clang_getCursorKind_wrap>('clang_getCursorKind_wrap'); - return _clang_getCursorKind_wrap( + return _clang_getCursorKind_wrap!( cursor, ); } - _dart_clang_getCursorKind_wrap _clang_getCursorKind_wrap; + _dart_clang_getCursorKind_wrap? _clang_getCursorKind_wrap; ffi.Pointer clang_getCursorKindSpelling_wrap( int kind, @@ -315,12 +315,12 @@ class Clang { _c_clang_getCursorKindSpelling_wrap, _dart_clang_getCursorKindSpelling_wrap>( 'clang_getCursorKindSpelling_wrap'); - return _clang_getCursorKindSpelling_wrap( + return _clang_getCursorKindSpelling_wrap!( kind, ); } - _dart_clang_getCursorKindSpelling_wrap _clang_getCursorKindSpelling_wrap; + _dart_clang_getCursorKindSpelling_wrap? _clang_getCursorKindSpelling_wrap; ffi.Pointer clang_getCursorType_wrap( ffi.Pointer cursor, @@ -328,12 +328,12 @@ class Clang { _clang_getCursorType_wrap ??= _dylib.lookupFunction< _c_clang_getCursorType_wrap, _dart_clang_getCursorType_wrap>('clang_getCursorType_wrap'); - return _clang_getCursorType_wrap( + return _clang_getCursorType_wrap!( cursor, ); } - _dart_clang_getCursorType_wrap _clang_getCursorType_wrap; + _dart_clang_getCursorType_wrap? _clang_getCursorType_wrap; ffi.Pointer clang_getTypeSpelling_wrap( ffi.Pointer type, @@ -341,25 +341,25 @@ class Clang { _clang_getTypeSpelling_wrap ??= _dylib.lookupFunction< _c_clang_getTypeSpelling_wrap, _dart_clang_getTypeSpelling_wrap>('clang_getTypeSpelling_wrap'); - return _clang_getTypeSpelling_wrap( + return _clang_getTypeSpelling_wrap!( type, ); } - _dart_clang_getTypeSpelling_wrap _clang_getTypeSpelling_wrap; + _dart_clang_getTypeSpelling_wrap? _clang_getTypeSpelling_wrap; ffi.Pointer clang_getTypeKindSpelling_wrap( - int typeKind, + int? typeKind, ) { _clang_getTypeKindSpelling_wrap ??= _dylib.lookupFunction< _c_clang_getTypeKindSpelling_wrap, _dart_clang_getTypeKindSpelling_wrap>('clang_getTypeKindSpelling_wrap'); - return _clang_getTypeKindSpelling_wrap( + return _clang_getTypeKindSpelling_wrap!( typeKind, ); } - _dart_clang_getTypeKindSpelling_wrap _clang_getTypeKindSpelling_wrap; + _dart_clang_getTypeKindSpelling_wrap? _clang_getTypeKindSpelling_wrap; ffi.Pointer clang_getResultType_wrap( ffi.Pointer functionType, @@ -367,12 +367,12 @@ class Clang { _clang_getResultType_wrap ??= _dylib.lookupFunction< _c_clang_getResultType_wrap, _dart_clang_getResultType_wrap>('clang_getResultType_wrap'); - return _clang_getResultType_wrap( + return _clang_getResultType_wrap!( functionType, ); } - _dart_clang_getResultType_wrap _clang_getResultType_wrap; + _dart_clang_getResultType_wrap? _clang_getResultType_wrap; ffi.Pointer clang_getPointeeType_wrap( ffi.Pointer pointerType, @@ -380,12 +380,12 @@ class Clang { _clang_getPointeeType_wrap ??= _dylib.lookupFunction< _c_clang_getPointeeType_wrap, _dart_clang_getPointeeType_wrap>('clang_getPointeeType_wrap'); - return _clang_getPointeeType_wrap( + return _clang_getPointeeType_wrap!( pointerType, ); } - _dart_clang_getPointeeType_wrap _clang_getPointeeType_wrap; + _dart_clang_getPointeeType_wrap? _clang_getPointeeType_wrap; ffi.Pointer clang_getCanonicalType_wrap( ffi.Pointer typerefType, @@ -393,12 +393,12 @@ class Clang { _clang_getCanonicalType_wrap ??= _dylib.lookupFunction< _c_clang_getCanonicalType_wrap, _dart_clang_getCanonicalType_wrap>('clang_getCanonicalType_wrap'); - return _clang_getCanonicalType_wrap( + return _clang_getCanonicalType_wrap!( typerefType, ); } - _dart_clang_getCanonicalType_wrap _clang_getCanonicalType_wrap; + _dart_clang_getCanonicalType_wrap? _clang_getCanonicalType_wrap; ffi.Pointer clang_Type_getNamedType_wrap( ffi.Pointer elaboratedType, @@ -406,12 +406,12 @@ class Clang { _clang_Type_getNamedType_wrap ??= _dylib.lookupFunction< _c_clang_Type_getNamedType_wrap, _dart_clang_Type_getNamedType_wrap>('clang_Type_getNamedType_wrap'); - return _clang_Type_getNamedType_wrap( + return _clang_Type_getNamedType_wrap!( elaboratedType, ); } - _dart_clang_Type_getNamedType_wrap _clang_Type_getNamedType_wrap; + _dart_clang_Type_getNamedType_wrap? _clang_Type_getNamedType_wrap; ffi.Pointer clang_getTypeDeclaration_wrap( ffi.Pointer cxtype, @@ -419,12 +419,12 @@ class Clang { _clang_getTypeDeclaration_wrap ??= _dylib.lookupFunction< _c_clang_getTypeDeclaration_wrap, _dart_clang_getTypeDeclaration_wrap>('clang_getTypeDeclaration_wrap'); - return _clang_getTypeDeclaration_wrap( + return _clang_getTypeDeclaration_wrap!( cxtype, ); } - _dart_clang_getTypeDeclaration_wrap _clang_getTypeDeclaration_wrap; + _dart_clang_getTypeDeclaration_wrap? _clang_getTypeDeclaration_wrap; ffi.Pointer clang_getTypedefDeclUnderlyingType_wrap( ffi.Pointer cxcursor, @@ -433,12 +433,12 @@ class Clang { _c_clang_getTypedefDeclUnderlyingType_wrap, _dart_clang_getTypedefDeclUnderlyingType_wrap>( 'clang_getTypedefDeclUnderlyingType_wrap'); - return _clang_getTypedefDeclUnderlyingType_wrap( + return _clang_getTypedefDeclUnderlyingType_wrap!( cxcursor, ); } - _dart_clang_getTypedefDeclUnderlyingType_wrap + _dart_clang_getTypedefDeclUnderlyingType_wrap? _clang_getTypedefDeclUnderlyingType_wrap; /// The name of parameter, struct, typedef. @@ -448,12 +448,12 @@ class Clang { _clang_getCursorSpelling_wrap ??= _dylib.lookupFunction< _c_clang_getCursorSpelling_wrap, _dart_clang_getCursorSpelling_wrap>('clang_getCursorSpelling_wrap'); - return _clang_getCursorSpelling_wrap( + return _clang_getCursorSpelling_wrap!( cursor, ); } - _dart_clang_getCursorSpelling_wrap _clang_getCursorSpelling_wrap; + _dart_clang_getCursorSpelling_wrap? _clang_getCursorSpelling_wrap; ffi.Pointer clang_getTranslationUnitCursor_wrap( ffi.Pointer tu, @@ -462,12 +462,12 @@ class Clang { _c_clang_getTranslationUnitCursor_wrap, _dart_clang_getTranslationUnitCursor_wrap>( 'clang_getTranslationUnitCursor_wrap'); - return _clang_getTranslationUnitCursor_wrap( + return _clang_getTranslationUnitCursor_wrap!( tu, ); } - _dart_clang_getTranslationUnitCursor_wrap + _dart_clang_getTranslationUnitCursor_wrap? _clang_getTranslationUnitCursor_wrap; ffi.Pointer clang_formatDiagnostic_wrap( @@ -477,13 +477,13 @@ class Clang { _clang_formatDiagnostic_wrap ??= _dylib.lookupFunction< _c_clang_formatDiagnostic_wrap, _dart_clang_formatDiagnostic_wrap>('clang_formatDiagnostic_wrap'); - return _clang_formatDiagnostic_wrap( + return _clang_formatDiagnostic_wrap!( diag, opts, ); } - _dart_clang_formatDiagnostic_wrap _clang_formatDiagnostic_wrap; + _dart_clang_formatDiagnostic_wrap? _clang_formatDiagnostic_wrap; /// Visitor is a function pointer with parameters having pointers to cxcursor /// instead of cxcursor by default. @@ -495,14 +495,14 @@ class Clang { _clang_visitChildren_wrap ??= _dylib.lookupFunction< _c_clang_visitChildren_wrap, _dart_clang_visitChildren_wrap>('clang_visitChildren_wrap'); - return _clang_visitChildren_wrap( + return _clang_visitChildren_wrap!( parent, _modifiedVisitor, uid, ); } - _dart_clang_visitChildren_wrap _clang_visitChildren_wrap; + _dart_clang_visitChildren_wrap? _clang_visitChildren_wrap; int clang_Cursor_getNumArguments_wrap( ffi.Pointer cursor, @@ -511,12 +511,12 @@ class Clang { _c_clang_Cursor_getNumArguments_wrap, _dart_clang_Cursor_getNumArguments_wrap>( 'clang_Cursor_getNumArguments_wrap'); - return _clang_Cursor_getNumArguments_wrap( + return _clang_Cursor_getNumArguments_wrap!( cursor, ); } - _dart_clang_Cursor_getNumArguments_wrap _clang_Cursor_getNumArguments_wrap; + _dart_clang_Cursor_getNumArguments_wrap? _clang_Cursor_getNumArguments_wrap; ffi.Pointer clang_Cursor_getArgument_wrap( ffi.Pointer cursor, @@ -525,13 +525,13 @@ class Clang { _clang_Cursor_getArgument_wrap ??= _dylib.lookupFunction< _c_clang_Cursor_getArgument_wrap, _dart_clang_Cursor_getArgument_wrap>('clang_Cursor_getArgument_wrap'); - return _clang_Cursor_getArgument_wrap( + return _clang_Cursor_getArgument_wrap!( cursor, i, ); } - _dart_clang_Cursor_getArgument_wrap _clang_Cursor_getArgument_wrap; + _dart_clang_Cursor_getArgument_wrap? _clang_Cursor_getArgument_wrap; int clang_getNumArgTypes_wrap( ffi.Pointer cxtype, @@ -539,12 +539,12 @@ class Clang { _clang_getNumArgTypes_wrap ??= _dylib.lookupFunction< _c_clang_getNumArgTypes_wrap, _dart_clang_getNumArgTypes_wrap>('clang_getNumArgTypes_wrap'); - return _clang_getNumArgTypes_wrap( + return _clang_getNumArgTypes_wrap!( cxtype, ); } - _dart_clang_getNumArgTypes_wrap _clang_getNumArgTypes_wrap; + _dart_clang_getNumArgTypes_wrap? _clang_getNumArgTypes_wrap; ffi.Pointer clang_getArgType_wrap( ffi.Pointer cxtype, @@ -552,13 +552,13 @@ class Clang { ) { _clang_getArgType_wrap ??= _dylib.lookupFunction<_c_clang_getArgType_wrap, _dart_clang_getArgType_wrap>('clang_getArgType_wrap'); - return _clang_getArgType_wrap( + return _clang_getArgType_wrap!( cxtype, i, ); } - _dart_clang_getArgType_wrap _clang_getArgType_wrap; + _dart_clang_getArgType_wrap? _clang_getArgType_wrap; int clang_getEnumConstantDeclValue_wrap( ffi.Pointer cursor, @@ -567,12 +567,12 @@ class Clang { _c_clang_getEnumConstantDeclValue_wrap, _dart_clang_getEnumConstantDeclValue_wrap>( 'clang_getEnumConstantDeclValue_wrap'); - return _clang_getEnumConstantDeclValue_wrap( + return _clang_getEnumConstantDeclValue_wrap!( cursor, ); } - _dart_clang_getEnumConstantDeclValue_wrap + _dart_clang_getEnumConstantDeclValue_wrap? _clang_getEnumConstantDeclValue_wrap; /// Returns non-zero if the ranges are the same, zero if they differ. @@ -582,13 +582,13 @@ class Clang { ) { _clang_equalRanges_wrap ??= _dylib.lookupFunction<_c_clang_equalRanges_wrap, _dart_clang_equalRanges_wrap>('clang_equalRanges_wrap'); - return _clang_equalRanges_wrap( + return _clang_equalRanges_wrap!( c1, c2, ); } - _dart_clang_equalRanges_wrap _clang_equalRanges_wrap; + _dart_clang_equalRanges_wrap? _clang_equalRanges_wrap; /// Returns the comment range. ffi.Pointer clang_Cursor_getCommentRange_wrap( @@ -598,12 +598,12 @@ class Clang { _c_clang_Cursor_getCommentRange_wrap, _dart_clang_Cursor_getCommentRange_wrap>( 'clang_Cursor_getCommentRange_wrap'); - return _clang_Cursor_getCommentRange_wrap( + return _clang_Cursor_getCommentRange_wrap!( cursor, ); } - _dart_clang_Cursor_getCommentRange_wrap _clang_Cursor_getCommentRange_wrap; + _dart_clang_Cursor_getCommentRange_wrap? _clang_Cursor_getCommentRange_wrap; /// Returns the raw comment. ffi.Pointer clang_Cursor_getRawCommentText_wrap( @@ -613,12 +613,12 @@ class Clang { _c_clang_Cursor_getRawCommentText_wrap, _dart_clang_Cursor_getRawCommentText_wrap>( 'clang_Cursor_getRawCommentText_wrap'); - return _clang_Cursor_getRawCommentText_wrap( + return _clang_Cursor_getRawCommentText_wrap!( cursor, ); } - _dart_clang_Cursor_getRawCommentText_wrap + _dart_clang_Cursor_getRawCommentText_wrap? _clang_Cursor_getRawCommentText_wrap; /// Returns the first paragraph of doxygen doc comment. @@ -629,12 +629,12 @@ class Clang { _c_clang_Cursor_getBriefCommentText_wrap, _dart_clang_Cursor_getBriefCommentText_wrap>( 'clang_Cursor_getBriefCommentText_wrap'); - return _clang_Cursor_getBriefCommentText_wrap( + return _clang_Cursor_getBriefCommentText_wrap!( cursor, ); } - _dart_clang_Cursor_getBriefCommentText_wrap + _dart_clang_Cursor_getBriefCommentText_wrap? _clang_Cursor_getBriefCommentText_wrap; ffi.Pointer clang_getCursorLocation_wrap( @@ -643,12 +643,12 @@ class Clang { _clang_getCursorLocation_wrap ??= _dylib.lookupFunction< _c_clang_getCursorLocation_wrap, _dart_clang_getCursorLocation_wrap>('clang_getCursorLocation_wrap'); - return _clang_getCursorLocation_wrap( + return _clang_getCursorLocation_wrap!( cursor, ); } - _dart_clang_getCursorLocation_wrap _clang_getCursorLocation_wrap; + _dart_clang_getCursorLocation_wrap? _clang_getCursorLocation_wrap; void clang_getFileLocation_wrap( ffi.Pointer location, @@ -660,7 +660,7 @@ class Clang { _clang_getFileLocation_wrap ??= _dylib.lookupFunction< _c_clang_getFileLocation_wrap, _dart_clang_getFileLocation_wrap>('clang_getFileLocation_wrap'); - return _clang_getFileLocation_wrap( + return _clang_getFileLocation_wrap!( location, file, line, @@ -669,19 +669,19 @@ class Clang { ); } - _dart_clang_getFileLocation_wrap _clang_getFileLocation_wrap; + _dart_clang_getFileLocation_wrap? _clang_getFileLocation_wrap; ffi.Pointer clang_getFileName_wrap( ffi.Pointer SFile, ) { _clang_getFileName_wrap ??= _dylib.lookupFunction<_c_clang_getFileName_wrap, _dart_clang_getFileName_wrap>('clang_getFileName_wrap'); - return _clang_getFileName_wrap( + return _clang_getFileName_wrap!( SFile, ); } - _dart_clang_getFileName_wrap _clang_getFileName_wrap; + _dart_clang_getFileName_wrap? _clang_getFileName_wrap; int clang_getNumElements_wrap( ffi.Pointer cxtype, @@ -689,12 +689,12 @@ class Clang { _clang_getNumElements_wrap ??= _dylib.lookupFunction< _c_clang_getNumElements_wrap, _dart_clang_getNumElements_wrap>('clang_getNumElements_wrap'); - return _clang_getNumElements_wrap( + return _clang_getNumElements_wrap!( cxtype, ); } - _dart_clang_getNumElements_wrap _clang_getNumElements_wrap; + _dart_clang_getNumElements_wrap? _clang_getNumElements_wrap; ffi.Pointer clang_getArrayElementType_wrap( ffi.Pointer cxtype, @@ -702,12 +702,12 @@ class Clang { _clang_getArrayElementType_wrap ??= _dylib.lookupFunction< _c_clang_getArrayElementType_wrap, _dart_clang_getArrayElementType_wrap>('clang_getArrayElementType_wrap'); - return _clang_getArrayElementType_wrap( + return _clang_getArrayElementType_wrap!( cxtype, ); } - _dart_clang_getArrayElementType_wrap _clang_getArrayElementType_wrap; + _dart_clang_getArrayElementType_wrap? _clang_getArrayElementType_wrap; int clang_Cursor_isMacroFunctionLike_wrap( ffi.Pointer cursor, @@ -716,12 +716,12 @@ class Clang { _c_clang_Cursor_isMacroFunctionLike_wrap, _dart_clang_Cursor_isMacroFunctionLike_wrap>( 'clang_Cursor_isMacroFunctionLike_wrap'); - return _clang_Cursor_isMacroFunctionLike_wrap( + return _clang_Cursor_isMacroFunctionLike_wrap!( cursor, ); } - _dart_clang_Cursor_isMacroFunctionLike_wrap + _dart_clang_Cursor_isMacroFunctionLike_wrap? _clang_Cursor_isMacroFunctionLike_wrap; int clang_Cursor_isMacroBuiltin_wrap( @@ -731,12 +731,12 @@ class Clang { _c_clang_Cursor_isMacroBuiltin_wrap, _dart_clang_Cursor_isMacroBuiltin_wrap>( 'clang_Cursor_isMacroBuiltin_wrap'); - return _clang_Cursor_isMacroBuiltin_wrap( + return _clang_Cursor_isMacroBuiltin_wrap!( cursor, ); } - _dart_clang_Cursor_isMacroBuiltin_wrap _clang_Cursor_isMacroBuiltin_wrap; + _dart_clang_Cursor_isMacroBuiltin_wrap? _clang_Cursor_isMacroBuiltin_wrap; ffi.Pointer clang_Cursor_Evaluate_wrap( ffi.Pointer cursor, @@ -744,12 +744,12 @@ class Clang { _clang_Cursor_Evaluate_wrap ??= _dylib.lookupFunction< _c_clang_Cursor_Evaluate_wrap, _dart_clang_Cursor_Evaluate_wrap>('clang_Cursor_Evaluate_wrap'); - return _clang_Cursor_Evaluate_wrap( + return _clang_Cursor_Evaluate_wrap!( cursor, ); } - _dart_clang_Cursor_Evaluate_wrap _clang_Cursor_Evaluate_wrap; + _dart_clang_Cursor_Evaluate_wrap? _clang_Cursor_Evaluate_wrap; int clang_Cursor_isAnonymous_wrap( ffi.Pointer cursor, @@ -757,12 +757,12 @@ class Clang { _clang_Cursor_isAnonymous_wrap ??= _dylib.lookupFunction< _c_clang_Cursor_isAnonymous_wrap, _dart_clang_Cursor_isAnonymous_wrap>('clang_Cursor_isAnonymous_wrap'); - return _clang_Cursor_isAnonymous_wrap( + return _clang_Cursor_isAnonymous_wrap!( cursor, ); } - _dart_clang_Cursor_isAnonymous_wrap _clang_Cursor_isAnonymous_wrap; + _dart_clang_Cursor_isAnonymous_wrap? _clang_Cursor_isAnonymous_wrap; int clang_Cursor_isAnonymousRecordDecl_wrap( ffi.Pointer cursor, @@ -771,12 +771,12 @@ class Clang { _c_clang_Cursor_isAnonymousRecordDecl_wrap, _dart_clang_Cursor_isAnonymousRecordDecl_wrap>( 'clang_Cursor_isAnonymousRecordDecl_wrap'); - return _clang_Cursor_isAnonymousRecordDecl_wrap( + return _clang_Cursor_isAnonymousRecordDecl_wrap!( cursor, ); } - _dart_clang_Cursor_isAnonymousRecordDecl_wrap + _dart_clang_Cursor_isAnonymousRecordDecl_wrap? _clang_Cursor_isAnonymousRecordDecl_wrap; ffi.Pointer clang_getCursorUSR_wrap( @@ -785,12 +785,12 @@ class Clang { _clang_getCursorUSR_wrap ??= _dylib.lookupFunction< _c_clang_getCursorUSR_wrap, _dart_clang_getCursorUSR_wrap>('clang_getCursorUSR_wrap'); - return _clang_getCursorUSR_wrap( + return _clang_getCursorUSR_wrap!( cursor, ); } - _dart_clang_getCursorUSR_wrap _clang_getCursorUSR_wrap; + _dart_clang_getCursorUSR_wrap? _clang_getCursorUSR_wrap; int clang_getFieldDeclBitWidth_wrap( ffi.Pointer cursor, @@ -799,12 +799,12 @@ class Clang { _c_clang_getFieldDeclBitWidth_wrap, _dart_clang_getFieldDeclBitWidth_wrap>( 'clang_getFieldDeclBitWidth_wrap'); - return _clang_getFieldDeclBitWidth_wrap( + return _clang_getFieldDeclBitWidth_wrap!( cursor, ); } - _dart_clang_getFieldDeclBitWidth_wrap _clang_getFieldDeclBitWidth_wrap; + _dart_clang_getFieldDeclBitWidth_wrap? _clang_getFieldDeclBitWidth_wrap; } /// A character string. @@ -814,10 +814,10 @@ class Clang { /// 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 { - ffi.Pointer data; + ffi.Pointer? data; @ffi.Uint32() - int private_flags; + int? private_flags; } class CXTranslationUnitImpl extends ffi.Struct {} @@ -831,14 +831,14 @@ class CXUnsavedFile extends ffi.Struct { /// The file whose contents have not yet been saved. /// /// This file must already exist in the file system. - ffi.Pointer Filename; + ffi.Pointer? Filename; /// A buffer containing the unsaved contents of this file. - ffi.Pointer Contents; + ffi.Pointer? Contents; /// The length of the unsaved contents of this buffer. @ffi.Uint64() - int Length; + int? Length; } /// Identifies a specific source location within a translation @@ -847,14 +847,14 @@ class CXUnsavedFile extends ffi.Struct { /// Use clang_getExpansionLocation() or clang_getSpellingLocation() /// to map a source location to a particular file, line, and column. class CXSourceLocation extends ffi.Struct { - ffi.Pointer _unique_ptr_data_item_0; - ffi.Pointer _unique_ptr_data_item_1; + ffi.Pointer? _unique_ptr_data_item_0; + 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() - int int_data; + int? int_data; } /// Helper for array `ptr_data` in struct `CXSourceLocation`. @@ -873,7 +873,7 @@ class ArrayHelper_CXSourceLocation_ptr_data_level0 { } } - ffi.Pointer operator [](int index) { + ffi.Pointer? operator [](int index) { _checkBounds(index); switch (_absoluteIndex + index) { case 0: @@ -905,17 +905,17 @@ class ArrayHelper_CXSourceLocation_ptr_data_level0 { /// Use clang_getRangeStart() and clang_getRangeEnd() to retrieve the /// starting and end locations from a source range, respectively. class CXSourceRange extends ffi.Struct { - ffi.Pointer _unique_ptr_data_item_0; - ffi.Pointer _unique_ptr_data_item_1; + ffi.Pointer? _unique_ptr_data_item_0; + 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() - int begin_int_data; + int? begin_int_data; @ffi.Uint32() - int end_int_data; + int? end_int_data; } /// Helper for array `ptr_data` in struct `CXSourceRange`. @@ -934,7 +934,7 @@ class ArrayHelper_CXSourceRange_ptr_data_level0 { } } - ffi.Pointer operator [](int index) { + ffi.Pointer? operator [](int index) { _checkBounds(index); switch (_absoluteIndex + index) { case 0: @@ -1939,14 +1939,14 @@ abstract class CXCursorKind { /// source code into the AST. class CXCursor extends ffi.Struct { @ffi.Int32() - int kind; + int? kind; @ffi.Int32() - int xdata; + int? xdata; - ffi.Pointer _unique_data_item_0; - ffi.Pointer _unique_data_item_1; - ffi.Pointer _unique_data_item_2; + ffi.Pointer? _unique_data_item_0; + ffi.Pointer? _unique_data_item_1; + ffi.Pointer? _unique_data_item_2; /// Helper for array `data`. ArrayHelper_CXCursor_data_level0 get data => @@ -1969,7 +1969,7 @@ class ArrayHelper_CXCursor_data_level0 { } } - ffi.Pointer operator [](int index) { + ffi.Pointer? operator [](int index) { _checkBounds(index); switch (_absoluteIndex + index) { case 0: @@ -2134,10 +2134,10 @@ abstract class CXTypeKind { /// The type of an element in the abstract syntax tree. class CXType extends ffi.Struct { @ffi.Int32() - int kind; + int? kind; - ffi.Pointer _unique_data_item_0; - ffi.Pointer _unique_data_item_1; + ffi.Pointer? _unique_data_item_0; + ffi.Pointer? _unique_data_item_1; /// Helper for array `data`. ArrayHelper_CXType_data_level0 get data => @@ -2160,7 +2160,7 @@ class ArrayHelper_CXType_data_level0 { } } - ffi.Pointer operator [](int index) { + ffi.Pointer? operator [](int index) { _checkBounds(index); switch (_absoluteIndex + index) { case 0: @@ -2398,7 +2398,7 @@ typedef _c_clang_getTypeKindSpelling_wrap = ffi.Pointer Function( ); typedef _dart_clang_getTypeKindSpelling_wrap = ffi.Pointer Function( - int typeKind, + int? typeKind, ); typedef _c_clang_getResultType_wrap = ffi.Pointer Function( diff --git a/pkgs/ffigen/lib/src/header_parser/data.dart b/pkgs/ffigen/lib/src/header_parser/data.dart index c307a26614..462f069f0e 100644 --- a/pkgs/ffigen/lib/src/header_parser/data.dart +++ b/pkgs/ffigen/lib/src/header_parser/data.dart @@ -7,7 +7,6 @@ import 'dart:isolate'; import 'package:ffigen/src/code_generator.dart' show Constant; import 'package:ffigen/src/config_provider.dart' show Config; -import 'package:meta/meta.dart'; import 'clang_bindings/clang_bindings.dart' show Clang; import 'utils.dart'; @@ -16,19 +15,19 @@ import 'utils.dart'; /// Holds configurations. Config get config => _config; -Config _config; +late Config _config; /// Holds clang functions. Clang get clang => _clang; -Clang _clang; +late Clang _clang; // Tracks seen status for bindings BindingsIndex get bindingsIndex => _bindingsIndex; -BindingsIndex _bindingsIndex; +BindingsIndex _bindingsIndex = BindingsIndex(); /// Used for naming typedefs. IncrementalNamer get incrementalNamer => _incrementalNamer; -IncrementalNamer _incrementalNamer; +IncrementalNamer _incrementalNamer = IncrementalNamer(); /// Holds the unique id refering to this isolate. /// @@ -38,13 +37,13 @@ final uid = Isolate.current.controlPort.nativePort; /// Saved macros, Key: prefixedName, Value originalName. Map get savedMacros => _savedMacros; -Map _savedMacros; +Map _savedMacros = {}; /// Saved unnamed EnumConstants. List get unnamedEnumConstants => _unnamedEnumConstants; -List _unnamedEnumConstants; +List _unnamedEnumConstants = []; -void initializeGlobals({@required Config config, @required Clang clang}) { +void initializeGlobals({required Config config, required Clang clang}) { _config = config; _clang = clang; _incrementalNamer = IncrementalNamer(); diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart index 5c8775bbca..67efefcbda 100644 --- a/pkgs/ffigen/lib/src/header_parser/includer.dart +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -10,8 +10,7 @@ import 'data.dart'; bool shouldIncludeStruct(String usr, String name) { if (bindingsIndex.isSeenStruct(usr) || name == '') { return false; - } else if (config.structDecl == null || - config.structDecl.shouldInclude(name)) { + } else if (config.structDecl.shouldInclude(name)) { return true; } else { return false; @@ -21,8 +20,7 @@ bool shouldIncludeStruct(String usr, String name) { bool shouldIncludeFunc(String usr, String name) { if (bindingsIndex.isSeenFunc(usr) || name == '') { return false; - } else if (config.functionDecl == null || - config.functionDecl.shouldInclude(name)) { + } else if (config.functionDecl.shouldInclude(name)) { return true; } else { return false; @@ -32,8 +30,7 @@ bool shouldIncludeFunc(String usr, String name) { bool shouldIncludeEnumClass(String usr, String name) { if (bindingsIndex.isSeenEnumClass(usr) || name == '') { return false; - } else if (config.enumClassDecl == null || - config.enumClassDecl.shouldInclude(name)) { + } else if (config.enumClassDecl.shouldInclude(name)) { return true; } else { return false; @@ -43,8 +40,7 @@ bool shouldIncludeEnumClass(String usr, String name) { bool shouldIncludeUnnamedEnumConstant(String usr, String name) { if (bindingsIndex.isSeenUnnamedEnumConstant(usr) || name == '') { return false; - } else if (config.unnamedEnumConstants == null || - config.unnamedEnumConstants.shouldInclude(name)) { + } else if (config.unnamedEnumConstants.shouldInclude(name)) { return true; } else { return false; @@ -54,7 +50,7 @@ bool shouldIncludeUnnamedEnumConstant(String usr, String name) { bool shouldIncludeMacro(String usr, String name) { if (bindingsIndex.isSeenMacro(usr) || name == '') { return false; - } else if (config.macroDecl == null || config.macroDecl.shouldInclude(name)) { + } else if (config.macroDecl.shouldInclude(name)) { return true; } else { return false; @@ -66,7 +62,7 @@ final _headerCache = {}; /// True if a cursor should be included based on headers config, used on root /// declarations. -bool shouldIncludeRootCursor(String sourceFile) { +bool shouldIncludeRootCursor(String? sourceFile) { // Handle null in case of system headers or macros. if (sourceFile == null) { return false; @@ -78,5 +74,5 @@ bool shouldIncludeRootCursor(String sourceFile) { config.headers.includeFilter.shouldInclude(sourceFile); } - return _headerCache[sourceFile]; + return _headerCache[sourceFile]!; } diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index 0cbe3c8049..7ce92fe3d3 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -48,11 +48,12 @@ final _logger = Logger('ffigen.header_parser.parser'); /// Initializes parser, clears any previous values. void initParser(Config c) { // Find full path of dynamic library and initialize bindings. - if (findDotDartTool() == null) { + final ddt = findDotDartTool(); + if (ddt == null) { throw Exception('Unable to find .dart_tool.'); } else { final fullDylibPath = path.join( - findDotDartTool().toFilePath(), + ddt.toFilePath(), strings.ffigenFolderName, strings.dylibFileName, ); @@ -78,10 +79,8 @@ List parseToBindings() { config.compilerOpts.add(strings.fparseAllComments); } - if (config.compilerOpts != null) { - clangCmdArgs = createDynamicStringArray(config.compilerOpts); - cmdLen = config.compilerOpts.length; - } + clangCmdArgs = createDynamicStringArray(config.compilerOpts); + cmdLen = config.compilerOpts.length; // Contains all bindings. A set ensures we never have duplicates. final bindings = {}; @@ -114,7 +113,7 @@ List parseToBindings() { logTuDiagnostics(tu, _logger, headerLocation); final rootCursor = clang.clang_getTranslationUnitCursor_wrap(tu); - bindings.addAll(parseTranslationUnit(rootCursor)); + bindings.addAll(parseTranslationUnit(rootCursor)!); // Cleanup. rootCursor.dispose(); @@ -125,11 +124,9 @@ List parseToBindings() { bindings.addAll(unnamedEnumConstants); // Parse all saved macros. - bindings.addAll(parseSavedMacros()); + bindings.addAll(parseSavedMacros()!); - if (config.compilerOpts != null) { - clangCmdArgs.dispose(config.compilerOpts.length); - } + clangCmdArgs.dispose(config.compilerOpts.length); clang.clang_disposeIndex(index); return bindings.toList(); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index 06ce22553b..1097372c2e 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -18,18 +18,18 @@ final _logger = Logger('ffigen.header_parser.enumdecl_parser'); /// Holds temporary information regarding [EnumClass] while parsing. class _ParsedEnum { - EnumClass enumClass; + EnumClass? enumClass; _ParsedEnum(); } final _stack = Stack<_ParsedEnum>(); /// Parses a function declaration. -EnumClass parseEnumDeclaration( +EnumClass? parseEnumDeclaration( Pointer cursor, { /// Optionally provide name to use (useful in case enum is inside a typedef). - String name, + String? name, }) { _stack.push(_ParsedEnum()); final enumUsr = cursor.usr(); @@ -50,14 +50,14 @@ EnumClass parseEnumDeclaration( originalName: enumName, name: config.enumClassDecl.renameUsingConfig(enumName), ); - bindingsIndex.addEnumClassToSeen(enumUsr, _stack.top.enumClass); + bindingsIndex.addEnumClassToSeen(enumUsr, _stack.top.enumClass!); _addEnumConstant(cursor); } if (bindingsIndex.isSeenEnumClass(enumUsr)) { _stack.top.enumClass = bindingsIndex.getSeenEnumClass(enumUsr); // If enum is seen, update it's name. - _stack.top.enumClass.name = + _stack.top.enumClass!.name = config.enumClassDecl.renameUsingConfig(enumName); } @@ -102,7 +102,7 @@ int _enumCursorVisitor(Pointer cursor, /// Adds the parameter to func in [functiondecl_parser.dart]. void _addEnumConstantToEnumClass(Pointer cursor) { - _stack.top.enumClass.enumConstants.add( + _stack.top.enumClass!.enumConstants.add( EnumConstant( dartDoc: getCursorDocComment( cursor, @@ -110,7 +110,7 @@ void _addEnumConstantToEnumClass(Pointer cursor) { ), originalName: cursor.spelling(), name: config.enumClassDecl.renameMemberUsingConfig( - _stack.top.enumClass.originalName, + _stack.top.enumClass!.originalName, cursor.spelling(), ), value: clang.clang_getEnumConstantDeclValue_wrap(cursor)), diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index 3be5c1ed98..2b005d8164 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -17,7 +17,7 @@ final _logger = Logger('ffigen.header_parser.functiondecl_parser'); /// Holds temporary information regarding [Func] while parsing. class _ParserFunc { - Func func; + Func? func; bool structByValueParameter = false; bool unimplementedParameterType = false; _ParserFunc(); @@ -26,7 +26,7 @@ class _ParserFunc { final _stack = Stack<_ParserFunc>(); /// Parses a function declaration. -Func parseFunctionDeclaration(Pointer cursor) { +Func? parseFunctionDeclaration(Pointer cursor) { _stack.push(_ParserFunc()); _stack.top.structByValueParameter = false; _stack.top.unimplementedParameterType = false; @@ -72,7 +72,7 @@ Func parseFunctionDeclaration(Pointer cursor) { returnType: rt, parameters: parameters, ); - bindingsIndex.addFuncToSeen(funcUsr, _stack.top.func); + bindingsIndex.addFuncToSeen(funcUsr, _stack.top.func!); } else if (bindingsIndex.isSeenFunc(funcUsr)) { _stack.top.func = bindingsIndex.getSeenFunc(funcUsr); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart index 6c13ada060..704eadecaa 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart @@ -43,12 +43,12 @@ void _saveMacro(String name, String usr, String originalName) { savedMacros[name] = Macro(usr, originalName); } -List _bindings; +List? _bindings; /// Macros cannot be parsed directly, so we create a new `.hpp` file in which /// they are assigned to a variable after which their value can be determined /// by evaluating the value of the variable. -List parseSavedMacros() { +List? parseSavedMacros() { _bindings = []; if (savedMacros.keys.isEmpty) { @@ -102,7 +102,7 @@ List parseSavedMacros() { /// Child visitor invoked on translationUnitCursor for parsing macroVariables. int _macroVariablevisitor(Pointer cursor, Pointer parent, Pointer clientData) { - Constant constant; + Constant? constant; try { if (isFromGeneratedFile(cursor) && _macroVarNames.contains(cursor.spelling()) && @@ -116,8 +116,8 @@ int _macroVariablevisitor(Pointer cursor, switch (k) { case clang_types.CXEvalResultKind.CXEval_Int: constant = Constant( - usr: savedMacros[macroName].usr, - originalName: savedMacros[macroName].originalName, + usr: savedMacros[macroName]!.usr, + originalName: savedMacros[macroName]!.originalName, name: macroName, rawType: 'int', rawValue: clang.clang_EvalResult_getAsLongLong(e).toString(), @@ -125,8 +125,8 @@ int _macroVariablevisitor(Pointer cursor, break; case clang_types.CXEvalResultKind.CXEval_Float: constant = Constant( - usr: savedMacros[macroName].usr, - originalName: savedMacros[macroName].originalName, + usr: savedMacros[macroName]!.usr, + originalName: savedMacros[macroName]!.originalName, name: macroName, rawType: 'double', rawValue: @@ -139,8 +139,8 @@ int _macroVariablevisitor(Pointer cursor, clang.clang_EvalResult_getAsStr(e), ); constant = Constant( - usr: savedMacros[macroName].usr, - originalName: savedMacros[macroName].originalName, + usr: savedMacros[macroName]!.usr, + originalName: savedMacros[macroName]!.originalName, name: macroName, rawType: 'String', rawValue: "'${rawValue}'", @@ -150,7 +150,7 @@ int _macroVariablevisitor(Pointer cursor, clang.clang_EvalResult_dispose(e); if (constant != null) { - _bindings.add(constant); + _bindings!.add(constant); } } cursor.dispose(); @@ -174,12 +174,12 @@ bool isFromGeneratedFile(Pointer cursor) { } /// Base name of generated file. -String _generatedFileBaseName; +String? _generatedFileBaseName; /// Generated macro variable names. /// /// Used to determine if macro should be included in bindings or not. -Set _macroVarNames; +late Set _macroVarNames; /// Creates a temporary file for parsing macros in current directory. File createFileForMacros() { @@ -210,7 +210,7 @@ File createFileForMacros() { // Write macro. final macroVarName = MacroVariableString.encode(prefixedMacroName); sb.writeln( - 'auto ${macroVarName} = ${savedMacros[prefixedMacroName].originalName};'); + 'auto ${macroVarName} = ${savedMacros[prefixedMacroName]!.originalName};'); // Add to _macroVarNames. _macroVarNames.add(macroVarName); } @@ -235,7 +235,7 @@ class MacroVariableString { // Remove underscore. s = s.substring(1); final intReg = RegExp('[0-9]+'); - final lengthEnd = intReg.matchAsPrefix(s).end; + final lengthEnd = intReg.matchAsPrefix(s)!.end; final len = int.parse(s.substring(0, lengthEnd)); // Name starts after an unerscore. diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index 334349c892..bce2eb4ccb 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -16,7 +16,7 @@ final _logger = Logger('ffigen.header_parser.structdecl_parser'); /// Holds temporary information regarding [struc] while parsing. class _ParsedStruc { - Struc struc; + Struc? struc; bool nestedStructMember = false; bool unimplementedMemberType = false; bool flexibleArrayMember = false; @@ -29,11 +29,11 @@ class _ParsedStruc { final _stack = Stack<_ParsedStruc>(); /// Parses a struct declaration. -Struc parseStructDeclaration( +Struc? parseStructDeclaration( Pointer cursor, { /// Optionally provide name (useful in case struct is inside a typedef). - String name, + String? name, /// Option to ignore struct filter (Useful in case of extracting structs /// when they are passed/returned by an included function.) @@ -58,7 +58,7 @@ Struc parseStructDeclaration( ); // Adding to seen here to stop recursion if a struct has itself as a // member, members are updated later. - bindingsIndex.addStructToSeen(structUsr, _stack.top.struc); + bindingsIndex.addStructToSeen(structUsr, _stack.top.struc!); _setStructMembers(cursor); } @@ -66,7 +66,7 @@ Struc parseStructDeclaration( _stack.top.struc = bindingsIndex.getSeenStruct(structUsr); // If struct is seen, update it's name. - _stack.top.struc.name = config.structDecl.renameUsingConfig(structName); + _stack.top.struc!.name = config.structDecl.renameUsingConfig(structName); } return _stack.pop().struc; } @@ -90,38 +90,38 @@ void _setStructMembers(Pointer cursor) { _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(); + '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.nestedStructMember) { _logger.fine( '---- Removed Struct members, reason: struct has struct members ${cursor.completeStringRepr()}'); _logger.warning( - 'Removed All Struct Members from ${_stack.top.struc.name}(${_stack.top.struc.originalName}), Nested Structures not supported.'); - return _stack.top.struc.members.clear(); + 'Removed All Struct Members from ${_stack.top.struc!.name}(${_stack.top.struc!.originalName}), Nested Structures 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(); + '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(); + '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(); + '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) { _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(); + 'Removed All Struct Members from ${_stack.top.struc!.name}(${_stack.top.struc!.originalName}), Dart_Handle member not supported.'); + return _stack.top.struc!.members.clear(); } } @@ -142,7 +142,7 @@ int _structMembersVisitor(Pointer cursor, _stack.top.nestedStructMember = true; } else if (mt.broadType == BroadType.ConstantArray) { _stack.top.arrayMember = true; - if (mt.child.broadType == BroadType.Struct) { + if (mt.child!.broadType == BroadType.Struct) { // Setting this flag will exclude adding members for this struct's // bindings. _stack.top.nestedStructMember = true; @@ -161,7 +161,7 @@ int _structMembersVisitor(Pointer cursor, _stack.top.unimplementedMemberType = true; } - _stack.top.struc.members.add( + _stack.top.struc!.members.add( Member( dartDoc: getCursorDocComment( cursor, @@ -169,7 +169,7 @@ int _structMembersVisitor(Pointer cursor, ), originalName: cursor.spelling(), name: config.structDecl.renameMemberUsingConfig( - _stack.top.struc.originalName, + _stack.top.struc!.originalName, cursor.spelling(), ), type: mt, diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart index 3801dded87..de39f207b8 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart @@ -18,15 +18,15 @@ final _logger = Logger('ffigen.header_parser.typedefdecl_parser'); /// Holds temporary information regarding a typedef referenced [Binding] /// while parsing. class _ParsedTypedef { - Binding binding; - String typedefName; + Binding? binding; + String? typedefName; _ParsedTypedef(); } final _stack = Stack<_ParsedTypedef>(); /// Parses a typedef declaration. -Binding parseTypedefDeclaration(Pointer cursor) { +Binding? parseTypedefDeclaration(Pointer cursor) { _stack.push(_ParsedTypedef()); // Name of typedef. _stack.top.typedefName = cursor.spelling(); diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart index 5ca8997d53..c4ad7e9ec9 100644 --- a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -19,10 +19,10 @@ import 'utils.dart'; final _logger = Logger('ffigen.header_parser.translation_unit_parser'); -Set _bindings; +Set? _bindings; /// Parses the translation unit and returns the generated bindings. -Set parseTranslationUnit( +Set? parseTranslationUnit( Pointer translationUnitCursor) { _bindings = {}; final resultCode = clang.clang_visitChildren_wrap( @@ -78,9 +78,9 @@ int _rootCursorVisitor(Pointer cursor, } /// Adds to binding if unseen and not null. -void addToBindings(Binding b) { +void addToBindings(Binding? b) { if (b != null) { // This is a set, and hence will not have duplicates. - _bindings.add(b); + _bindings!.add(b); } } diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart index 6dd175f4fc..1ecfdb3c40 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart @@ -27,7 +27,7 @@ var cxTypeKindToSupportedNativeTypes = { clang.CXTypeKind.CXType_Enum: SupportedNativeType.Int32, }; -SupportedNativeType get enumNativeType => +SupportedNativeType? get enumNativeType => cxTypeKindToSupportedNativeTypes[clang.CXTypeKind.CXType_Enum]; var suportedTypedefToSuportedNativeType = { diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 4137e77b72..2c770305af 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -20,7 +20,7 @@ final _logger = Logger('ffigen.header_parser.extractor'); const _padding = ' '; /// Converts cxtype to a typestring code_generator can accept. -Type getCodeGenType(Pointer cxtype, {String parentName}) { +Type getCodeGenType(Pointer cxtype, {String? parentName}) { _logger.fine('${_padding}getCodeGenType ${cxtype.completeStringRepr()}'); final kind = cxtype.kind(); @@ -33,7 +33,7 @@ Type getCodeGenType(Pointer cxtype, {String parentName}) { // Replace Pointer<_Dart_Handle> with Handle. if (config.useDartHandle && s.broadType == BroadType.Struct && - s.struc.usr == strings.dartHandleUsr) { + s.struc!.usr == strings.dartHandleUsr) { return Type.handle(); } return Type.pointer(s); @@ -41,13 +41,14 @@ Type getCodeGenType(Pointer cxtype, {String parentName}) { final spelling = cxtype.spelling(); if (config.typedefNativeTypeMappings.containsKey(spelling)) { _logger.fine(' Type Mapped from typedef-map'); - return Type.nativeType(config.typedefNativeTypeMappings[spelling]); + return Type.nativeType(config.typedefNativeTypeMappings[spelling!]); } // Get name from supported typedef name if config allows. if (config.useSupportedTypedefs) { if (suportedTypedefToSuportedNativeType.containsKey(spelling)) { _logger.fine(' Type Mapped from supported typedef'); - return Type.nativeType(suportedTypedefToSuportedNativeType[spelling]); + return Type.nativeType( + suportedTypedefToSuportedNativeType[spelling!]); } } @@ -91,7 +92,7 @@ Type getCodeGenType(Pointer cxtype, {String parentName}) { default: if (cxTypeKindToSupportedNativeTypes.containsKey(kind)) { return Type.nativeType( - cxTypeKindToSupportedNativeTypes[kind], + cxTypeKindToSupportedNativeTypes[kind!], ); } else { _logger.fine( @@ -102,7 +103,8 @@ Type getCodeGenType(Pointer cxtype, {String parentName}) { } } -Type _extractfromRecord(Pointer cxtype, String parentName) { +Type _extractfromRecord( + Pointer cxtype, String? parentName) { Type type; final cursor = clang.clang_getTypeDeclaration_wrap(cxtype); @@ -145,7 +147,7 @@ Type _extractfromRecord(Pointer cxtype, String parentName) { // Used for function pointer arguments. Type _extractFromFunctionProto( - Pointer cxtype, String parentName) { + Pointer cxtype, String? parentName) { var name = parentName; // An empty name means the function prototype was declared in-place, instead @@ -168,7 +170,7 @@ Type _extractFromFunctionProto( ); } - Typedef typedefC; + Typedef? typedefC; if (bindingsIndex.isSeenFunctionTypedef(name)) { typedefC = bindingsIndex.getSeenFunctionTypedef(name); } else { diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index df41d6fa8f..ca7f0cfa08 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -45,7 +45,7 @@ void logTuDiagnostics( clang_types .CXDiagnosticDisplayOptions.CXDiagnostic_DisplayCategoryName, ); - logger.severe(' ' + cxstring.toStringAndDispose()); + logger.severe(' ' + cxstring.toStringAndDispose()!); clang.clang_disposeDiagnostic(diag); } } @@ -58,7 +58,7 @@ extension CXSourceRangeExt on Pointer { extension CXCursorExt on Pointer { String usr() { - return clang.clang_getCursorUSR_wrap(this).toStringAndDispose(); + return clang.clang_getCursorUSR_wrap(this).toStringAndDispose()!; } /// Returns the kind int from [clang_types.CXCursorKind]. @@ -68,14 +68,14 @@ extension CXCursorExt on Pointer { /// Name of the cursor (E.g function name, Struct name, Parameter name). String spelling() { - return clang.clang_getCursorSpelling_wrap(this).toStringAndDispose(); + return clang.clang_getCursorSpelling_wrap(this).toStringAndDispose()!; } /// Spelling for a [clang_types.CXCursorKind], useful for debug purposes. String kindSpelling() { return clang .clang_getCursorKindSpelling_wrap(clang.clang_getCursorKind_wrap(this)) - .toStringAndDispose(); + .toStringAndDispose()!; } /// for debug: returns [spelling] [kind] [kindSpelling] [type] [typeSpelling]. @@ -102,7 +102,7 @@ extension CXCursorExt on Pointer { return r; } - String sourceFileName() { + String? sourceFileName() { final cxsource = clang.clang_getCursorLocation_wrap(this); final cxfilePtr = allocate>(); final line = allocate(); @@ -137,9 +137,9 @@ Pointer lastCommentRange = nullptr; /// The given string is wrapped at line width = 80 - [indent]. The [indent] is /// [commentPrefix.dimensions] by default because a comment starts with /// [commentPrefix]. -String getCursorDocComment(Pointer cursor, +String? getCursorDocComment(Pointer cursor, [int indent = commentPrefix.length]) { - String formattedDocComment; + String? formattedDocComment; final currentCommentRange = clang.clang_Cursor_getCommentRange_wrap(cursor); // See if this comment and the last comment both point to the same source @@ -176,7 +176,7 @@ String getCursorDocComment(Pointer cursor, /// /// Wrapping will work properly only when String has no new lines /// characters(\n). -String _wrapNoNewLineString(String string, int lineWidth) { +String? _wrapNoNewLineString(String? string, int lineWidth) { if (string == null || string.isEmpty) { return null; } @@ -202,7 +202,7 @@ String _wrapNoNewLineString(String string, int lineWidth) { } /// Removes /*, */ and any *'s in the beginning of a line. -String removeRawCommentMarkups(String string) { +String? removeRawCommentMarkups(String? string) { if (string == null || string.isEmpty) { return null; } @@ -234,16 +234,16 @@ extension CXTypeExt on Pointer { } /// Spelling for a [clang_types.CXTypeKind], useful for debug purposes. - String spelling() { + String? spelling() { return clang.clang_getTypeSpelling_wrap(this).toStringAndDispose(); } /// Returns the typeKind int from [clang_types.CXTypeKind]. - int kind() { + int? kind() { return ref.kind; } - String kindSpelling() { + String? kindSpelling() { return clang.clang_getTypeKindSpelling_wrap(kind()).toStringAndDispose(); } @@ -264,8 +264,8 @@ extension CXStringExt on Pointer { /// /// Make sure to dispose CXstring using dispose method, or use the /// [toStringAndDispose] method. - String string() { - String s; + String? string() { + String? s; final cstring = clang.clang_getCString_wrap(this); if (cstring != nullptr) { s = Utf8.fromUtf8(cstring.cast()); @@ -274,7 +274,7 @@ extension CXStringExt on Pointer { } /// Converts CXString to dart string and disposes CXString. - String toStringAndDispose() { + String? toStringAndDispose() { // Note: clang_getCString_wrap returns a const char *, calling free will result in error. final s = string(); clang.clang_disposeString_wrap(this); @@ -329,7 +329,7 @@ class IncrementalNamer { class Macro { final String usr; - final String originalName; + final String? originalName; Macro(this.usr, this.originalName); } @@ -353,7 +353,7 @@ class BindingsIndex { _structs[usr] = struc; } - Struc getSeenStruct(String usr) { + Struc? getSeenStruct(String usr) { return _structs[usr]; } @@ -365,7 +365,7 @@ class BindingsIndex { _functions[usr] = func; } - Func getSeenFunc(String usr) { + Func? getSeenFunc(String usr) { return _functions[usr]; } @@ -377,7 +377,7 @@ class BindingsIndex { _enumClass[usr] = enumClass; } - EnumClass getSeenEnumClass(String usr) { + EnumClass? getSeenEnumClass(String usr) { return _enumClass[usr]; } @@ -389,7 +389,7 @@ class BindingsIndex { _unnamedEnumConstants[usr] = enumConstant; } - Constant getSeenUnnamedEnumConstant(String usr) { + Constant? getSeenUnnamedEnumConstant(String usr) { return _unnamedEnumConstants[usr]; } @@ -401,7 +401,7 @@ class BindingsIndex { _macros[usr] = macro; } - String getSeenMacro(String usr) { + String? getSeenMacro(String usr) { return _macros[usr]; } @@ -413,7 +413,7 @@ class BindingsIndex { _functionTypedefs[originalName] = t; } - Typedef getSeenFunctionTypedef(String originalName) { + Typedef? getSeenFunctionTypedef(String originalName) { return _functionTypedefs[originalName]; } } diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 74dc0faeaa..0abc9de21e 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -8,7 +8,7 @@ import 'package:ffigen/src/find_resource.dart'; import 'package:ffigen/src/header_parser/clang_bindings/clang_bindings.dart' as clang; -String get dylibVersion => ffigenVersion; +String? get dylibVersion => ffigenVersion; /// Name of the dynamic library file according to current platform. String get dylibFileName { diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 80feda7e5b..2a0700155a 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,25 +3,24 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 1.2.0 +version: 2.0.0-nullsafety.0 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C header files. environment: - sdk: '>=2.7.0 <3.0.0' + sdk: '>=2.12.0-29.10.beta <3.0.0' dependencies: - ffi: ^0.1.3 - yaml: ^2.2.1 - meta: ^1.1.8 - args: ^1.6.0 - logging: ^0.11.4 - cli_util: ^0.2.0 - glob: ^1.2.0 - path: ^1.7.0 - quiver: ^2.1.3 - pub_semver: ^1.4.4 + ffi: ^0.2.0-nullsafety.1 + yaml: ^3.0.0-nullsafety.0 + path: ^1.8.0-nullsafety.3 + quiver: ^3.0.0-nullsafety.2 + args: ^1.6.0 # Not available + logging: ^0.11.4 # test->coverage->logging + cli_util: ^0.2.0 # test->analyzer->cli_util + glob: ^1.0.3 # test->analyzer->glob + pub_semver: ^1.4.4 # test->analyzer->pub_semver dev_dependencies: - pedantic: ^1.9.2 - test: ^1.15.3 + pedantic: ^1.10.0-nullsafety.3 + test: ^1.16.0-nullsafety.13 diff --git a/pkgs/ffigen/test/code_generator_test.dart b/pkgs/ffigen/test/code_generator_test.dart index 05dceb1a27..ea6393bacf 100644 --- a/pkgs/ffigen/test/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_test.dart @@ -94,35 +94,32 @@ Bindings(ffi.DynamicLibrary dynamicLibrary): _dylib = dynamicLibrary; /// heres another line int noParam( ) { -_noParam ??= _dylib.lookupFunction<_c_noParam,_dart_noParam>('noParam'); - return _noParam( +return (_noParam ??= _dylib.lookupFunction<_c_noParam,_dart_noParam>('noParam'))( ); } -_dart_noParam _noParam; +_dart_noParam? _noParam; int withPrimitiveParam( int a, int b, ) { -_withPrimitiveParam ??= _dylib.lookupFunction<_c_withPrimitiveParam,_dart_withPrimitiveParam>('withPrimitiveParam'); - return _withPrimitiveParam( +return (_withPrimitiveParam ??= _dylib.lookupFunction<_c_withPrimitiveParam,_dart_withPrimitiveParam>('withPrimitiveParam'))( a, b, ); } -_dart_withPrimitiveParam _withPrimitiveParam; +_dart_withPrimitiveParam? _withPrimitiveParam; ffi.Pointer withPointerParam( ffi.Pointer a, ffi.Pointer> b, ) { -_withPointerParam ??= _dylib.lookupFunction<_c_withPointerParam,_dart_withPointerParam>('withPointerParam'); - return _withPointerParam( +return (_withPointerParam ??= _dylib.lookupFunction<_c_withPointerParam,_dart_withPointerParam>('withPointerParam'))( a, b, ); } -_dart_withPointerParam _withPointerParam; +_dart_withPointerParam? _withPointerParam; } @@ -158,7 +155,7 @@ typedef _dart_withPointerParam = ffi.Pointer Function( } } catch (e) { file.writeAsStringSync(gen); - print('Failed test, Debug output: ${file.absolute?.path}'); + print('Failed test, Debug output: ${file.absolute.path}'); rethrow; } }); @@ -244,23 +241,23 @@ class NoMember extends ffi.Struct{ class WithPrimitiveMember extends ffi.Struct{ @ffi.Int32() - int a; + external int a; @ffi.Double() - double b; + external double b; @ffi.Uint8() - int c; + external int c; } class WithPointerMember extends ffi.Struct{ - ffi.Pointer a; + external ffi.Pointer a; - ffi.Pointer> b; + external ffi.Pointer> b; @ffi.Uint8() - int c; + external int c; } @@ -270,7 +267,7 @@ class WithPointerMember extends ffi.Struct{ } } catch (e) { file.writeAsStringSync(gen); - print('Failed test, Debug output: ${file.absolute?.path}'); + print('Failed test, Debug output: ${file.absolute.path}'); rethrow; } }); @@ -348,24 +345,23 @@ Bindings(ffi.DynamicLibrary dynamicLibrary): _dylib = dynamicLibrary; ffi.Pointer someFunc( ffi.Pointer> some, ) { -_someFunc ??= _dylib.lookupFunction<_c_someFunc,_dart_someFunc>('someFunc'); - return _someFunc( +return (_someFunc ??= _dylib.lookupFunction<_c_someFunc,_dart_someFunc>('someFunc'))( some, ); } -_dart_someFunc _someFunc; +_dart_someFunc? _someFunc; } class SomeStruc extends ffi.Struct{ @ffi.Int32() - int a; + external int a; @ffi.Double() - double b; + external double b; @ffi.Uint8() - int c; + external int c; } @@ -383,7 +379,7 @@ typedef _dart_someFunc = ffi.Pointer Function( } } catch (e) { file.writeAsStringSync(gen); - print('Failed test, Debug output: ${file.absolute?.path}'); + print('Failed test, Debug output: ${file.absolute.path}'); rethrow; } }); @@ -460,7 +456,7 @@ class Some extends ffi.Struct{ } } catch (e) { file.writeAsStringSync(gen); - print('Failed test, Debug output: ${file.absolute?.path}'); + print('Failed test, Debug output: ${file.absolute.path}'); rethrow; } }); @@ -504,7 +500,7 @@ const double test2 = 20.0; } } catch (e) { file.writeAsStringSync(gen); - print('Failed test, Debug output: ${file.absolute?.path}'); + print('Failed test, Debug output: ${file.absolute.path}'); rethrow; } }); @@ -553,7 +549,7 @@ abstract class Constants { } } catch (e) { file.writeAsStringSync(gen); - print('Failed test, Debug output: ${file.absolute?.path}'); + print('Failed test, Debug output: ${file.absolute.path}'); rethrow; } }); @@ -622,51 +618,46 @@ init_dylib_1(ffi.DynamicLibrary dynamicLibrary): _dylib = dynamicLibrary; void test( ) { -_test_1 ??= _dylib.lookupFunction<_c_test1,_dart_test1>('test'); - return _test_1( +return (_test_1 ??= _dylib.lookupFunction<_c_test1,_dart_test1>('test'))( ); } -_dart_test1 _test_1; +_dart_test1? _test_1; void _test( ) { -__test ??= _dylib.lookupFunction<_c__test,_dart__test>('_test'); - return __test( +return (__test ??= _dylib.lookupFunction<_c__test,_dart__test>('_test'))( ); } -_dart__test __test; +_dart__test? __test; void _c_test( ) { -__c_test ??= _dylib.lookupFunction<_c__c_test,_dart__c_test>('_c_test'); - return __c_test( +return (__c_test ??= _dylib.lookupFunction<_c__c_test,_dart__c_test>('_c_test'))( ); } -_dart__c_test __c_test; +_dart__c_test? __c_test; void _dart_test( ) { -__dart_test ??= _dylib.lookupFunction<_c__dart_test,_dart__dart_test>('_dart_test'); - return __dart_test( +return (__dart_test ??= _dylib.lookupFunction<_c__dart_test,_dart__dart_test>('_dart_test'))( ); } -_dart__dart_test __dart_test; +_dart__dart_test? __dart_test; void Test( ) { -_Test ??= _dylib.lookupFunction<_c_Test1,_dart_Test>('Test'); - return _Test( +return (_Test ??= _dylib.lookupFunction<_c_Test1,_dart_Test>('Test'))( ); } -_dart_Test _Test; +_dart_Test? _Test; } class _Test extends ffi.Struct{ @ffi.Int8() - int _unique_array_item_0; + external int _unique_array_item_0; @ffi.Int8() - int _unique_array_item_1; + external int _unique_array_item_1; /// Helper for array `array`. ArrayHelper1__Test_array_level0 get array => ArrayHelper1__Test_array_level0(this, [2], 0, 0); } @@ -753,7 +744,7 @@ typedef _dart_Test = void Function( } } catch (e) { file.writeAsStringSync(gen); - print('Failed test, Debug output: ${file.absolute?.path}'); + print('Failed test, Debug output: ${file.absolute.path}'); rethrow; } }); @@ -803,19 +794,18 @@ bool test1( bool a, ffi.Pointer b, ) { -_test1 ??= _dylib.lookupFunction<_c_test1,_dart_test1>('test1'); - return _test1( +return (_test1 ??= _dylib.lookupFunction<_c_test1,_dart_test1>('test1'))( a?1:0, b, )!=0; } -_dart_test1 _test1; +_dart_test1? _test1; } class test2 extends ffi.Struct{ @ffi.Uint8() - int a; + external int a; } @@ -835,7 +825,7 @@ typedef _dart_test1 = int Function( } } catch (e) { file.writeAsStringSync(gen); - print('Failed test, Debug output: ${file.absolute?.path}'); + print('Failed test, Debug output: ${file.absolute.path}'); rethrow; } }); @@ -884,19 +874,18 @@ int test1( int a, ffi.Pointer b, ) { -_test1 ??= _dylib.lookupFunction<_c_test1,_dart_test1>('test1'); - return _test1( +return (_test1 ??= _dylib.lookupFunction<_c_test1,_dart_test1>('test1'))( a, b, ); } -_dart_test1 _test1; +_dart_test1? _test1; } class test2 extends ffi.Struct{ @ffi.Uint8() - int a; + external int a; } @@ -916,7 +905,7 @@ typedef _dart_test1 = int Function( } } catch (e) { file.writeAsStringSync(gen); - print('Failed test, Debug output: ${file.absolute?.path}'); + print('Failed test, Debug output: ${file.absolute.path}'); rethrow; } }); diff --git a/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart b/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart index 3fdc12ce3a..16387ff450 100644 --- a/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart @@ -13,7 +13,7 @@ import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; -Library actual, expected; +late Library actual, expected; void main() { group('dart_handle_test', () { diff --git a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart index 909c13a597..9c3107c103 100644 --- a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart @@ -12,7 +12,7 @@ import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; -Library actual, expected; +late Library actual, expected; void main() { group('function_n_struct_test', () { diff --git a/pkgs/ffigen/test/header_parser_tests/functions_test.dart b/pkgs/ffigen/test/header_parser_tests/functions_test.dart index 2c898bc5ec..31e0506941 100644 --- a/pkgs/ffigen/test/header_parser_tests/functions_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/functions_test.dart @@ -11,7 +11,7 @@ import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; -Library actual, expected; +late Library actual, expected; void main() { group('functions_test', () { diff --git a/pkgs/ffigen/test/header_parser_tests/macros_test.dart b/pkgs/ffigen/test/header_parser_tests/macros_test.dart index 6ad50903d7..2611940279 100644 --- a/pkgs/ffigen/test/header_parser_tests/macros_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/macros_test.dart @@ -12,7 +12,7 @@ import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; -Library actual, expected; +late Library actual, expected; void main() { group('macros_test', () { diff --git a/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart index c1f2d37d67..54ef2909af 100644 --- a/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart @@ -14,7 +14,7 @@ import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; -Library actual; +late Library actual; void main() { group('unnamed_enums_test', () { setUpAll(() { @@ -59,27 +59,25 @@ NativeLibrary(ffi.DynamicLibrary dynamicLibrary): _dylib = dynamicLibrary; void func( ffi.Pointer> unnamed1, ) { -_func ??= _dylib.lookupFunction<_c_func,_dart_func>('func'); - return _func( +return (_func ??= _dylib.lookupFunction<_c_func,_dart_func>('func'))( unnamed1, ); } -_dart_func _func; +_dart_func? _func; void funcWithNativeFunc( ffi.Pointer> named, ) { -_funcWithNativeFunc ??= _dylib.lookupFunction<_c_funcWithNativeFunc,_dart_funcWithNativeFunc>('funcWithNativeFunc'); - return _funcWithNativeFunc( +return (_funcWithNativeFunc ??= _dylib.lookupFunction<_c_funcWithNativeFunc,_dart_funcWithNativeFunc>('funcWithNativeFunc'))( named, ); } -_dart_funcWithNativeFunc _funcWithNativeFunc; +_dart_funcWithNativeFunc? _funcWithNativeFunc; } class struc extends ffi.Struct{ - ffi.Pointer> unnamed1; + external ffi.Pointer> unnamed1; } @@ -125,7 +123,7 @@ typedef _typedefC_2 = ffi.Void Function( } } catch (e) { file.writeAsStringSync(gen); - print('Failed test, Debug output: ${file.absolute?.path}'); + print('Failed test, Debug output: ${file.absolute.path}'); rethrow; } }); diff --git a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart index c4c01a7aa4..40937c8158 100644 --- a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart @@ -11,7 +11,7 @@ import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; -Library actual, expected; +late Library actual, expected; void main() { group('nested_parsing_test', () { diff --git a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart index eeeb37c377..182b622900 100644 --- a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart @@ -12,7 +12,7 @@ import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; -Library actual, expected; +late Library actual, expected; void main() { group('typedef_test', () { diff --git a/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart b/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart index fa753929e3..02994afa22 100644 --- a/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart @@ -11,7 +11,7 @@ import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; -Library actual, expected; +late Library actual, expected; void main() { group('unnamed_enums_test', () { diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart index a22dd73601..c9820d2d57 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart @@ -12,93 +12,90 @@ class CJson { CJson(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; ffi.Pointer cJSON_Version() { - _cJSON_Version ??= _dylib - .lookupFunction<_c_cJSON_Version, _dart_cJSON_Version>('cJSON_Version'); - return _cJSON_Version(); + return (_cJSON_Version ??= + _dylib.lookupFunction<_c_cJSON_Version, _dart_cJSON_Version>( + 'cJSON_Version'))(); } - _dart_cJSON_Version _cJSON_Version; + _dart_cJSON_Version? _cJSON_Version; void cJSON_InitHooks( ffi.Pointer hooks, ) { - _cJSON_InitHooks ??= + return (_cJSON_InitHooks ??= _dylib.lookupFunction<_c_cJSON_InitHooks, _dart_cJSON_InitHooks>( - 'cJSON_InitHooks'); - return _cJSON_InitHooks( + 'cJSON_InitHooks'))( hooks, ); } - _dart_cJSON_InitHooks _cJSON_InitHooks; + _dart_cJSON_InitHooks? _cJSON_InitHooks; ffi.Pointer cJSON_Parse( ffi.Pointer value, ) { - _cJSON_Parse ??= - _dylib.lookupFunction<_c_cJSON_Parse, _dart_cJSON_Parse>('cJSON_Parse'); - return _cJSON_Parse( + return (_cJSON_Parse ??= _dylib + .lookupFunction<_c_cJSON_Parse, _dart_cJSON_Parse>('cJSON_Parse'))( value, ); } - _dart_cJSON_Parse _cJSON_Parse; + _dart_cJSON_Parse? _cJSON_Parse; ffi.Pointer cJSON_ParseWithOpts( ffi.Pointer value, ffi.Pointer> return_parse_end, int require_null_terminated, ) { - _cJSON_ParseWithOpts ??= _dylib.lookupFunction<_c_cJSON_ParseWithOpts, - _dart_cJSON_ParseWithOpts>('cJSON_ParseWithOpts'); - return _cJSON_ParseWithOpts( + return (_cJSON_ParseWithOpts ??= _dylib.lookupFunction< + _c_cJSON_ParseWithOpts, + _dart_cJSON_ParseWithOpts>('cJSON_ParseWithOpts'))( value, return_parse_end, require_null_terminated, ); } - _dart_cJSON_ParseWithOpts _cJSON_ParseWithOpts; + _dart_cJSON_ParseWithOpts? _cJSON_ParseWithOpts; ffi.Pointer cJSON_Print( ffi.Pointer item, ) { - _cJSON_Print ??= - _dylib.lookupFunction<_c_cJSON_Print, _dart_cJSON_Print>('cJSON_Print'); - return _cJSON_Print( + return (_cJSON_Print ??= _dylib + .lookupFunction<_c_cJSON_Print, _dart_cJSON_Print>('cJSON_Print'))( item, ); } - _dart_cJSON_Print _cJSON_Print; + _dart_cJSON_Print? _cJSON_Print; ffi.Pointer cJSON_PrintUnformatted( ffi.Pointer item, ) { - _cJSON_PrintUnformatted ??= _dylib.lookupFunction<_c_cJSON_PrintUnformatted, - _dart_cJSON_PrintUnformatted>('cJSON_PrintUnformatted'); - return _cJSON_PrintUnformatted( + return (_cJSON_PrintUnformatted ??= _dylib.lookupFunction< + _c_cJSON_PrintUnformatted, + _dart_cJSON_PrintUnformatted>('cJSON_PrintUnformatted'))( item, ); } - _dart_cJSON_PrintUnformatted _cJSON_PrintUnformatted; + _dart_cJSON_PrintUnformatted? _cJSON_PrintUnformatted; ffi.Pointer cJSON_PrintBuffered( ffi.Pointer item, int prebuffer, int fmt, ) { - _cJSON_PrintBuffered ??= _dylib.lookupFunction<_c_cJSON_PrintBuffered, - _dart_cJSON_PrintBuffered>('cJSON_PrintBuffered'); - return _cJSON_PrintBuffered( + return (_cJSON_PrintBuffered ??= _dylib.lookupFunction< + _c_cJSON_PrintBuffered, + _dart_cJSON_PrintBuffered>('cJSON_PrintBuffered'))( item, prebuffer, fmt, ); } - _dart_cJSON_PrintBuffered _cJSON_PrintBuffered; + _dart_cJSON_PrintBuffered? _cJSON_PrintBuffered; int cJSON_PrintPreallocated( ffi.Pointer item, @@ -106,10 +103,9 @@ class CJson { int length, int format, ) { - _cJSON_PrintPreallocated ??= _dylib.lookupFunction< + return (_cJSON_PrintPreallocated ??= _dylib.lookupFunction< _c_cJSON_PrintPreallocated, - _dart_cJSON_PrintPreallocated>('cJSON_PrintPreallocated'); - return _cJSON_PrintPreallocated( + _dart_cJSON_PrintPreallocated>('cJSON_PrintPreallocated'))( item, buffer, length, @@ -117,617 +113,581 @@ class CJson { ); } - _dart_cJSON_PrintPreallocated _cJSON_PrintPreallocated; + _dart_cJSON_PrintPreallocated? _cJSON_PrintPreallocated; void cJSON_Delete( ffi.Pointer item, ) { - _cJSON_Delete ??= _dylib - .lookupFunction<_c_cJSON_Delete, _dart_cJSON_Delete>('cJSON_Delete'); - return _cJSON_Delete( + return (_cJSON_Delete ??= _dylib + .lookupFunction<_c_cJSON_Delete, _dart_cJSON_Delete>('cJSON_Delete'))( item, ); } - _dart_cJSON_Delete _cJSON_Delete; + _dart_cJSON_Delete? _cJSON_Delete; int cJSON_GetArraySize( ffi.Pointer array, ) { - _cJSON_GetArraySize ??= + return (_cJSON_GetArraySize ??= _dylib.lookupFunction<_c_cJSON_GetArraySize, _dart_cJSON_GetArraySize>( - 'cJSON_GetArraySize'); - return _cJSON_GetArraySize( + 'cJSON_GetArraySize'))( array, ); } - _dart_cJSON_GetArraySize _cJSON_GetArraySize; + _dart_cJSON_GetArraySize? _cJSON_GetArraySize; ffi.Pointer cJSON_GetArrayItem( ffi.Pointer array, int index, ) { - _cJSON_GetArrayItem ??= + return (_cJSON_GetArrayItem ??= _dylib.lookupFunction<_c_cJSON_GetArrayItem, _dart_cJSON_GetArrayItem>( - 'cJSON_GetArrayItem'); - return _cJSON_GetArrayItem( + 'cJSON_GetArrayItem'))( array, index, ); } - _dart_cJSON_GetArrayItem _cJSON_GetArrayItem; + _dart_cJSON_GetArrayItem? _cJSON_GetArrayItem; ffi.Pointer cJSON_GetObjectItem( ffi.Pointer object, ffi.Pointer string, ) { - _cJSON_GetObjectItem ??= _dylib.lookupFunction<_c_cJSON_GetObjectItem, - _dart_cJSON_GetObjectItem>('cJSON_GetObjectItem'); - return _cJSON_GetObjectItem( + return (_cJSON_GetObjectItem ??= _dylib.lookupFunction< + _c_cJSON_GetObjectItem, + _dart_cJSON_GetObjectItem>('cJSON_GetObjectItem'))( object, string, ); } - _dart_cJSON_GetObjectItem _cJSON_GetObjectItem; + _dart_cJSON_GetObjectItem? _cJSON_GetObjectItem; ffi.Pointer cJSON_GetObjectItemCaseSensitive( ffi.Pointer object, ffi.Pointer string, ) { - _cJSON_GetObjectItemCaseSensitive ??= _dylib.lookupFunction< + return (_cJSON_GetObjectItemCaseSensitive ??= _dylib.lookupFunction< _c_cJSON_GetObjectItemCaseSensitive, _dart_cJSON_GetObjectItemCaseSensitive>( - 'cJSON_GetObjectItemCaseSensitive'); - return _cJSON_GetObjectItemCaseSensitive( + 'cJSON_GetObjectItemCaseSensitive'))( object, string, ); } - _dart_cJSON_GetObjectItemCaseSensitive _cJSON_GetObjectItemCaseSensitive; + _dart_cJSON_GetObjectItemCaseSensitive? _cJSON_GetObjectItemCaseSensitive; int cJSON_HasObjectItem( ffi.Pointer object, ffi.Pointer string, ) { - _cJSON_HasObjectItem ??= _dylib.lookupFunction<_c_cJSON_HasObjectItem, - _dart_cJSON_HasObjectItem>('cJSON_HasObjectItem'); - return _cJSON_HasObjectItem( + return (_cJSON_HasObjectItem ??= _dylib.lookupFunction< + _c_cJSON_HasObjectItem, + _dart_cJSON_HasObjectItem>('cJSON_HasObjectItem'))( object, string, ); } - _dart_cJSON_HasObjectItem _cJSON_HasObjectItem; + _dart_cJSON_HasObjectItem? _cJSON_HasObjectItem; ffi.Pointer cJSON_GetErrorPtr() { - _cJSON_GetErrorPtr ??= + return (_cJSON_GetErrorPtr ??= _dylib.lookupFunction<_c_cJSON_GetErrorPtr, _dart_cJSON_GetErrorPtr>( - 'cJSON_GetErrorPtr'); - return _cJSON_GetErrorPtr(); + 'cJSON_GetErrorPtr'))(); } - _dart_cJSON_GetErrorPtr _cJSON_GetErrorPtr; + _dart_cJSON_GetErrorPtr? _cJSON_GetErrorPtr; ffi.Pointer cJSON_GetStringValue( ffi.Pointer item, ) { - _cJSON_GetStringValue ??= _dylib.lookupFunction<_c_cJSON_GetStringValue, - _dart_cJSON_GetStringValue>('cJSON_GetStringValue'); - return _cJSON_GetStringValue( + return (_cJSON_GetStringValue ??= _dylib.lookupFunction< + _c_cJSON_GetStringValue, + _dart_cJSON_GetStringValue>('cJSON_GetStringValue'))( item, ); } - _dart_cJSON_GetStringValue _cJSON_GetStringValue; + _dart_cJSON_GetStringValue? _cJSON_GetStringValue; int cJSON_IsInvalid( ffi.Pointer item, ) { - _cJSON_IsInvalid ??= + return (_cJSON_IsInvalid ??= _dylib.lookupFunction<_c_cJSON_IsInvalid, _dart_cJSON_IsInvalid>( - 'cJSON_IsInvalid'); - return _cJSON_IsInvalid( + 'cJSON_IsInvalid'))( item, ); } - _dart_cJSON_IsInvalid _cJSON_IsInvalid; + _dart_cJSON_IsInvalid? _cJSON_IsInvalid; int cJSON_IsFalse( ffi.Pointer item, ) { - _cJSON_IsFalse ??= _dylib - .lookupFunction<_c_cJSON_IsFalse, _dart_cJSON_IsFalse>('cJSON_IsFalse'); - return _cJSON_IsFalse( + return (_cJSON_IsFalse ??= + _dylib.lookupFunction<_c_cJSON_IsFalse, _dart_cJSON_IsFalse>( + 'cJSON_IsFalse'))( item, ); } - _dart_cJSON_IsFalse _cJSON_IsFalse; + _dart_cJSON_IsFalse? _cJSON_IsFalse; int cJSON_IsTrue( ffi.Pointer item, ) { - _cJSON_IsTrue ??= _dylib - .lookupFunction<_c_cJSON_IsTrue, _dart_cJSON_IsTrue>('cJSON_IsTrue'); - return _cJSON_IsTrue( + return (_cJSON_IsTrue ??= _dylib + .lookupFunction<_c_cJSON_IsTrue, _dart_cJSON_IsTrue>('cJSON_IsTrue'))( item, ); } - _dart_cJSON_IsTrue _cJSON_IsTrue; + _dart_cJSON_IsTrue? _cJSON_IsTrue; int cJSON_IsBool( ffi.Pointer item, ) { - _cJSON_IsBool ??= _dylib - .lookupFunction<_c_cJSON_IsBool, _dart_cJSON_IsBool>('cJSON_IsBool'); - return _cJSON_IsBool( + return (_cJSON_IsBool ??= _dylib + .lookupFunction<_c_cJSON_IsBool, _dart_cJSON_IsBool>('cJSON_IsBool'))( item, ); } - _dart_cJSON_IsBool _cJSON_IsBool; + _dart_cJSON_IsBool? _cJSON_IsBool; int cJSON_IsNull( ffi.Pointer item, ) { - _cJSON_IsNull ??= _dylib - .lookupFunction<_c_cJSON_IsNull, _dart_cJSON_IsNull>('cJSON_IsNull'); - return _cJSON_IsNull( + return (_cJSON_IsNull ??= _dylib + .lookupFunction<_c_cJSON_IsNull, _dart_cJSON_IsNull>('cJSON_IsNull'))( item, ); } - _dart_cJSON_IsNull _cJSON_IsNull; + _dart_cJSON_IsNull? _cJSON_IsNull; int cJSON_IsNumber( ffi.Pointer item, ) { - _cJSON_IsNumber ??= + return (_cJSON_IsNumber ??= _dylib.lookupFunction<_c_cJSON_IsNumber, _dart_cJSON_IsNumber>( - 'cJSON_IsNumber'); - return _cJSON_IsNumber( + 'cJSON_IsNumber'))( item, ); } - _dart_cJSON_IsNumber _cJSON_IsNumber; + _dart_cJSON_IsNumber? _cJSON_IsNumber; int cJSON_IsString( ffi.Pointer item, ) { - _cJSON_IsString ??= + return (_cJSON_IsString ??= _dylib.lookupFunction<_c_cJSON_IsString, _dart_cJSON_IsString>( - 'cJSON_IsString'); - return _cJSON_IsString( + 'cJSON_IsString'))( item, ); } - _dart_cJSON_IsString _cJSON_IsString; + _dart_cJSON_IsString? _cJSON_IsString; int cJSON_IsArray( ffi.Pointer item, ) { - _cJSON_IsArray ??= _dylib - .lookupFunction<_c_cJSON_IsArray, _dart_cJSON_IsArray>('cJSON_IsArray'); - return _cJSON_IsArray( + return (_cJSON_IsArray ??= + _dylib.lookupFunction<_c_cJSON_IsArray, _dart_cJSON_IsArray>( + 'cJSON_IsArray'))( item, ); } - _dart_cJSON_IsArray _cJSON_IsArray; + _dart_cJSON_IsArray? _cJSON_IsArray; int cJSON_IsObject( ffi.Pointer item, ) { - _cJSON_IsObject ??= + return (_cJSON_IsObject ??= _dylib.lookupFunction<_c_cJSON_IsObject, _dart_cJSON_IsObject>( - 'cJSON_IsObject'); - return _cJSON_IsObject( + 'cJSON_IsObject'))( item, ); } - _dart_cJSON_IsObject _cJSON_IsObject; + _dart_cJSON_IsObject? _cJSON_IsObject; int cJSON_IsRaw( ffi.Pointer item, ) { - _cJSON_IsRaw ??= - _dylib.lookupFunction<_c_cJSON_IsRaw, _dart_cJSON_IsRaw>('cJSON_IsRaw'); - return _cJSON_IsRaw( + return (_cJSON_IsRaw ??= _dylib + .lookupFunction<_c_cJSON_IsRaw, _dart_cJSON_IsRaw>('cJSON_IsRaw'))( item, ); } - _dart_cJSON_IsRaw _cJSON_IsRaw; + _dart_cJSON_IsRaw? _cJSON_IsRaw; ffi.Pointer cJSON_CreateNull() { - _cJSON_CreateNull ??= + return (_cJSON_CreateNull ??= _dylib.lookupFunction<_c_cJSON_CreateNull, _dart_cJSON_CreateNull>( - 'cJSON_CreateNull'); - return _cJSON_CreateNull(); + 'cJSON_CreateNull'))(); } - _dart_cJSON_CreateNull _cJSON_CreateNull; + _dart_cJSON_CreateNull? _cJSON_CreateNull; ffi.Pointer cJSON_CreateTrue() { - _cJSON_CreateTrue ??= + return (_cJSON_CreateTrue ??= _dylib.lookupFunction<_c_cJSON_CreateTrue, _dart_cJSON_CreateTrue>( - 'cJSON_CreateTrue'); - return _cJSON_CreateTrue(); + 'cJSON_CreateTrue'))(); } - _dart_cJSON_CreateTrue _cJSON_CreateTrue; + _dart_cJSON_CreateTrue? _cJSON_CreateTrue; ffi.Pointer cJSON_CreateFalse() { - _cJSON_CreateFalse ??= + return (_cJSON_CreateFalse ??= _dylib.lookupFunction<_c_cJSON_CreateFalse, _dart_cJSON_CreateFalse>( - 'cJSON_CreateFalse'); - return _cJSON_CreateFalse(); + 'cJSON_CreateFalse'))(); } - _dart_cJSON_CreateFalse _cJSON_CreateFalse; + _dart_cJSON_CreateFalse? _cJSON_CreateFalse; ffi.Pointer cJSON_CreateBool( int boolean, ) { - _cJSON_CreateBool ??= + return (_cJSON_CreateBool ??= _dylib.lookupFunction<_c_cJSON_CreateBool, _dart_cJSON_CreateBool>( - 'cJSON_CreateBool'); - return _cJSON_CreateBool( + 'cJSON_CreateBool'))( boolean, ); } - _dart_cJSON_CreateBool _cJSON_CreateBool; + _dart_cJSON_CreateBool? _cJSON_CreateBool; ffi.Pointer cJSON_CreateNumber( double num, ) { - _cJSON_CreateNumber ??= + return (_cJSON_CreateNumber ??= _dylib.lookupFunction<_c_cJSON_CreateNumber, _dart_cJSON_CreateNumber>( - 'cJSON_CreateNumber'); - return _cJSON_CreateNumber( + 'cJSON_CreateNumber'))( num, ); } - _dart_cJSON_CreateNumber _cJSON_CreateNumber; + _dart_cJSON_CreateNumber? _cJSON_CreateNumber; ffi.Pointer cJSON_CreateString( ffi.Pointer string, ) { - _cJSON_CreateString ??= + return (_cJSON_CreateString ??= _dylib.lookupFunction<_c_cJSON_CreateString, _dart_cJSON_CreateString>( - 'cJSON_CreateString'); - return _cJSON_CreateString( + 'cJSON_CreateString'))( string, ); } - _dart_cJSON_CreateString _cJSON_CreateString; + _dart_cJSON_CreateString? _cJSON_CreateString; ffi.Pointer cJSON_CreateRaw( ffi.Pointer raw, ) { - _cJSON_CreateRaw ??= + return (_cJSON_CreateRaw ??= _dylib.lookupFunction<_c_cJSON_CreateRaw, _dart_cJSON_CreateRaw>( - 'cJSON_CreateRaw'); - return _cJSON_CreateRaw( + 'cJSON_CreateRaw'))( raw, ); } - _dart_cJSON_CreateRaw _cJSON_CreateRaw; + _dart_cJSON_CreateRaw? _cJSON_CreateRaw; ffi.Pointer cJSON_CreateArray() { - _cJSON_CreateArray ??= + return (_cJSON_CreateArray ??= _dylib.lookupFunction<_c_cJSON_CreateArray, _dart_cJSON_CreateArray>( - 'cJSON_CreateArray'); - return _cJSON_CreateArray(); + 'cJSON_CreateArray'))(); } - _dart_cJSON_CreateArray _cJSON_CreateArray; + _dart_cJSON_CreateArray? _cJSON_CreateArray; ffi.Pointer cJSON_CreateObject() { - _cJSON_CreateObject ??= + return (_cJSON_CreateObject ??= _dylib.lookupFunction<_c_cJSON_CreateObject, _dart_cJSON_CreateObject>( - 'cJSON_CreateObject'); - return _cJSON_CreateObject(); + 'cJSON_CreateObject'))(); } - _dart_cJSON_CreateObject _cJSON_CreateObject; + _dart_cJSON_CreateObject? _cJSON_CreateObject; ffi.Pointer cJSON_CreateStringReference( ffi.Pointer string, ) { - _cJSON_CreateStringReference ??= _dylib.lookupFunction< + return (_cJSON_CreateStringReference ??= _dylib.lookupFunction< _c_cJSON_CreateStringReference, - _dart_cJSON_CreateStringReference>('cJSON_CreateStringReference'); - return _cJSON_CreateStringReference( + _dart_cJSON_CreateStringReference>('cJSON_CreateStringReference'))( string, ); } - _dart_cJSON_CreateStringReference _cJSON_CreateStringReference; + _dart_cJSON_CreateStringReference? _cJSON_CreateStringReference; ffi.Pointer cJSON_CreateObjectReference( ffi.Pointer child, ) { - _cJSON_CreateObjectReference ??= _dylib.lookupFunction< + return (_cJSON_CreateObjectReference ??= _dylib.lookupFunction< _c_cJSON_CreateObjectReference, - _dart_cJSON_CreateObjectReference>('cJSON_CreateObjectReference'); - return _cJSON_CreateObjectReference( + _dart_cJSON_CreateObjectReference>('cJSON_CreateObjectReference'))( child, ); } - _dart_cJSON_CreateObjectReference _cJSON_CreateObjectReference; + _dart_cJSON_CreateObjectReference? _cJSON_CreateObjectReference; ffi.Pointer cJSON_CreateArrayReference( ffi.Pointer child, ) { - _cJSON_CreateArrayReference ??= _dylib.lookupFunction< + return (_cJSON_CreateArrayReference ??= _dylib.lookupFunction< _c_cJSON_CreateArrayReference, - _dart_cJSON_CreateArrayReference>('cJSON_CreateArrayReference'); - return _cJSON_CreateArrayReference( + _dart_cJSON_CreateArrayReference>('cJSON_CreateArrayReference'))( child, ); } - _dart_cJSON_CreateArrayReference _cJSON_CreateArrayReference; + _dart_cJSON_CreateArrayReference? _cJSON_CreateArrayReference; ffi.Pointer cJSON_CreateIntArray( ffi.Pointer numbers, int count, ) { - _cJSON_CreateIntArray ??= _dylib.lookupFunction<_c_cJSON_CreateIntArray, - _dart_cJSON_CreateIntArray>('cJSON_CreateIntArray'); - return _cJSON_CreateIntArray( + return (_cJSON_CreateIntArray ??= _dylib.lookupFunction< + _c_cJSON_CreateIntArray, + _dart_cJSON_CreateIntArray>('cJSON_CreateIntArray'))( numbers, count, ); } - _dart_cJSON_CreateIntArray _cJSON_CreateIntArray; + _dart_cJSON_CreateIntArray? _cJSON_CreateIntArray; ffi.Pointer cJSON_CreateFloatArray( ffi.Pointer numbers, int count, ) { - _cJSON_CreateFloatArray ??= _dylib.lookupFunction<_c_cJSON_CreateFloatArray, - _dart_cJSON_CreateFloatArray>('cJSON_CreateFloatArray'); - return _cJSON_CreateFloatArray( + return (_cJSON_CreateFloatArray ??= _dylib.lookupFunction< + _c_cJSON_CreateFloatArray, + _dart_cJSON_CreateFloatArray>('cJSON_CreateFloatArray'))( numbers, count, ); } - _dart_cJSON_CreateFloatArray _cJSON_CreateFloatArray; + _dart_cJSON_CreateFloatArray? _cJSON_CreateFloatArray; ffi.Pointer cJSON_CreateDoubleArray( ffi.Pointer numbers, int count, ) { - _cJSON_CreateDoubleArray ??= _dylib.lookupFunction< + return (_cJSON_CreateDoubleArray ??= _dylib.lookupFunction< _c_cJSON_CreateDoubleArray, - _dart_cJSON_CreateDoubleArray>('cJSON_CreateDoubleArray'); - return _cJSON_CreateDoubleArray( + _dart_cJSON_CreateDoubleArray>('cJSON_CreateDoubleArray'))( numbers, count, ); } - _dart_cJSON_CreateDoubleArray _cJSON_CreateDoubleArray; + _dart_cJSON_CreateDoubleArray? _cJSON_CreateDoubleArray; ffi.Pointer cJSON_CreateStringArray( ffi.Pointer> strings, int count, ) { - _cJSON_CreateStringArray ??= _dylib.lookupFunction< + return (_cJSON_CreateStringArray ??= _dylib.lookupFunction< _c_cJSON_CreateStringArray, - _dart_cJSON_CreateStringArray>('cJSON_CreateStringArray'); - return _cJSON_CreateStringArray( + _dart_cJSON_CreateStringArray>('cJSON_CreateStringArray'))( strings, count, ); } - _dart_cJSON_CreateStringArray _cJSON_CreateStringArray; + _dart_cJSON_CreateStringArray? _cJSON_CreateStringArray; void cJSON_AddItemToArray( ffi.Pointer array, ffi.Pointer item, ) { - _cJSON_AddItemToArray ??= _dylib.lookupFunction<_c_cJSON_AddItemToArray, - _dart_cJSON_AddItemToArray>('cJSON_AddItemToArray'); - return _cJSON_AddItemToArray( + return (_cJSON_AddItemToArray ??= _dylib.lookupFunction< + _c_cJSON_AddItemToArray, + _dart_cJSON_AddItemToArray>('cJSON_AddItemToArray'))( array, item, ); } - _dart_cJSON_AddItemToArray _cJSON_AddItemToArray; + _dart_cJSON_AddItemToArray? _cJSON_AddItemToArray; void cJSON_AddItemToObject( ffi.Pointer object, ffi.Pointer string, ffi.Pointer item, ) { - _cJSON_AddItemToObject ??= _dylib.lookupFunction<_c_cJSON_AddItemToObject, - _dart_cJSON_AddItemToObject>('cJSON_AddItemToObject'); - return _cJSON_AddItemToObject( + return (_cJSON_AddItemToObject ??= _dylib.lookupFunction< + _c_cJSON_AddItemToObject, + _dart_cJSON_AddItemToObject>('cJSON_AddItemToObject'))( object, string, item, ); } - _dart_cJSON_AddItemToObject _cJSON_AddItemToObject; + _dart_cJSON_AddItemToObject? _cJSON_AddItemToObject; void cJSON_AddItemToObjectCS( ffi.Pointer object, ffi.Pointer string, ffi.Pointer item, ) { - _cJSON_AddItemToObjectCS ??= _dylib.lookupFunction< + return (_cJSON_AddItemToObjectCS ??= _dylib.lookupFunction< _c_cJSON_AddItemToObjectCS, - _dart_cJSON_AddItemToObjectCS>('cJSON_AddItemToObjectCS'); - return _cJSON_AddItemToObjectCS( + _dart_cJSON_AddItemToObjectCS>('cJSON_AddItemToObjectCS'))( object, string, item, ); } - _dart_cJSON_AddItemToObjectCS _cJSON_AddItemToObjectCS; + _dart_cJSON_AddItemToObjectCS? _cJSON_AddItemToObjectCS; void cJSON_AddItemReferenceToArray( ffi.Pointer array, ffi.Pointer item, ) { - _cJSON_AddItemReferenceToArray ??= _dylib.lookupFunction< + return (_cJSON_AddItemReferenceToArray ??= _dylib.lookupFunction< _c_cJSON_AddItemReferenceToArray, - _dart_cJSON_AddItemReferenceToArray>('cJSON_AddItemReferenceToArray'); - return _cJSON_AddItemReferenceToArray( + _dart_cJSON_AddItemReferenceToArray>('cJSON_AddItemReferenceToArray'))( array, item, ); } - _dart_cJSON_AddItemReferenceToArray _cJSON_AddItemReferenceToArray; + _dart_cJSON_AddItemReferenceToArray? _cJSON_AddItemReferenceToArray; void cJSON_AddItemReferenceToObject( ffi.Pointer object, ffi.Pointer string, ffi.Pointer item, ) { - _cJSON_AddItemReferenceToObject ??= _dylib.lookupFunction< - _c_cJSON_AddItemReferenceToObject, - _dart_cJSON_AddItemReferenceToObject>('cJSON_AddItemReferenceToObject'); - return _cJSON_AddItemReferenceToObject( + return (_cJSON_AddItemReferenceToObject ??= _dylib.lookupFunction< + _c_cJSON_AddItemReferenceToObject, + _dart_cJSON_AddItemReferenceToObject>( + 'cJSON_AddItemReferenceToObject'))( object, string, item, ); } - _dart_cJSON_AddItemReferenceToObject _cJSON_AddItemReferenceToObject; + _dart_cJSON_AddItemReferenceToObject? _cJSON_AddItemReferenceToObject; ffi.Pointer cJSON_DetachItemViaPointer( ffi.Pointer parent, ffi.Pointer item, ) { - _cJSON_DetachItemViaPointer ??= _dylib.lookupFunction< + return (_cJSON_DetachItemViaPointer ??= _dylib.lookupFunction< _c_cJSON_DetachItemViaPointer, - _dart_cJSON_DetachItemViaPointer>('cJSON_DetachItemViaPointer'); - return _cJSON_DetachItemViaPointer( + _dart_cJSON_DetachItemViaPointer>('cJSON_DetachItemViaPointer'))( parent, item, ); } - _dart_cJSON_DetachItemViaPointer _cJSON_DetachItemViaPointer; + _dart_cJSON_DetachItemViaPointer? _cJSON_DetachItemViaPointer; ffi.Pointer cJSON_DetachItemFromArray( ffi.Pointer array, int which, ) { - _cJSON_DetachItemFromArray ??= _dylib.lookupFunction< + return (_cJSON_DetachItemFromArray ??= _dylib.lookupFunction< _c_cJSON_DetachItemFromArray, - _dart_cJSON_DetachItemFromArray>('cJSON_DetachItemFromArray'); - return _cJSON_DetachItemFromArray( + _dart_cJSON_DetachItemFromArray>('cJSON_DetachItemFromArray'))( array, which, ); } - _dart_cJSON_DetachItemFromArray _cJSON_DetachItemFromArray; + _dart_cJSON_DetachItemFromArray? _cJSON_DetachItemFromArray; void cJSON_DeleteItemFromArray( ffi.Pointer array, int which, ) { - _cJSON_DeleteItemFromArray ??= _dylib.lookupFunction< + return (_cJSON_DeleteItemFromArray ??= _dylib.lookupFunction< _c_cJSON_DeleteItemFromArray, - _dart_cJSON_DeleteItemFromArray>('cJSON_DeleteItemFromArray'); - return _cJSON_DeleteItemFromArray( + _dart_cJSON_DeleteItemFromArray>('cJSON_DeleteItemFromArray'))( array, which, ); } - _dart_cJSON_DeleteItemFromArray _cJSON_DeleteItemFromArray; + _dart_cJSON_DeleteItemFromArray? _cJSON_DeleteItemFromArray; ffi.Pointer cJSON_DetachItemFromObject( ffi.Pointer object, ffi.Pointer string, ) { - _cJSON_DetachItemFromObject ??= _dylib.lookupFunction< + return (_cJSON_DetachItemFromObject ??= _dylib.lookupFunction< _c_cJSON_DetachItemFromObject, - _dart_cJSON_DetachItemFromObject>('cJSON_DetachItemFromObject'); - return _cJSON_DetachItemFromObject( + _dart_cJSON_DetachItemFromObject>('cJSON_DetachItemFromObject'))( object, string, ); } - _dart_cJSON_DetachItemFromObject _cJSON_DetachItemFromObject; + _dart_cJSON_DetachItemFromObject? _cJSON_DetachItemFromObject; ffi.Pointer cJSON_DetachItemFromObjectCaseSensitive( ffi.Pointer object, ffi.Pointer string, ) { - _cJSON_DetachItemFromObjectCaseSensitive ??= _dylib.lookupFunction< + return (_cJSON_DetachItemFromObjectCaseSensitive ??= _dylib.lookupFunction< _c_cJSON_DetachItemFromObjectCaseSensitive, _dart_cJSON_DetachItemFromObjectCaseSensitive>( - 'cJSON_DetachItemFromObjectCaseSensitive'); - return _cJSON_DetachItemFromObjectCaseSensitive( + 'cJSON_DetachItemFromObjectCaseSensitive'))( object, string, ); } - _dart_cJSON_DetachItemFromObjectCaseSensitive + _dart_cJSON_DetachItemFromObjectCaseSensitive? _cJSON_DetachItemFromObjectCaseSensitive; void cJSON_DeleteItemFromObject( ffi.Pointer object, ffi.Pointer string, ) { - _cJSON_DeleteItemFromObject ??= _dylib.lookupFunction< + return (_cJSON_DeleteItemFromObject ??= _dylib.lookupFunction< _c_cJSON_DeleteItemFromObject, - _dart_cJSON_DeleteItemFromObject>('cJSON_DeleteItemFromObject'); - return _cJSON_DeleteItemFromObject( + _dart_cJSON_DeleteItemFromObject>('cJSON_DeleteItemFromObject'))( object, string, ); } - _dart_cJSON_DeleteItemFromObject _cJSON_DeleteItemFromObject; + _dart_cJSON_DeleteItemFromObject? _cJSON_DeleteItemFromObject; void cJSON_DeleteItemFromObjectCaseSensitive( ffi.Pointer object, ffi.Pointer string, ) { - _cJSON_DeleteItemFromObjectCaseSensitive ??= _dylib.lookupFunction< + return (_cJSON_DeleteItemFromObjectCaseSensitive ??= _dylib.lookupFunction< _c_cJSON_DeleteItemFromObjectCaseSensitive, _dart_cJSON_DeleteItemFromObjectCaseSensitive>( - 'cJSON_DeleteItemFromObjectCaseSensitive'); - return _cJSON_DeleteItemFromObjectCaseSensitive( + 'cJSON_DeleteItemFromObjectCaseSensitive'))( object, string, ); } - _dart_cJSON_DeleteItemFromObjectCaseSensitive + _dart_cJSON_DeleteItemFromObjectCaseSensitive? _cJSON_DeleteItemFromObjectCaseSensitive; void cJSON_InsertItemInArray( @@ -735,332 +695,320 @@ class CJson { int which, ffi.Pointer newitem, ) { - _cJSON_InsertItemInArray ??= _dylib.lookupFunction< + return (_cJSON_InsertItemInArray ??= _dylib.lookupFunction< _c_cJSON_InsertItemInArray, - _dart_cJSON_InsertItemInArray>('cJSON_InsertItemInArray'); - return _cJSON_InsertItemInArray( + _dart_cJSON_InsertItemInArray>('cJSON_InsertItemInArray'))( array, which, newitem, ); } - _dart_cJSON_InsertItemInArray _cJSON_InsertItemInArray; + _dart_cJSON_InsertItemInArray? _cJSON_InsertItemInArray; int cJSON_ReplaceItemViaPointer( ffi.Pointer parent, ffi.Pointer item, ffi.Pointer replacement, ) { - _cJSON_ReplaceItemViaPointer ??= _dylib.lookupFunction< + return (_cJSON_ReplaceItemViaPointer ??= _dylib.lookupFunction< _c_cJSON_ReplaceItemViaPointer, - _dart_cJSON_ReplaceItemViaPointer>('cJSON_ReplaceItemViaPointer'); - return _cJSON_ReplaceItemViaPointer( + _dart_cJSON_ReplaceItemViaPointer>('cJSON_ReplaceItemViaPointer'))( parent, item, replacement, ); } - _dart_cJSON_ReplaceItemViaPointer _cJSON_ReplaceItemViaPointer; + _dart_cJSON_ReplaceItemViaPointer? _cJSON_ReplaceItemViaPointer; void cJSON_ReplaceItemInArray( ffi.Pointer array, int which, ffi.Pointer newitem, ) { - _cJSON_ReplaceItemInArray ??= _dylib.lookupFunction< + return (_cJSON_ReplaceItemInArray ??= _dylib.lookupFunction< _c_cJSON_ReplaceItemInArray, - _dart_cJSON_ReplaceItemInArray>('cJSON_ReplaceItemInArray'); - return _cJSON_ReplaceItemInArray( + _dart_cJSON_ReplaceItemInArray>('cJSON_ReplaceItemInArray'))( array, which, newitem, ); } - _dart_cJSON_ReplaceItemInArray _cJSON_ReplaceItemInArray; + _dart_cJSON_ReplaceItemInArray? _cJSON_ReplaceItemInArray; void cJSON_ReplaceItemInObject( ffi.Pointer object, ffi.Pointer string, ffi.Pointer newitem, ) { - _cJSON_ReplaceItemInObject ??= _dylib.lookupFunction< + return (_cJSON_ReplaceItemInObject ??= _dylib.lookupFunction< _c_cJSON_ReplaceItemInObject, - _dart_cJSON_ReplaceItemInObject>('cJSON_ReplaceItemInObject'); - return _cJSON_ReplaceItemInObject( + _dart_cJSON_ReplaceItemInObject>('cJSON_ReplaceItemInObject'))( object, string, newitem, ); } - _dart_cJSON_ReplaceItemInObject _cJSON_ReplaceItemInObject; + _dart_cJSON_ReplaceItemInObject? _cJSON_ReplaceItemInObject; void cJSON_ReplaceItemInObjectCaseSensitive( ffi.Pointer object, ffi.Pointer string, ffi.Pointer newitem, ) { - _cJSON_ReplaceItemInObjectCaseSensitive ??= _dylib.lookupFunction< + return (_cJSON_ReplaceItemInObjectCaseSensitive ??= _dylib.lookupFunction< _c_cJSON_ReplaceItemInObjectCaseSensitive, _dart_cJSON_ReplaceItemInObjectCaseSensitive>( - 'cJSON_ReplaceItemInObjectCaseSensitive'); - return _cJSON_ReplaceItemInObjectCaseSensitive( + 'cJSON_ReplaceItemInObjectCaseSensitive'))( object, string, newitem, ); } - _dart_cJSON_ReplaceItemInObjectCaseSensitive + _dart_cJSON_ReplaceItemInObjectCaseSensitive? _cJSON_ReplaceItemInObjectCaseSensitive; ffi.Pointer cJSON_Duplicate( ffi.Pointer item, int recurse, ) { - _cJSON_Duplicate ??= + return (_cJSON_Duplicate ??= _dylib.lookupFunction<_c_cJSON_Duplicate, _dart_cJSON_Duplicate>( - 'cJSON_Duplicate'); - return _cJSON_Duplicate( + 'cJSON_Duplicate'))( item, recurse, ); } - _dart_cJSON_Duplicate _cJSON_Duplicate; + _dart_cJSON_Duplicate? _cJSON_Duplicate; int cJSON_Compare( ffi.Pointer a, ffi.Pointer b, int case_sensitive, ) { - _cJSON_Compare ??= _dylib - .lookupFunction<_c_cJSON_Compare, _dart_cJSON_Compare>('cJSON_Compare'); - return _cJSON_Compare( + return (_cJSON_Compare ??= + _dylib.lookupFunction<_c_cJSON_Compare, _dart_cJSON_Compare>( + 'cJSON_Compare'))( a, b, case_sensitive, ); } - _dart_cJSON_Compare _cJSON_Compare; + _dart_cJSON_Compare? _cJSON_Compare; void cJSON_Minify( ffi.Pointer json, ) { - _cJSON_Minify ??= _dylib - .lookupFunction<_c_cJSON_Minify, _dart_cJSON_Minify>('cJSON_Minify'); - return _cJSON_Minify( + return (_cJSON_Minify ??= _dylib + .lookupFunction<_c_cJSON_Minify, _dart_cJSON_Minify>('cJSON_Minify'))( json, ); } - _dart_cJSON_Minify _cJSON_Minify; + _dart_cJSON_Minify? _cJSON_Minify; ffi.Pointer cJSON_AddNullToObject( ffi.Pointer object, ffi.Pointer name, ) { - _cJSON_AddNullToObject ??= _dylib.lookupFunction<_c_cJSON_AddNullToObject, - _dart_cJSON_AddNullToObject>('cJSON_AddNullToObject'); - return _cJSON_AddNullToObject( + return (_cJSON_AddNullToObject ??= _dylib.lookupFunction< + _c_cJSON_AddNullToObject, + _dart_cJSON_AddNullToObject>('cJSON_AddNullToObject'))( object, name, ); } - _dart_cJSON_AddNullToObject _cJSON_AddNullToObject; + _dart_cJSON_AddNullToObject? _cJSON_AddNullToObject; ffi.Pointer cJSON_AddTrueToObject( ffi.Pointer object, ffi.Pointer name, ) { - _cJSON_AddTrueToObject ??= _dylib.lookupFunction<_c_cJSON_AddTrueToObject, - _dart_cJSON_AddTrueToObject>('cJSON_AddTrueToObject'); - return _cJSON_AddTrueToObject( + return (_cJSON_AddTrueToObject ??= _dylib.lookupFunction< + _c_cJSON_AddTrueToObject, + _dart_cJSON_AddTrueToObject>('cJSON_AddTrueToObject'))( object, name, ); } - _dart_cJSON_AddTrueToObject _cJSON_AddTrueToObject; + _dart_cJSON_AddTrueToObject? _cJSON_AddTrueToObject; ffi.Pointer cJSON_AddFalseToObject( ffi.Pointer object, ffi.Pointer name, ) { - _cJSON_AddFalseToObject ??= _dylib.lookupFunction<_c_cJSON_AddFalseToObject, - _dart_cJSON_AddFalseToObject>('cJSON_AddFalseToObject'); - return _cJSON_AddFalseToObject( + return (_cJSON_AddFalseToObject ??= _dylib.lookupFunction< + _c_cJSON_AddFalseToObject, + _dart_cJSON_AddFalseToObject>('cJSON_AddFalseToObject'))( object, name, ); } - _dart_cJSON_AddFalseToObject _cJSON_AddFalseToObject; + _dart_cJSON_AddFalseToObject? _cJSON_AddFalseToObject; ffi.Pointer cJSON_AddBoolToObject( ffi.Pointer object, ffi.Pointer name, int boolean, ) { - _cJSON_AddBoolToObject ??= _dylib.lookupFunction<_c_cJSON_AddBoolToObject, - _dart_cJSON_AddBoolToObject>('cJSON_AddBoolToObject'); - return _cJSON_AddBoolToObject( + return (_cJSON_AddBoolToObject ??= _dylib.lookupFunction< + _c_cJSON_AddBoolToObject, + _dart_cJSON_AddBoolToObject>('cJSON_AddBoolToObject'))( object, name, boolean, ); } - _dart_cJSON_AddBoolToObject _cJSON_AddBoolToObject; + _dart_cJSON_AddBoolToObject? _cJSON_AddBoolToObject; ffi.Pointer cJSON_AddNumberToObject( ffi.Pointer object, ffi.Pointer name, double number, ) { - _cJSON_AddNumberToObject ??= _dylib.lookupFunction< + return (_cJSON_AddNumberToObject ??= _dylib.lookupFunction< _c_cJSON_AddNumberToObject, - _dart_cJSON_AddNumberToObject>('cJSON_AddNumberToObject'); - return _cJSON_AddNumberToObject( + _dart_cJSON_AddNumberToObject>('cJSON_AddNumberToObject'))( object, name, number, ); } - _dart_cJSON_AddNumberToObject _cJSON_AddNumberToObject; + _dart_cJSON_AddNumberToObject? _cJSON_AddNumberToObject; ffi.Pointer cJSON_AddStringToObject( ffi.Pointer object, ffi.Pointer name, ffi.Pointer string, ) { - _cJSON_AddStringToObject ??= _dylib.lookupFunction< + return (_cJSON_AddStringToObject ??= _dylib.lookupFunction< _c_cJSON_AddStringToObject, - _dart_cJSON_AddStringToObject>('cJSON_AddStringToObject'); - return _cJSON_AddStringToObject( + _dart_cJSON_AddStringToObject>('cJSON_AddStringToObject'))( object, name, string, ); } - _dart_cJSON_AddStringToObject _cJSON_AddStringToObject; + _dart_cJSON_AddStringToObject? _cJSON_AddStringToObject; ffi.Pointer cJSON_AddRawToObject( ffi.Pointer object, ffi.Pointer name, ffi.Pointer raw, ) { - _cJSON_AddRawToObject ??= _dylib.lookupFunction<_c_cJSON_AddRawToObject, - _dart_cJSON_AddRawToObject>('cJSON_AddRawToObject'); - return _cJSON_AddRawToObject( + return (_cJSON_AddRawToObject ??= _dylib.lookupFunction< + _c_cJSON_AddRawToObject, + _dart_cJSON_AddRawToObject>('cJSON_AddRawToObject'))( object, name, raw, ); } - _dart_cJSON_AddRawToObject _cJSON_AddRawToObject; + _dart_cJSON_AddRawToObject? _cJSON_AddRawToObject; ffi.Pointer cJSON_AddObjectToObject( ffi.Pointer object, ffi.Pointer name, ) { - _cJSON_AddObjectToObject ??= _dylib.lookupFunction< + return (_cJSON_AddObjectToObject ??= _dylib.lookupFunction< _c_cJSON_AddObjectToObject, - _dart_cJSON_AddObjectToObject>('cJSON_AddObjectToObject'); - return _cJSON_AddObjectToObject( + _dart_cJSON_AddObjectToObject>('cJSON_AddObjectToObject'))( object, name, ); } - _dart_cJSON_AddObjectToObject _cJSON_AddObjectToObject; + _dart_cJSON_AddObjectToObject? _cJSON_AddObjectToObject; ffi.Pointer cJSON_AddArrayToObject( ffi.Pointer object, ffi.Pointer name, ) { - _cJSON_AddArrayToObject ??= _dylib.lookupFunction<_c_cJSON_AddArrayToObject, - _dart_cJSON_AddArrayToObject>('cJSON_AddArrayToObject'); - return _cJSON_AddArrayToObject( + return (_cJSON_AddArrayToObject ??= _dylib.lookupFunction< + _c_cJSON_AddArrayToObject, + _dart_cJSON_AddArrayToObject>('cJSON_AddArrayToObject'))( object, name, ); } - _dart_cJSON_AddArrayToObject _cJSON_AddArrayToObject; + _dart_cJSON_AddArrayToObject? _cJSON_AddArrayToObject; double cJSON_SetNumberHelper( ffi.Pointer object, double number, ) { - _cJSON_SetNumberHelper ??= _dylib.lookupFunction<_c_cJSON_SetNumberHelper, - _dart_cJSON_SetNumberHelper>('cJSON_SetNumberHelper'); - return _cJSON_SetNumberHelper( + return (_cJSON_SetNumberHelper ??= _dylib.lookupFunction< + _c_cJSON_SetNumberHelper, + _dart_cJSON_SetNumberHelper>('cJSON_SetNumberHelper'))( object, number, ); } - _dart_cJSON_SetNumberHelper _cJSON_SetNumberHelper; + _dart_cJSON_SetNumberHelper? _cJSON_SetNumberHelper; ffi.Pointer cJSON_malloc( int size, ) { - _cJSON_malloc ??= _dylib - .lookupFunction<_c_cJSON_malloc, _dart_cJSON_malloc>('cJSON_malloc'); - return _cJSON_malloc( + return (_cJSON_malloc ??= _dylib + .lookupFunction<_c_cJSON_malloc, _dart_cJSON_malloc>('cJSON_malloc'))( size, ); } - _dart_cJSON_malloc _cJSON_malloc; + _dart_cJSON_malloc? _cJSON_malloc; void cJSON_free( ffi.Pointer object, ) { - _cJSON_free ??= - _dylib.lookupFunction<_c_cJSON_free, _dart_cJSON_free>('cJSON_free'); - return _cJSON_free( + return (_cJSON_free ??= + _dylib.lookupFunction<_c_cJSON_free, _dart_cJSON_free>('cJSON_free'))( object, ); } - _dart_cJSON_free _cJSON_free; + _dart_cJSON_free? _cJSON_free; } class cJSON extends ffi.Struct { - ffi.Pointer next; + external ffi.Pointer next; - ffi.Pointer prev; + external ffi.Pointer prev; - ffi.Pointer child; + external ffi.Pointer child; @ffi.Int32() - int type; + external int type; - ffi.Pointer valuestring; + external ffi.Pointer valuestring; @ffi.Int32() - int valueint; + external int valueint; @ffi.Double() - double valuedouble; + external double valuedouble; - ffi.Pointer string; + external ffi.Pointer string; } class cJSON_Hooks extends ffi.Struct { - ffi.Pointer> malloc_fn; + external ffi.Pointer> malloc_fn; - ffi.Pointer> free_fn; + external ffi.Pointer> free_fn; } const int CJSON_VERSION_MAJOR = 1; diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index 4b6325bd83..e6cc63e49d 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -15,41 +15,40 @@ class LibClang { void clang_disposeStringSet( ffi.Pointer set_1, ) { - _clang_disposeStringSet ??= _dylib.lookupFunction<_c_clang_disposeStringSet, - _dart_clang_disposeStringSet>('clang_disposeStringSet'); - return _clang_disposeStringSet( + return (_clang_disposeStringSet ??= _dylib.lookupFunction< + _c_clang_disposeStringSet, + _dart_clang_disposeStringSet>('clang_disposeStringSet'))( set_1, ); } - _dart_clang_disposeStringSet _clang_disposeStringSet; + _dart_clang_disposeStringSet? _clang_disposeStringSet; /// Return the timestamp for use with Clang's -fbuild-session-timestamp= /// option. int clang_getBuildSessionTimestamp() { - _clang_getBuildSessionTimestamp ??= _dylib.lookupFunction< - _c_clang_getBuildSessionTimestamp, - _dart_clang_getBuildSessionTimestamp>('clang_getBuildSessionTimestamp'); - return _clang_getBuildSessionTimestamp(); + return (_clang_getBuildSessionTimestamp ??= _dylib.lookupFunction< + _c_clang_getBuildSessionTimestamp, + _dart_clang_getBuildSessionTimestamp>( + 'clang_getBuildSessionTimestamp'))(); } - _dart_clang_getBuildSessionTimestamp _clang_getBuildSessionTimestamp; + _dart_clang_getBuildSessionTimestamp? _clang_getBuildSessionTimestamp; /// Create a CXVirtualFileOverlay object. Must be disposed with /// clang_VirtualFileOverlay_dispose(). ffi.Pointer clang_VirtualFileOverlay_create( int options, ) { - _clang_VirtualFileOverlay_create ??= _dylib.lookupFunction< + return (_clang_VirtualFileOverlay_create ??= _dylib.lookupFunction< _c_clang_VirtualFileOverlay_create, _dart_clang_VirtualFileOverlay_create>( - 'clang_VirtualFileOverlay_create'); - return _clang_VirtualFileOverlay_create( + 'clang_VirtualFileOverlay_create'))( options, ); } - _dart_clang_VirtualFileOverlay_create _clang_VirtualFileOverlay_create; + _dart_clang_VirtualFileOverlay_create? _clang_VirtualFileOverlay_create; /// Map an absolute virtual file path to an absolute real one. The virtual /// path must be canonicalized (not contain "."/".."). @@ -58,18 +57,17 @@ class LibClang { ffi.Pointer virtualPath, ffi.Pointer realPath, ) { - _clang_VirtualFileOverlay_addFileMapping ??= _dylib.lookupFunction< + return (_clang_VirtualFileOverlay_addFileMapping ??= _dylib.lookupFunction< _c_clang_VirtualFileOverlay_addFileMapping, _dart_clang_VirtualFileOverlay_addFileMapping>( - 'clang_VirtualFileOverlay_addFileMapping'); - return _clang_VirtualFileOverlay_addFileMapping( + 'clang_VirtualFileOverlay_addFileMapping'))( arg0, virtualPath, realPath, ); } - _dart_clang_VirtualFileOverlay_addFileMapping + _dart_clang_VirtualFileOverlay_addFileMapping? _clang_VirtualFileOverlay_addFileMapping; /// Set the case sensitivity for the CXVirtualFileOverlay object. The @@ -79,17 +77,16 @@ class LibClang { ffi.Pointer arg0, int caseSensitive, ) { - _clang_VirtualFileOverlay_setCaseSensitivity ??= _dylib.lookupFunction< - _c_clang_VirtualFileOverlay_setCaseSensitivity, - _dart_clang_VirtualFileOverlay_setCaseSensitivity>( - 'clang_VirtualFileOverlay_setCaseSensitivity'); - return _clang_VirtualFileOverlay_setCaseSensitivity( + return (_clang_VirtualFileOverlay_setCaseSensitivity ??= + _dylib.lookupFunction<_c_clang_VirtualFileOverlay_setCaseSensitivity, + _dart_clang_VirtualFileOverlay_setCaseSensitivity>( + 'clang_VirtualFileOverlay_setCaseSensitivity'))( arg0, caseSensitive, ); } - _dart_clang_VirtualFileOverlay_setCaseSensitivity + _dart_clang_VirtualFileOverlay_setCaseSensitivity? _clang_VirtualFileOverlay_setCaseSensitivity; /// Write out the CXVirtualFileOverlay object to a char buffer. @@ -99,11 +96,10 @@ class LibClang { ffi.Pointer> out_buffer_ptr, ffi.Pointer out_buffer_size, ) { - _clang_VirtualFileOverlay_writeToBuffer ??= _dylib.lookupFunction< + return (_clang_VirtualFileOverlay_writeToBuffer ??= _dylib.lookupFunction< _c_clang_VirtualFileOverlay_writeToBuffer, _dart_clang_VirtualFileOverlay_writeToBuffer>( - 'clang_VirtualFileOverlay_writeToBuffer'); - return _clang_VirtualFileOverlay_writeToBuffer( + 'clang_VirtualFileOverlay_writeToBuffer'))( arg0, options, out_buffer_ptr, @@ -111,7 +107,7 @@ class LibClang { ); } - _dart_clang_VirtualFileOverlay_writeToBuffer + _dart_clang_VirtualFileOverlay_writeToBuffer? _clang_VirtualFileOverlay_writeToBuffer; /// free memory allocated by libclang, such as the buffer returned by @@ -119,62 +115,59 @@ class LibClang { void clang_free( ffi.Pointer buffer, ) { - _clang_free ??= - _dylib.lookupFunction<_c_clang_free, _dart_clang_free>('clang_free'); - return _clang_free( + return (_clang_free ??= + _dylib.lookupFunction<_c_clang_free, _dart_clang_free>('clang_free'))( buffer, ); } - _dart_clang_free _clang_free; + _dart_clang_free? _clang_free; /// Dispose a CXVirtualFileOverlay object. void clang_VirtualFileOverlay_dispose( ffi.Pointer arg0, ) { - _clang_VirtualFileOverlay_dispose ??= _dylib.lookupFunction< + return (_clang_VirtualFileOverlay_dispose ??= _dylib.lookupFunction< _c_clang_VirtualFileOverlay_dispose, _dart_clang_VirtualFileOverlay_dispose>( - 'clang_VirtualFileOverlay_dispose'); - return _clang_VirtualFileOverlay_dispose( + 'clang_VirtualFileOverlay_dispose'))( arg0, ); } - _dart_clang_VirtualFileOverlay_dispose _clang_VirtualFileOverlay_dispose; + _dart_clang_VirtualFileOverlay_dispose? _clang_VirtualFileOverlay_dispose; /// Create a CXModuleMapDescriptor object. Must be disposed with /// clang_ModuleMapDescriptor_dispose(). ffi.Pointer clang_ModuleMapDescriptor_create( int options, ) { - _clang_ModuleMapDescriptor_create ??= _dylib.lookupFunction< + return (_clang_ModuleMapDescriptor_create ??= _dylib.lookupFunction< _c_clang_ModuleMapDescriptor_create, _dart_clang_ModuleMapDescriptor_create>( - 'clang_ModuleMapDescriptor_create'); - return _clang_ModuleMapDescriptor_create( + 'clang_ModuleMapDescriptor_create'))( options, ); } - _dart_clang_ModuleMapDescriptor_create _clang_ModuleMapDescriptor_create; + _dart_clang_ModuleMapDescriptor_create? _clang_ModuleMapDescriptor_create; /// Sets the framework module name that the module.map describes. int clang_ModuleMapDescriptor_setFrameworkModuleName( ffi.Pointer arg0, ffi.Pointer name, ) { - _clang_ModuleMapDescriptor_setFrameworkModuleName ??= _dylib.lookupFunction< - _c_clang_ModuleMapDescriptor_setFrameworkModuleName, - _dart_clang_ModuleMapDescriptor_setFrameworkModuleName>( - 'clang_ModuleMapDescriptor_setFrameworkModuleName'); - return _clang_ModuleMapDescriptor_setFrameworkModuleName( + return (_clang_ModuleMapDescriptor_setFrameworkModuleName ??= + _dylib.lookupFunction< + _c_clang_ModuleMapDescriptor_setFrameworkModuleName, + _dart_clang_ModuleMapDescriptor_setFrameworkModuleName>( + 'clang_ModuleMapDescriptor_setFrameworkModuleName'))( arg0, name, ); } - _dart_clang_ModuleMapDescriptor_setFrameworkModuleName + _dart_clang_ModuleMapDescriptor_setFrameworkModuleName? _clang_ModuleMapDescriptor_setFrameworkModuleName; /// Sets the umbrealla header name that the module.map describes. @@ -182,17 +175,16 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer name, ) { - _clang_ModuleMapDescriptor_setUmbrellaHeader ??= _dylib.lookupFunction< - _c_clang_ModuleMapDescriptor_setUmbrellaHeader, - _dart_clang_ModuleMapDescriptor_setUmbrellaHeader>( - 'clang_ModuleMapDescriptor_setUmbrellaHeader'); - return _clang_ModuleMapDescriptor_setUmbrellaHeader( + return (_clang_ModuleMapDescriptor_setUmbrellaHeader ??= + _dylib.lookupFunction<_c_clang_ModuleMapDescriptor_setUmbrellaHeader, + _dart_clang_ModuleMapDescriptor_setUmbrellaHeader>( + 'clang_ModuleMapDescriptor_setUmbrellaHeader'))( arg0, name, ); } - _dart_clang_ModuleMapDescriptor_setUmbrellaHeader + _dart_clang_ModuleMapDescriptor_setUmbrellaHeader? _clang_ModuleMapDescriptor_setUmbrellaHeader; /// Write out the CXModuleMapDescriptor object to a char buffer. @@ -202,11 +194,10 @@ class LibClang { ffi.Pointer> out_buffer_ptr, ffi.Pointer out_buffer_size, ) { - _clang_ModuleMapDescriptor_writeToBuffer ??= _dylib.lookupFunction< + return (_clang_ModuleMapDescriptor_writeToBuffer ??= _dylib.lookupFunction< _c_clang_ModuleMapDescriptor_writeToBuffer, _dart_clang_ModuleMapDescriptor_writeToBuffer>( - 'clang_ModuleMapDescriptor_writeToBuffer'); - return _clang_ModuleMapDescriptor_writeToBuffer( + 'clang_ModuleMapDescriptor_writeToBuffer'))( arg0, options, out_buffer_ptr, @@ -214,130 +205,125 @@ class LibClang { ); } - _dart_clang_ModuleMapDescriptor_writeToBuffer + _dart_clang_ModuleMapDescriptor_writeToBuffer? _clang_ModuleMapDescriptor_writeToBuffer; /// Dispose a CXModuleMapDescriptor object. void clang_ModuleMapDescriptor_dispose( ffi.Pointer arg0, ) { - _clang_ModuleMapDescriptor_dispose ??= _dylib.lookupFunction< + return (_clang_ModuleMapDescriptor_dispose ??= _dylib.lookupFunction< _c_clang_ModuleMapDescriptor_dispose, _dart_clang_ModuleMapDescriptor_dispose>( - 'clang_ModuleMapDescriptor_dispose'); - return _clang_ModuleMapDescriptor_dispose( + 'clang_ModuleMapDescriptor_dispose'))( arg0, ); } - _dart_clang_ModuleMapDescriptor_dispose _clang_ModuleMapDescriptor_dispose; + _dart_clang_ModuleMapDescriptor_dispose? _clang_ModuleMapDescriptor_dispose; /// Provides a shared context for creating translation units. ffi.Pointer clang_createIndex( int excludeDeclarationsFromPCH, int displayDiagnostics, ) { - _clang_createIndex ??= + return (_clang_createIndex ??= _dylib.lookupFunction<_c_clang_createIndex, _dart_clang_createIndex>( - 'clang_createIndex'); - return _clang_createIndex( + 'clang_createIndex'))( excludeDeclarationsFromPCH, displayDiagnostics, ); } - _dart_clang_createIndex _clang_createIndex; + _dart_clang_createIndex? _clang_createIndex; /// Destroy the given index. void clang_disposeIndex( ffi.Pointer index, ) { - _clang_disposeIndex ??= + return (_clang_disposeIndex ??= _dylib.lookupFunction<_c_clang_disposeIndex, _dart_clang_disposeIndex>( - 'clang_disposeIndex'); - return _clang_disposeIndex( + 'clang_disposeIndex'))( index, ); } - _dart_clang_disposeIndex _clang_disposeIndex; + _dart_clang_disposeIndex? _clang_disposeIndex; /// Sets general options associated with a CXIndex. void clang_CXIndex_setGlobalOptions( ffi.Pointer arg0, int options, ) { - _clang_CXIndex_setGlobalOptions ??= _dylib.lookupFunction< - _c_clang_CXIndex_setGlobalOptions, - _dart_clang_CXIndex_setGlobalOptions>('clang_CXIndex_setGlobalOptions'); - return _clang_CXIndex_setGlobalOptions( + return (_clang_CXIndex_setGlobalOptions ??= _dylib.lookupFunction< + _c_clang_CXIndex_setGlobalOptions, + _dart_clang_CXIndex_setGlobalOptions>( + 'clang_CXIndex_setGlobalOptions'))( arg0, options, ); } - _dart_clang_CXIndex_setGlobalOptions _clang_CXIndex_setGlobalOptions; + _dart_clang_CXIndex_setGlobalOptions? _clang_CXIndex_setGlobalOptions; /// Gets the general options associated with a CXIndex. int clang_CXIndex_getGlobalOptions( ffi.Pointer arg0, ) { - _clang_CXIndex_getGlobalOptions ??= _dylib.lookupFunction< - _c_clang_CXIndex_getGlobalOptions, - _dart_clang_CXIndex_getGlobalOptions>('clang_CXIndex_getGlobalOptions'); - return _clang_CXIndex_getGlobalOptions( + return (_clang_CXIndex_getGlobalOptions ??= _dylib.lookupFunction< + _c_clang_CXIndex_getGlobalOptions, + _dart_clang_CXIndex_getGlobalOptions>( + 'clang_CXIndex_getGlobalOptions'))( arg0, ); } - _dart_clang_CXIndex_getGlobalOptions _clang_CXIndex_getGlobalOptions; + _dart_clang_CXIndex_getGlobalOptions? _clang_CXIndex_getGlobalOptions; /// Sets the invocation emission path option in a CXIndex. void clang_CXIndex_setInvocationEmissionPathOption( ffi.Pointer arg0, ffi.Pointer Path, ) { - _clang_CXIndex_setInvocationEmissionPathOption ??= _dylib.lookupFunction< - _c_clang_CXIndex_setInvocationEmissionPathOption, - _dart_clang_CXIndex_setInvocationEmissionPathOption>( - 'clang_CXIndex_setInvocationEmissionPathOption'); - return _clang_CXIndex_setInvocationEmissionPathOption( + return (_clang_CXIndex_setInvocationEmissionPathOption ??= + _dylib.lookupFunction<_c_clang_CXIndex_setInvocationEmissionPathOption, + _dart_clang_CXIndex_setInvocationEmissionPathOption>( + 'clang_CXIndex_setInvocationEmissionPathOption'))( arg0, Path, ); } - _dart_clang_CXIndex_setInvocationEmissionPathOption + _dart_clang_CXIndex_setInvocationEmissionPathOption? _clang_CXIndex_setInvocationEmissionPathOption; /// Retrieve the last modification time of the given file. int clang_getFileTime( ffi.Pointer SFile, ) { - _clang_getFileTime ??= + return (_clang_getFileTime ??= _dylib.lookupFunction<_c_clang_getFileTime, _dart_clang_getFileTime>( - 'clang_getFileTime'); - return _clang_getFileTime( + 'clang_getFileTime'))( SFile, ); } - _dart_clang_getFileTime _clang_getFileTime; + _dart_clang_getFileTime? _clang_getFileTime; /// Retrieve the unique ID for the given file. int clang_getFileUniqueID( ffi.Pointer file, ffi.Pointer outID, ) { - _clang_getFileUniqueID ??= _dylib.lookupFunction<_c_clang_getFileUniqueID, - _dart_clang_getFileUniqueID>('clang_getFileUniqueID'); - return _clang_getFileUniqueID( + return (_clang_getFileUniqueID ??= _dylib.lookupFunction< + _c_clang_getFileUniqueID, + _dart_clang_getFileUniqueID>('clang_getFileUniqueID'))( file, outID, ); } - _dart_clang_getFileUniqueID _clang_getFileUniqueID; + _dart_clang_getFileUniqueID? _clang_getFileUniqueID; /// Determine whether the given header is guarded against multiple inclusions, /// either with the conventional #ifndef/#define/#endif macro guards or with @@ -346,32 +332,31 @@ class LibClang { ffi.Pointer tu, ffi.Pointer file, ) { - _clang_isFileMultipleIncludeGuarded ??= _dylib.lookupFunction< + return (_clang_isFileMultipleIncludeGuarded ??= _dylib.lookupFunction< _c_clang_isFileMultipleIncludeGuarded, _dart_clang_isFileMultipleIncludeGuarded>( - 'clang_isFileMultipleIncludeGuarded'); - return _clang_isFileMultipleIncludeGuarded( + 'clang_isFileMultipleIncludeGuarded'))( tu, file, ); } - _dart_clang_isFileMultipleIncludeGuarded _clang_isFileMultipleIncludeGuarded; + _dart_clang_isFileMultipleIncludeGuarded? _clang_isFileMultipleIncludeGuarded; /// Retrieve a file handle within the given translation unit. ffi.Pointer clang_getFile( ffi.Pointer tu, ffi.Pointer file_name, ) { - _clang_getFile ??= _dylib - .lookupFunction<_c_clang_getFile, _dart_clang_getFile>('clang_getFile'); - return _clang_getFile( + return (_clang_getFile ??= + _dylib.lookupFunction<_c_clang_getFile, _dart_clang_getFile>( + 'clang_getFile'))( tu, file_name, ); } - _dart_clang_getFile _clang_getFile; + _dart_clang_getFile? _clang_getFile; /// Retrieve the buffer associated with the given file. ffi.Pointer clang_getFileContents( @@ -379,16 +364,16 @@ class LibClang { ffi.Pointer file, ffi.Pointer size, ) { - _clang_getFileContents ??= _dylib.lookupFunction<_c_clang_getFileContents, - _dart_clang_getFileContents>('clang_getFileContents'); - return _clang_getFileContents( + return (_clang_getFileContents ??= _dylib.lookupFunction< + _c_clang_getFileContents, + _dart_clang_getFileContents>('clang_getFileContents'))( tu, file, size, ); } - _dart_clang_getFileContents _clang_getFileContents; + _dart_clang_getFileContents? _clang_getFileContents; /// Returns non-zero if the file1 and file2 point to the same file, or they /// are both NULL. @@ -396,89 +381,84 @@ class LibClang { ffi.Pointer file1, ffi.Pointer file2, ) { - _clang_File_isEqual ??= + return (_clang_File_isEqual ??= _dylib.lookupFunction<_c_clang_File_isEqual, _dart_clang_File_isEqual>( - 'clang_File_isEqual'); - return _clang_File_isEqual( + 'clang_File_isEqual'))( file1, file2, ); } - _dart_clang_File_isEqual _clang_File_isEqual; + _dart_clang_File_isEqual? _clang_File_isEqual; /// Retrieve all ranges that were skipped by the preprocessor. ffi.Pointer clang_getSkippedRanges( ffi.Pointer tu, ffi.Pointer file, ) { - _clang_getSkippedRanges ??= _dylib.lookupFunction<_c_clang_getSkippedRanges, - _dart_clang_getSkippedRanges>('clang_getSkippedRanges'); - return _clang_getSkippedRanges( + return (_clang_getSkippedRanges ??= _dylib.lookupFunction< + _c_clang_getSkippedRanges, + _dart_clang_getSkippedRanges>('clang_getSkippedRanges'))( tu, file, ); } - _dart_clang_getSkippedRanges _clang_getSkippedRanges; + _dart_clang_getSkippedRanges? _clang_getSkippedRanges; /// Retrieve all ranges from all files that were skipped by the preprocessor. ffi.Pointer clang_getAllSkippedRanges( ffi.Pointer tu, ) { - _clang_getAllSkippedRanges ??= _dylib.lookupFunction< + return (_clang_getAllSkippedRanges ??= _dylib.lookupFunction< _c_clang_getAllSkippedRanges, - _dart_clang_getAllSkippedRanges>('clang_getAllSkippedRanges'); - return _clang_getAllSkippedRanges( + _dart_clang_getAllSkippedRanges>('clang_getAllSkippedRanges'))( tu, ); } - _dart_clang_getAllSkippedRanges _clang_getAllSkippedRanges; + _dart_clang_getAllSkippedRanges? _clang_getAllSkippedRanges; /// Destroy the given CXSourceRangeList. void clang_disposeSourceRangeList( ffi.Pointer ranges, ) { - _clang_disposeSourceRangeList ??= _dylib.lookupFunction< + return (_clang_disposeSourceRangeList ??= _dylib.lookupFunction< _c_clang_disposeSourceRangeList, - _dart_clang_disposeSourceRangeList>('clang_disposeSourceRangeList'); - return _clang_disposeSourceRangeList( + _dart_clang_disposeSourceRangeList>('clang_disposeSourceRangeList'))( ranges, ); } - _dart_clang_disposeSourceRangeList _clang_disposeSourceRangeList; + _dart_clang_disposeSourceRangeList? _clang_disposeSourceRangeList; /// Determine the number of diagnostics in a CXDiagnosticSet. int clang_getNumDiagnosticsInSet( ffi.Pointer Diags, ) { - _clang_getNumDiagnosticsInSet ??= _dylib.lookupFunction< + return (_clang_getNumDiagnosticsInSet ??= _dylib.lookupFunction< _c_clang_getNumDiagnosticsInSet, - _dart_clang_getNumDiagnosticsInSet>('clang_getNumDiagnosticsInSet'); - return _clang_getNumDiagnosticsInSet( + _dart_clang_getNumDiagnosticsInSet>('clang_getNumDiagnosticsInSet'))( Diags, ); } - _dart_clang_getNumDiagnosticsInSet _clang_getNumDiagnosticsInSet; + _dart_clang_getNumDiagnosticsInSet? _clang_getNumDiagnosticsInSet; /// Retrieve a diagnostic associated with the given CXDiagnosticSet. ffi.Pointer clang_getDiagnosticInSet( ffi.Pointer Diags, int Index, ) { - _clang_getDiagnosticInSet ??= _dylib.lookupFunction< + return (_clang_getDiagnosticInSet ??= _dylib.lookupFunction< _c_clang_getDiagnosticInSet, - _dart_clang_getDiagnosticInSet>('clang_getDiagnosticInSet'); - return _clang_getDiagnosticInSet( + _dart_clang_getDiagnosticInSet>('clang_getDiagnosticInSet'))( Diags, Index, ); } - _dart_clang_getDiagnosticInSet _clang_getDiagnosticInSet; + _dart_clang_getDiagnosticInSet? _clang_getDiagnosticInSet; /// Deserialize a set of diagnostics from a Clang diagnostics bitcode file. ffi.Pointer clang_loadDiagnostics( @@ -486,173 +466,163 @@ class LibClang { ffi.Pointer error, ffi.Pointer errorString, ) { - _clang_loadDiagnostics ??= _dylib.lookupFunction<_c_clang_loadDiagnostics, - _dart_clang_loadDiagnostics>('clang_loadDiagnostics'); - return _clang_loadDiagnostics( + return (_clang_loadDiagnostics ??= _dylib.lookupFunction< + _c_clang_loadDiagnostics, + _dart_clang_loadDiagnostics>('clang_loadDiagnostics'))( file, error, errorString, ); } - _dart_clang_loadDiagnostics _clang_loadDiagnostics; + _dart_clang_loadDiagnostics? _clang_loadDiagnostics; /// Release a CXDiagnosticSet and all of its contained diagnostics. void clang_disposeDiagnosticSet( ffi.Pointer Diags, ) { - _clang_disposeDiagnosticSet ??= _dylib.lookupFunction< + return (_clang_disposeDiagnosticSet ??= _dylib.lookupFunction< _c_clang_disposeDiagnosticSet, - _dart_clang_disposeDiagnosticSet>('clang_disposeDiagnosticSet'); - return _clang_disposeDiagnosticSet( + _dart_clang_disposeDiagnosticSet>('clang_disposeDiagnosticSet'))( Diags, ); } - _dart_clang_disposeDiagnosticSet _clang_disposeDiagnosticSet; + _dart_clang_disposeDiagnosticSet? _clang_disposeDiagnosticSet; /// Retrieve the child diagnostics of a CXDiagnostic. ffi.Pointer clang_getChildDiagnostics( ffi.Pointer D, ) { - _clang_getChildDiagnostics ??= _dylib.lookupFunction< + return (_clang_getChildDiagnostics ??= _dylib.lookupFunction< _c_clang_getChildDiagnostics, - _dart_clang_getChildDiagnostics>('clang_getChildDiagnostics'); - return _clang_getChildDiagnostics( + _dart_clang_getChildDiagnostics>('clang_getChildDiagnostics'))( D, ); } - _dart_clang_getChildDiagnostics _clang_getChildDiagnostics; + _dart_clang_getChildDiagnostics? _clang_getChildDiagnostics; /// Determine the number of diagnostics produced for the given translation /// unit. int clang_getNumDiagnostics( ffi.Pointer Unit, ) { - _clang_getNumDiagnostics ??= _dylib.lookupFunction< + return (_clang_getNumDiagnostics ??= _dylib.lookupFunction< _c_clang_getNumDiagnostics, - _dart_clang_getNumDiagnostics>('clang_getNumDiagnostics'); - return _clang_getNumDiagnostics( + _dart_clang_getNumDiagnostics>('clang_getNumDiagnostics'))( Unit, ); } - _dart_clang_getNumDiagnostics _clang_getNumDiagnostics; + _dart_clang_getNumDiagnostics? _clang_getNumDiagnostics; /// Retrieve a diagnostic associated with the given translation unit. ffi.Pointer clang_getDiagnostic( ffi.Pointer Unit, int Index, ) { - _clang_getDiagnostic ??= _dylib.lookupFunction<_c_clang_getDiagnostic, - _dart_clang_getDiagnostic>('clang_getDiagnostic'); - return _clang_getDiagnostic( + return (_clang_getDiagnostic ??= _dylib.lookupFunction< + _c_clang_getDiagnostic, + _dart_clang_getDiagnostic>('clang_getDiagnostic'))( Unit, Index, ); } - _dart_clang_getDiagnostic _clang_getDiagnostic; + _dart_clang_getDiagnostic? _clang_getDiagnostic; /// Retrieve the complete set of diagnostics associated with a translation /// unit. ffi.Pointer clang_getDiagnosticSetFromTU( ffi.Pointer Unit, ) { - _clang_getDiagnosticSetFromTU ??= _dylib.lookupFunction< + return (_clang_getDiagnosticSetFromTU ??= _dylib.lookupFunction< _c_clang_getDiagnosticSetFromTU, - _dart_clang_getDiagnosticSetFromTU>('clang_getDiagnosticSetFromTU'); - return _clang_getDiagnosticSetFromTU( + _dart_clang_getDiagnosticSetFromTU>('clang_getDiagnosticSetFromTU'))( Unit, ); } - _dart_clang_getDiagnosticSetFromTU _clang_getDiagnosticSetFromTU; + _dart_clang_getDiagnosticSetFromTU? _clang_getDiagnosticSetFromTU; /// Destroy a diagnostic. void clang_disposeDiagnostic( ffi.Pointer Diagnostic, ) { - _clang_disposeDiagnostic ??= _dylib.lookupFunction< + return (_clang_disposeDiagnostic ??= _dylib.lookupFunction< _c_clang_disposeDiagnostic, - _dart_clang_disposeDiagnostic>('clang_disposeDiagnostic'); - return _clang_disposeDiagnostic( + _dart_clang_disposeDiagnostic>('clang_disposeDiagnostic'))( Diagnostic, ); } - _dart_clang_disposeDiagnostic _clang_disposeDiagnostic; + _dart_clang_disposeDiagnostic? _clang_disposeDiagnostic; /// Retrieve the set of display options most similar to the default behavior /// of the clang compiler. int clang_defaultDiagnosticDisplayOptions() { - _clang_defaultDiagnosticDisplayOptions ??= _dylib.lookupFunction< + return (_clang_defaultDiagnosticDisplayOptions ??= _dylib.lookupFunction< _c_clang_defaultDiagnosticDisplayOptions, _dart_clang_defaultDiagnosticDisplayOptions>( - 'clang_defaultDiagnosticDisplayOptions'); - return _clang_defaultDiagnosticDisplayOptions(); + 'clang_defaultDiagnosticDisplayOptions'))(); } - _dart_clang_defaultDiagnosticDisplayOptions + _dart_clang_defaultDiagnosticDisplayOptions? _clang_defaultDiagnosticDisplayOptions; /// Determine the severity of the given diagnostic. int clang_getDiagnosticSeverity( ffi.Pointer arg0, ) { - _clang_getDiagnosticSeverity ??= _dylib.lookupFunction< + return (_clang_getDiagnosticSeverity ??= _dylib.lookupFunction< _c_clang_getDiagnosticSeverity, - _dart_clang_getDiagnosticSeverity>('clang_getDiagnosticSeverity'); - return _clang_getDiagnosticSeverity( + _dart_clang_getDiagnosticSeverity>('clang_getDiagnosticSeverity'))( arg0, ); } - _dart_clang_getDiagnosticSeverity _clang_getDiagnosticSeverity; + _dart_clang_getDiagnosticSeverity? _clang_getDiagnosticSeverity; /// Retrieve the category number for this diagnostic. int clang_getDiagnosticCategory( ffi.Pointer arg0, ) { - _clang_getDiagnosticCategory ??= _dylib.lookupFunction< + return (_clang_getDiagnosticCategory ??= _dylib.lookupFunction< _c_clang_getDiagnosticCategory, - _dart_clang_getDiagnosticCategory>('clang_getDiagnosticCategory'); - return _clang_getDiagnosticCategory( + _dart_clang_getDiagnosticCategory>('clang_getDiagnosticCategory'))( arg0, ); } - _dart_clang_getDiagnosticCategory _clang_getDiagnosticCategory; + _dart_clang_getDiagnosticCategory? _clang_getDiagnosticCategory; /// Determine the number of source ranges associated with the given /// diagnostic. int clang_getDiagnosticNumRanges( ffi.Pointer arg0, ) { - _clang_getDiagnosticNumRanges ??= _dylib.lookupFunction< + return (_clang_getDiagnosticNumRanges ??= _dylib.lookupFunction< _c_clang_getDiagnosticNumRanges, - _dart_clang_getDiagnosticNumRanges>('clang_getDiagnosticNumRanges'); - return _clang_getDiagnosticNumRanges( + _dart_clang_getDiagnosticNumRanges>('clang_getDiagnosticNumRanges'))( arg0, ); } - _dart_clang_getDiagnosticNumRanges _clang_getDiagnosticNumRanges; + _dart_clang_getDiagnosticNumRanges? _clang_getDiagnosticNumRanges; /// Determine the number of fix-it hints associated with the given diagnostic. int clang_getDiagnosticNumFixIts( ffi.Pointer Diagnostic, ) { - _clang_getDiagnosticNumFixIts ??= _dylib.lookupFunction< + return (_clang_getDiagnosticNumFixIts ??= _dylib.lookupFunction< _c_clang_getDiagnosticNumFixIts, - _dart_clang_getDiagnosticNumFixIts>('clang_getDiagnosticNumFixIts'); - return _clang_getDiagnosticNumFixIts( + _dart_clang_getDiagnosticNumFixIts>('clang_getDiagnosticNumFixIts'))( Diagnostic, ); } - _dart_clang_getDiagnosticNumFixIts _clang_getDiagnosticNumFixIts; + _dart_clang_getDiagnosticNumFixIts? _clang_getDiagnosticNumFixIts; /// Return the CXTranslationUnit for a given source file and the provided /// command line arguments one would pass to the compiler. @@ -664,11 +634,10 @@ class LibClang { int num_unsaved_files, ffi.Pointer unsaved_files, ) { - _clang_createTranslationUnitFromSourceFile ??= _dylib.lookupFunction< - _c_clang_createTranslationUnitFromSourceFile, - _dart_clang_createTranslationUnitFromSourceFile>( - 'clang_createTranslationUnitFromSourceFile'); - return _clang_createTranslationUnitFromSourceFile( + return (_clang_createTranslationUnitFromSourceFile ??= + _dylib.lookupFunction<_c_clang_createTranslationUnitFromSourceFile, + _dart_clang_createTranslationUnitFromSourceFile>( + 'clang_createTranslationUnitFromSourceFile'))( CIdx, source_filename, num_clang_command_line_args, @@ -678,7 +647,7 @@ class LibClang { ); } - _dart_clang_createTranslationUnitFromSourceFile + _dart_clang_createTranslationUnitFromSourceFile? _clang_createTranslationUnitFromSourceFile; /// Same as clang_createTranslationUnit2, but returns the CXTranslationUnit @@ -688,16 +657,15 @@ class LibClang { ffi.Pointer CIdx, ffi.Pointer ast_filename, ) { - _clang_createTranslationUnit ??= _dylib.lookupFunction< + return (_clang_createTranslationUnit ??= _dylib.lookupFunction< _c_clang_createTranslationUnit, - _dart_clang_createTranslationUnit>('clang_createTranslationUnit'); - return _clang_createTranslationUnit( + _dart_clang_createTranslationUnit>('clang_createTranslationUnit'))( CIdx, ast_filename, ); } - _dart_clang_createTranslationUnit _clang_createTranslationUnit; + _dart_clang_createTranslationUnit? _clang_createTranslationUnit; /// Create a translation unit from an AST file ( -emit-ast). int clang_createTranslationUnit2( @@ -705,29 +673,27 @@ class LibClang { ffi.Pointer ast_filename, ffi.Pointer> out_TU, ) { - _clang_createTranslationUnit2 ??= _dylib.lookupFunction< + return (_clang_createTranslationUnit2 ??= _dylib.lookupFunction< _c_clang_createTranslationUnit2, - _dart_clang_createTranslationUnit2>('clang_createTranslationUnit2'); - return _clang_createTranslationUnit2( + _dart_clang_createTranslationUnit2>('clang_createTranslationUnit2'))( CIdx, ast_filename, out_TU, ); } - _dart_clang_createTranslationUnit2 _clang_createTranslationUnit2; + _dart_clang_createTranslationUnit2? _clang_createTranslationUnit2; /// Returns the set of flags that is suitable for parsing a translation unit /// that is being edited. int clang_defaultEditingTranslationUnitOptions() { - _clang_defaultEditingTranslationUnitOptions ??= _dylib.lookupFunction< - _c_clang_defaultEditingTranslationUnitOptions, - _dart_clang_defaultEditingTranslationUnitOptions>( - 'clang_defaultEditingTranslationUnitOptions'); - return _clang_defaultEditingTranslationUnitOptions(); + return (_clang_defaultEditingTranslationUnitOptions ??= + _dylib.lookupFunction<_c_clang_defaultEditingTranslationUnitOptions, + _dart_clang_defaultEditingTranslationUnitOptions>( + 'clang_defaultEditingTranslationUnitOptions'))(); } - _dart_clang_defaultEditingTranslationUnitOptions + _dart_clang_defaultEditingTranslationUnitOptions? _clang_defaultEditingTranslationUnitOptions; /// Same as clang_parseTranslationUnit2, but returns the CXTranslationUnit @@ -742,10 +708,9 @@ class LibClang { int num_unsaved_files, int options, ) { - _clang_parseTranslationUnit ??= _dylib.lookupFunction< + return (_clang_parseTranslationUnit ??= _dylib.lookupFunction< _c_clang_parseTranslationUnit, - _dart_clang_parseTranslationUnit>('clang_parseTranslationUnit'); - return _clang_parseTranslationUnit( + _dart_clang_parseTranslationUnit>('clang_parseTranslationUnit'))( CIdx, source_filename, command_line_args, @@ -756,7 +721,7 @@ class LibClang { ); } - _dart_clang_parseTranslationUnit _clang_parseTranslationUnit; + _dart_clang_parseTranslationUnit? _clang_parseTranslationUnit; /// Parse the given source file and the translation unit corresponding to that /// file. @@ -770,10 +735,9 @@ class LibClang { int options, ffi.Pointer> out_TU, ) { - _clang_parseTranslationUnit2 ??= _dylib.lookupFunction< + return (_clang_parseTranslationUnit2 ??= _dylib.lookupFunction< _c_clang_parseTranslationUnit2, - _dart_clang_parseTranslationUnit2>('clang_parseTranslationUnit2'); - return _clang_parseTranslationUnit2( + _dart_clang_parseTranslationUnit2>('clang_parseTranslationUnit2'))( CIdx, source_filename, command_line_args, @@ -785,7 +749,7 @@ class LibClang { ); } - _dart_clang_parseTranslationUnit2 _clang_parseTranslationUnit2; + _dart_clang_parseTranslationUnit2? _clang_parseTranslationUnit2; /// Same as clang_parseTranslationUnit2 but requires a full command line for /// command_line_args including argv[0]. This is useful if the standard @@ -800,11 +764,10 @@ class LibClang { int options, ffi.Pointer> out_TU, ) { - _clang_parseTranslationUnit2FullArgv ??= _dylib.lookupFunction< + return (_clang_parseTranslationUnit2FullArgv ??= _dylib.lookupFunction< _c_clang_parseTranslationUnit2FullArgv, _dart_clang_parseTranslationUnit2FullArgv>( - 'clang_parseTranslationUnit2FullArgv'); - return _clang_parseTranslationUnit2FullArgv( + 'clang_parseTranslationUnit2FullArgv'))( CIdx, source_filename, command_line_args, @@ -816,22 +779,21 @@ class LibClang { ); } - _dart_clang_parseTranslationUnit2FullArgv + _dart_clang_parseTranslationUnit2FullArgv? _clang_parseTranslationUnit2FullArgv; /// Returns the set of flags that is suitable for saving a translation unit. int clang_defaultSaveOptions( ffi.Pointer TU, ) { - _clang_defaultSaveOptions ??= _dylib.lookupFunction< + return (_clang_defaultSaveOptions ??= _dylib.lookupFunction< _c_clang_defaultSaveOptions, - _dart_clang_defaultSaveOptions>('clang_defaultSaveOptions'); - return _clang_defaultSaveOptions( + _dart_clang_defaultSaveOptions>('clang_defaultSaveOptions'))( TU, ); } - _dart_clang_defaultSaveOptions _clang_defaultSaveOptions; + _dart_clang_defaultSaveOptions? _clang_defaultSaveOptions; /// Saves a translation unit into a serialized representation of that /// translation unit on disk. @@ -840,60 +802,56 @@ class LibClang { ffi.Pointer FileName, int options, ) { - _clang_saveTranslationUnit ??= _dylib.lookupFunction< + return (_clang_saveTranslationUnit ??= _dylib.lookupFunction< _c_clang_saveTranslationUnit, - _dart_clang_saveTranslationUnit>('clang_saveTranslationUnit'); - return _clang_saveTranslationUnit( + _dart_clang_saveTranslationUnit>('clang_saveTranslationUnit'))( TU, FileName, options, ); } - _dart_clang_saveTranslationUnit _clang_saveTranslationUnit; + _dart_clang_saveTranslationUnit? _clang_saveTranslationUnit; /// Suspend a translation unit in order to free memory associated with it. int clang_suspendTranslationUnit( ffi.Pointer arg0, ) { - _clang_suspendTranslationUnit ??= _dylib.lookupFunction< + return (_clang_suspendTranslationUnit ??= _dylib.lookupFunction< _c_clang_suspendTranslationUnit, - _dart_clang_suspendTranslationUnit>('clang_suspendTranslationUnit'); - return _clang_suspendTranslationUnit( + _dart_clang_suspendTranslationUnit>('clang_suspendTranslationUnit'))( arg0, ); } - _dart_clang_suspendTranslationUnit _clang_suspendTranslationUnit; + _dart_clang_suspendTranslationUnit? _clang_suspendTranslationUnit; /// Destroy the specified CXTranslationUnit object. void clang_disposeTranslationUnit( ffi.Pointer arg0, ) { - _clang_disposeTranslationUnit ??= _dylib.lookupFunction< + return (_clang_disposeTranslationUnit ??= _dylib.lookupFunction< _c_clang_disposeTranslationUnit, - _dart_clang_disposeTranslationUnit>('clang_disposeTranslationUnit'); - return _clang_disposeTranslationUnit( + _dart_clang_disposeTranslationUnit>('clang_disposeTranslationUnit'))( arg0, ); } - _dart_clang_disposeTranslationUnit _clang_disposeTranslationUnit; + _dart_clang_disposeTranslationUnit? _clang_disposeTranslationUnit; /// Returns the set of flags that is suitable for reparsing a translation /// unit. int clang_defaultReparseOptions( ffi.Pointer TU, ) { - _clang_defaultReparseOptions ??= _dylib.lookupFunction< + return (_clang_defaultReparseOptions ??= _dylib.lookupFunction< _c_clang_defaultReparseOptions, - _dart_clang_defaultReparseOptions>('clang_defaultReparseOptions'); - return _clang_defaultReparseOptions( + _dart_clang_defaultReparseOptions>('clang_defaultReparseOptions'))( TU, ); } - _dart_clang_defaultReparseOptions _clang_defaultReparseOptions; + _dart_clang_defaultReparseOptions? _clang_defaultReparseOptions; /// Reparse the source files that produced this translation unit. int clang_reparseTranslationUnit( @@ -902,10 +860,9 @@ class LibClang { ffi.Pointer unsaved_files, int options, ) { - _clang_reparseTranslationUnit ??= _dylib.lookupFunction< + return (_clang_reparseTranslationUnit ??= _dylib.lookupFunction< _c_clang_reparseTranslationUnit, - _dart_clang_reparseTranslationUnit>('clang_reparseTranslationUnit'); - return _clang_reparseTranslationUnit( + _dart_clang_reparseTranslationUnit>('clang_reparseTranslationUnit'))( TU, num_unsaved_files, unsaved_files, @@ -913,264 +870,249 @@ class LibClang { ); } - _dart_clang_reparseTranslationUnit _clang_reparseTranslationUnit; + _dart_clang_reparseTranslationUnit? _clang_reparseTranslationUnit; /// Returns the human-readable null-terminated C string that represents the /// name of the memory category. This string should never be freed. ffi.Pointer clang_getTUResourceUsageName( int kind, ) { - _clang_getTUResourceUsageName ??= _dylib.lookupFunction< + return (_clang_getTUResourceUsageName ??= _dylib.lookupFunction< _c_clang_getTUResourceUsageName, - _dart_clang_getTUResourceUsageName>('clang_getTUResourceUsageName'); - return _clang_getTUResourceUsageName( + _dart_clang_getTUResourceUsageName>('clang_getTUResourceUsageName'))( kind, ); } - _dart_clang_getTUResourceUsageName _clang_getTUResourceUsageName; + _dart_clang_getTUResourceUsageName? _clang_getTUResourceUsageName; /// Get target information for this translation unit. ffi.Pointer clang_getTranslationUnitTargetInfo( ffi.Pointer CTUnit, ) { - _clang_getTranslationUnitTargetInfo ??= _dylib.lookupFunction< + return (_clang_getTranslationUnitTargetInfo ??= _dylib.lookupFunction< _c_clang_getTranslationUnitTargetInfo, _dart_clang_getTranslationUnitTargetInfo>( - 'clang_getTranslationUnitTargetInfo'); - return _clang_getTranslationUnitTargetInfo( + 'clang_getTranslationUnitTargetInfo'))( CTUnit, ); } - _dart_clang_getTranslationUnitTargetInfo _clang_getTranslationUnitTargetInfo; + _dart_clang_getTranslationUnitTargetInfo? _clang_getTranslationUnitTargetInfo; /// Destroy the CXTargetInfo object. void clang_TargetInfo_dispose( ffi.Pointer Info, ) { - _clang_TargetInfo_dispose ??= _dylib.lookupFunction< + return (_clang_TargetInfo_dispose ??= _dylib.lookupFunction< _c_clang_TargetInfo_dispose, - _dart_clang_TargetInfo_dispose>('clang_TargetInfo_dispose'); - return _clang_TargetInfo_dispose( + _dart_clang_TargetInfo_dispose>('clang_TargetInfo_dispose'))( Info, ); } - _dart_clang_TargetInfo_dispose _clang_TargetInfo_dispose; + _dart_clang_TargetInfo_dispose? _clang_TargetInfo_dispose; /// Get the pointer width of the target in bits. int clang_TargetInfo_getPointerWidth( ffi.Pointer Info, ) { - _clang_TargetInfo_getPointerWidth ??= _dylib.lookupFunction< + return (_clang_TargetInfo_getPointerWidth ??= _dylib.lookupFunction< _c_clang_TargetInfo_getPointerWidth, _dart_clang_TargetInfo_getPointerWidth>( - 'clang_TargetInfo_getPointerWidth'); - return _clang_TargetInfo_getPointerWidth( + 'clang_TargetInfo_getPointerWidth'))( Info, ); } - _dart_clang_TargetInfo_getPointerWidth _clang_TargetInfo_getPointerWidth; + _dart_clang_TargetInfo_getPointerWidth? _clang_TargetInfo_getPointerWidth; /// Determine whether the given cursor kind represents a declaration. int clang_isDeclaration( int arg0, ) { - _clang_isDeclaration ??= _dylib.lookupFunction<_c_clang_isDeclaration, - _dart_clang_isDeclaration>('clang_isDeclaration'); - return _clang_isDeclaration( + return (_clang_isDeclaration ??= _dylib.lookupFunction< + _c_clang_isDeclaration, + _dart_clang_isDeclaration>('clang_isDeclaration'))( arg0, ); } - _dart_clang_isDeclaration _clang_isDeclaration; + _dart_clang_isDeclaration? _clang_isDeclaration; /// Determine whether the given cursor kind represents a simple reference. int clang_isReference( int arg0, ) { - _clang_isReference ??= + return (_clang_isReference ??= _dylib.lookupFunction<_c_clang_isReference, _dart_clang_isReference>( - 'clang_isReference'); - return _clang_isReference( + 'clang_isReference'))( arg0, ); } - _dart_clang_isReference _clang_isReference; + _dart_clang_isReference? _clang_isReference; /// Determine whether the given cursor kind represents an expression. int clang_isExpression( int arg0, ) { - _clang_isExpression ??= + return (_clang_isExpression ??= _dylib.lookupFunction<_c_clang_isExpression, _dart_clang_isExpression>( - 'clang_isExpression'); - return _clang_isExpression( + 'clang_isExpression'))( arg0, ); } - _dart_clang_isExpression _clang_isExpression; + _dart_clang_isExpression? _clang_isExpression; /// Determine whether the given cursor kind represents a statement. int clang_isStatement( int arg0, ) { - _clang_isStatement ??= + return (_clang_isStatement ??= _dylib.lookupFunction<_c_clang_isStatement, _dart_clang_isStatement>( - 'clang_isStatement'); - return _clang_isStatement( + 'clang_isStatement'))( arg0, ); } - _dart_clang_isStatement _clang_isStatement; + _dart_clang_isStatement? _clang_isStatement; /// Determine whether the given cursor kind represents an attribute. int clang_isAttribute( int arg0, ) { - _clang_isAttribute ??= + return (_clang_isAttribute ??= _dylib.lookupFunction<_c_clang_isAttribute, _dart_clang_isAttribute>( - 'clang_isAttribute'); - return _clang_isAttribute( + 'clang_isAttribute'))( arg0, ); } - _dart_clang_isAttribute _clang_isAttribute; + _dart_clang_isAttribute? _clang_isAttribute; /// Determine whether the given cursor kind represents an invalid cursor. int clang_isInvalid( int arg0, ) { - _clang_isInvalid ??= + return (_clang_isInvalid ??= _dylib.lookupFunction<_c_clang_isInvalid, _dart_clang_isInvalid>( - 'clang_isInvalid'); - return _clang_isInvalid( + 'clang_isInvalid'))( arg0, ); } - _dart_clang_isInvalid _clang_isInvalid; + _dart_clang_isInvalid? _clang_isInvalid; /// Determine whether the given cursor kind represents a translation unit. int clang_isTranslationUnit( int arg0, ) { - _clang_isTranslationUnit ??= _dylib.lookupFunction< + return (_clang_isTranslationUnit ??= _dylib.lookupFunction< _c_clang_isTranslationUnit, - _dart_clang_isTranslationUnit>('clang_isTranslationUnit'); - return _clang_isTranslationUnit( + _dart_clang_isTranslationUnit>('clang_isTranslationUnit'))( arg0, ); } - _dart_clang_isTranslationUnit _clang_isTranslationUnit; + _dart_clang_isTranslationUnit? _clang_isTranslationUnit; /// * Determine whether the given cursor represents a preprocessing element, /// such as a preprocessor directive or macro instantiation. int clang_isPreprocessing( int arg0, ) { - _clang_isPreprocessing ??= _dylib.lookupFunction<_c_clang_isPreprocessing, - _dart_clang_isPreprocessing>('clang_isPreprocessing'); - return _clang_isPreprocessing( + return (_clang_isPreprocessing ??= _dylib.lookupFunction< + _c_clang_isPreprocessing, + _dart_clang_isPreprocessing>('clang_isPreprocessing'))( arg0, ); } - _dart_clang_isPreprocessing _clang_isPreprocessing; + _dart_clang_isPreprocessing? _clang_isPreprocessing; /// * Determine whether the given cursor represents a currently unexposed /// piece of the AST (e.g., CXCursor_UnexposedStmt). int clang_isUnexposed( int arg0, ) { - _clang_isUnexposed ??= + return (_clang_isUnexposed ??= _dylib.lookupFunction<_c_clang_isUnexposed, _dart_clang_isUnexposed>( - 'clang_isUnexposed'); - return _clang_isUnexposed( + 'clang_isUnexposed'))( arg0, ); } - _dart_clang_isUnexposed _clang_isUnexposed; + _dart_clang_isUnexposed? _clang_isUnexposed; /// Free the memory associated with a CXPlatformAvailability structure. void clang_disposeCXPlatformAvailability( ffi.Pointer availability, ) { - _clang_disposeCXPlatformAvailability ??= _dylib.lookupFunction< + return (_clang_disposeCXPlatformAvailability ??= _dylib.lookupFunction< _c_clang_disposeCXPlatformAvailability, _dart_clang_disposeCXPlatformAvailability>( - 'clang_disposeCXPlatformAvailability'); - return _clang_disposeCXPlatformAvailability( + 'clang_disposeCXPlatformAvailability'))( availability, ); } - _dart_clang_disposeCXPlatformAvailability + _dart_clang_disposeCXPlatformAvailability? _clang_disposeCXPlatformAvailability; /// Creates an empty CXCursorSet. ffi.Pointer clang_createCXCursorSet() { - _clang_createCXCursorSet ??= _dylib.lookupFunction< + return (_clang_createCXCursorSet ??= _dylib.lookupFunction< _c_clang_createCXCursorSet, - _dart_clang_createCXCursorSet>('clang_createCXCursorSet'); - return _clang_createCXCursorSet(); + _dart_clang_createCXCursorSet>('clang_createCXCursorSet'))(); } - _dart_clang_createCXCursorSet _clang_createCXCursorSet; + _dart_clang_createCXCursorSet? _clang_createCXCursorSet; /// Disposes a CXCursorSet and releases its associated memory. void clang_disposeCXCursorSet( ffi.Pointer cset, ) { - _clang_disposeCXCursorSet ??= _dylib.lookupFunction< + return (_clang_disposeCXCursorSet ??= _dylib.lookupFunction< _c_clang_disposeCXCursorSet, - _dart_clang_disposeCXCursorSet>('clang_disposeCXCursorSet'); - return _clang_disposeCXCursorSet( + _dart_clang_disposeCXCursorSet>('clang_disposeCXCursorSet'))( cset, ); } - _dart_clang_disposeCXCursorSet _clang_disposeCXCursorSet; + _dart_clang_disposeCXCursorSet? _clang_disposeCXCursorSet; /// Free the set of overridden cursors returned by /// clang_getOverriddenCursors(). void clang_disposeOverriddenCursors( ffi.Pointer overridden, ) { - _clang_disposeOverriddenCursors ??= _dylib.lookupFunction< - _c_clang_disposeOverriddenCursors, - _dart_clang_disposeOverriddenCursors>('clang_disposeOverriddenCursors'); - return _clang_disposeOverriddenCursors( + return (_clang_disposeOverriddenCursors ??= _dylib.lookupFunction< + _c_clang_disposeOverriddenCursors, + _dart_clang_disposeOverriddenCursors>( + 'clang_disposeOverriddenCursors'))( overridden, ); } - _dart_clang_disposeOverriddenCursors _clang_disposeOverriddenCursors; + _dart_clang_disposeOverriddenCursors? _clang_disposeOverriddenCursors; /// Get a property value for the given printing policy. int clang_PrintingPolicy_getProperty( ffi.Pointer Policy, int Property, ) { - _clang_PrintingPolicy_getProperty ??= _dylib.lookupFunction< + return (_clang_PrintingPolicy_getProperty ??= _dylib.lookupFunction< _c_clang_PrintingPolicy_getProperty, _dart_clang_PrintingPolicy_getProperty>( - 'clang_PrintingPolicy_getProperty'); - return _clang_PrintingPolicy_getProperty( + 'clang_PrintingPolicy_getProperty'))( Policy, Property, ); } - _dart_clang_PrintingPolicy_getProperty _clang_PrintingPolicy_getProperty; + _dart_clang_PrintingPolicy_getProperty? _clang_PrintingPolicy_getProperty; /// Set a property value for the given printing policy. void clang_PrintingPolicy_setProperty( @@ -1178,32 +1120,30 @@ class LibClang { int Property, int Value, ) { - _clang_PrintingPolicy_setProperty ??= _dylib.lookupFunction< + return (_clang_PrintingPolicy_setProperty ??= _dylib.lookupFunction< _c_clang_PrintingPolicy_setProperty, _dart_clang_PrintingPolicy_setProperty>( - 'clang_PrintingPolicy_setProperty'); - return _clang_PrintingPolicy_setProperty( + 'clang_PrintingPolicy_setProperty'))( Policy, Property, Value, ); } - _dart_clang_PrintingPolicy_setProperty _clang_PrintingPolicy_setProperty; + _dart_clang_PrintingPolicy_setProperty? _clang_PrintingPolicy_setProperty; /// Release a printing policy. void clang_PrintingPolicy_dispose( ffi.Pointer Policy, ) { - _clang_PrintingPolicy_dispose ??= _dylib.lookupFunction< + return (_clang_PrintingPolicy_dispose ??= _dylib.lookupFunction< _c_clang_PrintingPolicy_dispose, - _dart_clang_PrintingPolicy_dispose>('clang_PrintingPolicy_dispose'); - return _clang_PrintingPolicy_dispose( + _dart_clang_PrintingPolicy_dispose>('clang_PrintingPolicy_dispose'))( Policy, ); } - _dart_clang_PrintingPolicy_dispose _clang_PrintingPolicy_dispose; + _dart_clang_PrintingPolicy_dispose? _clang_PrintingPolicy_dispose; /// Given a CXFile header file, return the module that contains it, if one /// exists. @@ -1211,73 +1151,71 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer arg1, ) { - _clang_getModuleForFile ??= _dylib.lookupFunction<_c_clang_getModuleForFile, - _dart_clang_getModuleForFile>('clang_getModuleForFile'); - return _clang_getModuleForFile( + return (_clang_getModuleForFile ??= _dylib.lookupFunction< + _c_clang_getModuleForFile, + _dart_clang_getModuleForFile>('clang_getModuleForFile'))( arg0, arg1, ); } - _dart_clang_getModuleForFile _clang_getModuleForFile; + _dart_clang_getModuleForFile? _clang_getModuleForFile; /// Returns the module file where the provided module object came from. ffi.Pointer clang_Module_getASTFile( ffi.Pointer Module, ) { - _clang_Module_getASTFile ??= _dylib.lookupFunction< + return (_clang_Module_getASTFile ??= _dylib.lookupFunction< _c_clang_Module_getASTFile, - _dart_clang_Module_getASTFile>('clang_Module_getASTFile'); - return _clang_Module_getASTFile( + _dart_clang_Module_getASTFile>('clang_Module_getASTFile'))( Module, ); } - _dart_clang_Module_getASTFile _clang_Module_getASTFile; + _dart_clang_Module_getASTFile? _clang_Module_getASTFile; /// 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, ) { - _clang_Module_getParent ??= _dylib.lookupFunction<_c_clang_Module_getParent, - _dart_clang_Module_getParent>('clang_Module_getParent'); - return _clang_Module_getParent( + 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; + _dart_clang_Module_getParent? _clang_Module_getParent; /// Returns non-zero if the module is a system one. int clang_Module_isSystem( ffi.Pointer Module, ) { - _clang_Module_isSystem ??= _dylib.lookupFunction<_c_clang_Module_isSystem, - _dart_clang_Module_isSystem>('clang_Module_isSystem'); - return _clang_Module_isSystem( + 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; + _dart_clang_Module_isSystem? _clang_Module_isSystem; /// Returns the number of top level headers associated with this module. int clang_Module_getNumTopLevelHeaders( ffi.Pointer arg0, ffi.Pointer Module, ) { - _clang_Module_getNumTopLevelHeaders ??= _dylib.lookupFunction< + return (_clang_Module_getNumTopLevelHeaders ??= _dylib.lookupFunction< _c_clang_Module_getNumTopLevelHeaders, _dart_clang_Module_getNumTopLevelHeaders>( - 'clang_Module_getNumTopLevelHeaders'); - return _clang_Module_getNumTopLevelHeaders( + 'clang_Module_getNumTopLevelHeaders'))( arg0, Module, ); } - _dart_clang_Module_getNumTopLevelHeaders _clang_Module_getNumTopLevelHeaders; + _dart_clang_Module_getNumTopLevelHeaders? _clang_Module_getNumTopLevelHeaders; /// Returns the specified top level header associated with the module. ffi.Pointer clang_Module_getTopLevelHeader( @@ -1285,17 +1223,17 @@ class LibClang { ffi.Pointer Module, int Index, ) { - _clang_Module_getTopLevelHeader ??= _dylib.lookupFunction< - _c_clang_Module_getTopLevelHeader, - _dart_clang_Module_getTopLevelHeader>('clang_Module_getTopLevelHeader'); - return _clang_Module_getTopLevelHeader( + 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; + _dart_clang_Module_getTopLevelHeader? _clang_Module_getTopLevelHeader; /// 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. @@ -1305,9 +1243,9 @@ class LibClang { int NumTokens, ffi.Pointer Cursors, ) { - _clang_annotateTokens ??= _dylib.lookupFunction<_c_clang_annotateTokens, - _dart_clang_annotateTokens>('clang_annotateTokens'); - return _clang_annotateTokens( + return (_clang_annotateTokens ??= _dylib.lookupFunction< + _c_clang_annotateTokens, + _dart_clang_annotateTokens>('clang_annotateTokens'))( TU, Tokens, NumTokens, @@ -1315,7 +1253,7 @@ class LibClang { ); } - _dart_clang_annotateTokens _clang_annotateTokens; + _dart_clang_annotateTokens? _clang_annotateTokens; /// Free the given set of tokens. void clang_disposeTokens( @@ -1323,57 +1261,55 @@ class LibClang { ffi.Pointer Tokens, int NumTokens, ) { - _clang_disposeTokens ??= _dylib.lookupFunction<_c_clang_disposeTokens, - _dart_clang_disposeTokens>('clang_disposeTokens'); - return _clang_disposeTokens( + return (_clang_disposeTokens ??= _dylib.lookupFunction< + _c_clang_disposeTokens, + _dart_clang_disposeTokens>('clang_disposeTokens'))( TU, Tokens, NumTokens, ); } - _dart_clang_disposeTokens _clang_disposeTokens; + _dart_clang_disposeTokens? _clang_disposeTokens; void clang_enableStackTraces() { - _clang_enableStackTraces ??= _dylib.lookupFunction< + return (_clang_enableStackTraces ??= _dylib.lookupFunction< _c_clang_enableStackTraces, - _dart_clang_enableStackTraces>('clang_enableStackTraces'); - return _clang_enableStackTraces(); + _dart_clang_enableStackTraces>('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, ) { - _clang_executeOnThread ??= _dylib.lookupFunction<_c_clang_executeOnThread, - _dart_clang_executeOnThread>('clang_executeOnThread'); - return _clang_executeOnThread( + return (_clang_executeOnThread ??= _dylib.lookupFunction< + _c_clang_executeOnThread, + _dart_clang_executeOnThread>('clang_executeOnThread'))( fn, user_data, stack_size, ); } - _dart_clang_executeOnThread _clang_executeOnThread; + _dart_clang_executeOnThread? _clang_executeOnThread; /// Determine the kind of a particular chunk within a completion string. int clang_getCompletionChunkKind( ffi.Pointer completion_string, int chunk_number, ) { - _clang_getCompletionChunkKind ??= _dylib.lookupFunction< + return (_clang_getCompletionChunkKind ??= _dylib.lookupFunction< _c_clang_getCompletionChunkKind, - _dart_clang_getCompletionChunkKind>('clang_getCompletionChunkKind'); - return _clang_getCompletionChunkKind( + _dart_clang_getCompletionChunkKind>('clang_getCompletionChunkKind'))( completion_string, chunk_number, ); } - _dart_clang_getCompletionChunkKind _clang_getCompletionChunkKind; + _dart_clang_getCompletionChunkKind? _clang_getCompletionChunkKind; /// Retrieve the completion string associated with a particular chunk within a /// completion string. @@ -1381,106 +1317,99 @@ class LibClang { ffi.Pointer completion_string, int chunk_number, ) { - _clang_getCompletionChunkCompletionString ??= _dylib.lookupFunction< + return (_clang_getCompletionChunkCompletionString ??= _dylib.lookupFunction< _c_clang_getCompletionChunkCompletionString, _dart_clang_getCompletionChunkCompletionString>( - 'clang_getCompletionChunkCompletionString'); - return _clang_getCompletionChunkCompletionString( + 'clang_getCompletionChunkCompletionString'))( completion_string, chunk_number, ); } - _dart_clang_getCompletionChunkCompletionString + _dart_clang_getCompletionChunkCompletionString? _clang_getCompletionChunkCompletionString; /// Retrieve the number of chunks in the given code-completion string. int clang_getNumCompletionChunks( ffi.Pointer completion_string, ) { - _clang_getNumCompletionChunks ??= _dylib.lookupFunction< + return (_clang_getNumCompletionChunks ??= _dylib.lookupFunction< _c_clang_getNumCompletionChunks, - _dart_clang_getNumCompletionChunks>('clang_getNumCompletionChunks'); - return _clang_getNumCompletionChunks( + _dart_clang_getNumCompletionChunks>('clang_getNumCompletionChunks'))( completion_string, ); } - _dart_clang_getNumCompletionChunks _clang_getNumCompletionChunks; + _dart_clang_getNumCompletionChunks? _clang_getNumCompletionChunks; /// Determine the priority of this code completion. int clang_getCompletionPriority( ffi.Pointer completion_string, ) { - _clang_getCompletionPriority ??= _dylib.lookupFunction< + return (_clang_getCompletionPriority ??= _dylib.lookupFunction< _c_clang_getCompletionPriority, - _dart_clang_getCompletionPriority>('clang_getCompletionPriority'); - return _clang_getCompletionPriority( + _dart_clang_getCompletionPriority>('clang_getCompletionPriority'))( completion_string, ); } - _dart_clang_getCompletionPriority _clang_getCompletionPriority; + _dart_clang_getCompletionPriority? _clang_getCompletionPriority; /// Determine the availability of the entity that this code-completion string /// refers to. int clang_getCompletionAvailability( ffi.Pointer completion_string, ) { - _clang_getCompletionAvailability ??= _dylib.lookupFunction< + return (_clang_getCompletionAvailability ??= _dylib.lookupFunction< _c_clang_getCompletionAvailability, _dart_clang_getCompletionAvailability>( - 'clang_getCompletionAvailability'); - return _clang_getCompletionAvailability( + 'clang_getCompletionAvailability'))( completion_string, ); } - _dart_clang_getCompletionAvailability _clang_getCompletionAvailability; + _dart_clang_getCompletionAvailability? _clang_getCompletionAvailability; /// Retrieve the number of annotations associated with the given completion /// string. int clang_getCompletionNumAnnotations( ffi.Pointer completion_string, ) { - _clang_getCompletionNumAnnotations ??= _dylib.lookupFunction< + return (_clang_getCompletionNumAnnotations ??= _dylib.lookupFunction< _c_clang_getCompletionNumAnnotations, _dart_clang_getCompletionNumAnnotations>( - 'clang_getCompletionNumAnnotations'); - return _clang_getCompletionNumAnnotations( + 'clang_getCompletionNumAnnotations'))( completion_string, ); } - _dart_clang_getCompletionNumAnnotations _clang_getCompletionNumAnnotations; + _dart_clang_getCompletionNumAnnotations? _clang_getCompletionNumAnnotations; /// Retrieve the number of fix-its for the given completion index. int clang_getCompletionNumFixIts( ffi.Pointer results, int completion_index, ) { - _clang_getCompletionNumFixIts ??= _dylib.lookupFunction< + return (_clang_getCompletionNumFixIts ??= _dylib.lookupFunction< _c_clang_getCompletionNumFixIts, - _dart_clang_getCompletionNumFixIts>('clang_getCompletionNumFixIts'); - return _clang_getCompletionNumFixIts( + _dart_clang_getCompletionNumFixIts>('clang_getCompletionNumFixIts'))( results, completion_index, ); } - _dart_clang_getCompletionNumFixIts _clang_getCompletionNumFixIts; + _dart_clang_getCompletionNumFixIts? _clang_getCompletionNumFixIts; /// Returns a default set of code-completion options that can be passed to /// clang_codeCompleteAt(). int clang_defaultCodeCompleteOptions() { - _clang_defaultCodeCompleteOptions ??= _dylib.lookupFunction< + return (_clang_defaultCodeCompleteOptions ??= _dylib.lookupFunction< _c_clang_defaultCodeCompleteOptions, _dart_clang_defaultCodeCompleteOptions>( - 'clang_defaultCodeCompleteOptions'); - return _clang_defaultCodeCompleteOptions(); + 'clang_defaultCodeCompleteOptions'))(); } - _dart_clang_defaultCodeCompleteOptions _clang_defaultCodeCompleteOptions; + _dart_clang_defaultCodeCompleteOptions? _clang_defaultCodeCompleteOptions; /// Perform code completion at a given location in a translation unit. ffi.Pointer clang_codeCompleteAt( @@ -1492,9 +1421,9 @@ class LibClang { int num_unsaved_files, int options, ) { - _clang_codeCompleteAt ??= _dylib.lookupFunction<_c_clang_codeCompleteAt, - _dart_clang_codeCompleteAt>('clang_codeCompleteAt'); - return _clang_codeCompleteAt( + return (_clang_codeCompleteAt ??= _dylib.lookupFunction< + _c_clang_codeCompleteAt, + _dart_clang_codeCompleteAt>('clang_codeCompleteAt'))( TU, complete_filename, complete_line, @@ -1505,55 +1434,52 @@ class LibClang { ); } - _dart_clang_codeCompleteAt _clang_codeCompleteAt; + _dart_clang_codeCompleteAt? _clang_codeCompleteAt; /// Sort the code-completion results in case-insensitive alphabetical order. void clang_sortCodeCompletionResults( ffi.Pointer Results, int NumResults, ) { - _clang_sortCodeCompletionResults ??= _dylib.lookupFunction< + return (_clang_sortCodeCompletionResults ??= _dylib.lookupFunction< _c_clang_sortCodeCompletionResults, _dart_clang_sortCodeCompletionResults>( - 'clang_sortCodeCompletionResults'); - return _clang_sortCodeCompletionResults( + 'clang_sortCodeCompletionResults'))( Results, NumResults, ); } - _dart_clang_sortCodeCompletionResults _clang_sortCodeCompletionResults; + _dart_clang_sortCodeCompletionResults? _clang_sortCodeCompletionResults; /// Free the given set of code-completion results. void clang_disposeCodeCompleteResults( ffi.Pointer Results, ) { - _clang_disposeCodeCompleteResults ??= _dylib.lookupFunction< + return (_clang_disposeCodeCompleteResults ??= _dylib.lookupFunction< _c_clang_disposeCodeCompleteResults, _dart_clang_disposeCodeCompleteResults>( - 'clang_disposeCodeCompleteResults'); - return _clang_disposeCodeCompleteResults( + 'clang_disposeCodeCompleteResults'))( Results, ); } - _dart_clang_disposeCodeCompleteResults _clang_disposeCodeCompleteResults; + _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, ) { - _clang_codeCompleteGetNumDiagnostics ??= _dylib.lookupFunction< + return (_clang_codeCompleteGetNumDiagnostics ??= _dylib.lookupFunction< _c_clang_codeCompleteGetNumDiagnostics, _dart_clang_codeCompleteGetNumDiagnostics>( - 'clang_codeCompleteGetNumDiagnostics'); - return _clang_codeCompleteGetNumDiagnostics( + 'clang_codeCompleteGetNumDiagnostics'))( Results, ); } - _dart_clang_codeCompleteGetNumDiagnostics + _dart_clang_codeCompleteGetNumDiagnostics? _clang_codeCompleteGetNumDiagnostics; /// Retrieve a diagnostic associated with the given code completion. @@ -1561,32 +1487,30 @@ class LibClang { ffi.Pointer Results, int Index, ) { - _clang_codeCompleteGetDiagnostic ??= _dylib.lookupFunction< + return (_clang_codeCompleteGetDiagnostic ??= _dylib.lookupFunction< _c_clang_codeCompleteGetDiagnostic, _dart_clang_codeCompleteGetDiagnostic>( - 'clang_codeCompleteGetDiagnostic'); - return _clang_codeCompleteGetDiagnostic( + 'clang_codeCompleteGetDiagnostic'))( Results, Index, ); } - _dart_clang_codeCompleteGetDiagnostic _clang_codeCompleteGetDiagnostic; + _dart_clang_codeCompleteGetDiagnostic? _clang_codeCompleteGetDiagnostic; /// Determines what completions are appropriate for the context the given code /// completion. int clang_codeCompleteGetContexts( ffi.Pointer Results, ) { - _clang_codeCompleteGetContexts ??= _dylib.lookupFunction< + return (_clang_codeCompleteGetContexts ??= _dylib.lookupFunction< _c_clang_codeCompleteGetContexts, - _dart_clang_codeCompleteGetContexts>('clang_codeCompleteGetContexts'); - return _clang_codeCompleteGetContexts( + _dart_clang_codeCompleteGetContexts>('clang_codeCompleteGetContexts'))( Results, ); } - _dart_clang_codeCompleteGetContexts _clang_codeCompleteGetContexts; + _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 @@ -1596,31 +1520,29 @@ class LibClang { ffi.Pointer Results, ffi.Pointer IsIncomplete, ) { - _clang_codeCompleteGetContainerKind ??= _dylib.lookupFunction< + return (_clang_codeCompleteGetContainerKind ??= _dylib.lookupFunction< _c_clang_codeCompleteGetContainerKind, _dart_clang_codeCompleteGetContainerKind>( - 'clang_codeCompleteGetContainerKind'); - return _clang_codeCompleteGetContainerKind( + 'clang_codeCompleteGetContainerKind'))( Results, IsIncomplete, ); } - _dart_clang_codeCompleteGetContainerKind _clang_codeCompleteGetContainerKind; + _dart_clang_codeCompleteGetContainerKind? _clang_codeCompleteGetContainerKind; /// Enable/disable crash recovery. void clang_toggleCrashRecovery( int isEnabled, ) { - _clang_toggleCrashRecovery ??= _dylib.lookupFunction< + return (_clang_toggleCrashRecovery ??= _dylib.lookupFunction< _c_clang_toggleCrashRecovery, - _dart_clang_toggleCrashRecovery>('clang_toggleCrashRecovery'); - return _clang_toggleCrashRecovery( + _dart_clang_toggleCrashRecovery>('clang_toggleCrashRecovery'))( isEnabled, ); } - _dart_clang_toggleCrashRecovery _clang_toggleCrashRecovery; + _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. @@ -1631,44 +1553,42 @@ class LibClang { ffi.Pointer> visitor, ffi.Pointer client_data, ) { - _clang_getInclusions ??= _dylib.lookupFunction<_c_clang_getInclusions, - _dart_clang_getInclusions>('clang_getInclusions'); - return _clang_getInclusions( + return (_clang_getInclusions ??= _dylib.lookupFunction< + _c_clang_getInclusions, + _dart_clang_getInclusions>('clang_getInclusions'))( tu, visitor, client_data, ); } - _dart_clang_getInclusions _clang_getInclusions; + _dart_clang_getInclusions? _clang_getInclusions; /// Returns the kind of the evaluated result. int clang_EvalResult_getKind( ffi.Pointer E, ) { - _clang_EvalResult_getKind ??= _dylib.lookupFunction< + return (_clang_EvalResult_getKind ??= _dylib.lookupFunction< _c_clang_EvalResult_getKind, - _dart_clang_EvalResult_getKind>('clang_EvalResult_getKind'); - return _clang_EvalResult_getKind( + _dart_clang_EvalResult_getKind>('clang_EvalResult_getKind'))( E, ); } - _dart_clang_EvalResult_getKind _clang_EvalResult_getKind; + _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, ) { - _clang_EvalResult_getAsInt ??= _dylib.lookupFunction< + return (_clang_EvalResult_getAsInt ??= _dylib.lookupFunction< _c_clang_EvalResult_getAsInt, - _dart_clang_EvalResult_getAsInt>('clang_EvalResult_getAsInt'); - return _clang_EvalResult_getAsInt( + _dart_clang_EvalResult_getAsInt>('clang_EvalResult_getAsInt'))( E, ); } - _dart_clang_EvalResult_getAsInt _clang_EvalResult_getAsInt; + _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 @@ -1676,59 +1596,58 @@ class LibClang { int clang_EvalResult_getAsLongLong( ffi.Pointer E, ) { - _clang_EvalResult_getAsLongLong ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsLongLong, - _dart_clang_EvalResult_getAsLongLong>('clang_EvalResult_getAsLongLong'); - return _clang_EvalResult_getAsLongLong( + 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; + _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, ) { - _clang_EvalResult_isUnsignedInt ??= _dylib.lookupFunction< - _c_clang_EvalResult_isUnsignedInt, - _dart_clang_EvalResult_isUnsignedInt>('clang_EvalResult_isUnsignedInt'); - return _clang_EvalResult_isUnsignedInt( + 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; + _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, ) { - _clang_EvalResult_getAsUnsigned ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsUnsigned, - _dart_clang_EvalResult_getAsUnsigned>('clang_EvalResult_getAsUnsigned'); - return _clang_EvalResult_getAsUnsigned( + 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; + _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, ) { - _clang_EvalResult_getAsDouble ??= _dylib.lookupFunction< + return (_clang_EvalResult_getAsDouble ??= _dylib.lookupFunction< _c_clang_EvalResult_getAsDouble, - _dart_clang_EvalResult_getAsDouble>('clang_EvalResult_getAsDouble'); - return _clang_EvalResult_getAsDouble( + _dart_clang_EvalResult_getAsDouble>('clang_EvalResult_getAsDouble'))( E, ); } - _dart_clang_EvalResult_getAsDouble _clang_EvalResult_getAsDouble; + _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 @@ -1737,73 +1656,69 @@ class LibClang { ffi.Pointer clang_EvalResult_getAsStr( ffi.Pointer E, ) { - _clang_EvalResult_getAsStr ??= _dylib.lookupFunction< + return (_clang_EvalResult_getAsStr ??= _dylib.lookupFunction< _c_clang_EvalResult_getAsStr, - _dart_clang_EvalResult_getAsStr>('clang_EvalResult_getAsStr'); - return _clang_EvalResult_getAsStr( + _dart_clang_EvalResult_getAsStr>('clang_EvalResult_getAsStr'))( E, ); } - _dart_clang_EvalResult_getAsStr _clang_EvalResult_getAsStr; + _dart_clang_EvalResult_getAsStr? _clang_EvalResult_getAsStr; /// Disposes the created Eval memory. void clang_EvalResult_dispose( ffi.Pointer E, ) { - _clang_EvalResult_dispose ??= _dylib.lookupFunction< + return (_clang_EvalResult_dispose ??= _dylib.lookupFunction< _c_clang_EvalResult_dispose, - _dart_clang_EvalResult_dispose>('clang_EvalResult_dispose'); - return _clang_EvalResult_dispose( + _dart_clang_EvalResult_dispose>('clang_EvalResult_dispose'))( E, ); } - _dart_clang_EvalResult_dispose _clang_EvalResult_dispose; + _dart_clang_EvalResult_dispose? _clang_EvalResult_dispose; /// Retrieve a remapping. ffi.Pointer clang_getRemappings( ffi.Pointer path, ) { - _clang_getRemappings ??= _dylib.lookupFunction<_c_clang_getRemappings, - _dart_clang_getRemappings>('clang_getRemappings'); - return _clang_getRemappings( + return (_clang_getRemappings ??= _dylib.lookupFunction< + _c_clang_getRemappings, + _dart_clang_getRemappings>('clang_getRemappings'))( path, ); } - _dart_clang_getRemappings _clang_getRemappings; + _dart_clang_getRemappings? _clang_getRemappings; /// Retrieve a remapping. ffi.Pointer clang_getRemappingsFromFileList( ffi.Pointer> filePaths, int numFiles, ) { - _clang_getRemappingsFromFileList ??= _dylib.lookupFunction< + return (_clang_getRemappingsFromFileList ??= _dylib.lookupFunction< _c_clang_getRemappingsFromFileList, _dart_clang_getRemappingsFromFileList>( - 'clang_getRemappingsFromFileList'); - return _clang_getRemappingsFromFileList( + 'clang_getRemappingsFromFileList'))( filePaths, numFiles, ); } - _dart_clang_getRemappingsFromFileList _clang_getRemappingsFromFileList; + _dart_clang_getRemappingsFromFileList? _clang_getRemappingsFromFileList; /// Determine the number of remappings. int clang_remap_getNumFiles( ffi.Pointer arg0, ) { - _clang_remap_getNumFiles ??= _dylib.lookupFunction< + return (_clang_remap_getNumFiles ??= _dylib.lookupFunction< _c_clang_remap_getNumFiles, - _dart_clang_remap_getNumFiles>('clang_remap_getNumFiles'); - return _clang_remap_getNumFiles( + _dart_clang_remap_getNumFiles>('clang_remap_getNumFiles'))( arg0, ); } - _dart_clang_remap_getNumFiles _clang_remap_getNumFiles; + _dart_clang_remap_getNumFiles? _clang_remap_getNumFiles; /// Get the original and the associated filename from the remapping. void clang_remap_getFilenames( @@ -1812,10 +1727,9 @@ class LibClang { ffi.Pointer original, ffi.Pointer transformed, ) { - _clang_remap_getFilenames ??= _dylib.lookupFunction< + return (_clang_remap_getFilenames ??= _dylib.lookupFunction< _c_clang_remap_getFilenames, - _dart_clang_remap_getFilenames>('clang_remap_getFilenames'); - return _clang_remap_getFilenames( + _dart_clang_remap_getFilenames>('clang_remap_getFilenames'))( arg0, index, original, @@ -1823,230 +1737,218 @@ class LibClang { ); } - _dart_clang_remap_getFilenames _clang_remap_getFilenames; + _dart_clang_remap_getFilenames? _clang_remap_getFilenames; /// Dispose the remapping. void clang_remap_dispose( ffi.Pointer arg0, ) { - _clang_remap_dispose ??= _dylib.lookupFunction<_c_clang_remap_dispose, - _dart_clang_remap_dispose>('clang_remap_dispose'); - return _clang_remap_dispose( + 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; + _dart_clang_remap_dispose? _clang_remap_dispose; int clang_index_isEntityObjCContainerKind( int arg0, ) { - _clang_index_isEntityObjCContainerKind ??= _dylib.lookupFunction< + return (_clang_index_isEntityObjCContainerKind ??= _dylib.lookupFunction< _c_clang_index_isEntityObjCContainerKind, _dart_clang_index_isEntityObjCContainerKind>( - 'clang_index_isEntityObjCContainerKind'); - return _clang_index_isEntityObjCContainerKind( + 'clang_index_isEntityObjCContainerKind'))( arg0, ); } - _dart_clang_index_isEntityObjCContainerKind + _dart_clang_index_isEntityObjCContainerKind? _clang_index_isEntityObjCContainerKind; ffi.Pointer clang_index_getObjCContainerDeclInfo( ffi.Pointer arg0, ) { - _clang_index_getObjCContainerDeclInfo ??= _dylib.lookupFunction< + return (_clang_index_getObjCContainerDeclInfo ??= _dylib.lookupFunction< _c_clang_index_getObjCContainerDeclInfo, _dart_clang_index_getObjCContainerDeclInfo>( - 'clang_index_getObjCContainerDeclInfo'); - return _clang_index_getObjCContainerDeclInfo( + 'clang_index_getObjCContainerDeclInfo'))( arg0, ); } - _dart_clang_index_getObjCContainerDeclInfo + _dart_clang_index_getObjCContainerDeclInfo? _clang_index_getObjCContainerDeclInfo; ffi.Pointer clang_index_getObjCInterfaceDeclInfo( ffi.Pointer arg0, ) { - _clang_index_getObjCInterfaceDeclInfo ??= _dylib.lookupFunction< + return (_clang_index_getObjCInterfaceDeclInfo ??= _dylib.lookupFunction< _c_clang_index_getObjCInterfaceDeclInfo, _dart_clang_index_getObjCInterfaceDeclInfo>( - 'clang_index_getObjCInterfaceDeclInfo'); - return _clang_index_getObjCInterfaceDeclInfo( + 'clang_index_getObjCInterfaceDeclInfo'))( arg0, ); } - _dart_clang_index_getObjCInterfaceDeclInfo + _dart_clang_index_getObjCInterfaceDeclInfo? _clang_index_getObjCInterfaceDeclInfo; ffi.Pointer clang_index_getObjCCategoryDeclInfo( ffi.Pointer arg0, ) { - _clang_index_getObjCCategoryDeclInfo ??= _dylib.lookupFunction< + return (_clang_index_getObjCCategoryDeclInfo ??= _dylib.lookupFunction< _c_clang_index_getObjCCategoryDeclInfo, _dart_clang_index_getObjCCategoryDeclInfo>( - 'clang_index_getObjCCategoryDeclInfo'); - return _clang_index_getObjCCategoryDeclInfo( + 'clang_index_getObjCCategoryDeclInfo'))( arg0, ); } - _dart_clang_index_getObjCCategoryDeclInfo + _dart_clang_index_getObjCCategoryDeclInfo? _clang_index_getObjCCategoryDeclInfo; ffi.Pointer clang_index_getObjCProtocolRefListInfo( ffi.Pointer arg0, ) { - _clang_index_getObjCProtocolRefListInfo ??= _dylib.lookupFunction< + return (_clang_index_getObjCProtocolRefListInfo ??= _dylib.lookupFunction< _c_clang_index_getObjCProtocolRefListInfo, _dart_clang_index_getObjCProtocolRefListInfo>( - 'clang_index_getObjCProtocolRefListInfo'); - return _clang_index_getObjCProtocolRefListInfo( + 'clang_index_getObjCProtocolRefListInfo'))( arg0, ); } - _dart_clang_index_getObjCProtocolRefListInfo + _dart_clang_index_getObjCProtocolRefListInfo? _clang_index_getObjCProtocolRefListInfo; ffi.Pointer clang_index_getObjCPropertyDeclInfo( ffi.Pointer arg0, ) { - _clang_index_getObjCPropertyDeclInfo ??= _dylib.lookupFunction< + return (_clang_index_getObjCPropertyDeclInfo ??= _dylib.lookupFunction< _c_clang_index_getObjCPropertyDeclInfo, _dart_clang_index_getObjCPropertyDeclInfo>( - 'clang_index_getObjCPropertyDeclInfo'); - return _clang_index_getObjCPropertyDeclInfo( + 'clang_index_getObjCPropertyDeclInfo'))( arg0, ); } - _dart_clang_index_getObjCPropertyDeclInfo + _dart_clang_index_getObjCPropertyDeclInfo? _clang_index_getObjCPropertyDeclInfo; ffi.Pointer clang_index_getIBOutletCollectionAttrInfo( ffi.Pointer arg0, ) { - _clang_index_getIBOutletCollectionAttrInfo ??= _dylib.lookupFunction< - _c_clang_index_getIBOutletCollectionAttrInfo, - _dart_clang_index_getIBOutletCollectionAttrInfo>( - 'clang_index_getIBOutletCollectionAttrInfo'); - return _clang_index_getIBOutletCollectionAttrInfo( + return (_clang_index_getIBOutletCollectionAttrInfo ??= + _dylib.lookupFunction<_c_clang_index_getIBOutletCollectionAttrInfo, + _dart_clang_index_getIBOutletCollectionAttrInfo>( + 'clang_index_getIBOutletCollectionAttrInfo'))( arg0, ); } - _dart_clang_index_getIBOutletCollectionAttrInfo + _dart_clang_index_getIBOutletCollectionAttrInfo? _clang_index_getIBOutletCollectionAttrInfo; ffi.Pointer clang_index_getCXXClassDeclInfo( ffi.Pointer arg0, ) { - _clang_index_getCXXClassDeclInfo ??= _dylib.lookupFunction< + return (_clang_index_getCXXClassDeclInfo ??= _dylib.lookupFunction< _c_clang_index_getCXXClassDeclInfo, _dart_clang_index_getCXXClassDeclInfo>( - 'clang_index_getCXXClassDeclInfo'); - return _clang_index_getCXXClassDeclInfo( + 'clang_index_getCXXClassDeclInfo'))( arg0, ); } - _dart_clang_index_getCXXClassDeclInfo _clang_index_getCXXClassDeclInfo; + _dart_clang_index_getCXXClassDeclInfo? _clang_index_getCXXClassDeclInfo; /// For retrieving a custom CXIdxClientContainer attached to a container. ffi.Pointer clang_index_getClientContainer( ffi.Pointer arg0, ) { - _clang_index_getClientContainer ??= _dylib.lookupFunction< - _c_clang_index_getClientContainer, - _dart_clang_index_getClientContainer>('clang_index_getClientContainer'); - return _clang_index_getClientContainer( + 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; + _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, ) { - _clang_index_setClientContainer ??= _dylib.lookupFunction< - _c_clang_index_setClientContainer, - _dart_clang_index_setClientContainer>('clang_index_setClientContainer'); - return _clang_index_setClientContainer( + 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; + _dart_clang_index_setClientContainer? _clang_index_setClientContainer; /// For retrieving a custom CXIdxClientEntity attached to an entity. ffi.Pointer clang_index_getClientEntity( ffi.Pointer arg0, ) { - _clang_index_getClientEntity ??= _dylib.lookupFunction< + return (_clang_index_getClientEntity ??= _dylib.lookupFunction< _c_clang_index_getClientEntity, - _dart_clang_index_getClientEntity>('clang_index_getClientEntity'); - return _clang_index_getClientEntity( + _dart_clang_index_getClientEntity>('clang_index_getClientEntity'))( arg0, ); } - _dart_clang_index_getClientEntity _clang_index_getClientEntity; + _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, ) { - _clang_index_setClientEntity ??= _dylib.lookupFunction< + return (_clang_index_setClientEntity ??= _dylib.lookupFunction< _c_clang_index_setClientEntity, - _dart_clang_index_setClientEntity>('clang_index_setClientEntity'); - return _clang_index_setClientEntity( + _dart_clang_index_setClientEntity>('clang_index_setClientEntity'))( arg0, arg1, ); } - _dart_clang_index_setClientEntity _clang_index_setClientEntity; + _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, ) { - _clang_IndexAction_create ??= _dylib.lookupFunction< + return (_clang_IndexAction_create ??= _dylib.lookupFunction< _c_clang_IndexAction_create, - _dart_clang_IndexAction_create>('clang_IndexAction_create'); - return _clang_IndexAction_create( + _dart_clang_IndexAction_create>('clang_IndexAction_create'))( CIdx, ); } - _dart_clang_IndexAction_create _clang_IndexAction_create; + _dart_clang_IndexAction_create? _clang_IndexAction_create; /// Destroy the given index action. void clang_IndexAction_dispose( ffi.Pointer arg0, ) { - _clang_IndexAction_dispose ??= _dylib.lookupFunction< + return (_clang_IndexAction_dispose ??= _dylib.lookupFunction< _c_clang_IndexAction_dispose, - _dart_clang_IndexAction_dispose>('clang_IndexAction_dispose'); - return _clang_IndexAction_dispose( + _dart_clang_IndexAction_dispose>('clang_IndexAction_dispose'))( arg0, ); } - _dart_clang_IndexAction_dispose _clang_IndexAction_dispose; + _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. @@ -2064,9 +1966,9 @@ class LibClang { ffi.Pointer> out_TU, int TU_options, ) { - _clang_indexSourceFile ??= _dylib.lookupFunction<_c_clang_indexSourceFile, - _dart_clang_indexSourceFile>('clang_indexSourceFile'); - return _clang_indexSourceFile( + return (_clang_indexSourceFile ??= _dylib.lookupFunction< + _c_clang_indexSourceFile, + _dart_clang_indexSourceFile>('clang_indexSourceFile'))( arg0, client_data, index_callbacks, @@ -2082,7 +1984,7 @@ class LibClang { ); } - _dart_clang_indexSourceFile _clang_indexSourceFile; + _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 @@ -2101,10 +2003,9 @@ class LibClang { ffi.Pointer> out_TU, int TU_options, ) { - _clang_indexSourceFileFullArgv ??= _dylib.lookupFunction< + return (_clang_indexSourceFileFullArgv ??= _dylib.lookupFunction< _c_clang_indexSourceFileFullArgv, - _dart_clang_indexSourceFileFullArgv>('clang_indexSourceFileFullArgv'); - return _clang_indexSourceFileFullArgv( + _dart_clang_indexSourceFileFullArgv>('clang_indexSourceFileFullArgv'))( arg0, client_data, index_callbacks, @@ -2120,7 +2021,7 @@ class LibClang { ); } - _dart_clang_indexSourceFileFullArgv _clang_indexSourceFileFullArgv; + _dart_clang_indexSourceFileFullArgv? _clang_indexSourceFileFullArgv; /// Index the given translation unit via callbacks implemented through /// #IndexerCallbacks. @@ -2132,10 +2033,9 @@ class LibClang { int index_options, ffi.Pointer arg5, ) { - _clang_indexTranslationUnit ??= _dylib.lookupFunction< + return (_clang_indexTranslationUnit ??= _dylib.lookupFunction< _c_clang_indexTranslationUnit, - _dart_clang_indexTranslationUnit>('clang_indexTranslationUnit'); - return _clang_indexTranslationUnit( + _dart_clang_indexTranslationUnit>('clang_indexTranslationUnit'))( arg0, client_data, index_callbacks, @@ -2145,7 +2045,7 @@ class LibClang { ); } - _dart_clang_indexTranslationUnit _clang_indexTranslationUnit; + _dart_clang_indexTranslationUnit? _clang_indexTranslationUnit; } /// Error codes returned by libclang routines. @@ -2168,17 +2068,17 @@ abstract class CXErrorCode { /// A character string. class CXString extends ffi.Struct { - ffi.Pointer data; + external ffi.Pointer data; @ffi.Uint32() - int private_flags; + external int private_flags; } class CXStringSet extends ffi.Struct { - ffi.Pointer Strings; + external ffi.Pointer Strings; @ffi.Uint32() - int Count; + external int Count; } class CXVirtualFileOverlayImpl extends ffi.Struct {} @@ -2192,14 +2092,14 @@ 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. - ffi.Pointer Filename; + external ffi.Pointer Filename; /// A buffer containing the unsaved contents of this file. - ffi.Pointer Contents; + external ffi.Pointer Contents; /// The length of the unsaved contents of this buffer. @ffi.Uint64() - int Length; + external int Length; } /// Describes the availability of a particular entity, which indicates whether @@ -2226,18 +2126,18 @@ 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() - int Major; + 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() - int Minor; + 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() - int Subminor; + external int Subminor; } /// Describes the exception specification of a cursor. @@ -2294,11 +2194,11 @@ abstract class CXGlobalOptFlags { /// across an indexing session. class CXFileUniqueID extends ffi.Struct { @ffi.Uint64() - int _unique_data_item_0; + external int _unique_data_item_0; @ffi.Uint64() - int _unique_data_item_1; + external int _unique_data_item_1; @ffi.Uint64() - int _unique_data_item_2; + external int _unique_data_item_2; /// Helper for array `data`. ArrayHelper_CXFileUniqueID_data_level0 get data => @@ -2355,14 +2255,14 @@ class ArrayHelper_CXFileUniqueID_data_level0 { /// Identifies a specific source location within a translation unit. class CXSourceLocation extends ffi.Struct { - ffi.Pointer _unique_ptr_data_item_0; - ffi.Pointer _unique_ptr_data_item_1; + 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() - int int_data; + external int int_data; } /// Helper for array `ptr_data` in struct `CXSourceLocation`. @@ -2410,17 +2310,17 @@ class ArrayHelper_CXSourceLocation_ptr_data_level0 { /// Identifies a half-open character range in the source code. class CXSourceRange extends ffi.Struct { - ffi.Pointer _unique_ptr_data_item_0; - ffi.Pointer _unique_ptr_data_item_1; + 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() - int begin_int_data; + external int begin_int_data; @ffi.Uint32() - int end_int_data; + external int end_int_data; } /// Helper for array `ptr_data` in struct `CXSourceRange`. @@ -2470,10 +2370,10 @@ class ArrayHelper_CXSourceRange_ptr_data_level0 { class CXSourceRangeList extends ffi.Struct { /// The number of ranges in the ranges array. @ffi.Uint32() - int count; + external int count; /// An array of CXSourceRanges. - ffi.Pointer ranges; + external ffi.Pointer ranges; } /// Describes the severity of a particular diagnostic. @@ -2656,20 +2556,20 @@ abstract class CXTUResourceUsageKind { class CXTUResourceUsageEntry extends ffi.Struct { @ffi.Int32() - int kind; + external int kind; @ffi.Uint64() - int amount; + external int amount; } /// The memory usage of a CXTranslationUnit, broken into categories. class CXTUResourceUsage extends ffi.Struct { - ffi.Pointer data; + external ffi.Pointer data; @ffi.Uint32() - int numEntries; + external int numEntries; - ffi.Pointer entries; + external ffi.Pointer entries; } /// Describes the kind of entity that a cursor refers to. @@ -3328,14 +3228,14 @@ abstract class CXCursorKind { /// translation unit. class CXCursor extends ffi.Struct { @ffi.Int32() - int kind; + external int kind; @ffi.Int32() - int xdata; + external int xdata; - ffi.Pointer _unique_data_item_0; - ffi.Pointer _unique_data_item_1; - ffi.Pointer _unique_data_item_2; + 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 => @@ -3602,10 +3502,10 @@ abstract class CXCallingConv { /// The type of an element in the abstract syntax tree. class CXType extends ffi.Struct { @ffi.Int32() - int kind; + external int kind; - ffi.Pointer _unique_data_item_0; - ffi.Pointer _unique_data_item_1; + external ffi.Pointer _unique_data_item_0; + external ffi.Pointer _unique_data_item_1; /// Helper for array `data`. ArrayHelper_CXType_data_level0 get data => @@ -3849,18 +3749,18 @@ abstract class CXTokenKind { /// Describes a single preprocessing token. class CXToken extends ffi.Struct { @ffi.Uint32() - int _unique_int_data_item_0; + external int _unique_int_data_item_0; @ffi.Uint32() - int _unique_int_data_item_1; + external int _unique_int_data_item_1; @ffi.Uint32() - int _unique_int_data_item_2; + external int _unique_int_data_item_2; @ffi.Uint32() - int _unique_int_data_item_3; + 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); - ffi.Pointer ptr_data; + external ffi.Pointer ptr_data; } /// Helper for array `int_data` in struct `CXToken`. @@ -3920,11 +3820,11 @@ class ArrayHelper_CXToken_int_data_level0 { class CXCompletionResult extends ffi.Struct { /// The kind of entity that this completion refers to. @ffi.Int32() - int CursorKind; + external int CursorKind; /// The code-completion string that describes how to insert this /// code-completion result into the editing buffer. - ffi.Pointer CompletionString; + external ffi.Pointer CompletionString; } /// Describes a single piece of text within a code-completion string. @@ -4003,11 +3903,11 @@ abstract class CXCompletionChunkKind { /// Contains the results of code-completion. class CXCodeCompleteResults extends ffi.Struct { /// The code-completion results. - ffi.Pointer Results; + external ffi.Pointer Results; /// The number of code-completion results stored in the Results array. @ffi.Uint32() - int NumResults; + external int NumResults; } /// Flags that can be passed to clang_codeCompleteAt() to modify its behavior. @@ -4158,14 +4058,14 @@ abstract class CXResult { /// Source location passed to index callbacks. class CXIdxLoc extends ffi.Struct { - ffi.Pointer _unique_ptr_data_item_0; - ffi.Pointer _unique_ptr_data_item_1; + 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() - int int_data; + external int int_data; } /// Helper for array `ptr_data` in struct `CXIdxLoc`. @@ -4294,10 +4194,10 @@ abstract class CXIdxObjCContainerKind { } class CXIdxObjCContainerDeclInfo extends ffi.Struct { - ffi.Pointer declInfo; + external ffi.Pointer declInfo; @ffi.Int32() - int kind; + external int kind; } class CXIdxBaseClassInfo extends ffi.Struct {} @@ -4305,37 +4205,37 @@ class CXIdxBaseClassInfo extends ffi.Struct {} class CXIdxObjCProtocolRefInfo extends ffi.Struct {} class CXIdxObjCProtocolRefListInfo extends ffi.Struct { - ffi.Pointer> protocols; + external ffi.Pointer> protocols; @ffi.Uint32() - int numProtocols; + external int numProtocols; } class CXIdxObjCInterfaceDeclInfo extends ffi.Struct { - ffi.Pointer containerInfo; + external ffi.Pointer containerInfo; - ffi.Pointer superInfo; + external ffi.Pointer superInfo; - ffi.Pointer protocols; + external ffi.Pointer protocols; } class CXIdxObjCCategoryDeclInfo extends ffi.Struct {} class CXIdxObjCPropertyDeclInfo extends ffi.Struct { - ffi.Pointer declInfo; + external ffi.Pointer declInfo; - ffi.Pointer getter; + external ffi.Pointer getter; - ffi.Pointer setter; + external ffi.Pointer setter; } class CXIdxCXXClassDeclInfo extends ffi.Struct { - ffi.Pointer declInfo; + external ffi.Pointer declInfo; - ffi.Pointer> bases; + external ffi.Pointer> bases; @ffi.Uint32() - int numBases; + external int numBases; } /// Data for IndexerCallbacks#indexEntityReference. @@ -4370,26 +4270,26 @@ class CXIdxEntityRefInfo extends ffi.Struct {} class IndexerCallbacks extends ffi.Struct { /// Called periodically to check whether indexing should be aborted. Should /// return 0 to continue, and non-zero to abort. - ffi.Pointer> abortQuery; + external ffi.Pointer> abortQuery; /// Called at the end of indexing; passes the complete diagnostic set. - ffi.Pointer> diagnostic; + external ffi.Pointer> diagnostic; - ffi.Pointer> enteredMainFile; + external ffi.Pointer> enteredMainFile; /// Called when a file gets #included/#imported. - ffi.Pointer> ppIncludedFile; + external ffi.Pointer> ppIncludedFile; /// Called when a AST file (PCH or module) gets imported. - ffi.Pointer> importedASTFile; + external ffi.Pointer> importedASTFile; /// Called at the beginning of indexing a translation unit. - ffi.Pointer> startedTranslationUnit; + external ffi.Pointer> startedTranslationUnit; - ffi.Pointer> indexDeclaration; + external ffi.Pointer> indexDeclaration; /// Called to index a reference of an entity. - ffi.Pointer> indexEntityReference; + external ffi.Pointer> indexEntityReference; } abstract class CXIndexOptFlags { diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index 7ca15ad870..7ea5be8f89 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -12,57 +12,52 @@ class SQLite { SQLite(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; ffi.Pointer sqlite3_libversion() { - _sqlite3_libversion ??= + return (_sqlite3_libversion ??= _dylib.lookupFunction<_c_sqlite3_libversion, _dart_sqlite3_libversion>( - 'sqlite3_libversion'); - return _sqlite3_libversion(); + 'sqlite3_libversion'))(); } - _dart_sqlite3_libversion _sqlite3_libversion; + _dart_sqlite3_libversion? _sqlite3_libversion; ffi.Pointer sqlite3_sourceid() { - _sqlite3_sourceid ??= + return (_sqlite3_sourceid ??= _dylib.lookupFunction<_c_sqlite3_sourceid, _dart_sqlite3_sourceid>( - 'sqlite3_sourceid'); - return _sqlite3_sourceid(); + 'sqlite3_sourceid'))(); } - _dart_sqlite3_sourceid _sqlite3_sourceid; + _dart_sqlite3_sourceid? _sqlite3_sourceid; int sqlite3_libversion_number() { - _sqlite3_libversion_number ??= _dylib.lookupFunction< + return (_sqlite3_libversion_number ??= _dylib.lookupFunction< _c_sqlite3_libversion_number, - _dart_sqlite3_libversion_number>('sqlite3_libversion_number'); - return _sqlite3_libversion_number(); + _dart_sqlite3_libversion_number>('sqlite3_libversion_number'))(); } - _dart_sqlite3_libversion_number _sqlite3_libversion_number; + _dart_sqlite3_libversion_number? _sqlite3_libversion_number; int sqlite3_compileoption_used( ffi.Pointer zOptName, ) { - _sqlite3_compileoption_used ??= _dylib.lookupFunction< + return (_sqlite3_compileoption_used ??= _dylib.lookupFunction< _c_sqlite3_compileoption_used, - _dart_sqlite3_compileoption_used>('sqlite3_compileoption_used'); - return _sqlite3_compileoption_used( + _dart_sqlite3_compileoption_used>('sqlite3_compileoption_used'))( zOptName, ); } - _dart_sqlite3_compileoption_used _sqlite3_compileoption_used; + _dart_sqlite3_compileoption_used? _sqlite3_compileoption_used; ffi.Pointer sqlite3_compileoption_get( int N, ) { - _sqlite3_compileoption_get ??= _dylib.lookupFunction< + return (_sqlite3_compileoption_get ??= _dylib.lookupFunction< _c_sqlite3_compileoption_get, - _dart_sqlite3_compileoption_get>('sqlite3_compileoption_get'); - return _sqlite3_compileoption_get( + _dart_sqlite3_compileoption_get>('sqlite3_compileoption_get'))( N, ); } - _dart_sqlite3_compileoption_get _sqlite3_compileoption_get; + _dart_sqlite3_compileoption_get? _sqlite3_compileoption_get; /// CAPI3REF: Test To See If The Library Is Threadsafe /// @@ -99,13 +94,12 @@ class SQLite { /// /// See the [threading mode] documentation for additional information. int sqlite3_threadsafe() { - _sqlite3_threadsafe ??= + return (_sqlite3_threadsafe ??= _dylib.lookupFunction<_c_sqlite3_threadsafe, _dart_sqlite3_threadsafe>( - 'sqlite3_threadsafe'); - return _sqlite3_threadsafe(); + 'sqlite3_threadsafe'))(); } - _dart_sqlite3_threadsafe _sqlite3_threadsafe; + _dart_sqlite3_threadsafe? _sqlite3_threadsafe; /// CAPI3REF: Closing A Database Connection /// DESTRUCTOR: sqlite3 @@ -146,27 +140,26 @@ class SQLite { int sqlite3_close( ffi.Pointer arg0, ) { - _sqlite3_close ??= _dylib - .lookupFunction<_c_sqlite3_close, _dart_sqlite3_close>('sqlite3_close'); - return _sqlite3_close( + return (_sqlite3_close ??= + _dylib.lookupFunction<_c_sqlite3_close, _dart_sqlite3_close>( + 'sqlite3_close'))( arg0, ); } - _dart_sqlite3_close _sqlite3_close; + _dart_sqlite3_close? _sqlite3_close; int sqlite3_close_v2( ffi.Pointer arg0, ) { - _sqlite3_close_v2 ??= + return (_sqlite3_close_v2 ??= _dylib.lookupFunction<_c_sqlite3_close_v2, _dart_sqlite3_close_v2>( - 'sqlite3_close_v2'); - return _sqlite3_close_v2( + 'sqlite3_close_v2'))( arg0, ); } - _dart_sqlite3_close_v2 _sqlite3_close_v2; + _dart_sqlite3_close_v2? _sqlite3_close_v2; /// CAPI3REF: One-Step Query Execution Interface /// METHOD: sqlite3 @@ -235,9 +228,8 @@ class SQLite { ffi.Pointer arg3, ffi.Pointer> errmsg, ) { - _sqlite3_exec ??= _dylib - .lookupFunction<_c_sqlite3_exec, _dart_sqlite3_exec>('sqlite3_exec'); - return _sqlite3_exec( + return (_sqlite3_exec ??= _dylib + .lookupFunction<_c_sqlite3_exec, _dart_sqlite3_exec>('sqlite3_exec'))( arg0, sql, callback, @@ -246,7 +238,7 @@ class SQLite { ); } - _dart_sqlite3_exec _sqlite3_exec; + _dart_sqlite3_exec? _sqlite3_exec; /// CAPI3REF: Initialize The SQLite Library /// @@ -322,40 +314,36 @@ class SQLite { /// must return [SQLITE_OK] on success and some other [error code] upon /// failure. int sqlite3_initialize() { - _sqlite3_initialize ??= + return (_sqlite3_initialize ??= _dylib.lookupFunction<_c_sqlite3_initialize, _dart_sqlite3_initialize>( - 'sqlite3_initialize'); - return _sqlite3_initialize(); + 'sqlite3_initialize'))(); } - _dart_sqlite3_initialize _sqlite3_initialize; + _dart_sqlite3_initialize? _sqlite3_initialize; int sqlite3_shutdown() { - _sqlite3_shutdown ??= + return (_sqlite3_shutdown ??= _dylib.lookupFunction<_c_sqlite3_shutdown, _dart_sqlite3_shutdown>( - 'sqlite3_shutdown'); - return _sqlite3_shutdown(); + 'sqlite3_shutdown'))(); } - _dart_sqlite3_shutdown _sqlite3_shutdown; + _dart_sqlite3_shutdown? _sqlite3_shutdown; int sqlite3_os_init() { - _sqlite3_os_init ??= + return (_sqlite3_os_init ??= _dylib.lookupFunction<_c_sqlite3_os_init, _dart_sqlite3_os_init>( - 'sqlite3_os_init'); - return _sqlite3_os_init(); + 'sqlite3_os_init'))(); } - _dart_sqlite3_os_init _sqlite3_os_init; + _dart_sqlite3_os_init? _sqlite3_os_init; int sqlite3_os_end() { - _sqlite3_os_end ??= + return (_sqlite3_os_end ??= _dylib.lookupFunction<_c_sqlite3_os_end, _dart_sqlite3_os_end>( - 'sqlite3_os_end'); - return _sqlite3_os_end(); + 'sqlite3_os_end'))(); } - _dart_sqlite3_os_end _sqlite3_os_end; + _dart_sqlite3_os_end? _sqlite3_os_end; /// CAPI3REF: Configuring The SQLite Library /// @@ -389,15 +377,14 @@ class SQLite { int sqlite3_config( int arg0, ) { - _sqlite3_config ??= + return (_sqlite3_config ??= _dylib.lookupFunction<_c_sqlite3_config, _dart_sqlite3_config>( - 'sqlite3_config'); - return _sqlite3_config( + 'sqlite3_config'))( arg0, ); } - _dart_sqlite3_config _sqlite3_config; + _dart_sqlite3_config? _sqlite3_config; /// CAPI3REF: Configure database connections /// METHOD: sqlite3 @@ -418,16 +405,15 @@ class SQLite { ffi.Pointer arg0, int op, ) { - _sqlite3_db_config ??= + return (_sqlite3_db_config ??= _dylib.lookupFunction<_c_sqlite3_db_config, _dart_sqlite3_db_config>( - 'sqlite3_db_config'); - return _sqlite3_db_config( + 'sqlite3_db_config'))( arg0, op, ); } - _dart_sqlite3_db_config _sqlite3_db_config; + _dart_sqlite3_db_config? _sqlite3_db_config; /// CAPI3REF: Enable Or Disable Extended Result Codes /// METHOD: sqlite3 @@ -439,16 +425,15 @@ class SQLite { ffi.Pointer arg0, int onoff, ) { - _sqlite3_extended_result_codes ??= _dylib.lookupFunction< + return (_sqlite3_extended_result_codes ??= _dylib.lookupFunction< _c_sqlite3_extended_result_codes, - _dart_sqlite3_extended_result_codes>('sqlite3_extended_result_codes'); - return _sqlite3_extended_result_codes( + _dart_sqlite3_extended_result_codes>('sqlite3_extended_result_codes'))( arg0, onoff, ); } - _dart_sqlite3_extended_result_codes _sqlite3_extended_result_codes; + _dart_sqlite3_extended_result_codes? _sqlite3_extended_result_codes; /// CAPI3REF: Last Insert Rowid /// METHOD: sqlite3 @@ -511,15 +496,14 @@ class SQLite { int sqlite3_last_insert_rowid( ffi.Pointer arg0, ) { - _sqlite3_last_insert_rowid ??= _dylib.lookupFunction< + return (_sqlite3_last_insert_rowid ??= _dylib.lookupFunction< _c_sqlite3_last_insert_rowid, - _dart_sqlite3_last_insert_rowid>('sqlite3_last_insert_rowid'); - return _sqlite3_last_insert_rowid( + _dart_sqlite3_last_insert_rowid>('sqlite3_last_insert_rowid'))( arg0, ); } - _dart_sqlite3_last_insert_rowid _sqlite3_last_insert_rowid; + _dart_sqlite3_last_insert_rowid? _sqlite3_last_insert_rowid; /// CAPI3REF: Set the Last Insert Rowid value. /// METHOD: sqlite3 @@ -531,16 +515,15 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - _sqlite3_set_last_insert_rowid ??= _dylib.lookupFunction< + return (_sqlite3_set_last_insert_rowid ??= _dylib.lookupFunction< _c_sqlite3_set_last_insert_rowid, - _dart_sqlite3_set_last_insert_rowid>('sqlite3_set_last_insert_rowid'); - return _sqlite3_set_last_insert_rowid( + _dart_sqlite3_set_last_insert_rowid>('sqlite3_set_last_insert_rowid'))( arg0, arg1, ); } - _dart_sqlite3_set_last_insert_rowid _sqlite3_set_last_insert_rowid; + _dart_sqlite3_set_last_insert_rowid? _sqlite3_set_last_insert_rowid; /// CAPI3REF: Count The Number Of Rows Modified /// METHOD: sqlite3 @@ -599,15 +582,14 @@ class SQLite { int sqlite3_changes( ffi.Pointer arg0, ) { - _sqlite3_changes ??= + return (_sqlite3_changes ??= _dylib.lookupFunction<_c_sqlite3_changes, _dart_sqlite3_changes>( - 'sqlite3_changes'); - return _sqlite3_changes( + 'sqlite3_changes'))( arg0, ); } - _dart_sqlite3_changes _sqlite3_changes; + _dart_sqlite3_changes? _sqlite3_changes; /// CAPI3REF: Total Number Of Rows Modified /// METHOD: sqlite3 @@ -645,14 +627,14 @@ class SQLite { int sqlite3_total_changes( ffi.Pointer arg0, ) { - _sqlite3_total_changes ??= _dylib.lookupFunction<_c_sqlite3_total_changes, - _dart_sqlite3_total_changes>('sqlite3_total_changes'); - return _sqlite3_total_changes( + return (_sqlite3_total_changes ??= _dylib.lookupFunction< + _c_sqlite3_total_changes, + _dart_sqlite3_total_changes>('sqlite3_total_changes'))( arg0, ); } - _dart_sqlite3_total_changes _sqlite3_total_changes; + _dart_sqlite3_total_changes? _sqlite3_total_changes; /// CAPI3REF: Interrupt A Long-Running Query /// METHOD: sqlite3 @@ -690,15 +672,14 @@ class SQLite { void sqlite3_interrupt( ffi.Pointer arg0, ) { - _sqlite3_interrupt ??= + return (_sqlite3_interrupt ??= _dylib.lookupFunction<_c_sqlite3_interrupt, _dart_sqlite3_interrupt>( - 'sqlite3_interrupt'); - return _sqlite3_interrupt( + 'sqlite3_interrupt'))( arg0, ); } - _dart_sqlite3_interrupt _sqlite3_interrupt; + _dart_sqlite3_interrupt? _sqlite3_interrupt; /// CAPI3REF: Determine If An SQL Statement Is Complete /// @@ -734,28 +715,26 @@ class SQLite { int sqlite3_complete( ffi.Pointer sql, ) { - _sqlite3_complete ??= + return (_sqlite3_complete ??= _dylib.lookupFunction<_c_sqlite3_complete, _dart_sqlite3_complete>( - 'sqlite3_complete'); - return _sqlite3_complete( + 'sqlite3_complete'))( sql, ); } - _dart_sqlite3_complete _sqlite3_complete; + _dart_sqlite3_complete? _sqlite3_complete; int sqlite3_complete16( ffi.Pointer sql, ) { - _sqlite3_complete16 ??= + return (_sqlite3_complete16 ??= _dylib.lookupFunction<_c_sqlite3_complete16, _dart_sqlite3_complete16>( - 'sqlite3_complete16'); - return _sqlite3_complete16( + 'sqlite3_complete16'))( sql, ); } - _dart_sqlite3_complete16 _sqlite3_complete16; + _dart_sqlite3_complete16? _sqlite3_complete16; /// CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors /// KEYWORDS: {busy-handler callback} {busy handler} @@ -819,16 +798,16 @@ class SQLite { ffi.Pointer> arg1, ffi.Pointer arg2, ) { - _sqlite3_busy_handler ??= _dylib.lookupFunction<_c_sqlite3_busy_handler, - _dart_sqlite3_busy_handler>('sqlite3_busy_handler'); - return _sqlite3_busy_handler( + return (_sqlite3_busy_handler ??= _dylib.lookupFunction< + _c_sqlite3_busy_handler, + _dart_sqlite3_busy_handler>('sqlite3_busy_handler'))( arg0, arg1, arg2, ); } - _dart_sqlite3_busy_handler _sqlite3_busy_handler; + _dart_sqlite3_busy_handler? _sqlite3_busy_handler; /// CAPI3REF: Set A Busy Timeout /// METHOD: sqlite3 @@ -853,15 +832,15 @@ class SQLite { ffi.Pointer arg0, int ms, ) { - _sqlite3_busy_timeout ??= _dylib.lookupFunction<_c_sqlite3_busy_timeout, - _dart_sqlite3_busy_timeout>('sqlite3_busy_timeout'); - return _sqlite3_busy_timeout( + return (_sqlite3_busy_timeout ??= _dylib.lookupFunction< + _c_sqlite3_busy_timeout, + _dart_sqlite3_busy_timeout>('sqlite3_busy_timeout'))( arg0, ms, ); } - _dart_sqlite3_busy_timeout _sqlite3_busy_timeout; + _dart_sqlite3_busy_timeout? _sqlite3_busy_timeout; /// CAPI3REF: Convenience Routines For Running Queries /// METHOD: sqlite3 @@ -942,10 +921,9 @@ class SQLite { ffi.Pointer pnColumn, ffi.Pointer> pzErrmsg, ) { - _sqlite3_get_table ??= + return (_sqlite3_get_table ??= _dylib.lookupFunction<_c_sqlite3_get_table, _dart_sqlite3_get_table>( - 'sqlite3_get_table'); - return _sqlite3_get_table( + 'sqlite3_get_table'))( db, zSql, pazResult, @@ -955,20 +933,19 @@ class SQLite { ); } - _dart_sqlite3_get_table _sqlite3_get_table; + _dart_sqlite3_get_table? _sqlite3_get_table; void sqlite3_free_table( ffi.Pointer> result, ) { - _sqlite3_free_table ??= + return (_sqlite3_free_table ??= _dylib.lookupFunction<_c_sqlite3_free_table, _dart_sqlite3_free_table>( - 'sqlite3_free_table'); - return _sqlite3_free_table( + 'sqlite3_free_table'))( result, ); } - _dart_sqlite3_free_table _sqlite3_free_table; + _dart_sqlite3_free_table? _sqlite3_free_table; /// CAPI3REF: Formatted String Printing Functions /// @@ -1011,32 +988,30 @@ class SQLite { ffi.Pointer sqlite3_mprintf( ffi.Pointer arg0, ) { - _sqlite3_mprintf ??= + return (_sqlite3_mprintf ??= _dylib.lookupFunction<_c_sqlite3_mprintf, _dart_sqlite3_mprintf>( - 'sqlite3_mprintf'); - return _sqlite3_mprintf( + 'sqlite3_mprintf'))( arg0, ); } - _dart_sqlite3_mprintf _sqlite3_mprintf; + _dart_sqlite3_mprintf? _sqlite3_mprintf; ffi.Pointer sqlite3_snprintf( int arg0, ffi.Pointer arg1, ffi.Pointer arg2, ) { - _sqlite3_snprintf ??= + return (_sqlite3_snprintf ??= _dylib.lookupFunction<_c_sqlite3_snprintf, _dart_sqlite3_snprintf>( - 'sqlite3_snprintf'); - return _sqlite3_snprintf( + 'sqlite3_snprintf'))( arg0, arg1, arg2, ); } - _dart_sqlite3_snprintf _sqlite3_snprintf; + _dart_sqlite3_snprintf? _sqlite3_snprintf; /// CAPI3REF: Memory Allocation Subsystem /// @@ -1114,82 +1089,77 @@ class SQLite { ffi.Pointer sqlite3_malloc( int arg0, ) { - _sqlite3_malloc ??= + return (_sqlite3_malloc ??= _dylib.lookupFunction<_c_sqlite3_malloc, _dart_sqlite3_malloc>( - 'sqlite3_malloc'); - return _sqlite3_malloc( + 'sqlite3_malloc'))( arg0, ); } - _dart_sqlite3_malloc _sqlite3_malloc; + _dart_sqlite3_malloc? _sqlite3_malloc; ffi.Pointer sqlite3_malloc64( int arg0, ) { - _sqlite3_malloc64 ??= + return (_sqlite3_malloc64 ??= _dylib.lookupFunction<_c_sqlite3_malloc64, _dart_sqlite3_malloc64>( - 'sqlite3_malloc64'); - return _sqlite3_malloc64( + 'sqlite3_malloc64'))( arg0, ); } - _dart_sqlite3_malloc64 _sqlite3_malloc64; + _dart_sqlite3_malloc64? _sqlite3_malloc64; ffi.Pointer sqlite3_realloc( ffi.Pointer arg0, int arg1, ) { - _sqlite3_realloc ??= + return (_sqlite3_realloc ??= _dylib.lookupFunction<_c_sqlite3_realloc, _dart_sqlite3_realloc>( - 'sqlite3_realloc'); - return _sqlite3_realloc( + 'sqlite3_realloc'))( arg0, arg1, ); } - _dart_sqlite3_realloc _sqlite3_realloc; + _dart_sqlite3_realloc? _sqlite3_realloc; ffi.Pointer sqlite3_realloc64( ffi.Pointer arg0, int arg1, ) { - _sqlite3_realloc64 ??= + return (_sqlite3_realloc64 ??= _dylib.lookupFunction<_c_sqlite3_realloc64, _dart_sqlite3_realloc64>( - 'sqlite3_realloc64'); - return _sqlite3_realloc64( + 'sqlite3_realloc64'))( arg0, arg1, ); } - _dart_sqlite3_realloc64 _sqlite3_realloc64; + _dart_sqlite3_realloc64? _sqlite3_realloc64; void sqlite3_free( ffi.Pointer arg0, ) { - _sqlite3_free ??= _dylib - .lookupFunction<_c_sqlite3_free, _dart_sqlite3_free>('sqlite3_free'); - return _sqlite3_free( + return (_sqlite3_free ??= _dylib + .lookupFunction<_c_sqlite3_free, _dart_sqlite3_free>('sqlite3_free'))( arg0, ); } - _dart_sqlite3_free _sqlite3_free; + _dart_sqlite3_free? _sqlite3_free; int sqlite3_msize( ffi.Pointer arg0, ) { - _sqlite3_msize ??= _dylib - .lookupFunction<_c_sqlite3_msize, _dart_sqlite3_msize>('sqlite3_msize'); - return _sqlite3_msize( + return (_sqlite3_msize ??= + _dylib.lookupFunction<_c_sqlite3_msize, _dart_sqlite3_msize>( + 'sqlite3_msize'))( arg0, ); } - _dart_sqlite3_msize _sqlite3_msize; + _dart_sqlite3_msize? _sqlite3_msize; /// CAPI3REF: Memory Allocator Statistics /// @@ -1213,25 +1183,24 @@ class SQLite { /// by [sqlite3_memory_highwater(1)] is the high-water mark /// prior to the reset. int sqlite3_memory_used() { - _sqlite3_memory_used ??= _dylib.lookupFunction<_c_sqlite3_memory_used, - _dart_sqlite3_memory_used>('sqlite3_memory_used'); - return _sqlite3_memory_used(); + return (_sqlite3_memory_used ??= _dylib.lookupFunction< + _c_sqlite3_memory_used, + _dart_sqlite3_memory_used>('sqlite3_memory_used'))(); } - _dart_sqlite3_memory_used _sqlite3_memory_used; + _dart_sqlite3_memory_used? _sqlite3_memory_used; int sqlite3_memory_highwater( int resetFlag, ) { - _sqlite3_memory_highwater ??= _dylib.lookupFunction< + return (_sqlite3_memory_highwater ??= _dylib.lookupFunction< _c_sqlite3_memory_highwater, - _dart_sqlite3_memory_highwater>('sqlite3_memory_highwater'); - return _sqlite3_memory_highwater( + _dart_sqlite3_memory_highwater>('sqlite3_memory_highwater'))( resetFlag, ); } - _dart_sqlite3_memory_highwater _sqlite3_memory_highwater; + _dart_sqlite3_memory_highwater? _sqlite3_memory_highwater; /// CAPI3REF: Pseudo-Random Number Generator /// @@ -1256,16 +1225,15 @@ class SQLite { int N, ffi.Pointer P, ) { - _sqlite3_randomness ??= + return (_sqlite3_randomness ??= _dylib.lookupFunction<_c_sqlite3_randomness, _dart_sqlite3_randomness>( - 'sqlite3_randomness'); - return _sqlite3_randomness( + 'sqlite3_randomness'))( N, P, ); } - _dart_sqlite3_randomness _sqlite3_randomness; + _dart_sqlite3_randomness? _sqlite3_randomness; /// CAPI3REF: Compile-Time Authorization Callbacks /// METHOD: sqlite3 @@ -1359,16 +1327,16 @@ class SQLite { ffi.Pointer> xAuth, ffi.Pointer pUserData, ) { - _sqlite3_set_authorizer ??= _dylib.lookupFunction<_c_sqlite3_set_authorizer, - _dart_sqlite3_set_authorizer>('sqlite3_set_authorizer'); - return _sqlite3_set_authorizer( + return (_sqlite3_set_authorizer ??= _dylib.lookupFunction< + _c_sqlite3_set_authorizer, + _dart_sqlite3_set_authorizer>('sqlite3_set_authorizer'))( arg0, xAuth, pUserData, ); } - _dart_sqlite3_set_authorizer _sqlite3_set_authorizer; + _dart_sqlite3_set_authorizer? _sqlite3_set_authorizer; /// CAPI3REF: Tracing And Profiling Functions /// METHOD: sqlite3 @@ -1405,33 +1373,32 @@ class SQLite { ffi.Pointer> xTrace, ffi.Pointer arg2, ) { - _sqlite3_trace ??= _dylib - .lookupFunction<_c_sqlite3_trace, _dart_sqlite3_trace>('sqlite3_trace'); - return _sqlite3_trace( + return (_sqlite3_trace ??= + _dylib.lookupFunction<_c_sqlite3_trace, _dart_sqlite3_trace>( + 'sqlite3_trace'))( arg0, xTrace, arg2, ); } - _dart_sqlite3_trace _sqlite3_trace; + _dart_sqlite3_trace? _sqlite3_trace; ffi.Pointer sqlite3_profile( ffi.Pointer arg0, ffi.Pointer> xProfile, ffi.Pointer arg2, ) { - _sqlite3_profile ??= + return (_sqlite3_profile ??= _dylib.lookupFunction<_c_sqlite3_profile, _dart_sqlite3_profile>( - 'sqlite3_profile'); - return _sqlite3_profile( + 'sqlite3_profile'))( arg0, xProfile, arg2, ); } - _dart_sqlite3_profile _sqlite3_profile; + _dart_sqlite3_profile? _sqlite3_profile; /// CAPI3REF: SQL Trace Hook /// METHOD: sqlite3 @@ -1466,10 +1433,9 @@ class SQLite { ffi.Pointer> xCallback, ffi.Pointer pCtx, ) { - _sqlite3_trace_v2 ??= + return (_sqlite3_trace_v2 ??= _dylib.lookupFunction<_c_sqlite3_trace_v2, _dart_sqlite3_trace_v2>( - 'sqlite3_trace_v2'); - return _sqlite3_trace_v2( + 'sqlite3_trace_v2'))( arg0, uMask, xCallback, @@ -1477,7 +1443,7 @@ class SQLite { ); } - _dart_sqlite3_trace_v2 _sqlite3_trace_v2; + _dart_sqlite3_trace_v2? _sqlite3_trace_v2; /// CAPI3REF: Query Progress Callbacks /// METHOD: sqlite3 @@ -1514,10 +1480,9 @@ class SQLite { ffi.Pointer> arg2, ffi.Pointer arg3, ) { - _sqlite3_progress_handler ??= _dylib.lookupFunction< + return (_sqlite3_progress_handler ??= _dylib.lookupFunction< _c_sqlite3_progress_handler, - _dart_sqlite3_progress_handler>('sqlite3_progress_handler'); - return _sqlite3_progress_handler( + _dart_sqlite3_progress_handler>('sqlite3_progress_handler'))( arg0, arg1, arg2, @@ -1525,7 +1490,7 @@ class SQLite { ); } - _dart_sqlite3_progress_handler _sqlite3_progress_handler; + _dart_sqlite3_progress_handler? _sqlite3_progress_handler; /// CAPI3REF: Opening A New Database Connection /// CONSTRUCTOR: sqlite3 @@ -1782,30 +1747,28 @@ class SQLite { ffi.Pointer filename, ffi.Pointer> ppDb, ) { - _sqlite3_open ??= _dylib - .lookupFunction<_c_sqlite3_open, _dart_sqlite3_open>('sqlite3_open'); - return _sqlite3_open( + return (_sqlite3_open ??= _dylib + .lookupFunction<_c_sqlite3_open, _dart_sqlite3_open>('sqlite3_open'))( filename, ppDb, ); } - _dart_sqlite3_open _sqlite3_open; + _dart_sqlite3_open? _sqlite3_open; int sqlite3_open16( ffi.Pointer filename, ffi.Pointer> ppDb, ) { - _sqlite3_open16 ??= + return (_sqlite3_open16 ??= _dylib.lookupFunction<_c_sqlite3_open16, _dart_sqlite3_open16>( - 'sqlite3_open16'); - return _sqlite3_open16( + 'sqlite3_open16'))( filename, ppDb, ); } - _dart_sqlite3_open16 _sqlite3_open16; + _dart_sqlite3_open16? _sqlite3_open16; int sqlite3_open_v2( ffi.Pointer filename, @@ -1813,10 +1776,9 @@ class SQLite { int flags, ffi.Pointer zVfs, ) { - _sqlite3_open_v2 ??= + return (_sqlite3_open_v2 ??= _dylib.lookupFunction<_c_sqlite3_open_v2, _dart_sqlite3_open_v2>( - 'sqlite3_open_v2'); - return _sqlite3_open_v2( + 'sqlite3_open_v2'))( filename, ppDb, flags, @@ -1824,7 +1786,7 @@ class SQLite { ); } - _dart_sqlite3_open_v2 _sqlite3_open_v2; + _dart_sqlite3_open_v2? _sqlite3_open_v2; /// CAPI3REF: Obtain Values For URI Parameters /// @@ -1894,63 +1856,61 @@ class SQLite { ffi.Pointer zFilename, ffi.Pointer zParam, ) { - _sqlite3_uri_parameter ??= _dylib.lookupFunction<_c_sqlite3_uri_parameter, - _dart_sqlite3_uri_parameter>('sqlite3_uri_parameter'); - return _sqlite3_uri_parameter( + return (_sqlite3_uri_parameter ??= _dylib.lookupFunction< + _c_sqlite3_uri_parameter, + _dart_sqlite3_uri_parameter>('sqlite3_uri_parameter'))( zFilename, zParam, ); } - _dart_sqlite3_uri_parameter _sqlite3_uri_parameter; + _dart_sqlite3_uri_parameter? _sqlite3_uri_parameter; int sqlite3_uri_boolean( ffi.Pointer zFile, ffi.Pointer zParam, int bDefault, ) { - _sqlite3_uri_boolean ??= _dylib.lookupFunction<_c_sqlite3_uri_boolean, - _dart_sqlite3_uri_boolean>('sqlite3_uri_boolean'); - return _sqlite3_uri_boolean( + return (_sqlite3_uri_boolean ??= _dylib.lookupFunction< + _c_sqlite3_uri_boolean, + _dart_sqlite3_uri_boolean>('sqlite3_uri_boolean'))( zFile, zParam, bDefault, ); } - _dart_sqlite3_uri_boolean _sqlite3_uri_boolean; + _dart_sqlite3_uri_boolean? _sqlite3_uri_boolean; int sqlite3_uri_int64( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, ) { - _sqlite3_uri_int64 ??= + return (_sqlite3_uri_int64 ??= _dylib.lookupFunction<_c_sqlite3_uri_int64, _dart_sqlite3_uri_int64>( - 'sqlite3_uri_int64'); - return _sqlite3_uri_int64( + 'sqlite3_uri_int64'))( arg0, arg1, arg2, ); } - _dart_sqlite3_uri_int64 _sqlite3_uri_int64; + _dart_sqlite3_uri_int64? _sqlite3_uri_int64; ffi.Pointer sqlite3_uri_key( ffi.Pointer zFilename, int N, ) { - _sqlite3_uri_key ??= + return (_sqlite3_uri_key ??= _dylib.lookupFunction<_c_sqlite3_uri_key, _dart_sqlite3_uri_key>( - 'sqlite3_uri_key'); - return _sqlite3_uri_key( + 'sqlite3_uri_key'))( zFilename, N, ); } - _dart_sqlite3_uri_key _sqlite3_uri_key; + _dart_sqlite3_uri_key? _sqlite3_uri_key; /// CAPI3REF: Translate filenames /// @@ -1980,40 +1940,38 @@ class SQLite { ffi.Pointer sqlite3_filename_database( ffi.Pointer arg0, ) { - _sqlite3_filename_database ??= _dylib.lookupFunction< + return (_sqlite3_filename_database ??= _dylib.lookupFunction< _c_sqlite3_filename_database, - _dart_sqlite3_filename_database>('sqlite3_filename_database'); - return _sqlite3_filename_database( + _dart_sqlite3_filename_database>('sqlite3_filename_database'))( arg0, ); } - _dart_sqlite3_filename_database _sqlite3_filename_database; + _dart_sqlite3_filename_database? _sqlite3_filename_database; ffi.Pointer sqlite3_filename_journal( ffi.Pointer arg0, ) { - _sqlite3_filename_journal ??= _dylib.lookupFunction< + return (_sqlite3_filename_journal ??= _dylib.lookupFunction< _c_sqlite3_filename_journal, - _dart_sqlite3_filename_journal>('sqlite3_filename_journal'); - return _sqlite3_filename_journal( + _dart_sqlite3_filename_journal>('sqlite3_filename_journal'))( arg0, ); } - _dart_sqlite3_filename_journal _sqlite3_filename_journal; + _dart_sqlite3_filename_journal? _sqlite3_filename_journal; ffi.Pointer sqlite3_filename_wal( ffi.Pointer arg0, ) { - _sqlite3_filename_wal ??= _dylib.lookupFunction<_c_sqlite3_filename_wal, - _dart_sqlite3_filename_wal>('sqlite3_filename_wal'); - return _sqlite3_filename_wal( + return (_sqlite3_filename_wal ??= _dylib.lookupFunction< + _c_sqlite3_filename_wal, + _dart_sqlite3_filename_wal>('sqlite3_filename_wal'))( arg0, ); } - _dart_sqlite3_filename_wal _sqlite3_filename_wal; + _dart_sqlite3_filename_wal? _sqlite3_filename_wal; /// CAPI3REF: Database File Corresponding To A Journal /// @@ -2033,15 +1991,14 @@ class SQLite { ffi.Pointer sqlite3_database_file_object( ffi.Pointer arg0, ) { - _sqlite3_database_file_object ??= _dylib.lookupFunction< + return (_sqlite3_database_file_object ??= _dylib.lookupFunction< _c_sqlite3_database_file_object, - _dart_sqlite3_database_file_object>('sqlite3_database_file_object'); - return _sqlite3_database_file_object( + _dart_sqlite3_database_file_object>('sqlite3_database_file_object'))( arg0, ); } - _dart_sqlite3_database_file_object _sqlite3_database_file_object; + _dart_sqlite3_database_file_object? _sqlite3_database_file_object; /// CAPI3REF: Create and Destroy VFS Filenames /// @@ -2093,10 +2050,9 @@ class SQLite { int nParam, ffi.Pointer> azParam, ) { - _sqlite3_create_filename ??= _dylib.lookupFunction< + return (_sqlite3_create_filename ??= _dylib.lookupFunction< _c_sqlite3_create_filename, - _dart_sqlite3_create_filename>('sqlite3_create_filename'); - return _sqlite3_create_filename( + _dart_sqlite3_create_filename>('sqlite3_create_filename'))( zDatabase, zJournal, zWal, @@ -2105,19 +2061,19 @@ class SQLite { ); } - _dart_sqlite3_create_filename _sqlite3_create_filename; + _dart_sqlite3_create_filename? _sqlite3_create_filename; void sqlite3_free_filename( ffi.Pointer arg0, ) { - _sqlite3_free_filename ??= _dylib.lookupFunction<_c_sqlite3_free_filename, - _dart_sqlite3_free_filename>('sqlite3_free_filename'); - return _sqlite3_free_filename( + return (_sqlite3_free_filename ??= _dylib.lookupFunction< + _c_sqlite3_free_filename, + _dart_sqlite3_free_filename>('sqlite3_free_filename'))( arg0, ); } - _dart_sqlite3_free_filename _sqlite3_free_filename; + _dart_sqlite3_free_filename? _sqlite3_free_filename; /// CAPI3REF: Error Codes And Messages /// METHOD: sqlite3 @@ -2172,67 +2128,62 @@ class SQLite { int sqlite3_errcode( ffi.Pointer db, ) { - _sqlite3_errcode ??= + return (_sqlite3_errcode ??= _dylib.lookupFunction<_c_sqlite3_errcode, _dart_sqlite3_errcode>( - 'sqlite3_errcode'); - return _sqlite3_errcode( + 'sqlite3_errcode'))( db, ); } - _dart_sqlite3_errcode _sqlite3_errcode; + _dart_sqlite3_errcode? _sqlite3_errcode; int sqlite3_extended_errcode( ffi.Pointer db, ) { - _sqlite3_extended_errcode ??= _dylib.lookupFunction< + return (_sqlite3_extended_errcode ??= _dylib.lookupFunction< _c_sqlite3_extended_errcode, - _dart_sqlite3_extended_errcode>('sqlite3_extended_errcode'); - return _sqlite3_extended_errcode( + _dart_sqlite3_extended_errcode>('sqlite3_extended_errcode'))( db, ); } - _dart_sqlite3_extended_errcode _sqlite3_extended_errcode; + _dart_sqlite3_extended_errcode? _sqlite3_extended_errcode; ffi.Pointer sqlite3_errmsg( ffi.Pointer arg0, ) { - _sqlite3_errmsg ??= + return (_sqlite3_errmsg ??= _dylib.lookupFunction<_c_sqlite3_errmsg, _dart_sqlite3_errmsg>( - 'sqlite3_errmsg'); - return _sqlite3_errmsg( + 'sqlite3_errmsg'))( arg0, ); } - _dart_sqlite3_errmsg _sqlite3_errmsg; + _dart_sqlite3_errmsg? _sqlite3_errmsg; ffi.Pointer sqlite3_errmsg16( ffi.Pointer arg0, ) { - _sqlite3_errmsg16 ??= + return (_sqlite3_errmsg16 ??= _dylib.lookupFunction<_c_sqlite3_errmsg16, _dart_sqlite3_errmsg16>( - 'sqlite3_errmsg16'); - return _sqlite3_errmsg16( + 'sqlite3_errmsg16'))( arg0, ); } - _dart_sqlite3_errmsg16 _sqlite3_errmsg16; + _dart_sqlite3_errmsg16? _sqlite3_errmsg16; ffi.Pointer sqlite3_errstr( int arg0, ) { - _sqlite3_errstr ??= + return (_sqlite3_errstr ??= _dylib.lookupFunction<_c_sqlite3_errstr, _dart_sqlite3_errstr>( - 'sqlite3_errstr'); - return _sqlite3_errstr( + 'sqlite3_errstr'))( arg0, ); } - _dart_sqlite3_errstr _sqlite3_errstr; + _dart_sqlite3_errstr? _sqlite3_errstr; /// CAPI3REF: Run-time Limits /// METHOD: sqlite3 @@ -2277,16 +2228,16 @@ class SQLite { int id, int newVal, ) { - _sqlite3_limit ??= _dylib - .lookupFunction<_c_sqlite3_limit, _dart_sqlite3_limit>('sqlite3_limit'); - return _sqlite3_limit( + return (_sqlite3_limit ??= + _dylib.lookupFunction<_c_sqlite3_limit, _dart_sqlite3_limit>( + 'sqlite3_limit'))( arg0, id, newVal, ); } - _dart_sqlite3_limit _sqlite3_limit; + _dart_sqlite3_limit? _sqlite3_limit; /// CAPI3REF: Compiling An SQL Statement /// KEYWORDS: {SQL statement compiler} @@ -2393,10 +2344,9 @@ class SQLite { ffi.Pointer> ppStmt, ffi.Pointer> pzTail, ) { - _sqlite3_prepare ??= + return (_sqlite3_prepare ??= _dylib.lookupFunction<_c_sqlite3_prepare, _dart_sqlite3_prepare>( - 'sqlite3_prepare'); - return _sqlite3_prepare( + 'sqlite3_prepare'))( db, zSql, nByte, @@ -2405,7 +2355,7 @@ class SQLite { ); } - _dart_sqlite3_prepare _sqlite3_prepare; + _dart_sqlite3_prepare? _sqlite3_prepare; int sqlite3_prepare_v2( ffi.Pointer db, @@ -2414,10 +2364,9 @@ class SQLite { ffi.Pointer> ppStmt, ffi.Pointer> pzTail, ) { - _sqlite3_prepare_v2 ??= + return (_sqlite3_prepare_v2 ??= _dylib.lookupFunction<_c_sqlite3_prepare_v2, _dart_sqlite3_prepare_v2>( - 'sqlite3_prepare_v2'); - return _sqlite3_prepare_v2( + 'sqlite3_prepare_v2'))( db, zSql, nByte, @@ -2426,7 +2375,7 @@ class SQLite { ); } - _dart_sqlite3_prepare_v2 _sqlite3_prepare_v2; + _dart_sqlite3_prepare_v2? _sqlite3_prepare_v2; int sqlite3_prepare_v3( ffi.Pointer db, @@ -2436,10 +2385,9 @@ class SQLite { ffi.Pointer> ppStmt, ffi.Pointer> pzTail, ) { - _sqlite3_prepare_v3 ??= + return (_sqlite3_prepare_v3 ??= _dylib.lookupFunction<_c_sqlite3_prepare_v3, _dart_sqlite3_prepare_v3>( - 'sqlite3_prepare_v3'); - return _sqlite3_prepare_v3( + 'sqlite3_prepare_v3'))( db, zSql, nByte, @@ -2449,7 +2397,7 @@ class SQLite { ); } - _dart_sqlite3_prepare_v3 _sqlite3_prepare_v3; + _dart_sqlite3_prepare_v3? _sqlite3_prepare_v3; int sqlite3_prepare16( ffi.Pointer db, @@ -2458,10 +2406,9 @@ class SQLite { ffi.Pointer> ppStmt, ffi.Pointer> pzTail, ) { - _sqlite3_prepare16 ??= + return (_sqlite3_prepare16 ??= _dylib.lookupFunction<_c_sqlite3_prepare16, _dart_sqlite3_prepare16>( - 'sqlite3_prepare16'); - return _sqlite3_prepare16( + 'sqlite3_prepare16'))( db, zSql, nByte, @@ -2470,7 +2417,7 @@ class SQLite { ); } - _dart_sqlite3_prepare16 _sqlite3_prepare16; + _dart_sqlite3_prepare16? _sqlite3_prepare16; int sqlite3_prepare16_v2( ffi.Pointer db, @@ -2479,9 +2426,9 @@ class SQLite { ffi.Pointer> ppStmt, ffi.Pointer> pzTail, ) { - _sqlite3_prepare16_v2 ??= _dylib.lookupFunction<_c_sqlite3_prepare16_v2, - _dart_sqlite3_prepare16_v2>('sqlite3_prepare16_v2'); - return _sqlite3_prepare16_v2( + return (_sqlite3_prepare16_v2 ??= _dylib.lookupFunction< + _c_sqlite3_prepare16_v2, + _dart_sqlite3_prepare16_v2>('sqlite3_prepare16_v2'))( db, zSql, nByte, @@ -2490,7 +2437,7 @@ class SQLite { ); } - _dart_sqlite3_prepare16_v2 _sqlite3_prepare16_v2; + _dart_sqlite3_prepare16_v2? _sqlite3_prepare16_v2; int sqlite3_prepare16_v3( ffi.Pointer db, @@ -2500,9 +2447,9 @@ class SQLite { ffi.Pointer> ppStmt, ffi.Pointer> pzTail, ) { - _sqlite3_prepare16_v3 ??= _dylib.lookupFunction<_c_sqlite3_prepare16_v3, - _dart_sqlite3_prepare16_v3>('sqlite3_prepare16_v3'); - return _sqlite3_prepare16_v3( + return (_sqlite3_prepare16_v3 ??= _dylib.lookupFunction< + _c_sqlite3_prepare16_v3, + _dart_sqlite3_prepare16_v3>('sqlite3_prepare16_v3'))( db, zSql, nByte, @@ -2512,7 +2459,7 @@ class SQLite { ); } - _dart_sqlite3_prepare16_v3 _sqlite3_prepare16_v3; + _dart_sqlite3_prepare16_v3? _sqlite3_prepare16_v3; /// CAPI3REF: Retrieving Statement SQL /// METHOD: sqlite3_stmt @@ -2553,38 +2500,37 @@ class SQLite { ffi.Pointer sqlite3_sql( ffi.Pointer pStmt, ) { - _sqlite3_sql ??= - _dylib.lookupFunction<_c_sqlite3_sql, _dart_sqlite3_sql>('sqlite3_sql'); - return _sqlite3_sql( + return (_sqlite3_sql ??= _dylib + .lookupFunction<_c_sqlite3_sql, _dart_sqlite3_sql>('sqlite3_sql'))( pStmt, ); } - _dart_sqlite3_sql _sqlite3_sql; + _dart_sqlite3_sql? _sqlite3_sql; ffi.Pointer sqlite3_expanded_sql( ffi.Pointer pStmt, ) { - _sqlite3_expanded_sql ??= _dylib.lookupFunction<_c_sqlite3_expanded_sql, - _dart_sqlite3_expanded_sql>('sqlite3_expanded_sql'); - return _sqlite3_expanded_sql( + return (_sqlite3_expanded_sql ??= _dylib.lookupFunction< + _c_sqlite3_expanded_sql, + _dart_sqlite3_expanded_sql>('sqlite3_expanded_sql'))( pStmt, ); } - _dart_sqlite3_expanded_sql _sqlite3_expanded_sql; + _dart_sqlite3_expanded_sql? _sqlite3_expanded_sql; ffi.Pointer sqlite3_normalized_sql( ffi.Pointer pStmt, ) { - _sqlite3_normalized_sql ??= _dylib.lookupFunction<_c_sqlite3_normalized_sql, - _dart_sqlite3_normalized_sql>('sqlite3_normalized_sql'); - return _sqlite3_normalized_sql( + return (_sqlite3_normalized_sql ??= _dylib.lookupFunction< + _c_sqlite3_normalized_sql, + _dart_sqlite3_normalized_sql>('sqlite3_normalized_sql'))( pStmt, ); } - _dart_sqlite3_normalized_sql _sqlite3_normalized_sql; + _dart_sqlite3_normalized_sql? _sqlite3_normalized_sql; /// CAPI3REF: Determine If An SQL Statement Writes The Database /// METHOD: sqlite3_stmt @@ -2621,14 +2567,14 @@ class SQLite { int sqlite3_stmt_readonly( ffi.Pointer pStmt, ) { - _sqlite3_stmt_readonly ??= _dylib.lookupFunction<_c_sqlite3_stmt_readonly, - _dart_sqlite3_stmt_readonly>('sqlite3_stmt_readonly'); - return _sqlite3_stmt_readonly( + return (_sqlite3_stmt_readonly ??= _dylib.lookupFunction< + _c_sqlite3_stmt_readonly, + _dart_sqlite3_stmt_readonly>('sqlite3_stmt_readonly'))( pStmt, ); } - _dart_sqlite3_stmt_readonly _sqlite3_stmt_readonly; + _dart_sqlite3_stmt_readonly? _sqlite3_stmt_readonly; /// CAPI3REF: Query The EXPLAIN Setting For A Prepared Statement /// METHOD: sqlite3_stmt @@ -2641,14 +2587,14 @@ class SQLite { int sqlite3_stmt_isexplain( ffi.Pointer pStmt, ) { - _sqlite3_stmt_isexplain ??= _dylib.lookupFunction<_c_sqlite3_stmt_isexplain, - _dart_sqlite3_stmt_isexplain>('sqlite3_stmt_isexplain'); - return _sqlite3_stmt_isexplain( + return (_sqlite3_stmt_isexplain ??= _dylib.lookupFunction< + _c_sqlite3_stmt_isexplain, + _dart_sqlite3_stmt_isexplain>('sqlite3_stmt_isexplain'))( pStmt, ); } - _dart_sqlite3_stmt_isexplain _sqlite3_stmt_isexplain; + _dart_sqlite3_stmt_isexplain? _sqlite3_stmt_isexplain; /// CAPI3REF: Determine If A Prepared Statement Has Been Reset /// METHOD: sqlite3_stmt @@ -2670,15 +2616,14 @@ class SQLite { int sqlite3_stmt_busy( ffi.Pointer arg0, ) { - _sqlite3_stmt_busy ??= + return (_sqlite3_stmt_busy ??= _dylib.lookupFunction<_c_sqlite3_stmt_busy, _dart_sqlite3_stmt_busy>( - 'sqlite3_stmt_busy'); - return _sqlite3_stmt_busy( + 'sqlite3_stmt_busy'))( arg0, ); } - _dart_sqlite3_stmt_busy _sqlite3_stmt_busy; + _dart_sqlite3_stmt_busy? _sqlite3_stmt_busy; /// CAPI3REF: Binding Values To Prepared Statements /// KEYWORDS: {host parameter} {host parameters} {host parameter name} @@ -2821,10 +2766,9 @@ class SQLite { int n, ffi.Pointer> arg4, ) { - _sqlite3_bind_blob ??= + return (_sqlite3_bind_blob ??= _dylib.lookupFunction<_c_sqlite3_bind_blob, _dart_sqlite3_bind_blob>( - 'sqlite3_bind_blob'); - return _sqlite3_bind_blob( + 'sqlite3_bind_blob'))( arg0, arg1, arg2, @@ -2833,7 +2777,7 @@ class SQLite { ); } - _dart_sqlite3_bind_blob _sqlite3_bind_blob; + _dart_sqlite3_bind_blob? _sqlite3_bind_blob; int sqlite3_bind_blob64( ffi.Pointer arg0, @@ -2842,9 +2786,9 @@ class SQLite { int arg3, ffi.Pointer> arg4, ) { - _sqlite3_bind_blob64 ??= _dylib.lookupFunction<_c_sqlite3_bind_blob64, - _dart_sqlite3_bind_blob64>('sqlite3_bind_blob64'); - return _sqlite3_bind_blob64( + return (_sqlite3_bind_blob64 ??= _dylib.lookupFunction< + _c_sqlite3_bind_blob64, + _dart_sqlite3_bind_blob64>('sqlite3_bind_blob64'))( arg0, arg1, arg2, @@ -2853,72 +2797,69 @@ class SQLite { ); } - _dart_sqlite3_bind_blob64 _sqlite3_bind_blob64; + _dart_sqlite3_bind_blob64? _sqlite3_bind_blob64; int sqlite3_bind_double( ffi.Pointer arg0, int arg1, double arg2, ) { - _sqlite3_bind_double ??= _dylib.lookupFunction<_c_sqlite3_bind_double, - _dart_sqlite3_bind_double>('sqlite3_bind_double'); - return _sqlite3_bind_double( + return (_sqlite3_bind_double ??= _dylib.lookupFunction< + _c_sqlite3_bind_double, + _dart_sqlite3_bind_double>('sqlite3_bind_double'))( arg0, arg1, arg2, ); } - _dart_sqlite3_bind_double _sqlite3_bind_double; + _dart_sqlite3_bind_double? _sqlite3_bind_double; int sqlite3_bind_int( ffi.Pointer arg0, int arg1, int arg2, ) { - _sqlite3_bind_int ??= + return (_sqlite3_bind_int ??= _dylib.lookupFunction<_c_sqlite3_bind_int, _dart_sqlite3_bind_int>( - 'sqlite3_bind_int'); - return _sqlite3_bind_int( + 'sqlite3_bind_int'))( arg0, arg1, arg2, ); } - _dart_sqlite3_bind_int _sqlite3_bind_int; + _dart_sqlite3_bind_int? _sqlite3_bind_int; int sqlite3_bind_int64( ffi.Pointer arg0, int arg1, int arg2, ) { - _sqlite3_bind_int64 ??= + return (_sqlite3_bind_int64 ??= _dylib.lookupFunction<_c_sqlite3_bind_int64, _dart_sqlite3_bind_int64>( - 'sqlite3_bind_int64'); - return _sqlite3_bind_int64( + 'sqlite3_bind_int64'))( arg0, arg1, arg2, ); } - _dart_sqlite3_bind_int64 _sqlite3_bind_int64; + _dart_sqlite3_bind_int64? _sqlite3_bind_int64; int sqlite3_bind_null( ffi.Pointer arg0, int arg1, ) { - _sqlite3_bind_null ??= + return (_sqlite3_bind_null ??= _dylib.lookupFunction<_c_sqlite3_bind_null, _dart_sqlite3_bind_null>( - 'sqlite3_bind_null'); - return _sqlite3_bind_null( + 'sqlite3_bind_null'))( arg0, arg1, ); } - _dart_sqlite3_bind_null _sqlite3_bind_null; + _dart_sqlite3_bind_null? _sqlite3_bind_null; int sqlite3_bind_text( ffi.Pointer arg0, @@ -2927,10 +2868,9 @@ class SQLite { int arg3, ffi.Pointer> arg4, ) { - _sqlite3_bind_text ??= + return (_sqlite3_bind_text ??= _dylib.lookupFunction<_c_sqlite3_bind_text, _dart_sqlite3_bind_text>( - 'sqlite3_bind_text'); - return _sqlite3_bind_text( + 'sqlite3_bind_text'))( arg0, arg1, arg2, @@ -2939,7 +2879,7 @@ class SQLite { ); } - _dart_sqlite3_bind_text _sqlite3_bind_text; + _dart_sqlite3_bind_text? _sqlite3_bind_text; int sqlite3_bind_text16( ffi.Pointer arg0, @@ -2948,9 +2888,9 @@ class SQLite { int arg3, ffi.Pointer> arg4, ) { - _sqlite3_bind_text16 ??= _dylib.lookupFunction<_c_sqlite3_bind_text16, - _dart_sqlite3_bind_text16>('sqlite3_bind_text16'); - return _sqlite3_bind_text16( + return (_sqlite3_bind_text16 ??= _dylib.lookupFunction< + _c_sqlite3_bind_text16, + _dart_sqlite3_bind_text16>('sqlite3_bind_text16'))( arg0, arg1, arg2, @@ -2959,7 +2899,7 @@ class SQLite { ); } - _dart_sqlite3_bind_text16 _sqlite3_bind_text16; + _dart_sqlite3_bind_text16? _sqlite3_bind_text16; int sqlite3_bind_text64( ffi.Pointer arg0, @@ -2969,9 +2909,9 @@ class SQLite { ffi.Pointer> arg4, int encoding, ) { - _sqlite3_bind_text64 ??= _dylib.lookupFunction<_c_sqlite3_bind_text64, - _dart_sqlite3_bind_text64>('sqlite3_bind_text64'); - return _sqlite3_bind_text64( + return (_sqlite3_bind_text64 ??= _dylib.lookupFunction< + _c_sqlite3_bind_text64, + _dart_sqlite3_bind_text64>('sqlite3_bind_text64'))( arg0, arg1, arg2, @@ -2981,24 +2921,23 @@ class SQLite { ); } - _dart_sqlite3_bind_text64 _sqlite3_bind_text64; + _dart_sqlite3_bind_text64? _sqlite3_bind_text64; int sqlite3_bind_value( ffi.Pointer arg0, int arg1, ffi.Pointer arg2, ) { - _sqlite3_bind_value ??= + return (_sqlite3_bind_value ??= _dylib.lookupFunction<_c_sqlite3_bind_value, _dart_sqlite3_bind_value>( - 'sqlite3_bind_value'); - return _sqlite3_bind_value( + 'sqlite3_bind_value'))( arg0, arg1, arg2, ); } - _dart_sqlite3_bind_value _sqlite3_bind_value; + _dart_sqlite3_bind_value? _sqlite3_bind_value; int sqlite3_bind_pointer( ffi.Pointer arg0, @@ -3007,9 +2946,9 @@ class SQLite { ffi.Pointer arg3, ffi.Pointer> arg4, ) { - _sqlite3_bind_pointer ??= _dylib.lookupFunction<_c_sqlite3_bind_pointer, - _dart_sqlite3_bind_pointer>('sqlite3_bind_pointer'); - return _sqlite3_bind_pointer( + return (_sqlite3_bind_pointer ??= _dylib.lookupFunction< + _c_sqlite3_bind_pointer, + _dart_sqlite3_bind_pointer>('sqlite3_bind_pointer'))( arg0, arg1, arg2, @@ -3018,40 +2957,39 @@ class SQLite { ); } - _dart_sqlite3_bind_pointer _sqlite3_bind_pointer; + _dart_sqlite3_bind_pointer? _sqlite3_bind_pointer; int sqlite3_bind_zeroblob( ffi.Pointer arg0, int arg1, int n, ) { - _sqlite3_bind_zeroblob ??= _dylib.lookupFunction<_c_sqlite3_bind_zeroblob, - _dart_sqlite3_bind_zeroblob>('sqlite3_bind_zeroblob'); - return _sqlite3_bind_zeroblob( + return (_sqlite3_bind_zeroblob ??= _dylib.lookupFunction< + _c_sqlite3_bind_zeroblob, + _dart_sqlite3_bind_zeroblob>('sqlite3_bind_zeroblob'))( arg0, arg1, n, ); } - _dart_sqlite3_bind_zeroblob _sqlite3_bind_zeroblob; + _dart_sqlite3_bind_zeroblob? _sqlite3_bind_zeroblob; int sqlite3_bind_zeroblob64( ffi.Pointer arg0, int arg1, int arg2, ) { - _sqlite3_bind_zeroblob64 ??= _dylib.lookupFunction< + return (_sqlite3_bind_zeroblob64 ??= _dylib.lookupFunction< _c_sqlite3_bind_zeroblob64, - _dart_sqlite3_bind_zeroblob64>('sqlite3_bind_zeroblob64'); - return _sqlite3_bind_zeroblob64( + _dart_sqlite3_bind_zeroblob64>('sqlite3_bind_zeroblob64'))( arg0, arg1, arg2, ); } - _dart_sqlite3_bind_zeroblob64 _sqlite3_bind_zeroblob64; + _dart_sqlite3_bind_zeroblob64? _sqlite3_bind_zeroblob64; /// CAPI3REF: Number Of SQL Parameters /// METHOD: sqlite3_stmt @@ -3073,15 +3011,14 @@ class SQLite { int sqlite3_bind_parameter_count( ffi.Pointer arg0, ) { - _sqlite3_bind_parameter_count ??= _dylib.lookupFunction< + return (_sqlite3_bind_parameter_count ??= _dylib.lookupFunction< _c_sqlite3_bind_parameter_count, - _dart_sqlite3_bind_parameter_count>('sqlite3_bind_parameter_count'); - return _sqlite3_bind_parameter_count( + _dart_sqlite3_bind_parameter_count>('sqlite3_bind_parameter_count'))( arg0, ); } - _dart_sqlite3_bind_parameter_count _sqlite3_bind_parameter_count; + _dart_sqlite3_bind_parameter_count? _sqlite3_bind_parameter_count; /// CAPI3REF: Name Of A Host Parameter /// METHOD: sqlite3_stmt @@ -3111,16 +3048,15 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - _sqlite3_bind_parameter_name ??= _dylib.lookupFunction< + return (_sqlite3_bind_parameter_name ??= _dylib.lookupFunction< _c_sqlite3_bind_parameter_name, - _dart_sqlite3_bind_parameter_name>('sqlite3_bind_parameter_name'); - return _sqlite3_bind_parameter_name( + _dart_sqlite3_bind_parameter_name>('sqlite3_bind_parameter_name'))( arg0, arg1, ); } - _dart_sqlite3_bind_parameter_name _sqlite3_bind_parameter_name; + _dart_sqlite3_bind_parameter_name? _sqlite3_bind_parameter_name; /// CAPI3REF: Index Of A Parameter With A Given Name /// METHOD: sqlite3_stmt @@ -3140,16 +3076,15 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer zName, ) { - _sqlite3_bind_parameter_index ??= _dylib.lookupFunction< + return (_sqlite3_bind_parameter_index ??= _dylib.lookupFunction< _c_sqlite3_bind_parameter_index, - _dart_sqlite3_bind_parameter_index>('sqlite3_bind_parameter_index'); - return _sqlite3_bind_parameter_index( + _dart_sqlite3_bind_parameter_index>('sqlite3_bind_parameter_index'))( arg0, zName, ); } - _dart_sqlite3_bind_parameter_index _sqlite3_bind_parameter_index; + _dart_sqlite3_bind_parameter_index? _sqlite3_bind_parameter_index; /// CAPI3REF: Reset All Bindings On A Prepared Statement /// METHOD: sqlite3_stmt @@ -3160,14 +3095,14 @@ class SQLite { int sqlite3_clear_bindings( ffi.Pointer arg0, ) { - _sqlite3_clear_bindings ??= _dylib.lookupFunction<_c_sqlite3_clear_bindings, - _dart_sqlite3_clear_bindings>('sqlite3_clear_bindings'); - return _sqlite3_clear_bindings( + return (_sqlite3_clear_bindings ??= _dylib.lookupFunction< + _c_sqlite3_clear_bindings, + _dart_sqlite3_clear_bindings>('sqlite3_clear_bindings'))( arg0, ); } - _dart_sqlite3_clear_bindings _sqlite3_clear_bindings; + _dart_sqlite3_clear_bindings? _sqlite3_clear_bindings; /// CAPI3REF: Number Of Columns In A Result Set /// METHOD: sqlite3_stmt @@ -3184,14 +3119,14 @@ class SQLite { int sqlite3_column_count( ffi.Pointer pStmt, ) { - _sqlite3_column_count ??= _dylib.lookupFunction<_c_sqlite3_column_count, - _dart_sqlite3_column_count>('sqlite3_column_count'); - return _sqlite3_column_count( + return (_sqlite3_column_count ??= _dylib.lookupFunction< + _c_sqlite3_column_count, + _dart_sqlite3_column_count>('sqlite3_column_count'))( pStmt, ); } - _dart_sqlite3_column_count _sqlite3_column_count; + _dart_sqlite3_column_count? _sqlite3_column_count; /// CAPI3REF: Column Names In A Result Set /// METHOD: sqlite3_stmt @@ -3222,29 +3157,29 @@ class SQLite { ffi.Pointer arg0, int N, ) { - _sqlite3_column_name ??= _dylib.lookupFunction<_c_sqlite3_column_name, - _dart_sqlite3_column_name>('sqlite3_column_name'); - return _sqlite3_column_name( + return (_sqlite3_column_name ??= _dylib.lookupFunction< + _c_sqlite3_column_name, + _dart_sqlite3_column_name>('sqlite3_column_name'))( arg0, N, ); } - _dart_sqlite3_column_name _sqlite3_column_name; + _dart_sqlite3_column_name? _sqlite3_column_name; ffi.Pointer sqlite3_column_name16( ffi.Pointer arg0, int N, ) { - _sqlite3_column_name16 ??= _dylib.lookupFunction<_c_sqlite3_column_name16, - _dart_sqlite3_column_name16>('sqlite3_column_name16'); - return _sqlite3_column_name16( + return (_sqlite3_column_name16 ??= _dylib.lookupFunction< + _c_sqlite3_column_name16, + _dart_sqlite3_column_name16>('sqlite3_column_name16'))( arg0, N, ); } - _dart_sqlite3_column_name16 _sqlite3_column_name16; + _dart_sqlite3_column_name16? _sqlite3_column_name16; /// CAPI3REF: Source Of Data In A Query Result /// METHOD: sqlite3_stmt @@ -3290,91 +3225,86 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - _sqlite3_column_database_name ??= _dylib.lookupFunction< + return (_sqlite3_column_database_name ??= _dylib.lookupFunction< _c_sqlite3_column_database_name, - _dart_sqlite3_column_database_name>('sqlite3_column_database_name'); - return _sqlite3_column_database_name( + _dart_sqlite3_column_database_name>('sqlite3_column_database_name'))( arg0, arg1, ); } - _dart_sqlite3_column_database_name _sqlite3_column_database_name; + _dart_sqlite3_column_database_name? _sqlite3_column_database_name; ffi.Pointer sqlite3_column_database_name16( ffi.Pointer arg0, int arg1, ) { - _sqlite3_column_database_name16 ??= _dylib.lookupFunction< - _c_sqlite3_column_database_name16, - _dart_sqlite3_column_database_name16>('sqlite3_column_database_name16'); - return _sqlite3_column_database_name16( + return (_sqlite3_column_database_name16 ??= _dylib.lookupFunction< + _c_sqlite3_column_database_name16, + _dart_sqlite3_column_database_name16>( + 'sqlite3_column_database_name16'))( arg0, arg1, ); } - _dart_sqlite3_column_database_name16 _sqlite3_column_database_name16; + _dart_sqlite3_column_database_name16? _sqlite3_column_database_name16; ffi.Pointer sqlite3_column_table_name( ffi.Pointer arg0, int arg1, ) { - _sqlite3_column_table_name ??= _dylib.lookupFunction< + return (_sqlite3_column_table_name ??= _dylib.lookupFunction< _c_sqlite3_column_table_name, - _dart_sqlite3_column_table_name>('sqlite3_column_table_name'); - return _sqlite3_column_table_name( + _dart_sqlite3_column_table_name>('sqlite3_column_table_name'))( arg0, arg1, ); } - _dart_sqlite3_column_table_name _sqlite3_column_table_name; + _dart_sqlite3_column_table_name? _sqlite3_column_table_name; ffi.Pointer sqlite3_column_table_name16( ffi.Pointer arg0, int arg1, ) { - _sqlite3_column_table_name16 ??= _dylib.lookupFunction< + return (_sqlite3_column_table_name16 ??= _dylib.lookupFunction< _c_sqlite3_column_table_name16, - _dart_sqlite3_column_table_name16>('sqlite3_column_table_name16'); - return _sqlite3_column_table_name16( + _dart_sqlite3_column_table_name16>('sqlite3_column_table_name16'))( arg0, arg1, ); } - _dart_sqlite3_column_table_name16 _sqlite3_column_table_name16; + _dart_sqlite3_column_table_name16? _sqlite3_column_table_name16; ffi.Pointer sqlite3_column_origin_name( ffi.Pointer arg0, int arg1, ) { - _sqlite3_column_origin_name ??= _dylib.lookupFunction< + return (_sqlite3_column_origin_name ??= _dylib.lookupFunction< _c_sqlite3_column_origin_name, - _dart_sqlite3_column_origin_name>('sqlite3_column_origin_name'); - return _sqlite3_column_origin_name( + _dart_sqlite3_column_origin_name>('sqlite3_column_origin_name'))( arg0, arg1, ); } - _dart_sqlite3_column_origin_name _sqlite3_column_origin_name; + _dart_sqlite3_column_origin_name? _sqlite3_column_origin_name; ffi.Pointer sqlite3_column_origin_name16( ffi.Pointer arg0, int arg1, ) { - _sqlite3_column_origin_name16 ??= _dylib.lookupFunction< + return (_sqlite3_column_origin_name16 ??= _dylib.lookupFunction< _c_sqlite3_column_origin_name16, - _dart_sqlite3_column_origin_name16>('sqlite3_column_origin_name16'); - return _sqlite3_column_origin_name16( + _dart_sqlite3_column_origin_name16>('sqlite3_column_origin_name16'))( arg0, arg1, ); } - _dart_sqlite3_column_origin_name16 _sqlite3_column_origin_name16; + _dart_sqlite3_column_origin_name16? _sqlite3_column_origin_name16; /// CAPI3REF: Declared Datatype Of A Query Result /// METHOD: sqlite3_stmt @@ -3408,31 +3338,29 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - _sqlite3_column_decltype ??= _dylib.lookupFunction< + return (_sqlite3_column_decltype ??= _dylib.lookupFunction< _c_sqlite3_column_decltype, - _dart_sqlite3_column_decltype>('sqlite3_column_decltype'); - return _sqlite3_column_decltype( + _dart_sqlite3_column_decltype>('sqlite3_column_decltype'))( arg0, arg1, ); } - _dart_sqlite3_column_decltype _sqlite3_column_decltype; + _dart_sqlite3_column_decltype? _sqlite3_column_decltype; ffi.Pointer sqlite3_column_decltype16( ffi.Pointer arg0, int arg1, ) { - _sqlite3_column_decltype16 ??= _dylib.lookupFunction< + return (_sqlite3_column_decltype16 ??= _dylib.lookupFunction< _c_sqlite3_column_decltype16, - _dart_sqlite3_column_decltype16>('sqlite3_column_decltype16'); - return _sqlite3_column_decltype16( + _dart_sqlite3_column_decltype16>('sqlite3_column_decltype16'))( arg0, arg1, ); } - _dart_sqlite3_column_decltype16 _sqlite3_column_decltype16; + _dart_sqlite3_column_decltype16? _sqlite3_column_decltype16; /// CAPI3REF: Evaluate An SQL Statement /// METHOD: sqlite3_stmt @@ -3517,14 +3445,13 @@ class SQLite { int sqlite3_step( ffi.Pointer arg0, ) { - _sqlite3_step ??= _dylib - .lookupFunction<_c_sqlite3_step, _dart_sqlite3_step>('sqlite3_step'); - return _sqlite3_step( + return (_sqlite3_step ??= _dylib + .lookupFunction<_c_sqlite3_step, _dart_sqlite3_step>('sqlite3_step'))( arg0, ); } - _dart_sqlite3_step _sqlite3_step; + _dart_sqlite3_step? _sqlite3_step; /// CAPI3REF: Number of columns in a result set /// METHOD: sqlite3_stmt @@ -3546,15 +3473,14 @@ class SQLite { int sqlite3_data_count( ffi.Pointer pStmt, ) { - _sqlite3_data_count ??= + return (_sqlite3_data_count ??= _dylib.lookupFunction<_c_sqlite3_data_count, _dart_sqlite3_data_count>( - 'sqlite3_data_count'); - return _sqlite3_data_count( + 'sqlite3_data_count'))( pStmt, ); } - _dart_sqlite3_data_count _sqlite3_data_count; + _dart_sqlite3_data_count? _sqlite3_data_count; /// CAPI3REF: Result Values From A Query /// KEYWORDS: {column access functions} @@ -3767,142 +3693,141 @@ class SQLite { ffi.Pointer arg0, int iCol, ) { - _sqlite3_column_blob ??= _dylib.lookupFunction<_c_sqlite3_column_blob, - _dart_sqlite3_column_blob>('sqlite3_column_blob'); - return _sqlite3_column_blob( + return (_sqlite3_column_blob ??= _dylib.lookupFunction< + _c_sqlite3_column_blob, + _dart_sqlite3_column_blob>('sqlite3_column_blob'))( arg0, iCol, ); } - _dart_sqlite3_column_blob _sqlite3_column_blob; + _dart_sqlite3_column_blob? _sqlite3_column_blob; double sqlite3_column_double( ffi.Pointer arg0, int iCol, ) { - _sqlite3_column_double ??= _dylib.lookupFunction<_c_sqlite3_column_double, - _dart_sqlite3_column_double>('sqlite3_column_double'); - return _sqlite3_column_double( + return (_sqlite3_column_double ??= _dylib.lookupFunction< + _c_sqlite3_column_double, + _dart_sqlite3_column_double>('sqlite3_column_double'))( arg0, iCol, ); } - _dart_sqlite3_column_double _sqlite3_column_double; + _dart_sqlite3_column_double? _sqlite3_column_double; int sqlite3_column_int( ffi.Pointer arg0, int iCol, ) { - _sqlite3_column_int ??= + return (_sqlite3_column_int ??= _dylib.lookupFunction<_c_sqlite3_column_int, _dart_sqlite3_column_int>( - 'sqlite3_column_int'); - return _sqlite3_column_int( + 'sqlite3_column_int'))( arg0, iCol, ); } - _dart_sqlite3_column_int _sqlite3_column_int; + _dart_sqlite3_column_int? _sqlite3_column_int; int sqlite3_column_int64( ffi.Pointer arg0, int iCol, ) { - _sqlite3_column_int64 ??= _dylib.lookupFunction<_c_sqlite3_column_int64, - _dart_sqlite3_column_int64>('sqlite3_column_int64'); - return _sqlite3_column_int64( + return (_sqlite3_column_int64 ??= _dylib.lookupFunction< + _c_sqlite3_column_int64, + _dart_sqlite3_column_int64>('sqlite3_column_int64'))( arg0, iCol, ); } - _dart_sqlite3_column_int64 _sqlite3_column_int64; + _dart_sqlite3_column_int64? _sqlite3_column_int64; ffi.Pointer sqlite3_column_text( ffi.Pointer arg0, int iCol, ) { - _sqlite3_column_text ??= _dylib.lookupFunction<_c_sqlite3_column_text, - _dart_sqlite3_column_text>('sqlite3_column_text'); - return _sqlite3_column_text( + return (_sqlite3_column_text ??= _dylib.lookupFunction< + _c_sqlite3_column_text, + _dart_sqlite3_column_text>('sqlite3_column_text'))( arg0, iCol, ); } - _dart_sqlite3_column_text _sqlite3_column_text; + _dart_sqlite3_column_text? _sqlite3_column_text; ffi.Pointer sqlite3_column_text16( ffi.Pointer arg0, int iCol, ) { - _sqlite3_column_text16 ??= _dylib.lookupFunction<_c_sqlite3_column_text16, - _dart_sqlite3_column_text16>('sqlite3_column_text16'); - return _sqlite3_column_text16( + return (_sqlite3_column_text16 ??= _dylib.lookupFunction< + _c_sqlite3_column_text16, + _dart_sqlite3_column_text16>('sqlite3_column_text16'))( arg0, iCol, ); } - _dart_sqlite3_column_text16 _sqlite3_column_text16; + _dart_sqlite3_column_text16? _sqlite3_column_text16; ffi.Pointer sqlite3_column_value( ffi.Pointer arg0, int iCol, ) { - _sqlite3_column_value ??= _dylib.lookupFunction<_c_sqlite3_column_value, - _dart_sqlite3_column_value>('sqlite3_column_value'); - return _sqlite3_column_value( + return (_sqlite3_column_value ??= _dylib.lookupFunction< + _c_sqlite3_column_value, + _dart_sqlite3_column_value>('sqlite3_column_value'))( arg0, iCol, ); } - _dart_sqlite3_column_value _sqlite3_column_value; + _dart_sqlite3_column_value? _sqlite3_column_value; int sqlite3_column_bytes( ffi.Pointer arg0, int iCol, ) { - _sqlite3_column_bytes ??= _dylib.lookupFunction<_c_sqlite3_column_bytes, - _dart_sqlite3_column_bytes>('sqlite3_column_bytes'); - return _sqlite3_column_bytes( + return (_sqlite3_column_bytes ??= _dylib.lookupFunction< + _c_sqlite3_column_bytes, + _dart_sqlite3_column_bytes>('sqlite3_column_bytes'))( arg0, iCol, ); } - _dart_sqlite3_column_bytes _sqlite3_column_bytes; + _dart_sqlite3_column_bytes? _sqlite3_column_bytes; int sqlite3_column_bytes16( ffi.Pointer arg0, int iCol, ) { - _sqlite3_column_bytes16 ??= _dylib.lookupFunction<_c_sqlite3_column_bytes16, - _dart_sqlite3_column_bytes16>('sqlite3_column_bytes16'); - return _sqlite3_column_bytes16( + return (_sqlite3_column_bytes16 ??= _dylib.lookupFunction< + _c_sqlite3_column_bytes16, + _dart_sqlite3_column_bytes16>('sqlite3_column_bytes16'))( arg0, iCol, ); } - _dart_sqlite3_column_bytes16 _sqlite3_column_bytes16; + _dart_sqlite3_column_bytes16? _sqlite3_column_bytes16; int sqlite3_column_type( ffi.Pointer arg0, int iCol, ) { - _sqlite3_column_type ??= _dylib.lookupFunction<_c_sqlite3_column_type, - _dart_sqlite3_column_type>('sqlite3_column_type'); - return _sqlite3_column_type( + return (_sqlite3_column_type ??= _dylib.lookupFunction< + _c_sqlite3_column_type, + _dart_sqlite3_column_type>('sqlite3_column_type'))( arg0, iCol, ); } - _dart_sqlite3_column_type _sqlite3_column_type; + _dart_sqlite3_column_type? _sqlite3_column_type; /// CAPI3REF: Destroy A Prepared Statement Object /// DESTRUCTOR: sqlite3_stmt @@ -3931,15 +3856,14 @@ class SQLite { int sqlite3_finalize( ffi.Pointer pStmt, ) { - _sqlite3_finalize ??= + return (_sqlite3_finalize ??= _dylib.lookupFunction<_c_sqlite3_finalize, _dart_sqlite3_finalize>( - 'sqlite3_finalize'); - return _sqlite3_finalize( + 'sqlite3_finalize'))( pStmt, ); } - _dart_sqlite3_finalize _sqlite3_finalize; + _dart_sqlite3_finalize? _sqlite3_finalize; /// CAPI3REF: Reset A Prepared Statement Object /// METHOD: sqlite3_stmt @@ -3967,14 +3891,14 @@ class SQLite { int sqlite3_reset( ffi.Pointer pStmt, ) { - _sqlite3_reset ??= _dylib - .lookupFunction<_c_sqlite3_reset, _dart_sqlite3_reset>('sqlite3_reset'); - return _sqlite3_reset( + return (_sqlite3_reset ??= + _dylib.lookupFunction<_c_sqlite3_reset, _dart_sqlite3_reset>( + 'sqlite3_reset'))( pStmt, ); } - _dart_sqlite3_reset _sqlite3_reset; + _dart_sqlite3_reset? _sqlite3_reset; /// CAPI3REF: Create Or Redefine SQL Functions /// KEYWORDS: {function creation routines} @@ -4109,10 +4033,9 @@ class SQLite { ffi.Pointer> xStep, ffi.Pointer> xFinal, ) { - _sqlite3_create_function ??= _dylib.lookupFunction< + return (_sqlite3_create_function ??= _dylib.lookupFunction< _c_sqlite3_create_function, - _dart_sqlite3_create_function>('sqlite3_create_function'); - return _sqlite3_create_function( + _dart_sqlite3_create_function>('sqlite3_create_function'))( db, zFunctionName, nArg, @@ -4124,7 +4047,7 @@ class SQLite { ); } - _dart_sqlite3_create_function _sqlite3_create_function; + _dart_sqlite3_create_function? _sqlite3_create_function; int sqlite3_create_function16( ffi.Pointer db, @@ -4136,10 +4059,9 @@ class SQLite { ffi.Pointer> xStep, ffi.Pointer> xFinal, ) { - _sqlite3_create_function16 ??= _dylib.lookupFunction< + return (_sqlite3_create_function16 ??= _dylib.lookupFunction< _c_sqlite3_create_function16, - _dart_sqlite3_create_function16>('sqlite3_create_function16'); - return _sqlite3_create_function16( + _dart_sqlite3_create_function16>('sqlite3_create_function16'))( db, zFunctionName, nArg, @@ -4151,7 +4073,7 @@ class SQLite { ); } - _dart_sqlite3_create_function16 _sqlite3_create_function16; + _dart_sqlite3_create_function16? _sqlite3_create_function16; int sqlite3_create_function_v2( ffi.Pointer db, @@ -4164,10 +4086,9 @@ class SQLite { ffi.Pointer> xFinal, ffi.Pointer> xDestroy, ) { - _sqlite3_create_function_v2 ??= _dylib.lookupFunction< + return (_sqlite3_create_function_v2 ??= _dylib.lookupFunction< _c_sqlite3_create_function_v2, - _dart_sqlite3_create_function_v2>('sqlite3_create_function_v2'); - return _sqlite3_create_function_v2( + _dart_sqlite3_create_function_v2>('sqlite3_create_function_v2'))( db, zFunctionName, nArg, @@ -4180,7 +4101,7 @@ class SQLite { ); } - _dart_sqlite3_create_function_v2 _sqlite3_create_function_v2; + _dart_sqlite3_create_function_v2? _sqlite3_create_function_v2; int sqlite3_create_window_function( ffi.Pointer db, @@ -4194,10 +4115,10 @@ class SQLite { ffi.Pointer> xInverse, ffi.Pointer> xDestroy, ) { - _sqlite3_create_window_function ??= _dylib.lookupFunction< - _c_sqlite3_create_window_function, - _dart_sqlite3_create_window_function>('sqlite3_create_window_function'); - return _sqlite3_create_window_function( + return (_sqlite3_create_window_function ??= _dylib.lookupFunction< + _c_sqlite3_create_window_function, + _dart_sqlite3_create_window_function>( + 'sqlite3_create_window_function'))( db, zFunctionName, nArg, @@ -4211,80 +4132,77 @@ class SQLite { ); } - _dart_sqlite3_create_window_function _sqlite3_create_window_function; + _dart_sqlite3_create_window_function? _sqlite3_create_window_function; int sqlite3_aggregate_count( ffi.Pointer arg0, ) { - _sqlite3_aggregate_count ??= _dylib.lookupFunction< + return (_sqlite3_aggregate_count ??= _dylib.lookupFunction< _c_sqlite3_aggregate_count, - _dart_sqlite3_aggregate_count>('sqlite3_aggregate_count'); - return _sqlite3_aggregate_count( + _dart_sqlite3_aggregate_count>('sqlite3_aggregate_count'))( arg0, ); } - _dart_sqlite3_aggregate_count _sqlite3_aggregate_count; + _dart_sqlite3_aggregate_count? _sqlite3_aggregate_count; int sqlite3_expired( ffi.Pointer arg0, ) { - _sqlite3_expired ??= + return (_sqlite3_expired ??= _dylib.lookupFunction<_c_sqlite3_expired, _dart_sqlite3_expired>( - 'sqlite3_expired'); - return _sqlite3_expired( + 'sqlite3_expired'))( arg0, ); } - _dart_sqlite3_expired _sqlite3_expired; + _dart_sqlite3_expired? _sqlite3_expired; int sqlite3_transfer_bindings( ffi.Pointer arg0, ffi.Pointer arg1, ) { - _sqlite3_transfer_bindings ??= _dylib.lookupFunction< + return (_sqlite3_transfer_bindings ??= _dylib.lookupFunction< _c_sqlite3_transfer_bindings, - _dart_sqlite3_transfer_bindings>('sqlite3_transfer_bindings'); - return _sqlite3_transfer_bindings( + _dart_sqlite3_transfer_bindings>('sqlite3_transfer_bindings'))( arg0, arg1, ); } - _dart_sqlite3_transfer_bindings _sqlite3_transfer_bindings; + _dart_sqlite3_transfer_bindings? _sqlite3_transfer_bindings; int sqlite3_global_recover() { - _sqlite3_global_recover ??= _dylib.lookupFunction<_c_sqlite3_global_recover, - _dart_sqlite3_global_recover>('sqlite3_global_recover'); - return _sqlite3_global_recover(); + return (_sqlite3_global_recover ??= _dylib.lookupFunction< + _c_sqlite3_global_recover, + _dart_sqlite3_global_recover>('sqlite3_global_recover'))(); } - _dart_sqlite3_global_recover _sqlite3_global_recover; + _dart_sqlite3_global_recover? _sqlite3_global_recover; void sqlite3_thread_cleanup() { - _sqlite3_thread_cleanup ??= _dylib.lookupFunction<_c_sqlite3_thread_cleanup, - _dart_sqlite3_thread_cleanup>('sqlite3_thread_cleanup'); - return _sqlite3_thread_cleanup(); + return (_sqlite3_thread_cleanup ??= _dylib.lookupFunction< + _c_sqlite3_thread_cleanup, + _dart_sqlite3_thread_cleanup>('sqlite3_thread_cleanup'))(); } - _dart_sqlite3_thread_cleanup _sqlite3_thread_cleanup; + _dart_sqlite3_thread_cleanup? _sqlite3_thread_cleanup; int sqlite3_memory_alarm( ffi.Pointer> arg0, ffi.Pointer arg1, int arg2, ) { - _sqlite3_memory_alarm ??= _dylib.lookupFunction<_c_sqlite3_memory_alarm, - _dart_sqlite3_memory_alarm>('sqlite3_memory_alarm'); - return _sqlite3_memory_alarm( + return (_sqlite3_memory_alarm ??= _dylib.lookupFunction< + _c_sqlite3_memory_alarm, + _dart_sqlite3_memory_alarm>('sqlite3_memory_alarm'))( arg0, arg1, arg2, ); } - _dart_sqlite3_memory_alarm _sqlite3_memory_alarm; + _dart_sqlite3_memory_alarm? _sqlite3_memory_alarm; /// CAPI3REF: Obtaining SQL Values /// METHOD: sqlite3_value @@ -4415,189 +4333,184 @@ class SQLite { ffi.Pointer sqlite3_value_blob( ffi.Pointer arg0, ) { - _sqlite3_value_blob ??= + return (_sqlite3_value_blob ??= _dylib.lookupFunction<_c_sqlite3_value_blob, _dart_sqlite3_value_blob>( - 'sqlite3_value_blob'); - return _sqlite3_value_blob( + 'sqlite3_value_blob'))( arg0, ); } - _dart_sqlite3_value_blob _sqlite3_value_blob; + _dart_sqlite3_value_blob? _sqlite3_value_blob; double sqlite3_value_double( ffi.Pointer arg0, ) { - _sqlite3_value_double ??= _dylib.lookupFunction<_c_sqlite3_value_double, - _dart_sqlite3_value_double>('sqlite3_value_double'); - return _sqlite3_value_double( + return (_sqlite3_value_double ??= _dylib.lookupFunction< + _c_sqlite3_value_double, + _dart_sqlite3_value_double>('sqlite3_value_double'))( arg0, ); } - _dart_sqlite3_value_double _sqlite3_value_double; + _dart_sqlite3_value_double? _sqlite3_value_double; int sqlite3_value_int( ffi.Pointer arg0, ) { - _sqlite3_value_int ??= + return (_sqlite3_value_int ??= _dylib.lookupFunction<_c_sqlite3_value_int, _dart_sqlite3_value_int>( - 'sqlite3_value_int'); - return _sqlite3_value_int( + 'sqlite3_value_int'))( arg0, ); } - _dart_sqlite3_value_int _sqlite3_value_int; + _dart_sqlite3_value_int? _sqlite3_value_int; int sqlite3_value_int64( ffi.Pointer arg0, ) { - _sqlite3_value_int64 ??= _dylib.lookupFunction<_c_sqlite3_value_int64, - _dart_sqlite3_value_int64>('sqlite3_value_int64'); - return _sqlite3_value_int64( + return (_sqlite3_value_int64 ??= _dylib.lookupFunction< + _c_sqlite3_value_int64, + _dart_sqlite3_value_int64>('sqlite3_value_int64'))( arg0, ); } - _dart_sqlite3_value_int64 _sqlite3_value_int64; + _dart_sqlite3_value_int64? _sqlite3_value_int64; ffi.Pointer sqlite3_value_pointer( ffi.Pointer arg0, ffi.Pointer arg1, ) { - _sqlite3_value_pointer ??= _dylib.lookupFunction<_c_sqlite3_value_pointer, - _dart_sqlite3_value_pointer>('sqlite3_value_pointer'); - return _sqlite3_value_pointer( + return (_sqlite3_value_pointer ??= _dylib.lookupFunction< + _c_sqlite3_value_pointer, + _dart_sqlite3_value_pointer>('sqlite3_value_pointer'))( arg0, arg1, ); } - _dart_sqlite3_value_pointer _sqlite3_value_pointer; + _dart_sqlite3_value_pointer? _sqlite3_value_pointer; ffi.Pointer sqlite3_value_text( ffi.Pointer arg0, ) { - _sqlite3_value_text ??= + return (_sqlite3_value_text ??= _dylib.lookupFunction<_c_sqlite3_value_text, _dart_sqlite3_value_text>( - 'sqlite3_value_text'); - return _sqlite3_value_text( + 'sqlite3_value_text'))( arg0, ); } - _dart_sqlite3_value_text _sqlite3_value_text; + _dart_sqlite3_value_text? _sqlite3_value_text; ffi.Pointer sqlite3_value_text16( ffi.Pointer arg0, ) { - _sqlite3_value_text16 ??= _dylib.lookupFunction<_c_sqlite3_value_text16, - _dart_sqlite3_value_text16>('sqlite3_value_text16'); - return _sqlite3_value_text16( + return (_sqlite3_value_text16 ??= _dylib.lookupFunction< + _c_sqlite3_value_text16, + _dart_sqlite3_value_text16>('sqlite3_value_text16'))( arg0, ); } - _dart_sqlite3_value_text16 _sqlite3_value_text16; + _dart_sqlite3_value_text16? _sqlite3_value_text16; ffi.Pointer sqlite3_value_text16le( ffi.Pointer arg0, ) { - _sqlite3_value_text16le ??= _dylib.lookupFunction<_c_sqlite3_value_text16le, - _dart_sqlite3_value_text16le>('sqlite3_value_text16le'); - return _sqlite3_value_text16le( + return (_sqlite3_value_text16le ??= _dylib.lookupFunction< + _c_sqlite3_value_text16le, + _dart_sqlite3_value_text16le>('sqlite3_value_text16le'))( arg0, ); } - _dart_sqlite3_value_text16le _sqlite3_value_text16le; + _dart_sqlite3_value_text16le? _sqlite3_value_text16le; ffi.Pointer sqlite3_value_text16be( ffi.Pointer arg0, ) { - _sqlite3_value_text16be ??= _dylib.lookupFunction<_c_sqlite3_value_text16be, - _dart_sqlite3_value_text16be>('sqlite3_value_text16be'); - return _sqlite3_value_text16be( + return (_sqlite3_value_text16be ??= _dylib.lookupFunction< + _c_sqlite3_value_text16be, + _dart_sqlite3_value_text16be>('sqlite3_value_text16be'))( arg0, ); } - _dart_sqlite3_value_text16be _sqlite3_value_text16be; + _dart_sqlite3_value_text16be? _sqlite3_value_text16be; int sqlite3_value_bytes( ffi.Pointer arg0, ) { - _sqlite3_value_bytes ??= _dylib.lookupFunction<_c_sqlite3_value_bytes, - _dart_sqlite3_value_bytes>('sqlite3_value_bytes'); - return _sqlite3_value_bytes( + return (_sqlite3_value_bytes ??= _dylib.lookupFunction< + _c_sqlite3_value_bytes, + _dart_sqlite3_value_bytes>('sqlite3_value_bytes'))( arg0, ); } - _dart_sqlite3_value_bytes _sqlite3_value_bytes; + _dart_sqlite3_value_bytes? _sqlite3_value_bytes; int sqlite3_value_bytes16( ffi.Pointer arg0, ) { - _sqlite3_value_bytes16 ??= _dylib.lookupFunction<_c_sqlite3_value_bytes16, - _dart_sqlite3_value_bytes16>('sqlite3_value_bytes16'); - return _sqlite3_value_bytes16( + return (_sqlite3_value_bytes16 ??= _dylib.lookupFunction< + _c_sqlite3_value_bytes16, + _dart_sqlite3_value_bytes16>('sqlite3_value_bytes16'))( arg0, ); } - _dart_sqlite3_value_bytes16 _sqlite3_value_bytes16; + _dart_sqlite3_value_bytes16? _sqlite3_value_bytes16; int sqlite3_value_type( ffi.Pointer arg0, ) { - _sqlite3_value_type ??= + return (_sqlite3_value_type ??= _dylib.lookupFunction<_c_sqlite3_value_type, _dart_sqlite3_value_type>( - 'sqlite3_value_type'); - return _sqlite3_value_type( + 'sqlite3_value_type'))( arg0, ); } - _dart_sqlite3_value_type _sqlite3_value_type; + _dart_sqlite3_value_type? _sqlite3_value_type; int sqlite3_value_numeric_type( ffi.Pointer arg0, ) { - _sqlite3_value_numeric_type ??= _dylib.lookupFunction< + return (_sqlite3_value_numeric_type ??= _dylib.lookupFunction< _c_sqlite3_value_numeric_type, - _dart_sqlite3_value_numeric_type>('sqlite3_value_numeric_type'); - return _sqlite3_value_numeric_type( + _dart_sqlite3_value_numeric_type>('sqlite3_value_numeric_type'))( arg0, ); } - _dart_sqlite3_value_numeric_type _sqlite3_value_numeric_type; + _dart_sqlite3_value_numeric_type? _sqlite3_value_numeric_type; int sqlite3_value_nochange( ffi.Pointer arg0, ) { - _sqlite3_value_nochange ??= _dylib.lookupFunction<_c_sqlite3_value_nochange, - _dart_sqlite3_value_nochange>('sqlite3_value_nochange'); - return _sqlite3_value_nochange( + return (_sqlite3_value_nochange ??= _dylib.lookupFunction< + _c_sqlite3_value_nochange, + _dart_sqlite3_value_nochange>('sqlite3_value_nochange'))( arg0, ); } - _dart_sqlite3_value_nochange _sqlite3_value_nochange; + _dart_sqlite3_value_nochange? _sqlite3_value_nochange; int sqlite3_value_frombind( ffi.Pointer arg0, ) { - _sqlite3_value_frombind ??= _dylib.lookupFunction<_c_sqlite3_value_frombind, - _dart_sqlite3_value_frombind>('sqlite3_value_frombind'); - return _sqlite3_value_frombind( + return (_sqlite3_value_frombind ??= _dylib.lookupFunction< + _c_sqlite3_value_frombind, + _dart_sqlite3_value_frombind>('sqlite3_value_frombind'))( arg0, ); } - _dart_sqlite3_value_frombind _sqlite3_value_frombind; + _dart_sqlite3_value_frombind? _sqlite3_value_frombind; /// CAPI3REF: Finding The Subtype Of SQL Values /// METHOD: sqlite3_value @@ -4610,14 +4523,14 @@ class SQLite { int sqlite3_value_subtype( ffi.Pointer arg0, ) { - _sqlite3_value_subtype ??= _dylib.lookupFunction<_c_sqlite3_value_subtype, - _dart_sqlite3_value_subtype>('sqlite3_value_subtype'); - return _sqlite3_value_subtype( + return (_sqlite3_value_subtype ??= _dylib.lookupFunction< + _c_sqlite3_value_subtype, + _dart_sqlite3_value_subtype>('sqlite3_value_subtype'))( arg0, ); } - _dart_sqlite3_value_subtype _sqlite3_value_subtype; + _dart_sqlite3_value_subtype? _sqlite3_value_subtype; /// CAPI3REF: Copy And Free SQL Values /// METHOD: sqlite3_value @@ -4634,28 +4547,26 @@ class SQLite { ffi.Pointer sqlite3_value_dup( ffi.Pointer arg0, ) { - _sqlite3_value_dup ??= + return (_sqlite3_value_dup ??= _dylib.lookupFunction<_c_sqlite3_value_dup, _dart_sqlite3_value_dup>( - 'sqlite3_value_dup'); - return _sqlite3_value_dup( + 'sqlite3_value_dup'))( arg0, ); } - _dart_sqlite3_value_dup _sqlite3_value_dup; + _dart_sqlite3_value_dup? _sqlite3_value_dup; void sqlite3_value_free( ffi.Pointer arg0, ) { - _sqlite3_value_free ??= + return (_sqlite3_value_free ??= _dylib.lookupFunction<_c_sqlite3_value_free, _dart_sqlite3_value_free>( - 'sqlite3_value_free'); - return _sqlite3_value_free( + 'sqlite3_value_free'))( arg0, ); } - _dart_sqlite3_value_free _sqlite3_value_free; + _dart_sqlite3_value_free? _sqlite3_value_free; /// CAPI3REF: Obtain Aggregate Function Context /// METHOD: sqlite3_context @@ -4702,16 +4613,15 @@ class SQLite { ffi.Pointer arg0, int nBytes, ) { - _sqlite3_aggregate_context ??= _dylib.lookupFunction< + return (_sqlite3_aggregate_context ??= _dylib.lookupFunction< _c_sqlite3_aggregate_context, - _dart_sqlite3_aggregate_context>('sqlite3_aggregate_context'); - return _sqlite3_aggregate_context( + _dart_sqlite3_aggregate_context>('sqlite3_aggregate_context'))( arg0, nBytes, ); } - _dart_sqlite3_aggregate_context _sqlite3_aggregate_context; + _dart_sqlite3_aggregate_context? _sqlite3_aggregate_context; /// CAPI3REF: User Data For Functions /// METHOD: sqlite3_context @@ -4727,15 +4637,14 @@ class SQLite { ffi.Pointer sqlite3_user_data( ffi.Pointer arg0, ) { - _sqlite3_user_data ??= + return (_sqlite3_user_data ??= _dylib.lookupFunction<_c_sqlite3_user_data, _dart_sqlite3_user_data>( - 'sqlite3_user_data'); - return _sqlite3_user_data( + 'sqlite3_user_data'))( arg0, ); } - _dart_sqlite3_user_data _sqlite3_user_data; + _dart_sqlite3_user_data? _sqlite3_user_data; /// CAPI3REF: Database Connection For Functions /// METHOD: sqlite3_context @@ -4748,15 +4657,14 @@ class SQLite { ffi.Pointer sqlite3_context_db_handle( ffi.Pointer arg0, ) { - _sqlite3_context_db_handle ??= _dylib.lookupFunction< + return (_sqlite3_context_db_handle ??= _dylib.lookupFunction< _c_sqlite3_context_db_handle, - _dart_sqlite3_context_db_handle>('sqlite3_context_db_handle'); - return _sqlite3_context_db_handle( + _dart_sqlite3_context_db_handle>('sqlite3_context_db_handle'))( arg0, ); } - _dart_sqlite3_context_db_handle _sqlite3_context_db_handle; + _dart_sqlite3_context_db_handle? _sqlite3_context_db_handle; /// CAPI3REF: Function Auxiliary Data /// METHOD: sqlite3_context @@ -4817,15 +4725,15 @@ class SQLite { ffi.Pointer arg0, int N, ) { - _sqlite3_get_auxdata ??= _dylib.lookupFunction<_c_sqlite3_get_auxdata, - _dart_sqlite3_get_auxdata>('sqlite3_get_auxdata'); - return _sqlite3_get_auxdata( + return (_sqlite3_get_auxdata ??= _dylib.lookupFunction< + _c_sqlite3_get_auxdata, + _dart_sqlite3_get_auxdata>('sqlite3_get_auxdata'))( arg0, N, ); } - _dart_sqlite3_get_auxdata _sqlite3_get_auxdata; + _dart_sqlite3_get_auxdata? _sqlite3_get_auxdata; void sqlite3_set_auxdata( ffi.Pointer arg0, @@ -4833,9 +4741,9 @@ class SQLite { ffi.Pointer arg2, ffi.Pointer> arg3, ) { - _sqlite3_set_auxdata ??= _dylib.lookupFunction<_c_sqlite3_set_auxdata, - _dart_sqlite3_set_auxdata>('sqlite3_set_auxdata'); - return _sqlite3_set_auxdata( + return (_sqlite3_set_auxdata ??= _dylib.lookupFunction< + _c_sqlite3_set_auxdata, + _dart_sqlite3_set_auxdata>('sqlite3_set_auxdata'))( arg0, N, arg2, @@ -4843,7 +4751,7 @@ class SQLite { ); } - _dart_sqlite3_set_auxdata _sqlite3_set_auxdata; + _dart_sqlite3_set_auxdata? _sqlite3_set_auxdata; /// CAPI3REF: Setting The Result Of An SQL Function /// METHOD: sqlite3_context @@ -4995,9 +4903,9 @@ class SQLite { int arg2, ffi.Pointer> arg3, ) { - _sqlite3_result_blob ??= _dylib.lookupFunction<_c_sqlite3_result_blob, - _dart_sqlite3_result_blob>('sqlite3_result_blob'); - return _sqlite3_result_blob( + return (_sqlite3_result_blob ??= _dylib.lookupFunction< + _c_sqlite3_result_blob, + _dart_sqlite3_result_blob>('sqlite3_result_blob'))( arg0, arg1, arg2, @@ -5005,7 +4913,7 @@ class SQLite { ); } - _dart_sqlite3_result_blob _sqlite3_result_blob; + _dart_sqlite3_result_blob? _sqlite3_result_blob; void sqlite3_result_blob64( ffi.Pointer arg0, @@ -5013,9 +4921,9 @@ class SQLite { int arg2, ffi.Pointer> arg3, ) { - _sqlite3_result_blob64 ??= _dylib.lookupFunction<_c_sqlite3_result_blob64, - _dart_sqlite3_result_blob64>('sqlite3_result_blob64'); - return _sqlite3_result_blob64( + return (_sqlite3_result_blob64 ??= _dylib.lookupFunction< + _c_sqlite3_result_blob64, + _dart_sqlite3_result_blob64>('sqlite3_result_blob64'))( arg0, arg1, arg2, @@ -5023,135 +4931,131 @@ class SQLite { ); } - _dart_sqlite3_result_blob64 _sqlite3_result_blob64; + _dart_sqlite3_result_blob64? _sqlite3_result_blob64; void sqlite3_result_double( ffi.Pointer arg0, double arg1, ) { - _sqlite3_result_double ??= _dylib.lookupFunction<_c_sqlite3_result_double, - _dart_sqlite3_result_double>('sqlite3_result_double'); - return _sqlite3_result_double( + return (_sqlite3_result_double ??= _dylib.lookupFunction< + _c_sqlite3_result_double, + _dart_sqlite3_result_double>('sqlite3_result_double'))( arg0, arg1, ); } - _dart_sqlite3_result_double _sqlite3_result_double; + _dart_sqlite3_result_double? _sqlite3_result_double; void sqlite3_result_error( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, ) { - _sqlite3_result_error ??= _dylib.lookupFunction<_c_sqlite3_result_error, - _dart_sqlite3_result_error>('sqlite3_result_error'); - return _sqlite3_result_error( + return (_sqlite3_result_error ??= _dylib.lookupFunction< + _c_sqlite3_result_error, + _dart_sqlite3_result_error>('sqlite3_result_error'))( arg0, arg1, arg2, ); } - _dart_sqlite3_result_error _sqlite3_result_error; + _dart_sqlite3_result_error? _sqlite3_result_error; void sqlite3_result_error16( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, ) { - _sqlite3_result_error16 ??= _dylib.lookupFunction<_c_sqlite3_result_error16, - _dart_sqlite3_result_error16>('sqlite3_result_error16'); - return _sqlite3_result_error16( + return (_sqlite3_result_error16 ??= _dylib.lookupFunction< + _c_sqlite3_result_error16, + _dart_sqlite3_result_error16>('sqlite3_result_error16'))( arg0, arg1, arg2, ); } - _dart_sqlite3_result_error16 _sqlite3_result_error16; + _dart_sqlite3_result_error16? _sqlite3_result_error16; void sqlite3_result_error_toobig( ffi.Pointer arg0, ) { - _sqlite3_result_error_toobig ??= _dylib.lookupFunction< + return (_sqlite3_result_error_toobig ??= _dylib.lookupFunction< _c_sqlite3_result_error_toobig, - _dart_sqlite3_result_error_toobig>('sqlite3_result_error_toobig'); - return _sqlite3_result_error_toobig( + _dart_sqlite3_result_error_toobig>('sqlite3_result_error_toobig'))( arg0, ); } - _dart_sqlite3_result_error_toobig _sqlite3_result_error_toobig; + _dart_sqlite3_result_error_toobig? _sqlite3_result_error_toobig; void sqlite3_result_error_nomem( ffi.Pointer arg0, ) { - _sqlite3_result_error_nomem ??= _dylib.lookupFunction< + return (_sqlite3_result_error_nomem ??= _dylib.lookupFunction< _c_sqlite3_result_error_nomem, - _dart_sqlite3_result_error_nomem>('sqlite3_result_error_nomem'); - return _sqlite3_result_error_nomem( + _dart_sqlite3_result_error_nomem>('sqlite3_result_error_nomem'))( arg0, ); } - _dart_sqlite3_result_error_nomem _sqlite3_result_error_nomem; + _dart_sqlite3_result_error_nomem? _sqlite3_result_error_nomem; void sqlite3_result_error_code( ffi.Pointer arg0, int arg1, ) { - _sqlite3_result_error_code ??= _dylib.lookupFunction< + return (_sqlite3_result_error_code ??= _dylib.lookupFunction< _c_sqlite3_result_error_code, - _dart_sqlite3_result_error_code>('sqlite3_result_error_code'); - return _sqlite3_result_error_code( + _dart_sqlite3_result_error_code>('sqlite3_result_error_code'))( arg0, arg1, ); } - _dart_sqlite3_result_error_code _sqlite3_result_error_code; + _dart_sqlite3_result_error_code? _sqlite3_result_error_code; void sqlite3_result_int( ffi.Pointer arg0, int arg1, ) { - _sqlite3_result_int ??= + return (_sqlite3_result_int ??= _dylib.lookupFunction<_c_sqlite3_result_int, _dart_sqlite3_result_int>( - 'sqlite3_result_int'); - return _sqlite3_result_int( + 'sqlite3_result_int'))( arg0, arg1, ); } - _dart_sqlite3_result_int _sqlite3_result_int; + _dart_sqlite3_result_int? _sqlite3_result_int; void sqlite3_result_int64( ffi.Pointer arg0, int arg1, ) { - _sqlite3_result_int64 ??= _dylib.lookupFunction<_c_sqlite3_result_int64, - _dart_sqlite3_result_int64>('sqlite3_result_int64'); - return _sqlite3_result_int64( + return (_sqlite3_result_int64 ??= _dylib.lookupFunction< + _c_sqlite3_result_int64, + _dart_sqlite3_result_int64>('sqlite3_result_int64'))( arg0, arg1, ); } - _dart_sqlite3_result_int64 _sqlite3_result_int64; + _dart_sqlite3_result_int64? _sqlite3_result_int64; void sqlite3_result_null( ffi.Pointer arg0, ) { - _sqlite3_result_null ??= _dylib.lookupFunction<_c_sqlite3_result_null, - _dart_sqlite3_result_null>('sqlite3_result_null'); - return _sqlite3_result_null( + return (_sqlite3_result_null ??= _dylib.lookupFunction< + _c_sqlite3_result_null, + _dart_sqlite3_result_null>('sqlite3_result_null'))( arg0, ); } - _dart_sqlite3_result_null _sqlite3_result_null; + _dart_sqlite3_result_null? _sqlite3_result_null; void sqlite3_result_text( ffi.Pointer arg0, @@ -5159,9 +5063,9 @@ class SQLite { int arg2, ffi.Pointer> arg3, ) { - _sqlite3_result_text ??= _dylib.lookupFunction<_c_sqlite3_result_text, - _dart_sqlite3_result_text>('sqlite3_result_text'); - return _sqlite3_result_text( + return (_sqlite3_result_text ??= _dylib.lookupFunction< + _c_sqlite3_result_text, + _dart_sqlite3_result_text>('sqlite3_result_text'))( arg0, arg1, arg2, @@ -5169,7 +5073,7 @@ class SQLite { ); } - _dart_sqlite3_result_text _sqlite3_result_text; + _dart_sqlite3_result_text? _sqlite3_result_text; void sqlite3_result_text64( ffi.Pointer arg0, @@ -5178,9 +5082,9 @@ class SQLite { ffi.Pointer> arg3, int encoding, ) { - _sqlite3_result_text64 ??= _dylib.lookupFunction<_c_sqlite3_result_text64, - _dart_sqlite3_result_text64>('sqlite3_result_text64'); - return _sqlite3_result_text64( + return (_sqlite3_result_text64 ??= _dylib.lookupFunction< + _c_sqlite3_result_text64, + _dart_sqlite3_result_text64>('sqlite3_result_text64'))( arg0, arg1, arg2, @@ -5189,7 +5093,7 @@ class SQLite { ); } - _dart_sqlite3_result_text64 _sqlite3_result_text64; + _dart_sqlite3_result_text64? _sqlite3_result_text64; void sqlite3_result_text16( ffi.Pointer arg0, @@ -5197,9 +5101,9 @@ class SQLite { int arg2, ffi.Pointer> arg3, ) { - _sqlite3_result_text16 ??= _dylib.lookupFunction<_c_sqlite3_result_text16, - _dart_sqlite3_result_text16>('sqlite3_result_text16'); - return _sqlite3_result_text16( + return (_sqlite3_result_text16 ??= _dylib.lookupFunction< + _c_sqlite3_result_text16, + _dart_sqlite3_result_text16>('sqlite3_result_text16'))( arg0, arg1, arg2, @@ -5207,7 +5111,7 @@ class SQLite { ); } - _dart_sqlite3_result_text16 _sqlite3_result_text16; + _dart_sqlite3_result_text16? _sqlite3_result_text16; void sqlite3_result_text16le( ffi.Pointer arg0, @@ -5215,10 +5119,9 @@ class SQLite { int arg2, ffi.Pointer> arg3, ) { - _sqlite3_result_text16le ??= _dylib.lookupFunction< + return (_sqlite3_result_text16le ??= _dylib.lookupFunction< _c_sqlite3_result_text16le, - _dart_sqlite3_result_text16le>('sqlite3_result_text16le'); - return _sqlite3_result_text16le( + _dart_sqlite3_result_text16le>('sqlite3_result_text16le'))( arg0, arg1, arg2, @@ -5226,7 +5129,7 @@ class SQLite { ); } - _dart_sqlite3_result_text16le _sqlite3_result_text16le; + _dart_sqlite3_result_text16le? _sqlite3_result_text16le; void sqlite3_result_text16be( ffi.Pointer arg0, @@ -5234,10 +5137,9 @@ class SQLite { int arg2, ffi.Pointer> arg3, ) { - _sqlite3_result_text16be ??= _dylib.lookupFunction< + return (_sqlite3_result_text16be ??= _dylib.lookupFunction< _c_sqlite3_result_text16be, - _dart_sqlite3_result_text16be>('sqlite3_result_text16be'); - return _sqlite3_result_text16be( + _dart_sqlite3_result_text16be>('sqlite3_result_text16be'))( arg0, arg1, arg2, @@ -5245,21 +5147,21 @@ class SQLite { ); } - _dart_sqlite3_result_text16be _sqlite3_result_text16be; + _dart_sqlite3_result_text16be? _sqlite3_result_text16be; void sqlite3_result_value( ffi.Pointer arg0, ffi.Pointer arg1, ) { - _sqlite3_result_value ??= _dylib.lookupFunction<_c_sqlite3_result_value, - _dart_sqlite3_result_value>('sqlite3_result_value'); - return _sqlite3_result_value( + return (_sqlite3_result_value ??= _dylib.lookupFunction< + _c_sqlite3_result_value, + _dart_sqlite3_result_value>('sqlite3_result_value'))( arg0, arg1, ); } - _dart_sqlite3_result_value _sqlite3_result_value; + _dart_sqlite3_result_value? _sqlite3_result_value; void sqlite3_result_pointer( ffi.Pointer arg0, @@ -5267,9 +5169,9 @@ class SQLite { ffi.Pointer arg2, ffi.Pointer> arg3, ) { - _sqlite3_result_pointer ??= _dylib.lookupFunction<_c_sqlite3_result_pointer, - _dart_sqlite3_result_pointer>('sqlite3_result_pointer'); - return _sqlite3_result_pointer( + return (_sqlite3_result_pointer ??= _dylib.lookupFunction< + _c_sqlite3_result_pointer, + _dart_sqlite3_result_pointer>('sqlite3_result_pointer'))( arg0, arg1, arg2, @@ -5277,37 +5179,35 @@ class SQLite { ); } - _dart_sqlite3_result_pointer _sqlite3_result_pointer; + _dart_sqlite3_result_pointer? _sqlite3_result_pointer; void sqlite3_result_zeroblob( ffi.Pointer arg0, int n, ) { - _sqlite3_result_zeroblob ??= _dylib.lookupFunction< + return (_sqlite3_result_zeroblob ??= _dylib.lookupFunction< _c_sqlite3_result_zeroblob, - _dart_sqlite3_result_zeroblob>('sqlite3_result_zeroblob'); - return _sqlite3_result_zeroblob( + _dart_sqlite3_result_zeroblob>('sqlite3_result_zeroblob'))( arg0, n, ); } - _dart_sqlite3_result_zeroblob _sqlite3_result_zeroblob; + _dart_sqlite3_result_zeroblob? _sqlite3_result_zeroblob; int sqlite3_result_zeroblob64( ffi.Pointer arg0, int n, ) { - _sqlite3_result_zeroblob64 ??= _dylib.lookupFunction< + return (_sqlite3_result_zeroblob64 ??= _dylib.lookupFunction< _c_sqlite3_result_zeroblob64, - _dart_sqlite3_result_zeroblob64>('sqlite3_result_zeroblob64'); - return _sqlite3_result_zeroblob64( + _dart_sqlite3_result_zeroblob64>('sqlite3_result_zeroblob64'))( arg0, n, ); } - _dart_sqlite3_result_zeroblob64 _sqlite3_result_zeroblob64; + _dart_sqlite3_result_zeroblob64? _sqlite3_result_zeroblob64; /// CAPI3REF: Setting The Subtype Of An SQL Function /// METHOD: sqlite3_context @@ -5323,15 +5223,15 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - _sqlite3_result_subtype ??= _dylib.lookupFunction<_c_sqlite3_result_subtype, - _dart_sqlite3_result_subtype>('sqlite3_result_subtype'); - return _sqlite3_result_subtype( + return (_sqlite3_result_subtype ??= _dylib.lookupFunction< + _c_sqlite3_result_subtype, + _dart_sqlite3_result_subtype>('sqlite3_result_subtype'))( arg0, arg1, ); } - _dart_sqlite3_result_subtype _sqlite3_result_subtype; + _dart_sqlite3_result_subtype? _sqlite3_result_subtype; /// CAPI3REF: Define New Collating Sequences /// METHOD: sqlite3 @@ -5419,10 +5319,9 @@ class SQLite { ffi.Pointer pArg, ffi.Pointer> xCompare, ) { - _sqlite3_create_collation ??= _dylib.lookupFunction< + return (_sqlite3_create_collation ??= _dylib.lookupFunction< _c_sqlite3_create_collation, - _dart_sqlite3_create_collation>('sqlite3_create_collation'); - return _sqlite3_create_collation( + _dart_sqlite3_create_collation>('sqlite3_create_collation'))( arg0, zName, eTextRep, @@ -5431,7 +5330,7 @@ class SQLite { ); } - _dart_sqlite3_create_collation _sqlite3_create_collation; + _dart_sqlite3_create_collation? _sqlite3_create_collation; int sqlite3_create_collation_v2( ffi.Pointer arg0, @@ -5441,10 +5340,9 @@ class SQLite { ffi.Pointer> xCompare, ffi.Pointer> xDestroy, ) { - _sqlite3_create_collation_v2 ??= _dylib.lookupFunction< + return (_sqlite3_create_collation_v2 ??= _dylib.lookupFunction< _c_sqlite3_create_collation_v2, - _dart_sqlite3_create_collation_v2>('sqlite3_create_collation_v2'); - return _sqlite3_create_collation_v2( + _dart_sqlite3_create_collation_v2>('sqlite3_create_collation_v2'))( arg0, zName, eTextRep, @@ -5454,7 +5352,7 @@ class SQLite { ); } - _dart_sqlite3_create_collation_v2 _sqlite3_create_collation_v2; + _dart_sqlite3_create_collation_v2? _sqlite3_create_collation_v2; int sqlite3_create_collation16( ffi.Pointer arg0, @@ -5463,10 +5361,9 @@ class SQLite { ffi.Pointer pArg, ffi.Pointer> xCompare, ) { - _sqlite3_create_collation16 ??= _dylib.lookupFunction< + return (_sqlite3_create_collation16 ??= _dylib.lookupFunction< _c_sqlite3_create_collation16, - _dart_sqlite3_create_collation16>('sqlite3_create_collation16'); - return _sqlite3_create_collation16( + _dart_sqlite3_create_collation16>('sqlite3_create_collation16'))( arg0, zName, eTextRep, @@ -5475,7 +5372,7 @@ class SQLite { ); } - _dart_sqlite3_create_collation16 _sqlite3_create_collation16; + _dart_sqlite3_create_collation16? _sqlite3_create_collation16; /// CAPI3REF: Collation Needed Callbacks /// METHOD: sqlite3 @@ -5507,34 +5404,32 @@ class SQLite { ffi.Pointer arg1, ffi.Pointer> arg2, ) { - _sqlite3_collation_needed ??= _dylib.lookupFunction< + return (_sqlite3_collation_needed ??= _dylib.lookupFunction< _c_sqlite3_collation_needed, - _dart_sqlite3_collation_needed>('sqlite3_collation_needed'); - return _sqlite3_collation_needed( + _dart_sqlite3_collation_needed>('sqlite3_collation_needed'))( arg0, arg1, arg2, ); } - _dart_sqlite3_collation_needed _sqlite3_collation_needed; + _dart_sqlite3_collation_needed? _sqlite3_collation_needed; int sqlite3_collation_needed16( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer> arg2, ) { - _sqlite3_collation_needed16 ??= _dylib.lookupFunction< + return (_sqlite3_collation_needed16 ??= _dylib.lookupFunction< _c_sqlite3_collation_needed16, - _dart_sqlite3_collation_needed16>('sqlite3_collation_needed16'); - return _sqlite3_collation_needed16( + _dart_sqlite3_collation_needed16>('sqlite3_collation_needed16'))( arg0, arg1, arg2, ); } - _dart_sqlite3_collation_needed16 _sqlite3_collation_needed16; + _dart_sqlite3_collation_needed16? _sqlite3_collation_needed16; /// CAPI3REF: Suspend Execution For A Short Time /// @@ -5554,14 +5449,14 @@ class SQLite { int sqlite3_sleep( int arg0, ) { - _sqlite3_sleep ??= _dylib - .lookupFunction<_c_sqlite3_sleep, _dart_sqlite3_sleep>('sqlite3_sleep'); - return _sqlite3_sleep( + return (_sqlite3_sleep ??= + _dylib.lookupFunction<_c_sqlite3_sleep, _dart_sqlite3_sleep>( + 'sqlite3_sleep'))( arg0, ); } - _dart_sqlite3_sleep _sqlite3_sleep; + _dart_sqlite3_sleep? _sqlite3_sleep; /// CAPI3REF: Win32 Specific Interface /// @@ -5584,46 +5479,43 @@ class SQLite { int type, ffi.Pointer zValue, ) { - _sqlite3_win32_set_directory ??= _dylib.lookupFunction< + return (_sqlite3_win32_set_directory ??= _dylib.lookupFunction< _c_sqlite3_win32_set_directory, - _dart_sqlite3_win32_set_directory>('sqlite3_win32_set_directory'); - return _sqlite3_win32_set_directory( + _dart_sqlite3_win32_set_directory>('sqlite3_win32_set_directory'))( type, zValue, ); } - _dart_sqlite3_win32_set_directory _sqlite3_win32_set_directory; + _dart_sqlite3_win32_set_directory? _sqlite3_win32_set_directory; int sqlite3_win32_set_directory8( int type, ffi.Pointer zValue, ) { - _sqlite3_win32_set_directory8 ??= _dylib.lookupFunction< + return (_sqlite3_win32_set_directory8 ??= _dylib.lookupFunction< _c_sqlite3_win32_set_directory8, - _dart_sqlite3_win32_set_directory8>('sqlite3_win32_set_directory8'); - return _sqlite3_win32_set_directory8( + _dart_sqlite3_win32_set_directory8>('sqlite3_win32_set_directory8'))( type, zValue, ); } - _dart_sqlite3_win32_set_directory8 _sqlite3_win32_set_directory8; + _dart_sqlite3_win32_set_directory8? _sqlite3_win32_set_directory8; int sqlite3_win32_set_directory16( int type, ffi.Pointer zValue, ) { - _sqlite3_win32_set_directory16 ??= _dylib.lookupFunction< + return (_sqlite3_win32_set_directory16 ??= _dylib.lookupFunction< _c_sqlite3_win32_set_directory16, - _dart_sqlite3_win32_set_directory16>('sqlite3_win32_set_directory16'); - return _sqlite3_win32_set_directory16( + _dart_sqlite3_win32_set_directory16>('sqlite3_win32_set_directory16'))( type, zValue, ); } - _dart_sqlite3_win32_set_directory16 _sqlite3_win32_set_directory16; + _dart_sqlite3_win32_set_directory16? _sqlite3_win32_set_directory16; /// CAPI3REF: Test For Auto-Commit Mode /// KEYWORDS: {autocommit mode} @@ -5648,14 +5540,14 @@ class SQLite { int sqlite3_get_autocommit( ffi.Pointer arg0, ) { - _sqlite3_get_autocommit ??= _dylib.lookupFunction<_c_sqlite3_get_autocommit, - _dart_sqlite3_get_autocommit>('sqlite3_get_autocommit'); - return _sqlite3_get_autocommit( + return (_sqlite3_get_autocommit ??= _dylib.lookupFunction< + _c_sqlite3_get_autocommit, + _dart_sqlite3_get_autocommit>('sqlite3_get_autocommit'))( arg0, ); } - _dart_sqlite3_get_autocommit _sqlite3_get_autocommit; + _dart_sqlite3_get_autocommit? _sqlite3_get_autocommit; /// CAPI3REF: Find The Database Handle Of A Prepared Statement /// METHOD: sqlite3_stmt @@ -5669,15 +5561,14 @@ class SQLite { ffi.Pointer sqlite3_db_handle( ffi.Pointer arg0, ) { - _sqlite3_db_handle ??= + return (_sqlite3_db_handle ??= _dylib.lookupFunction<_c_sqlite3_db_handle, _dart_sqlite3_db_handle>( - 'sqlite3_db_handle'); - return _sqlite3_db_handle( + 'sqlite3_db_handle'))( arg0, ); } - _dart_sqlite3_db_handle _sqlite3_db_handle; + _dart_sqlite3_db_handle? _sqlite3_db_handle; /// CAPI3REF: Return The Filename For A Database Connection /// METHOD: sqlite3 @@ -5711,15 +5602,15 @@ class SQLite { ffi.Pointer db, ffi.Pointer zDbName, ) { - _sqlite3_db_filename ??= _dylib.lookupFunction<_c_sqlite3_db_filename, - _dart_sqlite3_db_filename>('sqlite3_db_filename'); - return _sqlite3_db_filename( + return (_sqlite3_db_filename ??= _dylib.lookupFunction< + _c_sqlite3_db_filename, + _dart_sqlite3_db_filename>('sqlite3_db_filename'))( db, zDbName, ); } - _dart_sqlite3_db_filename _sqlite3_db_filename; + _dart_sqlite3_db_filename? _sqlite3_db_filename; /// CAPI3REF: Determine if a database is read-only /// METHOD: sqlite3 @@ -5731,15 +5622,15 @@ class SQLite { ffi.Pointer db, ffi.Pointer zDbName, ) { - _sqlite3_db_readonly ??= _dylib.lookupFunction<_c_sqlite3_db_readonly, - _dart_sqlite3_db_readonly>('sqlite3_db_readonly'); - return _sqlite3_db_readonly( + return (_sqlite3_db_readonly ??= _dylib.lookupFunction< + _c_sqlite3_db_readonly, + _dart_sqlite3_db_readonly>('sqlite3_db_readonly'))( db, zDbName, ); } - _dart_sqlite3_db_readonly _sqlite3_db_readonly; + _dart_sqlite3_db_readonly? _sqlite3_db_readonly; /// CAPI3REF: Find the next prepared statement /// METHOD: sqlite3 @@ -5757,16 +5648,15 @@ class SQLite { ffi.Pointer pDb, ffi.Pointer pStmt, ) { - _sqlite3_next_stmt ??= + return (_sqlite3_next_stmt ??= _dylib.lookupFunction<_c_sqlite3_next_stmt, _dart_sqlite3_next_stmt>( - 'sqlite3_next_stmt'); - return _sqlite3_next_stmt( + 'sqlite3_next_stmt'))( pDb, pStmt, ); } - _dart_sqlite3_next_stmt _sqlite3_next_stmt; + _dart_sqlite3_next_stmt? _sqlite3_next_stmt; /// CAPI3REF: Commit And Rollback Notification Callbacks /// METHOD: sqlite3 @@ -5818,32 +5708,32 @@ class SQLite { ffi.Pointer> arg1, ffi.Pointer arg2, ) { - _sqlite3_commit_hook ??= _dylib.lookupFunction<_c_sqlite3_commit_hook, - _dart_sqlite3_commit_hook>('sqlite3_commit_hook'); - return _sqlite3_commit_hook( + return (_sqlite3_commit_hook ??= _dylib.lookupFunction< + _c_sqlite3_commit_hook, + _dart_sqlite3_commit_hook>('sqlite3_commit_hook'))( arg0, arg1, arg2, ); } - _dart_sqlite3_commit_hook _sqlite3_commit_hook; + _dart_sqlite3_commit_hook? _sqlite3_commit_hook; ffi.Pointer sqlite3_rollback_hook( ffi.Pointer arg0, ffi.Pointer> arg1, ffi.Pointer arg2, ) { - _sqlite3_rollback_hook ??= _dylib.lookupFunction<_c_sqlite3_rollback_hook, - _dart_sqlite3_rollback_hook>('sqlite3_rollback_hook'); - return _sqlite3_rollback_hook( + return (_sqlite3_rollback_hook ??= _dylib.lookupFunction< + _c_sqlite3_rollback_hook, + _dart_sqlite3_rollback_hook>('sqlite3_rollback_hook'))( arg0, arg1, arg2, ); } - _dart_sqlite3_rollback_hook _sqlite3_rollback_hook; + _dart_sqlite3_rollback_hook? _sqlite3_rollback_hook; /// CAPI3REF: Data Change Notification Callbacks /// METHOD: sqlite3 @@ -5897,16 +5787,16 @@ class SQLite { ffi.Pointer> arg1, ffi.Pointer arg2, ) { - _sqlite3_update_hook ??= _dylib.lookupFunction<_c_sqlite3_update_hook, - _dart_sqlite3_update_hook>('sqlite3_update_hook'); - return _sqlite3_update_hook( + return (_sqlite3_update_hook ??= _dylib.lookupFunction< + _c_sqlite3_update_hook, + _dart_sqlite3_update_hook>('sqlite3_update_hook'))( arg0, arg1, arg2, ); } - _dart_sqlite3_update_hook _sqlite3_update_hook; + _dart_sqlite3_update_hook? _sqlite3_update_hook; /// CAPI3REF: Enable Or Disable Shared Pager Cache /// @@ -5948,15 +5838,14 @@ class SQLite { int sqlite3_enable_shared_cache( int arg0, ) { - _sqlite3_enable_shared_cache ??= _dylib.lookupFunction< + return (_sqlite3_enable_shared_cache ??= _dylib.lookupFunction< _c_sqlite3_enable_shared_cache, - _dart_sqlite3_enable_shared_cache>('sqlite3_enable_shared_cache'); - return _sqlite3_enable_shared_cache( + _dart_sqlite3_enable_shared_cache>('sqlite3_enable_shared_cache'))( arg0, ); } - _dart_sqlite3_enable_shared_cache _sqlite3_enable_shared_cache; + _dart_sqlite3_enable_shared_cache? _sqlite3_enable_shared_cache; /// CAPI3REF: Attempt To Free Heap Memory /// @@ -5973,14 +5862,14 @@ class SQLite { int sqlite3_release_memory( int arg0, ) { - _sqlite3_release_memory ??= _dylib.lookupFunction<_c_sqlite3_release_memory, - _dart_sqlite3_release_memory>('sqlite3_release_memory'); - return _sqlite3_release_memory( + return (_sqlite3_release_memory ??= _dylib.lookupFunction< + _c_sqlite3_release_memory, + _dart_sqlite3_release_memory>('sqlite3_release_memory'))( arg0, ); } - _dart_sqlite3_release_memory _sqlite3_release_memory; + _dart_sqlite3_release_memory? _sqlite3_release_memory; /// CAPI3REF: Free Memory Used By A Database Connection /// METHOD: sqlite3 @@ -5995,15 +5884,14 @@ class SQLite { int sqlite3_db_release_memory( ffi.Pointer arg0, ) { - _sqlite3_db_release_memory ??= _dylib.lookupFunction< + return (_sqlite3_db_release_memory ??= _dylib.lookupFunction< _c_sqlite3_db_release_memory, - _dart_sqlite3_db_release_memory>('sqlite3_db_release_memory'); - return _sqlite3_db_release_memory( + _dart_sqlite3_db_release_memory>('sqlite3_db_release_memory'))( arg0, ); } - _dart_sqlite3_db_release_memory _sqlite3_db_release_memory; + _dart_sqlite3_db_release_memory? _sqlite3_db_release_memory; /// CAPI3REF: Impose A Limit On Heap Size /// @@ -6070,28 +5958,26 @@ class SQLite { int sqlite3_soft_heap_limit64( int N, ) { - _sqlite3_soft_heap_limit64 ??= _dylib.lookupFunction< + return (_sqlite3_soft_heap_limit64 ??= _dylib.lookupFunction< _c_sqlite3_soft_heap_limit64, - _dart_sqlite3_soft_heap_limit64>('sqlite3_soft_heap_limit64'); - return _sqlite3_soft_heap_limit64( + _dart_sqlite3_soft_heap_limit64>('sqlite3_soft_heap_limit64'))( N, ); } - _dart_sqlite3_soft_heap_limit64 _sqlite3_soft_heap_limit64; + _dart_sqlite3_soft_heap_limit64? _sqlite3_soft_heap_limit64; int sqlite3_hard_heap_limit64( int N, ) { - _sqlite3_hard_heap_limit64 ??= _dylib.lookupFunction< + return (_sqlite3_hard_heap_limit64 ??= _dylib.lookupFunction< _c_sqlite3_hard_heap_limit64, - _dart_sqlite3_hard_heap_limit64>('sqlite3_hard_heap_limit64'); - return _sqlite3_hard_heap_limit64( + _dart_sqlite3_hard_heap_limit64>('sqlite3_hard_heap_limit64'))( N, ); } - _dart_sqlite3_hard_heap_limit64 _sqlite3_hard_heap_limit64; + _dart_sqlite3_hard_heap_limit64? _sqlite3_hard_heap_limit64; /// CAPI3REF: Deprecated Soft Heap Limit Interface /// DEPRECATED @@ -6103,15 +5989,14 @@ class SQLite { void sqlite3_soft_heap_limit( int N, ) { - _sqlite3_soft_heap_limit ??= _dylib.lookupFunction< + return (_sqlite3_soft_heap_limit ??= _dylib.lookupFunction< _c_sqlite3_soft_heap_limit, - _dart_sqlite3_soft_heap_limit>('sqlite3_soft_heap_limit'); - return _sqlite3_soft_heap_limit( + _dart_sqlite3_soft_heap_limit>('sqlite3_soft_heap_limit'))( N, ); } - _dart_sqlite3_soft_heap_limit _sqlite3_soft_heap_limit; + _dart_sqlite3_soft_heap_limit? _sqlite3_soft_heap_limit; /// CAPI3REF: Extract Metadata About A Column Of A Table /// METHOD: sqlite3 @@ -6191,10 +6076,9 @@ class SQLite { ffi.Pointer pPrimaryKey, ffi.Pointer pAutoinc, ) { - _sqlite3_table_column_metadata ??= _dylib.lookupFunction< + return (_sqlite3_table_column_metadata ??= _dylib.lookupFunction< _c_sqlite3_table_column_metadata, - _dart_sqlite3_table_column_metadata>('sqlite3_table_column_metadata'); - return _sqlite3_table_column_metadata( + _dart_sqlite3_table_column_metadata>('sqlite3_table_column_metadata'))( db, zDbName, zTableName, @@ -6207,7 +6091,7 @@ class SQLite { ); } - _dart_sqlite3_table_column_metadata _sqlite3_table_column_metadata; + _dart_sqlite3_table_column_metadata? _sqlite3_table_column_metadata; /// CAPI3REF: Load An Extension /// METHOD: sqlite3 @@ -6257,9 +6141,9 @@ class SQLite { ffi.Pointer zProc, ffi.Pointer> pzErrMsg, ) { - _sqlite3_load_extension ??= _dylib.lookupFunction<_c_sqlite3_load_extension, - _dart_sqlite3_load_extension>('sqlite3_load_extension'); - return _sqlite3_load_extension( + return (_sqlite3_load_extension ??= _dylib.lookupFunction< + _c_sqlite3_load_extension, + _dart_sqlite3_load_extension>('sqlite3_load_extension'))( db, zFile, zProc, @@ -6267,7 +6151,7 @@ class SQLite { ); } - _dart_sqlite3_load_extension _sqlite3_load_extension; + _dart_sqlite3_load_extension? _sqlite3_load_extension; /// CAPI3REF: Enable Or Disable Extension Loading /// METHOD: sqlite3 @@ -6296,16 +6180,15 @@ class SQLite { ffi.Pointer db, int onoff, ) { - _sqlite3_enable_load_extension ??= _dylib.lookupFunction< + return (_sqlite3_enable_load_extension ??= _dylib.lookupFunction< _c_sqlite3_enable_load_extension, - _dart_sqlite3_enable_load_extension>('sqlite3_enable_load_extension'); - return _sqlite3_enable_load_extension( + _dart_sqlite3_enable_load_extension>('sqlite3_enable_load_extension'))( db, onoff, ); } - _dart_sqlite3_enable_load_extension _sqlite3_enable_load_extension; + _dart_sqlite3_enable_load_extension? _sqlite3_enable_load_extension; /// CAPI3REF: Automatically Load Statically Linked Extensions /// @@ -6344,14 +6227,14 @@ class SQLite { int sqlite3_auto_extension( ffi.Pointer> xEntryPoint, ) { - _sqlite3_auto_extension ??= _dylib.lookupFunction<_c_sqlite3_auto_extension, - _dart_sqlite3_auto_extension>('sqlite3_auto_extension'); - return _sqlite3_auto_extension( + return (_sqlite3_auto_extension ??= _dylib.lookupFunction< + _c_sqlite3_auto_extension, + _dart_sqlite3_auto_extension>('sqlite3_auto_extension'))( xEntryPoint, ); } - _dart_sqlite3_auto_extension _sqlite3_auto_extension; + _dart_sqlite3_auto_extension? _sqlite3_auto_extension; /// CAPI3REF: Cancel Automatic Extension Loading /// @@ -6364,28 +6247,26 @@ class SQLite { int sqlite3_cancel_auto_extension( ffi.Pointer> xEntryPoint, ) { - _sqlite3_cancel_auto_extension ??= _dylib.lookupFunction< + return (_sqlite3_cancel_auto_extension ??= _dylib.lookupFunction< _c_sqlite3_cancel_auto_extension, - _dart_sqlite3_cancel_auto_extension>('sqlite3_cancel_auto_extension'); - return _sqlite3_cancel_auto_extension( + _dart_sqlite3_cancel_auto_extension>('sqlite3_cancel_auto_extension'))( xEntryPoint, ); } - _dart_sqlite3_cancel_auto_extension _sqlite3_cancel_auto_extension; + _dart_sqlite3_cancel_auto_extension? _sqlite3_cancel_auto_extension; /// CAPI3REF: Reset Automatic Extension Loading /// /// ^This interface disables all automatic extensions previously /// registered using [sqlite3_auto_extension()]. void sqlite3_reset_auto_extension() { - _sqlite3_reset_auto_extension ??= _dylib.lookupFunction< + return (_sqlite3_reset_auto_extension ??= _dylib.lookupFunction< _c_sqlite3_reset_auto_extension, - _dart_sqlite3_reset_auto_extension>('sqlite3_reset_auto_extension'); - return _sqlite3_reset_auto_extension(); + _dart_sqlite3_reset_auto_extension>('sqlite3_reset_auto_extension'))(); } - _dart_sqlite3_reset_auto_extension _sqlite3_reset_auto_extension; + _dart_sqlite3_reset_auto_extension? _sqlite3_reset_auto_extension; /// CAPI3REF: Register A Virtual Table Implementation /// METHOD: sqlite3 @@ -6423,9 +6304,9 @@ class SQLite { ffi.Pointer p, ffi.Pointer pClientData, ) { - _sqlite3_create_module ??= _dylib.lookupFunction<_c_sqlite3_create_module, - _dart_sqlite3_create_module>('sqlite3_create_module'); - return _sqlite3_create_module( + return (_sqlite3_create_module ??= _dylib.lookupFunction< + _c_sqlite3_create_module, + _dart_sqlite3_create_module>('sqlite3_create_module'))( db, zName, p, @@ -6433,7 +6314,7 @@ class SQLite { ); } - _dart_sqlite3_create_module _sqlite3_create_module; + _dart_sqlite3_create_module? _sqlite3_create_module; int sqlite3_create_module_v2( ffi.Pointer db, @@ -6442,10 +6323,9 @@ class SQLite { ffi.Pointer pClientData, ffi.Pointer> xDestroy, ) { - _sqlite3_create_module_v2 ??= _dylib.lookupFunction< + return (_sqlite3_create_module_v2 ??= _dylib.lookupFunction< _c_sqlite3_create_module_v2, - _dart_sqlite3_create_module_v2>('sqlite3_create_module_v2'); - return _sqlite3_create_module_v2( + _dart_sqlite3_create_module_v2>('sqlite3_create_module_v2'))( db, zName, p, @@ -6454,7 +6334,7 @@ class SQLite { ); } - _dart_sqlite3_create_module_v2 _sqlite3_create_module_v2; + _dart_sqlite3_create_module_v2? _sqlite3_create_module_v2; /// CAPI3REF: Remove Unnecessary Virtual Table Implementations /// METHOD: sqlite3 @@ -6470,15 +6350,15 @@ class SQLite { ffi.Pointer db, ffi.Pointer> azKeep, ) { - _sqlite3_drop_modules ??= _dylib.lookupFunction<_c_sqlite3_drop_modules, - _dart_sqlite3_drop_modules>('sqlite3_drop_modules'); - return _sqlite3_drop_modules( + return (_sqlite3_drop_modules ??= _dylib.lookupFunction< + _c_sqlite3_drop_modules, + _dart_sqlite3_drop_modules>('sqlite3_drop_modules'))( db, azKeep, ); } - _dart_sqlite3_drop_modules _sqlite3_drop_modules; + _dart_sqlite3_drop_modules? _sqlite3_drop_modules; /// CAPI3REF: Declare The Schema Of A Virtual Table /// @@ -6490,15 +6370,15 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer zSQL, ) { - _sqlite3_declare_vtab ??= _dylib.lookupFunction<_c_sqlite3_declare_vtab, - _dart_sqlite3_declare_vtab>('sqlite3_declare_vtab'); - return _sqlite3_declare_vtab( + return (_sqlite3_declare_vtab ??= _dylib.lookupFunction< + _c_sqlite3_declare_vtab, + _dart_sqlite3_declare_vtab>('sqlite3_declare_vtab'))( arg0, zSQL, ); } - _dart_sqlite3_declare_vtab _sqlite3_declare_vtab; + _dart_sqlite3_declare_vtab? _sqlite3_declare_vtab; /// CAPI3REF: Overload A Function For A Virtual Table /// METHOD: sqlite3 @@ -6520,17 +6400,16 @@ class SQLite { ffi.Pointer zFuncName, int nArg, ) { - _sqlite3_overload_function ??= _dylib.lookupFunction< + return (_sqlite3_overload_function ??= _dylib.lookupFunction< _c_sqlite3_overload_function, - _dart_sqlite3_overload_function>('sqlite3_overload_function'); - return _sqlite3_overload_function( + _dart_sqlite3_overload_function>('sqlite3_overload_function'))( arg0, zFuncName, nArg, ); } - _dart_sqlite3_overload_function _sqlite3_overload_function; + _dart_sqlite3_overload_function? _sqlite3_overload_function; /// CAPI3REF: Open A BLOB For Incremental I/O /// METHOD: sqlite3 @@ -6622,10 +6501,9 @@ class SQLite { int flags, ffi.Pointer> ppBlob, ) { - _sqlite3_blob_open ??= + return (_sqlite3_blob_open ??= _dylib.lookupFunction<_c_sqlite3_blob_open, _dart_sqlite3_blob_open>( - 'sqlite3_blob_open'); - return _sqlite3_blob_open( + 'sqlite3_blob_open'))( arg0, zDb, zTable, @@ -6636,7 +6514,7 @@ class SQLite { ); } - _dart_sqlite3_blob_open _sqlite3_blob_open; + _dart_sqlite3_blob_open? _sqlite3_blob_open; /// CAPI3REF: Move a BLOB Handle to a New Row /// METHOD: sqlite3_blob @@ -6663,15 +6541,15 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - _sqlite3_blob_reopen ??= _dylib.lookupFunction<_c_sqlite3_blob_reopen, - _dart_sqlite3_blob_reopen>('sqlite3_blob_reopen'); - return _sqlite3_blob_reopen( + return (_sqlite3_blob_reopen ??= _dylib.lookupFunction< + _c_sqlite3_blob_reopen, + _dart_sqlite3_blob_reopen>('sqlite3_blob_reopen'))( arg0, arg1, ); } - _dart_sqlite3_blob_reopen _sqlite3_blob_reopen; + _dart_sqlite3_blob_reopen? _sqlite3_blob_reopen; /// CAPI3REF: Close A BLOB Handle /// DESTRUCTOR: sqlite3_blob @@ -6695,15 +6573,14 @@ class SQLite { int sqlite3_blob_close( ffi.Pointer arg0, ) { - _sqlite3_blob_close ??= + return (_sqlite3_blob_close ??= _dylib.lookupFunction<_c_sqlite3_blob_close, _dart_sqlite3_blob_close>( - 'sqlite3_blob_close'); - return _sqlite3_blob_close( + 'sqlite3_blob_close'))( arg0, ); } - _dart_sqlite3_blob_close _sqlite3_blob_close; + _dart_sqlite3_blob_close? _sqlite3_blob_close; /// CAPI3REF: Return The Size Of An Open BLOB /// METHOD: sqlite3_blob @@ -6720,15 +6597,14 @@ class SQLite { int sqlite3_blob_bytes( ffi.Pointer arg0, ) { - _sqlite3_blob_bytes ??= + return (_sqlite3_blob_bytes ??= _dylib.lookupFunction<_c_sqlite3_blob_bytes, _dart_sqlite3_blob_bytes>( - 'sqlite3_blob_bytes'); - return _sqlite3_blob_bytes( + 'sqlite3_blob_bytes'))( arg0, ); } - _dart_sqlite3_blob_bytes _sqlite3_blob_bytes; + _dart_sqlite3_blob_bytes? _sqlite3_blob_bytes; /// CAPI3REF: Read Data From A BLOB Incrementally /// METHOD: sqlite3_blob @@ -6761,10 +6637,9 @@ class SQLite { int N, int iOffset, ) { - _sqlite3_blob_read ??= + return (_sqlite3_blob_read ??= _dylib.lookupFunction<_c_sqlite3_blob_read, _dart_sqlite3_blob_read>( - 'sqlite3_blob_read'); - return _sqlite3_blob_read( + 'sqlite3_blob_read'))( arg0, Z, N, @@ -6772,7 +6647,7 @@ class SQLite { ); } - _dart_sqlite3_blob_read _sqlite3_blob_read; + _dart_sqlite3_blob_read? _sqlite3_blob_read; /// CAPI3REF: Write Data Into A BLOB Incrementally /// METHOD: sqlite3_blob @@ -6818,10 +6693,9 @@ class SQLite { int n, int iOffset, ) { - _sqlite3_blob_write ??= + return (_sqlite3_blob_write ??= _dylib.lookupFunction<_c_sqlite3_blob_write, _dart_sqlite3_blob_write>( - 'sqlite3_blob_write'); - return _sqlite3_blob_write( + 'sqlite3_blob_write'))( arg0, z, n, @@ -6829,7 +6703,7 @@ class SQLite { ); } - _dart_sqlite3_blob_write _sqlite3_blob_write; + _dart_sqlite3_blob_write? _sqlite3_blob_write; /// CAPI3REF: Virtual File System Objects /// @@ -6861,41 +6735,40 @@ class SQLite { ffi.Pointer sqlite3_vfs_find( ffi.Pointer zVfsName, ) { - _sqlite3_vfs_find ??= + return (_sqlite3_vfs_find ??= _dylib.lookupFunction<_c_sqlite3_vfs_find, _dart_sqlite3_vfs_find>( - 'sqlite3_vfs_find'); - return _sqlite3_vfs_find( + 'sqlite3_vfs_find'))( zVfsName, ); } - _dart_sqlite3_vfs_find _sqlite3_vfs_find; + _dart_sqlite3_vfs_find? _sqlite3_vfs_find; int sqlite3_vfs_register( ffi.Pointer arg0, int makeDflt, ) { - _sqlite3_vfs_register ??= _dylib.lookupFunction<_c_sqlite3_vfs_register, - _dart_sqlite3_vfs_register>('sqlite3_vfs_register'); - return _sqlite3_vfs_register( + return (_sqlite3_vfs_register ??= _dylib.lookupFunction< + _c_sqlite3_vfs_register, + _dart_sqlite3_vfs_register>('sqlite3_vfs_register'))( arg0, makeDflt, ); } - _dart_sqlite3_vfs_register _sqlite3_vfs_register; + _dart_sqlite3_vfs_register? _sqlite3_vfs_register; int sqlite3_vfs_unregister( ffi.Pointer arg0, ) { - _sqlite3_vfs_unregister ??= _dylib.lookupFunction<_c_sqlite3_vfs_unregister, - _dart_sqlite3_vfs_unregister>('sqlite3_vfs_unregister'); - return _sqlite3_vfs_unregister( + return (_sqlite3_vfs_unregister ??= _dylib.lookupFunction< + _c_sqlite3_vfs_unregister, + _dart_sqlite3_vfs_unregister>('sqlite3_vfs_unregister'))( arg0, ); } - _dart_sqlite3_vfs_unregister _sqlite3_vfs_unregister; + _dart_sqlite3_vfs_unregister? _sqlite3_vfs_unregister; /// CAPI3REF: Mutexes /// @@ -7012,89 +6885,86 @@ class SQLite { ffi.Pointer sqlite3_mutex_alloc( int arg0, ) { - _sqlite3_mutex_alloc ??= _dylib.lookupFunction<_c_sqlite3_mutex_alloc, - _dart_sqlite3_mutex_alloc>('sqlite3_mutex_alloc'); - return _sqlite3_mutex_alloc( + return (_sqlite3_mutex_alloc ??= _dylib.lookupFunction< + _c_sqlite3_mutex_alloc, + _dart_sqlite3_mutex_alloc>('sqlite3_mutex_alloc'))( arg0, ); } - _dart_sqlite3_mutex_alloc _sqlite3_mutex_alloc; + _dart_sqlite3_mutex_alloc? _sqlite3_mutex_alloc; void sqlite3_mutex_free( ffi.Pointer arg0, ) { - _sqlite3_mutex_free ??= + return (_sqlite3_mutex_free ??= _dylib.lookupFunction<_c_sqlite3_mutex_free, _dart_sqlite3_mutex_free>( - 'sqlite3_mutex_free'); - return _sqlite3_mutex_free( + 'sqlite3_mutex_free'))( arg0, ); } - _dart_sqlite3_mutex_free _sqlite3_mutex_free; + _dart_sqlite3_mutex_free? _sqlite3_mutex_free; void sqlite3_mutex_enter( ffi.Pointer arg0, ) { - _sqlite3_mutex_enter ??= _dylib.lookupFunction<_c_sqlite3_mutex_enter, - _dart_sqlite3_mutex_enter>('sqlite3_mutex_enter'); - return _sqlite3_mutex_enter( + return (_sqlite3_mutex_enter ??= _dylib.lookupFunction< + _c_sqlite3_mutex_enter, + _dart_sqlite3_mutex_enter>('sqlite3_mutex_enter'))( arg0, ); } - _dart_sqlite3_mutex_enter _sqlite3_mutex_enter; + _dart_sqlite3_mutex_enter? _sqlite3_mutex_enter; int sqlite3_mutex_try( ffi.Pointer arg0, ) { - _sqlite3_mutex_try ??= + return (_sqlite3_mutex_try ??= _dylib.lookupFunction<_c_sqlite3_mutex_try, _dart_sqlite3_mutex_try>( - 'sqlite3_mutex_try'); - return _sqlite3_mutex_try( + 'sqlite3_mutex_try'))( arg0, ); } - _dart_sqlite3_mutex_try _sqlite3_mutex_try; + _dart_sqlite3_mutex_try? _sqlite3_mutex_try; void sqlite3_mutex_leave( ffi.Pointer arg0, ) { - _sqlite3_mutex_leave ??= _dylib.lookupFunction<_c_sqlite3_mutex_leave, - _dart_sqlite3_mutex_leave>('sqlite3_mutex_leave'); - return _sqlite3_mutex_leave( + return (_sqlite3_mutex_leave ??= _dylib.lookupFunction< + _c_sqlite3_mutex_leave, + _dart_sqlite3_mutex_leave>('sqlite3_mutex_leave'))( arg0, ); } - _dart_sqlite3_mutex_leave _sqlite3_mutex_leave; + _dart_sqlite3_mutex_leave? _sqlite3_mutex_leave; int sqlite3_mutex_held( ffi.Pointer arg0, ) { - _sqlite3_mutex_held ??= + return (_sqlite3_mutex_held ??= _dylib.lookupFunction<_c_sqlite3_mutex_held, _dart_sqlite3_mutex_held>( - 'sqlite3_mutex_held'); - return _sqlite3_mutex_held( + 'sqlite3_mutex_held'))( arg0, ); } - _dart_sqlite3_mutex_held _sqlite3_mutex_held; + _dart_sqlite3_mutex_held? _sqlite3_mutex_held; int sqlite3_mutex_notheld( ffi.Pointer arg0, ) { - _sqlite3_mutex_notheld ??= _dylib.lookupFunction<_c_sqlite3_mutex_notheld, - _dart_sqlite3_mutex_notheld>('sqlite3_mutex_notheld'); - return _sqlite3_mutex_notheld( + return (_sqlite3_mutex_notheld ??= _dylib.lookupFunction< + _c_sqlite3_mutex_notheld, + _dart_sqlite3_mutex_notheld>('sqlite3_mutex_notheld'))( arg0, ); } - _dart_sqlite3_mutex_notheld _sqlite3_mutex_notheld; + _dart_sqlite3_mutex_notheld? _sqlite3_mutex_notheld; /// CAPI3REF: Retrieve the mutex for a database connection /// METHOD: sqlite3 @@ -7107,15 +6977,14 @@ class SQLite { ffi.Pointer sqlite3_db_mutex( ffi.Pointer arg0, ) { - _sqlite3_db_mutex ??= + return (_sqlite3_db_mutex ??= _dylib.lookupFunction<_c_sqlite3_db_mutex, _dart_sqlite3_db_mutex>( - 'sqlite3_db_mutex'); - return _sqlite3_db_mutex( + 'sqlite3_db_mutex'))( arg0, ); } - _dart_sqlite3_db_mutex _sqlite3_db_mutex; + _dart_sqlite3_db_mutex? _sqlite3_db_mutex; /// CAPI3REF: Low-Level Control Of Database Files /// METHOD: sqlite3 @@ -7162,9 +7031,9 @@ class SQLite { int op, ffi.Pointer arg3, ) { - _sqlite3_file_control ??= _dylib.lookupFunction<_c_sqlite3_file_control, - _dart_sqlite3_file_control>('sqlite3_file_control'); - return _sqlite3_file_control( + return (_sqlite3_file_control ??= _dylib.lookupFunction< + _c_sqlite3_file_control, + _dart_sqlite3_file_control>('sqlite3_file_control'))( arg0, zDbName, op, @@ -7172,7 +7041,7 @@ class SQLite { ); } - _dart_sqlite3_file_control _sqlite3_file_control; + _dart_sqlite3_file_control? _sqlite3_file_control; /// CAPI3REF: Testing Interface /// @@ -7192,14 +7061,14 @@ class SQLite { int sqlite3_test_control( int op, ) { - _sqlite3_test_control ??= _dylib.lookupFunction<_c_sqlite3_test_control, - _dart_sqlite3_test_control>('sqlite3_test_control'); - return _sqlite3_test_control( + return (_sqlite3_test_control ??= _dylib.lookupFunction< + _c_sqlite3_test_control, + _dart_sqlite3_test_control>('sqlite3_test_control'))( op, ); } - _dart_sqlite3_test_control _sqlite3_test_control; + _dart_sqlite3_test_control? _sqlite3_test_control; /// CAPI3REF: SQL Keyword Checking /// @@ -7247,42 +7116,42 @@ class SQLite { /// SQLite is compiled with the [-DSQLITE_OMIT_VACUUM] option. Also, /// new keywords may be added to future releases of SQLite. int sqlite3_keyword_count() { - _sqlite3_keyword_count ??= _dylib.lookupFunction<_c_sqlite3_keyword_count, - _dart_sqlite3_keyword_count>('sqlite3_keyword_count'); - return _sqlite3_keyword_count(); + return (_sqlite3_keyword_count ??= _dylib.lookupFunction< + _c_sqlite3_keyword_count, + _dart_sqlite3_keyword_count>('sqlite3_keyword_count'))(); } - _dart_sqlite3_keyword_count _sqlite3_keyword_count; + _dart_sqlite3_keyword_count? _sqlite3_keyword_count; int sqlite3_keyword_name( int arg0, ffi.Pointer> arg1, ffi.Pointer arg2, ) { - _sqlite3_keyword_name ??= _dylib.lookupFunction<_c_sqlite3_keyword_name, - _dart_sqlite3_keyword_name>('sqlite3_keyword_name'); - return _sqlite3_keyword_name( + return (_sqlite3_keyword_name ??= _dylib.lookupFunction< + _c_sqlite3_keyword_name, + _dart_sqlite3_keyword_name>('sqlite3_keyword_name'))( arg0, arg1, arg2, ); } - _dart_sqlite3_keyword_name _sqlite3_keyword_name; + _dart_sqlite3_keyword_name? _sqlite3_keyword_name; int sqlite3_keyword_check( ffi.Pointer arg0, int arg1, ) { - _sqlite3_keyword_check ??= _dylib.lookupFunction<_c_sqlite3_keyword_check, - _dart_sqlite3_keyword_check>('sqlite3_keyword_check'); - return _sqlite3_keyword_check( + return (_sqlite3_keyword_check ??= _dylib.lookupFunction< + _c_sqlite3_keyword_check, + _dart_sqlite3_keyword_check>('sqlite3_keyword_check'))( arg0, arg1, ); } - _dart_sqlite3_keyword_check _sqlite3_keyword_check; + _dart_sqlite3_keyword_check? _sqlite3_keyword_check; /// CAPI3REF: Create A New Dynamic String Object /// CONSTRUCTOR: sqlite3_str @@ -7310,15 +7179,14 @@ class SQLite { ffi.Pointer sqlite3_str_new( ffi.Pointer arg0, ) { - _sqlite3_str_new ??= + return (_sqlite3_str_new ??= _dylib.lookupFunction<_c_sqlite3_str_new, _dart_sqlite3_str_new>( - 'sqlite3_str_new'); - return _sqlite3_str_new( + 'sqlite3_str_new'))( arg0, ); } - _dart_sqlite3_str_new _sqlite3_str_new; + _dart_sqlite3_str_new? _sqlite3_str_new; /// CAPI3REF: Finalize A Dynamic String /// DESTRUCTOR: sqlite3_str @@ -7334,15 +7202,14 @@ class SQLite { ffi.Pointer sqlite3_str_finish( ffi.Pointer arg0, ) { - _sqlite3_str_finish ??= + return (_sqlite3_str_finish ??= _dylib.lookupFunction<_c_sqlite3_str_finish, _dart_sqlite3_str_finish>( - 'sqlite3_str_finish'); - return _sqlite3_str_finish( + 'sqlite3_str_finish'))( arg0, ); } - _dart_sqlite3_str_finish _sqlite3_str_finish; + _dart_sqlite3_str_finish? _sqlite3_str_finish; /// CAPI3REF: Add Content To A Dynamic String /// METHOD: sqlite3_str @@ -7378,75 +7245,73 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer zFormat, ) { - _sqlite3_str_appendf ??= _dylib.lookupFunction<_c_sqlite3_str_appendf, - _dart_sqlite3_str_appendf>('sqlite3_str_appendf'); - return _sqlite3_str_appendf( + return (_sqlite3_str_appendf ??= _dylib.lookupFunction< + _c_sqlite3_str_appendf, + _dart_sqlite3_str_appendf>('sqlite3_str_appendf'))( arg0, zFormat, ); } - _dart_sqlite3_str_appendf _sqlite3_str_appendf; + _dart_sqlite3_str_appendf? _sqlite3_str_appendf; void sqlite3_str_append( ffi.Pointer arg0, ffi.Pointer zIn, int N, ) { - _sqlite3_str_append ??= + return (_sqlite3_str_append ??= _dylib.lookupFunction<_c_sqlite3_str_append, _dart_sqlite3_str_append>( - 'sqlite3_str_append'); - return _sqlite3_str_append( + 'sqlite3_str_append'))( arg0, zIn, N, ); } - _dart_sqlite3_str_append _sqlite3_str_append; + _dart_sqlite3_str_append? _sqlite3_str_append; void sqlite3_str_appendall( ffi.Pointer arg0, ffi.Pointer zIn, ) { - _sqlite3_str_appendall ??= _dylib.lookupFunction<_c_sqlite3_str_appendall, - _dart_sqlite3_str_appendall>('sqlite3_str_appendall'); - return _sqlite3_str_appendall( + return (_sqlite3_str_appendall ??= _dylib.lookupFunction< + _c_sqlite3_str_appendall, + _dart_sqlite3_str_appendall>('sqlite3_str_appendall'))( arg0, zIn, ); } - _dart_sqlite3_str_appendall _sqlite3_str_appendall; + _dart_sqlite3_str_appendall? _sqlite3_str_appendall; void sqlite3_str_appendchar( ffi.Pointer arg0, int N, int C, ) { - _sqlite3_str_appendchar ??= _dylib.lookupFunction<_c_sqlite3_str_appendchar, - _dart_sqlite3_str_appendchar>('sqlite3_str_appendchar'); - return _sqlite3_str_appendchar( + return (_sqlite3_str_appendchar ??= _dylib.lookupFunction< + _c_sqlite3_str_appendchar, + _dart_sqlite3_str_appendchar>('sqlite3_str_appendchar'))( arg0, N, C, ); } - _dart_sqlite3_str_appendchar _sqlite3_str_appendchar; + _dart_sqlite3_str_appendchar? _sqlite3_str_appendchar; void sqlite3_str_reset( ffi.Pointer arg0, ) { - _sqlite3_str_reset ??= + return (_sqlite3_str_reset ??= _dylib.lookupFunction<_c_sqlite3_str_reset, _dart_sqlite3_str_reset>( - 'sqlite3_str_reset'); - return _sqlite3_str_reset( + 'sqlite3_str_reset'))( arg0, ); } - _dart_sqlite3_str_reset _sqlite3_str_reset; + _dart_sqlite3_str_reset? _sqlite3_str_reset; /// CAPI3REF: Status Of A Dynamic String /// METHOD: sqlite3_str @@ -7478,40 +7343,38 @@ class SQLite { int sqlite3_str_errcode( ffi.Pointer arg0, ) { - _sqlite3_str_errcode ??= _dylib.lookupFunction<_c_sqlite3_str_errcode, - _dart_sqlite3_str_errcode>('sqlite3_str_errcode'); - return _sqlite3_str_errcode( + return (_sqlite3_str_errcode ??= _dylib.lookupFunction< + _c_sqlite3_str_errcode, + _dart_sqlite3_str_errcode>('sqlite3_str_errcode'))( arg0, ); } - _dart_sqlite3_str_errcode _sqlite3_str_errcode; + _dart_sqlite3_str_errcode? _sqlite3_str_errcode; int sqlite3_str_length( ffi.Pointer arg0, ) { - _sqlite3_str_length ??= + return (_sqlite3_str_length ??= _dylib.lookupFunction<_c_sqlite3_str_length, _dart_sqlite3_str_length>( - 'sqlite3_str_length'); - return _sqlite3_str_length( + 'sqlite3_str_length'))( arg0, ); } - _dart_sqlite3_str_length _sqlite3_str_length; + _dart_sqlite3_str_length? _sqlite3_str_length; ffi.Pointer sqlite3_str_value( ffi.Pointer arg0, ) { - _sqlite3_str_value ??= + return (_sqlite3_str_value ??= _dylib.lookupFunction<_c_sqlite3_str_value, _dart_sqlite3_str_value>( - 'sqlite3_str_value'); - return _sqlite3_str_value( + 'sqlite3_str_value'))( arg0, ); } - _dart_sqlite3_str_value _sqlite3_str_value; + _dart_sqlite3_str_value? _sqlite3_str_value; /// CAPI3REF: SQLite Runtime Status /// @@ -7543,10 +7406,9 @@ class SQLite { ffi.Pointer pHighwater, int resetFlag, ) { - _sqlite3_status ??= + return (_sqlite3_status ??= _dylib.lookupFunction<_c_sqlite3_status, _dart_sqlite3_status>( - 'sqlite3_status'); - return _sqlite3_status( + 'sqlite3_status'))( op, pCurrent, pHighwater, @@ -7554,7 +7416,7 @@ class SQLite { ); } - _dart_sqlite3_status _sqlite3_status; + _dart_sqlite3_status? _sqlite3_status; int sqlite3_status64( int op, @@ -7562,10 +7424,9 @@ class SQLite { ffi.Pointer pHighwater, int resetFlag, ) { - _sqlite3_status64 ??= + return (_sqlite3_status64 ??= _dylib.lookupFunction<_c_sqlite3_status64, _dart_sqlite3_status64>( - 'sqlite3_status64'); - return _sqlite3_status64( + 'sqlite3_status64'))( op, pCurrent, pHighwater, @@ -7573,7 +7434,7 @@ class SQLite { ); } - _dart_sqlite3_status64 _sqlite3_status64; + _dart_sqlite3_status64? _sqlite3_status64; /// CAPI3REF: Database Connection Status /// METHOD: sqlite3 @@ -7603,10 +7464,9 @@ class SQLite { ffi.Pointer pHiwtr, int resetFlg, ) { - _sqlite3_db_status ??= + return (_sqlite3_db_status ??= _dylib.lookupFunction<_c_sqlite3_db_status, _dart_sqlite3_db_status>( - 'sqlite3_db_status'); - return _sqlite3_db_status( + 'sqlite3_db_status'))( arg0, op, pCur, @@ -7615,7 +7475,7 @@ class SQLite { ); } - _dart_sqlite3_db_status _sqlite3_db_status; + _dart_sqlite3_db_status? _sqlite3_db_status; /// CAPI3REF: Prepared Statement Status /// METHOD: sqlite3_stmt @@ -7644,16 +7504,16 @@ class SQLite { int op, int resetFlg, ) { - _sqlite3_stmt_status ??= _dylib.lookupFunction<_c_sqlite3_stmt_status, - _dart_sqlite3_stmt_status>('sqlite3_stmt_status'); - return _sqlite3_stmt_status( + return (_sqlite3_stmt_status ??= _dylib.lookupFunction< + _c_sqlite3_stmt_status, + _dart_sqlite3_stmt_status>('sqlite3_stmt_status'))( arg0, op, resetFlg, ); } - _dart_sqlite3_stmt_status _sqlite3_stmt_status; + _dart_sqlite3_stmt_status? _sqlite3_stmt_status; /// CAPI3REF: Online Backup API. /// @@ -7845,9 +7705,9 @@ class SQLite { ffi.Pointer pSource, ffi.Pointer zSourceName, ) { - _sqlite3_backup_init ??= _dylib.lookupFunction<_c_sqlite3_backup_init, - _dart_sqlite3_backup_init>('sqlite3_backup_init'); - return _sqlite3_backup_init( + return (_sqlite3_backup_init ??= _dylib.lookupFunction< + _c_sqlite3_backup_init, + _dart_sqlite3_backup_init>('sqlite3_backup_init'))( pDest, zDestName, pSource, @@ -7855,59 +7715,57 @@ class SQLite { ); } - _dart_sqlite3_backup_init _sqlite3_backup_init; + _dart_sqlite3_backup_init? _sqlite3_backup_init; int sqlite3_backup_step( ffi.Pointer p, int nPage, ) { - _sqlite3_backup_step ??= _dylib.lookupFunction<_c_sqlite3_backup_step, - _dart_sqlite3_backup_step>('sqlite3_backup_step'); - return _sqlite3_backup_step( + return (_sqlite3_backup_step ??= _dylib.lookupFunction< + _c_sqlite3_backup_step, + _dart_sqlite3_backup_step>('sqlite3_backup_step'))( p, nPage, ); } - _dart_sqlite3_backup_step _sqlite3_backup_step; + _dart_sqlite3_backup_step? _sqlite3_backup_step; int sqlite3_backup_finish( ffi.Pointer p, ) { - _sqlite3_backup_finish ??= _dylib.lookupFunction<_c_sqlite3_backup_finish, - _dart_sqlite3_backup_finish>('sqlite3_backup_finish'); - return _sqlite3_backup_finish( + return (_sqlite3_backup_finish ??= _dylib.lookupFunction< + _c_sqlite3_backup_finish, + _dart_sqlite3_backup_finish>('sqlite3_backup_finish'))( p, ); } - _dart_sqlite3_backup_finish _sqlite3_backup_finish; + _dart_sqlite3_backup_finish? _sqlite3_backup_finish; int sqlite3_backup_remaining( ffi.Pointer p, ) { - _sqlite3_backup_remaining ??= _dylib.lookupFunction< + return (_sqlite3_backup_remaining ??= _dylib.lookupFunction< _c_sqlite3_backup_remaining, - _dart_sqlite3_backup_remaining>('sqlite3_backup_remaining'); - return _sqlite3_backup_remaining( + _dart_sqlite3_backup_remaining>('sqlite3_backup_remaining'))( p, ); } - _dart_sqlite3_backup_remaining _sqlite3_backup_remaining; + _dart_sqlite3_backup_remaining? _sqlite3_backup_remaining; int sqlite3_backup_pagecount( ffi.Pointer p, ) { - _sqlite3_backup_pagecount ??= _dylib.lookupFunction< + return (_sqlite3_backup_pagecount ??= _dylib.lookupFunction< _c_sqlite3_backup_pagecount, - _dart_sqlite3_backup_pagecount>('sqlite3_backup_pagecount'); - return _sqlite3_backup_pagecount( + _dart_sqlite3_backup_pagecount>('sqlite3_backup_pagecount'))( p, ); } - _dart_sqlite3_backup_pagecount _sqlite3_backup_pagecount; + _dart_sqlite3_backup_pagecount? _sqlite3_backup_pagecount; /// CAPI3REF: Unlock Notification /// METHOD: sqlite3 @@ -8027,16 +7885,16 @@ class SQLite { ffi.Pointer> xNotify, ffi.Pointer pNotifyArg, ) { - _sqlite3_unlock_notify ??= _dylib.lookupFunction<_c_sqlite3_unlock_notify, - _dart_sqlite3_unlock_notify>('sqlite3_unlock_notify'); - return _sqlite3_unlock_notify( + return (_sqlite3_unlock_notify ??= _dylib.lookupFunction< + _c_sqlite3_unlock_notify, + _dart_sqlite3_unlock_notify>('sqlite3_unlock_notify'))( pBlocked, xNotify, pNotifyArg, ); } - _dart_sqlite3_unlock_notify _sqlite3_unlock_notify; + _dart_sqlite3_unlock_notify? _sqlite3_unlock_notify; /// CAPI3REF: String Comparison /// @@ -8048,33 +7906,31 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, ) { - _sqlite3_stricmp ??= + return (_sqlite3_stricmp ??= _dylib.lookupFunction<_c_sqlite3_stricmp, _dart_sqlite3_stricmp>( - 'sqlite3_stricmp'); - return _sqlite3_stricmp( + 'sqlite3_stricmp'))( arg0, arg1, ); } - _dart_sqlite3_stricmp _sqlite3_stricmp; + _dart_sqlite3_stricmp? _sqlite3_stricmp; int sqlite3_strnicmp( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, ) { - _sqlite3_strnicmp ??= + return (_sqlite3_strnicmp ??= _dylib.lookupFunction<_c_sqlite3_strnicmp, _dart_sqlite3_strnicmp>( - 'sqlite3_strnicmp'); - return _sqlite3_strnicmp( + 'sqlite3_strnicmp'))( arg0, arg1, arg2, ); } - _dart_sqlite3_strnicmp _sqlite3_strnicmp; + _dart_sqlite3_strnicmp? _sqlite3_strnicmp; /// CAPI3REF: String Globbing /// @@ -8093,16 +7949,15 @@ class SQLite { ffi.Pointer zGlob, ffi.Pointer zStr, ) { - _sqlite3_strglob ??= + return (_sqlite3_strglob ??= _dylib.lookupFunction<_c_sqlite3_strglob, _dart_sqlite3_strglob>( - 'sqlite3_strglob'); - return _sqlite3_strglob( + 'sqlite3_strglob'))( zGlob, zStr, ); } - _dart_sqlite3_strglob _sqlite3_strglob; + _dart_sqlite3_strglob? _sqlite3_strglob; /// CAPI3REF: String LIKE Matching /// @@ -8128,17 +7983,16 @@ class SQLite { ffi.Pointer zStr, int cEsc, ) { - _sqlite3_strlike ??= + return (_sqlite3_strlike ??= _dylib.lookupFunction<_c_sqlite3_strlike, _dart_sqlite3_strlike>( - 'sqlite3_strlike'); - return _sqlite3_strlike( + 'sqlite3_strlike'))( zGlob, zStr, cEsc, ); } - _dart_sqlite3_strlike _sqlite3_strlike; + _dart_sqlite3_strlike? _sqlite3_strlike; /// CAPI3REF: Error Logging Interface /// @@ -8163,15 +8017,14 @@ class SQLite { int iErrCode, ffi.Pointer zFormat, ) { - _sqlite3_log ??= - _dylib.lookupFunction<_c_sqlite3_log, _dart_sqlite3_log>('sqlite3_log'); - return _sqlite3_log( + return (_sqlite3_log ??= _dylib + .lookupFunction<_c_sqlite3_log, _dart_sqlite3_log>('sqlite3_log'))( iErrCode, zFormat, ); } - _dart_sqlite3_log _sqlite3_log; + _dart_sqlite3_log? _sqlite3_log; /// CAPI3REF: Write-Ahead Log Commit Hook /// METHOD: sqlite3 @@ -8210,17 +8063,16 @@ class SQLite { ffi.Pointer> arg1, ffi.Pointer arg2, ) { - _sqlite3_wal_hook ??= + return (_sqlite3_wal_hook ??= _dylib.lookupFunction<_c_sqlite3_wal_hook, _dart_sqlite3_wal_hook>( - 'sqlite3_wal_hook'); - return _sqlite3_wal_hook( + 'sqlite3_wal_hook'))( arg0, arg1, arg2, ); } - _dart_sqlite3_wal_hook _sqlite3_wal_hook; + _dart_sqlite3_wal_hook? _sqlite3_wal_hook; /// CAPI3REF: Configure an auto-checkpoint /// METHOD: sqlite3 @@ -8253,16 +8105,15 @@ class SQLite { ffi.Pointer db, int N, ) { - _sqlite3_wal_autocheckpoint ??= _dylib.lookupFunction< + return (_sqlite3_wal_autocheckpoint ??= _dylib.lookupFunction< _c_sqlite3_wal_autocheckpoint, - _dart_sqlite3_wal_autocheckpoint>('sqlite3_wal_autocheckpoint'); - return _sqlite3_wal_autocheckpoint( + _dart_sqlite3_wal_autocheckpoint>('sqlite3_wal_autocheckpoint'))( db, N, ); } - _dart_sqlite3_wal_autocheckpoint _sqlite3_wal_autocheckpoint; + _dart_sqlite3_wal_autocheckpoint? _sqlite3_wal_autocheckpoint; /// CAPI3REF: Checkpoint a database /// METHOD: sqlite3 @@ -8286,15 +8137,15 @@ class SQLite { ffi.Pointer db, ffi.Pointer zDb, ) { - _sqlite3_wal_checkpoint ??= _dylib.lookupFunction<_c_sqlite3_wal_checkpoint, - _dart_sqlite3_wal_checkpoint>('sqlite3_wal_checkpoint'); - return _sqlite3_wal_checkpoint( + return (_sqlite3_wal_checkpoint ??= _dylib.lookupFunction< + _c_sqlite3_wal_checkpoint, + _dart_sqlite3_wal_checkpoint>('sqlite3_wal_checkpoint'))( db, zDb, ); } - _dart_sqlite3_wal_checkpoint _sqlite3_wal_checkpoint; + _dart_sqlite3_wal_checkpoint? _sqlite3_wal_checkpoint; /// CAPI3REF: Checkpoint a database /// METHOD: sqlite3 @@ -8393,10 +8244,9 @@ class SQLite { ffi.Pointer pnLog, ffi.Pointer pnCkpt, ) { - _sqlite3_wal_checkpoint_v2 ??= _dylib.lookupFunction< + return (_sqlite3_wal_checkpoint_v2 ??= _dylib.lookupFunction< _c_sqlite3_wal_checkpoint_v2, - _dart_sqlite3_wal_checkpoint_v2>('sqlite3_wal_checkpoint_v2'); - return _sqlite3_wal_checkpoint_v2( + _dart_sqlite3_wal_checkpoint_v2>('sqlite3_wal_checkpoint_v2'))( db, zDb, eMode, @@ -8405,7 +8255,7 @@ class SQLite { ); } - _dart_sqlite3_wal_checkpoint_v2 _sqlite3_wal_checkpoint_v2; + _dart_sqlite3_wal_checkpoint_v2? _sqlite3_wal_checkpoint_v2; /// CAPI3REF: Virtual Table Interface Configuration /// @@ -8427,15 +8277,15 @@ class SQLite { ffi.Pointer arg0, int op, ) { - _sqlite3_vtab_config ??= _dylib.lookupFunction<_c_sqlite3_vtab_config, - _dart_sqlite3_vtab_config>('sqlite3_vtab_config'); - return _sqlite3_vtab_config( + return (_sqlite3_vtab_config ??= _dylib.lookupFunction< + _c_sqlite3_vtab_config, + _dart_sqlite3_vtab_config>('sqlite3_vtab_config'))( arg0, op, ); } - _dart_sqlite3_vtab_config _sqlite3_vtab_config; + _dart_sqlite3_vtab_config? _sqlite3_vtab_config; /// CAPI3REF: Determine The Virtual Table Conflict Policy /// @@ -8448,15 +8298,14 @@ class SQLite { int sqlite3_vtab_on_conflict( ffi.Pointer arg0, ) { - _sqlite3_vtab_on_conflict ??= _dylib.lookupFunction< + return (_sqlite3_vtab_on_conflict ??= _dylib.lookupFunction< _c_sqlite3_vtab_on_conflict, - _dart_sqlite3_vtab_on_conflict>('sqlite3_vtab_on_conflict'); - return _sqlite3_vtab_on_conflict( + _dart_sqlite3_vtab_on_conflict>('sqlite3_vtab_on_conflict'))( arg0, ); } - _dart_sqlite3_vtab_on_conflict _sqlite3_vtab_on_conflict; + _dart_sqlite3_vtab_on_conflict? _sqlite3_vtab_on_conflict; /// CAPI3REF: Determine If Virtual Table Column Access Is For UPDATE /// @@ -8476,14 +8325,14 @@ class SQLite { int sqlite3_vtab_nochange( ffi.Pointer arg0, ) { - _sqlite3_vtab_nochange ??= _dylib.lookupFunction<_c_sqlite3_vtab_nochange, - _dart_sqlite3_vtab_nochange>('sqlite3_vtab_nochange'); - return _sqlite3_vtab_nochange( + return (_sqlite3_vtab_nochange ??= _dylib.lookupFunction< + _c_sqlite3_vtab_nochange, + _dart_sqlite3_vtab_nochange>('sqlite3_vtab_nochange'))( arg0, ); } - _dart_sqlite3_vtab_nochange _sqlite3_vtab_nochange; + _dart_sqlite3_vtab_nochange? _sqlite3_vtab_nochange; /// CAPI3REF: Determine The Collation For a Virtual Table Constraint /// @@ -8500,15 +8349,15 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - _sqlite3_vtab_collation ??= _dylib.lookupFunction<_c_sqlite3_vtab_collation, - _dart_sqlite3_vtab_collation>('sqlite3_vtab_collation'); - return _sqlite3_vtab_collation( + return (_sqlite3_vtab_collation ??= _dylib.lookupFunction< + _c_sqlite3_vtab_collation, + _dart_sqlite3_vtab_collation>('sqlite3_vtab_collation'))( arg0, arg1, ); } - _dart_sqlite3_vtab_collation _sqlite3_vtab_collation; + _dart_sqlite3_vtab_collation? _sqlite3_vtab_collation; /// CAPI3REF: Prepared Statement Scan Status /// METHOD: sqlite3_stmt @@ -8545,10 +8394,9 @@ class SQLite { int iScanStatusOp, ffi.Pointer pOut, ) { - _sqlite3_stmt_scanstatus ??= _dylib.lookupFunction< + return (_sqlite3_stmt_scanstatus ??= _dylib.lookupFunction< _c_sqlite3_stmt_scanstatus, - _dart_sqlite3_stmt_scanstatus>('sqlite3_stmt_scanstatus'); - return _sqlite3_stmt_scanstatus( + _dart_sqlite3_stmt_scanstatus>('sqlite3_stmt_scanstatus'))( pStmt, idx, iScanStatusOp, @@ -8556,7 +8404,7 @@ class SQLite { ); } - _dart_sqlite3_stmt_scanstatus _sqlite3_stmt_scanstatus; + _dart_sqlite3_stmt_scanstatus? _sqlite3_stmt_scanstatus; /// CAPI3REF: Zero Scan-Status Counters /// METHOD: sqlite3_stmt @@ -8568,15 +8416,14 @@ class SQLite { void sqlite3_stmt_scanstatus_reset( ffi.Pointer arg0, ) { - _sqlite3_stmt_scanstatus_reset ??= _dylib.lookupFunction< + return (_sqlite3_stmt_scanstatus_reset ??= _dylib.lookupFunction< _c_sqlite3_stmt_scanstatus_reset, - _dart_sqlite3_stmt_scanstatus_reset>('sqlite3_stmt_scanstatus_reset'); - return _sqlite3_stmt_scanstatus_reset( + _dart_sqlite3_stmt_scanstatus_reset>('sqlite3_stmt_scanstatus_reset'))( arg0, ); } - _dart_sqlite3_stmt_scanstatus_reset _sqlite3_stmt_scanstatus_reset; + _dart_sqlite3_stmt_scanstatus_reset? _sqlite3_stmt_scanstatus_reset; /// CAPI3REF: Flush caches to disk mid-transaction /// @@ -8609,14 +8456,14 @@ class SQLite { int sqlite3_db_cacheflush( ffi.Pointer arg0, ) { - _sqlite3_db_cacheflush ??= _dylib.lookupFunction<_c_sqlite3_db_cacheflush, - _dart_sqlite3_db_cacheflush>('sqlite3_db_cacheflush'); - return _sqlite3_db_cacheflush( + return (_sqlite3_db_cacheflush ??= _dylib.lookupFunction< + _c_sqlite3_db_cacheflush, + _dart_sqlite3_db_cacheflush>('sqlite3_db_cacheflush'))( arg0, ); } - _dart_sqlite3_db_cacheflush _sqlite3_db_cacheflush; + _dart_sqlite3_db_cacheflush? _sqlite3_db_cacheflush; /// CAPI3REF: Low-level system error code /// @@ -8629,14 +8476,14 @@ class SQLite { int sqlite3_system_errno( ffi.Pointer arg0, ) { - _sqlite3_system_errno ??= _dylib.lookupFunction<_c_sqlite3_system_errno, - _dart_sqlite3_system_errno>('sqlite3_system_errno'); - return _sqlite3_system_errno( + return (_sqlite3_system_errno ??= _dylib.lookupFunction< + _c_sqlite3_system_errno, + _dart_sqlite3_system_errno>('sqlite3_system_errno'))( arg0, ); } - _dart_sqlite3_system_errno _sqlite3_system_errno; + _dart_sqlite3_system_errno? _sqlite3_system_errno; /// CAPI3REF: Record A Database Snapshot /// CONSTRUCTOR: sqlite3_snapshot @@ -8684,16 +8531,16 @@ class SQLite { ffi.Pointer zSchema, ffi.Pointer> ppSnapshot, ) { - _sqlite3_snapshot_get ??= _dylib.lookupFunction<_c_sqlite3_snapshot_get, - _dart_sqlite3_snapshot_get>('sqlite3_snapshot_get'); - return _sqlite3_snapshot_get( + return (_sqlite3_snapshot_get ??= _dylib.lookupFunction< + _c_sqlite3_snapshot_get, + _dart_sqlite3_snapshot_get>('sqlite3_snapshot_get'))( db, zSchema, ppSnapshot, ); } - _dart_sqlite3_snapshot_get _sqlite3_snapshot_get; + _dart_sqlite3_snapshot_get? _sqlite3_snapshot_get; /// CAPI3REF: Start a read transaction on an historical snapshot /// METHOD: sqlite3_snapshot @@ -8741,16 +8588,16 @@ class SQLite { ffi.Pointer zSchema, ffi.Pointer pSnapshot, ) { - _sqlite3_snapshot_open ??= _dylib.lookupFunction<_c_sqlite3_snapshot_open, - _dart_sqlite3_snapshot_open>('sqlite3_snapshot_open'); - return _sqlite3_snapshot_open( + return (_sqlite3_snapshot_open ??= _dylib.lookupFunction< + _c_sqlite3_snapshot_open, + _dart_sqlite3_snapshot_open>('sqlite3_snapshot_open'))( db, zSchema, pSnapshot, ); } - _dart_sqlite3_snapshot_open _sqlite3_snapshot_open; + _dart_sqlite3_snapshot_open? _sqlite3_snapshot_open; /// CAPI3REF: Destroy a snapshot /// DESTRUCTOR: sqlite3_snapshot @@ -8764,14 +8611,14 @@ class SQLite { void sqlite3_snapshot_free( ffi.Pointer arg0, ) { - _sqlite3_snapshot_free ??= _dylib.lookupFunction<_c_sqlite3_snapshot_free, - _dart_sqlite3_snapshot_free>('sqlite3_snapshot_free'); - return _sqlite3_snapshot_free( + return (_sqlite3_snapshot_free ??= _dylib.lookupFunction< + _c_sqlite3_snapshot_free, + _dart_sqlite3_snapshot_free>('sqlite3_snapshot_free'))( arg0, ); } - _dart_sqlite3_snapshot_free _sqlite3_snapshot_free; + _dart_sqlite3_snapshot_free? _sqlite3_snapshot_free; /// CAPI3REF: Compare the ages of two snapshot handles. /// METHOD: sqlite3_snapshot @@ -8800,15 +8647,15 @@ class SQLite { ffi.Pointer p1, ffi.Pointer p2, ) { - _sqlite3_snapshot_cmp ??= _dylib.lookupFunction<_c_sqlite3_snapshot_cmp, - _dart_sqlite3_snapshot_cmp>('sqlite3_snapshot_cmp'); - return _sqlite3_snapshot_cmp( + return (_sqlite3_snapshot_cmp ??= _dylib.lookupFunction< + _c_sqlite3_snapshot_cmp, + _dart_sqlite3_snapshot_cmp>('sqlite3_snapshot_cmp'))( p1, p2, ); } - _dart_sqlite3_snapshot_cmp _sqlite3_snapshot_cmp; + _dart_sqlite3_snapshot_cmp? _sqlite3_snapshot_cmp; /// CAPI3REF: Recover snapshots from a wal file /// METHOD: sqlite3_snapshot @@ -8835,16 +8682,15 @@ class SQLite { ffi.Pointer db, ffi.Pointer zDb, ) { - _sqlite3_snapshot_recover ??= _dylib.lookupFunction< + return (_sqlite3_snapshot_recover ??= _dylib.lookupFunction< _c_sqlite3_snapshot_recover, - _dart_sqlite3_snapshot_recover>('sqlite3_snapshot_recover'); - return _sqlite3_snapshot_recover( + _dart_sqlite3_snapshot_recover>('sqlite3_snapshot_recover'))( db, zDb, ); } - _dart_sqlite3_snapshot_recover _sqlite3_snapshot_recover; + _dart_sqlite3_snapshot_recover? _sqlite3_snapshot_recover; /// CAPI3REF: Serialize a database /// @@ -8886,10 +8732,9 @@ class SQLite { ffi.Pointer piSize, int mFlags, ) { - _sqlite3_serialize ??= + return (_sqlite3_serialize ??= _dylib.lookupFunction<_c_sqlite3_serialize, _dart_sqlite3_serialize>( - 'sqlite3_serialize'); - return _sqlite3_serialize( + 'sqlite3_serialize'))( db, zSchema, piSize, @@ -8897,7 +8742,7 @@ class SQLite { ); } - _dart_sqlite3_serialize _sqlite3_serialize; + _dart_sqlite3_serialize? _sqlite3_serialize; /// CAPI3REF: Deserialize a database /// @@ -8934,9 +8779,9 @@ class SQLite { int szBuf, int mFlags, ) { - _sqlite3_deserialize ??= _dylib.lookupFunction<_c_sqlite3_deserialize, - _dart_sqlite3_deserialize>('sqlite3_deserialize'); - return _sqlite3_deserialize( + return (_sqlite3_deserialize ??= _dylib.lookupFunction< + _c_sqlite3_deserialize, + _dart_sqlite3_deserialize>('sqlite3_deserialize'))( db, zSchema, pData, @@ -8946,7 +8791,7 @@ class SQLite { ); } - _dart_sqlite3_deserialize _sqlite3_deserialize; + _dart_sqlite3_deserialize? _sqlite3_deserialize; /// Register a geometry callback named zGeom that can be used as part of an /// R-Tree geometry query as follows: @@ -8958,11 +8803,10 @@ class SQLite { ffi.Pointer> xGeom, ffi.Pointer pContext, ) { - _sqlite3_rtree_geometry_callback ??= _dylib.lookupFunction< + return (_sqlite3_rtree_geometry_callback ??= _dylib.lookupFunction< _c_sqlite3_rtree_geometry_callback, _dart_sqlite3_rtree_geometry_callback>( - 'sqlite3_rtree_geometry_callback'); - return _sqlite3_rtree_geometry_callback( + 'sqlite3_rtree_geometry_callback'))( db, zGeom, xGeom, @@ -8970,7 +8814,7 @@ class SQLite { ); } - _dart_sqlite3_rtree_geometry_callback _sqlite3_rtree_geometry_callback; + _dart_sqlite3_rtree_geometry_callback? _sqlite3_rtree_geometry_callback; /// Register a 2nd-generation geometry callback named zScore that can be /// used as part of an R-Tree geometry query as follows: @@ -8983,10 +8827,9 @@ class SQLite { ffi.Pointer pContext, ffi.Pointer> xDestructor, ) { - _sqlite3_rtree_query_callback ??= _dylib.lookupFunction< + return (_sqlite3_rtree_query_callback ??= _dylib.lookupFunction< _c_sqlite3_rtree_query_callback, - _dart_sqlite3_rtree_query_callback>('sqlite3_rtree_query_callback'); - return _sqlite3_rtree_query_callback( + _dart_sqlite3_rtree_query_callback>('sqlite3_rtree_query_callback'))( db, zQueryFunc, xQueryFunc, @@ -8995,7 +8838,7 @@ class SQLite { ); } - _dart_sqlite3_rtree_query_callback _sqlite3_rtree_query_callback; + _dart_sqlite3_rtree_query_callback? _sqlite3_rtree_query_callback; } class sqlite3 extends ffi.Struct {} @@ -9004,45 +8847,45 @@ class sqlite3_file extends ffi.Struct {} class sqlite3_io_methods extends ffi.Struct { @ffi.Int32() - int iVersion; + external int iVersion; - ffi.Pointer> xClose; + external ffi.Pointer> xClose; - ffi.Pointer> xRead; + external ffi.Pointer> xRead; - ffi.Pointer> xWrite; + external ffi.Pointer> xWrite; - ffi.Pointer> xTruncate; + external ffi.Pointer> xTruncate; - ffi.Pointer> xSync; + external ffi.Pointer> xSync; - ffi.Pointer> xFileSize; + external ffi.Pointer> xFileSize; - ffi.Pointer> xLock; + external ffi.Pointer> xLock; - ffi.Pointer> xUnlock; + external ffi.Pointer> xUnlock; - ffi.Pointer> xCheckReservedLock; + external ffi.Pointer> xCheckReservedLock; - ffi.Pointer> xFileControl; + external ffi.Pointer> xFileControl; - ffi.Pointer> xSectorSize; + external ffi.Pointer> xSectorSize; - ffi.Pointer> xDeviceCharacteristics; + external ffi.Pointer> xDeviceCharacteristics; /// Methods above are valid for version 1 - ffi.Pointer> xShmMap; + external ffi.Pointer> xShmMap; - ffi.Pointer> xShmLock; + external ffi.Pointer> xShmLock; - ffi.Pointer> xShmBarrier; + external ffi.Pointer> xShmBarrier; - ffi.Pointer> xShmUnmap; + external ffi.Pointer> xShmUnmap; /// Methods above are valid for version 2 - ffi.Pointer> xFetch; + external ffi.Pointer> xFetch; - ffi.Pointer> xUnfetch; + external ffi.Pointer> xUnfetch; } class sqlite3_mutex extends ffi.Struct {} @@ -9248,101 +9091,101 @@ class sqlite3_backup extends ffi.Struct {} /// the most recent version. class sqlite3_snapshot extends ffi.Struct { @ffi.Uint8() - int _unique_hidden_item_0; + external int _unique_hidden_item_0; @ffi.Uint8() - int _unique_hidden_item_1; + external int _unique_hidden_item_1; @ffi.Uint8() - int _unique_hidden_item_2; + external int _unique_hidden_item_2; @ffi.Uint8() - int _unique_hidden_item_3; + external int _unique_hidden_item_3; @ffi.Uint8() - int _unique_hidden_item_4; + external int _unique_hidden_item_4; @ffi.Uint8() - int _unique_hidden_item_5; + external int _unique_hidden_item_5; @ffi.Uint8() - int _unique_hidden_item_6; + external int _unique_hidden_item_6; @ffi.Uint8() - int _unique_hidden_item_7; + external int _unique_hidden_item_7; @ffi.Uint8() - int _unique_hidden_item_8; + external int _unique_hidden_item_8; @ffi.Uint8() - int _unique_hidden_item_9; + external int _unique_hidden_item_9; @ffi.Uint8() - int _unique_hidden_item_10; + external int _unique_hidden_item_10; @ffi.Uint8() - int _unique_hidden_item_11; + external int _unique_hidden_item_11; @ffi.Uint8() - int _unique_hidden_item_12; + external int _unique_hidden_item_12; @ffi.Uint8() - int _unique_hidden_item_13; + external int _unique_hidden_item_13; @ffi.Uint8() - int _unique_hidden_item_14; + external int _unique_hidden_item_14; @ffi.Uint8() - int _unique_hidden_item_15; + external int _unique_hidden_item_15; @ffi.Uint8() - int _unique_hidden_item_16; + external int _unique_hidden_item_16; @ffi.Uint8() - int _unique_hidden_item_17; + external int _unique_hidden_item_17; @ffi.Uint8() - int _unique_hidden_item_18; + external int _unique_hidden_item_18; @ffi.Uint8() - int _unique_hidden_item_19; + external int _unique_hidden_item_19; @ffi.Uint8() - int _unique_hidden_item_20; + external int _unique_hidden_item_20; @ffi.Uint8() - int _unique_hidden_item_21; + external int _unique_hidden_item_21; @ffi.Uint8() - int _unique_hidden_item_22; + external int _unique_hidden_item_22; @ffi.Uint8() - int _unique_hidden_item_23; + external int _unique_hidden_item_23; @ffi.Uint8() - int _unique_hidden_item_24; + external int _unique_hidden_item_24; @ffi.Uint8() - int _unique_hidden_item_25; + external int _unique_hidden_item_25; @ffi.Uint8() - int _unique_hidden_item_26; + external int _unique_hidden_item_26; @ffi.Uint8() - int _unique_hidden_item_27; + external int _unique_hidden_item_27; @ffi.Uint8() - int _unique_hidden_item_28; + external int _unique_hidden_item_28; @ffi.Uint8() - int _unique_hidden_item_29; + external int _unique_hidden_item_29; @ffi.Uint8() - int _unique_hidden_item_30; + external int _unique_hidden_item_30; @ffi.Uint8() - int _unique_hidden_item_31; + external int _unique_hidden_item_31; @ffi.Uint8() - int _unique_hidden_item_32; + external int _unique_hidden_item_32; @ffi.Uint8() - int _unique_hidden_item_33; + external int _unique_hidden_item_33; @ffi.Uint8() - int _unique_hidden_item_34; + external int _unique_hidden_item_34; @ffi.Uint8() - int _unique_hidden_item_35; + external int _unique_hidden_item_35; @ffi.Uint8() - int _unique_hidden_item_36; + external int _unique_hidden_item_36; @ffi.Uint8() - int _unique_hidden_item_37; + external int _unique_hidden_item_37; @ffi.Uint8() - int _unique_hidden_item_38; + external int _unique_hidden_item_38; @ffi.Uint8() - int _unique_hidden_item_39; + external int _unique_hidden_item_39; @ffi.Uint8() - int _unique_hidden_item_40; + external int _unique_hidden_item_40; @ffi.Uint8() - int _unique_hidden_item_41; + external int _unique_hidden_item_41; @ffi.Uint8() - int _unique_hidden_item_42; + external int _unique_hidden_item_42; @ffi.Uint8() - int _unique_hidden_item_43; + external int _unique_hidden_item_43; @ffi.Uint8() - int _unique_hidden_item_44; + external int _unique_hidden_item_44; @ffi.Uint8() - int _unique_hidden_item_45; + external int _unique_hidden_item_45; @ffi.Uint8() - int _unique_hidden_item_46; + external int _unique_hidden_item_46; @ffi.Uint8() - int _unique_hidden_item_47; + external int _unique_hidden_item_47; /// Helper for array `hidden`. ArrayHelper_sqlite3_snapshot_hidden_level0 get hidden => diff --git a/pkgs/ffigen/test/native_test/build_test_dylib.dart b/pkgs/ffigen/test/native_test/build_test_dylib.dart index e829231ed1..5ec89ac6ec 100644 --- a/pkgs/ffigen/test/native_test/build_test_dylib.dart +++ b/pkgs/ffigen/test/native_test/build_test_dylib.dart @@ -28,8 +28,6 @@ import 'dart:io'; -import 'package:meta/meta.dart'; - const macOS = 'macos'; const windows = 'windows'; const linux = 'linux'; @@ -57,7 +55,7 @@ Map platformOptions = { void main(List arguments) { print('Building Dynamic Library for Native Tests... '); - final options = getPlatformOptions(); + final options = getPlatformOptions()!; // Run clang compiler to generate the dynamic library. // ignore: omit_local_variable_types @@ -93,7 +91,7 @@ void printSuccess(ProcessResult result, Options options) { } /// Get options based on current platform. -Options getPlatformOptions() { +Options? getPlatformOptions() { if (Platform.isMacOS) { return platformOptions[macOS]; } else if (Platform.isWindows) { @@ -123,9 +121,9 @@ class Options { final String moduleDefPath; Options({ - @required this.outputfilename, - @required this.sharedFlag, - @required this.inputHeader, + required this.outputfilename, + required this.sharedFlag, + required this.inputHeader, this.fPIC = '', this.moduleDefPath = '', }); diff --git a/pkgs/ffigen/test/native_test/native_test.dart b/pkgs/ffigen/test/native_test/native_test.dart index baa1bacb6f..479b910208 100644 --- a/pkgs/ffigen/test/native_test/native_test.dart +++ b/pkgs/ffigen/test/native_test/native_test.dart @@ -14,7 +14,7 @@ import '../test_utils.dart'; import 'native_test_bindings.dart'; void main() { - NativeLibrary bindings; + late NativeLibrary bindings; group('native_test', () { setUpAll(() { logWarnings(); @@ -24,8 +24,8 @@ void main() { } else if (Platform.isWindows) { dylibName = r'test\native_test\native_test.dll'; } - bindings = NativeLibrary( - DynamicLibrary.open(File(dylibName).absolute?.path ?? dylibName)); + bindings = + NativeLibrary(DynamicLibrary.open(File(dylibName).absolute.path)); }); test('generate_bindings', () { @@ -46,7 +46,7 @@ void main() { file.delete(); } } catch (e) { - print('Failed test: Debug generated file: ${file.absolute?.path}'); + print('Failed test: Debug generated file: ${file.absolute.path}'); rethrow; } }); diff --git a/pkgs/ffigen/test/native_test/native_test_bindings.dart b/pkgs/ffigen/test/native_test/native_test_bindings.dart index c5cdd818a4..60825f14e4 100644 --- a/pkgs/ffigen/test/native_test/native_test_bindings.dart +++ b/pkgs/ffigen/test/native_test/native_test_bindings.dart @@ -14,183 +14,172 @@ class NativeLibrary { bool Function1Bool( bool x, ) { - _Function1Bool ??= _dylib - .lookupFunction<_c_Function1Bool, _dart_Function1Bool>('Function1Bool'); - return _Function1Bool( + return (_Function1Bool ??= + _dylib.lookupFunction<_c_Function1Bool, _dart_Function1Bool>( + 'Function1Bool'))( x ? 1 : 0, ) != 0; } - _dart_Function1Bool _Function1Bool; + _dart_Function1Bool? _Function1Bool; int Function1Uint8( int x, ) { - _Function1Uint8 ??= + return (_Function1Uint8 ??= _dylib.lookupFunction<_c_Function1Uint8, _dart_Function1Uint8>( - 'Function1Uint8'); - return _Function1Uint8( + 'Function1Uint8'))( x, ); } - _dart_Function1Uint8 _Function1Uint8; + _dart_Function1Uint8? _Function1Uint8; int Function1Uint16( int x, ) { - _Function1Uint16 ??= + return (_Function1Uint16 ??= _dylib.lookupFunction<_c_Function1Uint16, _dart_Function1Uint16>( - 'Function1Uint16'); - return _Function1Uint16( + 'Function1Uint16'))( x, ); } - _dart_Function1Uint16 _Function1Uint16; + _dart_Function1Uint16? _Function1Uint16; int Function1Uint32( int x, ) { - _Function1Uint32 ??= + return (_Function1Uint32 ??= _dylib.lookupFunction<_c_Function1Uint32, _dart_Function1Uint32>( - 'Function1Uint32'); - return _Function1Uint32( + 'Function1Uint32'))( x, ); } - _dart_Function1Uint32 _Function1Uint32; + _dart_Function1Uint32? _Function1Uint32; int Function1Uint64( int x, ) { - _Function1Uint64 ??= + return (_Function1Uint64 ??= _dylib.lookupFunction<_c_Function1Uint64, _dart_Function1Uint64>( - 'Function1Uint64'); - return _Function1Uint64( + 'Function1Uint64'))( x, ); } - _dart_Function1Uint64 _Function1Uint64; + _dart_Function1Uint64? _Function1Uint64; int Function1Int8( int x, ) { - _Function1Int8 ??= _dylib - .lookupFunction<_c_Function1Int8, _dart_Function1Int8>('Function1Int8'); - return _Function1Int8( + return (_Function1Int8 ??= + _dylib.lookupFunction<_c_Function1Int8, _dart_Function1Int8>( + 'Function1Int8'))( x, ); } - _dart_Function1Int8 _Function1Int8; + _dart_Function1Int8? _Function1Int8; int Function1Int16( int x, ) { - _Function1Int16 ??= + return (_Function1Int16 ??= _dylib.lookupFunction<_c_Function1Int16, _dart_Function1Int16>( - 'Function1Int16'); - return _Function1Int16( + 'Function1Int16'))( x, ); } - _dart_Function1Int16 _Function1Int16; + _dart_Function1Int16? _Function1Int16; int Function1Int32( int x, ) { - _Function1Int32 ??= + return (_Function1Int32 ??= _dylib.lookupFunction<_c_Function1Int32, _dart_Function1Int32>( - 'Function1Int32'); - return _Function1Int32( + 'Function1Int32'))( x, ); } - _dart_Function1Int32 _Function1Int32; + _dart_Function1Int32? _Function1Int32; int Function1Int64( int x, ) { - _Function1Int64 ??= + return (_Function1Int64 ??= _dylib.lookupFunction<_c_Function1Int64, _dart_Function1Int64>( - 'Function1Int64'); - return _Function1Int64( + 'Function1Int64'))( x, ); } - _dart_Function1Int64 _Function1Int64; + _dart_Function1Int64? _Function1Int64; int Function1IntPtr( int x, ) { - _Function1IntPtr ??= + return (_Function1IntPtr ??= _dylib.lookupFunction<_c_Function1IntPtr, _dart_Function1IntPtr>( - 'Function1IntPtr'); - return _Function1IntPtr( + 'Function1IntPtr'))( x, ); } - _dart_Function1IntPtr _Function1IntPtr; + _dart_Function1IntPtr? _Function1IntPtr; double Function1Float( double x, ) { - _Function1Float ??= + return (_Function1Float ??= _dylib.lookupFunction<_c_Function1Float, _dart_Function1Float>( - 'Function1Float'); - return _Function1Float( + 'Function1Float'))( x, ); } - _dart_Function1Float _Function1Float; + _dart_Function1Float? _Function1Float; double Function1Double( double x, ) { - _Function1Double ??= + return (_Function1Double ??= _dylib.lookupFunction<_c_Function1Double, _dart_Function1Double>( - 'Function1Double'); - return _Function1Double( + 'Function1Double'))( x, ); } - _dart_Function1Double _Function1Double; + _dart_Function1Double? _Function1Double; ffi.Pointer getStruct1() { - _getStruct1 ??= - _dylib.lookupFunction<_c_getStruct1, _dart_getStruct1>('getStruct1'); - return _getStruct1(); + return (_getStruct1 ??= + _dylib.lookupFunction<_c_getStruct1, _dart_getStruct1>('getStruct1'))(); } - _dart_getStruct1 _getStruct1; + _dart_getStruct1? _getStruct1; } class Struct1 extends ffi.Struct { @ffi.Int8() - int a; + external int a; @ffi.Int32() - int _unique_data_item_0; + external int _unique_data_item_0; @ffi.Int32() - int _unique_data_item_1; + external int _unique_data_item_1; @ffi.Int32() - int _unique_data_item_2; + external int _unique_data_item_2; @ffi.Int32() - int _unique_data_item_3; + external int _unique_data_item_3; @ffi.Int32() - int _unique_data_item_4; + external int _unique_data_item_4; @ffi.Int32() - int _unique_data_item_5; + external int _unique_data_item_5; /// Helper for array `data`. ArrayHelper_Struct1_data_level0 get data => diff --git a/pkgs/ffigen/test/rename_tests/rename_test.dart b/pkgs/ffigen/test/rename_tests/rename_test.dart index 962e545b3b..b6fd4031e5 100644 --- a/pkgs/ffigen/test/rename_tests/rename_test.dart +++ b/pkgs/ffigen/test/rename_tests/rename_test.dart @@ -11,7 +11,7 @@ import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; -Library actual, expected; +late Library actual, expected; final functionPrefix = 'fff'; final structPrefix = 'sss'; final enumPrefix = 'eee'; diff --git a/pkgs/ffigen/test/test_coverage.dart b/pkgs/ffigen/test/test_coverage.dart index a35f0f724d..ede39f3e45 100644 --- a/pkgs/ffigen/test/test_coverage.dart +++ b/pkgs/ffigen/test/test_coverage.dart @@ -13,12 +13,16 @@ import 'example_tests/libclang_example_test.dart' as example_tests_libclang_example_test; import 'example_tests/simple_example_test.dart' as example_tests_simple_example_test; +import 'header_parser_tests/dart_handle_test.dart' + as header_parser_tests_dart_handle_test; import 'header_parser_tests/function_n_struct_test.dart' as header_parser_tests_function_n_struct_test; import 'header_parser_tests/functions_test.dart' as header_parser_tests_functions_test; import 'header_parser_tests/macros_test.dart' as header_parser_tests_macros_test; +import 'header_parser_tests/native_func_typedef_test.dart' + as header_parser_tests_native_func_typedef_test; import 'header_parser_tests/nested_parsing_test.dart' as header_parser_tests_nested_parsing_test; import 'header_parser_tests/typedef_test.dart' @@ -37,9 +41,11 @@ void main() { example_tests_libclang_example_test.main(); collision_tests_decl_decl_collision_test.main(); collision_tests_reserved_keyword_collision_test.main(); + header_parser_tests_dart_handle_test.main(); header_parser_tests_functions_test.main(); header_parser_tests_macros_test.main(); header_parser_tests_function_n_struct_test.main(); + header_parser_tests_native_func_typedef_test.main(); header_parser_tests_nested_parsing_test.main(); header_parser_tests_typedef_test.main(); header_parser_tests_unnamed_enums_test.main(); diff --git a/pkgs/ffigen/test/test_utils.dart b/pkgs/ffigen/test/test_utils.dart index 0d94d29de5..1eebadb9d8 100644 --- a/pkgs/ffigen/test/test_utils.dart +++ b/pkgs/ffigen/test/test_utils.dart @@ -4,6 +4,7 @@ import 'dart:io'; +import 'package:collection/collection.dart' show IterableExtension; import 'package:ffigen/src/code_generator.dart'; import 'package:logging/logging.dart'; import 'package:path/path.dart' as path; @@ -14,8 +15,7 @@ import 'package:test/test.dart'; extension LibraryTestExt on Library { /// Get a [Binding]'s generated string with a given name. String getBindingAsString(String name) { - final b = bindings.firstWhere((element) => element.name == name, - orElse: () => null); + final b = bindings.firstWhereOrNull((element) => element.name == name); if (b == null) { throw NotFoundException("Binding '$name' not found."); } else { @@ -25,8 +25,7 @@ extension LibraryTestExt on Library { /// Get a [Binding] with a given name. Binding getBinding(String name) { - final b = bindings.firstWhere((element) => element.name == name, - orElse: () => null); + final b = bindings.firstWhereOrNull((element) => element.name == name); if (b == null) { throw NotFoundException("Binding '$name' not found."); } else { @@ -53,7 +52,7 @@ void matchLibraryWithExpected( file.delete(); } } catch (e) { - print('Failed test: Debug generated file: ${file.absolute?.path}'); + print('Failed test: Debug generated file: ${file.absolute.path}'); rethrow; } } diff --git a/pkgs/ffigen/tool/travis.sh b/pkgs/ffigen/tool/coverage.sh similarity index 55% rename from pkgs/ffigen/tool/travis.sh rename to pkgs/ffigen/tool/coverage.sh index 341aadacb2..d43016d0d6 100755 --- a/pkgs/ffigen/tool/travis.sh +++ b/pkgs/ffigen/tool/coverage.sh @@ -9,8 +9,11 @@ set -e # Gather coverage. pub global activate remove_from_coverage -pub global activate dart_coveralls +pub global activate coverage # Generate coverage report. -pub global run dart_coveralls calc test/test_coverage.dart > lcov.info +dart --no-sound-null-safety --pause-isolates-on-exit --disable-service-auth-codes --enable-vm-service=3000 test/test_coverage.dart & +dart pub global run coverage:collect_coverage --wait-paused --uri=http://127.0.0.1:3000/ -o coverage.json --resume-isolates +dart pub global run coverage:format_coverage --lcov -i coverage.json -o lcov.info + # Remove extra files from coverage report. pub global run remove_from_coverage -f lcov.info -r ".pub-cache" From 2ab4701a2851574b5cc2b2b9ea8df35721e30672 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Tue, 5 Jan 2021 16:28:13 +0530 Subject: [PATCH 054/276] [ffigen] Remove usage of package:collection. (#130) --- pkgs/ffigen/test/test_utils.dart | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pkgs/ffigen/test/test_utils.dart b/pkgs/ffigen/test/test_utils.dart index 1eebadb9d8..c2d95f009a 100644 --- a/pkgs/ffigen/test/test_utils.dart +++ b/pkgs/ffigen/test/test_utils.dart @@ -4,7 +4,6 @@ import 'dart:io'; -import 'package:collection/collection.dart' show IterableExtension; import 'package:ffigen/src/code_generator.dart'; import 'package:logging/logging.dart'; import 'package:path/path.dart' as path; @@ -15,21 +14,21 @@ import 'package:test/test.dart'; extension LibraryTestExt on Library { /// Get a [Binding]'s generated string with a given name. String getBindingAsString(String name) { - final b = bindings.firstWhereOrNull((element) => element.name == name); - if (b == null) { - throw NotFoundException("Binding '$name' not found."); - } else { + try { + final b = bindings.firstWhere((element) => element.name == name); return b.toBindingString(writer).string; + } catch (e) { + throw NotFoundException("Binding '$name' not found."); } } /// Get a [Binding] with a given name. Binding getBinding(String name) { - final b = bindings.firstWhereOrNull((element) => element.name == name); - if (b == null) { - throw NotFoundException("Binding '$name' not found."); - } else { + try { + final b = bindings.firstWhere((element) => element.name == name); return b; + } catch (e) { + throw NotFoundException("Binding '$name' not found."); } } } From fb8ac4ee9f8398f446b15cc5a4889e632e541091 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 11 Jan 2021 10:40:50 +0100 Subject: [PATCH 055/276] [ffigen] Add include path for systems with LLVM 11 (e.g. Debian 11) (#125) --- pkgs/ffigen/bin/setup.dart | 3 ++- pkgs/ffigen/example/libclang-example/pubspec.yaml | 2 +- pkgs/ffigen/test/example_tests/libclang_example_test.dart | 2 +- pkgs/ffigen/tool/libclang_config.yaml | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/ffigen/bin/setup.dart b/pkgs/ffigen/bin/setup.dart index edc79e215a..9949ebc154 100644 --- a/pkgs/ffigen/bin/setup.dart +++ b/pkgs/ffigen/bin/setup.dart @@ -10,7 +10,7 @@ /// /// Linux: /// ``` -/// clang -I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -lclang -shared -fpic path/to/wrapper.c -o path/to/libwrapped_clang.so +/// clang -I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -I/usr/lib/llvm-11/include/ -lclang -shared -fpic path/to/wrapper.c -o path/to/libwrapped_clang.so /// ``` /// MacOS: /// ``` @@ -39,6 +39,7 @@ final _linuxOpts = _Options( headerIncludes: [ '-I/usr/lib/llvm-9/include/', '-I/usr/lib/llvm-10/include/', + '-I/usr/lib/llvm-11/include/', ], ); final _windowsOpts = _Options( diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index e1a3cfc064..f45148fd24 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -24,7 +24,7 @@ ffigen: - '**CXString.h' - '**Index.h' - compiler-opts: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -IC:\Progra~1\LLVM\include -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' + compiler-opts: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -I/usr/lib/llvm-11/include/ -IC:\Progra~1\LLVM\include -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' functions: include: - 'clang_.*' # Can be a regexp, '.' matches any character. diff --git a/pkgs/ffigen/test/example_tests/libclang_example_test.dart b/pkgs/ffigen/test/example_tests/libclang_example_test.dart index ac3feab293..dba380d3cb 100644 --- a/pkgs/ffigen/test/example_tests/libclang_example_test.dart +++ b/pkgs/ffigen/test/example_tests/libclang_example_test.dart @@ -27,7 +27,7 @@ ${strings.headers}: - '**CXString.h' - '**Index.h' -${strings.compilerOpts}: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -IC:\Progra~1\LLVM\include -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' +${strings.compilerOpts}: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -I/usr/lib/llvm-11/include/ -IC:\Progra~1\LLVM\include -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' ${strings.functions}: ${strings.include}: - 'clang_.*' diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index 4262736aca..7be7ec1d21 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -13,7 +13,7 @@ name: Clang description: Holds bindings to LibClang. output: 'lib/src/header_parser/clang_bindings/clang_bindings.dart' sort: true -compiler-opts: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' +compiler-opts: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -I/usr/lib/llvm-11/include/ -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' headers: entry-points: - 'lib/src/clang_library/wrapper.c' From 4a9672f190edaa0852a4dc03c2479ffc2b6d7f9c Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 11 Jan 2021 15:19:05 +0530 Subject: [PATCH 056/276] [ffigen] Removed usage of --no-sound-null-safety flag. (#136) * Removed usage of --no-sound-null-safety flag * Update version, changelog * Use flag when running tests on travis --- .../ffigen/.github/workflows/test-package.yml | 2 +- pkgs/ffigen/CHANGELOG.md | 3 + pkgs/ffigen/README.md | 3 - pkgs/ffigen/bin/ffigen.dart | 211 +------------ pkgs/ffigen/bin/setup.dart | 276 +----------------- pkgs/ffigen/lib/src/executables/ffigen.dart | 211 +++++++++++++ pkgs/ffigen/lib/src/executables/setup.dart | 276 ++++++++++++++++++ pkgs/ffigen/pubspec.yaml | 2 +- 8 files changed, 500 insertions(+), 484 deletions(-) create mode 100644 pkgs/ffigen/lib/src/executables/ffigen.dart create mode 100644 pkgs/ffigen/lib/src/executables/setup.dart diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 102683409a..83fe4d6661 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -50,7 +50,7 @@ jobs: - name: Install libclang-10-dev run: sudo apt-get install libclang-10-dev - name: Setup ffigen - run: dart --no-sound-null-safety run ffigen:setup + run: dart run ffigen:setup - name: Build test dylib run: cd test/native_test && dart build_test_dylib.dart && cd ../.. - name: Run VM tests diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 2697d97dca..38fa2af9f3 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.0.0-nullsafety.1 +- Removed the need for `--no-sound-null-safety` flag. + # 2.0.0-nullsafety.0 - Migrated to (unsound) null safety. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 3b56033b3a..e6359eb86c 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -5,9 +5,6 @@ Experimental binding generator for [FFI](https://dart.dev/guides/libraries/c-interop) bindings. - -> Due to a few unmigrated dependencies, ffigen currently runs in unsound null safety, run using `dart --no-sound-null-safety run ffigen`. - ## Example For some header file _example.h_: diff --git a/pkgs/ffigen/bin/ffigen.dart b/pkgs/ffigen/bin/ffigen.dart index 82abac5bb3..cfb482cc2d 100644 --- a/pkgs/ffigen/bin/ffigen.dart +++ b/pkgs/ffigen/bin/ffigen.dart @@ -1,211 +1,8 @@ // Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// +// TODO(128): Remove this when package can run with sound null safety. +// @dart=2.7 -// Executable script to generate bindings for some C library. -import 'dart:io'; - -import 'package:args/args.dart'; -import 'package:cli_util/cli_logging.dart' show Ansi; -import 'package:ffigen/ffigen.dart'; -import 'package:logging/logging.dart'; -import 'package:yaml/yaml.dart' as yaml; - -import 'setup.dart'; - -final _logger = Logger('ffigen.ffigen'); -final _ansi = Ansi(Ansi.terminalSupportsAnsi); - -String successPen(String str) { - return '${_ansi.green}$str${_ansi.none}'; -} - -String errorPen(String str) { - return '${_ansi.red}$str${_ansi.none}'; -} - -void main(List args) { - // Parses the cmd args. This will print usage and exit if --help was passed. - final argResult = getArgResults(args); - - // Setup logging level and printing. - setupLogger(argResult); - - /// Prompt user if dylib doesn't exist and cannot be auto created to run - /// `pub run ffigen:setup -Ipath/to/llvm/include -Lpath/to/llvm/lib`. - if (!checkDylibExist() && !autoCreateDylib()) { - _logger.severe('Unable to create dynamic library automatically.'); - _logger.severe('If LLVM (9+) is installed, try running:'); - _logger.severe( - ' pub run ffigen:setup -Ipath/to/llvm/include -Lpath/to/llvm/lib'); - exit(1); - } - - // Create a config object. - Config config; - try { - config = getConfig(argResult); - } on FormatException { - _logger.severe('Please fix configuration errors and re-run the tool.'); - exit(1); - } - - // Parse the bindings according to config object provided. - final library = parse(config); - - // Generate file for the parsed bindings. - final gen = File(config.output); - library.generateFile(gen); - _logger - .info(successPen('Finished, Bindings generated in ${gen.absolute.path}')); -} - -Config getConfig(ArgResults result) { - _logger.info('Running in ${Directory.current}'); - - if (result.wasParsed('config')) { - return getConfigFromCustomYaml(result['config'] as String); - } else { - return getConfigFromPubspec(); - } -} - -/// Extracts configuration from pubspec file. -Config getConfigFromPubspec() { - final pubspecName = 'pubspec.yaml'; - final configKey = 'ffigen'; - - final pubspecFile = File(pubspecName); - - if (!pubspecFile.existsSync()) { - _logger.severe( - 'Error: $pubspecName not found, please run this tool from the root of your package.'); - exit(1); - } - - // Casting this because pubspec is expected to be a YamlMap. - - // Throws a [YamlException] if it's unable to parse the Yaml. - final bindingsConfigMap = - yaml.loadYaml(pubspecFile.readAsStringSync())[configKey] as yaml.YamlMap?; - - if (bindingsConfigMap == null) { - _logger.severe("Couldn't find an entry for '$configKey' in $pubspecName."); - exit(1); - } - return Config.fromYaml(bindingsConfigMap); -} - -/// Extracts configuration from a custom yaml file. -Config getConfigFromCustomYaml(String yamlPath) { - final yamlFile = File(yamlPath); - - if (!yamlFile.existsSync()) { - _logger.severe('Error: $yamlPath not found.'); - exit(1); - } - - // Throws a [YamlException] if it's unable to parse the Yaml. - final bindingsConfigMap = - yaml.loadYaml(yamlFile.readAsStringSync()) as yaml.YamlMap; - - return Config.fromYaml(bindingsConfigMap); -} - -/// Parses the cmd line arguments. -ArgResults getArgResults(List args) { - final parser = ArgParser(allowTrailingOptions: true); - - parser.addSeparator( - 'FFIGEN: Generate dart bindings from C header files\nUsage:'); - parser.addOption( - 'config', - help: 'path to Yaml file containing configurations if not in pubspec.yaml', - ); - parser.addOption( - 'verbose', - abbr: 'v', - defaultsTo: 'info', - allowed: [ - 'all', - 'fine', - 'info', - 'warning', - 'severe', - ], - ); - parser.addFlag( - 'help', - abbr: 'h', - help: 'prints this usage', - negatable: false, - ); - - ArgResults results; - try { - results = parser.parse(args); - - if (results.wasParsed('help')) { - print(parser.usage); - exit(0); - } - } catch (e) { - print(e); - print(parser.usage); - exit(1); - } - - return results; -} - -/// Sets up the logging level and printing. -void setupLogger(ArgResults result) { - if (result.wasParsed('verbose')) { - switch (result['verbose'] as String?) { - case 'all': - // Logs everything, the entire AST touched by our parser. - Logger.root.level = Level.ALL; - break; - case 'fine': - // Logs AST parts relevant to user (i.e those included in filters). - Logger.root.level = Level.FINE; - break; - case 'info': - // Logs relevant info for general user (default). - Logger.root.level = Level.INFO; - break; - case 'warning': - // Logs warnings for relevant stuff. - Logger.root.level = Level.WARNING; - break; - case 'severe': - // Logs severe warnings and errors. - Logger.root.level = Level.SEVERE; - break; - } - // Setup logger for printing (if verbosity was set by user). - Logger.root.onRecord.listen((record) { - final level = '[${record.level.name}]'.padRight(9); - printLog('${level}: ${record.message}', record.level); - }); - } else { - // Setup logger for printing (if verbosity was not set by user). - Logger.root.onRecord.listen((record) { - if (record.level.value > Level.INFO.value) { - final level = '[${record.level.name}]'.padRight(9); - printLog('${level}: ${record.message}', record.level); - } else { - printLog(record.message, record.level); - } - }); - } -} - -void printLog(String log, Level level) { - // Prints text in red for Severe logs only. - if (level < Level.SEVERE) { - print(log); - } else { - print(errorPen(log)); - } -} +export 'package:ffigen/src/executables/ffigen.dart'; diff --git a/pkgs/ffigen/bin/setup.dart b/pkgs/ffigen/bin/setup.dart index 9949ebc154..5b07636cfc 100644 --- a/pkgs/ffigen/bin/setup.dart +++ b/pkgs/ffigen/bin/setup.dart @@ -1,276 +1,8 @@ // Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// +// TODO(128): Remove this when package can run with sound null safety. +// @dart=2.7 -/// ======================================================================= -/// =============== Build script to generate dyamic library =============== -/// ======================================================================= -/// This Script effectively calls the following (but user can provide -/// command line args which will replace the defaults shown below)- -/// -/// Linux: -/// ``` -/// clang -I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -I/usr/lib/llvm-11/include/ -lclang -shared -fpic path/to/wrapper.c -o path/to/libwrapped_clang.so -/// ``` -/// MacOS: -/// ``` -/// clang -I/usr/local/opt/llvm/include/ -L/usr/local/opt/llvm/lib/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -v -lclang -shared -fpic path/to/wrapper.c -o path/to/libwrapped_clang.dylib -/// ``` -/// Windows: -/// ``` -/// clang -IC:\Progra~1\LLVM\include -LC:\Progra~1\LLVM\lib -llibclang -shared path/to/wrapper.c -o path/to/wrapped_clang.dll -Wl,/DEF:path/to/wrapper.def -/// ``` -/// ======================================================================= -/// ======================================================================= -/// ======================================================================= - -import 'dart:io'; -import 'package:args/args.dart'; -import 'package:ffigen/src/find_resource.dart'; -import 'package:ffigen/src/strings.dart' as strings; -import 'package:path/path.dart' as path; - -/// Default platform options. -final _linuxOpts = _Options( - sharedFlag: '-shared', - inputHeader: _getWrapperPath('wrapper.c'), - fPIC: '-fpic', - ldLibFlag: '-lclang', - headerIncludes: [ - '-I/usr/lib/llvm-9/include/', - '-I/usr/lib/llvm-10/include/', - '-I/usr/lib/llvm-11/include/', - ], -); -final _windowsOpts = _Options( - sharedFlag: '-shared', - inputHeader: _getWrapperPath('wrapper.c'), - moduleDefPath: '-Wl,/DEF:${_getWrapperPath("wrapper.def")}', - ldLibFlag: '-llibclang', - headerIncludes: [ - r'-IC:\Progra~1\LLVM\include', - ], - libIncludes: [ - r'-LC:\Progra~1\LLVM\lib', - ], -); -final _macOSOpts = _Options( - sharedFlag: '-shared', - inputHeader: _getWrapperPath('wrapper.c'), - fPIC: '-fpic', - ldLibFlag: '-lclang', - headerIncludes: [ - '-I/usr/local/opt/llvm/include/', - '-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/', - ], - libIncludes: [ - '-L/usr/local/opt/llvm/lib/', - ], -); - -/// If main is called directly we always re-create the dynamic library. -void main(List arguments) { - // Parses the cmd args. This will print usage and exit if --help was passed. - final argResults = _getArgResults(arguments); - - print('Building Dynamic Library for libclang wrapper...'); - final options = _getPlatformOptions(); - _deleteOldDylib(); - - // Updates header/lib includes in platform options. - _changeIncludesUsingCmdArgs(argResults, options); - - // Run clang compiler to generate the dynamic library. - final processResult = _runClangProcess(options); - _printDetails(processResult, options); -} - -/// Returns true if auto creating dylib was successful. -/// -/// This will fail if llvm is not in default directories or if .dart_tool -/// doesn't exist. -bool autoCreateDylib() { - _deleteOldDylib(); - final options = _getPlatformOptions(); - final processResult = _runClangProcess(options); - if ((processResult.stderr as String).isNotEmpty) { - print(processResult.stderr); - } - return checkDylibExist(); -} - -bool checkDylibExist() { - return File(path.join( - _getDotDartToolPath(), - strings.ffigenFolderName, - strings.dylibFileName, - )).existsSync(); -} - -/// Removes old dynamic libraries(if any) by deleting .dart_tool/ffigen. -/// -/// Throws error if '.dart_tool' is not found. -void _deleteOldDylib() { - // Find .dart_tool. - final dtpath = _getDotDartToolPath(); - // Find .dart_tool/ffigen and delete recursively if it exists. - final ffigenDir = Directory(path.join(dtpath, strings.ffigenFolderName)); - if (ffigenDir.existsSync()) ffigenDir.deleteSync(recursive: true); -} - -/// Creates necesarry parent folders and return full path to dylib. -String _dylibPath() { - // Find .dart_tool. - final dtpath = _getDotDartToolPath(); - // Create .dart_tool/ffigen if it doesn't exists. - final ffigenDir = Directory(path.join(dtpath, strings.ffigenFolderName)); - if (!ffigenDir.existsSync()) ffigenDir.createSync(); - - // Return dylib path - return path.join(ffigenDir.absolute.path, strings.dylibFileName); -} - -/// Returns full path of the wrapper files. -/// -/// Throws error if not found. -String _getWrapperPath(String wrapperName) { - final file = File.fromUri(findWrapper(wrapperName)!); - if (file.existsSync()) { - return file.absolute.path; - } else { - throw Exception('Unable to find $wrapperName file.'); - } -} - -/// Gets full path to .dart_tool. -/// -/// Throws Exception if not found. -String _getDotDartToolPath() { - final dtpath = findDotDartTool()?.toFilePath(); - if (dtpath == null) { - throw Exception('.dart_tool not found.'); - } - return dtpath; -} - -/// Calls the clang compiler. -ProcessResult _runClangProcess(_Options options) { - final result = Process.runSync( - 'clang', - [ - ...options.headerIncludes, - ...options.libIncludes, - options.ldLibFlag, - options.sharedFlag, - options.fPIC, - options.inputHeader, - '-o', - _dylibPath(), - options.moduleDefPath, - '-Wno-nullability-completeness', - ], - ); - return result; -} - -/// Prints success message (or process error if any). -void _printDetails(ProcessResult result, _Options options) { - print(result.stdout); - if ((result.stderr as String).isNotEmpty) { - print(result.stderr); - } else { - print('Created dynamic library.'); - } -} - -ArgResults _getArgResults(List args) { - final parser = ArgParser(allowTrailingOptions: true); - parser.addSeparator('Generates LLVM Wrapper used by this package:'); - parser.addMultiOption('include-header', - abbr: 'I', help: 'Path to header include directories'); - parser.addMultiOption('include-lib', - abbr: 'L', help: 'Path to library include directories'); - parser.addFlag( - 'help', - abbr: 'h', - help: 'prints this usage', - negatable: false, - ); - - ArgResults results; - try { - results = parser.parse(args); - - if (results.wasParsed('help')) { - print(parser.usage); - exit(0); - } - } catch (e) { - print(e); - print(parser.usage); - exit(1); - } - - return results; -} - -/// Use cmd args(if any) to change header/lib include paths. -void _changeIncludesUsingCmdArgs(ArgResults argResult, _Options options) { - if (argResult.wasParsed('include-header')) { - options.headerIncludes = (argResult['include-header'] as List) - .map((header) => '-I$header') - .toList(); - } - if (argResult.wasParsed('include-lib')) { - options.libIncludes = (argResult['include-lib'] as List) - .map((lib) => '-L$lib') - .toList(); - } -} - -/// Get options based on current platform. -_Options _getPlatformOptions() { - if (Platform.isMacOS) { - return _macOSOpts; - } else if (Platform.isWindows) { - return _windowsOpts; - } else if (Platform.isLinux) { - return _linuxOpts; - } else { - throw Exception('Unknown Platform.'); - } -} - -/// Hold options which would be passed to clang. -class _Options { - /// Tells compiler to generate a shared library. - final String sharedFlag; - - /// Flag for generating Position Independant Code (Not used on windows). - final String fPIC; - - /// Input file. - final String inputHeader; - - /// Path to `.def` file containing symbols to export, windows use only. - final String moduleDefPath; - - /// Path to header files. - List headerIncludes; - - /// Path to dynamic/static libraries - List libIncludes; - - /// Linker flag for linking to libclang. - final String ldLibFlag; - - _Options({ - required this.sharedFlag, - required this.inputHeader, - required this.ldLibFlag, - this.headerIncludes = const [], - this.libIncludes = const [], - this.fPIC = '', - this.moduleDefPath = '', - }); -} +export 'package:ffigen/src/executables/setup.dart'; diff --git a/pkgs/ffigen/lib/src/executables/ffigen.dart b/pkgs/ffigen/lib/src/executables/ffigen.dart new file mode 100644 index 0000000000..22b3744549 --- /dev/null +++ b/pkgs/ffigen/lib/src/executables/ffigen.dart @@ -0,0 +1,211 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Executable script to generate bindings for some C library. +import 'dart:io'; + +import 'package:args/args.dart'; +import 'package:cli_util/cli_logging.dart' show Ansi; +import 'package:ffigen/ffigen.dart'; +import 'package:logging/logging.dart'; +import 'package:yaml/yaml.dart' as yaml; + +import 'package:ffigen/src/executables/setup.dart'; + +final _logger = Logger('ffigen.ffigen'); +final _ansi = Ansi(Ansi.terminalSupportsAnsi); + +String successPen(String str) { + return '${_ansi.green}$str${_ansi.none}'; +} + +String errorPen(String str) { + return '${_ansi.red}$str${_ansi.none}'; +} + +void main(List args) { + // Parses the cmd args. This will print usage and exit if --help was passed. + final argResult = getArgResults(args); + + // Setup logging level and printing. + setupLogger(argResult); + + /// Prompt user if dylib doesn't exist and cannot be auto created to run + /// `pub run ffigen:setup -Ipath/to/llvm/include -Lpath/to/llvm/lib`. + if (!checkDylibExist() && !autoCreateDylib()) { + _logger.severe('Unable to create dynamic library automatically.'); + _logger.severe('If LLVM (9+) is installed, try running:'); + _logger.severe( + ' pub run ffigen:setup -Ipath/to/llvm/include -Lpath/to/llvm/lib'); + exit(1); + } + + // Create a config object. + Config config; + try { + config = getConfig(argResult); + } on FormatException { + _logger.severe('Please fix configuration errors and re-run the tool.'); + exit(1); + } + + // Parse the bindings according to config object provided. + final library = parse(config); + + // Generate file for the parsed bindings. + final gen = File(config.output); + library.generateFile(gen); + _logger + .info(successPen('Finished, Bindings generated in ${gen.absolute.path}')); +} + +Config getConfig(ArgResults result) { + _logger.info('Running in ${Directory.current}'); + + if (result.wasParsed('config')) { + return getConfigFromCustomYaml(result['config'] as String); + } else { + return getConfigFromPubspec(); + } +} + +/// Extracts configuration from pubspec file. +Config getConfigFromPubspec() { + final pubspecName = 'pubspec.yaml'; + final configKey = 'ffigen'; + + final pubspecFile = File(pubspecName); + + if (!pubspecFile.existsSync()) { + _logger.severe( + 'Error: $pubspecName not found, please run this tool from the root of your package.'); + exit(1); + } + + // Casting this because pubspec is expected to be a YamlMap. + + // Throws a [YamlException] if it's unable to parse the Yaml. + final bindingsConfigMap = + yaml.loadYaml(pubspecFile.readAsStringSync())[configKey] as yaml.YamlMap?; + + if (bindingsConfigMap == null) { + _logger.severe("Couldn't find an entry for '$configKey' in $pubspecName."); + exit(1); + } + return Config.fromYaml(bindingsConfigMap); +} + +/// Extracts configuration from a custom yaml file. +Config getConfigFromCustomYaml(String yamlPath) { + final yamlFile = File(yamlPath); + + if (!yamlFile.existsSync()) { + _logger.severe('Error: $yamlPath not found.'); + exit(1); + } + + // Throws a [YamlException] if it's unable to parse the Yaml. + final bindingsConfigMap = + yaml.loadYaml(yamlFile.readAsStringSync()) as yaml.YamlMap; + + return Config.fromYaml(bindingsConfigMap); +} + +/// Parses the cmd line arguments. +ArgResults getArgResults(List args) { + final parser = ArgParser(allowTrailingOptions: true); + + parser.addSeparator( + 'FFIGEN: Generate dart bindings from C header files\nUsage:'); + parser.addOption( + 'config', + help: 'path to Yaml file containing configurations if not in pubspec.yaml', + ); + parser.addOption( + 'verbose', + abbr: 'v', + defaultsTo: 'info', + allowed: [ + 'all', + 'fine', + 'info', + 'warning', + 'severe', + ], + ); + parser.addFlag( + 'help', + abbr: 'h', + help: 'prints this usage', + negatable: false, + ); + + ArgResults results; + try { + results = parser.parse(args); + + if (results.wasParsed('help')) { + print(parser.usage); + exit(0); + } + } catch (e) { + print(e); + print(parser.usage); + exit(1); + } + + return results; +} + +/// Sets up the logging level and printing. +void setupLogger(ArgResults result) { + if (result.wasParsed('verbose')) { + switch (result['verbose'] as String?) { + case 'all': + // Logs everything, the entire AST touched by our parser. + Logger.root.level = Level.ALL; + break; + case 'fine': + // Logs AST parts relevant to user (i.e those included in filters). + Logger.root.level = Level.FINE; + break; + case 'info': + // Logs relevant info for general user (default). + Logger.root.level = Level.INFO; + break; + case 'warning': + // Logs warnings for relevant stuff. + Logger.root.level = Level.WARNING; + break; + case 'severe': + // Logs severe warnings and errors. + Logger.root.level = Level.SEVERE; + break; + } + // Setup logger for printing (if verbosity was set by user). + Logger.root.onRecord.listen((record) { + final level = '[${record.level.name}]'.padRight(9); + printLog('${level}: ${record.message}', record.level); + }); + } else { + // Setup logger for printing (if verbosity was not set by user). + Logger.root.onRecord.listen((record) { + if (record.level.value > Level.INFO.value) { + final level = '[${record.level.name}]'.padRight(9); + printLog('${level}: ${record.message}', record.level); + } else { + printLog(record.message, record.level); + } + }); + } +} + +void printLog(String log, Level level) { + // Prints text in red for Severe logs only. + if (level < Level.SEVERE) { + print(log); + } else { + print(errorPen(log)); + } +} diff --git a/pkgs/ffigen/lib/src/executables/setup.dart b/pkgs/ffigen/lib/src/executables/setup.dart new file mode 100644 index 0000000000..84a069b5d2 --- /dev/null +++ b/pkgs/ffigen/lib/src/executables/setup.dart @@ -0,0 +1,276 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// ======================================================================= +/// =============== Build script to generate dyamic library =============== +/// ======================================================================= +/// This Script effectively calls the following (but user can provide +/// command line args which will replace the defaults shown below)- +/// +/// Linux: +/// ``` +/// clang -I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -I/usr/lib/llvm-11/include/ -lclang -shared -fpic path/to/wrapper.c -o path/to/libwrapped_clang.so +/// ``` +/// MacOS: +/// ``` +/// clang -I/usr/local/opt/llvm/include/ -L/usr/local/opt/llvm/lib/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -v -lclang -shared -fpic path/to/wrapper.c -o path/to/libwrapped_clang.dylib +/// ``` +/// Windows: +/// ``` +/// clang -IC:\Progra~1\LLVM\include -LC:\Progra~1\LLVM\lib -llibclang -shared path/to/wrapper.c -o path/to/wrapped_clang.dll -Wl,/DEF:path/to/wrapper.def +/// ``` +/// ======================================================================= +/// ======================================================================= +/// ======================================================================= + +import 'dart:io'; +import 'package:args/args.dart'; +import 'package:ffigen/src/find_resource.dart'; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:path/path.dart' as path; + +/// Default platform options. +final _linuxOpts = _Options( + sharedFlag: '-shared', + inputHeader: _getWrapperPath('wrapper.c'), + fPIC: '-fpic', + ldLibFlag: '-lclang', + headerIncludes: [ + '-I/usr/lib/llvm-9/include/', + '-I/usr/lib/llvm-10/include/', + '-I/usr/lib/llvm-11/include/', + ], +); +final _windowsOpts = _Options( + sharedFlag: '-shared', + inputHeader: _getWrapperPath('wrapper.c'), + moduleDefPath: '-Wl,/DEF:${_getWrapperPath("wrapper.def")}', + ldLibFlag: '-llibclang', + headerIncludes: [ + r'-IC:\Progra~1\LLVM\include', + ], + libIncludes: [ + r'-LC:\Progra~1\LLVM\lib', + ], +); +final _macOSOpts = _Options( + sharedFlag: '-shared', + inputHeader: _getWrapperPath('wrapper.c'), + fPIC: '-fpic', + ldLibFlag: '-lclang', + headerIncludes: [ + '-I/usr/local/opt/llvm/include/', + '-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/', + ], + libIncludes: [ + '-L/usr/local/opt/llvm/lib/', + ], +); + +/// If main is called directly we always re-create the dynamic library. +void main(List arguments) { + // Parses the cmd args. This will print usage and exit if --help was passed. + final argResults = _getArgResults(arguments); + + print('Building Dynamic Library for libclang wrapper...'); + final options = _getPlatformOptions(); + _deleteOldDylib(); + + // Updates header/lib includes in platform options. + _changeIncludesUsingCmdArgs(argResults, options); + + // Run clang compiler to generate the dynamic library. + final processResult = _runClangProcess(options); + _printDetails(processResult, options); +} + +/// Returns true if auto creating dylib was successful. +/// +/// This will fail if llvm is not in default directories or if .dart_tool +/// doesn't exist. +bool autoCreateDylib() { + _deleteOldDylib(); + final options = _getPlatformOptions(); + final processResult = _runClangProcess(options); + if ((processResult.stderr as String).isNotEmpty) { + print(processResult.stderr); + } + return checkDylibExist(); +} + +bool checkDylibExist() { + return File(path.join( + _getDotDartToolPath(), + strings.ffigenFolderName, + strings.dylibFileName, + )).existsSync(); +} + +/// Removes old dynamic libraries(if any) by deleting .dart_tool/ffigen. +/// +/// Throws error if '.dart_tool' is not found. +void _deleteOldDylib() { + // Find .dart_tool. + final dtpath = _getDotDartToolPath(); + // Find .dart_tool/ffigen and delete recursively if it exists. + final ffigenDir = Directory(path.join(dtpath, strings.ffigenFolderName)); + if (ffigenDir.existsSync()) ffigenDir.deleteSync(recursive: true); +} + +/// Creates necesarry parent folders and return full path to dylib. +String _dylibPath() { + // Find .dart_tool. + final dtpath = _getDotDartToolPath(); + // Create .dart_tool/ffigen if it doesn't exists. + final ffigenDir = Directory(path.join(dtpath, strings.ffigenFolderName)); + if (!ffigenDir.existsSync()) ffigenDir.createSync(); + + // Return dylib path + return path.join(ffigenDir.absolute.path, strings.dylibFileName); +} + +/// Returns full path of the wrapper files. +/// +/// Throws error if not found. +String _getWrapperPath(String wrapperName) { + final file = File.fromUri(findWrapper(wrapperName)!); + if (file.existsSync()) { + return file.absolute.path; + } else { + throw Exception('Unable to find $wrapperName file.'); + } +} + +/// Gets full path to .dart_tool. +/// +/// Throws Exception if not found. +String _getDotDartToolPath() { + final dtpath = findDotDartTool()?.toFilePath(); + if (dtpath == null) { + throw Exception('.dart_tool not found.'); + } + return dtpath; +} + +/// Calls the clang compiler. +ProcessResult _runClangProcess(_Options options) { + final result = Process.runSync( + 'clang', + [ + ...options.headerIncludes, + ...options.libIncludes, + options.ldLibFlag, + options.sharedFlag, + options.fPIC, + options.inputHeader, + '-o', + _dylibPath(), + options.moduleDefPath, + '-Wno-nullability-completeness', + ], + ); + return result; +} + +/// Prints success message (or process error if any). +void _printDetails(ProcessResult result, _Options options) { + print(result.stdout); + if ((result.stderr as String).isNotEmpty) { + print(result.stderr); + } else { + print('Created dynamic library.'); + } +} + +ArgResults _getArgResults(List args) { + final parser = ArgParser(allowTrailingOptions: true); + parser.addSeparator('Generates LLVM Wrapper used by this package:'); + parser.addMultiOption('include-header', + abbr: 'I', help: 'Path to header include directories'); + parser.addMultiOption('include-lib', + abbr: 'L', help: 'Path to library include directories'); + parser.addFlag( + 'help', + abbr: 'h', + help: 'prints this usage', + negatable: false, + ); + + ArgResults results; + try { + results = parser.parse(args); + + if (results.wasParsed('help')) { + print(parser.usage); + exit(0); + } + } catch (e) { + print(e); + print(parser.usage); + exit(1); + } + + return results; +} + +/// Use cmd args(if any) to change header/lib include paths. +void _changeIncludesUsingCmdArgs(ArgResults argResult, _Options options) { + if (argResult.wasParsed('include-header')) { + options.headerIncludes = (argResult['include-header'] as List) + .map((header) => '-I$header') + .toList(); + } + if (argResult.wasParsed('include-lib')) { + options.libIncludes = (argResult['include-lib'] as List) + .map((lib) => '-L$lib') + .toList(); + } +} + +/// Get options based on current platform. +_Options _getPlatformOptions() { + if (Platform.isMacOS) { + return _macOSOpts; + } else if (Platform.isWindows) { + return _windowsOpts; + } else if (Platform.isLinux) { + return _linuxOpts; + } else { + throw Exception('Unknown Platform.'); + } +} + +/// Hold options which would be passed to clang. +class _Options { + /// Tells compiler to generate a shared library. + final String sharedFlag; + + /// Flag for generating Position Independant Code (Not used on windows). + final String fPIC; + + /// Input file. + final String inputHeader; + + /// Path to `.def` file containing symbols to export, windows use only. + final String moduleDefPath; + + /// Path to header files. + List headerIncludes; + + /// Path to dynamic/static libraries + List libIncludes; + + /// Linker flag for linking to libclang. + final String ldLibFlag; + + _Options({ + required this.sharedFlag, + required this.inputHeader, + required this.ldLibFlag, + this.headerIncludes = const [], + this.libIncludes = const [], + this.fPIC = '', + this.moduleDefPath = '', + }); +} diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 2a0700155a..aaddf644e9 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.0.0-nullsafety.0 +version: 2.0.0-nullsafety.1 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C header files. From 06131d639e033e592affa22ab5a1334e817a976e Mon Sep 17 00:00:00 2001 From: Michael Thomsen Date: Tue, 23 Feb 2021 17:38:04 +0100 Subject: [PATCH 057/276] [ffigen] Update README.md (#152) --- pkgs/ffigen/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index e6359eb86c..4eb22ec26f 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -2,8 +2,7 @@ [![Build Status](https://github.com/dart-lang/ffigen/workflows/Dart%20CI/badge.svg)](https://github.com/dart-lang/ffigen/actions?query=workflow%3A"Dart+CI") [![Coverage Status](https://coveralls.io/repos/github/dart-lang/ffigen/badge.svg?branch=master)](https://coveralls.io/github/dart-lang/ffigen?branch=master) -Experimental binding generator for [FFI](https://dart.dev/guides/libraries/c-interop) -bindings. +Binding generator for [FFI](https://dart.dev/guides/libraries/c-interop) bindings. ## Example From 7f3948fd43bfd1309bb6a5cb8a9b9cf436b15489 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 1 Mar 2021 04:12:50 -0800 Subject: [PATCH 058/276] [ffigen] Support for Nested structs (#133) (#161) Co-authored-by: J-P Nurmi --- .../ffigen/.github/workflows/test-package.yml | 12 +- pkgs/ffigen/CHANGELOG.md | 3 + pkgs/ffigen/example/c_json/pubspec.yaml | 2 +- .../libclang-example/generated_bindings.dart | 207 ++++++++- .../example/libclang-example/pubspec.yaml | 2 +- pkgs/ffigen/example/simple/pubspec.yaml | 2 +- pkgs/ffigen/lib/src/code_generator/type.dart | 2 +- .../clang_bindings/clang_bindings.dart | 394 ++++++++---------- .../lib/src/header_parser/includer.dart | 6 +- .../sub_parsers/macro_parser.dart | 12 +- .../sub_parsers/structdecl_parser.dart | 22 +- .../type_extractor/extractor.dart | 5 +- pkgs/ffigen/lib/src/header_parser/utils.dart | 26 +- pkgs/ffigen/pubspec.yaml | 4 +- .../function_n_struct_test.dart | 18 +- .../_expected_libclang_bindings.dart | 196 ++++++++- 16 files changed, 616 insertions(+), 297 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 83fe4d6661..1b5ae04bee 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -14,18 +14,18 @@ env: jobs: # Check code formatting and static analysis on a single OS (linux) - # against Dart stable. + # against Dart dev. analyze: runs-on: ubuntu-latest strategy: fail-fast: false matrix: - sdk: [beta] # TODO(127):Revert to stable when null safety reaches stable branch. + sdk: [2.12.0-198.0.dev] # TODO(127): Revert to stable. steps: - uses: actions/checkout@v2 - - uses: dart-lang/setup-dart@v0.1 + - uses: dart-lang/setup-dart@v1.0 with: - channel: ${{ matrix.sdk }} + sdk: ${{ matrix.sdk }} - id: install name: Install dependencies run: dart pub get @@ -42,9 +42,9 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - - uses: dart-lang/setup-dart@v0.1 + - uses: dart-lang/setup-dart@v1.0 with: - channel: beta # TODO(127):Revert to stable when null safety reaches stable branch. + sdk: 2.12.0-198.0.dev # TODO(127): Revert to stable. - name: Install dependencies run: dart pub get - name: Install libclang-10-dev diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 38fa2af9f3..4fcb483d10 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.0.0-dev.0 +- Added support for Nested structs. + # 2.0.0-nullsafety.1 - Removed the need for `--no-sound-null-safety` flag. diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index dd99e63218..931aaeab0c 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -5,7 +5,7 @@ name: c_json_example environment: - sdk: '>=2.12.0-29.10.beta <3.0.0' + sdk: '>=2.12.0-198.0.dev <3.0.0' dependencies: ffi: ^0.2.0-nullsafety.1 diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index d694962d18..616826f9ee 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -2761,7 +2761,32 @@ class ArrayHelper_CXCursor_data_level0 { /// 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 {} +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 {} @@ -3112,20 +3137,127 @@ class ArrayHelper_CXIdxLoc_ptr_data_level0 { } /// Data for ppIncludedFile callback. -class CXIdxIncludedFileInfo extends ffi.Struct {} +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 {} +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; -class CXIdxAttrInfo extends ffi.Struct {} + external ffi.Pointer name; -class CXIdxEntityInfo extends ffi.Struct {} + external ffi.Pointer USR; -class CXIdxContainerInfo extends ffi.Struct {} + 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 CXIdxIBOutletCollectionAttrInfo extends ffi.Struct {} +class CXIdxDeclInfo extends ffi.Struct { + external ffi.Pointer entityInfo; -class CXIdxDeclInfo extends ffi.Struct {} + 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; @@ -3134,9 +3266,21 @@ class CXIdxObjCContainerDeclInfo extends ffi.Struct { external int kind; } -class CXIdxBaseClassInfo extends ffi.Struct {} +class CXIdxBaseClassInfo extends ffi.Struct { + external ffi.Pointer base; -class CXIdxObjCProtocolRefInfo extends ffi.Struct {} + 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; @@ -3153,7 +3297,17 @@ class CXIdxObjCInterfaceDeclInfo extends ffi.Struct { external ffi.Pointer protocols; } -class CXIdxObjCCategoryDeclInfo extends ffi.Struct {} +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; @@ -3173,7 +3327,36 @@ class CXIdxCXXClassDeclInfo extends ffi.Struct { } /// Data for IndexerCallbacks#indexEntityReference. -class CXIdxEntityRefInfo extends ffi.Struct {} +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. diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index f45148fd24..7e8fc936f2 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -5,7 +5,7 @@ name: libclang_example environment: - sdk: '>=2.12.0-29.10.beta <3.0.0' + sdk: '>=2.12.0-198.0.dev <3.0.0' dev_dependencies: ffigen: diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index 9e461ecc2d..ce3aa5e233 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -5,7 +5,7 @@ name: simple_example environment: - sdk: '>=2.12.0-29.10.beta <3.0.0' + sdk: '>=2.12.0-198.0.dev <3.0.0' dev_dependencies: ffigen: diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index 0f2071e296..014413ae40 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -187,7 +187,7 @@ class Type { } } - String? getDartType(Writer w) { + String getDartType(Writer w) { switch (broadType) { case BroadType.NativeType: return _primitives[nativeType!]!.dart; diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index db8439863b..213f7719a7 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -58,10 +58,9 @@ class Clang { int excludeDeclarationsFromPCH, int displayDiagnostics, ) { - _clang_createIndex ??= + return (_clang_createIndex ??= _dylib.lookupFunction<_c_clang_createIndex, _dart_clang_createIndex>( - 'clang_createIndex'); - return _clang_createIndex!( + 'clang_createIndex'))( excludeDeclarationsFromPCH, displayDiagnostics, ); @@ -76,10 +75,9 @@ class Clang { void clang_disposeIndex( ffi.Pointer index, ) { - _clang_disposeIndex ??= + return (_clang_disposeIndex ??= _dylib.lookupFunction<_c_clang_disposeIndex, _dart_clang_disposeIndex>( - 'clang_disposeIndex'); - return _clang_disposeIndex!( + 'clang_disposeIndex'))( index, ); } @@ -91,10 +89,9 @@ class Clang { int clang_getNumDiagnostics( ffi.Pointer Unit, ) { - _clang_getNumDiagnostics ??= _dylib.lookupFunction< + return (_clang_getNumDiagnostics ??= _dylib.lookupFunction< _c_clang_getNumDiagnostics, - _dart_clang_getNumDiagnostics>('clang_getNumDiagnostics'); - return _clang_getNumDiagnostics!( + _dart_clang_getNumDiagnostics>('clang_getNumDiagnostics'))( Unit, ); } @@ -112,9 +109,9 @@ class Clang { ffi.Pointer Unit, int Index, ) { - _clang_getDiagnostic ??= _dylib.lookupFunction<_c_clang_getDiagnostic, - _dart_clang_getDiagnostic>('clang_getDiagnostic'); - return _clang_getDiagnostic!( + return (_clang_getDiagnostic ??= _dylib.lookupFunction< + _c_clang_getDiagnostic, + _dart_clang_getDiagnostic>('clang_getDiagnostic'))( Unit, Index, ); @@ -126,10 +123,9 @@ class Clang { void clang_disposeDiagnostic( ffi.Pointer Diagnostic, ) { - _clang_disposeDiagnostic ??= _dylib.lookupFunction< + return (_clang_disposeDiagnostic ??= _dylib.lookupFunction< _c_clang_disposeDiagnostic, - _dart_clang_disposeDiagnostic>('clang_disposeDiagnostic'); - return _clang_disposeDiagnostic!( + _dart_clang_disposeDiagnostic>('clang_disposeDiagnostic'))( Diagnostic, ); } @@ -149,10 +145,9 @@ class Clang { int num_unsaved_files, int options, ) { - _clang_parseTranslationUnit ??= _dylib.lookupFunction< + return (_clang_parseTranslationUnit ??= _dylib.lookupFunction< _c_clang_parseTranslationUnit, - _dart_clang_parseTranslationUnit>('clang_parseTranslationUnit'); - return _clang_parseTranslationUnit!( + _dart_clang_parseTranslationUnit>('clang_parseTranslationUnit'))( CIdx, source_filename, command_line_args, @@ -169,10 +164,9 @@ class Clang { void clang_disposeTranslationUnit( ffi.Pointer arg0, ) { - _clang_disposeTranslationUnit ??= _dylib.lookupFunction< + return (_clang_disposeTranslationUnit ??= _dylib.lookupFunction< _c_clang_disposeTranslationUnit, - _dart_clang_disposeTranslationUnit>('clang_disposeTranslationUnit'); - return _clang_disposeTranslationUnit!( + _dart_clang_disposeTranslationUnit>('clang_disposeTranslationUnit'))( arg0, ); } @@ -183,10 +177,9 @@ class Clang { int clang_EvalResult_getKind( ffi.Pointer E, ) { - _clang_EvalResult_getKind ??= _dylib.lookupFunction< + return (_clang_EvalResult_getKind ??= _dylib.lookupFunction< _c_clang_EvalResult_getKind, - _dart_clang_EvalResult_getKind>('clang_EvalResult_getKind'); - return _clang_EvalResult_getKind!( + _dart_clang_EvalResult_getKind>('clang_EvalResult_getKind'))( E, ); } @@ -198,10 +191,9 @@ class Clang { int clang_EvalResult_getAsInt( ffi.Pointer E, ) { - _clang_EvalResult_getAsInt ??= _dylib.lookupFunction< + return (_clang_EvalResult_getAsInt ??= _dylib.lookupFunction< _c_clang_EvalResult_getAsInt, - _dart_clang_EvalResult_getAsInt>('clang_EvalResult_getAsInt'); - return _clang_EvalResult_getAsInt!( + _dart_clang_EvalResult_getAsInt>('clang_EvalResult_getAsInt'))( E, ); } @@ -214,10 +206,10 @@ class Clang { int clang_EvalResult_getAsLongLong( ffi.Pointer E, ) { - _clang_EvalResult_getAsLongLong ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsLongLong, - _dart_clang_EvalResult_getAsLongLong>('clang_EvalResult_getAsLongLong'); - return _clang_EvalResult_getAsLongLong!( + return (_clang_EvalResult_getAsLongLong ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsLongLong, + _dart_clang_EvalResult_getAsLongLong>( + 'clang_EvalResult_getAsLongLong'))( E, ); } @@ -229,10 +221,9 @@ class Clang { double clang_EvalResult_getAsDouble( ffi.Pointer E, ) { - _clang_EvalResult_getAsDouble ??= _dylib.lookupFunction< + return (_clang_EvalResult_getAsDouble ??= _dylib.lookupFunction< _c_clang_EvalResult_getAsDouble, - _dart_clang_EvalResult_getAsDouble>('clang_EvalResult_getAsDouble'); - return _clang_EvalResult_getAsDouble!( + _dart_clang_EvalResult_getAsDouble>('clang_EvalResult_getAsDouble'))( E, ); } @@ -246,10 +237,9 @@ class Clang { ffi.Pointer clang_EvalResult_getAsStr( ffi.Pointer E, ) { - _clang_EvalResult_getAsStr ??= _dylib.lookupFunction< + return (_clang_EvalResult_getAsStr ??= _dylib.lookupFunction< _c_clang_EvalResult_getAsStr, - _dart_clang_EvalResult_getAsStr>('clang_EvalResult_getAsStr'); - return _clang_EvalResult_getAsStr!( + _dart_clang_EvalResult_getAsStr>('clang_EvalResult_getAsStr'))( E, ); } @@ -260,10 +250,9 @@ class Clang { void clang_EvalResult_dispose( ffi.Pointer E, ) { - _clang_EvalResult_dispose ??= _dylib.lookupFunction< + return (_clang_EvalResult_dispose ??= _dylib.lookupFunction< _c_clang_EvalResult_dispose, - _dart_clang_EvalResult_dispose>('clang_EvalResult_dispose'); - return _clang_EvalResult_dispose!( + _dart_clang_EvalResult_dispose>('clang_EvalResult_dispose'))( E, ); } @@ -273,9 +262,9 @@ class Clang { ffi.Pointer clang_getCString_wrap( ffi.Pointer string, ) { - _clang_getCString_wrap ??= _dylib.lookupFunction<_c_clang_getCString_wrap, - _dart_clang_getCString_wrap>('clang_getCString_wrap'); - return _clang_getCString_wrap!( + return (_clang_getCString_wrap ??= _dylib.lookupFunction< + _c_clang_getCString_wrap, + _dart_clang_getCString_wrap>('clang_getCString_wrap'))( string, ); } @@ -285,10 +274,9 @@ class Clang { void clang_disposeString_wrap( ffi.Pointer string, ) { - _clang_disposeString_wrap ??= _dylib.lookupFunction< + return (_clang_disposeString_wrap ??= _dylib.lookupFunction< _c_clang_disposeString_wrap, - _dart_clang_disposeString_wrap>('clang_disposeString_wrap'); - return _clang_disposeString_wrap!( + _dart_clang_disposeString_wrap>('clang_disposeString_wrap'))( string, ); } @@ -298,10 +286,9 @@ class Clang { int clang_getCursorKind_wrap( ffi.Pointer cursor, ) { - _clang_getCursorKind_wrap ??= _dylib.lookupFunction< + return (_clang_getCursorKind_wrap ??= _dylib.lookupFunction< _c_clang_getCursorKind_wrap, - _dart_clang_getCursorKind_wrap>('clang_getCursorKind_wrap'); - return _clang_getCursorKind_wrap!( + _dart_clang_getCursorKind_wrap>('clang_getCursorKind_wrap'))( cursor, ); } @@ -311,11 +298,10 @@ class Clang { ffi.Pointer clang_getCursorKindSpelling_wrap( int kind, ) { - _clang_getCursorKindSpelling_wrap ??= _dylib.lookupFunction< + return (_clang_getCursorKindSpelling_wrap ??= _dylib.lookupFunction< _c_clang_getCursorKindSpelling_wrap, _dart_clang_getCursorKindSpelling_wrap>( - 'clang_getCursorKindSpelling_wrap'); - return _clang_getCursorKindSpelling_wrap!( + 'clang_getCursorKindSpelling_wrap'))( kind, ); } @@ -325,10 +311,9 @@ class Clang { ffi.Pointer clang_getCursorType_wrap( ffi.Pointer cursor, ) { - _clang_getCursorType_wrap ??= _dylib.lookupFunction< + return (_clang_getCursorType_wrap ??= _dylib.lookupFunction< _c_clang_getCursorType_wrap, - _dart_clang_getCursorType_wrap>('clang_getCursorType_wrap'); - return _clang_getCursorType_wrap!( + _dart_clang_getCursorType_wrap>('clang_getCursorType_wrap'))( cursor, ); } @@ -338,10 +323,9 @@ class Clang { ffi.Pointer clang_getTypeSpelling_wrap( ffi.Pointer type, ) { - _clang_getTypeSpelling_wrap ??= _dylib.lookupFunction< + return (_clang_getTypeSpelling_wrap ??= _dylib.lookupFunction< _c_clang_getTypeSpelling_wrap, - _dart_clang_getTypeSpelling_wrap>('clang_getTypeSpelling_wrap'); - return _clang_getTypeSpelling_wrap!( + _dart_clang_getTypeSpelling_wrap>('clang_getTypeSpelling_wrap'))( type, ); } @@ -349,12 +333,12 @@ class Clang { _dart_clang_getTypeSpelling_wrap? _clang_getTypeSpelling_wrap; ffi.Pointer clang_getTypeKindSpelling_wrap( - int? typeKind, + int typeKind, ) { - _clang_getTypeKindSpelling_wrap ??= _dylib.lookupFunction< - _c_clang_getTypeKindSpelling_wrap, - _dart_clang_getTypeKindSpelling_wrap>('clang_getTypeKindSpelling_wrap'); - return _clang_getTypeKindSpelling_wrap!( + return (_clang_getTypeKindSpelling_wrap ??= _dylib.lookupFunction< + _c_clang_getTypeKindSpelling_wrap, + _dart_clang_getTypeKindSpelling_wrap>( + 'clang_getTypeKindSpelling_wrap'))( typeKind, ); } @@ -364,10 +348,9 @@ class Clang { ffi.Pointer clang_getResultType_wrap( ffi.Pointer functionType, ) { - _clang_getResultType_wrap ??= _dylib.lookupFunction< + return (_clang_getResultType_wrap ??= _dylib.lookupFunction< _c_clang_getResultType_wrap, - _dart_clang_getResultType_wrap>('clang_getResultType_wrap'); - return _clang_getResultType_wrap!( + _dart_clang_getResultType_wrap>('clang_getResultType_wrap'))( functionType, ); } @@ -377,10 +360,9 @@ class Clang { ffi.Pointer clang_getPointeeType_wrap( ffi.Pointer pointerType, ) { - _clang_getPointeeType_wrap ??= _dylib.lookupFunction< + return (_clang_getPointeeType_wrap ??= _dylib.lookupFunction< _c_clang_getPointeeType_wrap, - _dart_clang_getPointeeType_wrap>('clang_getPointeeType_wrap'); - return _clang_getPointeeType_wrap!( + _dart_clang_getPointeeType_wrap>('clang_getPointeeType_wrap'))( pointerType, ); } @@ -390,10 +372,9 @@ class Clang { ffi.Pointer clang_getCanonicalType_wrap( ffi.Pointer typerefType, ) { - _clang_getCanonicalType_wrap ??= _dylib.lookupFunction< + return (_clang_getCanonicalType_wrap ??= _dylib.lookupFunction< _c_clang_getCanonicalType_wrap, - _dart_clang_getCanonicalType_wrap>('clang_getCanonicalType_wrap'); - return _clang_getCanonicalType_wrap!( + _dart_clang_getCanonicalType_wrap>('clang_getCanonicalType_wrap'))( typerefType, ); } @@ -403,10 +384,9 @@ class Clang { ffi.Pointer clang_Type_getNamedType_wrap( ffi.Pointer elaboratedType, ) { - _clang_Type_getNamedType_wrap ??= _dylib.lookupFunction< + return (_clang_Type_getNamedType_wrap ??= _dylib.lookupFunction< _c_clang_Type_getNamedType_wrap, - _dart_clang_Type_getNamedType_wrap>('clang_Type_getNamedType_wrap'); - return _clang_Type_getNamedType_wrap!( + _dart_clang_Type_getNamedType_wrap>('clang_Type_getNamedType_wrap'))( elaboratedType, ); } @@ -416,10 +396,9 @@ class Clang { ffi.Pointer clang_getTypeDeclaration_wrap( ffi.Pointer cxtype, ) { - _clang_getTypeDeclaration_wrap ??= _dylib.lookupFunction< + return (_clang_getTypeDeclaration_wrap ??= _dylib.lookupFunction< _c_clang_getTypeDeclaration_wrap, - _dart_clang_getTypeDeclaration_wrap>('clang_getTypeDeclaration_wrap'); - return _clang_getTypeDeclaration_wrap!( + _dart_clang_getTypeDeclaration_wrap>('clang_getTypeDeclaration_wrap'))( cxtype, ); } @@ -429,11 +408,10 @@ class Clang { ffi.Pointer clang_getTypedefDeclUnderlyingType_wrap( ffi.Pointer cxcursor, ) { - _clang_getTypedefDeclUnderlyingType_wrap ??= _dylib.lookupFunction< + return (_clang_getTypedefDeclUnderlyingType_wrap ??= _dylib.lookupFunction< _c_clang_getTypedefDeclUnderlyingType_wrap, _dart_clang_getTypedefDeclUnderlyingType_wrap>( - 'clang_getTypedefDeclUnderlyingType_wrap'); - return _clang_getTypedefDeclUnderlyingType_wrap!( + 'clang_getTypedefDeclUnderlyingType_wrap'))( cxcursor, ); } @@ -445,10 +423,9 @@ class Clang { ffi.Pointer clang_getCursorSpelling_wrap( ffi.Pointer cursor, ) { - _clang_getCursorSpelling_wrap ??= _dylib.lookupFunction< + return (_clang_getCursorSpelling_wrap ??= _dylib.lookupFunction< _c_clang_getCursorSpelling_wrap, - _dart_clang_getCursorSpelling_wrap>('clang_getCursorSpelling_wrap'); - return _clang_getCursorSpelling_wrap!( + _dart_clang_getCursorSpelling_wrap>('clang_getCursorSpelling_wrap'))( cursor, ); } @@ -458,11 +435,10 @@ class Clang { ffi.Pointer clang_getTranslationUnitCursor_wrap( ffi.Pointer tu, ) { - _clang_getTranslationUnitCursor_wrap ??= _dylib.lookupFunction< + return (_clang_getTranslationUnitCursor_wrap ??= _dylib.lookupFunction< _c_clang_getTranslationUnitCursor_wrap, _dart_clang_getTranslationUnitCursor_wrap>( - 'clang_getTranslationUnitCursor_wrap'); - return _clang_getTranslationUnitCursor_wrap!( + 'clang_getTranslationUnitCursor_wrap'))( tu, ); } @@ -474,10 +450,9 @@ class Clang { ffi.Pointer diag, int opts, ) { - _clang_formatDiagnostic_wrap ??= _dylib.lookupFunction< + return (_clang_formatDiagnostic_wrap ??= _dylib.lookupFunction< _c_clang_formatDiagnostic_wrap, - _dart_clang_formatDiagnostic_wrap>('clang_formatDiagnostic_wrap'); - return _clang_formatDiagnostic_wrap!( + _dart_clang_formatDiagnostic_wrap>('clang_formatDiagnostic_wrap'))( diag, opts, ); @@ -492,10 +467,9 @@ class Clang { ffi.Pointer> _modifiedVisitor, int uid, ) { - _clang_visitChildren_wrap ??= _dylib.lookupFunction< + return (_clang_visitChildren_wrap ??= _dylib.lookupFunction< _c_clang_visitChildren_wrap, - _dart_clang_visitChildren_wrap>('clang_visitChildren_wrap'); - return _clang_visitChildren_wrap!( + _dart_clang_visitChildren_wrap>('clang_visitChildren_wrap'))( parent, _modifiedVisitor, uid, @@ -507,11 +481,10 @@ class Clang { int clang_Cursor_getNumArguments_wrap( ffi.Pointer cursor, ) { - _clang_Cursor_getNumArguments_wrap ??= _dylib.lookupFunction< + return (_clang_Cursor_getNumArguments_wrap ??= _dylib.lookupFunction< _c_clang_Cursor_getNumArguments_wrap, _dart_clang_Cursor_getNumArguments_wrap>( - 'clang_Cursor_getNumArguments_wrap'); - return _clang_Cursor_getNumArguments_wrap!( + 'clang_Cursor_getNumArguments_wrap'))( cursor, ); } @@ -522,10 +495,9 @@ class Clang { ffi.Pointer cursor, int i, ) { - _clang_Cursor_getArgument_wrap ??= _dylib.lookupFunction< + return (_clang_Cursor_getArgument_wrap ??= _dylib.lookupFunction< _c_clang_Cursor_getArgument_wrap, - _dart_clang_Cursor_getArgument_wrap>('clang_Cursor_getArgument_wrap'); - return _clang_Cursor_getArgument_wrap!( + _dart_clang_Cursor_getArgument_wrap>('clang_Cursor_getArgument_wrap'))( cursor, i, ); @@ -536,10 +508,9 @@ class Clang { int clang_getNumArgTypes_wrap( ffi.Pointer cxtype, ) { - _clang_getNumArgTypes_wrap ??= _dylib.lookupFunction< + return (_clang_getNumArgTypes_wrap ??= _dylib.lookupFunction< _c_clang_getNumArgTypes_wrap, - _dart_clang_getNumArgTypes_wrap>('clang_getNumArgTypes_wrap'); - return _clang_getNumArgTypes_wrap!( + _dart_clang_getNumArgTypes_wrap>('clang_getNumArgTypes_wrap'))( cxtype, ); } @@ -550,9 +521,9 @@ class Clang { ffi.Pointer cxtype, int i, ) { - _clang_getArgType_wrap ??= _dylib.lookupFunction<_c_clang_getArgType_wrap, - _dart_clang_getArgType_wrap>('clang_getArgType_wrap'); - return _clang_getArgType_wrap!( + return (_clang_getArgType_wrap ??= _dylib.lookupFunction< + _c_clang_getArgType_wrap, + _dart_clang_getArgType_wrap>('clang_getArgType_wrap'))( cxtype, i, ); @@ -563,11 +534,10 @@ class Clang { int clang_getEnumConstantDeclValue_wrap( ffi.Pointer cursor, ) { - _clang_getEnumConstantDeclValue_wrap ??= _dylib.lookupFunction< + return (_clang_getEnumConstantDeclValue_wrap ??= _dylib.lookupFunction< _c_clang_getEnumConstantDeclValue_wrap, _dart_clang_getEnumConstantDeclValue_wrap>( - 'clang_getEnumConstantDeclValue_wrap'); - return _clang_getEnumConstantDeclValue_wrap!( + 'clang_getEnumConstantDeclValue_wrap'))( cursor, ); } @@ -580,9 +550,9 @@ class Clang { ffi.Pointer c1, ffi.Pointer c2, ) { - _clang_equalRanges_wrap ??= _dylib.lookupFunction<_c_clang_equalRanges_wrap, - _dart_clang_equalRanges_wrap>('clang_equalRanges_wrap'); - return _clang_equalRanges_wrap!( + return (_clang_equalRanges_wrap ??= _dylib.lookupFunction< + _c_clang_equalRanges_wrap, + _dart_clang_equalRanges_wrap>('clang_equalRanges_wrap'))( c1, c2, ); @@ -594,11 +564,10 @@ class Clang { ffi.Pointer clang_Cursor_getCommentRange_wrap( ffi.Pointer cursor, ) { - _clang_Cursor_getCommentRange_wrap ??= _dylib.lookupFunction< + return (_clang_Cursor_getCommentRange_wrap ??= _dylib.lookupFunction< _c_clang_Cursor_getCommentRange_wrap, _dart_clang_Cursor_getCommentRange_wrap>( - 'clang_Cursor_getCommentRange_wrap'); - return _clang_Cursor_getCommentRange_wrap!( + 'clang_Cursor_getCommentRange_wrap'))( cursor, ); } @@ -609,11 +578,10 @@ class Clang { ffi.Pointer clang_Cursor_getRawCommentText_wrap( ffi.Pointer cursor, ) { - _clang_Cursor_getRawCommentText_wrap ??= _dylib.lookupFunction< + return (_clang_Cursor_getRawCommentText_wrap ??= _dylib.lookupFunction< _c_clang_Cursor_getRawCommentText_wrap, _dart_clang_Cursor_getRawCommentText_wrap>( - 'clang_Cursor_getRawCommentText_wrap'); - return _clang_Cursor_getRawCommentText_wrap!( + 'clang_Cursor_getRawCommentText_wrap'))( cursor, ); } @@ -625,11 +593,10 @@ class Clang { ffi.Pointer clang_Cursor_getBriefCommentText_wrap( ffi.Pointer cursor, ) { - _clang_Cursor_getBriefCommentText_wrap ??= _dylib.lookupFunction< + return (_clang_Cursor_getBriefCommentText_wrap ??= _dylib.lookupFunction< _c_clang_Cursor_getBriefCommentText_wrap, _dart_clang_Cursor_getBriefCommentText_wrap>( - 'clang_Cursor_getBriefCommentText_wrap'); - return _clang_Cursor_getBriefCommentText_wrap!( + 'clang_Cursor_getBriefCommentText_wrap'))( cursor, ); } @@ -640,10 +607,9 @@ class Clang { ffi.Pointer clang_getCursorLocation_wrap( ffi.Pointer cursor, ) { - _clang_getCursorLocation_wrap ??= _dylib.lookupFunction< + return (_clang_getCursorLocation_wrap ??= _dylib.lookupFunction< _c_clang_getCursorLocation_wrap, - _dart_clang_getCursorLocation_wrap>('clang_getCursorLocation_wrap'); - return _clang_getCursorLocation_wrap!( + _dart_clang_getCursorLocation_wrap>('clang_getCursorLocation_wrap'))( cursor, ); } @@ -657,10 +623,9 @@ class Clang { ffi.Pointer column, ffi.Pointer offset, ) { - _clang_getFileLocation_wrap ??= _dylib.lookupFunction< + return (_clang_getFileLocation_wrap ??= _dylib.lookupFunction< _c_clang_getFileLocation_wrap, - _dart_clang_getFileLocation_wrap>('clang_getFileLocation_wrap'); - return _clang_getFileLocation_wrap!( + _dart_clang_getFileLocation_wrap>('clang_getFileLocation_wrap'))( location, file, line, @@ -674,9 +639,9 @@ class Clang { ffi.Pointer clang_getFileName_wrap( ffi.Pointer SFile, ) { - _clang_getFileName_wrap ??= _dylib.lookupFunction<_c_clang_getFileName_wrap, - _dart_clang_getFileName_wrap>('clang_getFileName_wrap'); - return _clang_getFileName_wrap!( + return (_clang_getFileName_wrap ??= _dylib.lookupFunction< + _c_clang_getFileName_wrap, + _dart_clang_getFileName_wrap>('clang_getFileName_wrap'))( SFile, ); } @@ -686,10 +651,9 @@ class Clang { int clang_getNumElements_wrap( ffi.Pointer cxtype, ) { - _clang_getNumElements_wrap ??= _dylib.lookupFunction< + return (_clang_getNumElements_wrap ??= _dylib.lookupFunction< _c_clang_getNumElements_wrap, - _dart_clang_getNumElements_wrap>('clang_getNumElements_wrap'); - return _clang_getNumElements_wrap!( + _dart_clang_getNumElements_wrap>('clang_getNumElements_wrap'))( cxtype, ); } @@ -699,10 +663,10 @@ class Clang { ffi.Pointer clang_getArrayElementType_wrap( ffi.Pointer cxtype, ) { - _clang_getArrayElementType_wrap ??= _dylib.lookupFunction< - _c_clang_getArrayElementType_wrap, - _dart_clang_getArrayElementType_wrap>('clang_getArrayElementType_wrap'); - return _clang_getArrayElementType_wrap!( + return (_clang_getArrayElementType_wrap ??= _dylib.lookupFunction< + _c_clang_getArrayElementType_wrap, + _dart_clang_getArrayElementType_wrap>( + 'clang_getArrayElementType_wrap'))( cxtype, ); } @@ -712,11 +676,10 @@ class Clang { int clang_Cursor_isMacroFunctionLike_wrap( ffi.Pointer cursor, ) { - _clang_Cursor_isMacroFunctionLike_wrap ??= _dylib.lookupFunction< + return (_clang_Cursor_isMacroFunctionLike_wrap ??= _dylib.lookupFunction< _c_clang_Cursor_isMacroFunctionLike_wrap, _dart_clang_Cursor_isMacroFunctionLike_wrap>( - 'clang_Cursor_isMacroFunctionLike_wrap'); - return _clang_Cursor_isMacroFunctionLike_wrap!( + 'clang_Cursor_isMacroFunctionLike_wrap'))( cursor, ); } @@ -727,11 +690,10 @@ class Clang { int clang_Cursor_isMacroBuiltin_wrap( ffi.Pointer cursor, ) { - _clang_Cursor_isMacroBuiltin_wrap ??= _dylib.lookupFunction< + return (_clang_Cursor_isMacroBuiltin_wrap ??= _dylib.lookupFunction< _c_clang_Cursor_isMacroBuiltin_wrap, _dart_clang_Cursor_isMacroBuiltin_wrap>( - 'clang_Cursor_isMacroBuiltin_wrap'); - return _clang_Cursor_isMacroBuiltin_wrap!( + 'clang_Cursor_isMacroBuiltin_wrap'))( cursor, ); } @@ -741,10 +703,9 @@ class Clang { ffi.Pointer clang_Cursor_Evaluate_wrap( ffi.Pointer cursor, ) { - _clang_Cursor_Evaluate_wrap ??= _dylib.lookupFunction< + return (_clang_Cursor_Evaluate_wrap ??= _dylib.lookupFunction< _c_clang_Cursor_Evaluate_wrap, - _dart_clang_Cursor_Evaluate_wrap>('clang_Cursor_Evaluate_wrap'); - return _clang_Cursor_Evaluate_wrap!( + _dart_clang_Cursor_Evaluate_wrap>('clang_Cursor_Evaluate_wrap'))( cursor, ); } @@ -754,10 +715,9 @@ class Clang { int clang_Cursor_isAnonymous_wrap( ffi.Pointer cursor, ) { - _clang_Cursor_isAnonymous_wrap ??= _dylib.lookupFunction< + return (_clang_Cursor_isAnonymous_wrap ??= _dylib.lookupFunction< _c_clang_Cursor_isAnonymous_wrap, - _dart_clang_Cursor_isAnonymous_wrap>('clang_Cursor_isAnonymous_wrap'); - return _clang_Cursor_isAnonymous_wrap!( + _dart_clang_Cursor_isAnonymous_wrap>('clang_Cursor_isAnonymous_wrap'))( cursor, ); } @@ -767,11 +727,10 @@ class Clang { int clang_Cursor_isAnonymousRecordDecl_wrap( ffi.Pointer cursor, ) { - _clang_Cursor_isAnonymousRecordDecl_wrap ??= _dylib.lookupFunction< + return (_clang_Cursor_isAnonymousRecordDecl_wrap ??= _dylib.lookupFunction< _c_clang_Cursor_isAnonymousRecordDecl_wrap, _dart_clang_Cursor_isAnonymousRecordDecl_wrap>( - 'clang_Cursor_isAnonymousRecordDecl_wrap'); - return _clang_Cursor_isAnonymousRecordDecl_wrap!( + 'clang_Cursor_isAnonymousRecordDecl_wrap'))( cursor, ); } @@ -782,10 +741,9 @@ class Clang { ffi.Pointer clang_getCursorUSR_wrap( ffi.Pointer cursor, ) { - _clang_getCursorUSR_wrap ??= _dylib.lookupFunction< + return (_clang_getCursorUSR_wrap ??= _dylib.lookupFunction< _c_clang_getCursorUSR_wrap, - _dart_clang_getCursorUSR_wrap>('clang_getCursorUSR_wrap'); - return _clang_getCursorUSR_wrap!( + _dart_clang_getCursorUSR_wrap>('clang_getCursorUSR_wrap'))( cursor, ); } @@ -795,11 +753,10 @@ class Clang { int clang_getFieldDeclBitWidth_wrap( ffi.Pointer cursor, ) { - _clang_getFieldDeclBitWidth_wrap ??= _dylib.lookupFunction< + return (_clang_getFieldDeclBitWidth_wrap ??= _dylib.lookupFunction< _c_clang_getFieldDeclBitWidth_wrap, _dart_clang_getFieldDeclBitWidth_wrap>( - 'clang_getFieldDeclBitWidth_wrap'); - return _clang_getFieldDeclBitWidth_wrap!( + 'clang_getFieldDeclBitWidth_wrap'))( cursor, ); } @@ -814,10 +771,10 @@ class Clang { /// 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 { - ffi.Pointer? data; + external ffi.Pointer data; @ffi.Uint32() - int? private_flags; + external int private_flags; } class CXTranslationUnitImpl extends ffi.Struct {} @@ -831,14 +788,14 @@ class CXUnsavedFile extends ffi.Struct { /// The file whose contents have not yet been saved. /// /// This file must already exist in the file system. - ffi.Pointer? Filename; + external ffi.Pointer Filename; /// A buffer containing the unsaved contents of this file. - ffi.Pointer? Contents; + external ffi.Pointer Contents; /// The length of the unsaved contents of this buffer. @ffi.Uint64() - int? Length; + external int Length; } /// Identifies a specific source location within a translation @@ -847,14 +804,14 @@ class CXUnsavedFile extends ffi.Struct { /// Use clang_getExpansionLocation() or clang_getSpellingLocation() /// to map a source location to a particular file, line, and column. class CXSourceLocation extends ffi.Struct { - ffi.Pointer? _unique_ptr_data_item_0; - ffi.Pointer? _unique_ptr_data_item_1; + 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() - int? int_data; + external int int_data; } /// Helper for array `ptr_data` in struct `CXSourceLocation`. @@ -873,7 +830,7 @@ class ArrayHelper_CXSourceLocation_ptr_data_level0 { } } - ffi.Pointer? operator [](int index) { + ffi.Pointer operator [](int index) { _checkBounds(index); switch (_absoluteIndex + index) { case 0: @@ -905,17 +862,17 @@ class ArrayHelper_CXSourceLocation_ptr_data_level0 { /// Use clang_getRangeStart() and clang_getRangeEnd() to retrieve the /// starting and end locations from a source range, respectively. class CXSourceRange extends ffi.Struct { - ffi.Pointer? _unique_ptr_data_item_0; - ffi.Pointer? _unique_ptr_data_item_1; + 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() - int? begin_int_data; + external int begin_int_data; @ffi.Uint32() - int? end_int_data; + external int end_int_data; } /// Helper for array `ptr_data` in struct `CXSourceRange`. @@ -934,7 +891,7 @@ class ArrayHelper_CXSourceRange_ptr_data_level0 { } } - ffi.Pointer? operator [](int index) { + ffi.Pointer operator [](int index) { _checkBounds(index); switch (_absoluteIndex + index) { case 0: @@ -1472,46 +1429,49 @@ abstract class CXCursorKind { /// \endcode static const int CXCursor_CXXFunctionalCastExpr = 128; + /// OpenCL's addrspace_cast<> expression. + static const int CXCursor_CXXAddrspaceCastExpr = 129; + /// A C++ typeid expression (C++ [expr.typeid]). - static const int CXCursor_CXXTypeidExpr = 129; + static const int CXCursor_CXXTypeidExpr = 130; /// [C++ 2.13.5] C++ Boolean Literal. - static const int CXCursor_CXXBoolLiteralExpr = 130; + static const int CXCursor_CXXBoolLiteralExpr = 131; /// [C++0x 2.14.7] C++ Pointer Literal. - static const int CXCursor_CXXNullPtrLiteralExpr = 131; + static const int CXCursor_CXXNullPtrLiteralExpr = 132; /// Represents the "this" expression in C++ - static const int CXCursor_CXXThisExpr = 132; + static const int CXCursor_CXXThisExpr = 133; /// [C++ 15] C++ Throw Expression. /// /// This handles 'throw' and 'throw' assignment-expression. When /// assignment-expression isn't present, Op will be null. - static const int CXCursor_CXXThrowExpr = 133; + static const int CXCursor_CXXThrowExpr = 134; /// A new expression for memory allocation and constructor calls, e.g: /// "new CXXNewExpr(foo)". - static const int CXCursor_CXXNewExpr = 134; + static const int CXCursor_CXXNewExpr = 135; /// A delete expression for memory deallocation and destructor calls, /// e.g. "delete[] pArray". - static const int CXCursor_CXXDeleteExpr = 135; + static const int CXCursor_CXXDeleteExpr = 136; /// A unary expression. (noexcept, sizeof, or other traits) - static const int CXCursor_UnaryExpr = 136; + static const int CXCursor_UnaryExpr = 137; /// An Objective-C string literal i.e. @"foo". - static const int CXCursor_ObjCStringLiteral = 137; + static const int CXCursor_ObjCStringLiteral = 138; /// An Objective-C \@encode expression. - static const int CXCursor_ObjCEncodeExpr = 138; + static const int CXCursor_ObjCEncodeExpr = 139; /// An Objective-C \@selector expression. - static const int CXCursor_ObjCSelectorExpr = 139; + static const int CXCursor_ObjCSelectorExpr = 140; /// An Objective-C \@protocol expression. - static const int CXCursor_ObjCProtocolExpr = 140; + static const int CXCursor_ObjCProtocolExpr = 141; /// An Objective-C "bridged" cast expression, which casts between /// Objective-C pointers and C pointers, transferring ownership in the process. @@ -1519,7 +1479,7 @@ abstract class CXCursorKind { /// \code /// NSString *str = (__bridge_transfer NSString *)CFCreateString(); /// \endcode - static const int CXCursor_ObjCBridgedCastExpr = 141; + static const int CXCursor_ObjCBridgedCastExpr = 142; /// Represents a C++0x pack expansion that produces a sequence of /// expressions. @@ -1533,7 +1493,7 @@ abstract class CXCursorKind { /// f(static_cast(args)...); /// } /// \endcode - static const int CXCursor_PackExpansionExpr = 142; + static const int CXCursor_PackExpansionExpr = 143; /// Represents an expression that computes the length of a parameter /// pack. @@ -1544,24 +1504,30 @@ abstract class CXCursorKind { /// static const unsigned value = sizeof...(Types); /// }; /// \endcode - static const int CXCursor_SizeOfPackExpr = 143; - static const int CXCursor_LambdaExpr = 144; + static const int CXCursor_SizeOfPackExpr = 144; + static const int CXCursor_LambdaExpr = 145; /// Objective-c Boolean Literal. - static const int CXCursor_ObjCBoolLiteralExpr = 145; + static const int CXCursor_ObjCBoolLiteralExpr = 146; /// Represents the "self" expression in an Objective-C method. - static const int CXCursor_ObjCSelfExpr = 146; + static const int CXCursor_ObjCSelfExpr = 147; - /// OpenMP 4.0 [2.4, Array Section]. - static const int CXCursor_OMPArraySectionExpr = 147; + /// OpenMP 5.0 [2.1.5, Array Section]. + static const int CXCursor_OMPArraySectionExpr = 148; /// Represents an @available(...) check. - static const int CXCursor_ObjCAvailabilityCheckExpr = 148; + static const int CXCursor_ObjCAvailabilityCheckExpr = 149; /// Fixed point literal - static const int CXCursor_FixedPointLiteral = 149; - static const int CXCursor_LastExpr = 149; + static const int CXCursor_FixedPointLiteral = 150; + + /// OpenMP 5.0 [2.1.4, Array Shaping]. + static const int CXCursor_OMPArrayShapingExpr = 151; + + /// OpenMP 5.0 [2.1.6 Iterators] + static const int CXCursor_OMPIteratorExpr = 152; + static const int CXCursor_LastExpr = 152; static const int CXCursor_FirstStmt = 200; /// A statement whose specific kind is not exposed via this @@ -1843,7 +1809,13 @@ abstract class CXCursorKind { /// OpenMP parallel master directive. static const int CXCursor_OMPParallelMasterDirective = 285; - static const int CXCursor_LastStmt = 285; + + /// OpenMP depobj directive. + static const int CXCursor_OMPDepobjDirective = 286; + + /// OpenMP scan directive. + static const int CXCursor_OMPScanDirective = 287; + static const int CXCursor_LastStmt = 287; /// Cursor that represents the translation unit itself. /// @@ -1939,14 +1911,14 @@ abstract class CXCursorKind { /// source code into the AST. class CXCursor extends ffi.Struct { @ffi.Int32() - int? kind; + external int kind; @ffi.Int32() - int? xdata; + external int xdata; - ffi.Pointer? _unique_data_item_0; - ffi.Pointer? _unique_data_item_1; - ffi.Pointer? _unique_data_item_2; + 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 => @@ -1969,7 +1941,7 @@ class ArrayHelper_CXCursor_data_level0 { } } - ffi.Pointer? operator [](int index) { + ffi.Pointer operator [](int index) { _checkBounds(index); switch (_absoluteIndex + index) { case 0: @@ -2046,8 +2018,9 @@ abstract class CXTypeKind { static const int CXType_UShortAccum = 36; static const int CXType_UAccum = 37; static const int CXType_ULongAccum = 38; + static const int CXType_BFloat16 = 39; static const int CXType_FirstBuiltin = 2; - static const int CXType_LastBuiltin = 38; + static const int CXType_LastBuiltin = 39; static const int CXType_Complex = 100; static const int CXType_Pointer = 101; static const int CXType_BlockPointer = 102; @@ -2129,15 +2102,16 @@ abstract class CXTypeKind { static const int CXType_OCLIntelSubgroupAVCImeSingleRefStreamin = 174; static const int CXType_OCLIntelSubgroupAVCImeDualRefStreamin = 175; static const int CXType_ExtVector = 176; + static const int CXType_Atomic = 177; } /// The type of an element in the abstract syntax tree. class CXType extends ffi.Struct { @ffi.Int32() - int? kind; + external int kind; - ffi.Pointer? _unique_data_item_0; - ffi.Pointer? _unique_data_item_1; + external ffi.Pointer _unique_data_item_0; + external ffi.Pointer _unique_data_item_1; /// Helper for array `data`. ArrayHelper_CXType_data_level0 get data => @@ -2160,7 +2134,7 @@ class ArrayHelper_CXType_data_level0 { } } - ffi.Pointer? operator [](int index) { + ffi.Pointer operator [](int index) { _checkBounds(index); switch (_absoluteIndex + index) { case 0: @@ -2217,11 +2191,11 @@ abstract class CXEvalResultKind { const int CINDEX_VERSION_MAJOR = 0; -const int CINDEX_VERSION_MINOR = 59; +const int CINDEX_VERSION_MINOR = 60; -const int CINDEX_VERSION = 59; +const int CINDEX_VERSION = 60; -const String CINDEX_VERSION_STRING = '0.59'; +const String CINDEX_VERSION_STRING = '0.60'; typedef _c_clang_createIndex = ffi.Pointer Function( ffi.Int32 excludeDeclarationsFromPCH, @@ -2398,7 +2372,7 @@ typedef _c_clang_getTypeKindSpelling_wrap = ffi.Pointer Function( ); typedef _dart_clang_getTypeKindSpelling_wrap = ffi.Pointer Function( - int? typeKind, + int typeKind, ); typedef _c_clang_getResultType_wrap = ffi.Pointer Function( diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart index 67efefcbda..baa5b5991c 100644 --- a/pkgs/ffigen/lib/src/header_parser/includer.dart +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -62,9 +62,9 @@ final _headerCache = {}; /// True if a cursor should be included based on headers config, used on root /// declarations. -bool shouldIncludeRootCursor(String? sourceFile) { - // Handle null in case of system headers or macros. - if (sourceFile == null) { +bool shouldIncludeRootCursor(String sourceFile) { + // Handle empty string in case of system headers or macros. + if (sourceFile.isEmpty) { return false; } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart index 704eadecaa..0261838688 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart @@ -61,10 +61,8 @@ List? parseSavedMacros() { final index = clang.clang_createIndex(0, 0); Pointer> clangCmdArgs = nullptr; var cmdLen = 0; - if (config.compilerOpts != null) { - clangCmdArgs = createDynamicStringArray(config.compilerOpts); - cmdLen = config.compilerOpts.length; - } + clangCmdArgs = createDynamicStringArray(config.compilerOpts); + cmdLen = config.compilerOpts.length; final tu = clang.clang_parseTranslationUnit( index, Utf8.toUtf8(file.path).cast(), @@ -166,11 +164,7 @@ int _macroVariablevisitor(Pointer cursor, /// Returns true if cursor is from generated file. bool isFromGeneratedFile(Pointer cursor) { final s = cursor.sourceFileName(); - if (s == null || s.isEmpty) { - return false; - } else { - return p.basename(s) == _generatedFileBaseName; - } + return p.basename(s) == _generatedFileBaseName; } /// Base name of generated file. diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index bce2eb4ccb..0c014d7635 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -17,7 +17,6 @@ final _logger = Logger('ffigen.header_parser.structdecl_parser'); /// Holds temporary information regarding [struc] while parsing. class _ParsedStruc { Struc? struc; - bool nestedStructMember = false; bool unimplementedMemberType = false; bool flexibleArrayMember = false; bool arrayMember = false; @@ -63,7 +62,7 @@ Struc? parseStructDeclaration( } if (bindingsIndex.isSeenStruct(structUsr)) { - _stack.top.struc = bindingsIndex.getSeenStruct(structUsr); + _stack.top.struc = bindingsIndex.getSeenStruct(structUsr)!; // If struct is seen, update it's name. _stack.top.struc!.name = config.structDecl.renameUsingConfig(structName); @@ -73,7 +72,6 @@ Struc? parseStructDeclaration( void _setStructMembers(Pointer cursor) { _stack.top.arrayMember = false; - _stack.top.nestedStructMember = false; _stack.top.unimplementedMemberType = false; final resultCode = clang.clang_visitChildren_wrap( @@ -92,12 +90,6 @@ void _setStructMembers(Pointer cursor) { _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.nestedStructMember) { - _logger.fine( - '---- Removed Struct members, reason: struct has struct members ${cursor.completeStringRepr()}'); - _logger.warning( - 'Removed All Struct Members from ${_stack.top.struc!.name}(${_stack.top.struc!.originalName}), Nested Structures not supported.'); - return _stack.top.struc!.members.clear(); } else if (_stack.top.unimplementedMemberType) { _logger.fine( '---- Removed Struct members, reason: member with unimplementedtype ${cursor.completeStringRepr()}'); @@ -135,18 +127,8 @@ int _structMembersVisitor(Pointer cursor, _logger.finer('===== member: ${cursor.completeStringRepr()}'); final mt = cursor.type().toCodeGenTypeAndDispose(); - //TODO(4): Remove these when support for Structs by value arrives. - if (mt.broadType == BroadType.Struct) { - // Setting this flag will exclude adding members for this struct's - // bindings. - _stack.top.nestedStructMember = true; - } else if (mt.broadType == BroadType.ConstantArray) { + if (mt.broadType == BroadType.ConstantArray) { _stack.top.arrayMember = true; - if (mt.child!.broadType == BroadType.Struct) { - // Setting this flag will exclude adding members for this struct's - // bindings. - _stack.top.nestedStructMember = true; - } } else if (mt.broadType == BroadType.IncompleteArray) { // TODO(68): Structs with flexible Array Members are not supported. _stack.top.flexibleArrayMember = true; diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 2c770305af..defa1d389d 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -41,14 +41,13 @@ Type getCodeGenType(Pointer cxtype, {String? parentName}) { final spelling = cxtype.spelling(); if (config.typedefNativeTypeMappings.containsKey(spelling)) { _logger.fine(' Type Mapped from typedef-map'); - return Type.nativeType(config.typedefNativeTypeMappings[spelling!]); + return Type.nativeType(config.typedefNativeTypeMappings[spelling]); } // Get name from supported typedef name if config allows. if (config.useSupportedTypedefs) { if (suportedTypedefToSuportedNativeType.containsKey(spelling)) { _logger.fine(' Type Mapped from supported typedef'); - return Type.nativeType( - suportedTypedefToSuportedNativeType[spelling!]); + return Type.nativeType(suportedTypedefToSuportedNativeType[spelling]); } } diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index ca7f0cfa08..f24c187311 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -45,7 +45,7 @@ void logTuDiagnostics( clang_types .CXDiagnosticDisplayOptions.CXDiagnostic_DisplayCategoryName, ); - logger.severe(' ' + cxstring.toStringAndDispose()!); + logger.severe(' ' + cxstring.toStringAndDispose()); clang.clang_disposeDiagnostic(diag); } } @@ -58,7 +58,7 @@ extension CXSourceRangeExt on Pointer { extension CXCursorExt on Pointer { String usr() { - return clang.clang_getCursorUSR_wrap(this).toStringAndDispose()!; + return clang.clang_getCursorUSR_wrap(this).toStringAndDispose(); } /// Returns the kind int from [clang_types.CXCursorKind]. @@ -68,14 +68,14 @@ extension CXCursorExt on Pointer { /// Name of the cursor (E.g function name, Struct name, Parameter name). String spelling() { - return clang.clang_getCursorSpelling_wrap(this).toStringAndDispose()!; + return clang.clang_getCursorSpelling_wrap(this).toStringAndDispose(); } /// Spelling for a [clang_types.CXCursorKind], useful for debug purposes. String kindSpelling() { return clang .clang_getCursorKindSpelling_wrap(clang.clang_getCursorKind_wrap(this)) - .toStringAndDispose()!; + .toStringAndDispose(); } /// for debug: returns [spelling] [kind] [kindSpelling] [type] [typeSpelling]. @@ -102,7 +102,7 @@ extension CXCursorExt on Pointer { return r; } - String? sourceFileName() { + String sourceFileName() { final cxsource = clang.clang_getCursorLocation_wrap(this); final cxfilePtr = allocate>(); final line = allocate(); @@ -234,7 +234,7 @@ extension CXTypeExt on Pointer { } /// Spelling for a [clang_types.CXTypeKind], useful for debug purposes. - String? spelling() { + String spelling() { return clang.clang_getTypeSpelling_wrap(this).toStringAndDispose(); } @@ -243,8 +243,8 @@ extension CXTypeExt on Pointer { return ref.kind; } - String? kindSpelling() { - return clang.clang_getTypeKindSpelling_wrap(kind()).toStringAndDispose(); + String kindSpelling() { + return clang.clang_getTypeKindSpelling_wrap(kind()!).toStringAndDispose(); } /// For debugging: returns [spelling] [kind] [kindSpelling]. @@ -264,17 +264,17 @@ extension CXStringExt on Pointer { /// /// Make sure to dispose CXstring using dispose method, or use the /// [toStringAndDispose] method. - String? string() { - String? s; + String string() { final cstring = clang.clang_getCString_wrap(this); if (cstring != nullptr) { - s = Utf8.fromUtf8(cstring.cast()); + return Utf8.fromUtf8(cstring.cast()); + } else { + return ''; } - return s; } /// Converts CXString to dart string and disposes CXString. - String? toStringAndDispose() { + String toStringAndDispose() { // Note: clang_getCString_wrap returns a const char *, calling free will result in error. final s = string(); clang.clang_disposeString_wrap(this); diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index aaddf644e9..44f1f1cf8e 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,12 +3,12 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.0.0-nullsafety.1 +version: 2.0.0-dev.0 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C header files. environment: - sdk: '>=2.12.0-29.10.beta <3.0.0' + sdk: '>=2.12.0-198.0.dev <3.0.0' dependencies: ffi: ^0.2.0-nullsafety.1 diff --git a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart index 9c3107c103..f8852d5b36 100644 --- a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart @@ -41,7 +41,8 @@ ${strings.headers}: expected.getBindingAsString('func2')); }); test('Struct2 nested struct member', () { - expect((actual.getBinding('Struct2') as Struc).members.isEmpty, true); + expect(actual.getBindingAsString('Struct2'), + expected.getBindingAsString('Struct2')); }); test('Struct3 flexible array member', () { expect((actual.getBinding('Struct3') as Struc).members.isEmpty, true); @@ -53,7 +54,13 @@ ${strings.headers}: } Library expectedLibrary() { - final struc2 = Struc(name: 'Struct2', members: []); + final struc1 = Struc(name: 'Struct1', members: []); + final struc2 = Struc(name: 'Struct2', members: [ + Member( + name: 'a', + type: Type.struct(struc1), + ), + ]); final struc3 = Struc(name: 'Struct3', members: []); return Library( name: 'Bindings', @@ -84,7 +91,12 @@ Library expectedLibrary() { SupportedNativeType.Void, ), ), - Struc(name: 'Struct4'), + Struc(name: 'Struct4', members: [ + Member( + name: 'a', + type: Type.struct(struc1), + ), + ]), ], ); } diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index e6cc63e49d..60698fca67 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -3328,7 +3328,30 @@ abstract class CXVisibilityKind { /// 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 {} +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 { @@ -4112,10 +4135,43 @@ class ArrayHelper_CXIdxLoc_ptr_data_level0 { } /// Data for ppIncludedFile callback. -class CXIdxIncludedFileInfo extends ffi.Struct {} +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 {} +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; @@ -4173,19 +4229,92 @@ abstract class CXIdxAttrKind { static const int CXIdxAttr_IBOutletCollection = 3; } -class CXIdxAttrInfo extends ffi.Struct {} +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; -class CXIdxEntityInfo extends ffi.Struct {} + external ffi.Pointer objcClass; -class CXIdxContainerInfo extends ffi.Struct {} + external CXCursor classCursor; -class CXIdxIBOutletCollectionAttrInfo extends ffi.Struct {} + external CXIdxLoc classLoc; +} abstract class CXIdxDeclInfoFlags { static const int CXIdxDeclFlag_Skipped = 1; } -class CXIdxDeclInfo extends ffi.Struct {} +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; @@ -4200,9 +4329,21 @@ class CXIdxObjCContainerDeclInfo extends ffi.Struct { external int kind; } -class CXIdxBaseClassInfo extends ffi.Struct {} +class CXIdxBaseClassInfo extends ffi.Struct { + external ffi.Pointer base; -class CXIdxObjCProtocolRefInfo extends ffi.Struct {} + 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; @@ -4219,7 +4360,17 @@ class CXIdxObjCInterfaceDeclInfo extends ffi.Struct { external ffi.Pointer protocols; } -class CXIdxObjCCategoryDeclInfo extends ffi.Struct {} +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; @@ -4263,7 +4414,28 @@ abstract class CXSymbolRole { } /// Data for IndexerCallbacks#indexEntityReference. -class CXIdxEntityRefInfo extends ffi.Struct {} +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. From bee5db2f06c32f0e5f9436eb9555ecbf1562ad73 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 1 Mar 2021 07:22:45 -0800 Subject: [PATCH 059/276] [ffigen] Support for passing/returning Structs by value. (#134) (#163) --- pkgs/ffigen/CHANGELOG.md | 3 + pkgs/ffigen/README.md | 2 - .../libclang-example/generated_bindings.dart | 9809 +++++++++++--- pkgs/ffigen/lib/src/code_generator/struc.dart | 6 + pkgs/ffigen/lib/src/code_generator/type.dart | 4 + .../sub_parsers/functiondecl_parser.dart | 18 +- .../sub_parsers/structdecl_parser.dart | 33 +- .../type_extractor/extractor.dart | 5 +- pkgs/ffigen/pubspec.yaml | 2 +- .../header_parser_tests/function_n_struct.h | 12 +- .../function_n_struct_test.dart | 7 + .../_expected_libclang_bindings.dart | 10885 +++++++++++----- pkgs/ffigen/test/native_test/native_test.c | 21 + pkgs/ffigen/test/native_test/native_test.dart | 6 + .../native_test/native_test_bindings.dart | 59 + 15 files changed, 15718 insertions(+), 5154 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 4fcb483d10..1345b70a00 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/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/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 4eb22ec26f..3956835e9a 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -373,8 +373,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/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index 616826f9ee..0edbcb9158 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/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/pkgs/ffigen/lib/src/code_generator/struc.dart b/pkgs/ffigen/lib/src/code_generator/struc.dart index ee8a52329d..8958139504 100644 --- a/pkgs/ffigen/lib/src/code_generator/struc.dart +++ b/pkgs/ffigen/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/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index 014413ae40..f6e5001f40 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/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/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index 2b005d8164..acb223a3b7 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/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/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index 0c014d7635..ffa4109d0f 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/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/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index defa1d389d..d1a7883bcd 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/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/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 44f1f1cf8e..d3c8da00bb 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/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/pkgs/ffigen/test/header_parser_tests/function_n_struct.h b/pkgs/ffigen/test/header_parser_tests/function_n_struct.h index 629c0ba8bb..bae5f401ac 100644 --- a/pkgs/ffigen/test/header_parser_tests/function_n_struct.h +++ b/pkgs/ffigen/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/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart index f8852d5b36..aec45027aa 100644 --- a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart +++ b/pkgs/ffigen/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/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index 60698fca67..e0abce7c74 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/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/pkgs/ffigen/test/native_test/native_test.c b/pkgs/ffigen/test/native_test/native_test.c index 57b23c0238..037a73b193 100644 --- a/pkgs/ffigen/test/native_test/native_test.c +++ b/pkgs/ffigen/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/pkgs/ffigen/test/native_test/native_test.dart b/pkgs/ffigen/test/native_test/native_test.dart index 479b910208..5e90a0ba70 100644 --- a/pkgs/ffigen/test/native_test/native_test.dart +++ b/pkgs/ffigen/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/pkgs/ffigen/test/native_test/native_test_bindings.dart b/pkgs/ffigen/test/native_test/native_test_bindings.dart index 60825f14e4..a4ae36f9e6 100644 --- a/pkgs/ffigen/test/native_test/native_test_bindings.dart +++ b/pkgs/ffigen/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, +); From 7ae4d240595e1d65142421bd4d7e32d6bbbf84fe Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 1 Mar 2021 08:27:50 -0800 Subject: [PATCH 060/276] [ffigen] Remove setup phase and usage of --no-sound-null-safety flag (#135, #137) (#164) Co-authored-by: J-P Nurmi --- .../ffigen/.github/workflows/test-package.yml | 2 - pkgs/ffigen/CHANGELOG.md | 7 + pkgs/ffigen/README.md | 19 +- pkgs/ffigen/bin/setup.dart | 8 - .../example/libclang-example/pubspec.yaml | 3 + pkgs/ffigen/lib/src/README.md | 31 +- pkgs/ffigen/lib/src/clang_library/wrapper.c | 370 ----- pkgs/ffigen/lib/src/clang_library/wrapper.def | 362 ---- .../lib/src/config_provider/config.dart | 11 + .../lib/src/config_provider/spec_utils.dart | 58 + pkgs/ffigen/lib/src/executables/ffigen.dart | 12 - pkgs/ffigen/lib/src/executables/setup.dart | 276 ---- pkgs/ffigen/lib/src/find_resource.dart | 96 -- .../clang_bindings/clang_bindings.dart | 1470 +++++++++-------- pkgs/ffigen/lib/src/header_parser/data.dart | 10 +- pkgs/ffigen/lib/src/header_parser/parser.dart | 28 +- .../sub_parsers/enumdecl_parser.dart | 22 +- .../sub_parsers/functiondecl_parser.dart | 20 +- .../sub_parsers/macro_parser.dart | 25 +- .../sub_parsers/structdecl_parser.dart | 21 +- .../sub_parsers/typedefdecl_parser.dart | 15 +- .../sub_parsers/unnamed_enumdecl_parser.dart | 18 +- .../translation_unit_parser.dart | 20 +- .../type_extractor/extractor.dart | 47 +- pkgs/ffigen/lib/src/header_parser/utils.dart | 90 +- pkgs/ffigen/lib/src/strings.dart | 26 +- pkgs/ffigen/pubspec.yaml | 2 +- pkgs/ffigen/tool/libclang_config.yaml | 78 +- 28 files changed, 1065 insertions(+), 2082 deletions(-) delete mode 100644 pkgs/ffigen/bin/setup.dart delete mode 100644 pkgs/ffigen/lib/src/clang_library/wrapper.c delete mode 100644 pkgs/ffigen/lib/src/clang_library/wrapper.def delete mode 100644 pkgs/ffigen/lib/src/executables/setup.dart delete mode 100644 pkgs/ffigen/lib/src/find_resource.dart diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 1b5ae04bee..a5cd11afa4 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -49,8 +49,6 @@ jobs: run: dart pub get - name: Install libclang-10-dev run: sudo apt-get install libclang-10-dev - - name: Setup ffigen - run: dart run ffigen:setup - name: Build test dylib run: cd test/native_test && dart build_test_dylib.dart && cd ../.. - name: Run VM tests diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 1345b70a00..a7b8617a55 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,10 @@ +# 2.0.0-dev.3 +- Removed the usage of `--no-sound-null-safety` flag. + +# 2.0.0-dev.2 +- Removed setup phase for ffigen. Added new optional config key `llvm-lib` +to specify path to `llvm/lib` folder. + # 2.0.0-dev.1 - Added support for passing and returning struct by value in functions. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 3956835e9a..df041e7842 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -36,13 +36,13 @@ typedef _dart_sum = int Function(int a, int b); ``` ## Using this package - Add `ffigen` under `dev_dependencies` in your `pubspec.yaml`. -- Setup for use (see [Setup](#Setup)). +- Install LLVM (see [Installing LLVM](#installing-llvm)). - Configurations must be provided in `pubspec.yaml` or in a custom YAML file (see [configurations](#configurations)). - Run the tool- `dart run ffigen`. Jump to [FAQ](#faq). -## Setup +## Installing LLVM `package:ffigen` uses LLVM. Install LLVM (9+) in the following way. #### ubuntu/linux @@ -83,6 +83,16 @@ The following configuration options are available- ```yaml output: 'generated_bindings.dart' +``` + + + + llvm-lib + Path to llvm/lib folder. Required if ffigen is unable to find this at default locations. + + +```yaml +llvm-lib: '/usr/local/opt/llvm/lib' ``` @@ -379,13 +389,12 @@ class ArrayHelper_CXFileUniqueID_data_level0 { 2. Run `pub run ffigen`. ## Running Tests -1. Run setup to build the LLVM wrapper - `pub run ffigen:setup`. -2. Dynamic library for some tests also need to be built before running the examples. +1. Dynamic library for some tests need to be built before running the examples. 1. `cd test/native_test`. 2. Run `dart build_test_dylib.dart`. Run tests from the root of the package with `pub run test`. - +> Note: If llvm is not installed in one of the default locations, tests may fail. ## FAQ ### Can ffigen be used for removing underscores or renaming declarations? Ffigen supports **regexp based renaming**, the regexp must be a diff --git a/pkgs/ffigen/bin/setup.dart b/pkgs/ffigen/bin/setup.dart deleted file mode 100644 index 5b07636cfc..0000000000 --- a/pkgs/ffigen/bin/setup.dart +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. -// -// TODO(128): Remove this when package can run with sound null safety. -// @dart=2.7 - -export 'package:ffigen/src/executables/setup.dart'; diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index 7e8fc936f2..df66b0b751 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -15,6 +15,9 @@ ffigen: output: 'generated_bindings.dart' sort: true + # This is required if LLVM can't be found in default locations by ffigen. + # llvm-lib: '/usr/local/opt/llvm/lib' + # Bash style Glob matching is also supported. # TODO(11): Globs dont work on windows if they begin with '.' or '..'. headers: diff --git a/pkgs/ffigen/lib/src/README.md b/pkgs/ffigen/lib/src/README.md index 900c9f7f72..cdfc01a796 100644 --- a/pkgs/ffigen/lib/src/README.md +++ b/pkgs/ffigen/lib/src/README.md @@ -2,12 +2,9 @@ ## Table of Contents - 1. [Overview](#overview) 2. [LibClang](#LibClang) - 1. [The Wrapper library](#The-Wrapper-library) - 2. [Generation and Usage](#Generation-and-Usage) - 3. [Bindings](#Bindings) + 1. [Bindings](#Bindings) 3. [Scripts](#scripts) 1. [ffigen.dart](#ffigen.dart) - 2. [setup.dart](#setup.dart) 4. [Components](#components) 1. [Config Provider](#Config-Provider) 2. [Header Parser](#Header-Parser) @@ -15,21 +12,7 @@ # Overview `package:ffigen` simplifies the process of generating `dart:ffi` bindings from C header files. It is simple to use, with the input being a small YAML config file. It requires LLVM (9+) to work. This document tries to give a complete overview of every component without going into too many details about every single class/file. # LibClang -`package:ffigen` binds to LibClang using `dart:ffi` for parsing C header files. A wrapper library must be generated to use it, as `dart:ffi` currently [doesn't support structs by value](https://github.com/dart-lang/ffigen/issues/3). -## The Wrapper library -> Note: The wrapper is only needed because `dart:ffi` currently doesn't support Structs by value. - -The `wrapper.c` file consists of functions that wrap LibClang functions. Most of them simply convert structs by value to pointers. Except - -- `clang_visitChildren_wrap` - The bindings for this function internally uses a **list** of **stack** for maintaining the supplied visitor functions. This is required because this function takes a function pointer which itself passes a struct by value. All this effort makes `clang_visitChildren_wrap` behave exactly like `clang_visitChildren`. -## Generation and Usage -The files needed for generating the wrapper are in `lib/src/clang_library`. -> The `wrapper.def` file is only needed on windows because the symbols are otherwise hidden. - -The libclang wrapper can be _manually_ generated using `pub run ffigen:setup`. See [setup.dart](#setup.dart) for details. - -The generated file is placed in the project's `.dart_tool/ffigen` folder, the file name also specifies the ffigen version (E.g - `_v0_2_4_libclang_wrapper.dylib`), this helps ensure the correct wrapper is being used for its corresponding version. - -This dynamic library is then used by [Header Parser](#header-parser) for parsing C files. +`package:ffigen` binds to LibClang using `dart:ffi` for parsing C header files. ## Bindings The config file for generating bindings is `tool/libclang_config.yaml`. The bindings are generated to `lib/src/header_parser/clang_bindings/clang_bindings.dart`. These are used by [Header Parser](#header-parser) for calling libclang functions. # Scripts @@ -38,19 +21,11 @@ This is the main entry point for the user- `pub run ffigen`. - Command-line options: - `--verbose`: Sets log level. - `--config`: Specifies a config file. -- `ffigen.dart` will first check if a dynamic library already exists and is up to date. If not, it tries to auto-create it. If that fails, user must excplicitly call [setup.dart](#setup.dart). - The internal modules are called by `ffigen.dart` in the following way: +- `ffigen.dart` will try to find dynamic library in default locations. If that fails, the user must excplicitly specify location in ffigen's config under the key `llvm-lib`. - It first creates a `Config` object from an input Yaml file. This is used by other modules. - The `parse` method is then invoked to generate a `Library` object. - Finally, the code is generated from the `Library` object to the specified file. -## setup.dart -Used to generate the wrapper dynamic library. Users will need to explicitly call this if `pub run ffigen` is unable to auto-create the dynamic library. -> `clang` must be on user's path for `setup.dart` to work. - -- Command-line options: - - `-I`: Specifies header includes. - - `-L`: Specifies library includes. -- `setup.dart` generates the dynamic library to the project's `.dart_tool/ffigen` folder using `clang`. # Components ## Config Provider The Config Provider holds all the configurations required by other modules. diff --git a/pkgs/ffigen/lib/src/clang_library/wrapper.c b/pkgs/ffigen/lib/src/clang_library/wrapper.c deleted file mode 100644 index 96f64baea1..0000000000 --- a/pkgs/ffigen/lib/src/clang_library/wrapper.c +++ /dev/null @@ -1,370 +0,0 @@ -// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -#include -#include -#include - -// utility. -#define aloc(T) ((T *)malloc(sizeof(T))) -CXCursor *ptrToCXCursor(CXCursor t) -{ - CXCursor *c = aloc(CXCursor); - *c = t; - return c; -} -CXString *ptrToCXString(CXString t) -{ - CXString *c = aloc(CXString); - *c = t; - return c; -} -CXType *ptrToCXType(CXType t) -{ - CXType *c = aloc(CXType); - *c = t; - return c; -} -CXSourceLocation *ptrToCXSourceLocation(CXSourceLocation t) -{ - CXSourceLocation *c = aloc(CXSourceLocation); - *c = t; - return c; -} -CXSourceRange *ptrToCXSourceRange(CXSourceRange t) -{ - CXSourceRange *c = aloc(CXSourceRange); - *c = t; - return c; -} -// START ===== Functions for testing libclang behavior in C. -enum CXChildVisitResult visitor_for_test_in_c(CXCursor cursor, CXCursor parent, CXClientData clientData) -{ - printf("Cursor- kind: %s, name: %s\n", clang_getCString(clang_getCursorKindSpelling(clang_getCursorKind(cursor))), clang_getCString(clang_getCursorSpelling(cursor))); - return CXChildVisit_Continue; -} -int test_in_c() -{ - printf("==========================run==========================\n"); - CXIndex Index = clang_createIndex(0, 0); - CXTranslationUnit TU = clang_parseTranslationUnit(Index, - "./test.h", 0, 0, NULL, 0, CXTranslationUnit_None); - - if (TU == NULL) - { - printf("Error creating TU\n"); - return 0; - } - - CXCursor root = clang_getTranslationUnitCursor(TU); - - unsigned a = clang_visitChildren(root, visitor_for_test_in_c, NULL); - - clang_disposeTranslationUnit(TU); - clang_disposeIndex(Index); - printf("\n==========================end==========================\n"); - return 0; -} -// END ===== Functions for testing libclang behavior in C ============================ - -// START ===== WRAPPER FUNCTIONS ===================== - -const char *clang_getCString_wrap(CXString *string) -{ - const char *a = clang_getCString(*string); - - return a; -} - -void clang_disposeString_wrap(CXString *string) -{ - clang_disposeString(*string); - free(string); - return; -} - -enum CXCursorKind clang_getCursorKind_wrap(CXCursor *cursor) -{ - return clang_getCursorKind(*cursor); -} - -CXString *clang_getCursorKindSpelling_wrap(enum CXCursorKind kind) -{ - return ptrToCXString(clang_getCursorKindSpelling(kind)); -} - -CXType *clang_getCursorType_wrap(CXCursor *cursor) -{ - return ptrToCXType(clang_getCursorType(*cursor)); -} - -CXString *clang_getTypeSpelling_wrap(CXType *type) -{ - return ptrToCXString(clang_getTypeSpelling(*type)); -} - -CXString *clang_getTypeKindSpelling_wrap(enum CXTypeKind typeKind) -{ - return ptrToCXString(clang_getTypeKindSpelling(typeKind)); -} - -CXType *clang_getResultType_wrap(CXType *functionType) -{ - return ptrToCXType(clang_getResultType(*functionType)); -} - -CXType *clang_getPointeeType_wrap(CXType *pointerType) -{ - return ptrToCXType(clang_getPointeeType(*pointerType)); -} - -CXType *clang_getCanonicalType_wrap(CXType *typerefType) -{ - return ptrToCXType(clang_getCanonicalType(*typerefType)); -} - -CXType *clang_Type_getNamedType_wrap(CXType *elaboratedType) -{ - return ptrToCXType(clang_Type_getNamedType(*elaboratedType)); -} - -CXCursor *clang_getTypeDeclaration_wrap(CXType *cxtype) -{ - return ptrToCXCursor(clang_getTypeDeclaration(*cxtype)); -} - -CXType *clang_getTypedefDeclUnderlyingType_wrap(CXCursor *cxcursor) -{ - return ptrToCXType(clang_getTypedefDeclUnderlyingType(*cxcursor)); -} - -/** The name of parameter, struct, typedef. */ -CXString *clang_getCursorSpelling_wrap(CXCursor *cursor) -{ - return ptrToCXString(clang_getCursorSpelling(*cursor)); -} - -CXCursor *clang_getTranslationUnitCursor_wrap(CXTranslationUnit tu) -{ - return ptrToCXCursor(clang_getTranslationUnitCursor(tu)); -} - -CXString *clang_formatDiagnostic_wrap(CXDiagnostic diag, int opts) -{ - return ptrToCXString(clang_formatDiagnostic(diag, opts)); -} - -// Alternative typedef for [CXCursorVisitor] using pointer for passing cursor and parent -// instead of passing by value -typedef enum CXChildVisitResult (*ModifiedCXCursorVisitor)(CXCursor *cursor, - CXCursor *parent, - CXClientData client_data); - -struct _stackForVisitChildren -{ - ModifiedCXCursorVisitor modifiedVisitor; - struct _stackForVisitChildren *link; -} * _visitorTemp; - -// Holds list of Isolate-Processor pairs, each having their own stack -// to hold the vistorFunctions. -struct _listForIsolateProcessPair -{ - long long uid; - struct _listForIsolateProcessPair *next; - struct _stackForVisitChildren *_visitorTop; -} ipHead, *ipTemp; -// `ipHead` is used only as head marker and will not contain any information. - -// Finds/Creates an Isolate-Processor pair from/in the linkedlist. -struct _listForIsolateProcessPair *_findIP(long long uid) -{ - struct _listForIsolateProcessPair *temp = ipHead.next; - while (temp != NULL) - { - if (temp->uid == uid) - { - return temp; - } - temp = temp->next; - } - // If we reach here this means no IP pair was found and we should create one - // and add it to the head of our list. - temp = aloc(struct _listForIsolateProcessPair); - temp->next = ipHead.next; - temp->uid = uid; - temp->_visitorTop = NULL; - ipHead.next = temp; - return temp; -} -void _push(ModifiedCXCursorVisitor modifiedVisitor, long long uid) -{ - struct _listForIsolateProcessPair *current = _findIP(uid); - if (current->_visitorTop == NULL) - { - current->_visitorTop = aloc(struct _stackForVisitChildren); - current->_visitorTop->link = NULL; - current->_visitorTop->modifiedVisitor = modifiedVisitor; - } - else - { - _visitorTemp = aloc(struct _stackForVisitChildren); - _visitorTemp->link = current->_visitorTop; - _visitorTemp->modifiedVisitor = modifiedVisitor; - current->_visitorTop = _visitorTemp; - } -} -void _pop(long long uid) -{ - struct _listForIsolateProcessPair *current = _findIP(uid); - _visitorTemp = current->_visitorTop; - - if (_visitorTemp == NULL) - { - printf("\n Error, Wrapper.C : Trying to pop from empty stack"); - return; - } - else - _visitorTemp = current->_visitorTop->link; - free(current->_visitorTop); - current->_visitorTop = _visitorTemp; -} -ModifiedCXCursorVisitor _top(long long uid) -{ - return _findIP(uid)->_visitorTop->modifiedVisitor; -} - -// Do not write binding for this function. -// used by [clang_visitChildren_wrap]. -enum CXChildVisitResult -_visitorwrap(CXCursor cursor, CXCursor parent, CXClientData clientData) -{ - // Use clientData (which is a unique ID) to get reference to the stack which - // this particular process-isolate pair uses. - long long uid = *((long long *)clientData); - enum CXChildVisitResult e = (_top(uid)(ptrToCXCursor(cursor), ptrToCXCursor(parent), clientData)); - return e; -} - -/** Visitor is a function pointer with parameters having pointers to cxcursor -* instead of cxcursor by default. */ -unsigned clang_visitChildren_wrap(CXCursor *parent, ModifiedCXCursorVisitor _modifiedVisitor, long long uid) -{ - long long *clientData = aloc(long long); - *clientData = uid; - _push(_modifiedVisitor, uid); - unsigned a = clang_visitChildren(*parent, _visitorwrap, clientData); - _pop(uid); - return a; -} - -int clang_Cursor_getNumArguments_wrap(CXCursor *cursor) -{ - return clang_Cursor_getNumArguments(*cursor); -} - -CXCursor *clang_Cursor_getArgument_wrap(CXCursor *cursor, unsigned i) -{ - return ptrToCXCursor(clang_Cursor_getArgument(*cursor, i)); -} - -int clang_getNumArgTypes_wrap(CXType *cxtype) -{ - return clang_getNumArgTypes(*cxtype); -} - -CXType *clang_getArgType_wrap(CXType *cxtype, unsigned i) -{ - return ptrToCXType(clang_getArgType(*cxtype, i)); -} - -long long clang_getEnumConstantDeclValue_wrap(CXCursor *cursor) -{ - return clang_getEnumConstantDeclValue(*cursor); -} - -/** Returns non-zero if the ranges are the same, zero if they differ. */ -unsigned clang_equalRanges_wrap(CXSourceRange *c1, CXSourceRange *c2) -{ - return clang_equalRanges(*c1, *c2); -} - -/** Returns the comment range. */ -CXSourceRange *clang_Cursor_getCommentRange_wrap(CXCursor *cursor) -{ - return ptrToCXSourceRange(clang_Cursor_getCommentRange(*cursor)); -} - -/** Returns the raw comment. */ -CXString *clang_Cursor_getRawCommentText_wrap(CXCursor *cursor) -{ - return ptrToCXString(clang_Cursor_getRawCommentText(*cursor)); -} - -/** Returns the first paragraph of doxygen doc comment. */ -CXString *clang_Cursor_getBriefCommentText_wrap(CXCursor *cursor) -{ - return ptrToCXString(clang_Cursor_getBriefCommentText(*cursor)); -} - -CXSourceLocation *clang_getCursorLocation_wrap(CXCursor *cursor) -{ - return ptrToCXSourceLocation(clang_getCursorLocation(*cursor)); -} - -void clang_getFileLocation_wrap(CXSourceLocation *location, CXFile *file, unsigned *line, unsigned *column, unsigned *offset) -{ - return clang_getFileLocation(*location, file, line, column, offset); -} - -CXString *clang_getFileName_wrap(CXFile SFile) -{ - return ptrToCXString(clang_getFileName(SFile)); -} - -unsigned long long clang_getNumElements_wrap(CXType *cxtype) -{ - return clang_getNumElements(*cxtype); -} - -CXType *clang_getArrayElementType_wrap(CXType *cxtype) -{ - return ptrToCXType(clang_getArrayElementType(*cxtype)); -} - -unsigned clang_Cursor_isMacroFunctionLike_wrap(CXCursor *cursor) -{ - return clang_Cursor_isMacroFunctionLike(*cursor); -} - -unsigned clang_Cursor_isMacroBuiltin_wrap(CXCursor *cursor) -{ - return clang_Cursor_isMacroBuiltin(*cursor); -} - -CXEvalResult clang_Cursor_Evaluate_wrap(CXCursor *cursor) -{ - return clang_Cursor_Evaluate(*cursor); -} - -unsigned clang_Cursor_isAnonymous_wrap(CXCursor *cursor) -{ - return clang_Cursor_isAnonymous(*cursor); -} - -unsigned clang_Cursor_isAnonymousRecordDecl_wrap(CXCursor *cursor) -{ - return clang_Cursor_isAnonymousRecordDecl(*cursor); -} - -CXString *clang_getCursorUSR_wrap(CXCursor *cursor) -{ - return ptrToCXString(clang_getCursorUSR(*cursor)); -} - -int clang_getFieldDeclBitWidth_wrap(CXCursor *cursor){ - return clang_getFieldDeclBitWidth(*cursor); -} - -// END ===== WRAPPER FUNCTIONS ===================== diff --git a/pkgs/ffigen/lib/src/clang_library/wrapper.def b/pkgs/ffigen/lib/src/clang_library/wrapper.def deleted file mode 100644 index 8a984b026a..0000000000 --- a/pkgs/ffigen/lib/src/clang_library/wrapper.def +++ /dev/null @@ -1,362 +0,0 @@ -; Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -; for details. All rights reserved. Use of this source code is governed by a -; BSD-style license that can be found in the LICENSE file. - -EXPORTS -clang_getCString -clang_disposeString -clang_disposeStringSet -clang_createIndex -clang_disposeIndex -clang_CXIndex_setGlobalOptions -clang_CXIndex_getGlobalOptions -clang_CXIndex_setInvocationEmissionPathOption -clang_getFileName -clang_getFileTime -clang_getFileUniqueID -clang_isFileMultipleIncludeGuarded -clang_getFile -clang_getFileContents -clang_File_isEqual -clang_File_tryGetRealPathName -clang_getNullLocation -clang_equalLocations -clang_getLocation -clang_getLocationForOffset -clang_Location_isInSystemHeader -clang_Location_isFromMainFile -clang_getNullRange -clang_getRange -clang_equalRanges -clang_Range_isNull -clang_getExpansionLocation -clang_getPresumedLocation -clang_getInstantiationLocation -clang_getSpellingLocation -clang_getFileLocation -clang_getRangeStart -clang_getRangeEnd -clang_getSkippedRanges -clang_getAllSkippedRanges -clang_disposeSourceRangeList -clang_getNumDiagnosticsInSet -clang_getDiagnosticInSet -clang_loadDiagnostics -clang_disposeDiagnosticSet -clang_getChildDiagnostics -clang_getNumDiagnostics -clang_getDiagnostic -clang_getDiagnosticSetFromTU -clang_disposeDiagnostic -clang_formatDiagnostic -clang_defaultDiagnosticDisplayOptions -clang_getDiagnosticSeverity -clang_getDiagnosticLocation -clang_getDiagnosticSpelling -clang_getDiagnosticOption -clang_getDiagnosticCategory -clang_getDiagnosticCategoryName -clang_getDiagnosticCategoryText -clang_getDiagnosticNumRanges -clang_getDiagnosticRange -clang_getDiagnosticNumFixIts -clang_getDiagnosticFixIt -clang_getTranslationUnitSpelling -clang_createTranslationUnitFromSourceFile -clang_createTranslationUnit -clang_createTranslationUnit2 -clang_defaultEditingTranslationUnitOptions -clang_parseTranslationUnit -clang_parseTranslationUnit2 -clang_parseTranslationUnit2FullArgv -clang_defaultSaveOptions -clang_saveTranslationUnit -clang_suspendTranslationUnit -clang_disposeTranslationUnit -clang_defaultReparseOptions -clang_reparseTranslationUnit -clang_getTUResourceUsageName -clang_getCXTUResourceUsage -clang_disposeCXTUResourceUsage -clang_getTranslationUnitTargetInfo -clang_TargetInfo_dispose -clang_TargetInfo_getTriple -clang_TargetInfo_getPointerWidth -clang_getNullCursor -clang_getTranslationUnitCursor -clang_equalCursors -clang_Cursor_isNull -clang_hashCursor -clang_getCursorKind -clang_isDeclaration -clang_isInvalidDeclaration -clang_isReference -clang_isExpression -clang_isStatement -clang_isAttribute -clang_Cursor_hasAttrs -clang_isInvalid -clang_isTranslationUnit -clang_isPreprocessing -clang_isUnexposed -clang_getCursorLinkage -clang_getCursorVisibility -clang_getCursorAvailability -clang_getCursorPlatformAvailability -clang_disposeCXPlatformAvailability -clang_getCursorLanguage -clang_getCursorTLSKind -clang_Cursor_getTranslationUnit -clang_createCXCursorSet -clang_disposeCXCursorSet -clang_CXCursorSet_contains -clang_CXCursorSet_insert -clang_getCursorSemanticParent -clang_getCursorLexicalParent -clang_getOverriddenCursors -clang_disposeOverriddenCursors -clang_getIncludedFile -clang_getCursor -clang_getCursorLocation -clang_getCursorExtent -clang_getCursorType -clang_getTypeSpelling -clang_getTypedefDeclUnderlyingType -clang_getEnumDeclIntegerType -clang_getEnumConstantDeclValue -clang_getEnumConstantDeclUnsignedValue -clang_getFieldDeclBitWidth -clang_Cursor_getNumArguments -clang_Cursor_getArgument -clang_Cursor_getNumTemplateArguments -clang_Cursor_getTemplateArgumentKind -clang_Cursor_getTemplateArgumentType -clang_Cursor_getTemplateArgumentValue -clang_Cursor_getTemplateArgumentUnsignedValue -clang_equalTypes -clang_getCanonicalType -clang_isConstQualifiedType -clang_Cursor_isMacroFunctionLike -clang_Cursor_isMacroBuiltin -clang_Cursor_isFunctionInlined -clang_isVolatileQualifiedType -clang_isRestrictQualifiedType -clang_getAddressSpace -clang_getTypedefName -clang_getPointeeType -clang_getTypeDeclaration -clang_getDeclObjCTypeEncoding -clang_Type_getObjCEncoding -clang_getTypeKindSpelling -clang_getFunctionTypeCallingConv -clang_getResultType -clang_getExceptionSpecificationType -clang_getNumArgTypes -clang_getArgType -clang_Type_getObjCObjectBaseType -clang_Type_getNumObjCProtocolRefs -clang_Type_getObjCProtocolDecl -clang_Type_getNumObjCTypeArgs -clang_Type_getObjCTypeArg -clang_isFunctionTypeVariadic -clang_getCursorResultType -clang_getCursorExceptionSpecificationType -clang_isPODType -clang_getElementType -clang_getNumElements -clang_getArrayElementType -clang_getArraySize -clang_Type_getNamedType -clang_Type_isTransparentTagTypedef -clang_Type_getNullability -clang_Type_getAlignOf -clang_Type_getClassType -clang_Type_getSizeOf -clang_Type_getOffsetOf -clang_Type_getModifiedType -clang_Cursor_getOffsetOfField -clang_Cursor_isAnonymous -clang_Cursor_isAnonymousRecordDecl -clang_Cursor_isInlineNamespace -clang_Type_getNumTemplateArguments -clang_Type_getTemplateArgumentAsType -clang_Type_getCXXRefQualifier -clang_Cursor_isBitField -clang_isVirtualBase -clang_getCXXAccessSpecifier -clang_Cursor_getStorageClass -clang_getNumOverloadedDecls -clang_getOverloadedDecl -clang_getIBOutletCollectionType -clang_visitChildren -clang_getCursorUSR -clang_constructUSR_ObjCClass -clang_constructUSR_ObjCCategory -clang_constructUSR_ObjCProtocol -clang_constructUSR_ObjCIvar -clang_constructUSR_ObjCMethod -clang_constructUSR_ObjCProperty -clang_getCursorSpelling -clang_Cursor_getSpellingNameRange -clang_PrintingPolicy_getProperty -clang_PrintingPolicy_setProperty -clang_getCursorPrintingPolicy -clang_PrintingPolicy_dispose -clang_getCursorPrettyPrinted -clang_getCursorDisplayName -clang_getCursorReferenced -clang_getCursorDefinition -clang_isCursorDefinition -clang_getCanonicalCursor -clang_Cursor_getObjCSelectorIndex -clang_Cursor_isDynamicCall -clang_Cursor_getReceiverType -clang_Cursor_getObjCPropertyAttributes -clang_Cursor_getObjCPropertyGetterName -clang_Cursor_getObjCPropertySetterName -clang_Cursor_getObjCDeclQualifiers -clang_Cursor_isObjCOptional -clang_Cursor_isVariadic -clang_Cursor_isExternalSymbol -clang_Cursor_getCommentRange -clang_Cursor_getRawCommentText -clang_Cursor_getBriefCommentText -clang_Cursor_getMangling -clang_Cursor_getCXXManglings -clang_Cursor_getObjCManglings -clang_Cursor_getModule -clang_getModuleForFile -clang_Module_getASTFile -clang_Module_getParent -clang_Module_getName -clang_Module_getFullName -clang_Module_isSystem -clang_Module_getNumTopLevelHeaders -clang_Module_getTopLevelHeader -clang_CXXConstructor_isConvertingConstructor -clang_CXXConstructor_isCopyConstructor -clang_CXXConstructor_isDefaultConstructor -clang_CXXConstructor_isMoveConstructor -clang_CXXField_isMutable -clang_CXXMethod_isDefaulted -clang_CXXMethod_isPureVirtual -clang_CXXMethod_isStatic -clang_CXXMethod_isVirtual -clang_CXXRecord_isAbstract -clang_EnumDecl_isScoped -clang_CXXMethod_isConst -clang_getTemplateCursorKind -clang_getSpecializedCursorTemplate -clang_getCursorReferenceNameRange -clang_getToken -clang_getTokenKind -clang_getTokenSpelling -clang_getTokenLocation -clang_getTokenExtent -clang_tokenize -clang_annotateTokens -clang_disposeTokens -clang_getCursorKindSpelling -clang_getDefinitionSpellingAndExtent -clang_enableStackTraces -clang_executeOnThread -clang_getCompletionChunkKind -clang_getCompletionChunkText -clang_getCompletionChunkCompletionString -clang_getNumCompletionChunks -clang_getCompletionPriority -clang_getCompletionAvailability -clang_getCompletionNumAnnotations -clang_getCompletionAnnotation -clang_getCompletionParent -clang_getCompletionBriefComment -clang_getCursorCompletionString -clang_getCompletionNumFixIts -clang_getCompletionFixIt -clang_defaultCodeCompleteOptions -clang_codeCompleteAt -clang_sortCodeCompletionResults -clang_disposeCodeCompleteResults -clang_codeCompleteGetNumDiagnostics -clang_codeCompleteGetDiagnostic -clang_codeCompleteGetContexts -clang_codeCompleteGetContainerKind -clang_codeCompleteGetContainerUSR -clang_codeCompleteGetObjCSelector -clang_getClangVersion -clang_toggleCrashRecovery -clang_getInclusions -clang_Cursor_Evaluate -clang_EvalResult_getKind -clang_EvalResult_getAsInt -clang_EvalResult_getAsLongLong -clang_EvalResult_isUnsignedInt -clang_EvalResult_getAsUnsigned -clang_EvalResult_getAsDouble -clang_EvalResult_getAsStr -clang_EvalResult_dispose -clang_getRemappings -clang_getRemappingsFromFileList -clang_remap_getNumFiles -clang_remap_getFilenames -clang_remap_dispose -clang_findReferencesInFile -clang_findIncludesInFile -clang_index_isEntityObjCContainerKind -clang_index_getObjCContainerDeclInfo -clang_index_getObjCInterfaceDeclInfo -clang_index_getObjCCategoryDeclInfo -clang_index_getObjCProtocolRefListInfo -clang_index_getObjCPropertyDeclInfo -clang_index_getIBOutletCollectionAttrInfo -clang_index_getCXXClassDeclInfo -clang_index_getClientContainer -clang_index_setClientContainer -clang_index_getClientEntity -clang_index_setClientEntity -clang_IndexAction_create -clang_IndexAction_dispose -clang_indexSourceFile -clang_indexSourceFileFullArgv -clang_indexTranslationUnit -clang_indexLoc_getFileLocation -clang_indexLoc_getCXSourceLocation -clang_Type_visitFields -clang_getCString_wrap -clang_disposeString_wrap -clang_getCursorKind_wrap -clang_getCursorKindSpelling_wrap -clang_getCursorType_wrap -clang_getTypeSpelling_wrap -clang_getTypeKindSpelling_wrap -clang_getResultType_wrap -clang_getPointeeType_wrap -clang_getCanonicalType_wrap -clang_Type_getNamedType_wrap -clang_getTypeDeclaration_wrap -clang_getTypedefDeclUnderlyingType_wrap -clang_getCursorSpelling_wrap -clang_getTranslationUnitCursor_wrap -clang_formatDiagnostic_wrap -clang_visitChildren_wrap -clang_Cursor_getNumArguments_wrap -clang_Cursor_getArgument_wrap -clang_getNumArgTypes_wrap -clang_getArgType_wrap -clang_getEnumConstantDeclValue_wrap -clang_equalRanges_wrap -clang_Cursor_getCommentRange_wrap -clang_Cursor_getRawCommentText_wrap -clang_Cursor_getBriefCommentText_wrap -clang_getCursorLocation_wrap -clang_getFileLocation_wrap -clang_getFileName_wrap -clang_getNumElements_wrap -clang_getArrayElementType_wrap -clang_Cursor_isMacroFunctionLike_wrap -clang_Cursor_isMacroBuiltin_wrap -clang_Cursor_Evaluate_wrap -clang_Cursor_isAnonymous_wrap -clang_Cursor_isAnonymousRecordDecl_wrap -clang_getCursorUSR_wrap -clang_getFieldDeclBitWidth_wrap diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 0649de57bf..96ca643dd3 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -20,6 +20,10 @@ final _logger = Logger('ffigen.config_provider.config'); /// /// Handles validation, extraction of confiurations from yaml file. class Config { + /// Location for llvm/lib folder. + String get libclangDylib => _libclangDylib; + late String _libclangDylib; + /// output file name. String get output => _output; late String _output; @@ -156,6 +160,13 @@ class Config { /// Key: Name, Value: [Specification] Map _getSpecs() { return { + strings.llvmLib: Specification( + requirement: Requirement.no, + validator: llvmLibValidator, + extractor: llvmLibExtractor, + defaultValue: () => findDylibAtDefaultLocations(), + extractedResult: (dynamic result) => _libclangDylib = result as String, + ), strings.output: Specification( requirement: Requirement.yes, validator: outputValidator, diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 2df7939127..839333aea3 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -197,6 +197,64 @@ String getDylibPath(String dylibParentFoler) { return dylibPath; } +/// Returns location of dynamic library by searching default locations. Logs +/// error and exits if not found. +String findDylibAtDefaultLocations() { + String? k; + if (Platform.isLinux) { + for (final l in strings.linuxDylibLocations) { + k = findLibclangDylib(l); + if (k != null) return k; + } + } else if (Platform.isWindows) { + for (final l in strings.windowsDylibLocations) { + k = findLibclangDylib(l); + if (k != null) return k; + } + } else if (Platform.isMacOS) { + for (final l in strings.macOsDylibLocations) { + k = findLibclangDylib(l); + if (k != null) return k; + } + } else { + throw Exception('Unsupported Platform.'); + } + + _logger.severe("Couldn't find dynamic library in default locations."); + _logger.severe( + "Please supply the path/to/llvm/lib in ffigen's config under the key 'llvm-lib'."); + throw Exception("Couldn't find dynamic library in default locations."); +} + +String? findLibclangDylib(String parentFolder) { + final location = p.join(parentFolder, strings.dylibFileName); + if (File(location).existsSync()) { + return location; + } else { + return null; + } +} + +String llvmLibExtractor(dynamic value) { + // Extract libclang's dylib from this. + final p = findLibclangDylib(value as String); + if (p == null) { + _logger.severe("Couldn't find ${strings.dylibFileName} at $value."); + exit(1); + } else { + return p; + } +} + +bool llvmLibValidator(String name, dynamic value) { + if (!checkType([name], value) || + !Directory(value as String).existsSync()) { + _logger.severe('Expected $name to be a valid folder Path.'); + return false; + } + return true; +} + String outputExtractor(dynamic value) => _replaceSeparators(value as String); bool outputValidator(String name, dynamic value) => diff --git a/pkgs/ffigen/lib/src/executables/ffigen.dart b/pkgs/ffigen/lib/src/executables/ffigen.dart index 22b3744549..dd4b209d91 100644 --- a/pkgs/ffigen/lib/src/executables/ffigen.dart +++ b/pkgs/ffigen/lib/src/executables/ffigen.dart @@ -11,8 +11,6 @@ import 'package:ffigen/ffigen.dart'; import 'package:logging/logging.dart'; import 'package:yaml/yaml.dart' as yaml; -import 'package:ffigen/src/executables/setup.dart'; - final _logger = Logger('ffigen.ffigen'); final _ansi = Ansi(Ansi.terminalSupportsAnsi); @@ -31,16 +29,6 @@ void main(List args) { // Setup logging level and printing. setupLogger(argResult); - /// Prompt user if dylib doesn't exist and cannot be auto created to run - /// `pub run ffigen:setup -Ipath/to/llvm/include -Lpath/to/llvm/lib`. - if (!checkDylibExist() && !autoCreateDylib()) { - _logger.severe('Unable to create dynamic library automatically.'); - _logger.severe('If LLVM (9+) is installed, try running:'); - _logger.severe( - ' pub run ffigen:setup -Ipath/to/llvm/include -Lpath/to/llvm/lib'); - exit(1); - } - // Create a config object. Config config; try { diff --git a/pkgs/ffigen/lib/src/executables/setup.dart b/pkgs/ffigen/lib/src/executables/setup.dart deleted file mode 100644 index 84a069b5d2..0000000000 --- a/pkgs/ffigen/lib/src/executables/setup.dart +++ /dev/null @@ -1,276 +0,0 @@ -// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -/// ======================================================================= -/// =============== Build script to generate dyamic library =============== -/// ======================================================================= -/// This Script effectively calls the following (but user can provide -/// command line args which will replace the defaults shown below)- -/// -/// Linux: -/// ``` -/// clang -I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -I/usr/lib/llvm-11/include/ -lclang -shared -fpic path/to/wrapper.c -o path/to/libwrapped_clang.so -/// ``` -/// MacOS: -/// ``` -/// clang -I/usr/local/opt/llvm/include/ -L/usr/local/opt/llvm/lib/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -v -lclang -shared -fpic path/to/wrapper.c -o path/to/libwrapped_clang.dylib -/// ``` -/// Windows: -/// ``` -/// clang -IC:\Progra~1\LLVM\include -LC:\Progra~1\LLVM\lib -llibclang -shared path/to/wrapper.c -o path/to/wrapped_clang.dll -Wl,/DEF:path/to/wrapper.def -/// ``` -/// ======================================================================= -/// ======================================================================= -/// ======================================================================= - -import 'dart:io'; -import 'package:args/args.dart'; -import 'package:ffigen/src/find_resource.dart'; -import 'package:ffigen/src/strings.dart' as strings; -import 'package:path/path.dart' as path; - -/// Default platform options. -final _linuxOpts = _Options( - sharedFlag: '-shared', - inputHeader: _getWrapperPath('wrapper.c'), - fPIC: '-fpic', - ldLibFlag: '-lclang', - headerIncludes: [ - '-I/usr/lib/llvm-9/include/', - '-I/usr/lib/llvm-10/include/', - '-I/usr/lib/llvm-11/include/', - ], -); -final _windowsOpts = _Options( - sharedFlag: '-shared', - inputHeader: _getWrapperPath('wrapper.c'), - moduleDefPath: '-Wl,/DEF:${_getWrapperPath("wrapper.def")}', - ldLibFlag: '-llibclang', - headerIncludes: [ - r'-IC:\Progra~1\LLVM\include', - ], - libIncludes: [ - r'-LC:\Progra~1\LLVM\lib', - ], -); -final _macOSOpts = _Options( - sharedFlag: '-shared', - inputHeader: _getWrapperPath('wrapper.c'), - fPIC: '-fpic', - ldLibFlag: '-lclang', - headerIncludes: [ - '-I/usr/local/opt/llvm/include/', - '-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/', - ], - libIncludes: [ - '-L/usr/local/opt/llvm/lib/', - ], -); - -/// If main is called directly we always re-create the dynamic library. -void main(List arguments) { - // Parses the cmd args. This will print usage and exit if --help was passed. - final argResults = _getArgResults(arguments); - - print('Building Dynamic Library for libclang wrapper...'); - final options = _getPlatformOptions(); - _deleteOldDylib(); - - // Updates header/lib includes in platform options. - _changeIncludesUsingCmdArgs(argResults, options); - - // Run clang compiler to generate the dynamic library. - final processResult = _runClangProcess(options); - _printDetails(processResult, options); -} - -/// Returns true if auto creating dylib was successful. -/// -/// This will fail if llvm is not in default directories or if .dart_tool -/// doesn't exist. -bool autoCreateDylib() { - _deleteOldDylib(); - final options = _getPlatformOptions(); - final processResult = _runClangProcess(options); - if ((processResult.stderr as String).isNotEmpty) { - print(processResult.stderr); - } - return checkDylibExist(); -} - -bool checkDylibExist() { - return File(path.join( - _getDotDartToolPath(), - strings.ffigenFolderName, - strings.dylibFileName, - )).existsSync(); -} - -/// Removes old dynamic libraries(if any) by deleting .dart_tool/ffigen. -/// -/// Throws error if '.dart_tool' is not found. -void _deleteOldDylib() { - // Find .dart_tool. - final dtpath = _getDotDartToolPath(); - // Find .dart_tool/ffigen and delete recursively if it exists. - final ffigenDir = Directory(path.join(dtpath, strings.ffigenFolderName)); - if (ffigenDir.existsSync()) ffigenDir.deleteSync(recursive: true); -} - -/// Creates necesarry parent folders and return full path to dylib. -String _dylibPath() { - // Find .dart_tool. - final dtpath = _getDotDartToolPath(); - // Create .dart_tool/ffigen if it doesn't exists. - final ffigenDir = Directory(path.join(dtpath, strings.ffigenFolderName)); - if (!ffigenDir.existsSync()) ffigenDir.createSync(); - - // Return dylib path - return path.join(ffigenDir.absolute.path, strings.dylibFileName); -} - -/// Returns full path of the wrapper files. -/// -/// Throws error if not found. -String _getWrapperPath(String wrapperName) { - final file = File.fromUri(findWrapper(wrapperName)!); - if (file.existsSync()) { - return file.absolute.path; - } else { - throw Exception('Unable to find $wrapperName file.'); - } -} - -/// Gets full path to .dart_tool. -/// -/// Throws Exception if not found. -String _getDotDartToolPath() { - final dtpath = findDotDartTool()?.toFilePath(); - if (dtpath == null) { - throw Exception('.dart_tool not found.'); - } - return dtpath; -} - -/// Calls the clang compiler. -ProcessResult _runClangProcess(_Options options) { - final result = Process.runSync( - 'clang', - [ - ...options.headerIncludes, - ...options.libIncludes, - options.ldLibFlag, - options.sharedFlag, - options.fPIC, - options.inputHeader, - '-o', - _dylibPath(), - options.moduleDefPath, - '-Wno-nullability-completeness', - ], - ); - return result; -} - -/// Prints success message (or process error if any). -void _printDetails(ProcessResult result, _Options options) { - print(result.stdout); - if ((result.stderr as String).isNotEmpty) { - print(result.stderr); - } else { - print('Created dynamic library.'); - } -} - -ArgResults _getArgResults(List args) { - final parser = ArgParser(allowTrailingOptions: true); - parser.addSeparator('Generates LLVM Wrapper used by this package:'); - parser.addMultiOption('include-header', - abbr: 'I', help: 'Path to header include directories'); - parser.addMultiOption('include-lib', - abbr: 'L', help: 'Path to library include directories'); - parser.addFlag( - 'help', - abbr: 'h', - help: 'prints this usage', - negatable: false, - ); - - ArgResults results; - try { - results = parser.parse(args); - - if (results.wasParsed('help')) { - print(parser.usage); - exit(0); - } - } catch (e) { - print(e); - print(parser.usage); - exit(1); - } - - return results; -} - -/// Use cmd args(if any) to change header/lib include paths. -void _changeIncludesUsingCmdArgs(ArgResults argResult, _Options options) { - if (argResult.wasParsed('include-header')) { - options.headerIncludes = (argResult['include-header'] as List) - .map((header) => '-I$header') - .toList(); - } - if (argResult.wasParsed('include-lib')) { - options.libIncludes = (argResult['include-lib'] as List) - .map((lib) => '-L$lib') - .toList(); - } -} - -/// Get options based on current platform. -_Options _getPlatformOptions() { - if (Platform.isMacOS) { - return _macOSOpts; - } else if (Platform.isWindows) { - return _windowsOpts; - } else if (Platform.isLinux) { - return _linuxOpts; - } else { - throw Exception('Unknown Platform.'); - } -} - -/// Hold options which would be passed to clang. -class _Options { - /// Tells compiler to generate a shared library. - final String sharedFlag; - - /// Flag for generating Position Independant Code (Not used on windows). - final String fPIC; - - /// Input file. - final String inputHeader; - - /// Path to `.def` file containing symbols to export, windows use only. - final String moduleDefPath; - - /// Path to header files. - List headerIncludes; - - /// Path to dynamic/static libraries - List libIncludes; - - /// Linker flag for linking to libclang. - final String ldLibFlag; - - _Options({ - required this.sharedFlag, - required this.inputHeader, - required this.ldLibFlag, - this.headerIncludes = const [], - this.libIncludes = const [], - this.fPIC = '', - this.moduleDefPath = '', - }); -} diff --git a/pkgs/ffigen/lib/src/find_resource.dart b/pkgs/ffigen/lib/src/find_resource.dart deleted file mode 100644 index c16d47ff12..0000000000 --- a/pkgs/ffigen/lib/src/find_resource.dart +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'dart:convert' show jsonDecode; -import 'dart:io' show File, Directory; - -import 'package:logging/logging.dart'; -import 'package:yaml/yaml.dart'; - -final _logger = Logger('ffigen.find_resource'); - -/// Find the `.dart_tool/` folder, returns `null` if unable to find it. -Uri? findDotDartTool() { - // HACK: Because 'dart:isolate' is unavailable in Flutter we have no means - // by which we can find the location of the package_config.json file. - // Which we need, because the binary library created by: - // flutter pub run ffigen:setup - // is located relative to this path. As a workaround we use - // `Platform.script` and traverse level-up until we find a - // `.dart_tool/package_config.json` file. - // Find script directory - var root = Directory.current.uri; - // Traverse up until we see a `.dart_tool/package_config.json` file. - do { - if (File.fromUri(root.resolve('.dart_tool/package_config.json')) - .existsSync()) { - return root.resolve('.dart_tool/'); - } - } while (root != (root = root.resolve('..'))); - return null; -} - -/// Get [Uri] for [posixPath] inside ffigen's rootUri. -Uri? _findInPackageRoot(String posixPath) { - var root = Directory.current.uri; - // Traverse up until we see a `.dart_tool/package_config.json` file. - do { - final file = File.fromUri(root.resolve('.dart_tool/package_config.json')); - if (file.existsSync()) { - /// Read the package_config.json file to extract path of wrapper. - try { - final packageMap = - jsonDecode(file.readAsStringSync()) as Map; - if (packageMap['configVersion'] == 2) { - var ffigenRootUriString = ((packageMap['packages'] as List) - .cast>() - .firstWhere( - (element) => element['name'] == 'ffigen')['rootUri'] - as String); - ffigenRootUriString = ffigenRootUriString.endsWith('/') - ? ffigenRootUriString - : ffigenRootUriString + '/'; - - /// [ffigenRootUri] can be relative to .dart_tool if its from - /// filesystem so we need to resolve it from .dart_tool first. - return file.parent.uri - .resolve(ffigenRootUriString) - .resolve(posixPath); - } - } catch (e, s) { - print(s); - throw Exception('Cannot resolve package:ffigen\'s rootUri.'); - } - } - } while (root != (root = root.resolve('..'))); - return null; -} - -Uri? findWrapper(String wrapperName) { - return _findInPackageRoot('lib/src/clang_library/$wrapperName'); -} - -Uri? _findFfigenPubspecYaml() { - return _findInPackageRoot('pubspec.yaml'); -} - -String? _ffigenVersion; - -/// Gets ffigen version from ffigen's pubspec.yaml -String? get ffigenVersion { - if (_ffigenVersion == null) { - try { - final yaml = - loadYaml(File.fromUri(_findFfigenPubspecYaml()!).readAsStringSync()) - as YamlMap; - final rawVersion = yaml['version'] as String; - // Sanitize name to be used as a file name. - _ffigenVersion = - 'v_${rawVersion.replaceAll('.', '_').replaceAll('+', '_')}'; - } catch (e) { - _logger.severe('Unable to extract ffigen version.'); - } - } - return _ffigenVersion; -} diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 213f7719a7..7e7ab7c8d3 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -16,6 +16,32 @@ class Clang { /// The symbols are looked up in [dynamicLibrary]. Clang(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; + /// Provides a shared context for creating translation units. /// /// It provides two options: @@ -84,6 +110,77 @@ class Clang { _dart_clang_disposeIndex? _clang_disposeIndex; + /// 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; + + /// 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; + + /// 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; + /// Determine the number of diagnostics produced for the given /// translation unit. int clang_getNumDiagnostics( @@ -132,6 +229,33 @@ class Clang { _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; + /// Same as \c clang_parseTranslationUnit2, but returns /// the \c CXTranslationUnit instead of an error code. In case of an error this /// routine returns a \c NULL \c CXTranslationUnit, without further detailed @@ -173,595 +297,614 @@ class Clang { _dart_clang_disposeTranslationUnit? _clang_disposeTranslationUnit; - /// 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 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; - - ffi.Pointer clang_getCString_wrap( - ffi.Pointer string, + /// 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_getCString_wrap ??= _dylib.lookupFunction< - _c_clang_getCString_wrap, - _dart_clang_getCString_wrap>('clang_getCString_wrap'))( - string, + return (_clang_getTranslationUnitCursor ??= _dylib.lookupFunction< + _c_clang_getTranslationUnitCursor, + _dart_clang_getTranslationUnitCursor>( + 'clang_getTranslationUnitCursor'))( + arg0, ); } - _dart_clang_getCString_wrap? _clang_getCString_wrap; + _dart_clang_getTranslationUnitCursor? _clang_getTranslationUnitCursor; - void clang_disposeString_wrap( - ffi.Pointer string, + /// Retrieve the kind of the given cursor. + int clang_getCursorKind( + CXCursor arg0, ) { - return (_clang_disposeString_wrap ??= _dylib.lookupFunction< - _c_clang_disposeString_wrap, - _dart_clang_disposeString_wrap>('clang_disposeString_wrap'))( - string, + return (_clang_getCursorKind ??= _dylib.lookupFunction< + _c_clang_getCursorKind, + _dart_clang_getCursorKind>('clang_getCursorKind'))( + arg0, ); } - _dart_clang_disposeString_wrap? _clang_disposeString_wrap; + _dart_clang_getCursorKind? _clang_getCursorKind; - int clang_getCursorKind_wrap( - ffi.Pointer cursor, + /// 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_getCursorKind_wrap ??= _dylib.lookupFunction< - _c_clang_getCursorKind_wrap, - _dart_clang_getCursorKind_wrap>('clang_getCursorKind_wrap'))( - cursor, + return (_clang_getCursorLocation ??= _dylib.lookupFunction< + _c_clang_getCursorLocation, + _dart_clang_getCursorLocation>('clang_getCursorLocation'))( + arg0, ); } - _dart_clang_getCursorKind_wrap? _clang_getCursorKind_wrap; + _dart_clang_getCursorLocation? _clang_getCursorLocation; - ffi.Pointer clang_getCursorKindSpelling_wrap( - int kind, + /// Retrieve the type of a CXCursor (if any). + CXType clang_getCursorType( + CXCursor C, ) { - return (_clang_getCursorKindSpelling_wrap ??= _dylib.lookupFunction< - _c_clang_getCursorKindSpelling_wrap, - _dart_clang_getCursorKindSpelling_wrap>( - 'clang_getCursorKindSpelling_wrap'))( - kind, + return (_clang_getCursorType ??= _dylib.lookupFunction< + _c_clang_getCursorType, + _dart_clang_getCursorType>('clang_getCursorType'))( + C, ); } - _dart_clang_getCursorKindSpelling_wrap? _clang_getCursorKindSpelling_wrap; + _dart_clang_getCursorType? _clang_getCursorType; - ffi.Pointer clang_getCursorType_wrap( - ffi.Pointer cursor, + /// Pretty-print the underlying type using the rules of the + /// language of the translation unit from which it came. + /// + /// If the type is invalid, an empty string is returned. + CXString clang_getTypeSpelling( + CXType CT, ) { - return (_clang_getCursorType_wrap ??= _dylib.lookupFunction< - _c_clang_getCursorType_wrap, - _dart_clang_getCursorType_wrap>('clang_getCursorType_wrap'))( - cursor, + return (_clang_getTypeSpelling ??= _dylib.lookupFunction< + _c_clang_getTypeSpelling, + _dart_clang_getTypeSpelling>('clang_getTypeSpelling'))( + CT, ); } - _dart_clang_getCursorType_wrap? _clang_getCursorType_wrap; + _dart_clang_getTypeSpelling? _clang_getTypeSpelling; - ffi.Pointer clang_getTypeSpelling_wrap( - ffi.Pointer type, + /// Retrieve the underlying type of a typedef declaration. + /// + /// If the cursor does not reference a typedef declaration, an invalid type is + /// returned. + CXType clang_getTypedefDeclUnderlyingType( + CXCursor C, ) { - return (_clang_getTypeSpelling_wrap ??= _dylib.lookupFunction< - _c_clang_getTypeSpelling_wrap, - _dart_clang_getTypeSpelling_wrap>('clang_getTypeSpelling_wrap'))( - type, + return (_clang_getTypedefDeclUnderlyingType ??= _dylib.lookupFunction< + _c_clang_getTypedefDeclUnderlyingType, + _dart_clang_getTypedefDeclUnderlyingType>( + 'clang_getTypedefDeclUnderlyingType'))( + C, ); } - _dart_clang_getTypeSpelling_wrap? _clang_getTypeSpelling_wrap; + _dart_clang_getTypedefDeclUnderlyingType? _clang_getTypedefDeclUnderlyingType; - ffi.Pointer clang_getTypeKindSpelling_wrap( - int typeKind, + /// Retrieve the integer value of an enum constant declaration as a signed + /// long long. + /// + /// 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_getTypeKindSpelling_wrap ??= _dylib.lookupFunction< - _c_clang_getTypeKindSpelling_wrap, - _dart_clang_getTypeKindSpelling_wrap>( - 'clang_getTypeKindSpelling_wrap'))( - typeKind, + return (_clang_getEnumConstantDeclValue ??= _dylib.lookupFunction< + _c_clang_getEnumConstantDeclValue, + _dart_clang_getEnumConstantDeclValue>( + 'clang_getEnumConstantDeclValue'))( + C, ); } - _dart_clang_getTypeKindSpelling_wrap? _clang_getTypeKindSpelling_wrap; + _dart_clang_getEnumConstantDeclValue? _clang_getEnumConstantDeclValue; - ffi.Pointer clang_getResultType_wrap( - ffi.Pointer functionType, + /// 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_getResultType_wrap ??= _dylib.lookupFunction< - _c_clang_getResultType_wrap, - _dart_clang_getResultType_wrap>('clang_getResultType_wrap'))( - functionType, + return (_clang_getFieldDeclBitWidth ??= _dylib.lookupFunction< + _c_clang_getFieldDeclBitWidth, + _dart_clang_getFieldDeclBitWidth>('clang_getFieldDeclBitWidth'))( + C, ); } - _dart_clang_getResultType_wrap? _clang_getResultType_wrap; + _dart_clang_getFieldDeclBitWidth? _clang_getFieldDeclBitWidth; - ffi.Pointer clang_getPointeeType_wrap( - ffi.Pointer pointerType, + /// 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_getPointeeType_wrap ??= _dylib.lookupFunction< - _c_clang_getPointeeType_wrap, - _dart_clang_getPointeeType_wrap>('clang_getPointeeType_wrap'))( - pointerType, + return (_clang_Cursor_getNumArguments ??= _dylib.lookupFunction< + _c_clang_Cursor_getNumArguments, + _dart_clang_Cursor_getNumArguments>('clang_Cursor_getNumArguments'))( + C, ); } - _dart_clang_getPointeeType_wrap? _clang_getPointeeType_wrap; + _dart_clang_Cursor_getNumArguments? _clang_Cursor_getNumArguments; - ffi.Pointer clang_getCanonicalType_wrap( - ffi.Pointer typerefType, + /// 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_getCanonicalType_wrap ??= _dylib.lookupFunction< - _c_clang_getCanonicalType_wrap, - _dart_clang_getCanonicalType_wrap>('clang_getCanonicalType_wrap'))( - typerefType, + return (_clang_Cursor_getArgument ??= _dylib.lookupFunction< + _c_clang_Cursor_getArgument, + _dart_clang_Cursor_getArgument>('clang_Cursor_getArgument'))( + C, + i, ); } - _dart_clang_getCanonicalType_wrap? _clang_getCanonicalType_wrap; + _dart_clang_Cursor_getArgument? _clang_Cursor_getArgument; - ffi.Pointer clang_Type_getNamedType_wrap( - ffi.Pointer elaboratedType, + /// Return the canonical type for a CXType. + /// + /// 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_Type_getNamedType_wrap ??= _dylib.lookupFunction< - _c_clang_Type_getNamedType_wrap, - _dart_clang_Type_getNamedType_wrap>('clang_Type_getNamedType_wrap'))( - elaboratedType, + return (_clang_getCanonicalType ??= _dylib.lookupFunction< + _c_clang_getCanonicalType, + _dart_clang_getCanonicalType>('clang_getCanonicalType'))( + T, ); } - _dart_clang_Type_getNamedType_wrap? _clang_Type_getNamedType_wrap; + _dart_clang_getCanonicalType? _clang_getCanonicalType; - ffi.Pointer clang_getTypeDeclaration_wrap( - ffi.Pointer cxtype, + /// Determine whether a CXCursor that is a macro, is + /// function like. + int clang_Cursor_isMacroFunctionLike( + CXCursor C, ) { - return (_clang_getTypeDeclaration_wrap ??= _dylib.lookupFunction< - _c_clang_getTypeDeclaration_wrap, - _dart_clang_getTypeDeclaration_wrap>('clang_getTypeDeclaration_wrap'))( - cxtype, + return (_clang_Cursor_isMacroFunctionLike ??= _dylib.lookupFunction< + _c_clang_Cursor_isMacroFunctionLike, + _dart_clang_Cursor_isMacroFunctionLike>( + 'clang_Cursor_isMacroFunctionLike'))( + C, ); } - _dart_clang_getTypeDeclaration_wrap? _clang_getTypeDeclaration_wrap; + _dart_clang_Cursor_isMacroFunctionLike? _clang_Cursor_isMacroFunctionLike; - ffi.Pointer clang_getTypedefDeclUnderlyingType_wrap( - ffi.Pointer cxcursor, + /// Determine whether a CXCursor that is a macro, is a + /// builtin one. + int clang_Cursor_isMacroBuiltin( + CXCursor C, ) { - return (_clang_getTypedefDeclUnderlyingType_wrap ??= _dylib.lookupFunction< - _c_clang_getTypedefDeclUnderlyingType_wrap, - _dart_clang_getTypedefDeclUnderlyingType_wrap>( - 'clang_getTypedefDeclUnderlyingType_wrap'))( - cxcursor, + return (_clang_Cursor_isMacroBuiltin ??= _dylib.lookupFunction< + _c_clang_Cursor_isMacroBuiltin, + _dart_clang_Cursor_isMacroBuiltin>('clang_Cursor_isMacroBuiltin'))( + C, ); } - _dart_clang_getTypedefDeclUnderlyingType_wrap? - _clang_getTypedefDeclUnderlyingType_wrap; + _dart_clang_Cursor_isMacroBuiltin? _clang_Cursor_isMacroBuiltin; - /// The name of parameter, struct, typedef. - ffi.Pointer clang_getCursorSpelling_wrap( - ffi.Pointer cursor, + /// For pointer types, returns the type of the pointee. + CXType clang_getPointeeType( + CXType T, ) { - return (_clang_getCursorSpelling_wrap ??= _dylib.lookupFunction< - _c_clang_getCursorSpelling_wrap, - _dart_clang_getCursorSpelling_wrap>('clang_getCursorSpelling_wrap'))( - cursor, + return (_clang_getPointeeType ??= _dylib.lookupFunction< + _c_clang_getPointeeType, + _dart_clang_getPointeeType>('clang_getPointeeType'))( + T, ); } - _dart_clang_getCursorSpelling_wrap? _clang_getCursorSpelling_wrap; + _dart_clang_getPointeeType? _clang_getPointeeType; - ffi.Pointer clang_getTranslationUnitCursor_wrap( - ffi.Pointer tu, + /// Return the cursor for the declaration of the given type. + CXCursor clang_getTypeDeclaration( + CXType T, ) { - return (_clang_getTranslationUnitCursor_wrap ??= _dylib.lookupFunction< - _c_clang_getTranslationUnitCursor_wrap, - _dart_clang_getTranslationUnitCursor_wrap>( - 'clang_getTranslationUnitCursor_wrap'))( - tu, + return (_clang_getTypeDeclaration ??= _dylib.lookupFunction< + _c_clang_getTypeDeclaration, + _dart_clang_getTypeDeclaration>('clang_getTypeDeclaration'))( + T, ); } - _dart_clang_getTranslationUnitCursor_wrap? - _clang_getTranslationUnitCursor_wrap; + _dart_clang_getTypeDeclaration? _clang_getTypeDeclaration; - ffi.Pointer clang_formatDiagnostic_wrap( - ffi.Pointer diag, - int opts, + /// Retrieve the spelling of a given CXTypeKind. + CXString clang_getTypeKindSpelling( + int K, ) { - return (_clang_formatDiagnostic_wrap ??= _dylib.lookupFunction< - _c_clang_formatDiagnostic_wrap, - _dart_clang_formatDiagnostic_wrap>('clang_formatDiagnostic_wrap'))( - diag, - opts, + return (_clang_getTypeKindSpelling ??= _dylib.lookupFunction< + _c_clang_getTypeKindSpelling, + _dart_clang_getTypeKindSpelling>('clang_getTypeKindSpelling'))( + K, ); } - _dart_clang_formatDiagnostic_wrap? _clang_formatDiagnostic_wrap; + _dart_clang_getTypeKindSpelling? _clang_getTypeKindSpelling; - /// Visitor is a function pointer with parameters having pointers to cxcursor - /// instead of cxcursor by default. - int clang_visitChildren_wrap( - ffi.Pointer parent, - ffi.Pointer> _modifiedVisitor, - int uid, + /// Retrieve the return type associated with a function type. + /// + /// If a non-function type is passed in, an invalid type is returned. + CXType clang_getResultType( + CXType T, ) { - return (_clang_visitChildren_wrap ??= _dylib.lookupFunction< - _c_clang_visitChildren_wrap, - _dart_clang_visitChildren_wrap>('clang_visitChildren_wrap'))( - parent, - _modifiedVisitor, - uid, + return (_clang_getResultType ??= _dylib.lookupFunction< + _c_clang_getResultType, + _dart_clang_getResultType>('clang_getResultType'))( + T, ); } - _dart_clang_visitChildren_wrap? _clang_visitChildren_wrap; + _dart_clang_getResultType? _clang_getResultType; - int clang_Cursor_getNumArguments_wrap( - ffi.Pointer cursor, + /// 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_Cursor_getNumArguments_wrap ??= _dylib.lookupFunction< - _c_clang_Cursor_getNumArguments_wrap, - _dart_clang_Cursor_getNumArguments_wrap>( - 'clang_Cursor_getNumArguments_wrap'))( - cursor, + return (_clang_getNumArgTypes ??= _dylib.lookupFunction< + _c_clang_getNumArgTypes, + _dart_clang_getNumArgTypes>('clang_getNumArgTypes'))( + T, ); } - _dart_clang_Cursor_getNumArguments_wrap? _clang_Cursor_getNumArguments_wrap; + _dart_clang_getNumArgTypes? _clang_getNumArgTypes; - ffi.Pointer clang_Cursor_getArgument_wrap( - ffi.Pointer cursor, + /// Retrieve the type of a parameter of a function type. + /// + /// 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_Cursor_getArgument_wrap ??= _dylib.lookupFunction< - _c_clang_Cursor_getArgument_wrap, - _dart_clang_Cursor_getArgument_wrap>('clang_Cursor_getArgument_wrap'))( - cursor, + return (_clang_getArgType ??= + _dylib.lookupFunction<_c_clang_getArgType, _dart_clang_getArgType>( + 'clang_getArgType'))( + T, i, ); } - _dart_clang_Cursor_getArgument_wrap? _clang_Cursor_getArgument_wrap; + _dart_clang_getArgType? _clang_getArgType; - int clang_getNumArgTypes_wrap( - ffi.Pointer cxtype, + /// 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_getNumArgTypes_wrap ??= _dylib.lookupFunction< - _c_clang_getNumArgTypes_wrap, - _dart_clang_getNumArgTypes_wrap>('clang_getNumArgTypes_wrap'))( - cxtype, + return (_clang_getNumElements ??= _dylib.lookupFunction< + _c_clang_getNumElements, + _dart_clang_getNumElements>('clang_getNumElements'))( + T, ); } - _dart_clang_getNumArgTypes_wrap? _clang_getNumArgTypes_wrap; + _dart_clang_getNumElements? _clang_getNumElements; - ffi.Pointer clang_getArgType_wrap( - ffi.Pointer cxtype, - int i, + /// 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_getArgType_wrap ??= _dylib.lookupFunction< - _c_clang_getArgType_wrap, - _dart_clang_getArgType_wrap>('clang_getArgType_wrap'))( - cxtype, - i, + return (_clang_getArrayElementType ??= _dylib.lookupFunction< + _c_clang_getArrayElementType, + _dart_clang_getArrayElementType>('clang_getArrayElementType'))( + T, ); } - _dart_clang_getArgType_wrap? _clang_getArgType_wrap; + _dart_clang_getArrayElementType? _clang_getArrayElementType; - int clang_getEnumConstantDeclValue_wrap( - ffi.Pointer cursor, + /// Retrieve the type named by the qualified-id. + /// + /// If a non-elaborated type is passed in, an invalid type is returned. + CXType clang_Type_getNamedType( + CXType T, ) { - return (_clang_getEnumConstantDeclValue_wrap ??= _dylib.lookupFunction< - _c_clang_getEnumConstantDeclValue_wrap, - _dart_clang_getEnumConstantDeclValue_wrap>( - 'clang_getEnumConstantDeclValue_wrap'))( - cursor, + return (_clang_Type_getNamedType ??= _dylib.lookupFunction< + _c_clang_Type_getNamedType, + _dart_clang_Type_getNamedType>('clang_Type_getNamedType'))( + T, ); } - _dart_clang_getEnumConstantDeclValue_wrap? - _clang_getEnumConstantDeclValue_wrap; + _dart_clang_Type_getNamedType? _clang_Type_getNamedType; - /// Returns non-zero if the ranges are the same, zero if they differ. - int clang_equalRanges_wrap( - ffi.Pointer c1, - ffi.Pointer c2, + /// Determine whether the given cursor represents an anonymous + /// tag or namespace + int clang_Cursor_isAnonymous( + CXCursor C, ) { - return (_clang_equalRanges_wrap ??= _dylib.lookupFunction< - _c_clang_equalRanges_wrap, - _dart_clang_equalRanges_wrap>('clang_equalRanges_wrap'))( - c1, - c2, + return (_clang_Cursor_isAnonymous ??= _dylib.lookupFunction< + _c_clang_Cursor_isAnonymous, + _dart_clang_Cursor_isAnonymous>('clang_Cursor_isAnonymous'))( + C, ); } - _dart_clang_equalRanges_wrap? _clang_equalRanges_wrap; + _dart_clang_Cursor_isAnonymous? _clang_Cursor_isAnonymous; - /// Returns the comment range. - ffi.Pointer clang_Cursor_getCommentRange_wrap( - ffi.Pointer cursor, + /// Determine whether the given cursor represents an anonymous record + /// declaration. + int clang_Cursor_isAnonymousRecordDecl( + CXCursor C, ) { - return (_clang_Cursor_getCommentRange_wrap ??= _dylib.lookupFunction< - _c_clang_Cursor_getCommentRange_wrap, - _dart_clang_Cursor_getCommentRange_wrap>( - 'clang_Cursor_getCommentRange_wrap'))( - cursor, + return (_clang_Cursor_isAnonymousRecordDecl ??= _dylib.lookupFunction< + _c_clang_Cursor_isAnonymousRecordDecl, + _dart_clang_Cursor_isAnonymousRecordDecl>( + 'clang_Cursor_isAnonymousRecordDecl'))( + C, ); } - _dart_clang_Cursor_getCommentRange_wrap? _clang_Cursor_getCommentRange_wrap; + _dart_clang_Cursor_isAnonymousRecordDecl? _clang_Cursor_isAnonymousRecordDecl; - /// Returns the raw comment. - ffi.Pointer clang_Cursor_getRawCommentText_wrap( - ffi.Pointer cursor, + /// Visit the children of a particular cursor. + /// + /// 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 parent the cursor whose child may be visited. All kinds of + /// cursors can be visited, including invalid cursors (which, by + /// definition, have no children). + /// + /// \param visitor the visitor function that will be invoked for each + /// child of \p parent. + /// + /// \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, ) { - return (_clang_Cursor_getRawCommentText_wrap ??= _dylib.lookupFunction< - _c_clang_Cursor_getRawCommentText_wrap, - _dart_clang_Cursor_getRawCommentText_wrap>( - 'clang_Cursor_getRawCommentText_wrap'))( - cursor, + return (_clang_visitChildren ??= _dylib.lookupFunction< + _c_clang_visitChildren, + _dart_clang_visitChildren>('clang_visitChildren'))( + parent, + visitor, + client_data, ); } - _dart_clang_Cursor_getRawCommentText_wrap? - _clang_Cursor_getRawCommentText_wrap; + _dart_clang_visitChildren? _clang_visitChildren; - /// Returns the first paragraph of doxygen doc comment. - ffi.Pointer clang_Cursor_getBriefCommentText_wrap( - ffi.Pointer cursor, + /// 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_Cursor_getBriefCommentText_wrap ??= _dylib.lookupFunction< - _c_clang_Cursor_getBriefCommentText_wrap, - _dart_clang_Cursor_getBriefCommentText_wrap>( - 'clang_Cursor_getBriefCommentText_wrap'))( - cursor, + return (_clang_getCursorUSR ??= + _dylib.lookupFunction<_c_clang_getCursorUSR, _dart_clang_getCursorUSR>( + 'clang_getCursorUSR'))( + arg0, ); } - _dart_clang_Cursor_getBriefCommentText_wrap? - _clang_Cursor_getBriefCommentText_wrap; + _dart_clang_getCursorUSR? _clang_getCursorUSR; - ffi.Pointer clang_getCursorLocation_wrap( - ffi.Pointer cursor, + /// Retrieve a name for the entity referenced by this cursor. + CXString clang_getCursorSpelling( + CXCursor arg0, ) { - return (_clang_getCursorLocation_wrap ??= _dylib.lookupFunction< - _c_clang_getCursorLocation_wrap, - _dart_clang_getCursorLocation_wrap>('clang_getCursorLocation_wrap'))( - cursor, + return (_clang_getCursorSpelling ??= _dylib.lookupFunction< + _c_clang_getCursorSpelling, + _dart_clang_getCursorSpelling>('clang_getCursorSpelling'))( + arg0, ); } - _dart_clang_getCursorLocation_wrap? _clang_getCursorLocation_wrap; + _dart_clang_getCursorSpelling? _clang_getCursorSpelling; - void clang_getFileLocation_wrap( - ffi.Pointer location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, + /// 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_getFileLocation_wrap ??= _dylib.lookupFunction< - _c_clang_getFileLocation_wrap, - _dart_clang_getFileLocation_wrap>('clang_getFileLocation_wrap'))( - location, - file, - line, - column, - offset, + return (_clang_Cursor_getCommentRange ??= _dylib.lookupFunction< + _c_clang_Cursor_getCommentRange, + _dart_clang_Cursor_getCommentRange>('clang_Cursor_getCommentRange'))( + C, ); } - _dart_clang_getFileLocation_wrap? _clang_getFileLocation_wrap; + _dart_clang_Cursor_getCommentRange? _clang_Cursor_getCommentRange; - ffi.Pointer clang_getFileName_wrap( - ffi.Pointer SFile, + /// Given a cursor that represents a declaration, return the associated + /// comment text, including comment markers. + CXString clang_Cursor_getRawCommentText( + CXCursor C, ) { - return (_clang_getFileName_wrap ??= _dylib.lookupFunction< - _c_clang_getFileName_wrap, - _dart_clang_getFileName_wrap>('clang_getFileName_wrap'))( - SFile, + return (_clang_Cursor_getRawCommentText ??= _dylib.lookupFunction< + _c_clang_Cursor_getRawCommentText, + _dart_clang_Cursor_getRawCommentText>( + 'clang_Cursor_getRawCommentText'))( + C, ); } - _dart_clang_getFileName_wrap? _clang_getFileName_wrap; + _dart_clang_Cursor_getRawCommentText? _clang_Cursor_getRawCommentText; - int clang_getNumElements_wrap( - ffi.Pointer cxtype, + /// 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_getNumElements_wrap ??= _dylib.lookupFunction< - _c_clang_getNumElements_wrap, - _dart_clang_getNumElements_wrap>('clang_getNumElements_wrap'))( - cxtype, + return (_clang_Cursor_getBriefCommentText ??= _dylib.lookupFunction< + _c_clang_Cursor_getBriefCommentText, + _dart_clang_Cursor_getBriefCommentText>( + 'clang_Cursor_getBriefCommentText'))( + C, ); } - _dart_clang_getNumElements_wrap? _clang_getNumElements_wrap; + _dart_clang_Cursor_getBriefCommentText? _clang_Cursor_getBriefCommentText; - ffi.Pointer clang_getArrayElementType_wrap( - ffi.Pointer cxtype, + /// \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_getArrayElementType_wrap ??= _dylib.lookupFunction< - _c_clang_getArrayElementType_wrap, - _dart_clang_getArrayElementType_wrap>( - 'clang_getArrayElementType_wrap'))( - cxtype, + return (_clang_getCursorKindSpelling ??= _dylib.lookupFunction< + _c_clang_getCursorKindSpelling, + _dart_clang_getCursorKindSpelling>('clang_getCursorKindSpelling'))( + Kind, ); } - _dart_clang_getArrayElementType_wrap? _clang_getArrayElementType_wrap; + _dart_clang_getCursorKindSpelling? _clang_getCursorKindSpelling; - int clang_Cursor_isMacroFunctionLike_wrap( - ffi.Pointer cursor, + /// 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_isMacroFunctionLike_wrap ??= _dylib.lookupFunction< - _c_clang_Cursor_isMacroFunctionLike_wrap, - _dart_clang_Cursor_isMacroFunctionLike_wrap>( - 'clang_Cursor_isMacroFunctionLike_wrap'))( - cursor, + return (_clang_Cursor_Evaluate ??= _dylib.lookupFunction< + _c_clang_Cursor_Evaluate, + _dart_clang_Cursor_Evaluate>('clang_Cursor_Evaluate'))( + C, ); } - _dart_clang_Cursor_isMacroFunctionLike_wrap? - _clang_Cursor_isMacroFunctionLike_wrap; + _dart_clang_Cursor_Evaluate? _clang_Cursor_Evaluate; - int clang_Cursor_isMacroBuiltin_wrap( - ffi.Pointer cursor, + /// Returns the kind of the evaluated result. + int clang_EvalResult_getKind( + ffi.Pointer E, ) { - return (_clang_Cursor_isMacroBuiltin_wrap ??= _dylib.lookupFunction< - _c_clang_Cursor_isMacroBuiltin_wrap, - _dart_clang_Cursor_isMacroBuiltin_wrap>( - 'clang_Cursor_isMacroBuiltin_wrap'))( - cursor, + return (_clang_EvalResult_getKind ??= _dylib.lookupFunction< + _c_clang_EvalResult_getKind, + _dart_clang_EvalResult_getKind>('clang_EvalResult_getKind'))( + E, ); } - _dart_clang_Cursor_isMacroBuiltin_wrap? _clang_Cursor_isMacroBuiltin_wrap; + _dart_clang_EvalResult_getKind? _clang_EvalResult_getKind; - ffi.Pointer clang_Cursor_Evaluate_wrap( - ffi.Pointer cursor, + /// Returns the evaluation result as integer if the + /// kind is Int. + int clang_EvalResult_getAsInt( + ffi.Pointer E, ) { - return (_clang_Cursor_Evaluate_wrap ??= _dylib.lookupFunction< - _c_clang_Cursor_Evaluate_wrap, - _dart_clang_Cursor_Evaluate_wrap>('clang_Cursor_Evaluate_wrap'))( - cursor, + return (_clang_EvalResult_getAsInt ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsInt, + _dart_clang_EvalResult_getAsInt>('clang_EvalResult_getAsInt'))( + E, ); } - _dart_clang_Cursor_Evaluate_wrap? _clang_Cursor_Evaluate_wrap; + _dart_clang_EvalResult_getAsInt? _clang_EvalResult_getAsInt; - int clang_Cursor_isAnonymous_wrap( - ffi.Pointer cursor, + /// 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_Cursor_isAnonymous_wrap ??= _dylib.lookupFunction< - _c_clang_Cursor_isAnonymous_wrap, - _dart_clang_Cursor_isAnonymous_wrap>('clang_Cursor_isAnonymous_wrap'))( - cursor, + return (_clang_EvalResult_getAsLongLong ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsLongLong, + _dart_clang_EvalResult_getAsLongLong>( + 'clang_EvalResult_getAsLongLong'))( + E, ); } - _dart_clang_Cursor_isAnonymous_wrap? _clang_Cursor_isAnonymous_wrap; + _dart_clang_EvalResult_getAsLongLong? _clang_EvalResult_getAsLongLong; - int clang_Cursor_isAnonymousRecordDecl_wrap( - ffi.Pointer cursor, + /// Returns the evaluation result as double if the + /// kind is double. + double clang_EvalResult_getAsDouble( + ffi.Pointer E, ) { - return (_clang_Cursor_isAnonymousRecordDecl_wrap ??= _dylib.lookupFunction< - _c_clang_Cursor_isAnonymousRecordDecl_wrap, - _dart_clang_Cursor_isAnonymousRecordDecl_wrap>( - 'clang_Cursor_isAnonymousRecordDecl_wrap'))( - cursor, + return (_clang_EvalResult_getAsDouble ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsDouble, + _dart_clang_EvalResult_getAsDouble>('clang_EvalResult_getAsDouble'))( + E, ); } - _dart_clang_Cursor_isAnonymousRecordDecl_wrap? - _clang_Cursor_isAnonymousRecordDecl_wrap; + _dart_clang_EvalResult_getAsDouble? _clang_EvalResult_getAsDouble; - ffi.Pointer clang_getCursorUSR_wrap( - ffi.Pointer cursor, + /// 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_getCursorUSR_wrap ??= _dylib.lookupFunction< - _c_clang_getCursorUSR_wrap, - _dart_clang_getCursorUSR_wrap>('clang_getCursorUSR_wrap'))( - cursor, + return (_clang_EvalResult_getAsStr ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsStr, + _dart_clang_EvalResult_getAsStr>('clang_EvalResult_getAsStr'))( + E, ); } - _dart_clang_getCursorUSR_wrap? _clang_getCursorUSR_wrap; + _dart_clang_EvalResult_getAsStr? _clang_EvalResult_getAsStr; - int clang_getFieldDeclBitWidth_wrap( - ffi.Pointer cursor, + /// Disposes the created Eval memory. + void clang_EvalResult_dispose( + ffi.Pointer E, ) { - return (_clang_getFieldDeclBitWidth_wrap ??= _dylib.lookupFunction< - _c_clang_getFieldDeclBitWidth_wrap, - _dart_clang_getFieldDeclBitWidth_wrap>( - 'clang_getFieldDeclBitWidth_wrap'))( - cursor, + return (_clang_EvalResult_dispose ??= _dylib.lookupFunction< + _c_clang_EvalResult_dispose, + _dart_clang_EvalResult_dispose>('clang_EvalResult_dispose'))( + E, ); } - _dart_clang_getFieldDeclBitWidth_wrap? _clang_getFieldDeclBitWidth_wrap; + _dart_clang_EvalResult_dispose? _clang_EvalResult_dispose; } /// A character string. @@ -1429,49 +1572,46 @@ abstract class CXCursorKind { /// \endcode static const int CXCursor_CXXFunctionalCastExpr = 128; - /// OpenCL's addrspace_cast<> expression. - static const int CXCursor_CXXAddrspaceCastExpr = 129; - /// A C++ typeid expression (C++ [expr.typeid]). - static const int CXCursor_CXXTypeidExpr = 130; + static const int CXCursor_CXXTypeidExpr = 129; /// [C++ 2.13.5] C++ Boolean Literal. - static const int CXCursor_CXXBoolLiteralExpr = 131; + static const int CXCursor_CXXBoolLiteralExpr = 130; /// [C++0x 2.14.7] C++ Pointer Literal. - static const int CXCursor_CXXNullPtrLiteralExpr = 132; + static const int CXCursor_CXXNullPtrLiteralExpr = 131; /// Represents the "this" expression in C++ - static const int CXCursor_CXXThisExpr = 133; + static const int CXCursor_CXXThisExpr = 132; /// [C++ 15] C++ Throw Expression. /// /// This handles 'throw' and 'throw' assignment-expression. When /// assignment-expression isn't present, Op will be null. - static const int CXCursor_CXXThrowExpr = 134; + 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 = 135; + static const int CXCursor_CXXNewExpr = 134; /// A delete expression for memory deallocation and destructor calls, /// e.g. "delete[] pArray". - static const int CXCursor_CXXDeleteExpr = 136; + static const int CXCursor_CXXDeleteExpr = 135; /// A unary expression. (noexcept, sizeof, or other traits) - static const int CXCursor_UnaryExpr = 137; + static const int CXCursor_UnaryExpr = 136; /// An Objective-C string literal i.e. @"foo". - static const int CXCursor_ObjCStringLiteral = 138; + static const int CXCursor_ObjCStringLiteral = 137; /// An Objective-C \@encode expression. - static const int CXCursor_ObjCEncodeExpr = 139; + static const int CXCursor_ObjCEncodeExpr = 138; /// An Objective-C \@selector expression. - static const int CXCursor_ObjCSelectorExpr = 140; + static const int CXCursor_ObjCSelectorExpr = 139; /// An Objective-C \@protocol expression. - static const int CXCursor_ObjCProtocolExpr = 141; + 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. @@ -1479,7 +1619,7 @@ abstract class CXCursorKind { /// \code /// NSString *str = (__bridge_transfer NSString *)CFCreateString(); /// \endcode - static const int CXCursor_ObjCBridgedCastExpr = 142; + static const int CXCursor_ObjCBridgedCastExpr = 141; /// Represents a C++0x pack expansion that produces a sequence of /// expressions. @@ -1493,7 +1633,7 @@ abstract class CXCursorKind { /// f(static_cast(args)...); /// } /// \endcode - static const int CXCursor_PackExpansionExpr = 143; + static const int CXCursor_PackExpansionExpr = 142; /// Represents an expression that computes the length of a parameter /// pack. @@ -1504,30 +1644,24 @@ abstract class CXCursorKind { /// static const unsigned value = sizeof...(Types); /// }; /// \endcode - static const int CXCursor_SizeOfPackExpr = 144; - static const int CXCursor_LambdaExpr = 145; + static const int CXCursor_SizeOfPackExpr = 143; + static const int CXCursor_LambdaExpr = 144; /// Objective-c Boolean Literal. - static const int CXCursor_ObjCBoolLiteralExpr = 146; + static const int CXCursor_ObjCBoolLiteralExpr = 145; /// Represents the "self" expression in an Objective-C method. - static const int CXCursor_ObjCSelfExpr = 147; + static const int CXCursor_ObjCSelfExpr = 146; - /// OpenMP 5.0 [2.1.5, Array Section]. - static const int CXCursor_OMPArraySectionExpr = 148; + /// OpenMP 4.0 [2.4, Array Section]. + static const int CXCursor_OMPArraySectionExpr = 147; /// Represents an @available(...) check. - static const int CXCursor_ObjCAvailabilityCheckExpr = 149; + static const int CXCursor_ObjCAvailabilityCheckExpr = 148; /// Fixed point literal - static const int CXCursor_FixedPointLiteral = 150; - - /// OpenMP 5.0 [2.1.4, Array Shaping]. - static const int CXCursor_OMPArrayShapingExpr = 151; - - /// OpenMP 5.0 [2.1.6 Iterators] - static const int CXCursor_OMPIteratorExpr = 152; - static const int CXCursor_LastExpr = 152; + 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 @@ -1809,13 +1943,7 @@ abstract class CXCursorKind { /// OpenMP parallel master directive. static const int CXCursor_OMPParallelMasterDirective = 285; - - /// OpenMP depobj directive. - static const int CXCursor_OMPDepobjDirective = 286; - - /// OpenMP scan directive. - static const int CXCursor_OMPScanDirective = 287; - static const int CXCursor_LastStmt = 287; + static const int CXCursor_LastStmt = 285; /// Cursor that represents the translation unit itself. /// @@ -2018,9 +2146,8 @@ abstract class CXTypeKind { static const int CXType_UShortAccum = 36; static const int CXType_UAccum = 37; static const int CXType_ULongAccum = 38; - static const int CXType_BFloat16 = 39; static const int CXType_FirstBuiltin = 2; - static const int CXType_LastBuiltin = 39; + static const int CXType_LastBuiltin = 38; static const int CXType_Complex = 100; static const int CXType_Pointer = 101; static const int CXType_BlockPointer = 102; @@ -2102,7 +2229,6 @@ abstract class CXTypeKind { static const int CXType_OCLIntelSubgroupAVCImeSingleRefStreamin = 174; static const int CXType_OCLIntelSubgroupAVCImeDualRefStreamin = 175; static const int CXType_ExtVector = 176; - static const int CXType_Atomic = 177; } /// The type of an element in the abstract syntax tree. @@ -2191,11 +2317,27 @@ abstract class CXEvalResultKind { const int CINDEX_VERSION_MAJOR = 0; -const int CINDEX_VERSION_MINOR = 60; +const int CINDEX_VERSION_MINOR = 59; -const int CINDEX_VERSION = 60; +const int CINDEX_VERSION = 59; -const String CINDEX_VERSION_STRING = '0.60'; +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_createIndex = ffi.Pointer Function( ffi.Int32 excludeDeclarationsFromPCH, @@ -2215,6 +2357,40 @@ typedef _dart_clang_disposeIndex = void Function( ffi.Pointer index, ); +typedef _c_clang_getFileName = CXString Function( + ffi.Pointer SFile, +); + +typedef _dart_clang_getFileName = CXString Function( + ffi.Pointer SFile, +); + +typedef _c_clang_equalRanges = ffi.Uint32 Function( + CXSourceRange range1, + CXSourceRange range2, +); + +typedef _dart_clang_equalRanges = int Function( + CXSourceRange range1, + CXSourceRange range2, +); + +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_getNumDiagnostics = ffi.Uint32 Function( ffi.Pointer Unit, ); @@ -2241,6 +2417,16 @@ 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_parseTranslationUnit = ffi.Pointer Function( ffi.Pointer CIdx, @@ -2271,390 +2457,320 @@ typedef _dart_clang_disposeTranslationUnit = void Function( ffi.Pointer arg0, ); -typedef _c_clang_EvalResult_getKind = ffi.Int32 Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getKind = int Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsInt = ffi.Int32 Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsInt = int Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsLongLong = ffi.Int64 Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsLongLong = int Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsDouble = ffi.Double Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsDouble = double Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsStr = ffi.Pointer Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsStr = ffi.Pointer Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_dispose = ffi.Void Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_dispose = void Function( - ffi.Pointer E, -); - -typedef _c_clang_getCString_wrap = ffi.Pointer Function( - ffi.Pointer string, +typedef _c_clang_getTranslationUnitCursor = CXCursor Function( + ffi.Pointer arg0, ); -typedef _dart_clang_getCString_wrap = ffi.Pointer Function( - ffi.Pointer string, +typedef _dart_clang_getTranslationUnitCursor = CXCursor Function( + ffi.Pointer arg0, ); -typedef _c_clang_disposeString_wrap = ffi.Void Function( - ffi.Pointer string, +typedef _c_clang_getCursorKind = ffi.Int32 Function( + CXCursor arg0, ); -typedef _dart_clang_disposeString_wrap = void Function( - ffi.Pointer string, +typedef _dart_clang_getCursorKind = int Function( + CXCursor arg0, ); -typedef _c_clang_getCursorKind_wrap = ffi.Int32 Function( - ffi.Pointer cursor, +typedef _c_clang_getCursorLocation = CXSourceLocation Function( + CXCursor arg0, ); -typedef _dart_clang_getCursorKind_wrap = int Function( - ffi.Pointer cursor, +typedef _dart_clang_getCursorLocation = CXSourceLocation Function( + CXCursor arg0, ); -typedef _c_clang_getCursorKindSpelling_wrap = ffi.Pointer Function( - ffi.Int32 kind, +typedef _c_clang_getCursorType = CXType Function( + CXCursor C, ); -typedef _dart_clang_getCursorKindSpelling_wrap = ffi.Pointer Function( - int kind, +typedef _dart_clang_getCursorType = CXType Function( + CXCursor C, ); -typedef _c_clang_getCursorType_wrap = ffi.Pointer Function( - ffi.Pointer cursor, +typedef _c_clang_getTypeSpelling = CXString Function( + CXType CT, ); -typedef _dart_clang_getCursorType_wrap = ffi.Pointer Function( - ffi.Pointer cursor, +typedef _dart_clang_getTypeSpelling = CXString Function( + CXType CT, ); -typedef _c_clang_getTypeSpelling_wrap = ffi.Pointer Function( - ffi.Pointer type, +typedef _c_clang_getTypedefDeclUnderlyingType = CXType Function( + CXCursor C, ); -typedef _dart_clang_getTypeSpelling_wrap = ffi.Pointer Function( - ffi.Pointer type, +typedef _dart_clang_getTypedefDeclUnderlyingType = CXType Function( + CXCursor C, ); -typedef _c_clang_getTypeKindSpelling_wrap = ffi.Pointer Function( - ffi.Int32 typeKind, +typedef _c_clang_getEnumConstantDeclValue = ffi.Int64 Function( + CXCursor C, ); -typedef _dart_clang_getTypeKindSpelling_wrap = ffi.Pointer Function( - int typeKind, +typedef _dart_clang_getEnumConstantDeclValue = int Function( + CXCursor C, ); -typedef _c_clang_getResultType_wrap = ffi.Pointer Function( - ffi.Pointer functionType, +typedef _c_clang_getFieldDeclBitWidth = ffi.Int32 Function( + CXCursor C, ); -typedef _dart_clang_getResultType_wrap = ffi.Pointer Function( - ffi.Pointer functionType, +typedef _dart_clang_getFieldDeclBitWidth = int Function( + CXCursor C, ); -typedef _c_clang_getPointeeType_wrap = ffi.Pointer Function( - ffi.Pointer pointerType, +typedef _c_clang_Cursor_getNumArguments = ffi.Int32 Function( + CXCursor C, ); -typedef _dart_clang_getPointeeType_wrap = ffi.Pointer Function( - ffi.Pointer pointerType, +typedef _dart_clang_Cursor_getNumArguments = int Function( + CXCursor C, ); -typedef _c_clang_getCanonicalType_wrap = ffi.Pointer Function( - ffi.Pointer typerefType, +typedef _c_clang_Cursor_getArgument = CXCursor Function( + CXCursor C, + ffi.Uint32 i, ); -typedef _dart_clang_getCanonicalType_wrap = ffi.Pointer Function( - ffi.Pointer typerefType, +typedef _dart_clang_Cursor_getArgument = CXCursor Function( + CXCursor C, + int i, ); -typedef _c_clang_Type_getNamedType_wrap = ffi.Pointer Function( - ffi.Pointer elaboratedType, +typedef _c_clang_getCanonicalType = CXType Function( + CXType T, ); -typedef _dart_clang_Type_getNamedType_wrap = ffi.Pointer Function( - ffi.Pointer elaboratedType, +typedef _dart_clang_getCanonicalType = CXType Function( + CXType T, ); -typedef _c_clang_getTypeDeclaration_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, +typedef _c_clang_Cursor_isMacroFunctionLike = ffi.Uint32 Function( + CXCursor C, ); -typedef _dart_clang_getTypeDeclaration_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, +typedef _dart_clang_Cursor_isMacroFunctionLike = int Function( + CXCursor C, ); -typedef _c_clang_getTypedefDeclUnderlyingType_wrap = ffi.Pointer - Function( - ffi.Pointer cxcursor, +typedef _c_clang_Cursor_isMacroBuiltin = ffi.Uint32 Function( + CXCursor C, ); -typedef _dart_clang_getTypedefDeclUnderlyingType_wrap = ffi.Pointer - Function( - ffi.Pointer cxcursor, +typedef _dart_clang_Cursor_isMacroBuiltin = int Function( + CXCursor C, ); -typedef _c_clang_getCursorSpelling_wrap = ffi.Pointer Function( - ffi.Pointer cursor, +typedef _c_clang_getPointeeType = CXType Function( + CXType T, ); -typedef _dart_clang_getCursorSpelling_wrap = ffi.Pointer Function( - ffi.Pointer cursor, +typedef _dart_clang_getPointeeType = CXType Function( + CXType T, ); -typedef _c_clang_getTranslationUnitCursor_wrap = ffi.Pointer Function( - ffi.Pointer tu, +typedef _c_clang_getTypeDeclaration = CXCursor Function( + CXType T, ); -typedef _dart_clang_getTranslationUnitCursor_wrap = ffi.Pointer - Function( - ffi.Pointer tu, +typedef _dart_clang_getTypeDeclaration = CXCursor Function( + CXType T, ); -typedef _c_clang_formatDiagnostic_wrap = ffi.Pointer Function( - ffi.Pointer diag, - ffi.Int32 opts, +typedef _c_clang_getTypeKindSpelling = CXString Function( + ffi.Int32 K, ); -typedef _dart_clang_formatDiagnostic_wrap = ffi.Pointer Function( - ffi.Pointer diag, - int opts, +typedef _dart_clang_getTypeKindSpelling = CXString Function( + int K, ); -typedef ModifiedCXCursorVisitor = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, +typedef _c_clang_getResultType = CXType Function( + CXType T, ); -typedef _c_clang_visitChildren_wrap = ffi.Uint32 Function( - ffi.Pointer parent, - ffi.Pointer> _modifiedVisitor, - ffi.Int64 uid, +typedef _dart_clang_getResultType = CXType Function( + CXType T, ); -typedef _dart_clang_visitChildren_wrap = int Function( - ffi.Pointer parent, - ffi.Pointer> _modifiedVisitor, - int uid, +typedef _c_clang_getNumArgTypes = ffi.Int32 Function( + CXType T, ); -typedef _c_clang_Cursor_getNumArguments_wrap = ffi.Int32 Function( - ffi.Pointer cursor, +typedef _dart_clang_getNumArgTypes = int Function( + CXType T, ); -typedef _dart_clang_Cursor_getNumArguments_wrap = int Function( - ffi.Pointer cursor, -); - -typedef _c_clang_Cursor_getArgument_wrap = ffi.Pointer Function( - ffi.Pointer cursor, +typedef _c_clang_getArgType = CXType Function( + CXType T, ffi.Uint32 i, ); -typedef _dart_clang_Cursor_getArgument_wrap = ffi.Pointer Function( - ffi.Pointer cursor, +typedef _dart_clang_getArgType = CXType Function( + CXType T, int i, ); -typedef _c_clang_getNumArgTypes_wrap = ffi.Int32 Function( - ffi.Pointer cxtype, +typedef _c_clang_getNumElements = ffi.Int64 Function( + CXType T, ); -typedef _dart_clang_getNumArgTypes_wrap = int Function( - ffi.Pointer cxtype, +typedef _dart_clang_getNumElements = int Function( + CXType T, ); -typedef _c_clang_getArgType_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, - ffi.Uint32 i, +typedef _c_clang_getArrayElementType = CXType Function( + CXType T, ); -typedef _dart_clang_getArgType_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, - int i, +typedef _dart_clang_getArrayElementType = CXType Function( + CXType T, ); -typedef _c_clang_getEnumConstantDeclValue_wrap = ffi.Int64 Function( - ffi.Pointer cursor, +typedef _c_clang_Type_getNamedType = CXType Function( + CXType T, ); -typedef _dart_clang_getEnumConstantDeclValue_wrap = int Function( - ffi.Pointer cursor, +typedef _dart_clang_Type_getNamedType = CXType Function( + CXType T, ); -typedef _c_clang_equalRanges_wrap = ffi.Uint32 Function( - ffi.Pointer c1, - ffi.Pointer c2, +typedef _c_clang_Cursor_isAnonymous = ffi.Uint32 Function( + CXCursor C, ); -typedef _dart_clang_equalRanges_wrap = int Function( - ffi.Pointer c1, - ffi.Pointer c2, +typedef _dart_clang_Cursor_isAnonymous = int Function( + CXCursor C, ); -typedef _c_clang_Cursor_getCommentRange_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, +typedef _c_clang_Cursor_isAnonymousRecordDecl = ffi.Uint32 Function( + CXCursor C, ); -typedef _dart_clang_Cursor_getCommentRange_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, +typedef _dart_clang_Cursor_isAnonymousRecordDecl = int Function( + CXCursor C, ); -typedef _c_clang_Cursor_getRawCommentText_wrap = ffi.Pointer Function( - ffi.Pointer cursor, +typedef CXCursorVisitor = ffi.Int32 Function( + CXCursor, + CXCursor, + ffi.Pointer, ); -typedef _dart_clang_Cursor_getRawCommentText_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, +typedef _c_clang_visitChildren = ffi.Uint32 Function( + CXCursor parent, + ffi.Pointer> visitor, + ffi.Pointer client_data, ); -typedef _c_clang_Cursor_getBriefCommentText_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, +typedef _dart_clang_visitChildren = int Function( + CXCursor parent, + ffi.Pointer> visitor, + ffi.Pointer client_data, ); -typedef _dart_clang_Cursor_getBriefCommentText_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, +typedef _c_clang_getCursorUSR = CXString Function( + CXCursor arg0, ); -typedef _c_clang_getCursorLocation_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, +typedef _dart_clang_getCursorUSR = CXString Function( + CXCursor arg0, ); -typedef _dart_clang_getCursorLocation_wrap = ffi.Pointer - Function( - ffi.Pointer cursor, +typedef _c_clang_getCursorSpelling = CXString Function( + CXCursor arg0, ); -typedef _c_clang_getFileLocation_wrap = ffi.Void Function( - ffi.Pointer location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, +typedef _dart_clang_getCursorSpelling = CXString Function( + CXCursor arg0, ); -typedef _dart_clang_getFileLocation_wrap = void Function( - ffi.Pointer location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, +typedef _c_clang_Cursor_getCommentRange = CXSourceRange Function( + CXCursor C, ); -typedef _c_clang_getFileName_wrap = ffi.Pointer Function( - ffi.Pointer SFile, +typedef _dart_clang_Cursor_getCommentRange = CXSourceRange Function( + CXCursor C, ); -typedef _dart_clang_getFileName_wrap = ffi.Pointer Function( - ffi.Pointer SFile, +typedef _c_clang_Cursor_getRawCommentText = CXString Function( + CXCursor C, +); + +typedef _dart_clang_Cursor_getRawCommentText = CXString Function( + CXCursor C, ); -typedef _c_clang_getNumElements_wrap = ffi.Uint64 Function( - ffi.Pointer cxtype, +typedef _c_clang_Cursor_getBriefCommentText = CXString Function( + CXCursor C, ); -typedef _dart_clang_getNumElements_wrap = int Function( - ffi.Pointer cxtype, +typedef _dart_clang_Cursor_getBriefCommentText = CXString Function( + CXCursor C, ); -typedef _c_clang_getArrayElementType_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, +typedef _c_clang_getCursorKindSpelling = CXString Function( + ffi.Int32 Kind, ); -typedef _dart_clang_getArrayElementType_wrap = ffi.Pointer Function( - ffi.Pointer cxtype, +typedef _dart_clang_getCursorKindSpelling = CXString Function( + int Kind, ); -typedef _c_clang_Cursor_isMacroFunctionLike_wrap = ffi.Uint32 Function( - ffi.Pointer cursor, +typedef _c_clang_Cursor_Evaluate = ffi.Pointer Function( + CXCursor C, ); -typedef _dart_clang_Cursor_isMacroFunctionLike_wrap = int Function( - ffi.Pointer cursor, +typedef _dart_clang_Cursor_Evaluate = ffi.Pointer Function( + CXCursor C, ); -typedef _c_clang_Cursor_isMacroBuiltin_wrap = ffi.Uint32 Function( - ffi.Pointer cursor, +typedef _c_clang_EvalResult_getKind = ffi.Int32 Function( + ffi.Pointer E, ); -typedef _dart_clang_Cursor_isMacroBuiltin_wrap = int Function( - ffi.Pointer cursor, +typedef _dart_clang_EvalResult_getKind = int Function( + ffi.Pointer E, ); -typedef _c_clang_Cursor_Evaluate_wrap = ffi.Pointer Function( - ffi.Pointer cursor, +typedef _c_clang_EvalResult_getAsInt = ffi.Int32 Function( + ffi.Pointer E, ); -typedef _dart_clang_Cursor_Evaluate_wrap = ffi.Pointer Function( - ffi.Pointer cursor, +typedef _dart_clang_EvalResult_getAsInt = int Function( + ffi.Pointer E, ); -typedef _c_clang_Cursor_isAnonymous_wrap = ffi.Uint32 Function( - ffi.Pointer cursor, +typedef _c_clang_EvalResult_getAsLongLong = ffi.Int64 Function( + ffi.Pointer E, ); -typedef _dart_clang_Cursor_isAnonymous_wrap = int Function( - ffi.Pointer cursor, +typedef _dart_clang_EvalResult_getAsLongLong = int Function( + ffi.Pointer E, ); -typedef _c_clang_Cursor_isAnonymousRecordDecl_wrap = ffi.Uint32 Function( - ffi.Pointer cursor, +typedef _c_clang_EvalResult_getAsDouble = ffi.Double Function( + ffi.Pointer E, ); -typedef _dart_clang_Cursor_isAnonymousRecordDecl_wrap = int Function( - ffi.Pointer cursor, +typedef _dart_clang_EvalResult_getAsDouble = double Function( + ffi.Pointer E, ); -typedef _c_clang_getCursorUSR_wrap = ffi.Pointer Function( - ffi.Pointer cursor, +typedef _c_clang_EvalResult_getAsStr = ffi.Pointer Function( + ffi.Pointer E, ); -typedef _dart_clang_getCursorUSR_wrap = ffi.Pointer Function( - ffi.Pointer cursor, +typedef _dart_clang_EvalResult_getAsStr = ffi.Pointer Function( + ffi.Pointer E, ); -typedef _c_clang_getFieldDeclBitWidth_wrap = ffi.Int32 Function( - ffi.Pointer cursor, +typedef _c_clang_EvalResult_dispose = ffi.Void Function( + ffi.Pointer E, ); -typedef _dart_clang_getFieldDeclBitWidth_wrap = int Function( - ffi.Pointer cursor, +typedef _dart_clang_EvalResult_dispose = void Function( + ffi.Pointer E, ); diff --git a/pkgs/ffigen/lib/src/header_parser/data.dart b/pkgs/ffigen/lib/src/header_parser/data.dart index 462f069f0e..c2b371e4ab 100644 --- a/pkgs/ffigen/lib/src/header_parser/data.dart +++ b/pkgs/ffigen/lib/src/header_parser/data.dart @@ -29,12 +29,6 @@ BindingsIndex _bindingsIndex = BindingsIndex(); IncrementalNamer get incrementalNamer => _incrementalNamer; IncrementalNamer _incrementalNamer = IncrementalNamer(); -/// Holds the unique id refering to this isolate. -/// -/// Used by visitChildren_wrap to call the correct dart function from C. -// int get uid => Isolate.current.controlPort.; -final uid = Isolate.current.controlPort.nativePort; - /// Saved macros, Key: prefixedName, Value originalName. Map get savedMacros => _savedMacros; Map _savedMacros = {}; @@ -43,9 +37,9 @@ Map _savedMacros = {}; List get unnamedEnumConstants => _unnamedEnumConstants; List _unnamedEnumConstants = []; -void initializeGlobals({required Config config, required Clang clang}) { +void initializeGlobals({required Config config}) { _config = config; - _clang = clang; + _clang = Clang(DynamicLibrary.open(config.libclangDylib)); _incrementalNamer = IncrementalNamer(); _savedMacros = {}; _unnamedEnumConstants = []; diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index 7ce92fe3d3..2ce1cb9851 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -9,11 +9,9 @@ import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/config_provider.dart'; import 'package:ffigen/src/header_parser/sub_parsers/macro_parser.dart'; import 'package:ffigen/src/config_provider/config_types.dart'; -import 'package:ffigen/src/find_resource.dart'; import 'package:ffigen/src/header_parser/translation_unit_parser.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; -import 'package:path/path.dart' as path; import 'clang_bindings/clang_bindings.dart' as clang_types; import 'data.dart'; @@ -47,23 +45,10 @@ final _logger = Logger('ffigen.header_parser.parser'); /// Initializes parser, clears any previous values. void initParser(Config c) { - // Find full path of dynamic library and initialize bindings. - final ddt = findDotDartTool(); - if (ddt == null) { - throw Exception('Unable to find .dart_tool.'); - } else { - final fullDylibPath = path.join( - ddt.toFilePath(), - strings.ffigenFolderName, - strings.dylibFileName, - ); - - // Initialize global variables. - initializeGlobals( - config: c, - clang: clang_types.Clang(DynamicLibrary.open(fullDylibPath)), - ); - } + // Initialize global variables. + initializeGlobals( + config: c, + ); } /// Parses source files and adds generated bindings to [bindings]. @@ -111,12 +96,11 @@ List parseToBindings() { } logTuDiagnostics(tu, _logger, headerLocation); - final rootCursor = clang.clang_getTranslationUnitCursor_wrap(tu); + final rootCursor = clang.clang_getTranslationUnitCursor(tu); - bindings.addAll(parseTranslationUnit(rootCursor)!); + bindings.addAll(parseTranslationUnit(rootCursor)); // Cleanup. - rootCursor.dispose(); clang.clang_disposeTranslationUnit(tu); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index 1097372c2e..7da0ab43bd 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -26,7 +26,7 @@ final _stack = Stack<_ParsedEnum>(); /// Parses a function declaration. EnumClass? parseEnumDeclaration( - Pointer cursor, { + clang_types.CXCursor cursor, { /// Optionally provide name to use (useful in case enum is inside a typedef). String? name, @@ -36,7 +36,7 @@ EnumClass? parseEnumDeclaration( final enumName = name ?? cursor.spelling(); if (enumName == '') { // Save this unnamed enum if it is anonymous (therefore not in a typedef). - if (clang.clang_Cursor_isAnonymous_wrap(cursor) != 0) { + if (clang.clang_Cursor_isAnonymous(cursor) != 0) { _logger.fine('Saving anonymous enum.'); saveUnNamedEnum(cursor); } else { @@ -64,12 +64,12 @@ EnumClass? parseEnumDeclaration( return _stack.pop().enumClass; } -void _addEnumConstant(Pointer cursor) { - final resultCode = clang.clang_visitChildren_wrap( +void _addEnumConstant(clang_types.CXCursor cursor) { + final resultCode = clang.clang_visitChildren( cursor, Pointer.fromFunction( _enumCursorVisitor, clang_types.CXChildVisitResult.CXChildVisit_Break), - uid, + nullptr, ); visitChildrenResultChecker(resultCode); @@ -79,19 +79,17 @@ void _addEnumConstant(Pointer cursor) { /// /// Invoked on every enum directly under rootCursor. /// Used for for extracting enum values. -int _enumCursorVisitor(Pointer cursor, - Pointer parent, Pointer clientData) { +int _enumCursorVisitor(clang_types.CXCursor cursor, clang_types.CXCursor parent, + Pointer clientData) { try { _logger.finest(' enumCursorVisitor: ${cursor.completeStringRepr()}'); - switch (clang.clang_getCursorKind_wrap(cursor)) { + switch (clang.clang_getCursorKind(cursor)) { case clang_types.CXCursorKind.CXCursor_EnumConstantDecl: _addEnumConstantToEnumClass(cursor); break; default: _logger.fine('invalid enum constant'); } - cursor.dispose(); - parent.dispose(); } catch (e, s) { _logger.severe(e); _logger.severe(s); @@ -101,7 +99,7 @@ int _enumCursorVisitor(Pointer cursor, } /// Adds the parameter to func in [functiondecl_parser.dart]. -void _addEnumConstantToEnumClass(Pointer cursor) { +void _addEnumConstantToEnumClass(clang_types.CXCursor cursor) { _stack.top.enumClass!.enumConstants.add( EnumConstant( dartDoc: getCursorDocComment( @@ -113,6 +111,6 @@ void _addEnumConstantToEnumClass(Pointer cursor) { _stack.top.enumClass!.originalName, cursor.spelling(), ), - value: clang.clang_getEnumConstantDeclValue_wrap(cursor)), + value: clang.clang_getEnumConstantDeclValue(cursor)), ); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index acb223a3b7..7bf089ab9a 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -2,8 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'dart:ffi'; - import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/header_parser/data.dart'; import 'package:logging/logging.dart'; @@ -26,7 +24,7 @@ class _ParserFunc { final _stack = Stack<_ParserFunc>(); /// Parses a function declaration. -Func? parseFunctionDeclaration(Pointer cursor) { +Func? parseFunctionDeclaration(clang_types.CXCursor cursor) { _stack.push(_ParserFunc()); final funcUsr = cursor.usr(); @@ -77,17 +75,16 @@ Func? parseFunctionDeclaration(Pointer cursor) { return _stack.pop().func; } -Type _getFunctionReturnType(Pointer cursor) { - return cursor.returnType().toCodeGenTypeAndDispose(); +Type _getFunctionReturnType(clang_types.CXCursor cursor) { + return cursor.returnType().toCodeGenType(); } -List _getParameters( - Pointer cursor, String funcName) { +List _getParameters(clang_types.CXCursor cursor, String funcName) { final parameters = []; - final totalArgs = clang.clang_Cursor_getNumArguments_wrap(cursor); + final totalArgs = clang.clang_Cursor_getNumArguments(cursor); for (var i = 0; i < totalArgs; i++) { - final paramCursor = clang.clang_Cursor_getArgument_wrap(cursor, i); + final paramCursor = clang.clang_Cursor_getArgument(cursor, i); _logger.finer('===== parameter: ${paramCursor.completeStringRepr()}'); @@ -110,12 +107,11 @@ List _getParameters( type: pt, ), ); - paramCursor.dispose(); } return parameters; } -Type _getParameterType(Pointer cursor) { - return cursor.type().toCodeGenTypeAndDispose(); +Type _getParameterType(clang_types.CXCursor cursor) { + return cursor.type().toCodeGenType(); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart index 0261838688..4f18ce6a6a 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart @@ -21,11 +21,11 @@ import '../utils.dart'; final _logger = Logger('ffigen.header_parser.macro_parser'); /// Adds a macro definition to be parsed later. -void saveMacroDefinition(Pointer cursor) { +void saveMacroDefinition(clang_types.CXCursor cursor) { final macroUsr = cursor.usr(); final originalMacroName = cursor.spelling(); - if (clang.clang_Cursor_isMacroBuiltin_wrap(cursor) == 0 && - clang.clang_Cursor_isMacroFunctionLike_wrap(cursor) == 0 && + if (clang.clang_Cursor_isMacroBuiltin(cursor) == 0 && + clang.clang_Cursor_isMacroFunctionLike(cursor) == 0 && shouldIncludeMacro(macroUsr, originalMacroName)) { // Parse macro only if it's not builtin or function-like. _logger.fine( @@ -76,17 +76,16 @@ List? parseSavedMacros() { if (tu == nullptr) { _logger.severe('Unable to parse Macros.'); } else { - final rootCursor = clang.clang_getTranslationUnitCursor_wrap(tu); + final rootCursor = clang.clang_getTranslationUnitCursor(tu); - final resultCode = clang.clang_visitChildren_wrap( + final resultCode = clang.clang_visitChildren( rootCursor, Pointer.fromFunction(_macroVariablevisitor, clang_types.CXChildVisitResult.CXChildVisit_Break), - uid, + nullptr, ); visitChildrenResultChecker(resultCode); - rootCursor.dispose(); } clang.clang_disposeTranslationUnit(tu); @@ -98,14 +97,14 @@ List? parseSavedMacros() { } /// Child visitor invoked on translationUnitCursor for parsing macroVariables. -int _macroVariablevisitor(Pointer cursor, - Pointer parent, Pointer clientData) { +int _macroVariablevisitor(clang_types.CXCursor cursor, + clang_types.CXCursor parent, Pointer clientData) { Constant? constant; try { if (isFromGeneratedFile(cursor) && _macroVarNames.contains(cursor.spelling()) && - cursor.kind() == clang_types.CXCursorKind.CXCursor_VarDecl) { - final e = clang.clang_Cursor_Evaluate_wrap(cursor); + cursor.kind == clang_types.CXCursorKind.CXCursor_VarDecl) { + final e = clang.clang_Cursor_Evaluate(cursor); final k = clang.clang_EvalResult_getKind(e); _logger.fine('macroVariablevisitor: ${cursor.completeStringRepr()}'); @@ -151,8 +150,6 @@ int _macroVariablevisitor(Pointer cursor, _bindings!.add(constant); } } - cursor.dispose(); - parent.dispose(); } catch (e, s) { _logger.severe(e); _logger.severe(s); @@ -162,7 +159,7 @@ int _macroVariablevisitor(Pointer cursor, } /// Returns true if cursor is from generated file. -bool isFromGeneratedFile(Pointer cursor) { +bool isFromGeneratedFile(clang_types.CXCursor cursor) { final s = cursor.sourceFileName(); return p.basename(s) == _generatedFileBaseName; } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index ffa4109d0f..dffd5028b7 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -5,7 +5,6 @@ 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; @@ -40,7 +39,7 @@ final _stack = Stack<_ParsedStruc>(); /// Parses a struct declaration. Struc? parseStructDeclaration( - Pointer cursor, { + clang_types.CXCursor cursor, { /// Optionally provide name (useful in case struct is inside a typedef). String? name, @@ -81,15 +80,15 @@ Struc? parseStructDeclaration( return _stack.pop().struc; } -void _setStructMembers(Pointer cursor) { +void _setStructMembers(clang_types.CXCursor cursor) { _stack.top.arrayMember = false; _stack.top.unimplementedMemberType = false; - final resultCode = clang.clang_visitChildren_wrap( + final resultCode = clang.clang_visitChildren( cursor, Pointer.fromFunction(_structMembersVisitor, clang_types.CXChildVisitResult.CXChildVisit_Break), - uid, + nullptr, ); visitChildrenResultChecker(resultCode); @@ -137,19 +136,19 @@ void _setStructMembers(Pointer cursor) { /// Visitor for the struct cursor [CXCursorKind.CXCursor_StructDecl]. /// /// Child visitor invoked on struct cursor. -int _structMembersVisitor(Pointer cursor, - Pointer parent, Pointer clientData) { +int _structMembersVisitor(clang_types.CXCursor cursor, + clang_types.CXCursor parent, Pointer clientData) { try { - if (cursor.kind() == clang_types.CXCursorKind.CXCursor_FieldDecl) { + if (cursor.kind == clang_types.CXCursorKind.CXCursor_FieldDecl) { _logger.finer('===== member: ${cursor.completeStringRepr()}'); - final mt = cursor.type().toCodeGenTypeAndDispose(); + final mt = cursor.type().toCodeGenType(); if (mt.broadType == BroadType.ConstantArray) { _stack.top.arrayMember = true; } else if (mt.broadType == BroadType.IncompleteArray) { // TODO(68): Structs with flexible Array Members are not supported. _stack.top.flexibleArrayMember = true; - } else if (clang.clang_getFieldDeclBitWidth_wrap(cursor) != -1) { + } else if (clang.clang_getFieldDeclBitWidth(cursor) != -1) { // TODO(84): Struct with bitfields are not suppoorted. _stack.top.bitFieldMember = true; } else if (mt.broadType == BroadType.Handle) { @@ -177,8 +176,6 @@ int _structMembersVisitor(Pointer cursor, ), ); } - cursor.dispose(); - parent.dispose(); } catch (e, s) { _logger.severe(e); _logger.severe(s); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart index de39f207b8..57ab11c19d 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart @@ -26,15 +26,15 @@ class _ParsedTypedef { final _stack = Stack<_ParsedTypedef>(); /// Parses a typedef declaration. -Binding? parseTypedefDeclaration(Pointer cursor) { +Binding? parseTypedefDeclaration(clang_types.CXCursor cursor) { _stack.push(_ParsedTypedef()); // Name of typedef. _stack.top.typedefName = cursor.spelling(); - final resultCode = clang.clang_visitChildren_wrap( + final resultCode = clang.clang_visitChildren( cursor, Pointer.fromFunction(_typedefdeclarationCursorVisitor, clang_types.CXChildVisitResult.CXChildVisit_Break), - uid, + nullptr, ); visitChildrenResultChecker(resultCode); @@ -46,13 +46,13 @@ Binding? parseTypedefDeclaration(Pointer cursor) { /// /// Visitor invoked on cursor of type declaration returned by /// [clang.clang_getTypeDeclaration_wrap]. -int _typedefdeclarationCursorVisitor(Pointer cursor, - Pointer parent, Pointer clientData) { +int _typedefdeclarationCursorVisitor(clang_types.CXCursor cursor, + clang_types.CXCursor parent, Pointer clientData) { try { _logger.finest( 'typedefdeclarationCursorVisitor: ${cursor.completeStringRepr()}'); - switch (clang.clang_getCursorKind_wrap(cursor)) { + switch (clang.clang_getCursorKind(cursor)) { case clang_types.CXCursorKind.CXCursor_StructDecl: _stack.top.binding = parseStructDeclaration(cursor, name: _stack.top.typedefName); @@ -64,9 +64,6 @@ int _typedefdeclarationCursorVisitor(Pointer cursor, default: _logger.finest('typedefdeclarationCursorVisitor: Ignored'); } - - cursor.dispose(); - parent.dispose(); } catch (e, s) { _logger.severe(e); _logger.severe(s); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart index 4c1e244d87..584694d869 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart @@ -16,12 +16,12 @@ import '../utils.dart'; final _logger = Logger('ffigen.header_parser.unnamed_enumdecl_parser'); /// Saves unnamed enums. -void saveUnNamedEnum(Pointer cursor) { - final resultCode = clang.clang_visitChildren_wrap( +void saveUnNamedEnum(clang_types.CXCursor cursor) { + final resultCode = clang.clang_visitChildren( cursor, Pointer.fromFunction(_unnamedenumCursorVisitor, clang_types.CXChildVisitResult.CXChildVisit_Break), - uid, + nullptr, ); visitChildrenResultChecker(resultCode); @@ -31,12 +31,12 @@ void saveUnNamedEnum(Pointer cursor) { /// /// Invoked on every enum directly under rootCursor. /// Used for for extracting enum values. -int _unnamedenumCursorVisitor(Pointer cursor, - Pointer parent, Pointer clientData) { +int _unnamedenumCursorVisitor(clang_types.CXCursor cursor, + clang_types.CXCursor parent, Pointer clientData) { try { _logger .finest(' unnamedenumCursorVisitor: ${cursor.completeStringRepr()}'); - switch (clang.clang_getCursorKind_wrap(cursor)) { + switch (clang.clang_getCursorKind(cursor)) { case clang_types.CXCursorKind.CXCursor_EnumConstantDecl: if (shouldIncludeUnnamedEnumConstant(cursor.usr(), cursor.spelling())) { _addUnNamedEnumConstant(cursor); @@ -45,8 +45,6 @@ int _unnamedenumCursorVisitor(Pointer cursor, default: _logger.severe('Invalid enum constant.'); } - cursor.dispose(); - parent.dispose(); } catch (e, s) { _logger.severe(e); _logger.severe(s); @@ -56,7 +54,7 @@ int _unnamedenumCursorVisitor(Pointer cursor, } /// Adds the parameter to func in [functiondecl_parser.dart]. -void _addUnNamedEnumConstant(Pointer cursor) { +void _addUnNamedEnumConstant(clang_types.CXCursor cursor) { unnamedEnumConstants.add( Constant( usr: cursor.usr(), @@ -65,7 +63,7 @@ void _addUnNamedEnumConstant(Pointer cursor) { cursor.spelling(), ), rawType: 'int', - rawValue: clang.clang_getEnumConstantDeclValue_wrap(cursor).toString(), + rawValue: clang.clang_getEnumConstantDeclValue(cursor).toString(), ), ); } diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart index c4ad7e9ec9..7c08410c32 100644 --- a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -19,17 +19,16 @@ import 'utils.dart'; final _logger = Logger('ffigen.header_parser.translation_unit_parser'); -Set? _bindings; +late Set _bindings; /// Parses the translation unit and returns the generated bindings. -Set? parseTranslationUnit( - Pointer translationUnitCursor) { +Set parseTranslationUnit(clang_types.CXCursor translationUnitCursor) { _bindings = {}; - final resultCode = clang.clang_visitChildren_wrap( + final resultCode = clang.clang_visitChildren( translationUnitCursor, Pointer.fromFunction( _rootCursorVisitor, clang_types.CXChildVisitResult.CXChildVisit_Break), - uid, + nullptr, ); visitChildrenResultChecker(resultCode); @@ -38,12 +37,12 @@ Set? parseTranslationUnit( } /// Child visitor invoked on translationUnitCursor [CXCursorKind.CXCursor_TranslationUnit]. -int _rootCursorVisitor(Pointer cursor, - Pointer parent, Pointer clientData) { +int _rootCursorVisitor(clang_types.CXCursor cursor, clang_types.CXCursor parent, + Pointer clientData) { try { if (shouldIncludeRootCursor(cursor.sourceFileName())) { _logger.finest('rootCursorVisitor: ${cursor.completeStringRepr()}'); - switch (clang.clang_getCursorKind_wrap(cursor)) { + switch (clang.clang_getCursorKind(cursor)) { case clang_types.CXCursorKind.CXCursor_FunctionDecl: addToBindings(parseFunctionDeclaration(cursor)); break; @@ -66,9 +65,6 @@ int _rootCursorVisitor(Pointer cursor, _logger.finest( 'rootCursorVisitor:(not included) ${cursor.completeStringRepr()}'); } - - cursor.dispose(); - parent.dispose(); } catch (e, s) { _logger.severe(e); _logger.severe(s); @@ -81,6 +77,6 @@ int _rootCursorVisitor(Pointer cursor, void addToBindings(Binding? b) { if (b != null) { // This is a set, and hence will not have duplicates. - _bindings!.add(b); + _bindings.add(b); } } diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index d1a7883bcd..e216d02aa8 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -3,8 +3,6 @@ // BSD-style license that can be found in the LICENSE file. /// Extracts code_gen Type from type. -import 'dart:ffi'; - import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; @@ -20,15 +18,14 @@ final _logger = Logger('ffigen.header_parser.extractor'); const _padding = ' '; /// Converts cxtype to a typestring code_generator can accept. -Type getCodeGenType(Pointer cxtype, {String? parentName}) { +Type getCodeGenType(clang_types.CXType cxtype, {String? parentName}) { _logger.fine('${_padding}getCodeGenType ${cxtype.completeStringRepr()}'); - final kind = cxtype.kind(); + final kind = cxtype.kind; switch (kind) { case clang_types.CXTypeKind.CXType_Pointer: - final pt = clang.clang_getPointeeType_wrap(cxtype); + final pt = clang.clang_getPointeeType(cxtype); final s = getCodeGenType(pt, parentName: parentName); - pt.dispose(); // Replace Pointer<_Dart_Handle> with Handle. if (config.useDartHandle && @@ -52,16 +49,14 @@ Type getCodeGenType(Pointer cxtype, {String? parentName}) { } // This is important or we get stuck in infinite recursion. - final ct = clang.clang_getTypedefDeclUnderlyingType_wrap( - clang.clang_getTypeDeclaration_wrap(cxtype)); + final ct = clang.clang_getTypedefDeclUnderlyingType( + clang.clang_getTypeDeclaration(cxtype)); final s = getCodeGenType(ct, parentName: parentName ?? cxtype.spelling()); - ct.dispose(); return s; case clang_types.CXTypeKind.CXType_Elaborated: - final et = clang.clang_Type_getNamedType_wrap(cxtype); + final et = clang.clang_Type_getNamedType(cxtype); final s = getCodeGenType(et, parentName: parentName); - et.dispose(); return s; case clang_types.CXTypeKind.CXType_Record: return _extractfromRecord(cxtype, parentName); @@ -78,20 +73,20 @@ Type getCodeGenType(Pointer cxtype, {String? parentName}) { case clang_types.CXTypeKind .CXType_ConstantArray: // Primarily used for constant array in struct members. return Type.constantArray( - clang.clang_getNumElements_wrap(cxtype), - clang.clang_getArrayElementType_wrap(cxtype).toCodeGenTypeAndDispose(), + clang.clang_getNumElements(cxtype), + clang.clang_getArrayElementType(cxtype).toCodeGenType(), ); case clang_types.CXTypeKind .CXType_IncompleteArray: // Primarily used for incomplete array in function parameters. return Type.incompleteArray( - clang.clang_getArrayElementType_wrap(cxtype).toCodeGenTypeAndDispose(), + clang.clang_getArrayElementType(cxtype).toCodeGenType(), ); case clang_types.CXTypeKind.CXType_Bool: return Type.boolean(); default: if (cxTypeKindToSupportedNativeTypes.containsKey(kind)) { return Type.nativeType( - cxTypeKindToSupportedNativeTypes[kind!], + cxTypeKindToSupportedNativeTypes[kind], ); } else { _logger.fine( @@ -102,16 +97,14 @@ Type getCodeGenType(Pointer cxtype, {String? parentName}) { } } -Type _extractfromRecord( - Pointer cxtype, String? parentName) { +Type _extractfromRecord(clang_types.CXType cxtype, String? parentName) { Type type; - final cursor = clang.clang_getTypeDeclaration_wrap(cxtype); + final cursor = clang.clang_getTypeDeclaration(cxtype); _logger.fine('${_padding}_extractfromRecord: ${cursor.completeStringRepr()}'); - switch (clang.clang_getCursorKind_wrap(cursor)) { + switch (clang.clang_getCursorKind(cursor)) { case clang_types.CXCursorKind.CXCursor_StructDecl: - final cxtype = cursor.type(); final structUsr = cursor.usr(); // Name of typedef (parentName) is used if available. @@ -132,7 +125,6 @@ Type _extractfromRecord( } } - cxtype.dispose(); break; default: _logger.fine( @@ -140,23 +132,21 @@ Type _extractfromRecord( return Type.unimplemented( 'Type: ${cxtype.kindSpelling()} not implemented'); } - cursor.dispose(); return type; } // Used for function pointer arguments. -Type _extractFromFunctionProto( - Pointer cxtype, String? parentName) { +Type _extractFromFunctionProto(clang_types.CXType cxtype, String? parentName) { var name = parentName; // An empty name means the function prototype was declared in-place, instead // of using a typedef. name = name ?? ''; final _parameters = []; - final totalArgs = clang.clang_getNumArgTypes_wrap(cxtype); + final totalArgs = clang.clang_getNumArgTypes(cxtype); for (var i = 0; i < totalArgs; i++) { - final t = clang.clang_getArgType_wrap(cxtype, i); - final pt = t.toCodeGenTypeAndDispose(); + final t = clang.clang_getArgType(cxtype, i); + final pt = t.toCodeGenType(); if (pt.isIncompleteStruct) { return Type.unimplemented( @@ -178,8 +168,7 @@ Type _extractFromFunctionProto( name: name.isNotEmpty ? name : incrementalNamer.name('_typedefC'), typedefType: TypedefType.C, parameters: _parameters, - returnType: - clang.clang_getResultType_wrap(cxtype).toCodeGenTypeAndDispose(), + returnType: clang.clang_getResultType(cxtype).toCodeGenType(), ); // Add to seen, if name isn't empty. if (name.isNotEmpty) { diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index f24c187311..f0a412781d 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -37,7 +37,7 @@ void logTuDiagnostics( logger.severe('Header $header: Total errors/warnings: $total.'); for (var i = 0; i < total; i++) { final diag = clang.clang_getDiagnostic(tu, i); - final cxstring = clang.clang_formatDiagnostic_wrap( + final cxstring = clang.clang_formatDiagnostic( diag, clang_types .CXDiagnosticDisplayOptions.CXDiagnostic_DisplaySourceLocation | @@ -56,25 +56,25 @@ extension CXSourceRangeExt on Pointer { } } -extension CXCursorExt on Pointer { +extension CXCursorExt on clang_types.CXCursor { String usr() { - return clang.clang_getCursorUSR_wrap(this).toStringAndDispose(); + return clang.clang_getCursorUSR(this).toStringAndDispose(); } /// Returns the kind int from [clang_types.CXCursorKind]. int kind() { - return clang.clang_getCursorKind_wrap(this); + return clang.clang_getCursorKind(this); } /// Name of the cursor (E.g function name, Struct name, Parameter name). String spelling() { - return clang.clang_getCursorSpelling_wrap(this).toStringAndDispose(); + return clang.clang_getCursorSpelling(this).toStringAndDispose(); } /// Spelling for a [clang_types.CXCursorKind], useful for debug purposes. String kindSpelling() { return clang - .clang_getCursorKindSpelling_wrap(clang.clang_getCursorKind_wrap(this)) + .clang_getCursorKindSpelling(clang.clang_getCursorKind(this)) .toStringAndDispose(); } @@ -82,92 +82,77 @@ extension CXCursorExt on Pointer { String completeStringRepr() { final cxtype = type(); final s = - '(Cursor) spelling: ${spelling()}, kind: ${kind()}, kindSpelling: ${kindSpelling()}, type: ${cxtype.kind()}, typeSpelling: ${cxtype.spelling()}, usr: ${usr()}'; - cxtype.dispose(); + '(Cursor) spelling: ${spelling()}, kind: ${kind()}, kindSpelling: ${kindSpelling()}, type: ${cxtype.kind}, typeSpelling: ${cxtype.spelling()}, usr: ${usr()}'; return s; } /// Dispose type using [type.dispose]. - Pointer type() { - return clang.clang_getCursorType_wrap(this); + clang_types.CXType type() { + return clang.clang_getCursorType(this); } /// Only valid for [clang.CXCursorKind.CXCursor_FunctionDecl]. /// /// Dispose type using [type.dispose]. - Pointer returnType() { - final t = type(); - final r = clang.clang_getResultType_wrap(t); - t.dispose(); - return r; + clang_types.CXType returnType() { + return clang.clang_getResultType(type()); } String sourceFileName() { - final cxsource = clang.clang_getCursorLocation_wrap(this); + final cxsource = clang.clang_getCursorLocation(this); final cxfilePtr = allocate>(); final line = allocate(); final column = allocate(); final offset = allocate(); // Puts the values in these pointers. - clang.clang_getFileLocation_wrap(cxsource, cxfilePtr, line, column, offset); - final s = - clang.clang_getFileName_wrap(cxfilePtr.value).toStringAndDispose(); - free(cxsource); + clang.clang_getFileLocation(cxsource, cxfilePtr, line, column, offset); + final s = clang.clang_getFileName(cxfilePtr.value).toStringAndDispose(); + free(cxfilePtr); free(line); free(column); free(offset); return s; } - - void dispose() { - free(this); - } } const commentPrefix = '/// '; const nesting = ' '; /// Stores the [clang_types.CXSourceRange] of the last comment. -Pointer lastCommentRange = nullptr; +clang_types.CXSourceRange? lastCommentRange; /// Returns a cursor's associated comment. /// /// The given string is wrapped at line width = 80 - [indent]. The [indent] is /// [commentPrefix.dimensions] by default because a comment starts with /// [commentPrefix]. -String? getCursorDocComment(Pointer cursor, +String? getCursorDocComment(clang_types.CXCursor cursor, [int indent = commentPrefix.length]) { String? formattedDocComment; - final currentCommentRange = clang.clang_Cursor_getCommentRange_wrap(cursor); + final currentCommentRange = clang.clang_Cursor_getCommentRange(cursor); // See if this comment and the last comment both point to the same source // range. - if (lastCommentRange != nullptr && - currentCommentRange != nullptr && - clang.clang_equalRanges_wrap(lastCommentRange, currentCommentRange) != - 0) { + if (lastCommentRange != null && + clang.clang_equalRanges(lastCommentRange!, currentCommentRange) != 0) { formattedDocComment = null; } else { switch (config.commentType.length) { case CommentLength.full: - formattedDocComment = removeRawCommentMarkups(clang - .clang_Cursor_getRawCommentText_wrap(cursor) - .toStringAndDispose()); + formattedDocComment = removeRawCommentMarkups( + clang.clang_Cursor_getRawCommentText(cursor).toStringAndDispose()); break; case CommentLength.brief: formattedDocComment = _wrapNoNewLineString( - clang - .clang_Cursor_getBriefCommentText_wrap(cursor) - .toStringAndDispose(), + clang.clang_Cursor_getBriefCommentText(cursor).toStringAndDispose(), 80 - indent); break; default: formattedDocComment = null; } } - lastCommentRange.dispose(); lastCommentRange = currentCommentRange; return formattedDocComment; } @@ -220,31 +205,24 @@ String? removeRawCommentMarkups(String? string) { return sb.toString().trim(); } -extension CXTypeExt on Pointer { +extension CXTypeExt on clang_types.CXType { /// Get code_gen [Type] representation of [clang_types.CXType]. Type toCodeGenType() { return getCodeGenType(this); } - /// Get code_gen [Type] representation of [clang_types.CXType] and dispose the type. - Type toCodeGenTypeAndDispose() { - final t = getCodeGenType(this); - dispose(); - return t; - } - /// Spelling for a [clang_types.CXTypeKind], useful for debug purposes. String spelling() { - return clang.clang_getTypeSpelling_wrap(this).toStringAndDispose(); + return clang.clang_getTypeSpelling(this).toStringAndDispose(); } /// Returns the typeKind int from [clang_types.CXTypeKind]. - int? kind() { - return ref.kind; + int kind() { + return this.kind; } String kindSpelling() { - return clang.clang_getTypeKindSpelling_wrap(kind()!).toStringAndDispose(); + return clang.clang_getTypeKindSpelling(kind()).toStringAndDispose(); } /// For debugging: returns [spelling] [kind] [kindSpelling]. @@ -253,19 +231,15 @@ extension CXTypeExt on Pointer { '(Type) spelling: ${spelling()}, kind: ${kind()}, kindSpelling: ${kindSpelling()}'; return s; } - - void dispose() { - free(this); - } } -extension CXStringExt on Pointer { +extension CXStringExt on clang_types.CXString { /// Convert CXString to a Dart string /// /// Make sure to dispose CXstring using dispose method, or use the /// [toStringAndDispose] method. String string() { - final cstring = clang.clang_getCString_wrap(this); + final cstring = clang.clang_getCString(this); if (cstring != nullptr) { return Utf8.fromUtf8(cstring.cast()); } else { @@ -277,12 +251,12 @@ extension CXStringExt on Pointer { String toStringAndDispose() { // Note: clang_getCString_wrap returns a const char *, calling free will result in error. final s = string(); - clang.clang_disposeString_wrap(this); + clang.clang_disposeString(this); return s; } void dispose() { - clang.clang_disposeString_wrap(this); + clang.clang_disposeString(this); } } diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 0abc9de21e..8f0ac937d6 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -4,12 +4,9 @@ import 'dart:io'; import 'package:ffigen/src/code_generator/type.dart'; -import 'package:ffigen/src/find_resource.dart'; import 'package:ffigen/src/header_parser/clang_bindings/clang_bindings.dart' as clang; -String? get dylibVersion => ffigenVersion; - /// Name of the dynamic library file according to current platform. String get dylibFileName { String name; @@ -22,10 +19,10 @@ String get dylibFileName { } else { throw Exception('Unsupported Platform.'); } - return '_${dylibVersion}_$name'; + return name; } -const ffigenFolderName = 'ffigen'; +const llvmLib = 'llvm-lib'; const output = 'output'; @@ -123,9 +120,22 @@ const description = 'description'; const preamble = 'preamble'; // Dynamic library names. -const libclang_dylib_linux = 'libwrapped_clang.so'; -const libclang_dylib_macos = 'libwrapped_clang.dylib'; -const libclang_dylib_windows = 'wrapped_clang.dll'; +const libclang_dylib_linux = 'libclang.so'; +const libclang_dylib_macos = 'libclang.dylib'; +const libclang_dylib_windows = 'libclang.dll'; + +// Dynamic library default locations. +const linuxDylibLocations = [ + '/usr/lib/llvm-9/lib/', + '/usr/lib/llvm-10/lib/', + '/usr/lib/llvm-11/lib/' +]; +const windowsDylibLocations = [ + r'C:\Program Files\LLVM\lib', +]; +const macOsDylibLocations = [ + '/usr/local/opt/llvm/lib/', +]; // Writen doubles. const doubleInfinity = 'double.infinity'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index d3c8da00bb..adf29939ce 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.0.0-dev.1 +version: 2.0.0-dev.3 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index 7be7ec1d21..2a059dd2a9 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -16,7 +16,7 @@ sort: true compiler-opts: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -I/usr/lib/llvm-11/include/ -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' headers: entry-points: - - 'lib/src/clang_library/wrapper.c' + - 'third_party/libclang/include/clang-c/Index.h' include-directives: - '**wrapper.c' - '**Index.h' @@ -63,41 +63,41 @@ functions: - clang_EvalResult_getAsDouble - clang_EvalResult_getAsStr - clang_EvalResult_dispose - - clang_getCString_wrap - - clang_disposeString_wrap - - clang_getCursorKind_wrap - - clang_getCursorKindSpelling_wrap - - clang_getCursorType_wrap - - clang_getTypeSpelling_wrap - - clang_getTypeKindSpelling_wrap - - clang_getResultType_wrap - - clang_getPointeeType_wrap - - clang_getCanonicalType_wrap - - clang_Type_getNamedType_wrap - - clang_getTypeDeclaration_wrap - - clang_getTypedefDeclUnderlyingType_wrap - - clang_getCursorSpelling_wrap - - clang_getTranslationUnitCursor_wrap - - clang_formatDiagnostic_wrap - - clang_visitChildren_wrap - - clang_Cursor_getNumArguments_wrap - - clang_Cursor_getArgument_wrap - - clang_getNumArgTypes_wrap - - clang_getArgType_wrap - - clang_getEnumConstantDeclValue_wrap - - clang_equalRanges_wrap - - clang_Cursor_getCommentRange_wrap - - clang_Cursor_getRawCommentText_wrap - - clang_Cursor_getBriefCommentText_wrap - - clang_getCursorLocation_wrap - - clang_getFileLocation_wrap - - clang_getFileName_wrap - - clang_getNumElements_wrap - - clang_getArrayElementType_wrap - - clang_Cursor_isMacroFunctionLike_wrap - - clang_Cursor_isMacroBuiltin_wrap - - clang_Cursor_Evaluate_wrap - - clang_Cursor_isAnonymous_wrap - - clang_Cursor_isAnonymousRecordDecl_wrap - - clang_getCursorUSR_wrap - - clang_getFieldDeclBitWidth_wrap + - clang_getCString + - clang_disposeString + - clang_getCursorKind + - clang_getCursorKindSpelling + - clang_getCursorType + - clang_getTypeSpelling + - clang_getTypeKindSpelling + - clang_getResultType + - clang_getPointeeType + - clang_getCanonicalType + - clang_Type_getNamedType + - clang_getTypeDeclaration + - clang_getTypedefDeclUnderlyingType + - clang_getCursorSpelling + - clang_getTranslationUnitCursor + - clang_formatDiagnostic + - clang_visitChildren + - clang_Cursor_getNumArguments + - clang_Cursor_getArgument + - clang_getNumArgTypes + - clang_getArgType + - clang_getEnumConstantDeclValue + - clang_equalRanges + - clang_Cursor_getCommentRange + - clang_Cursor_getRawCommentText + - clang_Cursor_getBriefCommentText + - clang_getCursorLocation + - clang_getFileLocation + - clang_getFileName + - clang_getNumElements + - clang_getArrayElementType + - clang_Cursor_isMacroFunctionLike + - clang_Cursor_isMacroBuiltin + - clang_Cursor_Evaluate + - clang_Cursor_isAnonymous + - clang_Cursor_isAnonymousRecordDecl + - clang_getCursorUSR + - clang_getFieldDeclBitWidth From bd781397026b6dfc870f755b3578d322004b5716 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 1 Mar 2021 08:55:31 -0800 Subject: [PATCH 061/276] [ffigen] Added support for Global variables (#139) (#165) --- pkgs/ffigen/CHANGELOG.md | 3 + pkgs/ffigen/README.md | 8 +- .../ffigen/lib/src/code_generator/global.dart | 32 +++- .../lib/src/config_provider/config.dart | 13 ++ .../lib/src/header_parser/includer.dart | 10 ++ .../header_parser/sub_parsers/var_parser.dart | 47 ++++++ .../translation_unit_parser.dart | 4 + pkgs/ffigen/lib/src/header_parser/utils.dart | 13 ++ pkgs/ffigen/lib/src/strings.dart | 1 + pkgs/ffigen/pubspec.yaml | 2 +- pkgs/ffigen/test/code_generator_test.dart | 21 ++- .../ffigen/test/header_parser_tests/globals.h | 15 ++ .../header_parser_tests/globals_test.dart | 75 +++++++++ .../_expected_sqlite_bindings.dart | 143 ++++++++++++++++++ 14 files changed, 374 insertions(+), 13 deletions(-) create mode 100644 pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/globals.h create mode 100644 pkgs/ffigen/test/header_parser_tests/globals_test.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index a7b8617a55..1e49bdc794 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.0.0-dev.4 +- Add support for parsing and generating globals. + # 2.0.0-dev.3 - Removed the usage of `--no-sound-null-safety` flag. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index df041e7842..f2c194e50d 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -144,7 +144,7 @@ compiler-opts: '-I/usr/lib/llvm-9/include/' - functions
structs
enums
unnamed-enums
macros + functions
structs
enums
unnamed-enums
macros
globals Filters for declarations.
Default: all are included @@ -170,6 +170,12 @@ enums: 'CXTypeKind': # Full names have higher priority. # $1 keeps only the 1st group i.e '(.*)'. 'CXType(.*)': '$1' +globals: + exclude: + - aGlobal + rename: + # Removes '_' from beginning of a name. + - '_(.*)': '$1' ``` diff --git a/pkgs/ffigen/lib/src/code_generator/global.dart b/pkgs/ffigen/lib/src/code_generator/global.dart index b52fa7023d..d419e92f6d 100644 --- a/pkgs/ffigen/lib/src/code_generator/global.dart +++ b/pkgs/ffigen/lib/src/code_generator/global.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:ffigen/src/code_generator/typedef.dart'; + import 'binding.dart'; import 'binding_string.dart'; import 'type.dart'; @@ -34,6 +36,21 @@ class Global extends LookUpBinding { dartDoc: dartDoc, ); + List? _typedefDependencies; + @override + List getTypedefDependencies(Writer w) { + if (_typedefDependencies == null) { + _typedefDependencies = []; + + // Add typedef's required by the variable's type. + final valueType = type.getBaseType(); + if (valueType.broadType == BroadType.NativeFunction) { + _typedefDependencies!.addAll(valueType.nativeFunc!.getDependencies()); + } + } + return _typedefDependencies!; + } + @override BindingString toBindingString(Writer w) { final s = StringBuffer(); @@ -41,13 +58,18 @@ class Global extends LookUpBinding { if (dartDoc != null) { s.write(makeDartDoc(dartDoc!)); } + final pointerName = w.wrapperLevelUniqueNamer.makeUnique('_$globalVarName'); + final dartType = type.getDartType(w); + final cType = type.getCType(w); + final refOrValue = type.broadType == BroadType.Struct ? 'ref' : 'value'; - final holderVarName = - w.wrapperLevelUniqueNamer.makeUnique('_$globalVarName'); s.write( - '${w.ffiLibraryPrefix}.Pointer<${type.getCType(w)}> $holderVarName;\n'); - s.write( - "${type.getDartType(w)} get $globalVarName => ($holderVarName ??= ${w.dylibIdentifier}.lookup<${type.getCType(w)}>('$originalName')).value;\n\n"); + "late final ${w.ffiLibraryPrefix}.Pointer<$dartType> $pointerName = ${w.dylibIdentifier}.lookup<$cType>('$originalName');\n\n"); + s.write('$dartType get $globalVarName => $pointerName.$refOrValue;\n\n'); + if (type.broadType != BroadType.Struct) { + s.write( + 'set $globalVarName($dartType value) => $pointerName.value = value;\n\n'); + } return BindingString(type: BindingStringType.global, string: s.toString()); } diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 96ca643dd3..6c11b344df 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -51,6 +51,10 @@ class Config { Declaration get unnamedEnumConstants => _unnamedEnumConstants; late Declaration _unnamedEnumConstants; + /// Declaration config for Globals. + Declaration get globals => _globals; + late Declaration _globals; + /// Declaration config for Macro constants. Declaration get macroDecl => _macroDecl; late Declaration _macroDecl; @@ -222,6 +226,15 @@ class Config { extractedResult: (dynamic result) => _unnamedEnumConstants = result as Declaration, ), + strings.globals: Specification( + requirement: Requirement.no, + validator: declarationConfigValidator, + extractor: declarationConfigExtractor, + defaultValue: () => Declaration(), + extractedResult: (dynamic result) { + _globals = result as Declaration; + }, + ), strings.macros: Specification( requirement: Requirement.no, validator: declarationConfigValidator, diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart index baa5b5991c..bd824761b3 100644 --- a/pkgs/ffigen/lib/src/header_parser/includer.dart +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -47,6 +47,16 @@ bool shouldIncludeUnnamedEnumConstant(String usr, String name) { } } +bool shouldIncludeGlobalVar(String usr, String name) { + if (bindingsIndex.isSeenGlobalVar(usr) || name == '') { + return false; + } else if (config.globals.shouldInclude(name)) { + return true; + } else { + return false; + } +} + bool shouldIncludeMacro(String usr, String name) { if (bindingsIndex.isSeenMacro(usr) || name == '') { return false; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart new file mode 100644 index 0000000000..d0248ec29d --- /dev/null +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart @@ -0,0 +1,47 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser/data.dart'; +import 'package:ffigen/src/header_parser/includer.dart'; +import 'package:logging/logging.dart'; + +import '../clang_bindings/clang_bindings.dart' as clang_types; +import '../data.dart'; +import '../utils.dart'; + +final _logger = Logger('ffigen.header_parser.var_parser'); + +/// Parses a global variable +Global? parseVarDeclaration(clang_types.CXCursor cursor) { + final name = cursor.spelling(); + final usr = cursor.usr(); + if (bindingsIndex.isSeenGlobalVar(usr)) { + return bindingsIndex.getSeenGlobalVar(usr); + } + if (!shouldIncludeGlobalVar(usr, name)) { + return null; + } + + _logger.fine('++++ Adding Global: ${cursor.completeStringRepr()}'); + + final type = cursor.type().toCodeGenType(); + if (type.getBaseType().broadType == BroadType.Unimplemented || + type.getBaseType().isIncompleteStruct) { + _logger.fine( + '---- Removed Global, reason: unsupported type: ${cursor.completeStringRepr()}'); + _logger.warning("Skipped global variable '$name', type not supported."); + return null; + } + + final global = Global( + originalName: name, + name: config.globals.renameUsingConfig(name), + usr: usr, + type: type, + dartDoc: getCursorDocComment(cursor), + ); + bindingsIndex.addGlobalVarToSeen(usr, global); + return global; +} diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart index 7c08410c32..69f7f13e1e 100644 --- a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -6,6 +6,7 @@ import 'dart:ffi'; import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/header_parser/sub_parsers/macro_parser.dart'; +import 'package:ffigen/src/header_parser/sub_parsers/var_parser.dart'; import 'package:logging/logging.dart'; import 'clang_bindings/clang_bindings.dart' as clang_types; @@ -58,6 +59,9 @@ int _rootCursorVisitor(clang_types.CXCursor cursor, clang_types.CXCursor parent, case clang_types.CXCursorKind.CXCursor_MacroDefinition: saveMacroDefinition(cursor); break; + case clang_types.CXCursorKind.CXCursor_VarDecl: + addToBindings(parseVarDeclaration(cursor)); + break; default: _logger.finer('rootCursorVisitor: CursorKind not implemented'); } diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index f0a412781d..28ca657544 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -316,6 +316,7 @@ class BindingsIndex { final Map _enumClass = {}; final Map _unnamedEnumConstants = {}; final Map _macros = {}; + final Map _globals = {}; // Stores only named typedefC used in NativeFunc. final Map _functionTypedefs = {}; @@ -367,6 +368,18 @@ class BindingsIndex { return _unnamedEnumConstants[usr]; } + bool isSeenGlobalVar(String usr) { + return _globals.containsKey(usr); + } + + void addGlobalVarToSeen(String usr, Global global) { + _globals[usr] = global; + } + + Global? getSeenGlobalVar(String usr) { + return _globals[usr]; + } + bool isSeenMacro(String usr) { return _macros.containsKey(usr); } diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 8f0ac937d6..99e0c680dc 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -39,6 +39,7 @@ const functions = 'functions'; const structs = 'structs'; const enums = 'enums'; const unnamedEnums = 'unnamed-enums'; +const globals = 'globals'; const macros = 'macros'; // Sub-fields of Declarations. diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index adf29939ce..87663a2558 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.0.0-dev.3 +version: 2.0.0-dev.4 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/code_generator_test.dart b/pkgs/ffigen/test/code_generator_test.dart index ea6393bacf..aae8b0f2ea 100644 --- a/pkgs/ffigen/test/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_test.dart @@ -436,14 +436,23 @@ final ffi.DynamicLibrary _dylib; /// The symbols are looked up in [dynamicLibrary]. Bindings(ffi.DynamicLibrary dynamicLibrary): _dylib = dynamicLibrary; -ffi.Pointer _test1; -int get test1 => (_test1 ??= _dylib.lookup('test1')).value; +late final ffi.Pointer _test1 = _dylib.lookup('test1'); -ffi.Pointer> _test2; -ffi.Pointer get test2 => (_test2 ??= _dylib.lookup>('test2')).value; +int get test1 => _test1.value; -ffi.Pointer> _test5; -ffi.Pointer get test5 => (_test5 ??= _dylib.lookup>('test5')).value; +set test1(int value) => _test1.value = value; + +late final ffi.Pointer> _test2 = _dylib.lookup>('test2'); + +ffi.Pointer get test2 => _test2.value; + +set test2(ffi.Pointer value) => _test2.value = value; + +late final ffi.Pointer> _test5 = _dylib.lookup>('test5'); + +ffi.Pointer get test5 => _test5.value; + +set test5(ffi.Pointer value) => _test5.value = value; } diff --git a/pkgs/ffigen/test/header_parser_tests/globals.h b/pkgs/ffigen/test/header_parser_tests/globals.h new file mode 100644 index 0000000000..f0f464fa6b --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/globals.h @@ -0,0 +1,15 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#include +#include + +bool coolGlobal; +int32_t myInt; +int32_t *aGlobalPointer; +long double longDouble; +long double *pointerToLongDouble; + +// This should be ignored +int GlobalIgnore; diff --git a/pkgs/ffigen/test/header_parser_tests/globals_test.dart b/pkgs/ffigen/test/header_parser_tests/globals_test.dart new file mode 100644 index 0000000000..7184792c3d --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/globals_test.dart @@ -0,0 +1,75 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/config_provider.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; +import 'package:ffigen/src/strings.dart' as strings; + +import '../test_utils.dart'; + +late Library actual, expected; + +void main() { + group('globals_test', () { + setUpAll(() { + logWarnings(); + expected = expectedLibrary(); + actual = parser.parse( + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Globals Test' +${strings.output}: 'unused' +${strings.headers}: + ${strings.entryPoints}: + - 'test/header_parser_tests/globals.h' + ${strings.includeDirectives}: + - '**globals.h' +${strings.globals}: + ${strings.exclude}: + - GlobalIgnore +# Needed for stdbool.h in MacOS +${strings.compilerOpts}: '-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Headers/ -Wno-nullability-completeness' + ''') as yaml.YamlMap), + ); + }); + + test('Total bindings count', () { + expect(actual.bindings.length, expected.bindings.length); + }); + + test('Parse global Values', () { + expect(actual.getBindingAsString('coolGlobal'), + expected.getBindingAsString('coolGlobal')); + expect(actual.getBindingAsString('myInt'), + expected.getBindingAsString('myInt')); + expect(actual.getBindingAsString('aGlobalPointer'), + expected.getBindingAsString('aGlobalPointer')); + }); + + test('Ignore global values', () { + expect(() => actual.getBindingAsString('GlobalIgnore'), + throwsA(TypeMatcher())); + expect(() => actual.getBindingAsString('longDouble'), + throwsA(TypeMatcher())); + expect(() => actual.getBindingAsString('pointerToLongDouble'), + throwsA(TypeMatcher())); + }); + }); +} + +Library expectedLibrary() { + return Library( + name: 'Bindings', + bindings: [ + Global(type: Type.boolean(), name: 'coolGlobal'), + Global(type: Type.nativeType(SupportedNativeType.Int32), name: 'myInt'), + Global( + type: Type.pointer(Type.nativeType(SupportedNativeType.Int32)), + name: 'aGlobalPointer'), + ], + ); +} diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index 7ea5be8f89..6abdd48804 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -11,6 +11,44 @@ class SQLite { /// The symbols are looked up in [dynamicLibrary]. SQLite(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + /// CAPI3REF: Run-Time Library Version Numbers + /// KEYWORDS: sqlite3_version sqlite3_sourceid + /// + /// These interfaces provide the same information as the [SQLITE_VERSION], + /// [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros + /// but are associated with the library instead of the header file. ^(Cautious + /// programmers might include assert() statements in their application to + /// verify that values returned by these interfaces match the macros in + /// the header, and thus ensure that the application is + /// compiled with matching library and header files. + /// + ///
+  /// assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
+  /// assert( strncmp(sqlite3_sourceid(),SQLITE_SOURCE_ID,80)==0 );
+  /// assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );
+  /// 
)^ + /// + /// ^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION] + /// macro. ^The sqlite3_libversion() function returns a pointer to the + /// to the sqlite3_version[] string constant. The sqlite3_libversion() + /// function is provided for use in DLLs since DLL users usually do not have + /// direct access to string constants within the DLL. ^The + /// sqlite3_libversion_number() function returns an integer equal to + /// [SQLITE_VERSION_NUMBER]. ^(The sqlite3_sourceid() function returns + /// a pointer to a string constant whose value is the same as the + /// [SQLITE_SOURCE_ID] C preprocessor macro. Except if SQLite is built + /// using an edited copy of [the amalgamation], then the last four characters + /// of the hash might be different from [SQLITE_SOURCE_ID].)^ + /// + /// See also: [sqlite_version()] and [sqlite_source_id()]. + late final ffi.Pointer> _sqlite3_version = + _dylib.lookup>('sqlite3_version'); + + ffi.Pointer get sqlite3_version => _sqlite3_version.value; + + set sqlite3_version(ffi.Pointer value) => + _sqlite3_version.value = value; + ffi.Pointer sqlite3_libversion() { return (_sqlite3_libversion ??= _dylib.lookupFunction<_c_sqlite3_libversion, _dart_sqlite3_libversion>( @@ -5458,6 +5496,111 @@ class SQLite { _dart_sqlite3_sleep? _sqlite3_sleep; + /// CAPI3REF: Name Of The Folder Holding Temporary Files + /// + /// ^(If this global variable is made to point to a string which is + /// the name of a folder (a.k.a. directory), then all temporary files + /// created by SQLite when using a built-in [sqlite3_vfs | VFS] + /// will be placed in that directory.)^ ^If this variable + /// is a NULL pointer, then SQLite performs a search for an appropriate + /// temporary file directory. + /// + /// Applications are strongly discouraged from using this global variable. + /// It is required to set a temporary folder on Windows Runtime (WinRT). + /// But for all other platforms, it is highly recommended that applications + /// neither read nor write this variable. This global variable is a relic + /// that exists for backwards compatibility of legacy applications and should + /// be avoided in new projects. + /// + /// It is not safe to read or modify this variable in more than one + /// thread at a time. It is not safe to read or modify this variable + /// if a [database connection] is being used at the same time in a separate + /// thread. + /// It is intended that this variable be set once + /// as part of process initialization and before any SQLite interface + /// routines have been called and that this variable remain unchanged + /// thereafter. + /// + /// ^The [temp_store_directory pragma] may modify this variable and cause + /// it to point to memory obtained from [sqlite3_malloc]. ^Furthermore, + /// the [temp_store_directory pragma] always assumes that any string + /// that this variable points to is held in memory obtained from + /// [sqlite3_malloc] and the pragma may attempt to free that memory + /// using [sqlite3_free]. + /// Hence, if this variable is modified directly, either it should be + /// made NULL or made to point to memory obtained from [sqlite3_malloc] + /// or else the use of the [temp_store_directory pragma] should be avoided. + /// Except when requested by the [temp_store_directory pragma], SQLite + /// does not free the memory that sqlite3_temp_directory points to. If + /// the application wants that memory to be freed, it must do + /// so itself, taking care to only do so after all [database connection] + /// objects have been destroyed. + /// + /// Note to Windows Runtime users: The temporary directory must be set + /// prior to calling [sqlite3_open] or [sqlite3_open_v2]. Otherwise, various + /// features that require the use of temporary files may fail. Here is an + /// example of how to do this using C++ with the Windows Runtime: + /// + ///
+  /// LPCWSTR zPath = Windows::Storage::ApplicationData::Current->
+  ///       TemporaryFolder->Path->Data();
+  /// char zPathBuf[MAX_PATH + 1];
+  /// memset(zPathBuf, 0, sizeof(zPathBuf));
+  /// WideCharToMultiByte(CP_UTF8, 0, zPath, -1, zPathBuf, sizeof(zPathBuf),
+  ///       NULL, NULL);
+  /// sqlite3_temp_directory = sqlite3_mprintf("%s", zPathBuf);
+  /// 
+ late final ffi.Pointer> _sqlite3_temp_directory = + _dylib.lookup>('sqlite3_temp_directory'); + + ffi.Pointer get sqlite3_temp_directory => + _sqlite3_temp_directory.value; + + set sqlite3_temp_directory(ffi.Pointer value) => + _sqlite3_temp_directory.value = value; + + /// CAPI3REF: Name Of The Folder Holding Database Files + /// + /// ^(If this global variable is made to point to a string which is + /// the name of a folder (a.k.a. directory), then all database files + /// specified with a relative pathname and created or accessed by + /// SQLite when using a built-in windows [sqlite3_vfs | VFS] will be assumed + /// to be relative to that directory.)^ ^If this variable is a NULL + /// pointer, then SQLite assumes that all database files specified + /// with a relative pathname are relative to the current directory + /// for the process. Only the windows VFS makes use of this global + /// variable; it is ignored by the unix VFS. + /// + /// Changing the value of this variable while a database connection is + /// open can result in a corrupt database. + /// + /// It is not safe to read or modify this variable in more than one + /// thread at a time. It is not safe to read or modify this variable + /// if a [database connection] is being used at the same time in a separate + /// thread. + /// It is intended that this variable be set once + /// as part of process initialization and before any SQLite interface + /// routines have been called and that this variable remain unchanged + /// thereafter. + /// + /// ^The [data_store_directory pragma] may modify this variable and cause + /// it to point to memory obtained from [sqlite3_malloc]. ^Furthermore, + /// the [data_store_directory pragma] always assumes that any string + /// that this variable points to is held in memory obtained from + /// [sqlite3_malloc] and the pragma may attempt to free that memory + /// using [sqlite3_free]. + /// Hence, if this variable is modified directly, either it should be + /// made NULL or made to point to memory obtained from [sqlite3_malloc] + /// or else the use of the [data_store_directory pragma] should be avoided. + late final ffi.Pointer> _sqlite3_data_directory = + _dylib.lookup>('sqlite3_data_directory'); + + ffi.Pointer get sqlite3_data_directory => + _sqlite3_data_directory.value; + + set sqlite3_data_directory(ffi.Pointer value) => + _sqlite3_data_directory.value = value; + /// CAPI3REF: Win32 Specific Interface /// /// These interfaces are available only on Windows. The From f75b3e8202a522210ef6215cb6eefc329fd01f3c Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 1 Mar 2021 09:42:38 -0800 Subject: [PATCH 062/276] [ffigen] Use Opaque to represent empty Structs (#142, #143) (#166) --- .../ffigen/.github/workflows/test-package.yml | 4 +- pkgs/ffigen/CHANGELOG.md | 3 + pkgs/ffigen/example/c_json/pubspec.yaml | 2 +- .../libclang-example/generated_bindings.dart | 6 +- .../example/libclang-example/pubspec.yaml | 2 +- pkgs/ffigen/example/simple/pubspec.yaml | 2 +- .../ffigen/lib/src/code_generator/global.dart | 14 +- .../lib/src/code_generator/library.dart | 1 + pkgs/ffigen/lib/src/code_generator/struc.dart | 4 +- .../clang_bindings/clang_bindings.dart | 2 +- pkgs/ffigen/lib/src/header_parser/data.dart | 1 - pkgs/ffigen/pubspec.yaml | 4 +- pkgs/ffigen/test/code_generator_test.dart | 921 ------------------ .../code_generator_test.dart | 382 ++++++++ .../_expected_boolean_dartbool_bindings.dart | 40 + ...expected_boolean_no_dartbool_bindings.dart | 39 + .../_expected_constant_bindings.dart | 10 + .../_expected_enumclass_bindings.dart | 15 + .../_expected_function_bindings.dart | 73 ++ .../_expected_function_n_struct_bindings.dart | 42 + .../_expected_global_bindings.dart | 41 + ...internal_conflict_resolution_bindings.dart | 126 +++ .../_expected_struct_bindings.dart | 28 + .../ffigen/test/header_parser_tests/globals.h | 6 + .../header_parser_tests/globals_test.dart | 3 + .../_expected_libclang_bindings.dart | 10 +- .../_expected_sqlite_bindings.dart | 58 +- pkgs/ffigen/test/test_coverage.dart | 5 +- pkgs/ffigen/test/test_utils.dart | 2 - 29 files changed, 871 insertions(+), 975 deletions(-) delete mode 100644 pkgs/ffigen/test/code_generator_test.dart create mode 100644 pkgs/ffigen/test/code_generator_tests/code_generator_test.dart create mode 100644 pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart create mode 100644 pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart create mode 100644 pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart create mode 100644 pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart create mode 100644 pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart create mode 100644 pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart create mode 100644 pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart create mode 100644 pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart create mode 100644 pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index a5cd11afa4..7de66eba1d 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -20,7 +20,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: [2.12.0-198.0.dev] # TODO(127): Revert to stable. + sdk: [2.12.0-237.0.dev] # TODO(127): Revert to stable. steps: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1.0 @@ -44,7 +44,7 @@ jobs: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1.0 with: - sdk: 2.12.0-198.0.dev # TODO(127): Revert to stable. + sdk: 2.12.0-237.0.dev # TODO(127): Revert to stable. - name: Install dependencies run: dart pub get - name: Install libclang-10-dev diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 1e49bdc794..e877eb77f4 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.0.0-dev.5 +- Use `Opaque` for representing empty `Struct`s. + # 2.0.0-dev.4 - Add support for parsing and generating globals. diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index 931aaeab0c..76e4198197 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -5,7 +5,7 @@ name: c_json_example environment: - sdk: '>=2.12.0-198.0.dev <3.0.0' + sdk: '>=2.12.0-237.0.dev <3.0.0' dependencies: ffi: ^0.2.0-nullsafety.1 diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index 0edbcb9158..330c63f1b7 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -6250,9 +6250,9 @@ class CXStringSet extends ffi.Struct { external int Count; } -class CXTargetInfoImpl extends ffi.Struct {} +class CXTargetInfoImpl extends ffi.Opaque {} -class CXTranslationUnitImpl extends ffi.Struct {} +class CXTranslationUnitImpl extends ffi.Opaque {} /// Provides the contents of a file that has not yet been saved to disk. /// @@ -6636,7 +6636,7 @@ class CXPlatformAvailability extends ffi.Struct { external CXString Message; } -class CXCursorSetImpl extends ffi.Struct {} +class CXCursorSetImpl extends ffi.Opaque {} /// Describes the kind of type abstract class CXTypeKind { diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index df66b0b751..efce0849b8 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -5,7 +5,7 @@ name: libclang_example environment: - sdk: '>=2.12.0-198.0.dev <3.0.0' + sdk: '>=2.12.0-237.0.dev <3.0.0' dev_dependencies: ffigen: diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index ce3aa5e233..d3562ef5b6 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -5,7 +5,7 @@ name: simple_example environment: - sdk: '>=2.12.0-198.0.dev <3.0.0' + sdk: '>=2.12.0-237.0.dev <3.0.0' dev_dependencies: ffigen: diff --git a/pkgs/ffigen/lib/src/code_generator/global.dart b/pkgs/ffigen/lib/src/code_generator/global.dart index d419e92f6d..42db339c94 100644 --- a/pkgs/ffigen/lib/src/code_generator/global.dart +++ b/pkgs/ffigen/lib/src/code_generator/global.dart @@ -61,12 +61,18 @@ class Global extends LookUpBinding { final pointerName = w.wrapperLevelUniqueNamer.makeUnique('_$globalVarName'); final dartType = type.getDartType(w); final cType = type.getCType(w); - final refOrValue = type.broadType == BroadType.Struct ? 'ref' : 'value'; s.write( - "late final ${w.ffiLibraryPrefix}.Pointer<$dartType> $pointerName = ${w.dylibIdentifier}.lookup<$cType>('$originalName');\n\n"); - s.write('$dartType get $globalVarName => $pointerName.$refOrValue;\n\n'); - if (type.broadType != BroadType.Struct) { + "late final ${w.ffiLibraryPrefix}.Pointer<$cType> $pointerName = ${w.dylibIdentifier}.lookup<$cType>('$originalName');\n\n"); + if (type.broadType == BroadType.Struct) { + if (type.struc!.isOpaque) { + s.write( + '${w.ffiLibraryPrefix}.Pointer<$cType> get $globalVarName => $pointerName;\n\n'); + } else { + s.write('$dartType get $globalVarName => $pointerName.ref;\n\n'); + } + } else { + s.write('$dartType get $globalVarName => $pointerName.value;\n\n'); s.write( 'set $globalVarName($dartType value) => $pointerName.value = value;\n\n'); } diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index 4ea8e654b6..139ef4fa5a 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -110,6 +110,7 @@ class Library { runInShell: Platform.isWindows); if (result.stderr.toString().isNotEmpty) { _logger.severe(result.stderr); + throw FormatException('Unable to format generated file: $path.'); } } diff --git a/pkgs/ffigen/lib/src/code_generator/struc.dart b/pkgs/ffigen/lib/src/code_generator/struc.dart index 8958139504..2a0aca5df4 100644 --- a/pkgs/ffigen/lib/src/code_generator/struc.dart +++ b/pkgs/ffigen/lib/src/code_generator/struc.dart @@ -42,6 +42,8 @@ class Struc extends NoLookUpBinding { List members; + bool get isOpaque => members.isEmpty; + Struc({ String? usr, String? originalName, @@ -102,7 +104,7 @@ class Struc extends NoLookUpBinding { // Write class declaration. s.write( - 'class $enclosingClassName extends ${w.ffiLibraryPrefix}.Struct{\n'); + 'class $enclosingClassName extends ${w.ffiLibraryPrefix}.${isOpaque ? 'Opaque' : 'Struct'}{\n'); for (final m in members) { final memberName = localUniqueNamer.makeUnique(m.name); if (m.type.broadType == BroadType.ConstantArray) { diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 7e7ab7c8d3..a68621eb30 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -920,7 +920,7 @@ class CXString extends ffi.Struct { external int private_flags; } -class CXTranslationUnitImpl extends ffi.Struct {} +class CXTranslationUnitImpl extends ffi.Opaque {} /// Provides the contents of a file that has not yet been saved to disk. /// diff --git a/pkgs/ffigen/lib/src/header_parser/data.dart b/pkgs/ffigen/lib/src/header_parser/data.dart index c2b371e4ab..ac16572a91 100644 --- a/pkgs/ffigen/lib/src/header_parser/data.dart +++ b/pkgs/ffigen/lib/src/header_parser/data.dart @@ -3,7 +3,6 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:ffi'; -import 'dart:isolate'; import 'package:ffigen/src/code_generator.dart' show Constant; import 'package:ffigen/src/config_provider.dart' show Config; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 87663a2558..cb1358470b 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,12 +3,12 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.0.0-dev.4 +version: 2.0.0-dev.5 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C header files. environment: - sdk: '>=2.12.0-198.0.dev <3.0.0' + sdk: '>=2.12.0-237.0.dev <3.0.0' dependencies: ffi: ^0.2.0-nullsafety.1 diff --git a/pkgs/ffigen/test/code_generator_test.dart b/pkgs/ffigen/test/code_generator_test.dart deleted file mode 100644 index aae8b0f2ea..0000000000 --- a/pkgs/ffigen/test/code_generator_test.dart +++ /dev/null @@ -1,921 +0,0 @@ -// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'dart:io'; - -import 'package:ffigen/src/code_generator.dart'; -import 'package:test/test.dart'; - -void main() { - group('code_generator: ', () { - test('Function Binding (primitives, pointers)', () { - final library = Library( - name: 'Bindings', - bindings: [ - Func( - name: 'noParam', - dartDoc: 'Just a test function\nheres another line', - returnType: Type.nativeType( - SupportedNativeType.Int32, - ), - ), - Func( - name: 'withPrimitiveParam', - parameters: [ - Parameter( - name: 'a', - type: Type.nativeType( - SupportedNativeType.Int32, - ), - ), - Parameter( - name: 'b', - type: Type.nativeType( - SupportedNativeType.Uint8, - ), - ), - ], - returnType: Type.nativeType( - SupportedNativeType.Char, - ), - ), - Func( - name: 'withPointerParam', - parameters: [ - Parameter( - name: 'a', - type: Type.pointer( - Type.nativeType( - SupportedNativeType.Int32, - ), - ), - ), - Parameter( - name: 'b', - type: Type.pointer( - Type.pointer( - Type.nativeType( - SupportedNativeType.Uint8, - ), - ), - ), - ), - ], - returnType: Type.pointer( - Type.nativeType( - SupportedNativeType.Double, - ), - ), - ), - ], - ); - - final gen = library.generate(); - - // Writing to file for debug purpose. - final file = File( - 'test/debug_generated/Function-Binding-test-output.dart', - ); - try { - expect(gen, '''// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; - -class Bindings{ -/// Holds the Dynamic library. -final ffi.DynamicLibrary _dylib; - -/// The symbols are looked up in [dynamicLibrary]. -Bindings(ffi.DynamicLibrary dynamicLibrary): _dylib = dynamicLibrary; - -/// Just a test function -/// heres another line -int noParam( -) { -return (_noParam ??= _dylib.lookupFunction<_c_noParam,_dart_noParam>('noParam'))( - ); -} -_dart_noParam? _noParam; - -int withPrimitiveParam( - int a, - int b, -) { -return (_withPrimitiveParam ??= _dylib.lookupFunction<_c_withPrimitiveParam,_dart_withPrimitiveParam>('withPrimitiveParam'))( - a, - b, - ); -} -_dart_withPrimitiveParam? _withPrimitiveParam; - -ffi.Pointer withPointerParam( - ffi.Pointer a, - ffi.Pointer> b, -) { -return (_withPointerParam ??= _dylib.lookupFunction<_c_withPointerParam,_dart_withPointerParam>('withPointerParam'))( - a, - b, - ); -} -_dart_withPointerParam? _withPointerParam; - -} - -typedef _c_noParam = ffi.Int32 Function( -); - -typedef _dart_noParam = int Function( -); - -typedef _c_withPrimitiveParam = ffi.Uint8 Function( - ffi.Int32 a, - ffi.Uint8 b, -); - -typedef _dart_withPrimitiveParam = int Function( - int a, - int b, -); - -typedef _c_withPointerParam = ffi.Pointer Function( - ffi.Pointer a, - ffi.Pointer> b, -); - -typedef _dart_withPointerParam = ffi.Pointer Function( - ffi.Pointer a, - ffi.Pointer> b, -); - -'''); - if (file.existsSync()) { - file.delete(); - } - } catch (e) { - file.writeAsStringSync(gen); - print('Failed test, Debug output: ${file.absolute.path}'); - rethrow; - } - }); - - test('Struct Binding (primitives, pointers)', () { - final library = Library( - name: 'Bindings', - bindings: [ - Struc( - name: 'NoMember', - dartDoc: 'Just a test struct\nheres another line', - ), - Struc( - name: 'WithPrimitiveMember', - members: [ - Member( - name: 'a', - type: Type.nativeType( - SupportedNativeType.Int32, - ), - ), - Member( - name: 'b', - type: Type.nativeType( - SupportedNativeType.Double, - ), - ), - Member( - name: 'c', - type: Type.nativeType( - SupportedNativeType.Char, - ), - ), - ], - ), - Struc( - name: 'WithPointerMember', - members: [ - Member( - name: 'a', - type: Type.pointer( - Type.nativeType( - SupportedNativeType.Int32, - ), - ), - ), - Member( - name: 'b', - type: Type.pointer( - Type.pointer( - Type.nativeType( - SupportedNativeType.Double, - ), - ), - ), - ), - Member( - name: 'c', - type: Type.nativeType( - SupportedNativeType.Char, - ), - ), - ], - ), - ], - ); - - final gen = library.generate(); - - // Writing to file for debug purpose. - final file = File('test/debug_generated/Struct-Binding-test-output.dart'); - - try { - expect(gen, '''// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; - -/// Just a test struct -/// heres another line -class NoMember extends ffi.Struct{ -} - -class WithPrimitiveMember extends ffi.Struct{ - @ffi.Int32() - external int a; - - @ffi.Double() - external double b; - - @ffi.Uint8() - external int c; - -} - -class WithPointerMember extends ffi.Struct{ - external ffi.Pointer a; - - external ffi.Pointer> b; - - @ffi.Uint8() - external int c; - -} - -'''); - if (file.existsSync()) { - file.delete(); - } - } catch (e) { - file.writeAsStringSync(gen); - print('Failed test, Debug output: ${file.absolute.path}'); - rethrow; - } - }); - - test('Function and Struct Binding (pointer to Struct)', () { - final struct_some = Struc( - name: 'SomeStruc', - members: [ - Member( - name: 'a', - type: Type.nativeType( - SupportedNativeType.Int32, - ), - ), - Member( - name: 'b', - type: Type.nativeType( - SupportedNativeType.Double, - ), - ), - Member( - name: 'c', - type: Type.nativeType( - SupportedNativeType.Char, - ), - ), - ], - ); - final library = Library( - name: 'Bindings', - bindings: [ - struct_some, - Func( - name: 'someFunc', - parameters: [ - Parameter( - name: 'some', - type: Type.pointer( - Type.pointer( - Type.struct( - struct_some, - ), - ), - ), - ), - ], - returnType: Type.pointer( - Type.struct( - struct_some, - ), - ), - ), - ], - ); - - final gen = library.generate(); - - // Writing to file for debug purpose. - final file = - File('test/debug_generated/Func-n-Struct-Binding-test-output.dart'); - try { - //expect - expect(gen, '''// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; - -class Bindings{ -/// Holds the Dynamic library. -final ffi.DynamicLibrary _dylib; - -/// The symbols are looked up in [dynamicLibrary]. -Bindings(ffi.DynamicLibrary dynamicLibrary): _dylib = dynamicLibrary; - -ffi.Pointer someFunc( - ffi.Pointer> some, -) { -return (_someFunc ??= _dylib.lookupFunction<_c_someFunc,_dart_someFunc>('someFunc'))( - some, - ); -} -_dart_someFunc? _someFunc; - -} - -class SomeStruc extends ffi.Struct{ - @ffi.Int32() - external int a; - - @ffi.Double() - external double b; - - @ffi.Uint8() - external int c; - -} - -typedef _c_someFunc = ffi.Pointer Function( - ffi.Pointer> some, -); - -typedef _dart_someFunc = ffi.Pointer Function( - ffi.Pointer> some, -); - -'''); - if (file.existsSync()) { - file.delete(); - } - } catch (e) { - file.writeAsStringSync(gen); - print('Failed test, Debug output: ${file.absolute.path}'); - rethrow; - } - }); - - test('global (primitives, pointers, pointer to struct)', () { - final struc_some = Struc( - name: 'Some', - ); - final library = Library( - name: 'Bindings', - bindings: [ - Global( - name: 'test1', - type: Type.nativeType( - SupportedNativeType.Int32, - ), - ), - Global( - name: 'test2', - type: Type.pointer( - Type.nativeType( - SupportedNativeType.Float, - ), - ), - ), - struc_some, - Global( - name: 'test5', - type: Type.pointer( - Type.struct( - struc_some, - ), - ), - ), - ], - ); - - final gen = library.generate(); - - // Writing to file for debug purpose. - final file = File( - 'test/debug_generated/Global-Binding-test-output.dart', - ); - try { - expect(gen, '''// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; - -class Bindings{ -/// Holds the Dynamic library. -final ffi.DynamicLibrary _dylib; - -/// The symbols are looked up in [dynamicLibrary]. -Bindings(ffi.DynamicLibrary dynamicLibrary): _dylib = dynamicLibrary; - -late final ffi.Pointer _test1 = _dylib.lookup('test1'); - -int get test1 => _test1.value; - -set test1(int value) => _test1.value = value; - -late final ffi.Pointer> _test2 = _dylib.lookup>('test2'); - -ffi.Pointer get test2 => _test2.value; - -set test2(ffi.Pointer value) => _test2.value = value; - -late final ffi.Pointer> _test5 = _dylib.lookup>('test5'); - -ffi.Pointer get test5 => _test5.value; - -set test5(ffi.Pointer value) => _test5.value = value; - -} - -class Some extends ffi.Struct{ -} - -'''); - if (file.existsSync()) { - file.delete(); - } - } catch (e) { - file.writeAsStringSync(gen); - print('Failed test, Debug output: ${file.absolute.path}'); - rethrow; - } - }); - - test('constant', () { - final library = Library( - name: 'Bindings', - bindings: [ - Constant( - name: 'test1', - rawType: 'int', - rawValue: '20', - ), - Constant( - name: 'test2', - rawType: 'double', - rawValue: '20.0', - ), - ], - ); - - final gen = library.generate(); - - // Writing to file for debug purpose. - final file = File( - 'test/debug_generated/Constant-test-output.dart', - ); - try { - expect(gen, '''// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; - -const int test1 = 20; - -const double test2 = 20.0; - -'''); - if (file.existsSync()) { - file.delete(); - } - } catch (e) { - file.writeAsStringSync(gen); - print('Failed test, Debug output: ${file.absolute.path}'); - rethrow; - } - }); - - test('enum_class', () { - final library = Library( - name: 'Bindings', - bindings: [ - EnumClass( - name: 'Constants', - dartDoc: 'test line 1\ntest line 2', - enumConstants: [ - EnumConstant( - name: 'a', - value: 10, - ), - EnumConstant(name: 'b', value: -1, dartDoc: 'negative'), - ], - ), - ], - ); - - final gen = library.generate(); - - // Writing to file for debug purpose. - final file = File( - 'test/debug_generated/enum-class-test-output.dart', - ); - try { - expect(gen, '''// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; - -/// test line 1 -/// test line 2 -abstract class Constants { - static const int a = 10; - /// negative - static const int b = -1; -} - -'''); - if (file.existsSync()) { - file.delete(); - } - } catch (e) { - file.writeAsStringSync(gen); - print('Failed test, Debug output: ${file.absolute.path}'); - rethrow; - } - }); - test('Internal conflict resolution', () { - final library = Library( - name: 'init_dylib', - bindings: [ - Func( - name: 'test', - returnType: Type.nativeType(SupportedNativeType.Void), - ), - Func( - name: '_test', - returnType: Type.nativeType(SupportedNativeType.Void), - ), - Func( - name: '_c_test', - returnType: Type.nativeType(SupportedNativeType.Void), - ), - Func( - name: '_dart_test', - returnType: Type.nativeType(SupportedNativeType.Void), - ), - Struc( - name: '_Test', - members: [ - Member( - name: 'array', - type: Type.constantArray( - 2, - Type.nativeType( - SupportedNativeType.Int8, - ), - ), - ), - ], - ), - Struc(name: 'ArrayHelperPrefixCollisionTest'), - Func( - name: 'Test', - returnType: Type.nativeType(SupportedNativeType.Void), - ), - EnumClass(name: '_c_Test'), - EnumClass(name: 'init_dylib'), - ], - ); - - final gen = library.generate(); - - // Writing to file for debug purpose. - final file = File( - 'test/debug_generated/internal-conflict-resolution.dart', - ); - try { - expect(gen, r'''// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; - -class init_dylib_1{ -/// Holds the Dynamic library. -final ffi.DynamicLibrary _dylib; - -/// The symbols are looked up in [dynamicLibrary]. -init_dylib_1(ffi.DynamicLibrary dynamicLibrary): _dylib = dynamicLibrary; - -void test( -) { -return (_test_1 ??= _dylib.lookupFunction<_c_test1,_dart_test1>('test'))( - ); -} -_dart_test1? _test_1; - -void _test( -) { -return (__test ??= _dylib.lookupFunction<_c__test,_dart__test>('_test'))( - ); -} -_dart__test? __test; - -void _c_test( -) { -return (__c_test ??= _dylib.lookupFunction<_c__c_test,_dart__c_test>('_c_test'))( - ); -} -_dart__c_test? __c_test; - -void _dart_test( -) { -return (__dart_test ??= _dylib.lookupFunction<_c__dart_test,_dart__dart_test>('_dart_test'))( - ); -} -_dart__dart_test? __dart_test; - -void Test( -) { -return (_Test ??= _dylib.lookupFunction<_c_Test1,_dart_Test>('Test'))( - ); -} -_dart_Test? _Test; - -} - -class _Test extends ffi.Struct{ - @ffi.Int8() - external int _unique_array_item_0; - @ffi.Int8() - external int _unique_array_item_1; -/// Helper for array `array`. -ArrayHelper1__Test_array_level0 get array => ArrayHelper1__Test_array_level0(this, [2], 0, 0); -} - -/// Helper for array `array` in struct `_Test`. -class ArrayHelper1__Test_array_level0{ -final _Test _struct; -final List dimensions; -final int level; -final int _absoluteIndex; -int get length => dimensions[level]; -ArrayHelper1__Test_array_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_array_item_0; -case 1: - return _struct._unique_array_item_1; -default: - throw Exception('Invalid Array Helper generated.');} -} -void operator[]=(int index, int value){ -_checkBounds(index); -switch(_absoluteIndex+index){ -case 0: - _struct._unique_array_item_0 = value; - break; -case 1: - _struct._unique_array_item_1 = value; - break; -default: - throw Exception('Invalid Array Helper generated.'); -} -} -} -class ArrayHelperPrefixCollisionTest extends ffi.Struct{ -} - -abstract class _c_Test { -} - -abstract class init_dylib { -} - -typedef _c_test1 = ffi.Void Function( -); - -typedef _dart_test1 = void Function( -); - -typedef _c__test = ffi.Void Function( -); - -typedef _dart__test = void Function( -); - -typedef _c__c_test = ffi.Void Function( -); - -typedef _dart__c_test = void Function( -); - -typedef _c__dart_test = ffi.Void Function( -); - -typedef _dart__dart_test = void Function( -); - -typedef _c_Test1 = ffi.Void Function( -); - -typedef _dart_Test = void Function( -); - -'''); - if (file.existsSync()) { - file.delete(); - } - } catch (e) { - file.writeAsStringSync(gen); - print('Failed test, Debug output: ${file.absolute.path}'); - rethrow; - } - }); - }); - test('boolean_dartBool', () { - final library = Library( - name: 'Bindings', - dartBool: true, - bindings: [ - Func( - name: 'test1', - returnType: Type.boolean(), - parameters: [ - Parameter(name: 'a', type: Type.boolean()), - Parameter(name: 'b', type: Type.pointer(Type.boolean())), - ], - ), - Struc( - name: 'test2', - members: [ - Member(name: 'a', type: Type.boolean()), - ], - ), - ], - ); - - final gen = library.generate(); - - // Writing to file for debug purpose. - final file = File( - 'test/debug_generated/boolean-dartbool-output.dart', - ); - try { - expect(gen, '''// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; - -class Bindings{ -/// Holds the Dynamic library. -final ffi.DynamicLibrary _dylib; - -/// The symbols are looked up in [dynamicLibrary]. -Bindings(ffi.DynamicLibrary dynamicLibrary): _dylib = dynamicLibrary; - -bool test1( - bool a, - ffi.Pointer b, -) { -return (_test1 ??= _dylib.lookupFunction<_c_test1,_dart_test1>('test1'))( - a?1:0, - b, - )!=0; -} -_dart_test1? _test1; - -} - -class test2 extends ffi.Struct{ - @ffi.Uint8() - external int a; - -} - -typedef _c_test1 = ffi.Uint8 Function( - ffi.Uint8 a, - ffi.Pointer b, -); - -typedef _dart_test1 = int Function( - int a, - ffi.Pointer b, -); - -'''); - if (file.existsSync()) { - file.delete(); - } - } catch (e) { - file.writeAsStringSync(gen); - print('Failed test, Debug output: ${file.absolute.path}'); - rethrow; - } - }); - test('boolean_no_dartBool', () { - final library = Library( - name: 'Bindings', - dartBool: false, - bindings: [ - Func( - name: 'test1', - returnType: Type.boolean(), - parameters: [ - Parameter(name: 'a', type: Type.boolean()), - Parameter(name: 'b', type: Type.pointer(Type.boolean())), - ], - ), - Struc( - name: 'test2', - members: [ - Member(name: 'a', type: Type.boolean()), - ], - ), - ], - ); - - final gen = library.generate(); - - // Writing to file for debug purpose. - final file = File( - 'test/debug_generated/boolean-no-dartBool-output.dart', - ); - try { - expect(gen, '''// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; - -class Bindings{ -/// Holds the Dynamic library. -final ffi.DynamicLibrary _dylib; - -/// The symbols are looked up in [dynamicLibrary]. -Bindings(ffi.DynamicLibrary dynamicLibrary): _dylib = dynamicLibrary; - -int test1( - int a, - ffi.Pointer b, -) { -return (_test1 ??= _dylib.lookupFunction<_c_test1,_dart_test1>('test1'))( - a, - b, - ); -} -_dart_test1? _test1; - -} - -class test2 extends ffi.Struct{ - @ffi.Uint8() - external int a; - -} - -typedef _c_test1 = ffi.Uint8 Function( - ffi.Uint8 a, - ffi.Pointer b, -); - -typedef _dart_test1 = int Function( - int a, - ffi.Pointer b, -); - -'''); - if (file.existsSync()) { - file.delete(); - } - } catch (e) { - file.writeAsStringSync(gen); - print('Failed test, Debug output: ${file.absolute.path}'); - rethrow; - } - }); -} diff --git a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart new file mode 100644 index 0000000000..350b799dd8 --- /dev/null +++ b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart @@ -0,0 +1,382 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:test/test.dart'; +import '../test_utils.dart'; + +void main() { + group('code_generator: ', () { + test('Function Binding (primitives, pointers)', () { + final library = Library( + name: 'Bindings', + bindings: [ + Func( + name: 'noParam', + dartDoc: 'Just a test function\nheres another line', + returnType: Type.nativeType( + SupportedNativeType.Int32, + ), + ), + Func( + name: 'withPrimitiveParam', + parameters: [ + Parameter( + name: 'a', + type: Type.nativeType( + SupportedNativeType.Int32, + ), + ), + Parameter( + name: 'b', + type: Type.nativeType( + SupportedNativeType.Uint8, + ), + ), + ], + returnType: Type.nativeType( + SupportedNativeType.Char, + ), + ), + Func( + name: 'withPointerParam', + parameters: [ + Parameter( + name: 'a', + type: Type.pointer( + Type.nativeType( + SupportedNativeType.Int32, + ), + ), + ), + Parameter( + name: 'b', + type: Type.pointer( + Type.pointer( + Type.nativeType( + SupportedNativeType.Uint8, + ), + ), + ), + ), + ], + returnType: Type.pointer( + Type.nativeType( + SupportedNativeType.Double, + ), + ), + ), + ], + ); + + _matchLib(library, 'function'); + }); + + test('Struct Binding (primitives, pointers)', () { + final library = Library( + name: 'Bindings', + bindings: [ + Struc( + name: 'NoMember', + dartDoc: 'Just a test struct\nheres another line', + ), + Struc( + name: 'WithPrimitiveMember', + members: [ + Member( + name: 'a', + type: Type.nativeType( + SupportedNativeType.Int32, + ), + ), + Member( + name: 'b', + type: Type.nativeType( + SupportedNativeType.Double, + ), + ), + Member( + name: 'c', + type: Type.nativeType( + SupportedNativeType.Char, + ), + ), + ], + ), + Struc( + name: 'WithPointerMember', + members: [ + Member( + name: 'a', + type: Type.pointer( + Type.nativeType( + SupportedNativeType.Int32, + ), + ), + ), + Member( + name: 'b', + type: Type.pointer( + Type.pointer( + Type.nativeType( + SupportedNativeType.Double, + ), + ), + ), + ), + Member( + name: 'c', + type: Type.nativeType( + SupportedNativeType.Char, + ), + ), + ], + ), + ], + ); + + _matchLib(library, 'struct'); + }); + + test('Function and Struct Binding (pointer to Struct)', () { + final struct_some = Struc( + name: 'SomeStruc', + members: [ + Member( + name: 'a', + type: Type.nativeType( + SupportedNativeType.Int32, + ), + ), + Member( + name: 'b', + type: Type.nativeType( + SupportedNativeType.Double, + ), + ), + Member( + name: 'c', + type: Type.nativeType( + SupportedNativeType.Char, + ), + ), + ], + ); + final library = Library( + name: 'Bindings', + bindings: [ + struct_some, + Func( + name: 'someFunc', + parameters: [ + Parameter( + name: 'some', + type: Type.pointer( + Type.pointer( + Type.struct( + struct_some, + ), + ), + ), + ), + ], + returnType: Type.pointer( + Type.struct( + struct_some, + ), + ), + ), + ], + ); + + _matchLib(library, 'function_n_struct'); + }); + + test('global (primitives, pointers, pointer to struct)', () { + final struc_some = Struc( + name: 'Some', + ); + final emptyGlobalStruc = Struc(name: 'EmptyStruct'); + + final library = Library( + name: 'Bindings', + bindings: [ + Global( + name: 'test1', + type: Type.nativeType( + SupportedNativeType.Int32, + ), + ), + Global( + name: 'test2', + type: Type.pointer( + Type.nativeType( + SupportedNativeType.Float, + ), + ), + ), + struc_some, + Global( + name: 'test5', + type: Type.pointer( + Type.struct( + struc_some, + ), + ), + ), + emptyGlobalStruc, + Global(name: 'globalStruct', type: Type.struct(emptyGlobalStruc)), + ], + ); + _matchLib(library, 'global'); + }); + + test('constant', () { + final library = Library( + name: 'Bindings', + header: '// ignore_for_file: unused_import\n', + bindings: [ + Constant( + name: 'test1', + rawType: 'int', + rawValue: '20', + ), + Constant( + name: 'test2', + rawType: 'double', + rawValue: '20.0', + ), + ], + ); + _matchLib(library, 'constant'); + }); + + test('enum_class', () { + final library = Library( + name: 'Bindings', + header: '// ignore_for_file: unused_import\n', + bindings: [ + EnumClass( + name: 'Constants', + dartDoc: 'test line 1\ntest line 2', + enumConstants: [ + EnumConstant( + name: 'a', + value: 10, + ), + EnumConstant(name: 'b', value: -1, dartDoc: 'negative'), + ], + ), + ], + ); + _matchLib(library, 'enumclass'); + }); + test('Internal conflict resolution', () { + final library = Library( + name: 'init_dylib', + header: '// ignore_for_file: unused_element\n', + bindings: [ + Func( + name: 'test', + returnType: Type.nativeType(SupportedNativeType.Void), + ), + Func( + name: '_test', + returnType: Type.nativeType(SupportedNativeType.Void), + ), + Func( + name: '_c_test', + returnType: Type.nativeType(SupportedNativeType.Void), + ), + Func( + name: '_dart_test', + returnType: Type.nativeType(SupportedNativeType.Void), + ), + Struc( + name: '_Test', + members: [ + Member( + name: 'array', + type: Type.constantArray( + 2, + Type.nativeType( + SupportedNativeType.Int8, + ), + ), + ), + ], + ), + Struc(name: 'ArrayHelperPrefixCollisionTest'), + Func( + name: 'Test', + returnType: Type.nativeType(SupportedNativeType.Void), + ), + EnumClass(name: '_c_Test'), + EnumClass(name: 'init_dylib'), + ], + ); + _matchLib(library, 'internal_conflict_resolution'); + }); + }); + test('boolean_dartBool', () { + final library = Library( + name: 'Bindings', + dartBool: true, + bindings: [ + Func( + name: 'test1', + returnType: Type.boolean(), + parameters: [ + Parameter(name: 'a', type: Type.boolean()), + Parameter(name: 'b', type: Type.pointer(Type.boolean())), + ], + ), + Struc( + name: 'test2', + members: [ + Member(name: 'a', type: Type.boolean()), + ], + ), + ], + ); + _matchLib(library, 'boolean_dartbool'); + }); + test('boolean_no_dartBool', () { + final library = Library( + name: 'Bindings', + dartBool: false, + bindings: [ + Func( + name: 'test1', + returnType: Type.boolean(), + parameters: [ + Parameter(name: 'a', type: Type.boolean()), + Parameter(name: 'b', type: Type.pointer(Type.boolean())), + ], + ), + Struc( + name: 'test2', + members: [ + Member(name: 'a', type: Type.boolean()), + ], + ), + ], + ); + _matchLib(library, 'boolean_no_dartbool'); + }); +} + +/// Utility to match expected bindings to the generated bindings. +void _matchLib(Library lib, String testName) { + matchLibraryWithExpected(lib, [ + 'test', + 'debug_generated', + 'code_generator_test_${testName}_output.dart' + ], [ + 'test', + 'code_generator_tests', + 'expected_bindings', + '_expected_${testName}_bindings.dart' + ]); +} diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart new file mode 100644 index 0000000000..9e9d6ac717 --- /dev/null +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart @@ -0,0 +1,40 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +class Bindings { + /// Holds the Dynamic library. + final ffi.DynamicLibrary _dylib; + + /// The symbols are looked up in [dynamicLibrary]. + Bindings(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + + bool test1( + bool a, + ffi.Pointer b, + ) { + return (_test1 ??= _dylib.lookupFunction<_c_test1, _dart_test1>('test1'))( + a ? 1 : 0, + b, + ) != + 0; + } + + _dart_test1? _test1; +} + +class test2 extends ffi.Struct { + @ffi.Uint8() + external int a; +} + +typedef _c_test1 = ffi.Uint8 Function( + ffi.Uint8 a, + ffi.Pointer b, +); + +typedef _dart_test1 = int Function( + int a, + ffi.Pointer b, +); diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart new file mode 100644 index 0000000000..99ed563fbe --- /dev/null +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart @@ -0,0 +1,39 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +class Bindings { + /// Holds the Dynamic library. + final ffi.DynamicLibrary _dylib; + + /// The symbols are looked up in [dynamicLibrary]. + Bindings(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + + int test1( + int a, + ffi.Pointer b, + ) { + return (_test1 ??= _dylib.lookupFunction<_c_test1, _dart_test1>('test1'))( + a, + b, + ); + } + + _dart_test1? _test1; +} + +class test2 extends ffi.Struct { + @ffi.Uint8() + external int a; +} + +typedef _c_test1 = ffi.Uint8 Function( + ffi.Uint8 a, + ffi.Pointer b, +); + +typedef _dart_test1 = int Function( + int a, + ffi.Pointer b, +); diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart new file mode 100644 index 0000000000..d01f2b1d01 --- /dev/null +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart @@ -0,0 +1,10 @@ +// ignore_for_file: unused_import + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +const int test1 = 20; + +const double test2 = 20.0; diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart new file mode 100644 index 0000000000..0aa2dbbd68 --- /dev/null +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart @@ -0,0 +1,15 @@ +// ignore_for_file: unused_import + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// test line 1 +/// test line 2 +abstract class Constants { + static const int a = 10; + + /// negative + static const int b = -1; +} diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart new file mode 100644 index 0000000000..82736d212e --- /dev/null +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart @@ -0,0 +1,73 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +class Bindings { + /// Holds the Dynamic library. + final ffi.DynamicLibrary _dylib; + + /// The symbols are looked up in [dynamicLibrary]. + Bindings(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + + /// Just a test function + /// heres another line + int noParam() { + return (_noParam ??= + _dylib.lookupFunction<_c_noParam, _dart_noParam>('noParam'))(); + } + + _dart_noParam? _noParam; + + int withPrimitiveParam( + int a, + int b, + ) { + return (_withPrimitiveParam ??= + _dylib.lookupFunction<_c_withPrimitiveParam, _dart_withPrimitiveParam>( + 'withPrimitiveParam'))( + a, + b, + ); + } + + _dart_withPrimitiveParam? _withPrimitiveParam; + + ffi.Pointer withPointerParam( + ffi.Pointer a, + ffi.Pointer> b, + ) { + return (_withPointerParam ??= + _dylib.lookupFunction<_c_withPointerParam, _dart_withPointerParam>( + 'withPointerParam'))( + a, + b, + ); + } + + _dart_withPointerParam? _withPointerParam; +} + +typedef _c_noParam = ffi.Int32 Function(); + +typedef _dart_noParam = int Function(); + +typedef _c_withPrimitiveParam = ffi.Uint8 Function( + ffi.Int32 a, + ffi.Uint8 b, +); + +typedef _dart_withPrimitiveParam = int Function( + int a, + int b, +); + +typedef _c_withPointerParam = ffi.Pointer Function( + ffi.Pointer a, + ffi.Pointer> b, +); + +typedef _dart_withPointerParam = ffi.Pointer Function( + ffi.Pointer a, + ffi.Pointer> b, +); diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart new file mode 100644 index 0000000000..4f0ea4632f --- /dev/null +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart @@ -0,0 +1,42 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +class Bindings { + /// Holds the Dynamic library. + final ffi.DynamicLibrary _dylib; + + /// The symbols are looked up in [dynamicLibrary]. + Bindings(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + + ffi.Pointer someFunc( + ffi.Pointer> some, + ) { + return (_someFunc ??= + _dylib.lookupFunction<_c_someFunc, _dart_someFunc>('someFunc'))( + some, + ); + } + + _dart_someFunc? _someFunc; +} + +class SomeStruc extends ffi.Struct { + @ffi.Int32() + external int a; + + @ffi.Double() + external double b; + + @ffi.Uint8() + external int c; +} + +typedef _c_someFunc = ffi.Pointer Function( + ffi.Pointer> some, +); + +typedef _dart_someFunc = ffi.Pointer Function( + ffi.Pointer> some, +); diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart new file mode 100644 index 0000000000..215858b7c1 --- /dev/null +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart @@ -0,0 +1,41 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +class Bindings { + /// Holds the Dynamic library. + final ffi.DynamicLibrary _dylib; + + /// The symbols are looked up in [dynamicLibrary]. + Bindings(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + + late final ffi.Pointer _test1 = _dylib.lookup('test1'); + + int get test1 => _test1.value; + + set test1(int value) => _test1.value = value; + + late final ffi.Pointer> _test2 = + _dylib.lookup>('test2'); + + ffi.Pointer get test2 => _test2.value; + + set test2(ffi.Pointer value) => _test2.value = value; + + late final ffi.Pointer> _test5 = + _dylib.lookup>('test5'); + + ffi.Pointer get test5 => _test5.value; + + set test5(ffi.Pointer value) => _test5.value = value; + + late final ffi.Pointer _globalStruct = + _dylib.lookup('globalStruct'); + + ffi.Pointer get globalStruct => _globalStruct; +} + +class Some extends ffi.Opaque {} + +class EmptyStruct extends ffi.Opaque {} diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart new file mode 100644 index 0000000000..a6fbe60bcd --- /dev/null +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart @@ -0,0 +1,126 @@ +// ignore_for_file: unused_element + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +class init_dylib_1 { + /// Holds the Dynamic library. + final ffi.DynamicLibrary _dylib; + + /// The symbols are looked up in [dynamicLibrary]. + init_dylib_1(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + + void test() { + return (_test_1 ??= _dylib.lookupFunction<_c_test1, _dart_test1>('test'))(); + } + + _dart_test1? _test_1; + + void _test() { + return (__test ??= _dylib.lookupFunction<_c__test, _dart__test>('_test'))(); + } + + _dart__test? __test; + + void _c_test() { + return (__c_test ??= + _dylib.lookupFunction<_c__c_test, _dart__c_test>('_c_test'))(); + } + + _dart__c_test? __c_test; + + void _dart_test() { + return (__dart_test ??= + _dylib.lookupFunction<_c__dart_test, _dart__dart_test>('_dart_test'))(); + } + + _dart__dart_test? __dart_test; + + void Test() { + return (_Test ??= _dylib.lookupFunction<_c_Test1, _dart_Test>('Test'))(); + } + + _dart_Test? _Test; +} + +class _Test extends ffi.Struct { + @ffi.Int8() + external int _unique_array_item_0; + @ffi.Int8() + external int _unique_array_item_1; + + /// Helper for array `array`. + ArrayHelper1__Test_array_level0 get array => + ArrayHelper1__Test_array_level0(this, [2], 0, 0); +} + +/// Helper for array `array` in struct `_Test`. +class ArrayHelper1__Test_array_level0 { + final _Test _struct; + final List dimensions; + final int level; + final int _absoluteIndex; + int get length => dimensions[level]; + ArrayHelper1__Test_array_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_array_item_0; + case 1: + return _struct._unique_array_item_1; + default: + throw Exception('Invalid Array Helper generated.'); + } + } + + void operator []=(int index, int value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._unique_array_item_0 = value; + break; + case 1: + _struct._unique_array_item_1 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); + } + } +} + +class ArrayHelperPrefixCollisionTest extends ffi.Opaque {} + +abstract class _c_Test {} + +abstract class init_dylib {} + +typedef _c_test1 = ffi.Void Function(); + +typedef _dart_test1 = void Function(); + +typedef _c__test = ffi.Void Function(); + +typedef _dart__test = void Function(); + +typedef _c__c_test = ffi.Void Function(); + +typedef _dart__c_test = void Function(); + +typedef _c__dart_test = ffi.Void Function(); + +typedef _dart__dart_test = void Function(); + +typedef _c_Test1 = ffi.Void Function(); + +typedef _dart_Test = void Function(); diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart new file mode 100644 index 0000000000..f84642b090 --- /dev/null +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart @@ -0,0 +1,28 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Just a test struct +/// heres another line +class NoMember extends ffi.Opaque {} + +class WithPrimitiveMember extends ffi.Struct { + @ffi.Int32() + external int a; + + @ffi.Double() + external double b; + + @ffi.Uint8() + external int c; +} + +class WithPointerMember extends ffi.Struct { + external ffi.Pointer a; + + external ffi.Pointer> b; + + @ffi.Uint8() + external int c; +} diff --git a/pkgs/ffigen/test/header_parser_tests/globals.h b/pkgs/ffigen/test/header_parser_tests/globals.h index f0f464fa6b..80da2b0a07 100644 --- a/pkgs/ffigen/test/header_parser_tests/globals.h +++ b/pkgs/ffigen/test/header_parser_tests/globals.h @@ -13,3 +13,9 @@ long double *pointerToLongDouble; // This should be ignored int GlobalIgnore; + +struct EmptyStruct +{ +}; + +struct EmptyStruct globalStruct; diff --git a/pkgs/ffigen/test/header_parser_tests/globals_test.dart b/pkgs/ffigen/test/header_parser_tests/globals_test.dart index 7184792c3d..832b89d1d9 100644 --- a/pkgs/ffigen/test/header_parser_tests/globals_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/globals_test.dart @@ -62,6 +62,7 @@ ${strings.compilerOpts}: '-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/ } Library expectedLibrary() { + final globalStruc = Struc(name: 'EmptyStruct'); return Library( name: 'Bindings', bindings: [ @@ -70,6 +71,8 @@ Library expectedLibrary() { Global( type: Type.pointer(Type.nativeType(SupportedNativeType.Int32)), name: 'aGlobalPointer'), + globalStruc, + Global(name: 'globalStruct', type: Type.struct(globalStruc)), ], ); } diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index e0abce7c74..9d4c52d116 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -5045,13 +5045,13 @@ class CXStringSet extends ffi.Struct { external int Count; } -class CXVirtualFileOverlayImpl extends ffi.Struct {} +class CXVirtualFileOverlayImpl extends ffi.Opaque {} -class CXModuleMapDescriptorImpl extends ffi.Struct {} +class CXModuleMapDescriptorImpl extends ffi.Opaque {} -class CXTargetInfoImpl extends ffi.Struct {} +class CXTargetInfoImpl extends ffi.Opaque {} -class CXTranslationUnitImpl extends ffi.Struct {} +class CXTranslationUnitImpl extends ffi.Opaque {} /// Provides the contents of a file that has not yet been saved to disk. class CXUnsavedFile extends ffi.Struct { @@ -6333,7 +6333,7 @@ abstract class CXTLSKind { static const int CXTLS_Static = 2; } -class CXCursorSetImpl extends ffi.Struct {} +class CXCursorSetImpl extends ffi.Opaque {} /// Describes the kind of type abstract class CXTypeKind { diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index 6abdd48804..fa67d48a07 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -8984,9 +8984,9 @@ class SQLite { _dart_sqlite3_rtree_query_callback? _sqlite3_rtree_query_callback; } -class sqlite3 extends ffi.Struct {} +class sqlite3 extends ffi.Opaque {} -class sqlite3_file extends ffi.Struct {} +class sqlite3_file extends ffi.Opaque {} class sqlite3_io_methods extends ffi.Struct { @ffi.Int32() @@ -9031,19 +9031,19 @@ class sqlite3_io_methods extends ffi.Struct { external ffi.Pointer> xUnfetch; } -class sqlite3_mutex extends ffi.Struct {} +class sqlite3_mutex extends ffi.Opaque {} -class sqlite3_api_routines extends ffi.Struct {} +class sqlite3_api_routines extends ffi.Opaque {} -class sqlite3_vfs extends ffi.Struct {} +class sqlite3_vfs extends ffi.Opaque {} -class sqlite3_mem_methods extends ffi.Struct {} +class sqlite3_mem_methods extends ffi.Opaque {} -class sqlite3_stmt extends ffi.Struct {} +class sqlite3_stmt extends ffi.Opaque {} -class sqlite3_value extends ffi.Struct {} +class sqlite3_value extends ffi.Opaque {} -class sqlite3_context extends ffi.Struct {} +class sqlite3_context extends ffi.Opaque {} /// CAPI3REF: Virtual Table Instance Object /// KEYWORDS: sqlite3_vtab @@ -9061,7 +9061,7 @@ class sqlite3_context extends ffi.Struct {} /// prior to assigning a new string to zErrMsg. ^After the error message /// is delivered up to the client application, the string will be automatically /// freed by sqlite3_free() and the zErrMsg field will be zeroed. -class sqlite3_vtab extends ffi.Struct {} +class sqlite3_vtab extends ffi.Opaque {} /// CAPI3REF: Virtual Table Indexing Information /// KEYWORDS: sqlite3_index_info @@ -9163,7 +9163,7 @@ class sqlite3_vtab extends ffi.Struct {} /// It may therefore only be used if /// sqlite3_libversion_number() returns a value greater than or equal to /// 3009000. -class sqlite3_index_info extends ffi.Struct {} +class sqlite3_index_info extends ffi.Opaque {} /// CAPI3REF: Virtual Table Cursor Object /// KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} @@ -9180,7 +9180,7 @@ class sqlite3_index_info extends ffi.Struct {} /// /// This superclass exists in order to define fields of the cursor that /// are common to all implementations. -class sqlite3_vtab_cursor extends ffi.Struct {} +class sqlite3_vtab_cursor extends ffi.Opaque {} /// CAPI3REF: Virtual Table Object /// KEYWORDS: sqlite3_module {virtual table module} @@ -9196,23 +9196,23 @@ class sqlite3_vtab_cursor extends ffi.Struct {} /// module or until the [database connection] closes. The content /// of this structure must not change while it is registered with /// any database connection. -class sqlite3_module extends ffi.Struct {} +class sqlite3_module extends ffi.Opaque {} -class sqlite3_blob extends ffi.Struct {} +class sqlite3_blob extends ffi.Opaque {} -class sqlite3_mutex_methods extends ffi.Struct {} +class sqlite3_mutex_methods extends ffi.Opaque {} -class sqlite3_str extends ffi.Struct {} +class sqlite3_str extends ffi.Opaque {} -class sqlite3_pcache extends ffi.Struct {} +class sqlite3_pcache extends ffi.Opaque {} -class sqlite3_pcache_page extends ffi.Struct {} +class sqlite3_pcache_page extends ffi.Opaque {} -class sqlite3_pcache_methods2 extends ffi.Struct {} +class sqlite3_pcache_methods2 extends ffi.Opaque {} -class sqlite3_pcache_methods extends ffi.Struct {} +class sqlite3_pcache_methods extends ffi.Opaque {} -class sqlite3_backup extends ffi.Struct {} +class sqlite3_backup extends ffi.Opaque {} /// CAPI3REF: Database Snapshot /// KEYWORDS: {snapshot} {sqlite3_snapshot} @@ -9610,7 +9610,7 @@ class ArrayHelper_sqlite3_snapshot_hidden_level0 { /// A pointer to a structure of the following type is passed as the first /// argument to callbacks registered using rtree_geometry_callback(). -class sqlite3_rtree_geometry extends ffi.Struct {} +class sqlite3_rtree_geometry extends ffi.Opaque {} /// A pointer to a structure of the following type is passed as the /// argument to scored geometry callback registered using @@ -9619,7 +9619,7 @@ class sqlite3_rtree_geometry extends ffi.Struct {} /// Note that the first 5 fields of this structure are identical to /// sqlite3_rtree_geometry. This structure is a subclass of /// sqlite3_rtree_geometry. -class sqlite3_rtree_query_info extends ffi.Struct {} +class sqlite3_rtree_query_info extends ffi.Opaque {} /// EXTENSION API FUNCTIONS /// @@ -9830,17 +9830,17 @@ class sqlite3_rtree_query_info extends ffi.Struct {} /// /// xPhraseNextColumn() /// See xPhraseFirstColumn above. -class Fts5ExtensionApi extends ffi.Struct {} +class Fts5ExtensionApi extends ffi.Opaque {} -class Fts5Context extends ffi.Struct {} +class Fts5Context extends ffi.Opaque {} -class Fts5PhraseIter extends ffi.Struct {} +class Fts5PhraseIter extends ffi.Opaque {} -class Fts5Tokenizer extends ffi.Struct {} +class Fts5Tokenizer extends ffi.Opaque {} -class fts5_tokenizer extends ffi.Struct {} +class fts5_tokenizer extends ffi.Opaque {} -class fts5_api extends ffi.Struct {} +class fts5_api extends ffi.Opaque {} const String SQLITE_VERSION = '3.32.3'; diff --git a/pkgs/ffigen/test/test_coverage.dart b/pkgs/ffigen/test/test_coverage.dart index ede39f3e45..9f61cde698 100644 --- a/pkgs/ffigen/test/test_coverage.dart +++ b/pkgs/ffigen/test/test_coverage.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'code_generator_test.dart' as code_generator_test; +import 'code_generator_tests/code_generator_test.dart' as code_generator_test; import 'collision_tests/decl_decl_collision_test.dart' as collision_tests_decl_decl_collision_test; import 'collision_tests/reserved_keyword_collision_test.dart' @@ -19,6 +19,8 @@ import 'header_parser_tests/function_n_struct_test.dart' as header_parser_tests_function_n_struct_test; import 'header_parser_tests/functions_test.dart' as header_parser_tests_functions_test; +import 'header_parser_tests/globals_test.dart' + as header_parser_tests_globals_test; import 'header_parser_tests/macros_test.dart' as header_parser_tests_macros_test; import 'header_parser_tests/native_func_typedef_test.dart' @@ -43,6 +45,7 @@ void main() { collision_tests_reserved_keyword_collision_test.main(); header_parser_tests_dart_handle_test.main(); header_parser_tests_functions_test.main(); + header_parser_tests_globals_test.main(); header_parser_tests_macros_test.main(); header_parser_tests_function_n_struct_test.main(); header_parser_tests_native_func_typedef_test.main(); diff --git a/pkgs/ffigen/test/test_utils.dart b/pkgs/ffigen/test/test_utils.dart index c2d95f009a..a967f66eee 100644 --- a/pkgs/ffigen/test/test_utils.dart +++ b/pkgs/ffigen/test/test_utils.dart @@ -9,8 +9,6 @@ import 'package:logging/logging.dart'; import 'package:path/path.dart' as path; import 'package:test/test.dart'; -/// Extracts a binding's string from a library. - extension LibraryTestExt on Library { /// Get a [Binding]'s generated string with a given name. String getBindingAsString(String name) { From 3cf6fc057cc6b882289e89b49d1d4e40466f9731 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 1 Mar 2021 09:50:39 -0800 Subject: [PATCH 063/276] [ffigen] Skip inline functions (#147) (#167) --- pkgs/ffigen/CHANGELOG.md | 3 +++ .../clang_bindings/clang_bindings.dart | 23 +++++++++++++++++++ .../sub_parsers/functiondecl_parser.dart | 10 ++++++++ pkgs/ffigen/pubspec.yaml | 2 +- .../test/header_parser_tests/functions.h | 3 +++ .../header_parser_tests/functions_test.dart | 5 ++++ pkgs/ffigen/tool/libclang_config.yaml | 1 + 7 files changed, 46 insertions(+), 1 deletion(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index e877eb77f4..9a3cbb6799 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.0.0-dev.6 +- Functions marked `inline` are now skipped. + # 2.0.0-dev.5 - Use `Opaque` for representing empty `Struct`s. diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index a68621eb30..b8342177af 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -510,6 +510,21 @@ class Clang { _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; + /// For pointer types, returns the type of the pointee. CXType clang_getPointeeType( CXType T, @@ -2563,6 +2578,14 @@ typedef _dart_clang_Cursor_isMacroBuiltin = int Function( CXCursor C, ); +typedef _c_clang_Cursor_isFunctionInlined = ffi.Uint32 Function( + CXCursor C, +); + +typedef _dart_clang_Cursor_isFunctionInlined = int Function( + CXCursor C, +); + typedef _c_clang_getPointeeType = CXType Function( CXType T, ); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index 7bf089ab9a..ccfcb216fc 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -35,6 +35,16 @@ Func? parseFunctionDeclaration(clang_types.CXCursor cursor) { final rt = _getFunctionReturnType(cursor); final parameters = _getParameters(cursor, funcName); + if (clang.clang_Cursor_isFunctionInlined(cursor) != 0) { + _logger.fine( + '---- Removed Function, reason: inline function: ${cursor.completeStringRepr()}'); + _logger.warning( + "Skipped Function '$funcName', inline functions are not supported."); + return _stack + .pop() + .func; // Returning null so that [addToBindings] function excludes this. + } + if (rt.isIncompleteStruct || _stack.top.incompleteStructParameter) { _logger.fine( '---- Removed Function, reason: Incomplete struct pass/return by value: ${cursor.completeStringRepr()}'); diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index cb1358470b..e8501c0ca8 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.0.0-dev.5 +version: 2.0.0-dev.6 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/header_parser_tests/functions.h b/pkgs/ffigen/test/header_parser_tests/functions.h index 5c00b33c93..56ec2bef74 100644 --- a/pkgs/ffigen/test/header_parser_tests/functions.h +++ b/pkgs/ffigen/test/header_parser_tests/functions.h @@ -16,3 +16,6 @@ void *func4(int8_t **, double, int32_t ***); typedef void shortHand(void(b)()); // Would be treated as `void func5(shortHand *a, void (*b)())`. void func5(shortHand a, void(b)()); + +// Should be skipped as inline functions are not supported. +static inline void inlineFunc(); diff --git a/pkgs/ffigen/test/header_parser_tests/functions_test.dart b/pkgs/ffigen/test/header_parser_tests/functions_test.dart index 31e0506941..c02905d091 100644 --- a/pkgs/ffigen/test/header_parser_tests/functions_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/functions_test.dart @@ -58,6 +58,11 @@ ${strings.headers}: expect(actual.getBindingAsString('func5'), expected.getBindingAsString('func5')); }); + + test('Skip inline functions', () { + expect(() => actual.getBindingAsString('inlineFunc'), + throwsA(TypeMatcher())); + }); }); } diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index 2a059dd2a9..c27f17c49f 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -101,3 +101,4 @@ functions: - clang_Cursor_isAnonymousRecordDecl - clang_getCursorUSR - clang_getFieldDeclBitWidth + - clang_Cursor_isFunctionInlined From d785fee7c220aff915d22b2ddec2b60ccc93d344 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 1 Mar 2021 10:07:43 -0800 Subject: [PATCH 064/276] [ffigen] Stable release: Update dependencies to sound null safety, minor changes. (#168) Co-authored-by: Daco Harkes --- .../ffigen/.github/workflows/test-package.yml | 11 ++++---- pkgs/ffigen/CHANGELOG.md | 6 ++++ pkgs/ffigen/README.md | 10 +++---- pkgs/ffigen/bin/ffigen.dart | 2 -- pkgs/ffigen/example/c_json/README.md | 2 +- pkgs/ffigen/example/c_json/main.dart | 6 ++-- pkgs/ffigen/example/c_json/pubspec.yaml | 4 +-- .../example/libclang-example/pubspec.yaml | 2 +- .../ffigen/example/libclang-example/readme.md | 2 +- pkgs/ffigen/example/simple/README.md | 2 +- pkgs/ffigen/example/simple/pubspec.yaml | 2 +- pkgs/ffigen/lib/src/README.md | 2 +- .../lib/src/code_generator/library.dart | 15 ++-------- .../lib/src/config_provider/config.dart | 14 +++++----- .../lib/src/config_provider/spec_utils.dart | 4 ++- pkgs/ffigen/lib/src/header_parser/parser.dart | 2 +- .../sub_parsers/macro_parser.dart | 6 ++-- pkgs/ffigen/lib/src/header_parser/utils.dart | 28 +++++++++---------- pkgs/ffigen/pubspec.yaml | 28 +++++++++---------- pkgs/ffigen/test/native_test/config.yaml | 2 +- pkgs/ffigen/tool/coverage.sh | 8 +++--- pkgs/ffigen/tool/libclang_config.yaml | 2 +- 22 files changed, 78 insertions(+), 82 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 7de66eba1d..d5e1f2d423 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -13,14 +13,13 @@ env: PUB_ENVIRONMENT: bot.github jobs: - # Check code formatting and static analysis on a single OS (linux) - # against Dart dev. + # Check code formatting and static analysis on a single OS (linux). analyze: runs-on: ubuntu-latest strategy: fail-fast: false matrix: - sdk: [2.12.0-237.0.dev] # TODO(127): Revert to stable. + sdk: [2.12.0-259.9.beta] # TODO(127): Revert to stable. steps: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1.0 @@ -33,7 +32,7 @@ jobs: run: dart format --output=none --set-exit-if-changed . if: always() && steps.install.outcome == 'success' - name: Analyze code - run: dart analyze # --fatal-infos # Removed till we stop using legacy libraries. + run: dart analyze --fatal-infos if: always() && steps.install.outcome == 'success' test: @@ -44,7 +43,7 @@ jobs: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1.0 with: - sdk: 2.12.0-237.0.dev # TODO(127): Revert to stable. + sdk: 2.12.0-259.9.beta # TODO(127): Revert to stable. - name: Install dependencies run: dart pub get - name: Install libclang-10-dev @@ -52,7 +51,7 @@ jobs: - name: Build test dylib run: cd test/native_test && dart build_test_dylib.dart && cd ../.. - name: Run VM tests - run: dart --no-sound-null-safety test --platform vm + run: dart test --platform vm - name: Collect coverage run: ./tool/coverage.sh - name: Upload coverage diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 9a3cbb6799..4ab98d44e2 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,9 @@ +# 2.0.1 +- Switch to preview release of `package:quiver`. + +# 2.0.0 +- Upgraded all dependencies. `package:ffigen` now runs with sound null safety. + # 2.0.0-dev.6 - Functions marked `inline` are now skipped. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index f2c194e50d..d531b4df25 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -60,7 +60,7 @@ Jump to [FAQ](#faq). Configurations can be provided in 2 ways- 1. In the project's `pubspec.yaml` file under the key `ffigen`. 2. Via a custom YAML file, then specify this file while running - -`pub run ffigen --config config.yaml` +`dart run ffigen --config config.yaml` The following configuration options are available- @@ -391,15 +391,15 @@ class ArrayHelper_CXFileUniqueID_data_level0 { 1. Multi OS support for types such as long. [Issue #7](https://github.com/dart-lang/ffigen/issues/7) ## Trying out examples -1. `cd examples/`, Run `pub get`. -2. Run `pub run ffigen`. +1. `cd examples/`, Run `dart pub get`. +2. Run `dart run ffigen`. ## Running Tests 1. Dynamic library for some tests need to be built before running the examples. 1. `cd test/native_test`. 2. Run `dart build_test_dylib.dart`. -Run tests from the root of the package with `pub run test`. +Run tests from the root of the package with `dart run test`. > Note: If llvm is not installed in one of the default locations, tests may fail. ## FAQ ### Can ffigen be used for removing underscores or renaming declarations? @@ -449,7 +449,7 @@ Note: exclude overrides include. ### How does ffigen handle C Strings? Ffigen treats `char*` just as any other pointer,(`Pointer`). -To convert these to/from `String`, you can use [package:ffi](https://pub.dev/packages/ffi) and use `Utf8.fromUtf8(ptr.cast())` to convert `char*` to dart `string`. +To convert these to/from `String`, you can use [package:ffi](https://pub.dev/packages/ffi). Use `ptr.cast().toDartString()` to convert `char*` to dart `string` and `"str".toNativeUtf8()` to convert `string` to `char*`. ### How does ffigen handle C99 bool data type? Although `dart:ffi` doesn't have a NativeType for `bool`, they can be implemented as `Uint8`. diff --git a/pkgs/ffigen/bin/ffigen.dart b/pkgs/ffigen/bin/ffigen.dart index cfb482cc2d..6156ed0a2e 100644 --- a/pkgs/ffigen/bin/ffigen.dart +++ b/pkgs/ffigen/bin/ffigen.dart @@ -2,7 +2,5 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. // -// TODO(128): Remove this when package can run with sound null safety. -// @dart=2.7 export 'package:ffigen/src/executables/ffigen.dart'; diff --git a/pkgs/ffigen/example/c_json/README.md b/pkgs/ffigen/example/c_json/README.md index d689ce5ace..229d65b7d8 100644 --- a/pkgs/ffigen/example/c_json/README.md +++ b/pkgs/ffigen/example/c_json/README.md @@ -15,7 +15,7 @@ make ## Generating bindings At the root of this example (`example/c_json`), run - ``` -pub run ffigen +dart run ffigen ``` This will generate bindings in a file: [cjson_generated_bindings.dart](./cjson_generated_bindings.dart) diff --git a/pkgs/ffigen/example/c_json/main.dart b/pkgs/ffigen/example/c_json/main.dart index fbd6f69f32..2774c314a6 100644 --- a/pkgs/ffigen/example/c_json/main.dart +++ b/pkgs/ffigen/example/c_json/main.dart @@ -18,7 +18,7 @@ void main() { final jsonString = File('./example.json').readAsStringSync(); // Parse this json string using our cJSON library. - final cjsonParsedJson = cjson.cJSON_Parse(Utf8.toUtf8(jsonString).cast()); + final cjsonParsedJson = cjson.cJSON_Parse(jsonString.toNativeUtf8().cast()); if (cjsonParsedJson == nullptr) { print('Error parsing cjson.'); exit(1); @@ -78,7 +78,7 @@ dynamic convertCJsonToDartObj(Pointer parsedcjson) { ptr = ptr.ref.next; } } else if (cjson.cJSON_IsString(parsedcjson.cast()) == 1) { - obj = Utf8.fromUtf8(parsedcjson.ref.valuestring.cast()); + obj = parsedcjson.ref.valuestring.cast().toDartString(); } else if (cjson.cJSON_IsNumber(parsedcjson.cast()) == 1) { obj = parsedcjson.ref.valueint == parsedcjson.ref.valuedouble ? parsedcjson.ref.valueint @@ -90,7 +90,7 @@ dynamic convertCJsonToDartObj(Pointer parsedcjson) { void _addToObj(dynamic obj, dynamic o, [Pointer? name]) { if (obj is Map) { - obj[Utf8.fromUtf8(name!)] = o; + obj[name!.toDartString()] = o; } else if (obj is List) { obj.add(o); } diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index 76e4198197..929dccfbdf 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -5,10 +5,10 @@ name: c_json_example environment: - sdk: '>=2.12.0-237.0.dev <3.0.0' + sdk: '>=2.12.0-259.9.beta <3.0.0' dependencies: - ffi: ^0.2.0-nullsafety.1 + ffi: ^1.0.0 dev_dependencies: ffigen: diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index efce0849b8..61373da296 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -5,7 +5,7 @@ name: libclang_example environment: - sdk: '>=2.12.0-237.0.dev <3.0.0' + sdk: '>=2.12.0-259.9.beta <3.0.0' dev_dependencies: ffigen: diff --git a/pkgs/ffigen/example/libclang-example/readme.md b/pkgs/ffigen/example/libclang-example/readme.md index 0b8da390ad..dab0bdf3cc 100644 --- a/pkgs/ffigen/example/libclang-example/readme.md +++ b/pkgs/ffigen/example/libclang-example/readme.md @@ -6,6 +6,6 @@ The C header source files for libclang are in [third_party/libclang](/third_part ## Generating bindings At the root of this example (`example/libclang-example`), run - ``` -pub run ffigen +dart run ffigen ``` This will generate bindings in a file: [generated_bindings.dart](./generated_bindings.dart). diff --git a/pkgs/ffigen/example/simple/README.md b/pkgs/ffigen/example/simple/README.md index d286dab2b1..026ae9f64a 100644 --- a/pkgs/ffigen/example/simple/README.md +++ b/pkgs/ffigen/example/simple/README.md @@ -5,6 +5,6 @@ A very simple example, generates bindings for a very small header file (`headers ## Generating bindings At the root of this example (`example/simple`), run - ``` -pub run ffigen +dart run ffigen ``` This will generate bindings in a file: [generated_bindings.dart](./generated_bindings.dart). diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index d3562ef5b6..bd4585797c 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -5,7 +5,7 @@ name: simple_example environment: - sdk: '>=2.12.0-237.0.dev <3.0.0' + sdk: '>=2.12.0-259.9.beta <3.0.0' dev_dependencies: ffigen: diff --git a/pkgs/ffigen/lib/src/README.md b/pkgs/ffigen/lib/src/README.md index cdfc01a796..7564006dfc 100644 --- a/pkgs/ffigen/lib/src/README.md +++ b/pkgs/ffigen/lib/src/README.md @@ -17,7 +17,7 @@ The config file for generating bindings is `tool/libclang_config.yaml`. The bindings are generated to `lib/src/header_parser/clang_bindings/clang_bindings.dart`. These are used by [Header Parser](#header-parser) for calling libclang functions. # Scripts ## ffigen.dart -This is the main entry point for the user- `pub run ffigen`. +This is the main entry point for the user- `dart run ffigen`. - Command-line options: - `--verbose`: Sets log level. - `--config`: Specifies a config file. diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index 139ef4fa5a..fd1644644b 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -7,7 +7,6 @@ import 'dart:io'; import 'package:cli_util/cli_util.dart'; import 'package:logging/logging.dart'; import 'package:path/path.dart' as p; -import 'package:pub_semver/pub_semver.dart'; import 'binding.dart'; import 'utils.dart'; import 'writer.dart'; @@ -97,17 +96,9 @@ class Library { /// Formats a file using `dartfmt`. void _dartFmt(String path) { final sdkPath = getSdkPath(); - final versionAtleast2dot10 = Version.parse( - File(p.join(sdkPath, 'version')).readAsStringSync().trim()) >= - Version(2, 10, 0); - - /// Starting from version `>=2.10.0` the dart sdk has a unified `dart` tool - /// So we call `dart format` instead of `dartfmt`. - final result = versionAtleast2dot10 - ? Process.runSync(p.join(sdkPath, 'bin', 'dart'), ['format', path], - runInShell: Platform.isWindows) - : Process.runSync(p.join(sdkPath, 'bin', 'dartfmt'), ['-w', path], - runInShell: Platform.isWindows); + final result = Process.runSync( + p.join(sdkPath, 'bin', 'dart'), ['format', path], + runInShell: Platform.isWindows); if (result.stderr.toString().isNotEmpty) { _logger.severe(result.stderr); throw FormatException('Unable to format generated file: $path.'); diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 6c11b344df..34f9de505e 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -92,12 +92,12 @@ class Config { late String _wrapperName; /// Doc comment for the wrapper class. - String get wrapperDocComment => _wrapperDocComment; - late String _wrapperDocComment; + String? get wrapperDocComment => _wrapperDocComment; + String? _wrapperDocComment; /// Header of the generated bindings. - String get preamble => _preamble; - late String _preamble; + String? get preamble => _preamble; + String? _preamble; /// If `Dart_Handle` should be mapped with Handle/Object. bool get useDartHandle => _useDartHandle; @@ -314,13 +314,13 @@ class Config { extractor: stringExtractor, defaultValue: () => null, extractedResult: (dynamic result) => - _wrapperDocComment = result as String, + _wrapperDocComment = result as String?, ), - strings.preamble: Specification( + strings.preamble: Specification( requirement: Requirement.no, validator: nonEmptyStringValidator, extractor: stringExtractor, - extractedResult: (dynamic result) => _preamble = result as String, + extractedResult: (dynamic result) => _preamble = result as String?, ), strings.useDartHandle: Specification( requirement: Requirement.no, diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 839333aea3..d377c9549e 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -5,6 +5,7 @@ import 'dart:io'; import 'package:ffigen/src/code_generator.dart'; +import 'package:file/local.dart'; import 'package:glob/glob.dart'; import 'package:logging/logging.dart'; import 'package:path/path.dart' as p; @@ -122,7 +123,8 @@ Headers headersExtractor(dynamic yamlConfig) { _logger.fine('Adding header/file: $headerGlob'); } else { final glob = Glob(headerGlob); - for (final file in glob.listSync(followLinks: true)) { + for (final file in glob.listFileSystemSync(const LocalFileSystem(), + followLinks: true)) { final fixedPath = _replaceSeparators(file.path); entryPoints.add(fixedPath); _logger.fine('Adding header/file: ${fixedPath}'); diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index 2ce1cb9851..3d4c5f00c7 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -78,7 +78,7 @@ List parseToBindings() { final tu = clang.clang_parseTranslationUnit( index, - Utf8.toUtf8(headerLocation).cast(), + headerLocation.toNativeUtf8().cast(), clangCmdArgs.cast(), cmdLen, nullptr, diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart index 4f18ce6a6a..7d9381475d 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart @@ -65,7 +65,7 @@ List? parseSavedMacros() { cmdLen = config.compilerOpts.length; final tu = clang.clang_parseTranslationUnit( index, - Utf8.toUtf8(file.path).cast(), + file.path.toNativeUtf8().cast(), clangCmdArgs.cast(), cmdLen, nullptr, @@ -247,7 +247,7 @@ String _getWrittenRepresentation(String macroName, Pointer strPtr) { sb.clear(); // This throws a Format Exception if string isn't Utf8 so that we handle it // in the catch block. - final result = Utf8.fromUtf8(strPtr.cast()); + final result = strPtr.cast().toDartString(); for (final s in result.runes) { sb.write(_getWritableChar(s)); } @@ -257,7 +257,7 @@ String _getWrittenRepresentation(String macroName, Pointer strPtr) { _logger.warning( "Couldn't decode Macro string '$macroName' as Utf8, using ASCII instead."); sb.clear(); - final length = Utf8.strlen(strPtr.cast()); + final length = strPtr.cast().length; final charList = Uint8List.view( strPtr.cast().asTypedList(length).buffer, 0, length); diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index 28ca657544..915d4b7d50 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -52,7 +52,7 @@ void logTuDiagnostics( extension CXSourceRangeExt on Pointer { void dispose() { - free(this); + calloc.free(this); } } @@ -100,19 +100,19 @@ extension CXCursorExt on clang_types.CXCursor { String sourceFileName() { final cxsource = clang.clang_getCursorLocation(this); - final cxfilePtr = allocate>(); - final line = allocate(); - final column = allocate(); - final offset = allocate(); + final cxfilePtr = calloc>(); + final line = calloc(); + final column = calloc(); + final offset = calloc(); // Puts the values in these pointers. clang.clang_getFileLocation(cxsource, cxfilePtr, line, column, offset); final s = clang.clang_getFileName(cxfilePtr.value).toStringAndDispose(); - free(cxfilePtr); - free(line); - free(column); - free(offset); + calloc.free(cxfilePtr); + calloc.free(line); + calloc.free(column); + calloc.free(offset); return s; } } @@ -241,7 +241,7 @@ extension CXStringExt on clang_types.CXString { String string() { final cstring = clang.clang_getCString(this); if (cstring != nullptr) { - return Utf8.fromUtf8(cstring.cast()); + return cstring.cast().toDartString(); } else { return ''; } @@ -262,10 +262,10 @@ extension CXStringExt on clang_types.CXString { /// Converts a [List] to [Pointer>]. Pointer> createDynamicStringArray(List list) { - final nativeCmdArgs = allocate>(count: list.length); + final nativeCmdArgs = calloc>(list.length); for (var i = 0; i < list.length; i++) { - nativeCmdArgs[i] = Utf8.toUtf8(list[i]); + nativeCmdArgs[i] = list[i].toNativeUtf8(); } return nativeCmdArgs; @@ -275,9 +275,9 @@ extension DynamicCStringArray on Pointer> { // Properly disposes a Pointer, ensure that sure length is correct. void dispose(int length) { for (var i = 0; i < length; i++) { - free(this[i]); + calloc.free(this[i]); } - free(this); + calloc.free(this); } } diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index e8501c0ca8..ccb3e8b503 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,24 +3,24 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.0.0-dev.6 +version: 2.0.1 homepage: https://github.com/dart-lang/ffigen -description: Experimental generator for FFI bindings, using LibClang to parse C header files. +description: Generator for FFI bindings, using LibClang to parse C header files. environment: - sdk: '>=2.12.0-237.0.dev <3.0.0' + sdk: '>=2.12.0-259.9.beta <3.0.0' dependencies: - ffi: ^0.2.0-nullsafety.1 - yaml: ^3.0.0-nullsafety.0 - path: ^1.8.0-nullsafety.3 - quiver: ^3.0.0-nullsafety.2 - args: ^1.6.0 # Not available - logging: ^0.11.4 # test->coverage->logging - cli_util: ^0.2.0 # test->analyzer->cli_util - glob: ^1.0.3 # test->analyzer->glob - pub_semver: ^1.4.4 # test->analyzer->pub_semver + ffi: ^1.0.0 + yaml: ^3.0.0 + path: ^1.8.0 + quiver: ^3.0.0 + args: ^2.0.0 + logging: ^1.0.0 + cli_util: ^0.3.0 + glob: ^2.0.0 + file: ^6.0.0 dev_dependencies: - pedantic: ^1.10.0-nullsafety.3 - test: ^1.16.0-nullsafety.13 + pedantic: ^1.10.0 + test: ^1.16.2 diff --git a/pkgs/ffigen/test/native_test/config.yaml b/pkgs/ffigen/test/native_test/config.yaml index 2b2ded28cd..393351800b 100644 --- a/pkgs/ffigen/test/native_test/config.yaml +++ b/pkgs/ffigen/test/native_test/config.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. # =================== GENERATING TEST BINDINGS ================== -# pub run ffigen --config test/native_test/config.yaml +# dart run ffigen --config test/native_test/config.yaml # =============================================================== name: NativeLibrary diff --git a/pkgs/ffigen/tool/coverage.sh b/pkgs/ffigen/tool/coverage.sh index d43016d0d6..7cecbfefbb 100755 --- a/pkgs/ffigen/tool/coverage.sh +++ b/pkgs/ffigen/tool/coverage.sh @@ -8,12 +8,12 @@ set -e # Gather coverage. -pub global activate remove_from_coverage -pub global activate coverage +dart pub global activate remove_from_coverage +dart pub global activate coverage # Generate coverage report. -dart --no-sound-null-safety --pause-isolates-on-exit --disable-service-auth-codes --enable-vm-service=3000 test/test_coverage.dart & +dart --pause-isolates-on-exit --disable-service-auth-codes --enable-vm-service=3000 test/test_coverage.dart & dart pub global run coverage:collect_coverage --wait-paused --uri=http://127.0.0.1:3000/ -o coverage.json --resume-isolates dart pub global run coverage:format_coverage --lcov -i coverage.json -o lcov.info # Remove extra files from coverage report. -pub global run remove_from_coverage -f lcov.info -r ".pub-cache" +dart pub global run remove_from_coverage -f lcov.info -r ".pub-cache" diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index c27f17c49f..178aa97838 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -6,7 +6,7 @@ # ===================== GENERATING BINDINGS ===================== # cd to project's root, and run - -# pub run ffigen --config tool/libclang_config.yaml +# dart run ffigen --config tool/libclang_config.yaml # =============================================================== name: Clang From d1a04a04ead5e541833f76074530025d1ac879ab Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Tue, 2 Mar 2021 03:11:17 -0800 Subject: [PATCH 065/276] [ffigen] Fixes for `const` in name error, unnamed inline structs and empty structs. (#169) * Fix windows issues * Added test for unnamed struct * Fix error due to const function pointer in structs * Mark empty struct as incomplete, mark struct with array of incomplete struct as incomplete. --- pkgs/ffigen/CHANGELOG.md | 4 + .../example/libclang-example/pubspec.yaml | 2 +- pkgs/ffigen/lib/src/code_generator/type.dart | 10 +- .../clang_bindings/clang_bindings.dart | 21 ++++ .../sub_parsers/structdecl_parser.dart | 30 ++++-- .../header_parser/sub_parsers/var_parser.dart | 3 +- .../type_extractor/cxtypekindmap.dart | 4 +- .../type_extractor/extractor.dart | 17 +-- pkgs/ffigen/lib/src/strings.dart | 2 +- pkgs/ffigen/pubspec.yaml | 2 +- .../example_tests/libclang_example_test.dart | 2 +- ...expected_native_func_typedef_bindings.dart | 78 ++++++++++++++ .../header_parser_tests/native_func_typedef.h | 5 + .../native_func_typedef_test.dart | 101 ++---------------- .../test/header_parser_tests/nested_parsing.h | 26 +++++ .../nested_parsing_test.dart | 42 +++++++- pkgs/ffigen/test/native_test/native_test.def | 3 + pkgs/ffigen/tool/libclang_config.yaml | 3 +- 18 files changed, 233 insertions(+), 122 deletions(-) create mode 100644 pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 4ab98d44e2..cfb41c4349 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.0.2 +- Fixed illegal use of `const` in name, crash due to unnamed inline structs and +structs having `Opaque` members. + # 2.0.1 - Switch to preview release of `package:quiver`. diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index 61373da296..2f64d88139 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -27,7 +27,7 @@ ffigen: - '**CXString.h' - '**Index.h' - compiler-opts: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -I/usr/lib/llvm-11/include/ -IC:\Progra~1\LLVM\include -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' + compiler-opts: '-Ithird_party/libclang/include -IC:\Progra~1\LLVM\include -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' functions: include: - 'clang_.*' # Can be a regexp, '.' matches any character. diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index f6e5001f40..c732e15217 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -100,13 +100,13 @@ class Type { factory Type.pointer(Type child) { return Type._(broadType: BroadType.Pointer, child: child); } - factory Type.struct(Struc? struc) { + factory Type.struct(Struc struc) { return Type._(broadType: BroadType.Struct, struc: struc); } - factory Type.nativeFunc(Typedef? nativeFunc) { + factory Type.nativeFunc(Typedef nativeFunc) { return Type._(broadType: BroadType.NativeFunction, nativeFunc: nativeFunc); } - factory Type.nativeType(SupportedNativeType? nativeType) { + factory Type.nativeType(SupportedNativeType nativeType) { return Type._(broadType: BroadType.NativeType, nativeType: nativeType); } factory Type.constantArray(int length, Type elementType) { @@ -164,7 +164,9 @@ class Type { /// Returns true if the type is a [Struc] and is incomplete. bool get isIncompleteStruct => - broadType == BroadType.Struct && struc!.isInComplete; + (broadType == BroadType.Struct && struc != null && struc!.isInComplete) || + (broadType == BroadType.ConstantArray && + getBaseArrayType().isIncompleteStruct); String getCType(Writer w) { switch (broadType) { diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index b8342177af..7cccd4a70e 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -525,6 +525,19 @@ class Clang { _dart_clang_Cursor_isFunctionInlined? _clang_Cursor_isFunctionInlined; + /// 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, @@ -2586,6 +2599,14 @@ typedef _dart_clang_Cursor_isFunctionInlined = int Function( CXCursor C, ); +typedef _c_clang_getTypedefName = CXString Function( + CXType CT, +); + +typedef _dart_clang_getTypedefName = CXString Function( + CXType CT, +); + typedef _c_clang_getPointeeType = CXType Function( CXType T, ); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index dffd5028b7..ac59f5ce6c 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -54,7 +54,17 @@ Struc? parseStructDeclaration( final structName = name ?? cursor.spelling(); if (structName.isEmpty) { - _logger.finest('unnamed structure or typedef structure declaration'); + if (ignoreFilter) { + // This struct is defined inside some other struct and hence must be generated. + _stack.top.struc = Struc( + name: incrementalNamer.name('unnamedStruct'), + usr: structUsr, + dartDoc: getCursorDocComment(cursor), + ); + _setStructMembers(cursor); + } else { + _logger.finest('unnamed structure or typedef structure declaration'); + } } else if ((ignoreFilter || shouldIncludeStruct(structUsr, structName)) && (!bindingsIndex.isSeenStruct(structUsr))) { _logger.fine( @@ -130,7 +140,10 @@ void _setStructMembers(clang_types.CXCursor cursor) { _stack.top.struc!.members.clear(); } - _stack.top.struc!.isInComplete = _stack.top.isInComplete; + // C allow empty structs, but it's undefined behaviour at runtine. So we need + // to mark a struct incomplete if it has no members. + _stack.top.struc!.isInComplete = + _stack.top.isInComplete || _stack.top.struc!.members.isEmpty; } /// Visitor for the struct cursor [CXCursorKind.CXCursor_StructDecl]. @@ -145,18 +158,21 @@ int _structMembersVisitor(clang_types.CXCursor cursor, final mt = cursor.type().toCodeGenType(); if (mt.broadType == BroadType.ConstantArray) { _stack.top.arrayMember = true; - } else if (mt.broadType == BroadType.IncompleteArray) { + } + if (mt.broadType == BroadType.IncompleteArray) { // TODO(68): Structs with flexible Array Members are not supported. _stack.top.flexibleArrayMember = true; - } else if (clang.clang_getFieldDeclBitWidth(cursor) != -1) { + } + if (clang.clang_getFieldDeclBitWidth(cursor) != -1) { // TODO(84): Struct with bitfields are not suppoorted. _stack.top.bitFieldMember = true; - } else if (mt.broadType == BroadType.Handle) { + } + if (mt.broadType == BroadType.Handle) { _stack.top.dartHandleMember = true; - } else if (mt.isIncompleteStruct) { + } + if (mt.isIncompleteStruct) { _stack.top.incompleteStructMember = true; } - if (mt.getBaseType().broadType == BroadType.Unimplemented) { _stack.top.unimplementedMemberType = true; } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart index d0248ec29d..a19c4b21ec 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart @@ -27,8 +27,7 @@ Global? parseVarDeclaration(clang_types.CXCursor cursor) { _logger.fine('++++ Adding Global: ${cursor.completeStringRepr()}'); final type = cursor.type().toCodeGenType(); - if (type.getBaseType().broadType == BroadType.Unimplemented || - type.getBaseType().isIncompleteStruct) { + if (type.getBaseType().broadType == BroadType.Unimplemented) { _logger.fine( '---- Removed Global, reason: unsupported type: ${cursor.completeStringRepr()}'); _logger.warning("Skipped global variable '$name', type not supported."); diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart index 1ecfdb3c40..0fe81aa134 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart @@ -27,8 +27,8 @@ var cxTypeKindToSupportedNativeTypes = { clang.CXTypeKind.CXType_Enum: SupportedNativeType.Int32, }; -SupportedNativeType? get enumNativeType => - cxTypeKindToSupportedNativeTypes[clang.CXTypeKind.CXType_Enum]; +SupportedNativeType get enumNativeType => + cxTypeKindToSupportedNativeTypes[clang.CXTypeKind.CXType_Enum]!; var suportedTypedefToSuportedNativeType = { 'uint8_t': SupportedNativeType.Uint8, diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index e216d02aa8..46d6a41b46 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -35,16 +35,17 @@ Type getCodeGenType(clang_types.CXType cxtype, {String? parentName}) { } return Type.pointer(s); case clang_types.CXTypeKind.CXType_Typedef: - final spelling = cxtype.spelling(); + final spelling = clang.clang_getTypedefName(cxtype).toStringAndDispose(); if (config.typedefNativeTypeMappings.containsKey(spelling)) { _logger.fine(' Type Mapped from typedef-map'); - return Type.nativeType(config.typedefNativeTypeMappings[spelling]); + return Type.nativeType(config.typedefNativeTypeMappings[spelling]!); } // Get name from supported typedef name if config allows. if (config.useSupportedTypedefs) { if (suportedTypedefToSuportedNativeType.containsKey(spelling)) { _logger.fine(' Type Mapped from supported typedef'); - return Type.nativeType(suportedTypedefToSuportedNativeType[spelling]); + return Type.nativeType( + suportedTypedefToSuportedNativeType[spelling]!); } } @@ -52,7 +53,7 @@ Type getCodeGenType(clang_types.CXType cxtype, {String? parentName}) { final ct = clang.clang_getTypedefDeclUnderlyingType( clang.clang_getTypeDeclaration(cxtype)); - final s = getCodeGenType(ct, parentName: parentName ?? cxtype.spelling()); + final s = getCodeGenType(ct, parentName: parentName ?? spelling); return s; case clang_types.CXTypeKind.CXType_Elaborated: final et = clang.clang_Type_getNamedType(cxtype); @@ -86,7 +87,7 @@ Type getCodeGenType(clang_types.CXType cxtype, {String? parentName}) { default: if (cxTypeKindToSupportedNativeTypes.containsKey(kind)) { return Type.nativeType( - cxTypeKindToSupportedNativeTypes[kind], + cxTypeKindToSupportedNativeTypes[kind]!, ); } else { _logger.fine( @@ -113,11 +114,11 @@ Type _extractfromRecord(clang_types.CXType cxtype, String? parentName) { // Also add a struct binding, if its unseen. // TODO(23): Check if we should auto add struct. if (bindingsIndex.isSeenStruct(structUsr)) { - type = Type.struct(bindingsIndex.getSeenStruct(structUsr)); + type = Type.struct(bindingsIndex.getSeenStruct(structUsr)!); } else { final struc = parseStructDeclaration(cursor, name: structName, ignoreFilter: true); - type = Type.struct(struc); + type = Type.struct(struc!); // Add to bindings if it's not Dart_Handle. if (!(config.useDartHandle && structUsr == strings.dartHandleUsr)) { @@ -176,5 +177,5 @@ Type _extractFromFunctionProto(clang_types.CXType cxtype, String? parentName) { } } - return Type.nativeFunc(typedefC); + return Type.nativeFunc(typedefC!); } diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 99e0c680dc..d5041aa211 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -132,7 +132,7 @@ const linuxDylibLocations = [ '/usr/lib/llvm-11/lib/' ]; const windowsDylibLocations = [ - r'C:\Program Files\LLVM\lib', + r'C:\Program Files\LLVM\bin\', ]; const macOsDylibLocations = [ '/usr/local/opt/llvm/lib/', diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index ccb3e8b503..bdc549d8e1 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.0.1 +version: 2.0.2 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/example_tests/libclang_example_test.dart b/pkgs/ffigen/test/example_tests/libclang_example_test.dart index dba380d3cb..f047376216 100644 --- a/pkgs/ffigen/test/example_tests/libclang_example_test.dart +++ b/pkgs/ffigen/test/example_tests/libclang_example_test.dart @@ -27,7 +27,7 @@ ${strings.headers}: - '**CXString.h' - '**Index.h' -${strings.compilerOpts}: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -I/usr/lib/llvm-11/include/ -IC:\Progra~1\LLVM\include -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' +${strings.compilerOpts}: '-Ithird_party/libclang/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' ${strings.functions}: ${strings.include}: - 'clang_.*' diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart new file mode 100644 index 0000000000..22e60da55a --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart @@ -0,0 +1,78 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Unnamed Enums Test +class NativeLibrary { + /// Holds the Dynamic library. + final ffi.DynamicLibrary _dylib; + + /// The symbols are looked up in [dynamicLibrary]. + NativeLibrary(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + + void func( + ffi.Pointer> unnamed1, + ) { + return (_func ??= _dylib.lookupFunction<_c_func, _dart_func>('func'))( + unnamed1, + ); + } + + _dart_func? _func; + + void funcWithNativeFunc( + ffi.Pointer> named, + ) { + return (_funcWithNativeFunc ??= + _dylib.lookupFunction<_c_funcWithNativeFunc, _dart_funcWithNativeFunc>( + 'funcWithNativeFunc'))( + named, + ); + } + + _dart_funcWithNativeFunc? _funcWithNativeFunc; +} + +class struc extends ffi.Struct { + external ffi.Pointer> unnamed1; +} + +class Struc2 extends ffi.Struct { + external ffi.Pointer> constFuncPointer; +} + +typedef _typedefC_3 = ffi.Void Function(); + +typedef _typedefC_4 = ffi.Void Function( + ffi.Pointer>, +); + +typedef _c_func = ffi.Void Function( + ffi.Pointer> unnamed1, +); + +typedef _dart_func = void Function( + ffi.Pointer> unnamed1, +); + +typedef insideReturnType = ffi.Void Function(); + +typedef withTypedefReturnType + = ffi.Pointer> Function(); + +typedef _c_funcWithNativeFunc = ffi.Void Function( + ffi.Pointer> named, +); + +typedef _dart_funcWithNativeFunc = void Function( + ffi.Pointer> named, +); + +typedef _typedefC_1 = ffi.Void Function(); + +typedef _typedefC_2 = ffi.Void Function( + ffi.Pointer>, +); + +typedef VoidFuncPointer = ffi.Void Function(); diff --git a/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h b/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h index da2f3c0727..94bcba97b1 100644 --- a/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h +++ b/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h @@ -15,3 +15,8 @@ void funcNestedUnimplemented(void (*unnamed1)(void (*unnamed2)(long double))); typedef void (*insideReturnType)(); typedef insideReturnType (*withTypedefReturnType)(); void funcWithNativeFunc(withTypedefReturnType named); + +typedef void (*VoidFuncPointer)(); +struct Struc2{ + const VoidFuncPointer constFuncPointer; +}; diff --git a/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart index 54ef2909af..7a56d2b599 100644 --- a/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart @@ -2,8 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'dart:io'; - import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/config_provider.dart'; @@ -37,95 +35,16 @@ ${strings.headers}: }); test('Expected bindings', () { - final gen = actual.generate(); - // Writing to file for debug purpose. - final file = - File('test/debug_generated/native_func_typedef_test-output.dart'); - - try { - expect(gen, '''// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; - -/// Unnamed Enums Test -class NativeLibrary{ -/// Holds the Dynamic library. -final ffi.DynamicLibrary _dylib; - -/// The symbols are looked up in [dynamicLibrary]. -NativeLibrary(ffi.DynamicLibrary dynamicLibrary): _dylib = dynamicLibrary; - -void func( - ffi.Pointer> unnamed1, -) { -return (_func ??= _dylib.lookupFunction<_c_func,_dart_func>('func'))( - unnamed1, - ); -} -_dart_func? _func; - -void funcWithNativeFunc( - ffi.Pointer> named, -) { -return (_funcWithNativeFunc ??= _dylib.lookupFunction<_c_funcWithNativeFunc,_dart_funcWithNativeFunc>('funcWithNativeFunc'))( - named, - ); -} -_dart_funcWithNativeFunc? _funcWithNativeFunc; - -} - -class struc extends ffi.Struct{ - external ffi.Pointer> unnamed1; - -} - -typedef _typedefC_3 = ffi.Void Function( -); - -typedef _typedefC_4 = ffi.Void Function( - ffi.Pointer> , -); - -typedef _c_func = ffi.Void Function( - ffi.Pointer> unnamed1, -); - -typedef _dart_func = void Function( - ffi.Pointer> unnamed1, -); - -typedef insideReturnType = ffi.Void Function( -); - -typedef withTypedefReturnType = ffi.Pointer> Function( -); - -typedef _c_funcWithNativeFunc = ffi.Void Function( - ffi.Pointer> named, -); - -typedef _dart_funcWithNativeFunc = void Function( - ffi.Pointer> named, -); - -typedef _typedefC_1 = ffi.Void Function( -); - -typedef _typedefC_2 = ffi.Void Function( - ffi.Pointer> , -); - -'''); - if (file.existsSync()) { - file.delete(); - } - } catch (e) { - file.writeAsStringSync(gen); - print('Failed test, Debug output: ${file.absolute.path}'); - rethrow; - } + matchLibraryWithExpected(actual, [ + 'test', + 'debug_generated', + 'native_func_typedef_test_output.dart' + ], [ + 'test', + 'header_parser_tests', + 'expected_bindings', + '_expected_native_func_typedef_bindings.dart' + ]); }); }); } diff --git a/pkgs/ffigen/test/header_parser_tests/nested_parsing.h b/pkgs/ffigen/test/header_parser_tests/nested_parsing.h index 29ad832c6d..cb218252af 100644 --- a/pkgs/ffigen/test/header_parser_tests/nested_parsing.h +++ b/pkgs/ffigen/test/header_parser_tests/nested_parsing.h @@ -14,3 +14,29 @@ struct Struct1 int b; struct Struct2 *struct2; }; + +struct Struct3 +{ + int a; + // An unnamed struct. + struct + { + int a; + int b; + } b; +}; + +struct EmptyStruct{ +}; + +struct Struct4{ + int a; + // Incomplete struct inside a struct. + struct EmptyStruct b; +}; + +struct Struct5{ + int a; + // Incomplete struct array. + struct EmptyStruct b[3]; +}; diff --git a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart index 40937c8158..978b36562c 100644 --- a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart @@ -23,13 +23,13 @@ void main() { ${strings.name}: 'NativeLibrary' ${strings.description}: 'Nested Parsing Test' ${strings.output}: 'unused' - +${strings.arrayWorkaround}: true ${strings.headers}: ${strings.entryPoints}: - 'test/header_parser_tests/nested_parsing.h' ${strings.structs}: - ${strings.include}: - - Struct1 + ${strings.exclude}: + - Struct2 ''') as yaml.YamlMap), ); }); @@ -46,6 +46,18 @@ ${strings.structs}: expect(actual.getBindingAsString('Struct2'), expected.getBindingAsString('Struct2')); }); + test('Struct3', () { + expect(actual.getBindingAsString('Struct3'), + expected.getBindingAsString('Struct3')); + }); + test('Struct4', () { + expect(actual.getBindingAsString('Struct4'), + expected.getBindingAsString('Struct4')); + }); + test('Struct5', () { + expect(actual.getBindingAsString('Struct5'), + expected.getBindingAsString('Struct5')); + }); }); } @@ -60,9 +72,20 @@ Library expectedLibrary() { type: Type.nativeType(SupportedNativeType.Int32), ), ]); + final unnamedInternalStruc = Struc(name: 'unnamedStruct_1', members: [ + Member( + name: 'a', + type: Type.nativeType(SupportedNativeType.Int32), + ), + Member( + name: 'b', + type: Type.nativeType(SupportedNativeType.Int32), + ), + ]); return Library( name: 'Bindings', bindings: [ + unnamedInternalStruc, struc2, Struc(name: 'Struct1', members: [ Member( @@ -75,6 +98,19 @@ Library expectedLibrary() { ), Member(name: 'struct2', type: Type.pointer(Type.struct(struc2))), ]), + Struc(name: 'Struct3', members: [ + Member( + name: 'a', + type: Type.nativeType(SupportedNativeType.Int32), + ), + Member( + name: 'b', + type: Type.struct(unnamedInternalStruc), + ), + ]), + Struc(name: 'EmptyStruct'), + Struc(name: 'Struct4'), + Struc(name: 'Struct5'), ], ); } diff --git a/pkgs/ffigen/test/native_test/native_test.def b/pkgs/ffigen/test/native_test/native_test.def index f6853d167b..b6bf2e0b2e 100644 --- a/pkgs/ffigen/test/native_test/native_test.def +++ b/pkgs/ffigen/test/native_test/native_test.def @@ -3,6 +3,7 @@ ; BSD-style license that can be found in the LICENSE file. EXPORTS +Function1Bool Function1Uint8 Function1Uint16 Function1Uint32 @@ -15,3 +16,5 @@ Function1IntPtr Function1Float Function1Double getStruct1 +Function1StructReturnByValue +Function1StructPassByValue diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index 178aa97838..a73d5cc876 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -13,7 +13,7 @@ name: Clang description: Holds bindings to LibClang. output: 'lib/src/header_parser/clang_bindings/clang_bindings.dart' sort: true -compiler-opts: '-I/usr/lib/llvm-9/include/ -I/usr/lib/llvm-10/include/ -I/usr/lib/llvm-11/include/ -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' +compiler-opts: '-Ithird_party/libclang/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' headers: entry-points: - 'third_party/libclang/include/clang-c/Index.h' @@ -71,6 +71,7 @@ functions: - clang_getTypeSpelling - clang_getTypeKindSpelling - clang_getResultType + - clang_getTypedefName - clang_getPointeeType - clang_getCanonicalType - clang_Type_getNamedType From a34723ff16c9a6782e8430a7a3de8bcc65dfe8fb Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Wed, 3 Mar 2021 08:00:47 -0800 Subject: [PATCH 066/276] [ffigen] Ignore name of typedef struct pointer declaration, recursively create directories for output. (#172) * Do not use the name of typedef to pointer for a struct (Closes 157). * Recursively create folders for output (Closes 171). --- pkgs/ffigen/CHANGELOG.md | 4 +++ .../lib/src/code_generator/library.dart | 1 + .../sub_parsers/typedefdecl_parser.dart | 33 +++++++++++++++++-- pkgs/ffigen/pubspec.yaml | 2 +- .../ffigen/test/header_parser_tests/typedef.h | 9 +++-- .../header_parser_tests/typedef_test.dart | 1 + 6 files changed, 45 insertions(+), 5 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index cfb41c4349..366939a77f 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.0.3 +- Ignore typedef to struct pointer when possible. +- Recursively create directories for output file. + # 2.0.2 - Fixed illegal use of `const` in name, crash due to unnamed inline structs and structs having `Opaque` members. diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index fd1644644b..893289d2d6 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -87,6 +87,7 @@ class Library { /// /// If format is true(default), 'dartfmt -w $PATH' will be called to format the generated file. void generateFile(File file, {bool format = true}) { + if (!file.existsSync()) file.createSync(recursive: true); file.writeAsStringSync(generate()); if (format) { _dartFmt(file.path); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart index 57ab11c19d..7c74aecd4a 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart @@ -17,9 +17,25 @@ final _logger = Logger('ffigen.header_parser.typedefdecl_parser'); /// Holds temporary information regarding a typedef referenced [Binding] /// while parsing. +/// +/// Notes: +/// - Pointer to Typedefs structs are skipped if the struct is seen. +/// - If there are multiple typedefs for a declaration (struct/enum), the last +/// seen name is used. +/// - Typerefs are completely ignored. +/// +/// Libclang marks them as following - +/// ```C +/// typedef struct A{ +/// int a +/// } B, *pB; // Typedef(s). +/// +/// typedef A D; // Typeref. +/// ``` class _ParsedTypedef { Binding? binding; String? typedefName; + bool typedefToPointer = false; _ParsedTypedef(); } @@ -28,6 +44,12 @@ final _stack = Stack<_ParsedTypedef>(); /// Parses a typedef declaration. Binding? parseTypedefDeclaration(clang_types.CXCursor cursor) { _stack.push(_ParsedTypedef()); + + /// Check if typedef declaration is to a pointer. + _stack.top.typedefToPointer = + (clang.clang_getTypedefDeclUnderlyingType(cursor).kind == + clang_types.CXTypeKind.CXType_Pointer); + // Name of typedef. _stack.top.typedefName = cursor.spelling(); final resultCode = clang.clang_visitChildren( @@ -54,8 +76,15 @@ int _typedefdeclarationCursorVisitor(clang_types.CXCursor cursor, switch (clang.clang_getCursorKind(cursor)) { case clang_types.CXCursorKind.CXCursor_StructDecl: - _stack.top.binding = - parseStructDeclaration(cursor, name: _stack.top.typedefName); + if (_stack.top.typedefToPointer && + bindingsIndex.isSeenStruct(cursor.usr())) { + // Skip a typedef pointer if struct is seen. + _stack.top.binding = bindingsIndex.getSeenStruct(cursor.usr()); + } else { + // This will update the name of struct if already seen. + _stack.top.binding = + parseStructDeclaration(cursor, name: _stack.top.typedefName); + } break; case clang_types.CXCursorKind.CXCursor_EnumDecl: _stack.top.binding = diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index bdc549d8e1..1207053a96 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.0.2 +version: 2.0.3 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/header_parser_tests/typedef.h b/pkgs/ffigen/test/header_parser_tests/typedef.h index 68ad426f99..a8e9cd6d5b 100644 --- a/pkgs/ffigen/test/header_parser_tests/typedef.h +++ b/pkgs/ffigen/test/header_parser_tests/typedef.h @@ -40,13 +40,13 @@ void func2(NTyperef1 *); typedef enum { - a=0 + a = 0 } AnonymousEnumInTypedef; // Name from global namespace is used. typedef enum _NamedEnumInTypedef { - b=0 + b = 0 } NamedEnumInTypedef; // Should be treated as IntPtr when used. @@ -54,3 +54,8 @@ typedef char specified_type_as_IntPtr; typedef specified_type_as_IntPtr nesting_a_specified_type; void func3(specified_type_as_IntPtr, nesting_a_specified_type b); + +// Struct3 is used. `pStruct2` and `pStruct3` are ignored. +typedef struct +{ +} Struct2, Struct3, *pStruct2, *pStruct3; diff --git a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart index 182b622900..8f2abc7060 100644 --- a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart @@ -122,6 +122,7 @@ Library expectedLibrary() { ), ], ), + Struc(name: 'Struct3'), ], ); } From 8cd3d69413b86305c8c57ecc07069201a77962f8 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Wed, 3 Mar 2021 23:52:49 -0800 Subject: [PATCH 067/276] [ffigen] Support for Dynamic linking (#174) * Added .fromLookup constructor. * Enforce lint rule unnecessary_brace_in_string_interps. * Updated SDK constraints to 2.12.0 stable. --- .../ffigen/.github/workflows/test-package.yml | 4 +- pkgs/ffigen/CHANGELOG.md | 4 + pkgs/ffigen/analysis_options.yaml | 1 + .../c_json/cjson_generated_bindings.dart | 448 ++-- pkgs/ffigen/example/c_json/pubspec.yaml | 2 +- .../libclang-example/generated_bindings.dart | 2273 +++++++++------- .../example/libclang-example/pubspec.yaml | 2 +- .../example/simple/generated_bindings.dart | 33 +- pkgs/ffigen/example/simple/pubspec.yaml | 2 +- .../lib/src/code_generator/constant.dart | 2 +- .../lib/src/code_generator/enum_class.dart | 2 +- pkgs/ffigen/lib/src/code_generator/func.dart | 2 +- .../ffigen/lib/src/code_generator/global.dart | 2 +- pkgs/ffigen/lib/src/code_generator/struc.dart | 22 +- pkgs/ffigen/lib/src/code_generator/type.dart | 2 +- .../lib/src/code_generator/typedef.dart | 4 +- .../ffigen/lib/src/code_generator/writer.dart | 22 +- .../lib/src/config_provider/config.dart | 2 +- .../lib/src/config_provider/spec_utils.dart | 4 +- pkgs/ffigen/lib/src/executables/ffigen.dart | 4 +- .../clang_bindings/clang_bindings.dart | 8 +- .../sub_parsers/macro_parser.dart | 8 +- .../sub_parsers/structdecl_parser.dart | 2 +- pkgs/ffigen/pubspec.yaml | 4 +- .../_expected_boolean_dartbool_bindings.dart | 16 +- ...expected_boolean_no_dartbool_bindings.dart | 16 +- .../_expected_function_bindings.dart | 25 +- .../_expected_function_n_struct_bindings.dart | 17 +- .../_expected_global_bindings.dart | 21 +- ...internal_conflict_resolution_bindings.dart | 32 +- ...expected_native_func_typedef_bindings.dart | 21 +- .../_expected_cjson_bindings.dart | 448 ++-- .../_expected_libclang_bindings.dart | 2368 +++++++++-------- .../_expected_sqlite_bindings.dart | 1649 +++++++----- .../native_test/native_test_bindings.dart | 85 +- 35 files changed, 4183 insertions(+), 3374 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index d5e1f2d423..2ee8d6af76 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: [2.12.0-259.9.beta] # TODO(127): Revert to stable. + sdk: [2.12.0] steps: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1.0 @@ -43,7 +43,7 @@ jobs: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1.0 with: - sdk: 2.12.0-259.9.beta # TODO(127): Revert to stable. + sdk: 2.12.0 - name: Install dependencies run: dart pub get - name: Install libclang-10-dev diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 366939a77f..c1b4129f66 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.1.0 +- Added a new named constructor `NativeLibrary.fromLookup()` to support dynamic linking. +- Updated dart SDK constraints to latest stable version `2.12.0`. + # 2.0.3 - Ignore typedef to struct pointer when possible. - Recursively create directories for output file. diff --git a/pkgs/ffigen/analysis_options.yaml b/pkgs/ffigen/analysis_options.yaml index 4113a7cd2c..467460f4db 100644 --- a/pkgs/ffigen/analysis_options.yaml +++ b/pkgs/ffigen/analysis_options.yaml @@ -15,3 +15,4 @@ linter: - prefer_final_fields - prefer_final_locals - prefer_final_in_for_each + - unnecessary_brace_in_string_interps diff --git a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart index f71f586c35..19222cca86 100644 --- a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart +++ b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart @@ -25,16 +25,23 @@ import 'dart:ffi' as ffi; /// Holds bindings to cJSON. class CJson { - /// Holds the Dynamic library. - final ffi.DynamicLibrary _dylib; + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; /// The symbols are looked up in [dynamicLibrary]. - CJson(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + CJson(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + CJson.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; ffi.Pointer cJSON_Version() { return (_cJSON_Version ??= - _dylib.lookupFunction<_c_cJSON_Version, _dart_cJSON_Version>( - 'cJSON_Version'))(); + _lookup>('cJSON_Version') + .asFunction<_dart_cJSON_Version>())(); } _dart_cJSON_Version? _cJSON_Version; @@ -43,8 +50,8 @@ class CJson { ffi.Pointer hooks, ) { return (_cJSON_InitHooks ??= - _dylib.lookupFunction<_c_cJSON_InitHooks, _dart_cJSON_InitHooks>( - 'cJSON_InitHooks'))( + _lookup>('cJSON_InitHooks') + .asFunction<_dart_cJSON_InitHooks>())( hooks, ); } @@ -54,8 +61,9 @@ class CJson { ffi.Pointer cJSON_Parse( ffi.Pointer value, ) { - return (_cJSON_Parse ??= _dylib - .lookupFunction<_c_cJSON_Parse, _dart_cJSON_Parse>('cJSON_Parse'))( + return (_cJSON_Parse ??= + _lookup>('cJSON_Parse') + .asFunction<_dart_cJSON_Parse>())( value, ); } @@ -67,9 +75,10 @@ class CJson { ffi.Pointer> return_parse_end, int require_null_terminated, ) { - return (_cJSON_ParseWithOpts ??= _dylib.lookupFunction< - _c_cJSON_ParseWithOpts, - _dart_cJSON_ParseWithOpts>('cJSON_ParseWithOpts'))( + return (_cJSON_ParseWithOpts ??= + _lookup>( + 'cJSON_ParseWithOpts') + .asFunction<_dart_cJSON_ParseWithOpts>())( value, return_parse_end, require_null_terminated, @@ -81,8 +90,9 @@ class CJson { ffi.Pointer cJSON_Print( ffi.Pointer item, ) { - return (_cJSON_Print ??= _dylib - .lookupFunction<_c_cJSON_Print, _dart_cJSON_Print>('cJSON_Print'))( + return (_cJSON_Print ??= + _lookup>('cJSON_Print') + .asFunction<_dart_cJSON_Print>())( item, ); } @@ -92,9 +102,10 @@ class CJson { ffi.Pointer cJSON_PrintUnformatted( ffi.Pointer item, ) { - return (_cJSON_PrintUnformatted ??= _dylib.lookupFunction< - _c_cJSON_PrintUnformatted, - _dart_cJSON_PrintUnformatted>('cJSON_PrintUnformatted'))( + return (_cJSON_PrintUnformatted ??= + _lookup>( + 'cJSON_PrintUnformatted') + .asFunction<_dart_cJSON_PrintUnformatted>())( item, ); } @@ -106,9 +117,10 @@ class CJson { int prebuffer, int fmt, ) { - return (_cJSON_PrintBuffered ??= _dylib.lookupFunction< - _c_cJSON_PrintBuffered, - _dart_cJSON_PrintBuffered>('cJSON_PrintBuffered'))( + return (_cJSON_PrintBuffered ??= + _lookup>( + 'cJSON_PrintBuffered') + .asFunction<_dart_cJSON_PrintBuffered>())( item, prebuffer, fmt, @@ -123,9 +135,10 @@ class CJson { int length, int format, ) { - return (_cJSON_PrintPreallocated ??= _dylib.lookupFunction< - _c_cJSON_PrintPreallocated, - _dart_cJSON_PrintPreallocated>('cJSON_PrintPreallocated'))( + return (_cJSON_PrintPreallocated ??= + _lookup>( + 'cJSON_PrintPreallocated') + .asFunction<_dart_cJSON_PrintPreallocated>())( item, buffer, length, @@ -138,8 +151,9 @@ class CJson { void cJSON_Delete( ffi.Pointer item, ) { - return (_cJSON_Delete ??= _dylib - .lookupFunction<_c_cJSON_Delete, _dart_cJSON_Delete>('cJSON_Delete'))( + return (_cJSON_Delete ??= + _lookup>('cJSON_Delete') + .asFunction<_dart_cJSON_Delete>())( item, ); } @@ -150,8 +164,8 @@ class CJson { ffi.Pointer array, ) { return (_cJSON_GetArraySize ??= - _dylib.lookupFunction<_c_cJSON_GetArraySize, _dart_cJSON_GetArraySize>( - 'cJSON_GetArraySize'))( + _lookup>('cJSON_GetArraySize') + .asFunction<_dart_cJSON_GetArraySize>())( array, ); } @@ -163,8 +177,8 @@ class CJson { int index, ) { return (_cJSON_GetArrayItem ??= - _dylib.lookupFunction<_c_cJSON_GetArrayItem, _dart_cJSON_GetArrayItem>( - 'cJSON_GetArrayItem'))( + _lookup>('cJSON_GetArrayItem') + .asFunction<_dart_cJSON_GetArrayItem>())( array, index, ); @@ -176,9 +190,10 @@ class CJson { ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_GetObjectItem ??= _dylib.lookupFunction< - _c_cJSON_GetObjectItem, - _dart_cJSON_GetObjectItem>('cJSON_GetObjectItem'))( + return (_cJSON_GetObjectItem ??= + _lookup>( + 'cJSON_GetObjectItem') + .asFunction<_dart_cJSON_GetObjectItem>())( object, string, ); @@ -190,10 +205,10 @@ class CJson { ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_GetObjectItemCaseSensitive ??= _dylib.lookupFunction< - _c_cJSON_GetObjectItemCaseSensitive, - _dart_cJSON_GetObjectItemCaseSensitive>( - 'cJSON_GetObjectItemCaseSensitive'))( + return (_cJSON_GetObjectItemCaseSensitive ??= + _lookup>( + 'cJSON_GetObjectItemCaseSensitive') + .asFunction<_dart_cJSON_GetObjectItemCaseSensitive>())( object, string, ); @@ -205,9 +220,10 @@ class CJson { ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_HasObjectItem ??= _dylib.lookupFunction< - _c_cJSON_HasObjectItem, - _dart_cJSON_HasObjectItem>('cJSON_HasObjectItem'))( + return (_cJSON_HasObjectItem ??= + _lookup>( + 'cJSON_HasObjectItem') + .asFunction<_dart_cJSON_HasObjectItem>())( object, string, ); @@ -217,8 +233,8 @@ class CJson { ffi.Pointer cJSON_GetErrorPtr() { return (_cJSON_GetErrorPtr ??= - _dylib.lookupFunction<_c_cJSON_GetErrorPtr, _dart_cJSON_GetErrorPtr>( - 'cJSON_GetErrorPtr'))(); + _lookup>('cJSON_GetErrorPtr') + .asFunction<_dart_cJSON_GetErrorPtr>())(); } _dart_cJSON_GetErrorPtr? _cJSON_GetErrorPtr; @@ -226,9 +242,10 @@ class CJson { ffi.Pointer cJSON_GetStringValue( ffi.Pointer item, ) { - return (_cJSON_GetStringValue ??= _dylib.lookupFunction< - _c_cJSON_GetStringValue, - _dart_cJSON_GetStringValue>('cJSON_GetStringValue'))( + return (_cJSON_GetStringValue ??= + _lookup>( + 'cJSON_GetStringValue') + .asFunction<_dart_cJSON_GetStringValue>())( item, ); } @@ -239,8 +256,8 @@ class CJson { ffi.Pointer item, ) { return (_cJSON_IsInvalid ??= - _dylib.lookupFunction<_c_cJSON_IsInvalid, _dart_cJSON_IsInvalid>( - 'cJSON_IsInvalid'))( + _lookup>('cJSON_IsInvalid') + .asFunction<_dart_cJSON_IsInvalid>())( item, ); } @@ -251,8 +268,8 @@ class CJson { ffi.Pointer item, ) { return (_cJSON_IsFalse ??= - _dylib.lookupFunction<_c_cJSON_IsFalse, _dart_cJSON_IsFalse>( - 'cJSON_IsFalse'))( + _lookup>('cJSON_IsFalse') + .asFunction<_dart_cJSON_IsFalse>())( item, ); } @@ -262,8 +279,9 @@ class CJson { int cJSON_IsTrue( ffi.Pointer item, ) { - return (_cJSON_IsTrue ??= _dylib - .lookupFunction<_c_cJSON_IsTrue, _dart_cJSON_IsTrue>('cJSON_IsTrue'))( + return (_cJSON_IsTrue ??= + _lookup>('cJSON_IsTrue') + .asFunction<_dart_cJSON_IsTrue>())( item, ); } @@ -273,8 +291,9 @@ class CJson { int cJSON_IsBool( ffi.Pointer item, ) { - return (_cJSON_IsBool ??= _dylib - .lookupFunction<_c_cJSON_IsBool, _dart_cJSON_IsBool>('cJSON_IsBool'))( + return (_cJSON_IsBool ??= + _lookup>('cJSON_IsBool') + .asFunction<_dart_cJSON_IsBool>())( item, ); } @@ -284,8 +303,9 @@ class CJson { int cJSON_IsNull( ffi.Pointer item, ) { - return (_cJSON_IsNull ??= _dylib - .lookupFunction<_c_cJSON_IsNull, _dart_cJSON_IsNull>('cJSON_IsNull'))( + return (_cJSON_IsNull ??= + _lookup>('cJSON_IsNull') + .asFunction<_dart_cJSON_IsNull>())( item, ); } @@ -296,8 +316,8 @@ class CJson { ffi.Pointer item, ) { return (_cJSON_IsNumber ??= - _dylib.lookupFunction<_c_cJSON_IsNumber, _dart_cJSON_IsNumber>( - 'cJSON_IsNumber'))( + _lookup>('cJSON_IsNumber') + .asFunction<_dart_cJSON_IsNumber>())( item, ); } @@ -308,8 +328,8 @@ class CJson { ffi.Pointer item, ) { return (_cJSON_IsString ??= - _dylib.lookupFunction<_c_cJSON_IsString, _dart_cJSON_IsString>( - 'cJSON_IsString'))( + _lookup>('cJSON_IsString') + .asFunction<_dart_cJSON_IsString>())( item, ); } @@ -320,8 +340,8 @@ class CJson { ffi.Pointer item, ) { return (_cJSON_IsArray ??= - _dylib.lookupFunction<_c_cJSON_IsArray, _dart_cJSON_IsArray>( - 'cJSON_IsArray'))( + _lookup>('cJSON_IsArray') + .asFunction<_dart_cJSON_IsArray>())( item, ); } @@ -332,8 +352,8 @@ class CJson { ffi.Pointer item, ) { return (_cJSON_IsObject ??= - _dylib.lookupFunction<_c_cJSON_IsObject, _dart_cJSON_IsObject>( - 'cJSON_IsObject'))( + _lookup>('cJSON_IsObject') + .asFunction<_dart_cJSON_IsObject>())( item, ); } @@ -343,8 +363,9 @@ class CJson { int cJSON_IsRaw( ffi.Pointer item, ) { - return (_cJSON_IsRaw ??= _dylib - .lookupFunction<_c_cJSON_IsRaw, _dart_cJSON_IsRaw>('cJSON_IsRaw'))( + return (_cJSON_IsRaw ??= + _lookup>('cJSON_IsRaw') + .asFunction<_dart_cJSON_IsRaw>())( item, ); } @@ -353,24 +374,24 @@ class CJson { ffi.Pointer cJSON_CreateNull() { return (_cJSON_CreateNull ??= - _dylib.lookupFunction<_c_cJSON_CreateNull, _dart_cJSON_CreateNull>( - 'cJSON_CreateNull'))(); + _lookup>('cJSON_CreateNull') + .asFunction<_dart_cJSON_CreateNull>())(); } _dart_cJSON_CreateNull? _cJSON_CreateNull; ffi.Pointer cJSON_CreateTrue() { return (_cJSON_CreateTrue ??= - _dylib.lookupFunction<_c_cJSON_CreateTrue, _dart_cJSON_CreateTrue>( - 'cJSON_CreateTrue'))(); + _lookup>('cJSON_CreateTrue') + .asFunction<_dart_cJSON_CreateTrue>())(); } _dart_cJSON_CreateTrue? _cJSON_CreateTrue; ffi.Pointer cJSON_CreateFalse() { return (_cJSON_CreateFalse ??= - _dylib.lookupFunction<_c_cJSON_CreateFalse, _dart_cJSON_CreateFalse>( - 'cJSON_CreateFalse'))(); + _lookup>('cJSON_CreateFalse') + .asFunction<_dart_cJSON_CreateFalse>())(); } _dart_cJSON_CreateFalse? _cJSON_CreateFalse; @@ -379,8 +400,8 @@ class CJson { int boolean, ) { return (_cJSON_CreateBool ??= - _dylib.lookupFunction<_c_cJSON_CreateBool, _dart_cJSON_CreateBool>( - 'cJSON_CreateBool'))( + _lookup>('cJSON_CreateBool') + .asFunction<_dart_cJSON_CreateBool>())( boolean, ); } @@ -391,8 +412,8 @@ class CJson { double num, ) { return (_cJSON_CreateNumber ??= - _dylib.lookupFunction<_c_cJSON_CreateNumber, _dart_cJSON_CreateNumber>( - 'cJSON_CreateNumber'))( + _lookup>('cJSON_CreateNumber') + .asFunction<_dart_cJSON_CreateNumber>())( num, ); } @@ -403,8 +424,8 @@ class CJson { ffi.Pointer string, ) { return (_cJSON_CreateString ??= - _dylib.lookupFunction<_c_cJSON_CreateString, _dart_cJSON_CreateString>( - 'cJSON_CreateString'))( + _lookup>('cJSON_CreateString') + .asFunction<_dart_cJSON_CreateString>())( string, ); } @@ -415,8 +436,8 @@ class CJson { ffi.Pointer raw, ) { return (_cJSON_CreateRaw ??= - _dylib.lookupFunction<_c_cJSON_CreateRaw, _dart_cJSON_CreateRaw>( - 'cJSON_CreateRaw'))( + _lookup>('cJSON_CreateRaw') + .asFunction<_dart_cJSON_CreateRaw>())( raw, ); } @@ -425,16 +446,16 @@ class CJson { ffi.Pointer cJSON_CreateArray() { return (_cJSON_CreateArray ??= - _dylib.lookupFunction<_c_cJSON_CreateArray, _dart_cJSON_CreateArray>( - 'cJSON_CreateArray'))(); + _lookup>('cJSON_CreateArray') + .asFunction<_dart_cJSON_CreateArray>())(); } _dart_cJSON_CreateArray? _cJSON_CreateArray; ffi.Pointer cJSON_CreateObject() { return (_cJSON_CreateObject ??= - _dylib.lookupFunction<_c_cJSON_CreateObject, _dart_cJSON_CreateObject>( - 'cJSON_CreateObject'))(); + _lookup>('cJSON_CreateObject') + .asFunction<_dart_cJSON_CreateObject>())(); } _dart_cJSON_CreateObject? _cJSON_CreateObject; @@ -442,9 +463,10 @@ class CJson { ffi.Pointer cJSON_CreateStringReference( ffi.Pointer string, ) { - return (_cJSON_CreateStringReference ??= _dylib.lookupFunction< - _c_cJSON_CreateStringReference, - _dart_cJSON_CreateStringReference>('cJSON_CreateStringReference'))( + return (_cJSON_CreateStringReference ??= + _lookup>( + 'cJSON_CreateStringReference') + .asFunction<_dart_cJSON_CreateStringReference>())( string, ); } @@ -454,9 +476,10 @@ class CJson { ffi.Pointer cJSON_CreateObjectReference( ffi.Pointer child, ) { - return (_cJSON_CreateObjectReference ??= _dylib.lookupFunction< - _c_cJSON_CreateObjectReference, - _dart_cJSON_CreateObjectReference>('cJSON_CreateObjectReference'))( + return (_cJSON_CreateObjectReference ??= + _lookup>( + 'cJSON_CreateObjectReference') + .asFunction<_dart_cJSON_CreateObjectReference>())( child, ); } @@ -466,9 +489,10 @@ class CJson { ffi.Pointer cJSON_CreateArrayReference( ffi.Pointer child, ) { - return (_cJSON_CreateArrayReference ??= _dylib.lookupFunction< - _c_cJSON_CreateArrayReference, - _dart_cJSON_CreateArrayReference>('cJSON_CreateArrayReference'))( + return (_cJSON_CreateArrayReference ??= + _lookup>( + 'cJSON_CreateArrayReference') + .asFunction<_dart_cJSON_CreateArrayReference>())( child, ); } @@ -479,9 +503,10 @@ class CJson { ffi.Pointer numbers, int count, ) { - return (_cJSON_CreateIntArray ??= _dylib.lookupFunction< - _c_cJSON_CreateIntArray, - _dart_cJSON_CreateIntArray>('cJSON_CreateIntArray'))( + return (_cJSON_CreateIntArray ??= + _lookup>( + 'cJSON_CreateIntArray') + .asFunction<_dart_cJSON_CreateIntArray>())( numbers, count, ); @@ -493,9 +518,10 @@ class CJson { ffi.Pointer numbers, int count, ) { - return (_cJSON_CreateFloatArray ??= _dylib.lookupFunction< - _c_cJSON_CreateFloatArray, - _dart_cJSON_CreateFloatArray>('cJSON_CreateFloatArray'))( + return (_cJSON_CreateFloatArray ??= + _lookup>( + 'cJSON_CreateFloatArray') + .asFunction<_dart_cJSON_CreateFloatArray>())( numbers, count, ); @@ -507,9 +533,10 @@ class CJson { ffi.Pointer numbers, int count, ) { - return (_cJSON_CreateDoubleArray ??= _dylib.lookupFunction< - _c_cJSON_CreateDoubleArray, - _dart_cJSON_CreateDoubleArray>('cJSON_CreateDoubleArray'))( + return (_cJSON_CreateDoubleArray ??= + _lookup>( + 'cJSON_CreateDoubleArray') + .asFunction<_dart_cJSON_CreateDoubleArray>())( numbers, count, ); @@ -521,9 +548,10 @@ class CJson { ffi.Pointer> strings, int count, ) { - return (_cJSON_CreateStringArray ??= _dylib.lookupFunction< - _c_cJSON_CreateStringArray, - _dart_cJSON_CreateStringArray>('cJSON_CreateStringArray'))( + return (_cJSON_CreateStringArray ??= + _lookup>( + 'cJSON_CreateStringArray') + .asFunction<_dart_cJSON_CreateStringArray>())( strings, count, ); @@ -535,9 +563,10 @@ class CJson { ffi.Pointer array, ffi.Pointer item, ) { - return (_cJSON_AddItemToArray ??= _dylib.lookupFunction< - _c_cJSON_AddItemToArray, - _dart_cJSON_AddItemToArray>('cJSON_AddItemToArray'))( + return (_cJSON_AddItemToArray ??= + _lookup>( + 'cJSON_AddItemToArray') + .asFunction<_dart_cJSON_AddItemToArray>())( array, item, ); @@ -550,9 +579,10 @@ class CJson { ffi.Pointer string, ffi.Pointer item, ) { - return (_cJSON_AddItemToObject ??= _dylib.lookupFunction< - _c_cJSON_AddItemToObject, - _dart_cJSON_AddItemToObject>('cJSON_AddItemToObject'))( + return (_cJSON_AddItemToObject ??= + _lookup>( + 'cJSON_AddItemToObject') + .asFunction<_dart_cJSON_AddItemToObject>())( object, string, item, @@ -566,9 +596,10 @@ class CJson { ffi.Pointer string, ffi.Pointer item, ) { - return (_cJSON_AddItemToObjectCS ??= _dylib.lookupFunction< - _c_cJSON_AddItemToObjectCS, - _dart_cJSON_AddItemToObjectCS>('cJSON_AddItemToObjectCS'))( + return (_cJSON_AddItemToObjectCS ??= + _lookup>( + 'cJSON_AddItemToObjectCS') + .asFunction<_dart_cJSON_AddItemToObjectCS>())( object, string, item, @@ -581,9 +612,10 @@ class CJson { ffi.Pointer array, ffi.Pointer item, ) { - return (_cJSON_AddItemReferenceToArray ??= _dylib.lookupFunction< - _c_cJSON_AddItemReferenceToArray, - _dart_cJSON_AddItemReferenceToArray>('cJSON_AddItemReferenceToArray'))( + return (_cJSON_AddItemReferenceToArray ??= + _lookup>( + 'cJSON_AddItemReferenceToArray') + .asFunction<_dart_cJSON_AddItemReferenceToArray>())( array, item, ); @@ -596,10 +628,10 @@ class CJson { ffi.Pointer string, ffi.Pointer item, ) { - return (_cJSON_AddItemReferenceToObject ??= _dylib.lookupFunction< - _c_cJSON_AddItemReferenceToObject, - _dart_cJSON_AddItemReferenceToObject>( - 'cJSON_AddItemReferenceToObject'))( + return (_cJSON_AddItemReferenceToObject ??= + _lookup>( + 'cJSON_AddItemReferenceToObject') + .asFunction<_dart_cJSON_AddItemReferenceToObject>())( object, string, item, @@ -612,9 +644,10 @@ class CJson { ffi.Pointer parent, ffi.Pointer item, ) { - return (_cJSON_DetachItemViaPointer ??= _dylib.lookupFunction< - _c_cJSON_DetachItemViaPointer, - _dart_cJSON_DetachItemViaPointer>('cJSON_DetachItemViaPointer'))( + return (_cJSON_DetachItemViaPointer ??= + _lookup>( + 'cJSON_DetachItemViaPointer') + .asFunction<_dart_cJSON_DetachItemViaPointer>())( parent, item, ); @@ -626,9 +659,10 @@ class CJson { ffi.Pointer array, int which, ) { - return (_cJSON_DetachItemFromArray ??= _dylib.lookupFunction< - _c_cJSON_DetachItemFromArray, - _dart_cJSON_DetachItemFromArray>('cJSON_DetachItemFromArray'))( + return (_cJSON_DetachItemFromArray ??= + _lookup>( + 'cJSON_DetachItemFromArray') + .asFunction<_dart_cJSON_DetachItemFromArray>())( array, which, ); @@ -640,9 +674,10 @@ class CJson { ffi.Pointer array, int which, ) { - return (_cJSON_DeleteItemFromArray ??= _dylib.lookupFunction< - _c_cJSON_DeleteItemFromArray, - _dart_cJSON_DeleteItemFromArray>('cJSON_DeleteItemFromArray'))( + return (_cJSON_DeleteItemFromArray ??= + _lookup>( + 'cJSON_DeleteItemFromArray') + .asFunction<_dart_cJSON_DeleteItemFromArray>())( array, which, ); @@ -654,9 +689,10 @@ class CJson { ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_DetachItemFromObject ??= _dylib.lookupFunction< - _c_cJSON_DetachItemFromObject, - _dart_cJSON_DetachItemFromObject>('cJSON_DetachItemFromObject'))( + return (_cJSON_DetachItemFromObject ??= + _lookup>( + 'cJSON_DetachItemFromObject') + .asFunction<_dart_cJSON_DetachItemFromObject>())( object, string, ); @@ -668,10 +704,10 @@ class CJson { ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_DetachItemFromObjectCaseSensitive ??= _dylib.lookupFunction< - _c_cJSON_DetachItemFromObjectCaseSensitive, - _dart_cJSON_DetachItemFromObjectCaseSensitive>( - 'cJSON_DetachItemFromObjectCaseSensitive'))( + return (_cJSON_DetachItemFromObjectCaseSensitive ??= + _lookup>( + 'cJSON_DetachItemFromObjectCaseSensitive') + .asFunction<_dart_cJSON_DetachItemFromObjectCaseSensitive>())( object, string, ); @@ -684,9 +720,10 @@ class CJson { ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_DeleteItemFromObject ??= _dylib.lookupFunction< - _c_cJSON_DeleteItemFromObject, - _dart_cJSON_DeleteItemFromObject>('cJSON_DeleteItemFromObject'))( + return (_cJSON_DeleteItemFromObject ??= + _lookup>( + 'cJSON_DeleteItemFromObject') + .asFunction<_dart_cJSON_DeleteItemFromObject>())( object, string, ); @@ -698,10 +735,10 @@ class CJson { ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_DeleteItemFromObjectCaseSensitive ??= _dylib.lookupFunction< - _c_cJSON_DeleteItemFromObjectCaseSensitive, - _dart_cJSON_DeleteItemFromObjectCaseSensitive>( - 'cJSON_DeleteItemFromObjectCaseSensitive'))( + return (_cJSON_DeleteItemFromObjectCaseSensitive ??= + _lookup>( + 'cJSON_DeleteItemFromObjectCaseSensitive') + .asFunction<_dart_cJSON_DeleteItemFromObjectCaseSensitive>())( object, string, ); @@ -715,9 +752,10 @@ class CJson { int which, ffi.Pointer newitem, ) { - return (_cJSON_InsertItemInArray ??= _dylib.lookupFunction< - _c_cJSON_InsertItemInArray, - _dart_cJSON_InsertItemInArray>('cJSON_InsertItemInArray'))( + return (_cJSON_InsertItemInArray ??= + _lookup>( + 'cJSON_InsertItemInArray') + .asFunction<_dart_cJSON_InsertItemInArray>())( array, which, newitem, @@ -731,9 +769,10 @@ class CJson { ffi.Pointer item, ffi.Pointer replacement, ) { - return (_cJSON_ReplaceItemViaPointer ??= _dylib.lookupFunction< - _c_cJSON_ReplaceItemViaPointer, - _dart_cJSON_ReplaceItemViaPointer>('cJSON_ReplaceItemViaPointer'))( + return (_cJSON_ReplaceItemViaPointer ??= + _lookup>( + 'cJSON_ReplaceItemViaPointer') + .asFunction<_dart_cJSON_ReplaceItemViaPointer>())( parent, item, replacement, @@ -747,9 +786,10 @@ class CJson { int which, ffi.Pointer newitem, ) { - return (_cJSON_ReplaceItemInArray ??= _dylib.lookupFunction< - _c_cJSON_ReplaceItemInArray, - _dart_cJSON_ReplaceItemInArray>('cJSON_ReplaceItemInArray'))( + return (_cJSON_ReplaceItemInArray ??= + _lookup>( + 'cJSON_ReplaceItemInArray') + .asFunction<_dart_cJSON_ReplaceItemInArray>())( array, which, newitem, @@ -763,9 +803,10 @@ class CJson { ffi.Pointer string, ffi.Pointer newitem, ) { - return (_cJSON_ReplaceItemInObject ??= _dylib.lookupFunction< - _c_cJSON_ReplaceItemInObject, - _dart_cJSON_ReplaceItemInObject>('cJSON_ReplaceItemInObject'))( + return (_cJSON_ReplaceItemInObject ??= + _lookup>( + 'cJSON_ReplaceItemInObject') + .asFunction<_dart_cJSON_ReplaceItemInObject>())( object, string, newitem, @@ -779,10 +820,10 @@ class CJson { ffi.Pointer string, ffi.Pointer newitem, ) { - return (_cJSON_ReplaceItemInObjectCaseSensitive ??= _dylib.lookupFunction< - _c_cJSON_ReplaceItemInObjectCaseSensitive, - _dart_cJSON_ReplaceItemInObjectCaseSensitive>( - 'cJSON_ReplaceItemInObjectCaseSensitive'))( + return (_cJSON_ReplaceItemInObjectCaseSensitive ??= + _lookup>( + 'cJSON_ReplaceItemInObjectCaseSensitive') + .asFunction<_dart_cJSON_ReplaceItemInObjectCaseSensitive>())( object, string, newitem, @@ -797,8 +838,8 @@ class CJson { int recurse, ) { return (_cJSON_Duplicate ??= - _dylib.lookupFunction<_c_cJSON_Duplicate, _dart_cJSON_Duplicate>( - 'cJSON_Duplicate'))( + _lookup>('cJSON_Duplicate') + .asFunction<_dart_cJSON_Duplicate>())( item, recurse, ); @@ -812,8 +853,8 @@ class CJson { int case_sensitive, ) { return (_cJSON_Compare ??= - _dylib.lookupFunction<_c_cJSON_Compare, _dart_cJSON_Compare>( - 'cJSON_Compare'))( + _lookup>('cJSON_Compare') + .asFunction<_dart_cJSON_Compare>())( a, b, case_sensitive, @@ -825,8 +866,9 @@ class CJson { void cJSON_Minify( ffi.Pointer json, ) { - return (_cJSON_Minify ??= _dylib - .lookupFunction<_c_cJSON_Minify, _dart_cJSON_Minify>('cJSON_Minify'))( + return (_cJSON_Minify ??= + _lookup>('cJSON_Minify') + .asFunction<_dart_cJSON_Minify>())( json, ); } @@ -837,9 +879,10 @@ class CJson { ffi.Pointer object, ffi.Pointer name, ) { - return (_cJSON_AddNullToObject ??= _dylib.lookupFunction< - _c_cJSON_AddNullToObject, - _dart_cJSON_AddNullToObject>('cJSON_AddNullToObject'))( + return (_cJSON_AddNullToObject ??= + _lookup>( + 'cJSON_AddNullToObject') + .asFunction<_dart_cJSON_AddNullToObject>())( object, name, ); @@ -851,9 +894,10 @@ class CJson { ffi.Pointer object, ffi.Pointer name, ) { - return (_cJSON_AddTrueToObject ??= _dylib.lookupFunction< - _c_cJSON_AddTrueToObject, - _dart_cJSON_AddTrueToObject>('cJSON_AddTrueToObject'))( + return (_cJSON_AddTrueToObject ??= + _lookup>( + 'cJSON_AddTrueToObject') + .asFunction<_dart_cJSON_AddTrueToObject>())( object, name, ); @@ -865,9 +909,10 @@ class CJson { ffi.Pointer object, ffi.Pointer name, ) { - return (_cJSON_AddFalseToObject ??= _dylib.lookupFunction< - _c_cJSON_AddFalseToObject, - _dart_cJSON_AddFalseToObject>('cJSON_AddFalseToObject'))( + return (_cJSON_AddFalseToObject ??= + _lookup>( + 'cJSON_AddFalseToObject') + .asFunction<_dart_cJSON_AddFalseToObject>())( object, name, ); @@ -880,9 +925,10 @@ class CJson { ffi.Pointer name, int boolean, ) { - return (_cJSON_AddBoolToObject ??= _dylib.lookupFunction< - _c_cJSON_AddBoolToObject, - _dart_cJSON_AddBoolToObject>('cJSON_AddBoolToObject'))( + return (_cJSON_AddBoolToObject ??= + _lookup>( + 'cJSON_AddBoolToObject') + .asFunction<_dart_cJSON_AddBoolToObject>())( object, name, boolean, @@ -896,9 +942,10 @@ class CJson { ffi.Pointer name, double number, ) { - return (_cJSON_AddNumberToObject ??= _dylib.lookupFunction< - _c_cJSON_AddNumberToObject, - _dart_cJSON_AddNumberToObject>('cJSON_AddNumberToObject'))( + return (_cJSON_AddNumberToObject ??= + _lookup>( + 'cJSON_AddNumberToObject') + .asFunction<_dart_cJSON_AddNumberToObject>())( object, name, number, @@ -912,9 +959,10 @@ class CJson { ffi.Pointer name, ffi.Pointer string, ) { - return (_cJSON_AddStringToObject ??= _dylib.lookupFunction< - _c_cJSON_AddStringToObject, - _dart_cJSON_AddStringToObject>('cJSON_AddStringToObject'))( + return (_cJSON_AddStringToObject ??= + _lookup>( + 'cJSON_AddStringToObject') + .asFunction<_dart_cJSON_AddStringToObject>())( object, name, string, @@ -928,9 +976,10 @@ class CJson { ffi.Pointer name, ffi.Pointer raw, ) { - return (_cJSON_AddRawToObject ??= _dylib.lookupFunction< - _c_cJSON_AddRawToObject, - _dart_cJSON_AddRawToObject>('cJSON_AddRawToObject'))( + return (_cJSON_AddRawToObject ??= + _lookup>( + 'cJSON_AddRawToObject') + .asFunction<_dart_cJSON_AddRawToObject>())( object, name, raw, @@ -943,9 +992,10 @@ class CJson { ffi.Pointer object, ffi.Pointer name, ) { - return (_cJSON_AddObjectToObject ??= _dylib.lookupFunction< - _c_cJSON_AddObjectToObject, - _dart_cJSON_AddObjectToObject>('cJSON_AddObjectToObject'))( + return (_cJSON_AddObjectToObject ??= + _lookup>( + 'cJSON_AddObjectToObject') + .asFunction<_dart_cJSON_AddObjectToObject>())( object, name, ); @@ -957,9 +1007,10 @@ class CJson { ffi.Pointer object, ffi.Pointer name, ) { - return (_cJSON_AddArrayToObject ??= _dylib.lookupFunction< - _c_cJSON_AddArrayToObject, - _dart_cJSON_AddArrayToObject>('cJSON_AddArrayToObject'))( + return (_cJSON_AddArrayToObject ??= + _lookup>( + 'cJSON_AddArrayToObject') + .asFunction<_dart_cJSON_AddArrayToObject>())( object, name, ); @@ -971,9 +1022,10 @@ class CJson { ffi.Pointer object, double number, ) { - return (_cJSON_SetNumberHelper ??= _dylib.lookupFunction< - _c_cJSON_SetNumberHelper, - _dart_cJSON_SetNumberHelper>('cJSON_SetNumberHelper'))( + return (_cJSON_SetNumberHelper ??= + _lookup>( + 'cJSON_SetNumberHelper') + .asFunction<_dart_cJSON_SetNumberHelper>())( object, number, ); @@ -984,8 +1036,9 @@ class CJson { ffi.Pointer cJSON_malloc( int size, ) { - return (_cJSON_malloc ??= _dylib - .lookupFunction<_c_cJSON_malloc, _dart_cJSON_malloc>('cJSON_malloc'))( + return (_cJSON_malloc ??= + _lookup>('cJSON_malloc') + .asFunction<_dart_cJSON_malloc>())( size, ); } @@ -996,7 +1049,8 @@ class CJson { ffi.Pointer object, ) { return (_cJSON_free ??= - _dylib.lookupFunction<_c_cJSON_free, _dart_cJSON_free>('cJSON_free'))( + _lookup>('cJSON_free') + .asFunction<_dart_cJSON_free>())( object, ); } diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index 929dccfbdf..5bce972a5b 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -5,7 +5,7 @@ name: c_json_example environment: - sdk: '>=2.12.0-259.9.beta <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: ffi: ^1.0.0 diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index 330c63f1b7..d90bcd9788 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -10,19 +10,26 @@ import 'dart:ffi' as ffi; /// Holds bindings to LibClang. class LibClang { - /// Holds the Dynamic library. - final ffi.DynamicLibrary _dylib; + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; /// The symbols are looked up in [dynamicLibrary]. - LibClang(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + LibClang(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + LibClang.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; /// 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'))( + _lookup>('clang_getCString') + .asFunction<_dart_clang_getCString>())( string, ); } @@ -33,9 +40,10 @@ class LibClang { void clang_disposeString( CXString string, ) { - return (_clang_disposeString ??= _dylib.lookupFunction< - _c_clang_disposeString, - _dart_clang_disposeString>('clang_disposeString'))( + return (_clang_disposeString ??= + _lookup>( + 'clang_disposeString') + .asFunction<_dart_clang_disposeString>())( string, ); } @@ -46,9 +54,10 @@ class LibClang { void clang_disposeStringSet( ffi.Pointer set_1, ) { - return (_clang_disposeStringSet ??= _dylib.lookupFunction< - _c_clang_disposeStringSet, - _dart_clang_disposeStringSet>('clang_disposeStringSet'))( + return (_clang_disposeStringSet ??= + _lookup>( + 'clang_disposeStringSet') + .asFunction<_dart_clang_disposeStringSet>())( set_1, ); } @@ -98,8 +107,8 @@ class LibClang { int displayDiagnostics, ) { return (_clang_createIndex ??= - _dylib.lookupFunction<_c_clang_createIndex, _dart_clang_createIndex>( - 'clang_createIndex'))( + _lookup>('clang_createIndex') + .asFunction<_dart_clang_createIndex>())( excludeDeclarationsFromPCH, displayDiagnostics, ); @@ -115,8 +124,8 @@ class LibClang { ffi.Pointer index, ) { return (_clang_disposeIndex ??= - _dylib.lookupFunction<_c_clang_disposeIndex, _dart_clang_disposeIndex>( - 'clang_disposeIndex'))( + _lookup>('clang_disposeIndex') + .asFunction<_dart_clang_disposeIndex>())( index, ); } @@ -138,10 +147,10 @@ class LibClang { ffi.Pointer arg0, int options, ) { - return (_clang_CXIndex_setGlobalOptions ??= _dylib.lookupFunction< - _c_clang_CXIndex_setGlobalOptions, - _dart_clang_CXIndex_setGlobalOptions>( - 'clang_CXIndex_setGlobalOptions'))( + return (_clang_CXIndex_setGlobalOptions ??= + _lookup>( + 'clang_CXIndex_setGlobalOptions') + .asFunction<_dart_clang_CXIndex_setGlobalOptions>())( arg0, options, ); @@ -156,10 +165,10 @@ class LibClang { int clang_CXIndex_getGlobalOptions( ffi.Pointer arg0, ) { - return (_clang_CXIndex_getGlobalOptions ??= _dylib.lookupFunction< - _c_clang_CXIndex_getGlobalOptions, - _dart_clang_CXIndex_getGlobalOptions>( - 'clang_CXIndex_getGlobalOptions'))( + return (_clang_CXIndex_getGlobalOptions ??= + _lookup>( + 'clang_CXIndex_getGlobalOptions') + .asFunction<_dart_clang_CXIndex_getGlobalOptions>())( arg0, ); } @@ -175,10 +184,11 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer Path, ) { - return (_clang_CXIndex_setInvocationEmissionPathOption ??= - _dylib.lookupFunction<_c_clang_CXIndex_setInvocationEmissionPathOption, - _dart_clang_CXIndex_setInvocationEmissionPathOption>( - 'clang_CXIndex_setInvocationEmissionPathOption'))( + return (_clang_CXIndex_setInvocationEmissionPathOption ??= _lookup< + ffi.NativeFunction< + _c_clang_CXIndex_setInvocationEmissionPathOption>>( + 'clang_CXIndex_setInvocationEmissionPathOption') + .asFunction<_dart_clang_CXIndex_setInvocationEmissionPathOption>())( arg0, Path, ); @@ -192,8 +202,8 @@ class LibClang { ffi.Pointer SFile, ) { return (_clang_getFileName ??= - _dylib.lookupFunction<_c_clang_getFileName, _dart_clang_getFileName>( - 'clang_getFileName'))( + _lookup>('clang_getFileName') + .asFunction<_dart_clang_getFileName>())( SFile, ); } @@ -205,8 +215,8 @@ class LibClang { ffi.Pointer SFile, ) { return (_clang_getFileTime ??= - _dylib.lookupFunction<_c_clang_getFileTime, _dart_clang_getFileTime>( - 'clang_getFileTime'))( + _lookup>('clang_getFileTime') + .asFunction<_dart_clang_getFileTime>())( SFile, ); } @@ -223,9 +233,10 @@ class LibClang { ffi.Pointer file, ffi.Pointer outID, ) { - return (_clang_getFileUniqueID ??= _dylib.lookupFunction< - _c_clang_getFileUniqueID, - _dart_clang_getFileUniqueID>('clang_getFileUniqueID'))( + return (_clang_getFileUniqueID ??= + _lookup>( + 'clang_getFileUniqueID') + .asFunction<_dart_clang_getFileUniqueID>())( file, outID, ); @@ -240,10 +251,10 @@ class LibClang { ffi.Pointer tu, ffi.Pointer file, ) { - return (_clang_isFileMultipleIncludeGuarded ??= _dylib.lookupFunction< - _c_clang_isFileMultipleIncludeGuarded, - _dart_clang_isFileMultipleIncludeGuarded>( - 'clang_isFileMultipleIncludeGuarded'))( + return (_clang_isFileMultipleIncludeGuarded ??= + _lookup>( + 'clang_isFileMultipleIncludeGuarded') + .asFunction<_dart_clang_isFileMultipleIncludeGuarded>())( tu, file, ); @@ -264,8 +275,8 @@ class LibClang { ffi.Pointer file_name, ) { return (_clang_getFile ??= - _dylib.lookupFunction<_c_clang_getFile, _dart_clang_getFile>( - 'clang_getFile'))( + _lookup>('clang_getFile') + .asFunction<_dart_clang_getFile>())( tu, file_name, ); @@ -288,9 +299,10 @@ class LibClang { ffi.Pointer file, ffi.Pointer size, ) { - return (_clang_getFileContents ??= _dylib.lookupFunction< - _c_clang_getFileContents, - _dart_clang_getFileContents>('clang_getFileContents'))( + return (_clang_getFileContents ??= + _lookup>( + 'clang_getFileContents') + .asFunction<_dart_clang_getFileContents>())( tu, file, size, @@ -306,8 +318,8 @@ class LibClang { ffi.Pointer file2, ) { return (_clang_File_isEqual ??= - _dylib.lookupFunction<_c_clang_File_isEqual, _dart_clang_File_isEqual>( - 'clang_File_isEqual'))( + _lookup>('clang_File_isEqual') + .asFunction<_dart_clang_File_isEqual>())( file1, file2, ); @@ -321,9 +333,10 @@ class LibClang { CXString clang_File_tryGetRealPathName( ffi.Pointer file, ) { - return (_clang_File_tryGetRealPathName ??= _dylib.lookupFunction< - _c_clang_File_tryGetRealPathName, - _dart_clang_File_tryGetRealPathName>('clang_File_tryGetRealPathName'))( + return (_clang_File_tryGetRealPathName ??= + _lookup>( + 'clang_File_tryGetRealPathName') + .asFunction<_dart_clang_File_tryGetRealPathName>())( file, ); } @@ -332,9 +345,10 @@ class LibClang { /// Retrieve a NULL (invalid) source location. CXSourceLocation clang_getNullLocation() { - return (_clang_getNullLocation ??= _dylib.lookupFunction< - _c_clang_getNullLocation, - _dart_clang_getNullLocation>('clang_getNullLocation'))(); + return (_clang_getNullLocation ??= + _lookup>( + 'clang_getNullLocation') + .asFunction<_dart_clang_getNullLocation>())(); } _dart_clang_getNullLocation? _clang_getNullLocation; @@ -349,9 +363,10 @@ class LibClang { CXSourceLocation loc1, CXSourceLocation loc2, ) { - return (_clang_equalLocations ??= _dylib.lookupFunction< - _c_clang_equalLocations, - _dart_clang_equalLocations>('clang_equalLocations'))( + return (_clang_equalLocations ??= + _lookup>( + 'clang_equalLocations') + .asFunction<_dart_clang_equalLocations>())( loc1, loc2, ); @@ -368,8 +383,8 @@ class LibClang { int column, ) { return (_clang_getLocation ??= - _dylib.lookupFunction<_c_clang_getLocation, _dart_clang_getLocation>( - 'clang_getLocation'))( + _lookup>('clang_getLocation') + .asFunction<_dart_clang_getLocation>())( tu, file, line, @@ -386,9 +401,10 @@ class LibClang { ffi.Pointer file, int offset, ) { - return (_clang_getLocationForOffset ??= _dylib.lookupFunction< - _c_clang_getLocationForOffset, - _dart_clang_getLocationForOffset>('clang_getLocationForOffset'))( + return (_clang_getLocationForOffset ??= + _lookup>( + 'clang_getLocationForOffset') + .asFunction<_dart_clang_getLocationForOffset>())( tu, file, offset, @@ -401,10 +417,10 @@ class LibClang { int clang_Location_isInSystemHeader( CXSourceLocation location, ) { - return (_clang_Location_isInSystemHeader ??= _dylib.lookupFunction< - _c_clang_Location_isInSystemHeader, - _dart_clang_Location_isInSystemHeader>( - 'clang_Location_isInSystemHeader'))( + return (_clang_Location_isInSystemHeader ??= + _lookup>( + 'clang_Location_isInSystemHeader') + .asFunction<_dart_clang_Location_isInSystemHeader>())( location, ); } @@ -416,9 +432,10 @@ class LibClang { int clang_Location_isFromMainFile( CXSourceLocation location, ) { - return (_clang_Location_isFromMainFile ??= _dylib.lookupFunction< - _c_clang_Location_isFromMainFile, - _dart_clang_Location_isFromMainFile>('clang_Location_isFromMainFile'))( + return (_clang_Location_isFromMainFile ??= + _lookup>( + 'clang_Location_isFromMainFile') + .asFunction<_dart_clang_Location_isFromMainFile>())( location, ); } @@ -428,8 +445,8 @@ class LibClang { /// Retrieve a NULL (invalid) source range. CXSourceRange clang_getNullRange() { return (_clang_getNullRange ??= - _dylib.lookupFunction<_c_clang_getNullRange, _dart_clang_getNullRange>( - 'clang_getNullRange'))(); + _lookup>('clang_getNullRange') + .asFunction<_dart_clang_getNullRange>())(); } _dart_clang_getNullRange? _clang_getNullRange; @@ -441,8 +458,8 @@ class LibClang { CXSourceLocation end, ) { return (_clang_getRange ??= - _dylib.lookupFunction<_c_clang_getRange, _dart_clang_getRange>( - 'clang_getRange'))( + _lookup>('clang_getRange') + .asFunction<_dart_clang_getRange>())( begin, end, ); @@ -458,8 +475,8 @@ class LibClang { CXSourceRange range2, ) { return (_clang_equalRanges ??= - _dylib.lookupFunction<_c_clang_equalRanges, _dart_clang_equalRanges>( - 'clang_equalRanges'))( + _lookup>('clang_equalRanges') + .asFunction<_dart_clang_equalRanges>())( range1, range2, ); @@ -472,8 +489,8 @@ class LibClang { CXSourceRange range, ) { return (_clang_Range_isNull ??= - _dylib.lookupFunction<_c_clang_Range_isNull, _dart_clang_Range_isNull>( - 'clang_Range_isNull'))( + _lookup>('clang_Range_isNull') + .asFunction<_dart_clang_Range_isNull>())( range, ); } @@ -507,9 +524,10 @@ class LibClang { ffi.Pointer column, ffi.Pointer offset, ) { - return (_clang_getExpansionLocation ??= _dylib.lookupFunction< - _c_clang_getExpansionLocation, - _dart_clang_getExpansionLocation>('clang_getExpansionLocation'))( + return (_clang_getExpansionLocation ??= + _lookup>( + 'clang_getExpansionLocation') + .asFunction<_dart_clang_getExpansionLocation>())( location, file, line, @@ -564,9 +582,10 @@ class LibClang { ffi.Pointer line, ffi.Pointer column, ) { - return (_clang_getPresumedLocation ??= _dylib.lookupFunction< - _c_clang_getPresumedLocation, - _dart_clang_getPresumedLocation>('clang_getPresumedLocation'))( + return (_clang_getPresumedLocation ??= + _lookup>( + 'clang_getPresumedLocation') + .asFunction<_dart_clang_getPresumedLocation>())( location, filename, line, @@ -589,10 +608,10 @@ class LibClang { ffi.Pointer column, ffi.Pointer offset, ) { - return (_clang_getInstantiationLocation ??= _dylib.lookupFunction< - _c_clang_getInstantiationLocation, - _dart_clang_getInstantiationLocation>( - 'clang_getInstantiationLocation'))( + return (_clang_getInstantiationLocation ??= + _lookup>( + 'clang_getInstantiationLocation') + .asFunction<_dart_clang_getInstantiationLocation>())( location, file, line, @@ -630,9 +649,10 @@ class LibClang { ffi.Pointer column, ffi.Pointer offset, ) { - return (_clang_getSpellingLocation ??= _dylib.lookupFunction< - _c_clang_getSpellingLocation, - _dart_clang_getSpellingLocation>('clang_getSpellingLocation'))( + return (_clang_getSpellingLocation ??= + _lookup>( + 'clang_getSpellingLocation') + .asFunction<_dart_clang_getSpellingLocation>())( location, file, line, @@ -671,9 +691,10 @@ class LibClang { ffi.Pointer column, ffi.Pointer offset, ) { - return (_clang_getFileLocation ??= _dylib.lookupFunction< - _c_clang_getFileLocation, - _dart_clang_getFileLocation>('clang_getFileLocation'))( + return (_clang_getFileLocation ??= + _lookup>( + 'clang_getFileLocation') + .asFunction<_dart_clang_getFileLocation>())( location, file, line, @@ -689,9 +710,10 @@ class LibClang { CXSourceLocation clang_getRangeStart( CXSourceRange range, ) { - return (_clang_getRangeStart ??= _dylib.lookupFunction< - _c_clang_getRangeStart, - _dart_clang_getRangeStart>('clang_getRangeStart'))( + return (_clang_getRangeStart ??= + _lookup>( + 'clang_getRangeStart') + .asFunction<_dart_clang_getRangeStart>())( range, ); } @@ -704,8 +726,8 @@ class LibClang { CXSourceRange range, ) { return (_clang_getRangeEnd ??= - _dylib.lookupFunction<_c_clang_getRangeEnd, _dart_clang_getRangeEnd>( - 'clang_getRangeEnd'))( + _lookup>('clang_getRangeEnd') + .asFunction<_dart_clang_getRangeEnd>())( range, ); } @@ -720,9 +742,10 @@ class LibClang { ffi.Pointer tu, ffi.Pointer file, ) { - return (_clang_getSkippedRanges ??= _dylib.lookupFunction< - _c_clang_getSkippedRanges, - _dart_clang_getSkippedRanges>('clang_getSkippedRanges'))( + return (_clang_getSkippedRanges ??= + _lookup>( + 'clang_getSkippedRanges') + .asFunction<_dart_clang_getSkippedRanges>())( tu, file, ); @@ -738,9 +761,10 @@ class LibClang { ffi.Pointer clang_getAllSkippedRanges( ffi.Pointer tu, ) { - return (_clang_getAllSkippedRanges ??= _dylib.lookupFunction< - _c_clang_getAllSkippedRanges, - _dart_clang_getAllSkippedRanges>('clang_getAllSkippedRanges'))( + return (_clang_getAllSkippedRanges ??= + _lookup>( + 'clang_getAllSkippedRanges') + .asFunction<_dart_clang_getAllSkippedRanges>())( tu, ); } @@ -751,9 +775,10 @@ class LibClang { void clang_disposeSourceRangeList( ffi.Pointer ranges, ) { - return (_clang_disposeSourceRangeList ??= _dylib.lookupFunction< - _c_clang_disposeSourceRangeList, - _dart_clang_disposeSourceRangeList>('clang_disposeSourceRangeList'))( + return (_clang_disposeSourceRangeList ??= + _lookup>( + 'clang_disposeSourceRangeList') + .asFunction<_dart_clang_disposeSourceRangeList>())( ranges, ); } @@ -764,9 +789,10 @@ class LibClang { int clang_getNumDiagnosticsInSet( ffi.Pointer Diags, ) { - return (_clang_getNumDiagnosticsInSet ??= _dylib.lookupFunction< - _c_clang_getNumDiagnosticsInSet, - _dart_clang_getNumDiagnosticsInSet>('clang_getNumDiagnosticsInSet'))( + return (_clang_getNumDiagnosticsInSet ??= + _lookup>( + 'clang_getNumDiagnosticsInSet') + .asFunction<_dart_clang_getNumDiagnosticsInSet>())( Diags, ); } @@ -784,9 +810,10 @@ class LibClang { ffi.Pointer Diags, int Index, ) { - return (_clang_getDiagnosticInSet ??= _dylib.lookupFunction< - _c_clang_getDiagnosticInSet, - _dart_clang_getDiagnosticInSet>('clang_getDiagnosticInSet'))( + return (_clang_getDiagnosticInSet ??= + _lookup>( + 'clang_getDiagnosticInSet') + .asFunction<_dart_clang_getDiagnosticInSet>())( Diags, Index, ); @@ -810,9 +837,10 @@ class LibClang { ffi.Pointer error, ffi.Pointer errorString, ) { - return (_clang_loadDiagnostics ??= _dylib.lookupFunction< - _c_clang_loadDiagnostics, - _dart_clang_loadDiagnostics>('clang_loadDiagnostics'))( + return (_clang_loadDiagnostics ??= + _lookup>( + 'clang_loadDiagnostics') + .asFunction<_dart_clang_loadDiagnostics>())( file, error, errorString, @@ -825,9 +853,10 @@ class LibClang { void clang_disposeDiagnosticSet( ffi.Pointer Diags, ) { - return (_clang_disposeDiagnosticSet ??= _dylib.lookupFunction< - _c_clang_disposeDiagnosticSet, - _dart_clang_disposeDiagnosticSet>('clang_disposeDiagnosticSet'))( + return (_clang_disposeDiagnosticSet ??= + _lookup>( + 'clang_disposeDiagnosticSet') + .asFunction<_dart_clang_disposeDiagnosticSet>())( Diags, ); } @@ -841,9 +870,10 @@ class LibClang { ffi.Pointer clang_getChildDiagnostics( ffi.Pointer D, ) { - return (_clang_getChildDiagnostics ??= _dylib.lookupFunction< - _c_clang_getChildDiagnostics, - _dart_clang_getChildDiagnostics>('clang_getChildDiagnostics'))( + return (_clang_getChildDiagnostics ??= + _lookup>( + 'clang_getChildDiagnostics') + .asFunction<_dart_clang_getChildDiagnostics>())( D, ); } @@ -855,9 +885,10 @@ class LibClang { int clang_getNumDiagnostics( ffi.Pointer Unit, ) { - return (_clang_getNumDiagnostics ??= _dylib.lookupFunction< - _c_clang_getNumDiagnostics, - _dart_clang_getNumDiagnostics>('clang_getNumDiagnostics'))( + return (_clang_getNumDiagnostics ??= + _lookup>( + 'clang_getNumDiagnostics') + .asFunction<_dart_clang_getNumDiagnostics>())( Unit, ); } @@ -875,9 +906,10 @@ class LibClang { ffi.Pointer Unit, int Index, ) { - return (_clang_getDiagnostic ??= _dylib.lookupFunction< - _c_clang_getDiagnostic, - _dart_clang_getDiagnostic>('clang_getDiagnostic'))( + return (_clang_getDiagnostic ??= + _lookup>( + 'clang_getDiagnostic') + .asFunction<_dart_clang_getDiagnostic>())( Unit, Index, ); @@ -892,9 +924,10 @@ class LibClang { ffi.Pointer clang_getDiagnosticSetFromTU( ffi.Pointer Unit, ) { - return (_clang_getDiagnosticSetFromTU ??= _dylib.lookupFunction< - _c_clang_getDiagnosticSetFromTU, - _dart_clang_getDiagnosticSetFromTU>('clang_getDiagnosticSetFromTU'))( + return (_clang_getDiagnosticSetFromTU ??= + _lookup>( + 'clang_getDiagnosticSetFromTU') + .asFunction<_dart_clang_getDiagnosticSetFromTU>())( Unit, ); } @@ -905,9 +938,10 @@ class LibClang { void clang_disposeDiagnostic( ffi.Pointer Diagnostic, ) { - return (_clang_disposeDiagnostic ??= _dylib.lookupFunction< - _c_clang_disposeDiagnostic, - _dart_clang_disposeDiagnostic>('clang_disposeDiagnostic'))( + return (_clang_disposeDiagnostic ??= + _lookup>( + 'clang_disposeDiagnostic') + .asFunction<_dart_clang_disposeDiagnostic>())( Diagnostic, ); } @@ -931,9 +965,10 @@ class LibClang { ffi.Pointer Diagnostic, int Options, ) { - return (_clang_formatDiagnostic ??= _dylib.lookupFunction< - _c_clang_formatDiagnostic, - _dart_clang_formatDiagnostic>('clang_formatDiagnostic'))( + return (_clang_formatDiagnostic ??= + _lookup>( + 'clang_formatDiagnostic') + .asFunction<_dart_clang_formatDiagnostic>())( Diagnostic, Options, ); @@ -947,10 +982,10 @@ class LibClang { /// \returns A set of display options suitable for use with \c /// clang_formatDiagnostic(). int clang_defaultDiagnosticDisplayOptions() { - return (_clang_defaultDiagnosticDisplayOptions ??= _dylib.lookupFunction< - _c_clang_defaultDiagnosticDisplayOptions, - _dart_clang_defaultDiagnosticDisplayOptions>( - 'clang_defaultDiagnosticDisplayOptions'))(); + return (_clang_defaultDiagnosticDisplayOptions ??= + _lookup>( + 'clang_defaultDiagnosticDisplayOptions') + .asFunction<_dart_clang_defaultDiagnosticDisplayOptions>())(); } _dart_clang_defaultDiagnosticDisplayOptions? @@ -960,9 +995,10 @@ class LibClang { int clang_getDiagnosticSeverity( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticSeverity ??= _dylib.lookupFunction< - _c_clang_getDiagnosticSeverity, - _dart_clang_getDiagnosticSeverity>('clang_getDiagnosticSeverity'))( + return (_clang_getDiagnosticSeverity ??= + _lookup>( + 'clang_getDiagnosticSeverity') + .asFunction<_dart_clang_getDiagnosticSeverity>())( arg0, ); } @@ -976,9 +1012,10 @@ class LibClang { CXSourceLocation clang_getDiagnosticLocation( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticLocation ??= _dylib.lookupFunction< - _c_clang_getDiagnosticLocation, - _dart_clang_getDiagnosticLocation>('clang_getDiagnosticLocation'))( + return (_clang_getDiagnosticLocation ??= + _lookup>( + 'clang_getDiagnosticLocation') + .asFunction<_dart_clang_getDiagnosticLocation>())( arg0, ); } @@ -989,9 +1026,10 @@ class LibClang { CXString clang_getDiagnosticSpelling( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticSpelling ??= _dylib.lookupFunction< - _c_clang_getDiagnosticSpelling, - _dart_clang_getDiagnosticSpelling>('clang_getDiagnosticSpelling'))( + return (_clang_getDiagnosticSpelling ??= + _lookup>( + 'clang_getDiagnosticSpelling') + .asFunction<_dart_clang_getDiagnosticSpelling>())( arg0, ); } @@ -1012,9 +1050,10 @@ class LibClang { ffi.Pointer Diag, ffi.Pointer Disable, ) { - return (_clang_getDiagnosticOption ??= _dylib.lookupFunction< - _c_clang_getDiagnosticOption, - _dart_clang_getDiagnosticOption>('clang_getDiagnosticOption'))( + return (_clang_getDiagnosticOption ??= + _lookup>( + 'clang_getDiagnosticOption') + .asFunction<_dart_clang_getDiagnosticOption>())( Diag, Disable, ); @@ -1033,9 +1072,10 @@ class LibClang { int clang_getDiagnosticCategory( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticCategory ??= _dylib.lookupFunction< - _c_clang_getDiagnosticCategory, - _dart_clang_getDiagnosticCategory>('clang_getDiagnosticCategory'))( + return (_clang_getDiagnosticCategory ??= + _lookup>( + 'clang_getDiagnosticCategory') + .asFunction<_dart_clang_getDiagnosticCategory>())( arg0, ); } @@ -1053,10 +1093,10 @@ class LibClang { CXString clang_getDiagnosticCategoryName( int Category, ) { - return (_clang_getDiagnosticCategoryName ??= _dylib.lookupFunction< - _c_clang_getDiagnosticCategoryName, - _dart_clang_getDiagnosticCategoryName>( - 'clang_getDiagnosticCategoryName'))( + return (_clang_getDiagnosticCategoryName ??= + _lookup>( + 'clang_getDiagnosticCategoryName') + .asFunction<_dart_clang_getDiagnosticCategoryName>())( Category, ); } @@ -1069,10 +1109,10 @@ class LibClang { CXString clang_getDiagnosticCategoryText( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticCategoryText ??= _dylib.lookupFunction< - _c_clang_getDiagnosticCategoryText, - _dart_clang_getDiagnosticCategoryText>( - 'clang_getDiagnosticCategoryText'))( + return (_clang_getDiagnosticCategoryText ??= + _lookup>( + 'clang_getDiagnosticCategoryText') + .asFunction<_dart_clang_getDiagnosticCategoryText>())( arg0, ); } @@ -1084,9 +1124,10 @@ class LibClang { int clang_getDiagnosticNumRanges( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticNumRanges ??= _dylib.lookupFunction< - _c_clang_getDiagnosticNumRanges, - _dart_clang_getDiagnosticNumRanges>('clang_getDiagnosticNumRanges'))( + return (_clang_getDiagnosticNumRanges ??= + _lookup>( + 'clang_getDiagnosticNumRanges') + .asFunction<_dart_clang_getDiagnosticNumRanges>())( arg0, ); } @@ -1108,9 +1149,10 @@ class LibClang { ffi.Pointer Diagnostic, int Range, ) { - return (_clang_getDiagnosticRange ??= _dylib.lookupFunction< - _c_clang_getDiagnosticRange, - _dart_clang_getDiagnosticRange>('clang_getDiagnosticRange'))( + return (_clang_getDiagnosticRange ??= + _lookup>( + 'clang_getDiagnosticRange') + .asFunction<_dart_clang_getDiagnosticRange>())( Diagnostic, Range, ); @@ -1123,9 +1165,10 @@ class LibClang { int clang_getDiagnosticNumFixIts( ffi.Pointer Diagnostic, ) { - return (_clang_getDiagnosticNumFixIts ??= _dylib.lookupFunction< - _c_clang_getDiagnosticNumFixIts, - _dart_clang_getDiagnosticNumFixIts>('clang_getDiagnosticNumFixIts'))( + return (_clang_getDiagnosticNumFixIts ??= + _lookup>( + 'clang_getDiagnosticNumFixIts') + .asFunction<_dart_clang_getDiagnosticNumFixIts>())( Diagnostic, ); } @@ -1160,9 +1203,10 @@ class LibClang { int FixIt, ffi.Pointer ReplacementRange, ) { - return (_clang_getDiagnosticFixIt ??= _dylib.lookupFunction< - _c_clang_getDiagnosticFixIt, - _dart_clang_getDiagnosticFixIt>('clang_getDiagnosticFixIt'))( + return (_clang_getDiagnosticFixIt ??= + _lookup>( + 'clang_getDiagnosticFixIt') + .asFunction<_dart_clang_getDiagnosticFixIt>())( Diagnostic, FixIt, ReplacementRange, @@ -1175,10 +1219,10 @@ class LibClang { CXString clang_getTranslationUnitSpelling( ffi.Pointer CTUnit, ) { - return (_clang_getTranslationUnitSpelling ??= _dylib.lookupFunction< - _c_clang_getTranslationUnitSpelling, - _dart_clang_getTranslationUnitSpelling>( - 'clang_getTranslationUnitSpelling'))( + return (_clang_getTranslationUnitSpelling ??= + _lookup>( + 'clang_getTranslationUnitSpelling') + .asFunction<_dart_clang_getTranslationUnitSpelling>())( CTUnit, ); } @@ -1231,10 +1275,11 @@ class LibClang { int num_unsaved_files, ffi.Pointer unsaved_files, ) { - return (_clang_createTranslationUnitFromSourceFile ??= - _dylib.lookupFunction<_c_clang_createTranslationUnitFromSourceFile, - _dart_clang_createTranslationUnitFromSourceFile>( - 'clang_createTranslationUnitFromSourceFile'))( + return (_clang_createTranslationUnitFromSourceFile ??= _lookup< + ffi.NativeFunction< + _c_clang_createTranslationUnitFromSourceFile>>( + 'clang_createTranslationUnitFromSourceFile') + .asFunction<_dart_clang_createTranslationUnitFromSourceFile>())( CIdx, source_filename, num_clang_command_line_args, @@ -1255,9 +1300,10 @@ class LibClang { ffi.Pointer CIdx, ffi.Pointer ast_filename, ) { - return (_clang_createTranslationUnit ??= _dylib.lookupFunction< - _c_clang_createTranslationUnit, - _dart_clang_createTranslationUnit>('clang_createTranslationUnit'))( + return (_clang_createTranslationUnit ??= + _lookup>( + 'clang_createTranslationUnit') + .asFunction<_dart_clang_createTranslationUnit>())( CIdx, ast_filename, ); @@ -1276,9 +1322,10 @@ class LibClang { ffi.Pointer ast_filename, ffi.Pointer> out_TU, ) { - return (_clang_createTranslationUnit2 ??= _dylib.lookupFunction< - _c_clang_createTranslationUnit2, - _dart_clang_createTranslationUnit2>('clang_createTranslationUnit2'))( + return (_clang_createTranslationUnit2 ??= + _lookup>( + 'clang_createTranslationUnit2') + .asFunction<_dart_clang_createTranslationUnit2>())( CIdx, ast_filename, out_TU, @@ -1298,10 +1345,11 @@ class LibClang { /// preamble) geared toward improving the performance of these routines. The /// set of optimizations enabled may change from one version to the next. int clang_defaultEditingTranslationUnitOptions() { - return (_clang_defaultEditingTranslationUnitOptions ??= - _dylib.lookupFunction<_c_clang_defaultEditingTranslationUnitOptions, - _dart_clang_defaultEditingTranslationUnitOptions>( - 'clang_defaultEditingTranslationUnitOptions'))(); + return (_clang_defaultEditingTranslationUnitOptions ??= _lookup< + ffi.NativeFunction< + _c_clang_defaultEditingTranslationUnitOptions>>( + 'clang_defaultEditingTranslationUnitOptions') + .asFunction<_dart_clang_defaultEditingTranslationUnitOptions>())(); } _dart_clang_defaultEditingTranslationUnitOptions? @@ -1320,9 +1368,10 @@ class LibClang { int num_unsaved_files, int options, ) { - return (_clang_parseTranslationUnit ??= _dylib.lookupFunction< - _c_clang_parseTranslationUnit, - _dart_clang_parseTranslationUnit>('clang_parseTranslationUnit'))( + return (_clang_parseTranslationUnit ??= + _lookup>( + 'clang_parseTranslationUnit') + .asFunction<_dart_clang_parseTranslationUnit>())( CIdx, source_filename, command_line_args, @@ -1387,9 +1436,10 @@ class LibClang { int options, ffi.Pointer> out_TU, ) { - return (_clang_parseTranslationUnit2 ??= _dylib.lookupFunction< - _c_clang_parseTranslationUnit2, - _dart_clang_parseTranslationUnit2>('clang_parseTranslationUnit2'))( + return (_clang_parseTranslationUnit2 ??= + _lookup>( + 'clang_parseTranslationUnit2') + .asFunction<_dart_clang_parseTranslationUnit2>())( CIdx, source_filename, command_line_args, @@ -1416,10 +1466,10 @@ class LibClang { int options, ffi.Pointer> out_TU, ) { - return (_clang_parseTranslationUnit2FullArgv ??= _dylib.lookupFunction< - _c_clang_parseTranslationUnit2FullArgv, - _dart_clang_parseTranslationUnit2FullArgv>( - 'clang_parseTranslationUnit2FullArgv'))( + return (_clang_parseTranslationUnit2FullArgv ??= + _lookup>( + 'clang_parseTranslationUnit2FullArgv') + .asFunction<_dart_clang_parseTranslationUnit2FullArgv>())( CIdx, source_filename, command_line_args, @@ -1444,9 +1494,10 @@ class LibClang { int clang_defaultSaveOptions( ffi.Pointer TU, ) { - return (_clang_defaultSaveOptions ??= _dylib.lookupFunction< - _c_clang_defaultSaveOptions, - _dart_clang_defaultSaveOptions>('clang_defaultSaveOptions'))( + return (_clang_defaultSaveOptions ??= + _lookup>( + 'clang_defaultSaveOptions') + .asFunction<_dart_clang_defaultSaveOptions>())( TU, ); } @@ -1479,9 +1530,10 @@ class LibClang { ffi.Pointer FileName, int options, ) { - return (_clang_saveTranslationUnit ??= _dylib.lookupFunction< - _c_clang_saveTranslationUnit, - _dart_clang_saveTranslationUnit>('clang_saveTranslationUnit'))( + return (_clang_saveTranslationUnit ??= + _lookup>( + 'clang_saveTranslationUnit') + .asFunction<_dart_clang_saveTranslationUnit>())( TU, FileName, options, @@ -1498,9 +1550,10 @@ class LibClang { int clang_suspendTranslationUnit( ffi.Pointer arg0, ) { - return (_clang_suspendTranslationUnit ??= _dylib.lookupFunction< - _c_clang_suspendTranslationUnit, - _dart_clang_suspendTranslationUnit>('clang_suspendTranslationUnit'))( + return (_clang_suspendTranslationUnit ??= + _lookup>( + 'clang_suspendTranslationUnit') + .asFunction<_dart_clang_suspendTranslationUnit>())( arg0, ); } @@ -1511,9 +1564,10 @@ class LibClang { void clang_disposeTranslationUnit( ffi.Pointer arg0, ) { - return (_clang_disposeTranslationUnit ??= _dylib.lookupFunction< - _c_clang_disposeTranslationUnit, - _dart_clang_disposeTranslationUnit>('clang_disposeTranslationUnit'))( + return (_clang_disposeTranslationUnit ??= + _lookup>( + 'clang_disposeTranslationUnit') + .asFunction<_dart_clang_disposeTranslationUnit>())( arg0, ); } @@ -1531,9 +1585,10 @@ class LibClang { int clang_defaultReparseOptions( ffi.Pointer TU, ) { - return (_clang_defaultReparseOptions ??= _dylib.lookupFunction< - _c_clang_defaultReparseOptions, - _dart_clang_defaultReparseOptions>('clang_defaultReparseOptions'))( + return (_clang_defaultReparseOptions ??= + _lookup>( + 'clang_defaultReparseOptions') + .asFunction<_dart_clang_defaultReparseOptions>())( TU, ); } @@ -1583,9 +1638,10 @@ class LibClang { ffi.Pointer unsaved_files, int options, ) { - return (_clang_reparseTranslationUnit ??= _dylib.lookupFunction< - _c_clang_reparseTranslationUnit, - _dart_clang_reparseTranslationUnit>('clang_reparseTranslationUnit'))( + return (_clang_reparseTranslationUnit ??= + _lookup>( + 'clang_reparseTranslationUnit') + .asFunction<_dart_clang_reparseTranslationUnit>())( TU, num_unsaved_files, unsaved_files, @@ -1600,9 +1656,10 @@ class LibClang { ffi.Pointer clang_getTUResourceUsageName( int kind, ) { - return (_clang_getTUResourceUsageName ??= _dylib.lookupFunction< - _c_clang_getTUResourceUsageName, - _dart_clang_getTUResourceUsageName>('clang_getTUResourceUsageName'))( + return (_clang_getTUResourceUsageName ??= + _lookup>( + 'clang_getTUResourceUsageName') + .asFunction<_dart_clang_getTUResourceUsageName>())( kind, ); } @@ -1614,9 +1671,10 @@ class LibClang { CXTUResourceUsage clang_getCXTUResourceUsage( ffi.Pointer TU, ) { - return (_clang_getCXTUResourceUsage ??= _dylib.lookupFunction< - _c_clang_getCXTUResourceUsage, - _dart_clang_getCXTUResourceUsage>('clang_getCXTUResourceUsage'))( + return (_clang_getCXTUResourceUsage ??= + _lookup>( + 'clang_getCXTUResourceUsage') + .asFunction<_dart_clang_getCXTUResourceUsage>())( TU, ); } @@ -1626,10 +1684,10 @@ class LibClang { void clang_disposeCXTUResourceUsage( CXTUResourceUsage usage, ) { - return (_clang_disposeCXTUResourceUsage ??= _dylib.lookupFunction< - _c_clang_disposeCXTUResourceUsage, - _dart_clang_disposeCXTUResourceUsage>( - 'clang_disposeCXTUResourceUsage'))( + return (_clang_disposeCXTUResourceUsage ??= + _lookup>( + 'clang_disposeCXTUResourceUsage') + .asFunction<_dart_clang_disposeCXTUResourceUsage>())( usage, ); } @@ -1642,10 +1700,10 @@ class LibClang { ffi.Pointer clang_getTranslationUnitTargetInfo( ffi.Pointer CTUnit, ) { - return (_clang_getTranslationUnitTargetInfo ??= _dylib.lookupFunction< - _c_clang_getTranslationUnitTargetInfo, - _dart_clang_getTranslationUnitTargetInfo>( - 'clang_getTranslationUnitTargetInfo'))( + return (_clang_getTranslationUnitTargetInfo ??= + _lookup>( + 'clang_getTranslationUnitTargetInfo') + .asFunction<_dart_clang_getTranslationUnitTargetInfo>())( CTUnit, ); } @@ -1656,9 +1714,10 @@ class LibClang { void clang_TargetInfo_dispose( ffi.Pointer Info, ) { - return (_clang_TargetInfo_dispose ??= _dylib.lookupFunction< - _c_clang_TargetInfo_dispose, - _dart_clang_TargetInfo_dispose>('clang_TargetInfo_dispose'))( + return (_clang_TargetInfo_dispose ??= + _lookup>( + 'clang_TargetInfo_dispose') + .asFunction<_dart_clang_TargetInfo_dispose>())( Info, ); } @@ -1671,9 +1730,10 @@ class LibClang { CXString clang_TargetInfo_getTriple( ffi.Pointer Info, ) { - return (_clang_TargetInfo_getTriple ??= _dylib.lookupFunction< - _c_clang_TargetInfo_getTriple, - _dart_clang_TargetInfo_getTriple>('clang_TargetInfo_getTriple'))( + return (_clang_TargetInfo_getTriple ??= + _lookup>( + 'clang_TargetInfo_getTriple') + .asFunction<_dart_clang_TargetInfo_getTriple>())( Info, ); } @@ -1686,10 +1746,10 @@ class LibClang { int clang_TargetInfo_getPointerWidth( ffi.Pointer Info, ) { - return (_clang_TargetInfo_getPointerWidth ??= _dylib.lookupFunction< - _c_clang_TargetInfo_getPointerWidth, - _dart_clang_TargetInfo_getPointerWidth>( - 'clang_TargetInfo_getPointerWidth'))( + return (_clang_TargetInfo_getPointerWidth ??= + _lookup>( + 'clang_TargetInfo_getPointerWidth') + .asFunction<_dart_clang_TargetInfo_getPointerWidth>())( Info, ); } @@ -1698,9 +1758,10 @@ class LibClang { /// Retrieve the NULL cursor, which represents no entity. CXCursor clang_getNullCursor() { - return (_clang_getNullCursor ??= _dylib.lookupFunction< - _c_clang_getNullCursor, - _dart_clang_getNullCursor>('clang_getNullCursor'))(); + return (_clang_getNullCursor ??= + _lookup>( + 'clang_getNullCursor') + .asFunction<_dart_clang_getNullCursor>())(); } _dart_clang_getNullCursor? _clang_getNullCursor; @@ -1712,10 +1773,10 @@ class LibClang { CXCursor clang_getTranslationUnitCursor( ffi.Pointer arg0, ) { - return (_clang_getTranslationUnitCursor ??= _dylib.lookupFunction< - _c_clang_getTranslationUnitCursor, - _dart_clang_getTranslationUnitCursor>( - 'clang_getTranslationUnitCursor'))( + return (_clang_getTranslationUnitCursor ??= + _lookup>( + 'clang_getTranslationUnitCursor') + .asFunction<_dart_clang_getTranslationUnitCursor>())( arg0, ); } @@ -1728,8 +1789,8 @@ class LibClang { CXCursor arg1, ) { return (_clang_equalCursors ??= - _dylib.lookupFunction<_c_clang_equalCursors, _dart_clang_equalCursors>( - 'clang_equalCursors'))( + _lookup>('clang_equalCursors') + .asFunction<_dart_clang_equalCursors>())( arg0, arg1, ); @@ -1741,9 +1802,10 @@ class LibClang { int clang_Cursor_isNull( CXCursor cursor, ) { - return (_clang_Cursor_isNull ??= _dylib.lookupFunction< - _c_clang_Cursor_isNull, - _dart_clang_Cursor_isNull>('clang_Cursor_isNull'))( + return (_clang_Cursor_isNull ??= + _lookup>( + 'clang_Cursor_isNull') + .asFunction<_dart_clang_Cursor_isNull>())( cursor, ); } @@ -1755,8 +1817,8 @@ class LibClang { CXCursor arg0, ) { return (_clang_hashCursor ??= - _dylib.lookupFunction<_c_clang_hashCursor, _dart_clang_hashCursor>( - 'clang_hashCursor'))( + _lookup>('clang_hashCursor') + .asFunction<_dart_clang_hashCursor>())( arg0, ); } @@ -1767,9 +1829,10 @@ class LibClang { int clang_getCursorKind( CXCursor arg0, ) { - return (_clang_getCursorKind ??= _dylib.lookupFunction< - _c_clang_getCursorKind, - _dart_clang_getCursorKind>('clang_getCursorKind'))( + return (_clang_getCursorKind ??= + _lookup>( + 'clang_getCursorKind') + .asFunction<_dart_clang_getCursorKind>())( arg0, ); } @@ -1780,9 +1843,10 @@ class LibClang { int clang_isDeclaration( int arg0, ) { - return (_clang_isDeclaration ??= _dylib.lookupFunction< - _c_clang_isDeclaration, - _dart_clang_isDeclaration>('clang_isDeclaration'))( + return (_clang_isDeclaration ??= + _lookup>( + 'clang_isDeclaration') + .asFunction<_dart_clang_isDeclaration>())( arg0, ); } @@ -1798,9 +1862,10 @@ class LibClang { int clang_isInvalidDeclaration( CXCursor arg0, ) { - return (_clang_isInvalidDeclaration ??= _dylib.lookupFunction< - _c_clang_isInvalidDeclaration, - _dart_clang_isInvalidDeclaration>('clang_isInvalidDeclaration'))( + return (_clang_isInvalidDeclaration ??= + _lookup>( + 'clang_isInvalidDeclaration') + .asFunction<_dart_clang_isInvalidDeclaration>())( arg0, ); } @@ -1817,8 +1882,8 @@ class LibClang { int arg0, ) { return (_clang_isReference ??= - _dylib.lookupFunction<_c_clang_isReference, _dart_clang_isReference>( - 'clang_isReference'))( + _lookup>('clang_isReference') + .asFunction<_dart_clang_isReference>())( arg0, ); } @@ -1830,8 +1895,8 @@ class LibClang { int arg0, ) { return (_clang_isExpression ??= - _dylib.lookupFunction<_c_clang_isExpression, _dart_clang_isExpression>( - 'clang_isExpression'))( + _lookup>('clang_isExpression') + .asFunction<_dart_clang_isExpression>())( arg0, ); } @@ -1843,8 +1908,8 @@ class LibClang { int arg0, ) { return (_clang_isStatement ??= - _dylib.lookupFunction<_c_clang_isStatement, _dart_clang_isStatement>( - 'clang_isStatement'))( + _lookup>('clang_isStatement') + .asFunction<_dart_clang_isStatement>())( arg0, ); } @@ -1856,8 +1921,8 @@ class LibClang { int arg0, ) { return (_clang_isAttribute ??= - _dylib.lookupFunction<_c_clang_isAttribute, _dart_clang_isAttribute>( - 'clang_isAttribute'))( + _lookup>('clang_isAttribute') + .asFunction<_dart_clang_isAttribute>())( arg0, ); } @@ -1868,9 +1933,10 @@ class LibClang { int clang_Cursor_hasAttrs( CXCursor C, ) { - return (_clang_Cursor_hasAttrs ??= _dylib.lookupFunction< - _c_clang_Cursor_hasAttrs, - _dart_clang_Cursor_hasAttrs>('clang_Cursor_hasAttrs'))( + return (_clang_Cursor_hasAttrs ??= + _lookup>( + 'clang_Cursor_hasAttrs') + .asFunction<_dart_clang_Cursor_hasAttrs>())( C, ); } @@ -1883,8 +1949,8 @@ class LibClang { int arg0, ) { return (_clang_isInvalid ??= - _dylib.lookupFunction<_c_clang_isInvalid, _dart_clang_isInvalid>( - 'clang_isInvalid'))( + _lookup>('clang_isInvalid') + .asFunction<_dart_clang_isInvalid>())( arg0, ); } @@ -1896,9 +1962,10 @@ class LibClang { int clang_isTranslationUnit( int arg0, ) { - return (_clang_isTranslationUnit ??= _dylib.lookupFunction< - _c_clang_isTranslationUnit, - _dart_clang_isTranslationUnit>('clang_isTranslationUnit'))( + return (_clang_isTranslationUnit ??= + _lookup>( + 'clang_isTranslationUnit') + .asFunction<_dart_clang_isTranslationUnit>())( arg0, ); } @@ -1910,9 +1977,10 @@ class LibClang { int clang_isPreprocessing( int arg0, ) { - return (_clang_isPreprocessing ??= _dylib.lookupFunction< - _c_clang_isPreprocessing, - _dart_clang_isPreprocessing>('clang_isPreprocessing'))( + return (_clang_isPreprocessing ??= + _lookup>( + 'clang_isPreprocessing') + .asFunction<_dart_clang_isPreprocessing>())( arg0, ); } @@ -1925,8 +1993,8 @@ class LibClang { int arg0, ) { return (_clang_isUnexposed ??= - _dylib.lookupFunction<_c_clang_isUnexposed, _dart_clang_isUnexposed>( - 'clang_isUnexposed'))( + _lookup>('clang_isUnexposed') + .asFunction<_dart_clang_isUnexposed>())( arg0, ); } @@ -1937,9 +2005,10 @@ class LibClang { int clang_getCursorLinkage( CXCursor cursor, ) { - return (_clang_getCursorLinkage ??= _dylib.lookupFunction< - _c_clang_getCursorLinkage, - _dart_clang_getCursorLinkage>('clang_getCursorLinkage'))( + return (_clang_getCursorLinkage ??= + _lookup>( + 'clang_getCursorLinkage') + .asFunction<_dart_clang_getCursorLinkage>())( cursor, ); } @@ -1958,9 +2027,10 @@ class LibClang { int clang_getCursorVisibility( CXCursor cursor, ) { - return (_clang_getCursorVisibility ??= _dylib.lookupFunction< - _c_clang_getCursorVisibility, - _dart_clang_getCursorVisibility>('clang_getCursorVisibility'))( + return (_clang_getCursorVisibility ??= + _lookup>( + 'clang_getCursorVisibility') + .asFunction<_dart_clang_getCursorVisibility>())( cursor, ); } @@ -1976,9 +2046,10 @@ class LibClang { int clang_getCursorAvailability( CXCursor cursor, ) { - return (_clang_getCursorAvailability ??= _dylib.lookupFunction< - _c_clang_getCursorAvailability, - _dart_clang_getCursorAvailability>('clang_getCursorAvailability'))( + return (_clang_getCursorAvailability ??= + _lookup>( + 'clang_getCursorAvailability') + .asFunction<_dart_clang_getCursorAvailability>())( cursor, ); } @@ -2028,10 +2099,10 @@ class LibClang { ffi.Pointer availability, int availability_size, ) { - return (_clang_getCursorPlatformAvailability ??= _dylib.lookupFunction< - _c_clang_getCursorPlatformAvailability, - _dart_clang_getCursorPlatformAvailability>( - 'clang_getCursorPlatformAvailability'))( + return (_clang_getCursorPlatformAvailability ??= + _lookup>( + 'clang_getCursorPlatformAvailability') + .asFunction<_dart_clang_getCursorPlatformAvailability>())( cursor, always_deprecated, deprecated_message, @@ -2049,10 +2120,10 @@ class LibClang { void clang_disposeCXPlatformAvailability( ffi.Pointer availability, ) { - return (_clang_disposeCXPlatformAvailability ??= _dylib.lookupFunction< - _c_clang_disposeCXPlatformAvailability, - _dart_clang_disposeCXPlatformAvailability>( - 'clang_disposeCXPlatformAvailability'))( + return (_clang_disposeCXPlatformAvailability ??= + _lookup>( + 'clang_disposeCXPlatformAvailability') + .asFunction<_dart_clang_disposeCXPlatformAvailability>())( availability, ); } @@ -2064,9 +2135,10 @@ class LibClang { int clang_getCursorLanguage( CXCursor cursor, ) { - return (_clang_getCursorLanguage ??= _dylib.lookupFunction< - _c_clang_getCursorLanguage, - _dart_clang_getCursorLanguage>('clang_getCursorLanguage'))( + return (_clang_getCursorLanguage ??= + _lookup>( + 'clang_getCursorLanguage') + .asFunction<_dart_clang_getCursorLanguage>())( cursor, ); } @@ -2078,9 +2150,10 @@ class LibClang { int clang_getCursorTLSKind( CXCursor cursor, ) { - return (_clang_getCursorTLSKind ??= _dylib.lookupFunction< - _c_clang_getCursorTLSKind, - _dart_clang_getCursorTLSKind>('clang_getCursorTLSKind'))( + return (_clang_getCursorTLSKind ??= + _lookup>( + 'clang_getCursorTLSKind') + .asFunction<_dart_clang_getCursorTLSKind>())( cursor, ); } @@ -2091,10 +2164,10 @@ class LibClang { ffi.Pointer clang_Cursor_getTranslationUnit( CXCursor arg0, ) { - return (_clang_Cursor_getTranslationUnit ??= _dylib.lookupFunction< - _c_clang_Cursor_getTranslationUnit, - _dart_clang_Cursor_getTranslationUnit>( - 'clang_Cursor_getTranslationUnit'))( + return (_clang_Cursor_getTranslationUnit ??= + _lookup>( + 'clang_Cursor_getTranslationUnit') + .asFunction<_dart_clang_Cursor_getTranslationUnit>())( arg0, ); } @@ -2103,9 +2176,10 @@ class LibClang { /// Creates an empty CXCursorSet. ffi.Pointer clang_createCXCursorSet() { - return (_clang_createCXCursorSet ??= _dylib.lookupFunction< - _c_clang_createCXCursorSet, - _dart_clang_createCXCursorSet>('clang_createCXCursorSet'))(); + return (_clang_createCXCursorSet ??= + _lookup>( + 'clang_createCXCursorSet') + .asFunction<_dart_clang_createCXCursorSet>())(); } _dart_clang_createCXCursorSet? _clang_createCXCursorSet; @@ -2114,9 +2188,10 @@ class LibClang { void clang_disposeCXCursorSet( ffi.Pointer cset, ) { - return (_clang_disposeCXCursorSet ??= _dylib.lookupFunction< - _c_clang_disposeCXCursorSet, - _dart_clang_disposeCXCursorSet>('clang_disposeCXCursorSet'))( + return (_clang_disposeCXCursorSet ??= + _lookup>( + 'clang_disposeCXCursorSet') + .asFunction<_dart_clang_disposeCXCursorSet>())( cset, ); } @@ -2130,9 +2205,10 @@ class LibClang { ffi.Pointer cset, CXCursor cursor, ) { - return (_clang_CXCursorSet_contains ??= _dylib.lookupFunction< - _c_clang_CXCursorSet_contains, - _dart_clang_CXCursorSet_contains>('clang_CXCursorSet_contains'))( + return (_clang_CXCursorSet_contains ??= + _lookup>( + 'clang_CXCursorSet_contains') + .asFunction<_dart_clang_CXCursorSet_contains>())( cset, cursor, ); @@ -2147,9 +2223,10 @@ class LibClang { ffi.Pointer cset, CXCursor cursor, ) { - return (_clang_CXCursorSet_insert ??= _dylib.lookupFunction< - _c_clang_CXCursorSet_insert, - _dart_clang_CXCursorSet_insert>('clang_CXCursorSet_insert'))( + return (_clang_CXCursorSet_insert ??= + _lookup>( + 'clang_CXCursorSet_insert') + .asFunction<_dart_clang_CXCursorSet_insert>())( cset, cursor, ); @@ -2191,9 +2268,10 @@ class LibClang { CXCursor clang_getCursorSemanticParent( CXCursor cursor, ) { - return (_clang_getCursorSemanticParent ??= _dylib.lookupFunction< - _c_clang_getCursorSemanticParent, - _dart_clang_getCursorSemanticParent>('clang_getCursorSemanticParent'))( + return (_clang_getCursorSemanticParent ??= + _lookup>( + 'clang_getCursorSemanticParent') + .asFunction<_dart_clang_getCursorSemanticParent>())( cursor, ); } @@ -2235,9 +2313,10 @@ class LibClang { CXCursor clang_getCursorLexicalParent( CXCursor cursor, ) { - return (_clang_getCursorLexicalParent ??= _dylib.lookupFunction< - _c_clang_getCursorLexicalParent, - _dart_clang_getCursorLexicalParent>('clang_getCursorLexicalParent'))( + return (_clang_getCursorLexicalParent ??= + _lookup>( + 'clang_getCursorLexicalParent') + .asFunction<_dart_clang_getCursorLexicalParent>())( cursor, ); } @@ -2290,9 +2369,10 @@ class LibClang { ffi.Pointer> overridden, ffi.Pointer num_overridden, ) { - return (_clang_getOverriddenCursors ??= _dylib.lookupFunction< - _c_clang_getOverriddenCursors, - _dart_clang_getOverriddenCursors>('clang_getOverriddenCursors'))( + return (_clang_getOverriddenCursors ??= + _lookup>( + 'clang_getOverriddenCursors') + .asFunction<_dart_clang_getOverriddenCursors>())( cursor, overridden, num_overridden, @@ -2306,10 +2386,10 @@ class LibClang { void clang_disposeOverriddenCursors( ffi.Pointer overridden, ) { - return (_clang_disposeOverriddenCursors ??= _dylib.lookupFunction< - _c_clang_disposeOverriddenCursors, - _dart_clang_disposeOverriddenCursors>( - 'clang_disposeOverriddenCursors'))( + return (_clang_disposeOverriddenCursors ??= + _lookup>( + 'clang_disposeOverriddenCursors') + .asFunction<_dart_clang_disposeOverriddenCursors>())( overridden, ); } @@ -2321,9 +2401,10 @@ class LibClang { ffi.Pointer clang_getIncludedFile( CXCursor cursor, ) { - return (_clang_getIncludedFile ??= _dylib.lookupFunction< - _c_clang_getIncludedFile, - _dart_clang_getIncludedFile>('clang_getIncludedFile'))( + return (_clang_getIncludedFile ??= + _lookup>( + 'clang_getIncludedFile') + .asFunction<_dart_clang_getIncludedFile>())( cursor, ); } @@ -2348,8 +2429,8 @@ class LibClang { CXSourceLocation arg1, ) { return (_clang_getCursor ??= - _dylib.lookupFunction<_c_clang_getCursor, _dart_clang_getCursor>( - 'clang_getCursor'))( + _lookup>('clang_getCursor') + .asFunction<_dart_clang_getCursor>())( arg0, arg1, ); @@ -2368,9 +2449,10 @@ class LibClang { CXSourceLocation clang_getCursorLocation( CXCursor arg0, ) { - return (_clang_getCursorLocation ??= _dylib.lookupFunction< - _c_clang_getCursorLocation, - _dart_clang_getCursorLocation>('clang_getCursorLocation'))( + return (_clang_getCursorLocation ??= + _lookup>( + 'clang_getCursorLocation') + .asFunction<_dart_clang_getCursorLocation>())( arg0, ); } @@ -2389,9 +2471,10 @@ class LibClang { CXSourceRange clang_getCursorExtent( CXCursor arg0, ) { - return (_clang_getCursorExtent ??= _dylib.lookupFunction< - _c_clang_getCursorExtent, - _dart_clang_getCursorExtent>('clang_getCursorExtent'))( + return (_clang_getCursorExtent ??= + _lookup>( + 'clang_getCursorExtent') + .asFunction<_dart_clang_getCursorExtent>())( arg0, ); } @@ -2402,9 +2485,10 @@ class LibClang { CXType clang_getCursorType( CXCursor C, ) { - return (_clang_getCursorType ??= _dylib.lookupFunction< - _c_clang_getCursorType, - _dart_clang_getCursorType>('clang_getCursorType'))( + return (_clang_getCursorType ??= + _lookup>( + 'clang_getCursorType') + .asFunction<_dart_clang_getCursorType>())( C, ); } @@ -2418,9 +2502,10 @@ class LibClang { CXString clang_getTypeSpelling( CXType CT, ) { - return (_clang_getTypeSpelling ??= _dylib.lookupFunction< - _c_clang_getTypeSpelling, - _dart_clang_getTypeSpelling>('clang_getTypeSpelling'))( + return (_clang_getTypeSpelling ??= + _lookup>( + 'clang_getTypeSpelling') + .asFunction<_dart_clang_getTypeSpelling>())( CT, ); } @@ -2434,10 +2519,10 @@ class LibClang { CXType clang_getTypedefDeclUnderlyingType( CXCursor C, ) { - return (_clang_getTypedefDeclUnderlyingType ??= _dylib.lookupFunction< - _c_clang_getTypedefDeclUnderlyingType, - _dart_clang_getTypedefDeclUnderlyingType>( - 'clang_getTypedefDeclUnderlyingType'))( + return (_clang_getTypedefDeclUnderlyingType ??= + _lookup>( + 'clang_getTypedefDeclUnderlyingType') + .asFunction<_dart_clang_getTypedefDeclUnderlyingType>())( C, ); } @@ -2451,9 +2536,10 @@ class LibClang { CXType clang_getEnumDeclIntegerType( CXCursor C, ) { - return (_clang_getEnumDeclIntegerType ??= _dylib.lookupFunction< - _c_clang_getEnumDeclIntegerType, - _dart_clang_getEnumDeclIntegerType>('clang_getEnumDeclIntegerType'))( + return (_clang_getEnumDeclIntegerType ??= + _lookup>( + 'clang_getEnumDeclIntegerType') + .asFunction<_dart_clang_getEnumDeclIntegerType>())( C, ); } @@ -2469,10 +2555,10 @@ class LibClang { int clang_getEnumConstantDeclValue( CXCursor C, ) { - return (_clang_getEnumConstantDeclValue ??= _dylib.lookupFunction< - _c_clang_getEnumConstantDeclValue, - _dart_clang_getEnumConstantDeclValue>( - 'clang_getEnumConstantDeclValue'))( + return (_clang_getEnumConstantDeclValue ??= + _lookup>( + 'clang_getEnumConstantDeclValue') + .asFunction<_dart_clang_getEnumConstantDeclValue>())( C, ); } @@ -2488,10 +2574,10 @@ class LibClang { int clang_getEnumConstantDeclUnsignedValue( CXCursor C, ) { - return (_clang_getEnumConstantDeclUnsignedValue ??= _dylib.lookupFunction< - _c_clang_getEnumConstantDeclUnsignedValue, - _dart_clang_getEnumConstantDeclUnsignedValue>( - 'clang_getEnumConstantDeclUnsignedValue'))( + return (_clang_getEnumConstantDeclUnsignedValue ??= + _lookup>( + 'clang_getEnumConstantDeclUnsignedValue') + .asFunction<_dart_clang_getEnumConstantDeclUnsignedValue>())( C, ); } @@ -2505,9 +2591,10 @@ class LibClang { int clang_getFieldDeclBitWidth( CXCursor C, ) { - return (_clang_getFieldDeclBitWidth ??= _dylib.lookupFunction< - _c_clang_getFieldDeclBitWidth, - _dart_clang_getFieldDeclBitWidth>('clang_getFieldDeclBitWidth'))( + return (_clang_getFieldDeclBitWidth ??= + _lookup>( + 'clang_getFieldDeclBitWidth') + .asFunction<_dart_clang_getFieldDeclBitWidth>())( C, ); } @@ -2522,9 +2609,10 @@ class LibClang { int clang_Cursor_getNumArguments( CXCursor C, ) { - return (_clang_Cursor_getNumArguments ??= _dylib.lookupFunction< - _c_clang_Cursor_getNumArguments, - _dart_clang_Cursor_getNumArguments>('clang_Cursor_getNumArguments'))( + return (_clang_Cursor_getNumArguments ??= + _lookup>( + 'clang_Cursor_getNumArguments') + .asFunction<_dart_clang_Cursor_getNumArguments>())( C, ); } @@ -2540,9 +2628,10 @@ class LibClang { CXCursor C, int i, ) { - return (_clang_Cursor_getArgument ??= _dylib.lookupFunction< - _c_clang_Cursor_getArgument, - _dart_clang_Cursor_getArgument>('clang_Cursor_getArgument'))( + return (_clang_Cursor_getArgument ??= + _lookup>( + 'clang_Cursor_getArgument') + .asFunction<_dart_clang_Cursor_getArgument>())( C, i, ); @@ -2567,10 +2656,10 @@ class LibClang { int clang_Cursor_getNumTemplateArguments( CXCursor C, ) { - return (_clang_Cursor_getNumTemplateArguments ??= _dylib.lookupFunction< - _c_clang_Cursor_getNumTemplateArguments, - _dart_clang_Cursor_getNumTemplateArguments>( - 'clang_Cursor_getNumTemplateArguments'))( + return (_clang_Cursor_getNumTemplateArguments ??= + _lookup>( + 'clang_Cursor_getNumTemplateArguments') + .asFunction<_dart_clang_Cursor_getNumTemplateArguments>())( C, ); } @@ -2596,10 +2685,10 @@ class LibClang { CXCursor C, int I, ) { - return (_clang_Cursor_getTemplateArgumentKind ??= _dylib.lookupFunction< - _c_clang_Cursor_getTemplateArgumentKind, - _dart_clang_Cursor_getTemplateArgumentKind>( - 'clang_Cursor_getTemplateArgumentKind'))( + return (_clang_Cursor_getTemplateArgumentKind ??= + _lookup>( + 'clang_Cursor_getTemplateArgumentKind') + .asFunction<_dart_clang_Cursor_getTemplateArgumentKind>())( C, I, ); @@ -2628,10 +2717,10 @@ class LibClang { CXCursor C, int I, ) { - return (_clang_Cursor_getTemplateArgumentType ??= _dylib.lookupFunction< - _c_clang_Cursor_getTemplateArgumentType, - _dart_clang_Cursor_getTemplateArgumentType>( - 'clang_Cursor_getTemplateArgumentType'))( + return (_clang_Cursor_getTemplateArgumentType ??= + _lookup>( + 'clang_Cursor_getTemplateArgumentType') + .asFunction<_dart_clang_Cursor_getTemplateArgumentType>())( C, I, ); @@ -2659,10 +2748,10 @@ class LibClang { CXCursor C, int I, ) { - return (_clang_Cursor_getTemplateArgumentValue ??= _dylib.lookupFunction< - _c_clang_Cursor_getTemplateArgumentValue, - _dart_clang_Cursor_getTemplateArgumentValue>( - 'clang_Cursor_getTemplateArgumentValue'))( + return (_clang_Cursor_getTemplateArgumentValue ??= + _lookup>( + 'clang_Cursor_getTemplateArgumentValue') + .asFunction<_dart_clang_Cursor_getTemplateArgumentValue>())( C, I, ); @@ -2690,10 +2779,11 @@ class LibClang { CXCursor C, int I, ) { - return (_clang_Cursor_getTemplateArgumentUnsignedValue ??= - _dylib.lookupFunction<_c_clang_Cursor_getTemplateArgumentUnsignedValue, - _dart_clang_Cursor_getTemplateArgumentUnsignedValue>( - 'clang_Cursor_getTemplateArgumentUnsignedValue'))( + return (_clang_Cursor_getTemplateArgumentUnsignedValue ??= _lookup< + ffi.NativeFunction< + _c_clang_Cursor_getTemplateArgumentUnsignedValue>>( + 'clang_Cursor_getTemplateArgumentUnsignedValue') + .asFunction<_dart_clang_Cursor_getTemplateArgumentUnsignedValue>())( C, I, ); @@ -2711,8 +2801,8 @@ class LibClang { CXType B, ) { return (_clang_equalTypes ??= - _dylib.lookupFunction<_c_clang_equalTypes, _dart_clang_equalTypes>( - 'clang_equalTypes'))( + _lookup>('clang_equalTypes') + .asFunction<_dart_clang_equalTypes>())( A, B, ); @@ -2729,9 +2819,10 @@ class LibClang { CXType clang_getCanonicalType( CXType T, ) { - return (_clang_getCanonicalType ??= _dylib.lookupFunction< - _c_clang_getCanonicalType, - _dart_clang_getCanonicalType>('clang_getCanonicalType'))( + return (_clang_getCanonicalType ??= + _lookup>( + 'clang_getCanonicalType') + .asFunction<_dart_clang_getCanonicalType>())( T, ); } @@ -2744,9 +2835,10 @@ class LibClang { int clang_isConstQualifiedType( CXType T, ) { - return (_clang_isConstQualifiedType ??= _dylib.lookupFunction< - _c_clang_isConstQualifiedType, - _dart_clang_isConstQualifiedType>('clang_isConstQualifiedType'))( + return (_clang_isConstQualifiedType ??= + _lookup>( + 'clang_isConstQualifiedType') + .asFunction<_dart_clang_isConstQualifiedType>())( T, ); } @@ -2758,10 +2850,10 @@ class LibClang { int clang_Cursor_isMacroFunctionLike( CXCursor C, ) { - return (_clang_Cursor_isMacroFunctionLike ??= _dylib.lookupFunction< - _c_clang_Cursor_isMacroFunctionLike, - _dart_clang_Cursor_isMacroFunctionLike>( - 'clang_Cursor_isMacroFunctionLike'))( + return (_clang_Cursor_isMacroFunctionLike ??= + _lookup>( + 'clang_Cursor_isMacroFunctionLike') + .asFunction<_dart_clang_Cursor_isMacroFunctionLike>())( C, ); } @@ -2773,9 +2865,10 @@ class LibClang { int clang_Cursor_isMacroBuiltin( CXCursor C, ) { - return (_clang_Cursor_isMacroBuiltin ??= _dylib.lookupFunction< - _c_clang_Cursor_isMacroBuiltin, - _dart_clang_Cursor_isMacroBuiltin>('clang_Cursor_isMacroBuiltin'))( + return (_clang_Cursor_isMacroBuiltin ??= + _lookup>( + 'clang_Cursor_isMacroBuiltin') + .asFunction<_dart_clang_Cursor_isMacroBuiltin>())( C, ); } @@ -2787,10 +2880,10 @@ class LibClang { int clang_Cursor_isFunctionInlined( CXCursor C, ) { - return (_clang_Cursor_isFunctionInlined ??= _dylib.lookupFunction< - _c_clang_Cursor_isFunctionInlined, - _dart_clang_Cursor_isFunctionInlined>( - 'clang_Cursor_isFunctionInlined'))( + return (_clang_Cursor_isFunctionInlined ??= + _lookup>( + 'clang_Cursor_isFunctionInlined') + .asFunction<_dart_clang_Cursor_isFunctionInlined>())( C, ); } @@ -2803,9 +2896,10 @@ class LibClang { int clang_isVolatileQualifiedType( CXType T, ) { - return (_clang_isVolatileQualifiedType ??= _dylib.lookupFunction< - _c_clang_isVolatileQualifiedType, - _dart_clang_isVolatileQualifiedType>('clang_isVolatileQualifiedType'))( + return (_clang_isVolatileQualifiedType ??= + _lookup>( + 'clang_isVolatileQualifiedType') + .asFunction<_dart_clang_isVolatileQualifiedType>())( T, ); } @@ -2818,9 +2912,10 @@ class LibClang { int clang_isRestrictQualifiedType( CXType T, ) { - return (_clang_isRestrictQualifiedType ??= _dylib.lookupFunction< - _c_clang_isRestrictQualifiedType, - _dart_clang_isRestrictQualifiedType>('clang_isRestrictQualifiedType'))( + return (_clang_isRestrictQualifiedType ??= + _lookup>( + 'clang_isRestrictQualifiedType') + .asFunction<_dart_clang_isRestrictQualifiedType>())( T, ); } @@ -2831,9 +2926,10 @@ class LibClang { int clang_getAddressSpace( CXType T, ) { - return (_clang_getAddressSpace ??= _dylib.lookupFunction< - _c_clang_getAddressSpace, - _dart_clang_getAddressSpace>('clang_getAddressSpace'))( + return (_clang_getAddressSpace ??= + _lookup>( + 'clang_getAddressSpace') + .asFunction<_dart_clang_getAddressSpace>())( T, ); } @@ -2844,9 +2940,10 @@ class LibClang { CXString clang_getTypedefName( CXType CT, ) { - return (_clang_getTypedefName ??= _dylib.lookupFunction< - _c_clang_getTypedefName, - _dart_clang_getTypedefName>('clang_getTypedefName'))( + return (_clang_getTypedefName ??= + _lookup>( + 'clang_getTypedefName') + .asFunction<_dart_clang_getTypedefName>())( CT, ); } @@ -2857,9 +2954,10 @@ class LibClang { CXType clang_getPointeeType( CXType T, ) { - return (_clang_getPointeeType ??= _dylib.lookupFunction< - _c_clang_getPointeeType, - _dart_clang_getPointeeType>('clang_getPointeeType'))( + return (_clang_getPointeeType ??= + _lookup>( + 'clang_getPointeeType') + .asFunction<_dart_clang_getPointeeType>())( T, ); } @@ -2870,9 +2968,10 @@ class LibClang { CXCursor clang_getTypeDeclaration( CXType T, ) { - return (_clang_getTypeDeclaration ??= _dylib.lookupFunction< - _c_clang_getTypeDeclaration, - _dart_clang_getTypeDeclaration>('clang_getTypeDeclaration'))( + return (_clang_getTypeDeclaration ??= + _lookup>( + 'clang_getTypeDeclaration') + .asFunction<_dart_clang_getTypeDeclaration>())( T, ); } @@ -2883,9 +2982,10 @@ class LibClang { CXString clang_getDeclObjCTypeEncoding( CXCursor C, ) { - return (_clang_getDeclObjCTypeEncoding ??= _dylib.lookupFunction< - _c_clang_getDeclObjCTypeEncoding, - _dart_clang_getDeclObjCTypeEncoding>('clang_getDeclObjCTypeEncoding'))( + return (_clang_getDeclObjCTypeEncoding ??= + _lookup>( + 'clang_getDeclObjCTypeEncoding') + .asFunction<_dart_clang_getDeclObjCTypeEncoding>())( C, ); } @@ -2896,9 +2996,10 @@ class LibClang { CXString clang_Type_getObjCEncoding( CXType type, ) { - return (_clang_Type_getObjCEncoding ??= _dylib.lookupFunction< - _c_clang_Type_getObjCEncoding, - _dart_clang_Type_getObjCEncoding>('clang_Type_getObjCEncoding'))( + return (_clang_Type_getObjCEncoding ??= + _lookup>( + 'clang_Type_getObjCEncoding') + .asFunction<_dart_clang_Type_getObjCEncoding>())( type, ); } @@ -2909,9 +3010,10 @@ class LibClang { CXString clang_getTypeKindSpelling( int K, ) { - return (_clang_getTypeKindSpelling ??= _dylib.lookupFunction< - _c_clang_getTypeKindSpelling, - _dart_clang_getTypeKindSpelling>('clang_getTypeKindSpelling'))( + return (_clang_getTypeKindSpelling ??= + _lookup>( + 'clang_getTypeKindSpelling') + .asFunction<_dart_clang_getTypeKindSpelling>())( K, ); } @@ -2924,10 +3026,10 @@ class LibClang { int clang_getFunctionTypeCallingConv( CXType T, ) { - return (_clang_getFunctionTypeCallingConv ??= _dylib.lookupFunction< - _c_clang_getFunctionTypeCallingConv, - _dart_clang_getFunctionTypeCallingConv>( - 'clang_getFunctionTypeCallingConv'))( + return (_clang_getFunctionTypeCallingConv ??= + _lookup>( + 'clang_getFunctionTypeCallingConv') + .asFunction<_dart_clang_getFunctionTypeCallingConv>())( T, ); } @@ -2940,9 +3042,10 @@ class LibClang { CXType clang_getResultType( CXType T, ) { - return (_clang_getResultType ??= _dylib.lookupFunction< - _c_clang_getResultType, - _dart_clang_getResultType>('clang_getResultType'))( + return (_clang_getResultType ??= + _lookup>( + 'clang_getResultType') + .asFunction<_dart_clang_getResultType>())( T, ); } @@ -2956,10 +3059,10 @@ class LibClang { int clang_getExceptionSpecificationType( CXType T, ) { - return (_clang_getExceptionSpecificationType ??= _dylib.lookupFunction< - _c_clang_getExceptionSpecificationType, - _dart_clang_getExceptionSpecificationType>( - 'clang_getExceptionSpecificationType'))( + return (_clang_getExceptionSpecificationType ??= + _lookup>( + 'clang_getExceptionSpecificationType') + .asFunction<_dart_clang_getExceptionSpecificationType>())( T, ); } @@ -2974,9 +3077,10 @@ class LibClang { int clang_getNumArgTypes( CXType T, ) { - return (_clang_getNumArgTypes ??= _dylib.lookupFunction< - _c_clang_getNumArgTypes, - _dart_clang_getNumArgTypes>('clang_getNumArgTypes'))( + return (_clang_getNumArgTypes ??= + _lookup>( + 'clang_getNumArgTypes') + .asFunction<_dart_clang_getNumArgTypes>())( T, ); } @@ -2992,8 +3096,8 @@ class LibClang { int i, ) { return (_clang_getArgType ??= - _dylib.lookupFunction<_c_clang_getArgType, _dart_clang_getArgType>( - 'clang_getArgType'))( + _lookup>('clang_getArgType') + .asFunction<_dart_clang_getArgType>())( T, i, ); @@ -3007,10 +3111,10 @@ class LibClang { CXType clang_Type_getObjCObjectBaseType( CXType T, ) { - return (_clang_Type_getObjCObjectBaseType ??= _dylib.lookupFunction< - _c_clang_Type_getObjCObjectBaseType, - _dart_clang_Type_getObjCObjectBaseType>( - 'clang_Type_getObjCObjectBaseType'))( + return (_clang_Type_getObjCObjectBaseType ??= + _lookup>( + 'clang_Type_getObjCObjectBaseType') + .asFunction<_dart_clang_Type_getObjCObjectBaseType>())( T, ); } @@ -3023,10 +3127,10 @@ class LibClang { int clang_Type_getNumObjCProtocolRefs( CXType T, ) { - return (_clang_Type_getNumObjCProtocolRefs ??= _dylib.lookupFunction< - _c_clang_Type_getNumObjCProtocolRefs, - _dart_clang_Type_getNumObjCProtocolRefs>( - 'clang_Type_getNumObjCProtocolRefs'))( + return (_clang_Type_getNumObjCProtocolRefs ??= + _lookup>( + 'clang_Type_getNumObjCProtocolRefs') + .asFunction<_dart_clang_Type_getNumObjCProtocolRefs>())( T, ); } @@ -3041,10 +3145,10 @@ class LibClang { CXType T, int i, ) { - return (_clang_Type_getObjCProtocolDecl ??= _dylib.lookupFunction< - _c_clang_Type_getObjCProtocolDecl, - _dart_clang_Type_getObjCProtocolDecl>( - 'clang_Type_getObjCProtocolDecl'))( + return (_clang_Type_getObjCProtocolDecl ??= + _lookup>( + 'clang_Type_getObjCProtocolDecl') + .asFunction<_dart_clang_Type_getObjCProtocolDecl>())( T, i, ); @@ -3058,9 +3162,10 @@ class LibClang { int clang_Type_getNumObjCTypeArgs( CXType T, ) { - return (_clang_Type_getNumObjCTypeArgs ??= _dylib.lookupFunction< - _c_clang_Type_getNumObjCTypeArgs, - _dart_clang_Type_getNumObjCTypeArgs>('clang_Type_getNumObjCTypeArgs'))( + return (_clang_Type_getNumObjCTypeArgs ??= + _lookup>( + 'clang_Type_getNumObjCTypeArgs') + .asFunction<_dart_clang_Type_getNumObjCTypeArgs>())( T, ); } @@ -3075,9 +3180,10 @@ class LibClang { CXType T, int i, ) { - return (_clang_Type_getObjCTypeArg ??= _dylib.lookupFunction< - _c_clang_Type_getObjCTypeArg, - _dart_clang_Type_getObjCTypeArg>('clang_Type_getObjCTypeArg'))( + return (_clang_Type_getObjCTypeArg ??= + _lookup>( + 'clang_Type_getObjCTypeArg') + .asFunction<_dart_clang_Type_getObjCTypeArg>())( T, i, ); @@ -3089,9 +3195,10 @@ class LibClang { int clang_isFunctionTypeVariadic( CXType T, ) { - return (_clang_isFunctionTypeVariadic ??= _dylib.lookupFunction< - _c_clang_isFunctionTypeVariadic, - _dart_clang_isFunctionTypeVariadic>('clang_isFunctionTypeVariadic'))( + return (_clang_isFunctionTypeVariadic ??= + _lookup>( + 'clang_isFunctionTypeVariadic') + .asFunction<_dart_clang_isFunctionTypeVariadic>())( T, ); } @@ -3104,9 +3211,10 @@ class LibClang { CXType clang_getCursorResultType( CXCursor C, ) { - return (_clang_getCursorResultType ??= _dylib.lookupFunction< - _c_clang_getCursorResultType, - _dart_clang_getCursorResultType>('clang_getCursorResultType'))( + return (_clang_getCursorResultType ??= + _lookup>( + 'clang_getCursorResultType') + .asFunction<_dart_clang_getCursorResultType>())( C, ); } @@ -3120,10 +3228,11 @@ class LibClang { int clang_getCursorExceptionSpecificationType( CXCursor C, ) { - return (_clang_getCursorExceptionSpecificationType ??= - _dylib.lookupFunction<_c_clang_getCursorExceptionSpecificationType, - _dart_clang_getCursorExceptionSpecificationType>( - 'clang_getCursorExceptionSpecificationType'))( + return (_clang_getCursorExceptionSpecificationType ??= _lookup< + ffi.NativeFunction< + _c_clang_getCursorExceptionSpecificationType>>( + 'clang_getCursorExceptionSpecificationType') + .asFunction<_dart_clang_getCursorExceptionSpecificationType>())( C, ); } @@ -3137,8 +3246,8 @@ class LibClang { CXType T, ) { return (_clang_isPODType ??= - _dylib.lookupFunction<_c_clang_isPODType, _dart_clang_isPODType>( - 'clang_isPODType'))( + _lookup>('clang_isPODType') + .asFunction<_dart_clang_isPODType>())( T, ); } @@ -3152,9 +3261,10 @@ class LibClang { CXType clang_getElementType( CXType T, ) { - return (_clang_getElementType ??= _dylib.lookupFunction< - _c_clang_getElementType, - _dart_clang_getElementType>('clang_getElementType'))( + return (_clang_getElementType ??= + _lookup>( + 'clang_getElementType') + .asFunction<_dart_clang_getElementType>())( T, ); } @@ -3168,9 +3278,10 @@ class LibClang { int clang_getNumElements( CXType T, ) { - return (_clang_getNumElements ??= _dylib.lookupFunction< - _c_clang_getNumElements, - _dart_clang_getNumElements>('clang_getNumElements'))( + return (_clang_getNumElements ??= + _lookup>( + 'clang_getNumElements') + .asFunction<_dart_clang_getNumElements>())( T, ); } @@ -3183,9 +3294,10 @@ class LibClang { CXType clang_getArrayElementType( CXType T, ) { - return (_clang_getArrayElementType ??= _dylib.lookupFunction< - _c_clang_getArrayElementType, - _dart_clang_getArrayElementType>('clang_getArrayElementType'))( + return (_clang_getArrayElementType ??= + _lookup>( + 'clang_getArrayElementType') + .asFunction<_dart_clang_getArrayElementType>())( T, ); } @@ -3199,8 +3311,8 @@ class LibClang { CXType T, ) { return (_clang_getArraySize ??= - _dylib.lookupFunction<_c_clang_getArraySize, _dart_clang_getArraySize>( - 'clang_getArraySize'))( + _lookup>('clang_getArraySize') + .asFunction<_dart_clang_getArraySize>())( T, ); } @@ -3213,9 +3325,10 @@ class LibClang { CXType clang_Type_getNamedType( CXType T, ) { - return (_clang_Type_getNamedType ??= _dylib.lookupFunction< - _c_clang_Type_getNamedType, - _dart_clang_Type_getNamedType>('clang_Type_getNamedType'))( + return (_clang_Type_getNamedType ??= + _lookup>( + 'clang_Type_getNamedType') + .asFunction<_dart_clang_Type_getNamedType>())( T, ); } @@ -3231,10 +3344,10 @@ class LibClang { int clang_Type_isTransparentTagTypedef( CXType T, ) { - return (_clang_Type_isTransparentTagTypedef ??= _dylib.lookupFunction< - _c_clang_Type_isTransparentTagTypedef, - _dart_clang_Type_isTransparentTagTypedef>( - 'clang_Type_isTransparentTagTypedef'))( + return (_clang_Type_isTransparentTagTypedef ??= + _lookup>( + 'clang_Type_isTransparentTagTypedef') + .asFunction<_dart_clang_Type_isTransparentTagTypedef>())( T, ); } @@ -3245,9 +3358,10 @@ class LibClang { int clang_Type_getNullability( CXType T, ) { - return (_clang_Type_getNullability ??= _dylib.lookupFunction< - _c_clang_Type_getNullability, - _dart_clang_Type_getNullability>('clang_Type_getNullability'))( + return (_clang_Type_getNullability ??= + _lookup>( + 'clang_Type_getNullability') + .asFunction<_dart_clang_Type_getNullability>())( T, ); } @@ -3267,9 +3381,10 @@ class LibClang { int clang_Type_getAlignOf( CXType T, ) { - return (_clang_Type_getAlignOf ??= _dylib.lookupFunction< - _c_clang_Type_getAlignOf, - _dart_clang_Type_getAlignOf>('clang_Type_getAlignOf'))( + return (_clang_Type_getAlignOf ??= + _lookup>( + 'clang_Type_getAlignOf') + .asFunction<_dart_clang_Type_getAlignOf>())( T, ); } @@ -3282,9 +3397,10 @@ class LibClang { CXType clang_Type_getClassType( CXType T, ) { - return (_clang_Type_getClassType ??= _dylib.lookupFunction< - _c_clang_Type_getClassType, - _dart_clang_Type_getClassType>('clang_Type_getClassType'))( + return (_clang_Type_getClassType ??= + _lookup>( + 'clang_Type_getClassType') + .asFunction<_dart_clang_Type_getClassType>())( T, ); } @@ -3301,9 +3417,10 @@ class LibClang { int clang_Type_getSizeOf( CXType T, ) { - return (_clang_Type_getSizeOf ??= _dylib.lookupFunction< - _c_clang_Type_getSizeOf, - _dart_clang_Type_getSizeOf>('clang_Type_getSizeOf'))( + return (_clang_Type_getSizeOf ??= + _lookup>( + 'clang_Type_getSizeOf') + .asFunction<_dart_clang_Type_getSizeOf>())( T, ); } @@ -3325,9 +3442,10 @@ class LibClang { CXType T, ffi.Pointer S, ) { - return (_clang_Type_getOffsetOf ??= _dylib.lookupFunction< - _c_clang_Type_getOffsetOf, - _dart_clang_Type_getOffsetOf>('clang_Type_getOffsetOf'))( + return (_clang_Type_getOffsetOf ??= + _lookup>( + 'clang_Type_getOffsetOf') + .asFunction<_dart_clang_Type_getOffsetOf>())( T, S, ); @@ -3341,9 +3459,10 @@ class LibClang { CXType clang_Type_getModifiedType( CXType T, ) { - return (_clang_Type_getModifiedType ??= _dylib.lookupFunction< - _c_clang_Type_getModifiedType, - _dart_clang_Type_getModifiedType>('clang_Type_getModifiedType'))( + return (_clang_Type_getModifiedType ??= + _lookup>( + 'clang_Type_getModifiedType') + .asFunction<_dart_clang_Type_getModifiedType>())( T, ); } @@ -3364,9 +3483,10 @@ class LibClang { int clang_Cursor_getOffsetOfField( CXCursor C, ) { - return (_clang_Cursor_getOffsetOfField ??= _dylib.lookupFunction< - _c_clang_Cursor_getOffsetOfField, - _dart_clang_Cursor_getOffsetOfField>('clang_Cursor_getOffsetOfField'))( + return (_clang_Cursor_getOffsetOfField ??= + _lookup>( + 'clang_Cursor_getOffsetOfField') + .asFunction<_dart_clang_Cursor_getOffsetOfField>())( C, ); } @@ -3378,9 +3498,10 @@ class LibClang { int clang_Cursor_isAnonymous( CXCursor C, ) { - return (_clang_Cursor_isAnonymous ??= _dylib.lookupFunction< - _c_clang_Cursor_isAnonymous, - _dart_clang_Cursor_isAnonymous>('clang_Cursor_isAnonymous'))( + return (_clang_Cursor_isAnonymous ??= + _lookup>( + 'clang_Cursor_isAnonymous') + .asFunction<_dart_clang_Cursor_isAnonymous>())( C, ); } @@ -3392,10 +3513,10 @@ class LibClang { int clang_Cursor_isAnonymousRecordDecl( CXCursor C, ) { - return (_clang_Cursor_isAnonymousRecordDecl ??= _dylib.lookupFunction< - _c_clang_Cursor_isAnonymousRecordDecl, - _dart_clang_Cursor_isAnonymousRecordDecl>( - 'clang_Cursor_isAnonymousRecordDecl'))( + return (_clang_Cursor_isAnonymousRecordDecl ??= + _lookup>( + 'clang_Cursor_isAnonymousRecordDecl') + .asFunction<_dart_clang_Cursor_isAnonymousRecordDecl>())( C, ); } @@ -3407,10 +3528,10 @@ class LibClang { int clang_Cursor_isInlineNamespace( CXCursor C, ) { - return (_clang_Cursor_isInlineNamespace ??= _dylib.lookupFunction< - _c_clang_Cursor_isInlineNamespace, - _dart_clang_Cursor_isInlineNamespace>( - 'clang_Cursor_isInlineNamespace'))( + return (_clang_Cursor_isInlineNamespace ??= + _lookup>( + 'clang_Cursor_isInlineNamespace') + .asFunction<_dart_clang_Cursor_isInlineNamespace>())( C, ); } @@ -3422,10 +3543,10 @@ class LibClang { int clang_Type_getNumTemplateArguments( CXType T, ) { - return (_clang_Type_getNumTemplateArguments ??= _dylib.lookupFunction< - _c_clang_Type_getNumTemplateArguments, - _dart_clang_Type_getNumTemplateArguments>( - 'clang_Type_getNumTemplateArguments'))( + return (_clang_Type_getNumTemplateArguments ??= + _lookup>( + 'clang_Type_getNumTemplateArguments') + .asFunction<_dart_clang_Type_getNumTemplateArguments>())( T, ); } @@ -3441,10 +3562,10 @@ class LibClang { CXType T, int i, ) { - return (_clang_Type_getTemplateArgumentAsType ??= _dylib.lookupFunction< - _c_clang_Type_getTemplateArgumentAsType, - _dart_clang_Type_getTemplateArgumentAsType>( - 'clang_Type_getTemplateArgumentAsType'))( + return (_clang_Type_getTemplateArgumentAsType ??= + _lookup>( + 'clang_Type_getTemplateArgumentAsType') + .asFunction<_dart_clang_Type_getTemplateArgumentAsType>())( T, i, ); @@ -3460,9 +3581,10 @@ class LibClang { int clang_Type_getCXXRefQualifier( CXType T, ) { - return (_clang_Type_getCXXRefQualifier ??= _dylib.lookupFunction< - _c_clang_Type_getCXXRefQualifier, - _dart_clang_Type_getCXXRefQualifier>('clang_Type_getCXXRefQualifier'))( + return (_clang_Type_getCXXRefQualifier ??= + _lookup>( + 'clang_Type_getCXXRefQualifier') + .asFunction<_dart_clang_Type_getCXXRefQualifier>())( T, ); } @@ -3474,9 +3596,10 @@ class LibClang { int clang_Cursor_isBitField( CXCursor C, ) { - return (_clang_Cursor_isBitField ??= _dylib.lookupFunction< - _c_clang_Cursor_isBitField, - _dart_clang_Cursor_isBitField>('clang_Cursor_isBitField'))( + return (_clang_Cursor_isBitField ??= + _lookup>( + 'clang_Cursor_isBitField') + .asFunction<_dart_clang_Cursor_isBitField>())( C, ); } @@ -3488,9 +3611,10 @@ class LibClang { int clang_isVirtualBase( CXCursor arg0, ) { - return (_clang_isVirtualBase ??= _dylib.lookupFunction< - _c_clang_isVirtualBase, - _dart_clang_isVirtualBase>('clang_isVirtualBase'))( + return (_clang_isVirtualBase ??= + _lookup>( + 'clang_isVirtualBase') + .asFunction<_dart_clang_isVirtualBase>())( arg0, ); } @@ -3505,9 +3629,10 @@ class LibClang { int clang_getCXXAccessSpecifier( CXCursor arg0, ) { - return (_clang_getCXXAccessSpecifier ??= _dylib.lookupFunction< - _c_clang_getCXXAccessSpecifier, - _dart_clang_getCXXAccessSpecifier>('clang_getCXXAccessSpecifier'))( + return (_clang_getCXXAccessSpecifier ??= + _lookup>( + 'clang_getCXXAccessSpecifier') + .asFunction<_dart_clang_getCXXAccessSpecifier>())( arg0, ); } @@ -3521,9 +3646,10 @@ class LibClang { int clang_Cursor_getStorageClass( CXCursor arg0, ) { - return (_clang_Cursor_getStorageClass ??= _dylib.lookupFunction< - _c_clang_Cursor_getStorageClass, - _dart_clang_Cursor_getStorageClass>('clang_Cursor_getStorageClass'))( + return (_clang_Cursor_getStorageClass ??= + _lookup>( + 'clang_Cursor_getStorageClass') + .asFunction<_dart_clang_Cursor_getStorageClass>())( arg0, ); } @@ -3540,9 +3666,10 @@ class LibClang { int clang_getNumOverloadedDecls( CXCursor cursor, ) { - return (_clang_getNumOverloadedDecls ??= _dylib.lookupFunction< - _c_clang_getNumOverloadedDecls, - _dart_clang_getNumOverloadedDecls>('clang_getNumOverloadedDecls'))( + return (_clang_getNumOverloadedDecls ??= + _lookup>( + 'clang_getNumOverloadedDecls') + .asFunction<_dart_clang_getNumOverloadedDecls>())( cursor, ); } @@ -3565,9 +3692,10 @@ class LibClang { CXCursor cursor, int index, ) { - return (_clang_getOverloadedDecl ??= _dylib.lookupFunction< - _c_clang_getOverloadedDecl, - _dart_clang_getOverloadedDecl>('clang_getOverloadedDecl'))( + return (_clang_getOverloadedDecl ??= + _lookup>( + 'clang_getOverloadedDecl') + .asFunction<_dart_clang_getOverloadedDecl>())( cursor, index, ); @@ -3580,10 +3708,10 @@ class LibClang { CXType clang_getIBOutletCollectionType( CXCursor arg0, ) { - return (_clang_getIBOutletCollectionType ??= _dylib.lookupFunction< - _c_clang_getIBOutletCollectionType, - _dart_clang_getIBOutletCollectionType>( - 'clang_getIBOutletCollectionType'))( + return (_clang_getIBOutletCollectionType ??= + _lookup>( + 'clang_getIBOutletCollectionType') + .asFunction<_dart_clang_getIBOutletCollectionType>())( arg0, ); } @@ -3615,9 +3743,10 @@ class LibClang { ffi.Pointer> visitor, ffi.Pointer client_data, ) { - return (_clang_visitChildren ??= _dylib.lookupFunction< - _c_clang_visitChildren, - _dart_clang_visitChildren>('clang_visitChildren'))( + return (_clang_visitChildren ??= + _lookup>( + 'clang_visitChildren') + .asFunction<_dart_clang_visitChildren>())( parent, visitor, client_data, @@ -3637,8 +3766,8 @@ class LibClang { CXCursor arg0, ) { return (_clang_getCursorUSR ??= - _dylib.lookupFunction<_c_clang_getCursorUSR, _dart_clang_getCursorUSR>( - 'clang_getCursorUSR'))( + _lookup>('clang_getCursorUSR') + .asFunction<_dart_clang_getCursorUSR>())( arg0, ); } @@ -3649,9 +3778,10 @@ class LibClang { 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'))( + return (_clang_constructUSR_ObjCClass ??= + _lookup>( + 'clang_constructUSR_ObjCClass') + .asFunction<_dart_clang_constructUSR_ObjCClass>())( class_name, ); } @@ -3663,10 +3793,10 @@ class LibClang { 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'))( + return (_clang_constructUSR_ObjCCategory ??= + _lookup>( + 'clang_constructUSR_ObjCCategory') + .asFunction<_dart_clang_constructUSR_ObjCCategory>())( class_name, category_name, ); @@ -3678,10 +3808,10 @@ class LibClang { 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'))( + return (_clang_constructUSR_ObjCProtocol ??= + _lookup>( + 'clang_constructUSR_ObjCProtocol') + .asFunction<_dart_clang_constructUSR_ObjCProtocol>())( protocol_name, ); } @@ -3694,9 +3824,10 @@ class LibClang { ffi.Pointer name, CXString classUSR, ) { - return (_clang_constructUSR_ObjCIvar ??= _dylib.lookupFunction< - _c_clang_constructUSR_ObjCIvar, - _dart_clang_constructUSR_ObjCIvar>('clang_constructUSR_ObjCIvar'))( + return (_clang_constructUSR_ObjCIvar ??= + _lookup>( + 'clang_constructUSR_ObjCIvar') + .asFunction<_dart_clang_constructUSR_ObjCIvar>())( name, classUSR, ); @@ -3711,9 +3842,10 @@ class LibClang { int isInstanceMethod, CXString classUSR, ) { - return (_clang_constructUSR_ObjCMethod ??= _dylib.lookupFunction< - _c_clang_constructUSR_ObjCMethod, - _dart_clang_constructUSR_ObjCMethod>('clang_constructUSR_ObjCMethod'))( + return (_clang_constructUSR_ObjCMethod ??= + _lookup>( + 'clang_constructUSR_ObjCMethod') + .asFunction<_dart_clang_constructUSR_ObjCMethod>())( name, isInstanceMethod, classUSR, @@ -3728,10 +3860,10 @@ class LibClang { ffi.Pointer property, CXString classUSR, ) { - return (_clang_constructUSR_ObjCProperty ??= _dylib.lookupFunction< - _c_clang_constructUSR_ObjCProperty, - _dart_clang_constructUSR_ObjCProperty>( - 'clang_constructUSR_ObjCProperty'))( + return (_clang_constructUSR_ObjCProperty ??= + _lookup>( + 'clang_constructUSR_ObjCProperty') + .asFunction<_dart_clang_constructUSR_ObjCProperty>())( property, classUSR, ); @@ -3743,9 +3875,10 @@ class LibClang { CXString clang_getCursorSpelling( CXCursor arg0, ) { - return (_clang_getCursorSpelling ??= _dylib.lookupFunction< - _c_clang_getCursorSpelling, - _dart_clang_getCursorSpelling>('clang_getCursorSpelling'))( + return (_clang_getCursorSpelling ??= + _lookup>( + 'clang_getCursorSpelling') + .asFunction<_dart_clang_getCursorSpelling>())( arg0, ); } @@ -3766,10 +3899,10 @@ class LibClang { int pieceIndex, int options, ) { - return (_clang_Cursor_getSpellingNameRange ??= _dylib.lookupFunction< - _c_clang_Cursor_getSpellingNameRange, - _dart_clang_Cursor_getSpellingNameRange>( - 'clang_Cursor_getSpellingNameRange'))( + return (_clang_Cursor_getSpellingNameRange ??= + _lookup>( + 'clang_Cursor_getSpellingNameRange') + .asFunction<_dart_clang_Cursor_getSpellingNameRange>())( arg0, pieceIndex, options, @@ -3783,10 +3916,10 @@ class LibClang { ffi.Pointer Policy, int Property, ) { - return (_clang_PrintingPolicy_getProperty ??= _dylib.lookupFunction< - _c_clang_PrintingPolicy_getProperty, - _dart_clang_PrintingPolicy_getProperty>( - 'clang_PrintingPolicy_getProperty'))( + return (_clang_PrintingPolicy_getProperty ??= + _lookup>( + 'clang_PrintingPolicy_getProperty') + .asFunction<_dart_clang_PrintingPolicy_getProperty>())( Policy, Property, ); @@ -3800,10 +3933,10 @@ class LibClang { int Property, int Value, ) { - return (_clang_PrintingPolicy_setProperty ??= _dylib.lookupFunction< - _c_clang_PrintingPolicy_setProperty, - _dart_clang_PrintingPolicy_setProperty>( - 'clang_PrintingPolicy_setProperty'))( + return (_clang_PrintingPolicy_setProperty ??= + _lookup>( + 'clang_PrintingPolicy_setProperty') + .asFunction<_dart_clang_PrintingPolicy_setProperty>())( Policy, Property, Value, @@ -3819,9 +3952,10 @@ class LibClang { ffi.Pointer clang_getCursorPrintingPolicy( CXCursor arg0, ) { - return (_clang_getCursorPrintingPolicy ??= _dylib.lookupFunction< - _c_clang_getCursorPrintingPolicy, - _dart_clang_getCursorPrintingPolicy>('clang_getCursorPrintingPolicy'))( + return (_clang_getCursorPrintingPolicy ??= + _lookup>( + 'clang_getCursorPrintingPolicy') + .asFunction<_dart_clang_getCursorPrintingPolicy>())( arg0, ); } @@ -3832,9 +3966,10 @@ class LibClang { void clang_PrintingPolicy_dispose( ffi.Pointer Policy, ) { - return (_clang_PrintingPolicy_dispose ??= _dylib.lookupFunction< - _c_clang_PrintingPolicy_dispose, - _dart_clang_PrintingPolicy_dispose>('clang_PrintingPolicy_dispose'))( + return (_clang_PrintingPolicy_dispose ??= + _lookup>( + 'clang_PrintingPolicy_dispose') + .asFunction<_dart_clang_PrintingPolicy_dispose>())( Policy, ); } @@ -3854,9 +3989,10 @@ class LibClang { CXCursor Cursor, ffi.Pointer Policy, ) { - return (_clang_getCursorPrettyPrinted ??= _dylib.lookupFunction< - _c_clang_getCursorPrettyPrinted, - _dart_clang_getCursorPrettyPrinted>('clang_getCursorPrettyPrinted'))( + return (_clang_getCursorPrettyPrinted ??= + _lookup>( + 'clang_getCursorPrettyPrinted') + .asFunction<_dart_clang_getCursorPrettyPrinted>())( Cursor, Policy, ); @@ -3872,9 +4008,10 @@ class LibClang { CXString clang_getCursorDisplayName( CXCursor arg0, ) { - return (_clang_getCursorDisplayName ??= _dylib.lookupFunction< - _c_clang_getCursorDisplayName, - _dart_clang_getCursorDisplayName>('clang_getCursorDisplayName'))( + return (_clang_getCursorDisplayName ??= + _lookup>( + 'clang_getCursorDisplayName') + .asFunction<_dart_clang_getCursorDisplayName>())( arg0, ); } @@ -3893,9 +4030,10 @@ class LibClang { CXCursor clang_getCursorReferenced( CXCursor arg0, ) { - return (_clang_getCursorReferenced ??= _dylib.lookupFunction< - _c_clang_getCursorReferenced, - _dart_clang_getCursorReferenced>('clang_getCursorReferenced'))( + return (_clang_getCursorReferenced ??= + _lookup>( + 'clang_getCursorReferenced') + .asFunction<_dart_clang_getCursorReferenced>())( arg0, ); } @@ -3931,9 +4069,10 @@ class LibClang { CXCursor clang_getCursorDefinition( CXCursor arg0, ) { - return (_clang_getCursorDefinition ??= _dylib.lookupFunction< - _c_clang_getCursorDefinition, - _dart_clang_getCursorDefinition>('clang_getCursorDefinition'))( + return (_clang_getCursorDefinition ??= + _lookup>( + 'clang_getCursorDefinition') + .asFunction<_dart_clang_getCursorDefinition>())( arg0, ); } @@ -3945,9 +4084,10 @@ class LibClang { int clang_isCursorDefinition( CXCursor arg0, ) { - return (_clang_isCursorDefinition ??= _dylib.lookupFunction< - _c_clang_isCursorDefinition, - _dart_clang_isCursorDefinition>('clang_isCursorDefinition'))( + return (_clang_isCursorDefinition ??= + _lookup>( + 'clang_isCursorDefinition') + .asFunction<_dart_clang_isCursorDefinition>())( arg0, ); } @@ -3979,9 +4119,10 @@ class LibClang { CXCursor clang_getCanonicalCursor( CXCursor arg0, ) { - return (_clang_getCanonicalCursor ??= _dylib.lookupFunction< - _c_clang_getCanonicalCursor, - _dart_clang_getCanonicalCursor>('clang_getCanonicalCursor'))( + return (_clang_getCanonicalCursor ??= + _lookup>( + 'clang_getCanonicalCursor') + .asFunction<_dart_clang_getCanonicalCursor>())( arg0, ); } @@ -4000,10 +4141,10 @@ class LibClang { int clang_Cursor_getObjCSelectorIndex( CXCursor arg0, ) { - return (_clang_Cursor_getObjCSelectorIndex ??= _dylib.lookupFunction< - _c_clang_Cursor_getObjCSelectorIndex, - _dart_clang_Cursor_getObjCSelectorIndex>( - 'clang_Cursor_getObjCSelectorIndex'))( + return (_clang_Cursor_getObjCSelectorIndex ??= + _lookup>( + 'clang_Cursor_getObjCSelectorIndex') + .asFunction<_dart_clang_Cursor_getObjCSelectorIndex>())( arg0, ); } @@ -4022,9 +4163,10 @@ class LibClang { int clang_Cursor_isDynamicCall( CXCursor C, ) { - return (_clang_Cursor_isDynamicCall ??= _dylib.lookupFunction< - _c_clang_Cursor_isDynamicCall, - _dart_clang_Cursor_isDynamicCall>('clang_Cursor_isDynamicCall'))( + return (_clang_Cursor_isDynamicCall ??= + _lookup>( + 'clang_Cursor_isDynamicCall') + .asFunction<_dart_clang_Cursor_isDynamicCall>())( C, ); } @@ -4036,9 +4178,10 @@ class LibClang { CXType clang_Cursor_getReceiverType( CXCursor C, ) { - return (_clang_Cursor_getReceiverType ??= _dylib.lookupFunction< - _c_clang_Cursor_getReceiverType, - _dart_clang_Cursor_getReceiverType>('clang_Cursor_getReceiverType'))( + return (_clang_Cursor_getReceiverType ??= + _lookup>( + 'clang_Cursor_getReceiverType') + .asFunction<_dart_clang_Cursor_getReceiverType>())( C, ); } @@ -4054,10 +4197,10 @@ class LibClang { CXCursor C, int reserved, ) { - return (_clang_Cursor_getObjCPropertyAttributes ??= _dylib.lookupFunction< - _c_clang_Cursor_getObjCPropertyAttributes, - _dart_clang_Cursor_getObjCPropertyAttributes>( - 'clang_Cursor_getObjCPropertyAttributes'))( + return (_clang_Cursor_getObjCPropertyAttributes ??= + _lookup>( + 'clang_Cursor_getObjCPropertyAttributes') + .asFunction<_dart_clang_Cursor_getObjCPropertyAttributes>())( C, reserved, ); @@ -4071,10 +4214,10 @@ class LibClang { CXString clang_Cursor_getObjCPropertyGetterName( CXCursor C, ) { - return (_clang_Cursor_getObjCPropertyGetterName ??= _dylib.lookupFunction< - _c_clang_Cursor_getObjCPropertyGetterName, - _dart_clang_Cursor_getObjCPropertyGetterName>( - 'clang_Cursor_getObjCPropertyGetterName'))( + return (_clang_Cursor_getObjCPropertyGetterName ??= + _lookup>( + 'clang_Cursor_getObjCPropertyGetterName') + .asFunction<_dart_clang_Cursor_getObjCPropertyGetterName>())( C, ); } @@ -4087,10 +4230,10 @@ class LibClang { CXString clang_Cursor_getObjCPropertySetterName( CXCursor C, ) { - return (_clang_Cursor_getObjCPropertySetterName ??= _dylib.lookupFunction< - _c_clang_Cursor_getObjCPropertySetterName, - _dart_clang_Cursor_getObjCPropertySetterName>( - 'clang_Cursor_getObjCPropertySetterName'))( + return (_clang_Cursor_getObjCPropertySetterName ??= + _lookup>( + 'clang_Cursor_getObjCPropertySetterName') + .asFunction<_dart_clang_Cursor_getObjCPropertySetterName>())( C, ); } @@ -4105,10 +4248,10 @@ class LibClang { int clang_Cursor_getObjCDeclQualifiers( CXCursor C, ) { - return (_clang_Cursor_getObjCDeclQualifiers ??= _dylib.lookupFunction< - _c_clang_Cursor_getObjCDeclQualifiers, - _dart_clang_Cursor_getObjCDeclQualifiers>( - 'clang_Cursor_getObjCDeclQualifiers'))( + return (_clang_Cursor_getObjCDeclQualifiers ??= + _lookup>( + 'clang_Cursor_getObjCDeclQualifiers') + .asFunction<_dart_clang_Cursor_getObjCDeclQualifiers>())( C, ); } @@ -4121,9 +4264,10 @@ class LibClang { int clang_Cursor_isObjCOptional( CXCursor C, ) { - return (_clang_Cursor_isObjCOptional ??= _dylib.lookupFunction< - _c_clang_Cursor_isObjCOptional, - _dart_clang_Cursor_isObjCOptional>('clang_Cursor_isObjCOptional'))( + return (_clang_Cursor_isObjCOptional ??= + _lookup>( + 'clang_Cursor_isObjCOptional') + .asFunction<_dart_clang_Cursor_isObjCOptional>())( C, ); } @@ -4134,9 +4278,10 @@ class LibClang { int clang_Cursor_isVariadic( CXCursor C, ) { - return (_clang_Cursor_isVariadic ??= _dylib.lookupFunction< - _c_clang_Cursor_isVariadic, - _dart_clang_Cursor_isVariadic>('clang_Cursor_isVariadic'))( + return (_clang_Cursor_isVariadic ??= + _lookup>( + 'clang_Cursor_isVariadic') + .asFunction<_dart_clang_Cursor_isVariadic>())( C, ); } @@ -4160,9 +4305,10 @@ class LibClang { ffi.Pointer definedIn, ffi.Pointer isGenerated, ) { - return (_clang_Cursor_isExternalSymbol ??= _dylib.lookupFunction< - _c_clang_Cursor_isExternalSymbol, - _dart_clang_Cursor_isExternalSymbol>('clang_Cursor_isExternalSymbol'))( + return (_clang_Cursor_isExternalSymbol ??= + _lookup>( + 'clang_Cursor_isExternalSymbol') + .asFunction<_dart_clang_Cursor_isExternalSymbol>())( C, language, definedIn, @@ -4178,9 +4324,10 @@ class LibClang { CXSourceRange clang_Cursor_getCommentRange( CXCursor C, ) { - return (_clang_Cursor_getCommentRange ??= _dylib.lookupFunction< - _c_clang_Cursor_getCommentRange, - _dart_clang_Cursor_getCommentRange>('clang_Cursor_getCommentRange'))( + return (_clang_Cursor_getCommentRange ??= + _lookup>( + 'clang_Cursor_getCommentRange') + .asFunction<_dart_clang_Cursor_getCommentRange>())( C, ); } @@ -4192,10 +4339,10 @@ class LibClang { CXString clang_Cursor_getRawCommentText( CXCursor C, ) { - return (_clang_Cursor_getRawCommentText ??= _dylib.lookupFunction< - _c_clang_Cursor_getRawCommentText, - _dart_clang_Cursor_getRawCommentText>( - 'clang_Cursor_getRawCommentText'))( + return (_clang_Cursor_getRawCommentText ??= + _lookup>( + 'clang_Cursor_getRawCommentText') + .asFunction<_dart_clang_Cursor_getRawCommentText>())( C, ); } @@ -4208,10 +4355,10 @@ class LibClang { CXString clang_Cursor_getBriefCommentText( CXCursor C, ) { - return (_clang_Cursor_getBriefCommentText ??= _dylib.lookupFunction< - _c_clang_Cursor_getBriefCommentText, - _dart_clang_Cursor_getBriefCommentText>( - 'clang_Cursor_getBriefCommentText'))( + return (_clang_Cursor_getBriefCommentText ??= + _lookup>( + 'clang_Cursor_getBriefCommentText') + .asFunction<_dart_clang_Cursor_getBriefCommentText>())( C, ); } @@ -4222,9 +4369,10 @@ class LibClang { CXString clang_Cursor_getMangling( CXCursor arg0, ) { - return (_clang_Cursor_getMangling ??= _dylib.lookupFunction< - _c_clang_Cursor_getMangling, - _dart_clang_Cursor_getMangling>('clang_Cursor_getMangling'))( + return (_clang_Cursor_getMangling ??= + _lookup>( + 'clang_Cursor_getMangling') + .asFunction<_dart_clang_Cursor_getMangling>())( arg0, ); } @@ -4236,9 +4384,10 @@ class LibClang { ffi.Pointer clang_Cursor_getCXXManglings( CXCursor arg0, ) { - return (_clang_Cursor_getCXXManglings ??= _dylib.lookupFunction< - _c_clang_Cursor_getCXXManglings, - _dart_clang_Cursor_getCXXManglings>('clang_Cursor_getCXXManglings'))( + return (_clang_Cursor_getCXXManglings ??= + _lookup>( + 'clang_Cursor_getCXXManglings') + .asFunction<_dart_clang_Cursor_getCXXManglings>())( arg0, ); } @@ -4250,9 +4399,10 @@ class LibClang { ffi.Pointer clang_Cursor_getObjCManglings( CXCursor arg0, ) { - return (_clang_Cursor_getObjCManglings ??= _dylib.lookupFunction< - _c_clang_Cursor_getObjCManglings, - _dart_clang_Cursor_getObjCManglings>('clang_Cursor_getObjCManglings'))( + return (_clang_Cursor_getObjCManglings ??= + _lookup>( + 'clang_Cursor_getObjCManglings') + .asFunction<_dart_clang_Cursor_getObjCManglings>())( arg0, ); } @@ -4263,9 +4413,10 @@ class LibClang { ffi.Pointer clang_Cursor_getModule( CXCursor C, ) { - return (_clang_Cursor_getModule ??= _dylib.lookupFunction< - _c_clang_Cursor_getModule, - _dart_clang_Cursor_getModule>('clang_Cursor_getModule'))( + return (_clang_Cursor_getModule ??= + _lookup>( + 'clang_Cursor_getModule') + .asFunction<_dart_clang_Cursor_getModule>())( C, ); } @@ -4278,9 +4429,10 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer arg1, ) { - return (_clang_getModuleForFile ??= _dylib.lookupFunction< - _c_clang_getModuleForFile, - _dart_clang_getModuleForFile>('clang_getModuleForFile'))( + return (_clang_getModuleForFile ??= + _lookup>( + 'clang_getModuleForFile') + .asFunction<_dart_clang_getModuleForFile>())( arg0, arg1, ); @@ -4294,9 +4446,10 @@ class LibClang { 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'))( + return (_clang_Module_getASTFile ??= + _lookup>( + 'clang_Module_getASTFile') + .asFunction<_dart_clang_Module_getASTFile>())( Module, ); } @@ -4310,9 +4463,10 @@ class LibClang { 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'))( + return (_clang_Module_getParent ??= + _lookup>( + 'clang_Module_getParent') + .asFunction<_dart_clang_Module_getParent>())( Module, ); } @@ -4326,9 +4480,10 @@ class LibClang { CXString clang_Module_getName( ffi.Pointer Module, ) { - return (_clang_Module_getName ??= _dylib.lookupFunction< - _c_clang_Module_getName, - _dart_clang_Module_getName>('clang_Module_getName'))( + return (_clang_Module_getName ??= + _lookup>( + 'clang_Module_getName') + .asFunction<_dart_clang_Module_getName>())( Module, ); } @@ -4341,9 +4496,10 @@ class LibClang { CXString clang_Module_getFullName( ffi.Pointer Module, ) { - return (_clang_Module_getFullName ??= _dylib.lookupFunction< - _c_clang_Module_getFullName, - _dart_clang_Module_getFullName>('clang_Module_getFullName'))( + return (_clang_Module_getFullName ??= + _lookup>( + 'clang_Module_getFullName') + .asFunction<_dart_clang_Module_getFullName>())( Module, ); } @@ -4356,9 +4512,10 @@ class LibClang { int clang_Module_isSystem( ffi.Pointer Module, ) { - return (_clang_Module_isSystem ??= _dylib.lookupFunction< - _c_clang_Module_isSystem, - _dart_clang_Module_isSystem>('clang_Module_isSystem'))( + return (_clang_Module_isSystem ??= + _lookup>( + 'clang_Module_isSystem') + .asFunction<_dart_clang_Module_isSystem>())( Module, ); } @@ -4372,10 +4529,10 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer Module, ) { - return (_clang_Module_getNumTopLevelHeaders ??= _dylib.lookupFunction< - _c_clang_Module_getNumTopLevelHeaders, - _dart_clang_Module_getNumTopLevelHeaders>( - 'clang_Module_getNumTopLevelHeaders'))( + return (_clang_Module_getNumTopLevelHeaders ??= + _lookup>( + 'clang_Module_getNumTopLevelHeaders') + .asFunction<_dart_clang_Module_getNumTopLevelHeaders>())( arg0, Module, ); @@ -4393,10 +4550,10 @@ class LibClang { ffi.Pointer Module, int Index, ) { - return (_clang_Module_getTopLevelHeader ??= _dylib.lookupFunction< - _c_clang_Module_getTopLevelHeader, - _dart_clang_Module_getTopLevelHeader>( - 'clang_Module_getTopLevelHeader'))( + return (_clang_Module_getTopLevelHeader ??= + _lookup>( + 'clang_Module_getTopLevelHeader') + .asFunction<_dart_clang_Module_getTopLevelHeader>())( arg0, Module, Index, @@ -4409,10 +4566,11 @@ class LibClang { int clang_CXXConstructor_isConvertingConstructor( CXCursor C, ) { - return (_clang_CXXConstructor_isConvertingConstructor ??= - _dylib.lookupFunction<_c_clang_CXXConstructor_isConvertingConstructor, - _dart_clang_CXXConstructor_isConvertingConstructor>( - 'clang_CXXConstructor_isConvertingConstructor'))( + return (_clang_CXXConstructor_isConvertingConstructor ??= _lookup< + ffi.NativeFunction< + _c_clang_CXXConstructor_isConvertingConstructor>>( + 'clang_CXXConstructor_isConvertingConstructor') + .asFunction<_dart_clang_CXXConstructor_isConvertingConstructor>())( C, ); } @@ -4424,10 +4582,10 @@ class LibClang { int clang_CXXConstructor_isCopyConstructor( CXCursor C, ) { - return (_clang_CXXConstructor_isCopyConstructor ??= _dylib.lookupFunction< - _c_clang_CXXConstructor_isCopyConstructor, - _dart_clang_CXXConstructor_isCopyConstructor>( - 'clang_CXXConstructor_isCopyConstructor'))( + return (_clang_CXXConstructor_isCopyConstructor ??= + _lookup>( + 'clang_CXXConstructor_isCopyConstructor') + .asFunction<_dart_clang_CXXConstructor_isCopyConstructor>())( C, ); } @@ -4439,10 +4597,11 @@ class LibClang { int clang_CXXConstructor_isDefaultConstructor( CXCursor C, ) { - return (_clang_CXXConstructor_isDefaultConstructor ??= - _dylib.lookupFunction<_c_clang_CXXConstructor_isDefaultConstructor, - _dart_clang_CXXConstructor_isDefaultConstructor>( - 'clang_CXXConstructor_isDefaultConstructor'))( + return (_clang_CXXConstructor_isDefaultConstructor ??= _lookup< + ffi.NativeFunction< + _c_clang_CXXConstructor_isDefaultConstructor>>( + 'clang_CXXConstructor_isDefaultConstructor') + .asFunction<_dart_clang_CXXConstructor_isDefaultConstructor>())( C, ); } @@ -4454,10 +4613,10 @@ class LibClang { int clang_CXXConstructor_isMoveConstructor( CXCursor C, ) { - return (_clang_CXXConstructor_isMoveConstructor ??= _dylib.lookupFunction< - _c_clang_CXXConstructor_isMoveConstructor, - _dart_clang_CXXConstructor_isMoveConstructor>( - 'clang_CXXConstructor_isMoveConstructor'))( + return (_clang_CXXConstructor_isMoveConstructor ??= + _lookup>( + 'clang_CXXConstructor_isMoveConstructor') + .asFunction<_dart_clang_CXXConstructor_isMoveConstructor>())( C, ); } @@ -4469,9 +4628,10 @@ class LibClang { int clang_CXXField_isMutable( CXCursor C, ) { - return (_clang_CXXField_isMutable ??= _dylib.lookupFunction< - _c_clang_CXXField_isMutable, - _dart_clang_CXXField_isMutable>('clang_CXXField_isMutable'))( + return (_clang_CXXField_isMutable ??= + _lookup>( + 'clang_CXXField_isMutable') + .asFunction<_dart_clang_CXXField_isMutable>())( C, ); } @@ -4482,9 +4642,10 @@ class LibClang { int clang_CXXMethod_isDefaulted( CXCursor C, ) { - return (_clang_CXXMethod_isDefaulted ??= _dylib.lookupFunction< - _c_clang_CXXMethod_isDefaulted, - _dart_clang_CXXMethod_isDefaulted>('clang_CXXMethod_isDefaulted'))( + return (_clang_CXXMethod_isDefaulted ??= + _lookup>( + 'clang_CXXMethod_isDefaulted') + .asFunction<_dart_clang_CXXMethod_isDefaulted>())( C, ); } @@ -4496,9 +4657,10 @@ class LibClang { int clang_CXXMethod_isPureVirtual( CXCursor C, ) { - return (_clang_CXXMethod_isPureVirtual ??= _dylib.lookupFunction< - _c_clang_CXXMethod_isPureVirtual, - _dart_clang_CXXMethod_isPureVirtual>('clang_CXXMethod_isPureVirtual'))( + return (_clang_CXXMethod_isPureVirtual ??= + _lookup>( + 'clang_CXXMethod_isPureVirtual') + .asFunction<_dart_clang_CXXMethod_isPureVirtual>())( C, ); } @@ -4510,9 +4672,10 @@ class LibClang { int clang_CXXMethod_isStatic( CXCursor C, ) { - return (_clang_CXXMethod_isStatic ??= _dylib.lookupFunction< - _c_clang_CXXMethod_isStatic, - _dart_clang_CXXMethod_isStatic>('clang_CXXMethod_isStatic'))( + return (_clang_CXXMethod_isStatic ??= + _lookup>( + 'clang_CXXMethod_isStatic') + .asFunction<_dart_clang_CXXMethod_isStatic>())( C, ); } @@ -4525,9 +4688,10 @@ class LibClang { int clang_CXXMethod_isVirtual( CXCursor C, ) { - return (_clang_CXXMethod_isVirtual ??= _dylib.lookupFunction< - _c_clang_CXXMethod_isVirtual, - _dart_clang_CXXMethod_isVirtual>('clang_CXXMethod_isVirtual'))( + return (_clang_CXXMethod_isVirtual ??= + _lookup>( + 'clang_CXXMethod_isVirtual') + .asFunction<_dart_clang_CXXMethod_isVirtual>())( C, ); } @@ -4539,9 +4703,10 @@ class LibClang { int clang_CXXRecord_isAbstract( CXCursor C, ) { - return (_clang_CXXRecord_isAbstract ??= _dylib.lookupFunction< - _c_clang_CXXRecord_isAbstract, - _dart_clang_CXXRecord_isAbstract>('clang_CXXRecord_isAbstract'))( + return (_clang_CXXRecord_isAbstract ??= + _lookup>( + 'clang_CXXRecord_isAbstract') + .asFunction<_dart_clang_CXXRecord_isAbstract>())( C, ); } @@ -4552,9 +4717,10 @@ class LibClang { int clang_EnumDecl_isScoped( CXCursor C, ) { - return (_clang_EnumDecl_isScoped ??= _dylib.lookupFunction< - _c_clang_EnumDecl_isScoped, - _dart_clang_EnumDecl_isScoped>('clang_EnumDecl_isScoped'))( + return (_clang_EnumDecl_isScoped ??= + _lookup>( + 'clang_EnumDecl_isScoped') + .asFunction<_dart_clang_EnumDecl_isScoped>())( C, ); } @@ -4566,9 +4732,10 @@ class LibClang { int clang_CXXMethod_isConst( CXCursor C, ) { - return (_clang_CXXMethod_isConst ??= _dylib.lookupFunction< - _c_clang_CXXMethod_isConst, - _dart_clang_CXXMethod_isConst>('clang_CXXMethod_isConst'))( + return (_clang_CXXMethod_isConst ??= + _lookup>( + 'clang_CXXMethod_isConst') + .asFunction<_dart_clang_CXXMethod_isConst>())( C, ); } @@ -4593,9 +4760,10 @@ class LibClang { int clang_getTemplateCursorKind( CXCursor C, ) { - return (_clang_getTemplateCursorKind ??= _dylib.lookupFunction< - _c_clang_getTemplateCursorKind, - _dart_clang_getTemplateCursorKind>('clang_getTemplateCursorKind'))( + return (_clang_getTemplateCursorKind ??= + _lookup>( + 'clang_getTemplateCursorKind') + .asFunction<_dart_clang_getTemplateCursorKind>())( C, ); } @@ -4631,10 +4799,10 @@ class LibClang { CXCursor clang_getSpecializedCursorTemplate( CXCursor C, ) { - return (_clang_getSpecializedCursorTemplate ??= _dylib.lookupFunction< - _c_clang_getSpecializedCursorTemplate, - _dart_clang_getSpecializedCursorTemplate>( - 'clang_getSpecializedCursorTemplate'))( + return (_clang_getSpecializedCursorTemplate ??= + _lookup>( + 'clang_getSpecializedCursorTemplate') + .asFunction<_dart_clang_getSpecializedCursorTemplate>())( C, ); } @@ -4662,10 +4830,10 @@ class LibClang { int NameFlags, int PieceIndex, ) { - return (_clang_getCursorReferenceNameRange ??= _dylib.lookupFunction< - _c_clang_getCursorReferenceNameRange, - _dart_clang_getCursorReferenceNameRange>( - 'clang_getCursorReferenceNameRange'))( + return (_clang_getCursorReferenceNameRange ??= + _lookup>( + 'clang_getCursorReferenceNameRange') + .asFunction<_dart_clang_getCursorReferenceNameRange>())( C, NameFlags, PieceIndex, @@ -4688,8 +4856,8 @@ class LibClang { CXSourceLocation Location, ) { return (_clang_getToken ??= - _dylib.lookupFunction<_c_clang_getToken, _dart_clang_getToken>( - 'clang_getToken'))( + _lookup>('clang_getToken') + .asFunction<_dart_clang_getToken>())( TU, Location, ); @@ -4702,8 +4870,8 @@ class LibClang { CXToken arg0, ) { return (_clang_getTokenKind ??= - _dylib.lookupFunction<_c_clang_getTokenKind, _dart_clang_getTokenKind>( - 'clang_getTokenKind'))( + _lookup>('clang_getTokenKind') + .asFunction<_dart_clang_getTokenKind>())( arg0, ); } @@ -4718,9 +4886,10 @@ class LibClang { ffi.Pointer arg0, CXToken arg1, ) { - return (_clang_getTokenSpelling ??= _dylib.lookupFunction< - _c_clang_getTokenSpelling, - _dart_clang_getTokenSpelling>('clang_getTokenSpelling'))( + return (_clang_getTokenSpelling ??= + _lookup>( + 'clang_getTokenSpelling') + .asFunction<_dart_clang_getTokenSpelling>())( arg0, arg1, ); @@ -4733,9 +4902,10 @@ class LibClang { ffi.Pointer arg0, CXToken arg1, ) { - return (_clang_getTokenLocation ??= _dylib.lookupFunction< - _c_clang_getTokenLocation, - _dart_clang_getTokenLocation>('clang_getTokenLocation'))( + return (_clang_getTokenLocation ??= + _lookup>( + 'clang_getTokenLocation') + .asFunction<_dart_clang_getTokenLocation>())( arg0, arg1, ); @@ -4748,9 +4918,10 @@ class LibClang { ffi.Pointer arg0, CXToken arg1, ) { - return (_clang_getTokenExtent ??= _dylib.lookupFunction< - _c_clang_getTokenExtent, - _dart_clang_getTokenExtent>('clang_getTokenExtent'))( + return (_clang_getTokenExtent ??= + _lookup>( + 'clang_getTokenExtent') + .asFunction<_dart_clang_getTokenExtent>())( arg0, arg1, ); @@ -4779,8 +4950,8 @@ class LibClang { ffi.Pointer NumTokens, ) { return (_clang_tokenize ??= - _dylib.lookupFunction<_c_clang_tokenize, _dart_clang_tokenize>( - 'clang_tokenize'))( + _lookup>('clang_tokenize') + .asFunction<_dart_clang_tokenize>())( TU, Range, Tokens, @@ -4824,9 +4995,10 @@ class LibClang { int NumTokens, ffi.Pointer Cursors, ) { - return (_clang_annotateTokens ??= _dylib.lookupFunction< - _c_clang_annotateTokens, - _dart_clang_annotateTokens>('clang_annotateTokens'))( + return (_clang_annotateTokens ??= + _lookup>( + 'clang_annotateTokens') + .asFunction<_dart_clang_annotateTokens>())( TU, Tokens, NumTokens, @@ -4842,9 +5014,10 @@ class LibClang { ffi.Pointer Tokens, int NumTokens, ) { - return (_clang_disposeTokens ??= _dylib.lookupFunction< - _c_clang_disposeTokens, - _dart_clang_disposeTokens>('clang_disposeTokens'))( + return (_clang_disposeTokens ??= + _lookup>( + 'clang_disposeTokens') + .asFunction<_dart_clang_disposeTokens>())( TU, Tokens, NumTokens, @@ -4862,9 +5035,10 @@ class LibClang { CXString clang_getCursorKindSpelling( int Kind, ) { - return (_clang_getCursorKindSpelling ??= _dylib.lookupFunction< - _c_clang_getCursorKindSpelling, - _dart_clang_getCursorKindSpelling>('clang_getCursorKindSpelling'))( + return (_clang_getCursorKindSpelling ??= + _lookup>( + 'clang_getCursorKindSpelling') + .asFunction<_dart_clang_getCursorKindSpelling>())( Kind, ); } @@ -4880,10 +5054,10 @@ class LibClang { ffi.Pointer endLine, ffi.Pointer endColumn, ) { - return (_clang_getDefinitionSpellingAndExtent ??= _dylib.lookupFunction< - _c_clang_getDefinitionSpellingAndExtent, - _dart_clang_getDefinitionSpellingAndExtent>( - 'clang_getDefinitionSpellingAndExtent'))( + return (_clang_getDefinitionSpellingAndExtent ??= + _lookup>( + 'clang_getDefinitionSpellingAndExtent') + .asFunction<_dart_clang_getDefinitionSpellingAndExtent>())( arg0, startBuf, endBuf, @@ -4898,9 +5072,10 @@ class LibClang { _clang_getDefinitionSpellingAndExtent; void clang_enableStackTraces() { - return (_clang_enableStackTraces ??= _dylib.lookupFunction< - _c_clang_enableStackTraces, - _dart_clang_enableStackTraces>('clang_enableStackTraces'))(); + return (_clang_enableStackTraces ??= + _lookup>( + 'clang_enableStackTraces') + .asFunction<_dart_clang_enableStackTraces>())(); } _dart_clang_enableStackTraces? _clang_enableStackTraces; @@ -4910,9 +5085,10 @@ class LibClang { ffi.Pointer user_data, int stack_size, ) { - return (_clang_executeOnThread ??= _dylib.lookupFunction< - _c_clang_executeOnThread, - _dart_clang_executeOnThread>('clang_executeOnThread'))( + return (_clang_executeOnThread ??= + _lookup>( + 'clang_executeOnThread') + .asFunction<_dart_clang_executeOnThread>())( fn, user_data, stack_size, @@ -4932,9 +5108,10 @@ class LibClang { ffi.Pointer completion_string, int chunk_number, ) { - return (_clang_getCompletionChunkKind ??= _dylib.lookupFunction< - _c_clang_getCompletionChunkKind, - _dart_clang_getCompletionChunkKind>('clang_getCompletionChunkKind'))( + return (_clang_getCompletionChunkKind ??= + _lookup>( + 'clang_getCompletionChunkKind') + .asFunction<_dart_clang_getCompletionChunkKind>())( completion_string, chunk_number, ); @@ -4954,9 +5131,10 @@ class LibClang { ffi.Pointer completion_string, int chunk_number, ) { - return (_clang_getCompletionChunkText ??= _dylib.lookupFunction< - _c_clang_getCompletionChunkText, - _dart_clang_getCompletionChunkText>('clang_getCompletionChunkText'))( + return (_clang_getCompletionChunkText ??= + _lookup>( + 'clang_getCompletionChunkText') + .asFunction<_dart_clang_getCompletionChunkText>())( completion_string, chunk_number, ); @@ -4977,10 +5155,11 @@ class LibClang { ffi.Pointer completion_string, int chunk_number, ) { - return (_clang_getCompletionChunkCompletionString ??= _dylib.lookupFunction< - _c_clang_getCompletionChunkCompletionString, - _dart_clang_getCompletionChunkCompletionString>( - 'clang_getCompletionChunkCompletionString'))( + return (_clang_getCompletionChunkCompletionString ??= _lookup< + ffi.NativeFunction< + _c_clang_getCompletionChunkCompletionString>>( + 'clang_getCompletionChunkCompletionString') + .asFunction<_dart_clang_getCompletionChunkCompletionString>())( completion_string, chunk_number, ); @@ -4993,9 +5172,10 @@ class LibClang { int clang_getNumCompletionChunks( ffi.Pointer completion_string, ) { - return (_clang_getNumCompletionChunks ??= _dylib.lookupFunction< - _c_clang_getNumCompletionChunks, - _dart_clang_getNumCompletionChunks>('clang_getNumCompletionChunks'))( + return (_clang_getNumCompletionChunks ??= + _lookup>( + 'clang_getNumCompletionChunks') + .asFunction<_dart_clang_getNumCompletionChunks>())( completion_string, ); } @@ -5015,9 +5195,10 @@ class LibClang { int clang_getCompletionPriority( ffi.Pointer completion_string, ) { - return (_clang_getCompletionPriority ??= _dylib.lookupFunction< - _c_clang_getCompletionPriority, - _dart_clang_getCompletionPriority>('clang_getCompletionPriority'))( + return (_clang_getCompletionPriority ??= + _lookup>( + 'clang_getCompletionPriority') + .asFunction<_dart_clang_getCompletionPriority>())( completion_string, ); } @@ -5033,10 +5214,10 @@ class LibClang { int clang_getCompletionAvailability( ffi.Pointer completion_string, ) { - return (_clang_getCompletionAvailability ??= _dylib.lookupFunction< - _c_clang_getCompletionAvailability, - _dart_clang_getCompletionAvailability>( - 'clang_getCompletionAvailability'))( + return (_clang_getCompletionAvailability ??= + _lookup>( + 'clang_getCompletionAvailability') + .asFunction<_dart_clang_getCompletionAvailability>())( completion_string, ); } @@ -5053,10 +5234,10 @@ class LibClang { int clang_getCompletionNumAnnotations( ffi.Pointer completion_string, ) { - return (_clang_getCompletionNumAnnotations ??= _dylib.lookupFunction< - _c_clang_getCompletionNumAnnotations, - _dart_clang_getCompletionNumAnnotations>( - 'clang_getCompletionNumAnnotations'))( + return (_clang_getCompletionNumAnnotations ??= + _lookup>( + 'clang_getCompletionNumAnnotations') + .asFunction<_dart_clang_getCompletionNumAnnotations>())( completion_string, ); } @@ -5076,9 +5257,10 @@ class LibClang { ffi.Pointer completion_string, int annotation_number, ) { - return (_clang_getCompletionAnnotation ??= _dylib.lookupFunction< - _c_clang_getCompletionAnnotation, - _dart_clang_getCompletionAnnotation>('clang_getCompletionAnnotation'))( + return (_clang_getCompletionAnnotation ??= + _lookup>( + 'clang_getCompletionAnnotation') + .asFunction<_dart_clang_getCompletionAnnotation>())( completion_string, annotation_number, ); @@ -5104,9 +5286,10 @@ class LibClang { ffi.Pointer completion_string, ffi.Pointer kind, ) { - return (_clang_getCompletionParent ??= _dylib.lookupFunction< - _c_clang_getCompletionParent, - _dart_clang_getCompletionParent>('clang_getCompletionParent'))( + return (_clang_getCompletionParent ??= + _lookup>( + 'clang_getCompletionParent') + .asFunction<_dart_clang_getCompletionParent>())( completion_string, kind, ); @@ -5119,10 +5302,10 @@ class LibClang { CXString clang_getCompletionBriefComment( ffi.Pointer completion_string, ) { - return (_clang_getCompletionBriefComment ??= _dylib.lookupFunction< - _c_clang_getCompletionBriefComment, - _dart_clang_getCompletionBriefComment>( - 'clang_getCompletionBriefComment'))( + return (_clang_getCompletionBriefComment ??= + _lookup>( + 'clang_getCompletionBriefComment') + .asFunction<_dart_clang_getCompletionBriefComment>())( completion_string, ); } @@ -5139,10 +5322,10 @@ class LibClang { ffi.Pointer clang_getCursorCompletionString( CXCursor cursor, ) { - return (_clang_getCursorCompletionString ??= _dylib.lookupFunction< - _c_clang_getCursorCompletionString, - _dart_clang_getCursorCompletionString>( - 'clang_getCursorCompletionString'))( + return (_clang_getCursorCompletionString ??= + _lookup>( + 'clang_getCursorCompletionString') + .asFunction<_dart_clang_getCursorCompletionString>())( cursor, ); } @@ -5164,9 +5347,10 @@ class LibClang { ffi.Pointer results, int completion_index, ) { - return (_clang_getCompletionNumFixIts ??= _dylib.lookupFunction< - _c_clang_getCompletionNumFixIts, - _dart_clang_getCompletionNumFixIts>('clang_getCompletionNumFixIts'))( + return (_clang_getCompletionNumFixIts ??= + _lookup>( + 'clang_getCompletionNumFixIts') + .asFunction<_dart_clang_getCompletionNumFixIts>())( results, completion_index, ); @@ -5221,9 +5405,10 @@ class LibClang { int fixit_index, ffi.Pointer replacement_range, ) { - return (_clang_getCompletionFixIt ??= _dylib.lookupFunction< - _c_clang_getCompletionFixIt, - _dart_clang_getCompletionFixIt>('clang_getCompletionFixIt'))( + return (_clang_getCompletionFixIt ??= + _lookup>( + 'clang_getCompletionFixIt') + .asFunction<_dart_clang_getCompletionFixIt>())( results, completion_index, fixit_index, @@ -5236,10 +5421,10 @@ class LibClang { /// 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'))(); + return (_clang_defaultCodeCompleteOptions ??= + _lookup>( + 'clang_defaultCodeCompleteOptions') + .asFunction<_dart_clang_defaultCodeCompleteOptions>())(); } _dart_clang_defaultCodeCompleteOptions? _clang_defaultCodeCompleteOptions; @@ -5319,9 +5504,10 @@ class LibClang { int num_unsaved_files, int options, ) { - return (_clang_codeCompleteAt ??= _dylib.lookupFunction< - _c_clang_codeCompleteAt, - _dart_clang_codeCompleteAt>('clang_codeCompleteAt'))( + return (_clang_codeCompleteAt ??= + _lookup>( + 'clang_codeCompleteAt') + .asFunction<_dart_clang_codeCompleteAt>())( TU, complete_filename, complete_line, @@ -5343,10 +5529,10 @@ class LibClang { ffi.Pointer Results, int NumResults, ) { - return (_clang_sortCodeCompletionResults ??= _dylib.lookupFunction< - _c_clang_sortCodeCompletionResults, - _dart_clang_sortCodeCompletionResults>( - 'clang_sortCodeCompletionResults'))( + return (_clang_sortCodeCompletionResults ??= + _lookup>( + 'clang_sortCodeCompletionResults') + .asFunction<_dart_clang_sortCodeCompletionResults>())( Results, NumResults, ); @@ -5358,10 +5544,10 @@ class LibClang { void clang_disposeCodeCompleteResults( ffi.Pointer Results, ) { - return (_clang_disposeCodeCompleteResults ??= _dylib.lookupFunction< - _c_clang_disposeCodeCompleteResults, - _dart_clang_disposeCodeCompleteResults>( - 'clang_disposeCodeCompleteResults'))( + return (_clang_disposeCodeCompleteResults ??= + _lookup>( + 'clang_disposeCodeCompleteResults') + .asFunction<_dart_clang_disposeCodeCompleteResults>())( Results, ); } @@ -5373,10 +5559,10 @@ class LibClang { int clang_codeCompleteGetNumDiagnostics( ffi.Pointer Results, ) { - return (_clang_codeCompleteGetNumDiagnostics ??= _dylib.lookupFunction< - _c_clang_codeCompleteGetNumDiagnostics, - _dart_clang_codeCompleteGetNumDiagnostics>( - 'clang_codeCompleteGetNumDiagnostics'))( + return (_clang_codeCompleteGetNumDiagnostics ??= + _lookup>( + 'clang_codeCompleteGetNumDiagnostics') + .asFunction<_dart_clang_codeCompleteGetNumDiagnostics>())( Results, ); } @@ -5395,10 +5581,10 @@ class LibClang { ffi.Pointer Results, int Index, ) { - return (_clang_codeCompleteGetDiagnostic ??= _dylib.lookupFunction< - _c_clang_codeCompleteGetDiagnostic, - _dart_clang_codeCompleteGetDiagnostic>( - 'clang_codeCompleteGetDiagnostic'))( + return (_clang_codeCompleteGetDiagnostic ??= + _lookup>( + 'clang_codeCompleteGetDiagnostic') + .asFunction<_dart_clang_codeCompleteGetDiagnostic>())( Results, Index, ); @@ -5416,9 +5602,10 @@ class LibClang { int clang_codeCompleteGetContexts( ffi.Pointer Results, ) { - return (_clang_codeCompleteGetContexts ??= _dylib.lookupFunction< - _c_clang_codeCompleteGetContexts, - _dart_clang_codeCompleteGetContexts>('clang_codeCompleteGetContexts'))( + return (_clang_codeCompleteGetContexts ??= + _lookup>( + 'clang_codeCompleteGetContexts') + .asFunction<_dart_clang_codeCompleteGetContexts>())( Results, ); } @@ -5443,10 +5630,10 @@ class LibClang { ffi.Pointer Results, ffi.Pointer IsIncomplete, ) { - return (_clang_codeCompleteGetContainerKind ??= _dylib.lookupFunction< - _c_clang_codeCompleteGetContainerKind, - _dart_clang_codeCompleteGetContainerKind>( - 'clang_codeCompleteGetContainerKind'))( + return (_clang_codeCompleteGetContainerKind ??= + _lookup>( + 'clang_codeCompleteGetContainerKind') + .asFunction<_dart_clang_codeCompleteGetContainerKind>())( Results, IsIncomplete, ); @@ -5464,10 +5651,10 @@ class LibClang { CXString clang_codeCompleteGetContainerUSR( ffi.Pointer Results, ) { - return (_clang_codeCompleteGetContainerUSR ??= _dylib.lookupFunction< - _c_clang_codeCompleteGetContainerUSR, - _dart_clang_codeCompleteGetContainerUSR>( - 'clang_codeCompleteGetContainerUSR'))( + return (_clang_codeCompleteGetContainerUSR ??= + _lookup>( + 'clang_codeCompleteGetContainerUSR') + .asFunction<_dart_clang_codeCompleteGetContainerUSR>())( Results, ); } @@ -5486,10 +5673,10 @@ class LibClang { CXString clang_codeCompleteGetObjCSelector( ffi.Pointer Results, ) { - return (_clang_codeCompleteGetObjCSelector ??= _dylib.lookupFunction< - _c_clang_codeCompleteGetObjCSelector, - _dart_clang_codeCompleteGetObjCSelector>( - 'clang_codeCompleteGetObjCSelector'))( + return (_clang_codeCompleteGetObjCSelector ??= + _lookup>( + 'clang_codeCompleteGetObjCSelector') + .asFunction<_dart_clang_codeCompleteGetObjCSelector>())( Results, ); } @@ -5499,9 +5686,10 @@ class LibClang { /// 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'))(); + return (_clang_getClangVersion ??= + _lookup>( + 'clang_getClangVersion') + .asFunction<_dart_clang_getClangVersion>())(); } _dart_clang_getClangVersion? _clang_getClangVersion; @@ -5513,9 +5701,10 @@ class LibClang { void clang_toggleCrashRecovery( int isEnabled, ) { - return (_clang_toggleCrashRecovery ??= _dylib.lookupFunction< - _c_clang_toggleCrashRecovery, - _dart_clang_toggleCrashRecovery>('clang_toggleCrashRecovery'))( + return (_clang_toggleCrashRecovery ??= + _lookup>( + 'clang_toggleCrashRecovery') + .asFunction<_dart_clang_toggleCrashRecovery>())( isEnabled, ); } @@ -5531,9 +5720,10 @@ class LibClang { ffi.Pointer> visitor, ffi.Pointer client_data, ) { - return (_clang_getInclusions ??= _dylib.lookupFunction< - _c_clang_getInclusions, - _dart_clang_getInclusions>('clang_getInclusions'))( + return (_clang_getInclusions ??= + _lookup>( + 'clang_getInclusions') + .asFunction<_dart_clang_getInclusions>())( tu, visitor, client_data, @@ -5548,9 +5738,10 @@ class LibClang { ffi.Pointer clang_Cursor_Evaluate( CXCursor C, ) { - return (_clang_Cursor_Evaluate ??= _dylib.lookupFunction< - _c_clang_Cursor_Evaluate, - _dart_clang_Cursor_Evaluate>('clang_Cursor_Evaluate'))( + return (_clang_Cursor_Evaluate ??= + _lookup>( + 'clang_Cursor_Evaluate') + .asFunction<_dart_clang_Cursor_Evaluate>())( C, ); } @@ -5561,9 +5752,10 @@ class LibClang { int clang_EvalResult_getKind( ffi.Pointer E, ) { - return (_clang_EvalResult_getKind ??= _dylib.lookupFunction< - _c_clang_EvalResult_getKind, - _dart_clang_EvalResult_getKind>('clang_EvalResult_getKind'))( + return (_clang_EvalResult_getKind ??= + _lookup>( + 'clang_EvalResult_getKind') + .asFunction<_dart_clang_EvalResult_getKind>())( E, ); } @@ -5575,9 +5767,10 @@ class LibClang { int clang_EvalResult_getAsInt( ffi.Pointer E, ) { - return (_clang_EvalResult_getAsInt ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsInt, - _dart_clang_EvalResult_getAsInt>('clang_EvalResult_getAsInt'))( + return (_clang_EvalResult_getAsInt ??= + _lookup>( + 'clang_EvalResult_getAsInt') + .asFunction<_dart_clang_EvalResult_getAsInt>())( E, ); } @@ -5590,10 +5783,10 @@ class LibClang { int clang_EvalResult_getAsLongLong( ffi.Pointer E, ) { - return (_clang_EvalResult_getAsLongLong ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsLongLong, - _dart_clang_EvalResult_getAsLongLong>( - 'clang_EvalResult_getAsLongLong'))( + return (_clang_EvalResult_getAsLongLong ??= + _lookup>( + 'clang_EvalResult_getAsLongLong') + .asFunction<_dart_clang_EvalResult_getAsLongLong>())( E, ); } @@ -5605,10 +5798,10 @@ class LibClang { int clang_EvalResult_isUnsignedInt( ffi.Pointer E, ) { - return (_clang_EvalResult_isUnsignedInt ??= _dylib.lookupFunction< - _c_clang_EvalResult_isUnsignedInt, - _dart_clang_EvalResult_isUnsignedInt>( - 'clang_EvalResult_isUnsignedInt'))( + return (_clang_EvalResult_isUnsignedInt ??= + _lookup>( + 'clang_EvalResult_isUnsignedInt') + .asFunction<_dart_clang_EvalResult_isUnsignedInt>())( E, ); } @@ -5620,10 +5813,10 @@ class LibClang { int clang_EvalResult_getAsUnsigned( ffi.Pointer E, ) { - return (_clang_EvalResult_getAsUnsigned ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsUnsigned, - _dart_clang_EvalResult_getAsUnsigned>( - 'clang_EvalResult_getAsUnsigned'))( + return (_clang_EvalResult_getAsUnsigned ??= + _lookup>( + 'clang_EvalResult_getAsUnsigned') + .asFunction<_dart_clang_EvalResult_getAsUnsigned>())( E, ); } @@ -5635,9 +5828,10 @@ class LibClang { double clang_EvalResult_getAsDouble( ffi.Pointer E, ) { - return (_clang_EvalResult_getAsDouble ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsDouble, - _dart_clang_EvalResult_getAsDouble>('clang_EvalResult_getAsDouble'))( + return (_clang_EvalResult_getAsDouble ??= + _lookup>( + 'clang_EvalResult_getAsDouble') + .asFunction<_dart_clang_EvalResult_getAsDouble>())( E, ); } @@ -5651,9 +5845,10 @@ class LibClang { 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'))( + return (_clang_EvalResult_getAsStr ??= + _lookup>( + 'clang_EvalResult_getAsStr') + .asFunction<_dart_clang_EvalResult_getAsStr>())( E, ); } @@ -5664,9 +5859,10 @@ class LibClang { void clang_EvalResult_dispose( ffi.Pointer E, ) { - return (_clang_EvalResult_dispose ??= _dylib.lookupFunction< - _c_clang_EvalResult_dispose, - _dart_clang_EvalResult_dispose>('clang_EvalResult_dispose'))( + return (_clang_EvalResult_dispose ??= + _lookup>( + 'clang_EvalResult_dispose') + .asFunction<_dart_clang_EvalResult_dispose>())( E, ); } @@ -5682,9 +5878,10 @@ class LibClang { ffi.Pointer clang_getRemappings( ffi.Pointer path, ) { - return (_clang_getRemappings ??= _dylib.lookupFunction< - _c_clang_getRemappings, - _dart_clang_getRemappings>('clang_getRemappings'))( + return (_clang_getRemappings ??= + _lookup>( + 'clang_getRemappings') + .asFunction<_dart_clang_getRemappings>())( path, ); } @@ -5703,10 +5900,10 @@ class LibClang { ffi.Pointer> filePaths, int numFiles, ) { - return (_clang_getRemappingsFromFileList ??= _dylib.lookupFunction< - _c_clang_getRemappingsFromFileList, - _dart_clang_getRemappingsFromFileList>( - 'clang_getRemappingsFromFileList'))( + return (_clang_getRemappingsFromFileList ??= + _lookup>( + 'clang_getRemappingsFromFileList') + .asFunction<_dart_clang_getRemappingsFromFileList>())( filePaths, numFiles, ); @@ -5718,9 +5915,10 @@ class LibClang { int clang_remap_getNumFiles( ffi.Pointer arg0, ) { - return (_clang_remap_getNumFiles ??= _dylib.lookupFunction< - _c_clang_remap_getNumFiles, - _dart_clang_remap_getNumFiles>('clang_remap_getNumFiles'))( + return (_clang_remap_getNumFiles ??= + _lookup>( + 'clang_remap_getNumFiles') + .asFunction<_dart_clang_remap_getNumFiles>())( arg0, ); } @@ -5739,9 +5937,10 @@ class LibClang { ffi.Pointer original, ffi.Pointer transformed, ) { - return (_clang_remap_getFilenames ??= _dylib.lookupFunction< - _c_clang_remap_getFilenames, - _dart_clang_remap_getFilenames>('clang_remap_getFilenames'))( + return (_clang_remap_getFilenames ??= + _lookup>( + 'clang_remap_getFilenames') + .asFunction<_dart_clang_remap_getFilenames>())( arg0, index, original, @@ -5755,9 +5954,10 @@ class LibClang { void clang_remap_dispose( ffi.Pointer arg0, ) { - return (_clang_remap_dispose ??= _dylib.lookupFunction< - _c_clang_remap_dispose, - _dart_clang_remap_dispose>('clang_remap_dispose'))( + return (_clang_remap_dispose ??= + _lookup>( + 'clang_remap_dispose') + .asFunction<_dart_clang_remap_dispose>())( arg0, ); } @@ -5781,9 +5981,10 @@ class LibClang { ffi.Pointer file, CXCursorAndRangeVisitor visitor, ) { - return (_clang_findReferencesInFile ??= _dylib.lookupFunction< - _c_clang_findReferencesInFile, - _dart_clang_findReferencesInFile>('clang_findReferencesInFile'))( + return (_clang_findReferencesInFile ??= + _lookup>( + 'clang_findReferencesInFile') + .asFunction<_dart_clang_findReferencesInFile>())( cursor, file, visitor, @@ -5807,9 +6008,10 @@ class LibClang { ffi.Pointer file, CXCursorAndRangeVisitor visitor, ) { - return (_clang_findIncludesInFile ??= _dylib.lookupFunction< - _c_clang_findIncludesInFile, - _dart_clang_findIncludesInFile>('clang_findIncludesInFile'))( + return (_clang_findIncludesInFile ??= + _lookup>( + 'clang_findIncludesInFile') + .asFunction<_dart_clang_findIncludesInFile>())( TU, file, visitor, @@ -5821,10 +6023,10 @@ class LibClang { int clang_index_isEntityObjCContainerKind( int arg0, ) { - return (_clang_index_isEntityObjCContainerKind ??= _dylib.lookupFunction< - _c_clang_index_isEntityObjCContainerKind, - _dart_clang_index_isEntityObjCContainerKind>( - 'clang_index_isEntityObjCContainerKind'))( + return (_clang_index_isEntityObjCContainerKind ??= + _lookup>( + 'clang_index_isEntityObjCContainerKind') + .asFunction<_dart_clang_index_isEntityObjCContainerKind>())( arg0, ); } @@ -5835,10 +6037,10 @@ class LibClang { 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'))( + return (_clang_index_getObjCContainerDeclInfo ??= + _lookup>( + 'clang_index_getObjCContainerDeclInfo') + .asFunction<_dart_clang_index_getObjCContainerDeclInfo>())( arg0, ); } @@ -5849,10 +6051,10 @@ class LibClang { 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'))( + return (_clang_index_getObjCInterfaceDeclInfo ??= + _lookup>( + 'clang_index_getObjCInterfaceDeclInfo') + .asFunction<_dart_clang_index_getObjCInterfaceDeclInfo>())( arg0, ); } @@ -5863,10 +6065,10 @@ class LibClang { 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'))( + return (_clang_index_getObjCCategoryDeclInfo ??= + _lookup>( + 'clang_index_getObjCCategoryDeclInfo') + .asFunction<_dart_clang_index_getObjCCategoryDeclInfo>())( arg0, ); } @@ -5878,10 +6080,10 @@ class LibClang { clang_index_getObjCProtocolRefListInfo( ffi.Pointer arg0, ) { - return (_clang_index_getObjCProtocolRefListInfo ??= _dylib.lookupFunction< - _c_clang_index_getObjCProtocolRefListInfo, - _dart_clang_index_getObjCProtocolRefListInfo>( - 'clang_index_getObjCProtocolRefListInfo'))( + return (_clang_index_getObjCProtocolRefListInfo ??= + _lookup>( + 'clang_index_getObjCProtocolRefListInfo') + .asFunction<_dart_clang_index_getObjCProtocolRefListInfo>())( arg0, ); } @@ -5892,10 +6094,10 @@ class LibClang { 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'))( + return (_clang_index_getObjCPropertyDeclInfo ??= + _lookup>( + 'clang_index_getObjCPropertyDeclInfo') + .asFunction<_dart_clang_index_getObjCPropertyDeclInfo>())( arg0, ); } @@ -5907,10 +6109,11 @@ class LibClang { clang_index_getIBOutletCollectionAttrInfo( ffi.Pointer arg0, ) { - return (_clang_index_getIBOutletCollectionAttrInfo ??= - _dylib.lookupFunction<_c_clang_index_getIBOutletCollectionAttrInfo, - _dart_clang_index_getIBOutletCollectionAttrInfo>( - 'clang_index_getIBOutletCollectionAttrInfo'))( + return (_clang_index_getIBOutletCollectionAttrInfo ??= _lookup< + ffi.NativeFunction< + _c_clang_index_getIBOutletCollectionAttrInfo>>( + 'clang_index_getIBOutletCollectionAttrInfo') + .asFunction<_dart_clang_index_getIBOutletCollectionAttrInfo>())( arg0, ); } @@ -5921,10 +6124,10 @@ class LibClang { 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'))( + return (_clang_index_getCXXClassDeclInfo ??= + _lookup>( + 'clang_index_getCXXClassDeclInfo') + .asFunction<_dart_clang_index_getCXXClassDeclInfo>())( arg0, ); } @@ -5936,10 +6139,10 @@ class LibClang { 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'))( + return (_clang_index_getClientContainer ??= + _lookup>( + 'clang_index_getClientContainer') + .asFunction<_dart_clang_index_getClientContainer>())( arg0, ); } @@ -5952,10 +6155,10 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer arg1, ) { - return (_clang_index_setClientContainer ??= _dylib.lookupFunction< - _c_clang_index_setClientContainer, - _dart_clang_index_setClientContainer>( - 'clang_index_setClientContainer'))( + return (_clang_index_setClientContainer ??= + _lookup>( + 'clang_index_setClientContainer') + .asFunction<_dart_clang_index_setClientContainer>())( arg0, arg1, ); @@ -5967,9 +6170,10 @@ class LibClang { 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'))( + return (_clang_index_getClientEntity ??= + _lookup>( + 'clang_index_getClientEntity') + .asFunction<_dart_clang_index_getClientEntity>())( arg0, ); } @@ -5981,9 +6185,10 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer arg1, ) { - return (_clang_index_setClientEntity ??= _dylib.lookupFunction< - _c_clang_index_setClientEntity, - _dart_clang_index_setClientEntity>('clang_index_setClientEntity'))( + return (_clang_index_setClientEntity ??= + _lookup>( + 'clang_index_setClientEntity') + .asFunction<_dart_clang_index_setClientEntity>())( arg0, arg1, ); @@ -5998,9 +6203,10 @@ class LibClang { 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'))( + return (_clang_IndexAction_create ??= + _lookup>( + 'clang_IndexAction_create') + .asFunction<_dart_clang_IndexAction_create>())( CIdx, ); } @@ -6014,9 +6220,10 @@ class LibClang { void clang_IndexAction_dispose( ffi.Pointer arg0, ) { - return (_clang_IndexAction_dispose ??= _dylib.lookupFunction< - _c_clang_IndexAction_dispose, - _dart_clang_IndexAction_dispose>('clang_IndexAction_dispose'))( + return (_clang_IndexAction_dispose ??= + _lookup>( + 'clang_IndexAction_dispose') + .asFunction<_dart_clang_IndexAction_dispose>())( arg0, ); } @@ -6060,9 +6267,10 @@ class LibClang { ffi.Pointer> out_TU, int TU_options, ) { - return (_clang_indexSourceFile ??= _dylib.lookupFunction< - _c_clang_indexSourceFile, - _dart_clang_indexSourceFile>('clang_indexSourceFile'))( + return (_clang_indexSourceFile ??= + _lookup>( + 'clang_indexSourceFile') + .asFunction<_dart_clang_indexSourceFile>())( arg0, client_data, index_callbacks, @@ -6097,9 +6305,10 @@ class LibClang { ffi.Pointer> out_TU, int TU_options, ) { - return (_clang_indexSourceFileFullArgv ??= _dylib.lookupFunction< - _c_clang_indexSourceFileFullArgv, - _dart_clang_indexSourceFileFullArgv>('clang_indexSourceFileFullArgv'))( + return (_clang_indexSourceFileFullArgv ??= + _lookup>( + 'clang_indexSourceFileFullArgv') + .asFunction<_dart_clang_indexSourceFileFullArgv>())( arg0, client_data, index_callbacks, @@ -6139,9 +6348,10 @@ class LibClang { int index_options, ffi.Pointer arg5, ) { - return (_clang_indexTranslationUnit ??= _dylib.lookupFunction< - _c_clang_indexTranslationUnit, - _dart_clang_indexTranslationUnit>('clang_indexTranslationUnit'))( + return (_clang_indexTranslationUnit ??= + _lookup>( + 'clang_indexTranslationUnit') + .asFunction<_dart_clang_indexTranslationUnit>())( arg0, client_data, index_callbacks, @@ -6167,10 +6377,10 @@ class LibClang { ffi.Pointer column, ffi.Pointer offset, ) { - return (_clang_indexLoc_getFileLocation ??= _dylib.lookupFunction< - _c_clang_indexLoc_getFileLocation, - _dart_clang_indexLoc_getFileLocation>( - 'clang_indexLoc_getFileLocation'))( + return (_clang_indexLoc_getFileLocation ??= + _lookup>( + 'clang_indexLoc_getFileLocation') + .asFunction<_dart_clang_indexLoc_getFileLocation>())( loc, indexFile, file, @@ -6186,10 +6396,10 @@ class LibClang { CXSourceLocation clang_indexLoc_getCXSourceLocation( CXIdxLoc loc, ) { - return (_clang_indexLoc_getCXSourceLocation ??= _dylib.lookupFunction< - _c_clang_indexLoc_getCXSourceLocation, - _dart_clang_indexLoc_getCXSourceLocation>( - 'clang_indexLoc_getCXSourceLocation'))( + return (_clang_indexLoc_getCXSourceLocation ??= + _lookup>( + 'clang_indexLoc_getCXSourceLocation') + .asFunction<_dart_clang_indexLoc_getCXSourceLocation>())( loc, ); } @@ -6218,9 +6428,10 @@ class LibClang { ffi.Pointer> visitor, ffi.Pointer client_data, ) { - return (_clang_Type_visitFields ??= _dylib.lookupFunction< - _c_clang_Type_visitFields, - _dart_clang_Type_visitFields>('clang_Type_visitFields'))( + return (_clang_Type_visitFields ??= + _lookup>( + 'clang_Type_visitFields') + .asFunction<_dart_clang_Type_visitFields>())( T, visitor, client_data, @@ -6343,7 +6554,7 @@ class ArrayHelper_CXFileUniqueID_data_level0 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } @@ -6407,7 +6618,7 @@ class ArrayHelper_CXSourceLocation_ptr_data_level0 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } @@ -6468,7 +6679,7 @@ class ArrayHelper_CXSourceRange_ptr_data_level0 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } @@ -6571,7 +6782,7 @@ class ArrayHelper_CXCursor_data_level0 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } @@ -6793,7 +7004,7 @@ class ArrayHelper_CXType_data_level0 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } @@ -6853,7 +7064,7 @@ class ArrayHelper_CXToken_int_data_level0 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } @@ -6957,7 +7168,7 @@ class ArrayHelper_CXIdxLoc_ptr_data_level0 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index 2f64d88139..a8c2cd53a5 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -5,7 +5,7 @@ name: libclang_example environment: - sdk: '>=2.12.0-259.9.beta <3.0.0' + sdk: '>=2.12.0 <3.0.0' dev_dependencies: ffigen: diff --git a/pkgs/ffigen/example/simple/generated_bindings.dart b/pkgs/ffigen/example/simple/generated_bindings.dart index 9a94f0d7e1..c0bb4d3a3c 100644 --- a/pkgs/ffigen/example/simple/generated_bindings.dart +++ b/pkgs/ffigen/example/simple/generated_bindings.dart @@ -5,18 +5,27 @@ import 'dart:ffi' as ffi; /// Bindings to `headers/example.h`. class NativeLibrary { - /// Holds the Dynamic library. - final ffi.DynamicLibrary _dylib; + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; /// The symbols are looked up in [dynamicLibrary]. - NativeLibrary(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + NativeLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NativeLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; /// Adds 2 integers. int sum( int a, int b, ) { - return (_sum ??= _dylib.lookupFunction<_c_sum, _dart_sum>('sum'))( + return (_sum ??= + _lookup>('sum').asFunction<_dart_sum>())( a, b, ); @@ -29,8 +38,8 @@ class NativeLibrary { ffi.Pointer a, int b, ) { - return (_subtract ??= - _dylib.lookupFunction<_c_subtract, _dart_subtract>('subtract'))( + return (_subtract ??= _lookup>('subtract') + .asFunction<_dart_subtract>())( a, b, ); @@ -43,8 +52,8 @@ class NativeLibrary { int a, int b, ) { - return (_multiply ??= - _dylib.lookupFunction<_c_multiply, _dart_multiply>('multiply'))( + return (_multiply ??= _lookup>('multiply') + .asFunction<_dart_multiply>())( a, b, ); @@ -57,8 +66,8 @@ class NativeLibrary { int a, int b, ) { - return (_divide ??= - _dylib.lookupFunction<_c_divide, _dart_divide>('divide'))( + return (_divide ??= _lookup>('divide') + .asFunction<_dart_divide>())( a, b, ); @@ -72,8 +81,8 @@ class NativeLibrary { ffi.Pointer b, ) { return (_dividePercision ??= - _dylib.lookupFunction<_c_dividePercision, _dart_dividePercision>( - 'dividePercision'))( + _lookup>('dividePercision') + .asFunction<_dart_dividePercision>())( a, b, ); diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index bd4585797c..f0a721a4b2 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -5,7 +5,7 @@ name: simple_example environment: - sdk: '>=2.12.0-259.9.beta <3.0.0' + sdk: '>=2.12.0 <3.0.0' dev_dependencies: ffigen: diff --git a/pkgs/ffigen/lib/src/code_generator/constant.dart b/pkgs/ffigen/lib/src/code_generator/constant.dart index 41a996147d..cf6d8e81fa 100644 --- a/pkgs/ffigen/lib/src/code_generator/constant.dart +++ b/pkgs/ffigen/lib/src/code_generator/constant.dart @@ -50,7 +50,7 @@ class Constant extends NoLookUpBinding { s.write(makeDartDoc(dartDoc!)); } - s.write('const ${rawType} $constantName = $rawValue;\n\n'); + s.write('const $rawType $constantName = $rawValue;\n\n'); return BindingString( type: BindingStringType.constant, string: s.toString()); diff --git a/pkgs/ffigen/lib/src/code_generator/enum_class.dart b/pkgs/ffigen/lib/src/code_generator/enum_class.dart index 249ab8c776..ec9d5e160f 100644 --- a/pkgs/ffigen/lib/src/code_generator/enum_class.dart +++ b/pkgs/ffigen/lib/src/code_generator/enum_class.dart @@ -61,7 +61,7 @@ class EnumClass extends NoLookUpBinding { s.writeAll(ec.dartDoc!.split('\n'), '\n' + depth + '/// '); s.write('\n'); } - s.write(depth + 'static const int ${enum_value_name} = ${ec.value};\n'); + s.write(depth + 'static const int $enum_value_name = ${ec.value};\n'); } s.write('}\n\n'); diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index 5a526a5ae5..c227c4e61d 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -128,7 +128,7 @@ class Func extends LookUpBinding { } s.write(') {\n'); s.write( - "return ($funcVarName ??= ${w.dylibIdentifier}.lookupFunction<${cType.name},${dartType.name}>('$originalName'))"); + "return ($funcVarName ??= ${w.lookupFuncIdentifier}<${w.ffiLibraryPrefix}.NativeFunction<${cType.name}>>('$originalName').asFunction<${dartType.name}>())"); s.write('(\n'); for (final p in parameters) { diff --git a/pkgs/ffigen/lib/src/code_generator/global.dart b/pkgs/ffigen/lib/src/code_generator/global.dart index 42db339c94..3531eb5940 100644 --- a/pkgs/ffigen/lib/src/code_generator/global.dart +++ b/pkgs/ffigen/lib/src/code_generator/global.dart @@ -63,7 +63,7 @@ class Global extends LookUpBinding { final cType = type.getCType(w); s.write( - "late final ${w.ffiLibraryPrefix}.Pointer<$cType> $pointerName = ${w.dylibIdentifier}.lookup<$cType>('$originalName');\n\n"); + "late final ${w.ffiLibraryPrefix}.Pointer<$cType> $pointerName = ${w.lookupFuncIdentifier}<$cType>('$originalName');\n\n"); if (type.broadType == BroadType.Struct) { if (type.struc!.isOpaque) { s.write( diff --git a/pkgs/ffigen/lib/src/code_generator/struc.dart b/pkgs/ffigen/lib/src/code_generator/struc.dart index 2a0aca5df4..d56682192c 100644 --- a/pkgs/ffigen/lib/src/code_generator/struc.dart +++ b/pkgs/ffigen/lib/src/code_generator/struc.dart @@ -111,12 +111,12 @@ class Struc extends NoLookUpBinding { // TODO(5): Remove array helpers when inline array support arives. final arrayHelper = ArrayHelper( helperClassGroupName: - '${w.arrayHelperClassPrefix}_${enclosingClassName}_${memberName}', + '${w.arrayHelperClassPrefix}_${enclosingClassName}_$memberName', elementType: m.type.getBaseArrayType(), dimensions: _getArrayDimensionLengths(m.type), name: memberName, structName: enclosingClassName, - elementNamePrefix: '${expandedArrayItemPrefix}${memberName}_item_', + elementNamePrefix: '$expandedArrayItemPrefix${memberName}_item_', ); s.write(arrayHelper.declarationString(w)); helpers.add(arrayHelper); @@ -130,7 +130,7 @@ class Struc extends NoLookUpBinding { if (m.type.isPrimitive) { s.write('$depth@${m.type.getCType(w)}()\n'); } - s.write('${depth}external ${m.type.getDartType(w)} ${memberName};\n\n'); + s.write('${depth}external ${m.type.getDartType(w)} $memberName;\n\n'); } } s.write('}\n\n'); @@ -152,7 +152,7 @@ class Struc extends NoLookUpBinding { // Not a unique prefix, start over with a new suffix. i = -1; suffixInt++; - expandedArrayItemPrefix = '${base}${suffixInt}'; + expandedArrayItemPrefix = '$base$suffixInt'; } } return expandedArrayItemPrefix + '_'; @@ -211,9 +211,9 @@ class ArrayHelper { for (var i = 0; i < expandedArrayLength; i++) { if (elementType.isPrimitive) { - s.write(' @${arrayCType}()\n'); + s.write(' @$arrayCType()\n'); } - s.write(' external ${arrayDartType} ${elementNamePrefix}$i;\n'); + s.write(' external $arrayDartType $elementNamePrefix$i;\n'); } s.write('/// Helper for array `$name`.\n'); @@ -227,7 +227,7 @@ class ArrayHelper { final s = StringBuffer(); final arrayType = elementType.getDartType(w); for (var dim = 0; dim < dimensions.length; dim++) { - final helperClassName = '${helperClassGroupName}_level${dim}'; + final helperClassName = '${helperClassGroupName}_level$dim'; final structIdentifier = '_struct'; final dimensionsIdentifier = 'dimensions'; final levelIdentifier = 'level'; @@ -238,7 +238,7 @@ class ArrayHelper { s.write('/// Helper for array `$name` in struct `$structName`.\n'); // Write class declaration. - s.write('class ${helperClassName}{\n'); + s.write('class $helperClassName{\n'); s.write('final $structName $structIdentifier;\n'); s.write('final List $dimensionsIdentifier;\n'); s.write('final int $levelIdentifier;\n'); @@ -254,7 +254,7 @@ class ArrayHelper { s.write(''' void $checkBoundsFunctionIdentifier(int index) { if (index >= $legthIdentifier || index < 0) { - throw RangeError('Dimension \$$levelIdentifier: index not in range 0..\${$legthIdentifier} exclusive.'); + throw RangeError('Dimension \$$levelIdentifier: index not in range 0..\$$legthIdentifier exclusive.'); } } '''); @@ -280,7 +280,7 @@ class ArrayHelper { s.write('switch($absoluteIndexIdentifier+index){\n'); for (var i = 0; i < expandedArrayLength; i++) { s.write('case $i:\n'); - s.write(' return $structIdentifier.${elementNamePrefix}$i;\n'); + s.write(' return $structIdentifier.$elementNamePrefix$i;\n'); } s.write('default:\n'); s.write(" throw Exception('Invalid Array Helper generated.');"); @@ -293,7 +293,7 @@ class ArrayHelper { s.write('switch($absoluteIndexIdentifier+index){\n'); for (var i = 0; i < expandedArrayLength; i++) { s.write('case $i:\n'); - s.write(' $structIdentifier.${elementNamePrefix}$i = value;\n'); + s.write(' $structIdentifier.$elementNamePrefix$i = value;\n'); s.write(' break;\n'); } s.write('default:\n'); diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index c732e15217..74b3aa5f1d 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -220,6 +220,6 @@ class Type { @override String toString() { - return 'Type: ${broadType}'; + return 'Type: $broadType'; } } diff --git a/pkgs/ffigen/lib/src/code_generator/typedef.dart b/pkgs/ffigen/lib/src/code_generator/typedef.dart index f1ba5adc2b..53bc46ebb5 100644 --- a/pkgs/ffigen/lib/src/code_generator/typedef.dart +++ b/pkgs/ffigen/lib/src/code_generator/typedef.dart @@ -65,7 +65,7 @@ class Typedef { s.write('typedef $typedefName = ${returnType.getCType(w)} Function(\n'); for (final p in parameters) { final name = p.name.isNotEmpty ? paramNamer.makeUnique(p.name) : p.name; - s.write(' ${p.type.getCType(w)} ${name},\n'); + s.write(' ${p.type.getCType(w)} $name,\n'); } s.write(');\n\n'); } else { @@ -74,7 +74,7 @@ class Typedef { for (final p in parameters) { final name = p.name.isNotEmpty ? paramNamer.makeUnique(p.name) : p.name; - s.write(' ${p.type.getDartType(w)} ${name},\n'); + s.write(' ${p.type.getDartType(w)} $name,\n'); } s.write(');\n\n'); } diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index 9e91099eac..d6ada16770 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -23,8 +23,8 @@ class Writer { String? _ffiLibraryPrefix; String? get ffiLibraryPrefix => _ffiLibraryPrefix; - String? _dylibIdentifier; - String? get dylibIdentifier => _dylibIdentifier; + String? _lookupFuncIdentifier; + String? get lookupFuncIdentifier => _lookupFuncIdentifier; final bool dartBool; @@ -70,8 +70,8 @@ class Writer { /// [_ffiLibraryPrefix] should be unique in top level. _ffiLibraryPrefix = _initialTopLevelUniqueNamer.makeUnique('ffi'); - /// [_dylibIdentifier] should be unique in top level. - _dylibIdentifier = _initialTopLevelUniqueNamer.makeUnique('_dylib'); + /// [_lookupFuncIdentifier] should be unique in top level. + _lookupFuncIdentifier = _initialTopLevelUniqueNamer.makeUnique('_lookup'); /// Finding a unique prefix for Array Helper Classes and store into /// [_arrayHelperClassPrefix]. @@ -83,7 +83,7 @@ class Writer { // Not a unique prefix, start over with a new suffix. i = -1; suffixInt++; - _arrayHelperClassPrefix = '${base}${suffixInt}'; + _arrayHelperClassPrefix = '$base$suffixInt'; } } @@ -140,14 +140,20 @@ class Writer { // Write wrapper classs. s.write('class $_className{\n'); // Write dylib. - s.write('/// Holds the Dynamic library.\n'); - s.write('final $ffiLibraryPrefix.DynamicLibrary ${dylibIdentifier};\n'); + s.write('/// Holds the symbol lookup function.\n'); + s.write( + 'final $ffiLibraryPrefix.Pointer Function(String symbolName) $lookupFuncIdentifier;\n'); s.write('\n'); //Write doc comment for wrapper class constructor. s.write(makeDartDoc('The symbols are looked up in [dynamicLibrary].')); // Write wrapper class constructor. s.write( - '${_className}($ffiLibraryPrefix.DynamicLibrary dynamicLibrary): $dylibIdentifier = dynamicLibrary;\n\n'); + '$_className($ffiLibraryPrefix.DynamicLibrary dynamicLibrary): $lookupFuncIdentifier = dynamicLibrary.lookup;\n\n'); + //Write doc comment for wrapper class named constructor. + s.write(makeDartDoc('The symbols are looked up with [lookup].')); + // Write wrapper class named constructor. + s.write( + '$_className.fromLookup($ffiLibraryPrefix.Pointer Function(String symbolName) lookup): $lookupFuncIdentifier = lookup;\n\n'); for (final b in lookUpBindings) { s.write(b.toBindingString(this).string); } diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 34f9de505e..a330e60aab 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -129,7 +129,7 @@ class Config { if (map.containsKey(key)) { _result = _result && spec!.validator(key, map[key]); } else if (spec!.requirement == Requirement.yes) { - _logger.severe("Key '${key}' is required."); + _logger.severe("Key '$key' is required."); _result = false; } else if (spec.requirement == Requirement.prefer) { _logger.warning("Prefer adding Key '$key' to your config."); diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index d377c9549e..8533eefef0 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -32,7 +32,7 @@ String _replaceSeparators(String path) { bool checkType(List keys, dynamic value) { if (value is! T) { _logger.severe( - "Expected value of key '${keys.join(' -> ')}' to be of type '${T}'."); + "Expected value of key '${keys.join(' -> ')}' to be of type '$T'."); return false; } return true; @@ -127,7 +127,7 @@ Headers headersExtractor(dynamic yamlConfig) { followLinks: true)) { final fixedPath = _replaceSeparators(file.path); entryPoints.add(fixedPath); - _logger.fine('Adding header/file: ${fixedPath}'); + _logger.fine('Adding header/file: $fixedPath'); } } } diff --git a/pkgs/ffigen/lib/src/executables/ffigen.dart b/pkgs/ffigen/lib/src/executables/ffigen.dart index dd4b209d91..14d1388155 100644 --- a/pkgs/ffigen/lib/src/executables/ffigen.dart +++ b/pkgs/ffigen/lib/src/executables/ffigen.dart @@ -174,14 +174,14 @@ void setupLogger(ArgResults result) { // Setup logger for printing (if verbosity was set by user). Logger.root.onRecord.listen((record) { final level = '[${record.level.name}]'.padRight(9); - printLog('${level}: ${record.message}', record.level); + printLog('$level: ${record.message}', record.level); }); } else { // Setup logger for printing (if verbosity was not set by user). Logger.root.onRecord.listen((record) { if (record.level.value > Level.INFO.value) { final level = '[${record.level.name}]'.padRight(9); - printLog('${level}: ${record.message}', record.level); + printLog('$level: ${record.message}', record.level); } else { printLog(record.message, record.level); } diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 7cccd4a70e..ac12256f5e 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -997,7 +997,7 @@ class ArrayHelper_CXSourceLocation_ptr_data_level0 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } @@ -1058,7 +1058,7 @@ class ArrayHelper_CXSourceRange_ptr_data_level0 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } @@ -2093,7 +2093,7 @@ class ArrayHelper_CXCursor_data_level0 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } @@ -2284,7 +2284,7 @@ class ArrayHelper_CXType_data_level0 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart index 7d9381475d..4574417194 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart @@ -140,7 +140,7 @@ int _macroVariablevisitor(clang_types.CXCursor cursor, originalName: savedMacros[macroName]!.originalName, name: macroName, rawType: 'String', - rawValue: "'${rawValue}'", + rawValue: "'$rawValue'", ); break; } @@ -201,7 +201,7 @@ File createFileForMacros() { // Write macro. final macroVarName = MacroVariableString.encode(prefixedMacroName); sb.writeln( - 'auto ${macroVarName} = ${savedMacros[prefixedMacroName]!.originalName};'); + 'auto $macroVarName = ${savedMacros[prefixedMacroName]!.originalName};'); // Add to _macroVarNames. _macroVarNames.add(macroVarName); } @@ -291,7 +291,7 @@ String _getWritableChar(int char, {bool utf8 = true}) { return r'\r'; default: final h = char.toRadixString(16).toUpperCase().padLeft(2, '0'); - return '\\x${h}'; + return '\\x$h'; } } @@ -309,7 +309,7 @@ String _getWritableChar(int char, {bool utf8 = true}) { /// Print range [128..255] as `\xHH`. if (!utf8) { final h = char.toRadixString(16).toUpperCase().padLeft(2, '0'); - return '\\x${h}'; + return '\\x$h'; } /// In all other cases, simply convert to string. diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index ac59f5ce6c..3cc0e23001 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -68,7 +68,7 @@ Struc? parseStructDeclaration( } else if ((ignoreFilter || shouldIncludeStruct(structUsr, structName)) && (!bindingsIndex.isSeenStruct(structUsr))) { _logger.fine( - '++++ Adding Structure: structName: ${structName}, ${cursor.completeStringRepr()}'); + '++++ Adding Structure: structName: $structName, ${cursor.completeStringRepr()}'); _stack.top.struc = Struc( usr: structUsr, originalName: structName, diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 1207053a96..171a0d2487 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,12 +3,12 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.0.3 +version: 2.1.0 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. environment: - sdk: '>=2.12.0-259.9.beta <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: ffi: ^1.0.0 diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart index 9e9d6ac717..ef210780cd 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart @@ -4,17 +4,25 @@ import 'dart:ffi' as ffi; class Bindings { - /// Holds the Dynamic library. - final ffi.DynamicLibrary _dylib; + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; /// The symbols are looked up in [dynamicLibrary]. - Bindings(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + Bindings(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + Bindings.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; bool test1( bool a, ffi.Pointer b, ) { - return (_test1 ??= _dylib.lookupFunction<_c_test1, _dart_test1>('test1'))( + return (_test1 ??= _lookup>('test1') + .asFunction<_dart_test1>())( a ? 1 : 0, b, ) != diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart index 99ed563fbe..94c815cdb6 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart @@ -4,17 +4,25 @@ import 'dart:ffi' as ffi; class Bindings { - /// Holds the Dynamic library. - final ffi.DynamicLibrary _dylib; + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; /// The symbols are looked up in [dynamicLibrary]. - Bindings(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + Bindings(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + Bindings.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; int test1( int a, ffi.Pointer b, ) { - return (_test1 ??= _dylib.lookupFunction<_c_test1, _dart_test1>('test1'))( + return (_test1 ??= _lookup>('test1') + .asFunction<_dart_test1>())( a, b, ); diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart index 82736d212e..4c144d8b27 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart @@ -4,17 +4,24 @@ import 'dart:ffi' as ffi; class Bindings { - /// Holds the Dynamic library. - final ffi.DynamicLibrary _dylib; + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; /// The symbols are looked up in [dynamicLibrary]. - Bindings(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + Bindings(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + Bindings.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; /// Just a test function /// heres another line int noParam() { - return (_noParam ??= - _dylib.lookupFunction<_c_noParam, _dart_noParam>('noParam'))(); + return (_noParam ??= _lookup>('noParam') + .asFunction<_dart_noParam>())(); } _dart_noParam? _noParam; @@ -24,8 +31,8 @@ class Bindings { int b, ) { return (_withPrimitiveParam ??= - _dylib.lookupFunction<_c_withPrimitiveParam, _dart_withPrimitiveParam>( - 'withPrimitiveParam'))( + _lookup>('withPrimitiveParam') + .asFunction<_dart_withPrimitiveParam>())( a, b, ); @@ -38,8 +45,8 @@ class Bindings { ffi.Pointer> b, ) { return (_withPointerParam ??= - _dylib.lookupFunction<_c_withPointerParam, _dart_withPointerParam>( - 'withPointerParam'))( + _lookup>('withPointerParam') + .asFunction<_dart_withPointerParam>())( a, b, ); diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart index 4f0ea4632f..b9d654b2a7 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart @@ -4,17 +4,24 @@ import 'dart:ffi' as ffi; class Bindings { - /// Holds the Dynamic library. - final ffi.DynamicLibrary _dylib; + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; /// The symbols are looked up in [dynamicLibrary]. - Bindings(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + Bindings(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + Bindings.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; ffi.Pointer someFunc( ffi.Pointer> some, ) { - return (_someFunc ??= - _dylib.lookupFunction<_c_someFunc, _dart_someFunc>('someFunc'))( + return (_someFunc ??= _lookup>('someFunc') + .asFunction<_dart_someFunc>())( some, ); } diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart index 215858b7c1..0a531fac85 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart @@ -4,34 +4,41 @@ import 'dart:ffi' as ffi; class Bindings { - /// Holds the Dynamic library. - final ffi.DynamicLibrary _dylib; + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; /// The symbols are looked up in [dynamicLibrary]. - Bindings(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + Bindings(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; - late final ffi.Pointer _test1 = _dylib.lookup('test1'); + /// The symbols are looked up with [lookup]. + Bindings.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + late final ffi.Pointer _test1 = _lookup('test1'); int get test1 => _test1.value; set test1(int value) => _test1.value = value; late final ffi.Pointer> _test2 = - _dylib.lookup>('test2'); + _lookup>('test2'); ffi.Pointer get test2 => _test2.value; set test2(ffi.Pointer value) => _test2.value = value; late final ffi.Pointer> _test5 = - _dylib.lookup>('test5'); + _lookup>('test5'); ffi.Pointer get test5 => _test5.value; set test5(ffi.Pointer value) => _test5.value = value; late final ffi.Pointer _globalStruct = - _dylib.lookup('globalStruct'); + _lookup('globalStruct'); ffi.Pointer get globalStruct => _globalStruct; } diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart index a6fbe60bcd..0c30a9274b 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart @@ -6,40 +6,52 @@ import 'dart:ffi' as ffi; class init_dylib_1 { - /// Holds the Dynamic library. - final ffi.DynamicLibrary _dylib; + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; /// The symbols are looked up in [dynamicLibrary]. - init_dylib_1(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + init_dylib_1(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + init_dylib_1.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; void test() { - return (_test_1 ??= _dylib.lookupFunction<_c_test1, _dart_test1>('test'))(); + return (_test_1 ??= _lookup>('test') + .asFunction<_dart_test1>())(); } _dart_test1? _test_1; void _test() { - return (__test ??= _dylib.lookupFunction<_c__test, _dart__test>('_test'))(); + return (__test ??= _lookup>('_test') + .asFunction<_dart__test>())(); } _dart__test? __test; void _c_test() { - return (__c_test ??= - _dylib.lookupFunction<_c__c_test, _dart__c_test>('_c_test'))(); + return (__c_test ??= _lookup>('_c_test') + .asFunction<_dart__c_test>())(); } _dart__c_test? __c_test; void _dart_test() { return (__dart_test ??= - _dylib.lookupFunction<_c__dart_test, _dart__dart_test>('_dart_test'))(); + _lookup>('_dart_test') + .asFunction<_dart__dart_test>())(); } _dart__dart_test? __dart_test; void Test() { - return (_Test ??= _dylib.lookupFunction<_c_Test1, _dart_Test>('Test'))(); + return (_Test ??= _lookup>('Test') + .asFunction<_dart_Test>())(); } _dart_Test? _Test; @@ -68,7 +80,7 @@ class ArrayHelper1__Test_array_level0 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart index 22e60da55a..f488f34b7d 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart @@ -5,16 +5,25 @@ import 'dart:ffi' as ffi; /// Unnamed Enums Test class NativeLibrary { - /// Holds the Dynamic library. - final ffi.DynamicLibrary _dylib; + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; /// The symbols are looked up in [dynamicLibrary]. - NativeLibrary(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + NativeLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NativeLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; void func( ffi.Pointer> unnamed1, ) { - return (_func ??= _dylib.lookupFunction<_c_func, _dart_func>('func'))( + return (_func ??= + _lookup>('func').asFunction<_dart_func>())( unnamed1, ); } @@ -25,8 +34,8 @@ class NativeLibrary { ffi.Pointer> named, ) { return (_funcWithNativeFunc ??= - _dylib.lookupFunction<_c_funcWithNativeFunc, _dart_funcWithNativeFunc>( - 'funcWithNativeFunc'))( + _lookup>('funcWithNativeFunc') + .asFunction<_dart_funcWithNativeFunc>())( named, ); } diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart index c9820d2d57..751780a80d 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart @@ -5,16 +5,23 @@ import 'dart:ffi' as ffi; /// Bindings to Cjson. class CJson { - /// Holds the Dynamic library. - final ffi.DynamicLibrary _dylib; + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; /// The symbols are looked up in [dynamicLibrary]. - CJson(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + CJson(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + CJson.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; ffi.Pointer cJSON_Version() { return (_cJSON_Version ??= - _dylib.lookupFunction<_c_cJSON_Version, _dart_cJSON_Version>( - 'cJSON_Version'))(); + _lookup>('cJSON_Version') + .asFunction<_dart_cJSON_Version>())(); } _dart_cJSON_Version? _cJSON_Version; @@ -23,8 +30,8 @@ class CJson { ffi.Pointer hooks, ) { return (_cJSON_InitHooks ??= - _dylib.lookupFunction<_c_cJSON_InitHooks, _dart_cJSON_InitHooks>( - 'cJSON_InitHooks'))( + _lookup>('cJSON_InitHooks') + .asFunction<_dart_cJSON_InitHooks>())( hooks, ); } @@ -34,8 +41,9 @@ class CJson { ffi.Pointer cJSON_Parse( ffi.Pointer value, ) { - return (_cJSON_Parse ??= _dylib - .lookupFunction<_c_cJSON_Parse, _dart_cJSON_Parse>('cJSON_Parse'))( + return (_cJSON_Parse ??= + _lookup>('cJSON_Parse') + .asFunction<_dart_cJSON_Parse>())( value, ); } @@ -47,9 +55,10 @@ class CJson { ffi.Pointer> return_parse_end, int require_null_terminated, ) { - return (_cJSON_ParseWithOpts ??= _dylib.lookupFunction< - _c_cJSON_ParseWithOpts, - _dart_cJSON_ParseWithOpts>('cJSON_ParseWithOpts'))( + return (_cJSON_ParseWithOpts ??= + _lookup>( + 'cJSON_ParseWithOpts') + .asFunction<_dart_cJSON_ParseWithOpts>())( value, return_parse_end, require_null_terminated, @@ -61,8 +70,9 @@ class CJson { ffi.Pointer cJSON_Print( ffi.Pointer item, ) { - return (_cJSON_Print ??= _dylib - .lookupFunction<_c_cJSON_Print, _dart_cJSON_Print>('cJSON_Print'))( + return (_cJSON_Print ??= + _lookup>('cJSON_Print') + .asFunction<_dart_cJSON_Print>())( item, ); } @@ -72,9 +82,10 @@ class CJson { ffi.Pointer cJSON_PrintUnformatted( ffi.Pointer item, ) { - return (_cJSON_PrintUnformatted ??= _dylib.lookupFunction< - _c_cJSON_PrintUnformatted, - _dart_cJSON_PrintUnformatted>('cJSON_PrintUnformatted'))( + return (_cJSON_PrintUnformatted ??= + _lookup>( + 'cJSON_PrintUnformatted') + .asFunction<_dart_cJSON_PrintUnformatted>())( item, ); } @@ -86,9 +97,10 @@ class CJson { int prebuffer, int fmt, ) { - return (_cJSON_PrintBuffered ??= _dylib.lookupFunction< - _c_cJSON_PrintBuffered, - _dart_cJSON_PrintBuffered>('cJSON_PrintBuffered'))( + return (_cJSON_PrintBuffered ??= + _lookup>( + 'cJSON_PrintBuffered') + .asFunction<_dart_cJSON_PrintBuffered>())( item, prebuffer, fmt, @@ -103,9 +115,10 @@ class CJson { int length, int format, ) { - return (_cJSON_PrintPreallocated ??= _dylib.lookupFunction< - _c_cJSON_PrintPreallocated, - _dart_cJSON_PrintPreallocated>('cJSON_PrintPreallocated'))( + return (_cJSON_PrintPreallocated ??= + _lookup>( + 'cJSON_PrintPreallocated') + .asFunction<_dart_cJSON_PrintPreallocated>())( item, buffer, length, @@ -118,8 +131,9 @@ class CJson { void cJSON_Delete( ffi.Pointer item, ) { - return (_cJSON_Delete ??= _dylib - .lookupFunction<_c_cJSON_Delete, _dart_cJSON_Delete>('cJSON_Delete'))( + return (_cJSON_Delete ??= + _lookup>('cJSON_Delete') + .asFunction<_dart_cJSON_Delete>())( item, ); } @@ -130,8 +144,8 @@ class CJson { ffi.Pointer array, ) { return (_cJSON_GetArraySize ??= - _dylib.lookupFunction<_c_cJSON_GetArraySize, _dart_cJSON_GetArraySize>( - 'cJSON_GetArraySize'))( + _lookup>('cJSON_GetArraySize') + .asFunction<_dart_cJSON_GetArraySize>())( array, ); } @@ -143,8 +157,8 @@ class CJson { int index, ) { return (_cJSON_GetArrayItem ??= - _dylib.lookupFunction<_c_cJSON_GetArrayItem, _dart_cJSON_GetArrayItem>( - 'cJSON_GetArrayItem'))( + _lookup>('cJSON_GetArrayItem') + .asFunction<_dart_cJSON_GetArrayItem>())( array, index, ); @@ -156,9 +170,10 @@ class CJson { ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_GetObjectItem ??= _dylib.lookupFunction< - _c_cJSON_GetObjectItem, - _dart_cJSON_GetObjectItem>('cJSON_GetObjectItem'))( + return (_cJSON_GetObjectItem ??= + _lookup>( + 'cJSON_GetObjectItem') + .asFunction<_dart_cJSON_GetObjectItem>())( object, string, ); @@ -170,10 +185,10 @@ class CJson { ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_GetObjectItemCaseSensitive ??= _dylib.lookupFunction< - _c_cJSON_GetObjectItemCaseSensitive, - _dart_cJSON_GetObjectItemCaseSensitive>( - 'cJSON_GetObjectItemCaseSensitive'))( + return (_cJSON_GetObjectItemCaseSensitive ??= + _lookup>( + 'cJSON_GetObjectItemCaseSensitive') + .asFunction<_dart_cJSON_GetObjectItemCaseSensitive>())( object, string, ); @@ -185,9 +200,10 @@ class CJson { ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_HasObjectItem ??= _dylib.lookupFunction< - _c_cJSON_HasObjectItem, - _dart_cJSON_HasObjectItem>('cJSON_HasObjectItem'))( + return (_cJSON_HasObjectItem ??= + _lookup>( + 'cJSON_HasObjectItem') + .asFunction<_dart_cJSON_HasObjectItem>())( object, string, ); @@ -197,8 +213,8 @@ class CJson { ffi.Pointer cJSON_GetErrorPtr() { return (_cJSON_GetErrorPtr ??= - _dylib.lookupFunction<_c_cJSON_GetErrorPtr, _dart_cJSON_GetErrorPtr>( - 'cJSON_GetErrorPtr'))(); + _lookup>('cJSON_GetErrorPtr') + .asFunction<_dart_cJSON_GetErrorPtr>())(); } _dart_cJSON_GetErrorPtr? _cJSON_GetErrorPtr; @@ -206,9 +222,10 @@ class CJson { ffi.Pointer cJSON_GetStringValue( ffi.Pointer item, ) { - return (_cJSON_GetStringValue ??= _dylib.lookupFunction< - _c_cJSON_GetStringValue, - _dart_cJSON_GetStringValue>('cJSON_GetStringValue'))( + return (_cJSON_GetStringValue ??= + _lookup>( + 'cJSON_GetStringValue') + .asFunction<_dart_cJSON_GetStringValue>())( item, ); } @@ -219,8 +236,8 @@ class CJson { ffi.Pointer item, ) { return (_cJSON_IsInvalid ??= - _dylib.lookupFunction<_c_cJSON_IsInvalid, _dart_cJSON_IsInvalid>( - 'cJSON_IsInvalid'))( + _lookup>('cJSON_IsInvalid') + .asFunction<_dart_cJSON_IsInvalid>())( item, ); } @@ -231,8 +248,8 @@ class CJson { ffi.Pointer item, ) { return (_cJSON_IsFalse ??= - _dylib.lookupFunction<_c_cJSON_IsFalse, _dart_cJSON_IsFalse>( - 'cJSON_IsFalse'))( + _lookup>('cJSON_IsFalse') + .asFunction<_dart_cJSON_IsFalse>())( item, ); } @@ -242,8 +259,9 @@ class CJson { int cJSON_IsTrue( ffi.Pointer item, ) { - return (_cJSON_IsTrue ??= _dylib - .lookupFunction<_c_cJSON_IsTrue, _dart_cJSON_IsTrue>('cJSON_IsTrue'))( + return (_cJSON_IsTrue ??= + _lookup>('cJSON_IsTrue') + .asFunction<_dart_cJSON_IsTrue>())( item, ); } @@ -253,8 +271,9 @@ class CJson { int cJSON_IsBool( ffi.Pointer item, ) { - return (_cJSON_IsBool ??= _dylib - .lookupFunction<_c_cJSON_IsBool, _dart_cJSON_IsBool>('cJSON_IsBool'))( + return (_cJSON_IsBool ??= + _lookup>('cJSON_IsBool') + .asFunction<_dart_cJSON_IsBool>())( item, ); } @@ -264,8 +283,9 @@ class CJson { int cJSON_IsNull( ffi.Pointer item, ) { - return (_cJSON_IsNull ??= _dylib - .lookupFunction<_c_cJSON_IsNull, _dart_cJSON_IsNull>('cJSON_IsNull'))( + return (_cJSON_IsNull ??= + _lookup>('cJSON_IsNull') + .asFunction<_dart_cJSON_IsNull>())( item, ); } @@ -276,8 +296,8 @@ class CJson { ffi.Pointer item, ) { return (_cJSON_IsNumber ??= - _dylib.lookupFunction<_c_cJSON_IsNumber, _dart_cJSON_IsNumber>( - 'cJSON_IsNumber'))( + _lookup>('cJSON_IsNumber') + .asFunction<_dart_cJSON_IsNumber>())( item, ); } @@ -288,8 +308,8 @@ class CJson { ffi.Pointer item, ) { return (_cJSON_IsString ??= - _dylib.lookupFunction<_c_cJSON_IsString, _dart_cJSON_IsString>( - 'cJSON_IsString'))( + _lookup>('cJSON_IsString') + .asFunction<_dart_cJSON_IsString>())( item, ); } @@ -300,8 +320,8 @@ class CJson { ffi.Pointer item, ) { return (_cJSON_IsArray ??= - _dylib.lookupFunction<_c_cJSON_IsArray, _dart_cJSON_IsArray>( - 'cJSON_IsArray'))( + _lookup>('cJSON_IsArray') + .asFunction<_dart_cJSON_IsArray>())( item, ); } @@ -312,8 +332,8 @@ class CJson { ffi.Pointer item, ) { return (_cJSON_IsObject ??= - _dylib.lookupFunction<_c_cJSON_IsObject, _dart_cJSON_IsObject>( - 'cJSON_IsObject'))( + _lookup>('cJSON_IsObject') + .asFunction<_dart_cJSON_IsObject>())( item, ); } @@ -323,8 +343,9 @@ class CJson { int cJSON_IsRaw( ffi.Pointer item, ) { - return (_cJSON_IsRaw ??= _dylib - .lookupFunction<_c_cJSON_IsRaw, _dart_cJSON_IsRaw>('cJSON_IsRaw'))( + return (_cJSON_IsRaw ??= + _lookup>('cJSON_IsRaw') + .asFunction<_dart_cJSON_IsRaw>())( item, ); } @@ -333,24 +354,24 @@ class CJson { ffi.Pointer cJSON_CreateNull() { return (_cJSON_CreateNull ??= - _dylib.lookupFunction<_c_cJSON_CreateNull, _dart_cJSON_CreateNull>( - 'cJSON_CreateNull'))(); + _lookup>('cJSON_CreateNull') + .asFunction<_dart_cJSON_CreateNull>())(); } _dart_cJSON_CreateNull? _cJSON_CreateNull; ffi.Pointer cJSON_CreateTrue() { return (_cJSON_CreateTrue ??= - _dylib.lookupFunction<_c_cJSON_CreateTrue, _dart_cJSON_CreateTrue>( - 'cJSON_CreateTrue'))(); + _lookup>('cJSON_CreateTrue') + .asFunction<_dart_cJSON_CreateTrue>())(); } _dart_cJSON_CreateTrue? _cJSON_CreateTrue; ffi.Pointer cJSON_CreateFalse() { return (_cJSON_CreateFalse ??= - _dylib.lookupFunction<_c_cJSON_CreateFalse, _dart_cJSON_CreateFalse>( - 'cJSON_CreateFalse'))(); + _lookup>('cJSON_CreateFalse') + .asFunction<_dart_cJSON_CreateFalse>())(); } _dart_cJSON_CreateFalse? _cJSON_CreateFalse; @@ -359,8 +380,8 @@ class CJson { int boolean, ) { return (_cJSON_CreateBool ??= - _dylib.lookupFunction<_c_cJSON_CreateBool, _dart_cJSON_CreateBool>( - 'cJSON_CreateBool'))( + _lookup>('cJSON_CreateBool') + .asFunction<_dart_cJSON_CreateBool>())( boolean, ); } @@ -371,8 +392,8 @@ class CJson { double num, ) { return (_cJSON_CreateNumber ??= - _dylib.lookupFunction<_c_cJSON_CreateNumber, _dart_cJSON_CreateNumber>( - 'cJSON_CreateNumber'))( + _lookup>('cJSON_CreateNumber') + .asFunction<_dart_cJSON_CreateNumber>())( num, ); } @@ -383,8 +404,8 @@ class CJson { ffi.Pointer string, ) { return (_cJSON_CreateString ??= - _dylib.lookupFunction<_c_cJSON_CreateString, _dart_cJSON_CreateString>( - 'cJSON_CreateString'))( + _lookup>('cJSON_CreateString') + .asFunction<_dart_cJSON_CreateString>())( string, ); } @@ -395,8 +416,8 @@ class CJson { ffi.Pointer raw, ) { return (_cJSON_CreateRaw ??= - _dylib.lookupFunction<_c_cJSON_CreateRaw, _dart_cJSON_CreateRaw>( - 'cJSON_CreateRaw'))( + _lookup>('cJSON_CreateRaw') + .asFunction<_dart_cJSON_CreateRaw>())( raw, ); } @@ -405,16 +426,16 @@ class CJson { ffi.Pointer cJSON_CreateArray() { return (_cJSON_CreateArray ??= - _dylib.lookupFunction<_c_cJSON_CreateArray, _dart_cJSON_CreateArray>( - 'cJSON_CreateArray'))(); + _lookup>('cJSON_CreateArray') + .asFunction<_dart_cJSON_CreateArray>())(); } _dart_cJSON_CreateArray? _cJSON_CreateArray; ffi.Pointer cJSON_CreateObject() { return (_cJSON_CreateObject ??= - _dylib.lookupFunction<_c_cJSON_CreateObject, _dart_cJSON_CreateObject>( - 'cJSON_CreateObject'))(); + _lookup>('cJSON_CreateObject') + .asFunction<_dart_cJSON_CreateObject>())(); } _dart_cJSON_CreateObject? _cJSON_CreateObject; @@ -422,9 +443,10 @@ class CJson { ffi.Pointer cJSON_CreateStringReference( ffi.Pointer string, ) { - return (_cJSON_CreateStringReference ??= _dylib.lookupFunction< - _c_cJSON_CreateStringReference, - _dart_cJSON_CreateStringReference>('cJSON_CreateStringReference'))( + return (_cJSON_CreateStringReference ??= + _lookup>( + 'cJSON_CreateStringReference') + .asFunction<_dart_cJSON_CreateStringReference>())( string, ); } @@ -434,9 +456,10 @@ class CJson { ffi.Pointer cJSON_CreateObjectReference( ffi.Pointer child, ) { - return (_cJSON_CreateObjectReference ??= _dylib.lookupFunction< - _c_cJSON_CreateObjectReference, - _dart_cJSON_CreateObjectReference>('cJSON_CreateObjectReference'))( + return (_cJSON_CreateObjectReference ??= + _lookup>( + 'cJSON_CreateObjectReference') + .asFunction<_dart_cJSON_CreateObjectReference>())( child, ); } @@ -446,9 +469,10 @@ class CJson { ffi.Pointer cJSON_CreateArrayReference( ffi.Pointer child, ) { - return (_cJSON_CreateArrayReference ??= _dylib.lookupFunction< - _c_cJSON_CreateArrayReference, - _dart_cJSON_CreateArrayReference>('cJSON_CreateArrayReference'))( + return (_cJSON_CreateArrayReference ??= + _lookup>( + 'cJSON_CreateArrayReference') + .asFunction<_dart_cJSON_CreateArrayReference>())( child, ); } @@ -459,9 +483,10 @@ class CJson { ffi.Pointer numbers, int count, ) { - return (_cJSON_CreateIntArray ??= _dylib.lookupFunction< - _c_cJSON_CreateIntArray, - _dart_cJSON_CreateIntArray>('cJSON_CreateIntArray'))( + return (_cJSON_CreateIntArray ??= + _lookup>( + 'cJSON_CreateIntArray') + .asFunction<_dart_cJSON_CreateIntArray>())( numbers, count, ); @@ -473,9 +498,10 @@ class CJson { ffi.Pointer numbers, int count, ) { - return (_cJSON_CreateFloatArray ??= _dylib.lookupFunction< - _c_cJSON_CreateFloatArray, - _dart_cJSON_CreateFloatArray>('cJSON_CreateFloatArray'))( + return (_cJSON_CreateFloatArray ??= + _lookup>( + 'cJSON_CreateFloatArray') + .asFunction<_dart_cJSON_CreateFloatArray>())( numbers, count, ); @@ -487,9 +513,10 @@ class CJson { ffi.Pointer numbers, int count, ) { - return (_cJSON_CreateDoubleArray ??= _dylib.lookupFunction< - _c_cJSON_CreateDoubleArray, - _dart_cJSON_CreateDoubleArray>('cJSON_CreateDoubleArray'))( + return (_cJSON_CreateDoubleArray ??= + _lookup>( + 'cJSON_CreateDoubleArray') + .asFunction<_dart_cJSON_CreateDoubleArray>())( numbers, count, ); @@ -501,9 +528,10 @@ class CJson { ffi.Pointer> strings, int count, ) { - return (_cJSON_CreateStringArray ??= _dylib.lookupFunction< - _c_cJSON_CreateStringArray, - _dart_cJSON_CreateStringArray>('cJSON_CreateStringArray'))( + return (_cJSON_CreateStringArray ??= + _lookup>( + 'cJSON_CreateStringArray') + .asFunction<_dart_cJSON_CreateStringArray>())( strings, count, ); @@ -515,9 +543,10 @@ class CJson { ffi.Pointer array, ffi.Pointer item, ) { - return (_cJSON_AddItemToArray ??= _dylib.lookupFunction< - _c_cJSON_AddItemToArray, - _dart_cJSON_AddItemToArray>('cJSON_AddItemToArray'))( + return (_cJSON_AddItemToArray ??= + _lookup>( + 'cJSON_AddItemToArray') + .asFunction<_dart_cJSON_AddItemToArray>())( array, item, ); @@ -530,9 +559,10 @@ class CJson { ffi.Pointer string, ffi.Pointer item, ) { - return (_cJSON_AddItemToObject ??= _dylib.lookupFunction< - _c_cJSON_AddItemToObject, - _dart_cJSON_AddItemToObject>('cJSON_AddItemToObject'))( + return (_cJSON_AddItemToObject ??= + _lookup>( + 'cJSON_AddItemToObject') + .asFunction<_dart_cJSON_AddItemToObject>())( object, string, item, @@ -546,9 +576,10 @@ class CJson { ffi.Pointer string, ffi.Pointer item, ) { - return (_cJSON_AddItemToObjectCS ??= _dylib.lookupFunction< - _c_cJSON_AddItemToObjectCS, - _dart_cJSON_AddItemToObjectCS>('cJSON_AddItemToObjectCS'))( + return (_cJSON_AddItemToObjectCS ??= + _lookup>( + 'cJSON_AddItemToObjectCS') + .asFunction<_dart_cJSON_AddItemToObjectCS>())( object, string, item, @@ -561,9 +592,10 @@ class CJson { ffi.Pointer array, ffi.Pointer item, ) { - return (_cJSON_AddItemReferenceToArray ??= _dylib.lookupFunction< - _c_cJSON_AddItemReferenceToArray, - _dart_cJSON_AddItemReferenceToArray>('cJSON_AddItemReferenceToArray'))( + return (_cJSON_AddItemReferenceToArray ??= + _lookup>( + 'cJSON_AddItemReferenceToArray') + .asFunction<_dart_cJSON_AddItemReferenceToArray>())( array, item, ); @@ -576,10 +608,10 @@ class CJson { ffi.Pointer string, ffi.Pointer item, ) { - return (_cJSON_AddItemReferenceToObject ??= _dylib.lookupFunction< - _c_cJSON_AddItemReferenceToObject, - _dart_cJSON_AddItemReferenceToObject>( - 'cJSON_AddItemReferenceToObject'))( + return (_cJSON_AddItemReferenceToObject ??= + _lookup>( + 'cJSON_AddItemReferenceToObject') + .asFunction<_dart_cJSON_AddItemReferenceToObject>())( object, string, item, @@ -592,9 +624,10 @@ class CJson { ffi.Pointer parent, ffi.Pointer item, ) { - return (_cJSON_DetachItemViaPointer ??= _dylib.lookupFunction< - _c_cJSON_DetachItemViaPointer, - _dart_cJSON_DetachItemViaPointer>('cJSON_DetachItemViaPointer'))( + return (_cJSON_DetachItemViaPointer ??= + _lookup>( + 'cJSON_DetachItemViaPointer') + .asFunction<_dart_cJSON_DetachItemViaPointer>())( parent, item, ); @@ -606,9 +639,10 @@ class CJson { ffi.Pointer array, int which, ) { - return (_cJSON_DetachItemFromArray ??= _dylib.lookupFunction< - _c_cJSON_DetachItemFromArray, - _dart_cJSON_DetachItemFromArray>('cJSON_DetachItemFromArray'))( + return (_cJSON_DetachItemFromArray ??= + _lookup>( + 'cJSON_DetachItemFromArray') + .asFunction<_dart_cJSON_DetachItemFromArray>())( array, which, ); @@ -620,9 +654,10 @@ class CJson { ffi.Pointer array, int which, ) { - return (_cJSON_DeleteItemFromArray ??= _dylib.lookupFunction< - _c_cJSON_DeleteItemFromArray, - _dart_cJSON_DeleteItemFromArray>('cJSON_DeleteItemFromArray'))( + return (_cJSON_DeleteItemFromArray ??= + _lookup>( + 'cJSON_DeleteItemFromArray') + .asFunction<_dart_cJSON_DeleteItemFromArray>())( array, which, ); @@ -634,9 +669,10 @@ class CJson { ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_DetachItemFromObject ??= _dylib.lookupFunction< - _c_cJSON_DetachItemFromObject, - _dart_cJSON_DetachItemFromObject>('cJSON_DetachItemFromObject'))( + return (_cJSON_DetachItemFromObject ??= + _lookup>( + 'cJSON_DetachItemFromObject') + .asFunction<_dart_cJSON_DetachItemFromObject>())( object, string, ); @@ -648,10 +684,10 @@ class CJson { ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_DetachItemFromObjectCaseSensitive ??= _dylib.lookupFunction< - _c_cJSON_DetachItemFromObjectCaseSensitive, - _dart_cJSON_DetachItemFromObjectCaseSensitive>( - 'cJSON_DetachItemFromObjectCaseSensitive'))( + return (_cJSON_DetachItemFromObjectCaseSensitive ??= + _lookup>( + 'cJSON_DetachItemFromObjectCaseSensitive') + .asFunction<_dart_cJSON_DetachItemFromObjectCaseSensitive>())( object, string, ); @@ -664,9 +700,10 @@ class CJson { ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_DeleteItemFromObject ??= _dylib.lookupFunction< - _c_cJSON_DeleteItemFromObject, - _dart_cJSON_DeleteItemFromObject>('cJSON_DeleteItemFromObject'))( + return (_cJSON_DeleteItemFromObject ??= + _lookup>( + 'cJSON_DeleteItemFromObject') + .asFunction<_dart_cJSON_DeleteItemFromObject>())( object, string, ); @@ -678,10 +715,10 @@ class CJson { ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_DeleteItemFromObjectCaseSensitive ??= _dylib.lookupFunction< - _c_cJSON_DeleteItemFromObjectCaseSensitive, - _dart_cJSON_DeleteItemFromObjectCaseSensitive>( - 'cJSON_DeleteItemFromObjectCaseSensitive'))( + return (_cJSON_DeleteItemFromObjectCaseSensitive ??= + _lookup>( + 'cJSON_DeleteItemFromObjectCaseSensitive') + .asFunction<_dart_cJSON_DeleteItemFromObjectCaseSensitive>())( object, string, ); @@ -695,9 +732,10 @@ class CJson { int which, ffi.Pointer newitem, ) { - return (_cJSON_InsertItemInArray ??= _dylib.lookupFunction< - _c_cJSON_InsertItemInArray, - _dart_cJSON_InsertItemInArray>('cJSON_InsertItemInArray'))( + return (_cJSON_InsertItemInArray ??= + _lookup>( + 'cJSON_InsertItemInArray') + .asFunction<_dart_cJSON_InsertItemInArray>())( array, which, newitem, @@ -711,9 +749,10 @@ class CJson { ffi.Pointer item, ffi.Pointer replacement, ) { - return (_cJSON_ReplaceItemViaPointer ??= _dylib.lookupFunction< - _c_cJSON_ReplaceItemViaPointer, - _dart_cJSON_ReplaceItemViaPointer>('cJSON_ReplaceItemViaPointer'))( + return (_cJSON_ReplaceItemViaPointer ??= + _lookup>( + 'cJSON_ReplaceItemViaPointer') + .asFunction<_dart_cJSON_ReplaceItemViaPointer>())( parent, item, replacement, @@ -727,9 +766,10 @@ class CJson { int which, ffi.Pointer newitem, ) { - return (_cJSON_ReplaceItemInArray ??= _dylib.lookupFunction< - _c_cJSON_ReplaceItemInArray, - _dart_cJSON_ReplaceItemInArray>('cJSON_ReplaceItemInArray'))( + return (_cJSON_ReplaceItemInArray ??= + _lookup>( + 'cJSON_ReplaceItemInArray') + .asFunction<_dart_cJSON_ReplaceItemInArray>())( array, which, newitem, @@ -743,9 +783,10 @@ class CJson { ffi.Pointer string, ffi.Pointer newitem, ) { - return (_cJSON_ReplaceItemInObject ??= _dylib.lookupFunction< - _c_cJSON_ReplaceItemInObject, - _dart_cJSON_ReplaceItemInObject>('cJSON_ReplaceItemInObject'))( + return (_cJSON_ReplaceItemInObject ??= + _lookup>( + 'cJSON_ReplaceItemInObject') + .asFunction<_dart_cJSON_ReplaceItemInObject>())( object, string, newitem, @@ -759,10 +800,10 @@ class CJson { ffi.Pointer string, ffi.Pointer newitem, ) { - return (_cJSON_ReplaceItemInObjectCaseSensitive ??= _dylib.lookupFunction< - _c_cJSON_ReplaceItemInObjectCaseSensitive, - _dart_cJSON_ReplaceItemInObjectCaseSensitive>( - 'cJSON_ReplaceItemInObjectCaseSensitive'))( + return (_cJSON_ReplaceItemInObjectCaseSensitive ??= + _lookup>( + 'cJSON_ReplaceItemInObjectCaseSensitive') + .asFunction<_dart_cJSON_ReplaceItemInObjectCaseSensitive>())( object, string, newitem, @@ -777,8 +818,8 @@ class CJson { int recurse, ) { return (_cJSON_Duplicate ??= - _dylib.lookupFunction<_c_cJSON_Duplicate, _dart_cJSON_Duplicate>( - 'cJSON_Duplicate'))( + _lookup>('cJSON_Duplicate') + .asFunction<_dart_cJSON_Duplicate>())( item, recurse, ); @@ -792,8 +833,8 @@ class CJson { int case_sensitive, ) { return (_cJSON_Compare ??= - _dylib.lookupFunction<_c_cJSON_Compare, _dart_cJSON_Compare>( - 'cJSON_Compare'))( + _lookup>('cJSON_Compare') + .asFunction<_dart_cJSON_Compare>())( a, b, case_sensitive, @@ -805,8 +846,9 @@ class CJson { void cJSON_Minify( ffi.Pointer json, ) { - return (_cJSON_Minify ??= _dylib - .lookupFunction<_c_cJSON_Minify, _dart_cJSON_Minify>('cJSON_Minify'))( + return (_cJSON_Minify ??= + _lookup>('cJSON_Minify') + .asFunction<_dart_cJSON_Minify>())( json, ); } @@ -817,9 +859,10 @@ class CJson { ffi.Pointer object, ffi.Pointer name, ) { - return (_cJSON_AddNullToObject ??= _dylib.lookupFunction< - _c_cJSON_AddNullToObject, - _dart_cJSON_AddNullToObject>('cJSON_AddNullToObject'))( + return (_cJSON_AddNullToObject ??= + _lookup>( + 'cJSON_AddNullToObject') + .asFunction<_dart_cJSON_AddNullToObject>())( object, name, ); @@ -831,9 +874,10 @@ class CJson { ffi.Pointer object, ffi.Pointer name, ) { - return (_cJSON_AddTrueToObject ??= _dylib.lookupFunction< - _c_cJSON_AddTrueToObject, - _dart_cJSON_AddTrueToObject>('cJSON_AddTrueToObject'))( + return (_cJSON_AddTrueToObject ??= + _lookup>( + 'cJSON_AddTrueToObject') + .asFunction<_dart_cJSON_AddTrueToObject>())( object, name, ); @@ -845,9 +889,10 @@ class CJson { ffi.Pointer object, ffi.Pointer name, ) { - return (_cJSON_AddFalseToObject ??= _dylib.lookupFunction< - _c_cJSON_AddFalseToObject, - _dart_cJSON_AddFalseToObject>('cJSON_AddFalseToObject'))( + return (_cJSON_AddFalseToObject ??= + _lookup>( + 'cJSON_AddFalseToObject') + .asFunction<_dart_cJSON_AddFalseToObject>())( object, name, ); @@ -860,9 +905,10 @@ class CJson { ffi.Pointer name, int boolean, ) { - return (_cJSON_AddBoolToObject ??= _dylib.lookupFunction< - _c_cJSON_AddBoolToObject, - _dart_cJSON_AddBoolToObject>('cJSON_AddBoolToObject'))( + return (_cJSON_AddBoolToObject ??= + _lookup>( + 'cJSON_AddBoolToObject') + .asFunction<_dart_cJSON_AddBoolToObject>())( object, name, boolean, @@ -876,9 +922,10 @@ class CJson { ffi.Pointer name, double number, ) { - return (_cJSON_AddNumberToObject ??= _dylib.lookupFunction< - _c_cJSON_AddNumberToObject, - _dart_cJSON_AddNumberToObject>('cJSON_AddNumberToObject'))( + return (_cJSON_AddNumberToObject ??= + _lookup>( + 'cJSON_AddNumberToObject') + .asFunction<_dart_cJSON_AddNumberToObject>())( object, name, number, @@ -892,9 +939,10 @@ class CJson { ffi.Pointer name, ffi.Pointer string, ) { - return (_cJSON_AddStringToObject ??= _dylib.lookupFunction< - _c_cJSON_AddStringToObject, - _dart_cJSON_AddStringToObject>('cJSON_AddStringToObject'))( + return (_cJSON_AddStringToObject ??= + _lookup>( + 'cJSON_AddStringToObject') + .asFunction<_dart_cJSON_AddStringToObject>())( object, name, string, @@ -908,9 +956,10 @@ class CJson { ffi.Pointer name, ffi.Pointer raw, ) { - return (_cJSON_AddRawToObject ??= _dylib.lookupFunction< - _c_cJSON_AddRawToObject, - _dart_cJSON_AddRawToObject>('cJSON_AddRawToObject'))( + return (_cJSON_AddRawToObject ??= + _lookup>( + 'cJSON_AddRawToObject') + .asFunction<_dart_cJSON_AddRawToObject>())( object, name, raw, @@ -923,9 +972,10 @@ class CJson { ffi.Pointer object, ffi.Pointer name, ) { - return (_cJSON_AddObjectToObject ??= _dylib.lookupFunction< - _c_cJSON_AddObjectToObject, - _dart_cJSON_AddObjectToObject>('cJSON_AddObjectToObject'))( + return (_cJSON_AddObjectToObject ??= + _lookup>( + 'cJSON_AddObjectToObject') + .asFunction<_dart_cJSON_AddObjectToObject>())( object, name, ); @@ -937,9 +987,10 @@ class CJson { ffi.Pointer object, ffi.Pointer name, ) { - return (_cJSON_AddArrayToObject ??= _dylib.lookupFunction< - _c_cJSON_AddArrayToObject, - _dart_cJSON_AddArrayToObject>('cJSON_AddArrayToObject'))( + return (_cJSON_AddArrayToObject ??= + _lookup>( + 'cJSON_AddArrayToObject') + .asFunction<_dart_cJSON_AddArrayToObject>())( object, name, ); @@ -951,9 +1002,10 @@ class CJson { ffi.Pointer object, double number, ) { - return (_cJSON_SetNumberHelper ??= _dylib.lookupFunction< - _c_cJSON_SetNumberHelper, - _dart_cJSON_SetNumberHelper>('cJSON_SetNumberHelper'))( + return (_cJSON_SetNumberHelper ??= + _lookup>( + 'cJSON_SetNumberHelper') + .asFunction<_dart_cJSON_SetNumberHelper>())( object, number, ); @@ -964,8 +1016,9 @@ class CJson { ffi.Pointer cJSON_malloc( int size, ) { - return (_cJSON_malloc ??= _dylib - .lookupFunction<_c_cJSON_malloc, _dart_cJSON_malloc>('cJSON_malloc'))( + return (_cJSON_malloc ??= + _lookup>('cJSON_malloc') + .asFunction<_dart_cJSON_malloc>())( size, ); } @@ -976,7 +1029,8 @@ class CJson { ffi.Pointer object, ) { return (_cJSON_free ??= - _dylib.lookupFunction<_c_cJSON_free, _dart_cJSON_free>('cJSON_free'))( + _lookup>('cJSON_free') + .asFunction<_dart_cJSON_free>())( object, ); } diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index 9d4c52d116..20cc5955be 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -5,19 +5,26 @@ import 'dart:ffi' as ffi; /// Bindings to LibClang. class LibClang { - /// Holds the Dynamic library. - final ffi.DynamicLibrary _dylib; + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; /// The symbols are looked up in [dynamicLibrary]. - LibClang(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + LibClang(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + LibClang.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; /// 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'))( + _lookup>('clang_getCString') + .asFunction<_dart_clang_getCString>())( string, ); } @@ -28,9 +35,10 @@ class LibClang { void clang_disposeString( CXString string, ) { - return (_clang_disposeString ??= _dylib.lookupFunction< - _c_clang_disposeString, - _dart_clang_disposeString>('clang_disposeString'))( + return (_clang_disposeString ??= + _lookup>( + 'clang_disposeString') + .asFunction<_dart_clang_disposeString>())( string, ); } @@ -41,9 +49,10 @@ class LibClang { void clang_disposeStringSet( ffi.Pointer set_1, ) { - return (_clang_disposeStringSet ??= _dylib.lookupFunction< - _c_clang_disposeStringSet, - _dart_clang_disposeStringSet>('clang_disposeStringSet'))( + return (_clang_disposeStringSet ??= + _lookup>( + 'clang_disposeStringSet') + .asFunction<_dart_clang_disposeStringSet>())( set_1, ); } @@ -53,10 +62,10 @@ class LibClang { /// Return the timestamp for use with Clang's -fbuild-session-timestamp= /// option. int clang_getBuildSessionTimestamp() { - return (_clang_getBuildSessionTimestamp ??= _dylib.lookupFunction< - _c_clang_getBuildSessionTimestamp, - _dart_clang_getBuildSessionTimestamp>( - 'clang_getBuildSessionTimestamp'))(); + return (_clang_getBuildSessionTimestamp ??= + _lookup>( + 'clang_getBuildSessionTimestamp') + .asFunction<_dart_clang_getBuildSessionTimestamp>())(); } _dart_clang_getBuildSessionTimestamp? _clang_getBuildSessionTimestamp; @@ -66,10 +75,10 @@ class LibClang { ffi.Pointer clang_VirtualFileOverlay_create( int options, ) { - return (_clang_VirtualFileOverlay_create ??= _dylib.lookupFunction< - _c_clang_VirtualFileOverlay_create, - _dart_clang_VirtualFileOverlay_create>( - 'clang_VirtualFileOverlay_create'))( + return (_clang_VirtualFileOverlay_create ??= + _lookup>( + 'clang_VirtualFileOverlay_create') + .asFunction<_dart_clang_VirtualFileOverlay_create>())( options, ); } @@ -83,10 +92,10 @@ class LibClang { ffi.Pointer virtualPath, ffi.Pointer realPath, ) { - return (_clang_VirtualFileOverlay_addFileMapping ??= _dylib.lookupFunction< - _c_clang_VirtualFileOverlay_addFileMapping, - _dart_clang_VirtualFileOverlay_addFileMapping>( - 'clang_VirtualFileOverlay_addFileMapping'))( + return (_clang_VirtualFileOverlay_addFileMapping ??= + _lookup>( + 'clang_VirtualFileOverlay_addFileMapping') + .asFunction<_dart_clang_VirtualFileOverlay_addFileMapping>())( arg0, virtualPath, realPath, @@ -103,10 +112,11 @@ class LibClang { ffi.Pointer arg0, int caseSensitive, ) { - return (_clang_VirtualFileOverlay_setCaseSensitivity ??= - _dylib.lookupFunction<_c_clang_VirtualFileOverlay_setCaseSensitivity, - _dart_clang_VirtualFileOverlay_setCaseSensitivity>( - 'clang_VirtualFileOverlay_setCaseSensitivity'))( + return (_clang_VirtualFileOverlay_setCaseSensitivity ??= _lookup< + ffi.NativeFunction< + _c_clang_VirtualFileOverlay_setCaseSensitivity>>( + 'clang_VirtualFileOverlay_setCaseSensitivity') + .asFunction<_dart_clang_VirtualFileOverlay_setCaseSensitivity>())( arg0, caseSensitive, ); @@ -122,10 +132,10 @@ class LibClang { ffi.Pointer> out_buffer_ptr, ffi.Pointer out_buffer_size, ) { - return (_clang_VirtualFileOverlay_writeToBuffer ??= _dylib.lookupFunction< - _c_clang_VirtualFileOverlay_writeToBuffer, - _dart_clang_VirtualFileOverlay_writeToBuffer>( - 'clang_VirtualFileOverlay_writeToBuffer'))( + return (_clang_VirtualFileOverlay_writeToBuffer ??= + _lookup>( + 'clang_VirtualFileOverlay_writeToBuffer') + .asFunction<_dart_clang_VirtualFileOverlay_writeToBuffer>())( arg0, options, out_buffer_ptr, @@ -142,7 +152,8 @@ class LibClang { ffi.Pointer buffer, ) { return (_clang_free ??= - _dylib.lookupFunction<_c_clang_free, _dart_clang_free>('clang_free'))( + _lookup>('clang_free') + .asFunction<_dart_clang_free>())( buffer, ); } @@ -153,10 +164,10 @@ class LibClang { void clang_VirtualFileOverlay_dispose( ffi.Pointer arg0, ) { - return (_clang_VirtualFileOverlay_dispose ??= _dylib.lookupFunction< - _c_clang_VirtualFileOverlay_dispose, - _dart_clang_VirtualFileOverlay_dispose>( - 'clang_VirtualFileOverlay_dispose'))( + return (_clang_VirtualFileOverlay_dispose ??= + _lookup>( + 'clang_VirtualFileOverlay_dispose') + .asFunction<_dart_clang_VirtualFileOverlay_dispose>())( arg0, ); } @@ -168,10 +179,10 @@ class LibClang { ffi.Pointer clang_ModuleMapDescriptor_create( int options, ) { - return (_clang_ModuleMapDescriptor_create ??= _dylib.lookupFunction< - _c_clang_ModuleMapDescriptor_create, - _dart_clang_ModuleMapDescriptor_create>( - 'clang_ModuleMapDescriptor_create'))( + return (_clang_ModuleMapDescriptor_create ??= + _lookup>( + 'clang_ModuleMapDescriptor_create') + .asFunction<_dart_clang_ModuleMapDescriptor_create>())( options, ); } @@ -183,11 +194,11 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer name, ) { - return (_clang_ModuleMapDescriptor_setFrameworkModuleName ??= - _dylib.lookupFunction< - _c_clang_ModuleMapDescriptor_setFrameworkModuleName, - _dart_clang_ModuleMapDescriptor_setFrameworkModuleName>( - 'clang_ModuleMapDescriptor_setFrameworkModuleName'))( + return (_clang_ModuleMapDescriptor_setFrameworkModuleName ??= _lookup< + ffi.NativeFunction< + _c_clang_ModuleMapDescriptor_setFrameworkModuleName>>( + 'clang_ModuleMapDescriptor_setFrameworkModuleName') + .asFunction<_dart_clang_ModuleMapDescriptor_setFrameworkModuleName>())( arg0, name, ); @@ -201,10 +212,11 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer name, ) { - return (_clang_ModuleMapDescriptor_setUmbrellaHeader ??= - _dylib.lookupFunction<_c_clang_ModuleMapDescriptor_setUmbrellaHeader, - _dart_clang_ModuleMapDescriptor_setUmbrellaHeader>( - 'clang_ModuleMapDescriptor_setUmbrellaHeader'))( + return (_clang_ModuleMapDescriptor_setUmbrellaHeader ??= _lookup< + ffi.NativeFunction< + _c_clang_ModuleMapDescriptor_setUmbrellaHeader>>( + 'clang_ModuleMapDescriptor_setUmbrellaHeader') + .asFunction<_dart_clang_ModuleMapDescriptor_setUmbrellaHeader>())( arg0, name, ); @@ -220,10 +232,10 @@ class LibClang { ffi.Pointer> out_buffer_ptr, ffi.Pointer out_buffer_size, ) { - return (_clang_ModuleMapDescriptor_writeToBuffer ??= _dylib.lookupFunction< - _c_clang_ModuleMapDescriptor_writeToBuffer, - _dart_clang_ModuleMapDescriptor_writeToBuffer>( - 'clang_ModuleMapDescriptor_writeToBuffer'))( + return (_clang_ModuleMapDescriptor_writeToBuffer ??= + _lookup>( + 'clang_ModuleMapDescriptor_writeToBuffer') + .asFunction<_dart_clang_ModuleMapDescriptor_writeToBuffer>())( arg0, options, out_buffer_ptr, @@ -238,10 +250,10 @@ class LibClang { void clang_ModuleMapDescriptor_dispose( ffi.Pointer arg0, ) { - return (_clang_ModuleMapDescriptor_dispose ??= _dylib.lookupFunction< - _c_clang_ModuleMapDescriptor_dispose, - _dart_clang_ModuleMapDescriptor_dispose>( - 'clang_ModuleMapDescriptor_dispose'))( + return (_clang_ModuleMapDescriptor_dispose ??= + _lookup>( + 'clang_ModuleMapDescriptor_dispose') + .asFunction<_dart_clang_ModuleMapDescriptor_dispose>())( arg0, ); } @@ -254,8 +266,8 @@ class LibClang { int displayDiagnostics, ) { return (_clang_createIndex ??= - _dylib.lookupFunction<_c_clang_createIndex, _dart_clang_createIndex>( - 'clang_createIndex'))( + _lookup>('clang_createIndex') + .asFunction<_dart_clang_createIndex>())( excludeDeclarationsFromPCH, displayDiagnostics, ); @@ -268,8 +280,8 @@ class LibClang { ffi.Pointer index, ) { return (_clang_disposeIndex ??= - _dylib.lookupFunction<_c_clang_disposeIndex, _dart_clang_disposeIndex>( - 'clang_disposeIndex'))( + _lookup>('clang_disposeIndex') + .asFunction<_dart_clang_disposeIndex>())( index, ); } @@ -281,10 +293,10 @@ class LibClang { ffi.Pointer arg0, int options, ) { - return (_clang_CXIndex_setGlobalOptions ??= _dylib.lookupFunction< - _c_clang_CXIndex_setGlobalOptions, - _dart_clang_CXIndex_setGlobalOptions>( - 'clang_CXIndex_setGlobalOptions'))( + return (_clang_CXIndex_setGlobalOptions ??= + _lookup>( + 'clang_CXIndex_setGlobalOptions') + .asFunction<_dart_clang_CXIndex_setGlobalOptions>())( arg0, options, ); @@ -296,10 +308,10 @@ class LibClang { int clang_CXIndex_getGlobalOptions( ffi.Pointer arg0, ) { - return (_clang_CXIndex_getGlobalOptions ??= _dylib.lookupFunction< - _c_clang_CXIndex_getGlobalOptions, - _dart_clang_CXIndex_getGlobalOptions>( - 'clang_CXIndex_getGlobalOptions'))( + return (_clang_CXIndex_getGlobalOptions ??= + _lookup>( + 'clang_CXIndex_getGlobalOptions') + .asFunction<_dart_clang_CXIndex_getGlobalOptions>())( arg0, ); } @@ -311,10 +323,11 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer Path, ) { - return (_clang_CXIndex_setInvocationEmissionPathOption ??= - _dylib.lookupFunction<_c_clang_CXIndex_setInvocationEmissionPathOption, - _dart_clang_CXIndex_setInvocationEmissionPathOption>( - 'clang_CXIndex_setInvocationEmissionPathOption'))( + return (_clang_CXIndex_setInvocationEmissionPathOption ??= _lookup< + ffi.NativeFunction< + _c_clang_CXIndex_setInvocationEmissionPathOption>>( + 'clang_CXIndex_setInvocationEmissionPathOption') + .asFunction<_dart_clang_CXIndex_setInvocationEmissionPathOption>())( arg0, Path, ); @@ -328,8 +341,8 @@ class LibClang { ffi.Pointer SFile, ) { return (_clang_getFileName ??= - _dylib.lookupFunction<_c_clang_getFileName, _dart_clang_getFileName>( - 'clang_getFileName'))( + _lookup>('clang_getFileName') + .asFunction<_dart_clang_getFileName>())( SFile, ); } @@ -341,8 +354,8 @@ class LibClang { ffi.Pointer SFile, ) { return (_clang_getFileTime ??= - _dylib.lookupFunction<_c_clang_getFileTime, _dart_clang_getFileTime>( - 'clang_getFileTime'))( + _lookup>('clang_getFileTime') + .asFunction<_dart_clang_getFileTime>())( SFile, ); } @@ -354,9 +367,10 @@ class LibClang { ffi.Pointer file, ffi.Pointer outID, ) { - return (_clang_getFileUniqueID ??= _dylib.lookupFunction< - _c_clang_getFileUniqueID, - _dart_clang_getFileUniqueID>('clang_getFileUniqueID'))( + return (_clang_getFileUniqueID ??= + _lookup>( + 'clang_getFileUniqueID') + .asFunction<_dart_clang_getFileUniqueID>())( file, outID, ); @@ -371,10 +385,10 @@ class LibClang { ffi.Pointer tu, ffi.Pointer file, ) { - return (_clang_isFileMultipleIncludeGuarded ??= _dylib.lookupFunction< - _c_clang_isFileMultipleIncludeGuarded, - _dart_clang_isFileMultipleIncludeGuarded>( - 'clang_isFileMultipleIncludeGuarded'))( + return (_clang_isFileMultipleIncludeGuarded ??= + _lookup>( + 'clang_isFileMultipleIncludeGuarded') + .asFunction<_dart_clang_isFileMultipleIncludeGuarded>())( tu, file, ); @@ -388,8 +402,8 @@ class LibClang { ffi.Pointer file_name, ) { return (_clang_getFile ??= - _dylib.lookupFunction<_c_clang_getFile, _dart_clang_getFile>( - 'clang_getFile'))( + _lookup>('clang_getFile') + .asFunction<_dart_clang_getFile>())( tu, file_name, ); @@ -403,9 +417,10 @@ class LibClang { ffi.Pointer file, ffi.Pointer size, ) { - return (_clang_getFileContents ??= _dylib.lookupFunction< - _c_clang_getFileContents, - _dart_clang_getFileContents>('clang_getFileContents'))( + return (_clang_getFileContents ??= + _lookup>( + 'clang_getFileContents') + .asFunction<_dart_clang_getFileContents>())( tu, file, size, @@ -421,8 +436,8 @@ class LibClang { ffi.Pointer file2, ) { return (_clang_File_isEqual ??= - _dylib.lookupFunction<_c_clang_File_isEqual, _dart_clang_File_isEqual>( - 'clang_File_isEqual'))( + _lookup>('clang_File_isEqual') + .asFunction<_dart_clang_File_isEqual>())( file1, file2, ); @@ -434,9 +449,10 @@ class LibClang { CXString clang_File_tryGetRealPathName( ffi.Pointer file, ) { - return (_clang_File_tryGetRealPathName ??= _dylib.lookupFunction< - _c_clang_File_tryGetRealPathName, - _dart_clang_File_tryGetRealPathName>('clang_File_tryGetRealPathName'))( + return (_clang_File_tryGetRealPathName ??= + _lookup>( + 'clang_File_tryGetRealPathName') + .asFunction<_dart_clang_File_tryGetRealPathName>())( file, ); } @@ -445,9 +461,10 @@ class LibClang { /// Retrieve a NULL (invalid) source location. CXSourceLocation clang_getNullLocation() { - return (_clang_getNullLocation ??= _dylib.lookupFunction< - _c_clang_getNullLocation, - _dart_clang_getNullLocation>('clang_getNullLocation'))(); + return (_clang_getNullLocation ??= + _lookup>( + 'clang_getNullLocation') + .asFunction<_dart_clang_getNullLocation>())(); } _dart_clang_getNullLocation? _clang_getNullLocation; @@ -458,9 +475,10 @@ class LibClang { CXSourceLocation loc1, CXSourceLocation loc2, ) { - return (_clang_equalLocations ??= _dylib.lookupFunction< - _c_clang_equalLocations, - _dart_clang_equalLocations>('clang_equalLocations'))( + return (_clang_equalLocations ??= + _lookup>( + 'clang_equalLocations') + .asFunction<_dart_clang_equalLocations>())( loc1, loc2, ); @@ -477,8 +495,8 @@ class LibClang { int column, ) { return (_clang_getLocation ??= - _dylib.lookupFunction<_c_clang_getLocation, _dart_clang_getLocation>( - 'clang_getLocation'))( + _lookup>('clang_getLocation') + .asFunction<_dart_clang_getLocation>())( tu, file, line, @@ -495,9 +513,10 @@ class LibClang { ffi.Pointer file, int offset, ) { - return (_clang_getLocationForOffset ??= _dylib.lookupFunction< - _c_clang_getLocationForOffset, - _dart_clang_getLocationForOffset>('clang_getLocationForOffset'))( + return (_clang_getLocationForOffset ??= + _lookup>( + 'clang_getLocationForOffset') + .asFunction<_dart_clang_getLocationForOffset>())( tu, file, offset, @@ -510,10 +529,10 @@ class LibClang { int clang_Location_isInSystemHeader( CXSourceLocation location, ) { - return (_clang_Location_isInSystemHeader ??= _dylib.lookupFunction< - _c_clang_Location_isInSystemHeader, - _dart_clang_Location_isInSystemHeader>( - 'clang_Location_isInSystemHeader'))( + return (_clang_Location_isInSystemHeader ??= + _lookup>( + 'clang_Location_isInSystemHeader') + .asFunction<_dart_clang_Location_isInSystemHeader>())( location, ); } @@ -525,9 +544,10 @@ class LibClang { int clang_Location_isFromMainFile( CXSourceLocation location, ) { - return (_clang_Location_isFromMainFile ??= _dylib.lookupFunction< - _c_clang_Location_isFromMainFile, - _dart_clang_Location_isFromMainFile>('clang_Location_isFromMainFile'))( + return (_clang_Location_isFromMainFile ??= + _lookup>( + 'clang_Location_isFromMainFile') + .asFunction<_dart_clang_Location_isFromMainFile>())( location, ); } @@ -537,8 +557,8 @@ class LibClang { /// Retrieve a NULL (invalid) source range. CXSourceRange clang_getNullRange() { return (_clang_getNullRange ??= - _dylib.lookupFunction<_c_clang_getNullRange, _dart_clang_getNullRange>( - 'clang_getNullRange'))(); + _lookup>('clang_getNullRange') + .asFunction<_dart_clang_getNullRange>())(); } _dart_clang_getNullRange? _clang_getNullRange; @@ -549,8 +569,8 @@ class LibClang { CXSourceLocation end, ) { return (_clang_getRange ??= - _dylib.lookupFunction<_c_clang_getRange, _dart_clang_getRange>( - 'clang_getRange'))( + _lookup>('clang_getRange') + .asFunction<_dart_clang_getRange>())( begin, end, ); @@ -564,8 +584,8 @@ class LibClang { CXSourceRange range2, ) { return (_clang_equalRanges ??= - _dylib.lookupFunction<_c_clang_equalRanges, _dart_clang_equalRanges>( - 'clang_equalRanges'))( + _lookup>('clang_equalRanges') + .asFunction<_dart_clang_equalRanges>())( range1, range2, ); @@ -578,8 +598,8 @@ class LibClang { CXSourceRange range, ) { return (_clang_Range_isNull ??= - _dylib.lookupFunction<_c_clang_Range_isNull, _dart_clang_Range_isNull>( - 'clang_Range_isNull'))( + _lookup>('clang_Range_isNull') + .asFunction<_dart_clang_Range_isNull>())( range, ); } @@ -595,9 +615,10 @@ class LibClang { ffi.Pointer column, ffi.Pointer offset, ) { - return (_clang_getExpansionLocation ??= _dylib.lookupFunction< - _c_clang_getExpansionLocation, - _dart_clang_getExpansionLocation>('clang_getExpansionLocation'))( + return (_clang_getExpansionLocation ??= + _lookup>( + 'clang_getExpansionLocation') + .asFunction<_dart_clang_getExpansionLocation>())( location, file, line, @@ -616,9 +637,10 @@ class LibClang { ffi.Pointer line, ffi.Pointer column, ) { - return (_clang_getPresumedLocation ??= _dylib.lookupFunction< - _c_clang_getPresumedLocation, - _dart_clang_getPresumedLocation>('clang_getPresumedLocation'))( + return (_clang_getPresumedLocation ??= + _lookup>( + 'clang_getPresumedLocation') + .asFunction<_dart_clang_getPresumedLocation>())( location, filename, line, @@ -637,10 +659,10 @@ class LibClang { ffi.Pointer column, ffi.Pointer offset, ) { - return (_clang_getInstantiationLocation ??= _dylib.lookupFunction< - _c_clang_getInstantiationLocation, - _dart_clang_getInstantiationLocation>( - 'clang_getInstantiationLocation'))( + return (_clang_getInstantiationLocation ??= + _lookup>( + 'clang_getInstantiationLocation') + .asFunction<_dart_clang_getInstantiationLocation>())( location, file, line, @@ -660,9 +682,10 @@ class LibClang { ffi.Pointer column, ffi.Pointer offset, ) { - return (_clang_getSpellingLocation ??= _dylib.lookupFunction< - _c_clang_getSpellingLocation, - _dart_clang_getSpellingLocation>('clang_getSpellingLocation'))( + return (_clang_getSpellingLocation ??= + _lookup>( + 'clang_getSpellingLocation') + .asFunction<_dart_clang_getSpellingLocation>())( location, file, line, @@ -682,9 +705,10 @@ class LibClang { ffi.Pointer column, ffi.Pointer offset, ) { - return (_clang_getFileLocation ??= _dylib.lookupFunction< - _c_clang_getFileLocation, - _dart_clang_getFileLocation>('clang_getFileLocation'))( + return (_clang_getFileLocation ??= + _lookup>( + 'clang_getFileLocation') + .asFunction<_dart_clang_getFileLocation>())( location, file, line, @@ -700,9 +724,10 @@ class LibClang { CXSourceLocation clang_getRangeStart( CXSourceRange range, ) { - return (_clang_getRangeStart ??= _dylib.lookupFunction< - _c_clang_getRangeStart, - _dart_clang_getRangeStart>('clang_getRangeStart'))( + return (_clang_getRangeStart ??= + _lookup>( + 'clang_getRangeStart') + .asFunction<_dart_clang_getRangeStart>())( range, ); } @@ -715,8 +740,8 @@ class LibClang { CXSourceRange range, ) { return (_clang_getRangeEnd ??= - _dylib.lookupFunction<_c_clang_getRangeEnd, _dart_clang_getRangeEnd>( - 'clang_getRangeEnd'))( + _lookup>('clang_getRangeEnd') + .asFunction<_dart_clang_getRangeEnd>())( range, ); } @@ -728,9 +753,10 @@ class LibClang { ffi.Pointer tu, ffi.Pointer file, ) { - return (_clang_getSkippedRanges ??= _dylib.lookupFunction< - _c_clang_getSkippedRanges, - _dart_clang_getSkippedRanges>('clang_getSkippedRanges'))( + return (_clang_getSkippedRanges ??= + _lookup>( + 'clang_getSkippedRanges') + .asFunction<_dart_clang_getSkippedRanges>())( tu, file, ); @@ -742,9 +768,10 @@ class LibClang { ffi.Pointer clang_getAllSkippedRanges( ffi.Pointer tu, ) { - return (_clang_getAllSkippedRanges ??= _dylib.lookupFunction< - _c_clang_getAllSkippedRanges, - _dart_clang_getAllSkippedRanges>('clang_getAllSkippedRanges'))( + return (_clang_getAllSkippedRanges ??= + _lookup>( + 'clang_getAllSkippedRanges') + .asFunction<_dart_clang_getAllSkippedRanges>())( tu, ); } @@ -755,9 +782,10 @@ class LibClang { void clang_disposeSourceRangeList( ffi.Pointer ranges, ) { - return (_clang_disposeSourceRangeList ??= _dylib.lookupFunction< - _c_clang_disposeSourceRangeList, - _dart_clang_disposeSourceRangeList>('clang_disposeSourceRangeList'))( + return (_clang_disposeSourceRangeList ??= + _lookup>( + 'clang_disposeSourceRangeList') + .asFunction<_dart_clang_disposeSourceRangeList>())( ranges, ); } @@ -768,9 +796,10 @@ class LibClang { int clang_getNumDiagnosticsInSet( ffi.Pointer Diags, ) { - return (_clang_getNumDiagnosticsInSet ??= _dylib.lookupFunction< - _c_clang_getNumDiagnosticsInSet, - _dart_clang_getNumDiagnosticsInSet>('clang_getNumDiagnosticsInSet'))( + return (_clang_getNumDiagnosticsInSet ??= + _lookup>( + 'clang_getNumDiagnosticsInSet') + .asFunction<_dart_clang_getNumDiagnosticsInSet>())( Diags, ); } @@ -782,9 +811,10 @@ class LibClang { ffi.Pointer Diags, int Index, ) { - return (_clang_getDiagnosticInSet ??= _dylib.lookupFunction< - _c_clang_getDiagnosticInSet, - _dart_clang_getDiagnosticInSet>('clang_getDiagnosticInSet'))( + return (_clang_getDiagnosticInSet ??= + _lookup>( + 'clang_getDiagnosticInSet') + .asFunction<_dart_clang_getDiagnosticInSet>())( Diags, Index, ); @@ -798,9 +828,10 @@ class LibClang { ffi.Pointer error, ffi.Pointer errorString, ) { - return (_clang_loadDiagnostics ??= _dylib.lookupFunction< - _c_clang_loadDiagnostics, - _dart_clang_loadDiagnostics>('clang_loadDiagnostics'))( + return (_clang_loadDiagnostics ??= + _lookup>( + 'clang_loadDiagnostics') + .asFunction<_dart_clang_loadDiagnostics>())( file, error, errorString, @@ -813,9 +844,10 @@ class LibClang { void clang_disposeDiagnosticSet( ffi.Pointer Diags, ) { - return (_clang_disposeDiagnosticSet ??= _dylib.lookupFunction< - _c_clang_disposeDiagnosticSet, - _dart_clang_disposeDiagnosticSet>('clang_disposeDiagnosticSet'))( + return (_clang_disposeDiagnosticSet ??= + _lookup>( + 'clang_disposeDiagnosticSet') + .asFunction<_dart_clang_disposeDiagnosticSet>())( Diags, ); } @@ -826,9 +858,10 @@ class LibClang { ffi.Pointer clang_getChildDiagnostics( ffi.Pointer D, ) { - return (_clang_getChildDiagnostics ??= _dylib.lookupFunction< - _c_clang_getChildDiagnostics, - _dart_clang_getChildDiagnostics>('clang_getChildDiagnostics'))( + return (_clang_getChildDiagnostics ??= + _lookup>( + 'clang_getChildDiagnostics') + .asFunction<_dart_clang_getChildDiagnostics>())( D, ); } @@ -840,9 +873,10 @@ class LibClang { int clang_getNumDiagnostics( ffi.Pointer Unit, ) { - return (_clang_getNumDiagnostics ??= _dylib.lookupFunction< - _c_clang_getNumDiagnostics, - _dart_clang_getNumDiagnostics>('clang_getNumDiagnostics'))( + return (_clang_getNumDiagnostics ??= + _lookup>( + 'clang_getNumDiagnostics') + .asFunction<_dart_clang_getNumDiagnostics>())( Unit, ); } @@ -854,9 +888,10 @@ class LibClang { ffi.Pointer Unit, int Index, ) { - return (_clang_getDiagnostic ??= _dylib.lookupFunction< - _c_clang_getDiagnostic, - _dart_clang_getDiagnostic>('clang_getDiagnostic'))( + return (_clang_getDiagnostic ??= + _lookup>( + 'clang_getDiagnostic') + .asFunction<_dart_clang_getDiagnostic>())( Unit, Index, ); @@ -869,9 +904,10 @@ class LibClang { ffi.Pointer clang_getDiagnosticSetFromTU( ffi.Pointer Unit, ) { - return (_clang_getDiagnosticSetFromTU ??= _dylib.lookupFunction< - _c_clang_getDiagnosticSetFromTU, - _dart_clang_getDiagnosticSetFromTU>('clang_getDiagnosticSetFromTU'))( + return (_clang_getDiagnosticSetFromTU ??= + _lookup>( + 'clang_getDiagnosticSetFromTU') + .asFunction<_dart_clang_getDiagnosticSetFromTU>())( Unit, ); } @@ -882,9 +918,10 @@ class LibClang { void clang_disposeDiagnostic( ffi.Pointer Diagnostic, ) { - return (_clang_disposeDiagnostic ??= _dylib.lookupFunction< - _c_clang_disposeDiagnostic, - _dart_clang_disposeDiagnostic>('clang_disposeDiagnostic'))( + return (_clang_disposeDiagnostic ??= + _lookup>( + 'clang_disposeDiagnostic') + .asFunction<_dart_clang_disposeDiagnostic>())( Diagnostic, ); } @@ -896,9 +933,10 @@ class LibClang { ffi.Pointer Diagnostic, int Options, ) { - return (_clang_formatDiagnostic ??= _dylib.lookupFunction< - _c_clang_formatDiagnostic, - _dart_clang_formatDiagnostic>('clang_formatDiagnostic'))( + return (_clang_formatDiagnostic ??= + _lookup>( + 'clang_formatDiagnostic') + .asFunction<_dart_clang_formatDiagnostic>())( Diagnostic, Options, ); @@ -909,10 +947,10 @@ class LibClang { /// Retrieve the set of display options most similar to the default behavior /// of the clang compiler. int clang_defaultDiagnosticDisplayOptions() { - return (_clang_defaultDiagnosticDisplayOptions ??= _dylib.lookupFunction< - _c_clang_defaultDiagnosticDisplayOptions, - _dart_clang_defaultDiagnosticDisplayOptions>( - 'clang_defaultDiagnosticDisplayOptions'))(); + return (_clang_defaultDiagnosticDisplayOptions ??= + _lookup>( + 'clang_defaultDiagnosticDisplayOptions') + .asFunction<_dart_clang_defaultDiagnosticDisplayOptions>())(); } _dart_clang_defaultDiagnosticDisplayOptions? @@ -922,9 +960,10 @@ class LibClang { int clang_getDiagnosticSeverity( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticSeverity ??= _dylib.lookupFunction< - _c_clang_getDiagnosticSeverity, - _dart_clang_getDiagnosticSeverity>('clang_getDiagnosticSeverity'))( + return (_clang_getDiagnosticSeverity ??= + _lookup>( + 'clang_getDiagnosticSeverity') + .asFunction<_dart_clang_getDiagnosticSeverity>())( arg0, ); } @@ -935,9 +974,10 @@ class LibClang { CXSourceLocation clang_getDiagnosticLocation( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticLocation ??= _dylib.lookupFunction< - _c_clang_getDiagnosticLocation, - _dart_clang_getDiagnosticLocation>('clang_getDiagnosticLocation'))( + return (_clang_getDiagnosticLocation ??= + _lookup>( + 'clang_getDiagnosticLocation') + .asFunction<_dart_clang_getDiagnosticLocation>())( arg0, ); } @@ -948,9 +988,10 @@ class LibClang { CXString clang_getDiagnosticSpelling( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticSpelling ??= _dylib.lookupFunction< - _c_clang_getDiagnosticSpelling, - _dart_clang_getDiagnosticSpelling>('clang_getDiagnosticSpelling'))( + return (_clang_getDiagnosticSpelling ??= + _lookup>( + 'clang_getDiagnosticSpelling') + .asFunction<_dart_clang_getDiagnosticSpelling>())( arg0, ); } @@ -962,9 +1003,10 @@ class LibClang { ffi.Pointer Diag, ffi.Pointer Disable, ) { - return (_clang_getDiagnosticOption ??= _dylib.lookupFunction< - _c_clang_getDiagnosticOption, - _dart_clang_getDiagnosticOption>('clang_getDiagnosticOption'))( + return (_clang_getDiagnosticOption ??= + _lookup>( + 'clang_getDiagnosticOption') + .asFunction<_dart_clang_getDiagnosticOption>())( Diag, Disable, ); @@ -976,9 +1018,10 @@ class LibClang { int clang_getDiagnosticCategory( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticCategory ??= _dylib.lookupFunction< - _c_clang_getDiagnosticCategory, - _dart_clang_getDiagnosticCategory>('clang_getDiagnosticCategory'))( + return (_clang_getDiagnosticCategory ??= + _lookup>( + 'clang_getDiagnosticCategory') + .asFunction<_dart_clang_getDiagnosticCategory>())( arg0, ); } @@ -990,10 +1033,10 @@ class LibClang { CXString clang_getDiagnosticCategoryName( int Category, ) { - return (_clang_getDiagnosticCategoryName ??= _dylib.lookupFunction< - _c_clang_getDiagnosticCategoryName, - _dart_clang_getDiagnosticCategoryName>( - 'clang_getDiagnosticCategoryName'))( + return (_clang_getDiagnosticCategoryName ??= + _lookup>( + 'clang_getDiagnosticCategoryName') + .asFunction<_dart_clang_getDiagnosticCategoryName>())( Category, ); } @@ -1004,10 +1047,10 @@ class LibClang { CXString clang_getDiagnosticCategoryText( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticCategoryText ??= _dylib.lookupFunction< - _c_clang_getDiagnosticCategoryText, - _dart_clang_getDiagnosticCategoryText>( - 'clang_getDiagnosticCategoryText'))( + return (_clang_getDiagnosticCategoryText ??= + _lookup>( + 'clang_getDiagnosticCategoryText') + .asFunction<_dart_clang_getDiagnosticCategoryText>())( arg0, ); } @@ -1019,9 +1062,10 @@ class LibClang { int clang_getDiagnosticNumRanges( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticNumRanges ??= _dylib.lookupFunction< - _c_clang_getDiagnosticNumRanges, - _dart_clang_getDiagnosticNumRanges>('clang_getDiagnosticNumRanges'))( + return (_clang_getDiagnosticNumRanges ??= + _lookup>( + 'clang_getDiagnosticNumRanges') + .asFunction<_dart_clang_getDiagnosticNumRanges>())( arg0, ); } @@ -1033,9 +1077,10 @@ class LibClang { ffi.Pointer Diagnostic, int Range, ) { - return (_clang_getDiagnosticRange ??= _dylib.lookupFunction< - _c_clang_getDiagnosticRange, - _dart_clang_getDiagnosticRange>('clang_getDiagnosticRange'))( + return (_clang_getDiagnosticRange ??= + _lookup>( + 'clang_getDiagnosticRange') + .asFunction<_dart_clang_getDiagnosticRange>())( Diagnostic, Range, ); @@ -1047,9 +1092,10 @@ class LibClang { int clang_getDiagnosticNumFixIts( ffi.Pointer Diagnostic, ) { - return (_clang_getDiagnosticNumFixIts ??= _dylib.lookupFunction< - _c_clang_getDiagnosticNumFixIts, - _dart_clang_getDiagnosticNumFixIts>('clang_getDiagnosticNumFixIts'))( + return (_clang_getDiagnosticNumFixIts ??= + _lookup>( + 'clang_getDiagnosticNumFixIts') + .asFunction<_dart_clang_getDiagnosticNumFixIts>())( Diagnostic, ); } @@ -1062,9 +1108,10 @@ class LibClang { int FixIt, ffi.Pointer ReplacementRange, ) { - return (_clang_getDiagnosticFixIt ??= _dylib.lookupFunction< - _c_clang_getDiagnosticFixIt, - _dart_clang_getDiagnosticFixIt>('clang_getDiagnosticFixIt'))( + return (_clang_getDiagnosticFixIt ??= + _lookup>( + 'clang_getDiagnosticFixIt') + .asFunction<_dart_clang_getDiagnosticFixIt>())( Diagnostic, FixIt, ReplacementRange, @@ -1077,10 +1124,10 @@ class LibClang { CXString clang_getTranslationUnitSpelling( ffi.Pointer CTUnit, ) { - return (_clang_getTranslationUnitSpelling ??= _dylib.lookupFunction< - _c_clang_getTranslationUnitSpelling, - _dart_clang_getTranslationUnitSpelling>( - 'clang_getTranslationUnitSpelling'))( + return (_clang_getTranslationUnitSpelling ??= + _lookup>( + 'clang_getTranslationUnitSpelling') + .asFunction<_dart_clang_getTranslationUnitSpelling>())( CTUnit, ); } @@ -1097,10 +1144,11 @@ class LibClang { int num_unsaved_files, ffi.Pointer unsaved_files, ) { - return (_clang_createTranslationUnitFromSourceFile ??= - _dylib.lookupFunction<_c_clang_createTranslationUnitFromSourceFile, - _dart_clang_createTranslationUnitFromSourceFile>( - 'clang_createTranslationUnitFromSourceFile'))( + return (_clang_createTranslationUnitFromSourceFile ??= _lookup< + ffi.NativeFunction< + _c_clang_createTranslationUnitFromSourceFile>>( + 'clang_createTranslationUnitFromSourceFile') + .asFunction<_dart_clang_createTranslationUnitFromSourceFile>())( CIdx, source_filename, num_clang_command_line_args, @@ -1120,9 +1168,10 @@ class LibClang { ffi.Pointer CIdx, ffi.Pointer ast_filename, ) { - return (_clang_createTranslationUnit ??= _dylib.lookupFunction< - _c_clang_createTranslationUnit, - _dart_clang_createTranslationUnit>('clang_createTranslationUnit'))( + return (_clang_createTranslationUnit ??= + _lookup>( + 'clang_createTranslationUnit') + .asFunction<_dart_clang_createTranslationUnit>())( CIdx, ast_filename, ); @@ -1136,9 +1185,10 @@ class LibClang { ffi.Pointer ast_filename, ffi.Pointer> out_TU, ) { - return (_clang_createTranslationUnit2 ??= _dylib.lookupFunction< - _c_clang_createTranslationUnit2, - _dart_clang_createTranslationUnit2>('clang_createTranslationUnit2'))( + return (_clang_createTranslationUnit2 ??= + _lookup>( + 'clang_createTranslationUnit2') + .asFunction<_dart_clang_createTranslationUnit2>())( CIdx, ast_filename, out_TU, @@ -1150,10 +1200,11 @@ class LibClang { /// Returns the set of flags that is suitable for parsing a translation unit /// that is being edited. int clang_defaultEditingTranslationUnitOptions() { - return (_clang_defaultEditingTranslationUnitOptions ??= - _dylib.lookupFunction<_c_clang_defaultEditingTranslationUnitOptions, - _dart_clang_defaultEditingTranslationUnitOptions>( - 'clang_defaultEditingTranslationUnitOptions'))(); + return (_clang_defaultEditingTranslationUnitOptions ??= _lookup< + ffi.NativeFunction< + _c_clang_defaultEditingTranslationUnitOptions>>( + 'clang_defaultEditingTranslationUnitOptions') + .asFunction<_dart_clang_defaultEditingTranslationUnitOptions>())(); } _dart_clang_defaultEditingTranslationUnitOptions? @@ -1171,9 +1222,10 @@ class LibClang { int num_unsaved_files, int options, ) { - return (_clang_parseTranslationUnit ??= _dylib.lookupFunction< - _c_clang_parseTranslationUnit, - _dart_clang_parseTranslationUnit>('clang_parseTranslationUnit'))( + return (_clang_parseTranslationUnit ??= + _lookup>( + 'clang_parseTranslationUnit') + .asFunction<_dart_clang_parseTranslationUnit>())( CIdx, source_filename, command_line_args, @@ -1198,9 +1250,10 @@ class LibClang { int options, ffi.Pointer> out_TU, ) { - return (_clang_parseTranslationUnit2 ??= _dylib.lookupFunction< - _c_clang_parseTranslationUnit2, - _dart_clang_parseTranslationUnit2>('clang_parseTranslationUnit2'))( + return (_clang_parseTranslationUnit2 ??= + _lookup>( + 'clang_parseTranslationUnit2') + .asFunction<_dart_clang_parseTranslationUnit2>())( CIdx, source_filename, command_line_args, @@ -1227,10 +1280,10 @@ class LibClang { int options, ffi.Pointer> out_TU, ) { - return (_clang_parseTranslationUnit2FullArgv ??= _dylib.lookupFunction< - _c_clang_parseTranslationUnit2FullArgv, - _dart_clang_parseTranslationUnit2FullArgv>( - 'clang_parseTranslationUnit2FullArgv'))( + return (_clang_parseTranslationUnit2FullArgv ??= + _lookup>( + 'clang_parseTranslationUnit2FullArgv') + .asFunction<_dart_clang_parseTranslationUnit2FullArgv>())( CIdx, source_filename, command_line_args, @@ -1249,9 +1302,10 @@ class LibClang { int clang_defaultSaveOptions( ffi.Pointer TU, ) { - return (_clang_defaultSaveOptions ??= _dylib.lookupFunction< - _c_clang_defaultSaveOptions, - _dart_clang_defaultSaveOptions>('clang_defaultSaveOptions'))( + return (_clang_defaultSaveOptions ??= + _lookup>( + 'clang_defaultSaveOptions') + .asFunction<_dart_clang_defaultSaveOptions>())( TU, ); } @@ -1265,9 +1319,10 @@ class LibClang { ffi.Pointer FileName, int options, ) { - return (_clang_saveTranslationUnit ??= _dylib.lookupFunction< - _c_clang_saveTranslationUnit, - _dart_clang_saveTranslationUnit>('clang_saveTranslationUnit'))( + return (_clang_saveTranslationUnit ??= + _lookup>( + 'clang_saveTranslationUnit') + .asFunction<_dart_clang_saveTranslationUnit>())( TU, FileName, options, @@ -1280,9 +1335,10 @@ class LibClang { int clang_suspendTranslationUnit( ffi.Pointer arg0, ) { - return (_clang_suspendTranslationUnit ??= _dylib.lookupFunction< - _c_clang_suspendTranslationUnit, - _dart_clang_suspendTranslationUnit>('clang_suspendTranslationUnit'))( + return (_clang_suspendTranslationUnit ??= + _lookup>( + 'clang_suspendTranslationUnit') + .asFunction<_dart_clang_suspendTranslationUnit>())( arg0, ); } @@ -1293,9 +1349,10 @@ class LibClang { void clang_disposeTranslationUnit( ffi.Pointer arg0, ) { - return (_clang_disposeTranslationUnit ??= _dylib.lookupFunction< - _c_clang_disposeTranslationUnit, - _dart_clang_disposeTranslationUnit>('clang_disposeTranslationUnit'))( + return (_clang_disposeTranslationUnit ??= + _lookup>( + 'clang_disposeTranslationUnit') + .asFunction<_dart_clang_disposeTranslationUnit>())( arg0, ); } @@ -1307,9 +1364,10 @@ class LibClang { int clang_defaultReparseOptions( ffi.Pointer TU, ) { - return (_clang_defaultReparseOptions ??= _dylib.lookupFunction< - _c_clang_defaultReparseOptions, - _dart_clang_defaultReparseOptions>('clang_defaultReparseOptions'))( + return (_clang_defaultReparseOptions ??= + _lookup>( + 'clang_defaultReparseOptions') + .asFunction<_dart_clang_defaultReparseOptions>())( TU, ); } @@ -1323,9 +1381,10 @@ class LibClang { ffi.Pointer unsaved_files, int options, ) { - return (_clang_reparseTranslationUnit ??= _dylib.lookupFunction< - _c_clang_reparseTranslationUnit, - _dart_clang_reparseTranslationUnit>('clang_reparseTranslationUnit'))( + return (_clang_reparseTranslationUnit ??= + _lookup>( + 'clang_reparseTranslationUnit') + .asFunction<_dart_clang_reparseTranslationUnit>())( TU, num_unsaved_files, unsaved_files, @@ -1340,9 +1399,10 @@ class LibClang { ffi.Pointer clang_getTUResourceUsageName( int kind, ) { - return (_clang_getTUResourceUsageName ??= _dylib.lookupFunction< - _c_clang_getTUResourceUsageName, - _dart_clang_getTUResourceUsageName>('clang_getTUResourceUsageName'))( + return (_clang_getTUResourceUsageName ??= + _lookup>( + 'clang_getTUResourceUsageName') + .asFunction<_dart_clang_getTUResourceUsageName>())( kind, ); } @@ -1354,9 +1414,10 @@ class LibClang { CXTUResourceUsage clang_getCXTUResourceUsage( ffi.Pointer TU, ) { - return (_clang_getCXTUResourceUsage ??= _dylib.lookupFunction< - _c_clang_getCXTUResourceUsage, - _dart_clang_getCXTUResourceUsage>('clang_getCXTUResourceUsage'))( + return (_clang_getCXTUResourceUsage ??= + _lookup>( + 'clang_getCXTUResourceUsage') + .asFunction<_dart_clang_getCXTUResourceUsage>())( TU, ); } @@ -1366,10 +1427,10 @@ class LibClang { void clang_disposeCXTUResourceUsage( CXTUResourceUsage usage, ) { - return (_clang_disposeCXTUResourceUsage ??= _dylib.lookupFunction< - _c_clang_disposeCXTUResourceUsage, - _dart_clang_disposeCXTUResourceUsage>( - 'clang_disposeCXTUResourceUsage'))( + return (_clang_disposeCXTUResourceUsage ??= + _lookup>( + 'clang_disposeCXTUResourceUsage') + .asFunction<_dart_clang_disposeCXTUResourceUsage>())( usage, ); } @@ -1380,10 +1441,10 @@ class LibClang { ffi.Pointer clang_getTranslationUnitTargetInfo( ffi.Pointer CTUnit, ) { - return (_clang_getTranslationUnitTargetInfo ??= _dylib.lookupFunction< - _c_clang_getTranslationUnitTargetInfo, - _dart_clang_getTranslationUnitTargetInfo>( - 'clang_getTranslationUnitTargetInfo'))( + return (_clang_getTranslationUnitTargetInfo ??= + _lookup>( + 'clang_getTranslationUnitTargetInfo') + .asFunction<_dart_clang_getTranslationUnitTargetInfo>())( CTUnit, ); } @@ -1394,9 +1455,10 @@ class LibClang { void clang_TargetInfo_dispose( ffi.Pointer Info, ) { - return (_clang_TargetInfo_dispose ??= _dylib.lookupFunction< - _c_clang_TargetInfo_dispose, - _dart_clang_TargetInfo_dispose>('clang_TargetInfo_dispose'))( + return (_clang_TargetInfo_dispose ??= + _lookup>( + 'clang_TargetInfo_dispose') + .asFunction<_dart_clang_TargetInfo_dispose>())( Info, ); } @@ -1407,9 +1469,10 @@ class LibClang { CXString clang_TargetInfo_getTriple( ffi.Pointer Info, ) { - return (_clang_TargetInfo_getTriple ??= _dylib.lookupFunction< - _c_clang_TargetInfo_getTriple, - _dart_clang_TargetInfo_getTriple>('clang_TargetInfo_getTriple'))( + return (_clang_TargetInfo_getTriple ??= + _lookup>( + 'clang_TargetInfo_getTriple') + .asFunction<_dart_clang_TargetInfo_getTriple>())( Info, ); } @@ -1420,10 +1483,10 @@ class LibClang { int clang_TargetInfo_getPointerWidth( ffi.Pointer Info, ) { - return (_clang_TargetInfo_getPointerWidth ??= _dylib.lookupFunction< - _c_clang_TargetInfo_getPointerWidth, - _dart_clang_TargetInfo_getPointerWidth>( - 'clang_TargetInfo_getPointerWidth'))( + return (_clang_TargetInfo_getPointerWidth ??= + _lookup>( + 'clang_TargetInfo_getPointerWidth') + .asFunction<_dart_clang_TargetInfo_getPointerWidth>())( Info, ); } @@ -1432,9 +1495,10 @@ class LibClang { /// Retrieve the NULL cursor, which represents no entity. CXCursor clang_getNullCursor() { - return (_clang_getNullCursor ??= _dylib.lookupFunction< - _c_clang_getNullCursor, - _dart_clang_getNullCursor>('clang_getNullCursor'))(); + return (_clang_getNullCursor ??= + _lookup>( + 'clang_getNullCursor') + .asFunction<_dart_clang_getNullCursor>())(); } _dart_clang_getNullCursor? _clang_getNullCursor; @@ -1443,10 +1507,10 @@ class LibClang { CXCursor clang_getTranslationUnitCursor( ffi.Pointer arg0, ) { - return (_clang_getTranslationUnitCursor ??= _dylib.lookupFunction< - _c_clang_getTranslationUnitCursor, - _dart_clang_getTranslationUnitCursor>( - 'clang_getTranslationUnitCursor'))( + return (_clang_getTranslationUnitCursor ??= + _lookup>( + 'clang_getTranslationUnitCursor') + .asFunction<_dart_clang_getTranslationUnitCursor>())( arg0, ); } @@ -1459,8 +1523,8 @@ class LibClang { CXCursor arg1, ) { return (_clang_equalCursors ??= - _dylib.lookupFunction<_c_clang_equalCursors, _dart_clang_equalCursors>( - 'clang_equalCursors'))( + _lookup>('clang_equalCursors') + .asFunction<_dart_clang_equalCursors>())( arg0, arg1, ); @@ -1472,9 +1536,10 @@ class LibClang { int clang_Cursor_isNull( CXCursor cursor, ) { - return (_clang_Cursor_isNull ??= _dylib.lookupFunction< - _c_clang_Cursor_isNull, - _dart_clang_Cursor_isNull>('clang_Cursor_isNull'))( + return (_clang_Cursor_isNull ??= + _lookup>( + 'clang_Cursor_isNull') + .asFunction<_dart_clang_Cursor_isNull>())( cursor, ); } @@ -1486,8 +1551,8 @@ class LibClang { CXCursor arg0, ) { return (_clang_hashCursor ??= - _dylib.lookupFunction<_c_clang_hashCursor, _dart_clang_hashCursor>( - 'clang_hashCursor'))( + _lookup>('clang_hashCursor') + .asFunction<_dart_clang_hashCursor>())( arg0, ); } @@ -1498,9 +1563,10 @@ class LibClang { int clang_getCursorKind( CXCursor arg0, ) { - return (_clang_getCursorKind ??= _dylib.lookupFunction< - _c_clang_getCursorKind, - _dart_clang_getCursorKind>('clang_getCursorKind'))( + return (_clang_getCursorKind ??= + _lookup>( + 'clang_getCursorKind') + .asFunction<_dart_clang_getCursorKind>())( arg0, ); } @@ -1511,9 +1577,10 @@ class LibClang { int clang_isDeclaration( int arg0, ) { - return (_clang_isDeclaration ??= _dylib.lookupFunction< - _c_clang_isDeclaration, - _dart_clang_isDeclaration>('clang_isDeclaration'))( + return (_clang_isDeclaration ??= + _lookup>( + 'clang_isDeclaration') + .asFunction<_dart_clang_isDeclaration>())( arg0, ); } @@ -1524,9 +1591,10 @@ class LibClang { int clang_isInvalidDeclaration( CXCursor arg0, ) { - return (_clang_isInvalidDeclaration ??= _dylib.lookupFunction< - _c_clang_isInvalidDeclaration, - _dart_clang_isInvalidDeclaration>('clang_isInvalidDeclaration'))( + return (_clang_isInvalidDeclaration ??= + _lookup>( + 'clang_isInvalidDeclaration') + .asFunction<_dart_clang_isInvalidDeclaration>())( arg0, ); } @@ -1538,8 +1606,8 @@ class LibClang { int arg0, ) { return (_clang_isReference ??= - _dylib.lookupFunction<_c_clang_isReference, _dart_clang_isReference>( - 'clang_isReference'))( + _lookup>('clang_isReference') + .asFunction<_dart_clang_isReference>())( arg0, ); } @@ -1551,8 +1619,8 @@ class LibClang { int arg0, ) { return (_clang_isExpression ??= - _dylib.lookupFunction<_c_clang_isExpression, _dart_clang_isExpression>( - 'clang_isExpression'))( + _lookup>('clang_isExpression') + .asFunction<_dart_clang_isExpression>())( arg0, ); } @@ -1564,8 +1632,8 @@ class LibClang { int arg0, ) { return (_clang_isStatement ??= - _dylib.lookupFunction<_c_clang_isStatement, _dart_clang_isStatement>( - 'clang_isStatement'))( + _lookup>('clang_isStatement') + .asFunction<_dart_clang_isStatement>())( arg0, ); } @@ -1577,8 +1645,8 @@ class LibClang { int arg0, ) { return (_clang_isAttribute ??= - _dylib.lookupFunction<_c_clang_isAttribute, _dart_clang_isAttribute>( - 'clang_isAttribute'))( + _lookup>('clang_isAttribute') + .asFunction<_dart_clang_isAttribute>())( arg0, ); } @@ -1589,9 +1657,10 @@ class LibClang { int clang_Cursor_hasAttrs( CXCursor C, ) { - return (_clang_Cursor_hasAttrs ??= _dylib.lookupFunction< - _c_clang_Cursor_hasAttrs, - _dart_clang_Cursor_hasAttrs>('clang_Cursor_hasAttrs'))( + return (_clang_Cursor_hasAttrs ??= + _lookup>( + 'clang_Cursor_hasAttrs') + .asFunction<_dart_clang_Cursor_hasAttrs>())( C, ); } @@ -1603,8 +1672,8 @@ class LibClang { int arg0, ) { return (_clang_isInvalid ??= - _dylib.lookupFunction<_c_clang_isInvalid, _dart_clang_isInvalid>( - 'clang_isInvalid'))( + _lookup>('clang_isInvalid') + .asFunction<_dart_clang_isInvalid>())( arg0, ); } @@ -1615,9 +1684,10 @@ class LibClang { int clang_isTranslationUnit( int arg0, ) { - return (_clang_isTranslationUnit ??= _dylib.lookupFunction< - _c_clang_isTranslationUnit, - _dart_clang_isTranslationUnit>('clang_isTranslationUnit'))( + return (_clang_isTranslationUnit ??= + _lookup>( + 'clang_isTranslationUnit') + .asFunction<_dart_clang_isTranslationUnit>())( arg0, ); } @@ -1629,9 +1699,10 @@ class LibClang { int clang_isPreprocessing( int arg0, ) { - return (_clang_isPreprocessing ??= _dylib.lookupFunction< - _c_clang_isPreprocessing, - _dart_clang_isPreprocessing>('clang_isPreprocessing'))( + return (_clang_isPreprocessing ??= + _lookup>( + 'clang_isPreprocessing') + .asFunction<_dart_clang_isPreprocessing>())( arg0, ); } @@ -1644,8 +1715,8 @@ class LibClang { int arg0, ) { return (_clang_isUnexposed ??= - _dylib.lookupFunction<_c_clang_isUnexposed, _dart_clang_isUnexposed>( - 'clang_isUnexposed'))( + _lookup>('clang_isUnexposed') + .asFunction<_dart_clang_isUnexposed>())( arg0, ); } @@ -1656,9 +1727,10 @@ class LibClang { int clang_getCursorLinkage( CXCursor cursor, ) { - return (_clang_getCursorLinkage ??= _dylib.lookupFunction< - _c_clang_getCursorLinkage, - _dart_clang_getCursorLinkage>('clang_getCursorLinkage'))( + return (_clang_getCursorLinkage ??= + _lookup>( + 'clang_getCursorLinkage') + .asFunction<_dart_clang_getCursorLinkage>())( cursor, ); } @@ -1669,9 +1741,10 @@ class LibClang { int clang_getCursorVisibility( CXCursor cursor, ) { - return (_clang_getCursorVisibility ??= _dylib.lookupFunction< - _c_clang_getCursorVisibility, - _dart_clang_getCursorVisibility>('clang_getCursorVisibility'))( + return (_clang_getCursorVisibility ??= + _lookup>( + 'clang_getCursorVisibility') + .asFunction<_dart_clang_getCursorVisibility>())( cursor, ); } @@ -1683,9 +1756,10 @@ class LibClang { int clang_getCursorAvailability( CXCursor cursor, ) { - return (_clang_getCursorAvailability ??= _dylib.lookupFunction< - _c_clang_getCursorAvailability, - _dart_clang_getCursorAvailability>('clang_getCursorAvailability'))( + return (_clang_getCursorAvailability ??= + _lookup>( + 'clang_getCursorAvailability') + .asFunction<_dart_clang_getCursorAvailability>())( cursor, ); } @@ -1703,10 +1777,10 @@ class LibClang { ffi.Pointer availability, int availability_size, ) { - return (_clang_getCursorPlatformAvailability ??= _dylib.lookupFunction< - _c_clang_getCursorPlatformAvailability, - _dart_clang_getCursorPlatformAvailability>( - 'clang_getCursorPlatformAvailability'))( + return (_clang_getCursorPlatformAvailability ??= + _lookup>( + 'clang_getCursorPlatformAvailability') + .asFunction<_dart_clang_getCursorPlatformAvailability>())( cursor, always_deprecated, deprecated_message, @@ -1724,10 +1798,10 @@ class LibClang { void clang_disposeCXPlatformAvailability( ffi.Pointer availability, ) { - return (_clang_disposeCXPlatformAvailability ??= _dylib.lookupFunction< - _c_clang_disposeCXPlatformAvailability, - _dart_clang_disposeCXPlatformAvailability>( - 'clang_disposeCXPlatformAvailability'))( + return (_clang_disposeCXPlatformAvailability ??= + _lookup>( + 'clang_disposeCXPlatformAvailability') + .asFunction<_dart_clang_disposeCXPlatformAvailability>())( availability, ); } @@ -1739,9 +1813,10 @@ class LibClang { int clang_getCursorLanguage( CXCursor cursor, ) { - return (_clang_getCursorLanguage ??= _dylib.lookupFunction< - _c_clang_getCursorLanguage, - _dart_clang_getCursorLanguage>('clang_getCursorLanguage'))( + return (_clang_getCursorLanguage ??= + _lookup>( + 'clang_getCursorLanguage') + .asFunction<_dart_clang_getCursorLanguage>())( cursor, ); } @@ -1753,9 +1828,10 @@ class LibClang { int clang_getCursorTLSKind( CXCursor cursor, ) { - return (_clang_getCursorTLSKind ??= _dylib.lookupFunction< - _c_clang_getCursorTLSKind, - _dart_clang_getCursorTLSKind>('clang_getCursorTLSKind'))( + return (_clang_getCursorTLSKind ??= + _lookup>( + 'clang_getCursorTLSKind') + .asFunction<_dart_clang_getCursorTLSKind>())( cursor, ); } @@ -1766,10 +1842,10 @@ class LibClang { ffi.Pointer clang_Cursor_getTranslationUnit( CXCursor arg0, ) { - return (_clang_Cursor_getTranslationUnit ??= _dylib.lookupFunction< - _c_clang_Cursor_getTranslationUnit, - _dart_clang_Cursor_getTranslationUnit>( - 'clang_Cursor_getTranslationUnit'))( + return (_clang_Cursor_getTranslationUnit ??= + _lookup>( + 'clang_Cursor_getTranslationUnit') + .asFunction<_dart_clang_Cursor_getTranslationUnit>())( arg0, ); } @@ -1778,9 +1854,10 @@ class LibClang { /// Creates an empty CXCursorSet. ffi.Pointer clang_createCXCursorSet() { - return (_clang_createCXCursorSet ??= _dylib.lookupFunction< - _c_clang_createCXCursorSet, - _dart_clang_createCXCursorSet>('clang_createCXCursorSet'))(); + return (_clang_createCXCursorSet ??= + _lookup>( + 'clang_createCXCursorSet') + .asFunction<_dart_clang_createCXCursorSet>())(); } _dart_clang_createCXCursorSet? _clang_createCXCursorSet; @@ -1789,9 +1866,10 @@ class LibClang { void clang_disposeCXCursorSet( ffi.Pointer cset, ) { - return (_clang_disposeCXCursorSet ??= _dylib.lookupFunction< - _c_clang_disposeCXCursorSet, - _dart_clang_disposeCXCursorSet>('clang_disposeCXCursorSet'))( + return (_clang_disposeCXCursorSet ??= + _lookup>( + 'clang_disposeCXCursorSet') + .asFunction<_dart_clang_disposeCXCursorSet>())( cset, ); } @@ -1803,9 +1881,10 @@ class LibClang { ffi.Pointer cset, CXCursor cursor, ) { - return (_clang_CXCursorSet_contains ??= _dylib.lookupFunction< - _c_clang_CXCursorSet_contains, - _dart_clang_CXCursorSet_contains>('clang_CXCursorSet_contains'))( + return (_clang_CXCursorSet_contains ??= + _lookup>( + 'clang_CXCursorSet_contains') + .asFunction<_dart_clang_CXCursorSet_contains>())( cset, cursor, ); @@ -1818,9 +1897,10 @@ class LibClang { ffi.Pointer cset, CXCursor cursor, ) { - return (_clang_CXCursorSet_insert ??= _dylib.lookupFunction< - _c_clang_CXCursorSet_insert, - _dart_clang_CXCursorSet_insert>('clang_CXCursorSet_insert'))( + return (_clang_CXCursorSet_insert ??= + _lookup>( + 'clang_CXCursorSet_insert') + .asFunction<_dart_clang_CXCursorSet_insert>())( cset, cursor, ); @@ -1832,9 +1912,10 @@ class LibClang { CXCursor clang_getCursorSemanticParent( CXCursor cursor, ) { - return (_clang_getCursorSemanticParent ??= _dylib.lookupFunction< - _c_clang_getCursorSemanticParent, - _dart_clang_getCursorSemanticParent>('clang_getCursorSemanticParent'))( + return (_clang_getCursorSemanticParent ??= + _lookup>( + 'clang_getCursorSemanticParent') + .asFunction<_dart_clang_getCursorSemanticParent>())( cursor, ); } @@ -1845,9 +1926,10 @@ class LibClang { CXCursor clang_getCursorLexicalParent( CXCursor cursor, ) { - return (_clang_getCursorLexicalParent ??= _dylib.lookupFunction< - _c_clang_getCursorLexicalParent, - _dart_clang_getCursorLexicalParent>('clang_getCursorLexicalParent'))( + return (_clang_getCursorLexicalParent ??= + _lookup>( + 'clang_getCursorLexicalParent') + .asFunction<_dart_clang_getCursorLexicalParent>())( cursor, ); } @@ -1860,9 +1942,10 @@ class LibClang { ffi.Pointer> overridden, ffi.Pointer num_overridden, ) { - return (_clang_getOverriddenCursors ??= _dylib.lookupFunction< - _c_clang_getOverriddenCursors, - _dart_clang_getOverriddenCursors>('clang_getOverriddenCursors'))( + return (_clang_getOverriddenCursors ??= + _lookup>( + 'clang_getOverriddenCursors') + .asFunction<_dart_clang_getOverriddenCursors>())( cursor, overridden, num_overridden, @@ -1876,10 +1959,10 @@ class LibClang { void clang_disposeOverriddenCursors( ffi.Pointer overridden, ) { - return (_clang_disposeOverriddenCursors ??= _dylib.lookupFunction< - _c_clang_disposeOverriddenCursors, - _dart_clang_disposeOverriddenCursors>( - 'clang_disposeOverriddenCursors'))( + return (_clang_disposeOverriddenCursors ??= + _lookup>( + 'clang_disposeOverriddenCursors') + .asFunction<_dart_clang_disposeOverriddenCursors>())( overridden, ); } @@ -1891,9 +1974,10 @@ class LibClang { ffi.Pointer clang_getIncludedFile( CXCursor cursor, ) { - return (_clang_getIncludedFile ??= _dylib.lookupFunction< - _c_clang_getIncludedFile, - _dart_clang_getIncludedFile>('clang_getIncludedFile'))( + return (_clang_getIncludedFile ??= + _lookup>( + 'clang_getIncludedFile') + .asFunction<_dart_clang_getIncludedFile>())( cursor, ); } @@ -1907,8 +1991,8 @@ class LibClang { CXSourceLocation arg1, ) { return (_clang_getCursor ??= - _dylib.lookupFunction<_c_clang_getCursor, _dart_clang_getCursor>( - 'clang_getCursor'))( + _lookup>('clang_getCursor') + .asFunction<_dart_clang_getCursor>())( arg0, arg1, ); @@ -1921,9 +2005,10 @@ class LibClang { CXSourceLocation clang_getCursorLocation( CXCursor arg0, ) { - return (_clang_getCursorLocation ??= _dylib.lookupFunction< - _c_clang_getCursorLocation, - _dart_clang_getCursorLocation>('clang_getCursorLocation'))( + return (_clang_getCursorLocation ??= + _lookup>( + 'clang_getCursorLocation') + .asFunction<_dart_clang_getCursorLocation>())( arg0, ); } @@ -1935,9 +2020,10 @@ class LibClang { CXSourceRange clang_getCursorExtent( CXCursor arg0, ) { - return (_clang_getCursorExtent ??= _dylib.lookupFunction< - _c_clang_getCursorExtent, - _dart_clang_getCursorExtent>('clang_getCursorExtent'))( + return (_clang_getCursorExtent ??= + _lookup>( + 'clang_getCursorExtent') + .asFunction<_dart_clang_getCursorExtent>())( arg0, ); } @@ -1948,9 +2034,10 @@ class LibClang { CXType clang_getCursorType( CXCursor C, ) { - return (_clang_getCursorType ??= _dylib.lookupFunction< - _c_clang_getCursorType, - _dart_clang_getCursorType>('clang_getCursorType'))( + return (_clang_getCursorType ??= + _lookup>( + 'clang_getCursorType') + .asFunction<_dart_clang_getCursorType>())( C, ); } @@ -1962,9 +2049,10 @@ class LibClang { CXString clang_getTypeSpelling( CXType CT, ) { - return (_clang_getTypeSpelling ??= _dylib.lookupFunction< - _c_clang_getTypeSpelling, - _dart_clang_getTypeSpelling>('clang_getTypeSpelling'))( + return (_clang_getTypeSpelling ??= + _lookup>( + 'clang_getTypeSpelling') + .asFunction<_dart_clang_getTypeSpelling>())( CT, ); } @@ -1975,10 +2063,10 @@ class LibClang { CXType clang_getTypedefDeclUnderlyingType( CXCursor C, ) { - return (_clang_getTypedefDeclUnderlyingType ??= _dylib.lookupFunction< - _c_clang_getTypedefDeclUnderlyingType, - _dart_clang_getTypedefDeclUnderlyingType>( - 'clang_getTypedefDeclUnderlyingType'))( + return (_clang_getTypedefDeclUnderlyingType ??= + _lookup>( + 'clang_getTypedefDeclUnderlyingType') + .asFunction<_dart_clang_getTypedefDeclUnderlyingType>())( C, ); } @@ -1989,9 +2077,10 @@ class LibClang { CXType clang_getEnumDeclIntegerType( CXCursor C, ) { - return (_clang_getEnumDeclIntegerType ??= _dylib.lookupFunction< - _c_clang_getEnumDeclIntegerType, - _dart_clang_getEnumDeclIntegerType>('clang_getEnumDeclIntegerType'))( + return (_clang_getEnumDeclIntegerType ??= + _lookup>( + 'clang_getEnumDeclIntegerType') + .asFunction<_dart_clang_getEnumDeclIntegerType>())( C, ); } @@ -2003,10 +2092,10 @@ class LibClang { int clang_getEnumConstantDeclValue( CXCursor C, ) { - return (_clang_getEnumConstantDeclValue ??= _dylib.lookupFunction< - _c_clang_getEnumConstantDeclValue, - _dart_clang_getEnumConstantDeclValue>( - 'clang_getEnumConstantDeclValue'))( + return (_clang_getEnumConstantDeclValue ??= + _lookup>( + 'clang_getEnumConstantDeclValue') + .asFunction<_dart_clang_getEnumConstantDeclValue>())( C, ); } @@ -2018,10 +2107,10 @@ class LibClang { int clang_getEnumConstantDeclUnsignedValue( CXCursor C, ) { - return (_clang_getEnumConstantDeclUnsignedValue ??= _dylib.lookupFunction< - _c_clang_getEnumConstantDeclUnsignedValue, - _dart_clang_getEnumConstantDeclUnsignedValue>( - 'clang_getEnumConstantDeclUnsignedValue'))( + return (_clang_getEnumConstantDeclUnsignedValue ??= + _lookup>( + 'clang_getEnumConstantDeclUnsignedValue') + .asFunction<_dart_clang_getEnumConstantDeclUnsignedValue>())( C, ); } @@ -2033,9 +2122,10 @@ class LibClang { int clang_getFieldDeclBitWidth( CXCursor C, ) { - return (_clang_getFieldDeclBitWidth ??= _dylib.lookupFunction< - _c_clang_getFieldDeclBitWidth, - _dart_clang_getFieldDeclBitWidth>('clang_getFieldDeclBitWidth'))( + return (_clang_getFieldDeclBitWidth ??= + _lookup>( + 'clang_getFieldDeclBitWidth') + .asFunction<_dart_clang_getFieldDeclBitWidth>())( C, ); } @@ -2047,9 +2137,10 @@ class LibClang { int clang_Cursor_getNumArguments( CXCursor C, ) { - return (_clang_Cursor_getNumArguments ??= _dylib.lookupFunction< - _c_clang_Cursor_getNumArguments, - _dart_clang_Cursor_getNumArguments>('clang_Cursor_getNumArguments'))( + return (_clang_Cursor_getNumArguments ??= + _lookup>( + 'clang_Cursor_getNumArguments') + .asFunction<_dart_clang_Cursor_getNumArguments>())( C, ); } @@ -2061,9 +2152,10 @@ class LibClang { CXCursor C, int i, ) { - return (_clang_Cursor_getArgument ??= _dylib.lookupFunction< - _c_clang_Cursor_getArgument, - _dart_clang_Cursor_getArgument>('clang_Cursor_getArgument'))( + return (_clang_Cursor_getArgument ??= + _lookup>( + 'clang_Cursor_getArgument') + .asFunction<_dart_clang_Cursor_getArgument>())( C, i, ); @@ -2076,10 +2168,10 @@ class LibClang { int clang_Cursor_getNumTemplateArguments( CXCursor C, ) { - return (_clang_Cursor_getNumTemplateArguments ??= _dylib.lookupFunction< - _c_clang_Cursor_getNumTemplateArguments, - _dart_clang_Cursor_getNumTemplateArguments>( - 'clang_Cursor_getNumTemplateArguments'))( + return (_clang_Cursor_getNumTemplateArguments ??= + _lookup>( + 'clang_Cursor_getNumTemplateArguments') + .asFunction<_dart_clang_Cursor_getNumTemplateArguments>())( C, ); } @@ -2092,10 +2184,10 @@ class LibClang { CXCursor C, int I, ) { - return (_clang_Cursor_getTemplateArgumentKind ??= _dylib.lookupFunction< - _c_clang_Cursor_getTemplateArgumentKind, - _dart_clang_Cursor_getTemplateArgumentKind>( - 'clang_Cursor_getTemplateArgumentKind'))( + return (_clang_Cursor_getTemplateArgumentKind ??= + _lookup>( + 'clang_Cursor_getTemplateArgumentKind') + .asFunction<_dart_clang_Cursor_getTemplateArgumentKind>())( C, I, ); @@ -2110,10 +2202,10 @@ class LibClang { CXCursor C, int I, ) { - return (_clang_Cursor_getTemplateArgumentType ??= _dylib.lookupFunction< - _c_clang_Cursor_getTemplateArgumentType, - _dart_clang_Cursor_getTemplateArgumentType>( - 'clang_Cursor_getTemplateArgumentType'))( + return (_clang_Cursor_getTemplateArgumentType ??= + _lookup>( + 'clang_Cursor_getTemplateArgumentType') + .asFunction<_dart_clang_Cursor_getTemplateArgumentType>())( C, I, ); @@ -2128,10 +2220,10 @@ class LibClang { CXCursor C, int I, ) { - return (_clang_Cursor_getTemplateArgumentValue ??= _dylib.lookupFunction< - _c_clang_Cursor_getTemplateArgumentValue, - _dart_clang_Cursor_getTemplateArgumentValue>( - 'clang_Cursor_getTemplateArgumentValue'))( + return (_clang_Cursor_getTemplateArgumentValue ??= + _lookup>( + 'clang_Cursor_getTemplateArgumentValue') + .asFunction<_dart_clang_Cursor_getTemplateArgumentValue>())( C, I, ); @@ -2146,10 +2238,11 @@ class LibClang { CXCursor C, int I, ) { - return (_clang_Cursor_getTemplateArgumentUnsignedValue ??= - _dylib.lookupFunction<_c_clang_Cursor_getTemplateArgumentUnsignedValue, - _dart_clang_Cursor_getTemplateArgumentUnsignedValue>( - 'clang_Cursor_getTemplateArgumentUnsignedValue'))( + return (_clang_Cursor_getTemplateArgumentUnsignedValue ??= _lookup< + ffi.NativeFunction< + _c_clang_Cursor_getTemplateArgumentUnsignedValue>>( + 'clang_Cursor_getTemplateArgumentUnsignedValue') + .asFunction<_dart_clang_Cursor_getTemplateArgumentUnsignedValue>())( C, I, ); @@ -2164,8 +2257,8 @@ class LibClang { CXType B, ) { return (_clang_equalTypes ??= - _dylib.lookupFunction<_c_clang_equalTypes, _dart_clang_equalTypes>( - 'clang_equalTypes'))( + _lookup>('clang_equalTypes') + .asFunction<_dart_clang_equalTypes>())( A, B, ); @@ -2177,9 +2270,10 @@ class LibClang { CXType clang_getCanonicalType( CXType T, ) { - return (_clang_getCanonicalType ??= _dylib.lookupFunction< - _c_clang_getCanonicalType, - _dart_clang_getCanonicalType>('clang_getCanonicalType'))( + return (_clang_getCanonicalType ??= + _lookup>( + 'clang_getCanonicalType') + .asFunction<_dart_clang_getCanonicalType>())( T, ); } @@ -2191,9 +2285,10 @@ class LibClang { int clang_isConstQualifiedType( CXType T, ) { - return (_clang_isConstQualifiedType ??= _dylib.lookupFunction< - _c_clang_isConstQualifiedType, - _dart_clang_isConstQualifiedType>('clang_isConstQualifiedType'))( + return (_clang_isConstQualifiedType ??= + _lookup>( + 'clang_isConstQualifiedType') + .asFunction<_dart_clang_isConstQualifiedType>())( T, ); } @@ -2204,10 +2299,10 @@ class LibClang { int clang_Cursor_isMacroFunctionLike( CXCursor C, ) { - return (_clang_Cursor_isMacroFunctionLike ??= _dylib.lookupFunction< - _c_clang_Cursor_isMacroFunctionLike, - _dart_clang_Cursor_isMacroFunctionLike>( - 'clang_Cursor_isMacroFunctionLike'))( + return (_clang_Cursor_isMacroFunctionLike ??= + _lookup>( + 'clang_Cursor_isMacroFunctionLike') + .asFunction<_dart_clang_Cursor_isMacroFunctionLike>())( C, ); } @@ -2218,9 +2313,10 @@ class LibClang { int clang_Cursor_isMacroBuiltin( CXCursor C, ) { - return (_clang_Cursor_isMacroBuiltin ??= _dylib.lookupFunction< - _c_clang_Cursor_isMacroBuiltin, - _dart_clang_Cursor_isMacroBuiltin>('clang_Cursor_isMacroBuiltin'))( + return (_clang_Cursor_isMacroBuiltin ??= + _lookup>( + 'clang_Cursor_isMacroBuiltin') + .asFunction<_dart_clang_Cursor_isMacroBuiltin>())( C, ); } @@ -2232,10 +2328,10 @@ class LibClang { int clang_Cursor_isFunctionInlined( CXCursor C, ) { - return (_clang_Cursor_isFunctionInlined ??= _dylib.lookupFunction< - _c_clang_Cursor_isFunctionInlined, - _dart_clang_Cursor_isFunctionInlined>( - 'clang_Cursor_isFunctionInlined'))( + return (_clang_Cursor_isFunctionInlined ??= + _lookup>( + 'clang_Cursor_isFunctionInlined') + .asFunction<_dart_clang_Cursor_isFunctionInlined>())( C, ); } @@ -2248,9 +2344,10 @@ class LibClang { int clang_isVolatileQualifiedType( CXType T, ) { - return (_clang_isVolatileQualifiedType ??= _dylib.lookupFunction< - _c_clang_isVolatileQualifiedType, - _dart_clang_isVolatileQualifiedType>('clang_isVolatileQualifiedType'))( + return (_clang_isVolatileQualifiedType ??= + _lookup>( + 'clang_isVolatileQualifiedType') + .asFunction<_dart_clang_isVolatileQualifiedType>())( T, ); } @@ -2263,9 +2360,10 @@ class LibClang { int clang_isRestrictQualifiedType( CXType T, ) { - return (_clang_isRestrictQualifiedType ??= _dylib.lookupFunction< - _c_clang_isRestrictQualifiedType, - _dart_clang_isRestrictQualifiedType>('clang_isRestrictQualifiedType'))( + return (_clang_isRestrictQualifiedType ??= + _lookup>( + 'clang_isRestrictQualifiedType') + .asFunction<_dart_clang_isRestrictQualifiedType>())( T, ); } @@ -2276,9 +2374,10 @@ class LibClang { int clang_getAddressSpace( CXType T, ) { - return (_clang_getAddressSpace ??= _dylib.lookupFunction< - _c_clang_getAddressSpace, - _dart_clang_getAddressSpace>('clang_getAddressSpace'))( + return (_clang_getAddressSpace ??= + _lookup>( + 'clang_getAddressSpace') + .asFunction<_dart_clang_getAddressSpace>())( T, ); } @@ -2289,9 +2388,10 @@ class LibClang { CXString clang_getTypedefName( CXType CT, ) { - return (_clang_getTypedefName ??= _dylib.lookupFunction< - _c_clang_getTypedefName, - _dart_clang_getTypedefName>('clang_getTypedefName'))( + return (_clang_getTypedefName ??= + _lookup>( + 'clang_getTypedefName') + .asFunction<_dart_clang_getTypedefName>())( CT, ); } @@ -2302,9 +2402,10 @@ class LibClang { CXType clang_getPointeeType( CXType T, ) { - return (_clang_getPointeeType ??= _dylib.lookupFunction< - _c_clang_getPointeeType, - _dart_clang_getPointeeType>('clang_getPointeeType'))( + return (_clang_getPointeeType ??= + _lookup>( + 'clang_getPointeeType') + .asFunction<_dart_clang_getPointeeType>())( T, ); } @@ -2315,9 +2416,10 @@ class LibClang { CXCursor clang_getTypeDeclaration( CXType T, ) { - return (_clang_getTypeDeclaration ??= _dylib.lookupFunction< - _c_clang_getTypeDeclaration, - _dart_clang_getTypeDeclaration>('clang_getTypeDeclaration'))( + return (_clang_getTypeDeclaration ??= + _lookup>( + 'clang_getTypeDeclaration') + .asFunction<_dart_clang_getTypeDeclaration>())( T, ); } @@ -2328,9 +2430,10 @@ class LibClang { CXString clang_getDeclObjCTypeEncoding( CXCursor C, ) { - return (_clang_getDeclObjCTypeEncoding ??= _dylib.lookupFunction< - _c_clang_getDeclObjCTypeEncoding, - _dart_clang_getDeclObjCTypeEncoding>('clang_getDeclObjCTypeEncoding'))( + return (_clang_getDeclObjCTypeEncoding ??= + _lookup>( + 'clang_getDeclObjCTypeEncoding') + .asFunction<_dart_clang_getDeclObjCTypeEncoding>())( C, ); } @@ -2341,9 +2444,10 @@ class LibClang { CXString clang_Type_getObjCEncoding( CXType type, ) { - return (_clang_Type_getObjCEncoding ??= _dylib.lookupFunction< - _c_clang_Type_getObjCEncoding, - _dart_clang_Type_getObjCEncoding>('clang_Type_getObjCEncoding'))( + return (_clang_Type_getObjCEncoding ??= + _lookup>( + 'clang_Type_getObjCEncoding') + .asFunction<_dart_clang_Type_getObjCEncoding>())( type, ); } @@ -2354,9 +2458,10 @@ class LibClang { CXString clang_getTypeKindSpelling( int K, ) { - return (_clang_getTypeKindSpelling ??= _dylib.lookupFunction< - _c_clang_getTypeKindSpelling, - _dart_clang_getTypeKindSpelling>('clang_getTypeKindSpelling'))( + return (_clang_getTypeKindSpelling ??= + _lookup>( + 'clang_getTypeKindSpelling') + .asFunction<_dart_clang_getTypeKindSpelling>())( K, ); } @@ -2367,10 +2472,10 @@ class LibClang { int clang_getFunctionTypeCallingConv( CXType T, ) { - return (_clang_getFunctionTypeCallingConv ??= _dylib.lookupFunction< - _c_clang_getFunctionTypeCallingConv, - _dart_clang_getFunctionTypeCallingConv>( - 'clang_getFunctionTypeCallingConv'))( + return (_clang_getFunctionTypeCallingConv ??= + _lookup>( + 'clang_getFunctionTypeCallingConv') + .asFunction<_dart_clang_getFunctionTypeCallingConv>())( T, ); } @@ -2381,9 +2486,10 @@ class LibClang { CXType clang_getResultType( CXType T, ) { - return (_clang_getResultType ??= _dylib.lookupFunction< - _c_clang_getResultType, - _dart_clang_getResultType>('clang_getResultType'))( + return (_clang_getResultType ??= + _lookup>( + 'clang_getResultType') + .asFunction<_dart_clang_getResultType>())( T, ); } @@ -2395,10 +2501,10 @@ class LibClang { int clang_getExceptionSpecificationType( CXType T, ) { - return (_clang_getExceptionSpecificationType ??= _dylib.lookupFunction< - _c_clang_getExceptionSpecificationType, - _dart_clang_getExceptionSpecificationType>( - 'clang_getExceptionSpecificationType'))( + return (_clang_getExceptionSpecificationType ??= + _lookup>( + 'clang_getExceptionSpecificationType') + .asFunction<_dart_clang_getExceptionSpecificationType>())( T, ); } @@ -2411,9 +2517,10 @@ class LibClang { int clang_getNumArgTypes( CXType T, ) { - return (_clang_getNumArgTypes ??= _dylib.lookupFunction< - _c_clang_getNumArgTypes, - _dart_clang_getNumArgTypes>('clang_getNumArgTypes'))( + return (_clang_getNumArgTypes ??= + _lookup>( + 'clang_getNumArgTypes') + .asFunction<_dart_clang_getNumArgTypes>())( T, ); } @@ -2426,8 +2533,8 @@ class LibClang { int i, ) { return (_clang_getArgType ??= - _dylib.lookupFunction<_c_clang_getArgType, _dart_clang_getArgType>( - 'clang_getArgType'))( + _lookup>('clang_getArgType') + .asFunction<_dart_clang_getArgType>())( T, i, ); @@ -2439,10 +2546,10 @@ class LibClang { CXType clang_Type_getObjCObjectBaseType( CXType T, ) { - return (_clang_Type_getObjCObjectBaseType ??= _dylib.lookupFunction< - _c_clang_Type_getObjCObjectBaseType, - _dart_clang_Type_getObjCObjectBaseType>( - 'clang_Type_getObjCObjectBaseType'))( + return (_clang_Type_getObjCObjectBaseType ??= + _lookup>( + 'clang_Type_getObjCObjectBaseType') + .asFunction<_dart_clang_Type_getObjCObjectBaseType>())( T, ); } @@ -2454,10 +2561,10 @@ class LibClang { int clang_Type_getNumObjCProtocolRefs( CXType T, ) { - return (_clang_Type_getNumObjCProtocolRefs ??= _dylib.lookupFunction< - _c_clang_Type_getNumObjCProtocolRefs, - _dart_clang_Type_getNumObjCProtocolRefs>( - 'clang_Type_getNumObjCProtocolRefs'))( + return (_clang_Type_getNumObjCProtocolRefs ??= + _lookup>( + 'clang_Type_getNumObjCProtocolRefs') + .asFunction<_dart_clang_Type_getNumObjCProtocolRefs>())( T, ); } @@ -2469,10 +2576,10 @@ class LibClang { CXType T, int i, ) { - return (_clang_Type_getObjCProtocolDecl ??= _dylib.lookupFunction< - _c_clang_Type_getObjCProtocolDecl, - _dart_clang_Type_getObjCProtocolDecl>( - 'clang_Type_getObjCProtocolDecl'))( + return (_clang_Type_getObjCProtocolDecl ??= + _lookup>( + 'clang_Type_getObjCProtocolDecl') + .asFunction<_dart_clang_Type_getObjCProtocolDecl>())( T, i, ); @@ -2484,9 +2591,10 @@ class LibClang { int clang_Type_getNumObjCTypeArgs( CXType T, ) { - return (_clang_Type_getNumObjCTypeArgs ??= _dylib.lookupFunction< - _c_clang_Type_getNumObjCTypeArgs, - _dart_clang_Type_getNumObjCTypeArgs>('clang_Type_getNumObjCTypeArgs'))( + return (_clang_Type_getNumObjCTypeArgs ??= + _lookup>( + 'clang_Type_getNumObjCTypeArgs') + .asFunction<_dart_clang_Type_getNumObjCTypeArgs>())( T, ); } @@ -2498,9 +2606,10 @@ class LibClang { CXType T, int i, ) { - return (_clang_Type_getObjCTypeArg ??= _dylib.lookupFunction< - _c_clang_Type_getObjCTypeArg, - _dart_clang_Type_getObjCTypeArg>('clang_Type_getObjCTypeArg'))( + return (_clang_Type_getObjCTypeArg ??= + _lookup>( + 'clang_Type_getObjCTypeArg') + .asFunction<_dart_clang_Type_getObjCTypeArg>())( T, i, ); @@ -2512,9 +2621,10 @@ class LibClang { int clang_isFunctionTypeVariadic( CXType T, ) { - return (_clang_isFunctionTypeVariadic ??= _dylib.lookupFunction< - _c_clang_isFunctionTypeVariadic, - _dart_clang_isFunctionTypeVariadic>('clang_isFunctionTypeVariadic'))( + return (_clang_isFunctionTypeVariadic ??= + _lookup>( + 'clang_isFunctionTypeVariadic') + .asFunction<_dart_clang_isFunctionTypeVariadic>())( T, ); } @@ -2525,9 +2635,10 @@ class LibClang { CXType clang_getCursorResultType( CXCursor C, ) { - return (_clang_getCursorResultType ??= _dylib.lookupFunction< - _c_clang_getCursorResultType, - _dart_clang_getCursorResultType>('clang_getCursorResultType'))( + return (_clang_getCursorResultType ??= + _lookup>( + 'clang_getCursorResultType') + .asFunction<_dart_clang_getCursorResultType>())( C, ); } @@ -2539,10 +2650,11 @@ class LibClang { int clang_getCursorExceptionSpecificationType( CXCursor C, ) { - return (_clang_getCursorExceptionSpecificationType ??= - _dylib.lookupFunction<_c_clang_getCursorExceptionSpecificationType, - _dart_clang_getCursorExceptionSpecificationType>( - 'clang_getCursorExceptionSpecificationType'))( + return (_clang_getCursorExceptionSpecificationType ??= _lookup< + ffi.NativeFunction< + _c_clang_getCursorExceptionSpecificationType>>( + 'clang_getCursorExceptionSpecificationType') + .asFunction<_dart_clang_getCursorExceptionSpecificationType>())( C, ); } @@ -2555,8 +2667,8 @@ class LibClang { CXType T, ) { return (_clang_isPODType ??= - _dylib.lookupFunction<_c_clang_isPODType, _dart_clang_isPODType>( - 'clang_isPODType'))( + _lookup>('clang_isPODType') + .asFunction<_dart_clang_isPODType>())( T, ); } @@ -2567,9 +2679,10 @@ class LibClang { CXType clang_getElementType( CXType T, ) { - return (_clang_getElementType ??= _dylib.lookupFunction< - _c_clang_getElementType, - _dart_clang_getElementType>('clang_getElementType'))( + return (_clang_getElementType ??= + _lookup>( + 'clang_getElementType') + .asFunction<_dart_clang_getElementType>())( T, ); } @@ -2580,9 +2693,10 @@ class LibClang { int clang_getNumElements( CXType T, ) { - return (_clang_getNumElements ??= _dylib.lookupFunction< - _c_clang_getNumElements, - _dart_clang_getNumElements>('clang_getNumElements'))( + return (_clang_getNumElements ??= + _lookup>( + 'clang_getNumElements') + .asFunction<_dart_clang_getNumElements>())( T, ); } @@ -2593,9 +2707,10 @@ class LibClang { CXType clang_getArrayElementType( CXType T, ) { - return (_clang_getArrayElementType ??= _dylib.lookupFunction< - _c_clang_getArrayElementType, - _dart_clang_getArrayElementType>('clang_getArrayElementType'))( + return (_clang_getArrayElementType ??= + _lookup>( + 'clang_getArrayElementType') + .asFunction<_dart_clang_getArrayElementType>())( T, ); } @@ -2607,8 +2722,8 @@ class LibClang { CXType T, ) { return (_clang_getArraySize ??= - _dylib.lookupFunction<_c_clang_getArraySize, _dart_clang_getArraySize>( - 'clang_getArraySize'))( + _lookup>('clang_getArraySize') + .asFunction<_dart_clang_getArraySize>())( T, ); } @@ -2619,9 +2734,10 @@ class LibClang { CXType clang_Type_getNamedType( CXType T, ) { - return (_clang_Type_getNamedType ??= _dylib.lookupFunction< - _c_clang_Type_getNamedType, - _dart_clang_Type_getNamedType>('clang_Type_getNamedType'))( + return (_clang_Type_getNamedType ??= + _lookup>( + 'clang_Type_getNamedType') + .asFunction<_dart_clang_Type_getNamedType>())( T, ); } @@ -2632,10 +2748,10 @@ class LibClang { int clang_Type_isTransparentTagTypedef( CXType T, ) { - return (_clang_Type_isTransparentTagTypedef ??= _dylib.lookupFunction< - _c_clang_Type_isTransparentTagTypedef, - _dart_clang_Type_isTransparentTagTypedef>( - 'clang_Type_isTransparentTagTypedef'))( + return (_clang_Type_isTransparentTagTypedef ??= + _lookup>( + 'clang_Type_isTransparentTagTypedef') + .asFunction<_dart_clang_Type_isTransparentTagTypedef>())( T, ); } @@ -2646,9 +2762,10 @@ class LibClang { int clang_Type_getNullability( CXType T, ) { - return (_clang_Type_getNullability ??= _dylib.lookupFunction< - _c_clang_Type_getNullability, - _dart_clang_Type_getNullability>('clang_Type_getNullability'))( + return (_clang_Type_getNullability ??= + _lookup>( + 'clang_Type_getNullability') + .asFunction<_dart_clang_Type_getNullability>())( T, ); } @@ -2659,9 +2776,10 @@ class LibClang { int clang_Type_getAlignOf( CXType T, ) { - return (_clang_Type_getAlignOf ??= _dylib.lookupFunction< - _c_clang_Type_getAlignOf, - _dart_clang_Type_getAlignOf>('clang_Type_getAlignOf'))( + return (_clang_Type_getAlignOf ??= + _lookup>( + 'clang_Type_getAlignOf') + .asFunction<_dart_clang_Type_getAlignOf>())( T, ); } @@ -2672,9 +2790,10 @@ class LibClang { CXType clang_Type_getClassType( CXType T, ) { - return (_clang_Type_getClassType ??= _dylib.lookupFunction< - _c_clang_Type_getClassType, - _dart_clang_Type_getClassType>('clang_Type_getClassType'))( + return (_clang_Type_getClassType ??= + _lookup>( + 'clang_Type_getClassType') + .asFunction<_dart_clang_Type_getClassType>())( T, ); } @@ -2685,9 +2804,10 @@ class LibClang { int clang_Type_getSizeOf( CXType T, ) { - return (_clang_Type_getSizeOf ??= _dylib.lookupFunction< - _c_clang_Type_getSizeOf, - _dart_clang_Type_getSizeOf>('clang_Type_getSizeOf'))( + return (_clang_Type_getSizeOf ??= + _lookup>( + 'clang_Type_getSizeOf') + .asFunction<_dart_clang_Type_getSizeOf>())( T, ); } @@ -2700,9 +2820,10 @@ class LibClang { CXType T, ffi.Pointer S, ) { - return (_clang_Type_getOffsetOf ??= _dylib.lookupFunction< - _c_clang_Type_getOffsetOf, - _dart_clang_Type_getOffsetOf>('clang_Type_getOffsetOf'))( + return (_clang_Type_getOffsetOf ??= + _lookup>( + 'clang_Type_getOffsetOf') + .asFunction<_dart_clang_Type_getOffsetOf>())( T, S, ); @@ -2714,9 +2835,10 @@ class LibClang { CXType clang_Type_getModifiedType( CXType T, ) { - return (_clang_Type_getModifiedType ??= _dylib.lookupFunction< - _c_clang_Type_getModifiedType, - _dart_clang_Type_getModifiedType>('clang_Type_getModifiedType'))( + return (_clang_Type_getModifiedType ??= + _lookup>( + 'clang_Type_getModifiedType') + .asFunction<_dart_clang_Type_getModifiedType>())( T, ); } @@ -2727,9 +2849,10 @@ class LibClang { int clang_Cursor_getOffsetOfField( CXCursor C, ) { - return (_clang_Cursor_getOffsetOfField ??= _dylib.lookupFunction< - _c_clang_Cursor_getOffsetOfField, - _dart_clang_Cursor_getOffsetOfField>('clang_Cursor_getOffsetOfField'))( + return (_clang_Cursor_getOffsetOfField ??= + _lookup>( + 'clang_Cursor_getOffsetOfField') + .asFunction<_dart_clang_Cursor_getOffsetOfField>())( C, ); } @@ -2741,9 +2864,10 @@ class LibClang { int clang_Cursor_isAnonymous( CXCursor C, ) { - return (_clang_Cursor_isAnonymous ??= _dylib.lookupFunction< - _c_clang_Cursor_isAnonymous, - _dart_clang_Cursor_isAnonymous>('clang_Cursor_isAnonymous'))( + return (_clang_Cursor_isAnonymous ??= + _lookup>( + 'clang_Cursor_isAnonymous') + .asFunction<_dart_clang_Cursor_isAnonymous>())( C, ); } @@ -2755,10 +2879,10 @@ class LibClang { int clang_Cursor_isAnonymousRecordDecl( CXCursor C, ) { - return (_clang_Cursor_isAnonymousRecordDecl ??= _dylib.lookupFunction< - _c_clang_Cursor_isAnonymousRecordDecl, - _dart_clang_Cursor_isAnonymousRecordDecl>( - 'clang_Cursor_isAnonymousRecordDecl'))( + return (_clang_Cursor_isAnonymousRecordDecl ??= + _lookup>( + 'clang_Cursor_isAnonymousRecordDecl') + .asFunction<_dart_clang_Cursor_isAnonymousRecordDecl>())( C, ); } @@ -2770,10 +2894,10 @@ class LibClang { int clang_Cursor_isInlineNamespace( CXCursor C, ) { - return (_clang_Cursor_isInlineNamespace ??= _dylib.lookupFunction< - _c_clang_Cursor_isInlineNamespace, - _dart_clang_Cursor_isInlineNamespace>( - 'clang_Cursor_isInlineNamespace'))( + return (_clang_Cursor_isInlineNamespace ??= + _lookup>( + 'clang_Cursor_isInlineNamespace') + .asFunction<_dart_clang_Cursor_isInlineNamespace>())( C, ); } @@ -2785,10 +2909,10 @@ class LibClang { int clang_Type_getNumTemplateArguments( CXType T, ) { - return (_clang_Type_getNumTemplateArguments ??= _dylib.lookupFunction< - _c_clang_Type_getNumTemplateArguments, - _dart_clang_Type_getNumTemplateArguments>( - 'clang_Type_getNumTemplateArguments'))( + return (_clang_Type_getNumTemplateArguments ??= + _lookup>( + 'clang_Type_getNumTemplateArguments') + .asFunction<_dart_clang_Type_getNumTemplateArguments>())( T, ); } @@ -2801,10 +2925,10 @@ class LibClang { CXType T, int i, ) { - return (_clang_Type_getTemplateArgumentAsType ??= _dylib.lookupFunction< - _c_clang_Type_getTemplateArgumentAsType, - _dart_clang_Type_getTemplateArgumentAsType>( - 'clang_Type_getTemplateArgumentAsType'))( + return (_clang_Type_getTemplateArgumentAsType ??= + _lookup>( + 'clang_Type_getTemplateArgumentAsType') + .asFunction<_dart_clang_Type_getTemplateArgumentAsType>())( T, i, ); @@ -2817,9 +2941,10 @@ class LibClang { int clang_Type_getCXXRefQualifier( CXType T, ) { - return (_clang_Type_getCXXRefQualifier ??= _dylib.lookupFunction< - _c_clang_Type_getCXXRefQualifier, - _dart_clang_Type_getCXXRefQualifier>('clang_Type_getCXXRefQualifier'))( + return (_clang_Type_getCXXRefQualifier ??= + _lookup>( + 'clang_Type_getCXXRefQualifier') + .asFunction<_dart_clang_Type_getCXXRefQualifier>())( T, ); } @@ -2831,9 +2956,10 @@ class LibClang { int clang_Cursor_isBitField( CXCursor C, ) { - return (_clang_Cursor_isBitField ??= _dylib.lookupFunction< - _c_clang_Cursor_isBitField, - _dart_clang_Cursor_isBitField>('clang_Cursor_isBitField'))( + return (_clang_Cursor_isBitField ??= + _lookup>( + 'clang_Cursor_isBitField') + .asFunction<_dart_clang_Cursor_isBitField>())( C, ); } @@ -2845,9 +2971,10 @@ class LibClang { int clang_isVirtualBase( CXCursor arg0, ) { - return (_clang_isVirtualBase ??= _dylib.lookupFunction< - _c_clang_isVirtualBase, - _dart_clang_isVirtualBase>('clang_isVirtualBase'))( + return (_clang_isVirtualBase ??= + _lookup>( + 'clang_isVirtualBase') + .asFunction<_dart_clang_isVirtualBase>())( arg0, ); } @@ -2858,9 +2985,10 @@ class LibClang { int clang_getCXXAccessSpecifier( CXCursor arg0, ) { - return (_clang_getCXXAccessSpecifier ??= _dylib.lookupFunction< - _c_clang_getCXXAccessSpecifier, - _dart_clang_getCXXAccessSpecifier>('clang_getCXXAccessSpecifier'))( + return (_clang_getCXXAccessSpecifier ??= + _lookup>( + 'clang_getCXXAccessSpecifier') + .asFunction<_dart_clang_getCXXAccessSpecifier>())( arg0, ); } @@ -2871,9 +2999,10 @@ class LibClang { int clang_Cursor_getStorageClass( CXCursor arg0, ) { - return (_clang_Cursor_getStorageClass ??= _dylib.lookupFunction< - _c_clang_Cursor_getStorageClass, - _dart_clang_Cursor_getStorageClass>('clang_Cursor_getStorageClass'))( + return (_clang_Cursor_getStorageClass ??= + _lookup>( + 'clang_Cursor_getStorageClass') + .asFunction<_dart_clang_Cursor_getStorageClass>())( arg0, ); } @@ -2885,9 +3014,10 @@ class LibClang { int clang_getNumOverloadedDecls( CXCursor cursor, ) { - return (_clang_getNumOverloadedDecls ??= _dylib.lookupFunction< - _c_clang_getNumOverloadedDecls, - _dart_clang_getNumOverloadedDecls>('clang_getNumOverloadedDecls'))( + return (_clang_getNumOverloadedDecls ??= + _lookup>( + 'clang_getNumOverloadedDecls') + .asFunction<_dart_clang_getNumOverloadedDecls>())( cursor, ); } @@ -2900,9 +3030,10 @@ class LibClang { CXCursor cursor, int index, ) { - return (_clang_getOverloadedDecl ??= _dylib.lookupFunction< - _c_clang_getOverloadedDecl, - _dart_clang_getOverloadedDecl>('clang_getOverloadedDecl'))( + return (_clang_getOverloadedDecl ??= + _lookup>( + 'clang_getOverloadedDecl') + .asFunction<_dart_clang_getOverloadedDecl>())( cursor, index, ); @@ -2915,10 +3046,10 @@ class LibClang { CXType clang_getIBOutletCollectionType( CXCursor arg0, ) { - return (_clang_getIBOutletCollectionType ??= _dylib.lookupFunction< - _c_clang_getIBOutletCollectionType, - _dart_clang_getIBOutletCollectionType>( - 'clang_getIBOutletCollectionType'))( + return (_clang_getIBOutletCollectionType ??= + _lookup>( + 'clang_getIBOutletCollectionType') + .asFunction<_dart_clang_getIBOutletCollectionType>())( arg0, ); } @@ -2931,9 +3062,10 @@ class LibClang { ffi.Pointer> visitor, ffi.Pointer client_data, ) { - return (_clang_visitChildren ??= _dylib.lookupFunction< - _c_clang_visitChildren, - _dart_clang_visitChildren>('clang_visitChildren'))( + return (_clang_visitChildren ??= + _lookup>( + 'clang_visitChildren') + .asFunction<_dart_clang_visitChildren>())( parent, visitor, client_data, @@ -2948,8 +3080,8 @@ class LibClang { CXCursor arg0, ) { return (_clang_getCursorUSR ??= - _dylib.lookupFunction<_c_clang_getCursorUSR, _dart_clang_getCursorUSR>( - 'clang_getCursorUSR'))( + _lookup>('clang_getCursorUSR') + .asFunction<_dart_clang_getCursorUSR>())( arg0, ); } @@ -2960,9 +3092,10 @@ class LibClang { 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'))( + return (_clang_constructUSR_ObjCClass ??= + _lookup>( + 'clang_constructUSR_ObjCClass') + .asFunction<_dart_clang_constructUSR_ObjCClass>())( class_name, ); } @@ -2974,10 +3107,10 @@ class LibClang { 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'))( + return (_clang_constructUSR_ObjCCategory ??= + _lookup>( + 'clang_constructUSR_ObjCCategory') + .asFunction<_dart_clang_constructUSR_ObjCCategory>())( class_name, category_name, ); @@ -2989,10 +3122,10 @@ class LibClang { 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'))( + return (_clang_constructUSR_ObjCProtocol ??= + _lookup>( + 'clang_constructUSR_ObjCProtocol') + .asFunction<_dart_clang_constructUSR_ObjCProtocol>())( protocol_name, ); } @@ -3005,9 +3138,10 @@ class LibClang { ffi.Pointer name, CXString classUSR, ) { - return (_clang_constructUSR_ObjCIvar ??= _dylib.lookupFunction< - _c_clang_constructUSR_ObjCIvar, - _dart_clang_constructUSR_ObjCIvar>('clang_constructUSR_ObjCIvar'))( + return (_clang_constructUSR_ObjCIvar ??= + _lookup>( + 'clang_constructUSR_ObjCIvar') + .asFunction<_dart_clang_constructUSR_ObjCIvar>())( name, classUSR, ); @@ -3022,9 +3156,10 @@ class LibClang { int isInstanceMethod, CXString classUSR, ) { - return (_clang_constructUSR_ObjCMethod ??= _dylib.lookupFunction< - _c_clang_constructUSR_ObjCMethod, - _dart_clang_constructUSR_ObjCMethod>('clang_constructUSR_ObjCMethod'))( + return (_clang_constructUSR_ObjCMethod ??= + _lookup>( + 'clang_constructUSR_ObjCMethod') + .asFunction<_dart_clang_constructUSR_ObjCMethod>())( name, isInstanceMethod, classUSR, @@ -3039,10 +3174,10 @@ class LibClang { ffi.Pointer property, CXString classUSR, ) { - return (_clang_constructUSR_ObjCProperty ??= _dylib.lookupFunction< - _c_clang_constructUSR_ObjCProperty, - _dart_clang_constructUSR_ObjCProperty>( - 'clang_constructUSR_ObjCProperty'))( + return (_clang_constructUSR_ObjCProperty ??= + _lookup>( + 'clang_constructUSR_ObjCProperty') + .asFunction<_dart_clang_constructUSR_ObjCProperty>())( property, classUSR, ); @@ -3054,9 +3189,10 @@ class LibClang { CXString clang_getCursorSpelling( CXCursor arg0, ) { - return (_clang_getCursorSpelling ??= _dylib.lookupFunction< - _c_clang_getCursorSpelling, - _dart_clang_getCursorSpelling>('clang_getCursorSpelling'))( + return (_clang_getCursorSpelling ??= + _lookup>( + 'clang_getCursorSpelling') + .asFunction<_dart_clang_getCursorSpelling>())( arg0, ); } @@ -3072,10 +3208,10 @@ class LibClang { int pieceIndex, int options, ) { - return (_clang_Cursor_getSpellingNameRange ??= _dylib.lookupFunction< - _c_clang_Cursor_getSpellingNameRange, - _dart_clang_Cursor_getSpellingNameRange>( - 'clang_Cursor_getSpellingNameRange'))( + return (_clang_Cursor_getSpellingNameRange ??= + _lookup>( + 'clang_Cursor_getSpellingNameRange') + .asFunction<_dart_clang_Cursor_getSpellingNameRange>())( arg0, pieceIndex, options, @@ -3089,10 +3225,10 @@ class LibClang { ffi.Pointer Policy, int Property, ) { - return (_clang_PrintingPolicy_getProperty ??= _dylib.lookupFunction< - _c_clang_PrintingPolicy_getProperty, - _dart_clang_PrintingPolicy_getProperty>( - 'clang_PrintingPolicy_getProperty'))( + return (_clang_PrintingPolicy_getProperty ??= + _lookup>( + 'clang_PrintingPolicy_getProperty') + .asFunction<_dart_clang_PrintingPolicy_getProperty>())( Policy, Property, ); @@ -3106,10 +3242,10 @@ class LibClang { int Property, int Value, ) { - return (_clang_PrintingPolicy_setProperty ??= _dylib.lookupFunction< - _c_clang_PrintingPolicy_setProperty, - _dart_clang_PrintingPolicy_setProperty>( - 'clang_PrintingPolicy_setProperty'))( + return (_clang_PrintingPolicy_setProperty ??= + _lookup>( + 'clang_PrintingPolicy_setProperty') + .asFunction<_dart_clang_PrintingPolicy_setProperty>())( Policy, Property, Value, @@ -3122,9 +3258,10 @@ class LibClang { ffi.Pointer clang_getCursorPrintingPolicy( CXCursor arg0, ) { - return (_clang_getCursorPrintingPolicy ??= _dylib.lookupFunction< - _c_clang_getCursorPrintingPolicy, - _dart_clang_getCursorPrintingPolicy>('clang_getCursorPrintingPolicy'))( + return (_clang_getCursorPrintingPolicy ??= + _lookup>( + 'clang_getCursorPrintingPolicy') + .asFunction<_dart_clang_getCursorPrintingPolicy>())( arg0, ); } @@ -3135,9 +3272,10 @@ class LibClang { void clang_PrintingPolicy_dispose( ffi.Pointer Policy, ) { - return (_clang_PrintingPolicy_dispose ??= _dylib.lookupFunction< - _c_clang_PrintingPolicy_dispose, - _dart_clang_PrintingPolicy_dispose>('clang_PrintingPolicy_dispose'))( + return (_clang_PrintingPolicy_dispose ??= + _lookup>( + 'clang_PrintingPolicy_dispose') + .asFunction<_dart_clang_PrintingPolicy_dispose>())( Policy, ); } @@ -3149,9 +3287,10 @@ class LibClang { CXCursor Cursor, ffi.Pointer Policy, ) { - return (_clang_getCursorPrettyPrinted ??= _dylib.lookupFunction< - _c_clang_getCursorPrettyPrinted, - _dart_clang_getCursorPrettyPrinted>('clang_getCursorPrettyPrinted'))( + return (_clang_getCursorPrettyPrinted ??= + _lookup>( + 'clang_getCursorPrettyPrinted') + .asFunction<_dart_clang_getCursorPrettyPrinted>())( Cursor, Policy, ); @@ -3163,9 +3302,10 @@ class LibClang { CXString clang_getCursorDisplayName( CXCursor arg0, ) { - return (_clang_getCursorDisplayName ??= _dylib.lookupFunction< - _c_clang_getCursorDisplayName, - _dart_clang_getCursorDisplayName>('clang_getCursorDisplayName'))( + return (_clang_getCursorDisplayName ??= + _lookup>( + 'clang_getCursorDisplayName') + .asFunction<_dart_clang_getCursorDisplayName>())( arg0, ); } @@ -3177,9 +3317,10 @@ class LibClang { CXCursor clang_getCursorReferenced( CXCursor arg0, ) { - return (_clang_getCursorReferenced ??= _dylib.lookupFunction< - _c_clang_getCursorReferenced, - _dart_clang_getCursorReferenced>('clang_getCursorReferenced'))( + return (_clang_getCursorReferenced ??= + _lookup>( + 'clang_getCursorReferenced') + .asFunction<_dart_clang_getCursorReferenced>())( arg0, ); } @@ -3191,9 +3332,10 @@ class LibClang { CXCursor clang_getCursorDefinition( CXCursor arg0, ) { - return (_clang_getCursorDefinition ??= _dylib.lookupFunction< - _c_clang_getCursorDefinition, - _dart_clang_getCursorDefinition>('clang_getCursorDefinition'))( + return (_clang_getCursorDefinition ??= + _lookup>( + 'clang_getCursorDefinition') + .asFunction<_dart_clang_getCursorDefinition>())( arg0, ); } @@ -3205,9 +3347,10 @@ class LibClang { int clang_isCursorDefinition( CXCursor arg0, ) { - return (_clang_isCursorDefinition ??= _dylib.lookupFunction< - _c_clang_isCursorDefinition, - _dart_clang_isCursorDefinition>('clang_isCursorDefinition'))( + return (_clang_isCursorDefinition ??= + _lookup>( + 'clang_isCursorDefinition') + .asFunction<_dart_clang_isCursorDefinition>())( arg0, ); } @@ -3218,9 +3361,10 @@ class LibClang { CXCursor clang_getCanonicalCursor( CXCursor arg0, ) { - return (_clang_getCanonicalCursor ??= _dylib.lookupFunction< - _c_clang_getCanonicalCursor, - _dart_clang_getCanonicalCursor>('clang_getCanonicalCursor'))( + return (_clang_getCanonicalCursor ??= + _lookup>( + 'clang_getCanonicalCursor') + .asFunction<_dart_clang_getCanonicalCursor>())( arg0, ); } @@ -3232,10 +3376,10 @@ class LibClang { int clang_Cursor_getObjCSelectorIndex( CXCursor arg0, ) { - return (_clang_Cursor_getObjCSelectorIndex ??= _dylib.lookupFunction< - _c_clang_Cursor_getObjCSelectorIndex, - _dart_clang_Cursor_getObjCSelectorIndex>( - 'clang_Cursor_getObjCSelectorIndex'))( + return (_clang_Cursor_getObjCSelectorIndex ??= + _lookup>( + 'clang_Cursor_getObjCSelectorIndex') + .asFunction<_dart_clang_Cursor_getObjCSelectorIndex>())( arg0, ); } @@ -3247,9 +3391,10 @@ class LibClang { int clang_Cursor_isDynamicCall( CXCursor C, ) { - return (_clang_Cursor_isDynamicCall ??= _dylib.lookupFunction< - _c_clang_Cursor_isDynamicCall, - _dart_clang_Cursor_isDynamicCall>('clang_Cursor_isDynamicCall'))( + return (_clang_Cursor_isDynamicCall ??= + _lookup>( + 'clang_Cursor_isDynamicCall') + .asFunction<_dart_clang_Cursor_isDynamicCall>())( C, ); } @@ -3261,9 +3406,10 @@ class LibClang { CXType clang_Cursor_getReceiverType( CXCursor C, ) { - return (_clang_Cursor_getReceiverType ??= _dylib.lookupFunction< - _c_clang_Cursor_getReceiverType, - _dart_clang_Cursor_getReceiverType>('clang_Cursor_getReceiverType'))( + return (_clang_Cursor_getReceiverType ??= + _lookup>( + 'clang_Cursor_getReceiverType') + .asFunction<_dart_clang_Cursor_getReceiverType>())( C, ); } @@ -3277,10 +3423,10 @@ class LibClang { CXCursor C, int reserved, ) { - return (_clang_Cursor_getObjCPropertyAttributes ??= _dylib.lookupFunction< - _c_clang_Cursor_getObjCPropertyAttributes, - _dart_clang_Cursor_getObjCPropertyAttributes>( - 'clang_Cursor_getObjCPropertyAttributes'))( + return (_clang_Cursor_getObjCPropertyAttributes ??= + _lookup>( + 'clang_Cursor_getObjCPropertyAttributes') + .asFunction<_dart_clang_Cursor_getObjCPropertyAttributes>())( C, reserved, ); @@ -3294,10 +3440,10 @@ class LibClang { CXString clang_Cursor_getObjCPropertyGetterName( CXCursor C, ) { - return (_clang_Cursor_getObjCPropertyGetterName ??= _dylib.lookupFunction< - _c_clang_Cursor_getObjCPropertyGetterName, - _dart_clang_Cursor_getObjCPropertyGetterName>( - 'clang_Cursor_getObjCPropertyGetterName'))( + return (_clang_Cursor_getObjCPropertyGetterName ??= + _lookup>( + 'clang_Cursor_getObjCPropertyGetterName') + .asFunction<_dart_clang_Cursor_getObjCPropertyGetterName>())( C, ); } @@ -3310,10 +3456,10 @@ class LibClang { CXString clang_Cursor_getObjCPropertySetterName( CXCursor C, ) { - return (_clang_Cursor_getObjCPropertySetterName ??= _dylib.lookupFunction< - _c_clang_Cursor_getObjCPropertySetterName, - _dart_clang_Cursor_getObjCPropertySetterName>( - 'clang_Cursor_getObjCPropertySetterName'))( + return (_clang_Cursor_getObjCPropertySetterName ??= + _lookup>( + 'clang_Cursor_getObjCPropertySetterName') + .asFunction<_dart_clang_Cursor_getObjCPropertySetterName>())( C, ); } @@ -3328,10 +3474,10 @@ class LibClang { int clang_Cursor_getObjCDeclQualifiers( CXCursor C, ) { - return (_clang_Cursor_getObjCDeclQualifiers ??= _dylib.lookupFunction< - _c_clang_Cursor_getObjCDeclQualifiers, - _dart_clang_Cursor_getObjCDeclQualifiers>( - 'clang_Cursor_getObjCDeclQualifiers'))( + return (_clang_Cursor_getObjCDeclQualifiers ??= + _lookup>( + 'clang_Cursor_getObjCDeclQualifiers') + .asFunction<_dart_clang_Cursor_getObjCDeclQualifiers>())( C, ); } @@ -3345,9 +3491,10 @@ class LibClang { int clang_Cursor_isObjCOptional( CXCursor C, ) { - return (_clang_Cursor_isObjCOptional ??= _dylib.lookupFunction< - _c_clang_Cursor_isObjCOptional, - _dart_clang_Cursor_isObjCOptional>('clang_Cursor_isObjCOptional'))( + return (_clang_Cursor_isObjCOptional ??= + _lookup>( + 'clang_Cursor_isObjCOptional') + .asFunction<_dart_clang_Cursor_isObjCOptional>())( C, ); } @@ -3358,9 +3505,10 @@ class LibClang { int clang_Cursor_isVariadic( CXCursor C, ) { - return (_clang_Cursor_isVariadic ??= _dylib.lookupFunction< - _c_clang_Cursor_isVariadic, - _dart_clang_Cursor_isVariadic>('clang_Cursor_isVariadic'))( + return (_clang_Cursor_isVariadic ??= + _lookup>( + 'clang_Cursor_isVariadic') + .asFunction<_dart_clang_Cursor_isVariadic>())( C, ); } @@ -3375,9 +3523,10 @@ class LibClang { ffi.Pointer definedIn, ffi.Pointer isGenerated, ) { - return (_clang_Cursor_isExternalSymbol ??= _dylib.lookupFunction< - _c_clang_Cursor_isExternalSymbol, - _dart_clang_Cursor_isExternalSymbol>('clang_Cursor_isExternalSymbol'))( + return (_clang_Cursor_isExternalSymbol ??= + _lookup>( + 'clang_Cursor_isExternalSymbol') + .asFunction<_dart_clang_Cursor_isExternalSymbol>())( C, language, definedIn, @@ -3393,9 +3542,10 @@ class LibClang { CXSourceRange clang_Cursor_getCommentRange( CXCursor C, ) { - return (_clang_Cursor_getCommentRange ??= _dylib.lookupFunction< - _c_clang_Cursor_getCommentRange, - _dart_clang_Cursor_getCommentRange>('clang_Cursor_getCommentRange'))( + return (_clang_Cursor_getCommentRange ??= + _lookup>( + 'clang_Cursor_getCommentRange') + .asFunction<_dart_clang_Cursor_getCommentRange>())( C, ); } @@ -3407,10 +3557,10 @@ class LibClang { CXString clang_Cursor_getRawCommentText( CXCursor C, ) { - return (_clang_Cursor_getRawCommentText ??= _dylib.lookupFunction< - _c_clang_Cursor_getRawCommentText, - _dart_clang_Cursor_getRawCommentText>( - 'clang_Cursor_getRawCommentText'))( + return (_clang_Cursor_getRawCommentText ??= + _lookup>( + 'clang_Cursor_getRawCommentText') + .asFunction<_dart_clang_Cursor_getRawCommentText>())( C, ); } @@ -3422,10 +3572,10 @@ class LibClang { CXString clang_Cursor_getBriefCommentText( CXCursor C, ) { - return (_clang_Cursor_getBriefCommentText ??= _dylib.lookupFunction< - _c_clang_Cursor_getBriefCommentText, - _dart_clang_Cursor_getBriefCommentText>( - 'clang_Cursor_getBriefCommentText'))( + return (_clang_Cursor_getBriefCommentText ??= + _lookup>( + 'clang_Cursor_getBriefCommentText') + .asFunction<_dart_clang_Cursor_getBriefCommentText>())( C, ); } @@ -3436,9 +3586,10 @@ class LibClang { CXString clang_Cursor_getMangling( CXCursor arg0, ) { - return (_clang_Cursor_getMangling ??= _dylib.lookupFunction< - _c_clang_Cursor_getMangling, - _dart_clang_Cursor_getMangling>('clang_Cursor_getMangling'))( + return (_clang_Cursor_getMangling ??= + _lookup>( + 'clang_Cursor_getMangling') + .asFunction<_dart_clang_Cursor_getMangling>())( arg0, ); } @@ -3450,9 +3601,10 @@ class LibClang { ffi.Pointer clang_Cursor_getCXXManglings( CXCursor arg0, ) { - return (_clang_Cursor_getCXXManglings ??= _dylib.lookupFunction< - _c_clang_Cursor_getCXXManglings, - _dart_clang_Cursor_getCXXManglings>('clang_Cursor_getCXXManglings'))( + return (_clang_Cursor_getCXXManglings ??= + _lookup>( + 'clang_Cursor_getCXXManglings') + .asFunction<_dart_clang_Cursor_getCXXManglings>())( arg0, ); } @@ -3464,9 +3616,10 @@ class LibClang { ffi.Pointer clang_Cursor_getObjCManglings( CXCursor arg0, ) { - return (_clang_Cursor_getObjCManglings ??= _dylib.lookupFunction< - _c_clang_Cursor_getObjCManglings, - _dart_clang_Cursor_getObjCManglings>('clang_Cursor_getObjCManglings'))( + return (_clang_Cursor_getObjCManglings ??= + _lookup>( + 'clang_Cursor_getObjCManglings') + .asFunction<_dart_clang_Cursor_getObjCManglings>())( arg0, ); } @@ -3477,9 +3630,10 @@ class LibClang { ffi.Pointer clang_Cursor_getModule( CXCursor C, ) { - return (_clang_Cursor_getModule ??= _dylib.lookupFunction< - _c_clang_Cursor_getModule, - _dart_clang_Cursor_getModule>('clang_Cursor_getModule'))( + return (_clang_Cursor_getModule ??= + _lookup>( + 'clang_Cursor_getModule') + .asFunction<_dart_clang_Cursor_getModule>())( C, ); } @@ -3492,9 +3646,10 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer arg1, ) { - return (_clang_getModuleForFile ??= _dylib.lookupFunction< - _c_clang_getModuleForFile, - _dart_clang_getModuleForFile>('clang_getModuleForFile'))( + return (_clang_getModuleForFile ??= + _lookup>( + 'clang_getModuleForFile') + .asFunction<_dart_clang_getModuleForFile>())( arg0, arg1, ); @@ -3506,9 +3661,10 @@ class LibClang { 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'))( + return (_clang_Module_getASTFile ??= + _lookup>( + 'clang_Module_getASTFile') + .asFunction<_dart_clang_Module_getASTFile>())( Module, ); } @@ -3520,9 +3676,10 @@ class LibClang { 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'))( + return (_clang_Module_getParent ??= + _lookup>( + 'clang_Module_getParent') + .asFunction<_dart_clang_Module_getParent>())( Module, ); } @@ -3534,9 +3691,10 @@ class LibClang { CXString clang_Module_getName( ffi.Pointer Module, ) { - return (_clang_Module_getName ??= _dylib.lookupFunction< - _c_clang_Module_getName, - _dart_clang_Module_getName>('clang_Module_getName'))( + return (_clang_Module_getName ??= + _lookup>( + 'clang_Module_getName') + .asFunction<_dart_clang_Module_getName>())( Module, ); } @@ -3547,9 +3705,10 @@ class LibClang { CXString clang_Module_getFullName( ffi.Pointer Module, ) { - return (_clang_Module_getFullName ??= _dylib.lookupFunction< - _c_clang_Module_getFullName, - _dart_clang_Module_getFullName>('clang_Module_getFullName'))( + return (_clang_Module_getFullName ??= + _lookup>( + 'clang_Module_getFullName') + .asFunction<_dart_clang_Module_getFullName>())( Module, ); } @@ -3560,9 +3719,10 @@ class LibClang { int clang_Module_isSystem( ffi.Pointer Module, ) { - return (_clang_Module_isSystem ??= _dylib.lookupFunction< - _c_clang_Module_isSystem, - _dart_clang_Module_isSystem>('clang_Module_isSystem'))( + return (_clang_Module_isSystem ??= + _lookup>( + 'clang_Module_isSystem') + .asFunction<_dart_clang_Module_isSystem>())( Module, ); } @@ -3574,10 +3734,10 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer Module, ) { - return (_clang_Module_getNumTopLevelHeaders ??= _dylib.lookupFunction< - _c_clang_Module_getNumTopLevelHeaders, - _dart_clang_Module_getNumTopLevelHeaders>( - 'clang_Module_getNumTopLevelHeaders'))( + return (_clang_Module_getNumTopLevelHeaders ??= + _lookup>( + 'clang_Module_getNumTopLevelHeaders') + .asFunction<_dart_clang_Module_getNumTopLevelHeaders>())( arg0, Module, ); @@ -3591,10 +3751,10 @@ class LibClang { ffi.Pointer Module, int Index, ) { - return (_clang_Module_getTopLevelHeader ??= _dylib.lookupFunction< - _c_clang_Module_getTopLevelHeader, - _dart_clang_Module_getTopLevelHeader>( - 'clang_Module_getTopLevelHeader'))( + return (_clang_Module_getTopLevelHeader ??= + _lookup>( + 'clang_Module_getTopLevelHeader') + .asFunction<_dart_clang_Module_getTopLevelHeader>())( arg0, Module, Index, @@ -3607,10 +3767,11 @@ class LibClang { int clang_CXXConstructor_isConvertingConstructor( CXCursor C, ) { - return (_clang_CXXConstructor_isConvertingConstructor ??= - _dylib.lookupFunction<_c_clang_CXXConstructor_isConvertingConstructor, - _dart_clang_CXXConstructor_isConvertingConstructor>( - 'clang_CXXConstructor_isConvertingConstructor'))( + return (_clang_CXXConstructor_isConvertingConstructor ??= _lookup< + ffi.NativeFunction< + _c_clang_CXXConstructor_isConvertingConstructor>>( + 'clang_CXXConstructor_isConvertingConstructor') + .asFunction<_dart_clang_CXXConstructor_isConvertingConstructor>())( C, ); } @@ -3622,10 +3783,10 @@ class LibClang { int clang_CXXConstructor_isCopyConstructor( CXCursor C, ) { - return (_clang_CXXConstructor_isCopyConstructor ??= _dylib.lookupFunction< - _c_clang_CXXConstructor_isCopyConstructor, - _dart_clang_CXXConstructor_isCopyConstructor>( - 'clang_CXXConstructor_isCopyConstructor'))( + return (_clang_CXXConstructor_isCopyConstructor ??= + _lookup>( + 'clang_CXXConstructor_isCopyConstructor') + .asFunction<_dart_clang_CXXConstructor_isCopyConstructor>())( C, ); } @@ -3637,10 +3798,11 @@ class LibClang { int clang_CXXConstructor_isDefaultConstructor( CXCursor C, ) { - return (_clang_CXXConstructor_isDefaultConstructor ??= - _dylib.lookupFunction<_c_clang_CXXConstructor_isDefaultConstructor, - _dart_clang_CXXConstructor_isDefaultConstructor>( - 'clang_CXXConstructor_isDefaultConstructor'))( + return (_clang_CXXConstructor_isDefaultConstructor ??= _lookup< + ffi.NativeFunction< + _c_clang_CXXConstructor_isDefaultConstructor>>( + 'clang_CXXConstructor_isDefaultConstructor') + .asFunction<_dart_clang_CXXConstructor_isDefaultConstructor>())( C, ); } @@ -3652,10 +3814,10 @@ class LibClang { int clang_CXXConstructor_isMoveConstructor( CXCursor C, ) { - return (_clang_CXXConstructor_isMoveConstructor ??= _dylib.lookupFunction< - _c_clang_CXXConstructor_isMoveConstructor, - _dart_clang_CXXConstructor_isMoveConstructor>( - 'clang_CXXConstructor_isMoveConstructor'))( + return (_clang_CXXConstructor_isMoveConstructor ??= + _lookup>( + 'clang_CXXConstructor_isMoveConstructor') + .asFunction<_dart_clang_CXXConstructor_isMoveConstructor>())( C, ); } @@ -3667,9 +3829,10 @@ class LibClang { int clang_CXXField_isMutable( CXCursor C, ) { - return (_clang_CXXField_isMutable ??= _dylib.lookupFunction< - _c_clang_CXXField_isMutable, - _dart_clang_CXXField_isMutable>('clang_CXXField_isMutable'))( + return (_clang_CXXField_isMutable ??= + _lookup>( + 'clang_CXXField_isMutable') + .asFunction<_dart_clang_CXXField_isMutable>())( C, ); } @@ -3680,9 +3843,10 @@ class LibClang { int clang_CXXMethod_isDefaulted( CXCursor C, ) { - return (_clang_CXXMethod_isDefaulted ??= _dylib.lookupFunction< - _c_clang_CXXMethod_isDefaulted, - _dart_clang_CXXMethod_isDefaulted>('clang_CXXMethod_isDefaulted'))( + return (_clang_CXXMethod_isDefaulted ??= + _lookup>( + 'clang_CXXMethod_isDefaulted') + .asFunction<_dart_clang_CXXMethod_isDefaulted>())( C, ); } @@ -3694,9 +3858,10 @@ class LibClang { int clang_CXXMethod_isPureVirtual( CXCursor C, ) { - return (_clang_CXXMethod_isPureVirtual ??= _dylib.lookupFunction< - _c_clang_CXXMethod_isPureVirtual, - _dart_clang_CXXMethod_isPureVirtual>('clang_CXXMethod_isPureVirtual'))( + return (_clang_CXXMethod_isPureVirtual ??= + _lookup>( + 'clang_CXXMethod_isPureVirtual') + .asFunction<_dart_clang_CXXMethod_isPureVirtual>())( C, ); } @@ -3708,9 +3873,10 @@ class LibClang { int clang_CXXMethod_isStatic( CXCursor C, ) { - return (_clang_CXXMethod_isStatic ??= _dylib.lookupFunction< - _c_clang_CXXMethod_isStatic, - _dart_clang_CXXMethod_isStatic>('clang_CXXMethod_isStatic'))( + return (_clang_CXXMethod_isStatic ??= + _lookup>( + 'clang_CXXMethod_isStatic') + .asFunction<_dart_clang_CXXMethod_isStatic>())( C, ); } @@ -3723,9 +3889,10 @@ class LibClang { int clang_CXXMethod_isVirtual( CXCursor C, ) { - return (_clang_CXXMethod_isVirtual ??= _dylib.lookupFunction< - _c_clang_CXXMethod_isVirtual, - _dart_clang_CXXMethod_isVirtual>('clang_CXXMethod_isVirtual'))( + return (_clang_CXXMethod_isVirtual ??= + _lookup>( + 'clang_CXXMethod_isVirtual') + .asFunction<_dart_clang_CXXMethod_isVirtual>())( C, ); } @@ -3737,9 +3904,10 @@ class LibClang { int clang_CXXRecord_isAbstract( CXCursor C, ) { - return (_clang_CXXRecord_isAbstract ??= _dylib.lookupFunction< - _c_clang_CXXRecord_isAbstract, - _dart_clang_CXXRecord_isAbstract>('clang_CXXRecord_isAbstract'))( + return (_clang_CXXRecord_isAbstract ??= + _lookup>( + 'clang_CXXRecord_isAbstract') + .asFunction<_dart_clang_CXXRecord_isAbstract>())( C, ); } @@ -3750,9 +3918,10 @@ class LibClang { int clang_EnumDecl_isScoped( CXCursor C, ) { - return (_clang_EnumDecl_isScoped ??= _dylib.lookupFunction< - _c_clang_EnumDecl_isScoped, - _dart_clang_EnumDecl_isScoped>('clang_EnumDecl_isScoped'))( + return (_clang_EnumDecl_isScoped ??= + _lookup>( + 'clang_EnumDecl_isScoped') + .asFunction<_dart_clang_EnumDecl_isScoped>())( C, ); } @@ -3764,9 +3933,10 @@ class LibClang { int clang_CXXMethod_isConst( CXCursor C, ) { - return (_clang_CXXMethod_isConst ??= _dylib.lookupFunction< - _c_clang_CXXMethod_isConst, - _dart_clang_CXXMethod_isConst>('clang_CXXMethod_isConst'))( + return (_clang_CXXMethod_isConst ??= + _lookup>( + 'clang_CXXMethod_isConst') + .asFunction<_dart_clang_CXXMethod_isConst>())( C, ); } @@ -3778,9 +3948,10 @@ class LibClang { int clang_getTemplateCursorKind( CXCursor C, ) { - return (_clang_getTemplateCursorKind ??= _dylib.lookupFunction< - _c_clang_getTemplateCursorKind, - _dart_clang_getTemplateCursorKind>('clang_getTemplateCursorKind'))( + return (_clang_getTemplateCursorKind ??= + _lookup>( + 'clang_getTemplateCursorKind') + .asFunction<_dart_clang_getTemplateCursorKind>())( C, ); } @@ -3793,10 +3964,10 @@ class LibClang { CXCursor clang_getSpecializedCursorTemplate( CXCursor C, ) { - return (_clang_getSpecializedCursorTemplate ??= _dylib.lookupFunction< - _c_clang_getSpecializedCursorTemplate, - _dart_clang_getSpecializedCursorTemplate>( - 'clang_getSpecializedCursorTemplate'))( + return (_clang_getSpecializedCursorTemplate ??= + _lookup>( + 'clang_getSpecializedCursorTemplate') + .asFunction<_dart_clang_getSpecializedCursorTemplate>())( C, ); } @@ -3810,10 +3981,10 @@ class LibClang { int NameFlags, int PieceIndex, ) { - return (_clang_getCursorReferenceNameRange ??= _dylib.lookupFunction< - _c_clang_getCursorReferenceNameRange, - _dart_clang_getCursorReferenceNameRange>( - 'clang_getCursorReferenceNameRange'))( + return (_clang_getCursorReferenceNameRange ??= + _lookup>( + 'clang_getCursorReferenceNameRange') + .asFunction<_dart_clang_getCursorReferenceNameRange>())( C, NameFlags, PieceIndex, @@ -3828,8 +3999,8 @@ class LibClang { CXSourceLocation Location, ) { return (_clang_getToken ??= - _dylib.lookupFunction<_c_clang_getToken, _dart_clang_getToken>( - 'clang_getToken'))( + _lookup>('clang_getToken') + .asFunction<_dart_clang_getToken>())( TU, Location, ); @@ -3842,8 +4013,8 @@ class LibClang { CXToken arg0, ) { return (_clang_getTokenKind ??= - _dylib.lookupFunction<_c_clang_getTokenKind, _dart_clang_getTokenKind>( - 'clang_getTokenKind'))( + _lookup>('clang_getTokenKind') + .asFunction<_dart_clang_getTokenKind>())( arg0, ); } @@ -3855,9 +4026,10 @@ class LibClang { ffi.Pointer arg0, CXToken arg1, ) { - return (_clang_getTokenSpelling ??= _dylib.lookupFunction< - _c_clang_getTokenSpelling, - _dart_clang_getTokenSpelling>('clang_getTokenSpelling'))( + return (_clang_getTokenSpelling ??= + _lookup>( + 'clang_getTokenSpelling') + .asFunction<_dart_clang_getTokenSpelling>())( arg0, arg1, ); @@ -3870,9 +4042,10 @@ class LibClang { ffi.Pointer arg0, CXToken arg1, ) { - return (_clang_getTokenLocation ??= _dylib.lookupFunction< - _c_clang_getTokenLocation, - _dart_clang_getTokenLocation>('clang_getTokenLocation'))( + return (_clang_getTokenLocation ??= + _lookup>( + 'clang_getTokenLocation') + .asFunction<_dart_clang_getTokenLocation>())( arg0, arg1, ); @@ -3885,9 +4058,10 @@ class LibClang { ffi.Pointer arg0, CXToken arg1, ) { - return (_clang_getTokenExtent ??= _dylib.lookupFunction< - _c_clang_getTokenExtent, - _dart_clang_getTokenExtent>('clang_getTokenExtent'))( + return (_clang_getTokenExtent ??= + _lookup>( + 'clang_getTokenExtent') + .asFunction<_dart_clang_getTokenExtent>())( arg0, arg1, ); @@ -3904,8 +4078,8 @@ class LibClang { ffi.Pointer NumTokens, ) { return (_clang_tokenize ??= - _dylib.lookupFunction<_c_clang_tokenize, _dart_clang_tokenize>( - 'clang_tokenize'))( + _lookup>('clang_tokenize') + .asFunction<_dart_clang_tokenize>())( TU, Range, Tokens, @@ -3923,9 +4097,10 @@ class LibClang { int NumTokens, ffi.Pointer Cursors, ) { - return (_clang_annotateTokens ??= _dylib.lookupFunction< - _c_clang_annotateTokens, - _dart_clang_annotateTokens>('clang_annotateTokens'))( + return (_clang_annotateTokens ??= + _lookup>( + 'clang_annotateTokens') + .asFunction<_dart_clang_annotateTokens>())( TU, Tokens, NumTokens, @@ -3941,9 +4116,10 @@ class LibClang { ffi.Pointer Tokens, int NumTokens, ) { - return (_clang_disposeTokens ??= _dylib.lookupFunction< - _c_clang_disposeTokens, - _dart_clang_disposeTokens>('clang_disposeTokens'))( + return (_clang_disposeTokens ??= + _lookup>( + 'clang_disposeTokens') + .asFunction<_dart_clang_disposeTokens>())( TU, Tokens, NumTokens, @@ -3957,9 +4133,10 @@ class LibClang { CXString clang_getCursorKindSpelling( int Kind, ) { - return (_clang_getCursorKindSpelling ??= _dylib.lookupFunction< - _c_clang_getCursorKindSpelling, - _dart_clang_getCursorKindSpelling>('clang_getCursorKindSpelling'))( + return (_clang_getCursorKindSpelling ??= + _lookup>( + 'clang_getCursorKindSpelling') + .asFunction<_dart_clang_getCursorKindSpelling>())( Kind, ); } @@ -3975,10 +4152,10 @@ class LibClang { ffi.Pointer endLine, ffi.Pointer endColumn, ) { - return (_clang_getDefinitionSpellingAndExtent ??= _dylib.lookupFunction< - _c_clang_getDefinitionSpellingAndExtent, - _dart_clang_getDefinitionSpellingAndExtent>( - 'clang_getDefinitionSpellingAndExtent'))( + return (_clang_getDefinitionSpellingAndExtent ??= + _lookup>( + 'clang_getDefinitionSpellingAndExtent') + .asFunction<_dart_clang_getDefinitionSpellingAndExtent>())( arg0, startBuf, endBuf, @@ -3993,9 +4170,10 @@ class LibClang { _clang_getDefinitionSpellingAndExtent; void clang_enableStackTraces() { - return (_clang_enableStackTraces ??= _dylib.lookupFunction< - _c_clang_enableStackTraces, - _dart_clang_enableStackTraces>('clang_enableStackTraces'))(); + return (_clang_enableStackTraces ??= + _lookup>( + 'clang_enableStackTraces') + .asFunction<_dart_clang_enableStackTraces>())(); } _dart_clang_enableStackTraces? _clang_enableStackTraces; @@ -4005,9 +4183,10 @@ class LibClang { ffi.Pointer user_data, int stack_size, ) { - return (_clang_executeOnThread ??= _dylib.lookupFunction< - _c_clang_executeOnThread, - _dart_clang_executeOnThread>('clang_executeOnThread'))( + return (_clang_executeOnThread ??= + _lookup>( + 'clang_executeOnThread') + .asFunction<_dart_clang_executeOnThread>())( fn, user_data, stack_size, @@ -4021,9 +4200,10 @@ class LibClang { ffi.Pointer completion_string, int chunk_number, ) { - return (_clang_getCompletionChunkKind ??= _dylib.lookupFunction< - _c_clang_getCompletionChunkKind, - _dart_clang_getCompletionChunkKind>('clang_getCompletionChunkKind'))( + return (_clang_getCompletionChunkKind ??= + _lookup>( + 'clang_getCompletionChunkKind') + .asFunction<_dart_clang_getCompletionChunkKind>())( completion_string, chunk_number, ); @@ -4037,9 +4217,10 @@ class LibClang { ffi.Pointer completion_string, int chunk_number, ) { - return (_clang_getCompletionChunkText ??= _dylib.lookupFunction< - _c_clang_getCompletionChunkText, - _dart_clang_getCompletionChunkText>('clang_getCompletionChunkText'))( + return (_clang_getCompletionChunkText ??= + _lookup>( + 'clang_getCompletionChunkText') + .asFunction<_dart_clang_getCompletionChunkText>())( completion_string, chunk_number, ); @@ -4053,10 +4234,11 @@ class LibClang { ffi.Pointer completion_string, int chunk_number, ) { - return (_clang_getCompletionChunkCompletionString ??= _dylib.lookupFunction< - _c_clang_getCompletionChunkCompletionString, - _dart_clang_getCompletionChunkCompletionString>( - 'clang_getCompletionChunkCompletionString'))( + return (_clang_getCompletionChunkCompletionString ??= _lookup< + ffi.NativeFunction< + _c_clang_getCompletionChunkCompletionString>>( + 'clang_getCompletionChunkCompletionString') + .asFunction<_dart_clang_getCompletionChunkCompletionString>())( completion_string, chunk_number, ); @@ -4069,9 +4251,10 @@ class LibClang { int clang_getNumCompletionChunks( ffi.Pointer completion_string, ) { - return (_clang_getNumCompletionChunks ??= _dylib.lookupFunction< - _c_clang_getNumCompletionChunks, - _dart_clang_getNumCompletionChunks>('clang_getNumCompletionChunks'))( + return (_clang_getNumCompletionChunks ??= + _lookup>( + 'clang_getNumCompletionChunks') + .asFunction<_dart_clang_getNumCompletionChunks>())( completion_string, ); } @@ -4082,9 +4265,10 @@ class LibClang { int clang_getCompletionPriority( ffi.Pointer completion_string, ) { - return (_clang_getCompletionPriority ??= _dylib.lookupFunction< - _c_clang_getCompletionPriority, - _dart_clang_getCompletionPriority>('clang_getCompletionPriority'))( + return (_clang_getCompletionPriority ??= + _lookup>( + 'clang_getCompletionPriority') + .asFunction<_dart_clang_getCompletionPriority>())( completion_string, ); } @@ -4096,10 +4280,10 @@ class LibClang { int clang_getCompletionAvailability( ffi.Pointer completion_string, ) { - return (_clang_getCompletionAvailability ??= _dylib.lookupFunction< - _c_clang_getCompletionAvailability, - _dart_clang_getCompletionAvailability>( - 'clang_getCompletionAvailability'))( + return (_clang_getCompletionAvailability ??= + _lookup>( + 'clang_getCompletionAvailability') + .asFunction<_dart_clang_getCompletionAvailability>())( completion_string, ); } @@ -4111,10 +4295,10 @@ class LibClang { int clang_getCompletionNumAnnotations( ffi.Pointer completion_string, ) { - return (_clang_getCompletionNumAnnotations ??= _dylib.lookupFunction< - _c_clang_getCompletionNumAnnotations, - _dart_clang_getCompletionNumAnnotations>( - 'clang_getCompletionNumAnnotations'))( + return (_clang_getCompletionNumAnnotations ??= + _lookup>( + 'clang_getCompletionNumAnnotations') + .asFunction<_dart_clang_getCompletionNumAnnotations>())( completion_string, ); } @@ -4126,9 +4310,10 @@ class LibClang { ffi.Pointer completion_string, int annotation_number, ) { - return (_clang_getCompletionAnnotation ??= _dylib.lookupFunction< - _c_clang_getCompletionAnnotation, - _dart_clang_getCompletionAnnotation>('clang_getCompletionAnnotation'))( + return (_clang_getCompletionAnnotation ??= + _lookup>( + 'clang_getCompletionAnnotation') + .asFunction<_dart_clang_getCompletionAnnotation>())( completion_string, annotation_number, ); @@ -4141,9 +4326,10 @@ class LibClang { ffi.Pointer completion_string, ffi.Pointer kind, ) { - return (_clang_getCompletionParent ??= _dylib.lookupFunction< - _c_clang_getCompletionParent, - _dart_clang_getCompletionParent>('clang_getCompletionParent'))( + return (_clang_getCompletionParent ??= + _lookup>( + 'clang_getCompletionParent') + .asFunction<_dart_clang_getCompletionParent>())( completion_string, kind, ); @@ -4156,10 +4342,10 @@ class LibClang { CXString clang_getCompletionBriefComment( ffi.Pointer completion_string, ) { - return (_clang_getCompletionBriefComment ??= _dylib.lookupFunction< - _c_clang_getCompletionBriefComment, - _dart_clang_getCompletionBriefComment>( - 'clang_getCompletionBriefComment'))( + return (_clang_getCompletionBriefComment ??= + _lookup>( + 'clang_getCompletionBriefComment') + .asFunction<_dart_clang_getCompletionBriefComment>())( completion_string, ); } @@ -4171,10 +4357,10 @@ class LibClang { ffi.Pointer clang_getCursorCompletionString( CXCursor cursor, ) { - return (_clang_getCursorCompletionString ??= _dylib.lookupFunction< - _c_clang_getCursorCompletionString, - _dart_clang_getCursorCompletionString>( - 'clang_getCursorCompletionString'))( + return (_clang_getCursorCompletionString ??= + _lookup>( + 'clang_getCursorCompletionString') + .asFunction<_dart_clang_getCursorCompletionString>())( cursor, ); } @@ -4186,9 +4372,10 @@ class LibClang { ffi.Pointer results, int completion_index, ) { - return (_clang_getCompletionNumFixIts ??= _dylib.lookupFunction< - _c_clang_getCompletionNumFixIts, - _dart_clang_getCompletionNumFixIts>('clang_getCompletionNumFixIts'))( + return (_clang_getCompletionNumFixIts ??= + _lookup>( + 'clang_getCompletionNumFixIts') + .asFunction<_dart_clang_getCompletionNumFixIts>())( results, completion_index, ); @@ -4204,9 +4391,10 @@ class LibClang { int fixit_index, ffi.Pointer replacement_range, ) { - return (_clang_getCompletionFixIt ??= _dylib.lookupFunction< - _c_clang_getCompletionFixIt, - _dart_clang_getCompletionFixIt>('clang_getCompletionFixIt'))( + return (_clang_getCompletionFixIt ??= + _lookup>( + 'clang_getCompletionFixIt') + .asFunction<_dart_clang_getCompletionFixIt>())( results, completion_index, fixit_index, @@ -4219,10 +4407,10 @@ class LibClang { /// 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'))(); + return (_clang_defaultCodeCompleteOptions ??= + _lookup>( + 'clang_defaultCodeCompleteOptions') + .asFunction<_dart_clang_defaultCodeCompleteOptions>())(); } _dart_clang_defaultCodeCompleteOptions? _clang_defaultCodeCompleteOptions; @@ -4237,9 +4425,10 @@ class LibClang { int num_unsaved_files, int options, ) { - return (_clang_codeCompleteAt ??= _dylib.lookupFunction< - _c_clang_codeCompleteAt, - _dart_clang_codeCompleteAt>('clang_codeCompleteAt'))( + return (_clang_codeCompleteAt ??= + _lookup>( + 'clang_codeCompleteAt') + .asFunction<_dart_clang_codeCompleteAt>())( TU, complete_filename, complete_line, @@ -4257,10 +4446,10 @@ class LibClang { ffi.Pointer Results, int NumResults, ) { - return (_clang_sortCodeCompletionResults ??= _dylib.lookupFunction< - _c_clang_sortCodeCompletionResults, - _dart_clang_sortCodeCompletionResults>( - 'clang_sortCodeCompletionResults'))( + return (_clang_sortCodeCompletionResults ??= + _lookup>( + 'clang_sortCodeCompletionResults') + .asFunction<_dart_clang_sortCodeCompletionResults>())( Results, NumResults, ); @@ -4272,10 +4461,10 @@ class LibClang { void clang_disposeCodeCompleteResults( ffi.Pointer Results, ) { - return (_clang_disposeCodeCompleteResults ??= _dylib.lookupFunction< - _c_clang_disposeCodeCompleteResults, - _dart_clang_disposeCodeCompleteResults>( - 'clang_disposeCodeCompleteResults'))( + return (_clang_disposeCodeCompleteResults ??= + _lookup>( + 'clang_disposeCodeCompleteResults') + .asFunction<_dart_clang_disposeCodeCompleteResults>())( Results, ); } @@ -4287,10 +4476,10 @@ class LibClang { int clang_codeCompleteGetNumDiagnostics( ffi.Pointer Results, ) { - return (_clang_codeCompleteGetNumDiagnostics ??= _dylib.lookupFunction< - _c_clang_codeCompleteGetNumDiagnostics, - _dart_clang_codeCompleteGetNumDiagnostics>( - 'clang_codeCompleteGetNumDiagnostics'))( + return (_clang_codeCompleteGetNumDiagnostics ??= + _lookup>( + 'clang_codeCompleteGetNumDiagnostics') + .asFunction<_dart_clang_codeCompleteGetNumDiagnostics>())( Results, ); } @@ -4303,10 +4492,10 @@ class LibClang { ffi.Pointer Results, int Index, ) { - return (_clang_codeCompleteGetDiagnostic ??= _dylib.lookupFunction< - _c_clang_codeCompleteGetDiagnostic, - _dart_clang_codeCompleteGetDiagnostic>( - 'clang_codeCompleteGetDiagnostic'))( + return (_clang_codeCompleteGetDiagnostic ??= + _lookup>( + 'clang_codeCompleteGetDiagnostic') + .asFunction<_dart_clang_codeCompleteGetDiagnostic>())( Results, Index, ); @@ -4319,9 +4508,10 @@ class LibClang { int clang_codeCompleteGetContexts( ffi.Pointer Results, ) { - return (_clang_codeCompleteGetContexts ??= _dylib.lookupFunction< - _c_clang_codeCompleteGetContexts, - _dart_clang_codeCompleteGetContexts>('clang_codeCompleteGetContexts'))( + return (_clang_codeCompleteGetContexts ??= + _lookup>( + 'clang_codeCompleteGetContexts') + .asFunction<_dart_clang_codeCompleteGetContexts>())( Results, ); } @@ -4336,10 +4526,10 @@ class LibClang { ffi.Pointer Results, ffi.Pointer IsIncomplete, ) { - return (_clang_codeCompleteGetContainerKind ??= _dylib.lookupFunction< - _c_clang_codeCompleteGetContainerKind, - _dart_clang_codeCompleteGetContainerKind>( - 'clang_codeCompleteGetContainerKind'))( + return (_clang_codeCompleteGetContainerKind ??= + _lookup>( + 'clang_codeCompleteGetContainerKind') + .asFunction<_dart_clang_codeCompleteGetContainerKind>())( Results, IsIncomplete, ); @@ -4353,10 +4543,10 @@ class LibClang { CXString clang_codeCompleteGetContainerUSR( ffi.Pointer Results, ) { - return (_clang_codeCompleteGetContainerUSR ??= _dylib.lookupFunction< - _c_clang_codeCompleteGetContainerUSR, - _dart_clang_codeCompleteGetContainerUSR>( - 'clang_codeCompleteGetContainerUSR'))( + return (_clang_codeCompleteGetContainerUSR ??= + _lookup>( + 'clang_codeCompleteGetContainerUSR') + .asFunction<_dart_clang_codeCompleteGetContainerUSR>())( Results, ); } @@ -4370,10 +4560,10 @@ class LibClang { CXString clang_codeCompleteGetObjCSelector( ffi.Pointer Results, ) { - return (_clang_codeCompleteGetObjCSelector ??= _dylib.lookupFunction< - _c_clang_codeCompleteGetObjCSelector, - _dart_clang_codeCompleteGetObjCSelector>( - 'clang_codeCompleteGetObjCSelector'))( + return (_clang_codeCompleteGetObjCSelector ??= + _lookup>( + 'clang_codeCompleteGetObjCSelector') + .asFunction<_dart_clang_codeCompleteGetObjCSelector>())( Results, ); } @@ -4383,9 +4573,10 @@ class LibClang { /// 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'))(); + return (_clang_getClangVersion ??= + _lookup>( + 'clang_getClangVersion') + .asFunction<_dart_clang_getClangVersion>())(); } _dart_clang_getClangVersion? _clang_getClangVersion; @@ -4394,9 +4585,10 @@ class LibClang { void clang_toggleCrashRecovery( int isEnabled, ) { - return (_clang_toggleCrashRecovery ??= _dylib.lookupFunction< - _c_clang_toggleCrashRecovery, - _dart_clang_toggleCrashRecovery>('clang_toggleCrashRecovery'))( + return (_clang_toggleCrashRecovery ??= + _lookup>( + 'clang_toggleCrashRecovery') + .asFunction<_dart_clang_toggleCrashRecovery>())( isEnabled, ); } @@ -4412,9 +4604,10 @@ class LibClang { ffi.Pointer> visitor, ffi.Pointer client_data, ) { - return (_clang_getInclusions ??= _dylib.lookupFunction< - _c_clang_getInclusions, - _dart_clang_getInclusions>('clang_getInclusions'))( + return (_clang_getInclusions ??= + _lookup>( + 'clang_getInclusions') + .asFunction<_dart_clang_getInclusions>())( tu, visitor, client_data, @@ -4429,9 +4622,10 @@ class LibClang { ffi.Pointer clang_Cursor_Evaluate( CXCursor C, ) { - return (_clang_Cursor_Evaluate ??= _dylib.lookupFunction< - _c_clang_Cursor_Evaluate, - _dart_clang_Cursor_Evaluate>('clang_Cursor_Evaluate'))( + return (_clang_Cursor_Evaluate ??= + _lookup>( + 'clang_Cursor_Evaluate') + .asFunction<_dart_clang_Cursor_Evaluate>())( C, ); } @@ -4442,9 +4636,10 @@ class LibClang { int clang_EvalResult_getKind( ffi.Pointer E, ) { - return (_clang_EvalResult_getKind ??= _dylib.lookupFunction< - _c_clang_EvalResult_getKind, - _dart_clang_EvalResult_getKind>('clang_EvalResult_getKind'))( + return (_clang_EvalResult_getKind ??= + _lookup>( + 'clang_EvalResult_getKind') + .asFunction<_dart_clang_EvalResult_getKind>())( E, ); } @@ -4455,9 +4650,10 @@ class LibClang { int clang_EvalResult_getAsInt( ffi.Pointer E, ) { - return (_clang_EvalResult_getAsInt ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsInt, - _dart_clang_EvalResult_getAsInt>('clang_EvalResult_getAsInt'))( + return (_clang_EvalResult_getAsInt ??= + _lookup>( + 'clang_EvalResult_getAsInt') + .asFunction<_dart_clang_EvalResult_getAsInt>())( E, ); } @@ -4470,10 +4666,10 @@ class LibClang { int clang_EvalResult_getAsLongLong( ffi.Pointer E, ) { - return (_clang_EvalResult_getAsLongLong ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsLongLong, - _dart_clang_EvalResult_getAsLongLong>( - 'clang_EvalResult_getAsLongLong'))( + return (_clang_EvalResult_getAsLongLong ??= + _lookup>( + 'clang_EvalResult_getAsLongLong') + .asFunction<_dart_clang_EvalResult_getAsLongLong>())( E, ); } @@ -4485,10 +4681,10 @@ class LibClang { int clang_EvalResult_isUnsignedInt( ffi.Pointer E, ) { - return (_clang_EvalResult_isUnsignedInt ??= _dylib.lookupFunction< - _c_clang_EvalResult_isUnsignedInt, - _dart_clang_EvalResult_isUnsignedInt>( - 'clang_EvalResult_isUnsignedInt'))( + return (_clang_EvalResult_isUnsignedInt ??= + _lookup>( + 'clang_EvalResult_isUnsignedInt') + .asFunction<_dart_clang_EvalResult_isUnsignedInt>())( E, ); } @@ -4500,10 +4696,10 @@ class LibClang { int clang_EvalResult_getAsUnsigned( ffi.Pointer E, ) { - return (_clang_EvalResult_getAsUnsigned ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsUnsigned, - _dart_clang_EvalResult_getAsUnsigned>( - 'clang_EvalResult_getAsUnsigned'))( + return (_clang_EvalResult_getAsUnsigned ??= + _lookup>( + 'clang_EvalResult_getAsUnsigned') + .asFunction<_dart_clang_EvalResult_getAsUnsigned>())( E, ); } @@ -4514,9 +4710,10 @@ class LibClang { double clang_EvalResult_getAsDouble( ffi.Pointer E, ) { - return (_clang_EvalResult_getAsDouble ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsDouble, - _dart_clang_EvalResult_getAsDouble>('clang_EvalResult_getAsDouble'))( + return (_clang_EvalResult_getAsDouble ??= + _lookup>( + 'clang_EvalResult_getAsDouble') + .asFunction<_dart_clang_EvalResult_getAsDouble>())( E, ); } @@ -4530,9 +4727,10 @@ class LibClang { 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'))( + return (_clang_EvalResult_getAsStr ??= + _lookup>( + 'clang_EvalResult_getAsStr') + .asFunction<_dart_clang_EvalResult_getAsStr>())( E, ); } @@ -4543,9 +4741,10 @@ class LibClang { void clang_EvalResult_dispose( ffi.Pointer E, ) { - return (_clang_EvalResult_dispose ??= _dylib.lookupFunction< - _c_clang_EvalResult_dispose, - _dart_clang_EvalResult_dispose>('clang_EvalResult_dispose'))( + return (_clang_EvalResult_dispose ??= + _lookup>( + 'clang_EvalResult_dispose') + .asFunction<_dart_clang_EvalResult_dispose>())( E, ); } @@ -4556,9 +4755,10 @@ class LibClang { ffi.Pointer clang_getRemappings( ffi.Pointer path, ) { - return (_clang_getRemappings ??= _dylib.lookupFunction< - _c_clang_getRemappings, - _dart_clang_getRemappings>('clang_getRemappings'))( + return (_clang_getRemappings ??= + _lookup>( + 'clang_getRemappings') + .asFunction<_dart_clang_getRemappings>())( path, ); } @@ -4570,10 +4770,10 @@ class LibClang { ffi.Pointer> filePaths, int numFiles, ) { - return (_clang_getRemappingsFromFileList ??= _dylib.lookupFunction< - _c_clang_getRemappingsFromFileList, - _dart_clang_getRemappingsFromFileList>( - 'clang_getRemappingsFromFileList'))( + return (_clang_getRemappingsFromFileList ??= + _lookup>( + 'clang_getRemappingsFromFileList') + .asFunction<_dart_clang_getRemappingsFromFileList>())( filePaths, numFiles, ); @@ -4585,9 +4785,10 @@ class LibClang { int clang_remap_getNumFiles( ffi.Pointer arg0, ) { - return (_clang_remap_getNumFiles ??= _dylib.lookupFunction< - _c_clang_remap_getNumFiles, - _dart_clang_remap_getNumFiles>('clang_remap_getNumFiles'))( + return (_clang_remap_getNumFiles ??= + _lookup>( + 'clang_remap_getNumFiles') + .asFunction<_dart_clang_remap_getNumFiles>())( arg0, ); } @@ -4601,9 +4802,10 @@ class LibClang { ffi.Pointer original, ffi.Pointer transformed, ) { - return (_clang_remap_getFilenames ??= _dylib.lookupFunction< - _c_clang_remap_getFilenames, - _dart_clang_remap_getFilenames>('clang_remap_getFilenames'))( + return (_clang_remap_getFilenames ??= + _lookup>( + 'clang_remap_getFilenames') + .asFunction<_dart_clang_remap_getFilenames>())( arg0, index, original, @@ -4617,9 +4819,10 @@ class LibClang { void clang_remap_dispose( ffi.Pointer arg0, ) { - return (_clang_remap_dispose ??= _dylib.lookupFunction< - _c_clang_remap_dispose, - _dart_clang_remap_dispose>('clang_remap_dispose'))( + return (_clang_remap_dispose ??= + _lookup>( + 'clang_remap_dispose') + .asFunction<_dart_clang_remap_dispose>())( arg0, ); } @@ -4632,9 +4835,10 @@ class LibClang { ffi.Pointer file, CXCursorAndRangeVisitor visitor, ) { - return (_clang_findReferencesInFile ??= _dylib.lookupFunction< - _c_clang_findReferencesInFile, - _dart_clang_findReferencesInFile>('clang_findReferencesInFile'))( + return (_clang_findReferencesInFile ??= + _lookup>( + 'clang_findReferencesInFile') + .asFunction<_dart_clang_findReferencesInFile>())( cursor, file, visitor, @@ -4649,9 +4853,10 @@ class LibClang { ffi.Pointer file, CXCursorAndRangeVisitor visitor, ) { - return (_clang_findIncludesInFile ??= _dylib.lookupFunction< - _c_clang_findIncludesInFile, - _dart_clang_findIncludesInFile>('clang_findIncludesInFile'))( + return (_clang_findIncludesInFile ??= + _lookup>( + 'clang_findIncludesInFile') + .asFunction<_dart_clang_findIncludesInFile>())( TU, file, visitor, @@ -4663,10 +4868,10 @@ class LibClang { int clang_index_isEntityObjCContainerKind( int arg0, ) { - return (_clang_index_isEntityObjCContainerKind ??= _dylib.lookupFunction< - _c_clang_index_isEntityObjCContainerKind, - _dart_clang_index_isEntityObjCContainerKind>( - 'clang_index_isEntityObjCContainerKind'))( + return (_clang_index_isEntityObjCContainerKind ??= + _lookup>( + 'clang_index_isEntityObjCContainerKind') + .asFunction<_dart_clang_index_isEntityObjCContainerKind>())( arg0, ); } @@ -4677,10 +4882,10 @@ class LibClang { 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'))( + return (_clang_index_getObjCContainerDeclInfo ??= + _lookup>( + 'clang_index_getObjCContainerDeclInfo') + .asFunction<_dart_clang_index_getObjCContainerDeclInfo>())( arg0, ); } @@ -4691,10 +4896,10 @@ class LibClang { 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'))( + return (_clang_index_getObjCInterfaceDeclInfo ??= + _lookup>( + 'clang_index_getObjCInterfaceDeclInfo') + .asFunction<_dart_clang_index_getObjCInterfaceDeclInfo>())( arg0, ); } @@ -4705,10 +4910,10 @@ class LibClang { 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'))( + return (_clang_index_getObjCCategoryDeclInfo ??= + _lookup>( + 'clang_index_getObjCCategoryDeclInfo') + .asFunction<_dart_clang_index_getObjCCategoryDeclInfo>())( arg0, ); } @@ -4720,10 +4925,10 @@ class LibClang { clang_index_getObjCProtocolRefListInfo( ffi.Pointer arg0, ) { - return (_clang_index_getObjCProtocolRefListInfo ??= _dylib.lookupFunction< - _c_clang_index_getObjCProtocolRefListInfo, - _dart_clang_index_getObjCProtocolRefListInfo>( - 'clang_index_getObjCProtocolRefListInfo'))( + return (_clang_index_getObjCProtocolRefListInfo ??= + _lookup>( + 'clang_index_getObjCProtocolRefListInfo') + .asFunction<_dart_clang_index_getObjCProtocolRefListInfo>())( arg0, ); } @@ -4734,10 +4939,10 @@ class LibClang { 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'))( + return (_clang_index_getObjCPropertyDeclInfo ??= + _lookup>( + 'clang_index_getObjCPropertyDeclInfo') + .asFunction<_dart_clang_index_getObjCPropertyDeclInfo>())( arg0, ); } @@ -4749,10 +4954,11 @@ class LibClang { clang_index_getIBOutletCollectionAttrInfo( ffi.Pointer arg0, ) { - return (_clang_index_getIBOutletCollectionAttrInfo ??= - _dylib.lookupFunction<_c_clang_index_getIBOutletCollectionAttrInfo, - _dart_clang_index_getIBOutletCollectionAttrInfo>( - 'clang_index_getIBOutletCollectionAttrInfo'))( + return (_clang_index_getIBOutletCollectionAttrInfo ??= _lookup< + ffi.NativeFunction< + _c_clang_index_getIBOutletCollectionAttrInfo>>( + 'clang_index_getIBOutletCollectionAttrInfo') + .asFunction<_dart_clang_index_getIBOutletCollectionAttrInfo>())( arg0, ); } @@ -4763,10 +4969,10 @@ class LibClang { 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'))( + return (_clang_index_getCXXClassDeclInfo ??= + _lookup>( + 'clang_index_getCXXClassDeclInfo') + .asFunction<_dart_clang_index_getCXXClassDeclInfo>())( arg0, ); } @@ -4777,10 +4983,10 @@ class LibClang { 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'))( + return (_clang_index_getClientContainer ??= + _lookup>( + 'clang_index_getClientContainer') + .asFunction<_dart_clang_index_getClientContainer>())( arg0, ); } @@ -4792,10 +4998,10 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer arg1, ) { - return (_clang_index_setClientContainer ??= _dylib.lookupFunction< - _c_clang_index_setClientContainer, - _dart_clang_index_setClientContainer>( - 'clang_index_setClientContainer'))( + return (_clang_index_setClientContainer ??= + _lookup>( + 'clang_index_setClientContainer') + .asFunction<_dart_clang_index_setClientContainer>())( arg0, arg1, ); @@ -4807,9 +5013,10 @@ class LibClang { 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'))( + return (_clang_index_getClientEntity ??= + _lookup>( + 'clang_index_getClientEntity') + .asFunction<_dart_clang_index_getClientEntity>())( arg0, ); } @@ -4821,9 +5028,10 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer arg1, ) { - return (_clang_index_setClientEntity ??= _dylib.lookupFunction< - _c_clang_index_setClientEntity, - _dart_clang_index_setClientEntity>('clang_index_setClientEntity'))( + return (_clang_index_setClientEntity ??= + _lookup>( + 'clang_index_setClientEntity') + .asFunction<_dart_clang_index_setClientEntity>())( arg0, arg1, ); @@ -4836,9 +5044,10 @@ class LibClang { 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'))( + return (_clang_IndexAction_create ??= + _lookup>( + 'clang_IndexAction_create') + .asFunction<_dart_clang_IndexAction_create>())( CIdx, ); } @@ -4849,9 +5058,10 @@ class LibClang { void clang_IndexAction_dispose( ffi.Pointer arg0, ) { - return (_clang_IndexAction_dispose ??= _dylib.lookupFunction< - _c_clang_IndexAction_dispose, - _dart_clang_IndexAction_dispose>('clang_IndexAction_dispose'))( + return (_clang_IndexAction_dispose ??= + _lookup>( + 'clang_IndexAction_dispose') + .asFunction<_dart_clang_IndexAction_dispose>())( arg0, ); } @@ -4874,9 +5084,10 @@ class LibClang { ffi.Pointer> out_TU, int TU_options, ) { - return (_clang_indexSourceFile ??= _dylib.lookupFunction< - _c_clang_indexSourceFile, - _dart_clang_indexSourceFile>('clang_indexSourceFile'))( + return (_clang_indexSourceFile ??= + _lookup>( + 'clang_indexSourceFile') + .asFunction<_dart_clang_indexSourceFile>())( arg0, client_data, index_callbacks, @@ -4911,9 +5122,10 @@ class LibClang { ffi.Pointer> out_TU, int TU_options, ) { - return (_clang_indexSourceFileFullArgv ??= _dylib.lookupFunction< - _c_clang_indexSourceFileFullArgv, - _dart_clang_indexSourceFileFullArgv>('clang_indexSourceFileFullArgv'))( + return (_clang_indexSourceFileFullArgv ??= + _lookup>( + 'clang_indexSourceFileFullArgv') + .asFunction<_dart_clang_indexSourceFileFullArgv>())( arg0, client_data, index_callbacks, @@ -4941,9 +5153,10 @@ class LibClang { int index_options, ffi.Pointer arg5, ) { - return (_clang_indexTranslationUnit ??= _dylib.lookupFunction< - _c_clang_indexTranslationUnit, - _dart_clang_indexTranslationUnit>('clang_indexTranslationUnit'))( + return (_clang_indexTranslationUnit ??= + _lookup>( + 'clang_indexTranslationUnit') + .asFunction<_dart_clang_indexTranslationUnit>())( arg0, client_data, index_callbacks, @@ -4965,10 +5178,10 @@ class LibClang { ffi.Pointer column, ffi.Pointer offset, ) { - return (_clang_indexLoc_getFileLocation ??= _dylib.lookupFunction< - _c_clang_indexLoc_getFileLocation, - _dart_clang_indexLoc_getFileLocation>( - 'clang_indexLoc_getFileLocation'))( + return (_clang_indexLoc_getFileLocation ??= + _lookup>( + 'clang_indexLoc_getFileLocation') + .asFunction<_dart_clang_indexLoc_getFileLocation>())( loc, indexFile, file, @@ -4984,10 +5197,10 @@ class LibClang { CXSourceLocation clang_indexLoc_getCXSourceLocation( CXIdxLoc loc, ) { - return (_clang_indexLoc_getCXSourceLocation ??= _dylib.lookupFunction< - _c_clang_indexLoc_getCXSourceLocation, - _dart_clang_indexLoc_getCXSourceLocation>( - 'clang_indexLoc_getCXSourceLocation'))( + return (_clang_indexLoc_getCXSourceLocation ??= + _lookup>( + 'clang_indexLoc_getCXSourceLocation') + .asFunction<_dart_clang_indexLoc_getCXSourceLocation>())( loc, ); } @@ -5000,9 +5213,10 @@ class LibClang { ffi.Pointer> visitor, ffi.Pointer client_data, ) { - return (_clang_Type_visitFields ??= _dylib.lookupFunction< - _c_clang_Type_visitFields, - _dart_clang_Type_visitFields>('clang_Type_visitFields'))( + return (_clang_Type_visitFields ??= + _lookup>( + 'clang_Type_visitFields') + .asFunction<_dart_clang_Type_visitFields>())( T, visitor, client_data, @@ -5181,7 +5395,7 @@ class ArrayHelper_CXFileUniqueID_data_level0 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } @@ -5241,7 +5455,7 @@ class ArrayHelper_CXSourceLocation_ptr_data_level0 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } @@ -5299,7 +5513,7 @@ class ArrayHelper_CXSourceRange_ptr_data_level0 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } @@ -6218,7 +6432,7 @@ class ArrayHelper_CXCursor_data_level0 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } @@ -6511,7 +6725,7 @@ class ArrayHelper_CXType_data_level0 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } @@ -6762,7 +6976,7 @@ class ArrayHelper_CXToken_int_data_level0 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } @@ -7071,7 +7285,7 @@ class ArrayHelper_CXIdxLoc_ptr_data_level0 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index fa67d48a07..9afeabdc7b 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -5,11 +5,18 @@ import 'dart:ffi' as ffi; /// Bindings to SQLite. class SQLite { - /// Holds the Dynamic library. - final ffi.DynamicLibrary _dylib; + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; /// The symbols are looked up in [dynamicLibrary]. - SQLite(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + SQLite(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + SQLite.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; /// CAPI3REF: Run-Time Library Version Numbers /// KEYWORDS: sqlite3_version sqlite3_sourceid @@ -42,7 +49,7 @@ class SQLite { /// /// See also: [sqlite_version()] and [sqlite_source_id()]. late final ffi.Pointer> _sqlite3_version = - _dylib.lookup>('sqlite3_version'); + _lookup>('sqlite3_version'); ffi.Pointer get sqlite3_version => _sqlite3_version.value; @@ -51,24 +58,25 @@ class SQLite { ffi.Pointer sqlite3_libversion() { return (_sqlite3_libversion ??= - _dylib.lookupFunction<_c_sqlite3_libversion, _dart_sqlite3_libversion>( - 'sqlite3_libversion'))(); + _lookup>('sqlite3_libversion') + .asFunction<_dart_sqlite3_libversion>())(); } _dart_sqlite3_libversion? _sqlite3_libversion; ffi.Pointer sqlite3_sourceid() { return (_sqlite3_sourceid ??= - _dylib.lookupFunction<_c_sqlite3_sourceid, _dart_sqlite3_sourceid>( - 'sqlite3_sourceid'))(); + _lookup>('sqlite3_sourceid') + .asFunction<_dart_sqlite3_sourceid>())(); } _dart_sqlite3_sourceid? _sqlite3_sourceid; int sqlite3_libversion_number() { - return (_sqlite3_libversion_number ??= _dylib.lookupFunction< - _c_sqlite3_libversion_number, - _dart_sqlite3_libversion_number>('sqlite3_libversion_number'))(); + return (_sqlite3_libversion_number ??= + _lookup>( + 'sqlite3_libversion_number') + .asFunction<_dart_sqlite3_libversion_number>())(); } _dart_sqlite3_libversion_number? _sqlite3_libversion_number; @@ -76,9 +84,10 @@ class SQLite { int sqlite3_compileoption_used( ffi.Pointer zOptName, ) { - return (_sqlite3_compileoption_used ??= _dylib.lookupFunction< - _c_sqlite3_compileoption_used, - _dart_sqlite3_compileoption_used>('sqlite3_compileoption_used'))( + return (_sqlite3_compileoption_used ??= + _lookup>( + 'sqlite3_compileoption_used') + .asFunction<_dart_sqlite3_compileoption_used>())( zOptName, ); } @@ -88,9 +97,10 @@ class SQLite { ffi.Pointer sqlite3_compileoption_get( int N, ) { - return (_sqlite3_compileoption_get ??= _dylib.lookupFunction< - _c_sqlite3_compileoption_get, - _dart_sqlite3_compileoption_get>('sqlite3_compileoption_get'))( + return (_sqlite3_compileoption_get ??= + _lookup>( + 'sqlite3_compileoption_get') + .asFunction<_dart_sqlite3_compileoption_get>())( N, ); } @@ -133,8 +143,8 @@ class SQLite { /// See the [threading mode] documentation for additional information. int sqlite3_threadsafe() { return (_sqlite3_threadsafe ??= - _dylib.lookupFunction<_c_sqlite3_threadsafe, _dart_sqlite3_threadsafe>( - 'sqlite3_threadsafe'))(); + _lookup>('sqlite3_threadsafe') + .asFunction<_dart_sqlite3_threadsafe>())(); } _dart_sqlite3_threadsafe? _sqlite3_threadsafe; @@ -179,8 +189,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_close ??= - _dylib.lookupFunction<_c_sqlite3_close, _dart_sqlite3_close>( - 'sqlite3_close'))( + _lookup>('sqlite3_close') + .asFunction<_dart_sqlite3_close>())( arg0, ); } @@ -191,8 +201,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_close_v2 ??= - _dylib.lookupFunction<_c_sqlite3_close_v2, _dart_sqlite3_close_v2>( - 'sqlite3_close_v2'))( + _lookup>('sqlite3_close_v2') + .asFunction<_dart_sqlite3_close_v2>())( arg0, ); } @@ -266,8 +276,9 @@ class SQLite { ffi.Pointer arg3, ffi.Pointer> errmsg, ) { - return (_sqlite3_exec ??= _dylib - .lookupFunction<_c_sqlite3_exec, _dart_sqlite3_exec>('sqlite3_exec'))( + return (_sqlite3_exec ??= + _lookup>('sqlite3_exec') + .asFunction<_dart_sqlite3_exec>())( arg0, sql, callback, @@ -353,32 +364,32 @@ class SQLite { /// failure. int sqlite3_initialize() { return (_sqlite3_initialize ??= - _dylib.lookupFunction<_c_sqlite3_initialize, _dart_sqlite3_initialize>( - 'sqlite3_initialize'))(); + _lookup>('sqlite3_initialize') + .asFunction<_dart_sqlite3_initialize>())(); } _dart_sqlite3_initialize? _sqlite3_initialize; int sqlite3_shutdown() { return (_sqlite3_shutdown ??= - _dylib.lookupFunction<_c_sqlite3_shutdown, _dart_sqlite3_shutdown>( - 'sqlite3_shutdown'))(); + _lookup>('sqlite3_shutdown') + .asFunction<_dart_sqlite3_shutdown>())(); } _dart_sqlite3_shutdown? _sqlite3_shutdown; int sqlite3_os_init() { return (_sqlite3_os_init ??= - _dylib.lookupFunction<_c_sqlite3_os_init, _dart_sqlite3_os_init>( - 'sqlite3_os_init'))(); + _lookup>('sqlite3_os_init') + .asFunction<_dart_sqlite3_os_init>())(); } _dart_sqlite3_os_init? _sqlite3_os_init; int sqlite3_os_end() { return (_sqlite3_os_end ??= - _dylib.lookupFunction<_c_sqlite3_os_end, _dart_sqlite3_os_end>( - 'sqlite3_os_end'))(); + _lookup>('sqlite3_os_end') + .asFunction<_dart_sqlite3_os_end>())(); } _dart_sqlite3_os_end? _sqlite3_os_end; @@ -416,8 +427,8 @@ class SQLite { int arg0, ) { return (_sqlite3_config ??= - _dylib.lookupFunction<_c_sqlite3_config, _dart_sqlite3_config>( - 'sqlite3_config'))( + _lookup>('sqlite3_config') + .asFunction<_dart_sqlite3_config>())( arg0, ); } @@ -444,8 +455,8 @@ class SQLite { int op, ) { return (_sqlite3_db_config ??= - _dylib.lookupFunction<_c_sqlite3_db_config, _dart_sqlite3_db_config>( - 'sqlite3_db_config'))( + _lookup>('sqlite3_db_config') + .asFunction<_dart_sqlite3_db_config>())( arg0, op, ); @@ -463,9 +474,10 @@ class SQLite { ffi.Pointer arg0, int onoff, ) { - return (_sqlite3_extended_result_codes ??= _dylib.lookupFunction< - _c_sqlite3_extended_result_codes, - _dart_sqlite3_extended_result_codes>('sqlite3_extended_result_codes'))( + return (_sqlite3_extended_result_codes ??= + _lookup>( + 'sqlite3_extended_result_codes') + .asFunction<_dart_sqlite3_extended_result_codes>())( arg0, onoff, ); @@ -534,9 +546,10 @@ class SQLite { int sqlite3_last_insert_rowid( ffi.Pointer arg0, ) { - return (_sqlite3_last_insert_rowid ??= _dylib.lookupFunction< - _c_sqlite3_last_insert_rowid, - _dart_sqlite3_last_insert_rowid>('sqlite3_last_insert_rowid'))( + return (_sqlite3_last_insert_rowid ??= + _lookup>( + 'sqlite3_last_insert_rowid') + .asFunction<_dart_sqlite3_last_insert_rowid>())( arg0, ); } @@ -553,9 +566,10 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_set_last_insert_rowid ??= _dylib.lookupFunction< - _c_sqlite3_set_last_insert_rowid, - _dart_sqlite3_set_last_insert_rowid>('sqlite3_set_last_insert_rowid'))( + return (_sqlite3_set_last_insert_rowid ??= + _lookup>( + 'sqlite3_set_last_insert_rowid') + .asFunction<_dart_sqlite3_set_last_insert_rowid>())( arg0, arg1, ); @@ -621,8 +635,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_changes ??= - _dylib.lookupFunction<_c_sqlite3_changes, _dart_sqlite3_changes>( - 'sqlite3_changes'))( + _lookup>('sqlite3_changes') + .asFunction<_dart_sqlite3_changes>())( arg0, ); } @@ -665,9 +679,10 @@ class SQLite { int sqlite3_total_changes( ffi.Pointer arg0, ) { - return (_sqlite3_total_changes ??= _dylib.lookupFunction< - _c_sqlite3_total_changes, - _dart_sqlite3_total_changes>('sqlite3_total_changes'))( + return (_sqlite3_total_changes ??= + _lookup>( + 'sqlite3_total_changes') + .asFunction<_dart_sqlite3_total_changes>())( arg0, ); } @@ -711,8 +726,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_interrupt ??= - _dylib.lookupFunction<_c_sqlite3_interrupt, _dart_sqlite3_interrupt>( - 'sqlite3_interrupt'))( + _lookup>('sqlite3_interrupt') + .asFunction<_dart_sqlite3_interrupt>())( arg0, ); } @@ -754,8 +769,8 @@ class SQLite { ffi.Pointer sql, ) { return (_sqlite3_complete ??= - _dylib.lookupFunction<_c_sqlite3_complete, _dart_sqlite3_complete>( - 'sqlite3_complete'))( + _lookup>('sqlite3_complete') + .asFunction<_dart_sqlite3_complete>())( sql, ); } @@ -766,8 +781,8 @@ class SQLite { ffi.Pointer sql, ) { return (_sqlite3_complete16 ??= - _dylib.lookupFunction<_c_sqlite3_complete16, _dart_sqlite3_complete16>( - 'sqlite3_complete16'))( + _lookup>('sqlite3_complete16') + .asFunction<_dart_sqlite3_complete16>())( sql, ); } @@ -836,9 +851,10 @@ class SQLite { ffi.Pointer> arg1, ffi.Pointer arg2, ) { - return (_sqlite3_busy_handler ??= _dylib.lookupFunction< - _c_sqlite3_busy_handler, - _dart_sqlite3_busy_handler>('sqlite3_busy_handler'))( + return (_sqlite3_busy_handler ??= + _lookup>( + 'sqlite3_busy_handler') + .asFunction<_dart_sqlite3_busy_handler>())( arg0, arg1, arg2, @@ -870,9 +886,10 @@ class SQLite { ffi.Pointer arg0, int ms, ) { - return (_sqlite3_busy_timeout ??= _dylib.lookupFunction< - _c_sqlite3_busy_timeout, - _dart_sqlite3_busy_timeout>('sqlite3_busy_timeout'))( + return (_sqlite3_busy_timeout ??= + _lookup>( + 'sqlite3_busy_timeout') + .asFunction<_dart_sqlite3_busy_timeout>())( arg0, ms, ); @@ -960,8 +977,8 @@ class SQLite { ffi.Pointer> pzErrmsg, ) { return (_sqlite3_get_table ??= - _dylib.lookupFunction<_c_sqlite3_get_table, _dart_sqlite3_get_table>( - 'sqlite3_get_table'))( + _lookup>('sqlite3_get_table') + .asFunction<_dart_sqlite3_get_table>())( db, zSql, pazResult, @@ -977,8 +994,8 @@ class SQLite { ffi.Pointer> result, ) { return (_sqlite3_free_table ??= - _dylib.lookupFunction<_c_sqlite3_free_table, _dart_sqlite3_free_table>( - 'sqlite3_free_table'))( + _lookup>('sqlite3_free_table') + .asFunction<_dart_sqlite3_free_table>())( result, ); } @@ -1027,8 +1044,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_mprintf ??= - _dylib.lookupFunction<_c_sqlite3_mprintf, _dart_sqlite3_mprintf>( - 'sqlite3_mprintf'))( + _lookup>('sqlite3_mprintf') + .asFunction<_dart_sqlite3_mprintf>())( arg0, ); } @@ -1041,8 +1058,8 @@ class SQLite { ffi.Pointer arg2, ) { return (_sqlite3_snprintf ??= - _dylib.lookupFunction<_c_sqlite3_snprintf, _dart_sqlite3_snprintf>( - 'sqlite3_snprintf'))( + _lookup>('sqlite3_snprintf') + .asFunction<_dart_sqlite3_snprintf>())( arg0, arg1, arg2, @@ -1128,8 +1145,8 @@ class SQLite { int arg0, ) { return (_sqlite3_malloc ??= - _dylib.lookupFunction<_c_sqlite3_malloc, _dart_sqlite3_malloc>( - 'sqlite3_malloc'))( + _lookup>('sqlite3_malloc') + .asFunction<_dart_sqlite3_malloc>())( arg0, ); } @@ -1140,8 +1157,8 @@ class SQLite { int arg0, ) { return (_sqlite3_malloc64 ??= - _dylib.lookupFunction<_c_sqlite3_malloc64, _dart_sqlite3_malloc64>( - 'sqlite3_malloc64'))( + _lookup>('sqlite3_malloc64') + .asFunction<_dart_sqlite3_malloc64>())( arg0, ); } @@ -1153,8 +1170,8 @@ class SQLite { int arg1, ) { return (_sqlite3_realloc ??= - _dylib.lookupFunction<_c_sqlite3_realloc, _dart_sqlite3_realloc>( - 'sqlite3_realloc'))( + _lookup>('sqlite3_realloc') + .asFunction<_dart_sqlite3_realloc>())( arg0, arg1, ); @@ -1167,8 +1184,8 @@ class SQLite { int arg1, ) { return (_sqlite3_realloc64 ??= - _dylib.lookupFunction<_c_sqlite3_realloc64, _dart_sqlite3_realloc64>( - 'sqlite3_realloc64'))( + _lookup>('sqlite3_realloc64') + .asFunction<_dart_sqlite3_realloc64>())( arg0, arg1, ); @@ -1179,8 +1196,9 @@ class SQLite { void sqlite3_free( ffi.Pointer arg0, ) { - return (_sqlite3_free ??= _dylib - .lookupFunction<_c_sqlite3_free, _dart_sqlite3_free>('sqlite3_free'))( + return (_sqlite3_free ??= + _lookup>('sqlite3_free') + .asFunction<_dart_sqlite3_free>())( arg0, ); } @@ -1191,8 +1209,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_msize ??= - _dylib.lookupFunction<_c_sqlite3_msize, _dart_sqlite3_msize>( - 'sqlite3_msize'))( + _lookup>('sqlite3_msize') + .asFunction<_dart_sqlite3_msize>())( arg0, ); } @@ -1221,9 +1239,10 @@ class SQLite { /// by [sqlite3_memory_highwater(1)] is the high-water mark /// prior to the reset. int sqlite3_memory_used() { - return (_sqlite3_memory_used ??= _dylib.lookupFunction< - _c_sqlite3_memory_used, - _dart_sqlite3_memory_used>('sqlite3_memory_used'))(); + return (_sqlite3_memory_used ??= + _lookup>( + 'sqlite3_memory_used') + .asFunction<_dart_sqlite3_memory_used>())(); } _dart_sqlite3_memory_used? _sqlite3_memory_used; @@ -1231,9 +1250,10 @@ class SQLite { int sqlite3_memory_highwater( int resetFlag, ) { - return (_sqlite3_memory_highwater ??= _dylib.lookupFunction< - _c_sqlite3_memory_highwater, - _dart_sqlite3_memory_highwater>('sqlite3_memory_highwater'))( + return (_sqlite3_memory_highwater ??= + _lookup>( + 'sqlite3_memory_highwater') + .asFunction<_dart_sqlite3_memory_highwater>())( resetFlag, ); } @@ -1264,8 +1284,8 @@ class SQLite { ffi.Pointer P, ) { return (_sqlite3_randomness ??= - _dylib.lookupFunction<_c_sqlite3_randomness, _dart_sqlite3_randomness>( - 'sqlite3_randomness'))( + _lookup>('sqlite3_randomness') + .asFunction<_dart_sqlite3_randomness>())( N, P, ); @@ -1365,9 +1385,10 @@ class SQLite { ffi.Pointer> xAuth, ffi.Pointer pUserData, ) { - return (_sqlite3_set_authorizer ??= _dylib.lookupFunction< - _c_sqlite3_set_authorizer, - _dart_sqlite3_set_authorizer>('sqlite3_set_authorizer'))( + return (_sqlite3_set_authorizer ??= + _lookup>( + 'sqlite3_set_authorizer') + .asFunction<_dart_sqlite3_set_authorizer>())( arg0, xAuth, pUserData, @@ -1412,8 +1433,8 @@ class SQLite { ffi.Pointer arg2, ) { return (_sqlite3_trace ??= - _dylib.lookupFunction<_c_sqlite3_trace, _dart_sqlite3_trace>( - 'sqlite3_trace'))( + _lookup>('sqlite3_trace') + .asFunction<_dart_sqlite3_trace>())( arg0, xTrace, arg2, @@ -1428,8 +1449,8 @@ class SQLite { ffi.Pointer arg2, ) { return (_sqlite3_profile ??= - _dylib.lookupFunction<_c_sqlite3_profile, _dart_sqlite3_profile>( - 'sqlite3_profile'))( + _lookup>('sqlite3_profile') + .asFunction<_dart_sqlite3_profile>())( arg0, xProfile, arg2, @@ -1472,8 +1493,8 @@ class SQLite { ffi.Pointer pCtx, ) { return (_sqlite3_trace_v2 ??= - _dylib.lookupFunction<_c_sqlite3_trace_v2, _dart_sqlite3_trace_v2>( - 'sqlite3_trace_v2'))( + _lookup>('sqlite3_trace_v2') + .asFunction<_dart_sqlite3_trace_v2>())( arg0, uMask, xCallback, @@ -1518,9 +1539,10 @@ class SQLite { ffi.Pointer> arg2, ffi.Pointer arg3, ) { - return (_sqlite3_progress_handler ??= _dylib.lookupFunction< - _c_sqlite3_progress_handler, - _dart_sqlite3_progress_handler>('sqlite3_progress_handler'))( + return (_sqlite3_progress_handler ??= + _lookup>( + 'sqlite3_progress_handler') + .asFunction<_dart_sqlite3_progress_handler>())( arg0, arg1, arg2, @@ -1785,8 +1807,9 @@ class SQLite { ffi.Pointer filename, ffi.Pointer> ppDb, ) { - return (_sqlite3_open ??= _dylib - .lookupFunction<_c_sqlite3_open, _dart_sqlite3_open>('sqlite3_open'))( + return (_sqlite3_open ??= + _lookup>('sqlite3_open') + .asFunction<_dart_sqlite3_open>())( filename, ppDb, ); @@ -1799,8 +1822,8 @@ class SQLite { ffi.Pointer> ppDb, ) { return (_sqlite3_open16 ??= - _dylib.lookupFunction<_c_sqlite3_open16, _dart_sqlite3_open16>( - 'sqlite3_open16'))( + _lookup>('sqlite3_open16') + .asFunction<_dart_sqlite3_open16>())( filename, ppDb, ); @@ -1815,8 +1838,8 @@ class SQLite { ffi.Pointer zVfs, ) { return (_sqlite3_open_v2 ??= - _dylib.lookupFunction<_c_sqlite3_open_v2, _dart_sqlite3_open_v2>( - 'sqlite3_open_v2'))( + _lookup>('sqlite3_open_v2') + .asFunction<_dart_sqlite3_open_v2>())( filename, ppDb, flags, @@ -1894,9 +1917,10 @@ class SQLite { ffi.Pointer zFilename, ffi.Pointer zParam, ) { - return (_sqlite3_uri_parameter ??= _dylib.lookupFunction< - _c_sqlite3_uri_parameter, - _dart_sqlite3_uri_parameter>('sqlite3_uri_parameter'))( + return (_sqlite3_uri_parameter ??= + _lookup>( + 'sqlite3_uri_parameter') + .asFunction<_dart_sqlite3_uri_parameter>())( zFilename, zParam, ); @@ -1909,9 +1933,10 @@ class SQLite { ffi.Pointer zParam, int bDefault, ) { - return (_sqlite3_uri_boolean ??= _dylib.lookupFunction< - _c_sqlite3_uri_boolean, - _dart_sqlite3_uri_boolean>('sqlite3_uri_boolean'))( + return (_sqlite3_uri_boolean ??= + _lookup>( + 'sqlite3_uri_boolean') + .asFunction<_dart_sqlite3_uri_boolean>())( zFile, zParam, bDefault, @@ -1926,8 +1951,8 @@ class SQLite { int arg2, ) { return (_sqlite3_uri_int64 ??= - _dylib.lookupFunction<_c_sqlite3_uri_int64, _dart_sqlite3_uri_int64>( - 'sqlite3_uri_int64'))( + _lookup>('sqlite3_uri_int64') + .asFunction<_dart_sqlite3_uri_int64>())( arg0, arg1, arg2, @@ -1941,8 +1966,8 @@ class SQLite { int N, ) { return (_sqlite3_uri_key ??= - _dylib.lookupFunction<_c_sqlite3_uri_key, _dart_sqlite3_uri_key>( - 'sqlite3_uri_key'))( + _lookup>('sqlite3_uri_key') + .asFunction<_dart_sqlite3_uri_key>())( zFilename, N, ); @@ -1978,9 +2003,10 @@ class SQLite { ffi.Pointer sqlite3_filename_database( ffi.Pointer arg0, ) { - return (_sqlite3_filename_database ??= _dylib.lookupFunction< - _c_sqlite3_filename_database, - _dart_sqlite3_filename_database>('sqlite3_filename_database'))( + return (_sqlite3_filename_database ??= + _lookup>( + 'sqlite3_filename_database') + .asFunction<_dart_sqlite3_filename_database>())( arg0, ); } @@ -1990,9 +2016,10 @@ class SQLite { ffi.Pointer sqlite3_filename_journal( ffi.Pointer arg0, ) { - return (_sqlite3_filename_journal ??= _dylib.lookupFunction< - _c_sqlite3_filename_journal, - _dart_sqlite3_filename_journal>('sqlite3_filename_journal'))( + return (_sqlite3_filename_journal ??= + _lookup>( + 'sqlite3_filename_journal') + .asFunction<_dart_sqlite3_filename_journal>())( arg0, ); } @@ -2002,9 +2029,10 @@ class SQLite { ffi.Pointer sqlite3_filename_wal( ffi.Pointer arg0, ) { - return (_sqlite3_filename_wal ??= _dylib.lookupFunction< - _c_sqlite3_filename_wal, - _dart_sqlite3_filename_wal>('sqlite3_filename_wal'))( + return (_sqlite3_filename_wal ??= + _lookup>( + 'sqlite3_filename_wal') + .asFunction<_dart_sqlite3_filename_wal>())( arg0, ); } @@ -2029,9 +2057,10 @@ class SQLite { ffi.Pointer sqlite3_database_file_object( ffi.Pointer arg0, ) { - return (_sqlite3_database_file_object ??= _dylib.lookupFunction< - _c_sqlite3_database_file_object, - _dart_sqlite3_database_file_object>('sqlite3_database_file_object'))( + return (_sqlite3_database_file_object ??= + _lookup>( + 'sqlite3_database_file_object') + .asFunction<_dart_sqlite3_database_file_object>())( arg0, ); } @@ -2088,9 +2117,10 @@ class SQLite { int nParam, ffi.Pointer> azParam, ) { - return (_sqlite3_create_filename ??= _dylib.lookupFunction< - _c_sqlite3_create_filename, - _dart_sqlite3_create_filename>('sqlite3_create_filename'))( + return (_sqlite3_create_filename ??= + _lookup>( + 'sqlite3_create_filename') + .asFunction<_dart_sqlite3_create_filename>())( zDatabase, zJournal, zWal, @@ -2104,9 +2134,10 @@ class SQLite { void sqlite3_free_filename( ffi.Pointer arg0, ) { - return (_sqlite3_free_filename ??= _dylib.lookupFunction< - _c_sqlite3_free_filename, - _dart_sqlite3_free_filename>('sqlite3_free_filename'))( + return (_sqlite3_free_filename ??= + _lookup>( + 'sqlite3_free_filename') + .asFunction<_dart_sqlite3_free_filename>())( arg0, ); } @@ -2167,8 +2198,8 @@ class SQLite { ffi.Pointer db, ) { return (_sqlite3_errcode ??= - _dylib.lookupFunction<_c_sqlite3_errcode, _dart_sqlite3_errcode>( - 'sqlite3_errcode'))( + _lookup>('sqlite3_errcode') + .asFunction<_dart_sqlite3_errcode>())( db, ); } @@ -2178,9 +2209,10 @@ class SQLite { int sqlite3_extended_errcode( ffi.Pointer db, ) { - return (_sqlite3_extended_errcode ??= _dylib.lookupFunction< - _c_sqlite3_extended_errcode, - _dart_sqlite3_extended_errcode>('sqlite3_extended_errcode'))( + return (_sqlite3_extended_errcode ??= + _lookup>( + 'sqlite3_extended_errcode') + .asFunction<_dart_sqlite3_extended_errcode>())( db, ); } @@ -2191,8 +2223,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_errmsg ??= - _dylib.lookupFunction<_c_sqlite3_errmsg, _dart_sqlite3_errmsg>( - 'sqlite3_errmsg'))( + _lookup>('sqlite3_errmsg') + .asFunction<_dart_sqlite3_errmsg>())( arg0, ); } @@ -2203,8 +2235,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_errmsg16 ??= - _dylib.lookupFunction<_c_sqlite3_errmsg16, _dart_sqlite3_errmsg16>( - 'sqlite3_errmsg16'))( + _lookup>('sqlite3_errmsg16') + .asFunction<_dart_sqlite3_errmsg16>())( arg0, ); } @@ -2215,8 +2247,8 @@ class SQLite { int arg0, ) { return (_sqlite3_errstr ??= - _dylib.lookupFunction<_c_sqlite3_errstr, _dart_sqlite3_errstr>( - 'sqlite3_errstr'))( + _lookup>('sqlite3_errstr') + .asFunction<_dart_sqlite3_errstr>())( arg0, ); } @@ -2267,8 +2299,8 @@ class SQLite { int newVal, ) { return (_sqlite3_limit ??= - _dylib.lookupFunction<_c_sqlite3_limit, _dart_sqlite3_limit>( - 'sqlite3_limit'))( + _lookup>('sqlite3_limit') + .asFunction<_dart_sqlite3_limit>())( arg0, id, newVal, @@ -2383,8 +2415,8 @@ class SQLite { ffi.Pointer> pzTail, ) { return (_sqlite3_prepare ??= - _dylib.lookupFunction<_c_sqlite3_prepare, _dart_sqlite3_prepare>( - 'sqlite3_prepare'))( + _lookup>('sqlite3_prepare') + .asFunction<_dart_sqlite3_prepare>())( db, zSql, nByte, @@ -2403,8 +2435,8 @@ class SQLite { ffi.Pointer> pzTail, ) { return (_sqlite3_prepare_v2 ??= - _dylib.lookupFunction<_c_sqlite3_prepare_v2, _dart_sqlite3_prepare_v2>( - 'sqlite3_prepare_v2'))( + _lookup>('sqlite3_prepare_v2') + .asFunction<_dart_sqlite3_prepare_v2>())( db, zSql, nByte, @@ -2424,8 +2456,8 @@ class SQLite { ffi.Pointer> pzTail, ) { return (_sqlite3_prepare_v3 ??= - _dylib.lookupFunction<_c_sqlite3_prepare_v3, _dart_sqlite3_prepare_v3>( - 'sqlite3_prepare_v3'))( + _lookup>('sqlite3_prepare_v3') + .asFunction<_dart_sqlite3_prepare_v3>())( db, zSql, nByte, @@ -2445,8 +2477,8 @@ class SQLite { ffi.Pointer> pzTail, ) { return (_sqlite3_prepare16 ??= - _dylib.lookupFunction<_c_sqlite3_prepare16, _dart_sqlite3_prepare16>( - 'sqlite3_prepare16'))( + _lookup>('sqlite3_prepare16') + .asFunction<_dart_sqlite3_prepare16>())( db, zSql, nByte, @@ -2464,9 +2496,10 @@ class SQLite { ffi.Pointer> ppStmt, ffi.Pointer> pzTail, ) { - return (_sqlite3_prepare16_v2 ??= _dylib.lookupFunction< - _c_sqlite3_prepare16_v2, - _dart_sqlite3_prepare16_v2>('sqlite3_prepare16_v2'))( + return (_sqlite3_prepare16_v2 ??= + _lookup>( + 'sqlite3_prepare16_v2') + .asFunction<_dart_sqlite3_prepare16_v2>())( db, zSql, nByte, @@ -2485,9 +2518,10 @@ class SQLite { ffi.Pointer> ppStmt, ffi.Pointer> pzTail, ) { - return (_sqlite3_prepare16_v3 ??= _dylib.lookupFunction< - _c_sqlite3_prepare16_v3, - _dart_sqlite3_prepare16_v3>('sqlite3_prepare16_v3'))( + return (_sqlite3_prepare16_v3 ??= + _lookup>( + 'sqlite3_prepare16_v3') + .asFunction<_dart_sqlite3_prepare16_v3>())( db, zSql, nByte, @@ -2538,8 +2572,9 @@ class SQLite { ffi.Pointer sqlite3_sql( ffi.Pointer pStmt, ) { - return (_sqlite3_sql ??= _dylib - .lookupFunction<_c_sqlite3_sql, _dart_sqlite3_sql>('sqlite3_sql'))( + return (_sqlite3_sql ??= + _lookup>('sqlite3_sql') + .asFunction<_dart_sqlite3_sql>())( pStmt, ); } @@ -2549,9 +2584,10 @@ class SQLite { ffi.Pointer sqlite3_expanded_sql( ffi.Pointer pStmt, ) { - return (_sqlite3_expanded_sql ??= _dylib.lookupFunction< - _c_sqlite3_expanded_sql, - _dart_sqlite3_expanded_sql>('sqlite3_expanded_sql'))( + return (_sqlite3_expanded_sql ??= + _lookup>( + 'sqlite3_expanded_sql') + .asFunction<_dart_sqlite3_expanded_sql>())( pStmt, ); } @@ -2561,9 +2597,10 @@ class SQLite { ffi.Pointer sqlite3_normalized_sql( ffi.Pointer pStmt, ) { - return (_sqlite3_normalized_sql ??= _dylib.lookupFunction< - _c_sqlite3_normalized_sql, - _dart_sqlite3_normalized_sql>('sqlite3_normalized_sql'))( + return (_sqlite3_normalized_sql ??= + _lookup>( + 'sqlite3_normalized_sql') + .asFunction<_dart_sqlite3_normalized_sql>())( pStmt, ); } @@ -2605,9 +2642,10 @@ class SQLite { int sqlite3_stmt_readonly( ffi.Pointer pStmt, ) { - return (_sqlite3_stmt_readonly ??= _dylib.lookupFunction< - _c_sqlite3_stmt_readonly, - _dart_sqlite3_stmt_readonly>('sqlite3_stmt_readonly'))( + return (_sqlite3_stmt_readonly ??= + _lookup>( + 'sqlite3_stmt_readonly') + .asFunction<_dart_sqlite3_stmt_readonly>())( pStmt, ); } @@ -2625,9 +2663,10 @@ class SQLite { int sqlite3_stmt_isexplain( ffi.Pointer pStmt, ) { - return (_sqlite3_stmt_isexplain ??= _dylib.lookupFunction< - _c_sqlite3_stmt_isexplain, - _dart_sqlite3_stmt_isexplain>('sqlite3_stmt_isexplain'))( + return (_sqlite3_stmt_isexplain ??= + _lookup>( + 'sqlite3_stmt_isexplain') + .asFunction<_dart_sqlite3_stmt_isexplain>())( pStmt, ); } @@ -2655,8 +2694,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_stmt_busy ??= - _dylib.lookupFunction<_c_sqlite3_stmt_busy, _dart_sqlite3_stmt_busy>( - 'sqlite3_stmt_busy'))( + _lookup>('sqlite3_stmt_busy') + .asFunction<_dart_sqlite3_stmt_busy>())( arg0, ); } @@ -2805,8 +2844,8 @@ class SQLite { ffi.Pointer> arg4, ) { return (_sqlite3_bind_blob ??= - _dylib.lookupFunction<_c_sqlite3_bind_blob, _dart_sqlite3_bind_blob>( - 'sqlite3_bind_blob'))( + _lookup>('sqlite3_bind_blob') + .asFunction<_dart_sqlite3_bind_blob>())( arg0, arg1, arg2, @@ -2824,9 +2863,10 @@ class SQLite { int arg3, ffi.Pointer> arg4, ) { - return (_sqlite3_bind_blob64 ??= _dylib.lookupFunction< - _c_sqlite3_bind_blob64, - _dart_sqlite3_bind_blob64>('sqlite3_bind_blob64'))( + return (_sqlite3_bind_blob64 ??= + _lookup>( + 'sqlite3_bind_blob64') + .asFunction<_dart_sqlite3_bind_blob64>())( arg0, arg1, arg2, @@ -2842,9 +2882,10 @@ class SQLite { int arg1, double arg2, ) { - return (_sqlite3_bind_double ??= _dylib.lookupFunction< - _c_sqlite3_bind_double, - _dart_sqlite3_bind_double>('sqlite3_bind_double'))( + return (_sqlite3_bind_double ??= + _lookup>( + 'sqlite3_bind_double') + .asFunction<_dart_sqlite3_bind_double>())( arg0, arg1, arg2, @@ -2859,8 +2900,8 @@ class SQLite { int arg2, ) { return (_sqlite3_bind_int ??= - _dylib.lookupFunction<_c_sqlite3_bind_int, _dart_sqlite3_bind_int>( - 'sqlite3_bind_int'))( + _lookup>('sqlite3_bind_int') + .asFunction<_dart_sqlite3_bind_int>())( arg0, arg1, arg2, @@ -2875,8 +2916,8 @@ class SQLite { int arg2, ) { return (_sqlite3_bind_int64 ??= - _dylib.lookupFunction<_c_sqlite3_bind_int64, _dart_sqlite3_bind_int64>( - 'sqlite3_bind_int64'))( + _lookup>('sqlite3_bind_int64') + .asFunction<_dart_sqlite3_bind_int64>())( arg0, arg1, arg2, @@ -2890,8 +2931,8 @@ class SQLite { int arg1, ) { return (_sqlite3_bind_null ??= - _dylib.lookupFunction<_c_sqlite3_bind_null, _dart_sqlite3_bind_null>( - 'sqlite3_bind_null'))( + _lookup>('sqlite3_bind_null') + .asFunction<_dart_sqlite3_bind_null>())( arg0, arg1, ); @@ -2907,8 +2948,8 @@ class SQLite { ffi.Pointer> arg4, ) { return (_sqlite3_bind_text ??= - _dylib.lookupFunction<_c_sqlite3_bind_text, _dart_sqlite3_bind_text>( - 'sqlite3_bind_text'))( + _lookup>('sqlite3_bind_text') + .asFunction<_dart_sqlite3_bind_text>())( arg0, arg1, arg2, @@ -2926,9 +2967,10 @@ class SQLite { int arg3, ffi.Pointer> arg4, ) { - return (_sqlite3_bind_text16 ??= _dylib.lookupFunction< - _c_sqlite3_bind_text16, - _dart_sqlite3_bind_text16>('sqlite3_bind_text16'))( + return (_sqlite3_bind_text16 ??= + _lookup>( + 'sqlite3_bind_text16') + .asFunction<_dart_sqlite3_bind_text16>())( arg0, arg1, arg2, @@ -2947,9 +2989,10 @@ class SQLite { ffi.Pointer> arg4, int encoding, ) { - return (_sqlite3_bind_text64 ??= _dylib.lookupFunction< - _c_sqlite3_bind_text64, - _dart_sqlite3_bind_text64>('sqlite3_bind_text64'))( + return (_sqlite3_bind_text64 ??= + _lookup>( + 'sqlite3_bind_text64') + .asFunction<_dart_sqlite3_bind_text64>())( arg0, arg1, arg2, @@ -2967,8 +3010,8 @@ class SQLite { ffi.Pointer arg2, ) { return (_sqlite3_bind_value ??= - _dylib.lookupFunction<_c_sqlite3_bind_value, _dart_sqlite3_bind_value>( - 'sqlite3_bind_value'))( + _lookup>('sqlite3_bind_value') + .asFunction<_dart_sqlite3_bind_value>())( arg0, arg1, arg2, @@ -2984,9 +3027,10 @@ class SQLite { ffi.Pointer arg3, ffi.Pointer> arg4, ) { - return (_sqlite3_bind_pointer ??= _dylib.lookupFunction< - _c_sqlite3_bind_pointer, - _dart_sqlite3_bind_pointer>('sqlite3_bind_pointer'))( + return (_sqlite3_bind_pointer ??= + _lookup>( + 'sqlite3_bind_pointer') + .asFunction<_dart_sqlite3_bind_pointer>())( arg0, arg1, arg2, @@ -3002,9 +3046,10 @@ class SQLite { int arg1, int n, ) { - return (_sqlite3_bind_zeroblob ??= _dylib.lookupFunction< - _c_sqlite3_bind_zeroblob, - _dart_sqlite3_bind_zeroblob>('sqlite3_bind_zeroblob'))( + return (_sqlite3_bind_zeroblob ??= + _lookup>( + 'sqlite3_bind_zeroblob') + .asFunction<_dart_sqlite3_bind_zeroblob>())( arg0, arg1, n, @@ -3018,9 +3063,10 @@ class SQLite { int arg1, int arg2, ) { - return (_sqlite3_bind_zeroblob64 ??= _dylib.lookupFunction< - _c_sqlite3_bind_zeroblob64, - _dart_sqlite3_bind_zeroblob64>('sqlite3_bind_zeroblob64'))( + return (_sqlite3_bind_zeroblob64 ??= + _lookup>( + 'sqlite3_bind_zeroblob64') + .asFunction<_dart_sqlite3_bind_zeroblob64>())( arg0, arg1, arg2, @@ -3049,9 +3095,10 @@ class SQLite { int sqlite3_bind_parameter_count( ffi.Pointer arg0, ) { - return (_sqlite3_bind_parameter_count ??= _dylib.lookupFunction< - _c_sqlite3_bind_parameter_count, - _dart_sqlite3_bind_parameter_count>('sqlite3_bind_parameter_count'))( + return (_sqlite3_bind_parameter_count ??= + _lookup>( + 'sqlite3_bind_parameter_count') + .asFunction<_dart_sqlite3_bind_parameter_count>())( arg0, ); } @@ -3086,9 +3133,10 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_bind_parameter_name ??= _dylib.lookupFunction< - _c_sqlite3_bind_parameter_name, - _dart_sqlite3_bind_parameter_name>('sqlite3_bind_parameter_name'))( + return (_sqlite3_bind_parameter_name ??= + _lookup>( + 'sqlite3_bind_parameter_name') + .asFunction<_dart_sqlite3_bind_parameter_name>())( arg0, arg1, ); @@ -3114,9 +3162,10 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer zName, ) { - return (_sqlite3_bind_parameter_index ??= _dylib.lookupFunction< - _c_sqlite3_bind_parameter_index, - _dart_sqlite3_bind_parameter_index>('sqlite3_bind_parameter_index'))( + return (_sqlite3_bind_parameter_index ??= + _lookup>( + 'sqlite3_bind_parameter_index') + .asFunction<_dart_sqlite3_bind_parameter_index>())( arg0, zName, ); @@ -3133,9 +3182,10 @@ class SQLite { int sqlite3_clear_bindings( ffi.Pointer arg0, ) { - return (_sqlite3_clear_bindings ??= _dylib.lookupFunction< - _c_sqlite3_clear_bindings, - _dart_sqlite3_clear_bindings>('sqlite3_clear_bindings'))( + return (_sqlite3_clear_bindings ??= + _lookup>( + 'sqlite3_clear_bindings') + .asFunction<_dart_sqlite3_clear_bindings>())( arg0, ); } @@ -3157,9 +3207,10 @@ class SQLite { int sqlite3_column_count( ffi.Pointer pStmt, ) { - return (_sqlite3_column_count ??= _dylib.lookupFunction< - _c_sqlite3_column_count, - _dart_sqlite3_column_count>('sqlite3_column_count'))( + return (_sqlite3_column_count ??= + _lookup>( + 'sqlite3_column_count') + .asFunction<_dart_sqlite3_column_count>())( pStmt, ); } @@ -3195,9 +3246,10 @@ class SQLite { ffi.Pointer arg0, int N, ) { - return (_sqlite3_column_name ??= _dylib.lookupFunction< - _c_sqlite3_column_name, - _dart_sqlite3_column_name>('sqlite3_column_name'))( + return (_sqlite3_column_name ??= + _lookup>( + 'sqlite3_column_name') + .asFunction<_dart_sqlite3_column_name>())( arg0, N, ); @@ -3209,9 +3261,10 @@ class SQLite { ffi.Pointer arg0, int N, ) { - return (_sqlite3_column_name16 ??= _dylib.lookupFunction< - _c_sqlite3_column_name16, - _dart_sqlite3_column_name16>('sqlite3_column_name16'))( + return (_sqlite3_column_name16 ??= + _lookup>( + 'sqlite3_column_name16') + .asFunction<_dart_sqlite3_column_name16>())( arg0, N, ); @@ -3263,9 +3316,10 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_column_database_name ??= _dylib.lookupFunction< - _c_sqlite3_column_database_name, - _dart_sqlite3_column_database_name>('sqlite3_column_database_name'))( + return (_sqlite3_column_database_name ??= + _lookup>( + 'sqlite3_column_database_name') + .asFunction<_dart_sqlite3_column_database_name>())( arg0, arg1, ); @@ -3277,10 +3331,10 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_column_database_name16 ??= _dylib.lookupFunction< - _c_sqlite3_column_database_name16, - _dart_sqlite3_column_database_name16>( - 'sqlite3_column_database_name16'))( + return (_sqlite3_column_database_name16 ??= + _lookup>( + 'sqlite3_column_database_name16') + .asFunction<_dart_sqlite3_column_database_name16>())( arg0, arg1, ); @@ -3292,9 +3346,10 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_column_table_name ??= _dylib.lookupFunction< - _c_sqlite3_column_table_name, - _dart_sqlite3_column_table_name>('sqlite3_column_table_name'))( + return (_sqlite3_column_table_name ??= + _lookup>( + 'sqlite3_column_table_name') + .asFunction<_dart_sqlite3_column_table_name>())( arg0, arg1, ); @@ -3306,9 +3361,10 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_column_table_name16 ??= _dylib.lookupFunction< - _c_sqlite3_column_table_name16, - _dart_sqlite3_column_table_name16>('sqlite3_column_table_name16'))( + return (_sqlite3_column_table_name16 ??= + _lookup>( + 'sqlite3_column_table_name16') + .asFunction<_dart_sqlite3_column_table_name16>())( arg0, arg1, ); @@ -3320,9 +3376,10 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_column_origin_name ??= _dylib.lookupFunction< - _c_sqlite3_column_origin_name, - _dart_sqlite3_column_origin_name>('sqlite3_column_origin_name'))( + return (_sqlite3_column_origin_name ??= + _lookup>( + 'sqlite3_column_origin_name') + .asFunction<_dart_sqlite3_column_origin_name>())( arg0, arg1, ); @@ -3334,9 +3391,10 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_column_origin_name16 ??= _dylib.lookupFunction< - _c_sqlite3_column_origin_name16, - _dart_sqlite3_column_origin_name16>('sqlite3_column_origin_name16'))( + return (_sqlite3_column_origin_name16 ??= + _lookup>( + 'sqlite3_column_origin_name16') + .asFunction<_dart_sqlite3_column_origin_name16>())( arg0, arg1, ); @@ -3376,9 +3434,10 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_column_decltype ??= _dylib.lookupFunction< - _c_sqlite3_column_decltype, - _dart_sqlite3_column_decltype>('sqlite3_column_decltype'))( + return (_sqlite3_column_decltype ??= + _lookup>( + 'sqlite3_column_decltype') + .asFunction<_dart_sqlite3_column_decltype>())( arg0, arg1, ); @@ -3390,9 +3449,10 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_column_decltype16 ??= _dylib.lookupFunction< - _c_sqlite3_column_decltype16, - _dart_sqlite3_column_decltype16>('sqlite3_column_decltype16'))( + return (_sqlite3_column_decltype16 ??= + _lookup>( + 'sqlite3_column_decltype16') + .asFunction<_dart_sqlite3_column_decltype16>())( arg0, arg1, ); @@ -3483,8 +3543,9 @@ class SQLite { int sqlite3_step( ffi.Pointer arg0, ) { - return (_sqlite3_step ??= _dylib - .lookupFunction<_c_sqlite3_step, _dart_sqlite3_step>('sqlite3_step'))( + return (_sqlite3_step ??= + _lookup>('sqlite3_step') + .asFunction<_dart_sqlite3_step>())( arg0, ); } @@ -3512,8 +3573,8 @@ class SQLite { ffi.Pointer pStmt, ) { return (_sqlite3_data_count ??= - _dylib.lookupFunction<_c_sqlite3_data_count, _dart_sqlite3_data_count>( - 'sqlite3_data_count'))( + _lookup>('sqlite3_data_count') + .asFunction<_dart_sqlite3_data_count>())( pStmt, ); } @@ -3731,9 +3792,10 @@ class SQLite { ffi.Pointer arg0, int iCol, ) { - return (_sqlite3_column_blob ??= _dylib.lookupFunction< - _c_sqlite3_column_blob, - _dart_sqlite3_column_blob>('sqlite3_column_blob'))( + return (_sqlite3_column_blob ??= + _lookup>( + 'sqlite3_column_blob') + .asFunction<_dart_sqlite3_column_blob>())( arg0, iCol, ); @@ -3745,9 +3807,10 @@ class SQLite { ffi.Pointer arg0, int iCol, ) { - return (_sqlite3_column_double ??= _dylib.lookupFunction< - _c_sqlite3_column_double, - _dart_sqlite3_column_double>('sqlite3_column_double'))( + return (_sqlite3_column_double ??= + _lookup>( + 'sqlite3_column_double') + .asFunction<_dart_sqlite3_column_double>())( arg0, iCol, ); @@ -3760,8 +3823,8 @@ class SQLite { int iCol, ) { return (_sqlite3_column_int ??= - _dylib.lookupFunction<_c_sqlite3_column_int, _dart_sqlite3_column_int>( - 'sqlite3_column_int'))( + _lookup>('sqlite3_column_int') + .asFunction<_dart_sqlite3_column_int>())( arg0, iCol, ); @@ -3773,9 +3836,10 @@ class SQLite { ffi.Pointer arg0, int iCol, ) { - return (_sqlite3_column_int64 ??= _dylib.lookupFunction< - _c_sqlite3_column_int64, - _dart_sqlite3_column_int64>('sqlite3_column_int64'))( + return (_sqlite3_column_int64 ??= + _lookup>( + 'sqlite3_column_int64') + .asFunction<_dart_sqlite3_column_int64>())( arg0, iCol, ); @@ -3787,9 +3851,10 @@ class SQLite { ffi.Pointer arg0, int iCol, ) { - return (_sqlite3_column_text ??= _dylib.lookupFunction< - _c_sqlite3_column_text, - _dart_sqlite3_column_text>('sqlite3_column_text'))( + return (_sqlite3_column_text ??= + _lookup>( + 'sqlite3_column_text') + .asFunction<_dart_sqlite3_column_text>())( arg0, iCol, ); @@ -3801,9 +3866,10 @@ class SQLite { ffi.Pointer arg0, int iCol, ) { - return (_sqlite3_column_text16 ??= _dylib.lookupFunction< - _c_sqlite3_column_text16, - _dart_sqlite3_column_text16>('sqlite3_column_text16'))( + return (_sqlite3_column_text16 ??= + _lookup>( + 'sqlite3_column_text16') + .asFunction<_dart_sqlite3_column_text16>())( arg0, iCol, ); @@ -3815,9 +3881,10 @@ class SQLite { ffi.Pointer arg0, int iCol, ) { - return (_sqlite3_column_value ??= _dylib.lookupFunction< - _c_sqlite3_column_value, - _dart_sqlite3_column_value>('sqlite3_column_value'))( + return (_sqlite3_column_value ??= + _lookup>( + 'sqlite3_column_value') + .asFunction<_dart_sqlite3_column_value>())( arg0, iCol, ); @@ -3829,9 +3896,10 @@ class SQLite { ffi.Pointer arg0, int iCol, ) { - return (_sqlite3_column_bytes ??= _dylib.lookupFunction< - _c_sqlite3_column_bytes, - _dart_sqlite3_column_bytes>('sqlite3_column_bytes'))( + return (_sqlite3_column_bytes ??= + _lookup>( + 'sqlite3_column_bytes') + .asFunction<_dart_sqlite3_column_bytes>())( arg0, iCol, ); @@ -3843,9 +3911,10 @@ class SQLite { ffi.Pointer arg0, int iCol, ) { - return (_sqlite3_column_bytes16 ??= _dylib.lookupFunction< - _c_sqlite3_column_bytes16, - _dart_sqlite3_column_bytes16>('sqlite3_column_bytes16'))( + return (_sqlite3_column_bytes16 ??= + _lookup>( + 'sqlite3_column_bytes16') + .asFunction<_dart_sqlite3_column_bytes16>())( arg0, iCol, ); @@ -3857,9 +3926,10 @@ class SQLite { ffi.Pointer arg0, int iCol, ) { - return (_sqlite3_column_type ??= _dylib.lookupFunction< - _c_sqlite3_column_type, - _dart_sqlite3_column_type>('sqlite3_column_type'))( + return (_sqlite3_column_type ??= + _lookup>( + 'sqlite3_column_type') + .asFunction<_dart_sqlite3_column_type>())( arg0, iCol, ); @@ -3895,8 +3965,8 @@ class SQLite { ffi.Pointer pStmt, ) { return (_sqlite3_finalize ??= - _dylib.lookupFunction<_c_sqlite3_finalize, _dart_sqlite3_finalize>( - 'sqlite3_finalize'))( + _lookup>('sqlite3_finalize') + .asFunction<_dart_sqlite3_finalize>())( pStmt, ); } @@ -3930,8 +4000,8 @@ class SQLite { ffi.Pointer pStmt, ) { return (_sqlite3_reset ??= - _dylib.lookupFunction<_c_sqlite3_reset, _dart_sqlite3_reset>( - 'sqlite3_reset'))( + _lookup>('sqlite3_reset') + .asFunction<_dart_sqlite3_reset>())( pStmt, ); } @@ -4071,9 +4141,10 @@ class SQLite { ffi.Pointer> xStep, ffi.Pointer> xFinal, ) { - return (_sqlite3_create_function ??= _dylib.lookupFunction< - _c_sqlite3_create_function, - _dart_sqlite3_create_function>('sqlite3_create_function'))( + return (_sqlite3_create_function ??= + _lookup>( + 'sqlite3_create_function') + .asFunction<_dart_sqlite3_create_function>())( db, zFunctionName, nArg, @@ -4097,9 +4168,10 @@ class SQLite { ffi.Pointer> xStep, ffi.Pointer> xFinal, ) { - return (_sqlite3_create_function16 ??= _dylib.lookupFunction< - _c_sqlite3_create_function16, - _dart_sqlite3_create_function16>('sqlite3_create_function16'))( + return (_sqlite3_create_function16 ??= + _lookup>( + 'sqlite3_create_function16') + .asFunction<_dart_sqlite3_create_function16>())( db, zFunctionName, nArg, @@ -4124,9 +4196,10 @@ class SQLite { ffi.Pointer> xFinal, ffi.Pointer> xDestroy, ) { - return (_sqlite3_create_function_v2 ??= _dylib.lookupFunction< - _c_sqlite3_create_function_v2, - _dart_sqlite3_create_function_v2>('sqlite3_create_function_v2'))( + return (_sqlite3_create_function_v2 ??= + _lookup>( + 'sqlite3_create_function_v2') + .asFunction<_dart_sqlite3_create_function_v2>())( db, zFunctionName, nArg, @@ -4153,10 +4226,10 @@ class SQLite { ffi.Pointer> xInverse, ffi.Pointer> xDestroy, ) { - return (_sqlite3_create_window_function ??= _dylib.lookupFunction< - _c_sqlite3_create_window_function, - _dart_sqlite3_create_window_function>( - 'sqlite3_create_window_function'))( + return (_sqlite3_create_window_function ??= + _lookup>( + 'sqlite3_create_window_function') + .asFunction<_dart_sqlite3_create_window_function>())( db, zFunctionName, nArg, @@ -4175,9 +4248,10 @@ class SQLite { int sqlite3_aggregate_count( ffi.Pointer arg0, ) { - return (_sqlite3_aggregate_count ??= _dylib.lookupFunction< - _c_sqlite3_aggregate_count, - _dart_sqlite3_aggregate_count>('sqlite3_aggregate_count'))( + return (_sqlite3_aggregate_count ??= + _lookup>( + 'sqlite3_aggregate_count') + .asFunction<_dart_sqlite3_aggregate_count>())( arg0, ); } @@ -4188,8 +4262,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_expired ??= - _dylib.lookupFunction<_c_sqlite3_expired, _dart_sqlite3_expired>( - 'sqlite3_expired'))( + _lookup>('sqlite3_expired') + .asFunction<_dart_sqlite3_expired>())( arg0, ); } @@ -4200,9 +4274,10 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, ) { - return (_sqlite3_transfer_bindings ??= _dylib.lookupFunction< - _c_sqlite3_transfer_bindings, - _dart_sqlite3_transfer_bindings>('sqlite3_transfer_bindings'))( + return (_sqlite3_transfer_bindings ??= + _lookup>( + 'sqlite3_transfer_bindings') + .asFunction<_dart_sqlite3_transfer_bindings>())( arg0, arg1, ); @@ -4211,17 +4286,19 @@ class SQLite { _dart_sqlite3_transfer_bindings? _sqlite3_transfer_bindings; int sqlite3_global_recover() { - return (_sqlite3_global_recover ??= _dylib.lookupFunction< - _c_sqlite3_global_recover, - _dart_sqlite3_global_recover>('sqlite3_global_recover'))(); + return (_sqlite3_global_recover ??= + _lookup>( + 'sqlite3_global_recover') + .asFunction<_dart_sqlite3_global_recover>())(); } _dart_sqlite3_global_recover? _sqlite3_global_recover; void sqlite3_thread_cleanup() { - return (_sqlite3_thread_cleanup ??= _dylib.lookupFunction< - _c_sqlite3_thread_cleanup, - _dart_sqlite3_thread_cleanup>('sqlite3_thread_cleanup'))(); + return (_sqlite3_thread_cleanup ??= + _lookup>( + 'sqlite3_thread_cleanup') + .asFunction<_dart_sqlite3_thread_cleanup>())(); } _dart_sqlite3_thread_cleanup? _sqlite3_thread_cleanup; @@ -4231,9 +4308,10 @@ class SQLite { ffi.Pointer arg1, int arg2, ) { - return (_sqlite3_memory_alarm ??= _dylib.lookupFunction< - _c_sqlite3_memory_alarm, - _dart_sqlite3_memory_alarm>('sqlite3_memory_alarm'))( + return (_sqlite3_memory_alarm ??= + _lookup>( + 'sqlite3_memory_alarm') + .asFunction<_dart_sqlite3_memory_alarm>())( arg0, arg1, arg2, @@ -4372,8 +4450,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_value_blob ??= - _dylib.lookupFunction<_c_sqlite3_value_blob, _dart_sqlite3_value_blob>( - 'sqlite3_value_blob'))( + _lookup>('sqlite3_value_blob') + .asFunction<_dart_sqlite3_value_blob>())( arg0, ); } @@ -4383,9 +4461,10 @@ class SQLite { double sqlite3_value_double( ffi.Pointer arg0, ) { - return (_sqlite3_value_double ??= _dylib.lookupFunction< - _c_sqlite3_value_double, - _dart_sqlite3_value_double>('sqlite3_value_double'))( + return (_sqlite3_value_double ??= + _lookup>( + 'sqlite3_value_double') + .asFunction<_dart_sqlite3_value_double>())( arg0, ); } @@ -4396,8 +4475,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_value_int ??= - _dylib.lookupFunction<_c_sqlite3_value_int, _dart_sqlite3_value_int>( - 'sqlite3_value_int'))( + _lookup>('sqlite3_value_int') + .asFunction<_dart_sqlite3_value_int>())( arg0, ); } @@ -4407,9 +4486,10 @@ class SQLite { int sqlite3_value_int64( ffi.Pointer arg0, ) { - return (_sqlite3_value_int64 ??= _dylib.lookupFunction< - _c_sqlite3_value_int64, - _dart_sqlite3_value_int64>('sqlite3_value_int64'))( + return (_sqlite3_value_int64 ??= + _lookup>( + 'sqlite3_value_int64') + .asFunction<_dart_sqlite3_value_int64>())( arg0, ); } @@ -4420,9 +4500,10 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, ) { - return (_sqlite3_value_pointer ??= _dylib.lookupFunction< - _c_sqlite3_value_pointer, - _dart_sqlite3_value_pointer>('sqlite3_value_pointer'))( + return (_sqlite3_value_pointer ??= + _lookup>( + 'sqlite3_value_pointer') + .asFunction<_dart_sqlite3_value_pointer>())( arg0, arg1, ); @@ -4434,8 +4515,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_value_text ??= - _dylib.lookupFunction<_c_sqlite3_value_text, _dart_sqlite3_value_text>( - 'sqlite3_value_text'))( + _lookup>('sqlite3_value_text') + .asFunction<_dart_sqlite3_value_text>())( arg0, ); } @@ -4445,9 +4526,10 @@ class SQLite { ffi.Pointer sqlite3_value_text16( ffi.Pointer arg0, ) { - return (_sqlite3_value_text16 ??= _dylib.lookupFunction< - _c_sqlite3_value_text16, - _dart_sqlite3_value_text16>('sqlite3_value_text16'))( + return (_sqlite3_value_text16 ??= + _lookup>( + 'sqlite3_value_text16') + .asFunction<_dart_sqlite3_value_text16>())( arg0, ); } @@ -4457,9 +4539,10 @@ class SQLite { ffi.Pointer sqlite3_value_text16le( ffi.Pointer arg0, ) { - return (_sqlite3_value_text16le ??= _dylib.lookupFunction< - _c_sqlite3_value_text16le, - _dart_sqlite3_value_text16le>('sqlite3_value_text16le'))( + return (_sqlite3_value_text16le ??= + _lookup>( + 'sqlite3_value_text16le') + .asFunction<_dart_sqlite3_value_text16le>())( arg0, ); } @@ -4469,9 +4552,10 @@ class SQLite { ffi.Pointer sqlite3_value_text16be( ffi.Pointer arg0, ) { - return (_sqlite3_value_text16be ??= _dylib.lookupFunction< - _c_sqlite3_value_text16be, - _dart_sqlite3_value_text16be>('sqlite3_value_text16be'))( + return (_sqlite3_value_text16be ??= + _lookup>( + 'sqlite3_value_text16be') + .asFunction<_dart_sqlite3_value_text16be>())( arg0, ); } @@ -4481,9 +4565,10 @@ class SQLite { int sqlite3_value_bytes( ffi.Pointer arg0, ) { - return (_sqlite3_value_bytes ??= _dylib.lookupFunction< - _c_sqlite3_value_bytes, - _dart_sqlite3_value_bytes>('sqlite3_value_bytes'))( + return (_sqlite3_value_bytes ??= + _lookup>( + 'sqlite3_value_bytes') + .asFunction<_dart_sqlite3_value_bytes>())( arg0, ); } @@ -4493,9 +4578,10 @@ class SQLite { int sqlite3_value_bytes16( ffi.Pointer arg0, ) { - return (_sqlite3_value_bytes16 ??= _dylib.lookupFunction< - _c_sqlite3_value_bytes16, - _dart_sqlite3_value_bytes16>('sqlite3_value_bytes16'))( + return (_sqlite3_value_bytes16 ??= + _lookup>( + 'sqlite3_value_bytes16') + .asFunction<_dart_sqlite3_value_bytes16>())( arg0, ); } @@ -4506,8 +4592,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_value_type ??= - _dylib.lookupFunction<_c_sqlite3_value_type, _dart_sqlite3_value_type>( - 'sqlite3_value_type'))( + _lookup>('sqlite3_value_type') + .asFunction<_dart_sqlite3_value_type>())( arg0, ); } @@ -4517,9 +4603,10 @@ class SQLite { int sqlite3_value_numeric_type( ffi.Pointer arg0, ) { - return (_sqlite3_value_numeric_type ??= _dylib.lookupFunction< - _c_sqlite3_value_numeric_type, - _dart_sqlite3_value_numeric_type>('sqlite3_value_numeric_type'))( + return (_sqlite3_value_numeric_type ??= + _lookup>( + 'sqlite3_value_numeric_type') + .asFunction<_dart_sqlite3_value_numeric_type>())( arg0, ); } @@ -4529,9 +4616,10 @@ class SQLite { int sqlite3_value_nochange( ffi.Pointer arg0, ) { - return (_sqlite3_value_nochange ??= _dylib.lookupFunction< - _c_sqlite3_value_nochange, - _dart_sqlite3_value_nochange>('sqlite3_value_nochange'))( + return (_sqlite3_value_nochange ??= + _lookup>( + 'sqlite3_value_nochange') + .asFunction<_dart_sqlite3_value_nochange>())( arg0, ); } @@ -4541,9 +4629,10 @@ class SQLite { int sqlite3_value_frombind( ffi.Pointer arg0, ) { - return (_sqlite3_value_frombind ??= _dylib.lookupFunction< - _c_sqlite3_value_frombind, - _dart_sqlite3_value_frombind>('sqlite3_value_frombind'))( + return (_sqlite3_value_frombind ??= + _lookup>( + 'sqlite3_value_frombind') + .asFunction<_dart_sqlite3_value_frombind>())( arg0, ); } @@ -4561,9 +4650,10 @@ class SQLite { int sqlite3_value_subtype( ffi.Pointer arg0, ) { - return (_sqlite3_value_subtype ??= _dylib.lookupFunction< - _c_sqlite3_value_subtype, - _dart_sqlite3_value_subtype>('sqlite3_value_subtype'))( + return (_sqlite3_value_subtype ??= + _lookup>( + 'sqlite3_value_subtype') + .asFunction<_dart_sqlite3_value_subtype>())( arg0, ); } @@ -4586,8 +4676,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_value_dup ??= - _dylib.lookupFunction<_c_sqlite3_value_dup, _dart_sqlite3_value_dup>( - 'sqlite3_value_dup'))( + _lookup>('sqlite3_value_dup') + .asFunction<_dart_sqlite3_value_dup>())( arg0, ); } @@ -4598,8 +4688,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_value_free ??= - _dylib.lookupFunction<_c_sqlite3_value_free, _dart_sqlite3_value_free>( - 'sqlite3_value_free'))( + _lookup>('sqlite3_value_free') + .asFunction<_dart_sqlite3_value_free>())( arg0, ); } @@ -4651,9 +4741,10 @@ class SQLite { ffi.Pointer arg0, int nBytes, ) { - return (_sqlite3_aggregate_context ??= _dylib.lookupFunction< - _c_sqlite3_aggregate_context, - _dart_sqlite3_aggregate_context>('sqlite3_aggregate_context'))( + return (_sqlite3_aggregate_context ??= + _lookup>( + 'sqlite3_aggregate_context') + .asFunction<_dart_sqlite3_aggregate_context>())( arg0, nBytes, ); @@ -4676,8 +4767,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_user_data ??= - _dylib.lookupFunction<_c_sqlite3_user_data, _dart_sqlite3_user_data>( - 'sqlite3_user_data'))( + _lookup>('sqlite3_user_data') + .asFunction<_dart_sqlite3_user_data>())( arg0, ); } @@ -4695,9 +4786,10 @@ class SQLite { ffi.Pointer sqlite3_context_db_handle( ffi.Pointer arg0, ) { - return (_sqlite3_context_db_handle ??= _dylib.lookupFunction< - _c_sqlite3_context_db_handle, - _dart_sqlite3_context_db_handle>('sqlite3_context_db_handle'))( + return (_sqlite3_context_db_handle ??= + _lookup>( + 'sqlite3_context_db_handle') + .asFunction<_dart_sqlite3_context_db_handle>())( arg0, ); } @@ -4763,9 +4855,10 @@ class SQLite { ffi.Pointer arg0, int N, ) { - return (_sqlite3_get_auxdata ??= _dylib.lookupFunction< - _c_sqlite3_get_auxdata, - _dart_sqlite3_get_auxdata>('sqlite3_get_auxdata'))( + return (_sqlite3_get_auxdata ??= + _lookup>( + 'sqlite3_get_auxdata') + .asFunction<_dart_sqlite3_get_auxdata>())( arg0, N, ); @@ -4779,9 +4872,10 @@ class SQLite { ffi.Pointer arg2, ffi.Pointer> arg3, ) { - return (_sqlite3_set_auxdata ??= _dylib.lookupFunction< - _c_sqlite3_set_auxdata, - _dart_sqlite3_set_auxdata>('sqlite3_set_auxdata'))( + return (_sqlite3_set_auxdata ??= + _lookup>( + 'sqlite3_set_auxdata') + .asFunction<_dart_sqlite3_set_auxdata>())( arg0, N, arg2, @@ -4941,9 +5035,10 @@ class SQLite { int arg2, ffi.Pointer> arg3, ) { - return (_sqlite3_result_blob ??= _dylib.lookupFunction< - _c_sqlite3_result_blob, - _dart_sqlite3_result_blob>('sqlite3_result_blob'))( + return (_sqlite3_result_blob ??= + _lookup>( + 'sqlite3_result_blob') + .asFunction<_dart_sqlite3_result_blob>())( arg0, arg1, arg2, @@ -4959,9 +5054,10 @@ class SQLite { int arg2, ffi.Pointer> arg3, ) { - return (_sqlite3_result_blob64 ??= _dylib.lookupFunction< - _c_sqlite3_result_blob64, - _dart_sqlite3_result_blob64>('sqlite3_result_blob64'))( + return (_sqlite3_result_blob64 ??= + _lookup>( + 'sqlite3_result_blob64') + .asFunction<_dart_sqlite3_result_blob64>())( arg0, arg1, arg2, @@ -4975,9 +5071,10 @@ class SQLite { ffi.Pointer arg0, double arg1, ) { - return (_sqlite3_result_double ??= _dylib.lookupFunction< - _c_sqlite3_result_double, - _dart_sqlite3_result_double>('sqlite3_result_double'))( + return (_sqlite3_result_double ??= + _lookup>( + 'sqlite3_result_double') + .asFunction<_dart_sqlite3_result_double>())( arg0, arg1, ); @@ -4990,9 +5087,10 @@ class SQLite { ffi.Pointer arg1, int arg2, ) { - return (_sqlite3_result_error ??= _dylib.lookupFunction< - _c_sqlite3_result_error, - _dart_sqlite3_result_error>('sqlite3_result_error'))( + return (_sqlite3_result_error ??= + _lookup>( + 'sqlite3_result_error') + .asFunction<_dart_sqlite3_result_error>())( arg0, arg1, arg2, @@ -5006,9 +5104,10 @@ class SQLite { ffi.Pointer arg1, int arg2, ) { - return (_sqlite3_result_error16 ??= _dylib.lookupFunction< - _c_sqlite3_result_error16, - _dart_sqlite3_result_error16>('sqlite3_result_error16'))( + return (_sqlite3_result_error16 ??= + _lookup>( + 'sqlite3_result_error16') + .asFunction<_dart_sqlite3_result_error16>())( arg0, arg1, arg2, @@ -5020,9 +5119,10 @@ class SQLite { void sqlite3_result_error_toobig( ffi.Pointer arg0, ) { - return (_sqlite3_result_error_toobig ??= _dylib.lookupFunction< - _c_sqlite3_result_error_toobig, - _dart_sqlite3_result_error_toobig>('sqlite3_result_error_toobig'))( + return (_sqlite3_result_error_toobig ??= + _lookup>( + 'sqlite3_result_error_toobig') + .asFunction<_dart_sqlite3_result_error_toobig>())( arg0, ); } @@ -5032,9 +5132,10 @@ class SQLite { void sqlite3_result_error_nomem( ffi.Pointer arg0, ) { - return (_sqlite3_result_error_nomem ??= _dylib.lookupFunction< - _c_sqlite3_result_error_nomem, - _dart_sqlite3_result_error_nomem>('sqlite3_result_error_nomem'))( + return (_sqlite3_result_error_nomem ??= + _lookup>( + 'sqlite3_result_error_nomem') + .asFunction<_dart_sqlite3_result_error_nomem>())( arg0, ); } @@ -5045,9 +5146,10 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_result_error_code ??= _dylib.lookupFunction< - _c_sqlite3_result_error_code, - _dart_sqlite3_result_error_code>('sqlite3_result_error_code'))( + return (_sqlite3_result_error_code ??= + _lookup>( + 'sqlite3_result_error_code') + .asFunction<_dart_sqlite3_result_error_code>())( arg0, arg1, ); @@ -5060,8 +5162,8 @@ class SQLite { int arg1, ) { return (_sqlite3_result_int ??= - _dylib.lookupFunction<_c_sqlite3_result_int, _dart_sqlite3_result_int>( - 'sqlite3_result_int'))( + _lookup>('sqlite3_result_int') + .asFunction<_dart_sqlite3_result_int>())( arg0, arg1, ); @@ -5073,9 +5175,10 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_result_int64 ??= _dylib.lookupFunction< - _c_sqlite3_result_int64, - _dart_sqlite3_result_int64>('sqlite3_result_int64'))( + return (_sqlite3_result_int64 ??= + _lookup>( + 'sqlite3_result_int64') + .asFunction<_dart_sqlite3_result_int64>())( arg0, arg1, ); @@ -5086,9 +5189,10 @@ class SQLite { void sqlite3_result_null( ffi.Pointer arg0, ) { - return (_sqlite3_result_null ??= _dylib.lookupFunction< - _c_sqlite3_result_null, - _dart_sqlite3_result_null>('sqlite3_result_null'))( + return (_sqlite3_result_null ??= + _lookup>( + 'sqlite3_result_null') + .asFunction<_dart_sqlite3_result_null>())( arg0, ); } @@ -5101,9 +5205,10 @@ class SQLite { int arg2, ffi.Pointer> arg3, ) { - return (_sqlite3_result_text ??= _dylib.lookupFunction< - _c_sqlite3_result_text, - _dart_sqlite3_result_text>('sqlite3_result_text'))( + return (_sqlite3_result_text ??= + _lookup>( + 'sqlite3_result_text') + .asFunction<_dart_sqlite3_result_text>())( arg0, arg1, arg2, @@ -5120,9 +5225,10 @@ class SQLite { ffi.Pointer> arg3, int encoding, ) { - return (_sqlite3_result_text64 ??= _dylib.lookupFunction< - _c_sqlite3_result_text64, - _dart_sqlite3_result_text64>('sqlite3_result_text64'))( + return (_sqlite3_result_text64 ??= + _lookup>( + 'sqlite3_result_text64') + .asFunction<_dart_sqlite3_result_text64>())( arg0, arg1, arg2, @@ -5139,9 +5245,10 @@ class SQLite { int arg2, ffi.Pointer> arg3, ) { - return (_sqlite3_result_text16 ??= _dylib.lookupFunction< - _c_sqlite3_result_text16, - _dart_sqlite3_result_text16>('sqlite3_result_text16'))( + return (_sqlite3_result_text16 ??= + _lookup>( + 'sqlite3_result_text16') + .asFunction<_dart_sqlite3_result_text16>())( arg0, arg1, arg2, @@ -5157,9 +5264,10 @@ class SQLite { int arg2, ffi.Pointer> arg3, ) { - return (_sqlite3_result_text16le ??= _dylib.lookupFunction< - _c_sqlite3_result_text16le, - _dart_sqlite3_result_text16le>('sqlite3_result_text16le'))( + return (_sqlite3_result_text16le ??= + _lookup>( + 'sqlite3_result_text16le') + .asFunction<_dart_sqlite3_result_text16le>())( arg0, arg1, arg2, @@ -5175,9 +5283,10 @@ class SQLite { int arg2, ffi.Pointer> arg3, ) { - return (_sqlite3_result_text16be ??= _dylib.lookupFunction< - _c_sqlite3_result_text16be, - _dart_sqlite3_result_text16be>('sqlite3_result_text16be'))( + return (_sqlite3_result_text16be ??= + _lookup>( + 'sqlite3_result_text16be') + .asFunction<_dart_sqlite3_result_text16be>())( arg0, arg1, arg2, @@ -5191,9 +5300,10 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, ) { - return (_sqlite3_result_value ??= _dylib.lookupFunction< - _c_sqlite3_result_value, - _dart_sqlite3_result_value>('sqlite3_result_value'))( + return (_sqlite3_result_value ??= + _lookup>( + 'sqlite3_result_value') + .asFunction<_dart_sqlite3_result_value>())( arg0, arg1, ); @@ -5207,9 +5317,10 @@ class SQLite { ffi.Pointer arg2, ffi.Pointer> arg3, ) { - return (_sqlite3_result_pointer ??= _dylib.lookupFunction< - _c_sqlite3_result_pointer, - _dart_sqlite3_result_pointer>('sqlite3_result_pointer'))( + return (_sqlite3_result_pointer ??= + _lookup>( + 'sqlite3_result_pointer') + .asFunction<_dart_sqlite3_result_pointer>())( arg0, arg1, arg2, @@ -5223,9 +5334,10 @@ class SQLite { ffi.Pointer arg0, int n, ) { - return (_sqlite3_result_zeroblob ??= _dylib.lookupFunction< - _c_sqlite3_result_zeroblob, - _dart_sqlite3_result_zeroblob>('sqlite3_result_zeroblob'))( + return (_sqlite3_result_zeroblob ??= + _lookup>( + 'sqlite3_result_zeroblob') + .asFunction<_dart_sqlite3_result_zeroblob>())( arg0, n, ); @@ -5237,9 +5349,10 @@ class SQLite { ffi.Pointer arg0, int n, ) { - return (_sqlite3_result_zeroblob64 ??= _dylib.lookupFunction< - _c_sqlite3_result_zeroblob64, - _dart_sqlite3_result_zeroblob64>('sqlite3_result_zeroblob64'))( + return (_sqlite3_result_zeroblob64 ??= + _lookup>( + 'sqlite3_result_zeroblob64') + .asFunction<_dart_sqlite3_result_zeroblob64>())( arg0, n, ); @@ -5261,9 +5374,10 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_result_subtype ??= _dylib.lookupFunction< - _c_sqlite3_result_subtype, - _dart_sqlite3_result_subtype>('sqlite3_result_subtype'))( + return (_sqlite3_result_subtype ??= + _lookup>( + 'sqlite3_result_subtype') + .asFunction<_dart_sqlite3_result_subtype>())( arg0, arg1, ); @@ -5357,9 +5471,10 @@ class SQLite { ffi.Pointer pArg, ffi.Pointer> xCompare, ) { - return (_sqlite3_create_collation ??= _dylib.lookupFunction< - _c_sqlite3_create_collation, - _dart_sqlite3_create_collation>('sqlite3_create_collation'))( + return (_sqlite3_create_collation ??= + _lookup>( + 'sqlite3_create_collation') + .asFunction<_dart_sqlite3_create_collation>())( arg0, zName, eTextRep, @@ -5378,9 +5493,10 @@ class SQLite { ffi.Pointer> xCompare, ffi.Pointer> xDestroy, ) { - return (_sqlite3_create_collation_v2 ??= _dylib.lookupFunction< - _c_sqlite3_create_collation_v2, - _dart_sqlite3_create_collation_v2>('sqlite3_create_collation_v2'))( + return (_sqlite3_create_collation_v2 ??= + _lookup>( + 'sqlite3_create_collation_v2') + .asFunction<_dart_sqlite3_create_collation_v2>())( arg0, zName, eTextRep, @@ -5399,9 +5515,10 @@ class SQLite { ffi.Pointer pArg, ffi.Pointer> xCompare, ) { - return (_sqlite3_create_collation16 ??= _dylib.lookupFunction< - _c_sqlite3_create_collation16, - _dart_sqlite3_create_collation16>('sqlite3_create_collation16'))( + return (_sqlite3_create_collation16 ??= + _lookup>( + 'sqlite3_create_collation16') + .asFunction<_dart_sqlite3_create_collation16>())( arg0, zName, eTextRep, @@ -5442,9 +5559,10 @@ class SQLite { ffi.Pointer arg1, ffi.Pointer> arg2, ) { - return (_sqlite3_collation_needed ??= _dylib.lookupFunction< - _c_sqlite3_collation_needed, - _dart_sqlite3_collation_needed>('sqlite3_collation_needed'))( + return (_sqlite3_collation_needed ??= + _lookup>( + 'sqlite3_collation_needed') + .asFunction<_dart_sqlite3_collation_needed>())( arg0, arg1, arg2, @@ -5458,9 +5576,10 @@ class SQLite { ffi.Pointer arg1, ffi.Pointer> arg2, ) { - return (_sqlite3_collation_needed16 ??= _dylib.lookupFunction< - _c_sqlite3_collation_needed16, - _dart_sqlite3_collation_needed16>('sqlite3_collation_needed16'))( + return (_sqlite3_collation_needed16 ??= + _lookup>( + 'sqlite3_collation_needed16') + .asFunction<_dart_sqlite3_collation_needed16>())( arg0, arg1, arg2, @@ -5488,8 +5607,8 @@ class SQLite { int arg0, ) { return (_sqlite3_sleep ??= - _dylib.lookupFunction<_c_sqlite3_sleep, _dart_sqlite3_sleep>( - 'sqlite3_sleep'))( + _lookup>('sqlite3_sleep') + .asFunction<_dart_sqlite3_sleep>())( arg0, ); } @@ -5551,7 +5670,7 @@ class SQLite { /// sqlite3_temp_directory = sqlite3_mprintf("%s", zPathBuf); /// late final ffi.Pointer> _sqlite3_temp_directory = - _dylib.lookup>('sqlite3_temp_directory'); + _lookup>('sqlite3_temp_directory'); ffi.Pointer get sqlite3_temp_directory => _sqlite3_temp_directory.value; @@ -5593,7 +5712,7 @@ class SQLite { /// made NULL or made to point to memory obtained from [sqlite3_malloc] /// or else the use of the [data_store_directory pragma] should be avoided. late final ffi.Pointer> _sqlite3_data_directory = - _dylib.lookup>('sqlite3_data_directory'); + _lookup>('sqlite3_data_directory'); ffi.Pointer get sqlite3_data_directory => _sqlite3_data_directory.value; @@ -5622,9 +5741,10 @@ class SQLite { int type, ffi.Pointer zValue, ) { - return (_sqlite3_win32_set_directory ??= _dylib.lookupFunction< - _c_sqlite3_win32_set_directory, - _dart_sqlite3_win32_set_directory>('sqlite3_win32_set_directory'))( + return (_sqlite3_win32_set_directory ??= + _lookup>( + 'sqlite3_win32_set_directory') + .asFunction<_dart_sqlite3_win32_set_directory>())( type, zValue, ); @@ -5636,9 +5756,10 @@ class SQLite { int type, ffi.Pointer zValue, ) { - return (_sqlite3_win32_set_directory8 ??= _dylib.lookupFunction< - _c_sqlite3_win32_set_directory8, - _dart_sqlite3_win32_set_directory8>('sqlite3_win32_set_directory8'))( + return (_sqlite3_win32_set_directory8 ??= + _lookup>( + 'sqlite3_win32_set_directory8') + .asFunction<_dart_sqlite3_win32_set_directory8>())( type, zValue, ); @@ -5650,9 +5771,10 @@ class SQLite { int type, ffi.Pointer zValue, ) { - return (_sqlite3_win32_set_directory16 ??= _dylib.lookupFunction< - _c_sqlite3_win32_set_directory16, - _dart_sqlite3_win32_set_directory16>('sqlite3_win32_set_directory16'))( + return (_sqlite3_win32_set_directory16 ??= + _lookup>( + 'sqlite3_win32_set_directory16') + .asFunction<_dart_sqlite3_win32_set_directory16>())( type, zValue, ); @@ -5683,9 +5805,10 @@ class SQLite { int sqlite3_get_autocommit( ffi.Pointer arg0, ) { - return (_sqlite3_get_autocommit ??= _dylib.lookupFunction< - _c_sqlite3_get_autocommit, - _dart_sqlite3_get_autocommit>('sqlite3_get_autocommit'))( + return (_sqlite3_get_autocommit ??= + _lookup>( + 'sqlite3_get_autocommit') + .asFunction<_dart_sqlite3_get_autocommit>())( arg0, ); } @@ -5705,8 +5828,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_db_handle ??= - _dylib.lookupFunction<_c_sqlite3_db_handle, _dart_sqlite3_db_handle>( - 'sqlite3_db_handle'))( + _lookup>('sqlite3_db_handle') + .asFunction<_dart_sqlite3_db_handle>())( arg0, ); } @@ -5745,9 +5868,10 @@ class SQLite { ffi.Pointer db, ffi.Pointer zDbName, ) { - return (_sqlite3_db_filename ??= _dylib.lookupFunction< - _c_sqlite3_db_filename, - _dart_sqlite3_db_filename>('sqlite3_db_filename'))( + return (_sqlite3_db_filename ??= + _lookup>( + 'sqlite3_db_filename') + .asFunction<_dart_sqlite3_db_filename>())( db, zDbName, ); @@ -5765,9 +5889,10 @@ class SQLite { ffi.Pointer db, ffi.Pointer zDbName, ) { - return (_sqlite3_db_readonly ??= _dylib.lookupFunction< - _c_sqlite3_db_readonly, - _dart_sqlite3_db_readonly>('sqlite3_db_readonly'))( + return (_sqlite3_db_readonly ??= + _lookup>( + 'sqlite3_db_readonly') + .asFunction<_dart_sqlite3_db_readonly>())( db, zDbName, ); @@ -5792,8 +5917,8 @@ class SQLite { ffi.Pointer pStmt, ) { return (_sqlite3_next_stmt ??= - _dylib.lookupFunction<_c_sqlite3_next_stmt, _dart_sqlite3_next_stmt>( - 'sqlite3_next_stmt'))( + _lookup>('sqlite3_next_stmt') + .asFunction<_dart_sqlite3_next_stmt>())( pDb, pStmt, ); @@ -5851,9 +5976,10 @@ class SQLite { ffi.Pointer> arg1, ffi.Pointer arg2, ) { - return (_sqlite3_commit_hook ??= _dylib.lookupFunction< - _c_sqlite3_commit_hook, - _dart_sqlite3_commit_hook>('sqlite3_commit_hook'))( + return (_sqlite3_commit_hook ??= + _lookup>( + 'sqlite3_commit_hook') + .asFunction<_dart_sqlite3_commit_hook>())( arg0, arg1, arg2, @@ -5867,9 +5993,10 @@ class SQLite { ffi.Pointer> arg1, ffi.Pointer arg2, ) { - return (_sqlite3_rollback_hook ??= _dylib.lookupFunction< - _c_sqlite3_rollback_hook, - _dart_sqlite3_rollback_hook>('sqlite3_rollback_hook'))( + return (_sqlite3_rollback_hook ??= + _lookup>( + 'sqlite3_rollback_hook') + .asFunction<_dart_sqlite3_rollback_hook>())( arg0, arg1, arg2, @@ -5930,9 +6057,10 @@ class SQLite { ffi.Pointer> arg1, ffi.Pointer arg2, ) { - return (_sqlite3_update_hook ??= _dylib.lookupFunction< - _c_sqlite3_update_hook, - _dart_sqlite3_update_hook>('sqlite3_update_hook'))( + return (_sqlite3_update_hook ??= + _lookup>( + 'sqlite3_update_hook') + .asFunction<_dart_sqlite3_update_hook>())( arg0, arg1, arg2, @@ -5981,9 +6109,10 @@ class SQLite { int sqlite3_enable_shared_cache( int arg0, ) { - return (_sqlite3_enable_shared_cache ??= _dylib.lookupFunction< - _c_sqlite3_enable_shared_cache, - _dart_sqlite3_enable_shared_cache>('sqlite3_enable_shared_cache'))( + return (_sqlite3_enable_shared_cache ??= + _lookup>( + 'sqlite3_enable_shared_cache') + .asFunction<_dart_sqlite3_enable_shared_cache>())( arg0, ); } @@ -6005,9 +6134,10 @@ class SQLite { int sqlite3_release_memory( int arg0, ) { - return (_sqlite3_release_memory ??= _dylib.lookupFunction< - _c_sqlite3_release_memory, - _dart_sqlite3_release_memory>('sqlite3_release_memory'))( + return (_sqlite3_release_memory ??= + _lookup>( + 'sqlite3_release_memory') + .asFunction<_dart_sqlite3_release_memory>())( arg0, ); } @@ -6027,9 +6157,10 @@ class SQLite { int sqlite3_db_release_memory( ffi.Pointer arg0, ) { - return (_sqlite3_db_release_memory ??= _dylib.lookupFunction< - _c_sqlite3_db_release_memory, - _dart_sqlite3_db_release_memory>('sqlite3_db_release_memory'))( + return (_sqlite3_db_release_memory ??= + _lookup>( + 'sqlite3_db_release_memory') + .asFunction<_dart_sqlite3_db_release_memory>())( arg0, ); } @@ -6101,9 +6232,10 @@ class SQLite { int sqlite3_soft_heap_limit64( int N, ) { - return (_sqlite3_soft_heap_limit64 ??= _dylib.lookupFunction< - _c_sqlite3_soft_heap_limit64, - _dart_sqlite3_soft_heap_limit64>('sqlite3_soft_heap_limit64'))( + return (_sqlite3_soft_heap_limit64 ??= + _lookup>( + 'sqlite3_soft_heap_limit64') + .asFunction<_dart_sqlite3_soft_heap_limit64>())( N, ); } @@ -6113,9 +6245,10 @@ class SQLite { int sqlite3_hard_heap_limit64( int N, ) { - return (_sqlite3_hard_heap_limit64 ??= _dylib.lookupFunction< - _c_sqlite3_hard_heap_limit64, - _dart_sqlite3_hard_heap_limit64>('sqlite3_hard_heap_limit64'))( + return (_sqlite3_hard_heap_limit64 ??= + _lookup>( + 'sqlite3_hard_heap_limit64') + .asFunction<_dart_sqlite3_hard_heap_limit64>())( N, ); } @@ -6132,9 +6265,10 @@ class SQLite { void sqlite3_soft_heap_limit( int N, ) { - return (_sqlite3_soft_heap_limit ??= _dylib.lookupFunction< - _c_sqlite3_soft_heap_limit, - _dart_sqlite3_soft_heap_limit>('sqlite3_soft_heap_limit'))( + return (_sqlite3_soft_heap_limit ??= + _lookup>( + 'sqlite3_soft_heap_limit') + .asFunction<_dart_sqlite3_soft_heap_limit>())( N, ); } @@ -6219,9 +6353,10 @@ class SQLite { ffi.Pointer pPrimaryKey, ffi.Pointer pAutoinc, ) { - return (_sqlite3_table_column_metadata ??= _dylib.lookupFunction< - _c_sqlite3_table_column_metadata, - _dart_sqlite3_table_column_metadata>('sqlite3_table_column_metadata'))( + return (_sqlite3_table_column_metadata ??= + _lookup>( + 'sqlite3_table_column_metadata') + .asFunction<_dart_sqlite3_table_column_metadata>())( db, zDbName, zTableName, @@ -6284,9 +6419,10 @@ class SQLite { ffi.Pointer zProc, ffi.Pointer> pzErrMsg, ) { - return (_sqlite3_load_extension ??= _dylib.lookupFunction< - _c_sqlite3_load_extension, - _dart_sqlite3_load_extension>('sqlite3_load_extension'))( + return (_sqlite3_load_extension ??= + _lookup>( + 'sqlite3_load_extension') + .asFunction<_dart_sqlite3_load_extension>())( db, zFile, zProc, @@ -6323,9 +6459,10 @@ class SQLite { ffi.Pointer db, int onoff, ) { - return (_sqlite3_enable_load_extension ??= _dylib.lookupFunction< - _c_sqlite3_enable_load_extension, - _dart_sqlite3_enable_load_extension>('sqlite3_enable_load_extension'))( + return (_sqlite3_enable_load_extension ??= + _lookup>( + 'sqlite3_enable_load_extension') + .asFunction<_dart_sqlite3_enable_load_extension>())( db, onoff, ); @@ -6370,9 +6507,10 @@ class SQLite { int sqlite3_auto_extension( ffi.Pointer> xEntryPoint, ) { - return (_sqlite3_auto_extension ??= _dylib.lookupFunction< - _c_sqlite3_auto_extension, - _dart_sqlite3_auto_extension>('sqlite3_auto_extension'))( + return (_sqlite3_auto_extension ??= + _lookup>( + 'sqlite3_auto_extension') + .asFunction<_dart_sqlite3_auto_extension>())( xEntryPoint, ); } @@ -6390,9 +6528,10 @@ class SQLite { int sqlite3_cancel_auto_extension( ffi.Pointer> xEntryPoint, ) { - return (_sqlite3_cancel_auto_extension ??= _dylib.lookupFunction< - _c_sqlite3_cancel_auto_extension, - _dart_sqlite3_cancel_auto_extension>('sqlite3_cancel_auto_extension'))( + return (_sqlite3_cancel_auto_extension ??= + _lookup>( + 'sqlite3_cancel_auto_extension') + .asFunction<_dart_sqlite3_cancel_auto_extension>())( xEntryPoint, ); } @@ -6404,9 +6543,10 @@ class SQLite { /// ^This interface disables all automatic extensions previously /// registered using [sqlite3_auto_extension()]. void sqlite3_reset_auto_extension() { - return (_sqlite3_reset_auto_extension ??= _dylib.lookupFunction< - _c_sqlite3_reset_auto_extension, - _dart_sqlite3_reset_auto_extension>('sqlite3_reset_auto_extension'))(); + return (_sqlite3_reset_auto_extension ??= + _lookup>( + 'sqlite3_reset_auto_extension') + .asFunction<_dart_sqlite3_reset_auto_extension>())(); } _dart_sqlite3_reset_auto_extension? _sqlite3_reset_auto_extension; @@ -6447,9 +6587,10 @@ class SQLite { ffi.Pointer p, ffi.Pointer pClientData, ) { - return (_sqlite3_create_module ??= _dylib.lookupFunction< - _c_sqlite3_create_module, - _dart_sqlite3_create_module>('sqlite3_create_module'))( + return (_sqlite3_create_module ??= + _lookup>( + 'sqlite3_create_module') + .asFunction<_dart_sqlite3_create_module>())( db, zName, p, @@ -6466,9 +6607,10 @@ class SQLite { ffi.Pointer pClientData, ffi.Pointer> xDestroy, ) { - return (_sqlite3_create_module_v2 ??= _dylib.lookupFunction< - _c_sqlite3_create_module_v2, - _dart_sqlite3_create_module_v2>('sqlite3_create_module_v2'))( + return (_sqlite3_create_module_v2 ??= + _lookup>( + 'sqlite3_create_module_v2') + .asFunction<_dart_sqlite3_create_module_v2>())( db, zName, p, @@ -6493,9 +6635,10 @@ class SQLite { ffi.Pointer db, ffi.Pointer> azKeep, ) { - return (_sqlite3_drop_modules ??= _dylib.lookupFunction< - _c_sqlite3_drop_modules, - _dart_sqlite3_drop_modules>('sqlite3_drop_modules'))( + return (_sqlite3_drop_modules ??= + _lookup>( + 'sqlite3_drop_modules') + .asFunction<_dart_sqlite3_drop_modules>())( db, azKeep, ); @@ -6513,9 +6656,10 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer zSQL, ) { - return (_sqlite3_declare_vtab ??= _dylib.lookupFunction< - _c_sqlite3_declare_vtab, - _dart_sqlite3_declare_vtab>('sqlite3_declare_vtab'))( + return (_sqlite3_declare_vtab ??= + _lookup>( + 'sqlite3_declare_vtab') + .asFunction<_dart_sqlite3_declare_vtab>())( arg0, zSQL, ); @@ -6543,9 +6687,10 @@ class SQLite { ffi.Pointer zFuncName, int nArg, ) { - return (_sqlite3_overload_function ??= _dylib.lookupFunction< - _c_sqlite3_overload_function, - _dart_sqlite3_overload_function>('sqlite3_overload_function'))( + return (_sqlite3_overload_function ??= + _lookup>( + 'sqlite3_overload_function') + .asFunction<_dart_sqlite3_overload_function>())( arg0, zFuncName, nArg, @@ -6645,8 +6790,8 @@ class SQLite { ffi.Pointer> ppBlob, ) { return (_sqlite3_blob_open ??= - _dylib.lookupFunction<_c_sqlite3_blob_open, _dart_sqlite3_blob_open>( - 'sqlite3_blob_open'))( + _lookup>('sqlite3_blob_open') + .asFunction<_dart_sqlite3_blob_open>())( arg0, zDb, zTable, @@ -6684,9 +6829,10 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_blob_reopen ??= _dylib.lookupFunction< - _c_sqlite3_blob_reopen, - _dart_sqlite3_blob_reopen>('sqlite3_blob_reopen'))( + return (_sqlite3_blob_reopen ??= + _lookup>( + 'sqlite3_blob_reopen') + .asFunction<_dart_sqlite3_blob_reopen>())( arg0, arg1, ); @@ -6717,8 +6863,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_blob_close ??= - _dylib.lookupFunction<_c_sqlite3_blob_close, _dart_sqlite3_blob_close>( - 'sqlite3_blob_close'))( + _lookup>('sqlite3_blob_close') + .asFunction<_dart_sqlite3_blob_close>())( arg0, ); } @@ -6741,8 +6887,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_blob_bytes ??= - _dylib.lookupFunction<_c_sqlite3_blob_bytes, _dart_sqlite3_blob_bytes>( - 'sqlite3_blob_bytes'))( + _lookup>('sqlite3_blob_bytes') + .asFunction<_dart_sqlite3_blob_bytes>())( arg0, ); } @@ -6781,8 +6927,8 @@ class SQLite { int iOffset, ) { return (_sqlite3_blob_read ??= - _dylib.lookupFunction<_c_sqlite3_blob_read, _dart_sqlite3_blob_read>( - 'sqlite3_blob_read'))( + _lookup>('sqlite3_blob_read') + .asFunction<_dart_sqlite3_blob_read>())( arg0, Z, N, @@ -6837,8 +6983,8 @@ class SQLite { int iOffset, ) { return (_sqlite3_blob_write ??= - _dylib.lookupFunction<_c_sqlite3_blob_write, _dart_sqlite3_blob_write>( - 'sqlite3_blob_write'))( + _lookup>('sqlite3_blob_write') + .asFunction<_dart_sqlite3_blob_write>())( arg0, z, n, @@ -6879,8 +7025,8 @@ class SQLite { ffi.Pointer zVfsName, ) { return (_sqlite3_vfs_find ??= - _dylib.lookupFunction<_c_sqlite3_vfs_find, _dart_sqlite3_vfs_find>( - 'sqlite3_vfs_find'))( + _lookup>('sqlite3_vfs_find') + .asFunction<_dart_sqlite3_vfs_find>())( zVfsName, ); } @@ -6891,9 +7037,10 @@ class SQLite { ffi.Pointer arg0, int makeDflt, ) { - return (_sqlite3_vfs_register ??= _dylib.lookupFunction< - _c_sqlite3_vfs_register, - _dart_sqlite3_vfs_register>('sqlite3_vfs_register'))( + return (_sqlite3_vfs_register ??= + _lookup>( + 'sqlite3_vfs_register') + .asFunction<_dart_sqlite3_vfs_register>())( arg0, makeDflt, ); @@ -6904,9 +7051,10 @@ class SQLite { int sqlite3_vfs_unregister( ffi.Pointer arg0, ) { - return (_sqlite3_vfs_unregister ??= _dylib.lookupFunction< - _c_sqlite3_vfs_unregister, - _dart_sqlite3_vfs_unregister>('sqlite3_vfs_unregister'))( + return (_sqlite3_vfs_unregister ??= + _lookup>( + 'sqlite3_vfs_unregister') + .asFunction<_dart_sqlite3_vfs_unregister>())( arg0, ); } @@ -7028,9 +7176,10 @@ class SQLite { ffi.Pointer sqlite3_mutex_alloc( int arg0, ) { - return (_sqlite3_mutex_alloc ??= _dylib.lookupFunction< - _c_sqlite3_mutex_alloc, - _dart_sqlite3_mutex_alloc>('sqlite3_mutex_alloc'))( + return (_sqlite3_mutex_alloc ??= + _lookup>( + 'sqlite3_mutex_alloc') + .asFunction<_dart_sqlite3_mutex_alloc>())( arg0, ); } @@ -7041,8 +7190,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_mutex_free ??= - _dylib.lookupFunction<_c_sqlite3_mutex_free, _dart_sqlite3_mutex_free>( - 'sqlite3_mutex_free'))( + _lookup>('sqlite3_mutex_free') + .asFunction<_dart_sqlite3_mutex_free>())( arg0, ); } @@ -7052,9 +7201,10 @@ class SQLite { void sqlite3_mutex_enter( ffi.Pointer arg0, ) { - return (_sqlite3_mutex_enter ??= _dylib.lookupFunction< - _c_sqlite3_mutex_enter, - _dart_sqlite3_mutex_enter>('sqlite3_mutex_enter'))( + return (_sqlite3_mutex_enter ??= + _lookup>( + 'sqlite3_mutex_enter') + .asFunction<_dart_sqlite3_mutex_enter>())( arg0, ); } @@ -7065,8 +7215,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_mutex_try ??= - _dylib.lookupFunction<_c_sqlite3_mutex_try, _dart_sqlite3_mutex_try>( - 'sqlite3_mutex_try'))( + _lookup>('sqlite3_mutex_try') + .asFunction<_dart_sqlite3_mutex_try>())( arg0, ); } @@ -7076,9 +7226,10 @@ class SQLite { void sqlite3_mutex_leave( ffi.Pointer arg0, ) { - return (_sqlite3_mutex_leave ??= _dylib.lookupFunction< - _c_sqlite3_mutex_leave, - _dart_sqlite3_mutex_leave>('sqlite3_mutex_leave'))( + return (_sqlite3_mutex_leave ??= + _lookup>( + 'sqlite3_mutex_leave') + .asFunction<_dart_sqlite3_mutex_leave>())( arg0, ); } @@ -7089,8 +7240,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_mutex_held ??= - _dylib.lookupFunction<_c_sqlite3_mutex_held, _dart_sqlite3_mutex_held>( - 'sqlite3_mutex_held'))( + _lookup>('sqlite3_mutex_held') + .asFunction<_dart_sqlite3_mutex_held>())( arg0, ); } @@ -7100,9 +7251,10 @@ class SQLite { int sqlite3_mutex_notheld( ffi.Pointer arg0, ) { - return (_sqlite3_mutex_notheld ??= _dylib.lookupFunction< - _c_sqlite3_mutex_notheld, - _dart_sqlite3_mutex_notheld>('sqlite3_mutex_notheld'))( + return (_sqlite3_mutex_notheld ??= + _lookup>( + 'sqlite3_mutex_notheld') + .asFunction<_dart_sqlite3_mutex_notheld>())( arg0, ); } @@ -7121,8 +7273,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_db_mutex ??= - _dylib.lookupFunction<_c_sqlite3_db_mutex, _dart_sqlite3_db_mutex>( - 'sqlite3_db_mutex'))( + _lookup>('sqlite3_db_mutex') + .asFunction<_dart_sqlite3_db_mutex>())( arg0, ); } @@ -7174,9 +7326,10 @@ class SQLite { int op, ffi.Pointer arg3, ) { - return (_sqlite3_file_control ??= _dylib.lookupFunction< - _c_sqlite3_file_control, - _dart_sqlite3_file_control>('sqlite3_file_control'))( + return (_sqlite3_file_control ??= + _lookup>( + 'sqlite3_file_control') + .asFunction<_dart_sqlite3_file_control>())( arg0, zDbName, op, @@ -7204,9 +7357,10 @@ class SQLite { int sqlite3_test_control( int op, ) { - return (_sqlite3_test_control ??= _dylib.lookupFunction< - _c_sqlite3_test_control, - _dart_sqlite3_test_control>('sqlite3_test_control'))( + return (_sqlite3_test_control ??= + _lookup>( + 'sqlite3_test_control') + .asFunction<_dart_sqlite3_test_control>())( op, ); } @@ -7259,9 +7413,10 @@ class SQLite { /// SQLite is compiled with the [-DSQLITE_OMIT_VACUUM] option. Also, /// new keywords may be added to future releases of SQLite. int sqlite3_keyword_count() { - return (_sqlite3_keyword_count ??= _dylib.lookupFunction< - _c_sqlite3_keyword_count, - _dart_sqlite3_keyword_count>('sqlite3_keyword_count'))(); + return (_sqlite3_keyword_count ??= + _lookup>( + 'sqlite3_keyword_count') + .asFunction<_dart_sqlite3_keyword_count>())(); } _dart_sqlite3_keyword_count? _sqlite3_keyword_count; @@ -7271,9 +7426,10 @@ class SQLite { ffi.Pointer> arg1, ffi.Pointer arg2, ) { - return (_sqlite3_keyword_name ??= _dylib.lookupFunction< - _c_sqlite3_keyword_name, - _dart_sqlite3_keyword_name>('sqlite3_keyword_name'))( + return (_sqlite3_keyword_name ??= + _lookup>( + 'sqlite3_keyword_name') + .asFunction<_dart_sqlite3_keyword_name>())( arg0, arg1, arg2, @@ -7286,9 +7442,10 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_keyword_check ??= _dylib.lookupFunction< - _c_sqlite3_keyword_check, - _dart_sqlite3_keyword_check>('sqlite3_keyword_check'))( + return (_sqlite3_keyword_check ??= + _lookup>( + 'sqlite3_keyword_check') + .asFunction<_dart_sqlite3_keyword_check>())( arg0, arg1, ); @@ -7323,8 +7480,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_str_new ??= - _dylib.lookupFunction<_c_sqlite3_str_new, _dart_sqlite3_str_new>( - 'sqlite3_str_new'))( + _lookup>('sqlite3_str_new') + .asFunction<_dart_sqlite3_str_new>())( arg0, ); } @@ -7346,8 +7503,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_str_finish ??= - _dylib.lookupFunction<_c_sqlite3_str_finish, _dart_sqlite3_str_finish>( - 'sqlite3_str_finish'))( + _lookup>('sqlite3_str_finish') + .asFunction<_dart_sqlite3_str_finish>())( arg0, ); } @@ -7388,9 +7545,10 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer zFormat, ) { - return (_sqlite3_str_appendf ??= _dylib.lookupFunction< - _c_sqlite3_str_appendf, - _dart_sqlite3_str_appendf>('sqlite3_str_appendf'))( + return (_sqlite3_str_appendf ??= + _lookup>( + 'sqlite3_str_appendf') + .asFunction<_dart_sqlite3_str_appendf>())( arg0, zFormat, ); @@ -7404,8 +7562,8 @@ class SQLite { int N, ) { return (_sqlite3_str_append ??= - _dylib.lookupFunction<_c_sqlite3_str_append, _dart_sqlite3_str_append>( - 'sqlite3_str_append'))( + _lookup>('sqlite3_str_append') + .asFunction<_dart_sqlite3_str_append>())( arg0, zIn, N, @@ -7418,9 +7576,10 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer zIn, ) { - return (_sqlite3_str_appendall ??= _dylib.lookupFunction< - _c_sqlite3_str_appendall, - _dart_sqlite3_str_appendall>('sqlite3_str_appendall'))( + return (_sqlite3_str_appendall ??= + _lookup>( + 'sqlite3_str_appendall') + .asFunction<_dart_sqlite3_str_appendall>())( arg0, zIn, ); @@ -7433,9 +7592,10 @@ class SQLite { int N, int C, ) { - return (_sqlite3_str_appendchar ??= _dylib.lookupFunction< - _c_sqlite3_str_appendchar, - _dart_sqlite3_str_appendchar>('sqlite3_str_appendchar'))( + return (_sqlite3_str_appendchar ??= + _lookup>( + 'sqlite3_str_appendchar') + .asFunction<_dart_sqlite3_str_appendchar>())( arg0, N, C, @@ -7448,8 +7608,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_str_reset ??= - _dylib.lookupFunction<_c_sqlite3_str_reset, _dart_sqlite3_str_reset>( - 'sqlite3_str_reset'))( + _lookup>('sqlite3_str_reset') + .asFunction<_dart_sqlite3_str_reset>())( arg0, ); } @@ -7486,9 +7646,10 @@ class SQLite { int sqlite3_str_errcode( ffi.Pointer arg0, ) { - return (_sqlite3_str_errcode ??= _dylib.lookupFunction< - _c_sqlite3_str_errcode, - _dart_sqlite3_str_errcode>('sqlite3_str_errcode'))( + return (_sqlite3_str_errcode ??= + _lookup>( + 'sqlite3_str_errcode') + .asFunction<_dart_sqlite3_str_errcode>())( arg0, ); } @@ -7499,8 +7660,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_str_length ??= - _dylib.lookupFunction<_c_sqlite3_str_length, _dart_sqlite3_str_length>( - 'sqlite3_str_length'))( + _lookup>('sqlite3_str_length') + .asFunction<_dart_sqlite3_str_length>())( arg0, ); } @@ -7511,8 +7672,8 @@ class SQLite { ffi.Pointer arg0, ) { return (_sqlite3_str_value ??= - _dylib.lookupFunction<_c_sqlite3_str_value, _dart_sqlite3_str_value>( - 'sqlite3_str_value'))( + _lookup>('sqlite3_str_value') + .asFunction<_dart_sqlite3_str_value>())( arg0, ); } @@ -7550,8 +7711,8 @@ class SQLite { int resetFlag, ) { return (_sqlite3_status ??= - _dylib.lookupFunction<_c_sqlite3_status, _dart_sqlite3_status>( - 'sqlite3_status'))( + _lookup>('sqlite3_status') + .asFunction<_dart_sqlite3_status>())( op, pCurrent, pHighwater, @@ -7568,8 +7729,8 @@ class SQLite { int resetFlag, ) { return (_sqlite3_status64 ??= - _dylib.lookupFunction<_c_sqlite3_status64, _dart_sqlite3_status64>( - 'sqlite3_status64'))( + _lookup>('sqlite3_status64') + .asFunction<_dart_sqlite3_status64>())( op, pCurrent, pHighwater, @@ -7608,8 +7769,8 @@ class SQLite { int resetFlg, ) { return (_sqlite3_db_status ??= - _dylib.lookupFunction<_c_sqlite3_db_status, _dart_sqlite3_db_status>( - 'sqlite3_db_status'))( + _lookup>('sqlite3_db_status') + .asFunction<_dart_sqlite3_db_status>())( arg0, op, pCur, @@ -7647,9 +7808,10 @@ class SQLite { int op, int resetFlg, ) { - return (_sqlite3_stmt_status ??= _dylib.lookupFunction< - _c_sqlite3_stmt_status, - _dart_sqlite3_stmt_status>('sqlite3_stmt_status'))( + return (_sqlite3_stmt_status ??= + _lookup>( + 'sqlite3_stmt_status') + .asFunction<_dart_sqlite3_stmt_status>())( arg0, op, resetFlg, @@ -7848,9 +8010,10 @@ class SQLite { ffi.Pointer pSource, ffi.Pointer zSourceName, ) { - return (_sqlite3_backup_init ??= _dylib.lookupFunction< - _c_sqlite3_backup_init, - _dart_sqlite3_backup_init>('sqlite3_backup_init'))( + return (_sqlite3_backup_init ??= + _lookup>( + 'sqlite3_backup_init') + .asFunction<_dart_sqlite3_backup_init>())( pDest, zDestName, pSource, @@ -7864,9 +8027,10 @@ class SQLite { ffi.Pointer p, int nPage, ) { - return (_sqlite3_backup_step ??= _dylib.lookupFunction< - _c_sqlite3_backup_step, - _dart_sqlite3_backup_step>('sqlite3_backup_step'))( + return (_sqlite3_backup_step ??= + _lookup>( + 'sqlite3_backup_step') + .asFunction<_dart_sqlite3_backup_step>())( p, nPage, ); @@ -7877,9 +8041,10 @@ class SQLite { int sqlite3_backup_finish( ffi.Pointer p, ) { - return (_sqlite3_backup_finish ??= _dylib.lookupFunction< - _c_sqlite3_backup_finish, - _dart_sqlite3_backup_finish>('sqlite3_backup_finish'))( + return (_sqlite3_backup_finish ??= + _lookup>( + 'sqlite3_backup_finish') + .asFunction<_dart_sqlite3_backup_finish>())( p, ); } @@ -7889,9 +8054,10 @@ class SQLite { int sqlite3_backup_remaining( ffi.Pointer p, ) { - return (_sqlite3_backup_remaining ??= _dylib.lookupFunction< - _c_sqlite3_backup_remaining, - _dart_sqlite3_backup_remaining>('sqlite3_backup_remaining'))( + return (_sqlite3_backup_remaining ??= + _lookup>( + 'sqlite3_backup_remaining') + .asFunction<_dart_sqlite3_backup_remaining>())( p, ); } @@ -7901,9 +8067,10 @@ class SQLite { int sqlite3_backup_pagecount( ffi.Pointer p, ) { - return (_sqlite3_backup_pagecount ??= _dylib.lookupFunction< - _c_sqlite3_backup_pagecount, - _dart_sqlite3_backup_pagecount>('sqlite3_backup_pagecount'))( + return (_sqlite3_backup_pagecount ??= + _lookup>( + 'sqlite3_backup_pagecount') + .asFunction<_dart_sqlite3_backup_pagecount>())( p, ); } @@ -8028,9 +8195,10 @@ class SQLite { ffi.Pointer> xNotify, ffi.Pointer pNotifyArg, ) { - return (_sqlite3_unlock_notify ??= _dylib.lookupFunction< - _c_sqlite3_unlock_notify, - _dart_sqlite3_unlock_notify>('sqlite3_unlock_notify'))( + return (_sqlite3_unlock_notify ??= + _lookup>( + 'sqlite3_unlock_notify') + .asFunction<_dart_sqlite3_unlock_notify>())( pBlocked, xNotify, pNotifyArg, @@ -8050,8 +8218,8 @@ class SQLite { ffi.Pointer arg1, ) { return (_sqlite3_stricmp ??= - _dylib.lookupFunction<_c_sqlite3_stricmp, _dart_sqlite3_stricmp>( - 'sqlite3_stricmp'))( + _lookup>('sqlite3_stricmp') + .asFunction<_dart_sqlite3_stricmp>())( arg0, arg1, ); @@ -8065,8 +8233,8 @@ class SQLite { int arg2, ) { return (_sqlite3_strnicmp ??= - _dylib.lookupFunction<_c_sqlite3_strnicmp, _dart_sqlite3_strnicmp>( - 'sqlite3_strnicmp'))( + _lookup>('sqlite3_strnicmp') + .asFunction<_dart_sqlite3_strnicmp>())( arg0, arg1, arg2, @@ -8093,8 +8261,8 @@ class SQLite { ffi.Pointer zStr, ) { return (_sqlite3_strglob ??= - _dylib.lookupFunction<_c_sqlite3_strglob, _dart_sqlite3_strglob>( - 'sqlite3_strglob'))( + _lookup>('sqlite3_strglob') + .asFunction<_dart_sqlite3_strglob>())( zGlob, zStr, ); @@ -8127,8 +8295,8 @@ class SQLite { int cEsc, ) { return (_sqlite3_strlike ??= - _dylib.lookupFunction<_c_sqlite3_strlike, _dart_sqlite3_strlike>( - 'sqlite3_strlike'))( + _lookup>('sqlite3_strlike') + .asFunction<_dart_sqlite3_strlike>())( zGlob, zStr, cEsc, @@ -8160,8 +8328,9 @@ class SQLite { int iErrCode, ffi.Pointer zFormat, ) { - return (_sqlite3_log ??= _dylib - .lookupFunction<_c_sqlite3_log, _dart_sqlite3_log>('sqlite3_log'))( + return (_sqlite3_log ??= + _lookup>('sqlite3_log') + .asFunction<_dart_sqlite3_log>())( iErrCode, zFormat, ); @@ -8207,8 +8376,8 @@ class SQLite { ffi.Pointer arg2, ) { return (_sqlite3_wal_hook ??= - _dylib.lookupFunction<_c_sqlite3_wal_hook, _dart_sqlite3_wal_hook>( - 'sqlite3_wal_hook'))( + _lookup>('sqlite3_wal_hook') + .asFunction<_dart_sqlite3_wal_hook>())( arg0, arg1, arg2, @@ -8248,9 +8417,10 @@ class SQLite { ffi.Pointer db, int N, ) { - return (_sqlite3_wal_autocheckpoint ??= _dylib.lookupFunction< - _c_sqlite3_wal_autocheckpoint, - _dart_sqlite3_wal_autocheckpoint>('sqlite3_wal_autocheckpoint'))( + return (_sqlite3_wal_autocheckpoint ??= + _lookup>( + 'sqlite3_wal_autocheckpoint') + .asFunction<_dart_sqlite3_wal_autocheckpoint>())( db, N, ); @@ -8280,9 +8450,10 @@ class SQLite { ffi.Pointer db, ffi.Pointer zDb, ) { - return (_sqlite3_wal_checkpoint ??= _dylib.lookupFunction< - _c_sqlite3_wal_checkpoint, - _dart_sqlite3_wal_checkpoint>('sqlite3_wal_checkpoint'))( + return (_sqlite3_wal_checkpoint ??= + _lookup>( + 'sqlite3_wal_checkpoint') + .asFunction<_dart_sqlite3_wal_checkpoint>())( db, zDb, ); @@ -8387,9 +8558,10 @@ class SQLite { ffi.Pointer pnLog, ffi.Pointer pnCkpt, ) { - return (_sqlite3_wal_checkpoint_v2 ??= _dylib.lookupFunction< - _c_sqlite3_wal_checkpoint_v2, - _dart_sqlite3_wal_checkpoint_v2>('sqlite3_wal_checkpoint_v2'))( + return (_sqlite3_wal_checkpoint_v2 ??= + _lookup>( + 'sqlite3_wal_checkpoint_v2') + .asFunction<_dart_sqlite3_wal_checkpoint_v2>())( db, zDb, eMode, @@ -8420,9 +8592,10 @@ class SQLite { ffi.Pointer arg0, int op, ) { - return (_sqlite3_vtab_config ??= _dylib.lookupFunction< - _c_sqlite3_vtab_config, - _dart_sqlite3_vtab_config>('sqlite3_vtab_config'))( + return (_sqlite3_vtab_config ??= + _lookup>( + 'sqlite3_vtab_config') + .asFunction<_dart_sqlite3_vtab_config>())( arg0, op, ); @@ -8441,9 +8614,10 @@ class SQLite { int sqlite3_vtab_on_conflict( ffi.Pointer arg0, ) { - return (_sqlite3_vtab_on_conflict ??= _dylib.lookupFunction< - _c_sqlite3_vtab_on_conflict, - _dart_sqlite3_vtab_on_conflict>('sqlite3_vtab_on_conflict'))( + return (_sqlite3_vtab_on_conflict ??= + _lookup>( + 'sqlite3_vtab_on_conflict') + .asFunction<_dart_sqlite3_vtab_on_conflict>())( arg0, ); } @@ -8468,9 +8642,10 @@ class SQLite { int sqlite3_vtab_nochange( ffi.Pointer arg0, ) { - return (_sqlite3_vtab_nochange ??= _dylib.lookupFunction< - _c_sqlite3_vtab_nochange, - _dart_sqlite3_vtab_nochange>('sqlite3_vtab_nochange'))( + return (_sqlite3_vtab_nochange ??= + _lookup>( + 'sqlite3_vtab_nochange') + .asFunction<_dart_sqlite3_vtab_nochange>())( arg0, ); } @@ -8492,9 +8667,10 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_vtab_collation ??= _dylib.lookupFunction< - _c_sqlite3_vtab_collation, - _dart_sqlite3_vtab_collation>('sqlite3_vtab_collation'))( + return (_sqlite3_vtab_collation ??= + _lookup>( + 'sqlite3_vtab_collation') + .asFunction<_dart_sqlite3_vtab_collation>())( arg0, arg1, ); @@ -8537,9 +8713,10 @@ class SQLite { int iScanStatusOp, ffi.Pointer pOut, ) { - return (_sqlite3_stmt_scanstatus ??= _dylib.lookupFunction< - _c_sqlite3_stmt_scanstatus, - _dart_sqlite3_stmt_scanstatus>('sqlite3_stmt_scanstatus'))( + return (_sqlite3_stmt_scanstatus ??= + _lookup>( + 'sqlite3_stmt_scanstatus') + .asFunction<_dart_sqlite3_stmt_scanstatus>())( pStmt, idx, iScanStatusOp, @@ -8559,9 +8736,10 @@ class SQLite { void sqlite3_stmt_scanstatus_reset( ffi.Pointer arg0, ) { - return (_sqlite3_stmt_scanstatus_reset ??= _dylib.lookupFunction< - _c_sqlite3_stmt_scanstatus_reset, - _dart_sqlite3_stmt_scanstatus_reset>('sqlite3_stmt_scanstatus_reset'))( + return (_sqlite3_stmt_scanstatus_reset ??= + _lookup>( + 'sqlite3_stmt_scanstatus_reset') + .asFunction<_dart_sqlite3_stmt_scanstatus_reset>())( arg0, ); } @@ -8599,9 +8777,10 @@ class SQLite { int sqlite3_db_cacheflush( ffi.Pointer arg0, ) { - return (_sqlite3_db_cacheflush ??= _dylib.lookupFunction< - _c_sqlite3_db_cacheflush, - _dart_sqlite3_db_cacheflush>('sqlite3_db_cacheflush'))( + return (_sqlite3_db_cacheflush ??= + _lookup>( + 'sqlite3_db_cacheflush') + .asFunction<_dart_sqlite3_db_cacheflush>())( arg0, ); } @@ -8619,9 +8798,10 @@ class SQLite { int sqlite3_system_errno( ffi.Pointer arg0, ) { - return (_sqlite3_system_errno ??= _dylib.lookupFunction< - _c_sqlite3_system_errno, - _dart_sqlite3_system_errno>('sqlite3_system_errno'))( + return (_sqlite3_system_errno ??= + _lookup>( + 'sqlite3_system_errno') + .asFunction<_dart_sqlite3_system_errno>())( arg0, ); } @@ -8674,9 +8854,10 @@ class SQLite { ffi.Pointer zSchema, ffi.Pointer> ppSnapshot, ) { - return (_sqlite3_snapshot_get ??= _dylib.lookupFunction< - _c_sqlite3_snapshot_get, - _dart_sqlite3_snapshot_get>('sqlite3_snapshot_get'))( + return (_sqlite3_snapshot_get ??= + _lookup>( + 'sqlite3_snapshot_get') + .asFunction<_dart_sqlite3_snapshot_get>())( db, zSchema, ppSnapshot, @@ -8731,9 +8912,10 @@ class SQLite { ffi.Pointer zSchema, ffi.Pointer pSnapshot, ) { - return (_sqlite3_snapshot_open ??= _dylib.lookupFunction< - _c_sqlite3_snapshot_open, - _dart_sqlite3_snapshot_open>('sqlite3_snapshot_open'))( + return (_sqlite3_snapshot_open ??= + _lookup>( + 'sqlite3_snapshot_open') + .asFunction<_dart_sqlite3_snapshot_open>())( db, zSchema, pSnapshot, @@ -8754,9 +8936,10 @@ class SQLite { void sqlite3_snapshot_free( ffi.Pointer arg0, ) { - return (_sqlite3_snapshot_free ??= _dylib.lookupFunction< - _c_sqlite3_snapshot_free, - _dart_sqlite3_snapshot_free>('sqlite3_snapshot_free'))( + return (_sqlite3_snapshot_free ??= + _lookup>( + 'sqlite3_snapshot_free') + .asFunction<_dart_sqlite3_snapshot_free>())( arg0, ); } @@ -8790,9 +8973,10 @@ class SQLite { ffi.Pointer p1, ffi.Pointer p2, ) { - return (_sqlite3_snapshot_cmp ??= _dylib.lookupFunction< - _c_sqlite3_snapshot_cmp, - _dart_sqlite3_snapshot_cmp>('sqlite3_snapshot_cmp'))( + return (_sqlite3_snapshot_cmp ??= + _lookup>( + 'sqlite3_snapshot_cmp') + .asFunction<_dart_sqlite3_snapshot_cmp>())( p1, p2, ); @@ -8825,9 +9009,10 @@ class SQLite { ffi.Pointer db, ffi.Pointer zDb, ) { - return (_sqlite3_snapshot_recover ??= _dylib.lookupFunction< - _c_sqlite3_snapshot_recover, - _dart_sqlite3_snapshot_recover>('sqlite3_snapshot_recover'))( + return (_sqlite3_snapshot_recover ??= + _lookup>( + 'sqlite3_snapshot_recover') + .asFunction<_dart_sqlite3_snapshot_recover>())( db, zDb, ); @@ -8876,8 +9061,8 @@ class SQLite { int mFlags, ) { return (_sqlite3_serialize ??= - _dylib.lookupFunction<_c_sqlite3_serialize, _dart_sqlite3_serialize>( - 'sqlite3_serialize'))( + _lookup>('sqlite3_serialize') + .asFunction<_dart_sqlite3_serialize>())( db, zSchema, piSize, @@ -8922,9 +9107,10 @@ class SQLite { int szBuf, int mFlags, ) { - return (_sqlite3_deserialize ??= _dylib.lookupFunction< - _c_sqlite3_deserialize, - _dart_sqlite3_deserialize>('sqlite3_deserialize'))( + return (_sqlite3_deserialize ??= + _lookup>( + 'sqlite3_deserialize') + .asFunction<_dart_sqlite3_deserialize>())( db, zSchema, pData, @@ -8946,10 +9132,10 @@ class SQLite { ffi.Pointer> xGeom, ffi.Pointer pContext, ) { - return (_sqlite3_rtree_geometry_callback ??= _dylib.lookupFunction< - _c_sqlite3_rtree_geometry_callback, - _dart_sqlite3_rtree_geometry_callback>( - 'sqlite3_rtree_geometry_callback'))( + return (_sqlite3_rtree_geometry_callback ??= + _lookup>( + 'sqlite3_rtree_geometry_callback') + .asFunction<_dart_sqlite3_rtree_geometry_callback>())( db, zGeom, xGeom, @@ -8970,9 +9156,10 @@ class SQLite { ffi.Pointer pContext, ffi.Pointer> xDestructor, ) { - return (_sqlite3_rtree_query_callback ??= _dylib.lookupFunction< - _c_sqlite3_rtree_query_callback, - _dart_sqlite3_rtree_query_callback>('sqlite3_rtree_query_callback'))( + return (_sqlite3_rtree_query_callback ??= + _lookup>( + 'sqlite3_rtree_query_callback') + .asFunction<_dart_sqlite3_rtree_query_callback>())( db, zQueryFunc, xQueryFunc, @@ -9347,7 +9534,7 @@ class ArrayHelper_sqlite3_snapshot_hidden_level0 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } diff --git a/pkgs/ffigen/test/native_test/native_test_bindings.dart b/pkgs/ffigen/test/native_test/native_test_bindings.dart index a4ae36f9e6..392068963f 100644 --- a/pkgs/ffigen/test/native_test/native_test_bindings.dart +++ b/pkgs/ffigen/test/native_test/native_test_bindings.dart @@ -5,18 +5,26 @@ import 'dart:ffi' as ffi; /// Native tests. class NativeLibrary { - /// Holds the Dynamic library. - final ffi.DynamicLibrary _dylib; + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; /// The symbols are looked up in [dynamicLibrary]. - NativeLibrary(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + NativeLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NativeLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; bool Function1Bool( bool x, ) { return (_Function1Bool ??= - _dylib.lookupFunction<_c_Function1Bool, _dart_Function1Bool>( - 'Function1Bool'))( + _lookup>('Function1Bool') + .asFunction<_dart_Function1Bool>())( x ? 1 : 0, ) != 0; @@ -28,8 +36,8 @@ class NativeLibrary { int x, ) { return (_Function1Uint8 ??= - _dylib.lookupFunction<_c_Function1Uint8, _dart_Function1Uint8>( - 'Function1Uint8'))( + _lookup>('Function1Uint8') + .asFunction<_dart_Function1Uint8>())( x, ); } @@ -40,8 +48,8 @@ class NativeLibrary { int x, ) { return (_Function1Uint16 ??= - _dylib.lookupFunction<_c_Function1Uint16, _dart_Function1Uint16>( - 'Function1Uint16'))( + _lookup>('Function1Uint16') + .asFunction<_dart_Function1Uint16>())( x, ); } @@ -52,8 +60,8 @@ class NativeLibrary { int x, ) { return (_Function1Uint32 ??= - _dylib.lookupFunction<_c_Function1Uint32, _dart_Function1Uint32>( - 'Function1Uint32'))( + _lookup>('Function1Uint32') + .asFunction<_dart_Function1Uint32>())( x, ); } @@ -64,8 +72,8 @@ class NativeLibrary { int x, ) { return (_Function1Uint64 ??= - _dylib.lookupFunction<_c_Function1Uint64, _dart_Function1Uint64>( - 'Function1Uint64'))( + _lookup>('Function1Uint64') + .asFunction<_dart_Function1Uint64>())( x, ); } @@ -76,8 +84,8 @@ class NativeLibrary { int x, ) { return (_Function1Int8 ??= - _dylib.lookupFunction<_c_Function1Int8, _dart_Function1Int8>( - 'Function1Int8'))( + _lookup>('Function1Int8') + .asFunction<_dart_Function1Int8>())( x, ); } @@ -88,8 +96,8 @@ class NativeLibrary { int x, ) { return (_Function1Int16 ??= - _dylib.lookupFunction<_c_Function1Int16, _dart_Function1Int16>( - 'Function1Int16'))( + _lookup>('Function1Int16') + .asFunction<_dart_Function1Int16>())( x, ); } @@ -100,8 +108,8 @@ class NativeLibrary { int x, ) { return (_Function1Int32 ??= - _dylib.lookupFunction<_c_Function1Int32, _dart_Function1Int32>( - 'Function1Int32'))( + _lookup>('Function1Int32') + .asFunction<_dart_Function1Int32>())( x, ); } @@ -112,8 +120,8 @@ class NativeLibrary { int x, ) { return (_Function1Int64 ??= - _dylib.lookupFunction<_c_Function1Int64, _dart_Function1Int64>( - 'Function1Int64'))( + _lookup>('Function1Int64') + .asFunction<_dart_Function1Int64>())( x, ); } @@ -124,8 +132,8 @@ class NativeLibrary { int x, ) { return (_Function1IntPtr ??= - _dylib.lookupFunction<_c_Function1IntPtr, _dart_Function1IntPtr>( - 'Function1IntPtr'))( + _lookup>('Function1IntPtr') + .asFunction<_dart_Function1IntPtr>())( x, ); } @@ -136,8 +144,8 @@ class NativeLibrary { double x, ) { return (_Function1Float ??= - _dylib.lookupFunction<_c_Function1Float, _dart_Function1Float>( - 'Function1Float'))( + _lookup>('Function1Float') + .asFunction<_dart_Function1Float>())( x, ); } @@ -148,8 +156,8 @@ class NativeLibrary { double x, ) { return (_Function1Double ??= - _dylib.lookupFunction<_c_Function1Double, _dart_Function1Double>( - 'Function1Double'))( + _lookup>('Function1Double') + .asFunction<_dart_Function1Double>())( x, ); } @@ -158,7 +166,8 @@ class NativeLibrary { ffi.Pointer getStruct1() { return (_getStruct1 ??= - _dylib.lookupFunction<_c_getStruct1, _dart_getStruct1>('getStruct1'))(); + _lookup>('getStruct1') + .asFunction<_dart_getStruct1>())(); } _dart_getStruct1? _getStruct1; @@ -168,9 +177,10 @@ class NativeLibrary { int b, int c, ) { - return (_Function1StructReturnByValue ??= _dylib.lookupFunction< - _c_Function1StructReturnByValue, - _dart_Function1StructReturnByValue>('Function1StructReturnByValue'))( + return (_Function1StructReturnByValue ??= + _lookup>( + 'Function1StructReturnByValue') + .asFunction<_dart_Function1StructReturnByValue>())( a, b, c, @@ -182,9 +192,10 @@ class NativeLibrary { int Function1StructPassByValue( Struct3 sum_a_b_c, ) { - return (_Function1StructPassByValue ??= _dylib.lookupFunction< - _c_Function1StructPassByValue, - _dart_Function1StructPassByValue>('Function1StructPassByValue'))( + return (_Function1StructPassByValue ??= + _lookup>( + 'Function1StructPassByValue') + .asFunction<_dart_Function1StructPassByValue>())( sum_a_b_c, ); } @@ -226,7 +237,7 @@ class ArrayHelper_Struct1_data_level0 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } @@ -253,7 +264,7 @@ class ArrayHelper_Struct1_data_level1 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } @@ -280,7 +291,7 @@ class ArrayHelper_Struct1_data_level2 { void _checkBounds(int index) { if (index >= length || index < 0) { throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); + 'Dimension $level: index not in range 0..$length exclusive.'); } } From 18189c4a86a23cc2830d8c114e9122b266c227fd Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Fri, 5 Mar 2021 00:58:02 -0800 Subject: [PATCH 068/276] [ffigen] Added subkey symbol-address to expose native pointers and typedefs. (#175) --- pkgs/ffigen/CHANGELOG.md | 3 + pkgs/ffigen/README.md | 19 + .../c_json/cjson_generated_bindings.dart | 773 +-- .../libclang-example/generated_bindings.dart | 5264 +++++++++++------ .../example/libclang-example/pubspec.yaml | 3 + .../example/simple/generated_bindings.dart | 37 +- pkgs/ffigen/lib/src/code_generator/func.dart | 24 +- .../ffigen/lib/src/code_generator/global.dart | 11 + .../ffigen/lib/src/code_generator/writer.dart | 86 +- .../lib/src/config_provider/config_types.dart | 19 +- .../lib/src/config_provider/spec_utils.dart | 51 +- .../sub_parsers/functiondecl_parser.dart | 2 + .../header_parser/sub_parsers/var_parser.dart | 1 + pkgs/ffigen/lib/src/strings.dart | 2 + pkgs/ffigen/pubspec.yaml | 2 +- .../_expected_boolean_dartbool_bindings.dart | 6 +- ...expected_boolean_no_dartbool_bindings.dart | 6 +- .../_expected_function_bindings.dart | 24 +- .../_expected_function_n_struct_bindings.dart | 8 +- ...internal_conflict_resolution_bindings.dart | 33 +- .../decl_symbol_address_collision_test.dart | 48 + ...ecl_symbol_address_collision_bindings.dart | 65 + .../example_tests/libclang_example_test.dart | 3 + ...expected_native_func_typedef_bindings.dart | 15 +- .../header_parser_tests/functions_test.dart | 8 + .../header_parser_tests/globals_test.dart | 23 +- .../_expected_cjson_bindings.dart | 773 +-- .../_expected_libclang_bindings.dart | 3916 ++++++------ .../_expected_sqlite_bindings.dart | 2862 +++++---- .../native_test/native_test_bindings.dart | 141 +- 30 files changed, 8524 insertions(+), 5704 deletions(-) create mode 100644 pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart create mode 100644 pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index c1b4129f66..cd555c8453 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.2.0 +- Added subkey `symbol-address` to expose native symbol pointers for `functions` and `globals`. + # 2.1.0 - Added a new named constructor `NativeLibrary.fromLookup()` to support dynamic linking. - Updated dart SDK constraints to latest stable version `2.12.0`. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index d531b4df25..02c908324d 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -162,6 +162,10 @@ functions: 'clang_dispose': 'dispose' # Removes '_' from beginning of a name. '_(.*)': '$1' + symbol-address: + # Used to expose symbol and typedef. + include: + - myFunc enums: member-rename: '(.*)': # Matches any enum. @@ -475,3 +479,18 @@ unnamed-enums: This happens when an excluded struct is a dependency to some included declaration. (A dependency means a struct is being passed/returned by a function or is member of another struct in some way) + +### How to expose the native pointers and typedefs? + +By default all native pointers and typedefs are hidden, but you can use the +`symbol-address` subkey for functions/globals and make them public by matching with its name. The pointers are then accesible via `nativeLibrary.addresses` and the native +typedef are prefixed with `Native_`. + +Example - +```yaml +functions: + symbol-address: + include: + - 'myFunc' + - '.*' # Do this to expose all pointers. +``` diff --git a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart index 19222cca86..2b9d0a8a35 100644 --- a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart +++ b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart @@ -39,95 +39,102 @@ class CJson { : _lookup = lookup; ffi.Pointer cJSON_Version() { - return (_cJSON_Version ??= - _lookup>('cJSON_Version') - .asFunction<_dart_cJSON_Version>())(); + return _cJSON_Version(); } - _dart_cJSON_Version? _cJSON_Version; + late final _cJSON_Version_ptr = + _lookup>('cJSON_Version'); + late final _dart_cJSON_Version _cJSON_Version = + _cJSON_Version_ptr.asFunction<_dart_cJSON_Version>(); void cJSON_InitHooks( ffi.Pointer hooks, ) { - return (_cJSON_InitHooks ??= - _lookup>('cJSON_InitHooks') - .asFunction<_dart_cJSON_InitHooks>())( + return _cJSON_InitHooks( hooks, ); } - _dart_cJSON_InitHooks? _cJSON_InitHooks; + late final _cJSON_InitHooks_ptr = + _lookup>('cJSON_InitHooks'); + late final _dart_cJSON_InitHooks _cJSON_InitHooks = + _cJSON_InitHooks_ptr.asFunction<_dart_cJSON_InitHooks>(); ffi.Pointer cJSON_Parse( ffi.Pointer value, ) { - return (_cJSON_Parse ??= - _lookup>('cJSON_Parse') - .asFunction<_dart_cJSON_Parse>())( + return _cJSON_Parse( value, ); } - _dart_cJSON_Parse? _cJSON_Parse; + late final _cJSON_Parse_ptr = + _lookup>('cJSON_Parse'); + late final _dart_cJSON_Parse _cJSON_Parse = + _cJSON_Parse_ptr.asFunction<_dart_cJSON_Parse>(); ffi.Pointer cJSON_ParseWithOpts( ffi.Pointer value, ffi.Pointer> return_parse_end, int require_null_terminated, ) { - return (_cJSON_ParseWithOpts ??= - _lookup>( - 'cJSON_ParseWithOpts') - .asFunction<_dart_cJSON_ParseWithOpts>())( + return _cJSON_ParseWithOpts( value, return_parse_end, require_null_terminated, ); } - _dart_cJSON_ParseWithOpts? _cJSON_ParseWithOpts; + late final _cJSON_ParseWithOpts_ptr = + _lookup>( + 'cJSON_ParseWithOpts'); + late final _dart_cJSON_ParseWithOpts _cJSON_ParseWithOpts = + _cJSON_ParseWithOpts_ptr.asFunction<_dart_cJSON_ParseWithOpts>(); ffi.Pointer cJSON_Print( ffi.Pointer item, ) { - return (_cJSON_Print ??= - _lookup>('cJSON_Print') - .asFunction<_dart_cJSON_Print>())( + return _cJSON_Print( item, ); } - _dart_cJSON_Print? _cJSON_Print; + late final _cJSON_Print_ptr = + _lookup>('cJSON_Print'); + late final _dart_cJSON_Print _cJSON_Print = + _cJSON_Print_ptr.asFunction<_dart_cJSON_Print>(); ffi.Pointer cJSON_PrintUnformatted( ffi.Pointer item, ) { - return (_cJSON_PrintUnformatted ??= - _lookup>( - 'cJSON_PrintUnformatted') - .asFunction<_dart_cJSON_PrintUnformatted>())( + return _cJSON_PrintUnformatted( item, ); } - _dart_cJSON_PrintUnformatted? _cJSON_PrintUnformatted; + late final _cJSON_PrintUnformatted_ptr = + _lookup>( + 'cJSON_PrintUnformatted'); + late final _dart_cJSON_PrintUnformatted _cJSON_PrintUnformatted = + _cJSON_PrintUnformatted_ptr.asFunction<_dart_cJSON_PrintUnformatted>(); ffi.Pointer cJSON_PrintBuffered( ffi.Pointer item, int prebuffer, int fmt, ) { - return (_cJSON_PrintBuffered ??= - _lookup>( - 'cJSON_PrintBuffered') - .asFunction<_dart_cJSON_PrintBuffered>())( + return _cJSON_PrintBuffered( item, prebuffer, fmt, ); } - _dart_cJSON_PrintBuffered? _cJSON_PrintBuffered; + late final _cJSON_PrintBuffered_ptr = + _lookup>( + 'cJSON_PrintBuffered'); + late final _dart_cJSON_PrintBuffered _cJSON_PrintBuffered = + _cJSON_PrintBuffered_ptr.asFunction<_dart_cJSON_PrintBuffered>(); int cJSON_PrintPreallocated( ffi.Pointer item, @@ -135,10 +142,7 @@ class CJson { int length, int format, ) { - return (_cJSON_PrintPreallocated ??= - _lookup>( - 'cJSON_PrintPreallocated') - .asFunction<_dart_cJSON_PrintPreallocated>())( + return _cJSON_PrintPreallocated( item, buffer, length, @@ -146,916 +150,1003 @@ class CJson { ); } - _dart_cJSON_PrintPreallocated? _cJSON_PrintPreallocated; + late final _cJSON_PrintPreallocated_ptr = + _lookup>( + 'cJSON_PrintPreallocated'); + late final _dart_cJSON_PrintPreallocated _cJSON_PrintPreallocated = + _cJSON_PrintPreallocated_ptr.asFunction<_dart_cJSON_PrintPreallocated>(); void cJSON_Delete( ffi.Pointer item, ) { - return (_cJSON_Delete ??= - _lookup>('cJSON_Delete') - .asFunction<_dart_cJSON_Delete>())( + return _cJSON_Delete( item, ); } - _dart_cJSON_Delete? _cJSON_Delete; + late final _cJSON_Delete_ptr = + _lookup>('cJSON_Delete'); + late final _dart_cJSON_Delete _cJSON_Delete = + _cJSON_Delete_ptr.asFunction<_dart_cJSON_Delete>(); int cJSON_GetArraySize( ffi.Pointer array, ) { - return (_cJSON_GetArraySize ??= - _lookup>('cJSON_GetArraySize') - .asFunction<_dart_cJSON_GetArraySize>())( + return _cJSON_GetArraySize( array, ); } - _dart_cJSON_GetArraySize? _cJSON_GetArraySize; + late final _cJSON_GetArraySize_ptr = + _lookup>('cJSON_GetArraySize'); + late final _dart_cJSON_GetArraySize _cJSON_GetArraySize = + _cJSON_GetArraySize_ptr.asFunction<_dart_cJSON_GetArraySize>(); ffi.Pointer cJSON_GetArrayItem( ffi.Pointer array, int index, ) { - return (_cJSON_GetArrayItem ??= - _lookup>('cJSON_GetArrayItem') - .asFunction<_dart_cJSON_GetArrayItem>())( + return _cJSON_GetArrayItem( array, index, ); } - _dart_cJSON_GetArrayItem? _cJSON_GetArrayItem; + late final _cJSON_GetArrayItem_ptr = + _lookup>('cJSON_GetArrayItem'); + late final _dart_cJSON_GetArrayItem _cJSON_GetArrayItem = + _cJSON_GetArrayItem_ptr.asFunction<_dart_cJSON_GetArrayItem>(); ffi.Pointer cJSON_GetObjectItem( ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_GetObjectItem ??= - _lookup>( - 'cJSON_GetObjectItem') - .asFunction<_dart_cJSON_GetObjectItem>())( + return _cJSON_GetObjectItem( object, string, ); } - _dart_cJSON_GetObjectItem? _cJSON_GetObjectItem; + late final _cJSON_GetObjectItem_ptr = + _lookup>( + 'cJSON_GetObjectItem'); + late final _dart_cJSON_GetObjectItem _cJSON_GetObjectItem = + _cJSON_GetObjectItem_ptr.asFunction<_dart_cJSON_GetObjectItem>(); ffi.Pointer cJSON_GetObjectItemCaseSensitive( ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_GetObjectItemCaseSensitive ??= - _lookup>( - 'cJSON_GetObjectItemCaseSensitive') - .asFunction<_dart_cJSON_GetObjectItemCaseSensitive>())( + return _cJSON_GetObjectItemCaseSensitive( object, string, ); } - _dart_cJSON_GetObjectItemCaseSensitive? _cJSON_GetObjectItemCaseSensitive; + late final _cJSON_GetObjectItemCaseSensitive_ptr = + _lookup>( + 'cJSON_GetObjectItemCaseSensitive'); + late final _dart_cJSON_GetObjectItemCaseSensitive + _cJSON_GetObjectItemCaseSensitive = _cJSON_GetObjectItemCaseSensitive_ptr + .asFunction<_dart_cJSON_GetObjectItemCaseSensitive>(); int cJSON_HasObjectItem( ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_HasObjectItem ??= - _lookup>( - 'cJSON_HasObjectItem') - .asFunction<_dart_cJSON_HasObjectItem>())( + return _cJSON_HasObjectItem( object, string, ); } - _dart_cJSON_HasObjectItem? _cJSON_HasObjectItem; + late final _cJSON_HasObjectItem_ptr = + _lookup>( + 'cJSON_HasObjectItem'); + late final _dart_cJSON_HasObjectItem _cJSON_HasObjectItem = + _cJSON_HasObjectItem_ptr.asFunction<_dart_cJSON_HasObjectItem>(); ffi.Pointer cJSON_GetErrorPtr() { - return (_cJSON_GetErrorPtr ??= - _lookup>('cJSON_GetErrorPtr') - .asFunction<_dart_cJSON_GetErrorPtr>())(); + return _cJSON_GetErrorPtr(); } - _dart_cJSON_GetErrorPtr? _cJSON_GetErrorPtr; + late final _cJSON_GetErrorPtr_ptr = + _lookup>('cJSON_GetErrorPtr'); + late final _dart_cJSON_GetErrorPtr _cJSON_GetErrorPtr = + _cJSON_GetErrorPtr_ptr.asFunction<_dart_cJSON_GetErrorPtr>(); ffi.Pointer cJSON_GetStringValue( ffi.Pointer item, ) { - return (_cJSON_GetStringValue ??= - _lookup>( - 'cJSON_GetStringValue') - .asFunction<_dart_cJSON_GetStringValue>())( + return _cJSON_GetStringValue( item, ); } - _dart_cJSON_GetStringValue? _cJSON_GetStringValue; + late final _cJSON_GetStringValue_ptr = + _lookup>( + 'cJSON_GetStringValue'); + late final _dart_cJSON_GetStringValue _cJSON_GetStringValue = + _cJSON_GetStringValue_ptr.asFunction<_dart_cJSON_GetStringValue>(); int cJSON_IsInvalid( ffi.Pointer item, ) { - return (_cJSON_IsInvalid ??= - _lookup>('cJSON_IsInvalid') - .asFunction<_dart_cJSON_IsInvalid>())( + return _cJSON_IsInvalid( item, ); } - _dart_cJSON_IsInvalid? _cJSON_IsInvalid; + late final _cJSON_IsInvalid_ptr = + _lookup>('cJSON_IsInvalid'); + late final _dart_cJSON_IsInvalid _cJSON_IsInvalid = + _cJSON_IsInvalid_ptr.asFunction<_dart_cJSON_IsInvalid>(); int cJSON_IsFalse( ffi.Pointer item, ) { - return (_cJSON_IsFalse ??= - _lookup>('cJSON_IsFalse') - .asFunction<_dart_cJSON_IsFalse>())( + return _cJSON_IsFalse( item, ); } - _dart_cJSON_IsFalse? _cJSON_IsFalse; + late final _cJSON_IsFalse_ptr = + _lookup>('cJSON_IsFalse'); + late final _dart_cJSON_IsFalse _cJSON_IsFalse = + _cJSON_IsFalse_ptr.asFunction<_dart_cJSON_IsFalse>(); int cJSON_IsTrue( ffi.Pointer item, ) { - return (_cJSON_IsTrue ??= - _lookup>('cJSON_IsTrue') - .asFunction<_dart_cJSON_IsTrue>())( + return _cJSON_IsTrue( item, ); } - _dart_cJSON_IsTrue? _cJSON_IsTrue; + late final _cJSON_IsTrue_ptr = + _lookup>('cJSON_IsTrue'); + late final _dart_cJSON_IsTrue _cJSON_IsTrue = + _cJSON_IsTrue_ptr.asFunction<_dart_cJSON_IsTrue>(); int cJSON_IsBool( ffi.Pointer item, ) { - return (_cJSON_IsBool ??= - _lookup>('cJSON_IsBool') - .asFunction<_dart_cJSON_IsBool>())( + return _cJSON_IsBool( item, ); } - _dart_cJSON_IsBool? _cJSON_IsBool; + late final _cJSON_IsBool_ptr = + _lookup>('cJSON_IsBool'); + late final _dart_cJSON_IsBool _cJSON_IsBool = + _cJSON_IsBool_ptr.asFunction<_dart_cJSON_IsBool>(); int cJSON_IsNull( ffi.Pointer item, ) { - return (_cJSON_IsNull ??= - _lookup>('cJSON_IsNull') - .asFunction<_dart_cJSON_IsNull>())( + return _cJSON_IsNull( item, ); } - _dart_cJSON_IsNull? _cJSON_IsNull; + late final _cJSON_IsNull_ptr = + _lookup>('cJSON_IsNull'); + late final _dart_cJSON_IsNull _cJSON_IsNull = + _cJSON_IsNull_ptr.asFunction<_dart_cJSON_IsNull>(); int cJSON_IsNumber( ffi.Pointer item, ) { - return (_cJSON_IsNumber ??= - _lookup>('cJSON_IsNumber') - .asFunction<_dart_cJSON_IsNumber>())( + return _cJSON_IsNumber( item, ); } - _dart_cJSON_IsNumber? _cJSON_IsNumber; + late final _cJSON_IsNumber_ptr = + _lookup>('cJSON_IsNumber'); + late final _dart_cJSON_IsNumber _cJSON_IsNumber = + _cJSON_IsNumber_ptr.asFunction<_dart_cJSON_IsNumber>(); int cJSON_IsString( ffi.Pointer item, ) { - return (_cJSON_IsString ??= - _lookup>('cJSON_IsString') - .asFunction<_dart_cJSON_IsString>())( + return _cJSON_IsString( item, ); } - _dart_cJSON_IsString? _cJSON_IsString; + late final _cJSON_IsString_ptr = + _lookup>('cJSON_IsString'); + late final _dart_cJSON_IsString _cJSON_IsString = + _cJSON_IsString_ptr.asFunction<_dart_cJSON_IsString>(); int cJSON_IsArray( ffi.Pointer item, ) { - return (_cJSON_IsArray ??= - _lookup>('cJSON_IsArray') - .asFunction<_dart_cJSON_IsArray>())( + return _cJSON_IsArray( item, ); } - _dart_cJSON_IsArray? _cJSON_IsArray; + late final _cJSON_IsArray_ptr = + _lookup>('cJSON_IsArray'); + late final _dart_cJSON_IsArray _cJSON_IsArray = + _cJSON_IsArray_ptr.asFunction<_dart_cJSON_IsArray>(); int cJSON_IsObject( ffi.Pointer item, ) { - return (_cJSON_IsObject ??= - _lookup>('cJSON_IsObject') - .asFunction<_dart_cJSON_IsObject>())( + return _cJSON_IsObject( item, ); } - _dart_cJSON_IsObject? _cJSON_IsObject; + late final _cJSON_IsObject_ptr = + _lookup>('cJSON_IsObject'); + late final _dart_cJSON_IsObject _cJSON_IsObject = + _cJSON_IsObject_ptr.asFunction<_dart_cJSON_IsObject>(); int cJSON_IsRaw( ffi.Pointer item, ) { - return (_cJSON_IsRaw ??= - _lookup>('cJSON_IsRaw') - .asFunction<_dart_cJSON_IsRaw>())( + return _cJSON_IsRaw( item, ); } - _dart_cJSON_IsRaw? _cJSON_IsRaw; + late final _cJSON_IsRaw_ptr = + _lookup>('cJSON_IsRaw'); + late final _dart_cJSON_IsRaw _cJSON_IsRaw = + _cJSON_IsRaw_ptr.asFunction<_dart_cJSON_IsRaw>(); ffi.Pointer cJSON_CreateNull() { - return (_cJSON_CreateNull ??= - _lookup>('cJSON_CreateNull') - .asFunction<_dart_cJSON_CreateNull>())(); + return _cJSON_CreateNull(); } - _dart_cJSON_CreateNull? _cJSON_CreateNull; + late final _cJSON_CreateNull_ptr = + _lookup>('cJSON_CreateNull'); + late final _dart_cJSON_CreateNull _cJSON_CreateNull = + _cJSON_CreateNull_ptr.asFunction<_dart_cJSON_CreateNull>(); ffi.Pointer cJSON_CreateTrue() { - return (_cJSON_CreateTrue ??= - _lookup>('cJSON_CreateTrue') - .asFunction<_dart_cJSON_CreateTrue>())(); + return _cJSON_CreateTrue(); } - _dart_cJSON_CreateTrue? _cJSON_CreateTrue; + late final _cJSON_CreateTrue_ptr = + _lookup>('cJSON_CreateTrue'); + late final _dart_cJSON_CreateTrue _cJSON_CreateTrue = + _cJSON_CreateTrue_ptr.asFunction<_dart_cJSON_CreateTrue>(); ffi.Pointer cJSON_CreateFalse() { - return (_cJSON_CreateFalse ??= - _lookup>('cJSON_CreateFalse') - .asFunction<_dart_cJSON_CreateFalse>())(); + return _cJSON_CreateFalse(); } - _dart_cJSON_CreateFalse? _cJSON_CreateFalse; + late final _cJSON_CreateFalse_ptr = + _lookup>('cJSON_CreateFalse'); + late final _dart_cJSON_CreateFalse _cJSON_CreateFalse = + _cJSON_CreateFalse_ptr.asFunction<_dart_cJSON_CreateFalse>(); ffi.Pointer cJSON_CreateBool( int boolean, ) { - return (_cJSON_CreateBool ??= - _lookup>('cJSON_CreateBool') - .asFunction<_dart_cJSON_CreateBool>())( + return _cJSON_CreateBool( boolean, ); } - _dart_cJSON_CreateBool? _cJSON_CreateBool; + late final _cJSON_CreateBool_ptr = + _lookup>('cJSON_CreateBool'); + late final _dart_cJSON_CreateBool _cJSON_CreateBool = + _cJSON_CreateBool_ptr.asFunction<_dart_cJSON_CreateBool>(); ffi.Pointer cJSON_CreateNumber( double num, ) { - return (_cJSON_CreateNumber ??= - _lookup>('cJSON_CreateNumber') - .asFunction<_dart_cJSON_CreateNumber>())( + return _cJSON_CreateNumber( num, ); } - _dart_cJSON_CreateNumber? _cJSON_CreateNumber; + late final _cJSON_CreateNumber_ptr = + _lookup>('cJSON_CreateNumber'); + late final _dart_cJSON_CreateNumber _cJSON_CreateNumber = + _cJSON_CreateNumber_ptr.asFunction<_dart_cJSON_CreateNumber>(); ffi.Pointer cJSON_CreateString( ffi.Pointer string, ) { - return (_cJSON_CreateString ??= - _lookup>('cJSON_CreateString') - .asFunction<_dart_cJSON_CreateString>())( + return _cJSON_CreateString( string, ); } - _dart_cJSON_CreateString? _cJSON_CreateString; + late final _cJSON_CreateString_ptr = + _lookup>('cJSON_CreateString'); + late final _dart_cJSON_CreateString _cJSON_CreateString = + _cJSON_CreateString_ptr.asFunction<_dart_cJSON_CreateString>(); ffi.Pointer cJSON_CreateRaw( ffi.Pointer raw, ) { - return (_cJSON_CreateRaw ??= - _lookup>('cJSON_CreateRaw') - .asFunction<_dart_cJSON_CreateRaw>())( + return _cJSON_CreateRaw( raw, ); } - _dart_cJSON_CreateRaw? _cJSON_CreateRaw; + late final _cJSON_CreateRaw_ptr = + _lookup>('cJSON_CreateRaw'); + late final _dart_cJSON_CreateRaw _cJSON_CreateRaw = + _cJSON_CreateRaw_ptr.asFunction<_dart_cJSON_CreateRaw>(); ffi.Pointer cJSON_CreateArray() { - return (_cJSON_CreateArray ??= - _lookup>('cJSON_CreateArray') - .asFunction<_dart_cJSON_CreateArray>())(); + return _cJSON_CreateArray(); } - _dart_cJSON_CreateArray? _cJSON_CreateArray; + late final _cJSON_CreateArray_ptr = + _lookup>('cJSON_CreateArray'); + late final _dart_cJSON_CreateArray _cJSON_CreateArray = + _cJSON_CreateArray_ptr.asFunction<_dart_cJSON_CreateArray>(); ffi.Pointer cJSON_CreateObject() { - return (_cJSON_CreateObject ??= - _lookup>('cJSON_CreateObject') - .asFunction<_dart_cJSON_CreateObject>())(); + return _cJSON_CreateObject(); } - _dart_cJSON_CreateObject? _cJSON_CreateObject; + late final _cJSON_CreateObject_ptr = + _lookup>('cJSON_CreateObject'); + late final _dart_cJSON_CreateObject _cJSON_CreateObject = + _cJSON_CreateObject_ptr.asFunction<_dart_cJSON_CreateObject>(); ffi.Pointer cJSON_CreateStringReference( ffi.Pointer string, ) { - return (_cJSON_CreateStringReference ??= - _lookup>( - 'cJSON_CreateStringReference') - .asFunction<_dart_cJSON_CreateStringReference>())( + return _cJSON_CreateStringReference( string, ); } - _dart_cJSON_CreateStringReference? _cJSON_CreateStringReference; + late final _cJSON_CreateStringReference_ptr = + _lookup>( + 'cJSON_CreateStringReference'); + late final _dart_cJSON_CreateStringReference _cJSON_CreateStringReference = + _cJSON_CreateStringReference_ptr + .asFunction<_dart_cJSON_CreateStringReference>(); ffi.Pointer cJSON_CreateObjectReference( ffi.Pointer child, ) { - return (_cJSON_CreateObjectReference ??= - _lookup>( - 'cJSON_CreateObjectReference') - .asFunction<_dart_cJSON_CreateObjectReference>())( + return _cJSON_CreateObjectReference( child, ); } - _dart_cJSON_CreateObjectReference? _cJSON_CreateObjectReference; + late final _cJSON_CreateObjectReference_ptr = + _lookup>( + 'cJSON_CreateObjectReference'); + late final _dart_cJSON_CreateObjectReference _cJSON_CreateObjectReference = + _cJSON_CreateObjectReference_ptr + .asFunction<_dart_cJSON_CreateObjectReference>(); ffi.Pointer cJSON_CreateArrayReference( ffi.Pointer child, ) { - return (_cJSON_CreateArrayReference ??= - _lookup>( - 'cJSON_CreateArrayReference') - .asFunction<_dart_cJSON_CreateArrayReference>())( + return _cJSON_CreateArrayReference( child, ); } - _dart_cJSON_CreateArrayReference? _cJSON_CreateArrayReference; + late final _cJSON_CreateArrayReference_ptr = + _lookup>( + 'cJSON_CreateArrayReference'); + late final _dart_cJSON_CreateArrayReference _cJSON_CreateArrayReference = + _cJSON_CreateArrayReference_ptr + .asFunction<_dart_cJSON_CreateArrayReference>(); ffi.Pointer cJSON_CreateIntArray( ffi.Pointer numbers, int count, ) { - return (_cJSON_CreateIntArray ??= - _lookup>( - 'cJSON_CreateIntArray') - .asFunction<_dart_cJSON_CreateIntArray>())( + return _cJSON_CreateIntArray( numbers, count, ); } - _dart_cJSON_CreateIntArray? _cJSON_CreateIntArray; + late final _cJSON_CreateIntArray_ptr = + _lookup>( + 'cJSON_CreateIntArray'); + late final _dart_cJSON_CreateIntArray _cJSON_CreateIntArray = + _cJSON_CreateIntArray_ptr.asFunction<_dart_cJSON_CreateIntArray>(); ffi.Pointer cJSON_CreateFloatArray( ffi.Pointer numbers, int count, ) { - return (_cJSON_CreateFloatArray ??= - _lookup>( - 'cJSON_CreateFloatArray') - .asFunction<_dart_cJSON_CreateFloatArray>())( + return _cJSON_CreateFloatArray( numbers, count, ); } - _dart_cJSON_CreateFloatArray? _cJSON_CreateFloatArray; + late final _cJSON_CreateFloatArray_ptr = + _lookup>( + 'cJSON_CreateFloatArray'); + late final _dart_cJSON_CreateFloatArray _cJSON_CreateFloatArray = + _cJSON_CreateFloatArray_ptr.asFunction<_dart_cJSON_CreateFloatArray>(); ffi.Pointer cJSON_CreateDoubleArray( ffi.Pointer numbers, int count, ) { - return (_cJSON_CreateDoubleArray ??= - _lookup>( - 'cJSON_CreateDoubleArray') - .asFunction<_dart_cJSON_CreateDoubleArray>())( + return _cJSON_CreateDoubleArray( numbers, count, ); } - _dart_cJSON_CreateDoubleArray? _cJSON_CreateDoubleArray; + late final _cJSON_CreateDoubleArray_ptr = + _lookup>( + 'cJSON_CreateDoubleArray'); + late final _dart_cJSON_CreateDoubleArray _cJSON_CreateDoubleArray = + _cJSON_CreateDoubleArray_ptr.asFunction<_dart_cJSON_CreateDoubleArray>(); ffi.Pointer cJSON_CreateStringArray( ffi.Pointer> strings, int count, ) { - return (_cJSON_CreateStringArray ??= - _lookup>( - 'cJSON_CreateStringArray') - .asFunction<_dart_cJSON_CreateStringArray>())( + return _cJSON_CreateStringArray( strings, count, ); } - _dart_cJSON_CreateStringArray? _cJSON_CreateStringArray; + late final _cJSON_CreateStringArray_ptr = + _lookup>( + 'cJSON_CreateStringArray'); + late final _dart_cJSON_CreateStringArray _cJSON_CreateStringArray = + _cJSON_CreateStringArray_ptr.asFunction<_dart_cJSON_CreateStringArray>(); void cJSON_AddItemToArray( ffi.Pointer array, ffi.Pointer item, ) { - return (_cJSON_AddItemToArray ??= - _lookup>( - 'cJSON_AddItemToArray') - .asFunction<_dart_cJSON_AddItemToArray>())( + return _cJSON_AddItemToArray( array, item, ); } - _dart_cJSON_AddItemToArray? _cJSON_AddItemToArray; + late final _cJSON_AddItemToArray_ptr = + _lookup>( + 'cJSON_AddItemToArray'); + late final _dart_cJSON_AddItemToArray _cJSON_AddItemToArray = + _cJSON_AddItemToArray_ptr.asFunction<_dart_cJSON_AddItemToArray>(); void cJSON_AddItemToObject( ffi.Pointer object, ffi.Pointer string, ffi.Pointer item, ) { - return (_cJSON_AddItemToObject ??= - _lookup>( - 'cJSON_AddItemToObject') - .asFunction<_dart_cJSON_AddItemToObject>())( + return _cJSON_AddItemToObject( object, string, item, ); } - _dart_cJSON_AddItemToObject? _cJSON_AddItemToObject; + late final _cJSON_AddItemToObject_ptr = + _lookup>( + 'cJSON_AddItemToObject'); + late final _dart_cJSON_AddItemToObject _cJSON_AddItemToObject = + _cJSON_AddItemToObject_ptr.asFunction<_dart_cJSON_AddItemToObject>(); void cJSON_AddItemToObjectCS( ffi.Pointer object, ffi.Pointer string, ffi.Pointer item, ) { - return (_cJSON_AddItemToObjectCS ??= - _lookup>( - 'cJSON_AddItemToObjectCS') - .asFunction<_dart_cJSON_AddItemToObjectCS>())( + return _cJSON_AddItemToObjectCS( object, string, item, ); } - _dart_cJSON_AddItemToObjectCS? _cJSON_AddItemToObjectCS; + late final _cJSON_AddItemToObjectCS_ptr = + _lookup>( + 'cJSON_AddItemToObjectCS'); + late final _dart_cJSON_AddItemToObjectCS _cJSON_AddItemToObjectCS = + _cJSON_AddItemToObjectCS_ptr.asFunction<_dart_cJSON_AddItemToObjectCS>(); void cJSON_AddItemReferenceToArray( ffi.Pointer array, ffi.Pointer item, ) { - return (_cJSON_AddItemReferenceToArray ??= - _lookup>( - 'cJSON_AddItemReferenceToArray') - .asFunction<_dart_cJSON_AddItemReferenceToArray>())( + return _cJSON_AddItemReferenceToArray( array, item, ); } - _dart_cJSON_AddItemReferenceToArray? _cJSON_AddItemReferenceToArray; + late final _cJSON_AddItemReferenceToArray_ptr = + _lookup>( + 'cJSON_AddItemReferenceToArray'); + late final _dart_cJSON_AddItemReferenceToArray + _cJSON_AddItemReferenceToArray = _cJSON_AddItemReferenceToArray_ptr + .asFunction<_dart_cJSON_AddItemReferenceToArray>(); void cJSON_AddItemReferenceToObject( ffi.Pointer object, ffi.Pointer string, ffi.Pointer item, ) { - return (_cJSON_AddItemReferenceToObject ??= - _lookup>( - 'cJSON_AddItemReferenceToObject') - .asFunction<_dart_cJSON_AddItemReferenceToObject>())( + return _cJSON_AddItemReferenceToObject( object, string, item, ); } - _dart_cJSON_AddItemReferenceToObject? _cJSON_AddItemReferenceToObject; + late final _cJSON_AddItemReferenceToObject_ptr = + _lookup>( + 'cJSON_AddItemReferenceToObject'); + late final _dart_cJSON_AddItemReferenceToObject + _cJSON_AddItemReferenceToObject = _cJSON_AddItemReferenceToObject_ptr + .asFunction<_dart_cJSON_AddItemReferenceToObject>(); ffi.Pointer cJSON_DetachItemViaPointer( ffi.Pointer parent, ffi.Pointer item, ) { - return (_cJSON_DetachItemViaPointer ??= - _lookup>( - 'cJSON_DetachItemViaPointer') - .asFunction<_dart_cJSON_DetachItemViaPointer>())( + return _cJSON_DetachItemViaPointer( parent, item, ); } - _dart_cJSON_DetachItemViaPointer? _cJSON_DetachItemViaPointer; + late final _cJSON_DetachItemViaPointer_ptr = + _lookup>( + 'cJSON_DetachItemViaPointer'); + late final _dart_cJSON_DetachItemViaPointer _cJSON_DetachItemViaPointer = + _cJSON_DetachItemViaPointer_ptr + .asFunction<_dart_cJSON_DetachItemViaPointer>(); ffi.Pointer cJSON_DetachItemFromArray( ffi.Pointer array, int which, ) { - return (_cJSON_DetachItemFromArray ??= - _lookup>( - 'cJSON_DetachItemFromArray') - .asFunction<_dart_cJSON_DetachItemFromArray>())( + return _cJSON_DetachItemFromArray( array, which, ); } - _dart_cJSON_DetachItemFromArray? _cJSON_DetachItemFromArray; + late final _cJSON_DetachItemFromArray_ptr = + _lookup>( + 'cJSON_DetachItemFromArray'); + late final _dart_cJSON_DetachItemFromArray _cJSON_DetachItemFromArray = + _cJSON_DetachItemFromArray_ptr + .asFunction<_dart_cJSON_DetachItemFromArray>(); void cJSON_DeleteItemFromArray( ffi.Pointer array, int which, ) { - return (_cJSON_DeleteItemFromArray ??= - _lookup>( - 'cJSON_DeleteItemFromArray') - .asFunction<_dart_cJSON_DeleteItemFromArray>())( + return _cJSON_DeleteItemFromArray( array, which, ); } - _dart_cJSON_DeleteItemFromArray? _cJSON_DeleteItemFromArray; + late final _cJSON_DeleteItemFromArray_ptr = + _lookup>( + 'cJSON_DeleteItemFromArray'); + late final _dart_cJSON_DeleteItemFromArray _cJSON_DeleteItemFromArray = + _cJSON_DeleteItemFromArray_ptr + .asFunction<_dart_cJSON_DeleteItemFromArray>(); ffi.Pointer cJSON_DetachItemFromObject( ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_DetachItemFromObject ??= - _lookup>( - 'cJSON_DetachItemFromObject') - .asFunction<_dart_cJSON_DetachItemFromObject>())( + return _cJSON_DetachItemFromObject( object, string, ); } - _dart_cJSON_DetachItemFromObject? _cJSON_DetachItemFromObject; + late final _cJSON_DetachItemFromObject_ptr = + _lookup>( + 'cJSON_DetachItemFromObject'); + late final _dart_cJSON_DetachItemFromObject _cJSON_DetachItemFromObject = + _cJSON_DetachItemFromObject_ptr + .asFunction<_dart_cJSON_DetachItemFromObject>(); ffi.Pointer cJSON_DetachItemFromObjectCaseSensitive( ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_DetachItemFromObjectCaseSensitive ??= - _lookup>( - 'cJSON_DetachItemFromObjectCaseSensitive') - .asFunction<_dart_cJSON_DetachItemFromObjectCaseSensitive>())( + return _cJSON_DetachItemFromObjectCaseSensitive( object, string, ); } - _dart_cJSON_DetachItemFromObjectCaseSensitive? - _cJSON_DetachItemFromObjectCaseSensitive; + late final _cJSON_DetachItemFromObjectCaseSensitive_ptr = + _lookup>( + 'cJSON_DetachItemFromObjectCaseSensitive'); + late final _dart_cJSON_DetachItemFromObjectCaseSensitive + _cJSON_DetachItemFromObjectCaseSensitive = + _cJSON_DetachItemFromObjectCaseSensitive_ptr + .asFunction<_dart_cJSON_DetachItemFromObjectCaseSensitive>(); void cJSON_DeleteItemFromObject( ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_DeleteItemFromObject ??= - _lookup>( - 'cJSON_DeleteItemFromObject') - .asFunction<_dart_cJSON_DeleteItemFromObject>())( + return _cJSON_DeleteItemFromObject( object, string, ); } - _dart_cJSON_DeleteItemFromObject? _cJSON_DeleteItemFromObject; + late final _cJSON_DeleteItemFromObject_ptr = + _lookup>( + 'cJSON_DeleteItemFromObject'); + late final _dart_cJSON_DeleteItemFromObject _cJSON_DeleteItemFromObject = + _cJSON_DeleteItemFromObject_ptr + .asFunction<_dart_cJSON_DeleteItemFromObject>(); void cJSON_DeleteItemFromObjectCaseSensitive( ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_DeleteItemFromObjectCaseSensitive ??= - _lookup>( - 'cJSON_DeleteItemFromObjectCaseSensitive') - .asFunction<_dart_cJSON_DeleteItemFromObjectCaseSensitive>())( + return _cJSON_DeleteItemFromObjectCaseSensitive( object, string, ); } - _dart_cJSON_DeleteItemFromObjectCaseSensitive? - _cJSON_DeleteItemFromObjectCaseSensitive; + late final _cJSON_DeleteItemFromObjectCaseSensitive_ptr = + _lookup>( + 'cJSON_DeleteItemFromObjectCaseSensitive'); + late final _dart_cJSON_DeleteItemFromObjectCaseSensitive + _cJSON_DeleteItemFromObjectCaseSensitive = + _cJSON_DeleteItemFromObjectCaseSensitive_ptr + .asFunction<_dart_cJSON_DeleteItemFromObjectCaseSensitive>(); void cJSON_InsertItemInArray( ffi.Pointer array, int which, ffi.Pointer newitem, ) { - return (_cJSON_InsertItemInArray ??= - _lookup>( - 'cJSON_InsertItemInArray') - .asFunction<_dart_cJSON_InsertItemInArray>())( + return _cJSON_InsertItemInArray( array, which, newitem, ); } - _dart_cJSON_InsertItemInArray? _cJSON_InsertItemInArray; + late final _cJSON_InsertItemInArray_ptr = + _lookup>( + 'cJSON_InsertItemInArray'); + late final _dart_cJSON_InsertItemInArray _cJSON_InsertItemInArray = + _cJSON_InsertItemInArray_ptr.asFunction<_dart_cJSON_InsertItemInArray>(); int cJSON_ReplaceItemViaPointer( ffi.Pointer parent, ffi.Pointer item, ffi.Pointer replacement, ) { - return (_cJSON_ReplaceItemViaPointer ??= - _lookup>( - 'cJSON_ReplaceItemViaPointer') - .asFunction<_dart_cJSON_ReplaceItemViaPointer>())( + return _cJSON_ReplaceItemViaPointer( parent, item, replacement, ); } - _dart_cJSON_ReplaceItemViaPointer? _cJSON_ReplaceItemViaPointer; + late final _cJSON_ReplaceItemViaPointer_ptr = + _lookup>( + 'cJSON_ReplaceItemViaPointer'); + late final _dart_cJSON_ReplaceItemViaPointer _cJSON_ReplaceItemViaPointer = + _cJSON_ReplaceItemViaPointer_ptr + .asFunction<_dart_cJSON_ReplaceItemViaPointer>(); void cJSON_ReplaceItemInArray( ffi.Pointer array, int which, ffi.Pointer newitem, ) { - return (_cJSON_ReplaceItemInArray ??= - _lookup>( - 'cJSON_ReplaceItemInArray') - .asFunction<_dart_cJSON_ReplaceItemInArray>())( + return _cJSON_ReplaceItemInArray( array, which, newitem, ); } - _dart_cJSON_ReplaceItemInArray? _cJSON_ReplaceItemInArray; + late final _cJSON_ReplaceItemInArray_ptr = + _lookup>( + 'cJSON_ReplaceItemInArray'); + late final _dart_cJSON_ReplaceItemInArray _cJSON_ReplaceItemInArray = + _cJSON_ReplaceItemInArray_ptr + .asFunction<_dart_cJSON_ReplaceItemInArray>(); void cJSON_ReplaceItemInObject( ffi.Pointer object, ffi.Pointer string, ffi.Pointer newitem, ) { - return (_cJSON_ReplaceItemInObject ??= - _lookup>( - 'cJSON_ReplaceItemInObject') - .asFunction<_dart_cJSON_ReplaceItemInObject>())( + return _cJSON_ReplaceItemInObject( object, string, newitem, ); } - _dart_cJSON_ReplaceItemInObject? _cJSON_ReplaceItemInObject; + late final _cJSON_ReplaceItemInObject_ptr = + _lookup>( + 'cJSON_ReplaceItemInObject'); + late final _dart_cJSON_ReplaceItemInObject _cJSON_ReplaceItemInObject = + _cJSON_ReplaceItemInObject_ptr + .asFunction<_dart_cJSON_ReplaceItemInObject>(); void cJSON_ReplaceItemInObjectCaseSensitive( ffi.Pointer object, ffi.Pointer string, ffi.Pointer newitem, ) { - return (_cJSON_ReplaceItemInObjectCaseSensitive ??= - _lookup>( - 'cJSON_ReplaceItemInObjectCaseSensitive') - .asFunction<_dart_cJSON_ReplaceItemInObjectCaseSensitive>())( + return _cJSON_ReplaceItemInObjectCaseSensitive( object, string, newitem, ); } - _dart_cJSON_ReplaceItemInObjectCaseSensitive? - _cJSON_ReplaceItemInObjectCaseSensitive; + late final _cJSON_ReplaceItemInObjectCaseSensitive_ptr = + _lookup>( + 'cJSON_ReplaceItemInObjectCaseSensitive'); + late final _dart_cJSON_ReplaceItemInObjectCaseSensitive + _cJSON_ReplaceItemInObjectCaseSensitive = + _cJSON_ReplaceItemInObjectCaseSensitive_ptr + .asFunction<_dart_cJSON_ReplaceItemInObjectCaseSensitive>(); ffi.Pointer cJSON_Duplicate( ffi.Pointer item, int recurse, ) { - return (_cJSON_Duplicate ??= - _lookup>('cJSON_Duplicate') - .asFunction<_dart_cJSON_Duplicate>())( + return _cJSON_Duplicate( item, recurse, ); } - _dart_cJSON_Duplicate? _cJSON_Duplicate; + late final _cJSON_Duplicate_ptr = + _lookup>('cJSON_Duplicate'); + late final _dart_cJSON_Duplicate _cJSON_Duplicate = + _cJSON_Duplicate_ptr.asFunction<_dart_cJSON_Duplicate>(); int cJSON_Compare( ffi.Pointer a, ffi.Pointer b, int case_sensitive, ) { - return (_cJSON_Compare ??= - _lookup>('cJSON_Compare') - .asFunction<_dart_cJSON_Compare>())( + return _cJSON_Compare( a, b, case_sensitive, ); } - _dart_cJSON_Compare? _cJSON_Compare; + late final _cJSON_Compare_ptr = + _lookup>('cJSON_Compare'); + late final _dart_cJSON_Compare _cJSON_Compare = + _cJSON_Compare_ptr.asFunction<_dart_cJSON_Compare>(); void cJSON_Minify( ffi.Pointer json, ) { - return (_cJSON_Minify ??= - _lookup>('cJSON_Minify') - .asFunction<_dart_cJSON_Minify>())( + return _cJSON_Minify( json, ); } - _dart_cJSON_Minify? _cJSON_Minify; + late final _cJSON_Minify_ptr = + _lookup>('cJSON_Minify'); + late final _dart_cJSON_Minify _cJSON_Minify = + _cJSON_Minify_ptr.asFunction<_dart_cJSON_Minify>(); ffi.Pointer cJSON_AddNullToObject( ffi.Pointer object, ffi.Pointer name, ) { - return (_cJSON_AddNullToObject ??= - _lookup>( - 'cJSON_AddNullToObject') - .asFunction<_dart_cJSON_AddNullToObject>())( + return _cJSON_AddNullToObject( object, name, ); } - _dart_cJSON_AddNullToObject? _cJSON_AddNullToObject; + late final _cJSON_AddNullToObject_ptr = + _lookup>( + 'cJSON_AddNullToObject'); + late final _dart_cJSON_AddNullToObject _cJSON_AddNullToObject = + _cJSON_AddNullToObject_ptr.asFunction<_dart_cJSON_AddNullToObject>(); ffi.Pointer cJSON_AddTrueToObject( ffi.Pointer object, ffi.Pointer name, ) { - return (_cJSON_AddTrueToObject ??= - _lookup>( - 'cJSON_AddTrueToObject') - .asFunction<_dart_cJSON_AddTrueToObject>())( + return _cJSON_AddTrueToObject( object, name, ); } - _dart_cJSON_AddTrueToObject? _cJSON_AddTrueToObject; + late final _cJSON_AddTrueToObject_ptr = + _lookup>( + 'cJSON_AddTrueToObject'); + late final _dart_cJSON_AddTrueToObject _cJSON_AddTrueToObject = + _cJSON_AddTrueToObject_ptr.asFunction<_dart_cJSON_AddTrueToObject>(); ffi.Pointer cJSON_AddFalseToObject( ffi.Pointer object, ffi.Pointer name, ) { - return (_cJSON_AddFalseToObject ??= - _lookup>( - 'cJSON_AddFalseToObject') - .asFunction<_dart_cJSON_AddFalseToObject>())( + return _cJSON_AddFalseToObject( object, name, ); } - _dart_cJSON_AddFalseToObject? _cJSON_AddFalseToObject; + late final _cJSON_AddFalseToObject_ptr = + _lookup>( + 'cJSON_AddFalseToObject'); + late final _dart_cJSON_AddFalseToObject _cJSON_AddFalseToObject = + _cJSON_AddFalseToObject_ptr.asFunction<_dart_cJSON_AddFalseToObject>(); ffi.Pointer cJSON_AddBoolToObject( ffi.Pointer object, ffi.Pointer name, int boolean, ) { - return (_cJSON_AddBoolToObject ??= - _lookup>( - 'cJSON_AddBoolToObject') - .asFunction<_dart_cJSON_AddBoolToObject>())( + return _cJSON_AddBoolToObject( object, name, boolean, ); } - _dart_cJSON_AddBoolToObject? _cJSON_AddBoolToObject; + late final _cJSON_AddBoolToObject_ptr = + _lookup>( + 'cJSON_AddBoolToObject'); + late final _dart_cJSON_AddBoolToObject _cJSON_AddBoolToObject = + _cJSON_AddBoolToObject_ptr.asFunction<_dart_cJSON_AddBoolToObject>(); ffi.Pointer cJSON_AddNumberToObject( ffi.Pointer object, ffi.Pointer name, double number, ) { - return (_cJSON_AddNumberToObject ??= - _lookup>( - 'cJSON_AddNumberToObject') - .asFunction<_dart_cJSON_AddNumberToObject>())( + return _cJSON_AddNumberToObject( object, name, number, ); } - _dart_cJSON_AddNumberToObject? _cJSON_AddNumberToObject; + late final _cJSON_AddNumberToObject_ptr = + _lookup>( + 'cJSON_AddNumberToObject'); + late final _dart_cJSON_AddNumberToObject _cJSON_AddNumberToObject = + _cJSON_AddNumberToObject_ptr.asFunction<_dart_cJSON_AddNumberToObject>(); ffi.Pointer cJSON_AddStringToObject( ffi.Pointer object, ffi.Pointer name, ffi.Pointer string, ) { - return (_cJSON_AddStringToObject ??= - _lookup>( - 'cJSON_AddStringToObject') - .asFunction<_dart_cJSON_AddStringToObject>())( + return _cJSON_AddStringToObject( object, name, string, ); } - _dart_cJSON_AddStringToObject? _cJSON_AddStringToObject; + late final _cJSON_AddStringToObject_ptr = + _lookup>( + 'cJSON_AddStringToObject'); + late final _dart_cJSON_AddStringToObject _cJSON_AddStringToObject = + _cJSON_AddStringToObject_ptr.asFunction<_dart_cJSON_AddStringToObject>(); ffi.Pointer cJSON_AddRawToObject( ffi.Pointer object, ffi.Pointer name, ffi.Pointer raw, ) { - return (_cJSON_AddRawToObject ??= - _lookup>( - 'cJSON_AddRawToObject') - .asFunction<_dart_cJSON_AddRawToObject>())( + return _cJSON_AddRawToObject( object, name, raw, ); } - _dart_cJSON_AddRawToObject? _cJSON_AddRawToObject; + late final _cJSON_AddRawToObject_ptr = + _lookup>( + 'cJSON_AddRawToObject'); + late final _dart_cJSON_AddRawToObject _cJSON_AddRawToObject = + _cJSON_AddRawToObject_ptr.asFunction<_dart_cJSON_AddRawToObject>(); ffi.Pointer cJSON_AddObjectToObject( ffi.Pointer object, ffi.Pointer name, ) { - return (_cJSON_AddObjectToObject ??= - _lookup>( - 'cJSON_AddObjectToObject') - .asFunction<_dart_cJSON_AddObjectToObject>())( + return _cJSON_AddObjectToObject( object, name, ); } - _dart_cJSON_AddObjectToObject? _cJSON_AddObjectToObject; + late final _cJSON_AddObjectToObject_ptr = + _lookup>( + 'cJSON_AddObjectToObject'); + late final _dart_cJSON_AddObjectToObject _cJSON_AddObjectToObject = + _cJSON_AddObjectToObject_ptr.asFunction<_dart_cJSON_AddObjectToObject>(); ffi.Pointer cJSON_AddArrayToObject( ffi.Pointer object, ffi.Pointer name, ) { - return (_cJSON_AddArrayToObject ??= - _lookup>( - 'cJSON_AddArrayToObject') - .asFunction<_dart_cJSON_AddArrayToObject>())( + return _cJSON_AddArrayToObject( object, name, ); } - _dart_cJSON_AddArrayToObject? _cJSON_AddArrayToObject; + late final _cJSON_AddArrayToObject_ptr = + _lookup>( + 'cJSON_AddArrayToObject'); + late final _dart_cJSON_AddArrayToObject _cJSON_AddArrayToObject = + _cJSON_AddArrayToObject_ptr.asFunction<_dart_cJSON_AddArrayToObject>(); double cJSON_SetNumberHelper( ffi.Pointer object, double number, ) { - return (_cJSON_SetNumberHelper ??= - _lookup>( - 'cJSON_SetNumberHelper') - .asFunction<_dart_cJSON_SetNumberHelper>())( + return _cJSON_SetNumberHelper( object, number, ); } - _dart_cJSON_SetNumberHelper? _cJSON_SetNumberHelper; + late final _cJSON_SetNumberHelper_ptr = + _lookup>( + 'cJSON_SetNumberHelper'); + late final _dart_cJSON_SetNumberHelper _cJSON_SetNumberHelper = + _cJSON_SetNumberHelper_ptr.asFunction<_dart_cJSON_SetNumberHelper>(); ffi.Pointer cJSON_malloc( int size, ) { - return (_cJSON_malloc ??= - _lookup>('cJSON_malloc') - .asFunction<_dart_cJSON_malloc>())( + return _cJSON_malloc( size, ); } - _dart_cJSON_malloc? _cJSON_malloc; + late final _cJSON_malloc_ptr = + _lookup>('cJSON_malloc'); + late final _dart_cJSON_malloc _cJSON_malloc = + _cJSON_malloc_ptr.asFunction<_dart_cJSON_malloc>(); void cJSON_free( ffi.Pointer object, ) { - return (_cJSON_free ??= - _lookup>('cJSON_free') - .asFunction<_dart_cJSON_free>())( + return _cJSON_free( object, ); } - _dart_cJSON_free? _cJSON_free; + late final _cJSON_free_ptr = + _lookup>('cJSON_free'); + late final _dart_cJSON_free _cJSON_free = + _cJSON_free_ptr.asFunction<_dart_cJSON_free>(); } class cJSON extends ffi.Struct { diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index d90bcd9788..cd366f3ca8 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -27,42 +27,45 @@ class LibClang { ffi.Pointer clang_getCString( CXString string, ) { - return (_clang_getCString ??= - _lookup>('clang_getCString') - .asFunction<_dart_clang_getCString>())( + return _clang_getCString( string, ); } - _dart_clang_getCString? _clang_getCString; + late final _clang_getCString_ptr = + _lookup>('clang_getCString'); + late final _dart_clang_getCString _clang_getCString = + _clang_getCString_ptr.asFunction<_dart_clang_getCString>(); /// Free the given string. void clang_disposeString( CXString string, ) { - return (_clang_disposeString ??= - _lookup>( - 'clang_disposeString') - .asFunction<_dart_clang_disposeString>())( + return _clang_disposeString( string, ); } - _dart_clang_disposeString? _clang_disposeString; + late final _clang_disposeString_ptr = + _lookup>( + 'clang_disposeString'); + late final _dart_clang_disposeString _clang_disposeString = + _clang_disposeString_ptr.asFunction<_dart_clang_disposeString>(); /// Free the given string set. void clang_disposeStringSet( ffi.Pointer set_1, ) { - return (_clang_disposeStringSet ??= - _lookup>( - 'clang_disposeStringSet') - .asFunction<_dart_clang_disposeStringSet>())( + return _clang_disposeStringSet( set_1, ); } - _dart_clang_disposeStringSet? _clang_disposeStringSet; + late final _clang_disposeStringSet_ptr = + _lookup>( + 'clang_disposeStringSet'); + late final _dart_clang_disposeStringSet _clang_disposeStringSet = + _clang_disposeStringSet_ptr.asFunction<_dart_clang_disposeStringSet>(); /// Provides a shared context for creating translation units. /// @@ -106,15 +109,17 @@ class LibClang { int excludeDeclarationsFromPCH, int displayDiagnostics, ) { - return (_clang_createIndex ??= - _lookup>('clang_createIndex') - .asFunction<_dart_clang_createIndex>())( + return _clang_createIndex( excludeDeclarationsFromPCH, displayDiagnostics, ); } - _dart_clang_createIndex? _clang_createIndex; + late final _clang_createIndex_ptr = + _lookup>( + 'clang_createIndex'); + late final _dart_clang_createIndex _clang_createIndex = + _clang_createIndex_ptr.asFunction<_dart_clang_createIndex>(); /// Destroy the given index. /// @@ -123,14 +128,16 @@ class LibClang { void clang_disposeIndex( ffi.Pointer index, ) { - return (_clang_disposeIndex ??= - _lookup>('clang_disposeIndex') - .asFunction<_dart_clang_disposeIndex>())( + return _clang_disposeIndex( index, ); } - _dart_clang_disposeIndex? _clang_disposeIndex; + late final _clang_disposeIndex_ptr = + _lookup>( + 'clang_disposeIndex'); + late final _dart_clang_disposeIndex _clang_disposeIndex = + _clang_disposeIndex_ptr.asFunction<_dart_clang_disposeIndex>(); /// Sets general options associated with a CXIndex. /// @@ -147,16 +154,18 @@ class LibClang { ffi.Pointer arg0, int options, ) { - return (_clang_CXIndex_setGlobalOptions ??= - _lookup>( - 'clang_CXIndex_setGlobalOptions') - .asFunction<_dart_clang_CXIndex_setGlobalOptions>())( + return _clang_CXIndex_setGlobalOptions( arg0, options, ); } - _dart_clang_CXIndex_setGlobalOptions? _clang_CXIndex_setGlobalOptions; + late final _clang_CXIndex_setGlobalOptions_ptr = + _lookup>( + 'clang_CXIndex_setGlobalOptions'); + late final _dart_clang_CXIndex_setGlobalOptions + _clang_CXIndex_setGlobalOptions = _clang_CXIndex_setGlobalOptions_ptr + .asFunction<_dart_clang_CXIndex_setGlobalOptions>(); /// Gets the general options associated with a CXIndex. /// @@ -165,15 +174,17 @@ class LibClang { int clang_CXIndex_getGlobalOptions( ffi.Pointer arg0, ) { - return (_clang_CXIndex_getGlobalOptions ??= - _lookup>( - 'clang_CXIndex_getGlobalOptions') - .asFunction<_dart_clang_CXIndex_getGlobalOptions>())( + return _clang_CXIndex_getGlobalOptions( arg0, ); } - _dart_clang_CXIndex_getGlobalOptions? _clang_CXIndex_getGlobalOptions; + late final _clang_CXIndex_getGlobalOptions_ptr = + _lookup>( + 'clang_CXIndex_getGlobalOptions'); + late final _dart_clang_CXIndex_getGlobalOptions + _clang_CXIndex_getGlobalOptions = _clang_CXIndex_getGlobalOptions_ptr + .asFunction<_dart_clang_CXIndex_getGlobalOptions>(); /// Sets the invocation emission path option in a CXIndex. /// @@ -184,44 +195,50 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer Path, ) { - return (_clang_CXIndex_setInvocationEmissionPathOption ??= _lookup< - ffi.NativeFunction< - _c_clang_CXIndex_setInvocationEmissionPathOption>>( - 'clang_CXIndex_setInvocationEmissionPathOption') - .asFunction<_dart_clang_CXIndex_setInvocationEmissionPathOption>())( + return _clang_CXIndex_setInvocationEmissionPathOption( arg0, Path, ); } - _dart_clang_CXIndex_setInvocationEmissionPathOption? - _clang_CXIndex_setInvocationEmissionPathOption; + late final _clang_CXIndex_setInvocationEmissionPathOption_ptr = _lookup< + ffi.NativeFunction< + Native_clang_CXIndex_setInvocationEmissionPathOption>>( + 'clang_CXIndex_setInvocationEmissionPathOption'); + late final _dart_clang_CXIndex_setInvocationEmissionPathOption + _clang_CXIndex_setInvocationEmissionPathOption = + _clang_CXIndex_setInvocationEmissionPathOption_ptr + .asFunction<_dart_clang_CXIndex_setInvocationEmissionPathOption>(); /// Retrieve the complete file and path name of the given file. CXString clang_getFileName( ffi.Pointer SFile, ) { - return (_clang_getFileName ??= - _lookup>('clang_getFileName') - .asFunction<_dart_clang_getFileName>())( + return _clang_getFileName( SFile, ); } - _dart_clang_getFileName? _clang_getFileName; + late final _clang_getFileName_ptr = + _lookup>( + 'clang_getFileName'); + late final _dart_clang_getFileName _clang_getFileName = + _clang_getFileName_ptr.asFunction<_dart_clang_getFileName>(); /// Retrieve the last modification time of the given file. int clang_getFileTime( ffi.Pointer SFile, ) { - return (_clang_getFileTime ??= - _lookup>('clang_getFileTime') - .asFunction<_dart_clang_getFileTime>())( + return _clang_getFileTime( SFile, ); } - _dart_clang_getFileTime? _clang_getFileTime; + late final _clang_getFileTime_ptr = + _lookup>( + 'clang_getFileTime'); + late final _dart_clang_getFileTime _clang_getFileTime = + _clang_getFileTime_ptr.asFunction<_dart_clang_getFileTime>(); /// Retrieve the unique ID for the given \c file. /// @@ -233,16 +250,17 @@ class LibClang { ffi.Pointer file, ffi.Pointer outID, ) { - return (_clang_getFileUniqueID ??= - _lookup>( - 'clang_getFileUniqueID') - .asFunction<_dart_clang_getFileUniqueID>())( + return _clang_getFileUniqueID( file, outID, ); } - _dart_clang_getFileUniqueID? _clang_getFileUniqueID; + late final _clang_getFileUniqueID_ptr = + _lookup>( + 'clang_getFileUniqueID'); + late final _dart_clang_getFileUniqueID _clang_getFileUniqueID = + _clang_getFileUniqueID_ptr.asFunction<_dart_clang_getFileUniqueID>(); /// Determine whether the given header is guarded against /// multiple inclusions, either with the conventional @@ -251,16 +269,19 @@ class LibClang { ffi.Pointer tu, ffi.Pointer file, ) { - return (_clang_isFileMultipleIncludeGuarded ??= - _lookup>( - 'clang_isFileMultipleIncludeGuarded') - .asFunction<_dart_clang_isFileMultipleIncludeGuarded>())( + return _clang_isFileMultipleIncludeGuarded( tu, file, ); } - _dart_clang_isFileMultipleIncludeGuarded? _clang_isFileMultipleIncludeGuarded; + late final _clang_isFileMultipleIncludeGuarded_ptr = + _lookup>( + 'clang_isFileMultipleIncludeGuarded'); + late final _dart_clang_isFileMultipleIncludeGuarded + _clang_isFileMultipleIncludeGuarded = + _clang_isFileMultipleIncludeGuarded_ptr + .asFunction<_dart_clang_isFileMultipleIncludeGuarded>(); /// Retrieve a file handle within the given translation unit. /// @@ -274,15 +295,16 @@ class LibClang { ffi.Pointer tu, ffi.Pointer file_name, ) { - return (_clang_getFile ??= - _lookup>('clang_getFile') - .asFunction<_dart_clang_getFile>())( + return _clang_getFile( tu, file_name, ); } - _dart_clang_getFile? _clang_getFile; + late final _clang_getFile_ptr = + _lookup>('clang_getFile'); + late final _dart_clang_getFile _clang_getFile = + _clang_getFile_ptr.asFunction<_dart_clang_getFile>(); /// Retrieve the buffer associated with the given file. /// @@ -299,17 +321,18 @@ class LibClang { ffi.Pointer file, ffi.Pointer size, ) { - return (_clang_getFileContents ??= - _lookup>( - 'clang_getFileContents') - .asFunction<_dart_clang_getFileContents>())( + return _clang_getFileContents( tu, file, size, ); } - _dart_clang_getFileContents? _clang_getFileContents; + late final _clang_getFileContents_ptr = + _lookup>( + 'clang_getFileContents'); + late final _dart_clang_getFileContents _clang_getFileContents = + _clang_getFileContents_ptr.asFunction<_dart_clang_getFileContents>(); /// Returns non-zero if the \c file1 and \c file2 point to the same file, /// or they are both NULL. @@ -317,15 +340,17 @@ class LibClang { ffi.Pointer file1, ffi.Pointer file2, ) { - return (_clang_File_isEqual ??= - _lookup>('clang_File_isEqual') - .asFunction<_dart_clang_File_isEqual>())( + return _clang_File_isEqual( file1, file2, ); } - _dart_clang_File_isEqual? _clang_File_isEqual; + late final _clang_File_isEqual_ptr = + _lookup>( + 'clang_File_isEqual'); + late final _dart_clang_File_isEqual _clang_File_isEqual = + _clang_File_isEqual_ptr.asFunction<_dart_clang_File_isEqual>(); /// Returns the real path name of \c file. /// @@ -333,25 +358,28 @@ class LibClang { CXString clang_File_tryGetRealPathName( ffi.Pointer file, ) { - return (_clang_File_tryGetRealPathName ??= - _lookup>( - 'clang_File_tryGetRealPathName') - .asFunction<_dart_clang_File_tryGetRealPathName>())( + return _clang_File_tryGetRealPathName( file, ); } - _dart_clang_File_tryGetRealPathName? _clang_File_tryGetRealPathName; + late final _clang_File_tryGetRealPathName_ptr = + _lookup>( + 'clang_File_tryGetRealPathName'); + late final _dart_clang_File_tryGetRealPathName + _clang_File_tryGetRealPathName = _clang_File_tryGetRealPathName_ptr + .asFunction<_dart_clang_File_tryGetRealPathName>(); /// Retrieve a NULL (invalid) source location. CXSourceLocation clang_getNullLocation() { - return (_clang_getNullLocation ??= - _lookup>( - 'clang_getNullLocation') - .asFunction<_dart_clang_getNullLocation>())(); + return _clang_getNullLocation(); } - _dart_clang_getNullLocation? _clang_getNullLocation; + late final _clang_getNullLocation_ptr = + _lookup>( + 'clang_getNullLocation'); + late final _dart_clang_getNullLocation _clang_getNullLocation = + _clang_getNullLocation_ptr.asFunction<_dart_clang_getNullLocation>(); /// Determine whether two source locations, which must refer into /// the same translation unit, refer to exactly the same point in the source @@ -363,16 +391,17 @@ class LibClang { CXSourceLocation loc1, CXSourceLocation loc2, ) { - return (_clang_equalLocations ??= - _lookup>( - 'clang_equalLocations') - .asFunction<_dart_clang_equalLocations>())( + return _clang_equalLocations( loc1, loc2, ); } - _dart_clang_equalLocations? _clang_equalLocations; + late final _clang_equalLocations_ptr = + _lookup>( + 'clang_equalLocations'); + late final _dart_clang_equalLocations _clang_equalLocations = + _clang_equalLocations_ptr.asFunction<_dart_clang_equalLocations>(); /// Retrieves the source location associated with a given file/line/column /// in a particular translation unit. @@ -382,9 +411,7 @@ class LibClang { int line, int column, ) { - return (_clang_getLocation ??= - _lookup>('clang_getLocation') - .asFunction<_dart_clang_getLocation>())( + return _clang_getLocation( tu, file, line, @@ -392,7 +419,11 @@ class LibClang { ); } - _dart_clang_getLocation? _clang_getLocation; + late final _clang_getLocation_ptr = + _lookup>( + 'clang_getLocation'); + late final _dart_clang_getLocation _clang_getLocation = + _clang_getLocation_ptr.asFunction<_dart_clang_getLocation>(); /// Retrieves the source location associated with a given character offset /// in a particular translation unit. @@ -401,55 +432,63 @@ class LibClang { ffi.Pointer file, int offset, ) { - return (_clang_getLocationForOffset ??= - _lookup>( - 'clang_getLocationForOffset') - .asFunction<_dart_clang_getLocationForOffset>())( + return _clang_getLocationForOffset( tu, file, offset, ); } - _dart_clang_getLocationForOffset? _clang_getLocationForOffset; + late final _clang_getLocationForOffset_ptr = + _lookup>( + 'clang_getLocationForOffset'); + late final _dart_clang_getLocationForOffset _clang_getLocationForOffset = + _clang_getLocationForOffset_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_Location_isInSystemHeader') - .asFunction<_dart_clang_Location_isInSystemHeader>())( + return _clang_Location_isInSystemHeader( location, ); } - _dart_clang_Location_isInSystemHeader? _clang_Location_isInSystemHeader; + late final _clang_Location_isInSystemHeader_ptr = + _lookup>( + 'clang_Location_isInSystemHeader'); + late final _dart_clang_Location_isInSystemHeader + _clang_Location_isInSystemHeader = _clang_Location_isInSystemHeader_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_Location_isFromMainFile') - .asFunction<_dart_clang_Location_isFromMainFile>())( + return _clang_Location_isFromMainFile( location, ); } - _dart_clang_Location_isFromMainFile? _clang_Location_isFromMainFile; + late final _clang_Location_isFromMainFile_ptr = + _lookup>( + 'clang_Location_isFromMainFile'); + late final _dart_clang_Location_isFromMainFile + _clang_Location_isFromMainFile = _clang_Location_isFromMainFile_ptr + .asFunction<_dart_clang_Location_isFromMainFile>(); /// Retrieve a NULL (invalid) source range. CXSourceRange clang_getNullRange() { - return (_clang_getNullRange ??= - _lookup>('clang_getNullRange') - .asFunction<_dart_clang_getNullRange>())(); + return _clang_getNullRange(); } - _dart_clang_getNullRange? _clang_getNullRange; + late final _clang_getNullRange_ptr = + _lookup>( + 'clang_getNullRange'); + late final _dart_clang_getNullRange _clang_getNullRange = + _clang_getNullRange_ptr.asFunction<_dart_clang_getNullRange>(); /// Retrieve a source range given the beginning and ending source /// locations. @@ -457,15 +496,16 @@ class LibClang { CXSourceLocation begin, CXSourceLocation end, ) { - return (_clang_getRange ??= - _lookup>('clang_getRange') - .asFunction<_dart_clang_getRange>())( + return _clang_getRange( begin, end, ); } - _dart_clang_getRange? _clang_getRange; + late final _clang_getRange_ptr = + _lookup>('clang_getRange'); + late final _dart_clang_getRange _clang_getRange = + _clang_getRange_ptr.asFunction<_dart_clang_getRange>(); /// Determine whether two ranges are equivalent. /// @@ -474,28 +514,32 @@ class LibClang { CXSourceRange range1, CXSourceRange range2, ) { - return (_clang_equalRanges ??= - _lookup>('clang_equalRanges') - .asFunction<_dart_clang_equalRanges>())( + return _clang_equalRanges( range1, range2, ); } - _dart_clang_equalRanges? _clang_equalRanges; + late final _clang_equalRanges_ptr = + _lookup>( + 'clang_equalRanges'); + late final _dart_clang_equalRanges _clang_equalRanges = + _clang_equalRanges_ptr.asFunction<_dart_clang_equalRanges>(); /// Returns non-zero if \p range is null. int clang_Range_isNull( CXSourceRange range, ) { - return (_clang_Range_isNull ??= - _lookup>('clang_Range_isNull') - .asFunction<_dart_clang_Range_isNull>())( + return _clang_Range_isNull( range, ); } - _dart_clang_Range_isNull? _clang_Range_isNull; + late final _clang_Range_isNull_ptr = + _lookup>( + 'clang_Range_isNull'); + late final _dart_clang_Range_isNull _clang_Range_isNull = + _clang_Range_isNull_ptr.asFunction<_dart_clang_Range_isNull>(); /// Retrieve the file, line, column, and offset represented by /// the given source location. @@ -524,10 +568,7 @@ class LibClang { ffi.Pointer column, ffi.Pointer offset, ) { - return (_clang_getExpansionLocation ??= - _lookup>( - 'clang_getExpansionLocation') - .asFunction<_dart_clang_getExpansionLocation>())( + return _clang_getExpansionLocation( location, file, line, @@ -536,7 +577,12 @@ class LibClang { ); } - _dart_clang_getExpansionLocation? _clang_getExpansionLocation; + late final _clang_getExpansionLocation_ptr = + _lookup>( + 'clang_getExpansionLocation'); + late final _dart_clang_getExpansionLocation _clang_getExpansionLocation = + _clang_getExpansionLocation_ptr + .asFunction<_dart_clang_getExpansionLocation>(); /// Retrieve the file, line and column represented by the given source /// location, as specified in a # line directive. @@ -582,10 +628,7 @@ class LibClang { ffi.Pointer line, ffi.Pointer column, ) { - return (_clang_getPresumedLocation ??= - _lookup>( - 'clang_getPresumedLocation') - .asFunction<_dart_clang_getPresumedLocation>())( + return _clang_getPresumedLocation( location, filename, line, @@ -593,7 +636,12 @@ class LibClang { ); } - _dart_clang_getPresumedLocation? _clang_getPresumedLocation; + late final _clang_getPresumedLocation_ptr = + _lookup>( + 'clang_getPresumedLocation'); + late final _dart_clang_getPresumedLocation _clang_getPresumedLocation = + _clang_getPresumedLocation_ptr + .asFunction<_dart_clang_getPresumedLocation>(); /// Legacy API to retrieve the file, line, column, and offset represented /// by the given source location. @@ -608,10 +656,7 @@ class LibClang { ffi.Pointer column, ffi.Pointer offset, ) { - return (_clang_getInstantiationLocation ??= - _lookup>( - 'clang_getInstantiationLocation') - .asFunction<_dart_clang_getInstantiationLocation>())( + return _clang_getInstantiationLocation( location, file, line, @@ -620,7 +665,12 @@ class LibClang { ); } - _dart_clang_getInstantiationLocation? _clang_getInstantiationLocation; + late final _clang_getInstantiationLocation_ptr = + _lookup>( + 'clang_getInstantiationLocation'); + late final _dart_clang_getInstantiationLocation + _clang_getInstantiationLocation = _clang_getInstantiationLocation_ptr + .asFunction<_dart_clang_getInstantiationLocation>(); /// Retrieve the file, line, column, and offset represented by /// the given source location. @@ -649,10 +699,7 @@ class LibClang { ffi.Pointer column, ffi.Pointer offset, ) { - return (_clang_getSpellingLocation ??= - _lookup>( - 'clang_getSpellingLocation') - .asFunction<_dart_clang_getSpellingLocation>())( + return _clang_getSpellingLocation( location, file, line, @@ -661,7 +708,12 @@ class LibClang { ); } - _dart_clang_getSpellingLocation? _clang_getSpellingLocation; + late final _clang_getSpellingLocation_ptr = + _lookup>( + 'clang_getSpellingLocation'); + late final _dart_clang_getSpellingLocation _clang_getSpellingLocation = + _clang_getSpellingLocation_ptr + .asFunction<_dart_clang_getSpellingLocation>(); /// Retrieve the file, line, column, and offset represented by /// the given source location. @@ -691,10 +743,7 @@ class LibClang { ffi.Pointer column, ffi.Pointer offset, ) { - return (_clang_getFileLocation ??= - _lookup>( - 'clang_getFileLocation') - .asFunction<_dart_clang_getFileLocation>())( + return _clang_getFileLocation( location, file, line, @@ -703,36 +752,43 @@ class LibClang { ); } - _dart_clang_getFileLocation? _clang_getFileLocation; + late final _clang_getFileLocation_ptr = + _lookup>( + 'clang_getFileLocation'); + late final _dart_clang_getFileLocation _clang_getFileLocation = + _clang_getFileLocation_ptr.asFunction<_dart_clang_getFileLocation>(); /// Retrieve a source location representing the first character within a /// source range. CXSourceLocation clang_getRangeStart( CXSourceRange range, ) { - return (_clang_getRangeStart ??= - _lookup>( - 'clang_getRangeStart') - .asFunction<_dart_clang_getRangeStart>())( + return _clang_getRangeStart( range, ); } - _dart_clang_getRangeStart? _clang_getRangeStart; + late final _clang_getRangeStart_ptr = + _lookup>( + 'clang_getRangeStart'); + late final _dart_clang_getRangeStart _clang_getRangeStart = + _clang_getRangeStart_ptr.asFunction<_dart_clang_getRangeStart>(); /// Retrieve a source location representing the last character within a /// source range. CXSourceLocation clang_getRangeEnd( CXSourceRange range, ) { - return (_clang_getRangeEnd ??= - _lookup>('clang_getRangeEnd') - .asFunction<_dart_clang_getRangeEnd>())( + return _clang_getRangeEnd( range, ); } - _dart_clang_getRangeEnd? _clang_getRangeEnd; + late final _clang_getRangeEnd_ptr = + _lookup>( + 'clang_getRangeEnd'); + late final _dart_clang_getRangeEnd _clang_getRangeEnd = + _clang_getRangeEnd_ptr.asFunction<_dart_clang_getRangeEnd>(); /// Retrieve all ranges that were skipped by the preprocessor. /// @@ -742,16 +798,17 @@ class LibClang { ffi.Pointer tu, ffi.Pointer file, ) { - return (_clang_getSkippedRanges ??= - _lookup>( - 'clang_getSkippedRanges') - .asFunction<_dart_clang_getSkippedRanges>())( + return _clang_getSkippedRanges( tu, file, ); } - _dart_clang_getSkippedRanges? _clang_getSkippedRanges; + late final _clang_getSkippedRanges_ptr = + _lookup>( + 'clang_getSkippedRanges'); + late final _dart_clang_getSkippedRanges _clang_getSkippedRanges = + _clang_getSkippedRanges_ptr.asFunction<_dart_clang_getSkippedRanges>(); /// Retrieve all ranges from all files that were skipped by the /// preprocessor. @@ -761,43 +818,49 @@ class LibClang { ffi.Pointer clang_getAllSkippedRanges( ffi.Pointer tu, ) { - return (_clang_getAllSkippedRanges ??= - _lookup>( - 'clang_getAllSkippedRanges') - .asFunction<_dart_clang_getAllSkippedRanges>())( + return _clang_getAllSkippedRanges( tu, ); } - _dart_clang_getAllSkippedRanges? _clang_getAllSkippedRanges; + late final _clang_getAllSkippedRanges_ptr = + _lookup>( + 'clang_getAllSkippedRanges'); + late final _dart_clang_getAllSkippedRanges _clang_getAllSkippedRanges = + _clang_getAllSkippedRanges_ptr + .asFunction<_dart_clang_getAllSkippedRanges>(); /// Destroy the given \c CXSourceRangeList. void clang_disposeSourceRangeList( ffi.Pointer ranges, ) { - return (_clang_disposeSourceRangeList ??= - _lookup>( - 'clang_disposeSourceRangeList') - .asFunction<_dart_clang_disposeSourceRangeList>())( + return _clang_disposeSourceRangeList( ranges, ); } - _dart_clang_disposeSourceRangeList? _clang_disposeSourceRangeList; + late final _clang_disposeSourceRangeList_ptr = + _lookup>( + 'clang_disposeSourceRangeList'); + late final _dart_clang_disposeSourceRangeList _clang_disposeSourceRangeList = + _clang_disposeSourceRangeList_ptr + .asFunction<_dart_clang_disposeSourceRangeList>(); /// Determine the number of diagnostics in a CXDiagnosticSet. int clang_getNumDiagnosticsInSet( ffi.Pointer Diags, ) { - return (_clang_getNumDiagnosticsInSet ??= - _lookup>( - 'clang_getNumDiagnosticsInSet') - .asFunction<_dart_clang_getNumDiagnosticsInSet>())( + return _clang_getNumDiagnosticsInSet( Diags, ); } - _dart_clang_getNumDiagnosticsInSet? _clang_getNumDiagnosticsInSet; + late final _clang_getNumDiagnosticsInSet_ptr = + _lookup>( + 'clang_getNumDiagnosticsInSet'); + late final _dart_clang_getNumDiagnosticsInSet _clang_getNumDiagnosticsInSet = + _clang_getNumDiagnosticsInSet_ptr + .asFunction<_dart_clang_getNumDiagnosticsInSet>(); /// Retrieve a diagnostic associated with the given CXDiagnosticSet. /// @@ -810,16 +873,18 @@ class LibClang { ffi.Pointer Diags, int Index, ) { - return (_clang_getDiagnosticInSet ??= - _lookup>( - 'clang_getDiagnosticInSet') - .asFunction<_dart_clang_getDiagnosticInSet>())( + return _clang_getDiagnosticInSet( Diags, Index, ); } - _dart_clang_getDiagnosticInSet? _clang_getDiagnosticInSet; + late final _clang_getDiagnosticInSet_ptr = + _lookup>( + 'clang_getDiagnosticInSet'); + late final _dart_clang_getDiagnosticInSet _clang_getDiagnosticInSet = + _clang_getDiagnosticInSet_ptr + .asFunction<_dart_clang_getDiagnosticInSet>(); /// Deserialize a set of diagnostics from a Clang diagnostics bitcode /// file. @@ -837,31 +902,34 @@ class LibClang { ffi.Pointer error, ffi.Pointer errorString, ) { - return (_clang_loadDiagnostics ??= - _lookup>( - 'clang_loadDiagnostics') - .asFunction<_dart_clang_loadDiagnostics>())( + return _clang_loadDiagnostics( file, error, errorString, ); } - _dart_clang_loadDiagnostics? _clang_loadDiagnostics; + late final _clang_loadDiagnostics_ptr = + _lookup>( + 'clang_loadDiagnostics'); + late final _dart_clang_loadDiagnostics _clang_loadDiagnostics = + _clang_loadDiagnostics_ptr.asFunction<_dart_clang_loadDiagnostics>(); /// Release a CXDiagnosticSet and all of its contained diagnostics. void clang_disposeDiagnosticSet( ffi.Pointer Diags, ) { - return (_clang_disposeDiagnosticSet ??= - _lookup>( - 'clang_disposeDiagnosticSet') - .asFunction<_dart_clang_disposeDiagnosticSet>())( + return _clang_disposeDiagnosticSet( Diags, ); } - _dart_clang_disposeDiagnosticSet? _clang_disposeDiagnosticSet; + late final _clang_disposeDiagnosticSet_ptr = + _lookup>( + 'clang_disposeDiagnosticSet'); + late final _dart_clang_disposeDiagnosticSet _clang_disposeDiagnosticSet = + _clang_disposeDiagnosticSet_ptr + .asFunction<_dart_clang_disposeDiagnosticSet>(); /// Retrieve the child diagnostics of a CXDiagnostic. /// @@ -870,30 +938,33 @@ class LibClang { ffi.Pointer clang_getChildDiagnostics( ffi.Pointer D, ) { - return (_clang_getChildDiagnostics ??= - _lookup>( - 'clang_getChildDiagnostics') - .asFunction<_dart_clang_getChildDiagnostics>())( + return _clang_getChildDiagnostics( D, ); } - _dart_clang_getChildDiagnostics? _clang_getChildDiagnostics; + late final _clang_getChildDiagnostics_ptr = + _lookup>( + 'clang_getChildDiagnostics'); + late final _dart_clang_getChildDiagnostics _clang_getChildDiagnostics = + _clang_getChildDiagnostics_ptr + .asFunction<_dart_clang_getChildDiagnostics>(); /// Determine the number of diagnostics produced for the given /// translation unit. int clang_getNumDiagnostics( ffi.Pointer Unit, ) { - return (_clang_getNumDiagnostics ??= - _lookup>( - 'clang_getNumDiagnostics') - .asFunction<_dart_clang_getNumDiagnostics>())( + return _clang_getNumDiagnostics( Unit, ); } - _dart_clang_getNumDiagnostics? _clang_getNumDiagnostics; + late final _clang_getNumDiagnostics_ptr = + _lookup>( + 'clang_getNumDiagnostics'); + late final _dart_clang_getNumDiagnostics _clang_getNumDiagnostics = + _clang_getNumDiagnostics_ptr.asFunction<_dart_clang_getNumDiagnostics>(); /// Retrieve a diagnostic associated with the given translation unit. /// @@ -906,16 +977,17 @@ class LibClang { ffi.Pointer Unit, int Index, ) { - return (_clang_getDiagnostic ??= - _lookup>( - 'clang_getDiagnostic') - .asFunction<_dart_clang_getDiagnostic>())( + return _clang_getDiagnostic( Unit, Index, ); } - _dart_clang_getDiagnostic? _clang_getDiagnostic; + late final _clang_getDiagnostic_ptr = + _lookup>( + 'clang_getDiagnostic'); + late final _dart_clang_getDiagnostic _clang_getDiagnostic = + _clang_getDiagnostic_ptr.asFunction<_dart_clang_getDiagnostic>(); /// Retrieve the complete set of diagnostics associated with a /// translation unit. @@ -924,29 +996,32 @@ class LibClang { ffi.Pointer clang_getDiagnosticSetFromTU( ffi.Pointer Unit, ) { - return (_clang_getDiagnosticSetFromTU ??= - _lookup>( - 'clang_getDiagnosticSetFromTU') - .asFunction<_dart_clang_getDiagnosticSetFromTU>())( + return _clang_getDiagnosticSetFromTU( Unit, ); } - _dart_clang_getDiagnosticSetFromTU? _clang_getDiagnosticSetFromTU; + late final _clang_getDiagnosticSetFromTU_ptr = + _lookup>( + 'clang_getDiagnosticSetFromTU'); + late final _dart_clang_getDiagnosticSetFromTU _clang_getDiagnosticSetFromTU = + _clang_getDiagnosticSetFromTU_ptr + .asFunction<_dart_clang_getDiagnosticSetFromTU>(); /// Destroy a diagnostic. void clang_disposeDiagnostic( ffi.Pointer Diagnostic, ) { - return (_clang_disposeDiagnostic ??= - _lookup>( - 'clang_disposeDiagnostic') - .asFunction<_dart_clang_disposeDiagnostic>())( + return _clang_disposeDiagnostic( Diagnostic, ); } - _dart_clang_disposeDiagnostic? _clang_disposeDiagnostic; + late final _clang_disposeDiagnostic_ptr = + _lookup>( + 'clang_disposeDiagnostic'); + late final _dart_clang_disposeDiagnostic _clang_disposeDiagnostic = + _clang_disposeDiagnostic_ptr.asFunction<_dart_clang_disposeDiagnostic>(); /// Format the given diagnostic in a manner that is suitable for display. /// @@ -965,16 +1040,17 @@ class LibClang { ffi.Pointer Diagnostic, int Options, ) { - return (_clang_formatDiagnostic ??= - _lookup>( - 'clang_formatDiagnostic') - .asFunction<_dart_clang_formatDiagnostic>())( + return _clang_formatDiagnostic( Diagnostic, Options, ); } - _dart_clang_formatDiagnostic? _clang_formatDiagnostic; + late final _clang_formatDiagnostic_ptr = + _lookup>( + 'clang_formatDiagnostic'); + late final _dart_clang_formatDiagnostic _clang_formatDiagnostic = + _clang_formatDiagnostic_ptr.asFunction<_dart_clang_formatDiagnostic>(); /// Retrieve the set of display options most similar to the /// default behavior of the clang compiler. @@ -982,28 +1058,32 @@ class LibClang { /// \returns A set of display options suitable for use with \c /// clang_formatDiagnostic(). int clang_defaultDiagnosticDisplayOptions() { - return (_clang_defaultDiagnosticDisplayOptions ??= - _lookup>( - 'clang_defaultDiagnosticDisplayOptions') - .asFunction<_dart_clang_defaultDiagnosticDisplayOptions>())(); + return _clang_defaultDiagnosticDisplayOptions(); } - _dart_clang_defaultDiagnosticDisplayOptions? - _clang_defaultDiagnosticDisplayOptions; + late final _clang_defaultDiagnosticDisplayOptions_ptr = + _lookup>( + 'clang_defaultDiagnosticDisplayOptions'); + late final _dart_clang_defaultDiagnosticDisplayOptions + _clang_defaultDiagnosticDisplayOptions = + _clang_defaultDiagnosticDisplayOptions_ptr + .asFunction<_dart_clang_defaultDiagnosticDisplayOptions>(); /// Determine the severity of the given diagnostic. int clang_getDiagnosticSeverity( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticSeverity ??= - _lookup>( - 'clang_getDiagnosticSeverity') - .asFunction<_dart_clang_getDiagnosticSeverity>())( + return _clang_getDiagnosticSeverity( arg0, ); } - _dart_clang_getDiagnosticSeverity? _clang_getDiagnosticSeverity; + late final _clang_getDiagnosticSeverity_ptr = + _lookup>( + 'clang_getDiagnosticSeverity'); + late final _dart_clang_getDiagnosticSeverity _clang_getDiagnosticSeverity = + _clang_getDiagnosticSeverity_ptr + .asFunction<_dart_clang_getDiagnosticSeverity>(); /// Retrieve the source location of the given diagnostic. /// @@ -1012,29 +1092,33 @@ class LibClang { CXSourceLocation clang_getDiagnosticLocation( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticLocation ??= - _lookup>( - 'clang_getDiagnosticLocation') - .asFunction<_dart_clang_getDiagnosticLocation>())( + return _clang_getDiagnosticLocation( arg0, ); } - _dart_clang_getDiagnosticLocation? _clang_getDiagnosticLocation; + late final _clang_getDiagnosticLocation_ptr = + _lookup>( + 'clang_getDiagnosticLocation'); + late final _dart_clang_getDiagnosticLocation _clang_getDiagnosticLocation = + _clang_getDiagnosticLocation_ptr + .asFunction<_dart_clang_getDiagnosticLocation>(); /// Retrieve the text of the given diagnostic. CXString clang_getDiagnosticSpelling( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticSpelling ??= - _lookup>( - 'clang_getDiagnosticSpelling') - .asFunction<_dart_clang_getDiagnosticSpelling>())( + return _clang_getDiagnosticSpelling( arg0, ); } - _dart_clang_getDiagnosticSpelling? _clang_getDiagnosticSpelling; + late final _clang_getDiagnosticSpelling_ptr = + _lookup>( + 'clang_getDiagnosticSpelling'); + late final _dart_clang_getDiagnosticSpelling _clang_getDiagnosticSpelling = + _clang_getDiagnosticSpelling_ptr + .asFunction<_dart_clang_getDiagnosticSpelling>(); /// Retrieve the name of the command-line option that enabled this /// diagnostic. @@ -1050,16 +1134,18 @@ class LibClang { ffi.Pointer Diag, ffi.Pointer Disable, ) { - return (_clang_getDiagnosticOption ??= - _lookup>( - 'clang_getDiagnosticOption') - .asFunction<_dart_clang_getDiagnosticOption>())( + return _clang_getDiagnosticOption( Diag, Disable, ); } - _dart_clang_getDiagnosticOption? _clang_getDiagnosticOption; + late final _clang_getDiagnosticOption_ptr = + _lookup>( + 'clang_getDiagnosticOption'); + late final _dart_clang_getDiagnosticOption _clang_getDiagnosticOption = + _clang_getDiagnosticOption_ptr + .asFunction<_dart_clang_getDiagnosticOption>(); /// Retrieve the category number for this diagnostic. /// @@ -1072,15 +1158,17 @@ class LibClang { int clang_getDiagnosticCategory( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticCategory ??= - _lookup>( - 'clang_getDiagnosticCategory') - .asFunction<_dart_clang_getDiagnosticCategory>())( + return _clang_getDiagnosticCategory( arg0, ); } - _dart_clang_getDiagnosticCategory? _clang_getDiagnosticCategory; + late final _clang_getDiagnosticCategory_ptr = + _lookup>( + 'clang_getDiagnosticCategory'); + late final _dart_clang_getDiagnosticCategory _clang_getDiagnosticCategory = + _clang_getDiagnosticCategory_ptr + .asFunction<_dart_clang_getDiagnosticCategory>(); /// Retrieve the name of a particular diagnostic category. This /// is now deprecated. Use clang_getDiagnosticCategoryText() @@ -1093,15 +1181,17 @@ class LibClang { CXString clang_getDiagnosticCategoryName( int Category, ) { - return (_clang_getDiagnosticCategoryName ??= - _lookup>( - 'clang_getDiagnosticCategoryName') - .asFunction<_dart_clang_getDiagnosticCategoryName>())( + return _clang_getDiagnosticCategoryName( Category, ); } - _dart_clang_getDiagnosticCategoryName? _clang_getDiagnosticCategoryName; + late final _clang_getDiagnosticCategoryName_ptr = + _lookup>( + 'clang_getDiagnosticCategoryName'); + late final _dart_clang_getDiagnosticCategoryName + _clang_getDiagnosticCategoryName = _clang_getDiagnosticCategoryName_ptr + .asFunction<_dart_clang_getDiagnosticCategoryName>(); /// Retrieve the diagnostic category text for a given diagnostic. /// @@ -1109,30 +1199,34 @@ class LibClang { CXString clang_getDiagnosticCategoryText( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticCategoryText ??= - _lookup>( - 'clang_getDiagnosticCategoryText') - .asFunction<_dart_clang_getDiagnosticCategoryText>())( + return _clang_getDiagnosticCategoryText( arg0, ); } - _dart_clang_getDiagnosticCategoryText? _clang_getDiagnosticCategoryText; + late final _clang_getDiagnosticCategoryText_ptr = + _lookup>( + 'clang_getDiagnosticCategoryText'); + late final _dart_clang_getDiagnosticCategoryText + _clang_getDiagnosticCategoryText = _clang_getDiagnosticCategoryText_ptr + .asFunction<_dart_clang_getDiagnosticCategoryText>(); /// Determine the number of source ranges associated with the given /// diagnostic. int clang_getDiagnosticNumRanges( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticNumRanges ??= - _lookup>( - 'clang_getDiagnosticNumRanges') - .asFunction<_dart_clang_getDiagnosticNumRanges>())( + return _clang_getDiagnosticNumRanges( arg0, ); } - _dart_clang_getDiagnosticNumRanges? _clang_getDiagnosticNumRanges; + late final _clang_getDiagnosticNumRanges_ptr = + _lookup>( + 'clang_getDiagnosticNumRanges'); + late final _dart_clang_getDiagnosticNumRanges _clang_getDiagnosticNumRanges = + _clang_getDiagnosticNumRanges_ptr + .asFunction<_dart_clang_getDiagnosticNumRanges>(); /// Retrieve a source range associated with the diagnostic. /// @@ -1149,31 +1243,35 @@ class LibClang { ffi.Pointer Diagnostic, int Range, ) { - return (_clang_getDiagnosticRange ??= - _lookup>( - 'clang_getDiagnosticRange') - .asFunction<_dart_clang_getDiagnosticRange>())( + return _clang_getDiagnosticRange( Diagnostic, Range, ); } - _dart_clang_getDiagnosticRange? _clang_getDiagnosticRange; + late final _clang_getDiagnosticRange_ptr = + _lookup>( + 'clang_getDiagnosticRange'); + late final _dart_clang_getDiagnosticRange _clang_getDiagnosticRange = + _clang_getDiagnosticRange_ptr + .asFunction<_dart_clang_getDiagnosticRange>(); /// Determine the number of fix-it hints associated with the /// given diagnostic. int clang_getDiagnosticNumFixIts( ffi.Pointer Diagnostic, ) { - return (_clang_getDiagnosticNumFixIts ??= - _lookup>( - 'clang_getDiagnosticNumFixIts') - .asFunction<_dart_clang_getDiagnosticNumFixIts>())( + return _clang_getDiagnosticNumFixIts( Diagnostic, ); } - _dart_clang_getDiagnosticNumFixIts? _clang_getDiagnosticNumFixIts; + late final _clang_getDiagnosticNumFixIts_ptr = + _lookup>( + 'clang_getDiagnosticNumFixIts'); + late final _dart_clang_getDiagnosticNumFixIts _clang_getDiagnosticNumFixIts = + _clang_getDiagnosticNumFixIts_ptr + .asFunction<_dart_clang_getDiagnosticNumFixIts>(); /// Retrieve the replacement information for a given fix-it. /// @@ -1203,31 +1301,35 @@ class LibClang { int FixIt, ffi.Pointer ReplacementRange, ) { - return (_clang_getDiagnosticFixIt ??= - _lookup>( - 'clang_getDiagnosticFixIt') - .asFunction<_dart_clang_getDiagnosticFixIt>())( + return _clang_getDiagnosticFixIt( Diagnostic, FixIt, ReplacementRange, ); } - _dart_clang_getDiagnosticFixIt? _clang_getDiagnosticFixIt; + late final _clang_getDiagnosticFixIt_ptr = + _lookup>( + 'clang_getDiagnosticFixIt'); + late final _dart_clang_getDiagnosticFixIt _clang_getDiagnosticFixIt = + _clang_getDiagnosticFixIt_ptr + .asFunction<_dart_clang_getDiagnosticFixIt>(); /// Get the original translation unit source file name. CXString clang_getTranslationUnitSpelling( ffi.Pointer CTUnit, ) { - return (_clang_getTranslationUnitSpelling ??= - _lookup>( - 'clang_getTranslationUnitSpelling') - .asFunction<_dart_clang_getTranslationUnitSpelling>())( + return _clang_getTranslationUnitSpelling( CTUnit, ); } - _dart_clang_getTranslationUnitSpelling? _clang_getTranslationUnitSpelling; + late final _clang_getTranslationUnitSpelling_ptr = + _lookup>( + 'clang_getTranslationUnitSpelling'); + late final _dart_clang_getTranslationUnitSpelling + _clang_getTranslationUnitSpelling = _clang_getTranslationUnitSpelling_ptr + .asFunction<_dart_clang_getTranslationUnitSpelling>(); /// Return the CXTranslationUnit for a given source file and the provided /// command line arguments one would pass to the compiler. @@ -1275,11 +1377,7 @@ class LibClang { int num_unsaved_files, ffi.Pointer unsaved_files, ) { - return (_clang_createTranslationUnitFromSourceFile ??= _lookup< - ffi.NativeFunction< - _c_clang_createTranslationUnitFromSourceFile>>( - 'clang_createTranslationUnitFromSourceFile') - .asFunction<_dart_clang_createTranslationUnitFromSourceFile>())( + return _clang_createTranslationUnitFromSourceFile( CIdx, source_filename, num_clang_command_line_args, @@ -1289,8 +1387,13 @@ class LibClang { ); } - _dart_clang_createTranslationUnitFromSourceFile? - _clang_createTranslationUnitFromSourceFile; + late final _clang_createTranslationUnitFromSourceFile_ptr = _lookup< + ffi.NativeFunction>( + 'clang_createTranslationUnitFromSourceFile'); + late final _dart_clang_createTranslationUnitFromSourceFile + _clang_createTranslationUnitFromSourceFile = + _clang_createTranslationUnitFromSourceFile_ptr + .asFunction<_dart_clang_createTranslationUnitFromSourceFile>(); /// Same as \c clang_createTranslationUnit2, but returns /// the \c CXTranslationUnit instead of an error code. In case of an error this @@ -1300,16 +1403,18 @@ class LibClang { ffi.Pointer CIdx, ffi.Pointer ast_filename, ) { - return (_clang_createTranslationUnit ??= - _lookup>( - 'clang_createTranslationUnit') - .asFunction<_dart_clang_createTranslationUnit>())( + return _clang_createTranslationUnit( CIdx, ast_filename, ); } - _dart_clang_createTranslationUnit? _clang_createTranslationUnit; + late final _clang_createTranslationUnit_ptr = + _lookup>( + 'clang_createTranslationUnit'); + late final _dart_clang_createTranslationUnit _clang_createTranslationUnit = + _clang_createTranslationUnit_ptr + .asFunction<_dart_clang_createTranslationUnit>(); /// Create a translation unit from an AST file (\c -emit-ast). /// @@ -1322,17 +1427,19 @@ class LibClang { ffi.Pointer ast_filename, ffi.Pointer> out_TU, ) { - return (_clang_createTranslationUnit2 ??= - _lookup>( - 'clang_createTranslationUnit2') - .asFunction<_dart_clang_createTranslationUnit2>())( + return _clang_createTranslationUnit2( CIdx, ast_filename, out_TU, ); } - _dart_clang_createTranslationUnit2? _clang_createTranslationUnit2; + late final _clang_createTranslationUnit2_ptr = + _lookup>( + 'clang_createTranslationUnit2'); + late final _dart_clang_createTranslationUnit2 _clang_createTranslationUnit2 = + _clang_createTranslationUnit2_ptr + .asFunction<_dart_clang_createTranslationUnit2>(); /// Returns the set of flags that is suitable for parsing a translation /// unit that is being edited. @@ -1345,15 +1452,17 @@ class LibClang { /// preamble) geared toward improving the performance of these routines. The /// set of optimizations enabled may change from one version to the next. int clang_defaultEditingTranslationUnitOptions() { - return (_clang_defaultEditingTranslationUnitOptions ??= _lookup< - ffi.NativeFunction< - _c_clang_defaultEditingTranslationUnitOptions>>( - 'clang_defaultEditingTranslationUnitOptions') - .asFunction<_dart_clang_defaultEditingTranslationUnitOptions>())(); + return _clang_defaultEditingTranslationUnitOptions(); } - _dart_clang_defaultEditingTranslationUnitOptions? - _clang_defaultEditingTranslationUnitOptions; + late final _clang_defaultEditingTranslationUnitOptions_ptr = _lookup< + ffi.NativeFunction< + Native_clang_defaultEditingTranslationUnitOptions>>( + 'clang_defaultEditingTranslationUnitOptions'); + late final _dart_clang_defaultEditingTranslationUnitOptions + _clang_defaultEditingTranslationUnitOptions = + _clang_defaultEditingTranslationUnitOptions_ptr + .asFunction<_dart_clang_defaultEditingTranslationUnitOptions>(); /// Same as \c clang_parseTranslationUnit2, but returns /// the \c CXTranslationUnit instead of an error code. In case of an error this @@ -1368,10 +1477,7 @@ class LibClang { int num_unsaved_files, int options, ) { - return (_clang_parseTranslationUnit ??= - _lookup>( - 'clang_parseTranslationUnit') - .asFunction<_dart_clang_parseTranslationUnit>())( + return _clang_parseTranslationUnit( CIdx, source_filename, command_line_args, @@ -1382,7 +1488,12 @@ class LibClang { ); } - _dart_clang_parseTranslationUnit? _clang_parseTranslationUnit; + late final _clang_parseTranslationUnit_ptr = + _lookup>( + 'clang_parseTranslationUnit'); + late final _dart_clang_parseTranslationUnit _clang_parseTranslationUnit = + _clang_parseTranslationUnit_ptr + .asFunction<_dart_clang_parseTranslationUnit>(); /// Parse the given source file and the translation unit corresponding /// to that file. @@ -1436,10 +1547,7 @@ class LibClang { int options, ffi.Pointer> out_TU, ) { - return (_clang_parseTranslationUnit2 ??= - _lookup>( - 'clang_parseTranslationUnit2') - .asFunction<_dart_clang_parseTranslationUnit2>())( + return _clang_parseTranslationUnit2( CIdx, source_filename, command_line_args, @@ -1451,7 +1559,12 @@ class LibClang { ); } - _dart_clang_parseTranslationUnit2? _clang_parseTranslationUnit2; + late final _clang_parseTranslationUnit2_ptr = + _lookup>( + 'clang_parseTranslationUnit2'); + late final _dart_clang_parseTranslationUnit2 _clang_parseTranslationUnit2 = + _clang_parseTranslationUnit2_ptr + .asFunction<_dart_clang_parseTranslationUnit2>(); /// Same as clang_parseTranslationUnit2 but requires a full command line /// for \c command_line_args including argv[0]. This is useful if the standard @@ -1466,10 +1579,7 @@ class LibClang { int options, ffi.Pointer> out_TU, ) { - return (_clang_parseTranslationUnit2FullArgv ??= - _lookup>( - 'clang_parseTranslationUnit2FullArgv') - .asFunction<_dart_clang_parseTranslationUnit2FullArgv>())( + return _clang_parseTranslationUnit2FullArgv( CIdx, source_filename, command_line_args, @@ -1481,8 +1591,13 @@ class LibClang { ); } - _dart_clang_parseTranslationUnit2FullArgv? - _clang_parseTranslationUnit2FullArgv; + late final _clang_parseTranslationUnit2FullArgv_ptr = + _lookup>( + 'clang_parseTranslationUnit2FullArgv'); + late final _dart_clang_parseTranslationUnit2FullArgv + _clang_parseTranslationUnit2FullArgv = + _clang_parseTranslationUnit2FullArgv_ptr + .asFunction<_dart_clang_parseTranslationUnit2FullArgv>(); /// Returns the set of flags that is suitable for saving a translation /// unit. @@ -1494,15 +1609,17 @@ class LibClang { int clang_defaultSaveOptions( ffi.Pointer TU, ) { - return (_clang_defaultSaveOptions ??= - _lookup>( - 'clang_defaultSaveOptions') - .asFunction<_dart_clang_defaultSaveOptions>())( + return _clang_defaultSaveOptions( TU, ); } - _dart_clang_defaultSaveOptions? _clang_defaultSaveOptions; + late final _clang_defaultSaveOptions_ptr = + _lookup>( + 'clang_defaultSaveOptions'); + late final _dart_clang_defaultSaveOptions _clang_defaultSaveOptions = + _clang_defaultSaveOptions_ptr + .asFunction<_dart_clang_defaultSaveOptions>(); /// Saves a translation unit into a serialized representation of /// that translation unit on disk. @@ -1530,17 +1647,19 @@ class LibClang { ffi.Pointer FileName, int options, ) { - return (_clang_saveTranslationUnit ??= - _lookup>( - 'clang_saveTranslationUnit') - .asFunction<_dart_clang_saveTranslationUnit>())( + return _clang_saveTranslationUnit( TU, FileName, options, ); } - _dart_clang_saveTranslationUnit? _clang_saveTranslationUnit; + late final _clang_saveTranslationUnit_ptr = + _lookup>( + 'clang_saveTranslationUnit'); + late final _dart_clang_saveTranslationUnit _clang_saveTranslationUnit = + _clang_saveTranslationUnit_ptr + .asFunction<_dart_clang_saveTranslationUnit>(); /// Suspend a translation unit in order to free memory associated with it. /// @@ -1550,29 +1669,33 @@ class LibClang { int clang_suspendTranslationUnit( ffi.Pointer arg0, ) { - return (_clang_suspendTranslationUnit ??= - _lookup>( - 'clang_suspendTranslationUnit') - .asFunction<_dart_clang_suspendTranslationUnit>())( + return _clang_suspendTranslationUnit( arg0, ); } - _dart_clang_suspendTranslationUnit? _clang_suspendTranslationUnit; + late final _clang_suspendTranslationUnit_ptr = + _lookup>( + 'clang_suspendTranslationUnit'); + late final _dart_clang_suspendTranslationUnit _clang_suspendTranslationUnit = + _clang_suspendTranslationUnit_ptr + .asFunction<_dart_clang_suspendTranslationUnit>(); /// Destroy the specified CXTranslationUnit object. void clang_disposeTranslationUnit( ffi.Pointer arg0, ) { - return (_clang_disposeTranslationUnit ??= - _lookup>( - 'clang_disposeTranslationUnit') - .asFunction<_dart_clang_disposeTranslationUnit>())( + return _clang_disposeTranslationUnit( arg0, ); } - _dart_clang_disposeTranslationUnit? _clang_disposeTranslationUnit; + late final _clang_disposeTranslationUnit_ptr = + _lookup>( + 'clang_disposeTranslationUnit'); + late final _dart_clang_disposeTranslationUnit _clang_disposeTranslationUnit = + _clang_disposeTranslationUnit_ptr + .asFunction<_dart_clang_disposeTranslationUnit>(); /// Returns the set of flags that is suitable for reparsing a translation /// unit. @@ -1585,15 +1708,17 @@ class LibClang { int clang_defaultReparseOptions( ffi.Pointer TU, ) { - return (_clang_defaultReparseOptions ??= - _lookup>( - 'clang_defaultReparseOptions') - .asFunction<_dart_clang_defaultReparseOptions>())( + return _clang_defaultReparseOptions( TU, ); } - _dart_clang_defaultReparseOptions? _clang_defaultReparseOptions; + late final _clang_defaultReparseOptions_ptr = + _lookup>( + 'clang_defaultReparseOptions'); + late final _dart_clang_defaultReparseOptions _clang_defaultReparseOptions = + _clang_defaultReparseOptions_ptr + .asFunction<_dart_clang_defaultReparseOptions>(); /// Reparse the source files that produced this translation unit. /// @@ -1638,10 +1763,7 @@ class LibClang { ffi.Pointer unsaved_files, int options, ) { - return (_clang_reparseTranslationUnit ??= - _lookup>( - 'clang_reparseTranslationUnit') - .asFunction<_dart_clang_reparseTranslationUnit>())( + return _clang_reparseTranslationUnit( TU, num_unsaved_files, unsaved_files, @@ -1649,50 +1771,61 @@ class LibClang { ); } - _dart_clang_reparseTranslationUnit? _clang_reparseTranslationUnit; + late final _clang_reparseTranslationUnit_ptr = + _lookup>( + 'clang_reparseTranslationUnit'); + late final _dart_clang_reparseTranslationUnit _clang_reparseTranslationUnit = + _clang_reparseTranslationUnit_ptr + .asFunction<_dart_clang_reparseTranslationUnit>(); /// Returns the human-readable null-terminated C string that represents /// the name of the memory category. This string should never be freed. ffi.Pointer clang_getTUResourceUsageName( int kind, ) { - return (_clang_getTUResourceUsageName ??= - _lookup>( - 'clang_getTUResourceUsageName') - .asFunction<_dart_clang_getTUResourceUsageName>())( + return _clang_getTUResourceUsageName( kind, ); } - _dart_clang_getTUResourceUsageName? _clang_getTUResourceUsageName; + late final _clang_getTUResourceUsageName_ptr = + _lookup>( + 'clang_getTUResourceUsageName'); + late final _dart_clang_getTUResourceUsageName _clang_getTUResourceUsageName = + _clang_getTUResourceUsageName_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_getCXTUResourceUsage') - .asFunction<_dart_clang_getCXTUResourceUsage>())( + return _clang_getCXTUResourceUsage( TU, ); } - _dart_clang_getCXTUResourceUsage? _clang_getCXTUResourceUsage; + late final _clang_getCXTUResourceUsage_ptr = + _lookup>( + 'clang_getCXTUResourceUsage'); + late final _dart_clang_getCXTUResourceUsage _clang_getCXTUResourceUsage = + _clang_getCXTUResourceUsage_ptr + .asFunction<_dart_clang_getCXTUResourceUsage>(); void clang_disposeCXTUResourceUsage( CXTUResourceUsage usage, ) { - return (_clang_disposeCXTUResourceUsage ??= - _lookup>( - 'clang_disposeCXTUResourceUsage') - .asFunction<_dart_clang_disposeCXTUResourceUsage>())( + return _clang_disposeCXTUResourceUsage( usage, ); } - _dart_clang_disposeCXTUResourceUsage? _clang_disposeCXTUResourceUsage; + late final _clang_disposeCXTUResourceUsage_ptr = + _lookup>( + 'clang_disposeCXTUResourceUsage'); + late final _dart_clang_disposeCXTUResourceUsage + _clang_disposeCXTUResourceUsage = _clang_disposeCXTUResourceUsage_ptr + .asFunction<_dart_clang_disposeCXTUResourceUsage>(); /// Get target information for this translation unit. /// @@ -1700,29 +1833,34 @@ class LibClang { ffi.Pointer clang_getTranslationUnitTargetInfo( ffi.Pointer CTUnit, ) { - return (_clang_getTranslationUnitTargetInfo ??= - _lookup>( - 'clang_getTranslationUnitTargetInfo') - .asFunction<_dart_clang_getTranslationUnitTargetInfo>())( + return _clang_getTranslationUnitTargetInfo( CTUnit, ); } - _dart_clang_getTranslationUnitTargetInfo? _clang_getTranslationUnitTargetInfo; + late final _clang_getTranslationUnitTargetInfo_ptr = + _lookup>( + 'clang_getTranslationUnitTargetInfo'); + late final _dart_clang_getTranslationUnitTargetInfo + _clang_getTranslationUnitTargetInfo = + _clang_getTranslationUnitTargetInfo_ptr + .asFunction<_dart_clang_getTranslationUnitTargetInfo>(); /// Destroy the CXTargetInfo object. void clang_TargetInfo_dispose( ffi.Pointer Info, ) { - return (_clang_TargetInfo_dispose ??= - _lookup>( - 'clang_TargetInfo_dispose') - .asFunction<_dart_clang_TargetInfo_dispose>())( + return _clang_TargetInfo_dispose( Info, ); } - _dart_clang_TargetInfo_dispose? _clang_TargetInfo_dispose; + late final _clang_TargetInfo_dispose_ptr = + _lookup>( + 'clang_TargetInfo_dispose'); + late final _dart_clang_TargetInfo_dispose _clang_TargetInfo_dispose = + _clang_TargetInfo_dispose_ptr + .asFunction<_dart_clang_TargetInfo_dispose>(); /// Get the normalized target triple as a string. /// @@ -1730,15 +1868,17 @@ class LibClang { CXString clang_TargetInfo_getTriple( ffi.Pointer Info, ) { - return (_clang_TargetInfo_getTriple ??= - _lookup>( - 'clang_TargetInfo_getTriple') - .asFunction<_dart_clang_TargetInfo_getTriple>())( + return _clang_TargetInfo_getTriple( Info, ); } - _dart_clang_TargetInfo_getTriple? _clang_TargetInfo_getTriple; + late final _clang_TargetInfo_getTriple_ptr = + _lookup>( + 'clang_TargetInfo_getTriple'); + late final _dart_clang_TargetInfo_getTriple _clang_TargetInfo_getTriple = + _clang_TargetInfo_getTriple_ptr + .asFunction<_dart_clang_TargetInfo_getTriple>(); /// Get the pointer width of the target in bits. /// @@ -1746,25 +1886,28 @@ class LibClang { int clang_TargetInfo_getPointerWidth( ffi.Pointer Info, ) { - return (_clang_TargetInfo_getPointerWidth ??= - _lookup>( - 'clang_TargetInfo_getPointerWidth') - .asFunction<_dart_clang_TargetInfo_getPointerWidth>())( + return _clang_TargetInfo_getPointerWidth( Info, ); } - _dart_clang_TargetInfo_getPointerWidth? _clang_TargetInfo_getPointerWidth; + late final _clang_TargetInfo_getPointerWidth_ptr = + _lookup>( + 'clang_TargetInfo_getPointerWidth'); + late final _dart_clang_TargetInfo_getPointerWidth + _clang_TargetInfo_getPointerWidth = _clang_TargetInfo_getPointerWidth_ptr + .asFunction<_dart_clang_TargetInfo_getPointerWidth>(); /// Retrieve the NULL cursor, which represents no entity. CXCursor clang_getNullCursor() { - return (_clang_getNullCursor ??= - _lookup>( - 'clang_getNullCursor') - .asFunction<_dart_clang_getNullCursor>())(); + return _clang_getNullCursor(); } - _dart_clang_getNullCursor? _clang_getNullCursor; + late final _clang_getNullCursor_ptr = + _lookup>( + 'clang_getNullCursor'); + late final _dart_clang_getNullCursor _clang_getNullCursor = + _clang_getNullCursor_ptr.asFunction<_dart_clang_getNullCursor>(); /// Retrieve the cursor that represents the given translation unit. /// @@ -1773,85 +1916,93 @@ class LibClang { CXCursor clang_getTranslationUnitCursor( ffi.Pointer arg0, ) { - return (_clang_getTranslationUnitCursor ??= - _lookup>( - 'clang_getTranslationUnitCursor') - .asFunction<_dart_clang_getTranslationUnitCursor>())( + return _clang_getTranslationUnitCursor( arg0, ); } - _dart_clang_getTranslationUnitCursor? _clang_getTranslationUnitCursor; + late final _clang_getTranslationUnitCursor_ptr = + _lookup>( + 'clang_getTranslationUnitCursor'); + late final _dart_clang_getTranslationUnitCursor + _clang_getTranslationUnitCursor = _clang_getTranslationUnitCursor_ptr + .asFunction<_dart_clang_getTranslationUnitCursor>(); /// Determine whether two cursors are equivalent. int clang_equalCursors( CXCursor arg0, CXCursor arg1, ) { - return (_clang_equalCursors ??= - _lookup>('clang_equalCursors') - .asFunction<_dart_clang_equalCursors>())( + return _clang_equalCursors( arg0, arg1, ); } - _dart_clang_equalCursors? _clang_equalCursors; + late final _clang_equalCursors_ptr = + _lookup>( + 'clang_equalCursors'); + late final _dart_clang_equalCursors _clang_equalCursors = + _clang_equalCursors_ptr.asFunction<_dart_clang_equalCursors>(); /// Returns non-zero if \p cursor is null. int clang_Cursor_isNull( CXCursor cursor, ) { - return (_clang_Cursor_isNull ??= - _lookup>( - 'clang_Cursor_isNull') - .asFunction<_dart_clang_Cursor_isNull>())( + return _clang_Cursor_isNull( cursor, ); } - _dart_clang_Cursor_isNull? _clang_Cursor_isNull; + late final _clang_Cursor_isNull_ptr = + _lookup>( + 'clang_Cursor_isNull'); + late final _dart_clang_Cursor_isNull _clang_Cursor_isNull = + _clang_Cursor_isNull_ptr.asFunction<_dart_clang_Cursor_isNull>(); /// Compute a hash value for the given cursor. int clang_hashCursor( CXCursor arg0, ) { - return (_clang_hashCursor ??= - _lookup>('clang_hashCursor') - .asFunction<_dart_clang_hashCursor>())( + return _clang_hashCursor( arg0, ); } - _dart_clang_hashCursor? _clang_hashCursor; + late final _clang_hashCursor_ptr = + _lookup>('clang_hashCursor'); + late final _dart_clang_hashCursor _clang_hashCursor = + _clang_hashCursor_ptr.asFunction<_dart_clang_hashCursor>(); /// Retrieve the kind of the given cursor. int clang_getCursorKind( CXCursor arg0, ) { - return (_clang_getCursorKind ??= - _lookup>( - 'clang_getCursorKind') - .asFunction<_dart_clang_getCursorKind>())( + return _clang_getCursorKind( arg0, ); } - _dart_clang_getCursorKind? _clang_getCursorKind; + late final _clang_getCursorKind_ptr = + _lookup>( + 'clang_getCursorKind'); + late final _dart_clang_getCursorKind _clang_getCursorKind = + _clang_getCursorKind_ptr.asFunction<_dart_clang_getCursorKind>(); /// Determine whether the given cursor kind represents a declaration. int clang_isDeclaration( int arg0, ) { - return (_clang_isDeclaration ??= - _lookup>( - 'clang_isDeclaration') - .asFunction<_dart_clang_isDeclaration>())( + return _clang_isDeclaration( arg0, ); } - _dart_clang_isDeclaration? _clang_isDeclaration; + late final _clang_isDeclaration_ptr = + _lookup>( + 'clang_isDeclaration'); + late final _dart_clang_isDeclaration _clang_isDeclaration = + _clang_isDeclaration_ptr.asFunction<_dart_clang_isDeclaration>(); /// Determine whether the given declaration is invalid. /// @@ -1862,15 +2013,17 @@ class LibClang { int clang_isInvalidDeclaration( CXCursor arg0, ) { - return (_clang_isInvalidDeclaration ??= - _lookup>( - 'clang_isInvalidDeclaration') - .asFunction<_dart_clang_isInvalidDeclaration>())( + return _clang_isInvalidDeclaration( arg0, ); } - _dart_clang_isInvalidDeclaration? _clang_isInvalidDeclaration; + late final _clang_isInvalidDeclaration_ptr = + _lookup>( + 'clang_isInvalidDeclaration'); + late final _dart_clang_isInvalidDeclaration _clang_isInvalidDeclaration = + _clang_isInvalidDeclaration_ptr + .asFunction<_dart_clang_isInvalidDeclaration>(); /// Determine whether the given cursor kind represents a simple /// reference. @@ -1881,139 +2034,154 @@ class LibClang { int clang_isReference( int arg0, ) { - return (_clang_isReference ??= - _lookup>('clang_isReference') - .asFunction<_dart_clang_isReference>())( + return _clang_isReference( arg0, ); } - _dart_clang_isReference? _clang_isReference; + late final _clang_isReference_ptr = + _lookup>( + 'clang_isReference'); + late final _dart_clang_isReference _clang_isReference = + _clang_isReference_ptr.asFunction<_dart_clang_isReference>(); /// Determine whether the given cursor kind represents an expression. int clang_isExpression( int arg0, ) { - return (_clang_isExpression ??= - _lookup>('clang_isExpression') - .asFunction<_dart_clang_isExpression>())( + return _clang_isExpression( arg0, ); } - _dart_clang_isExpression? _clang_isExpression; + late final _clang_isExpression_ptr = + _lookup>( + 'clang_isExpression'); + late final _dart_clang_isExpression _clang_isExpression = + _clang_isExpression_ptr.asFunction<_dart_clang_isExpression>(); /// Determine whether the given cursor kind represents a statement. int clang_isStatement( int arg0, ) { - return (_clang_isStatement ??= - _lookup>('clang_isStatement') - .asFunction<_dart_clang_isStatement>())( + return _clang_isStatement( arg0, ); } - _dart_clang_isStatement? _clang_isStatement; + late final _clang_isStatement_ptr = + _lookup>( + 'clang_isStatement'); + late final _dart_clang_isStatement _clang_isStatement = + _clang_isStatement_ptr.asFunction<_dart_clang_isStatement>(); /// Determine whether the given cursor kind represents an attribute. int clang_isAttribute( int arg0, ) { - return (_clang_isAttribute ??= - _lookup>('clang_isAttribute') - .asFunction<_dart_clang_isAttribute>())( + return _clang_isAttribute( arg0, ); } - _dart_clang_isAttribute? _clang_isAttribute; + late final _clang_isAttribute_ptr = + _lookup>( + 'clang_isAttribute'); + late final _dart_clang_isAttribute _clang_isAttribute = + _clang_isAttribute_ptr.asFunction<_dart_clang_isAttribute>(); /// Determine whether the given cursor has any attributes. int clang_Cursor_hasAttrs( CXCursor C, ) { - return (_clang_Cursor_hasAttrs ??= - _lookup>( - 'clang_Cursor_hasAttrs') - .asFunction<_dart_clang_Cursor_hasAttrs>())( + return _clang_Cursor_hasAttrs( C, ); } - _dart_clang_Cursor_hasAttrs? _clang_Cursor_hasAttrs; + late final _clang_Cursor_hasAttrs_ptr = + _lookup>( + 'clang_Cursor_hasAttrs'); + late final _dart_clang_Cursor_hasAttrs _clang_Cursor_hasAttrs = + _clang_Cursor_hasAttrs_ptr.asFunction<_dart_clang_Cursor_hasAttrs>(); /// Determine whether the given cursor kind represents an invalid /// cursor. int clang_isInvalid( int arg0, ) { - return (_clang_isInvalid ??= - _lookup>('clang_isInvalid') - .asFunction<_dart_clang_isInvalid>())( + return _clang_isInvalid( arg0, ); } - _dart_clang_isInvalid? _clang_isInvalid; + late final _clang_isInvalid_ptr = + _lookup>('clang_isInvalid'); + late final _dart_clang_isInvalid _clang_isInvalid = + _clang_isInvalid_ptr.asFunction<_dart_clang_isInvalid>(); /// Determine whether the given cursor kind represents a translation /// unit. int clang_isTranslationUnit( int arg0, ) { - return (_clang_isTranslationUnit ??= - _lookup>( - 'clang_isTranslationUnit') - .asFunction<_dart_clang_isTranslationUnit>())( + return _clang_isTranslationUnit( arg0, ); } - _dart_clang_isTranslationUnit? _clang_isTranslationUnit; + late final _clang_isTranslationUnit_ptr = + _lookup>( + 'clang_isTranslationUnit'); + late final _dart_clang_isTranslationUnit _clang_isTranslationUnit = + _clang_isTranslationUnit_ptr.asFunction<_dart_clang_isTranslationUnit>(); /// Determine whether the given cursor represents a preprocessing /// element, such as a preprocessor directive or macro instantiation. int clang_isPreprocessing( int arg0, ) { - return (_clang_isPreprocessing ??= - _lookup>( - 'clang_isPreprocessing') - .asFunction<_dart_clang_isPreprocessing>())( + return _clang_isPreprocessing( arg0, ); } - _dart_clang_isPreprocessing? _clang_isPreprocessing; + late final _clang_isPreprocessing_ptr = + _lookup>( + 'clang_isPreprocessing'); + late final _dart_clang_isPreprocessing _clang_isPreprocessing = + _clang_isPreprocessing_ptr.asFunction<_dart_clang_isPreprocessing>(); /// Determine whether the given cursor represents a currently /// unexposed piece of the AST (e.g., CXCursor_UnexposedStmt). int clang_isUnexposed( int arg0, ) { - return (_clang_isUnexposed ??= - _lookup>('clang_isUnexposed') - .asFunction<_dart_clang_isUnexposed>())( + return _clang_isUnexposed( arg0, ); } - _dart_clang_isUnexposed? _clang_isUnexposed; + late final _clang_isUnexposed_ptr = + _lookup>( + 'clang_isUnexposed'); + late final _dart_clang_isUnexposed _clang_isUnexposed = + _clang_isUnexposed_ptr.asFunction<_dart_clang_isUnexposed>(); /// Determine the linkage of the entity referred to by a given cursor. int clang_getCursorLinkage( CXCursor cursor, ) { - return (_clang_getCursorLinkage ??= - _lookup>( - 'clang_getCursorLinkage') - .asFunction<_dart_clang_getCursorLinkage>())( + return _clang_getCursorLinkage( cursor, ); } - _dart_clang_getCursorLinkage? _clang_getCursorLinkage; + late final _clang_getCursorLinkage_ptr = + _lookup>( + 'clang_getCursorLinkage'); + late final _dart_clang_getCursorLinkage _clang_getCursorLinkage = + _clang_getCursorLinkage_ptr.asFunction<_dart_clang_getCursorLinkage>(); /// Describe the visibility of the entity referred to by a cursor. /// @@ -2027,15 +2195,17 @@ class LibClang { int clang_getCursorVisibility( CXCursor cursor, ) { - return (_clang_getCursorVisibility ??= - _lookup>( - 'clang_getCursorVisibility') - .asFunction<_dart_clang_getCursorVisibility>())( + return _clang_getCursorVisibility( cursor, ); } - _dart_clang_getCursorVisibility? _clang_getCursorVisibility; + late final _clang_getCursorVisibility_ptr = + _lookup>( + 'clang_getCursorVisibility'); + late final _dart_clang_getCursorVisibility _clang_getCursorVisibility = + _clang_getCursorVisibility_ptr + .asFunction<_dart_clang_getCursorVisibility>(); /// Determine the availability of the entity that this cursor refers to, /// taking the current target platform into account. @@ -2046,15 +2216,17 @@ class LibClang { int clang_getCursorAvailability( CXCursor cursor, ) { - return (_clang_getCursorAvailability ??= - _lookup>( - 'clang_getCursorAvailability') - .asFunction<_dart_clang_getCursorAvailability>())( + return _clang_getCursorAvailability( cursor, ); } - _dart_clang_getCursorAvailability? _clang_getCursorAvailability; + late final _clang_getCursorAvailability_ptr = + _lookup>( + 'clang_getCursorAvailability'); + late final _dart_clang_getCursorAvailability _clang_getCursorAvailability = + _clang_getCursorAvailability_ptr + .asFunction<_dart_clang_getCursorAvailability>(); /// Determine the availability of the entity that this cursor refers to /// on any platforms for which availability information is known. @@ -2099,10 +2271,7 @@ class LibClang { ffi.Pointer availability, int availability_size, ) { - return (_clang_getCursorPlatformAvailability ??= - _lookup>( - 'clang_getCursorPlatformAvailability') - .asFunction<_dart_clang_getCursorPlatformAvailability>())( + return _clang_getCursorPlatformAvailability( cursor, always_deprecated, deprecated_message, @@ -2113,90 +2282,104 @@ class LibClang { ); } - _dart_clang_getCursorPlatformAvailability? - _clang_getCursorPlatformAvailability; + late final _clang_getCursorPlatformAvailability_ptr = + _lookup>( + 'clang_getCursorPlatformAvailability'); + late final _dart_clang_getCursorPlatformAvailability + _clang_getCursorPlatformAvailability = + _clang_getCursorPlatformAvailability_ptr + .asFunction<_dart_clang_getCursorPlatformAvailability>(); /// Free the memory associated with a \c CXPlatformAvailability structure. void clang_disposeCXPlatformAvailability( ffi.Pointer availability, ) { - return (_clang_disposeCXPlatformAvailability ??= - _lookup>( - 'clang_disposeCXPlatformAvailability') - .asFunction<_dart_clang_disposeCXPlatformAvailability>())( + return _clang_disposeCXPlatformAvailability( availability, ); } - _dart_clang_disposeCXPlatformAvailability? - _clang_disposeCXPlatformAvailability; + late final _clang_disposeCXPlatformAvailability_ptr = + _lookup>( + 'clang_disposeCXPlatformAvailability'); + late final _dart_clang_disposeCXPlatformAvailability + _clang_disposeCXPlatformAvailability = + _clang_disposeCXPlatformAvailability_ptr + .asFunction<_dart_clang_disposeCXPlatformAvailability>(); /// Determine the "language" of the entity referred to by a given cursor. int clang_getCursorLanguage( CXCursor cursor, ) { - return (_clang_getCursorLanguage ??= - _lookup>( - 'clang_getCursorLanguage') - .asFunction<_dart_clang_getCursorLanguage>())( + return _clang_getCursorLanguage( cursor, ); } - _dart_clang_getCursorLanguage? _clang_getCursorLanguage; + late final _clang_getCursorLanguage_ptr = + _lookup>( + 'clang_getCursorLanguage'); + late final _dart_clang_getCursorLanguage _clang_getCursorLanguage = + _clang_getCursorLanguage_ptr.asFunction<_dart_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 ??= - _lookup>( - 'clang_getCursorTLSKind') - .asFunction<_dart_clang_getCursorTLSKind>())( + return _clang_getCursorTLSKind( cursor, ); } - _dart_clang_getCursorTLSKind? _clang_getCursorTLSKind; + late final _clang_getCursorTLSKind_ptr = + _lookup>( + 'clang_getCursorTLSKind'); + late final _dart_clang_getCursorTLSKind _clang_getCursorTLSKind = + _clang_getCursorTLSKind_ptr.asFunction<_dart_clang_getCursorTLSKind>(); /// Returns the translation unit that a cursor originated from. ffi.Pointer clang_Cursor_getTranslationUnit( CXCursor arg0, ) { - return (_clang_Cursor_getTranslationUnit ??= - _lookup>( - 'clang_Cursor_getTranslationUnit') - .asFunction<_dart_clang_Cursor_getTranslationUnit>())( + return _clang_Cursor_getTranslationUnit( arg0, ); } - _dart_clang_Cursor_getTranslationUnit? _clang_Cursor_getTranslationUnit; + late final _clang_Cursor_getTranslationUnit_ptr = + _lookup>( + 'clang_Cursor_getTranslationUnit'); + late final _dart_clang_Cursor_getTranslationUnit + _clang_Cursor_getTranslationUnit = _clang_Cursor_getTranslationUnit_ptr + .asFunction<_dart_clang_Cursor_getTranslationUnit>(); /// Creates an empty CXCursorSet. ffi.Pointer clang_createCXCursorSet() { - return (_clang_createCXCursorSet ??= - _lookup>( - 'clang_createCXCursorSet') - .asFunction<_dart_clang_createCXCursorSet>())(); + return _clang_createCXCursorSet(); } - _dart_clang_createCXCursorSet? _clang_createCXCursorSet; + late final _clang_createCXCursorSet_ptr = + _lookup>( + 'clang_createCXCursorSet'); + late final _dart_clang_createCXCursorSet _clang_createCXCursorSet = + _clang_createCXCursorSet_ptr.asFunction<_dart_clang_createCXCursorSet>(); /// Disposes a CXCursorSet and releases its associated memory. void clang_disposeCXCursorSet( ffi.Pointer cset, ) { - return (_clang_disposeCXCursorSet ??= - _lookup>( - 'clang_disposeCXCursorSet') - .asFunction<_dart_clang_disposeCXCursorSet>())( + return _clang_disposeCXCursorSet( cset, ); } - _dart_clang_disposeCXCursorSet? _clang_disposeCXCursorSet; + late final _clang_disposeCXCursorSet_ptr = + _lookup>( + 'clang_disposeCXCursorSet'); + late final _dart_clang_disposeCXCursorSet _clang_disposeCXCursorSet = + _clang_disposeCXCursorSet_ptr + .asFunction<_dart_clang_disposeCXCursorSet>(); /// Queries a CXCursorSet to see if it contains a specific CXCursor. /// @@ -2205,16 +2388,18 @@ class LibClang { ffi.Pointer cset, CXCursor cursor, ) { - return (_clang_CXCursorSet_contains ??= - _lookup>( - 'clang_CXCursorSet_contains') - .asFunction<_dart_clang_CXCursorSet_contains>())( + return _clang_CXCursorSet_contains( cset, cursor, ); } - _dart_clang_CXCursorSet_contains? _clang_CXCursorSet_contains; + late final _clang_CXCursorSet_contains_ptr = + _lookup>( + 'clang_CXCursorSet_contains'); + late final _dart_clang_CXCursorSet_contains _clang_CXCursorSet_contains = + _clang_CXCursorSet_contains_ptr + .asFunction<_dart_clang_CXCursorSet_contains>(); /// Inserts a CXCursor into a CXCursorSet. /// @@ -2223,16 +2408,18 @@ class LibClang { ffi.Pointer cset, CXCursor cursor, ) { - return (_clang_CXCursorSet_insert ??= - _lookup>( - 'clang_CXCursorSet_insert') - .asFunction<_dart_clang_CXCursorSet_insert>())( + return _clang_CXCursorSet_insert( cset, cursor, ); } - _dart_clang_CXCursorSet_insert? _clang_CXCursorSet_insert; + late final _clang_CXCursorSet_insert_ptr = + _lookup>( + 'clang_CXCursorSet_insert'); + late final _dart_clang_CXCursorSet_insert _clang_CXCursorSet_insert = + _clang_CXCursorSet_insert_ptr + .asFunction<_dart_clang_CXCursorSet_insert>(); /// Determine the semantic parent of the given cursor. /// @@ -2268,15 +2455,17 @@ class LibClang { CXCursor clang_getCursorSemanticParent( CXCursor cursor, ) { - return (_clang_getCursorSemanticParent ??= - _lookup>( - 'clang_getCursorSemanticParent') - .asFunction<_dart_clang_getCursorSemanticParent>())( + return _clang_getCursorSemanticParent( cursor, ); } - _dart_clang_getCursorSemanticParent? _clang_getCursorSemanticParent; + late final _clang_getCursorSemanticParent_ptr = + _lookup>( + 'clang_getCursorSemanticParent'); + late final _dart_clang_getCursorSemanticParent + _clang_getCursorSemanticParent = _clang_getCursorSemanticParent_ptr + .asFunction<_dart_clang_getCursorSemanticParent>(); /// Determine the lexical parent of the given cursor. /// @@ -2313,15 +2502,17 @@ class LibClang { CXCursor clang_getCursorLexicalParent( CXCursor cursor, ) { - return (_clang_getCursorLexicalParent ??= - _lookup>( - 'clang_getCursorLexicalParent') - .asFunction<_dart_clang_getCursorLexicalParent>())( + return _clang_getCursorLexicalParent( cursor, ); } - _dart_clang_getCursorLexicalParent? _clang_getCursorLexicalParent; + late final _clang_getCursorLexicalParent_ptr = + _lookup>( + 'clang_getCursorLexicalParent'); + late final _dart_clang_getCursorLexicalParent _clang_getCursorLexicalParent = + _clang_getCursorLexicalParent_ptr + .asFunction<_dart_clang_getCursorLexicalParent>(); /// Determine the set of methods that are overridden by the given /// method. @@ -2369,47 +2560,52 @@ class LibClang { ffi.Pointer> overridden, ffi.Pointer num_overridden, ) { - return (_clang_getOverriddenCursors ??= - _lookup>( - 'clang_getOverriddenCursors') - .asFunction<_dart_clang_getOverriddenCursors>())( + return _clang_getOverriddenCursors( cursor, overridden, num_overridden, ); } - _dart_clang_getOverriddenCursors? _clang_getOverriddenCursors; + late final _clang_getOverriddenCursors_ptr = + _lookup>( + 'clang_getOverriddenCursors'); + late final _dart_clang_getOverriddenCursors _clang_getOverriddenCursors = + _clang_getOverriddenCursors_ptr + .asFunction<_dart_clang_getOverriddenCursors>(); /// Free the set of overridden cursors returned by \c /// clang_getOverriddenCursors(). void clang_disposeOverriddenCursors( ffi.Pointer overridden, ) { - return (_clang_disposeOverriddenCursors ??= - _lookup>( - 'clang_disposeOverriddenCursors') - .asFunction<_dart_clang_disposeOverriddenCursors>())( + return _clang_disposeOverriddenCursors( overridden, ); } - _dart_clang_disposeOverriddenCursors? _clang_disposeOverriddenCursors; + late final _clang_disposeOverriddenCursors_ptr = + _lookup>( + 'clang_disposeOverriddenCursors'); + late final _dart_clang_disposeOverriddenCursors + _clang_disposeOverriddenCursors = _clang_disposeOverriddenCursors_ptr + .asFunction<_dart_clang_disposeOverriddenCursors>(); /// Retrieve the file that is included by the given inclusion directive /// cursor. ffi.Pointer clang_getIncludedFile( CXCursor cursor, ) { - return (_clang_getIncludedFile ??= - _lookup>( - 'clang_getIncludedFile') - .asFunction<_dart_clang_getIncludedFile>())( + return _clang_getIncludedFile( cursor, ); } - _dart_clang_getIncludedFile? _clang_getIncludedFile; + late final _clang_getIncludedFile_ptr = + _lookup>( + 'clang_getIncludedFile'); + late final _dart_clang_getIncludedFile _clang_getIncludedFile = + _clang_getIncludedFile_ptr.asFunction<_dart_clang_getIncludedFile>(); /// Map a source location to the cursor that describes the entity at that /// location in the source code. @@ -2428,15 +2624,16 @@ class LibClang { ffi.Pointer arg0, CXSourceLocation arg1, ) { - return (_clang_getCursor ??= - _lookup>('clang_getCursor') - .asFunction<_dart_clang_getCursor>())( + return _clang_getCursor( arg0, arg1, ); } - _dart_clang_getCursor? _clang_getCursor; + late final _clang_getCursor_ptr = + _lookup>('clang_getCursor'); + late final _dart_clang_getCursor _clang_getCursor = + _clang_getCursor_ptr.asFunction<_dart_clang_getCursor>(); /// Retrieve the physical location of the source constructor referenced /// by the given cursor. @@ -2449,15 +2646,16 @@ class LibClang { CXSourceLocation clang_getCursorLocation( CXCursor arg0, ) { - return (_clang_getCursorLocation ??= - _lookup>( - 'clang_getCursorLocation') - .asFunction<_dart_clang_getCursorLocation>())( + return _clang_getCursorLocation( arg0, ); } - _dart_clang_getCursorLocation? _clang_getCursorLocation; + late final _clang_getCursorLocation_ptr = + _lookup>( + 'clang_getCursorLocation'); + late final _dart_clang_getCursorLocation _clang_getCursorLocation = + _clang_getCursorLocation_ptr.asFunction<_dart_clang_getCursorLocation>(); /// Retrieve the physical extent of the source construct referenced by /// the given cursor. @@ -2471,29 +2669,31 @@ class LibClang { CXSourceRange clang_getCursorExtent( CXCursor arg0, ) { - return (_clang_getCursorExtent ??= - _lookup>( - 'clang_getCursorExtent') - .asFunction<_dart_clang_getCursorExtent>())( + return _clang_getCursorExtent( arg0, ); } - _dart_clang_getCursorExtent? _clang_getCursorExtent; + late final _clang_getCursorExtent_ptr = + _lookup>( + 'clang_getCursorExtent'); + late final _dart_clang_getCursorExtent _clang_getCursorExtent = + _clang_getCursorExtent_ptr.asFunction<_dart_clang_getCursorExtent>(); /// Retrieve the type of a CXCursor (if any). CXType clang_getCursorType( CXCursor C, ) { - return (_clang_getCursorType ??= - _lookup>( - 'clang_getCursorType') - .asFunction<_dart_clang_getCursorType>())( + return _clang_getCursorType( C, ); } - _dart_clang_getCursorType? _clang_getCursorType; + late final _clang_getCursorType_ptr = + _lookup>( + 'clang_getCursorType'); + late final _dart_clang_getCursorType _clang_getCursorType = + _clang_getCursorType_ptr.asFunction<_dart_clang_getCursorType>(); /// Pretty-print the underlying type using the rules of the /// language of the translation unit from which it came. @@ -2502,15 +2702,16 @@ class LibClang { CXString clang_getTypeSpelling( CXType CT, ) { - return (_clang_getTypeSpelling ??= - _lookup>( - 'clang_getTypeSpelling') - .asFunction<_dart_clang_getTypeSpelling>())( + return _clang_getTypeSpelling( CT, ); } - _dart_clang_getTypeSpelling? _clang_getTypeSpelling; + late final _clang_getTypeSpelling_ptr = + _lookup>( + 'clang_getTypeSpelling'); + late final _dart_clang_getTypeSpelling _clang_getTypeSpelling = + _clang_getTypeSpelling_ptr.asFunction<_dart_clang_getTypeSpelling>(); /// Retrieve the underlying type of a typedef declaration. /// @@ -2519,15 +2720,18 @@ class LibClang { CXType clang_getTypedefDeclUnderlyingType( CXCursor C, ) { - return (_clang_getTypedefDeclUnderlyingType ??= - _lookup>( - 'clang_getTypedefDeclUnderlyingType') - .asFunction<_dart_clang_getTypedefDeclUnderlyingType>())( + return _clang_getTypedefDeclUnderlyingType( C, ); } - _dart_clang_getTypedefDeclUnderlyingType? _clang_getTypedefDeclUnderlyingType; + late final _clang_getTypedefDeclUnderlyingType_ptr = + _lookup>( + 'clang_getTypedefDeclUnderlyingType'); + late final _dart_clang_getTypedefDeclUnderlyingType + _clang_getTypedefDeclUnderlyingType = + _clang_getTypedefDeclUnderlyingType_ptr + .asFunction<_dart_clang_getTypedefDeclUnderlyingType>(); /// Retrieve the integer type of an enum declaration. /// @@ -2536,15 +2740,17 @@ class LibClang { CXType clang_getEnumDeclIntegerType( CXCursor C, ) { - return (_clang_getEnumDeclIntegerType ??= - _lookup>( - 'clang_getEnumDeclIntegerType') - .asFunction<_dart_clang_getEnumDeclIntegerType>())( + return _clang_getEnumDeclIntegerType( C, ); } - _dart_clang_getEnumDeclIntegerType? _clang_getEnumDeclIntegerType; + late final _clang_getEnumDeclIntegerType_ptr = + _lookup>( + 'clang_getEnumDeclIntegerType'); + late final _dart_clang_getEnumDeclIntegerType _clang_getEnumDeclIntegerType = + _clang_getEnumDeclIntegerType_ptr + .asFunction<_dart_clang_getEnumDeclIntegerType>(); /// Retrieve the integer value of an enum constant declaration as a signed /// long long. @@ -2555,15 +2761,17 @@ class LibClang { int clang_getEnumConstantDeclValue( CXCursor C, ) { - return (_clang_getEnumConstantDeclValue ??= - _lookup>( - 'clang_getEnumConstantDeclValue') - .asFunction<_dart_clang_getEnumConstantDeclValue>())( + return _clang_getEnumConstantDeclValue( C, ); } - _dart_clang_getEnumConstantDeclValue? _clang_getEnumConstantDeclValue; + late final _clang_getEnumConstantDeclValue_ptr = + _lookup>( + 'clang_getEnumConstantDeclValue'); + late final _dart_clang_getEnumConstantDeclValue + _clang_getEnumConstantDeclValue = _clang_getEnumConstantDeclValue_ptr + .asFunction<_dart_clang_getEnumConstantDeclValue>(); /// Retrieve the integer value of an enum constant declaration as an unsigned /// long long. @@ -2574,16 +2782,18 @@ class LibClang { int clang_getEnumConstantDeclUnsignedValue( CXCursor C, ) { - return (_clang_getEnumConstantDeclUnsignedValue ??= - _lookup>( - 'clang_getEnumConstantDeclUnsignedValue') - .asFunction<_dart_clang_getEnumConstantDeclUnsignedValue>())( + return _clang_getEnumConstantDeclUnsignedValue( C, ); } - _dart_clang_getEnumConstantDeclUnsignedValue? - _clang_getEnumConstantDeclUnsignedValue; + late final _clang_getEnumConstantDeclUnsignedValue_ptr = _lookup< + ffi.NativeFunction>( + 'clang_getEnumConstantDeclUnsignedValue'); + late final _dart_clang_getEnumConstantDeclUnsignedValue + _clang_getEnumConstantDeclUnsignedValue = + _clang_getEnumConstantDeclUnsignedValue_ptr + .asFunction<_dart_clang_getEnumConstantDeclUnsignedValue>(); /// Retrieve the bit width of a bit field declaration as an integer. /// @@ -2591,15 +2801,17 @@ class LibClang { int clang_getFieldDeclBitWidth( CXCursor C, ) { - return (_clang_getFieldDeclBitWidth ??= - _lookup>( - 'clang_getFieldDeclBitWidth') - .asFunction<_dart_clang_getFieldDeclBitWidth>())( + return _clang_getFieldDeclBitWidth( C, ); } - _dart_clang_getFieldDeclBitWidth? _clang_getFieldDeclBitWidth; + late final _clang_getFieldDeclBitWidth_ptr = + _lookup>( + 'clang_getFieldDeclBitWidth'); + late final _dart_clang_getFieldDeclBitWidth _clang_getFieldDeclBitWidth = + _clang_getFieldDeclBitWidth_ptr + .asFunction<_dart_clang_getFieldDeclBitWidth>(); /// Retrieve the number of non-variadic arguments associated with a given /// cursor. @@ -2609,15 +2821,17 @@ class LibClang { int clang_Cursor_getNumArguments( CXCursor C, ) { - return (_clang_Cursor_getNumArguments ??= - _lookup>( - 'clang_Cursor_getNumArguments') - .asFunction<_dart_clang_Cursor_getNumArguments>())( + return _clang_Cursor_getNumArguments( C, ); } - _dart_clang_Cursor_getNumArguments? _clang_Cursor_getNumArguments; + late final _clang_Cursor_getNumArguments_ptr = + _lookup>( + 'clang_Cursor_getNumArguments'); + late final _dart_clang_Cursor_getNumArguments _clang_Cursor_getNumArguments = + _clang_Cursor_getNumArguments_ptr + .asFunction<_dart_clang_Cursor_getNumArguments>(); /// Retrieve the argument cursor of a function or method. /// @@ -2628,16 +2842,18 @@ class LibClang { CXCursor C, int i, ) { - return (_clang_Cursor_getArgument ??= - _lookup>( - 'clang_Cursor_getArgument') - .asFunction<_dart_clang_Cursor_getArgument>())( + return _clang_Cursor_getArgument( C, i, ); } - _dart_clang_Cursor_getArgument? _clang_Cursor_getArgument; + late final _clang_Cursor_getArgument_ptr = + _lookup>( + 'clang_Cursor_getArgument'); + late final _dart_clang_Cursor_getArgument _clang_Cursor_getArgument = + _clang_Cursor_getArgument_ptr + .asFunction<_dart_clang_Cursor_getArgument>(); /// Returns the number of template args of a function decl representing a /// template specialization. @@ -2656,16 +2872,18 @@ class LibClang { int clang_Cursor_getNumTemplateArguments( CXCursor C, ) { - return (_clang_Cursor_getNumTemplateArguments ??= - _lookup>( - 'clang_Cursor_getNumTemplateArguments') - .asFunction<_dart_clang_Cursor_getNumTemplateArguments>())( + return _clang_Cursor_getNumTemplateArguments( C, ); } - _dart_clang_Cursor_getNumTemplateArguments? - _clang_Cursor_getNumTemplateArguments; + late final _clang_Cursor_getNumTemplateArguments_ptr = + _lookup>( + 'clang_Cursor_getNumTemplateArguments'); + late final _dart_clang_Cursor_getNumTemplateArguments + _clang_Cursor_getNumTemplateArguments = + _clang_Cursor_getNumTemplateArguments_ptr + .asFunction<_dart_clang_Cursor_getNumTemplateArguments>(); /// Retrieve the kind of the I'th template argument of the CXCursor C. /// @@ -2685,17 +2903,19 @@ class LibClang { CXCursor C, int I, ) { - return (_clang_Cursor_getTemplateArgumentKind ??= - _lookup>( - 'clang_Cursor_getTemplateArgumentKind') - .asFunction<_dart_clang_Cursor_getTemplateArgumentKind>())( + return _clang_Cursor_getTemplateArgumentKind( C, I, ); } - _dart_clang_Cursor_getTemplateArgumentKind? - _clang_Cursor_getTemplateArgumentKind; + late final _clang_Cursor_getTemplateArgumentKind_ptr = + _lookup>( + 'clang_Cursor_getTemplateArgumentKind'); + late final _dart_clang_Cursor_getTemplateArgumentKind + _clang_Cursor_getTemplateArgumentKind = + _clang_Cursor_getTemplateArgumentKind_ptr + .asFunction<_dart_clang_Cursor_getTemplateArgumentKind>(); /// Retrieve a CXType representing the type of a TemplateArgument of a /// function decl representing a template specialization. @@ -2717,17 +2937,19 @@ class LibClang { CXCursor C, int I, ) { - return (_clang_Cursor_getTemplateArgumentType ??= - _lookup>( - 'clang_Cursor_getTemplateArgumentType') - .asFunction<_dart_clang_Cursor_getTemplateArgumentType>())( + return _clang_Cursor_getTemplateArgumentType( C, I, ); } - _dart_clang_Cursor_getTemplateArgumentType? - _clang_Cursor_getTemplateArgumentType; + late final _clang_Cursor_getTemplateArgumentType_ptr = + _lookup>( + 'clang_Cursor_getTemplateArgumentType'); + late final _dart_clang_Cursor_getTemplateArgumentType + _clang_Cursor_getTemplateArgumentType = + _clang_Cursor_getTemplateArgumentType_ptr + .asFunction<_dart_clang_Cursor_getTemplateArgumentType>(); /// Retrieve the value of an Integral TemplateArgument (of a function /// decl representing a template specialization) as a signed long long. @@ -2748,17 +2970,19 @@ class LibClang { CXCursor C, int I, ) { - return (_clang_Cursor_getTemplateArgumentValue ??= - _lookup>( - 'clang_Cursor_getTemplateArgumentValue') - .asFunction<_dart_clang_Cursor_getTemplateArgumentValue>())( + return _clang_Cursor_getTemplateArgumentValue( C, I, ); } - _dart_clang_Cursor_getTemplateArgumentValue? - _clang_Cursor_getTemplateArgumentValue; + late final _clang_Cursor_getTemplateArgumentValue_ptr = + _lookup>( + 'clang_Cursor_getTemplateArgumentValue'); + late final _dart_clang_Cursor_getTemplateArgumentValue + _clang_Cursor_getTemplateArgumentValue = + _clang_Cursor_getTemplateArgumentValue_ptr + .asFunction<_dart_clang_Cursor_getTemplateArgumentValue>(); /// Retrieve the value of an Integral TemplateArgument (of a function /// decl representing a template specialization) as an unsigned long long. @@ -2779,18 +3003,20 @@ class LibClang { CXCursor C, int I, ) { - return (_clang_Cursor_getTemplateArgumentUnsignedValue ??= _lookup< - ffi.NativeFunction< - _c_clang_Cursor_getTemplateArgumentUnsignedValue>>( - 'clang_Cursor_getTemplateArgumentUnsignedValue') - .asFunction<_dart_clang_Cursor_getTemplateArgumentUnsignedValue>())( + return _clang_Cursor_getTemplateArgumentUnsignedValue( C, I, ); } - _dart_clang_Cursor_getTemplateArgumentUnsignedValue? - _clang_Cursor_getTemplateArgumentUnsignedValue; + late final _clang_Cursor_getTemplateArgumentUnsignedValue_ptr = _lookup< + ffi.NativeFunction< + Native_clang_Cursor_getTemplateArgumentUnsignedValue>>( + 'clang_Cursor_getTemplateArgumentUnsignedValue'); + late final _dart_clang_Cursor_getTemplateArgumentUnsignedValue + _clang_Cursor_getTemplateArgumentUnsignedValue = + _clang_Cursor_getTemplateArgumentUnsignedValue_ptr + .asFunction<_dart_clang_Cursor_getTemplateArgumentUnsignedValue>(); /// Determine whether two CXTypes represent the same type. /// @@ -2800,15 +3026,16 @@ class LibClang { CXType A, CXType B, ) { - return (_clang_equalTypes ??= - _lookup>('clang_equalTypes') - .asFunction<_dart_clang_equalTypes>())( + return _clang_equalTypes( A, B, ); } - _dart_clang_equalTypes? _clang_equalTypes; + late final _clang_equalTypes_ptr = + _lookup>('clang_equalTypes'); + late final _dart_clang_equalTypes _clang_equalTypes = + _clang_equalTypes_ptr.asFunction<_dart_clang_equalTypes>(); /// Return the canonical type for a CXType. /// @@ -2819,15 +3046,16 @@ class LibClang { CXType clang_getCanonicalType( CXType T, ) { - return (_clang_getCanonicalType ??= - _lookup>( - 'clang_getCanonicalType') - .asFunction<_dart_clang_getCanonicalType>())( + return _clang_getCanonicalType( T, ); } - _dart_clang_getCanonicalType? _clang_getCanonicalType; + late final _clang_getCanonicalType_ptr = + _lookup>( + 'clang_getCanonicalType'); + late final _dart_clang_getCanonicalType _clang_getCanonicalType = + _clang_getCanonicalType_ptr.asFunction<_dart_clang_getCanonicalType>(); /// Determine whether a CXType has the "const" qualifier set, /// without looking through typedefs that may have added "const" at a @@ -2835,60 +3063,68 @@ class LibClang { int clang_isConstQualifiedType( CXType T, ) { - return (_clang_isConstQualifiedType ??= - _lookup>( - 'clang_isConstQualifiedType') - .asFunction<_dart_clang_isConstQualifiedType>())( + return _clang_isConstQualifiedType( T, ); } - _dart_clang_isConstQualifiedType? _clang_isConstQualifiedType; + late final _clang_isConstQualifiedType_ptr = + _lookup>( + 'clang_isConstQualifiedType'); + late final _dart_clang_isConstQualifiedType _clang_isConstQualifiedType = + _clang_isConstQualifiedType_ptr + .asFunction<_dart_clang_isConstQualifiedType>(); /// Determine whether a CXCursor that is a macro, is /// function like. int clang_Cursor_isMacroFunctionLike( CXCursor C, ) { - return (_clang_Cursor_isMacroFunctionLike ??= - _lookup>( - 'clang_Cursor_isMacroFunctionLike') - .asFunction<_dart_clang_Cursor_isMacroFunctionLike>())( + return _clang_Cursor_isMacroFunctionLike( C, ); } - _dart_clang_Cursor_isMacroFunctionLike? _clang_Cursor_isMacroFunctionLike; + late final _clang_Cursor_isMacroFunctionLike_ptr = + _lookup>( + 'clang_Cursor_isMacroFunctionLike'); + late final _dart_clang_Cursor_isMacroFunctionLike + _clang_Cursor_isMacroFunctionLike = _clang_Cursor_isMacroFunctionLike_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_Cursor_isMacroBuiltin') - .asFunction<_dart_clang_Cursor_isMacroBuiltin>())( + return _clang_Cursor_isMacroBuiltin( C, ); } - _dart_clang_Cursor_isMacroBuiltin? _clang_Cursor_isMacroBuiltin; + late final _clang_Cursor_isMacroBuiltin_ptr = + _lookup>( + 'clang_Cursor_isMacroBuiltin'); + late final _dart_clang_Cursor_isMacroBuiltin _clang_Cursor_isMacroBuiltin = + _clang_Cursor_isMacroBuiltin_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_Cursor_isFunctionInlined') - .asFunction<_dart_clang_Cursor_isFunctionInlined>())( + return _clang_Cursor_isFunctionInlined( C, ); } - _dart_clang_Cursor_isFunctionInlined? _clang_Cursor_isFunctionInlined; + late final _clang_Cursor_isFunctionInlined_ptr = + _lookup>( + 'clang_Cursor_isFunctionInlined'); + late final _dart_clang_Cursor_isFunctionInlined + _clang_Cursor_isFunctionInlined = _clang_Cursor_isFunctionInlined_ptr + .asFunction<_dart_clang_Cursor_isFunctionInlined>(); /// Determine whether a CXType has the "volatile" qualifier set, /// without looking through typedefs that may have added "volatile" at @@ -2896,15 +3132,17 @@ class LibClang { int clang_isVolatileQualifiedType( CXType T, ) { - return (_clang_isVolatileQualifiedType ??= - _lookup>( - 'clang_isVolatileQualifiedType') - .asFunction<_dart_clang_isVolatileQualifiedType>())( + return _clang_isVolatileQualifiedType( T, ); } - _dart_clang_isVolatileQualifiedType? _clang_isVolatileQualifiedType; + late final _clang_isVolatileQualifiedType_ptr = + _lookup>( + 'clang_isVolatileQualifiedType'); + late final _dart_clang_isVolatileQualifiedType + _clang_isVolatileQualifiedType = _clang_isVolatileQualifiedType_ptr + .asFunction<_dart_clang_isVolatileQualifiedType>(); /// Determine whether a CXType has the "restrict" qualifier set, /// without looking through typedefs that may have added "restrict" at a @@ -2912,113 +3150,126 @@ class LibClang { int clang_isRestrictQualifiedType( CXType T, ) { - return (_clang_isRestrictQualifiedType ??= - _lookup>( - 'clang_isRestrictQualifiedType') - .asFunction<_dart_clang_isRestrictQualifiedType>())( + return _clang_isRestrictQualifiedType( T, ); } - _dart_clang_isRestrictQualifiedType? _clang_isRestrictQualifiedType; + late final _clang_isRestrictQualifiedType_ptr = + _lookup>( + 'clang_isRestrictQualifiedType'); + late final _dart_clang_isRestrictQualifiedType + _clang_isRestrictQualifiedType = _clang_isRestrictQualifiedType_ptr + .asFunction<_dart_clang_isRestrictQualifiedType>(); /// Returns the address space of the given type. int clang_getAddressSpace( CXType T, ) { - return (_clang_getAddressSpace ??= - _lookup>( - 'clang_getAddressSpace') - .asFunction<_dart_clang_getAddressSpace>())( + return _clang_getAddressSpace( T, ); } - _dart_clang_getAddressSpace? _clang_getAddressSpace; + late final _clang_getAddressSpace_ptr = + _lookup>( + 'clang_getAddressSpace'); + late final _dart_clang_getAddressSpace _clang_getAddressSpace = + _clang_getAddressSpace_ptr.asFunction<_dart_clang_getAddressSpace>(); /// Returns the typedef name of the given type. CXString clang_getTypedefName( CXType CT, ) { - return (_clang_getTypedefName ??= - _lookup>( - 'clang_getTypedefName') - .asFunction<_dart_clang_getTypedefName>())( + return _clang_getTypedefName( CT, ); } - _dart_clang_getTypedefName? _clang_getTypedefName; + late final _clang_getTypedefName_ptr = + _lookup>( + 'clang_getTypedefName'); + late final _dart_clang_getTypedefName _clang_getTypedefName = + _clang_getTypedefName_ptr.asFunction<_dart_clang_getTypedefName>(); /// For pointer types, returns the type of the pointee. CXType clang_getPointeeType( CXType T, ) { - return (_clang_getPointeeType ??= - _lookup>( - 'clang_getPointeeType') - .asFunction<_dart_clang_getPointeeType>())( + return _clang_getPointeeType( T, ); } - _dart_clang_getPointeeType? _clang_getPointeeType; + late final _clang_getPointeeType_ptr = + _lookup>( + 'clang_getPointeeType'); + late final _dart_clang_getPointeeType _clang_getPointeeType = + _clang_getPointeeType_ptr.asFunction<_dart_clang_getPointeeType>(); /// Return the cursor for the declaration of the given type. CXCursor clang_getTypeDeclaration( CXType T, ) { - return (_clang_getTypeDeclaration ??= - _lookup>( - 'clang_getTypeDeclaration') - .asFunction<_dart_clang_getTypeDeclaration>())( + return _clang_getTypeDeclaration( T, ); } - _dart_clang_getTypeDeclaration? _clang_getTypeDeclaration; + late final _clang_getTypeDeclaration_ptr = + _lookup>( + 'clang_getTypeDeclaration'); + late final _dart_clang_getTypeDeclaration _clang_getTypeDeclaration = + _clang_getTypeDeclaration_ptr + .asFunction<_dart_clang_getTypeDeclaration>(); /// Returns the Objective-C type encoding for the specified declaration. CXString clang_getDeclObjCTypeEncoding( CXCursor C, ) { - return (_clang_getDeclObjCTypeEncoding ??= - _lookup>( - 'clang_getDeclObjCTypeEncoding') - .asFunction<_dart_clang_getDeclObjCTypeEncoding>())( + return _clang_getDeclObjCTypeEncoding( C, ); } - _dart_clang_getDeclObjCTypeEncoding? _clang_getDeclObjCTypeEncoding; + late final _clang_getDeclObjCTypeEncoding_ptr = + _lookup>( + 'clang_getDeclObjCTypeEncoding'); + late final _dart_clang_getDeclObjCTypeEncoding + _clang_getDeclObjCTypeEncoding = _clang_getDeclObjCTypeEncoding_ptr + .asFunction<_dart_clang_getDeclObjCTypeEncoding>(); /// Returns the Objective-C type encoding for the specified CXType. CXString clang_Type_getObjCEncoding( CXType type, ) { - return (_clang_Type_getObjCEncoding ??= - _lookup>( - 'clang_Type_getObjCEncoding') - .asFunction<_dart_clang_Type_getObjCEncoding>())( + return _clang_Type_getObjCEncoding( type, ); } - _dart_clang_Type_getObjCEncoding? _clang_Type_getObjCEncoding; + late final _clang_Type_getObjCEncoding_ptr = + _lookup>( + 'clang_Type_getObjCEncoding'); + late final _dart_clang_Type_getObjCEncoding _clang_Type_getObjCEncoding = + _clang_Type_getObjCEncoding_ptr + .asFunction<_dart_clang_Type_getObjCEncoding>(); /// Retrieve the spelling of a given CXTypeKind. CXString clang_getTypeKindSpelling( int K, ) { - return (_clang_getTypeKindSpelling ??= - _lookup>( - 'clang_getTypeKindSpelling') - .asFunction<_dart_clang_getTypeKindSpelling>())( + return _clang_getTypeKindSpelling( K, ); } - _dart_clang_getTypeKindSpelling? _clang_getTypeKindSpelling; + late final _clang_getTypeKindSpelling_ptr = + _lookup>( + 'clang_getTypeKindSpelling'); + late final _dart_clang_getTypeKindSpelling _clang_getTypeKindSpelling = + _clang_getTypeKindSpelling_ptr + .asFunction<_dart_clang_getTypeKindSpelling>(); /// Retrieve the calling convention associated with a function type. /// @@ -3026,15 +3277,17 @@ class LibClang { int clang_getFunctionTypeCallingConv( CXType T, ) { - return (_clang_getFunctionTypeCallingConv ??= - _lookup>( - 'clang_getFunctionTypeCallingConv') - .asFunction<_dart_clang_getFunctionTypeCallingConv>())( + return _clang_getFunctionTypeCallingConv( T, ); } - _dart_clang_getFunctionTypeCallingConv? _clang_getFunctionTypeCallingConv; + late final _clang_getFunctionTypeCallingConv_ptr = + _lookup>( + 'clang_getFunctionTypeCallingConv'); + late final _dart_clang_getFunctionTypeCallingConv + _clang_getFunctionTypeCallingConv = _clang_getFunctionTypeCallingConv_ptr + .asFunction<_dart_clang_getFunctionTypeCallingConv>(); /// Retrieve the return type associated with a function type. /// @@ -3042,15 +3295,16 @@ class LibClang { CXType clang_getResultType( CXType T, ) { - return (_clang_getResultType ??= - _lookup>( - 'clang_getResultType') - .asFunction<_dart_clang_getResultType>())( + return _clang_getResultType( T, ); } - _dart_clang_getResultType? _clang_getResultType; + late final _clang_getResultType_ptr = + _lookup>( + 'clang_getResultType'); + late final _dart_clang_getResultType _clang_getResultType = + _clang_getResultType_ptr.asFunction<_dart_clang_getResultType>(); /// Retrieve the exception specification type associated with a function type. /// This is a value of type CXCursor_ExceptionSpecificationKind. @@ -3059,16 +3313,18 @@ class LibClang { int clang_getExceptionSpecificationType( CXType T, ) { - return (_clang_getExceptionSpecificationType ??= - _lookup>( - 'clang_getExceptionSpecificationType') - .asFunction<_dart_clang_getExceptionSpecificationType>())( + return _clang_getExceptionSpecificationType( T, ); } - _dart_clang_getExceptionSpecificationType? - _clang_getExceptionSpecificationType; + late final _clang_getExceptionSpecificationType_ptr = + _lookup>( + 'clang_getExceptionSpecificationType'); + late final _dart_clang_getExceptionSpecificationType + _clang_getExceptionSpecificationType = + _clang_getExceptionSpecificationType_ptr + .asFunction<_dart_clang_getExceptionSpecificationType>(); /// Retrieve the number of non-variadic parameters associated with a /// function type. @@ -3077,15 +3333,16 @@ class LibClang { int clang_getNumArgTypes( CXType T, ) { - return (_clang_getNumArgTypes ??= - _lookup>( - 'clang_getNumArgTypes') - .asFunction<_dart_clang_getNumArgTypes>())( + return _clang_getNumArgTypes( T, ); } - _dart_clang_getNumArgTypes? _clang_getNumArgTypes; + late final _clang_getNumArgTypes_ptr = + _lookup>( + 'clang_getNumArgTypes'); + late final _dart_clang_getNumArgTypes _clang_getNumArgTypes = + _clang_getNumArgTypes_ptr.asFunction<_dart_clang_getNumArgTypes>(); /// Retrieve the type of a parameter of a function type. /// @@ -3095,15 +3352,16 @@ class LibClang { CXType T, int i, ) { - return (_clang_getArgType ??= - _lookup>('clang_getArgType') - .asFunction<_dart_clang_getArgType>())( + return _clang_getArgType( T, i, ); } - _dart_clang_getArgType? _clang_getArgType; + late final _clang_getArgType_ptr = + _lookup>('clang_getArgType'); + late final _dart_clang_getArgType _clang_getArgType = + _clang_getArgType_ptr.asFunction<_dart_clang_getArgType>(); /// Retrieves the base type of the ObjCObjectType. /// @@ -3111,15 +3369,17 @@ class LibClang { CXType clang_Type_getObjCObjectBaseType( CXType T, ) { - return (_clang_Type_getObjCObjectBaseType ??= - _lookup>( - 'clang_Type_getObjCObjectBaseType') - .asFunction<_dart_clang_Type_getObjCObjectBaseType>())( + return _clang_Type_getObjCObjectBaseType( T, ); } - _dart_clang_Type_getObjCObjectBaseType? _clang_Type_getObjCObjectBaseType; + late final _clang_Type_getObjCObjectBaseType_ptr = + _lookup>( + 'clang_Type_getObjCObjectBaseType'); + late final _dart_clang_Type_getObjCObjectBaseType + _clang_Type_getObjCObjectBaseType = _clang_Type_getObjCObjectBaseType_ptr + .asFunction<_dart_clang_Type_getObjCObjectBaseType>(); /// Retrieve the number of protocol references associated with an ObjC object/id. /// @@ -3127,15 +3387,18 @@ class LibClang { int clang_Type_getNumObjCProtocolRefs( CXType T, ) { - return (_clang_Type_getNumObjCProtocolRefs ??= - _lookup>( - 'clang_Type_getNumObjCProtocolRefs') - .asFunction<_dart_clang_Type_getNumObjCProtocolRefs>())( + return _clang_Type_getNumObjCProtocolRefs( T, ); } - _dart_clang_Type_getNumObjCProtocolRefs? _clang_Type_getNumObjCProtocolRefs; + late final _clang_Type_getNumObjCProtocolRefs_ptr = + _lookup>( + 'clang_Type_getNumObjCProtocolRefs'); + late final _dart_clang_Type_getNumObjCProtocolRefs + _clang_Type_getNumObjCProtocolRefs = + _clang_Type_getNumObjCProtocolRefs_ptr + .asFunction<_dart_clang_Type_getNumObjCProtocolRefs>(); /// Retrieve the decl for a protocol reference for an ObjC object/id. /// @@ -3145,16 +3408,18 @@ class LibClang { CXType T, int i, ) { - return (_clang_Type_getObjCProtocolDecl ??= - _lookup>( - 'clang_Type_getObjCProtocolDecl') - .asFunction<_dart_clang_Type_getObjCProtocolDecl>())( + return _clang_Type_getObjCProtocolDecl( T, i, ); } - _dart_clang_Type_getObjCProtocolDecl? _clang_Type_getObjCProtocolDecl; + late final _clang_Type_getObjCProtocolDecl_ptr = + _lookup>( + 'clang_Type_getObjCProtocolDecl'); + late final _dart_clang_Type_getObjCProtocolDecl + _clang_Type_getObjCProtocolDecl = _clang_Type_getObjCProtocolDecl_ptr + .asFunction<_dart_clang_Type_getObjCProtocolDecl>(); /// Retreive the number of type arguments associated with an ObjC object. /// @@ -3162,15 +3427,17 @@ class LibClang { int clang_Type_getNumObjCTypeArgs( CXType T, ) { - return (_clang_Type_getNumObjCTypeArgs ??= - _lookup>( - 'clang_Type_getNumObjCTypeArgs') - .asFunction<_dart_clang_Type_getNumObjCTypeArgs>())( + return _clang_Type_getNumObjCTypeArgs( T, ); } - _dart_clang_Type_getNumObjCTypeArgs? _clang_Type_getNumObjCTypeArgs; + late final _clang_Type_getNumObjCTypeArgs_ptr = + _lookup>( + 'clang_Type_getNumObjCTypeArgs'); + late final _dart_clang_Type_getNumObjCTypeArgs + _clang_Type_getNumObjCTypeArgs = _clang_Type_getNumObjCTypeArgs_ptr + .asFunction<_dart_clang_Type_getNumObjCTypeArgs>(); /// Retrieve a type argument associated with an ObjC object. /// @@ -3180,30 +3447,34 @@ class LibClang { CXType T, int i, ) { - return (_clang_Type_getObjCTypeArg ??= - _lookup>( - 'clang_Type_getObjCTypeArg') - .asFunction<_dart_clang_Type_getObjCTypeArg>())( + return _clang_Type_getObjCTypeArg( T, i, ); } - _dart_clang_Type_getObjCTypeArg? _clang_Type_getObjCTypeArg; + late final _clang_Type_getObjCTypeArg_ptr = + _lookup>( + 'clang_Type_getObjCTypeArg'); + late final _dart_clang_Type_getObjCTypeArg _clang_Type_getObjCTypeArg = + _clang_Type_getObjCTypeArg_ptr + .asFunction<_dart_clang_Type_getObjCTypeArg>(); /// Return 1 if the CXType is a variadic function type, and 0 otherwise. int clang_isFunctionTypeVariadic( CXType T, ) { - return (_clang_isFunctionTypeVariadic ??= - _lookup>( - 'clang_isFunctionTypeVariadic') - .asFunction<_dart_clang_isFunctionTypeVariadic>())( + return _clang_isFunctionTypeVariadic( T, ); } - _dart_clang_isFunctionTypeVariadic? _clang_isFunctionTypeVariadic; + late final _clang_isFunctionTypeVariadic_ptr = + _lookup>( + 'clang_isFunctionTypeVariadic'); + late final _dart_clang_isFunctionTypeVariadic _clang_isFunctionTypeVariadic = + _clang_isFunctionTypeVariadic_ptr + .asFunction<_dart_clang_isFunctionTypeVariadic>(); /// Retrieve the return type associated with a given cursor. /// @@ -3211,15 +3482,17 @@ class LibClang { CXType clang_getCursorResultType( CXCursor C, ) { - return (_clang_getCursorResultType ??= - _lookup>( - 'clang_getCursorResultType') - .asFunction<_dart_clang_getCursorResultType>())( + return _clang_getCursorResultType( C, ); } - _dart_clang_getCursorResultType? _clang_getCursorResultType; + late final _clang_getCursorResultType_ptr = + _lookup>( + 'clang_getCursorResultType'); + late final _dart_clang_getCursorResultType _clang_getCursorResultType = + _clang_getCursorResultType_ptr + .asFunction<_dart_clang_getCursorResultType>(); /// Retrieve the exception specification type associated with a given cursor. /// This is a value of type CXCursor_ExceptionSpecificationKind. @@ -3228,31 +3501,33 @@ class LibClang { int clang_getCursorExceptionSpecificationType( CXCursor C, ) { - return (_clang_getCursorExceptionSpecificationType ??= _lookup< - ffi.NativeFunction< - _c_clang_getCursorExceptionSpecificationType>>( - 'clang_getCursorExceptionSpecificationType') - .asFunction<_dart_clang_getCursorExceptionSpecificationType>())( + return _clang_getCursorExceptionSpecificationType( C, ); } - _dart_clang_getCursorExceptionSpecificationType? - _clang_getCursorExceptionSpecificationType; + late final _clang_getCursorExceptionSpecificationType_ptr = _lookup< + ffi.NativeFunction>( + 'clang_getCursorExceptionSpecificationType'); + late final _dart_clang_getCursorExceptionSpecificationType + _clang_getCursorExceptionSpecificationType = + _clang_getCursorExceptionSpecificationType_ptr + .asFunction<_dart_clang_getCursorExceptionSpecificationType>(); /// Return 1 if the CXType is a POD (plain old data) type, and 0 /// otherwise. int clang_isPODType( CXType T, ) { - return (_clang_isPODType ??= - _lookup>('clang_isPODType') - .asFunction<_dart_clang_isPODType>())( + return _clang_isPODType( T, ); } - _dart_clang_isPODType? _clang_isPODType; + late final _clang_isPODType_ptr = + _lookup>('clang_isPODType'); + late final _dart_clang_isPODType _clang_isPODType = + _clang_isPODType_ptr.asFunction<_dart_clang_isPODType>(); /// Return the element type of an array, complex, or vector type. /// @@ -3261,15 +3536,16 @@ class LibClang { CXType clang_getElementType( CXType T, ) { - return (_clang_getElementType ??= - _lookup>( - 'clang_getElementType') - .asFunction<_dart_clang_getElementType>())( + return _clang_getElementType( T, ); } - _dart_clang_getElementType? _clang_getElementType; + late final _clang_getElementType_ptr = + _lookup>( + 'clang_getElementType'); + late final _dart_clang_getElementType _clang_getElementType = + _clang_getElementType_ptr.asFunction<_dart_clang_getElementType>(); /// Return the number of elements of an array or vector type. /// @@ -3278,15 +3554,16 @@ class LibClang { int clang_getNumElements( CXType T, ) { - return (_clang_getNumElements ??= - _lookup>( - 'clang_getNumElements') - .asFunction<_dart_clang_getNumElements>())( + return _clang_getNumElements( T, ); } - _dart_clang_getNumElements? _clang_getNumElements; + late final _clang_getNumElements_ptr = + _lookup>( + 'clang_getNumElements'); + late final _dart_clang_getNumElements _clang_getNumElements = + _clang_getNumElements_ptr.asFunction<_dart_clang_getNumElements>(); /// Return the element type of an array type. /// @@ -3294,15 +3571,17 @@ class LibClang { CXType clang_getArrayElementType( CXType T, ) { - return (_clang_getArrayElementType ??= - _lookup>( - 'clang_getArrayElementType') - .asFunction<_dart_clang_getArrayElementType>())( + return _clang_getArrayElementType( T, ); } - _dart_clang_getArrayElementType? _clang_getArrayElementType; + late final _clang_getArrayElementType_ptr = + _lookup>( + 'clang_getArrayElementType'); + late final _dart_clang_getArrayElementType _clang_getArrayElementType = + _clang_getArrayElementType_ptr + .asFunction<_dart_clang_getArrayElementType>(); /// Return the array size of a constant array. /// @@ -3310,14 +3589,16 @@ class LibClang { int clang_getArraySize( CXType T, ) { - return (_clang_getArraySize ??= - _lookup>('clang_getArraySize') - .asFunction<_dart_clang_getArraySize>())( + return _clang_getArraySize( T, ); } - _dart_clang_getArraySize? _clang_getArraySize; + late final _clang_getArraySize_ptr = + _lookup>( + 'clang_getArraySize'); + late final _dart_clang_getArraySize _clang_getArraySize = + _clang_getArraySize_ptr.asFunction<_dart_clang_getArraySize>(); /// Retrieve the type named by the qualified-id. /// @@ -3325,15 +3606,16 @@ class LibClang { CXType clang_Type_getNamedType( CXType T, ) { - return (_clang_Type_getNamedType ??= - _lookup>( - 'clang_Type_getNamedType') - .asFunction<_dart_clang_Type_getNamedType>())( + return _clang_Type_getNamedType( T, ); } - _dart_clang_Type_getNamedType? _clang_Type_getNamedType; + late final _clang_Type_getNamedType_ptr = + _lookup>( + 'clang_Type_getNamedType'); + late final _dart_clang_Type_getNamedType _clang_Type_getNamedType = + _clang_Type_getNamedType_ptr.asFunction<_dart_clang_Type_getNamedType>(); /// Determine if a typedef is 'transparent' tag. /// @@ -3344,29 +3626,34 @@ class LibClang { int clang_Type_isTransparentTagTypedef( CXType T, ) { - return (_clang_Type_isTransparentTagTypedef ??= - _lookup>( - 'clang_Type_isTransparentTagTypedef') - .asFunction<_dart_clang_Type_isTransparentTagTypedef>())( + return _clang_Type_isTransparentTagTypedef( T, ); } - _dart_clang_Type_isTransparentTagTypedef? _clang_Type_isTransparentTagTypedef; + late final _clang_Type_isTransparentTagTypedef_ptr = + _lookup>( + 'clang_Type_isTransparentTagTypedef'); + late final _dart_clang_Type_isTransparentTagTypedef + _clang_Type_isTransparentTagTypedef = + _clang_Type_isTransparentTagTypedef_ptr + .asFunction<_dart_clang_Type_isTransparentTagTypedef>(); /// Retrieve the nullability kind of a pointer type. int clang_Type_getNullability( CXType T, ) { - return (_clang_Type_getNullability ??= - _lookup>( - 'clang_Type_getNullability') - .asFunction<_dart_clang_Type_getNullability>())( + return _clang_Type_getNullability( T, ); } - _dart_clang_Type_getNullability? _clang_Type_getNullability; + late final _clang_Type_getNullability_ptr = + _lookup>( + 'clang_Type_getNullability'); + late final _dart_clang_Type_getNullability _clang_Type_getNullability = + _clang_Type_getNullability_ptr + .asFunction<_dart_clang_Type_getNullability>(); /// Return the alignment of a type in bytes as per C++[expr.alignof] /// standard. @@ -3381,15 +3668,16 @@ class LibClang { int clang_Type_getAlignOf( CXType T, ) { - return (_clang_Type_getAlignOf ??= - _lookup>( - 'clang_Type_getAlignOf') - .asFunction<_dart_clang_Type_getAlignOf>())( + return _clang_Type_getAlignOf( T, ); } - _dart_clang_Type_getAlignOf? _clang_Type_getAlignOf; + late final _clang_Type_getAlignOf_ptr = + _lookup>( + 'clang_Type_getAlignOf'); + late final _dart_clang_Type_getAlignOf _clang_Type_getAlignOf = + _clang_Type_getAlignOf_ptr.asFunction<_dart_clang_Type_getAlignOf>(); /// Return the class type of an member pointer type. /// @@ -3397,15 +3685,16 @@ class LibClang { CXType clang_Type_getClassType( CXType T, ) { - return (_clang_Type_getClassType ??= - _lookup>( - 'clang_Type_getClassType') - .asFunction<_dart_clang_Type_getClassType>())( + return _clang_Type_getClassType( T, ); } - _dart_clang_Type_getClassType? _clang_Type_getClassType; + late final _clang_Type_getClassType_ptr = + _lookup>( + 'clang_Type_getClassType'); + late final _dart_clang_Type_getClassType _clang_Type_getClassType = + _clang_Type_getClassType_ptr.asFunction<_dart_clang_Type_getClassType>(); /// Return the size of a type in bytes as per C++[expr.sizeof] standard. /// @@ -3417,15 +3706,16 @@ class LibClang { int clang_Type_getSizeOf( CXType T, ) { - return (_clang_Type_getSizeOf ??= - _lookup>( - 'clang_Type_getSizeOf') - .asFunction<_dart_clang_Type_getSizeOf>())( + return _clang_Type_getSizeOf( T, ); } - _dart_clang_Type_getSizeOf? _clang_Type_getSizeOf; + late final _clang_Type_getSizeOf_ptr = + _lookup>( + 'clang_Type_getSizeOf'); + late final _dart_clang_Type_getSizeOf _clang_Type_getSizeOf = + _clang_Type_getSizeOf_ptr.asFunction<_dart_clang_Type_getSizeOf>(); /// 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] @@ -3442,16 +3732,17 @@ class LibClang { CXType T, ffi.Pointer S, ) { - return (_clang_Type_getOffsetOf ??= - _lookup>( - 'clang_Type_getOffsetOf') - .asFunction<_dart_clang_Type_getOffsetOf>())( + return _clang_Type_getOffsetOf( T, S, ); } - _dart_clang_Type_getOffsetOf? _clang_Type_getOffsetOf; + late final _clang_Type_getOffsetOf_ptr = + _lookup>( + 'clang_Type_getOffsetOf'); + late final _dart_clang_Type_getOffsetOf _clang_Type_getOffsetOf = + _clang_Type_getOffsetOf_ptr.asFunction<_dart_clang_Type_getOffsetOf>(); /// Return the type that was modified by this attributed type. /// @@ -3459,15 +3750,17 @@ class LibClang { CXType clang_Type_getModifiedType( CXType T, ) { - return (_clang_Type_getModifiedType ??= - _lookup>( - 'clang_Type_getModifiedType') - .asFunction<_dart_clang_Type_getModifiedType>())( + return _clang_Type_getModifiedType( T, ); } - _dart_clang_Type_getModifiedType? _clang_Type_getModifiedType; + late final _clang_Type_getModifiedType_ptr = + _lookup>( + 'clang_Type_getModifiedType'); + late final _dart_clang_Type_getModifiedType _clang_Type_getModifiedType = + _clang_Type_getModifiedType_ptr + .asFunction<_dart_clang_Type_getModifiedType>(); /// Return the offset of the field represented by the Cursor. /// @@ -3483,75 +3776,87 @@ class LibClang { int clang_Cursor_getOffsetOfField( CXCursor C, ) { - return (_clang_Cursor_getOffsetOfField ??= - _lookup>( - 'clang_Cursor_getOffsetOfField') - .asFunction<_dart_clang_Cursor_getOffsetOfField>())( + return _clang_Cursor_getOffsetOfField( C, ); } - _dart_clang_Cursor_getOffsetOfField? _clang_Cursor_getOffsetOfField; + late final _clang_Cursor_getOffsetOfField_ptr = + _lookup>( + 'clang_Cursor_getOffsetOfField'); + late final _dart_clang_Cursor_getOffsetOfField + _clang_Cursor_getOffsetOfField = _clang_Cursor_getOffsetOfField_ptr + .asFunction<_dart_clang_Cursor_getOffsetOfField>(); /// Determine whether the given cursor represents an anonymous /// tag or namespace int clang_Cursor_isAnonymous( CXCursor C, ) { - return (_clang_Cursor_isAnonymous ??= - _lookup>( - 'clang_Cursor_isAnonymous') - .asFunction<_dart_clang_Cursor_isAnonymous>())( + return _clang_Cursor_isAnonymous( C, ); } - _dart_clang_Cursor_isAnonymous? _clang_Cursor_isAnonymous; + late final _clang_Cursor_isAnonymous_ptr = + _lookup>( + 'clang_Cursor_isAnonymous'); + late final _dart_clang_Cursor_isAnonymous _clang_Cursor_isAnonymous = + _clang_Cursor_isAnonymous_ptr + .asFunction<_dart_clang_Cursor_isAnonymous>(); /// Determine whether the given cursor represents an anonymous record /// declaration. int clang_Cursor_isAnonymousRecordDecl( CXCursor C, ) { - return (_clang_Cursor_isAnonymousRecordDecl ??= - _lookup>( - 'clang_Cursor_isAnonymousRecordDecl') - .asFunction<_dart_clang_Cursor_isAnonymousRecordDecl>())( + return _clang_Cursor_isAnonymousRecordDecl( C, ); } - _dart_clang_Cursor_isAnonymousRecordDecl? _clang_Cursor_isAnonymousRecordDecl; + late final _clang_Cursor_isAnonymousRecordDecl_ptr = + _lookup>( + 'clang_Cursor_isAnonymousRecordDecl'); + late final _dart_clang_Cursor_isAnonymousRecordDecl + _clang_Cursor_isAnonymousRecordDecl = + _clang_Cursor_isAnonymousRecordDecl_ptr + .asFunction<_dart_clang_Cursor_isAnonymousRecordDecl>(); /// Determine whether the given cursor represents an inline namespace /// declaration. int clang_Cursor_isInlineNamespace( CXCursor C, ) { - return (_clang_Cursor_isInlineNamespace ??= - _lookup>( - 'clang_Cursor_isInlineNamespace') - .asFunction<_dart_clang_Cursor_isInlineNamespace>())( + return _clang_Cursor_isInlineNamespace( C, ); } - _dart_clang_Cursor_isInlineNamespace? _clang_Cursor_isInlineNamespace; + late final _clang_Cursor_isInlineNamespace_ptr = + _lookup>( + 'clang_Cursor_isInlineNamespace'); + late final _dart_clang_Cursor_isInlineNamespace + _clang_Cursor_isInlineNamespace = _clang_Cursor_isInlineNamespace_ptr + .asFunction<_dart_clang_Cursor_isInlineNamespace>(); /// 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_Type_getNumTemplateArguments ??= - _lookup>( - 'clang_Type_getNumTemplateArguments') - .asFunction<_dart_clang_Type_getNumTemplateArguments>())( + return _clang_Type_getNumTemplateArguments( T, ); } - _dart_clang_Type_getNumTemplateArguments? _clang_Type_getNumTemplateArguments; + late final _clang_Type_getNumTemplateArguments_ptr = + _lookup>( + 'clang_Type_getNumTemplateArguments'); + late final _dart_clang_Type_getNumTemplateArguments + _clang_Type_getNumTemplateArguments = + _clang_Type_getNumTemplateArguments_ptr + .asFunction<_dart_clang_Type_getNumTemplateArguments>(); /// Returns the type template argument of a template class specialization /// at given index. @@ -3562,17 +3867,19 @@ class LibClang { CXType T, int i, ) { - return (_clang_Type_getTemplateArgumentAsType ??= - _lookup>( - 'clang_Type_getTemplateArgumentAsType') - .asFunction<_dart_clang_Type_getTemplateArgumentAsType>())( + return _clang_Type_getTemplateArgumentAsType( T, i, ); } - _dart_clang_Type_getTemplateArgumentAsType? - _clang_Type_getTemplateArgumentAsType; + late final _clang_Type_getTemplateArgumentAsType_ptr = + _lookup>( + 'clang_Type_getTemplateArgumentAsType'); + late final _dart_clang_Type_getTemplateArgumentAsType + _clang_Type_getTemplateArgumentAsType = + _clang_Type_getTemplateArgumentAsType_ptr + .asFunction<_dart_clang_Type_getTemplateArgumentAsType>(); /// Retrieve the ref-qualifier kind of a function or method. /// @@ -3581,45 +3888,49 @@ class LibClang { int clang_Type_getCXXRefQualifier( CXType T, ) { - return (_clang_Type_getCXXRefQualifier ??= - _lookup>( - 'clang_Type_getCXXRefQualifier') - .asFunction<_dart_clang_Type_getCXXRefQualifier>())( + return _clang_Type_getCXXRefQualifier( T, ); } - _dart_clang_Type_getCXXRefQualifier? _clang_Type_getCXXRefQualifier; + late final _clang_Type_getCXXRefQualifier_ptr = + _lookup>( + 'clang_Type_getCXXRefQualifier'); + late final _dart_clang_Type_getCXXRefQualifier + _clang_Type_getCXXRefQualifier = _clang_Type_getCXXRefQualifier_ptr + .asFunction<_dart_clang_Type_getCXXRefQualifier>(); /// Returns non-zero if the cursor specifies a Record member that is a /// bitfield. int clang_Cursor_isBitField( CXCursor C, ) { - return (_clang_Cursor_isBitField ??= - _lookup>( - 'clang_Cursor_isBitField') - .asFunction<_dart_clang_Cursor_isBitField>())( + return _clang_Cursor_isBitField( C, ); } - _dart_clang_Cursor_isBitField? _clang_Cursor_isBitField; + late final _clang_Cursor_isBitField_ptr = + _lookup>( + 'clang_Cursor_isBitField'); + late final _dart_clang_Cursor_isBitField _clang_Cursor_isBitField = + _clang_Cursor_isBitField_ptr.asFunction<_dart_clang_Cursor_isBitField>(); /// Returns 1 if the base class specified by the cursor with kind /// CX_CXXBaseSpecifier is virtual. int clang_isVirtualBase( CXCursor arg0, ) { - return (_clang_isVirtualBase ??= - _lookup>( - 'clang_isVirtualBase') - .asFunction<_dart_clang_isVirtualBase>())( + return _clang_isVirtualBase( arg0, ); } - _dart_clang_isVirtualBase? _clang_isVirtualBase; + late final _clang_isVirtualBase_ptr = + _lookup>( + 'clang_isVirtualBase'); + late final _dart_clang_isVirtualBase _clang_isVirtualBase = + _clang_isVirtualBase_ptr.asFunction<_dart_clang_isVirtualBase>(); /// Returns the access control level for the referenced object. /// @@ -3629,15 +3940,17 @@ class LibClang { int clang_getCXXAccessSpecifier( CXCursor arg0, ) { - return (_clang_getCXXAccessSpecifier ??= - _lookup>( - 'clang_getCXXAccessSpecifier') - .asFunction<_dart_clang_getCXXAccessSpecifier>())( + return _clang_getCXXAccessSpecifier( arg0, ); } - _dart_clang_getCXXAccessSpecifier? _clang_getCXXAccessSpecifier; + late final _clang_getCXXAccessSpecifier_ptr = + _lookup>( + 'clang_getCXXAccessSpecifier'); + late final _dart_clang_getCXXAccessSpecifier _clang_getCXXAccessSpecifier = + _clang_getCXXAccessSpecifier_ptr + .asFunction<_dart_clang_getCXXAccessSpecifier>(); /// Returns the storage class for a function or variable declaration. /// @@ -3646,15 +3959,17 @@ class LibClang { int clang_Cursor_getStorageClass( CXCursor arg0, ) { - return (_clang_Cursor_getStorageClass ??= - _lookup>( - 'clang_Cursor_getStorageClass') - .asFunction<_dart_clang_Cursor_getStorageClass>())( + return _clang_Cursor_getStorageClass( arg0, ); } - _dart_clang_Cursor_getStorageClass? _clang_Cursor_getStorageClass; + late final _clang_Cursor_getStorageClass_ptr = + _lookup>( + 'clang_Cursor_getStorageClass'); + late final _dart_clang_Cursor_getStorageClass _clang_Cursor_getStorageClass = + _clang_Cursor_getStorageClass_ptr + .asFunction<_dart_clang_Cursor_getStorageClass>(); /// Determine the number of overloaded declarations referenced by a /// \c CXCursor_OverloadedDeclRef cursor. @@ -3666,15 +3981,17 @@ class LibClang { int clang_getNumOverloadedDecls( CXCursor cursor, ) { - return (_clang_getNumOverloadedDecls ??= - _lookup>( - 'clang_getNumOverloadedDecls') - .asFunction<_dart_clang_getNumOverloadedDecls>())( + return _clang_getNumOverloadedDecls( cursor, ); } - _dart_clang_getNumOverloadedDecls? _clang_getNumOverloadedDecls; + late final _clang_getNumOverloadedDecls_ptr = + _lookup>( + 'clang_getNumOverloadedDecls'); + late final _dart_clang_getNumOverloadedDecls _clang_getNumOverloadedDecls = + _clang_getNumOverloadedDecls_ptr + .asFunction<_dart_clang_getNumOverloadedDecls>(); /// Retrieve a cursor for one of the overloaded declarations referenced /// by a \c CXCursor_OverloadedDeclRef cursor. @@ -3692,31 +4009,34 @@ class LibClang { CXCursor cursor, int index, ) { - return (_clang_getOverloadedDecl ??= - _lookup>( - 'clang_getOverloadedDecl') - .asFunction<_dart_clang_getOverloadedDecl>())( + return _clang_getOverloadedDecl( cursor, index, ); } - _dart_clang_getOverloadedDecl? _clang_getOverloadedDecl; + late final _clang_getOverloadedDecl_ptr = + _lookup>( + 'clang_getOverloadedDecl'); + late final _dart_clang_getOverloadedDecl _clang_getOverloadedDecl = + _clang_getOverloadedDecl_ptr.asFunction<_dart_clang_getOverloadedDecl>(); /// For cursors representing an iboutletcollection attribute, /// this function returns the collection element type. CXType clang_getIBOutletCollectionType( CXCursor arg0, ) { - return (_clang_getIBOutletCollectionType ??= - _lookup>( - 'clang_getIBOutletCollectionType') - .asFunction<_dart_clang_getIBOutletCollectionType>())( + return _clang_getIBOutletCollectionType( arg0, ); } - _dart_clang_getIBOutletCollectionType? _clang_getIBOutletCollectionType; + late final _clang_getIBOutletCollectionType_ptr = + _lookup>( + 'clang_getIBOutletCollectionType'); + late final _dart_clang_getIBOutletCollectionType + _clang_getIBOutletCollectionType = _clang_getIBOutletCollectionType_ptr + .asFunction<_dart_clang_getIBOutletCollectionType>(); /// Visit the children of a particular cursor. /// @@ -3743,17 +4063,18 @@ class LibClang { ffi.Pointer> visitor, ffi.Pointer client_data, ) { - return (_clang_visitChildren ??= - _lookup>( - 'clang_visitChildren') - .asFunction<_dart_clang_visitChildren>())( + return _clang_visitChildren( parent, visitor, client_data, ); } - _dart_clang_visitChildren? _clang_visitChildren; + late final _clang_visitChildren_ptr = + _lookup>( + 'clang_visitChildren'); + late final _dart_clang_visitChildren _clang_visitChildren = + _clang_visitChildren_ptr.asFunction<_dart_clang_visitChildren>(); /// Retrieve a Unified Symbol Resolution (USR) for the entity referenced /// by the given cursor. @@ -3765,58 +4086,66 @@ class LibClang { CXString clang_getCursorUSR( CXCursor arg0, ) { - return (_clang_getCursorUSR ??= - _lookup>('clang_getCursorUSR') - .asFunction<_dart_clang_getCursorUSR>())( + return _clang_getCursorUSR( arg0, ); } - _dart_clang_getCursorUSR? _clang_getCursorUSR; + late final _clang_getCursorUSR_ptr = + _lookup>( + 'clang_getCursorUSR'); + late final _dart_clang_getCursorUSR _clang_getCursorUSR = + _clang_getCursorUSR_ptr.asFunction<_dart_clang_getCursorUSR>(); /// Construct a USR for a specified Objective-C class. CXString clang_constructUSR_ObjCClass( ffi.Pointer class_name, ) { - return (_clang_constructUSR_ObjCClass ??= - _lookup>( - 'clang_constructUSR_ObjCClass') - .asFunction<_dart_clang_constructUSR_ObjCClass>())( + return _clang_constructUSR_ObjCClass( class_name, ); } - _dart_clang_constructUSR_ObjCClass? _clang_constructUSR_ObjCClass; + late final _clang_constructUSR_ObjCClass_ptr = + _lookup>( + 'clang_constructUSR_ObjCClass'); + late final _dart_clang_constructUSR_ObjCClass _clang_constructUSR_ObjCClass = + _clang_constructUSR_ObjCClass_ptr + .asFunction<_dart_clang_constructUSR_ObjCClass>(); /// 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 ??= - _lookup>( - 'clang_constructUSR_ObjCCategory') - .asFunction<_dart_clang_constructUSR_ObjCCategory>())( + return _clang_constructUSR_ObjCCategory( class_name, category_name, ); } - _dart_clang_constructUSR_ObjCCategory? _clang_constructUSR_ObjCCategory; + late final _clang_constructUSR_ObjCCategory_ptr = + _lookup>( + 'clang_constructUSR_ObjCCategory'); + late final _dart_clang_constructUSR_ObjCCategory + _clang_constructUSR_ObjCCategory = _clang_constructUSR_ObjCCategory_ptr + .asFunction<_dart_clang_constructUSR_ObjCCategory>(); /// Construct a USR for a specified Objective-C protocol. CXString clang_constructUSR_ObjCProtocol( ffi.Pointer protocol_name, ) { - return (_clang_constructUSR_ObjCProtocol ??= - _lookup>( - 'clang_constructUSR_ObjCProtocol') - .asFunction<_dart_clang_constructUSR_ObjCProtocol>())( + return _clang_constructUSR_ObjCProtocol( protocol_name, ); } - _dart_clang_constructUSR_ObjCProtocol? _clang_constructUSR_ObjCProtocol; + late final _clang_constructUSR_ObjCProtocol_ptr = + _lookup>( + 'clang_constructUSR_ObjCProtocol'); + late final _dart_clang_constructUSR_ObjCProtocol + _clang_constructUSR_ObjCProtocol = _clang_constructUSR_ObjCProtocol_ptr + .asFunction<_dart_clang_constructUSR_ObjCProtocol>(); /// Construct a USR for a specified Objective-C instance variable and /// the USR for its containing class. @@ -3824,16 +4153,18 @@ class LibClang { ffi.Pointer name, CXString classUSR, ) { - return (_clang_constructUSR_ObjCIvar ??= - _lookup>( - 'clang_constructUSR_ObjCIvar') - .asFunction<_dart_clang_constructUSR_ObjCIvar>())( + return _clang_constructUSR_ObjCIvar( name, classUSR, ); } - _dart_clang_constructUSR_ObjCIvar? _clang_constructUSR_ObjCIvar; + late final _clang_constructUSR_ObjCIvar_ptr = + _lookup>( + 'clang_constructUSR_ObjCIvar'); + late final _dart_clang_constructUSR_ObjCIvar _clang_constructUSR_ObjCIvar = + _clang_constructUSR_ObjCIvar_ptr + .asFunction<_dart_clang_constructUSR_ObjCIvar>(); /// Construct a USR for a specified Objective-C method and /// the USR for its containing class. @@ -3842,17 +4173,19 @@ class LibClang { int isInstanceMethod, CXString classUSR, ) { - return (_clang_constructUSR_ObjCMethod ??= - _lookup>( - 'clang_constructUSR_ObjCMethod') - .asFunction<_dart_clang_constructUSR_ObjCMethod>())( + return _clang_constructUSR_ObjCMethod( name, isInstanceMethod, classUSR, ); } - _dart_clang_constructUSR_ObjCMethod? _clang_constructUSR_ObjCMethod; + late final _clang_constructUSR_ObjCMethod_ptr = + _lookup>( + 'clang_constructUSR_ObjCMethod'); + late final _dart_clang_constructUSR_ObjCMethod + _clang_constructUSR_ObjCMethod = _clang_constructUSR_ObjCMethod_ptr + .asFunction<_dart_clang_constructUSR_ObjCMethod>(); /// Construct a USR for a specified Objective-C property and the USR /// for its containing class. @@ -3860,30 +4193,33 @@ class LibClang { ffi.Pointer property, CXString classUSR, ) { - return (_clang_constructUSR_ObjCProperty ??= - _lookup>( - 'clang_constructUSR_ObjCProperty') - .asFunction<_dart_clang_constructUSR_ObjCProperty>())( + return _clang_constructUSR_ObjCProperty( property, classUSR, ); } - _dart_clang_constructUSR_ObjCProperty? _clang_constructUSR_ObjCProperty; + late final _clang_constructUSR_ObjCProperty_ptr = + _lookup>( + 'clang_constructUSR_ObjCProperty'); + late final _dart_clang_constructUSR_ObjCProperty + _clang_constructUSR_ObjCProperty = _clang_constructUSR_ObjCProperty_ptr + .asFunction<_dart_clang_constructUSR_ObjCProperty>(); /// Retrieve a name for the entity referenced by this cursor. CXString clang_getCursorSpelling( CXCursor arg0, ) { - return (_clang_getCursorSpelling ??= - _lookup>( - 'clang_getCursorSpelling') - .asFunction<_dart_clang_getCursorSpelling>())( + return _clang_getCursorSpelling( arg0, ); } - _dart_clang_getCursorSpelling? _clang_getCursorSpelling; + late final _clang_getCursorSpelling_ptr = + _lookup>( + 'clang_getCursorSpelling'); + late final _dart_clang_getCursorSpelling _clang_getCursorSpelling = + _clang_getCursorSpelling_ptr.asFunction<_dart_clang_getCursorSpelling>(); /// 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 @@ -3899,33 +4235,38 @@ class LibClang { int pieceIndex, int options, ) { - return (_clang_Cursor_getSpellingNameRange ??= - _lookup>( - 'clang_Cursor_getSpellingNameRange') - .asFunction<_dart_clang_Cursor_getSpellingNameRange>())( + return _clang_Cursor_getSpellingNameRange( arg0, pieceIndex, options, ); } - _dart_clang_Cursor_getSpellingNameRange? _clang_Cursor_getSpellingNameRange; + late final _clang_Cursor_getSpellingNameRange_ptr = + _lookup>( + 'clang_Cursor_getSpellingNameRange'); + late final _dart_clang_Cursor_getSpellingNameRange + _clang_Cursor_getSpellingNameRange = + _clang_Cursor_getSpellingNameRange_ptr + .asFunction<_dart_clang_Cursor_getSpellingNameRange>(); /// Get a property value for the given printing policy. int clang_PrintingPolicy_getProperty( ffi.Pointer Policy, int Property, ) { - return (_clang_PrintingPolicy_getProperty ??= - _lookup>( - 'clang_PrintingPolicy_getProperty') - .asFunction<_dart_clang_PrintingPolicy_getProperty>())( + return _clang_PrintingPolicy_getProperty( Policy, Property, ); } - _dart_clang_PrintingPolicy_getProperty? _clang_PrintingPolicy_getProperty; + late final _clang_PrintingPolicy_getProperty_ptr = + _lookup>( + 'clang_PrintingPolicy_getProperty'); + late final _dart_clang_PrintingPolicy_getProperty + _clang_PrintingPolicy_getProperty = _clang_PrintingPolicy_getProperty_ptr + .asFunction<_dart_clang_PrintingPolicy_getProperty>(); /// Set a property value for the given printing policy. void clang_PrintingPolicy_setProperty( @@ -3933,17 +4274,19 @@ class LibClang { int Property, int Value, ) { - return (_clang_PrintingPolicy_setProperty ??= - _lookup>( - 'clang_PrintingPolicy_setProperty') - .asFunction<_dart_clang_PrintingPolicy_setProperty>())( + return _clang_PrintingPolicy_setProperty( Policy, Property, Value, ); } - _dart_clang_PrintingPolicy_setProperty? _clang_PrintingPolicy_setProperty; + late final _clang_PrintingPolicy_setProperty_ptr = + _lookup>( + 'clang_PrintingPolicy_setProperty'); + late final _dart_clang_PrintingPolicy_setProperty + _clang_PrintingPolicy_setProperty = _clang_PrintingPolicy_setProperty_ptr + .asFunction<_dart_clang_PrintingPolicy_setProperty>(); /// Retrieve the default policy for the cursor. /// @@ -3952,29 +4295,33 @@ class LibClang { ffi.Pointer clang_getCursorPrintingPolicy( CXCursor arg0, ) { - return (_clang_getCursorPrintingPolicy ??= - _lookup>( - 'clang_getCursorPrintingPolicy') - .asFunction<_dart_clang_getCursorPrintingPolicy>())( + return _clang_getCursorPrintingPolicy( arg0, ); } - _dart_clang_getCursorPrintingPolicy? _clang_getCursorPrintingPolicy; + late final _clang_getCursorPrintingPolicy_ptr = + _lookup>( + 'clang_getCursorPrintingPolicy'); + late final _dart_clang_getCursorPrintingPolicy + _clang_getCursorPrintingPolicy = _clang_getCursorPrintingPolicy_ptr + .asFunction<_dart_clang_getCursorPrintingPolicy>(); /// Release a printing policy. void clang_PrintingPolicy_dispose( ffi.Pointer Policy, ) { - return (_clang_PrintingPolicy_dispose ??= - _lookup>( - 'clang_PrintingPolicy_dispose') - .asFunction<_dart_clang_PrintingPolicy_dispose>())( + return _clang_PrintingPolicy_dispose( Policy, ); } - _dart_clang_PrintingPolicy_dispose? _clang_PrintingPolicy_dispose; + late final _clang_PrintingPolicy_dispose_ptr = + _lookup>( + 'clang_PrintingPolicy_dispose'); + late final _dart_clang_PrintingPolicy_dispose _clang_PrintingPolicy_dispose = + _clang_PrintingPolicy_dispose_ptr + .asFunction<_dart_clang_PrintingPolicy_dispose>(); /// Pretty print declarations. /// @@ -3989,16 +4336,18 @@ class LibClang { CXCursor Cursor, ffi.Pointer Policy, ) { - return (_clang_getCursorPrettyPrinted ??= - _lookup>( - 'clang_getCursorPrettyPrinted') - .asFunction<_dart_clang_getCursorPrettyPrinted>())( + return _clang_getCursorPrettyPrinted( Cursor, Policy, ); } - _dart_clang_getCursorPrettyPrinted? _clang_getCursorPrettyPrinted; + late final _clang_getCursorPrettyPrinted_ptr = + _lookup>( + 'clang_getCursorPrettyPrinted'); + late final _dart_clang_getCursorPrettyPrinted _clang_getCursorPrettyPrinted = + _clang_getCursorPrettyPrinted_ptr + .asFunction<_dart_clang_getCursorPrettyPrinted>(); /// Retrieve the display name for the entity referenced by this cursor. /// @@ -4008,15 +4357,17 @@ class LibClang { CXString clang_getCursorDisplayName( CXCursor arg0, ) { - return (_clang_getCursorDisplayName ??= - _lookup>( - 'clang_getCursorDisplayName') - .asFunction<_dart_clang_getCursorDisplayName>())( + return _clang_getCursorDisplayName( arg0, ); } - _dart_clang_getCursorDisplayName? _clang_getCursorDisplayName; + late final _clang_getCursorDisplayName_ptr = + _lookup>( + 'clang_getCursorDisplayName'); + late final _dart_clang_getCursorDisplayName _clang_getCursorDisplayName = + _clang_getCursorDisplayName_ptr + .asFunction<_dart_clang_getCursorDisplayName>(); /// For a cursor that is a reference, retrieve a cursor representing the /// entity that it references. @@ -4030,15 +4381,17 @@ class LibClang { CXCursor clang_getCursorReferenced( CXCursor arg0, ) { - return (_clang_getCursorReferenced ??= - _lookup>( - 'clang_getCursorReferenced') - .asFunction<_dart_clang_getCursorReferenced>())( + return _clang_getCursorReferenced( arg0, ); } - _dart_clang_getCursorReferenced? _clang_getCursorReferenced; + late final _clang_getCursorReferenced_ptr = + _lookup>( + 'clang_getCursorReferenced'); + late final _dart_clang_getCursorReferenced _clang_getCursorReferenced = + _clang_getCursorReferenced_ptr + .asFunction<_dart_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 @@ -4069,30 +4422,34 @@ class LibClang { CXCursor clang_getCursorDefinition( CXCursor arg0, ) { - return (_clang_getCursorDefinition ??= - _lookup>( - 'clang_getCursorDefinition') - .asFunction<_dart_clang_getCursorDefinition>())( + return _clang_getCursorDefinition( arg0, ); } - _dart_clang_getCursorDefinition? _clang_getCursorDefinition; + late final _clang_getCursorDefinition_ptr = + _lookup>( + 'clang_getCursorDefinition'); + late final _dart_clang_getCursorDefinition _clang_getCursorDefinition = + _clang_getCursorDefinition_ptr + .asFunction<_dart_clang_getCursorDefinition>(); /// Determine whether the declaration pointed to by this cursor /// is also a definition of that entity. int clang_isCursorDefinition( CXCursor arg0, ) { - return (_clang_isCursorDefinition ??= - _lookup>( - 'clang_isCursorDefinition') - .asFunction<_dart_clang_isCursorDefinition>())( + return _clang_isCursorDefinition( arg0, ); } - _dart_clang_isCursorDefinition? _clang_isCursorDefinition; + late final _clang_isCursorDefinition_ptr = + _lookup>( + 'clang_isCursorDefinition'); + late final _dart_clang_isCursorDefinition _clang_isCursorDefinition = + _clang_isCursorDefinition_ptr + .asFunction<_dart_clang_isCursorDefinition>(); /// Retrieve the canonical cursor corresponding to the given cursor. /// @@ -4119,15 +4476,17 @@ class LibClang { CXCursor clang_getCanonicalCursor( CXCursor arg0, ) { - return (_clang_getCanonicalCursor ??= - _lookup>( - 'clang_getCanonicalCursor') - .asFunction<_dart_clang_getCanonicalCursor>())( + return _clang_getCanonicalCursor( arg0, ); } - _dart_clang_getCanonicalCursor? _clang_getCanonicalCursor; + late final _clang_getCanonicalCursor_ptr = + _lookup>( + 'clang_getCanonicalCursor'); + late final _dart_clang_getCanonicalCursor _clang_getCanonicalCursor = + _clang_getCanonicalCursor_ptr + .asFunction<_dart_clang_getCanonicalCursor>(); /// If the cursor points to a selector identifier in an Objective-C /// method or message expression, this returns the selector index. @@ -4141,15 +4500,18 @@ class LibClang { int clang_Cursor_getObjCSelectorIndex( CXCursor arg0, ) { - return (_clang_Cursor_getObjCSelectorIndex ??= - _lookup>( - 'clang_Cursor_getObjCSelectorIndex') - .asFunction<_dart_clang_Cursor_getObjCSelectorIndex>())( + return _clang_Cursor_getObjCSelectorIndex( arg0, ); } - _dart_clang_Cursor_getObjCSelectorIndex? _clang_Cursor_getObjCSelectorIndex; + late final _clang_Cursor_getObjCSelectorIndex_ptr = + _lookup>( + 'clang_Cursor_getObjCSelectorIndex'); + late final _dart_clang_Cursor_getObjCSelectorIndex + _clang_Cursor_getObjCSelectorIndex = + _clang_Cursor_getObjCSelectorIndex_ptr + .asFunction<_dart_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: @@ -4163,30 +4525,34 @@ class LibClang { int clang_Cursor_isDynamicCall( CXCursor C, ) { - return (_clang_Cursor_isDynamicCall ??= - _lookup>( - 'clang_Cursor_isDynamicCall') - .asFunction<_dart_clang_Cursor_isDynamicCall>())( + return _clang_Cursor_isDynamicCall( C, ); } - _dart_clang_Cursor_isDynamicCall? _clang_Cursor_isDynamicCall; + late final _clang_Cursor_isDynamicCall_ptr = + _lookup>( + 'clang_Cursor_isDynamicCall'); + late final _dart_clang_Cursor_isDynamicCall _clang_Cursor_isDynamicCall = + _clang_Cursor_isDynamicCall_ptr + .asFunction<_dart_clang_Cursor_isDynamicCall>(); /// 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 ??= - _lookup>( - 'clang_Cursor_getReceiverType') - .asFunction<_dart_clang_Cursor_getReceiverType>())( + return _clang_Cursor_getReceiverType( C, ); } - _dart_clang_Cursor_getReceiverType? _clang_Cursor_getReceiverType; + late final _clang_Cursor_getReceiverType_ptr = + _lookup>( + 'clang_Cursor_getReceiverType'); + late final _dart_clang_Cursor_getReceiverType _clang_Cursor_getReceiverType = + _clang_Cursor_getReceiverType_ptr + .asFunction<_dart_clang_Cursor_getReceiverType>(); /// Given a cursor that represents a property declaration, return the /// associated property attributes. The bits are formed from @@ -4197,49 +4563,55 @@ class LibClang { CXCursor C, int reserved, ) { - return (_clang_Cursor_getObjCPropertyAttributes ??= - _lookup>( - 'clang_Cursor_getObjCPropertyAttributes') - .asFunction<_dart_clang_Cursor_getObjCPropertyAttributes>())( + return _clang_Cursor_getObjCPropertyAttributes( C, reserved, ); } - _dart_clang_Cursor_getObjCPropertyAttributes? - _clang_Cursor_getObjCPropertyAttributes; + late final _clang_Cursor_getObjCPropertyAttributes_ptr = _lookup< + ffi.NativeFunction>( + 'clang_Cursor_getObjCPropertyAttributes'); + late final _dart_clang_Cursor_getObjCPropertyAttributes + _clang_Cursor_getObjCPropertyAttributes = + _clang_Cursor_getObjCPropertyAttributes_ptr + .asFunction<_dart_clang_Cursor_getObjCPropertyAttributes>(); /// 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 ??= - _lookup>( - 'clang_Cursor_getObjCPropertyGetterName') - .asFunction<_dart_clang_Cursor_getObjCPropertyGetterName>())( + return _clang_Cursor_getObjCPropertyGetterName( C, ); } - _dart_clang_Cursor_getObjCPropertyGetterName? - _clang_Cursor_getObjCPropertyGetterName; + late final _clang_Cursor_getObjCPropertyGetterName_ptr = _lookup< + ffi.NativeFunction>( + 'clang_Cursor_getObjCPropertyGetterName'); + late final _dart_clang_Cursor_getObjCPropertyGetterName + _clang_Cursor_getObjCPropertyGetterName = + _clang_Cursor_getObjCPropertyGetterName_ptr + .asFunction<_dart_clang_Cursor_getObjCPropertyGetterName>(); /// 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 ??= - _lookup>( - 'clang_Cursor_getObjCPropertySetterName') - .asFunction<_dart_clang_Cursor_getObjCPropertySetterName>())( + return _clang_Cursor_getObjCPropertySetterName( C, ); } - _dart_clang_Cursor_getObjCPropertySetterName? - _clang_Cursor_getObjCPropertySetterName; + late final _clang_Cursor_getObjCPropertySetterName_ptr = _lookup< + ffi.NativeFunction>( + 'clang_Cursor_getObjCPropertySetterName'); + late final _dart_clang_Cursor_getObjCPropertySetterName + _clang_Cursor_getObjCPropertySetterName = + _clang_Cursor_getObjCPropertySetterName_ptr + .asFunction<_dart_clang_Cursor_getObjCPropertySetterName>(); /// Given a cursor that represents an Objective-C method or parameter /// declaration, return the associated Objective-C qualifiers for the return @@ -4248,15 +4620,18 @@ class LibClang { int clang_Cursor_getObjCDeclQualifiers( CXCursor C, ) { - return (_clang_Cursor_getObjCDeclQualifiers ??= - _lookup>( - 'clang_Cursor_getObjCDeclQualifiers') - .asFunction<_dart_clang_Cursor_getObjCDeclQualifiers>())( + return _clang_Cursor_getObjCDeclQualifiers( C, ); } - _dart_clang_Cursor_getObjCDeclQualifiers? _clang_Cursor_getObjCDeclQualifiers; + late final _clang_Cursor_getObjCDeclQualifiers_ptr = + _lookup>( + 'clang_Cursor_getObjCDeclQualifiers'); + late final _dart_clang_Cursor_getObjCDeclQualifiers + _clang_Cursor_getObjCDeclQualifiers = + _clang_Cursor_getObjCDeclQualifiers_ptr + .asFunction<_dart_clang_Cursor_getObjCDeclQualifiers>(); /// Given a cursor that represents an Objective-C method or property /// declaration, return non-zero if the declaration was affected by "\@optional". @@ -4264,29 +4639,32 @@ class LibClang { int clang_Cursor_isObjCOptional( CXCursor C, ) { - return (_clang_Cursor_isObjCOptional ??= - _lookup>( - 'clang_Cursor_isObjCOptional') - .asFunction<_dart_clang_Cursor_isObjCOptional>())( + return _clang_Cursor_isObjCOptional( C, ); } - _dart_clang_Cursor_isObjCOptional? _clang_Cursor_isObjCOptional; + late final _clang_Cursor_isObjCOptional_ptr = + _lookup>( + 'clang_Cursor_isObjCOptional'); + late final _dart_clang_Cursor_isObjCOptional _clang_Cursor_isObjCOptional = + _clang_Cursor_isObjCOptional_ptr + .asFunction<_dart_clang_Cursor_isObjCOptional>(); /// Returns non-zero if the given cursor is a variadic function or method. int clang_Cursor_isVariadic( CXCursor C, ) { - return (_clang_Cursor_isVariadic ??= - _lookup>( - 'clang_Cursor_isVariadic') - .asFunction<_dart_clang_Cursor_isVariadic>())( + return _clang_Cursor_isVariadic( C, ); } - _dart_clang_Cursor_isVariadic? _clang_Cursor_isVariadic; + late final _clang_Cursor_isVariadic_ptr = + _lookup>( + 'clang_Cursor_isVariadic'); + late final _dart_clang_Cursor_isVariadic _clang_Cursor_isVariadic = + _clang_Cursor_isVariadic_ptr.asFunction<_dart_clang_Cursor_isVariadic>(); /// Returns non-zero if the given cursor points to a symbol marked with /// external_source_symbol attribute. @@ -4305,10 +4683,7 @@ class LibClang { ffi.Pointer definedIn, ffi.Pointer isGenerated, ) { - return (_clang_Cursor_isExternalSymbol ??= - _lookup>( - 'clang_Cursor_isExternalSymbol') - .asFunction<_dart_clang_Cursor_isExternalSymbol>())( + return _clang_Cursor_isExternalSymbol( C, language, definedIn, @@ -4316,7 +4691,12 @@ class LibClang { ); } - _dart_clang_Cursor_isExternalSymbol? _clang_Cursor_isExternalSymbol; + late final _clang_Cursor_isExternalSymbol_ptr = + _lookup>( + 'clang_Cursor_isExternalSymbol'); + late final _dart_clang_Cursor_isExternalSymbol + _clang_Cursor_isExternalSymbol = _clang_Cursor_isExternalSymbol_ptr + .asFunction<_dart_clang_Cursor_isExternalSymbol>(); /// Given a cursor that represents a declaration, return the associated /// comment's source range. The range may include multiple consecutive comments @@ -4324,30 +4704,34 @@ class LibClang { CXSourceRange clang_Cursor_getCommentRange( CXCursor C, ) { - return (_clang_Cursor_getCommentRange ??= - _lookup>( - 'clang_Cursor_getCommentRange') - .asFunction<_dart_clang_Cursor_getCommentRange>())( + return _clang_Cursor_getCommentRange( C, ); } - _dart_clang_Cursor_getCommentRange? _clang_Cursor_getCommentRange; + late final _clang_Cursor_getCommentRange_ptr = + _lookup>( + 'clang_Cursor_getCommentRange'); + late final _dart_clang_Cursor_getCommentRange _clang_Cursor_getCommentRange = + _clang_Cursor_getCommentRange_ptr + .asFunction<_dart_clang_Cursor_getCommentRange>(); /// 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 ??= - _lookup>( - 'clang_Cursor_getRawCommentText') - .asFunction<_dart_clang_Cursor_getRawCommentText>())( + return _clang_Cursor_getRawCommentText( C, ); } - _dart_clang_Cursor_getRawCommentText? _clang_Cursor_getRawCommentText; + late final _clang_Cursor_getRawCommentText_ptr = + _lookup>( + 'clang_Cursor_getRawCommentText'); + late final _dart_clang_Cursor_getRawCommentText + _clang_Cursor_getRawCommentText = _clang_Cursor_getRawCommentText_ptr + .asFunction<_dart_clang_Cursor_getRawCommentText>(); /// Given a cursor that represents a documentable entity (e.g., /// declaration), return the associated \paragraph; otherwise return the @@ -4355,73 +4739,82 @@ class LibClang { CXString clang_Cursor_getBriefCommentText( CXCursor C, ) { - return (_clang_Cursor_getBriefCommentText ??= - _lookup>( - 'clang_Cursor_getBriefCommentText') - .asFunction<_dart_clang_Cursor_getBriefCommentText>())( + return _clang_Cursor_getBriefCommentText( C, ); } - _dart_clang_Cursor_getBriefCommentText? _clang_Cursor_getBriefCommentText; + late final _clang_Cursor_getBriefCommentText_ptr = + _lookup>( + 'clang_Cursor_getBriefCommentText'); + late final _dart_clang_Cursor_getBriefCommentText + _clang_Cursor_getBriefCommentText = _clang_Cursor_getBriefCommentText_ptr + .asFunction<_dart_clang_Cursor_getBriefCommentText>(); /// Retrieve the CXString representing the mangled name of the cursor. CXString clang_Cursor_getMangling( CXCursor arg0, ) { - return (_clang_Cursor_getMangling ??= - _lookup>( - 'clang_Cursor_getMangling') - .asFunction<_dart_clang_Cursor_getMangling>())( + return _clang_Cursor_getMangling( arg0, ); } - _dart_clang_Cursor_getMangling? _clang_Cursor_getMangling; + late final _clang_Cursor_getMangling_ptr = + _lookup>( + 'clang_Cursor_getMangling'); + late final _dart_clang_Cursor_getMangling _clang_Cursor_getMangling = + _clang_Cursor_getMangling_ptr + .asFunction<_dart_clang_Cursor_getMangling>(); /// 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 ??= - _lookup>( - 'clang_Cursor_getCXXManglings') - .asFunction<_dart_clang_Cursor_getCXXManglings>())( + return _clang_Cursor_getCXXManglings( arg0, ); } - _dart_clang_Cursor_getCXXManglings? _clang_Cursor_getCXXManglings; + late final _clang_Cursor_getCXXManglings_ptr = + _lookup>( + 'clang_Cursor_getCXXManglings'); + late final _dart_clang_Cursor_getCXXManglings _clang_Cursor_getCXXManglings = + _clang_Cursor_getCXXManglings_ptr + .asFunction<_dart_clang_Cursor_getCXXManglings>(); /// 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 ??= - _lookup>( - 'clang_Cursor_getObjCManglings') - .asFunction<_dart_clang_Cursor_getObjCManglings>())( + return _clang_Cursor_getObjCManglings( arg0, ); } - _dart_clang_Cursor_getObjCManglings? _clang_Cursor_getObjCManglings; + late final _clang_Cursor_getObjCManglings_ptr = + _lookup>( + 'clang_Cursor_getObjCManglings'); + late final _dart_clang_Cursor_getObjCManglings + _clang_Cursor_getObjCManglings = _clang_Cursor_getObjCManglings_ptr + .asFunction<_dart_clang_Cursor_getObjCManglings>(); /// Given a CXCursor_ModuleImportDecl cursor, return the associated module. ffi.Pointer clang_Cursor_getModule( CXCursor C, ) { - return (_clang_Cursor_getModule ??= - _lookup>( - 'clang_Cursor_getModule') - .asFunction<_dart_clang_Cursor_getModule>())( + return _clang_Cursor_getModule( C, ); } - _dart_clang_Cursor_getModule? _clang_Cursor_getModule; + late final _clang_Cursor_getModule_ptr = + _lookup>( + 'clang_Cursor_getModule'); + late final _dart_clang_Cursor_getModule _clang_Cursor_getModule = + _clang_Cursor_getModule_ptr.asFunction<_dart_clang_Cursor_getModule>(); /// Given a CXFile header file, return the module that contains it, if one /// exists. @@ -4429,16 +4822,17 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer arg1, ) { - return (_clang_getModuleForFile ??= - _lookup>( - 'clang_getModuleForFile') - .asFunction<_dart_clang_getModuleForFile>())( + return _clang_getModuleForFile( arg0, arg1, ); } - _dart_clang_getModuleForFile? _clang_getModuleForFile; + late final _clang_getModuleForFile_ptr = + _lookup>( + 'clang_getModuleForFile'); + late final _dart_clang_getModuleForFile _clang_getModuleForFile = + _clang_getModuleForFile_ptr.asFunction<_dart_clang_getModuleForFile>(); /// \param Module a module object. /// @@ -4446,15 +4840,16 @@ class LibClang { ffi.Pointer clang_Module_getASTFile( ffi.Pointer Module, ) { - return (_clang_Module_getASTFile ??= - _lookup>( - 'clang_Module_getASTFile') - .asFunction<_dart_clang_Module_getASTFile>())( + return _clang_Module_getASTFile( Module, ); } - _dart_clang_Module_getASTFile? _clang_Module_getASTFile; + late final _clang_Module_getASTFile_ptr = + _lookup>( + 'clang_Module_getASTFile'); + late final _dart_clang_Module_getASTFile _clang_Module_getASTFile = + _clang_Module_getASTFile_ptr.asFunction<_dart_clang_Module_getASTFile>(); /// \param Module a module object. /// @@ -4463,15 +4858,16 @@ class LibClang { ffi.Pointer clang_Module_getParent( ffi.Pointer Module, ) { - return (_clang_Module_getParent ??= - _lookup>( - 'clang_Module_getParent') - .asFunction<_dart_clang_Module_getParent>())( + return _clang_Module_getParent( Module, ); } - _dart_clang_Module_getParent? _clang_Module_getParent; + late final _clang_Module_getParent_ptr = + _lookup>( + 'clang_Module_getParent'); + late final _dart_clang_Module_getParent _clang_Module_getParent = + _clang_Module_getParent_ptr.asFunction<_dart_clang_Module_getParent>(); /// \param Module a module object. /// @@ -4480,15 +4876,16 @@ class LibClang { CXString clang_Module_getName( ffi.Pointer Module, ) { - return (_clang_Module_getName ??= - _lookup>( - 'clang_Module_getName') - .asFunction<_dart_clang_Module_getName>())( + return _clang_Module_getName( Module, ); } - _dart_clang_Module_getName? _clang_Module_getName; + late final _clang_Module_getName_ptr = + _lookup>( + 'clang_Module_getName'); + late final _dart_clang_Module_getName _clang_Module_getName = + _clang_Module_getName_ptr.asFunction<_dart_clang_Module_getName>(); /// \param Module a module object. /// @@ -4496,15 +4893,17 @@ class LibClang { CXString clang_Module_getFullName( ffi.Pointer Module, ) { - return (_clang_Module_getFullName ??= - _lookup>( - 'clang_Module_getFullName') - .asFunction<_dart_clang_Module_getFullName>())( + return _clang_Module_getFullName( Module, ); } - _dart_clang_Module_getFullName? _clang_Module_getFullName; + late final _clang_Module_getFullName_ptr = + _lookup>( + 'clang_Module_getFullName'); + late final _dart_clang_Module_getFullName _clang_Module_getFullName = + _clang_Module_getFullName_ptr + .asFunction<_dart_clang_Module_getFullName>(); /// \param Module a module object. /// @@ -4512,15 +4911,16 @@ class LibClang { int clang_Module_isSystem( ffi.Pointer Module, ) { - return (_clang_Module_isSystem ??= - _lookup>( - 'clang_Module_isSystem') - .asFunction<_dart_clang_Module_isSystem>())( + return _clang_Module_isSystem( Module, ); } - _dart_clang_Module_isSystem? _clang_Module_isSystem; + late final _clang_Module_isSystem_ptr = + _lookup>( + 'clang_Module_isSystem'); + late final _dart_clang_Module_isSystem _clang_Module_isSystem = + _clang_Module_isSystem_ptr.asFunction<_dart_clang_Module_isSystem>(); /// \param Module a module object. /// @@ -4529,16 +4929,19 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer Module, ) { - return (_clang_Module_getNumTopLevelHeaders ??= - _lookup>( - 'clang_Module_getNumTopLevelHeaders') - .asFunction<_dart_clang_Module_getNumTopLevelHeaders>())( + return _clang_Module_getNumTopLevelHeaders( arg0, Module, ); } - _dart_clang_Module_getNumTopLevelHeaders? _clang_Module_getNumTopLevelHeaders; + late final _clang_Module_getNumTopLevelHeaders_ptr = + _lookup>( + 'clang_Module_getNumTopLevelHeaders'); + late final _dart_clang_Module_getNumTopLevelHeaders + _clang_Module_getNumTopLevelHeaders = + _clang_Module_getNumTopLevelHeaders_ptr + .asFunction<_dart_clang_Module_getNumTopLevelHeaders>(); /// \param Module a module object. /// @@ -4550,137 +4953,154 @@ class LibClang { ffi.Pointer Module, int Index, ) { - return (_clang_Module_getTopLevelHeader ??= - _lookup>( - 'clang_Module_getTopLevelHeader') - .asFunction<_dart_clang_Module_getTopLevelHeader>())( + return _clang_Module_getTopLevelHeader( arg0, Module, Index, ); } - _dart_clang_Module_getTopLevelHeader? _clang_Module_getTopLevelHeader; + late final _clang_Module_getTopLevelHeader_ptr = + _lookup>( + 'clang_Module_getTopLevelHeader'); + late final _dart_clang_Module_getTopLevelHeader + _clang_Module_getTopLevelHeader = _clang_Module_getTopLevelHeader_ptr + .asFunction<_dart_clang_Module_getTopLevelHeader>(); /// Determine if a C++ constructor is a converting constructor. int clang_CXXConstructor_isConvertingConstructor( CXCursor C, ) { - return (_clang_CXXConstructor_isConvertingConstructor ??= _lookup< - ffi.NativeFunction< - _c_clang_CXXConstructor_isConvertingConstructor>>( - 'clang_CXXConstructor_isConvertingConstructor') - .asFunction<_dart_clang_CXXConstructor_isConvertingConstructor>())( + return _clang_CXXConstructor_isConvertingConstructor( C, ); } - _dart_clang_CXXConstructor_isConvertingConstructor? - _clang_CXXConstructor_isConvertingConstructor; + late final _clang_CXXConstructor_isConvertingConstructor_ptr = _lookup< + ffi.NativeFunction< + Native_clang_CXXConstructor_isConvertingConstructor>>( + 'clang_CXXConstructor_isConvertingConstructor'); + late final _dart_clang_CXXConstructor_isConvertingConstructor + _clang_CXXConstructor_isConvertingConstructor = + _clang_CXXConstructor_isConvertingConstructor_ptr + .asFunction<_dart_clang_CXXConstructor_isConvertingConstructor>(); /// Determine if a C++ constructor is a copy constructor. int clang_CXXConstructor_isCopyConstructor( CXCursor C, ) { - return (_clang_CXXConstructor_isCopyConstructor ??= - _lookup>( - 'clang_CXXConstructor_isCopyConstructor') - .asFunction<_dart_clang_CXXConstructor_isCopyConstructor>())( + return _clang_CXXConstructor_isCopyConstructor( C, ); } - _dart_clang_CXXConstructor_isCopyConstructor? - _clang_CXXConstructor_isCopyConstructor; + late final _clang_CXXConstructor_isCopyConstructor_ptr = _lookup< + ffi.NativeFunction>( + 'clang_CXXConstructor_isCopyConstructor'); + late final _dart_clang_CXXConstructor_isCopyConstructor + _clang_CXXConstructor_isCopyConstructor = + _clang_CXXConstructor_isCopyConstructor_ptr + .asFunction<_dart_clang_CXXConstructor_isCopyConstructor>(); /// Determine if a C++ constructor is the default constructor. int clang_CXXConstructor_isDefaultConstructor( CXCursor C, ) { - return (_clang_CXXConstructor_isDefaultConstructor ??= _lookup< - ffi.NativeFunction< - _c_clang_CXXConstructor_isDefaultConstructor>>( - 'clang_CXXConstructor_isDefaultConstructor') - .asFunction<_dart_clang_CXXConstructor_isDefaultConstructor>())( + return _clang_CXXConstructor_isDefaultConstructor( C, ); } - _dart_clang_CXXConstructor_isDefaultConstructor? - _clang_CXXConstructor_isDefaultConstructor; + late final _clang_CXXConstructor_isDefaultConstructor_ptr = _lookup< + ffi.NativeFunction>( + 'clang_CXXConstructor_isDefaultConstructor'); + late final _dart_clang_CXXConstructor_isDefaultConstructor + _clang_CXXConstructor_isDefaultConstructor = + _clang_CXXConstructor_isDefaultConstructor_ptr + .asFunction<_dart_clang_CXXConstructor_isDefaultConstructor>(); /// Determine if a C++ constructor is a move constructor. int clang_CXXConstructor_isMoveConstructor( CXCursor C, ) { - return (_clang_CXXConstructor_isMoveConstructor ??= - _lookup>( - 'clang_CXXConstructor_isMoveConstructor') - .asFunction<_dart_clang_CXXConstructor_isMoveConstructor>())( + return _clang_CXXConstructor_isMoveConstructor( C, ); } - _dart_clang_CXXConstructor_isMoveConstructor? - _clang_CXXConstructor_isMoveConstructor; + late final _clang_CXXConstructor_isMoveConstructor_ptr = _lookup< + ffi.NativeFunction>( + 'clang_CXXConstructor_isMoveConstructor'); + late final _dart_clang_CXXConstructor_isMoveConstructor + _clang_CXXConstructor_isMoveConstructor = + _clang_CXXConstructor_isMoveConstructor_ptr + .asFunction<_dart_clang_CXXConstructor_isMoveConstructor>(); /// Determine if a C++ field is declared 'mutable'. int clang_CXXField_isMutable( CXCursor C, ) { - return (_clang_CXXField_isMutable ??= - _lookup>( - 'clang_CXXField_isMutable') - .asFunction<_dart_clang_CXXField_isMutable>())( + return _clang_CXXField_isMutable( C, ); } - _dart_clang_CXXField_isMutable? _clang_CXXField_isMutable; + late final _clang_CXXField_isMutable_ptr = + _lookup>( + 'clang_CXXField_isMutable'); + late final _dart_clang_CXXField_isMutable _clang_CXXField_isMutable = + _clang_CXXField_isMutable_ptr + .asFunction<_dart_clang_CXXField_isMutable>(); /// Determine if a C++ method is declared '= default'. int clang_CXXMethod_isDefaulted( CXCursor C, ) { - return (_clang_CXXMethod_isDefaulted ??= - _lookup>( - 'clang_CXXMethod_isDefaulted') - .asFunction<_dart_clang_CXXMethod_isDefaulted>())( + return _clang_CXXMethod_isDefaulted( C, ); } - _dart_clang_CXXMethod_isDefaulted? _clang_CXXMethod_isDefaulted; + late final _clang_CXXMethod_isDefaulted_ptr = + _lookup>( + 'clang_CXXMethod_isDefaulted'); + late final _dart_clang_CXXMethod_isDefaulted _clang_CXXMethod_isDefaulted = + _clang_CXXMethod_isDefaulted_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_CXXMethod_isPureVirtual') - .asFunction<_dart_clang_CXXMethod_isPureVirtual>())( + return _clang_CXXMethod_isPureVirtual( C, ); } - _dart_clang_CXXMethod_isPureVirtual? _clang_CXXMethod_isPureVirtual; + late final _clang_CXXMethod_isPureVirtual_ptr = + _lookup>( + 'clang_CXXMethod_isPureVirtual'); + late final _dart_clang_CXXMethod_isPureVirtual + _clang_CXXMethod_isPureVirtual = _clang_CXXMethod_isPureVirtual_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_CXXMethod_isStatic') - .asFunction<_dart_clang_CXXMethod_isStatic>())( + return _clang_CXXMethod_isStatic( C, ); } - _dart_clang_CXXMethod_isStatic? _clang_CXXMethod_isStatic; + late final _clang_CXXMethod_isStatic_ptr = + _lookup>( + 'clang_CXXMethod_isStatic'); + late final _dart_clang_CXXMethod_isStatic _clang_CXXMethod_isStatic = + _clang_CXXMethod_isStatic_ptr + .asFunction<_dart_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 @@ -4688,59 +5108,65 @@ class LibClang { int clang_CXXMethod_isVirtual( CXCursor C, ) { - return (_clang_CXXMethod_isVirtual ??= - _lookup>( - 'clang_CXXMethod_isVirtual') - .asFunction<_dart_clang_CXXMethod_isVirtual>())( + return _clang_CXXMethod_isVirtual( C, ); } - _dart_clang_CXXMethod_isVirtual? _clang_CXXMethod_isVirtual; + late final _clang_CXXMethod_isVirtual_ptr = + _lookup>( + 'clang_CXXMethod_isVirtual'); + late final _dart_clang_CXXMethod_isVirtual _clang_CXXMethod_isVirtual = + _clang_CXXMethod_isVirtual_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_CXXRecord_isAbstract') - .asFunction<_dart_clang_CXXRecord_isAbstract>())( + return _clang_CXXRecord_isAbstract( C, ); } - _dart_clang_CXXRecord_isAbstract? _clang_CXXRecord_isAbstract; + late final _clang_CXXRecord_isAbstract_ptr = + _lookup>( + 'clang_CXXRecord_isAbstract'); + late final _dart_clang_CXXRecord_isAbstract _clang_CXXRecord_isAbstract = + _clang_CXXRecord_isAbstract_ptr + .asFunction<_dart_clang_CXXRecord_isAbstract>(); /// Determine if an enum declaration refers to a scoped enum. int clang_EnumDecl_isScoped( CXCursor C, ) { - return (_clang_EnumDecl_isScoped ??= - _lookup>( - 'clang_EnumDecl_isScoped') - .asFunction<_dart_clang_EnumDecl_isScoped>())( + return _clang_EnumDecl_isScoped( C, ); } - _dart_clang_EnumDecl_isScoped? _clang_EnumDecl_isScoped; + late final _clang_EnumDecl_isScoped_ptr = + _lookup>( + 'clang_EnumDecl_isScoped'); + late final _dart_clang_EnumDecl_isScoped _clang_EnumDecl_isScoped = + _clang_EnumDecl_isScoped_ptr.asFunction<_dart_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 ??= - _lookup>( - 'clang_CXXMethod_isConst') - .asFunction<_dart_clang_CXXMethod_isConst>())( + return _clang_CXXMethod_isConst( C, ); } - _dart_clang_CXXMethod_isConst? _clang_CXXMethod_isConst; + late final _clang_CXXMethod_isConst_ptr = + _lookup>( + 'clang_CXXMethod_isConst'); + late final _dart_clang_CXXMethod_isConst _clang_CXXMethod_isConst = + _clang_CXXMethod_isConst_ptr.asFunction<_dart_clang_CXXMethod_isConst>(); /// Given a cursor that represents a template, determine /// the cursor kind of the specializations would be generated by instantiating @@ -4760,15 +5186,17 @@ class LibClang { int clang_getTemplateCursorKind( CXCursor C, ) { - return (_clang_getTemplateCursorKind ??= - _lookup>( - 'clang_getTemplateCursorKind') - .asFunction<_dart_clang_getTemplateCursorKind>())( + return _clang_getTemplateCursorKind( C, ); } - _dart_clang_getTemplateCursorKind? _clang_getTemplateCursorKind; + late final _clang_getTemplateCursorKind_ptr = + _lookup>( + 'clang_getTemplateCursorKind'); + late final _dart_clang_getTemplateCursorKind _clang_getTemplateCursorKind = + _clang_getTemplateCursorKind_ptr + .asFunction<_dart_clang_getTemplateCursorKind>(); /// Given a cursor that may represent a specialization or instantiation /// of a template, retrieve the cursor that represents the template that it @@ -4799,15 +5227,18 @@ class LibClang { CXCursor clang_getSpecializedCursorTemplate( CXCursor C, ) { - return (_clang_getSpecializedCursorTemplate ??= - _lookup>( - 'clang_getSpecializedCursorTemplate') - .asFunction<_dart_clang_getSpecializedCursorTemplate>())( + return _clang_getSpecializedCursorTemplate( C, ); } - _dart_clang_getSpecializedCursorTemplate? _clang_getSpecializedCursorTemplate; + late final _clang_getSpecializedCursorTemplate_ptr = + _lookup>( + 'clang_getSpecializedCursorTemplate'); + late final _dart_clang_getSpecializedCursorTemplate + _clang_getSpecializedCursorTemplate = + _clang_getSpecializedCursorTemplate_ptr + .asFunction<_dart_clang_getSpecializedCursorTemplate>(); /// Given a cursor that references something else, return the source range /// covering that reference. @@ -4830,17 +5261,20 @@ class LibClang { int NameFlags, int PieceIndex, ) { - return (_clang_getCursorReferenceNameRange ??= - _lookup>( - 'clang_getCursorReferenceNameRange') - .asFunction<_dart_clang_getCursorReferenceNameRange>())( + return _clang_getCursorReferenceNameRange( C, NameFlags, PieceIndex, ); } - _dart_clang_getCursorReferenceNameRange? _clang_getCursorReferenceNameRange; + late final _clang_getCursorReferenceNameRange_ptr = + _lookup>( + 'clang_getCursorReferenceNameRange'); + late final _dart_clang_getCursorReferenceNameRange + _clang_getCursorReferenceNameRange = + _clang_getCursorReferenceNameRange_ptr + .asFunction<_dart_clang_getCursorReferenceNameRange>(); /// Get the raw lexical token starting with the given location. /// @@ -4855,28 +5289,31 @@ class LibClang { ffi.Pointer TU, CXSourceLocation Location, ) { - return (_clang_getToken ??= - _lookup>('clang_getToken') - .asFunction<_dart_clang_getToken>())( + return _clang_getToken( TU, Location, ); } - _dart_clang_getToken? _clang_getToken; + late final _clang_getToken_ptr = + _lookup>('clang_getToken'); + late final _dart_clang_getToken _clang_getToken = + _clang_getToken_ptr.asFunction<_dart_clang_getToken>(); /// Determine the kind of the given token. int clang_getTokenKind( CXToken arg0, ) { - return (_clang_getTokenKind ??= - _lookup>('clang_getTokenKind') - .asFunction<_dart_clang_getTokenKind>())( + return _clang_getTokenKind( arg0, ); } - _dart_clang_getTokenKind? _clang_getTokenKind; + late final _clang_getTokenKind_ptr = + _lookup>( + 'clang_getTokenKind'); + late final _dart_clang_getTokenKind _clang_getTokenKind = + _clang_getTokenKind_ptr.asFunction<_dart_clang_getTokenKind>(); /// Determine the spelling of the given token. /// @@ -4886,48 +5323,51 @@ class LibClang { ffi.Pointer arg0, CXToken arg1, ) { - return (_clang_getTokenSpelling ??= - _lookup>( - 'clang_getTokenSpelling') - .asFunction<_dart_clang_getTokenSpelling>())( + return _clang_getTokenSpelling( arg0, arg1, ); } - _dart_clang_getTokenSpelling? _clang_getTokenSpelling; + late final _clang_getTokenSpelling_ptr = + _lookup>( + 'clang_getTokenSpelling'); + late final _dart_clang_getTokenSpelling _clang_getTokenSpelling = + _clang_getTokenSpelling_ptr.asFunction<_dart_clang_getTokenSpelling>(); /// Retrieve the source location of the given token. CXSourceLocation clang_getTokenLocation( ffi.Pointer arg0, CXToken arg1, ) { - return (_clang_getTokenLocation ??= - _lookup>( - 'clang_getTokenLocation') - .asFunction<_dart_clang_getTokenLocation>())( + return _clang_getTokenLocation( arg0, arg1, ); } - _dart_clang_getTokenLocation? _clang_getTokenLocation; + late final _clang_getTokenLocation_ptr = + _lookup>( + 'clang_getTokenLocation'); + late final _dart_clang_getTokenLocation _clang_getTokenLocation = + _clang_getTokenLocation_ptr.asFunction<_dart_clang_getTokenLocation>(); /// Retrieve a source range that covers the given token. CXSourceRange clang_getTokenExtent( ffi.Pointer arg0, CXToken arg1, ) { - return (_clang_getTokenExtent ??= - _lookup>( - 'clang_getTokenExtent') - .asFunction<_dart_clang_getTokenExtent>())( + return _clang_getTokenExtent( arg0, arg1, ); } - _dart_clang_getTokenExtent? _clang_getTokenExtent; + late final _clang_getTokenExtent_ptr = + _lookup>( + 'clang_getTokenExtent'); + late final _dart_clang_getTokenExtent _clang_getTokenExtent = + _clang_getTokenExtent_ptr.asFunction<_dart_clang_getTokenExtent>(); /// Tokenize the source code described by the given range into raw /// lexical tokens. @@ -4949,9 +5389,7 @@ class LibClang { ffi.Pointer> Tokens, ffi.Pointer NumTokens, ) { - return (_clang_tokenize ??= - _lookup>('clang_tokenize') - .asFunction<_dart_clang_tokenize>())( + return _clang_tokenize( TU, Range, Tokens, @@ -4959,7 +5397,10 @@ class LibClang { ); } - _dart_clang_tokenize? _clang_tokenize; + late final _clang_tokenize_ptr = + _lookup>('clang_tokenize'); + late final _dart_clang_tokenize _clang_tokenize = + _clang_tokenize_ptr.asFunction<_dart_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. @@ -4995,10 +5436,7 @@ class LibClang { int NumTokens, ffi.Pointer Cursors, ) { - return (_clang_annotateTokens ??= - _lookup>( - 'clang_annotateTokens') - .asFunction<_dart_clang_annotateTokens>())( + return _clang_annotateTokens( TU, Tokens, NumTokens, @@ -5006,7 +5444,11 @@ class LibClang { ); } - _dart_clang_annotateTokens? _clang_annotateTokens; + late final _clang_annotateTokens_ptr = + _lookup>( + 'clang_annotateTokens'); + late final _dart_clang_annotateTokens _clang_annotateTokens = + _clang_annotateTokens_ptr.asFunction<_dart_clang_annotateTokens>(); /// Free the given set of tokens. void clang_disposeTokens( @@ -5014,17 +5456,18 @@ class LibClang { ffi.Pointer Tokens, int NumTokens, ) { - return (_clang_disposeTokens ??= - _lookup>( - 'clang_disposeTokens') - .asFunction<_dart_clang_disposeTokens>())( + return _clang_disposeTokens( TU, Tokens, NumTokens, ); } - _dart_clang_disposeTokens? _clang_disposeTokens; + late final _clang_disposeTokens_ptr = + _lookup>( + 'clang_disposeTokens'); + late final _dart_clang_disposeTokens _clang_disposeTokens = + _clang_disposeTokens_ptr.asFunction<_dart_clang_disposeTokens>(); /// \defgroup CINDEX_DEBUG Debugging facilities /// @@ -5035,15 +5478,17 @@ class LibClang { CXString clang_getCursorKindSpelling( int Kind, ) { - return (_clang_getCursorKindSpelling ??= - _lookup>( - 'clang_getCursorKindSpelling') - .asFunction<_dart_clang_getCursorKindSpelling>())( + return _clang_getCursorKindSpelling( Kind, ); } - _dart_clang_getCursorKindSpelling? _clang_getCursorKindSpelling; + late final _clang_getCursorKindSpelling_ptr = + _lookup>( + 'clang_getCursorKindSpelling'); + late final _dart_clang_getCursorKindSpelling _clang_getCursorKindSpelling = + _clang_getCursorKindSpelling_ptr + .asFunction<_dart_clang_getCursorKindSpelling>(); void clang_getDefinitionSpellingAndExtent( CXCursor arg0, @@ -5054,10 +5499,7 @@ class LibClang { ffi.Pointer endLine, ffi.Pointer endColumn, ) { - return (_clang_getDefinitionSpellingAndExtent ??= - _lookup>( - 'clang_getDefinitionSpellingAndExtent') - .asFunction<_dart_clang_getDefinitionSpellingAndExtent>())( + return _clang_getDefinitionSpellingAndExtent( arg0, startBuf, endBuf, @@ -5068,34 +5510,41 @@ class LibClang { ); } - _dart_clang_getDefinitionSpellingAndExtent? - _clang_getDefinitionSpellingAndExtent; + late final _clang_getDefinitionSpellingAndExtent_ptr = + _lookup>( + 'clang_getDefinitionSpellingAndExtent'); + late final _dart_clang_getDefinitionSpellingAndExtent + _clang_getDefinitionSpellingAndExtent = + _clang_getDefinitionSpellingAndExtent_ptr + .asFunction<_dart_clang_getDefinitionSpellingAndExtent>(); void clang_enableStackTraces() { - return (_clang_enableStackTraces ??= - _lookup>( - 'clang_enableStackTraces') - .asFunction<_dart_clang_enableStackTraces>())(); + return _clang_enableStackTraces(); } - _dart_clang_enableStackTraces? _clang_enableStackTraces; + late final _clang_enableStackTraces_ptr = + _lookup>( + 'clang_enableStackTraces'); + late final _dart_clang_enableStackTraces _clang_enableStackTraces = + _clang_enableStackTraces_ptr.asFunction<_dart_clang_enableStackTraces>(); void clang_executeOnThread( ffi.Pointer> fn, ffi.Pointer user_data, int stack_size, ) { - return (_clang_executeOnThread ??= - _lookup>( - 'clang_executeOnThread') - .asFunction<_dart_clang_executeOnThread>())( + return _clang_executeOnThread( fn, user_data, stack_size, ); } - _dart_clang_executeOnThread? _clang_executeOnThread; + late final _clang_executeOnThread_ptr = + _lookup>( + 'clang_executeOnThread'); + late final _dart_clang_executeOnThread _clang_executeOnThread = + _clang_executeOnThread_ptr.asFunction<_dart_clang_executeOnThread>(); /// Determine the kind of a particular chunk within a completion string. /// @@ -5108,16 +5557,18 @@ class LibClang { ffi.Pointer completion_string, int chunk_number, ) { - return (_clang_getCompletionChunkKind ??= - _lookup>( - 'clang_getCompletionChunkKind') - .asFunction<_dart_clang_getCompletionChunkKind>())( + return _clang_getCompletionChunkKind( completion_string, chunk_number, ); } - _dart_clang_getCompletionChunkKind? _clang_getCompletionChunkKind; + late final _clang_getCompletionChunkKind_ptr = + _lookup>( + 'clang_getCompletionChunkKind'); + late final _dart_clang_getCompletionChunkKind _clang_getCompletionChunkKind = + _clang_getCompletionChunkKind_ptr + .asFunction<_dart_clang_getCompletionChunkKind>(); /// Retrieve the text associated with a particular chunk within a /// completion string. @@ -5131,16 +5582,18 @@ class LibClang { ffi.Pointer completion_string, int chunk_number, ) { - return (_clang_getCompletionChunkText ??= - _lookup>( - 'clang_getCompletionChunkText') - .asFunction<_dart_clang_getCompletionChunkText>())( + return _clang_getCompletionChunkText( completion_string, chunk_number, ); } - _dart_clang_getCompletionChunkText? _clang_getCompletionChunkText; + late final _clang_getCompletionChunkText_ptr = + _lookup>( + 'clang_getCompletionChunkText'); + late final _dart_clang_getCompletionChunkText _clang_getCompletionChunkText = + _clang_getCompletionChunkText_ptr + .asFunction<_dart_clang_getCompletionChunkText>(); /// Retrieve the completion string associated with a particular chunk /// within a completion string. @@ -5155,32 +5608,35 @@ class LibClang { ffi.Pointer completion_string, int chunk_number, ) { - return (_clang_getCompletionChunkCompletionString ??= _lookup< - ffi.NativeFunction< - _c_clang_getCompletionChunkCompletionString>>( - 'clang_getCompletionChunkCompletionString') - .asFunction<_dart_clang_getCompletionChunkCompletionString>())( + return _clang_getCompletionChunkCompletionString( completion_string, chunk_number, ); } - _dart_clang_getCompletionChunkCompletionString? - _clang_getCompletionChunkCompletionString; + late final _clang_getCompletionChunkCompletionString_ptr = _lookup< + ffi.NativeFunction>( + 'clang_getCompletionChunkCompletionString'); + late final _dart_clang_getCompletionChunkCompletionString + _clang_getCompletionChunkCompletionString = + _clang_getCompletionChunkCompletionString_ptr + .asFunction<_dart_clang_getCompletionChunkCompletionString>(); /// Retrieve the number of chunks in the given code-completion string. int clang_getNumCompletionChunks( ffi.Pointer completion_string, ) { - return (_clang_getNumCompletionChunks ??= - _lookup>( - 'clang_getNumCompletionChunks') - .asFunction<_dart_clang_getNumCompletionChunks>())( + return _clang_getNumCompletionChunks( completion_string, ); } - _dart_clang_getNumCompletionChunks? _clang_getNumCompletionChunks; + late final _clang_getNumCompletionChunks_ptr = + _lookup>( + 'clang_getNumCompletionChunks'); + late final _dart_clang_getNumCompletionChunks _clang_getNumCompletionChunks = + _clang_getNumCompletionChunks_ptr + .asFunction<_dart_clang_getNumCompletionChunks>(); /// Determine the priority of this code completion. /// @@ -5195,15 +5651,17 @@ class LibClang { int clang_getCompletionPriority( ffi.Pointer completion_string, ) { - return (_clang_getCompletionPriority ??= - _lookup>( - 'clang_getCompletionPriority') - .asFunction<_dart_clang_getCompletionPriority>())( + return _clang_getCompletionPriority( completion_string, ); } - _dart_clang_getCompletionPriority? _clang_getCompletionPriority; + late final _clang_getCompletionPriority_ptr = + _lookup>( + 'clang_getCompletionPriority'); + late final _dart_clang_getCompletionPriority _clang_getCompletionPriority = + _clang_getCompletionPriority_ptr + .asFunction<_dart_clang_getCompletionPriority>(); /// Determine the availability of the entity that this code-completion /// string refers to. @@ -5214,15 +5672,17 @@ class LibClang { int clang_getCompletionAvailability( ffi.Pointer completion_string, ) { - return (_clang_getCompletionAvailability ??= - _lookup>( - 'clang_getCompletionAvailability') - .asFunction<_dart_clang_getCompletionAvailability>())( + return _clang_getCompletionAvailability( completion_string, ); } - _dart_clang_getCompletionAvailability? _clang_getCompletionAvailability; + late final _clang_getCompletionAvailability_ptr = + _lookup>( + 'clang_getCompletionAvailability'); + late final _dart_clang_getCompletionAvailability + _clang_getCompletionAvailability = _clang_getCompletionAvailability_ptr + .asFunction<_dart_clang_getCompletionAvailability>(); /// Retrieve the number of annotations associated with the given /// completion string. @@ -5234,15 +5694,18 @@ class LibClang { int clang_getCompletionNumAnnotations( ffi.Pointer completion_string, ) { - return (_clang_getCompletionNumAnnotations ??= - _lookup>( - 'clang_getCompletionNumAnnotations') - .asFunction<_dart_clang_getCompletionNumAnnotations>())( + return _clang_getCompletionNumAnnotations( completion_string, ); } - _dart_clang_getCompletionNumAnnotations? _clang_getCompletionNumAnnotations; + late final _clang_getCompletionNumAnnotations_ptr = + _lookup>( + 'clang_getCompletionNumAnnotations'); + late final _dart_clang_getCompletionNumAnnotations + _clang_getCompletionNumAnnotations = + _clang_getCompletionNumAnnotations_ptr + .asFunction<_dart_clang_getCompletionNumAnnotations>(); /// Retrieve the annotation associated with the given completion string. /// @@ -5257,16 +5720,18 @@ class LibClang { ffi.Pointer completion_string, int annotation_number, ) { - return (_clang_getCompletionAnnotation ??= - _lookup>( - 'clang_getCompletionAnnotation') - .asFunction<_dart_clang_getCompletionAnnotation>())( + return _clang_getCompletionAnnotation( completion_string, annotation_number, ); } - _dart_clang_getCompletionAnnotation? _clang_getCompletionAnnotation; + late final _clang_getCompletionAnnotation_ptr = + _lookup>( + 'clang_getCompletionAnnotation'); + late final _dart_clang_getCompletionAnnotation + _clang_getCompletionAnnotation = _clang_getCompletionAnnotation_ptr + .asFunction<_dart_clang_getCompletionAnnotation>(); /// Retrieve the parent context of the given completion string. /// @@ -5286,31 +5751,35 @@ class LibClang { ffi.Pointer completion_string, ffi.Pointer kind, ) { - return (_clang_getCompletionParent ??= - _lookup>( - 'clang_getCompletionParent') - .asFunction<_dart_clang_getCompletionParent>())( + return _clang_getCompletionParent( completion_string, kind, ); } - _dart_clang_getCompletionParent? _clang_getCompletionParent; + late final _clang_getCompletionParent_ptr = + _lookup>( + 'clang_getCompletionParent'); + late final _dart_clang_getCompletionParent _clang_getCompletionParent = + _clang_getCompletionParent_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_getCompletionBriefComment') - .asFunction<_dart_clang_getCompletionBriefComment>())( + return _clang_getCompletionBriefComment( completion_string, ); } - _dart_clang_getCompletionBriefComment? _clang_getCompletionBriefComment; + late final _clang_getCompletionBriefComment_ptr = + _lookup>( + 'clang_getCompletionBriefComment'); + late final _dart_clang_getCompletionBriefComment + _clang_getCompletionBriefComment = _clang_getCompletionBriefComment_ptr + .asFunction<_dart_clang_getCompletionBriefComment>(); /// Retrieve a completion string for an arbitrary declaration or macro /// definition cursor. @@ -5322,15 +5791,17 @@ class LibClang { ffi.Pointer clang_getCursorCompletionString( CXCursor cursor, ) { - return (_clang_getCursorCompletionString ??= - _lookup>( - 'clang_getCursorCompletionString') - .asFunction<_dart_clang_getCursorCompletionString>())( + return _clang_getCursorCompletionString( cursor, ); } - _dart_clang_getCursorCompletionString? _clang_getCursorCompletionString; + late final _clang_getCursorCompletionString_ptr = + _lookup>( + 'clang_getCursorCompletionString'); + late final _dart_clang_getCursorCompletionString + _clang_getCursorCompletionString = _clang_getCursorCompletionString_ptr + .asFunction<_dart_clang_getCursorCompletionString>(); /// Retrieve the number of fix-its for the given completion index. /// @@ -5347,16 +5818,18 @@ class LibClang { ffi.Pointer results, int completion_index, ) { - return (_clang_getCompletionNumFixIts ??= - _lookup>( - 'clang_getCompletionNumFixIts') - .asFunction<_dart_clang_getCompletionNumFixIts>())( + return _clang_getCompletionNumFixIts( results, completion_index, ); } - _dart_clang_getCompletionNumFixIts? _clang_getCompletionNumFixIts; + late final _clang_getCompletionNumFixIts_ptr = + _lookup>( + 'clang_getCompletionNumFixIts'); + late final _dart_clang_getCompletionNumFixIts _clang_getCompletionNumFixIts = + _clang_getCompletionNumFixIts_ptr + .asFunction<_dart_clang_getCompletionNumFixIts>(); /// Fix-its that *must* be applied before inserting the text for the /// corresponding completion. @@ -5405,10 +5878,7 @@ class LibClang { int fixit_index, ffi.Pointer replacement_range, ) { - return (_clang_getCompletionFixIt ??= - _lookup>( - 'clang_getCompletionFixIt') - .asFunction<_dart_clang_getCompletionFixIt>())( + return _clang_getCompletionFixIt( results, completion_index, fixit_index, @@ -5416,18 +5886,25 @@ class LibClang { ); } - _dart_clang_getCompletionFixIt? _clang_getCompletionFixIt; + late final _clang_getCompletionFixIt_ptr = + _lookup>( + 'clang_getCompletionFixIt'); + late final _dart_clang_getCompletionFixIt _clang_getCompletionFixIt = + _clang_getCompletionFixIt_ptr + .asFunction<_dart_clang_getCompletionFixIt>(); /// Returns a default set of code-completion options that can be /// passed to\c clang_codeCompleteAt(). int clang_defaultCodeCompleteOptions() { - return (_clang_defaultCodeCompleteOptions ??= - _lookup>( - 'clang_defaultCodeCompleteOptions') - .asFunction<_dart_clang_defaultCodeCompleteOptions>())(); + return _clang_defaultCodeCompleteOptions(); } - _dart_clang_defaultCodeCompleteOptions? _clang_defaultCodeCompleteOptions; + late final _clang_defaultCodeCompleteOptions_ptr = + _lookup>( + 'clang_defaultCodeCompleteOptions'); + late final _dart_clang_defaultCodeCompleteOptions + _clang_defaultCodeCompleteOptions = _clang_defaultCodeCompleteOptions_ptr + .asFunction<_dart_clang_defaultCodeCompleteOptions>(); /// Perform code completion at a given location in a translation unit. /// @@ -5504,10 +5981,7 @@ class LibClang { int num_unsaved_files, int options, ) { - return (_clang_codeCompleteAt ??= - _lookup>( - 'clang_codeCompleteAt') - .asFunction<_dart_clang_codeCompleteAt>())( + return _clang_codeCompleteAt( TU, complete_filename, complete_line, @@ -5518,7 +5992,11 @@ class LibClang { ); } - _dart_clang_codeCompleteAt? _clang_codeCompleteAt; + late final _clang_codeCompleteAt_ptr = + _lookup>( + 'clang_codeCompleteAt'); + late final _dart_clang_codeCompleteAt _clang_codeCompleteAt = + _clang_codeCompleteAt_ptr.asFunction<_dart_clang_codeCompleteAt>(); /// Sort the code-completion results in case-insensitive alphabetical /// order. @@ -5529,46 +6007,52 @@ class LibClang { ffi.Pointer Results, int NumResults, ) { - return (_clang_sortCodeCompletionResults ??= - _lookup>( - 'clang_sortCodeCompletionResults') - .asFunction<_dart_clang_sortCodeCompletionResults>())( + return _clang_sortCodeCompletionResults( Results, NumResults, ); } - _dart_clang_sortCodeCompletionResults? _clang_sortCodeCompletionResults; + late final _clang_sortCodeCompletionResults_ptr = + _lookup>( + 'clang_sortCodeCompletionResults'); + late final _dart_clang_sortCodeCompletionResults + _clang_sortCodeCompletionResults = _clang_sortCodeCompletionResults_ptr + .asFunction<_dart_clang_sortCodeCompletionResults>(); /// Free the given set of code-completion results. void clang_disposeCodeCompleteResults( ffi.Pointer Results, ) { - return (_clang_disposeCodeCompleteResults ??= - _lookup>( - 'clang_disposeCodeCompleteResults') - .asFunction<_dart_clang_disposeCodeCompleteResults>())( + return _clang_disposeCodeCompleteResults( Results, ); } - _dart_clang_disposeCodeCompleteResults? _clang_disposeCodeCompleteResults; + late final _clang_disposeCodeCompleteResults_ptr = + _lookup>( + 'clang_disposeCodeCompleteResults'); + late final _dart_clang_disposeCodeCompleteResults + _clang_disposeCodeCompleteResults = _clang_disposeCodeCompleteResults_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_codeCompleteGetNumDiagnostics') - .asFunction<_dart_clang_codeCompleteGetNumDiagnostics>())( + return _clang_codeCompleteGetNumDiagnostics( Results, ); } - _dart_clang_codeCompleteGetNumDiagnostics? - _clang_codeCompleteGetNumDiagnostics; + late final _clang_codeCompleteGetNumDiagnostics_ptr = + _lookup>( + 'clang_codeCompleteGetNumDiagnostics'); + late final _dart_clang_codeCompleteGetNumDiagnostics + _clang_codeCompleteGetNumDiagnostics = + _clang_codeCompleteGetNumDiagnostics_ptr + .asFunction<_dart_clang_codeCompleteGetNumDiagnostics>(); /// Retrieve a diagnostic associated with the given code completion. /// @@ -5581,16 +6065,18 @@ class LibClang { ffi.Pointer Results, int Index, ) { - return (_clang_codeCompleteGetDiagnostic ??= - _lookup>( - 'clang_codeCompleteGetDiagnostic') - .asFunction<_dart_clang_codeCompleteGetDiagnostic>())( + return _clang_codeCompleteGetDiagnostic( Results, Index, ); } - _dart_clang_codeCompleteGetDiagnostic? _clang_codeCompleteGetDiagnostic; + late final _clang_codeCompleteGetDiagnostic_ptr = + _lookup>( + 'clang_codeCompleteGetDiagnostic'); + late final _dart_clang_codeCompleteGetDiagnostic + _clang_codeCompleteGetDiagnostic = _clang_codeCompleteGetDiagnostic_ptr + .asFunction<_dart_clang_codeCompleteGetDiagnostic>(); /// Determines what completions are appropriate for the context /// the given code completion. @@ -5602,15 +6088,17 @@ class LibClang { int clang_codeCompleteGetContexts( ffi.Pointer Results, ) { - return (_clang_codeCompleteGetContexts ??= - _lookup>( - 'clang_codeCompleteGetContexts') - .asFunction<_dart_clang_codeCompleteGetContexts>())( + return _clang_codeCompleteGetContexts( Results, ); } - _dart_clang_codeCompleteGetContexts? _clang_codeCompleteGetContexts; + late final _clang_codeCompleteGetContexts_ptr = + _lookup>( + 'clang_codeCompleteGetContexts'); + late final _dart_clang_codeCompleteGetContexts + _clang_codeCompleteGetContexts = _clang_codeCompleteGetContexts_ptr + .asFunction<_dart_clang_codeCompleteGetContexts>(); /// Returns the cursor kind for the container for the current code /// completion context. The container is only guaranteed to be set for @@ -5630,16 +6118,19 @@ class LibClang { ffi.Pointer Results, ffi.Pointer IsIncomplete, ) { - return (_clang_codeCompleteGetContainerKind ??= - _lookup>( - 'clang_codeCompleteGetContainerKind') - .asFunction<_dart_clang_codeCompleteGetContainerKind>())( + return _clang_codeCompleteGetContainerKind( Results, IsIncomplete, ); } - _dart_clang_codeCompleteGetContainerKind? _clang_codeCompleteGetContainerKind; + late final _clang_codeCompleteGetContainerKind_ptr = + _lookup>( + 'clang_codeCompleteGetContainerKind'); + late final _dart_clang_codeCompleteGetContainerKind + _clang_codeCompleteGetContainerKind = + _clang_codeCompleteGetContainerKind_ptr + .asFunction<_dart_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 @@ -5651,15 +6142,18 @@ class LibClang { CXString clang_codeCompleteGetContainerUSR( ffi.Pointer Results, ) { - return (_clang_codeCompleteGetContainerUSR ??= - _lookup>( - 'clang_codeCompleteGetContainerUSR') - .asFunction<_dart_clang_codeCompleteGetContainerUSR>())( + return _clang_codeCompleteGetContainerUSR( Results, ); } - _dart_clang_codeCompleteGetContainerUSR? _clang_codeCompleteGetContainerUSR; + late final _clang_codeCompleteGetContainerUSR_ptr = + _lookup>( + 'clang_codeCompleteGetContainerUSR'); + late final _dart_clang_codeCompleteGetContainerUSR + _clang_codeCompleteGetContainerUSR = + _clang_codeCompleteGetContainerUSR_ptr + .asFunction<_dart_clang_codeCompleteGetContainerUSR>(); /// Returns the currently-entered selector for an Objective-C message /// send, formatted like "initWithFoo:bar:". Only guaranteed to return a @@ -5673,26 +6167,30 @@ class LibClang { CXString clang_codeCompleteGetObjCSelector( ffi.Pointer Results, ) { - return (_clang_codeCompleteGetObjCSelector ??= - _lookup>( - 'clang_codeCompleteGetObjCSelector') - .asFunction<_dart_clang_codeCompleteGetObjCSelector>())( + return _clang_codeCompleteGetObjCSelector( Results, ); } - _dart_clang_codeCompleteGetObjCSelector? _clang_codeCompleteGetObjCSelector; + late final _clang_codeCompleteGetObjCSelector_ptr = + _lookup>( + 'clang_codeCompleteGetObjCSelector'); + late final _dart_clang_codeCompleteGetObjCSelector + _clang_codeCompleteGetObjCSelector = + _clang_codeCompleteGetObjCSelector_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_getClangVersion') - .asFunction<_dart_clang_getClangVersion>())(); + return _clang_getClangVersion(); } - _dart_clang_getClangVersion? _clang_getClangVersion; + late final _clang_getClangVersion_ptr = + _lookup>( + 'clang_getClangVersion'); + late final _dart_clang_getClangVersion _clang_getClangVersion = + _clang_getClangVersion_ptr.asFunction<_dart_clang_getClangVersion>(); /// Enable/disable crash recovery. /// @@ -5701,15 +6199,17 @@ class LibClang { void clang_toggleCrashRecovery( int isEnabled, ) { - return (_clang_toggleCrashRecovery ??= - _lookup>( - 'clang_toggleCrashRecovery') - .asFunction<_dart_clang_toggleCrashRecovery>())( + return _clang_toggleCrashRecovery( isEnabled, ); } - _dart_clang_toggleCrashRecovery? _clang_toggleCrashRecovery; + late final _clang_toggleCrashRecovery_ptr = + _lookup>( + 'clang_toggleCrashRecovery'); + late final _dart_clang_toggleCrashRecovery _clang_toggleCrashRecovery = + _clang_toggleCrashRecovery_ptr + .asFunction<_dart_clang_toggleCrashRecovery>(); /// Visit the set of preprocessor inclusions in a translation unit. /// The visitor function is called with the provided data for every included @@ -5720,17 +6220,18 @@ class LibClang { ffi.Pointer> visitor, ffi.Pointer client_data, ) { - return (_clang_getInclusions ??= - _lookup>( - 'clang_getInclusions') - .asFunction<_dart_clang_getInclusions>())( + return _clang_getInclusions( tu, visitor, client_data, ); } - _dart_clang_getInclusions? _clang_getInclusions; + late final _clang_getInclusions_ptr = + _lookup>( + 'clang_getInclusions'); + late final _dart_clang_getInclusions _clang_getInclusions = + _clang_getInclusions_ptr.asFunction<_dart_clang_getInclusions>(); /// If cursor is a statement declaration tries to evaluate the /// statement and if its variable, tries to evaluate its initializer, @@ -5738,44 +6239,49 @@ class LibClang { ffi.Pointer clang_Cursor_Evaluate( CXCursor C, ) { - return (_clang_Cursor_Evaluate ??= - _lookup>( - 'clang_Cursor_Evaluate') - .asFunction<_dart_clang_Cursor_Evaluate>())( + return _clang_Cursor_Evaluate( C, ); } - _dart_clang_Cursor_Evaluate? _clang_Cursor_Evaluate; + late final _clang_Cursor_Evaluate_ptr = + _lookup>( + 'clang_Cursor_Evaluate'); + late final _dart_clang_Cursor_Evaluate _clang_Cursor_Evaluate = + _clang_Cursor_Evaluate_ptr.asFunction<_dart_clang_Cursor_Evaluate>(); /// Returns the kind of the evaluated result. int clang_EvalResult_getKind( ffi.Pointer E, ) { - return (_clang_EvalResult_getKind ??= - _lookup>( - 'clang_EvalResult_getKind') - .asFunction<_dart_clang_EvalResult_getKind>())( + return _clang_EvalResult_getKind( E, ); } - _dart_clang_EvalResult_getKind? _clang_EvalResult_getKind; + late final _clang_EvalResult_getKind_ptr = + _lookup>( + 'clang_EvalResult_getKind'); + late final _dart_clang_EvalResult_getKind _clang_EvalResult_getKind = + _clang_EvalResult_getKind_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_EvalResult_getAsInt') - .asFunction<_dart_clang_EvalResult_getAsInt>())( + return _clang_EvalResult_getAsInt( E, ); } - _dart_clang_EvalResult_getAsInt? _clang_EvalResult_getAsInt; + late final _clang_EvalResult_getAsInt_ptr = + _lookup>( + 'clang_EvalResult_getAsInt'); + late final _dart_clang_EvalResult_getAsInt _clang_EvalResult_getAsInt = + _clang_EvalResult_getAsInt_ptr + .asFunction<_dart_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 @@ -5783,60 +6289,68 @@ class LibClang { int clang_EvalResult_getAsLongLong( ffi.Pointer E, ) { - return (_clang_EvalResult_getAsLongLong ??= - _lookup>( - 'clang_EvalResult_getAsLongLong') - .asFunction<_dart_clang_EvalResult_getAsLongLong>())( + return _clang_EvalResult_getAsLongLong( E, ); } - _dart_clang_EvalResult_getAsLongLong? _clang_EvalResult_getAsLongLong; + late final _clang_EvalResult_getAsLongLong_ptr = + _lookup>( + 'clang_EvalResult_getAsLongLong'); + late final _dart_clang_EvalResult_getAsLongLong + _clang_EvalResult_getAsLongLong = _clang_EvalResult_getAsLongLong_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_EvalResult_isUnsignedInt') - .asFunction<_dart_clang_EvalResult_isUnsignedInt>())( + return _clang_EvalResult_isUnsignedInt( E, ); } - _dart_clang_EvalResult_isUnsignedInt? _clang_EvalResult_isUnsignedInt; + late final _clang_EvalResult_isUnsignedInt_ptr = + _lookup>( + 'clang_EvalResult_isUnsignedInt'); + late final _dart_clang_EvalResult_isUnsignedInt + _clang_EvalResult_isUnsignedInt = _clang_EvalResult_isUnsignedInt_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_EvalResult_getAsUnsigned') - .asFunction<_dart_clang_EvalResult_getAsUnsigned>())( + return _clang_EvalResult_getAsUnsigned( E, ); } - _dart_clang_EvalResult_getAsUnsigned? _clang_EvalResult_getAsUnsigned; + late final _clang_EvalResult_getAsUnsigned_ptr = + _lookup>( + 'clang_EvalResult_getAsUnsigned'); + late final _dart_clang_EvalResult_getAsUnsigned + _clang_EvalResult_getAsUnsigned = _clang_EvalResult_getAsUnsigned_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_EvalResult_getAsDouble') - .asFunction<_dart_clang_EvalResult_getAsDouble>())( + return _clang_EvalResult_getAsDouble( E, ); } - _dart_clang_EvalResult_getAsDouble? _clang_EvalResult_getAsDouble; + late final _clang_EvalResult_getAsDouble_ptr = + _lookup>( + 'clang_EvalResult_getAsDouble'); + late final _dart_clang_EvalResult_getAsDouble _clang_EvalResult_getAsDouble = + _clang_EvalResult_getAsDouble_ptr + .asFunction<_dart_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, @@ -5845,29 +6359,33 @@ class LibClang { ffi.Pointer clang_EvalResult_getAsStr( ffi.Pointer E, ) { - return (_clang_EvalResult_getAsStr ??= - _lookup>( - 'clang_EvalResult_getAsStr') - .asFunction<_dart_clang_EvalResult_getAsStr>())( + return _clang_EvalResult_getAsStr( E, ); } - _dart_clang_EvalResult_getAsStr? _clang_EvalResult_getAsStr; + late final _clang_EvalResult_getAsStr_ptr = + _lookup>( + 'clang_EvalResult_getAsStr'); + late final _dart_clang_EvalResult_getAsStr _clang_EvalResult_getAsStr = + _clang_EvalResult_getAsStr_ptr + .asFunction<_dart_clang_EvalResult_getAsStr>(); /// Disposes the created Eval memory. void clang_EvalResult_dispose( ffi.Pointer E, ) { - return (_clang_EvalResult_dispose ??= - _lookup>( - 'clang_EvalResult_dispose') - .asFunction<_dart_clang_EvalResult_dispose>())( + return _clang_EvalResult_dispose( E, ); } - _dart_clang_EvalResult_dispose? _clang_EvalResult_dispose; + late final _clang_EvalResult_dispose_ptr = + _lookup>( + 'clang_EvalResult_dispose'); + late final _dart_clang_EvalResult_dispose _clang_EvalResult_dispose = + _clang_EvalResult_dispose_ptr + .asFunction<_dart_clang_EvalResult_dispose>(); /// Retrieve a remapping. /// @@ -5878,15 +6396,16 @@ class LibClang { ffi.Pointer clang_getRemappings( ffi.Pointer path, ) { - return (_clang_getRemappings ??= - _lookup>( - 'clang_getRemappings') - .asFunction<_dart_clang_getRemappings>())( + return _clang_getRemappings( path, ); } - _dart_clang_getRemappings? _clang_getRemappings; + late final _clang_getRemappings_ptr = + _lookup>( + 'clang_getRemappings'); + late final _dart_clang_getRemappings _clang_getRemappings = + _clang_getRemappings_ptr.asFunction<_dart_clang_getRemappings>(); /// Retrieve a remapping. /// @@ -5900,30 +6419,33 @@ class LibClang { ffi.Pointer> filePaths, int numFiles, ) { - return (_clang_getRemappingsFromFileList ??= - _lookup>( - 'clang_getRemappingsFromFileList') - .asFunction<_dart_clang_getRemappingsFromFileList>())( + return _clang_getRemappingsFromFileList( filePaths, numFiles, ); } - _dart_clang_getRemappingsFromFileList? _clang_getRemappingsFromFileList; + late final _clang_getRemappingsFromFileList_ptr = + _lookup>( + 'clang_getRemappingsFromFileList'); + late final _dart_clang_getRemappingsFromFileList + _clang_getRemappingsFromFileList = _clang_getRemappingsFromFileList_ptr + .asFunction<_dart_clang_getRemappingsFromFileList>(); /// Determine the number of remappings. int clang_remap_getNumFiles( ffi.Pointer arg0, ) { - return (_clang_remap_getNumFiles ??= - _lookup>( - 'clang_remap_getNumFiles') - .asFunction<_dart_clang_remap_getNumFiles>())( + return _clang_remap_getNumFiles( arg0, ); } - _dart_clang_remap_getNumFiles? _clang_remap_getNumFiles; + late final _clang_remap_getNumFiles_ptr = + _lookup>( + 'clang_remap_getNumFiles'); + late final _dart_clang_remap_getNumFiles _clang_remap_getNumFiles = + _clang_remap_getNumFiles_ptr.asFunction<_dart_clang_remap_getNumFiles>(); /// Get the original and the associated filename from the remapping. /// @@ -5937,10 +6459,7 @@ class LibClang { ffi.Pointer original, ffi.Pointer transformed, ) { - return (_clang_remap_getFilenames ??= - _lookup>( - 'clang_remap_getFilenames') - .asFunction<_dart_clang_remap_getFilenames>())( + return _clang_remap_getFilenames( arg0, index, original, @@ -5948,21 +6467,27 @@ class LibClang { ); } - _dart_clang_remap_getFilenames? _clang_remap_getFilenames; + late final _clang_remap_getFilenames_ptr = + _lookup>( + 'clang_remap_getFilenames'); + late final _dart_clang_remap_getFilenames _clang_remap_getFilenames = + _clang_remap_getFilenames_ptr + .asFunction<_dart_clang_remap_getFilenames>(); /// Dispose the remapping. void clang_remap_dispose( ffi.Pointer arg0, ) { - return (_clang_remap_dispose ??= - _lookup>( - 'clang_remap_dispose') - .asFunction<_dart_clang_remap_dispose>())( + return _clang_remap_dispose( arg0, ); } - _dart_clang_remap_dispose? _clang_remap_dispose; + late final _clang_remap_dispose_ptr = + _lookup>( + 'clang_remap_dispose'); + late final _dart_clang_remap_dispose _clang_remap_dispose = + _clang_remap_dispose_ptr.asFunction<_dart_clang_remap_dispose>(); /// Find references of a declaration in a specific file. /// @@ -5981,17 +6506,19 @@ class LibClang { ffi.Pointer file, CXCursorAndRangeVisitor visitor, ) { - return (_clang_findReferencesInFile ??= - _lookup>( - 'clang_findReferencesInFile') - .asFunction<_dart_clang_findReferencesInFile>())( + return _clang_findReferencesInFile( cursor, file, visitor, ); } - _dart_clang_findReferencesInFile? _clang_findReferencesInFile; + late final _clang_findReferencesInFile_ptr = + _lookup>( + 'clang_findReferencesInFile'); + late final _dart_clang_findReferencesInFile _clang_findReferencesInFile = + _clang_findReferencesInFile_ptr + .asFunction<_dart_clang_findReferencesInFile>(); /// Find #import/#include directives in a specific file. /// @@ -6008,146 +6535,165 @@ class LibClang { ffi.Pointer file, CXCursorAndRangeVisitor visitor, ) { - return (_clang_findIncludesInFile ??= - _lookup>( - 'clang_findIncludesInFile') - .asFunction<_dart_clang_findIncludesInFile>())( + return _clang_findIncludesInFile( TU, file, visitor, ); } - _dart_clang_findIncludesInFile? _clang_findIncludesInFile; + late final _clang_findIncludesInFile_ptr = + _lookup>( + 'clang_findIncludesInFile'); + late final _dart_clang_findIncludesInFile _clang_findIncludesInFile = + _clang_findIncludesInFile_ptr + .asFunction<_dart_clang_findIncludesInFile>(); int clang_index_isEntityObjCContainerKind( int arg0, ) { - return (_clang_index_isEntityObjCContainerKind ??= - _lookup>( - 'clang_index_isEntityObjCContainerKind') - .asFunction<_dart_clang_index_isEntityObjCContainerKind>())( + return _clang_index_isEntityObjCContainerKind( arg0, ); } - _dart_clang_index_isEntityObjCContainerKind? - _clang_index_isEntityObjCContainerKind; + late final _clang_index_isEntityObjCContainerKind_ptr = + _lookup>( + 'clang_index_isEntityObjCContainerKind'); + late final _dart_clang_index_isEntityObjCContainerKind + _clang_index_isEntityObjCContainerKind = + _clang_index_isEntityObjCContainerKind_ptr + .asFunction<_dart_clang_index_isEntityObjCContainerKind>(); ffi.Pointer clang_index_getObjCContainerDeclInfo( ffi.Pointer arg0, ) { - return (_clang_index_getObjCContainerDeclInfo ??= - _lookup>( - 'clang_index_getObjCContainerDeclInfo') - .asFunction<_dart_clang_index_getObjCContainerDeclInfo>())( + return _clang_index_getObjCContainerDeclInfo( arg0, ); } - _dart_clang_index_getObjCContainerDeclInfo? - _clang_index_getObjCContainerDeclInfo; + late final _clang_index_getObjCContainerDeclInfo_ptr = + _lookup>( + 'clang_index_getObjCContainerDeclInfo'); + late final _dart_clang_index_getObjCContainerDeclInfo + _clang_index_getObjCContainerDeclInfo = + _clang_index_getObjCContainerDeclInfo_ptr + .asFunction<_dart_clang_index_getObjCContainerDeclInfo>(); ffi.Pointer clang_index_getObjCInterfaceDeclInfo( ffi.Pointer arg0, ) { - return (_clang_index_getObjCInterfaceDeclInfo ??= - _lookup>( - 'clang_index_getObjCInterfaceDeclInfo') - .asFunction<_dart_clang_index_getObjCInterfaceDeclInfo>())( + return _clang_index_getObjCInterfaceDeclInfo( arg0, ); } - _dart_clang_index_getObjCInterfaceDeclInfo? - _clang_index_getObjCInterfaceDeclInfo; + late final _clang_index_getObjCInterfaceDeclInfo_ptr = + _lookup>( + 'clang_index_getObjCInterfaceDeclInfo'); + late final _dart_clang_index_getObjCInterfaceDeclInfo + _clang_index_getObjCInterfaceDeclInfo = + _clang_index_getObjCInterfaceDeclInfo_ptr + .asFunction<_dart_clang_index_getObjCInterfaceDeclInfo>(); ffi.Pointer clang_index_getObjCCategoryDeclInfo( ffi.Pointer arg0, ) { - return (_clang_index_getObjCCategoryDeclInfo ??= - _lookup>( - 'clang_index_getObjCCategoryDeclInfo') - .asFunction<_dart_clang_index_getObjCCategoryDeclInfo>())( + return _clang_index_getObjCCategoryDeclInfo( arg0, ); } - _dart_clang_index_getObjCCategoryDeclInfo? - _clang_index_getObjCCategoryDeclInfo; + late final _clang_index_getObjCCategoryDeclInfo_ptr = + _lookup>( + 'clang_index_getObjCCategoryDeclInfo'); + late final _dart_clang_index_getObjCCategoryDeclInfo + _clang_index_getObjCCategoryDeclInfo = + _clang_index_getObjCCategoryDeclInfo_ptr + .asFunction<_dart_clang_index_getObjCCategoryDeclInfo>(); ffi.Pointer clang_index_getObjCProtocolRefListInfo( ffi.Pointer arg0, ) { - return (_clang_index_getObjCProtocolRefListInfo ??= - _lookup>( - 'clang_index_getObjCProtocolRefListInfo') - .asFunction<_dart_clang_index_getObjCProtocolRefListInfo>())( + return _clang_index_getObjCProtocolRefListInfo( arg0, ); } - _dart_clang_index_getObjCProtocolRefListInfo? - _clang_index_getObjCProtocolRefListInfo; + late final _clang_index_getObjCProtocolRefListInfo_ptr = _lookup< + ffi.NativeFunction>( + 'clang_index_getObjCProtocolRefListInfo'); + late final _dart_clang_index_getObjCProtocolRefListInfo + _clang_index_getObjCProtocolRefListInfo = + _clang_index_getObjCProtocolRefListInfo_ptr + .asFunction<_dart_clang_index_getObjCProtocolRefListInfo>(); ffi.Pointer clang_index_getObjCPropertyDeclInfo( ffi.Pointer arg0, ) { - return (_clang_index_getObjCPropertyDeclInfo ??= - _lookup>( - 'clang_index_getObjCPropertyDeclInfo') - .asFunction<_dart_clang_index_getObjCPropertyDeclInfo>())( + return _clang_index_getObjCPropertyDeclInfo( arg0, ); } - _dart_clang_index_getObjCPropertyDeclInfo? - _clang_index_getObjCPropertyDeclInfo; + late final _clang_index_getObjCPropertyDeclInfo_ptr = + _lookup>( + 'clang_index_getObjCPropertyDeclInfo'); + late final _dart_clang_index_getObjCPropertyDeclInfo + _clang_index_getObjCPropertyDeclInfo = + _clang_index_getObjCPropertyDeclInfo_ptr + .asFunction<_dart_clang_index_getObjCPropertyDeclInfo>(); ffi.Pointer clang_index_getIBOutletCollectionAttrInfo( ffi.Pointer arg0, ) { - return (_clang_index_getIBOutletCollectionAttrInfo ??= _lookup< - ffi.NativeFunction< - _c_clang_index_getIBOutletCollectionAttrInfo>>( - 'clang_index_getIBOutletCollectionAttrInfo') - .asFunction<_dart_clang_index_getIBOutletCollectionAttrInfo>())( + return _clang_index_getIBOutletCollectionAttrInfo( arg0, ); } - _dart_clang_index_getIBOutletCollectionAttrInfo? - _clang_index_getIBOutletCollectionAttrInfo; + late final _clang_index_getIBOutletCollectionAttrInfo_ptr = _lookup< + ffi.NativeFunction>( + 'clang_index_getIBOutletCollectionAttrInfo'); + late final _dart_clang_index_getIBOutletCollectionAttrInfo + _clang_index_getIBOutletCollectionAttrInfo = + _clang_index_getIBOutletCollectionAttrInfo_ptr + .asFunction<_dart_clang_index_getIBOutletCollectionAttrInfo>(); ffi.Pointer clang_index_getCXXClassDeclInfo( ffi.Pointer arg0, ) { - return (_clang_index_getCXXClassDeclInfo ??= - _lookup>( - 'clang_index_getCXXClassDeclInfo') - .asFunction<_dart_clang_index_getCXXClassDeclInfo>())( + return _clang_index_getCXXClassDeclInfo( arg0, ); } - _dart_clang_index_getCXXClassDeclInfo? _clang_index_getCXXClassDeclInfo; + late final _clang_index_getCXXClassDeclInfo_ptr = + _lookup>( + 'clang_index_getCXXClassDeclInfo'); + late final _dart_clang_index_getCXXClassDeclInfo + _clang_index_getCXXClassDeclInfo = _clang_index_getCXXClassDeclInfo_ptr + .asFunction<_dart_clang_index_getCXXClassDeclInfo>(); /// For retrieving a custom CXIdxClientContainer attached to a /// container. ffi.Pointer clang_index_getClientContainer( ffi.Pointer arg0, ) { - return (_clang_index_getClientContainer ??= - _lookup>( - 'clang_index_getClientContainer') - .asFunction<_dart_clang_index_getClientContainer>())( + return _clang_index_getClientContainer( arg0, ); } - _dart_clang_index_getClientContainer? _clang_index_getClientContainer; + late final _clang_index_getClientContainer_ptr = + _lookup>( + 'clang_index_getClientContainer'); + late final _dart_clang_index_getClientContainer + _clang_index_getClientContainer = _clang_index_getClientContainer_ptr + .asFunction<_dart_clang_index_getClientContainer>(); /// For setting a custom CXIdxClientContainer attached to a /// container. @@ -6155,46 +6701,52 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer arg1, ) { - return (_clang_index_setClientContainer ??= - _lookup>( - 'clang_index_setClientContainer') - .asFunction<_dart_clang_index_setClientContainer>())( + return _clang_index_setClientContainer( arg0, arg1, ); } - _dart_clang_index_setClientContainer? _clang_index_setClientContainer; + late final _clang_index_setClientContainer_ptr = + _lookup>( + 'clang_index_setClientContainer'); + late final _dart_clang_index_setClientContainer + _clang_index_setClientContainer = _clang_index_setClientContainer_ptr + .asFunction<_dart_clang_index_setClientContainer>(); /// For retrieving a custom CXIdxClientEntity attached to an entity. ffi.Pointer clang_index_getClientEntity( ffi.Pointer arg0, ) { - return (_clang_index_getClientEntity ??= - _lookup>( - 'clang_index_getClientEntity') - .asFunction<_dart_clang_index_getClientEntity>())( + return _clang_index_getClientEntity( arg0, ); } - _dart_clang_index_getClientEntity? _clang_index_getClientEntity; + late final _clang_index_getClientEntity_ptr = + _lookup>( + 'clang_index_getClientEntity'); + late final _dart_clang_index_getClientEntity _clang_index_getClientEntity = + _clang_index_getClientEntity_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_index_setClientEntity') - .asFunction<_dart_clang_index_setClientEntity>())( + return _clang_index_setClientEntity( arg0, arg1, ); } - _dart_clang_index_setClientEntity? _clang_index_setClientEntity; + late final _clang_index_setClientEntity_ptr = + _lookup>( + 'clang_index_setClientEntity'); + late final _dart_clang_index_setClientEntity _clang_index_setClientEntity = + _clang_index_setClientEntity_ptr + .asFunction<_dart_clang_index_setClientEntity>(); /// An indexing action/session, to be applied to one or multiple /// translation units. @@ -6203,15 +6755,17 @@ class LibClang { ffi.Pointer clang_IndexAction_create( ffi.Pointer CIdx, ) { - return (_clang_IndexAction_create ??= - _lookup>( - 'clang_IndexAction_create') - .asFunction<_dart_clang_IndexAction_create>())( + return _clang_IndexAction_create( CIdx, ); } - _dart_clang_IndexAction_create? _clang_IndexAction_create; + late final _clang_IndexAction_create_ptr = + _lookup>( + 'clang_IndexAction_create'); + late final _dart_clang_IndexAction_create _clang_IndexAction_create = + _clang_IndexAction_create_ptr + .asFunction<_dart_clang_IndexAction_create>(); /// Destroy the given index action. /// @@ -6220,15 +6774,17 @@ class LibClang { void clang_IndexAction_dispose( ffi.Pointer arg0, ) { - return (_clang_IndexAction_dispose ??= - _lookup>( - 'clang_IndexAction_dispose') - .asFunction<_dart_clang_IndexAction_dispose>())( + return _clang_IndexAction_dispose( arg0, ); } - _dart_clang_IndexAction_dispose? _clang_IndexAction_dispose; + late final _clang_IndexAction_dispose_ptr = + _lookup>( + 'clang_IndexAction_dispose'); + late final _dart_clang_IndexAction_dispose _clang_IndexAction_dispose = + _clang_IndexAction_dispose_ptr + .asFunction<_dart_clang_IndexAction_dispose>(); /// Index the given source file and the translation unit corresponding /// to that file via callbacks implemented through #IndexerCallbacks. @@ -6267,10 +6823,7 @@ class LibClang { ffi.Pointer> out_TU, int TU_options, ) { - return (_clang_indexSourceFile ??= - _lookup>( - 'clang_indexSourceFile') - .asFunction<_dart_clang_indexSourceFile>())( + return _clang_indexSourceFile( arg0, client_data, index_callbacks, @@ -6286,7 +6839,11 @@ class LibClang { ); } - _dart_clang_indexSourceFile? _clang_indexSourceFile; + late final _clang_indexSourceFile_ptr = + _lookup>( + 'clang_indexSourceFile'); + late final _dart_clang_indexSourceFile _clang_indexSourceFile = + _clang_indexSourceFile_ptr.asFunction<_dart_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 @@ -6305,10 +6862,7 @@ class LibClang { ffi.Pointer> out_TU, int TU_options, ) { - return (_clang_indexSourceFileFullArgv ??= - _lookup>( - 'clang_indexSourceFileFullArgv') - .asFunction<_dart_clang_indexSourceFileFullArgv>())( + return _clang_indexSourceFileFullArgv( arg0, client_data, index_callbacks, @@ -6324,7 +6878,12 @@ class LibClang { ); } - _dart_clang_indexSourceFileFullArgv? _clang_indexSourceFileFullArgv; + late final _clang_indexSourceFileFullArgv_ptr = + _lookup>( + 'clang_indexSourceFileFullArgv'); + late final _dart_clang_indexSourceFileFullArgv + _clang_indexSourceFileFullArgv = _clang_indexSourceFileFullArgv_ptr + .asFunction<_dart_clang_indexSourceFileFullArgv>(); /// Index the given translation unit via callbacks implemented through /// #IndexerCallbacks. @@ -6348,10 +6907,7 @@ class LibClang { int index_options, ffi.Pointer arg5, ) { - return (_clang_indexTranslationUnit ??= - _lookup>( - 'clang_indexTranslationUnit') - .asFunction<_dart_clang_indexTranslationUnit>())( + return _clang_indexTranslationUnit( arg0, client_data, index_callbacks, @@ -6361,7 +6917,12 @@ class LibClang { ); } - _dart_clang_indexTranslationUnit? _clang_indexTranslationUnit; + late final _clang_indexTranslationUnit_ptr = + _lookup>( + 'clang_indexTranslationUnit'); + late final _dart_clang_indexTranslationUnit _clang_indexTranslationUnit = + _clang_indexTranslationUnit_ptr + .asFunction<_dart_clang_indexTranslationUnit>(); /// Retrieve the CXIdxFile, file, line, column, and offset represented by /// the given CXIdxLoc. @@ -6377,10 +6938,7 @@ class LibClang { ffi.Pointer column, ffi.Pointer offset, ) { - return (_clang_indexLoc_getFileLocation ??= - _lookup>( - 'clang_indexLoc_getFileLocation') - .asFunction<_dart_clang_indexLoc_getFileLocation>())( + return _clang_indexLoc_getFileLocation( loc, indexFile, file, @@ -6390,21 +6948,29 @@ class LibClang { ); } - _dart_clang_indexLoc_getFileLocation? _clang_indexLoc_getFileLocation; + late final _clang_indexLoc_getFileLocation_ptr = + _lookup>( + 'clang_indexLoc_getFileLocation'); + late final _dart_clang_indexLoc_getFileLocation + _clang_indexLoc_getFileLocation = _clang_indexLoc_getFileLocation_ptr + .asFunction<_dart_clang_indexLoc_getFileLocation>(); /// Retrieve the CXSourceLocation represented by the given CXIdxLoc. CXSourceLocation clang_indexLoc_getCXSourceLocation( CXIdxLoc loc, ) { - return (_clang_indexLoc_getCXSourceLocation ??= - _lookup>( - 'clang_indexLoc_getCXSourceLocation') - .asFunction<_dart_clang_indexLoc_getCXSourceLocation>())( + return _clang_indexLoc_getCXSourceLocation( loc, ); } - _dart_clang_indexLoc_getCXSourceLocation? _clang_indexLoc_getCXSourceLocation; + late final _clang_indexLoc_getCXSourceLocation_ptr = + _lookup>( + 'clang_indexLoc_getCXSourceLocation'); + late final _dart_clang_indexLoc_getCXSourceLocation + _clang_indexLoc_getCXSourceLocation = + _clang_indexLoc_getCXSourceLocation_ptr + .asFunction<_dart_clang_indexLoc_getCXSourceLocation>(); /// Visit the fields of a particular type. /// @@ -6428,17 +6994,849 @@ class LibClang { ffi.Pointer> visitor, ffi.Pointer client_data, ) { - return (_clang_Type_visitFields ??= - _lookup>( - 'clang_Type_visitFields') - .asFunction<_dart_clang_Type_visitFields>())( + return _clang_Type_visitFields( T, visitor, client_data, ); } - _dart_clang_Type_visitFields? _clang_Type_visitFields; + late final _clang_Type_visitFields_ptr = + _lookup>( + 'clang_Type_visitFields'); + late final _dart_clang_Type_visitFields _clang_Type_visitFields = + _clang_Type_visitFields_ptr.asFunction<_dart_clang_Type_visitFields>(); + + late final addresses = _SymbolAddresses(this); +} + +class _SymbolAddresses { + final LibClang _library; + _SymbolAddresses(this._library); + ffi.Pointer> + get clang_getCString => _library._clang_getCString_ptr; + ffi.Pointer> + get clang_disposeString => _library._clang_disposeString_ptr; + ffi.Pointer> + get clang_disposeStringSet => _library._clang_disposeStringSet_ptr; + ffi.Pointer> + get clang_createIndex => _library._clang_createIndex_ptr; + ffi.Pointer> + get clang_disposeIndex => _library._clang_disposeIndex_ptr; + ffi.Pointer> + get clang_CXIndex_setGlobalOptions => + _library._clang_CXIndex_setGlobalOptions_ptr; + ffi.Pointer> + get clang_CXIndex_getGlobalOptions => + _library._clang_CXIndex_getGlobalOptions_ptr; + ffi.Pointer< + ffi.NativeFunction< + Native_clang_CXIndex_setInvocationEmissionPathOption>> + get clang_CXIndex_setInvocationEmissionPathOption => + _library._clang_CXIndex_setInvocationEmissionPathOption_ptr; + ffi.Pointer> + get clang_getFileName => _library._clang_getFileName_ptr; + ffi.Pointer> + get clang_getFileTime => _library._clang_getFileTime_ptr; + ffi.Pointer> + get clang_getFileUniqueID => _library._clang_getFileUniqueID_ptr; + ffi.Pointer> + get clang_isFileMultipleIncludeGuarded => + _library._clang_isFileMultipleIncludeGuarded_ptr; + ffi.Pointer> get clang_getFile => + _library._clang_getFile_ptr; + ffi.Pointer> + get clang_getFileContents => _library._clang_getFileContents_ptr; + ffi.Pointer> + get clang_File_isEqual => _library._clang_File_isEqual_ptr; + ffi.Pointer> + get clang_File_tryGetRealPathName => + _library._clang_File_tryGetRealPathName_ptr; + ffi.Pointer> + get clang_getNullLocation => _library._clang_getNullLocation_ptr; + ffi.Pointer> + get clang_equalLocations => _library._clang_equalLocations_ptr; + ffi.Pointer> + get clang_getLocation => _library._clang_getLocation_ptr; + ffi.Pointer> + get clang_getLocationForOffset => + _library._clang_getLocationForOffset_ptr; + ffi.Pointer> + get clang_Location_isInSystemHeader => + _library._clang_Location_isInSystemHeader_ptr; + ffi.Pointer> + get clang_Location_isFromMainFile => + _library._clang_Location_isFromMainFile_ptr; + ffi.Pointer> + get clang_getNullRange => _library._clang_getNullRange_ptr; + ffi.Pointer> get clang_getRange => + _library._clang_getRange_ptr; + ffi.Pointer> + get clang_equalRanges => _library._clang_equalRanges_ptr; + ffi.Pointer> + get clang_Range_isNull => _library._clang_Range_isNull_ptr; + ffi.Pointer> + get clang_getExpansionLocation => + _library._clang_getExpansionLocation_ptr; + ffi.Pointer> + get clang_getPresumedLocation => _library._clang_getPresumedLocation_ptr; + ffi.Pointer> + get clang_getInstantiationLocation => + _library._clang_getInstantiationLocation_ptr; + ffi.Pointer> + get clang_getSpellingLocation => _library._clang_getSpellingLocation_ptr; + ffi.Pointer> + get clang_getFileLocation => _library._clang_getFileLocation_ptr; + ffi.Pointer> + get clang_getRangeStart => _library._clang_getRangeStart_ptr; + ffi.Pointer> + get clang_getRangeEnd => _library._clang_getRangeEnd_ptr; + ffi.Pointer> + get clang_getSkippedRanges => _library._clang_getSkippedRanges_ptr; + ffi.Pointer> + get clang_getAllSkippedRanges => _library._clang_getAllSkippedRanges_ptr; + ffi.Pointer> + get clang_disposeSourceRangeList => + _library._clang_disposeSourceRangeList_ptr; + ffi.Pointer> + get clang_getNumDiagnosticsInSet => + _library._clang_getNumDiagnosticsInSet_ptr; + ffi.Pointer> + get clang_getDiagnosticInSet => _library._clang_getDiagnosticInSet_ptr; + ffi.Pointer> + get clang_loadDiagnostics => _library._clang_loadDiagnostics_ptr; + ffi.Pointer> + get clang_disposeDiagnosticSet => + _library._clang_disposeDiagnosticSet_ptr; + ffi.Pointer> + get clang_getChildDiagnostics => _library._clang_getChildDiagnostics_ptr; + ffi.Pointer> + get clang_getNumDiagnostics => _library._clang_getNumDiagnostics_ptr; + ffi.Pointer> + get clang_getDiagnostic => _library._clang_getDiagnostic_ptr; + ffi.Pointer> + get clang_getDiagnosticSetFromTU => + _library._clang_getDiagnosticSetFromTU_ptr; + ffi.Pointer> + get clang_disposeDiagnostic => _library._clang_disposeDiagnostic_ptr; + ffi.Pointer> + get clang_formatDiagnostic => _library._clang_formatDiagnostic_ptr; + ffi.Pointer> + get clang_defaultDiagnosticDisplayOptions => + _library._clang_defaultDiagnosticDisplayOptions_ptr; + ffi.Pointer> + get clang_getDiagnosticSeverity => + _library._clang_getDiagnosticSeverity_ptr; + ffi.Pointer> + get clang_getDiagnosticLocation => + _library._clang_getDiagnosticLocation_ptr; + ffi.Pointer> + get clang_getDiagnosticSpelling => + _library._clang_getDiagnosticSpelling_ptr; + ffi.Pointer> + get clang_getDiagnosticOption => _library._clang_getDiagnosticOption_ptr; + ffi.Pointer> + get clang_getDiagnosticCategory => + _library._clang_getDiagnosticCategory_ptr; + ffi.Pointer> + get clang_getDiagnosticCategoryName => + _library._clang_getDiagnosticCategoryName_ptr; + ffi.Pointer> + get clang_getDiagnosticCategoryText => + _library._clang_getDiagnosticCategoryText_ptr; + ffi.Pointer> + get clang_getDiagnosticNumRanges => + _library._clang_getDiagnosticNumRanges_ptr; + ffi.Pointer> + get clang_getDiagnosticRange => _library._clang_getDiagnosticRange_ptr; + ffi.Pointer> + get clang_getDiagnosticNumFixIts => + _library._clang_getDiagnosticNumFixIts_ptr; + ffi.Pointer> + get clang_getDiagnosticFixIt => _library._clang_getDiagnosticFixIt_ptr; + ffi.Pointer> + get clang_getTranslationUnitSpelling => + _library._clang_getTranslationUnitSpelling_ptr; + ffi.Pointer< + ffi.NativeFunction> + get clang_createTranslationUnitFromSourceFile => + _library._clang_createTranslationUnitFromSourceFile_ptr; + ffi.Pointer> + get clang_createTranslationUnit => + _library._clang_createTranslationUnit_ptr; + ffi.Pointer> + get clang_createTranslationUnit2 => + _library._clang_createTranslationUnit2_ptr; + ffi.Pointer< + ffi.NativeFunction> + get clang_defaultEditingTranslationUnitOptions => + _library._clang_defaultEditingTranslationUnitOptions_ptr; + ffi.Pointer> + get clang_parseTranslationUnit => + _library._clang_parseTranslationUnit_ptr; + ffi.Pointer> + get clang_parseTranslationUnit2 => + _library._clang_parseTranslationUnit2_ptr; + ffi.Pointer> + get clang_parseTranslationUnit2FullArgv => + _library._clang_parseTranslationUnit2FullArgv_ptr; + ffi.Pointer> + get clang_defaultSaveOptions => _library._clang_defaultSaveOptions_ptr; + ffi.Pointer> + get clang_saveTranslationUnit => _library._clang_saveTranslationUnit_ptr; + ffi.Pointer> + get clang_suspendTranslationUnit => + _library._clang_suspendTranslationUnit_ptr; + ffi.Pointer> + get clang_disposeTranslationUnit => + _library._clang_disposeTranslationUnit_ptr; + ffi.Pointer> + get clang_defaultReparseOptions => + _library._clang_defaultReparseOptions_ptr; + ffi.Pointer> + get clang_reparseTranslationUnit => + _library._clang_reparseTranslationUnit_ptr; + ffi.Pointer> + get clang_getTUResourceUsageName => + _library._clang_getTUResourceUsageName_ptr; + ffi.Pointer> + get clang_getCXTUResourceUsage => + _library._clang_getCXTUResourceUsage_ptr; + ffi.Pointer> + get clang_disposeCXTUResourceUsage => + _library._clang_disposeCXTUResourceUsage_ptr; + ffi.Pointer> + get clang_getTranslationUnitTargetInfo => + _library._clang_getTranslationUnitTargetInfo_ptr; + ffi.Pointer> + get clang_TargetInfo_dispose => _library._clang_TargetInfo_dispose_ptr; + ffi.Pointer> + get clang_TargetInfo_getTriple => + _library._clang_TargetInfo_getTriple_ptr; + ffi.Pointer> + get clang_TargetInfo_getPointerWidth => + _library._clang_TargetInfo_getPointerWidth_ptr; + ffi.Pointer> + get clang_getNullCursor => _library._clang_getNullCursor_ptr; + ffi.Pointer> + get clang_getTranslationUnitCursor => + _library._clang_getTranslationUnitCursor_ptr; + ffi.Pointer> + get clang_equalCursors => _library._clang_equalCursors_ptr; + ffi.Pointer> + get clang_Cursor_isNull => _library._clang_Cursor_isNull_ptr; + ffi.Pointer> + get clang_hashCursor => _library._clang_hashCursor_ptr; + ffi.Pointer> + get clang_getCursorKind => _library._clang_getCursorKind_ptr; + ffi.Pointer> + get clang_isDeclaration => _library._clang_isDeclaration_ptr; + ffi.Pointer> + get clang_isInvalidDeclaration => + _library._clang_isInvalidDeclaration_ptr; + ffi.Pointer> + get clang_isReference => _library._clang_isReference_ptr; + ffi.Pointer> + get clang_isExpression => _library._clang_isExpression_ptr; + ffi.Pointer> + get clang_isStatement => _library._clang_isStatement_ptr; + ffi.Pointer> + get clang_isAttribute => _library._clang_isAttribute_ptr; + ffi.Pointer> + get clang_Cursor_hasAttrs => _library._clang_Cursor_hasAttrs_ptr; + ffi.Pointer> get clang_isInvalid => + _library._clang_isInvalid_ptr; + ffi.Pointer> + get clang_isTranslationUnit => _library._clang_isTranslationUnit_ptr; + ffi.Pointer> + get clang_isPreprocessing => _library._clang_isPreprocessing_ptr; + ffi.Pointer> + get clang_isUnexposed => _library._clang_isUnexposed_ptr; + ffi.Pointer> + get clang_getCursorLinkage => _library._clang_getCursorLinkage_ptr; + ffi.Pointer> + get clang_getCursorVisibility => _library._clang_getCursorVisibility_ptr; + ffi.Pointer> + get clang_getCursorAvailability => + _library._clang_getCursorAvailability_ptr; + ffi.Pointer> + get clang_getCursorPlatformAvailability => + _library._clang_getCursorPlatformAvailability_ptr; + ffi.Pointer> + get clang_disposeCXPlatformAvailability => + _library._clang_disposeCXPlatformAvailability_ptr; + ffi.Pointer> + get clang_getCursorLanguage => _library._clang_getCursorLanguage_ptr; + ffi.Pointer> + get clang_getCursorTLSKind => _library._clang_getCursorTLSKind_ptr; + ffi.Pointer> + get clang_Cursor_getTranslationUnit => + _library._clang_Cursor_getTranslationUnit_ptr; + ffi.Pointer> + get clang_createCXCursorSet => _library._clang_createCXCursorSet_ptr; + ffi.Pointer> + get clang_disposeCXCursorSet => _library._clang_disposeCXCursorSet_ptr; + ffi.Pointer> + get clang_CXCursorSet_contains => + _library._clang_CXCursorSet_contains_ptr; + ffi.Pointer> + get clang_CXCursorSet_insert => _library._clang_CXCursorSet_insert_ptr; + ffi.Pointer> + get clang_getCursorSemanticParent => + _library._clang_getCursorSemanticParent_ptr; + ffi.Pointer> + get clang_getCursorLexicalParent => + _library._clang_getCursorLexicalParent_ptr; + ffi.Pointer> + get clang_getOverriddenCursors => + _library._clang_getOverriddenCursors_ptr; + ffi.Pointer> + get clang_disposeOverriddenCursors => + _library._clang_disposeOverriddenCursors_ptr; + ffi.Pointer> + get clang_getIncludedFile => _library._clang_getIncludedFile_ptr; + ffi.Pointer> get clang_getCursor => + _library._clang_getCursor_ptr; + ffi.Pointer> + get clang_getCursorLocation => _library._clang_getCursorLocation_ptr; + ffi.Pointer> + get clang_getCursorExtent => _library._clang_getCursorExtent_ptr; + ffi.Pointer> + get clang_getCursorType => _library._clang_getCursorType_ptr; + ffi.Pointer> + get clang_getTypeSpelling => _library._clang_getTypeSpelling_ptr; + ffi.Pointer> + get clang_getTypedefDeclUnderlyingType => + _library._clang_getTypedefDeclUnderlyingType_ptr; + ffi.Pointer> + get clang_getEnumDeclIntegerType => + _library._clang_getEnumDeclIntegerType_ptr; + ffi.Pointer> + get clang_getEnumConstantDeclValue => + _library._clang_getEnumConstantDeclValue_ptr; + ffi.Pointer> + get clang_getEnumConstantDeclUnsignedValue => + _library._clang_getEnumConstantDeclUnsignedValue_ptr; + ffi.Pointer> + get clang_getFieldDeclBitWidth => + _library._clang_getFieldDeclBitWidth_ptr; + ffi.Pointer> + get clang_Cursor_getNumArguments => + _library._clang_Cursor_getNumArguments_ptr; + ffi.Pointer> + get clang_Cursor_getArgument => _library._clang_Cursor_getArgument_ptr; + ffi.Pointer> + get clang_Cursor_getNumTemplateArguments => + _library._clang_Cursor_getNumTemplateArguments_ptr; + ffi.Pointer> + get clang_Cursor_getTemplateArgumentKind => + _library._clang_Cursor_getTemplateArgumentKind_ptr; + ffi.Pointer> + get clang_Cursor_getTemplateArgumentType => + _library._clang_Cursor_getTemplateArgumentType_ptr; + ffi.Pointer> + get clang_Cursor_getTemplateArgumentValue => + _library._clang_Cursor_getTemplateArgumentValue_ptr; + ffi.Pointer< + ffi.NativeFunction< + Native_clang_Cursor_getTemplateArgumentUnsignedValue>> + get clang_Cursor_getTemplateArgumentUnsignedValue => + _library._clang_Cursor_getTemplateArgumentUnsignedValue_ptr; + ffi.Pointer> + get clang_equalTypes => _library._clang_equalTypes_ptr; + ffi.Pointer> + get clang_getCanonicalType => _library._clang_getCanonicalType_ptr; + ffi.Pointer> + get clang_isConstQualifiedType => + _library._clang_isConstQualifiedType_ptr; + ffi.Pointer> + get clang_Cursor_isMacroFunctionLike => + _library._clang_Cursor_isMacroFunctionLike_ptr; + ffi.Pointer> + get clang_Cursor_isMacroBuiltin => + _library._clang_Cursor_isMacroBuiltin_ptr; + ffi.Pointer> + get clang_Cursor_isFunctionInlined => + _library._clang_Cursor_isFunctionInlined_ptr; + ffi.Pointer> + get clang_isVolatileQualifiedType => + _library._clang_isVolatileQualifiedType_ptr; + ffi.Pointer> + get clang_isRestrictQualifiedType => + _library._clang_isRestrictQualifiedType_ptr; + ffi.Pointer> + get clang_getAddressSpace => _library._clang_getAddressSpace_ptr; + ffi.Pointer> + get clang_getTypedefName => _library._clang_getTypedefName_ptr; + ffi.Pointer> + get clang_getPointeeType => _library._clang_getPointeeType_ptr; + ffi.Pointer> + get clang_getTypeDeclaration => _library._clang_getTypeDeclaration_ptr; + ffi.Pointer> + get clang_getDeclObjCTypeEncoding => + _library._clang_getDeclObjCTypeEncoding_ptr; + ffi.Pointer> + get clang_Type_getObjCEncoding => + _library._clang_Type_getObjCEncoding_ptr; + ffi.Pointer> + get clang_getTypeKindSpelling => _library._clang_getTypeKindSpelling_ptr; + ffi.Pointer> + get clang_getFunctionTypeCallingConv => + _library._clang_getFunctionTypeCallingConv_ptr; + ffi.Pointer> + get clang_getResultType => _library._clang_getResultType_ptr; + ffi.Pointer> + get clang_getExceptionSpecificationType => + _library._clang_getExceptionSpecificationType_ptr; + ffi.Pointer> + get clang_getNumArgTypes => _library._clang_getNumArgTypes_ptr; + ffi.Pointer> + get clang_getArgType => _library._clang_getArgType_ptr; + ffi.Pointer> + get clang_Type_getObjCObjectBaseType => + _library._clang_Type_getObjCObjectBaseType_ptr; + ffi.Pointer> + get clang_Type_getNumObjCProtocolRefs => + _library._clang_Type_getNumObjCProtocolRefs_ptr; + ffi.Pointer> + get clang_Type_getObjCProtocolDecl => + _library._clang_Type_getObjCProtocolDecl_ptr; + ffi.Pointer> + get clang_Type_getNumObjCTypeArgs => + _library._clang_Type_getNumObjCTypeArgs_ptr; + ffi.Pointer> + get clang_Type_getObjCTypeArg => _library._clang_Type_getObjCTypeArg_ptr; + ffi.Pointer> + get clang_isFunctionTypeVariadic => + _library._clang_isFunctionTypeVariadic_ptr; + ffi.Pointer> + get clang_getCursorResultType => _library._clang_getCursorResultType_ptr; + ffi.Pointer< + ffi.NativeFunction> + get clang_getCursorExceptionSpecificationType => + _library._clang_getCursorExceptionSpecificationType_ptr; + ffi.Pointer> get clang_isPODType => + _library._clang_isPODType_ptr; + ffi.Pointer> + get clang_getElementType => _library._clang_getElementType_ptr; + ffi.Pointer> + get clang_getNumElements => _library._clang_getNumElements_ptr; + ffi.Pointer> + get clang_getArrayElementType => _library._clang_getArrayElementType_ptr; + ffi.Pointer> + get clang_getArraySize => _library._clang_getArraySize_ptr; + ffi.Pointer> + get clang_Type_getNamedType => _library._clang_Type_getNamedType_ptr; + ffi.Pointer> + get clang_Type_isTransparentTagTypedef => + _library._clang_Type_isTransparentTagTypedef_ptr; + ffi.Pointer> + get clang_Type_getNullability => _library._clang_Type_getNullability_ptr; + ffi.Pointer> + get clang_Type_getAlignOf => _library._clang_Type_getAlignOf_ptr; + ffi.Pointer> + get clang_Type_getClassType => _library._clang_Type_getClassType_ptr; + ffi.Pointer> + get clang_Type_getSizeOf => _library._clang_Type_getSizeOf_ptr; + ffi.Pointer> + get clang_Type_getOffsetOf => _library._clang_Type_getOffsetOf_ptr; + ffi.Pointer> + get clang_Type_getModifiedType => + _library._clang_Type_getModifiedType_ptr; + ffi.Pointer> + get clang_Cursor_getOffsetOfField => + _library._clang_Cursor_getOffsetOfField_ptr; + ffi.Pointer> + get clang_Cursor_isAnonymous => _library._clang_Cursor_isAnonymous_ptr; + ffi.Pointer> + get clang_Cursor_isAnonymousRecordDecl => + _library._clang_Cursor_isAnonymousRecordDecl_ptr; + ffi.Pointer> + get clang_Cursor_isInlineNamespace => + _library._clang_Cursor_isInlineNamespace_ptr; + ffi.Pointer> + get clang_Type_getNumTemplateArguments => + _library._clang_Type_getNumTemplateArguments_ptr; + ffi.Pointer> + get clang_Type_getTemplateArgumentAsType => + _library._clang_Type_getTemplateArgumentAsType_ptr; + ffi.Pointer> + get clang_Type_getCXXRefQualifier => + _library._clang_Type_getCXXRefQualifier_ptr; + ffi.Pointer> + get clang_Cursor_isBitField => _library._clang_Cursor_isBitField_ptr; + ffi.Pointer> + get clang_isVirtualBase => _library._clang_isVirtualBase_ptr; + ffi.Pointer> + get clang_getCXXAccessSpecifier => + _library._clang_getCXXAccessSpecifier_ptr; + ffi.Pointer> + get clang_Cursor_getStorageClass => + _library._clang_Cursor_getStorageClass_ptr; + ffi.Pointer> + get clang_getNumOverloadedDecls => + _library._clang_getNumOverloadedDecls_ptr; + ffi.Pointer> + get clang_getOverloadedDecl => _library._clang_getOverloadedDecl_ptr; + ffi.Pointer> + get clang_getIBOutletCollectionType => + _library._clang_getIBOutletCollectionType_ptr; + ffi.Pointer> + get clang_visitChildren => _library._clang_visitChildren_ptr; + ffi.Pointer> + get clang_getCursorUSR => _library._clang_getCursorUSR_ptr; + ffi.Pointer> + get clang_constructUSR_ObjCClass => + _library._clang_constructUSR_ObjCClass_ptr; + ffi.Pointer> + get clang_constructUSR_ObjCCategory => + _library._clang_constructUSR_ObjCCategory_ptr; + ffi.Pointer> + get clang_constructUSR_ObjCProtocol => + _library._clang_constructUSR_ObjCProtocol_ptr; + ffi.Pointer> + get clang_constructUSR_ObjCIvar => + _library._clang_constructUSR_ObjCIvar_ptr; + ffi.Pointer> + get clang_constructUSR_ObjCMethod => + _library._clang_constructUSR_ObjCMethod_ptr; + ffi.Pointer> + get clang_constructUSR_ObjCProperty => + _library._clang_constructUSR_ObjCProperty_ptr; + ffi.Pointer> + get clang_getCursorSpelling => _library._clang_getCursorSpelling_ptr; + ffi.Pointer> + get clang_Cursor_getSpellingNameRange => + _library._clang_Cursor_getSpellingNameRange_ptr; + ffi.Pointer> + get clang_PrintingPolicy_getProperty => + _library._clang_PrintingPolicy_getProperty_ptr; + ffi.Pointer> + get clang_PrintingPolicy_setProperty => + _library._clang_PrintingPolicy_setProperty_ptr; + ffi.Pointer> + get clang_getCursorPrintingPolicy => + _library._clang_getCursorPrintingPolicy_ptr; + ffi.Pointer> + get clang_PrintingPolicy_dispose => + _library._clang_PrintingPolicy_dispose_ptr; + ffi.Pointer> + get clang_getCursorPrettyPrinted => + _library._clang_getCursorPrettyPrinted_ptr; + ffi.Pointer> + get clang_getCursorDisplayName => + _library._clang_getCursorDisplayName_ptr; + ffi.Pointer> + get clang_getCursorReferenced => _library._clang_getCursorReferenced_ptr; + ffi.Pointer> + get clang_getCursorDefinition => _library._clang_getCursorDefinition_ptr; + ffi.Pointer> + get clang_isCursorDefinition => _library._clang_isCursorDefinition_ptr; + ffi.Pointer> + get clang_getCanonicalCursor => _library._clang_getCanonicalCursor_ptr; + ffi.Pointer> + get clang_Cursor_getObjCSelectorIndex => + _library._clang_Cursor_getObjCSelectorIndex_ptr; + ffi.Pointer> + get clang_Cursor_isDynamicCall => + _library._clang_Cursor_isDynamicCall_ptr; + ffi.Pointer> + get clang_Cursor_getReceiverType => + _library._clang_Cursor_getReceiverType_ptr; + ffi.Pointer> + get clang_Cursor_getObjCPropertyAttributes => + _library._clang_Cursor_getObjCPropertyAttributes_ptr; + ffi.Pointer> + get clang_Cursor_getObjCPropertyGetterName => + _library._clang_Cursor_getObjCPropertyGetterName_ptr; + ffi.Pointer> + get clang_Cursor_getObjCPropertySetterName => + _library._clang_Cursor_getObjCPropertySetterName_ptr; + ffi.Pointer> + get clang_Cursor_getObjCDeclQualifiers => + _library._clang_Cursor_getObjCDeclQualifiers_ptr; + ffi.Pointer> + get clang_Cursor_isObjCOptional => + _library._clang_Cursor_isObjCOptional_ptr; + ffi.Pointer> + get clang_Cursor_isVariadic => _library._clang_Cursor_isVariadic_ptr; + ffi.Pointer> + get clang_Cursor_isExternalSymbol => + _library._clang_Cursor_isExternalSymbol_ptr; + ffi.Pointer> + get clang_Cursor_getCommentRange => + _library._clang_Cursor_getCommentRange_ptr; + ffi.Pointer> + get clang_Cursor_getRawCommentText => + _library._clang_Cursor_getRawCommentText_ptr; + ffi.Pointer> + get clang_Cursor_getBriefCommentText => + _library._clang_Cursor_getBriefCommentText_ptr; + ffi.Pointer> + get clang_Cursor_getMangling => _library._clang_Cursor_getMangling_ptr; + ffi.Pointer> + get clang_Cursor_getCXXManglings => + _library._clang_Cursor_getCXXManglings_ptr; + ffi.Pointer> + get clang_Cursor_getObjCManglings => + _library._clang_Cursor_getObjCManglings_ptr; + ffi.Pointer> + get clang_Cursor_getModule => _library._clang_Cursor_getModule_ptr; + ffi.Pointer> + get clang_getModuleForFile => _library._clang_getModuleForFile_ptr; + ffi.Pointer> + get clang_Module_getASTFile => _library._clang_Module_getASTFile_ptr; + ffi.Pointer> + get clang_Module_getParent => _library._clang_Module_getParent_ptr; + ffi.Pointer> + get clang_Module_getName => _library._clang_Module_getName_ptr; + ffi.Pointer> + get clang_Module_getFullName => _library._clang_Module_getFullName_ptr; + ffi.Pointer> + get clang_Module_isSystem => _library._clang_Module_isSystem_ptr; + ffi.Pointer> + get clang_Module_getNumTopLevelHeaders => + _library._clang_Module_getNumTopLevelHeaders_ptr; + ffi.Pointer> + get clang_Module_getTopLevelHeader => + _library._clang_Module_getTopLevelHeader_ptr; + ffi.Pointer< + ffi.NativeFunction< + Native_clang_CXXConstructor_isConvertingConstructor>> + get clang_CXXConstructor_isConvertingConstructor => + _library._clang_CXXConstructor_isConvertingConstructor_ptr; + ffi.Pointer> + get clang_CXXConstructor_isCopyConstructor => + _library._clang_CXXConstructor_isCopyConstructor_ptr; + ffi.Pointer< + ffi.NativeFunction> + get clang_CXXConstructor_isDefaultConstructor => + _library._clang_CXXConstructor_isDefaultConstructor_ptr; + ffi.Pointer> + get clang_CXXConstructor_isMoveConstructor => + _library._clang_CXXConstructor_isMoveConstructor_ptr; + ffi.Pointer> + get clang_CXXField_isMutable => _library._clang_CXXField_isMutable_ptr; + ffi.Pointer> + get clang_CXXMethod_isDefaulted => + _library._clang_CXXMethod_isDefaulted_ptr; + ffi.Pointer> + get clang_CXXMethod_isPureVirtual => + _library._clang_CXXMethod_isPureVirtual_ptr; + ffi.Pointer> + get clang_CXXMethod_isStatic => _library._clang_CXXMethod_isStatic_ptr; + ffi.Pointer> + get clang_CXXMethod_isVirtual => _library._clang_CXXMethod_isVirtual_ptr; + ffi.Pointer> + get clang_CXXRecord_isAbstract => + _library._clang_CXXRecord_isAbstract_ptr; + ffi.Pointer> + get clang_EnumDecl_isScoped => _library._clang_EnumDecl_isScoped_ptr; + ffi.Pointer> + get clang_CXXMethod_isConst => _library._clang_CXXMethod_isConst_ptr; + ffi.Pointer> + get clang_getTemplateCursorKind => + _library._clang_getTemplateCursorKind_ptr; + ffi.Pointer> + get clang_getSpecializedCursorTemplate => + _library._clang_getSpecializedCursorTemplate_ptr; + ffi.Pointer> + get clang_getCursorReferenceNameRange => + _library._clang_getCursorReferenceNameRange_ptr; + ffi.Pointer> get clang_getToken => + _library._clang_getToken_ptr; + ffi.Pointer> + get clang_getTokenKind => _library._clang_getTokenKind_ptr; + ffi.Pointer> + get clang_getTokenSpelling => _library._clang_getTokenSpelling_ptr; + ffi.Pointer> + get clang_getTokenLocation => _library._clang_getTokenLocation_ptr; + ffi.Pointer> + get clang_getTokenExtent => _library._clang_getTokenExtent_ptr; + ffi.Pointer> get clang_tokenize => + _library._clang_tokenize_ptr; + ffi.Pointer> + get clang_annotateTokens => _library._clang_annotateTokens_ptr; + ffi.Pointer> + get clang_disposeTokens => _library._clang_disposeTokens_ptr; + ffi.Pointer> + get clang_getCursorKindSpelling => + _library._clang_getCursorKindSpelling_ptr; + ffi.Pointer> + get clang_getDefinitionSpellingAndExtent => + _library._clang_getDefinitionSpellingAndExtent_ptr; + ffi.Pointer> + get clang_enableStackTraces => _library._clang_enableStackTraces_ptr; + ffi.Pointer> + get clang_executeOnThread => _library._clang_executeOnThread_ptr; + ffi.Pointer> + get clang_getCompletionChunkKind => + _library._clang_getCompletionChunkKind_ptr; + ffi.Pointer> + get clang_getCompletionChunkText => + _library._clang_getCompletionChunkText_ptr; + ffi.Pointer< + ffi.NativeFunction> + get clang_getCompletionChunkCompletionString => + _library._clang_getCompletionChunkCompletionString_ptr; + ffi.Pointer> + get clang_getNumCompletionChunks => + _library._clang_getNumCompletionChunks_ptr; + ffi.Pointer> + get clang_getCompletionPriority => + _library._clang_getCompletionPriority_ptr; + ffi.Pointer> + get clang_getCompletionAvailability => + _library._clang_getCompletionAvailability_ptr; + ffi.Pointer> + get clang_getCompletionNumAnnotations => + _library._clang_getCompletionNumAnnotations_ptr; + ffi.Pointer> + get clang_getCompletionAnnotation => + _library._clang_getCompletionAnnotation_ptr; + ffi.Pointer> + get clang_getCompletionParent => _library._clang_getCompletionParent_ptr; + ffi.Pointer> + get clang_getCompletionBriefComment => + _library._clang_getCompletionBriefComment_ptr; + ffi.Pointer> + get clang_getCursorCompletionString => + _library._clang_getCursorCompletionString_ptr; + ffi.Pointer> + get clang_getCompletionNumFixIts => + _library._clang_getCompletionNumFixIts_ptr; + ffi.Pointer> + get clang_getCompletionFixIt => _library._clang_getCompletionFixIt_ptr; + ffi.Pointer> + get clang_defaultCodeCompleteOptions => + _library._clang_defaultCodeCompleteOptions_ptr; + ffi.Pointer> + get clang_codeCompleteAt => _library._clang_codeCompleteAt_ptr; + ffi.Pointer> + get clang_sortCodeCompletionResults => + _library._clang_sortCodeCompletionResults_ptr; + ffi.Pointer> + get clang_disposeCodeCompleteResults => + _library._clang_disposeCodeCompleteResults_ptr; + ffi.Pointer> + get clang_codeCompleteGetNumDiagnostics => + _library._clang_codeCompleteGetNumDiagnostics_ptr; + ffi.Pointer> + get clang_codeCompleteGetDiagnostic => + _library._clang_codeCompleteGetDiagnostic_ptr; + ffi.Pointer> + get clang_codeCompleteGetContexts => + _library._clang_codeCompleteGetContexts_ptr; + ffi.Pointer> + get clang_codeCompleteGetContainerKind => + _library._clang_codeCompleteGetContainerKind_ptr; + ffi.Pointer> + get clang_codeCompleteGetContainerUSR => + _library._clang_codeCompleteGetContainerUSR_ptr; + ffi.Pointer> + get clang_codeCompleteGetObjCSelector => + _library._clang_codeCompleteGetObjCSelector_ptr; + ffi.Pointer> + get clang_getClangVersion => _library._clang_getClangVersion_ptr; + ffi.Pointer> + get clang_toggleCrashRecovery => _library._clang_toggleCrashRecovery_ptr; + ffi.Pointer> + get clang_getInclusions => _library._clang_getInclusions_ptr; + ffi.Pointer> + get clang_Cursor_Evaluate => _library._clang_Cursor_Evaluate_ptr; + ffi.Pointer> + get clang_EvalResult_getKind => _library._clang_EvalResult_getKind_ptr; + ffi.Pointer> + get clang_EvalResult_getAsInt => _library._clang_EvalResult_getAsInt_ptr; + ffi.Pointer> + get clang_EvalResult_getAsLongLong => + _library._clang_EvalResult_getAsLongLong_ptr; + ffi.Pointer> + get clang_EvalResult_isUnsignedInt => + _library._clang_EvalResult_isUnsignedInt_ptr; + ffi.Pointer> + get clang_EvalResult_getAsUnsigned => + _library._clang_EvalResult_getAsUnsigned_ptr; + ffi.Pointer> + get clang_EvalResult_getAsDouble => + _library._clang_EvalResult_getAsDouble_ptr; + ffi.Pointer> + get clang_EvalResult_getAsStr => _library._clang_EvalResult_getAsStr_ptr; + ffi.Pointer> + get clang_EvalResult_dispose => _library._clang_EvalResult_dispose_ptr; + ffi.Pointer> + get clang_getRemappings => _library._clang_getRemappings_ptr; + ffi.Pointer> + get clang_getRemappingsFromFileList => + _library._clang_getRemappingsFromFileList_ptr; + ffi.Pointer> + get clang_remap_getNumFiles => _library._clang_remap_getNumFiles_ptr; + ffi.Pointer> + get clang_remap_getFilenames => _library._clang_remap_getFilenames_ptr; + ffi.Pointer> + get clang_remap_dispose => _library._clang_remap_dispose_ptr; + ffi.Pointer> + get clang_findReferencesInFile => + _library._clang_findReferencesInFile_ptr; + ffi.Pointer> + get clang_findIncludesInFile => _library._clang_findIncludesInFile_ptr; + ffi.Pointer> + get clang_index_isEntityObjCContainerKind => + _library._clang_index_isEntityObjCContainerKind_ptr; + ffi.Pointer> + get clang_index_getObjCContainerDeclInfo => + _library._clang_index_getObjCContainerDeclInfo_ptr; + ffi.Pointer> + get clang_index_getObjCInterfaceDeclInfo => + _library._clang_index_getObjCInterfaceDeclInfo_ptr; + ffi.Pointer> + get clang_index_getObjCCategoryDeclInfo => + _library._clang_index_getObjCCategoryDeclInfo_ptr; + ffi.Pointer> + get clang_index_getObjCProtocolRefListInfo => + _library._clang_index_getObjCProtocolRefListInfo_ptr; + ffi.Pointer> + get clang_index_getObjCPropertyDeclInfo => + _library._clang_index_getObjCPropertyDeclInfo_ptr; + ffi.Pointer< + ffi.NativeFunction> + get clang_index_getIBOutletCollectionAttrInfo => + _library._clang_index_getIBOutletCollectionAttrInfo_ptr; + ffi.Pointer> + get clang_index_getCXXClassDeclInfo => + _library._clang_index_getCXXClassDeclInfo_ptr; + ffi.Pointer> + get clang_index_getClientContainer => + _library._clang_index_getClientContainer_ptr; + ffi.Pointer> + get clang_index_setClientContainer => + _library._clang_index_setClientContainer_ptr; + ffi.Pointer> + get clang_index_getClientEntity => + _library._clang_index_getClientEntity_ptr; + ffi.Pointer> + get clang_index_setClientEntity => + _library._clang_index_setClientEntity_ptr; + ffi.Pointer> + get clang_IndexAction_create => _library._clang_IndexAction_create_ptr; + ffi.Pointer> + get clang_IndexAction_dispose => _library._clang_IndexAction_dispose_ptr; + ffi.Pointer> + get clang_indexSourceFile => _library._clang_indexSourceFile_ptr; + ffi.Pointer> + get clang_indexSourceFileFullArgv => + _library._clang_indexSourceFileFullArgv_ptr; + ffi.Pointer> + get clang_indexTranslationUnit => + _library._clang_indexTranslationUnit_ptr; + ffi.Pointer> + get clang_indexLoc_getFileLocation => + _library._clang_indexLoc_getFileLocation_ptr; + ffi.Pointer> + get clang_indexLoc_getCXSourceLocation => + _library._clang_indexLoc_getCXSourceLocation_ptr; + ffi.Pointer> + get clang_Type_visitFields => _library._clang_Type_visitFields_ptr; } /// A character string. @@ -7461,7 +8859,7 @@ const int CINDEX_VERSION = 59; const String CINDEX_VERSION_STRING = '0.59'; -typedef _c_clang_getCString = ffi.Pointer Function( +typedef Native_clang_getCString = ffi.Pointer Function( CXString string, ); @@ -7469,7 +8867,7 @@ typedef _dart_clang_getCString = ffi.Pointer Function( CXString string, ); -typedef _c_clang_disposeString = ffi.Void Function( +typedef Native_clang_disposeString = ffi.Void Function( CXString string, ); @@ -7477,7 +8875,7 @@ typedef _dart_clang_disposeString = void Function( CXString string, ); -typedef _c_clang_disposeStringSet = ffi.Void Function( +typedef Native_clang_disposeStringSet = ffi.Void Function( ffi.Pointer set_1, ); @@ -7485,7 +8883,7 @@ typedef _dart_clang_disposeStringSet = void Function( ffi.Pointer set_1, ); -typedef _c_clang_createIndex = ffi.Pointer Function( +typedef Native_clang_createIndex = ffi.Pointer Function( ffi.Int32 excludeDeclarationsFromPCH, ffi.Int32 displayDiagnostics, ); @@ -7495,7 +8893,7 @@ typedef _dart_clang_createIndex = ffi.Pointer Function( int displayDiagnostics, ); -typedef _c_clang_disposeIndex = ffi.Void Function( +typedef Native_clang_disposeIndex = ffi.Void Function( ffi.Pointer index, ); @@ -7503,7 +8901,7 @@ typedef _dart_clang_disposeIndex = void Function( ffi.Pointer index, ); -typedef _c_clang_CXIndex_setGlobalOptions = ffi.Void Function( +typedef Native_clang_CXIndex_setGlobalOptions = ffi.Void Function( ffi.Pointer arg0, ffi.Uint32 options, ); @@ -7513,7 +8911,7 @@ typedef _dart_clang_CXIndex_setGlobalOptions = void Function( int options, ); -typedef _c_clang_CXIndex_getGlobalOptions = ffi.Uint32 Function( +typedef Native_clang_CXIndex_getGlobalOptions = ffi.Uint32 Function( ffi.Pointer arg0, ); @@ -7521,7 +8919,8 @@ typedef _dart_clang_CXIndex_getGlobalOptions = int Function( ffi.Pointer arg0, ); -typedef _c_clang_CXIndex_setInvocationEmissionPathOption = ffi.Void Function( +typedef Native_clang_CXIndex_setInvocationEmissionPathOption = ffi.Void + Function( ffi.Pointer arg0, ffi.Pointer Path, ); @@ -7531,7 +8930,7 @@ typedef _dart_clang_CXIndex_setInvocationEmissionPathOption = void Function( ffi.Pointer Path, ); -typedef _c_clang_getFileName = CXString Function( +typedef Native_clang_getFileName = CXString Function( ffi.Pointer SFile, ); @@ -7539,7 +8938,7 @@ typedef _dart_clang_getFileName = CXString Function( ffi.Pointer SFile, ); -typedef _c_clang_getFileTime = ffi.Int64 Function( +typedef Native_clang_getFileTime = ffi.Int64 Function( ffi.Pointer SFile, ); @@ -7547,7 +8946,7 @@ typedef _dart_clang_getFileTime = int Function( ffi.Pointer SFile, ); -typedef _c_clang_getFileUniqueID = ffi.Int32 Function( +typedef Native_clang_getFileUniqueID = ffi.Int32 Function( ffi.Pointer file, ffi.Pointer outID, ); @@ -7557,7 +8956,7 @@ typedef _dart_clang_getFileUniqueID = int Function( ffi.Pointer outID, ); -typedef _c_clang_isFileMultipleIncludeGuarded = ffi.Uint32 Function( +typedef Native_clang_isFileMultipleIncludeGuarded = ffi.Uint32 Function( ffi.Pointer tu, ffi.Pointer file, ); @@ -7567,7 +8966,7 @@ typedef _dart_clang_isFileMultipleIncludeGuarded = int Function( ffi.Pointer file, ); -typedef _c_clang_getFile = ffi.Pointer Function( +typedef Native_clang_getFile = ffi.Pointer Function( ffi.Pointer tu, ffi.Pointer file_name, ); @@ -7577,7 +8976,7 @@ typedef _dart_clang_getFile = ffi.Pointer Function( ffi.Pointer file_name, ); -typedef _c_clang_getFileContents = ffi.Pointer Function( +typedef Native_clang_getFileContents = ffi.Pointer Function( ffi.Pointer tu, ffi.Pointer file, ffi.Pointer size, @@ -7589,7 +8988,7 @@ typedef _dart_clang_getFileContents = ffi.Pointer Function( ffi.Pointer size, ); -typedef _c_clang_File_isEqual = ffi.Int32 Function( +typedef Native_clang_File_isEqual = ffi.Int32 Function( ffi.Pointer file1, ffi.Pointer file2, ); @@ -7599,7 +8998,7 @@ typedef _dart_clang_File_isEqual = int Function( ffi.Pointer file2, ); -typedef _c_clang_File_tryGetRealPathName = CXString Function( +typedef Native_clang_File_tryGetRealPathName = CXString Function( ffi.Pointer file, ); @@ -7607,11 +9006,11 @@ typedef _dart_clang_File_tryGetRealPathName = CXString Function( ffi.Pointer file, ); -typedef _c_clang_getNullLocation = CXSourceLocation Function(); +typedef Native_clang_getNullLocation = CXSourceLocation Function(); typedef _dart_clang_getNullLocation = CXSourceLocation Function(); -typedef _c_clang_equalLocations = ffi.Uint32 Function( +typedef Native_clang_equalLocations = ffi.Uint32 Function( CXSourceLocation loc1, CXSourceLocation loc2, ); @@ -7621,7 +9020,7 @@ typedef _dart_clang_equalLocations = int Function( CXSourceLocation loc2, ); -typedef _c_clang_getLocation = CXSourceLocation Function( +typedef Native_clang_getLocation = CXSourceLocation Function( ffi.Pointer tu, ffi.Pointer file, ffi.Uint32 line, @@ -7635,7 +9034,7 @@ typedef _dart_clang_getLocation = CXSourceLocation Function( int column, ); -typedef _c_clang_getLocationForOffset = CXSourceLocation Function( +typedef Native_clang_getLocationForOffset = CXSourceLocation Function( ffi.Pointer tu, ffi.Pointer file, ffi.Uint32 offset, @@ -7647,7 +9046,7 @@ typedef _dart_clang_getLocationForOffset = CXSourceLocation Function( int offset, ); -typedef _c_clang_Location_isInSystemHeader = ffi.Int32 Function( +typedef Native_clang_Location_isInSystemHeader = ffi.Int32 Function( CXSourceLocation location, ); @@ -7655,7 +9054,7 @@ typedef _dart_clang_Location_isInSystemHeader = int Function( CXSourceLocation location, ); -typedef _c_clang_Location_isFromMainFile = ffi.Int32 Function( +typedef Native_clang_Location_isFromMainFile = ffi.Int32 Function( CXSourceLocation location, ); @@ -7663,11 +9062,11 @@ typedef _dart_clang_Location_isFromMainFile = int Function( CXSourceLocation location, ); -typedef _c_clang_getNullRange = CXSourceRange Function(); +typedef Native_clang_getNullRange = CXSourceRange Function(); typedef _dart_clang_getNullRange = CXSourceRange Function(); -typedef _c_clang_getRange = CXSourceRange Function( +typedef Native_clang_getRange = CXSourceRange Function( CXSourceLocation begin, CXSourceLocation end, ); @@ -7677,7 +9076,7 @@ typedef _dart_clang_getRange = CXSourceRange Function( CXSourceLocation end, ); -typedef _c_clang_equalRanges = ffi.Uint32 Function( +typedef Native_clang_equalRanges = ffi.Uint32 Function( CXSourceRange range1, CXSourceRange range2, ); @@ -7687,7 +9086,7 @@ typedef _dart_clang_equalRanges = int Function( CXSourceRange range2, ); -typedef _c_clang_Range_isNull = ffi.Int32 Function( +typedef Native_clang_Range_isNull = ffi.Int32 Function( CXSourceRange range, ); @@ -7695,7 +9094,7 @@ typedef _dart_clang_Range_isNull = int Function( CXSourceRange range, ); -typedef _c_clang_getExpansionLocation = ffi.Void Function( +typedef Native_clang_getExpansionLocation = ffi.Void Function( CXSourceLocation location, ffi.Pointer> file, ffi.Pointer line, @@ -7711,7 +9110,7 @@ typedef _dart_clang_getExpansionLocation = void Function( ffi.Pointer offset, ); -typedef _c_clang_getPresumedLocation = ffi.Void Function( +typedef Native_clang_getPresumedLocation = ffi.Void Function( CXSourceLocation location, ffi.Pointer filename, ffi.Pointer line, @@ -7725,7 +9124,7 @@ typedef _dart_clang_getPresumedLocation = void Function( ffi.Pointer column, ); -typedef _c_clang_getInstantiationLocation = ffi.Void Function( +typedef Native_clang_getInstantiationLocation = ffi.Void Function( CXSourceLocation location, ffi.Pointer> file, ffi.Pointer line, @@ -7741,7 +9140,7 @@ typedef _dart_clang_getInstantiationLocation = void Function( ffi.Pointer offset, ); -typedef _c_clang_getSpellingLocation = ffi.Void Function( +typedef Native_clang_getSpellingLocation = ffi.Void Function( CXSourceLocation location, ffi.Pointer> file, ffi.Pointer line, @@ -7757,7 +9156,7 @@ typedef _dart_clang_getSpellingLocation = void Function( ffi.Pointer offset, ); -typedef _c_clang_getFileLocation = ffi.Void Function( +typedef Native_clang_getFileLocation = ffi.Void Function( CXSourceLocation location, ffi.Pointer> file, ffi.Pointer line, @@ -7773,7 +9172,7 @@ typedef _dart_clang_getFileLocation = void Function( ffi.Pointer offset, ); -typedef _c_clang_getRangeStart = CXSourceLocation Function( +typedef Native_clang_getRangeStart = CXSourceLocation Function( CXSourceRange range, ); @@ -7781,7 +9180,7 @@ typedef _dart_clang_getRangeStart = CXSourceLocation Function( CXSourceRange range, ); -typedef _c_clang_getRangeEnd = CXSourceLocation Function( +typedef Native_clang_getRangeEnd = CXSourceLocation Function( CXSourceRange range, ); @@ -7789,7 +9188,7 @@ typedef _dart_clang_getRangeEnd = CXSourceLocation Function( CXSourceRange range, ); -typedef _c_clang_getSkippedRanges = ffi.Pointer Function( +typedef Native_clang_getSkippedRanges = ffi.Pointer Function( ffi.Pointer tu, ffi.Pointer file, ); @@ -7799,7 +9198,8 @@ typedef _dart_clang_getSkippedRanges = ffi.Pointer Function( ffi.Pointer file, ); -typedef _c_clang_getAllSkippedRanges = ffi.Pointer Function( +typedef Native_clang_getAllSkippedRanges = ffi.Pointer + Function( ffi.Pointer tu, ); @@ -7808,7 +9208,7 @@ typedef _dart_clang_getAllSkippedRanges = ffi.Pointer ffi.Pointer tu, ); -typedef _c_clang_disposeSourceRangeList = ffi.Void Function( +typedef Native_clang_disposeSourceRangeList = ffi.Void Function( ffi.Pointer ranges, ); @@ -7816,7 +9216,7 @@ typedef _dart_clang_disposeSourceRangeList = void Function( ffi.Pointer ranges, ); -typedef _c_clang_getNumDiagnosticsInSet = ffi.Uint32 Function( +typedef Native_clang_getNumDiagnosticsInSet = ffi.Uint32 Function( ffi.Pointer Diags, ); @@ -7824,7 +9224,7 @@ typedef _dart_clang_getNumDiagnosticsInSet = int Function( ffi.Pointer Diags, ); -typedef _c_clang_getDiagnosticInSet = ffi.Pointer Function( +typedef Native_clang_getDiagnosticInSet = ffi.Pointer Function( ffi.Pointer Diags, ffi.Uint32 Index, ); @@ -7834,7 +9234,7 @@ typedef _dart_clang_getDiagnosticInSet = ffi.Pointer Function( int Index, ); -typedef _c_clang_loadDiagnostics = ffi.Pointer Function( +typedef Native_clang_loadDiagnostics = ffi.Pointer Function( ffi.Pointer file, ffi.Pointer error, ffi.Pointer errorString, @@ -7846,7 +9246,7 @@ typedef _dart_clang_loadDiagnostics = ffi.Pointer Function( ffi.Pointer errorString, ); -typedef _c_clang_disposeDiagnosticSet = ffi.Void Function( +typedef Native_clang_disposeDiagnosticSet = ffi.Void Function( ffi.Pointer Diags, ); @@ -7854,7 +9254,7 @@ typedef _dart_clang_disposeDiagnosticSet = void Function( ffi.Pointer Diags, ); -typedef _c_clang_getChildDiagnostics = ffi.Pointer Function( +typedef Native_clang_getChildDiagnostics = ffi.Pointer Function( ffi.Pointer D, ); @@ -7862,7 +9262,7 @@ typedef _dart_clang_getChildDiagnostics = ffi.Pointer Function( ffi.Pointer D, ); -typedef _c_clang_getNumDiagnostics = ffi.Uint32 Function( +typedef Native_clang_getNumDiagnostics = ffi.Uint32 Function( ffi.Pointer Unit, ); @@ -7870,7 +9270,7 @@ typedef _dart_clang_getNumDiagnostics = int Function( ffi.Pointer Unit, ); -typedef _c_clang_getDiagnostic = ffi.Pointer Function( +typedef Native_clang_getDiagnostic = ffi.Pointer Function( ffi.Pointer Unit, ffi.Uint32 Index, ); @@ -7880,7 +9280,7 @@ typedef _dart_clang_getDiagnostic = ffi.Pointer Function( int Index, ); -typedef _c_clang_getDiagnosticSetFromTU = ffi.Pointer Function( +typedef Native_clang_getDiagnosticSetFromTU = ffi.Pointer Function( ffi.Pointer Unit, ); @@ -7888,7 +9288,7 @@ typedef _dart_clang_getDiagnosticSetFromTU = ffi.Pointer Function( ffi.Pointer Unit, ); -typedef _c_clang_disposeDiagnostic = ffi.Void Function( +typedef Native_clang_disposeDiagnostic = ffi.Void Function( ffi.Pointer Diagnostic, ); @@ -7896,7 +9296,7 @@ typedef _dart_clang_disposeDiagnostic = void Function( ffi.Pointer Diagnostic, ); -typedef _c_clang_formatDiagnostic = CXString Function( +typedef Native_clang_formatDiagnostic = CXString Function( ffi.Pointer Diagnostic, ffi.Uint32 Options, ); @@ -7906,11 +9306,11 @@ typedef _dart_clang_formatDiagnostic = CXString Function( int Options, ); -typedef _c_clang_defaultDiagnosticDisplayOptions = ffi.Uint32 Function(); +typedef Native_clang_defaultDiagnosticDisplayOptions = ffi.Uint32 Function(); typedef _dart_clang_defaultDiagnosticDisplayOptions = int Function(); -typedef _c_clang_getDiagnosticSeverity = ffi.Int32 Function( +typedef Native_clang_getDiagnosticSeverity = ffi.Int32 Function( ffi.Pointer arg0, ); @@ -7918,7 +9318,7 @@ typedef _dart_clang_getDiagnosticSeverity = int Function( ffi.Pointer arg0, ); -typedef _c_clang_getDiagnosticLocation = CXSourceLocation Function( +typedef Native_clang_getDiagnosticLocation = CXSourceLocation Function( ffi.Pointer arg0, ); @@ -7926,7 +9326,7 @@ typedef _dart_clang_getDiagnosticLocation = CXSourceLocation Function( ffi.Pointer arg0, ); -typedef _c_clang_getDiagnosticSpelling = CXString Function( +typedef Native_clang_getDiagnosticSpelling = CXString Function( ffi.Pointer arg0, ); @@ -7934,7 +9334,7 @@ typedef _dart_clang_getDiagnosticSpelling = CXString Function( ffi.Pointer arg0, ); -typedef _c_clang_getDiagnosticOption = CXString Function( +typedef Native_clang_getDiagnosticOption = CXString Function( ffi.Pointer Diag, ffi.Pointer Disable, ); @@ -7944,7 +9344,7 @@ typedef _dart_clang_getDiagnosticOption = CXString Function( ffi.Pointer Disable, ); -typedef _c_clang_getDiagnosticCategory = ffi.Uint32 Function( +typedef Native_clang_getDiagnosticCategory = ffi.Uint32 Function( ffi.Pointer arg0, ); @@ -7952,7 +9352,7 @@ typedef _dart_clang_getDiagnosticCategory = int Function( ffi.Pointer arg0, ); -typedef _c_clang_getDiagnosticCategoryName = CXString Function( +typedef Native_clang_getDiagnosticCategoryName = CXString Function( ffi.Uint32 Category, ); @@ -7960,7 +9360,7 @@ typedef _dart_clang_getDiagnosticCategoryName = CXString Function( int Category, ); -typedef _c_clang_getDiagnosticCategoryText = CXString Function( +typedef Native_clang_getDiagnosticCategoryText = CXString Function( ffi.Pointer arg0, ); @@ -7968,7 +9368,7 @@ typedef _dart_clang_getDiagnosticCategoryText = CXString Function( ffi.Pointer arg0, ); -typedef _c_clang_getDiagnosticNumRanges = ffi.Uint32 Function( +typedef Native_clang_getDiagnosticNumRanges = ffi.Uint32 Function( ffi.Pointer arg0, ); @@ -7976,7 +9376,7 @@ typedef _dart_clang_getDiagnosticNumRanges = int Function( ffi.Pointer arg0, ); -typedef _c_clang_getDiagnosticRange = CXSourceRange Function( +typedef Native_clang_getDiagnosticRange = CXSourceRange Function( ffi.Pointer Diagnostic, ffi.Uint32 Range, ); @@ -7986,7 +9386,7 @@ typedef _dart_clang_getDiagnosticRange = CXSourceRange Function( int Range, ); -typedef _c_clang_getDiagnosticNumFixIts = ffi.Uint32 Function( +typedef Native_clang_getDiagnosticNumFixIts = ffi.Uint32 Function( ffi.Pointer Diagnostic, ); @@ -7994,7 +9394,7 @@ typedef _dart_clang_getDiagnosticNumFixIts = int Function( ffi.Pointer Diagnostic, ); -typedef _c_clang_getDiagnosticFixIt = CXString Function( +typedef Native_clang_getDiagnosticFixIt = CXString Function( ffi.Pointer Diagnostic, ffi.Uint32 FixIt, ffi.Pointer ReplacementRange, @@ -8006,7 +9406,7 @@ typedef _dart_clang_getDiagnosticFixIt = CXString Function( ffi.Pointer ReplacementRange, ); -typedef _c_clang_getTranslationUnitSpelling = CXString Function( +typedef Native_clang_getTranslationUnitSpelling = CXString Function( ffi.Pointer CTUnit, ); @@ -8014,7 +9414,7 @@ typedef _dart_clang_getTranslationUnitSpelling = CXString Function( ffi.Pointer CTUnit, ); -typedef _c_clang_createTranslationUnitFromSourceFile +typedef Native_clang_createTranslationUnitFromSourceFile = ffi.Pointer Function( ffi.Pointer CIdx, ffi.Pointer source_filename, @@ -8034,7 +9434,7 @@ typedef _dart_clang_createTranslationUnitFromSourceFile ffi.Pointer unsaved_files, ); -typedef _c_clang_createTranslationUnit = ffi.Pointer +typedef Native_clang_createTranslationUnit = ffi.Pointer Function( ffi.Pointer CIdx, ffi.Pointer ast_filename, @@ -8046,7 +9446,7 @@ typedef _dart_clang_createTranslationUnit = ffi.Pointer ffi.Pointer ast_filename, ); -typedef _c_clang_createTranslationUnit2 = ffi.Int32 Function( +typedef Native_clang_createTranslationUnit2 = ffi.Int32 Function( ffi.Pointer CIdx, ffi.Pointer ast_filename, ffi.Pointer> out_TU, @@ -8058,11 +9458,12 @@ typedef _dart_clang_createTranslationUnit2 = int Function( ffi.Pointer> out_TU, ); -typedef _c_clang_defaultEditingTranslationUnitOptions = ffi.Uint32 Function(); +typedef Native_clang_defaultEditingTranslationUnitOptions = ffi.Uint32 + Function(); typedef _dart_clang_defaultEditingTranslationUnitOptions = int Function(); -typedef _c_clang_parseTranslationUnit = ffi.Pointer +typedef Native_clang_parseTranslationUnit = ffi.Pointer Function( ffi.Pointer CIdx, ffi.Pointer source_filename, @@ -8084,7 +9485,7 @@ typedef _dart_clang_parseTranslationUnit = ffi.Pointer int options, ); -typedef _c_clang_parseTranslationUnit2 = ffi.Int32 Function( +typedef Native_clang_parseTranslationUnit2 = ffi.Int32 Function( ffi.Pointer CIdx, ffi.Pointer source_filename, ffi.Pointer> command_line_args, @@ -8106,7 +9507,7 @@ typedef _dart_clang_parseTranslationUnit2 = int Function( ffi.Pointer> out_TU, ); -typedef _c_clang_parseTranslationUnit2FullArgv = ffi.Int32 Function( +typedef Native_clang_parseTranslationUnit2FullArgv = ffi.Int32 Function( ffi.Pointer CIdx, ffi.Pointer source_filename, ffi.Pointer> command_line_args, @@ -8128,7 +9529,7 @@ typedef _dart_clang_parseTranslationUnit2FullArgv = int Function( ffi.Pointer> out_TU, ); -typedef _c_clang_defaultSaveOptions = ffi.Uint32 Function( +typedef Native_clang_defaultSaveOptions = ffi.Uint32 Function( ffi.Pointer TU, ); @@ -8136,7 +9537,7 @@ typedef _dart_clang_defaultSaveOptions = int Function( ffi.Pointer TU, ); -typedef _c_clang_saveTranslationUnit = ffi.Int32 Function( +typedef Native_clang_saveTranslationUnit = ffi.Int32 Function( ffi.Pointer TU, ffi.Pointer FileName, ffi.Uint32 options, @@ -8148,7 +9549,7 @@ typedef _dart_clang_saveTranslationUnit = int Function( int options, ); -typedef _c_clang_suspendTranslationUnit = ffi.Uint32 Function( +typedef Native_clang_suspendTranslationUnit = ffi.Uint32 Function( ffi.Pointer arg0, ); @@ -8156,7 +9557,7 @@ typedef _dart_clang_suspendTranslationUnit = int Function( ffi.Pointer arg0, ); -typedef _c_clang_disposeTranslationUnit = ffi.Void Function( +typedef Native_clang_disposeTranslationUnit = ffi.Void Function( ffi.Pointer arg0, ); @@ -8164,7 +9565,7 @@ typedef _dart_clang_disposeTranslationUnit = void Function( ffi.Pointer arg0, ); -typedef _c_clang_defaultReparseOptions = ffi.Uint32 Function( +typedef Native_clang_defaultReparseOptions = ffi.Uint32 Function( ffi.Pointer TU, ); @@ -8172,7 +9573,7 @@ typedef _dart_clang_defaultReparseOptions = int Function( ffi.Pointer TU, ); -typedef _c_clang_reparseTranslationUnit = ffi.Int32 Function( +typedef Native_clang_reparseTranslationUnit = ffi.Int32 Function( ffi.Pointer TU, ffi.Uint32 num_unsaved_files, ffi.Pointer unsaved_files, @@ -8186,7 +9587,7 @@ typedef _dart_clang_reparseTranslationUnit = int Function( int options, ); -typedef _c_clang_getTUResourceUsageName = ffi.Pointer Function( +typedef Native_clang_getTUResourceUsageName = ffi.Pointer Function( ffi.Int32 kind, ); @@ -8194,7 +9595,7 @@ typedef _dart_clang_getTUResourceUsageName = ffi.Pointer Function( int kind, ); -typedef _c_clang_getCXTUResourceUsage = CXTUResourceUsage Function( +typedef Native_clang_getCXTUResourceUsage = CXTUResourceUsage Function( ffi.Pointer TU, ); @@ -8202,7 +9603,7 @@ typedef _dart_clang_getCXTUResourceUsage = CXTUResourceUsage Function( ffi.Pointer TU, ); -typedef _c_clang_disposeCXTUResourceUsage = ffi.Void Function( +typedef Native_clang_disposeCXTUResourceUsage = ffi.Void Function( CXTUResourceUsage usage, ); @@ -8210,8 +9611,8 @@ typedef _dart_clang_disposeCXTUResourceUsage = void Function( CXTUResourceUsage usage, ); -typedef _c_clang_getTranslationUnitTargetInfo = ffi.Pointer - Function( +typedef Native_clang_getTranslationUnitTargetInfo + = ffi.Pointer Function( ffi.Pointer CTUnit, ); @@ -8220,7 +9621,7 @@ typedef _dart_clang_getTranslationUnitTargetInfo = ffi.Pointer ffi.Pointer CTUnit, ); -typedef _c_clang_TargetInfo_dispose = ffi.Void Function( +typedef Native_clang_TargetInfo_dispose = ffi.Void Function( ffi.Pointer Info, ); @@ -8228,7 +9629,7 @@ typedef _dart_clang_TargetInfo_dispose = void Function( ffi.Pointer Info, ); -typedef _c_clang_TargetInfo_getTriple = CXString Function( +typedef Native_clang_TargetInfo_getTriple = CXString Function( ffi.Pointer Info, ); @@ -8236,7 +9637,7 @@ typedef _dart_clang_TargetInfo_getTriple = CXString Function( ffi.Pointer Info, ); -typedef _c_clang_TargetInfo_getPointerWidth = ffi.Int32 Function( +typedef Native_clang_TargetInfo_getPointerWidth = ffi.Int32 Function( ffi.Pointer Info, ); @@ -8244,11 +9645,11 @@ typedef _dart_clang_TargetInfo_getPointerWidth = int Function( ffi.Pointer Info, ); -typedef _c_clang_getNullCursor = CXCursor Function(); +typedef Native_clang_getNullCursor = CXCursor Function(); typedef _dart_clang_getNullCursor = CXCursor Function(); -typedef _c_clang_getTranslationUnitCursor = CXCursor Function( +typedef Native_clang_getTranslationUnitCursor = CXCursor Function( ffi.Pointer arg0, ); @@ -8256,7 +9657,7 @@ typedef _dart_clang_getTranslationUnitCursor = CXCursor Function( ffi.Pointer arg0, ); -typedef _c_clang_equalCursors = ffi.Uint32 Function( +typedef Native_clang_equalCursors = ffi.Uint32 Function( CXCursor arg0, CXCursor arg1, ); @@ -8266,7 +9667,7 @@ typedef _dart_clang_equalCursors = int Function( CXCursor arg1, ); -typedef _c_clang_Cursor_isNull = ffi.Int32 Function( +typedef Native_clang_Cursor_isNull = ffi.Int32 Function( CXCursor cursor, ); @@ -8274,7 +9675,7 @@ typedef _dart_clang_Cursor_isNull = int Function( CXCursor cursor, ); -typedef _c_clang_hashCursor = ffi.Uint32 Function( +typedef Native_clang_hashCursor = ffi.Uint32 Function( CXCursor arg0, ); @@ -8282,7 +9683,7 @@ typedef _dart_clang_hashCursor = int Function( CXCursor arg0, ); -typedef _c_clang_getCursorKind = ffi.Int32 Function( +typedef Native_clang_getCursorKind = ffi.Int32 Function( CXCursor arg0, ); @@ -8290,7 +9691,7 @@ typedef _dart_clang_getCursorKind = int Function( CXCursor arg0, ); -typedef _c_clang_isDeclaration = ffi.Uint32 Function( +typedef Native_clang_isDeclaration = ffi.Uint32 Function( ffi.Int32 arg0, ); @@ -8298,7 +9699,7 @@ typedef _dart_clang_isDeclaration = int Function( int arg0, ); -typedef _c_clang_isInvalidDeclaration = ffi.Uint32 Function( +typedef Native_clang_isInvalidDeclaration = ffi.Uint32 Function( CXCursor arg0, ); @@ -8306,7 +9707,7 @@ typedef _dart_clang_isInvalidDeclaration = int Function( CXCursor arg0, ); -typedef _c_clang_isReference = ffi.Uint32 Function( +typedef Native_clang_isReference = ffi.Uint32 Function( ffi.Int32 arg0, ); @@ -8314,7 +9715,7 @@ typedef _dart_clang_isReference = int Function( int arg0, ); -typedef _c_clang_isExpression = ffi.Uint32 Function( +typedef Native_clang_isExpression = ffi.Uint32 Function( ffi.Int32 arg0, ); @@ -8322,7 +9723,7 @@ typedef _dart_clang_isExpression = int Function( int arg0, ); -typedef _c_clang_isStatement = ffi.Uint32 Function( +typedef Native_clang_isStatement = ffi.Uint32 Function( ffi.Int32 arg0, ); @@ -8330,7 +9731,7 @@ typedef _dart_clang_isStatement = int Function( int arg0, ); -typedef _c_clang_isAttribute = ffi.Uint32 Function( +typedef Native_clang_isAttribute = ffi.Uint32 Function( ffi.Int32 arg0, ); @@ -8338,7 +9739,7 @@ typedef _dart_clang_isAttribute = int Function( int arg0, ); -typedef _c_clang_Cursor_hasAttrs = ffi.Uint32 Function( +typedef Native_clang_Cursor_hasAttrs = ffi.Uint32 Function( CXCursor C, ); @@ -8346,7 +9747,7 @@ typedef _dart_clang_Cursor_hasAttrs = int Function( CXCursor C, ); -typedef _c_clang_isInvalid = ffi.Uint32 Function( +typedef Native_clang_isInvalid = ffi.Uint32 Function( ffi.Int32 arg0, ); @@ -8354,7 +9755,7 @@ typedef _dart_clang_isInvalid = int Function( int arg0, ); -typedef _c_clang_isTranslationUnit = ffi.Uint32 Function( +typedef Native_clang_isTranslationUnit = ffi.Uint32 Function( ffi.Int32 arg0, ); @@ -8362,7 +9763,7 @@ typedef _dart_clang_isTranslationUnit = int Function( int arg0, ); -typedef _c_clang_isPreprocessing = ffi.Uint32 Function( +typedef Native_clang_isPreprocessing = ffi.Uint32 Function( ffi.Int32 arg0, ); @@ -8370,7 +9771,7 @@ typedef _dart_clang_isPreprocessing = int Function( int arg0, ); -typedef _c_clang_isUnexposed = ffi.Uint32 Function( +typedef Native_clang_isUnexposed = ffi.Uint32 Function( ffi.Int32 arg0, ); @@ -8378,7 +9779,7 @@ typedef _dart_clang_isUnexposed = int Function( int arg0, ); -typedef _c_clang_getCursorLinkage = ffi.Int32 Function( +typedef Native_clang_getCursorLinkage = ffi.Int32 Function( CXCursor cursor, ); @@ -8386,7 +9787,7 @@ typedef _dart_clang_getCursorLinkage = int Function( CXCursor cursor, ); -typedef _c_clang_getCursorVisibility = ffi.Int32 Function( +typedef Native_clang_getCursorVisibility = ffi.Int32 Function( CXCursor cursor, ); @@ -8394,7 +9795,7 @@ typedef _dart_clang_getCursorVisibility = int Function( CXCursor cursor, ); -typedef _c_clang_getCursorAvailability = ffi.Int32 Function( +typedef Native_clang_getCursorAvailability = ffi.Int32 Function( CXCursor cursor, ); @@ -8402,7 +9803,7 @@ typedef _dart_clang_getCursorAvailability = int Function( CXCursor cursor, ); -typedef _c_clang_getCursorPlatformAvailability = ffi.Int32 Function( +typedef Native_clang_getCursorPlatformAvailability = ffi.Int32 Function( CXCursor cursor, ffi.Pointer always_deprecated, ffi.Pointer deprecated_message, @@ -8422,7 +9823,7 @@ typedef _dart_clang_getCursorPlatformAvailability = int Function( int availability_size, ); -typedef _c_clang_disposeCXPlatformAvailability = ffi.Void Function( +typedef Native_clang_disposeCXPlatformAvailability = ffi.Void Function( ffi.Pointer availability, ); @@ -8430,7 +9831,7 @@ typedef _dart_clang_disposeCXPlatformAvailability = void Function( ffi.Pointer availability, ); -typedef _c_clang_getCursorLanguage = ffi.Int32 Function( +typedef Native_clang_getCursorLanguage = ffi.Int32 Function( CXCursor cursor, ); @@ -8438,7 +9839,7 @@ typedef _dart_clang_getCursorLanguage = int Function( CXCursor cursor, ); -typedef _c_clang_getCursorTLSKind = ffi.Int32 Function( +typedef Native_clang_getCursorTLSKind = ffi.Int32 Function( CXCursor cursor, ); @@ -8446,8 +9847,8 @@ typedef _dart_clang_getCursorTLSKind = int Function( CXCursor cursor, ); -typedef _c_clang_Cursor_getTranslationUnit = ffi.Pointer - Function( +typedef Native_clang_Cursor_getTranslationUnit + = ffi.Pointer Function( CXCursor arg0, ); @@ -8456,11 +9857,12 @@ typedef _dart_clang_Cursor_getTranslationUnit CXCursor arg0, ); -typedef _c_clang_createCXCursorSet = ffi.Pointer Function(); +typedef Native_clang_createCXCursorSet = ffi.Pointer + Function(); typedef _dart_clang_createCXCursorSet = ffi.Pointer Function(); -typedef _c_clang_disposeCXCursorSet = ffi.Void Function( +typedef Native_clang_disposeCXCursorSet = ffi.Void Function( ffi.Pointer cset, ); @@ -8468,7 +9870,7 @@ typedef _dart_clang_disposeCXCursorSet = void Function( ffi.Pointer cset, ); -typedef _c_clang_CXCursorSet_contains = ffi.Uint32 Function( +typedef Native_clang_CXCursorSet_contains = ffi.Uint32 Function( ffi.Pointer cset, CXCursor cursor, ); @@ -8478,7 +9880,7 @@ typedef _dart_clang_CXCursorSet_contains = int Function( CXCursor cursor, ); -typedef _c_clang_CXCursorSet_insert = ffi.Uint32 Function( +typedef Native_clang_CXCursorSet_insert = ffi.Uint32 Function( ffi.Pointer cset, CXCursor cursor, ); @@ -8488,7 +9890,7 @@ typedef _dart_clang_CXCursorSet_insert = int Function( CXCursor cursor, ); -typedef _c_clang_getCursorSemanticParent = CXCursor Function( +typedef Native_clang_getCursorSemanticParent = CXCursor Function( CXCursor cursor, ); @@ -8496,7 +9898,7 @@ typedef _dart_clang_getCursorSemanticParent = CXCursor Function( CXCursor cursor, ); -typedef _c_clang_getCursorLexicalParent = CXCursor Function( +typedef Native_clang_getCursorLexicalParent = CXCursor Function( CXCursor cursor, ); @@ -8504,7 +9906,7 @@ typedef _dart_clang_getCursorLexicalParent = CXCursor Function( CXCursor cursor, ); -typedef _c_clang_getOverriddenCursors = ffi.Void Function( +typedef Native_clang_getOverriddenCursors = ffi.Void Function( CXCursor cursor, ffi.Pointer> overridden, ffi.Pointer num_overridden, @@ -8516,7 +9918,7 @@ typedef _dart_clang_getOverriddenCursors = void Function( ffi.Pointer num_overridden, ); -typedef _c_clang_disposeOverriddenCursors = ffi.Void Function( +typedef Native_clang_disposeOverriddenCursors = ffi.Void Function( ffi.Pointer overridden, ); @@ -8524,7 +9926,7 @@ typedef _dart_clang_disposeOverriddenCursors = void Function( ffi.Pointer overridden, ); -typedef _c_clang_getIncludedFile = ffi.Pointer Function( +typedef Native_clang_getIncludedFile = ffi.Pointer Function( CXCursor cursor, ); @@ -8532,7 +9934,7 @@ typedef _dart_clang_getIncludedFile = ffi.Pointer Function( CXCursor cursor, ); -typedef _c_clang_getCursor = CXCursor Function( +typedef Native_clang_getCursor = CXCursor Function( ffi.Pointer arg0, CXSourceLocation arg1, ); @@ -8542,7 +9944,7 @@ typedef _dart_clang_getCursor = CXCursor Function( CXSourceLocation arg1, ); -typedef _c_clang_getCursorLocation = CXSourceLocation Function( +typedef Native_clang_getCursorLocation = CXSourceLocation Function( CXCursor arg0, ); @@ -8550,7 +9952,7 @@ typedef _dart_clang_getCursorLocation = CXSourceLocation Function( CXCursor arg0, ); -typedef _c_clang_getCursorExtent = CXSourceRange Function( +typedef Native_clang_getCursorExtent = CXSourceRange Function( CXCursor arg0, ); @@ -8558,7 +9960,7 @@ typedef _dart_clang_getCursorExtent = CXSourceRange Function( CXCursor arg0, ); -typedef _c_clang_getCursorType = CXType Function( +typedef Native_clang_getCursorType = CXType Function( CXCursor C, ); @@ -8566,7 +9968,7 @@ typedef _dart_clang_getCursorType = CXType Function( CXCursor C, ); -typedef _c_clang_getTypeSpelling = CXString Function( +typedef Native_clang_getTypeSpelling = CXString Function( CXType CT, ); @@ -8574,7 +9976,7 @@ typedef _dart_clang_getTypeSpelling = CXString Function( CXType CT, ); -typedef _c_clang_getTypedefDeclUnderlyingType = CXType Function( +typedef Native_clang_getTypedefDeclUnderlyingType = CXType Function( CXCursor C, ); @@ -8582,7 +9984,7 @@ typedef _dart_clang_getTypedefDeclUnderlyingType = CXType Function( CXCursor C, ); -typedef _c_clang_getEnumDeclIntegerType = CXType Function( +typedef Native_clang_getEnumDeclIntegerType = CXType Function( CXCursor C, ); @@ -8590,7 +9992,7 @@ typedef _dart_clang_getEnumDeclIntegerType = CXType Function( CXCursor C, ); -typedef _c_clang_getEnumConstantDeclValue = ffi.Int64 Function( +typedef Native_clang_getEnumConstantDeclValue = ffi.Int64 Function( CXCursor C, ); @@ -8598,7 +10000,7 @@ typedef _dart_clang_getEnumConstantDeclValue = int Function( CXCursor C, ); -typedef _c_clang_getEnumConstantDeclUnsignedValue = ffi.Uint64 Function( +typedef Native_clang_getEnumConstantDeclUnsignedValue = ffi.Uint64 Function( CXCursor C, ); @@ -8606,7 +10008,7 @@ typedef _dart_clang_getEnumConstantDeclUnsignedValue = int Function( CXCursor C, ); -typedef _c_clang_getFieldDeclBitWidth = ffi.Int32 Function( +typedef Native_clang_getFieldDeclBitWidth = ffi.Int32 Function( CXCursor C, ); @@ -8614,7 +10016,7 @@ typedef _dart_clang_getFieldDeclBitWidth = int Function( CXCursor C, ); -typedef _c_clang_Cursor_getNumArguments = ffi.Int32 Function( +typedef Native_clang_Cursor_getNumArguments = ffi.Int32 Function( CXCursor C, ); @@ -8622,7 +10024,7 @@ typedef _dart_clang_Cursor_getNumArguments = int Function( CXCursor C, ); -typedef _c_clang_Cursor_getArgument = CXCursor Function( +typedef Native_clang_Cursor_getArgument = CXCursor Function( CXCursor C, ffi.Uint32 i, ); @@ -8632,7 +10034,7 @@ typedef _dart_clang_Cursor_getArgument = CXCursor Function( int i, ); -typedef _c_clang_Cursor_getNumTemplateArguments = ffi.Int32 Function( +typedef Native_clang_Cursor_getNumTemplateArguments = ffi.Int32 Function( CXCursor C, ); @@ -8640,7 +10042,7 @@ typedef _dart_clang_Cursor_getNumTemplateArguments = int Function( CXCursor C, ); -typedef _c_clang_Cursor_getTemplateArgumentKind = ffi.Int32 Function( +typedef Native_clang_Cursor_getTemplateArgumentKind = ffi.Int32 Function( CXCursor C, ffi.Uint32 I, ); @@ -8650,7 +10052,7 @@ typedef _dart_clang_Cursor_getTemplateArgumentKind = int Function( int I, ); -typedef _c_clang_Cursor_getTemplateArgumentType = CXType Function( +typedef Native_clang_Cursor_getTemplateArgumentType = CXType Function( CXCursor C, ffi.Uint32 I, ); @@ -8660,7 +10062,7 @@ typedef _dart_clang_Cursor_getTemplateArgumentType = CXType Function( int I, ); -typedef _c_clang_Cursor_getTemplateArgumentValue = ffi.Int64 Function( +typedef Native_clang_Cursor_getTemplateArgumentValue = ffi.Int64 Function( CXCursor C, ffi.Uint32 I, ); @@ -8670,7 +10072,8 @@ typedef _dart_clang_Cursor_getTemplateArgumentValue = int Function( int I, ); -typedef _c_clang_Cursor_getTemplateArgumentUnsignedValue = ffi.Uint64 Function( +typedef Native_clang_Cursor_getTemplateArgumentUnsignedValue = ffi.Uint64 + Function( CXCursor C, ffi.Uint32 I, ); @@ -8680,7 +10083,7 @@ typedef _dart_clang_Cursor_getTemplateArgumentUnsignedValue = int Function( int I, ); -typedef _c_clang_equalTypes = ffi.Uint32 Function( +typedef Native_clang_equalTypes = ffi.Uint32 Function( CXType A, CXType B, ); @@ -8690,7 +10093,7 @@ typedef _dart_clang_equalTypes = int Function( CXType B, ); -typedef _c_clang_getCanonicalType = CXType Function( +typedef Native_clang_getCanonicalType = CXType Function( CXType T, ); @@ -8698,7 +10101,7 @@ typedef _dart_clang_getCanonicalType = CXType Function( CXType T, ); -typedef _c_clang_isConstQualifiedType = ffi.Uint32 Function( +typedef Native_clang_isConstQualifiedType = ffi.Uint32 Function( CXType T, ); @@ -8706,7 +10109,7 @@ typedef _dart_clang_isConstQualifiedType = int Function( CXType T, ); -typedef _c_clang_Cursor_isMacroFunctionLike = ffi.Uint32 Function( +typedef Native_clang_Cursor_isMacroFunctionLike = ffi.Uint32 Function( CXCursor C, ); @@ -8714,7 +10117,7 @@ typedef _dart_clang_Cursor_isMacroFunctionLike = int Function( CXCursor C, ); -typedef _c_clang_Cursor_isMacroBuiltin = ffi.Uint32 Function( +typedef Native_clang_Cursor_isMacroBuiltin = ffi.Uint32 Function( CXCursor C, ); @@ -8722,7 +10125,7 @@ typedef _dart_clang_Cursor_isMacroBuiltin = int Function( CXCursor C, ); -typedef _c_clang_Cursor_isFunctionInlined = ffi.Uint32 Function( +typedef Native_clang_Cursor_isFunctionInlined = ffi.Uint32 Function( CXCursor C, ); @@ -8730,7 +10133,7 @@ typedef _dart_clang_Cursor_isFunctionInlined = int Function( CXCursor C, ); -typedef _c_clang_isVolatileQualifiedType = ffi.Uint32 Function( +typedef Native_clang_isVolatileQualifiedType = ffi.Uint32 Function( CXType T, ); @@ -8738,7 +10141,7 @@ typedef _dart_clang_isVolatileQualifiedType = int Function( CXType T, ); -typedef _c_clang_isRestrictQualifiedType = ffi.Uint32 Function( +typedef Native_clang_isRestrictQualifiedType = ffi.Uint32 Function( CXType T, ); @@ -8746,7 +10149,7 @@ typedef _dart_clang_isRestrictQualifiedType = int Function( CXType T, ); -typedef _c_clang_getAddressSpace = ffi.Uint32 Function( +typedef Native_clang_getAddressSpace = ffi.Uint32 Function( CXType T, ); @@ -8754,7 +10157,7 @@ typedef _dart_clang_getAddressSpace = int Function( CXType T, ); -typedef _c_clang_getTypedefName = CXString Function( +typedef Native_clang_getTypedefName = CXString Function( CXType CT, ); @@ -8762,7 +10165,7 @@ typedef _dart_clang_getTypedefName = CXString Function( CXType CT, ); -typedef _c_clang_getPointeeType = CXType Function( +typedef Native_clang_getPointeeType = CXType Function( CXType T, ); @@ -8770,7 +10173,7 @@ typedef _dart_clang_getPointeeType = CXType Function( CXType T, ); -typedef _c_clang_getTypeDeclaration = CXCursor Function( +typedef Native_clang_getTypeDeclaration = CXCursor Function( CXType T, ); @@ -8778,7 +10181,7 @@ typedef _dart_clang_getTypeDeclaration = CXCursor Function( CXType T, ); -typedef _c_clang_getDeclObjCTypeEncoding = CXString Function( +typedef Native_clang_getDeclObjCTypeEncoding = CXString Function( CXCursor C, ); @@ -8786,7 +10189,7 @@ typedef _dart_clang_getDeclObjCTypeEncoding = CXString Function( CXCursor C, ); -typedef _c_clang_Type_getObjCEncoding = CXString Function( +typedef Native_clang_Type_getObjCEncoding = CXString Function( CXType type, ); @@ -8794,7 +10197,7 @@ typedef _dart_clang_Type_getObjCEncoding = CXString Function( CXType type, ); -typedef _c_clang_getTypeKindSpelling = CXString Function( +typedef Native_clang_getTypeKindSpelling = CXString Function( ffi.Int32 K, ); @@ -8802,7 +10205,7 @@ typedef _dart_clang_getTypeKindSpelling = CXString Function( int K, ); -typedef _c_clang_getFunctionTypeCallingConv = ffi.Int32 Function( +typedef Native_clang_getFunctionTypeCallingConv = ffi.Int32 Function( CXType T, ); @@ -8810,7 +10213,7 @@ typedef _dart_clang_getFunctionTypeCallingConv = int Function( CXType T, ); -typedef _c_clang_getResultType = CXType Function( +typedef Native_clang_getResultType = CXType Function( CXType T, ); @@ -8818,7 +10221,7 @@ typedef _dart_clang_getResultType = CXType Function( CXType T, ); -typedef _c_clang_getExceptionSpecificationType = ffi.Int32 Function( +typedef Native_clang_getExceptionSpecificationType = ffi.Int32 Function( CXType T, ); @@ -8826,7 +10229,7 @@ typedef _dart_clang_getExceptionSpecificationType = int Function( CXType T, ); -typedef _c_clang_getNumArgTypes = ffi.Int32 Function( +typedef Native_clang_getNumArgTypes = ffi.Int32 Function( CXType T, ); @@ -8834,7 +10237,7 @@ typedef _dart_clang_getNumArgTypes = int Function( CXType T, ); -typedef _c_clang_getArgType = CXType Function( +typedef Native_clang_getArgType = CXType Function( CXType T, ffi.Uint32 i, ); @@ -8844,7 +10247,7 @@ typedef _dart_clang_getArgType = CXType Function( int i, ); -typedef _c_clang_Type_getObjCObjectBaseType = CXType Function( +typedef Native_clang_Type_getObjCObjectBaseType = CXType Function( CXType T, ); @@ -8852,7 +10255,7 @@ typedef _dart_clang_Type_getObjCObjectBaseType = CXType Function( CXType T, ); -typedef _c_clang_Type_getNumObjCProtocolRefs = ffi.Uint32 Function( +typedef Native_clang_Type_getNumObjCProtocolRefs = ffi.Uint32 Function( CXType T, ); @@ -8860,7 +10263,7 @@ typedef _dart_clang_Type_getNumObjCProtocolRefs = int Function( CXType T, ); -typedef _c_clang_Type_getObjCProtocolDecl = CXCursor Function( +typedef Native_clang_Type_getObjCProtocolDecl = CXCursor Function( CXType T, ffi.Uint32 i, ); @@ -8870,7 +10273,7 @@ typedef _dart_clang_Type_getObjCProtocolDecl = CXCursor Function( int i, ); -typedef _c_clang_Type_getNumObjCTypeArgs = ffi.Uint32 Function( +typedef Native_clang_Type_getNumObjCTypeArgs = ffi.Uint32 Function( CXType T, ); @@ -8878,7 +10281,7 @@ typedef _dart_clang_Type_getNumObjCTypeArgs = int Function( CXType T, ); -typedef _c_clang_Type_getObjCTypeArg = CXType Function( +typedef Native_clang_Type_getObjCTypeArg = CXType Function( CXType T, ffi.Uint32 i, ); @@ -8888,7 +10291,7 @@ typedef _dart_clang_Type_getObjCTypeArg = CXType Function( int i, ); -typedef _c_clang_isFunctionTypeVariadic = ffi.Uint32 Function( +typedef Native_clang_isFunctionTypeVariadic = ffi.Uint32 Function( CXType T, ); @@ -8896,7 +10299,7 @@ typedef _dart_clang_isFunctionTypeVariadic = int Function( CXType T, ); -typedef _c_clang_getCursorResultType = CXType Function( +typedef Native_clang_getCursorResultType = CXType Function( CXCursor C, ); @@ -8904,7 +10307,7 @@ typedef _dart_clang_getCursorResultType = CXType Function( CXCursor C, ); -typedef _c_clang_getCursorExceptionSpecificationType = ffi.Int32 Function( +typedef Native_clang_getCursorExceptionSpecificationType = ffi.Int32 Function( CXCursor C, ); @@ -8912,7 +10315,7 @@ typedef _dart_clang_getCursorExceptionSpecificationType = int Function( CXCursor C, ); -typedef _c_clang_isPODType = ffi.Uint32 Function( +typedef Native_clang_isPODType = ffi.Uint32 Function( CXType T, ); @@ -8920,7 +10323,7 @@ typedef _dart_clang_isPODType = int Function( CXType T, ); -typedef _c_clang_getElementType = CXType Function( +typedef Native_clang_getElementType = CXType Function( CXType T, ); @@ -8928,7 +10331,7 @@ typedef _dart_clang_getElementType = CXType Function( CXType T, ); -typedef _c_clang_getNumElements = ffi.Int64 Function( +typedef Native_clang_getNumElements = ffi.Int64 Function( CXType T, ); @@ -8936,7 +10339,7 @@ typedef _dart_clang_getNumElements = int Function( CXType T, ); -typedef _c_clang_getArrayElementType = CXType Function( +typedef Native_clang_getArrayElementType = CXType Function( CXType T, ); @@ -8944,7 +10347,7 @@ typedef _dart_clang_getArrayElementType = CXType Function( CXType T, ); -typedef _c_clang_getArraySize = ffi.Int64 Function( +typedef Native_clang_getArraySize = ffi.Int64 Function( CXType T, ); @@ -8952,7 +10355,7 @@ typedef _dart_clang_getArraySize = int Function( CXType T, ); -typedef _c_clang_Type_getNamedType = CXType Function( +typedef Native_clang_Type_getNamedType = CXType Function( CXType T, ); @@ -8960,7 +10363,7 @@ typedef _dart_clang_Type_getNamedType = CXType Function( CXType T, ); -typedef _c_clang_Type_isTransparentTagTypedef = ffi.Uint32 Function( +typedef Native_clang_Type_isTransparentTagTypedef = ffi.Uint32 Function( CXType T, ); @@ -8968,7 +10371,7 @@ typedef _dart_clang_Type_isTransparentTagTypedef = int Function( CXType T, ); -typedef _c_clang_Type_getNullability = ffi.Int32 Function( +typedef Native_clang_Type_getNullability = ffi.Int32 Function( CXType T, ); @@ -8976,7 +10379,7 @@ typedef _dart_clang_Type_getNullability = int Function( CXType T, ); -typedef _c_clang_Type_getAlignOf = ffi.Int64 Function( +typedef Native_clang_Type_getAlignOf = ffi.Int64 Function( CXType T, ); @@ -8984,7 +10387,7 @@ typedef _dart_clang_Type_getAlignOf = int Function( CXType T, ); -typedef _c_clang_Type_getClassType = CXType Function( +typedef Native_clang_Type_getClassType = CXType Function( CXType T, ); @@ -8992,7 +10395,7 @@ typedef _dart_clang_Type_getClassType = CXType Function( CXType T, ); -typedef _c_clang_Type_getSizeOf = ffi.Int64 Function( +typedef Native_clang_Type_getSizeOf = ffi.Int64 Function( CXType T, ); @@ -9000,7 +10403,7 @@ typedef _dart_clang_Type_getSizeOf = int Function( CXType T, ); -typedef _c_clang_Type_getOffsetOf = ffi.Int64 Function( +typedef Native_clang_Type_getOffsetOf = ffi.Int64 Function( CXType T, ffi.Pointer S, ); @@ -9010,7 +10413,7 @@ typedef _dart_clang_Type_getOffsetOf = int Function( ffi.Pointer S, ); -typedef _c_clang_Type_getModifiedType = CXType Function( +typedef Native_clang_Type_getModifiedType = CXType Function( CXType T, ); @@ -9018,7 +10421,7 @@ typedef _dart_clang_Type_getModifiedType = CXType Function( CXType T, ); -typedef _c_clang_Cursor_getOffsetOfField = ffi.Int64 Function( +typedef Native_clang_Cursor_getOffsetOfField = ffi.Int64 Function( CXCursor C, ); @@ -9026,7 +10429,7 @@ typedef _dart_clang_Cursor_getOffsetOfField = int Function( CXCursor C, ); -typedef _c_clang_Cursor_isAnonymous = ffi.Uint32 Function( +typedef Native_clang_Cursor_isAnonymous = ffi.Uint32 Function( CXCursor C, ); @@ -9034,7 +10437,7 @@ typedef _dart_clang_Cursor_isAnonymous = int Function( CXCursor C, ); -typedef _c_clang_Cursor_isAnonymousRecordDecl = ffi.Uint32 Function( +typedef Native_clang_Cursor_isAnonymousRecordDecl = ffi.Uint32 Function( CXCursor C, ); @@ -9042,7 +10445,7 @@ typedef _dart_clang_Cursor_isAnonymousRecordDecl = int Function( CXCursor C, ); -typedef _c_clang_Cursor_isInlineNamespace = ffi.Uint32 Function( +typedef Native_clang_Cursor_isInlineNamespace = ffi.Uint32 Function( CXCursor C, ); @@ -9050,7 +10453,7 @@ typedef _dart_clang_Cursor_isInlineNamespace = int Function( CXCursor C, ); -typedef _c_clang_Type_getNumTemplateArguments = ffi.Int32 Function( +typedef Native_clang_Type_getNumTemplateArguments = ffi.Int32 Function( CXType T, ); @@ -9058,7 +10461,7 @@ typedef _dart_clang_Type_getNumTemplateArguments = int Function( CXType T, ); -typedef _c_clang_Type_getTemplateArgumentAsType = CXType Function( +typedef Native_clang_Type_getTemplateArgumentAsType = CXType Function( CXType T, ffi.Uint32 i, ); @@ -9068,7 +10471,7 @@ typedef _dart_clang_Type_getTemplateArgumentAsType = CXType Function( int i, ); -typedef _c_clang_Type_getCXXRefQualifier = ffi.Int32 Function( +typedef Native_clang_Type_getCXXRefQualifier = ffi.Int32 Function( CXType T, ); @@ -9076,7 +10479,7 @@ typedef _dart_clang_Type_getCXXRefQualifier = int Function( CXType T, ); -typedef _c_clang_Cursor_isBitField = ffi.Uint32 Function( +typedef Native_clang_Cursor_isBitField = ffi.Uint32 Function( CXCursor C, ); @@ -9084,7 +10487,7 @@ typedef _dart_clang_Cursor_isBitField = int Function( CXCursor C, ); -typedef _c_clang_isVirtualBase = ffi.Uint32 Function( +typedef Native_clang_isVirtualBase = ffi.Uint32 Function( CXCursor arg0, ); @@ -9092,7 +10495,7 @@ typedef _dart_clang_isVirtualBase = int Function( CXCursor arg0, ); -typedef _c_clang_getCXXAccessSpecifier = ffi.Int32 Function( +typedef Native_clang_getCXXAccessSpecifier = ffi.Int32 Function( CXCursor arg0, ); @@ -9100,7 +10503,7 @@ typedef _dart_clang_getCXXAccessSpecifier = int Function( CXCursor arg0, ); -typedef _c_clang_Cursor_getStorageClass = ffi.Int32 Function( +typedef Native_clang_Cursor_getStorageClass = ffi.Int32 Function( CXCursor arg0, ); @@ -9108,7 +10511,7 @@ typedef _dart_clang_Cursor_getStorageClass = int Function( CXCursor arg0, ); -typedef _c_clang_getNumOverloadedDecls = ffi.Uint32 Function( +typedef Native_clang_getNumOverloadedDecls = ffi.Uint32 Function( CXCursor cursor, ); @@ -9116,7 +10519,7 @@ typedef _dart_clang_getNumOverloadedDecls = int Function( CXCursor cursor, ); -typedef _c_clang_getOverloadedDecl = CXCursor Function( +typedef Native_clang_getOverloadedDecl = CXCursor Function( CXCursor cursor, ffi.Uint32 index, ); @@ -9126,7 +10529,7 @@ typedef _dart_clang_getOverloadedDecl = CXCursor Function( int index, ); -typedef _c_clang_getIBOutletCollectionType = CXType Function( +typedef Native_clang_getIBOutletCollectionType = CXType Function( CXCursor arg0, ); @@ -9140,7 +10543,7 @@ typedef CXCursorVisitor = ffi.Int32 Function( ffi.Pointer, ); -typedef _c_clang_visitChildren = ffi.Uint32 Function( +typedef Native_clang_visitChildren = ffi.Uint32 Function( CXCursor parent, ffi.Pointer> visitor, ffi.Pointer client_data, @@ -9152,7 +10555,7 @@ typedef _dart_clang_visitChildren = int Function( ffi.Pointer client_data, ); -typedef _c_clang_getCursorUSR = CXString Function( +typedef Native_clang_getCursorUSR = CXString Function( CXCursor arg0, ); @@ -9160,7 +10563,7 @@ typedef _dart_clang_getCursorUSR = CXString Function( CXCursor arg0, ); -typedef _c_clang_constructUSR_ObjCClass = CXString Function( +typedef Native_clang_constructUSR_ObjCClass = CXString Function( ffi.Pointer class_name, ); @@ -9168,7 +10571,7 @@ typedef _dart_clang_constructUSR_ObjCClass = CXString Function( ffi.Pointer class_name, ); -typedef _c_clang_constructUSR_ObjCCategory = CXString Function( +typedef Native_clang_constructUSR_ObjCCategory = CXString Function( ffi.Pointer class_name, ffi.Pointer category_name, ); @@ -9178,7 +10581,7 @@ typedef _dart_clang_constructUSR_ObjCCategory = CXString Function( ffi.Pointer category_name, ); -typedef _c_clang_constructUSR_ObjCProtocol = CXString Function( +typedef Native_clang_constructUSR_ObjCProtocol = CXString Function( ffi.Pointer protocol_name, ); @@ -9186,7 +10589,7 @@ typedef _dart_clang_constructUSR_ObjCProtocol = CXString Function( ffi.Pointer protocol_name, ); -typedef _c_clang_constructUSR_ObjCIvar = CXString Function( +typedef Native_clang_constructUSR_ObjCIvar = CXString Function( ffi.Pointer name, CXString classUSR, ); @@ -9196,7 +10599,7 @@ typedef _dart_clang_constructUSR_ObjCIvar = CXString Function( CXString classUSR, ); -typedef _c_clang_constructUSR_ObjCMethod = CXString Function( +typedef Native_clang_constructUSR_ObjCMethod = CXString Function( ffi.Pointer name, ffi.Uint32 isInstanceMethod, CXString classUSR, @@ -9208,7 +10611,7 @@ typedef _dart_clang_constructUSR_ObjCMethod = CXString Function( CXString classUSR, ); -typedef _c_clang_constructUSR_ObjCProperty = CXString Function( +typedef Native_clang_constructUSR_ObjCProperty = CXString Function( ffi.Pointer property, CXString classUSR, ); @@ -9218,7 +10621,7 @@ typedef _dart_clang_constructUSR_ObjCProperty = CXString Function( CXString classUSR, ); -typedef _c_clang_getCursorSpelling = CXString Function( +typedef Native_clang_getCursorSpelling = CXString Function( CXCursor arg0, ); @@ -9226,7 +10629,7 @@ typedef _dart_clang_getCursorSpelling = CXString Function( CXCursor arg0, ); -typedef _c_clang_Cursor_getSpellingNameRange = CXSourceRange Function( +typedef Native_clang_Cursor_getSpellingNameRange = CXSourceRange Function( CXCursor arg0, ffi.Uint32 pieceIndex, ffi.Uint32 options, @@ -9238,7 +10641,7 @@ typedef _dart_clang_Cursor_getSpellingNameRange = CXSourceRange Function( int options, ); -typedef _c_clang_PrintingPolicy_getProperty = ffi.Uint32 Function( +typedef Native_clang_PrintingPolicy_getProperty = ffi.Uint32 Function( ffi.Pointer Policy, ffi.Int32 Property, ); @@ -9248,7 +10651,7 @@ typedef _dart_clang_PrintingPolicy_getProperty = int Function( int Property, ); -typedef _c_clang_PrintingPolicy_setProperty = ffi.Void Function( +typedef Native_clang_PrintingPolicy_setProperty = ffi.Void Function( ffi.Pointer Policy, ffi.Int32 Property, ffi.Uint32 Value, @@ -9260,7 +10663,7 @@ typedef _dart_clang_PrintingPolicy_setProperty = void Function( int Value, ); -typedef _c_clang_getCursorPrintingPolicy = ffi.Pointer Function( +typedef Native_clang_getCursorPrintingPolicy = ffi.Pointer Function( CXCursor arg0, ); @@ -9268,7 +10671,7 @@ typedef _dart_clang_getCursorPrintingPolicy = ffi.Pointer Function( CXCursor arg0, ); -typedef _c_clang_PrintingPolicy_dispose = ffi.Void Function( +typedef Native_clang_PrintingPolicy_dispose = ffi.Void Function( ffi.Pointer Policy, ); @@ -9276,7 +10679,7 @@ typedef _dart_clang_PrintingPolicy_dispose = void Function( ffi.Pointer Policy, ); -typedef _c_clang_getCursorPrettyPrinted = CXString Function( +typedef Native_clang_getCursorPrettyPrinted = CXString Function( CXCursor Cursor, ffi.Pointer Policy, ); @@ -9286,7 +10689,7 @@ typedef _dart_clang_getCursorPrettyPrinted = CXString Function( ffi.Pointer Policy, ); -typedef _c_clang_getCursorDisplayName = CXString Function( +typedef Native_clang_getCursorDisplayName = CXString Function( CXCursor arg0, ); @@ -9294,7 +10697,7 @@ typedef _dart_clang_getCursorDisplayName = CXString Function( CXCursor arg0, ); -typedef _c_clang_getCursorReferenced = CXCursor Function( +typedef Native_clang_getCursorReferenced = CXCursor Function( CXCursor arg0, ); @@ -9302,7 +10705,7 @@ typedef _dart_clang_getCursorReferenced = CXCursor Function( CXCursor arg0, ); -typedef _c_clang_getCursorDefinition = CXCursor Function( +typedef Native_clang_getCursorDefinition = CXCursor Function( CXCursor arg0, ); @@ -9310,7 +10713,7 @@ typedef _dart_clang_getCursorDefinition = CXCursor Function( CXCursor arg0, ); -typedef _c_clang_isCursorDefinition = ffi.Uint32 Function( +typedef Native_clang_isCursorDefinition = ffi.Uint32 Function( CXCursor arg0, ); @@ -9318,7 +10721,7 @@ typedef _dart_clang_isCursorDefinition = int Function( CXCursor arg0, ); -typedef _c_clang_getCanonicalCursor = CXCursor Function( +typedef Native_clang_getCanonicalCursor = CXCursor Function( CXCursor arg0, ); @@ -9326,7 +10729,7 @@ typedef _dart_clang_getCanonicalCursor = CXCursor Function( CXCursor arg0, ); -typedef _c_clang_Cursor_getObjCSelectorIndex = ffi.Int32 Function( +typedef Native_clang_Cursor_getObjCSelectorIndex = ffi.Int32 Function( CXCursor arg0, ); @@ -9334,7 +10737,7 @@ typedef _dart_clang_Cursor_getObjCSelectorIndex = int Function( CXCursor arg0, ); -typedef _c_clang_Cursor_isDynamicCall = ffi.Int32 Function( +typedef Native_clang_Cursor_isDynamicCall = ffi.Int32 Function( CXCursor C, ); @@ -9342,7 +10745,7 @@ typedef _dart_clang_Cursor_isDynamicCall = int Function( CXCursor C, ); -typedef _c_clang_Cursor_getReceiverType = CXType Function( +typedef Native_clang_Cursor_getReceiverType = CXType Function( CXCursor C, ); @@ -9350,7 +10753,7 @@ typedef _dart_clang_Cursor_getReceiverType = CXType Function( CXCursor C, ); -typedef _c_clang_Cursor_getObjCPropertyAttributes = ffi.Uint32 Function( +typedef Native_clang_Cursor_getObjCPropertyAttributes = ffi.Uint32 Function( CXCursor C, ffi.Uint32 reserved, ); @@ -9360,7 +10763,7 @@ typedef _dart_clang_Cursor_getObjCPropertyAttributes = int Function( int reserved, ); -typedef _c_clang_Cursor_getObjCPropertyGetterName = CXString Function( +typedef Native_clang_Cursor_getObjCPropertyGetterName = CXString Function( CXCursor C, ); @@ -9368,7 +10771,7 @@ typedef _dart_clang_Cursor_getObjCPropertyGetterName = CXString Function( CXCursor C, ); -typedef _c_clang_Cursor_getObjCPropertySetterName = CXString Function( +typedef Native_clang_Cursor_getObjCPropertySetterName = CXString Function( CXCursor C, ); @@ -9376,7 +10779,7 @@ typedef _dart_clang_Cursor_getObjCPropertySetterName = CXString Function( CXCursor C, ); -typedef _c_clang_Cursor_getObjCDeclQualifiers = ffi.Uint32 Function( +typedef Native_clang_Cursor_getObjCDeclQualifiers = ffi.Uint32 Function( CXCursor C, ); @@ -9384,7 +10787,7 @@ typedef _dart_clang_Cursor_getObjCDeclQualifiers = int Function( CXCursor C, ); -typedef _c_clang_Cursor_isObjCOptional = ffi.Uint32 Function( +typedef Native_clang_Cursor_isObjCOptional = ffi.Uint32 Function( CXCursor C, ); @@ -9392,7 +10795,7 @@ typedef _dart_clang_Cursor_isObjCOptional = int Function( CXCursor C, ); -typedef _c_clang_Cursor_isVariadic = ffi.Uint32 Function( +typedef Native_clang_Cursor_isVariadic = ffi.Uint32 Function( CXCursor C, ); @@ -9400,7 +10803,7 @@ typedef _dart_clang_Cursor_isVariadic = int Function( CXCursor C, ); -typedef _c_clang_Cursor_isExternalSymbol = ffi.Uint32 Function( +typedef Native_clang_Cursor_isExternalSymbol = ffi.Uint32 Function( CXCursor C, ffi.Pointer language, ffi.Pointer definedIn, @@ -9414,7 +10817,7 @@ typedef _dart_clang_Cursor_isExternalSymbol = int Function( ffi.Pointer isGenerated, ); -typedef _c_clang_Cursor_getCommentRange = CXSourceRange Function( +typedef Native_clang_Cursor_getCommentRange = CXSourceRange Function( CXCursor C, ); @@ -9422,7 +10825,7 @@ typedef _dart_clang_Cursor_getCommentRange = CXSourceRange Function( CXCursor C, ); -typedef _c_clang_Cursor_getRawCommentText = CXString Function( +typedef Native_clang_Cursor_getRawCommentText = CXString Function( CXCursor C, ); @@ -9430,7 +10833,7 @@ typedef _dart_clang_Cursor_getRawCommentText = CXString Function( CXCursor C, ); -typedef _c_clang_Cursor_getBriefCommentText = CXString Function( +typedef Native_clang_Cursor_getBriefCommentText = CXString Function( CXCursor C, ); @@ -9438,7 +10841,7 @@ typedef _dart_clang_Cursor_getBriefCommentText = CXString Function( CXCursor C, ); -typedef _c_clang_Cursor_getMangling = CXString Function( +typedef Native_clang_Cursor_getMangling = CXString Function( CXCursor arg0, ); @@ -9446,7 +10849,7 @@ typedef _dart_clang_Cursor_getMangling = CXString Function( CXCursor arg0, ); -typedef _c_clang_Cursor_getCXXManglings = ffi.Pointer Function( +typedef Native_clang_Cursor_getCXXManglings = ffi.Pointer Function( CXCursor arg0, ); @@ -9454,7 +10857,8 @@ typedef _dart_clang_Cursor_getCXXManglings = ffi.Pointer Function( CXCursor arg0, ); -typedef _c_clang_Cursor_getObjCManglings = ffi.Pointer Function( +typedef Native_clang_Cursor_getObjCManglings = ffi.Pointer + Function( CXCursor arg0, ); @@ -9462,7 +10866,7 @@ typedef _dart_clang_Cursor_getObjCManglings = ffi.Pointer Function( CXCursor arg0, ); -typedef _c_clang_Cursor_getModule = ffi.Pointer Function( +typedef Native_clang_Cursor_getModule = ffi.Pointer Function( CXCursor C, ); @@ -9470,7 +10874,7 @@ typedef _dart_clang_Cursor_getModule = ffi.Pointer Function( CXCursor C, ); -typedef _c_clang_getModuleForFile = ffi.Pointer Function( +typedef Native_clang_getModuleForFile = ffi.Pointer Function( ffi.Pointer arg0, ffi.Pointer arg1, ); @@ -9480,7 +10884,7 @@ typedef _dart_clang_getModuleForFile = ffi.Pointer Function( ffi.Pointer arg1, ); -typedef _c_clang_Module_getASTFile = ffi.Pointer Function( +typedef Native_clang_Module_getASTFile = ffi.Pointer Function( ffi.Pointer Module, ); @@ -9488,7 +10892,7 @@ typedef _dart_clang_Module_getASTFile = ffi.Pointer Function( ffi.Pointer Module, ); -typedef _c_clang_Module_getParent = ffi.Pointer Function( +typedef Native_clang_Module_getParent = ffi.Pointer Function( ffi.Pointer Module, ); @@ -9496,7 +10900,7 @@ typedef _dart_clang_Module_getParent = ffi.Pointer Function( ffi.Pointer Module, ); -typedef _c_clang_Module_getName = CXString Function( +typedef Native_clang_Module_getName = CXString Function( ffi.Pointer Module, ); @@ -9504,7 +10908,7 @@ typedef _dart_clang_Module_getName = CXString Function( ffi.Pointer Module, ); -typedef _c_clang_Module_getFullName = CXString Function( +typedef Native_clang_Module_getFullName = CXString Function( ffi.Pointer Module, ); @@ -9512,7 +10916,7 @@ typedef _dart_clang_Module_getFullName = CXString Function( ffi.Pointer Module, ); -typedef _c_clang_Module_isSystem = ffi.Int32 Function( +typedef Native_clang_Module_isSystem = ffi.Int32 Function( ffi.Pointer Module, ); @@ -9520,7 +10924,7 @@ typedef _dart_clang_Module_isSystem = int Function( ffi.Pointer Module, ); -typedef _c_clang_Module_getNumTopLevelHeaders = ffi.Uint32 Function( +typedef Native_clang_Module_getNumTopLevelHeaders = ffi.Uint32 Function( ffi.Pointer arg0, ffi.Pointer Module, ); @@ -9530,7 +10934,7 @@ typedef _dart_clang_Module_getNumTopLevelHeaders = int Function( ffi.Pointer Module, ); -typedef _c_clang_Module_getTopLevelHeader = ffi.Pointer Function( +typedef Native_clang_Module_getTopLevelHeader = ffi.Pointer Function( ffi.Pointer arg0, ffi.Pointer Module, ffi.Uint32 Index, @@ -9542,7 +10946,8 @@ typedef _dart_clang_Module_getTopLevelHeader = ffi.Pointer Function( int Index, ); -typedef _c_clang_CXXConstructor_isConvertingConstructor = ffi.Uint32 Function( +typedef Native_clang_CXXConstructor_isConvertingConstructor = ffi.Uint32 + Function( CXCursor C, ); @@ -9550,7 +10955,7 @@ typedef _dart_clang_CXXConstructor_isConvertingConstructor = int Function( CXCursor C, ); -typedef _c_clang_CXXConstructor_isCopyConstructor = ffi.Uint32 Function( +typedef Native_clang_CXXConstructor_isCopyConstructor = ffi.Uint32 Function( CXCursor C, ); @@ -9558,7 +10963,7 @@ typedef _dart_clang_CXXConstructor_isCopyConstructor = int Function( CXCursor C, ); -typedef _c_clang_CXXConstructor_isDefaultConstructor = ffi.Uint32 Function( +typedef Native_clang_CXXConstructor_isDefaultConstructor = ffi.Uint32 Function( CXCursor C, ); @@ -9566,7 +10971,7 @@ typedef _dart_clang_CXXConstructor_isDefaultConstructor = int Function( CXCursor C, ); -typedef _c_clang_CXXConstructor_isMoveConstructor = ffi.Uint32 Function( +typedef Native_clang_CXXConstructor_isMoveConstructor = ffi.Uint32 Function( CXCursor C, ); @@ -9574,7 +10979,7 @@ typedef _dart_clang_CXXConstructor_isMoveConstructor = int Function( CXCursor C, ); -typedef _c_clang_CXXField_isMutable = ffi.Uint32 Function( +typedef Native_clang_CXXField_isMutable = ffi.Uint32 Function( CXCursor C, ); @@ -9582,7 +10987,7 @@ typedef _dart_clang_CXXField_isMutable = int Function( CXCursor C, ); -typedef _c_clang_CXXMethod_isDefaulted = ffi.Uint32 Function( +typedef Native_clang_CXXMethod_isDefaulted = ffi.Uint32 Function( CXCursor C, ); @@ -9590,7 +10995,7 @@ typedef _dart_clang_CXXMethod_isDefaulted = int Function( CXCursor C, ); -typedef _c_clang_CXXMethod_isPureVirtual = ffi.Uint32 Function( +typedef Native_clang_CXXMethod_isPureVirtual = ffi.Uint32 Function( CXCursor C, ); @@ -9598,7 +11003,7 @@ typedef _dart_clang_CXXMethod_isPureVirtual = int Function( CXCursor C, ); -typedef _c_clang_CXXMethod_isStatic = ffi.Uint32 Function( +typedef Native_clang_CXXMethod_isStatic = ffi.Uint32 Function( CXCursor C, ); @@ -9606,7 +11011,7 @@ typedef _dart_clang_CXXMethod_isStatic = int Function( CXCursor C, ); -typedef _c_clang_CXXMethod_isVirtual = ffi.Uint32 Function( +typedef Native_clang_CXXMethod_isVirtual = ffi.Uint32 Function( CXCursor C, ); @@ -9614,7 +11019,7 @@ typedef _dart_clang_CXXMethod_isVirtual = int Function( CXCursor C, ); -typedef _c_clang_CXXRecord_isAbstract = ffi.Uint32 Function( +typedef Native_clang_CXXRecord_isAbstract = ffi.Uint32 Function( CXCursor C, ); @@ -9622,7 +11027,7 @@ typedef _dart_clang_CXXRecord_isAbstract = int Function( CXCursor C, ); -typedef _c_clang_EnumDecl_isScoped = ffi.Uint32 Function( +typedef Native_clang_EnumDecl_isScoped = ffi.Uint32 Function( CXCursor C, ); @@ -9630,7 +11035,7 @@ typedef _dart_clang_EnumDecl_isScoped = int Function( CXCursor C, ); -typedef _c_clang_CXXMethod_isConst = ffi.Uint32 Function( +typedef Native_clang_CXXMethod_isConst = ffi.Uint32 Function( CXCursor C, ); @@ -9638,7 +11043,7 @@ typedef _dart_clang_CXXMethod_isConst = int Function( CXCursor C, ); -typedef _c_clang_getTemplateCursorKind = ffi.Int32 Function( +typedef Native_clang_getTemplateCursorKind = ffi.Int32 Function( CXCursor C, ); @@ -9646,7 +11051,7 @@ typedef _dart_clang_getTemplateCursorKind = int Function( CXCursor C, ); -typedef _c_clang_getSpecializedCursorTemplate = CXCursor Function( +typedef Native_clang_getSpecializedCursorTemplate = CXCursor Function( CXCursor C, ); @@ -9654,7 +11059,7 @@ typedef _dart_clang_getSpecializedCursorTemplate = CXCursor Function( CXCursor C, ); -typedef _c_clang_getCursorReferenceNameRange = CXSourceRange Function( +typedef Native_clang_getCursorReferenceNameRange = CXSourceRange Function( CXCursor C, ffi.Uint32 NameFlags, ffi.Uint32 PieceIndex, @@ -9666,7 +11071,7 @@ typedef _dart_clang_getCursorReferenceNameRange = CXSourceRange Function( int PieceIndex, ); -typedef _c_clang_getToken = ffi.Pointer Function( +typedef Native_clang_getToken = ffi.Pointer Function( ffi.Pointer TU, CXSourceLocation Location, ); @@ -9676,7 +11081,7 @@ typedef _dart_clang_getToken = ffi.Pointer Function( CXSourceLocation Location, ); -typedef _c_clang_getTokenKind = ffi.Int32 Function( +typedef Native_clang_getTokenKind = ffi.Int32 Function( CXToken arg0, ); @@ -9684,7 +11089,7 @@ typedef _dart_clang_getTokenKind = int Function( CXToken arg0, ); -typedef _c_clang_getTokenSpelling = CXString Function( +typedef Native_clang_getTokenSpelling = CXString Function( ffi.Pointer arg0, CXToken arg1, ); @@ -9694,7 +11099,7 @@ typedef _dart_clang_getTokenSpelling = CXString Function( CXToken arg1, ); -typedef _c_clang_getTokenLocation = CXSourceLocation Function( +typedef Native_clang_getTokenLocation = CXSourceLocation Function( ffi.Pointer arg0, CXToken arg1, ); @@ -9704,7 +11109,7 @@ typedef _dart_clang_getTokenLocation = CXSourceLocation Function( CXToken arg1, ); -typedef _c_clang_getTokenExtent = CXSourceRange Function( +typedef Native_clang_getTokenExtent = CXSourceRange Function( ffi.Pointer arg0, CXToken arg1, ); @@ -9714,7 +11119,7 @@ typedef _dart_clang_getTokenExtent = CXSourceRange Function( CXToken arg1, ); -typedef _c_clang_tokenize = ffi.Void Function( +typedef Native_clang_tokenize = ffi.Void Function( ffi.Pointer TU, CXSourceRange Range, ffi.Pointer> Tokens, @@ -9728,7 +11133,7 @@ typedef _dart_clang_tokenize = void Function( ffi.Pointer NumTokens, ); -typedef _c_clang_annotateTokens = ffi.Void Function( +typedef Native_clang_annotateTokens = ffi.Void Function( ffi.Pointer TU, ffi.Pointer Tokens, ffi.Uint32 NumTokens, @@ -9742,7 +11147,7 @@ typedef _dart_clang_annotateTokens = void Function( ffi.Pointer Cursors, ); -typedef _c_clang_disposeTokens = ffi.Void Function( +typedef Native_clang_disposeTokens = ffi.Void Function( ffi.Pointer TU, ffi.Pointer Tokens, ffi.Uint32 NumTokens, @@ -9754,7 +11159,7 @@ typedef _dart_clang_disposeTokens = void Function( int NumTokens, ); -typedef _c_clang_getCursorKindSpelling = CXString Function( +typedef Native_clang_getCursorKindSpelling = CXString Function( ffi.Int32 Kind, ); @@ -9762,7 +11167,7 @@ typedef _dart_clang_getCursorKindSpelling = CXString Function( int Kind, ); -typedef _c_clang_getDefinitionSpellingAndExtent = ffi.Void Function( +typedef Native_clang_getDefinitionSpellingAndExtent = ffi.Void Function( CXCursor arg0, ffi.Pointer> startBuf, ffi.Pointer> endBuf, @@ -9782,7 +11187,7 @@ typedef _dart_clang_getDefinitionSpellingAndExtent = void Function( ffi.Pointer endColumn, ); -typedef _c_clang_enableStackTraces = ffi.Void Function(); +typedef Native_clang_enableStackTraces = ffi.Void Function(); typedef _dart_clang_enableStackTraces = void Function(); @@ -9790,7 +11195,7 @@ typedef _typedefC_1 = ffi.Void Function( ffi.Pointer, ); -typedef _c_clang_executeOnThread = ffi.Void Function( +typedef Native_clang_executeOnThread = ffi.Void Function( ffi.Pointer> fn, ffi.Pointer user_data, ffi.Uint32 stack_size, @@ -9802,7 +11207,7 @@ typedef _dart_clang_executeOnThread = void Function( int stack_size, ); -typedef _c_clang_getCompletionChunkKind = ffi.Int32 Function( +typedef Native_clang_getCompletionChunkKind = ffi.Int32 Function( ffi.Pointer completion_string, ffi.Uint32 chunk_number, ); @@ -9812,7 +11217,7 @@ typedef _dart_clang_getCompletionChunkKind = int Function( int chunk_number, ); -typedef _c_clang_getCompletionChunkText = CXString Function( +typedef Native_clang_getCompletionChunkText = CXString Function( ffi.Pointer completion_string, ffi.Uint32 chunk_number, ); @@ -9822,7 +11227,7 @@ typedef _dart_clang_getCompletionChunkText = CXString Function( int chunk_number, ); -typedef _c_clang_getCompletionChunkCompletionString = ffi.Pointer +typedef Native_clang_getCompletionChunkCompletionString = ffi.Pointer Function( ffi.Pointer completion_string, ffi.Uint32 chunk_number, @@ -9834,7 +11239,7 @@ typedef _dart_clang_getCompletionChunkCompletionString = ffi.Pointer int chunk_number, ); -typedef _c_clang_getNumCompletionChunks = ffi.Uint32 Function( +typedef Native_clang_getNumCompletionChunks = ffi.Uint32 Function( ffi.Pointer completion_string, ); @@ -9842,7 +11247,7 @@ typedef _dart_clang_getNumCompletionChunks = int Function( ffi.Pointer completion_string, ); -typedef _c_clang_getCompletionPriority = ffi.Uint32 Function( +typedef Native_clang_getCompletionPriority = ffi.Uint32 Function( ffi.Pointer completion_string, ); @@ -9850,7 +11255,7 @@ typedef _dart_clang_getCompletionPriority = int Function( ffi.Pointer completion_string, ); -typedef _c_clang_getCompletionAvailability = ffi.Int32 Function( +typedef Native_clang_getCompletionAvailability = ffi.Int32 Function( ffi.Pointer completion_string, ); @@ -9858,7 +11263,7 @@ typedef _dart_clang_getCompletionAvailability = int Function( ffi.Pointer completion_string, ); -typedef _c_clang_getCompletionNumAnnotations = ffi.Uint32 Function( +typedef Native_clang_getCompletionNumAnnotations = ffi.Uint32 Function( ffi.Pointer completion_string, ); @@ -9866,7 +11271,7 @@ typedef _dart_clang_getCompletionNumAnnotations = int Function( ffi.Pointer completion_string, ); -typedef _c_clang_getCompletionAnnotation = CXString Function( +typedef Native_clang_getCompletionAnnotation = CXString Function( ffi.Pointer completion_string, ffi.Uint32 annotation_number, ); @@ -9876,7 +11281,7 @@ typedef _dart_clang_getCompletionAnnotation = CXString Function( int annotation_number, ); -typedef _c_clang_getCompletionParent = CXString Function( +typedef Native_clang_getCompletionParent = CXString Function( ffi.Pointer completion_string, ffi.Pointer kind, ); @@ -9886,7 +11291,7 @@ typedef _dart_clang_getCompletionParent = CXString Function( ffi.Pointer kind, ); -typedef _c_clang_getCompletionBriefComment = CXString Function( +typedef Native_clang_getCompletionBriefComment = CXString Function( ffi.Pointer completion_string, ); @@ -9894,7 +11299,7 @@ typedef _dart_clang_getCompletionBriefComment = CXString Function( ffi.Pointer completion_string, ); -typedef _c_clang_getCursorCompletionString = ffi.Pointer Function( +typedef Native_clang_getCursorCompletionString = ffi.Pointer Function( CXCursor cursor, ); @@ -9902,7 +11307,7 @@ typedef _dart_clang_getCursorCompletionString = ffi.Pointer Function( CXCursor cursor, ); -typedef _c_clang_getCompletionNumFixIts = ffi.Uint32 Function( +typedef Native_clang_getCompletionNumFixIts = ffi.Uint32 Function( ffi.Pointer results, ffi.Uint32 completion_index, ); @@ -9912,7 +11317,7 @@ typedef _dart_clang_getCompletionNumFixIts = int Function( int completion_index, ); -typedef _c_clang_getCompletionFixIt = CXString Function( +typedef Native_clang_getCompletionFixIt = CXString Function( ffi.Pointer results, ffi.Uint32 completion_index, ffi.Uint32 fixit_index, @@ -9926,11 +11331,12 @@ typedef _dart_clang_getCompletionFixIt = CXString Function( ffi.Pointer replacement_range, ); -typedef _c_clang_defaultCodeCompleteOptions = ffi.Uint32 Function(); +typedef Native_clang_defaultCodeCompleteOptions = ffi.Uint32 Function(); typedef _dart_clang_defaultCodeCompleteOptions = int Function(); -typedef _c_clang_codeCompleteAt = ffi.Pointer Function( +typedef Native_clang_codeCompleteAt = ffi.Pointer + Function( ffi.Pointer TU, ffi.Pointer complete_filename, ffi.Uint32 complete_line, @@ -9951,7 +11357,7 @@ typedef _dart_clang_codeCompleteAt = ffi.Pointer int options, ); -typedef _c_clang_sortCodeCompletionResults = ffi.Void Function( +typedef Native_clang_sortCodeCompletionResults = ffi.Void Function( ffi.Pointer Results, ffi.Uint32 NumResults, ); @@ -9961,7 +11367,7 @@ typedef _dart_clang_sortCodeCompletionResults = void Function( int NumResults, ); -typedef _c_clang_disposeCodeCompleteResults = ffi.Void Function( +typedef Native_clang_disposeCodeCompleteResults = ffi.Void Function( ffi.Pointer Results, ); @@ -9969,7 +11375,7 @@ typedef _dart_clang_disposeCodeCompleteResults = void Function( ffi.Pointer Results, ); -typedef _c_clang_codeCompleteGetNumDiagnostics = ffi.Uint32 Function( +typedef Native_clang_codeCompleteGetNumDiagnostics = ffi.Uint32 Function( ffi.Pointer Results, ); @@ -9977,7 +11383,7 @@ typedef _dart_clang_codeCompleteGetNumDiagnostics = int Function( ffi.Pointer Results, ); -typedef _c_clang_codeCompleteGetDiagnostic = ffi.Pointer Function( +typedef Native_clang_codeCompleteGetDiagnostic = ffi.Pointer Function( ffi.Pointer Results, ffi.Uint32 Index, ); @@ -9987,7 +11393,7 @@ typedef _dart_clang_codeCompleteGetDiagnostic = ffi.Pointer Function( int Index, ); -typedef _c_clang_codeCompleteGetContexts = ffi.Uint64 Function( +typedef Native_clang_codeCompleteGetContexts = ffi.Uint64 Function( ffi.Pointer Results, ); @@ -9995,7 +11401,7 @@ typedef _dart_clang_codeCompleteGetContexts = int Function( ffi.Pointer Results, ); -typedef _c_clang_codeCompleteGetContainerKind = ffi.Int32 Function( +typedef Native_clang_codeCompleteGetContainerKind = ffi.Int32 Function( ffi.Pointer Results, ffi.Pointer IsIncomplete, ); @@ -10005,7 +11411,7 @@ typedef _dart_clang_codeCompleteGetContainerKind = int Function( ffi.Pointer IsIncomplete, ); -typedef _c_clang_codeCompleteGetContainerUSR = CXString Function( +typedef Native_clang_codeCompleteGetContainerUSR = CXString Function( ffi.Pointer Results, ); @@ -10013,7 +11419,7 @@ typedef _dart_clang_codeCompleteGetContainerUSR = CXString Function( ffi.Pointer Results, ); -typedef _c_clang_codeCompleteGetObjCSelector = CXString Function( +typedef Native_clang_codeCompleteGetObjCSelector = CXString Function( ffi.Pointer Results, ); @@ -10021,11 +11427,11 @@ typedef _dart_clang_codeCompleteGetObjCSelector = CXString Function( ffi.Pointer Results, ); -typedef _c_clang_getClangVersion = CXString Function(); +typedef Native_clang_getClangVersion = CXString Function(); typedef _dart_clang_getClangVersion = CXString Function(); -typedef _c_clang_toggleCrashRecovery = ffi.Void Function( +typedef Native_clang_toggleCrashRecovery = ffi.Void Function( ffi.Uint32 isEnabled, ); @@ -10040,7 +11446,7 @@ typedef CXInclusionVisitor = ffi.Void Function( ffi.Pointer, ); -typedef _c_clang_getInclusions = ffi.Void Function( +typedef Native_clang_getInclusions = ffi.Void Function( ffi.Pointer tu, ffi.Pointer> visitor, ffi.Pointer client_data, @@ -10052,7 +11458,7 @@ typedef _dart_clang_getInclusions = void Function( ffi.Pointer client_data, ); -typedef _c_clang_Cursor_Evaluate = ffi.Pointer Function( +typedef Native_clang_Cursor_Evaluate = ffi.Pointer Function( CXCursor C, ); @@ -10060,7 +11466,7 @@ typedef _dart_clang_Cursor_Evaluate = ffi.Pointer Function( CXCursor C, ); -typedef _c_clang_EvalResult_getKind = ffi.Int32 Function( +typedef Native_clang_EvalResult_getKind = ffi.Int32 Function( ffi.Pointer E, ); @@ -10068,7 +11474,7 @@ typedef _dart_clang_EvalResult_getKind = int Function( ffi.Pointer E, ); -typedef _c_clang_EvalResult_getAsInt = ffi.Int32 Function( +typedef Native_clang_EvalResult_getAsInt = ffi.Int32 Function( ffi.Pointer E, ); @@ -10076,7 +11482,7 @@ typedef _dart_clang_EvalResult_getAsInt = int Function( ffi.Pointer E, ); -typedef _c_clang_EvalResult_getAsLongLong = ffi.Int64 Function( +typedef Native_clang_EvalResult_getAsLongLong = ffi.Int64 Function( ffi.Pointer E, ); @@ -10084,7 +11490,7 @@ typedef _dart_clang_EvalResult_getAsLongLong = int Function( ffi.Pointer E, ); -typedef _c_clang_EvalResult_isUnsignedInt = ffi.Uint32 Function( +typedef Native_clang_EvalResult_isUnsignedInt = ffi.Uint32 Function( ffi.Pointer E, ); @@ -10092,7 +11498,7 @@ typedef _dart_clang_EvalResult_isUnsignedInt = int Function( ffi.Pointer E, ); -typedef _c_clang_EvalResult_getAsUnsigned = ffi.Uint64 Function( +typedef Native_clang_EvalResult_getAsUnsigned = ffi.Uint64 Function( ffi.Pointer E, ); @@ -10100,7 +11506,7 @@ typedef _dart_clang_EvalResult_getAsUnsigned = int Function( ffi.Pointer E, ); -typedef _c_clang_EvalResult_getAsDouble = ffi.Double Function( +typedef Native_clang_EvalResult_getAsDouble = ffi.Double Function( ffi.Pointer E, ); @@ -10108,7 +11514,7 @@ typedef _dart_clang_EvalResult_getAsDouble = double Function( ffi.Pointer E, ); -typedef _c_clang_EvalResult_getAsStr = ffi.Pointer Function( +typedef Native_clang_EvalResult_getAsStr = ffi.Pointer Function( ffi.Pointer E, ); @@ -10116,7 +11522,7 @@ typedef _dart_clang_EvalResult_getAsStr = ffi.Pointer Function( ffi.Pointer E, ); -typedef _c_clang_EvalResult_dispose = ffi.Void Function( +typedef Native_clang_EvalResult_dispose = ffi.Void Function( ffi.Pointer E, ); @@ -10124,7 +11530,7 @@ typedef _dart_clang_EvalResult_dispose = void Function( ffi.Pointer E, ); -typedef _c_clang_getRemappings = ffi.Pointer Function( +typedef Native_clang_getRemappings = ffi.Pointer Function( ffi.Pointer path, ); @@ -10132,7 +11538,7 @@ typedef _dart_clang_getRemappings = ffi.Pointer Function( ffi.Pointer path, ); -typedef _c_clang_getRemappingsFromFileList = ffi.Pointer Function( +typedef Native_clang_getRemappingsFromFileList = ffi.Pointer Function( ffi.Pointer> filePaths, ffi.Uint32 numFiles, ); @@ -10142,7 +11548,7 @@ typedef _dart_clang_getRemappingsFromFileList = ffi.Pointer Function( int numFiles, ); -typedef _c_clang_remap_getNumFiles = ffi.Uint32 Function( +typedef Native_clang_remap_getNumFiles = ffi.Uint32 Function( ffi.Pointer arg0, ); @@ -10150,7 +11556,7 @@ typedef _dart_clang_remap_getNumFiles = int Function( ffi.Pointer arg0, ); -typedef _c_clang_remap_getFilenames = ffi.Void Function( +typedef Native_clang_remap_getFilenames = ffi.Void Function( ffi.Pointer arg0, ffi.Uint32 index, ffi.Pointer original, @@ -10164,7 +11570,7 @@ typedef _dart_clang_remap_getFilenames = void Function( ffi.Pointer transformed, ); -typedef _c_clang_remap_dispose = ffi.Void Function( +typedef Native_clang_remap_dispose = ffi.Void Function( ffi.Pointer arg0, ); @@ -10172,7 +11578,7 @@ typedef _dart_clang_remap_dispose = void Function( ffi.Pointer arg0, ); -typedef _c_clang_findReferencesInFile = ffi.Int32 Function( +typedef Native_clang_findReferencesInFile = ffi.Int32 Function( CXCursor cursor, ffi.Pointer file, CXCursorAndRangeVisitor visitor, @@ -10184,7 +11590,7 @@ typedef _dart_clang_findReferencesInFile = int Function( CXCursorAndRangeVisitor visitor, ); -typedef _c_clang_findIncludesInFile = ffi.Int32 Function( +typedef Native_clang_findIncludesInFile = ffi.Int32 Function( ffi.Pointer TU, ffi.Pointer file, CXCursorAndRangeVisitor visitor, @@ -10196,7 +11602,7 @@ typedef _dart_clang_findIncludesInFile = int Function( CXCursorAndRangeVisitor visitor, ); -typedef _c_clang_index_isEntityObjCContainerKind = ffi.Int32 Function( +typedef Native_clang_index_isEntityObjCContainerKind = ffi.Int32 Function( ffi.Int32 arg0, ); @@ -10204,7 +11610,7 @@ typedef _dart_clang_index_isEntityObjCContainerKind = int Function( int arg0, ); -typedef _c_clang_index_getObjCContainerDeclInfo +typedef Native_clang_index_getObjCContainerDeclInfo = ffi.Pointer Function( ffi.Pointer arg0, ); @@ -10214,7 +11620,7 @@ typedef _dart_clang_index_getObjCContainerDeclInfo ffi.Pointer arg0, ); -typedef _c_clang_index_getObjCInterfaceDeclInfo +typedef Native_clang_index_getObjCInterfaceDeclInfo = ffi.Pointer Function( ffi.Pointer arg0, ); @@ -10224,7 +11630,7 @@ typedef _dart_clang_index_getObjCInterfaceDeclInfo ffi.Pointer arg0, ); -typedef _c_clang_index_getObjCCategoryDeclInfo +typedef Native_clang_index_getObjCCategoryDeclInfo = ffi.Pointer Function( ffi.Pointer arg0, ); @@ -10234,7 +11640,7 @@ typedef _dart_clang_index_getObjCCategoryDeclInfo ffi.Pointer arg0, ); -typedef _c_clang_index_getObjCProtocolRefListInfo +typedef Native_clang_index_getObjCProtocolRefListInfo = ffi.Pointer Function( ffi.Pointer arg0, ); @@ -10244,7 +11650,7 @@ typedef _dart_clang_index_getObjCProtocolRefListInfo ffi.Pointer arg0, ); -typedef _c_clang_index_getObjCPropertyDeclInfo +typedef Native_clang_index_getObjCPropertyDeclInfo = ffi.Pointer Function( ffi.Pointer arg0, ); @@ -10254,7 +11660,7 @@ typedef _dart_clang_index_getObjCPropertyDeclInfo ffi.Pointer arg0, ); -typedef _c_clang_index_getIBOutletCollectionAttrInfo +typedef Native_clang_index_getIBOutletCollectionAttrInfo = ffi.Pointer Function( ffi.Pointer arg0, ); @@ -10264,8 +11670,8 @@ typedef _dart_clang_index_getIBOutletCollectionAttrInfo ffi.Pointer arg0, ); -typedef _c_clang_index_getCXXClassDeclInfo = ffi.Pointer - Function( +typedef Native_clang_index_getCXXClassDeclInfo + = ffi.Pointer Function( ffi.Pointer arg0, ); @@ -10274,7 +11680,7 @@ typedef _dart_clang_index_getCXXClassDeclInfo ffi.Pointer arg0, ); -typedef _c_clang_index_getClientContainer = ffi.Pointer Function( +typedef Native_clang_index_getClientContainer = ffi.Pointer Function( ffi.Pointer arg0, ); @@ -10282,7 +11688,7 @@ typedef _dart_clang_index_getClientContainer = ffi.Pointer Function( ffi.Pointer arg0, ); -typedef _c_clang_index_setClientContainer = ffi.Void Function( +typedef Native_clang_index_setClientContainer = ffi.Void Function( ffi.Pointer arg0, ffi.Pointer arg1, ); @@ -10292,7 +11698,7 @@ typedef _dart_clang_index_setClientContainer = void Function( ffi.Pointer arg1, ); -typedef _c_clang_index_getClientEntity = ffi.Pointer Function( +typedef Native_clang_index_getClientEntity = ffi.Pointer Function( ffi.Pointer arg0, ); @@ -10300,7 +11706,7 @@ typedef _dart_clang_index_getClientEntity = ffi.Pointer Function( ffi.Pointer arg0, ); -typedef _c_clang_index_setClientEntity = ffi.Void Function( +typedef Native_clang_index_setClientEntity = ffi.Void Function( ffi.Pointer arg0, ffi.Pointer arg1, ); @@ -10310,7 +11716,7 @@ typedef _dart_clang_index_setClientEntity = void Function( ffi.Pointer arg1, ); -typedef _c_clang_IndexAction_create = ffi.Pointer Function( +typedef Native_clang_IndexAction_create = ffi.Pointer Function( ffi.Pointer CIdx, ); @@ -10318,7 +11724,7 @@ typedef _dart_clang_IndexAction_create = ffi.Pointer Function( ffi.Pointer CIdx, ); -typedef _c_clang_IndexAction_dispose = ffi.Void Function( +typedef Native_clang_IndexAction_dispose = ffi.Void Function( ffi.Pointer arg0, ); @@ -10326,7 +11732,7 @@ typedef _dart_clang_IndexAction_dispose = void Function( ffi.Pointer arg0, ); -typedef _c_clang_indexSourceFile = ffi.Int32 Function( +typedef Native_clang_indexSourceFile = ffi.Int32 Function( ffi.Pointer arg0, ffi.Pointer client_data, ffi.Pointer index_callbacks, @@ -10356,7 +11762,7 @@ typedef _dart_clang_indexSourceFile = int Function( int TU_options, ); -typedef _c_clang_indexSourceFileFullArgv = ffi.Int32 Function( +typedef Native_clang_indexSourceFileFullArgv = ffi.Int32 Function( ffi.Pointer arg0, ffi.Pointer client_data, ffi.Pointer index_callbacks, @@ -10386,7 +11792,7 @@ typedef _dart_clang_indexSourceFileFullArgv = int Function( int TU_options, ); -typedef _c_clang_indexTranslationUnit = ffi.Int32 Function( +typedef Native_clang_indexTranslationUnit = ffi.Int32 Function( ffi.Pointer arg0, ffi.Pointer client_data, ffi.Pointer index_callbacks, @@ -10404,7 +11810,7 @@ typedef _dart_clang_indexTranslationUnit = int Function( ffi.Pointer arg5, ); -typedef _c_clang_indexLoc_getFileLocation = ffi.Void Function( +typedef Native_clang_indexLoc_getFileLocation = ffi.Void Function( CXIdxLoc loc, ffi.Pointer> indexFile, ffi.Pointer> file, @@ -10422,7 +11828,7 @@ typedef _dart_clang_indexLoc_getFileLocation = void Function( ffi.Pointer offset, ); -typedef _c_clang_indexLoc_getCXSourceLocation = CXSourceLocation Function( +typedef Native_clang_indexLoc_getCXSourceLocation = CXSourceLocation Function( CXIdxLoc loc, ); @@ -10435,7 +11841,7 @@ typedef CXFieldVisitor = ffi.Int32 Function( ffi.Pointer, ); -typedef _c_clang_Type_visitFields = ffi.Uint32 Function( +typedef Native_clang_Type_visitFields = ffi.Uint32 Function( CXType T, ffi.Pointer> visitor, ffi.Pointer client_data, diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index a8c2cd53a5..9c67f6bd1f 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -31,6 +31,9 @@ ffigen: functions: include: - 'clang_.*' # Can be a regexp, '.' matches any character. + symbol-address: + include: + - 'clang_.*' # Symbol Address and Typedefs for these functions will be exposed via addresses. structs: include: - 'CX.*' diff --git a/pkgs/ffigen/example/simple/generated_bindings.dart b/pkgs/ffigen/example/simple/generated_bindings.dart index c0bb4d3a3c..167488252e 100644 --- a/pkgs/ffigen/example/simple/generated_bindings.dart +++ b/pkgs/ffigen/example/simple/generated_bindings.dart @@ -24,71 +24,76 @@ class NativeLibrary { int a, int b, ) { - return (_sum ??= - _lookup>('sum').asFunction<_dart_sum>())( + return _sum( a, b, ); } - _dart_sum? _sum; + late final _sum_ptr = _lookup>('sum'); + late final _dart_sum _sum = _sum_ptr.asFunction<_dart_sum>(); /// Subtracts 2 integers. int subtract( ffi.Pointer a, int b, ) { - return (_subtract ??= _lookup>('subtract') - .asFunction<_dart_subtract>())( + return _subtract( a, b, ); } - _dart_subtract? _subtract; + late final _subtract_ptr = + _lookup>('subtract'); + late final _dart_subtract _subtract = + _subtract_ptr.asFunction<_dart_subtract>(); /// Multiplies 2 integers, returns pointer to an integer,. ffi.Pointer multiply( int a, int b, ) { - return (_multiply ??= _lookup>('multiply') - .asFunction<_dart_multiply>())( + return _multiply( a, b, ); } - _dart_multiply? _multiply; + late final _multiply_ptr = + _lookup>('multiply'); + late final _dart_multiply _multiply = + _multiply_ptr.asFunction<_dart_multiply>(); /// Divides 2 integers, returns pointer to a float. ffi.Pointer divide( int a, int b, ) { - return (_divide ??= _lookup>('divide') - .asFunction<_dart_divide>())( + return _divide( a, b, ); } - _dart_divide? _divide; + late final _divide_ptr = _lookup>('divide'); + late final _dart_divide _divide = _divide_ptr.asFunction<_dart_divide>(); /// Divides 2 floats, returns a pointer to double. ffi.Pointer dividePercision( ffi.Pointer a, ffi.Pointer b, ) { - return (_dividePercision ??= - _lookup>('dividePercision') - .asFunction<_dart_dividePercision>())( + return _dividePercision( a, b, ); } - _dart_dividePercision? _dividePercision; + late final _dividePercision_ptr = + _lookup>('dividePercision'); + late final _dart_dividePercision _dividePercision = + _dividePercision_ptr.asFunction<_dart_dividePercision>(); } typedef _c_sum = ffi.Int32 Function( diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index c227c4e61d..5236c50a08 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -31,6 +31,7 @@ import 'writer.dart'; class Func extends LookUpBinding { final Type returnType; final List parameters; + final bool exposeSymbolAddress; /// [originalName] is looked up in dynamic library, if not /// provided, takes the value of [name]. @@ -41,6 +42,7 @@ class Func extends LookUpBinding { String? dartDoc, required this.returnType, List? parameters, + this.exposeSymbolAddress = false, }) : parameters = parameters ?? [], super( usr: usr, @@ -85,7 +87,7 @@ class Func extends LookUpBinding { Typedef? _cType, _dartType; Typedef get cType => _cType ??= Typedef( - name: '_c_$name', + name: exposeSymbolAddress ? 'Native_$name' : '_c_$name', returnType: returnType, parameters: parameters, typedefType: TypedefType.C, @@ -102,6 +104,8 @@ class Func extends LookUpBinding { final s = StringBuffer(); final enclosingFuncName = name; final funcVarName = w.wrapperLevelUniqueNamer.makeUnique('_$name'); + final funcPointerName = + w.wrapperLevelUniqueNamer.makeUnique('_${name}_ptr'); if (dartDoc != null) { s.write(makeDartDoc(dartDoc!)); @@ -127,8 +131,7 @@ class Func extends LookUpBinding { } } s.write(') {\n'); - s.write( - "return ($funcVarName ??= ${w.lookupFuncIdentifier}<${w.ffiLibraryPrefix}.NativeFunction<${cType.name}>>('$originalName').asFunction<${dartType.name}>())"); + s.write('return $funcVarName'); s.write('(\n'); for (final p in parameters) { @@ -147,9 +150,22 @@ class Func extends LookUpBinding { } s.write('}\n'); + // Write function pointer. + s.write( + "late final $funcPointerName = ${w.lookupFuncIdentifier}<${w.ffiLibraryPrefix}.NativeFunction<${cType.name}>>('$originalName');\n"); // Write function variable. - s.write('${dartType.name}? $funcVarName;\n\n'); + s.write( + 'late final ${dartType.name} $funcVarName = $funcPointerName.asFunction<${dartType.name}>();\n\n'); + if (exposeSymbolAddress) { + // Add to SymbolAddress in writer. + w.symbolAddressWriter.addSymbol( + type: + '${w.ffiLibraryPrefix}.Pointer<${w.ffiLibraryPrefix}.NativeFunction<${cType.name}>>', + name: name, + ptrName: funcPointerName, + ); + } return BindingString(type: BindingStringType.func, string: s.toString()); } } diff --git a/pkgs/ffigen/lib/src/code_generator/global.dart b/pkgs/ffigen/lib/src/code_generator/global.dart index 3531eb5940..1951371f06 100644 --- a/pkgs/ffigen/lib/src/code_generator/global.dart +++ b/pkgs/ffigen/lib/src/code_generator/global.dart @@ -22,6 +22,7 @@ import 'writer.dart'; /// ``` class Global extends LookUpBinding { final Type type; + final bool exposeSymbolAddress; Global({ String? usr, @@ -29,6 +30,7 @@ class Global extends LookUpBinding { required String name, required this.type, String? dartDoc, + this.exposeSymbolAddress = false, }) : super( usr: usr, originalName: originalName, @@ -77,6 +79,15 @@ class Global extends LookUpBinding { 'set $globalVarName($dartType value) => $pointerName.value = value;\n\n'); } + if (exposeSymbolAddress) { + // Add to SymbolAddress in writer. + w.symbolAddressWriter.addSymbol( + type: '${w.ffiLibraryPrefix}.Pointer<$cType>', + name: name, + ptrName: pointerName, + ); + } + return BindingString(type: BindingStringType.global, string: s.toString()); } } diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index d6ada16770..03c36470f3 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -17,14 +17,21 @@ class Writer { /// Holds bindings which don't lookup symbols. final List noLookUpBindings; - String? _className; + /// Manages the `_SymbolAddress` class. + final symbolAddressWriter = SymbolAddressWriter(); + + late String _className; final String? classDocComment; - String? _ffiLibraryPrefix; - String? get ffiLibraryPrefix => _ffiLibraryPrefix; + late String _ffiLibraryPrefix; + String get ffiLibraryPrefix => _ffiLibraryPrefix; + + late String _lookupFuncIdentifier; + String get lookupFuncIdentifier => _lookupFuncIdentifier; - String? _lookupFuncIdentifier; - String? get lookupFuncIdentifier => _lookupFuncIdentifier; + late String _symbolAddressClassName; + late String _symbolAddressVariableName; + late String _symbolAddressLibraryVarName; final bool dartBool; @@ -37,10 +44,10 @@ class Writer { UniqueNamer get topLevelUniqueNamer => _topLevelUniqueNamer; UniqueNamer get wrapperLevelUniqueNamer => _wrapperLevelUniqueNamer; - String? _arrayHelperClassPrefix; + late String _arrayHelperClassPrefix; /// Guaranteed to be a unique prefix. - String? get arrayHelperClassPrefix => _arrayHelperClassPrefix; + String get arrayHelperClassPrefix => _arrayHelperClassPrefix; /// [_usedUpNames] should contain names of all the declarations which are /// already used. This is used to avoid name collisions. @@ -64,8 +71,8 @@ class Writer { /// Wrapper class name must be unique among all names. _className = allLevelsUniqueNamer.makeUnique(className); - _initialWrapperLevelUniqueNamer.markUsed(_className!); - _initialTopLevelUniqueNamer.markUsed(_className!); + _initialWrapperLevelUniqueNamer.markUsed(_className); + _initialTopLevelUniqueNamer.markUsed(_className); /// [_ffiLibraryPrefix] should be unique in top level. _ffiLibraryPrefix = _initialTopLevelUniqueNamer.makeUnique('ffi'); @@ -73,13 +80,21 @@ class Writer { /// [_lookupFuncIdentifier] should be unique in top level. _lookupFuncIdentifier = _initialTopLevelUniqueNamer.makeUnique('_lookup'); + /// Resolve name conflicts of identifiers used for SymbolAddresses. + _symbolAddressClassName = + allLevelsUniqueNamer.makeUnique('_SymbolAddresses'); + _symbolAddressVariableName = + _initialWrapperLevelUniqueNamer.makeUnique('addresses'); + _symbolAddressLibraryVarName = + _initialWrapperLevelUniqueNamer.makeUnique('_library'); + /// Finding a unique prefix for Array Helper Classes and store into /// [_arrayHelperClassPrefix]. final base = 'ArrayHelper'; _arrayHelperClassPrefix = base; var suffixInt = 0; for (var i = 0; i < allNameSet.length; i++) { - if (allNameSet.elementAt(i).startsWith(_arrayHelperClassPrefix!)) { + if (allNameSet.elementAt(i).startsWith(_arrayHelperClassPrefix)) { // Not a unique prefix, start over with a new suffix. i = -1; suffixInt++; @@ -157,9 +172,17 @@ class Writer { for (final b in lookUpBindings) { s.write(b.toBindingString(this).string); } + if (symbolAddressWriter.shouldGenerate) { + s.write(symbolAddressWriter.writeObject(this)); + } + s.write('}\n\n'); } + if (symbolAddressWriter.shouldGenerate) { + s.write(symbolAddressWriter.writeClass(this)); + } + /// Write [noLookUpBindings]. for (final b in noLookUpBindings) { s.write(b.toBindingString(this).string); @@ -198,3 +221,46 @@ class Writer { return uniqueName; } } + +/// Manages the generated `_SymbolAddress` class. +class SymbolAddressWriter { + final List<_SymbolAddressUnit> _addresses = []; + + /// Used to check if we need to generate `_SymbolAddress` class. + bool get shouldGenerate => _addresses.isNotEmpty; + + void addSymbol({ + required String type, + required String name, + required String ptrName, + }) { + _addresses.add(_SymbolAddressUnit(type, name, ptrName)); + } + + String writeObject(Writer w) { + return 'late final ${w._symbolAddressVariableName} = ${w._symbolAddressClassName}(this);'; + } + + String writeClass(Writer w) { + final sb = StringBuffer(); + sb.write('class ${w._symbolAddressClassName} {\n'); + // Write Library object. + sb.write('final ${w._className} ${w._symbolAddressLibraryVarName};\n'); + // Write Constructor. + sb.write( + '${w._symbolAddressClassName}(this.${w._symbolAddressLibraryVarName});\n'); + for (final address in _addresses) { + sb.write( + '${address.type} get ${address.name} => ${w._symbolAddressLibraryVarName}.${address.ptrName};\n'); + } + sb.write('}\n'); + return sb.toString(); + } +} + +/// Holds the data for a single symbol address. +class _SymbolAddressUnit { + final String type, name, ptrName; + + _SymbolAddressUnit(this.type, this.name, this.ptrName); +} diff --git a/pkgs/ffigen/lib/src/config_provider/config_types.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart index 9ce215c3ec..e412d96029 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_types.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart @@ -92,19 +92,24 @@ class GlobHeaderFilter extends HeaderIncludeFilter { } } -/// A generic declaration config, used for Functions, Structs and Enums. +/// A generic declaration config, used for Functions, Structs, Enums, Macros, +/// unnamed Enums and Globals. class Declaration { final Includer _includer; final Renamer _renamer; final MemberRenamer _memberRenamer; + final Includer _symbolAddressIncluder; Declaration({ Includer? includer, Renamer? renamer, MemberRenamer? memberRenamer, + Includer? symbolAddressIncluder, }) : _includer = includer ?? Includer(), _renamer = renamer ?? Renamer(), - _memberRenamer = memberRenamer ?? MemberRenamer(); + _memberRenamer = memberRenamer ?? MemberRenamer(), + _symbolAddressIncluder = + symbolAddressIncluder ?? Includer.excludeByDefault(); /// Applies renaming and returns the result. String renameUsingConfig(String name) => _renamer.rename(name); @@ -115,6 +120,10 @@ class Declaration { /// Checks if a name is allowed by a filter. bool shouldInclude(String name) => _includer.shouldInclude(name); + + /// Checks if the symbol address should be included for this name. + bool shouldIncludeSymbolAddress(String name) => + _symbolAddressIncluder.shouldInclude(name); } /// Matches `$`, value can be accessed in group 1 of match. @@ -180,6 +189,12 @@ class Includer { _excludeMatchers = excludeMatchers ?? [], _excludeFull = excludeFull ?? {}; + Includer.excludeByDefault() + : _includeMatchers = [], + _includeFull = {}, + _excludeMatchers = [RegExp('.*', dotAll: true)], + _excludeFull = {}; + /// Returns true if [name] is allowed. /// /// Exclude overrides include. diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 8533eefef0..eeab2ae767 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -268,15 +268,11 @@ bool outputValidator(String name, dynamic value) => bool isFullDeclarationName(String str) => quiver.matchesFull(RegExp('[a-zA-Z_0-9]*'), str); -Declaration declarationConfigExtractor(dynamic yamlMap) { +Includer _extractIncluderFromYaml(dynamic yamlMap) { final includeMatchers = [], includeFull = {}, excludeMatchers = [], excludeFull = {}; - final renamePatterns = []; - final renameFull = {}; - final memberRenamePatterns = []; - final memberRenamerFull = {}; final include = (yamlMap[strings.include] as YamlList?)?.cast(); if (include != null) { @@ -300,6 +296,27 @@ Declaration declarationConfigExtractor(dynamic yamlMap) { } } + return Includer( + includeMatchers: includeMatchers, + includeFull: includeFull, + excludeMatchers: excludeMatchers, + excludeFull: excludeFull, + ); +} + +Declaration declarationConfigExtractor(dynamic yamlMap) { + final renamePatterns = []; + final renameFull = {}; + final memberRenamePatterns = []; + final memberRenamerFull = {}; + + final includer = _extractIncluderFromYaml(yamlMap); + + Includer? symbolIncluder; + if (yamlMap[strings.symbolAddress] != null) { + symbolIncluder = _extractIncluderFromYaml(yamlMap[strings.symbolAddress]); + } + final rename = (yamlMap[strings.rename] as YamlMap?)?.cast(); if (rename != null) { @@ -350,12 +367,7 @@ Declaration declarationConfigExtractor(dynamic yamlMap) { } return Declaration( - includer: Includer( - includeMatchers: includeMatchers, - includeFull: includeFull, - excludeMatchers: excludeMatchers, - excludeFull: excludeFull, - ), + includer: includer, renamer: Renamer( renameFull: renameFull, renamePatterns: renamePatterns, @@ -364,6 +376,7 @@ Declaration declarationConfigExtractor(dynamic yamlMap) { memberRenameFull: memberRenamerFull, memberRenamePattern: memberRenamePatterns, ), + symbolAddressIncluder: symbolIncluder, ); } @@ -408,6 +421,22 @@ bool declarationConfigValidator(String name, dynamic value) { } } } + } else if (key == strings.symbolAddress) { + if (!checkType([name, key as String], value[key])) { + _result = false; + } else { + for (final subkey in value[key].keys) { + if (subkey == strings.include || subkey == strings.exclude) { + if (!checkType( + [name, key, subkey as String], value[key][subkey])) { + _result = false; + } + } else { + _logger.severe("Unknown key '$subkey' in '$name -> $key'."); + _result = false; + } + } + } } else { _logger.severe("Unknown key '$key' in '$name'."); _result = false; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index ccfcb216fc..ac1d11ddf6 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -76,6 +76,8 @@ Func? parseFunctionDeclaration(clang_types.CXCursor cursor) { originalName: funcName, returnType: rt, parameters: parameters, + exposeSymbolAddress: + config.functionDecl.shouldIncludeSymbolAddress(funcName), ); bindingsIndex.addFuncToSeen(funcUsr, _stack.top.func!); } else if (bindingsIndex.isSeenFunc(funcUsr)) { diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart index a19c4b21ec..9114f82e89 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart @@ -40,6 +40,7 @@ Global? parseVarDeclaration(clang_types.CXCursor cursor) { usr: usr, type: type, dartDoc: getCursorDocComment(cursor), + exposeSymbolAddress: config.functionDecl.shouldIncludeSymbolAddress(name), ); bindingsIndex.addGlobalVarToSeen(usr, global); return global; diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index d5041aa211..1929051ed8 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -47,6 +47,8 @@ const include = 'include'; const exclude = 'exclude'; const rename = 'rename'; const memberRename = 'member-rename'; +const symbolAddress = 'symbol-address'; + const sizemap = 'size-map'; const typedefmap = 'typedef-map'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 171a0d2487..860f4e8095 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.1.0 +version: 2.2.0 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart index ef210780cd..7764524652 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart @@ -21,15 +21,15 @@ class Bindings { bool a, ffi.Pointer b, ) { - return (_test1 ??= _lookup>('test1') - .asFunction<_dart_test1>())( + return _test1( a ? 1 : 0, b, ) != 0; } - _dart_test1? _test1; + late final _test1_ptr = _lookup>('test1'); + late final _dart_test1 _test1 = _test1_ptr.asFunction<_dart_test1>(); } class test2 extends ffi.Struct { diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart index 94c815cdb6..5757ff03e7 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart @@ -21,14 +21,14 @@ class Bindings { int a, ffi.Pointer b, ) { - return (_test1 ??= _lookup>('test1') - .asFunction<_dart_test1>())( + return _test1( a, b, ); } - _dart_test1? _test1; + late final _test1_ptr = _lookup>('test1'); + late final _dart_test1 _test1 = _test1_ptr.asFunction<_dart_test1>(); } class test2 extends ffi.Struct { diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart index 4c144d8b27..30de175b7c 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart @@ -20,39 +20,41 @@ class Bindings { /// Just a test function /// heres another line int noParam() { - return (_noParam ??= _lookup>('noParam') - .asFunction<_dart_noParam>())(); + return _noParam(); } - _dart_noParam? _noParam; + late final _noParam_ptr = _lookup>('noParam'); + late final _dart_noParam _noParam = _noParam_ptr.asFunction<_dart_noParam>(); int withPrimitiveParam( int a, int b, ) { - return (_withPrimitiveParam ??= - _lookup>('withPrimitiveParam') - .asFunction<_dart_withPrimitiveParam>())( + return _withPrimitiveParam( a, b, ); } - _dart_withPrimitiveParam? _withPrimitiveParam; + late final _withPrimitiveParam_ptr = + _lookup>('withPrimitiveParam'); + late final _dart_withPrimitiveParam _withPrimitiveParam = + _withPrimitiveParam_ptr.asFunction<_dart_withPrimitiveParam>(); ffi.Pointer withPointerParam( ffi.Pointer a, ffi.Pointer> b, ) { - return (_withPointerParam ??= - _lookup>('withPointerParam') - .asFunction<_dart_withPointerParam>())( + return _withPointerParam( a, b, ); } - _dart_withPointerParam? _withPointerParam; + late final _withPointerParam_ptr = + _lookup>('withPointerParam'); + late final _dart_withPointerParam _withPointerParam = + _withPointerParam_ptr.asFunction<_dart_withPointerParam>(); } typedef _c_noParam = ffi.Int32 Function(); diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart index b9d654b2a7..c4bfa273c5 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart @@ -20,13 +20,15 @@ class Bindings { ffi.Pointer someFunc( ffi.Pointer> some, ) { - return (_someFunc ??= _lookup>('someFunc') - .asFunction<_dart_someFunc>())( + return _someFunc( some, ); } - _dart_someFunc? _someFunc; + late final _someFunc_ptr = + _lookup>('someFunc'); + late final _dart_someFunc _someFunc = + _someFunc_ptr.asFunction<_dart_someFunc>(); } class SomeStruc extends ffi.Struct { diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart index 0c30a9274b..5e599fc5d8 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart @@ -21,40 +21,41 @@ class init_dylib_1 { : _lookup = lookup; void test() { - return (_test_1 ??= _lookup>('test') - .asFunction<_dart_test1>())(); + return _test_1(); } - _dart_test1? _test_1; + late final _test_ptr = _lookup>('test'); + late final _dart_test1 _test_1 = _test_ptr.asFunction<_dart_test1>(); void _test() { - return (__test ??= _lookup>('_test') - .asFunction<_dart__test>())(); + return __test(); } - _dart__test? __test; + late final __test_ptr = _lookup>('_test'); + late final _dart__test __test = __test_ptr.asFunction<_dart__test>(); void _c_test() { - return (__c_test ??= _lookup>('_c_test') - .asFunction<_dart__c_test>())(); + return __c_test(); } - _dart__c_test? __c_test; + late final __c_test_ptr = _lookup>('_c_test'); + late final _dart__c_test __c_test = __c_test_ptr.asFunction<_dart__c_test>(); void _dart_test() { - return (__dart_test ??= - _lookup>('_dart_test') - .asFunction<_dart__dart_test>())(); + return __dart_test(); } - _dart__dart_test? __dart_test; + late final __dart_test_ptr = + _lookup>('_dart_test'); + late final _dart__dart_test __dart_test = + __dart_test_ptr.asFunction<_dart__dart_test>(); void Test() { - return (_Test ??= _lookup>('Test') - .asFunction<_dart_Test>())(); + return _Test(); } - _dart_Test? _Test; + late final _Test_ptr = _lookup>('Test'); + late final _dart_Test _Test = _Test_ptr.asFunction<_dart_Test>(); } class _Test extends ffi.Struct { diff --git a/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart b/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart new file mode 100644 index 0000000000..cc534e89f1 --- /dev/null +++ b/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart @@ -0,0 +1,48 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; +import '../test_utils.dart'; + +late Library actual; +void main() { + group('decl_symbol_address_collision_test', () { + setUpAll(() { + logWarnings(Level.SEVERE); + actual = Library( + name: 'Bindings', + header: '// ignore_for_file: unused_element', + bindings: [ + Struc(name: 'addresses'), + Struc(name: '_SymbolAddresses'), + EnumClass(name: 'Bindings'), + Func( + name: '_library', + returnType: Type.nativeType(SupportedNativeType.Void), + exposeSymbolAddress: true, + ), + Func( + name: '_SymbolAddresses_1', + returnType: Type.nativeType(SupportedNativeType.Void), + exposeSymbolAddress: true, + ), + ], + ); + }); + test('declaration and symbol address conflict', () { + matchLibraryWithExpected(actual, [ + 'test', + 'debug_generated', + 'decl_symbol_address_collision_output.dart' + ], [ + 'test', + 'collision_tests', + 'expected_bindings', + '_expected_decl_symbol_address_collision_bindings.dart' + ]); + }); + }); +} diff --git a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart new file mode 100644 index 0000000000..b983034b06 --- /dev/null +++ b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart @@ -0,0 +1,65 @@ +// ignore_for_file: unused_element +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +class Bindings_1 { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + Bindings_1(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + Bindings_1.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + void _library() { + return __library(); + } + + late final __library_ptr = + _lookup>('_library'); + late final _dart__library __library = + __library_ptr.asFunction<_dart__library>(); + + void _SymbolAddresses_1() { + return __SymbolAddresses_1(); + } + + late final __SymbolAddresses_1_ptr = + _lookup>( + '_SymbolAddresses_1'); + late final _dart__SymbolAddresses_1 __SymbolAddresses_1 = + __SymbolAddresses_1_ptr.asFunction<_dart__SymbolAddresses_1>(); + + late final addresses = _SymbolAddresses_2(this); +} + +class _SymbolAddresses_2 { + final Bindings_1 _library_1; + _SymbolAddresses_2(this._library_1); + ffi.Pointer> get _library => + _library_1.__library_ptr; + ffi.Pointer> + get _SymbolAddresses_1 => _library_1.__SymbolAddresses_1_ptr; +} + +class addresses extends ffi.Opaque {} + +class _SymbolAddresses extends ffi.Opaque {} + +abstract class Bindings {} + +typedef Native__library = ffi.Void Function(); + +typedef _dart__library = void Function(); + +typedef Native__SymbolAddresses_1 = ffi.Void Function(); + +typedef _dart__SymbolAddresses_1 = void Function(); diff --git a/pkgs/ffigen/test/example_tests/libclang_example_test.dart b/pkgs/ffigen/test/example_tests/libclang_example_test.dart index f047376216..e7cbc56082 100644 --- a/pkgs/ffigen/test/example_tests/libclang_example_test.dart +++ b/pkgs/ffigen/test/example_tests/libclang_example_test.dart @@ -31,6 +31,9 @@ ${strings.compilerOpts}: '-Ithird_party/libclang/include -I/Applications/Xcode.a ${strings.functions}: ${strings.include}: - 'clang_.*' + ${strings.symbolAddress}: + ${strings.include}: + - 'clang_.*' ${strings.structs}: ${strings.include}: - 'CX.*' diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart index f488f34b7d..bc97540ab3 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart @@ -22,25 +22,26 @@ class NativeLibrary { void func( ffi.Pointer> unnamed1, ) { - return (_func ??= - _lookup>('func').asFunction<_dart_func>())( + return _func( unnamed1, ); } - _dart_func? _func; + late final _func_ptr = _lookup>('func'); + late final _dart_func _func = _func_ptr.asFunction<_dart_func>(); void funcWithNativeFunc( ffi.Pointer> named, ) { - return (_funcWithNativeFunc ??= - _lookup>('funcWithNativeFunc') - .asFunction<_dart_funcWithNativeFunc>())( + return _funcWithNativeFunc( named, ); } - _dart_funcWithNativeFunc? _funcWithNativeFunc; + late final _funcWithNativeFunc_ptr = + _lookup>('funcWithNativeFunc'); + late final _dart_funcWithNativeFunc _funcWithNativeFunc = + _funcWithNativeFunc_ptr.asFunction<_dart_funcWithNativeFunc>(); } class struc extends ffi.Struct { diff --git a/pkgs/ffigen/test/header_parser_tests/functions_test.dart b/pkgs/ffigen/test/header_parser_tests/functions_test.dart index c02905d091..ec5c2f680f 100644 --- a/pkgs/ffigen/test/header_parser_tests/functions_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/functions_test.dart @@ -29,6 +29,12 @@ ${strings.headers}: - 'test/header_parser_tests/functions.h' ${strings.includeDirectives}: - '**functions.h' + +${strings.functions}: + ${strings.symbolAddress}: + ${strings.include}: + - func3 + - func4 ''') as yaml.YamlMap), ); }); @@ -92,6 +98,7 @@ Library expectedLibrary() { ), Func( name: 'func3', + exposeSymbolAddress: true, returnType: Type.nativeType( SupportedNativeType.Double, ), @@ -123,6 +130,7 @@ Library expectedLibrary() { ), Func( name: 'func4', + exposeSymbolAddress: true, returnType: Type.pointer(Type.nativeType(SupportedNativeType.Void)), parameters: [ Parameter( diff --git a/pkgs/ffigen/test/header_parser_tests/globals_test.dart b/pkgs/ffigen/test/header_parser_tests/globals_test.dart index 832b89d1d9..db7bf8ea11 100644 --- a/pkgs/ffigen/test/header_parser_tests/globals_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/globals_test.dart @@ -31,6 +31,11 @@ ${strings.headers}: ${strings.globals}: ${strings.exclude}: - GlobalIgnore + ${strings.symbolAddress}: + ${strings.include}: + - myInt + - pointerToLongDouble + - globalStruct # Needed for stdbool.h in MacOS ${strings.compilerOpts}: '-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Headers/ -Wno-nullability-completeness' ''') as yaml.YamlMap), @@ -67,12 +72,22 @@ Library expectedLibrary() { name: 'Bindings', bindings: [ Global(type: Type.boolean(), name: 'coolGlobal'), - Global(type: Type.nativeType(SupportedNativeType.Int32), name: 'myInt'), Global( - type: Type.pointer(Type.nativeType(SupportedNativeType.Int32)), - name: 'aGlobalPointer'), + type: Type.nativeType(SupportedNativeType.Int32), + name: 'myInt', + exposeSymbolAddress: true, + ), + Global( + type: Type.pointer(Type.nativeType(SupportedNativeType.Int32)), + name: 'aGlobalPointer', + exposeSymbolAddress: true, + ), globalStruc, - Global(name: 'globalStruct', type: Type.struct(globalStruc)), + Global( + name: 'globalStruct', + type: Type.struct(globalStruc), + exposeSymbolAddress: true, + ), ], ); } diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart index 751780a80d..818416a8b7 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart @@ -19,95 +19,102 @@ class CJson { : _lookup = lookup; ffi.Pointer cJSON_Version() { - return (_cJSON_Version ??= - _lookup>('cJSON_Version') - .asFunction<_dart_cJSON_Version>())(); + return _cJSON_Version(); } - _dart_cJSON_Version? _cJSON_Version; + late final _cJSON_Version_ptr = + _lookup>('cJSON_Version'); + late final _dart_cJSON_Version _cJSON_Version = + _cJSON_Version_ptr.asFunction<_dart_cJSON_Version>(); void cJSON_InitHooks( ffi.Pointer hooks, ) { - return (_cJSON_InitHooks ??= - _lookup>('cJSON_InitHooks') - .asFunction<_dart_cJSON_InitHooks>())( + return _cJSON_InitHooks( hooks, ); } - _dart_cJSON_InitHooks? _cJSON_InitHooks; + late final _cJSON_InitHooks_ptr = + _lookup>('cJSON_InitHooks'); + late final _dart_cJSON_InitHooks _cJSON_InitHooks = + _cJSON_InitHooks_ptr.asFunction<_dart_cJSON_InitHooks>(); ffi.Pointer cJSON_Parse( ffi.Pointer value, ) { - return (_cJSON_Parse ??= - _lookup>('cJSON_Parse') - .asFunction<_dart_cJSON_Parse>())( + return _cJSON_Parse( value, ); } - _dart_cJSON_Parse? _cJSON_Parse; + late final _cJSON_Parse_ptr = + _lookup>('cJSON_Parse'); + late final _dart_cJSON_Parse _cJSON_Parse = + _cJSON_Parse_ptr.asFunction<_dart_cJSON_Parse>(); ffi.Pointer cJSON_ParseWithOpts( ffi.Pointer value, ffi.Pointer> return_parse_end, int require_null_terminated, ) { - return (_cJSON_ParseWithOpts ??= - _lookup>( - 'cJSON_ParseWithOpts') - .asFunction<_dart_cJSON_ParseWithOpts>())( + return _cJSON_ParseWithOpts( value, return_parse_end, require_null_terminated, ); } - _dart_cJSON_ParseWithOpts? _cJSON_ParseWithOpts; + late final _cJSON_ParseWithOpts_ptr = + _lookup>( + 'cJSON_ParseWithOpts'); + late final _dart_cJSON_ParseWithOpts _cJSON_ParseWithOpts = + _cJSON_ParseWithOpts_ptr.asFunction<_dart_cJSON_ParseWithOpts>(); ffi.Pointer cJSON_Print( ffi.Pointer item, ) { - return (_cJSON_Print ??= - _lookup>('cJSON_Print') - .asFunction<_dart_cJSON_Print>())( + return _cJSON_Print( item, ); } - _dart_cJSON_Print? _cJSON_Print; + late final _cJSON_Print_ptr = + _lookup>('cJSON_Print'); + late final _dart_cJSON_Print _cJSON_Print = + _cJSON_Print_ptr.asFunction<_dart_cJSON_Print>(); ffi.Pointer cJSON_PrintUnformatted( ffi.Pointer item, ) { - return (_cJSON_PrintUnformatted ??= - _lookup>( - 'cJSON_PrintUnformatted') - .asFunction<_dart_cJSON_PrintUnformatted>())( + return _cJSON_PrintUnformatted( item, ); } - _dart_cJSON_PrintUnformatted? _cJSON_PrintUnformatted; + late final _cJSON_PrintUnformatted_ptr = + _lookup>( + 'cJSON_PrintUnformatted'); + late final _dart_cJSON_PrintUnformatted _cJSON_PrintUnformatted = + _cJSON_PrintUnformatted_ptr.asFunction<_dart_cJSON_PrintUnformatted>(); ffi.Pointer cJSON_PrintBuffered( ffi.Pointer item, int prebuffer, int fmt, ) { - return (_cJSON_PrintBuffered ??= - _lookup>( - 'cJSON_PrintBuffered') - .asFunction<_dart_cJSON_PrintBuffered>())( + return _cJSON_PrintBuffered( item, prebuffer, fmt, ); } - _dart_cJSON_PrintBuffered? _cJSON_PrintBuffered; + late final _cJSON_PrintBuffered_ptr = + _lookup>( + 'cJSON_PrintBuffered'); + late final _dart_cJSON_PrintBuffered _cJSON_PrintBuffered = + _cJSON_PrintBuffered_ptr.asFunction<_dart_cJSON_PrintBuffered>(); int cJSON_PrintPreallocated( ffi.Pointer item, @@ -115,10 +122,7 @@ class CJson { int length, int format, ) { - return (_cJSON_PrintPreallocated ??= - _lookup>( - 'cJSON_PrintPreallocated') - .asFunction<_dart_cJSON_PrintPreallocated>())( + return _cJSON_PrintPreallocated( item, buffer, length, @@ -126,916 +130,1003 @@ class CJson { ); } - _dart_cJSON_PrintPreallocated? _cJSON_PrintPreallocated; + late final _cJSON_PrintPreallocated_ptr = + _lookup>( + 'cJSON_PrintPreallocated'); + late final _dart_cJSON_PrintPreallocated _cJSON_PrintPreallocated = + _cJSON_PrintPreallocated_ptr.asFunction<_dart_cJSON_PrintPreallocated>(); void cJSON_Delete( ffi.Pointer item, ) { - return (_cJSON_Delete ??= - _lookup>('cJSON_Delete') - .asFunction<_dart_cJSON_Delete>())( + return _cJSON_Delete( item, ); } - _dart_cJSON_Delete? _cJSON_Delete; + late final _cJSON_Delete_ptr = + _lookup>('cJSON_Delete'); + late final _dart_cJSON_Delete _cJSON_Delete = + _cJSON_Delete_ptr.asFunction<_dart_cJSON_Delete>(); int cJSON_GetArraySize( ffi.Pointer array, ) { - return (_cJSON_GetArraySize ??= - _lookup>('cJSON_GetArraySize') - .asFunction<_dart_cJSON_GetArraySize>())( + return _cJSON_GetArraySize( array, ); } - _dart_cJSON_GetArraySize? _cJSON_GetArraySize; + late final _cJSON_GetArraySize_ptr = + _lookup>('cJSON_GetArraySize'); + late final _dart_cJSON_GetArraySize _cJSON_GetArraySize = + _cJSON_GetArraySize_ptr.asFunction<_dart_cJSON_GetArraySize>(); ffi.Pointer cJSON_GetArrayItem( ffi.Pointer array, int index, ) { - return (_cJSON_GetArrayItem ??= - _lookup>('cJSON_GetArrayItem') - .asFunction<_dart_cJSON_GetArrayItem>())( + return _cJSON_GetArrayItem( array, index, ); } - _dart_cJSON_GetArrayItem? _cJSON_GetArrayItem; + late final _cJSON_GetArrayItem_ptr = + _lookup>('cJSON_GetArrayItem'); + late final _dart_cJSON_GetArrayItem _cJSON_GetArrayItem = + _cJSON_GetArrayItem_ptr.asFunction<_dart_cJSON_GetArrayItem>(); ffi.Pointer cJSON_GetObjectItem( ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_GetObjectItem ??= - _lookup>( - 'cJSON_GetObjectItem') - .asFunction<_dart_cJSON_GetObjectItem>())( + return _cJSON_GetObjectItem( object, string, ); } - _dart_cJSON_GetObjectItem? _cJSON_GetObjectItem; + late final _cJSON_GetObjectItem_ptr = + _lookup>( + 'cJSON_GetObjectItem'); + late final _dart_cJSON_GetObjectItem _cJSON_GetObjectItem = + _cJSON_GetObjectItem_ptr.asFunction<_dart_cJSON_GetObjectItem>(); ffi.Pointer cJSON_GetObjectItemCaseSensitive( ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_GetObjectItemCaseSensitive ??= - _lookup>( - 'cJSON_GetObjectItemCaseSensitive') - .asFunction<_dart_cJSON_GetObjectItemCaseSensitive>())( + return _cJSON_GetObjectItemCaseSensitive( object, string, ); } - _dart_cJSON_GetObjectItemCaseSensitive? _cJSON_GetObjectItemCaseSensitive; + late final _cJSON_GetObjectItemCaseSensitive_ptr = + _lookup>( + 'cJSON_GetObjectItemCaseSensitive'); + late final _dart_cJSON_GetObjectItemCaseSensitive + _cJSON_GetObjectItemCaseSensitive = _cJSON_GetObjectItemCaseSensitive_ptr + .asFunction<_dart_cJSON_GetObjectItemCaseSensitive>(); int cJSON_HasObjectItem( ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_HasObjectItem ??= - _lookup>( - 'cJSON_HasObjectItem') - .asFunction<_dart_cJSON_HasObjectItem>())( + return _cJSON_HasObjectItem( object, string, ); } - _dart_cJSON_HasObjectItem? _cJSON_HasObjectItem; + late final _cJSON_HasObjectItem_ptr = + _lookup>( + 'cJSON_HasObjectItem'); + late final _dart_cJSON_HasObjectItem _cJSON_HasObjectItem = + _cJSON_HasObjectItem_ptr.asFunction<_dart_cJSON_HasObjectItem>(); ffi.Pointer cJSON_GetErrorPtr() { - return (_cJSON_GetErrorPtr ??= - _lookup>('cJSON_GetErrorPtr') - .asFunction<_dart_cJSON_GetErrorPtr>())(); + return _cJSON_GetErrorPtr(); } - _dart_cJSON_GetErrorPtr? _cJSON_GetErrorPtr; + late final _cJSON_GetErrorPtr_ptr = + _lookup>('cJSON_GetErrorPtr'); + late final _dart_cJSON_GetErrorPtr _cJSON_GetErrorPtr = + _cJSON_GetErrorPtr_ptr.asFunction<_dart_cJSON_GetErrorPtr>(); ffi.Pointer cJSON_GetStringValue( ffi.Pointer item, ) { - return (_cJSON_GetStringValue ??= - _lookup>( - 'cJSON_GetStringValue') - .asFunction<_dart_cJSON_GetStringValue>())( + return _cJSON_GetStringValue( item, ); } - _dart_cJSON_GetStringValue? _cJSON_GetStringValue; + late final _cJSON_GetStringValue_ptr = + _lookup>( + 'cJSON_GetStringValue'); + late final _dart_cJSON_GetStringValue _cJSON_GetStringValue = + _cJSON_GetStringValue_ptr.asFunction<_dart_cJSON_GetStringValue>(); int cJSON_IsInvalid( ffi.Pointer item, ) { - return (_cJSON_IsInvalid ??= - _lookup>('cJSON_IsInvalid') - .asFunction<_dart_cJSON_IsInvalid>())( + return _cJSON_IsInvalid( item, ); } - _dart_cJSON_IsInvalid? _cJSON_IsInvalid; + late final _cJSON_IsInvalid_ptr = + _lookup>('cJSON_IsInvalid'); + late final _dart_cJSON_IsInvalid _cJSON_IsInvalid = + _cJSON_IsInvalid_ptr.asFunction<_dart_cJSON_IsInvalid>(); int cJSON_IsFalse( ffi.Pointer item, ) { - return (_cJSON_IsFalse ??= - _lookup>('cJSON_IsFalse') - .asFunction<_dart_cJSON_IsFalse>())( + return _cJSON_IsFalse( item, ); } - _dart_cJSON_IsFalse? _cJSON_IsFalse; + late final _cJSON_IsFalse_ptr = + _lookup>('cJSON_IsFalse'); + late final _dart_cJSON_IsFalse _cJSON_IsFalse = + _cJSON_IsFalse_ptr.asFunction<_dart_cJSON_IsFalse>(); int cJSON_IsTrue( ffi.Pointer item, ) { - return (_cJSON_IsTrue ??= - _lookup>('cJSON_IsTrue') - .asFunction<_dart_cJSON_IsTrue>())( + return _cJSON_IsTrue( item, ); } - _dart_cJSON_IsTrue? _cJSON_IsTrue; + late final _cJSON_IsTrue_ptr = + _lookup>('cJSON_IsTrue'); + late final _dart_cJSON_IsTrue _cJSON_IsTrue = + _cJSON_IsTrue_ptr.asFunction<_dart_cJSON_IsTrue>(); int cJSON_IsBool( ffi.Pointer item, ) { - return (_cJSON_IsBool ??= - _lookup>('cJSON_IsBool') - .asFunction<_dart_cJSON_IsBool>())( + return _cJSON_IsBool( item, ); } - _dart_cJSON_IsBool? _cJSON_IsBool; + late final _cJSON_IsBool_ptr = + _lookup>('cJSON_IsBool'); + late final _dart_cJSON_IsBool _cJSON_IsBool = + _cJSON_IsBool_ptr.asFunction<_dart_cJSON_IsBool>(); int cJSON_IsNull( ffi.Pointer item, ) { - return (_cJSON_IsNull ??= - _lookup>('cJSON_IsNull') - .asFunction<_dart_cJSON_IsNull>())( + return _cJSON_IsNull( item, ); } - _dart_cJSON_IsNull? _cJSON_IsNull; + late final _cJSON_IsNull_ptr = + _lookup>('cJSON_IsNull'); + late final _dart_cJSON_IsNull _cJSON_IsNull = + _cJSON_IsNull_ptr.asFunction<_dart_cJSON_IsNull>(); int cJSON_IsNumber( ffi.Pointer item, ) { - return (_cJSON_IsNumber ??= - _lookup>('cJSON_IsNumber') - .asFunction<_dart_cJSON_IsNumber>())( + return _cJSON_IsNumber( item, ); } - _dart_cJSON_IsNumber? _cJSON_IsNumber; + late final _cJSON_IsNumber_ptr = + _lookup>('cJSON_IsNumber'); + late final _dart_cJSON_IsNumber _cJSON_IsNumber = + _cJSON_IsNumber_ptr.asFunction<_dart_cJSON_IsNumber>(); int cJSON_IsString( ffi.Pointer item, ) { - return (_cJSON_IsString ??= - _lookup>('cJSON_IsString') - .asFunction<_dart_cJSON_IsString>())( + return _cJSON_IsString( item, ); } - _dart_cJSON_IsString? _cJSON_IsString; + late final _cJSON_IsString_ptr = + _lookup>('cJSON_IsString'); + late final _dart_cJSON_IsString _cJSON_IsString = + _cJSON_IsString_ptr.asFunction<_dart_cJSON_IsString>(); int cJSON_IsArray( ffi.Pointer item, ) { - return (_cJSON_IsArray ??= - _lookup>('cJSON_IsArray') - .asFunction<_dart_cJSON_IsArray>())( + return _cJSON_IsArray( item, ); } - _dart_cJSON_IsArray? _cJSON_IsArray; + late final _cJSON_IsArray_ptr = + _lookup>('cJSON_IsArray'); + late final _dart_cJSON_IsArray _cJSON_IsArray = + _cJSON_IsArray_ptr.asFunction<_dart_cJSON_IsArray>(); int cJSON_IsObject( ffi.Pointer item, ) { - return (_cJSON_IsObject ??= - _lookup>('cJSON_IsObject') - .asFunction<_dart_cJSON_IsObject>())( + return _cJSON_IsObject( item, ); } - _dart_cJSON_IsObject? _cJSON_IsObject; + late final _cJSON_IsObject_ptr = + _lookup>('cJSON_IsObject'); + late final _dart_cJSON_IsObject _cJSON_IsObject = + _cJSON_IsObject_ptr.asFunction<_dart_cJSON_IsObject>(); int cJSON_IsRaw( ffi.Pointer item, ) { - return (_cJSON_IsRaw ??= - _lookup>('cJSON_IsRaw') - .asFunction<_dart_cJSON_IsRaw>())( + return _cJSON_IsRaw( item, ); } - _dart_cJSON_IsRaw? _cJSON_IsRaw; + late final _cJSON_IsRaw_ptr = + _lookup>('cJSON_IsRaw'); + late final _dart_cJSON_IsRaw _cJSON_IsRaw = + _cJSON_IsRaw_ptr.asFunction<_dart_cJSON_IsRaw>(); ffi.Pointer cJSON_CreateNull() { - return (_cJSON_CreateNull ??= - _lookup>('cJSON_CreateNull') - .asFunction<_dart_cJSON_CreateNull>())(); + return _cJSON_CreateNull(); } - _dart_cJSON_CreateNull? _cJSON_CreateNull; + late final _cJSON_CreateNull_ptr = + _lookup>('cJSON_CreateNull'); + late final _dart_cJSON_CreateNull _cJSON_CreateNull = + _cJSON_CreateNull_ptr.asFunction<_dart_cJSON_CreateNull>(); ffi.Pointer cJSON_CreateTrue() { - return (_cJSON_CreateTrue ??= - _lookup>('cJSON_CreateTrue') - .asFunction<_dart_cJSON_CreateTrue>())(); + return _cJSON_CreateTrue(); } - _dart_cJSON_CreateTrue? _cJSON_CreateTrue; + late final _cJSON_CreateTrue_ptr = + _lookup>('cJSON_CreateTrue'); + late final _dart_cJSON_CreateTrue _cJSON_CreateTrue = + _cJSON_CreateTrue_ptr.asFunction<_dart_cJSON_CreateTrue>(); ffi.Pointer cJSON_CreateFalse() { - return (_cJSON_CreateFalse ??= - _lookup>('cJSON_CreateFalse') - .asFunction<_dart_cJSON_CreateFalse>())(); + return _cJSON_CreateFalse(); } - _dart_cJSON_CreateFalse? _cJSON_CreateFalse; + late final _cJSON_CreateFalse_ptr = + _lookup>('cJSON_CreateFalse'); + late final _dart_cJSON_CreateFalse _cJSON_CreateFalse = + _cJSON_CreateFalse_ptr.asFunction<_dart_cJSON_CreateFalse>(); ffi.Pointer cJSON_CreateBool( int boolean, ) { - return (_cJSON_CreateBool ??= - _lookup>('cJSON_CreateBool') - .asFunction<_dart_cJSON_CreateBool>())( + return _cJSON_CreateBool( boolean, ); } - _dart_cJSON_CreateBool? _cJSON_CreateBool; + late final _cJSON_CreateBool_ptr = + _lookup>('cJSON_CreateBool'); + late final _dart_cJSON_CreateBool _cJSON_CreateBool = + _cJSON_CreateBool_ptr.asFunction<_dart_cJSON_CreateBool>(); ffi.Pointer cJSON_CreateNumber( double num, ) { - return (_cJSON_CreateNumber ??= - _lookup>('cJSON_CreateNumber') - .asFunction<_dart_cJSON_CreateNumber>())( + return _cJSON_CreateNumber( num, ); } - _dart_cJSON_CreateNumber? _cJSON_CreateNumber; + late final _cJSON_CreateNumber_ptr = + _lookup>('cJSON_CreateNumber'); + late final _dart_cJSON_CreateNumber _cJSON_CreateNumber = + _cJSON_CreateNumber_ptr.asFunction<_dart_cJSON_CreateNumber>(); ffi.Pointer cJSON_CreateString( ffi.Pointer string, ) { - return (_cJSON_CreateString ??= - _lookup>('cJSON_CreateString') - .asFunction<_dart_cJSON_CreateString>())( + return _cJSON_CreateString( string, ); } - _dart_cJSON_CreateString? _cJSON_CreateString; + late final _cJSON_CreateString_ptr = + _lookup>('cJSON_CreateString'); + late final _dart_cJSON_CreateString _cJSON_CreateString = + _cJSON_CreateString_ptr.asFunction<_dart_cJSON_CreateString>(); ffi.Pointer cJSON_CreateRaw( ffi.Pointer raw, ) { - return (_cJSON_CreateRaw ??= - _lookup>('cJSON_CreateRaw') - .asFunction<_dart_cJSON_CreateRaw>())( + return _cJSON_CreateRaw( raw, ); } - _dart_cJSON_CreateRaw? _cJSON_CreateRaw; + late final _cJSON_CreateRaw_ptr = + _lookup>('cJSON_CreateRaw'); + late final _dart_cJSON_CreateRaw _cJSON_CreateRaw = + _cJSON_CreateRaw_ptr.asFunction<_dart_cJSON_CreateRaw>(); ffi.Pointer cJSON_CreateArray() { - return (_cJSON_CreateArray ??= - _lookup>('cJSON_CreateArray') - .asFunction<_dart_cJSON_CreateArray>())(); + return _cJSON_CreateArray(); } - _dart_cJSON_CreateArray? _cJSON_CreateArray; + late final _cJSON_CreateArray_ptr = + _lookup>('cJSON_CreateArray'); + late final _dart_cJSON_CreateArray _cJSON_CreateArray = + _cJSON_CreateArray_ptr.asFunction<_dart_cJSON_CreateArray>(); ffi.Pointer cJSON_CreateObject() { - return (_cJSON_CreateObject ??= - _lookup>('cJSON_CreateObject') - .asFunction<_dart_cJSON_CreateObject>())(); + return _cJSON_CreateObject(); } - _dart_cJSON_CreateObject? _cJSON_CreateObject; + late final _cJSON_CreateObject_ptr = + _lookup>('cJSON_CreateObject'); + late final _dart_cJSON_CreateObject _cJSON_CreateObject = + _cJSON_CreateObject_ptr.asFunction<_dart_cJSON_CreateObject>(); ffi.Pointer cJSON_CreateStringReference( ffi.Pointer string, ) { - return (_cJSON_CreateStringReference ??= - _lookup>( - 'cJSON_CreateStringReference') - .asFunction<_dart_cJSON_CreateStringReference>())( + return _cJSON_CreateStringReference( string, ); } - _dart_cJSON_CreateStringReference? _cJSON_CreateStringReference; + late final _cJSON_CreateStringReference_ptr = + _lookup>( + 'cJSON_CreateStringReference'); + late final _dart_cJSON_CreateStringReference _cJSON_CreateStringReference = + _cJSON_CreateStringReference_ptr + .asFunction<_dart_cJSON_CreateStringReference>(); ffi.Pointer cJSON_CreateObjectReference( ffi.Pointer child, ) { - return (_cJSON_CreateObjectReference ??= - _lookup>( - 'cJSON_CreateObjectReference') - .asFunction<_dart_cJSON_CreateObjectReference>())( + return _cJSON_CreateObjectReference( child, ); } - _dart_cJSON_CreateObjectReference? _cJSON_CreateObjectReference; + late final _cJSON_CreateObjectReference_ptr = + _lookup>( + 'cJSON_CreateObjectReference'); + late final _dart_cJSON_CreateObjectReference _cJSON_CreateObjectReference = + _cJSON_CreateObjectReference_ptr + .asFunction<_dart_cJSON_CreateObjectReference>(); ffi.Pointer cJSON_CreateArrayReference( ffi.Pointer child, ) { - return (_cJSON_CreateArrayReference ??= - _lookup>( - 'cJSON_CreateArrayReference') - .asFunction<_dart_cJSON_CreateArrayReference>())( + return _cJSON_CreateArrayReference( child, ); } - _dart_cJSON_CreateArrayReference? _cJSON_CreateArrayReference; + late final _cJSON_CreateArrayReference_ptr = + _lookup>( + 'cJSON_CreateArrayReference'); + late final _dart_cJSON_CreateArrayReference _cJSON_CreateArrayReference = + _cJSON_CreateArrayReference_ptr + .asFunction<_dart_cJSON_CreateArrayReference>(); ffi.Pointer cJSON_CreateIntArray( ffi.Pointer numbers, int count, ) { - return (_cJSON_CreateIntArray ??= - _lookup>( - 'cJSON_CreateIntArray') - .asFunction<_dart_cJSON_CreateIntArray>())( + return _cJSON_CreateIntArray( numbers, count, ); } - _dart_cJSON_CreateIntArray? _cJSON_CreateIntArray; + late final _cJSON_CreateIntArray_ptr = + _lookup>( + 'cJSON_CreateIntArray'); + late final _dart_cJSON_CreateIntArray _cJSON_CreateIntArray = + _cJSON_CreateIntArray_ptr.asFunction<_dart_cJSON_CreateIntArray>(); ffi.Pointer cJSON_CreateFloatArray( ffi.Pointer numbers, int count, ) { - return (_cJSON_CreateFloatArray ??= - _lookup>( - 'cJSON_CreateFloatArray') - .asFunction<_dart_cJSON_CreateFloatArray>())( + return _cJSON_CreateFloatArray( numbers, count, ); } - _dart_cJSON_CreateFloatArray? _cJSON_CreateFloatArray; + late final _cJSON_CreateFloatArray_ptr = + _lookup>( + 'cJSON_CreateFloatArray'); + late final _dart_cJSON_CreateFloatArray _cJSON_CreateFloatArray = + _cJSON_CreateFloatArray_ptr.asFunction<_dart_cJSON_CreateFloatArray>(); ffi.Pointer cJSON_CreateDoubleArray( ffi.Pointer numbers, int count, ) { - return (_cJSON_CreateDoubleArray ??= - _lookup>( - 'cJSON_CreateDoubleArray') - .asFunction<_dart_cJSON_CreateDoubleArray>())( + return _cJSON_CreateDoubleArray( numbers, count, ); } - _dart_cJSON_CreateDoubleArray? _cJSON_CreateDoubleArray; + late final _cJSON_CreateDoubleArray_ptr = + _lookup>( + 'cJSON_CreateDoubleArray'); + late final _dart_cJSON_CreateDoubleArray _cJSON_CreateDoubleArray = + _cJSON_CreateDoubleArray_ptr.asFunction<_dart_cJSON_CreateDoubleArray>(); ffi.Pointer cJSON_CreateStringArray( ffi.Pointer> strings, int count, ) { - return (_cJSON_CreateStringArray ??= - _lookup>( - 'cJSON_CreateStringArray') - .asFunction<_dart_cJSON_CreateStringArray>())( + return _cJSON_CreateStringArray( strings, count, ); } - _dart_cJSON_CreateStringArray? _cJSON_CreateStringArray; + late final _cJSON_CreateStringArray_ptr = + _lookup>( + 'cJSON_CreateStringArray'); + late final _dart_cJSON_CreateStringArray _cJSON_CreateStringArray = + _cJSON_CreateStringArray_ptr.asFunction<_dart_cJSON_CreateStringArray>(); void cJSON_AddItemToArray( ffi.Pointer array, ffi.Pointer item, ) { - return (_cJSON_AddItemToArray ??= - _lookup>( - 'cJSON_AddItemToArray') - .asFunction<_dart_cJSON_AddItemToArray>())( + return _cJSON_AddItemToArray( array, item, ); } - _dart_cJSON_AddItemToArray? _cJSON_AddItemToArray; + late final _cJSON_AddItemToArray_ptr = + _lookup>( + 'cJSON_AddItemToArray'); + late final _dart_cJSON_AddItemToArray _cJSON_AddItemToArray = + _cJSON_AddItemToArray_ptr.asFunction<_dart_cJSON_AddItemToArray>(); void cJSON_AddItemToObject( ffi.Pointer object, ffi.Pointer string, ffi.Pointer item, ) { - return (_cJSON_AddItemToObject ??= - _lookup>( - 'cJSON_AddItemToObject') - .asFunction<_dart_cJSON_AddItemToObject>())( + return _cJSON_AddItemToObject( object, string, item, ); } - _dart_cJSON_AddItemToObject? _cJSON_AddItemToObject; + late final _cJSON_AddItemToObject_ptr = + _lookup>( + 'cJSON_AddItemToObject'); + late final _dart_cJSON_AddItemToObject _cJSON_AddItemToObject = + _cJSON_AddItemToObject_ptr.asFunction<_dart_cJSON_AddItemToObject>(); void cJSON_AddItemToObjectCS( ffi.Pointer object, ffi.Pointer string, ffi.Pointer item, ) { - return (_cJSON_AddItemToObjectCS ??= - _lookup>( - 'cJSON_AddItemToObjectCS') - .asFunction<_dart_cJSON_AddItemToObjectCS>())( + return _cJSON_AddItemToObjectCS( object, string, item, ); } - _dart_cJSON_AddItemToObjectCS? _cJSON_AddItemToObjectCS; + late final _cJSON_AddItemToObjectCS_ptr = + _lookup>( + 'cJSON_AddItemToObjectCS'); + late final _dart_cJSON_AddItemToObjectCS _cJSON_AddItemToObjectCS = + _cJSON_AddItemToObjectCS_ptr.asFunction<_dart_cJSON_AddItemToObjectCS>(); void cJSON_AddItemReferenceToArray( ffi.Pointer array, ffi.Pointer item, ) { - return (_cJSON_AddItemReferenceToArray ??= - _lookup>( - 'cJSON_AddItemReferenceToArray') - .asFunction<_dart_cJSON_AddItemReferenceToArray>())( + return _cJSON_AddItemReferenceToArray( array, item, ); } - _dart_cJSON_AddItemReferenceToArray? _cJSON_AddItemReferenceToArray; + late final _cJSON_AddItemReferenceToArray_ptr = + _lookup>( + 'cJSON_AddItemReferenceToArray'); + late final _dart_cJSON_AddItemReferenceToArray + _cJSON_AddItemReferenceToArray = _cJSON_AddItemReferenceToArray_ptr + .asFunction<_dart_cJSON_AddItemReferenceToArray>(); void cJSON_AddItemReferenceToObject( ffi.Pointer object, ffi.Pointer string, ffi.Pointer item, ) { - return (_cJSON_AddItemReferenceToObject ??= - _lookup>( - 'cJSON_AddItemReferenceToObject') - .asFunction<_dart_cJSON_AddItemReferenceToObject>())( + return _cJSON_AddItemReferenceToObject( object, string, item, ); } - _dart_cJSON_AddItemReferenceToObject? _cJSON_AddItemReferenceToObject; + late final _cJSON_AddItemReferenceToObject_ptr = + _lookup>( + 'cJSON_AddItemReferenceToObject'); + late final _dart_cJSON_AddItemReferenceToObject + _cJSON_AddItemReferenceToObject = _cJSON_AddItemReferenceToObject_ptr + .asFunction<_dart_cJSON_AddItemReferenceToObject>(); ffi.Pointer cJSON_DetachItemViaPointer( ffi.Pointer parent, ffi.Pointer item, ) { - return (_cJSON_DetachItemViaPointer ??= - _lookup>( - 'cJSON_DetachItemViaPointer') - .asFunction<_dart_cJSON_DetachItemViaPointer>())( + return _cJSON_DetachItemViaPointer( parent, item, ); } - _dart_cJSON_DetachItemViaPointer? _cJSON_DetachItemViaPointer; + late final _cJSON_DetachItemViaPointer_ptr = + _lookup>( + 'cJSON_DetachItemViaPointer'); + late final _dart_cJSON_DetachItemViaPointer _cJSON_DetachItemViaPointer = + _cJSON_DetachItemViaPointer_ptr + .asFunction<_dart_cJSON_DetachItemViaPointer>(); ffi.Pointer cJSON_DetachItemFromArray( ffi.Pointer array, int which, ) { - return (_cJSON_DetachItemFromArray ??= - _lookup>( - 'cJSON_DetachItemFromArray') - .asFunction<_dart_cJSON_DetachItemFromArray>())( + return _cJSON_DetachItemFromArray( array, which, ); } - _dart_cJSON_DetachItemFromArray? _cJSON_DetachItemFromArray; + late final _cJSON_DetachItemFromArray_ptr = + _lookup>( + 'cJSON_DetachItemFromArray'); + late final _dart_cJSON_DetachItemFromArray _cJSON_DetachItemFromArray = + _cJSON_DetachItemFromArray_ptr + .asFunction<_dart_cJSON_DetachItemFromArray>(); void cJSON_DeleteItemFromArray( ffi.Pointer array, int which, ) { - return (_cJSON_DeleteItemFromArray ??= - _lookup>( - 'cJSON_DeleteItemFromArray') - .asFunction<_dart_cJSON_DeleteItemFromArray>())( + return _cJSON_DeleteItemFromArray( array, which, ); } - _dart_cJSON_DeleteItemFromArray? _cJSON_DeleteItemFromArray; + late final _cJSON_DeleteItemFromArray_ptr = + _lookup>( + 'cJSON_DeleteItemFromArray'); + late final _dart_cJSON_DeleteItemFromArray _cJSON_DeleteItemFromArray = + _cJSON_DeleteItemFromArray_ptr + .asFunction<_dart_cJSON_DeleteItemFromArray>(); ffi.Pointer cJSON_DetachItemFromObject( ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_DetachItemFromObject ??= - _lookup>( - 'cJSON_DetachItemFromObject') - .asFunction<_dart_cJSON_DetachItemFromObject>())( + return _cJSON_DetachItemFromObject( object, string, ); } - _dart_cJSON_DetachItemFromObject? _cJSON_DetachItemFromObject; + late final _cJSON_DetachItemFromObject_ptr = + _lookup>( + 'cJSON_DetachItemFromObject'); + late final _dart_cJSON_DetachItemFromObject _cJSON_DetachItemFromObject = + _cJSON_DetachItemFromObject_ptr + .asFunction<_dart_cJSON_DetachItemFromObject>(); ffi.Pointer cJSON_DetachItemFromObjectCaseSensitive( ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_DetachItemFromObjectCaseSensitive ??= - _lookup>( - 'cJSON_DetachItemFromObjectCaseSensitive') - .asFunction<_dart_cJSON_DetachItemFromObjectCaseSensitive>())( + return _cJSON_DetachItemFromObjectCaseSensitive( object, string, ); } - _dart_cJSON_DetachItemFromObjectCaseSensitive? - _cJSON_DetachItemFromObjectCaseSensitive; + late final _cJSON_DetachItemFromObjectCaseSensitive_ptr = + _lookup>( + 'cJSON_DetachItemFromObjectCaseSensitive'); + late final _dart_cJSON_DetachItemFromObjectCaseSensitive + _cJSON_DetachItemFromObjectCaseSensitive = + _cJSON_DetachItemFromObjectCaseSensitive_ptr + .asFunction<_dart_cJSON_DetachItemFromObjectCaseSensitive>(); void cJSON_DeleteItemFromObject( ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_DeleteItemFromObject ??= - _lookup>( - 'cJSON_DeleteItemFromObject') - .asFunction<_dart_cJSON_DeleteItemFromObject>())( + return _cJSON_DeleteItemFromObject( object, string, ); } - _dart_cJSON_DeleteItemFromObject? _cJSON_DeleteItemFromObject; + late final _cJSON_DeleteItemFromObject_ptr = + _lookup>( + 'cJSON_DeleteItemFromObject'); + late final _dart_cJSON_DeleteItemFromObject _cJSON_DeleteItemFromObject = + _cJSON_DeleteItemFromObject_ptr + .asFunction<_dart_cJSON_DeleteItemFromObject>(); void cJSON_DeleteItemFromObjectCaseSensitive( ffi.Pointer object, ffi.Pointer string, ) { - return (_cJSON_DeleteItemFromObjectCaseSensitive ??= - _lookup>( - 'cJSON_DeleteItemFromObjectCaseSensitive') - .asFunction<_dart_cJSON_DeleteItemFromObjectCaseSensitive>())( + return _cJSON_DeleteItemFromObjectCaseSensitive( object, string, ); } - _dart_cJSON_DeleteItemFromObjectCaseSensitive? - _cJSON_DeleteItemFromObjectCaseSensitive; + late final _cJSON_DeleteItemFromObjectCaseSensitive_ptr = + _lookup>( + 'cJSON_DeleteItemFromObjectCaseSensitive'); + late final _dart_cJSON_DeleteItemFromObjectCaseSensitive + _cJSON_DeleteItemFromObjectCaseSensitive = + _cJSON_DeleteItemFromObjectCaseSensitive_ptr + .asFunction<_dart_cJSON_DeleteItemFromObjectCaseSensitive>(); void cJSON_InsertItemInArray( ffi.Pointer array, int which, ffi.Pointer newitem, ) { - return (_cJSON_InsertItemInArray ??= - _lookup>( - 'cJSON_InsertItemInArray') - .asFunction<_dart_cJSON_InsertItemInArray>())( + return _cJSON_InsertItemInArray( array, which, newitem, ); } - _dart_cJSON_InsertItemInArray? _cJSON_InsertItemInArray; + late final _cJSON_InsertItemInArray_ptr = + _lookup>( + 'cJSON_InsertItemInArray'); + late final _dart_cJSON_InsertItemInArray _cJSON_InsertItemInArray = + _cJSON_InsertItemInArray_ptr.asFunction<_dart_cJSON_InsertItemInArray>(); int cJSON_ReplaceItemViaPointer( ffi.Pointer parent, ffi.Pointer item, ffi.Pointer replacement, ) { - return (_cJSON_ReplaceItemViaPointer ??= - _lookup>( - 'cJSON_ReplaceItemViaPointer') - .asFunction<_dart_cJSON_ReplaceItemViaPointer>())( + return _cJSON_ReplaceItemViaPointer( parent, item, replacement, ); } - _dart_cJSON_ReplaceItemViaPointer? _cJSON_ReplaceItemViaPointer; + late final _cJSON_ReplaceItemViaPointer_ptr = + _lookup>( + 'cJSON_ReplaceItemViaPointer'); + late final _dart_cJSON_ReplaceItemViaPointer _cJSON_ReplaceItemViaPointer = + _cJSON_ReplaceItemViaPointer_ptr + .asFunction<_dart_cJSON_ReplaceItemViaPointer>(); void cJSON_ReplaceItemInArray( ffi.Pointer array, int which, ffi.Pointer newitem, ) { - return (_cJSON_ReplaceItemInArray ??= - _lookup>( - 'cJSON_ReplaceItemInArray') - .asFunction<_dart_cJSON_ReplaceItemInArray>())( + return _cJSON_ReplaceItemInArray( array, which, newitem, ); } - _dart_cJSON_ReplaceItemInArray? _cJSON_ReplaceItemInArray; + late final _cJSON_ReplaceItemInArray_ptr = + _lookup>( + 'cJSON_ReplaceItemInArray'); + late final _dart_cJSON_ReplaceItemInArray _cJSON_ReplaceItemInArray = + _cJSON_ReplaceItemInArray_ptr + .asFunction<_dart_cJSON_ReplaceItemInArray>(); void cJSON_ReplaceItemInObject( ffi.Pointer object, ffi.Pointer string, ffi.Pointer newitem, ) { - return (_cJSON_ReplaceItemInObject ??= - _lookup>( - 'cJSON_ReplaceItemInObject') - .asFunction<_dart_cJSON_ReplaceItemInObject>())( + return _cJSON_ReplaceItemInObject( object, string, newitem, ); } - _dart_cJSON_ReplaceItemInObject? _cJSON_ReplaceItemInObject; + late final _cJSON_ReplaceItemInObject_ptr = + _lookup>( + 'cJSON_ReplaceItemInObject'); + late final _dart_cJSON_ReplaceItemInObject _cJSON_ReplaceItemInObject = + _cJSON_ReplaceItemInObject_ptr + .asFunction<_dart_cJSON_ReplaceItemInObject>(); void cJSON_ReplaceItemInObjectCaseSensitive( ffi.Pointer object, ffi.Pointer string, ffi.Pointer newitem, ) { - return (_cJSON_ReplaceItemInObjectCaseSensitive ??= - _lookup>( - 'cJSON_ReplaceItemInObjectCaseSensitive') - .asFunction<_dart_cJSON_ReplaceItemInObjectCaseSensitive>())( + return _cJSON_ReplaceItemInObjectCaseSensitive( object, string, newitem, ); } - _dart_cJSON_ReplaceItemInObjectCaseSensitive? - _cJSON_ReplaceItemInObjectCaseSensitive; + late final _cJSON_ReplaceItemInObjectCaseSensitive_ptr = + _lookup>( + 'cJSON_ReplaceItemInObjectCaseSensitive'); + late final _dart_cJSON_ReplaceItemInObjectCaseSensitive + _cJSON_ReplaceItemInObjectCaseSensitive = + _cJSON_ReplaceItemInObjectCaseSensitive_ptr + .asFunction<_dart_cJSON_ReplaceItemInObjectCaseSensitive>(); ffi.Pointer cJSON_Duplicate( ffi.Pointer item, int recurse, ) { - return (_cJSON_Duplicate ??= - _lookup>('cJSON_Duplicate') - .asFunction<_dart_cJSON_Duplicate>())( + return _cJSON_Duplicate( item, recurse, ); } - _dart_cJSON_Duplicate? _cJSON_Duplicate; + late final _cJSON_Duplicate_ptr = + _lookup>('cJSON_Duplicate'); + late final _dart_cJSON_Duplicate _cJSON_Duplicate = + _cJSON_Duplicate_ptr.asFunction<_dart_cJSON_Duplicate>(); int cJSON_Compare( ffi.Pointer a, ffi.Pointer b, int case_sensitive, ) { - return (_cJSON_Compare ??= - _lookup>('cJSON_Compare') - .asFunction<_dart_cJSON_Compare>())( + return _cJSON_Compare( a, b, case_sensitive, ); } - _dart_cJSON_Compare? _cJSON_Compare; + late final _cJSON_Compare_ptr = + _lookup>('cJSON_Compare'); + late final _dart_cJSON_Compare _cJSON_Compare = + _cJSON_Compare_ptr.asFunction<_dart_cJSON_Compare>(); void cJSON_Minify( ffi.Pointer json, ) { - return (_cJSON_Minify ??= - _lookup>('cJSON_Minify') - .asFunction<_dart_cJSON_Minify>())( + return _cJSON_Minify( json, ); } - _dart_cJSON_Minify? _cJSON_Minify; + late final _cJSON_Minify_ptr = + _lookup>('cJSON_Minify'); + late final _dart_cJSON_Minify _cJSON_Minify = + _cJSON_Minify_ptr.asFunction<_dart_cJSON_Minify>(); ffi.Pointer cJSON_AddNullToObject( ffi.Pointer object, ffi.Pointer name, ) { - return (_cJSON_AddNullToObject ??= - _lookup>( - 'cJSON_AddNullToObject') - .asFunction<_dart_cJSON_AddNullToObject>())( + return _cJSON_AddNullToObject( object, name, ); } - _dart_cJSON_AddNullToObject? _cJSON_AddNullToObject; + late final _cJSON_AddNullToObject_ptr = + _lookup>( + 'cJSON_AddNullToObject'); + late final _dart_cJSON_AddNullToObject _cJSON_AddNullToObject = + _cJSON_AddNullToObject_ptr.asFunction<_dart_cJSON_AddNullToObject>(); ffi.Pointer cJSON_AddTrueToObject( ffi.Pointer object, ffi.Pointer name, ) { - return (_cJSON_AddTrueToObject ??= - _lookup>( - 'cJSON_AddTrueToObject') - .asFunction<_dart_cJSON_AddTrueToObject>())( + return _cJSON_AddTrueToObject( object, name, ); } - _dart_cJSON_AddTrueToObject? _cJSON_AddTrueToObject; + late final _cJSON_AddTrueToObject_ptr = + _lookup>( + 'cJSON_AddTrueToObject'); + late final _dart_cJSON_AddTrueToObject _cJSON_AddTrueToObject = + _cJSON_AddTrueToObject_ptr.asFunction<_dart_cJSON_AddTrueToObject>(); ffi.Pointer cJSON_AddFalseToObject( ffi.Pointer object, ffi.Pointer name, ) { - return (_cJSON_AddFalseToObject ??= - _lookup>( - 'cJSON_AddFalseToObject') - .asFunction<_dart_cJSON_AddFalseToObject>())( + return _cJSON_AddFalseToObject( object, name, ); } - _dart_cJSON_AddFalseToObject? _cJSON_AddFalseToObject; + late final _cJSON_AddFalseToObject_ptr = + _lookup>( + 'cJSON_AddFalseToObject'); + late final _dart_cJSON_AddFalseToObject _cJSON_AddFalseToObject = + _cJSON_AddFalseToObject_ptr.asFunction<_dart_cJSON_AddFalseToObject>(); ffi.Pointer cJSON_AddBoolToObject( ffi.Pointer object, ffi.Pointer name, int boolean, ) { - return (_cJSON_AddBoolToObject ??= - _lookup>( - 'cJSON_AddBoolToObject') - .asFunction<_dart_cJSON_AddBoolToObject>())( + return _cJSON_AddBoolToObject( object, name, boolean, ); } - _dart_cJSON_AddBoolToObject? _cJSON_AddBoolToObject; + late final _cJSON_AddBoolToObject_ptr = + _lookup>( + 'cJSON_AddBoolToObject'); + late final _dart_cJSON_AddBoolToObject _cJSON_AddBoolToObject = + _cJSON_AddBoolToObject_ptr.asFunction<_dart_cJSON_AddBoolToObject>(); ffi.Pointer cJSON_AddNumberToObject( ffi.Pointer object, ffi.Pointer name, double number, ) { - return (_cJSON_AddNumberToObject ??= - _lookup>( - 'cJSON_AddNumberToObject') - .asFunction<_dart_cJSON_AddNumberToObject>())( + return _cJSON_AddNumberToObject( object, name, number, ); } - _dart_cJSON_AddNumberToObject? _cJSON_AddNumberToObject; + late final _cJSON_AddNumberToObject_ptr = + _lookup>( + 'cJSON_AddNumberToObject'); + late final _dart_cJSON_AddNumberToObject _cJSON_AddNumberToObject = + _cJSON_AddNumberToObject_ptr.asFunction<_dart_cJSON_AddNumberToObject>(); ffi.Pointer cJSON_AddStringToObject( ffi.Pointer object, ffi.Pointer name, ffi.Pointer string, ) { - return (_cJSON_AddStringToObject ??= - _lookup>( - 'cJSON_AddStringToObject') - .asFunction<_dart_cJSON_AddStringToObject>())( + return _cJSON_AddStringToObject( object, name, string, ); } - _dart_cJSON_AddStringToObject? _cJSON_AddStringToObject; + late final _cJSON_AddStringToObject_ptr = + _lookup>( + 'cJSON_AddStringToObject'); + late final _dart_cJSON_AddStringToObject _cJSON_AddStringToObject = + _cJSON_AddStringToObject_ptr.asFunction<_dart_cJSON_AddStringToObject>(); ffi.Pointer cJSON_AddRawToObject( ffi.Pointer object, ffi.Pointer name, ffi.Pointer raw, ) { - return (_cJSON_AddRawToObject ??= - _lookup>( - 'cJSON_AddRawToObject') - .asFunction<_dart_cJSON_AddRawToObject>())( + return _cJSON_AddRawToObject( object, name, raw, ); } - _dart_cJSON_AddRawToObject? _cJSON_AddRawToObject; + late final _cJSON_AddRawToObject_ptr = + _lookup>( + 'cJSON_AddRawToObject'); + late final _dart_cJSON_AddRawToObject _cJSON_AddRawToObject = + _cJSON_AddRawToObject_ptr.asFunction<_dart_cJSON_AddRawToObject>(); ffi.Pointer cJSON_AddObjectToObject( ffi.Pointer object, ffi.Pointer name, ) { - return (_cJSON_AddObjectToObject ??= - _lookup>( - 'cJSON_AddObjectToObject') - .asFunction<_dart_cJSON_AddObjectToObject>())( + return _cJSON_AddObjectToObject( object, name, ); } - _dart_cJSON_AddObjectToObject? _cJSON_AddObjectToObject; + late final _cJSON_AddObjectToObject_ptr = + _lookup>( + 'cJSON_AddObjectToObject'); + late final _dart_cJSON_AddObjectToObject _cJSON_AddObjectToObject = + _cJSON_AddObjectToObject_ptr.asFunction<_dart_cJSON_AddObjectToObject>(); ffi.Pointer cJSON_AddArrayToObject( ffi.Pointer object, ffi.Pointer name, ) { - return (_cJSON_AddArrayToObject ??= - _lookup>( - 'cJSON_AddArrayToObject') - .asFunction<_dart_cJSON_AddArrayToObject>())( + return _cJSON_AddArrayToObject( object, name, ); } - _dart_cJSON_AddArrayToObject? _cJSON_AddArrayToObject; + late final _cJSON_AddArrayToObject_ptr = + _lookup>( + 'cJSON_AddArrayToObject'); + late final _dart_cJSON_AddArrayToObject _cJSON_AddArrayToObject = + _cJSON_AddArrayToObject_ptr.asFunction<_dart_cJSON_AddArrayToObject>(); double cJSON_SetNumberHelper( ffi.Pointer object, double number, ) { - return (_cJSON_SetNumberHelper ??= - _lookup>( - 'cJSON_SetNumberHelper') - .asFunction<_dart_cJSON_SetNumberHelper>())( + return _cJSON_SetNumberHelper( object, number, ); } - _dart_cJSON_SetNumberHelper? _cJSON_SetNumberHelper; + late final _cJSON_SetNumberHelper_ptr = + _lookup>( + 'cJSON_SetNumberHelper'); + late final _dart_cJSON_SetNumberHelper _cJSON_SetNumberHelper = + _cJSON_SetNumberHelper_ptr.asFunction<_dart_cJSON_SetNumberHelper>(); ffi.Pointer cJSON_malloc( int size, ) { - return (_cJSON_malloc ??= - _lookup>('cJSON_malloc') - .asFunction<_dart_cJSON_malloc>())( + return _cJSON_malloc( size, ); } - _dart_cJSON_malloc? _cJSON_malloc; + late final _cJSON_malloc_ptr = + _lookup>('cJSON_malloc'); + late final _dart_cJSON_malloc _cJSON_malloc = + _cJSON_malloc_ptr.asFunction<_dart_cJSON_malloc>(); void cJSON_free( ffi.Pointer object, ) { - return (_cJSON_free ??= - _lookup>('cJSON_free') - .asFunction<_dart_cJSON_free>())( + return _cJSON_free( object, ); } - _dart_cJSON_free? _cJSON_free; + late final _cJSON_free_ptr = + _lookup>('cJSON_free'); + late final _dart_cJSON_free _cJSON_free = + _cJSON_free_ptr.asFunction<_dart_cJSON_free>(); } class cJSON extends ffi.Struct { diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index 20cc5955be..34c663359d 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -22,68 +22,75 @@ class LibClang { ffi.Pointer clang_getCString( CXString string, ) { - return (_clang_getCString ??= - _lookup>('clang_getCString') - .asFunction<_dart_clang_getCString>())( + return _clang_getCString( string, ); } - _dart_clang_getCString? _clang_getCString; + late final _clang_getCString_ptr = + _lookup>('clang_getCString'); + late final _dart_clang_getCString _clang_getCString = + _clang_getCString_ptr.asFunction<_dart_clang_getCString>(); /// Free the given string. void clang_disposeString( CXString string, ) { - return (_clang_disposeString ??= - _lookup>( - 'clang_disposeString') - .asFunction<_dart_clang_disposeString>())( + return _clang_disposeString( string, ); } - _dart_clang_disposeString? _clang_disposeString; + late final _clang_disposeString_ptr = + _lookup>( + 'clang_disposeString'); + late final _dart_clang_disposeString _clang_disposeString = + _clang_disposeString_ptr.asFunction<_dart_clang_disposeString>(); /// Free the given string set. void clang_disposeStringSet( ffi.Pointer set_1, ) { - return (_clang_disposeStringSet ??= - _lookup>( - 'clang_disposeStringSet') - .asFunction<_dart_clang_disposeStringSet>())( + return _clang_disposeStringSet( set_1, ); } - _dart_clang_disposeStringSet? _clang_disposeStringSet; + late final _clang_disposeStringSet_ptr = + _lookup>( + 'clang_disposeStringSet'); + late final _dart_clang_disposeStringSet _clang_disposeStringSet = + _clang_disposeStringSet_ptr.asFunction<_dart_clang_disposeStringSet>(); /// Return the timestamp for use with Clang's -fbuild-session-timestamp= /// option. int clang_getBuildSessionTimestamp() { - return (_clang_getBuildSessionTimestamp ??= - _lookup>( - 'clang_getBuildSessionTimestamp') - .asFunction<_dart_clang_getBuildSessionTimestamp>())(); + return _clang_getBuildSessionTimestamp(); } - _dart_clang_getBuildSessionTimestamp? _clang_getBuildSessionTimestamp; + late final _clang_getBuildSessionTimestamp_ptr = + _lookup>( + 'clang_getBuildSessionTimestamp'); + late final _dart_clang_getBuildSessionTimestamp + _clang_getBuildSessionTimestamp = _clang_getBuildSessionTimestamp_ptr + .asFunction<_dart_clang_getBuildSessionTimestamp>(); /// Create a CXVirtualFileOverlay object. Must be disposed with /// clang_VirtualFileOverlay_dispose(). ffi.Pointer clang_VirtualFileOverlay_create( int options, ) { - return (_clang_VirtualFileOverlay_create ??= - _lookup>( - 'clang_VirtualFileOverlay_create') - .asFunction<_dart_clang_VirtualFileOverlay_create>())( + return _clang_VirtualFileOverlay_create( options, ); } - _dart_clang_VirtualFileOverlay_create? _clang_VirtualFileOverlay_create; + late final _clang_VirtualFileOverlay_create_ptr = + _lookup>( + 'clang_VirtualFileOverlay_create'); + late final _dart_clang_VirtualFileOverlay_create + _clang_VirtualFileOverlay_create = _clang_VirtualFileOverlay_create_ptr + .asFunction<_dart_clang_VirtualFileOverlay_create>(); /// Map an absolute virtual file path to an absolute real one. The virtual /// path must be canonicalized (not contain "."/".."). @@ -92,18 +99,20 @@ class LibClang { ffi.Pointer virtualPath, ffi.Pointer realPath, ) { - return (_clang_VirtualFileOverlay_addFileMapping ??= - _lookup>( - 'clang_VirtualFileOverlay_addFileMapping') - .asFunction<_dart_clang_VirtualFileOverlay_addFileMapping>())( + return _clang_VirtualFileOverlay_addFileMapping( arg0, virtualPath, realPath, ); } - _dart_clang_VirtualFileOverlay_addFileMapping? - _clang_VirtualFileOverlay_addFileMapping; + late final _clang_VirtualFileOverlay_addFileMapping_ptr = + _lookup>( + 'clang_VirtualFileOverlay_addFileMapping'); + late final _dart_clang_VirtualFileOverlay_addFileMapping + _clang_VirtualFileOverlay_addFileMapping = + _clang_VirtualFileOverlay_addFileMapping_ptr + .asFunction<_dart_clang_VirtualFileOverlay_addFileMapping>(); /// Set the case sensitivity for the CXVirtualFileOverlay object. The /// CXVirtualFileOverlay object is case-sensitive by default, this option can @@ -112,18 +121,19 @@ class LibClang { ffi.Pointer arg0, int caseSensitive, ) { - return (_clang_VirtualFileOverlay_setCaseSensitivity ??= _lookup< - ffi.NativeFunction< - _c_clang_VirtualFileOverlay_setCaseSensitivity>>( - 'clang_VirtualFileOverlay_setCaseSensitivity') - .asFunction<_dart_clang_VirtualFileOverlay_setCaseSensitivity>())( + return _clang_VirtualFileOverlay_setCaseSensitivity( arg0, caseSensitive, ); } - _dart_clang_VirtualFileOverlay_setCaseSensitivity? - _clang_VirtualFileOverlay_setCaseSensitivity; + late final _clang_VirtualFileOverlay_setCaseSensitivity_ptr = _lookup< + ffi.NativeFunction<_c_clang_VirtualFileOverlay_setCaseSensitivity>>( + 'clang_VirtualFileOverlay_setCaseSensitivity'); + late final _dart_clang_VirtualFileOverlay_setCaseSensitivity + _clang_VirtualFileOverlay_setCaseSensitivity = + _clang_VirtualFileOverlay_setCaseSensitivity_ptr + .asFunction<_dart_clang_VirtualFileOverlay_setCaseSensitivity>(); /// Write out the CXVirtualFileOverlay object to a char buffer. int clang_VirtualFileOverlay_writeToBuffer( @@ -132,10 +142,7 @@ class LibClang { ffi.Pointer> out_buffer_ptr, ffi.Pointer out_buffer_size, ) { - return (_clang_VirtualFileOverlay_writeToBuffer ??= - _lookup>( - 'clang_VirtualFileOverlay_writeToBuffer') - .asFunction<_dart_clang_VirtualFileOverlay_writeToBuffer>())( + return _clang_VirtualFileOverlay_writeToBuffer( arg0, options, out_buffer_ptr, @@ -143,87 +150,100 @@ class LibClang { ); } - _dart_clang_VirtualFileOverlay_writeToBuffer? - _clang_VirtualFileOverlay_writeToBuffer; + late final _clang_VirtualFileOverlay_writeToBuffer_ptr = + _lookup>( + 'clang_VirtualFileOverlay_writeToBuffer'); + late final _dart_clang_VirtualFileOverlay_writeToBuffer + _clang_VirtualFileOverlay_writeToBuffer = + _clang_VirtualFileOverlay_writeToBuffer_ptr + .asFunction<_dart_clang_VirtualFileOverlay_writeToBuffer>(); /// free memory allocated by libclang, such as the buffer returned by /// CXVirtualFileOverlay() or clang_ModuleMapDescriptor_writeToBuffer(). void clang_free( ffi.Pointer buffer, ) { - return (_clang_free ??= - _lookup>('clang_free') - .asFunction<_dart_clang_free>())( + return _clang_free( buffer, ); } - _dart_clang_free? _clang_free; + late final _clang_free_ptr = + _lookup>('clang_free'); + late final _dart_clang_free _clang_free = + _clang_free_ptr.asFunction<_dart_clang_free>(); /// Dispose a CXVirtualFileOverlay object. void clang_VirtualFileOverlay_dispose( ffi.Pointer arg0, ) { - return (_clang_VirtualFileOverlay_dispose ??= - _lookup>( - 'clang_VirtualFileOverlay_dispose') - .asFunction<_dart_clang_VirtualFileOverlay_dispose>())( + return _clang_VirtualFileOverlay_dispose( arg0, ); } - _dart_clang_VirtualFileOverlay_dispose? _clang_VirtualFileOverlay_dispose; + late final _clang_VirtualFileOverlay_dispose_ptr = + _lookup>( + 'clang_VirtualFileOverlay_dispose'); + late final _dart_clang_VirtualFileOverlay_dispose + _clang_VirtualFileOverlay_dispose = _clang_VirtualFileOverlay_dispose_ptr + .asFunction<_dart_clang_VirtualFileOverlay_dispose>(); /// Create a CXModuleMapDescriptor object. Must be disposed with /// clang_ModuleMapDescriptor_dispose(). ffi.Pointer clang_ModuleMapDescriptor_create( int options, ) { - return (_clang_ModuleMapDescriptor_create ??= - _lookup>( - 'clang_ModuleMapDescriptor_create') - .asFunction<_dart_clang_ModuleMapDescriptor_create>())( + return _clang_ModuleMapDescriptor_create( options, ); } - _dart_clang_ModuleMapDescriptor_create? _clang_ModuleMapDescriptor_create; + late final _clang_ModuleMapDescriptor_create_ptr = + _lookup>( + 'clang_ModuleMapDescriptor_create'); + late final _dart_clang_ModuleMapDescriptor_create + _clang_ModuleMapDescriptor_create = _clang_ModuleMapDescriptor_create_ptr + .asFunction<_dart_clang_ModuleMapDescriptor_create>(); /// Sets the framework module name that the module.map describes. int clang_ModuleMapDescriptor_setFrameworkModuleName( ffi.Pointer arg0, ffi.Pointer name, ) { - return (_clang_ModuleMapDescriptor_setFrameworkModuleName ??= _lookup< - ffi.NativeFunction< - _c_clang_ModuleMapDescriptor_setFrameworkModuleName>>( - 'clang_ModuleMapDescriptor_setFrameworkModuleName') - .asFunction<_dart_clang_ModuleMapDescriptor_setFrameworkModuleName>())( + return _clang_ModuleMapDescriptor_setFrameworkModuleName( arg0, name, ); } - _dart_clang_ModuleMapDescriptor_setFrameworkModuleName? - _clang_ModuleMapDescriptor_setFrameworkModuleName; + late final _clang_ModuleMapDescriptor_setFrameworkModuleName_ptr = _lookup< + ffi.NativeFunction< + _c_clang_ModuleMapDescriptor_setFrameworkModuleName>>( + 'clang_ModuleMapDescriptor_setFrameworkModuleName'); + late final _dart_clang_ModuleMapDescriptor_setFrameworkModuleName + _clang_ModuleMapDescriptor_setFrameworkModuleName = + _clang_ModuleMapDescriptor_setFrameworkModuleName_ptr + .asFunction<_dart_clang_ModuleMapDescriptor_setFrameworkModuleName>(); /// Sets the umbrealla header name that the module.map describes. int clang_ModuleMapDescriptor_setUmbrellaHeader( ffi.Pointer arg0, ffi.Pointer name, ) { - return (_clang_ModuleMapDescriptor_setUmbrellaHeader ??= _lookup< - ffi.NativeFunction< - _c_clang_ModuleMapDescriptor_setUmbrellaHeader>>( - 'clang_ModuleMapDescriptor_setUmbrellaHeader') - .asFunction<_dart_clang_ModuleMapDescriptor_setUmbrellaHeader>())( + return _clang_ModuleMapDescriptor_setUmbrellaHeader( arg0, name, ); } - _dart_clang_ModuleMapDescriptor_setUmbrellaHeader? - _clang_ModuleMapDescriptor_setUmbrellaHeader; + late final _clang_ModuleMapDescriptor_setUmbrellaHeader_ptr = _lookup< + ffi.NativeFunction<_c_clang_ModuleMapDescriptor_setUmbrellaHeader>>( + 'clang_ModuleMapDescriptor_setUmbrellaHeader'); + late final _dart_clang_ModuleMapDescriptor_setUmbrellaHeader + _clang_ModuleMapDescriptor_setUmbrellaHeader = + _clang_ModuleMapDescriptor_setUmbrellaHeader_ptr + .asFunction<_dart_clang_ModuleMapDescriptor_setUmbrellaHeader>(); /// Write out the CXModuleMapDescriptor object to a char buffer. int clang_ModuleMapDescriptor_writeToBuffer( @@ -232,10 +252,7 @@ class LibClang { ffi.Pointer> out_buffer_ptr, ffi.Pointer out_buffer_size, ) { - return (_clang_ModuleMapDescriptor_writeToBuffer ??= - _lookup>( - 'clang_ModuleMapDescriptor_writeToBuffer') - .asFunction<_dart_clang_ModuleMapDescriptor_writeToBuffer>())( + return _clang_ModuleMapDescriptor_writeToBuffer( arg0, options, out_buffer_ptr, @@ -243,140 +260,158 @@ class LibClang { ); } - _dart_clang_ModuleMapDescriptor_writeToBuffer? - _clang_ModuleMapDescriptor_writeToBuffer; + late final _clang_ModuleMapDescriptor_writeToBuffer_ptr = + _lookup>( + 'clang_ModuleMapDescriptor_writeToBuffer'); + late final _dart_clang_ModuleMapDescriptor_writeToBuffer + _clang_ModuleMapDescriptor_writeToBuffer = + _clang_ModuleMapDescriptor_writeToBuffer_ptr + .asFunction<_dart_clang_ModuleMapDescriptor_writeToBuffer>(); /// Dispose a CXModuleMapDescriptor object. void clang_ModuleMapDescriptor_dispose( ffi.Pointer arg0, ) { - return (_clang_ModuleMapDescriptor_dispose ??= - _lookup>( - 'clang_ModuleMapDescriptor_dispose') - .asFunction<_dart_clang_ModuleMapDescriptor_dispose>())( + return _clang_ModuleMapDescriptor_dispose( arg0, ); } - _dart_clang_ModuleMapDescriptor_dispose? _clang_ModuleMapDescriptor_dispose; + late final _clang_ModuleMapDescriptor_dispose_ptr = + _lookup>( + 'clang_ModuleMapDescriptor_dispose'); + late final _dart_clang_ModuleMapDescriptor_dispose + _clang_ModuleMapDescriptor_dispose = + _clang_ModuleMapDescriptor_dispose_ptr + .asFunction<_dart_clang_ModuleMapDescriptor_dispose>(); /// Provides a shared context for creating translation units. ffi.Pointer clang_createIndex( int excludeDeclarationsFromPCH, int displayDiagnostics, ) { - return (_clang_createIndex ??= - _lookup>('clang_createIndex') - .asFunction<_dart_clang_createIndex>())( + return _clang_createIndex( excludeDeclarationsFromPCH, displayDiagnostics, ); } - _dart_clang_createIndex? _clang_createIndex; + late final _clang_createIndex_ptr = + _lookup>('clang_createIndex'); + late final _dart_clang_createIndex _clang_createIndex = + _clang_createIndex_ptr.asFunction<_dart_clang_createIndex>(); /// Destroy the given index. void clang_disposeIndex( ffi.Pointer index, ) { - return (_clang_disposeIndex ??= - _lookup>('clang_disposeIndex') - .asFunction<_dart_clang_disposeIndex>())( + return _clang_disposeIndex( index, ); } - _dart_clang_disposeIndex? _clang_disposeIndex; + late final _clang_disposeIndex_ptr = + _lookup>('clang_disposeIndex'); + late final _dart_clang_disposeIndex _clang_disposeIndex = + _clang_disposeIndex_ptr.asFunction<_dart_clang_disposeIndex>(); /// Sets general options associated with a CXIndex. void clang_CXIndex_setGlobalOptions( ffi.Pointer arg0, int options, ) { - return (_clang_CXIndex_setGlobalOptions ??= - _lookup>( - 'clang_CXIndex_setGlobalOptions') - .asFunction<_dart_clang_CXIndex_setGlobalOptions>())( + return _clang_CXIndex_setGlobalOptions( arg0, options, ); } - _dart_clang_CXIndex_setGlobalOptions? _clang_CXIndex_setGlobalOptions; + late final _clang_CXIndex_setGlobalOptions_ptr = + _lookup>( + 'clang_CXIndex_setGlobalOptions'); + late final _dart_clang_CXIndex_setGlobalOptions + _clang_CXIndex_setGlobalOptions = _clang_CXIndex_setGlobalOptions_ptr + .asFunction<_dart_clang_CXIndex_setGlobalOptions>(); /// Gets the general options associated with a CXIndex. int clang_CXIndex_getGlobalOptions( ffi.Pointer arg0, ) { - return (_clang_CXIndex_getGlobalOptions ??= - _lookup>( - 'clang_CXIndex_getGlobalOptions') - .asFunction<_dart_clang_CXIndex_getGlobalOptions>())( + return _clang_CXIndex_getGlobalOptions( arg0, ); } - _dart_clang_CXIndex_getGlobalOptions? _clang_CXIndex_getGlobalOptions; + late final _clang_CXIndex_getGlobalOptions_ptr = + _lookup>( + 'clang_CXIndex_getGlobalOptions'); + late final _dart_clang_CXIndex_getGlobalOptions + _clang_CXIndex_getGlobalOptions = _clang_CXIndex_getGlobalOptions_ptr + .asFunction<_dart_clang_CXIndex_getGlobalOptions>(); /// Sets the invocation emission path option in a CXIndex. void clang_CXIndex_setInvocationEmissionPathOption( ffi.Pointer arg0, ffi.Pointer Path, ) { - return (_clang_CXIndex_setInvocationEmissionPathOption ??= _lookup< - ffi.NativeFunction< - _c_clang_CXIndex_setInvocationEmissionPathOption>>( - 'clang_CXIndex_setInvocationEmissionPathOption') - .asFunction<_dart_clang_CXIndex_setInvocationEmissionPathOption>())( + return _clang_CXIndex_setInvocationEmissionPathOption( arg0, Path, ); } - _dart_clang_CXIndex_setInvocationEmissionPathOption? - _clang_CXIndex_setInvocationEmissionPathOption; + late final _clang_CXIndex_setInvocationEmissionPathOption_ptr = _lookup< + ffi.NativeFunction<_c_clang_CXIndex_setInvocationEmissionPathOption>>( + 'clang_CXIndex_setInvocationEmissionPathOption'); + late final _dart_clang_CXIndex_setInvocationEmissionPathOption + _clang_CXIndex_setInvocationEmissionPathOption = + _clang_CXIndex_setInvocationEmissionPathOption_ptr + .asFunction<_dart_clang_CXIndex_setInvocationEmissionPathOption>(); /// Retrieve the complete file and path name of the given file. CXString clang_getFileName( ffi.Pointer SFile, ) { - return (_clang_getFileName ??= - _lookup>('clang_getFileName') - .asFunction<_dart_clang_getFileName>())( + return _clang_getFileName( SFile, ); } - _dart_clang_getFileName? _clang_getFileName; + late final _clang_getFileName_ptr = + _lookup>('clang_getFileName'); + late final _dart_clang_getFileName _clang_getFileName = + _clang_getFileName_ptr.asFunction<_dart_clang_getFileName>(); /// Retrieve the last modification time of the given file. int clang_getFileTime( ffi.Pointer SFile, ) { - return (_clang_getFileTime ??= - _lookup>('clang_getFileTime') - .asFunction<_dart_clang_getFileTime>())( + return _clang_getFileTime( SFile, ); } - _dart_clang_getFileTime? _clang_getFileTime; + late final _clang_getFileTime_ptr = + _lookup>('clang_getFileTime'); + late final _dart_clang_getFileTime _clang_getFileTime = + _clang_getFileTime_ptr.asFunction<_dart_clang_getFileTime>(); /// Retrieve the unique ID for the given file. int clang_getFileUniqueID( ffi.Pointer file, ffi.Pointer outID, ) { - return (_clang_getFileUniqueID ??= - _lookup>( - 'clang_getFileUniqueID') - .asFunction<_dart_clang_getFileUniqueID>())( + return _clang_getFileUniqueID( file, outID, ); } - _dart_clang_getFileUniqueID? _clang_getFileUniqueID; + late final _clang_getFileUniqueID_ptr = + _lookup>( + 'clang_getFileUniqueID'); + late final _dart_clang_getFileUniqueID _clang_getFileUniqueID = + _clang_getFileUniqueID_ptr.asFunction<_dart_clang_getFileUniqueID>(); /// Determine whether the given header is guarded against multiple inclusions, /// either with the conventional #ifndef/#define/#endif macro guards or with @@ -385,31 +420,35 @@ class LibClang { ffi.Pointer tu, ffi.Pointer file, ) { - return (_clang_isFileMultipleIncludeGuarded ??= - _lookup>( - 'clang_isFileMultipleIncludeGuarded') - .asFunction<_dart_clang_isFileMultipleIncludeGuarded>())( + return _clang_isFileMultipleIncludeGuarded( tu, file, ); } - _dart_clang_isFileMultipleIncludeGuarded? _clang_isFileMultipleIncludeGuarded; + late final _clang_isFileMultipleIncludeGuarded_ptr = + _lookup>( + 'clang_isFileMultipleIncludeGuarded'); + late final _dart_clang_isFileMultipleIncludeGuarded + _clang_isFileMultipleIncludeGuarded = + _clang_isFileMultipleIncludeGuarded_ptr + .asFunction<_dart_clang_isFileMultipleIncludeGuarded>(); /// Retrieve a file handle within the given translation unit. ffi.Pointer clang_getFile( ffi.Pointer tu, ffi.Pointer file_name, ) { - return (_clang_getFile ??= - _lookup>('clang_getFile') - .asFunction<_dart_clang_getFile>())( + return _clang_getFile( tu, file_name, ); } - _dart_clang_getFile? _clang_getFile; + late final _clang_getFile_ptr = + _lookup>('clang_getFile'); + late final _dart_clang_getFile _clang_getFile = + _clang_getFile_ptr.asFunction<_dart_clang_getFile>(); /// Retrieve the buffer associated with the given file. ffi.Pointer clang_getFileContents( @@ -417,17 +456,18 @@ class LibClang { ffi.Pointer file, ffi.Pointer size, ) { - return (_clang_getFileContents ??= - _lookup>( - 'clang_getFileContents') - .asFunction<_dart_clang_getFileContents>())( + return _clang_getFileContents( tu, file, size, ); } - _dart_clang_getFileContents? _clang_getFileContents; + late final _clang_getFileContents_ptr = + _lookup>( + 'clang_getFileContents'); + late final _dart_clang_getFileContents _clang_getFileContents = + _clang_getFileContents_ptr.asFunction<_dart_clang_getFileContents>(); /// Returns non-zero if the file1 and file2 point to the same file, or they /// are both NULL. @@ -435,39 +475,43 @@ class LibClang { ffi.Pointer file1, ffi.Pointer file2, ) { - return (_clang_File_isEqual ??= - _lookup>('clang_File_isEqual') - .asFunction<_dart_clang_File_isEqual>())( + return _clang_File_isEqual( file1, file2, ); } - _dart_clang_File_isEqual? _clang_File_isEqual; + late final _clang_File_isEqual_ptr = + _lookup>('clang_File_isEqual'); + late final _dart_clang_File_isEqual _clang_File_isEqual = + _clang_File_isEqual_ptr.asFunction<_dart_clang_File_isEqual>(); /// Returns the real path name of file. CXString clang_File_tryGetRealPathName( ffi.Pointer file, ) { - return (_clang_File_tryGetRealPathName ??= - _lookup>( - 'clang_File_tryGetRealPathName') - .asFunction<_dart_clang_File_tryGetRealPathName>())( + return _clang_File_tryGetRealPathName( file, ); } - _dart_clang_File_tryGetRealPathName? _clang_File_tryGetRealPathName; + late final _clang_File_tryGetRealPathName_ptr = + _lookup>( + 'clang_File_tryGetRealPathName'); + late final _dart_clang_File_tryGetRealPathName + _clang_File_tryGetRealPathName = _clang_File_tryGetRealPathName_ptr + .asFunction<_dart_clang_File_tryGetRealPathName>(); /// Retrieve a NULL (invalid) source location. CXSourceLocation clang_getNullLocation() { - return (_clang_getNullLocation ??= - _lookup>( - 'clang_getNullLocation') - .asFunction<_dart_clang_getNullLocation>())(); + return _clang_getNullLocation(); } - _dart_clang_getNullLocation? _clang_getNullLocation; + late final _clang_getNullLocation_ptr = + _lookup>( + 'clang_getNullLocation'); + late final _dart_clang_getNullLocation _clang_getNullLocation = + _clang_getNullLocation_ptr.asFunction<_dart_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. @@ -475,16 +519,17 @@ class LibClang { CXSourceLocation loc1, CXSourceLocation loc2, ) { - return (_clang_equalLocations ??= - _lookup>( - 'clang_equalLocations') - .asFunction<_dart_clang_equalLocations>())( + return _clang_equalLocations( loc1, loc2, ); } - _dart_clang_equalLocations? _clang_equalLocations; + late final _clang_equalLocations_ptr = + _lookup>( + 'clang_equalLocations'); + late final _dart_clang_equalLocations _clang_equalLocations = + _clang_equalLocations_ptr.asFunction<_dart_clang_equalLocations>(); /// Retrieves the source location associated with a given file/line/column in /// a particular translation unit. @@ -494,9 +539,7 @@ class LibClang { int line, int column, ) { - return (_clang_getLocation ??= - _lookup>('clang_getLocation') - .asFunction<_dart_clang_getLocation>())( + return _clang_getLocation( tu, file, line, @@ -504,7 +547,10 @@ class LibClang { ); } - _dart_clang_getLocation? _clang_getLocation; + late final _clang_getLocation_ptr = + _lookup>('clang_getLocation'); + late final _dart_clang_getLocation _clang_getLocation = + _clang_getLocation_ptr.asFunction<_dart_clang_getLocation>(); /// Retrieves the source location associated with a given character offset in /// a particular translation unit. @@ -513,98 +559,108 @@ class LibClang { ffi.Pointer file, int offset, ) { - return (_clang_getLocationForOffset ??= - _lookup>( - 'clang_getLocationForOffset') - .asFunction<_dart_clang_getLocationForOffset>())( + return _clang_getLocationForOffset( tu, file, offset, ); } - _dart_clang_getLocationForOffset? _clang_getLocationForOffset; + late final _clang_getLocationForOffset_ptr = + _lookup>( + 'clang_getLocationForOffset'); + late final _dart_clang_getLocationForOffset _clang_getLocationForOffset = + _clang_getLocationForOffset_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_Location_isInSystemHeader') - .asFunction<_dart_clang_Location_isInSystemHeader>())( + return _clang_Location_isInSystemHeader( location, ); } - _dart_clang_Location_isInSystemHeader? _clang_Location_isInSystemHeader; + late final _clang_Location_isInSystemHeader_ptr = + _lookup>( + 'clang_Location_isInSystemHeader'); + late final _dart_clang_Location_isInSystemHeader + _clang_Location_isInSystemHeader = _clang_Location_isInSystemHeader_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_Location_isFromMainFile') - .asFunction<_dart_clang_Location_isFromMainFile>())( + return _clang_Location_isFromMainFile( location, ); } - _dart_clang_Location_isFromMainFile? _clang_Location_isFromMainFile; + late final _clang_Location_isFromMainFile_ptr = + _lookup>( + 'clang_Location_isFromMainFile'); + late final _dart_clang_Location_isFromMainFile + _clang_Location_isFromMainFile = _clang_Location_isFromMainFile_ptr + .asFunction<_dart_clang_Location_isFromMainFile>(); /// Retrieve a NULL (invalid) source range. CXSourceRange clang_getNullRange() { - return (_clang_getNullRange ??= - _lookup>('clang_getNullRange') - .asFunction<_dart_clang_getNullRange>())(); + return _clang_getNullRange(); } - _dart_clang_getNullRange? _clang_getNullRange; + late final _clang_getNullRange_ptr = + _lookup>('clang_getNullRange'); + late final _dart_clang_getNullRange _clang_getNullRange = + _clang_getNullRange_ptr.asFunction<_dart_clang_getNullRange>(); /// Retrieve a source range given the beginning and ending source locations. CXSourceRange clang_getRange( CXSourceLocation begin, CXSourceLocation end, ) { - return (_clang_getRange ??= - _lookup>('clang_getRange') - .asFunction<_dart_clang_getRange>())( + return _clang_getRange( begin, end, ); } - _dart_clang_getRange? _clang_getRange; + late final _clang_getRange_ptr = + _lookup>('clang_getRange'); + late final _dart_clang_getRange _clang_getRange = + _clang_getRange_ptr.asFunction<_dart_clang_getRange>(); /// Determine whether two ranges are equivalent. int clang_equalRanges( CXSourceRange range1, CXSourceRange range2, ) { - return (_clang_equalRanges ??= - _lookup>('clang_equalRanges') - .asFunction<_dart_clang_equalRanges>())( + return _clang_equalRanges( range1, range2, ); } - _dart_clang_equalRanges? _clang_equalRanges; + late final _clang_equalRanges_ptr = + _lookup>('clang_equalRanges'); + late final _dart_clang_equalRanges _clang_equalRanges = + _clang_equalRanges_ptr.asFunction<_dart_clang_equalRanges>(); /// Returns non-zero if range is null. int clang_Range_isNull( CXSourceRange range, ) { - return (_clang_Range_isNull ??= - _lookup>('clang_Range_isNull') - .asFunction<_dart_clang_Range_isNull>())( + return _clang_Range_isNull( range, ); } - _dart_clang_Range_isNull? _clang_Range_isNull; + late final _clang_Range_isNull_ptr = + _lookup>('clang_Range_isNull'); + late final _dart_clang_Range_isNull _clang_Range_isNull = + _clang_Range_isNull_ptr.asFunction<_dart_clang_Range_isNull>(); /// Retrieve the file, line, column, and offset represented by the given /// source location. @@ -615,10 +671,7 @@ class LibClang { ffi.Pointer column, ffi.Pointer offset, ) { - return (_clang_getExpansionLocation ??= - _lookup>( - 'clang_getExpansionLocation') - .asFunction<_dart_clang_getExpansionLocation>())( + return _clang_getExpansionLocation( location, file, line, @@ -627,7 +680,12 @@ class LibClang { ); } - _dart_clang_getExpansionLocation? _clang_getExpansionLocation; + late final _clang_getExpansionLocation_ptr = + _lookup>( + 'clang_getExpansionLocation'); + late final _dart_clang_getExpansionLocation _clang_getExpansionLocation = + _clang_getExpansionLocation_ptr + .asFunction<_dart_clang_getExpansionLocation>(); /// Retrieve the file, line and column represented by the given source /// location, as specified in a # line directive. @@ -637,10 +695,7 @@ class LibClang { ffi.Pointer line, ffi.Pointer column, ) { - return (_clang_getPresumedLocation ??= - _lookup>( - 'clang_getPresumedLocation') - .asFunction<_dart_clang_getPresumedLocation>())( + return _clang_getPresumedLocation( location, filename, line, @@ -648,7 +703,12 @@ class LibClang { ); } - _dart_clang_getPresumedLocation? _clang_getPresumedLocation; + late final _clang_getPresumedLocation_ptr = + _lookup>( + 'clang_getPresumedLocation'); + late final _dart_clang_getPresumedLocation _clang_getPresumedLocation = + _clang_getPresumedLocation_ptr + .asFunction<_dart_clang_getPresumedLocation>(); /// Legacy API to retrieve the file, line, column, and offset represented by /// the given source location. @@ -659,10 +719,7 @@ class LibClang { ffi.Pointer column, ffi.Pointer offset, ) { - return (_clang_getInstantiationLocation ??= - _lookup>( - 'clang_getInstantiationLocation') - .asFunction<_dart_clang_getInstantiationLocation>())( + return _clang_getInstantiationLocation( location, file, line, @@ -671,7 +728,12 @@ class LibClang { ); } - _dart_clang_getInstantiationLocation? _clang_getInstantiationLocation; + late final _clang_getInstantiationLocation_ptr = + _lookup>( + 'clang_getInstantiationLocation'); + late final _dart_clang_getInstantiationLocation + _clang_getInstantiationLocation = _clang_getInstantiationLocation_ptr + .asFunction<_dart_clang_getInstantiationLocation>(); /// Retrieve the file, line, column, and offset represented by the given /// source location. @@ -682,10 +744,7 @@ class LibClang { ffi.Pointer column, ffi.Pointer offset, ) { - return (_clang_getSpellingLocation ??= - _lookup>( - 'clang_getSpellingLocation') - .asFunction<_dart_clang_getSpellingLocation>())( + return _clang_getSpellingLocation( location, file, line, @@ -694,7 +753,12 @@ class LibClang { ); } - _dart_clang_getSpellingLocation? _clang_getSpellingLocation; + late final _clang_getSpellingLocation_ptr = + _lookup>( + 'clang_getSpellingLocation'); + late final _dart_clang_getSpellingLocation _clang_getSpellingLocation = + _clang_getSpellingLocation_ptr + .asFunction<_dart_clang_getSpellingLocation>(); /// Retrieve the file, line, column, and offset represented by the given /// source location. @@ -705,10 +769,7 @@ class LibClang { ffi.Pointer column, ffi.Pointer offset, ) { - return (_clang_getFileLocation ??= - _lookup>( - 'clang_getFileLocation') - .asFunction<_dart_clang_getFileLocation>())( + return _clang_getFileLocation( location, file, line, @@ -717,110 +778,125 @@ class LibClang { ); } - _dart_clang_getFileLocation? _clang_getFileLocation; + late final _clang_getFileLocation_ptr = + _lookup>( + 'clang_getFileLocation'); + late final _dart_clang_getFileLocation _clang_getFileLocation = + _clang_getFileLocation_ptr.asFunction<_dart_clang_getFileLocation>(); /// Retrieve a source location representing the first character within a /// source range. CXSourceLocation clang_getRangeStart( CXSourceRange range, ) { - return (_clang_getRangeStart ??= - _lookup>( - 'clang_getRangeStart') - .asFunction<_dart_clang_getRangeStart>())( + return _clang_getRangeStart( range, ); } - _dart_clang_getRangeStart? _clang_getRangeStart; + late final _clang_getRangeStart_ptr = + _lookup>( + 'clang_getRangeStart'); + late final _dart_clang_getRangeStart _clang_getRangeStart = + _clang_getRangeStart_ptr.asFunction<_dart_clang_getRangeStart>(); /// Retrieve a source location representing the last character within a source /// range. CXSourceLocation clang_getRangeEnd( CXSourceRange range, ) { - return (_clang_getRangeEnd ??= - _lookup>('clang_getRangeEnd') - .asFunction<_dart_clang_getRangeEnd>())( + return _clang_getRangeEnd( range, ); } - _dart_clang_getRangeEnd? _clang_getRangeEnd; + late final _clang_getRangeEnd_ptr = + _lookup>('clang_getRangeEnd'); + late final _dart_clang_getRangeEnd _clang_getRangeEnd = + _clang_getRangeEnd_ptr.asFunction<_dart_clang_getRangeEnd>(); /// Retrieve all ranges that were skipped by the preprocessor. ffi.Pointer clang_getSkippedRanges( ffi.Pointer tu, ffi.Pointer file, ) { - return (_clang_getSkippedRanges ??= - _lookup>( - 'clang_getSkippedRanges') - .asFunction<_dart_clang_getSkippedRanges>())( + return _clang_getSkippedRanges( tu, file, ); } - _dart_clang_getSkippedRanges? _clang_getSkippedRanges; + late final _clang_getSkippedRanges_ptr = + _lookup>( + 'clang_getSkippedRanges'); + late final _dart_clang_getSkippedRanges _clang_getSkippedRanges = + _clang_getSkippedRanges_ptr.asFunction<_dart_clang_getSkippedRanges>(); /// Retrieve all ranges from all files that were skipped by the preprocessor. ffi.Pointer clang_getAllSkippedRanges( ffi.Pointer tu, ) { - return (_clang_getAllSkippedRanges ??= - _lookup>( - 'clang_getAllSkippedRanges') - .asFunction<_dart_clang_getAllSkippedRanges>())( + return _clang_getAllSkippedRanges( tu, ); } - _dart_clang_getAllSkippedRanges? _clang_getAllSkippedRanges; + late final _clang_getAllSkippedRanges_ptr = + _lookup>( + 'clang_getAllSkippedRanges'); + late final _dart_clang_getAllSkippedRanges _clang_getAllSkippedRanges = + _clang_getAllSkippedRanges_ptr + .asFunction<_dart_clang_getAllSkippedRanges>(); /// Destroy the given CXSourceRangeList. void clang_disposeSourceRangeList( ffi.Pointer ranges, ) { - return (_clang_disposeSourceRangeList ??= - _lookup>( - 'clang_disposeSourceRangeList') - .asFunction<_dart_clang_disposeSourceRangeList>())( + return _clang_disposeSourceRangeList( ranges, ); } - _dart_clang_disposeSourceRangeList? _clang_disposeSourceRangeList; + late final _clang_disposeSourceRangeList_ptr = + _lookup>( + 'clang_disposeSourceRangeList'); + late final _dart_clang_disposeSourceRangeList _clang_disposeSourceRangeList = + _clang_disposeSourceRangeList_ptr + .asFunction<_dart_clang_disposeSourceRangeList>(); /// Determine the number of diagnostics in a CXDiagnosticSet. int clang_getNumDiagnosticsInSet( ffi.Pointer Diags, ) { - return (_clang_getNumDiagnosticsInSet ??= - _lookup>( - 'clang_getNumDiagnosticsInSet') - .asFunction<_dart_clang_getNumDiagnosticsInSet>())( + return _clang_getNumDiagnosticsInSet( Diags, ); } - _dart_clang_getNumDiagnosticsInSet? _clang_getNumDiagnosticsInSet; + late final _clang_getNumDiagnosticsInSet_ptr = + _lookup>( + 'clang_getNumDiagnosticsInSet'); + late final _dart_clang_getNumDiagnosticsInSet _clang_getNumDiagnosticsInSet = + _clang_getNumDiagnosticsInSet_ptr + .asFunction<_dart_clang_getNumDiagnosticsInSet>(); /// Retrieve a diagnostic associated with the given CXDiagnosticSet. ffi.Pointer clang_getDiagnosticInSet( ffi.Pointer Diags, int Index, ) { - return (_clang_getDiagnosticInSet ??= - _lookup>( - 'clang_getDiagnosticInSet') - .asFunction<_dart_clang_getDiagnosticInSet>())( + return _clang_getDiagnosticInSet( Diags, Index, ); } - _dart_clang_getDiagnosticInSet? _clang_getDiagnosticInSet; + late final _clang_getDiagnosticInSet_ptr = + _lookup>( + 'clang_getDiagnosticInSet'); + late final _dart_clang_getDiagnosticInSet _clang_getDiagnosticInSet = + _clang_getDiagnosticInSet_ptr + .asFunction<_dart_clang_getDiagnosticInSet>(); /// Deserialize a set of diagnostics from a Clang diagnostics bitcode file. ffi.Pointer clang_loadDiagnostics( @@ -828,279 +904,312 @@ class LibClang { ffi.Pointer error, ffi.Pointer errorString, ) { - return (_clang_loadDiagnostics ??= - _lookup>( - 'clang_loadDiagnostics') - .asFunction<_dart_clang_loadDiagnostics>())( + return _clang_loadDiagnostics( file, error, errorString, ); } - _dart_clang_loadDiagnostics? _clang_loadDiagnostics; + late final _clang_loadDiagnostics_ptr = + _lookup>( + 'clang_loadDiagnostics'); + late final _dart_clang_loadDiagnostics _clang_loadDiagnostics = + _clang_loadDiagnostics_ptr.asFunction<_dart_clang_loadDiagnostics>(); /// Release a CXDiagnosticSet and all of its contained diagnostics. void clang_disposeDiagnosticSet( ffi.Pointer Diags, ) { - return (_clang_disposeDiagnosticSet ??= - _lookup>( - 'clang_disposeDiagnosticSet') - .asFunction<_dart_clang_disposeDiagnosticSet>())( + return _clang_disposeDiagnosticSet( Diags, ); } - _dart_clang_disposeDiagnosticSet? _clang_disposeDiagnosticSet; + late final _clang_disposeDiagnosticSet_ptr = + _lookup>( + 'clang_disposeDiagnosticSet'); + late final _dart_clang_disposeDiagnosticSet _clang_disposeDiagnosticSet = + _clang_disposeDiagnosticSet_ptr + .asFunction<_dart_clang_disposeDiagnosticSet>(); /// Retrieve the child diagnostics of a CXDiagnostic. ffi.Pointer clang_getChildDiagnostics( ffi.Pointer D, ) { - return (_clang_getChildDiagnostics ??= - _lookup>( - 'clang_getChildDiagnostics') - .asFunction<_dart_clang_getChildDiagnostics>())( + return _clang_getChildDiagnostics( D, ); } - _dart_clang_getChildDiagnostics? _clang_getChildDiagnostics; + late final _clang_getChildDiagnostics_ptr = + _lookup>( + 'clang_getChildDiagnostics'); + late final _dart_clang_getChildDiagnostics _clang_getChildDiagnostics = + _clang_getChildDiagnostics_ptr + .asFunction<_dart_clang_getChildDiagnostics>(); /// Determine the number of diagnostics produced for the given translation /// unit. int clang_getNumDiagnostics( ffi.Pointer Unit, ) { - return (_clang_getNumDiagnostics ??= - _lookup>( - 'clang_getNumDiagnostics') - .asFunction<_dart_clang_getNumDiagnostics>())( + return _clang_getNumDiagnostics( Unit, ); } - _dart_clang_getNumDiagnostics? _clang_getNumDiagnostics; + late final _clang_getNumDiagnostics_ptr = + _lookup>( + 'clang_getNumDiagnostics'); + late final _dart_clang_getNumDiagnostics _clang_getNumDiagnostics = + _clang_getNumDiagnostics_ptr.asFunction<_dart_clang_getNumDiagnostics>(); /// Retrieve a diagnostic associated with the given translation unit. ffi.Pointer clang_getDiagnostic( ffi.Pointer Unit, int Index, ) { - return (_clang_getDiagnostic ??= - _lookup>( - 'clang_getDiagnostic') - .asFunction<_dart_clang_getDiagnostic>())( + return _clang_getDiagnostic( Unit, Index, ); } - _dart_clang_getDiagnostic? _clang_getDiagnostic; + late final _clang_getDiagnostic_ptr = + _lookup>( + 'clang_getDiagnostic'); + late final _dart_clang_getDiagnostic _clang_getDiagnostic = + _clang_getDiagnostic_ptr.asFunction<_dart_clang_getDiagnostic>(); /// Retrieve the complete set of diagnostics associated with a translation /// unit. ffi.Pointer clang_getDiagnosticSetFromTU( ffi.Pointer Unit, ) { - return (_clang_getDiagnosticSetFromTU ??= - _lookup>( - 'clang_getDiagnosticSetFromTU') - .asFunction<_dart_clang_getDiagnosticSetFromTU>())( + return _clang_getDiagnosticSetFromTU( Unit, ); } - _dart_clang_getDiagnosticSetFromTU? _clang_getDiagnosticSetFromTU; + late final _clang_getDiagnosticSetFromTU_ptr = + _lookup>( + 'clang_getDiagnosticSetFromTU'); + late final _dart_clang_getDiagnosticSetFromTU _clang_getDiagnosticSetFromTU = + _clang_getDiagnosticSetFromTU_ptr + .asFunction<_dart_clang_getDiagnosticSetFromTU>(); /// Destroy a diagnostic. void clang_disposeDiagnostic( ffi.Pointer Diagnostic, ) { - return (_clang_disposeDiagnostic ??= - _lookup>( - 'clang_disposeDiagnostic') - .asFunction<_dart_clang_disposeDiagnostic>())( + return _clang_disposeDiagnostic( Diagnostic, ); } - _dart_clang_disposeDiagnostic? _clang_disposeDiagnostic; + late final _clang_disposeDiagnostic_ptr = + _lookup>( + 'clang_disposeDiagnostic'); + late final _dart_clang_disposeDiagnostic _clang_disposeDiagnostic = + _clang_disposeDiagnostic_ptr.asFunction<_dart_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 ??= - _lookup>( - 'clang_formatDiagnostic') - .asFunction<_dart_clang_formatDiagnostic>())( + return _clang_formatDiagnostic( Diagnostic, Options, ); } - _dart_clang_formatDiagnostic? _clang_formatDiagnostic; + late final _clang_formatDiagnostic_ptr = + _lookup>( + 'clang_formatDiagnostic'); + late final _dart_clang_formatDiagnostic _clang_formatDiagnostic = + _clang_formatDiagnostic_ptr.asFunction<_dart_clang_formatDiagnostic>(); /// Retrieve the set of display options most similar to the default behavior /// of the clang compiler. int clang_defaultDiagnosticDisplayOptions() { - return (_clang_defaultDiagnosticDisplayOptions ??= - _lookup>( - 'clang_defaultDiagnosticDisplayOptions') - .asFunction<_dart_clang_defaultDiagnosticDisplayOptions>())(); + return _clang_defaultDiagnosticDisplayOptions(); } - _dart_clang_defaultDiagnosticDisplayOptions? - _clang_defaultDiagnosticDisplayOptions; + late final _clang_defaultDiagnosticDisplayOptions_ptr = + _lookup>( + 'clang_defaultDiagnosticDisplayOptions'); + late final _dart_clang_defaultDiagnosticDisplayOptions + _clang_defaultDiagnosticDisplayOptions = + _clang_defaultDiagnosticDisplayOptions_ptr + .asFunction<_dart_clang_defaultDiagnosticDisplayOptions>(); /// Determine the severity of the given diagnostic. int clang_getDiagnosticSeverity( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticSeverity ??= - _lookup>( - 'clang_getDiagnosticSeverity') - .asFunction<_dart_clang_getDiagnosticSeverity>())( + return _clang_getDiagnosticSeverity( arg0, ); } - _dart_clang_getDiagnosticSeverity? _clang_getDiagnosticSeverity; + late final _clang_getDiagnosticSeverity_ptr = + _lookup>( + 'clang_getDiagnosticSeverity'); + late final _dart_clang_getDiagnosticSeverity _clang_getDiagnosticSeverity = + _clang_getDiagnosticSeverity_ptr + .asFunction<_dart_clang_getDiagnosticSeverity>(); /// Retrieve the source location of the given diagnostic. CXSourceLocation clang_getDiagnosticLocation( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticLocation ??= - _lookup>( - 'clang_getDiagnosticLocation') - .asFunction<_dart_clang_getDiagnosticLocation>())( + return _clang_getDiagnosticLocation( arg0, ); } - _dart_clang_getDiagnosticLocation? _clang_getDiagnosticLocation; + late final _clang_getDiagnosticLocation_ptr = + _lookup>( + 'clang_getDiagnosticLocation'); + late final _dart_clang_getDiagnosticLocation _clang_getDiagnosticLocation = + _clang_getDiagnosticLocation_ptr + .asFunction<_dart_clang_getDiagnosticLocation>(); /// Retrieve the text of the given diagnostic. CXString clang_getDiagnosticSpelling( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticSpelling ??= - _lookup>( - 'clang_getDiagnosticSpelling') - .asFunction<_dart_clang_getDiagnosticSpelling>())( + return _clang_getDiagnosticSpelling( arg0, ); } - _dart_clang_getDiagnosticSpelling? _clang_getDiagnosticSpelling; + late final _clang_getDiagnosticSpelling_ptr = + _lookup>( + 'clang_getDiagnosticSpelling'); + late final _dart_clang_getDiagnosticSpelling _clang_getDiagnosticSpelling = + _clang_getDiagnosticSpelling_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_getDiagnosticOption') - .asFunction<_dart_clang_getDiagnosticOption>())( + return _clang_getDiagnosticOption( Diag, Disable, ); } - _dart_clang_getDiagnosticOption? _clang_getDiagnosticOption; + late final _clang_getDiagnosticOption_ptr = + _lookup>( + 'clang_getDiagnosticOption'); + late final _dart_clang_getDiagnosticOption _clang_getDiagnosticOption = + _clang_getDiagnosticOption_ptr + .asFunction<_dart_clang_getDiagnosticOption>(); /// Retrieve the category number for this diagnostic. int clang_getDiagnosticCategory( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticCategory ??= - _lookup>( - 'clang_getDiagnosticCategory') - .asFunction<_dart_clang_getDiagnosticCategory>())( + return _clang_getDiagnosticCategory( arg0, ); } - _dart_clang_getDiagnosticCategory? _clang_getDiagnosticCategory; + late final _clang_getDiagnosticCategory_ptr = + _lookup>( + 'clang_getDiagnosticCategory'); + late final _dart_clang_getDiagnosticCategory _clang_getDiagnosticCategory = + _clang_getDiagnosticCategory_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_getDiagnosticCategoryName') - .asFunction<_dart_clang_getDiagnosticCategoryName>())( + return _clang_getDiagnosticCategoryName( Category, ); } - _dart_clang_getDiagnosticCategoryName? _clang_getDiagnosticCategoryName; + late final _clang_getDiagnosticCategoryName_ptr = + _lookup>( + 'clang_getDiagnosticCategoryName'); + late final _dart_clang_getDiagnosticCategoryName + _clang_getDiagnosticCategoryName = _clang_getDiagnosticCategoryName_ptr + .asFunction<_dart_clang_getDiagnosticCategoryName>(); /// Retrieve the diagnostic category text for a given diagnostic. CXString clang_getDiagnosticCategoryText( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticCategoryText ??= - _lookup>( - 'clang_getDiagnosticCategoryText') - .asFunction<_dart_clang_getDiagnosticCategoryText>())( + return _clang_getDiagnosticCategoryText( arg0, ); } - _dart_clang_getDiagnosticCategoryText? _clang_getDiagnosticCategoryText; + late final _clang_getDiagnosticCategoryText_ptr = + _lookup>( + 'clang_getDiagnosticCategoryText'); + late final _dart_clang_getDiagnosticCategoryText + _clang_getDiagnosticCategoryText = _clang_getDiagnosticCategoryText_ptr + .asFunction<_dart_clang_getDiagnosticCategoryText>(); /// Determine the number of source ranges associated with the given /// diagnostic. int clang_getDiagnosticNumRanges( ffi.Pointer arg0, ) { - return (_clang_getDiagnosticNumRanges ??= - _lookup>( - 'clang_getDiagnosticNumRanges') - .asFunction<_dart_clang_getDiagnosticNumRanges>())( + return _clang_getDiagnosticNumRanges( arg0, ); } - _dart_clang_getDiagnosticNumRanges? _clang_getDiagnosticNumRanges; + late final _clang_getDiagnosticNumRanges_ptr = + _lookup>( + 'clang_getDiagnosticNumRanges'); + late final _dart_clang_getDiagnosticNumRanges _clang_getDiagnosticNumRanges = + _clang_getDiagnosticNumRanges_ptr + .asFunction<_dart_clang_getDiagnosticNumRanges>(); /// Retrieve a source range associated with the diagnostic. CXSourceRange clang_getDiagnosticRange( ffi.Pointer Diagnostic, int Range, ) { - return (_clang_getDiagnosticRange ??= - _lookup>( - 'clang_getDiagnosticRange') - .asFunction<_dart_clang_getDiagnosticRange>())( + return _clang_getDiagnosticRange( Diagnostic, Range, ); } - _dart_clang_getDiagnosticRange? _clang_getDiagnosticRange; + late final _clang_getDiagnosticRange_ptr = + _lookup>( + 'clang_getDiagnosticRange'); + late final _dart_clang_getDiagnosticRange _clang_getDiagnosticRange = + _clang_getDiagnosticRange_ptr + .asFunction<_dart_clang_getDiagnosticRange>(); /// Determine the number of fix-it hints associated with the given diagnostic. int clang_getDiagnosticNumFixIts( ffi.Pointer Diagnostic, ) { - return (_clang_getDiagnosticNumFixIts ??= - _lookup>( - 'clang_getDiagnosticNumFixIts') - .asFunction<_dart_clang_getDiagnosticNumFixIts>())( + return _clang_getDiagnosticNumFixIts( Diagnostic, ); } - _dart_clang_getDiagnosticNumFixIts? _clang_getDiagnosticNumFixIts; + late final _clang_getDiagnosticNumFixIts_ptr = + _lookup>( + 'clang_getDiagnosticNumFixIts'); + late final _dart_clang_getDiagnosticNumFixIts _clang_getDiagnosticNumFixIts = + _clang_getDiagnosticNumFixIts_ptr + .asFunction<_dart_clang_getDiagnosticNumFixIts>(); /// Retrieve the replacement information for a given fix-it. CXString clang_getDiagnosticFixIt( @@ -1108,31 +1217,35 @@ class LibClang { int FixIt, ffi.Pointer ReplacementRange, ) { - return (_clang_getDiagnosticFixIt ??= - _lookup>( - 'clang_getDiagnosticFixIt') - .asFunction<_dart_clang_getDiagnosticFixIt>())( + return _clang_getDiagnosticFixIt( Diagnostic, FixIt, ReplacementRange, ); } - _dart_clang_getDiagnosticFixIt? _clang_getDiagnosticFixIt; + late final _clang_getDiagnosticFixIt_ptr = + _lookup>( + 'clang_getDiagnosticFixIt'); + late final _dart_clang_getDiagnosticFixIt _clang_getDiagnosticFixIt = + _clang_getDiagnosticFixIt_ptr + .asFunction<_dart_clang_getDiagnosticFixIt>(); /// Get the original translation unit source file name. CXString clang_getTranslationUnitSpelling( ffi.Pointer CTUnit, ) { - return (_clang_getTranslationUnitSpelling ??= - _lookup>( - 'clang_getTranslationUnitSpelling') - .asFunction<_dart_clang_getTranslationUnitSpelling>())( + return _clang_getTranslationUnitSpelling( CTUnit, ); } - _dart_clang_getTranslationUnitSpelling? _clang_getTranslationUnitSpelling; + late final _clang_getTranslationUnitSpelling_ptr = + _lookup>( + 'clang_getTranslationUnitSpelling'); + late final _dart_clang_getTranslationUnitSpelling + _clang_getTranslationUnitSpelling = _clang_getTranslationUnitSpelling_ptr + .asFunction<_dart_clang_getTranslationUnitSpelling>(); /// Return the CXTranslationUnit for a given source file and the provided /// command line arguments one would pass to the compiler. @@ -1144,11 +1257,7 @@ class LibClang { int num_unsaved_files, ffi.Pointer unsaved_files, ) { - return (_clang_createTranslationUnitFromSourceFile ??= _lookup< - ffi.NativeFunction< - _c_clang_createTranslationUnitFromSourceFile>>( - 'clang_createTranslationUnitFromSourceFile') - .asFunction<_dart_clang_createTranslationUnitFromSourceFile>())( + return _clang_createTranslationUnitFromSourceFile( CIdx, source_filename, num_clang_command_line_args, @@ -1158,8 +1267,13 @@ class LibClang { ); } - _dart_clang_createTranslationUnitFromSourceFile? - _clang_createTranslationUnitFromSourceFile; + late final _clang_createTranslationUnitFromSourceFile_ptr = + _lookup>( + 'clang_createTranslationUnitFromSourceFile'); + late final _dart_clang_createTranslationUnitFromSourceFile + _clang_createTranslationUnitFromSourceFile = + _clang_createTranslationUnitFromSourceFile_ptr + .asFunction<_dart_clang_createTranslationUnitFromSourceFile>(); /// Same as clang_createTranslationUnit2, but returns the CXTranslationUnit /// instead of an error code. In case of an error this routine returns a NULL @@ -1168,16 +1282,18 @@ class LibClang { ffi.Pointer CIdx, ffi.Pointer ast_filename, ) { - return (_clang_createTranslationUnit ??= - _lookup>( - 'clang_createTranslationUnit') - .asFunction<_dart_clang_createTranslationUnit>())( + return _clang_createTranslationUnit( CIdx, ast_filename, ); } - _dart_clang_createTranslationUnit? _clang_createTranslationUnit; + late final _clang_createTranslationUnit_ptr = + _lookup>( + 'clang_createTranslationUnit'); + late final _dart_clang_createTranslationUnit _clang_createTranslationUnit = + _clang_createTranslationUnit_ptr + .asFunction<_dart_clang_createTranslationUnit>(); /// Create a translation unit from an AST file ( -emit-ast). int clang_createTranslationUnit2( @@ -1185,30 +1301,33 @@ class LibClang { ffi.Pointer ast_filename, ffi.Pointer> out_TU, ) { - return (_clang_createTranslationUnit2 ??= - _lookup>( - 'clang_createTranslationUnit2') - .asFunction<_dart_clang_createTranslationUnit2>())( + return _clang_createTranslationUnit2( CIdx, ast_filename, out_TU, ); } - _dart_clang_createTranslationUnit2? _clang_createTranslationUnit2; + late final _clang_createTranslationUnit2_ptr = + _lookup>( + 'clang_createTranslationUnit2'); + late final _dart_clang_createTranslationUnit2 _clang_createTranslationUnit2 = + _clang_createTranslationUnit2_ptr + .asFunction<_dart_clang_createTranslationUnit2>(); /// Returns the set of flags that is suitable for parsing a translation unit /// that is being edited. int clang_defaultEditingTranslationUnitOptions() { - return (_clang_defaultEditingTranslationUnitOptions ??= _lookup< - ffi.NativeFunction< - _c_clang_defaultEditingTranslationUnitOptions>>( - 'clang_defaultEditingTranslationUnitOptions') - .asFunction<_dart_clang_defaultEditingTranslationUnitOptions>())(); + return _clang_defaultEditingTranslationUnitOptions(); } - _dart_clang_defaultEditingTranslationUnitOptions? - _clang_defaultEditingTranslationUnitOptions; + late final _clang_defaultEditingTranslationUnitOptions_ptr = _lookup< + ffi.NativeFunction<_c_clang_defaultEditingTranslationUnitOptions>>( + 'clang_defaultEditingTranslationUnitOptions'); + late final _dart_clang_defaultEditingTranslationUnitOptions + _clang_defaultEditingTranslationUnitOptions = + _clang_defaultEditingTranslationUnitOptions_ptr + .asFunction<_dart_clang_defaultEditingTranslationUnitOptions>(); /// Same as clang_parseTranslationUnit2, but returns the CXTranslationUnit /// instead of an error code. In case of an error this routine returns a NULL @@ -1222,10 +1341,7 @@ class LibClang { int num_unsaved_files, int options, ) { - return (_clang_parseTranslationUnit ??= - _lookup>( - 'clang_parseTranslationUnit') - .asFunction<_dart_clang_parseTranslationUnit>())( + return _clang_parseTranslationUnit( CIdx, source_filename, command_line_args, @@ -1236,7 +1352,12 @@ class LibClang { ); } - _dart_clang_parseTranslationUnit? _clang_parseTranslationUnit; + late final _clang_parseTranslationUnit_ptr = + _lookup>( + 'clang_parseTranslationUnit'); + late final _dart_clang_parseTranslationUnit _clang_parseTranslationUnit = + _clang_parseTranslationUnit_ptr + .asFunction<_dart_clang_parseTranslationUnit>(); /// Parse the given source file and the translation unit corresponding to that /// file. @@ -1250,10 +1371,7 @@ class LibClang { int options, ffi.Pointer> out_TU, ) { - return (_clang_parseTranslationUnit2 ??= - _lookup>( - 'clang_parseTranslationUnit2') - .asFunction<_dart_clang_parseTranslationUnit2>())( + return _clang_parseTranslationUnit2( CIdx, source_filename, command_line_args, @@ -1265,7 +1383,12 @@ class LibClang { ); } - _dart_clang_parseTranslationUnit2? _clang_parseTranslationUnit2; + late final _clang_parseTranslationUnit2_ptr = + _lookup>( + 'clang_parseTranslationUnit2'); + late final _dart_clang_parseTranslationUnit2 _clang_parseTranslationUnit2 = + _clang_parseTranslationUnit2_ptr + .asFunction<_dart_clang_parseTranslationUnit2>(); /// Same as clang_parseTranslationUnit2 but requires a full command line for /// command_line_args including argv[0]. This is useful if the standard @@ -1280,10 +1403,7 @@ class LibClang { int options, ffi.Pointer> out_TU, ) { - return (_clang_parseTranslationUnit2FullArgv ??= - _lookup>( - 'clang_parseTranslationUnit2FullArgv') - .asFunction<_dart_clang_parseTranslationUnit2FullArgv>())( + return _clang_parseTranslationUnit2FullArgv( CIdx, source_filename, command_line_args, @@ -1295,22 +1415,29 @@ class LibClang { ); } - _dart_clang_parseTranslationUnit2FullArgv? - _clang_parseTranslationUnit2FullArgv; + late final _clang_parseTranslationUnit2FullArgv_ptr = + _lookup>( + 'clang_parseTranslationUnit2FullArgv'); + late final _dart_clang_parseTranslationUnit2FullArgv + _clang_parseTranslationUnit2FullArgv = + _clang_parseTranslationUnit2FullArgv_ptr + .asFunction<_dart_clang_parseTranslationUnit2FullArgv>(); /// Returns the set of flags that is suitable for saving a translation unit. int clang_defaultSaveOptions( ffi.Pointer TU, ) { - return (_clang_defaultSaveOptions ??= - _lookup>( - 'clang_defaultSaveOptions') - .asFunction<_dart_clang_defaultSaveOptions>())( + return _clang_defaultSaveOptions( TU, ); } - _dart_clang_defaultSaveOptions? _clang_defaultSaveOptions; + late final _clang_defaultSaveOptions_ptr = + _lookup>( + 'clang_defaultSaveOptions'); + late final _dart_clang_defaultSaveOptions _clang_defaultSaveOptions = + _clang_defaultSaveOptions_ptr + .asFunction<_dart_clang_defaultSaveOptions>(); /// Saves a translation unit into a serialized representation of that /// translation unit on disk. @@ -1319,60 +1446,68 @@ class LibClang { ffi.Pointer FileName, int options, ) { - return (_clang_saveTranslationUnit ??= - _lookup>( - 'clang_saveTranslationUnit') - .asFunction<_dart_clang_saveTranslationUnit>())( + return _clang_saveTranslationUnit( TU, FileName, options, ); } - _dart_clang_saveTranslationUnit? _clang_saveTranslationUnit; + late final _clang_saveTranslationUnit_ptr = + _lookup>( + 'clang_saveTranslationUnit'); + late final _dart_clang_saveTranslationUnit _clang_saveTranslationUnit = + _clang_saveTranslationUnit_ptr + .asFunction<_dart_clang_saveTranslationUnit>(); /// Suspend a translation unit in order to free memory associated with it. int clang_suspendTranslationUnit( ffi.Pointer arg0, ) { - return (_clang_suspendTranslationUnit ??= - _lookup>( - 'clang_suspendTranslationUnit') - .asFunction<_dart_clang_suspendTranslationUnit>())( + return _clang_suspendTranslationUnit( arg0, ); } - _dart_clang_suspendTranslationUnit? _clang_suspendTranslationUnit; + late final _clang_suspendTranslationUnit_ptr = + _lookup>( + 'clang_suspendTranslationUnit'); + late final _dart_clang_suspendTranslationUnit _clang_suspendTranslationUnit = + _clang_suspendTranslationUnit_ptr + .asFunction<_dart_clang_suspendTranslationUnit>(); /// Destroy the specified CXTranslationUnit object. void clang_disposeTranslationUnit( ffi.Pointer arg0, ) { - return (_clang_disposeTranslationUnit ??= - _lookup>( - 'clang_disposeTranslationUnit') - .asFunction<_dart_clang_disposeTranslationUnit>())( + return _clang_disposeTranslationUnit( arg0, ); } - _dart_clang_disposeTranslationUnit? _clang_disposeTranslationUnit; + late final _clang_disposeTranslationUnit_ptr = + _lookup>( + 'clang_disposeTranslationUnit'); + late final _dart_clang_disposeTranslationUnit _clang_disposeTranslationUnit = + _clang_disposeTranslationUnit_ptr + .asFunction<_dart_clang_disposeTranslationUnit>(); /// Returns the set of flags that is suitable for reparsing a translation /// unit. int clang_defaultReparseOptions( ffi.Pointer TU, ) { - return (_clang_defaultReparseOptions ??= - _lookup>( - 'clang_defaultReparseOptions') - .asFunction<_dart_clang_defaultReparseOptions>())( + return _clang_defaultReparseOptions( TU, ); } - _dart_clang_defaultReparseOptions? _clang_defaultReparseOptions; + late final _clang_defaultReparseOptions_ptr = + _lookup>( + 'clang_defaultReparseOptions'); + late final _dart_clang_defaultReparseOptions _clang_defaultReparseOptions = + _clang_defaultReparseOptions_ptr + .asFunction<_dart_clang_defaultReparseOptions>(); /// Reparse the source files that produced this translation unit. int clang_reparseTranslationUnit( @@ -1381,10 +1516,7 @@ class LibClang { ffi.Pointer unsaved_files, int options, ) { - return (_clang_reparseTranslationUnit ??= - _lookup>( - 'clang_reparseTranslationUnit') - .asFunction<_dart_clang_reparseTranslationUnit>())( + return _clang_reparseTranslationUnit( TU, num_unsaved_files, unsaved_files, @@ -1392,379 +1524,423 @@ class LibClang { ); } - _dart_clang_reparseTranslationUnit? _clang_reparseTranslationUnit; + late final _clang_reparseTranslationUnit_ptr = + _lookup>( + 'clang_reparseTranslationUnit'); + late final _dart_clang_reparseTranslationUnit _clang_reparseTranslationUnit = + _clang_reparseTranslationUnit_ptr + .asFunction<_dart_clang_reparseTranslationUnit>(); /// Returns the human-readable null-terminated C string that represents the /// name of the memory category. This string should never be freed. ffi.Pointer clang_getTUResourceUsageName( int kind, ) { - return (_clang_getTUResourceUsageName ??= - _lookup>( - 'clang_getTUResourceUsageName') - .asFunction<_dart_clang_getTUResourceUsageName>())( + return _clang_getTUResourceUsageName( kind, ); } - _dart_clang_getTUResourceUsageName? _clang_getTUResourceUsageName; + late final _clang_getTUResourceUsageName_ptr = + _lookup>( + 'clang_getTUResourceUsageName'); + late final _dart_clang_getTUResourceUsageName _clang_getTUResourceUsageName = + _clang_getTUResourceUsageName_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_getCXTUResourceUsage') - .asFunction<_dart_clang_getCXTUResourceUsage>())( + return _clang_getCXTUResourceUsage( TU, ); } - _dart_clang_getCXTUResourceUsage? _clang_getCXTUResourceUsage; + late final _clang_getCXTUResourceUsage_ptr = + _lookup>( + 'clang_getCXTUResourceUsage'); + late final _dart_clang_getCXTUResourceUsage _clang_getCXTUResourceUsage = + _clang_getCXTUResourceUsage_ptr + .asFunction<_dart_clang_getCXTUResourceUsage>(); void clang_disposeCXTUResourceUsage( CXTUResourceUsage usage, ) { - return (_clang_disposeCXTUResourceUsage ??= - _lookup>( - 'clang_disposeCXTUResourceUsage') - .asFunction<_dart_clang_disposeCXTUResourceUsage>())( + return _clang_disposeCXTUResourceUsage( usage, ); } - _dart_clang_disposeCXTUResourceUsage? _clang_disposeCXTUResourceUsage; + late final _clang_disposeCXTUResourceUsage_ptr = + _lookup>( + 'clang_disposeCXTUResourceUsage'); + late final _dart_clang_disposeCXTUResourceUsage + _clang_disposeCXTUResourceUsage = _clang_disposeCXTUResourceUsage_ptr + .asFunction<_dart_clang_disposeCXTUResourceUsage>(); /// Get target information for this translation unit. ffi.Pointer clang_getTranslationUnitTargetInfo( ffi.Pointer CTUnit, ) { - return (_clang_getTranslationUnitTargetInfo ??= - _lookup>( - 'clang_getTranslationUnitTargetInfo') - .asFunction<_dart_clang_getTranslationUnitTargetInfo>())( + return _clang_getTranslationUnitTargetInfo( CTUnit, ); } - _dart_clang_getTranslationUnitTargetInfo? _clang_getTranslationUnitTargetInfo; + late final _clang_getTranslationUnitTargetInfo_ptr = + _lookup>( + 'clang_getTranslationUnitTargetInfo'); + late final _dart_clang_getTranslationUnitTargetInfo + _clang_getTranslationUnitTargetInfo = + _clang_getTranslationUnitTargetInfo_ptr + .asFunction<_dart_clang_getTranslationUnitTargetInfo>(); /// Destroy the CXTargetInfo object. void clang_TargetInfo_dispose( ffi.Pointer Info, ) { - return (_clang_TargetInfo_dispose ??= - _lookup>( - 'clang_TargetInfo_dispose') - .asFunction<_dart_clang_TargetInfo_dispose>())( + return _clang_TargetInfo_dispose( Info, ); } - _dart_clang_TargetInfo_dispose? _clang_TargetInfo_dispose; + late final _clang_TargetInfo_dispose_ptr = + _lookup>( + 'clang_TargetInfo_dispose'); + late final _dart_clang_TargetInfo_dispose _clang_TargetInfo_dispose = + _clang_TargetInfo_dispose_ptr + .asFunction<_dart_clang_TargetInfo_dispose>(); /// Get the normalized target triple as a string. CXString clang_TargetInfo_getTriple( ffi.Pointer Info, ) { - return (_clang_TargetInfo_getTriple ??= - _lookup>( - 'clang_TargetInfo_getTriple') - .asFunction<_dart_clang_TargetInfo_getTriple>())( + return _clang_TargetInfo_getTriple( Info, ); } - _dart_clang_TargetInfo_getTriple? _clang_TargetInfo_getTriple; + late final _clang_TargetInfo_getTriple_ptr = + _lookup>( + 'clang_TargetInfo_getTriple'); + late final _dart_clang_TargetInfo_getTriple _clang_TargetInfo_getTriple = + _clang_TargetInfo_getTriple_ptr + .asFunction<_dart_clang_TargetInfo_getTriple>(); /// Get the pointer width of the target in bits. int clang_TargetInfo_getPointerWidth( ffi.Pointer Info, ) { - return (_clang_TargetInfo_getPointerWidth ??= - _lookup>( - 'clang_TargetInfo_getPointerWidth') - .asFunction<_dart_clang_TargetInfo_getPointerWidth>())( + return _clang_TargetInfo_getPointerWidth( Info, ); } - _dart_clang_TargetInfo_getPointerWidth? _clang_TargetInfo_getPointerWidth; + late final _clang_TargetInfo_getPointerWidth_ptr = + _lookup>( + 'clang_TargetInfo_getPointerWidth'); + late final _dart_clang_TargetInfo_getPointerWidth + _clang_TargetInfo_getPointerWidth = _clang_TargetInfo_getPointerWidth_ptr + .asFunction<_dart_clang_TargetInfo_getPointerWidth>(); /// Retrieve the NULL cursor, which represents no entity. CXCursor clang_getNullCursor() { - return (_clang_getNullCursor ??= - _lookup>( - 'clang_getNullCursor') - .asFunction<_dart_clang_getNullCursor>())(); + return _clang_getNullCursor(); } - _dart_clang_getNullCursor? _clang_getNullCursor; + late final _clang_getNullCursor_ptr = + _lookup>( + 'clang_getNullCursor'); + late final _dart_clang_getNullCursor _clang_getNullCursor = + _clang_getNullCursor_ptr.asFunction<_dart_clang_getNullCursor>(); /// Retrieve the cursor that represents the given translation unit. CXCursor clang_getTranslationUnitCursor( ffi.Pointer arg0, ) { - return (_clang_getTranslationUnitCursor ??= - _lookup>( - 'clang_getTranslationUnitCursor') - .asFunction<_dart_clang_getTranslationUnitCursor>())( + return _clang_getTranslationUnitCursor( arg0, ); } - _dart_clang_getTranslationUnitCursor? _clang_getTranslationUnitCursor; + late final _clang_getTranslationUnitCursor_ptr = + _lookup>( + 'clang_getTranslationUnitCursor'); + late final _dart_clang_getTranslationUnitCursor + _clang_getTranslationUnitCursor = _clang_getTranslationUnitCursor_ptr + .asFunction<_dart_clang_getTranslationUnitCursor>(); /// Determine whether two cursors are equivalent. int clang_equalCursors( CXCursor arg0, CXCursor arg1, ) { - return (_clang_equalCursors ??= - _lookup>('clang_equalCursors') - .asFunction<_dart_clang_equalCursors>())( + return _clang_equalCursors( arg0, arg1, ); } - _dart_clang_equalCursors? _clang_equalCursors; + late final _clang_equalCursors_ptr = + _lookup>('clang_equalCursors'); + late final _dart_clang_equalCursors _clang_equalCursors = + _clang_equalCursors_ptr.asFunction<_dart_clang_equalCursors>(); /// Returns non-zero if cursor is null. int clang_Cursor_isNull( CXCursor cursor, ) { - return (_clang_Cursor_isNull ??= - _lookup>( - 'clang_Cursor_isNull') - .asFunction<_dart_clang_Cursor_isNull>())( + return _clang_Cursor_isNull( cursor, ); } - _dart_clang_Cursor_isNull? _clang_Cursor_isNull; + late final _clang_Cursor_isNull_ptr = + _lookup>( + 'clang_Cursor_isNull'); + late final _dart_clang_Cursor_isNull _clang_Cursor_isNull = + _clang_Cursor_isNull_ptr.asFunction<_dart_clang_Cursor_isNull>(); /// Compute a hash value for the given cursor. int clang_hashCursor( CXCursor arg0, ) { - return (_clang_hashCursor ??= - _lookup>('clang_hashCursor') - .asFunction<_dart_clang_hashCursor>())( + return _clang_hashCursor( arg0, ); } - _dart_clang_hashCursor? _clang_hashCursor; + late final _clang_hashCursor_ptr = + _lookup>('clang_hashCursor'); + late final _dart_clang_hashCursor _clang_hashCursor = + _clang_hashCursor_ptr.asFunction<_dart_clang_hashCursor>(); /// Retrieve the kind of the given cursor. int clang_getCursorKind( CXCursor arg0, ) { - return (_clang_getCursorKind ??= - _lookup>( - 'clang_getCursorKind') - .asFunction<_dart_clang_getCursorKind>())( + return _clang_getCursorKind( arg0, ); } - _dart_clang_getCursorKind? _clang_getCursorKind; + late final _clang_getCursorKind_ptr = + _lookup>( + 'clang_getCursorKind'); + late final _dart_clang_getCursorKind _clang_getCursorKind = + _clang_getCursorKind_ptr.asFunction<_dart_clang_getCursorKind>(); /// Determine whether the given cursor kind represents a declaration. int clang_isDeclaration( int arg0, ) { - return (_clang_isDeclaration ??= - _lookup>( - 'clang_isDeclaration') - .asFunction<_dart_clang_isDeclaration>())( + return _clang_isDeclaration( arg0, ); } - _dart_clang_isDeclaration? _clang_isDeclaration; + late final _clang_isDeclaration_ptr = + _lookup>( + 'clang_isDeclaration'); + late final _dart_clang_isDeclaration _clang_isDeclaration = + _clang_isDeclaration_ptr.asFunction<_dart_clang_isDeclaration>(); /// Determine whether the given declaration is invalid. int clang_isInvalidDeclaration( CXCursor arg0, ) { - return (_clang_isInvalidDeclaration ??= - _lookup>( - 'clang_isInvalidDeclaration') - .asFunction<_dart_clang_isInvalidDeclaration>())( + return _clang_isInvalidDeclaration( arg0, ); } - _dart_clang_isInvalidDeclaration? _clang_isInvalidDeclaration; + late final _clang_isInvalidDeclaration_ptr = + _lookup>( + 'clang_isInvalidDeclaration'); + late final _dart_clang_isInvalidDeclaration _clang_isInvalidDeclaration = + _clang_isInvalidDeclaration_ptr + .asFunction<_dart_clang_isInvalidDeclaration>(); /// Determine whether the given cursor kind represents a simple reference. int clang_isReference( int arg0, ) { - return (_clang_isReference ??= - _lookup>('clang_isReference') - .asFunction<_dart_clang_isReference>())( + return _clang_isReference( arg0, ); } - _dart_clang_isReference? _clang_isReference; + late final _clang_isReference_ptr = + _lookup>('clang_isReference'); + late final _dart_clang_isReference _clang_isReference = + _clang_isReference_ptr.asFunction<_dart_clang_isReference>(); /// Determine whether the given cursor kind represents an expression. int clang_isExpression( int arg0, ) { - return (_clang_isExpression ??= - _lookup>('clang_isExpression') - .asFunction<_dart_clang_isExpression>())( + return _clang_isExpression( arg0, ); } - _dart_clang_isExpression? _clang_isExpression; + late final _clang_isExpression_ptr = + _lookup>('clang_isExpression'); + late final _dart_clang_isExpression _clang_isExpression = + _clang_isExpression_ptr.asFunction<_dart_clang_isExpression>(); /// Determine whether the given cursor kind represents a statement. int clang_isStatement( int arg0, ) { - return (_clang_isStatement ??= - _lookup>('clang_isStatement') - .asFunction<_dart_clang_isStatement>())( + return _clang_isStatement( arg0, ); } - _dart_clang_isStatement? _clang_isStatement; + late final _clang_isStatement_ptr = + _lookup>('clang_isStatement'); + late final _dart_clang_isStatement _clang_isStatement = + _clang_isStatement_ptr.asFunction<_dart_clang_isStatement>(); /// Determine whether the given cursor kind represents an attribute. int clang_isAttribute( int arg0, ) { - return (_clang_isAttribute ??= - _lookup>('clang_isAttribute') - .asFunction<_dart_clang_isAttribute>())( + return _clang_isAttribute( arg0, ); } - _dart_clang_isAttribute? _clang_isAttribute; + late final _clang_isAttribute_ptr = + _lookup>('clang_isAttribute'); + late final _dart_clang_isAttribute _clang_isAttribute = + _clang_isAttribute_ptr.asFunction<_dart_clang_isAttribute>(); /// Determine whether the given cursor has any attributes. int clang_Cursor_hasAttrs( CXCursor C, ) { - return (_clang_Cursor_hasAttrs ??= - _lookup>( - 'clang_Cursor_hasAttrs') - .asFunction<_dart_clang_Cursor_hasAttrs>())( + return _clang_Cursor_hasAttrs( C, ); } - _dart_clang_Cursor_hasAttrs? _clang_Cursor_hasAttrs; + late final _clang_Cursor_hasAttrs_ptr = + _lookup>( + 'clang_Cursor_hasAttrs'); + late final _dart_clang_Cursor_hasAttrs _clang_Cursor_hasAttrs = + _clang_Cursor_hasAttrs_ptr.asFunction<_dart_clang_Cursor_hasAttrs>(); /// Determine whether the given cursor kind represents an invalid cursor. int clang_isInvalid( int arg0, ) { - return (_clang_isInvalid ??= - _lookup>('clang_isInvalid') - .asFunction<_dart_clang_isInvalid>())( + return _clang_isInvalid( arg0, ); } - _dart_clang_isInvalid? _clang_isInvalid; + late final _clang_isInvalid_ptr = + _lookup>('clang_isInvalid'); + late final _dart_clang_isInvalid _clang_isInvalid = + _clang_isInvalid_ptr.asFunction<_dart_clang_isInvalid>(); /// Determine whether the given cursor kind represents a translation unit. int clang_isTranslationUnit( int arg0, ) { - return (_clang_isTranslationUnit ??= - _lookup>( - 'clang_isTranslationUnit') - .asFunction<_dart_clang_isTranslationUnit>())( + return _clang_isTranslationUnit( arg0, ); } - _dart_clang_isTranslationUnit? _clang_isTranslationUnit; + late final _clang_isTranslationUnit_ptr = + _lookup>( + 'clang_isTranslationUnit'); + late final _dart_clang_isTranslationUnit _clang_isTranslationUnit = + _clang_isTranslationUnit_ptr.asFunction<_dart_clang_isTranslationUnit>(); /// * Determine whether the given cursor represents a preprocessing element, /// such as a preprocessor directive or macro instantiation. int clang_isPreprocessing( int arg0, ) { - return (_clang_isPreprocessing ??= - _lookup>( - 'clang_isPreprocessing') - .asFunction<_dart_clang_isPreprocessing>())( + return _clang_isPreprocessing( arg0, ); } - _dart_clang_isPreprocessing? _clang_isPreprocessing; + late final _clang_isPreprocessing_ptr = + _lookup>( + 'clang_isPreprocessing'); + late final _dart_clang_isPreprocessing _clang_isPreprocessing = + _clang_isPreprocessing_ptr.asFunction<_dart_clang_isPreprocessing>(); /// * Determine whether the given cursor represents a currently unexposed /// piece of the AST (e.g., CXCursor_UnexposedStmt). int clang_isUnexposed( int arg0, ) { - return (_clang_isUnexposed ??= - _lookup>('clang_isUnexposed') - .asFunction<_dart_clang_isUnexposed>())( + return _clang_isUnexposed( arg0, ); } - _dart_clang_isUnexposed? _clang_isUnexposed; + late final _clang_isUnexposed_ptr = + _lookup>('clang_isUnexposed'); + late final _dart_clang_isUnexposed _clang_isUnexposed = + _clang_isUnexposed_ptr.asFunction<_dart_clang_isUnexposed>(); /// Determine the linkage of the entity referred to by a given cursor. int clang_getCursorLinkage( CXCursor cursor, ) { - return (_clang_getCursorLinkage ??= - _lookup>( - 'clang_getCursorLinkage') - .asFunction<_dart_clang_getCursorLinkage>())( + return _clang_getCursorLinkage( cursor, ); } - _dart_clang_getCursorLinkage? _clang_getCursorLinkage; + late final _clang_getCursorLinkage_ptr = + _lookup>( + 'clang_getCursorLinkage'); + late final _dart_clang_getCursorLinkage _clang_getCursorLinkage = + _clang_getCursorLinkage_ptr.asFunction<_dart_clang_getCursorLinkage>(); /// Describe the visibility of the entity referred to by a cursor. int clang_getCursorVisibility( CXCursor cursor, ) { - return (_clang_getCursorVisibility ??= - _lookup>( - 'clang_getCursorVisibility') - .asFunction<_dart_clang_getCursorVisibility>())( + return _clang_getCursorVisibility( cursor, ); } - _dart_clang_getCursorVisibility? _clang_getCursorVisibility; + late final _clang_getCursorVisibility_ptr = + _lookup>( + 'clang_getCursorVisibility'); + late final _dart_clang_getCursorVisibility _clang_getCursorVisibility = + _clang_getCursorVisibility_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_getCursorAvailability') - .asFunction<_dart_clang_getCursorAvailability>())( + return _clang_getCursorAvailability( cursor, ); } - _dart_clang_getCursorAvailability? _clang_getCursorAvailability; + late final _clang_getCursorAvailability_ptr = + _lookup>( + 'clang_getCursorAvailability'); + late final _dart_clang_getCursorAvailability _clang_getCursorAvailability = + _clang_getCursorAvailability_ptr + .asFunction<_dart_clang_getCursorAvailability>(); /// Determine the availability of the entity that this cursor refers to on any /// platforms for which availability information is known. @@ -1777,10 +1953,7 @@ class LibClang { ffi.Pointer availability, int availability_size, ) { - return (_clang_getCursorPlatformAvailability ??= - _lookup>( - 'clang_getCursorPlatformAvailability') - .asFunction<_dart_clang_getCursorPlatformAvailability>())( + return _clang_getCursorPlatformAvailability( cursor, always_deprecated, deprecated_message, @@ -1791,150 +1964,172 @@ class LibClang { ); } - _dart_clang_getCursorPlatformAvailability? - _clang_getCursorPlatformAvailability; + late final _clang_getCursorPlatformAvailability_ptr = + _lookup>( + 'clang_getCursorPlatformAvailability'); + late final _dart_clang_getCursorPlatformAvailability + _clang_getCursorPlatformAvailability = + _clang_getCursorPlatformAvailability_ptr + .asFunction<_dart_clang_getCursorPlatformAvailability>(); /// Free the memory associated with a CXPlatformAvailability structure. void clang_disposeCXPlatformAvailability( ffi.Pointer availability, ) { - return (_clang_disposeCXPlatformAvailability ??= - _lookup>( - 'clang_disposeCXPlatformAvailability') - .asFunction<_dart_clang_disposeCXPlatformAvailability>())( + return _clang_disposeCXPlatformAvailability( availability, ); } - _dart_clang_disposeCXPlatformAvailability? - _clang_disposeCXPlatformAvailability; + late final _clang_disposeCXPlatformAvailability_ptr = + _lookup>( + 'clang_disposeCXPlatformAvailability'); + late final _dart_clang_disposeCXPlatformAvailability + _clang_disposeCXPlatformAvailability = + _clang_disposeCXPlatformAvailability_ptr + .asFunction<_dart_clang_disposeCXPlatformAvailability>(); /// Determine the "language" of the entity referred to by a given cursor. int clang_getCursorLanguage( CXCursor cursor, ) { - return (_clang_getCursorLanguage ??= - _lookup>( - 'clang_getCursorLanguage') - .asFunction<_dart_clang_getCursorLanguage>())( + return _clang_getCursorLanguage( cursor, ); } - _dart_clang_getCursorLanguage? _clang_getCursorLanguage; + late final _clang_getCursorLanguage_ptr = + _lookup>( + 'clang_getCursorLanguage'); + late final _dart_clang_getCursorLanguage _clang_getCursorLanguage = + _clang_getCursorLanguage_ptr.asFunction<_dart_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 ??= - _lookup>( - 'clang_getCursorTLSKind') - .asFunction<_dart_clang_getCursorTLSKind>())( + return _clang_getCursorTLSKind( cursor, ); } - _dart_clang_getCursorTLSKind? _clang_getCursorTLSKind; + late final _clang_getCursorTLSKind_ptr = + _lookup>( + 'clang_getCursorTLSKind'); + late final _dart_clang_getCursorTLSKind _clang_getCursorTLSKind = + _clang_getCursorTLSKind_ptr.asFunction<_dart_clang_getCursorTLSKind>(); /// Returns the translation unit that a cursor originated from. ffi.Pointer clang_Cursor_getTranslationUnit( CXCursor arg0, ) { - return (_clang_Cursor_getTranslationUnit ??= - _lookup>( - 'clang_Cursor_getTranslationUnit') - .asFunction<_dart_clang_Cursor_getTranslationUnit>())( + return _clang_Cursor_getTranslationUnit( arg0, ); } - _dart_clang_Cursor_getTranslationUnit? _clang_Cursor_getTranslationUnit; + late final _clang_Cursor_getTranslationUnit_ptr = + _lookup>( + 'clang_Cursor_getTranslationUnit'); + late final _dart_clang_Cursor_getTranslationUnit + _clang_Cursor_getTranslationUnit = _clang_Cursor_getTranslationUnit_ptr + .asFunction<_dart_clang_Cursor_getTranslationUnit>(); /// Creates an empty CXCursorSet. ffi.Pointer clang_createCXCursorSet() { - return (_clang_createCXCursorSet ??= - _lookup>( - 'clang_createCXCursorSet') - .asFunction<_dart_clang_createCXCursorSet>())(); + return _clang_createCXCursorSet(); } - _dart_clang_createCXCursorSet? _clang_createCXCursorSet; + late final _clang_createCXCursorSet_ptr = + _lookup>( + 'clang_createCXCursorSet'); + late final _dart_clang_createCXCursorSet _clang_createCXCursorSet = + _clang_createCXCursorSet_ptr.asFunction<_dart_clang_createCXCursorSet>(); /// Disposes a CXCursorSet and releases its associated memory. void clang_disposeCXCursorSet( ffi.Pointer cset, ) { - return (_clang_disposeCXCursorSet ??= - _lookup>( - 'clang_disposeCXCursorSet') - .asFunction<_dart_clang_disposeCXCursorSet>())( + return _clang_disposeCXCursorSet( cset, ); } - _dart_clang_disposeCXCursorSet? _clang_disposeCXCursorSet; + late final _clang_disposeCXCursorSet_ptr = + _lookup>( + 'clang_disposeCXCursorSet'); + late final _dart_clang_disposeCXCursorSet _clang_disposeCXCursorSet = + _clang_disposeCXCursorSet_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_CXCursorSet_contains') - .asFunction<_dart_clang_CXCursorSet_contains>())( + return _clang_CXCursorSet_contains( cset, cursor, ); } - _dart_clang_CXCursorSet_contains? _clang_CXCursorSet_contains; + late final _clang_CXCursorSet_contains_ptr = + _lookup>( + 'clang_CXCursorSet_contains'); + late final _dart_clang_CXCursorSet_contains _clang_CXCursorSet_contains = + _clang_CXCursorSet_contains_ptr + .asFunction<_dart_clang_CXCursorSet_contains>(); /// Inserts a CXCursor into a CXCursorSet. int clang_CXCursorSet_insert( ffi.Pointer cset, CXCursor cursor, ) { - return (_clang_CXCursorSet_insert ??= - _lookup>( - 'clang_CXCursorSet_insert') - .asFunction<_dart_clang_CXCursorSet_insert>())( + return _clang_CXCursorSet_insert( cset, cursor, ); } - _dart_clang_CXCursorSet_insert? _clang_CXCursorSet_insert; + late final _clang_CXCursorSet_insert_ptr = + _lookup>( + 'clang_CXCursorSet_insert'); + late final _dart_clang_CXCursorSet_insert _clang_CXCursorSet_insert = + _clang_CXCursorSet_insert_ptr + .asFunction<_dart_clang_CXCursorSet_insert>(); /// Determine the semantic parent of the given cursor. CXCursor clang_getCursorSemanticParent( CXCursor cursor, ) { - return (_clang_getCursorSemanticParent ??= - _lookup>( - 'clang_getCursorSemanticParent') - .asFunction<_dart_clang_getCursorSemanticParent>())( + return _clang_getCursorSemanticParent( cursor, ); } - _dart_clang_getCursorSemanticParent? _clang_getCursorSemanticParent; + late final _clang_getCursorSemanticParent_ptr = + _lookup>( + 'clang_getCursorSemanticParent'); + late final _dart_clang_getCursorSemanticParent + _clang_getCursorSemanticParent = _clang_getCursorSemanticParent_ptr + .asFunction<_dart_clang_getCursorSemanticParent>(); /// Determine the lexical parent of the given cursor. CXCursor clang_getCursorLexicalParent( CXCursor cursor, ) { - return (_clang_getCursorLexicalParent ??= - _lookup>( - 'clang_getCursorLexicalParent') - .asFunction<_dart_clang_getCursorLexicalParent>())( + return _clang_getCursorLexicalParent( cursor, ); } - _dart_clang_getCursorLexicalParent? _clang_getCursorLexicalParent; + late final _clang_getCursorLexicalParent_ptr = + _lookup>( + 'clang_getCursorLexicalParent'); + late final _dart_clang_getCursorLexicalParent _clang_getCursorLexicalParent = + _clang_getCursorLexicalParent_ptr + .asFunction<_dart_clang_getCursorLexicalParent>(); /// Determine the set of methods that are overridden by the given method. void clang_getOverriddenCursors( @@ -1942,47 +2137,52 @@ class LibClang { ffi.Pointer> overridden, ffi.Pointer num_overridden, ) { - return (_clang_getOverriddenCursors ??= - _lookup>( - 'clang_getOverriddenCursors') - .asFunction<_dart_clang_getOverriddenCursors>())( + return _clang_getOverriddenCursors( cursor, overridden, num_overridden, ); } - _dart_clang_getOverriddenCursors? _clang_getOverriddenCursors; + late final _clang_getOverriddenCursors_ptr = + _lookup>( + 'clang_getOverriddenCursors'); + late final _dart_clang_getOverriddenCursors _clang_getOverriddenCursors = + _clang_getOverriddenCursors_ptr + .asFunction<_dart_clang_getOverriddenCursors>(); /// Free the set of overridden cursors returned by /// clang_getOverriddenCursors(). void clang_disposeOverriddenCursors( ffi.Pointer overridden, ) { - return (_clang_disposeOverriddenCursors ??= - _lookup>( - 'clang_disposeOverriddenCursors') - .asFunction<_dart_clang_disposeOverriddenCursors>())( + return _clang_disposeOverriddenCursors( overridden, ); } - _dart_clang_disposeOverriddenCursors? _clang_disposeOverriddenCursors; + late final _clang_disposeOverriddenCursors_ptr = + _lookup>( + 'clang_disposeOverriddenCursors'); + late final _dart_clang_disposeOverriddenCursors + _clang_disposeOverriddenCursors = _clang_disposeOverriddenCursors_ptr + .asFunction<_dart_clang_disposeOverriddenCursors>(); /// Retrieve the file that is included by the given inclusion directive /// cursor. ffi.Pointer clang_getIncludedFile( CXCursor cursor, ) { - return (_clang_getIncludedFile ??= - _lookup>( - 'clang_getIncludedFile') - .asFunction<_dart_clang_getIncludedFile>())( + return _clang_getIncludedFile( cursor, ); } - _dart_clang_getIncludedFile? _clang_getIncludedFile; + late final _clang_getIncludedFile_ptr = + _lookup>( + 'clang_getIncludedFile'); + late final _dart_clang_getIncludedFile _clang_getIncludedFile = + _clang_getIncludedFile_ptr.asFunction<_dart_clang_getIncludedFile>(); /// Map a source location to the cursor that describes the entity at that /// location in the source code. @@ -1990,211 +2190,235 @@ class LibClang { ffi.Pointer arg0, CXSourceLocation arg1, ) { - return (_clang_getCursor ??= - _lookup>('clang_getCursor') - .asFunction<_dart_clang_getCursor>())( + return _clang_getCursor( arg0, arg1, ); } - _dart_clang_getCursor? _clang_getCursor; + late final _clang_getCursor_ptr = + _lookup>('clang_getCursor'); + late final _dart_clang_getCursor _clang_getCursor = + _clang_getCursor_ptr.asFunction<_dart_clang_getCursor>(); /// Retrieve the physical location of the source constructor referenced by the /// given cursor. CXSourceLocation clang_getCursorLocation( CXCursor arg0, ) { - return (_clang_getCursorLocation ??= - _lookup>( - 'clang_getCursorLocation') - .asFunction<_dart_clang_getCursorLocation>())( + return _clang_getCursorLocation( arg0, ); } - _dart_clang_getCursorLocation? _clang_getCursorLocation; + late final _clang_getCursorLocation_ptr = + _lookup>( + 'clang_getCursorLocation'); + late final _dart_clang_getCursorLocation _clang_getCursorLocation = + _clang_getCursorLocation_ptr.asFunction<_dart_clang_getCursorLocation>(); /// Retrieve the physical extent of the source construct referenced by the /// given cursor. CXSourceRange clang_getCursorExtent( CXCursor arg0, ) { - return (_clang_getCursorExtent ??= - _lookup>( - 'clang_getCursorExtent') - .asFunction<_dart_clang_getCursorExtent>())( + return _clang_getCursorExtent( arg0, ); } - _dart_clang_getCursorExtent? _clang_getCursorExtent; + late final _clang_getCursorExtent_ptr = + _lookup>( + 'clang_getCursorExtent'); + late final _dart_clang_getCursorExtent _clang_getCursorExtent = + _clang_getCursorExtent_ptr.asFunction<_dart_clang_getCursorExtent>(); /// Retrieve the type of a CXCursor (if any). CXType clang_getCursorType( CXCursor C, ) { - return (_clang_getCursorType ??= - _lookup>( - 'clang_getCursorType') - .asFunction<_dart_clang_getCursorType>())( + return _clang_getCursorType( C, ); } - _dart_clang_getCursorType? _clang_getCursorType; + late final _clang_getCursorType_ptr = + _lookup>( + 'clang_getCursorType'); + late final _dart_clang_getCursorType _clang_getCursorType = + _clang_getCursorType_ptr.asFunction<_dart_clang_getCursorType>(); /// 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_getTypeSpelling ??= - _lookup>( - 'clang_getTypeSpelling') - .asFunction<_dart_clang_getTypeSpelling>())( + return _clang_getTypeSpelling( CT, ); } - _dart_clang_getTypeSpelling? _clang_getTypeSpelling; + late final _clang_getTypeSpelling_ptr = + _lookup>( + 'clang_getTypeSpelling'); + late final _dart_clang_getTypeSpelling _clang_getTypeSpelling = + _clang_getTypeSpelling_ptr.asFunction<_dart_clang_getTypeSpelling>(); /// Retrieve the underlying type of a typedef declaration. CXType clang_getTypedefDeclUnderlyingType( CXCursor C, ) { - return (_clang_getTypedefDeclUnderlyingType ??= - _lookup>( - 'clang_getTypedefDeclUnderlyingType') - .asFunction<_dart_clang_getTypedefDeclUnderlyingType>())( + return _clang_getTypedefDeclUnderlyingType( C, ); } - _dart_clang_getTypedefDeclUnderlyingType? _clang_getTypedefDeclUnderlyingType; + late final _clang_getTypedefDeclUnderlyingType_ptr = + _lookup>( + 'clang_getTypedefDeclUnderlyingType'); + late final _dart_clang_getTypedefDeclUnderlyingType + _clang_getTypedefDeclUnderlyingType = + _clang_getTypedefDeclUnderlyingType_ptr + .asFunction<_dart_clang_getTypedefDeclUnderlyingType>(); /// Retrieve the integer type of an enum declaration. CXType clang_getEnumDeclIntegerType( CXCursor C, ) { - return (_clang_getEnumDeclIntegerType ??= - _lookup>( - 'clang_getEnumDeclIntegerType') - .asFunction<_dart_clang_getEnumDeclIntegerType>())( + return _clang_getEnumDeclIntegerType( C, ); } - _dart_clang_getEnumDeclIntegerType? _clang_getEnumDeclIntegerType; + late final _clang_getEnumDeclIntegerType_ptr = + _lookup>( + 'clang_getEnumDeclIntegerType'); + late final _dart_clang_getEnumDeclIntegerType _clang_getEnumDeclIntegerType = + _clang_getEnumDeclIntegerType_ptr + .asFunction<_dart_clang_getEnumDeclIntegerType>(); /// Retrieve the integer value of an enum constant declaration as a signed /// long long. int clang_getEnumConstantDeclValue( CXCursor C, ) { - return (_clang_getEnumConstantDeclValue ??= - _lookup>( - 'clang_getEnumConstantDeclValue') - .asFunction<_dart_clang_getEnumConstantDeclValue>())( + return _clang_getEnumConstantDeclValue( C, ); } - _dart_clang_getEnumConstantDeclValue? _clang_getEnumConstantDeclValue; + late final _clang_getEnumConstantDeclValue_ptr = + _lookup>( + 'clang_getEnumConstantDeclValue'); + late final _dart_clang_getEnumConstantDeclValue + _clang_getEnumConstantDeclValue = _clang_getEnumConstantDeclValue_ptr + .asFunction<_dart_clang_getEnumConstantDeclValue>(); /// Retrieve the integer value of an enum constant declaration as an unsigned /// long long. int clang_getEnumConstantDeclUnsignedValue( CXCursor C, ) { - return (_clang_getEnumConstantDeclUnsignedValue ??= - _lookup>( - 'clang_getEnumConstantDeclUnsignedValue') - .asFunction<_dart_clang_getEnumConstantDeclUnsignedValue>())( + return _clang_getEnumConstantDeclUnsignedValue( C, ); } - _dart_clang_getEnumConstantDeclUnsignedValue? - _clang_getEnumConstantDeclUnsignedValue; + late final _clang_getEnumConstantDeclUnsignedValue_ptr = + _lookup>( + 'clang_getEnumConstantDeclUnsignedValue'); + late final _dart_clang_getEnumConstantDeclUnsignedValue + _clang_getEnumConstantDeclUnsignedValue = + _clang_getEnumConstantDeclUnsignedValue_ptr + .asFunction<_dart_clang_getEnumConstantDeclUnsignedValue>(); /// Retrieve the bit width of a bit field declaration as an integer. int clang_getFieldDeclBitWidth( CXCursor C, ) { - return (_clang_getFieldDeclBitWidth ??= - _lookup>( - 'clang_getFieldDeclBitWidth') - .asFunction<_dart_clang_getFieldDeclBitWidth>())( + return _clang_getFieldDeclBitWidth( C, ); } - _dart_clang_getFieldDeclBitWidth? _clang_getFieldDeclBitWidth; + late final _clang_getFieldDeclBitWidth_ptr = + _lookup>( + 'clang_getFieldDeclBitWidth'); + late final _dart_clang_getFieldDeclBitWidth _clang_getFieldDeclBitWidth = + _clang_getFieldDeclBitWidth_ptr + .asFunction<_dart_clang_getFieldDeclBitWidth>(); /// Retrieve the number of non-variadic arguments associated with a given /// cursor. int clang_Cursor_getNumArguments( CXCursor C, ) { - return (_clang_Cursor_getNumArguments ??= - _lookup>( - 'clang_Cursor_getNumArguments') - .asFunction<_dart_clang_Cursor_getNumArguments>())( + return _clang_Cursor_getNumArguments( C, ); } - _dart_clang_Cursor_getNumArguments? _clang_Cursor_getNumArguments; + late final _clang_Cursor_getNumArguments_ptr = + _lookup>( + 'clang_Cursor_getNumArguments'); + late final _dart_clang_Cursor_getNumArguments _clang_Cursor_getNumArguments = + _clang_Cursor_getNumArguments_ptr + .asFunction<_dart_clang_Cursor_getNumArguments>(); /// Retrieve the argument cursor of a function or method. CXCursor clang_Cursor_getArgument( CXCursor C, int i, ) { - return (_clang_Cursor_getArgument ??= - _lookup>( - 'clang_Cursor_getArgument') - .asFunction<_dart_clang_Cursor_getArgument>())( + return _clang_Cursor_getArgument( C, i, ); } - _dart_clang_Cursor_getArgument? _clang_Cursor_getArgument; + late final _clang_Cursor_getArgument_ptr = + _lookup>( + 'clang_Cursor_getArgument'); + late final _dart_clang_Cursor_getArgument _clang_Cursor_getArgument = + _clang_Cursor_getArgument_ptr + .asFunction<_dart_clang_Cursor_getArgument>(); /// Returns the number of template args of a function decl representing a /// template specialization. int clang_Cursor_getNumTemplateArguments( CXCursor C, ) { - return (_clang_Cursor_getNumTemplateArguments ??= - _lookup>( - 'clang_Cursor_getNumTemplateArguments') - .asFunction<_dart_clang_Cursor_getNumTemplateArguments>())( + return _clang_Cursor_getNumTemplateArguments( C, ); } - _dart_clang_Cursor_getNumTemplateArguments? - _clang_Cursor_getNumTemplateArguments; + late final _clang_Cursor_getNumTemplateArguments_ptr = + _lookup>( + 'clang_Cursor_getNumTemplateArguments'); + late final _dart_clang_Cursor_getNumTemplateArguments + _clang_Cursor_getNumTemplateArguments = + _clang_Cursor_getNumTemplateArguments_ptr + .asFunction<_dart_clang_Cursor_getNumTemplateArguments>(); /// Retrieve the kind of the I'th template argument of the CXCursor C. int clang_Cursor_getTemplateArgumentKind( CXCursor C, int I, ) { - return (_clang_Cursor_getTemplateArgumentKind ??= - _lookup>( - 'clang_Cursor_getTemplateArgumentKind') - .asFunction<_dart_clang_Cursor_getTemplateArgumentKind>())( + return _clang_Cursor_getTemplateArgumentKind( C, I, ); } - _dart_clang_Cursor_getTemplateArgumentKind? - _clang_Cursor_getTemplateArgumentKind; + late final _clang_Cursor_getTemplateArgumentKind_ptr = + _lookup>( + 'clang_Cursor_getTemplateArgumentKind'); + late final _dart_clang_Cursor_getTemplateArgumentKind + _clang_Cursor_getTemplateArgumentKind = + _clang_Cursor_getTemplateArgumentKind_ptr + .asFunction<_dart_clang_Cursor_getTemplateArgumentKind>(); /// Retrieve a CXType representing the type of a TemplateArgument of a /// function decl representing a template specialization. @@ -2202,17 +2426,19 @@ class LibClang { CXCursor C, int I, ) { - return (_clang_Cursor_getTemplateArgumentType ??= - _lookup>( - 'clang_Cursor_getTemplateArgumentType') - .asFunction<_dart_clang_Cursor_getTemplateArgumentType>())( + return _clang_Cursor_getTemplateArgumentType( C, I, ); } - _dart_clang_Cursor_getTemplateArgumentType? - _clang_Cursor_getTemplateArgumentType; + late final _clang_Cursor_getTemplateArgumentType_ptr = + _lookup>( + 'clang_Cursor_getTemplateArgumentType'); + late final _dart_clang_Cursor_getTemplateArgumentType + _clang_Cursor_getTemplateArgumentType = + _clang_Cursor_getTemplateArgumentType_ptr + .asFunction<_dart_clang_Cursor_getTemplateArgumentType>(); /// Retrieve the value of an Integral TemplateArgument (of a function decl /// representing a template specialization) as a signed long long. @@ -2220,17 +2446,19 @@ class LibClang { CXCursor C, int I, ) { - return (_clang_Cursor_getTemplateArgumentValue ??= - _lookup>( - 'clang_Cursor_getTemplateArgumentValue') - .asFunction<_dart_clang_Cursor_getTemplateArgumentValue>())( + return _clang_Cursor_getTemplateArgumentValue( C, I, ); } - _dart_clang_Cursor_getTemplateArgumentValue? - _clang_Cursor_getTemplateArgumentValue; + late final _clang_Cursor_getTemplateArgumentValue_ptr = + _lookup>( + 'clang_Cursor_getTemplateArgumentValue'); + late final _dart_clang_Cursor_getTemplateArgumentValue + _clang_Cursor_getTemplateArgumentValue = + _clang_Cursor_getTemplateArgumentValue_ptr + .asFunction<_dart_clang_Cursor_getTemplateArgumentValue>(); /// Retrieve the value of an Integral TemplateArgument (of a function decl /// representing a template specialization) as an unsigned long long. @@ -2238,105 +2466,116 @@ class LibClang { CXCursor C, int I, ) { - return (_clang_Cursor_getTemplateArgumentUnsignedValue ??= _lookup< - ffi.NativeFunction< - _c_clang_Cursor_getTemplateArgumentUnsignedValue>>( - 'clang_Cursor_getTemplateArgumentUnsignedValue') - .asFunction<_dart_clang_Cursor_getTemplateArgumentUnsignedValue>())( + return _clang_Cursor_getTemplateArgumentUnsignedValue( C, I, ); } - _dart_clang_Cursor_getTemplateArgumentUnsignedValue? - _clang_Cursor_getTemplateArgumentUnsignedValue; + late final _clang_Cursor_getTemplateArgumentUnsignedValue_ptr = _lookup< + ffi.NativeFunction<_c_clang_Cursor_getTemplateArgumentUnsignedValue>>( + 'clang_Cursor_getTemplateArgumentUnsignedValue'); + late final _dart_clang_Cursor_getTemplateArgumentUnsignedValue + _clang_Cursor_getTemplateArgumentUnsignedValue = + _clang_Cursor_getTemplateArgumentUnsignedValue_ptr + .asFunction<_dart_clang_Cursor_getTemplateArgumentUnsignedValue>(); /// Determine whether two CXTypes represent the same type. int clang_equalTypes( CXType A, CXType B, ) { - return (_clang_equalTypes ??= - _lookup>('clang_equalTypes') - .asFunction<_dart_clang_equalTypes>())( + return _clang_equalTypes( A, B, ); } - _dart_clang_equalTypes? _clang_equalTypes; + late final _clang_equalTypes_ptr = + _lookup>('clang_equalTypes'); + late final _dart_clang_equalTypes _clang_equalTypes = + _clang_equalTypes_ptr.asFunction<_dart_clang_equalTypes>(); /// Return the canonical type for a CXType. CXType clang_getCanonicalType( CXType T, ) { - return (_clang_getCanonicalType ??= - _lookup>( - 'clang_getCanonicalType') - .asFunction<_dart_clang_getCanonicalType>())( + return _clang_getCanonicalType( T, ); } - _dart_clang_getCanonicalType? _clang_getCanonicalType; + late final _clang_getCanonicalType_ptr = + _lookup>( + 'clang_getCanonicalType'); + late final _dart_clang_getCanonicalType _clang_getCanonicalType = + _clang_getCanonicalType_ptr.asFunction<_dart_clang_getCanonicalType>(); /// 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 ??= - _lookup>( - 'clang_isConstQualifiedType') - .asFunction<_dart_clang_isConstQualifiedType>())( + return _clang_isConstQualifiedType( T, ); } - _dart_clang_isConstQualifiedType? _clang_isConstQualifiedType; + late final _clang_isConstQualifiedType_ptr = + _lookup>( + 'clang_isConstQualifiedType'); + late final _dart_clang_isConstQualifiedType _clang_isConstQualifiedType = + _clang_isConstQualifiedType_ptr + .asFunction<_dart_clang_isConstQualifiedType>(); /// Determine whether a CXCursor that is a macro, is function like. int clang_Cursor_isMacroFunctionLike( CXCursor C, ) { - return (_clang_Cursor_isMacroFunctionLike ??= - _lookup>( - 'clang_Cursor_isMacroFunctionLike') - .asFunction<_dart_clang_Cursor_isMacroFunctionLike>())( + return _clang_Cursor_isMacroFunctionLike( C, ); } - _dart_clang_Cursor_isMacroFunctionLike? _clang_Cursor_isMacroFunctionLike; + late final _clang_Cursor_isMacroFunctionLike_ptr = + _lookup>( + 'clang_Cursor_isMacroFunctionLike'); + late final _dart_clang_Cursor_isMacroFunctionLike + _clang_Cursor_isMacroFunctionLike = _clang_Cursor_isMacroFunctionLike_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_Cursor_isMacroBuiltin') - .asFunction<_dart_clang_Cursor_isMacroBuiltin>())( + return _clang_Cursor_isMacroBuiltin( C, ); } - _dart_clang_Cursor_isMacroBuiltin? _clang_Cursor_isMacroBuiltin; + late final _clang_Cursor_isMacroBuiltin_ptr = + _lookup>( + 'clang_Cursor_isMacroBuiltin'); + late final _dart_clang_Cursor_isMacroBuiltin _clang_Cursor_isMacroBuiltin = + _clang_Cursor_isMacroBuiltin_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_Cursor_isFunctionInlined') - .asFunction<_dart_clang_Cursor_isFunctionInlined>())( + return _clang_Cursor_isFunctionInlined( C, ); } - _dart_clang_Cursor_isFunctionInlined? _clang_Cursor_isFunctionInlined; + late final _clang_Cursor_isFunctionInlined_ptr = + _lookup>( + 'clang_Cursor_isFunctionInlined'); + late final _dart_clang_Cursor_isFunctionInlined + _clang_Cursor_isFunctionInlined = _clang_Cursor_isFunctionInlined_ptr + .asFunction<_dart_clang_Cursor_isFunctionInlined>(); /// Determine whether a CXType has the "volatile" qualifier set, without /// looking through typedefs that may have added "volatile" at a different @@ -2344,15 +2583,17 @@ class LibClang { int clang_isVolatileQualifiedType( CXType T, ) { - return (_clang_isVolatileQualifiedType ??= - _lookup>( - 'clang_isVolatileQualifiedType') - .asFunction<_dart_clang_isVolatileQualifiedType>())( + return _clang_isVolatileQualifiedType( T, ); } - _dart_clang_isVolatileQualifiedType? _clang_isVolatileQualifiedType; + late final _clang_isVolatileQualifiedType_ptr = + _lookup>( + 'clang_isVolatileQualifiedType'); + late final _dart_clang_isVolatileQualifiedType + _clang_isVolatileQualifiedType = _clang_isVolatileQualifiedType_ptr + .asFunction<_dart_clang_isVolatileQualifiedType>(); /// Determine whether a CXType has the "restrict" qualifier set, without /// looking through typedefs that may have added "restrict" at a different @@ -2360,459 +2601,510 @@ class LibClang { int clang_isRestrictQualifiedType( CXType T, ) { - return (_clang_isRestrictQualifiedType ??= - _lookup>( - 'clang_isRestrictQualifiedType') - .asFunction<_dart_clang_isRestrictQualifiedType>())( + return _clang_isRestrictQualifiedType( T, ); } - _dart_clang_isRestrictQualifiedType? _clang_isRestrictQualifiedType; + late final _clang_isRestrictQualifiedType_ptr = + _lookup>( + 'clang_isRestrictQualifiedType'); + late final _dart_clang_isRestrictQualifiedType + _clang_isRestrictQualifiedType = _clang_isRestrictQualifiedType_ptr + .asFunction<_dart_clang_isRestrictQualifiedType>(); /// Returns the address space of the given type. int clang_getAddressSpace( CXType T, ) { - return (_clang_getAddressSpace ??= - _lookup>( - 'clang_getAddressSpace') - .asFunction<_dart_clang_getAddressSpace>())( + return _clang_getAddressSpace( T, ); } - _dart_clang_getAddressSpace? _clang_getAddressSpace; + late final _clang_getAddressSpace_ptr = + _lookup>( + 'clang_getAddressSpace'); + late final _dart_clang_getAddressSpace _clang_getAddressSpace = + _clang_getAddressSpace_ptr.asFunction<_dart_clang_getAddressSpace>(); /// Returns the typedef name of the given type. CXString clang_getTypedefName( CXType CT, ) { - return (_clang_getTypedefName ??= - _lookup>( - 'clang_getTypedefName') - .asFunction<_dart_clang_getTypedefName>())( + return _clang_getTypedefName( CT, ); } - _dart_clang_getTypedefName? _clang_getTypedefName; + late final _clang_getTypedefName_ptr = + _lookup>( + 'clang_getTypedefName'); + late final _dart_clang_getTypedefName _clang_getTypedefName = + _clang_getTypedefName_ptr.asFunction<_dart_clang_getTypedefName>(); /// For pointer types, returns the type of the pointee. CXType clang_getPointeeType( CXType T, ) { - return (_clang_getPointeeType ??= - _lookup>( - 'clang_getPointeeType') - .asFunction<_dart_clang_getPointeeType>())( + return _clang_getPointeeType( T, ); } - _dart_clang_getPointeeType? _clang_getPointeeType; + late final _clang_getPointeeType_ptr = + _lookup>( + 'clang_getPointeeType'); + late final _dart_clang_getPointeeType _clang_getPointeeType = + _clang_getPointeeType_ptr.asFunction<_dart_clang_getPointeeType>(); /// Return the cursor for the declaration of the given type. CXCursor clang_getTypeDeclaration( CXType T, ) { - return (_clang_getTypeDeclaration ??= - _lookup>( - 'clang_getTypeDeclaration') - .asFunction<_dart_clang_getTypeDeclaration>())( + return _clang_getTypeDeclaration( T, ); } - _dart_clang_getTypeDeclaration? _clang_getTypeDeclaration; + late final _clang_getTypeDeclaration_ptr = + _lookup>( + 'clang_getTypeDeclaration'); + late final _dart_clang_getTypeDeclaration _clang_getTypeDeclaration = + _clang_getTypeDeclaration_ptr + .asFunction<_dart_clang_getTypeDeclaration>(); /// Returns the Objective-C type encoding for the specified declaration. CXString clang_getDeclObjCTypeEncoding( CXCursor C, ) { - return (_clang_getDeclObjCTypeEncoding ??= - _lookup>( - 'clang_getDeclObjCTypeEncoding') - .asFunction<_dart_clang_getDeclObjCTypeEncoding>())( + return _clang_getDeclObjCTypeEncoding( C, ); } - _dart_clang_getDeclObjCTypeEncoding? _clang_getDeclObjCTypeEncoding; + late final _clang_getDeclObjCTypeEncoding_ptr = + _lookup>( + 'clang_getDeclObjCTypeEncoding'); + late final _dart_clang_getDeclObjCTypeEncoding + _clang_getDeclObjCTypeEncoding = _clang_getDeclObjCTypeEncoding_ptr + .asFunction<_dart_clang_getDeclObjCTypeEncoding>(); /// Returns the Objective-C type encoding for the specified CXType. CXString clang_Type_getObjCEncoding( CXType type, ) { - return (_clang_Type_getObjCEncoding ??= - _lookup>( - 'clang_Type_getObjCEncoding') - .asFunction<_dart_clang_Type_getObjCEncoding>())( + return _clang_Type_getObjCEncoding( type, ); } - _dart_clang_Type_getObjCEncoding? _clang_Type_getObjCEncoding; + late final _clang_Type_getObjCEncoding_ptr = + _lookup>( + 'clang_Type_getObjCEncoding'); + late final _dart_clang_Type_getObjCEncoding _clang_Type_getObjCEncoding = + _clang_Type_getObjCEncoding_ptr + .asFunction<_dart_clang_Type_getObjCEncoding>(); /// Retrieve the spelling of a given CXTypeKind. CXString clang_getTypeKindSpelling( int K, ) { - return (_clang_getTypeKindSpelling ??= - _lookup>( - 'clang_getTypeKindSpelling') - .asFunction<_dart_clang_getTypeKindSpelling>())( + return _clang_getTypeKindSpelling( K, ); } - _dart_clang_getTypeKindSpelling? _clang_getTypeKindSpelling; + late final _clang_getTypeKindSpelling_ptr = + _lookup>( + 'clang_getTypeKindSpelling'); + late final _dart_clang_getTypeKindSpelling _clang_getTypeKindSpelling = + _clang_getTypeKindSpelling_ptr + .asFunction<_dart_clang_getTypeKindSpelling>(); /// Retrieve the calling convention associated with a function type. int clang_getFunctionTypeCallingConv( CXType T, ) { - return (_clang_getFunctionTypeCallingConv ??= - _lookup>( - 'clang_getFunctionTypeCallingConv') - .asFunction<_dart_clang_getFunctionTypeCallingConv>())( + return _clang_getFunctionTypeCallingConv( T, ); } - _dart_clang_getFunctionTypeCallingConv? _clang_getFunctionTypeCallingConv; + late final _clang_getFunctionTypeCallingConv_ptr = + _lookup>( + 'clang_getFunctionTypeCallingConv'); + late final _dart_clang_getFunctionTypeCallingConv + _clang_getFunctionTypeCallingConv = _clang_getFunctionTypeCallingConv_ptr + .asFunction<_dart_clang_getFunctionTypeCallingConv>(); /// Retrieve the return type associated with a function type. CXType clang_getResultType( CXType T, ) { - return (_clang_getResultType ??= - _lookup>( - 'clang_getResultType') - .asFunction<_dart_clang_getResultType>())( + return _clang_getResultType( T, ); } - _dart_clang_getResultType? _clang_getResultType; + late final _clang_getResultType_ptr = + _lookup>( + 'clang_getResultType'); + late final _dart_clang_getResultType _clang_getResultType = + _clang_getResultType_ptr.asFunction<_dart_clang_getResultType>(); /// 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_getExceptionSpecificationType ??= - _lookup>( - 'clang_getExceptionSpecificationType') - .asFunction<_dart_clang_getExceptionSpecificationType>())( + return _clang_getExceptionSpecificationType( T, ); } - _dart_clang_getExceptionSpecificationType? - _clang_getExceptionSpecificationType; + late final _clang_getExceptionSpecificationType_ptr = + _lookup>( + 'clang_getExceptionSpecificationType'); + late final _dart_clang_getExceptionSpecificationType + _clang_getExceptionSpecificationType = + _clang_getExceptionSpecificationType_ptr + .asFunction<_dart_clang_getExceptionSpecificationType>(); /// Retrieve the number of non-variadic parameters associated with a function /// type. int clang_getNumArgTypes( CXType T, ) { - return (_clang_getNumArgTypes ??= - _lookup>( - 'clang_getNumArgTypes') - .asFunction<_dart_clang_getNumArgTypes>())( + return _clang_getNumArgTypes( T, ); } - _dart_clang_getNumArgTypes? _clang_getNumArgTypes; + late final _clang_getNumArgTypes_ptr = + _lookup>( + 'clang_getNumArgTypes'); + late final _dart_clang_getNumArgTypes _clang_getNumArgTypes = + _clang_getNumArgTypes_ptr.asFunction<_dart_clang_getNumArgTypes>(); /// Retrieve the type of a parameter of a function type. CXType clang_getArgType( CXType T, int i, ) { - return (_clang_getArgType ??= - _lookup>('clang_getArgType') - .asFunction<_dart_clang_getArgType>())( + return _clang_getArgType( T, i, ); } - _dart_clang_getArgType? _clang_getArgType; + late final _clang_getArgType_ptr = + _lookup>('clang_getArgType'); + late final _dart_clang_getArgType _clang_getArgType = + _clang_getArgType_ptr.asFunction<_dart_clang_getArgType>(); /// Retrieves the base type of the ObjCObjectType. CXType clang_Type_getObjCObjectBaseType( CXType T, ) { - return (_clang_Type_getObjCObjectBaseType ??= - _lookup>( - 'clang_Type_getObjCObjectBaseType') - .asFunction<_dart_clang_Type_getObjCObjectBaseType>())( + return _clang_Type_getObjCObjectBaseType( T, ); } - _dart_clang_Type_getObjCObjectBaseType? _clang_Type_getObjCObjectBaseType; + late final _clang_Type_getObjCObjectBaseType_ptr = + _lookup>( + 'clang_Type_getObjCObjectBaseType'); + late final _dart_clang_Type_getObjCObjectBaseType + _clang_Type_getObjCObjectBaseType = _clang_Type_getObjCObjectBaseType_ptr + .asFunction<_dart_clang_Type_getObjCObjectBaseType>(); /// Retrieve the number of protocol references associated with an ObjC /// object/id. int clang_Type_getNumObjCProtocolRefs( CXType T, ) { - return (_clang_Type_getNumObjCProtocolRefs ??= - _lookup>( - 'clang_Type_getNumObjCProtocolRefs') - .asFunction<_dart_clang_Type_getNumObjCProtocolRefs>())( + return _clang_Type_getNumObjCProtocolRefs( T, ); } - _dart_clang_Type_getNumObjCProtocolRefs? _clang_Type_getNumObjCProtocolRefs; + late final _clang_Type_getNumObjCProtocolRefs_ptr = + _lookup>( + 'clang_Type_getNumObjCProtocolRefs'); + late final _dart_clang_Type_getNumObjCProtocolRefs + _clang_Type_getNumObjCProtocolRefs = + _clang_Type_getNumObjCProtocolRefs_ptr + .asFunction<_dart_clang_Type_getNumObjCProtocolRefs>(); /// Retrieve the decl for a protocol reference for an ObjC object/id. CXCursor clang_Type_getObjCProtocolDecl( CXType T, int i, ) { - return (_clang_Type_getObjCProtocolDecl ??= - _lookup>( - 'clang_Type_getObjCProtocolDecl') - .asFunction<_dart_clang_Type_getObjCProtocolDecl>())( + return _clang_Type_getObjCProtocolDecl( T, i, ); } - _dart_clang_Type_getObjCProtocolDecl? _clang_Type_getObjCProtocolDecl; + late final _clang_Type_getObjCProtocolDecl_ptr = + _lookup>( + 'clang_Type_getObjCProtocolDecl'); + late final _dart_clang_Type_getObjCProtocolDecl + _clang_Type_getObjCProtocolDecl = _clang_Type_getObjCProtocolDecl_ptr + .asFunction<_dart_clang_Type_getObjCProtocolDecl>(); /// Retreive the number of type arguments associated with an ObjC object. int clang_Type_getNumObjCTypeArgs( CXType T, ) { - return (_clang_Type_getNumObjCTypeArgs ??= - _lookup>( - 'clang_Type_getNumObjCTypeArgs') - .asFunction<_dart_clang_Type_getNumObjCTypeArgs>())( + return _clang_Type_getNumObjCTypeArgs( T, ); } - _dart_clang_Type_getNumObjCTypeArgs? _clang_Type_getNumObjCTypeArgs; + late final _clang_Type_getNumObjCTypeArgs_ptr = + _lookup>( + 'clang_Type_getNumObjCTypeArgs'); + late final _dart_clang_Type_getNumObjCTypeArgs + _clang_Type_getNumObjCTypeArgs = _clang_Type_getNumObjCTypeArgs_ptr + .asFunction<_dart_clang_Type_getNumObjCTypeArgs>(); /// Retrieve a type argument associated with an ObjC object. CXType clang_Type_getObjCTypeArg( CXType T, int i, ) { - return (_clang_Type_getObjCTypeArg ??= - _lookup>( - 'clang_Type_getObjCTypeArg') - .asFunction<_dart_clang_Type_getObjCTypeArg>())( + return _clang_Type_getObjCTypeArg( T, i, ); } - _dart_clang_Type_getObjCTypeArg? _clang_Type_getObjCTypeArg; + late final _clang_Type_getObjCTypeArg_ptr = + _lookup>( + 'clang_Type_getObjCTypeArg'); + late final _dart_clang_Type_getObjCTypeArg _clang_Type_getObjCTypeArg = + _clang_Type_getObjCTypeArg_ptr + .asFunction<_dart_clang_Type_getObjCTypeArg>(); /// Return 1 if the CXType is a variadic function type, and 0 otherwise. int clang_isFunctionTypeVariadic( CXType T, ) { - return (_clang_isFunctionTypeVariadic ??= - _lookup>( - 'clang_isFunctionTypeVariadic') - .asFunction<_dart_clang_isFunctionTypeVariadic>())( + return _clang_isFunctionTypeVariadic( T, ); } - _dart_clang_isFunctionTypeVariadic? _clang_isFunctionTypeVariadic; + late final _clang_isFunctionTypeVariadic_ptr = + _lookup>( + 'clang_isFunctionTypeVariadic'); + late final _dart_clang_isFunctionTypeVariadic _clang_isFunctionTypeVariadic = + _clang_isFunctionTypeVariadic_ptr + .asFunction<_dart_clang_isFunctionTypeVariadic>(); /// Retrieve the return type associated with a given cursor. CXType clang_getCursorResultType( CXCursor C, ) { - return (_clang_getCursorResultType ??= - _lookup>( - 'clang_getCursorResultType') - .asFunction<_dart_clang_getCursorResultType>())( + return _clang_getCursorResultType( C, ); } - _dart_clang_getCursorResultType? _clang_getCursorResultType; + late final _clang_getCursorResultType_ptr = + _lookup>( + 'clang_getCursorResultType'); + late final _dart_clang_getCursorResultType _clang_getCursorResultType = + _clang_getCursorResultType_ptr + .asFunction<_dart_clang_getCursorResultType>(); /// 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_getCursorExceptionSpecificationType ??= _lookup< - ffi.NativeFunction< - _c_clang_getCursorExceptionSpecificationType>>( - 'clang_getCursorExceptionSpecificationType') - .asFunction<_dart_clang_getCursorExceptionSpecificationType>())( + return _clang_getCursorExceptionSpecificationType( C, ); } - _dart_clang_getCursorExceptionSpecificationType? - _clang_getCursorExceptionSpecificationType; + late final _clang_getCursorExceptionSpecificationType_ptr = + _lookup>( + 'clang_getCursorExceptionSpecificationType'); + late final _dart_clang_getCursorExceptionSpecificationType + _clang_getCursorExceptionSpecificationType = + _clang_getCursorExceptionSpecificationType_ptr + .asFunction<_dart_clang_getCursorExceptionSpecificationType>(); /// Return 1 if the CXType is a POD (plain old data) type, and 0 otherwise. int clang_isPODType( CXType T, ) { - return (_clang_isPODType ??= - _lookup>('clang_isPODType') - .asFunction<_dart_clang_isPODType>())( + return _clang_isPODType( T, ); } - _dart_clang_isPODType? _clang_isPODType; + late final _clang_isPODType_ptr = + _lookup>('clang_isPODType'); + late final _dart_clang_isPODType _clang_isPODType = + _clang_isPODType_ptr.asFunction<_dart_clang_isPODType>(); /// Return the element type of an array, complex, or vector type. CXType clang_getElementType( CXType T, ) { - return (_clang_getElementType ??= - _lookup>( - 'clang_getElementType') - .asFunction<_dart_clang_getElementType>())( + return _clang_getElementType( T, ); } - _dart_clang_getElementType? _clang_getElementType; + late final _clang_getElementType_ptr = + _lookup>( + 'clang_getElementType'); + late final _dart_clang_getElementType _clang_getElementType = + _clang_getElementType_ptr.asFunction<_dart_clang_getElementType>(); /// Return the number of elements of an array or vector type. int clang_getNumElements( CXType T, ) { - return (_clang_getNumElements ??= - _lookup>( - 'clang_getNumElements') - .asFunction<_dart_clang_getNumElements>())( + return _clang_getNumElements( T, ); } - _dart_clang_getNumElements? _clang_getNumElements; + late final _clang_getNumElements_ptr = + _lookup>( + 'clang_getNumElements'); + late final _dart_clang_getNumElements _clang_getNumElements = + _clang_getNumElements_ptr.asFunction<_dart_clang_getNumElements>(); /// Return the element type of an array type. CXType clang_getArrayElementType( CXType T, ) { - return (_clang_getArrayElementType ??= - _lookup>( - 'clang_getArrayElementType') - .asFunction<_dart_clang_getArrayElementType>())( + return _clang_getArrayElementType( T, ); } - _dart_clang_getArrayElementType? _clang_getArrayElementType; + late final _clang_getArrayElementType_ptr = + _lookup>( + 'clang_getArrayElementType'); + late final _dart_clang_getArrayElementType _clang_getArrayElementType = + _clang_getArrayElementType_ptr + .asFunction<_dart_clang_getArrayElementType>(); /// Return the array size of a constant array. int clang_getArraySize( CXType T, ) { - return (_clang_getArraySize ??= - _lookup>('clang_getArraySize') - .asFunction<_dart_clang_getArraySize>())( + return _clang_getArraySize( T, ); } - _dart_clang_getArraySize? _clang_getArraySize; + late final _clang_getArraySize_ptr = + _lookup>('clang_getArraySize'); + late final _dart_clang_getArraySize _clang_getArraySize = + _clang_getArraySize_ptr.asFunction<_dart_clang_getArraySize>(); /// Retrieve the type named by the qualified-id. CXType clang_Type_getNamedType( CXType T, ) { - return (_clang_Type_getNamedType ??= - _lookup>( - 'clang_Type_getNamedType') - .asFunction<_dart_clang_Type_getNamedType>())( + return _clang_Type_getNamedType( T, ); } - _dart_clang_Type_getNamedType? _clang_Type_getNamedType; + late final _clang_Type_getNamedType_ptr = + _lookup>( + 'clang_Type_getNamedType'); + late final _dart_clang_Type_getNamedType _clang_Type_getNamedType = + _clang_Type_getNamedType_ptr.asFunction<_dart_clang_Type_getNamedType>(); /// Determine if a typedef is 'transparent' tag. int clang_Type_isTransparentTagTypedef( CXType T, ) { - return (_clang_Type_isTransparentTagTypedef ??= - _lookup>( - 'clang_Type_isTransparentTagTypedef') - .asFunction<_dart_clang_Type_isTransparentTagTypedef>())( + return _clang_Type_isTransparentTagTypedef( T, ); } - _dart_clang_Type_isTransparentTagTypedef? _clang_Type_isTransparentTagTypedef; + late final _clang_Type_isTransparentTagTypedef_ptr = + _lookup>( + 'clang_Type_isTransparentTagTypedef'); + late final _dart_clang_Type_isTransparentTagTypedef + _clang_Type_isTransparentTagTypedef = + _clang_Type_isTransparentTagTypedef_ptr + .asFunction<_dart_clang_Type_isTransparentTagTypedef>(); /// Retrieve the nullability kind of a pointer type. int clang_Type_getNullability( CXType T, ) { - return (_clang_Type_getNullability ??= - _lookup>( - 'clang_Type_getNullability') - .asFunction<_dart_clang_Type_getNullability>())( + return _clang_Type_getNullability( T, ); } - _dart_clang_Type_getNullability? _clang_Type_getNullability; + late final _clang_Type_getNullability_ptr = + _lookup>( + 'clang_Type_getNullability'); + late final _dart_clang_Type_getNullability _clang_Type_getNullability = + _clang_Type_getNullability_ptr + .asFunction<_dart_clang_Type_getNullability>(); /// Return the alignment of a type in bytes as per C++[expr.alignof] standard. int clang_Type_getAlignOf( CXType T, ) { - return (_clang_Type_getAlignOf ??= - _lookup>( - 'clang_Type_getAlignOf') - .asFunction<_dart_clang_Type_getAlignOf>())( + return _clang_Type_getAlignOf( T, ); } - _dart_clang_Type_getAlignOf? _clang_Type_getAlignOf; + late final _clang_Type_getAlignOf_ptr = + _lookup>( + 'clang_Type_getAlignOf'); + late final _dart_clang_Type_getAlignOf _clang_Type_getAlignOf = + _clang_Type_getAlignOf_ptr.asFunction<_dart_clang_Type_getAlignOf>(); /// Return the class type of an member pointer type. CXType clang_Type_getClassType( CXType T, ) { - return (_clang_Type_getClassType ??= - _lookup>( - 'clang_Type_getClassType') - .asFunction<_dart_clang_Type_getClassType>())( + return _clang_Type_getClassType( T, ); } - _dart_clang_Type_getClassType? _clang_Type_getClassType; + late final _clang_Type_getClassType_ptr = + _lookup>( + 'clang_Type_getClassType'); + late final _dart_clang_Type_getClassType _clang_Type_getClassType = + _clang_Type_getClassType_ptr.asFunction<_dart_clang_Type_getClassType>(); /// Return the size of a type in bytes as per C++[expr.sizeof] standard. int clang_Type_getSizeOf( CXType T, ) { - return (_clang_Type_getSizeOf ??= - _lookup>( - 'clang_Type_getSizeOf') - .asFunction<_dart_clang_Type_getSizeOf>())( + return _clang_Type_getSizeOf( T, ); } - _dart_clang_Type_getSizeOf? _clang_Type_getSizeOf; + late final _clang_Type_getSizeOf_ptr = + _lookup>( + 'clang_Type_getSizeOf'); + late final _dart_clang_Type_getSizeOf _clang_Type_getSizeOf = + _clang_Type_getSizeOf_ptr.asFunction<_dart_clang_Type_getSizeOf>(); /// 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] @@ -2820,104 +3112,119 @@ class LibClang { CXType T, ffi.Pointer S, ) { - return (_clang_Type_getOffsetOf ??= - _lookup>( - 'clang_Type_getOffsetOf') - .asFunction<_dart_clang_Type_getOffsetOf>())( + return _clang_Type_getOffsetOf( T, S, ); } - _dart_clang_Type_getOffsetOf? _clang_Type_getOffsetOf; + late final _clang_Type_getOffsetOf_ptr = + _lookup>( + 'clang_Type_getOffsetOf'); + late final _dart_clang_Type_getOffsetOf _clang_Type_getOffsetOf = + _clang_Type_getOffsetOf_ptr.asFunction<_dart_clang_Type_getOffsetOf>(); /// Return the type that was modified by this attributed type. CXType clang_Type_getModifiedType( CXType T, ) { - return (_clang_Type_getModifiedType ??= - _lookup>( - 'clang_Type_getModifiedType') - .asFunction<_dart_clang_Type_getModifiedType>())( + return _clang_Type_getModifiedType( T, ); } - _dart_clang_Type_getModifiedType? _clang_Type_getModifiedType; + late final _clang_Type_getModifiedType_ptr = + _lookup>( + 'clang_Type_getModifiedType'); + late final _dart_clang_Type_getModifiedType _clang_Type_getModifiedType = + _clang_Type_getModifiedType_ptr + .asFunction<_dart_clang_Type_getModifiedType>(); /// Return the offset of the field represented by the Cursor. int clang_Cursor_getOffsetOfField( CXCursor C, ) { - return (_clang_Cursor_getOffsetOfField ??= - _lookup>( - 'clang_Cursor_getOffsetOfField') - .asFunction<_dart_clang_Cursor_getOffsetOfField>())( + return _clang_Cursor_getOffsetOfField( C, ); } - _dart_clang_Cursor_getOffsetOfField? _clang_Cursor_getOffsetOfField; + late final _clang_Cursor_getOffsetOfField_ptr = + _lookup>( + 'clang_Cursor_getOffsetOfField'); + late final _dart_clang_Cursor_getOffsetOfField + _clang_Cursor_getOffsetOfField = _clang_Cursor_getOffsetOfField_ptr + .asFunction<_dart_clang_Cursor_getOffsetOfField>(); /// Determine whether the given cursor represents an anonymous tag or /// namespace int clang_Cursor_isAnonymous( CXCursor C, ) { - return (_clang_Cursor_isAnonymous ??= - _lookup>( - 'clang_Cursor_isAnonymous') - .asFunction<_dart_clang_Cursor_isAnonymous>())( + return _clang_Cursor_isAnonymous( C, ); } - _dart_clang_Cursor_isAnonymous? _clang_Cursor_isAnonymous; + late final _clang_Cursor_isAnonymous_ptr = + _lookup>( + 'clang_Cursor_isAnonymous'); + late final _dart_clang_Cursor_isAnonymous _clang_Cursor_isAnonymous = + _clang_Cursor_isAnonymous_ptr + .asFunction<_dart_clang_Cursor_isAnonymous>(); /// Determine whether the given cursor represents an anonymous record /// declaration. int clang_Cursor_isAnonymousRecordDecl( CXCursor C, ) { - return (_clang_Cursor_isAnonymousRecordDecl ??= - _lookup>( - 'clang_Cursor_isAnonymousRecordDecl') - .asFunction<_dart_clang_Cursor_isAnonymousRecordDecl>())( + return _clang_Cursor_isAnonymousRecordDecl( C, ); } - _dart_clang_Cursor_isAnonymousRecordDecl? _clang_Cursor_isAnonymousRecordDecl; + late final _clang_Cursor_isAnonymousRecordDecl_ptr = + _lookup>( + 'clang_Cursor_isAnonymousRecordDecl'); + late final _dart_clang_Cursor_isAnonymousRecordDecl + _clang_Cursor_isAnonymousRecordDecl = + _clang_Cursor_isAnonymousRecordDecl_ptr + .asFunction<_dart_clang_Cursor_isAnonymousRecordDecl>(); /// Determine whether the given cursor represents an inline namespace /// declaration. int clang_Cursor_isInlineNamespace( CXCursor C, ) { - return (_clang_Cursor_isInlineNamespace ??= - _lookup>( - 'clang_Cursor_isInlineNamespace') - .asFunction<_dart_clang_Cursor_isInlineNamespace>())( + return _clang_Cursor_isInlineNamespace( C, ); } - _dart_clang_Cursor_isInlineNamespace? _clang_Cursor_isInlineNamespace; + late final _clang_Cursor_isInlineNamespace_ptr = + _lookup>( + 'clang_Cursor_isInlineNamespace'); + late final _dart_clang_Cursor_isInlineNamespace + _clang_Cursor_isInlineNamespace = _clang_Cursor_isInlineNamespace_ptr + .asFunction<_dart_clang_Cursor_isInlineNamespace>(); /// 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 ??= - _lookup>( - 'clang_Type_getNumTemplateArguments') - .asFunction<_dart_clang_Type_getNumTemplateArguments>())( + return _clang_Type_getNumTemplateArguments( T, ); } - _dart_clang_Type_getNumTemplateArguments? _clang_Type_getNumTemplateArguments; + late final _clang_Type_getNumTemplateArguments_ptr = + _lookup>( + 'clang_Type_getNumTemplateArguments'); + late final _dart_clang_Type_getNumTemplateArguments + _clang_Type_getNumTemplateArguments = + _clang_Type_getNumTemplateArguments_ptr + .asFunction<_dart_clang_Type_getNumTemplateArguments>(); /// Returns the type template argument of a template class specialization at /// given index. @@ -2925,104 +3232,116 @@ class LibClang { CXType T, int i, ) { - return (_clang_Type_getTemplateArgumentAsType ??= - _lookup>( - 'clang_Type_getTemplateArgumentAsType') - .asFunction<_dart_clang_Type_getTemplateArgumentAsType>())( + return _clang_Type_getTemplateArgumentAsType( T, i, ); } - _dart_clang_Type_getTemplateArgumentAsType? - _clang_Type_getTemplateArgumentAsType; + late final _clang_Type_getTemplateArgumentAsType_ptr = + _lookup>( + 'clang_Type_getTemplateArgumentAsType'); + late final _dart_clang_Type_getTemplateArgumentAsType + _clang_Type_getTemplateArgumentAsType = + _clang_Type_getTemplateArgumentAsType_ptr + .asFunction<_dart_clang_Type_getTemplateArgumentAsType>(); /// Retrieve the ref-qualifier kind of a function or method. int clang_Type_getCXXRefQualifier( CXType T, ) { - return (_clang_Type_getCXXRefQualifier ??= - _lookup>( - 'clang_Type_getCXXRefQualifier') - .asFunction<_dart_clang_Type_getCXXRefQualifier>())( + return _clang_Type_getCXXRefQualifier( T, ); } - _dart_clang_Type_getCXXRefQualifier? _clang_Type_getCXXRefQualifier; + late final _clang_Type_getCXXRefQualifier_ptr = + _lookup>( + 'clang_Type_getCXXRefQualifier'); + late final _dart_clang_Type_getCXXRefQualifier + _clang_Type_getCXXRefQualifier = _clang_Type_getCXXRefQualifier_ptr + .asFunction<_dart_clang_Type_getCXXRefQualifier>(); /// Returns non-zero if the cursor specifies a Record member that is a /// bitfield. int clang_Cursor_isBitField( CXCursor C, ) { - return (_clang_Cursor_isBitField ??= - _lookup>( - 'clang_Cursor_isBitField') - .asFunction<_dart_clang_Cursor_isBitField>())( + return _clang_Cursor_isBitField( C, ); } - _dart_clang_Cursor_isBitField? _clang_Cursor_isBitField; + late final _clang_Cursor_isBitField_ptr = + _lookup>( + 'clang_Cursor_isBitField'); + late final _dart_clang_Cursor_isBitField _clang_Cursor_isBitField = + _clang_Cursor_isBitField_ptr.asFunction<_dart_clang_Cursor_isBitField>(); /// Returns 1 if the base class specified by the cursor with kind /// CX_CXXBaseSpecifier is virtual. int clang_isVirtualBase( CXCursor arg0, ) { - return (_clang_isVirtualBase ??= - _lookup>( - 'clang_isVirtualBase') - .asFunction<_dart_clang_isVirtualBase>())( + return _clang_isVirtualBase( arg0, ); } - _dart_clang_isVirtualBase? _clang_isVirtualBase; + late final _clang_isVirtualBase_ptr = + _lookup>( + 'clang_isVirtualBase'); + late final _dart_clang_isVirtualBase _clang_isVirtualBase = + _clang_isVirtualBase_ptr.asFunction<_dart_clang_isVirtualBase>(); /// Returns the access control level for the referenced object. int clang_getCXXAccessSpecifier( CXCursor arg0, ) { - return (_clang_getCXXAccessSpecifier ??= - _lookup>( - 'clang_getCXXAccessSpecifier') - .asFunction<_dart_clang_getCXXAccessSpecifier>())( + return _clang_getCXXAccessSpecifier( arg0, ); } - _dart_clang_getCXXAccessSpecifier? _clang_getCXXAccessSpecifier; + late final _clang_getCXXAccessSpecifier_ptr = + _lookup>( + 'clang_getCXXAccessSpecifier'); + late final _dart_clang_getCXXAccessSpecifier _clang_getCXXAccessSpecifier = + _clang_getCXXAccessSpecifier_ptr + .asFunction<_dart_clang_getCXXAccessSpecifier>(); /// Returns the storage class for a function or variable declaration. int clang_Cursor_getStorageClass( CXCursor arg0, ) { - return (_clang_Cursor_getStorageClass ??= - _lookup>( - 'clang_Cursor_getStorageClass') - .asFunction<_dart_clang_Cursor_getStorageClass>())( + return _clang_Cursor_getStorageClass( arg0, ); } - _dart_clang_Cursor_getStorageClass? _clang_Cursor_getStorageClass; + late final _clang_Cursor_getStorageClass_ptr = + _lookup>( + 'clang_Cursor_getStorageClass'); + late final _dart_clang_Cursor_getStorageClass _clang_Cursor_getStorageClass = + _clang_Cursor_getStorageClass_ptr + .asFunction<_dart_clang_Cursor_getStorageClass>(); /// Determine the number of overloaded declarations referenced by a /// CXCursor_OverloadedDeclRef cursor. int clang_getNumOverloadedDecls( CXCursor cursor, ) { - return (_clang_getNumOverloadedDecls ??= - _lookup>( - 'clang_getNumOverloadedDecls') - .asFunction<_dart_clang_getNumOverloadedDecls>())( + return _clang_getNumOverloadedDecls( cursor, ); } - _dart_clang_getNumOverloadedDecls? _clang_getNumOverloadedDecls; + late final _clang_getNumOverloadedDecls_ptr = + _lookup>( + 'clang_getNumOverloadedDecls'); + late final _dart_clang_getNumOverloadedDecls _clang_getNumOverloadedDecls = + _clang_getNumOverloadedDecls_ptr + .asFunction<_dart_clang_getNumOverloadedDecls>(); /// Retrieve a cursor for one of the overloaded declarations referenced by a /// CXCursor_OverloadedDeclRef cursor. @@ -3030,31 +3349,34 @@ class LibClang { CXCursor cursor, int index, ) { - return (_clang_getOverloadedDecl ??= - _lookup>( - 'clang_getOverloadedDecl') - .asFunction<_dart_clang_getOverloadedDecl>())( + return _clang_getOverloadedDecl( cursor, index, ); } - _dart_clang_getOverloadedDecl? _clang_getOverloadedDecl; + late final _clang_getOverloadedDecl_ptr = + _lookup>( + 'clang_getOverloadedDecl'); + late final _dart_clang_getOverloadedDecl _clang_getOverloadedDecl = + _clang_getOverloadedDecl_ptr.asFunction<_dart_clang_getOverloadedDecl>(); /// For cursors representing an iboutletcollection attribute, this function /// returns the collection element type. CXType clang_getIBOutletCollectionType( CXCursor arg0, ) { - return (_clang_getIBOutletCollectionType ??= - _lookup>( - 'clang_getIBOutletCollectionType') - .asFunction<_dart_clang_getIBOutletCollectionType>())( + return _clang_getIBOutletCollectionType( arg0, ); } - _dart_clang_getIBOutletCollectionType? _clang_getIBOutletCollectionType; + late final _clang_getIBOutletCollectionType_ptr = + _lookup>( + 'clang_getIBOutletCollectionType'); + late final _dart_clang_getIBOutletCollectionType + _clang_getIBOutletCollectionType = _clang_getIBOutletCollectionType_ptr + .asFunction<_dart_clang_getIBOutletCollectionType>(); /// Visit the children of a particular cursor. int clang_visitChildren( @@ -3062,75 +3384,83 @@ class LibClang { ffi.Pointer> visitor, ffi.Pointer client_data, ) { - return (_clang_visitChildren ??= - _lookup>( - 'clang_visitChildren') - .asFunction<_dart_clang_visitChildren>())( + return _clang_visitChildren( parent, visitor, client_data, ); } - _dart_clang_visitChildren? _clang_visitChildren; + late final _clang_visitChildren_ptr = + _lookup>( + 'clang_visitChildren'); + late final _dart_clang_visitChildren _clang_visitChildren = + _clang_visitChildren_ptr.asFunction<_dart_clang_visitChildren>(); /// Retrieve a Unified Symbol Resolution (USR) for the entity referenced by /// the given cursor. CXString clang_getCursorUSR( CXCursor arg0, ) { - return (_clang_getCursorUSR ??= - _lookup>('clang_getCursorUSR') - .asFunction<_dart_clang_getCursorUSR>())( + return _clang_getCursorUSR( arg0, ); } - _dart_clang_getCursorUSR? _clang_getCursorUSR; + late final _clang_getCursorUSR_ptr = + _lookup>('clang_getCursorUSR'); + late final _dart_clang_getCursorUSR _clang_getCursorUSR = + _clang_getCursorUSR_ptr.asFunction<_dart_clang_getCursorUSR>(); /// Construct a USR for a specified Objective-C class. CXString clang_constructUSR_ObjCClass( ffi.Pointer class_name, ) { - return (_clang_constructUSR_ObjCClass ??= - _lookup>( - 'clang_constructUSR_ObjCClass') - .asFunction<_dart_clang_constructUSR_ObjCClass>())( + return _clang_constructUSR_ObjCClass( class_name, ); } - _dart_clang_constructUSR_ObjCClass? _clang_constructUSR_ObjCClass; + late final _clang_constructUSR_ObjCClass_ptr = + _lookup>( + 'clang_constructUSR_ObjCClass'); + late final _dart_clang_constructUSR_ObjCClass _clang_constructUSR_ObjCClass = + _clang_constructUSR_ObjCClass_ptr + .asFunction<_dart_clang_constructUSR_ObjCClass>(); /// 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 ??= - _lookup>( - 'clang_constructUSR_ObjCCategory') - .asFunction<_dart_clang_constructUSR_ObjCCategory>())( + return _clang_constructUSR_ObjCCategory( class_name, category_name, ); } - _dart_clang_constructUSR_ObjCCategory? _clang_constructUSR_ObjCCategory; + late final _clang_constructUSR_ObjCCategory_ptr = + _lookup>( + 'clang_constructUSR_ObjCCategory'); + late final _dart_clang_constructUSR_ObjCCategory + _clang_constructUSR_ObjCCategory = _clang_constructUSR_ObjCCategory_ptr + .asFunction<_dart_clang_constructUSR_ObjCCategory>(); /// Construct a USR for a specified Objective-C protocol. CXString clang_constructUSR_ObjCProtocol( ffi.Pointer protocol_name, ) { - return (_clang_constructUSR_ObjCProtocol ??= - _lookup>( - 'clang_constructUSR_ObjCProtocol') - .asFunction<_dart_clang_constructUSR_ObjCProtocol>())( + return _clang_constructUSR_ObjCProtocol( protocol_name, ); } - _dart_clang_constructUSR_ObjCProtocol? _clang_constructUSR_ObjCProtocol; + late final _clang_constructUSR_ObjCProtocol_ptr = + _lookup>( + 'clang_constructUSR_ObjCProtocol'); + late final _dart_clang_constructUSR_ObjCProtocol + _clang_constructUSR_ObjCProtocol = _clang_constructUSR_ObjCProtocol_ptr + .asFunction<_dart_clang_constructUSR_ObjCProtocol>(); /// Construct a USR for a specified Objective-C instance variable and the USR /// for its containing class. @@ -3138,16 +3468,18 @@ class LibClang { ffi.Pointer name, CXString classUSR, ) { - return (_clang_constructUSR_ObjCIvar ??= - _lookup>( - 'clang_constructUSR_ObjCIvar') - .asFunction<_dart_clang_constructUSR_ObjCIvar>())( + return _clang_constructUSR_ObjCIvar( name, classUSR, ); } - _dart_clang_constructUSR_ObjCIvar? _clang_constructUSR_ObjCIvar; + late final _clang_constructUSR_ObjCIvar_ptr = + _lookup>( + 'clang_constructUSR_ObjCIvar'); + late final _dart_clang_constructUSR_ObjCIvar _clang_constructUSR_ObjCIvar = + _clang_constructUSR_ObjCIvar_ptr + .asFunction<_dart_clang_constructUSR_ObjCIvar>(); /// Construct a USR for a specified Objective-C method and the USR for its /// containing class. @@ -3156,17 +3488,19 @@ class LibClang { int isInstanceMethod, CXString classUSR, ) { - return (_clang_constructUSR_ObjCMethod ??= - _lookup>( - 'clang_constructUSR_ObjCMethod') - .asFunction<_dart_clang_constructUSR_ObjCMethod>())( + return _clang_constructUSR_ObjCMethod( name, isInstanceMethod, classUSR, ); } - _dart_clang_constructUSR_ObjCMethod? _clang_constructUSR_ObjCMethod; + late final _clang_constructUSR_ObjCMethod_ptr = + _lookup>( + 'clang_constructUSR_ObjCMethod'); + late final _dart_clang_constructUSR_ObjCMethod + _clang_constructUSR_ObjCMethod = _clang_constructUSR_ObjCMethod_ptr + .asFunction<_dart_clang_constructUSR_ObjCMethod>(); /// Construct a USR for a specified Objective-C property and the USR for its /// containing class. @@ -3174,30 +3508,33 @@ class LibClang { ffi.Pointer property, CXString classUSR, ) { - return (_clang_constructUSR_ObjCProperty ??= - _lookup>( - 'clang_constructUSR_ObjCProperty') - .asFunction<_dart_clang_constructUSR_ObjCProperty>())( + return _clang_constructUSR_ObjCProperty( property, classUSR, ); } - _dart_clang_constructUSR_ObjCProperty? _clang_constructUSR_ObjCProperty; + late final _clang_constructUSR_ObjCProperty_ptr = + _lookup>( + 'clang_constructUSR_ObjCProperty'); + late final _dart_clang_constructUSR_ObjCProperty + _clang_constructUSR_ObjCProperty = _clang_constructUSR_ObjCProperty_ptr + .asFunction<_dart_clang_constructUSR_ObjCProperty>(); /// Retrieve a name for the entity referenced by this cursor. CXString clang_getCursorSpelling( CXCursor arg0, ) { - return (_clang_getCursorSpelling ??= - _lookup>( - 'clang_getCursorSpelling') - .asFunction<_dart_clang_getCursorSpelling>())( + return _clang_getCursorSpelling( arg0, ); } - _dart_clang_getCursorSpelling? _clang_getCursorSpelling; + late final _clang_getCursorSpelling_ptr = + _lookup>( + 'clang_getCursorSpelling'); + late final _dart_clang_getCursorSpelling _clang_getCursorSpelling = + _clang_getCursorSpelling_ptr.asFunction<_dart_clang_getCursorSpelling>(); /// 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 @@ -3208,33 +3545,38 @@ class LibClang { int pieceIndex, int options, ) { - return (_clang_Cursor_getSpellingNameRange ??= - _lookup>( - 'clang_Cursor_getSpellingNameRange') - .asFunction<_dart_clang_Cursor_getSpellingNameRange>())( + return _clang_Cursor_getSpellingNameRange( arg0, pieceIndex, options, ); } - _dart_clang_Cursor_getSpellingNameRange? _clang_Cursor_getSpellingNameRange; + late final _clang_Cursor_getSpellingNameRange_ptr = + _lookup>( + 'clang_Cursor_getSpellingNameRange'); + late final _dart_clang_Cursor_getSpellingNameRange + _clang_Cursor_getSpellingNameRange = + _clang_Cursor_getSpellingNameRange_ptr + .asFunction<_dart_clang_Cursor_getSpellingNameRange>(); /// Get a property value for the given printing policy. int clang_PrintingPolicy_getProperty( ffi.Pointer Policy, int Property, ) { - return (_clang_PrintingPolicy_getProperty ??= - _lookup>( - 'clang_PrintingPolicy_getProperty') - .asFunction<_dart_clang_PrintingPolicy_getProperty>())( + return _clang_PrintingPolicy_getProperty( Policy, Property, ); } - _dart_clang_PrintingPolicy_getProperty? _clang_PrintingPolicy_getProperty; + late final _clang_PrintingPolicy_getProperty_ptr = + _lookup>( + 'clang_PrintingPolicy_getProperty'); + late final _dart_clang_PrintingPolicy_getProperty + _clang_PrintingPolicy_getProperty = _clang_PrintingPolicy_getProperty_ptr + .asFunction<_dart_clang_PrintingPolicy_getProperty>(); /// Set a property value for the given printing policy. void clang_PrintingPolicy_setProperty( @@ -3242,179 +3584,204 @@ class LibClang { int Property, int Value, ) { - return (_clang_PrintingPolicy_setProperty ??= - _lookup>( - 'clang_PrintingPolicy_setProperty') - .asFunction<_dart_clang_PrintingPolicy_setProperty>())( + return _clang_PrintingPolicy_setProperty( Policy, Property, Value, ); } - _dart_clang_PrintingPolicy_setProperty? _clang_PrintingPolicy_setProperty; + late final _clang_PrintingPolicy_setProperty_ptr = + _lookup>( + 'clang_PrintingPolicy_setProperty'); + late final _dart_clang_PrintingPolicy_setProperty + _clang_PrintingPolicy_setProperty = _clang_PrintingPolicy_setProperty_ptr + .asFunction<_dart_clang_PrintingPolicy_setProperty>(); /// Retrieve the default policy for the cursor. ffi.Pointer clang_getCursorPrintingPolicy( CXCursor arg0, ) { - return (_clang_getCursorPrintingPolicy ??= - _lookup>( - 'clang_getCursorPrintingPolicy') - .asFunction<_dart_clang_getCursorPrintingPolicy>())( + return _clang_getCursorPrintingPolicy( arg0, ); } - _dart_clang_getCursorPrintingPolicy? _clang_getCursorPrintingPolicy; + late final _clang_getCursorPrintingPolicy_ptr = + _lookup>( + 'clang_getCursorPrintingPolicy'); + late final _dart_clang_getCursorPrintingPolicy + _clang_getCursorPrintingPolicy = _clang_getCursorPrintingPolicy_ptr + .asFunction<_dart_clang_getCursorPrintingPolicy>(); /// Release a printing policy. void clang_PrintingPolicy_dispose( ffi.Pointer Policy, ) { - return (_clang_PrintingPolicy_dispose ??= - _lookup>( - 'clang_PrintingPolicy_dispose') - .asFunction<_dart_clang_PrintingPolicy_dispose>())( + return _clang_PrintingPolicy_dispose( Policy, ); } - _dart_clang_PrintingPolicy_dispose? _clang_PrintingPolicy_dispose; + late final _clang_PrintingPolicy_dispose_ptr = + _lookup>( + 'clang_PrintingPolicy_dispose'); + late final _dart_clang_PrintingPolicy_dispose _clang_PrintingPolicy_dispose = + _clang_PrintingPolicy_dispose_ptr + .asFunction<_dart_clang_PrintingPolicy_dispose>(); /// Pretty print declarations. CXString clang_getCursorPrettyPrinted( CXCursor Cursor, ffi.Pointer Policy, ) { - return (_clang_getCursorPrettyPrinted ??= - _lookup>( - 'clang_getCursorPrettyPrinted') - .asFunction<_dart_clang_getCursorPrettyPrinted>())( + return _clang_getCursorPrettyPrinted( Cursor, Policy, ); } - _dart_clang_getCursorPrettyPrinted? _clang_getCursorPrettyPrinted; + late final _clang_getCursorPrettyPrinted_ptr = + _lookup>( + 'clang_getCursorPrettyPrinted'); + late final _dart_clang_getCursorPrettyPrinted _clang_getCursorPrettyPrinted = + _clang_getCursorPrettyPrinted_ptr + .asFunction<_dart_clang_getCursorPrettyPrinted>(); /// Retrieve the display name for the entity referenced by this cursor. CXString clang_getCursorDisplayName( CXCursor arg0, ) { - return (_clang_getCursorDisplayName ??= - _lookup>( - 'clang_getCursorDisplayName') - .asFunction<_dart_clang_getCursorDisplayName>())( + return _clang_getCursorDisplayName( arg0, ); } - _dart_clang_getCursorDisplayName? _clang_getCursorDisplayName; + late final _clang_getCursorDisplayName_ptr = + _lookup>( + 'clang_getCursorDisplayName'); + late final _dart_clang_getCursorDisplayName _clang_getCursorDisplayName = + _clang_getCursorDisplayName_ptr + .asFunction<_dart_clang_getCursorDisplayName>(); /// For a cursor that is a reference, retrieve a cursor representing the /// entity that it references. CXCursor clang_getCursorReferenced( CXCursor arg0, ) { - return (_clang_getCursorReferenced ??= - _lookup>( - 'clang_getCursorReferenced') - .asFunction<_dart_clang_getCursorReferenced>())( + return _clang_getCursorReferenced( arg0, ); } - _dart_clang_getCursorReferenced? _clang_getCursorReferenced; + late final _clang_getCursorReferenced_ptr = + _lookup>( + 'clang_getCursorReferenced'); + late final _dart_clang_getCursorReferenced _clang_getCursorReferenced = + _clang_getCursorReferenced_ptr + .asFunction<_dart_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. CXCursor clang_getCursorDefinition( CXCursor arg0, ) { - return (_clang_getCursorDefinition ??= - _lookup>( - 'clang_getCursorDefinition') - .asFunction<_dart_clang_getCursorDefinition>())( + return _clang_getCursorDefinition( arg0, ); } - _dart_clang_getCursorDefinition? _clang_getCursorDefinition; + late final _clang_getCursorDefinition_ptr = + _lookup>( + 'clang_getCursorDefinition'); + late final _dart_clang_getCursorDefinition _clang_getCursorDefinition = + _clang_getCursorDefinition_ptr + .asFunction<_dart_clang_getCursorDefinition>(); /// Determine whether the declaration pointed to by this cursor is also a /// definition of that entity. int clang_isCursorDefinition( CXCursor arg0, ) { - return (_clang_isCursorDefinition ??= - _lookup>( - 'clang_isCursorDefinition') - .asFunction<_dart_clang_isCursorDefinition>())( + return _clang_isCursorDefinition( arg0, ); } - _dart_clang_isCursorDefinition? _clang_isCursorDefinition; + late final _clang_isCursorDefinition_ptr = + _lookup>( + 'clang_isCursorDefinition'); + late final _dart_clang_isCursorDefinition _clang_isCursorDefinition = + _clang_isCursorDefinition_ptr + .asFunction<_dart_clang_isCursorDefinition>(); /// Retrieve the canonical cursor corresponding to the given cursor. CXCursor clang_getCanonicalCursor( CXCursor arg0, ) { - return (_clang_getCanonicalCursor ??= - _lookup>( - 'clang_getCanonicalCursor') - .asFunction<_dart_clang_getCanonicalCursor>())( + return _clang_getCanonicalCursor( arg0, ); } - _dart_clang_getCanonicalCursor? _clang_getCanonicalCursor; + late final _clang_getCanonicalCursor_ptr = + _lookup>( + 'clang_getCanonicalCursor'); + late final _dart_clang_getCanonicalCursor _clang_getCanonicalCursor = + _clang_getCanonicalCursor_ptr + .asFunction<_dart_clang_getCanonicalCursor>(); /// 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 ??= - _lookup>( - 'clang_Cursor_getObjCSelectorIndex') - .asFunction<_dart_clang_Cursor_getObjCSelectorIndex>())( + return _clang_Cursor_getObjCSelectorIndex( arg0, ); } - _dart_clang_Cursor_getObjCSelectorIndex? _clang_Cursor_getObjCSelectorIndex; + late final _clang_Cursor_getObjCSelectorIndex_ptr = + _lookup>( + 'clang_Cursor_getObjCSelectorIndex'); + late final _dart_clang_Cursor_getObjCSelectorIndex + _clang_Cursor_getObjCSelectorIndex = + _clang_Cursor_getObjCSelectorIndex_ptr + .asFunction<_dart_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: int clang_Cursor_isDynamicCall( CXCursor C, ) { - return (_clang_Cursor_isDynamicCall ??= - _lookup>( - 'clang_Cursor_isDynamicCall') - .asFunction<_dart_clang_Cursor_isDynamicCall>())( + return _clang_Cursor_isDynamicCall( C, ); } - _dart_clang_Cursor_isDynamicCall? _clang_Cursor_isDynamicCall; + late final _clang_Cursor_isDynamicCall_ptr = + _lookup>( + 'clang_Cursor_isDynamicCall'); + late final _dart_clang_Cursor_isDynamicCall _clang_Cursor_isDynamicCall = + _clang_Cursor_isDynamicCall_ptr + .asFunction<_dart_clang_Cursor_isDynamicCall>(); /// 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 ??= - _lookup>( - 'clang_Cursor_getReceiverType') - .asFunction<_dart_clang_Cursor_getReceiverType>())( + return _clang_Cursor_getReceiverType( C, ); } - _dart_clang_Cursor_getReceiverType? _clang_Cursor_getReceiverType; + late final _clang_Cursor_getReceiverType_ptr = + _lookup>( + 'clang_Cursor_getReceiverType'); + late final _dart_clang_Cursor_getReceiverType _clang_Cursor_getReceiverType = + _clang_Cursor_getReceiverType_ptr + .asFunction<_dart_clang_Cursor_getReceiverType>(); /// Given a cursor that represents a property declaration, return the /// associated property attributes. The bits are formed from @@ -3423,49 +3790,55 @@ class LibClang { CXCursor C, int reserved, ) { - return (_clang_Cursor_getObjCPropertyAttributes ??= - _lookup>( - 'clang_Cursor_getObjCPropertyAttributes') - .asFunction<_dart_clang_Cursor_getObjCPropertyAttributes>())( + return _clang_Cursor_getObjCPropertyAttributes( C, reserved, ); } - _dart_clang_Cursor_getObjCPropertyAttributes? - _clang_Cursor_getObjCPropertyAttributes; + late final _clang_Cursor_getObjCPropertyAttributes_ptr = + _lookup>( + 'clang_Cursor_getObjCPropertyAttributes'); + late final _dart_clang_Cursor_getObjCPropertyAttributes + _clang_Cursor_getObjCPropertyAttributes = + _clang_Cursor_getObjCPropertyAttributes_ptr + .asFunction<_dart_clang_Cursor_getObjCPropertyAttributes>(); /// 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 ??= - _lookup>( - 'clang_Cursor_getObjCPropertyGetterName') - .asFunction<_dart_clang_Cursor_getObjCPropertyGetterName>())( + return _clang_Cursor_getObjCPropertyGetterName( C, ); } - _dart_clang_Cursor_getObjCPropertyGetterName? - _clang_Cursor_getObjCPropertyGetterName; + late final _clang_Cursor_getObjCPropertyGetterName_ptr = + _lookup>( + 'clang_Cursor_getObjCPropertyGetterName'); + late final _dart_clang_Cursor_getObjCPropertyGetterName + _clang_Cursor_getObjCPropertyGetterName = + _clang_Cursor_getObjCPropertyGetterName_ptr + .asFunction<_dart_clang_Cursor_getObjCPropertyGetterName>(); /// 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 ??= - _lookup>( - 'clang_Cursor_getObjCPropertySetterName') - .asFunction<_dart_clang_Cursor_getObjCPropertySetterName>())( + return _clang_Cursor_getObjCPropertySetterName( C, ); } - _dart_clang_Cursor_getObjCPropertySetterName? - _clang_Cursor_getObjCPropertySetterName; + late final _clang_Cursor_getObjCPropertySetterName_ptr = + _lookup>( + 'clang_Cursor_getObjCPropertySetterName'); + late final _dart_clang_Cursor_getObjCPropertySetterName + _clang_Cursor_getObjCPropertySetterName = + _clang_Cursor_getObjCPropertySetterName_ptr + .asFunction<_dart_clang_Cursor_getObjCPropertySetterName>(); /// Given a cursor that represents an Objective-C method or parameter /// declaration, return the associated Objective-C qualifiers for the return @@ -3474,15 +3847,18 @@ class LibClang { int clang_Cursor_getObjCDeclQualifiers( CXCursor C, ) { - return (_clang_Cursor_getObjCDeclQualifiers ??= - _lookup>( - 'clang_Cursor_getObjCDeclQualifiers') - .asFunction<_dart_clang_Cursor_getObjCDeclQualifiers>())( + return _clang_Cursor_getObjCDeclQualifiers( C, ); } - _dart_clang_Cursor_getObjCDeclQualifiers? _clang_Cursor_getObjCDeclQualifiers; + late final _clang_Cursor_getObjCDeclQualifiers_ptr = + _lookup>( + 'clang_Cursor_getObjCDeclQualifiers'); + late final _dart_clang_Cursor_getObjCDeclQualifiers + _clang_Cursor_getObjCDeclQualifiers = + _clang_Cursor_getObjCDeclQualifiers_ptr + .asFunction<_dart_clang_Cursor_getObjCDeclQualifiers>(); /// Given a cursor that represents an Objective-C method or property /// declaration, return non-zero if the declaration was affected by @@ -3491,29 +3867,32 @@ class LibClang { int clang_Cursor_isObjCOptional( CXCursor C, ) { - return (_clang_Cursor_isObjCOptional ??= - _lookup>( - 'clang_Cursor_isObjCOptional') - .asFunction<_dart_clang_Cursor_isObjCOptional>())( + return _clang_Cursor_isObjCOptional( C, ); } - _dart_clang_Cursor_isObjCOptional? _clang_Cursor_isObjCOptional; + late final _clang_Cursor_isObjCOptional_ptr = + _lookup>( + 'clang_Cursor_isObjCOptional'); + late final _dart_clang_Cursor_isObjCOptional _clang_Cursor_isObjCOptional = + _clang_Cursor_isObjCOptional_ptr + .asFunction<_dart_clang_Cursor_isObjCOptional>(); /// Returns non-zero if the given cursor is a variadic function or method. int clang_Cursor_isVariadic( CXCursor C, ) { - return (_clang_Cursor_isVariadic ??= - _lookup>( - 'clang_Cursor_isVariadic') - .asFunction<_dart_clang_Cursor_isVariadic>())( + return _clang_Cursor_isVariadic( C, ); } - _dart_clang_Cursor_isVariadic? _clang_Cursor_isVariadic; + late final _clang_Cursor_isVariadic_ptr = + _lookup>( + 'clang_Cursor_isVariadic'); + late final _dart_clang_Cursor_isVariadic _clang_Cursor_isVariadic = + _clang_Cursor_isVariadic_ptr.asFunction<_dart_clang_Cursor_isVariadic>(); /// Returns non-zero if the given cursor points to a symbol marked with /// external_source_symbol attribute. @@ -3523,10 +3902,7 @@ class LibClang { ffi.Pointer definedIn, ffi.Pointer isGenerated, ) { - return (_clang_Cursor_isExternalSymbol ??= - _lookup>( - 'clang_Cursor_isExternalSymbol') - .asFunction<_dart_clang_Cursor_isExternalSymbol>())( + return _clang_Cursor_isExternalSymbol( C, language, definedIn, @@ -3534,7 +3910,12 @@ class LibClang { ); } - _dart_clang_Cursor_isExternalSymbol? _clang_Cursor_isExternalSymbol; + late final _clang_Cursor_isExternalSymbol_ptr = + _lookup>( + 'clang_Cursor_isExternalSymbol'); + late final _dart_clang_Cursor_isExternalSymbol + _clang_Cursor_isExternalSymbol = _clang_Cursor_isExternalSymbol_ptr + .asFunction<_dart_clang_Cursor_isExternalSymbol>(); /// Given a cursor that represents a declaration, return the associated /// comment's source range. The range may include multiple consecutive @@ -3542,103 +3923,116 @@ class LibClang { CXSourceRange clang_Cursor_getCommentRange( CXCursor C, ) { - return (_clang_Cursor_getCommentRange ??= - _lookup>( - 'clang_Cursor_getCommentRange') - .asFunction<_dart_clang_Cursor_getCommentRange>())( + return _clang_Cursor_getCommentRange( C, ); } - _dart_clang_Cursor_getCommentRange? _clang_Cursor_getCommentRange; + late final _clang_Cursor_getCommentRange_ptr = + _lookup>( + 'clang_Cursor_getCommentRange'); + late final _dart_clang_Cursor_getCommentRange _clang_Cursor_getCommentRange = + _clang_Cursor_getCommentRange_ptr + .asFunction<_dart_clang_Cursor_getCommentRange>(); /// 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 ??= - _lookup>( - 'clang_Cursor_getRawCommentText') - .asFunction<_dart_clang_Cursor_getRawCommentText>())( + return _clang_Cursor_getRawCommentText( C, ); } - _dart_clang_Cursor_getRawCommentText? _clang_Cursor_getRawCommentText; + late final _clang_Cursor_getRawCommentText_ptr = + _lookup>( + 'clang_Cursor_getRawCommentText'); + late final _dart_clang_Cursor_getRawCommentText + _clang_Cursor_getRawCommentText = _clang_Cursor_getRawCommentText_ptr + .asFunction<_dart_clang_Cursor_getRawCommentText>(); /// 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 ??= - _lookup>( - 'clang_Cursor_getBriefCommentText') - .asFunction<_dart_clang_Cursor_getBriefCommentText>())( + return _clang_Cursor_getBriefCommentText( C, ); } - _dart_clang_Cursor_getBriefCommentText? _clang_Cursor_getBriefCommentText; + late final _clang_Cursor_getBriefCommentText_ptr = + _lookup>( + 'clang_Cursor_getBriefCommentText'); + late final _dart_clang_Cursor_getBriefCommentText + _clang_Cursor_getBriefCommentText = _clang_Cursor_getBriefCommentText_ptr + .asFunction<_dart_clang_Cursor_getBriefCommentText>(); /// Retrieve the CXString representing the mangled name of the cursor. CXString clang_Cursor_getMangling( CXCursor arg0, ) { - return (_clang_Cursor_getMangling ??= - _lookup>( - 'clang_Cursor_getMangling') - .asFunction<_dart_clang_Cursor_getMangling>())( + return _clang_Cursor_getMangling( arg0, ); } - _dart_clang_Cursor_getMangling? _clang_Cursor_getMangling; + late final _clang_Cursor_getMangling_ptr = + _lookup>( + 'clang_Cursor_getMangling'); + late final _dart_clang_Cursor_getMangling _clang_Cursor_getMangling = + _clang_Cursor_getMangling_ptr + .asFunction<_dart_clang_Cursor_getMangling>(); /// 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 ??= - _lookup>( - 'clang_Cursor_getCXXManglings') - .asFunction<_dart_clang_Cursor_getCXXManglings>())( + return _clang_Cursor_getCXXManglings( arg0, ); } - _dart_clang_Cursor_getCXXManglings? _clang_Cursor_getCXXManglings; + late final _clang_Cursor_getCXXManglings_ptr = + _lookup>( + 'clang_Cursor_getCXXManglings'); + late final _dart_clang_Cursor_getCXXManglings _clang_Cursor_getCXXManglings = + _clang_Cursor_getCXXManglings_ptr + .asFunction<_dart_clang_Cursor_getCXXManglings>(); /// 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 ??= - _lookup>( - 'clang_Cursor_getObjCManglings') - .asFunction<_dart_clang_Cursor_getObjCManglings>())( + return _clang_Cursor_getObjCManglings( arg0, ); } - _dart_clang_Cursor_getObjCManglings? _clang_Cursor_getObjCManglings; + late final _clang_Cursor_getObjCManglings_ptr = + _lookup>( + 'clang_Cursor_getObjCManglings'); + late final _dart_clang_Cursor_getObjCManglings + _clang_Cursor_getObjCManglings = _clang_Cursor_getObjCManglings_ptr + .asFunction<_dart_clang_Cursor_getObjCManglings>(); /// Given a CXCursor_ModuleImportDecl cursor, return the associated module. ffi.Pointer clang_Cursor_getModule( CXCursor C, ) { - return (_clang_Cursor_getModule ??= - _lookup>( - 'clang_Cursor_getModule') - .asFunction<_dart_clang_Cursor_getModule>())( + return _clang_Cursor_getModule( C, ); } - _dart_clang_Cursor_getModule? _clang_Cursor_getModule; + late final _clang_Cursor_getModule_ptr = + _lookup>( + 'clang_Cursor_getModule'); + late final _dart_clang_Cursor_getModule _clang_Cursor_getModule = + _clang_Cursor_getModule_ptr.asFunction<_dart_clang_Cursor_getModule>(); /// Given a CXFile header file, return the module that contains it, if one /// exists. @@ -3646,104 +4040,114 @@ class LibClang { ffi.Pointer arg0, ffi.Pointer arg1, ) { - return (_clang_getModuleForFile ??= - _lookup>( - 'clang_getModuleForFile') - .asFunction<_dart_clang_getModuleForFile>())( + return _clang_getModuleForFile( arg0, arg1, ); } - _dart_clang_getModuleForFile? _clang_getModuleForFile; + late final _clang_getModuleForFile_ptr = + _lookup>( + 'clang_getModuleForFile'); + late final _dart_clang_getModuleForFile _clang_getModuleForFile = + _clang_getModuleForFile_ptr.asFunction<_dart_clang_getModuleForFile>(); /// Returns the module file where the provided module object came from. ffi.Pointer clang_Module_getASTFile( ffi.Pointer Module, ) { - return (_clang_Module_getASTFile ??= - _lookup>( - 'clang_Module_getASTFile') - .asFunction<_dart_clang_Module_getASTFile>())( + return _clang_Module_getASTFile( Module, ); } - _dart_clang_Module_getASTFile? _clang_Module_getASTFile; + late final _clang_Module_getASTFile_ptr = + _lookup>( + 'clang_Module_getASTFile'); + late final _dart_clang_Module_getASTFile _clang_Module_getASTFile = + _clang_Module_getASTFile_ptr.asFunction<_dart_clang_Module_getASTFile>(); /// 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 ??= - _lookup>( - 'clang_Module_getParent') - .asFunction<_dart_clang_Module_getParent>())( + return _clang_Module_getParent( Module, ); } - _dart_clang_Module_getParent? _clang_Module_getParent; + late final _clang_Module_getParent_ptr = + _lookup>( + 'clang_Module_getParent'); + late final _dart_clang_Module_getParent _clang_Module_getParent = + _clang_Module_getParent_ptr.asFunction<_dart_clang_Module_getParent>(); /// 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 ??= - _lookup>( - 'clang_Module_getName') - .asFunction<_dart_clang_Module_getName>())( + return _clang_Module_getName( Module, ); } - _dart_clang_Module_getName? _clang_Module_getName; + late final _clang_Module_getName_ptr = + _lookup>( + 'clang_Module_getName'); + late final _dart_clang_Module_getName _clang_Module_getName = + _clang_Module_getName_ptr.asFunction<_dart_clang_Module_getName>(); /// Returns the full name of the module, e.g. "std.vector". CXString clang_Module_getFullName( ffi.Pointer Module, ) { - return (_clang_Module_getFullName ??= - _lookup>( - 'clang_Module_getFullName') - .asFunction<_dart_clang_Module_getFullName>())( + return _clang_Module_getFullName( Module, ); } - _dart_clang_Module_getFullName? _clang_Module_getFullName; + late final _clang_Module_getFullName_ptr = + _lookup>( + 'clang_Module_getFullName'); + late final _dart_clang_Module_getFullName _clang_Module_getFullName = + _clang_Module_getFullName_ptr + .asFunction<_dart_clang_Module_getFullName>(); /// Returns non-zero if the module is a system one. int clang_Module_isSystem( ffi.Pointer Module, ) { - return (_clang_Module_isSystem ??= - _lookup>( - 'clang_Module_isSystem') - .asFunction<_dart_clang_Module_isSystem>())( + return _clang_Module_isSystem( Module, ); } - _dart_clang_Module_isSystem? _clang_Module_isSystem; + late final _clang_Module_isSystem_ptr = + _lookup>( + 'clang_Module_isSystem'); + late final _dart_clang_Module_isSystem _clang_Module_isSystem = + _clang_Module_isSystem_ptr.asFunction<_dart_clang_Module_isSystem>(); /// 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 ??= - _lookup>( - 'clang_Module_getNumTopLevelHeaders') - .asFunction<_dart_clang_Module_getNumTopLevelHeaders>())( + return _clang_Module_getNumTopLevelHeaders( arg0, Module, ); } - _dart_clang_Module_getNumTopLevelHeaders? _clang_Module_getNumTopLevelHeaders; + late final _clang_Module_getNumTopLevelHeaders_ptr = + _lookup>( + 'clang_Module_getNumTopLevelHeaders'); + late final _dart_clang_Module_getNumTopLevelHeaders + _clang_Module_getNumTopLevelHeaders = + _clang_Module_getNumTopLevelHeaders_ptr + .asFunction<_dart_clang_Module_getNumTopLevelHeaders>(); /// Returns the specified top level header associated with the module. ffi.Pointer clang_Module_getTopLevelHeader( @@ -3751,137 +4155,153 @@ class LibClang { ffi.Pointer Module, int Index, ) { - return (_clang_Module_getTopLevelHeader ??= - _lookup>( - 'clang_Module_getTopLevelHeader') - .asFunction<_dart_clang_Module_getTopLevelHeader>())( + return _clang_Module_getTopLevelHeader( arg0, Module, Index, ); } - _dart_clang_Module_getTopLevelHeader? _clang_Module_getTopLevelHeader; + late final _clang_Module_getTopLevelHeader_ptr = + _lookup>( + 'clang_Module_getTopLevelHeader'); + late final _dart_clang_Module_getTopLevelHeader + _clang_Module_getTopLevelHeader = _clang_Module_getTopLevelHeader_ptr + .asFunction<_dart_clang_Module_getTopLevelHeader>(); /// Determine if a C++ constructor is a converting constructor. int clang_CXXConstructor_isConvertingConstructor( CXCursor C, ) { - return (_clang_CXXConstructor_isConvertingConstructor ??= _lookup< - ffi.NativeFunction< - _c_clang_CXXConstructor_isConvertingConstructor>>( - 'clang_CXXConstructor_isConvertingConstructor') - .asFunction<_dart_clang_CXXConstructor_isConvertingConstructor>())( + return _clang_CXXConstructor_isConvertingConstructor( C, ); } - _dart_clang_CXXConstructor_isConvertingConstructor? - _clang_CXXConstructor_isConvertingConstructor; + late final _clang_CXXConstructor_isConvertingConstructor_ptr = _lookup< + ffi.NativeFunction<_c_clang_CXXConstructor_isConvertingConstructor>>( + 'clang_CXXConstructor_isConvertingConstructor'); + late final _dart_clang_CXXConstructor_isConvertingConstructor + _clang_CXXConstructor_isConvertingConstructor = + _clang_CXXConstructor_isConvertingConstructor_ptr + .asFunction<_dart_clang_CXXConstructor_isConvertingConstructor>(); /// Determine if a C++ constructor is a copy constructor. int clang_CXXConstructor_isCopyConstructor( CXCursor C, ) { - return (_clang_CXXConstructor_isCopyConstructor ??= - _lookup>( - 'clang_CXXConstructor_isCopyConstructor') - .asFunction<_dart_clang_CXXConstructor_isCopyConstructor>())( + return _clang_CXXConstructor_isCopyConstructor( C, ); } - _dart_clang_CXXConstructor_isCopyConstructor? - _clang_CXXConstructor_isCopyConstructor; + late final _clang_CXXConstructor_isCopyConstructor_ptr = + _lookup>( + 'clang_CXXConstructor_isCopyConstructor'); + late final _dart_clang_CXXConstructor_isCopyConstructor + _clang_CXXConstructor_isCopyConstructor = + _clang_CXXConstructor_isCopyConstructor_ptr + .asFunction<_dart_clang_CXXConstructor_isCopyConstructor>(); /// Determine if a C++ constructor is the default constructor. int clang_CXXConstructor_isDefaultConstructor( CXCursor C, ) { - return (_clang_CXXConstructor_isDefaultConstructor ??= _lookup< - ffi.NativeFunction< - _c_clang_CXXConstructor_isDefaultConstructor>>( - 'clang_CXXConstructor_isDefaultConstructor') - .asFunction<_dart_clang_CXXConstructor_isDefaultConstructor>())( + return _clang_CXXConstructor_isDefaultConstructor( C, ); } - _dart_clang_CXXConstructor_isDefaultConstructor? - _clang_CXXConstructor_isDefaultConstructor; + late final _clang_CXXConstructor_isDefaultConstructor_ptr = + _lookup>( + 'clang_CXXConstructor_isDefaultConstructor'); + late final _dart_clang_CXXConstructor_isDefaultConstructor + _clang_CXXConstructor_isDefaultConstructor = + _clang_CXXConstructor_isDefaultConstructor_ptr + .asFunction<_dart_clang_CXXConstructor_isDefaultConstructor>(); /// Determine if a C++ constructor is a move constructor. int clang_CXXConstructor_isMoveConstructor( CXCursor C, ) { - return (_clang_CXXConstructor_isMoveConstructor ??= - _lookup>( - 'clang_CXXConstructor_isMoveConstructor') - .asFunction<_dart_clang_CXXConstructor_isMoveConstructor>())( + return _clang_CXXConstructor_isMoveConstructor( C, ); } - _dart_clang_CXXConstructor_isMoveConstructor? - _clang_CXXConstructor_isMoveConstructor; + late final _clang_CXXConstructor_isMoveConstructor_ptr = + _lookup>( + 'clang_CXXConstructor_isMoveConstructor'); + late final _dart_clang_CXXConstructor_isMoveConstructor + _clang_CXXConstructor_isMoveConstructor = + _clang_CXXConstructor_isMoveConstructor_ptr + .asFunction<_dart_clang_CXXConstructor_isMoveConstructor>(); /// Determine if a C++ field is declared 'mutable'. int clang_CXXField_isMutable( CXCursor C, ) { - return (_clang_CXXField_isMutable ??= - _lookup>( - 'clang_CXXField_isMutable') - .asFunction<_dart_clang_CXXField_isMutable>())( + return _clang_CXXField_isMutable( C, ); } - _dart_clang_CXXField_isMutable? _clang_CXXField_isMutable; + late final _clang_CXXField_isMutable_ptr = + _lookup>( + 'clang_CXXField_isMutable'); + late final _dart_clang_CXXField_isMutable _clang_CXXField_isMutable = + _clang_CXXField_isMutable_ptr + .asFunction<_dart_clang_CXXField_isMutable>(); /// Determine if a C++ method is declared '= default'. int clang_CXXMethod_isDefaulted( CXCursor C, ) { - return (_clang_CXXMethod_isDefaulted ??= - _lookup>( - 'clang_CXXMethod_isDefaulted') - .asFunction<_dart_clang_CXXMethod_isDefaulted>())( + return _clang_CXXMethod_isDefaulted( C, ); } - _dart_clang_CXXMethod_isDefaulted? _clang_CXXMethod_isDefaulted; + late final _clang_CXXMethod_isDefaulted_ptr = + _lookup>( + 'clang_CXXMethod_isDefaulted'); + late final _dart_clang_CXXMethod_isDefaulted _clang_CXXMethod_isDefaulted = + _clang_CXXMethod_isDefaulted_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_CXXMethod_isPureVirtual') - .asFunction<_dart_clang_CXXMethod_isPureVirtual>())( + return _clang_CXXMethod_isPureVirtual( C, ); } - _dart_clang_CXXMethod_isPureVirtual? _clang_CXXMethod_isPureVirtual; + late final _clang_CXXMethod_isPureVirtual_ptr = + _lookup>( + 'clang_CXXMethod_isPureVirtual'); + late final _dart_clang_CXXMethod_isPureVirtual + _clang_CXXMethod_isPureVirtual = _clang_CXXMethod_isPureVirtual_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_CXXMethod_isStatic') - .asFunction<_dart_clang_CXXMethod_isStatic>())( + return _clang_CXXMethod_isStatic( C, ); } - _dart_clang_CXXMethod_isStatic? _clang_CXXMethod_isStatic; + late final _clang_CXXMethod_isStatic_ptr = + _lookup>( + 'clang_CXXMethod_isStatic'); + late final _dart_clang_CXXMethod_isStatic _clang_CXXMethod_isStatic = + _clang_CXXMethod_isStatic_ptr + .asFunction<_dart_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 @@ -3889,74 +4309,82 @@ class LibClang { int clang_CXXMethod_isVirtual( CXCursor C, ) { - return (_clang_CXXMethod_isVirtual ??= - _lookup>( - 'clang_CXXMethod_isVirtual') - .asFunction<_dart_clang_CXXMethod_isVirtual>())( + return _clang_CXXMethod_isVirtual( C, ); } - _dart_clang_CXXMethod_isVirtual? _clang_CXXMethod_isVirtual; + late final _clang_CXXMethod_isVirtual_ptr = + _lookup>( + 'clang_CXXMethod_isVirtual'); + late final _dart_clang_CXXMethod_isVirtual _clang_CXXMethod_isVirtual = + _clang_CXXMethod_isVirtual_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_CXXRecord_isAbstract') - .asFunction<_dart_clang_CXXRecord_isAbstract>())( + return _clang_CXXRecord_isAbstract( C, ); } - _dart_clang_CXXRecord_isAbstract? _clang_CXXRecord_isAbstract; + late final _clang_CXXRecord_isAbstract_ptr = + _lookup>( + 'clang_CXXRecord_isAbstract'); + late final _dart_clang_CXXRecord_isAbstract _clang_CXXRecord_isAbstract = + _clang_CXXRecord_isAbstract_ptr + .asFunction<_dart_clang_CXXRecord_isAbstract>(); /// Determine if an enum declaration refers to a scoped enum. int clang_EnumDecl_isScoped( CXCursor C, ) { - return (_clang_EnumDecl_isScoped ??= - _lookup>( - 'clang_EnumDecl_isScoped') - .asFunction<_dart_clang_EnumDecl_isScoped>())( + return _clang_EnumDecl_isScoped( C, ); } - _dart_clang_EnumDecl_isScoped? _clang_EnumDecl_isScoped; + late final _clang_EnumDecl_isScoped_ptr = + _lookup>( + 'clang_EnumDecl_isScoped'); + late final _dart_clang_EnumDecl_isScoped _clang_EnumDecl_isScoped = + _clang_EnumDecl_isScoped_ptr.asFunction<_dart_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 ??= - _lookup>( - 'clang_CXXMethod_isConst') - .asFunction<_dart_clang_CXXMethod_isConst>())( + return _clang_CXXMethod_isConst( C, ); } - _dart_clang_CXXMethod_isConst? _clang_CXXMethod_isConst; + late final _clang_CXXMethod_isConst_ptr = + _lookup>( + 'clang_CXXMethod_isConst'); + late final _dart_clang_CXXMethod_isConst _clang_CXXMethod_isConst = + _clang_CXXMethod_isConst_ptr.asFunction<_dart_clang_CXXMethod_isConst>(); /// 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 ??= - _lookup>( - 'clang_getTemplateCursorKind') - .asFunction<_dart_clang_getTemplateCursorKind>())( + return _clang_getTemplateCursorKind( C, ); } - _dart_clang_getTemplateCursorKind? _clang_getTemplateCursorKind; + late final _clang_getTemplateCursorKind_ptr = + _lookup>( + 'clang_getTemplateCursorKind'); + late final _dart_clang_getTemplateCursorKind _clang_getTemplateCursorKind = + _clang_getTemplateCursorKind_ptr + .asFunction<_dart_clang_getTemplateCursorKind>(); /// Given a cursor that may represent a specialization or instantiation of a /// template, retrieve the cursor that represents the template that it @@ -3964,15 +4392,18 @@ class LibClang { CXCursor clang_getSpecializedCursorTemplate( CXCursor C, ) { - return (_clang_getSpecializedCursorTemplate ??= - _lookup>( - 'clang_getSpecializedCursorTemplate') - .asFunction<_dart_clang_getSpecializedCursorTemplate>())( + return _clang_getSpecializedCursorTemplate( C, ); } - _dart_clang_getSpecializedCursorTemplate? _clang_getSpecializedCursorTemplate; + late final _clang_getSpecializedCursorTemplate_ptr = + _lookup>( + 'clang_getSpecializedCursorTemplate'); + late final _dart_clang_getSpecializedCursorTemplate + _clang_getSpecializedCursorTemplate = + _clang_getSpecializedCursorTemplate_ptr + .asFunction<_dart_clang_getSpecializedCursorTemplate>(); /// Given a cursor that references something else, return the source range /// covering that reference. @@ -3981,93 +4412,101 @@ class LibClang { int NameFlags, int PieceIndex, ) { - return (_clang_getCursorReferenceNameRange ??= - _lookup>( - 'clang_getCursorReferenceNameRange') - .asFunction<_dart_clang_getCursorReferenceNameRange>())( + return _clang_getCursorReferenceNameRange( C, NameFlags, PieceIndex, ); } - _dart_clang_getCursorReferenceNameRange? _clang_getCursorReferenceNameRange; + late final _clang_getCursorReferenceNameRange_ptr = + _lookup>( + 'clang_getCursorReferenceNameRange'); + late final _dart_clang_getCursorReferenceNameRange + _clang_getCursorReferenceNameRange = + _clang_getCursorReferenceNameRange_ptr + .asFunction<_dart_clang_getCursorReferenceNameRange>(); /// Get the raw lexical token starting with the given location. ffi.Pointer clang_getToken( ffi.Pointer TU, CXSourceLocation Location, ) { - return (_clang_getToken ??= - _lookup>('clang_getToken') - .asFunction<_dart_clang_getToken>())( + return _clang_getToken( TU, Location, ); } - _dart_clang_getToken? _clang_getToken; + late final _clang_getToken_ptr = + _lookup>('clang_getToken'); + late final _dart_clang_getToken _clang_getToken = + _clang_getToken_ptr.asFunction<_dart_clang_getToken>(); /// Determine the kind of the given token. int clang_getTokenKind( CXToken arg0, ) { - return (_clang_getTokenKind ??= - _lookup>('clang_getTokenKind') - .asFunction<_dart_clang_getTokenKind>())( + return _clang_getTokenKind( arg0, ); } - _dart_clang_getTokenKind? _clang_getTokenKind; + late final _clang_getTokenKind_ptr = + _lookup>('clang_getTokenKind'); + late final _dart_clang_getTokenKind _clang_getTokenKind = + _clang_getTokenKind_ptr.asFunction<_dart_clang_getTokenKind>(); /// Determine the spelling of the given token. CXString clang_getTokenSpelling( ffi.Pointer arg0, CXToken arg1, ) { - return (_clang_getTokenSpelling ??= - _lookup>( - 'clang_getTokenSpelling') - .asFunction<_dart_clang_getTokenSpelling>())( + return _clang_getTokenSpelling( arg0, arg1, ); } - _dart_clang_getTokenSpelling? _clang_getTokenSpelling; + late final _clang_getTokenSpelling_ptr = + _lookup>( + 'clang_getTokenSpelling'); + late final _dart_clang_getTokenSpelling _clang_getTokenSpelling = + _clang_getTokenSpelling_ptr.asFunction<_dart_clang_getTokenSpelling>(); /// Retrieve the source location of the given token. CXSourceLocation clang_getTokenLocation( ffi.Pointer arg0, CXToken arg1, ) { - return (_clang_getTokenLocation ??= - _lookup>( - 'clang_getTokenLocation') - .asFunction<_dart_clang_getTokenLocation>())( + return _clang_getTokenLocation( arg0, arg1, ); } - _dart_clang_getTokenLocation? _clang_getTokenLocation; + late final _clang_getTokenLocation_ptr = + _lookup>( + 'clang_getTokenLocation'); + late final _dart_clang_getTokenLocation _clang_getTokenLocation = + _clang_getTokenLocation_ptr.asFunction<_dart_clang_getTokenLocation>(); /// Retrieve a source range that covers the given token. CXSourceRange clang_getTokenExtent( ffi.Pointer arg0, CXToken arg1, ) { - return (_clang_getTokenExtent ??= - _lookup>( - 'clang_getTokenExtent') - .asFunction<_dart_clang_getTokenExtent>())( + return _clang_getTokenExtent( arg0, arg1, ); } - _dart_clang_getTokenExtent? _clang_getTokenExtent; + late final _clang_getTokenExtent_ptr = + _lookup>( + 'clang_getTokenExtent'); + late final _dart_clang_getTokenExtent _clang_getTokenExtent = + _clang_getTokenExtent_ptr.asFunction<_dart_clang_getTokenExtent>(); /// Tokenize the source code described by the given range into raw lexical /// tokens. @@ -4077,9 +4516,7 @@ class LibClang { ffi.Pointer> Tokens, ffi.Pointer NumTokens, ) { - return (_clang_tokenize ??= - _lookup>('clang_tokenize') - .asFunction<_dart_clang_tokenize>())( + return _clang_tokenize( TU, Range, Tokens, @@ -4087,7 +4524,10 @@ class LibClang { ); } - _dart_clang_tokenize? _clang_tokenize; + late final _clang_tokenize_ptr = + _lookup>('clang_tokenize'); + late final _dart_clang_tokenize _clang_tokenize = + _clang_tokenize_ptr.asFunction<_dart_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. @@ -4097,10 +4537,7 @@ class LibClang { int NumTokens, ffi.Pointer Cursors, ) { - return (_clang_annotateTokens ??= - _lookup>( - 'clang_annotateTokens') - .asFunction<_dart_clang_annotateTokens>())( + return _clang_annotateTokens( TU, Tokens, NumTokens, @@ -4108,7 +4545,11 @@ class LibClang { ); } - _dart_clang_annotateTokens? _clang_annotateTokens; + late final _clang_annotateTokens_ptr = + _lookup>( + 'clang_annotateTokens'); + late final _dart_clang_annotateTokens _clang_annotateTokens = + _clang_annotateTokens_ptr.asFunction<_dart_clang_annotateTokens>(); /// Free the given set of tokens. void clang_disposeTokens( @@ -4116,32 +4557,35 @@ class LibClang { ffi.Pointer Tokens, int NumTokens, ) { - return (_clang_disposeTokens ??= - _lookup>( - 'clang_disposeTokens') - .asFunction<_dart_clang_disposeTokens>())( + return _clang_disposeTokens( TU, Tokens, NumTokens, ); } - _dart_clang_disposeTokens? _clang_disposeTokens; + late final _clang_disposeTokens_ptr = + _lookup>( + 'clang_disposeTokens'); + late final _dart_clang_disposeTokens _clang_disposeTokens = + _clang_disposeTokens_ptr.asFunction<_dart_clang_disposeTokens>(); /// These routines are used for testing and debugging, only, and should not be /// relied upon. CXString clang_getCursorKindSpelling( int Kind, ) { - return (_clang_getCursorKindSpelling ??= - _lookup>( - 'clang_getCursorKindSpelling') - .asFunction<_dart_clang_getCursorKindSpelling>())( + return _clang_getCursorKindSpelling( Kind, ); } - _dart_clang_getCursorKindSpelling? _clang_getCursorKindSpelling; + late final _clang_getCursorKindSpelling_ptr = + _lookup>( + 'clang_getCursorKindSpelling'); + late final _dart_clang_getCursorKindSpelling _clang_getCursorKindSpelling = + _clang_getCursorKindSpelling_ptr + .asFunction<_dart_clang_getCursorKindSpelling>(); void clang_getDefinitionSpellingAndExtent( CXCursor arg0, @@ -4152,10 +4596,7 @@ class LibClang { ffi.Pointer endLine, ffi.Pointer endColumn, ) { - return (_clang_getDefinitionSpellingAndExtent ??= - _lookup>( - 'clang_getDefinitionSpellingAndExtent') - .asFunction<_dart_clang_getDefinitionSpellingAndExtent>())( + return _clang_getDefinitionSpellingAndExtent( arg0, startBuf, endBuf, @@ -4166,50 +4607,59 @@ class LibClang { ); } - _dart_clang_getDefinitionSpellingAndExtent? - _clang_getDefinitionSpellingAndExtent; + late final _clang_getDefinitionSpellingAndExtent_ptr = + _lookup>( + 'clang_getDefinitionSpellingAndExtent'); + late final _dart_clang_getDefinitionSpellingAndExtent + _clang_getDefinitionSpellingAndExtent = + _clang_getDefinitionSpellingAndExtent_ptr + .asFunction<_dart_clang_getDefinitionSpellingAndExtent>(); void clang_enableStackTraces() { - return (_clang_enableStackTraces ??= - _lookup>( - 'clang_enableStackTraces') - .asFunction<_dart_clang_enableStackTraces>())(); + return _clang_enableStackTraces(); } - _dart_clang_enableStackTraces? _clang_enableStackTraces; + late final _clang_enableStackTraces_ptr = + _lookup>( + 'clang_enableStackTraces'); + late final _dart_clang_enableStackTraces _clang_enableStackTraces = + _clang_enableStackTraces_ptr.asFunction<_dart_clang_enableStackTraces>(); void clang_executeOnThread( ffi.Pointer> fn, ffi.Pointer user_data, int stack_size, ) { - return (_clang_executeOnThread ??= - _lookup>( - 'clang_executeOnThread') - .asFunction<_dart_clang_executeOnThread>())( + return _clang_executeOnThread( fn, user_data, stack_size, ); } - _dart_clang_executeOnThread? _clang_executeOnThread; + late final _clang_executeOnThread_ptr = + _lookup>( + 'clang_executeOnThread'); + late final _dart_clang_executeOnThread _clang_executeOnThread = + _clang_executeOnThread_ptr.asFunction<_dart_clang_executeOnThread>(); /// Determine the kind of a particular chunk within a completion string. int clang_getCompletionChunkKind( ffi.Pointer completion_string, int chunk_number, ) { - return (_clang_getCompletionChunkKind ??= - _lookup>( - 'clang_getCompletionChunkKind') - .asFunction<_dart_clang_getCompletionChunkKind>())( + return _clang_getCompletionChunkKind( completion_string, chunk_number, ); } - _dart_clang_getCompletionChunkKind? _clang_getCompletionChunkKind; + late final _clang_getCompletionChunkKind_ptr = + _lookup>( + 'clang_getCompletionChunkKind'); + late final _dart_clang_getCompletionChunkKind _clang_getCompletionChunkKind = + _clang_getCompletionChunkKind_ptr + .asFunction<_dart_clang_getCompletionChunkKind>(); /// Retrieve the text associated with a particular chunk within a completion /// string. @@ -4217,16 +4667,18 @@ class LibClang { ffi.Pointer completion_string, int chunk_number, ) { - return (_clang_getCompletionChunkText ??= - _lookup>( - 'clang_getCompletionChunkText') - .asFunction<_dart_clang_getCompletionChunkText>())( + return _clang_getCompletionChunkText( completion_string, chunk_number, ); } - _dart_clang_getCompletionChunkText? _clang_getCompletionChunkText; + late final _clang_getCompletionChunkText_ptr = + _lookup>( + 'clang_getCompletionChunkText'); + late final _dart_clang_getCompletionChunkText _clang_getCompletionChunkText = + _clang_getCompletionChunkText_ptr + .asFunction<_dart_clang_getCompletionChunkText>(); /// Retrieve the completion string associated with a particular chunk within a /// completion string. @@ -4234,154 +4686,174 @@ class LibClang { ffi.Pointer completion_string, int chunk_number, ) { - return (_clang_getCompletionChunkCompletionString ??= _lookup< - ffi.NativeFunction< - _c_clang_getCompletionChunkCompletionString>>( - 'clang_getCompletionChunkCompletionString') - .asFunction<_dart_clang_getCompletionChunkCompletionString>())( + return _clang_getCompletionChunkCompletionString( completion_string, chunk_number, ); } - _dart_clang_getCompletionChunkCompletionString? - _clang_getCompletionChunkCompletionString; + late final _clang_getCompletionChunkCompletionString_ptr = + _lookup>( + 'clang_getCompletionChunkCompletionString'); + late final _dart_clang_getCompletionChunkCompletionString + _clang_getCompletionChunkCompletionString = + _clang_getCompletionChunkCompletionString_ptr + .asFunction<_dart_clang_getCompletionChunkCompletionString>(); /// Retrieve the number of chunks in the given code-completion string. int clang_getNumCompletionChunks( ffi.Pointer completion_string, ) { - return (_clang_getNumCompletionChunks ??= - _lookup>( - 'clang_getNumCompletionChunks') - .asFunction<_dart_clang_getNumCompletionChunks>())( + return _clang_getNumCompletionChunks( completion_string, ); } - _dart_clang_getNumCompletionChunks? _clang_getNumCompletionChunks; + late final _clang_getNumCompletionChunks_ptr = + _lookup>( + 'clang_getNumCompletionChunks'); + late final _dart_clang_getNumCompletionChunks _clang_getNumCompletionChunks = + _clang_getNumCompletionChunks_ptr + .asFunction<_dart_clang_getNumCompletionChunks>(); /// Determine the priority of this code completion. int clang_getCompletionPriority( ffi.Pointer completion_string, ) { - return (_clang_getCompletionPriority ??= - _lookup>( - 'clang_getCompletionPriority') - .asFunction<_dart_clang_getCompletionPriority>())( + return _clang_getCompletionPriority( completion_string, ); } - _dart_clang_getCompletionPriority? _clang_getCompletionPriority; + late final _clang_getCompletionPriority_ptr = + _lookup>( + 'clang_getCompletionPriority'); + late final _dart_clang_getCompletionPriority _clang_getCompletionPriority = + _clang_getCompletionPriority_ptr + .asFunction<_dart_clang_getCompletionPriority>(); /// Determine the availability of the entity that this code-completion string /// refers to. int clang_getCompletionAvailability( ffi.Pointer completion_string, ) { - return (_clang_getCompletionAvailability ??= - _lookup>( - 'clang_getCompletionAvailability') - .asFunction<_dart_clang_getCompletionAvailability>())( + return _clang_getCompletionAvailability( completion_string, ); } - _dart_clang_getCompletionAvailability? _clang_getCompletionAvailability; + late final _clang_getCompletionAvailability_ptr = + _lookup>( + 'clang_getCompletionAvailability'); + late final _dart_clang_getCompletionAvailability + _clang_getCompletionAvailability = _clang_getCompletionAvailability_ptr + .asFunction<_dart_clang_getCompletionAvailability>(); /// Retrieve the number of annotations associated with the given completion /// string. int clang_getCompletionNumAnnotations( ffi.Pointer completion_string, ) { - return (_clang_getCompletionNumAnnotations ??= - _lookup>( - 'clang_getCompletionNumAnnotations') - .asFunction<_dart_clang_getCompletionNumAnnotations>())( + return _clang_getCompletionNumAnnotations( completion_string, ); } - _dart_clang_getCompletionNumAnnotations? _clang_getCompletionNumAnnotations; + late final _clang_getCompletionNumAnnotations_ptr = + _lookup>( + 'clang_getCompletionNumAnnotations'); + late final _dart_clang_getCompletionNumAnnotations + _clang_getCompletionNumAnnotations = + _clang_getCompletionNumAnnotations_ptr + .asFunction<_dart_clang_getCompletionNumAnnotations>(); /// Retrieve the annotation associated with the given completion string. CXString clang_getCompletionAnnotation( ffi.Pointer completion_string, int annotation_number, ) { - return (_clang_getCompletionAnnotation ??= - _lookup>( - 'clang_getCompletionAnnotation') - .asFunction<_dart_clang_getCompletionAnnotation>())( + return _clang_getCompletionAnnotation( completion_string, annotation_number, ); } - _dart_clang_getCompletionAnnotation? _clang_getCompletionAnnotation; + late final _clang_getCompletionAnnotation_ptr = + _lookup>( + 'clang_getCompletionAnnotation'); + late final _dart_clang_getCompletionAnnotation + _clang_getCompletionAnnotation = _clang_getCompletionAnnotation_ptr + .asFunction<_dart_clang_getCompletionAnnotation>(); /// Retrieve the parent context of the given completion string. CXString clang_getCompletionParent( ffi.Pointer completion_string, ffi.Pointer kind, ) { - return (_clang_getCompletionParent ??= - _lookup>( - 'clang_getCompletionParent') - .asFunction<_dart_clang_getCompletionParent>())( + return _clang_getCompletionParent( completion_string, kind, ); } - _dart_clang_getCompletionParent? _clang_getCompletionParent; + late final _clang_getCompletionParent_ptr = + _lookup>( + 'clang_getCompletionParent'); + late final _dart_clang_getCompletionParent _clang_getCompletionParent = + _clang_getCompletionParent_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_getCompletionBriefComment') - .asFunction<_dart_clang_getCompletionBriefComment>())( + return _clang_getCompletionBriefComment( completion_string, ); } - _dart_clang_getCompletionBriefComment? _clang_getCompletionBriefComment; + late final _clang_getCompletionBriefComment_ptr = + _lookup>( + 'clang_getCompletionBriefComment'); + late final _dart_clang_getCompletionBriefComment + _clang_getCompletionBriefComment = _clang_getCompletionBriefComment_ptr + .asFunction<_dart_clang_getCompletionBriefComment>(); /// Retrieve a completion string for an arbitrary declaration or macro /// definition cursor. ffi.Pointer clang_getCursorCompletionString( CXCursor cursor, ) { - return (_clang_getCursorCompletionString ??= - _lookup>( - 'clang_getCursorCompletionString') - .asFunction<_dart_clang_getCursorCompletionString>())( + return _clang_getCursorCompletionString( cursor, ); } - _dart_clang_getCursorCompletionString? _clang_getCursorCompletionString; + late final _clang_getCursorCompletionString_ptr = + _lookup>( + 'clang_getCursorCompletionString'); + late final _dart_clang_getCursorCompletionString + _clang_getCursorCompletionString = _clang_getCursorCompletionString_ptr + .asFunction<_dart_clang_getCursorCompletionString>(); /// Retrieve the number of fix-its for the given completion index. int clang_getCompletionNumFixIts( ffi.Pointer results, int completion_index, ) { - return (_clang_getCompletionNumFixIts ??= - _lookup>( - 'clang_getCompletionNumFixIts') - .asFunction<_dart_clang_getCompletionNumFixIts>())( + return _clang_getCompletionNumFixIts( results, completion_index, ); } - _dart_clang_getCompletionNumFixIts? _clang_getCompletionNumFixIts; + late final _clang_getCompletionNumFixIts_ptr = + _lookup>( + 'clang_getCompletionNumFixIts'); + late final _dart_clang_getCompletionNumFixIts _clang_getCompletionNumFixIts = + _clang_getCompletionNumFixIts_ptr + .asFunction<_dart_clang_getCompletionNumFixIts>(); /// Fix-its that *must* be applied before inserting the text for the /// corresponding completion. @@ -4391,10 +4863,7 @@ class LibClang { int fixit_index, ffi.Pointer replacement_range, ) { - return (_clang_getCompletionFixIt ??= - _lookup>( - 'clang_getCompletionFixIt') - .asFunction<_dart_clang_getCompletionFixIt>())( + return _clang_getCompletionFixIt( results, completion_index, fixit_index, @@ -4402,18 +4871,25 @@ class LibClang { ); } - _dart_clang_getCompletionFixIt? _clang_getCompletionFixIt; + late final _clang_getCompletionFixIt_ptr = + _lookup>( + 'clang_getCompletionFixIt'); + late final _dart_clang_getCompletionFixIt _clang_getCompletionFixIt = + _clang_getCompletionFixIt_ptr + .asFunction<_dart_clang_getCompletionFixIt>(); /// Returns a default set of code-completion options that can be passed to /// clang_codeCompleteAt(). int clang_defaultCodeCompleteOptions() { - return (_clang_defaultCodeCompleteOptions ??= - _lookup>( - 'clang_defaultCodeCompleteOptions') - .asFunction<_dart_clang_defaultCodeCompleteOptions>())(); + return _clang_defaultCodeCompleteOptions(); } - _dart_clang_defaultCodeCompleteOptions? _clang_defaultCodeCompleteOptions; + late final _clang_defaultCodeCompleteOptions_ptr = + _lookup>( + 'clang_defaultCodeCompleteOptions'); + late final _dart_clang_defaultCodeCompleteOptions + _clang_defaultCodeCompleteOptions = _clang_defaultCodeCompleteOptions_ptr + .asFunction<_dart_clang_defaultCodeCompleteOptions>(); /// Perform code completion at a given location in a translation unit. ffi.Pointer clang_codeCompleteAt( @@ -4425,10 +4901,7 @@ class LibClang { int num_unsaved_files, int options, ) { - return (_clang_codeCompleteAt ??= - _lookup>( - 'clang_codeCompleteAt') - .asFunction<_dart_clang_codeCompleteAt>())( + return _clang_codeCompleteAt( TU, complete_filename, complete_line, @@ -4439,84 +4912,98 @@ class LibClang { ); } - _dart_clang_codeCompleteAt? _clang_codeCompleteAt; + late final _clang_codeCompleteAt_ptr = + _lookup>( + 'clang_codeCompleteAt'); + late final _dart_clang_codeCompleteAt _clang_codeCompleteAt = + _clang_codeCompleteAt_ptr.asFunction<_dart_clang_codeCompleteAt>(); /// Sort the code-completion results in case-insensitive alphabetical order. void clang_sortCodeCompletionResults( ffi.Pointer Results, int NumResults, ) { - return (_clang_sortCodeCompletionResults ??= - _lookup>( - 'clang_sortCodeCompletionResults') - .asFunction<_dart_clang_sortCodeCompletionResults>())( + return _clang_sortCodeCompletionResults( Results, NumResults, ); } - _dart_clang_sortCodeCompletionResults? _clang_sortCodeCompletionResults; + late final _clang_sortCodeCompletionResults_ptr = + _lookup>( + 'clang_sortCodeCompletionResults'); + late final _dart_clang_sortCodeCompletionResults + _clang_sortCodeCompletionResults = _clang_sortCodeCompletionResults_ptr + .asFunction<_dart_clang_sortCodeCompletionResults>(); /// Free the given set of code-completion results. void clang_disposeCodeCompleteResults( ffi.Pointer Results, ) { - return (_clang_disposeCodeCompleteResults ??= - _lookup>( - 'clang_disposeCodeCompleteResults') - .asFunction<_dart_clang_disposeCodeCompleteResults>())( + return _clang_disposeCodeCompleteResults( Results, ); } - _dart_clang_disposeCodeCompleteResults? _clang_disposeCodeCompleteResults; + late final _clang_disposeCodeCompleteResults_ptr = + _lookup>( + 'clang_disposeCodeCompleteResults'); + late final _dart_clang_disposeCodeCompleteResults + _clang_disposeCodeCompleteResults = _clang_disposeCodeCompleteResults_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_codeCompleteGetNumDiagnostics') - .asFunction<_dart_clang_codeCompleteGetNumDiagnostics>())( + return _clang_codeCompleteGetNumDiagnostics( Results, ); } - _dart_clang_codeCompleteGetNumDiagnostics? - _clang_codeCompleteGetNumDiagnostics; + late final _clang_codeCompleteGetNumDiagnostics_ptr = + _lookup>( + 'clang_codeCompleteGetNumDiagnostics'); + late final _dart_clang_codeCompleteGetNumDiagnostics + _clang_codeCompleteGetNumDiagnostics = + _clang_codeCompleteGetNumDiagnostics_ptr + .asFunction<_dart_clang_codeCompleteGetNumDiagnostics>(); /// Retrieve a diagnostic associated with the given code completion. ffi.Pointer clang_codeCompleteGetDiagnostic( ffi.Pointer Results, int Index, ) { - return (_clang_codeCompleteGetDiagnostic ??= - _lookup>( - 'clang_codeCompleteGetDiagnostic') - .asFunction<_dart_clang_codeCompleteGetDiagnostic>())( + return _clang_codeCompleteGetDiagnostic( Results, Index, ); } - _dart_clang_codeCompleteGetDiagnostic? _clang_codeCompleteGetDiagnostic; + late final _clang_codeCompleteGetDiagnostic_ptr = + _lookup>( + 'clang_codeCompleteGetDiagnostic'); + late final _dart_clang_codeCompleteGetDiagnostic + _clang_codeCompleteGetDiagnostic = _clang_codeCompleteGetDiagnostic_ptr + .asFunction<_dart_clang_codeCompleteGetDiagnostic>(); /// Determines what completions are appropriate for the context the given code /// completion. int clang_codeCompleteGetContexts( ffi.Pointer Results, ) { - return (_clang_codeCompleteGetContexts ??= - _lookup>( - 'clang_codeCompleteGetContexts') - .asFunction<_dart_clang_codeCompleteGetContexts>())( + return _clang_codeCompleteGetContexts( Results, ); } - _dart_clang_codeCompleteGetContexts? _clang_codeCompleteGetContexts; + late final _clang_codeCompleteGetContexts_ptr = + _lookup>( + 'clang_codeCompleteGetContexts'); + late final _dart_clang_codeCompleteGetContexts + _clang_codeCompleteGetContexts = _clang_codeCompleteGetContexts_ptr + .asFunction<_dart_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 @@ -4526,16 +5013,19 @@ class LibClang { ffi.Pointer Results, ffi.Pointer IsIncomplete, ) { - return (_clang_codeCompleteGetContainerKind ??= - _lookup>( - 'clang_codeCompleteGetContainerKind') - .asFunction<_dart_clang_codeCompleteGetContainerKind>())( + return _clang_codeCompleteGetContainerKind( Results, IsIncomplete, ); } - _dart_clang_codeCompleteGetContainerKind? _clang_codeCompleteGetContainerKind; + late final _clang_codeCompleteGetContainerKind_ptr = + _lookup>( + 'clang_codeCompleteGetContainerKind'); + late final _dart_clang_codeCompleteGetContainerKind + _clang_codeCompleteGetContainerKind = + _clang_codeCompleteGetContainerKind_ptr + .asFunction<_dart_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 @@ -4543,15 +5033,18 @@ class LibClang { CXString clang_codeCompleteGetContainerUSR( ffi.Pointer Results, ) { - return (_clang_codeCompleteGetContainerUSR ??= - _lookup>( - 'clang_codeCompleteGetContainerUSR') - .asFunction<_dart_clang_codeCompleteGetContainerUSR>())( + return _clang_codeCompleteGetContainerUSR( Results, ); } - _dart_clang_codeCompleteGetContainerUSR? _clang_codeCompleteGetContainerUSR; + late final _clang_codeCompleteGetContainerUSR_ptr = + _lookup>( + 'clang_codeCompleteGetContainerUSR'); + late final _dart_clang_codeCompleteGetContainerUSR + _clang_codeCompleteGetContainerUSR = + _clang_codeCompleteGetContainerUSR_ptr + .asFunction<_dart_clang_codeCompleteGetContainerUSR>(); /// Returns the currently-entered selector for an Objective-C message send, /// formatted like "initWithFoo:bar:". Only guaranteed to return a non-empty @@ -4560,40 +5053,46 @@ class LibClang { CXString clang_codeCompleteGetObjCSelector( ffi.Pointer Results, ) { - return (_clang_codeCompleteGetObjCSelector ??= - _lookup>( - 'clang_codeCompleteGetObjCSelector') - .asFunction<_dart_clang_codeCompleteGetObjCSelector>())( + return _clang_codeCompleteGetObjCSelector( Results, ); } - _dart_clang_codeCompleteGetObjCSelector? _clang_codeCompleteGetObjCSelector; + late final _clang_codeCompleteGetObjCSelector_ptr = + _lookup>( + 'clang_codeCompleteGetObjCSelector'); + late final _dart_clang_codeCompleteGetObjCSelector + _clang_codeCompleteGetObjCSelector = + _clang_codeCompleteGetObjCSelector_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_getClangVersion') - .asFunction<_dart_clang_getClangVersion>())(); + return _clang_getClangVersion(); } - _dart_clang_getClangVersion? _clang_getClangVersion; + late final _clang_getClangVersion_ptr = + _lookup>( + 'clang_getClangVersion'); + late final _dart_clang_getClangVersion _clang_getClangVersion = + _clang_getClangVersion_ptr.asFunction<_dart_clang_getClangVersion>(); /// Enable/disable crash recovery. void clang_toggleCrashRecovery( int isEnabled, ) { - return (_clang_toggleCrashRecovery ??= - _lookup>( - 'clang_toggleCrashRecovery') - .asFunction<_dart_clang_toggleCrashRecovery>())( + return _clang_toggleCrashRecovery( isEnabled, ); } - _dart_clang_toggleCrashRecovery? _clang_toggleCrashRecovery; + late final _clang_toggleCrashRecovery_ptr = + _lookup>( + 'clang_toggleCrashRecovery'); + late final _dart_clang_toggleCrashRecovery _clang_toggleCrashRecovery = + _clang_toggleCrashRecovery_ptr + .asFunction<_dart_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. @@ -4604,17 +5103,18 @@ class LibClang { ffi.Pointer> visitor, ffi.Pointer client_data, ) { - return (_clang_getInclusions ??= - _lookup>( - 'clang_getInclusions') - .asFunction<_dart_clang_getInclusions>())( + return _clang_getInclusions( tu, visitor, client_data, ); } - _dart_clang_getInclusions? _clang_getInclusions; + late final _clang_getInclusions_ptr = + _lookup>( + 'clang_getInclusions'); + late final _dart_clang_getInclusions _clang_getInclusions = + _clang_getInclusions_ptr.asFunction<_dart_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 @@ -4622,43 +5122,48 @@ class LibClang { ffi.Pointer clang_Cursor_Evaluate( CXCursor C, ) { - return (_clang_Cursor_Evaluate ??= - _lookup>( - 'clang_Cursor_Evaluate') - .asFunction<_dart_clang_Cursor_Evaluate>())( + return _clang_Cursor_Evaluate( C, ); } - _dart_clang_Cursor_Evaluate? _clang_Cursor_Evaluate; + late final _clang_Cursor_Evaluate_ptr = + _lookup>( + 'clang_Cursor_Evaluate'); + late final _dart_clang_Cursor_Evaluate _clang_Cursor_Evaluate = + _clang_Cursor_Evaluate_ptr.asFunction<_dart_clang_Cursor_Evaluate>(); /// Returns the kind of the evaluated result. int clang_EvalResult_getKind( ffi.Pointer E, ) { - return (_clang_EvalResult_getKind ??= - _lookup>( - 'clang_EvalResult_getKind') - .asFunction<_dart_clang_EvalResult_getKind>())( + return _clang_EvalResult_getKind( E, ); } - _dart_clang_EvalResult_getKind? _clang_EvalResult_getKind; + late final _clang_EvalResult_getKind_ptr = + _lookup>( + 'clang_EvalResult_getKind'); + late final _dart_clang_EvalResult_getKind _clang_EvalResult_getKind = + _clang_EvalResult_getKind_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_EvalResult_getAsInt') - .asFunction<_dart_clang_EvalResult_getAsInt>())( + return _clang_EvalResult_getAsInt( E, ); } - _dart_clang_EvalResult_getAsInt? _clang_EvalResult_getAsInt; + late final _clang_EvalResult_getAsInt_ptr = + _lookup>( + 'clang_EvalResult_getAsInt'); + late final _dart_clang_EvalResult_getAsInt _clang_EvalResult_getAsInt = + _clang_EvalResult_getAsInt_ptr + .asFunction<_dart_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 @@ -4666,59 +5171,67 @@ class LibClang { int clang_EvalResult_getAsLongLong( ffi.Pointer E, ) { - return (_clang_EvalResult_getAsLongLong ??= - _lookup>( - 'clang_EvalResult_getAsLongLong') - .asFunction<_dart_clang_EvalResult_getAsLongLong>())( + return _clang_EvalResult_getAsLongLong( E, ); } - _dart_clang_EvalResult_getAsLongLong? _clang_EvalResult_getAsLongLong; + late final _clang_EvalResult_getAsLongLong_ptr = + _lookup>( + 'clang_EvalResult_getAsLongLong'); + late final _dart_clang_EvalResult_getAsLongLong + _clang_EvalResult_getAsLongLong = _clang_EvalResult_getAsLongLong_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_EvalResult_isUnsignedInt') - .asFunction<_dart_clang_EvalResult_isUnsignedInt>())( + return _clang_EvalResult_isUnsignedInt( E, ); } - _dart_clang_EvalResult_isUnsignedInt? _clang_EvalResult_isUnsignedInt; + late final _clang_EvalResult_isUnsignedInt_ptr = + _lookup>( + 'clang_EvalResult_isUnsignedInt'); + late final _dart_clang_EvalResult_isUnsignedInt + _clang_EvalResult_isUnsignedInt = _clang_EvalResult_isUnsignedInt_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_EvalResult_getAsUnsigned') - .asFunction<_dart_clang_EvalResult_getAsUnsigned>())( + return _clang_EvalResult_getAsUnsigned( E, ); } - _dart_clang_EvalResult_getAsUnsigned? _clang_EvalResult_getAsUnsigned; + late final _clang_EvalResult_getAsUnsigned_ptr = + _lookup>( + 'clang_EvalResult_getAsUnsigned'); + late final _dart_clang_EvalResult_getAsUnsigned + _clang_EvalResult_getAsUnsigned = _clang_EvalResult_getAsUnsigned_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_EvalResult_getAsDouble') - .asFunction<_dart_clang_EvalResult_getAsDouble>())( + return _clang_EvalResult_getAsDouble( E, ); } - _dart_clang_EvalResult_getAsDouble? _clang_EvalResult_getAsDouble; + late final _clang_EvalResult_getAsDouble_ptr = + _lookup>( + 'clang_EvalResult_getAsDouble'); + late final _dart_clang_EvalResult_getAsDouble _clang_EvalResult_getAsDouble = + _clang_EvalResult_getAsDouble_ptr + .asFunction<_dart_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 @@ -4727,73 +5240,81 @@ class LibClang { ffi.Pointer clang_EvalResult_getAsStr( ffi.Pointer E, ) { - return (_clang_EvalResult_getAsStr ??= - _lookup>( - 'clang_EvalResult_getAsStr') - .asFunction<_dart_clang_EvalResult_getAsStr>())( + return _clang_EvalResult_getAsStr( E, ); } - _dart_clang_EvalResult_getAsStr? _clang_EvalResult_getAsStr; + late final _clang_EvalResult_getAsStr_ptr = + _lookup>( + 'clang_EvalResult_getAsStr'); + late final _dart_clang_EvalResult_getAsStr _clang_EvalResult_getAsStr = + _clang_EvalResult_getAsStr_ptr + .asFunction<_dart_clang_EvalResult_getAsStr>(); /// Disposes the created Eval memory. void clang_EvalResult_dispose( ffi.Pointer E, ) { - return (_clang_EvalResult_dispose ??= - _lookup>( - 'clang_EvalResult_dispose') - .asFunction<_dart_clang_EvalResult_dispose>())( + return _clang_EvalResult_dispose( E, ); } - _dart_clang_EvalResult_dispose? _clang_EvalResult_dispose; + late final _clang_EvalResult_dispose_ptr = + _lookup>( + 'clang_EvalResult_dispose'); + late final _dart_clang_EvalResult_dispose _clang_EvalResult_dispose = + _clang_EvalResult_dispose_ptr + .asFunction<_dart_clang_EvalResult_dispose>(); /// Retrieve a remapping. ffi.Pointer clang_getRemappings( ffi.Pointer path, ) { - return (_clang_getRemappings ??= - _lookup>( - 'clang_getRemappings') - .asFunction<_dart_clang_getRemappings>())( + return _clang_getRemappings( path, ); } - _dart_clang_getRemappings? _clang_getRemappings; + late final _clang_getRemappings_ptr = + _lookup>( + 'clang_getRemappings'); + late final _dart_clang_getRemappings _clang_getRemappings = + _clang_getRemappings_ptr.asFunction<_dart_clang_getRemappings>(); /// Retrieve a remapping. ffi.Pointer clang_getRemappingsFromFileList( ffi.Pointer> filePaths, int numFiles, ) { - return (_clang_getRemappingsFromFileList ??= - _lookup>( - 'clang_getRemappingsFromFileList') - .asFunction<_dart_clang_getRemappingsFromFileList>())( + return _clang_getRemappingsFromFileList( filePaths, numFiles, ); } - _dart_clang_getRemappingsFromFileList? _clang_getRemappingsFromFileList; + late final _clang_getRemappingsFromFileList_ptr = + _lookup>( + 'clang_getRemappingsFromFileList'); + late final _dart_clang_getRemappingsFromFileList + _clang_getRemappingsFromFileList = _clang_getRemappingsFromFileList_ptr + .asFunction<_dart_clang_getRemappingsFromFileList>(); /// Determine the number of remappings. int clang_remap_getNumFiles( ffi.Pointer arg0, ) { - return (_clang_remap_getNumFiles ??= - _lookup>( - 'clang_remap_getNumFiles') - .asFunction<_dart_clang_remap_getNumFiles>())( + return _clang_remap_getNumFiles( arg0, ); } - _dart_clang_remap_getNumFiles? _clang_remap_getNumFiles; + late final _clang_remap_getNumFiles_ptr = + _lookup>( + 'clang_remap_getNumFiles'); + late final _dart_clang_remap_getNumFiles _clang_remap_getNumFiles = + _clang_remap_getNumFiles_ptr.asFunction<_dart_clang_remap_getNumFiles>(); /// Get the original and the associated filename from the remapping. void clang_remap_getFilenames( @@ -4802,10 +5323,7 @@ class LibClang { ffi.Pointer original, ffi.Pointer transformed, ) { - return (_clang_remap_getFilenames ??= - _lookup>( - 'clang_remap_getFilenames') - .asFunction<_dart_clang_remap_getFilenames>())( + return _clang_remap_getFilenames( arg0, index, original, @@ -4813,21 +5331,27 @@ class LibClang { ); } - _dart_clang_remap_getFilenames? _clang_remap_getFilenames; + late final _clang_remap_getFilenames_ptr = + _lookup>( + 'clang_remap_getFilenames'); + late final _dart_clang_remap_getFilenames _clang_remap_getFilenames = + _clang_remap_getFilenames_ptr + .asFunction<_dart_clang_remap_getFilenames>(); /// Dispose the remapping. void clang_remap_dispose( ffi.Pointer arg0, ) { - return (_clang_remap_dispose ??= - _lookup>( - 'clang_remap_dispose') - .asFunction<_dart_clang_remap_dispose>())( + return _clang_remap_dispose( arg0, ); } - _dart_clang_remap_dispose? _clang_remap_dispose; + late final _clang_remap_dispose_ptr = + _lookup>( + 'clang_remap_dispose'); + late final _dart_clang_remap_dispose _clang_remap_dispose = + _clang_remap_dispose_ptr.asFunction<_dart_clang_remap_dispose>(); /// Find references of a declaration in a specific file. int clang_findReferencesInFile( @@ -4835,17 +5359,19 @@ class LibClang { ffi.Pointer file, CXCursorAndRangeVisitor visitor, ) { - return (_clang_findReferencesInFile ??= - _lookup>( - 'clang_findReferencesInFile') - .asFunction<_dart_clang_findReferencesInFile>())( + return _clang_findReferencesInFile( cursor, file, visitor, ); } - _dart_clang_findReferencesInFile? _clang_findReferencesInFile; + late final _clang_findReferencesInFile_ptr = + _lookup>( + 'clang_findReferencesInFile'); + late final _dart_clang_findReferencesInFile _clang_findReferencesInFile = + _clang_findReferencesInFile_ptr + .asFunction<_dart_clang_findReferencesInFile>(); /// Find #import/#include directives in a specific file. int clang_findIncludesInFile( @@ -4853,220 +5379,249 @@ class LibClang { ffi.Pointer file, CXCursorAndRangeVisitor visitor, ) { - return (_clang_findIncludesInFile ??= - _lookup>( - 'clang_findIncludesInFile') - .asFunction<_dart_clang_findIncludesInFile>())( + return _clang_findIncludesInFile( TU, file, visitor, ); } - _dart_clang_findIncludesInFile? _clang_findIncludesInFile; + late final _clang_findIncludesInFile_ptr = + _lookup>( + 'clang_findIncludesInFile'); + late final _dart_clang_findIncludesInFile _clang_findIncludesInFile = + _clang_findIncludesInFile_ptr + .asFunction<_dart_clang_findIncludesInFile>(); int clang_index_isEntityObjCContainerKind( int arg0, ) { - return (_clang_index_isEntityObjCContainerKind ??= - _lookup>( - 'clang_index_isEntityObjCContainerKind') - .asFunction<_dart_clang_index_isEntityObjCContainerKind>())( + return _clang_index_isEntityObjCContainerKind( arg0, ); } - _dart_clang_index_isEntityObjCContainerKind? - _clang_index_isEntityObjCContainerKind; + late final _clang_index_isEntityObjCContainerKind_ptr = + _lookup>( + 'clang_index_isEntityObjCContainerKind'); + late final _dart_clang_index_isEntityObjCContainerKind + _clang_index_isEntityObjCContainerKind = + _clang_index_isEntityObjCContainerKind_ptr + .asFunction<_dart_clang_index_isEntityObjCContainerKind>(); ffi.Pointer clang_index_getObjCContainerDeclInfo( ffi.Pointer arg0, ) { - return (_clang_index_getObjCContainerDeclInfo ??= - _lookup>( - 'clang_index_getObjCContainerDeclInfo') - .asFunction<_dart_clang_index_getObjCContainerDeclInfo>())( + return _clang_index_getObjCContainerDeclInfo( arg0, ); } - _dart_clang_index_getObjCContainerDeclInfo? - _clang_index_getObjCContainerDeclInfo; + late final _clang_index_getObjCContainerDeclInfo_ptr = + _lookup>( + 'clang_index_getObjCContainerDeclInfo'); + late final _dart_clang_index_getObjCContainerDeclInfo + _clang_index_getObjCContainerDeclInfo = + _clang_index_getObjCContainerDeclInfo_ptr + .asFunction<_dart_clang_index_getObjCContainerDeclInfo>(); ffi.Pointer clang_index_getObjCInterfaceDeclInfo( ffi.Pointer arg0, ) { - return (_clang_index_getObjCInterfaceDeclInfo ??= - _lookup>( - 'clang_index_getObjCInterfaceDeclInfo') - .asFunction<_dart_clang_index_getObjCInterfaceDeclInfo>())( + return _clang_index_getObjCInterfaceDeclInfo( arg0, ); } - _dart_clang_index_getObjCInterfaceDeclInfo? - _clang_index_getObjCInterfaceDeclInfo; + late final _clang_index_getObjCInterfaceDeclInfo_ptr = + _lookup>( + 'clang_index_getObjCInterfaceDeclInfo'); + late final _dart_clang_index_getObjCInterfaceDeclInfo + _clang_index_getObjCInterfaceDeclInfo = + _clang_index_getObjCInterfaceDeclInfo_ptr + .asFunction<_dart_clang_index_getObjCInterfaceDeclInfo>(); ffi.Pointer clang_index_getObjCCategoryDeclInfo( ffi.Pointer arg0, ) { - return (_clang_index_getObjCCategoryDeclInfo ??= - _lookup>( - 'clang_index_getObjCCategoryDeclInfo') - .asFunction<_dart_clang_index_getObjCCategoryDeclInfo>())( + return _clang_index_getObjCCategoryDeclInfo( arg0, ); } - _dart_clang_index_getObjCCategoryDeclInfo? - _clang_index_getObjCCategoryDeclInfo; + late final _clang_index_getObjCCategoryDeclInfo_ptr = + _lookup>( + 'clang_index_getObjCCategoryDeclInfo'); + late final _dart_clang_index_getObjCCategoryDeclInfo + _clang_index_getObjCCategoryDeclInfo = + _clang_index_getObjCCategoryDeclInfo_ptr + .asFunction<_dart_clang_index_getObjCCategoryDeclInfo>(); ffi.Pointer clang_index_getObjCProtocolRefListInfo( ffi.Pointer arg0, ) { - return (_clang_index_getObjCProtocolRefListInfo ??= - _lookup>( - 'clang_index_getObjCProtocolRefListInfo') - .asFunction<_dart_clang_index_getObjCProtocolRefListInfo>())( + return _clang_index_getObjCProtocolRefListInfo( arg0, ); } - _dart_clang_index_getObjCProtocolRefListInfo? - _clang_index_getObjCProtocolRefListInfo; + late final _clang_index_getObjCProtocolRefListInfo_ptr = + _lookup>( + 'clang_index_getObjCProtocolRefListInfo'); + late final _dart_clang_index_getObjCProtocolRefListInfo + _clang_index_getObjCProtocolRefListInfo = + _clang_index_getObjCProtocolRefListInfo_ptr + .asFunction<_dart_clang_index_getObjCProtocolRefListInfo>(); ffi.Pointer clang_index_getObjCPropertyDeclInfo( ffi.Pointer arg0, ) { - return (_clang_index_getObjCPropertyDeclInfo ??= - _lookup>( - 'clang_index_getObjCPropertyDeclInfo') - .asFunction<_dart_clang_index_getObjCPropertyDeclInfo>())( + return _clang_index_getObjCPropertyDeclInfo( arg0, ); } - _dart_clang_index_getObjCPropertyDeclInfo? - _clang_index_getObjCPropertyDeclInfo; + late final _clang_index_getObjCPropertyDeclInfo_ptr = + _lookup>( + 'clang_index_getObjCPropertyDeclInfo'); + late final _dart_clang_index_getObjCPropertyDeclInfo + _clang_index_getObjCPropertyDeclInfo = + _clang_index_getObjCPropertyDeclInfo_ptr + .asFunction<_dart_clang_index_getObjCPropertyDeclInfo>(); ffi.Pointer clang_index_getIBOutletCollectionAttrInfo( ffi.Pointer arg0, ) { - return (_clang_index_getIBOutletCollectionAttrInfo ??= _lookup< - ffi.NativeFunction< - _c_clang_index_getIBOutletCollectionAttrInfo>>( - 'clang_index_getIBOutletCollectionAttrInfo') - .asFunction<_dart_clang_index_getIBOutletCollectionAttrInfo>())( + return _clang_index_getIBOutletCollectionAttrInfo( arg0, ); } - _dart_clang_index_getIBOutletCollectionAttrInfo? - _clang_index_getIBOutletCollectionAttrInfo; + late final _clang_index_getIBOutletCollectionAttrInfo_ptr = + _lookup>( + 'clang_index_getIBOutletCollectionAttrInfo'); + late final _dart_clang_index_getIBOutletCollectionAttrInfo + _clang_index_getIBOutletCollectionAttrInfo = + _clang_index_getIBOutletCollectionAttrInfo_ptr + .asFunction<_dart_clang_index_getIBOutletCollectionAttrInfo>(); ffi.Pointer clang_index_getCXXClassDeclInfo( ffi.Pointer arg0, ) { - return (_clang_index_getCXXClassDeclInfo ??= - _lookup>( - 'clang_index_getCXXClassDeclInfo') - .asFunction<_dart_clang_index_getCXXClassDeclInfo>())( + return _clang_index_getCXXClassDeclInfo( arg0, ); } - _dart_clang_index_getCXXClassDeclInfo? _clang_index_getCXXClassDeclInfo; + late final _clang_index_getCXXClassDeclInfo_ptr = + _lookup>( + 'clang_index_getCXXClassDeclInfo'); + late final _dart_clang_index_getCXXClassDeclInfo + _clang_index_getCXXClassDeclInfo = _clang_index_getCXXClassDeclInfo_ptr + .asFunction<_dart_clang_index_getCXXClassDeclInfo>(); /// For retrieving a custom CXIdxClientContainer attached to a container. ffi.Pointer clang_index_getClientContainer( ffi.Pointer arg0, ) { - return (_clang_index_getClientContainer ??= - _lookup>( - 'clang_index_getClientContainer') - .asFunction<_dart_clang_index_getClientContainer>())( + return _clang_index_getClientContainer( arg0, ); } - _dart_clang_index_getClientContainer? _clang_index_getClientContainer; + late final _clang_index_getClientContainer_ptr = + _lookup>( + 'clang_index_getClientContainer'); + late final _dart_clang_index_getClientContainer + _clang_index_getClientContainer = _clang_index_getClientContainer_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_index_setClientContainer') - .asFunction<_dart_clang_index_setClientContainer>())( + return _clang_index_setClientContainer( arg0, arg1, ); } - _dart_clang_index_setClientContainer? _clang_index_setClientContainer; + late final _clang_index_setClientContainer_ptr = + _lookup>( + 'clang_index_setClientContainer'); + late final _dart_clang_index_setClientContainer + _clang_index_setClientContainer = _clang_index_setClientContainer_ptr + .asFunction<_dart_clang_index_setClientContainer>(); /// For retrieving a custom CXIdxClientEntity attached to an entity. ffi.Pointer clang_index_getClientEntity( ffi.Pointer arg0, ) { - return (_clang_index_getClientEntity ??= - _lookup>( - 'clang_index_getClientEntity') - .asFunction<_dart_clang_index_getClientEntity>())( + return _clang_index_getClientEntity( arg0, ); } - _dart_clang_index_getClientEntity? _clang_index_getClientEntity; + late final _clang_index_getClientEntity_ptr = + _lookup>( + 'clang_index_getClientEntity'); + late final _dart_clang_index_getClientEntity _clang_index_getClientEntity = + _clang_index_getClientEntity_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_index_setClientEntity') - .asFunction<_dart_clang_index_setClientEntity>())( + return _clang_index_setClientEntity( arg0, arg1, ); } - _dart_clang_index_setClientEntity? _clang_index_setClientEntity; + late final _clang_index_setClientEntity_ptr = + _lookup>( + 'clang_index_setClientEntity'); + late final _dart_clang_index_setClientEntity _clang_index_setClientEntity = + _clang_index_setClientEntity_ptr + .asFunction<_dart_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 ??= - _lookup>( - 'clang_IndexAction_create') - .asFunction<_dart_clang_IndexAction_create>())( + return _clang_IndexAction_create( CIdx, ); } - _dart_clang_IndexAction_create? _clang_IndexAction_create; + late final _clang_IndexAction_create_ptr = + _lookup>( + 'clang_IndexAction_create'); + late final _dart_clang_IndexAction_create _clang_IndexAction_create = + _clang_IndexAction_create_ptr + .asFunction<_dart_clang_IndexAction_create>(); /// Destroy the given index action. void clang_IndexAction_dispose( ffi.Pointer arg0, ) { - return (_clang_IndexAction_dispose ??= - _lookup>( - 'clang_IndexAction_dispose') - .asFunction<_dart_clang_IndexAction_dispose>())( + return _clang_IndexAction_dispose( arg0, ); } - _dart_clang_IndexAction_dispose? _clang_IndexAction_dispose; + late final _clang_IndexAction_dispose_ptr = + _lookup>( + 'clang_IndexAction_dispose'); + late final _dart_clang_IndexAction_dispose _clang_IndexAction_dispose = + _clang_IndexAction_dispose_ptr + .asFunction<_dart_clang_IndexAction_dispose>(); /// Index the given source file and the translation unit corresponding to that /// file via callbacks implemented through #IndexerCallbacks. @@ -5084,10 +5639,7 @@ class LibClang { ffi.Pointer> out_TU, int TU_options, ) { - return (_clang_indexSourceFile ??= - _lookup>( - 'clang_indexSourceFile') - .asFunction<_dart_clang_indexSourceFile>())( + return _clang_indexSourceFile( arg0, client_data, index_callbacks, @@ -5103,7 +5655,11 @@ class LibClang { ); } - _dart_clang_indexSourceFile? _clang_indexSourceFile; + late final _clang_indexSourceFile_ptr = + _lookup>( + 'clang_indexSourceFile'); + late final _dart_clang_indexSourceFile _clang_indexSourceFile = + _clang_indexSourceFile_ptr.asFunction<_dart_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 @@ -5122,10 +5678,7 @@ class LibClang { ffi.Pointer> out_TU, int TU_options, ) { - return (_clang_indexSourceFileFullArgv ??= - _lookup>( - 'clang_indexSourceFileFullArgv') - .asFunction<_dart_clang_indexSourceFileFullArgv>())( + return _clang_indexSourceFileFullArgv( arg0, client_data, index_callbacks, @@ -5141,7 +5694,12 @@ class LibClang { ); } - _dart_clang_indexSourceFileFullArgv? _clang_indexSourceFileFullArgv; + late final _clang_indexSourceFileFullArgv_ptr = + _lookup>( + 'clang_indexSourceFileFullArgv'); + late final _dart_clang_indexSourceFileFullArgv + _clang_indexSourceFileFullArgv = _clang_indexSourceFileFullArgv_ptr + .asFunction<_dart_clang_indexSourceFileFullArgv>(); /// Index the given translation unit via callbacks implemented through /// #IndexerCallbacks. @@ -5153,10 +5711,7 @@ class LibClang { int index_options, ffi.Pointer arg5, ) { - return (_clang_indexTranslationUnit ??= - _lookup>( - 'clang_indexTranslationUnit') - .asFunction<_dart_clang_indexTranslationUnit>())( + return _clang_indexTranslationUnit( arg0, client_data, index_callbacks, @@ -5166,7 +5721,12 @@ class LibClang { ); } - _dart_clang_indexTranslationUnit? _clang_indexTranslationUnit; + late final _clang_indexTranslationUnit_ptr = + _lookup>( + 'clang_indexTranslationUnit'); + late final _dart_clang_indexTranslationUnit _clang_indexTranslationUnit = + _clang_indexTranslationUnit_ptr + .asFunction<_dart_clang_indexTranslationUnit>(); /// Retrieve the CXIdxFile, file, line, column, and offset represented by the /// given CXIdxLoc. @@ -5178,10 +5738,7 @@ class LibClang { ffi.Pointer column, ffi.Pointer offset, ) { - return (_clang_indexLoc_getFileLocation ??= - _lookup>( - 'clang_indexLoc_getFileLocation') - .asFunction<_dart_clang_indexLoc_getFileLocation>())( + return _clang_indexLoc_getFileLocation( loc, indexFile, file, @@ -5191,21 +5748,29 @@ class LibClang { ); } - _dart_clang_indexLoc_getFileLocation? _clang_indexLoc_getFileLocation; + late final _clang_indexLoc_getFileLocation_ptr = + _lookup>( + 'clang_indexLoc_getFileLocation'); + late final _dart_clang_indexLoc_getFileLocation + _clang_indexLoc_getFileLocation = _clang_indexLoc_getFileLocation_ptr + .asFunction<_dart_clang_indexLoc_getFileLocation>(); /// Retrieve the CXSourceLocation represented by the given CXIdxLoc. CXSourceLocation clang_indexLoc_getCXSourceLocation( CXIdxLoc loc, ) { - return (_clang_indexLoc_getCXSourceLocation ??= - _lookup>( - 'clang_indexLoc_getCXSourceLocation') - .asFunction<_dart_clang_indexLoc_getCXSourceLocation>())( + return _clang_indexLoc_getCXSourceLocation( loc, ); } - _dart_clang_indexLoc_getCXSourceLocation? _clang_indexLoc_getCXSourceLocation; + late final _clang_indexLoc_getCXSourceLocation_ptr = + _lookup>( + 'clang_indexLoc_getCXSourceLocation'); + late final _dart_clang_indexLoc_getCXSourceLocation + _clang_indexLoc_getCXSourceLocation = + _clang_indexLoc_getCXSourceLocation_ptr + .asFunction<_dart_clang_indexLoc_getCXSourceLocation>(); /// Visit the fields of a particular type. int clang_Type_visitFields( @@ -5213,17 +5778,18 @@ class LibClang { ffi.Pointer> visitor, ffi.Pointer client_data, ) { - return (_clang_Type_visitFields ??= - _lookup>( - 'clang_Type_visitFields') - .asFunction<_dart_clang_Type_visitFields>())( + return _clang_Type_visitFields( T, visitor, client_data, ); } - _dart_clang_Type_visitFields? _clang_Type_visitFields; + late final _clang_Type_visitFields_ptr = + _lookup>( + 'clang_Type_visitFields'); + late final _dart_clang_Type_visitFields _clang_Type_visitFields = + _clang_Type_visitFields_ptr.asFunction<_dart_clang_Type_visitFields>(); } /// Error codes returned by libclang routines. diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index 9afeabdc7b..0a52e5bc5c 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -57,55 +57,63 @@ class SQLite { _sqlite3_version.value = value; ffi.Pointer sqlite3_libversion() { - return (_sqlite3_libversion ??= - _lookup>('sqlite3_libversion') - .asFunction<_dart_sqlite3_libversion>())(); + return _sqlite3_libversion(); } - _dart_sqlite3_libversion? _sqlite3_libversion; + late final _sqlite3_libversion_ptr = + _lookup>('sqlite3_libversion'); + late final _dart_sqlite3_libversion _sqlite3_libversion = + _sqlite3_libversion_ptr.asFunction<_dart_sqlite3_libversion>(); ffi.Pointer sqlite3_sourceid() { - return (_sqlite3_sourceid ??= - _lookup>('sqlite3_sourceid') - .asFunction<_dart_sqlite3_sourceid>())(); + return _sqlite3_sourceid(); } - _dart_sqlite3_sourceid? _sqlite3_sourceid; + late final _sqlite3_sourceid_ptr = + _lookup>('sqlite3_sourceid'); + late final _dart_sqlite3_sourceid _sqlite3_sourceid = + _sqlite3_sourceid_ptr.asFunction<_dart_sqlite3_sourceid>(); int sqlite3_libversion_number() { - return (_sqlite3_libversion_number ??= - _lookup>( - 'sqlite3_libversion_number') - .asFunction<_dart_sqlite3_libversion_number>())(); + return _sqlite3_libversion_number(); } - _dart_sqlite3_libversion_number? _sqlite3_libversion_number; + late final _sqlite3_libversion_number_ptr = + _lookup>( + 'sqlite3_libversion_number'); + late final _dart_sqlite3_libversion_number _sqlite3_libversion_number = + _sqlite3_libversion_number_ptr + .asFunction<_dart_sqlite3_libversion_number>(); int sqlite3_compileoption_used( ffi.Pointer zOptName, ) { - return (_sqlite3_compileoption_used ??= - _lookup>( - 'sqlite3_compileoption_used') - .asFunction<_dart_sqlite3_compileoption_used>())( + return _sqlite3_compileoption_used( zOptName, ); } - _dart_sqlite3_compileoption_used? _sqlite3_compileoption_used; + late final _sqlite3_compileoption_used_ptr = + _lookup>( + 'sqlite3_compileoption_used'); + late final _dart_sqlite3_compileoption_used _sqlite3_compileoption_used = + _sqlite3_compileoption_used_ptr + .asFunction<_dart_sqlite3_compileoption_used>(); ffi.Pointer sqlite3_compileoption_get( int N, ) { - return (_sqlite3_compileoption_get ??= - _lookup>( - 'sqlite3_compileoption_get') - .asFunction<_dart_sqlite3_compileoption_get>())( + return _sqlite3_compileoption_get( N, ); } - _dart_sqlite3_compileoption_get? _sqlite3_compileoption_get; + late final _sqlite3_compileoption_get_ptr = + _lookup>( + 'sqlite3_compileoption_get'); + late final _dart_sqlite3_compileoption_get _sqlite3_compileoption_get = + _sqlite3_compileoption_get_ptr + .asFunction<_dart_sqlite3_compileoption_get>(); /// CAPI3REF: Test To See If The Library Is Threadsafe /// @@ -142,12 +150,13 @@ class SQLite { /// /// See the [threading mode] documentation for additional information. int sqlite3_threadsafe() { - return (_sqlite3_threadsafe ??= - _lookup>('sqlite3_threadsafe') - .asFunction<_dart_sqlite3_threadsafe>())(); + return _sqlite3_threadsafe(); } - _dart_sqlite3_threadsafe? _sqlite3_threadsafe; + late final _sqlite3_threadsafe_ptr = + _lookup>('sqlite3_threadsafe'); + late final _dart_sqlite3_threadsafe _sqlite3_threadsafe = + _sqlite3_threadsafe_ptr.asFunction<_dart_sqlite3_threadsafe>(); /// CAPI3REF: Closing A Database Connection /// DESTRUCTOR: sqlite3 @@ -188,26 +197,28 @@ class SQLite { int sqlite3_close( ffi.Pointer arg0, ) { - return (_sqlite3_close ??= - _lookup>('sqlite3_close') - .asFunction<_dart_sqlite3_close>())( + return _sqlite3_close( arg0, ); } - _dart_sqlite3_close? _sqlite3_close; + late final _sqlite3_close_ptr = + _lookup>('sqlite3_close'); + late final _dart_sqlite3_close _sqlite3_close = + _sqlite3_close_ptr.asFunction<_dart_sqlite3_close>(); int sqlite3_close_v2( ffi.Pointer arg0, ) { - return (_sqlite3_close_v2 ??= - _lookup>('sqlite3_close_v2') - .asFunction<_dart_sqlite3_close_v2>())( + return _sqlite3_close_v2( arg0, ); } - _dart_sqlite3_close_v2? _sqlite3_close_v2; + late final _sqlite3_close_v2_ptr = + _lookup>('sqlite3_close_v2'); + late final _dart_sqlite3_close_v2 _sqlite3_close_v2 = + _sqlite3_close_v2_ptr.asFunction<_dart_sqlite3_close_v2>(); /// CAPI3REF: One-Step Query Execution Interface /// METHOD: sqlite3 @@ -276,9 +287,7 @@ class SQLite { ffi.Pointer arg3, ffi.Pointer> errmsg, ) { - return (_sqlite3_exec ??= - _lookup>('sqlite3_exec') - .asFunction<_dart_sqlite3_exec>())( + return _sqlite3_exec( arg0, sql, callback, @@ -287,7 +296,10 @@ class SQLite { ); } - _dart_sqlite3_exec? _sqlite3_exec; + late final _sqlite3_exec_ptr = + _lookup>('sqlite3_exec'); + late final _dart_sqlite3_exec _sqlite3_exec = + _sqlite3_exec_ptr.asFunction<_dart_sqlite3_exec>(); /// CAPI3REF: Initialize The SQLite Library /// @@ -363,36 +375,40 @@ class SQLite { /// must return [SQLITE_OK] on success and some other [error code] upon /// failure. int sqlite3_initialize() { - return (_sqlite3_initialize ??= - _lookup>('sqlite3_initialize') - .asFunction<_dart_sqlite3_initialize>())(); + return _sqlite3_initialize(); } - _dart_sqlite3_initialize? _sqlite3_initialize; + late final _sqlite3_initialize_ptr = + _lookup>('sqlite3_initialize'); + late final _dart_sqlite3_initialize _sqlite3_initialize = + _sqlite3_initialize_ptr.asFunction<_dart_sqlite3_initialize>(); int sqlite3_shutdown() { - return (_sqlite3_shutdown ??= - _lookup>('sqlite3_shutdown') - .asFunction<_dart_sqlite3_shutdown>())(); + return _sqlite3_shutdown(); } - _dart_sqlite3_shutdown? _sqlite3_shutdown; + late final _sqlite3_shutdown_ptr = + _lookup>('sqlite3_shutdown'); + late final _dart_sqlite3_shutdown _sqlite3_shutdown = + _sqlite3_shutdown_ptr.asFunction<_dart_sqlite3_shutdown>(); int sqlite3_os_init() { - return (_sqlite3_os_init ??= - _lookup>('sqlite3_os_init') - .asFunction<_dart_sqlite3_os_init>())(); + return _sqlite3_os_init(); } - _dart_sqlite3_os_init? _sqlite3_os_init; + late final _sqlite3_os_init_ptr = + _lookup>('sqlite3_os_init'); + late final _dart_sqlite3_os_init _sqlite3_os_init = + _sqlite3_os_init_ptr.asFunction<_dart_sqlite3_os_init>(); int sqlite3_os_end() { - return (_sqlite3_os_end ??= - _lookup>('sqlite3_os_end') - .asFunction<_dart_sqlite3_os_end>())(); + return _sqlite3_os_end(); } - _dart_sqlite3_os_end? _sqlite3_os_end; + late final _sqlite3_os_end_ptr = + _lookup>('sqlite3_os_end'); + late final _dart_sqlite3_os_end _sqlite3_os_end = + _sqlite3_os_end_ptr.asFunction<_dart_sqlite3_os_end>(); /// CAPI3REF: Configuring The SQLite Library /// @@ -426,14 +442,15 @@ class SQLite { int sqlite3_config( int arg0, ) { - return (_sqlite3_config ??= - _lookup>('sqlite3_config') - .asFunction<_dart_sqlite3_config>())( + return _sqlite3_config( arg0, ); } - _dart_sqlite3_config? _sqlite3_config; + late final _sqlite3_config_ptr = + _lookup>('sqlite3_config'); + late final _dart_sqlite3_config _sqlite3_config = + _sqlite3_config_ptr.asFunction<_dart_sqlite3_config>(); /// CAPI3REF: Configure database connections /// METHOD: sqlite3 @@ -454,15 +471,16 @@ class SQLite { ffi.Pointer arg0, int op, ) { - return (_sqlite3_db_config ??= - _lookup>('sqlite3_db_config') - .asFunction<_dart_sqlite3_db_config>())( + return _sqlite3_db_config( arg0, op, ); } - _dart_sqlite3_db_config? _sqlite3_db_config; + late final _sqlite3_db_config_ptr = + _lookup>('sqlite3_db_config'); + late final _dart_sqlite3_db_config _sqlite3_db_config = + _sqlite3_db_config_ptr.asFunction<_dart_sqlite3_db_config>(); /// CAPI3REF: Enable Or Disable Extended Result Codes /// METHOD: sqlite3 @@ -474,16 +492,18 @@ class SQLite { ffi.Pointer arg0, int onoff, ) { - return (_sqlite3_extended_result_codes ??= - _lookup>( - 'sqlite3_extended_result_codes') - .asFunction<_dart_sqlite3_extended_result_codes>())( + return _sqlite3_extended_result_codes( arg0, onoff, ); } - _dart_sqlite3_extended_result_codes? _sqlite3_extended_result_codes; + late final _sqlite3_extended_result_codes_ptr = + _lookup>( + 'sqlite3_extended_result_codes'); + late final _dart_sqlite3_extended_result_codes + _sqlite3_extended_result_codes = _sqlite3_extended_result_codes_ptr + .asFunction<_dart_sqlite3_extended_result_codes>(); /// CAPI3REF: Last Insert Rowid /// METHOD: sqlite3 @@ -546,15 +566,17 @@ class SQLite { int sqlite3_last_insert_rowid( ffi.Pointer arg0, ) { - return (_sqlite3_last_insert_rowid ??= - _lookup>( - 'sqlite3_last_insert_rowid') - .asFunction<_dart_sqlite3_last_insert_rowid>())( + return _sqlite3_last_insert_rowid( arg0, ); } - _dart_sqlite3_last_insert_rowid? _sqlite3_last_insert_rowid; + late final _sqlite3_last_insert_rowid_ptr = + _lookup>( + 'sqlite3_last_insert_rowid'); + late final _dart_sqlite3_last_insert_rowid _sqlite3_last_insert_rowid = + _sqlite3_last_insert_rowid_ptr + .asFunction<_dart_sqlite3_last_insert_rowid>(); /// CAPI3REF: Set the Last Insert Rowid value. /// METHOD: sqlite3 @@ -566,16 +588,18 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_set_last_insert_rowid ??= - _lookup>( - 'sqlite3_set_last_insert_rowid') - .asFunction<_dart_sqlite3_set_last_insert_rowid>())( + return _sqlite3_set_last_insert_rowid( arg0, arg1, ); } - _dart_sqlite3_set_last_insert_rowid? _sqlite3_set_last_insert_rowid; + late final _sqlite3_set_last_insert_rowid_ptr = + _lookup>( + 'sqlite3_set_last_insert_rowid'); + late final _dart_sqlite3_set_last_insert_rowid + _sqlite3_set_last_insert_rowid = _sqlite3_set_last_insert_rowid_ptr + .asFunction<_dart_sqlite3_set_last_insert_rowid>(); /// CAPI3REF: Count The Number Of Rows Modified /// METHOD: sqlite3 @@ -634,14 +658,15 @@ class SQLite { int sqlite3_changes( ffi.Pointer arg0, ) { - return (_sqlite3_changes ??= - _lookup>('sqlite3_changes') - .asFunction<_dart_sqlite3_changes>())( + return _sqlite3_changes( arg0, ); } - _dart_sqlite3_changes? _sqlite3_changes; + late final _sqlite3_changes_ptr = + _lookup>('sqlite3_changes'); + late final _dart_sqlite3_changes _sqlite3_changes = + _sqlite3_changes_ptr.asFunction<_dart_sqlite3_changes>(); /// CAPI3REF: Total Number Of Rows Modified /// METHOD: sqlite3 @@ -679,15 +704,16 @@ class SQLite { int sqlite3_total_changes( ffi.Pointer arg0, ) { - return (_sqlite3_total_changes ??= - _lookup>( - 'sqlite3_total_changes') - .asFunction<_dart_sqlite3_total_changes>())( + return _sqlite3_total_changes( arg0, ); } - _dart_sqlite3_total_changes? _sqlite3_total_changes; + late final _sqlite3_total_changes_ptr = + _lookup>( + 'sqlite3_total_changes'); + late final _dart_sqlite3_total_changes _sqlite3_total_changes = + _sqlite3_total_changes_ptr.asFunction<_dart_sqlite3_total_changes>(); /// CAPI3REF: Interrupt A Long-Running Query /// METHOD: sqlite3 @@ -725,14 +751,15 @@ class SQLite { void sqlite3_interrupt( ffi.Pointer arg0, ) { - return (_sqlite3_interrupt ??= - _lookup>('sqlite3_interrupt') - .asFunction<_dart_sqlite3_interrupt>())( + return _sqlite3_interrupt( arg0, ); } - _dart_sqlite3_interrupt? _sqlite3_interrupt; + late final _sqlite3_interrupt_ptr = + _lookup>('sqlite3_interrupt'); + late final _dart_sqlite3_interrupt _sqlite3_interrupt = + _sqlite3_interrupt_ptr.asFunction<_dart_sqlite3_interrupt>(); /// CAPI3REF: Determine If An SQL Statement Is Complete /// @@ -768,26 +795,28 @@ class SQLite { int sqlite3_complete( ffi.Pointer sql, ) { - return (_sqlite3_complete ??= - _lookup>('sqlite3_complete') - .asFunction<_dart_sqlite3_complete>())( + return _sqlite3_complete( sql, ); } - _dart_sqlite3_complete? _sqlite3_complete; + late final _sqlite3_complete_ptr = + _lookup>('sqlite3_complete'); + late final _dart_sqlite3_complete _sqlite3_complete = + _sqlite3_complete_ptr.asFunction<_dart_sqlite3_complete>(); int sqlite3_complete16( ffi.Pointer sql, ) { - return (_sqlite3_complete16 ??= - _lookup>('sqlite3_complete16') - .asFunction<_dart_sqlite3_complete16>())( + return _sqlite3_complete16( sql, ); } - _dart_sqlite3_complete16? _sqlite3_complete16; + late final _sqlite3_complete16_ptr = + _lookup>('sqlite3_complete16'); + late final _dart_sqlite3_complete16 _sqlite3_complete16 = + _sqlite3_complete16_ptr.asFunction<_dart_sqlite3_complete16>(); /// CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors /// KEYWORDS: {busy-handler callback} {busy handler} @@ -851,17 +880,18 @@ class SQLite { ffi.Pointer> arg1, ffi.Pointer arg2, ) { - return (_sqlite3_busy_handler ??= - _lookup>( - 'sqlite3_busy_handler') - .asFunction<_dart_sqlite3_busy_handler>())( + return _sqlite3_busy_handler( arg0, arg1, arg2, ); } - _dart_sqlite3_busy_handler? _sqlite3_busy_handler; + late final _sqlite3_busy_handler_ptr = + _lookup>( + 'sqlite3_busy_handler'); + late final _dart_sqlite3_busy_handler _sqlite3_busy_handler = + _sqlite3_busy_handler_ptr.asFunction<_dart_sqlite3_busy_handler>(); /// CAPI3REF: Set A Busy Timeout /// METHOD: sqlite3 @@ -886,16 +916,17 @@ class SQLite { ffi.Pointer arg0, int ms, ) { - return (_sqlite3_busy_timeout ??= - _lookup>( - 'sqlite3_busy_timeout') - .asFunction<_dart_sqlite3_busy_timeout>())( + return _sqlite3_busy_timeout( arg0, ms, ); } - _dart_sqlite3_busy_timeout? _sqlite3_busy_timeout; + late final _sqlite3_busy_timeout_ptr = + _lookup>( + 'sqlite3_busy_timeout'); + late final _dart_sqlite3_busy_timeout _sqlite3_busy_timeout = + _sqlite3_busy_timeout_ptr.asFunction<_dart_sqlite3_busy_timeout>(); /// CAPI3REF: Convenience Routines For Running Queries /// METHOD: sqlite3 @@ -976,9 +1007,7 @@ class SQLite { ffi.Pointer pnColumn, ffi.Pointer> pzErrmsg, ) { - return (_sqlite3_get_table ??= - _lookup>('sqlite3_get_table') - .asFunction<_dart_sqlite3_get_table>())( + return _sqlite3_get_table( db, zSql, pazResult, @@ -988,19 +1017,23 @@ class SQLite { ); } - _dart_sqlite3_get_table? _sqlite3_get_table; + late final _sqlite3_get_table_ptr = + _lookup>('sqlite3_get_table'); + late final _dart_sqlite3_get_table _sqlite3_get_table = + _sqlite3_get_table_ptr.asFunction<_dart_sqlite3_get_table>(); void sqlite3_free_table( ffi.Pointer> result, ) { - return (_sqlite3_free_table ??= - _lookup>('sqlite3_free_table') - .asFunction<_dart_sqlite3_free_table>())( + return _sqlite3_free_table( result, ); } - _dart_sqlite3_free_table? _sqlite3_free_table; + late final _sqlite3_free_table_ptr = + _lookup>('sqlite3_free_table'); + late final _dart_sqlite3_free_table _sqlite3_free_table = + _sqlite3_free_table_ptr.asFunction<_dart_sqlite3_free_table>(); /// CAPI3REF: Formatted String Printing Functions /// @@ -1043,30 +1076,32 @@ class SQLite { ffi.Pointer sqlite3_mprintf( ffi.Pointer arg0, ) { - return (_sqlite3_mprintf ??= - _lookup>('sqlite3_mprintf') - .asFunction<_dart_sqlite3_mprintf>())( + return _sqlite3_mprintf( arg0, ); } - _dart_sqlite3_mprintf? _sqlite3_mprintf; + late final _sqlite3_mprintf_ptr = + _lookup>('sqlite3_mprintf'); + late final _dart_sqlite3_mprintf _sqlite3_mprintf = + _sqlite3_mprintf_ptr.asFunction<_dart_sqlite3_mprintf>(); ffi.Pointer sqlite3_snprintf( int arg0, ffi.Pointer arg1, ffi.Pointer arg2, ) { - return (_sqlite3_snprintf ??= - _lookup>('sqlite3_snprintf') - .asFunction<_dart_sqlite3_snprintf>())( + return _sqlite3_snprintf( arg0, arg1, arg2, ); } - _dart_sqlite3_snprintf? _sqlite3_snprintf; + late final _sqlite3_snprintf_ptr = + _lookup>('sqlite3_snprintf'); + late final _dart_sqlite3_snprintf _sqlite3_snprintf = + _sqlite3_snprintf_ptr.asFunction<_dart_sqlite3_snprintf>(); /// CAPI3REF: Memory Allocation Subsystem /// @@ -1144,78 +1179,84 @@ class SQLite { ffi.Pointer sqlite3_malloc( int arg0, ) { - return (_sqlite3_malloc ??= - _lookup>('sqlite3_malloc') - .asFunction<_dart_sqlite3_malloc>())( + return _sqlite3_malloc( arg0, ); } - _dart_sqlite3_malloc? _sqlite3_malloc; + late final _sqlite3_malloc_ptr = + _lookup>('sqlite3_malloc'); + late final _dart_sqlite3_malloc _sqlite3_malloc = + _sqlite3_malloc_ptr.asFunction<_dart_sqlite3_malloc>(); ffi.Pointer sqlite3_malloc64( int arg0, ) { - return (_sqlite3_malloc64 ??= - _lookup>('sqlite3_malloc64') - .asFunction<_dart_sqlite3_malloc64>())( + return _sqlite3_malloc64( arg0, ); } - _dart_sqlite3_malloc64? _sqlite3_malloc64; + late final _sqlite3_malloc64_ptr = + _lookup>('sqlite3_malloc64'); + late final _dart_sqlite3_malloc64 _sqlite3_malloc64 = + _sqlite3_malloc64_ptr.asFunction<_dart_sqlite3_malloc64>(); ffi.Pointer sqlite3_realloc( ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_realloc ??= - _lookup>('sqlite3_realloc') - .asFunction<_dart_sqlite3_realloc>())( + return _sqlite3_realloc( arg0, arg1, ); } - _dart_sqlite3_realloc? _sqlite3_realloc; + late final _sqlite3_realloc_ptr = + _lookup>('sqlite3_realloc'); + late final _dart_sqlite3_realloc _sqlite3_realloc = + _sqlite3_realloc_ptr.asFunction<_dart_sqlite3_realloc>(); ffi.Pointer sqlite3_realloc64( ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_realloc64 ??= - _lookup>('sqlite3_realloc64') - .asFunction<_dart_sqlite3_realloc64>())( + return _sqlite3_realloc64( arg0, arg1, ); } - _dart_sqlite3_realloc64? _sqlite3_realloc64; + late final _sqlite3_realloc64_ptr = + _lookup>('sqlite3_realloc64'); + late final _dart_sqlite3_realloc64 _sqlite3_realloc64 = + _sqlite3_realloc64_ptr.asFunction<_dart_sqlite3_realloc64>(); void sqlite3_free( ffi.Pointer arg0, ) { - return (_sqlite3_free ??= - _lookup>('sqlite3_free') - .asFunction<_dart_sqlite3_free>())( + return _sqlite3_free( arg0, ); } - _dart_sqlite3_free? _sqlite3_free; + late final _sqlite3_free_ptr = + _lookup>('sqlite3_free'); + late final _dart_sqlite3_free _sqlite3_free = + _sqlite3_free_ptr.asFunction<_dart_sqlite3_free>(); int sqlite3_msize( ffi.Pointer arg0, ) { - return (_sqlite3_msize ??= - _lookup>('sqlite3_msize') - .asFunction<_dart_sqlite3_msize>())( + return _sqlite3_msize( arg0, ); } - _dart_sqlite3_msize? _sqlite3_msize; + late final _sqlite3_msize_ptr = + _lookup>('sqlite3_msize'); + late final _dart_sqlite3_msize _sqlite3_msize = + _sqlite3_msize_ptr.asFunction<_dart_sqlite3_msize>(); /// CAPI3REF: Memory Allocator Statistics /// @@ -1239,26 +1280,29 @@ class SQLite { /// by [sqlite3_memory_highwater(1)] is the high-water mark /// prior to the reset. int sqlite3_memory_used() { - return (_sqlite3_memory_used ??= - _lookup>( - 'sqlite3_memory_used') - .asFunction<_dart_sqlite3_memory_used>())(); + return _sqlite3_memory_used(); } - _dart_sqlite3_memory_used? _sqlite3_memory_used; + late final _sqlite3_memory_used_ptr = + _lookup>( + 'sqlite3_memory_used'); + late final _dart_sqlite3_memory_used _sqlite3_memory_used = + _sqlite3_memory_used_ptr.asFunction<_dart_sqlite3_memory_used>(); int sqlite3_memory_highwater( int resetFlag, ) { - return (_sqlite3_memory_highwater ??= - _lookup>( - 'sqlite3_memory_highwater') - .asFunction<_dart_sqlite3_memory_highwater>())( + return _sqlite3_memory_highwater( resetFlag, ); } - _dart_sqlite3_memory_highwater? _sqlite3_memory_highwater; + late final _sqlite3_memory_highwater_ptr = + _lookup>( + 'sqlite3_memory_highwater'); + late final _dart_sqlite3_memory_highwater _sqlite3_memory_highwater = + _sqlite3_memory_highwater_ptr + .asFunction<_dart_sqlite3_memory_highwater>(); /// CAPI3REF: Pseudo-Random Number Generator /// @@ -1283,15 +1327,16 @@ class SQLite { int N, ffi.Pointer P, ) { - return (_sqlite3_randomness ??= - _lookup>('sqlite3_randomness') - .asFunction<_dart_sqlite3_randomness>())( + return _sqlite3_randomness( N, P, ); } - _dart_sqlite3_randomness? _sqlite3_randomness; + late final _sqlite3_randomness_ptr = + _lookup>('sqlite3_randomness'); + late final _dart_sqlite3_randomness _sqlite3_randomness = + _sqlite3_randomness_ptr.asFunction<_dart_sqlite3_randomness>(); /// CAPI3REF: Compile-Time Authorization Callbacks /// METHOD: sqlite3 @@ -1385,17 +1430,18 @@ class SQLite { ffi.Pointer> xAuth, ffi.Pointer pUserData, ) { - return (_sqlite3_set_authorizer ??= - _lookup>( - 'sqlite3_set_authorizer') - .asFunction<_dart_sqlite3_set_authorizer>())( + return _sqlite3_set_authorizer( arg0, xAuth, pUserData, ); } - _dart_sqlite3_set_authorizer? _sqlite3_set_authorizer; + late final _sqlite3_set_authorizer_ptr = + _lookup>( + 'sqlite3_set_authorizer'); + late final _dart_sqlite3_set_authorizer _sqlite3_set_authorizer = + _sqlite3_set_authorizer_ptr.asFunction<_dart_sqlite3_set_authorizer>(); /// CAPI3REF: Tracing And Profiling Functions /// METHOD: sqlite3 @@ -1432,32 +1478,34 @@ class SQLite { ffi.Pointer> xTrace, ffi.Pointer arg2, ) { - return (_sqlite3_trace ??= - _lookup>('sqlite3_trace') - .asFunction<_dart_sqlite3_trace>())( + return _sqlite3_trace( arg0, xTrace, arg2, ); } - _dart_sqlite3_trace? _sqlite3_trace; + late final _sqlite3_trace_ptr = + _lookup>('sqlite3_trace'); + late final _dart_sqlite3_trace _sqlite3_trace = + _sqlite3_trace_ptr.asFunction<_dart_sqlite3_trace>(); ffi.Pointer sqlite3_profile( ffi.Pointer arg0, ffi.Pointer> xProfile, ffi.Pointer arg2, ) { - return (_sqlite3_profile ??= - _lookup>('sqlite3_profile') - .asFunction<_dart_sqlite3_profile>())( + return _sqlite3_profile( arg0, xProfile, arg2, ); } - _dart_sqlite3_profile? _sqlite3_profile; + late final _sqlite3_profile_ptr = + _lookup>('sqlite3_profile'); + late final _dart_sqlite3_profile _sqlite3_profile = + _sqlite3_profile_ptr.asFunction<_dart_sqlite3_profile>(); /// CAPI3REF: SQL Trace Hook /// METHOD: sqlite3 @@ -1492,9 +1540,7 @@ class SQLite { ffi.Pointer> xCallback, ffi.Pointer pCtx, ) { - return (_sqlite3_trace_v2 ??= - _lookup>('sqlite3_trace_v2') - .asFunction<_dart_sqlite3_trace_v2>())( + return _sqlite3_trace_v2( arg0, uMask, xCallback, @@ -1502,7 +1548,10 @@ class SQLite { ); } - _dart_sqlite3_trace_v2? _sqlite3_trace_v2; + late final _sqlite3_trace_v2_ptr = + _lookup>('sqlite3_trace_v2'); + late final _dart_sqlite3_trace_v2 _sqlite3_trace_v2 = + _sqlite3_trace_v2_ptr.asFunction<_dart_sqlite3_trace_v2>(); /// CAPI3REF: Query Progress Callbacks /// METHOD: sqlite3 @@ -1539,10 +1588,7 @@ class SQLite { ffi.Pointer> arg2, ffi.Pointer arg3, ) { - return (_sqlite3_progress_handler ??= - _lookup>( - 'sqlite3_progress_handler') - .asFunction<_dart_sqlite3_progress_handler>())( + return _sqlite3_progress_handler( arg0, arg1, arg2, @@ -1550,7 +1596,12 @@ class SQLite { ); } - _dart_sqlite3_progress_handler? _sqlite3_progress_handler; + late final _sqlite3_progress_handler_ptr = + _lookup>( + 'sqlite3_progress_handler'); + late final _dart_sqlite3_progress_handler _sqlite3_progress_handler = + _sqlite3_progress_handler_ptr + .asFunction<_dart_sqlite3_progress_handler>(); /// CAPI3REF: Opening A New Database Connection /// CONSTRUCTOR: sqlite3 @@ -1807,29 +1858,31 @@ class SQLite { ffi.Pointer filename, ffi.Pointer> ppDb, ) { - return (_sqlite3_open ??= - _lookup>('sqlite3_open') - .asFunction<_dart_sqlite3_open>())( + return _sqlite3_open( filename, ppDb, ); } - _dart_sqlite3_open? _sqlite3_open; + late final _sqlite3_open_ptr = + _lookup>('sqlite3_open'); + late final _dart_sqlite3_open _sqlite3_open = + _sqlite3_open_ptr.asFunction<_dart_sqlite3_open>(); int sqlite3_open16( ffi.Pointer filename, ffi.Pointer> ppDb, ) { - return (_sqlite3_open16 ??= - _lookup>('sqlite3_open16') - .asFunction<_dart_sqlite3_open16>())( + return _sqlite3_open16( filename, ppDb, ); } - _dart_sqlite3_open16? _sqlite3_open16; + late final _sqlite3_open16_ptr = + _lookup>('sqlite3_open16'); + late final _dart_sqlite3_open16 _sqlite3_open16 = + _sqlite3_open16_ptr.asFunction<_dart_sqlite3_open16>(); int sqlite3_open_v2( ffi.Pointer filename, @@ -1837,9 +1890,7 @@ class SQLite { int flags, ffi.Pointer zVfs, ) { - return (_sqlite3_open_v2 ??= - _lookup>('sqlite3_open_v2') - .asFunction<_dart_sqlite3_open_v2>())( + return _sqlite3_open_v2( filename, ppDb, flags, @@ -1847,7 +1898,10 @@ class SQLite { ); } - _dart_sqlite3_open_v2? _sqlite3_open_v2; + late final _sqlite3_open_v2_ptr = + _lookup>('sqlite3_open_v2'); + late final _dart_sqlite3_open_v2 _sqlite3_open_v2 = + _sqlite3_open_v2_ptr.asFunction<_dart_sqlite3_open_v2>(); /// CAPI3REF: Obtain Values For URI Parameters /// @@ -1917,63 +1971,67 @@ class SQLite { ffi.Pointer zFilename, ffi.Pointer zParam, ) { - return (_sqlite3_uri_parameter ??= - _lookup>( - 'sqlite3_uri_parameter') - .asFunction<_dart_sqlite3_uri_parameter>())( + return _sqlite3_uri_parameter( zFilename, zParam, ); } - _dart_sqlite3_uri_parameter? _sqlite3_uri_parameter; + late final _sqlite3_uri_parameter_ptr = + _lookup>( + 'sqlite3_uri_parameter'); + late final _dart_sqlite3_uri_parameter _sqlite3_uri_parameter = + _sqlite3_uri_parameter_ptr.asFunction<_dart_sqlite3_uri_parameter>(); int sqlite3_uri_boolean( ffi.Pointer zFile, ffi.Pointer zParam, int bDefault, ) { - return (_sqlite3_uri_boolean ??= - _lookup>( - 'sqlite3_uri_boolean') - .asFunction<_dart_sqlite3_uri_boolean>())( + return _sqlite3_uri_boolean( zFile, zParam, bDefault, ); } - _dart_sqlite3_uri_boolean? _sqlite3_uri_boolean; + late final _sqlite3_uri_boolean_ptr = + _lookup>( + 'sqlite3_uri_boolean'); + late final _dart_sqlite3_uri_boolean _sqlite3_uri_boolean = + _sqlite3_uri_boolean_ptr.asFunction<_dart_sqlite3_uri_boolean>(); int sqlite3_uri_int64( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, ) { - return (_sqlite3_uri_int64 ??= - _lookup>('sqlite3_uri_int64') - .asFunction<_dart_sqlite3_uri_int64>())( + return _sqlite3_uri_int64( arg0, arg1, arg2, ); } - _dart_sqlite3_uri_int64? _sqlite3_uri_int64; + late final _sqlite3_uri_int64_ptr = + _lookup>('sqlite3_uri_int64'); + late final _dart_sqlite3_uri_int64 _sqlite3_uri_int64 = + _sqlite3_uri_int64_ptr.asFunction<_dart_sqlite3_uri_int64>(); ffi.Pointer sqlite3_uri_key( ffi.Pointer zFilename, int N, ) { - return (_sqlite3_uri_key ??= - _lookup>('sqlite3_uri_key') - .asFunction<_dart_sqlite3_uri_key>())( + return _sqlite3_uri_key( zFilename, N, ); } - _dart_sqlite3_uri_key? _sqlite3_uri_key; + late final _sqlite3_uri_key_ptr = + _lookup>('sqlite3_uri_key'); + late final _dart_sqlite3_uri_key _sqlite3_uri_key = + _sqlite3_uri_key_ptr.asFunction<_dart_sqlite3_uri_key>(); /// CAPI3REF: Translate filenames /// @@ -2003,41 +2061,46 @@ class SQLite { ffi.Pointer sqlite3_filename_database( ffi.Pointer arg0, ) { - return (_sqlite3_filename_database ??= - _lookup>( - 'sqlite3_filename_database') - .asFunction<_dart_sqlite3_filename_database>())( + return _sqlite3_filename_database( arg0, ); } - _dart_sqlite3_filename_database? _sqlite3_filename_database; + late final _sqlite3_filename_database_ptr = + _lookup>( + 'sqlite3_filename_database'); + late final _dart_sqlite3_filename_database _sqlite3_filename_database = + _sqlite3_filename_database_ptr + .asFunction<_dart_sqlite3_filename_database>(); ffi.Pointer sqlite3_filename_journal( ffi.Pointer arg0, ) { - return (_sqlite3_filename_journal ??= - _lookup>( - 'sqlite3_filename_journal') - .asFunction<_dart_sqlite3_filename_journal>())( + return _sqlite3_filename_journal( arg0, ); } - _dart_sqlite3_filename_journal? _sqlite3_filename_journal; + late final _sqlite3_filename_journal_ptr = + _lookup>( + 'sqlite3_filename_journal'); + late final _dart_sqlite3_filename_journal _sqlite3_filename_journal = + _sqlite3_filename_journal_ptr + .asFunction<_dart_sqlite3_filename_journal>(); ffi.Pointer sqlite3_filename_wal( ffi.Pointer arg0, ) { - return (_sqlite3_filename_wal ??= - _lookup>( - 'sqlite3_filename_wal') - .asFunction<_dart_sqlite3_filename_wal>())( + return _sqlite3_filename_wal( arg0, ); } - _dart_sqlite3_filename_wal? _sqlite3_filename_wal; + late final _sqlite3_filename_wal_ptr = + _lookup>( + 'sqlite3_filename_wal'); + late final _dart_sqlite3_filename_wal _sqlite3_filename_wal = + _sqlite3_filename_wal_ptr.asFunction<_dart_sqlite3_filename_wal>(); /// CAPI3REF: Database File Corresponding To A Journal /// @@ -2057,15 +2120,17 @@ class SQLite { ffi.Pointer sqlite3_database_file_object( ffi.Pointer arg0, ) { - return (_sqlite3_database_file_object ??= - _lookup>( - 'sqlite3_database_file_object') - .asFunction<_dart_sqlite3_database_file_object>())( + return _sqlite3_database_file_object( arg0, ); } - _dart_sqlite3_database_file_object? _sqlite3_database_file_object; + late final _sqlite3_database_file_object_ptr = + _lookup>( + 'sqlite3_database_file_object'); + late final _dart_sqlite3_database_file_object _sqlite3_database_file_object = + _sqlite3_database_file_object_ptr + .asFunction<_dart_sqlite3_database_file_object>(); /// CAPI3REF: Create and Destroy VFS Filenames /// @@ -2117,10 +2182,7 @@ class SQLite { int nParam, ffi.Pointer> azParam, ) { - return (_sqlite3_create_filename ??= - _lookup>( - 'sqlite3_create_filename') - .asFunction<_dart_sqlite3_create_filename>())( + return _sqlite3_create_filename( zDatabase, zJournal, zWal, @@ -2129,20 +2191,25 @@ class SQLite { ); } - _dart_sqlite3_create_filename? _sqlite3_create_filename; + late final _sqlite3_create_filename_ptr = + _lookup>( + 'sqlite3_create_filename'); + late final _dart_sqlite3_create_filename _sqlite3_create_filename = + _sqlite3_create_filename_ptr.asFunction<_dart_sqlite3_create_filename>(); void sqlite3_free_filename( ffi.Pointer arg0, ) { - return (_sqlite3_free_filename ??= - _lookup>( - 'sqlite3_free_filename') - .asFunction<_dart_sqlite3_free_filename>())( + return _sqlite3_free_filename( arg0, ); } - _dart_sqlite3_free_filename? _sqlite3_free_filename; + late final _sqlite3_free_filename_ptr = + _lookup>( + 'sqlite3_free_filename'); + late final _dart_sqlite3_free_filename _sqlite3_free_filename = + _sqlite3_free_filename_ptr.asFunction<_dart_sqlite3_free_filename>(); /// CAPI3REF: Error Codes And Messages /// METHOD: sqlite3 @@ -2197,63 +2264,69 @@ class SQLite { int sqlite3_errcode( ffi.Pointer db, ) { - return (_sqlite3_errcode ??= - _lookup>('sqlite3_errcode') - .asFunction<_dart_sqlite3_errcode>())( + return _sqlite3_errcode( db, ); } - _dart_sqlite3_errcode? _sqlite3_errcode; + late final _sqlite3_errcode_ptr = + _lookup>('sqlite3_errcode'); + late final _dart_sqlite3_errcode _sqlite3_errcode = + _sqlite3_errcode_ptr.asFunction<_dart_sqlite3_errcode>(); int sqlite3_extended_errcode( ffi.Pointer db, ) { - return (_sqlite3_extended_errcode ??= - _lookup>( - 'sqlite3_extended_errcode') - .asFunction<_dart_sqlite3_extended_errcode>())( + return _sqlite3_extended_errcode( db, ); } - _dart_sqlite3_extended_errcode? _sqlite3_extended_errcode; + late final _sqlite3_extended_errcode_ptr = + _lookup>( + 'sqlite3_extended_errcode'); + late final _dart_sqlite3_extended_errcode _sqlite3_extended_errcode = + _sqlite3_extended_errcode_ptr + .asFunction<_dart_sqlite3_extended_errcode>(); ffi.Pointer sqlite3_errmsg( ffi.Pointer arg0, ) { - return (_sqlite3_errmsg ??= - _lookup>('sqlite3_errmsg') - .asFunction<_dart_sqlite3_errmsg>())( + return _sqlite3_errmsg( arg0, ); } - _dart_sqlite3_errmsg? _sqlite3_errmsg; + late final _sqlite3_errmsg_ptr = + _lookup>('sqlite3_errmsg'); + late final _dart_sqlite3_errmsg _sqlite3_errmsg = + _sqlite3_errmsg_ptr.asFunction<_dart_sqlite3_errmsg>(); ffi.Pointer sqlite3_errmsg16( ffi.Pointer arg0, ) { - return (_sqlite3_errmsg16 ??= - _lookup>('sqlite3_errmsg16') - .asFunction<_dart_sqlite3_errmsg16>())( + return _sqlite3_errmsg16( arg0, ); } - _dart_sqlite3_errmsg16? _sqlite3_errmsg16; + late final _sqlite3_errmsg16_ptr = + _lookup>('sqlite3_errmsg16'); + late final _dart_sqlite3_errmsg16 _sqlite3_errmsg16 = + _sqlite3_errmsg16_ptr.asFunction<_dart_sqlite3_errmsg16>(); ffi.Pointer sqlite3_errstr( int arg0, ) { - return (_sqlite3_errstr ??= - _lookup>('sqlite3_errstr') - .asFunction<_dart_sqlite3_errstr>())( + return _sqlite3_errstr( arg0, ); } - _dart_sqlite3_errstr? _sqlite3_errstr; + late final _sqlite3_errstr_ptr = + _lookup>('sqlite3_errstr'); + late final _dart_sqlite3_errstr _sqlite3_errstr = + _sqlite3_errstr_ptr.asFunction<_dart_sqlite3_errstr>(); /// CAPI3REF: Run-time Limits /// METHOD: sqlite3 @@ -2298,16 +2371,17 @@ class SQLite { int id, int newVal, ) { - return (_sqlite3_limit ??= - _lookup>('sqlite3_limit') - .asFunction<_dart_sqlite3_limit>())( + return _sqlite3_limit( arg0, id, newVal, ); } - _dart_sqlite3_limit? _sqlite3_limit; + late final _sqlite3_limit_ptr = + _lookup>('sqlite3_limit'); + late final _dart_sqlite3_limit _sqlite3_limit = + _sqlite3_limit_ptr.asFunction<_dart_sqlite3_limit>(); /// CAPI3REF: Compiling An SQL Statement /// KEYWORDS: {SQL statement compiler} @@ -2414,9 +2488,7 @@ class SQLite { ffi.Pointer> ppStmt, ffi.Pointer> pzTail, ) { - return (_sqlite3_prepare ??= - _lookup>('sqlite3_prepare') - .asFunction<_dart_sqlite3_prepare>())( + return _sqlite3_prepare( db, zSql, nByte, @@ -2425,7 +2497,10 @@ class SQLite { ); } - _dart_sqlite3_prepare? _sqlite3_prepare; + late final _sqlite3_prepare_ptr = + _lookup>('sqlite3_prepare'); + late final _dart_sqlite3_prepare _sqlite3_prepare = + _sqlite3_prepare_ptr.asFunction<_dart_sqlite3_prepare>(); int sqlite3_prepare_v2( ffi.Pointer db, @@ -2434,9 +2509,7 @@ class SQLite { ffi.Pointer> ppStmt, ffi.Pointer> pzTail, ) { - return (_sqlite3_prepare_v2 ??= - _lookup>('sqlite3_prepare_v2') - .asFunction<_dart_sqlite3_prepare_v2>())( + return _sqlite3_prepare_v2( db, zSql, nByte, @@ -2445,7 +2518,10 @@ class SQLite { ); } - _dart_sqlite3_prepare_v2? _sqlite3_prepare_v2; + late final _sqlite3_prepare_v2_ptr = + _lookup>('sqlite3_prepare_v2'); + late final _dart_sqlite3_prepare_v2 _sqlite3_prepare_v2 = + _sqlite3_prepare_v2_ptr.asFunction<_dart_sqlite3_prepare_v2>(); int sqlite3_prepare_v3( ffi.Pointer db, @@ -2455,9 +2531,7 @@ class SQLite { ffi.Pointer> ppStmt, ffi.Pointer> pzTail, ) { - return (_sqlite3_prepare_v3 ??= - _lookup>('sqlite3_prepare_v3') - .asFunction<_dart_sqlite3_prepare_v3>())( + return _sqlite3_prepare_v3( db, zSql, nByte, @@ -2467,7 +2541,10 @@ class SQLite { ); } - _dart_sqlite3_prepare_v3? _sqlite3_prepare_v3; + late final _sqlite3_prepare_v3_ptr = + _lookup>('sqlite3_prepare_v3'); + late final _dart_sqlite3_prepare_v3 _sqlite3_prepare_v3 = + _sqlite3_prepare_v3_ptr.asFunction<_dart_sqlite3_prepare_v3>(); int sqlite3_prepare16( ffi.Pointer db, @@ -2476,9 +2553,7 @@ class SQLite { ffi.Pointer> ppStmt, ffi.Pointer> pzTail, ) { - return (_sqlite3_prepare16 ??= - _lookup>('sqlite3_prepare16') - .asFunction<_dart_sqlite3_prepare16>())( + return _sqlite3_prepare16( db, zSql, nByte, @@ -2487,7 +2562,10 @@ class SQLite { ); } - _dart_sqlite3_prepare16? _sqlite3_prepare16; + late final _sqlite3_prepare16_ptr = + _lookup>('sqlite3_prepare16'); + late final _dart_sqlite3_prepare16 _sqlite3_prepare16 = + _sqlite3_prepare16_ptr.asFunction<_dart_sqlite3_prepare16>(); int sqlite3_prepare16_v2( ffi.Pointer db, @@ -2496,10 +2574,7 @@ class SQLite { ffi.Pointer> ppStmt, ffi.Pointer> pzTail, ) { - return (_sqlite3_prepare16_v2 ??= - _lookup>( - 'sqlite3_prepare16_v2') - .asFunction<_dart_sqlite3_prepare16_v2>())( + return _sqlite3_prepare16_v2( db, zSql, nByte, @@ -2508,7 +2583,11 @@ class SQLite { ); } - _dart_sqlite3_prepare16_v2? _sqlite3_prepare16_v2; + late final _sqlite3_prepare16_v2_ptr = + _lookup>( + 'sqlite3_prepare16_v2'); + late final _dart_sqlite3_prepare16_v2 _sqlite3_prepare16_v2 = + _sqlite3_prepare16_v2_ptr.asFunction<_dart_sqlite3_prepare16_v2>(); int sqlite3_prepare16_v3( ffi.Pointer db, @@ -2518,10 +2597,7 @@ class SQLite { ffi.Pointer> ppStmt, ffi.Pointer> pzTail, ) { - return (_sqlite3_prepare16_v3 ??= - _lookup>( - 'sqlite3_prepare16_v3') - .asFunction<_dart_sqlite3_prepare16_v3>())( + return _sqlite3_prepare16_v3( db, zSql, nByte, @@ -2531,7 +2607,11 @@ class SQLite { ); } - _dart_sqlite3_prepare16_v3? _sqlite3_prepare16_v3; + late final _sqlite3_prepare16_v3_ptr = + _lookup>( + 'sqlite3_prepare16_v3'); + late final _dart_sqlite3_prepare16_v3 _sqlite3_prepare16_v3 = + _sqlite3_prepare16_v3_ptr.asFunction<_dart_sqlite3_prepare16_v3>(); /// CAPI3REF: Retrieving Statement SQL /// METHOD: sqlite3_stmt @@ -2572,40 +2652,43 @@ class SQLite { ffi.Pointer sqlite3_sql( ffi.Pointer pStmt, ) { - return (_sqlite3_sql ??= - _lookup>('sqlite3_sql') - .asFunction<_dart_sqlite3_sql>())( + return _sqlite3_sql( pStmt, ); } - _dart_sqlite3_sql? _sqlite3_sql; + late final _sqlite3_sql_ptr = + _lookup>('sqlite3_sql'); + late final _dart_sqlite3_sql _sqlite3_sql = + _sqlite3_sql_ptr.asFunction<_dart_sqlite3_sql>(); ffi.Pointer sqlite3_expanded_sql( ffi.Pointer pStmt, ) { - return (_sqlite3_expanded_sql ??= - _lookup>( - 'sqlite3_expanded_sql') - .asFunction<_dart_sqlite3_expanded_sql>())( + return _sqlite3_expanded_sql( pStmt, ); } - _dart_sqlite3_expanded_sql? _sqlite3_expanded_sql; + late final _sqlite3_expanded_sql_ptr = + _lookup>( + 'sqlite3_expanded_sql'); + late final _dart_sqlite3_expanded_sql _sqlite3_expanded_sql = + _sqlite3_expanded_sql_ptr.asFunction<_dart_sqlite3_expanded_sql>(); ffi.Pointer sqlite3_normalized_sql( ffi.Pointer pStmt, ) { - return (_sqlite3_normalized_sql ??= - _lookup>( - 'sqlite3_normalized_sql') - .asFunction<_dart_sqlite3_normalized_sql>())( + return _sqlite3_normalized_sql( pStmt, ); } - _dart_sqlite3_normalized_sql? _sqlite3_normalized_sql; + late final _sqlite3_normalized_sql_ptr = + _lookup>( + 'sqlite3_normalized_sql'); + late final _dart_sqlite3_normalized_sql _sqlite3_normalized_sql = + _sqlite3_normalized_sql_ptr.asFunction<_dart_sqlite3_normalized_sql>(); /// CAPI3REF: Determine If An SQL Statement Writes The Database /// METHOD: sqlite3_stmt @@ -2642,15 +2725,16 @@ class SQLite { int sqlite3_stmt_readonly( ffi.Pointer pStmt, ) { - return (_sqlite3_stmt_readonly ??= - _lookup>( - 'sqlite3_stmt_readonly') - .asFunction<_dart_sqlite3_stmt_readonly>())( + return _sqlite3_stmt_readonly( pStmt, ); } - _dart_sqlite3_stmt_readonly? _sqlite3_stmt_readonly; + late final _sqlite3_stmt_readonly_ptr = + _lookup>( + 'sqlite3_stmt_readonly'); + late final _dart_sqlite3_stmt_readonly _sqlite3_stmt_readonly = + _sqlite3_stmt_readonly_ptr.asFunction<_dart_sqlite3_stmt_readonly>(); /// CAPI3REF: Query The EXPLAIN Setting For A Prepared Statement /// METHOD: sqlite3_stmt @@ -2663,15 +2747,16 @@ class SQLite { int sqlite3_stmt_isexplain( ffi.Pointer pStmt, ) { - return (_sqlite3_stmt_isexplain ??= - _lookup>( - 'sqlite3_stmt_isexplain') - .asFunction<_dart_sqlite3_stmt_isexplain>())( + return _sqlite3_stmt_isexplain( pStmt, ); } - _dart_sqlite3_stmt_isexplain? _sqlite3_stmt_isexplain; + late final _sqlite3_stmt_isexplain_ptr = + _lookup>( + 'sqlite3_stmt_isexplain'); + late final _dart_sqlite3_stmt_isexplain _sqlite3_stmt_isexplain = + _sqlite3_stmt_isexplain_ptr.asFunction<_dart_sqlite3_stmt_isexplain>(); /// CAPI3REF: Determine If A Prepared Statement Has Been Reset /// METHOD: sqlite3_stmt @@ -2693,14 +2778,15 @@ class SQLite { int sqlite3_stmt_busy( ffi.Pointer arg0, ) { - return (_sqlite3_stmt_busy ??= - _lookup>('sqlite3_stmt_busy') - .asFunction<_dart_sqlite3_stmt_busy>())( + return _sqlite3_stmt_busy( arg0, ); } - _dart_sqlite3_stmt_busy? _sqlite3_stmt_busy; + late final _sqlite3_stmt_busy_ptr = + _lookup>('sqlite3_stmt_busy'); + late final _dart_sqlite3_stmt_busy _sqlite3_stmt_busy = + _sqlite3_stmt_busy_ptr.asFunction<_dart_sqlite3_stmt_busy>(); /// CAPI3REF: Binding Values To Prepared Statements /// KEYWORDS: {host parameter} {host parameters} {host parameter name} @@ -2843,9 +2929,7 @@ class SQLite { int n, ffi.Pointer> arg4, ) { - return (_sqlite3_bind_blob ??= - _lookup>('sqlite3_bind_blob') - .asFunction<_dart_sqlite3_bind_blob>())( + return _sqlite3_bind_blob( arg0, arg1, arg2, @@ -2854,7 +2938,10 @@ class SQLite { ); } - _dart_sqlite3_bind_blob? _sqlite3_bind_blob; + late final _sqlite3_bind_blob_ptr = + _lookup>('sqlite3_bind_blob'); + late final _dart_sqlite3_bind_blob _sqlite3_bind_blob = + _sqlite3_bind_blob_ptr.asFunction<_dart_sqlite3_bind_blob>(); int sqlite3_bind_blob64( ffi.Pointer arg0, @@ -2863,10 +2950,7 @@ class SQLite { int arg3, ffi.Pointer> arg4, ) { - return (_sqlite3_bind_blob64 ??= - _lookup>( - 'sqlite3_bind_blob64') - .asFunction<_dart_sqlite3_bind_blob64>())( + return _sqlite3_bind_blob64( arg0, arg1, arg2, @@ -2875,70 +2959,78 @@ class SQLite { ); } - _dart_sqlite3_bind_blob64? _sqlite3_bind_blob64; + late final _sqlite3_bind_blob64_ptr = + _lookup>( + 'sqlite3_bind_blob64'); + late final _dart_sqlite3_bind_blob64 _sqlite3_bind_blob64 = + _sqlite3_bind_blob64_ptr.asFunction<_dart_sqlite3_bind_blob64>(); int sqlite3_bind_double( ffi.Pointer arg0, int arg1, double arg2, ) { - return (_sqlite3_bind_double ??= - _lookup>( - 'sqlite3_bind_double') - .asFunction<_dart_sqlite3_bind_double>())( + return _sqlite3_bind_double( arg0, arg1, arg2, ); } - _dart_sqlite3_bind_double? _sqlite3_bind_double; + late final _sqlite3_bind_double_ptr = + _lookup>( + 'sqlite3_bind_double'); + late final _dart_sqlite3_bind_double _sqlite3_bind_double = + _sqlite3_bind_double_ptr.asFunction<_dart_sqlite3_bind_double>(); int sqlite3_bind_int( ffi.Pointer arg0, int arg1, int arg2, ) { - return (_sqlite3_bind_int ??= - _lookup>('sqlite3_bind_int') - .asFunction<_dart_sqlite3_bind_int>())( + return _sqlite3_bind_int( arg0, arg1, arg2, ); } - _dart_sqlite3_bind_int? _sqlite3_bind_int; + late final _sqlite3_bind_int_ptr = + _lookup>('sqlite3_bind_int'); + late final _dart_sqlite3_bind_int _sqlite3_bind_int = + _sqlite3_bind_int_ptr.asFunction<_dart_sqlite3_bind_int>(); int sqlite3_bind_int64( ffi.Pointer arg0, int arg1, int arg2, ) { - return (_sqlite3_bind_int64 ??= - _lookup>('sqlite3_bind_int64') - .asFunction<_dart_sqlite3_bind_int64>())( + return _sqlite3_bind_int64( arg0, arg1, arg2, ); } - _dart_sqlite3_bind_int64? _sqlite3_bind_int64; + late final _sqlite3_bind_int64_ptr = + _lookup>('sqlite3_bind_int64'); + late final _dart_sqlite3_bind_int64 _sqlite3_bind_int64 = + _sqlite3_bind_int64_ptr.asFunction<_dart_sqlite3_bind_int64>(); int sqlite3_bind_null( ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_bind_null ??= - _lookup>('sqlite3_bind_null') - .asFunction<_dart_sqlite3_bind_null>())( + return _sqlite3_bind_null( arg0, arg1, ); } - _dart_sqlite3_bind_null? _sqlite3_bind_null; + late final _sqlite3_bind_null_ptr = + _lookup>('sqlite3_bind_null'); + late final _dart_sqlite3_bind_null _sqlite3_bind_null = + _sqlite3_bind_null_ptr.asFunction<_dart_sqlite3_bind_null>(); int sqlite3_bind_text( ffi.Pointer arg0, @@ -2947,9 +3039,7 @@ class SQLite { int arg3, ffi.Pointer> arg4, ) { - return (_sqlite3_bind_text ??= - _lookup>('sqlite3_bind_text') - .asFunction<_dart_sqlite3_bind_text>())( + return _sqlite3_bind_text( arg0, arg1, arg2, @@ -2958,7 +3048,10 @@ class SQLite { ); } - _dart_sqlite3_bind_text? _sqlite3_bind_text; + late final _sqlite3_bind_text_ptr = + _lookup>('sqlite3_bind_text'); + late final _dart_sqlite3_bind_text _sqlite3_bind_text = + _sqlite3_bind_text_ptr.asFunction<_dart_sqlite3_bind_text>(); int sqlite3_bind_text16( ffi.Pointer arg0, @@ -2967,10 +3060,7 @@ class SQLite { int arg3, ffi.Pointer> arg4, ) { - return (_sqlite3_bind_text16 ??= - _lookup>( - 'sqlite3_bind_text16') - .asFunction<_dart_sqlite3_bind_text16>())( + return _sqlite3_bind_text16( arg0, arg1, arg2, @@ -2979,7 +3069,11 @@ class SQLite { ); } - _dart_sqlite3_bind_text16? _sqlite3_bind_text16; + late final _sqlite3_bind_text16_ptr = + _lookup>( + 'sqlite3_bind_text16'); + late final _dart_sqlite3_bind_text16 _sqlite3_bind_text16 = + _sqlite3_bind_text16_ptr.asFunction<_dart_sqlite3_bind_text16>(); int sqlite3_bind_text64( ffi.Pointer arg0, @@ -2989,10 +3083,7 @@ class SQLite { ffi.Pointer> arg4, int encoding, ) { - return (_sqlite3_bind_text64 ??= - _lookup>( - 'sqlite3_bind_text64') - .asFunction<_dart_sqlite3_bind_text64>())( + return _sqlite3_bind_text64( arg0, arg1, arg2, @@ -3002,23 +3093,28 @@ class SQLite { ); } - _dart_sqlite3_bind_text64? _sqlite3_bind_text64; + late final _sqlite3_bind_text64_ptr = + _lookup>( + 'sqlite3_bind_text64'); + late final _dart_sqlite3_bind_text64 _sqlite3_bind_text64 = + _sqlite3_bind_text64_ptr.asFunction<_dart_sqlite3_bind_text64>(); int sqlite3_bind_value( ffi.Pointer arg0, int arg1, ffi.Pointer arg2, ) { - return (_sqlite3_bind_value ??= - _lookup>('sqlite3_bind_value') - .asFunction<_dart_sqlite3_bind_value>())( + return _sqlite3_bind_value( arg0, arg1, arg2, ); } - _dart_sqlite3_bind_value? _sqlite3_bind_value; + late final _sqlite3_bind_value_ptr = + _lookup>('sqlite3_bind_value'); + late final _dart_sqlite3_bind_value _sqlite3_bind_value = + _sqlite3_bind_value_ptr.asFunction<_dart_sqlite3_bind_value>(); int sqlite3_bind_pointer( ffi.Pointer arg0, @@ -3027,10 +3123,7 @@ class SQLite { ffi.Pointer arg3, ffi.Pointer> arg4, ) { - return (_sqlite3_bind_pointer ??= - _lookup>( - 'sqlite3_bind_pointer') - .asFunction<_dart_sqlite3_bind_pointer>())( + return _sqlite3_bind_pointer( arg0, arg1, arg2, @@ -3039,41 +3132,47 @@ class SQLite { ); } - _dart_sqlite3_bind_pointer? _sqlite3_bind_pointer; + late final _sqlite3_bind_pointer_ptr = + _lookup>( + 'sqlite3_bind_pointer'); + late final _dart_sqlite3_bind_pointer _sqlite3_bind_pointer = + _sqlite3_bind_pointer_ptr.asFunction<_dart_sqlite3_bind_pointer>(); int sqlite3_bind_zeroblob( ffi.Pointer arg0, int arg1, int n, ) { - return (_sqlite3_bind_zeroblob ??= - _lookup>( - 'sqlite3_bind_zeroblob') - .asFunction<_dart_sqlite3_bind_zeroblob>())( + return _sqlite3_bind_zeroblob( arg0, arg1, n, ); } - _dart_sqlite3_bind_zeroblob? _sqlite3_bind_zeroblob; + late final _sqlite3_bind_zeroblob_ptr = + _lookup>( + 'sqlite3_bind_zeroblob'); + late final _dart_sqlite3_bind_zeroblob _sqlite3_bind_zeroblob = + _sqlite3_bind_zeroblob_ptr.asFunction<_dart_sqlite3_bind_zeroblob>(); int sqlite3_bind_zeroblob64( ffi.Pointer arg0, int arg1, int arg2, ) { - return (_sqlite3_bind_zeroblob64 ??= - _lookup>( - 'sqlite3_bind_zeroblob64') - .asFunction<_dart_sqlite3_bind_zeroblob64>())( + return _sqlite3_bind_zeroblob64( arg0, arg1, arg2, ); } - _dart_sqlite3_bind_zeroblob64? _sqlite3_bind_zeroblob64; + late final _sqlite3_bind_zeroblob64_ptr = + _lookup>( + 'sqlite3_bind_zeroblob64'); + late final _dart_sqlite3_bind_zeroblob64 _sqlite3_bind_zeroblob64 = + _sqlite3_bind_zeroblob64_ptr.asFunction<_dart_sqlite3_bind_zeroblob64>(); /// CAPI3REF: Number Of SQL Parameters /// METHOD: sqlite3_stmt @@ -3095,15 +3194,17 @@ class SQLite { int sqlite3_bind_parameter_count( ffi.Pointer arg0, ) { - return (_sqlite3_bind_parameter_count ??= - _lookup>( - 'sqlite3_bind_parameter_count') - .asFunction<_dart_sqlite3_bind_parameter_count>())( + return _sqlite3_bind_parameter_count( arg0, ); } - _dart_sqlite3_bind_parameter_count? _sqlite3_bind_parameter_count; + late final _sqlite3_bind_parameter_count_ptr = + _lookup>( + 'sqlite3_bind_parameter_count'); + late final _dart_sqlite3_bind_parameter_count _sqlite3_bind_parameter_count = + _sqlite3_bind_parameter_count_ptr + .asFunction<_dart_sqlite3_bind_parameter_count>(); /// CAPI3REF: Name Of A Host Parameter /// METHOD: sqlite3_stmt @@ -3133,16 +3234,18 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_bind_parameter_name ??= - _lookup>( - 'sqlite3_bind_parameter_name') - .asFunction<_dart_sqlite3_bind_parameter_name>())( + return _sqlite3_bind_parameter_name( arg0, arg1, ); } - _dart_sqlite3_bind_parameter_name? _sqlite3_bind_parameter_name; + late final _sqlite3_bind_parameter_name_ptr = + _lookup>( + 'sqlite3_bind_parameter_name'); + late final _dart_sqlite3_bind_parameter_name _sqlite3_bind_parameter_name = + _sqlite3_bind_parameter_name_ptr + .asFunction<_dart_sqlite3_bind_parameter_name>(); /// CAPI3REF: Index Of A Parameter With A Given Name /// METHOD: sqlite3_stmt @@ -3162,16 +3265,18 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer zName, ) { - return (_sqlite3_bind_parameter_index ??= - _lookup>( - 'sqlite3_bind_parameter_index') - .asFunction<_dart_sqlite3_bind_parameter_index>())( + return _sqlite3_bind_parameter_index( arg0, zName, ); } - _dart_sqlite3_bind_parameter_index? _sqlite3_bind_parameter_index; + late final _sqlite3_bind_parameter_index_ptr = + _lookup>( + 'sqlite3_bind_parameter_index'); + late final _dart_sqlite3_bind_parameter_index _sqlite3_bind_parameter_index = + _sqlite3_bind_parameter_index_ptr + .asFunction<_dart_sqlite3_bind_parameter_index>(); /// CAPI3REF: Reset All Bindings On A Prepared Statement /// METHOD: sqlite3_stmt @@ -3182,15 +3287,16 @@ class SQLite { int sqlite3_clear_bindings( ffi.Pointer arg0, ) { - return (_sqlite3_clear_bindings ??= - _lookup>( - 'sqlite3_clear_bindings') - .asFunction<_dart_sqlite3_clear_bindings>())( + return _sqlite3_clear_bindings( arg0, ); } - _dart_sqlite3_clear_bindings? _sqlite3_clear_bindings; + late final _sqlite3_clear_bindings_ptr = + _lookup>( + 'sqlite3_clear_bindings'); + late final _dart_sqlite3_clear_bindings _sqlite3_clear_bindings = + _sqlite3_clear_bindings_ptr.asFunction<_dart_sqlite3_clear_bindings>(); /// CAPI3REF: Number Of Columns In A Result Set /// METHOD: sqlite3_stmt @@ -3207,15 +3313,16 @@ class SQLite { int sqlite3_column_count( ffi.Pointer pStmt, ) { - return (_sqlite3_column_count ??= - _lookup>( - 'sqlite3_column_count') - .asFunction<_dart_sqlite3_column_count>())( + return _sqlite3_column_count( pStmt, ); } - _dart_sqlite3_column_count? _sqlite3_column_count; + late final _sqlite3_column_count_ptr = + _lookup>( + 'sqlite3_column_count'); + late final _dart_sqlite3_column_count _sqlite3_column_count = + _sqlite3_column_count_ptr.asFunction<_dart_sqlite3_column_count>(); /// CAPI3REF: Column Names In A Result Set /// METHOD: sqlite3_stmt @@ -3246,31 +3353,33 @@ class SQLite { ffi.Pointer arg0, int N, ) { - return (_sqlite3_column_name ??= - _lookup>( - 'sqlite3_column_name') - .asFunction<_dart_sqlite3_column_name>())( + return _sqlite3_column_name( arg0, N, ); } - _dart_sqlite3_column_name? _sqlite3_column_name; + late final _sqlite3_column_name_ptr = + _lookup>( + 'sqlite3_column_name'); + late final _dart_sqlite3_column_name _sqlite3_column_name = + _sqlite3_column_name_ptr.asFunction<_dart_sqlite3_column_name>(); ffi.Pointer sqlite3_column_name16( ffi.Pointer arg0, int N, ) { - return (_sqlite3_column_name16 ??= - _lookup>( - 'sqlite3_column_name16') - .asFunction<_dart_sqlite3_column_name16>())( + return _sqlite3_column_name16( arg0, N, ); } - _dart_sqlite3_column_name16? _sqlite3_column_name16; + late final _sqlite3_column_name16_ptr = + _lookup>( + 'sqlite3_column_name16'); + late final _dart_sqlite3_column_name16 _sqlite3_column_name16 = + _sqlite3_column_name16_ptr.asFunction<_dart_sqlite3_column_name16>(); /// CAPI3REF: Source Of Data In A Query Result /// METHOD: sqlite3_stmt @@ -3316,91 +3425,103 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_column_database_name ??= - _lookup>( - 'sqlite3_column_database_name') - .asFunction<_dart_sqlite3_column_database_name>())( + return _sqlite3_column_database_name( arg0, arg1, ); } - _dart_sqlite3_column_database_name? _sqlite3_column_database_name; + late final _sqlite3_column_database_name_ptr = + _lookup>( + 'sqlite3_column_database_name'); + late final _dart_sqlite3_column_database_name _sqlite3_column_database_name = + _sqlite3_column_database_name_ptr + .asFunction<_dart_sqlite3_column_database_name>(); ffi.Pointer sqlite3_column_database_name16( ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_column_database_name16 ??= - _lookup>( - 'sqlite3_column_database_name16') - .asFunction<_dart_sqlite3_column_database_name16>())( + return _sqlite3_column_database_name16( arg0, arg1, ); } - _dart_sqlite3_column_database_name16? _sqlite3_column_database_name16; + late final _sqlite3_column_database_name16_ptr = + _lookup>( + 'sqlite3_column_database_name16'); + late final _dart_sqlite3_column_database_name16 + _sqlite3_column_database_name16 = _sqlite3_column_database_name16_ptr + .asFunction<_dart_sqlite3_column_database_name16>(); ffi.Pointer sqlite3_column_table_name( ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_column_table_name ??= - _lookup>( - 'sqlite3_column_table_name') - .asFunction<_dart_sqlite3_column_table_name>())( + return _sqlite3_column_table_name( arg0, arg1, ); } - _dart_sqlite3_column_table_name? _sqlite3_column_table_name; + late final _sqlite3_column_table_name_ptr = + _lookup>( + 'sqlite3_column_table_name'); + late final _dart_sqlite3_column_table_name _sqlite3_column_table_name = + _sqlite3_column_table_name_ptr + .asFunction<_dart_sqlite3_column_table_name>(); ffi.Pointer sqlite3_column_table_name16( ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_column_table_name16 ??= - _lookup>( - 'sqlite3_column_table_name16') - .asFunction<_dart_sqlite3_column_table_name16>())( + return _sqlite3_column_table_name16( arg0, arg1, ); } - _dart_sqlite3_column_table_name16? _sqlite3_column_table_name16; + late final _sqlite3_column_table_name16_ptr = + _lookup>( + 'sqlite3_column_table_name16'); + late final _dart_sqlite3_column_table_name16 _sqlite3_column_table_name16 = + _sqlite3_column_table_name16_ptr + .asFunction<_dart_sqlite3_column_table_name16>(); ffi.Pointer sqlite3_column_origin_name( ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_column_origin_name ??= - _lookup>( - 'sqlite3_column_origin_name') - .asFunction<_dart_sqlite3_column_origin_name>())( + return _sqlite3_column_origin_name( arg0, arg1, ); } - _dart_sqlite3_column_origin_name? _sqlite3_column_origin_name; + late final _sqlite3_column_origin_name_ptr = + _lookup>( + 'sqlite3_column_origin_name'); + late final _dart_sqlite3_column_origin_name _sqlite3_column_origin_name = + _sqlite3_column_origin_name_ptr + .asFunction<_dart_sqlite3_column_origin_name>(); ffi.Pointer sqlite3_column_origin_name16( ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_column_origin_name16 ??= - _lookup>( - 'sqlite3_column_origin_name16') - .asFunction<_dart_sqlite3_column_origin_name16>())( + return _sqlite3_column_origin_name16( arg0, arg1, ); } - _dart_sqlite3_column_origin_name16? _sqlite3_column_origin_name16; + late final _sqlite3_column_origin_name16_ptr = + _lookup>( + 'sqlite3_column_origin_name16'); + late final _dart_sqlite3_column_origin_name16 _sqlite3_column_origin_name16 = + _sqlite3_column_origin_name16_ptr + .asFunction<_dart_sqlite3_column_origin_name16>(); /// CAPI3REF: Declared Datatype Of A Query Result /// METHOD: sqlite3_stmt @@ -3434,31 +3555,34 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_column_decltype ??= - _lookup>( - 'sqlite3_column_decltype') - .asFunction<_dart_sqlite3_column_decltype>())( + return _sqlite3_column_decltype( arg0, arg1, ); } - _dart_sqlite3_column_decltype? _sqlite3_column_decltype; + late final _sqlite3_column_decltype_ptr = + _lookup>( + 'sqlite3_column_decltype'); + late final _dart_sqlite3_column_decltype _sqlite3_column_decltype = + _sqlite3_column_decltype_ptr.asFunction<_dart_sqlite3_column_decltype>(); ffi.Pointer sqlite3_column_decltype16( ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_column_decltype16 ??= - _lookup>( - 'sqlite3_column_decltype16') - .asFunction<_dart_sqlite3_column_decltype16>())( + return _sqlite3_column_decltype16( arg0, arg1, ); } - _dart_sqlite3_column_decltype16? _sqlite3_column_decltype16; + late final _sqlite3_column_decltype16_ptr = + _lookup>( + 'sqlite3_column_decltype16'); + late final _dart_sqlite3_column_decltype16 _sqlite3_column_decltype16 = + _sqlite3_column_decltype16_ptr + .asFunction<_dart_sqlite3_column_decltype16>(); /// CAPI3REF: Evaluate An SQL Statement /// METHOD: sqlite3_stmt @@ -3543,14 +3667,15 @@ class SQLite { int sqlite3_step( ffi.Pointer arg0, ) { - return (_sqlite3_step ??= - _lookup>('sqlite3_step') - .asFunction<_dart_sqlite3_step>())( + return _sqlite3_step( arg0, ); } - _dart_sqlite3_step? _sqlite3_step; + late final _sqlite3_step_ptr = + _lookup>('sqlite3_step'); + late final _dart_sqlite3_step _sqlite3_step = + _sqlite3_step_ptr.asFunction<_dart_sqlite3_step>(); /// CAPI3REF: Number of columns in a result set /// METHOD: sqlite3_stmt @@ -3572,14 +3697,15 @@ class SQLite { int sqlite3_data_count( ffi.Pointer pStmt, ) { - return (_sqlite3_data_count ??= - _lookup>('sqlite3_data_count') - .asFunction<_dart_sqlite3_data_count>())( + return _sqlite3_data_count( pStmt, ); } - _dart_sqlite3_data_count? _sqlite3_data_count; + late final _sqlite3_data_count_ptr = + _lookup>('sqlite3_data_count'); + late final _dart_sqlite3_data_count _sqlite3_data_count = + _sqlite3_data_count_ptr.asFunction<_dart_sqlite3_data_count>(); /// CAPI3REF: Result Values From A Query /// KEYWORDS: {column access functions} @@ -3792,150 +3918,160 @@ class SQLite { ffi.Pointer arg0, int iCol, ) { - return (_sqlite3_column_blob ??= - _lookup>( - 'sqlite3_column_blob') - .asFunction<_dart_sqlite3_column_blob>())( + return _sqlite3_column_blob( arg0, iCol, ); } - _dart_sqlite3_column_blob? _sqlite3_column_blob; + late final _sqlite3_column_blob_ptr = + _lookup>( + 'sqlite3_column_blob'); + late final _dart_sqlite3_column_blob _sqlite3_column_blob = + _sqlite3_column_blob_ptr.asFunction<_dart_sqlite3_column_blob>(); double sqlite3_column_double( ffi.Pointer arg0, int iCol, ) { - return (_sqlite3_column_double ??= - _lookup>( - 'sqlite3_column_double') - .asFunction<_dart_sqlite3_column_double>())( + return _sqlite3_column_double( arg0, iCol, ); } - _dart_sqlite3_column_double? _sqlite3_column_double; + late final _sqlite3_column_double_ptr = + _lookup>( + 'sqlite3_column_double'); + late final _dart_sqlite3_column_double _sqlite3_column_double = + _sqlite3_column_double_ptr.asFunction<_dart_sqlite3_column_double>(); int sqlite3_column_int( ffi.Pointer arg0, int iCol, ) { - return (_sqlite3_column_int ??= - _lookup>('sqlite3_column_int') - .asFunction<_dart_sqlite3_column_int>())( + return _sqlite3_column_int( arg0, iCol, ); } - _dart_sqlite3_column_int? _sqlite3_column_int; + late final _sqlite3_column_int_ptr = + _lookup>('sqlite3_column_int'); + late final _dart_sqlite3_column_int _sqlite3_column_int = + _sqlite3_column_int_ptr.asFunction<_dart_sqlite3_column_int>(); int sqlite3_column_int64( ffi.Pointer arg0, int iCol, ) { - return (_sqlite3_column_int64 ??= - _lookup>( - 'sqlite3_column_int64') - .asFunction<_dart_sqlite3_column_int64>())( + return _sqlite3_column_int64( arg0, iCol, ); } - _dart_sqlite3_column_int64? _sqlite3_column_int64; + late final _sqlite3_column_int64_ptr = + _lookup>( + 'sqlite3_column_int64'); + late final _dart_sqlite3_column_int64 _sqlite3_column_int64 = + _sqlite3_column_int64_ptr.asFunction<_dart_sqlite3_column_int64>(); ffi.Pointer sqlite3_column_text( ffi.Pointer arg0, int iCol, ) { - return (_sqlite3_column_text ??= - _lookup>( - 'sqlite3_column_text') - .asFunction<_dart_sqlite3_column_text>())( + return _sqlite3_column_text( arg0, iCol, ); } - _dart_sqlite3_column_text? _sqlite3_column_text; + late final _sqlite3_column_text_ptr = + _lookup>( + 'sqlite3_column_text'); + late final _dart_sqlite3_column_text _sqlite3_column_text = + _sqlite3_column_text_ptr.asFunction<_dart_sqlite3_column_text>(); ffi.Pointer sqlite3_column_text16( ffi.Pointer arg0, int iCol, ) { - return (_sqlite3_column_text16 ??= - _lookup>( - 'sqlite3_column_text16') - .asFunction<_dart_sqlite3_column_text16>())( + return _sqlite3_column_text16( arg0, iCol, ); } - _dart_sqlite3_column_text16? _sqlite3_column_text16; + late final _sqlite3_column_text16_ptr = + _lookup>( + 'sqlite3_column_text16'); + late final _dart_sqlite3_column_text16 _sqlite3_column_text16 = + _sqlite3_column_text16_ptr.asFunction<_dart_sqlite3_column_text16>(); ffi.Pointer sqlite3_column_value( ffi.Pointer arg0, int iCol, ) { - return (_sqlite3_column_value ??= - _lookup>( - 'sqlite3_column_value') - .asFunction<_dart_sqlite3_column_value>())( + return _sqlite3_column_value( arg0, iCol, ); } - _dart_sqlite3_column_value? _sqlite3_column_value; + late final _sqlite3_column_value_ptr = + _lookup>( + 'sqlite3_column_value'); + late final _dart_sqlite3_column_value _sqlite3_column_value = + _sqlite3_column_value_ptr.asFunction<_dart_sqlite3_column_value>(); int sqlite3_column_bytes( ffi.Pointer arg0, int iCol, ) { - return (_sqlite3_column_bytes ??= - _lookup>( - 'sqlite3_column_bytes') - .asFunction<_dart_sqlite3_column_bytes>())( + return _sqlite3_column_bytes( arg0, iCol, ); } - _dart_sqlite3_column_bytes? _sqlite3_column_bytes; + late final _sqlite3_column_bytes_ptr = + _lookup>( + 'sqlite3_column_bytes'); + late final _dart_sqlite3_column_bytes _sqlite3_column_bytes = + _sqlite3_column_bytes_ptr.asFunction<_dart_sqlite3_column_bytes>(); int sqlite3_column_bytes16( ffi.Pointer arg0, int iCol, ) { - return (_sqlite3_column_bytes16 ??= - _lookup>( - 'sqlite3_column_bytes16') - .asFunction<_dart_sqlite3_column_bytes16>())( + return _sqlite3_column_bytes16( arg0, iCol, ); } - _dart_sqlite3_column_bytes16? _sqlite3_column_bytes16; + late final _sqlite3_column_bytes16_ptr = + _lookup>( + 'sqlite3_column_bytes16'); + late final _dart_sqlite3_column_bytes16 _sqlite3_column_bytes16 = + _sqlite3_column_bytes16_ptr.asFunction<_dart_sqlite3_column_bytes16>(); int sqlite3_column_type( ffi.Pointer arg0, int iCol, ) { - return (_sqlite3_column_type ??= - _lookup>( - 'sqlite3_column_type') - .asFunction<_dart_sqlite3_column_type>())( + return _sqlite3_column_type( arg0, iCol, ); } - _dart_sqlite3_column_type? _sqlite3_column_type; + late final _sqlite3_column_type_ptr = + _lookup>( + 'sqlite3_column_type'); + late final _dart_sqlite3_column_type _sqlite3_column_type = + _sqlite3_column_type_ptr.asFunction<_dart_sqlite3_column_type>(); /// CAPI3REF: Destroy A Prepared Statement Object /// DESTRUCTOR: sqlite3_stmt @@ -3964,14 +4100,15 @@ class SQLite { int sqlite3_finalize( ffi.Pointer pStmt, ) { - return (_sqlite3_finalize ??= - _lookup>('sqlite3_finalize') - .asFunction<_dart_sqlite3_finalize>())( + return _sqlite3_finalize( pStmt, ); } - _dart_sqlite3_finalize? _sqlite3_finalize; + late final _sqlite3_finalize_ptr = + _lookup>('sqlite3_finalize'); + late final _dart_sqlite3_finalize _sqlite3_finalize = + _sqlite3_finalize_ptr.asFunction<_dart_sqlite3_finalize>(); /// CAPI3REF: Reset A Prepared Statement Object /// METHOD: sqlite3_stmt @@ -3999,14 +4136,15 @@ class SQLite { int sqlite3_reset( ffi.Pointer pStmt, ) { - return (_sqlite3_reset ??= - _lookup>('sqlite3_reset') - .asFunction<_dart_sqlite3_reset>())( + return _sqlite3_reset( pStmt, ); } - _dart_sqlite3_reset? _sqlite3_reset; + late final _sqlite3_reset_ptr = + _lookup>('sqlite3_reset'); + late final _dart_sqlite3_reset _sqlite3_reset = + _sqlite3_reset_ptr.asFunction<_dart_sqlite3_reset>(); /// CAPI3REF: Create Or Redefine SQL Functions /// KEYWORDS: {function creation routines} @@ -4141,10 +4279,7 @@ class SQLite { ffi.Pointer> xStep, ffi.Pointer> xFinal, ) { - return (_sqlite3_create_function ??= - _lookup>( - 'sqlite3_create_function') - .asFunction<_dart_sqlite3_create_function>())( + return _sqlite3_create_function( db, zFunctionName, nArg, @@ -4156,7 +4291,11 @@ class SQLite { ); } - _dart_sqlite3_create_function? _sqlite3_create_function; + late final _sqlite3_create_function_ptr = + _lookup>( + 'sqlite3_create_function'); + late final _dart_sqlite3_create_function _sqlite3_create_function = + _sqlite3_create_function_ptr.asFunction<_dart_sqlite3_create_function>(); int sqlite3_create_function16( ffi.Pointer db, @@ -4168,10 +4307,7 @@ class SQLite { ffi.Pointer> xStep, ffi.Pointer> xFinal, ) { - return (_sqlite3_create_function16 ??= - _lookup>( - 'sqlite3_create_function16') - .asFunction<_dart_sqlite3_create_function16>())( + return _sqlite3_create_function16( db, zFunctionName, nArg, @@ -4183,7 +4319,12 @@ class SQLite { ); } - _dart_sqlite3_create_function16? _sqlite3_create_function16; + late final _sqlite3_create_function16_ptr = + _lookup>( + 'sqlite3_create_function16'); + late final _dart_sqlite3_create_function16 _sqlite3_create_function16 = + _sqlite3_create_function16_ptr + .asFunction<_dart_sqlite3_create_function16>(); int sqlite3_create_function_v2( ffi.Pointer db, @@ -4196,10 +4337,7 @@ class SQLite { ffi.Pointer> xFinal, ffi.Pointer> xDestroy, ) { - return (_sqlite3_create_function_v2 ??= - _lookup>( - 'sqlite3_create_function_v2') - .asFunction<_dart_sqlite3_create_function_v2>())( + return _sqlite3_create_function_v2( db, zFunctionName, nArg, @@ -4212,7 +4350,12 @@ class SQLite { ); } - _dart_sqlite3_create_function_v2? _sqlite3_create_function_v2; + late final _sqlite3_create_function_v2_ptr = + _lookup>( + 'sqlite3_create_function_v2'); + late final _dart_sqlite3_create_function_v2 _sqlite3_create_function_v2 = + _sqlite3_create_function_v2_ptr + .asFunction<_dart_sqlite3_create_function_v2>(); int sqlite3_create_window_function( ffi.Pointer db, @@ -4226,10 +4369,7 @@ class SQLite { ffi.Pointer> xInverse, ffi.Pointer> xDestroy, ) { - return (_sqlite3_create_window_function ??= - _lookup>( - 'sqlite3_create_window_function') - .asFunction<_dart_sqlite3_create_window_function>())( + return _sqlite3_create_window_function( db, zFunctionName, nArg, @@ -4243,82 +4383,94 @@ class SQLite { ); } - _dart_sqlite3_create_window_function? _sqlite3_create_window_function; + late final _sqlite3_create_window_function_ptr = + _lookup>( + 'sqlite3_create_window_function'); + late final _dart_sqlite3_create_window_function + _sqlite3_create_window_function = _sqlite3_create_window_function_ptr + .asFunction<_dart_sqlite3_create_window_function>(); int sqlite3_aggregate_count( ffi.Pointer arg0, ) { - return (_sqlite3_aggregate_count ??= - _lookup>( - 'sqlite3_aggregate_count') - .asFunction<_dart_sqlite3_aggregate_count>())( + return _sqlite3_aggregate_count( arg0, ); } - _dart_sqlite3_aggregate_count? _sqlite3_aggregate_count; + late final _sqlite3_aggregate_count_ptr = + _lookup>( + 'sqlite3_aggregate_count'); + late final _dart_sqlite3_aggregate_count _sqlite3_aggregate_count = + _sqlite3_aggregate_count_ptr.asFunction<_dart_sqlite3_aggregate_count>(); int sqlite3_expired( ffi.Pointer arg0, ) { - return (_sqlite3_expired ??= - _lookup>('sqlite3_expired') - .asFunction<_dart_sqlite3_expired>())( + return _sqlite3_expired( arg0, ); } - _dart_sqlite3_expired? _sqlite3_expired; + late final _sqlite3_expired_ptr = + _lookup>('sqlite3_expired'); + late final _dart_sqlite3_expired _sqlite3_expired = + _sqlite3_expired_ptr.asFunction<_dart_sqlite3_expired>(); int sqlite3_transfer_bindings( ffi.Pointer arg0, ffi.Pointer arg1, ) { - return (_sqlite3_transfer_bindings ??= - _lookup>( - 'sqlite3_transfer_bindings') - .asFunction<_dart_sqlite3_transfer_bindings>())( + return _sqlite3_transfer_bindings( arg0, arg1, ); } - _dart_sqlite3_transfer_bindings? _sqlite3_transfer_bindings; + late final _sqlite3_transfer_bindings_ptr = + _lookup>( + 'sqlite3_transfer_bindings'); + late final _dart_sqlite3_transfer_bindings _sqlite3_transfer_bindings = + _sqlite3_transfer_bindings_ptr + .asFunction<_dart_sqlite3_transfer_bindings>(); int sqlite3_global_recover() { - return (_sqlite3_global_recover ??= - _lookup>( - 'sqlite3_global_recover') - .asFunction<_dart_sqlite3_global_recover>())(); + return _sqlite3_global_recover(); } - _dart_sqlite3_global_recover? _sqlite3_global_recover; + late final _sqlite3_global_recover_ptr = + _lookup>( + 'sqlite3_global_recover'); + late final _dart_sqlite3_global_recover _sqlite3_global_recover = + _sqlite3_global_recover_ptr.asFunction<_dart_sqlite3_global_recover>(); void sqlite3_thread_cleanup() { - return (_sqlite3_thread_cleanup ??= - _lookup>( - 'sqlite3_thread_cleanup') - .asFunction<_dart_sqlite3_thread_cleanup>())(); + return _sqlite3_thread_cleanup(); } - _dart_sqlite3_thread_cleanup? _sqlite3_thread_cleanup; + late final _sqlite3_thread_cleanup_ptr = + _lookup>( + 'sqlite3_thread_cleanup'); + late final _dart_sqlite3_thread_cleanup _sqlite3_thread_cleanup = + _sqlite3_thread_cleanup_ptr.asFunction<_dart_sqlite3_thread_cleanup>(); int sqlite3_memory_alarm( ffi.Pointer> arg0, ffi.Pointer arg1, int arg2, ) { - return (_sqlite3_memory_alarm ??= - _lookup>( - 'sqlite3_memory_alarm') - .asFunction<_dart_sqlite3_memory_alarm>())( + return _sqlite3_memory_alarm( arg0, arg1, arg2, ); } - _dart_sqlite3_memory_alarm? _sqlite3_memory_alarm; + late final _sqlite3_memory_alarm_ptr = + _lookup>( + 'sqlite3_memory_alarm'); + late final _dart_sqlite3_memory_alarm _sqlite3_memory_alarm = + _sqlite3_memory_alarm_ptr.asFunction<_dart_sqlite3_memory_alarm>(); /// CAPI3REF: Obtaining SQL Values /// METHOD: sqlite3_value @@ -4449,195 +4601,211 @@ class SQLite { ffi.Pointer sqlite3_value_blob( ffi.Pointer arg0, ) { - return (_sqlite3_value_blob ??= - _lookup>('sqlite3_value_blob') - .asFunction<_dart_sqlite3_value_blob>())( + return _sqlite3_value_blob( arg0, ); } - _dart_sqlite3_value_blob? _sqlite3_value_blob; + late final _sqlite3_value_blob_ptr = + _lookup>('sqlite3_value_blob'); + late final _dart_sqlite3_value_blob _sqlite3_value_blob = + _sqlite3_value_blob_ptr.asFunction<_dart_sqlite3_value_blob>(); double sqlite3_value_double( ffi.Pointer arg0, ) { - return (_sqlite3_value_double ??= - _lookup>( - 'sqlite3_value_double') - .asFunction<_dart_sqlite3_value_double>())( + return _sqlite3_value_double( arg0, ); } - _dart_sqlite3_value_double? _sqlite3_value_double; + late final _sqlite3_value_double_ptr = + _lookup>( + 'sqlite3_value_double'); + late final _dart_sqlite3_value_double _sqlite3_value_double = + _sqlite3_value_double_ptr.asFunction<_dart_sqlite3_value_double>(); int sqlite3_value_int( ffi.Pointer arg0, ) { - return (_sqlite3_value_int ??= - _lookup>('sqlite3_value_int') - .asFunction<_dart_sqlite3_value_int>())( + return _sqlite3_value_int( arg0, ); } - _dart_sqlite3_value_int? _sqlite3_value_int; + late final _sqlite3_value_int_ptr = + _lookup>('sqlite3_value_int'); + late final _dart_sqlite3_value_int _sqlite3_value_int = + _sqlite3_value_int_ptr.asFunction<_dart_sqlite3_value_int>(); int sqlite3_value_int64( ffi.Pointer arg0, ) { - return (_sqlite3_value_int64 ??= - _lookup>( - 'sqlite3_value_int64') - .asFunction<_dart_sqlite3_value_int64>())( + return _sqlite3_value_int64( arg0, ); } - _dart_sqlite3_value_int64? _sqlite3_value_int64; + late final _sqlite3_value_int64_ptr = + _lookup>( + 'sqlite3_value_int64'); + late final _dart_sqlite3_value_int64 _sqlite3_value_int64 = + _sqlite3_value_int64_ptr.asFunction<_dart_sqlite3_value_int64>(); ffi.Pointer sqlite3_value_pointer( ffi.Pointer arg0, ffi.Pointer arg1, ) { - return (_sqlite3_value_pointer ??= - _lookup>( - 'sqlite3_value_pointer') - .asFunction<_dart_sqlite3_value_pointer>())( + return _sqlite3_value_pointer( arg0, arg1, ); } - _dart_sqlite3_value_pointer? _sqlite3_value_pointer; + late final _sqlite3_value_pointer_ptr = + _lookup>( + 'sqlite3_value_pointer'); + late final _dart_sqlite3_value_pointer _sqlite3_value_pointer = + _sqlite3_value_pointer_ptr.asFunction<_dart_sqlite3_value_pointer>(); ffi.Pointer sqlite3_value_text( ffi.Pointer arg0, ) { - return (_sqlite3_value_text ??= - _lookup>('sqlite3_value_text') - .asFunction<_dart_sqlite3_value_text>())( + return _sqlite3_value_text( arg0, ); } - _dart_sqlite3_value_text? _sqlite3_value_text; + late final _sqlite3_value_text_ptr = + _lookup>('sqlite3_value_text'); + late final _dart_sqlite3_value_text _sqlite3_value_text = + _sqlite3_value_text_ptr.asFunction<_dart_sqlite3_value_text>(); ffi.Pointer sqlite3_value_text16( ffi.Pointer arg0, ) { - return (_sqlite3_value_text16 ??= - _lookup>( - 'sqlite3_value_text16') - .asFunction<_dart_sqlite3_value_text16>())( + return _sqlite3_value_text16( arg0, ); } - _dart_sqlite3_value_text16? _sqlite3_value_text16; + late final _sqlite3_value_text16_ptr = + _lookup>( + 'sqlite3_value_text16'); + late final _dart_sqlite3_value_text16 _sqlite3_value_text16 = + _sqlite3_value_text16_ptr.asFunction<_dart_sqlite3_value_text16>(); ffi.Pointer sqlite3_value_text16le( ffi.Pointer arg0, ) { - return (_sqlite3_value_text16le ??= - _lookup>( - 'sqlite3_value_text16le') - .asFunction<_dart_sqlite3_value_text16le>())( + return _sqlite3_value_text16le( arg0, ); } - _dart_sqlite3_value_text16le? _sqlite3_value_text16le; + late final _sqlite3_value_text16le_ptr = + _lookup>( + 'sqlite3_value_text16le'); + late final _dart_sqlite3_value_text16le _sqlite3_value_text16le = + _sqlite3_value_text16le_ptr.asFunction<_dart_sqlite3_value_text16le>(); ffi.Pointer sqlite3_value_text16be( ffi.Pointer arg0, ) { - return (_sqlite3_value_text16be ??= - _lookup>( - 'sqlite3_value_text16be') - .asFunction<_dart_sqlite3_value_text16be>())( + return _sqlite3_value_text16be( arg0, ); } - _dart_sqlite3_value_text16be? _sqlite3_value_text16be; + late final _sqlite3_value_text16be_ptr = + _lookup>( + 'sqlite3_value_text16be'); + late final _dart_sqlite3_value_text16be _sqlite3_value_text16be = + _sqlite3_value_text16be_ptr.asFunction<_dart_sqlite3_value_text16be>(); int sqlite3_value_bytes( ffi.Pointer arg0, ) { - return (_sqlite3_value_bytes ??= - _lookup>( - 'sqlite3_value_bytes') - .asFunction<_dart_sqlite3_value_bytes>())( + return _sqlite3_value_bytes( arg0, ); } - _dart_sqlite3_value_bytes? _sqlite3_value_bytes; + late final _sqlite3_value_bytes_ptr = + _lookup>( + 'sqlite3_value_bytes'); + late final _dart_sqlite3_value_bytes _sqlite3_value_bytes = + _sqlite3_value_bytes_ptr.asFunction<_dart_sqlite3_value_bytes>(); int sqlite3_value_bytes16( ffi.Pointer arg0, ) { - return (_sqlite3_value_bytes16 ??= - _lookup>( - 'sqlite3_value_bytes16') - .asFunction<_dart_sqlite3_value_bytes16>())( + return _sqlite3_value_bytes16( arg0, ); } - _dart_sqlite3_value_bytes16? _sqlite3_value_bytes16; + late final _sqlite3_value_bytes16_ptr = + _lookup>( + 'sqlite3_value_bytes16'); + late final _dart_sqlite3_value_bytes16 _sqlite3_value_bytes16 = + _sqlite3_value_bytes16_ptr.asFunction<_dart_sqlite3_value_bytes16>(); int sqlite3_value_type( ffi.Pointer arg0, ) { - return (_sqlite3_value_type ??= - _lookup>('sqlite3_value_type') - .asFunction<_dart_sqlite3_value_type>())( + return _sqlite3_value_type( arg0, ); } - _dart_sqlite3_value_type? _sqlite3_value_type; + late final _sqlite3_value_type_ptr = + _lookup>('sqlite3_value_type'); + late final _dart_sqlite3_value_type _sqlite3_value_type = + _sqlite3_value_type_ptr.asFunction<_dart_sqlite3_value_type>(); int sqlite3_value_numeric_type( ffi.Pointer arg0, ) { - return (_sqlite3_value_numeric_type ??= - _lookup>( - 'sqlite3_value_numeric_type') - .asFunction<_dart_sqlite3_value_numeric_type>())( + return _sqlite3_value_numeric_type( arg0, ); } - _dart_sqlite3_value_numeric_type? _sqlite3_value_numeric_type; + late final _sqlite3_value_numeric_type_ptr = + _lookup>( + 'sqlite3_value_numeric_type'); + late final _dart_sqlite3_value_numeric_type _sqlite3_value_numeric_type = + _sqlite3_value_numeric_type_ptr + .asFunction<_dart_sqlite3_value_numeric_type>(); int sqlite3_value_nochange( ffi.Pointer arg0, ) { - return (_sqlite3_value_nochange ??= - _lookup>( - 'sqlite3_value_nochange') - .asFunction<_dart_sqlite3_value_nochange>())( + return _sqlite3_value_nochange( arg0, ); } - _dart_sqlite3_value_nochange? _sqlite3_value_nochange; + late final _sqlite3_value_nochange_ptr = + _lookup>( + 'sqlite3_value_nochange'); + late final _dart_sqlite3_value_nochange _sqlite3_value_nochange = + _sqlite3_value_nochange_ptr.asFunction<_dart_sqlite3_value_nochange>(); int sqlite3_value_frombind( ffi.Pointer arg0, ) { - return (_sqlite3_value_frombind ??= - _lookup>( - 'sqlite3_value_frombind') - .asFunction<_dart_sqlite3_value_frombind>())( + return _sqlite3_value_frombind( arg0, ); } - _dart_sqlite3_value_frombind? _sqlite3_value_frombind; + late final _sqlite3_value_frombind_ptr = + _lookup>( + 'sqlite3_value_frombind'); + late final _dart_sqlite3_value_frombind _sqlite3_value_frombind = + _sqlite3_value_frombind_ptr.asFunction<_dart_sqlite3_value_frombind>(); /// CAPI3REF: Finding The Subtype Of SQL Values /// METHOD: sqlite3_value @@ -4650,15 +4818,16 @@ class SQLite { int sqlite3_value_subtype( ffi.Pointer arg0, ) { - return (_sqlite3_value_subtype ??= - _lookup>( - 'sqlite3_value_subtype') - .asFunction<_dart_sqlite3_value_subtype>())( + return _sqlite3_value_subtype( arg0, ); } - _dart_sqlite3_value_subtype? _sqlite3_value_subtype; + late final _sqlite3_value_subtype_ptr = + _lookup>( + 'sqlite3_value_subtype'); + late final _dart_sqlite3_value_subtype _sqlite3_value_subtype = + _sqlite3_value_subtype_ptr.asFunction<_dart_sqlite3_value_subtype>(); /// CAPI3REF: Copy And Free SQL Values /// METHOD: sqlite3_value @@ -4675,26 +4844,28 @@ class SQLite { ffi.Pointer sqlite3_value_dup( ffi.Pointer arg0, ) { - return (_sqlite3_value_dup ??= - _lookup>('sqlite3_value_dup') - .asFunction<_dart_sqlite3_value_dup>())( + return _sqlite3_value_dup( arg0, ); } - _dart_sqlite3_value_dup? _sqlite3_value_dup; + late final _sqlite3_value_dup_ptr = + _lookup>('sqlite3_value_dup'); + late final _dart_sqlite3_value_dup _sqlite3_value_dup = + _sqlite3_value_dup_ptr.asFunction<_dart_sqlite3_value_dup>(); void sqlite3_value_free( ffi.Pointer arg0, ) { - return (_sqlite3_value_free ??= - _lookup>('sqlite3_value_free') - .asFunction<_dart_sqlite3_value_free>())( + return _sqlite3_value_free( arg0, ); } - _dart_sqlite3_value_free? _sqlite3_value_free; + late final _sqlite3_value_free_ptr = + _lookup>('sqlite3_value_free'); + late final _dart_sqlite3_value_free _sqlite3_value_free = + _sqlite3_value_free_ptr.asFunction<_dart_sqlite3_value_free>(); /// CAPI3REF: Obtain Aggregate Function Context /// METHOD: sqlite3_context @@ -4741,16 +4912,18 @@ class SQLite { ffi.Pointer arg0, int nBytes, ) { - return (_sqlite3_aggregate_context ??= - _lookup>( - 'sqlite3_aggregate_context') - .asFunction<_dart_sqlite3_aggregate_context>())( + return _sqlite3_aggregate_context( arg0, nBytes, ); } - _dart_sqlite3_aggregate_context? _sqlite3_aggregate_context; + late final _sqlite3_aggregate_context_ptr = + _lookup>( + 'sqlite3_aggregate_context'); + late final _dart_sqlite3_aggregate_context _sqlite3_aggregate_context = + _sqlite3_aggregate_context_ptr + .asFunction<_dart_sqlite3_aggregate_context>(); /// CAPI3REF: User Data For Functions /// METHOD: sqlite3_context @@ -4766,14 +4939,15 @@ class SQLite { ffi.Pointer sqlite3_user_data( ffi.Pointer arg0, ) { - return (_sqlite3_user_data ??= - _lookup>('sqlite3_user_data') - .asFunction<_dart_sqlite3_user_data>())( + return _sqlite3_user_data( arg0, ); } - _dart_sqlite3_user_data? _sqlite3_user_data; + late final _sqlite3_user_data_ptr = + _lookup>('sqlite3_user_data'); + late final _dart_sqlite3_user_data _sqlite3_user_data = + _sqlite3_user_data_ptr.asFunction<_dart_sqlite3_user_data>(); /// CAPI3REF: Database Connection For Functions /// METHOD: sqlite3_context @@ -4786,15 +4960,17 @@ class SQLite { ffi.Pointer sqlite3_context_db_handle( ffi.Pointer arg0, ) { - return (_sqlite3_context_db_handle ??= - _lookup>( - 'sqlite3_context_db_handle') - .asFunction<_dart_sqlite3_context_db_handle>())( + return _sqlite3_context_db_handle( arg0, ); } - _dart_sqlite3_context_db_handle? _sqlite3_context_db_handle; + late final _sqlite3_context_db_handle_ptr = + _lookup>( + 'sqlite3_context_db_handle'); + late final _dart_sqlite3_context_db_handle _sqlite3_context_db_handle = + _sqlite3_context_db_handle_ptr + .asFunction<_dart_sqlite3_context_db_handle>(); /// CAPI3REF: Function Auxiliary Data /// METHOD: sqlite3_context @@ -4855,16 +5031,17 @@ class SQLite { ffi.Pointer arg0, int N, ) { - return (_sqlite3_get_auxdata ??= - _lookup>( - 'sqlite3_get_auxdata') - .asFunction<_dart_sqlite3_get_auxdata>())( + return _sqlite3_get_auxdata( arg0, N, ); } - _dart_sqlite3_get_auxdata? _sqlite3_get_auxdata; + late final _sqlite3_get_auxdata_ptr = + _lookup>( + 'sqlite3_get_auxdata'); + late final _dart_sqlite3_get_auxdata _sqlite3_get_auxdata = + _sqlite3_get_auxdata_ptr.asFunction<_dart_sqlite3_get_auxdata>(); void sqlite3_set_auxdata( ffi.Pointer arg0, @@ -4872,10 +5049,7 @@ class SQLite { ffi.Pointer arg2, ffi.Pointer> arg3, ) { - return (_sqlite3_set_auxdata ??= - _lookup>( - 'sqlite3_set_auxdata') - .asFunction<_dart_sqlite3_set_auxdata>())( + return _sqlite3_set_auxdata( arg0, N, arg2, @@ -4883,7 +5057,11 @@ class SQLite { ); } - _dart_sqlite3_set_auxdata? _sqlite3_set_auxdata; + late final _sqlite3_set_auxdata_ptr = + _lookup>( + 'sqlite3_set_auxdata'); + late final _dart_sqlite3_set_auxdata _sqlite3_set_auxdata = + _sqlite3_set_auxdata_ptr.asFunction<_dart_sqlite3_set_auxdata>(); /// CAPI3REF: Setting The Result Of An SQL Function /// METHOD: sqlite3_context @@ -5035,10 +5213,7 @@ class SQLite { int arg2, ffi.Pointer> arg3, ) { - return (_sqlite3_result_blob ??= - _lookup>( - 'sqlite3_result_blob') - .asFunction<_dart_sqlite3_result_blob>())( + return _sqlite3_result_blob( arg0, arg1, arg2, @@ -5046,7 +5221,11 @@ class SQLite { ); } - _dart_sqlite3_result_blob? _sqlite3_result_blob; + late final _sqlite3_result_blob_ptr = + _lookup>( + 'sqlite3_result_blob'); + late final _dart_sqlite3_result_blob _sqlite3_result_blob = + _sqlite3_result_blob_ptr.asFunction<_dart_sqlite3_result_blob>(); void sqlite3_result_blob64( ffi.Pointer arg0, @@ -5054,10 +5233,7 @@ class SQLite { int arg2, ffi.Pointer> arg3, ) { - return (_sqlite3_result_blob64 ??= - _lookup>( - 'sqlite3_result_blob64') - .asFunction<_dart_sqlite3_result_blob64>())( + return _sqlite3_result_blob64( arg0, arg1, arg2, @@ -5065,139 +5241,155 @@ class SQLite { ); } - _dart_sqlite3_result_blob64? _sqlite3_result_blob64; + late final _sqlite3_result_blob64_ptr = + _lookup>( + 'sqlite3_result_blob64'); + late final _dart_sqlite3_result_blob64 _sqlite3_result_blob64 = + _sqlite3_result_blob64_ptr.asFunction<_dart_sqlite3_result_blob64>(); void sqlite3_result_double( ffi.Pointer arg0, double arg1, ) { - return (_sqlite3_result_double ??= - _lookup>( - 'sqlite3_result_double') - .asFunction<_dart_sqlite3_result_double>())( + return _sqlite3_result_double( arg0, arg1, ); } - _dart_sqlite3_result_double? _sqlite3_result_double; + late final _sqlite3_result_double_ptr = + _lookup>( + 'sqlite3_result_double'); + late final _dart_sqlite3_result_double _sqlite3_result_double = + _sqlite3_result_double_ptr.asFunction<_dart_sqlite3_result_double>(); void sqlite3_result_error( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, ) { - return (_sqlite3_result_error ??= - _lookup>( - 'sqlite3_result_error') - .asFunction<_dart_sqlite3_result_error>())( + return _sqlite3_result_error( arg0, arg1, arg2, ); } - _dart_sqlite3_result_error? _sqlite3_result_error; + late final _sqlite3_result_error_ptr = + _lookup>( + 'sqlite3_result_error'); + late final _dart_sqlite3_result_error _sqlite3_result_error = + _sqlite3_result_error_ptr.asFunction<_dart_sqlite3_result_error>(); void sqlite3_result_error16( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, ) { - return (_sqlite3_result_error16 ??= - _lookup>( - 'sqlite3_result_error16') - .asFunction<_dart_sqlite3_result_error16>())( + return _sqlite3_result_error16( arg0, arg1, arg2, ); } - _dart_sqlite3_result_error16? _sqlite3_result_error16; + late final _sqlite3_result_error16_ptr = + _lookup>( + 'sqlite3_result_error16'); + late final _dart_sqlite3_result_error16 _sqlite3_result_error16 = + _sqlite3_result_error16_ptr.asFunction<_dart_sqlite3_result_error16>(); void sqlite3_result_error_toobig( ffi.Pointer arg0, ) { - return (_sqlite3_result_error_toobig ??= - _lookup>( - 'sqlite3_result_error_toobig') - .asFunction<_dart_sqlite3_result_error_toobig>())( + return _sqlite3_result_error_toobig( arg0, ); } - _dart_sqlite3_result_error_toobig? _sqlite3_result_error_toobig; + late final _sqlite3_result_error_toobig_ptr = + _lookup>( + 'sqlite3_result_error_toobig'); + late final _dart_sqlite3_result_error_toobig _sqlite3_result_error_toobig = + _sqlite3_result_error_toobig_ptr + .asFunction<_dart_sqlite3_result_error_toobig>(); void sqlite3_result_error_nomem( ffi.Pointer arg0, ) { - return (_sqlite3_result_error_nomem ??= - _lookup>( - 'sqlite3_result_error_nomem') - .asFunction<_dart_sqlite3_result_error_nomem>())( + return _sqlite3_result_error_nomem( arg0, ); } - _dart_sqlite3_result_error_nomem? _sqlite3_result_error_nomem; + late final _sqlite3_result_error_nomem_ptr = + _lookup>( + 'sqlite3_result_error_nomem'); + late final _dart_sqlite3_result_error_nomem _sqlite3_result_error_nomem = + _sqlite3_result_error_nomem_ptr + .asFunction<_dart_sqlite3_result_error_nomem>(); void sqlite3_result_error_code( ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_result_error_code ??= - _lookup>( - 'sqlite3_result_error_code') - .asFunction<_dart_sqlite3_result_error_code>())( + return _sqlite3_result_error_code( arg0, arg1, ); } - _dart_sqlite3_result_error_code? _sqlite3_result_error_code; + late final _sqlite3_result_error_code_ptr = + _lookup>( + 'sqlite3_result_error_code'); + late final _dart_sqlite3_result_error_code _sqlite3_result_error_code = + _sqlite3_result_error_code_ptr + .asFunction<_dart_sqlite3_result_error_code>(); void sqlite3_result_int( ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_result_int ??= - _lookup>('sqlite3_result_int') - .asFunction<_dart_sqlite3_result_int>())( + return _sqlite3_result_int( arg0, arg1, ); } - _dart_sqlite3_result_int? _sqlite3_result_int; + late final _sqlite3_result_int_ptr = + _lookup>('sqlite3_result_int'); + late final _dart_sqlite3_result_int _sqlite3_result_int = + _sqlite3_result_int_ptr.asFunction<_dart_sqlite3_result_int>(); void sqlite3_result_int64( ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_result_int64 ??= - _lookup>( - 'sqlite3_result_int64') - .asFunction<_dart_sqlite3_result_int64>())( + return _sqlite3_result_int64( arg0, arg1, ); } - _dart_sqlite3_result_int64? _sqlite3_result_int64; + late final _sqlite3_result_int64_ptr = + _lookup>( + 'sqlite3_result_int64'); + late final _dart_sqlite3_result_int64 _sqlite3_result_int64 = + _sqlite3_result_int64_ptr.asFunction<_dart_sqlite3_result_int64>(); void sqlite3_result_null( ffi.Pointer arg0, ) { - return (_sqlite3_result_null ??= - _lookup>( - 'sqlite3_result_null') - .asFunction<_dart_sqlite3_result_null>())( + return _sqlite3_result_null( arg0, ); } - _dart_sqlite3_result_null? _sqlite3_result_null; + late final _sqlite3_result_null_ptr = + _lookup>( + 'sqlite3_result_null'); + late final _dart_sqlite3_result_null _sqlite3_result_null = + _sqlite3_result_null_ptr.asFunction<_dart_sqlite3_result_null>(); void sqlite3_result_text( ffi.Pointer arg0, @@ -5205,10 +5397,7 @@ class SQLite { int arg2, ffi.Pointer> arg3, ) { - return (_sqlite3_result_text ??= - _lookup>( - 'sqlite3_result_text') - .asFunction<_dart_sqlite3_result_text>())( + return _sqlite3_result_text( arg0, arg1, arg2, @@ -5216,7 +5405,11 @@ class SQLite { ); } - _dart_sqlite3_result_text? _sqlite3_result_text; + late final _sqlite3_result_text_ptr = + _lookup>( + 'sqlite3_result_text'); + late final _dart_sqlite3_result_text _sqlite3_result_text = + _sqlite3_result_text_ptr.asFunction<_dart_sqlite3_result_text>(); void sqlite3_result_text64( ffi.Pointer arg0, @@ -5225,10 +5418,7 @@ class SQLite { ffi.Pointer> arg3, int encoding, ) { - return (_sqlite3_result_text64 ??= - _lookup>( - 'sqlite3_result_text64') - .asFunction<_dart_sqlite3_result_text64>())( + return _sqlite3_result_text64( arg0, arg1, arg2, @@ -5237,7 +5427,11 @@ class SQLite { ); } - _dart_sqlite3_result_text64? _sqlite3_result_text64; + late final _sqlite3_result_text64_ptr = + _lookup>( + 'sqlite3_result_text64'); + late final _dart_sqlite3_result_text64 _sqlite3_result_text64 = + _sqlite3_result_text64_ptr.asFunction<_dart_sqlite3_result_text64>(); void sqlite3_result_text16( ffi.Pointer arg0, @@ -5245,10 +5439,7 @@ class SQLite { int arg2, ffi.Pointer> arg3, ) { - return (_sqlite3_result_text16 ??= - _lookup>( - 'sqlite3_result_text16') - .asFunction<_dart_sqlite3_result_text16>())( + return _sqlite3_result_text16( arg0, arg1, arg2, @@ -5256,7 +5447,11 @@ class SQLite { ); } - _dart_sqlite3_result_text16? _sqlite3_result_text16; + late final _sqlite3_result_text16_ptr = + _lookup>( + 'sqlite3_result_text16'); + late final _dart_sqlite3_result_text16 _sqlite3_result_text16 = + _sqlite3_result_text16_ptr.asFunction<_dart_sqlite3_result_text16>(); void sqlite3_result_text16le( ffi.Pointer arg0, @@ -5264,10 +5459,7 @@ class SQLite { int arg2, ffi.Pointer> arg3, ) { - return (_sqlite3_result_text16le ??= - _lookup>( - 'sqlite3_result_text16le') - .asFunction<_dart_sqlite3_result_text16le>())( + return _sqlite3_result_text16le( arg0, arg1, arg2, @@ -5275,7 +5467,11 @@ class SQLite { ); } - _dart_sqlite3_result_text16le? _sqlite3_result_text16le; + late final _sqlite3_result_text16le_ptr = + _lookup>( + 'sqlite3_result_text16le'); + late final _dart_sqlite3_result_text16le _sqlite3_result_text16le = + _sqlite3_result_text16le_ptr.asFunction<_dart_sqlite3_result_text16le>(); void sqlite3_result_text16be( ffi.Pointer arg0, @@ -5283,10 +5479,7 @@ class SQLite { int arg2, ffi.Pointer> arg3, ) { - return (_sqlite3_result_text16be ??= - _lookup>( - 'sqlite3_result_text16be') - .asFunction<_dart_sqlite3_result_text16be>())( + return _sqlite3_result_text16be( arg0, arg1, arg2, @@ -5294,22 +5487,27 @@ class SQLite { ); } - _dart_sqlite3_result_text16be? _sqlite3_result_text16be; + late final _sqlite3_result_text16be_ptr = + _lookup>( + 'sqlite3_result_text16be'); + late final _dart_sqlite3_result_text16be _sqlite3_result_text16be = + _sqlite3_result_text16be_ptr.asFunction<_dart_sqlite3_result_text16be>(); void sqlite3_result_value( ffi.Pointer arg0, ffi.Pointer arg1, ) { - return (_sqlite3_result_value ??= - _lookup>( - 'sqlite3_result_value') - .asFunction<_dart_sqlite3_result_value>())( + return _sqlite3_result_value( arg0, arg1, ); } - _dart_sqlite3_result_value? _sqlite3_result_value; + late final _sqlite3_result_value_ptr = + _lookup>( + 'sqlite3_result_value'); + late final _dart_sqlite3_result_value _sqlite3_result_value = + _sqlite3_result_value_ptr.asFunction<_dart_sqlite3_result_value>(); void sqlite3_result_pointer( ffi.Pointer arg0, @@ -5317,10 +5515,7 @@ class SQLite { ffi.Pointer arg2, ffi.Pointer> arg3, ) { - return (_sqlite3_result_pointer ??= - _lookup>( - 'sqlite3_result_pointer') - .asFunction<_dart_sqlite3_result_pointer>())( + return _sqlite3_result_pointer( arg0, arg1, arg2, @@ -5328,37 +5523,44 @@ class SQLite { ); } - _dart_sqlite3_result_pointer? _sqlite3_result_pointer; + late final _sqlite3_result_pointer_ptr = + _lookup>( + 'sqlite3_result_pointer'); + late final _dart_sqlite3_result_pointer _sqlite3_result_pointer = + _sqlite3_result_pointer_ptr.asFunction<_dart_sqlite3_result_pointer>(); void sqlite3_result_zeroblob( ffi.Pointer arg0, int n, ) { - return (_sqlite3_result_zeroblob ??= - _lookup>( - 'sqlite3_result_zeroblob') - .asFunction<_dart_sqlite3_result_zeroblob>())( + return _sqlite3_result_zeroblob( arg0, n, ); } - _dart_sqlite3_result_zeroblob? _sqlite3_result_zeroblob; + late final _sqlite3_result_zeroblob_ptr = + _lookup>( + 'sqlite3_result_zeroblob'); + late final _dart_sqlite3_result_zeroblob _sqlite3_result_zeroblob = + _sqlite3_result_zeroblob_ptr.asFunction<_dart_sqlite3_result_zeroblob>(); int sqlite3_result_zeroblob64( ffi.Pointer arg0, int n, ) { - return (_sqlite3_result_zeroblob64 ??= - _lookup>( - 'sqlite3_result_zeroblob64') - .asFunction<_dart_sqlite3_result_zeroblob64>())( + return _sqlite3_result_zeroblob64( arg0, n, ); } - _dart_sqlite3_result_zeroblob64? _sqlite3_result_zeroblob64; + late final _sqlite3_result_zeroblob64_ptr = + _lookup>( + 'sqlite3_result_zeroblob64'); + late final _dart_sqlite3_result_zeroblob64 _sqlite3_result_zeroblob64 = + _sqlite3_result_zeroblob64_ptr + .asFunction<_dart_sqlite3_result_zeroblob64>(); /// CAPI3REF: Setting The Subtype Of An SQL Function /// METHOD: sqlite3_context @@ -5374,16 +5576,17 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_result_subtype ??= - _lookup>( - 'sqlite3_result_subtype') - .asFunction<_dart_sqlite3_result_subtype>())( + return _sqlite3_result_subtype( arg0, arg1, ); } - _dart_sqlite3_result_subtype? _sqlite3_result_subtype; + late final _sqlite3_result_subtype_ptr = + _lookup>( + 'sqlite3_result_subtype'); + late final _dart_sqlite3_result_subtype _sqlite3_result_subtype = + _sqlite3_result_subtype_ptr.asFunction<_dart_sqlite3_result_subtype>(); /// CAPI3REF: Define New Collating Sequences /// METHOD: sqlite3 @@ -5471,10 +5674,7 @@ class SQLite { ffi.Pointer pArg, ffi.Pointer> xCompare, ) { - return (_sqlite3_create_collation ??= - _lookup>( - 'sqlite3_create_collation') - .asFunction<_dart_sqlite3_create_collation>())( + return _sqlite3_create_collation( arg0, zName, eTextRep, @@ -5483,7 +5683,12 @@ class SQLite { ); } - _dart_sqlite3_create_collation? _sqlite3_create_collation; + late final _sqlite3_create_collation_ptr = + _lookup>( + 'sqlite3_create_collation'); + late final _dart_sqlite3_create_collation _sqlite3_create_collation = + _sqlite3_create_collation_ptr + .asFunction<_dart_sqlite3_create_collation>(); int sqlite3_create_collation_v2( ffi.Pointer arg0, @@ -5493,10 +5698,7 @@ class SQLite { ffi.Pointer> xCompare, ffi.Pointer> xDestroy, ) { - return (_sqlite3_create_collation_v2 ??= - _lookup>( - 'sqlite3_create_collation_v2') - .asFunction<_dart_sqlite3_create_collation_v2>())( + return _sqlite3_create_collation_v2( arg0, zName, eTextRep, @@ -5506,7 +5708,12 @@ class SQLite { ); } - _dart_sqlite3_create_collation_v2? _sqlite3_create_collation_v2; + late final _sqlite3_create_collation_v2_ptr = + _lookup>( + 'sqlite3_create_collation_v2'); + late final _dart_sqlite3_create_collation_v2 _sqlite3_create_collation_v2 = + _sqlite3_create_collation_v2_ptr + .asFunction<_dart_sqlite3_create_collation_v2>(); int sqlite3_create_collation16( ffi.Pointer arg0, @@ -5515,10 +5722,7 @@ class SQLite { ffi.Pointer pArg, ffi.Pointer> xCompare, ) { - return (_sqlite3_create_collation16 ??= - _lookup>( - 'sqlite3_create_collation16') - .asFunction<_dart_sqlite3_create_collation16>())( + return _sqlite3_create_collation16( arg0, zName, eTextRep, @@ -5527,7 +5731,12 @@ class SQLite { ); } - _dart_sqlite3_create_collation16? _sqlite3_create_collation16; + late final _sqlite3_create_collation16_ptr = + _lookup>( + 'sqlite3_create_collation16'); + late final _dart_sqlite3_create_collation16 _sqlite3_create_collation16 = + _sqlite3_create_collation16_ptr + .asFunction<_dart_sqlite3_create_collation16>(); /// CAPI3REF: Collation Needed Callbacks /// METHOD: sqlite3 @@ -5559,34 +5768,38 @@ class SQLite { ffi.Pointer arg1, ffi.Pointer> arg2, ) { - return (_sqlite3_collation_needed ??= - _lookup>( - 'sqlite3_collation_needed') - .asFunction<_dart_sqlite3_collation_needed>())( + return _sqlite3_collation_needed( arg0, arg1, arg2, ); } - _dart_sqlite3_collation_needed? _sqlite3_collation_needed; + late final _sqlite3_collation_needed_ptr = + _lookup>( + 'sqlite3_collation_needed'); + late final _dart_sqlite3_collation_needed _sqlite3_collation_needed = + _sqlite3_collation_needed_ptr + .asFunction<_dart_sqlite3_collation_needed>(); int sqlite3_collation_needed16( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer> arg2, ) { - return (_sqlite3_collation_needed16 ??= - _lookup>( - 'sqlite3_collation_needed16') - .asFunction<_dart_sqlite3_collation_needed16>())( + return _sqlite3_collation_needed16( arg0, arg1, arg2, ); } - _dart_sqlite3_collation_needed16? _sqlite3_collation_needed16; + late final _sqlite3_collation_needed16_ptr = + _lookup>( + 'sqlite3_collation_needed16'); + late final _dart_sqlite3_collation_needed16 _sqlite3_collation_needed16 = + _sqlite3_collation_needed16_ptr + .asFunction<_dart_sqlite3_collation_needed16>(); /// CAPI3REF: Suspend Execution For A Short Time /// @@ -5606,14 +5819,15 @@ class SQLite { int sqlite3_sleep( int arg0, ) { - return (_sqlite3_sleep ??= - _lookup>('sqlite3_sleep') - .asFunction<_dart_sqlite3_sleep>())( + return _sqlite3_sleep( arg0, ); } - _dart_sqlite3_sleep? _sqlite3_sleep; + late final _sqlite3_sleep_ptr = + _lookup>('sqlite3_sleep'); + late final _dart_sqlite3_sleep _sqlite3_sleep = + _sqlite3_sleep_ptr.asFunction<_dart_sqlite3_sleep>(); /// CAPI3REF: Name Of The Folder Holding Temporary Files /// @@ -5741,46 +5955,52 @@ class SQLite { int type, ffi.Pointer zValue, ) { - return (_sqlite3_win32_set_directory ??= - _lookup>( - 'sqlite3_win32_set_directory') - .asFunction<_dart_sqlite3_win32_set_directory>())( + return _sqlite3_win32_set_directory( type, zValue, ); } - _dart_sqlite3_win32_set_directory? _sqlite3_win32_set_directory; + late final _sqlite3_win32_set_directory_ptr = + _lookup>( + 'sqlite3_win32_set_directory'); + late final _dart_sqlite3_win32_set_directory _sqlite3_win32_set_directory = + _sqlite3_win32_set_directory_ptr + .asFunction<_dart_sqlite3_win32_set_directory>(); int sqlite3_win32_set_directory8( int type, ffi.Pointer zValue, ) { - return (_sqlite3_win32_set_directory8 ??= - _lookup>( - 'sqlite3_win32_set_directory8') - .asFunction<_dart_sqlite3_win32_set_directory8>())( + return _sqlite3_win32_set_directory8( type, zValue, ); } - _dart_sqlite3_win32_set_directory8? _sqlite3_win32_set_directory8; + late final _sqlite3_win32_set_directory8_ptr = + _lookup>( + 'sqlite3_win32_set_directory8'); + late final _dart_sqlite3_win32_set_directory8 _sqlite3_win32_set_directory8 = + _sqlite3_win32_set_directory8_ptr + .asFunction<_dart_sqlite3_win32_set_directory8>(); int sqlite3_win32_set_directory16( int type, ffi.Pointer zValue, ) { - return (_sqlite3_win32_set_directory16 ??= - _lookup>( - 'sqlite3_win32_set_directory16') - .asFunction<_dart_sqlite3_win32_set_directory16>())( + return _sqlite3_win32_set_directory16( type, zValue, ); } - _dart_sqlite3_win32_set_directory16? _sqlite3_win32_set_directory16; + late final _sqlite3_win32_set_directory16_ptr = + _lookup>( + 'sqlite3_win32_set_directory16'); + late final _dart_sqlite3_win32_set_directory16 + _sqlite3_win32_set_directory16 = _sqlite3_win32_set_directory16_ptr + .asFunction<_dart_sqlite3_win32_set_directory16>(); /// CAPI3REF: Test For Auto-Commit Mode /// KEYWORDS: {autocommit mode} @@ -5805,15 +6025,16 @@ class SQLite { int sqlite3_get_autocommit( ffi.Pointer arg0, ) { - return (_sqlite3_get_autocommit ??= - _lookup>( - 'sqlite3_get_autocommit') - .asFunction<_dart_sqlite3_get_autocommit>())( + return _sqlite3_get_autocommit( arg0, ); } - _dart_sqlite3_get_autocommit? _sqlite3_get_autocommit; + late final _sqlite3_get_autocommit_ptr = + _lookup>( + 'sqlite3_get_autocommit'); + late final _dart_sqlite3_get_autocommit _sqlite3_get_autocommit = + _sqlite3_get_autocommit_ptr.asFunction<_dart_sqlite3_get_autocommit>(); /// CAPI3REF: Find The Database Handle Of A Prepared Statement /// METHOD: sqlite3_stmt @@ -5827,14 +6048,15 @@ class SQLite { ffi.Pointer sqlite3_db_handle( ffi.Pointer arg0, ) { - return (_sqlite3_db_handle ??= - _lookup>('sqlite3_db_handle') - .asFunction<_dart_sqlite3_db_handle>())( + return _sqlite3_db_handle( arg0, ); } - _dart_sqlite3_db_handle? _sqlite3_db_handle; + late final _sqlite3_db_handle_ptr = + _lookup>('sqlite3_db_handle'); + late final _dart_sqlite3_db_handle _sqlite3_db_handle = + _sqlite3_db_handle_ptr.asFunction<_dart_sqlite3_db_handle>(); /// CAPI3REF: Return The Filename For A Database Connection /// METHOD: sqlite3 @@ -5868,16 +6090,17 @@ class SQLite { ffi.Pointer db, ffi.Pointer zDbName, ) { - return (_sqlite3_db_filename ??= - _lookup>( - 'sqlite3_db_filename') - .asFunction<_dart_sqlite3_db_filename>())( + return _sqlite3_db_filename( db, zDbName, ); } - _dart_sqlite3_db_filename? _sqlite3_db_filename; + late final _sqlite3_db_filename_ptr = + _lookup>( + 'sqlite3_db_filename'); + late final _dart_sqlite3_db_filename _sqlite3_db_filename = + _sqlite3_db_filename_ptr.asFunction<_dart_sqlite3_db_filename>(); /// CAPI3REF: Determine if a database is read-only /// METHOD: sqlite3 @@ -5889,16 +6112,17 @@ class SQLite { ffi.Pointer db, ffi.Pointer zDbName, ) { - return (_sqlite3_db_readonly ??= - _lookup>( - 'sqlite3_db_readonly') - .asFunction<_dart_sqlite3_db_readonly>())( + return _sqlite3_db_readonly( db, zDbName, ); } - _dart_sqlite3_db_readonly? _sqlite3_db_readonly; + late final _sqlite3_db_readonly_ptr = + _lookup>( + 'sqlite3_db_readonly'); + late final _dart_sqlite3_db_readonly _sqlite3_db_readonly = + _sqlite3_db_readonly_ptr.asFunction<_dart_sqlite3_db_readonly>(); /// CAPI3REF: Find the next prepared statement /// METHOD: sqlite3 @@ -5916,15 +6140,16 @@ class SQLite { ffi.Pointer pDb, ffi.Pointer pStmt, ) { - return (_sqlite3_next_stmt ??= - _lookup>('sqlite3_next_stmt') - .asFunction<_dart_sqlite3_next_stmt>())( + return _sqlite3_next_stmt( pDb, pStmt, ); } - _dart_sqlite3_next_stmt? _sqlite3_next_stmt; + late final _sqlite3_next_stmt_ptr = + _lookup>('sqlite3_next_stmt'); + late final _dart_sqlite3_next_stmt _sqlite3_next_stmt = + _sqlite3_next_stmt_ptr.asFunction<_dart_sqlite3_next_stmt>(); /// CAPI3REF: Commit And Rollback Notification Callbacks /// METHOD: sqlite3 @@ -5976,34 +6201,36 @@ class SQLite { ffi.Pointer> arg1, ffi.Pointer arg2, ) { - return (_sqlite3_commit_hook ??= - _lookup>( - 'sqlite3_commit_hook') - .asFunction<_dart_sqlite3_commit_hook>())( + return _sqlite3_commit_hook( arg0, arg1, arg2, ); } - _dart_sqlite3_commit_hook? _sqlite3_commit_hook; + late final _sqlite3_commit_hook_ptr = + _lookup>( + 'sqlite3_commit_hook'); + late final _dart_sqlite3_commit_hook _sqlite3_commit_hook = + _sqlite3_commit_hook_ptr.asFunction<_dart_sqlite3_commit_hook>(); ffi.Pointer sqlite3_rollback_hook( ffi.Pointer arg0, ffi.Pointer> arg1, ffi.Pointer arg2, ) { - return (_sqlite3_rollback_hook ??= - _lookup>( - 'sqlite3_rollback_hook') - .asFunction<_dart_sqlite3_rollback_hook>())( + return _sqlite3_rollback_hook( arg0, arg1, arg2, ); } - _dart_sqlite3_rollback_hook? _sqlite3_rollback_hook; + late final _sqlite3_rollback_hook_ptr = + _lookup>( + 'sqlite3_rollback_hook'); + late final _dart_sqlite3_rollback_hook _sqlite3_rollback_hook = + _sqlite3_rollback_hook_ptr.asFunction<_dart_sqlite3_rollback_hook>(); /// CAPI3REF: Data Change Notification Callbacks /// METHOD: sqlite3 @@ -6057,17 +6284,18 @@ class SQLite { ffi.Pointer> arg1, ffi.Pointer arg2, ) { - return (_sqlite3_update_hook ??= - _lookup>( - 'sqlite3_update_hook') - .asFunction<_dart_sqlite3_update_hook>())( + return _sqlite3_update_hook( arg0, arg1, arg2, ); } - _dart_sqlite3_update_hook? _sqlite3_update_hook; + late final _sqlite3_update_hook_ptr = + _lookup>( + 'sqlite3_update_hook'); + late final _dart_sqlite3_update_hook _sqlite3_update_hook = + _sqlite3_update_hook_ptr.asFunction<_dart_sqlite3_update_hook>(); /// CAPI3REF: Enable Or Disable Shared Pager Cache /// @@ -6109,15 +6337,17 @@ class SQLite { int sqlite3_enable_shared_cache( int arg0, ) { - return (_sqlite3_enable_shared_cache ??= - _lookup>( - 'sqlite3_enable_shared_cache') - .asFunction<_dart_sqlite3_enable_shared_cache>())( + return _sqlite3_enable_shared_cache( arg0, ); } - _dart_sqlite3_enable_shared_cache? _sqlite3_enable_shared_cache; + late final _sqlite3_enable_shared_cache_ptr = + _lookup>( + 'sqlite3_enable_shared_cache'); + late final _dart_sqlite3_enable_shared_cache _sqlite3_enable_shared_cache = + _sqlite3_enable_shared_cache_ptr + .asFunction<_dart_sqlite3_enable_shared_cache>(); /// CAPI3REF: Attempt To Free Heap Memory /// @@ -6134,15 +6364,16 @@ class SQLite { int sqlite3_release_memory( int arg0, ) { - return (_sqlite3_release_memory ??= - _lookup>( - 'sqlite3_release_memory') - .asFunction<_dart_sqlite3_release_memory>())( + return _sqlite3_release_memory( arg0, ); } - _dart_sqlite3_release_memory? _sqlite3_release_memory; + late final _sqlite3_release_memory_ptr = + _lookup>( + 'sqlite3_release_memory'); + late final _dart_sqlite3_release_memory _sqlite3_release_memory = + _sqlite3_release_memory_ptr.asFunction<_dart_sqlite3_release_memory>(); /// CAPI3REF: Free Memory Used By A Database Connection /// METHOD: sqlite3 @@ -6157,15 +6388,17 @@ class SQLite { int sqlite3_db_release_memory( ffi.Pointer arg0, ) { - return (_sqlite3_db_release_memory ??= - _lookup>( - 'sqlite3_db_release_memory') - .asFunction<_dart_sqlite3_db_release_memory>())( + return _sqlite3_db_release_memory( arg0, ); } - _dart_sqlite3_db_release_memory? _sqlite3_db_release_memory; + late final _sqlite3_db_release_memory_ptr = + _lookup>( + 'sqlite3_db_release_memory'); + late final _dart_sqlite3_db_release_memory _sqlite3_db_release_memory = + _sqlite3_db_release_memory_ptr + .asFunction<_dart_sqlite3_db_release_memory>(); /// CAPI3REF: Impose A Limit On Heap Size /// @@ -6232,28 +6465,32 @@ class SQLite { int sqlite3_soft_heap_limit64( int N, ) { - return (_sqlite3_soft_heap_limit64 ??= - _lookup>( - 'sqlite3_soft_heap_limit64') - .asFunction<_dart_sqlite3_soft_heap_limit64>())( + return _sqlite3_soft_heap_limit64( N, ); } - _dart_sqlite3_soft_heap_limit64? _sqlite3_soft_heap_limit64; + late final _sqlite3_soft_heap_limit64_ptr = + _lookup>( + 'sqlite3_soft_heap_limit64'); + late final _dart_sqlite3_soft_heap_limit64 _sqlite3_soft_heap_limit64 = + _sqlite3_soft_heap_limit64_ptr + .asFunction<_dart_sqlite3_soft_heap_limit64>(); int sqlite3_hard_heap_limit64( int N, ) { - return (_sqlite3_hard_heap_limit64 ??= - _lookup>( - 'sqlite3_hard_heap_limit64') - .asFunction<_dart_sqlite3_hard_heap_limit64>())( + return _sqlite3_hard_heap_limit64( N, ); } - _dart_sqlite3_hard_heap_limit64? _sqlite3_hard_heap_limit64; + late final _sqlite3_hard_heap_limit64_ptr = + _lookup>( + 'sqlite3_hard_heap_limit64'); + late final _dart_sqlite3_hard_heap_limit64 _sqlite3_hard_heap_limit64 = + _sqlite3_hard_heap_limit64_ptr + .asFunction<_dart_sqlite3_hard_heap_limit64>(); /// CAPI3REF: Deprecated Soft Heap Limit Interface /// DEPRECATED @@ -6265,15 +6502,16 @@ class SQLite { void sqlite3_soft_heap_limit( int N, ) { - return (_sqlite3_soft_heap_limit ??= - _lookup>( - 'sqlite3_soft_heap_limit') - .asFunction<_dart_sqlite3_soft_heap_limit>())( + return _sqlite3_soft_heap_limit( N, ); } - _dart_sqlite3_soft_heap_limit? _sqlite3_soft_heap_limit; + late final _sqlite3_soft_heap_limit_ptr = + _lookup>( + 'sqlite3_soft_heap_limit'); + late final _dart_sqlite3_soft_heap_limit _sqlite3_soft_heap_limit = + _sqlite3_soft_heap_limit_ptr.asFunction<_dart_sqlite3_soft_heap_limit>(); /// CAPI3REF: Extract Metadata About A Column Of A Table /// METHOD: sqlite3 @@ -6353,10 +6591,7 @@ class SQLite { ffi.Pointer pPrimaryKey, ffi.Pointer pAutoinc, ) { - return (_sqlite3_table_column_metadata ??= - _lookup>( - 'sqlite3_table_column_metadata') - .asFunction<_dart_sqlite3_table_column_metadata>())( + return _sqlite3_table_column_metadata( db, zDbName, zTableName, @@ -6369,7 +6604,12 @@ class SQLite { ); } - _dart_sqlite3_table_column_metadata? _sqlite3_table_column_metadata; + late final _sqlite3_table_column_metadata_ptr = + _lookup>( + 'sqlite3_table_column_metadata'); + late final _dart_sqlite3_table_column_metadata + _sqlite3_table_column_metadata = _sqlite3_table_column_metadata_ptr + .asFunction<_dart_sqlite3_table_column_metadata>(); /// CAPI3REF: Load An Extension /// METHOD: sqlite3 @@ -6419,10 +6659,7 @@ class SQLite { ffi.Pointer zProc, ffi.Pointer> pzErrMsg, ) { - return (_sqlite3_load_extension ??= - _lookup>( - 'sqlite3_load_extension') - .asFunction<_dart_sqlite3_load_extension>())( + return _sqlite3_load_extension( db, zFile, zProc, @@ -6430,7 +6667,11 @@ class SQLite { ); } - _dart_sqlite3_load_extension? _sqlite3_load_extension; + late final _sqlite3_load_extension_ptr = + _lookup>( + 'sqlite3_load_extension'); + late final _dart_sqlite3_load_extension _sqlite3_load_extension = + _sqlite3_load_extension_ptr.asFunction<_dart_sqlite3_load_extension>(); /// CAPI3REF: Enable Or Disable Extension Loading /// METHOD: sqlite3 @@ -6459,16 +6700,18 @@ class SQLite { ffi.Pointer db, int onoff, ) { - return (_sqlite3_enable_load_extension ??= - _lookup>( - 'sqlite3_enable_load_extension') - .asFunction<_dart_sqlite3_enable_load_extension>())( + return _sqlite3_enable_load_extension( db, onoff, ); } - _dart_sqlite3_enable_load_extension? _sqlite3_enable_load_extension; + late final _sqlite3_enable_load_extension_ptr = + _lookup>( + 'sqlite3_enable_load_extension'); + late final _dart_sqlite3_enable_load_extension + _sqlite3_enable_load_extension = _sqlite3_enable_load_extension_ptr + .asFunction<_dart_sqlite3_enable_load_extension>(); /// CAPI3REF: Automatically Load Statically Linked Extensions /// @@ -6507,15 +6750,16 @@ class SQLite { int sqlite3_auto_extension( ffi.Pointer> xEntryPoint, ) { - return (_sqlite3_auto_extension ??= - _lookup>( - 'sqlite3_auto_extension') - .asFunction<_dart_sqlite3_auto_extension>())( + return _sqlite3_auto_extension( xEntryPoint, ); } - _dart_sqlite3_auto_extension? _sqlite3_auto_extension; + late final _sqlite3_auto_extension_ptr = + _lookup>( + 'sqlite3_auto_extension'); + late final _dart_sqlite3_auto_extension _sqlite3_auto_extension = + _sqlite3_auto_extension_ptr.asFunction<_dart_sqlite3_auto_extension>(); /// CAPI3REF: Cancel Automatic Extension Loading /// @@ -6528,28 +6772,32 @@ class SQLite { int sqlite3_cancel_auto_extension( ffi.Pointer> xEntryPoint, ) { - return (_sqlite3_cancel_auto_extension ??= - _lookup>( - 'sqlite3_cancel_auto_extension') - .asFunction<_dart_sqlite3_cancel_auto_extension>())( + return _sqlite3_cancel_auto_extension( xEntryPoint, ); } - _dart_sqlite3_cancel_auto_extension? _sqlite3_cancel_auto_extension; + late final _sqlite3_cancel_auto_extension_ptr = + _lookup>( + 'sqlite3_cancel_auto_extension'); + late final _dart_sqlite3_cancel_auto_extension + _sqlite3_cancel_auto_extension = _sqlite3_cancel_auto_extension_ptr + .asFunction<_dart_sqlite3_cancel_auto_extension>(); /// CAPI3REF: Reset Automatic Extension Loading /// /// ^This interface disables all automatic extensions previously /// registered using [sqlite3_auto_extension()]. void sqlite3_reset_auto_extension() { - return (_sqlite3_reset_auto_extension ??= - _lookup>( - 'sqlite3_reset_auto_extension') - .asFunction<_dart_sqlite3_reset_auto_extension>())(); + return _sqlite3_reset_auto_extension(); } - _dart_sqlite3_reset_auto_extension? _sqlite3_reset_auto_extension; + late final _sqlite3_reset_auto_extension_ptr = + _lookup>( + 'sqlite3_reset_auto_extension'); + late final _dart_sqlite3_reset_auto_extension _sqlite3_reset_auto_extension = + _sqlite3_reset_auto_extension_ptr + .asFunction<_dart_sqlite3_reset_auto_extension>(); /// CAPI3REF: Register A Virtual Table Implementation /// METHOD: sqlite3 @@ -6587,10 +6835,7 @@ class SQLite { ffi.Pointer p, ffi.Pointer pClientData, ) { - return (_sqlite3_create_module ??= - _lookup>( - 'sqlite3_create_module') - .asFunction<_dart_sqlite3_create_module>())( + return _sqlite3_create_module( db, zName, p, @@ -6598,7 +6843,11 @@ class SQLite { ); } - _dart_sqlite3_create_module? _sqlite3_create_module; + late final _sqlite3_create_module_ptr = + _lookup>( + 'sqlite3_create_module'); + late final _dart_sqlite3_create_module _sqlite3_create_module = + _sqlite3_create_module_ptr.asFunction<_dart_sqlite3_create_module>(); int sqlite3_create_module_v2( ffi.Pointer db, @@ -6607,10 +6856,7 @@ class SQLite { ffi.Pointer pClientData, ffi.Pointer> xDestroy, ) { - return (_sqlite3_create_module_v2 ??= - _lookup>( - 'sqlite3_create_module_v2') - .asFunction<_dart_sqlite3_create_module_v2>())( + return _sqlite3_create_module_v2( db, zName, p, @@ -6619,7 +6865,12 @@ class SQLite { ); } - _dart_sqlite3_create_module_v2? _sqlite3_create_module_v2; + late final _sqlite3_create_module_v2_ptr = + _lookup>( + 'sqlite3_create_module_v2'); + late final _dart_sqlite3_create_module_v2 _sqlite3_create_module_v2 = + _sqlite3_create_module_v2_ptr + .asFunction<_dart_sqlite3_create_module_v2>(); /// CAPI3REF: Remove Unnecessary Virtual Table Implementations /// METHOD: sqlite3 @@ -6635,16 +6886,17 @@ class SQLite { ffi.Pointer db, ffi.Pointer> azKeep, ) { - return (_sqlite3_drop_modules ??= - _lookup>( - 'sqlite3_drop_modules') - .asFunction<_dart_sqlite3_drop_modules>())( + return _sqlite3_drop_modules( db, azKeep, ); } - _dart_sqlite3_drop_modules? _sqlite3_drop_modules; + late final _sqlite3_drop_modules_ptr = + _lookup>( + 'sqlite3_drop_modules'); + late final _dart_sqlite3_drop_modules _sqlite3_drop_modules = + _sqlite3_drop_modules_ptr.asFunction<_dart_sqlite3_drop_modules>(); /// CAPI3REF: Declare The Schema Of A Virtual Table /// @@ -6656,16 +6908,17 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer zSQL, ) { - return (_sqlite3_declare_vtab ??= - _lookup>( - 'sqlite3_declare_vtab') - .asFunction<_dart_sqlite3_declare_vtab>())( + return _sqlite3_declare_vtab( arg0, zSQL, ); } - _dart_sqlite3_declare_vtab? _sqlite3_declare_vtab; + late final _sqlite3_declare_vtab_ptr = + _lookup>( + 'sqlite3_declare_vtab'); + late final _dart_sqlite3_declare_vtab _sqlite3_declare_vtab = + _sqlite3_declare_vtab_ptr.asFunction<_dart_sqlite3_declare_vtab>(); /// CAPI3REF: Overload A Function For A Virtual Table /// METHOD: sqlite3 @@ -6687,17 +6940,19 @@ class SQLite { ffi.Pointer zFuncName, int nArg, ) { - return (_sqlite3_overload_function ??= - _lookup>( - 'sqlite3_overload_function') - .asFunction<_dart_sqlite3_overload_function>())( + return _sqlite3_overload_function( arg0, zFuncName, nArg, ); } - _dart_sqlite3_overload_function? _sqlite3_overload_function; + late final _sqlite3_overload_function_ptr = + _lookup>( + 'sqlite3_overload_function'); + late final _dart_sqlite3_overload_function _sqlite3_overload_function = + _sqlite3_overload_function_ptr + .asFunction<_dart_sqlite3_overload_function>(); /// CAPI3REF: Open A BLOB For Incremental I/O /// METHOD: sqlite3 @@ -6789,9 +7044,7 @@ class SQLite { int flags, ffi.Pointer> ppBlob, ) { - return (_sqlite3_blob_open ??= - _lookup>('sqlite3_blob_open') - .asFunction<_dart_sqlite3_blob_open>())( + return _sqlite3_blob_open( arg0, zDb, zTable, @@ -6802,7 +7055,10 @@ class SQLite { ); } - _dart_sqlite3_blob_open? _sqlite3_blob_open; + late final _sqlite3_blob_open_ptr = + _lookup>('sqlite3_blob_open'); + late final _dart_sqlite3_blob_open _sqlite3_blob_open = + _sqlite3_blob_open_ptr.asFunction<_dart_sqlite3_blob_open>(); /// CAPI3REF: Move a BLOB Handle to a New Row /// METHOD: sqlite3_blob @@ -6829,16 +7085,17 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_blob_reopen ??= - _lookup>( - 'sqlite3_blob_reopen') - .asFunction<_dart_sqlite3_blob_reopen>())( + return _sqlite3_blob_reopen( arg0, arg1, ); } - _dart_sqlite3_blob_reopen? _sqlite3_blob_reopen; + late final _sqlite3_blob_reopen_ptr = + _lookup>( + 'sqlite3_blob_reopen'); + late final _dart_sqlite3_blob_reopen _sqlite3_blob_reopen = + _sqlite3_blob_reopen_ptr.asFunction<_dart_sqlite3_blob_reopen>(); /// CAPI3REF: Close A BLOB Handle /// DESTRUCTOR: sqlite3_blob @@ -6862,14 +7119,15 @@ class SQLite { int sqlite3_blob_close( ffi.Pointer arg0, ) { - return (_sqlite3_blob_close ??= - _lookup>('sqlite3_blob_close') - .asFunction<_dart_sqlite3_blob_close>())( + return _sqlite3_blob_close( arg0, ); } - _dart_sqlite3_blob_close? _sqlite3_blob_close; + late final _sqlite3_blob_close_ptr = + _lookup>('sqlite3_blob_close'); + late final _dart_sqlite3_blob_close _sqlite3_blob_close = + _sqlite3_blob_close_ptr.asFunction<_dart_sqlite3_blob_close>(); /// CAPI3REF: Return The Size Of An Open BLOB /// METHOD: sqlite3_blob @@ -6886,14 +7144,15 @@ class SQLite { int sqlite3_blob_bytes( ffi.Pointer arg0, ) { - return (_sqlite3_blob_bytes ??= - _lookup>('sqlite3_blob_bytes') - .asFunction<_dart_sqlite3_blob_bytes>())( + return _sqlite3_blob_bytes( arg0, ); } - _dart_sqlite3_blob_bytes? _sqlite3_blob_bytes; + late final _sqlite3_blob_bytes_ptr = + _lookup>('sqlite3_blob_bytes'); + late final _dart_sqlite3_blob_bytes _sqlite3_blob_bytes = + _sqlite3_blob_bytes_ptr.asFunction<_dart_sqlite3_blob_bytes>(); /// CAPI3REF: Read Data From A BLOB Incrementally /// METHOD: sqlite3_blob @@ -6926,9 +7185,7 @@ class SQLite { int N, int iOffset, ) { - return (_sqlite3_blob_read ??= - _lookup>('sqlite3_blob_read') - .asFunction<_dart_sqlite3_blob_read>())( + return _sqlite3_blob_read( arg0, Z, N, @@ -6936,7 +7193,10 @@ class SQLite { ); } - _dart_sqlite3_blob_read? _sqlite3_blob_read; + late final _sqlite3_blob_read_ptr = + _lookup>('sqlite3_blob_read'); + late final _dart_sqlite3_blob_read _sqlite3_blob_read = + _sqlite3_blob_read_ptr.asFunction<_dart_sqlite3_blob_read>(); /// CAPI3REF: Write Data Into A BLOB Incrementally /// METHOD: sqlite3_blob @@ -6982,9 +7242,7 @@ class SQLite { int n, int iOffset, ) { - return (_sqlite3_blob_write ??= - _lookup>('sqlite3_blob_write') - .asFunction<_dart_sqlite3_blob_write>())( + return _sqlite3_blob_write( arg0, z, n, @@ -6992,7 +7250,10 @@ class SQLite { ); } - _dart_sqlite3_blob_write? _sqlite3_blob_write; + late final _sqlite3_blob_write_ptr = + _lookup>('sqlite3_blob_write'); + late final _dart_sqlite3_blob_write _sqlite3_blob_write = + _sqlite3_blob_write_ptr.asFunction<_dart_sqlite3_blob_write>(); /// CAPI3REF: Virtual File System Objects /// @@ -7024,42 +7285,45 @@ class SQLite { ffi.Pointer sqlite3_vfs_find( ffi.Pointer zVfsName, ) { - return (_sqlite3_vfs_find ??= - _lookup>('sqlite3_vfs_find') - .asFunction<_dart_sqlite3_vfs_find>())( + return _sqlite3_vfs_find( zVfsName, ); } - _dart_sqlite3_vfs_find? _sqlite3_vfs_find; + late final _sqlite3_vfs_find_ptr = + _lookup>('sqlite3_vfs_find'); + late final _dart_sqlite3_vfs_find _sqlite3_vfs_find = + _sqlite3_vfs_find_ptr.asFunction<_dart_sqlite3_vfs_find>(); int sqlite3_vfs_register( ffi.Pointer arg0, int makeDflt, ) { - return (_sqlite3_vfs_register ??= - _lookup>( - 'sqlite3_vfs_register') - .asFunction<_dart_sqlite3_vfs_register>())( + return _sqlite3_vfs_register( arg0, makeDflt, ); } - _dart_sqlite3_vfs_register? _sqlite3_vfs_register; + late final _sqlite3_vfs_register_ptr = + _lookup>( + 'sqlite3_vfs_register'); + late final _dart_sqlite3_vfs_register _sqlite3_vfs_register = + _sqlite3_vfs_register_ptr.asFunction<_dart_sqlite3_vfs_register>(); int sqlite3_vfs_unregister( ffi.Pointer arg0, ) { - return (_sqlite3_vfs_unregister ??= - _lookup>( - 'sqlite3_vfs_unregister') - .asFunction<_dart_sqlite3_vfs_unregister>())( + return _sqlite3_vfs_unregister( arg0, ); } - _dart_sqlite3_vfs_unregister? _sqlite3_vfs_unregister; + late final _sqlite3_vfs_unregister_ptr = + _lookup>( + 'sqlite3_vfs_unregister'); + late final _dart_sqlite3_vfs_unregister _sqlite3_vfs_unregister = + _sqlite3_vfs_unregister_ptr.asFunction<_dart_sqlite3_vfs_unregister>(); /// CAPI3REF: Mutexes /// @@ -7176,90 +7440,97 @@ class SQLite { ffi.Pointer sqlite3_mutex_alloc( int arg0, ) { - return (_sqlite3_mutex_alloc ??= - _lookup>( - 'sqlite3_mutex_alloc') - .asFunction<_dart_sqlite3_mutex_alloc>())( + return _sqlite3_mutex_alloc( arg0, ); } - _dart_sqlite3_mutex_alloc? _sqlite3_mutex_alloc; + late final _sqlite3_mutex_alloc_ptr = + _lookup>( + 'sqlite3_mutex_alloc'); + late final _dart_sqlite3_mutex_alloc _sqlite3_mutex_alloc = + _sqlite3_mutex_alloc_ptr.asFunction<_dart_sqlite3_mutex_alloc>(); void sqlite3_mutex_free( ffi.Pointer arg0, ) { - return (_sqlite3_mutex_free ??= - _lookup>('sqlite3_mutex_free') - .asFunction<_dart_sqlite3_mutex_free>())( + return _sqlite3_mutex_free( arg0, ); } - _dart_sqlite3_mutex_free? _sqlite3_mutex_free; + late final _sqlite3_mutex_free_ptr = + _lookup>('sqlite3_mutex_free'); + late final _dart_sqlite3_mutex_free _sqlite3_mutex_free = + _sqlite3_mutex_free_ptr.asFunction<_dart_sqlite3_mutex_free>(); void sqlite3_mutex_enter( ffi.Pointer arg0, ) { - return (_sqlite3_mutex_enter ??= - _lookup>( - 'sqlite3_mutex_enter') - .asFunction<_dart_sqlite3_mutex_enter>())( + return _sqlite3_mutex_enter( arg0, ); } - _dart_sqlite3_mutex_enter? _sqlite3_mutex_enter; + late final _sqlite3_mutex_enter_ptr = + _lookup>( + 'sqlite3_mutex_enter'); + late final _dart_sqlite3_mutex_enter _sqlite3_mutex_enter = + _sqlite3_mutex_enter_ptr.asFunction<_dart_sqlite3_mutex_enter>(); int sqlite3_mutex_try( ffi.Pointer arg0, ) { - return (_sqlite3_mutex_try ??= - _lookup>('sqlite3_mutex_try') - .asFunction<_dart_sqlite3_mutex_try>())( + return _sqlite3_mutex_try( arg0, ); } - _dart_sqlite3_mutex_try? _sqlite3_mutex_try; + late final _sqlite3_mutex_try_ptr = + _lookup>('sqlite3_mutex_try'); + late final _dart_sqlite3_mutex_try _sqlite3_mutex_try = + _sqlite3_mutex_try_ptr.asFunction<_dart_sqlite3_mutex_try>(); void sqlite3_mutex_leave( ffi.Pointer arg0, ) { - return (_sqlite3_mutex_leave ??= - _lookup>( - 'sqlite3_mutex_leave') - .asFunction<_dart_sqlite3_mutex_leave>())( + return _sqlite3_mutex_leave( arg0, ); } - _dart_sqlite3_mutex_leave? _sqlite3_mutex_leave; + late final _sqlite3_mutex_leave_ptr = + _lookup>( + 'sqlite3_mutex_leave'); + late final _dart_sqlite3_mutex_leave _sqlite3_mutex_leave = + _sqlite3_mutex_leave_ptr.asFunction<_dart_sqlite3_mutex_leave>(); int sqlite3_mutex_held( ffi.Pointer arg0, ) { - return (_sqlite3_mutex_held ??= - _lookup>('sqlite3_mutex_held') - .asFunction<_dart_sqlite3_mutex_held>())( + return _sqlite3_mutex_held( arg0, ); } - _dart_sqlite3_mutex_held? _sqlite3_mutex_held; + late final _sqlite3_mutex_held_ptr = + _lookup>('sqlite3_mutex_held'); + late final _dart_sqlite3_mutex_held _sqlite3_mutex_held = + _sqlite3_mutex_held_ptr.asFunction<_dart_sqlite3_mutex_held>(); int sqlite3_mutex_notheld( ffi.Pointer arg0, ) { - return (_sqlite3_mutex_notheld ??= - _lookup>( - 'sqlite3_mutex_notheld') - .asFunction<_dart_sqlite3_mutex_notheld>())( + return _sqlite3_mutex_notheld( arg0, ); } - _dart_sqlite3_mutex_notheld? _sqlite3_mutex_notheld; + late final _sqlite3_mutex_notheld_ptr = + _lookup>( + 'sqlite3_mutex_notheld'); + late final _dart_sqlite3_mutex_notheld _sqlite3_mutex_notheld = + _sqlite3_mutex_notheld_ptr.asFunction<_dart_sqlite3_mutex_notheld>(); /// CAPI3REF: Retrieve the mutex for a database connection /// METHOD: sqlite3 @@ -7272,14 +7543,15 @@ class SQLite { ffi.Pointer sqlite3_db_mutex( ffi.Pointer arg0, ) { - return (_sqlite3_db_mutex ??= - _lookup>('sqlite3_db_mutex') - .asFunction<_dart_sqlite3_db_mutex>())( + return _sqlite3_db_mutex( arg0, ); } - _dart_sqlite3_db_mutex? _sqlite3_db_mutex; + late final _sqlite3_db_mutex_ptr = + _lookup>('sqlite3_db_mutex'); + late final _dart_sqlite3_db_mutex _sqlite3_db_mutex = + _sqlite3_db_mutex_ptr.asFunction<_dart_sqlite3_db_mutex>(); /// CAPI3REF: Low-Level Control Of Database Files /// METHOD: sqlite3 @@ -7326,10 +7598,7 @@ class SQLite { int op, ffi.Pointer arg3, ) { - return (_sqlite3_file_control ??= - _lookup>( - 'sqlite3_file_control') - .asFunction<_dart_sqlite3_file_control>())( + return _sqlite3_file_control( arg0, zDbName, op, @@ -7337,7 +7606,11 @@ class SQLite { ); } - _dart_sqlite3_file_control? _sqlite3_file_control; + late final _sqlite3_file_control_ptr = + _lookup>( + 'sqlite3_file_control'); + late final _dart_sqlite3_file_control _sqlite3_file_control = + _sqlite3_file_control_ptr.asFunction<_dart_sqlite3_file_control>(); /// CAPI3REF: Testing Interface /// @@ -7357,15 +7630,16 @@ class SQLite { int sqlite3_test_control( int op, ) { - return (_sqlite3_test_control ??= - _lookup>( - 'sqlite3_test_control') - .asFunction<_dart_sqlite3_test_control>())( + return _sqlite3_test_control( op, ); } - _dart_sqlite3_test_control? _sqlite3_test_control; + late final _sqlite3_test_control_ptr = + _lookup>( + 'sqlite3_test_control'); + late final _dart_sqlite3_test_control _sqlite3_test_control = + _sqlite3_test_control_ptr.asFunction<_dart_sqlite3_test_control>(); /// CAPI3REF: SQL Keyword Checking /// @@ -7413,45 +7687,48 @@ class SQLite { /// SQLite is compiled with the [-DSQLITE_OMIT_VACUUM] option. Also, /// new keywords may be added to future releases of SQLite. int sqlite3_keyword_count() { - return (_sqlite3_keyword_count ??= - _lookup>( - 'sqlite3_keyword_count') - .asFunction<_dart_sqlite3_keyword_count>())(); + return _sqlite3_keyword_count(); } - _dart_sqlite3_keyword_count? _sqlite3_keyword_count; + late final _sqlite3_keyword_count_ptr = + _lookup>( + 'sqlite3_keyword_count'); + late final _dart_sqlite3_keyword_count _sqlite3_keyword_count = + _sqlite3_keyword_count_ptr.asFunction<_dart_sqlite3_keyword_count>(); int sqlite3_keyword_name( int arg0, ffi.Pointer> arg1, ffi.Pointer arg2, ) { - return (_sqlite3_keyword_name ??= - _lookup>( - 'sqlite3_keyword_name') - .asFunction<_dart_sqlite3_keyword_name>())( + return _sqlite3_keyword_name( arg0, arg1, arg2, ); } - _dart_sqlite3_keyword_name? _sqlite3_keyword_name; + late final _sqlite3_keyword_name_ptr = + _lookup>( + 'sqlite3_keyword_name'); + late final _dart_sqlite3_keyword_name _sqlite3_keyword_name = + _sqlite3_keyword_name_ptr.asFunction<_dart_sqlite3_keyword_name>(); int sqlite3_keyword_check( ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_keyword_check ??= - _lookup>( - 'sqlite3_keyword_check') - .asFunction<_dart_sqlite3_keyword_check>())( + return _sqlite3_keyword_check( arg0, arg1, ); } - _dart_sqlite3_keyword_check? _sqlite3_keyword_check; + late final _sqlite3_keyword_check_ptr = + _lookup>( + 'sqlite3_keyword_check'); + late final _dart_sqlite3_keyword_check _sqlite3_keyword_check = + _sqlite3_keyword_check_ptr.asFunction<_dart_sqlite3_keyword_check>(); /// CAPI3REF: Create A New Dynamic String Object /// CONSTRUCTOR: sqlite3_str @@ -7479,14 +7756,15 @@ class SQLite { ffi.Pointer sqlite3_str_new( ffi.Pointer arg0, ) { - return (_sqlite3_str_new ??= - _lookup>('sqlite3_str_new') - .asFunction<_dart_sqlite3_str_new>())( + return _sqlite3_str_new( arg0, ); } - _dart_sqlite3_str_new? _sqlite3_str_new; + late final _sqlite3_str_new_ptr = + _lookup>('sqlite3_str_new'); + late final _dart_sqlite3_str_new _sqlite3_str_new = + _sqlite3_str_new_ptr.asFunction<_dart_sqlite3_str_new>(); /// CAPI3REF: Finalize A Dynamic String /// DESTRUCTOR: sqlite3_str @@ -7502,14 +7780,15 @@ class SQLite { ffi.Pointer sqlite3_str_finish( ffi.Pointer arg0, ) { - return (_sqlite3_str_finish ??= - _lookup>('sqlite3_str_finish') - .asFunction<_dart_sqlite3_str_finish>())( + return _sqlite3_str_finish( arg0, ); } - _dart_sqlite3_str_finish? _sqlite3_str_finish; + late final _sqlite3_str_finish_ptr = + _lookup>('sqlite3_str_finish'); + late final _dart_sqlite3_str_finish _sqlite3_str_finish = + _sqlite3_str_finish_ptr.asFunction<_dart_sqlite3_str_finish>(); /// CAPI3REF: Add Content To A Dynamic String /// METHOD: sqlite3_str @@ -7545,76 +7824,81 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer zFormat, ) { - return (_sqlite3_str_appendf ??= - _lookup>( - 'sqlite3_str_appendf') - .asFunction<_dart_sqlite3_str_appendf>())( + return _sqlite3_str_appendf( arg0, zFormat, ); } - _dart_sqlite3_str_appendf? _sqlite3_str_appendf; + late final _sqlite3_str_appendf_ptr = + _lookup>( + 'sqlite3_str_appendf'); + late final _dart_sqlite3_str_appendf _sqlite3_str_appendf = + _sqlite3_str_appendf_ptr.asFunction<_dart_sqlite3_str_appendf>(); void sqlite3_str_append( ffi.Pointer arg0, ffi.Pointer zIn, int N, ) { - return (_sqlite3_str_append ??= - _lookup>('sqlite3_str_append') - .asFunction<_dart_sqlite3_str_append>())( + return _sqlite3_str_append( arg0, zIn, N, ); } - _dart_sqlite3_str_append? _sqlite3_str_append; + late final _sqlite3_str_append_ptr = + _lookup>('sqlite3_str_append'); + late final _dart_sqlite3_str_append _sqlite3_str_append = + _sqlite3_str_append_ptr.asFunction<_dart_sqlite3_str_append>(); void sqlite3_str_appendall( ffi.Pointer arg0, ffi.Pointer zIn, ) { - return (_sqlite3_str_appendall ??= - _lookup>( - 'sqlite3_str_appendall') - .asFunction<_dart_sqlite3_str_appendall>())( + return _sqlite3_str_appendall( arg0, zIn, ); } - _dart_sqlite3_str_appendall? _sqlite3_str_appendall; + late final _sqlite3_str_appendall_ptr = + _lookup>( + 'sqlite3_str_appendall'); + late final _dart_sqlite3_str_appendall _sqlite3_str_appendall = + _sqlite3_str_appendall_ptr.asFunction<_dart_sqlite3_str_appendall>(); void sqlite3_str_appendchar( ffi.Pointer arg0, int N, int C, ) { - return (_sqlite3_str_appendchar ??= - _lookup>( - 'sqlite3_str_appendchar') - .asFunction<_dart_sqlite3_str_appendchar>())( + return _sqlite3_str_appendchar( arg0, N, C, ); } - _dart_sqlite3_str_appendchar? _sqlite3_str_appendchar; + late final _sqlite3_str_appendchar_ptr = + _lookup>( + 'sqlite3_str_appendchar'); + late final _dart_sqlite3_str_appendchar _sqlite3_str_appendchar = + _sqlite3_str_appendchar_ptr.asFunction<_dart_sqlite3_str_appendchar>(); void sqlite3_str_reset( ffi.Pointer arg0, ) { - return (_sqlite3_str_reset ??= - _lookup>('sqlite3_str_reset') - .asFunction<_dart_sqlite3_str_reset>())( + return _sqlite3_str_reset( arg0, ); } - _dart_sqlite3_str_reset? _sqlite3_str_reset; + late final _sqlite3_str_reset_ptr = + _lookup>('sqlite3_str_reset'); + late final _dart_sqlite3_str_reset _sqlite3_str_reset = + _sqlite3_str_reset_ptr.asFunction<_dart_sqlite3_str_reset>(); /// CAPI3REF: Status Of A Dynamic String /// METHOD: sqlite3_str @@ -7646,39 +7930,42 @@ class SQLite { int sqlite3_str_errcode( ffi.Pointer arg0, ) { - return (_sqlite3_str_errcode ??= - _lookup>( - 'sqlite3_str_errcode') - .asFunction<_dart_sqlite3_str_errcode>())( + return _sqlite3_str_errcode( arg0, ); } - _dart_sqlite3_str_errcode? _sqlite3_str_errcode; + late final _sqlite3_str_errcode_ptr = + _lookup>( + 'sqlite3_str_errcode'); + late final _dart_sqlite3_str_errcode _sqlite3_str_errcode = + _sqlite3_str_errcode_ptr.asFunction<_dart_sqlite3_str_errcode>(); int sqlite3_str_length( ffi.Pointer arg0, ) { - return (_sqlite3_str_length ??= - _lookup>('sqlite3_str_length') - .asFunction<_dart_sqlite3_str_length>())( + return _sqlite3_str_length( arg0, ); } - _dart_sqlite3_str_length? _sqlite3_str_length; + late final _sqlite3_str_length_ptr = + _lookup>('sqlite3_str_length'); + late final _dart_sqlite3_str_length _sqlite3_str_length = + _sqlite3_str_length_ptr.asFunction<_dart_sqlite3_str_length>(); ffi.Pointer sqlite3_str_value( ffi.Pointer arg0, ) { - return (_sqlite3_str_value ??= - _lookup>('sqlite3_str_value') - .asFunction<_dart_sqlite3_str_value>())( + return _sqlite3_str_value( arg0, ); } - _dart_sqlite3_str_value? _sqlite3_str_value; + late final _sqlite3_str_value_ptr = + _lookup>('sqlite3_str_value'); + late final _dart_sqlite3_str_value _sqlite3_str_value = + _sqlite3_str_value_ptr.asFunction<_dart_sqlite3_str_value>(); /// CAPI3REF: SQLite Runtime Status /// @@ -7710,9 +7997,7 @@ class SQLite { ffi.Pointer pHighwater, int resetFlag, ) { - return (_sqlite3_status ??= - _lookup>('sqlite3_status') - .asFunction<_dart_sqlite3_status>())( + return _sqlite3_status( op, pCurrent, pHighwater, @@ -7720,7 +8005,10 @@ class SQLite { ); } - _dart_sqlite3_status? _sqlite3_status; + late final _sqlite3_status_ptr = + _lookup>('sqlite3_status'); + late final _dart_sqlite3_status _sqlite3_status = + _sqlite3_status_ptr.asFunction<_dart_sqlite3_status>(); int sqlite3_status64( int op, @@ -7728,9 +8016,7 @@ class SQLite { ffi.Pointer pHighwater, int resetFlag, ) { - return (_sqlite3_status64 ??= - _lookup>('sqlite3_status64') - .asFunction<_dart_sqlite3_status64>())( + return _sqlite3_status64( op, pCurrent, pHighwater, @@ -7738,7 +8024,10 @@ class SQLite { ); } - _dart_sqlite3_status64? _sqlite3_status64; + late final _sqlite3_status64_ptr = + _lookup>('sqlite3_status64'); + late final _dart_sqlite3_status64 _sqlite3_status64 = + _sqlite3_status64_ptr.asFunction<_dart_sqlite3_status64>(); /// CAPI3REF: Database Connection Status /// METHOD: sqlite3 @@ -7768,9 +8057,7 @@ class SQLite { ffi.Pointer pHiwtr, int resetFlg, ) { - return (_sqlite3_db_status ??= - _lookup>('sqlite3_db_status') - .asFunction<_dart_sqlite3_db_status>())( + return _sqlite3_db_status( arg0, op, pCur, @@ -7779,7 +8066,10 @@ class SQLite { ); } - _dart_sqlite3_db_status? _sqlite3_db_status; + late final _sqlite3_db_status_ptr = + _lookup>('sqlite3_db_status'); + late final _dart_sqlite3_db_status _sqlite3_db_status = + _sqlite3_db_status_ptr.asFunction<_dart_sqlite3_db_status>(); /// CAPI3REF: Prepared Statement Status /// METHOD: sqlite3_stmt @@ -7808,17 +8098,18 @@ class SQLite { int op, int resetFlg, ) { - return (_sqlite3_stmt_status ??= - _lookup>( - 'sqlite3_stmt_status') - .asFunction<_dart_sqlite3_stmt_status>())( + return _sqlite3_stmt_status( arg0, op, resetFlg, ); } - _dart_sqlite3_stmt_status? _sqlite3_stmt_status; + late final _sqlite3_stmt_status_ptr = + _lookup>( + 'sqlite3_stmt_status'); + late final _dart_sqlite3_stmt_status _sqlite3_stmt_status = + _sqlite3_stmt_status_ptr.asFunction<_dart_sqlite3_stmt_status>(); /// CAPI3REF: Online Backup API. /// @@ -8010,10 +8301,7 @@ class SQLite { ffi.Pointer pSource, ffi.Pointer zSourceName, ) { - return (_sqlite3_backup_init ??= - _lookup>( - 'sqlite3_backup_init') - .asFunction<_dart_sqlite3_backup_init>())( + return _sqlite3_backup_init( pDest, zDestName, pSource, @@ -8021,61 +8309,71 @@ class SQLite { ); } - _dart_sqlite3_backup_init? _sqlite3_backup_init; + late final _sqlite3_backup_init_ptr = + _lookup>( + 'sqlite3_backup_init'); + late final _dart_sqlite3_backup_init _sqlite3_backup_init = + _sqlite3_backup_init_ptr.asFunction<_dart_sqlite3_backup_init>(); int sqlite3_backup_step( ffi.Pointer p, int nPage, ) { - return (_sqlite3_backup_step ??= - _lookup>( - 'sqlite3_backup_step') - .asFunction<_dart_sqlite3_backup_step>())( + return _sqlite3_backup_step( p, nPage, ); } - _dart_sqlite3_backup_step? _sqlite3_backup_step; + late final _sqlite3_backup_step_ptr = + _lookup>( + 'sqlite3_backup_step'); + late final _dart_sqlite3_backup_step _sqlite3_backup_step = + _sqlite3_backup_step_ptr.asFunction<_dart_sqlite3_backup_step>(); int sqlite3_backup_finish( ffi.Pointer p, ) { - return (_sqlite3_backup_finish ??= - _lookup>( - 'sqlite3_backup_finish') - .asFunction<_dart_sqlite3_backup_finish>())( + return _sqlite3_backup_finish( p, ); } - _dart_sqlite3_backup_finish? _sqlite3_backup_finish; + late final _sqlite3_backup_finish_ptr = + _lookup>( + 'sqlite3_backup_finish'); + late final _dart_sqlite3_backup_finish _sqlite3_backup_finish = + _sqlite3_backup_finish_ptr.asFunction<_dart_sqlite3_backup_finish>(); int sqlite3_backup_remaining( ffi.Pointer p, ) { - return (_sqlite3_backup_remaining ??= - _lookup>( - 'sqlite3_backup_remaining') - .asFunction<_dart_sqlite3_backup_remaining>())( + return _sqlite3_backup_remaining( p, ); } - _dart_sqlite3_backup_remaining? _sqlite3_backup_remaining; + late final _sqlite3_backup_remaining_ptr = + _lookup>( + 'sqlite3_backup_remaining'); + late final _dart_sqlite3_backup_remaining _sqlite3_backup_remaining = + _sqlite3_backup_remaining_ptr + .asFunction<_dart_sqlite3_backup_remaining>(); int sqlite3_backup_pagecount( ffi.Pointer p, ) { - return (_sqlite3_backup_pagecount ??= - _lookup>( - 'sqlite3_backup_pagecount') - .asFunction<_dart_sqlite3_backup_pagecount>())( + return _sqlite3_backup_pagecount( p, ); } - _dart_sqlite3_backup_pagecount? _sqlite3_backup_pagecount; + late final _sqlite3_backup_pagecount_ptr = + _lookup>( + 'sqlite3_backup_pagecount'); + late final _dart_sqlite3_backup_pagecount _sqlite3_backup_pagecount = + _sqlite3_backup_pagecount_ptr + .asFunction<_dart_sqlite3_backup_pagecount>(); /// CAPI3REF: Unlock Notification /// METHOD: sqlite3 @@ -8195,17 +8493,18 @@ class SQLite { ffi.Pointer> xNotify, ffi.Pointer pNotifyArg, ) { - return (_sqlite3_unlock_notify ??= - _lookup>( - 'sqlite3_unlock_notify') - .asFunction<_dart_sqlite3_unlock_notify>())( + return _sqlite3_unlock_notify( pBlocked, xNotify, pNotifyArg, ); } - _dart_sqlite3_unlock_notify? _sqlite3_unlock_notify; + late final _sqlite3_unlock_notify_ptr = + _lookup>( + 'sqlite3_unlock_notify'); + late final _dart_sqlite3_unlock_notify _sqlite3_unlock_notify = + _sqlite3_unlock_notify_ptr.asFunction<_dart_sqlite3_unlock_notify>(); /// CAPI3REF: String Comparison /// @@ -8217,31 +8516,33 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, ) { - return (_sqlite3_stricmp ??= - _lookup>('sqlite3_stricmp') - .asFunction<_dart_sqlite3_stricmp>())( + return _sqlite3_stricmp( arg0, arg1, ); } - _dart_sqlite3_stricmp? _sqlite3_stricmp; + late final _sqlite3_stricmp_ptr = + _lookup>('sqlite3_stricmp'); + late final _dart_sqlite3_stricmp _sqlite3_stricmp = + _sqlite3_stricmp_ptr.asFunction<_dart_sqlite3_stricmp>(); int sqlite3_strnicmp( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, ) { - return (_sqlite3_strnicmp ??= - _lookup>('sqlite3_strnicmp') - .asFunction<_dart_sqlite3_strnicmp>())( + return _sqlite3_strnicmp( arg0, arg1, arg2, ); } - _dart_sqlite3_strnicmp? _sqlite3_strnicmp; + late final _sqlite3_strnicmp_ptr = + _lookup>('sqlite3_strnicmp'); + late final _dart_sqlite3_strnicmp _sqlite3_strnicmp = + _sqlite3_strnicmp_ptr.asFunction<_dart_sqlite3_strnicmp>(); /// CAPI3REF: String Globbing /// @@ -8260,15 +8561,16 @@ class SQLite { ffi.Pointer zGlob, ffi.Pointer zStr, ) { - return (_sqlite3_strglob ??= - _lookup>('sqlite3_strglob') - .asFunction<_dart_sqlite3_strglob>())( + return _sqlite3_strglob( zGlob, zStr, ); } - _dart_sqlite3_strglob? _sqlite3_strglob; + late final _sqlite3_strglob_ptr = + _lookup>('sqlite3_strglob'); + late final _dart_sqlite3_strglob _sqlite3_strglob = + _sqlite3_strglob_ptr.asFunction<_dart_sqlite3_strglob>(); /// CAPI3REF: String LIKE Matching /// @@ -8294,16 +8596,17 @@ class SQLite { ffi.Pointer zStr, int cEsc, ) { - return (_sqlite3_strlike ??= - _lookup>('sqlite3_strlike') - .asFunction<_dart_sqlite3_strlike>())( + return _sqlite3_strlike( zGlob, zStr, cEsc, ); } - _dart_sqlite3_strlike? _sqlite3_strlike; + late final _sqlite3_strlike_ptr = + _lookup>('sqlite3_strlike'); + late final _dart_sqlite3_strlike _sqlite3_strlike = + _sqlite3_strlike_ptr.asFunction<_dart_sqlite3_strlike>(); /// CAPI3REF: Error Logging Interface /// @@ -8328,15 +8631,16 @@ class SQLite { int iErrCode, ffi.Pointer zFormat, ) { - return (_sqlite3_log ??= - _lookup>('sqlite3_log') - .asFunction<_dart_sqlite3_log>())( + return _sqlite3_log( iErrCode, zFormat, ); } - _dart_sqlite3_log? _sqlite3_log; + late final _sqlite3_log_ptr = + _lookup>('sqlite3_log'); + late final _dart_sqlite3_log _sqlite3_log = + _sqlite3_log_ptr.asFunction<_dart_sqlite3_log>(); /// CAPI3REF: Write-Ahead Log Commit Hook /// METHOD: sqlite3 @@ -8375,16 +8679,17 @@ class SQLite { ffi.Pointer> arg1, ffi.Pointer arg2, ) { - return (_sqlite3_wal_hook ??= - _lookup>('sqlite3_wal_hook') - .asFunction<_dart_sqlite3_wal_hook>())( + return _sqlite3_wal_hook( arg0, arg1, arg2, ); } - _dart_sqlite3_wal_hook? _sqlite3_wal_hook; + late final _sqlite3_wal_hook_ptr = + _lookup>('sqlite3_wal_hook'); + late final _dart_sqlite3_wal_hook _sqlite3_wal_hook = + _sqlite3_wal_hook_ptr.asFunction<_dart_sqlite3_wal_hook>(); /// CAPI3REF: Configure an auto-checkpoint /// METHOD: sqlite3 @@ -8417,16 +8722,18 @@ class SQLite { ffi.Pointer db, int N, ) { - return (_sqlite3_wal_autocheckpoint ??= - _lookup>( - 'sqlite3_wal_autocheckpoint') - .asFunction<_dart_sqlite3_wal_autocheckpoint>())( + return _sqlite3_wal_autocheckpoint( db, N, ); } - _dart_sqlite3_wal_autocheckpoint? _sqlite3_wal_autocheckpoint; + late final _sqlite3_wal_autocheckpoint_ptr = + _lookup>( + 'sqlite3_wal_autocheckpoint'); + late final _dart_sqlite3_wal_autocheckpoint _sqlite3_wal_autocheckpoint = + _sqlite3_wal_autocheckpoint_ptr + .asFunction<_dart_sqlite3_wal_autocheckpoint>(); /// CAPI3REF: Checkpoint a database /// METHOD: sqlite3 @@ -8450,16 +8757,17 @@ class SQLite { ffi.Pointer db, ffi.Pointer zDb, ) { - return (_sqlite3_wal_checkpoint ??= - _lookup>( - 'sqlite3_wal_checkpoint') - .asFunction<_dart_sqlite3_wal_checkpoint>())( + return _sqlite3_wal_checkpoint( db, zDb, ); } - _dart_sqlite3_wal_checkpoint? _sqlite3_wal_checkpoint; + late final _sqlite3_wal_checkpoint_ptr = + _lookup>( + 'sqlite3_wal_checkpoint'); + late final _dart_sqlite3_wal_checkpoint _sqlite3_wal_checkpoint = + _sqlite3_wal_checkpoint_ptr.asFunction<_dart_sqlite3_wal_checkpoint>(); /// CAPI3REF: Checkpoint a database /// METHOD: sqlite3 @@ -8558,10 +8866,7 @@ class SQLite { ffi.Pointer pnLog, ffi.Pointer pnCkpt, ) { - return (_sqlite3_wal_checkpoint_v2 ??= - _lookup>( - 'sqlite3_wal_checkpoint_v2') - .asFunction<_dart_sqlite3_wal_checkpoint_v2>())( + return _sqlite3_wal_checkpoint_v2( db, zDb, eMode, @@ -8570,7 +8875,12 @@ class SQLite { ); } - _dart_sqlite3_wal_checkpoint_v2? _sqlite3_wal_checkpoint_v2; + late final _sqlite3_wal_checkpoint_v2_ptr = + _lookup>( + 'sqlite3_wal_checkpoint_v2'); + late final _dart_sqlite3_wal_checkpoint_v2 _sqlite3_wal_checkpoint_v2 = + _sqlite3_wal_checkpoint_v2_ptr + .asFunction<_dart_sqlite3_wal_checkpoint_v2>(); /// CAPI3REF: Virtual Table Interface Configuration /// @@ -8592,16 +8902,17 @@ class SQLite { ffi.Pointer arg0, int op, ) { - return (_sqlite3_vtab_config ??= - _lookup>( - 'sqlite3_vtab_config') - .asFunction<_dart_sqlite3_vtab_config>())( + return _sqlite3_vtab_config( arg0, op, ); } - _dart_sqlite3_vtab_config? _sqlite3_vtab_config; + late final _sqlite3_vtab_config_ptr = + _lookup>( + 'sqlite3_vtab_config'); + late final _dart_sqlite3_vtab_config _sqlite3_vtab_config = + _sqlite3_vtab_config_ptr.asFunction<_dart_sqlite3_vtab_config>(); /// CAPI3REF: Determine The Virtual Table Conflict Policy /// @@ -8614,15 +8925,17 @@ class SQLite { int sqlite3_vtab_on_conflict( ffi.Pointer arg0, ) { - return (_sqlite3_vtab_on_conflict ??= - _lookup>( - 'sqlite3_vtab_on_conflict') - .asFunction<_dart_sqlite3_vtab_on_conflict>())( + return _sqlite3_vtab_on_conflict( arg0, ); } - _dart_sqlite3_vtab_on_conflict? _sqlite3_vtab_on_conflict; + late final _sqlite3_vtab_on_conflict_ptr = + _lookup>( + 'sqlite3_vtab_on_conflict'); + late final _dart_sqlite3_vtab_on_conflict _sqlite3_vtab_on_conflict = + _sqlite3_vtab_on_conflict_ptr + .asFunction<_dart_sqlite3_vtab_on_conflict>(); /// CAPI3REF: Determine If Virtual Table Column Access Is For UPDATE /// @@ -8642,15 +8955,16 @@ class SQLite { int sqlite3_vtab_nochange( ffi.Pointer arg0, ) { - return (_sqlite3_vtab_nochange ??= - _lookup>( - 'sqlite3_vtab_nochange') - .asFunction<_dart_sqlite3_vtab_nochange>())( + return _sqlite3_vtab_nochange( arg0, ); } - _dart_sqlite3_vtab_nochange? _sqlite3_vtab_nochange; + late final _sqlite3_vtab_nochange_ptr = + _lookup>( + 'sqlite3_vtab_nochange'); + late final _dart_sqlite3_vtab_nochange _sqlite3_vtab_nochange = + _sqlite3_vtab_nochange_ptr.asFunction<_dart_sqlite3_vtab_nochange>(); /// CAPI3REF: Determine The Collation For a Virtual Table Constraint /// @@ -8667,16 +8981,17 @@ class SQLite { ffi.Pointer arg0, int arg1, ) { - return (_sqlite3_vtab_collation ??= - _lookup>( - 'sqlite3_vtab_collation') - .asFunction<_dart_sqlite3_vtab_collation>())( + return _sqlite3_vtab_collation( arg0, arg1, ); } - _dart_sqlite3_vtab_collation? _sqlite3_vtab_collation; + late final _sqlite3_vtab_collation_ptr = + _lookup>( + 'sqlite3_vtab_collation'); + late final _dart_sqlite3_vtab_collation _sqlite3_vtab_collation = + _sqlite3_vtab_collation_ptr.asFunction<_dart_sqlite3_vtab_collation>(); /// CAPI3REF: Prepared Statement Scan Status /// METHOD: sqlite3_stmt @@ -8713,10 +9028,7 @@ class SQLite { int iScanStatusOp, ffi.Pointer pOut, ) { - return (_sqlite3_stmt_scanstatus ??= - _lookup>( - 'sqlite3_stmt_scanstatus') - .asFunction<_dart_sqlite3_stmt_scanstatus>())( + return _sqlite3_stmt_scanstatus( pStmt, idx, iScanStatusOp, @@ -8724,7 +9036,11 @@ class SQLite { ); } - _dart_sqlite3_stmt_scanstatus? _sqlite3_stmt_scanstatus; + late final _sqlite3_stmt_scanstatus_ptr = + _lookup>( + 'sqlite3_stmt_scanstatus'); + late final _dart_sqlite3_stmt_scanstatus _sqlite3_stmt_scanstatus = + _sqlite3_stmt_scanstatus_ptr.asFunction<_dart_sqlite3_stmt_scanstatus>(); /// CAPI3REF: Zero Scan-Status Counters /// METHOD: sqlite3_stmt @@ -8736,15 +9052,17 @@ class SQLite { void sqlite3_stmt_scanstatus_reset( ffi.Pointer arg0, ) { - return (_sqlite3_stmt_scanstatus_reset ??= - _lookup>( - 'sqlite3_stmt_scanstatus_reset') - .asFunction<_dart_sqlite3_stmt_scanstatus_reset>())( + return _sqlite3_stmt_scanstatus_reset( arg0, ); } - _dart_sqlite3_stmt_scanstatus_reset? _sqlite3_stmt_scanstatus_reset; + late final _sqlite3_stmt_scanstatus_reset_ptr = + _lookup>( + 'sqlite3_stmt_scanstatus_reset'); + late final _dart_sqlite3_stmt_scanstatus_reset + _sqlite3_stmt_scanstatus_reset = _sqlite3_stmt_scanstatus_reset_ptr + .asFunction<_dart_sqlite3_stmt_scanstatus_reset>(); /// CAPI3REF: Flush caches to disk mid-transaction /// @@ -8777,15 +9095,16 @@ class SQLite { int sqlite3_db_cacheflush( ffi.Pointer arg0, ) { - return (_sqlite3_db_cacheflush ??= - _lookup>( - 'sqlite3_db_cacheflush') - .asFunction<_dart_sqlite3_db_cacheflush>())( + return _sqlite3_db_cacheflush( arg0, ); } - _dart_sqlite3_db_cacheflush? _sqlite3_db_cacheflush; + late final _sqlite3_db_cacheflush_ptr = + _lookup>( + 'sqlite3_db_cacheflush'); + late final _dart_sqlite3_db_cacheflush _sqlite3_db_cacheflush = + _sqlite3_db_cacheflush_ptr.asFunction<_dart_sqlite3_db_cacheflush>(); /// CAPI3REF: Low-level system error code /// @@ -8798,15 +9117,16 @@ class SQLite { int sqlite3_system_errno( ffi.Pointer arg0, ) { - return (_sqlite3_system_errno ??= - _lookup>( - 'sqlite3_system_errno') - .asFunction<_dart_sqlite3_system_errno>())( + return _sqlite3_system_errno( arg0, ); } - _dart_sqlite3_system_errno? _sqlite3_system_errno; + late final _sqlite3_system_errno_ptr = + _lookup>( + 'sqlite3_system_errno'); + late final _dart_sqlite3_system_errno _sqlite3_system_errno = + _sqlite3_system_errno_ptr.asFunction<_dart_sqlite3_system_errno>(); /// CAPI3REF: Record A Database Snapshot /// CONSTRUCTOR: sqlite3_snapshot @@ -8854,17 +9174,18 @@ class SQLite { ffi.Pointer zSchema, ffi.Pointer> ppSnapshot, ) { - return (_sqlite3_snapshot_get ??= - _lookup>( - 'sqlite3_snapshot_get') - .asFunction<_dart_sqlite3_snapshot_get>())( + return _sqlite3_snapshot_get( db, zSchema, ppSnapshot, ); } - _dart_sqlite3_snapshot_get? _sqlite3_snapshot_get; + late final _sqlite3_snapshot_get_ptr = + _lookup>( + 'sqlite3_snapshot_get'); + late final _dart_sqlite3_snapshot_get _sqlite3_snapshot_get = + _sqlite3_snapshot_get_ptr.asFunction<_dart_sqlite3_snapshot_get>(); /// CAPI3REF: Start a read transaction on an historical snapshot /// METHOD: sqlite3_snapshot @@ -8912,17 +9233,18 @@ class SQLite { ffi.Pointer zSchema, ffi.Pointer pSnapshot, ) { - return (_sqlite3_snapshot_open ??= - _lookup>( - 'sqlite3_snapshot_open') - .asFunction<_dart_sqlite3_snapshot_open>())( + return _sqlite3_snapshot_open( db, zSchema, pSnapshot, ); } - _dart_sqlite3_snapshot_open? _sqlite3_snapshot_open; + late final _sqlite3_snapshot_open_ptr = + _lookup>( + 'sqlite3_snapshot_open'); + late final _dart_sqlite3_snapshot_open _sqlite3_snapshot_open = + _sqlite3_snapshot_open_ptr.asFunction<_dart_sqlite3_snapshot_open>(); /// CAPI3REF: Destroy a snapshot /// DESTRUCTOR: sqlite3_snapshot @@ -8936,15 +9258,16 @@ class SQLite { void sqlite3_snapshot_free( ffi.Pointer arg0, ) { - return (_sqlite3_snapshot_free ??= - _lookup>( - 'sqlite3_snapshot_free') - .asFunction<_dart_sqlite3_snapshot_free>())( + return _sqlite3_snapshot_free( arg0, ); } - _dart_sqlite3_snapshot_free? _sqlite3_snapshot_free; + late final _sqlite3_snapshot_free_ptr = + _lookup>( + 'sqlite3_snapshot_free'); + late final _dart_sqlite3_snapshot_free _sqlite3_snapshot_free = + _sqlite3_snapshot_free_ptr.asFunction<_dart_sqlite3_snapshot_free>(); /// CAPI3REF: Compare the ages of two snapshot handles. /// METHOD: sqlite3_snapshot @@ -8973,16 +9296,17 @@ class SQLite { ffi.Pointer p1, ffi.Pointer p2, ) { - return (_sqlite3_snapshot_cmp ??= - _lookup>( - 'sqlite3_snapshot_cmp') - .asFunction<_dart_sqlite3_snapshot_cmp>())( + return _sqlite3_snapshot_cmp( p1, p2, ); } - _dart_sqlite3_snapshot_cmp? _sqlite3_snapshot_cmp; + late final _sqlite3_snapshot_cmp_ptr = + _lookup>( + 'sqlite3_snapshot_cmp'); + late final _dart_sqlite3_snapshot_cmp _sqlite3_snapshot_cmp = + _sqlite3_snapshot_cmp_ptr.asFunction<_dart_sqlite3_snapshot_cmp>(); /// CAPI3REF: Recover snapshots from a wal file /// METHOD: sqlite3_snapshot @@ -9009,16 +9333,18 @@ class SQLite { ffi.Pointer db, ffi.Pointer zDb, ) { - return (_sqlite3_snapshot_recover ??= - _lookup>( - 'sqlite3_snapshot_recover') - .asFunction<_dart_sqlite3_snapshot_recover>())( + return _sqlite3_snapshot_recover( db, zDb, ); } - _dart_sqlite3_snapshot_recover? _sqlite3_snapshot_recover; + late final _sqlite3_snapshot_recover_ptr = + _lookup>( + 'sqlite3_snapshot_recover'); + late final _dart_sqlite3_snapshot_recover _sqlite3_snapshot_recover = + _sqlite3_snapshot_recover_ptr + .asFunction<_dart_sqlite3_snapshot_recover>(); /// CAPI3REF: Serialize a database /// @@ -9060,9 +9386,7 @@ class SQLite { ffi.Pointer piSize, int mFlags, ) { - return (_sqlite3_serialize ??= - _lookup>('sqlite3_serialize') - .asFunction<_dart_sqlite3_serialize>())( + return _sqlite3_serialize( db, zSchema, piSize, @@ -9070,7 +9394,10 @@ class SQLite { ); } - _dart_sqlite3_serialize? _sqlite3_serialize; + late final _sqlite3_serialize_ptr = + _lookup>('sqlite3_serialize'); + late final _dart_sqlite3_serialize _sqlite3_serialize = + _sqlite3_serialize_ptr.asFunction<_dart_sqlite3_serialize>(); /// CAPI3REF: Deserialize a database /// @@ -9107,10 +9434,7 @@ class SQLite { int szBuf, int mFlags, ) { - return (_sqlite3_deserialize ??= - _lookup>( - 'sqlite3_deserialize') - .asFunction<_dart_sqlite3_deserialize>())( + return _sqlite3_deserialize( db, zSchema, pData, @@ -9120,7 +9444,11 @@ class SQLite { ); } - _dart_sqlite3_deserialize? _sqlite3_deserialize; + late final _sqlite3_deserialize_ptr = + _lookup>( + 'sqlite3_deserialize'); + late final _dart_sqlite3_deserialize _sqlite3_deserialize = + _sqlite3_deserialize_ptr.asFunction<_dart_sqlite3_deserialize>(); /// Register a geometry callback named zGeom that can be used as part of an /// R-Tree geometry query as follows: @@ -9132,10 +9460,7 @@ class SQLite { ffi.Pointer> xGeom, ffi.Pointer pContext, ) { - return (_sqlite3_rtree_geometry_callback ??= - _lookup>( - 'sqlite3_rtree_geometry_callback') - .asFunction<_dart_sqlite3_rtree_geometry_callback>())( + return _sqlite3_rtree_geometry_callback( db, zGeom, xGeom, @@ -9143,7 +9468,12 @@ class SQLite { ); } - _dart_sqlite3_rtree_geometry_callback? _sqlite3_rtree_geometry_callback; + late final _sqlite3_rtree_geometry_callback_ptr = + _lookup>( + 'sqlite3_rtree_geometry_callback'); + late final _dart_sqlite3_rtree_geometry_callback + _sqlite3_rtree_geometry_callback = _sqlite3_rtree_geometry_callback_ptr + .asFunction<_dart_sqlite3_rtree_geometry_callback>(); /// Register a 2nd-generation geometry callback named zScore that can be /// used as part of an R-Tree geometry query as follows: @@ -9156,10 +9486,7 @@ class SQLite { ffi.Pointer pContext, ffi.Pointer> xDestructor, ) { - return (_sqlite3_rtree_query_callback ??= - _lookup>( - 'sqlite3_rtree_query_callback') - .asFunction<_dart_sqlite3_rtree_query_callback>())( + return _sqlite3_rtree_query_callback( db, zQueryFunc, xQueryFunc, @@ -9168,7 +9495,12 @@ class SQLite { ); } - _dart_sqlite3_rtree_query_callback? _sqlite3_rtree_query_callback; + late final _sqlite3_rtree_query_callback_ptr = + _lookup>( + 'sqlite3_rtree_query_callback'); + late final _dart_sqlite3_rtree_query_callback _sqlite3_rtree_query_callback = + _sqlite3_rtree_query_callback_ptr + .asFunction<_dart_sqlite3_rtree_query_callback>(); } class sqlite3 extends ffi.Opaque {} diff --git a/pkgs/ffigen/test/native_test/native_test_bindings.dart b/pkgs/ffigen/test/native_test/native_test_bindings.dart index 392068963f..f409db86d1 100644 --- a/pkgs/ffigen/test/native_test/native_test_bindings.dart +++ b/pkgs/ffigen/test/native_test/native_test_bindings.dart @@ -22,185 +22,202 @@ class NativeLibrary { bool Function1Bool( bool x, ) { - return (_Function1Bool ??= - _lookup>('Function1Bool') - .asFunction<_dart_Function1Bool>())( + return _Function1Bool( x ? 1 : 0, ) != 0; } - _dart_Function1Bool? _Function1Bool; + late final _Function1Bool_ptr = + _lookup>('Function1Bool'); + late final _dart_Function1Bool _Function1Bool = + _Function1Bool_ptr.asFunction<_dart_Function1Bool>(); int Function1Uint8( int x, ) { - return (_Function1Uint8 ??= - _lookup>('Function1Uint8') - .asFunction<_dart_Function1Uint8>())( + return _Function1Uint8( x, ); } - _dart_Function1Uint8? _Function1Uint8; + late final _Function1Uint8_ptr = + _lookup>('Function1Uint8'); + late final _dart_Function1Uint8 _Function1Uint8 = + _Function1Uint8_ptr.asFunction<_dart_Function1Uint8>(); int Function1Uint16( int x, ) { - return (_Function1Uint16 ??= - _lookup>('Function1Uint16') - .asFunction<_dart_Function1Uint16>())( + return _Function1Uint16( x, ); } - _dart_Function1Uint16? _Function1Uint16; + late final _Function1Uint16_ptr = + _lookup>('Function1Uint16'); + late final _dart_Function1Uint16 _Function1Uint16 = + _Function1Uint16_ptr.asFunction<_dart_Function1Uint16>(); int Function1Uint32( int x, ) { - return (_Function1Uint32 ??= - _lookup>('Function1Uint32') - .asFunction<_dart_Function1Uint32>())( + return _Function1Uint32( x, ); } - _dart_Function1Uint32? _Function1Uint32; + late final _Function1Uint32_ptr = + _lookup>('Function1Uint32'); + late final _dart_Function1Uint32 _Function1Uint32 = + _Function1Uint32_ptr.asFunction<_dart_Function1Uint32>(); int Function1Uint64( int x, ) { - return (_Function1Uint64 ??= - _lookup>('Function1Uint64') - .asFunction<_dart_Function1Uint64>())( + return _Function1Uint64( x, ); } - _dart_Function1Uint64? _Function1Uint64; + late final _Function1Uint64_ptr = + _lookup>('Function1Uint64'); + late final _dart_Function1Uint64 _Function1Uint64 = + _Function1Uint64_ptr.asFunction<_dart_Function1Uint64>(); int Function1Int8( int x, ) { - return (_Function1Int8 ??= - _lookup>('Function1Int8') - .asFunction<_dart_Function1Int8>())( + return _Function1Int8( x, ); } - _dart_Function1Int8? _Function1Int8; + late final _Function1Int8_ptr = + _lookup>('Function1Int8'); + late final _dart_Function1Int8 _Function1Int8 = + _Function1Int8_ptr.asFunction<_dart_Function1Int8>(); int Function1Int16( int x, ) { - return (_Function1Int16 ??= - _lookup>('Function1Int16') - .asFunction<_dart_Function1Int16>())( + return _Function1Int16( x, ); } - _dart_Function1Int16? _Function1Int16; + late final _Function1Int16_ptr = + _lookup>('Function1Int16'); + late final _dart_Function1Int16 _Function1Int16 = + _Function1Int16_ptr.asFunction<_dart_Function1Int16>(); int Function1Int32( int x, ) { - return (_Function1Int32 ??= - _lookup>('Function1Int32') - .asFunction<_dart_Function1Int32>())( + return _Function1Int32( x, ); } - _dart_Function1Int32? _Function1Int32; + late final _Function1Int32_ptr = + _lookup>('Function1Int32'); + late final _dart_Function1Int32 _Function1Int32 = + _Function1Int32_ptr.asFunction<_dart_Function1Int32>(); int Function1Int64( int x, ) { - return (_Function1Int64 ??= - _lookup>('Function1Int64') - .asFunction<_dart_Function1Int64>())( + return _Function1Int64( x, ); } - _dart_Function1Int64? _Function1Int64; + late final _Function1Int64_ptr = + _lookup>('Function1Int64'); + late final _dart_Function1Int64 _Function1Int64 = + _Function1Int64_ptr.asFunction<_dart_Function1Int64>(); int Function1IntPtr( int x, ) { - return (_Function1IntPtr ??= - _lookup>('Function1IntPtr') - .asFunction<_dart_Function1IntPtr>())( + return _Function1IntPtr( x, ); } - _dart_Function1IntPtr? _Function1IntPtr; + late final _Function1IntPtr_ptr = + _lookup>('Function1IntPtr'); + late final _dart_Function1IntPtr _Function1IntPtr = + _Function1IntPtr_ptr.asFunction<_dart_Function1IntPtr>(); double Function1Float( double x, ) { - return (_Function1Float ??= - _lookup>('Function1Float') - .asFunction<_dart_Function1Float>())( + return _Function1Float( x, ); } - _dart_Function1Float? _Function1Float; + late final _Function1Float_ptr = + _lookup>('Function1Float'); + late final _dart_Function1Float _Function1Float = + _Function1Float_ptr.asFunction<_dart_Function1Float>(); double Function1Double( double x, ) { - return (_Function1Double ??= - _lookup>('Function1Double') - .asFunction<_dart_Function1Double>())( + return _Function1Double( x, ); } - _dart_Function1Double? _Function1Double; + late final _Function1Double_ptr = + _lookup>('Function1Double'); + late final _dart_Function1Double _Function1Double = + _Function1Double_ptr.asFunction<_dart_Function1Double>(); ffi.Pointer getStruct1() { - return (_getStruct1 ??= - _lookup>('getStruct1') - .asFunction<_dart_getStruct1>())(); + return _getStruct1(); } - _dart_getStruct1? _getStruct1; + late final _getStruct1_ptr = + _lookup>('getStruct1'); + late final _dart_getStruct1 _getStruct1 = + _getStruct1_ptr.asFunction<_dart_getStruct1>(); Struct3 Function1StructReturnByValue( int a, int b, int c, ) { - return (_Function1StructReturnByValue ??= - _lookup>( - 'Function1StructReturnByValue') - .asFunction<_dart_Function1StructReturnByValue>())( + return _Function1StructReturnByValue( a, b, c, ); } - _dart_Function1StructReturnByValue? _Function1StructReturnByValue; + late final _Function1StructReturnByValue_ptr = + _lookup>( + 'Function1StructReturnByValue'); + late final _dart_Function1StructReturnByValue _Function1StructReturnByValue = + _Function1StructReturnByValue_ptr.asFunction< + _dart_Function1StructReturnByValue>(); int Function1StructPassByValue( Struct3 sum_a_b_c, ) { - return (_Function1StructPassByValue ??= - _lookup>( - 'Function1StructPassByValue') - .asFunction<_dart_Function1StructPassByValue>())( + return _Function1StructPassByValue( sum_a_b_c, ); } - _dart_Function1StructPassByValue? _Function1StructPassByValue; + late final _Function1StructPassByValue_ptr = + _lookup>( + 'Function1StructPassByValue'); + late final _dart_Function1StructPassByValue _Function1StructPassByValue = + _Function1StructPassByValue_ptr.asFunction< + _dart_Function1StructPassByValue>(); } class Struct1 extends ffi.Struct { From e2038adf2b9851a673aee97fd1c24f960e03d802 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Fri, 5 Mar 2021 02:00:39 -0800 Subject: [PATCH 069/276] [ffigen] Fix generation of duplicate constants with multiple entry points (#178) --- pkgs/ffigen/CHANGELOG.md | 3 +++ .../sub_parsers/unnamed_enumdecl_parser.dart | 20 ++++++++++--------- pkgs/ffigen/pubspec.yaml | 2 +- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index cd555c8453..2c76c31f6a 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.2.1 +- Fixed generation of duplicate constants suffixed with `_` when using multiple entry points. + # 2.2.0 - Added subkey `symbol-address` to expose native symbol pointers for `functions` and `globals`. diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart index 584694d869..4cac558e7d 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart @@ -55,15 +55,17 @@ int _unnamedenumCursorVisitor(clang_types.CXCursor cursor, /// Adds the parameter to func in [functiondecl_parser.dart]. void _addUnNamedEnumConstant(clang_types.CXCursor cursor) { - unnamedEnumConstants.add( - Constant( - usr: cursor.usr(), - originalName: cursor.spelling(), - name: config.unnamedEnumConstants.renameUsingConfig( - cursor.spelling(), - ), - rawType: 'int', - rawValue: clang.clang_getEnumConstantDeclValue(cursor).toString(), + _logger.fine( + '++++ Adding Constant from unnamed enum: ${cursor.completeStringRepr()}'); + final constant = Constant( + usr: cursor.usr(), + originalName: cursor.spelling(), + name: config.unnamedEnumConstants.renameUsingConfig( + cursor.spelling(), ), + rawType: 'int', + rawValue: clang.clang_getEnumConstantDeclValue(cursor).toString(), ); + bindingsIndex.addUnnamedEnumConstantToSeen(cursor.usr(), constant); + unnamedEnumConstants.add(constant); } diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 860f4e8095..df6c00b90b 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.2.0 +version: 2.2.1 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. From 710842f4f25ab2f4a1d65071d2fcd4e6dfeab1e2 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Fri, 5 Mar 2021 04:53:30 -0800 Subject: [PATCH 070/276] [ffigen] Fixed generation of empty Opaque structs due to forward declarations. (#180) --- pkgs/ffigen/CHANGELOG.md | 3 + .../clang_bindings/clang_bindings.dart | 645 ++++--- .../sub_parsers/enumdecl_parser.dart | 6 + .../sub_parsers/structdecl_parser.dart | 5 + pkgs/ffigen/lib/src/header_parser/utils.dart | 5 + pkgs/ffigen/pubspec.yaml | 2 +- .../_expected_forward_decl_bindings.dart | 57 + ...expected_native_func_typedef_bindings.dart | 2 +- .../test/header_parser_tests/forward_decl.h | 20 + .../forward_decl_test.dart | 45 + .../native_func_typedef_test.dart | 4 +- .../_expected_sqlite_bindings.dart | 1548 ++++++++++++++--- pkgs/ffigen/tool/libclang_config.yaml | 2 + 13 files changed, 1865 insertions(+), 479 deletions(-) create mode 100644 pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/forward_decl.h create mode 100644 pkgs/ffigen/test/header_parser_tests/forward_decl_test.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 2c76c31f6a..df06dd51a0 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.2.2 +- Fixed generation of empty opaque structs due to forward declarations in header files. + # 2.2.1 - Fixed generation of duplicate constants suffixed with `_` when using multiple entry points. diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index ac12256f5e..71c02c94e3 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -10,37 +10,47 @@ import 'dart:ffi' as ffi; /// Holds bindings to LibClang. class Clang { - /// Holds the Dynamic library. - final ffi.DynamicLibrary _dylib; + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; /// The symbols are looked up in [dynamicLibrary]. - Clang(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + Clang(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + Clang.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; /// 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'))( + return _clang_getCString( string, ); } - _dart_clang_getCString? _clang_getCString; + late final _clang_getCString_ptr = + _lookup>('clang_getCString'); + late final _dart_clang_getCString _clang_getCString = + _clang_getCString_ptr.asFunction<_dart_clang_getCString>(); /// Free the given string. void clang_disposeString( CXString string, ) { - return (_clang_disposeString ??= _dylib.lookupFunction< - _c_clang_disposeString, - _dart_clang_disposeString>('clang_disposeString'))( + return _clang_disposeString( string, ); } - _dart_clang_disposeString? _clang_disposeString; + late final _clang_disposeString_ptr = + _lookup>( + 'clang_disposeString'); + late final _dart_clang_disposeString _clang_disposeString = + _clang_disposeString_ptr.asFunction<_dart_clang_disposeString>(); /// Provides a shared context for creating translation units. /// @@ -84,15 +94,16 @@ class Clang { int excludeDeclarationsFromPCH, int displayDiagnostics, ) { - return (_clang_createIndex ??= - _dylib.lookupFunction<_c_clang_createIndex, _dart_clang_createIndex>( - 'clang_createIndex'))( + return _clang_createIndex( excludeDeclarationsFromPCH, displayDiagnostics, ); } - _dart_clang_createIndex? _clang_createIndex; + late final _clang_createIndex_ptr = + _lookup>('clang_createIndex'); + late final _dart_clang_createIndex _clang_createIndex = + _clang_createIndex_ptr.asFunction<_dart_clang_createIndex>(); /// Destroy the given index. /// @@ -101,27 +112,29 @@ class Clang { void clang_disposeIndex( ffi.Pointer index, ) { - return (_clang_disposeIndex ??= - _dylib.lookupFunction<_c_clang_disposeIndex, _dart_clang_disposeIndex>( - 'clang_disposeIndex'))( + return _clang_disposeIndex( index, ); } - _dart_clang_disposeIndex? _clang_disposeIndex; + late final _clang_disposeIndex_ptr = + _lookup>('clang_disposeIndex'); + late final _dart_clang_disposeIndex _clang_disposeIndex = + _clang_disposeIndex_ptr.asFunction<_dart_clang_disposeIndex>(); /// 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'))( + return _clang_getFileName( SFile, ); } - _dart_clang_getFileName? _clang_getFileName; + late final _clang_getFileName_ptr = + _lookup>('clang_getFileName'); + late final _dart_clang_getFileName _clang_getFileName = + _clang_getFileName_ptr.asFunction<_dart_clang_getFileName>(); /// Determine whether two ranges are equivalent. /// @@ -130,15 +143,16 @@ class Clang { CXSourceRange range1, CXSourceRange range2, ) { - return (_clang_equalRanges ??= - _dylib.lookupFunction<_c_clang_equalRanges, _dart_clang_equalRanges>( - 'clang_equalRanges'))( + return _clang_equalRanges( range1, range2, ); } - _dart_clang_equalRanges? _clang_equalRanges; + late final _clang_equalRanges_ptr = + _lookup>('clang_equalRanges'); + late final _dart_clang_equalRanges _clang_equalRanges = + _clang_equalRanges_ptr.asFunction<_dart_clang_equalRanges>(); /// Retrieve the file, line, column, and offset represented by /// the given source location. @@ -168,9 +182,7 @@ class Clang { ffi.Pointer column, ffi.Pointer offset, ) { - return (_clang_getFileLocation ??= _dylib.lookupFunction< - _c_clang_getFileLocation, - _dart_clang_getFileLocation>('clang_getFileLocation'))( + return _clang_getFileLocation( location, file, line, @@ -179,21 +191,27 @@ class Clang { ); } - _dart_clang_getFileLocation? _clang_getFileLocation; + late final _clang_getFileLocation_ptr = + _lookup>( + 'clang_getFileLocation'); + late final _dart_clang_getFileLocation _clang_getFileLocation = + _clang_getFileLocation_ptr.asFunction<_dart_clang_getFileLocation>(); /// Determine the number of diagnostics produced for the given /// translation unit. int clang_getNumDiagnostics( ffi.Pointer Unit, ) { - return (_clang_getNumDiagnostics ??= _dylib.lookupFunction< - _c_clang_getNumDiagnostics, - _dart_clang_getNumDiagnostics>('clang_getNumDiagnostics'))( + return _clang_getNumDiagnostics( Unit, ); } - _dart_clang_getNumDiagnostics? _clang_getNumDiagnostics; + late final _clang_getNumDiagnostics_ptr = + _lookup>( + 'clang_getNumDiagnostics'); + late final _dart_clang_getNumDiagnostics _clang_getNumDiagnostics = + _clang_getNumDiagnostics_ptr.asFunction<_dart_clang_getNumDiagnostics>(); /// Retrieve a diagnostic associated with the given translation unit. /// @@ -206,28 +224,32 @@ class Clang { ffi.Pointer Unit, int Index, ) { - return (_clang_getDiagnostic ??= _dylib.lookupFunction< - _c_clang_getDiagnostic, - _dart_clang_getDiagnostic>('clang_getDiagnostic'))( + return _clang_getDiagnostic( Unit, Index, ); } - _dart_clang_getDiagnostic? _clang_getDiagnostic; + late final _clang_getDiagnostic_ptr = + _lookup>( + 'clang_getDiagnostic'); + late final _dart_clang_getDiagnostic _clang_getDiagnostic = + _clang_getDiagnostic_ptr.asFunction<_dart_clang_getDiagnostic>(); /// Destroy a diagnostic. void clang_disposeDiagnostic( ffi.Pointer Diagnostic, ) { - return (_clang_disposeDiagnostic ??= _dylib.lookupFunction< - _c_clang_disposeDiagnostic, - _dart_clang_disposeDiagnostic>('clang_disposeDiagnostic'))( + return _clang_disposeDiagnostic( Diagnostic, ); } - _dart_clang_disposeDiagnostic? _clang_disposeDiagnostic; + late final _clang_disposeDiagnostic_ptr = + _lookup>( + 'clang_disposeDiagnostic'); + late final _dart_clang_disposeDiagnostic _clang_disposeDiagnostic = + _clang_disposeDiagnostic_ptr.asFunction<_dart_clang_disposeDiagnostic>(); /// Format the given diagnostic in a manner that is suitable for display. /// @@ -246,15 +268,17 @@ class Clang { ffi.Pointer Diagnostic, int Options, ) { - return (_clang_formatDiagnostic ??= _dylib.lookupFunction< - _c_clang_formatDiagnostic, - _dart_clang_formatDiagnostic>('clang_formatDiagnostic'))( + return _clang_formatDiagnostic( Diagnostic, Options, ); } - _dart_clang_formatDiagnostic? _clang_formatDiagnostic; + late final _clang_formatDiagnostic_ptr = + _lookup>( + 'clang_formatDiagnostic'); + late final _dart_clang_formatDiagnostic _clang_formatDiagnostic = + _clang_formatDiagnostic_ptr.asFunction<_dart_clang_formatDiagnostic>(); /// Same as \c clang_parseTranslationUnit2, but returns /// the \c CXTranslationUnit instead of an error code. In case of an error this @@ -269,9 +293,7 @@ class Clang { int num_unsaved_files, int options, ) { - return (_clang_parseTranslationUnit ??= _dylib.lookupFunction< - _c_clang_parseTranslationUnit, - _dart_clang_parseTranslationUnit>('clang_parseTranslationUnit'))( + return _clang_parseTranslationUnit( CIdx, source_filename, command_line_args, @@ -282,20 +304,28 @@ class Clang { ); } - _dart_clang_parseTranslationUnit? _clang_parseTranslationUnit; + late final _clang_parseTranslationUnit_ptr = + _lookup>( + 'clang_parseTranslationUnit'); + late final _dart_clang_parseTranslationUnit _clang_parseTranslationUnit = + _clang_parseTranslationUnit_ptr + .asFunction<_dart_clang_parseTranslationUnit>(); /// Destroy the specified CXTranslationUnit object. void clang_disposeTranslationUnit( ffi.Pointer arg0, ) { - return (_clang_disposeTranslationUnit ??= _dylib.lookupFunction< - _c_clang_disposeTranslationUnit, - _dart_clang_disposeTranslationUnit>('clang_disposeTranslationUnit'))( + return _clang_disposeTranslationUnit( arg0, ); } - _dart_clang_disposeTranslationUnit? _clang_disposeTranslationUnit; + late final _clang_disposeTranslationUnit_ptr = + _lookup>( + 'clang_disposeTranslationUnit'); + late final _dart_clang_disposeTranslationUnit _clang_disposeTranslationUnit = + _clang_disposeTranslationUnit_ptr + .asFunction<_dart_clang_disposeTranslationUnit>(); /// Retrieve the cursor that represents the given translation unit. /// @@ -304,28 +334,47 @@ class Clang { CXCursor clang_getTranslationUnitCursor( ffi.Pointer arg0, ) { - return (_clang_getTranslationUnitCursor ??= _dylib.lookupFunction< - _c_clang_getTranslationUnitCursor, - _dart_clang_getTranslationUnitCursor>( - 'clang_getTranslationUnitCursor'))( + return _clang_getTranslationUnitCursor( arg0, ); } - _dart_clang_getTranslationUnitCursor? _clang_getTranslationUnitCursor; + late final _clang_getTranslationUnitCursor_ptr = + _lookup>( + 'clang_getTranslationUnitCursor'); + late final _dart_clang_getTranslationUnitCursor + _clang_getTranslationUnitCursor = _clang_getTranslationUnitCursor_ptr + .asFunction<_dart_clang_getTranslationUnitCursor>(); + + /// Returns non-zero if \p cursor is null. + int clang_Cursor_isNull( + CXCursor cursor, + ) { + return _clang_Cursor_isNull( + cursor, + ); + } + + late final _clang_Cursor_isNull_ptr = + _lookup>( + 'clang_Cursor_isNull'); + late final _dart_clang_Cursor_isNull _clang_Cursor_isNull = + _clang_Cursor_isNull_ptr.asFunction<_dart_clang_Cursor_isNull>(); /// 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'))( + return _clang_getCursorKind( arg0, ); } - _dart_clang_getCursorKind? _clang_getCursorKind; + late final _clang_getCursorKind_ptr = + _lookup>( + 'clang_getCursorKind'); + late final _dart_clang_getCursorKind _clang_getCursorKind = + _clang_getCursorKind_ptr.asFunction<_dart_clang_getCursorKind>(); /// Retrieve the physical location of the source constructor referenced /// by the given cursor. @@ -338,27 +387,31 @@ class Clang { CXSourceLocation clang_getCursorLocation( CXCursor arg0, ) { - return (_clang_getCursorLocation ??= _dylib.lookupFunction< - _c_clang_getCursorLocation, - _dart_clang_getCursorLocation>('clang_getCursorLocation'))( + return _clang_getCursorLocation( arg0, ); } - _dart_clang_getCursorLocation? _clang_getCursorLocation; + late final _clang_getCursorLocation_ptr = + _lookup>( + 'clang_getCursorLocation'); + late final _dart_clang_getCursorLocation _clang_getCursorLocation = + _clang_getCursorLocation_ptr.asFunction<_dart_clang_getCursorLocation>(); /// Retrieve the type of a CXCursor (if any). CXType clang_getCursorType( CXCursor C, ) { - return (_clang_getCursorType ??= _dylib.lookupFunction< - _c_clang_getCursorType, - _dart_clang_getCursorType>('clang_getCursorType'))( + return _clang_getCursorType( C, ); } - _dart_clang_getCursorType? _clang_getCursorType; + late final _clang_getCursorType_ptr = + _lookup>( + 'clang_getCursorType'); + late final _dart_clang_getCursorType _clang_getCursorType = + _clang_getCursorType_ptr.asFunction<_dart_clang_getCursorType>(); /// Pretty-print the underlying type using the rules of the /// language of the translation unit from which it came. @@ -367,14 +420,16 @@ class Clang { CXString clang_getTypeSpelling( CXType CT, ) { - return (_clang_getTypeSpelling ??= _dylib.lookupFunction< - _c_clang_getTypeSpelling, - _dart_clang_getTypeSpelling>('clang_getTypeSpelling'))( + return _clang_getTypeSpelling( CT, ); } - _dart_clang_getTypeSpelling? _clang_getTypeSpelling; + late final _clang_getTypeSpelling_ptr = + _lookup>( + 'clang_getTypeSpelling'); + late final _dart_clang_getTypeSpelling _clang_getTypeSpelling = + _clang_getTypeSpelling_ptr.asFunction<_dart_clang_getTypeSpelling>(); /// Retrieve the underlying type of a typedef declaration. /// @@ -383,15 +438,18 @@ class Clang { CXType clang_getTypedefDeclUnderlyingType( CXCursor C, ) { - return (_clang_getTypedefDeclUnderlyingType ??= _dylib.lookupFunction< - _c_clang_getTypedefDeclUnderlyingType, - _dart_clang_getTypedefDeclUnderlyingType>( - 'clang_getTypedefDeclUnderlyingType'))( + return _clang_getTypedefDeclUnderlyingType( C, ); } - _dart_clang_getTypedefDeclUnderlyingType? _clang_getTypedefDeclUnderlyingType; + late final _clang_getTypedefDeclUnderlyingType_ptr = + _lookup>( + 'clang_getTypedefDeclUnderlyingType'); + late final _dart_clang_getTypedefDeclUnderlyingType + _clang_getTypedefDeclUnderlyingType = + _clang_getTypedefDeclUnderlyingType_ptr + .asFunction<_dart_clang_getTypedefDeclUnderlyingType>(); /// Retrieve the integer value of an enum constant declaration as a signed /// long long. @@ -402,15 +460,17 @@ class Clang { int clang_getEnumConstantDeclValue( CXCursor C, ) { - return (_clang_getEnumConstantDeclValue ??= _dylib.lookupFunction< - _c_clang_getEnumConstantDeclValue, - _dart_clang_getEnumConstantDeclValue>( - 'clang_getEnumConstantDeclValue'))( + return _clang_getEnumConstantDeclValue( C, ); } - _dart_clang_getEnumConstantDeclValue? _clang_getEnumConstantDeclValue; + late final _clang_getEnumConstantDeclValue_ptr = + _lookup>( + 'clang_getEnumConstantDeclValue'); + late final _dart_clang_getEnumConstantDeclValue + _clang_getEnumConstantDeclValue = _clang_getEnumConstantDeclValue_ptr + .asFunction<_dart_clang_getEnumConstantDeclValue>(); /// Retrieve the bit width of a bit field declaration as an integer. /// @@ -418,14 +478,17 @@ class Clang { int clang_getFieldDeclBitWidth( CXCursor C, ) { - return (_clang_getFieldDeclBitWidth ??= _dylib.lookupFunction< - _c_clang_getFieldDeclBitWidth, - _dart_clang_getFieldDeclBitWidth>('clang_getFieldDeclBitWidth'))( + return _clang_getFieldDeclBitWidth( C, ); } - _dart_clang_getFieldDeclBitWidth? _clang_getFieldDeclBitWidth; + late final _clang_getFieldDeclBitWidth_ptr = + _lookup>( + 'clang_getFieldDeclBitWidth'); + late final _dart_clang_getFieldDeclBitWidth _clang_getFieldDeclBitWidth = + _clang_getFieldDeclBitWidth_ptr + .asFunction<_dart_clang_getFieldDeclBitWidth>(); /// Retrieve the number of non-variadic arguments associated with a given /// cursor. @@ -435,14 +498,17 @@ class Clang { int clang_Cursor_getNumArguments( CXCursor C, ) { - return (_clang_Cursor_getNumArguments ??= _dylib.lookupFunction< - _c_clang_Cursor_getNumArguments, - _dart_clang_Cursor_getNumArguments>('clang_Cursor_getNumArguments'))( + return _clang_Cursor_getNumArguments( C, ); } - _dart_clang_Cursor_getNumArguments? _clang_Cursor_getNumArguments; + late final _clang_Cursor_getNumArguments_ptr = + _lookup>( + 'clang_Cursor_getNumArguments'); + late final _dart_clang_Cursor_getNumArguments _clang_Cursor_getNumArguments = + _clang_Cursor_getNumArguments_ptr + .asFunction<_dart_clang_Cursor_getNumArguments>(); /// Retrieve the argument cursor of a function or method. /// @@ -453,15 +519,18 @@ class Clang { CXCursor C, int i, ) { - return (_clang_Cursor_getArgument ??= _dylib.lookupFunction< - _c_clang_Cursor_getArgument, - _dart_clang_Cursor_getArgument>('clang_Cursor_getArgument'))( + return _clang_Cursor_getArgument( C, i, ); } - _dart_clang_Cursor_getArgument? _clang_Cursor_getArgument; + late final _clang_Cursor_getArgument_ptr = + _lookup>( + 'clang_Cursor_getArgument'); + late final _dart_clang_Cursor_getArgument _clang_Cursor_getArgument = + _clang_Cursor_getArgument_ptr + .asFunction<_dart_clang_Cursor_getArgument>(); /// Return the canonical type for a CXType. /// @@ -472,110 +541,129 @@ class Clang { CXType clang_getCanonicalType( CXType T, ) { - return (_clang_getCanonicalType ??= _dylib.lookupFunction< - _c_clang_getCanonicalType, - _dart_clang_getCanonicalType>('clang_getCanonicalType'))( + return _clang_getCanonicalType( T, ); } - _dart_clang_getCanonicalType? _clang_getCanonicalType; + late final _clang_getCanonicalType_ptr = + _lookup>( + 'clang_getCanonicalType'); + late final _dart_clang_getCanonicalType _clang_getCanonicalType = + _clang_getCanonicalType_ptr.asFunction<_dart_clang_getCanonicalType>(); /// 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'))( + return _clang_Cursor_isMacroFunctionLike( C, ); } - _dart_clang_Cursor_isMacroFunctionLike? _clang_Cursor_isMacroFunctionLike; + late final _clang_Cursor_isMacroFunctionLike_ptr = + _lookup>( + 'clang_Cursor_isMacroFunctionLike'); + late final _dart_clang_Cursor_isMacroFunctionLike + _clang_Cursor_isMacroFunctionLike = _clang_Cursor_isMacroFunctionLike_ptr + .asFunction<_dart_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'))( + return _clang_Cursor_isMacroBuiltin( C, ); } - _dart_clang_Cursor_isMacroBuiltin? _clang_Cursor_isMacroBuiltin; + late final _clang_Cursor_isMacroBuiltin_ptr = + _lookup>( + 'clang_Cursor_isMacroBuiltin'); + late final _dart_clang_Cursor_isMacroBuiltin _clang_Cursor_isMacroBuiltin = + _clang_Cursor_isMacroBuiltin_ptr + .asFunction<_dart_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'))( + return _clang_Cursor_isFunctionInlined( C, ); } - _dart_clang_Cursor_isFunctionInlined? _clang_Cursor_isFunctionInlined; + late final _clang_Cursor_isFunctionInlined_ptr = + _lookup>( + 'clang_Cursor_isFunctionInlined'); + late final _dart_clang_Cursor_isFunctionInlined + _clang_Cursor_isFunctionInlined = _clang_Cursor_isFunctionInlined_ptr + .asFunction<_dart_clang_Cursor_isFunctionInlined>(); /// 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'))( + return _clang_getTypedefName( CT, ); } - _dart_clang_getTypedefName? _clang_getTypedefName; + late final _clang_getTypedefName_ptr = + _lookup>( + 'clang_getTypedefName'); + late final _dart_clang_getTypedefName _clang_getTypedefName = + _clang_getTypedefName_ptr.asFunction<_dart_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'))( + return _clang_getPointeeType( T, ); } - _dart_clang_getPointeeType? _clang_getPointeeType; + late final _clang_getPointeeType_ptr = + _lookup>( + 'clang_getPointeeType'); + late final _dart_clang_getPointeeType _clang_getPointeeType = + _clang_getPointeeType_ptr.asFunction<_dart_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'))( + return _clang_getTypeDeclaration( T, ); } - _dart_clang_getTypeDeclaration? _clang_getTypeDeclaration; + late final _clang_getTypeDeclaration_ptr = + _lookup>( + 'clang_getTypeDeclaration'); + late final _dart_clang_getTypeDeclaration _clang_getTypeDeclaration = + _clang_getTypeDeclaration_ptr + .asFunction<_dart_clang_getTypeDeclaration>(); /// 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'))( + return _clang_getTypeKindSpelling( K, ); } - _dart_clang_getTypeKindSpelling? _clang_getTypeKindSpelling; + late final _clang_getTypeKindSpelling_ptr = + _lookup>( + 'clang_getTypeKindSpelling'); + late final _dart_clang_getTypeKindSpelling _clang_getTypeKindSpelling = + _clang_getTypeKindSpelling_ptr + .asFunction<_dart_clang_getTypeKindSpelling>(); /// Retrieve the return type associated with a function type. /// @@ -583,14 +671,16 @@ class Clang { CXType clang_getResultType( CXType T, ) { - return (_clang_getResultType ??= _dylib.lookupFunction< - _c_clang_getResultType, - _dart_clang_getResultType>('clang_getResultType'))( + return _clang_getResultType( T, ); } - _dart_clang_getResultType? _clang_getResultType; + late final _clang_getResultType_ptr = + _lookup>( + 'clang_getResultType'); + late final _dart_clang_getResultType _clang_getResultType = + _clang_getResultType_ptr.asFunction<_dart_clang_getResultType>(); /// Retrieve the number of non-variadic parameters associated with a /// function type. @@ -599,14 +689,16 @@ class Clang { int clang_getNumArgTypes( CXType T, ) { - return (_clang_getNumArgTypes ??= _dylib.lookupFunction< - _c_clang_getNumArgTypes, - _dart_clang_getNumArgTypes>('clang_getNumArgTypes'))( + return _clang_getNumArgTypes( T, ); } - _dart_clang_getNumArgTypes? _clang_getNumArgTypes; + late final _clang_getNumArgTypes_ptr = + _lookup>( + 'clang_getNumArgTypes'); + late final _dart_clang_getNumArgTypes _clang_getNumArgTypes = + _clang_getNumArgTypes_ptr.asFunction<_dart_clang_getNumArgTypes>(); /// Retrieve the type of a parameter of a function type. /// @@ -616,15 +708,16 @@ class Clang { CXType T, int i, ) { - return (_clang_getArgType ??= - _dylib.lookupFunction<_c_clang_getArgType, _dart_clang_getArgType>( - 'clang_getArgType'))( + return _clang_getArgType( T, i, ); } - _dart_clang_getArgType? _clang_getArgType; + late final _clang_getArgType_ptr = + _lookup>('clang_getArgType'); + late final _dart_clang_getArgType _clang_getArgType = + _clang_getArgType_ptr.asFunction<_dart_clang_getArgType>(); /// Return the number of elements of an array or vector type. /// @@ -633,14 +726,16 @@ class Clang { int clang_getNumElements( CXType T, ) { - return (_clang_getNumElements ??= _dylib.lookupFunction< - _c_clang_getNumElements, - _dart_clang_getNumElements>('clang_getNumElements'))( + return _clang_getNumElements( T, ); } - _dart_clang_getNumElements? _clang_getNumElements; + late final _clang_getNumElements_ptr = + _lookup>( + 'clang_getNumElements'); + late final _dart_clang_getNumElements _clang_getNumElements = + _clang_getNumElements_ptr.asFunction<_dart_clang_getNumElements>(); /// Return the element type of an array type. /// @@ -648,14 +743,17 @@ class Clang { CXType clang_getArrayElementType( CXType T, ) { - return (_clang_getArrayElementType ??= _dylib.lookupFunction< - _c_clang_getArrayElementType, - _dart_clang_getArrayElementType>('clang_getArrayElementType'))( + return _clang_getArrayElementType( T, ); } - _dart_clang_getArrayElementType? _clang_getArrayElementType; + late final _clang_getArrayElementType_ptr = + _lookup>( + 'clang_getArrayElementType'); + late final _dart_clang_getArrayElementType _clang_getArrayElementType = + _clang_getArrayElementType_ptr + .asFunction<_dart_clang_getArrayElementType>(); /// Retrieve the type named by the qualified-id. /// @@ -663,43 +761,51 @@ class Clang { CXType clang_Type_getNamedType( CXType T, ) { - return (_clang_Type_getNamedType ??= _dylib.lookupFunction< - _c_clang_Type_getNamedType, - _dart_clang_Type_getNamedType>('clang_Type_getNamedType'))( + return _clang_Type_getNamedType( T, ); } - _dart_clang_Type_getNamedType? _clang_Type_getNamedType; + late final _clang_Type_getNamedType_ptr = + _lookup>( + 'clang_Type_getNamedType'); + late final _dart_clang_Type_getNamedType _clang_Type_getNamedType = + _clang_Type_getNamedType_ptr.asFunction<_dart_clang_Type_getNamedType>(); /// 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'))( + return _clang_Cursor_isAnonymous( C, ); } - _dart_clang_Cursor_isAnonymous? _clang_Cursor_isAnonymous; + late final _clang_Cursor_isAnonymous_ptr = + _lookup>( + 'clang_Cursor_isAnonymous'); + late final _dart_clang_Cursor_isAnonymous _clang_Cursor_isAnonymous = + _clang_Cursor_isAnonymous_ptr + .asFunction<_dart_clang_Cursor_isAnonymous>(); /// 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'))( + return _clang_Cursor_isAnonymousRecordDecl( C, ); } - _dart_clang_Cursor_isAnonymousRecordDecl? _clang_Cursor_isAnonymousRecordDecl; + late final _clang_Cursor_isAnonymousRecordDecl_ptr = + _lookup>( + 'clang_Cursor_isAnonymousRecordDecl'); + late final _dart_clang_Cursor_isAnonymousRecordDecl + _clang_Cursor_isAnonymousRecordDecl = + _clang_Cursor_isAnonymousRecordDecl_ptr + .asFunction<_dart_clang_Cursor_isAnonymousRecordDecl>(); /// Visit the children of a particular cursor. /// @@ -726,16 +832,18 @@ class Clang { ffi.Pointer> visitor, ffi.Pointer client_data, ) { - return (_clang_visitChildren ??= _dylib.lookupFunction< - _c_clang_visitChildren, - _dart_clang_visitChildren>('clang_visitChildren'))( + return _clang_visitChildren( parent, visitor, client_data, ); } - _dart_clang_visitChildren? _clang_visitChildren; + late final _clang_visitChildren_ptr = + _lookup>( + 'clang_visitChildren'); + late final _dart_clang_visitChildren _clang_visitChildren = + _clang_visitChildren_ptr.asFunction<_dart_clang_visitChildren>(); /// Retrieve a Unified Symbol Resolution (USR) for the entity referenced /// by the given cursor. @@ -747,27 +855,71 @@ class Clang { CXString clang_getCursorUSR( CXCursor arg0, ) { - return (_clang_getCursorUSR ??= - _dylib.lookupFunction<_c_clang_getCursorUSR, _dart_clang_getCursorUSR>( - 'clang_getCursorUSR'))( + return _clang_getCursorUSR( arg0, ); } - _dart_clang_getCursorUSR? _clang_getCursorUSR; + late final _clang_getCursorUSR_ptr = + _lookup>('clang_getCursorUSR'); + late final _dart_clang_getCursorUSR _clang_getCursorUSR = + _clang_getCursorUSR_ptr.asFunction<_dart_clang_getCursorUSR>(); /// 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'))( + return _clang_getCursorSpelling( + arg0, + ); + } + + late final _clang_getCursorSpelling_ptr = + _lookup>( + 'clang_getCursorSpelling'); + late final _dart_clang_getCursorSpelling _clang_getCursorSpelling = + _clang_getCursorSpelling_ptr.asFunction<_dart_clang_getCursorSpelling>(); + + /// 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( arg0, ); } - _dart_clang_getCursorSpelling? _clang_getCursorSpelling; + late final _clang_getCursorDefinition_ptr = + _lookup>( + 'clang_getCursorDefinition'); + late final _dart_clang_getCursorDefinition _clang_getCursorDefinition = + _clang_getCursorDefinition_ptr + .asFunction<_dart_clang_getCursorDefinition>(); /// Given a cursor that represents a declaration, return the associated /// comment's source range. The range may include multiple consecutive comments @@ -775,29 +927,34 @@ class Clang { CXSourceRange clang_Cursor_getCommentRange( CXCursor C, ) { - return (_clang_Cursor_getCommentRange ??= _dylib.lookupFunction< - _c_clang_Cursor_getCommentRange, - _dart_clang_Cursor_getCommentRange>('clang_Cursor_getCommentRange'))( + return _clang_Cursor_getCommentRange( C, ); } - _dart_clang_Cursor_getCommentRange? _clang_Cursor_getCommentRange; + late final _clang_Cursor_getCommentRange_ptr = + _lookup>( + 'clang_Cursor_getCommentRange'); + late final _dart_clang_Cursor_getCommentRange _clang_Cursor_getCommentRange = + _clang_Cursor_getCommentRange_ptr + .asFunction<_dart_clang_Cursor_getCommentRange>(); /// 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'))( + return _clang_Cursor_getRawCommentText( C, ); } - _dart_clang_Cursor_getRawCommentText? _clang_Cursor_getRawCommentText; + late final _clang_Cursor_getRawCommentText_ptr = + _lookup>( + 'clang_Cursor_getRawCommentText'); + late final _dart_clang_Cursor_getRawCommentText + _clang_Cursor_getRawCommentText = _clang_Cursor_getRawCommentText_ptr + .asFunction<_dart_clang_Cursor_getRawCommentText>(); /// Given a cursor that represents a documentable entity (e.g., /// declaration), return the associated \paragraph; otherwise return the @@ -805,15 +962,17 @@ class Clang { CXString clang_Cursor_getBriefCommentText( CXCursor C, ) { - return (_clang_Cursor_getBriefCommentText ??= _dylib.lookupFunction< - _c_clang_Cursor_getBriefCommentText, - _dart_clang_Cursor_getBriefCommentText>( - 'clang_Cursor_getBriefCommentText'))( + return _clang_Cursor_getBriefCommentText( C, ); } - _dart_clang_Cursor_getBriefCommentText? _clang_Cursor_getBriefCommentText; + late final _clang_Cursor_getBriefCommentText_ptr = + _lookup>( + 'clang_Cursor_getBriefCommentText'); + late final _dart_clang_Cursor_getBriefCommentText + _clang_Cursor_getBriefCommentText = _clang_Cursor_getBriefCommentText_ptr + .asFunction<_dart_clang_Cursor_getBriefCommentText>(); /// \defgroup CINDEX_DEBUG Debugging facilities /// @@ -824,14 +983,17 @@ class Clang { CXString clang_getCursorKindSpelling( int Kind, ) { - return (_clang_getCursorKindSpelling ??= _dylib.lookupFunction< - _c_clang_getCursorKindSpelling, - _dart_clang_getCursorKindSpelling>('clang_getCursorKindSpelling'))( + return _clang_getCursorKindSpelling( Kind, ); } - _dart_clang_getCursorKindSpelling? _clang_getCursorKindSpelling; + late final _clang_getCursorKindSpelling_ptr = + _lookup>( + 'clang_getCursorKindSpelling'); + late final _dart_clang_getCursorKindSpelling _clang_getCursorKindSpelling = + _clang_getCursorKindSpelling_ptr + .asFunction<_dart_clang_getCursorKindSpelling>(); /// If cursor is a statement declaration tries to evaluate the /// statement and if its variable, tries to evaluate its initializer, @@ -839,41 +1001,49 @@ class Clang { ffi.Pointer clang_Cursor_Evaluate( CXCursor C, ) { - return (_clang_Cursor_Evaluate ??= _dylib.lookupFunction< - _c_clang_Cursor_Evaluate, - _dart_clang_Cursor_Evaluate>('clang_Cursor_Evaluate'))( + return _clang_Cursor_Evaluate( C, ); } - _dart_clang_Cursor_Evaluate? _clang_Cursor_Evaluate; + late final _clang_Cursor_Evaluate_ptr = + _lookup>( + 'clang_Cursor_Evaluate'); + late final _dart_clang_Cursor_Evaluate _clang_Cursor_Evaluate = + _clang_Cursor_Evaluate_ptr.asFunction<_dart_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'))( + return _clang_EvalResult_getKind( E, ); } - _dart_clang_EvalResult_getKind? _clang_EvalResult_getKind; + late final _clang_EvalResult_getKind_ptr = + _lookup>( + 'clang_EvalResult_getKind'); + late final _dart_clang_EvalResult_getKind _clang_EvalResult_getKind = + _clang_EvalResult_getKind_ptr + .asFunction<_dart_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'))( + return _clang_EvalResult_getAsInt( E, ); } - _dart_clang_EvalResult_getAsInt? _clang_EvalResult_getAsInt; + late final _clang_EvalResult_getAsInt_ptr = + _lookup>( + 'clang_EvalResult_getAsInt'); + late final _dart_clang_EvalResult_getAsInt _clang_EvalResult_getAsInt = + _clang_EvalResult_getAsInt_ptr + .asFunction<_dart_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 @@ -881,29 +1051,34 @@ class Clang { int clang_EvalResult_getAsLongLong( ffi.Pointer E, ) { - return (_clang_EvalResult_getAsLongLong ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsLongLong, - _dart_clang_EvalResult_getAsLongLong>( - 'clang_EvalResult_getAsLongLong'))( + return _clang_EvalResult_getAsLongLong( E, ); } - _dart_clang_EvalResult_getAsLongLong? _clang_EvalResult_getAsLongLong; + late final _clang_EvalResult_getAsLongLong_ptr = + _lookup>( + 'clang_EvalResult_getAsLongLong'); + late final _dart_clang_EvalResult_getAsLongLong + _clang_EvalResult_getAsLongLong = _clang_EvalResult_getAsLongLong_ptr + .asFunction<_dart_clang_EvalResult_getAsLongLong>(); /// 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'))( + return _clang_EvalResult_getAsDouble( E, ); } - _dart_clang_EvalResult_getAsDouble? _clang_EvalResult_getAsDouble; + late final _clang_EvalResult_getAsDouble_ptr = + _lookup>( + 'clang_EvalResult_getAsDouble'); + late final _dart_clang_EvalResult_getAsDouble _clang_EvalResult_getAsDouble = + _clang_EvalResult_getAsDouble_ptr + .asFunction<_dart_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, @@ -912,27 +1087,33 @@ class Clang { 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'))( + return _clang_EvalResult_getAsStr( E, ); } - _dart_clang_EvalResult_getAsStr? _clang_EvalResult_getAsStr; + late final _clang_EvalResult_getAsStr_ptr = + _lookup>( + 'clang_EvalResult_getAsStr'); + late final _dart_clang_EvalResult_getAsStr _clang_EvalResult_getAsStr = + _clang_EvalResult_getAsStr_ptr + .asFunction<_dart_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'))( + return _clang_EvalResult_dispose( E, ); } - _dart_clang_EvalResult_dispose? _clang_EvalResult_dispose; + late final _clang_EvalResult_dispose_ptr = + _lookup>( + 'clang_EvalResult_dispose'); + late final _dart_clang_EvalResult_dispose _clang_EvalResult_dispose = + _clang_EvalResult_dispose_ptr + .asFunction<_dart_clang_EvalResult_dispose>(); } /// A character string. @@ -2493,6 +2674,14 @@ typedef _dart_clang_getTranslationUnitCursor = CXCursor Function( ffi.Pointer arg0, ); +typedef _c_clang_Cursor_isNull = ffi.Int32 Function( + CXCursor cursor, +); + +typedef _dart_clang_Cursor_isNull = int Function( + CXCursor cursor, +); + typedef _c_clang_getCursorKind = ffi.Int32 Function( CXCursor arg0, ); @@ -2731,6 +2920,14 @@ typedef _dart_clang_getCursorSpelling = CXString Function( CXCursor arg0, ); +typedef _c_clang_getCursorDefinition = CXCursor Function( + CXCursor arg0, +); + +typedef _dart_clang_getCursorDefinition = CXCursor Function( + CXCursor arg0, +); + typedef _c_clang_Cursor_getCommentRange = CXSourceRange Function( CXCursor C, ); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index 7da0ab43bd..7e09598080 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -32,6 +32,12 @@ EnumClass? parseEnumDeclaration( String? name, }) { _stack.push(_ParsedEnum()); + + // Parse the cursor definition instead, if this is a forward declaration. + if (isForwardDeclaration(cursor)) { + cursor = clang.clang_getCursorDefinition(cursor); + } + final enumUsr = cursor.usr(); final enumName = name ?? cursor.spelling(); if (enumName == '') { diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index 3cc0e23001..4a6964bb55 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -50,6 +50,11 @@ Struc? parseStructDeclaration( }) { _stack.push(_ParsedStruc()); + // Parse the cursor definition instead, if this is a forward declaration. + if (isForwardDeclaration(cursor)) { + cursor = clang.clang_getCursorDefinition(cursor); + } + final structUsr = cursor.usr(); final structName = name ?? cursor.spelling(); diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index 915d4b7d50..ef91924da4 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -205,6 +205,11 @@ String? removeRawCommentMarkups(String? string) { return sb.toString().trim(); } +bool isForwardDeclaration(clang_types.CXCursor cursor) { + return clang.clang_Cursor_isNull(clang.clang_getCursorDefinition(cursor)) == + 0; +} + extension CXTypeExt on clang_types.CXType { /// Get code_gen [Type] representation of [clang_types.CXType]. Type toCodeGenType() { diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index df6c00b90b..1b6b447771 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.2.1 +version: 2.2.2 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart new file mode 100644 index 0000000000..5fc47cdea4 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart @@ -0,0 +1,57 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Forward Declaration Test +class NativeLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + NativeLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NativeLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + void func( + ffi.Pointer a, + int b, + ) { + return _func( + a, + b, + ); + } + + late final _func_ptr = _lookup>('func'); + late final _dart_func _func = _func_ptr.asFunction<_dart_func>(); +} + +class A extends ffi.Struct { + @ffi.Int32() + external int a; + + @ffi.Int32() + external int b; +} + +abstract class B { + static const int a = 0; + static const int b = 1; +} + +typedef _c_func = ffi.Void Function( + ffi.Pointer a, + ffi.Int32 b, +); + +typedef _dart_func = void Function( + ffi.Pointer a, + int b, +); diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart index bc97540ab3..ac068d2aaa 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart @@ -3,7 +3,7 @@ // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -/// Unnamed Enums Test +/// Native Func Typedef Test. class NativeLibrary { /// Holds the symbol lookup function. final ffi.Pointer Function(String symbolName) diff --git a/pkgs/ffigen/test/header_parser_tests/forward_decl.h b/pkgs/ffigen/test/header_parser_tests/forward_decl.h new file mode 100644 index 0000000000..9e669aa6ec --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/forward_decl.h @@ -0,0 +1,20 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +struct A; +enum B; + +void func(struct A *a, enum B b); + +struct A +{ + int a; + int b; +}; + +enum B +{ + a, + b +}; diff --git a/pkgs/ffigen/test/header_parser_tests/forward_decl_test.dart b/pkgs/ffigen/test/header_parser_tests/forward_decl_test.dart new file mode 100644 index 0000000000..b0418b54f4 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/forward_decl_test.dart @@ -0,0 +1,45 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/config_provider.dart'; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; +import 'package:ffigen/src/strings.dart' as strings; + +import '../test_utils.dart'; + +late Library actual; +void main() { + group('forward_decl_test', () { + setUpAll(() { + logWarnings(Level.SEVERE); + actual = parser.parse( + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Forward Declaration Test' +${strings.output}: 'unused' +${strings.headers}: + ${strings.entryPoints}: + - 'test/header_parser_tests/forward_decl.h' + ''') as yaml.YamlMap), + ); + }); + + test('Expected bindings', () { + matchLibraryWithExpected(actual, [ + 'test', + 'debug_generated', + 'forward_decl_test_output.dart' + ], [ + 'test', + 'header_parser_tests', + 'expected_bindings', + '_expected_forward_decl_bindings.dart' + ]); + }); + }); +} diff --git a/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart index 7a56d2b599..e041f56087 100644 --- a/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart @@ -14,13 +14,13 @@ import '../test_utils.dart'; late Library actual; void main() { - group('unnamed_enums_test', () { + group('native_func_typedef_test', () { setUpAll(() { logWarnings(Level.SEVERE); actual = parser.parse( Config.fromYaml(yaml.loadYaml(''' ${strings.name}: 'NativeLibrary' -${strings.description}: 'Unnamed Enums Test' +${strings.description}: 'Native Func Typedef Test.' ${strings.output}: 'unused' ${strings.headers}: ${strings.entryPoints}: diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index 0a52e5bc5c..3a7e50e434 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -877,7 +877,7 @@ class SQLite { /// or [prepared statement] that invoked the busy handler. int sqlite3_busy_handler( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ) { return _sqlite3_busy_handler( @@ -1427,7 +1427,7 @@ class SQLite { /// sqlite3_prepare_v2() to reprepare a statement after a schema change. int sqlite3_set_authorizer( ffi.Pointer arg0, - ffi.Pointer> xAuth, + ffi.Pointer> xAuth, ffi.Pointer pUserData, ) { return _sqlite3_set_authorizer( @@ -1475,7 +1475,7 @@ class SQLite { /// profile callback. ffi.Pointer sqlite3_trace( ffi.Pointer arg0, - ffi.Pointer> xTrace, + ffi.Pointer> xTrace, ffi.Pointer arg2, ) { return _sqlite3_trace( @@ -1492,7 +1492,7 @@ class SQLite { ffi.Pointer sqlite3_profile( ffi.Pointer arg0, - ffi.Pointer> xProfile, + ffi.Pointer> xProfile, ffi.Pointer arg2, ) { return _sqlite3_profile( @@ -1537,7 +1537,7 @@ class SQLite { int sqlite3_trace_v2( ffi.Pointer arg0, int uMask, - ffi.Pointer> xCallback, + ffi.Pointer> xCallback, ffi.Pointer pCtx, ) { return _sqlite3_trace_v2( @@ -1585,7 +1585,7 @@ class SQLite { void sqlite3_progress_handler( ffi.Pointer arg0, int arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, ffi.Pointer arg3, ) { return _sqlite3_progress_handler( @@ -2927,7 +2927,7 @@ class SQLite { int arg1, ffi.Pointer arg2, int n, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ) { return _sqlite3_bind_blob( arg0, @@ -2948,7 +2948,7 @@ class SQLite { int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ) { return _sqlite3_bind_blob64( arg0, @@ -3037,7 +3037,7 @@ class SQLite { int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ) { return _sqlite3_bind_text( arg0, @@ -3058,7 +3058,7 @@ class SQLite { int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ) { return _sqlite3_bind_text16( arg0, @@ -3080,7 +3080,7 @@ class SQLite { int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, int encoding, ) { return _sqlite3_bind_text64( @@ -3121,7 +3121,7 @@ class SQLite { int arg1, ffi.Pointer arg2, ffi.Pointer arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ) { return _sqlite3_bind_pointer( arg0, @@ -4275,9 +4275,9 @@ class SQLite { int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, ) { return _sqlite3_create_function( db, @@ -4303,9 +4303,9 @@ class SQLite { int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, ) { return _sqlite3_create_function16( db, @@ -4332,10 +4332,10 @@ class SQLite { int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xDestroy, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, + ffi.Pointer> xDestroy, ) { return _sqlite3_create_function_v2( db, @@ -4363,11 +4363,11 @@ class SQLite { int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xValue, - ffi.Pointer> xInverse, - ffi.Pointer> xDestroy, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, + ffi.Pointer> xValue, + ffi.Pointer> xInverse, + ffi.Pointer> xDestroy, ) { return _sqlite3_create_window_function( db, @@ -4455,7 +4455,7 @@ class SQLite { _sqlite3_thread_cleanup_ptr.asFunction<_dart_sqlite3_thread_cleanup>(); int sqlite3_memory_alarm( - ffi.Pointer> arg0, + ffi.Pointer> arg0, ffi.Pointer arg1, int arg2, ) { @@ -5047,7 +5047,7 @@ class SQLite { ffi.Pointer arg0, int N, ffi.Pointer arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ) { return _sqlite3_set_auxdata( arg0, @@ -5211,7 +5211,7 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ) { return _sqlite3_result_blob( arg0, @@ -5231,7 +5231,7 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ) { return _sqlite3_result_blob64( arg0, @@ -5395,7 +5395,7 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ) { return _sqlite3_result_text( arg0, @@ -5415,7 +5415,7 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, int encoding, ) { return _sqlite3_result_text64( @@ -5437,7 +5437,7 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ) { return _sqlite3_result_text16( arg0, @@ -5457,7 +5457,7 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ) { return _sqlite3_result_text16le( arg0, @@ -5477,7 +5477,7 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ) { return _sqlite3_result_text16be( arg0, @@ -5513,7 +5513,7 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ) { return _sqlite3_result_pointer( arg0, @@ -5672,7 +5672,7 @@ class SQLite { ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, + ffi.Pointer> xCompare, ) { return _sqlite3_create_collation( arg0, @@ -5695,8 +5695,8 @@ class SQLite { ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, - ffi.Pointer> xDestroy, + ffi.Pointer> xCompare, + ffi.Pointer> xDestroy, ) { return _sqlite3_create_collation_v2( arg0, @@ -5720,7 +5720,7 @@ class SQLite { ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, + ffi.Pointer> xCompare, ) { return _sqlite3_create_collation16( arg0, @@ -5766,7 +5766,7 @@ class SQLite { int sqlite3_collation_needed( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, ) { return _sqlite3_collation_needed( arg0, @@ -5785,7 +5785,7 @@ class SQLite { int sqlite3_collation_needed16( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, ) { return _sqlite3_collation_needed16( arg0, @@ -6198,7 +6198,7 @@ class SQLite { /// See also the [sqlite3_update_hook()] interface. ffi.Pointer sqlite3_commit_hook( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ) { return _sqlite3_commit_hook( @@ -6216,7 +6216,7 @@ class SQLite { ffi.Pointer sqlite3_rollback_hook( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ) { return _sqlite3_rollback_hook( @@ -6281,7 +6281,7 @@ class SQLite { /// and [sqlite3_preupdate_hook()] interfaces. ffi.Pointer sqlite3_update_hook( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ) { return _sqlite3_update_hook( @@ -6748,7 +6748,7 @@ class SQLite { /// See also: [sqlite3_reset_auto_extension()] /// and [sqlite3_cancel_auto_extension()] int sqlite3_auto_extension( - ffi.Pointer> xEntryPoint, + ffi.Pointer> xEntryPoint, ) { return _sqlite3_auto_extension( xEntryPoint, @@ -6770,7 +6770,7 @@ class SQLite { /// unregistered and it returns 0 if X was not on the list of initialization /// routines. int sqlite3_cancel_auto_extension( - ffi.Pointer> xEntryPoint, + ffi.Pointer> xEntryPoint, ) { return _sqlite3_cancel_auto_extension( xEntryPoint, @@ -6854,7 +6854,7 @@ class SQLite { ffi.Pointer zName, ffi.Pointer p, ffi.Pointer pClientData, - ffi.Pointer> xDestroy, + ffi.Pointer> xDestroy, ) { return _sqlite3_create_module_v2( db, @@ -8490,7 +8490,7 @@ class SQLite { /// SQLITE_LOCKED.)^ int sqlite3_unlock_notify( ffi.Pointer pBlocked, - ffi.Pointer> xNotify, + ffi.Pointer> xNotify, ffi.Pointer pNotifyArg, ) { return _sqlite3_unlock_notify( @@ -8676,7 +8676,7 @@ class SQLite { /// overwrite any prior [sqlite3_wal_hook()] settings. ffi.Pointer sqlite3_wal_hook( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ) { return _sqlite3_wal_hook( @@ -9457,7 +9457,7 @@ class SQLite { int sqlite3_rtree_geometry_callback( ffi.Pointer db, ffi.Pointer zGeom, - ffi.Pointer> xGeom, + ffi.Pointer> xGeom, ffi.Pointer pContext, ) { return _sqlite3_rtree_geometry_callback( @@ -9482,9 +9482,9 @@ class SQLite { int sqlite3_rtree_query_callback( ffi.Pointer db, ffi.Pointer zQueryFunc, - ffi.Pointer> xQueryFunc, + ffi.Pointer> xQueryFunc, ffi.Pointer pContext, - ffi.Pointer> xDestructor, + ffi.Pointer> xDestructor, ) { return _sqlite3_rtree_query_callback( db, @@ -9505,8 +9505,6 @@ class SQLite { class sqlite3 extends ffi.Opaque {} -class sqlite3_file extends ffi.Opaque {} - class sqlite3_io_methods extends ffi.Struct { @ffi.Int32() external int iVersion; @@ -9550,13 +9548,99 @@ class sqlite3_io_methods extends ffi.Struct { external ffi.Pointer> xUnfetch; } +class sqlite3_file extends ffi.Struct { + /// Methods for an open file + external ffi.Pointer pMethods; +} + class sqlite3_mutex extends ffi.Opaque {} class sqlite3_api_routines extends ffi.Opaque {} -class sqlite3_vfs extends ffi.Opaque {} +class sqlite3_vfs extends ffi.Struct { + /// Structure version number (currently 3) + @ffi.Int32() + external int iVersion; + + /// Size of subclassed sqlite3_file + @ffi.Int32() + external int szOsFile; + + /// Maximum file pathname length + @ffi.Int32() + external int mxPathname; + + /// Next registered VFS + external ffi.Pointer pNext; + + /// Name of this virtual file system + external ffi.Pointer zName; + + /// Pointer to application-specific data + external ffi.Pointer pAppData; + + external ffi.Pointer> xOpen; + + external ffi.Pointer> xDelete; + + external ffi.Pointer> xAccess; + + external ffi.Pointer> xFullPathname; + + external ffi.Pointer> xDlOpen; + + external ffi.Pointer> xDlError; + + external ffi.Pointer> xDlSym; + + external ffi.Pointer> xDlClose; + + external ffi.Pointer> xRandomness; + + external ffi.Pointer> xSleep; + + external ffi.Pointer> xCurrentTime; + + external ffi.Pointer> xGetLastError; + + /// The methods above are in version 1 of the sqlite_vfs object + /// definition. Those that follow are added in version 2 or later + external ffi.Pointer> xCurrentTimeInt64; + + /// The methods above are in versions 1 and 2 of the sqlite_vfs object. + /// Those below are for version 3 and greater. + external ffi.Pointer> xSetSystemCall; + + external ffi.Pointer> xGetSystemCall; + + external ffi.Pointer> xNextSystemCall; +} + +class sqlite3_mem_methods extends ffi.Struct { + /// Memory allocation function + external ffi.Pointer> xMalloc; + + /// Free a prior allocation + external ffi.Pointer> xFree; + + /// Resize an allocation + external ffi.Pointer> xRealloc; -class sqlite3_mem_methods extends ffi.Opaque {} + /// Return the size of an allocation + external ffi.Pointer> xSize; + + /// Round up request size to allocation size + external ffi.Pointer> xRoundup; + + /// Initialize the memory allocator + external ffi.Pointer> xInit; + + /// Deinitialize the memory allocator + external ffi.Pointer> xShutdown; + + /// Argument to xInit() and xShutdown() + external ffi.Pointer pAppData; +} class sqlite3_stmt extends ffi.Opaque {} @@ -9564,23 +9648,44 @@ class sqlite3_value extends ffi.Opaque {} class sqlite3_context extends ffi.Opaque {} -/// CAPI3REF: Virtual Table Instance Object -/// KEYWORDS: sqlite3_vtab -/// -/// Every [virtual table module] implementation uses a subclass -/// of this object to describe a particular instance -/// of the [virtual table]. Each subclass will -/// be tailored to the specific needs of the module implementation. -/// The purpose of this superclass is to define certain fields that are -/// common to all module implementations. -/// -/// ^Virtual tables methods can set an error message by assigning a -/// string obtained from [sqlite3_mprintf()] to zErrMsg. The method should -/// take care that any prior string is freed by a call to [sqlite3_free()] -/// prior to assigning a new string to zErrMsg. ^After the error message -/// is delivered up to the client application, the string will be automatically -/// freed by sqlite3_free() and the zErrMsg field will be zeroed. -class sqlite3_vtab extends ffi.Opaque {} +class sqlite3_index_constraint extends ffi.Struct { + /// Column constrained. -1 for ROWID + @ffi.Int32() + external int iColumn; + + /// Constraint operator + @ffi.Uint8() + external int op; + + /// True if this constraint is usable + @ffi.Uint8() + external int usable; + + /// Used internally - xBestIndex should ignore + @ffi.Int32() + external int iTermOffset; +} + +class sqlite3_index_orderby extends ffi.Struct { + /// Column number + @ffi.Int32() + external int iColumn; + + /// True for DESC. False for ASC. + @ffi.Uint8() + external int desc; +} + +/// Outputs +class sqlite3_index_constraint_usage extends ffi.Struct { + /// if >0, constraint is part of argv to xFilter + @ffi.Int32() + external int argvIndex; + + /// Do not code a test for this constraint + @ffi.Uint8() + external int omit; +} /// CAPI3REF: Virtual Table Indexing Information /// KEYWORDS: sqlite3_index_info @@ -9682,7 +9787,54 @@ class sqlite3_vtab extends ffi.Opaque {} /// It may therefore only be used if /// sqlite3_libversion_number() returns a value greater than or equal to /// 3009000. -class sqlite3_index_info extends ffi.Opaque {} +class sqlite3_index_info extends ffi.Struct { + /// Number of entries in aConstraint + @ffi.Int32() + external int nConstraint; + + /// Table of WHERE clause constraints + external ffi.Pointer aConstraint; + + /// Number of terms in the ORDER BY clause + @ffi.Int32() + external int nOrderBy; + + /// The ORDER BY clause + external ffi.Pointer aOrderBy; + + external ffi.Pointer aConstraintUsage; + + /// Number used to identify the index + @ffi.Int32() + external int idxNum; + + /// String, possibly obtained from sqlite3_malloc + external ffi.Pointer idxStr; + + /// Free idxStr using sqlite3_free() if true + @ffi.Int32() + external int needToFreeIdxStr; + + /// True if output is already ordered + @ffi.Int32() + external int orderByConsumed; + + /// Estimated cost of using this index + @ffi.Double() + external double estimatedCost; + + /// Estimated number of rows returned + @ffi.Int64() + external int estimatedRows; + + /// Mask of SQLITE_INDEX_SCAN_* flags + @ffi.Int32() + external int idxFlags; + + /// Input: Mask of columns used by statement + @ffi.Uint64() + external int colUsed; +} /// CAPI3REF: Virtual Table Cursor Object /// KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} @@ -9699,7 +9851,10 @@ class sqlite3_index_info extends ffi.Opaque {} /// /// This superclass exists in order to define fields of the cursor that /// are common to all implementations. -class sqlite3_vtab_cursor extends ffi.Opaque {} +class sqlite3_vtab_cursor extends ffi.Struct { + /// Virtual table of this cursor + external ffi.Pointer pVtab; +} /// CAPI3REF: Virtual Table Object /// KEYWORDS: sqlite3_module {virtual table module} @@ -9715,21 +9870,175 @@ class sqlite3_vtab_cursor extends ffi.Opaque {} /// module or until the [database connection] closes. The content /// of this structure must not change while it is registered with /// any database connection. -class sqlite3_module extends ffi.Opaque {} +class sqlite3_module extends ffi.Struct { + @ffi.Int32() + external int iVersion; + + external ffi.Pointer> xCreate; + + external ffi.Pointer> xConnect; + + external ffi.Pointer> xBestIndex; + + external ffi.Pointer> xDisconnect; + + external ffi.Pointer> xDestroy; + + external ffi.Pointer> xOpen; + + external ffi.Pointer> xClose; + + external ffi.Pointer> xFilter; + + external ffi.Pointer> xNext; + + external ffi.Pointer> xEof; + + external ffi.Pointer> xColumn; + + external ffi.Pointer> xRowid; + + external ffi.Pointer> xUpdate; + + external ffi.Pointer> xBegin; + + external ffi.Pointer> xSync; + + external ffi.Pointer> xCommit; + + external ffi.Pointer> xRollback; + + external ffi.Pointer> xFindFunction; + + external ffi.Pointer> xRename; + + /// The methods above are in version 1 of the sqlite_module object. Those + /// below are for version 2 and greater. + external ffi.Pointer> xSavepoint; + + external ffi.Pointer> xRelease; + + external ffi.Pointer> xRollbackTo; + + /// The methods above are in versions 1 and 2 of the sqlite_module object. + /// Those below are for version 3 and greater. + external ffi.Pointer> xShadowName; +} + +/// CAPI3REF: Virtual Table Instance Object +/// KEYWORDS: sqlite3_vtab +/// +/// Every [virtual table module] implementation uses a subclass +/// of this object to describe a particular instance +/// of the [virtual table]. Each subclass will +/// be tailored to the specific needs of the module implementation. +/// The purpose of this superclass is to define certain fields that are +/// common to all module implementations. +/// +/// ^Virtual tables methods can set an error message by assigning a +/// string obtained from [sqlite3_mprintf()] to zErrMsg. The method should +/// take care that any prior string is freed by a call to [sqlite3_free()] +/// prior to assigning a new string to zErrMsg. ^After the error message +/// is delivered up to the client application, the string will be automatically +/// freed by sqlite3_free() and the zErrMsg field will be zeroed. +class sqlite3_vtab extends ffi.Struct { + /// The module for this virtual table + external ffi.Pointer pModule; + + /// Number of open cursors + @ffi.Int32() + external int nRef; + + /// Error message from sqlite3_mprintf() + external ffi.Pointer zErrMsg; +} class sqlite3_blob extends ffi.Opaque {} -class sqlite3_mutex_methods extends ffi.Opaque {} +class sqlite3_mutex_methods extends ffi.Struct { + external ffi.Pointer> xMutexInit; + + external ffi.Pointer> xMutexEnd; + + external ffi.Pointer> xMutexAlloc; + + external ffi.Pointer> xMutexFree; + + external ffi.Pointer> xMutexEnter; + + external ffi.Pointer> xMutexTry; + + external ffi.Pointer> xMutexLeave; + + external ffi.Pointer> xMutexHeld; + + external ffi.Pointer> xMutexNotheld; +} class sqlite3_str extends ffi.Opaque {} class sqlite3_pcache extends ffi.Opaque {} -class sqlite3_pcache_page extends ffi.Opaque {} +class sqlite3_pcache_page extends ffi.Struct { + /// The content of the page + external ffi.Pointer pBuf; + + /// Extra information associated with the page + external ffi.Pointer pExtra; +} + +class sqlite3_pcache_methods2 extends ffi.Struct { + @ffi.Int32() + external int iVersion; + + external ffi.Pointer pArg; + + external ffi.Pointer> xInit; + + external ffi.Pointer> xShutdown; + + external ffi.Pointer> xCreate; + + external ffi.Pointer> xCachesize; + + external ffi.Pointer> xPagecount; + + external ffi.Pointer> xFetch; + + external ffi.Pointer> xUnpin; -class sqlite3_pcache_methods2 extends ffi.Opaque {} + external ffi.Pointer> xRekey; -class sqlite3_pcache_methods extends ffi.Opaque {} + external ffi.Pointer> xTruncate; + + external ffi.Pointer> xDestroy; + + external ffi.Pointer> xShrink; +} + +class sqlite3_pcache_methods extends ffi.Struct { + external ffi.Pointer pArg; + + external ffi.Pointer> xInit; + + external ffi.Pointer> xShutdown; + + external ffi.Pointer> xCreate; + + external ffi.Pointer> xCachesize; + + external ffi.Pointer> xPagecount; + + external ffi.Pointer> xFetch; + + external ffi.Pointer> xUnpin; + + external ffi.Pointer> xRekey; + + external ffi.Pointer> xTruncate; + + external ffi.Pointer> xDestroy; +} class sqlite3_backup extends ffi.Opaque {} @@ -10129,7 +10438,23 @@ class ArrayHelper_sqlite3_snapshot_hidden_level0 { /// A pointer to a structure of the following type is passed as the first /// argument to callbacks registered using rtree_geometry_callback(). -class sqlite3_rtree_geometry extends ffi.Opaque {} +class sqlite3_rtree_geometry extends ffi.Struct { + /// Copy of pContext passed to s_r_g_c() + external ffi.Pointer pContext; + + /// Size of array aParam[] + @ffi.Int32() + external int nParam; + + /// Parameters passed to SQL geom function + external ffi.Pointer aParam; + + /// Callback implementation user data + external ffi.Pointer pUser; + + /// Called by SQLite to clean up pUser + external ffi.Pointer> xDelUser; +} /// A pointer to a structure of the following type is passed as the /// argument to scored geometry callback registered using @@ -10138,7 +10463,72 @@ class sqlite3_rtree_geometry extends ffi.Opaque {} /// Note that the first 5 fields of this structure are identical to /// sqlite3_rtree_geometry. This structure is a subclass of /// sqlite3_rtree_geometry. -class sqlite3_rtree_query_info extends ffi.Opaque {} +class sqlite3_rtree_query_info extends ffi.Struct { + /// pContext from when function registered + external ffi.Pointer pContext; + + /// Number of function parameters + @ffi.Int32() + external int nParam; + + /// value of function parameters + external ffi.Pointer aParam; + + /// callback can use this, if desired + external ffi.Pointer pUser; + + /// function to free pUser + external ffi.Pointer> xDelUser; + + /// Coordinates of node or entry to check + external ffi.Pointer aCoord; + + /// Number of pending entries in the queue + external ffi.Pointer anQueue; + + /// Number of coordinates + @ffi.Int32() + external int nCoord; + + /// Level of current node or entry + @ffi.Int32() + external int iLevel; + + /// The largest iLevel value in the tree + @ffi.Int32() + external int mxLevel; + + /// Rowid for current entry + @ffi.Int64() + external int iRowid; + + /// Score of parent node + @ffi.Double() + external double rParentScore; + + /// Visibility of parent node + @ffi.Int32() + external int eParentWithin; + + /// OUT: Visibility + @ffi.Int32() + external int eWithin; + + /// OUT: Write the score here + @ffi.Double() + external double rScore; + + /// Original SQL values of parameters + external ffi.Pointer> apSqlParam; +} + +class Fts5Context extends ffi.Opaque {} + +class Fts5PhraseIter extends ffi.Struct { + external ffi.Pointer a; + + external ffi.Pointer b; +} /// EXTENSION API FUNCTIONS /// @@ -10349,17 +10739,74 @@ class sqlite3_rtree_query_info extends ffi.Opaque {} /// /// xPhraseNextColumn() /// See xPhraseFirstColumn above. -class Fts5ExtensionApi extends ffi.Opaque {} +class Fts5ExtensionApi extends ffi.Struct { + /// Currently always set to 3 + @ffi.Int32() + external int iVersion; -class Fts5Context extends ffi.Opaque {} + external ffi.Pointer> xUserData; + + external ffi.Pointer> xColumnCount; + + external ffi.Pointer> xRowCount; + + external ffi.Pointer> xColumnTotalSize; + + external ffi.Pointer> xTokenize; + + external ffi.Pointer> xPhraseCount; + + external ffi.Pointer> xPhraseSize; + + external ffi.Pointer> xInstCount; + + external ffi.Pointer> xInst; + + external ffi.Pointer> xRowid; + + external ffi.Pointer> xColumnText; + + external ffi.Pointer> xColumnSize; + + external ffi.Pointer> xQueryPhrase; + + external ffi.Pointer> xSetAuxdata; -class Fts5PhraseIter extends ffi.Opaque {} + external ffi.Pointer> xGetAuxdata; + + external ffi.Pointer> xPhraseFirst; + + external ffi.Pointer> xPhraseNext; + + external ffi.Pointer> xPhraseFirstColumn; + + external ffi.Pointer> xPhraseNextColumn; +} class Fts5Tokenizer extends ffi.Opaque {} -class fts5_tokenizer extends ffi.Opaque {} +class fts5_tokenizer extends ffi.Struct { + external ffi.Pointer> xCreate; + + external ffi.Pointer> xDelete; + + external ffi.Pointer> xTokenize; +} + +class fts5_api extends ffi.Struct { + /// Currently always set to 2 + @ffi.Int32() + external int iVersion; + + /// Create a new tokenizer + external ffi.Pointer> xCreateTokenizer; -class fts5_api extends ffi.Opaque {} + /// Find an existing tokenizer + external ffi.Pointer> xFindTokenizer; + + /// Create a new auxiliary function + external ffi.Pointer> xCreateFunction; +} const String SQLITE_VERSION = '3.32.3'; @@ -11415,20 +11862,20 @@ typedef _dart_sqlite3_complete16 = int Function( ffi.Pointer sql, ); -typedef _typedefC_20 = ffi.Int32 Function( +typedef _typedefC_44 = ffi.Int32 Function( ffi.Pointer, ffi.Int32, ); typedef _c_sqlite3_busy_handler = ffi.Int32 Function( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ); typedef _dart_sqlite3_busy_handler = int Function( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ); @@ -11562,7 +12009,7 @@ typedef _dart_sqlite3_randomness = void Function( ffi.Pointer P, ); -typedef _typedefC_21 = ffi.Int32 Function( +typedef _typedefC_45 = ffi.Int32 Function( ffi.Pointer, ffi.Int32, ffi.Pointer, @@ -11573,34 +12020,34 @@ typedef _typedefC_21 = ffi.Int32 Function( typedef _c_sqlite3_set_authorizer = ffi.Int32 Function( ffi.Pointer arg0, - ffi.Pointer> xAuth, + ffi.Pointer> xAuth, ffi.Pointer pUserData, ); typedef _dart_sqlite3_set_authorizer = int Function( ffi.Pointer arg0, - ffi.Pointer> xAuth, + ffi.Pointer> xAuth, ffi.Pointer pUserData, ); -typedef _typedefC_22 = ffi.Void Function( +typedef _typedefC_46 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ); typedef _c_sqlite3_trace = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> xTrace, + ffi.Pointer> xTrace, ffi.Pointer arg2, ); typedef _dart_sqlite3_trace = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> xTrace, + ffi.Pointer> xTrace, ffi.Pointer arg2, ); -typedef _typedefC_23 = ffi.Void Function( +typedef _typedefC_47 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Uint64, @@ -11608,17 +12055,17 @@ typedef _typedefC_23 = ffi.Void Function( typedef _c_sqlite3_profile = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> xProfile, + ffi.Pointer> xProfile, ffi.Pointer arg2, ); typedef _dart_sqlite3_profile = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> xProfile, + ffi.Pointer> xProfile, ffi.Pointer arg2, ); -typedef _typedefC_24 = ffi.Int32 Function( +typedef _typedefC_48 = ffi.Int32 Function( ffi.Uint32, ffi.Pointer, ffi.Pointer, @@ -11628,32 +12075,32 @@ typedef _typedefC_24 = ffi.Int32 Function( typedef _c_sqlite3_trace_v2 = ffi.Int32 Function( ffi.Pointer arg0, ffi.Uint32 uMask, - ffi.Pointer> xCallback, + ffi.Pointer> xCallback, ffi.Pointer pCtx, ); typedef _dart_sqlite3_trace_v2 = int Function( ffi.Pointer arg0, int uMask, - ffi.Pointer> xCallback, + ffi.Pointer> xCallback, ffi.Pointer pCtx, ); -typedef _typedefC_25 = ffi.Int32 Function( +typedef _typedefC_49 = ffi.Int32 Function( ffi.Pointer, ); typedef _c_sqlite3_progress_handler = ffi.Void Function( ffi.Pointer arg0, ffi.Int32 arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, ffi.Pointer arg3, ); typedef _dart_sqlite3_progress_handler = void Function( ffi.Pointer arg0, int arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, ffi.Pointer arg3, ); @@ -11991,7 +12438,7 @@ typedef _dart_sqlite3_stmt_busy = int Function( ffi.Pointer arg0, ); -typedef _typedefC_26 = ffi.Void Function( +typedef _typedefC_50 = ffi.Void Function( ffi.Pointer, ); @@ -12000,7 +12447,7 @@ typedef _c_sqlite3_bind_blob = ffi.Int32 Function( ffi.Int32 arg1, ffi.Pointer arg2, ffi.Int32 n, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ); typedef _dart_sqlite3_bind_blob = int Function( @@ -12008,10 +12455,10 @@ typedef _dart_sqlite3_bind_blob = int Function( int arg1, ffi.Pointer arg2, int n, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ); -typedef _typedefC_27 = ffi.Void Function( +typedef _typedefC_51 = ffi.Void Function( ffi.Pointer, ); @@ -12020,7 +12467,7 @@ typedef _c_sqlite3_bind_blob64 = ffi.Int32 Function( ffi.Int32 arg1, ffi.Pointer arg2, ffi.Uint64 arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ); typedef _dart_sqlite3_bind_blob64 = int Function( @@ -12028,7 +12475,7 @@ typedef _dart_sqlite3_bind_blob64 = int Function( int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ); typedef _c_sqlite3_bind_double = ffi.Int32 Function( @@ -12077,7 +12524,7 @@ typedef _dart_sqlite3_bind_null = int Function( int arg1, ); -typedef _typedefC_28 = ffi.Void Function( +typedef _typedefC_52 = ffi.Void Function( ffi.Pointer, ); @@ -12086,7 +12533,7 @@ typedef _c_sqlite3_bind_text = ffi.Int32 Function( ffi.Int32 arg1, ffi.Pointer arg2, ffi.Int32 arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ); typedef _dart_sqlite3_bind_text = int Function( @@ -12094,10 +12541,10 @@ typedef _dart_sqlite3_bind_text = int Function( int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ); -typedef _typedefC_29 = ffi.Void Function( +typedef _typedefC_53 = ffi.Void Function( ffi.Pointer, ); @@ -12106,7 +12553,7 @@ typedef _c_sqlite3_bind_text16 = ffi.Int32 Function( ffi.Int32 arg1, ffi.Pointer arg2, ffi.Int32 arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ); typedef _dart_sqlite3_bind_text16 = int Function( @@ -12114,10 +12561,10 @@ typedef _dart_sqlite3_bind_text16 = int Function( int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ); -typedef _typedefC_30 = ffi.Void Function( +typedef _typedefC_54 = ffi.Void Function( ffi.Pointer, ); @@ -12126,7 +12573,7 @@ typedef _c_sqlite3_bind_text64 = ffi.Int32 Function( ffi.Int32 arg1, ffi.Pointer arg2, ffi.Uint64 arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ffi.Uint8 encoding, ); @@ -12135,7 +12582,7 @@ typedef _dart_sqlite3_bind_text64 = int Function( int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, int encoding, ); @@ -12151,7 +12598,7 @@ typedef _dart_sqlite3_bind_value = int Function( ffi.Pointer arg2, ); -typedef _typedefC_31 = ffi.Void Function( +typedef _typedefC_55 = ffi.Void Function( ffi.Pointer, ); @@ -12160,7 +12607,7 @@ typedef _c_sqlite3_bind_pointer = ffi.Int32 Function( ffi.Int32 arg1, ffi.Pointer arg2, ffi.Pointer arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ); typedef _dart_sqlite3_bind_pointer = int Function( @@ -12168,7 +12615,7 @@ typedef _dart_sqlite3_bind_pointer = int Function( int arg1, ffi.Pointer arg2, ffi.Pointer arg3, - ffi.Pointer> arg4, + ffi.Pointer> arg4, ); typedef _c_sqlite3_bind_zeroblob = ffi.Int32 Function( @@ -12471,19 +12918,19 @@ typedef _dart_sqlite3_reset = int Function( ffi.Pointer pStmt, ); -typedef _typedefC_32 = ffi.Void Function( +typedef _typedefC_56 = ffi.Void Function( ffi.Pointer, ffi.Int32, ffi.Pointer>, ); -typedef _typedefC_33 = ffi.Void Function( +typedef _typedefC_57 = ffi.Void Function( ffi.Pointer, ffi.Int32, ffi.Pointer>, ); -typedef _typedefC_34 = ffi.Void Function( +typedef _typedefC_58 = ffi.Void Function( ffi.Pointer, ); @@ -12493,9 +12940,9 @@ typedef _c_sqlite3_create_function = ffi.Int32 Function( ffi.Int32 nArg, ffi.Int32 eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, ); typedef _dart_sqlite3_create_function = int Function( @@ -12504,24 +12951,24 @@ typedef _dart_sqlite3_create_function = int Function( int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, ); -typedef _typedefC_35 = ffi.Void Function( +typedef _typedefC_59 = ffi.Void Function( ffi.Pointer, ffi.Int32, ffi.Pointer>, ); -typedef _typedefC_36 = ffi.Void Function( +typedef _typedefC_60 = ffi.Void Function( ffi.Pointer, ffi.Int32, ffi.Pointer>, ); -typedef _typedefC_37 = ffi.Void Function( +typedef _typedefC_61 = ffi.Void Function( ffi.Pointer, ); @@ -12531,9 +12978,9 @@ typedef _c_sqlite3_create_function16 = ffi.Int32 Function( ffi.Int32 nArg, ffi.Int32 eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, ); typedef _dart_sqlite3_create_function16 = int Function( @@ -12542,28 +12989,28 @@ typedef _dart_sqlite3_create_function16 = int Function( int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, ); -typedef _typedefC_38 = ffi.Void Function( +typedef _typedefC_62 = ffi.Void Function( ffi.Pointer, ffi.Int32, ffi.Pointer>, ); -typedef _typedefC_39 = ffi.Void Function( +typedef _typedefC_63 = ffi.Void Function( ffi.Pointer, ffi.Int32, ffi.Pointer>, ); -typedef _typedefC_40 = ffi.Void Function( +typedef _typedefC_64 = ffi.Void Function( ffi.Pointer, ); -typedef _typedefC_41 = ffi.Void Function( +typedef _typedefC_65 = ffi.Void Function( ffi.Pointer, ); @@ -12573,10 +13020,10 @@ typedef _c_sqlite3_create_function_v2 = ffi.Int32 Function( ffi.Int32 nArg, ffi.Int32 eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xDestroy, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, + ffi.Pointer> xDestroy, ); typedef _dart_sqlite3_create_function_v2 = int Function( @@ -12585,33 +13032,33 @@ typedef _dart_sqlite3_create_function_v2 = int Function( int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xDestroy, + ffi.Pointer> xFunc, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, + ffi.Pointer> xDestroy, ); -typedef _typedefC_42 = ffi.Void Function( +typedef _typedefC_66 = ffi.Void Function( ffi.Pointer, ffi.Int32, ffi.Pointer>, ); -typedef _typedefC_43 = ffi.Void Function( +typedef _typedefC_67 = ffi.Void Function( ffi.Pointer, ); -typedef _typedefC_44 = ffi.Void Function( +typedef _typedefC_68 = ffi.Void Function( ffi.Pointer, ); -typedef _typedefC_45 = ffi.Void Function( +typedef _typedefC_69 = ffi.Void Function( ffi.Pointer, ffi.Int32, ffi.Pointer>, ); -typedef _typedefC_46 = ffi.Void Function( +typedef _typedefC_70 = ffi.Void Function( ffi.Pointer, ); @@ -12621,11 +13068,11 @@ typedef _c_sqlite3_create_window_function = ffi.Int32 Function( ffi.Int32 nArg, ffi.Int32 eTextRep, ffi.Pointer pApp, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xValue, - ffi.Pointer> xInverse, - ffi.Pointer> xDestroy, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, + ffi.Pointer> xValue, + ffi.Pointer> xInverse, + ffi.Pointer> xDestroy, ); typedef _dart_sqlite3_create_window_function = int Function( @@ -12634,11 +13081,11 @@ typedef _dart_sqlite3_create_window_function = int Function( int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xValue, - ffi.Pointer> xInverse, - ffi.Pointer> xDestroy, + ffi.Pointer> xStep, + ffi.Pointer> xFinal, + ffi.Pointer> xValue, + ffi.Pointer> xInverse, + ffi.Pointer> xDestroy, ); typedef _c_sqlite3_aggregate_count = ffi.Int32 Function( @@ -12675,20 +13122,20 @@ typedef _c_sqlite3_thread_cleanup = ffi.Void Function(); typedef _dart_sqlite3_thread_cleanup = void Function(); -typedef _typedefC_47 = ffi.Void Function( +typedef _typedefC_71 = ffi.Void Function( ffi.Pointer, ffi.Int64, ffi.Int32, ); typedef _c_sqlite3_memory_alarm = ffi.Int32 Function( - ffi.Pointer> arg0, + ffi.Pointer> arg0, ffi.Pointer arg1, ffi.Int64 arg2, ); typedef _dart_sqlite3_memory_alarm = int Function( - ffi.Pointer> arg0, + ffi.Pointer> arg0, ffi.Pointer arg1, int arg2, ); @@ -12875,7 +13322,7 @@ typedef _dart_sqlite3_get_auxdata = ffi.Pointer Function( int N, ); -typedef _typedefC_48 = ffi.Void Function( +typedef _typedefC_72 = ffi.Void Function( ffi.Pointer, ); @@ -12883,17 +13330,17 @@ typedef _c_sqlite3_set_auxdata = ffi.Void Function( ffi.Pointer arg0, ffi.Int32 N, ffi.Pointer arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _dart_sqlite3_set_auxdata = void Function( ffi.Pointer arg0, int N, ffi.Pointer arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); -typedef _typedefC_49 = ffi.Void Function( +typedef _typedefC_73 = ffi.Void Function( ffi.Pointer, ); @@ -12901,17 +13348,17 @@ typedef _c_sqlite3_result_blob = ffi.Void Function( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Int32 arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _dart_sqlite3_result_blob = void Function( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); -typedef _typedefC_50 = ffi.Void Function( +typedef _typedefC_74 = ffi.Void Function( ffi.Pointer, ); @@ -12919,14 +13366,14 @@ typedef _c_sqlite3_result_blob64 = ffi.Void Function( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Uint64 arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _dart_sqlite3_result_blob64 = void Function( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _c_sqlite3_result_double = ffi.Void Function( @@ -13017,7 +13464,7 @@ typedef _dart_sqlite3_result_null = void Function( ffi.Pointer arg0, ); -typedef _typedefC_51 = ffi.Void Function( +typedef _typedefC_75 = ffi.Void Function( ffi.Pointer, ); @@ -13025,17 +13472,17 @@ typedef _c_sqlite3_result_text = ffi.Void Function( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Int32 arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _dart_sqlite3_result_text = void Function( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); -typedef _typedefC_52 = ffi.Void Function( +typedef _typedefC_76 = ffi.Void Function( ffi.Pointer, ); @@ -13043,7 +13490,7 @@ typedef _c_sqlite3_result_text64 = ffi.Void Function( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Uint64 arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ffi.Uint8 encoding, ); @@ -13051,11 +13498,11 @@ typedef _dart_sqlite3_result_text64 = void Function( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, int encoding, ); -typedef _typedefC_53 = ffi.Void Function( +typedef _typedefC_77 = ffi.Void Function( ffi.Pointer, ); @@ -13063,17 +13510,17 @@ typedef _c_sqlite3_result_text16 = ffi.Void Function( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Int32 arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _dart_sqlite3_result_text16 = void Function( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); -typedef _typedefC_54 = ffi.Void Function( +typedef _typedefC_78 = ffi.Void Function( ffi.Pointer, ); @@ -13081,17 +13528,17 @@ typedef _c_sqlite3_result_text16le = ffi.Void Function( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Int32 arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _dart_sqlite3_result_text16le = void Function( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); -typedef _typedefC_55 = ffi.Void Function( +typedef _typedefC_79 = ffi.Void Function( ffi.Pointer, ); @@ -13099,14 +13546,14 @@ typedef _c_sqlite3_result_text16be = ffi.Void Function( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Int32 arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _dart_sqlite3_result_text16be = void Function( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _c_sqlite3_result_value = ffi.Void Function( @@ -13119,7 +13566,7 @@ typedef _dart_sqlite3_result_value = void Function( ffi.Pointer arg1, ); -typedef _typedefC_56 = ffi.Void Function( +typedef _typedefC_80 = ffi.Void Function( ffi.Pointer, ); @@ -13127,14 +13574,14 @@ typedef _c_sqlite3_result_pointer = ffi.Void Function( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _dart_sqlite3_result_pointer = void Function( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ); typedef _c_sqlite3_result_zeroblob = ffi.Void Function( @@ -13167,7 +13614,7 @@ typedef _dart_sqlite3_result_subtype = void Function( int arg1, ); -typedef _typedefC_57 = ffi.Int32 Function( +typedef _typedefC_81 = ffi.Int32 Function( ffi.Pointer, ffi.Int32, ffi.Pointer, @@ -13180,7 +13627,7 @@ typedef _c_sqlite3_create_collation = ffi.Int32 Function( ffi.Pointer zName, ffi.Int32 eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, + ffi.Pointer> xCompare, ); typedef _dart_sqlite3_create_collation = int Function( @@ -13188,10 +13635,10 @@ typedef _dart_sqlite3_create_collation = int Function( ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, + ffi.Pointer> xCompare, ); -typedef _typedefC_58 = ffi.Int32 Function( +typedef _typedefC_82 = ffi.Int32 Function( ffi.Pointer, ffi.Int32, ffi.Pointer, @@ -13199,7 +13646,7 @@ typedef _typedefC_58 = ffi.Int32 Function( ffi.Pointer, ); -typedef _typedefC_59 = ffi.Void Function( +typedef _typedefC_83 = ffi.Void Function( ffi.Pointer, ); @@ -13208,8 +13655,8 @@ typedef _c_sqlite3_create_collation_v2 = ffi.Int32 Function( ffi.Pointer zName, ffi.Int32 eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, - ffi.Pointer> xDestroy, + ffi.Pointer> xCompare, + ffi.Pointer> xDestroy, ); typedef _dart_sqlite3_create_collation_v2 = int Function( @@ -13217,11 +13664,11 @@ typedef _dart_sqlite3_create_collation_v2 = int Function( ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, - ffi.Pointer> xDestroy, + ffi.Pointer> xCompare, + ffi.Pointer> xDestroy, ); -typedef _typedefC_60 = ffi.Int32 Function( +typedef _typedefC_84 = ffi.Int32 Function( ffi.Pointer, ffi.Int32, ffi.Pointer, @@ -13234,7 +13681,7 @@ typedef _c_sqlite3_create_collation16 = ffi.Int32 Function( ffi.Pointer zName, ffi.Int32 eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, + ffi.Pointer> xCompare, ); typedef _dart_sqlite3_create_collation16 = int Function( @@ -13242,10 +13689,10 @@ typedef _dart_sqlite3_create_collation16 = int Function( ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, + ffi.Pointer> xCompare, ); -typedef _typedefC_61 = ffi.Void Function( +typedef _typedefC_85 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Int32, @@ -13255,16 +13702,16 @@ typedef _typedefC_61 = ffi.Void Function( typedef _c_sqlite3_collation_needed = ffi.Int32 Function( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, ); typedef _dart_sqlite3_collation_needed = int Function( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, ); -typedef _typedefC_62 = ffi.Void Function( +typedef _typedefC_86 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Int32, @@ -13274,13 +13721,13 @@ typedef _typedefC_62 = ffi.Void Function( typedef _c_sqlite3_collation_needed16 = ffi.Int32 Function( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, ); typedef _dart_sqlite3_collation_needed16 = int Function( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, ); typedef _c_sqlite3_sleep = ffi.Int32 Function( @@ -13367,39 +13814,39 @@ typedef _dart_sqlite3_next_stmt = ffi.Pointer Function( ffi.Pointer pStmt, ); -typedef _typedefC_63 = ffi.Int32 Function( +typedef _typedefC_87 = ffi.Int32 Function( ffi.Pointer, ); typedef _c_sqlite3_commit_hook = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ); typedef _dart_sqlite3_commit_hook = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ); -typedef _typedefC_64 = ffi.Void Function( +typedef _typedefC_88 = ffi.Void Function( ffi.Pointer, ); typedef _c_sqlite3_rollback_hook = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ); typedef _dart_sqlite3_rollback_hook = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ); -typedef _typedefC_65 = ffi.Void Function( +typedef _typedefC_89 = ffi.Void Function( ffi.Pointer, ffi.Int32, ffi.Pointer, @@ -13409,13 +13856,13 @@ typedef _typedefC_65 = ffi.Void Function( typedef _c_sqlite3_update_hook = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ); typedef _dart_sqlite3_update_hook = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ); @@ -13515,24 +13962,24 @@ typedef _dart_sqlite3_enable_load_extension = int Function( int onoff, ); -typedef _typedefC_66 = ffi.Void Function(); +typedef _typedefC_90 = ffi.Void Function(); typedef _c_sqlite3_auto_extension = ffi.Int32 Function( - ffi.Pointer> xEntryPoint, + ffi.Pointer> xEntryPoint, ); typedef _dart_sqlite3_auto_extension = int Function( - ffi.Pointer> xEntryPoint, + ffi.Pointer> xEntryPoint, ); -typedef _typedefC_67 = ffi.Void Function(); +typedef _typedefC_91 = ffi.Void Function(); typedef _c_sqlite3_cancel_auto_extension = ffi.Int32 Function( - ffi.Pointer> xEntryPoint, + ffi.Pointer> xEntryPoint, ); typedef _dart_sqlite3_cancel_auto_extension = int Function( - ffi.Pointer> xEntryPoint, + ffi.Pointer> xEntryPoint, ); typedef _c_sqlite3_reset_auto_extension = ffi.Void Function(); @@ -13553,7 +14000,7 @@ typedef _dart_sqlite3_create_module = int Function( ffi.Pointer pClientData, ); -typedef _typedefC_68 = ffi.Void Function( +typedef _typedefC_116 = ffi.Void Function( ffi.Pointer, ); @@ -13562,7 +14009,7 @@ typedef _c_sqlite3_create_module_v2 = ffi.Int32 Function( ffi.Pointer zName, ffi.Pointer p, ffi.Pointer pClientData, - ffi.Pointer> xDestroy, + ffi.Pointer> xDestroy, ); typedef _dart_sqlite3_create_module_v2 = int Function( @@ -13570,7 +14017,7 @@ typedef _dart_sqlite3_create_module_v2 = int Function( ffi.Pointer zName, ffi.Pointer p, ffi.Pointer pClientData, - ffi.Pointer> xDestroy, + ffi.Pointer> xDestroy, ); typedef _c_sqlite3_drop_modules = ffi.Int32 Function( @@ -14013,20 +14460,20 @@ typedef _dart_sqlite3_backup_pagecount = int Function( ffi.Pointer p, ); -typedef _typedefC_69 = ffi.Void Function( +typedef _typedefC_147 = ffi.Void Function( ffi.Pointer>, ffi.Int32, ); typedef _c_sqlite3_unlock_notify = ffi.Int32 Function( ffi.Pointer pBlocked, - ffi.Pointer> xNotify, + ffi.Pointer> xNotify, ffi.Pointer pNotifyArg, ); typedef _dart_sqlite3_unlock_notify = int Function( ffi.Pointer pBlocked, - ffi.Pointer> xNotify, + ffi.Pointer> xNotify, ffi.Pointer pNotifyArg, ); @@ -14084,7 +14531,7 @@ typedef _dart_sqlite3_log = void Function( ffi.Pointer zFormat, ); -typedef _typedefC_70 = ffi.Int32 Function( +typedef _typedefC_148 = ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, @@ -14093,13 +14540,13 @@ typedef _typedefC_70 = ffi.Int32 Function( typedef _c_sqlite3_wal_hook = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ); typedef _dart_sqlite3_wal_hook = ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer> arg1, ffi.Pointer arg2, ); @@ -14297,7 +14744,7 @@ typedef _dart_sqlite3_deserialize = int Function( int mFlags, ); -typedef _typedefC_71 = ffi.Int32 Function( +typedef _typedefC_151 = ffi.Int32 Function( ffi.Pointer, ffi.Int32, ffi.Pointer, @@ -14307,39 +14754,39 @@ typedef _typedefC_71 = ffi.Int32 Function( typedef _c_sqlite3_rtree_geometry_callback = ffi.Int32 Function( ffi.Pointer db, ffi.Pointer zGeom, - ffi.Pointer> xGeom, + ffi.Pointer> xGeom, ffi.Pointer pContext, ); typedef _dart_sqlite3_rtree_geometry_callback = int Function( ffi.Pointer db, ffi.Pointer zGeom, - ffi.Pointer> xGeom, + ffi.Pointer> xGeom, ffi.Pointer pContext, ); -typedef _typedefC_72 = ffi.Int32 Function( +typedef _typedefC_152 = ffi.Int32 Function( ffi.Pointer, ); -typedef _typedefC_73 = ffi.Void Function( +typedef _typedefC_153 = ffi.Void Function( ffi.Pointer, ); typedef _c_sqlite3_rtree_query_callback = ffi.Int32 Function( ffi.Pointer db, ffi.Pointer zQueryFunc, - ffi.Pointer> xQueryFunc, + ffi.Pointer> xQueryFunc, ffi.Pointer pContext, - ffi.Pointer> xDestructor, + ffi.Pointer> xDestructor, ); typedef _dart_sqlite3_rtree_query_callback = int Function( ffi.Pointer db, ffi.Pointer zQueryFunc, - ffi.Pointer> xQueryFunc, + ffi.Pointer> xQueryFunc, ffi.Pointer pContext, - ffi.Pointer> xDestructor, + ffi.Pointer> xDestructor, ); typedef _typedefC_2 = ffi.Int32 Function( @@ -14440,3 +14887,602 @@ typedef _typedefC_19 = ffi.Int32 Function( ffi.Int64, ffi.Pointer, ); + +typedef _typedefC_20 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, +); + +typedef _typedefC_21 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, +); + +typedef _typedefC_22 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, +); + +typedef _typedefC_23 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, +); + +typedef _typedefC_24 = ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_25 = ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, +); + +typedef _typedefC_27 = ffi.Void Function(); + +typedef _typedefC_26 = ffi.Pointer> Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_28 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_29 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, +); + +typedef _typedefC_30 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, +); + +typedef _typedefC_31 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_32 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, +); + +typedef _typedefC_33 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef sqlite3_syscall_ptr = ffi.Void Function(); + +typedef _typedefC_34 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, +); + +typedef _typedefC_35 = ffi.Pointer> + Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_36 = ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_37 = ffi.Pointer Function( + ffi.Int32, +); + +typedef _typedefC_38 = ffi.Void Function( + ffi.Pointer, +); + +typedef _typedefC_39 = ffi.Pointer Function( + ffi.Pointer, + ffi.Int32, +); + +typedef _typedefC_40 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_41 = ffi.Int32 Function( + ffi.Int32, +); + +typedef _typedefC_42 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_43 = ffi.Void Function( + ffi.Pointer, +); + +typedef _typedefC_92 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer>, +); + +typedef _typedefC_93 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer>, +); + +typedef _typedefC_94 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_95 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_96 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_97 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer>, +); + +typedef _typedefC_98 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_99 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, +); + +typedef _typedefC_100 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_101 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_102 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, +); + +typedef _typedefC_103 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_104 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer, +); + +typedef _typedefC_105 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_106 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_107 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_108 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_109 = ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, +); + +typedef _typedefC_110 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer>>, + ffi.Pointer>, +); + +typedef _typedefC_111 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_112 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, +); + +typedef _typedefC_113 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, +); + +typedef _typedefC_114 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, +); + +typedef _typedefC_115 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_117 = ffi.Int32 Function(); + +typedef _typedefC_118 = ffi.Int32 Function(); + +typedef _typedefC_119 = ffi.Pointer Function( + ffi.Int32, +); + +typedef _typedefC_120 = ffi.Void Function( + ffi.Pointer, +); + +typedef _typedefC_121 = ffi.Void Function( + ffi.Pointer, +); + +typedef _typedefC_122 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_123 = ffi.Void Function( + ffi.Pointer, +); + +typedef _typedefC_124 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_125 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_126 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_127 = ffi.Void Function( + ffi.Pointer, +); + +typedef _typedefC_128 = ffi.Pointer Function( + ffi.Int32, + ffi.Int32, + ffi.Int32, +); + +typedef _typedefC_129 = ffi.Void Function( + ffi.Pointer, + ffi.Int32, +); + +typedef _typedefC_130 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_131 = ffi.Pointer Function( + ffi.Pointer, + ffi.Uint32, + ffi.Int32, +); + +typedef _typedefC_132 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, +); + +typedef _typedefC_133 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32, +); + +typedef _typedefC_134 = ffi.Void Function( + ffi.Pointer, + ffi.Uint32, +); + +typedef _typedefC_135 = ffi.Void Function( + ffi.Pointer, +); + +typedef _typedefC_136 = ffi.Void Function( + ffi.Pointer, +); + +typedef _typedefC_137 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_138 = ffi.Void Function( + ffi.Pointer, +); + +typedef _typedefC_139 = ffi.Pointer Function( + ffi.Int32, + ffi.Int32, +); + +typedef _typedefC_140 = ffi.Void Function( + ffi.Pointer, + ffi.Int32, +); + +typedef _typedefC_141 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_142 = ffi.Pointer Function( + ffi.Pointer, + ffi.Uint32, + ffi.Int32, +); + +typedef _typedefC_143 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, +); + +typedef _typedefC_144 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32, +); + +typedef _typedefC_145 = ffi.Void Function( + ffi.Pointer, + ffi.Uint32, +); + +typedef _typedefC_146 = ffi.Void Function( + ffi.Pointer, +); + +typedef _typedefC_149 = ffi.Void Function( + ffi.Pointer, +); + +typedef _typedefC_150 = ffi.Void Function( + ffi.Pointer, +); + +typedef _typedefC_154 = ffi.Pointer Function( + ffi.Pointer, +); + +typedef _typedefC_155 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_156 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_157 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, +); + +typedef _typedefC_158 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Int32, +); + +typedef _typedefC_159 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer>, +); + +typedef _typedefC_160 = ffi.Int32 Function( + ffi.Pointer, +); + +typedef _typedefC_161 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, +); + +typedef _typedefC_162 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_163 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_164 = ffi.Int64 Function( + ffi.Pointer, +); + +typedef _typedefC_165 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer, +); + +typedef _typedefC_166 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, +); + +typedef _typedefC_167 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_168 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer>, +); + +typedef _typedefC_169 = ffi.Void Function( + ffi.Pointer, +); + +typedef _typedefC_170 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, +); + +typedef _typedefC_171 = ffi.Pointer Function( + ffi.Pointer, + ffi.Int32, +); + +typedef _typedefC_172 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_173 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_174 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_175 = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, +); + +typedef _typedefC_176 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer>, + ffi.Int32, + ffi.Pointer>, +); + +typedef _typedefC_177 = ffi.Void Function( + ffi.Pointer, +); + +typedef _typedefC_178 = ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Int32, +); + +typedef _typedefC_179 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, +); + +typedef _typedefC_180 = ffi.Void Function( + ffi.Pointer, +); + +typedef _typedefC_181 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, +); + +typedef _typedefC_182 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, +); + +typedef fts5_extension_function = ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, +); + +typedef _typedefC_183 = ffi.Void Function( + ffi.Pointer, +); + +typedef _typedefC_184 = ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, +); diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index a73d5cc876..ec4944637c 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -103,3 +103,5 @@ functions: - clang_getCursorUSR - clang_getFieldDeclBitWidth - clang_Cursor_isFunctionInlined + - clang_getCursorDefinition + - clang_Cursor_isNull From 1c59892be3ff327b33f5c85edb9685d1b81a511c Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 8 Mar 2021 02:23:25 -0800 Subject: [PATCH 071/276] [ffigen] Added option to generate dependency-only structs as opaque (#181) --- pkgs/ffigen/CHANGELOG.md | 6 ++ pkgs/ffigen/README.md | 22 ++++ .../lib/src/code_generator/dart_keywords.dart | 3 +- pkgs/ffigen/lib/src/code_generator/struc.dart | 3 + .../lib/src/config_provider/config.dart | 102 ++++++++++++------ .../lib/src/config_provider/config_types.dart | 4 +- .../lib/src/config_provider/spec_utils.dart | 83 ++++++++------ .../sub_parsers/structdecl_parser.dart | 31 +++++- .../type_extractor/extractor.dart | 42 ++++++-- pkgs/ffigen/lib/src/strings.dart | 5 + pkgs/ffigen/pubspec.yaml | 2 +- ...expected_opaque_dependencies_bindings.dart | 57 ++++++++++ .../header_parser_tests/opaque_dependencies.h | 36 +++++++ .../opaque_dependencies_test.dart | 49 +++++++++ 14 files changed, 366 insertions(+), 79 deletions(-) create mode 100644 pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/opaque_dependencies.h create mode 100644 pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index df06dd51a0..4a849f38a8 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,9 @@ +# 2.2.3 +- Added new subkey `dependency-only` (options - `full (default) | opaque`) under `structs`. +When set to `opaque`, ffigen will generate empty `Opaque` structs if structs +were excluded in config (i.e added because they were a dependency) and +only passed by reference(pointer). + # 2.2.2 - Fixed generation of empty opaque structs due to forward declarations in header files. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 02c908324d..7c00f1a594 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -210,6 +210,21 @@ array-workaround: true comments: style: doxygen length: full +``` + + + + + + @@ -480,6 +495,13 @@ unnamed-enums: This happens when an excluded struct is a dependency to some included declaration. (A dependency means a struct is being passed/returned by a function or is member of another struct in some way) +Note: If you supply `structs` -> `dependency-only` as `opaque` ffigen will generate +these struct dependencies as `Opaque` if they were only passed by reference(pointer). +```yaml +structs: + dependency-only: opaque +``` + ### How to expose the native pointers and typedefs? By default all native pointers and typedefs are hidden, but you can use the diff --git a/pkgs/ffigen/lib/src/code_generator/dart_keywords.dart b/pkgs/ffigen/lib/src/code_generator/dart_keywords.dart index 2f3d4d61f7..8e0de3c22a 100644 --- a/pkgs/ffigen/lib/src/code_generator/dart_keywords.dart +++ b/pkgs/ffigen/lib/src/code_generator/dart_keywords.dart @@ -66,5 +66,6 @@ const keywords = { 'show', 'dynamic', 'implements', - 'static' + 'static', + 'late', }; diff --git a/pkgs/ffigen/lib/src/code_generator/struc.dart b/pkgs/ffigen/lib/src/code_generator/struc.dart index d56682192c..2fc96d6184 100644 --- a/pkgs/ffigen/lib/src/code_generator/struc.dart +++ b/pkgs/ffigen/lib/src/code_generator/struc.dart @@ -44,6 +44,9 @@ class Struc extends NoLookUpBinding { bool get isOpaque => members.isEmpty; + /// Marker for checking if the dependencies are parsed. + bool parsedDependencies = false; + Struc({ String? usr, String? originalName, diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index a330e60aab..cf083df478 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -76,6 +76,10 @@ class Config { CommentType get commentType => _commentType; late CommentType _commentType; + /// Whether structs that are dependencies should be included. + StructDependencies get structDependencies => _structDependencies; + late StructDependencies _structDependencies; + /// If tool should generate array workarounds. /// /// If false(default), structs with inline array members will have all its @@ -121,13 +125,41 @@ class Config { return configspecs; } + /// Checks if there are nested [key] in [map]. + bool _checkKeyInYaml(List key, YamlMap map) { + dynamic last = map; + for (final k in key) { + if (last is YamlMap) { + if (!last.containsKey(k)) return false; + last = last[k]; + } else { + return false; + } + } + return last != null; + } + + /// Extracts value of nested [key] from [map]. + dynamic _getKeyValueFromYaml(List key, YamlMap map) { + if (_checkKeyInYaml(key, map)) { + dynamic last = map; + for (final k in key) { + last = last[k]; + } + return last; + } + + return null; + } + /// Validates Yaml according to given specs. - bool _checkConfigs(YamlMap map, Map specs) { + bool _checkConfigs(YamlMap map, Map, Specification> specs) { var _result = true; for (final key in specs.keys) { final spec = specs[key]; - if (map.containsKey(key)) { - _result = _result && spec!.validator(key, map[key]); + if (_checkKeyInYaml(key, map)) { + _result = + _result && spec!.validator(key, _getKeyValueFromYaml(key, map)); } else if (spec!.requirement == Requirement.yes) { _logger.severe("Key '$key' is required."); _result = false; @@ -137,7 +169,8 @@ class Config { } // Warn about unknown keys. for (final key in map.keys) { - if (!specs.containsKey(key)) { + final specString = specs.keys.map((e) => e.join(':')).toSet(); + if (!specString.contains(key)) { _logger.warning("Unknown key '$key' found."); } } @@ -148,11 +181,11 @@ class Config { /// Extracts variables from Yaml according to given specs. /// /// Validation must be done beforehand, using [_checkConfigs]. - void _extract(YamlMap map, Map specs) { + void _extract(YamlMap map, Map, Specification> specs) { for (final key in specs.keys) { final spec = specs[key]; - if (map.containsKey(key)) { - spec!.extractedResult(spec.extractor(map[key])); + if (_checkKeyInYaml(key, map)) { + spec!.extractedResult(spec.extractor(_getKeyValueFromYaml(key, map))); } else { spec!.extractedResult(spec.defaultValue?.call()); } @@ -162,28 +195,28 @@ class Config { /// Returns map of various specifications avaialble for our tool. /// /// Key: Name, Value: [Specification] - Map _getSpecs() { - return { - strings.llvmLib: Specification( + Map, Specification> _getSpecs() { + return , Specification>{ + [strings.llvmLib]: Specification( requirement: Requirement.no, validator: llvmLibValidator, extractor: llvmLibExtractor, defaultValue: () => findDylibAtDefaultLocations(), extractedResult: (dynamic result) => _libclangDylib = result as String, ), - strings.output: Specification( + [strings.output]: Specification( requirement: Requirement.yes, validator: outputValidator, extractor: outputExtractor, extractedResult: (dynamic result) => _output = result as String, ), - strings.headers: Specification( + [strings.headers]: Specification( requirement: Requirement.yes, validator: headersValidator, extractor: headersExtractor, extractedResult: (dynamic result) => _headers = result as Headers, ), - strings.compilerOpts: Specification>( + [strings.compilerOpts]: Specification>( requirement: Requirement.no, validator: compilerOptsValidator, extractor: compilerOptsExtractor, @@ -191,7 +224,7 @@ class Config { extractedResult: (dynamic result) => _compilerOpts = result as List, ), - strings.functions: Specification( + [strings.functions]: Specification( requirement: Requirement.no, validator: declarationConfigValidator, extractor: declarationConfigExtractor, @@ -200,7 +233,7 @@ class Config { _functionDecl = result as Declaration; }, ), - strings.structs: Specification( + [strings.structs]: Specification( requirement: Requirement.no, validator: declarationConfigValidator, extractor: declarationConfigExtractor, @@ -209,7 +242,7 @@ class Config { _structDecl = result as Declaration; }, ), - strings.enums: Specification( + [strings.enums]: Specification( requirement: Requirement.no, validator: declarationConfigValidator, extractor: declarationConfigExtractor, @@ -218,7 +251,7 @@ class Config { _enumClassDecl = result as Declaration; }, ), - strings.unnamedEnums: Specification( + [strings.unnamedEnums]: Specification( requirement: Requirement.no, validator: declarationConfigValidator, extractor: declarationConfigExtractor, @@ -226,7 +259,7 @@ class Config { extractedResult: (dynamic result) => _unnamedEnumConstants = result as Declaration, ), - strings.globals: Specification( + [strings.globals]: Specification( requirement: Requirement.no, validator: declarationConfigValidator, extractor: declarationConfigExtractor, @@ -235,7 +268,7 @@ class Config { _globals = result as Declaration; }, ), - strings.macros: Specification( + [strings.macros]: Specification( requirement: Requirement.no, validator: declarationConfigValidator, extractor: declarationConfigExtractor, @@ -244,7 +277,7 @@ class Config { _macroDecl = result as Declaration; }, ), - strings.sizemap: Specification>( + [strings.sizemap]: Specification>( validator: sizemapValidator, extractor: sizemapExtractor, defaultValue: () => {}, @@ -257,21 +290,21 @@ class Config { } }, ), - strings.typedefmap: Specification>( + [strings.typedefmap]: Specification>( validator: typedefmapValidator, extractor: typedefmapExtractor, defaultValue: () => {}, extractedResult: (dynamic result) => _typedefNativeTypeMappings = result as Map, ), - strings.sort: Specification( + [strings.sort]: Specification( requirement: Requirement.no, validator: booleanValidator, extractor: booleanExtractor, defaultValue: () => false, extractedResult: (dynamic result) => _sort = result as bool, ), - strings.useSupportedTypedefs: Specification( + [strings.useSupportedTypedefs]: Specification( requirement: Requirement.no, validator: booleanValidator, extractor: booleanExtractor, @@ -279,7 +312,7 @@ class Config { extractedResult: (dynamic result) => _useSupportedTypedefs = result as bool, ), - strings.comments: Specification( + [strings.comments]: Specification( requirement: Requirement.no, validator: commentValidator, extractor: commentExtractor, @@ -287,28 +320,37 @@ class Config { extractedResult: (dynamic result) => _commentType = result as CommentType, ), - strings.arrayWorkaround: Specification( + [strings.structs, strings.structDependencies]: + Specification( + requirement: Requirement.no, + validator: structDependenciesValidator, + extractor: structDependenciesExtractor, + defaultValue: () => StructDependencies.full, + extractedResult: (dynamic result) => + _structDependencies = result as StructDependencies, + ), + [strings.arrayWorkaround]: Specification( requirement: Requirement.no, validator: booleanValidator, extractor: booleanExtractor, defaultValue: () => false, extractedResult: (dynamic result) => _arrayWorkaround = result as bool, ), - strings.dartBool: Specification( + [strings.dartBool]: Specification( requirement: Requirement.no, validator: booleanValidator, extractor: booleanExtractor, defaultValue: () => true, extractedResult: (dynamic result) => _dartBool = result as bool, ), - strings.name: Specification( + [strings.name]: Specification( requirement: Requirement.prefer, validator: dartClassNameValidator, extractor: stringExtractor, defaultValue: () => 'NativeLibrary', extractedResult: (dynamic result) => _wrapperName = result as String, ), - strings.description: Specification( + [strings.description]: Specification( requirement: Requirement.prefer, validator: nonEmptyStringValidator, extractor: stringExtractor, @@ -316,13 +358,13 @@ class Config { extractedResult: (dynamic result) => _wrapperDocComment = result as String?, ), - strings.preamble: Specification( + [strings.preamble]: Specification( requirement: Requirement.no, validator: nonEmptyStringValidator, extractor: stringExtractor, extractedResult: (dynamic result) => _preamble = result as String?, ), - strings.useDartHandle: Specification( + [strings.useDartHandle]: Specification( requirement: Requirement.no, validator: booleanValidator, extractor: booleanExtractor, diff --git a/pkgs/ffigen/lib/src/config_provider/config_types.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart index e412d96029..35d24f0ab9 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_types.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart @@ -26,11 +26,13 @@ class CommentType { enum CommentStyle { doxygen, any } enum CommentLength { none, brief, full } +enum StructDependencies { full, opaque } + /// Represents a single specification in configurations. /// /// [E] is the return type of the extractedResult. class Specification { - final bool Function(String name, dynamic value) validator; + final bool Function(List name, dynamic value) validator; final E Function(dynamic map) extractor; final E Function()? defaultValue; diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index eeab2ae767..0351d8c9c0 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -40,8 +40,8 @@ bool checkType(List keys, dynamic value) { bool booleanExtractor(dynamic value) => value as bool; -bool booleanValidator(String name, dynamic value) => - checkType([name], value); +bool booleanValidator(List name, dynamic value) => + checkType(name, value); Map sizemapExtractor(dynamic yamlConfig) { final resultMap = {}; @@ -59,8 +59,8 @@ Map sizemapExtractor(dynamic yamlConfig) { return resultMap; } -bool sizemapValidator(String name, dynamic yamlConfig) { - if (!checkType([name], yamlConfig)) { +bool sizemapValidator(List name, dynamic yamlConfig) { + if (!checkType(name, yamlConfig)) { return false; } for (final key in (yamlConfig as YamlMap).keys) { @@ -89,8 +89,8 @@ Map typedefmapExtractor(dynamic yamlConfig) { return resultMap; } -bool typedefmapValidator(String name, dynamic yamlConfig) { - if (!checkType([name], yamlConfig)) { +bool typedefmapValidator(List name, dynamic yamlConfig) { + if (!checkType(name, yamlConfig)) { return false; } for (final value in (yamlConfig as YamlMap).values) { @@ -106,8 +106,8 @@ bool typedefmapValidator(String name, dynamic yamlConfig) { List compilerOptsExtractor(dynamic value) => (value as String).split(' '); -bool compilerOptsValidator(String name, dynamic value) => - checkType([name], value); +bool compilerOptsValidator(List name, dynamic value) => + checkType(name, value); Headers headersExtractor(dynamic yamlConfig) { final entryPoints = []; @@ -147,8 +147,8 @@ Headers headersExtractor(dynamic yamlConfig) { ); } -bool headersValidator(String name, dynamic value) { - if (!checkType([name], value)) { +bool headersValidator(List name, dynamic value) { + if (!checkType(name, value)) { return false; } if (!(value as YamlMap).containsKey(strings.entryPoints)) { @@ -157,7 +157,7 @@ bool headersValidator(String name, dynamic value) { } else { for (final key in value.keys) { if (key == strings.entryPoints || key == strings.includeDirectives) { - if (!checkType([name, key as String], value[key])) { + if (!checkType([...name, key as String], value[key])) { return false; } } else { @@ -171,8 +171,8 @@ bool headersValidator(String name, dynamic value) { String libclangDylibExtractor(dynamic value) => getDylibPath(value as String); -bool libclangDylibValidator(String name, dynamic value) { - if (!checkType([name], value)) { +bool libclangDylibValidator(List name, dynamic value) { + if (!checkType(name, value)) { return false; } else { final dylibPath = getDylibPath(value as String); @@ -248,8 +248,8 @@ String llvmLibExtractor(dynamic value) { } } -bool llvmLibValidator(String name, dynamic value) { - if (!checkType([name], value) || +bool llvmLibValidator(List name, dynamic value) { + if (!checkType(name, value) || !Directory(value as String).existsSync()) { _logger.severe('Expected $name to be a valid folder Path.'); return false; @@ -259,8 +259,8 @@ bool llvmLibValidator(String name, dynamic value) { String outputExtractor(dynamic value) => _replaceSeparators(value as String); -bool outputValidator(String name, dynamic value) => - checkType([name], value); +bool outputValidator(List name, dynamic value) => + checkType(name, value); /// Returns true if [str] is not a full name. /// @@ -380,37 +380,37 @@ Declaration declarationConfigExtractor(dynamic yamlMap) { ); } -bool declarationConfigValidator(String name, dynamic value) { +bool declarationConfigValidator(List name, dynamic value) { var _result = true; if (value is YamlMap) { for (final key in value.keys) { if (key == strings.include || key == strings.exclude) { - if (!checkType([name, key as String], value[key])) { + if (!checkType([...name, key as String], value[key])) { _result = false; } } else if (key == strings.rename) { - if (!checkType([name, key as String], value[key])) { + if (!checkType([...name, key as String], value[key])) { _result = false; } else { for (final subkey in value[key].keys) { if (!checkType( - [name, key, subkey as String], value[key][subkey])) { + [...name, key, subkey as String], value[key][subkey])) { _result = false; } } } } else if (key == strings.memberRename) { - if (!checkType([name, key as String], value[key])) { + if (!checkType([...name, key as String], value[key])) { _result = false; } else { for (final declNameKey in value[key].keys) { - if (!checkType( - [name, key, declNameKey as String], value[key][declNameKey])) { + if (!checkType([...name, key, declNameKey as String], + value[key][declNameKey])) { _result = false; } else { for (final memberNameKey in value[key][declNameKey].keys) { if (!checkType([ - name, + ...name, key, declNameKey, memberNameKey as String, @@ -422,13 +422,13 @@ bool declarationConfigValidator(String name, dynamic value) { } } } else if (key == strings.symbolAddress) { - if (!checkType([name, key as String], value[key])) { + if (!checkType([...name, key as String], value[key])) { _result = false; } else { for (final subkey in value[key].keys) { if (subkey == strings.include || subkey == strings.exclude) { if (!checkType( - [name, key, subkey as String], value[key][subkey])) { + [...name, key, subkey as String], value[key][subkey])) { _result = false; } } else { @@ -437,9 +437,6 @@ bool declarationConfigValidator(String name, dynamic value) { } } } - } else { - _logger.severe("Unknown key '$key' in '$name'."); - _result = false; } } } else { @@ -467,7 +464,7 @@ SupportedNativeType nativeSupportedType(int value, {bool signed = true}) { String stringExtractor(dynamic value) => value as String; -bool nonEmptyStringValidator(String name, dynamic value) { +bool nonEmptyStringValidator(List name, dynamic value) { if (value is String && value.isNotEmpty) { return true; } else { @@ -476,7 +473,7 @@ bool nonEmptyStringValidator(String name, dynamic value) { } } -bool dartClassNameValidator(String name, dynamic value) { +bool dartClassNameValidator(List name, dynamic value) { if (value is String && quiver.matchesFull(RegExp('[a-zA-Z]+[_a-zA-Z0-9]*'), value)) { return true; @@ -516,7 +513,7 @@ CommentType commentExtractor(dynamic value) { return ct; } -bool commentValidator(String name, dynamic value) { +bool commentValidator(List name, dynamic value) { if (value is bool) { return true; } else if (value is YamlMap) { @@ -547,3 +544,23 @@ bool commentValidator(String name, dynamic value) { return false; } } + +StructDependencies structDependenciesExtractor(dynamic value) { + var result = StructDependencies.full; + if (value == strings.opaqueStructDependencies) { + result = StructDependencies.opaque; + } + return result; +} + +bool structDependenciesValidator(List name, dynamic value) { + var result = true; + if (value is! String || + !(value == strings.fullStructDependencies || + value == strings.opaqueStructDependencies)) { + _logger.severe( + "'$name' must be one of the following - {${strings.fullStructDependencies}, ${strings.opaqueStructDependencies}}"); + result = false; + } + return result; +} diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index 4a6964bb55..d9c402327b 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/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/config_provider/config_types.dart'; import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang_types; @@ -47,6 +48,13 @@ Struc? parseStructDeclaration( /// Option to ignore struct filter (Useful in case of extracting structs /// when they are passed/returned by an included function.) bool ignoreFilter = false, + + /// To track if the struct was used by reference(i.e struct*). (Used to only + /// generate these as opaque if `struct-dependencies` was set to opaque). + bool pointerReference = false, + + /// If the struct name should be updated, if it was already seen. + bool updateName = true, }) { _stack.push(_ParsedStruc()); @@ -83,15 +91,30 @@ Struc? parseStructDeclaration( // Adding to seen here to stop recursion if a struct has itself as a // member, members are updated later. bindingsIndex.addStructToSeen(structUsr, _stack.top.struc!); - _setStructMembers(cursor); } if (bindingsIndex.isSeenStruct(structUsr)) { - _stack.top.struc = bindingsIndex.getSeenStruct(structUsr)!; + _stack.top.struc = bindingsIndex.getSeenStruct(structUsr); + + final skipDependencies = _stack.top.struc!.parsedDependencies || + (config.structDependencies == StructDependencies.opaque && + pointerReference && + ignoreFilter); + + if (!skipDependencies) { + // Prevents infinite recursion if struct has a pointer to itself. + _stack.top.struc!.parsedDependencies = true; + _setStructMembers(cursor); + } else if (!_stack.top.struc!.parsedDependencies) { + _logger.fine('Skipped dependencies.'); + } - // If struct is seen, update it's name. - _stack.top.struc!.name = config.structDecl.renameUsingConfig(structName); + if (updateName) { + // If struct is seen, update it's name. + _stack.top.struc!.name = config.structDecl.renameUsingConfig(structName); + } } + return _stack.pop().struc; } diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 46d6a41b46..cd0445ea7d 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -18,14 +18,21 @@ final _logger = Logger('ffigen.header_parser.extractor'); const _padding = ' '; /// Converts cxtype to a typestring code_generator can accept. -Type getCodeGenType(clang_types.CXType cxtype, {String? parentName}) { +Type getCodeGenType( + clang_types.CXType cxtype, { + String? parentName, + + /// Passed on if a value was marked as a pointer before this one. + bool pointerReference = false, +}) { _logger.fine('${_padding}getCodeGenType ${cxtype.completeStringRepr()}'); final kind = cxtype.kind; switch (kind) { case clang_types.CXTypeKind.CXType_Pointer: final pt = clang.clang_getPointeeType(cxtype); - final s = getCodeGenType(pt, parentName: parentName); + final s = + getCodeGenType(pt, parentName: parentName, pointerReference: true); // Replace Pointer<_Dart_Handle> with Handle. if (config.useDartHandle && @@ -53,14 +60,17 @@ Type getCodeGenType(clang_types.CXType cxtype, {String? parentName}) { final ct = clang.clang_getTypedefDeclUnderlyingType( clang.clang_getTypeDeclaration(cxtype)); - final s = getCodeGenType(ct, parentName: parentName ?? spelling); + final s = getCodeGenType(ct, + parentName: parentName ?? spelling, + pointerReference: pointerReference); return s; case clang_types.CXTypeKind.CXType_Elaborated: final et = clang.clang_Type_getNamedType(cxtype); - final s = getCodeGenType(et, parentName: parentName); + final s = getCodeGenType(et, + parentName: parentName, pointerReference: pointerReference); return s; case clang_types.CXTypeKind.CXType_Record: - return _extractfromRecord(cxtype, parentName); + return _extractfromRecord(cxtype, parentName, pointerReference); case clang_types.CXTypeKind.CXType_Enum: return Type.nativeType( enumNativeType, @@ -98,7 +108,8 @@ Type getCodeGenType(clang_types.CXType cxtype, {String? parentName}) { } } -Type _extractfromRecord(clang_types.CXType cxtype, String? parentName) { +Type _extractfromRecord( + clang_types.CXType cxtype, String? parentName, bool pointerReference) { Type type; final cursor = clang.clang_getTypeDeclaration(cxtype); @@ -115,12 +126,25 @@ Type _extractfromRecord(clang_types.CXType cxtype, String? parentName) { // TODO(23): Check if we should auto add struct. if (bindingsIndex.isSeenStruct(structUsr)) { type = Type.struct(bindingsIndex.getSeenStruct(structUsr)!); + + // This will parse the dependencies if needed. + parseStructDeclaration( + cursor, + name: structName, + ignoreFilter: true, + pointerReference: pointerReference, + updateName: false, + ); } else { - final struc = parseStructDeclaration(cursor, - name: structName, ignoreFilter: true); + final struc = parseStructDeclaration( + cursor, + name: structName, + ignoreFilter: true, + pointerReference: pointerReference, + ); type = Type.struct(struc!); - // Add to bindings if it's not Dart_Handle. + // Add to bindings if it's not Dart_Handle and is unseen. if (!(config.useDartHandle && structUsr == strings.dartHandleUsr)) { addToBindings(struc); } diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 1929051ed8..885427dc95 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -49,6 +49,11 @@ const rename = 'rename'; const memberRename = 'member-rename'; const symbolAddress = 'symbol-address'; +const structDependencies = 'dependency-only'; +// Values for `structDependencies`. +const fullStructDependencies = 'full'; +const opaqueStructDependencies = 'opaque'; + const sizemap = 'size-map'; const typedefmap = 'typedef-map'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 1b6b447771..21c65c35d3 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.2.2 +version: 2.2.3 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart new file mode 100644 index 0000000000..0c3498fc94 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart @@ -0,0 +1,57 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Opaque Dependencies Test +class NativeLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + NativeLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NativeLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + ffi.Pointer func( + ffi.Pointer a, + ) { + return _func( + a, + ); + } + + late final _func_ptr = _lookup>('func'); + late final _dart_func _func = _func_ptr.asFunction<_dart_func>(); +} + +class B extends ffi.Opaque {} + +class A extends ffi.Opaque {} + +class C extends ffi.Opaque {} + +class D extends ffi.Struct { + @ffi.Int32() + external int a; +} + +class E extends ffi.Struct { + external ffi.Pointer c; + + external D d; +} + +typedef _c_func = ffi.Pointer Function( + ffi.Pointer a, +); + +typedef _dart_func = ffi.Pointer Function( + ffi.Pointer a, +); diff --git a/pkgs/ffigen/test/header_parser_tests/opaque_dependencies.h b/pkgs/ffigen/test/header_parser_tests/opaque_dependencies.h new file mode 100644 index 0000000000..fa2499328f --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/opaque_dependencies.h @@ -0,0 +1,36 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Opaque. +struct A +{ + int a; +}; + +// Opaque. +struct B +{ + int a; +}; + +struct B *func(struct A *a); + +// Opaque. +struct C +{ + int a; +}; + +// Full (excluded, but used by value). +struct D +{ + int a; +}; + +// Full (included) +struct E +{ + struct C *c; + struct D d; +}; diff --git a/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart b/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart new file mode 100644 index 0000000000..1107767ceb --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart @@ -0,0 +1,49 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/config_provider.dart'; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; +import 'package:ffigen/src/strings.dart' as strings; + +import '../test_utils.dart'; + +late Library actual; +void main() { + group('opaque_dependencies_test', () { + setUpAll(() { + logWarnings(Level.SEVERE); + actual = parser.parse( + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Opaque Dependencies Test' +${strings.output}: 'unused' +${strings.headers}: + ${strings.entryPoints}: + - 'test/header_parser_tests/opaque_dependencies.h' +${strings.structs}: + ${strings.include}: + - 'E' + ${strings.structDependencies}: ${strings.opaqueStructDependencies} + ''') as yaml.YamlMap), + ); + }); + + test('Expected bindings', () { + matchLibraryWithExpected(actual, [ + 'test', + 'debug_generated', + 'opaque_dependencies_test_output.dart' + ], [ + 'test', + 'header_parser_tests', + 'expected_bindings', + '_expected_opaque_dependencies_bindings.dart' + ]); + }); + }); +} From 3c138e56d06f5457cd102efdbd8d44e88eed8477 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 8 Mar 2021 12:21:26 -0800 Subject: [PATCH 072/276] [ffigen] Fix `sort: true` not working, remove //+ from full comments. (#187) --- pkgs/ffigen/CHANGELOG.md | 4 ++ .../example/libclang-example/pubspec.yaml | 4 +- .../lib/src/code_generator/library.dart | 5 +- pkgs/ffigen/lib/src/header_parser/parser.dart | 4 +- pkgs/ffigen/lib/src/header_parser/utils.dart | 24 ++++--- pkgs/ffigen/pubspec.yaml | 2 +- .../code_generator_test.dart | 13 ++++ .../_expected_sort_bindings_bindings.dart | 45 ++++++++++++ .../example_tests/libclang_example_test.dart | 1 - .../test/header_parser_tests/comment_markup.h | 26 +++++++ .../comment_markup_test.dart | 48 +++++++++++++ .../_expected_comment_markup_bindings.dart | 72 +++++++++++++++++++ pkgs/ffigen/test/native_test/config.yaml | 1 - 13 files changed, 232 insertions(+), 17 deletions(-) create mode 100644 pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/comment_markup.h create mode 100644 pkgs/ffigen/test/header_parser_tests/comment_markup_test.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 4a849f38a8..abc7d7bdb6 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.2.4 +- Fix `sort: true` not working. +- Fix extra `//` or `///` in comments when using `comments -> style`: `full`. + # 2.2.3 - Added new subkey `dependency-only` (options - `full (default) | opaque`) under `structs`. When set to `opaque`, ffigen will generate empty `Opaque` structs if structs diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index 9c67f6bd1f..fe0f30b4e4 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -13,7 +13,9 @@ dev_dependencies: ffigen: output: 'generated_bindings.dart' - sort: true + + # This will sort the bindings alphabetically. + # sort: true # This is required if LLVM can't be found in default locations by ffigen. # llvm-lib: '/usr/local/opt/llvm/lib' diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index 893289d2d6..d83a19d948 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -27,7 +27,10 @@ class Library { required this.bindings, String? header, bool dartBool = true, + bool sort = false, }) { + if (sort) _sort(); + // Seperate bindings which require lookup. final lookUpBindings = bindings.whereType().toList(); final noLookUpBindings = bindings.whereType().toList(); @@ -79,7 +82,7 @@ class Library { } /// Sort all bindings in alphabetical order. - void sort() { + void _sort() { bindings.sort((b1, b2) => b1.name.compareTo(b2.name)); } diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index 3d4c5f00c7..a8473af69f 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -29,11 +29,9 @@ Library parse(Config c) { description: config.wrapperDocComment, header: config.preamble, dartBool: config.dartBool, + sort: config.sort, ); - if (config.sort) { - library.sort(); - } return library; } diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index ef91924da4..e1b205c6d8 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -193,15 +193,21 @@ String? removeRawCommentMarkups(String? string) { } final sb = StringBuffer(); - // Remove comment identifiers. - string = string.replaceAll('/*', ''); - string = string.replaceAll('*/', ''); - - // Remove any *'s in the beginning of a every line. - string.split('\n').forEach((element) { - element = element.trim().replaceFirst(RegExp(r'\**'), '').trim(); - sb.writeln(element); - }); + // Remove comment identifiers (`/** * */`, `///`, `//`) from lines. + if (string.contains(RegExp(r'^\s*\/\*+'))) { + string = string.replaceFirst(RegExp(r'^\s*\/\*+\s*'), ''); + string = string.replaceFirst(RegExp(r'\s*\*+\/$'), ''); + string.split('\n').forEach((element) { + element = element.replaceFirst(RegExp(r'^\s*\**\s*'), ''); + sb.writeln(element); + }); + } else if (string.contains(RegExp(r'^\s*\/\/\/?\s*'))) { + string.split('\n').forEach((element) { + element = element.replaceFirst(RegExp(r'^\s*\/\/\/?\s*'), ''); + sb.writeln(element); + }); + } + return sb.toString().trim(); } diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 21c65c35d3..e986dfdddd 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.2.3 +version: 2.2.4 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart index 350b799dd8..806ae22173 100644 --- a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart @@ -365,6 +365,19 @@ void main() { ); _matchLib(library, 'boolean_no_dartbool'); }); + test('sort bindings', () { + final library = Library( + name: 'Bindings', + sort: true, + bindings: [ + Func(name: 'b', returnType: Type.nativeType(SupportedNativeType.Void)), + Func(name: 'a', returnType: Type.nativeType(SupportedNativeType.Void)), + Struc(name: 'd'), + Struc(name: 'c'), + ], + ); + _matchLib(library, 'sort_bindings'); + }); } /// Utility to match expected bindings to the generated bindings. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart new file mode 100644 index 0000000000..aaa8f2d2d4 --- /dev/null +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart @@ -0,0 +1,45 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +class Bindings { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + Bindings(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + Bindings.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + void a() { + return _a(); + } + + late final _a_ptr = _lookup>('a'); + late final _dart_a _a = _a_ptr.asFunction<_dart_a>(); + + void b() { + return _b(); + } + + late final _b_ptr = _lookup>('b'); + late final _dart_b _b = _b_ptr.asFunction<_dart_b>(); +} + +class c extends ffi.Opaque {} + +class d extends ffi.Opaque {} + +typedef _c_a = ffi.Void Function(); + +typedef _dart_a = void Function(); + +typedef _c_b = ffi.Void Function(); + +typedef _dart_b = void Function(); diff --git a/pkgs/ffigen/test/example_tests/libclang_example_test.dart b/pkgs/ffigen/test/example_tests/libclang_example_test.dart index e7cbc56082..f385b000a9 100644 --- a/pkgs/ffigen/test/example_tests/libclang_example_test.dart +++ b/pkgs/ffigen/test/example_tests/libclang_example_test.dart @@ -19,7 +19,6 @@ void main() { test('libclang-example', () { final config = Config.fromYaml(loadYaml(''' ${strings.output}: 'generated_bindings.dart' -${strings.sort}: true ${strings.headers}: ${strings.entryPoints}: - third_party/libclang/include/clang-c/Index.h diff --git a/pkgs/ffigen/test/header_parser_tests/comment_markup.h b/pkgs/ffigen/test/header_parser_tests/comment_markup.h new file mode 100644 index 0000000000..1201e87b50 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/comment_markup.h @@ -0,0 +1,26 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// This is a single line test comment. +void com1(); + +/// This is a multi-line +/// test comment. +void com2(); + +/** This is a multi-line + * doxygen style + * test comment. + */ +void com3(); + +// Test comment for struct. +struct com4{ + /// Muli-line test comment for struct field + // With multiple line and both // and ///. + int a; + + /* Single line field comment. */ + float b; +}; diff --git a/pkgs/ffigen/test/header_parser_tests/comment_markup_test.dart b/pkgs/ffigen/test/header_parser_tests/comment_markup_test.dart new file mode 100644 index 0000000000..6d3f8bad09 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/comment_markup_test.dart @@ -0,0 +1,48 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/config_provider.dart'; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; +import 'package:ffigen/src/strings.dart' as strings; + +import '../test_utils.dart'; + +late Library actual; +void main() { + group('comment_markup_test', () { + setUpAll(() { + logWarnings(Level.SEVERE); + actual = parser.parse( + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Comment Markup Test' +${strings.output}: 'unused' +${strings.headers}: + ${strings.entryPoints}: + - 'test/header_parser_tests/comment_markup.h' +${strings.comments}: + ${strings.style}: ${strings.any} + ${strings.length}: ${strings.full} + ''') as yaml.YamlMap), + ); + }); + + test('Expected bindings', () { + matchLibraryWithExpected(actual, [ + 'test', + 'debug_generated', + 'comment_markup_test_output.dart' + ], [ + 'test', + 'header_parser_tests', + 'expected_bindings', + '_expected_comment_markup_bindings.dart' + ]); + }); + }); +} diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart new file mode 100644 index 0000000000..75bc7c7c5e --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart @@ -0,0 +1,72 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Comment Markup Test +class NativeLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + NativeLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NativeLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + /// This is a single line test comment. + void com1() { + return _com1(); + } + + late final _com1_ptr = _lookup>('com1'); + late final _dart_com1 _com1 = _com1_ptr.asFunction<_dart_com1>(); + + /// This is a multi-line + /// test comment. + void com2() { + return _com2(); + } + + late final _com2_ptr = _lookup>('com2'); + late final _dart_com2 _com2 = _com2_ptr.asFunction<_dart_com2>(); + + /// This is a multi-line + /// doxygen style + /// test comment. + void com3() { + return _com3(); + } + + late final _com3_ptr = _lookup>('com3'); + late final _dart_com3 _com3 = _com3_ptr.asFunction<_dart_com3>(); +} + +/// Test comment for struct. +class com4 extends ffi.Struct { + /// Muli-line test comment for struct field + /// With multiple line and both // and ///. + @ffi.Int32() + external int a; + + /// Single line field comment. + @ffi.Float() + external double b; +} + +typedef _c_com1 = ffi.Void Function(); + +typedef _dart_com1 = void Function(); + +typedef _c_com2 = ffi.Void Function(); + +typedef _dart_com2 = void Function(); + +typedef _c_com3 = ffi.Void Function(); + +typedef _dart_com3 = void Function(); diff --git a/pkgs/ffigen/test/native_test/config.yaml b/pkgs/ffigen/test/native_test/config.yaml index 393351800b..7abdce4bbd 100644 --- a/pkgs/ffigen/test/native_test/config.yaml +++ b/pkgs/ffigen/test/native_test/config.yaml @@ -9,7 +9,6 @@ name: NativeLibrary description: 'Native tests.' output: 'test/native_test/native_test_bindings.dart' -sort: true headers: entry-points: - 'test/native_test/native_test.c' From 02ef1a373583cbb2a97245a2ae1ead898c20996f Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Tue, 9 Mar 2021 14:21:03 +0100 Subject: [PATCH 073/276] [ffigen] Fix global rename in README.md (#188) --- pkgs/ffigen/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 7c00f1a594..9f516e4f1a 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -179,7 +179,7 @@ globals: - aGlobal rename: # Removes '_' from beginning of a name. - - '_(.*)': '$1' + '_(.*)': '$1' ``` From 8fb2f9f620717e7501f6d75a617e131fad95d87f Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Wed, 10 Mar 2021 23:28:37 +0530 Subject: [PATCH 074/276] [ffigen] Added new command-line option `--compiler-opts`. (#192) --- pkgs/ffigen/CHANGELOG.md | 3 + pkgs/ffigen/README.md | 8 +- .../lib/src/config_provider/config.dart | 11 +++ .../lib/src/config_provider/spec_utils.dart | 19 ++++- pkgs/ffigen/lib/src/executables/ffigen.dart | 74 ++++++++++++------- pkgs/ffigen/pubspec.yaml | 2 +- .../test/config_tests/compiler_opts_test.dart | 29 ++++++++ pkgs/ffigen/test/test_coverage.dart | 12 +++ 8 files changed, 130 insertions(+), 28 deletions(-) create mode 100644 pkgs/ffigen/test/config_tests/compiler_opts_test.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index abc7d7bdb6..319671ad28 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.2.5 +- Added new command line flag `--compiler-opts` to the command line tool. + # 2.2.4 - Fix `sort: true` not working. - Fix extra `//` or `///` in comments when using `comments -> style`: `full`. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 9f516e4f1a..5eb01030cf 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -135,11 +135,17 @@ description: 'Bindings to SQLite' - + diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index cf083df478..434137e799 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -125,6 +125,17 @@ class Config { return configspecs; } + /// Add compiler options for clang. If [highPriority] is true these are added + /// to the front of the list. + void addCompilerOpts(String compilerOpts, {bool highPriority = false}) { + if (highPriority) { + _compilerOpts.insertAll( + 0, compilerOptsToList(compilerOpts)); // Inserts at the front. + } else { + _compilerOpts.addAll(compilerOptsToList(compilerOpts)); + } + } + /// Checks if there are nested [key] in [map]. bool _checkKeyInYaml(List key, YamlMap map) { dynamic last = map; diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 0351d8c9c0..692f92197b 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -103,8 +103,25 @@ bool typedefmapValidator(List name, dynamic yamlConfig) { return true; } +final _quoteMatcher = RegExp(r'''^["'](.*)["']$''', dotAll: true); +final _cmdlineArgMatcher = RegExp(r'''['"](\\"|[^"])*?['"]|[^ ]+'''); +List compilerOptsToList(String compilerOpts) { + final list = []; + _cmdlineArgMatcher.allMatches(compilerOpts).forEach((element) { + var match = element.group(0); + if (match != null) { + if (quiver.matchesFull(_quoteMatcher, match)) { + match = _quoteMatcher.allMatches(match).first.group(1)!; + } + list.add(match); + } + }); + + return list; +} + List compilerOptsExtractor(dynamic value) => - (value as String).split(' '); + compilerOptsToList(value as String); bool compilerOptsValidator(List name, dynamic value) => checkType(name, value); diff --git a/pkgs/ffigen/lib/src/executables/ffigen.dart b/pkgs/ffigen/lib/src/executables/ffigen.dart index 14d1388155..12dd868d1f 100644 --- a/pkgs/ffigen/lib/src/executables/ffigen.dart +++ b/pkgs/ffigen/lib/src/executables/ffigen.dart @@ -14,6 +14,18 @@ import 'package:yaml/yaml.dart' as yaml; final _logger = Logger('ffigen.ffigen'); final _ansi = Ansi(Ansi.terminalSupportsAnsi); +const compilerOpts = 'compiler-opts'; +const conf = 'config'; +const help = 'help'; +const verbose = 'verbose'; +const pubspecName = 'pubspec.yaml'; +const configKey = 'ffigen'; +const logAll = 'all'; +const logFine = 'fine'; +const logInfo = 'info'; +const logWarning = 'warning'; +const logSevere = 'severe'; + String successPen(String str) { return '${_ansi.green}$str${_ansi.none}'; } @@ -50,19 +62,27 @@ void main(List args) { Config getConfig(ArgResults result) { _logger.info('Running in ${Directory.current}'); + Config config; - if (result.wasParsed('config')) { - return getConfigFromCustomYaml(result['config'] as String); + // Parse config from yaml. + if (result.wasParsed(conf)) { + config = getConfigFromCustomYaml(result[conf] as String); } else { - return getConfigFromPubspec(); + config = getConfigFromPubspec(); + } + + // Add compiler options from command line. + if (result.wasParsed(compilerOpts)) { + _logger.fine('Passed compiler opts - "${result[compilerOpts]}"'); + config.addCompilerOpts((result[compilerOpts] as String), + highPriority: true); } + + return config; } /// Extracts configuration from pubspec file. Config getConfigFromPubspec() { - final pubspecName = 'pubspec.yaml'; - final configKey = 'ffigen'; - final pubspecFile = File(pubspecName); if (!pubspecFile.existsSync()) { @@ -107,33 +127,37 @@ ArgResults getArgResults(List args) { parser.addSeparator( 'FFIGEN: Generate dart bindings from C header files\nUsage:'); parser.addOption( - 'config', - help: 'path to Yaml file containing configurations if not in pubspec.yaml', + conf, + help: 'Path to Yaml file containing configurations if not in pubspec.yaml', ); parser.addOption( - 'verbose', + verbose, abbr: 'v', - defaultsTo: 'info', + defaultsTo: logInfo, allowed: [ - 'all', - 'fine', - 'info', - 'warning', - 'severe', + logAll, + logFine, + logInfo, + logWarning, + logSevere, ], ); parser.addFlag( - 'help', + help, abbr: 'h', - help: 'prints this usage', + help: 'Prints this usage', negatable: false, ); + parser.addOption( + compilerOpts, + help: 'Compiler options for clang. (E.g --$compilerOpts "-I/headers -W")', + ); ArgResults results; try { results = parser.parse(args); - if (results.wasParsed('help')) { + if (results.wasParsed(help)) { print(parser.usage); exit(0); } @@ -148,25 +172,25 @@ ArgResults getArgResults(List args) { /// Sets up the logging level and printing. void setupLogger(ArgResults result) { - if (result.wasParsed('verbose')) { - switch (result['verbose'] as String?) { - case 'all': + if (result.wasParsed(verbose)) { + switch (result[verbose] as String?) { + case logAll: // Logs everything, the entire AST touched by our parser. Logger.root.level = Level.ALL; break; - case 'fine': + case logFine: // Logs AST parts relevant to user (i.e those included in filters). Logger.root.level = Level.FINE; break; - case 'info': + case logInfo: // Logs relevant info for general user (default). Logger.root.level = Level.INFO; break; - case 'warning': + case logWarning: // Logs warnings for relevant stuff. Logger.root.level = Level.WARNING; break; - case 'severe': + case logSevere: // Logs severe warnings and errors. Logger.root.level = Level.SEVERE; break; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index e986dfdddd..31048c4e7d 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.2.4 +version: 2.2.5 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/config_tests/compiler_opts_test.dart b/pkgs/ffigen/test/config_tests/compiler_opts_test.dart new file mode 100644 index 0000000000..a3aa1176c3 --- /dev/null +++ b/pkgs/ffigen/test/config_tests/compiler_opts_test.dart @@ -0,0 +1,29 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/config_provider/spec_utils.dart'; +import 'package:test/test.dart'; + +late Library actual, expected; + +void main() { + group('compiler_opts_test', () { + test('Compiler Opts', () { + final opts = + '''--option value "in double quotes" 'in single quotes' -tab=separated'''; + final list = compilerOptsToList(opts); + expect( + list, + [ + '--option', + 'value', + 'in double quotes', + 'in single quotes', + '-tab=separated', + ], + ); + }); + }); +} diff --git a/pkgs/ffigen/test/test_coverage.dart b/pkgs/ffigen/test/test_coverage.dart index 9f61cde698..88623baeef 100644 --- a/pkgs/ffigen/test/test_coverage.dart +++ b/pkgs/ffigen/test/test_coverage.dart @@ -7,14 +7,20 @@ import 'collision_tests/decl_decl_collision_test.dart' as collision_tests_decl_decl_collision_test; import 'collision_tests/reserved_keyword_collision_test.dart' as collision_tests_reserved_keyword_collision_test; +import 'config_tests/compiler_opts_test.dart' + as config_tests_compiler_opts_test; import 'example_tests/cjson_example_test.dart' as example_tests_cjson_example_test; import 'example_tests/libclang_example_test.dart' as example_tests_libclang_example_test; import 'example_tests/simple_example_test.dart' as example_tests_simple_example_test; +import 'header_parser_tests/comment_markup_test.dart' + as header_parser_tests_comment_markup_test; import 'header_parser_tests/dart_handle_test.dart' as header_parser_tests_dart_handle_test; +import 'header_parser_tests/forward_decl_test.dart' + as header_parser_tests_forward_decl_test; import 'header_parser_tests/function_n_struct_test.dart' as header_parser_tests_function_n_struct_test; import 'header_parser_tests/functions_test.dart' @@ -27,6 +33,8 @@ import 'header_parser_tests/native_func_typedef_test.dart' as header_parser_tests_native_func_typedef_test; import 'header_parser_tests/nested_parsing_test.dart' as header_parser_tests_nested_parsing_test; +import 'header_parser_tests/opaque_dependencies_test.dart' + as header_parser_tests_opaque_dependencies_test; import 'header_parser_tests/typedef_test.dart' as header_parser_tests_typedef_test; import 'header_parser_tests/unnamed_enums_test.dart' @@ -43,13 +51,17 @@ void main() { example_tests_libclang_example_test.main(); collision_tests_decl_decl_collision_test.main(); collision_tests_reserved_keyword_collision_test.main(); + config_tests_compiler_opts_test.main(); + header_parser_tests_comment_markup_test.main(); header_parser_tests_dart_handle_test.main(); + header_parser_tests_forward_decl_test.main(); header_parser_tests_functions_test.main(); header_parser_tests_globals_test.main(); header_parser_tests_macros_test.main(); header_parser_tests_function_n_struct_test.main(); header_parser_tests_native_func_typedef_test.main(); header_parser_tests_nested_parsing_test.main(); + header_parser_tests_opaque_dependencies_test.main(); header_parser_tests_typedef_test.main(); header_parser_tests_unnamed_enums_test.main(); native_test_native_test.main(); From 7e106e41c0e59d9e9f9dddfee782a7b4a9b3f491 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 15 Mar 2021 14:28:27 +0530 Subject: [PATCH 075/276] [ffigen] Automatically add std lib for macos, allow passing list to compiler-opts. (#193) --- pkgs/ffigen/CHANGELOG.md | 5 + pkgs/ffigen/README.md | 18 +++- .../example/libclang-example/pubspec.yaml | 4 +- .../lib/src/config_provider/config.dart | 44 +++------ .../lib/src/config_provider/config_types.dart | 20 ++++ .../lib/src/config_provider/path_finder.dart | 63 ++++++++++++ .../lib/src/config_provider/spec_utils.dart | 95 ++++++++++++++++++- pkgs/ffigen/lib/src/header_parser/parser.dart | 1 + pkgs/ffigen/lib/src/strings.dart | 6 ++ pkgs/ffigen/pubspec.yaml | 2 +- .../test/config_tests/compiler_opts_test.dart | 17 ++++ .../header_parser_tests/dart_handle_test.dart | 2 +- .../header_parser_tests/globals_test.dart | 3 +- .../large_integration_tests/large_test.dart | 2 - pkgs/ffigen/test/native_test/config.yaml | 3 +- pkgs/ffigen/tool/libclang_config.yaml | 5 +- 16 files changed, 242 insertions(+), 48 deletions(-) create mode 100644 pkgs/ffigen/lib/src/config_provider/path_finder.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 319671ad28..40ae92a552 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,8 @@ +# 2.3.0 +- Added config key `compiler-opts-automatic -> macos -> include-c-standard-library` +(default: true) to automatically find and add C standard library on macOS. +- Allow passing list of string to config key `compiler-opts`. + # 2.2.5 - Added new command line flag `--compiler-opts` to the command line tool. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 5eb01030cf..e3faf97385 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -140,12 +140,28 @@ description: 'Bindings to SQLite' + + + + + diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index fe0f30b4e4..a7cbf4a5c6 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -29,7 +29,9 @@ ffigen: - '**CXString.h' - '**Index.h' - compiler-opts: '-Ithird_party/libclang/include -IC:\Progra~1\LLVM\include -I/usr/local/opt/llvm/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' + compiler-opts: + - '-Ithird_party/libclang/include' + - '-Wno-nullability-completeness' functions: include: - 'clang_.*' # Can be a regexp, '.' matches any character. diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 434137e799..673daeaa03 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -136,41 +136,14 @@ class Config { } } - /// Checks if there are nested [key] in [map]. - bool _checkKeyInYaml(List key, YamlMap map) { - dynamic last = map; - for (final k in key) { - if (last is YamlMap) { - if (!last.containsKey(k)) return false; - last = last[k]; - } else { - return false; - } - } - return last != null; - } - - /// Extracts value of nested [key] from [map]. - dynamic _getKeyValueFromYaml(List key, YamlMap map) { - if (_checkKeyInYaml(key, map)) { - dynamic last = map; - for (final k in key) { - last = last[k]; - } - return last; - } - - return null; - } - /// Validates Yaml according to given specs. bool _checkConfigs(YamlMap map, Map, Specification> specs) { var _result = true; for (final key in specs.keys) { final spec = specs[key]; - if (_checkKeyInYaml(key, map)) { + if (checkKeyInYaml(key, map)) { _result = - _result && spec!.validator(key, _getKeyValueFromYaml(key, map)); + _result && spec!.validator(key, getKeyValueFromYaml(key, map)); } else if (spec!.requirement == Requirement.yes) { _logger.severe("Key '$key' is required."); _result = false; @@ -195,8 +168,8 @@ class Config { void _extract(YamlMap map, Map, Specification> specs) { for (final key in specs.keys) { final spec = specs[key]; - if (_checkKeyInYaml(key, map)) { - spec!.extractedResult(spec.extractor(_getKeyValueFromYaml(key, map))); + if (checkKeyInYaml(key, map)) { + spec!.extractedResult(spec.extractor(getKeyValueFromYaml(key, map))); } else { spec!.extractedResult(spec.defaultValue?.call()); } @@ -235,6 +208,15 @@ class Config { extractedResult: (dynamic result) => _compilerOpts = result as List, ), + [strings.compilerOptsAuto]: Specification( + requirement: Requirement.no, + validator: compilerOptsAutoValidator, + extractor: compilerOptsAutoExtractor, + defaultValue: () => CompilerOptsAuto(), + extractedResult: (dynamic result) { + _compilerOpts + .addAll((result as CompilerOptsAuto).extractCompilerOpts()); + }), [strings.functions]: Specification( requirement: Requirement.no, validator: declarationConfigValidator, diff --git a/pkgs/ffigen/lib/src/config_provider/config_types.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart index 35d24f0ab9..0240c19c80 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_types.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart @@ -3,9 +3,12 @@ // BSD-style license that can be found in the LICENSE file. /// Contains all the neccesary classes required by config. +import 'dart:io'; import 'package:quiver/pattern.dart' as quiver; +import 'path_finder.dart'; + class CommentType { CommentStyle style; CommentLength length; @@ -319,3 +322,20 @@ class MemberRenamer { return member; } } + +/// Handles config for automatically added compiler options. +class CompilerOptsAuto { + final bool macIncludeStdLib; + + CompilerOptsAuto({bool? macIncludeStdLib}) + : macIncludeStdLib = macIncludeStdLib ?? true; + + /// Extracts compiler options based on OS and config. + List extractCompilerOpts() { + if (Platform.isMacOS && macIncludeStdLib) { + return getCStandardLibraryHeadersForMac(); + } + + return []; + } +} diff --git a/pkgs/ffigen/lib/src/config_provider/path_finder.dart b/pkgs/ffigen/lib/src/config_provider/path_finder.dart new file mode 100644 index 0000000000..3f6a59760c --- /dev/null +++ b/pkgs/ffigen/lib/src/config_provider/path_finder.dart @@ -0,0 +1,63 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// Utils for finding header paths on system. + +import 'dart:io'; + +import 'package:logging/logging.dart'; +import 'package:path/path.dart' as p; + +final _logger = Logger('ffigen.config_provider.path_finder'); + +/// This will return include path from either LLVM, XCode or CommandLineTools. +List getCStandardLibraryHeadersForMac() { + final includePaths = []; + + /// Add system headers. + const systemHeaders = + '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include'; + if (Directory(systemHeaders).existsSync()) { + _logger.fine('Added $systemHeaders to compiler-opts.'); + includePaths.add('-I' + systemHeaders); + } + + /// Find headers from XCode or LLVM installed via brew. + const brewLlvmPath = '/usr/local/opt/llvm/lib/clang'; + const xcodeClangPath = + '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/'; + const searchPaths = [brewLlvmPath, xcodeClangPath]; + for (final searchPath in searchPaths) { + if (!Directory(searchPath).existsSync()) continue; + + final result = Process.runSync('ls', [searchPath]); + final stdout = result.stdout as String; + if (stdout != '') { + final versions = stdout.split('\n').where((s) => s != ''); + for (final version in versions) { + final path = p.join(searchPath, version, 'include'); + if (Directory(path).existsSync()) { + _logger.fine('Added stdlib path: $path to compiler-opts.'); + includePaths.add('-I' + path); + return includePaths; + } + } + } + } + + /// If CommandLineTools are installed use those headers. + const cmdLineToolHeaders = + '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Headers/'; + if (Directory(cmdLineToolHeaders).existsSync()) { + _logger.fine('Added stdlib path: $cmdLineToolHeaders to compiler-opts.'); + includePaths.add('-I' + cmdLineToolHeaders); + return includePaths; + } + + // Warnings for missing headers are printed by libclang while parsing. + _logger.fine('Couldn\'t find stdlib headers in default locations.'); + _logger.fine('Paths searched: ${[cmdLineToolHeaders, ...searchPaths]}'); + + return []; +} diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 692f92197b..ce6aae5bd5 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -38,6 +38,33 @@ bool checkType(List keys, dynamic value) { return true; } +/// Checks if there are nested [key] in [map]. +bool checkKeyInYaml(List key, YamlMap map) { + dynamic last = map; + for (final k in key) { + if (last is YamlMap) { + if (!last.containsKey(k)) return false; + last = last[k]; + } else { + return false; + } + } + return last != null; +} + +/// Extracts value of nested [key] from [map]. +dynamic getKeyValueFromYaml(List key, YamlMap map) { + if (checkKeyInYaml(key, map)) { + dynamic last = map; + for (final k in key) { + last = last[k]; + } + return last; + } + + return null; +} + bool booleanExtractor(dynamic value) => value as bool; bool booleanValidator(List name, dynamic value) => @@ -120,11 +147,69 @@ List compilerOptsToList(String compilerOpts) { return list; } -List compilerOptsExtractor(dynamic value) => - compilerOptsToList(value as String); +List compilerOptsExtractor(dynamic value) { + if (value is String) { + return compilerOptsToList(value); + } + + final list = []; + for (final el in (value as YamlList)) { + if (el is String) { + list.addAll(compilerOptsToList(el)); + } + } + return list; +} -bool compilerOptsValidator(List name, dynamic value) => - checkType(name, value); +bool compilerOptsValidator(List name, dynamic value) { + if (value is String || value is YamlList) { + return true; + } else { + _logger.severe('Expected $name to be a String or List of String.'); + return false; + } +} + +CompilerOptsAuto compilerOptsAutoExtractor(dynamic value) { + return CompilerOptsAuto( + macIncludeStdLib: getKeyValueFromYaml( + [strings.macos, strings.includeCStdLib], + value as YamlMap, + ) as bool?, + ); +} + +bool compilerOptsAutoValidator(List name, dynamic value) { + var _result = true; + + if (!checkType(name, value)) { + return false; + } + + for (final oskey in (value as YamlMap).keys) { + if (oskey == strings.macos) { + if (!checkType([...name, oskey as String], value[oskey])) { + return false; + } + + for (final inckey in (value[oskey] as YamlMap).keys) { + if (inckey == strings.includeCStdLib) { + if (!checkType( + [...name, oskey, inckey as String], value[oskey][inckey])) { + _result = false; + } + } else { + _logger.severe("Unknown key '$inckey' in '$name -> $oskey."); + _result = false; + } + } + } else { + _logger.severe("Unknown key '$oskey' in '$name'."); + _result = false; + } + } + return _result; +} Headers headersExtractor(dynamic yamlConfig) { final entryPoints = []; @@ -169,7 +254,7 @@ bool headersValidator(List name, dynamic value) { return false; } if (!(value as YamlMap).containsKey(strings.entryPoints)) { - _logger.severe("Expected '$name -> ${strings.entryPoints}' to be a Map."); + _logger.severe("Required '$name -> ${strings.entryPoints}'."); return false; } else { for (final key in value.keys) { diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index a8473af69f..ff28679c65 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -62,6 +62,7 @@ List parseToBindings() { config.compilerOpts.add(strings.fparseAllComments); } + _logger.fine('CompilerOpts used: ${config.compilerOpts}'); clangCmdArgs = createDynamicStringArray(config.compilerOpts); cmdLen = config.compilerOpts.length; diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 885427dc95..a4f1d688ef 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -34,6 +34,12 @@ const includeDirectives = 'include-directives'; const compilerOpts = 'compiler-opts'; +const compilerOptsAuto = 'compiler-opts-automatic'; +// Sub-fields of compilerOptsAuto. +const macos = 'macos'; +// Sub-fields of macos. +const includeCStdLib = 'include-c-standard-library'; + // Declarations. const functions = 'functions'; const structs = 'structs'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 31048c4e7d..4104cd31b9 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.2.5 +version: 2.3.0 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/config_tests/compiler_opts_test.dart b/pkgs/ffigen/test/config_tests/compiler_opts_test.dart index a3aa1176c3..1c5493bbe8 100644 --- a/pkgs/ffigen/test/config_tests/compiler_opts_test.dart +++ b/pkgs/ffigen/test/config_tests/compiler_opts_test.dart @@ -2,8 +2,11 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:ffigen/ffigen.dart'; import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/config_provider/spec_utils.dart'; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:yaml/yaml.dart' as yaml; import 'package:test/test.dart'; late Library actual, expected; @@ -25,5 +28,19 @@ void main() { ], ); }); + test('Compiler Opts Automatic', () { + final config = Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Compiler Opts Test' +${strings.output}: 'unused' +${strings.headers}: + ${strings.entryPoints}: + - 'test/header_parser_tests/comment_markup.h' +${strings.compilerOptsAuto}: + ${strings.macos}: + ${strings.includeCStdLib}: false + ''') as yaml.YamlMap); + expect(config.compilerOpts.isEmpty, true); + }); }); } diff --git a/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart b/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart index 16387ff450..27ce68eb5a 100644 --- a/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart @@ -25,7 +25,7 @@ void main() { ${strings.name}: 'NativeLibrary' ${strings.description}: 'Dart_Handle Test' ${strings.output}: 'unused' -${strings.compilerOpts}: '-I${path.join(getSdkPath(), "include")} -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Headers/' +${strings.compilerOpts}: '-I${path.join(getSdkPath(), "include")}' ${strings.headers}: ${strings.entryPoints}: diff --git a/pkgs/ffigen/test/header_parser_tests/globals_test.dart b/pkgs/ffigen/test/header_parser_tests/globals_test.dart index db7bf8ea11..7da24140b3 100644 --- a/pkgs/ffigen/test/header_parser_tests/globals_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/globals_test.dart @@ -36,8 +36,7 @@ ${strings.globals}: - myInt - pointerToLongDouble - globalStruct -# Needed for stdbool.h in MacOS -${strings.compilerOpts}: '-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Headers/ -Wno-nullability-completeness' +${strings.compilerOpts}: '-Wno-nullability-completeness' ''') as yaml.YamlMap), ); }); diff --git a/pkgs/ffigen/test/large_integration_tests/large_test.dart b/pkgs/ffigen/test/large_integration_tests/large_test.dart index 697ea920fb..2815a1fc5e 100644 --- a/pkgs/ffigen/test/large_integration_tests/large_test.dart +++ b/pkgs/ffigen/test/large_integration_tests/large_test.dart @@ -79,8 +79,6 @@ ${strings.name}: SQLite ${strings.description}: Bindings to SQLite. ${strings.output}: unused ${strings.arrayWorkaround}: true -# Needed for stdarg.h in MacOS -${strings.compilerOpts}: '-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Headers/' ${strings.comments}: ${strings.style}: ${strings.any} ${strings.length}: ${strings.full} diff --git a/pkgs/ffigen/test/native_test/config.yaml b/pkgs/ffigen/test/native_test/config.yaml index 7abdce4bbd..6c7b239d70 100644 --- a/pkgs/ffigen/test/native_test/config.yaml +++ b/pkgs/ffigen/test/native_test/config.yaml @@ -16,5 +16,4 @@ headers: - '**native_test.c' array-workaround: true -# Needed for stdbool.h in MacOS -compiler-opts: '-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Headers/ -Wno-nullability-completeness' +compiler-opts: '-Wno-nullability-completeness' diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index ec4944637c..f61c097001 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -12,8 +12,9 @@ name: Clang description: Holds bindings to LibClang. output: 'lib/src/header_parser/clang_bindings/clang_bindings.dart' -sort: true -compiler-opts: '-Ithird_party/libclang/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' +compiler-opts: + - '-Ithird_party/libclang/include' + - '-Wno-nullability-completeness' headers: entry-points: - 'third_party/libclang/include/clang-c/Index.h' From 8d26a111681373e201f9cd208bf5f4bba0fe0c26 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 15 Mar 2021 19:43:51 +0530 Subject: [PATCH 076/276] [ffigen] Added key `llvm-path`. Deprecate `llvm-lib`. (#194) --- pkgs/ffigen/CHANGELOG.md | 4 ++ pkgs/ffigen/README.md | 9 +++-- .../lib/src/config_provider/config.dart | 15 +++++++- .../lib/src/config_provider/spec_utils.dart | 37 ++++++++++++++++++- pkgs/ffigen/lib/src/strings.dart | 4 ++ pkgs/ffigen/pubspec.yaml | 2 +- 6 files changed, 64 insertions(+), 7 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 40ae92a552..1f2afa4e53 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.4.0 +- Added new config key `llvm-path` that accepts a list of `path/to/llvm`. +- Deprecated config key `llvm-lib`. + # 2.3.0 - Added config key `compiler-opts-automatic -> macos -> include-c-standard-library` (default: true) to automatically find and add C standard library on macOS. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index e3faf97385..19cbf566c9 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -87,12 +87,15 @@ output: 'generated_bindings.dart' - - + + diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 673daeaa03..2830366065 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -181,12 +181,25 @@ class Config { /// Key: Name, Value: [Specification] Map, Specification> _getSpecs() { return , Specification>{ + //TODO: Deprecated, remove in next major update. [strings.llvmLib]: Specification( requirement: Requirement.no, validator: llvmLibValidator, extractor: llvmLibExtractor, + defaultValue: () => '', + extractedResult: (dynamic result) { + _libclangDylib = result as String; + }, + ), + [strings.llvmPath]: Specification( + requirement: Requirement.no, + validator: llvmPathValidator, + extractor: llvmPathExtractor, defaultValue: () => findDylibAtDefaultLocations(), - extractedResult: (dynamic result) => _libclangDylib = result as String, + extractedResult: (dynamic result) { + // If this key wasn't already set by `llvm-lib` use this result. + if (_libclangDylib.isEmpty) _libclangDylib = result as String; + }, ), [strings.output]: Specification( requirement: Requirement.yes, diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index ce6aae5bd5..68246b4ccc 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -302,7 +302,7 @@ String getDylibPath(String dylibParentFoler) { } /// Returns location of dynamic library by searching default locations. Logs -/// error and exits if not found. +/// error and throws an Exception if not found. String findDylibAtDefaultLocations() { String? k; if (Platform.isLinux) { @@ -326,7 +326,7 @@ String findDylibAtDefaultLocations() { _logger.severe("Couldn't find dynamic library in default locations."); _logger.severe( - "Please supply the path/to/llvm/lib in ffigen's config under the key 'llvm-lib'."); + "Please supply one or more path/to/llvm in ffigen's config under the key '${strings.llvmPath}'."); throw Exception("Couldn't find dynamic library in default locations."); } @@ -351,6 +351,8 @@ String llvmLibExtractor(dynamic value) { } bool llvmLibValidator(List name, dynamic value) { + _logger.warning( + 'Deprecated ${strings.llvmLib}: please use ${strings.llvmPath} instead.'); if (!checkType(name, value) || !Directory(value as String).existsSync()) { _logger.severe('Expected $name to be a valid folder Path.'); @@ -359,6 +361,37 @@ bool llvmLibValidator(List name, dynamic value) { return true; } +String llvmPathExtractor(dynamic value) { + // Extract libclang's dylib from user specified paths. + for (final path in (value as YamlList)) { + if (path is! String) continue; + final dylibPath = + findLibclangDylib(p.join(path, strings.dynamicLibParentName)); + if (dylibPath != null) { + _logger.fine('Found dynamic library at: $dylibPath'); + return dylibPath; + } + } + _logger.fine( + "Couldn't find dynamic library under paths specified by ${strings.llvmPath}."); + // Extract path from default locations. + try { + final res = findDylibAtDefaultLocations(); + return res; + } catch (e) { + _logger.severe( + "Couldn't find libclang dynamic library in specified locations."); + exit(1); + } +} + +bool llvmPathValidator(List name, dynamic value) { + if (!checkType(name, value)) { + return false; + } + return true; +} + String outputExtractor(dynamic value) => _replaceSeparators(value as String); bool outputValidator(List name, dynamic value) => diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index a4f1d688ef..dcbae34a20 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -23,6 +23,10 @@ String get dylibFileName { } const llvmLib = 'llvm-lib'; +const llvmPath = 'llvm-path'; + +/// Name of the parent folder of dynamic library `lib` or `bin` (on windows). +String get dynamicLibParentName => Platform.isWindows ? 'bin' : 'lib'; const output = 'output'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 4104cd31b9..bc514bf4e3 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.3.0 +version: 2.4.0 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. From 108d09f599d185aaa1e9dcc9dbac25326e0c16bf Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Wed, 24 Mar 2021 15:29:08 +0530 Subject: [PATCH 077/276] [ffigen] Add /usr/lib to default locations and update readme. (#196) --- pkgs/ffigen/CHANGELOG.md | 3 + pkgs/ffigen/README.md | 80 ++++++++++++------- .../example/libclang-example/pubspec.yaml | 2 +- .../lib/src/config_provider/spec_utils.dart | 2 +- pkgs/ffigen/lib/src/strings.dart | 3 +- pkgs/ffigen/pubspec.yaml | 2 +- 6 files changed, 60 insertions(+), 32 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 1f2afa4e53..b037c395e6 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.4.1 +- Added `/usr/lib` to default dynamic library location for linux. + # 2.4.0 - Added new config key `llvm-path` that accepts a list of `path/to/llvm`. - Deprecated config key `llvm-lib`. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 19cbf566c9..cc1aeacd29 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -21,15 +21,21 @@ ffigen: Output (_generated_bindings.dart_). ```dart class NativeLibrary { - final DynamicLibrary _dylib; - - NativeLibrary(DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + final Pointer Function(String symbolName) + _lookup; + NativeLibrary(DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + NativeLibrary.fromLookup( + Pointer Function(String symbolName) + lookup) + : _lookup = lookup; int sum(int a, int b) { - return (_sum ??= _dylib.lookupFunction<_c_sum, _dart_sum>('sum'))(a, b); + return _sum(a, b); } - _dart_sum? _sum; + late final _sum_ptr = _lookup>('sum'); + late final _dart_sum _sum = _sum_ptr.asFunction<_dart_sum>(); } typedef _c_sum = Int32 Function(Int32 a, Int32 b); typedef _dart_sum = int Function(int a, int b); @@ -77,7 +83,7 @@ The following configuration options are available- - + - + - - + + - - + + @@ -223,7 +246,7 @@ array-workaround: true @@ -243,7 +266,7 @@ comments: - + + + + + diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index e37a0629e0..c29313f6b7 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -5,9 +5,11 @@ import 'dart:io'; import 'package:cli_util/cli_util.dart'; +import 'package:ffigen/src/config_provider/config_types.dart'; import 'package:logging/logging.dart'; import 'package:path/path.dart' as p; import 'binding.dart'; +import 'struc.dart'; import 'utils.dart'; import 'writer.dart'; @@ -28,6 +30,7 @@ class Library { String? header, bool dartBool = true, bool sort = false, + StructPackingOverride? packingOverride, }) { if (sort) _sort(); @@ -38,6 +41,16 @@ class Library { _resolveIfNameConflicts(declConflictHandler, b); } + // Override pack values according to config. We do this after declaration + // conflicts have been handled so that users can target the generated names. + if (packingOverride != null) { + for (final b in bindings) { + if (b is Struc && packingOverride.isOverriden(b.name)) { + b.pack = packingOverride.getOverridenPackValue(b.name); + } + } + } + // Seperate bindings which require lookup. final lookUpBindings = bindings.whereType().toList(); final noLookUpBindings = bindings.whereType().toList(); diff --git a/pkgs/ffigen/lib/src/code_generator/struc.dart b/pkgs/ffigen/lib/src/code_generator/struc.dart index 2fc96d6184..37edfa0184 100644 --- a/pkgs/ffigen/lib/src/code_generator/struc.dart +++ b/pkgs/ffigen/lib/src/code_generator/struc.dart @@ -44,6 +44,9 @@ class Struc extends NoLookUpBinding { bool get isOpaque => members.isEmpty; + /// Value for `@Packed(X)` annotation. Can be null(no packing), 1, 2, 4, 8, 16. + int? pack; + /// Marker for checking if the dependencies are parsed. bool parsedDependencies = false; @@ -52,6 +55,7 @@ class Struc extends NoLookUpBinding { String? originalName, required String name, this.isInComplete = false, + this.pack, String? dartDoc, List? members, }) : members = members ?? [], @@ -105,6 +109,10 @@ class Struc extends NoLookUpBinding { /// to have the same name as the class. final localUniqueNamer = UniqueNamer({enclosingClassName}); + /// Write @Packed(X) annotation if struct is packed. + if (pack != null) { + s.write('@${w.ffiLibraryPrefix}.Packed($pack)\n'); + } // Write class declaration. s.write( 'class $enclosingClassName extends ${w.ffiLibraryPrefix}.${isOpaque ? 'Opaque' : 'Struct'}{\n'); diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 2830366065..cacc7fa2c3 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -80,6 +80,10 @@ class Config { StructDependencies get structDependencies => _structDependencies; late StructDependencies _structDependencies; + /// Holds config for how struct packing should be overriden. + StructPackingOverride get structPackingOverride => _structPackingOverride; + late StructPackingOverride _structPackingOverride; + /// If tool should generate array workarounds. /// /// If false(default), structs with inline array members will have all its @@ -335,6 +339,15 @@ class Config { extractedResult: (dynamic result) => _structDependencies = result as StructDependencies, ), + [strings.structs, strings.structPack]: + Specification( + requirement: Requirement.no, + validator: structPackingOverrideValidator, + extractor: structPackingOverrideExtractor, + defaultValue: () => StructPackingOverride(), + extractedResult: (dynamic result) => + _structPackingOverride = result as StructPackingOverride, + ), [strings.arrayWorkaround]: Specification( requirement: Requirement.no, validator: booleanValidator, diff --git a/pkgs/ffigen/lib/src/config_provider/config_types.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart index 0240c19c80..7fcc3526c3 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_types.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart @@ -31,6 +31,35 @@ enum CommentLength { none, brief, full } enum StructDependencies { full, opaque } +/// Holds config for how Structs Packing will be overriden. +class StructPackingOverride { + final Map _matcherMap; + + StructPackingOverride({Map? matcherMap}) + : _matcherMap = matcherMap ?? {}; + + /// Returns true if the user has overriden the pack value. + bool isOverriden(String name) { + for (final key in _matcherMap.keys) { + if (quiver.matchesFull(key, name)) { + return true; + } + } + return false; + } + + /// Returns pack value for [name]. Ensure that value [isOverriden] before + /// using the returned value. + int? getOverridenPackValue(String name) { + for (final opv in _matcherMap.entries) { + if (quiver.matchesFull(opv.key, name)) { + return opv.value; + } + } + return null; + } +} + /// Represents a single specification in configurations. /// /// [E] is the return type of the extractedResult. diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 6875af15f2..ff4a44a9fc 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -699,3 +699,30 @@ bool structDependenciesValidator(List name, dynamic value) { } return result; } + +StructPackingOverride structPackingOverrideExtractor(dynamic value) { + final matcherMap = {}; + for (final key in value.keys) { + matcherMap[RegExp(key as String, dotAll: true)] = + strings.packingValuesMap[value[key]]; + } + return StructPackingOverride(matcherMap: matcherMap); +} + +bool structPackingOverrideValidator(List name, dynamic value) { + var _result = true; + + if (!checkType([...name], value)) { + _result = false; + } else { + for (final key in value.keys) { + if (!(strings.packingValuesMap.keys.contains(value[key]))) { + _logger.severe( + "'$name -> $key' must be one of the following - ${strings.packingValuesMap.keys.toList()}"); + _result = false; + } + } + } + + return _result; +} diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 71c02c94e3..2c69fa75ec 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -376,6 +376,21 @@ class Clang { late final _dart_clang_getCursorKind _clang_getCursorKind = _clang_getCursorKind_ptr.asFunction<_dart_clang_getCursorKind>(); + /// Determine whether the given cursor has any attributes. + int clang_Cursor_hasAttrs( + CXCursor C, + ) { + return _clang_Cursor_hasAttrs( + C, + ); + } + + late final _clang_Cursor_hasAttrs_ptr = + _lookup>( + 'clang_Cursor_hasAttrs'); + late final _dart_clang_Cursor_hasAttrs _clang_Cursor_hasAttrs = + _clang_Cursor_hasAttrs_ptr.asFunction<_dart_clang_Cursor_hasAttrs>(); + /// Retrieve the physical location of the source constructor referenced /// by the given cursor. /// @@ -772,6 +787,30 @@ class Clang { late final _dart_clang_Type_getNamedType _clang_Type_getNamedType = _clang_Type_getNamedType_ptr.asFunction<_dart_clang_Type_getNamedType>(); + /// Return the alignment of a type in bytes as per C++[expr.alignof] + /// 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. + /// If the type declaration is not a constant size type, + /// CXTypeLayoutError_NotConstantSize is returned. + int clang_Type_getAlignOf( + CXType T, + ) { + return _clang_Type_getAlignOf( + T, + ); + } + + late final _clang_Type_getAlignOf_ptr = + _lookup>( + 'clang_Type_getAlignOf'); + late final _dart_clang_Type_getAlignOf _clang_Type_getAlignOf = + _clang_Type_getAlignOf_ptr.asFunction<_dart_clang_Type_getAlignOf>(); + /// Determine whether the given cursor represents an anonymous /// tag or namespace int clang_Cursor_isAnonymous( @@ -2690,6 +2729,14 @@ typedef _dart_clang_getCursorKind = int Function( CXCursor arg0, ); +typedef _c_clang_Cursor_hasAttrs = ffi.Uint32 Function( + CXCursor C, +); + +typedef _dart_clang_Cursor_hasAttrs = int Function( + CXCursor C, +); + typedef _c_clang_getCursorLocation = CXSourceLocation Function( CXCursor arg0, ); @@ -2870,6 +2917,14 @@ typedef _dart_clang_Type_getNamedType = CXType Function( CXType T, ); +typedef _c_clang_Type_getAlignOf = ffi.Int64 Function( + CXType T, +); + +typedef _dart_clang_Type_getAlignOf = int Function( + CXType T, +); + typedef _c_clang_Cursor_isAnonymous = ffi.Uint32 Function( CXCursor C, ); diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index ff28679c65..ddcd9c692c 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -30,6 +30,7 @@ Library parse(Config c) { header: config.preamble, dartBool: config.dartBool, sort: config.sort, + packingOverride: config.structPackingOverride, ); return library; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index d9c402327b..c27d8416c3 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -8,6 +8,7 @@ import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/config_provider/config_types.dart'; import 'package:logging/logging.dart'; +import '../../strings.dart' as strings; import '../clang_bindings/clang_bindings.dart' as clang_types; import '../data.dart'; import '../includer.dart'; @@ -33,6 +34,39 @@ class _ParsedStruc { (dartHandleMember && config.useDartHandle) || incompleteStructMember; + // A struct without any attribute is definitely not packed. #pragma pack(...) + // also adds an attribute, but it's unexposed and cannot be travesed. + bool hasAttr = false; + // A struct which as a __packed__ attribute is definitely packed. + bool hasPackedAttr = false; + // Stores the maximum alignment from all the children. + int maxChildAlignment = 0; + // Alignment of this struct. + int allignment = 0; + + bool get _isPacked { + if (!hasAttr || isInComplete) return false; + if (hasPackedAttr) return true; + + return maxChildAlignment > allignment; + } + + /// Returns pack value of a struct depending on config, returns null for no + /// packing. + int? get packValue { + if (_isPacked) { + if (strings.packingValuesMap.containsKey(allignment)) { + return allignment; + } else { + _logger.warning( + 'Unsupported pack value "$allignment" for Struct "${struc!.name}".'); + return null; + } + } else { + return null; + } + } + _ParsedStruc(); } @@ -62,7 +96,6 @@ Struc? parseStructDeclaration( if (isForwardDeclaration(cursor)) { cursor = clang.clang_getCursorDefinition(cursor); } - final structUsr = cursor.usr(); final structName = name ?? cursor.spelling(); @@ -119,8 +152,8 @@ Struc? parseStructDeclaration( } void _setStructMembers(clang_types.CXCursor cursor) { - _stack.top.arrayMember = false; - _stack.top.unimplementedMemberType = false; + _stack.top.hasAttr = clang.clang_Cursor_hasAttrs(cursor) != 0; + _stack.top.allignment = cursor.type().alignment(); final resultCode = clang.clang_visitChildren( cursor, @@ -129,6 +162,10 @@ void _setStructMembers(clang_types.CXCursor cursor) { nullptr, ); + _logger.finest( + 'Opaque: ${_stack.top.isInComplete}, HasAttr: ${_stack.top.hasAttr}, AlignValue: ${_stack.top.allignment}, MaxChildAlignValue: ${_stack.top.maxChildAlignment}, PackValue: ${_stack.top.packValue}.'); + _stack.top.struc!.pack = _stack.top.packValue; + visitChildrenResultChecker(resultCode); if (_stack.top.arrayMember && !config.arrayWorkaround) { @@ -183,6 +220,12 @@ int _structMembersVisitor(clang_types.CXCursor cursor, if (cursor.kind == clang_types.CXCursorKind.CXCursor_FieldDecl) { _logger.finer('===== member: ${cursor.completeStringRepr()}'); + // Set maxChildAlignValue. + final align = cursor.type().alignment(); + if (align > _stack.top.maxChildAlignment) { + _stack.top.maxChildAlignment = align; + } + final mt = cursor.type().toCodeGenType(); if (mt.broadType == BroadType.ConstantArray) { _stack.top.arrayMember = true; @@ -219,6 +262,8 @@ int _structMembersVisitor(clang_types.CXCursor cursor, type: mt, ), ); + } else if (cursor.kind == clang_types.CXCursorKind.CXCursor_PackedAttr) { + _stack.top.hasPackedAttr = true; } } catch (e, s) { _logger.severe(e); diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index e1b205c6d8..fda7f6580d 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -236,6 +236,10 @@ extension CXTypeExt on clang_types.CXType { return clang.clang_getTypeKindSpelling(kind()).toStringAndDispose(); } + int alignment() { + return clang.clang_Type_getAlignOf(this); + } + /// For debugging: returns [spelling] [kind] [kindSpelling]. String completeStringRepr() { final s = diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 2f592a2c6c..76ed9404e8 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -64,6 +64,16 @@ const structDependencies = 'dependency-only'; const fullStructDependencies = 'full'; const opaqueStructDependencies = 'opaque'; +const structPack = 'pack'; +const Map packingValuesMap = { + 'none': null, + 1: 1, + 2: 2, + 4: 4, + 8: 8, + 16: 16, +}; + const sizemap = 'size-map'; const typedefmap = 'typedef-map'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index d5ad721058..e761291e79 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,12 +3,12 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.4.2 +version: 2.5.0-beta.1 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.13.0-211.6.beta <3.0.0' dependencies: ffi: ^1.0.0 diff --git a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart index 806ae22173..7b0fa29a76 100644 --- a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart @@ -378,6 +378,32 @@ void main() { ); _matchLib(library, 'sort_bindings'); }); + test('Pack Structs', () { + final library = Library( + name: 'Bindings', + bindings: [ + Struc(name: 'NoPacking', pack: null, members: [ + Member(name: 'a', type: Type.nativeType(SupportedNativeType.Char)), + ]), + Struc(name: 'Pack1', pack: 1, members: [ + Member(name: 'a', type: Type.nativeType(SupportedNativeType.Char)), + ]), + Struc(name: 'Pack2', pack: 2, members: [ + Member(name: 'a', type: Type.nativeType(SupportedNativeType.Char)), + ]), + Struc(name: 'Pack2', pack: 4, members: [ + Member(name: 'a', type: Type.nativeType(SupportedNativeType.Char)), + ]), + Struc(name: 'Pack2', pack: 8, members: [ + Member(name: 'a', type: Type.nativeType(SupportedNativeType.Char)), + ]), + Struc(name: 'Pack16', pack: 16, members: [ + Member(name: 'a', type: Type.nativeType(SupportedNativeType.Char)), + ]), + ], + ); + _matchLib(library, 'packed_structs'); + }); } /// Utility to match expected bindings to the generated bindings. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart new file mode 100644 index 0000000000..9c647d7523 --- /dev/null +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart @@ -0,0 +1,39 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +class NoPacking extends ffi.Struct { + @ffi.Uint8() + external int a; +} + +@ffi.Packed(1) +class Pack1 extends ffi.Struct { + @ffi.Uint8() + external int a; +} + +@ffi.Packed(2) +class Pack2 extends ffi.Struct { + @ffi.Uint8() + external int a; +} + +@ffi.Packed(4) +class Pack2_1 extends ffi.Struct { + @ffi.Uint8() + external int a; +} + +@ffi.Packed(8) +class Pack2_2 extends ffi.Struct { + @ffi.Uint8() + external int a; +} + +@ffi.Packed(16) +class Pack16 extends ffi.Struct { + @ffi.Uint8() + external int a; +} diff --git a/pkgs/ffigen/test/config_tests/packed_struct_override_test.dart b/pkgs/ffigen/test/config_tests/packed_struct_override_test.dart new file mode 100644 index 0000000000..fd8be93834 --- /dev/null +++ b/pkgs/ffigen/test/config_tests/packed_struct_override_test.dart @@ -0,0 +1,62 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/ffigen.dart'; +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:yaml/yaml.dart' as yaml; +import 'package:test/test.dart'; + +import '../test_utils.dart'; + +late Library actual, expected; + +void main() { + group('packed_struct_override_test', () { + test('Invalid Packed Config values', () { + const baseYaml = '''${strings.name}: 'NativeLibrary' +${strings.description}: 'Packed Struct Override Test' +${strings.output}: 'unused' +${strings.headers}: + ${strings.entryPoints}: + - 'test/header_parser_tests/packed_structs.h' +${strings.structs}: + ${strings.structPack}: + '''; + expect( + () => Config.fromYaml( + yaml.loadYaml(baseYaml + "'.*': null") as yaml.YamlMap), + throwsA(TypeMatcher())); + expect( + () => Config.fromYaml( + yaml.loadYaml(baseYaml + "'.*': 3") as yaml.YamlMap), + throwsA(TypeMatcher())); + expect( + () => Config.fromYaml( + yaml.loadYaml(baseYaml + "'.*': 32") as yaml.YamlMap), + throwsA(TypeMatcher())); + }); + test('Override values', () { + final config = Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Packed Struct Override Test' +${strings.output}: 'unused' +${strings.headers}: + ${strings.entryPoints}: + - 'test/header_parser_tests/packed_structs.h' +${strings.structs}: + ${strings.structPack}: + 'Normal.*': 1 + 'StructWithAttr': 2 + 'PackedAttr': none + ''') as yaml.YamlMap); + + final library = parse(config); + + expect((library.getBinding('NormalStruct1') as Struc).pack, 1); + expect((library.getBinding('StructWithAttr') as Struc).pack, 2); + expect((library.getBinding('PackedAttr') as Struc).pack, null); + }); + }); +} diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_packed_structs_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_packed_structs_bindings.dart new file mode 100644 index 0000000000..d27adc4cc8 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_packed_structs_bindings.dart @@ -0,0 +1,49 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +class NormalStruct1 extends ffi.Struct { + @ffi.Int8() + external int a; +} + +/// Should not be packed. +class StructWithAttr extends ffi.Struct { + external ffi.Pointer a; + + external ffi.Pointer b; +} + +/// Should be packed with 1. +@ffi.Packed(1) +class PackedAttr extends ffi.Struct { + @ffi.Int32() + external int a; +} + +/// Should be packed with 8. +@ffi.Packed(8) +class PackedAttrAlign8 extends ffi.Struct { + @ffi.Int32() + external int a; +} + +/// Should be packed with 2. +@ffi.Packed(2) +class Pack2WithPragma extends ffi.Struct { + @ffi.Int32() + external int a; +} + +/// Should be packed with 4. +@ffi.Packed(4) +class Pack4WithPragma extends ffi.Struct { + @ffi.Int64() + external int a; +} + +class NormalStruct2 extends ffi.Struct { + @ffi.Int8() + external int a; +} diff --git a/pkgs/ffigen/test/header_parser_tests/packed_structs.h b/pkgs/ffigen/test/header_parser_tests/packed_structs.h new file mode 100644 index 0000000000..2edec80095 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/packed_structs.h @@ -0,0 +1,41 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +struct NormalStruct1 +{ + char a; +}; + +/// Should not be packed. +struct StructWithAttr +{ + int *a; + int *b; +} __attribute__((annotate("Attr is not __packed__"))); + +/// Should be packed with 1. +struct PackedAttr{ + int a; +} __attribute__((__packed__)); + +/// Should be packed with 8. +struct PackedAttrAlign8{ + int a; +} __attribute__((__packed__, aligned(8))); + +#pragma pack(push, 2) +/// Should be packed with 2. +struct Pack2WithPragma{ + int a; +}; +#pragma pack(4) +/// Should be packed with 4. +struct Pack4WithPragma{ + long long a; +}; +#pragma pack(pop) +struct NormalStruct2 +{ + char a; +}; diff --git a/pkgs/ffigen/test/header_parser_tests/packed_structs_test.dart b/pkgs/ffigen/test/header_parser_tests/packed_structs_test.dart new file mode 100644 index 0000000000..e334fab899 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/packed_structs_test.dart @@ -0,0 +1,45 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/config_provider.dart'; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; +import 'package:ffigen/src/strings.dart' as strings; + +import '../test_utils.dart'; + +late Library actual; +void main() { + group('packed_structs_test', () { + setUpAll(() { + logWarnings(Level.SEVERE); + actual = parser.parse( + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Packed Structs Test' +${strings.output}: 'unused' +${strings.headers}: + ${strings.entryPoints}: + - 'test/header_parser_tests/packed_structs.h' + ''') as yaml.YamlMap), + ); + }); + + test('Expected bindings', () { + matchLibraryWithExpected(actual, [ + 'test', + 'debug_generated', + 'packed_structs_test_output.dart' + ], [ + 'test', + 'header_parser_tests', + 'expected_bindings', + '_expected_packed_structs_bindings.dart' + ]); + }); + }); +} diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index f61c097001..87f6bb0c33 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -76,6 +76,7 @@ functions: - clang_getPointeeType - clang_getCanonicalType - clang_Type_getNamedType + - clang_Type_getAlignOf - clang_getTypeDeclaration - clang_getTypedefDeclUnderlyingType - clang_getCursorSpelling @@ -106,3 +107,4 @@ functions: - clang_Cursor_isFunctionInlined - clang_getCursorDefinition - clang_Cursor_isNull + - clang_Cursor_hasAttrs From 78cafc8f155765a9e9ea104a66606588f5e0b8d9 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 19 Apr 2021 13:29:46 +0530 Subject: [PATCH 082/276] [ffigen] Support for inline arrays in structs (#206) * Generates `Array` instead of workaround. * Removes `array-workaround` config. * Removes depreacted `llvm-lib` config. --- pkgs/ffigen/CHANGELOG.md | 5 + pkgs/ffigen/README.md | 86 ---- .../libclang-example/generated_bindings.dart | 384 +----------------- .../example/libclang-example/pubspec.yaml | 6 +- pkgs/ffigen/lib/src/README.md | 2 +- pkgs/ffigen/lib/src/code_generator/struc.dart | 183 +-------- .../lib/src/config_provider/config.dart | 27 +- .../lib/src/config_provider/spec_utils.dart | 22 - .../clang_bindings/clang_bindings.dart | 208 +--------- .../sub_parsers/structdecl_parser.dart | 12 +- pkgs/ffigen/lib/src/strings.dart | 3 - pkgs/ffigen/pubspec.yaml | 2 +- ...internal_conflict_resolution_bindings.dart | 53 +-- .../example_tests/libclang_example_test.dart | 1 - .../nested_parsing_test.dart | 1 - .../_expected_libclang_bindings.dart | 384 +----------------- .../_expected_sqlite_bindings.dart | 375 +---------------- .../large_integration_tests/large_test.dart | 3 - pkgs/ffigen/test/native_test/config.yaml | 1 - pkgs/ffigen/test/native_test/native_test.dart | 11 +- .../native_test/native_test_bindings.dart | 135 +----- pkgs/ffigen/tool/libclang_config.yaml | 1 - 22 files changed, 71 insertions(+), 1834 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 82b580772d..5139d6fd9b 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,8 @@ +# 3.0.0-beta.0 +- Added support for inline arrays in `Struct`s. +- Remove config key `array-workaround`. +- Remove deprecated key `llvm-lib` from config, Use `llvm-path` instead. + # 2.5.0-beta.1 - Added support for `Packed` structs. Packed annotations are generated automatically but can be overriden using `structs -> pack` config. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index d8cac98171..a008d37e97 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -249,18 +249,6 @@ structs: # Matches with the generated name. 'NoPackStruct': none # No packing '.*': 1 # Pack all structs with value 1 -``` - - - - - - @@ -402,80 +390,6 @@ size-map:
structs -> dependency-onlyIf `opaque`, generates empty `Opaque` structs if structs +were not included in config (but were added since they are a dependency) and +only passed by reference(pointer).
+ Options - full(default) | opaque
+
+ +```yaml +structs: + dependency-only: opaque ```
compiler-optsPass compiler options to clang.Pass compiler options to clang. You can also pass + these via the command line tool. ```yaml compiler-opts: '-I/usr/lib/llvm-9/include/' +``` +and/or via the command line - +```bash +dart run ffigen --compiler-opts "-I/headers +-L 'path/to/folder name/file'" ```
```yaml -compiler-opts: '-I/usr/lib/llvm-9/include/' +compiler-opts: + - '-I/usr/lib/llvm-9/include/' ``` and/or via the command line - ```bash dart run ffigen --compiler-opts "-I/headers -L 'path/to/folder name/file'" +``` +
compiler-opts-automatic -> macos -> include-c-standard-libraryTries to automatically find and add C standard library path to + compiler-opts on macos. + Default: true + + +```yaml +compiler-opts-automatic: + macos: + include-c-standard-library: false ```
llvm-libPath to llvm/lib folder. Required if ffigen is unable to find this at default locations.llvm-pathPath to llvm folder. ffigen will sequentially search all the specified paths. Required if ffigen is unable to find this at default locations. ```yaml -llvm-lib: '/usr/local/opt/llvm/lib' +llvm-path: + - '/usr/local/opt/llvm/lib' + - 'C:\Program Files\llvm` + - '/usr/lib/llvm-11' ```
output
(Required)
output
(Required)
Output path of the generated bindings. @@ -88,20 +94,24 @@ output: 'generated_bindings.dart'
llvm-pathPath to llvm folder. ffigen will sequentially search all the specified paths. Required if ffigen is unable to find this at default locations.Path to llvm folder.
ffigen will sequentially search + for `lib/libclang.so` on linux, `lib/libclang.dylib` on macOs and + `bin\libclang.dll` on windows, in the specified paths.
+ Required if ffigen is unable to find this at default locations.
```yaml llvm-path: - - '/usr/local/opt/llvm/lib' + - '/usr/local/opt/llvm' - 'C:\Program Files\llvm` - '/usr/lib/llvm-11' ```
headers
(Required)
The header entry-points and include-directives. Glob syntax is allowed.headers
(Required)
The header entry-points and include-directives. Glob syntax is allowed.
+ If include-directives are not specified ffigen will generate everything directly/transitively under the entry-points.
```yaml @@ -156,7 +166,7 @@ dart run ffigen --compiler-opts "-I/headers
compiler-opts-automatic -> macos -> include-c-standard-library Tries to automatically find and add C standard library path to - compiler-opts on macos. + compiler-opts on macos.
Default: true
@@ -169,23 +179,32 @@ compiler-opts-automatic:
functions
structs
enums
unnamed-enums
macros
globals
Filters for declarations.
Default: all are included
functions

structs

enums

unnamed-enums

macros

globals
Filters for declarations.
Default: all are included.

+ Options -
+ - Include/Exclude declarations.
+ - Rename declarations.
+ - Rename enum and struct members.
+ - Expose symbol-address and typedef for functions and globals.
+
```yaml functions: include: # 'exclude' is also available. - - [a-z][a-zA-Z0-9]* # Matches using regexp. - - prefix.* # '.' matches any character. - - someFuncName # Matches with exact name - - anotherName # Full names have higher priority. + # Matches using regexp. + - [a-z][a-zA-Z0-9]* + # '.' matches any character. + - prefix.* + # Matches with exact name + - someFuncName + # Full names have higher priority. + - anotherName rename: # Regexp groups based replacement. 'clang_(.*)': '$1' - # full name matches have higher priority. 'clang_dispose': 'dispose' - # Removes '_' from beginning of a name. + # Removes '_' from beginning. '_(.*)': '$1' symbol-address: # Used to expose symbol and typedef. @@ -194,16 +213,20 @@ functions: enums: member-rename: '(.*)': # Matches any enum. - # Removes '_' from beginning enum member name. + # Removes '_' from beginning + # enum member name. '_(.*)': '$1' - 'CXTypeKind': # Full names have higher priority. - # $1 keeps only the 1st group i.e '(.*)'. + # Full names have higher priority. + 'CXTypeKind': + # $1 keeps only the 1st + # group i.e only '(.*)'. 'CXType(.*)': '$1' globals: exclude: - aGlobal rename: - # Removes '_' from beginning of a name. + # Removes '_' from + # beginning of a name. '_(.*)': '$1' ```
comments Extract documentation comments for declarations.
- The style and length of the comments can be specified with the following options.
+ The style and length of the comments recognized can be specified with the following options-
style: doxygen(default) | any
length: brief | full(default)
If you want to disable all comments you can also pass
@@ -233,7 +256,7 @@ array-workaround: true ```yaml comments: - style: doxygen + style: any length: full ```
If `opaque`, generates empty `Opaque` structs if structs were not included in config (but were added since they are a dependency) and only passed by reference(pointer).
- Options - full(default) | opaque
+ Options - full(default) | opaque
@@ -279,7 +302,7 @@ use-supported-typedefs: true
dart-boolShould generate dart `bool` for c99 bool in functions.
+
Should generate dart `bool` instead of Uint8 for c99 bool in functions.
Default: true
@@ -338,7 +361,8 @@ typedef-map: ```yaml # These are optional and also default, -# Omitting any and the default will be used. +# Omitting any and the default +# will be used. size-map: char: 1 unsigned char: 1 diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index a7cbf4a5c6..e048fe5764 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -30,7 +30,7 @@ ffigen: - '**Index.h' compiler-opts: - - '-Ithird_party/libclang/include' + - '-I../../third_party/libclang/include' - '-Wno-nullability-completeness' functions: include: diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 68246b4ccc..6875af15f2 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -380,7 +380,7 @@ String llvmPathExtractor(dynamic value) { return res; } catch (e) { _logger.severe( - "Couldn't find libclang dynamic library in specified locations."); + "Couldn't find ${p.join(strings.dynamicLibParentName, strings.dylibFileName)} in specified locations."); exit(1); } } diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index dcbae34a20..2f592a2c6c 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -146,7 +146,8 @@ const libclang_dylib_windows = 'libclang.dll'; const linuxDylibLocations = [ '/usr/lib/llvm-9/lib/', '/usr/lib/llvm-10/lib/', - '/usr/lib/llvm-11/lib/' + '/usr/lib/llvm-11/lib/', + '/usr/lib/' ]; const windowsDylibLocations = [ r'C:\Program Files\LLVM\bin\', diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index bc514bf4e3..deb1c68c61 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.4.0 +version: 2.4.1 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. From 14f7c969f42d730711ab967e24a5df1938c80e3f Mon Sep 17 00:00:00 2001 From: Hannes Winkler Date: Tue, 6 Apr 2021 10:34:44 +0200 Subject: [PATCH 078/276] [ffigen] Support Char_U type kind (#202) --- .../lib/src/header_parser/type_extractor/cxtypekindmap.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart index 0fe81aa134..7c7a936d31 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart @@ -24,6 +24,7 @@ var cxTypeKindToSupportedNativeTypes = { clang.CXTypeKind.CXType_Float: SupportedNativeType.Float, clang.CXTypeKind.CXType_Double: SupportedNativeType.Double, clang.CXTypeKind.CXType_Char_S: SupportedNativeType.Int8, + clang.CXTypeKind.CXType_Char_U: SupportedNativeType.Uint8, clang.CXTypeKind.CXType_Enum: SupportedNativeType.Int32, }; From 6152bb4470922f281f6982276e708a9c2a09c256 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Tue, 6 Apr 2021 14:16:24 +0530 Subject: [PATCH 079/276] [ffigen] Fix error caused by duplicate declaration names and collision with ffi library prefix (#200) --- pkgs/ffigen/CHANGELOG.md | 5 ++ .../lib/src/code_generator/library.dart | 21 +++---- .../ffigen/lib/src/code_generator/writer.dart | 59 +++++++++++++++---- pkgs/ffigen/pubspec.yaml | 2 +- .../decl_decl_collision_test.dart | 25 ++++++++ 5 files changed, 84 insertions(+), 28 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index b037c395e6..1b811cc61c 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,8 @@ +# 2.4.2 +- Fix issues due to declarations having duplicate names. +- Fix name conflict of declaration with ffi library prefix. +- Fix `char` not being recognized on platforms where it's unsigned by default. + # 2.4.1 - Added `/usr/lib` to default dynamic library location for linux. diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index d83a19d948..e37a0629e0 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -31,23 +31,16 @@ class Library { }) { if (sort) _sort(); - // Seperate bindings which require lookup. - final lookUpBindings = bindings.whereType().toList(); - final noLookUpBindings = bindings.whereType().toList(); - - /// Handle any declaration-declaration name conflict in [lookUpBindings]. - final lookUpDeclConflictHandler = UniqueNamer({}); - for (final b in lookUpBindings) { + /// Handle any declaration-declaration name conflicts. + final declConflictHandler = UniqueNamer({}); + for (final b in bindings) { _warnIfPrivateDeclaration(b); - _resolveIfNameConflicts(lookUpDeclConflictHandler, b); + _resolveIfNameConflicts(declConflictHandler, b); } - /// Handle any declaration-declaration name conflict in [noLookUpBindings]. - final noLookUpDeclConflictHandler = UniqueNamer({}); - for (final b in noLookUpBindings) { - _warnIfPrivateDeclaration(b); - _resolveIfNameConflicts(noLookUpDeclConflictHandler, b); - } + // Seperate bindings which require lookup. + final lookUpBindings = bindings.whereType().toList(); + final noLookUpBindings = bindings.whereType().toList(); _writer = Writer( lookUpBindings: lookUpBindings, diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index 03c36470f3..10d1d57328 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -70,23 +70,42 @@ class Writer { final allLevelsUniqueNamer = UniqueNamer(allNameSet); /// Wrapper class name must be unique among all names. - _className = allLevelsUniqueNamer.makeUnique(className); - _initialWrapperLevelUniqueNamer.markUsed(_className); - _initialTopLevelUniqueNamer.markUsed(_className); - - /// [_ffiLibraryPrefix] should be unique in top level. - _ffiLibraryPrefix = _initialTopLevelUniqueNamer.makeUnique('ffi'); + _className = _resolveNameConflict( + name: className, + makeUnique: allLevelsUniqueNamer, + markUsed: [_initialWrapperLevelUniqueNamer, _initialTopLevelUniqueNamer], + ); + + /// [_ffiLibraryPrefix] should be unique unique among all names. + _ffiLibraryPrefix = _resolveNameConflict( + name: 'ffi', + makeUnique: allLevelsUniqueNamer, + markUsed: [_initialWrapperLevelUniqueNamer, _initialTopLevelUniqueNamer], + ); /// [_lookupFuncIdentifier] should be unique in top level. - _lookupFuncIdentifier = _initialTopLevelUniqueNamer.makeUnique('_lookup'); + _lookupFuncIdentifier = _resolveNameConflict( + name: '_lookup', + makeUnique: _initialTopLevelUniqueNamer, + markUsed: [_initialTopLevelUniqueNamer], + ); /// Resolve name conflicts of identifiers used for SymbolAddresses. - _symbolAddressClassName = - allLevelsUniqueNamer.makeUnique('_SymbolAddresses'); - _symbolAddressVariableName = - _initialWrapperLevelUniqueNamer.makeUnique('addresses'); - _symbolAddressLibraryVarName = - _initialWrapperLevelUniqueNamer.makeUnique('_library'); + _symbolAddressClassName = _resolveNameConflict( + name: '_SymbolAddresses', + makeUnique: allLevelsUniqueNamer, + markUsed: [_initialWrapperLevelUniqueNamer, _initialTopLevelUniqueNamer], + ); + _symbolAddressVariableName = _resolveNameConflict( + name: 'addresses', + makeUnique: _initialWrapperLevelUniqueNamer, + markUsed: [_initialWrapperLevelUniqueNamer], + ); + _symbolAddressLibraryVarName = _resolveNameConflict( + name: '_library', + makeUnique: _initialWrapperLevelUniqueNamer, + markUsed: [_initialWrapperLevelUniqueNamer], + ); /// Finding a unique prefix for Array Helper Classes and store into /// [_arrayHelperClassPrefix]. @@ -105,6 +124,20 @@ class Writer { _resetUniqueNamersNamers(); } + /// Resolved name conflict using [makeUnique] and marks the result as used in + /// all [markUsed]. + String _resolveNameConflict({ + required String name, + required UniqueNamer makeUnique, + List markUsed = const [], + }) { + final s = makeUnique.makeUnique(name); + for (final un in markUsed) { + un.markUsed(s); + } + return s; + } + /// Resets the namers to initial state. Namers are reset before generating. void _resetUniqueNamersNamers() { _topLevelUniqueNamer = _initialTopLevelUniqueNamer.clone(); diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index deb1c68c61..d5ad721058 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.4.1 +version: 2.4.2 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart index 554795ecc8..fb6645fea6 100644 --- a/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart @@ -36,6 +36,20 @@ void main() { rawType: 'int', rawValue: '0', ), + + /// Conflicts across declarations. + Struc(name: 'testCrossDecl'), + Func( + name: 'testCrossDecl', + returnType: Type.nativeType(SupportedNativeType.Void)), + Constant(name: 'testCrossDecl', rawValue: '0', rawType: 'int'), + EnumClass(name: 'testCrossDecl'), + + /// Conflicts with ffi library prefix, name of prefix is changed. + Struc(name: 'ffi'), + Func( + name: 'ffi_1', + returnType: Type.nativeType(SupportedNativeType.Void)), ]); final l2 = Library(name: 'Bindings', bindings: [ Struc(name: 'TestStruc'), @@ -62,6 +76,17 @@ void main() { rawType: 'int', rawValue: '0', ), + Struc(name: 'testCrossDecl', originalName: 'testCrossDecl'), + Func( + name: 'testCrossDecl_1', + originalName: 'testCrossDecl', + returnType: Type.nativeType(SupportedNativeType.Void)), + Constant(name: 'testCrossDecl_2', rawValue: '0', rawType: 'int'), + EnumClass(name: 'testCrossDecl_3'), + Struc(name: 'ffi'), + Func( + name: 'ffi_1', + returnType: Type.nativeType(SupportedNativeType.Void)), ]); expect(l1.generate(), l2.generate()); From 1d65b28497171a59f3b18981a0f58df130a0a533 Mon Sep 17 00:00:00 2001 From: Franklin Yow <58489007+franklinyow@users.noreply.github.com> Date: Wed, 7 Apr 2021 01:05:59 -0700 Subject: [PATCH 080/276] [ffigen] Update LICENSE (#203) Changes to comply with internal review --- pkgs/ffigen/LICENSE | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/ffigen/LICENSE b/pkgs/ffigen/LICENSE index 18daf2b5bd..467a982862 100644 --- a/pkgs/ffigen/LICENSE +++ b/pkgs/ffigen/LICENSE @@ -1,4 +1,5 @@ -Copyright 2020, the Dart project authors. All rights reserved. +Copyright 2020, the Dart project authors. + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -9,7 +10,7 @@ met: copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. From 9f8e6d4f7311e5cb6081a77b758c729a08dba688 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Fri, 16 Apr 2021 21:33:09 +0530 Subject: [PATCH 081/276] [ffigen] Support for Packed struct (#205) --- .../ffigen/.github/workflows/test-package.yml | 4 +- pkgs/ffigen/CHANGELOG.md | 5 ++ pkgs/ffigen/README.md | 21 +++++++ .../lib/src/code_generator/library.dart | 13 ++++ pkgs/ffigen/lib/src/code_generator/struc.dart | 8 +++ .../lib/src/config_provider/config.dart | 13 ++++ .../lib/src/config_provider/config_types.dart | 29 +++++++++ .../lib/src/config_provider/spec_utils.dart | 27 ++++++++ .../clang_bindings/clang_bindings.dart | 55 ++++++++++++++++ pkgs/ffigen/lib/src/header_parser/parser.dart | 1 + .../sub_parsers/structdecl_parser.dart | 51 ++++++++++++++- pkgs/ffigen/lib/src/header_parser/utils.dart | 4 ++ pkgs/ffigen/lib/src/strings.dart | 10 +++ pkgs/ffigen/pubspec.yaml | 4 +- .../code_generator_test.dart | 26 ++++++++ .../_expected_packed_structs_bindings.dart | 39 ++++++++++++ .../packed_struct_override_test.dart | 62 +++++++++++++++++++ .../_expected_packed_structs_bindings.dart | 49 +++++++++++++++ .../test/header_parser_tests/packed_structs.h | 41 ++++++++++++ .../packed_structs_test.dart | 45 ++++++++++++++ pkgs/ffigen/tool/libclang_config.yaml | 2 + 21 files changed, 502 insertions(+), 7 deletions(-) create mode 100644 pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart create mode 100644 pkgs/ffigen/test/config_tests/packed_struct_override_test.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_packed_structs_bindings.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/packed_structs.h create mode 100644 pkgs/ffigen/test/header_parser_tests/packed_structs_test.dart diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 2ee8d6af76..642fed714f 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: [2.12.0] + sdk: [2.13.0-211.6.beta] # TODO: revert to 2.13. steps: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1.0 @@ -43,7 +43,7 @@ jobs: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1.0 with: - sdk: 2.12.0 + sdk: 2.13.0-211.6.beta # TODO: revert to 2.13. - name: Install dependencies run: dart pub get - name: Install libclang-10-dev diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 1b811cc61c..82b580772d 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,8 @@ +# 2.5.0-beta.1 +- Added support for `Packed` structs. Packed annotations are generated +automatically but can be overriden using `structs -> pack` config. +- Updated sdk constraints to `>=2.13.0-211.6.beta`. + # 2.4.2 - Fix issues due to declarations having duplicate names. - Fix name conflict of declaration with ffi library prefix. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index cc1aeacd29..d8cac98171 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -228,6 +228,27 @@ globals: # Removes '_' from # beginning of a name. '_(.*)': '$1' +``` +
structs -> packOverride the @Packed(X) annotation for generated structs.

+ Options - none, 1, 2, 4, 8, 16
+ You can use RegExp to match with the generated names.

+ Note: Ffigen can only reliably identify packing specified using + __attribute__((__packed__)). However, structs packed using + `#pragma pack(...)` or any other way could potentially be incorrect + in which case you can override the generated annotations. +
+ +```yaml +structs: + pack: + # Matches with the generated name. + 'NoPackStruct': none # No packing + '.*': 1 # Pack all structs with value 1 ```
array-workaroundShould generate workaround for fixed arrays in Structs. See Array Workaround
- Default: false -
- -```yaml -array-workaround: true ```
-## Array-Workaround -Fixed size array's in structs aren't currently supported by Dart. However we provide -a workaround, using which array items can now be accessed using `[]` operator. - -Here's a C structure from libclang- -```c -typedef struct { - unsigned long long data[3]; -} CXFileUniqueID; -``` -The generated code is - -```dart -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.'); - } - } -} -``` - ## Limitations 1. Multi OS support for types such as long. [Issue #7](https://github.com/dart-lang/ffigen/issues/7) diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index cd366f3ca8..71fa196b83 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -7928,64 +7928,8 @@ abstract class CXGlobalOptFlags { /// 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.'); - } - } + @ffi.Array.multi([3]) + external ffi.Array data; } /// Identifies a specific source location within a translation @@ -7994,70 +7938,21 @@ class ArrayHelper_CXFileUniqueID_data_level0 { /// 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; + @ffi.Array.multi([2]) + external ffi.Array> ptr_data; - /// 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; + @ffi.Array.multi([2]) + external ffi.Array> ptr_data; - /// 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; @@ -8065,49 +7960,6 @@ class CXSourceRange extends ffi.Struct { 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. @@ -8159,61 +8011,8 @@ class CXCursor extends ffi.Struct { @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.'); - } - } + @ffi.Array.multi([3]) + external ffi.Array> data; } /// Describes the availability of a given entity on a particular platform, e.g., @@ -8382,127 +8181,18 @@ 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.'); - } - } + @ffi.Array.multi([2]) + external ffi.Array> data; } /// 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; + @ffi.Array.multi([4]) + external ffi.Array int_data; - /// 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. @@ -8544,59 +8234,13 @@ class CXCursorAndRangeVisitor extends ffi.Struct { /// 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; + @ffi.Array.multi([2]) + external ffi.Array> ptr_data; - /// 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. diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index e048fe5764..bf0695e9bf 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -18,7 +18,8 @@ ffigen: # sort: true # This is required if LLVM can't be found in default locations by ffigen. - # llvm-lib: '/usr/local/opt/llvm/lib' + # llvm-path: + # - '/usr/local/opt/llvm' # Bash style Glob matching is also supported. # TODO(11): Globs dont work on windows if they begin with '.' or '..'. @@ -66,9 +67,6 @@ ffigen: description: 'Holds bindings to LibClang.' - # False by default. - array-workaround: true - # Doc Comments for generated binings. # Comments can be disabled by using comments: false comments: diff --git a/pkgs/ffigen/lib/src/README.md b/pkgs/ffigen/lib/src/README.md index 7564006dfc..2b20f84e88 100644 --- a/pkgs/ffigen/lib/src/README.md +++ b/pkgs/ffigen/lib/src/README.md @@ -22,7 +22,7 @@ This is the main entry point for the user- `dart run ffigen`. - `--verbose`: Sets log level. - `--config`: Specifies a config file. - The internal modules are called by `ffigen.dart` in the following way: -- `ffigen.dart` will try to find dynamic library in default locations. If that fails, the user must excplicitly specify location in ffigen's config under the key `llvm-lib`. +- `ffigen.dart` will try to find dynamic library in default locations. If that fails, the user must excplicitly specify location in ffigen's config under the key `llvm-path`. - It first creates a `Config` object from an input Yaml file. This is used by other modules. - The `parse` method is then invoked to generate a `Library` object. - Finally, the code is generated from the `Library` object to the specified file. diff --git a/pkgs/ffigen/lib/src/code_generator/struc.dart b/pkgs/ffigen/lib/src/code_generator/struc.dart index 37edfa0184..8b878919fe 100644 --- a/pkgs/ffigen/lib/src/code_generator/struc.dart +++ b/pkgs/ffigen/lib/src/code_generator/struc.dart @@ -76,6 +76,13 @@ class Struc extends NoLookUpBinding { return array; } + String _getInlineArrayTypeString(Type type, Writer w) { + if (type.broadType == BroadType.ConstantArray) { + return '${w.ffiLibraryPrefix}.Array<${_getInlineArrayTypeString(type.child!, w)}>'; + } + return type.getCType(w); + } + List? _typedefDependencies; @override List getTypedefDependencies(Writer w) { @@ -101,10 +108,6 @@ class Struc extends NoLookUpBinding { s.write(makeDartDoc(dartDoc!)); } - final helpers = []; - - final expandedArrayItemPrefix = getUniqueExpandedArrayItemPrefix(); - /// Adding [enclosingClassName] because dart doesn't allow class member /// to have the same name as the class. final localUniqueNamer = UniqueNamer({enclosingClassName}); @@ -116,23 +119,15 @@ class Struc extends NoLookUpBinding { // Write class declaration. s.write( 'class $enclosingClassName extends ${w.ffiLibraryPrefix}.${isOpaque ? 'Opaque' : 'Struct'}{\n'); + const depth = ' '; for (final m in members) { final memberName = localUniqueNamer.makeUnique(m.name); if (m.type.broadType == BroadType.ConstantArray) { - // TODO(5): Remove array helpers when inline array support arives. - final arrayHelper = ArrayHelper( - helperClassGroupName: - '${w.arrayHelperClassPrefix}_${enclosingClassName}_$memberName', - elementType: m.type.getBaseArrayType(), - dimensions: _getArrayDimensionLengths(m.type), - name: memberName, - structName: enclosingClassName, - elementNamePrefix: '$expandedArrayItemPrefix${memberName}_item_', - ); - s.write(arrayHelper.declarationString(w)); - helpers.add(arrayHelper); + s.write( + '$depth@${w.ffiLibraryPrefix}.Array.multi(${_getArrayDimensionLengths(m.type)})\n'); + s.write( + '${depth}external ${_getInlineArrayTypeString(m.type, w)} $memberName;\n\n'); } else { - const depth = ' '; if (m.dartDoc != null) { s.write(depth + '/// '); s.writeAll(m.dartDoc!.split('\n'), '\n' + depth + '/// '); @@ -146,28 +141,8 @@ class Struc extends NoLookUpBinding { } s.write('}\n\n'); - for (final helper in helpers) { - s.write(helper.helperClassString(w)); - } - return BindingString(type: BindingStringType.struc, string: s.toString()); } - - /// Gets a unique prefix in local namespace for expanded array items. - String getUniqueExpandedArrayItemPrefix() { - final base = '_unique'; - var expandedArrayItemPrefix = base; - var suffixInt = 0; - for (var i = 0; i < members.length; i++) { - if (members[i].name.startsWith(expandedArrayItemPrefix)) { - // Not a unique prefix, start over with a new suffix. - i = -1; - suffixInt++; - expandedArrayItemPrefix = '$base$suffixInt'; - } - } - return expandedArrayItemPrefix + '_'; - } } class Member { @@ -183,137 +158,3 @@ class Member { this.dartDoc, }) : originalName = originalName ?? name; } - -// Helper bindings for struct array. -class ArrayHelper { - final Type elementType; - final List dimensions; - final String? structName; - - final String? name; - final String helperClassGroupName; - final String elementNamePrefix; - - int? _expandedArrayLength; - int get expandedArrayLength { - if (_expandedArrayLength != null) return _expandedArrayLength!; - - var arrayLength = 1; - for (final i in dimensions) { - arrayLength = arrayLength * i; - } - return arrayLength; - } - - ArrayHelper({ - required this.elementType, - required this.dimensions, - required this.structName, - required this.name, - required this.helperClassGroupName, - required this.elementNamePrefix, - }); - - /// Create declaration binding, added inside the struct binding. - String declarationString(Writer w) { - final s = StringBuffer(); - final arrayDartType = elementType.getDartType(w); - final arrayCType = elementType.getCType(w); - - for (var i = 0; i < expandedArrayLength; i++) { - if (elementType.isPrimitive) { - s.write(' @$arrayCType()\n'); - } - s.write(' external $arrayDartType $elementNamePrefix$i;\n'); - } - - s.write('/// Helper for array `$name`.\n'); - s.write( - '${helperClassGroupName}_level0 get $name => ${helperClassGroupName}_level0(this, $dimensions, 0, 0);\n'); - - return s.toString(); - } - - String helperClassString(Writer w) { - final s = StringBuffer(); - final arrayType = elementType.getDartType(w); - for (var dim = 0; dim < dimensions.length; dim++) { - final helperClassName = '${helperClassGroupName}_level$dim'; - final structIdentifier = '_struct'; - final dimensionsIdentifier = 'dimensions'; - final levelIdentifier = 'level'; - final absoluteIndexIdentifier = '_absoluteIndex'; - final checkBoundsFunctionIdentifier = '_checkBounds'; - final legthIdentifier = 'length'; - - s.write('/// Helper for array `$name` in struct `$structName`.\n'); - - // Write class declaration. - s.write('class $helperClassName{\n'); - s.write('final $structName $structIdentifier;\n'); - s.write('final List $dimensionsIdentifier;\n'); - s.write('final int $levelIdentifier;\n'); - s.write('final int $absoluteIndexIdentifier;\n'); - s.write( - 'int get $legthIdentifier => $dimensionsIdentifier[$levelIdentifier];\n'); - - // Write class constructor. - s.write( - '$helperClassName(this.$structIdentifier, this.$dimensionsIdentifier, this.$levelIdentifier, this.$absoluteIndexIdentifier);\n'); - - // Write checkBoundsFunction. - s.write(''' - void $checkBoundsFunctionIdentifier(int index) { - if (index >= $legthIdentifier || index < 0) { - throw RangeError('Dimension \$$levelIdentifier: index not in range 0..\$$legthIdentifier exclusive.'); - } - } - '''); - // If this isn't the last level. - if (dim + 1 != dimensions.length) { - // Override [] operator. - s.write(''' - ${helperClassGroupName}_level${dim + 1} operator [](int index) { - $checkBoundsFunctionIdentifier(index); - var offset = index; - for (var i = level + 1; i < $dimensionsIdentifier.length; i++) { - offset *= $dimensionsIdentifier[i]; - } - return ${helperClassGroupName}_level${dim + 1}( - $structIdentifier, $dimensionsIdentifier, $levelIdentifier + 1, $absoluteIndexIdentifier + offset); - } -'''); - } else { - // This is the last level, add switching logic here. - // Override [] operator. - s.write('$arrayType operator[](int index){\n'); - s.write('$checkBoundsFunctionIdentifier(index);\n'); - s.write('switch($absoluteIndexIdentifier+index){\n'); - for (var i = 0; i < expandedArrayLength; i++) { - s.write('case $i:\n'); - s.write(' return $structIdentifier.$elementNamePrefix$i;\n'); - } - s.write('default:\n'); - s.write(" throw Exception('Invalid Array Helper generated.');"); - s.write('}\n'); - s.write('}\n'); - - // Override []= operator. - s.write('void operator[]=(int index, $arrayType value){\n'); - s.write('$checkBoundsFunctionIdentifier(index);\n'); - s.write('switch($absoluteIndexIdentifier+index){\n'); - for (var i = 0; i < expandedArrayLength; i++) { - s.write('case $i:\n'); - s.write(' $structIdentifier.$elementNamePrefix$i = value;\n'); - s.write(' break;\n'); - } - s.write('default:\n'); - s.write(" throw Exception('Invalid Array Helper generated.');\n"); - s.write('}\n'); - s.write('}\n'); - } - s.write('}\n'); - } - return s.toString(); - } -} diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index cacc7fa2c3..e42ed46494 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -84,13 +84,6 @@ class Config { StructPackingOverride get structPackingOverride => _structPackingOverride; late StructPackingOverride _structPackingOverride; - /// If tool should generate array workarounds. - /// - /// If false(default), structs with inline array members will have all its - /// members removed. - bool get arrayWorkaround => _arrayWorkaround; - late bool _arrayWorkaround; - /// If dart bool should be generated for C booleans. bool get dartBool => _dartBool; late bool _dartBool; @@ -185,24 +178,13 @@ class Config { /// Key: Name, Value: [Specification] Map, Specification> _getSpecs() { return , Specification>{ - //TODO: Deprecated, remove in next major update. - [strings.llvmLib]: Specification( - requirement: Requirement.no, - validator: llvmLibValidator, - extractor: llvmLibExtractor, - defaultValue: () => '', - extractedResult: (dynamic result) { - _libclangDylib = result as String; - }, - ), [strings.llvmPath]: Specification( requirement: Requirement.no, validator: llvmPathValidator, extractor: llvmPathExtractor, defaultValue: () => findDylibAtDefaultLocations(), extractedResult: (dynamic result) { - // If this key wasn't already set by `llvm-lib` use this result. - if (_libclangDylib.isEmpty) _libclangDylib = result as String; + _libclangDylib = result as String; }, ), [strings.output]: Specification( @@ -348,13 +330,6 @@ class Config { extractedResult: (dynamic result) => _structPackingOverride = result as StructPackingOverride, ), - [strings.arrayWorkaround]: Specification( - requirement: Requirement.no, - validator: booleanValidator, - extractor: booleanExtractor, - defaultValue: () => false, - extractedResult: (dynamic result) => _arrayWorkaround = result as bool, - ), [strings.dartBool]: Specification( requirement: Requirement.no, validator: booleanValidator, diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index ff4a44a9fc..a08d8c8d93 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -339,28 +339,6 @@ String? findLibclangDylib(String parentFolder) { } } -String llvmLibExtractor(dynamic value) { - // Extract libclang's dylib from this. - final p = findLibclangDylib(value as String); - if (p == null) { - _logger.severe("Couldn't find ${strings.dylibFileName} at $value."); - exit(1); - } else { - return p; - } -} - -bool llvmLibValidator(List name, dynamic value) { - _logger.warning( - 'Deprecated ${strings.llvmLib}: please use ${strings.llvmPath} instead.'); - if (!checkType(name, value) || - !Directory(value as String).existsSync()) { - _logger.severe('Expected $name to be a valid folder Path.'); - return false; - } - return true; -} - String llvmPathExtractor(dynamic value) { // Extract libclang's dylib from user specified paths. for (final path in (value as YamlList)) { diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 2c69fa75ec..0525565524 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -1195,70 +1195,21 @@ class CXUnsavedFile extends ffi.Struct { /// 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; + @ffi.Array.multi([2]) + external ffi.Array> ptr_data; - /// 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; + @ffi.Array.multi([2]) + external ffi.Array> ptr_data; - /// 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; @@ -1266,49 +1217,6 @@ class CXSourceRange extends ffi.Struct { 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.'); - } - } -} - /// Options to control the display of diagnostics. /// /// The values in this enum are meant to be combined to customize the @@ -2292,61 +2200,8 @@ class CXCursor extends ffi.Struct { @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.'); - } - } + @ffi.Array.multi([3]) + external ffi.Array> data; } /// Describes the kind of type @@ -2484,55 +2339,8 @@ 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.'); - } - } + @ffi.Array.multi([2]) + external ffi.Array> data; } /// Describes how the traversal of the children of a particular diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart index c27d8416c3..e5970f475b 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -21,7 +21,6 @@ class _ParsedStruc { Struc? struc; bool unimplementedMemberType = false; bool flexibleArrayMember = false; - bool arrayMember = false; bool bitFieldMember = false; bool dartHandleMember = false; bool incompleteStructMember = false; @@ -29,7 +28,6 @@ class _ParsedStruc { bool get isInComplete => unimplementedMemberType || flexibleArrayMember || - (arrayMember && !config.arrayWorkaround) || bitFieldMember || (dartHandleMember && config.useDartHandle) || incompleteStructMember; @@ -168,12 +166,7 @@ void _setStructMembers(clang_types.CXCursor cursor) { visitChildrenResultChecker(resultCode); - 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'); - } else if (_stack.top.unimplementedMemberType) { + if (_stack.top.unimplementedMemberType) { _logger.fine( '---- Removed Struct members, reason: member with unimplementedtype ${cursor.completeStringRepr()}'); _logger.warning( @@ -227,9 +220,6 @@ int _structMembersVisitor(clang_types.CXCursor cursor, } final mt = cursor.type().toCodeGenType(); - if (mt.broadType == BroadType.ConstantArray) { - _stack.top.arrayMember = true; - } if (mt.broadType == BroadType.IncompleteArray) { // TODO(68): Structs with flexible Array Members are not supported. _stack.top.flexibleArrayMember = true; diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 76ed9404e8..0b5d2f1e25 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -22,7 +22,6 @@ String get dylibFileName { return name; } -const llvmLib = 'llvm-lib'; const llvmPath = 'llvm-path'; /// Name of the parent folder of dynamic library `lib` or `bin` (on windows). @@ -123,8 +122,6 @@ const supportedNativeType_mappings = { // Boolean flags. const sort = 'sort'; const useSupportedTypedefs = 'use-supported-typedefs'; -const warnWhenRemoving = 'warn-when-removing'; -const arrayWorkaround = 'array-workaround'; const dartBool = 'dart-bool'; const useDartHandle = 'use-dart-handle'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index e761291e79..15555a23f9 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.5.0-beta.1 +version: 3.0.0-beta.0 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart index 5e599fc5d8..4556dfaefe 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart @@ -59,57 +59,8 @@ class init_dylib_1 { } class _Test extends ffi.Struct { - @ffi.Int8() - external int _unique_array_item_0; - @ffi.Int8() - external int _unique_array_item_1; - - /// Helper for array `array`. - ArrayHelper1__Test_array_level0 get array => - ArrayHelper1__Test_array_level0(this, [2], 0, 0); -} - -/// Helper for array `array` in struct `_Test`. -class ArrayHelper1__Test_array_level0 { - final _Test _struct; - final List dimensions; - final int level; - final int _absoluteIndex; - int get length => dimensions[level]; - ArrayHelper1__Test_array_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_array_item_0; - case 1: - return _struct._unique_array_item_1; - default: - throw Exception('Invalid Array Helper generated.'); - } - } - - void operator []=(int index, int value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._unique_array_item_0 = value; - break; - case 1: - _struct._unique_array_item_1 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } - } + @ffi.Array.multi([2]) + external ffi.Array array; } class ArrayHelperPrefixCollisionTest extends ffi.Opaque {} diff --git a/pkgs/ffigen/test/example_tests/libclang_example_test.dart b/pkgs/ffigen/test/example_tests/libclang_example_test.dart index f385b000a9..deed803581 100644 --- a/pkgs/ffigen/test/example_tests/libclang_example_test.dart +++ b/pkgs/ffigen/test/example_tests/libclang_example_test.dart @@ -43,7 +43,6 @@ ${strings.enums}: ${strings.name}: 'LibClang' ${strings.description}: 'Holds bindings to LibClang.' -${strings.arrayWorkaround}: true ${strings.comments}: ${strings.style}: ${strings.doxygen} ${strings.length}: ${strings.full} diff --git a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart index 978b36562c..4dc9427544 100644 --- a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart @@ -23,7 +23,6 @@ void main() { ${strings.name}: 'NativeLibrary' ${strings.description}: 'Nested Parsing Test' ${strings.output}: 'unused' -${strings.arrayWorkaround}: true ${strings.headers}: ${strings.entryPoints}: - 'test/header_parser_tests/nested_parsing.h' diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index 34c663359d..be68fb586c 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -5937,129 +5937,24 @@ abstract class CXGlobalOptFlags { /// 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.'); - } - } + @ffi.Array.multi([3]) + external ffi.Array data; } /// 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; + @ffi.Array.multi([2]) + external ffi.Array> ptr_data; - /// 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; + @ffi.Array.multi([2]) + external ffi.Array> ptr_data; - /// 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; @@ -6067,49 +5962,6 @@ class CXSourceRange extends ffi.Struct { 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. @@ -6977,61 +6829,8 @@ class CXCursor extends ffi.Struct { @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.'); - } - } + @ffi.Array.multi([3]) + external ffi.Array> data; } /// Describe the linkage of the entity referred to by a cursor. @@ -7271,55 +7070,8 @@ 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.'); - } - } + @ffi.Array.multi([2]) + external ffi.Array> data; } /// Describes the kind of a template argument. @@ -7515,74 +7267,12 @@ abstract class CXTokenKind { /// 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; + @ffi.Array.multi([4]) + external ffi.Array int_data; - /// 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. @@ -7829,59 +7519,13 @@ abstract class CXResult { /// 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; + @ffi.Array.multi([2]) + external ffi.Array> ptr_data; - /// 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. diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index 3a7e50e434..9580bd19c4 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -10061,379 +10061,8 @@ class sqlite3_backup extends ffi.Opaque {} /// transaction that sees that historical version of the database rather than /// the most recent version. class sqlite3_snapshot extends ffi.Struct { - @ffi.Uint8() - external int _unique_hidden_item_0; - @ffi.Uint8() - external int _unique_hidden_item_1; - @ffi.Uint8() - external int _unique_hidden_item_2; - @ffi.Uint8() - external int _unique_hidden_item_3; - @ffi.Uint8() - external int _unique_hidden_item_4; - @ffi.Uint8() - external int _unique_hidden_item_5; - @ffi.Uint8() - external int _unique_hidden_item_6; - @ffi.Uint8() - external int _unique_hidden_item_7; - @ffi.Uint8() - external int _unique_hidden_item_8; - @ffi.Uint8() - external int _unique_hidden_item_9; - @ffi.Uint8() - external int _unique_hidden_item_10; - @ffi.Uint8() - external int _unique_hidden_item_11; - @ffi.Uint8() - external int _unique_hidden_item_12; - @ffi.Uint8() - external int _unique_hidden_item_13; - @ffi.Uint8() - external int _unique_hidden_item_14; - @ffi.Uint8() - external int _unique_hidden_item_15; - @ffi.Uint8() - external int _unique_hidden_item_16; - @ffi.Uint8() - external int _unique_hidden_item_17; - @ffi.Uint8() - external int _unique_hidden_item_18; - @ffi.Uint8() - external int _unique_hidden_item_19; - @ffi.Uint8() - external int _unique_hidden_item_20; - @ffi.Uint8() - external int _unique_hidden_item_21; - @ffi.Uint8() - external int _unique_hidden_item_22; - @ffi.Uint8() - external int _unique_hidden_item_23; - @ffi.Uint8() - external int _unique_hidden_item_24; - @ffi.Uint8() - external int _unique_hidden_item_25; - @ffi.Uint8() - external int _unique_hidden_item_26; - @ffi.Uint8() - external int _unique_hidden_item_27; - @ffi.Uint8() - external int _unique_hidden_item_28; - @ffi.Uint8() - external int _unique_hidden_item_29; - @ffi.Uint8() - external int _unique_hidden_item_30; - @ffi.Uint8() - external int _unique_hidden_item_31; - @ffi.Uint8() - external int _unique_hidden_item_32; - @ffi.Uint8() - external int _unique_hidden_item_33; - @ffi.Uint8() - external int _unique_hidden_item_34; - @ffi.Uint8() - external int _unique_hidden_item_35; - @ffi.Uint8() - external int _unique_hidden_item_36; - @ffi.Uint8() - external int _unique_hidden_item_37; - @ffi.Uint8() - external int _unique_hidden_item_38; - @ffi.Uint8() - external int _unique_hidden_item_39; - @ffi.Uint8() - external int _unique_hidden_item_40; - @ffi.Uint8() - external int _unique_hidden_item_41; - @ffi.Uint8() - external int _unique_hidden_item_42; - @ffi.Uint8() - external int _unique_hidden_item_43; - @ffi.Uint8() - external int _unique_hidden_item_44; - @ffi.Uint8() - external int _unique_hidden_item_45; - @ffi.Uint8() - external int _unique_hidden_item_46; - @ffi.Uint8() - external int _unique_hidden_item_47; - - /// Helper for array `hidden`. - ArrayHelper_sqlite3_snapshot_hidden_level0 get hidden => - ArrayHelper_sqlite3_snapshot_hidden_level0(this, [48], 0, 0); -} - -/// Helper for array `hidden` in struct `sqlite3_snapshot`. -class ArrayHelper_sqlite3_snapshot_hidden_level0 { - final sqlite3_snapshot _struct; - final List dimensions; - final int level; - final int _absoluteIndex; - int get length => dimensions[level]; - ArrayHelper_sqlite3_snapshot_hidden_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_hidden_item_0; - case 1: - return _struct._unique_hidden_item_1; - case 2: - return _struct._unique_hidden_item_2; - case 3: - return _struct._unique_hidden_item_3; - case 4: - return _struct._unique_hidden_item_4; - case 5: - return _struct._unique_hidden_item_5; - case 6: - return _struct._unique_hidden_item_6; - case 7: - return _struct._unique_hidden_item_7; - case 8: - return _struct._unique_hidden_item_8; - case 9: - return _struct._unique_hidden_item_9; - case 10: - return _struct._unique_hidden_item_10; - case 11: - return _struct._unique_hidden_item_11; - case 12: - return _struct._unique_hidden_item_12; - case 13: - return _struct._unique_hidden_item_13; - case 14: - return _struct._unique_hidden_item_14; - case 15: - return _struct._unique_hidden_item_15; - case 16: - return _struct._unique_hidden_item_16; - case 17: - return _struct._unique_hidden_item_17; - case 18: - return _struct._unique_hidden_item_18; - case 19: - return _struct._unique_hidden_item_19; - case 20: - return _struct._unique_hidden_item_20; - case 21: - return _struct._unique_hidden_item_21; - case 22: - return _struct._unique_hidden_item_22; - case 23: - return _struct._unique_hidden_item_23; - case 24: - return _struct._unique_hidden_item_24; - case 25: - return _struct._unique_hidden_item_25; - case 26: - return _struct._unique_hidden_item_26; - case 27: - return _struct._unique_hidden_item_27; - case 28: - return _struct._unique_hidden_item_28; - case 29: - return _struct._unique_hidden_item_29; - case 30: - return _struct._unique_hidden_item_30; - case 31: - return _struct._unique_hidden_item_31; - case 32: - return _struct._unique_hidden_item_32; - case 33: - return _struct._unique_hidden_item_33; - case 34: - return _struct._unique_hidden_item_34; - case 35: - return _struct._unique_hidden_item_35; - case 36: - return _struct._unique_hidden_item_36; - case 37: - return _struct._unique_hidden_item_37; - case 38: - return _struct._unique_hidden_item_38; - case 39: - return _struct._unique_hidden_item_39; - case 40: - return _struct._unique_hidden_item_40; - case 41: - return _struct._unique_hidden_item_41; - case 42: - return _struct._unique_hidden_item_42; - case 43: - return _struct._unique_hidden_item_43; - case 44: - return _struct._unique_hidden_item_44; - case 45: - return _struct._unique_hidden_item_45; - case 46: - return _struct._unique_hidden_item_46; - case 47: - return _struct._unique_hidden_item_47; - default: - throw Exception('Invalid Array Helper generated.'); - } - } - - void operator []=(int index, int value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._unique_hidden_item_0 = value; - break; - case 1: - _struct._unique_hidden_item_1 = value; - break; - case 2: - _struct._unique_hidden_item_2 = value; - break; - case 3: - _struct._unique_hidden_item_3 = value; - break; - case 4: - _struct._unique_hidden_item_4 = value; - break; - case 5: - _struct._unique_hidden_item_5 = value; - break; - case 6: - _struct._unique_hidden_item_6 = value; - break; - case 7: - _struct._unique_hidden_item_7 = value; - break; - case 8: - _struct._unique_hidden_item_8 = value; - break; - case 9: - _struct._unique_hidden_item_9 = value; - break; - case 10: - _struct._unique_hidden_item_10 = value; - break; - case 11: - _struct._unique_hidden_item_11 = value; - break; - case 12: - _struct._unique_hidden_item_12 = value; - break; - case 13: - _struct._unique_hidden_item_13 = value; - break; - case 14: - _struct._unique_hidden_item_14 = value; - break; - case 15: - _struct._unique_hidden_item_15 = value; - break; - case 16: - _struct._unique_hidden_item_16 = value; - break; - case 17: - _struct._unique_hidden_item_17 = value; - break; - case 18: - _struct._unique_hidden_item_18 = value; - break; - case 19: - _struct._unique_hidden_item_19 = value; - break; - case 20: - _struct._unique_hidden_item_20 = value; - break; - case 21: - _struct._unique_hidden_item_21 = value; - break; - case 22: - _struct._unique_hidden_item_22 = value; - break; - case 23: - _struct._unique_hidden_item_23 = value; - break; - case 24: - _struct._unique_hidden_item_24 = value; - break; - case 25: - _struct._unique_hidden_item_25 = value; - break; - case 26: - _struct._unique_hidden_item_26 = value; - break; - case 27: - _struct._unique_hidden_item_27 = value; - break; - case 28: - _struct._unique_hidden_item_28 = value; - break; - case 29: - _struct._unique_hidden_item_29 = value; - break; - case 30: - _struct._unique_hidden_item_30 = value; - break; - case 31: - _struct._unique_hidden_item_31 = value; - break; - case 32: - _struct._unique_hidden_item_32 = value; - break; - case 33: - _struct._unique_hidden_item_33 = value; - break; - case 34: - _struct._unique_hidden_item_34 = value; - break; - case 35: - _struct._unique_hidden_item_35 = value; - break; - case 36: - _struct._unique_hidden_item_36 = value; - break; - case 37: - _struct._unique_hidden_item_37 = value; - break; - case 38: - _struct._unique_hidden_item_38 = value; - break; - case 39: - _struct._unique_hidden_item_39 = value; - break; - case 40: - _struct._unique_hidden_item_40 = value; - break; - case 41: - _struct._unique_hidden_item_41 = value; - break; - case 42: - _struct._unique_hidden_item_42 = value; - break; - case 43: - _struct._unique_hidden_item_43 = value; - break; - case 44: - _struct._unique_hidden_item_44 = value; - break; - case 45: - _struct._unique_hidden_item_45 = value; - break; - case 46: - _struct._unique_hidden_item_46 = value; - break; - case 47: - _struct._unique_hidden_item_47 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } - } + @ffi.Array.multi([48]) + external ffi.Array hidden; } /// A pointer to a structure of the following type is passed as the first diff --git a/pkgs/ffigen/test/large_integration_tests/large_test.dart b/pkgs/ffigen/test/large_integration_tests/large_test.dart index 2815a1fc5e..fc38fb39e6 100644 --- a/pkgs/ffigen/test/large_integration_tests/large_test.dart +++ b/pkgs/ffigen/test/large_integration_tests/large_test.dart @@ -23,7 +23,6 @@ ${strings.name}: LibClang ${strings.description}: Bindings to LibClang. ${strings.output}: unused ${strings.compilerOpts}: -I${path.join('third_party', 'libclang', 'include')} -${strings.arrayWorkaround}: true ${strings.comments}: ${strings.style}: ${strings.doxygen} ${strings.length}: ${strings.brief} @@ -55,7 +54,6 @@ ${strings.description}: Bindings to Cjson. ${strings.output}: unused ${strings.comments}: ${strings.length}: ${strings.full} -${strings.arrayWorkaround}: true ${strings.headers}: ${strings.entryPoints}: - third_party/cjson_library/cJSON.h @@ -78,7 +76,6 @@ ${strings.headers}: ${strings.name}: SQLite ${strings.description}: Bindings to SQLite. ${strings.output}: unused -${strings.arrayWorkaround}: true ${strings.comments}: ${strings.style}: ${strings.any} ${strings.length}: ${strings.full} diff --git a/pkgs/ffigen/test/native_test/config.yaml b/pkgs/ffigen/test/native_test/config.yaml index 6c7b239d70..d68a62fdf7 100644 --- a/pkgs/ffigen/test/native_test/config.yaml +++ b/pkgs/ffigen/test/native_test/config.yaml @@ -14,6 +14,5 @@ headers: - 'test/native_test/native_test.c' include-directives: - '**native_test.c' -array-workaround: true compiler-opts: '-Wno-nullability-completeness' diff --git a/pkgs/ffigen/test/native_test/native_test.dart b/pkgs/ffigen/test/native_test/native_test.dart index 5e90a0ba70..08e1475eb4 100644 --- a/pkgs/ffigen/test/native_test/native_test.dart +++ b/pkgs/ffigen/test/native_test/native_test.dart @@ -91,19 +91,20 @@ void main() { test('double', () { expect(bindings.Function1Double(0), 42.0); }); - test('array-workaround: Order of access', () { + test('Array Test: Order of access', () { final struct1 = bindings.getStruct1(); var expectedValue = 1; - for (var i = 0; i < struct1.ref.data.dimensions[0]; i++) { - for (var j = 0; j < struct1.ref.data.dimensions[1]; j++) { - for (var k = 0; k < struct1.ref.data.dimensions[2]; k++) { + final dimensions = [3, 1, 2]; + for (var i = 0; i < dimensions[0]; i++) { + for (var j = 0; j < dimensions[1]; j++) { + for (var k = 0; k < dimensions[2]; k++) { expect(struct1.ref.data[i][j][k], expectedValue); expectedValue++; } } } }); - test('array-workaround: Range Errors', () { + test('Array Workaround: Range Errors', () { final struct1 = bindings.getStruct1(); // Index (get) above range. expect( diff --git a/pkgs/ffigen/test/native_test/native_test_bindings.dart b/pkgs/ffigen/test/native_test/native_test_bindings.dart index f409db86d1..620771c336 100644 --- a/pkgs/ffigen/test/native_test/native_test_bindings.dart +++ b/pkgs/ffigen/test/native_test/native_test_bindings.dart @@ -224,139 +224,8 @@ class Struct1 extends ffi.Struct { @ffi.Int8() external int a; - @ffi.Int32() - external int _unique_data_item_0; - @ffi.Int32() - external int _unique_data_item_1; - @ffi.Int32() - external int _unique_data_item_2; - @ffi.Int32() - external int _unique_data_item_3; - @ffi.Int32() - external int _unique_data_item_4; - @ffi.Int32() - external int _unique_data_item_5; - - /// Helper for array `data`. - ArrayHelper_Struct1_data_level0 get data => - ArrayHelper_Struct1_data_level0(this, [3, 1, 2], 0, 0); -} - -/// Helper for array `data` in struct `Struct1`. -class ArrayHelper_Struct1_data_level0 { - final Struct1 _struct; - final List dimensions; - final int level; - final int _absoluteIndex; - int get length => dimensions[level]; - ArrayHelper_Struct1_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.'); - } - } - - ArrayHelper_Struct1_data_level1 operator [](int index) { - _checkBounds(index); - var offset = index; - for (var i = level + 1; i < dimensions.length; i++) { - offset *= dimensions[i]; - } - return ArrayHelper_Struct1_data_level1( - _struct, dimensions, level + 1, _absoluteIndex + offset); - } -} - -/// Helper for array `data` in struct `Struct1`. -class ArrayHelper_Struct1_data_level1 { - final Struct1 _struct; - final List dimensions; - final int level; - final int _absoluteIndex; - int get length => dimensions[level]; - ArrayHelper_Struct1_data_level1( - 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.'); - } - } - - ArrayHelper_Struct1_data_level2 operator [](int index) { - _checkBounds(index); - var offset = index; - for (var i = level + 1; i < dimensions.length; i++) { - offset *= dimensions[i]; - } - return ArrayHelper_Struct1_data_level2( - _struct, dimensions, level + 1, _absoluteIndex + offset); - } -} - -/// Helper for array `data` in struct `Struct1`. -class ArrayHelper_Struct1_data_level2 { - final Struct1 _struct; - final List dimensions; - final int level; - final int _absoluteIndex; - int get length => dimensions[level]; - ArrayHelper_Struct1_data_level2( - 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; - case 3: - return _struct._unique_data_item_3; - case 4: - return _struct._unique_data_item_4; - case 5: - return _struct._unique_data_item_5; - 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; - case 3: - _struct._unique_data_item_3 = value; - break; - case 4: - _struct._unique_data_item_4 = value; - break; - case 5: - _struct._unique_data_item_5 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } - } + @ffi.Array.multi([3, 1, 2]) + external ffi.Array>> data; } class Struct3 extends ffi.Struct { diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index 87f6bb0c33..b6af5e10f1 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -23,7 +23,6 @@ headers: - '**Index.h' - '**CXString.h' -array-workaround: true preamble: | // Part of the LLVM Project, under the Apache License v2.0 with LLVM // Exceptions. From 53a193dfe43c37f658b1187d0d8737d6b741f672 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Wed, 28 Apr 2021 18:02:47 +0530 Subject: [PATCH 083/276] [ffigen] Update readme to clarify C support. (#209) We will not support C++ headers, because C++ does not have a stable ABI like C (or use of extern "C" in C++ headers). Without a stable ABI it is impossible to know in what register/stack locations to pass arguments and this will lead to endless segmentation faults. We could potentially support C++ headers which have extern "C" on every symbol, but we will not support C++ headers. --- pkgs/ffigen/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index a008d37e97..099fe044ce 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -4,6 +4,8 @@ Binding generator for [FFI](https://dart.dev/guides/libraries/c-interop) bindings. +> Note: ffigen only supports parsing `C` headers. + ## Example For some header file _example.h_: From 09e8bedbae527422e34b21957d272c0051d24a7c Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Wed, 19 May 2021 13:48:57 +0530 Subject: [PATCH 084/276] [ffigen] Bump version to 3.0.0 (#216) --- pkgs/ffigen/.github/workflows/test-package.yml | 4 ++-- pkgs/ffigen/CHANGELOG.md | 3 +++ pkgs/ffigen/lib/src/config_provider/spec_utils.dart | 2 +- pkgs/ffigen/lib/src/header_parser/parser.dart | 2 +- .../lib/src/header_parser/sub_parsers/macro_parser.dart | 4 ++-- .../src/header_parser/type_extractor/cxtypekindmap.dart | 2 +- pkgs/ffigen/pubspec.yaml | 4 ++-- pkgs/ffigen/test/config_tests/compiler_opts_test.dart | 2 +- .../test/config_tests/packed_struct_override_test.dart | 2 +- pkgs/ffigen/test/example_tests/cjson_example_test.dart | 6 +++--- pkgs/ffigen/test/example_tests/libclang_example_test.dart | 6 +++--- pkgs/ffigen/test/example_tests/simple_example_test.dart | 6 +++--- .../test/header_parser_tests/comment_markup_test.dart | 4 ++-- .../ffigen/test/header_parser_tests/dart_handle_test.dart | 6 +++--- .../test/header_parser_tests/forward_decl_test.dart | 4 ++-- .../test/header_parser_tests/function_n_struct_test.dart | 4 ++-- pkgs/ffigen/test/header_parser_tests/functions_test.dart | 4 ++-- pkgs/ffigen/test/header_parser_tests/globals_test.dart | 4 ++-- pkgs/ffigen/test/header_parser_tests/macros_test.dart | 4 ++-- .../header_parser_tests/native_func_typedef_test.dart | 4 ++-- .../test/header_parser_tests/nested_parsing_test.dart | 4 ++-- .../header_parser_tests/opaque_dependencies_test.dart | 4 ++-- .../test/header_parser_tests/packed_structs_test.dart | 4 ++-- pkgs/ffigen/test/header_parser_tests/typedef_test.dart | 4 ++-- .../test/header_parser_tests/unnamed_enums_test.dart | 4 ++-- pkgs/ffigen/test/large_integration_tests/large_test.dart | 8 ++++---- pkgs/ffigen/test/native_test/build_test_dylib.dart | 1 - pkgs/ffigen/test/rename_tests/rename_test.dart | 4 ++-- 28 files changed, 56 insertions(+), 54 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 642fed714f..da0cc9b1db 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: [2.13.0-211.6.beta] # TODO: revert to 2.13. + sdk: [2.13.0] steps: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1.0 @@ -43,7 +43,7 @@ jobs: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1.0 with: - sdk: 2.13.0-211.6.beta # TODO: revert to 2.13. + sdk: 2.13.0 - name: Install dependencies run: dart pub get - name: Install libclang-10-dev diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 5139d6fd9b..3b1f928079 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 3.0.0 +- Release for dart sdk `>=2.13` (Support for packed structs and inline arrays). + # 3.0.0-beta.0 - Added support for inline arrays in `Struct`s. - Remove config key `array-workaround`. diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index a08d8c8d93..73c0d0db13 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -9,8 +9,8 @@ import 'package:file/local.dart'; import 'package:glob/glob.dart'; import 'package:logging/logging.dart'; import 'package:path/path.dart' as p; -import 'package:yaml/yaml.dart'; import 'package:quiver/pattern.dart' as quiver; +import 'package:yaml/yaml.dart'; import '../strings.dart' as strings; import 'config_types.dart'; diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index ddcd9c692c..93dfaa1989 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -7,8 +7,8 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/config_provider.dart'; -import 'package:ffigen/src/header_parser/sub_parsers/macro_parser.dart'; import 'package:ffigen/src/config_provider/config_types.dart'; +import 'package:ffigen/src/header_parser/sub_parsers/macro_parser.dart'; import 'package:ffigen/src/header_parser/translation_unit_parser.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart index 4574417194..61db5372bb 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart @@ -6,13 +6,13 @@ import 'dart:ffi'; import 'dart:io'; import 'dart:typed_data'; -import 'package:ffigen/src/strings.dart' as strings; -import 'package:path/path.dart' as p; import 'package:ffi/ffi.dart'; import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/header_parser/data.dart'; import 'package:ffigen/src/header_parser/includer.dart'; +import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; +import 'package:path/path.dart' as p; import '../clang_bindings/clang_bindings.dart' as clang_types; import '../data.dart'; diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart index 7c7a936d31..48c915af6a 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart @@ -2,9 +2,9 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:ffigen/src/code_generator.dart' show SupportedNativeType; import 'package:ffigen/src/header_parser/clang_bindings/clang_bindings.dart' as clang; -import 'package:ffigen/src/code_generator.dart' show SupportedNativeType; /// Utility to convert CXType to [code_generator.Type]. /// diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 15555a23f9..ddacda0fef 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,12 +3,12 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 3.0.0-beta.0 +version: 3.0.0 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. environment: - sdk: '>=2.13.0-211.6.beta <3.0.0' + sdk: '>=2.13.0 <3.0.0' dependencies: ffi: ^1.0.0 diff --git a/pkgs/ffigen/test/config_tests/compiler_opts_test.dart b/pkgs/ffigen/test/config_tests/compiler_opts_test.dart index 1c5493bbe8..b5e644b65f 100644 --- a/pkgs/ffigen/test/config_tests/compiler_opts_test.dart +++ b/pkgs/ffigen/test/config_tests/compiler_opts_test.dart @@ -6,8 +6,8 @@ import 'package:ffigen/ffigen.dart'; import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/config_provider/spec_utils.dart'; import 'package:ffigen/src/strings.dart' as strings; -import 'package:yaml/yaml.dart' as yaml; import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; late Library actual, expected; diff --git a/pkgs/ffigen/test/config_tests/packed_struct_override_test.dart b/pkgs/ffigen/test/config_tests/packed_struct_override_test.dart index fd8be93834..ca371d8f56 100644 --- a/pkgs/ffigen/test/config_tests/packed_struct_override_test.dart +++ b/pkgs/ffigen/test/config_tests/packed_struct_override_test.dart @@ -5,8 +5,8 @@ import 'package:ffigen/ffigen.dart'; import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/strings.dart' as strings; -import 'package:yaml/yaml.dart' as yaml; import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; diff --git a/pkgs/ffigen/test/example_tests/cjson_example_test.dart b/pkgs/ffigen/test/example_tests/cjson_example_test.dart index 3d4536f479..f6504a8186 100644 --- a/pkgs/ffigen/test/example_tests/cjson_example_test.dart +++ b/pkgs/ffigen/test/example_tests/cjson_example_test.dart @@ -2,12 +2,12 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:ffigen/src/header_parser.dart'; -import 'package:logging/logging.dart'; -import 'package:yaml/yaml.dart'; import 'package:ffigen/src/config_provider/config.dart'; +import 'package:ffigen/src/header_parser.dart'; import 'package:ffigen/src/strings.dart' as strings; +import 'package:logging/logging.dart'; import 'package:test/test.dart'; +import 'package:yaml/yaml.dart'; import '../test_utils.dart'; diff --git a/pkgs/ffigen/test/example_tests/libclang_example_test.dart b/pkgs/ffigen/test/example_tests/libclang_example_test.dart index deed803581..43407fc4c3 100644 --- a/pkgs/ffigen/test/example_tests/libclang_example_test.dart +++ b/pkgs/ffigen/test/example_tests/libclang_example_test.dart @@ -2,12 +2,12 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:ffigen/src/header_parser.dart'; -import 'package:logging/logging.dart'; -import 'package:yaml/yaml.dart'; import 'package:ffigen/src/config_provider/config.dart'; +import 'package:ffigen/src/header_parser.dart'; import 'package:ffigen/src/strings.dart' as strings; +import 'package:logging/logging.dart'; import 'package:test/test.dart'; +import 'package:yaml/yaml.dart'; import '../test_utils.dart'; diff --git a/pkgs/ffigen/test/example_tests/simple_example_test.dart b/pkgs/ffigen/test/example_tests/simple_example_test.dart index 5b22de7d5f..8f4c1815e6 100644 --- a/pkgs/ffigen/test/example_tests/simple_example_test.dart +++ b/pkgs/ffigen/test/example_tests/simple_example_test.dart @@ -2,12 +2,12 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:ffigen/src/header_parser.dart'; -import 'package:logging/logging.dart'; -import 'package:yaml/yaml.dart'; import 'package:ffigen/src/config_provider/config.dart'; +import 'package:ffigen/src/header_parser.dart'; import 'package:ffigen/src/strings.dart' as strings; +import 'package:logging/logging.dart'; import 'package:test/test.dart'; +import 'package:yaml/yaml.dart'; import '../test_utils.dart'; diff --git a/pkgs/ffigen/test/header_parser_tests/comment_markup_test.dart b/pkgs/ffigen/test/header_parser_tests/comment_markup_test.dart index 6d3f8bad09..9771f632c0 100644 --- a/pkgs/ffigen/test/header_parser_tests/comment_markup_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/comment_markup_test.dart @@ -3,12 +3,12 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:test/test.dart'; import 'package:yaml/yaml.dart' as yaml; -import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; diff --git a/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart b/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart index 27ce68eb5a..ed9d1aa700 100644 --- a/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart @@ -3,13 +3,13 @@ // BSD-style license that can be found in the LICENSE file. import 'package:cli_util/cli_util.dart'; -import 'package:path/path.dart' as path; import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:path/path.dart' as path; import 'package:test/test.dart'; import 'package:yaml/yaml.dart' as yaml; -import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; diff --git a/pkgs/ffigen/test/header_parser_tests/forward_decl_test.dart b/pkgs/ffigen/test/header_parser_tests/forward_decl_test.dart index b0418b54f4..0d4488e33b 100644 --- a/pkgs/ffigen/test/header_parser_tests/forward_decl_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/forward_decl_test.dart @@ -3,12 +3,12 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:test/test.dart'; import 'package:yaml/yaml.dart' as yaml; -import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; diff --git a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart index aec45027aa..861a6bfe39 100644 --- a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart @@ -3,12 +3,12 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:test/test.dart'; import 'package:yaml/yaml.dart' as yaml; -import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; diff --git a/pkgs/ffigen/test/header_parser_tests/functions_test.dart b/pkgs/ffigen/test/header_parser_tests/functions_test.dart index ec5c2f680f..6e526b15ad 100644 --- a/pkgs/ffigen/test/header_parser_tests/functions_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/functions_test.dart @@ -3,11 +3,11 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; import 'package:test/test.dart'; import 'package:yaml/yaml.dart' as yaml; -import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; diff --git a/pkgs/ffigen/test/header_parser_tests/globals_test.dart b/pkgs/ffigen/test/header_parser_tests/globals_test.dart index 7da24140b3..467be8a00a 100644 --- a/pkgs/ffigen/test/header_parser_tests/globals_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/globals_test.dart @@ -3,11 +3,11 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; import 'package:test/test.dart'; import 'package:yaml/yaml.dart' as yaml; -import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; diff --git a/pkgs/ffigen/test/header_parser_tests/macros_test.dart b/pkgs/ffigen/test/header_parser_tests/macros_test.dart index 2611940279..d615b2643f 100644 --- a/pkgs/ffigen/test/header_parser_tests/macros_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/macros_test.dart @@ -3,12 +3,12 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:test/test.dart'; import 'package:yaml/yaml.dart' as yaml; -import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; diff --git a/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart index e041f56087..cc348cbcc2 100644 --- a/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart @@ -3,12 +3,12 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:test/test.dart'; import 'package:yaml/yaml.dart' as yaml; -import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; diff --git a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart index 4dc9427544..284d1701b9 100644 --- a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart @@ -3,11 +3,11 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; import 'package:test/test.dart'; import 'package:yaml/yaml.dart' as yaml; -import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; diff --git a/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart b/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart index 1107767ceb..aea546871f 100644 --- a/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart @@ -3,12 +3,12 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:test/test.dart'; import 'package:yaml/yaml.dart' as yaml; -import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; diff --git a/pkgs/ffigen/test/header_parser_tests/packed_structs_test.dart b/pkgs/ffigen/test/header_parser_tests/packed_structs_test.dart index e334fab899..4e99c037f6 100644 --- a/pkgs/ffigen/test/header_parser_tests/packed_structs_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/packed_structs_test.dart @@ -3,12 +3,12 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:test/test.dart'; import 'package:yaml/yaml.dart' as yaml; -import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; diff --git a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart index 8f2abc7060..4e3daa52b0 100644 --- a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart @@ -3,12 +3,12 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:test/test.dart'; import 'package:yaml/yaml.dart' as yaml; -import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; diff --git a/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart b/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart index 02994afa22..ea9f32d302 100644 --- a/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart @@ -3,11 +3,11 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; import 'package:test/test.dart'; import 'package:yaml/yaml.dart' as yaml; -import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; diff --git a/pkgs/ffigen/test/large_integration_tests/large_test.dart b/pkgs/ffigen/test/large_integration_tests/large_test.dart index fc38fb39e6..b7cf797d21 100644 --- a/pkgs/ffigen/test/large_integration_tests/large_test.dart +++ b/pkgs/ffigen/test/large_integration_tests/large_test.dart @@ -2,13 +2,13 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:ffigen/src/header_parser.dart'; -import 'package:logging/logging.dart'; -import 'package:yaml/yaml.dart'; import 'package:ffigen/src/config_provider/config.dart'; -import 'package:test/test.dart'; +import 'package:ffigen/src/header_parser.dart'; import 'package:ffigen/src/strings.dart' as strings; +import 'package:logging/logging.dart'; import 'package:path/path.dart' as path; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart'; import '../test_utils.dart'; diff --git a/pkgs/ffigen/test/native_test/build_test_dylib.dart b/pkgs/ffigen/test/native_test/build_test_dylib.dart index 5ec89ac6ec..a41f6863b2 100644 --- a/pkgs/ffigen/test/native_test/build_test_dylib.dart +++ b/pkgs/ffigen/test/native_test/build_test_dylib.dart @@ -58,7 +58,6 @@ void main(List arguments) { final options = getPlatformOptions()!; // Run clang compiler to generate the dynamic library. - // ignore: omit_local_variable_types final processResult = runClangProcess(options); printSuccess(processResult, options); } diff --git a/pkgs/ffigen/test/rename_tests/rename_test.dart b/pkgs/ffigen/test/rename_tests/rename_test.dart index b6fd4031e5..bb4f0ee577 100644 --- a/pkgs/ffigen/test/rename_tests/rename_test.dart +++ b/pkgs/ffigen/test/rename_tests/rename_test.dart @@ -3,11 +3,11 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; import 'package:test/test.dart'; import 'package:yaml/yaml.dart' as yaml; -import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; From 362cc702dcde5a70238a8a80c97cb8b9b9f25ecd Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Thu, 20 May 2021 16:03:05 +0530 Subject: [PATCH 085/276] [ffigen] Added support for generating Unions (#215) --- .../ffigen/.github/workflows/test-package.yml | 4 +- pkgs/ffigen/CHANGELOG.md | 3 + pkgs/ffigen/README.md | 16 +- pkgs/ffigen/lib/src/code_generator.dart | 2 + .../src/code_generator/binding_string.dart | 1 + .../lib/src/code_generator/compound.dart | 184 +++++++++++ .../ffigen/lib/src/code_generator/global.dart | 4 +- pkgs/ffigen/lib/src/code_generator/struc.dart | 128 +------- pkgs/ffigen/lib/src/code_generator/type.dart | 40 ++- pkgs/ffigen/lib/src/code_generator/union.dart | 49 +++ .../lib/src/config_provider/config.dart | 42 ++- .../lib/src/config_provider/config_types.dart | 2 +- .../lib/src/config_provider/spec_utils.dart | 16 +- .../lib/src/header_parser/includer.dart | 10 + .../sub_parsers/compounddecl_parser.dart | 303 ++++++++++++++++++ .../sub_parsers/functiondecl_parser.dart | 4 +- .../sub_parsers/structdecl_parser.dart | 264 --------------- .../sub_parsers/typedefdecl_parser.dart | 23 +- .../translation_unit_parser.dart | 7 +- .../type_extractor/extractor.dart | 108 ++++--- pkgs/ffigen/lib/src/header_parser/utils.dart | 17 +- pkgs/ffigen/lib/src/strings.dart | 9 +- pkgs/ffigen/pubspec.yaml | 4 +- .../code_generator_test.dart | 43 +++ .../_expected_unions_bindings.dart | 58 ++++ ...expected_opaque_dependencies_bindings.dart | 36 +++ .../_expected_unions_bindings.dart | 74 +++++ .../header_parser_tests/opaque_dependencies.h | 33 ++ .../opaque_dependencies_test.dart | 6 +- pkgs/ffigen/test/header_parser_tests/unions.h | 38 +++ .../test/header_parser_tests/unions_test.dart | 45 +++ 31 files changed, 1090 insertions(+), 483 deletions(-) create mode 100644 pkgs/ffigen/lib/src/code_generator/compound.dart create mode 100644 pkgs/ffigen/lib/src/code_generator/union.dart create mode 100644 pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart delete mode 100644 pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart create mode 100644 pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/unions.h create mode 100644 pkgs/ffigen/test/header_parser_tests/unions_test.dart diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index da0cc9b1db..7cc704e646 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: [2.13.0] + sdk: [2.14.0-115.0.dev] # TODO: revert to 2.14 steps: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1.0 @@ -43,7 +43,7 @@ jobs: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1.0 with: - sdk: 2.13.0 + sdk: 2.14.0-115.0.dev # TODO: revert to 2.14. - name: Install dependencies run: dart pub get - name: Install libclang-10-dev diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 3b1f928079..6950615c17 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 3.1.0-dev.0 +- Added support for generating unions. + # 3.0.0 - Release for dart sdk `>=2.13` (Support for packed structs and inline arrays). diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 099fe044ce..ae66d69805 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -181,7 +181,7 @@ compiler-opts-automatic: - functions

structs

enums

unnamed-enums

macros

globals + functions

structs

unions

enums

unnamed-enums

macros

globals Filters for declarations.
Default: all are included.

Options -
- Include/Exclude declarations.
@@ -273,8 +273,10 @@ comments: - structs -> dependency-only - If `opaque`, generates empty `Opaque` structs if structs + structs -> dependency-only

+ unions -> dependency-only + + If `opaque`, generates empty `Opaque` structs/unions if they were not included in config (but were added since they are a dependency) and only passed by reference(pointer).
Options - full(default) | opaque
@@ -284,6 +286,8 @@ only passed by reference(pointer).
```yaml structs: dependency-only: opaque +unions: + dependency-only: opaque ``` @@ -476,9 +480,9 @@ unnamed-enums: 'CXType_(.*)': '$1' ``` -### Why are some struct declarations generated even after excluded them in config? +### Why are some struct/union declarations generated even after excluded them in config? -This happens when an excluded struct is a dependency to some included declaration. +This happens when an excluded struct/union is a dependency to some included declaration. (A dependency means a struct is being passed/returned by a function or is member of another struct in some way) Note: If you supply `structs` -> `dependency-only` as `opaque` ffigen will generate @@ -486,6 +490,8 @@ these struct dependencies as `Opaque` if they were only passed by reference(poin ```yaml structs: dependency-only: opaque +unions: + dependency-only: opaque ``` ### How to expose the native pointers and typedefs? diff --git a/pkgs/ffigen/lib/src/code_generator.dart b/pkgs/ffigen/lib/src/code_generator.dart index efbb1a2843..0b2367456f 100644 --- a/pkgs/ffigen/lib/src/code_generator.dart +++ b/pkgs/ffigen/lib/src/code_generator.dart @@ -6,6 +6,7 @@ library code_generator; export 'code_generator/binding.dart'; +export 'code_generator/compound.dart'; export 'code_generator/constant.dart'; export 'code_generator/enum_class.dart'; export 'code_generator/func.dart'; @@ -14,3 +15,4 @@ export 'code_generator/library.dart'; export 'code_generator/struc.dart'; export 'code_generator/type.dart'; export 'code_generator/typedef.dart'; +export 'code_generator/union.dart'; diff --git a/pkgs/ffigen/lib/src/code_generator/binding_string.dart b/pkgs/ffigen/lib/src/code_generator/binding_string.dart index a2b721ea38..2929ee8765 100644 --- a/pkgs/ffigen/lib/src/code_generator/binding_string.dart +++ b/pkgs/ffigen/lib/src/code_generator/binding_string.dart @@ -18,6 +18,7 @@ class BindingString { enum BindingStringType { func, struc, + union, constant, global, enumClass, diff --git a/pkgs/ffigen/lib/src/code_generator/compound.dart b/pkgs/ffigen/lib/src/code_generator/compound.dart new file mode 100644 index 0000000000..77868ebda6 --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/compound.dart @@ -0,0 +1,184 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/code_generator/typedef.dart'; + +import 'binding.dart'; +import 'binding_string.dart'; +import 'type.dart'; +import 'utils.dart'; +import 'writer.dart'; + +enum CompoundType { struct, union } + +/// A binding for Compound type - Struct/Union. +abstract class Compound 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; + + bool get isOpaque => members.isEmpty; + + /// Value for `@Packed(X)` annotation. Can be null(no packing), 1, 2, 4, 8, 16. + /// + /// Only supported for [CompoundType.struct]. + int? pack; + + /// Marker for checking if the dependencies are parsed. + bool parsedDependencies = false; + + CompoundType compoundType; + bool get isStruct => compoundType == CompoundType.struct; + bool get isUnion => compoundType == CompoundType.union; + + Compound({ + String? usr, + String? originalName, + required String name, + required this.compoundType, + this.isInComplete = false, + this.pack, + String? dartDoc, + List? members, + }) : members = members ?? [], + super( + usr: usr, + originalName: originalName, + name: name, + dartDoc: dartDoc, + ); + + factory Compound.fromType({ + required CompoundType type, + String? usr, + String? originalName, + required String name, + bool isInComplete = false, + int? pack, + String? dartDoc, + List? members, + }) { + switch (type) { + case CompoundType.struct: + return Struc( + usr: usr, + originalName: originalName, + name: name, + isInComplete: isInComplete, + pack: pack, + dartDoc: dartDoc, + members: members, + ); + case CompoundType.union: + return Union( + usr: usr, + originalName: originalName, + name: name, + isInComplete: isInComplete, + pack: pack, + dartDoc: dartDoc, + members: members, + ); + } + } + + List _getArrayDimensionLengths(Type type) { + final array = []; + var startType = type; + while (startType.broadType == BroadType.ConstantArray) { + array.add(startType.length!); + startType = startType.child!; + } + return array; + } + + String _getInlineArrayTypeString(Type type, Writer w) { + if (type.broadType == BroadType.ConstantArray) { + return '${w.ffiLibraryPrefix}.Array<${_getInlineArrayTypeString(type.child!, w)}>'; + } + return type.getCType(w); + } + + List? _typedefDependencies; + @override + List getTypedefDependencies(Writer w) { + if (_typedefDependencies == null) { + _typedefDependencies = []; + + // Write typedef's required by members and resolve name conflicts. + for (final m in members) { + final base = m.type.getBaseType(); + if (base.broadType == BroadType.NativeFunction) { + _typedefDependencies!.addAll(base.nativeFunc!.getDependencies()); + } + } + } + return _typedefDependencies ?? []; + } + + @override + BindingString toBindingString(Writer w) { + final s = StringBuffer(); + final enclosingClassName = name; + if (dartDoc != null) { + s.write(makeDartDoc(dartDoc!)); + } + + /// Adding [enclosingClassName] because dart doesn't allow class member + /// to have the same name as the class. + final localUniqueNamer = UniqueNamer({enclosingClassName}); + + /// Write @Packed(X) annotation if struct is packed. + if (isStruct && pack != null) { + s.write('@${w.ffiLibraryPrefix}.Packed($pack)\n'); + } + final dartClassName = isStruct ? 'Struct' : 'Union'; + // Write class declaration. + s.write( + 'class $enclosingClassName extends ${w.ffiLibraryPrefix}.${isOpaque ? 'Opaque' : dartClassName}{\n'); + const depth = ' '; + for (final m in members) { + final memberName = localUniqueNamer.makeUnique(m.name); + if (m.type.broadType == BroadType.ConstantArray) { + s.write( + '$depth@${w.ffiLibraryPrefix}.Array.multi(${_getArrayDimensionLengths(m.type)})\n'); + s.write( + '${depth}external ${_getInlineArrayTypeString(m.type, w)} $memberName;\n\n'); + } else { + if (m.dartDoc != null) { + s.write(depth + '/// '); + s.writeAll(m.dartDoc!.split('\n'), '\n' + depth + '/// '); + s.write('\n'); + } + if (m.type.isPrimitive) { + s.write('$depth@${m.type.getCType(w)}()\n'); + } + s.write('${depth}external ${m.type.getDartType(w)} $memberName;\n\n'); + } + } + s.write('}\n\n'); + + return BindingString( + type: isStruct ? BindingStringType.struc : BindingStringType.union, + string: s.toString()); + } +} + +class Member { + final String? dartDoc; + final String originalName; + final String name; + final Type type; + + const Member({ + String? originalName, + required this.name, + required this.type, + this.dartDoc, + }) : originalName = originalName ?? name; +} diff --git a/pkgs/ffigen/lib/src/code_generator/global.dart b/pkgs/ffigen/lib/src/code_generator/global.dart index 1951371f06..cf864cd929 100644 --- a/pkgs/ffigen/lib/src/code_generator/global.dart +++ b/pkgs/ffigen/lib/src/code_generator/global.dart @@ -66,8 +66,8 @@ class Global extends LookUpBinding { s.write( "late final ${w.ffiLibraryPrefix}.Pointer<$cType> $pointerName = ${w.lookupFuncIdentifier}<$cType>('$originalName');\n\n"); - if (type.broadType == BroadType.Struct) { - if (type.struc!.isOpaque) { + if (type.broadType == BroadType.Compound) { + if (type.compound!.isOpaque) { s.write( '${w.ffiLibraryPrefix}.Pointer<$cType> get $globalVarName => $pointerName;\n\n'); } else { diff --git a/pkgs/ffigen/lib/src/code_generator/struc.dart b/pkgs/ffigen/lib/src/code_generator/struc.dart index 8b878919fe..4f06369b6f 100644 --- a/pkgs/ffigen/lib/src/code_generator/struc.dart +++ b/pkgs/ffigen/lib/src/code_generator/struc.dart @@ -2,13 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:ffigen/src/code_generator/typedef.dart'; - -import 'binding.dart'; -import 'binding_string.dart'; -import 'type.dart'; -import 'utils.dart'; -import 'writer.dart'; +import 'package:ffigen/src/code_generator/compound.dart'; /// A binding for C Struct. /// @@ -34,127 +28,23 @@ 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; - - bool get isOpaque => members.isEmpty; - - /// Value for `@Packed(X)` annotation. Can be null(no packing), 1, 2, 4, 8, 16. - int? pack; - - /// Marker for checking if the dependencies are parsed. - bool parsedDependencies = false; - +class Struc extends Compound { Struc({ String? usr, String? originalName, required String name, - this.isInComplete = false, - this.pack, + bool isInComplete = false, + int? pack, String? dartDoc, List? members, - }) : members = members ?? [], - super( + }) : super( usr: usr, originalName: originalName, name: name, dartDoc: dartDoc, + isInComplete: isInComplete, + members: members, + pack: pack, + compoundType: CompoundType.struct, ); - - List _getArrayDimensionLengths(Type type) { - final array = []; - var startType = type; - while (startType.broadType == BroadType.ConstantArray) { - array.add(startType.length!); - startType = startType.child!; - } - return array; - } - - String _getInlineArrayTypeString(Type type, Writer w) { - if (type.broadType == BroadType.ConstantArray) { - return '${w.ffiLibraryPrefix}.Array<${_getInlineArrayTypeString(type.child!, w)}>'; - } - return type.getCType(w); - } - - List? _typedefDependencies; - @override - List getTypedefDependencies(Writer w) { - if (_typedefDependencies == null) { - _typedefDependencies = []; - - // Write typedef's required by members and resolve name conflicts. - for (final m in members) { - final base = m.type.getBaseType(); - if (base.broadType == BroadType.NativeFunction) { - _typedefDependencies!.addAll(base.nativeFunc!.getDependencies()); - } - } - } - return _typedefDependencies ?? []; - } - - @override - BindingString toBindingString(Writer w) { - final s = StringBuffer(); - final enclosingClassName = name; - if (dartDoc != null) { - s.write(makeDartDoc(dartDoc!)); - } - - /// Adding [enclosingClassName] because dart doesn't allow class member - /// to have the same name as the class. - final localUniqueNamer = UniqueNamer({enclosingClassName}); - - /// Write @Packed(X) annotation if struct is packed. - if (pack != null) { - s.write('@${w.ffiLibraryPrefix}.Packed($pack)\n'); - } - // Write class declaration. - s.write( - 'class $enclosingClassName extends ${w.ffiLibraryPrefix}.${isOpaque ? 'Opaque' : 'Struct'}{\n'); - const depth = ' '; - for (final m in members) { - final memberName = localUniqueNamer.makeUnique(m.name); - if (m.type.broadType == BroadType.ConstantArray) { - s.write( - '$depth@${w.ffiLibraryPrefix}.Array.multi(${_getArrayDimensionLengths(m.type)})\n'); - s.write( - '${depth}external ${_getInlineArrayTypeString(m.type, w)} $memberName;\n\n'); - } else { - if (m.dartDoc != null) { - s.write(depth + '/// '); - s.writeAll(m.dartDoc!.split('\n'), '\n' + depth + '/// '); - s.write('\n'); - } - if (m.type.isPrimitive) { - s.write('$depth@${m.type.getCType(w)}()\n'); - } - s.write('${depth}external ${m.type.getDartType(w)} $memberName;\n\n'); - } - } - s.write('}\n\n'); - - return BindingString(type: BindingStringType.struc, string: s.toString()); - } -} - -class Member { - final String? dartDoc; - final String originalName; - final String name; - final Type type; - - const Member({ - String? originalName, - required this.name, - required this.type, - this.dartDoc, - }) : originalName = originalName ?? name; } diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index 74b3aa5f1d..c306395c2b 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -2,7 +2,9 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'struc.dart'; +import 'package:ffigen/src/code_generator.dart'; + +import 'compound.dart'; import 'typedef.dart'; import 'writer.dart'; @@ -34,7 +36,7 @@ enum BroadType { Boolean, NativeType, Pointer, - Struct, + Compound, NativeFunction, /// Represents a Dart_Handle. @@ -44,7 +46,7 @@ enum BroadType { ConstantArray, IncompleteArray, - /// Used as a marker, so that functions/structs having these can exclude them. + /// Used as a marker, so that declarations having these can exclude them. Unimplemented, } @@ -66,8 +68,8 @@ class Type { SupportedNativeType.IntPtr: _SubType(c: 'IntPtr', dart: 'int'), }; - /// Reference to the [Struc] binding this type refers to. - Struc? struc; + /// Reference to the [Compound] binding this type refers to. + Compound? compound; /// Reference to the [Typedef] this type refers to. Typedef? nativeFunc; @@ -90,7 +92,7 @@ class Type { Type._({ required this.broadType, this.child, - this.struc, + this.compound, this.nativeType, this.nativeFunc, this.length, @@ -100,8 +102,14 @@ class Type { factory Type.pointer(Type child) { return Type._(broadType: BroadType.Pointer, child: child); } + factory Type.compound(Compound compound) { + return Type._(broadType: BroadType.Compound, compound: compound); + } factory Type.struct(Struc struc) { - return Type._(broadType: BroadType.Struct, struc: struc); + return Type._(broadType: BroadType.Compound, compound: struc); + } + factory Type.union(Union union) { + return Type._(broadType: BroadType.Compound, compound: union); } factory Type.nativeFunc(Typedef nativeFunc) { return Type._(broadType: BroadType.NativeFunction, nativeFunc: nativeFunc); @@ -162,11 +170,13 @@ 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 != null && struc!.isInComplete) || + /// Returns true if the type is a [Compound] and is incomplete. + bool get isIncompleteCompound => + (broadType == BroadType.Compound && + compound != null && + compound!.isInComplete) || (broadType == BroadType.ConstantArray && - getBaseArrayType().isIncompleteStruct); + getBaseArrayType().isIncompleteCompound); String getCType(Writer w) { switch (broadType) { @@ -174,8 +184,8 @@ class Type { return '${w.ffiLibraryPrefix}.${_primitives[nativeType!]!.c}'; case BroadType.Pointer: return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; - case BroadType.Struct: - return '${struc!.name}'; + case BroadType.Compound: + return '${compound!.name}'; case BroadType.NativeFunction: return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFunc!.name}>'; case BroadType @@ -199,8 +209,8 @@ class Type { return _primitives[nativeType!]!.dart; case BroadType.Pointer: return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; - case BroadType.Struct: - return '${struc!.name}'; + case BroadType.Compound: + return '${compound!.name}'; case BroadType.NativeFunction: return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFunc!.name}>'; case BroadType diff --git a/pkgs/ffigen/lib/src/code_generator/union.dart b/pkgs/ffigen/lib/src/code_generator/union.dart new file mode 100644 index 0000000000..a8a08611ca --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/union.dart @@ -0,0 +1,49 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator/compound.dart'; + +/// A binding for a C union - +/// +/// ```c +/// union C { +/// int a; +/// double b; +/// float c; +/// }; +/// ``` +/// The generated dart code is - +/// ```dart +/// class Union extends ffi.Union{ +/// @ffi.Int32() +/// int a; +/// +/// @ffi.Double() +/// double b; +/// +/// @ffi.Float() +/// float c; +/// +/// } +/// ``` +class Union extends Compound { + Union({ + String? usr, + String? originalName, + required String name, + bool isInComplete = false, + int? pack, + String? dartDoc, + List? members, + }) : super( + usr: usr, + originalName: originalName, + name: name, + dartDoc: dartDoc, + isInComplete: isInComplete, + members: members, + pack: pack, + compoundType: CompoundType.union, + ); +} diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index e42ed46494..92194dc1db 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -43,6 +43,10 @@ class Config { Declaration get structDecl => _structDecl; late Declaration _structDecl; + /// Declaration config for Unions. + Declaration get unionDecl => _unionDecl; + late Declaration _unionDecl; + /// Declaration config for Enums. Declaration get enumClassDecl => _enumClassDecl; late Declaration _enumClassDecl; @@ -77,8 +81,12 @@ class Config { late CommentType _commentType; /// Whether structs that are dependencies should be included. - StructDependencies get structDependencies => _structDependencies; - late StructDependencies _structDependencies; + CompoundDependencies get structDependencies => _structDependencies; + late CompoundDependencies _structDependencies; + + /// Whether unions that are dependencies should be included. + CompoundDependencies get unionDependencies => _unionDependencies; + late CompoundDependencies _unionDependencies; /// Holds config for how struct packing should be overriden. StructPackingOverride get structPackingOverride => _structPackingOverride; @@ -234,6 +242,15 @@ class Config { _structDecl = result as Declaration; }, ), + [strings.unions]: Specification( + requirement: Requirement.no, + validator: declarationConfigValidator, + extractor: declarationConfigExtractor, + defaultValue: () => Declaration(), + extractedResult: (dynamic result) { + _unionDecl = result as Declaration; + }, + ), [strings.enums]: Specification( requirement: Requirement.no, validator: declarationConfigValidator, @@ -312,14 +329,23 @@ class Config { extractedResult: (dynamic result) => _commentType = result as CommentType, ), - [strings.structs, strings.structDependencies]: - Specification( + [strings.structs, strings.dependencyOnly]: + Specification( + requirement: Requirement.no, + validator: dependencyOnlyValidator, + extractor: dependencyOnlyExtractor, + defaultValue: () => CompoundDependencies.full, + extractedResult: (dynamic result) => + _structDependencies = result as CompoundDependencies, + ), + [strings.unions, strings.dependencyOnly]: + Specification( requirement: Requirement.no, - validator: structDependenciesValidator, - extractor: structDependenciesExtractor, - defaultValue: () => StructDependencies.full, + validator: dependencyOnlyValidator, + extractor: dependencyOnlyExtractor, + defaultValue: () => CompoundDependencies.full, extractedResult: (dynamic result) => - _structDependencies = result as StructDependencies, + _unionDependencies = result as CompoundDependencies, ), [strings.structs, strings.structPack]: Specification( diff --git a/pkgs/ffigen/lib/src/config_provider/config_types.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart index 7fcc3526c3..42e99f0961 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_types.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart @@ -29,7 +29,7 @@ class CommentType { enum CommentStyle { doxygen, any } enum CommentLength { none, brief, full } -enum StructDependencies { full, opaque } +enum CompoundDependencies { full, opaque } /// Holds config for how Structs Packing will be overriden. class StructPackingOverride { diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 73c0d0db13..a36ee50b5b 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -658,21 +658,21 @@ bool commentValidator(List name, dynamic value) { } } -StructDependencies structDependenciesExtractor(dynamic value) { - var result = StructDependencies.full; - if (value == strings.opaqueStructDependencies) { - result = StructDependencies.opaque; +CompoundDependencies dependencyOnlyExtractor(dynamic value) { + var result = CompoundDependencies.full; + if (value == strings.opaqueCompoundDependencies) { + result = CompoundDependencies.opaque; } return result; } -bool structDependenciesValidator(List name, dynamic value) { +bool dependencyOnlyValidator(List name, dynamic value) { var result = true; if (value is! String || - !(value == strings.fullStructDependencies || - value == strings.opaqueStructDependencies)) { + !(value == strings.fullCompoundDependencies || + value == strings.opaqueCompoundDependencies)) { _logger.severe( - "'$name' must be one of the following - {${strings.fullStructDependencies}, ${strings.opaqueStructDependencies}}"); + "'$name' must be one of the following - {${strings.fullCompoundDependencies}, ${strings.opaqueCompoundDependencies}}"); result = false; } return result; diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart index bd824761b3..1cd4ff16b0 100644 --- a/pkgs/ffigen/lib/src/header_parser/includer.dart +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -17,6 +17,16 @@ bool shouldIncludeStruct(String usr, String name) { } } +bool shouldIncludeUnion(String usr, String name) { + if (bindingsIndex.isSeenStruct(usr) || name == '') { + return false; + } else if (config.unionDecl.shouldInclude(name)) { + return true; + } else { + return false; + } +} + bool shouldIncludeFunc(String usr, String name) { if (bindingsIndex.isSeenFunc(usr) || name == '') { return false; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart new file mode 100644 index 0000000000..82bac38b82 --- /dev/null +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart @@ -0,0 +1,303 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:ffi'; + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/config_provider/config_types.dart'; +import 'package:logging/logging.dart'; + +import '../../strings.dart' as strings; +import '../clang_bindings/clang_bindings.dart' as clang_types; +import '../data.dart'; +import '../includer.dart'; +import '../utils.dart'; + +final _logger = Logger('ffigen.header_parser.compounddecl_parser'); + +/// Holds temporary information regarding [compound] while parsing. +class _ParsedCompound { + Compound? compound; + bool unimplementedMemberType = false; + bool flexibleArrayMember = false; + bool bitFieldMember = false; + bool dartHandleMember = false; + bool incompleteCompoundMember = false; + + bool get isInComplete => + unimplementedMemberType || + flexibleArrayMember || + bitFieldMember || + (dartHandleMember && config.useDartHandle) || + incompleteCompoundMember; + + // A struct without any attribute is definitely not packed. #pragma pack(...) + // also adds an attribute, but it's unexposed and cannot be travesed. + bool hasAttr = false; + // A struct which as a __packed__ attribute is definitely packed. + bool hasPackedAttr = false; + // Stores the maximum alignment from all the children. + int maxChildAlignment = 0; + // Alignment of this struct. + int allignment = 0; + + bool get _isPacked { + if (!hasAttr || isInComplete) return false; + if (hasPackedAttr) return true; + + return maxChildAlignment > allignment; + } + + /// Returns pack value of a struct depending on config, returns null for no + /// packing. + int? get packValue { + if (compound!.isStruct && _isPacked) { + if (strings.packingValuesMap.containsKey(allignment)) { + return allignment; + } else { + _logger.warning( + 'Unsupported pack value "$allignment" for Struct "${compound!.name}".'); + return null; + } + } else { + return null; + } + } + + _ParsedCompound(); +} + +final _stack = Stack<_ParsedCompound>(); + +/// Parses a compound declaration. +Compound? parseCompoundDeclaration( + clang_types.CXCursor cursor, + CompoundType compoundType, { + + /// Optionally provide name (useful in case declaration is inside a typedef). + String? name, + + /// Option to ignore declaration filter (Useful in case of extracting + /// declarations when they are passed/returned by an included function.) + bool ignoreFilter = false, + + /// To track if the declaration was used by reference(i.e T*). (Used to only + /// generate these as opaque if `dependency-only` was set to opaque). + bool pointerReference = false, + + /// If the compound name should be updated, if it was already seen. + bool updateName = true, +}) { + _stack.push(_ParsedCompound()); + + // Parse the cursor definition instead, if this is a forward declaration. + if (isForwardDeclaration(cursor)) { + cursor = clang.clang_getCursorDefinition(cursor); + } + final declUsr = cursor.usr(); + final declName = name ?? cursor.spelling(); + + // Set includer functions according to compoundType. + final bool Function(String, String) shouldIncludeDecl; + final bool Function(String) isSeenDecl; + final Compound? Function(String) getSeenDecl; + final void Function(String, Compound) addDeclToSeen; + final Declaration configDecl; + final String className; + switch (compoundType) { + case CompoundType.struct: + shouldIncludeDecl = shouldIncludeStruct; + isSeenDecl = bindingsIndex.isSeenStruct; + getSeenDecl = bindingsIndex.getSeenStruct; + addDeclToSeen = bindingsIndex.addStructToSeen; + configDecl = config.structDecl; + className = 'Struct'; + break; + case CompoundType.union: + shouldIncludeDecl = shouldIncludeUnion; + isSeenDecl = bindingsIndex.isSeenUnion; + getSeenDecl = bindingsIndex.getSeenUnion; + addDeclToSeen = bindingsIndex.addUnionToSeen; + configDecl = config.unionDecl; + className = 'Union'; + break; + } + + if (declName.isEmpty) { + if (ignoreFilter) { + // This declaration is defined inside some other declaration and hence + // must be generated. + _stack.top.compound = Compound.fromType( + type: compoundType, + name: incrementalNamer.name('unnamed$className'), + usr: declUsr, + dartDoc: getCursorDocComment(cursor), + ); + _setMembers(cursor, className); + } else { + _logger.finest('unnamed $className or typedef $className declaration'); + } + } else { + if ((ignoreFilter || shouldIncludeDecl(declUsr, declName)) && + (!isSeenDecl(declUsr))) { + _logger.fine( + '++++ Adding $className: Name: $declName, ${cursor.completeStringRepr()}'); + _stack.top.compound = Compound.fromType( + type: compoundType, + usr: declUsr, + originalName: declName, + name: configDecl.renameUsingConfig(declName), + dartDoc: getCursorDocComment(cursor), + ); + // Adding to seen here to stop recursion if a declaration has itself as a + // member, members are updated later. + addDeclToSeen(declUsr, _stack.top.compound!); + } + } + + if (isSeenDecl(declUsr)) { + _stack.top.compound = getSeenDecl(declUsr); + + // Skip dependencies if already seen OR user has specified `dependency-only` + // as opaque AND this is a pointer reference AND the declaration was not + // included according to config (ignoreFilter). + final skipDependencies = _stack.top.compound!.parsedDependencies || + (pointerReference && + ignoreFilter && + ((compoundType == CompoundType.struct && + config.structDependencies == CompoundDependencies.opaque) || + (compoundType == CompoundType.union && + config.unionDependencies == CompoundDependencies.opaque))); + + if (!skipDependencies) { + // Prevents infinite recursion if struct has a pointer to itself. + _stack.top.compound!.parsedDependencies = true; + _setMembers(cursor, className); + } else if (!_stack.top.compound!.parsedDependencies) { + _logger.fine('Skipped dependencies.'); + } + + if (updateName) { + // If struct is seen, update it's name. + _stack.top.compound!.name = configDecl.renameUsingConfig(declName); + } + } + + return _stack.pop().compound; +} + +void _setMembers(clang_types.CXCursor cursor, String className) { + _stack.top.hasAttr = clang.clang_Cursor_hasAttrs(cursor) != 0; + _stack.top.allignment = cursor.type().alignment(); + + final resultCode = clang.clang_visitChildren( + cursor, + Pointer.fromFunction(_compoundMembersVisitor, + clang_types.CXChildVisitResult.CXChildVisit_Break), + nullptr, + ); + + _logger.finest( + 'Opaque: ${_stack.top.isInComplete}, HasAttr: ${_stack.top.hasAttr}, AlignValue: ${_stack.top.allignment}, MaxChildAlignValue: ${_stack.top.maxChildAlignment}, PackValue: ${_stack.top.packValue}.'); + _stack.top.compound!.pack = _stack.top.packValue; + + visitChildrenResultChecker(resultCode); + + if (_stack.top.unimplementedMemberType) { + _logger.fine( + '---- Removed $className members, reason: member with unimplementedtype ${cursor.completeStringRepr()}'); + _logger.warning( + 'Removed All $className Members from ${_stack.top.compound!.name}(${_stack.top.compound!.originalName}), struct member has an unsupported type.'); + } else if (_stack.top.flexibleArrayMember) { + _logger.fine( + '---- Removed $className members, reason: incomplete array member ${cursor.completeStringRepr()}'); + _logger.warning( + 'Removed All $className Members from ${_stack.top.compound!.name}(${_stack.top.compound!.originalName}), Flexible array members not supported.'); + } else if (_stack.top.bitFieldMember) { + _logger.fine( + '---- Removed $className members, reason: bitfield members ${cursor.completeStringRepr()}'); + _logger.warning( + 'Removed All $className Members from ${_stack.top.compound!.name}(${_stack.top.compound!.originalName}), Bit Field members not supported.'); + } else if (_stack.top.dartHandleMember && config.useDartHandle) { + _logger.fine( + '---- Removed $className members, reason: Dart_Handle member. ${cursor.completeStringRepr()}'); + _logger.warning( + 'Removed All $className Members from ${_stack.top.compound!.name}(${_stack.top.compound!.originalName}), Dart_Handle member not supported.'); + } else if (_stack.top.incompleteCompoundMember) { + _logger.fine( + '---- Removed $className members, reason: Incomplete Nested Struct member. ${cursor.completeStringRepr()}'); + _logger.warning( + 'Removed All $className Members from ${_stack.top.compound!.name}(${_stack.top.compound!.originalName}), Incomplete Nested Struct member not supported.'); + } + + // Clear all members if declaration is incomplete. + if (_stack.top.isInComplete) { + _stack.top.compound!.members.clear(); + } + + // C allows empty structs/union, but it's undefined behaviour at runtine. + // So we need to mark a declaration incomplete if it has no members. + _stack.top.compound!.isInComplete = + _stack.top.isInComplete || _stack.top.compound!.members.isEmpty; +} + +/// Visitor for the struct/union cursor [CXCursorKind.CXCursor_StructDecl]/ +/// [CXCursorKind.CXCursor_UnionDecl]. +/// +/// Child visitor invoked on struct/union cursor. +int _compoundMembersVisitor(clang_types.CXCursor cursor, + clang_types.CXCursor parent, Pointer clientData) { + try { + if (cursor.kind == clang_types.CXCursorKind.CXCursor_FieldDecl) { + _logger.finer('===== member: ${cursor.completeStringRepr()}'); + + // Set maxChildAlignValue. + final align = cursor.type().alignment(); + if (align > _stack.top.maxChildAlignment) { + _stack.top.maxChildAlignment = align; + } + + final mt = cursor.type().toCodeGenType(); + if (mt.broadType == BroadType.IncompleteArray) { + // TODO(68): Structs with flexible Array Members are not supported. + _stack.top.flexibleArrayMember = true; + } + if (clang.clang_getFieldDeclBitWidth(cursor) != -1) { + // TODO(84): Struct with bitfields are not suppoorted. + _stack.top.bitFieldMember = true; + } + if (mt.broadType == BroadType.Handle) { + _stack.top.dartHandleMember = true; + } + if (mt.isIncompleteCompound) { + _stack.top.incompleteCompoundMember = true; + } + if (mt.getBaseType().broadType == BroadType.Unimplemented) { + _stack.top.unimplementedMemberType = true; + } + + _stack.top.compound!.members.add( + Member( + dartDoc: getCursorDocComment( + cursor, + nesting.length + commentPrefix.length, + ), + originalName: cursor.spelling(), + name: config.structDecl.renameMemberUsingConfig( + _stack.top.compound!.originalName, + cursor.spelling(), + ), + type: mt, + ), + ); + } else if (cursor.kind == clang_types.CXCursorKind.CXCursor_PackedAttr) { + _stack.top.hasPackedAttr = true; + } + } catch (e, s) { + _logger.severe(e); + _logger.severe(s); + rethrow; + } + return clang_types.CXChildVisitResult.CXChildVisit_Continue; +} diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index ac1d11ddf6..a715f0e1b6 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -45,7 +45,7 @@ Func? parseFunctionDeclaration(clang_types.CXCursor cursor) { .func; // Returning null so that [addToBindings] function excludes this. } - if (rt.isIncompleteStruct || _stack.top.incompleteStructParameter) { + if (rt.isIncompleteCompound || _stack.top.incompleteStructParameter) { _logger.fine( '---- Removed Function, reason: Incomplete struct pass/return by value: ${cursor.completeStringRepr()}'); _logger.warning( @@ -101,7 +101,7 @@ List _getParameters(clang_types.CXCursor cursor, String funcName) { _logger.finer('===== parameter: ${paramCursor.completeStringRepr()}'); final pt = _getParameterType(paramCursor); - if (pt.isIncompleteStruct) { + if (pt.isIncompleteCompound) { _stack.top.incompleteStructParameter = true; } else if (pt.getBaseType().broadType == BroadType.Unimplemented) { _logger diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart deleted file mode 100644 index e5970f475b..0000000000 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'dart:ffi'; - -import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider/config_types.dart'; -import 'package:logging/logging.dart'; - -import '../../strings.dart' as strings; -import '../clang_bindings/clang_bindings.dart' as clang_types; -import '../data.dart'; -import '../includer.dart'; -import '../utils.dart'; - -final _logger = Logger('ffigen.header_parser.structdecl_parser'); - -/// Holds temporary information regarding [struc] while parsing. -class _ParsedStruc { - Struc? struc; - bool unimplementedMemberType = false; - bool flexibleArrayMember = false; - bool bitFieldMember = false; - bool dartHandleMember = false; - bool incompleteStructMember = false; - - bool get isInComplete => - unimplementedMemberType || - flexibleArrayMember || - bitFieldMember || - (dartHandleMember && config.useDartHandle) || - incompleteStructMember; - - // A struct without any attribute is definitely not packed. #pragma pack(...) - // also adds an attribute, but it's unexposed and cannot be travesed. - bool hasAttr = false; - // A struct which as a __packed__ attribute is definitely packed. - bool hasPackedAttr = false; - // Stores the maximum alignment from all the children. - int maxChildAlignment = 0; - // Alignment of this struct. - int allignment = 0; - - bool get _isPacked { - if (!hasAttr || isInComplete) return false; - if (hasPackedAttr) return true; - - return maxChildAlignment > allignment; - } - - /// Returns pack value of a struct depending on config, returns null for no - /// packing. - int? get packValue { - if (_isPacked) { - if (strings.packingValuesMap.containsKey(allignment)) { - return allignment; - } else { - _logger.warning( - 'Unsupported pack value "$allignment" for Struct "${struc!.name}".'); - return null; - } - } else { - return null; - } - } - - _ParsedStruc(); -} - -final _stack = Stack<_ParsedStruc>(); - -/// Parses a struct declaration. -Struc? parseStructDeclaration( - clang_types.CXCursor cursor, { - - /// Optionally provide name (useful in case struct is inside a typedef). - String? name, - - /// Option to ignore struct filter (Useful in case of extracting structs - /// when they are passed/returned by an included function.) - bool ignoreFilter = false, - - /// To track if the struct was used by reference(i.e struct*). (Used to only - /// generate these as opaque if `struct-dependencies` was set to opaque). - bool pointerReference = false, - - /// If the struct name should be updated, if it was already seen. - bool updateName = true, -}) { - _stack.push(_ParsedStruc()); - - // Parse the cursor definition instead, if this is a forward declaration. - if (isForwardDeclaration(cursor)) { - cursor = clang.clang_getCursorDefinition(cursor); - } - final structUsr = cursor.usr(); - final structName = name ?? cursor.spelling(); - - if (structName.isEmpty) { - if (ignoreFilter) { - // This struct is defined inside some other struct and hence must be generated. - _stack.top.struc = Struc( - name: incrementalNamer.name('unnamedStruct'), - usr: structUsr, - dartDoc: getCursorDocComment(cursor), - ); - _setStructMembers(cursor); - } else { - _logger.finest('unnamed structure or typedef structure declaration'); - } - } else if ((ignoreFilter || shouldIncludeStruct(structUsr, structName)) && - (!bindingsIndex.isSeenStruct(structUsr))) { - _logger.fine( - '++++ Adding Structure: structName: $structName, ${cursor.completeStringRepr()}'); - _stack.top.struc = Struc( - usr: structUsr, - originalName: structName, - name: config.structDecl.renameUsingConfig(structName), - dartDoc: getCursorDocComment(cursor), - ); - // Adding to seen here to stop recursion if a struct has itself as a - // member, members are updated later. - bindingsIndex.addStructToSeen(structUsr, _stack.top.struc!); - } - - if (bindingsIndex.isSeenStruct(structUsr)) { - _stack.top.struc = bindingsIndex.getSeenStruct(structUsr); - - final skipDependencies = _stack.top.struc!.parsedDependencies || - (config.structDependencies == StructDependencies.opaque && - pointerReference && - ignoreFilter); - - if (!skipDependencies) { - // Prevents infinite recursion if struct has a pointer to itself. - _stack.top.struc!.parsedDependencies = true; - _setStructMembers(cursor); - } else if (!_stack.top.struc!.parsedDependencies) { - _logger.fine('Skipped dependencies.'); - } - - if (updateName) { - // If struct is seen, update it's name. - _stack.top.struc!.name = config.structDecl.renameUsingConfig(structName); - } - } - - return _stack.pop().struc; -} - -void _setStructMembers(clang_types.CXCursor cursor) { - _stack.top.hasAttr = clang.clang_Cursor_hasAttrs(cursor) != 0; - _stack.top.allignment = cursor.type().alignment(); - - final resultCode = clang.clang_visitChildren( - cursor, - Pointer.fromFunction(_structMembersVisitor, - clang_types.CXChildVisitResult.CXChildVisit_Break), - nullptr, - ); - - _logger.finest( - 'Opaque: ${_stack.top.isInComplete}, HasAttr: ${_stack.top.hasAttr}, AlignValue: ${_stack.top.allignment}, MaxChildAlignValue: ${_stack.top.maxChildAlignment}, PackValue: ${_stack.top.packValue}.'); - _stack.top.struc!.pack = _stack.top.packValue; - - visitChildrenResultChecker(resultCode); - - 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.'); - } 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.'); - } 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.'); - } 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.'); - } 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(); - } - - // C allow empty structs, but it's undefined behaviour at runtine. So we need - // to mark a struct incomplete if it has no members. - _stack.top.struc!.isInComplete = - _stack.top.isInComplete || _stack.top.struc!.members.isEmpty; -} - -/// Visitor for the struct cursor [CXCursorKind.CXCursor_StructDecl]. -/// -/// Child visitor invoked on struct cursor. -int _structMembersVisitor(clang_types.CXCursor cursor, - clang_types.CXCursor parent, Pointer clientData) { - try { - if (cursor.kind == clang_types.CXCursorKind.CXCursor_FieldDecl) { - _logger.finer('===== member: ${cursor.completeStringRepr()}'); - - // Set maxChildAlignValue. - final align = cursor.type().alignment(); - if (align > _stack.top.maxChildAlignment) { - _stack.top.maxChildAlignment = align; - } - - final mt = cursor.type().toCodeGenType(); - if (mt.broadType == BroadType.IncompleteArray) { - // TODO(68): Structs with flexible Array Members are not supported. - _stack.top.flexibleArrayMember = true; - } - if (clang.clang_getFieldDeclBitWidth(cursor) != -1) { - // TODO(84): Struct with bitfields are not suppoorted. - _stack.top.bitFieldMember = true; - } - if (mt.broadType == BroadType.Handle) { - _stack.top.dartHandleMember = true; - } - if (mt.isIncompleteStruct) { - _stack.top.incompleteStructMember = true; - } - if (mt.getBaseType().broadType == BroadType.Unimplemented) { - _stack.top.unimplementedMemberType = true; - } - - _stack.top.struc!.members.add( - Member( - dartDoc: getCursorDocComment( - cursor, - nesting.length + commentPrefix.length, - ), - originalName: cursor.spelling(), - name: config.structDecl.renameMemberUsingConfig( - _stack.top.struc!.originalName, - cursor.spelling(), - ), - type: mt, - ), - ); - } else if (cursor.kind == clang_types.CXCursorKind.CXCursor_PackedAttr) { - _stack.top.hasPackedAttr = true; - } - } catch (e, s) { - _logger.severe(e); - _logger.severe(s); - rethrow; - } - return clang_types.CXChildVisitResult.CXChildVisit_Continue; -} diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart index 7c74aecd4a..192c038983 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart @@ -10,8 +10,8 @@ import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang_types; import '../data.dart'; import '../sub_parsers/enumdecl_parser.dart'; -import '../sub_parsers/structdecl_parser.dart'; import '../utils.dart'; +import 'compounddecl_parser.dart'; final _logger = Logger('ffigen.header_parser.typedefdecl_parser'); @@ -82,8 +82,25 @@ int _typedefdeclarationCursorVisitor(clang_types.CXCursor cursor, _stack.top.binding = bindingsIndex.getSeenStruct(cursor.usr()); } else { // This will update the name of struct if already seen. - _stack.top.binding = - parseStructDeclaration(cursor, name: _stack.top.typedefName); + _stack.top.binding = parseCompoundDeclaration( + cursor, + CompoundType.struct, + name: _stack.top.typedefName, + ); + } + break; + case clang_types.CXCursorKind.CXCursor_UnionDecl: + if (_stack.top.typedefToPointer && + bindingsIndex.isSeenUnion(cursor.usr())) { + // Skip a typedef pointer if struct is seen. + _stack.top.binding = bindingsIndex.getSeenUnion(cursor.usr()); + } else { + // This will update the name of struct if already seen. + _stack.top.binding = parseCompoundDeclaration( + cursor, + CompoundType.union, + name: _stack.top.typedefName, + ); } break; case clang_types.CXCursorKind.CXCursor_EnumDecl: diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart index 69f7f13e1e..5f597077ce 100644 --- a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -12,9 +12,9 @@ import 'package:logging/logging.dart'; import 'clang_bindings/clang_bindings.dart' as clang_types; import 'data.dart'; import 'includer.dart'; +import 'sub_parsers/compounddecl_parser.dart'; import 'sub_parsers/enumdecl_parser.dart'; import 'sub_parsers/functiondecl_parser.dart'; -import 'sub_parsers/structdecl_parser.dart'; import 'sub_parsers/typedefdecl_parser.dart'; import 'utils.dart'; @@ -51,7 +51,10 @@ int _rootCursorVisitor(clang_types.CXCursor cursor, clang_types.CXCursor parent, addToBindings(parseTypedefDeclaration(cursor)); break; case clang_types.CXCursorKind.CXCursor_StructDecl: - addToBindings(parseStructDeclaration(cursor)); + addToBindings(parseCompoundDeclaration(cursor, CompoundType.struct)); + break; + case clang_types.CXCursorKind.CXCursor_UnionDecl: + addToBindings(parseCompoundDeclaration(cursor, CompoundType.union)); break; case clang_types.CXCursorKind.CXCursor_EnumDecl: addToBindings(parseEnumDeclaration(cursor)); diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index cd0445ea7d..521e71e8af 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -9,7 +9,7 @@ import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang_types; import '../data.dart'; -import '../sub_parsers/structdecl_parser.dart'; +import '../sub_parsers/compounddecl_parser.dart'; import '../translation_unit_parser.dart'; import '../type_extractor/cxtypekindmap.dart'; import '../utils.dart'; @@ -36,8 +36,9 @@ Type getCodeGenType( // Replace Pointer<_Dart_Handle> with Handle. if (config.useDartHandle && - s.broadType == BroadType.Struct && - s.struc!.usr == strings.dartHandleUsr) { + s.broadType == BroadType.Compound && + s.compound!.compoundType == CompoundType.struct && + s.compound!.usr == strings.dartHandleUsr) { return Type.handle(); } return Type.pointer(s); @@ -115,48 +116,69 @@ Type _extractfromRecord( final cursor = clang.clang_getTypeDeclaration(cxtype); _logger.fine('${_padding}_extractfromRecord: ${cursor.completeStringRepr()}'); - switch (clang.clang_getCursorKind(cursor)) { - case clang_types.CXCursorKind.CXCursor_StructDecl: - final structUsr = cursor.usr(); - - // Name of typedef (parentName) is used if available. - final structName = parentName ?? cursor.spelling(); - - // Also add a struct binding, if its unseen. - // TODO(23): Check if we should auto add struct. - if (bindingsIndex.isSeenStruct(structUsr)) { - type = Type.struct(bindingsIndex.getSeenStruct(structUsr)!); - - // This will parse the dependencies if needed. - parseStructDeclaration( - cursor, - name: structName, - ignoreFilter: true, - pointerReference: pointerReference, - updateName: false, - ); - } else { - final struc = parseStructDeclaration( - cursor, - name: structName, - ignoreFilter: true, - pointerReference: pointerReference, - ); - type = Type.struct(struc!); + final cursorKind = clang.clang_getCursorKind(cursor); + if (cursorKind == clang_types.CXCursorKind.CXCursor_StructDecl || + cursorKind == clang_types.CXCursorKind.CXCursor_UnionDecl) { + final declUsr = cursor.usr(); + + // Name of typedef (parentName) is used if available. + final declName = parentName ?? cursor.spelling(); + + // Set includer functions according to compoundType. + final bool Function(String) isSeenDecl; + final Compound? Function(String) getSeenDecl; + final CompoundType compoundType; + + switch (cursorKind) { + case clang_types.CXCursorKind.CXCursor_StructDecl: + isSeenDecl = bindingsIndex.isSeenStruct; + getSeenDecl = bindingsIndex.getSeenStruct; + compoundType = CompoundType.struct; + break; + case clang_types.CXCursorKind.CXCursor_UnionDecl: + isSeenDecl = bindingsIndex.isSeenUnion; + getSeenDecl = bindingsIndex.getSeenUnion; + compoundType = CompoundType.union; + break; + default: + throw Exception('Unhandled compound type cursorkind.'); + } - // Add to bindings if it's not Dart_Handle and is unseen. - if (!(config.useDartHandle && structUsr == strings.dartHandleUsr)) { - addToBindings(struc); - } - } + // Also add a struct binding, if its unseen. + // TODO(23): Check if we should auto add compound declarations. + if (isSeenDecl(declUsr)) { + type = Type.compound(getSeenDecl(declUsr)!); + + // This will parse the dependencies if needed. + parseCompoundDeclaration( + cursor, + compoundType, + name: declName, + ignoreFilter: true, + pointerReference: pointerReference, + updateName: false, + ); + } else { + final struc = parseCompoundDeclaration( + cursor, + compoundType, + name: declName, + ignoreFilter: true, + pointerReference: pointerReference, + ); + type = Type.compound(struc!); - break; - default: - _logger.fine( - 'typedeclarationCursorVisitor: _extractfromRecord: Not Implemented, ${cursor.completeStringRepr()}'); - return Type.unimplemented( - 'Type: ${cxtype.kindSpelling()} not implemented'); + // Add to bindings if it's not Dart_Handle and is unseen. + if (!(config.useDartHandle && declUsr == strings.dartHandleUsr)) { + addToBindings(struc); + } + } + } else { + _logger.fine( + 'typedeclarationCursorVisitor: _extractfromRecord: Not Implemented, ${cursor.completeStringRepr()}'); + return Type.unimplemented('Type: ${cxtype.kindSpelling()} not implemented'); } + return type; } @@ -173,7 +195,7 @@ Type _extractFromFunctionProto(clang_types.CXType cxtype, String? parentName) { final t = clang.clang_getArgType(cxtype, i); final pt = t.toCodeGenType(); - if (pt.isIncompleteStruct) { + if (pt.isIncompleteCompound) { return Type.unimplemented( 'Incomplete Struct by value in function parameter.'); } else if (pt.getBaseType().broadType == BroadType.Unimplemented) { diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index fda7f6580d..272f21d86c 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -327,6 +327,7 @@ class Macro { class BindingsIndex { // Tracks if bindings are already seen, Map key is USR obtained from libclang. final Map _structs = {}; + final Map _unions = {}; final Map _functions = {}; final Map _enumClass = {}; final Map _unnamedEnumConstants = {}; @@ -339,14 +340,26 @@ class BindingsIndex { return _structs.containsKey(usr); } - void addStructToSeen(String usr, Struc struc) { - _structs[usr] = struc; + void addStructToSeen(String usr, Compound struc) { + _structs[usr] = struc as Struc; } Struc? getSeenStruct(String usr) { return _structs[usr]; } + bool isSeenUnion(String usr) { + return _unions.containsKey(usr); + } + + void addUnionToSeen(String usr, Compound union) { + _unions[usr] = union as Union; + } + + Union? getSeenUnion(String usr) { + return _unions[usr]; + } + bool isSeenFunc(String usr) { return _functions.containsKey(usr); } diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 0b5d2f1e25..b551ead6d5 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -46,6 +46,7 @@ const includeCStdLib = 'include-c-standard-library'; // Declarations. const functions = 'functions'; const structs = 'structs'; +const unions = 'unions'; const enums = 'enums'; const unnamedEnums = 'unnamed-enums'; const globals = 'globals'; @@ -58,10 +59,10 @@ const rename = 'rename'; const memberRename = 'member-rename'; const symbolAddress = 'symbol-address'; -const structDependencies = 'dependency-only'; -// Values for `structDependencies`. -const fullStructDependencies = 'full'; -const opaqueStructDependencies = 'opaque'; +const dependencyOnly = 'dependency-only'; +// Values for `compoundDependencies`. +const fullCompoundDependencies = 'full'; +const opaqueCompoundDependencies = 'opaque'; const structPack = 'pack'; const Map packingValuesMap = { diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index ddacda0fef..54793af7fd 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,12 +3,12 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 3.0.0 +version: 3.1.0-dev.0 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. environment: - sdk: '>=2.13.0 <3.0.0' + sdk: '>=2.14.0-115.0.dev <3.0.0' dependencies: ffi: ^1.0.0 diff --git a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart index 7b0fa29a76..79ac352000 100644 --- a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart @@ -404,6 +404,49 @@ void main() { ); _matchLib(library, 'packed_structs'); }); + test('Union Bindings', () { + final struct1 = Struc(name: 'Struct1', members: [ + Member(name: 'a', type: Type.nativeType(SupportedNativeType.Int8)) + ]); + final union1 = Union(name: 'Union1', members: [ + Member(name: 'a', type: Type.nativeType(SupportedNativeType.Int8)) + ]); + final library = Library( + name: 'Bindings', + bindings: [ + struct1, + union1, + Union(name: 'EmptyUnion'), + Union(name: 'Primitives', members: [ + Member(name: 'a', type: Type.nativeType(SupportedNativeType.Int8)), + Member(name: 'b', type: Type.nativeType(SupportedNativeType.Int32)), + Member(name: 'c', type: Type.nativeType(SupportedNativeType.Float)), + Member(name: 'd', type: Type.nativeType(SupportedNativeType.Double)), + ]), + Union(name: 'PrimitivesWithPointers', members: [ + Member(name: 'a', type: Type.nativeType(SupportedNativeType.Int8)), + Member(name: 'b', type: Type.nativeType(SupportedNativeType.Float)), + Member( + name: 'c', + type: Type.pointer(Type.nativeType(SupportedNativeType.Double))), + Member(name: 'd', type: Type.pointer(Type.union(union1))), + Member(name: 'd', type: Type.pointer(Type.struct(struct1))), + ]), + Union(name: 'WithArray', members: [ + Member( + name: 'a', + type: Type.constantArray( + 10, Type.nativeType(SupportedNativeType.Int8))), + Member(name: 'b', type: Type.constantArray(10, Type.union(union1))), + Member(name: 'b', type: Type.constantArray(10, Type.struct(struct1))), + Member( + name: 'c', + type: Type.constantArray(10, Type.pointer(Type.union(union1)))), + ]), + ], + ); + _matchLib(library, 'unions'); + }); } /// Utility to match expected bindings to the generated bindings. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart new file mode 100644 index 0000000000..60399e541d --- /dev/null +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart @@ -0,0 +1,58 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +class Struct1 extends ffi.Struct { + @ffi.Int8() + external int a; +} + +class Union1 extends ffi.Union { + @ffi.Int8() + external int a; +} + +class EmptyUnion extends ffi.Opaque {} + +class Primitives extends ffi.Union { + @ffi.Int8() + external int a; + + @ffi.Int32() + external int b; + + @ffi.Float() + external double c; + + @ffi.Double() + external double d; +} + +class PrimitivesWithPointers extends ffi.Union { + @ffi.Int8() + external int a; + + @ffi.Float() + external double b; + + external ffi.Pointer c; + + external ffi.Pointer d; + + external ffi.Pointer d_1; +} + +class WithArray extends ffi.Union { + @ffi.Array.multi([10]) + external ffi.Array a; + + @ffi.Array.multi([10]) + external ffi.Array b; + + @ffi.Array.multi([10]) + external ffi.Array b_1; + + @ffi.Array.multi([10]) + external ffi.Array> c; +} diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart index 0c3498fc94..c37dbafcc1 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart @@ -29,6 +29,17 @@ class NativeLibrary { late final _func_ptr = _lookup>('func'); late final _dart_func _func = _func_ptr.asFunction<_dart_func>(); + + ffi.Pointer func2( + ffi.Pointer a, + ) { + return _func2( + a, + ); + } + + late final _func2_ptr = _lookup>('func2'); + late final _dart_func2 _func2 = _func2_ptr.asFunction<_dart_func2>(); } class B extends ffi.Opaque {} @@ -48,6 +59,23 @@ class E extends ffi.Struct { external D d; } +class UB extends ffi.Opaque {} + +class UA extends ffi.Opaque {} + +class UC extends ffi.Opaque {} + +class UD extends ffi.Union { + @ffi.Int32() + external int a; +} + +class UE extends ffi.Union { + external ffi.Pointer c; + + external UD d; +} + typedef _c_func = ffi.Pointer Function( ffi.Pointer
a, ); @@ -55,3 +83,11 @@ typedef _c_func = ffi.Pointer Function( typedef _dart_func = ffi.Pointer Function( ffi.Pointer a, ); + +typedef _c_func2 = ffi.Pointer Function( + ffi.Pointer a, +); + +typedef _dart_func2 = ffi.Pointer Function( + ffi.Pointer a, +); diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart new file mode 100644 index 0000000000..a06659ee48 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart @@ -0,0 +1,74 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Unions Test +class NativeLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + NativeLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NativeLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + void func1( + ffi.Pointer s, + ) { + return _func1( + s, + ); + } + + late final _func1_ptr = _lookup>('func1'); + late final _dart_func1 _func1 = _func1_ptr.asFunction<_dart_func1>(); + + void func2( + ffi.Pointer s, + ) { + return _func2( + s, + ); + } + + late final _func2_ptr = _lookup>('func2'); + late final _dart_func2 _func2 = _func2_ptr.asFunction<_dart_func2>(); +} + +class Union1 extends ffi.Union { + @ffi.Int32() + external int a; +} + +class Union2 extends ffi.Union { + external Union1 a; +} + +class Union3 extends ffi.Opaque {} + +class Union4 extends ffi.Opaque {} + +class Union5 extends ffi.Opaque {} + +typedef _c_func1 = ffi.Void Function( + ffi.Pointer s, +); + +typedef _dart_func1 = void Function( + ffi.Pointer s, +); + +typedef _c_func2 = ffi.Void Function( + ffi.Pointer s, +); + +typedef _dart_func2 = void Function( + ffi.Pointer s, +); diff --git a/pkgs/ffigen/test/header_parser_tests/opaque_dependencies.h b/pkgs/ffigen/test/header_parser_tests/opaque_dependencies.h index fa2499328f..e30b260e7b 100644 --- a/pkgs/ffigen/test/header_parser_tests/opaque_dependencies.h +++ b/pkgs/ffigen/test/header_parser_tests/opaque_dependencies.h @@ -34,3 +34,36 @@ struct E struct C *c; struct D d; }; + +// Opaque. +union UA +{ + int a; +}; + +// Opaque. +union UB +{ + int a; +}; + +union UB *func2(union UA *a); + +// Opaque. +union UC +{ + int a; +}; + +// Full (excluded, but used by value). +union UD +{ + int a; +}; + +// Full (included) +union UE +{ + union UC *c; + union UD d; +}; diff --git a/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart b/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart index aea546871f..101e8db83c 100644 --- a/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart @@ -28,7 +28,11 @@ ${strings.headers}: ${strings.structs}: ${strings.include}: - 'E' - ${strings.structDependencies}: ${strings.opaqueStructDependencies} + ${strings.dependencyOnly}: ${strings.opaqueCompoundDependencies} +${strings.unions}: + ${strings.include}: + - 'UE' + ${strings.dependencyOnly}: ${strings.opaqueCompoundDependencies} ''') as yaml.YamlMap), ); }); diff --git a/pkgs/ffigen/test/header_parser_tests/unions.h b/pkgs/ffigen/test/header_parser_tests/unions.h new file mode 100644 index 0000000000..1bd9ae1a7f --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/unions.h @@ -0,0 +1,38 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +union Union1 +{ + int a; +}; + +union Union2 +{ + union Union1 a; +}; + +// Should be marked incomplete, long double not supported. +union Union3 +{ + long double a; +}; + +// All members should be removed, Bit fields are not supported. +union Union4 +{ + int a : 3; + int : 2; // Unnamed bit field. +}; + +// All members should be removed, Incomplete union members are not supported. +union Union5 +{ + int a; + union Union3 s; // Incomplete nested union. +}; + +void func1(union Union2 *s); + +// Incomplete array parameter will be treated as a pointer. +void func2(union Union3 s[]); diff --git a/pkgs/ffigen/test/header_parser_tests/unions_test.dart b/pkgs/ffigen/test/header_parser_tests/unions_test.dart new file mode 100644 index 0000000000..699f93d0ba --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/unions_test.dart @@ -0,0 +1,45 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; + +import '../test_utils.dart'; + +late Library actual; +void main() { + group('packed_structs_test', () { + setUpAll(() { + logWarnings(Level.SEVERE); + actual = parser.parse( + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Unions Test' +${strings.output}: 'unused' +${strings.headers}: + ${strings.entryPoints}: + - 'test/header_parser_tests/unions.h' + ''') as yaml.YamlMap), + ); + }); + + test('Expected bindings', () { + matchLibraryWithExpected(actual, [ + 'test', + 'debug_generated', + 'unions_test_output.dart' + ], [ + 'test', + 'header_parser_tests', + 'expected_bindings', + '_expected_unions_bindings.dart' + ]); + }); + }); +} From 4bed07546406124193951e20a4ccbc966f0bc9bf Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Fri, 21 May 2021 13:49:02 +0530 Subject: [PATCH 086/276] [ffigen] Allow users to specify complete dylib path (#221) --- pkgs/ffigen/CHANGELOG.md | 3 +++ pkgs/ffigen/README.md | 5 ++++- pkgs/ffigen/lib/src/config_provider/spec_utils.dart | 8 ++++++++ pkgs/ffigen/pubspec.yaml | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 6950615c17..be98e9ad9b 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 3.1.0-dev.1 +- Users can now specify exact path to dynamic library in `llvm-path`. + # 3.1.0-dev.0 - Added support for generating unions. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index ae66d69805..10911df518 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -98,7 +98,8 @@ output: 'generated_bindings.dart' llvm-path Path to llvm folder.
ffigen will sequentially search for `lib/libclang.so` on linux, `lib/libclang.dylib` on macOs and - `bin\libclang.dll` on windows, in the specified paths.
+ `bin\libclang.dll` on windows, in the specified paths.

+ Complete path to the dynamic library can also be supplied.
Required if ffigen is unable to find this at default locations. @@ -107,6 +108,8 @@ llvm-path: - '/usr/local/opt/llvm' - 'C:\Program Files\llvm` - '/usr/lib/llvm-11' + # Specify exact path to dylib + - '/usr/lib64/libclang.so' ``` diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index a36ee50b5b..52a5df9897 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -349,6 +349,14 @@ String llvmPathExtractor(dynamic value) { _logger.fine('Found dynamic library at: $dylibPath'); return dylibPath; } + // Check if user has specified complete path to dylib. + final completeDylibPath = path; + if (p.extension(completeDylibPath).isNotEmpty && + File(completeDylibPath).existsSync()) { + _logger.info( + 'Using complete dylib path: $completeDylibPath from llvm-path.'); + return completeDylibPath; + } } _logger.fine( "Couldn't find dynamic library under paths specified by ${strings.llvmPath}."); diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 54793af7fd..ef3ff7652b 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 3.1.0-dev.0 +version: 3.1.0-dev.1 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. From ae89d3ffe4af3f0678fdf173978f3289e22f423e Mon Sep 17 00:00:00 2001 From: Sunbreak Date: Mon, 31 May 2021 14:23:54 +0800 Subject: [PATCH 087/276] [ffigen] Add `structs` and `enums`'s rename to readme (#225) --- pkgs/ffigen/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 10911df518..5a99aff24c 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -215,7 +215,20 @@ functions: # Used to expose symbol and typedef. include: - myFunc +structs: + rename: + # Removes prefix underscores + # from all structures. + '_(.*)': '$1' + member-rename: + '.*': # Matches any struct. + # Removes prefix underscores + # from members. + '_(.*)': '$1' enums: + rename: + # Regexp groups based replacement. + 'CXType_(.*)': '$1' member-rename: '(.*)': # Matches any enum. # Removes '_' from beginning From eb7b6545b625222f51e8c8b25cecf82564be729d Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Thu, 3 Jun 2021 16:56:42 +0530 Subject: [PATCH 088/276] [ffigen] Generate dart typedefs for C typedefs (#224) --- pkgs/ffigen/CHANGELOG.md | 36 + pkgs/ffigen/README.md | 40 +- .../c_json/cjson_generated_bindings.dart | 1446 +-- pkgs/ffigen/example/c_json/main.dart | 13 +- pkgs/ffigen/example/c_json/pubspec.yaml | 5 +- .../libclang-example/generated_bindings.dart | 7480 +++++++------- .../example/libclang-example/pubspec.yaml | 7 +- .../example/simple/generated_bindings.dart | 92 +- pkgs/ffigen/lib/src/code_generator.dart | 2 +- .../lib/src/code_generator/binding.dart | 5 +- .../lib/src/code_generator/compound.dart | 28 +- .../lib/src/code_generator/constant.dart | 9 +- .../lib/src/code_generator/enum_class.dart | 7 + pkgs/ffigen/lib/src/code_generator/func.dart | 116 +- .../ffigen/lib/src/code_generator/global.dart | 30 +- .../lib/src/code_generator/library.dart | 24 +- pkgs/ffigen/lib/src/code_generator/type.dart | 190 +- .../lib/src/code_generator/typealias.dart | 52 + .../lib/src/code_generator/typedef.dart | 86 - .../ffigen/lib/src/code_generator/writer.dart | 45 - .../lib/src/config_provider/config.dart | 13 + .../clang_bindings/clang_bindings.dart | 1005 +- .../lib/src/header_parser/includer.dart | 86 +- .../sub_parsers/compounddecl_parser.dart | 69 +- .../sub_parsers/enumdecl_parser.dart | 37 +- .../sub_parsers/typedefdecl_parser.dart | 141 +- .../translation_unit_parser.dart | 4 - .../type_extractor/cxtypekindmap.dart | 4 - .../type_extractor/extractor.dart | 101 +- pkgs/ffigen/lib/src/header_parser/utils.dart | 41 +- pkgs/ffigen/lib/src/strings.dart | 4 +- pkgs/ffigen/pubspec.yaml | 2 +- .../code_generator_test.dart | 34 + .../_expected_boolean_dartbool_bindings.dart | 17 +- ...expected_boolean_no_dartbool_bindings.dart | 17 +- .../_expected_function_bindings.dart | 47 +- .../_expected_function_n_struct_bindings.dart | 18 +- ...internal_conflict_resolution_bindings.dart | 45 +- .../_expected_sort_bindings_bindings.dart | 16 +- .../_expected_typealias_bindings.dart | 54 + .../decl_decl_collision_test.dart | 15 + .../decl_symbol_address_collision_test.dart | 2 +- ...ecl_symbol_address_collision_bindings.dart | 12 +- .../reserved_keyword_collision_test.dart | 3 + .../example_tests/cjson_example_test.dart | 4 +- .../example_tests/libclang_example_test.dart | 6 +- .../example_tests/simple_example_test.dart | 2 +- .../comment_markup_test.dart | 2 +- .../header_parser_tests/dart_handle_test.dart | 92 +- .../_expected_comment_markup_bindings.dart | 27 +- .../_expected_dart_handle_bindings.dart | 77 + .../_expected_forward_decl_bindings.dart | 16 +- .../_expected_functions_bindings.dart | 114 + ...expected_native_func_typedef_bindings.dart | 79 +- ...expected_opaque_dependencies_bindings.dart | 56 +- .../_expected_typedef_bindings.dart | 121 + .../_expected_unions_bindings.dart | 30 +- .../forward_decl_test.dart | 2 +- .../header_parser_tests/function_n_struct.h | 9 + .../function_n_struct_test.dart | 48 +- .../header_parser_tests/functions_test.dart | 144 +- .../ffigen/test/header_parser_tests/globals.h | 3 + .../header_parser_tests/globals_test.dart | 10 + .../native_func_typedef_test.dart | 2 +- .../header_parser_tests/opaque_dependencies.h | 6 +- .../opaque_dependencies_test.dart | 3 +- .../packed_structs_test.dart | 2 +- .../ffigen/test/header_parser_tests/typedef.h | 10 + .../header_parser_tests/typedef_test.dart | 104 +- .../test/header_parser_tests/unions_test.dart | 2 +- .../_expected_cjson_bindings.dart | 1446 +-- .../_expected_libclang_bindings.dart | 6741 ++++--------- .../_expected_sqlite_bindings.dart | 8680 +++++++---------- .../large_integration_tests/large_test.dart | 5 + .../native_test/native_test_bindings.dart | 229 +- pkgs/ffigen/test/rename_tests/rename.h | 5 + .../ffigen/test/rename_tests/rename_test.dart | 32 +- 77 files changed, 11120 insertions(+), 18489 deletions(-) create mode 100644 pkgs/ffigen/lib/src/code_generator/typealias.dart delete mode 100644 pkgs/ffigen/lib/src/code_generator/typedef.dart create mode 100644 pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index be98e9ad9b..e8e031cd0c 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,39 @@ +# 4.0.0-dev.0 +- Added support for generating typedefs (_referred_ typedefs only). + + + + + + + + + +
Example C CodeGenerated Dart typedef
+ +```C++ +typedef struct A{ + ... +} TA, *PA; + +TA func(PA ptr); +``` + + +```dart +class A extends ffi.Struct {...} +typedef TA = A; +typedef PA = ffi.Pointer; +TA func(PA ptr){...} +``` +
+ +- All declarations that are excluded by the user are now only included if being +used somewhere. +- Improved struct/union include/exclude. These declarations can now be targetted +by their actual name, or if they are unnamed then by the name of the first +typedef that refers to them. + # 3.1.0-dev.1 - Users can now specify exact path to dynamic library in `llvm-path`. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 5a99aff24c..aa4ad94152 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -36,11 +36,9 @@ class NativeLibrary { return _sum(a, b); } - late final _sum_ptr = _lookup>('sum'); - late final _dart_sum _sum = _sum_ptr.asFunction<_dart_sum>(); + late final _sum_ptr = _lookup>('sum'); + late final _sum = _sum_ptr.asFunction(); } -typedef _c_sum = Int32 Function(Int32 a, Int32 b); -typedef _dart_sum = int Function(int a, int b); ``` ## Using this package - Add `ffigen` under `dev_dependencies` in your `pubspec.yaml`. @@ -246,6 +244,27 @@ globals: # Removes '_' from # beginning of a name. '_(.*)': '$1' +``` + + + + typedefs + Filters for referred typedefs.

+ Options -
+ - Include/Exclude (referred typedefs only).
+ - Rename typedefs.

+ Note: Typedefs that are not referred to anywhere will not be generated. + + + +```yaml +typedefs: + exclude: + # Typedefs starting with `p` are not generated. + - 'p.*' + rename: + # Removes '_' from beginning of a typedef. + '_(.*)': '$1' ``` @@ -524,3 +543,16 @@ functions: - 'myFunc' - '.*' # Do this to expose all pointers. ``` + +### How are Structs/Unions/Enums that are reffered to via typedefs handled? + +Named declarations use their own names even when inside another typedef. +However, unnamed declarations inside typedefs take the name of the _first_ typedef +that refers to them. + +### Why are some typedefs not generated? + +The following typedefs are not generated - +- They are not referred to anywhere in the included declarations. +- They refer to a struct/union having the same name as itself. +- They refer to a boolean, enum, inline array, Handle or any unsupported type. diff --git a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart index 2b9d0a8a35..d0fb894d37 100644 --- a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart +++ b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart @@ -43,9 +43,10 @@ class CJson { } late final _cJSON_Version_ptr = - _lookup>('cJSON_Version'); - late final _dart_cJSON_Version _cJSON_Version = - _cJSON_Version_ptr.asFunction<_dart_cJSON_Version>(); + _lookup Function()>>( + 'cJSON_Version'); + late final _cJSON_Version = + _cJSON_Version_ptr.asFunction Function()>(); void cJSON_InitHooks( ffi.Pointer hooks, @@ -56,9 +57,10 @@ class CJson { } late final _cJSON_InitHooks_ptr = - _lookup>('cJSON_InitHooks'); - late final _dart_cJSON_InitHooks _cJSON_InitHooks = - _cJSON_InitHooks_ptr.asFunction<_dart_cJSON_InitHooks>(); + _lookup)>>( + 'cJSON_InitHooks'); + late final _cJSON_InitHooks = _cJSON_InitHooks_ptr + .asFunction)>(); ffi.Pointer cJSON_Parse( ffi.Pointer value, @@ -68,10 +70,11 @@ class CJson { ); } - late final _cJSON_Parse_ptr = - _lookup>('cJSON_Parse'); - late final _dart_cJSON_Parse _cJSON_Parse = - _cJSON_Parse_ptr.asFunction<_dart_cJSON_Parse>(); + late final _cJSON_Parse_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>>('cJSON_Parse'); + late final _cJSON_Parse = _cJSON_Parse_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_ParseWithOpts( ffi.Pointer value, @@ -85,11 +88,15 @@ class CJson { ); } - late final _cJSON_ParseWithOpts_ptr = - _lookup>( - 'cJSON_ParseWithOpts'); - late final _dart_cJSON_ParseWithOpts _cJSON_ParseWithOpts = - _cJSON_ParseWithOpts_ptr.asFunction<_dart_cJSON_ParseWithOpts>(); + late final _cJSON_ParseWithOpts_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer>, + cJSON_bool)>>('cJSON_ParseWithOpts'); + late final _cJSON_ParseWithOpts = _cJSON_ParseWithOpts_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer>, int)>(); ffi.Pointer cJSON_Print( ffi.Pointer item, @@ -99,10 +106,11 @@ class CJson { ); } - late final _cJSON_Print_ptr = - _lookup>('cJSON_Print'); - late final _dart_cJSON_Print _cJSON_Print = - _cJSON_Print_ptr.asFunction<_dart_cJSON_Print>(); + late final _cJSON_Print_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>>('cJSON_Print'); + late final _cJSON_Print = _cJSON_Print_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_PrintUnformatted( ffi.Pointer item, @@ -112,11 +120,12 @@ class CJson { ); } - late final _cJSON_PrintUnformatted_ptr = - _lookup>( - 'cJSON_PrintUnformatted'); - late final _dart_cJSON_PrintUnformatted _cJSON_PrintUnformatted = - _cJSON_PrintUnformatted_ptr.asFunction<_dart_cJSON_PrintUnformatted>(); + late final _cJSON_PrintUnformatted_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_PrintUnformatted'); + late final _cJSON_PrintUnformatted = _cJSON_PrintUnformatted_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_PrintBuffered( ffi.Pointer item, @@ -130,11 +139,12 @@ class CJson { ); } - late final _cJSON_PrintBuffered_ptr = - _lookup>( - 'cJSON_PrintBuffered'); - late final _dart_cJSON_PrintBuffered _cJSON_PrintBuffered = - _cJSON_PrintBuffered_ptr.asFunction<_dart_cJSON_PrintBuffered>(); + late final _cJSON_PrintBuffered_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Int32, + cJSON_bool)>>('cJSON_PrintBuffered'); + late final _cJSON_PrintBuffered = _cJSON_PrintBuffered_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int, int)>(); int cJSON_PrintPreallocated( ffi.Pointer item, @@ -150,11 +160,12 @@ class CJson { ); } - late final _cJSON_PrintPreallocated_ptr = - _lookup>( - 'cJSON_PrintPreallocated'); - late final _dart_cJSON_PrintPreallocated _cJSON_PrintPreallocated = - _cJSON_PrintPreallocated_ptr.asFunction<_dart_cJSON_PrintPreallocated>(); + late final _cJSON_PrintPreallocated_ptr = _lookup< + ffi.NativeFunction< + cJSON_bool Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, cJSON_bool)>>('cJSON_PrintPreallocated'); + late final _cJSON_PrintPreallocated = _cJSON_PrintPreallocated_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, int)>(); void cJSON_Delete( ffi.Pointer item, @@ -165,9 +176,10 @@ class CJson { } late final _cJSON_Delete_ptr = - _lookup>('cJSON_Delete'); - late final _dart_cJSON_Delete _cJSON_Delete = - _cJSON_Delete_ptr.asFunction<_dart_cJSON_Delete>(); + _lookup)>>( + 'cJSON_Delete'); + late final _cJSON_Delete = + _cJSON_Delete_ptr.asFunction)>(); int cJSON_GetArraySize( ffi.Pointer array, @@ -178,9 +190,10 @@ class CJson { } late final _cJSON_GetArraySize_ptr = - _lookup>('cJSON_GetArraySize'); - late final _dart_cJSON_GetArraySize _cJSON_GetArraySize = - _cJSON_GetArraySize_ptr.asFunction<_dart_cJSON_GetArraySize>(); + _lookup)>>( + 'cJSON_GetArraySize'); + late final _cJSON_GetArraySize = + _cJSON_GetArraySize_ptr.asFunction)>(); ffi.Pointer cJSON_GetArrayItem( ffi.Pointer array, @@ -192,10 +205,12 @@ class CJson { ); } - late final _cJSON_GetArrayItem_ptr = - _lookup>('cJSON_GetArrayItem'); - late final _dart_cJSON_GetArrayItem _cJSON_GetArrayItem = - _cJSON_GetArrayItem_ptr.asFunction<_dart_cJSON_GetArrayItem>(); + late final _cJSON_GetArrayItem_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('cJSON_GetArrayItem'); + late final _cJSON_GetArrayItem = _cJSON_GetArrayItem_ptr + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_GetObjectItem( ffi.Pointer object, @@ -207,11 +222,12 @@ class CJson { ); } - late final _cJSON_GetObjectItem_ptr = - _lookup>( - 'cJSON_GetObjectItem'); - late final _dart_cJSON_GetObjectItem _cJSON_GetObjectItem = - _cJSON_GetObjectItem_ptr.asFunction<_dart_cJSON_GetObjectItem>(); + late final _cJSON_GetObjectItem_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_GetObjectItem'); + late final _cJSON_GetObjectItem = _cJSON_GetObjectItem_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_GetObjectItemCaseSensitive( ffi.Pointer object, @@ -223,12 +239,14 @@ class CJson { ); } - late final _cJSON_GetObjectItemCaseSensitive_ptr = - _lookup>( - 'cJSON_GetObjectItemCaseSensitive'); - late final _dart_cJSON_GetObjectItemCaseSensitive - _cJSON_GetObjectItemCaseSensitive = _cJSON_GetObjectItemCaseSensitive_ptr - .asFunction<_dart_cJSON_GetObjectItemCaseSensitive>(); + late final _cJSON_GetObjectItemCaseSensitive_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_GetObjectItemCaseSensitive'); + late final _cJSON_GetObjectItemCaseSensitive = + _cJSON_GetObjectItemCaseSensitive_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); int cJSON_HasObjectItem( ffi.Pointer object, @@ -240,20 +258,22 @@ class CJson { ); } - late final _cJSON_HasObjectItem_ptr = - _lookup>( - 'cJSON_HasObjectItem'); - late final _dart_cJSON_HasObjectItem _cJSON_HasObjectItem = - _cJSON_HasObjectItem_ptr.asFunction<_dart_cJSON_HasObjectItem>(); + late final _cJSON_HasObjectItem_ptr = _lookup< + ffi.NativeFunction< + cJSON_bool Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_HasObjectItem'); + late final _cJSON_HasObjectItem = _cJSON_HasObjectItem_ptr + .asFunction, ffi.Pointer)>(); ffi.Pointer cJSON_GetErrorPtr() { return _cJSON_GetErrorPtr(); } late final _cJSON_GetErrorPtr_ptr = - _lookup>('cJSON_GetErrorPtr'); - late final _dart_cJSON_GetErrorPtr _cJSON_GetErrorPtr = - _cJSON_GetErrorPtr_ptr.asFunction<_dart_cJSON_GetErrorPtr>(); + _lookup Function()>>( + 'cJSON_GetErrorPtr'); + late final _cJSON_GetErrorPtr = + _cJSON_GetErrorPtr_ptr.asFunction Function()>(); ffi.Pointer cJSON_GetStringValue( ffi.Pointer item, @@ -263,11 +283,12 @@ class CJson { ); } - late final _cJSON_GetStringValue_ptr = - _lookup>( - 'cJSON_GetStringValue'); - late final _dart_cJSON_GetStringValue _cJSON_GetStringValue = - _cJSON_GetStringValue_ptr.asFunction<_dart_cJSON_GetStringValue>(); + late final _cJSON_GetStringValue_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_GetStringValue'); + late final _cJSON_GetStringValue = _cJSON_GetStringValue_ptr + .asFunction Function(ffi.Pointer)>(); int cJSON_IsInvalid( ffi.Pointer item, @@ -278,9 +299,10 @@ class CJson { } late final _cJSON_IsInvalid_ptr = - _lookup>('cJSON_IsInvalid'); - late final _dart_cJSON_IsInvalid _cJSON_IsInvalid = - _cJSON_IsInvalid_ptr.asFunction<_dart_cJSON_IsInvalid>(); + _lookup)>>( + 'cJSON_IsInvalid'); + late final _cJSON_IsInvalid = + _cJSON_IsInvalid_ptr.asFunction)>(); int cJSON_IsFalse( ffi.Pointer item, @@ -291,9 +313,10 @@ class CJson { } late final _cJSON_IsFalse_ptr = - _lookup>('cJSON_IsFalse'); - late final _dart_cJSON_IsFalse _cJSON_IsFalse = - _cJSON_IsFalse_ptr.asFunction<_dart_cJSON_IsFalse>(); + _lookup)>>( + 'cJSON_IsFalse'); + late final _cJSON_IsFalse = + _cJSON_IsFalse_ptr.asFunction)>(); int cJSON_IsTrue( ffi.Pointer item, @@ -304,9 +327,10 @@ class CJson { } late final _cJSON_IsTrue_ptr = - _lookup>('cJSON_IsTrue'); - late final _dart_cJSON_IsTrue _cJSON_IsTrue = - _cJSON_IsTrue_ptr.asFunction<_dart_cJSON_IsTrue>(); + _lookup)>>( + 'cJSON_IsTrue'); + late final _cJSON_IsTrue = + _cJSON_IsTrue_ptr.asFunction)>(); int cJSON_IsBool( ffi.Pointer item, @@ -317,9 +341,10 @@ class CJson { } late final _cJSON_IsBool_ptr = - _lookup>('cJSON_IsBool'); - late final _dart_cJSON_IsBool _cJSON_IsBool = - _cJSON_IsBool_ptr.asFunction<_dart_cJSON_IsBool>(); + _lookup)>>( + 'cJSON_IsBool'); + late final _cJSON_IsBool = + _cJSON_IsBool_ptr.asFunction)>(); int cJSON_IsNull( ffi.Pointer item, @@ -330,9 +355,10 @@ class CJson { } late final _cJSON_IsNull_ptr = - _lookup>('cJSON_IsNull'); - late final _dart_cJSON_IsNull _cJSON_IsNull = - _cJSON_IsNull_ptr.asFunction<_dart_cJSON_IsNull>(); + _lookup)>>( + 'cJSON_IsNull'); + late final _cJSON_IsNull = + _cJSON_IsNull_ptr.asFunction)>(); int cJSON_IsNumber( ffi.Pointer item, @@ -343,9 +369,10 @@ class CJson { } late final _cJSON_IsNumber_ptr = - _lookup>('cJSON_IsNumber'); - late final _dart_cJSON_IsNumber _cJSON_IsNumber = - _cJSON_IsNumber_ptr.asFunction<_dart_cJSON_IsNumber>(); + _lookup)>>( + 'cJSON_IsNumber'); + late final _cJSON_IsNumber = + _cJSON_IsNumber_ptr.asFunction)>(); int cJSON_IsString( ffi.Pointer item, @@ -356,9 +383,10 @@ class CJson { } late final _cJSON_IsString_ptr = - _lookup>('cJSON_IsString'); - late final _dart_cJSON_IsString _cJSON_IsString = - _cJSON_IsString_ptr.asFunction<_dart_cJSON_IsString>(); + _lookup)>>( + 'cJSON_IsString'); + late final _cJSON_IsString = + _cJSON_IsString_ptr.asFunction)>(); int cJSON_IsArray( ffi.Pointer item, @@ -369,9 +397,10 @@ class CJson { } late final _cJSON_IsArray_ptr = - _lookup>('cJSON_IsArray'); - late final _dart_cJSON_IsArray _cJSON_IsArray = - _cJSON_IsArray_ptr.asFunction<_dart_cJSON_IsArray>(); + _lookup)>>( + 'cJSON_IsArray'); + late final _cJSON_IsArray = + _cJSON_IsArray_ptr.asFunction)>(); int cJSON_IsObject( ffi.Pointer item, @@ -382,9 +411,10 @@ class CJson { } late final _cJSON_IsObject_ptr = - _lookup>('cJSON_IsObject'); - late final _dart_cJSON_IsObject _cJSON_IsObject = - _cJSON_IsObject_ptr.asFunction<_dart_cJSON_IsObject>(); + _lookup)>>( + 'cJSON_IsObject'); + late final _cJSON_IsObject = + _cJSON_IsObject_ptr.asFunction)>(); int cJSON_IsRaw( ffi.Pointer item, @@ -395,36 +425,40 @@ class CJson { } late final _cJSON_IsRaw_ptr = - _lookup>('cJSON_IsRaw'); - late final _dart_cJSON_IsRaw _cJSON_IsRaw = - _cJSON_IsRaw_ptr.asFunction<_dart_cJSON_IsRaw>(); + _lookup)>>( + 'cJSON_IsRaw'); + late final _cJSON_IsRaw = + _cJSON_IsRaw_ptr.asFunction)>(); ffi.Pointer cJSON_CreateNull() { return _cJSON_CreateNull(); } late final _cJSON_CreateNull_ptr = - _lookup>('cJSON_CreateNull'); - late final _dart_cJSON_CreateNull _cJSON_CreateNull = - _cJSON_CreateNull_ptr.asFunction<_dart_cJSON_CreateNull>(); + _lookup Function()>>( + 'cJSON_CreateNull'); + late final _cJSON_CreateNull = + _cJSON_CreateNull_ptr.asFunction Function()>(); ffi.Pointer cJSON_CreateTrue() { return _cJSON_CreateTrue(); } late final _cJSON_CreateTrue_ptr = - _lookup>('cJSON_CreateTrue'); - late final _dart_cJSON_CreateTrue _cJSON_CreateTrue = - _cJSON_CreateTrue_ptr.asFunction<_dart_cJSON_CreateTrue>(); + _lookup Function()>>( + 'cJSON_CreateTrue'); + late final _cJSON_CreateTrue = + _cJSON_CreateTrue_ptr.asFunction Function()>(); ffi.Pointer cJSON_CreateFalse() { return _cJSON_CreateFalse(); } late final _cJSON_CreateFalse_ptr = - _lookup>('cJSON_CreateFalse'); - late final _dart_cJSON_CreateFalse _cJSON_CreateFalse = - _cJSON_CreateFalse_ptr.asFunction<_dart_cJSON_CreateFalse>(); + _lookup Function()>>( + 'cJSON_CreateFalse'); + late final _cJSON_CreateFalse = + _cJSON_CreateFalse_ptr.asFunction Function()>(); ffi.Pointer cJSON_CreateBool( int boolean, @@ -435,9 +469,10 @@ class CJson { } late final _cJSON_CreateBool_ptr = - _lookup>('cJSON_CreateBool'); - late final _dart_cJSON_CreateBool _cJSON_CreateBool = - _cJSON_CreateBool_ptr.asFunction<_dart_cJSON_CreateBool>(); + _lookup Function(cJSON_bool)>>( + 'cJSON_CreateBool'); + late final _cJSON_CreateBool = + _cJSON_CreateBool_ptr.asFunction Function(int)>(); ffi.Pointer cJSON_CreateNumber( double num, @@ -448,9 +483,10 @@ class CJson { } late final _cJSON_CreateNumber_ptr = - _lookup>('cJSON_CreateNumber'); - late final _dart_cJSON_CreateNumber _cJSON_CreateNumber = - _cJSON_CreateNumber_ptr.asFunction<_dart_cJSON_CreateNumber>(); + _lookup Function(ffi.Double)>>( + 'cJSON_CreateNumber'); + late final _cJSON_CreateNumber = + _cJSON_CreateNumber_ptr.asFunction Function(double)>(); ffi.Pointer cJSON_CreateString( ffi.Pointer string, @@ -460,10 +496,12 @@ class CJson { ); } - late final _cJSON_CreateString_ptr = - _lookup>('cJSON_CreateString'); - late final _dart_cJSON_CreateString _cJSON_CreateString = - _cJSON_CreateString_ptr.asFunction<_dart_cJSON_CreateString>(); + late final _cJSON_CreateString_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_CreateString'); + late final _cJSON_CreateString = _cJSON_CreateString_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateRaw( ffi.Pointer raw, @@ -473,28 +511,32 @@ class CJson { ); } - late final _cJSON_CreateRaw_ptr = - _lookup>('cJSON_CreateRaw'); - late final _dart_cJSON_CreateRaw _cJSON_CreateRaw = - _cJSON_CreateRaw_ptr.asFunction<_dart_cJSON_CreateRaw>(); + late final _cJSON_CreateRaw_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_CreateRaw'); + late final _cJSON_CreateRaw = _cJSON_CreateRaw_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateArray() { return _cJSON_CreateArray(); } late final _cJSON_CreateArray_ptr = - _lookup>('cJSON_CreateArray'); - late final _dart_cJSON_CreateArray _cJSON_CreateArray = - _cJSON_CreateArray_ptr.asFunction<_dart_cJSON_CreateArray>(); + _lookup Function()>>( + 'cJSON_CreateArray'); + late final _cJSON_CreateArray = + _cJSON_CreateArray_ptr.asFunction Function()>(); ffi.Pointer cJSON_CreateObject() { return _cJSON_CreateObject(); } late final _cJSON_CreateObject_ptr = - _lookup>('cJSON_CreateObject'); - late final _dart_cJSON_CreateObject _cJSON_CreateObject = - _cJSON_CreateObject_ptr.asFunction<_dart_cJSON_CreateObject>(); + _lookup Function()>>( + 'cJSON_CreateObject'); + late final _cJSON_CreateObject = + _cJSON_CreateObject_ptr.asFunction Function()>(); ffi.Pointer cJSON_CreateStringReference( ffi.Pointer string, @@ -504,12 +546,12 @@ class CJson { ); } - late final _cJSON_CreateStringReference_ptr = - _lookup>( - 'cJSON_CreateStringReference'); - late final _dart_cJSON_CreateStringReference _cJSON_CreateStringReference = - _cJSON_CreateStringReference_ptr - .asFunction<_dart_cJSON_CreateStringReference>(); + late final _cJSON_CreateStringReference_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_CreateStringReference'); + late final _cJSON_CreateStringReference = _cJSON_CreateStringReference_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateObjectReference( ffi.Pointer child, @@ -519,12 +561,11 @@ class CJson { ); } - late final _cJSON_CreateObjectReference_ptr = - _lookup>( - 'cJSON_CreateObjectReference'); - late final _dart_cJSON_CreateObjectReference _cJSON_CreateObjectReference = - _cJSON_CreateObjectReference_ptr - .asFunction<_dart_cJSON_CreateObjectReference>(); + late final _cJSON_CreateObjectReference_ptr = _lookup< + ffi.NativeFunction Function(ffi.Pointer)>>( + 'cJSON_CreateObjectReference'); + late final _cJSON_CreateObjectReference = _cJSON_CreateObjectReference_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateArrayReference( ffi.Pointer child, @@ -534,12 +575,11 @@ class CJson { ); } - late final _cJSON_CreateArrayReference_ptr = - _lookup>( - 'cJSON_CreateArrayReference'); - late final _dart_cJSON_CreateArrayReference _cJSON_CreateArrayReference = - _cJSON_CreateArrayReference_ptr - .asFunction<_dart_cJSON_CreateArrayReference>(); + late final _cJSON_CreateArrayReference_ptr = _lookup< + ffi.NativeFunction Function(ffi.Pointer)>>( + 'cJSON_CreateArrayReference'); + late final _cJSON_CreateArrayReference = _cJSON_CreateArrayReference_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateIntArray( ffi.Pointer numbers, @@ -551,11 +591,12 @@ class CJson { ); } - late final _cJSON_CreateIntArray_ptr = - _lookup>( - 'cJSON_CreateIntArray'); - late final _dart_cJSON_CreateIntArray _cJSON_CreateIntArray = - _cJSON_CreateIntArray_ptr.asFunction<_dart_cJSON_CreateIntArray>(); + late final _cJSON_CreateIntArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('cJSON_CreateIntArray'); + late final _cJSON_CreateIntArray = _cJSON_CreateIntArray_ptr + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateFloatArray( ffi.Pointer numbers, @@ -567,11 +608,12 @@ class CJson { ); } - late final _cJSON_CreateFloatArray_ptr = - _lookup>( - 'cJSON_CreateFloatArray'); - late final _dart_cJSON_CreateFloatArray _cJSON_CreateFloatArray = - _cJSON_CreateFloatArray_ptr.asFunction<_dart_cJSON_CreateFloatArray>(); + late final _cJSON_CreateFloatArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('cJSON_CreateFloatArray'); + late final _cJSON_CreateFloatArray = _cJSON_CreateFloatArray_ptr + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateDoubleArray( ffi.Pointer numbers, @@ -583,11 +625,12 @@ class CJson { ); } - late final _cJSON_CreateDoubleArray_ptr = - _lookup>( - 'cJSON_CreateDoubleArray'); - late final _dart_cJSON_CreateDoubleArray _cJSON_CreateDoubleArray = - _cJSON_CreateDoubleArray_ptr.asFunction<_dart_cJSON_CreateDoubleArray>(); + late final _cJSON_CreateDoubleArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('cJSON_CreateDoubleArray'); + late final _cJSON_CreateDoubleArray = _cJSON_CreateDoubleArray_ptr + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateStringArray( ffi.Pointer> strings, @@ -599,11 +642,12 @@ class CJson { ); } - late final _cJSON_CreateStringArray_ptr = - _lookup>( - 'cJSON_CreateStringArray'); - late final _dart_cJSON_CreateStringArray _cJSON_CreateStringArray = - _cJSON_CreateStringArray_ptr.asFunction<_dart_cJSON_CreateStringArray>(); + late final _cJSON_CreateStringArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer>, + ffi.Int32)>>('cJSON_CreateStringArray'); + late final _cJSON_CreateStringArray = _cJSON_CreateStringArray_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer>, int)>(); void cJSON_AddItemToArray( ffi.Pointer array, @@ -615,11 +659,12 @@ class CJson { ); } - late final _cJSON_AddItemToArray_ptr = - _lookup>( - 'cJSON_AddItemToArray'); - late final _dart_cJSON_AddItemToArray _cJSON_AddItemToArray = - _cJSON_AddItemToArray_ptr.asFunction<_dart_cJSON_AddItemToArray>(); + late final _cJSON_AddItemToArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemToArray'); + late final _cJSON_AddItemToArray = _cJSON_AddItemToArray_ptr + .asFunction, ffi.Pointer)>(); void cJSON_AddItemToObject( ffi.Pointer object, @@ -633,11 +678,13 @@ class CJson { ); } - late final _cJSON_AddItemToObject_ptr = - _lookup>( - 'cJSON_AddItemToObject'); - late final _dart_cJSON_AddItemToObject _cJSON_AddItemToObject = - _cJSON_AddItemToObject_ptr.asFunction<_dart_cJSON_AddItemToObject>(); + late final _cJSON_AddItemToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddItemToObject'); + late final _cJSON_AddItemToObject = _cJSON_AddItemToObject_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_AddItemToObjectCS( ffi.Pointer object, @@ -651,11 +698,13 @@ class CJson { ); } - late final _cJSON_AddItemToObjectCS_ptr = - _lookup>( - 'cJSON_AddItemToObjectCS'); - late final _dart_cJSON_AddItemToObjectCS _cJSON_AddItemToObjectCS = - _cJSON_AddItemToObjectCS_ptr.asFunction<_dart_cJSON_AddItemToObjectCS>(); + late final _cJSON_AddItemToObjectCS_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddItemToObjectCS'); + late final _cJSON_AddItemToObjectCS = _cJSON_AddItemToObjectCS_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_AddItemReferenceToArray( ffi.Pointer array, @@ -667,12 +716,12 @@ class CJson { ); } - late final _cJSON_AddItemReferenceToArray_ptr = - _lookup>( - 'cJSON_AddItemReferenceToArray'); - late final _dart_cJSON_AddItemReferenceToArray - _cJSON_AddItemReferenceToArray = _cJSON_AddItemReferenceToArray_ptr - .asFunction<_dart_cJSON_AddItemReferenceToArray>(); + late final _cJSON_AddItemReferenceToArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddItemReferenceToArray'); + late final _cJSON_AddItemReferenceToArray = _cJSON_AddItemReferenceToArray_ptr + .asFunction, ffi.Pointer)>(); void cJSON_AddItemReferenceToObject( ffi.Pointer object, @@ -686,12 +735,14 @@ class CJson { ); } - late final _cJSON_AddItemReferenceToObject_ptr = - _lookup>( - 'cJSON_AddItemReferenceToObject'); - late final _dart_cJSON_AddItemReferenceToObject - _cJSON_AddItemReferenceToObject = _cJSON_AddItemReferenceToObject_ptr - .asFunction<_dart_cJSON_AddItemReferenceToObject>(); + late final _cJSON_AddItemReferenceToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddItemReferenceToObject'); + late final _cJSON_AddItemReferenceToObject = + _cJSON_AddItemReferenceToObject_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_DetachItemViaPointer( ffi.Pointer parent, @@ -703,12 +754,14 @@ class CJson { ); } - late final _cJSON_DetachItemViaPointer_ptr = - _lookup>( - 'cJSON_DetachItemViaPointer'); - late final _dart_cJSON_DetachItemViaPointer _cJSON_DetachItemViaPointer = - _cJSON_DetachItemViaPointer_ptr - .asFunction<_dart_cJSON_DetachItemViaPointer>(); + late final _cJSON_DetachItemViaPointer_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_DetachItemViaPointer'); + late final _cJSON_DetachItemViaPointer = + _cJSON_DetachItemViaPointer_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_DetachItemFromArray( ffi.Pointer array, @@ -720,12 +773,12 @@ class CJson { ); } - late final _cJSON_DetachItemFromArray_ptr = - _lookup>( - 'cJSON_DetachItemFromArray'); - late final _dart_cJSON_DetachItemFromArray _cJSON_DetachItemFromArray = - _cJSON_DetachItemFromArray_ptr - .asFunction<_dart_cJSON_DetachItemFromArray>(); + late final _cJSON_DetachItemFromArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('cJSON_DetachItemFromArray'); + late final _cJSON_DetachItemFromArray = _cJSON_DetachItemFromArray_ptr + .asFunction Function(ffi.Pointer, int)>(); void cJSON_DeleteItemFromArray( ffi.Pointer array, @@ -737,12 +790,11 @@ class CJson { ); } - late final _cJSON_DeleteItemFromArray_ptr = - _lookup>( - 'cJSON_DeleteItemFromArray'); - late final _dart_cJSON_DeleteItemFromArray _cJSON_DeleteItemFromArray = - _cJSON_DeleteItemFromArray_ptr - .asFunction<_dart_cJSON_DeleteItemFromArray>(); + late final _cJSON_DeleteItemFromArray_ptr = _lookup< + ffi.NativeFunction, ffi.Int32)>>( + 'cJSON_DeleteItemFromArray'); + late final _cJSON_DeleteItemFromArray = _cJSON_DeleteItemFromArray_ptr + .asFunction, int)>(); ffi.Pointer cJSON_DetachItemFromObject( ffi.Pointer object, @@ -754,12 +806,14 @@ class CJson { ); } - late final _cJSON_DetachItemFromObject_ptr = - _lookup>( - 'cJSON_DetachItemFromObject'); - late final _dart_cJSON_DetachItemFromObject _cJSON_DetachItemFromObject = - _cJSON_DetachItemFromObject_ptr - .asFunction<_dart_cJSON_DetachItemFromObject>(); + late final _cJSON_DetachItemFromObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_DetachItemFromObject'); + late final _cJSON_DetachItemFromObject = + _cJSON_DetachItemFromObject_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_DetachItemFromObjectCaseSensitive( ffi.Pointer object, @@ -771,13 +825,15 @@ class CJson { ); } - late final _cJSON_DetachItemFromObjectCaseSensitive_ptr = - _lookup>( - 'cJSON_DetachItemFromObjectCaseSensitive'); - late final _dart_cJSON_DetachItemFromObjectCaseSensitive - _cJSON_DetachItemFromObjectCaseSensitive = - _cJSON_DetachItemFromObjectCaseSensitive_ptr - .asFunction<_dart_cJSON_DetachItemFromObjectCaseSensitive>(); + late final _cJSON_DetachItemFromObjectCaseSensitive_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>( + 'cJSON_DetachItemFromObjectCaseSensitive'); + late final _cJSON_DetachItemFromObjectCaseSensitive = + _cJSON_DetachItemFromObjectCaseSensitive_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); void cJSON_DeleteItemFromObject( ffi.Pointer object, @@ -789,12 +845,12 @@ class CJson { ); } - late final _cJSON_DeleteItemFromObject_ptr = - _lookup>( - 'cJSON_DeleteItemFromObject'); - late final _dart_cJSON_DeleteItemFromObject _cJSON_DeleteItemFromObject = - _cJSON_DeleteItemFromObject_ptr - .asFunction<_dart_cJSON_DeleteItemFromObject>(); + late final _cJSON_DeleteItemFromObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_DeleteItemFromObject'); + late final _cJSON_DeleteItemFromObject = _cJSON_DeleteItemFromObject_ptr + .asFunction, ffi.Pointer)>(); void cJSON_DeleteItemFromObjectCaseSensitive( ffi.Pointer object, @@ -806,13 +862,13 @@ class CJson { ); } - late final _cJSON_DeleteItemFromObjectCaseSensitive_ptr = - _lookup>( - 'cJSON_DeleteItemFromObjectCaseSensitive'); - late final _dart_cJSON_DeleteItemFromObjectCaseSensitive - _cJSON_DeleteItemFromObjectCaseSensitive = - _cJSON_DeleteItemFromObjectCaseSensitive_ptr - .asFunction<_dart_cJSON_DeleteItemFromObjectCaseSensitive>(); + late final _cJSON_DeleteItemFromObjectCaseSensitive_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer)>>( + 'cJSON_DeleteItemFromObjectCaseSensitive'); + late final _cJSON_DeleteItemFromObjectCaseSensitive = + _cJSON_DeleteItemFromObjectCaseSensitive_ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); void cJSON_InsertItemInArray( ffi.Pointer array, @@ -826,11 +882,12 @@ class CJson { ); } - late final _cJSON_InsertItemInArray_ptr = - _lookup>( - 'cJSON_InsertItemInArray'); - late final _dart_cJSON_InsertItemInArray _cJSON_InsertItemInArray = - _cJSON_InsertItemInArray_ptr.asFunction<_dart_cJSON_InsertItemInArray>(); + late final _cJSON_InsertItemInArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer)>>('cJSON_InsertItemInArray'); + late final _cJSON_InsertItemInArray = _cJSON_InsertItemInArray_ptr + .asFunction, int, ffi.Pointer)>(); int cJSON_ReplaceItemViaPointer( ffi.Pointer parent, @@ -844,12 +901,14 @@ class CJson { ); } - late final _cJSON_ReplaceItemViaPointer_ptr = - _lookup>( - 'cJSON_ReplaceItemViaPointer'); - late final _dart_cJSON_ReplaceItemViaPointer _cJSON_ReplaceItemViaPointer = - _cJSON_ReplaceItemViaPointer_ptr - .asFunction<_dart_cJSON_ReplaceItemViaPointer>(); + late final _cJSON_ReplaceItemViaPointer_ptr = _lookup< + ffi.NativeFunction< + cJSON_bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_ReplaceItemViaPointer'); + late final _cJSON_ReplaceItemViaPointer = + _cJSON_ReplaceItemViaPointer_ptr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_ReplaceItemInArray( ffi.Pointer array, @@ -863,12 +922,12 @@ class CJson { ); } - late final _cJSON_ReplaceItemInArray_ptr = - _lookup>( - 'cJSON_ReplaceItemInArray'); - late final _dart_cJSON_ReplaceItemInArray _cJSON_ReplaceItemInArray = - _cJSON_ReplaceItemInArray_ptr - .asFunction<_dart_cJSON_ReplaceItemInArray>(); + late final _cJSON_ReplaceItemInArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer)>>('cJSON_ReplaceItemInArray'); + late final _cJSON_ReplaceItemInArray = _cJSON_ReplaceItemInArray_ptr + .asFunction, int, ffi.Pointer)>(); void cJSON_ReplaceItemInObject( ffi.Pointer object, @@ -882,12 +941,14 @@ class CJson { ); } - late final _cJSON_ReplaceItemInObject_ptr = - _lookup>( - 'cJSON_ReplaceItemInObject'); - late final _dart_cJSON_ReplaceItemInObject _cJSON_ReplaceItemInObject = - _cJSON_ReplaceItemInObject_ptr - .asFunction<_dart_cJSON_ReplaceItemInObject>(); + late final _cJSON_ReplaceItemInObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_ReplaceItemInObject'); + late final _cJSON_ReplaceItemInObject = + _cJSON_ReplaceItemInObject_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_ReplaceItemInObjectCaseSensitive( ffi.Pointer object, @@ -901,13 +962,14 @@ class CJson { ); } - late final _cJSON_ReplaceItemInObjectCaseSensitive_ptr = - _lookup>( - 'cJSON_ReplaceItemInObjectCaseSensitive'); - late final _dart_cJSON_ReplaceItemInObjectCaseSensitive - _cJSON_ReplaceItemInObjectCaseSensitive = - _cJSON_ReplaceItemInObjectCaseSensitive_ptr - .asFunction<_dart_cJSON_ReplaceItemInObjectCaseSensitive>(); + late final _cJSON_ReplaceItemInObjectCaseSensitive_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_ReplaceItemInObjectCaseSensitive'); + late final _cJSON_ReplaceItemInObjectCaseSensitive = + _cJSON_ReplaceItemInObjectCaseSensitive_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_Duplicate( ffi.Pointer item, @@ -919,10 +981,12 @@ class CJson { ); } - late final _cJSON_Duplicate_ptr = - _lookup>('cJSON_Duplicate'); - late final _dart_cJSON_Duplicate _cJSON_Duplicate = - _cJSON_Duplicate_ptr.asFunction<_dart_cJSON_Duplicate>(); + late final _cJSON_Duplicate_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, cJSON_bool)>>('cJSON_Duplicate'); + late final _cJSON_Duplicate = _cJSON_Duplicate_ptr + .asFunction Function(ffi.Pointer, int)>(); int cJSON_Compare( ffi.Pointer a, @@ -936,10 +1000,12 @@ class CJson { ); } - late final _cJSON_Compare_ptr = - _lookup>('cJSON_Compare'); - late final _dart_cJSON_Compare _cJSON_Compare = - _cJSON_Compare_ptr.asFunction<_dart_cJSON_Compare>(); + late final _cJSON_Compare_ptr = _lookup< + ffi.NativeFunction< + cJSON_bool Function(ffi.Pointer, ffi.Pointer, + cJSON_bool)>>('cJSON_Compare'); + late final _cJSON_Compare = _cJSON_Compare_ptr + .asFunction, ffi.Pointer, int)>(); void cJSON_Minify( ffi.Pointer json, @@ -950,9 +1016,10 @@ class CJson { } late final _cJSON_Minify_ptr = - _lookup>('cJSON_Minify'); - late final _dart_cJSON_Minify _cJSON_Minify = - _cJSON_Minify_ptr.asFunction<_dart_cJSON_Minify>(); + _lookup)>>( + 'cJSON_Minify'); + late final _cJSON_Minify = + _cJSON_Minify_ptr.asFunction)>(); ffi.Pointer cJSON_AddNullToObject( ffi.Pointer object, @@ -964,11 +1031,12 @@ class CJson { ); } - late final _cJSON_AddNullToObject_ptr = - _lookup>( - 'cJSON_AddNullToObject'); - late final _dart_cJSON_AddNullToObject _cJSON_AddNullToObject = - _cJSON_AddNullToObject_ptr.asFunction<_dart_cJSON_AddNullToObject>(); + late final _cJSON_AddNullToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddNullToObject'); + late final _cJSON_AddNullToObject = _cJSON_AddNullToObject_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddTrueToObject( ffi.Pointer object, @@ -980,11 +1048,12 @@ class CJson { ); } - late final _cJSON_AddTrueToObject_ptr = - _lookup>( - 'cJSON_AddTrueToObject'); - late final _dart_cJSON_AddTrueToObject _cJSON_AddTrueToObject = - _cJSON_AddTrueToObject_ptr.asFunction<_dart_cJSON_AddTrueToObject>(); + late final _cJSON_AddTrueToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddTrueToObject'); + late final _cJSON_AddTrueToObject = _cJSON_AddTrueToObject_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddFalseToObject( ffi.Pointer object, @@ -996,11 +1065,12 @@ class CJson { ); } - late final _cJSON_AddFalseToObject_ptr = - _lookup>( - 'cJSON_AddFalseToObject'); - late final _dart_cJSON_AddFalseToObject _cJSON_AddFalseToObject = - _cJSON_AddFalseToObject_ptr.asFunction<_dart_cJSON_AddFalseToObject>(); + late final _cJSON_AddFalseToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddFalseToObject'); + late final _cJSON_AddFalseToObject = _cJSON_AddFalseToObject_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddBoolToObject( ffi.Pointer object, @@ -1014,11 +1084,13 @@ class CJson { ); } - late final _cJSON_AddBoolToObject_ptr = - _lookup>( - 'cJSON_AddBoolToObject'); - late final _dart_cJSON_AddBoolToObject _cJSON_AddBoolToObject = - _cJSON_AddBoolToObject_ptr.asFunction<_dart_cJSON_AddBoolToObject>(); + late final _cJSON_AddBoolToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + cJSON_bool)>>('cJSON_AddBoolToObject'); + late final _cJSON_AddBoolToObject = _cJSON_AddBoolToObject_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); ffi.Pointer cJSON_AddNumberToObject( ffi.Pointer object, @@ -1032,11 +1104,13 @@ class CJson { ); } - late final _cJSON_AddNumberToObject_ptr = - _lookup>( - 'cJSON_AddNumberToObject'); - late final _dart_cJSON_AddNumberToObject _cJSON_AddNumberToObject = - _cJSON_AddNumberToObject_ptr.asFunction<_dart_cJSON_AddNumberToObject>(); + late final _cJSON_AddNumberToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Double)>>('cJSON_AddNumberToObject'); + late final _cJSON_AddNumberToObject = _cJSON_AddNumberToObject_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); ffi.Pointer cJSON_AddStringToObject( ffi.Pointer object, @@ -1050,11 +1124,13 @@ class CJson { ); } - late final _cJSON_AddStringToObject_ptr = - _lookup>( - 'cJSON_AddStringToObject'); - late final _dart_cJSON_AddStringToObject _cJSON_AddStringToObject = - _cJSON_AddStringToObject_ptr.asFunction<_dart_cJSON_AddStringToObject>(); + late final _cJSON_AddStringToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddStringToObject'); + late final _cJSON_AddStringToObject = _cJSON_AddStringToObject_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddRawToObject( ffi.Pointer object, @@ -1068,11 +1144,13 @@ class CJson { ); } - late final _cJSON_AddRawToObject_ptr = - _lookup>( - 'cJSON_AddRawToObject'); - late final _dart_cJSON_AddRawToObject _cJSON_AddRawToObject = - _cJSON_AddRawToObject_ptr.asFunction<_dart_cJSON_AddRawToObject>(); + late final _cJSON_AddRawToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddRawToObject'); + late final _cJSON_AddRawToObject = _cJSON_AddRawToObject_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddObjectToObject( ffi.Pointer object, @@ -1084,11 +1162,12 @@ class CJson { ); } - late final _cJSON_AddObjectToObject_ptr = - _lookup>( - 'cJSON_AddObjectToObject'); - late final _dart_cJSON_AddObjectToObject _cJSON_AddObjectToObject = - _cJSON_AddObjectToObject_ptr.asFunction<_dart_cJSON_AddObjectToObject>(); + late final _cJSON_AddObjectToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddObjectToObject'); + late final _cJSON_AddObjectToObject = _cJSON_AddObjectToObject_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddArrayToObject( ffi.Pointer object, @@ -1100,11 +1179,12 @@ class CJson { ); } - late final _cJSON_AddArrayToObject_ptr = - _lookup>( - 'cJSON_AddArrayToObject'); - late final _dart_cJSON_AddArrayToObject _cJSON_AddArrayToObject = - _cJSON_AddArrayToObject_ptr.asFunction<_dart_cJSON_AddArrayToObject>(); + late final _cJSON_AddArrayToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddArrayToObject'); + late final _cJSON_AddArrayToObject = _cJSON_AddArrayToObject_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); double cJSON_SetNumberHelper( ffi.Pointer object, @@ -1116,11 +1196,12 @@ class CJson { ); } - late final _cJSON_SetNumberHelper_ptr = - _lookup>( - 'cJSON_SetNumberHelper'); - late final _dart_cJSON_SetNumberHelper _cJSON_SetNumberHelper = - _cJSON_SetNumberHelper_ptr.asFunction<_dart_cJSON_SetNumberHelper>(); + late final _cJSON_SetNumberHelper_ptr = _lookup< + ffi.NativeFunction< + ffi.Double Function( + ffi.Pointer, ffi.Double)>>('cJSON_SetNumberHelper'); + late final _cJSON_SetNumberHelper = _cJSON_SetNumberHelper_ptr + .asFunction, double)>(); ffi.Pointer cJSON_malloc( int size, @@ -1131,9 +1212,10 @@ class CJson { } late final _cJSON_malloc_ptr = - _lookup>('cJSON_malloc'); - late final _dart_cJSON_malloc _cJSON_malloc = - _cJSON_malloc_ptr.asFunction<_dart_cJSON_malloc>(); + _lookup Function(ffi.IntPtr)>>( + 'cJSON_malloc'); + late final _cJSON_malloc = + _cJSON_malloc_ptr.asFunction Function(int)>(); void cJSON_free( ffi.Pointer object, @@ -1144,9 +1226,10 @@ class CJson { } late final _cJSON_free_ptr = - _lookup>('cJSON_free'); - late final _dart_cJSON_free _cJSON_free = - _cJSON_free_ptr.asFunction<_dart_cJSON_free>(); + _lookup)>>( + 'cJSON_free'); + late final _cJSON_free = + _cJSON_free_ptr.asFunction)>(); } class cJSON extends ffi.Struct { @@ -1171,11 +1254,16 @@ class cJSON extends ffi.Struct { } class cJSON_Hooks extends ffi.Struct { - external ffi.Pointer> malloc_fn; + external ffi.Pointer< + ffi.NativeFunction Function(ffi.IntPtr)>> malloc_fn; - external ffi.Pointer> free_fn; + external ffi + .Pointer)>> + free_fn; } +typedef cJSON_bool = ffi.Int32; + const int CJSON_VERSION_MAJOR = 1; const int CJSON_VERSION_MINOR = 7; @@ -1207,691 +1295,3 @@ const int cJSON_StringIsConst = 512; const int CJSON_NESTING_LIMIT = 1000; const double CJSON_DOUBLE_PRECISION = 1e-16; - -typedef _c_cJSON_Version = ffi.Pointer Function(); - -typedef _dart_cJSON_Version = ffi.Pointer Function(); - -typedef _c_cJSON_InitHooks = ffi.Void Function( - ffi.Pointer hooks, -); - -typedef _dart_cJSON_InitHooks = void Function( - ffi.Pointer hooks, -); - -typedef _c_cJSON_Parse = ffi.Pointer Function( - ffi.Pointer value, -); - -typedef _dart_cJSON_Parse = ffi.Pointer Function( - ffi.Pointer value, -); - -typedef _c_cJSON_ParseWithOpts = ffi.Pointer Function( - ffi.Pointer value, - ffi.Pointer> return_parse_end, - ffi.Int32 require_null_terminated, -); - -typedef _dart_cJSON_ParseWithOpts = ffi.Pointer Function( - ffi.Pointer value, - ffi.Pointer> return_parse_end, - int require_null_terminated, -); - -typedef _c_cJSON_Print = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_Print = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _c_cJSON_PrintUnformatted = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_PrintUnformatted = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _c_cJSON_PrintBuffered = ffi.Pointer Function( - ffi.Pointer item, - ffi.Int32 prebuffer, - ffi.Int32 fmt, -); - -typedef _dart_cJSON_PrintBuffered = ffi.Pointer Function( - ffi.Pointer item, - int prebuffer, - int fmt, -); - -typedef _c_cJSON_PrintPreallocated = ffi.Int32 Function( - ffi.Pointer item, - ffi.Pointer buffer, - ffi.Int32 length, - ffi.Int32 format, -); - -typedef _dart_cJSON_PrintPreallocated = int Function( - ffi.Pointer item, - ffi.Pointer buffer, - int length, - int format, -); - -typedef _c_cJSON_Delete = ffi.Void Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_Delete = void Function( - ffi.Pointer item, -); - -typedef _c_cJSON_GetArraySize = ffi.Int32 Function( - ffi.Pointer array, -); - -typedef _dart_cJSON_GetArraySize = int Function( - ffi.Pointer array, -); - -typedef _c_cJSON_GetArrayItem = ffi.Pointer Function( - ffi.Pointer array, - ffi.Int32 index, -); - -typedef _dart_cJSON_GetArrayItem = ffi.Pointer Function( - ffi.Pointer array, - int index, -); - -typedef _c_cJSON_GetObjectItem = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_GetObjectItem = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_GetObjectItemCaseSensitive = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_GetObjectItemCaseSensitive = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_HasObjectItem = ffi.Int32 Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_HasObjectItem = int Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_GetErrorPtr = ffi.Pointer Function(); - -typedef _dart_cJSON_GetErrorPtr = ffi.Pointer Function(); - -typedef _c_cJSON_GetStringValue = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_GetStringValue = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsInvalid = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsInvalid = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsFalse = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsFalse = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsTrue = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsTrue = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsBool = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsBool = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsNull = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsNull = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsNumber = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsNumber = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsString = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsString = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsArray = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsArray = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsObject = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsObject = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsRaw = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsRaw = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_CreateNull = ffi.Pointer Function(); - -typedef _dart_cJSON_CreateNull = ffi.Pointer Function(); - -typedef _c_cJSON_CreateTrue = ffi.Pointer Function(); - -typedef _dart_cJSON_CreateTrue = ffi.Pointer Function(); - -typedef _c_cJSON_CreateFalse = ffi.Pointer Function(); - -typedef _dart_cJSON_CreateFalse = ffi.Pointer Function(); - -typedef _c_cJSON_CreateBool = ffi.Pointer Function( - ffi.Int32 boolean, -); - -typedef _dart_cJSON_CreateBool = ffi.Pointer Function( - int boolean, -); - -typedef _c_cJSON_CreateNumber = ffi.Pointer Function( - ffi.Double num, -); - -typedef _dart_cJSON_CreateNumber = ffi.Pointer Function( - double num, -); - -typedef _c_cJSON_CreateString = ffi.Pointer Function( - ffi.Pointer string, -); - -typedef _dart_cJSON_CreateString = ffi.Pointer Function( - ffi.Pointer string, -); - -typedef _c_cJSON_CreateRaw = ffi.Pointer Function( - ffi.Pointer raw, -); - -typedef _dart_cJSON_CreateRaw = ffi.Pointer Function( - ffi.Pointer raw, -); - -typedef _c_cJSON_CreateArray = ffi.Pointer Function(); - -typedef _dart_cJSON_CreateArray = ffi.Pointer Function(); - -typedef _c_cJSON_CreateObject = ffi.Pointer Function(); - -typedef _dart_cJSON_CreateObject = ffi.Pointer Function(); - -typedef _c_cJSON_CreateStringReference = ffi.Pointer Function( - ffi.Pointer string, -); - -typedef _dart_cJSON_CreateStringReference = ffi.Pointer Function( - ffi.Pointer string, -); - -typedef _c_cJSON_CreateObjectReference = ffi.Pointer Function( - ffi.Pointer child, -); - -typedef _dart_cJSON_CreateObjectReference = ffi.Pointer Function( - ffi.Pointer child, -); - -typedef _c_cJSON_CreateArrayReference = ffi.Pointer Function( - ffi.Pointer child, -); - -typedef _dart_cJSON_CreateArrayReference = ffi.Pointer Function( - ffi.Pointer child, -); - -typedef _c_cJSON_CreateIntArray = ffi.Pointer Function( - ffi.Pointer numbers, - ffi.Int32 count, -); - -typedef _dart_cJSON_CreateIntArray = ffi.Pointer Function( - ffi.Pointer numbers, - int count, -); - -typedef _c_cJSON_CreateFloatArray = ffi.Pointer Function( - ffi.Pointer numbers, - ffi.Int32 count, -); - -typedef _dart_cJSON_CreateFloatArray = ffi.Pointer Function( - ffi.Pointer numbers, - int count, -); - -typedef _c_cJSON_CreateDoubleArray = ffi.Pointer Function( - ffi.Pointer numbers, - ffi.Int32 count, -); - -typedef _dart_cJSON_CreateDoubleArray = ffi.Pointer Function( - ffi.Pointer numbers, - int count, -); - -typedef _c_cJSON_CreateStringArray = ffi.Pointer Function( - ffi.Pointer> strings, - ffi.Int32 count, -); - -typedef _dart_cJSON_CreateStringArray = ffi.Pointer Function( - ffi.Pointer> strings, - int count, -); - -typedef _c_cJSON_AddItemToArray = ffi.Void Function( - ffi.Pointer array, - ffi.Pointer item, -); - -typedef _dart_cJSON_AddItemToArray = void Function( - ffi.Pointer array, - ffi.Pointer item, -); - -typedef _c_cJSON_AddItemToObject = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _dart_cJSON_AddItemToObject = void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _c_cJSON_AddItemToObjectCS = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _dart_cJSON_AddItemToObjectCS = void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _c_cJSON_AddItemReferenceToArray = ffi.Void Function( - ffi.Pointer array, - ffi.Pointer item, -); - -typedef _dart_cJSON_AddItemReferenceToArray = void Function( - ffi.Pointer array, - ffi.Pointer item, -); - -typedef _c_cJSON_AddItemReferenceToObject = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _dart_cJSON_AddItemReferenceToObject = void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _c_cJSON_DetachItemViaPointer = ffi.Pointer Function( - ffi.Pointer parent, - ffi.Pointer item, -); - -typedef _dart_cJSON_DetachItemViaPointer = ffi.Pointer Function( - ffi.Pointer parent, - ffi.Pointer item, -); - -typedef _c_cJSON_DetachItemFromArray = ffi.Pointer Function( - ffi.Pointer array, - ffi.Int32 which, -); - -typedef _dart_cJSON_DetachItemFromArray = ffi.Pointer Function( - ffi.Pointer array, - int which, -); - -typedef _c_cJSON_DeleteItemFromArray = ffi.Void Function( - ffi.Pointer array, - ffi.Int32 which, -); - -typedef _dart_cJSON_DeleteItemFromArray = void Function( - ffi.Pointer array, - int which, -); - -typedef _c_cJSON_DetachItemFromObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_DetachItemFromObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_DetachItemFromObjectCaseSensitive = ffi.Pointer - Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_DetachItemFromObjectCaseSensitive = ffi.Pointer - Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_DeleteItemFromObject = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_DeleteItemFromObject = void Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_DeleteItemFromObjectCaseSensitive = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_DeleteItemFromObjectCaseSensitive = void Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_InsertItemInArray = ffi.Void Function( - ffi.Pointer array, - ffi.Int32 which, - ffi.Pointer newitem, -); - -typedef _dart_cJSON_InsertItemInArray = void Function( - ffi.Pointer array, - int which, - ffi.Pointer newitem, -); - -typedef _c_cJSON_ReplaceItemViaPointer = ffi.Int32 Function( - ffi.Pointer parent, - ffi.Pointer item, - ffi.Pointer replacement, -); - -typedef _dart_cJSON_ReplaceItemViaPointer = int Function( - ffi.Pointer parent, - ffi.Pointer item, - ffi.Pointer replacement, -); - -typedef _c_cJSON_ReplaceItemInArray = ffi.Void Function( - ffi.Pointer array, - ffi.Int32 which, - ffi.Pointer newitem, -); - -typedef _dart_cJSON_ReplaceItemInArray = void Function( - ffi.Pointer array, - int which, - ffi.Pointer newitem, -); - -typedef _c_cJSON_ReplaceItemInObject = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer newitem, -); - -typedef _dart_cJSON_ReplaceItemInObject = void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer newitem, -); - -typedef _c_cJSON_ReplaceItemInObjectCaseSensitive = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer newitem, -); - -typedef _dart_cJSON_ReplaceItemInObjectCaseSensitive = void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer newitem, -); - -typedef _c_cJSON_Duplicate = ffi.Pointer Function( - ffi.Pointer item, - ffi.Int32 recurse, -); - -typedef _dart_cJSON_Duplicate = ffi.Pointer Function( - ffi.Pointer item, - int recurse, -); - -typedef _c_cJSON_Compare = ffi.Int32 Function( - ffi.Pointer a, - ffi.Pointer b, - ffi.Int32 case_sensitive, -); - -typedef _dart_cJSON_Compare = int Function( - ffi.Pointer a, - ffi.Pointer b, - int case_sensitive, -); - -typedef _c_cJSON_Minify = ffi.Void Function( - ffi.Pointer json, -); - -typedef _dart_cJSON_Minify = void Function( - ffi.Pointer json, -); - -typedef _c_cJSON_AddNullToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _dart_cJSON_AddNullToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _c_cJSON_AddTrueToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _dart_cJSON_AddTrueToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _c_cJSON_AddFalseToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _dart_cJSON_AddFalseToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _c_cJSON_AddBoolToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Int32 boolean, -); - -typedef _dart_cJSON_AddBoolToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - int boolean, -); - -typedef _c_cJSON_AddNumberToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Double number, -); - -typedef _dart_cJSON_AddNumberToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - double number, -); - -typedef _c_cJSON_AddStringToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer string, -); - -typedef _dart_cJSON_AddStringToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer string, -); - -typedef _c_cJSON_AddRawToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer raw, -); - -typedef _dart_cJSON_AddRawToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer raw, -); - -typedef _c_cJSON_AddObjectToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _dart_cJSON_AddObjectToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _c_cJSON_AddArrayToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _dart_cJSON_AddArrayToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _c_cJSON_SetNumberHelper = ffi.Double Function( - ffi.Pointer object, - ffi.Double number, -); - -typedef _dart_cJSON_SetNumberHelper = double Function( - ffi.Pointer object, - double number, -); - -typedef _c_cJSON_malloc = ffi.Pointer Function( - ffi.Uint64 size, -); - -typedef _dart_cJSON_malloc = ffi.Pointer Function( - int size, -); - -typedef _c_cJSON_free = ffi.Void Function( - ffi.Pointer object, -); - -typedef _dart_cJSON_free = void Function( - ffi.Pointer object, -); - -typedef _typedefC_1 = ffi.Pointer Function( - ffi.Uint64, -); - -typedef _typedefC_2 = ffi.Void Function( - ffi.Pointer, -); diff --git a/pkgs/ffigen/example/c_json/main.dart b/pkgs/ffigen/example/c_json/main.dart index 2774c314a6..99042ebbd0 100644 --- a/pkgs/ffigen/example/c_json/main.dart +++ b/pkgs/ffigen/example/c_json/main.dart @@ -7,6 +7,7 @@ import 'dart:ffi'; import 'dart:io'; import 'package:ffi/ffi.dart'; +import 'package:path/path.dart' as p; import 'cjson_generated_bindings.dart' as cj; @@ -45,12 +46,14 @@ void main() { } String _getPath() { - var path = '../../third_party/cjson_library/libcjson.so'; + final cjsonExamplePath = Directory.current.absolute.path; + var path = p.join(cjsonExamplePath, '../../third_party/cjson_library/'); if (Platform.isMacOS) { - path = '../../third_party/cjson_library/libstructs.dylib'; - } - if (Platform.isWindows) { - path = r'..\..\third_party\cjson_library\Debug\structs.dll'; + path = p.join(path, 'libcjson.dylib'); + } else if (Platform.isWindows) { + path = p.join(path, 'Debug', 'cjson.dll'); + } else { + path = p.join(path, 'libcjson.so'); } return path; } diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index 5bce972a5b..03a913b3bf 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -5,10 +5,11 @@ name: c_json_example environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.13.0 <3.0.0' dependencies: ffi: ^1.0.0 + path: ^1.8.0 dev_dependencies: ffigen: @@ -24,6 +25,8 @@ ffigen: include-directives: - '**cJSON.h' comments: false + typedef-map: + 'size_t': 'IntPtr' preamble: | // Copyright (c) 2009-2017 Dave Gamble and cJSON contributors diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index 71fa196b83..f8e77c4e6a 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -34,8 +34,8 @@ class LibClang { late final _clang_getCString_ptr = _lookup>('clang_getCString'); - late final _dart_clang_getCString _clang_getCString = - _clang_getCString_ptr.asFunction<_dart_clang_getCString>(); + late final _clang_getCString = _clang_getCString_ptr + .asFunction Function(CXString)>(); /// Free the given string. void clang_disposeString( @@ -49,8 +49,8 @@ class LibClang { late final _clang_disposeString_ptr = _lookup>( 'clang_disposeString'); - late final _dart_clang_disposeString _clang_disposeString = - _clang_disposeString_ptr.asFunction<_dart_clang_disposeString>(); + late final _clang_disposeString = + _clang_disposeString_ptr.asFunction(); /// Free the given string set. void clang_disposeStringSet( @@ -64,8 +64,8 @@ class LibClang { late final _clang_disposeStringSet_ptr = _lookup>( 'clang_disposeStringSet'); - late final _dart_clang_disposeStringSet _clang_disposeStringSet = - _clang_disposeStringSet_ptr.asFunction<_dart_clang_disposeStringSet>(); + late final _clang_disposeStringSet = _clang_disposeStringSet_ptr + .asFunction)>(); /// Provides a shared context for creating translation units. /// @@ -105,7 +105,7 @@ class LibClang { /// This process of creating the 'pch', loading it separately, and using it (via /// -include-pch) allows 'excludeDeclsFromPCH' to remove redundant callbacks /// (which gives the indexer the same performance benefit as the compiler). - ffi.Pointer clang_createIndex( + CXIndex clang_createIndex( int excludeDeclarationsFromPCH, int displayDiagnostics, ) { @@ -118,15 +118,15 @@ class LibClang { late final _clang_createIndex_ptr = _lookup>( 'clang_createIndex'); - late final _dart_clang_createIndex _clang_createIndex = - _clang_createIndex_ptr.asFunction<_dart_clang_createIndex>(); + late final _clang_createIndex = + _clang_createIndex_ptr.asFunction(); /// Destroy the given index. /// /// The index must not be destroyed until all of the translation units created /// within that index have been destroyed. void clang_disposeIndex( - ffi.Pointer index, + CXIndex index, ) { return _clang_disposeIndex( index, @@ -136,8 +136,8 @@ class LibClang { late final _clang_disposeIndex_ptr = _lookup>( 'clang_disposeIndex'); - late final _dart_clang_disposeIndex _clang_disposeIndex = - _clang_disposeIndex_ptr.asFunction<_dart_clang_disposeIndex>(); + late final _clang_disposeIndex = + _clang_disposeIndex_ptr.asFunction(); /// Sets general options associated with a CXIndex. /// @@ -151,7 +151,7 @@ class LibClang { /// /// \param options A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags. void clang_CXIndex_setGlobalOptions( - ffi.Pointer arg0, + CXIndex arg0, int options, ) { return _clang_CXIndex_setGlobalOptions( @@ -163,16 +163,16 @@ class LibClang { late final _clang_CXIndex_setGlobalOptions_ptr = _lookup>( 'clang_CXIndex_setGlobalOptions'); - late final _dart_clang_CXIndex_setGlobalOptions - _clang_CXIndex_setGlobalOptions = _clang_CXIndex_setGlobalOptions_ptr - .asFunction<_dart_clang_CXIndex_setGlobalOptions>(); + late final _clang_CXIndex_setGlobalOptions = + _clang_CXIndex_setGlobalOptions_ptr + .asFunction(); /// Gets the general options associated with a CXIndex. /// /// \returns A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags that /// are associated with the given CXIndex object. int clang_CXIndex_getGlobalOptions( - ffi.Pointer arg0, + CXIndex arg0, ) { return _clang_CXIndex_getGlobalOptions( arg0, @@ -182,9 +182,8 @@ class LibClang { late final _clang_CXIndex_getGlobalOptions_ptr = _lookup>( 'clang_CXIndex_getGlobalOptions'); - late final _dart_clang_CXIndex_getGlobalOptions - _clang_CXIndex_getGlobalOptions = _clang_CXIndex_getGlobalOptions_ptr - .asFunction<_dart_clang_CXIndex_getGlobalOptions>(); + late final _clang_CXIndex_getGlobalOptions = + _clang_CXIndex_getGlobalOptions_ptr.asFunction(); /// Sets the invocation emission path option in a CXIndex. /// @@ -192,7 +191,7 @@ class LibClang { /// files for certain libclang invocations. A null value (default) implies that /// libclang invocations are not logged.. void clang_CXIndex_setInvocationEmissionPathOption( - ffi.Pointer arg0, + CXIndex arg0, ffi.Pointer Path, ) { return _clang_CXIndex_setInvocationEmissionPathOption( @@ -205,14 +204,13 @@ class LibClang { ffi.NativeFunction< Native_clang_CXIndex_setInvocationEmissionPathOption>>( 'clang_CXIndex_setInvocationEmissionPathOption'); - late final _dart_clang_CXIndex_setInvocationEmissionPathOption - _clang_CXIndex_setInvocationEmissionPathOption = + late final _clang_CXIndex_setInvocationEmissionPathOption = _clang_CXIndex_setInvocationEmissionPathOption_ptr - .asFunction<_dart_clang_CXIndex_setInvocationEmissionPathOption>(); + .asFunction)>(); /// Retrieve the complete file and path name of the given file. CXString clang_getFileName( - ffi.Pointer SFile, + CXFile SFile, ) { return _clang_getFileName( SFile, @@ -222,12 +220,12 @@ class LibClang { late final _clang_getFileName_ptr = _lookup>( 'clang_getFileName'); - late final _dart_clang_getFileName _clang_getFileName = - _clang_getFileName_ptr.asFunction<_dart_clang_getFileName>(); + late final _clang_getFileName = + _clang_getFileName_ptr.asFunction(); /// Retrieve the last modification time of the given file. int clang_getFileTime( - ffi.Pointer SFile, + CXFile SFile, ) { return _clang_getFileTime( SFile, @@ -237,8 +235,8 @@ class LibClang { late final _clang_getFileTime_ptr = _lookup>( 'clang_getFileTime'); - late final _dart_clang_getFileTime _clang_getFileTime = - _clang_getFileTime_ptr.asFunction<_dart_clang_getFileTime>(); + late final _clang_getFileTime = + _clang_getFileTime_ptr.asFunction(); /// Retrieve the unique ID for the given \c file. /// @@ -247,7 +245,7 @@ class LibClang { /// \returns If there was a failure getting the unique ID, returns non-zero, /// otherwise returns 0. int clang_getFileUniqueID( - ffi.Pointer file, + CXFile file, ffi.Pointer outID, ) { return _clang_getFileUniqueID( @@ -259,15 +257,15 @@ class LibClang { late final _clang_getFileUniqueID_ptr = _lookup>( 'clang_getFileUniqueID'); - late final _dart_clang_getFileUniqueID _clang_getFileUniqueID = - _clang_getFileUniqueID_ptr.asFunction<_dart_clang_getFileUniqueID>(); + late final _clang_getFileUniqueID = _clang_getFileUniqueID_ptr + .asFunction)>(); /// Determine whether the given header is guarded against /// multiple inclusions, either with the conventional /// \#ifndef/\#define/\#endif macro guards or with \#pragma once. int clang_isFileMultipleIncludeGuarded( - ffi.Pointer tu, - ffi.Pointer file, + CXTranslationUnit tu, + CXFile file, ) { return _clang_isFileMultipleIncludeGuarded( tu, @@ -278,10 +276,9 @@ class LibClang { late final _clang_isFileMultipleIncludeGuarded_ptr = _lookup>( 'clang_isFileMultipleIncludeGuarded'); - late final _dart_clang_isFileMultipleIncludeGuarded - _clang_isFileMultipleIncludeGuarded = + late final _clang_isFileMultipleIncludeGuarded = _clang_isFileMultipleIncludeGuarded_ptr - .asFunction<_dart_clang_isFileMultipleIncludeGuarded>(); + .asFunction(); /// Retrieve a file handle within the given translation unit. /// @@ -291,8 +288,8 @@ class LibClang { /// /// \returns the file handle for the named file in the translation unit \p tu, /// or a NULL file handle if the file was not a part of this translation unit. - ffi.Pointer clang_getFile( - ffi.Pointer tu, + CXFile clang_getFile( + CXTranslationUnit tu, ffi.Pointer file_name, ) { return _clang_getFile( @@ -303,8 +300,8 @@ class LibClang { late final _clang_getFile_ptr = _lookup>('clang_getFile'); - late final _dart_clang_getFile _clang_getFile = - _clang_getFile_ptr.asFunction<_dart_clang_getFile>(); + late final _clang_getFile = _clang_getFile_ptr + .asFunction)>(); /// Retrieve the buffer associated with the given file. /// @@ -317,9 +314,9 @@ class LibClang { /// \returns a pointer to the buffer in memory that holds the contents of /// \p file, or a NULL pointer when the file is not loaded. ffi.Pointer clang_getFileContents( - ffi.Pointer tu, - ffi.Pointer file, - ffi.Pointer size, + CXTranslationUnit tu, + CXFile file, + ffi.Pointer size, ) { return _clang_getFileContents( tu, @@ -331,14 +328,15 @@ class LibClang { late final _clang_getFileContents_ptr = _lookup>( 'clang_getFileContents'); - late final _dart_clang_getFileContents _clang_getFileContents = - _clang_getFileContents_ptr.asFunction<_dart_clang_getFileContents>(); + late final _clang_getFileContents = _clang_getFileContents_ptr.asFunction< + ffi.Pointer Function( + CXTranslationUnit, CXFile, ffi.Pointer)>(); /// Returns non-zero if the \c file1 and \c file2 point to the same file, /// or they are both NULL. int clang_File_isEqual( - ffi.Pointer file1, - ffi.Pointer file2, + CXFile file1, + CXFile file2, ) { return _clang_File_isEqual( file1, @@ -349,14 +347,14 @@ class LibClang { late final _clang_File_isEqual_ptr = _lookup>( 'clang_File_isEqual'); - late final _dart_clang_File_isEqual _clang_File_isEqual = - _clang_File_isEqual_ptr.asFunction<_dart_clang_File_isEqual>(); + late final _clang_File_isEqual = + _clang_File_isEqual_ptr.asFunction(); /// 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, + CXFile file, ) { return _clang_File_tryGetRealPathName( file, @@ -366,9 +364,8 @@ class LibClang { late final _clang_File_tryGetRealPathName_ptr = _lookup>( 'clang_File_tryGetRealPathName'); - late final _dart_clang_File_tryGetRealPathName - _clang_File_tryGetRealPathName = _clang_File_tryGetRealPathName_ptr - .asFunction<_dart_clang_File_tryGetRealPathName>(); + late final _clang_File_tryGetRealPathName = _clang_File_tryGetRealPathName_ptr + .asFunction(); /// Retrieve a NULL (invalid) source location. CXSourceLocation clang_getNullLocation() { @@ -378,8 +375,8 @@ class LibClang { late final _clang_getNullLocation_ptr = _lookup>( 'clang_getNullLocation'); - late final _dart_clang_getNullLocation _clang_getNullLocation = - _clang_getNullLocation_ptr.asFunction<_dart_clang_getNullLocation>(); + late final _clang_getNullLocation = + _clang_getNullLocation_ptr.asFunction(); /// Determine whether two source locations, which must refer into /// the same translation unit, refer to exactly the same point in the source @@ -400,14 +397,14 @@ class LibClang { late final _clang_equalLocations_ptr = _lookup>( 'clang_equalLocations'); - late final _dart_clang_equalLocations _clang_equalLocations = - _clang_equalLocations_ptr.asFunction<_dart_clang_equalLocations>(); + late final _clang_equalLocations = _clang_equalLocations_ptr + .asFunction(); /// 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, + CXTranslationUnit tu, + CXFile file, int line, int column, ) { @@ -422,14 +419,14 @@ class LibClang { late final _clang_getLocation_ptr = _lookup>( 'clang_getLocation'); - late final _dart_clang_getLocation _clang_getLocation = - _clang_getLocation_ptr.asFunction<_dart_clang_getLocation>(); + late final _clang_getLocation = _clang_getLocation_ptr.asFunction< + CXSourceLocation Function(CXTranslationUnit, CXFile, int, int)>(); /// Retrieves the source location associated with a given character offset /// in a particular translation unit. CXSourceLocation clang_getLocationForOffset( - ffi.Pointer tu, - ffi.Pointer file, + CXTranslationUnit tu, + CXFile file, int offset, ) { return _clang_getLocationForOffset( @@ -442,9 +439,8 @@ class LibClang { late final _clang_getLocationForOffset_ptr = _lookup>( 'clang_getLocationForOffset'); - late final _dart_clang_getLocationForOffset _clang_getLocationForOffset = - _clang_getLocationForOffset_ptr - .asFunction<_dart_clang_getLocationForOffset>(); + late final _clang_getLocationForOffset = _clang_getLocationForOffset_ptr + .asFunction(); /// Returns non-zero if the given source location is in a system header. int clang_Location_isInSystemHeader( @@ -458,9 +454,9 @@ class LibClang { late final _clang_Location_isInSystemHeader_ptr = _lookup>( 'clang_Location_isInSystemHeader'); - late final _dart_clang_Location_isInSystemHeader - _clang_Location_isInSystemHeader = _clang_Location_isInSystemHeader_ptr - .asFunction<_dart_clang_Location_isInSystemHeader>(); + late final _clang_Location_isInSystemHeader = + _clang_Location_isInSystemHeader_ptr + .asFunction(); /// Returns non-zero if the given source location is in the main file of /// the corresponding translation unit. @@ -475,9 +471,8 @@ class LibClang { late final _clang_Location_isFromMainFile_ptr = _lookup>( 'clang_Location_isFromMainFile'); - late final _dart_clang_Location_isFromMainFile - _clang_Location_isFromMainFile = _clang_Location_isFromMainFile_ptr - .asFunction<_dart_clang_Location_isFromMainFile>(); + late final _clang_Location_isFromMainFile = _clang_Location_isFromMainFile_ptr + .asFunction(); /// Retrieve a NULL (invalid) source range. CXSourceRange clang_getNullRange() { @@ -487,8 +482,8 @@ class LibClang { late final _clang_getNullRange_ptr = _lookup>( 'clang_getNullRange'); - late final _dart_clang_getNullRange _clang_getNullRange = - _clang_getNullRange_ptr.asFunction<_dart_clang_getNullRange>(); + late final _clang_getNullRange = + _clang_getNullRange_ptr.asFunction(); /// Retrieve a source range given the beginning and ending source /// locations. @@ -504,8 +499,8 @@ class LibClang { late final _clang_getRange_ptr = _lookup>('clang_getRange'); - late final _dart_clang_getRange _clang_getRange = - _clang_getRange_ptr.asFunction<_dart_clang_getRange>(); + late final _clang_getRange = _clang_getRange_ptr + .asFunction(); /// Determine whether two ranges are equivalent. /// @@ -523,8 +518,8 @@ class LibClang { late final _clang_equalRanges_ptr = _lookup>( 'clang_equalRanges'); - late final _dart_clang_equalRanges _clang_equalRanges = - _clang_equalRanges_ptr.asFunction<_dart_clang_equalRanges>(); + late final _clang_equalRanges = _clang_equalRanges_ptr + .asFunction(); /// Returns non-zero if \p range is null. int clang_Range_isNull( @@ -538,8 +533,8 @@ class LibClang { late final _clang_Range_isNull_ptr = _lookup>( 'clang_Range_isNull'); - late final _dart_clang_Range_isNull _clang_Range_isNull = - _clang_Range_isNull_ptr.asFunction<_dart_clang_Range_isNull>(); + late final _clang_Range_isNull = + _clang_Range_isNull_ptr.asFunction(); /// Retrieve the file, line, column, and offset represented by /// the given source location. @@ -563,7 +558,7 @@ class LibClang { /// buffer to which the given source location points. void clang_getExpansionLocation( CXSourceLocation location, - ffi.Pointer> file, + ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -580,9 +575,14 @@ class LibClang { late final _clang_getExpansionLocation_ptr = _lookup>( 'clang_getExpansionLocation'); - late final _dart_clang_getExpansionLocation _clang_getExpansionLocation = - _clang_getExpansionLocation_ptr - .asFunction<_dart_clang_getExpansionLocation>(); + late final _clang_getExpansionLocation = + _clang_getExpansionLocation_ptr.asFunction< + void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve the file, line and column represented by the given source /// location, as specified in a # line directive. @@ -639,9 +639,10 @@ class LibClang { late final _clang_getPresumedLocation_ptr = _lookup>( 'clang_getPresumedLocation'); - late final _dart_clang_getPresumedLocation _clang_getPresumedLocation = - _clang_getPresumedLocation_ptr - .asFunction<_dart_clang_getPresumedLocation>(); + late final _clang_getPresumedLocation = + _clang_getPresumedLocation_ptr.asFunction< + void Function(CXSourceLocation, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// Legacy API to retrieve the file, line, column, and offset represented /// by the given source location. @@ -651,7 +652,7 @@ class LibClang { /// details. void clang_getInstantiationLocation( CXSourceLocation location, - ffi.Pointer> file, + ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -668,9 +669,14 @@ class LibClang { late final _clang_getInstantiationLocation_ptr = _lookup>( 'clang_getInstantiationLocation'); - late final _dart_clang_getInstantiationLocation - _clang_getInstantiationLocation = _clang_getInstantiationLocation_ptr - .asFunction<_dart_clang_getInstantiationLocation>(); + late final _clang_getInstantiationLocation = + _clang_getInstantiationLocation_ptr.asFunction< + void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve the file, line, column, and offset represented by /// the given source location. @@ -694,7 +700,7 @@ class LibClang { /// buffer to which the given source location points. void clang_getSpellingLocation( CXSourceLocation location, - ffi.Pointer> file, + ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -711,9 +717,14 @@ class LibClang { late final _clang_getSpellingLocation_ptr = _lookup>( 'clang_getSpellingLocation'); - late final _dart_clang_getSpellingLocation _clang_getSpellingLocation = - _clang_getSpellingLocation_ptr - .asFunction<_dart_clang_getSpellingLocation>(); + late final _clang_getSpellingLocation = + _clang_getSpellingLocation_ptr.asFunction< + void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve the file, line, column, and offset represented by /// the given source location. @@ -738,7 +749,7 @@ class LibClang { /// buffer to which the given source location points. void clang_getFileLocation( CXSourceLocation location, - ffi.Pointer> file, + ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -755,8 +766,13 @@ class LibClang { late final _clang_getFileLocation_ptr = _lookup>( 'clang_getFileLocation'); - late final _dart_clang_getFileLocation _clang_getFileLocation = - _clang_getFileLocation_ptr.asFunction<_dart_clang_getFileLocation>(); + late final _clang_getFileLocation = _clang_getFileLocation_ptr.asFunction< + void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve a source location representing the first character within a /// source range. @@ -771,8 +787,8 @@ class LibClang { late final _clang_getRangeStart_ptr = _lookup>( 'clang_getRangeStart'); - late final _dart_clang_getRangeStart _clang_getRangeStart = - _clang_getRangeStart_ptr.asFunction<_dart_clang_getRangeStart>(); + late final _clang_getRangeStart = _clang_getRangeStart_ptr + .asFunction(); /// Retrieve a source location representing the last character within a /// source range. @@ -787,16 +803,16 @@ class LibClang { late final _clang_getRangeEnd_ptr = _lookup>( 'clang_getRangeEnd'); - late final _dart_clang_getRangeEnd _clang_getRangeEnd = - _clang_getRangeEnd_ptr.asFunction<_dart_clang_getRangeEnd>(); + late final _clang_getRangeEnd = _clang_getRangeEnd_ptr + .asFunction(); /// Retrieve all ranges that were skipped by the preprocessor. /// /// The preprocessor will skip lines when they are surrounded by an /// if/ifdef/ifndef directive whose condition does not evaluate to true. ffi.Pointer clang_getSkippedRanges( - ffi.Pointer tu, - ffi.Pointer file, + CXTranslationUnit tu, + CXFile file, ) { return _clang_getSkippedRanges( tu, @@ -807,8 +823,8 @@ class LibClang { late final _clang_getSkippedRanges_ptr = _lookup>( 'clang_getSkippedRanges'); - late final _dart_clang_getSkippedRanges _clang_getSkippedRanges = - _clang_getSkippedRanges_ptr.asFunction<_dart_clang_getSkippedRanges>(); + late final _clang_getSkippedRanges = _clang_getSkippedRanges_ptr.asFunction< + ffi.Pointer Function(CXTranslationUnit, CXFile)>(); /// Retrieve all ranges from all files that were skipped by the /// preprocessor. @@ -816,7 +832,7 @@ class LibClang { /// The preprocessor will skip lines when they are surrounded by an /// if/ifdef/ifndef directive whose condition does not evaluate to true. ffi.Pointer clang_getAllSkippedRanges( - ffi.Pointer tu, + CXTranslationUnit tu, ) { return _clang_getAllSkippedRanges( tu, @@ -826,9 +842,8 @@ class LibClang { late final _clang_getAllSkippedRanges_ptr = _lookup>( 'clang_getAllSkippedRanges'); - late final _dart_clang_getAllSkippedRanges _clang_getAllSkippedRanges = - _clang_getAllSkippedRanges_ptr - .asFunction<_dart_clang_getAllSkippedRanges>(); + late final _clang_getAllSkippedRanges = _clang_getAllSkippedRanges_ptr + .asFunction Function(CXTranslationUnit)>(); /// Destroy the given \c CXSourceRangeList. void clang_disposeSourceRangeList( @@ -842,13 +857,12 @@ class LibClang { late final _clang_disposeSourceRangeList_ptr = _lookup>( 'clang_disposeSourceRangeList'); - late final _dart_clang_disposeSourceRangeList _clang_disposeSourceRangeList = - _clang_disposeSourceRangeList_ptr - .asFunction<_dart_clang_disposeSourceRangeList>(); + late final _clang_disposeSourceRangeList = _clang_disposeSourceRangeList_ptr + .asFunction)>(); /// Determine the number of diagnostics in a CXDiagnosticSet. int clang_getNumDiagnosticsInSet( - ffi.Pointer Diags, + CXDiagnosticSet Diags, ) { return _clang_getNumDiagnosticsInSet( Diags, @@ -858,9 +872,8 @@ class LibClang { late final _clang_getNumDiagnosticsInSet_ptr = _lookup>( 'clang_getNumDiagnosticsInSet'); - late final _dart_clang_getNumDiagnosticsInSet _clang_getNumDiagnosticsInSet = - _clang_getNumDiagnosticsInSet_ptr - .asFunction<_dart_clang_getNumDiagnosticsInSet>(); + late final _clang_getNumDiagnosticsInSet = _clang_getNumDiagnosticsInSet_ptr + .asFunction(); /// Retrieve a diagnostic associated with the given CXDiagnosticSet. /// @@ -869,8 +882,8 @@ class LibClang { /// /// \returns the requested diagnostic. This diagnostic must be freed /// via a call to \c clang_disposeDiagnostic(). - ffi.Pointer clang_getDiagnosticInSet( - ffi.Pointer Diags, + CXDiagnostic clang_getDiagnosticInSet( + CXDiagnosticSet Diags, int Index, ) { return _clang_getDiagnosticInSet( @@ -882,9 +895,8 @@ class LibClang { late final _clang_getDiagnosticInSet_ptr = _lookup>( 'clang_getDiagnosticInSet'); - late final _dart_clang_getDiagnosticInSet _clang_getDiagnosticInSet = - _clang_getDiagnosticInSet_ptr - .asFunction<_dart_clang_getDiagnosticInSet>(); + late final _clang_getDiagnosticInSet = _clang_getDiagnosticInSet_ptr + .asFunction(); /// Deserialize a set of diagnostics from a Clang diagnostics bitcode /// file. @@ -897,7 +909,7 @@ class LibClang { /// /// \returns A loaded CXDiagnosticSet if successful, and NULL otherwise. These /// diagnostics should be released using clang_disposeDiagnosticSet(). - ffi.Pointer clang_loadDiagnostics( + CXDiagnosticSet clang_loadDiagnostics( ffi.Pointer file, ffi.Pointer error, ffi.Pointer errorString, @@ -912,12 +924,13 @@ class LibClang { late final _clang_loadDiagnostics_ptr = _lookup>( 'clang_loadDiagnostics'); - late final _dart_clang_loadDiagnostics _clang_loadDiagnostics = - _clang_loadDiagnostics_ptr.asFunction<_dart_clang_loadDiagnostics>(); + late final _clang_loadDiagnostics = _clang_loadDiagnostics_ptr.asFunction< + CXDiagnosticSet Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Release a CXDiagnosticSet and all of its contained diagnostics. void clang_disposeDiagnosticSet( - ffi.Pointer Diags, + CXDiagnosticSet Diags, ) { return _clang_disposeDiagnosticSet( Diags, @@ -927,16 +940,15 @@ class LibClang { late final _clang_disposeDiagnosticSet_ptr = _lookup>( 'clang_disposeDiagnosticSet'); - late final _dart_clang_disposeDiagnosticSet _clang_disposeDiagnosticSet = - _clang_disposeDiagnosticSet_ptr - .asFunction<_dart_clang_disposeDiagnosticSet>(); + late final _clang_disposeDiagnosticSet = _clang_disposeDiagnosticSet_ptr + .asFunction(); /// Retrieve the child diagnostics of a CXDiagnostic. /// /// This CXDiagnosticSet does not need to be released by /// clang_disposeDiagnosticSet. - ffi.Pointer clang_getChildDiagnostics( - ffi.Pointer D, + CXDiagnosticSet clang_getChildDiagnostics( + CXDiagnostic D, ) { return _clang_getChildDiagnostics( D, @@ -946,14 +958,13 @@ class LibClang { late final _clang_getChildDiagnostics_ptr = _lookup>( 'clang_getChildDiagnostics'); - late final _dart_clang_getChildDiagnostics _clang_getChildDiagnostics = - _clang_getChildDiagnostics_ptr - .asFunction<_dart_clang_getChildDiagnostics>(); + late final _clang_getChildDiagnostics = _clang_getChildDiagnostics_ptr + .asFunction(); /// Determine the number of diagnostics produced for the given /// translation unit. int clang_getNumDiagnostics( - ffi.Pointer Unit, + CXTranslationUnit Unit, ) { return _clang_getNumDiagnostics( Unit, @@ -963,8 +974,8 @@ class LibClang { late final _clang_getNumDiagnostics_ptr = _lookup>( 'clang_getNumDiagnostics'); - late final _dart_clang_getNumDiagnostics _clang_getNumDiagnostics = - _clang_getNumDiagnostics_ptr.asFunction<_dart_clang_getNumDiagnostics>(); + late final _clang_getNumDiagnostics = _clang_getNumDiagnostics_ptr + .asFunction(); /// Retrieve a diagnostic associated with the given translation unit. /// @@ -973,8 +984,8 @@ class LibClang { /// /// \returns the requested diagnostic. This diagnostic must be freed /// via a call to \c clang_disposeDiagnostic(). - ffi.Pointer clang_getDiagnostic( - ffi.Pointer Unit, + CXDiagnostic clang_getDiagnostic( + CXTranslationUnit Unit, int Index, ) { return _clang_getDiagnostic( @@ -986,15 +997,15 @@ class LibClang { late final _clang_getDiagnostic_ptr = _lookup>( 'clang_getDiagnostic'); - late final _dart_clang_getDiagnostic _clang_getDiagnostic = - _clang_getDiagnostic_ptr.asFunction<_dart_clang_getDiagnostic>(); + late final _clang_getDiagnostic = _clang_getDiagnostic_ptr + .asFunction(); /// Retrieve the complete set of diagnostics associated with a /// translation unit. /// /// \param Unit the translation unit to query. - ffi.Pointer clang_getDiagnosticSetFromTU( - ffi.Pointer Unit, + CXDiagnosticSet clang_getDiagnosticSetFromTU( + CXTranslationUnit Unit, ) { return _clang_getDiagnosticSetFromTU( Unit, @@ -1004,13 +1015,12 @@ class LibClang { late final _clang_getDiagnosticSetFromTU_ptr = _lookup>( 'clang_getDiagnosticSetFromTU'); - late final _dart_clang_getDiagnosticSetFromTU _clang_getDiagnosticSetFromTU = - _clang_getDiagnosticSetFromTU_ptr - .asFunction<_dart_clang_getDiagnosticSetFromTU>(); + late final _clang_getDiagnosticSetFromTU = _clang_getDiagnosticSetFromTU_ptr + .asFunction(); /// Destroy a diagnostic. void clang_disposeDiagnostic( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, ) { return _clang_disposeDiagnostic( Diagnostic, @@ -1020,8 +1030,8 @@ class LibClang { late final _clang_disposeDiagnostic_ptr = _lookup>( 'clang_disposeDiagnostic'); - late final _dart_clang_disposeDiagnostic _clang_disposeDiagnostic = - _clang_disposeDiagnostic_ptr.asFunction<_dart_clang_disposeDiagnostic>(); + late final _clang_disposeDiagnostic = + _clang_disposeDiagnostic_ptr.asFunction(); /// Format the given diagnostic in a manner that is suitable for display. /// @@ -1037,7 +1047,7 @@ class LibClang { /// /// \returns A new string containing for formatted diagnostic. CXString clang_formatDiagnostic( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, int Options, ) { return _clang_formatDiagnostic( @@ -1049,8 +1059,8 @@ class LibClang { late final _clang_formatDiagnostic_ptr = _lookup>( 'clang_formatDiagnostic'); - late final _dart_clang_formatDiagnostic _clang_formatDiagnostic = - _clang_formatDiagnostic_ptr.asFunction<_dart_clang_formatDiagnostic>(); + late final _clang_formatDiagnostic = _clang_formatDiagnostic_ptr + .asFunction(); /// Retrieve the set of display options most similar to the /// default behavior of the clang compiler. @@ -1064,14 +1074,12 @@ class LibClang { late final _clang_defaultDiagnosticDisplayOptions_ptr = _lookup>( 'clang_defaultDiagnosticDisplayOptions'); - late final _dart_clang_defaultDiagnosticDisplayOptions - _clang_defaultDiagnosticDisplayOptions = - _clang_defaultDiagnosticDisplayOptions_ptr - .asFunction<_dart_clang_defaultDiagnosticDisplayOptions>(); + late final _clang_defaultDiagnosticDisplayOptions = + _clang_defaultDiagnosticDisplayOptions_ptr.asFunction(); /// Determine the severity of the given diagnostic. int clang_getDiagnosticSeverity( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticSeverity( arg0, @@ -1081,16 +1089,15 @@ class LibClang { late final _clang_getDiagnosticSeverity_ptr = _lookup>( 'clang_getDiagnosticSeverity'); - late final _dart_clang_getDiagnosticSeverity _clang_getDiagnosticSeverity = - _clang_getDiagnosticSeverity_ptr - .asFunction<_dart_clang_getDiagnosticSeverity>(); + late final _clang_getDiagnosticSeverity = + _clang_getDiagnosticSeverity_ptr.asFunction(); /// 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, + CXDiagnostic arg0, ) { return _clang_getDiagnosticLocation( arg0, @@ -1100,13 +1107,12 @@ class LibClang { late final _clang_getDiagnosticLocation_ptr = _lookup>( 'clang_getDiagnosticLocation'); - late final _dart_clang_getDiagnosticLocation _clang_getDiagnosticLocation = - _clang_getDiagnosticLocation_ptr - .asFunction<_dart_clang_getDiagnosticLocation>(); + late final _clang_getDiagnosticLocation = _clang_getDiagnosticLocation_ptr + .asFunction(); /// Retrieve the text of the given diagnostic. CXString clang_getDiagnosticSpelling( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticSpelling( arg0, @@ -1116,9 +1122,8 @@ class LibClang { late final _clang_getDiagnosticSpelling_ptr = _lookup>( 'clang_getDiagnosticSpelling'); - late final _dart_clang_getDiagnosticSpelling _clang_getDiagnosticSpelling = - _clang_getDiagnosticSpelling_ptr - .asFunction<_dart_clang_getDiagnosticSpelling>(); + late final _clang_getDiagnosticSpelling = _clang_getDiagnosticSpelling_ptr + .asFunction(); /// Retrieve the name of the command-line option that enabled this /// diagnostic. @@ -1131,7 +1136,7 @@ class LibClang { /// \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, + CXDiagnostic Diag, ffi.Pointer Disable, ) { return _clang_getDiagnosticOption( @@ -1143,9 +1148,8 @@ class LibClang { late final _clang_getDiagnosticOption_ptr = _lookup>( 'clang_getDiagnosticOption'); - late final _dart_clang_getDiagnosticOption _clang_getDiagnosticOption = - _clang_getDiagnosticOption_ptr - .asFunction<_dart_clang_getDiagnosticOption>(); + late final _clang_getDiagnosticOption = _clang_getDiagnosticOption_ptr + .asFunction)>(); /// Retrieve the category number for this diagnostic. /// @@ -1156,7 +1160,7 @@ class LibClang { /// \returns The number of the category that contains this diagnostic, or zero /// if this diagnostic is uncategorized. int clang_getDiagnosticCategory( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticCategory( arg0, @@ -1166,9 +1170,8 @@ class LibClang { late final _clang_getDiagnosticCategory_ptr = _lookup>( 'clang_getDiagnosticCategory'); - late final _dart_clang_getDiagnosticCategory _clang_getDiagnosticCategory = - _clang_getDiagnosticCategory_ptr - .asFunction<_dart_clang_getDiagnosticCategory>(); + late final _clang_getDiagnosticCategory = + _clang_getDiagnosticCategory_ptr.asFunction(); /// Retrieve the name of a particular diagnostic category. This /// is now deprecated. Use clang_getDiagnosticCategoryText() @@ -1189,15 +1192,14 @@ class LibClang { late final _clang_getDiagnosticCategoryName_ptr = _lookup>( 'clang_getDiagnosticCategoryName'); - late final _dart_clang_getDiagnosticCategoryName - _clang_getDiagnosticCategoryName = _clang_getDiagnosticCategoryName_ptr - .asFunction<_dart_clang_getDiagnosticCategoryName>(); + late final _clang_getDiagnosticCategoryName = + _clang_getDiagnosticCategoryName_ptr.asFunction(); /// Retrieve the diagnostic category text for a given diagnostic. /// /// \returns The text of the given diagnostic category. CXString clang_getDiagnosticCategoryText( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticCategoryText( arg0, @@ -1207,14 +1209,14 @@ class LibClang { late final _clang_getDiagnosticCategoryText_ptr = _lookup>( 'clang_getDiagnosticCategoryText'); - late final _dart_clang_getDiagnosticCategoryText - _clang_getDiagnosticCategoryText = _clang_getDiagnosticCategoryText_ptr - .asFunction<_dart_clang_getDiagnosticCategoryText>(); + late final _clang_getDiagnosticCategoryText = + _clang_getDiagnosticCategoryText_ptr + .asFunction(); /// Determine the number of source ranges associated with the given /// diagnostic. int clang_getDiagnosticNumRanges( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticNumRanges( arg0, @@ -1224,9 +1226,8 @@ class LibClang { late final _clang_getDiagnosticNumRanges_ptr = _lookup>( 'clang_getDiagnosticNumRanges'); - late final _dart_clang_getDiagnosticNumRanges _clang_getDiagnosticNumRanges = - _clang_getDiagnosticNumRanges_ptr - .asFunction<_dart_clang_getDiagnosticNumRanges>(); + late final _clang_getDiagnosticNumRanges = _clang_getDiagnosticNumRanges_ptr + .asFunction(); /// Retrieve a source range associated with the diagnostic. /// @@ -1240,7 +1241,7 @@ class LibClang { /// /// \returns the requested source range. CXSourceRange clang_getDiagnosticRange( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, int Range, ) { return _clang_getDiagnosticRange( @@ -1252,14 +1253,13 @@ class LibClang { late final _clang_getDiagnosticRange_ptr = _lookup>( 'clang_getDiagnosticRange'); - late final _dart_clang_getDiagnosticRange _clang_getDiagnosticRange = - _clang_getDiagnosticRange_ptr - .asFunction<_dart_clang_getDiagnosticRange>(); + late final _clang_getDiagnosticRange = _clang_getDiagnosticRange_ptr + .asFunction(); /// Determine the number of fix-it hints associated with the /// given diagnostic. int clang_getDiagnosticNumFixIts( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, ) { return _clang_getDiagnosticNumFixIts( Diagnostic, @@ -1269,9 +1269,8 @@ class LibClang { late final _clang_getDiagnosticNumFixIts_ptr = _lookup>( 'clang_getDiagnosticNumFixIts'); - late final _dart_clang_getDiagnosticNumFixIts _clang_getDiagnosticNumFixIts = - _clang_getDiagnosticNumFixIts_ptr - .asFunction<_dart_clang_getDiagnosticNumFixIts>(); + late final _clang_getDiagnosticNumFixIts = _clang_getDiagnosticNumFixIts_ptr + .asFunction(); /// Retrieve the replacement information for a given fix-it. /// @@ -1297,7 +1296,7 @@ class LibClang { /// \returns A string containing text that should be replace the source /// code indicated by the \c ReplacementRange. CXString clang_getDiagnosticFixIt( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, int FixIt, ffi.Pointer ReplacementRange, ) { @@ -1311,13 +1310,13 @@ class LibClang { late final _clang_getDiagnosticFixIt_ptr = _lookup>( 'clang_getDiagnosticFixIt'); - late final _dart_clang_getDiagnosticFixIt _clang_getDiagnosticFixIt = - _clang_getDiagnosticFixIt_ptr - .asFunction<_dart_clang_getDiagnosticFixIt>(); + late final _clang_getDiagnosticFixIt = + _clang_getDiagnosticFixIt_ptr.asFunction< + CXString Function(CXDiagnostic, int, ffi.Pointer)>(); /// Get the original translation unit source file name. CXString clang_getTranslationUnitSpelling( - ffi.Pointer CTUnit, + CXTranslationUnit CTUnit, ) { return _clang_getTranslationUnitSpelling( CTUnit, @@ -1327,9 +1326,9 @@ class LibClang { late final _clang_getTranslationUnitSpelling_ptr = _lookup>( 'clang_getTranslationUnitSpelling'); - late final _dart_clang_getTranslationUnitSpelling - _clang_getTranslationUnitSpelling = _clang_getTranslationUnitSpelling_ptr - .asFunction<_dart_clang_getTranslationUnitSpelling>(); + late final _clang_getTranslationUnitSpelling = + _clang_getTranslationUnitSpelling_ptr + .asFunction(); /// Return the CXTranslationUnit for a given source file and the provided /// command line arguments one would pass to the compiler. @@ -1369,8 +1368,8 @@ class LibClang { /// 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. - ffi.Pointer clang_createTranslationUnitFromSourceFile( - ffi.Pointer CIdx, + CXTranslationUnit clang_createTranslationUnitFromSourceFile( + CXIndex CIdx, ffi.Pointer source_filename, int num_clang_command_line_args, ffi.Pointer> clang_command_line_args, @@ -1390,17 +1389,22 @@ class LibClang { late final _clang_createTranslationUnitFromSourceFile_ptr = _lookup< ffi.NativeFunction>( 'clang_createTranslationUnitFromSourceFile'); - late final _dart_clang_createTranslationUnitFromSourceFile - _clang_createTranslationUnitFromSourceFile = - _clang_createTranslationUnitFromSourceFile_ptr - .asFunction<_dart_clang_createTranslationUnitFromSourceFile>(); + late final _clang_createTranslationUnitFromSourceFile = + _clang_createTranslationUnitFromSourceFile_ptr.asFunction< + CXTranslationUnit Function( + CXIndex, + ffi.Pointer, + int, + ffi.Pointer>, + int, + ffi.Pointer)>(); /// Same as \c clang_createTranslationUnit2, but returns /// the \c CXTranslationUnit instead of an error code. In case of an error this /// routine returns a \c NULL \c CXTranslationUnit, without further detailed /// error codes. - ffi.Pointer clang_createTranslationUnit( - ffi.Pointer CIdx, + CXTranslationUnit clang_createTranslationUnit( + CXIndex CIdx, ffi.Pointer ast_filename, ) { return _clang_createTranslationUnit( @@ -1412,9 +1416,8 @@ class LibClang { late final _clang_createTranslationUnit_ptr = _lookup>( 'clang_createTranslationUnit'); - late final _dart_clang_createTranslationUnit _clang_createTranslationUnit = - _clang_createTranslationUnit_ptr - .asFunction<_dart_clang_createTranslationUnit>(); + late final _clang_createTranslationUnit = _clang_createTranslationUnit_ptr + .asFunction)>(); /// Create a translation unit from an AST file (\c -emit-ast). /// @@ -1423,9 +1426,9 @@ class LibClang { /// /// \returns Zero on success, otherwise returns an error code. int clang_createTranslationUnit2( - ffi.Pointer CIdx, + CXIndex CIdx, ffi.Pointer ast_filename, - ffi.Pointer> out_TU, + ffi.Pointer out_TU, ) { return _clang_createTranslationUnit2( CIdx, @@ -1437,9 +1440,10 @@ class LibClang { late final _clang_createTranslationUnit2_ptr = _lookup>( 'clang_createTranslationUnit2'); - late final _dart_clang_createTranslationUnit2 _clang_createTranslationUnit2 = - _clang_createTranslationUnit2_ptr - .asFunction<_dart_clang_createTranslationUnit2>(); + late final _clang_createTranslationUnit2 = + _clang_createTranslationUnit2_ptr.asFunction< + int Function(CXIndex, ffi.Pointer, + ffi.Pointer)>(); /// Returns the set of flags that is suitable for parsing a translation /// unit that is being edited. @@ -1459,17 +1463,16 @@ class LibClang { ffi.NativeFunction< Native_clang_defaultEditingTranslationUnitOptions>>( 'clang_defaultEditingTranslationUnitOptions'); - late final _dart_clang_defaultEditingTranslationUnitOptions - _clang_defaultEditingTranslationUnitOptions = + late final _clang_defaultEditingTranslationUnitOptions = _clang_defaultEditingTranslationUnitOptions_ptr - .asFunction<_dart_clang_defaultEditingTranslationUnitOptions>(); + .asFunction(); /// Same as \c clang_parseTranslationUnit2, but returns /// the \c CXTranslationUnit instead of an error code. In case of an error this /// routine returns a \c NULL \c CXTranslationUnit, without further detailed /// error codes. - ffi.Pointer clang_parseTranslationUnit( - ffi.Pointer CIdx, + CXTranslationUnit clang_parseTranslationUnit( + CXIndex CIdx, ffi.Pointer source_filename, ffi.Pointer> command_line_args, int num_command_line_args, @@ -1491,9 +1494,16 @@ class LibClang { late final _clang_parseTranslationUnit_ptr = _lookup>( 'clang_parseTranslationUnit'); - late final _dart_clang_parseTranslationUnit _clang_parseTranslationUnit = - _clang_parseTranslationUnit_ptr - .asFunction<_dart_clang_parseTranslationUnit>(); + late final _clang_parseTranslationUnit = + _clang_parseTranslationUnit_ptr.asFunction< + CXTranslationUnit Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + int)>(); /// Parse the given source file and the translation unit corresponding /// to that file. @@ -1538,14 +1548,14 @@ class LibClang { /// /// \returns Zero on success, otherwise returns an error code. int clang_parseTranslationUnit2( - ffi.Pointer CIdx, + CXIndex 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, + ffi.Pointer out_TU, ) { return _clang_parseTranslationUnit2( CIdx, @@ -1562,22 +1572,30 @@ class LibClang { late final _clang_parseTranslationUnit2_ptr = _lookup>( 'clang_parseTranslationUnit2'); - late final _dart_clang_parseTranslationUnit2 _clang_parseTranslationUnit2 = - _clang_parseTranslationUnit2_ptr - .asFunction<_dart_clang_parseTranslationUnit2>(); + late final _clang_parseTranslationUnit2 = + _clang_parseTranslationUnit2_ptr.asFunction< + int Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + int, + ffi.Pointer)>(); /// Same as clang_parseTranslationUnit2 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_parseTranslationUnit2FullArgv( - ffi.Pointer CIdx, + CXIndex 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, + ffi.Pointer out_TU, ) { return _clang_parseTranslationUnit2FullArgv( CIdx, @@ -1594,10 +1612,17 @@ class LibClang { late final _clang_parseTranslationUnit2FullArgv_ptr = _lookup>( 'clang_parseTranslationUnit2FullArgv'); - late final _dart_clang_parseTranslationUnit2FullArgv - _clang_parseTranslationUnit2FullArgv = - _clang_parseTranslationUnit2FullArgv_ptr - .asFunction<_dart_clang_parseTranslationUnit2FullArgv>(); + late final _clang_parseTranslationUnit2FullArgv = + _clang_parseTranslationUnit2FullArgv_ptr.asFunction< + int Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + int, + ffi.Pointer)>(); /// Returns the set of flags that is suitable for saving a translation /// unit. @@ -1607,7 +1632,7 @@ class LibClang { /// set contains an unspecified set of options that save translation units with /// the most commonly-requested data. int clang_defaultSaveOptions( - ffi.Pointer TU, + CXTranslationUnit TU, ) { return _clang_defaultSaveOptions( TU, @@ -1617,9 +1642,8 @@ class LibClang { late final _clang_defaultSaveOptions_ptr = _lookup>( 'clang_defaultSaveOptions'); - late final _dart_clang_defaultSaveOptions _clang_defaultSaveOptions = - _clang_defaultSaveOptions_ptr - .asFunction<_dart_clang_defaultSaveOptions>(); + late final _clang_defaultSaveOptions = _clang_defaultSaveOptions_ptr + .asFunction(); /// Saves a translation unit into a serialized representation of /// that translation unit on disk. @@ -1643,7 +1667,7 @@ class LibClang { /// enumeration. Zero (CXSaveError_None) indicates that the translation unit was /// saved successfully, while a non-zero value indicates that a problem occurred. int clang_saveTranslationUnit( - ffi.Pointer TU, + CXTranslationUnit TU, ffi.Pointer FileName, int options, ) { @@ -1657,9 +1681,9 @@ class LibClang { late final _clang_saveTranslationUnit_ptr = _lookup>( 'clang_saveTranslationUnit'); - late final _dart_clang_saveTranslationUnit _clang_saveTranslationUnit = - _clang_saveTranslationUnit_ptr - .asFunction<_dart_clang_saveTranslationUnit>(); + late final _clang_saveTranslationUnit = + _clang_saveTranslationUnit_ptr.asFunction< + int Function(CXTranslationUnit, ffi.Pointer, int)>(); /// Suspend a translation unit in order to free memory associated with it. /// @@ -1667,7 +1691,7 @@ class LibClang { /// side does not support any other calls than \c clang_reparseTranslationUnit /// to resume it or \c clang_disposeTranslationUnit to dispose it completely. int clang_suspendTranslationUnit( - ffi.Pointer arg0, + CXTranslationUnit arg0, ) { return _clang_suspendTranslationUnit( arg0, @@ -1677,13 +1701,12 @@ class LibClang { late final _clang_suspendTranslationUnit_ptr = _lookup>( 'clang_suspendTranslationUnit'); - late final _dart_clang_suspendTranslationUnit _clang_suspendTranslationUnit = - _clang_suspendTranslationUnit_ptr - .asFunction<_dart_clang_suspendTranslationUnit>(); + late final _clang_suspendTranslationUnit = _clang_suspendTranslationUnit_ptr + .asFunction(); /// Destroy the specified CXTranslationUnit object. void clang_disposeTranslationUnit( - ffi.Pointer arg0, + CXTranslationUnit arg0, ) { return _clang_disposeTranslationUnit( arg0, @@ -1693,9 +1716,8 @@ class LibClang { late final _clang_disposeTranslationUnit_ptr = _lookup>( 'clang_disposeTranslationUnit'); - late final _dart_clang_disposeTranslationUnit _clang_disposeTranslationUnit = - _clang_disposeTranslationUnit_ptr - .asFunction<_dart_clang_disposeTranslationUnit>(); + late final _clang_disposeTranslationUnit = _clang_disposeTranslationUnit_ptr + .asFunction(); /// Returns the set of flags that is suitable for reparsing a translation /// unit. @@ -1706,7 +1728,7 @@ class LibClang { /// of reparsing. The set of optimizations enabled may change from one version /// to the next. int clang_defaultReparseOptions( - ffi.Pointer TU, + CXTranslationUnit TU, ) { return _clang_defaultReparseOptions( TU, @@ -1716,9 +1738,8 @@ class LibClang { late final _clang_defaultReparseOptions_ptr = _lookup>( 'clang_defaultReparseOptions'); - late final _dart_clang_defaultReparseOptions _clang_defaultReparseOptions = - _clang_defaultReparseOptions_ptr - .asFunction<_dart_clang_defaultReparseOptions>(); + late final _clang_defaultReparseOptions = _clang_defaultReparseOptions_ptr + .asFunction(); /// Reparse the source files that produced this translation unit. /// @@ -1758,7 +1779,7 @@ class LibClang { /// \c clang_disposeTranslationUnit(TU). The error codes returned by this /// routine are described by the \c CXErrorCode enum. int clang_reparseTranslationUnit( - ffi.Pointer TU, + CXTranslationUnit TU, int num_unsaved_files, ffi.Pointer unsaved_files, int options, @@ -1774,9 +1795,10 @@ class LibClang { late final _clang_reparseTranslationUnit_ptr = _lookup>( 'clang_reparseTranslationUnit'); - late final _dart_clang_reparseTranslationUnit _clang_reparseTranslationUnit = - _clang_reparseTranslationUnit_ptr - .asFunction<_dart_clang_reparseTranslationUnit>(); + late final _clang_reparseTranslationUnit = + _clang_reparseTranslationUnit_ptr.asFunction< + int Function( + CXTranslationUnit, int, ffi.Pointer, int)>(); /// Returns the human-readable null-terminated C string that represents /// the name of the memory category. This string should never be freed. @@ -1791,14 +1813,13 @@ class LibClang { late final _clang_getTUResourceUsageName_ptr = _lookup>( 'clang_getTUResourceUsageName'); - late final _dart_clang_getTUResourceUsageName _clang_getTUResourceUsageName = - _clang_getTUResourceUsageName_ptr - .asFunction<_dart_clang_getTUResourceUsageName>(); + late final _clang_getTUResourceUsageName = _clang_getTUResourceUsageName_ptr + .asFunction Function(int)>(); /// Return the memory usage of a translation unit. This object /// should be released with clang_disposeCXTUResourceUsage(). CXTUResourceUsage clang_getCXTUResourceUsage( - ffi.Pointer TU, + CXTranslationUnit TU, ) { return _clang_getCXTUResourceUsage( TU, @@ -1808,9 +1829,8 @@ class LibClang { late final _clang_getCXTUResourceUsage_ptr = _lookup>( 'clang_getCXTUResourceUsage'); - late final _dart_clang_getCXTUResourceUsage _clang_getCXTUResourceUsage = - _clang_getCXTUResourceUsage_ptr - .asFunction<_dart_clang_getCXTUResourceUsage>(); + late final _clang_getCXTUResourceUsage = _clang_getCXTUResourceUsage_ptr + .asFunction(); void clang_disposeCXTUResourceUsage( CXTUResourceUsage usage, @@ -1823,15 +1843,15 @@ class LibClang { late final _clang_disposeCXTUResourceUsage_ptr = _lookup>( 'clang_disposeCXTUResourceUsage'); - late final _dart_clang_disposeCXTUResourceUsage - _clang_disposeCXTUResourceUsage = _clang_disposeCXTUResourceUsage_ptr - .asFunction<_dart_clang_disposeCXTUResourceUsage>(); + late final _clang_disposeCXTUResourceUsage = + _clang_disposeCXTUResourceUsage_ptr + .asFunction(); /// Get target information for this translation unit. /// /// The CXTargetInfo object cannot outlive the CXTranslationUnit object. - ffi.Pointer clang_getTranslationUnitTargetInfo( - ffi.Pointer CTUnit, + CXTargetInfo clang_getTranslationUnitTargetInfo( + CXTranslationUnit CTUnit, ) { return _clang_getTranslationUnitTargetInfo( CTUnit, @@ -1841,14 +1861,13 @@ class LibClang { late final _clang_getTranslationUnitTargetInfo_ptr = _lookup>( 'clang_getTranslationUnitTargetInfo'); - late final _dart_clang_getTranslationUnitTargetInfo - _clang_getTranslationUnitTargetInfo = + late final _clang_getTranslationUnitTargetInfo = _clang_getTranslationUnitTargetInfo_ptr - .asFunction<_dart_clang_getTranslationUnitTargetInfo>(); + .asFunction(); /// Destroy the CXTargetInfo object. void clang_TargetInfo_dispose( - ffi.Pointer Info, + CXTargetInfo Info, ) { return _clang_TargetInfo_dispose( Info, @@ -1858,15 +1877,14 @@ class LibClang { late final _clang_TargetInfo_dispose_ptr = _lookup>( 'clang_TargetInfo_dispose'); - late final _dart_clang_TargetInfo_dispose _clang_TargetInfo_dispose = - _clang_TargetInfo_dispose_ptr - .asFunction<_dart_clang_TargetInfo_dispose>(); + late final _clang_TargetInfo_dispose = + _clang_TargetInfo_dispose_ptr.asFunction(); /// Get the normalized target triple as a string. /// /// Returns the empty string in case of any error. CXString clang_TargetInfo_getTriple( - ffi.Pointer Info, + CXTargetInfo Info, ) { return _clang_TargetInfo_getTriple( Info, @@ -1876,15 +1894,14 @@ class LibClang { late final _clang_TargetInfo_getTriple_ptr = _lookup>( 'clang_TargetInfo_getTriple'); - late final _dart_clang_TargetInfo_getTriple _clang_TargetInfo_getTriple = - _clang_TargetInfo_getTriple_ptr - .asFunction<_dart_clang_TargetInfo_getTriple>(); + late final _clang_TargetInfo_getTriple = _clang_TargetInfo_getTriple_ptr + .asFunction(); /// Get the pointer width of the target in bits. /// /// Returns -1 in case of error. int clang_TargetInfo_getPointerWidth( - ffi.Pointer Info, + CXTargetInfo Info, ) { return _clang_TargetInfo_getPointerWidth( Info, @@ -1894,9 +1911,9 @@ class LibClang { late final _clang_TargetInfo_getPointerWidth_ptr = _lookup>( 'clang_TargetInfo_getPointerWidth'); - late final _dart_clang_TargetInfo_getPointerWidth - _clang_TargetInfo_getPointerWidth = _clang_TargetInfo_getPointerWidth_ptr - .asFunction<_dart_clang_TargetInfo_getPointerWidth>(); + late final _clang_TargetInfo_getPointerWidth = + _clang_TargetInfo_getPointerWidth_ptr + .asFunction(); /// Retrieve the NULL cursor, which represents no entity. CXCursor clang_getNullCursor() { @@ -1906,15 +1923,15 @@ class LibClang { late final _clang_getNullCursor_ptr = _lookup>( 'clang_getNullCursor'); - late final _dart_clang_getNullCursor _clang_getNullCursor = - _clang_getNullCursor_ptr.asFunction<_dart_clang_getNullCursor>(); + late final _clang_getNullCursor = + _clang_getNullCursor_ptr.asFunction(); /// 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, + CXTranslationUnit arg0, ) { return _clang_getTranslationUnitCursor( arg0, @@ -1924,9 +1941,9 @@ class LibClang { late final _clang_getTranslationUnitCursor_ptr = _lookup>( 'clang_getTranslationUnitCursor'); - late final _dart_clang_getTranslationUnitCursor - _clang_getTranslationUnitCursor = _clang_getTranslationUnitCursor_ptr - .asFunction<_dart_clang_getTranslationUnitCursor>(); + late final _clang_getTranslationUnitCursor = + _clang_getTranslationUnitCursor_ptr + .asFunction(); /// Determine whether two cursors are equivalent. int clang_equalCursors( @@ -1942,8 +1959,8 @@ class LibClang { late final _clang_equalCursors_ptr = _lookup>( 'clang_equalCursors'); - late final _dart_clang_equalCursors _clang_equalCursors = - _clang_equalCursors_ptr.asFunction<_dart_clang_equalCursors>(); + late final _clang_equalCursors = + _clang_equalCursors_ptr.asFunction(); /// Returns non-zero if \p cursor is null. int clang_Cursor_isNull( @@ -1957,8 +1974,8 @@ class LibClang { late final _clang_Cursor_isNull_ptr = _lookup>( 'clang_Cursor_isNull'); - late final _dart_clang_Cursor_isNull _clang_Cursor_isNull = - _clang_Cursor_isNull_ptr.asFunction<_dart_clang_Cursor_isNull>(); + late final _clang_Cursor_isNull = + _clang_Cursor_isNull_ptr.asFunction(); /// Compute a hash value for the given cursor. int clang_hashCursor( @@ -1971,8 +1988,8 @@ class LibClang { late final _clang_hashCursor_ptr = _lookup>('clang_hashCursor'); - late final _dart_clang_hashCursor _clang_hashCursor = - _clang_hashCursor_ptr.asFunction<_dart_clang_hashCursor>(); + late final _clang_hashCursor = + _clang_hashCursor_ptr.asFunction(); /// Retrieve the kind of the given cursor. int clang_getCursorKind( @@ -1986,8 +2003,8 @@ class LibClang { late final _clang_getCursorKind_ptr = _lookup>( 'clang_getCursorKind'); - late final _dart_clang_getCursorKind _clang_getCursorKind = - _clang_getCursorKind_ptr.asFunction<_dart_clang_getCursorKind>(); + late final _clang_getCursorKind = + _clang_getCursorKind_ptr.asFunction(); /// Determine whether the given cursor kind represents a declaration. int clang_isDeclaration( @@ -2001,8 +2018,8 @@ class LibClang { late final _clang_isDeclaration_ptr = _lookup>( 'clang_isDeclaration'); - late final _dart_clang_isDeclaration _clang_isDeclaration = - _clang_isDeclaration_ptr.asFunction<_dart_clang_isDeclaration>(); + late final _clang_isDeclaration = + _clang_isDeclaration_ptr.asFunction(); /// Determine whether the given declaration is invalid. /// @@ -2021,9 +2038,8 @@ class LibClang { late final _clang_isInvalidDeclaration_ptr = _lookup>( 'clang_isInvalidDeclaration'); - late final _dart_clang_isInvalidDeclaration _clang_isInvalidDeclaration = - _clang_isInvalidDeclaration_ptr - .asFunction<_dart_clang_isInvalidDeclaration>(); + late final _clang_isInvalidDeclaration = + _clang_isInvalidDeclaration_ptr.asFunction(); /// Determine whether the given cursor kind represents a simple /// reference. @@ -2042,8 +2058,8 @@ class LibClang { late final _clang_isReference_ptr = _lookup>( 'clang_isReference'); - late final _dart_clang_isReference _clang_isReference = - _clang_isReference_ptr.asFunction<_dart_clang_isReference>(); + late final _clang_isReference = + _clang_isReference_ptr.asFunction(); /// Determine whether the given cursor kind represents an expression. int clang_isExpression( @@ -2057,8 +2073,8 @@ class LibClang { late final _clang_isExpression_ptr = _lookup>( 'clang_isExpression'); - late final _dart_clang_isExpression _clang_isExpression = - _clang_isExpression_ptr.asFunction<_dart_clang_isExpression>(); + late final _clang_isExpression = + _clang_isExpression_ptr.asFunction(); /// Determine whether the given cursor kind represents a statement. int clang_isStatement( @@ -2072,8 +2088,8 @@ class LibClang { late final _clang_isStatement_ptr = _lookup>( 'clang_isStatement'); - late final _dart_clang_isStatement _clang_isStatement = - _clang_isStatement_ptr.asFunction<_dart_clang_isStatement>(); + late final _clang_isStatement = + _clang_isStatement_ptr.asFunction(); /// Determine whether the given cursor kind represents an attribute. int clang_isAttribute( @@ -2087,8 +2103,8 @@ class LibClang { late final _clang_isAttribute_ptr = _lookup>( 'clang_isAttribute'); - late final _dart_clang_isAttribute _clang_isAttribute = - _clang_isAttribute_ptr.asFunction<_dart_clang_isAttribute>(); + late final _clang_isAttribute = + _clang_isAttribute_ptr.asFunction(); /// Determine whether the given cursor has any attributes. int clang_Cursor_hasAttrs( @@ -2102,8 +2118,8 @@ class LibClang { late final _clang_Cursor_hasAttrs_ptr = _lookup>( 'clang_Cursor_hasAttrs'); - late final _dart_clang_Cursor_hasAttrs _clang_Cursor_hasAttrs = - _clang_Cursor_hasAttrs_ptr.asFunction<_dart_clang_Cursor_hasAttrs>(); + late final _clang_Cursor_hasAttrs = + _clang_Cursor_hasAttrs_ptr.asFunction(); /// Determine whether the given cursor kind represents an invalid /// cursor. @@ -2117,8 +2133,8 @@ class LibClang { late final _clang_isInvalid_ptr = _lookup>('clang_isInvalid'); - late final _dart_clang_isInvalid _clang_isInvalid = - _clang_isInvalid_ptr.asFunction<_dart_clang_isInvalid>(); + late final _clang_isInvalid = + _clang_isInvalid_ptr.asFunction(); /// Determine whether the given cursor kind represents a translation /// unit. @@ -2133,8 +2149,8 @@ class LibClang { late final _clang_isTranslationUnit_ptr = _lookup>( 'clang_isTranslationUnit'); - late final _dart_clang_isTranslationUnit _clang_isTranslationUnit = - _clang_isTranslationUnit_ptr.asFunction<_dart_clang_isTranslationUnit>(); + late final _clang_isTranslationUnit = + _clang_isTranslationUnit_ptr.asFunction(); /// Determine whether the given cursor represents a preprocessing /// element, such as a preprocessor directive or macro instantiation. @@ -2149,8 +2165,8 @@ class LibClang { late final _clang_isPreprocessing_ptr = _lookup>( 'clang_isPreprocessing'); - late final _dart_clang_isPreprocessing _clang_isPreprocessing = - _clang_isPreprocessing_ptr.asFunction<_dart_clang_isPreprocessing>(); + late final _clang_isPreprocessing = + _clang_isPreprocessing_ptr.asFunction(); /// Determine whether the given cursor represents a currently /// unexposed piece of the AST (e.g., CXCursor_UnexposedStmt). @@ -2165,8 +2181,8 @@ class LibClang { late final _clang_isUnexposed_ptr = _lookup>( 'clang_isUnexposed'); - late final _dart_clang_isUnexposed _clang_isUnexposed = - _clang_isUnexposed_ptr.asFunction<_dart_clang_isUnexposed>(); + late final _clang_isUnexposed = + _clang_isUnexposed_ptr.asFunction(); /// Determine the linkage of the entity referred to by a given cursor. int clang_getCursorLinkage( @@ -2180,8 +2196,8 @@ class LibClang { late final _clang_getCursorLinkage_ptr = _lookup>( 'clang_getCursorLinkage'); - late final _dart_clang_getCursorLinkage _clang_getCursorLinkage = - _clang_getCursorLinkage_ptr.asFunction<_dart_clang_getCursorLinkage>(); + late final _clang_getCursorLinkage = + _clang_getCursorLinkage_ptr.asFunction(); /// Describe the visibility of the entity referred to by a cursor. /// @@ -2203,9 +2219,8 @@ class LibClang { late final _clang_getCursorVisibility_ptr = _lookup>( 'clang_getCursorVisibility'); - late final _dart_clang_getCursorVisibility _clang_getCursorVisibility = - _clang_getCursorVisibility_ptr - .asFunction<_dart_clang_getCursorVisibility>(); + late final _clang_getCursorVisibility = + _clang_getCursorVisibility_ptr.asFunction(); /// Determine the availability of the entity that this cursor refers to, /// taking the current target platform into account. @@ -2224,9 +2239,8 @@ class LibClang { late final _clang_getCursorAvailability_ptr = _lookup>( 'clang_getCursorAvailability'); - late final _dart_clang_getCursorAvailability _clang_getCursorAvailability = - _clang_getCursorAvailability_ptr - .asFunction<_dart_clang_getCursorAvailability>(); + late final _clang_getCursorAvailability = + _clang_getCursorAvailability_ptr.asFunction(); /// Determine the availability of the entity that this cursor refers to /// on any platforms for which availability information is known. @@ -2285,10 +2299,16 @@ class LibClang { late final _clang_getCursorPlatformAvailability_ptr = _lookup>( 'clang_getCursorPlatformAvailability'); - late final _dart_clang_getCursorPlatformAvailability - _clang_getCursorPlatformAvailability = - _clang_getCursorPlatformAvailability_ptr - .asFunction<_dart_clang_getCursorPlatformAvailability>(); + late final _clang_getCursorPlatformAvailability = + _clang_getCursorPlatformAvailability_ptr.asFunction< + int Function( + CXCursor, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); /// Free the memory associated with a \c CXPlatformAvailability structure. void clang_disposeCXPlatformAvailability( @@ -2302,10 +2322,9 @@ class LibClang { late final _clang_disposeCXPlatformAvailability_ptr = _lookup>( 'clang_disposeCXPlatformAvailability'); - late final _dart_clang_disposeCXPlatformAvailability - _clang_disposeCXPlatformAvailability = + late final _clang_disposeCXPlatformAvailability = _clang_disposeCXPlatformAvailability_ptr - .asFunction<_dart_clang_disposeCXPlatformAvailability>(); + .asFunction)>(); /// Determine the "language" of the entity referred to by a given cursor. int clang_getCursorLanguage( @@ -2319,8 +2338,8 @@ class LibClang { late final _clang_getCursorLanguage_ptr = _lookup>( 'clang_getCursorLanguage'); - late final _dart_clang_getCursorLanguage _clang_getCursorLanguage = - _clang_getCursorLanguage_ptr.asFunction<_dart_clang_getCursorLanguage>(); + late final _clang_getCursorLanguage = + _clang_getCursorLanguage_ptr.asFunction(); /// Determine the "thread-local storage (TLS) kind" of the declaration /// referred to by a cursor. @@ -2335,11 +2354,11 @@ class LibClang { late final _clang_getCursorTLSKind_ptr = _lookup>( 'clang_getCursorTLSKind'); - late final _dart_clang_getCursorTLSKind _clang_getCursorTLSKind = - _clang_getCursorTLSKind_ptr.asFunction<_dart_clang_getCursorTLSKind>(); + late final _clang_getCursorTLSKind = + _clang_getCursorTLSKind_ptr.asFunction(); /// Returns the translation unit that a cursor originated from. - ffi.Pointer clang_Cursor_getTranslationUnit( + CXTranslationUnit clang_Cursor_getTranslationUnit( CXCursor arg0, ) { return _clang_Cursor_getTranslationUnit( @@ -2350,24 +2369,24 @@ class LibClang { late final _clang_Cursor_getTranslationUnit_ptr = _lookup>( 'clang_Cursor_getTranslationUnit'); - late final _dart_clang_Cursor_getTranslationUnit - _clang_Cursor_getTranslationUnit = _clang_Cursor_getTranslationUnit_ptr - .asFunction<_dart_clang_Cursor_getTranslationUnit>(); + late final _clang_Cursor_getTranslationUnit = + _clang_Cursor_getTranslationUnit_ptr + .asFunction(); /// Creates an empty CXCursorSet. - ffi.Pointer clang_createCXCursorSet() { + CXCursorSet clang_createCXCursorSet() { return _clang_createCXCursorSet(); } late final _clang_createCXCursorSet_ptr = _lookup>( 'clang_createCXCursorSet'); - late final _dart_clang_createCXCursorSet _clang_createCXCursorSet = - _clang_createCXCursorSet_ptr.asFunction<_dart_clang_createCXCursorSet>(); + late final _clang_createCXCursorSet = + _clang_createCXCursorSet_ptr.asFunction(); /// Disposes a CXCursorSet and releases its associated memory. void clang_disposeCXCursorSet( - ffi.Pointer cset, + CXCursorSet cset, ) { return _clang_disposeCXCursorSet( cset, @@ -2377,15 +2396,14 @@ class LibClang { late final _clang_disposeCXCursorSet_ptr = _lookup>( 'clang_disposeCXCursorSet'); - late final _dart_clang_disposeCXCursorSet _clang_disposeCXCursorSet = - _clang_disposeCXCursorSet_ptr - .asFunction<_dart_clang_disposeCXCursorSet>(); + late final _clang_disposeCXCursorSet = + _clang_disposeCXCursorSet_ptr.asFunction(); /// 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, + CXCursorSet cset, CXCursor cursor, ) { return _clang_CXCursorSet_contains( @@ -2397,15 +2415,14 @@ class LibClang { late final _clang_CXCursorSet_contains_ptr = _lookup>( 'clang_CXCursorSet_contains'); - late final _dart_clang_CXCursorSet_contains _clang_CXCursorSet_contains = - _clang_CXCursorSet_contains_ptr - .asFunction<_dart_clang_CXCursorSet_contains>(); + late final _clang_CXCursorSet_contains = _clang_CXCursorSet_contains_ptr + .asFunction(); /// 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, + CXCursorSet cset, CXCursor cursor, ) { return _clang_CXCursorSet_insert( @@ -2417,9 +2434,8 @@ class LibClang { late final _clang_CXCursorSet_insert_ptr = _lookup>( 'clang_CXCursorSet_insert'); - late final _dart_clang_CXCursorSet_insert _clang_CXCursorSet_insert = - _clang_CXCursorSet_insert_ptr - .asFunction<_dart_clang_CXCursorSet_insert>(); + late final _clang_CXCursorSet_insert = _clang_CXCursorSet_insert_ptr + .asFunction(); /// Determine the semantic parent of the given cursor. /// @@ -2463,9 +2479,8 @@ class LibClang { late final _clang_getCursorSemanticParent_ptr = _lookup>( 'clang_getCursorSemanticParent'); - late final _dart_clang_getCursorSemanticParent - _clang_getCursorSemanticParent = _clang_getCursorSemanticParent_ptr - .asFunction<_dart_clang_getCursorSemanticParent>(); + late final _clang_getCursorSemanticParent = _clang_getCursorSemanticParent_ptr + .asFunction(); /// Determine the lexical parent of the given cursor. /// @@ -2510,9 +2525,8 @@ class LibClang { late final _clang_getCursorLexicalParent_ptr = _lookup>( 'clang_getCursorLexicalParent'); - late final _dart_clang_getCursorLexicalParent _clang_getCursorLexicalParent = - _clang_getCursorLexicalParent_ptr - .asFunction<_dart_clang_getCursorLexicalParent>(); + late final _clang_getCursorLexicalParent = _clang_getCursorLexicalParent_ptr + .asFunction(); /// Determine the set of methods that are overridden by the given /// method. @@ -2570,9 +2584,10 @@ class LibClang { late final _clang_getOverriddenCursors_ptr = _lookup>( 'clang_getOverriddenCursors'); - late final _dart_clang_getOverriddenCursors _clang_getOverriddenCursors = - _clang_getOverriddenCursors_ptr - .asFunction<_dart_clang_getOverriddenCursors>(); + late final _clang_getOverriddenCursors = + _clang_getOverriddenCursors_ptr.asFunction< + void Function(CXCursor, ffi.Pointer>, + ffi.Pointer)>(); /// Free the set of overridden cursors returned by \c /// clang_getOverriddenCursors(). @@ -2587,13 +2602,13 @@ class LibClang { late final _clang_disposeOverriddenCursors_ptr = _lookup>( 'clang_disposeOverriddenCursors'); - late final _dart_clang_disposeOverriddenCursors - _clang_disposeOverriddenCursors = _clang_disposeOverriddenCursors_ptr - .asFunction<_dart_clang_disposeOverriddenCursors>(); + late final _clang_disposeOverriddenCursors = + _clang_disposeOverriddenCursors_ptr + .asFunction)>(); /// Retrieve the file that is included by the given inclusion directive /// cursor. - ffi.Pointer clang_getIncludedFile( + CXFile clang_getIncludedFile( CXCursor cursor, ) { return _clang_getIncludedFile( @@ -2604,8 +2619,8 @@ class LibClang { late final _clang_getIncludedFile_ptr = _lookup>( 'clang_getIncludedFile'); - late final _dart_clang_getIncludedFile _clang_getIncludedFile = - _clang_getIncludedFile_ptr.asFunction<_dart_clang_getIncludedFile>(); + late final _clang_getIncludedFile = + _clang_getIncludedFile_ptr.asFunction(); /// Map a source location to the cursor that describes the entity at that /// location in the source code. @@ -2621,7 +2636,7 @@ class LibClang { /// \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, + CXTranslationUnit arg0, CXSourceLocation arg1, ) { return _clang_getCursor( @@ -2632,8 +2647,8 @@ class LibClang { late final _clang_getCursor_ptr = _lookup>('clang_getCursor'); - late final _dart_clang_getCursor _clang_getCursor = - _clang_getCursor_ptr.asFunction<_dart_clang_getCursor>(); + late final _clang_getCursor = _clang_getCursor_ptr + .asFunction(); /// Retrieve the physical location of the source constructor referenced /// by the given cursor. @@ -2654,8 +2669,8 @@ class LibClang { late final _clang_getCursorLocation_ptr = _lookup>( 'clang_getCursorLocation'); - late final _dart_clang_getCursorLocation _clang_getCursorLocation = - _clang_getCursorLocation_ptr.asFunction<_dart_clang_getCursorLocation>(); + late final _clang_getCursorLocation = _clang_getCursorLocation_ptr + .asFunction(); /// Retrieve the physical extent of the source construct referenced by /// the given cursor. @@ -2677,8 +2692,8 @@ class LibClang { late final _clang_getCursorExtent_ptr = _lookup>( 'clang_getCursorExtent'); - late final _dart_clang_getCursorExtent _clang_getCursorExtent = - _clang_getCursorExtent_ptr.asFunction<_dart_clang_getCursorExtent>(); + late final _clang_getCursorExtent = + _clang_getCursorExtent_ptr.asFunction(); /// Retrieve the type of a CXCursor (if any). CXType clang_getCursorType( @@ -2692,8 +2707,8 @@ class LibClang { late final _clang_getCursorType_ptr = _lookup>( 'clang_getCursorType'); - late final _dart_clang_getCursorType _clang_getCursorType = - _clang_getCursorType_ptr.asFunction<_dart_clang_getCursorType>(); + late final _clang_getCursorType = + _clang_getCursorType_ptr.asFunction(); /// Pretty-print the underlying type using the rules of the /// language of the translation unit from which it came. @@ -2710,8 +2725,8 @@ class LibClang { late final _clang_getTypeSpelling_ptr = _lookup>( 'clang_getTypeSpelling'); - late final _dart_clang_getTypeSpelling _clang_getTypeSpelling = - _clang_getTypeSpelling_ptr.asFunction<_dart_clang_getTypeSpelling>(); + late final _clang_getTypeSpelling = + _clang_getTypeSpelling_ptr.asFunction(); /// Retrieve the underlying type of a typedef declaration. /// @@ -2728,10 +2743,9 @@ class LibClang { late final _clang_getTypedefDeclUnderlyingType_ptr = _lookup>( 'clang_getTypedefDeclUnderlyingType'); - late final _dart_clang_getTypedefDeclUnderlyingType - _clang_getTypedefDeclUnderlyingType = + late final _clang_getTypedefDeclUnderlyingType = _clang_getTypedefDeclUnderlyingType_ptr - .asFunction<_dart_clang_getTypedefDeclUnderlyingType>(); + .asFunction(); /// Retrieve the integer type of an enum declaration. /// @@ -2748,9 +2762,8 @@ class LibClang { late final _clang_getEnumDeclIntegerType_ptr = _lookup>( 'clang_getEnumDeclIntegerType'); - late final _dart_clang_getEnumDeclIntegerType _clang_getEnumDeclIntegerType = - _clang_getEnumDeclIntegerType_ptr - .asFunction<_dart_clang_getEnumDeclIntegerType>(); + late final _clang_getEnumDeclIntegerType = + _clang_getEnumDeclIntegerType_ptr.asFunction(); /// Retrieve the integer value of an enum constant declaration as a signed /// long long. @@ -2769,9 +2782,8 @@ class LibClang { late final _clang_getEnumConstantDeclValue_ptr = _lookup>( 'clang_getEnumConstantDeclValue'); - late final _dart_clang_getEnumConstantDeclValue - _clang_getEnumConstantDeclValue = _clang_getEnumConstantDeclValue_ptr - .asFunction<_dart_clang_getEnumConstantDeclValue>(); + late final _clang_getEnumConstantDeclValue = + _clang_getEnumConstantDeclValue_ptr.asFunction(); /// Retrieve the integer value of an enum constant declaration as an unsigned /// long long. @@ -2790,10 +2802,9 @@ class LibClang { late final _clang_getEnumConstantDeclUnsignedValue_ptr = _lookup< ffi.NativeFunction>( 'clang_getEnumConstantDeclUnsignedValue'); - late final _dart_clang_getEnumConstantDeclUnsignedValue - _clang_getEnumConstantDeclUnsignedValue = + late final _clang_getEnumConstantDeclUnsignedValue = _clang_getEnumConstantDeclUnsignedValue_ptr - .asFunction<_dart_clang_getEnumConstantDeclUnsignedValue>(); + .asFunction(); /// Retrieve the bit width of a bit field declaration as an integer. /// @@ -2809,9 +2820,8 @@ class LibClang { late final _clang_getFieldDeclBitWidth_ptr = _lookup>( 'clang_getFieldDeclBitWidth'); - late final _dart_clang_getFieldDeclBitWidth _clang_getFieldDeclBitWidth = - _clang_getFieldDeclBitWidth_ptr - .asFunction<_dart_clang_getFieldDeclBitWidth>(); + late final _clang_getFieldDeclBitWidth = + _clang_getFieldDeclBitWidth_ptr.asFunction(); /// Retrieve the number of non-variadic arguments associated with a given /// cursor. @@ -2829,9 +2839,8 @@ class LibClang { late final _clang_Cursor_getNumArguments_ptr = _lookup>( 'clang_Cursor_getNumArguments'); - late final _dart_clang_Cursor_getNumArguments _clang_Cursor_getNumArguments = - _clang_Cursor_getNumArguments_ptr - .asFunction<_dart_clang_Cursor_getNumArguments>(); + late final _clang_Cursor_getNumArguments = + _clang_Cursor_getNumArguments_ptr.asFunction(); /// Retrieve the argument cursor of a function or method. /// @@ -2851,9 +2860,8 @@ class LibClang { late final _clang_Cursor_getArgument_ptr = _lookup>( 'clang_Cursor_getArgument'); - late final _dart_clang_Cursor_getArgument _clang_Cursor_getArgument = - _clang_Cursor_getArgument_ptr - .asFunction<_dart_clang_Cursor_getArgument>(); + late final _clang_Cursor_getArgument = _clang_Cursor_getArgument_ptr + .asFunction(); /// Returns the number of template args of a function decl representing a /// template specialization. @@ -2880,10 +2888,9 @@ class LibClang { late final _clang_Cursor_getNumTemplateArguments_ptr = _lookup>( 'clang_Cursor_getNumTemplateArguments'); - late final _dart_clang_Cursor_getNumTemplateArguments - _clang_Cursor_getNumTemplateArguments = + late final _clang_Cursor_getNumTemplateArguments = _clang_Cursor_getNumTemplateArguments_ptr - .asFunction<_dart_clang_Cursor_getNumTemplateArguments>(); + .asFunction(); /// Retrieve the kind of the I'th template argument of the CXCursor C. /// @@ -2912,10 +2919,9 @@ class LibClang { late final _clang_Cursor_getTemplateArgumentKind_ptr = _lookup>( 'clang_Cursor_getTemplateArgumentKind'); - late final _dart_clang_Cursor_getTemplateArgumentKind - _clang_Cursor_getTemplateArgumentKind = + late final _clang_Cursor_getTemplateArgumentKind = _clang_Cursor_getTemplateArgumentKind_ptr - .asFunction<_dart_clang_Cursor_getTemplateArgumentKind>(); + .asFunction(); /// Retrieve a CXType representing the type of a TemplateArgument of a /// function decl representing a template specialization. @@ -2946,10 +2952,9 @@ class LibClang { late final _clang_Cursor_getTemplateArgumentType_ptr = _lookup>( 'clang_Cursor_getTemplateArgumentType'); - late final _dart_clang_Cursor_getTemplateArgumentType - _clang_Cursor_getTemplateArgumentType = + late final _clang_Cursor_getTemplateArgumentType = _clang_Cursor_getTemplateArgumentType_ptr - .asFunction<_dart_clang_Cursor_getTemplateArgumentType>(); + .asFunction(); /// Retrieve the value of an Integral TemplateArgument (of a function /// decl representing a template specialization) as a signed long long. @@ -2979,10 +2984,9 @@ class LibClang { late final _clang_Cursor_getTemplateArgumentValue_ptr = _lookup>( 'clang_Cursor_getTemplateArgumentValue'); - late final _dart_clang_Cursor_getTemplateArgumentValue - _clang_Cursor_getTemplateArgumentValue = + late final _clang_Cursor_getTemplateArgumentValue = _clang_Cursor_getTemplateArgumentValue_ptr - .asFunction<_dart_clang_Cursor_getTemplateArgumentValue>(); + .asFunction(); /// Retrieve the value of an Integral TemplateArgument (of a function /// decl representing a template specialization) as an unsigned long long. @@ -3013,10 +3017,9 @@ class LibClang { ffi.NativeFunction< Native_clang_Cursor_getTemplateArgumentUnsignedValue>>( 'clang_Cursor_getTemplateArgumentUnsignedValue'); - late final _dart_clang_Cursor_getTemplateArgumentUnsignedValue - _clang_Cursor_getTemplateArgumentUnsignedValue = + late final _clang_Cursor_getTemplateArgumentUnsignedValue = _clang_Cursor_getTemplateArgumentUnsignedValue_ptr - .asFunction<_dart_clang_Cursor_getTemplateArgumentUnsignedValue>(); + .asFunction(); /// Determine whether two CXTypes represent the same type. /// @@ -3034,8 +3037,8 @@ class LibClang { late final _clang_equalTypes_ptr = _lookup>('clang_equalTypes'); - late final _dart_clang_equalTypes _clang_equalTypes = - _clang_equalTypes_ptr.asFunction<_dart_clang_equalTypes>(); + late final _clang_equalTypes = + _clang_equalTypes_ptr.asFunction(); /// Return the canonical type for a CXType. /// @@ -3054,8 +3057,8 @@ class LibClang { late final _clang_getCanonicalType_ptr = _lookup>( 'clang_getCanonicalType'); - late final _dart_clang_getCanonicalType _clang_getCanonicalType = - _clang_getCanonicalType_ptr.asFunction<_dart_clang_getCanonicalType>(); + late final _clang_getCanonicalType = + _clang_getCanonicalType_ptr.asFunction(); /// Determine whether a CXType has the "const" qualifier set, /// without looking through typedefs that may have added "const" at a @@ -3071,9 +3074,8 @@ class LibClang { late final _clang_isConstQualifiedType_ptr = _lookup>( 'clang_isConstQualifiedType'); - late final _dart_clang_isConstQualifiedType _clang_isConstQualifiedType = - _clang_isConstQualifiedType_ptr - .asFunction<_dart_clang_isConstQualifiedType>(); + late final _clang_isConstQualifiedType = + _clang_isConstQualifiedType_ptr.asFunction(); /// Determine whether a CXCursor that is a macro, is /// function like. @@ -3088,9 +3090,9 @@ class LibClang { late final _clang_Cursor_isMacroFunctionLike_ptr = _lookup>( 'clang_Cursor_isMacroFunctionLike'); - late final _dart_clang_Cursor_isMacroFunctionLike - _clang_Cursor_isMacroFunctionLike = _clang_Cursor_isMacroFunctionLike_ptr - .asFunction<_dart_clang_Cursor_isMacroFunctionLike>(); + late final _clang_Cursor_isMacroFunctionLike = + _clang_Cursor_isMacroFunctionLike_ptr + .asFunction(); /// Determine whether a CXCursor that is a macro, is a /// builtin one. @@ -3105,9 +3107,8 @@ class LibClang { late final _clang_Cursor_isMacroBuiltin_ptr = _lookup>( 'clang_Cursor_isMacroBuiltin'); - late final _dart_clang_Cursor_isMacroBuiltin _clang_Cursor_isMacroBuiltin = - _clang_Cursor_isMacroBuiltin_ptr - .asFunction<_dart_clang_Cursor_isMacroBuiltin>(); + late final _clang_Cursor_isMacroBuiltin = + _clang_Cursor_isMacroBuiltin_ptr.asFunction(); /// Determine whether a CXCursor that is a function declaration, is an /// inline declaration. @@ -3122,9 +3123,8 @@ class LibClang { late final _clang_Cursor_isFunctionInlined_ptr = _lookup>( 'clang_Cursor_isFunctionInlined'); - late final _dart_clang_Cursor_isFunctionInlined - _clang_Cursor_isFunctionInlined = _clang_Cursor_isFunctionInlined_ptr - .asFunction<_dart_clang_Cursor_isFunctionInlined>(); + late final _clang_Cursor_isFunctionInlined = + _clang_Cursor_isFunctionInlined_ptr.asFunction(); /// Determine whether a CXType has the "volatile" qualifier set, /// without looking through typedefs that may have added "volatile" at @@ -3140,9 +3140,8 @@ class LibClang { late final _clang_isVolatileQualifiedType_ptr = _lookup>( 'clang_isVolatileQualifiedType'); - late final _dart_clang_isVolatileQualifiedType - _clang_isVolatileQualifiedType = _clang_isVolatileQualifiedType_ptr - .asFunction<_dart_clang_isVolatileQualifiedType>(); + late final _clang_isVolatileQualifiedType = + _clang_isVolatileQualifiedType_ptr.asFunction(); /// Determine whether a CXType has the "restrict" qualifier set, /// without looking through typedefs that may have added "restrict" at a @@ -3158,9 +3157,8 @@ class LibClang { late final _clang_isRestrictQualifiedType_ptr = _lookup>( 'clang_isRestrictQualifiedType'); - late final _dart_clang_isRestrictQualifiedType - _clang_isRestrictQualifiedType = _clang_isRestrictQualifiedType_ptr - .asFunction<_dart_clang_isRestrictQualifiedType>(); + late final _clang_isRestrictQualifiedType = + _clang_isRestrictQualifiedType_ptr.asFunction(); /// Returns the address space of the given type. int clang_getAddressSpace( @@ -3174,8 +3172,8 @@ class LibClang { late final _clang_getAddressSpace_ptr = _lookup>( 'clang_getAddressSpace'); - late final _dart_clang_getAddressSpace _clang_getAddressSpace = - _clang_getAddressSpace_ptr.asFunction<_dart_clang_getAddressSpace>(); + late final _clang_getAddressSpace = + _clang_getAddressSpace_ptr.asFunction(); /// Returns the typedef name of the given type. CXString clang_getTypedefName( @@ -3189,8 +3187,8 @@ class LibClang { late final _clang_getTypedefName_ptr = _lookup>( 'clang_getTypedefName'); - late final _dart_clang_getTypedefName _clang_getTypedefName = - _clang_getTypedefName_ptr.asFunction<_dart_clang_getTypedefName>(); + late final _clang_getTypedefName = + _clang_getTypedefName_ptr.asFunction(); /// For pointer types, returns the type of the pointee. CXType clang_getPointeeType( @@ -3204,8 +3202,8 @@ class LibClang { late final _clang_getPointeeType_ptr = _lookup>( 'clang_getPointeeType'); - late final _dart_clang_getPointeeType _clang_getPointeeType = - _clang_getPointeeType_ptr.asFunction<_dart_clang_getPointeeType>(); + late final _clang_getPointeeType = + _clang_getPointeeType_ptr.asFunction(); /// Return the cursor for the declaration of the given type. CXCursor clang_getTypeDeclaration( @@ -3219,9 +3217,8 @@ class LibClang { late final _clang_getTypeDeclaration_ptr = _lookup>( 'clang_getTypeDeclaration'); - late final _dart_clang_getTypeDeclaration _clang_getTypeDeclaration = - _clang_getTypeDeclaration_ptr - .asFunction<_dart_clang_getTypeDeclaration>(); + late final _clang_getTypeDeclaration = + _clang_getTypeDeclaration_ptr.asFunction(); /// Returns the Objective-C type encoding for the specified declaration. CXString clang_getDeclObjCTypeEncoding( @@ -3235,9 +3232,8 @@ class LibClang { late final _clang_getDeclObjCTypeEncoding_ptr = _lookup>( 'clang_getDeclObjCTypeEncoding'); - late final _dart_clang_getDeclObjCTypeEncoding - _clang_getDeclObjCTypeEncoding = _clang_getDeclObjCTypeEncoding_ptr - .asFunction<_dart_clang_getDeclObjCTypeEncoding>(); + late final _clang_getDeclObjCTypeEncoding = _clang_getDeclObjCTypeEncoding_ptr + .asFunction(); /// Returns the Objective-C type encoding for the specified CXType. CXString clang_Type_getObjCEncoding( @@ -3251,9 +3247,8 @@ class LibClang { late final _clang_Type_getObjCEncoding_ptr = _lookup>( 'clang_Type_getObjCEncoding'); - late final _dart_clang_Type_getObjCEncoding _clang_Type_getObjCEncoding = - _clang_Type_getObjCEncoding_ptr - .asFunction<_dart_clang_Type_getObjCEncoding>(); + late final _clang_Type_getObjCEncoding = + _clang_Type_getObjCEncoding_ptr.asFunction(); /// Retrieve the spelling of a given CXTypeKind. CXString clang_getTypeKindSpelling( @@ -3267,9 +3262,8 @@ class LibClang { late final _clang_getTypeKindSpelling_ptr = _lookup>( 'clang_getTypeKindSpelling'); - late final _dart_clang_getTypeKindSpelling _clang_getTypeKindSpelling = - _clang_getTypeKindSpelling_ptr - .asFunction<_dart_clang_getTypeKindSpelling>(); + late final _clang_getTypeKindSpelling = + _clang_getTypeKindSpelling_ptr.asFunction(); /// Retrieve the calling convention associated with a function type. /// @@ -3285,9 +3279,8 @@ class LibClang { late final _clang_getFunctionTypeCallingConv_ptr = _lookup>( 'clang_getFunctionTypeCallingConv'); - late final _dart_clang_getFunctionTypeCallingConv - _clang_getFunctionTypeCallingConv = _clang_getFunctionTypeCallingConv_ptr - .asFunction<_dart_clang_getFunctionTypeCallingConv>(); + late final _clang_getFunctionTypeCallingConv = + _clang_getFunctionTypeCallingConv_ptr.asFunction(); /// Retrieve the return type associated with a function type. /// @@ -3303,8 +3296,8 @@ class LibClang { late final _clang_getResultType_ptr = _lookup>( 'clang_getResultType'); - late final _dart_clang_getResultType _clang_getResultType = - _clang_getResultType_ptr.asFunction<_dart_clang_getResultType>(); + late final _clang_getResultType = + _clang_getResultType_ptr.asFunction(); /// Retrieve the exception specification type associated with a function type. /// This is a value of type CXCursor_ExceptionSpecificationKind. @@ -3321,10 +3314,9 @@ class LibClang { late final _clang_getExceptionSpecificationType_ptr = _lookup>( 'clang_getExceptionSpecificationType'); - late final _dart_clang_getExceptionSpecificationType - _clang_getExceptionSpecificationType = + late final _clang_getExceptionSpecificationType = _clang_getExceptionSpecificationType_ptr - .asFunction<_dart_clang_getExceptionSpecificationType>(); + .asFunction(); /// Retrieve the number of non-variadic parameters associated with a /// function type. @@ -3341,8 +3333,8 @@ class LibClang { late final _clang_getNumArgTypes_ptr = _lookup>( 'clang_getNumArgTypes'); - late final _dart_clang_getNumArgTypes _clang_getNumArgTypes = - _clang_getNumArgTypes_ptr.asFunction<_dart_clang_getNumArgTypes>(); + late final _clang_getNumArgTypes = + _clang_getNumArgTypes_ptr.asFunction(); /// Retrieve the type of a parameter of a function type. /// @@ -3360,8 +3352,8 @@ class LibClang { late final _clang_getArgType_ptr = _lookup>('clang_getArgType'); - late final _dart_clang_getArgType _clang_getArgType = - _clang_getArgType_ptr.asFunction<_dart_clang_getArgType>(); + late final _clang_getArgType = + _clang_getArgType_ptr.asFunction(); /// Retrieves the base type of the ObjCObjectType. /// @@ -3377,9 +3369,9 @@ class LibClang { late final _clang_Type_getObjCObjectBaseType_ptr = _lookup>( 'clang_Type_getObjCObjectBaseType'); - late final _dart_clang_Type_getObjCObjectBaseType - _clang_Type_getObjCObjectBaseType = _clang_Type_getObjCObjectBaseType_ptr - .asFunction<_dart_clang_Type_getObjCObjectBaseType>(); + late final _clang_Type_getObjCObjectBaseType = + _clang_Type_getObjCObjectBaseType_ptr + .asFunction(); /// Retrieve the number of protocol references associated with an ObjC object/id. /// @@ -3395,10 +3387,8 @@ class LibClang { late final _clang_Type_getNumObjCProtocolRefs_ptr = _lookup>( 'clang_Type_getNumObjCProtocolRefs'); - late final _dart_clang_Type_getNumObjCProtocolRefs - _clang_Type_getNumObjCProtocolRefs = - _clang_Type_getNumObjCProtocolRefs_ptr - .asFunction<_dart_clang_Type_getNumObjCProtocolRefs>(); + late final _clang_Type_getNumObjCProtocolRefs = + _clang_Type_getNumObjCProtocolRefs_ptr.asFunction(); /// Retrieve the decl for a protocol reference for an ObjC object/id. /// @@ -3417,9 +3407,9 @@ class LibClang { late final _clang_Type_getObjCProtocolDecl_ptr = _lookup>( 'clang_Type_getObjCProtocolDecl'); - late final _dart_clang_Type_getObjCProtocolDecl - _clang_Type_getObjCProtocolDecl = _clang_Type_getObjCProtocolDecl_ptr - .asFunction<_dart_clang_Type_getObjCProtocolDecl>(); + late final _clang_Type_getObjCProtocolDecl = + _clang_Type_getObjCProtocolDecl_ptr + .asFunction(); /// Retreive the number of type arguments associated with an ObjC object. /// @@ -3435,9 +3425,8 @@ class LibClang { late final _clang_Type_getNumObjCTypeArgs_ptr = _lookup>( 'clang_Type_getNumObjCTypeArgs'); - late final _dart_clang_Type_getNumObjCTypeArgs - _clang_Type_getNumObjCTypeArgs = _clang_Type_getNumObjCTypeArgs_ptr - .asFunction<_dart_clang_Type_getNumObjCTypeArgs>(); + late final _clang_Type_getNumObjCTypeArgs = + _clang_Type_getNumObjCTypeArgs_ptr.asFunction(); /// Retrieve a type argument associated with an ObjC object. /// @@ -3456,9 +3445,8 @@ class LibClang { late final _clang_Type_getObjCTypeArg_ptr = _lookup>( 'clang_Type_getObjCTypeArg'); - late final _dart_clang_Type_getObjCTypeArg _clang_Type_getObjCTypeArg = - _clang_Type_getObjCTypeArg_ptr - .asFunction<_dart_clang_Type_getObjCTypeArg>(); + late final _clang_Type_getObjCTypeArg = + _clang_Type_getObjCTypeArg_ptr.asFunction(); /// Return 1 if the CXType is a variadic function type, and 0 otherwise. int clang_isFunctionTypeVariadic( @@ -3472,9 +3460,8 @@ class LibClang { late final _clang_isFunctionTypeVariadic_ptr = _lookup>( 'clang_isFunctionTypeVariadic'); - late final _dart_clang_isFunctionTypeVariadic _clang_isFunctionTypeVariadic = - _clang_isFunctionTypeVariadic_ptr - .asFunction<_dart_clang_isFunctionTypeVariadic>(); + late final _clang_isFunctionTypeVariadic = + _clang_isFunctionTypeVariadic_ptr.asFunction(); /// Retrieve the return type associated with a given cursor. /// @@ -3490,9 +3477,8 @@ class LibClang { late final _clang_getCursorResultType_ptr = _lookup>( 'clang_getCursorResultType'); - late final _dart_clang_getCursorResultType _clang_getCursorResultType = - _clang_getCursorResultType_ptr - .asFunction<_dart_clang_getCursorResultType>(); + late final _clang_getCursorResultType = + _clang_getCursorResultType_ptr.asFunction(); /// Retrieve the exception specification type associated with a given cursor. /// This is a value of type CXCursor_ExceptionSpecificationKind. @@ -3509,10 +3495,9 @@ class LibClang { late final _clang_getCursorExceptionSpecificationType_ptr = _lookup< ffi.NativeFunction>( 'clang_getCursorExceptionSpecificationType'); - late final _dart_clang_getCursorExceptionSpecificationType - _clang_getCursorExceptionSpecificationType = + late final _clang_getCursorExceptionSpecificationType = _clang_getCursorExceptionSpecificationType_ptr - .asFunction<_dart_clang_getCursorExceptionSpecificationType>(); + .asFunction(); /// Return 1 if the CXType is a POD (plain old data) type, and 0 /// otherwise. @@ -3526,8 +3511,8 @@ class LibClang { late final _clang_isPODType_ptr = _lookup>('clang_isPODType'); - late final _dart_clang_isPODType _clang_isPODType = - _clang_isPODType_ptr.asFunction<_dart_clang_isPODType>(); + late final _clang_isPODType = + _clang_isPODType_ptr.asFunction(); /// Return the element type of an array, complex, or vector type. /// @@ -3544,8 +3529,8 @@ class LibClang { late final _clang_getElementType_ptr = _lookup>( 'clang_getElementType'); - late final _dart_clang_getElementType _clang_getElementType = - _clang_getElementType_ptr.asFunction<_dart_clang_getElementType>(); + late final _clang_getElementType = + _clang_getElementType_ptr.asFunction(); /// Return the number of elements of an array or vector type. /// @@ -3562,8 +3547,8 @@ class LibClang { late final _clang_getNumElements_ptr = _lookup>( 'clang_getNumElements'); - late final _dart_clang_getNumElements _clang_getNumElements = - _clang_getNumElements_ptr.asFunction<_dart_clang_getNumElements>(); + late final _clang_getNumElements = + _clang_getNumElements_ptr.asFunction(); /// Return the element type of an array type. /// @@ -3579,9 +3564,8 @@ class LibClang { late final _clang_getArrayElementType_ptr = _lookup>( 'clang_getArrayElementType'); - late final _dart_clang_getArrayElementType _clang_getArrayElementType = - _clang_getArrayElementType_ptr - .asFunction<_dart_clang_getArrayElementType>(); + late final _clang_getArrayElementType = + _clang_getArrayElementType_ptr.asFunction(); /// Return the array size of a constant array. /// @@ -3597,8 +3581,8 @@ class LibClang { late final _clang_getArraySize_ptr = _lookup>( 'clang_getArraySize'); - late final _dart_clang_getArraySize _clang_getArraySize = - _clang_getArraySize_ptr.asFunction<_dart_clang_getArraySize>(); + late final _clang_getArraySize = + _clang_getArraySize_ptr.asFunction(); /// Retrieve the type named by the qualified-id. /// @@ -3614,8 +3598,8 @@ class LibClang { late final _clang_Type_getNamedType_ptr = _lookup>( 'clang_Type_getNamedType'); - late final _dart_clang_Type_getNamedType _clang_Type_getNamedType = - _clang_Type_getNamedType_ptr.asFunction<_dart_clang_Type_getNamedType>(); + late final _clang_Type_getNamedType = + _clang_Type_getNamedType_ptr.asFunction(); /// Determine if a typedef is 'transparent' tag. /// @@ -3634,10 +3618,9 @@ class LibClang { late final _clang_Type_isTransparentTagTypedef_ptr = _lookup>( 'clang_Type_isTransparentTagTypedef'); - late final _dart_clang_Type_isTransparentTagTypedef - _clang_Type_isTransparentTagTypedef = + late final _clang_Type_isTransparentTagTypedef = _clang_Type_isTransparentTagTypedef_ptr - .asFunction<_dart_clang_Type_isTransparentTagTypedef>(); + .asFunction(); /// Retrieve the nullability kind of a pointer type. int clang_Type_getNullability( @@ -3651,9 +3634,8 @@ class LibClang { late final _clang_Type_getNullability_ptr = _lookup>( 'clang_Type_getNullability'); - late final _dart_clang_Type_getNullability _clang_Type_getNullability = - _clang_Type_getNullability_ptr - .asFunction<_dart_clang_Type_getNullability>(); + late final _clang_Type_getNullability = + _clang_Type_getNullability_ptr.asFunction(); /// Return the alignment of a type in bytes as per C++[expr.alignof] /// standard. @@ -3676,8 +3658,8 @@ class LibClang { late final _clang_Type_getAlignOf_ptr = _lookup>( 'clang_Type_getAlignOf'); - late final _dart_clang_Type_getAlignOf _clang_Type_getAlignOf = - _clang_Type_getAlignOf_ptr.asFunction<_dart_clang_Type_getAlignOf>(); + late final _clang_Type_getAlignOf = + _clang_Type_getAlignOf_ptr.asFunction(); /// Return the class type of an member pointer type. /// @@ -3693,8 +3675,8 @@ class LibClang { late final _clang_Type_getClassType_ptr = _lookup>( 'clang_Type_getClassType'); - late final _dart_clang_Type_getClassType _clang_Type_getClassType = - _clang_Type_getClassType_ptr.asFunction<_dart_clang_Type_getClassType>(); + late final _clang_Type_getClassType = + _clang_Type_getClassType_ptr.asFunction(); /// Return the size of a type in bytes as per C++[expr.sizeof] standard. /// @@ -3714,8 +3696,8 @@ class LibClang { late final _clang_Type_getSizeOf_ptr = _lookup>( 'clang_Type_getSizeOf'); - late final _dart_clang_Type_getSizeOf _clang_Type_getSizeOf = - _clang_Type_getSizeOf_ptr.asFunction<_dart_clang_Type_getSizeOf>(); + late final _clang_Type_getSizeOf = + _clang_Type_getSizeOf_ptr.asFunction(); /// 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] @@ -3741,8 +3723,8 @@ class LibClang { late final _clang_Type_getOffsetOf_ptr = _lookup>( 'clang_Type_getOffsetOf'); - late final _dart_clang_Type_getOffsetOf _clang_Type_getOffsetOf = - _clang_Type_getOffsetOf_ptr.asFunction<_dart_clang_Type_getOffsetOf>(); + late final _clang_Type_getOffsetOf = _clang_Type_getOffsetOf_ptr + .asFunction)>(); /// Return the type that was modified by this attributed type. /// @@ -3758,9 +3740,8 @@ class LibClang { late final _clang_Type_getModifiedType_ptr = _lookup>( 'clang_Type_getModifiedType'); - late final _dart_clang_Type_getModifiedType _clang_Type_getModifiedType = - _clang_Type_getModifiedType_ptr - .asFunction<_dart_clang_Type_getModifiedType>(); + late final _clang_Type_getModifiedType = + _clang_Type_getModifiedType_ptr.asFunction(); /// Return the offset of the field represented by the Cursor. /// @@ -3784,9 +3765,8 @@ class LibClang { late final _clang_Cursor_getOffsetOfField_ptr = _lookup>( 'clang_Cursor_getOffsetOfField'); - late final _dart_clang_Cursor_getOffsetOfField - _clang_Cursor_getOffsetOfField = _clang_Cursor_getOffsetOfField_ptr - .asFunction<_dart_clang_Cursor_getOffsetOfField>(); + late final _clang_Cursor_getOffsetOfField = + _clang_Cursor_getOffsetOfField_ptr.asFunction(); /// Determine whether the given cursor represents an anonymous /// tag or namespace @@ -3801,9 +3781,8 @@ class LibClang { late final _clang_Cursor_isAnonymous_ptr = _lookup>( 'clang_Cursor_isAnonymous'); - late final _dart_clang_Cursor_isAnonymous _clang_Cursor_isAnonymous = - _clang_Cursor_isAnonymous_ptr - .asFunction<_dart_clang_Cursor_isAnonymous>(); + late final _clang_Cursor_isAnonymous = + _clang_Cursor_isAnonymous_ptr.asFunction(); /// Determine whether the given cursor represents an anonymous record /// declaration. @@ -3818,10 +3797,9 @@ class LibClang { late final _clang_Cursor_isAnonymousRecordDecl_ptr = _lookup>( 'clang_Cursor_isAnonymousRecordDecl'); - late final _dart_clang_Cursor_isAnonymousRecordDecl - _clang_Cursor_isAnonymousRecordDecl = + late final _clang_Cursor_isAnonymousRecordDecl = _clang_Cursor_isAnonymousRecordDecl_ptr - .asFunction<_dart_clang_Cursor_isAnonymousRecordDecl>(); + .asFunction(); /// Determine whether the given cursor represents an inline namespace /// declaration. @@ -3836,9 +3814,8 @@ class LibClang { late final _clang_Cursor_isInlineNamespace_ptr = _lookup>( 'clang_Cursor_isInlineNamespace'); - late final _dart_clang_Cursor_isInlineNamespace - _clang_Cursor_isInlineNamespace = _clang_Cursor_isInlineNamespace_ptr - .asFunction<_dart_clang_Cursor_isInlineNamespace>(); + late final _clang_Cursor_isInlineNamespace = + _clang_Cursor_isInlineNamespace_ptr.asFunction(); /// Returns the number of template arguments for given template /// specialization, or -1 if type \c T is not a template specialization. @@ -3853,10 +3830,9 @@ class LibClang { late final _clang_Type_getNumTemplateArguments_ptr = _lookup>( 'clang_Type_getNumTemplateArguments'); - late final _dart_clang_Type_getNumTemplateArguments - _clang_Type_getNumTemplateArguments = + late final _clang_Type_getNumTemplateArguments = _clang_Type_getNumTemplateArguments_ptr - .asFunction<_dart_clang_Type_getNumTemplateArguments>(); + .asFunction(); /// Returns the type template argument of a template class specialization /// at given index. @@ -3876,10 +3852,9 @@ class LibClang { late final _clang_Type_getTemplateArgumentAsType_ptr = _lookup>( 'clang_Type_getTemplateArgumentAsType'); - late final _dart_clang_Type_getTemplateArgumentAsType - _clang_Type_getTemplateArgumentAsType = + late final _clang_Type_getTemplateArgumentAsType = _clang_Type_getTemplateArgumentAsType_ptr - .asFunction<_dart_clang_Type_getTemplateArgumentAsType>(); + .asFunction(); /// Retrieve the ref-qualifier kind of a function or method. /// @@ -3896,9 +3871,8 @@ class LibClang { late final _clang_Type_getCXXRefQualifier_ptr = _lookup>( 'clang_Type_getCXXRefQualifier'); - late final _dart_clang_Type_getCXXRefQualifier - _clang_Type_getCXXRefQualifier = _clang_Type_getCXXRefQualifier_ptr - .asFunction<_dart_clang_Type_getCXXRefQualifier>(); + late final _clang_Type_getCXXRefQualifier = + _clang_Type_getCXXRefQualifier_ptr.asFunction(); /// Returns non-zero if the cursor specifies a Record member that is a /// bitfield. @@ -3913,8 +3887,8 @@ class LibClang { late final _clang_Cursor_isBitField_ptr = _lookup>( 'clang_Cursor_isBitField'); - late final _dart_clang_Cursor_isBitField _clang_Cursor_isBitField = - _clang_Cursor_isBitField_ptr.asFunction<_dart_clang_Cursor_isBitField>(); + late final _clang_Cursor_isBitField = + _clang_Cursor_isBitField_ptr.asFunction(); /// Returns 1 if the base class specified by the cursor with kind /// CX_CXXBaseSpecifier is virtual. @@ -3929,8 +3903,8 @@ class LibClang { late final _clang_isVirtualBase_ptr = _lookup>( 'clang_isVirtualBase'); - late final _dart_clang_isVirtualBase _clang_isVirtualBase = - _clang_isVirtualBase_ptr.asFunction<_dart_clang_isVirtualBase>(); + late final _clang_isVirtualBase = + _clang_isVirtualBase_ptr.asFunction(); /// Returns the access control level for the referenced object. /// @@ -3948,9 +3922,8 @@ class LibClang { late final _clang_getCXXAccessSpecifier_ptr = _lookup>( 'clang_getCXXAccessSpecifier'); - late final _dart_clang_getCXXAccessSpecifier _clang_getCXXAccessSpecifier = - _clang_getCXXAccessSpecifier_ptr - .asFunction<_dart_clang_getCXXAccessSpecifier>(); + late final _clang_getCXXAccessSpecifier = + _clang_getCXXAccessSpecifier_ptr.asFunction(); /// Returns the storage class for a function or variable declaration. /// @@ -3967,9 +3940,8 @@ class LibClang { late final _clang_Cursor_getStorageClass_ptr = _lookup>( 'clang_Cursor_getStorageClass'); - late final _dart_clang_Cursor_getStorageClass _clang_Cursor_getStorageClass = - _clang_Cursor_getStorageClass_ptr - .asFunction<_dart_clang_Cursor_getStorageClass>(); + late final _clang_Cursor_getStorageClass = + _clang_Cursor_getStorageClass_ptr.asFunction(); /// Determine the number of overloaded declarations referenced by a /// \c CXCursor_OverloadedDeclRef cursor. @@ -3989,9 +3961,8 @@ class LibClang { late final _clang_getNumOverloadedDecls_ptr = _lookup>( 'clang_getNumOverloadedDecls'); - late final _dart_clang_getNumOverloadedDecls _clang_getNumOverloadedDecls = - _clang_getNumOverloadedDecls_ptr - .asFunction<_dart_clang_getNumOverloadedDecls>(); + late final _clang_getNumOverloadedDecls = + _clang_getNumOverloadedDecls_ptr.asFunction(); /// Retrieve a cursor for one of the overloaded declarations referenced /// by a \c CXCursor_OverloadedDeclRef cursor. @@ -4018,8 +3989,8 @@ class LibClang { late final _clang_getOverloadedDecl_ptr = _lookup>( 'clang_getOverloadedDecl'); - late final _dart_clang_getOverloadedDecl _clang_getOverloadedDecl = - _clang_getOverloadedDecl_ptr.asFunction<_dart_clang_getOverloadedDecl>(); + late final _clang_getOverloadedDecl = _clang_getOverloadedDecl_ptr + .asFunction(); /// For cursors representing an iboutletcollection attribute, /// this function returns the collection element type. @@ -4034,9 +4005,9 @@ class LibClang { late final _clang_getIBOutletCollectionType_ptr = _lookup>( 'clang_getIBOutletCollectionType'); - late final _dart_clang_getIBOutletCollectionType - _clang_getIBOutletCollectionType = _clang_getIBOutletCollectionType_ptr - .asFunction<_dart_clang_getIBOutletCollectionType>(); + late final _clang_getIBOutletCollectionType = + _clang_getIBOutletCollectionType_ptr + .asFunction(); /// Visit the children of a particular cursor. /// @@ -4060,8 +4031,8 @@ class LibClang { /// prematurely by the visitor returning \c CXChildVisit_Break. int clang_visitChildren( CXCursor parent, - ffi.Pointer> visitor, - ffi.Pointer client_data, + CXCursorVisitor visitor, + CXClientData client_data, ) { return _clang_visitChildren( parent, @@ -4073,8 +4044,8 @@ class LibClang { late final _clang_visitChildren_ptr = _lookup>( 'clang_visitChildren'); - late final _dart_clang_visitChildren _clang_visitChildren = - _clang_visitChildren_ptr.asFunction<_dart_clang_visitChildren>(); + late final _clang_visitChildren = _clang_visitChildren_ptr + .asFunction(); /// Retrieve a Unified Symbol Resolution (USR) for the entity referenced /// by the given cursor. @@ -4094,8 +4065,8 @@ class LibClang { late final _clang_getCursorUSR_ptr = _lookup>( 'clang_getCursorUSR'); - late final _dart_clang_getCursorUSR _clang_getCursorUSR = - _clang_getCursorUSR_ptr.asFunction<_dart_clang_getCursorUSR>(); + late final _clang_getCursorUSR = + _clang_getCursorUSR_ptr.asFunction(); /// Construct a USR for a specified Objective-C class. CXString clang_constructUSR_ObjCClass( @@ -4109,9 +4080,8 @@ class LibClang { late final _clang_constructUSR_ObjCClass_ptr = _lookup>( 'clang_constructUSR_ObjCClass'); - late final _dart_clang_constructUSR_ObjCClass _clang_constructUSR_ObjCClass = - _clang_constructUSR_ObjCClass_ptr - .asFunction<_dart_clang_constructUSR_ObjCClass>(); + late final _clang_constructUSR_ObjCClass = _clang_constructUSR_ObjCClass_ptr + .asFunction)>(); /// Construct a USR for a specified Objective-C category. CXString clang_constructUSR_ObjCCategory( @@ -4127,9 +4097,9 @@ class LibClang { late final _clang_constructUSR_ObjCCategory_ptr = _lookup>( 'clang_constructUSR_ObjCCategory'); - late final _dart_clang_constructUSR_ObjCCategory - _clang_constructUSR_ObjCCategory = _clang_constructUSR_ObjCCategory_ptr - .asFunction<_dart_clang_constructUSR_ObjCCategory>(); + late final _clang_constructUSR_ObjCCategory = + _clang_constructUSR_ObjCCategory_ptr.asFunction< + CXString Function(ffi.Pointer, ffi.Pointer)>(); /// Construct a USR for a specified Objective-C protocol. CXString clang_constructUSR_ObjCProtocol( @@ -4143,9 +4113,9 @@ class LibClang { late final _clang_constructUSR_ObjCProtocol_ptr = _lookup>( 'clang_constructUSR_ObjCProtocol'); - late final _dart_clang_constructUSR_ObjCProtocol - _clang_constructUSR_ObjCProtocol = _clang_constructUSR_ObjCProtocol_ptr - .asFunction<_dart_clang_constructUSR_ObjCProtocol>(); + late final _clang_constructUSR_ObjCProtocol = + _clang_constructUSR_ObjCProtocol_ptr + .asFunction)>(); /// Construct a USR for a specified Objective-C instance variable and /// the USR for its containing class. @@ -4162,9 +4132,8 @@ class LibClang { late final _clang_constructUSR_ObjCIvar_ptr = _lookup>( 'clang_constructUSR_ObjCIvar'); - late final _dart_clang_constructUSR_ObjCIvar _clang_constructUSR_ObjCIvar = - _clang_constructUSR_ObjCIvar_ptr - .asFunction<_dart_clang_constructUSR_ObjCIvar>(); + late final _clang_constructUSR_ObjCIvar = _clang_constructUSR_ObjCIvar_ptr + .asFunction, CXString)>(); /// Construct a USR for a specified Objective-C method and /// the USR for its containing class. @@ -4183,9 +4152,8 @@ class LibClang { late final _clang_constructUSR_ObjCMethod_ptr = _lookup>( 'clang_constructUSR_ObjCMethod'); - late final _dart_clang_constructUSR_ObjCMethod - _clang_constructUSR_ObjCMethod = _clang_constructUSR_ObjCMethod_ptr - .asFunction<_dart_clang_constructUSR_ObjCMethod>(); + late final _clang_constructUSR_ObjCMethod = _clang_constructUSR_ObjCMethod_ptr + .asFunction, int, CXString)>(); /// Construct a USR for a specified Objective-C property and the USR /// for its containing class. @@ -4202,9 +4170,9 @@ class LibClang { late final _clang_constructUSR_ObjCProperty_ptr = _lookup>( 'clang_constructUSR_ObjCProperty'); - late final _dart_clang_constructUSR_ObjCProperty - _clang_constructUSR_ObjCProperty = _clang_constructUSR_ObjCProperty_ptr - .asFunction<_dart_clang_constructUSR_ObjCProperty>(); + late final _clang_constructUSR_ObjCProperty = + _clang_constructUSR_ObjCProperty_ptr + .asFunction, CXString)>(); /// Retrieve a name for the entity referenced by this cursor. CXString clang_getCursorSpelling( @@ -4218,8 +4186,8 @@ class LibClang { late final _clang_getCursorSpelling_ptr = _lookup>( 'clang_getCursorSpelling'); - late final _dart_clang_getCursorSpelling _clang_getCursorSpelling = - _clang_getCursorSpelling_ptr.asFunction<_dart_clang_getCursorSpelling>(); + late final _clang_getCursorSpelling = + _clang_getCursorSpelling_ptr.asFunction(); /// 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 @@ -4245,14 +4213,13 @@ class LibClang { late final _clang_Cursor_getSpellingNameRange_ptr = _lookup>( 'clang_Cursor_getSpellingNameRange'); - late final _dart_clang_Cursor_getSpellingNameRange - _clang_Cursor_getSpellingNameRange = + late final _clang_Cursor_getSpellingNameRange = _clang_Cursor_getSpellingNameRange_ptr - .asFunction<_dart_clang_Cursor_getSpellingNameRange>(); + .asFunction(); /// Get a property value for the given printing policy. int clang_PrintingPolicy_getProperty( - ffi.Pointer Policy, + CXPrintingPolicy Policy, int Property, ) { return _clang_PrintingPolicy_getProperty( @@ -4264,13 +4231,13 @@ class LibClang { late final _clang_PrintingPolicy_getProperty_ptr = _lookup>( 'clang_PrintingPolicy_getProperty'); - late final _dart_clang_PrintingPolicy_getProperty - _clang_PrintingPolicy_getProperty = _clang_PrintingPolicy_getProperty_ptr - .asFunction<_dart_clang_PrintingPolicy_getProperty>(); + late final _clang_PrintingPolicy_getProperty = + _clang_PrintingPolicy_getProperty_ptr + .asFunction(); /// Set a property value for the given printing policy. void clang_PrintingPolicy_setProperty( - ffi.Pointer Policy, + CXPrintingPolicy Policy, int Property, int Value, ) { @@ -4284,15 +4251,15 @@ class LibClang { late final _clang_PrintingPolicy_setProperty_ptr = _lookup>( 'clang_PrintingPolicy_setProperty'); - late final _dart_clang_PrintingPolicy_setProperty - _clang_PrintingPolicy_setProperty = _clang_PrintingPolicy_setProperty_ptr - .asFunction<_dart_clang_PrintingPolicy_setProperty>(); + late final _clang_PrintingPolicy_setProperty = + _clang_PrintingPolicy_setProperty_ptr + .asFunction(); /// Retrieve the default policy for the cursor. /// /// The policy should be released after use with \c /// clang_PrintingPolicy_dispose. - ffi.Pointer clang_getCursorPrintingPolicy( + CXPrintingPolicy clang_getCursorPrintingPolicy( CXCursor arg0, ) { return _clang_getCursorPrintingPolicy( @@ -4303,13 +4270,12 @@ class LibClang { late final _clang_getCursorPrintingPolicy_ptr = _lookup>( 'clang_getCursorPrintingPolicy'); - late final _dart_clang_getCursorPrintingPolicy - _clang_getCursorPrintingPolicy = _clang_getCursorPrintingPolicy_ptr - .asFunction<_dart_clang_getCursorPrintingPolicy>(); + late final _clang_getCursorPrintingPolicy = _clang_getCursorPrintingPolicy_ptr + .asFunction(); /// Release a printing policy. void clang_PrintingPolicy_dispose( - ffi.Pointer Policy, + CXPrintingPolicy Policy, ) { return _clang_PrintingPolicy_dispose( Policy, @@ -4319,9 +4285,8 @@ class LibClang { late final _clang_PrintingPolicy_dispose_ptr = _lookup>( 'clang_PrintingPolicy_dispose'); - late final _dart_clang_PrintingPolicy_dispose _clang_PrintingPolicy_dispose = - _clang_PrintingPolicy_dispose_ptr - .asFunction<_dart_clang_PrintingPolicy_dispose>(); + late final _clang_PrintingPolicy_dispose = _clang_PrintingPolicy_dispose_ptr + .asFunction(); /// Pretty print declarations. /// @@ -4334,7 +4299,7 @@ class LibClang { /// other cursors. CXString clang_getCursorPrettyPrinted( CXCursor Cursor, - ffi.Pointer Policy, + CXPrintingPolicy Policy, ) { return _clang_getCursorPrettyPrinted( Cursor, @@ -4345,9 +4310,8 @@ class LibClang { late final _clang_getCursorPrettyPrinted_ptr = _lookup>( 'clang_getCursorPrettyPrinted'); - late final _dart_clang_getCursorPrettyPrinted _clang_getCursorPrettyPrinted = - _clang_getCursorPrettyPrinted_ptr - .asFunction<_dart_clang_getCursorPrettyPrinted>(); + late final _clang_getCursorPrettyPrinted = _clang_getCursorPrettyPrinted_ptr + .asFunction(); /// Retrieve the display name for the entity referenced by this cursor. /// @@ -4365,9 +4329,8 @@ class LibClang { late final _clang_getCursorDisplayName_ptr = _lookup>( 'clang_getCursorDisplayName'); - late final _dart_clang_getCursorDisplayName _clang_getCursorDisplayName = - _clang_getCursorDisplayName_ptr - .asFunction<_dart_clang_getCursorDisplayName>(); + late final _clang_getCursorDisplayName = + _clang_getCursorDisplayName_ptr.asFunction(); /// For a cursor that is a reference, retrieve a cursor representing the /// entity that it references. @@ -4389,9 +4352,8 @@ class LibClang { late final _clang_getCursorReferenced_ptr = _lookup>( 'clang_getCursorReferenced'); - late final _dart_clang_getCursorReferenced _clang_getCursorReferenced = - _clang_getCursorReferenced_ptr - .asFunction<_dart_clang_getCursorReferenced>(); + late final _clang_getCursorReferenced = + _clang_getCursorReferenced_ptr.asFunction(); /// For a cursor that is either a reference to or a declaration /// of some entity, retrieve a cursor that describes the definition of @@ -4430,9 +4392,8 @@ class LibClang { late final _clang_getCursorDefinition_ptr = _lookup>( 'clang_getCursorDefinition'); - late final _dart_clang_getCursorDefinition _clang_getCursorDefinition = - _clang_getCursorDefinition_ptr - .asFunction<_dart_clang_getCursorDefinition>(); + late final _clang_getCursorDefinition = + _clang_getCursorDefinition_ptr.asFunction(); /// Determine whether the declaration pointed to by this cursor /// is also a definition of that entity. @@ -4447,9 +4408,8 @@ class LibClang { late final _clang_isCursorDefinition_ptr = _lookup>( 'clang_isCursorDefinition'); - late final _dart_clang_isCursorDefinition _clang_isCursorDefinition = - _clang_isCursorDefinition_ptr - .asFunction<_dart_clang_isCursorDefinition>(); + late final _clang_isCursorDefinition = + _clang_isCursorDefinition_ptr.asFunction(); /// Retrieve the canonical cursor corresponding to the given cursor. /// @@ -4484,9 +4444,8 @@ class LibClang { late final _clang_getCanonicalCursor_ptr = _lookup>( 'clang_getCanonicalCursor'); - late final _dart_clang_getCanonicalCursor _clang_getCanonicalCursor = - _clang_getCanonicalCursor_ptr - .asFunction<_dart_clang_getCanonicalCursor>(); + late final _clang_getCanonicalCursor = + _clang_getCanonicalCursor_ptr.asFunction(); /// If the cursor points to a selector identifier in an Objective-C /// method or message expression, this returns the selector index. @@ -4508,10 +4467,9 @@ class LibClang { late final _clang_Cursor_getObjCSelectorIndex_ptr = _lookup>( 'clang_Cursor_getObjCSelectorIndex'); - late final _dart_clang_Cursor_getObjCSelectorIndex - _clang_Cursor_getObjCSelectorIndex = + late final _clang_Cursor_getObjCSelectorIndex = _clang_Cursor_getObjCSelectorIndex_ptr - .asFunction<_dart_clang_Cursor_getObjCSelectorIndex>(); + .asFunction(); /// Given a cursor pointing to a C++ method call or an Objective-C /// message, returns non-zero if the method/message is "dynamic", meaning: @@ -4533,9 +4491,8 @@ class LibClang { late final _clang_Cursor_isDynamicCall_ptr = _lookup>( 'clang_Cursor_isDynamicCall'); - late final _dart_clang_Cursor_isDynamicCall _clang_Cursor_isDynamicCall = - _clang_Cursor_isDynamicCall_ptr - .asFunction<_dart_clang_Cursor_isDynamicCall>(); + late final _clang_Cursor_isDynamicCall = + _clang_Cursor_isDynamicCall_ptr.asFunction(); /// Given a cursor pointing to an Objective-C message or property /// reference, or C++ method call, returns the CXType of the receiver. @@ -4550,9 +4507,8 @@ class LibClang { late final _clang_Cursor_getReceiverType_ptr = _lookup>( 'clang_Cursor_getReceiverType'); - late final _dart_clang_Cursor_getReceiverType _clang_Cursor_getReceiverType = - _clang_Cursor_getReceiverType_ptr - .asFunction<_dart_clang_Cursor_getReceiverType>(); + late final _clang_Cursor_getReceiverType = + _clang_Cursor_getReceiverType_ptr.asFunction(); /// Given a cursor that represents a property declaration, return the /// associated property attributes. The bits are formed from @@ -4572,10 +4528,9 @@ class LibClang { late final _clang_Cursor_getObjCPropertyAttributes_ptr = _lookup< ffi.NativeFunction>( 'clang_Cursor_getObjCPropertyAttributes'); - late final _dart_clang_Cursor_getObjCPropertyAttributes - _clang_Cursor_getObjCPropertyAttributes = + late final _clang_Cursor_getObjCPropertyAttributes = _clang_Cursor_getObjCPropertyAttributes_ptr - .asFunction<_dart_clang_Cursor_getObjCPropertyAttributes>(); + .asFunction(); /// Given a cursor that represents a property declaration, return the /// name of the method that implements the getter. @@ -4590,10 +4545,9 @@ class LibClang { late final _clang_Cursor_getObjCPropertyGetterName_ptr = _lookup< ffi.NativeFunction>( 'clang_Cursor_getObjCPropertyGetterName'); - late final _dart_clang_Cursor_getObjCPropertyGetterName - _clang_Cursor_getObjCPropertyGetterName = + late final _clang_Cursor_getObjCPropertyGetterName = _clang_Cursor_getObjCPropertyGetterName_ptr - .asFunction<_dart_clang_Cursor_getObjCPropertyGetterName>(); + .asFunction(); /// Given a cursor that represents a property declaration, return the /// name of the method that implements the setter, if any. @@ -4608,10 +4562,9 @@ class LibClang { late final _clang_Cursor_getObjCPropertySetterName_ptr = _lookup< ffi.NativeFunction>( 'clang_Cursor_getObjCPropertySetterName'); - late final _dart_clang_Cursor_getObjCPropertySetterName - _clang_Cursor_getObjCPropertySetterName = + late final _clang_Cursor_getObjCPropertySetterName = _clang_Cursor_getObjCPropertySetterName_ptr - .asFunction<_dart_clang_Cursor_getObjCPropertySetterName>(); + .asFunction(); /// Given a cursor that represents an Objective-C method or parameter /// declaration, return the associated Objective-C qualifiers for the return @@ -4628,10 +4581,9 @@ class LibClang { late final _clang_Cursor_getObjCDeclQualifiers_ptr = _lookup>( 'clang_Cursor_getObjCDeclQualifiers'); - late final _dart_clang_Cursor_getObjCDeclQualifiers - _clang_Cursor_getObjCDeclQualifiers = + late final _clang_Cursor_getObjCDeclQualifiers = _clang_Cursor_getObjCDeclQualifiers_ptr - .asFunction<_dart_clang_Cursor_getObjCDeclQualifiers>(); + .asFunction(); /// Given a cursor that represents an Objective-C method or property /// declaration, return non-zero if the declaration was affected by "\@optional". @@ -4647,9 +4599,8 @@ class LibClang { late final _clang_Cursor_isObjCOptional_ptr = _lookup>( 'clang_Cursor_isObjCOptional'); - late final _dart_clang_Cursor_isObjCOptional _clang_Cursor_isObjCOptional = - _clang_Cursor_isObjCOptional_ptr - .asFunction<_dart_clang_Cursor_isObjCOptional>(); + late final _clang_Cursor_isObjCOptional = + _clang_Cursor_isObjCOptional_ptr.asFunction(); /// Returns non-zero if the given cursor is a variadic function or method. int clang_Cursor_isVariadic( @@ -4663,8 +4614,8 @@ class LibClang { late final _clang_Cursor_isVariadic_ptr = _lookup>( 'clang_Cursor_isVariadic'); - late final _dart_clang_Cursor_isVariadic _clang_Cursor_isVariadic = - _clang_Cursor_isVariadic_ptr.asFunction<_dart_clang_Cursor_isVariadic>(); + late final _clang_Cursor_isVariadic = + _clang_Cursor_isVariadic_ptr.asFunction(); /// Returns non-zero if the given cursor points to a symbol marked with /// external_source_symbol attribute. @@ -4694,9 +4645,10 @@ class LibClang { late final _clang_Cursor_isExternalSymbol_ptr = _lookup>( 'clang_Cursor_isExternalSymbol'); - late final _dart_clang_Cursor_isExternalSymbol - _clang_Cursor_isExternalSymbol = _clang_Cursor_isExternalSymbol_ptr - .asFunction<_dart_clang_Cursor_isExternalSymbol>(); + late final _clang_Cursor_isExternalSymbol = + _clang_Cursor_isExternalSymbol_ptr.asFunction< + int Function(CXCursor, ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Given a cursor that represents a declaration, return the associated /// comment's source range. The range may include multiple consecutive comments @@ -4712,9 +4664,8 @@ class LibClang { late final _clang_Cursor_getCommentRange_ptr = _lookup>( 'clang_Cursor_getCommentRange'); - late final _dart_clang_Cursor_getCommentRange _clang_Cursor_getCommentRange = - _clang_Cursor_getCommentRange_ptr - .asFunction<_dart_clang_Cursor_getCommentRange>(); + late final _clang_Cursor_getCommentRange = _clang_Cursor_getCommentRange_ptr + .asFunction(); /// Given a cursor that represents a declaration, return the associated /// comment text, including comment markers. @@ -4729,9 +4680,9 @@ class LibClang { late final _clang_Cursor_getRawCommentText_ptr = _lookup>( 'clang_Cursor_getRawCommentText'); - late final _dart_clang_Cursor_getRawCommentText - _clang_Cursor_getRawCommentText = _clang_Cursor_getRawCommentText_ptr - .asFunction<_dart_clang_Cursor_getRawCommentText>(); + late final _clang_Cursor_getRawCommentText = + _clang_Cursor_getRawCommentText_ptr + .asFunction(); /// Given a cursor that represents a documentable entity (e.g., /// declaration), return the associated \paragraph; otherwise return the @@ -4747,9 +4698,9 @@ class LibClang { late final _clang_Cursor_getBriefCommentText_ptr = _lookup>( 'clang_Cursor_getBriefCommentText'); - late final _dart_clang_Cursor_getBriefCommentText - _clang_Cursor_getBriefCommentText = _clang_Cursor_getBriefCommentText_ptr - .asFunction<_dart_clang_Cursor_getBriefCommentText>(); + late final _clang_Cursor_getBriefCommentText = + _clang_Cursor_getBriefCommentText_ptr + .asFunction(); /// Retrieve the CXString representing the mangled name of the cursor. CXString clang_Cursor_getMangling( @@ -4763,9 +4714,8 @@ class LibClang { late final _clang_Cursor_getMangling_ptr = _lookup>( 'clang_Cursor_getMangling'); - late final _dart_clang_Cursor_getMangling _clang_Cursor_getMangling = - _clang_Cursor_getMangling_ptr - .asFunction<_dart_clang_Cursor_getMangling>(); + late final _clang_Cursor_getMangling = + _clang_Cursor_getMangling_ptr.asFunction(); /// Retrieve the CXStrings representing the mangled symbols of the C++ /// constructor or destructor at the cursor. @@ -4780,9 +4730,8 @@ class LibClang { late final _clang_Cursor_getCXXManglings_ptr = _lookup>( 'clang_Cursor_getCXXManglings'); - late final _dart_clang_Cursor_getCXXManglings _clang_Cursor_getCXXManglings = - _clang_Cursor_getCXXManglings_ptr - .asFunction<_dart_clang_Cursor_getCXXManglings>(); + late final _clang_Cursor_getCXXManglings = _clang_Cursor_getCXXManglings_ptr + .asFunction Function(CXCursor)>(); /// Retrieve the CXStrings representing the mangled symbols of the ObjC /// class interface or implementation at the cursor. @@ -4797,12 +4746,11 @@ class LibClang { late final _clang_Cursor_getObjCManglings_ptr = _lookup>( 'clang_Cursor_getObjCManglings'); - late final _dart_clang_Cursor_getObjCManglings - _clang_Cursor_getObjCManglings = _clang_Cursor_getObjCManglings_ptr - .asFunction<_dart_clang_Cursor_getObjCManglings>(); + late final _clang_Cursor_getObjCManglings = _clang_Cursor_getObjCManglings_ptr + .asFunction Function(CXCursor)>(); /// Given a CXCursor_ModuleImportDecl cursor, return the associated module. - ffi.Pointer clang_Cursor_getModule( + CXModule clang_Cursor_getModule( CXCursor C, ) { return _clang_Cursor_getModule( @@ -4813,14 +4761,14 @@ class LibClang { late final _clang_Cursor_getModule_ptr = _lookup>( 'clang_Cursor_getModule'); - late final _dart_clang_Cursor_getModule _clang_Cursor_getModule = - _clang_Cursor_getModule_ptr.asFunction<_dart_clang_Cursor_getModule>(); + late final _clang_Cursor_getModule = + _clang_Cursor_getModule_ptr.asFunction(); /// Given a CXFile header file, return the module that contains it, if one /// exists. - ffi.Pointer clang_getModuleForFile( - ffi.Pointer arg0, - ffi.Pointer arg1, + CXModule clang_getModuleForFile( + CXTranslationUnit arg0, + CXFile arg1, ) { return _clang_getModuleForFile( arg0, @@ -4831,14 +4779,14 @@ class LibClang { late final _clang_getModuleForFile_ptr = _lookup>( 'clang_getModuleForFile'); - late final _dart_clang_getModuleForFile _clang_getModuleForFile = - _clang_getModuleForFile_ptr.asFunction<_dart_clang_getModuleForFile>(); + late final _clang_getModuleForFile = _clang_getModuleForFile_ptr + .asFunction(); /// \param Module a module object. /// /// \returns the module file where the provided module object came from. - ffi.Pointer clang_Module_getASTFile( - ffi.Pointer Module, + CXFile clang_Module_getASTFile( + CXModule Module, ) { return _clang_Module_getASTFile( Module, @@ -4848,15 +4796,15 @@ class LibClang { late final _clang_Module_getASTFile_ptr = _lookup>( 'clang_Module_getASTFile'); - late final _dart_clang_Module_getASTFile _clang_Module_getASTFile = - _clang_Module_getASTFile_ptr.asFunction<_dart_clang_Module_getASTFile>(); + late final _clang_Module_getASTFile = + _clang_Module_getASTFile_ptr.asFunction(); /// \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, + CXModule clang_Module_getParent( + CXModule Module, ) { return _clang_Module_getParent( Module, @@ -4866,15 +4814,15 @@ class LibClang { late final _clang_Module_getParent_ptr = _lookup>( 'clang_Module_getParent'); - late final _dart_clang_Module_getParent _clang_Module_getParent = - _clang_Module_getParent_ptr.asFunction<_dart_clang_Module_getParent>(); + late final _clang_Module_getParent = + _clang_Module_getParent_ptr.asFunction(); /// \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, + CXModule Module, ) { return _clang_Module_getName( Module, @@ -4884,14 +4832,14 @@ class LibClang { late final _clang_Module_getName_ptr = _lookup>( 'clang_Module_getName'); - late final _dart_clang_Module_getName _clang_Module_getName = - _clang_Module_getName_ptr.asFunction<_dart_clang_Module_getName>(); + late final _clang_Module_getName = + _clang_Module_getName_ptr.asFunction(); /// \param Module a module object. /// /// \returns the full name of the module, e.g. "std.vector". CXString clang_Module_getFullName( - ffi.Pointer Module, + CXModule Module, ) { return _clang_Module_getFullName( Module, @@ -4901,15 +4849,14 @@ class LibClang { late final _clang_Module_getFullName_ptr = _lookup>( 'clang_Module_getFullName'); - late final _dart_clang_Module_getFullName _clang_Module_getFullName = - _clang_Module_getFullName_ptr - .asFunction<_dart_clang_Module_getFullName>(); + late final _clang_Module_getFullName = + _clang_Module_getFullName_ptr.asFunction(); /// \param Module a module object. /// /// \returns non-zero if the module is a system one. int clang_Module_isSystem( - ffi.Pointer Module, + CXModule Module, ) { return _clang_Module_isSystem( Module, @@ -4919,15 +4866,15 @@ class LibClang { late final _clang_Module_isSystem_ptr = _lookup>( 'clang_Module_isSystem'); - late final _dart_clang_Module_isSystem _clang_Module_isSystem = - _clang_Module_isSystem_ptr.asFunction<_dart_clang_Module_isSystem>(); + late final _clang_Module_isSystem = + _clang_Module_isSystem_ptr.asFunction(); /// \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, + CXTranslationUnit arg0, + CXModule Module, ) { return _clang_Module_getNumTopLevelHeaders( arg0, @@ -4938,19 +4885,18 @@ class LibClang { late final _clang_Module_getNumTopLevelHeaders_ptr = _lookup>( 'clang_Module_getNumTopLevelHeaders'); - late final _dart_clang_Module_getNumTopLevelHeaders - _clang_Module_getNumTopLevelHeaders = + late final _clang_Module_getNumTopLevelHeaders = _clang_Module_getNumTopLevelHeaders_ptr - .asFunction<_dart_clang_Module_getNumTopLevelHeaders>(); + .asFunction(); /// \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, + CXFile clang_Module_getTopLevelHeader( + CXTranslationUnit arg0, + CXModule Module, int Index, ) { return _clang_Module_getTopLevelHeader( @@ -4963,9 +4909,9 @@ class LibClang { late final _clang_Module_getTopLevelHeader_ptr = _lookup>( 'clang_Module_getTopLevelHeader'); - late final _dart_clang_Module_getTopLevelHeader - _clang_Module_getTopLevelHeader = _clang_Module_getTopLevelHeader_ptr - .asFunction<_dart_clang_Module_getTopLevelHeader>(); + late final _clang_Module_getTopLevelHeader = + _clang_Module_getTopLevelHeader_ptr + .asFunction(); /// Determine if a C++ constructor is a converting constructor. int clang_CXXConstructor_isConvertingConstructor( @@ -4980,10 +4926,9 @@ class LibClang { ffi.NativeFunction< Native_clang_CXXConstructor_isConvertingConstructor>>( 'clang_CXXConstructor_isConvertingConstructor'); - late final _dart_clang_CXXConstructor_isConvertingConstructor - _clang_CXXConstructor_isConvertingConstructor = + late final _clang_CXXConstructor_isConvertingConstructor = _clang_CXXConstructor_isConvertingConstructor_ptr - .asFunction<_dart_clang_CXXConstructor_isConvertingConstructor>(); + .asFunction(); /// Determine if a C++ constructor is a copy constructor. int clang_CXXConstructor_isCopyConstructor( @@ -4997,10 +4942,9 @@ class LibClang { late final _clang_CXXConstructor_isCopyConstructor_ptr = _lookup< ffi.NativeFunction>( 'clang_CXXConstructor_isCopyConstructor'); - late final _dart_clang_CXXConstructor_isCopyConstructor - _clang_CXXConstructor_isCopyConstructor = + late final _clang_CXXConstructor_isCopyConstructor = _clang_CXXConstructor_isCopyConstructor_ptr - .asFunction<_dart_clang_CXXConstructor_isCopyConstructor>(); + .asFunction(); /// Determine if a C++ constructor is the default constructor. int clang_CXXConstructor_isDefaultConstructor( @@ -5014,10 +4958,9 @@ class LibClang { late final _clang_CXXConstructor_isDefaultConstructor_ptr = _lookup< ffi.NativeFunction>( 'clang_CXXConstructor_isDefaultConstructor'); - late final _dart_clang_CXXConstructor_isDefaultConstructor - _clang_CXXConstructor_isDefaultConstructor = + late final _clang_CXXConstructor_isDefaultConstructor = _clang_CXXConstructor_isDefaultConstructor_ptr - .asFunction<_dart_clang_CXXConstructor_isDefaultConstructor>(); + .asFunction(); /// Determine if a C++ constructor is a move constructor. int clang_CXXConstructor_isMoveConstructor( @@ -5031,10 +4974,9 @@ class LibClang { late final _clang_CXXConstructor_isMoveConstructor_ptr = _lookup< ffi.NativeFunction>( 'clang_CXXConstructor_isMoveConstructor'); - late final _dart_clang_CXXConstructor_isMoveConstructor - _clang_CXXConstructor_isMoveConstructor = + late final _clang_CXXConstructor_isMoveConstructor = _clang_CXXConstructor_isMoveConstructor_ptr - .asFunction<_dart_clang_CXXConstructor_isMoveConstructor>(); + .asFunction(); /// Determine if a C++ field is declared 'mutable'. int clang_CXXField_isMutable( @@ -5048,9 +4990,8 @@ class LibClang { late final _clang_CXXField_isMutable_ptr = _lookup>( 'clang_CXXField_isMutable'); - late final _dart_clang_CXXField_isMutable _clang_CXXField_isMutable = - _clang_CXXField_isMutable_ptr - .asFunction<_dart_clang_CXXField_isMutable>(); + late final _clang_CXXField_isMutable = + _clang_CXXField_isMutable_ptr.asFunction(); /// Determine if a C++ method is declared '= default'. int clang_CXXMethod_isDefaulted( @@ -5064,9 +5005,8 @@ class LibClang { late final _clang_CXXMethod_isDefaulted_ptr = _lookup>( 'clang_CXXMethod_isDefaulted'); - late final _dart_clang_CXXMethod_isDefaulted _clang_CXXMethod_isDefaulted = - _clang_CXXMethod_isDefaulted_ptr - .asFunction<_dart_clang_CXXMethod_isDefaulted>(); + late final _clang_CXXMethod_isDefaulted = + _clang_CXXMethod_isDefaulted_ptr.asFunction(); /// Determine if a C++ member function or member function template is /// pure virtual. @@ -5081,9 +5021,8 @@ class LibClang { late final _clang_CXXMethod_isPureVirtual_ptr = _lookup>( 'clang_CXXMethod_isPureVirtual'); - late final _dart_clang_CXXMethod_isPureVirtual - _clang_CXXMethod_isPureVirtual = _clang_CXXMethod_isPureVirtual_ptr - .asFunction<_dart_clang_CXXMethod_isPureVirtual>(); + late final _clang_CXXMethod_isPureVirtual = + _clang_CXXMethod_isPureVirtual_ptr.asFunction(); /// Determine if a C++ member function or member function template is /// declared 'static'. @@ -5098,9 +5037,8 @@ class LibClang { late final _clang_CXXMethod_isStatic_ptr = _lookup>( 'clang_CXXMethod_isStatic'); - late final _dart_clang_CXXMethod_isStatic _clang_CXXMethod_isStatic = - _clang_CXXMethod_isStatic_ptr - .asFunction<_dart_clang_CXXMethod_isStatic>(); + late final _clang_CXXMethod_isStatic = + _clang_CXXMethod_isStatic_ptr.asFunction(); /// Determine if a C++ member function or member function template is /// explicitly declared 'virtual' or if it overrides a virtual method from @@ -5116,9 +5054,8 @@ class LibClang { late final _clang_CXXMethod_isVirtual_ptr = _lookup>( 'clang_CXXMethod_isVirtual'); - late final _dart_clang_CXXMethod_isVirtual _clang_CXXMethod_isVirtual = - _clang_CXXMethod_isVirtual_ptr - .asFunction<_dart_clang_CXXMethod_isVirtual>(); + late final _clang_CXXMethod_isVirtual = + _clang_CXXMethod_isVirtual_ptr.asFunction(); /// Determine if a C++ record is abstract, i.e. whether a class or struct /// has a pure virtual member function. @@ -5133,9 +5070,8 @@ class LibClang { late final _clang_CXXRecord_isAbstract_ptr = _lookup>( 'clang_CXXRecord_isAbstract'); - late final _dart_clang_CXXRecord_isAbstract _clang_CXXRecord_isAbstract = - _clang_CXXRecord_isAbstract_ptr - .asFunction<_dart_clang_CXXRecord_isAbstract>(); + late final _clang_CXXRecord_isAbstract = + _clang_CXXRecord_isAbstract_ptr.asFunction(); /// Determine if an enum declaration refers to a scoped enum. int clang_EnumDecl_isScoped( @@ -5149,8 +5085,8 @@ class LibClang { late final _clang_EnumDecl_isScoped_ptr = _lookup>( 'clang_EnumDecl_isScoped'); - late final _dart_clang_EnumDecl_isScoped _clang_EnumDecl_isScoped = - _clang_EnumDecl_isScoped_ptr.asFunction<_dart_clang_EnumDecl_isScoped>(); + late final _clang_EnumDecl_isScoped = + _clang_EnumDecl_isScoped_ptr.asFunction(); /// Determine if a C++ member function or member function template is /// declared 'const'. @@ -5165,8 +5101,8 @@ class LibClang { late final _clang_CXXMethod_isConst_ptr = _lookup>( 'clang_CXXMethod_isConst'); - late final _dart_clang_CXXMethod_isConst _clang_CXXMethod_isConst = - _clang_CXXMethod_isConst_ptr.asFunction<_dart_clang_CXXMethod_isConst>(); + late final _clang_CXXMethod_isConst = + _clang_CXXMethod_isConst_ptr.asFunction(); /// Given a cursor that represents a template, determine /// the cursor kind of the specializations would be generated by instantiating @@ -5194,9 +5130,8 @@ class LibClang { late final _clang_getTemplateCursorKind_ptr = _lookup>( 'clang_getTemplateCursorKind'); - late final _dart_clang_getTemplateCursorKind _clang_getTemplateCursorKind = - _clang_getTemplateCursorKind_ptr - .asFunction<_dart_clang_getTemplateCursorKind>(); + late final _clang_getTemplateCursorKind = + _clang_getTemplateCursorKind_ptr.asFunction(); /// Given a cursor that may represent a specialization or instantiation /// of a template, retrieve the cursor that represents the template that it @@ -5235,10 +5170,9 @@ class LibClang { late final _clang_getSpecializedCursorTemplate_ptr = _lookup>( 'clang_getSpecializedCursorTemplate'); - late final _dart_clang_getSpecializedCursorTemplate - _clang_getSpecializedCursorTemplate = + late final _clang_getSpecializedCursorTemplate = _clang_getSpecializedCursorTemplate_ptr - .asFunction<_dart_clang_getSpecializedCursorTemplate>(); + .asFunction(); /// Given a cursor that references something else, return the source range /// covering that reference. @@ -5271,10 +5205,9 @@ class LibClang { late final _clang_getCursorReferenceNameRange_ptr = _lookup>( 'clang_getCursorReferenceNameRange'); - late final _dart_clang_getCursorReferenceNameRange - _clang_getCursorReferenceNameRange = + late final _clang_getCursorReferenceNameRange = _clang_getCursorReferenceNameRange_ptr - .asFunction<_dart_clang_getCursorReferenceNameRange>(); + .asFunction(); /// Get the raw lexical token starting with the given location. /// @@ -5286,7 +5219,7 @@ class LibClang { /// exist. The returned pointer must be freed with clang_disposeTokens before the /// translation unit is destroyed. ffi.Pointer clang_getToken( - ffi.Pointer TU, + CXTranslationUnit TU, CXSourceLocation Location, ) { return _clang_getToken( @@ -5297,8 +5230,8 @@ class LibClang { late final _clang_getToken_ptr = _lookup>('clang_getToken'); - late final _dart_clang_getToken _clang_getToken = - _clang_getToken_ptr.asFunction<_dart_clang_getToken>(); + late final _clang_getToken = _clang_getToken_ptr.asFunction< + ffi.Pointer Function(CXTranslationUnit, CXSourceLocation)>(); /// Determine the kind of the given token. int clang_getTokenKind( @@ -5312,15 +5245,15 @@ class LibClang { late final _clang_getTokenKind_ptr = _lookup>( 'clang_getTokenKind'); - late final _dart_clang_getTokenKind _clang_getTokenKind = - _clang_getTokenKind_ptr.asFunction<_dart_clang_getTokenKind>(); + late final _clang_getTokenKind = + _clang_getTokenKind_ptr.asFunction(); /// 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, + CXTranslationUnit arg0, CXToken arg1, ) { return _clang_getTokenSpelling( @@ -5332,12 +5265,12 @@ class LibClang { late final _clang_getTokenSpelling_ptr = _lookup>( 'clang_getTokenSpelling'); - late final _dart_clang_getTokenSpelling _clang_getTokenSpelling = - _clang_getTokenSpelling_ptr.asFunction<_dart_clang_getTokenSpelling>(); + late final _clang_getTokenSpelling = _clang_getTokenSpelling_ptr + .asFunction(); /// Retrieve the source location of the given token. CXSourceLocation clang_getTokenLocation( - ffi.Pointer arg0, + CXTranslationUnit arg0, CXToken arg1, ) { return _clang_getTokenLocation( @@ -5349,12 +5282,12 @@ class LibClang { late final _clang_getTokenLocation_ptr = _lookup>( 'clang_getTokenLocation'); - late final _dart_clang_getTokenLocation _clang_getTokenLocation = - _clang_getTokenLocation_ptr.asFunction<_dart_clang_getTokenLocation>(); + late final _clang_getTokenLocation = _clang_getTokenLocation_ptr + .asFunction(); /// Retrieve a source range that covers the given token. CXSourceRange clang_getTokenExtent( - ffi.Pointer arg0, + CXTranslationUnit arg0, CXToken arg1, ) { return _clang_getTokenExtent( @@ -5366,8 +5299,8 @@ class LibClang { late final _clang_getTokenExtent_ptr = _lookup>( 'clang_getTokenExtent'); - late final _dart_clang_getTokenExtent _clang_getTokenExtent = - _clang_getTokenExtent_ptr.asFunction<_dart_clang_getTokenExtent>(); + late final _clang_getTokenExtent = _clang_getTokenExtent_ptr + .asFunction(); /// Tokenize the source code described by the given range into raw /// lexical tokens. @@ -5384,7 +5317,7 @@ class LibClang { /// \param NumTokens will be set to the number of tokens in the \c *Tokens /// array. void clang_tokenize( - ffi.Pointer TU, + CXTranslationUnit TU, CXSourceRange Range, ffi.Pointer> Tokens, ffi.Pointer NumTokens, @@ -5399,8 +5332,9 @@ class LibClang { late final _clang_tokenize_ptr = _lookup>('clang_tokenize'); - late final _dart_clang_tokenize _clang_tokenize = - _clang_tokenize_ptr.asFunction<_dart_clang_tokenize>(); + late final _clang_tokenize = _clang_tokenize_ptr.asFunction< + void Function(CXTranslationUnit, CXSourceRange, + ffi.Pointer>, ffi.Pointer)>(); /// 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. @@ -5431,7 +5365,7 @@ class LibClang { /// \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, + CXTranslationUnit TU, ffi.Pointer Tokens, int NumTokens, ffi.Pointer Cursors, @@ -5447,12 +5381,13 @@ class LibClang { late final _clang_annotateTokens_ptr = _lookup>( 'clang_annotateTokens'); - late final _dart_clang_annotateTokens _clang_annotateTokens = - _clang_annotateTokens_ptr.asFunction<_dart_clang_annotateTokens>(); + late final _clang_annotateTokens = _clang_annotateTokens_ptr.asFunction< + void Function(CXTranslationUnit, ffi.Pointer, int, + ffi.Pointer)>(); /// Free the given set of tokens. void clang_disposeTokens( - ffi.Pointer TU, + CXTranslationUnit TU, ffi.Pointer Tokens, int NumTokens, ) { @@ -5466,8 +5401,8 @@ class LibClang { late final _clang_disposeTokens_ptr = _lookup>( 'clang_disposeTokens'); - late final _dart_clang_disposeTokens _clang_disposeTokens = - _clang_disposeTokens_ptr.asFunction<_dart_clang_disposeTokens>(); + late final _clang_disposeTokens = _clang_disposeTokens_ptr.asFunction< + void Function(CXTranslationUnit, ffi.Pointer, int)>(); /// \defgroup CINDEX_DEBUG Debugging facilities /// @@ -5486,9 +5421,8 @@ class LibClang { late final _clang_getCursorKindSpelling_ptr = _lookup>( 'clang_getCursorKindSpelling'); - late final _dart_clang_getCursorKindSpelling _clang_getCursorKindSpelling = - _clang_getCursorKindSpelling_ptr - .asFunction<_dart_clang_getCursorKindSpelling>(); + late final _clang_getCursorKindSpelling = + _clang_getCursorKindSpelling_ptr.asFunction(); void clang_getDefinitionSpellingAndExtent( CXCursor arg0, @@ -5513,10 +5447,16 @@ class LibClang { late final _clang_getDefinitionSpellingAndExtent_ptr = _lookup>( 'clang_getDefinitionSpellingAndExtent'); - late final _dart_clang_getDefinitionSpellingAndExtent - _clang_getDefinitionSpellingAndExtent = - _clang_getDefinitionSpellingAndExtent_ptr - .asFunction<_dart_clang_getDefinitionSpellingAndExtent>(); + late final _clang_getDefinitionSpellingAndExtent = + _clang_getDefinitionSpellingAndExtent_ptr.asFunction< + void Function( + CXCursor, + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); void clang_enableStackTraces() { return _clang_enableStackTraces(); @@ -5525,11 +5465,12 @@ class LibClang { late final _clang_enableStackTraces_ptr = _lookup>( 'clang_enableStackTraces'); - late final _dart_clang_enableStackTraces _clang_enableStackTraces = - _clang_enableStackTraces_ptr.asFunction<_dart_clang_enableStackTraces>(); + late final _clang_enableStackTraces = + _clang_enableStackTraces_ptr.asFunction(); void clang_executeOnThread( - ffi.Pointer> fn, + ffi.Pointer)>> + fn, ffi.Pointer user_data, int stack_size, ) { @@ -5543,8 +5484,12 @@ class LibClang { late final _clang_executeOnThread_ptr = _lookup>( 'clang_executeOnThread'); - late final _dart_clang_executeOnThread _clang_executeOnThread = - _clang_executeOnThread_ptr.asFunction<_dart_clang_executeOnThread>(); + late final _clang_executeOnThread = _clang_executeOnThread_ptr.asFunction< + void Function( + ffi.Pointer< + ffi.NativeFunction)>>, + ffi.Pointer, + int)>(); /// Determine the kind of a particular chunk within a completion string. /// @@ -5554,7 +5499,7 @@ class LibClang { /// /// \returns the kind of the chunk at the index \c chunk_number. int clang_getCompletionChunkKind( - ffi.Pointer completion_string, + CXCompletionString completion_string, int chunk_number, ) { return _clang_getCompletionChunkKind( @@ -5566,9 +5511,8 @@ class LibClang { late final _clang_getCompletionChunkKind_ptr = _lookup>( 'clang_getCompletionChunkKind'); - late final _dart_clang_getCompletionChunkKind _clang_getCompletionChunkKind = - _clang_getCompletionChunkKind_ptr - .asFunction<_dart_clang_getCompletionChunkKind>(); + late final _clang_getCompletionChunkKind = _clang_getCompletionChunkKind_ptr + .asFunction(); /// Retrieve the text associated with a particular chunk within a /// completion string. @@ -5579,7 +5523,7 @@ class LibClang { /// /// \returns the text associated with the chunk at index \c chunk_number. CXString clang_getCompletionChunkText( - ffi.Pointer completion_string, + CXCompletionString completion_string, int chunk_number, ) { return _clang_getCompletionChunkText( @@ -5591,9 +5535,8 @@ class LibClang { late final _clang_getCompletionChunkText_ptr = _lookup>( 'clang_getCompletionChunkText'); - late final _dart_clang_getCompletionChunkText _clang_getCompletionChunkText = - _clang_getCompletionChunkText_ptr - .asFunction<_dart_clang_getCompletionChunkText>(); + late final _clang_getCompletionChunkText = _clang_getCompletionChunkText_ptr + .asFunction(); /// Retrieve the completion string associated with a particular chunk /// within a completion string. @@ -5604,8 +5547,8 @@ class LibClang { /// /// \returns the completion string associated with the chunk at index /// \c chunk_number. - ffi.Pointer clang_getCompletionChunkCompletionString( - ffi.Pointer completion_string, + CXCompletionString clang_getCompletionChunkCompletionString( + CXCompletionString completion_string, int chunk_number, ) { return _clang_getCompletionChunkCompletionString( @@ -5617,14 +5560,13 @@ class LibClang { late final _clang_getCompletionChunkCompletionString_ptr = _lookup< ffi.NativeFunction>( 'clang_getCompletionChunkCompletionString'); - late final _dart_clang_getCompletionChunkCompletionString - _clang_getCompletionChunkCompletionString = + late final _clang_getCompletionChunkCompletionString = _clang_getCompletionChunkCompletionString_ptr - .asFunction<_dart_clang_getCompletionChunkCompletionString>(); + .asFunction(); /// Retrieve the number of chunks in the given code-completion string. int clang_getNumCompletionChunks( - ffi.Pointer completion_string, + CXCompletionString completion_string, ) { return _clang_getNumCompletionChunks( completion_string, @@ -5634,9 +5576,8 @@ class LibClang { late final _clang_getNumCompletionChunks_ptr = _lookup>( 'clang_getNumCompletionChunks'); - late final _dart_clang_getNumCompletionChunks _clang_getNumCompletionChunks = - _clang_getNumCompletionChunks_ptr - .asFunction<_dart_clang_getNumCompletionChunks>(); + late final _clang_getNumCompletionChunks = _clang_getNumCompletionChunks_ptr + .asFunction(); /// Determine the priority of this code completion. /// @@ -5649,7 +5590,7 @@ class LibClang { /// \returns The priority of this completion string. Smaller values indicate /// higher-priority (more likely) completions. int clang_getCompletionPriority( - ffi.Pointer completion_string, + CXCompletionString completion_string, ) { return _clang_getCompletionPriority( completion_string, @@ -5659,9 +5600,8 @@ class LibClang { late final _clang_getCompletionPriority_ptr = _lookup>( 'clang_getCompletionPriority'); - late final _dart_clang_getCompletionPriority _clang_getCompletionPriority = - _clang_getCompletionPriority_ptr - .asFunction<_dart_clang_getCompletionPriority>(); + late final _clang_getCompletionPriority = _clang_getCompletionPriority_ptr + .asFunction(); /// Determine the availability of the entity that this code-completion /// string refers to. @@ -5670,7 +5610,7 @@ class LibClang { /// /// \returns The availability of the completion string. int clang_getCompletionAvailability( - ffi.Pointer completion_string, + CXCompletionString completion_string, ) { return _clang_getCompletionAvailability( completion_string, @@ -5680,9 +5620,9 @@ class LibClang { late final _clang_getCompletionAvailability_ptr = _lookup>( 'clang_getCompletionAvailability'); - late final _dart_clang_getCompletionAvailability - _clang_getCompletionAvailability = _clang_getCompletionAvailability_ptr - .asFunction<_dart_clang_getCompletionAvailability>(); + late final _clang_getCompletionAvailability = + _clang_getCompletionAvailability_ptr + .asFunction(); /// Retrieve the number of annotations associated with the given /// completion string. @@ -5692,7 +5632,7 @@ class LibClang { /// \returns the number of annotations associated with the given completion /// string. int clang_getCompletionNumAnnotations( - ffi.Pointer completion_string, + CXCompletionString completion_string, ) { return _clang_getCompletionNumAnnotations( completion_string, @@ -5702,10 +5642,9 @@ class LibClang { late final _clang_getCompletionNumAnnotations_ptr = _lookup>( 'clang_getCompletionNumAnnotations'); - late final _dart_clang_getCompletionNumAnnotations - _clang_getCompletionNumAnnotations = + late final _clang_getCompletionNumAnnotations = _clang_getCompletionNumAnnotations_ptr - .asFunction<_dart_clang_getCompletionNumAnnotations>(); + .asFunction(); /// Retrieve the annotation associated with the given completion string. /// @@ -5717,7 +5656,7 @@ class LibClang { /// \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, + CXCompletionString completion_string, int annotation_number, ) { return _clang_getCompletionAnnotation( @@ -5729,9 +5668,8 @@ class LibClang { late final _clang_getCompletionAnnotation_ptr = _lookup>( 'clang_getCompletionAnnotation'); - late final _dart_clang_getCompletionAnnotation - _clang_getCompletionAnnotation = _clang_getCompletionAnnotation_ptr - .asFunction<_dart_clang_getCompletionAnnotation>(); + late final _clang_getCompletionAnnotation = _clang_getCompletionAnnotation_ptr + .asFunction(); /// Retrieve the parent context of the given completion string. /// @@ -5748,7 +5686,7 @@ class LibClang { /// \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, + CXCompletionString completion_string, ffi.Pointer kind, ) { return _clang_getCompletionParent( @@ -5760,14 +5698,14 @@ class LibClang { late final _clang_getCompletionParent_ptr = _lookup>( 'clang_getCompletionParent'); - late final _dart_clang_getCompletionParent _clang_getCompletionParent = - _clang_getCompletionParent_ptr - .asFunction<_dart_clang_getCompletionParent>(); + late final _clang_getCompletionParent = + _clang_getCompletionParent_ptr.asFunction< + CXString Function(CXCompletionString, ffi.Pointer)>(); /// Retrieve the brief documentation comment attached to the declaration /// that corresponds to the given completion string. CXString clang_getCompletionBriefComment( - ffi.Pointer completion_string, + CXCompletionString completion_string, ) { return _clang_getCompletionBriefComment( completion_string, @@ -5777,9 +5715,9 @@ class LibClang { late final _clang_getCompletionBriefComment_ptr = _lookup>( 'clang_getCompletionBriefComment'); - late final _dart_clang_getCompletionBriefComment - _clang_getCompletionBriefComment = _clang_getCompletionBriefComment_ptr - .asFunction<_dart_clang_getCompletionBriefComment>(); + late final _clang_getCompletionBriefComment = + _clang_getCompletionBriefComment_ptr + .asFunction(); /// Retrieve a completion string for an arbitrary declaration or macro /// definition cursor. @@ -5788,7 +5726,7 @@ class LibClang { /// /// \returns A non-context-sensitive completion string for declaration and macro /// definition cursors, or NULL for other kinds of cursors. - ffi.Pointer clang_getCursorCompletionString( + CXCompletionString clang_getCursorCompletionString( CXCursor cursor, ) { return _clang_getCursorCompletionString( @@ -5799,9 +5737,9 @@ class LibClang { late final _clang_getCursorCompletionString_ptr = _lookup>( 'clang_getCursorCompletionString'); - late final _dart_clang_getCursorCompletionString - _clang_getCursorCompletionString = _clang_getCursorCompletionString_ptr - .asFunction<_dart_clang_getCursorCompletionString>(); + late final _clang_getCursorCompletionString = + _clang_getCursorCompletionString_ptr + .asFunction(); /// Retrieve the number of fix-its for the given completion index. /// @@ -5827,9 +5765,8 @@ class LibClang { late final _clang_getCompletionNumFixIts_ptr = _lookup>( 'clang_getCompletionNumFixIts'); - late final _dart_clang_getCompletionNumFixIts _clang_getCompletionNumFixIts = - _clang_getCompletionNumFixIts_ptr - .asFunction<_dart_clang_getCompletionNumFixIts>(); + late final _clang_getCompletionNumFixIts = _clang_getCompletionNumFixIts_ptr + .asFunction, int)>(); /// Fix-its that *must* be applied before inserting the text for the /// corresponding completion. @@ -5889,9 +5826,10 @@ class LibClang { late final _clang_getCompletionFixIt_ptr = _lookup>( 'clang_getCompletionFixIt'); - late final _dart_clang_getCompletionFixIt _clang_getCompletionFixIt = - _clang_getCompletionFixIt_ptr - .asFunction<_dart_clang_getCompletionFixIt>(); + late final _clang_getCompletionFixIt = + _clang_getCompletionFixIt_ptr.asFunction< + CXString Function(ffi.Pointer, int, int, + ffi.Pointer)>(); /// Returns a default set of code-completion options that can be /// passed to\c clang_codeCompleteAt(). @@ -5902,9 +5840,8 @@ class LibClang { late final _clang_defaultCodeCompleteOptions_ptr = _lookup>( 'clang_defaultCodeCompleteOptions'); - late final _dart_clang_defaultCodeCompleteOptions - _clang_defaultCodeCompleteOptions = _clang_defaultCodeCompleteOptions_ptr - .asFunction<_dart_clang_defaultCodeCompleteOptions>(); + late final _clang_defaultCodeCompleteOptions = + _clang_defaultCodeCompleteOptions_ptr.asFunction(); /// Perform code completion at a given location in a translation unit. /// @@ -5973,7 +5910,7 @@ class LibClang { /// freed with \c clang_disposeCodeCompleteResults(). If code /// completion fails, returns NULL. ffi.Pointer clang_codeCompleteAt( - ffi.Pointer TU, + CXTranslationUnit TU, ffi.Pointer complete_filename, int complete_line, int complete_column, @@ -5995,8 +5932,15 @@ class LibClang { late final _clang_codeCompleteAt_ptr = _lookup>( 'clang_codeCompleteAt'); - late final _dart_clang_codeCompleteAt _clang_codeCompleteAt = - _clang_codeCompleteAt_ptr.asFunction<_dart_clang_codeCompleteAt>(); + late final _clang_codeCompleteAt = _clang_codeCompleteAt_ptr.asFunction< + ffi.Pointer Function( + CXTranslationUnit, + ffi.Pointer, + int, + int, + ffi.Pointer, + int, + int)>(); /// Sort the code-completion results in case-insensitive alphabetical /// order. @@ -6016,9 +5960,9 @@ class LibClang { late final _clang_sortCodeCompletionResults_ptr = _lookup>( 'clang_sortCodeCompletionResults'); - late final _dart_clang_sortCodeCompletionResults - _clang_sortCodeCompletionResults = _clang_sortCodeCompletionResults_ptr - .asFunction<_dart_clang_sortCodeCompletionResults>(); + late final _clang_sortCodeCompletionResults = + _clang_sortCodeCompletionResults_ptr + .asFunction, int)>(); /// Free the given set of code-completion results. void clang_disposeCodeCompleteResults( @@ -6032,9 +5976,9 @@ class LibClang { late final _clang_disposeCodeCompleteResults_ptr = _lookup>( 'clang_disposeCodeCompleteResults'); - late final _dart_clang_disposeCodeCompleteResults - _clang_disposeCodeCompleteResults = _clang_disposeCodeCompleteResults_ptr - .asFunction<_dart_clang_disposeCodeCompleteResults>(); + late final _clang_disposeCodeCompleteResults = + _clang_disposeCodeCompleteResults_ptr + .asFunction)>(); /// Determine the number of diagnostics produced prior to the /// location where code completion was performed. @@ -6049,10 +5993,9 @@ class LibClang { late final _clang_codeCompleteGetNumDiagnostics_ptr = _lookup>( 'clang_codeCompleteGetNumDiagnostics'); - late final _dart_clang_codeCompleteGetNumDiagnostics - _clang_codeCompleteGetNumDiagnostics = + late final _clang_codeCompleteGetNumDiagnostics = _clang_codeCompleteGetNumDiagnostics_ptr - .asFunction<_dart_clang_codeCompleteGetNumDiagnostics>(); + .asFunction)>(); /// Retrieve a diagnostic associated with the given code completion. /// @@ -6061,7 +6004,7 @@ class LibClang { /// /// \returns the requested diagnostic. This diagnostic must be freed /// via a call to \c clang_disposeDiagnostic(). - ffi.Pointer clang_codeCompleteGetDiagnostic( + CXDiagnostic clang_codeCompleteGetDiagnostic( ffi.Pointer Results, int Index, ) { @@ -6074,9 +6017,9 @@ class LibClang { late final _clang_codeCompleteGetDiagnostic_ptr = _lookup>( 'clang_codeCompleteGetDiagnostic'); - late final _dart_clang_codeCompleteGetDiagnostic - _clang_codeCompleteGetDiagnostic = _clang_codeCompleteGetDiagnostic_ptr - .asFunction<_dart_clang_codeCompleteGetDiagnostic>(); + late final _clang_codeCompleteGetDiagnostic = + _clang_codeCompleteGetDiagnostic_ptr.asFunction< + CXDiagnostic Function(ffi.Pointer, int)>(); /// Determines what completions are appropriate for the context /// the given code completion. @@ -6096,9 +6039,8 @@ class LibClang { late final _clang_codeCompleteGetContexts_ptr = _lookup>( 'clang_codeCompleteGetContexts'); - late final _dart_clang_codeCompleteGetContexts - _clang_codeCompleteGetContexts = _clang_codeCompleteGetContexts_ptr - .asFunction<_dart_clang_codeCompleteGetContexts>(); + late final _clang_codeCompleteGetContexts = _clang_codeCompleteGetContexts_ptr + .asFunction)>(); /// Returns the cursor kind for the container for the current code /// completion context. The container is only guaranteed to be set for @@ -6127,10 +6069,10 @@ class LibClang { late final _clang_codeCompleteGetContainerKind_ptr = _lookup>( 'clang_codeCompleteGetContainerKind'); - late final _dart_clang_codeCompleteGetContainerKind - _clang_codeCompleteGetContainerKind = - _clang_codeCompleteGetContainerKind_ptr - .asFunction<_dart_clang_codeCompleteGetContainerKind>(); + late final _clang_codeCompleteGetContainerKind = + _clang_codeCompleteGetContainerKind_ptr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); /// Returns the USR for the container for the current code completion /// context. If there is not a container for the current context, this @@ -6150,10 +6092,9 @@ class LibClang { late final _clang_codeCompleteGetContainerUSR_ptr = _lookup>( 'clang_codeCompleteGetContainerUSR'); - late final _dart_clang_codeCompleteGetContainerUSR - _clang_codeCompleteGetContainerUSR = + late final _clang_codeCompleteGetContainerUSR = _clang_codeCompleteGetContainerUSR_ptr - .asFunction<_dart_clang_codeCompleteGetContainerUSR>(); + .asFunction)>(); /// Returns the currently-entered selector for an Objective-C message /// send, formatted like "initWithFoo:bar:". Only guaranteed to return a @@ -6175,10 +6116,9 @@ class LibClang { late final _clang_codeCompleteGetObjCSelector_ptr = _lookup>( 'clang_codeCompleteGetObjCSelector'); - late final _dart_clang_codeCompleteGetObjCSelector - _clang_codeCompleteGetObjCSelector = + late final _clang_codeCompleteGetObjCSelector = _clang_codeCompleteGetObjCSelector_ptr - .asFunction<_dart_clang_codeCompleteGetObjCSelector>(); + .asFunction)>(); /// Return a version string, suitable for showing to a user, but not /// intended to be parsed (the format is not guaranteed to be stable). @@ -6189,8 +6129,8 @@ class LibClang { late final _clang_getClangVersion_ptr = _lookup>( 'clang_getClangVersion'); - late final _dart_clang_getClangVersion _clang_getClangVersion = - _clang_getClangVersion_ptr.asFunction<_dart_clang_getClangVersion>(); + late final _clang_getClangVersion = + _clang_getClangVersion_ptr.asFunction(); /// Enable/disable crash recovery. /// @@ -6207,18 +6147,17 @@ class LibClang { late final _clang_toggleCrashRecovery_ptr = _lookup>( 'clang_toggleCrashRecovery'); - late final _dart_clang_toggleCrashRecovery _clang_toggleCrashRecovery = - _clang_toggleCrashRecovery_ptr - .asFunction<_dart_clang_toggleCrashRecovery>(); + late final _clang_toggleCrashRecovery = + _clang_toggleCrashRecovery_ptr.asFunction(); /// 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, + CXTranslationUnit tu, + CXInclusionVisitor visitor, + CXClientData client_data, ) { return _clang_getInclusions( tu, @@ -6230,13 +6169,13 @@ class LibClang { late final _clang_getInclusions_ptr = _lookup>( 'clang_getInclusions'); - late final _dart_clang_getInclusions _clang_getInclusions = - _clang_getInclusions_ptr.asFunction<_dart_clang_getInclusions>(); + late final _clang_getInclusions = _clang_getInclusions_ptr.asFunction< + void Function(CXTranslationUnit, CXInclusionVisitor, CXClientData)>(); /// 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( + CXEvalResult clang_Cursor_Evaluate( CXCursor C, ) { return _clang_Cursor_Evaluate( @@ -6247,12 +6186,12 @@ class LibClang { late final _clang_Cursor_Evaluate_ptr = _lookup>( 'clang_Cursor_Evaluate'); - late final _dart_clang_Cursor_Evaluate _clang_Cursor_Evaluate = - _clang_Cursor_Evaluate_ptr.asFunction<_dart_clang_Cursor_Evaluate>(); + late final _clang_Cursor_Evaluate = + _clang_Cursor_Evaluate_ptr.asFunction(); /// Returns the kind of the evaluated result. int clang_EvalResult_getKind( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getKind( E, @@ -6262,14 +6201,13 @@ class LibClang { late final _clang_EvalResult_getKind_ptr = _lookup>( 'clang_EvalResult_getKind'); - late final _dart_clang_EvalResult_getKind _clang_EvalResult_getKind = - _clang_EvalResult_getKind_ptr - .asFunction<_dart_clang_EvalResult_getKind>(); + late final _clang_EvalResult_getKind = + _clang_EvalResult_getKind_ptr.asFunction(); /// Returns the evaluation result as integer if the /// kind is Int. int clang_EvalResult_getAsInt( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getAsInt( E, @@ -6279,15 +6217,14 @@ class LibClang { late final _clang_EvalResult_getAsInt_ptr = _lookup>( 'clang_EvalResult_getAsInt'); - late final _dart_clang_EvalResult_getAsInt _clang_EvalResult_getAsInt = - _clang_EvalResult_getAsInt_ptr - .asFunction<_dart_clang_EvalResult_getAsInt>(); + late final _clang_EvalResult_getAsInt = + _clang_EvalResult_getAsInt_ptr.asFunction(); /// 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, + CXEvalResult E, ) { return _clang_EvalResult_getAsLongLong( E, @@ -6297,14 +6234,14 @@ class LibClang { late final _clang_EvalResult_getAsLongLong_ptr = _lookup>( 'clang_EvalResult_getAsLongLong'); - late final _dart_clang_EvalResult_getAsLongLong - _clang_EvalResult_getAsLongLong = _clang_EvalResult_getAsLongLong_ptr - .asFunction<_dart_clang_EvalResult_getAsLongLong>(); + late final _clang_EvalResult_getAsLongLong = + _clang_EvalResult_getAsLongLong_ptr + .asFunction(); /// 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, + CXEvalResult E, ) { return _clang_EvalResult_isUnsignedInt( E, @@ -6314,14 +6251,14 @@ class LibClang { late final _clang_EvalResult_isUnsignedInt_ptr = _lookup>( 'clang_EvalResult_isUnsignedInt'); - late final _dart_clang_EvalResult_isUnsignedInt - _clang_EvalResult_isUnsignedInt = _clang_EvalResult_isUnsignedInt_ptr - .asFunction<_dart_clang_EvalResult_isUnsignedInt>(); + late final _clang_EvalResult_isUnsignedInt = + _clang_EvalResult_isUnsignedInt_ptr + .asFunction(); /// 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, + CXEvalResult E, ) { return _clang_EvalResult_getAsUnsigned( E, @@ -6331,14 +6268,14 @@ class LibClang { late final _clang_EvalResult_getAsUnsigned_ptr = _lookup>( 'clang_EvalResult_getAsUnsigned'); - late final _dart_clang_EvalResult_getAsUnsigned - _clang_EvalResult_getAsUnsigned = _clang_EvalResult_getAsUnsigned_ptr - .asFunction<_dart_clang_EvalResult_getAsUnsigned>(); + late final _clang_EvalResult_getAsUnsigned = + _clang_EvalResult_getAsUnsigned_ptr + .asFunction(); /// Returns the evaluation result as double if the /// kind is double. double clang_EvalResult_getAsDouble( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getAsDouble( E, @@ -6348,16 +6285,15 @@ class LibClang { late final _clang_EvalResult_getAsDouble_ptr = _lookup>( 'clang_EvalResult_getAsDouble'); - late final _dart_clang_EvalResult_getAsDouble _clang_EvalResult_getAsDouble = - _clang_EvalResult_getAsDouble_ptr - .asFunction<_dart_clang_EvalResult_getAsDouble>(); + late final _clang_EvalResult_getAsDouble = _clang_EvalResult_getAsDouble_ptr + .asFunction(); /// 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, + CXEvalResult E, ) { return _clang_EvalResult_getAsStr( E, @@ -6367,13 +6303,12 @@ class LibClang { late final _clang_EvalResult_getAsStr_ptr = _lookup>( 'clang_EvalResult_getAsStr'); - late final _dart_clang_EvalResult_getAsStr _clang_EvalResult_getAsStr = - _clang_EvalResult_getAsStr_ptr - .asFunction<_dart_clang_EvalResult_getAsStr>(); + late final _clang_EvalResult_getAsStr = _clang_EvalResult_getAsStr_ptr + .asFunction Function(CXEvalResult)>(); /// Disposes the created Eval memory. void clang_EvalResult_dispose( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_dispose( E, @@ -6383,9 +6318,8 @@ class LibClang { late final _clang_EvalResult_dispose_ptr = _lookup>( 'clang_EvalResult_dispose'); - late final _dart_clang_EvalResult_dispose _clang_EvalResult_dispose = - _clang_EvalResult_dispose_ptr - .asFunction<_dart_clang_EvalResult_dispose>(); + late final _clang_EvalResult_dispose = + _clang_EvalResult_dispose_ptr.asFunction(); /// Retrieve a remapping. /// @@ -6393,7 +6327,7 @@ class LibClang { /// /// \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( + CXRemapping clang_getRemappings( ffi.Pointer path, ) { return _clang_getRemappings( @@ -6404,8 +6338,8 @@ class LibClang { late final _clang_getRemappings_ptr = _lookup>( 'clang_getRemappings'); - late final _dart_clang_getRemappings _clang_getRemappings = - _clang_getRemappings_ptr.asFunction<_dart_clang_getRemappings>(); + late final _clang_getRemappings = _clang_getRemappings_ptr + .asFunction)>(); /// Retrieve a remapping. /// @@ -6415,7 +6349,7 @@ class LibClang { /// /// \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( + CXRemapping clang_getRemappingsFromFileList( ffi.Pointer> filePaths, int numFiles, ) { @@ -6428,13 +6362,13 @@ class LibClang { late final _clang_getRemappingsFromFileList_ptr = _lookup>( 'clang_getRemappingsFromFileList'); - late final _dart_clang_getRemappingsFromFileList - _clang_getRemappingsFromFileList = _clang_getRemappingsFromFileList_ptr - .asFunction<_dart_clang_getRemappingsFromFileList>(); + late final _clang_getRemappingsFromFileList = + _clang_getRemappingsFromFileList_ptr.asFunction< + CXRemapping Function(ffi.Pointer>, int)>(); /// Determine the number of remappings. int clang_remap_getNumFiles( - ffi.Pointer arg0, + CXRemapping arg0, ) { return _clang_remap_getNumFiles( arg0, @@ -6444,8 +6378,8 @@ class LibClang { late final _clang_remap_getNumFiles_ptr = _lookup>( 'clang_remap_getNumFiles'); - late final _dart_clang_remap_getNumFiles _clang_remap_getNumFiles = - _clang_remap_getNumFiles_ptr.asFunction<_dart_clang_remap_getNumFiles>(); + late final _clang_remap_getNumFiles = + _clang_remap_getNumFiles_ptr.asFunction(); /// Get the original and the associated filename from the remapping. /// @@ -6454,7 +6388,7 @@ class LibClang { /// \param transformed If non-NULL, will be set to the filename that the original /// is associated with. void clang_remap_getFilenames( - ffi.Pointer arg0, + CXRemapping arg0, int index, ffi.Pointer original, ffi.Pointer transformed, @@ -6470,13 +6404,14 @@ class LibClang { late final _clang_remap_getFilenames_ptr = _lookup>( 'clang_remap_getFilenames'); - late final _dart_clang_remap_getFilenames _clang_remap_getFilenames = - _clang_remap_getFilenames_ptr - .asFunction<_dart_clang_remap_getFilenames>(); + late final _clang_remap_getFilenames = + _clang_remap_getFilenames_ptr.asFunction< + void Function(CXRemapping, int, ffi.Pointer, + ffi.Pointer)>(); /// Dispose the remapping. void clang_remap_dispose( - ffi.Pointer arg0, + CXRemapping arg0, ) { return _clang_remap_dispose( arg0, @@ -6486,8 +6421,8 @@ class LibClang { late final _clang_remap_dispose_ptr = _lookup>( 'clang_remap_dispose'); - late final _dart_clang_remap_dispose _clang_remap_dispose = - _clang_remap_dispose_ptr.asFunction<_dart_clang_remap_dispose>(); + late final _clang_remap_dispose = + _clang_remap_dispose_ptr.asFunction(); /// Find references of a declaration in a specific file. /// @@ -6503,7 +6438,7 @@ class LibClang { /// \returns one of the CXResult enumerators. int clang_findReferencesInFile( CXCursor cursor, - ffi.Pointer file, + CXFile file, CXCursorAndRangeVisitor visitor, ) { return _clang_findReferencesInFile( @@ -6516,9 +6451,8 @@ class LibClang { late final _clang_findReferencesInFile_ptr = _lookup>( 'clang_findReferencesInFile'); - late final _dart_clang_findReferencesInFile _clang_findReferencesInFile = - _clang_findReferencesInFile_ptr - .asFunction<_dart_clang_findReferencesInFile>(); + late final _clang_findReferencesInFile = _clang_findReferencesInFile_ptr + .asFunction(); /// Find #import/#include directives in a specific file. /// @@ -6531,8 +6465,8 @@ class LibClang { /// /// \returns one of the CXResult enumerators. int clang_findIncludesInFile( - ffi.Pointer TU, - ffi.Pointer file, + CXTranslationUnit TU, + CXFile file, CXCursorAndRangeVisitor visitor, ) { return _clang_findIncludesInFile( @@ -6545,9 +6479,9 @@ class LibClang { late final _clang_findIncludesInFile_ptr = _lookup>( 'clang_findIncludesInFile'); - late final _dart_clang_findIncludesInFile _clang_findIncludesInFile = - _clang_findIncludesInFile_ptr - .asFunction<_dart_clang_findIncludesInFile>(); + late final _clang_findIncludesInFile = + _clang_findIncludesInFile_ptr.asFunction< + int Function(CXTranslationUnit, CXFile, CXCursorAndRangeVisitor)>(); int clang_index_isEntityObjCContainerKind( int arg0, @@ -6560,10 +6494,9 @@ class LibClang { late final _clang_index_isEntityObjCContainerKind_ptr = _lookup>( 'clang_index_isEntityObjCContainerKind'); - late final _dart_clang_index_isEntityObjCContainerKind - _clang_index_isEntityObjCContainerKind = + late final _clang_index_isEntityObjCContainerKind = _clang_index_isEntityObjCContainerKind_ptr - .asFunction<_dart_clang_index_isEntityObjCContainerKind>(); + .asFunction(); ffi.Pointer clang_index_getObjCContainerDeclInfo( ffi.Pointer arg0, @@ -6576,10 +6509,10 @@ class LibClang { late final _clang_index_getObjCContainerDeclInfo_ptr = _lookup>( 'clang_index_getObjCContainerDeclInfo'); - late final _dart_clang_index_getObjCContainerDeclInfo - _clang_index_getObjCContainerDeclInfo = - _clang_index_getObjCContainerDeclInfo_ptr - .asFunction<_dart_clang_index_getObjCContainerDeclInfo>(); + late final _clang_index_getObjCContainerDeclInfo = + _clang_index_getObjCContainerDeclInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getObjCInterfaceDeclInfo( ffi.Pointer arg0, @@ -6592,10 +6525,10 @@ class LibClang { late final _clang_index_getObjCInterfaceDeclInfo_ptr = _lookup>( 'clang_index_getObjCInterfaceDeclInfo'); - late final _dart_clang_index_getObjCInterfaceDeclInfo - _clang_index_getObjCInterfaceDeclInfo = - _clang_index_getObjCInterfaceDeclInfo_ptr - .asFunction<_dart_clang_index_getObjCInterfaceDeclInfo>(); + late final _clang_index_getObjCInterfaceDeclInfo = + _clang_index_getObjCInterfaceDeclInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getObjCCategoryDeclInfo( ffi.Pointer arg0, @@ -6608,10 +6541,10 @@ class LibClang { late final _clang_index_getObjCCategoryDeclInfo_ptr = _lookup>( 'clang_index_getObjCCategoryDeclInfo'); - late final _dart_clang_index_getObjCCategoryDeclInfo - _clang_index_getObjCCategoryDeclInfo = - _clang_index_getObjCCategoryDeclInfo_ptr - .asFunction<_dart_clang_index_getObjCCategoryDeclInfo>(); + late final _clang_index_getObjCCategoryDeclInfo = + _clang_index_getObjCCategoryDeclInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getObjCProtocolRefListInfo( @@ -6625,10 +6558,10 @@ class LibClang { late final _clang_index_getObjCProtocolRefListInfo_ptr = _lookup< ffi.NativeFunction>( 'clang_index_getObjCProtocolRefListInfo'); - late final _dart_clang_index_getObjCProtocolRefListInfo - _clang_index_getObjCProtocolRefListInfo = - _clang_index_getObjCProtocolRefListInfo_ptr - .asFunction<_dart_clang_index_getObjCProtocolRefListInfo>(); + late final _clang_index_getObjCProtocolRefListInfo = + _clang_index_getObjCProtocolRefListInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getObjCPropertyDeclInfo( ffi.Pointer arg0, @@ -6641,10 +6574,10 @@ class LibClang { late final _clang_index_getObjCPropertyDeclInfo_ptr = _lookup>( 'clang_index_getObjCPropertyDeclInfo'); - late final _dart_clang_index_getObjCPropertyDeclInfo - _clang_index_getObjCPropertyDeclInfo = - _clang_index_getObjCPropertyDeclInfo_ptr - .asFunction<_dart_clang_index_getObjCPropertyDeclInfo>(); + late final _clang_index_getObjCPropertyDeclInfo = + _clang_index_getObjCPropertyDeclInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getIBOutletCollectionAttrInfo( @@ -6658,10 +6591,10 @@ class LibClang { late final _clang_index_getIBOutletCollectionAttrInfo_ptr = _lookup< ffi.NativeFunction>( 'clang_index_getIBOutletCollectionAttrInfo'); - late final _dart_clang_index_getIBOutletCollectionAttrInfo - _clang_index_getIBOutletCollectionAttrInfo = - _clang_index_getIBOutletCollectionAttrInfo_ptr - .asFunction<_dart_clang_index_getIBOutletCollectionAttrInfo>(); + late final _clang_index_getIBOutletCollectionAttrInfo = + _clang_index_getIBOutletCollectionAttrInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getCXXClassDeclInfo( ffi.Pointer arg0, @@ -6674,13 +6607,14 @@ class LibClang { late final _clang_index_getCXXClassDeclInfo_ptr = _lookup>( 'clang_index_getCXXClassDeclInfo'); - late final _dart_clang_index_getCXXClassDeclInfo - _clang_index_getCXXClassDeclInfo = _clang_index_getCXXClassDeclInfo_ptr - .asFunction<_dart_clang_index_getCXXClassDeclInfo>(); + late final _clang_index_getCXXClassDeclInfo = + _clang_index_getCXXClassDeclInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); /// For retrieving a custom CXIdxClientContainer attached to a /// container. - ffi.Pointer clang_index_getClientContainer( + CXIdxClientContainer clang_index_getClientContainer( ffi.Pointer arg0, ) { return _clang_index_getClientContainer( @@ -6691,15 +6625,15 @@ class LibClang { late final _clang_index_getClientContainer_ptr = _lookup>( 'clang_index_getClientContainer'); - late final _dart_clang_index_getClientContainer - _clang_index_getClientContainer = _clang_index_getClientContainer_ptr - .asFunction<_dart_clang_index_getClientContainer>(); + late final _clang_index_getClientContainer = + _clang_index_getClientContainer_ptr.asFunction< + CXIdxClientContainer Function(ffi.Pointer)>(); /// For setting a custom CXIdxClientContainer attached to a /// container. void clang_index_setClientContainer( ffi.Pointer arg0, - ffi.Pointer arg1, + CXIdxClientContainer arg1, ) { return _clang_index_setClientContainer( arg0, @@ -6710,12 +6644,13 @@ class LibClang { late final _clang_index_setClientContainer_ptr = _lookup>( 'clang_index_setClientContainer'); - late final _dart_clang_index_setClientContainer - _clang_index_setClientContainer = _clang_index_setClientContainer_ptr - .asFunction<_dart_clang_index_setClientContainer>(); + late final _clang_index_setClientContainer = + _clang_index_setClientContainer_ptr.asFunction< + void Function( + ffi.Pointer, CXIdxClientContainer)>(); /// For retrieving a custom CXIdxClientEntity attached to an entity. - ffi.Pointer clang_index_getClientEntity( + CXIdxClientEntity clang_index_getClientEntity( ffi.Pointer arg0, ) { return _clang_index_getClientEntity( @@ -6726,14 +6661,13 @@ class LibClang { late final _clang_index_getClientEntity_ptr = _lookup>( 'clang_index_getClientEntity'); - late final _dart_clang_index_getClientEntity _clang_index_getClientEntity = - _clang_index_getClientEntity_ptr - .asFunction<_dart_clang_index_getClientEntity>(); + late final _clang_index_getClientEntity = _clang_index_getClientEntity_ptr + .asFunction)>(); /// For setting a custom CXIdxClientEntity attached to an entity. void clang_index_setClientEntity( ffi.Pointer arg0, - ffi.Pointer arg1, + CXIdxClientEntity arg1, ) { return _clang_index_setClientEntity( arg0, @@ -6744,16 +6678,16 @@ class LibClang { late final _clang_index_setClientEntity_ptr = _lookup>( 'clang_index_setClientEntity'); - late final _dart_clang_index_setClientEntity _clang_index_setClientEntity = - _clang_index_setClientEntity_ptr - .asFunction<_dart_clang_index_setClientEntity>(); + late final _clang_index_setClientEntity = + _clang_index_setClientEntity_ptr.asFunction< + void Function(ffi.Pointer, CXIdxClientEntity)>(); /// 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, + CXIndexAction clang_IndexAction_create( + CXIndex CIdx, ) { return _clang_IndexAction_create( CIdx, @@ -6763,16 +6697,15 @@ class LibClang { late final _clang_IndexAction_create_ptr = _lookup>( 'clang_IndexAction_create'); - late final _dart_clang_IndexAction_create _clang_IndexAction_create = - _clang_IndexAction_create_ptr - .asFunction<_dart_clang_IndexAction_create>(); + late final _clang_IndexAction_create = _clang_IndexAction_create_ptr + .asFunction(); /// 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, + CXIndexAction arg0, ) { return _clang_IndexAction_dispose( arg0, @@ -6782,9 +6715,8 @@ class LibClang { late final _clang_IndexAction_dispose_ptr = _lookup>( 'clang_IndexAction_dispose'); - late final _dart_clang_IndexAction_dispose _clang_IndexAction_dispose = - _clang_IndexAction_dispose_ptr - .asFunction<_dart_clang_IndexAction_dispose>(); + late final _clang_IndexAction_dispose = + _clang_IndexAction_dispose_ptr.asFunction(); /// Index the given source file and the translation unit corresponding /// to that file via callbacks implemented through #IndexerCallbacks. @@ -6810,8 +6742,8 @@ class LibClang { /// /// The rest of the parameters are the same as #clang_parseTranslationUnit. int clang_indexSourceFile( - ffi.Pointer arg0, - ffi.Pointer client_data, + CXIndexAction arg0, + CXClientData client_data, ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, @@ -6820,7 +6752,7 @@ class LibClang { int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, - ffi.Pointer> out_TU, + ffi.Pointer out_TU, int TU_options, ) { return _clang_indexSourceFile( @@ -6842,15 +6774,27 @@ class LibClang { late final _clang_indexSourceFile_ptr = _lookup>( 'clang_indexSourceFile'); - late final _dart_clang_indexSourceFile _clang_indexSourceFile = - _clang_indexSourceFile_ptr.asFunction<_dart_clang_indexSourceFile>(); + late final _clang_indexSourceFile = _clang_indexSourceFile_ptr.asFunction< + int Function( + CXIndexAction, + CXClientData, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + ffi.Pointer, + int)>(); /// 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, + CXIndexAction arg0, + CXClientData client_data, ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, @@ -6859,7 +6803,7 @@ class LibClang { int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, - ffi.Pointer> out_TU, + ffi.Pointer out_TU, int TU_options, ) { return _clang_indexSourceFileFullArgv( @@ -6881,9 +6825,21 @@ class LibClang { late final _clang_indexSourceFileFullArgv_ptr = _lookup>( 'clang_indexSourceFileFullArgv'); - late final _dart_clang_indexSourceFileFullArgv - _clang_indexSourceFileFullArgv = _clang_indexSourceFileFullArgv_ptr - .asFunction<_dart_clang_indexSourceFileFullArgv>(); + late final _clang_indexSourceFileFullArgv = + _clang_indexSourceFileFullArgv_ptr.asFunction< + int Function( + CXIndexAction, + CXClientData, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + ffi.Pointer, + int)>(); /// Index the given translation unit via callbacks implemented through /// #IndexerCallbacks. @@ -6900,12 +6856,12 @@ class LibClang { /// \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, + CXIndexAction arg0, + CXClientData client_data, ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, - ffi.Pointer arg5, + CXTranslationUnit arg5, ) { return _clang_indexTranslationUnit( arg0, @@ -6920,9 +6876,10 @@ class LibClang { late final _clang_indexTranslationUnit_ptr = _lookup>( 'clang_indexTranslationUnit'); - late final _dart_clang_indexTranslationUnit _clang_indexTranslationUnit = - _clang_indexTranslationUnit_ptr - .asFunction<_dart_clang_indexTranslationUnit>(); + late final _clang_indexTranslationUnit = + _clang_indexTranslationUnit_ptr.asFunction< + int Function(CXIndexAction, CXClientData, + ffi.Pointer, int, int, CXTranslationUnit)>(); /// Retrieve the CXIdxFile, file, line, column, and offset represented by /// the given CXIdxLoc. @@ -6932,8 +6889,8 @@ class LibClang { /// retrieves the location of the argument. void clang_indexLoc_getFileLocation( CXIdxLoc loc, - ffi.Pointer> indexFile, - ffi.Pointer> file, + ffi.Pointer indexFile, + ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -6951,9 +6908,15 @@ class LibClang { late final _clang_indexLoc_getFileLocation_ptr = _lookup>( 'clang_indexLoc_getFileLocation'); - late final _dart_clang_indexLoc_getFileLocation - _clang_indexLoc_getFileLocation = _clang_indexLoc_getFileLocation_ptr - .asFunction<_dart_clang_indexLoc_getFileLocation>(); + late final _clang_indexLoc_getFileLocation = + _clang_indexLoc_getFileLocation_ptr.asFunction< + void Function( + CXIdxLoc, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve the CXSourceLocation represented by the given CXIdxLoc. CXSourceLocation clang_indexLoc_getCXSourceLocation( @@ -6967,10 +6930,9 @@ class LibClang { late final _clang_indexLoc_getCXSourceLocation_ptr = _lookup>( 'clang_indexLoc_getCXSourceLocation'); - late final _dart_clang_indexLoc_getCXSourceLocation - _clang_indexLoc_getCXSourceLocation = + late final _clang_indexLoc_getCXSourceLocation = _clang_indexLoc_getCXSourceLocation_ptr - .asFunction<_dart_clang_indexLoc_getCXSourceLocation>(); + .asFunction(); /// Visit the fields of a particular type. /// @@ -6991,8 +6953,8 @@ class LibClang { /// prematurely by the visitor returning \c CXFieldVisit_Break. int clang_Type_visitFields( CXType T, - ffi.Pointer> visitor, - ffi.Pointer client_data, + CXFieldVisitor visitor, + CXClientData client_data, ) { return _clang_Type_visitFields( T, @@ -7004,8 +6966,8 @@ class LibClang { late final _clang_Type_visitFields_ptr = _lookup>( 'clang_Type_visitFields'); - late final _dart_clang_Type_visitFields _clang_Type_visitFields = - _clang_Type_visitFields_ptr.asFunction<_dart_clang_Type_visitFields>(); + late final _clang_Type_visitFields = _clang_Type_visitFields_ptr + .asFunction(); late final addresses = _SymbolAddresses(this); } @@ -7859,6 +7821,12 @@ class CXStringSet extends ffi.Struct { external int Count; } +typedef Native_clang_getCString = ffi.Pointer Function( + CXString string); +typedef Native_clang_disposeString = ffi.Void Function(CXString string); +typedef Native_clang_disposeStringSet = ffi.Void Function( + ffi.Pointer set_1); + class CXTargetInfoImpl extends ffi.Opaque {} class CXTranslationUnitImpl extends ffi.Opaque {} @@ -7902,6 +7870,14 @@ class CXVersion extends ffi.Struct { external int Subminor; } +typedef Native_clang_createIndex = CXIndex Function( + ffi.Int32 excludeDeclarationsFromPCH, ffi.Int32 displayDiagnostics); + +/// An "index" that consists of a set of translation units that would +/// typically be linked together into an executable or library. +typedef CXIndex = ffi.Pointer; +typedef Native_clang_disposeIndex = ffi.Void Function(CXIndex index); + abstract class CXGlobalOptFlags { /// Used to indicate that no special CXIndex options are needed. static const int CXGlobalOpt_None = 0; @@ -7925,6 +7901,18 @@ abstract class CXGlobalOptFlags { static const int CXGlobalOpt_ThreadBackgroundPriorityForAll = 3; } +typedef Native_clang_CXIndex_setGlobalOptions = ffi.Void Function( + CXIndex arg0, ffi.Uint32 options); +typedef Native_clang_CXIndex_getGlobalOptions = ffi.Uint32 Function( + CXIndex arg0); +typedef Native_clang_CXIndex_setInvocationEmissionPathOption = ffi.Void + Function(CXIndex arg0, ffi.Pointer Path); +typedef Native_clang_getFileName = CXString Function(CXFile SFile); + +/// A particular source file that is part of a translation unit. +typedef CXFile = ffi.Pointer; +typedef Native_clang_getFileTime = ffi.Int64 Function(CXFile SFile); + /// Uniquely identifies a CXFile, that refers to the same underlying file, /// across an indexing session. class CXFileUniqueID extends ffi.Struct { @@ -7932,6 +7920,21 @@ class CXFileUniqueID extends ffi.Struct { external ffi.Array data; } +typedef Native_clang_getFileUniqueID = ffi.Int32 Function( + CXFile file, ffi.Pointer outID); +typedef Native_clang_isFileMultipleIncludeGuarded = ffi.Uint32 Function( + CXTranslationUnit tu, CXFile file); + +/// A single translation unit, which resides in an index. +typedef CXTranslationUnit = ffi.Pointer; +typedef Native_clang_getFile = CXFile Function( + CXTranslationUnit tu, ffi.Pointer file_name); +typedef Native_clang_getFileContents = ffi.Pointer Function( + CXTranslationUnit tu, CXFile file, ffi.Pointer size); +typedef Native_clang_File_isEqual = ffi.Int32 Function( + CXFile file1, CXFile file2); +typedef Native_clang_File_tryGetRealPathName = CXString Function(CXFile file); + /// Identifies a specific source location within a translation /// unit. /// @@ -7960,6 +7963,57 @@ class CXSourceRange extends ffi.Struct { external int end_int_data; } +typedef Native_clang_getNullLocation = CXSourceLocation Function(); +typedef Native_clang_equalLocations = ffi.Uint32 Function( + CXSourceLocation loc1, CXSourceLocation loc2); +typedef Native_clang_getLocation = CXSourceLocation Function( + CXTranslationUnit tu, CXFile file, ffi.Uint32 line, ffi.Uint32 column); +typedef Native_clang_getLocationForOffset = CXSourceLocation Function( + CXTranslationUnit tu, CXFile file, ffi.Uint32 offset); +typedef Native_clang_Location_isInSystemHeader = ffi.Int32 Function( + CXSourceLocation location); +typedef Native_clang_Location_isFromMainFile = ffi.Int32 Function( + CXSourceLocation location); +typedef Native_clang_getNullRange = CXSourceRange Function(); +typedef Native_clang_getRange = CXSourceRange Function( + CXSourceLocation begin, CXSourceLocation end); +typedef Native_clang_equalRanges = ffi.Uint32 Function( + CXSourceRange range1, CXSourceRange range2); +typedef Native_clang_Range_isNull = ffi.Int32 Function(CXSourceRange range); +typedef Native_clang_getExpansionLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); +typedef Native_clang_getPresumedLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer filename, + ffi.Pointer line, + ffi.Pointer column); +typedef Native_clang_getInstantiationLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); +typedef Native_clang_getSpellingLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); +typedef Native_clang_getFileLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); +typedef Native_clang_getRangeStart = CXSourceLocation Function( + CXSourceRange range); +typedef Native_clang_getRangeEnd = CXSourceLocation Function( + CXSourceRange range); + /// Identifies an array of ranges. class CXSourceRangeList extends ffi.Struct { /// The number of ranges in the \c ranges array. @@ -7970,6 +8024,218 @@ class CXSourceRangeList extends ffi.Struct { external ffi.Pointer ranges; } +typedef Native_clang_getSkippedRanges = ffi.Pointer Function( + CXTranslationUnit tu, CXFile file); +typedef Native_clang_getAllSkippedRanges = ffi.Pointer + Function(CXTranslationUnit tu); +typedef Native_clang_disposeSourceRangeList = ffi.Void Function( + ffi.Pointer ranges); +typedef Native_clang_getNumDiagnosticsInSet = ffi.Uint32 Function( + CXDiagnosticSet Diags); + +/// A group of CXDiagnostics. +typedef CXDiagnosticSet = ffi.Pointer; +typedef Native_clang_getDiagnosticInSet = CXDiagnostic Function( + CXDiagnosticSet Diags, ffi.Uint32 Index); + +/// A single diagnostic, containing the diagnostic's severity, +/// location, text, source ranges, and fix-it hints. +typedef CXDiagnostic = ffi.Pointer; +typedef Native_clang_loadDiagnostics = CXDiagnosticSet Function( + ffi.Pointer file, + ffi.Pointer error, + ffi.Pointer errorString); + +/// Describes the kind of error that occurred (if any) in a call to +/// \c 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; +} + +typedef Native_clang_disposeDiagnosticSet = ffi.Void Function( + CXDiagnosticSet Diags); +typedef Native_clang_getChildDiagnostics = CXDiagnosticSet Function( + CXDiagnostic D); +typedef Native_clang_getNumDiagnostics = ffi.Uint32 Function( + CXTranslationUnit Unit); +typedef Native_clang_getDiagnostic = CXDiagnostic Function( + CXTranslationUnit Unit, ffi.Uint32 Index); +typedef Native_clang_getDiagnosticSetFromTU = CXDiagnosticSet Function( + CXTranslationUnit Unit); +typedef Native_clang_disposeDiagnostic = ffi.Void Function( + CXDiagnostic Diagnostic); +typedef Native_clang_formatDiagnostic = CXString Function( + CXDiagnostic Diagnostic, ffi.Uint32 Options); +typedef Native_clang_defaultDiagnosticDisplayOptions = ffi.Uint32 Function(); +typedef Native_clang_getDiagnosticSeverity = ffi.Int32 Function( + CXDiagnostic arg0); + +/// 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; +} + +typedef Native_clang_getDiagnosticLocation = CXSourceLocation Function( + CXDiagnostic arg0); +typedef Native_clang_getDiagnosticSpelling = CXString Function( + CXDiagnostic arg0); +typedef Native_clang_getDiagnosticOption = CXString Function( + CXDiagnostic Diag, ffi.Pointer Disable); +typedef Native_clang_getDiagnosticCategory = ffi.Uint32 Function( + CXDiagnostic arg0); +typedef Native_clang_getDiagnosticCategoryName = CXString Function( + ffi.Uint32 Category); +typedef Native_clang_getDiagnosticCategoryText = CXString Function( + CXDiagnostic arg0); +typedef Native_clang_getDiagnosticNumRanges = ffi.Uint32 Function( + CXDiagnostic arg0); +typedef Native_clang_getDiagnosticRange = CXSourceRange Function( + CXDiagnostic Diagnostic, ffi.Uint32 Range); +typedef Native_clang_getDiagnosticNumFixIts = ffi.Uint32 Function( + CXDiagnostic Diagnostic); +typedef Native_clang_getDiagnosticFixIt = CXString Function( + CXDiagnostic Diagnostic, + ffi.Uint32 FixIt, + ffi.Pointer ReplacementRange); +typedef Native_clang_getTranslationUnitSpelling = CXString Function( + CXTranslationUnit CTUnit); +typedef Native_clang_createTranslationUnitFromSourceFile + = CXTranslationUnit Function( + CXIndex 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 Native_clang_createTranslationUnit = CXTranslationUnit Function( + CXIndex CIdx, ffi.Pointer ast_filename); +typedef Native_clang_createTranslationUnit2 = ffi.Int32 Function(CXIndex CIdx, + ffi.Pointer ast_filename, ffi.Pointer out_TU); + +/// Error codes returned by libclang routines. +/// +/// Zero (\c CXError_Success) is the only error code indicating success. Other +/// error codes, including not yet assigned non-zero values, indicate errors. +abstract class CXErrorCode { + /// No error. + static const int CXError_Success = 0; + + /// A generic error code, no further details are available. + /// + /// Errors of this kind can get their own specific error codes in future + /// libclang versions. + 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; +} + +typedef Native_clang_defaultEditingTranslationUnitOptions = ffi.Uint32 + Function(); +typedef Native_clang_parseTranslationUnit = CXTranslationUnit Function( + CXIndex 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 Native_clang_parseTranslationUnit2 = ffi.Int32 Function( + CXIndex 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 Native_clang_parseTranslationUnit2FullArgv = ffi.Int32 Function( + CXIndex 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 Native_clang_defaultSaveOptions = ffi.Uint32 Function( + CXTranslationUnit TU); +typedef Native_clang_saveTranslationUnit = ffi.Int32 Function( + CXTranslationUnit TU, ffi.Pointer FileName, ffi.Uint32 options); +typedef Native_clang_suspendTranslationUnit = ffi.Uint32 Function( + CXTranslationUnit arg0); +typedef Native_clang_disposeTranslationUnit = ffi.Void Function( + CXTranslationUnit arg0); +typedef Native_clang_defaultReparseOptions = ffi.Uint32 Function( + CXTranslationUnit TU); +typedef Native_clang_reparseTranslationUnit = ffi.Int32 Function( + CXTranslationUnit TU, + ffi.Uint32 num_unsaved_files, + ffi.Pointer unsaved_files, + ffi.Uint32 options); +typedef Native_clang_getTUResourceUsageName = ffi.Pointer Function( + ffi.Int32 kind); + +/// 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; @@ -7988,6 +8254,22 @@ class CXTUResourceUsage extends ffi.Struct { external ffi.Pointer entries; } +typedef Native_clang_getCXTUResourceUsage = CXTUResourceUsage Function( + CXTranslationUnit TU); +typedef Native_clang_disposeCXTUResourceUsage = ffi.Void Function( + CXTUResourceUsage usage); +typedef Native_clang_getTranslationUnitTargetInfo = CXTargetInfo Function( + CXTranslationUnit CTUnit); + +/// An opaque type representing target information for a given translation +/// unit. +typedef CXTargetInfo = ffi.Pointer; +typedef Native_clang_TargetInfo_dispose = ffi.Void Function(CXTargetInfo Info); +typedef Native_clang_TargetInfo_getTriple = CXString Function( + CXTargetInfo Info); +typedef Native_clang_TargetInfo_getPointerWidth = ffi.Int32 Function( + CXTargetInfo Info); + /// A cursor representing some element in the abstract syntax tree for /// a translation unit. /// @@ -8015,3532 +8297,2372 @@ class CXCursor extends ffi.Struct { external ffi.Array> data; } -/// 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. +/// Describes the kind of entity that a cursor refers to. +abstract class CXCursorKind { + /// A declaration whose specific kind is not exposed via this + /// interface. /// - /// Possible values are "ios" or "macos". - external CXString Platform; + /// Unexposed declarations have the same operations as any other kind + /// of declaration; one can extract their location information, + /// spelling, find their definitions, etc. However, the specific kind + /// of the declaration is not reported. + static const int CXCursor_UnexposedDecl = 1; - /// The version number in which this entity was introduced. - external CXVersion Introduced; + /// A C or C++ struct. + static const int CXCursor_StructDecl = 2; - /// The version number in which this entity was deprecated (but is - /// still available). - external CXVersion Deprecated; + /// A C or C++ union. + static const int CXCursor_UnionDecl = 3; - /// The version number in which this entity was obsoleted, and therefore - /// is no longer available. - external CXVersion Obsoleted; + /// A C++ class. + static const int CXCursor_ClassDecl = 4; - /// Whether the entity is unconditionally unavailable on this platform. - @ffi.Int32() - external int Unavailable; + /// An enumeration. + static const int CXCursor_EnumDecl = 5; - /// An optional message to provide to a user of this API, e.g., to - /// suggest replacement APIs. - external CXString Message; -} + /// A field (in C) or non-static data member (in C++) in a + /// struct, union, or C++ class. + static const int CXCursor_FieldDecl = 6; -class CXCursorSetImpl extends ffi.Opaque {} + /// An enumerator constant. + static const int CXCursor_EnumConstantDecl = 7; -/// 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 function. + static const int CXCursor_FunctionDecl = 8; - /// 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; + /// A variable. + static const int CXCursor_VarDecl = 9; - /// Represents a type that was referred to using an elaborated type keyword. + /// 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. /// - /// 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; - - @ffi.Array.multi([2]) - external ffi.Array> data; -} - -/// Describes a single preprocessing token. -class CXToken extends ffi.Struct { - @ffi.Array.multi([4]) - external ffi.Array int_data; - - external ffi.Pointer ptr_data; -} - -/// A single result of code completion. -class CXCompletionResult extends ffi.Struct { - /// The kind of entity that this completion refers to. + /// A type reference occurs anywhere where a type is named but not + /// declared. For example, given: /// - /// 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. + /// \code + /// typedef unsigned size_type; + /// size_type size; + /// \endcode /// - /// \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 { - @ffi.Array.multi([2]) - external ffi.Array> ptr_data; - - @ffi.Uint32() - external int int_data; -} - -/// 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; + /// The typedef is a declaration of size_type (CXCursor_TypedefDecl), + /// while the type of the variable "size" is referenced. The cursor + /// referenced by the type of size is the typedef for size_type. + static const int CXCursor_TypeRef = 43; + static const int CXCursor_CXXBaseSpecifier = 44; - /// 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; + /// A reference to a class template, function template, template + /// template parameter, or class template partial specialization. + static const int CXCursor_TemplateRef = 45; - external CXCursor classCursor; + /// A reference to a namespace or namespace alias. + static const int CXCursor_NamespaceRef = 46; - external CXIdxLoc classLoc; -} + /// 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; -class CXIdxDeclInfo extends ffi.Struct { - external ffi.Pointer entityInfo; + /// A reference to a labeled statement. + /// + /// This cursor kind is used to describe the jump to "start_over" in the + /// goto statement in the following example: + /// + /// \code + /// start_over: + /// ++counter; + /// + /// goto start_over; + /// \endcode + /// + /// A label reference cursor refers to a label statement. + static const int CXCursor_LabelRef = 48; - external CXCursor cursor; + /// A reference to a set of overloaded functions or function templates + /// that has not yet been resolved to a specific function or function template. + /// + /// An overloaded declaration reference cursor occurs in C++ templates where + /// a dependent name refers to a function. For example: + /// + /// \code + /// template void swap(T&, T&); + /// + /// struct X { ... }; + /// void swap(X&, X&); + /// + /// template + /// void reverse(T* first, T* last) { + /// while (first < last - 1) { + /// swap(*first, *--last); + /// ++first; + /// } + /// } + /// + /// struct Y { }; + /// void swap(Y&, Y&); + /// \endcode + /// + /// Here, the identifier "swap" is associated with an overloaded declaration + /// reference. In the template definition, "swap" refers to either of the two + /// "swap" functions declared above, so both results will be available. At + /// instantiation time, "swap" may also refer to other functions found via + /// argument-dependent lookup (e.g., the "swap" function at the end of the + /// example). + /// + /// The functions \c clang_getNumOverloadedDecls() and + /// \c clang_getOverloadedDecl() can be used to retrieve the definitions + /// referenced by this cursor. + 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. + /// + /// Unexposed expressions have the same operations as any other kind + /// of expression; one can extract their location information, + /// spelling, children, etc. However, the specific kind of the + /// expression is not reported. + static const int CXCursor_UnexposedExpr = 100; - external CXIdxLoc loc; + /// An expression that refers to some value declaration, such + /// as a function, variable, or enumerator. + static const int CXCursor_DeclRefExpr = 101; - external ffi.Pointer semanticContainer; + /// An expression that refers to a member of a struct, union, + /// class, Objective-C class, etc. + static const int CXCursor_MemberRefExpr = 102; - /// Generally same as #semanticContainer but can be different in - /// cases like out-of-line C++ member functions. - external ffi.Pointer lexicalContainer; + /// An expression that calls a function. + static const int CXCursor_CallExpr = 103; - @ffi.Int32() - external int isRedeclaration; + /// An expression that sends a message to an Objective-C + /// object or class. + static const int CXCursor_ObjCMessageExpr = 104; - @ffi.Int32() - external int isDefinition; + /// An expression that represents a block literal. + static const int CXCursor_BlockExpr = 105; - @ffi.Int32() - external int isContainer; + /// An integer literal. + static const int CXCursor_IntegerLiteral = 106; - external ffi.Pointer declAsContainer; + /// A floating point number literal. + static const int CXCursor_FloatingLiteral = 107; - /// 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; + /// An imaginary number literal. + static const int CXCursor_ImaginaryLiteral = 108; - external ffi.Pointer> attributes; + /// A string literal. + static const int CXCursor_StringLiteral = 109; - @ffi.Uint32() - external int numAttributes; + /// A character literal. + static const int CXCursor_CharacterLiteral = 110; - @ffi.Uint32() - external int flags; -} + /// A parenthesized expression, e.g. "(1)". + /// + /// This AST node is only formed if full location information is requested. + static const int CXCursor_ParenExpr = 111; -class CXIdxObjCContainerDeclInfo extends ffi.Struct { - external ffi.Pointer declInfo; + /// This represents the unary-expression's (except sizeof and + /// alignof). + static const int CXCursor_UnaryOperator = 112; - @ffi.Int32() - external int kind; -} + /// [C99 6.5.2.1] Array Subscripting. + static const int CXCursor_ArraySubscriptExpr = 113; -class CXIdxBaseClassInfo extends ffi.Struct { - external ffi.Pointer base; + /// A builtin binary operation expression such as "x + y" or + /// "x <= y". + static const int CXCursor_BinaryOperator = 114; - external CXCursor cursor; + /// Compound assignment such as "+=". + static const int CXCursor_CompoundAssignOperator = 115; - external CXIdxLoc loc; -} + /// The ?: ternary operator. + static const int CXCursor_ConditionalOperator = 116; -class CXIdxObjCProtocolRefInfo extends ffi.Struct { - external ffi.Pointer protocol; + /// 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. + /// + /// For example: (int)f. + static const int CXCursor_CStyleCastExpr = 117; - external CXCursor cursor; + /// [C99 6.5.2.5] + static const int CXCursor_CompoundLiteralExpr = 118; - external CXIdxLoc loc; -} + /// Describes an C or C++ initializer list. + static const int CXCursor_InitListExpr = 119; -class CXIdxObjCProtocolRefListInfo extends ffi.Struct { - external ffi.Pointer> protocols; + /// The GNU address of label extension, representing &&label. + static const int CXCursor_AddrLabelExpr = 120; - @ffi.Uint32() - external int numProtocols; -} + /// This is the GNU Statement Expression extension: ({int X=4; X;}) + static const int CXCursor_StmtExpr = 121; -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 Native_clang_getCString = ffi.Pointer Function( - CXString string, -); - -typedef _dart_clang_getCString = ffi.Pointer Function( - CXString string, -); - -typedef Native_clang_disposeString = ffi.Void Function( - CXString string, -); - -typedef _dart_clang_disposeString = void Function( - CXString string, -); - -typedef Native_clang_disposeStringSet = ffi.Void Function( - ffi.Pointer set_1, -); - -typedef _dart_clang_disposeStringSet = void Function( - ffi.Pointer set_1, -); - -typedef Native_clang_createIndex = ffi.Pointer Function( - ffi.Int32 excludeDeclarationsFromPCH, - ffi.Int32 displayDiagnostics, -); - -typedef _dart_clang_createIndex = ffi.Pointer Function( - int excludeDeclarationsFromPCH, - int displayDiagnostics, -); - -typedef Native_clang_disposeIndex = ffi.Void Function( - ffi.Pointer index, -); - -typedef _dart_clang_disposeIndex = void Function( - ffi.Pointer index, -); - -typedef Native_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 Native_clang_CXIndex_getGlobalOptions = ffi.Uint32 Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_CXIndex_getGlobalOptions = int Function( - ffi.Pointer arg0, -); - -typedef Native_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 Native_clang_getFileName = CXString Function( - ffi.Pointer SFile, -); - -typedef _dart_clang_getFileName = CXString Function( - ffi.Pointer SFile, -); - -typedef Native_clang_getFileTime = ffi.Int64 Function( - ffi.Pointer SFile, -); - -typedef _dart_clang_getFileTime = int Function( - ffi.Pointer SFile, -); - -typedef Native_clang_getFileUniqueID = ffi.Int32 Function( - ffi.Pointer file, - ffi.Pointer outID, -); - -typedef _dart_clang_getFileUniqueID = int Function( - ffi.Pointer file, - ffi.Pointer outID, -); - -typedef Native_clang_isFileMultipleIncludeGuarded = ffi.Uint32 Function( - ffi.Pointer tu, - ffi.Pointer file, -); - -typedef _dart_clang_isFileMultipleIncludeGuarded = int Function( - ffi.Pointer tu, - ffi.Pointer file, -); - -typedef Native_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 Native_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 Native_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 Native_clang_File_tryGetRealPathName = CXString Function( - ffi.Pointer file, -); - -typedef _dart_clang_File_tryGetRealPathName = CXString Function( - ffi.Pointer file, -); - -typedef Native_clang_getNullLocation = CXSourceLocation Function(); - -typedef _dart_clang_getNullLocation = CXSourceLocation Function(); - -typedef Native_clang_equalLocations = ffi.Uint32 Function( - CXSourceLocation loc1, - CXSourceLocation loc2, -); - -typedef _dart_clang_equalLocations = int Function( - CXSourceLocation loc1, - CXSourceLocation loc2, -); - -typedef Native_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 Native_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 Native_clang_Location_isInSystemHeader = ffi.Int32 Function( - CXSourceLocation location, -); - -typedef _dart_clang_Location_isInSystemHeader = int Function( - CXSourceLocation location, -); - -typedef Native_clang_Location_isFromMainFile = ffi.Int32 Function( - CXSourceLocation location, -); - -typedef _dart_clang_Location_isFromMainFile = int Function( - CXSourceLocation location, -); - -typedef Native_clang_getNullRange = CXSourceRange Function(); - -typedef _dart_clang_getNullRange = CXSourceRange Function(); - -typedef Native_clang_getRange = CXSourceRange Function( - CXSourceLocation begin, - CXSourceLocation end, -); - -typedef _dart_clang_getRange = CXSourceRange Function( - CXSourceLocation begin, - CXSourceLocation end, -); - -typedef Native_clang_equalRanges = ffi.Uint32 Function( - CXSourceRange range1, - CXSourceRange range2, -); - -typedef _dart_clang_equalRanges = int Function( - CXSourceRange range1, - CXSourceRange range2, -); - -typedef Native_clang_Range_isNull = ffi.Int32 Function( - CXSourceRange range, -); - -typedef _dart_clang_Range_isNull = int Function( - CXSourceRange range, -); - -typedef Native_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 Native_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 Native_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 Native_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 Native_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 Native_clang_getRangeStart = CXSourceLocation Function( - CXSourceRange range, -); - -typedef _dart_clang_getRangeStart = CXSourceLocation Function( - CXSourceRange range, -); - -typedef Native_clang_getRangeEnd = CXSourceLocation Function( - CXSourceRange range, -); - -typedef _dart_clang_getRangeEnd = CXSourceLocation Function( - CXSourceRange range, -); - -typedef Native_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 Native_clang_getAllSkippedRanges = ffi.Pointer - Function( - ffi.Pointer tu, -); - -typedef _dart_clang_getAllSkippedRanges = ffi.Pointer - Function( - ffi.Pointer tu, -); - -typedef Native_clang_disposeSourceRangeList = ffi.Void Function( - ffi.Pointer ranges, -); - -typedef _dart_clang_disposeSourceRangeList = void Function( - ffi.Pointer ranges, -); - -typedef Native_clang_getNumDiagnosticsInSet = ffi.Uint32 Function( - ffi.Pointer Diags, -); - -typedef _dart_clang_getNumDiagnosticsInSet = int Function( - ffi.Pointer Diags, -); - -typedef Native_clang_getDiagnosticInSet = ffi.Pointer Function( - ffi.Pointer Diags, - ffi.Uint32 Index, -); - -typedef _dart_clang_getDiagnosticInSet = ffi.Pointer Function( - ffi.Pointer Diags, - int Index, -); - -typedef Native_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 Native_clang_disposeDiagnosticSet = ffi.Void Function( - ffi.Pointer Diags, -); - -typedef _dart_clang_disposeDiagnosticSet = void Function( - ffi.Pointer Diags, -); - -typedef Native_clang_getChildDiagnostics = ffi.Pointer Function( - ffi.Pointer D, -); - -typedef _dart_clang_getChildDiagnostics = ffi.Pointer Function( - ffi.Pointer D, -); - -typedef Native_clang_getNumDiagnostics = ffi.Uint32 Function( - ffi.Pointer Unit, -); - -typedef _dart_clang_getNumDiagnostics = int Function( - ffi.Pointer Unit, -); - -typedef Native_clang_getDiagnostic = ffi.Pointer Function( - ffi.Pointer Unit, - ffi.Uint32 Index, -); - -typedef _dart_clang_getDiagnostic = ffi.Pointer Function( - ffi.Pointer Unit, - int Index, -); - -typedef Native_clang_getDiagnosticSetFromTU = ffi.Pointer Function( - ffi.Pointer Unit, -); - -typedef _dart_clang_getDiagnosticSetFromTU = ffi.Pointer Function( - ffi.Pointer Unit, -); - -typedef Native_clang_disposeDiagnostic = ffi.Void Function( - ffi.Pointer Diagnostic, -); - -typedef _dart_clang_disposeDiagnostic = void Function( - ffi.Pointer Diagnostic, -); - -typedef Native_clang_formatDiagnostic = CXString Function( - ffi.Pointer Diagnostic, - ffi.Uint32 Options, -); - -typedef _dart_clang_formatDiagnostic = CXString Function( - ffi.Pointer Diagnostic, - int Options, -); - -typedef Native_clang_defaultDiagnosticDisplayOptions = ffi.Uint32 Function(); - -typedef _dart_clang_defaultDiagnosticDisplayOptions = int Function(); - -typedef Native_clang_getDiagnosticSeverity = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getDiagnosticSeverity = int Function( - ffi.Pointer arg0, -); - -typedef Native_clang_getDiagnosticLocation = CXSourceLocation Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getDiagnosticLocation = CXSourceLocation Function( - ffi.Pointer arg0, -); - -typedef Native_clang_getDiagnosticSpelling = CXString Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getDiagnosticSpelling = CXString Function( - ffi.Pointer arg0, -); - -typedef Native_clang_getDiagnosticOption = CXString Function( - ffi.Pointer Diag, - ffi.Pointer Disable, -); - -typedef _dart_clang_getDiagnosticOption = CXString Function( - ffi.Pointer Diag, - ffi.Pointer Disable, -); - -typedef Native_clang_getDiagnosticCategory = ffi.Uint32 Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getDiagnosticCategory = int Function( - ffi.Pointer arg0, -); - -typedef Native_clang_getDiagnosticCategoryName = CXString Function( - ffi.Uint32 Category, -); - -typedef _dart_clang_getDiagnosticCategoryName = CXString Function( - int Category, -); - -typedef Native_clang_getDiagnosticCategoryText = CXString Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getDiagnosticCategoryText = CXString Function( - ffi.Pointer arg0, -); - -typedef Native_clang_getDiagnosticNumRanges = ffi.Uint32 Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getDiagnosticNumRanges = int Function( - ffi.Pointer arg0, -); - -typedef Native_clang_getDiagnosticRange = CXSourceRange Function( - ffi.Pointer Diagnostic, - ffi.Uint32 Range, -); - -typedef _dart_clang_getDiagnosticRange = CXSourceRange Function( - ffi.Pointer Diagnostic, - int Range, -); - -typedef Native_clang_getDiagnosticNumFixIts = ffi.Uint32 Function( - ffi.Pointer Diagnostic, -); - -typedef _dart_clang_getDiagnosticNumFixIts = int Function( - ffi.Pointer Diagnostic, -); - -typedef Native_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 Native_clang_getTranslationUnitSpelling = CXString Function( - ffi.Pointer CTUnit, -); - -typedef _dart_clang_getTranslationUnitSpelling = CXString Function( - ffi.Pointer CTUnit, -); - -typedef Native_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 Native_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 Native_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 Native_clang_defaultEditingTranslationUnitOptions = ffi.Uint32 - Function(); - -typedef _dart_clang_defaultEditingTranslationUnitOptions = int Function(); - -typedef Native_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 Native_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 Native_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 Native_clang_defaultSaveOptions = ffi.Uint32 Function( - ffi.Pointer TU, -); - -typedef _dart_clang_defaultSaveOptions = int Function( - ffi.Pointer TU, -); - -typedef Native_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 Native_clang_suspendTranslationUnit = ffi.Uint32 Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_suspendTranslationUnit = int Function( - ffi.Pointer arg0, -); - -typedef Native_clang_disposeTranslationUnit = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_disposeTranslationUnit = void Function( - ffi.Pointer arg0, -); - -typedef Native_clang_defaultReparseOptions = ffi.Uint32 Function( - ffi.Pointer TU, -); - -typedef _dart_clang_defaultReparseOptions = int Function( - ffi.Pointer TU, -); - -typedef Native_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 Native_clang_getTUResourceUsageName = ffi.Pointer Function( - ffi.Int32 kind, -); - -typedef _dart_clang_getTUResourceUsageName = ffi.Pointer Function( - int kind, -); - -typedef Native_clang_getCXTUResourceUsage = CXTUResourceUsage Function( - ffi.Pointer TU, -); - -typedef _dart_clang_getCXTUResourceUsage = CXTUResourceUsage Function( - ffi.Pointer TU, -); - -typedef Native_clang_disposeCXTUResourceUsage = ffi.Void Function( - CXTUResourceUsage usage, -); - -typedef _dart_clang_disposeCXTUResourceUsage = void Function( - CXTUResourceUsage usage, -); - -typedef Native_clang_getTranslationUnitTargetInfo - = ffi.Pointer Function( - ffi.Pointer CTUnit, -); - -typedef _dart_clang_getTranslationUnitTargetInfo = ffi.Pointer - Function( - ffi.Pointer CTUnit, -); - -typedef Native_clang_TargetInfo_dispose = ffi.Void Function( - ffi.Pointer Info, -); - -typedef _dart_clang_TargetInfo_dispose = void Function( - ffi.Pointer Info, -); - -typedef Native_clang_TargetInfo_getTriple = CXString Function( - ffi.Pointer Info, -); - -typedef _dart_clang_TargetInfo_getTriple = CXString Function( - ffi.Pointer Info, -); - -typedef Native_clang_TargetInfo_getPointerWidth = ffi.Int32 Function( - ffi.Pointer Info, -); - -typedef _dart_clang_TargetInfo_getPointerWidth = int Function( - ffi.Pointer Info, -); - -typedef Native_clang_getNullCursor = CXCursor Function(); - -typedef _dart_clang_getNullCursor = CXCursor Function(); - -typedef Native_clang_getTranslationUnitCursor = CXCursor Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getTranslationUnitCursor = CXCursor Function( - ffi.Pointer arg0, -); - -typedef Native_clang_equalCursors = ffi.Uint32 Function( - CXCursor arg0, - CXCursor arg1, -); - -typedef _dart_clang_equalCursors = int Function( - CXCursor arg0, - CXCursor arg1, -); - -typedef Native_clang_Cursor_isNull = ffi.Int32 Function( - CXCursor cursor, -); - -typedef _dart_clang_Cursor_isNull = int Function( - CXCursor cursor, -); - -typedef Native_clang_hashCursor = ffi.Uint32 Function( - CXCursor arg0, -); - -typedef _dart_clang_hashCursor = int Function( - CXCursor arg0, -); - -typedef Native_clang_getCursorKind = ffi.Int32 Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorKind = int Function( - CXCursor arg0, -); - -typedef Native_clang_isDeclaration = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isDeclaration = int Function( - int arg0, -); - -typedef Native_clang_isInvalidDeclaration = ffi.Uint32 Function( - CXCursor arg0, -); - -typedef _dart_clang_isInvalidDeclaration = int Function( - CXCursor arg0, -); - -typedef Native_clang_isReference = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isReference = int Function( - int arg0, -); - -typedef Native_clang_isExpression = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isExpression = int Function( - int arg0, -); - -typedef Native_clang_isStatement = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isStatement = int Function( - int arg0, -); - -typedef Native_clang_isAttribute = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isAttribute = int Function( - int arg0, -); - -typedef Native_clang_Cursor_hasAttrs = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_hasAttrs = int Function( - CXCursor C, -); - -typedef Native_clang_isInvalid = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isInvalid = int Function( - int arg0, -); - -typedef Native_clang_isTranslationUnit = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isTranslationUnit = int Function( - int arg0, -); - -typedef Native_clang_isPreprocessing = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isPreprocessing = int Function( - int arg0, -); - -typedef Native_clang_isUnexposed = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isUnexposed = int Function( - int arg0, -); - -typedef Native_clang_getCursorLinkage = ffi.Int32 Function( - CXCursor cursor, -); - -typedef _dart_clang_getCursorLinkage = int Function( - CXCursor cursor, -); - -typedef Native_clang_getCursorVisibility = ffi.Int32 Function( - CXCursor cursor, -); - -typedef _dart_clang_getCursorVisibility = int Function( - CXCursor cursor, -); - -typedef Native_clang_getCursorAvailability = ffi.Int32 Function( - CXCursor cursor, -); - -typedef _dart_clang_getCursorAvailability = int Function( - CXCursor cursor, -); - -typedef Native_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, -); + /// Represents a C11 generic selection. + static const int CXCursor_GenericSelectionExpr = 122; -typedef Native_clang_disposeCXPlatformAvailability = ffi.Void Function( - ffi.Pointer availability, -); + /// 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. + /// + /// The __null extension is typically only used by system headers, which define + /// NULL as __null in C++ rather than using 0 (which is an integer that may not + /// match the size of a pointer). + static const int CXCursor_GNUNullExpr = 123; -typedef _dart_clang_disposeCXPlatformAvailability = void Function( - ffi.Pointer availability, -); + /// C++'s static_cast<> expression. + static const int CXCursor_CXXStaticCastExpr = 124; -typedef Native_clang_getCursorLanguage = ffi.Int32 Function( - CXCursor cursor, -); + /// C++'s dynamic_cast<> expression. + static const int CXCursor_CXXDynamicCastExpr = 125; -typedef _dart_clang_getCursorLanguage = int Function( - CXCursor cursor, -); + /// C++'s reinterpret_cast<> expression. + static const int CXCursor_CXXReinterpretCastExpr = 126; -typedef Native_clang_getCursorTLSKind = ffi.Int32 Function( - CXCursor cursor, -); + /// C++'s const_cast<> expression. + static const int CXCursor_CXXConstCastExpr = 127; -typedef _dart_clang_getCursorTLSKind = int Function( - CXCursor cursor, -); + /// Represents an explicit C++ type conversion that uses "functional" + /// notion (C++ [expr.type.conv]). + /// + /// Example: + /// \code + /// x = int(0.5); + /// \endcode + static const int CXCursor_CXXFunctionalCastExpr = 128; -typedef Native_clang_Cursor_getTranslationUnit - = ffi.Pointer Function( - CXCursor arg0, -); + /// A C++ typeid expression (C++ [expr.typeid]). + static const int CXCursor_CXXTypeidExpr = 129; -typedef _dart_clang_Cursor_getTranslationUnit - = ffi.Pointer Function( - CXCursor arg0, -); + /// [C++ 2.13.5] C++ Boolean Literal. + static const int CXCursor_CXXBoolLiteralExpr = 130; -typedef Native_clang_createCXCursorSet = ffi.Pointer - Function(); + /// [C++0x 2.14.7] C++ Pointer Literal. + static const int CXCursor_CXXNullPtrLiteralExpr = 131; -typedef _dart_clang_createCXCursorSet = ffi.Pointer Function(); + /// Represents the "this" expression in C++ + static const int CXCursor_CXXThisExpr = 132; -typedef Native_clang_disposeCXCursorSet = ffi.Void Function( - ffi.Pointer cset, -); + /// [C++ 15] C++ Throw Expression. + /// + /// This handles 'throw' and 'throw' assignment-expression. When + /// assignment-expression isn't present, Op will be null. + static const int CXCursor_CXXThrowExpr = 133; -typedef _dart_clang_disposeCXCursorSet = void Function( - ffi.Pointer cset, -); + /// A new expression for memory allocation and constructor calls, e.g: + /// "new CXXNewExpr(foo)". + static const int CXCursor_CXXNewExpr = 134; -typedef Native_clang_CXCursorSet_contains = ffi.Uint32 Function( - ffi.Pointer cset, - CXCursor cursor, -); + /// A delete expression for memory deallocation and destructor calls, + /// e.g. "delete[] pArray". + static const int CXCursor_CXXDeleteExpr = 135; -typedef _dart_clang_CXCursorSet_contains = int Function( - ffi.Pointer cset, - CXCursor cursor, -); + /// A unary expression. (noexcept, sizeof, or other traits) + static const int CXCursor_UnaryExpr = 136; -typedef Native_clang_CXCursorSet_insert = ffi.Uint32 Function( - ffi.Pointer cset, - CXCursor cursor, -); + /// An Objective-C string literal i.e. @"foo". + static const int CXCursor_ObjCStringLiteral = 137; -typedef _dart_clang_CXCursorSet_insert = int Function( - ffi.Pointer cset, - CXCursor cursor, -); + /// An Objective-C \@encode expression. + static const int CXCursor_ObjCEncodeExpr = 138; -typedef Native_clang_getCursorSemanticParent = CXCursor Function( - CXCursor cursor, -); + /// An Objective-C \@selector expression. + static const int CXCursor_ObjCSelectorExpr = 139; -typedef _dart_clang_getCursorSemanticParent = CXCursor Function( - CXCursor cursor, -); + /// An Objective-C \@protocol expression. + static const int CXCursor_ObjCProtocolExpr = 140; -typedef Native_clang_getCursorLexicalParent = CXCursor Function( - CXCursor cursor, -); + /// An Objective-C "bridged" cast expression, which casts between + /// Objective-C pointers and C pointers, transferring ownership in the process. + /// + /// \code + /// NSString *str = (__bridge_transfer NSString *)CFCreateString(); + /// \endcode + static const int CXCursor_ObjCBridgedCastExpr = 141; -typedef _dart_clang_getCursorLexicalParent = CXCursor Function( - CXCursor cursor, -); + /// Represents a C++0x pack expansion that produces a sequence of + /// expressions. + /// + /// A pack expansion expression contains a pattern (which itself is an + /// expression) followed by an ellipsis. For example: + /// + /// \code + /// template + /// void forward(F f, Types &&...args) { + /// f(static_cast(args)...); + /// } + /// \endcode + static const int CXCursor_PackExpansionExpr = 142; -typedef Native_clang_getOverriddenCursors = ffi.Void Function( - CXCursor cursor, - ffi.Pointer> overridden, - ffi.Pointer num_overridden, -); + /// Represents an expression that computes the length of a parameter + /// pack. + /// + /// \code + /// template + /// struct count { + /// static const unsigned value = sizeof...(Types); + /// }; + /// \endcode + static const int CXCursor_SizeOfPackExpr = 143; + static const int CXCursor_LambdaExpr = 144; -typedef _dart_clang_getOverriddenCursors = void Function( - CXCursor cursor, - ffi.Pointer> overridden, - ffi.Pointer num_overridden, -); + /// Objective-c Boolean Literal. + static const int CXCursor_ObjCBoolLiteralExpr = 145; -typedef Native_clang_disposeOverriddenCursors = ffi.Void Function( - ffi.Pointer overridden, -); + /// Represents the "self" expression in an Objective-C method. + static const int CXCursor_ObjCSelfExpr = 146; -typedef _dart_clang_disposeOverriddenCursors = void Function( - ffi.Pointer overridden, -); + /// OpenMP 4.0 [2.4, Array Section]. + static const int CXCursor_OMPArraySectionExpr = 147; -typedef Native_clang_getIncludedFile = ffi.Pointer Function( - CXCursor cursor, -); + /// Represents an @available(...) check. + static const int CXCursor_ObjCAvailabilityCheckExpr = 148; -typedef _dart_clang_getIncludedFile = ffi.Pointer Function( - CXCursor cursor, -); + /// Fixed point literal + static const int CXCursor_FixedPointLiteral = 149; + static const int CXCursor_LastExpr = 149; + static const int CXCursor_FirstStmt = 200; -typedef Native_clang_getCursor = CXCursor Function( - ffi.Pointer arg0, - CXSourceLocation arg1, -); + /// A statement whose specific kind is not exposed via this + /// interface. + /// + /// Unexposed statements have the same operations as any other kind of + /// statement; one can extract their location information, spelling, + /// children, etc. However, the specific kind of the statement is not + /// reported. + static const int CXCursor_UnexposedStmt = 200; -typedef _dart_clang_getCursor = CXCursor Function( - ffi.Pointer arg0, - CXSourceLocation arg1, -); + /// A labelled statement in a function. + /// + /// This cursor kind is used to describe the "start_over:" label statement in + /// the following example: + /// + /// \code + /// start_over: + /// ++counter; + /// \endcode + static const int CXCursor_LabelStmt = 201; -typedef Native_clang_getCursorLocation = CXSourceLocation Function( - CXCursor arg0, -); + /// A group of statements like { stmt stmt }. + /// + /// This cursor kind is used to describe compound statements, e.g. function + /// bodies. + static const int CXCursor_CompoundStmt = 202; -typedef _dart_clang_getCursorLocation = CXSourceLocation Function( - CXCursor arg0, -); + /// A case statement. + static const int CXCursor_CaseStmt = 203; -typedef Native_clang_getCursorExtent = CXSourceRange Function( - CXCursor arg0, -); + /// A default statement. + static const int CXCursor_DefaultStmt = 204; -typedef _dart_clang_getCursorExtent = CXSourceRange Function( - CXCursor arg0, -); + /// An if statement + static const int CXCursor_IfStmt = 205; -typedef Native_clang_getCursorType = CXType Function( - CXCursor C, -); + /// A switch statement. + static const int CXCursor_SwitchStmt = 206; -typedef _dart_clang_getCursorType = CXType Function( - CXCursor C, -); + /// A while statement. + static const int CXCursor_WhileStmt = 207; -typedef Native_clang_getTypeSpelling = CXString Function( - CXType CT, -); + /// A do statement. + static const int CXCursor_DoStmt = 208; -typedef _dart_clang_getTypeSpelling = CXString Function( - CXType CT, -); + /// A for statement. + static const int CXCursor_ForStmt = 209; -typedef Native_clang_getTypedefDeclUnderlyingType = CXType Function( - CXCursor C, -); + /// A goto statement. + static const int CXCursor_GotoStmt = 210; -typedef _dart_clang_getTypedefDeclUnderlyingType = CXType Function( - CXCursor C, -); + /// An indirect goto statement. + static const int CXCursor_IndirectGotoStmt = 211; -typedef Native_clang_getEnumDeclIntegerType = CXType Function( - CXCursor C, -); + /// A continue statement. + static const int CXCursor_ContinueStmt = 212; -typedef _dart_clang_getEnumDeclIntegerType = CXType Function( - CXCursor C, -); + /// A break statement. + static const int CXCursor_BreakStmt = 213; -typedef Native_clang_getEnumConstantDeclValue = ffi.Int64 Function( - CXCursor C, -); + /// A return statement. + static const int CXCursor_ReturnStmt = 214; -typedef _dart_clang_getEnumConstantDeclValue = int Function( - CXCursor C, -); + /// A GCC inline assembly statement extension. + static const int CXCursor_GCCAsmStmt = 215; + static const int CXCursor_AsmStmt = 215; -typedef Native_clang_getEnumConstantDeclUnsignedValue = ffi.Uint64 Function( - CXCursor C, -); + /// Objective-C's overall \@try-\@catch-\@finally statement. + static const int CXCursor_ObjCAtTryStmt = 216; -typedef _dart_clang_getEnumConstantDeclUnsignedValue = int Function( - CXCursor C, -); + /// Objective-C's \@catch statement. + static const int CXCursor_ObjCAtCatchStmt = 217; -typedef Native_clang_getFieldDeclBitWidth = ffi.Int32 Function( - CXCursor C, -); + /// Objective-C's \@finally statement. + static const int CXCursor_ObjCAtFinallyStmt = 218; -typedef _dart_clang_getFieldDeclBitWidth = int Function( - CXCursor C, -); + /// Objective-C's \@throw statement. + static const int CXCursor_ObjCAtThrowStmt = 219; -typedef Native_clang_Cursor_getNumArguments = ffi.Int32 Function( - CXCursor C, -); + /// Objective-C's \@synchronized statement. + static const int CXCursor_ObjCAtSynchronizedStmt = 220; -typedef _dart_clang_Cursor_getNumArguments = int Function( - CXCursor C, -); + /// Objective-C's autorelease pool statement. + static const int CXCursor_ObjCAutoreleasePoolStmt = 221; -typedef Native_clang_Cursor_getArgument = CXCursor Function( - CXCursor C, - ffi.Uint32 i, -); + /// Objective-C's collection statement. + static const int CXCursor_ObjCForCollectionStmt = 222; -typedef _dart_clang_Cursor_getArgument = CXCursor Function( - CXCursor C, - int i, -); + /// C++'s catch statement. + static const int CXCursor_CXXCatchStmt = 223; -typedef Native_clang_Cursor_getNumTemplateArguments = ffi.Int32 Function( - CXCursor C, -); + /// C++'s try statement. + static const int CXCursor_CXXTryStmt = 224; -typedef _dart_clang_Cursor_getNumTemplateArguments = int Function( - CXCursor C, -); + /// C++'s for (* : *) statement. + static const int CXCursor_CXXForRangeStmt = 225; -typedef Native_clang_Cursor_getTemplateArgumentKind = ffi.Int32 Function( - CXCursor C, - ffi.Uint32 I, -); + /// Windows Structured Exception Handling's try statement. + static const int CXCursor_SEHTryStmt = 226; -typedef _dart_clang_Cursor_getTemplateArgumentKind = int Function( - CXCursor C, - int I, -); + /// Windows Structured Exception Handling's except statement. + static const int CXCursor_SEHExceptStmt = 227; -typedef Native_clang_Cursor_getTemplateArgumentType = CXType Function( - CXCursor C, - ffi.Uint32 I, -); + /// Windows Structured Exception Handling's finally statement. + static const int CXCursor_SEHFinallyStmt = 228; -typedef _dart_clang_Cursor_getTemplateArgumentType = CXType Function( - CXCursor C, - int I, -); + /// A MS inline assembly statement extension. + static const int CXCursor_MSAsmStmt = 229; -typedef Native_clang_Cursor_getTemplateArgumentValue = ffi.Int64 Function( - CXCursor C, - ffi.Uint32 I, -); + /// The null statement ";": C99 6.8.3p3. + /// + /// This cursor kind is used to describe the null statement. + static const int CXCursor_NullStmt = 230; -typedef _dart_clang_Cursor_getTemplateArgumentValue = int Function( - CXCursor C, - int I, -); + /// Adaptor class for mixing declarations with statements and + /// expressions. + static const int CXCursor_DeclStmt = 231; -typedef Native_clang_Cursor_getTemplateArgumentUnsignedValue = ffi.Uint64 - Function( - CXCursor C, - ffi.Uint32 I, -); - -typedef _dart_clang_Cursor_getTemplateArgumentUnsignedValue = int Function( - CXCursor C, - int I, -); - -typedef Native_clang_equalTypes = ffi.Uint32 Function( - CXType A, - CXType B, -); - -typedef _dart_clang_equalTypes = int Function( - CXType A, - CXType B, -); - -typedef Native_clang_getCanonicalType = CXType Function( - CXType T, -); - -typedef _dart_clang_getCanonicalType = CXType Function( - CXType T, -); - -typedef Native_clang_isConstQualifiedType = ffi.Uint32 Function( - CXType T, -); - -typedef _dart_clang_isConstQualifiedType = int Function( - CXType T, -); + /// OpenMP parallel directive. + static const int CXCursor_OMPParallelDirective = 232; -typedef Native_clang_Cursor_isMacroFunctionLike = ffi.Uint32 Function( - CXCursor C, -); + /// OpenMP SIMD directive. + static const int CXCursor_OMPSimdDirective = 233; -typedef _dart_clang_Cursor_isMacroFunctionLike = int Function( - CXCursor C, -); + /// OpenMP for directive. + static const int CXCursor_OMPForDirective = 234; -typedef Native_clang_Cursor_isMacroBuiltin = ffi.Uint32 Function( - CXCursor C, -); + /// OpenMP sections directive. + static const int CXCursor_OMPSectionsDirective = 235; -typedef _dart_clang_Cursor_isMacroBuiltin = int Function( - CXCursor C, -); + /// OpenMP section directive. + static const int CXCursor_OMPSectionDirective = 236; -typedef Native_clang_Cursor_isFunctionInlined = ffi.Uint32 Function( - CXCursor C, -); + /// OpenMP single directive. + static const int CXCursor_OMPSingleDirective = 237; -typedef _dart_clang_Cursor_isFunctionInlined = int Function( - CXCursor C, -); + /// OpenMP parallel for directive. + static const int CXCursor_OMPParallelForDirective = 238; -typedef Native_clang_isVolatileQualifiedType = ffi.Uint32 Function( - CXType T, -); + /// OpenMP parallel sections directive. + static const int CXCursor_OMPParallelSectionsDirective = 239; -typedef _dart_clang_isVolatileQualifiedType = int Function( - CXType T, -); + /// OpenMP task directive. + static const int CXCursor_OMPTaskDirective = 240; -typedef Native_clang_isRestrictQualifiedType = ffi.Uint32 Function( - CXType T, -); + /// OpenMP master directive. + static const int CXCursor_OMPMasterDirective = 241; -typedef _dart_clang_isRestrictQualifiedType = int Function( - CXType T, -); + /// OpenMP critical directive. + static const int CXCursor_OMPCriticalDirective = 242; -typedef Native_clang_getAddressSpace = ffi.Uint32 Function( - CXType T, -); + /// OpenMP taskyield directive. + static const int CXCursor_OMPTaskyieldDirective = 243; -typedef _dart_clang_getAddressSpace = int Function( - CXType T, -); + /// OpenMP barrier directive. + static const int CXCursor_OMPBarrierDirective = 244; -typedef Native_clang_getTypedefName = CXString Function( - CXType CT, -); + /// OpenMP taskwait directive. + static const int CXCursor_OMPTaskwaitDirective = 245; -typedef _dart_clang_getTypedefName = CXString Function( - CXType CT, -); + /// OpenMP flush directive. + static const int CXCursor_OMPFlushDirective = 246; -typedef Native_clang_getPointeeType = CXType Function( - CXType T, -); + /// Windows Structured Exception Handling's leave statement. + static const int CXCursor_SEHLeaveStmt = 247; -typedef _dart_clang_getPointeeType = CXType Function( - CXType T, -); + /// OpenMP ordered directive. + static const int CXCursor_OMPOrderedDirective = 248; -typedef Native_clang_getTypeDeclaration = CXCursor Function( - CXType T, -); + /// OpenMP atomic directive. + static const int CXCursor_OMPAtomicDirective = 249; -typedef _dart_clang_getTypeDeclaration = CXCursor Function( - CXType T, -); + /// OpenMP for SIMD directive. + static const int CXCursor_OMPForSimdDirective = 250; -typedef Native_clang_getDeclObjCTypeEncoding = CXString Function( - CXCursor C, -); + /// OpenMP parallel for SIMD directive. + static const int CXCursor_OMPParallelForSimdDirective = 251; -typedef _dart_clang_getDeclObjCTypeEncoding = CXString Function( - CXCursor C, -); + /// OpenMP target directive. + static const int CXCursor_OMPTargetDirective = 252; -typedef Native_clang_Type_getObjCEncoding = CXString Function( - CXType type, -); + /// OpenMP teams directive. + static const int CXCursor_OMPTeamsDirective = 253; -typedef _dart_clang_Type_getObjCEncoding = CXString Function( - CXType type, -); + /// OpenMP taskgroup directive. + static const int CXCursor_OMPTaskgroupDirective = 254; -typedef Native_clang_getTypeKindSpelling = CXString Function( - ffi.Int32 K, -); + /// OpenMP cancellation point directive. + static const int CXCursor_OMPCancellationPointDirective = 255; -typedef _dart_clang_getTypeKindSpelling = CXString Function( - int K, -); + /// OpenMP cancel directive. + static const int CXCursor_OMPCancelDirective = 256; -typedef Native_clang_getFunctionTypeCallingConv = ffi.Int32 Function( - CXType T, -); + /// OpenMP target data directive. + static const int CXCursor_OMPTargetDataDirective = 257; -typedef _dart_clang_getFunctionTypeCallingConv = int Function( - CXType T, -); + /// OpenMP taskloop directive. + static const int CXCursor_OMPTaskLoopDirective = 258; -typedef Native_clang_getResultType = CXType Function( - CXType T, -); + /// OpenMP taskloop simd directive. + static const int CXCursor_OMPTaskLoopSimdDirective = 259; -typedef _dart_clang_getResultType = CXType Function( - CXType T, -); + /// OpenMP distribute directive. + static const int CXCursor_OMPDistributeDirective = 260; -typedef Native_clang_getExceptionSpecificationType = ffi.Int32 Function( - CXType T, -); + /// OpenMP target enter data directive. + static const int CXCursor_OMPTargetEnterDataDirective = 261; -typedef _dart_clang_getExceptionSpecificationType = int Function( - CXType T, -); + /// OpenMP target exit data directive. + static const int CXCursor_OMPTargetExitDataDirective = 262; -typedef Native_clang_getNumArgTypes = ffi.Int32 Function( - CXType T, -); + /// OpenMP target parallel directive. + static const int CXCursor_OMPTargetParallelDirective = 263; -typedef _dart_clang_getNumArgTypes = int Function( - CXType T, -); + /// OpenMP target parallel for directive. + static const int CXCursor_OMPTargetParallelForDirective = 264; -typedef Native_clang_getArgType = CXType Function( - CXType T, - ffi.Uint32 i, -); + /// OpenMP target update directive. + static const int CXCursor_OMPTargetUpdateDirective = 265; -typedef _dart_clang_getArgType = CXType Function( - CXType T, - int i, -); + /// OpenMP distribute parallel for directive. + static const int CXCursor_OMPDistributeParallelForDirective = 266; -typedef Native_clang_Type_getObjCObjectBaseType = CXType Function( - CXType T, -); + /// OpenMP distribute parallel for simd directive. + static const int CXCursor_OMPDistributeParallelForSimdDirective = 267; -typedef _dart_clang_Type_getObjCObjectBaseType = CXType Function( - CXType T, -); + /// OpenMP distribute simd directive. + static const int CXCursor_OMPDistributeSimdDirective = 268; -typedef Native_clang_Type_getNumObjCProtocolRefs = ffi.Uint32 Function( - CXType T, -); + /// OpenMP target parallel for simd directive. + static const int CXCursor_OMPTargetParallelForSimdDirective = 269; -typedef _dart_clang_Type_getNumObjCProtocolRefs = int Function( - CXType T, -); + /// OpenMP target simd directive. + static const int CXCursor_OMPTargetSimdDirective = 270; -typedef Native_clang_Type_getObjCProtocolDecl = CXCursor Function( - CXType T, - ffi.Uint32 i, -); + /// OpenMP teams distribute directive. + static const int CXCursor_OMPTeamsDistributeDirective = 271; -typedef _dart_clang_Type_getObjCProtocolDecl = CXCursor Function( - CXType T, - int i, -); + /// OpenMP teams distribute simd directive. + static const int CXCursor_OMPTeamsDistributeSimdDirective = 272; -typedef Native_clang_Type_getNumObjCTypeArgs = ffi.Uint32 Function( - CXType T, -); + /// OpenMP teams distribute parallel for simd directive. + static const int CXCursor_OMPTeamsDistributeParallelForSimdDirective = 273; -typedef _dart_clang_Type_getNumObjCTypeArgs = int Function( - CXType T, -); + /// OpenMP teams distribute parallel for directive. + static const int CXCursor_OMPTeamsDistributeParallelForDirective = 274; -typedef Native_clang_Type_getObjCTypeArg = CXType Function( - CXType T, - ffi.Uint32 i, -); + /// OpenMP target teams directive. + static const int CXCursor_OMPTargetTeamsDirective = 275; -typedef _dart_clang_Type_getObjCTypeArg = CXType Function( - CXType T, - int i, -); + /// OpenMP target teams distribute directive. + static const int CXCursor_OMPTargetTeamsDistributeDirective = 276; -typedef Native_clang_isFunctionTypeVariadic = ffi.Uint32 Function( - CXType T, -); + /// OpenMP target teams distribute parallel for directive. + static const int CXCursor_OMPTargetTeamsDistributeParallelForDirective = 277; -typedef _dart_clang_isFunctionTypeVariadic = int Function( - CXType T, -); + /// OpenMP target teams distribute parallel for simd directive. + static const int CXCursor_OMPTargetTeamsDistributeParallelForSimdDirective = + 278; -typedef Native_clang_getCursorResultType = CXType Function( - CXCursor C, -); + /// OpenMP target teams distribute simd directive. + static const int CXCursor_OMPTargetTeamsDistributeSimdDirective = 279; -typedef _dart_clang_getCursorResultType = CXType Function( - CXCursor C, -); + /// C++2a std::bit_cast expression. + static const int CXCursor_BuiltinBitCastExpr = 280; -typedef Native_clang_getCursorExceptionSpecificationType = ffi.Int32 Function( - CXCursor C, -); + /// OpenMP master taskloop directive. + static const int CXCursor_OMPMasterTaskLoopDirective = 281; -typedef _dart_clang_getCursorExceptionSpecificationType = int Function( - CXCursor C, -); + /// OpenMP parallel master taskloop directive. + static const int CXCursor_OMPParallelMasterTaskLoopDirective = 282; -typedef Native_clang_isPODType = ffi.Uint32 Function( - CXType T, -); + /// OpenMP master taskloop simd directive. + static const int CXCursor_OMPMasterTaskLoopSimdDirective = 283; -typedef _dart_clang_isPODType = int Function( - CXType T, -); + /// OpenMP parallel master taskloop simd directive. + static const int CXCursor_OMPParallelMasterTaskLoopSimdDirective = 284; -typedef Native_clang_getElementType = CXType Function( - CXType T, -); + /// OpenMP parallel master directive. + static const int CXCursor_OMPParallelMasterDirective = 285; + static const int CXCursor_LastStmt = 285; -typedef _dart_clang_getElementType = CXType Function( - CXType T, -); + /// Cursor that represents the translation unit itself. + /// + /// The translation unit cursor exists primarily to act as the root + /// cursor for traversing the contents of a translation unit. + static const int CXCursor_TranslationUnit = 300; + static const int CXCursor_FirstAttr = 400; -typedef Native_clang_getNumElements = ffi.Int64 Function( - CXType T, -); + /// 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; +} -typedef _dart_clang_getNumElements = int Function( - CXType T, -); +typedef Native_clang_getNullCursor = CXCursor Function(); +typedef Native_clang_getTranslationUnitCursor = CXCursor Function( + CXTranslationUnit arg0); +typedef Native_clang_equalCursors = ffi.Uint32 Function( + CXCursor arg0, CXCursor arg1); +typedef Native_clang_Cursor_isNull = ffi.Int32 Function(CXCursor cursor); +typedef Native_clang_hashCursor = ffi.Uint32 Function(CXCursor arg0); +typedef Native_clang_getCursorKind = ffi.Int32 Function(CXCursor arg0); +typedef Native_clang_isDeclaration = ffi.Uint32 Function(ffi.Int32 arg0); +typedef Native_clang_isInvalidDeclaration = ffi.Uint32 Function(CXCursor arg0); +typedef Native_clang_isReference = ffi.Uint32 Function(ffi.Int32 arg0); +typedef Native_clang_isExpression = ffi.Uint32 Function(ffi.Int32 arg0); +typedef Native_clang_isStatement = ffi.Uint32 Function(ffi.Int32 arg0); +typedef Native_clang_isAttribute = ffi.Uint32 Function(ffi.Int32 arg0); +typedef Native_clang_Cursor_hasAttrs = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_isInvalid = ffi.Uint32 Function(ffi.Int32 arg0); +typedef Native_clang_isTranslationUnit = ffi.Uint32 Function(ffi.Int32 arg0); +typedef Native_clang_isPreprocessing = ffi.Uint32 Function(ffi.Int32 arg0); +typedef Native_clang_isUnexposed = ffi.Uint32 Function(ffi.Int32 arg0); +typedef Native_clang_getCursorLinkage = ffi.Int32 Function(CXCursor cursor); + +/// 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; +} -typedef Native_clang_getArrayElementType = CXType Function( - CXType T, -); +typedef Native_clang_getCursorVisibility = ffi.Int32 Function(CXCursor cursor); -typedef _dart_clang_getArrayElementType = CXType Function( - CXType T, -); +abstract class CXVisibilityKind { + /// This value indicates that no visibility information is available + /// for a provided CXCursor. + static const int CXVisibility_Invalid = 0; -typedef Native_clang_getArraySize = ffi.Int64 Function( - CXType T, -); + /// Symbol not seen by the linker. + static const int CXVisibility_Hidden = 1; -typedef _dart_clang_getArraySize = int Function( - CXType T, -); + /// Symbol seen by the linker but resolves to a symbol inside this object. + static const int CXVisibility_Protected = 2; -typedef Native_clang_Type_getNamedType = CXType Function( - CXType T, -); + /// Symbol seen by the linker and acts like a normal symbol. + static const int CXVisibility_Default = 3; +} -typedef _dart_clang_Type_getNamedType = CXType Function( - CXType T, -); +typedef Native_clang_getCursorAvailability = ffi.Int32 Function( + CXCursor cursor); -typedef Native_clang_Type_isTransparentTagTypedef = ffi.Uint32 Function( - CXType T, -); +/// 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; -typedef _dart_clang_Type_isTransparentTagTypedef = int Function( - CXType T, -); + /// The entity is available, but has been deprecated (and its use is + /// not recommended). + static const int CXAvailability_Deprecated = 1; -typedef Native_clang_Type_getNullability = ffi.Int32 Function( - CXType T, -); + /// The entity is not available; any use of it will be an error. + static const int CXAvailability_NotAvailable = 2; -typedef _dart_clang_Type_getNullability = int Function( - CXType T, -); + /// The entity is available, but not accessible; any use of it will be + /// an error. + static const int CXAvailability_NotAccessible = 3; +} -typedef Native_clang_Type_getAlignOf = ffi.Int64 Function( - CXType T, -); +/// 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; -typedef _dart_clang_Type_getAlignOf = int Function( - CXType T, -); + /// The version number in which this entity was introduced. + external CXVersion Introduced; -typedef Native_clang_Type_getClassType = CXType Function( - CXType T, -); + /// The version number in which this entity was deprecated (but is + /// still available). + external CXVersion Deprecated; -typedef _dart_clang_Type_getClassType = CXType Function( - CXType T, -); + /// The version number in which this entity was obsoleted, and therefore + /// is no longer available. + external CXVersion Obsoleted; -typedef Native_clang_Type_getSizeOf = ffi.Int64 Function( - CXType T, -); + /// Whether the entity is unconditionally unavailable on this platform. + @ffi.Int32() + external int Unavailable; -typedef _dart_clang_Type_getSizeOf = int Function( - CXType T, -); + /// An optional message to provide to a user of this API, e.g., to + /// suggest replacement APIs. + external CXString Message; +} -typedef Native_clang_Type_getOffsetOf = ffi.Int64 Function( - CXType T, - ffi.Pointer S, -); +typedef Native_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 Native_clang_disposeCXPlatformAvailability = ffi.Void Function( + ffi.Pointer availability); +typedef Native_clang_getCursorLanguage = ffi.Int32 Function(CXCursor cursor); + +/// 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_Type_getOffsetOf = int Function( - CXType T, - ffi.Pointer S, -); +typedef Native_clang_getCursorTLSKind = ffi.Int32 Function(CXCursor cursor); -typedef Native_clang_Type_getModifiedType = CXType Function( - CXType T, -); +/// 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 _dart_clang_Type_getModifiedType = CXType Function( - CXType T, -); +typedef Native_clang_Cursor_getTranslationUnit = CXTranslationUnit Function( + CXCursor arg0); -typedef Native_clang_Cursor_getOffsetOfField = ffi.Int64 Function( - CXCursor C, -); +class CXCursorSetImpl extends ffi.Opaque {} -typedef _dart_clang_Cursor_getOffsetOfField = int Function( - CXCursor C, -); +typedef Native_clang_createCXCursorSet = CXCursorSet Function(); -typedef Native_clang_Cursor_isAnonymous = ffi.Uint32 Function( - CXCursor C, -); +/// A fast container representing a set of CXCursors. +typedef CXCursorSet = ffi.Pointer; +typedef Native_clang_disposeCXCursorSet = ffi.Void Function(CXCursorSet cset); +typedef Native_clang_CXCursorSet_contains = ffi.Uint32 Function( + CXCursorSet cset, CXCursor cursor); +typedef Native_clang_CXCursorSet_insert = ffi.Uint32 Function( + CXCursorSet cset, CXCursor cursor); +typedef Native_clang_getCursorSemanticParent = CXCursor Function( + CXCursor cursor); +typedef Native_clang_getCursorLexicalParent = CXCursor Function( + CXCursor cursor); +typedef Native_clang_getOverriddenCursors = ffi.Void Function( + CXCursor cursor, + ffi.Pointer> overridden, + ffi.Pointer num_overridden); +typedef Native_clang_disposeOverriddenCursors = ffi.Void Function( + ffi.Pointer overridden); +typedef Native_clang_getIncludedFile = CXFile Function(CXCursor cursor); +typedef Native_clang_getCursor = CXCursor Function( + CXTranslationUnit arg0, CXSourceLocation arg1); +typedef Native_clang_getCursorLocation = CXSourceLocation Function( + CXCursor arg0); +typedef Native_clang_getCursorExtent = CXSourceRange Function(CXCursor arg0); -typedef _dart_clang_Cursor_isAnonymous = int Function( - CXCursor 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; -typedef Native_clang_Cursor_isAnonymousRecordDecl = ffi.Uint32 Function( - CXCursor C, -); + /// 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_Cursor_isAnonymousRecordDecl = int Function( - CXCursor C, -); + /// 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; +} -typedef Native_clang_Cursor_isInlineNamespace = ffi.Uint32 Function( - CXCursor C, -); +/// The type of an element in the abstract syntax tree. +class CXType extends ffi.Struct { + @ffi.Int32() + external int kind; -typedef _dart_clang_Cursor_isInlineNamespace = int Function( - CXCursor C, -); + @ffi.Array.multi([2]) + external ffi.Array> data; +} -typedef Native_clang_Type_getNumTemplateArguments = ffi.Int32 Function( - CXType T, -); +typedef Native_clang_getCursorType = CXType Function(CXCursor C); +typedef Native_clang_getTypeSpelling = CXString Function(CXType CT); +typedef Native_clang_getTypedefDeclUnderlyingType = CXType Function(CXCursor C); +typedef Native_clang_getEnumDeclIntegerType = CXType Function(CXCursor C); +typedef Native_clang_getEnumConstantDeclValue = ffi.Int64 Function(CXCursor C); +typedef Native_clang_getEnumConstantDeclUnsignedValue = ffi.Uint64 Function( + CXCursor C); +typedef Native_clang_getFieldDeclBitWidth = ffi.Int32 Function(CXCursor C); +typedef Native_clang_Cursor_getNumArguments = ffi.Int32 Function(CXCursor C); +typedef Native_clang_Cursor_getArgument = CXCursor Function( + CXCursor C, ffi.Uint32 i); +typedef Native_clang_Cursor_getNumTemplateArguments = ffi.Int32 Function( + CXCursor C); +typedef Native_clang_Cursor_getTemplateArgumentKind = ffi.Int32 Function( + CXCursor C, ffi.Uint32 I); -typedef _dart_clang_Type_getNumTemplateArguments = int Function( - CXType T, -); +/// Describes the kind of a template argument. +/// +/// See the definition of llvm::clang::TemplateArgument::ArgKind for full +/// element descriptions. +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 Native_clang_Type_getTemplateArgumentAsType = CXType Function( - CXType T, - ffi.Uint32 i, -); +typedef Native_clang_Cursor_getTemplateArgumentType = CXType Function( + CXCursor C, ffi.Uint32 I); +typedef Native_clang_Cursor_getTemplateArgumentValue = ffi.Int64 Function( + CXCursor C, ffi.Uint32 I); +typedef Native_clang_Cursor_getTemplateArgumentUnsignedValue = ffi.Uint64 + Function(CXCursor C, ffi.Uint32 I); +typedef Native_clang_equalTypes = ffi.Uint32 Function(CXType A, CXType B); +typedef Native_clang_getCanonicalType = CXType Function(CXType T); +typedef Native_clang_isConstQualifiedType = ffi.Uint32 Function(CXType T); +typedef Native_clang_Cursor_isMacroFunctionLike = ffi.Uint32 Function( + CXCursor C); +typedef Native_clang_Cursor_isMacroBuiltin = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_Cursor_isFunctionInlined = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_isVolatileQualifiedType = ffi.Uint32 Function(CXType T); +typedef Native_clang_isRestrictQualifiedType = ffi.Uint32 Function(CXType T); +typedef Native_clang_getAddressSpace = ffi.Uint32 Function(CXType T); +typedef Native_clang_getTypedefName = CXString Function(CXType CT); +typedef Native_clang_getPointeeType = CXType Function(CXType T); +typedef Native_clang_getTypeDeclaration = CXCursor Function(CXType T); +typedef Native_clang_getDeclObjCTypeEncoding = CXString Function(CXCursor C); +typedef Native_clang_Type_getObjCEncoding = CXString Function(CXType type); +typedef Native_clang_getTypeKindSpelling = CXString Function(ffi.Int32 K); +typedef Native_clang_getFunctionTypeCallingConv = ffi.Int32 Function(CXType T); + +/// 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_Type_getTemplateArgumentAsType = CXType Function( - CXType T, - int i, -); +typedef Native_clang_getResultType = CXType Function(CXType T); +typedef Native_clang_getExceptionSpecificationType = ffi.Int32 Function( + CXType T); +typedef Native_clang_getNumArgTypes = ffi.Int32 Function(CXType T); +typedef Native_clang_getArgType = CXType Function(CXType T, ffi.Uint32 i); +typedef Native_clang_Type_getObjCObjectBaseType = CXType Function(CXType T); +typedef Native_clang_Type_getNumObjCProtocolRefs = ffi.Uint32 Function( + CXType T); +typedef Native_clang_Type_getObjCProtocolDecl = CXCursor Function( + CXType T, ffi.Uint32 i); +typedef Native_clang_Type_getNumObjCTypeArgs = ffi.Uint32 Function(CXType T); +typedef Native_clang_Type_getObjCTypeArg = CXType Function( + CXType T, ffi.Uint32 i); +typedef Native_clang_isFunctionTypeVariadic = ffi.Uint32 Function(CXType T); +typedef Native_clang_getCursorResultType = CXType Function(CXCursor C); +typedef Native_clang_getCursorExceptionSpecificationType = ffi.Int32 Function( + CXCursor C); +typedef Native_clang_isPODType = ffi.Uint32 Function(CXType T); +typedef Native_clang_getElementType = CXType Function(CXType T); +typedef Native_clang_getNumElements = ffi.Int64 Function(CXType T); +typedef Native_clang_getArrayElementType = CXType Function(CXType T); +typedef Native_clang_getArraySize = ffi.Int64 Function(CXType T); +typedef Native_clang_Type_getNamedType = CXType Function(CXType T); +typedef Native_clang_Type_isTransparentTagTypedef = ffi.Uint32 Function( + CXType T); +typedef Native_clang_Type_getNullability = ffi.Int32 Function(CXType T); -typedef Native_clang_Type_getCXXRefQualifier = ffi.Int32 Function( - CXType T, -); +abstract class CXTypeNullabilityKind { + /// Values of this type can never be null. + static const int CXTypeNullability_NonNull = 0; -typedef _dart_clang_Type_getCXXRefQualifier = int Function( - CXType T, -); + /// Values of this type can be null. + static const int CXTypeNullability_Nullable = 1; -typedef Native_clang_Cursor_isBitField = ffi.Uint32 Function( - CXCursor C, -); + /// 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_Cursor_isBitField = int Function( - CXCursor C, -); + /// Nullability is not applicable to this type. + static const int CXTypeNullability_Invalid = 3; +} -typedef Native_clang_isVirtualBase = ffi.Uint32 Function( - CXCursor arg0, -); +typedef Native_clang_Type_getAlignOf = ffi.Int64 Function(CXType T); +typedef Native_clang_Type_getClassType = CXType Function(CXType T); +typedef Native_clang_Type_getSizeOf = ffi.Int64 Function(CXType T); +typedef Native_clang_Type_getOffsetOf = ffi.Int64 Function( + CXType T, ffi.Pointer S); +typedef Native_clang_Type_getModifiedType = CXType Function(CXType T); +typedef Native_clang_Cursor_getOffsetOfField = ffi.Int64 Function(CXCursor C); +typedef Native_clang_Cursor_isAnonymous = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_Cursor_isAnonymousRecordDecl = ffi.Uint32 Function( + CXCursor C); +typedef Native_clang_Cursor_isInlineNamespace = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_Type_getNumTemplateArguments = ffi.Int32 Function( + CXType T); +typedef Native_clang_Type_getTemplateArgumentAsType = CXType Function( + CXType T, ffi.Uint32 i); +typedef Native_clang_Type_getCXXRefQualifier = ffi.Int32 Function(CXType T); -typedef _dart_clang_isVirtualBase = int Function( - CXCursor arg0, -); +abstract class CXRefQualifierKind { + /// No ref-qualifier was provided. + static const int CXRefQualifier_None = 0; -typedef Native_clang_getCXXAccessSpecifier = ffi.Int32 Function( - CXCursor arg0, -); + /// An lvalue ref-qualifier was provided (\c &). + static const int CXRefQualifier_LValue = 1; -typedef _dart_clang_getCXXAccessSpecifier = int Function( - CXCursor arg0, -); + /// An rvalue ref-qualifier was provided (\c &&). + static const int CXRefQualifier_RValue = 2; +} -typedef Native_clang_Cursor_getStorageClass = ffi.Int32 Function( - CXCursor arg0, -); +typedef Native_clang_Cursor_isBitField = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_isVirtualBase = ffi.Uint32 Function(CXCursor arg0); +typedef Native_clang_getCXXAccessSpecifier = ffi.Int32 Function(CXCursor arg0); + +/// 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 _dart_clang_Cursor_getStorageClass = int Function( - CXCursor arg0, -); +typedef Native_clang_Cursor_getStorageClass = ffi.Int32 Function(CXCursor arg0); + +/// 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 Native_clang_getNumOverloadedDecls = ffi.Uint32 Function( - CXCursor cursor, -); - -typedef _dart_clang_getNumOverloadedDecls = int Function( - CXCursor cursor, -); - + CXCursor cursor); typedef Native_clang_getOverloadedDecl = CXCursor Function( - CXCursor cursor, - ffi.Uint32 index, -); - -typedef _dart_clang_getOverloadedDecl = CXCursor Function( - CXCursor cursor, - int index, -); - -typedef Native_clang_getIBOutletCollectionType = CXType Function( - CXCursor arg0, -); - -typedef _dart_clang_getIBOutletCollectionType = CXType Function( - CXCursor arg0, -); - -typedef CXCursorVisitor = ffi.Int32 Function( - CXCursor, - CXCursor, - ffi.Pointer, -); - + CXCursor cursor, ffi.Uint32 index); +typedef Native_clang_getIBOutletCollectionType = CXType Function(CXCursor arg0); typedef Native_clang_visitChildren = ffi.Uint32 Function( - CXCursor parent, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); - -typedef _dart_clang_visitChildren = int Function( - CXCursor parent, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); + CXCursor parent, CXCursorVisitor visitor, CXClientData client_data); -typedef Native_clang_getCursorUSR = CXString Function( - CXCursor arg0, -); +/// Visitor invoked for each cursor found by a traversal. +/// +/// This visitor function will be invoked for each cursor found by +/// clang_visitCursorChildren(). Its first argument is the cursor being +/// visited, its second argument is the parent visitor for that cursor, +/// and its third argument is the client data provided to +/// clang_visitCursorChildren(). +/// +/// The visitor should return one of the \c CXChildVisitResult values +/// to direct clang_visitCursorChildren(). +typedef CXCursorVisitor = ffi.Pointer< + ffi.NativeFunction>; -typedef _dart_clang_getCursorUSR = CXString Function( - CXCursor arg0, -); +/// Describes how the traversal of the children of a particular +/// cursor should proceed after visiting a particular child cursor. +/// +/// A value of this enumeration type should be returned by each +/// \c CXCursorVisitor to indicate how clang_visitChildren() proceed. +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; +} +/// Opaque pointer representing client data that will be passed through +/// to various callbacks and visitors. +typedef CXClientData = ffi.Pointer; +typedef Native_clang_getCursorUSR = CXString Function(CXCursor arg0); typedef Native_clang_constructUSR_ObjCClass = CXString Function( - ffi.Pointer class_name, -); - -typedef _dart_clang_constructUSR_ObjCClass = CXString Function( - ffi.Pointer class_name, -); - + ffi.Pointer class_name); typedef Native_clang_constructUSR_ObjCCategory = CXString Function( - ffi.Pointer class_name, - ffi.Pointer category_name, -); - -typedef _dart_clang_constructUSR_ObjCCategory = CXString Function( - ffi.Pointer class_name, - ffi.Pointer category_name, -); - + ffi.Pointer class_name, ffi.Pointer category_name); typedef Native_clang_constructUSR_ObjCProtocol = CXString Function( - ffi.Pointer protocol_name, -); - -typedef _dart_clang_constructUSR_ObjCProtocol = CXString Function( - ffi.Pointer protocol_name, -); - + ffi.Pointer protocol_name); typedef Native_clang_constructUSR_ObjCIvar = CXString Function( - ffi.Pointer name, - CXString classUSR, -); - -typedef _dart_clang_constructUSR_ObjCIvar = CXString Function( - ffi.Pointer name, - CXString classUSR, -); - + ffi.Pointer name, CXString classUSR); typedef Native_clang_constructUSR_ObjCMethod = CXString Function( - ffi.Pointer name, - ffi.Uint32 isInstanceMethod, - CXString classUSR, -); - -typedef _dart_clang_constructUSR_ObjCMethod = CXString Function( - ffi.Pointer name, - int isInstanceMethod, - CXString classUSR, -); - + ffi.Pointer name, ffi.Uint32 isInstanceMethod, CXString classUSR); typedef Native_clang_constructUSR_ObjCProperty = CXString Function( - ffi.Pointer property, - CXString classUSR, -); - -typedef _dart_clang_constructUSR_ObjCProperty = CXString Function( - ffi.Pointer property, - CXString classUSR, -); - -typedef Native_clang_getCursorSpelling = CXString Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorSpelling = CXString Function( - CXCursor arg0, -); - + ffi.Pointer property, CXString classUSR); +typedef Native_clang_getCursorSpelling = CXString Function(CXCursor arg0); typedef Native_clang_Cursor_getSpellingNameRange = CXSourceRange Function( - CXCursor arg0, - ffi.Uint32 pieceIndex, - ffi.Uint32 options, -); - -typedef _dart_clang_Cursor_getSpellingNameRange = CXSourceRange Function( - CXCursor arg0, - int pieceIndex, - int options, -); - + CXCursor arg0, ffi.Uint32 pieceIndex, ffi.Uint32 options); typedef Native_clang_PrintingPolicy_getProperty = ffi.Uint32 Function( - ffi.Pointer Policy, - ffi.Int32 Property, -); - -typedef _dart_clang_PrintingPolicy_getProperty = int Function( - ffi.Pointer Policy, - int Property, -); - -typedef Native_clang_PrintingPolicy_setProperty = ffi.Void Function( - ffi.Pointer Policy, - ffi.Int32 Property, - ffi.Uint32 Value, -); - -typedef _dart_clang_PrintingPolicy_setProperty = void Function( - ffi.Pointer Policy, - int Property, - int Value, -); + CXPrintingPolicy Policy, ffi.Int32 Property); -typedef Native_clang_getCursorPrintingPolicy = ffi.Pointer Function( - CXCursor arg0, -); +/// Opaque pointer representing a policy that controls pretty printing +/// for \c clang_getCursorPrettyPrinted. +typedef CXPrintingPolicy = ffi.Pointer; -typedef _dart_clang_getCursorPrintingPolicy = ffi.Pointer Function( - CXCursor arg0, -); +/// Properties for the printing policy. +/// +/// See \c clang::PrintingPolicy for more information. +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 Native_clang_PrintingPolicy_setProperty = ffi.Void Function( + CXPrintingPolicy Policy, ffi.Int32 Property, ffi.Uint32 Value); +typedef Native_clang_getCursorPrintingPolicy = CXPrintingPolicy Function( + CXCursor arg0); typedef Native_clang_PrintingPolicy_dispose = ffi.Void Function( - ffi.Pointer Policy, -); - -typedef _dart_clang_PrintingPolicy_dispose = void Function( - ffi.Pointer Policy, -); - + CXPrintingPolicy Policy); typedef Native_clang_getCursorPrettyPrinted = CXString Function( - CXCursor Cursor, - ffi.Pointer Policy, -); - -typedef _dart_clang_getCursorPrettyPrinted = CXString Function( - CXCursor Cursor, - ffi.Pointer Policy, -); - -typedef Native_clang_getCursorDisplayName = CXString Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorDisplayName = CXString Function( - CXCursor arg0, -); - -typedef Native_clang_getCursorReferenced = CXCursor Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorReferenced = CXCursor Function( - CXCursor arg0, -); - -typedef Native_clang_getCursorDefinition = CXCursor Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorDefinition = CXCursor Function( - CXCursor arg0, -); - -typedef Native_clang_isCursorDefinition = ffi.Uint32 Function( - CXCursor arg0, -); - -typedef _dart_clang_isCursorDefinition = int Function( - CXCursor arg0, -); - -typedef Native_clang_getCanonicalCursor = CXCursor Function( - CXCursor arg0, -); - -typedef _dart_clang_getCanonicalCursor = CXCursor Function( - CXCursor arg0, -); - + CXCursor Cursor, CXPrintingPolicy Policy); +typedef Native_clang_getCursorDisplayName = CXString Function(CXCursor arg0); +typedef Native_clang_getCursorReferenced = CXCursor Function(CXCursor arg0); +typedef Native_clang_getCursorDefinition = CXCursor Function(CXCursor arg0); +typedef Native_clang_isCursorDefinition = ffi.Uint32 Function(CXCursor arg0); +typedef Native_clang_getCanonicalCursor = CXCursor Function(CXCursor arg0); typedef Native_clang_Cursor_getObjCSelectorIndex = ffi.Int32 Function( - CXCursor arg0, -); - -typedef _dart_clang_Cursor_getObjCSelectorIndex = int Function( - CXCursor arg0, -); - -typedef Native_clang_Cursor_isDynamicCall = ffi.Int32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isDynamicCall = int Function( - CXCursor C, -); - -typedef Native_clang_Cursor_getReceiverType = CXType Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getReceiverType = CXType Function( - CXCursor C, -); - + CXCursor arg0); +typedef Native_clang_Cursor_isDynamicCall = ffi.Int32 Function(CXCursor C); +typedef Native_clang_Cursor_getReceiverType = CXType Function(CXCursor C); typedef Native_clang_Cursor_getObjCPropertyAttributes = ffi.Uint32 Function( - CXCursor C, - ffi.Uint32 reserved, -); - -typedef _dart_clang_Cursor_getObjCPropertyAttributes = int Function( - CXCursor C, - int reserved, -); - + CXCursor C, ffi.Uint32 reserved); typedef Native_clang_Cursor_getObjCPropertyGetterName = CXString Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getObjCPropertyGetterName = CXString Function( - CXCursor C, -); - + CXCursor C); typedef Native_clang_Cursor_getObjCPropertySetterName = CXString Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getObjCPropertySetterName = CXString Function( - CXCursor C, -); - + CXCursor C); typedef Native_clang_Cursor_getObjCDeclQualifiers = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getObjCDeclQualifiers = int Function( - CXCursor C, -); - -typedef Native_clang_Cursor_isObjCOptional = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isObjCOptional = int Function( - CXCursor C, -); - -typedef Native_clang_Cursor_isVariadic = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isVariadic = int Function( - CXCursor C, -); - + CXCursor C); +typedef Native_clang_Cursor_isObjCOptional = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_Cursor_isVariadic = ffi.Uint32 Function(CXCursor C); typedef Native_clang_Cursor_isExternalSymbol = ffi.Uint32 Function( - CXCursor C, - ffi.Pointer language, - ffi.Pointer definedIn, - ffi.Pointer isGenerated, -); - -typedef _dart_clang_Cursor_isExternalSymbol = int Function( - CXCursor C, - ffi.Pointer language, - ffi.Pointer definedIn, - ffi.Pointer isGenerated, -); - + CXCursor C, + ffi.Pointer language, + ffi.Pointer definedIn, + ffi.Pointer isGenerated); typedef Native_clang_Cursor_getCommentRange = CXSourceRange Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getCommentRange = CXSourceRange Function( - CXCursor C, -); - -typedef Native_clang_Cursor_getRawCommentText = CXString Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getRawCommentText = CXString Function( - CXCursor C, -); - -typedef Native_clang_Cursor_getBriefCommentText = CXString Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getBriefCommentText = CXString Function( - CXCursor C, -); - -typedef Native_clang_Cursor_getMangling = CXString Function( - CXCursor arg0, -); - -typedef _dart_clang_Cursor_getMangling = CXString Function( - CXCursor arg0, -); - + CXCursor C); +typedef Native_clang_Cursor_getRawCommentText = CXString Function(CXCursor C); +typedef Native_clang_Cursor_getBriefCommentText = CXString Function(CXCursor C); +typedef Native_clang_Cursor_getMangling = CXString Function(CXCursor arg0); typedef Native_clang_Cursor_getCXXManglings = ffi.Pointer Function( - CXCursor arg0, -); - -typedef _dart_clang_Cursor_getCXXManglings = ffi.Pointer Function( - CXCursor arg0, -); - + CXCursor arg0); typedef Native_clang_Cursor_getObjCManglings = ffi.Pointer - Function( - CXCursor arg0, -); - -typedef _dart_clang_Cursor_getObjCManglings = ffi.Pointer Function( - CXCursor arg0, -); - -typedef Native_clang_Cursor_getModule = ffi.Pointer Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getModule = ffi.Pointer Function( - CXCursor C, -); - -typedef Native_clang_getModuleForFile = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _dart_clang_getModuleForFile = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef Native_clang_Module_getASTFile = ffi.Pointer Function( - ffi.Pointer Module, -); - -typedef _dart_clang_Module_getASTFile = ffi.Pointer Function( - ffi.Pointer Module, -); - -typedef Native_clang_Module_getParent = ffi.Pointer Function( - ffi.Pointer Module, -); - -typedef _dart_clang_Module_getParent = ffi.Pointer Function( - ffi.Pointer Module, -); - -typedef Native_clang_Module_getName = CXString Function( - ffi.Pointer Module, -); - -typedef _dart_clang_Module_getName = CXString Function( - ffi.Pointer Module, -); - -typedef Native_clang_Module_getFullName = CXString Function( - ffi.Pointer Module, -); - -typedef _dart_clang_Module_getFullName = CXString Function( - ffi.Pointer Module, -); - -typedef Native_clang_Module_isSystem = ffi.Int32 Function( - ffi.Pointer Module, -); - -typedef _dart_clang_Module_isSystem = int Function( - ffi.Pointer Module, -); + Function(CXCursor arg0); +typedef Native_clang_Cursor_getModule = CXModule Function(CXCursor C); +/// \defgroup CINDEX_MODULE Module introspection +/// +/// The functions in this group provide access to information about modules. +/// +/// @{ +typedef CXModule = ffi.Pointer; +typedef Native_clang_getModuleForFile = CXModule Function( + CXTranslationUnit arg0, CXFile arg1); +typedef Native_clang_Module_getASTFile = CXFile Function(CXModule Module); +typedef Native_clang_Module_getParent = CXModule Function(CXModule Module); +typedef Native_clang_Module_getName = CXString Function(CXModule Module); +typedef Native_clang_Module_getFullName = CXString Function(CXModule Module); +typedef Native_clang_Module_isSystem = ffi.Int32 Function(CXModule Module); typedef Native_clang_Module_getNumTopLevelHeaders = ffi.Uint32 Function( - ffi.Pointer arg0, - ffi.Pointer Module, -); - -typedef _dart_clang_Module_getNumTopLevelHeaders = int Function( - ffi.Pointer arg0, - ffi.Pointer Module, -); - -typedef Native_clang_Module_getTopLevelHeader = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer Module, - ffi.Uint32 Index, -); - -typedef _dart_clang_Module_getTopLevelHeader = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer Module, - int Index, -); - + CXTranslationUnit arg0, CXModule Module); +typedef Native_clang_Module_getTopLevelHeader = CXFile Function( + CXTranslationUnit arg0, CXModule Module, ffi.Uint32 Index); typedef Native_clang_CXXConstructor_isConvertingConstructor = ffi.Uint32 - Function( - CXCursor C, -); - -typedef _dart_clang_CXXConstructor_isConvertingConstructor = int Function( - CXCursor C, -); - + Function(CXCursor C); typedef Native_clang_CXXConstructor_isCopyConstructor = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXConstructor_isCopyConstructor = int Function( - CXCursor C, -); - + CXCursor C); typedef Native_clang_CXXConstructor_isDefaultConstructor = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXConstructor_isDefaultConstructor = int Function( - CXCursor C, -); - + CXCursor C); typedef Native_clang_CXXConstructor_isMoveConstructor = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXConstructor_isMoveConstructor = int Function( - CXCursor C, -); - -typedef Native_clang_CXXField_isMutable = ffi.Uint32 Function( - CXCursor C, -); + CXCursor C); +typedef Native_clang_CXXField_isMutable = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_CXXMethod_isDefaulted = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_CXXMethod_isPureVirtual = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_CXXMethod_isStatic = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_CXXMethod_isVirtual = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_CXXRecord_isAbstract = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_EnumDecl_isScoped = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_CXXMethod_isConst = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_getTemplateCursorKind = ffi.Int32 Function(CXCursor C); +typedef Native_clang_getSpecializedCursorTemplate = CXCursor Function( + CXCursor C); +typedef Native_clang_getCursorReferenceNameRange = CXSourceRange Function( + CXCursor C, ffi.Uint32 NameFlags, ffi.Uint32 PieceIndex); -typedef _dart_clang_CXXField_isMutable = int Function( - CXCursor C, -); +/// Describes a single preprocessing token. +class CXToken extends ffi.Struct { + @ffi.Array.multi([4]) + external ffi.Array int_data; -typedef Native_clang_CXXMethod_isDefaulted = ffi.Uint32 Function( - CXCursor C, -); + external ffi.Pointer ptr_data; +} -typedef _dart_clang_CXXMethod_isDefaulted = int Function( - CXCursor C, -); +typedef Native_clang_getToken = ffi.Pointer Function( + CXTranslationUnit TU, CXSourceLocation Location); +typedef Native_clang_getTokenKind = ffi.Int32 Function(CXToken arg0); -typedef Native_clang_CXXMethod_isPureVirtual = ffi.Uint32 Function( - CXCursor C, -); +/// Describes a kind of token. +abstract class CXTokenKind { + /// A token that contains some kind of punctuation. + static const int CXToken_Punctuation = 0; -typedef _dart_clang_CXXMethod_isPureVirtual = int Function( - CXCursor C, -); + /// A language keyword. + static const int CXToken_Keyword = 1; -typedef Native_clang_CXXMethod_isStatic = ffi.Uint32 Function( - CXCursor C, -); + /// An identifier (that is not a keyword). + static const int CXToken_Identifier = 2; -typedef _dart_clang_CXXMethod_isStatic = int Function( - CXCursor C, -); + /// A numeric, string, or character literal. + static const int CXToken_Literal = 3; -typedef Native_clang_CXXMethod_isVirtual = ffi.Uint32 Function( - CXCursor C, -); + /// A comment. + static const int CXToken_Comment = 4; +} -typedef _dart_clang_CXXMethod_isVirtual = int Function( - CXCursor C, -); +typedef Native_clang_getTokenSpelling = CXString Function( + CXTranslationUnit arg0, CXToken arg1); +typedef Native_clang_getTokenLocation = CXSourceLocation Function( + CXTranslationUnit arg0, CXToken arg1); +typedef Native_clang_getTokenExtent = CXSourceRange Function( + CXTranslationUnit arg0, CXToken arg1); +typedef Native_clang_tokenize = ffi.Void Function( + CXTranslationUnit TU, + CXSourceRange Range, + ffi.Pointer> Tokens, + ffi.Pointer NumTokens); +typedef Native_clang_annotateTokens = ffi.Void Function( + CXTranslationUnit TU, + ffi.Pointer Tokens, + ffi.Uint32 NumTokens, + ffi.Pointer Cursors); +typedef Native_clang_disposeTokens = ffi.Void Function( + CXTranslationUnit TU, ffi.Pointer Tokens, ffi.Uint32 NumTokens); +typedef Native_clang_getCursorKindSpelling = CXString Function(ffi.Int32 Kind); +typedef Native_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 Native_clang_enableStackTraces = ffi.Void Function(); +typedef Native_clang_executeOnThread = ffi.Void Function( + ffi.Pointer)>> + fn, + ffi.Pointer user_data, + ffi.Uint32 stack_size); -typedef Native_clang_CXXRecord_isAbstract = 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_CXXRecord_isAbstract = int Function( - CXCursor C, -); + /// The code-completion string that describes how to insert this + /// code-completion result into the editing buffer. + external CXCompletionString CompletionString; +} -typedef Native_clang_EnumDecl_isScoped = ffi.Uint32 Function( - CXCursor C, -); +/// A semantic string that describes a code-completion result. +/// +/// A semantic string that describes the formatting of a code-completion +/// result as a single "template" of text that should be inserted into the +/// source buffer when a particular code-completion result is selected. +/// Each semantic string is made up of some number of "chunks", each of which +/// contains some text along with a description of what that text means, e.g., +/// the name of the entity being referenced, whether the text chunk is part of +/// the template, or whether it is a "placeholder" that the user should replace +/// with actual code,of a specific kind. See \c CXCompletionChunkKind for a +/// description of the different kinds of chunks. +typedef CXCompletionString = ffi.Pointer; +typedef Native_clang_getCompletionChunkKind = ffi.Int32 Function( + CXCompletionString completion_string, ffi.Uint32 chunk_number); -typedef _dart_clang_EnumDecl_isScoped = int Function( - CXCursor C, -); +/// Describes a single piece of text within a code-completion string. +/// +/// Each "chunk" within a code-completion string (\c CXCompletionString) is +/// either a piece of text with a specific "kind" that describes how that text +/// should be interpreted by the client or is another 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). + /// + /// The Optional chunk is the only kind of chunk that has a code-completion + /// string for its representation, which is accessible via + /// \c clang_getCompletionChunkCompletionString(). The code-completion string + /// describes an additional part of the template that is completely optional. + /// For example, optional chunks can be used to describe the placeholders for + /// arguments that match up with defaulted function parameters, e.g. given: + /// + /// \code + /// void f(int x, float y = 3.14, double z = 2.71828); + /// \endcode + /// + /// The code-completion string for this function would contain: + /// - a TypedText chunk for "f". + /// - a LeftParen chunk for "(". + /// - a Placeholder chunk for "int x" + /// - an Optional chunk containing the remaining defaulted arguments, e.g., + /// - a Comma chunk for "," + /// - a Placeholder chunk for "float y" + /// - an Optional chunk containing the last defaulted argument: + /// - a Comma chunk for "," + /// - a Placeholder chunk for "double z" + /// - a RightParen chunk for ")" + /// + /// There are many ways to handle Optional chunks. Two simple approaches are: + /// - Completely ignore optional chunks, in which case the template for the + /// function "f" would only include the first parameter ("int x"). + /// - Fully expand all optional chunks, in which case the template for the + /// function "f" would have all of the parameters. + static const int CXCompletionChunk_Optional = 0; + + /// Text that a user would be expected to type to get this + /// code-completion result. + /// + /// There will be exactly one "typed text" chunk in a semantic string, which + /// will typically provide the spelling of a keyword or the name of a + /// declaration that could be used at the current code point. Clients are + /// expected to filter the code-completion results based on the text in this + /// chunk. + static const int CXCompletionChunk_TypedText = 1; + + /// Text that should be inserted as part of a code-completion result. + /// + /// A "text" chunk represents text that is part of the template to be + /// inserted into user code should this particular code-completion result + /// be selected. + static const int CXCompletionChunk_Text = 2; + + /// Placeholder text that should be replaced by the user. + /// + /// A "placeholder" chunk marks a place where the user should insert text + /// into the code-completion template. For example, placeholders might mark + /// the function parameters for a function declaration, to indicate that the + /// user should provide arguments for each of those parameters. The actual + /// text in a placeholder is a suggestion for the text to display before + /// the user replaces the placeholder with real code. + static const int CXCompletionChunk_Placeholder = 3; + + /// Informative text that should be displayed but never inserted as + /// part of the template. + /// + /// An "informative" chunk contains annotations that can be displayed to + /// help the user decide whether a particular code-completion result is the + /// right option, but which is not part of the actual template to be inserted + /// by code completion. + 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. + /// + /// A "current parameter" chunk occurs when code-completion is providing + /// information about a parameter corresponding to the argument at the + /// code-completion point. For example, given a function + /// + /// \code + /// int add(int x, int y); + /// \endcode + /// + /// and the source code \c add(, where the code-completion point is after the + /// "(", the code-completion string will contain a "current parameter" chunk + /// for "int x", indicating that the current argument will initialize that + /// parameter. After typing further, to \c add(17, (where the code-completion + /// point is after the ","), the code-completion string will contain a + /// "current parameter" chunk to "int y". + static const int CXCompletionChunk_CurrentParameter = 5; -typedef Native_clang_CXXMethod_isConst = ffi.Uint32 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 _dart_clang_CXXMethod_isConst = int Function( - CXCursor C, -); + /// 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 Native_clang_getTemplateCursorKind = ffi.Int32 Function( - CXCursor C, -); + /// A left bracket ('['). + static const int CXCompletionChunk_LeftBracket = 8; -typedef _dart_clang_getTemplateCursorKind = int Function( - CXCursor C, -); + /// A right bracket (']'). + static const int CXCompletionChunk_RightBracket = 9; -typedef Native_clang_getSpecializedCursorTemplate = CXCursor Function( - CXCursor C, -); + /// A left brace ('{'). + static const int CXCompletionChunk_LeftBrace = 10; -typedef _dart_clang_getSpecializedCursorTemplate = CXCursor Function( - CXCursor C, -); + /// A right brace ('}'). + static const int CXCompletionChunk_RightBrace = 11; -typedef Native_clang_getCursorReferenceNameRange = CXSourceRange Function( - CXCursor C, - ffi.Uint32 NameFlags, - ffi.Uint32 PieceIndex, -); + /// A left angle bracket ('<'). + static const int CXCompletionChunk_LeftAngle = 12; -typedef _dart_clang_getCursorReferenceNameRange = CXSourceRange Function( - CXCursor C, - int NameFlags, - int PieceIndex, -); + /// A right angle bracket ('>'). + static const int CXCompletionChunk_RightAngle = 13; -typedef Native_clang_getToken = ffi.Pointer Function( - ffi.Pointer TU, - CXSourceLocation Location, -); + /// A comma separator (','). + static const int CXCompletionChunk_Comma = 14; -typedef _dart_clang_getToken = ffi.Pointer Function( - ffi.Pointer TU, - CXSourceLocation Location, -); + /// Text that specifies the result type of a given result. + /// + /// This special kind of informative chunk is not meant to be inserted into + /// the text buffer. Rather, it is meant to illustrate the type that an + /// expression using the given completion string would have. + static const int CXCompletionChunk_ResultType = 15; -typedef Native_clang_getTokenKind = ffi.Int32 Function( - CXToken arg0, -); + /// A colon (':'). + static const int CXCompletionChunk_Colon = 16; -typedef _dart_clang_getTokenKind = int Function( - CXToken arg0, -); + /// A semicolon (';'). + static const int CXCompletionChunk_SemiColon = 17; -typedef Native_clang_getTokenSpelling = CXString Function( - ffi.Pointer arg0, - CXToken arg1, -); + /// An '=' sign. + static const int CXCompletionChunk_Equal = 18; -typedef _dart_clang_getTokenSpelling = CXString Function( - ffi.Pointer arg0, - CXToken arg1, -); + /// Horizontal space (' '). + static const int CXCompletionChunk_HorizontalSpace = 19; -typedef Native_clang_getTokenLocation = CXSourceLocation Function( - ffi.Pointer arg0, - CXToken arg1, -); + /// Vertical space ('\\n'), after which it is generally a good idea to + /// perform indentation. + static const int CXCompletionChunk_VerticalSpace = 20; +} -typedef _dart_clang_getTokenLocation = CXSourceLocation Function( - ffi.Pointer arg0, - CXToken arg1, -); +typedef Native_clang_getCompletionChunkText = CXString Function( + CXCompletionString completion_string, ffi.Uint32 chunk_number); +typedef Native_clang_getCompletionChunkCompletionString = CXCompletionString + Function(CXCompletionString completion_string, ffi.Uint32 chunk_number); +typedef Native_clang_getNumCompletionChunks = ffi.Uint32 Function( + CXCompletionString completion_string); +typedef Native_clang_getCompletionPriority = ffi.Uint32 Function( + CXCompletionString completion_string); +typedef Native_clang_getCompletionAvailability = ffi.Int32 Function( + CXCompletionString completion_string); +typedef Native_clang_getCompletionNumAnnotations = ffi.Uint32 Function( + CXCompletionString completion_string); +typedef Native_clang_getCompletionAnnotation = CXString Function( + CXCompletionString completion_string, ffi.Uint32 annotation_number); +typedef Native_clang_getCompletionParent = CXString Function( + CXCompletionString completion_string, ffi.Pointer kind); +typedef Native_clang_getCompletionBriefComment = CXString Function( + CXCompletionString completion_string); +typedef Native_clang_getCursorCompletionString = CXCompletionString Function( + CXCursor cursor); -typedef Native_clang_getTokenExtent = CXSourceRange Function( - ffi.Pointer arg0, - CXToken arg1, -); +/// 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_getTokenExtent = CXSourceRange Function( - ffi.Pointer arg0, - CXToken arg1, -); + /// The number of code-completion results stored in the + /// \c Results array. + @ffi.Uint32() + external int NumResults; +} -typedef Native_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 Native_clang_getCompletionNumFixIts = ffi.Uint32 Function( + ffi.Pointer results, ffi.Uint32 completion_index); +typedef Native_clang_getCompletionFixIt = CXString Function( + ffi.Pointer results, + ffi.Uint32 completion_index, + ffi.Uint32 fixit_index, + ffi.Pointer replacement_range); +typedef Native_clang_defaultCodeCompleteOptions = ffi.Uint32 Function(); +typedef Native_clang_codeCompleteAt + = ffi.Pointer Function( + CXTranslationUnit TU, + ffi.Pointer complete_filename, + ffi.Uint32 complete_line, + ffi.Uint32 complete_column, + ffi.Pointer unsaved_files, + ffi.Uint32 num_unsaved_files, + ffi.Uint32 options); +typedef Native_clang_sortCodeCompletionResults = ffi.Void Function( + ffi.Pointer Results, ffi.Uint32 NumResults); +typedef Native_clang_disposeCodeCompleteResults = ffi.Void Function( + ffi.Pointer Results); +typedef Native_clang_codeCompleteGetNumDiagnostics = ffi.Uint32 Function( + ffi.Pointer Results); +typedef Native_clang_codeCompleteGetDiagnostic = CXDiagnostic Function( + ffi.Pointer Results, ffi.Uint32 Index); +typedef Native_clang_codeCompleteGetContexts = ffi.Uint64 Function( + ffi.Pointer Results); +typedef Native_clang_codeCompleteGetContainerKind = ffi.Int32 Function( + ffi.Pointer Results, + ffi.Pointer IsIncomplete); +typedef Native_clang_codeCompleteGetContainerUSR = CXString Function( + ffi.Pointer Results); +typedef Native_clang_codeCompleteGetObjCSelector = CXString Function( + ffi.Pointer Results); +typedef Native_clang_getClangVersion = CXString Function(); +typedef Native_clang_toggleCrashRecovery = ffi.Void Function( + ffi.Uint32 isEnabled); +typedef Native_clang_getInclusions = ffi.Void Function( + CXTranslationUnit tu, CXInclusionVisitor visitor, CXClientData client_data); -typedef Native_clang_annotateTokens = ffi.Void Function( - ffi.Pointer TU, - ffi.Pointer Tokens, - ffi.Uint32 NumTokens, - ffi.Pointer Cursors, -); - -typedef _dart_clang_annotateTokens = void Function( - ffi.Pointer TU, - ffi.Pointer Tokens, - int NumTokens, - ffi.Pointer Cursors, -); +/// Visitor invoked for each file in a translation unit +/// (used with clang_getInclusions()). +/// +/// This visitor function will be invoked by clang_getInclusions() for each +/// file included (either at the top-level or by \#include directives) within +/// a translation unit. The first argument is the file being included, and +/// the second and third arguments provide the inclusion stack. The +/// array is sorted in order of immediate inclusion. For example, +/// the first element refers to the location that included 'included_file'. +typedef CXInclusionVisitor = ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + CXFile, ffi.Pointer, ffi.Uint32, CXClientData)>>; +typedef Native_clang_Cursor_Evaluate = CXEvalResult Function(CXCursor C); + +/// Evaluation result of a cursor +typedef CXEvalResult = ffi.Pointer; +typedef Native_clang_EvalResult_getKind = ffi.Int32 Function(CXEvalResult E); + +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 Native_clang_disposeTokens = ffi.Void Function( - ffi.Pointer TU, - ffi.Pointer Tokens, - ffi.Uint32 NumTokens, -); +typedef Native_clang_EvalResult_getAsInt = ffi.Int32 Function(CXEvalResult E); +typedef Native_clang_EvalResult_getAsLongLong = ffi.Int64 Function( + CXEvalResult E); +typedef Native_clang_EvalResult_isUnsignedInt = ffi.Uint32 Function( + CXEvalResult E); +typedef Native_clang_EvalResult_getAsUnsigned = ffi.Uint64 Function( + CXEvalResult E); +typedef Native_clang_EvalResult_getAsDouble = ffi.Double Function( + CXEvalResult E); +typedef Native_clang_EvalResult_getAsStr = ffi.Pointer Function( + CXEvalResult E); +typedef Native_clang_EvalResult_dispose = ffi.Void Function(CXEvalResult E); +typedef Native_clang_getRemappings = CXRemapping Function( + ffi.Pointer path); + +/// A remapping of original source files and their translated files. +typedef CXRemapping = ffi.Pointer; +typedef Native_clang_getRemappingsFromFileList = CXRemapping Function( + ffi.Pointer> filePaths, ffi.Uint32 numFiles); +typedef Native_clang_remap_getNumFiles = ffi.Uint32 Function(CXRemapping arg0); +typedef Native_clang_remap_getFilenames = ffi.Void Function( + CXRemapping arg0, + ffi.Uint32 index, + ffi.Pointer original, + ffi.Pointer transformed); +typedef Native_clang_remap_dispose = ffi.Void Function(CXRemapping arg0); -typedef _dart_clang_disposeTokens = void Function( - ffi.Pointer TU, - ffi.Pointer Tokens, - int NumTokens, -); +class CXCursorAndRangeVisitor extends ffi.Struct { + external ffi.Pointer context; -typedef Native_clang_getCursorKindSpelling = CXString Function( - ffi.Int32 Kind, -); + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, CXCursor, CXSourceRange)>> visit; +} -typedef _dart_clang_getCursorKindSpelling = CXString Function( - int Kind, -); +/// \defgroup CINDEX_HIGH Higher level API functions +/// +/// @{ +abstract class CXVisitorResult { + static const int CXVisit_Break = 0; + static const int CXVisit_Continue = 1; +} -typedef Native_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 Native_clang_findReferencesInFile = ffi.Int32 Function( + CXCursor cursor, CXFile file, CXCursorAndRangeVisitor visitor); -typedef Native_clang_enableStackTraces = ffi.Void Function(); +abstract class CXResult { + /// Function returned successfully. + static const int CXResult_Success = 0; -typedef _dart_clang_enableStackTraces = void Function(); + /// One of the parameters was invalid for the function. + static const int CXResult_Invalid = 1; -typedef _typedefC_1 = ffi.Void Function( - ffi.Pointer, -); + /// The function was terminated by a callback (e.g. it returned + /// CXVisit_Break) + static const int CXResult_VisitBreak = 2; +} -typedef Native_clang_executeOnThread = ffi.Void Function( - ffi.Pointer> fn, - ffi.Pointer user_data, - ffi.Uint32 stack_size, -); +typedef Native_clang_findIncludesInFile = ffi.Int32 Function( + CXTranslationUnit TU, CXFile file, CXCursorAndRangeVisitor visitor); -typedef _dart_clang_executeOnThread = void Function( - ffi.Pointer> fn, - ffi.Pointer user_data, - int stack_size, -); +/// Source location passed to index callbacks. +class CXIdxLoc extends ffi.Struct { + @ffi.Array.multi([2]) + external ffi.Array> ptr_data; -typedef Native_clang_getCompletionChunkKind = ffi.Int32 Function( - ffi.Pointer completion_string, - ffi.Uint32 chunk_number, -); + @ffi.Uint32() + external int int_data; +} -typedef _dart_clang_getCompletionChunkKind = int Function( - ffi.Pointer completion_string, - int chunk_number, -); +/// Data for ppIncludedFile callback. +class CXIdxIncludedFileInfo extends ffi.Struct { + /// Location of '#' in the \#include/\#import directive. + external CXIdxLoc hashLoc; -typedef Native_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 Native_clang_getCompletionChunkCompletionString = ffi.Pointer - Function( - ffi.Pointer completion_string, - ffi.Uint32 chunk_number, -); - -typedef _dart_clang_getCompletionChunkCompletionString = ffi.Pointer - Function( - ffi.Pointer completion_string, - int chunk_number, -); + /// Filename as written in the \#include/\#import directive. + external ffi.Pointer filename; -typedef Native_clang_getNumCompletionChunks = ffi.Uint32 Function( - ffi.Pointer completion_string, -); + /// The actual file that the \#include/\#import directive resolved to. + external CXFile file; -typedef _dart_clang_getNumCompletionChunks = int Function( - ffi.Pointer completion_string, -); + @ffi.Int32() + external int isImport; -typedef Native_clang_getCompletionPriority = ffi.Uint32 Function( - ffi.Pointer completion_string, -); + @ffi.Int32() + external int isAngled; -typedef _dart_clang_getCompletionPriority = int Function( - ffi.Pointer completion_string, -); + /// Non-zero if the directive was automatically turned into a module + /// import. + @ffi.Int32() + external int isModuleImport; +} -typedef Native_clang_getCompletionAvailability = ffi.Int32 Function( - ffi.Pointer completion_string, -); +/// Data for IndexerCallbacks#importedASTFile. +class CXIdxImportedASTFileInfo extends ffi.Struct { + /// Top level AST file containing the imported PCH, module or submodule. + external CXFile file; -typedef _dart_clang_getCompletionAvailability = int Function( - ffi.Pointer completion_string, -); + /// The imported module or NULL if the AST file is a PCH. + external CXModule module; -typedef Native_clang_getCompletionNumAnnotations = ffi.Uint32 Function( - ffi.Pointer completion_string, -); + /// Location where the file is imported. Applicable only for modules. + external CXIdxLoc loc; -typedef _dart_clang_getCompletionNumAnnotations = int Function( - ffi.Pointer completion_string, -); + /// Non-zero if an inclusion directive was automatically turned into + /// a module import. Applicable only for modules. + @ffi.Int32() + external int isImplicit; +} -typedef Native_clang_getCompletionAnnotation = CXString Function( - ffi.Pointer completion_string, - ffi.Uint32 annotation_number, -); +class CXIdxAttrInfo extends ffi.Struct { + @ffi.Int32() + external int kind; -typedef _dart_clang_getCompletionAnnotation = CXString Function( - ffi.Pointer completion_string, - int annotation_number, -); + external CXCursor cursor; -typedef Native_clang_getCompletionParent = CXString Function( - ffi.Pointer completion_string, - ffi.Pointer kind, -); + external CXIdxLoc loc; +} -typedef _dart_clang_getCompletionParent = CXString Function( - ffi.Pointer completion_string, - ffi.Pointer kind, -); +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 Native_clang_getCompletionBriefComment = CXString Function( - ffi.Pointer completion_string, -); +class CXIdxEntityInfo extends ffi.Struct { + @ffi.Int32() + external int kind; -typedef _dart_clang_getCompletionBriefComment = CXString Function( - ffi.Pointer completion_string, -); + @ffi.Int32() + external int templateKind; -typedef Native_clang_getCursorCompletionString = ffi.Pointer Function( - CXCursor cursor, -); + @ffi.Int32() + external int lang; -typedef _dart_clang_getCursorCompletionString = ffi.Pointer Function( - CXCursor cursor, -); + external ffi.Pointer name; -typedef Native_clang_getCompletionNumFixIts = ffi.Uint32 Function( - ffi.Pointer results, - ffi.Uint32 completion_index, -); + external ffi.Pointer USR; -typedef _dart_clang_getCompletionNumFixIts = int Function( - ffi.Pointer results, - int completion_index, -); + external CXCursor cursor; -typedef Native_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, -); + external ffi.Pointer> attributes; -typedef Native_clang_defaultCodeCompleteOptions = ffi.Uint32 Function(); + @ffi.Uint32() + external int numAttributes; +} -typedef _dart_clang_defaultCodeCompleteOptions = int Function(); - -typedef Native_clang_codeCompleteAt = ffi.Pointer - Function( - ffi.Pointer TU, - ffi.Pointer complete_filename, - ffi.Uint32 complete_line, - ffi.Uint32 complete_column, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options, -); - -typedef _dart_clang_codeCompleteAt = ffi.Pointer - Function( - ffi.Pointer TU, - ffi.Pointer complete_filename, - int complete_line, - int complete_column, - ffi.Pointer unsaved_files, - int num_unsaved_files, - int options, -); +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 Native_clang_sortCodeCompletionResults = ffi.Void Function( - ffi.Pointer Results, - ffi.Uint32 NumResults, -); +/// 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_sortCodeCompletionResults = void Function( - ffi.Pointer Results, - int NumResults, -); +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 Native_clang_disposeCodeCompleteResults = ffi.Void Function( - ffi.Pointer Results, -); +class CXIdxContainerInfo extends ffi.Struct { + external CXCursor cursor; +} -typedef _dart_clang_disposeCodeCompleteResults = void Function( - ffi.Pointer Results, -); +class CXIdxIBOutletCollectionAttrInfo extends ffi.Struct { + external ffi.Pointer attrInfo; -typedef Native_clang_codeCompleteGetNumDiagnostics = ffi.Uint32 Function( - ffi.Pointer Results, -); + external ffi.Pointer objcClass; -typedef _dart_clang_codeCompleteGetNumDiagnostics = int Function( - ffi.Pointer Results, -); + external CXCursor classCursor; -typedef Native_clang_codeCompleteGetDiagnostic = ffi.Pointer Function( - ffi.Pointer Results, - ffi.Uint32 Index, -); + external CXIdxLoc classLoc; +} -typedef _dart_clang_codeCompleteGetDiagnostic = ffi.Pointer Function( - ffi.Pointer Results, - int Index, -); +class CXIdxDeclInfo extends ffi.Struct { + external ffi.Pointer entityInfo; -typedef Native_clang_codeCompleteGetContexts = ffi.Uint64 Function( - ffi.Pointer Results, -); + external CXCursor cursor; -typedef _dart_clang_codeCompleteGetContexts = int Function( - ffi.Pointer Results, -); + external CXIdxLoc loc; -typedef Native_clang_codeCompleteGetContainerKind = ffi.Int32 Function( - ffi.Pointer Results, - ffi.Pointer IsIncomplete, -); + external ffi.Pointer semanticContainer; -typedef _dart_clang_codeCompleteGetContainerKind = int Function( - ffi.Pointer Results, - ffi.Pointer IsIncomplete, -); + /// Generally same as #semanticContainer but can be different in + /// cases like out-of-line C++ member functions. + external ffi.Pointer lexicalContainer; -typedef Native_clang_codeCompleteGetContainerUSR = CXString Function( - ffi.Pointer Results, -); + @ffi.Int32() + external int isRedeclaration; -typedef _dart_clang_codeCompleteGetContainerUSR = CXString Function( - ffi.Pointer Results, -); + @ffi.Int32() + external int isDefinition; -typedef Native_clang_codeCompleteGetObjCSelector = CXString Function( - ffi.Pointer Results, -); + @ffi.Int32() + external int isContainer; -typedef _dart_clang_codeCompleteGetObjCSelector = CXString Function( - ffi.Pointer Results, -); + external ffi.Pointer declAsContainer; -typedef Native_clang_getClangVersion = CXString Function(); + /// 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_getClangVersion = CXString Function(); + external ffi.Pointer> attributes; -typedef Native_clang_toggleCrashRecovery = ffi.Void Function( - ffi.Uint32 isEnabled, -); + @ffi.Uint32() + external int numAttributes; -typedef _dart_clang_toggleCrashRecovery = void Function( - int isEnabled, -); + @ffi.Uint32() + external int flags; +} -typedef CXInclusionVisitor = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Uint32, - ffi.Pointer, -); +class CXIdxObjCContainerDeclInfo extends ffi.Struct { + external ffi.Pointer declInfo; -typedef Native_clang_getInclusions = ffi.Void Function( - ffi.Pointer tu, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); + @ffi.Int32() + external int kind; +} -typedef _dart_clang_getInclusions = void Function( - ffi.Pointer tu, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); +abstract class CXIdxObjCContainerKind { + static const int CXIdxObjCContainer_ForwardRef = 0; + static const int CXIdxObjCContainer_Interface = 1; + static const int CXIdxObjCContainer_Implementation = 2; +} -typedef Native_clang_Cursor_Evaluate = ffi.Pointer Function( - CXCursor C, -); +class CXIdxBaseClassInfo extends ffi.Struct { + external ffi.Pointer base; -typedef _dart_clang_Cursor_Evaluate = ffi.Pointer Function( - CXCursor C, -); + external CXCursor cursor; -typedef Native_clang_EvalResult_getKind = ffi.Int32 Function( - ffi.Pointer E, -); + external CXIdxLoc loc; +} -typedef _dart_clang_EvalResult_getKind = int Function( - ffi.Pointer E, -); +class CXIdxObjCProtocolRefInfo extends ffi.Struct { + external ffi.Pointer protocol; -typedef Native_clang_EvalResult_getAsInt = ffi.Int32 Function( - ffi.Pointer E, -); + external CXCursor cursor; -typedef _dart_clang_EvalResult_getAsInt = int Function( - ffi.Pointer E, -); + external CXIdxLoc loc; +} -typedef Native_clang_EvalResult_getAsLongLong = ffi.Int64 Function( - ffi.Pointer E, -); +class CXIdxObjCProtocolRefListInfo extends ffi.Struct { + external ffi.Pointer> protocols; -typedef _dart_clang_EvalResult_getAsLongLong = int Function( - ffi.Pointer E, -); + @ffi.Uint32() + external int numProtocols; +} -typedef Native_clang_EvalResult_isUnsignedInt = ffi.Uint32 Function( - ffi.Pointer E, -); +class CXIdxObjCInterfaceDeclInfo extends ffi.Struct { + external ffi.Pointer containerInfo; -typedef _dart_clang_EvalResult_isUnsignedInt = int Function( - ffi.Pointer E, -); + external ffi.Pointer superInfo; -typedef Native_clang_EvalResult_getAsUnsigned = ffi.Uint64 Function( - ffi.Pointer E, -); + external ffi.Pointer protocols; +} -typedef _dart_clang_EvalResult_getAsUnsigned = int Function( - ffi.Pointer E, -); +class CXIdxObjCCategoryDeclInfo extends ffi.Struct { + external ffi.Pointer containerInfo; -typedef Native_clang_EvalResult_getAsDouble = ffi.Double Function( - ffi.Pointer E, -); + external ffi.Pointer objcClass; -typedef _dart_clang_EvalResult_getAsDouble = double Function( - ffi.Pointer E, -); + external CXCursor classCursor; -typedef Native_clang_EvalResult_getAsStr = ffi.Pointer Function( - ffi.Pointer E, -); + external CXIdxLoc classLoc; -typedef _dart_clang_EvalResult_getAsStr = ffi.Pointer Function( - ffi.Pointer E, -); + external ffi.Pointer protocols; +} -typedef Native_clang_EvalResult_dispose = ffi.Void Function( - ffi.Pointer E, -); +class CXIdxObjCPropertyDeclInfo extends ffi.Struct { + external ffi.Pointer declInfo; -typedef _dart_clang_EvalResult_dispose = void Function( - ffi.Pointer E, -); + external ffi.Pointer getter; -typedef Native_clang_getRemappings = ffi.Pointer Function( - ffi.Pointer path, -); + external ffi.Pointer setter; +} -typedef _dart_clang_getRemappings = ffi.Pointer Function( - ffi.Pointer path, -); +class CXIdxCXXClassDeclInfo extends ffi.Struct { + external ffi.Pointer declInfo; -typedef Native_clang_getRemappingsFromFileList = ffi.Pointer Function( - ffi.Pointer> filePaths, - ffi.Uint32 numFiles, -); + external ffi.Pointer> bases; -typedef _dart_clang_getRemappingsFromFileList = ffi.Pointer Function( - ffi.Pointer> filePaths, - int numFiles, -); + @ffi.Uint32() + external int numBases; +} -typedef Native_clang_remap_getNumFiles = ffi.Uint32 Function( - ffi.Pointer arg0, -); +/// Data for IndexerCallbacks#indexEntityReference. +class CXIdxEntityRefInfo extends ffi.Struct { + @ffi.Int32() + external int kind; -typedef _dart_clang_remap_getNumFiles = int Function( - ffi.Pointer arg0, -); + /// Reference cursor. + external CXCursor cursor; -typedef Native_clang_remap_getFilenames = ffi.Void Function( - ffi.Pointer arg0, - ffi.Uint32 index, - ffi.Pointer original, - ffi.Pointer transformed, -); - -typedef _dart_clang_remap_getFilenames = void Function( - ffi.Pointer arg0, - int index, - ffi.Pointer original, - ffi.Pointer transformed, -); - -typedef Native_clang_remap_dispose = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_remap_dispose = void Function( - ffi.Pointer arg0, -); + external CXIdxLoc loc; -typedef Native_clang_findReferencesInFile = ffi.Int32 Function( - CXCursor cursor, - ffi.Pointer file, - CXCursorAndRangeVisitor visitor, -); + /// The entity that gets referenced. + external ffi.Pointer referencedEntity; -typedef _dart_clang_findReferencesInFile = int Function( - CXCursor cursor, - ffi.Pointer file, - CXCursorAndRangeVisitor visitor, -); + /// 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 Native_clang_findIncludesInFile = ffi.Int32 Function( - ffi.Pointer TU, - ffi.Pointer file, - CXCursorAndRangeVisitor visitor, -); + /// Lexical container context of the reference. + external ffi.Pointer container; -typedef _dart_clang_findIncludesInFile = int Function( - ffi.Pointer TU, - ffi.Pointer file, - CXCursorAndRangeVisitor visitor, -); + /// Sets of symbol roles of the reference. + @ffi.Int32() + external int role; +} -typedef Native_clang_index_isEntityObjCContainerKind = ffi.Int32 Function( - ffi.Int32 arg0, -); +/// Data for IndexerCallbacks#indexEntityReference. +/// +/// This may be deprecated in a future version as this duplicates +/// the \c CXSymbolRole_Implicit bit in \c CXSymbolRole. +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; +} -typedef _dart_clang_index_isEntityObjCContainerKind = int Function( - int arg0, -); +/// Roles that are attributed to symbol occurrences. +/// +/// Internal: this currently mirrors low 9 bits of clang::index::SymbolRole with +/// higher bits zeroed. These high bits may be exposed in the future. +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 Native_clang_index_isEntityObjCContainerKind = ffi.Int32 Function( + ffi.Int32 arg0); typedef Native_clang_index_getObjCContainerDeclInfo = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getObjCContainerDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - + ffi.Pointer arg0); typedef Native_clang_index_getObjCInterfaceDeclInfo = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getObjCInterfaceDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - + ffi.Pointer arg0); typedef Native_clang_index_getObjCCategoryDeclInfo = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getObjCCategoryDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - + ffi.Pointer arg0); typedef Native_clang_index_getObjCProtocolRefListInfo = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getObjCProtocolRefListInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - + ffi.Pointer arg0); typedef Native_clang_index_getObjCPropertyDeclInfo = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getObjCPropertyDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - + ffi.Pointer arg0); typedef Native_clang_index_getIBOutletCollectionAttrInfo = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getIBOutletCollectionAttrInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - + ffi.Pointer arg0); typedef Native_clang_index_getCXXClassDeclInfo = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getCXXClassDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef Native_clang_index_getClientContainer = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getClientContainer = ffi.Pointer Function( - ffi.Pointer arg0, -); + ffi.Pointer arg0); +typedef Native_clang_index_getClientContainer = CXIdxClientContainer Function( + ffi.Pointer arg0); +/// The client's data object that is associated with a semantic container +/// of entities. +typedef CXIdxClientContainer = ffi.Pointer; typedef Native_clang_index_setClientContainer = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); + ffi.Pointer arg0, CXIdxClientContainer arg1); +typedef Native_clang_index_getClientEntity = CXIdxClientEntity Function( + ffi.Pointer arg0); + +/// The client's data object that is associated with a semantic entity. +typedef CXIdxClientEntity = ffi.Pointer; +typedef Native_clang_index_setClientEntity = ffi.Void Function( + ffi.Pointer arg0, CXIdxClientEntity arg1); +typedef Native_clang_IndexAction_create = CXIndexAction Function(CXIndex CIdx); -typedef _dart_clang_index_setClientContainer = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); +/// An indexing action/session, to be applied to one or multiple +/// translation units. +typedef CXIndexAction = ffi.Pointer; +typedef Native_clang_IndexAction_dispose = ffi.Void Function( + CXIndexAction arg0); +typedef Native_clang_indexSourceFile = ffi.Int32 Function( + CXIndexAction arg0, + CXClientData client_data, + ffi.Pointer index_callbacks, + ffi.Uint32 index_callbacks_size, + ffi.Uint32 index_options, + 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.Pointer out_TU, + ffi.Uint32 TU_options); -typedef Native_clang_index_getClientEntity = ffi.Pointer Function( - ffi.Pointer arg0, -); +/// 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< + ffi.NativeFunction< + ffi.Int32 Function(CXClientData, ffi.Pointer)>> abortQuery; -typedef _dart_clang_index_getClientEntity = ffi.Pointer Function( - ffi.Pointer arg0, -); + /// Called at the end of indexing; passes the complete diagnostic set. + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + CXClientData, CXDiagnosticSet, ffi.Pointer)>> + diagnostic; -typedef Native_clang_index_setClientEntity = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); + external ffi.Pointer< + ffi.NativeFunction< + CXIdxClientFile Function( + CXClientData, CXFile, ffi.Pointer)>> enteredMainFile; -typedef _dart_clang_index_setClientEntity = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); + /// Called when a file gets \#included/\#imported. + external ffi.Pointer< + ffi.NativeFunction< + CXIdxClientFile Function( + CXClientData, ffi.Pointer)>> + ppIncludedFile; -typedef Native_clang_IndexAction_create = ffi.Pointer Function( - ffi.Pointer CIdx, -); + /// 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< + ffi.NativeFunction< + CXIdxClientASTFile Function( + CXClientData, ffi.Pointer)>> + importedASTFile; -typedef _dart_clang_IndexAction_create = ffi.Pointer Function( - ffi.Pointer CIdx, -); + /// Called at the beginning of indexing a translation unit. + external ffi.Pointer< + ffi.NativeFunction< + CXIdxClientContainer Function( + CXClientData, ffi.Pointer)>> startedTranslationUnit; -typedef Native_clang_IndexAction_dispose = ffi.Void Function( - ffi.Pointer arg0, -); + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(CXClientData, ffi.Pointer)>> + indexDeclaration; -typedef _dart_clang_IndexAction_dispose = void Function( - ffi.Pointer arg0, -); + /// Called to index a reference of an entity. + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(CXClientData, ffi.Pointer)>> + indexEntityReference; +} -typedef Native_clang_indexSourceFile = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - ffi.Uint32 index_callbacks_size, - ffi.Uint32 index_options, - 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.Pointer> out_TU, - ffi.Uint32 TU_options, -); - -typedef _dart_clang_indexSourceFile = int Function( - 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, -); +/// The client's data object that is associated with a CXFile. +typedef CXIdxClientFile = ffi.Pointer; +/// The client's data object that is associated with an AST file (PCH +/// or module). +typedef CXIdxClientASTFile = ffi.Pointer; typedef Native_clang_indexSourceFileFullArgv = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - ffi.Uint32 index_callbacks_size, - ffi.Uint32 index_options, - 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.Pointer> out_TU, - ffi.Uint32 TU_options, -); - -typedef _dart_clang_indexSourceFileFullArgv = int Function( - 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, -); - + CXIndexAction arg0, + CXClientData client_data, + ffi.Pointer index_callbacks, + ffi.Uint32 index_callbacks_size, + ffi.Uint32 index_options, + 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.Pointer out_TU, + ffi.Uint32 TU_options); typedef Native_clang_indexTranslationUnit = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - ffi.Uint32 index_callbacks_size, - ffi.Uint32 index_options, - ffi.Pointer arg5, -); - -typedef _dart_clang_indexTranslationUnit = int Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - int index_callbacks_size, - int index_options, - ffi.Pointer arg5, -); - + CXIndexAction arg0, + CXClientData client_data, + ffi.Pointer index_callbacks, + ffi.Uint32 index_callbacks_size, + ffi.Uint32 index_options, + CXTranslationUnit arg5); typedef Native_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, -); - + CXIdxLoc loc, + ffi.Pointer indexFile, + ffi.Pointer file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef Native_clang_indexLoc_getCXSourceLocation = CXSourceLocation Function( - CXIdxLoc loc, -); + CXIdxLoc loc); +typedef Native_clang_Type_visitFields = ffi.Uint32 Function( + CXType T, CXFieldVisitor visitor, CXClientData client_data); + +/// Visitor invoked for each field found by a traversal. +/// +/// This visitor function will be invoked for each field found by +/// \c clang_Type_visitFields. Its first argument is the cursor being +/// visited, its second argument is the client data provided to +/// \c clang_Type_visitFields. +/// +/// The visitor should return one of the \c CXVisitorResult values +/// to direct \c clang_Type_visitFields. +typedef CXFieldVisitor = ffi + .Pointer>; + +const int CINDEX_VERSION_MAJOR = 0; -typedef _dart_clang_indexLoc_getCXSourceLocation = CXSourceLocation Function( - CXIdxLoc loc, -); +const int CINDEX_VERSION_MINOR = 59; -typedef CXFieldVisitor = ffi.Int32 Function( - CXCursor, - ffi.Pointer, -); +const int CINDEX_VERSION = 59; -typedef Native_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_4 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_5 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_6 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_7 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_8 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_9 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_10 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, -); +const String CINDEX_VERSION_STRING = '0.59'; diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index bf0695e9bf..f65a62335f 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -5,7 +5,7 @@ name: libclang_example environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.13.0 <3.0.0' dev_dependencies: ffigen: @@ -62,6 +62,11 @@ ffigen: unsigned long long: 8 enum: 4 + # These can be used to map any typedef to a specific native type. + typedef-map: + 'size_t': 'IntPtr' + 'time_t': 'Int64' + # Default is 'NativeLibrary' name: 'LibClang' diff --git a/pkgs/ffigen/example/simple/generated_bindings.dart b/pkgs/ffigen/example/simple/generated_bindings.dart index 167488252e..a964f5074f 100644 --- a/pkgs/ffigen/example/simple/generated_bindings.dart +++ b/pkgs/ffigen/example/simple/generated_bindings.dart @@ -30,8 +30,10 @@ class NativeLibrary { ); } - late final _sum_ptr = _lookup>('sum'); - late final _dart_sum _sum = _sum_ptr.asFunction<_dart_sum>(); + late final _sum_ptr = + _lookup>( + 'sum'); + late final _sum = _sum_ptr.asFunction(); /// Subtracts 2 integers. int subtract( @@ -44,10 +46,11 @@ class NativeLibrary { ); } - late final _subtract_ptr = - _lookup>('subtract'); - late final _dart_subtract _subtract = - _subtract_ptr.asFunction<_dart_subtract>(); + late final _subtract_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>>('subtract'); + late final _subtract = + _subtract_ptr.asFunction, int)>(); /// Multiplies 2 integers, returns pointer to an integer,. ffi.Pointer multiply( @@ -60,10 +63,11 @@ class NativeLibrary { ); } - late final _multiply_ptr = - _lookup>('multiply'); - late final _dart_multiply _multiply = - _multiply_ptr.asFunction<_dart_multiply>(); + late final _multiply_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Int32, ffi.Int32)>>('multiply'); + late final _multiply = + _multiply_ptr.asFunction Function(int, int)>(); /// Divides 2 integers, returns pointer to a float. ffi.Pointer divide( @@ -76,8 +80,11 @@ class NativeLibrary { ); } - late final _divide_ptr = _lookup>('divide'); - late final _dart_divide _divide = _divide_ptr.asFunction<_dart_divide>(); + late final _divide_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Int32, ffi.Int32)>>('divide'); + late final _divide = + _divide_ptr.asFunction Function(int, int)>(); /// Divides 2 floats, returns a pointer to double. ffi.Pointer dividePercision( @@ -90,58 +97,11 @@ class NativeLibrary { ); } - late final _dividePercision_ptr = - _lookup>('dividePercision'); - late final _dart_dividePercision _dividePercision = - _dividePercision_ptr.asFunction<_dart_dividePercision>(); + late final _dividePercision_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('dividePercision'); + late final _dividePercision = _dividePercision_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); } - -typedef _c_sum = ffi.Int32 Function( - ffi.Int32 a, - ffi.Int32 b, -); - -typedef _dart_sum = int Function( - int a, - int b, -); - -typedef _c_subtract = ffi.Int32 Function( - ffi.Pointer a, - ffi.Int32 b, -); - -typedef _dart_subtract = int Function( - ffi.Pointer a, - int b, -); - -typedef _c_multiply = ffi.Pointer Function( - ffi.Int32 a, - ffi.Int32 b, -); - -typedef _dart_multiply = ffi.Pointer Function( - int a, - int b, -); - -typedef _c_divide = ffi.Pointer Function( - ffi.Int32 a, - ffi.Int32 b, -); - -typedef _dart_divide = ffi.Pointer Function( - int a, - int b, -); - -typedef _c_dividePercision = ffi.Pointer Function( - ffi.Pointer a, - ffi.Pointer b, -); - -typedef _dart_dividePercision = ffi.Pointer Function( - ffi.Pointer a, - ffi.Pointer b, -); diff --git a/pkgs/ffigen/lib/src/code_generator.dart b/pkgs/ffigen/lib/src/code_generator.dart index 0b2367456f..710b32fad3 100644 --- a/pkgs/ffigen/lib/src/code_generator.dart +++ b/pkgs/ffigen/lib/src/code_generator.dart @@ -14,5 +14,5 @@ export 'code_generator/global.dart'; export 'code_generator/library.dart'; export 'code_generator/struc.dart'; export 'code_generator/type.dart'; -export 'code_generator/typedef.dart'; +export 'code_generator/typealias.dart'; export 'code_generator/union.dart'; diff --git a/pkgs/ffigen/lib/src/code_generator/binding.dart b/pkgs/ffigen/lib/src/code_generator/binding.dart index 877f243eee..105d6f00fa 100644 --- a/pkgs/ffigen/lib/src/code_generator/binding.dart +++ b/pkgs/ffigen/lib/src/code_generator/binding.dart @@ -3,7 +3,6 @@ // BSD-style license that can be found in the LICENSE file. import 'binding_string.dart'; -import 'typedef.dart'; import 'writer.dart'; /// Base class for all Bindings. @@ -28,8 +27,8 @@ abstract class Binding { this.dartDoc, }); - /// Return typedef dependencies. - List getTypedefDependencies(Writer w) => const []; + /// Get all dependencies, including itself and save them in [dependencies]. + void addDependencies(Set dependencies); /// Converts a Binding to its actual string representation. /// diff --git a/pkgs/ffigen/lib/src/code_generator/compound.dart b/pkgs/ffigen/lib/src/code_generator/compound.dart index 77868ebda6..b6b97a3427 100644 --- a/pkgs/ffigen/lib/src/code_generator/compound.dart +++ b/pkgs/ffigen/lib/src/code_generator/compound.dart @@ -3,7 +3,6 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/code_generator/typedef.dart'; import 'binding.dart'; import 'binding_string.dart'; @@ -104,23 +103,6 @@ abstract class Compound extends NoLookUpBinding { return type.getCType(w); } - List? _typedefDependencies; - @override - List getTypedefDependencies(Writer w) { - if (_typedefDependencies == null) { - _typedefDependencies = []; - - // Write typedef's required by members and resolve name conflicts. - for (final m in members) { - final base = m.type.getBaseType(); - if (base.broadType == BroadType.NativeFunction) { - _typedefDependencies!.addAll(base.nativeFunc!.getDependencies()); - } - } - } - return _typedefDependencies ?? []; - } - @override BindingString toBindingString(Writer w) { final s = StringBuffer(); @@ -155,7 +137,7 @@ abstract class Compound extends NoLookUpBinding { s.writeAll(m.dartDoc!.split('\n'), '\n' + depth + '/// '); s.write('\n'); } - if (m.type.isPrimitive) { + if (!m.type.sameDartAndCType(w)) { s.write('$depth@${m.type.getCType(w)}()\n'); } s.write('${depth}external ${m.type.getDartType(w)} $memberName;\n\n'); @@ -167,6 +149,14 @@ abstract class Compound extends NoLookUpBinding { type: isStruct ? BindingStringType.struc : BindingStringType.union, string: s.toString()); } + + @override + void addDependencies(Set dependencies) { + if (dependencies.contains(this)) return; + + dependencies.add(this); + members.forEach((m) => m.type.addDependencies(dependencies)); + } } class Member { diff --git a/pkgs/ffigen/lib/src/code_generator/constant.dart b/pkgs/ffigen/lib/src/code_generator/constant.dart index cf6d8e81fa..8fd719169d 100644 --- a/pkgs/ffigen/lib/src/code_generator/constant.dart +++ b/pkgs/ffigen/lib/src/code_generator/constant.dart @@ -50,9 +50,16 @@ class Constant extends NoLookUpBinding { s.write(makeDartDoc(dartDoc!)); } - s.write('const $rawType $constantName = $rawValue;\n\n'); + s.write('\nconst $rawType $constantName = $rawValue;\n\n'); return BindingString( type: BindingStringType.constant, string: s.toString()); } + + @override + void addDependencies(Set dependencies) { + if (dependencies.contains(this)) return; + + dependencies.add(this); + } } diff --git a/pkgs/ffigen/lib/src/code_generator/enum_class.dart b/pkgs/ffigen/lib/src/code_generator/enum_class.dart index ec9d5e160f..e1ed5c4db0 100644 --- a/pkgs/ffigen/lib/src/code_generator/enum_class.dart +++ b/pkgs/ffigen/lib/src/code_generator/enum_class.dart @@ -68,6 +68,13 @@ class EnumClass extends NoLookUpBinding { return BindingString( type: BindingStringType.enumClass, string: s.toString()); } + + @override + void addDependencies(Set dependencies) { + if (dependencies.contains(this)) return; + + dependencies.add(this); + } } /// Represents a single value in an enum. diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index 5236c50a08..21aad75b7a 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -29,10 +29,12 @@ import 'writer.dart'; /// typedef _dart_sum = int Function(int a, int b); /// ``` class Func extends LookUpBinding { - final Type returnType; - final List parameters; + final FunctionType functionType; final bool exposeSymbolAddress; + /// Contains typealias for function type if [exposeSymbolAddress] is true. + Type? _exposedFunctionType; + /// [originalName] is looked up in dynamic library, if not /// provided, takes the value of [name]. Func({ @@ -40,65 +42,29 @@ class Func extends LookUpBinding { required String name, String? originalName, String? dartDoc, - required this.returnType, + required Type returnType, List? parameters, this.exposeSymbolAddress = false, - }) : parameters = parameters ?? [], + }) : functionType = FunctionType( + returnType: returnType, + parameters: parameters ?? const [], + ), super( usr: usr, originalName: originalName, name: name, dartDoc: dartDoc, ) { - for (var i = 0; i < this.parameters.length; i++) { - if (this.parameters[i].name.trim() == '') { - this.parameters[i].name = 'arg$i'; + for (var i = 0; i < functionType.parameters.length; i++) { + if (functionType.parameters[i].name.trim() == '') { + functionType.parameters[i].name = 'arg$i'; } } - } - - List? _typedefDependencies; - @override - List getTypedefDependencies(Writer w) { - if (_typedefDependencies == null) { - _typedefDependencies = []; - - // Add typedef's required by return type. - final returnTypeBase = returnType.getBaseType(); - if (returnTypeBase.broadType == BroadType.NativeFunction) { - _typedefDependencies! - .addAll(returnTypeBase.nativeFunc!.getDependencies()); - } - // Add typedef's required by parameters. - for (final p in parameters) { - final base = p.type.getBaseType(); - if (base.broadType == BroadType.NativeFunction) { - _typedefDependencies!.addAll(base.nativeFunc!.getDependencies()); - } - } - // Add C function typedef. - _typedefDependencies!.add(cType); - // Add Dart function typedef. - _typedefDependencies!.add(dartType); - } - return _typedefDependencies!; + _exposedFunctionType = Type.typealias( + Typealias(name: 'Native_$name', type: Type.functionType(functionType))); } - Typedef? _cType, _dartType; - Typedef get cType => _cType ??= Typedef( - name: exposeSymbolAddress ? 'Native_$name' : '_c_$name', - returnType: returnType, - parameters: parameters, - typedefType: TypedefType.C, - ); - Typedef get dartType => _dartType ??= Typedef( - name: '_dart_$name', - returnType: returnType, - parameters: parameters, - typedefType: TypedefType.Dart, - ); - @override BindingString toBindingString(Writer w) { final s = StringBuffer(); @@ -112,18 +78,22 @@ class Func extends LookUpBinding { } // Resolve name conflicts in function parameter names. final paramNamer = UniqueNamer({}); - for (final p in parameters) { + for (final p in functionType.parameters) { p.name = paramNamer.makeUnique(p.name); } // Write enclosing function. - if (w.dartBool && returnType.broadType == BroadType.Boolean) { + if (w.dartBool && + functionType.returnType.getBaseTypealiasType().broadType == + BroadType.Boolean) { // Use bool return type in enclosing function. s.write('bool $enclosingFuncName(\n'); } else { - s.write('${returnType.getDartType(w)} $enclosingFuncName(\n'); + s.write( + '${functionType.returnType.getDartType(w)} $enclosingFuncName(\n'); } - for (final p in parameters) { - if (w.dartBool && p.type.broadType == BroadType.Boolean) { + for (final p in functionType.parameters) { + if (w.dartBool && + p.type.getBaseTypealiasType().broadType == BroadType.Boolean) { // Use bool parameter type in enclosing function. s.write(' bool ${p.name},\n'); } else { @@ -134,15 +104,16 @@ class Func extends LookUpBinding { s.write('return $funcVarName'); s.write('(\n'); - for (final p in parameters) { - if (w.dartBool && p.type.broadType == BroadType.Boolean) { + for (final p in functionType.parameters) { + if (w.dartBool && + p.type.getBaseTypealiasType().broadType == BroadType.Boolean) { // Convert bool parameter to int before calling. s.write(' ${p.name}?1:0,\n'); } else { s.write(' ${p.name},\n'); } } - if (w.dartBool && returnType.broadType == BroadType.Boolean) { + if (w.dartBool && functionType.returnType.broadType == BroadType.Boolean) { // Convert int return type to bool. s.write(' )!=0;\n'); } else { @@ -150,27 +121,42 @@ class Func extends LookUpBinding { } s.write('}\n'); - // Write function pointer. - s.write( - "late final $funcPointerName = ${w.lookupFuncIdentifier}<${w.ffiLibraryPrefix}.NativeFunction<${cType.name}>>('$originalName');\n"); - // Write function variable. - s.write( - 'late final ${dartType.name} $funcVarName = $funcPointerName.asFunction<${dartType.name}>();\n\n'); + final cType = exposeSymbolAddress + ? _exposedFunctionType!.getCType(w) + : functionType.getCType(w, writeArgumentNames: false); + final dartType = functionType.getDartType(w, writeArgumentNames: false); if (exposeSymbolAddress) { // Add to SymbolAddress in writer. w.symbolAddressWriter.addSymbol( type: - '${w.ffiLibraryPrefix}.Pointer<${w.ffiLibraryPrefix}.NativeFunction<${cType.name}>>', + '${w.ffiLibraryPrefix}.Pointer<${w.ffiLibraryPrefix}.NativeFunction<$cType>>', name: name, ptrName: funcPointerName, ); } + // Write function pointer. + s.write( + "late final $funcPointerName = ${w.lookupFuncIdentifier}<${w.ffiLibraryPrefix}.NativeFunction<$cType>>('$originalName');\n"); + s.write( + 'late final $funcVarName = $funcPointerName.asFunction<$dartType>();\n\n'); + return BindingString(type: BindingStringType.func, string: s.toString()); } + + @override + void addDependencies(Set dependencies) { + if (dependencies.contains(this)) return; + + dependencies.add(this); + if (exposeSymbolAddress) { + _exposedFunctionType!.addDependencies(dependencies); + } + functionType.addDependencies(dependencies); + } } -/// Represents a Parameter, used in [Func] and [Typedef]. +/// Represents a Parameter, used in [Func] and [Typealias]. class Parameter { final String? originalName; String name; @@ -180,7 +166,7 @@ class Parameter { : originalName = originalName ?? name, // A type with broadtype [BroadType.NativeFunction] is wrapped with a // pointer because this is a shorthand used in C for Pointer to function. - type = type.broadType == BroadType.NativeFunction + type = type.getBaseTypealiasType().broadType == BroadType.NativeFunction ? Type.pointer(type) : type; } diff --git a/pkgs/ffigen/lib/src/code_generator/global.dart b/pkgs/ffigen/lib/src/code_generator/global.dart index cf864cd929..df4c7f059a 100644 --- a/pkgs/ffigen/lib/src/code_generator/global.dart +++ b/pkgs/ffigen/lib/src/code_generator/global.dart @@ -2,8 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:ffigen/src/code_generator/typedef.dart'; - import 'binding.dart'; import 'binding_string.dart'; import 'type.dart'; @@ -38,21 +36,6 @@ class Global extends LookUpBinding { dartDoc: dartDoc, ); - List? _typedefDependencies; - @override - List getTypedefDependencies(Writer w) { - if (_typedefDependencies == null) { - _typedefDependencies = []; - - // Add typedef's required by the variable's type. - final valueType = type.getBaseType(); - if (valueType.broadType == BroadType.NativeFunction) { - _typedefDependencies!.addAll(valueType.nativeFunc!.getDependencies()); - } - } - return _typedefDependencies!; - } - @override BindingString toBindingString(Writer w) { final s = StringBuffer(); @@ -66,8 +49,9 @@ class Global extends LookUpBinding { s.write( "late final ${w.ffiLibraryPrefix}.Pointer<$cType> $pointerName = ${w.lookupFuncIdentifier}<$cType>('$originalName');\n\n"); - if (type.broadType == BroadType.Compound) { - if (type.compound!.isOpaque) { + final baseTypealiasType = type.getBaseTypealiasType(); + if (baseTypealiasType.broadType == BroadType.Compound) { + if (baseTypealiasType.compound!.isOpaque) { s.write( '${w.ffiLibraryPrefix}.Pointer<$cType> get $globalVarName => $pointerName;\n\n'); } else { @@ -90,4 +74,12 @@ class Global extends LookUpBinding { return BindingString(type: BindingStringType.global, string: s.toString()); } + + @override + void addDependencies(Set dependencies) { + if (dependencies.contains(this)) return; + + dependencies.add(this); + type.addDependencies(dependencies); + } } diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index c29313f6b7..57776bb4c4 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -18,7 +18,7 @@ final _logger = Logger('ffigen.code_generator.library'); /// Container for all Bindings. class Library { /// List of bindings in this library. - final List bindings; + late List bindings; late Writer _writer; Writer get writer => _writer; @@ -26,17 +26,26 @@ class Library { Library({ required String name, String? description, - required this.bindings, + required List bindings, String? header, bool dartBool = true, bool sort = false, StructPackingOverride? packingOverride, }) { - if (sort) _sort(); + /// Get all dependencies (includes itself). + final dependencies = {}; + bindings.forEach((b) => b.addDependencies(dependencies)); + + /// Save bindings. + this.bindings = dependencies.toList(); + + if (sort) { + _sort(); + } /// Handle any declaration-declaration name conflicts. final declConflictHandler = UniqueNamer({}); - for (final b in bindings) { + for (final b in this.bindings) { _warnIfPrivateDeclaration(b); _resolveIfNameConflicts(declConflictHandler, b); } @@ -44,7 +53,7 @@ class Library { // Override pack values according to config. We do this after declaration // conflicts have been handled so that users can target the generated names. if (packingOverride != null) { - for (final b in bindings) { + for (final b in this.bindings) { if (b is Struc && packingOverride.isOverriden(b.name)) { b.pack = packingOverride.getOverridenPackValue(b.name); } @@ -52,8 +61,9 @@ class Library { } // Seperate bindings which require lookup. - final lookUpBindings = bindings.whereType().toList(); - final noLookUpBindings = bindings.whereType().toList(); + final lookUpBindings = this.bindings.whereType().toList(); + final noLookUpBindings = + this.bindings.whereType().toList(); _writer = Writer( lookUpBindings: lookUpBindings, diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index c306395c2b..0a7e941884 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -5,7 +5,7 @@ import 'package:ffigen/src/code_generator.dart'; import 'compound.dart'; -import 'typedef.dart'; +import 'typealias.dart'; import 'writer.dart'; class _SubType { @@ -39,10 +39,18 @@ enum BroadType { Compound, NativeFunction, + /// Represents a function type. + FunctionType, + + /// Represents a typealias. + Typealias, + /// Represents a Dart_Handle. Handle, - /// Stores its element type in NativeType as only those are supported. + Enum, + + /// Represents an Array type. ConstantArray, IncompleteArray, @@ -68,11 +76,23 @@ class Type { SupportedNativeType.IntPtr: _SubType(c: 'IntPtr', dart: 'int'), }; + /// Enum type is mapped to [SupportedNativeType.Int32]. + static const enumNativeType = SupportedNativeType.Int32; + /// Reference to the [Compound] binding this type refers to. Compound? compound; - /// Reference to the [Typedef] this type refers to. - Typedef? nativeFunc; + /// Reference to the [NativeFunc] this type refers to. + NativeFunc? nativeFunc; + + /// Reference to the [Typealias] this type refers to. + Typealias? typealias; + + /// Reference to the [FunctionType] this type refers to. + FunctionType? functionType; + + /// Reference to the [EnumClass] this type refers to. + EnumClass? enumClass; /// For providing [SupportedNativeType] only. final SupportedNativeType? nativeType; @@ -93,8 +113,11 @@ class Type { required this.broadType, this.child, this.compound, + this.enumClass, this.nativeType, this.nativeFunc, + this.typealias, + this.functionType, this.length, this.unimplementedReason, }); @@ -111,9 +134,19 @@ class Type { factory Type.union(Union union) { return Type._(broadType: BroadType.Compound, compound: union); } - factory Type.nativeFunc(Typedef nativeFunc) { + factory Type.enumClass(EnumClass enumClass) { + return Type._(broadType: BroadType.Enum, enumClass: enumClass); + } + factory Type.functionType(FunctionType functionType) { + return Type._( + broadType: BroadType.FunctionType, functionType: functionType); + } + factory Type.nativeFunc(NativeFunc nativeFunc) { return Type._(broadType: BroadType.NativeFunction, nativeFunc: nativeFunc); } + factory Type.typealias(Typealias typealias) { + return Type._(broadType: BroadType.Typealias, typealias: typealias); + } factory Type.nativeType(SupportedNativeType nativeType) { return Type._(broadType: BroadType.NativeType, nativeType: nativeType); } @@ -143,6 +176,26 @@ class Type { return Type._(broadType: BroadType.Handle); } + /// Get all dependencies of this type and save them in [dependencies]. + void addDependencies(Set dependencies) { + switch (broadType) { + case BroadType.Compound: + return compound!.addDependencies(dependencies); + case BroadType.NativeFunction: + return nativeFunc!.addDependencies(dependencies); + case BroadType.FunctionType: + return functionType!.addDependencies(dependencies); + case BroadType.Typealias: + return typealias!.addDependencies(dependencies); + case BroadType.Enum: + return enumClass!.addDependencies(dependencies); + default: + if (child != null) { + return child!.addDependencies(dependencies); + } + } + } + /// Get base type for any type. /// /// E.g int** has base [Type] of int. @@ -167,16 +220,33 @@ class Type { } } - bool get isPrimitive => - (broadType == BroadType.NativeType || broadType == BroadType.Boolean); + /// Get base typealias type. + /// + /// Returns itself if it's not a Typealias. + Type getBaseTypealiasType() { + if (broadType == BroadType.Typealias) { + return typealias!.type.getBaseTypealiasType(); + } else { + return this; + } + } + + /// Function to check if the dart and C type string are same. + bool sameDartAndCType(Writer w) => getCType(w) == getDartType(w); /// Returns true if the type is a [Compound] and is incomplete. - bool get isIncompleteCompound => - (broadType == BroadType.Compound && - compound != null && - compound!.isInComplete) || - (broadType == BroadType.ConstantArray && - getBaseArrayType().isIncompleteCompound); + bool get isIncompleteCompound { + final baseTypealiasType = getBaseTypealiasType(); + if (baseTypealiasType == this) { + return (broadType == BroadType.Compound && + compound != null && + compound!.isInComplete) || + (broadType == BroadType.ConstantArray && + getBaseArrayType().isIncompleteCompound); + } else { + return baseTypealiasType.isIncompleteCompound; + } + } String getCType(Writer w) { switch (broadType) { @@ -186,8 +256,10 @@ class Type { return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; case BroadType.Compound: return '${compound!.name}'; + case BroadType.Enum: + return '${w.ffiLibraryPrefix}.${_primitives[enumNativeType]!.c}'; case BroadType.NativeFunction: - return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFunc!.name}>'; + return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFunc!.type.getCType(w)}>'; case BroadType .IncompleteArray: // Array parameters are treated as Pointers in C. return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; @@ -198,8 +270,12 @@ class Type { return '${w.ffiLibraryPrefix}.${_primitives[SupportedNativeType.Uint8]!.c}'; case BroadType.Handle: return '${w.ffiLibraryPrefix}.Handle'; - default: - throw Exception('cType unknown'); + case BroadType.FunctionType: + return functionType!.getCType(w); + case BroadType.Typealias: + return typealias!.name; + case BroadType.Unimplemented: + throw UnimplementedError('C type unknown for ${broadType.toString()}'); } } @@ -211,8 +287,10 @@ class Type { return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; case BroadType.Compound: return '${compound!.name}'; + case BroadType.Enum: + return _primitives[enumNativeType]!.dart; case BroadType.NativeFunction: - return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFunc!.name}>'; + return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFunc!.type.getDartType(w)}>'; case BroadType .IncompleteArray: // Array parameters are treated as Pointers in C. return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; @@ -223,8 +301,19 @@ class Type { return _primitives[SupportedNativeType.Uint8]!.dart; case BroadType.Handle: return 'Object'; - default: - throw Exception('dart type unknown for ${broadType.toString()}'); + case BroadType.FunctionType: + return functionType!.getDartType(w); + case BroadType.Typealias: + // Typealias cannot be used by name in Dart types unless both the C and + // Dart type of the underlying types are same. + if (typealias!.type.sameDartAndCType(w)) { + return typealias!.name; + } else { + return typealias!.type.getDartType(w); + } + case BroadType.Unimplemented: + throw UnimplementedError( + 'dart type unknown for ${broadType.toString()}'); } } @@ -233,3 +322,66 @@ class Type { return 'Type: $broadType'; } } + +/// Represents a function type. +class FunctionType { + final Type returnType; + final List parameters; + + FunctionType({ + required this.returnType, + required this.parameters, + }); + + String getCType(Writer w, {bool writeArgumentNames = true}) { + final sb = StringBuffer(); + + // Write return Type. + sb.write(returnType.getCType(w)); + + // Write Function. + sb.write(' Function('); + sb.write(parameters.map((p) { + return '${p.type.getCType(w)} ${writeArgumentNames ? p.name : ""}'; + }).join(', ')); + sb.write(')'); + + return sb.toString(); + } + + String getDartType(Writer w, {bool writeArgumentNames = true}) { + final sb = StringBuffer(); + + // Write return Type. + sb.write(returnType.getDartType(w)); + + // Write Function. + sb.write(' Function('); + sb.write(parameters.map((p) { + return '${p.type.getDartType(w)} ${writeArgumentNames ? p.name : ""}'; + }).join(', ')); + sb.write(')'); + + return sb.toString(); + } + + void addDependencies(Set dependencies) { + returnType.addDependencies(dependencies); + parameters.forEach((p) => p.type.addDependencies(dependencies)); + } +} + +/// Represents a NativeFunction. +class NativeFunc { + final Type type; + + NativeFunc.fromFunctionType(FunctionType functionType) + : type = Type.functionType(functionType); + + NativeFunc.fromFunctionTypealias(Typealias typealias) + : type = Type.typealias(typealias); + + void addDependencies(Set dependencies) { + type.addDependencies(dependencies); + } +} diff --git a/pkgs/ffigen/lib/src/code_generator/typealias.dart b/pkgs/ffigen/lib/src/code_generator/typealias.dart new file mode 100644 index 0000000000..ada848efcd --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/typealias.dart @@ -0,0 +1,52 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; + +import 'binding_string.dart'; +import 'type.dart'; +import 'utils.dart'; +import 'writer.dart'; + +/// A simple Typealias, Expands to - +/// +/// ```dart +/// typedef $name = $type; +/// ); +/// ``` +class Typealias extends NoLookUpBinding { + final Type type; + + Typealias({ + String? usr, + String? originalName, + String? dartDoc, + required String name, + required this.type, + }) : super( + usr: usr, + name: name, + dartDoc: dartDoc, + originalName: originalName, + ); + + @override + void addDependencies(Set dependencies) { + if (dependencies.contains(this)) return; + + dependencies.add(this); + type.addDependencies(dependencies); + } + + @override + BindingString toBindingString(Writer w) { + final sb = StringBuffer(); + if (dartDoc != null) { + sb.write(makeDartDoc(dartDoc!)); + } + sb.write('typedef $name = ${type.getCType(w)};\n'); + return BindingString( + type: BindingStringType.typeDef, string: sb.toString()); + } +} diff --git a/pkgs/ffigen/lib/src/code_generator/typedef.dart b/pkgs/ffigen/lib/src/code_generator/typedef.dart deleted file mode 100644 index 53bc46ebb5..0000000000 --- a/pkgs/ffigen/lib/src/code_generator/typedef.dart +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'package:ffigen/src/code_generator.dart'; - -import 'func.dart' show Parameter; -import 'type.dart'; -import 'utils.dart'; -import 'writer.dart'; - -/// A simple typedef, Expands to - -/// -/// ```dart -/// typedef $name = $returnType Function( -/// $parameter1..., -/// $parameter2..., -/// . -/// . -/// ); -/// ``` -/// Return/Parameter types can be of for C/Dart signarture depending on [typedefType]. -/// -/// Note: re-set [name] after resolving name conflicts. -class Typedef { - String name; - String? dartDoc; - final Type returnType; - final TypedefType typedefType; - final List parameters; - - Typedef({ - required this.name, - this.dartDoc, - required this.returnType, - required this.typedefType, - List? parameters, - }) : parameters = parameters ?? []; - - /// Returns the [Typedef] dependencies required by this typedef including itself. - List getDependencies() { - final dep = []; - for (final p in parameters) { - final base = p.type.getBaseType(); - if (base.broadType == BroadType.NativeFunction) { - dep.addAll(base.nativeFunc!.getDependencies()); - } - } - final returnTypeBase = returnType.getBaseType(); - if (returnTypeBase.broadType == BroadType.NativeFunction) { - dep.addAll(returnTypeBase.nativeFunc!.getDependencies()); - } - dep.add(this); - return dep; - } - - String toTypedefString(Writer w) { - final s = StringBuffer(); - if (dartDoc != null) { - s.write(makeDartDoc(dartDoc!)); - } - final typedefName = name; - final paramNamer = UniqueNamer({}); - if (typedefType == TypedefType.C) { - s.write('typedef $typedefName = ${returnType.getCType(w)} Function(\n'); - for (final p in parameters) { - final name = p.name.isNotEmpty ? paramNamer.makeUnique(p.name) : p.name; - s.write(' ${p.type.getCType(w)} $name,\n'); - } - s.write(');\n\n'); - } else { - s.write( - 'typedef $typedefName = ${returnType.getDartType(w)} Function(\n'); - for (final p in parameters) { - final name = p.name.isNotEmpty ? paramNamer.makeUnique(p.name) : p.name; - - s.write(' ${p.type.getDartType(w)} $name,\n'); - } - s.write(');\n\n'); - } - - return s.toString(); - } -} - -enum TypedefType { C, Dart } diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index 10d1d57328..2b9a0c9636 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -5,7 +5,6 @@ import 'package:ffigen/src/code_generator/utils.dart'; import 'binding.dart'; -import 'typedef.dart'; /// To store generated String bindings. class Writer { @@ -165,20 +164,6 @@ class Writer { s.write("import 'dart:ffi' as $ffiLibraryPrefix;\n"); s.write('\n'); - // Will contain duplicates, must be processed. - final rawDependencies = []; - - /// Get typedef dependencies, these will be written at the end. - for (final b in lookUpBindings) { - rawDependencies.addAll(b.getTypedefDependencies(this)); - } - for (final b in noLookUpBindings) { - rawDependencies.addAll(b.getTypedefDependencies(this)); - } - - // Dependencies, processed to remove duplicates and resolve name conflicts. - final dependencies = processDependencies(rawDependencies); - /// Write [lookUpBindings]. if (lookUpBindings.isNotEmpty) { // Write doc comment for wrapper class. @@ -221,38 +206,8 @@ class Writer { s.write(b.toBindingString(this).string); } - // Write typedef dependencies. - for (final d in dependencies) { - s.write(d.toTypedefString(this)); - } - return s.toString(); } - - /// Removes duplicates and resolves all name conflicts. - Set processDependencies(List dependencies) { - final processedDependencies = dependencies.toSet(); - - for (final d in processedDependencies) { - d.name = _makeUniqueTypedefName(d.name); - } - return processedDependencies; - } - - /// Returns a typedef name that is unique in both top level and wrapper level, - /// ans only marks it as used at top-level. - String _makeUniqueTypedefName(String name) { - final base = name; - var uniqueName = name; - var suffix = 0; - while (topLevelUniqueNamer.isUsed(uniqueName) || - wrapperLevelUniqueNamer.isUsed(uniqueName)) { - suffix++; - uniqueName = base + suffix.toString(); - } - topLevelUniqueNamer.markUsed(uniqueName); - return uniqueName; - } } /// Manages the generated `_SymbolAddress` class. diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 92194dc1db..57c0019efd 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -63,6 +63,10 @@ class Config { Declaration get macroDecl => _macroDecl; late Declaration _macroDecl; + /// Declaration config for Typedefs. + Declaration get typedefs => _typedefs; + late Declaration _typedefs; + /// If generated bindings should be sorted alphabetically. bool get sort => _sort; late bool _sort; @@ -286,6 +290,15 @@ class Config { _macroDecl = result as Declaration; }, ), + [strings.typedefs]: Specification( + requirement: Requirement.no, + validator: declarationConfigValidator, + extractor: declarationConfigExtractor, + defaultValue: () => Declaration(), + extractedResult: (dynamic result) { + _typedefs = result as Declaration; + }, + ), [strings.sizemap]: Specification>( validator: sizemapValidator, extractor: sizemapExtractor, diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 0525565524..6f02100697 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -33,9 +33,10 @@ class Clang { } late final _clang_getCString_ptr = - _lookup>('clang_getCString'); - late final _dart_clang_getCString _clang_getCString = - _clang_getCString_ptr.asFunction<_dart_clang_getCString>(); + _lookup Function(CXString)>>( + 'clang_getCString'); + late final _clang_getCString = _clang_getCString_ptr + .asFunction Function(CXString)>(); /// Free the given string. void clang_disposeString( @@ -47,10 +48,10 @@ class Clang { } late final _clang_disposeString_ptr = - _lookup>( + _lookup>( 'clang_disposeString'); - late final _dart_clang_disposeString _clang_disposeString = - _clang_disposeString_ptr.asFunction<_dart_clang_disposeString>(); + late final _clang_disposeString = + _clang_disposeString_ptr.asFunction(); /// Provides a shared context for creating translation units. /// @@ -90,7 +91,7 @@ class Clang { /// This process of creating the 'pch', loading it separately, and using it (via /// -include-pch) allows 'excludeDeclsFromPCH' to remove redundant callbacks /// (which gives the indexer the same performance benefit as the compiler). - ffi.Pointer clang_createIndex( + CXIndex clang_createIndex( int excludeDeclarationsFromPCH, int displayDiagnostics, ) { @@ -101,16 +102,17 @@ class Clang { } late final _clang_createIndex_ptr = - _lookup>('clang_createIndex'); - late final _dart_clang_createIndex _clang_createIndex = - _clang_createIndex_ptr.asFunction<_dart_clang_createIndex>(); + _lookup>( + 'clang_createIndex'); + late final _clang_createIndex = + _clang_createIndex_ptr.asFunction(); /// Destroy the given index. /// /// The index must not be destroyed until all of the translation units created /// within that index have been destroyed. void clang_disposeIndex( - ffi.Pointer index, + CXIndex index, ) { return _clang_disposeIndex( index, @@ -118,13 +120,14 @@ class Clang { } late final _clang_disposeIndex_ptr = - _lookup>('clang_disposeIndex'); - late final _dart_clang_disposeIndex _clang_disposeIndex = - _clang_disposeIndex_ptr.asFunction<_dart_clang_disposeIndex>(); + _lookup>( + 'clang_disposeIndex'); + late final _clang_disposeIndex = + _clang_disposeIndex_ptr.asFunction(); /// Retrieve the complete file and path name of the given file. CXString clang_getFileName( - ffi.Pointer SFile, + CXFile SFile, ) { return _clang_getFileName( SFile, @@ -132,9 +135,10 @@ class Clang { } late final _clang_getFileName_ptr = - _lookup>('clang_getFileName'); - late final _dart_clang_getFileName _clang_getFileName = - _clang_getFileName_ptr.asFunction<_dart_clang_getFileName>(); + _lookup>( + 'clang_getFileName'); + late final _clang_getFileName = + _clang_getFileName_ptr.asFunction(); /// Determine whether two ranges are equivalent. /// @@ -149,10 +153,12 @@ class Clang { ); } - late final _clang_equalRanges_ptr = - _lookup>('clang_equalRanges'); - late final _dart_clang_equalRanges _clang_equalRanges = - _clang_equalRanges_ptr.asFunction<_dart_clang_equalRanges>(); + late final _clang_equalRanges_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint32 Function( + CXSourceRange, CXSourceRange)>>('clang_equalRanges'); + late final _clang_equalRanges = _clang_equalRanges_ptr + .asFunction(); /// Retrieve the file, line, column, and offset represented by /// the given source location. @@ -177,7 +183,7 @@ class Clang { /// buffer to which the given source location points. void clang_getFileLocation( CXSourceLocation location, - ffi.Pointer> file, + ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -191,16 +197,26 @@ class Clang { ); } - late final _clang_getFileLocation_ptr = - _lookup>( - 'clang_getFileLocation'); - late final _dart_clang_getFileLocation _clang_getFileLocation = - _clang_getFileLocation_ptr.asFunction<_dart_clang_getFileLocation>(); + late final _clang_getFileLocation_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_getFileLocation'); + late final _clang_getFileLocation = _clang_getFileLocation_ptr.asFunction< + void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Determine the number of diagnostics produced for the given /// translation unit. int clang_getNumDiagnostics( - ffi.Pointer Unit, + CXTranslationUnit Unit, ) { return _clang_getNumDiagnostics( Unit, @@ -208,10 +224,10 @@ class Clang { } late final _clang_getNumDiagnostics_ptr = - _lookup>( + _lookup>( 'clang_getNumDiagnostics'); - late final _dart_clang_getNumDiagnostics _clang_getNumDiagnostics = - _clang_getNumDiagnostics_ptr.asFunction<_dart_clang_getNumDiagnostics>(); + late final _clang_getNumDiagnostics = _clang_getNumDiagnostics_ptr + .asFunction(); /// Retrieve a diagnostic associated with the given translation unit. /// @@ -220,8 +236,8 @@ class Clang { /// /// \returns the requested diagnostic. This diagnostic must be freed /// via a call to \c clang_disposeDiagnostic(). - ffi.Pointer clang_getDiagnostic( - ffi.Pointer Unit, + CXDiagnostic clang_getDiagnostic( + CXTranslationUnit Unit, int Index, ) { return _clang_getDiagnostic( @@ -230,15 +246,16 @@ class Clang { ); } - late final _clang_getDiagnostic_ptr = - _lookup>( - 'clang_getDiagnostic'); - late final _dart_clang_getDiagnostic _clang_getDiagnostic = - _clang_getDiagnostic_ptr.asFunction<_dart_clang_getDiagnostic>(); + late final _clang_getDiagnostic_ptr = _lookup< + ffi.NativeFunction< + CXDiagnostic Function( + CXTranslationUnit, ffi.Uint32)>>('clang_getDiagnostic'); + late final _clang_getDiagnostic = _clang_getDiagnostic_ptr + .asFunction(); /// Destroy a diagnostic. void clang_disposeDiagnostic( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, ) { return _clang_disposeDiagnostic( Diagnostic, @@ -246,10 +263,10 @@ class Clang { } late final _clang_disposeDiagnostic_ptr = - _lookup>( + _lookup>( 'clang_disposeDiagnostic'); - late final _dart_clang_disposeDiagnostic _clang_disposeDiagnostic = - _clang_disposeDiagnostic_ptr.asFunction<_dart_clang_disposeDiagnostic>(); + late final _clang_disposeDiagnostic = + _clang_disposeDiagnostic_ptr.asFunction(); /// Format the given diagnostic in a manner that is suitable for display. /// @@ -265,7 +282,7 @@ class Clang { /// /// \returns A new string containing for formatted diagnostic. CXString clang_formatDiagnostic( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, int Options, ) { return _clang_formatDiagnostic( @@ -275,17 +292,17 @@ class Clang { } late final _clang_formatDiagnostic_ptr = - _lookup>( + _lookup>( 'clang_formatDiagnostic'); - late final _dart_clang_formatDiagnostic _clang_formatDiagnostic = - _clang_formatDiagnostic_ptr.asFunction<_dart_clang_formatDiagnostic>(); + late final _clang_formatDiagnostic = _clang_formatDiagnostic_ptr + .asFunction(); /// Same as \c clang_parseTranslationUnit2, but returns /// the \c CXTranslationUnit instead of an error code. In case of an error this /// routine returns a \c NULL \c CXTranslationUnit, without further detailed /// error codes. - ffi.Pointer clang_parseTranslationUnit( - ffi.Pointer CIdx, + CXTranslationUnit clang_parseTranslationUnit( + CXIndex CIdx, ffi.Pointer source_filename, ffi.Pointer> command_line_args, int num_command_line_args, @@ -304,16 +321,30 @@ class Clang { ); } - late final _clang_parseTranslationUnit_ptr = - _lookup>( - 'clang_parseTranslationUnit'); - late final _dart_clang_parseTranslationUnit _clang_parseTranslationUnit = - _clang_parseTranslationUnit_ptr - .asFunction<_dart_clang_parseTranslationUnit>(); + late final _clang_parseTranslationUnit_ptr = _lookup< + ffi.NativeFunction< + CXTranslationUnit Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + ffi.Int32, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32)>>('clang_parseTranslationUnit'); + late final _clang_parseTranslationUnit = + _clang_parseTranslationUnit_ptr.asFunction< + CXTranslationUnit Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + int)>(); /// Destroy the specified CXTranslationUnit object. void clang_disposeTranslationUnit( - ffi.Pointer arg0, + CXTranslationUnit arg0, ) { return _clang_disposeTranslationUnit( arg0, @@ -321,18 +352,17 @@ class Clang { } late final _clang_disposeTranslationUnit_ptr = - _lookup>( + _lookup>( 'clang_disposeTranslationUnit'); - late final _dart_clang_disposeTranslationUnit _clang_disposeTranslationUnit = - _clang_disposeTranslationUnit_ptr - .asFunction<_dart_clang_disposeTranslationUnit>(); + late final _clang_disposeTranslationUnit = _clang_disposeTranslationUnit_ptr + .asFunction(); /// 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, + CXTranslationUnit arg0, ) { return _clang_getTranslationUnitCursor( arg0, @@ -340,11 +370,11 @@ class Clang { } late final _clang_getTranslationUnitCursor_ptr = - _lookup>( + _lookup>( 'clang_getTranslationUnitCursor'); - late final _dart_clang_getTranslationUnitCursor - _clang_getTranslationUnitCursor = _clang_getTranslationUnitCursor_ptr - .asFunction<_dart_clang_getTranslationUnitCursor>(); + late final _clang_getTranslationUnitCursor = + _clang_getTranslationUnitCursor_ptr + .asFunction(); /// Returns non-zero if \p cursor is null. int clang_Cursor_isNull( @@ -356,10 +386,10 @@ class Clang { } late final _clang_Cursor_isNull_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isNull'); - late final _dart_clang_Cursor_isNull _clang_Cursor_isNull = - _clang_Cursor_isNull_ptr.asFunction<_dart_clang_Cursor_isNull>(); + late final _clang_Cursor_isNull = + _clang_Cursor_isNull_ptr.asFunction(); /// Retrieve the kind of the given cursor. int clang_getCursorKind( @@ -371,10 +401,10 @@ class Clang { } late final _clang_getCursorKind_ptr = - _lookup>( + _lookup>( 'clang_getCursorKind'); - late final _dart_clang_getCursorKind _clang_getCursorKind = - _clang_getCursorKind_ptr.asFunction<_dart_clang_getCursorKind>(); + late final _clang_getCursorKind = + _clang_getCursorKind_ptr.asFunction(); /// Determine whether the given cursor has any attributes. int clang_Cursor_hasAttrs( @@ -386,10 +416,10 @@ class Clang { } late final _clang_Cursor_hasAttrs_ptr = - _lookup>( + _lookup>( 'clang_Cursor_hasAttrs'); - late final _dart_clang_Cursor_hasAttrs _clang_Cursor_hasAttrs = - _clang_Cursor_hasAttrs_ptr.asFunction<_dart_clang_Cursor_hasAttrs>(); + late final _clang_Cursor_hasAttrs = + _clang_Cursor_hasAttrs_ptr.asFunction(); /// Retrieve the physical location of the source constructor referenced /// by the given cursor. @@ -408,10 +438,10 @@ class Clang { } late final _clang_getCursorLocation_ptr = - _lookup>( + _lookup>( 'clang_getCursorLocation'); - late final _dart_clang_getCursorLocation _clang_getCursorLocation = - _clang_getCursorLocation_ptr.asFunction<_dart_clang_getCursorLocation>(); + late final _clang_getCursorLocation = _clang_getCursorLocation_ptr + .asFunction(); /// Retrieve the type of a CXCursor (if any). CXType clang_getCursorType( @@ -423,10 +453,10 @@ class Clang { } late final _clang_getCursorType_ptr = - _lookup>( + _lookup>( 'clang_getCursorType'); - late final _dart_clang_getCursorType _clang_getCursorType = - _clang_getCursorType_ptr.asFunction<_dart_clang_getCursorType>(); + late final _clang_getCursorType = + _clang_getCursorType_ptr.asFunction(); /// Pretty-print the underlying type using the rules of the /// language of the translation unit from which it came. @@ -441,10 +471,10 @@ class Clang { } late final _clang_getTypeSpelling_ptr = - _lookup>( + _lookup>( 'clang_getTypeSpelling'); - late final _dart_clang_getTypeSpelling _clang_getTypeSpelling = - _clang_getTypeSpelling_ptr.asFunction<_dart_clang_getTypeSpelling>(); + late final _clang_getTypeSpelling = + _clang_getTypeSpelling_ptr.asFunction(); /// Retrieve the underlying type of a typedef declaration. /// @@ -459,12 +489,11 @@ class Clang { } late final _clang_getTypedefDeclUnderlyingType_ptr = - _lookup>( + _lookup>( 'clang_getTypedefDeclUnderlyingType'); - late final _dart_clang_getTypedefDeclUnderlyingType - _clang_getTypedefDeclUnderlyingType = + late final _clang_getTypedefDeclUnderlyingType = _clang_getTypedefDeclUnderlyingType_ptr - .asFunction<_dart_clang_getTypedefDeclUnderlyingType>(); + .asFunction(); /// Retrieve the integer value of an enum constant declaration as a signed /// long long. @@ -481,11 +510,10 @@ class Clang { } late final _clang_getEnumConstantDeclValue_ptr = - _lookup>( + _lookup>( 'clang_getEnumConstantDeclValue'); - late final _dart_clang_getEnumConstantDeclValue - _clang_getEnumConstantDeclValue = _clang_getEnumConstantDeclValue_ptr - .asFunction<_dart_clang_getEnumConstantDeclValue>(); + late final _clang_getEnumConstantDeclValue = + _clang_getEnumConstantDeclValue_ptr.asFunction(); /// Retrieve the bit width of a bit field declaration as an integer. /// @@ -499,11 +527,10 @@ class Clang { } late final _clang_getFieldDeclBitWidth_ptr = - _lookup>( + _lookup>( 'clang_getFieldDeclBitWidth'); - late final _dart_clang_getFieldDeclBitWidth _clang_getFieldDeclBitWidth = - _clang_getFieldDeclBitWidth_ptr - .asFunction<_dart_clang_getFieldDeclBitWidth>(); + late final _clang_getFieldDeclBitWidth = + _clang_getFieldDeclBitWidth_ptr.asFunction(); /// Retrieve the number of non-variadic arguments associated with a given /// cursor. @@ -519,11 +546,10 @@ class Clang { } late final _clang_Cursor_getNumArguments_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getNumArguments'); - late final _dart_clang_Cursor_getNumArguments _clang_Cursor_getNumArguments = - _clang_Cursor_getNumArguments_ptr - .asFunction<_dart_clang_Cursor_getNumArguments>(); + late final _clang_Cursor_getNumArguments = + _clang_Cursor_getNumArguments_ptr.asFunction(); /// Retrieve the argument cursor of a function or method. /// @@ -541,11 +567,10 @@ class Clang { } late final _clang_Cursor_getArgument_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getArgument'); - late final _dart_clang_Cursor_getArgument _clang_Cursor_getArgument = - _clang_Cursor_getArgument_ptr - .asFunction<_dart_clang_Cursor_getArgument>(); + late final _clang_Cursor_getArgument = _clang_Cursor_getArgument_ptr + .asFunction(); /// Return the canonical type for a CXType. /// @@ -562,10 +587,10 @@ class Clang { } late final _clang_getCanonicalType_ptr = - _lookup>( + _lookup>( 'clang_getCanonicalType'); - late final _dart_clang_getCanonicalType _clang_getCanonicalType = - _clang_getCanonicalType_ptr.asFunction<_dart_clang_getCanonicalType>(); + late final _clang_getCanonicalType = + _clang_getCanonicalType_ptr.asFunction(); /// Determine whether a CXCursor that is a macro, is /// function like. @@ -578,11 +603,11 @@ class Clang { } late final _clang_Cursor_isMacroFunctionLike_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isMacroFunctionLike'); - late final _dart_clang_Cursor_isMacroFunctionLike - _clang_Cursor_isMacroFunctionLike = _clang_Cursor_isMacroFunctionLike_ptr - .asFunction<_dart_clang_Cursor_isMacroFunctionLike>(); + late final _clang_Cursor_isMacroFunctionLike = + _clang_Cursor_isMacroFunctionLike_ptr + .asFunction(); /// Determine whether a CXCursor that is a macro, is a /// builtin one. @@ -595,11 +620,10 @@ class Clang { } late final _clang_Cursor_isMacroBuiltin_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isMacroBuiltin'); - late final _dart_clang_Cursor_isMacroBuiltin _clang_Cursor_isMacroBuiltin = - _clang_Cursor_isMacroBuiltin_ptr - .asFunction<_dart_clang_Cursor_isMacroBuiltin>(); + late final _clang_Cursor_isMacroBuiltin = + _clang_Cursor_isMacroBuiltin_ptr.asFunction(); /// Determine whether a CXCursor that is a function declaration, is an /// inline declaration. @@ -612,11 +636,10 @@ class Clang { } late final _clang_Cursor_isFunctionInlined_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isFunctionInlined'); - late final _dart_clang_Cursor_isFunctionInlined - _clang_Cursor_isFunctionInlined = _clang_Cursor_isFunctionInlined_ptr - .asFunction<_dart_clang_Cursor_isFunctionInlined>(); + late final _clang_Cursor_isFunctionInlined = + _clang_Cursor_isFunctionInlined_ptr.asFunction(); /// Returns the typedef name of the given type. CXString clang_getTypedefName( @@ -628,10 +651,10 @@ class Clang { } late final _clang_getTypedefName_ptr = - _lookup>( + _lookup>( 'clang_getTypedefName'); - late final _dart_clang_getTypedefName _clang_getTypedefName = - _clang_getTypedefName_ptr.asFunction<_dart_clang_getTypedefName>(); + late final _clang_getTypedefName = + _clang_getTypedefName_ptr.asFunction(); /// For pointer types, returns the type of the pointee. CXType clang_getPointeeType( @@ -643,10 +666,10 @@ class Clang { } late final _clang_getPointeeType_ptr = - _lookup>( + _lookup>( 'clang_getPointeeType'); - late final _dart_clang_getPointeeType _clang_getPointeeType = - _clang_getPointeeType_ptr.asFunction<_dart_clang_getPointeeType>(); + late final _clang_getPointeeType = + _clang_getPointeeType_ptr.asFunction(); /// Return the cursor for the declaration of the given type. CXCursor clang_getTypeDeclaration( @@ -658,11 +681,10 @@ class Clang { } late final _clang_getTypeDeclaration_ptr = - _lookup>( + _lookup>( 'clang_getTypeDeclaration'); - late final _dart_clang_getTypeDeclaration _clang_getTypeDeclaration = - _clang_getTypeDeclaration_ptr - .asFunction<_dart_clang_getTypeDeclaration>(); + late final _clang_getTypeDeclaration = + _clang_getTypeDeclaration_ptr.asFunction(); /// Retrieve the spelling of a given CXTypeKind. CXString clang_getTypeKindSpelling( @@ -674,11 +696,10 @@ class Clang { } late final _clang_getTypeKindSpelling_ptr = - _lookup>( + _lookup>( 'clang_getTypeKindSpelling'); - late final _dart_clang_getTypeKindSpelling _clang_getTypeKindSpelling = - _clang_getTypeKindSpelling_ptr - .asFunction<_dart_clang_getTypeKindSpelling>(); + late final _clang_getTypeKindSpelling = + _clang_getTypeKindSpelling_ptr.asFunction(); /// Retrieve the return type associated with a function type. /// @@ -692,10 +713,10 @@ class Clang { } late final _clang_getResultType_ptr = - _lookup>( + _lookup>( 'clang_getResultType'); - late final _dart_clang_getResultType _clang_getResultType = - _clang_getResultType_ptr.asFunction<_dart_clang_getResultType>(); + late final _clang_getResultType = + _clang_getResultType_ptr.asFunction(); /// Retrieve the number of non-variadic parameters associated with a /// function type. @@ -710,10 +731,10 @@ class Clang { } late final _clang_getNumArgTypes_ptr = - _lookup>( + _lookup>( 'clang_getNumArgTypes'); - late final _dart_clang_getNumArgTypes _clang_getNumArgTypes = - _clang_getNumArgTypes_ptr.asFunction<_dart_clang_getNumArgTypes>(); + late final _clang_getNumArgTypes = + _clang_getNumArgTypes_ptr.asFunction(); /// Retrieve the type of a parameter of a function type. /// @@ -730,9 +751,10 @@ class Clang { } late final _clang_getArgType_ptr = - _lookup>('clang_getArgType'); - late final _dart_clang_getArgType _clang_getArgType = - _clang_getArgType_ptr.asFunction<_dart_clang_getArgType>(); + _lookup>( + 'clang_getArgType'); + late final _clang_getArgType = + _clang_getArgType_ptr.asFunction(); /// Return the number of elements of an array or vector type. /// @@ -747,10 +769,10 @@ class Clang { } late final _clang_getNumElements_ptr = - _lookup>( + _lookup>( 'clang_getNumElements'); - late final _dart_clang_getNumElements _clang_getNumElements = - _clang_getNumElements_ptr.asFunction<_dart_clang_getNumElements>(); + late final _clang_getNumElements = + _clang_getNumElements_ptr.asFunction(); /// Return the element type of an array type. /// @@ -764,11 +786,10 @@ class Clang { } late final _clang_getArrayElementType_ptr = - _lookup>( + _lookup>( 'clang_getArrayElementType'); - late final _dart_clang_getArrayElementType _clang_getArrayElementType = - _clang_getArrayElementType_ptr - .asFunction<_dart_clang_getArrayElementType>(); + late final _clang_getArrayElementType = + _clang_getArrayElementType_ptr.asFunction(); /// Retrieve the type named by the qualified-id. /// @@ -782,10 +803,10 @@ class Clang { } late final _clang_Type_getNamedType_ptr = - _lookup>( + _lookup>( 'clang_Type_getNamedType'); - late final _dart_clang_Type_getNamedType _clang_Type_getNamedType = - _clang_Type_getNamedType_ptr.asFunction<_dart_clang_Type_getNamedType>(); + late final _clang_Type_getNamedType = + _clang_Type_getNamedType_ptr.asFunction(); /// Return the alignment of a type in bytes as per C++[expr.alignof] /// standard. @@ -806,10 +827,10 @@ class Clang { } late final _clang_Type_getAlignOf_ptr = - _lookup>( + _lookup>( 'clang_Type_getAlignOf'); - late final _dart_clang_Type_getAlignOf _clang_Type_getAlignOf = - _clang_Type_getAlignOf_ptr.asFunction<_dart_clang_Type_getAlignOf>(); + late final _clang_Type_getAlignOf = + _clang_Type_getAlignOf_ptr.asFunction(); /// Determine whether the given cursor represents an anonymous /// tag or namespace @@ -822,11 +843,10 @@ class Clang { } late final _clang_Cursor_isAnonymous_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isAnonymous'); - late final _dart_clang_Cursor_isAnonymous _clang_Cursor_isAnonymous = - _clang_Cursor_isAnonymous_ptr - .asFunction<_dart_clang_Cursor_isAnonymous>(); + late final _clang_Cursor_isAnonymous = + _clang_Cursor_isAnonymous_ptr.asFunction(); /// Determine whether the given cursor represents an anonymous record /// declaration. @@ -839,12 +859,11 @@ class Clang { } late final _clang_Cursor_isAnonymousRecordDecl_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isAnonymousRecordDecl'); - late final _dart_clang_Cursor_isAnonymousRecordDecl - _clang_Cursor_isAnonymousRecordDecl = + late final _clang_Cursor_isAnonymousRecordDecl = _clang_Cursor_isAnonymousRecordDecl_ptr - .asFunction<_dart_clang_Cursor_isAnonymousRecordDecl>(); + .asFunction(); /// Visit the children of a particular cursor. /// @@ -868,8 +887,8 @@ class Clang { /// prematurely by the visitor returning \c CXChildVisit_Break. int clang_visitChildren( CXCursor parent, - ffi.Pointer> visitor, - ffi.Pointer client_data, + CXCursorVisitor visitor, + CXClientData client_data, ) { return _clang_visitChildren( parent, @@ -878,11 +897,12 @@ class Clang { ); } - late final _clang_visitChildren_ptr = - _lookup>( - 'clang_visitChildren'); - late final _dart_clang_visitChildren _clang_visitChildren = - _clang_visitChildren_ptr.asFunction<_dart_clang_visitChildren>(); + late final _clang_visitChildren_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint32 Function( + CXCursor, CXCursorVisitor, CXClientData)>>('clang_visitChildren'); + late final _clang_visitChildren = _clang_visitChildren_ptr + .asFunction(); /// Retrieve a Unified Symbol Resolution (USR) for the entity referenced /// by the given cursor. @@ -900,9 +920,10 @@ class Clang { } late final _clang_getCursorUSR_ptr = - _lookup>('clang_getCursorUSR'); - late final _dart_clang_getCursorUSR _clang_getCursorUSR = - _clang_getCursorUSR_ptr.asFunction<_dart_clang_getCursorUSR>(); + _lookup>( + 'clang_getCursorUSR'); + late final _clang_getCursorUSR = + _clang_getCursorUSR_ptr.asFunction(); /// Retrieve a name for the entity referenced by this cursor. CXString clang_getCursorSpelling( @@ -914,10 +935,10 @@ class Clang { } late final _clang_getCursorSpelling_ptr = - _lookup>( + _lookup>( 'clang_getCursorSpelling'); - late final _dart_clang_getCursorSpelling _clang_getCursorSpelling = - _clang_getCursorSpelling_ptr.asFunction<_dart_clang_getCursorSpelling>(); + late final _clang_getCursorSpelling = + _clang_getCursorSpelling_ptr.asFunction(); /// For a cursor that is either a reference to or a declaration /// of some entity, retrieve a cursor that describes the definition of @@ -954,11 +975,10 @@ class Clang { } late final _clang_getCursorDefinition_ptr = - _lookup>( + _lookup>( 'clang_getCursorDefinition'); - late final _dart_clang_getCursorDefinition _clang_getCursorDefinition = - _clang_getCursorDefinition_ptr - .asFunction<_dart_clang_getCursorDefinition>(); + late final _clang_getCursorDefinition = + _clang_getCursorDefinition_ptr.asFunction(); /// Given a cursor that represents a declaration, return the associated /// comment's source range. The range may include multiple consecutive comments @@ -972,11 +992,10 @@ class Clang { } late final _clang_Cursor_getCommentRange_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getCommentRange'); - late final _dart_clang_Cursor_getCommentRange _clang_Cursor_getCommentRange = - _clang_Cursor_getCommentRange_ptr - .asFunction<_dart_clang_Cursor_getCommentRange>(); + late final _clang_Cursor_getCommentRange = _clang_Cursor_getCommentRange_ptr + .asFunction(); /// Given a cursor that represents a declaration, return the associated /// comment text, including comment markers. @@ -989,11 +1008,11 @@ class Clang { } late final _clang_Cursor_getRawCommentText_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getRawCommentText'); - late final _dart_clang_Cursor_getRawCommentText - _clang_Cursor_getRawCommentText = _clang_Cursor_getRawCommentText_ptr - .asFunction<_dart_clang_Cursor_getRawCommentText>(); + late final _clang_Cursor_getRawCommentText = + _clang_Cursor_getRawCommentText_ptr + .asFunction(); /// Given a cursor that represents a documentable entity (e.g., /// declaration), return the associated \paragraph; otherwise return the @@ -1007,11 +1026,11 @@ class Clang { } late final _clang_Cursor_getBriefCommentText_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getBriefCommentText'); - late final _dart_clang_Cursor_getBriefCommentText - _clang_Cursor_getBriefCommentText = _clang_Cursor_getBriefCommentText_ptr - .asFunction<_dart_clang_Cursor_getBriefCommentText>(); + late final _clang_Cursor_getBriefCommentText = + _clang_Cursor_getBriefCommentText_ptr + .asFunction(); /// \defgroup CINDEX_DEBUG Debugging facilities /// @@ -1028,16 +1047,15 @@ class Clang { } late final _clang_getCursorKindSpelling_ptr = - _lookup>( + _lookup>( 'clang_getCursorKindSpelling'); - late final _dart_clang_getCursorKindSpelling _clang_getCursorKindSpelling = - _clang_getCursorKindSpelling_ptr - .asFunction<_dart_clang_getCursorKindSpelling>(); + late final _clang_getCursorKindSpelling = + _clang_getCursorKindSpelling_ptr.asFunction(); /// 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( + CXEvalResult clang_Cursor_Evaluate( CXCursor C, ) { return _clang_Cursor_Evaluate( @@ -1046,14 +1064,14 @@ class Clang { } late final _clang_Cursor_Evaluate_ptr = - _lookup>( + _lookup>( 'clang_Cursor_Evaluate'); - late final _dart_clang_Cursor_Evaluate _clang_Cursor_Evaluate = - _clang_Cursor_Evaluate_ptr.asFunction<_dart_clang_Cursor_Evaluate>(); + late final _clang_Cursor_Evaluate = + _clang_Cursor_Evaluate_ptr.asFunction(); /// Returns the kind of the evaluated result. int clang_EvalResult_getKind( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getKind( E, @@ -1061,16 +1079,15 @@ class Clang { } late final _clang_EvalResult_getKind_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_getKind'); - late final _dart_clang_EvalResult_getKind _clang_EvalResult_getKind = - _clang_EvalResult_getKind_ptr - .asFunction<_dart_clang_EvalResult_getKind>(); + late final _clang_EvalResult_getKind = + _clang_EvalResult_getKind_ptr.asFunction(); /// Returns the evaluation result as integer if the /// kind is Int. int clang_EvalResult_getAsInt( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getAsInt( E, @@ -1078,17 +1095,16 @@ class Clang { } late final _clang_EvalResult_getAsInt_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsInt'); - late final _dart_clang_EvalResult_getAsInt _clang_EvalResult_getAsInt = - _clang_EvalResult_getAsInt_ptr - .asFunction<_dart_clang_EvalResult_getAsInt>(); + late final _clang_EvalResult_getAsInt = + _clang_EvalResult_getAsInt_ptr.asFunction(); /// 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, + CXEvalResult E, ) { return _clang_EvalResult_getAsLongLong( E, @@ -1096,16 +1112,16 @@ class Clang { } late final _clang_EvalResult_getAsLongLong_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsLongLong'); - late final _dart_clang_EvalResult_getAsLongLong - _clang_EvalResult_getAsLongLong = _clang_EvalResult_getAsLongLong_ptr - .asFunction<_dart_clang_EvalResult_getAsLongLong>(); + late final _clang_EvalResult_getAsLongLong = + _clang_EvalResult_getAsLongLong_ptr + .asFunction(); /// Returns the evaluation result as double if the /// kind is double. double clang_EvalResult_getAsDouble( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getAsDouble( E, @@ -1113,18 +1129,17 @@ class Clang { } late final _clang_EvalResult_getAsDouble_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsDouble'); - late final _dart_clang_EvalResult_getAsDouble _clang_EvalResult_getAsDouble = - _clang_EvalResult_getAsDouble_ptr - .asFunction<_dart_clang_EvalResult_getAsDouble>(); + late final _clang_EvalResult_getAsDouble = _clang_EvalResult_getAsDouble_ptr + .asFunction(); /// 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, + CXEvalResult E, ) { return _clang_EvalResult_getAsStr( E, @@ -1132,15 +1147,14 @@ class Clang { } late final _clang_EvalResult_getAsStr_ptr = - _lookup>( + _lookup Function(CXEvalResult)>>( 'clang_EvalResult_getAsStr'); - late final _dart_clang_EvalResult_getAsStr _clang_EvalResult_getAsStr = - _clang_EvalResult_getAsStr_ptr - .asFunction<_dart_clang_EvalResult_getAsStr>(); + late final _clang_EvalResult_getAsStr = _clang_EvalResult_getAsStr_ptr + .asFunction Function(CXEvalResult)>(); /// Disposes the created Eval memory. void clang_EvalResult_dispose( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_dispose( E, @@ -1148,11 +1162,10 @@ class Clang { } late final _clang_EvalResult_dispose_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_dispose'); - late final _dart_clang_EvalResult_dispose _clang_EvalResult_dispose = - _clang_EvalResult_dispose_ptr - .asFunction<_dart_clang_EvalResult_dispose>(); + late final _clang_EvalResult_dispose = + _clang_EvalResult_dispose_ptr.asFunction(); } /// A character string. @@ -1189,6 +1202,13 @@ class CXUnsavedFile extends ffi.Struct { external int Length; } +/// An "index" that consists of a set of translation units that would +/// typically be linked together into an executable or library. +typedef CXIndex = ffi.Pointer; + +/// A particular source file that is part of a translation unit. +typedef CXFile = ffi.Pointer; + /// Identifies a specific source location within a translation /// unit. /// @@ -1217,6 +1237,13 @@ class CXSourceRange extends ffi.Struct { external int end_int_data; } +/// A single translation unit, which resides in an index. +typedef CXTranslationUnit = ffi.Pointer; + +/// A single diagnostic, containing the diagnostic's severity, +/// location, text, source ranges, and fix-it hints. +typedef CXDiagnostic = ffi.Pointer; + /// Options to control the display of diagnostics. /// /// The values in this enum are meant to be combined to customize the @@ -2361,6 +2388,23 @@ abstract class CXChildVisitResult { static const int CXChildVisit_Recurse = 2; } +/// Visitor invoked for each cursor found by a traversal. +/// +/// This visitor function will be invoked for each cursor found by +/// clang_visitCursorChildren(). Its first argument is the cursor being +/// visited, its second argument is the parent visitor for that cursor, +/// and its third argument is the client data provided to +/// clang_visitCursorChildren(). +/// +/// The visitor should return one of the \c CXChildVisitResult values +/// to direct clang_visitCursorChildren(). +typedef CXCursorVisitor = ffi.Pointer< + ffi.NativeFunction>; + +/// Opaque pointer representing client data that will be passed through +/// to various callbacks and visitors. +typedef CXClientData = ffi.Pointer; + abstract class CXEvalResultKind { static const int CXEval_Int = 1; static const int CXEval_Float = 2; @@ -2371,6 +2415,9 @@ abstract class CXEvalResultKind { static const int CXEval_UnExposed = 0; } +/// Evaluation result of a cursor +typedef CXEvalResult = ffi.Pointer; + const int CINDEX_VERSION_MAJOR = 0; const int CINDEX_VERSION_MINOR = 59; @@ -2378,503 +2425,3 @@ 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_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_getFileName = CXString Function( - ffi.Pointer SFile, -); - -typedef _dart_clang_getFileName = CXString Function( - ffi.Pointer SFile, -); - -typedef _c_clang_equalRanges = ffi.Uint32 Function( - CXSourceRange range1, - CXSourceRange range2, -); - -typedef _dart_clang_equalRanges = int Function( - CXSourceRange range1, - CXSourceRange range2, -); - -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_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_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_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_disposeTranslationUnit = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_disposeTranslationUnit = void Function( - ffi.Pointer arg0, -); - -typedef _c_clang_getTranslationUnitCursor = CXCursor Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getTranslationUnitCursor = CXCursor Function( - ffi.Pointer arg0, -); - -typedef _c_clang_Cursor_isNull = ffi.Int32 Function( - CXCursor cursor, -); - -typedef _dart_clang_Cursor_isNull = int Function( - CXCursor cursor, -); - -typedef _c_clang_getCursorKind = ffi.Int32 Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorKind = int Function( - CXCursor arg0, -); - -typedef _c_clang_Cursor_hasAttrs = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_hasAttrs = int Function( - CXCursor C, -); - -typedef _c_clang_getCursorLocation = CXSourceLocation Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorLocation = CXSourceLocation 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_getEnumConstantDeclValue = ffi.Int64 Function( - CXCursor C, -); - -typedef _dart_clang_getEnumConstantDeclValue = 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_getCanonicalType = CXType Function( - CXType T, -); - -typedef _dart_clang_getCanonicalType = CXType Function( - CXType T, -); - -typedef _c_clang_Cursor_isMacroFunctionLike = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isMacroFunctionLike = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isMacroBuiltin = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isMacroBuiltin = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isFunctionInlined = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isFunctionInlined = int Function( - CXCursor C, -); - -typedef _c_clang_getTypedefName = CXString Function( - CXType CT, -); - -typedef _dart_clang_getTypedefName = CXString Function( - CXType CT, -); - -typedef _c_clang_getPointeeType = CXType Function( - CXType T, -); - -typedef _dart_clang_getPointeeType = CXType Function( - CXType T, -); - -typedef _c_clang_getTypeDeclaration = CXCursor Function( - CXType T, -); - -typedef _dart_clang_getTypeDeclaration = CXCursor Function( - CXType T, -); - -typedef _c_clang_getTypeKindSpelling = CXString Function( - ffi.Int32 K, -); - -typedef _dart_clang_getTypeKindSpelling = CXString Function( - int K, -); - -typedef _c_clang_getResultType = CXType Function( - CXType T, -); - -typedef _dart_clang_getResultType = CXType Function( - CXType T, -); - -typedef _c_clang_getNumArgTypes = ffi.Int32 Function( - CXType T, -); - -typedef _dart_clang_getNumArgTypes = int Function( - CXType T, -); - -typedef _c_clang_getArgType = CXType Function( - CXType T, - ffi.Uint32 i, -); - -typedef _dart_clang_getArgType = CXType Function( - CXType T, - int i, -); - -typedef _c_clang_getNumElements = ffi.Int64 Function( - CXType T, -); - -typedef _dart_clang_getNumElements = int Function( - CXType T, -); - -typedef _c_clang_getArrayElementType = CXType Function( - CXType T, -); - -typedef _dart_clang_getArrayElementType = CXType Function( - CXType T, -); - -typedef _c_clang_Type_getNamedType = CXType Function( - CXType T, -); - -typedef _dart_clang_Type_getNamedType = CXType Function( - CXType T, -); - -typedef _c_clang_Type_getAlignOf = ffi.Int64 Function( - CXType T, -); - -typedef _dart_clang_Type_getAlignOf = int Function( - CXType T, -); - -typedef _c_clang_Cursor_isAnonymous = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isAnonymous = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isAnonymousRecordDecl = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isAnonymousRecordDecl = int Function( - CXCursor C, -); - -typedef CXCursorVisitor = ffi.Int32 Function( - CXCursor, - CXCursor, - ffi.Pointer, -); - -typedef _c_clang_visitChildren = ffi.Uint32 Function( - CXCursor parent, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); - -typedef _dart_clang_visitChildren = int Function( - CXCursor parent, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); - -typedef _c_clang_getCursorUSR = CXString Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorUSR = CXString Function( - CXCursor arg0, -); - -typedef _c_clang_getCursorSpelling = CXString Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorSpelling = CXString Function( - CXCursor arg0, -); - -typedef _c_clang_getCursorDefinition = CXCursor Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorDefinition = CXCursor Function( - CXCursor arg0, -); - -typedef _c_clang_Cursor_getCommentRange = CXSourceRange Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getCommentRange = CXSourceRange Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getRawCommentText = CXString Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getRawCommentText = CXString Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getBriefCommentText = CXString Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getBriefCommentText = CXString Function( - CXCursor C, -); - -typedef _c_clang_getCursorKindSpelling = CXString Function( - ffi.Int32 Kind, -); - -typedef _dart_clang_getCursorKindSpelling = CXString Function( - int Kind, -); - -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, -); - -typedef _dart_clang_EvalResult_getKind = int Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsInt = ffi.Int32 Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsInt = int Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsLongLong = ffi.Int64 Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsLongLong = int Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsDouble = ffi.Double Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsDouble = double Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsStr = ffi.Pointer Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsStr = ffi.Pointer Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_dispose = ffi.Void Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_dispose = void Function( - ffi.Pointer E, -); diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart index 1cd4ff16b0..9211d5fa0b 100644 --- a/pkgs/ffigen/lib/src/header_parser/includer.dart +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -2,83 +2,61 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'data.dart'; - /// Utility functions to check whether a binding should be parsed or not /// based on filters. -bool shouldIncludeStruct(String usr, String name) { - if (bindingsIndex.isSeenStruct(usr) || name == '') { +import 'data.dart'; + +bool _shouldIncludeDecl(String usr, String name, + bool Function(String) isSeenDecl, bool Function(String) configIncludes) { + if (isSeenDecl(usr) || name == '') { return false; - } else if (config.structDecl.shouldInclude(name)) { + } else if (configIncludes(name)) { return true; } else { return false; } } +bool shouldIncludeStruct(String usr, String name) { + return _shouldIncludeDecl( + usr, name, bindingsIndex.isSeenStruct, config.structDecl.shouldInclude); +} + bool shouldIncludeUnion(String usr, String name) { - if (bindingsIndex.isSeenStruct(usr) || name == '') { - return false; - } else if (config.unionDecl.shouldInclude(name)) { - return true; - } else { - return false; - } + return _shouldIncludeDecl( + usr, name, bindingsIndex.isSeenUnion, config.unionDecl.shouldInclude); } bool shouldIncludeFunc(String usr, String name) { - if (bindingsIndex.isSeenFunc(usr) || name == '') { - return false; - } else if (config.functionDecl.shouldInclude(name)) { - return true; - } else { - return false; - } + return _shouldIncludeDecl( + usr, name, bindingsIndex.isSeenFunc, config.functionDecl.shouldInclude); } bool shouldIncludeEnumClass(String usr, String name) { - if (bindingsIndex.isSeenEnumClass(usr) || name == '') { - return false; - } else if (config.enumClassDecl.shouldInclude(name)) { - return true; - } else { - return false; - } + return _shouldIncludeDecl(usr, name, bindingsIndex.isSeenEnumClass, + config.enumClassDecl.shouldInclude); } bool shouldIncludeUnnamedEnumConstant(String usr, String name) { - if (bindingsIndex.isSeenUnnamedEnumConstant(usr) || name == '') { - return false; - } else if (config.unnamedEnumConstants.shouldInclude(name)) { - return true; - } else { - return false; - } + return _shouldIncludeDecl(usr, name, bindingsIndex.isSeenUnnamedEnumConstant, + config.unnamedEnumConstants.shouldInclude); } bool shouldIncludeGlobalVar(String usr, String name) { - if (bindingsIndex.isSeenGlobalVar(usr) || name == '') { - return false; - } else if (config.globals.shouldInclude(name)) { - return true; - } else { - return false; - } + return _shouldIncludeDecl( + usr, name, bindingsIndex.isSeenGlobalVar, config.globals.shouldInclude); } bool shouldIncludeMacro(String usr, String name) { - if (bindingsIndex.isSeenMacro(usr) || name == '') { - return false; - } else if (config.macroDecl.shouldInclude(name)) { - return true; - } else { - return false; - } + return _shouldIncludeDecl( + usr, name, bindingsIndex.isSeenMacro, config.macroDecl.shouldInclude); } -/// Cache for headers. -final _headerCache = {}; +bool shouldIncludeTypealias(String usr, String name) { + return _shouldIncludeDecl( + usr, name, bindingsIndex.isSeenTypealias, config.typedefs.shouldInclude); +} /// True if a cursor should be included based on headers config, used on root /// declarations. @@ -88,11 +66,11 @@ bool shouldIncludeRootCursor(String sourceFile) { return false; } - // Add header to cache if its not. - if (!_headerCache.containsKey(sourceFile)) { - _headerCache[sourceFile] = - config.headers.includeFilter.shouldInclude(sourceFile); + // Add header to seen if it's not. + if (!bindingsIndex.isSeenHeader(sourceFile)) { + bindingsIndex.addHeaderToSeen( + sourceFile, config.headers.includeFilter.shouldInclude(sourceFile)); } - return _headerCache[sourceFile]!; + return bindingsIndex.getSeenHeaderStatus(sourceFile)!; } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart index 82bac38b82..0bee37d9f9 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart @@ -75,9 +75,6 @@ Compound? parseCompoundDeclaration( clang_types.CXCursor cursor, CompoundType compoundType, { - /// Optionally provide name (useful in case declaration is inside a typedef). - String? name, - /// Option to ignore declaration filter (Useful in case of extracting /// declarations when they are passed/returned by an included function.) bool ignoreFilter = false, @@ -85,19 +82,9 @@ Compound? parseCompoundDeclaration( /// To track if the declaration was used by reference(i.e T*). (Used to only /// generate these as opaque if `dependency-only` was set to opaque). bool pointerReference = false, - - /// If the compound name should be updated, if it was already seen. - bool updateName = true, }) { _stack.push(_ParsedCompound()); - // Parse the cursor definition instead, if this is a forward declaration. - if (isForwardDeclaration(cursor)) { - cursor = clang.clang_getCursorDefinition(cursor); - } - final declUsr = cursor.usr(); - final declName = name ?? cursor.spelling(); - // Set includer functions according to compoundType. final bool Function(String, String) shouldIncludeDecl; final bool Function(String) isSeenDecl; @@ -124,6 +111,25 @@ Compound? parseCompoundDeclaration( break; } + // Parse the cursor definition instead, if this is a forward declaration. + if (isForwardDeclaration(cursor)) { + cursor = clang.clang_getCursorDefinition(cursor); + } + final declUsr = cursor.usr(); + final String declName; + + // Only set name using USR if the type is not Anonymous (A struct is anonymous + // if it has no name, is not inside any typedef and declared inline inside + // another declaration). + if (clang.clang_Cursor_isAnonymous(cursor) == 0) { + // This gives the significant name, i.e name of the struct if defined or + // name of the first typedef declaration that refers to it. + declName = declUsr.split('@').last; + } else { + // Empty names are treated as inline declarations. + declName = ''; + } + if (declName.isEmpty) { if (ignoreFilter) { // This declaration is defined inside some other declaration and hence @@ -136,24 +142,22 @@ Compound? parseCompoundDeclaration( ); _setMembers(cursor, className); } else { - _logger.finest('unnamed $className or typedef $className declaration'); - } - } else { - if ((ignoreFilter || shouldIncludeDecl(declUsr, declName)) && - (!isSeenDecl(declUsr))) { - _logger.fine( - '++++ Adding $className: Name: $declName, ${cursor.completeStringRepr()}'); - _stack.top.compound = Compound.fromType( - type: compoundType, - usr: declUsr, - originalName: declName, - name: configDecl.renameUsingConfig(declName), - dartDoc: getCursorDocComment(cursor), - ); - // Adding to seen here to stop recursion if a declaration has itself as a - // member, members are updated later. - addDeclToSeen(declUsr, _stack.top.compound!); + _logger.finest('unnamed $className declaration'); } + } else if ((ignoreFilter || shouldIncludeDecl(declUsr, declName)) && + (!isSeenDecl(declUsr))) { + _logger.fine( + '++++ Adding $className: Name: $declName, ${cursor.completeStringRepr()}'); + _stack.top.compound = Compound.fromType( + type: compoundType, + usr: declUsr, + originalName: declName, + name: configDecl.renameUsingConfig(declName), + dartDoc: getCursorDocComment(cursor), + ); + // Adding to seen here to stop recursion if a declaration has itself as a + // member, members are updated later. + addDeclToSeen(declUsr, _stack.top.compound!); } if (isSeenDecl(declUsr)) { @@ -177,11 +181,6 @@ Compound? parseCompoundDeclaration( } else if (!_stack.top.compound!.parsedDependencies) { _logger.fine('Skipped dependencies.'); } - - if (updateName) { - // If struct is seen, update it's name. - _stack.top.compound!.name = configDecl.renameUsingConfig(declName); - } } return _stack.pop().compound; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index 7e09598080..52cb4ba013 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -24,12 +24,13 @@ class _ParsedEnum { final _stack = Stack<_ParsedEnum>(); -/// Parses a function declaration. +/// Parses an enum declaration. EnumClass? parseEnumDeclaration( clang_types.CXCursor cursor, { - /// Optionally provide name to use (useful in case enum is inside a typedef). - String? name, + /// Option to ignore declaration filter (Useful in case of extracting + /// declarations when they are passed/returned by an included function.) + bool ignoreFilter = false, }) { _stack.push(_ParsedEnum()); @@ -39,16 +40,22 @@ EnumClass? parseEnumDeclaration( } final enumUsr = cursor.usr(); - final enumName = name ?? cursor.spelling(); - if (enumName == '') { - // Save this unnamed enum if it is anonymous (therefore not in a typedef). - if (clang.clang_Cursor_isAnonymous(cursor) != 0) { - _logger.fine('Saving anonymous enum.'); - saveUnNamedEnum(cursor); - } else { - _logger.fine('Unnamed enum inside a typedef.'); - } - } else if (shouldIncludeEnumClass(enumUsr, enumName)) { + final String enumName; + // Only set name using USR if the type is not Anonymous (i.e not inside + // any typedef and declared inplace inside another type). + if (clang.clang_Cursor_isAnonymous(cursor) == 0) { + // This gives the significant name, i.e name of the enum if defined or + // name of the first typedef declaration that refers to it. + enumName = enumUsr.split('@').last; + } else { + enumName = ''; + } + + if (enumName.isEmpty) { + _logger.fine('Saving anonymous enum.'); + saveUnNamedEnum(cursor); + } else if ((ignoreFilter || shouldIncludeEnumClass(enumUsr, enumName)) && + (!bindingsIndex.isSeenEnumClass(enumUsr))) { _logger.fine('++++ Adding Enum: ${cursor.completeStringRepr()}'); _stack.top.enumClass = EnumClass( usr: enumUsr, @@ -61,10 +68,6 @@ EnumClass? parseEnumDeclaration( } if (bindingsIndex.isSeenEnumClass(enumUsr)) { _stack.top.enumClass = bindingsIndex.getSeenEnumClass(enumUsr); - - // If enum is seen, update it's name. - _stack.top.enumClass!.name = - config.enumClassDecl.renameUsingConfig(enumName); } return _stack.pop().enumClass; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart index 192c038983..90d5664d67 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart @@ -2,16 +2,14 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'dart:ffi'; - import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser/includer.dart'; +import 'package:ffigen/src/header_parser/type_extractor/extractor.dart'; import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang_types; import '../data.dart'; -import '../sub_parsers/enumdecl_parser.dart'; import '../utils.dart'; -import 'compounddecl_parser.dart'; final _logger = Logger('ffigen.header_parser.typedefdecl_parser'); @@ -32,88 +30,75 @@ final _logger = Logger('ffigen.header_parser.typedefdecl_parser'); /// /// typedef A D; // Typeref. /// ``` -class _ParsedTypedef { - Binding? binding; +class _ParsedTypealias { + Typealias? typealias; String? typedefName; bool typedefToPointer = false; - _ParsedTypedef(); + _ParsedTypealias(); } -final _stack = Stack<_ParsedTypedef>(); +final _stack = Stack<_ParsedTypealias>(); /// Parses a typedef declaration. -Binding? parseTypedefDeclaration(clang_types.CXCursor cursor) { - _stack.push(_ParsedTypedef()); - - /// Check if typedef declaration is to a pointer. - _stack.top.typedefToPointer = - (clang.clang_getTypedefDeclUnderlyingType(cursor).kind == - clang_types.CXTypeKind.CXType_Pointer); - - // Name of typedef. - _stack.top.typedefName = cursor.spelling(); - final resultCode = clang.clang_visitChildren( - cursor, - Pointer.fromFunction(_typedefdeclarationCursorVisitor, - clang_types.CXChildVisitResult.CXChildVisit_Break), - nullptr, - ); - - visitChildrenResultChecker(resultCode); - return _stack.pop().binding; -} - -/// Visitor for extracting binding for a TypedefDeclarations of a -/// [clang.CXCursorKind.CXCursor_TypedefDecl]. /// -/// Visitor invoked on cursor of type declaration returned by -/// [clang.clang_getTypeDeclaration_wrap]. -int _typedefdeclarationCursorVisitor(clang_types.CXCursor cursor, - clang_types.CXCursor parent, Pointer clientData) { - try { - _logger.finest( - 'typedefdeclarationCursorVisitor: ${cursor.completeStringRepr()}'); +/// Returns `null` if the typedef could not be generated or has been excluded +/// by the config. +Typealias? parseTypedefDeclaration( + clang_types.CXCursor cursor, { + bool pointerReference = false, +}) { + _stack.push(_ParsedTypealias()); + final typedefName = cursor.spelling(); + final typedefUsr = cursor.usr(); + if (shouldIncludeTypealias(typedefUsr, typedefName)) { + final ct = clang.clang_getTypedefDeclUnderlyingType(cursor); + final s = getCodeGenType(ct, pointerReference: pointerReference); - switch (clang.clang_getCursorKind(cursor)) { - case clang_types.CXCursorKind.CXCursor_StructDecl: - if (_stack.top.typedefToPointer && - bindingsIndex.isSeenStruct(cursor.usr())) { - // Skip a typedef pointer if struct is seen. - _stack.top.binding = bindingsIndex.getSeenStruct(cursor.usr()); - } else { - // This will update the name of struct if already seen. - _stack.top.binding = parseCompoundDeclaration( - cursor, - CompoundType.struct, - name: _stack.top.typedefName, - ); - } - break; - case clang_types.CXCursorKind.CXCursor_UnionDecl: - if (_stack.top.typedefToPointer && - bindingsIndex.isSeenUnion(cursor.usr())) { - // Skip a typedef pointer if struct is seen. - _stack.top.binding = bindingsIndex.getSeenUnion(cursor.usr()); - } else { - // This will update the name of struct if already seen. - _stack.top.binding = parseCompoundDeclaration( - cursor, - CompoundType.union, - name: _stack.top.typedefName, - ); - } - break; - case clang_types.CXCursorKind.CXCursor_EnumDecl: - _stack.top.binding = - parseEnumDeclaration(cursor, name: _stack.top.typedefName); - break; - default: - _logger.finest('typedefdeclarationCursorVisitor: Ignored'); + if (bindingsIndex.isSeenUnsupportedTypealias(typedefUsr)) { + // Do not process unsupported typealiases again. + } else if (s.broadType == BroadType.Unimplemented) { + _logger + .fine("Skipped Typedef '$typedefName': Unimplemented type referred."); + bindingsIndex.addUnsupportedTypealiasToSeen(typedefUsr); + } else if (s.broadType == BroadType.Compound && + s.compound!.originalName == typedefName) { + // Ignore typedef if it refers to a compound with the same original name. + bindingsIndex.addUnsupportedTypealiasToSeen(typedefUsr); + _logger.fine( + "Skipped Typedef '$typedefName': Name matches with referred struct/union."); + } else if (s.broadType == BroadType.Enum) { + // Ignore typedefs to Enum. + bindingsIndex.addUnsupportedTypealiasToSeen(typedefUsr); + _logger.fine("Skipped Typedef '$typedefName': typedef to enum."); + } else if (s.broadType == BroadType.Handle) { + // Ignore typedefs to Handle. + _logger.fine("Skipped Typedef '$typedefName': typedef to Dart Handle."); + bindingsIndex.addUnsupportedTypealiasToSeen(typedefUsr); + } else if (s.broadType == BroadType.ConstantArray || + s.broadType == BroadType.IncompleteArray) { + // Ignore typedefs to Constant Array. + _logger.fine("Skipped Typedef '$typedefName': typedef to array."); + bindingsIndex.addUnsupportedTypealiasToSeen(typedefUsr); + } else if (s.broadType == BroadType.Boolean) { + // Ignore typedefs to Boolean. + _logger.fine("Skipped Typedef '$typedefName': typedef to bool."); + bindingsIndex.addUnsupportedTypealiasToSeen(typedefUsr); + } else { + // Create typealias. + _stack.top.typealias = Typealias( + usr: typedefUsr, + originalName: typedefName, + name: config.typedefs.renameUsingConfig(typedefName), + type: s, + dartDoc: getCursorDocComment(cursor), + ); + bindingsIndex.addTypealiasToSeen(typedefUsr, _stack.top.typealias!); } - } catch (e, s) { - _logger.severe(e); - _logger.severe(s); - rethrow; } - return clang_types.CXChildVisitResult.CXChildVisit_Continue; + + if (bindingsIndex.isSeenTypealias(typedefUsr)) { + _stack.top.typealias = bindingsIndex.getSeenTypealias(typedefUsr); + } + + return _stack.pop().typealias; } diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart index 5f597077ce..3e5a677cc5 100644 --- a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -15,7 +15,6 @@ import 'includer.dart'; import 'sub_parsers/compounddecl_parser.dart'; import 'sub_parsers/enumdecl_parser.dart'; import 'sub_parsers/functiondecl_parser.dart'; -import 'sub_parsers/typedefdecl_parser.dart'; import 'utils.dart'; final _logger = Logger('ffigen.header_parser.translation_unit_parser'); @@ -47,9 +46,6 @@ int _rootCursorVisitor(clang_types.CXCursor cursor, clang_types.CXCursor parent, case clang_types.CXCursorKind.CXCursor_FunctionDecl: addToBindings(parseFunctionDeclaration(cursor)); break; - case clang_types.CXCursorKind.CXCursor_TypedefDecl: - addToBindings(parseTypedefDeclaration(cursor)); - break; case clang_types.CXCursorKind.CXCursor_StructDecl: addToBindings(parseCompoundDeclaration(cursor, CompoundType.struct)); break; diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart index 48c915af6a..eae99bc4d2 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart @@ -25,12 +25,8 @@ var cxTypeKindToSupportedNativeTypes = { clang.CXTypeKind.CXType_Double: SupportedNativeType.Double, clang.CXTypeKind.CXType_Char_S: SupportedNativeType.Int8, clang.CXTypeKind.CXType_Char_U: SupportedNativeType.Uint8, - clang.CXTypeKind.CXType_Enum: SupportedNativeType.Int32, }; -SupportedNativeType get enumNativeType => - cxTypeKindToSupportedNativeTypes[clang.CXTypeKind.CXType_Enum]!; - var suportedTypedefToSuportedNativeType = { 'uint8_t': SupportedNativeType.Uint8, 'uint16_t': SupportedNativeType.Uint16, diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 521e71e8af..43d964cd55 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -4,13 +4,14 @@ /// Extracts code_gen Type from type. import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser/sub_parsers/typedefdecl_parser.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang_types; import '../data.dart'; import '../sub_parsers/compounddecl_parser.dart'; -import '../translation_unit_parser.dart'; +import '../sub_parsers/enumdecl_parser.dart'; import '../type_extractor/cxtypekindmap.dart'; import '../utils.dart'; @@ -20,7 +21,6 @@ const _padding = ' '; /// Converts cxtype to a typestring code_generator can accept. Type getCodeGenType( clang_types.CXType cxtype, { - String? parentName, /// Passed on if a value was marked as a pointer before this one. bool pointerReference = false, @@ -31,8 +31,7 @@ Type getCodeGenType( switch (kind) { case clang_types.CXTypeKind.CXType_Pointer: final pt = clang.clang_getPointeeType(cxtype); - final s = - getCodeGenType(pt, parentName: parentName, pointerReference: true); + final s = getCodeGenType(pt, pointerReference: true); // Replace Pointer<_Dart_Handle> with Handle. if (config.useDartHandle && @@ -58,30 +57,54 @@ Type getCodeGenType( } // This is important or we get stuck in infinite recursion. - final ct = clang.clang_getTypedefDeclUnderlyingType( - clang.clang_getTypeDeclaration(cxtype)); + final cursor = clang.clang_getTypeDeclaration(cxtype); + final typedefUsr = cursor.usr(); - final s = getCodeGenType(ct, - parentName: parentName ?? spelling, - pointerReference: pointerReference); - return s; + if (bindingsIndex.isSeenTypealias(typedefUsr)) { + return Type.typealias(bindingsIndex.getSeenTypealias(typedefUsr)!); + } else { + final typealias = + parseTypedefDeclaration(cursor, pointerReference: pointerReference); + + if (typealias != null) { + return Type.typealias(typealias); + } else { + // Use underlying type if typealias couldn't be created or if + // the user excluded this typedef. + final ct = clang.clang_getTypedefDeclUnderlyingType(cursor); + return getCodeGenType(ct, pointerReference: pointerReference); + } + } case clang_types.CXTypeKind.CXType_Elaborated: final et = clang.clang_Type_getNamedType(cxtype); - final s = getCodeGenType(et, - parentName: parentName, pointerReference: pointerReference); + final s = getCodeGenType(et, pointerReference: pointerReference); return s; case clang_types.CXTypeKind.CXType_Record: - return _extractfromRecord(cxtype, parentName, pointerReference); + return _extractfromRecord(cxtype, pointerReference); case clang_types.CXTypeKind.CXType_Enum: - return Type.nativeType( - enumNativeType, - ); + final cursor = clang.clang_getTypeDeclaration(cxtype); + final usr = cursor.usr(); + + if (bindingsIndex.isSeenEnumClass(usr)) { + return Type.enumClass(bindingsIndex.getSeenEnumClass(usr)!); + } else { + final enumClass = parseEnumDeclaration( + cursor, + ignoreFilter: true, + ); + if (enumClass == null) { + // Handle anonymous enum declarations within another declaration. + return Type.nativeType(Type.enumNativeType); + } else { + return Type.enumClass(enumClass); + } + } case clang_types.CXTypeKind.CXType_FunctionProto: // Primarily used for function pointers. - return _extractFromFunctionProto(cxtype, parentName); + return _extractFromFunctionProto(cxtype); case clang_types.CXTypeKind.CXType_FunctionNoProto: // Primarily used for function types with zero arguments. - return _extractFromFunctionProto(cxtype, parentName); + return _extractFromFunctionProto(cxtype); case clang_types.CXTypeKind .CXType_ConstantArray: // Primarily used for constant array in struct members. return Type.constantArray( @@ -109,8 +132,7 @@ Type getCodeGenType( } } -Type _extractfromRecord( - clang_types.CXType cxtype, String? parentName, bool pointerReference) { +Type _extractfromRecord(clang_types.CXType cxtype, bool pointerReference) { Type type; final cursor = clang.clang_getTypeDeclaration(cxtype); @@ -121,9 +143,6 @@ Type _extractfromRecord( cursorKind == clang_types.CXCursorKind.CXCursor_UnionDecl) { final declUsr = cursor.usr(); - // Name of typedef (parentName) is used if available. - final declName = parentName ?? cursor.spelling(); - // Set includer functions according to compoundType. final bool Function(String) isSeenDecl; final Compound? Function(String) getSeenDecl; @@ -153,25 +172,17 @@ Type _extractfromRecord( parseCompoundDeclaration( cursor, compoundType, - name: declName, ignoreFilter: true, pointerReference: pointerReference, - updateName: false, ); } else { final struc = parseCompoundDeclaration( cursor, compoundType, - name: declName, ignoreFilter: true, pointerReference: pointerReference, ); type = Type.compound(struc!); - - // Add to bindings if it's not Dart_Handle and is unseen. - if (!(config.useDartHandle && declUsr == strings.dartHandleUsr)) { - addToBindings(struc); - } } } else { _logger.fine( @@ -183,12 +194,7 @@ Type _extractfromRecord( } // Used for function pointer arguments. -Type _extractFromFunctionProto(clang_types.CXType cxtype, String? parentName) { - var name = parentName; - - // An empty name means the function prototype was declared in-place, instead - // of using a typedef. - name = name ?? ''; +Type _extractFromFunctionProto(clang_types.CXType cxtype) { final _parameters = []; final totalArgs = clang.clang_getNumArgTypes(cxtype); for (var i = 0; i < totalArgs; i++) { @@ -207,21 +213,8 @@ Type _extractFromFunctionProto(clang_types.CXType cxtype, String? parentName) { ); } - Typedef? typedefC; - if (bindingsIndex.isSeenFunctionTypedef(name)) { - typedefC = bindingsIndex.getSeenFunctionTypedef(name); - } else { - typedefC = Typedef( - name: name.isNotEmpty ? name : incrementalNamer.name('_typedefC'), - typedefType: TypedefType.C, - parameters: _parameters, - returnType: clang.clang_getResultType(cxtype).toCodeGenType(), - ); - // Add to seen, if name isn't empty. - if (name.isNotEmpty) { - bindingsIndex.addFunctionTypedefToSeen(name, typedefC); - } - } - - return Type.nativeFunc(typedefC!); + return Type.nativeFunc(NativeFunc.fromFunctionType(FunctionType( + parameters: _parameters, + returnType: clang.clang_getResultType(cxtype).toCodeGenType(), + ))); } diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index 272f21d86c..9ff09fe3e6 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -333,8 +333,13 @@ class BindingsIndex { final Map _unnamedEnumConstants = {}; final Map _macros = {}; final Map _globals = {}; - // Stores only named typedefC used in NativeFunc. - final Map _functionTypedefs = {}; + + /// Contains usr for typedefs which cannot be generated. + final Set _unsupportedTypealiases = {}; + final Map _typealiases = {}; + + /// Index for headers. + final Map _headerCache = {}; bool isSeenStruct(String usr) { return _structs.containsKey(usr); @@ -420,15 +425,35 @@ class BindingsIndex { return _macros[usr]; } - bool isSeenFunctionTypedef(String originalName) { - return _functionTypedefs.containsKey(originalName); + bool isSeenTypealias(String usr) { + return _typealiases.containsKey(usr); + } + + void addTypealiasToSeen(String usr, Typealias t) { + _typealiases[usr] = t; + } + + bool isSeenUnsupportedTypealias(String usr) { + return _unsupportedTypealiases.contains(usr); + } + + void addUnsupportedTypealiasToSeen(String usr) { + _unsupportedTypealiases.add(usr); + } + + Typealias? getSeenTypealias(String usr) { + return _typealiases[usr]; + } + + bool isSeenHeader(String source) { + return _headerCache.containsKey(source); } - void addFunctionTypedefToSeen(String originalName, Typedef t) { - _functionTypedefs[originalName] = t; + void addHeaderToSeen(String source, bool includeStatus) { + _headerCache[source] = includeStatus; } - Typedef? getSeenFunctionTypedef(String originalName) { - return _functionTypedefs[originalName]; + bool? getSeenHeaderStatus(String source) { + return _headerCache[source]; } } diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index b551ead6d5..46bdb09963 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -51,6 +51,7 @@ const enums = 'enums'; const unnamedEnums = 'unnamed-enums'; const globals = 'globals'; const macros = 'macros'; +const typedefs = 'typedefs'; // Sub-fields of Declarations. const include = 'include'; @@ -155,7 +156,8 @@ const linuxDylibLocations = [ '/usr/lib/llvm-9/lib/', '/usr/lib/llvm-10/lib/', '/usr/lib/llvm-11/lib/', - '/usr/lib/' + '/usr/lib/', + '/usr/lib64/', ]; const windowsDylibLocations = [ r'C:\Program Files\LLVM\bin\', diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index ef3ff7652b..9c305e26dd 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 3.1.0-dev.1 +version: 4.0.0-dev.0 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart index 79ac352000..b30f6347da 100644 --- a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart @@ -447,6 +447,40 @@ void main() { ); _matchLib(library, 'unions'); }); + test('Typealias Bindings', () { + final library = Library( + name: 'Bindings', + bindings: [ + Typealias( + name: 'RawUnused', type: Type.compound(Struc(name: 'Struct1'))), + Struc(name: 'WithTypealiasStruc', members: [ + Member( + name: 't', + type: Type.typealias(Typealias( + name: 'Struct2Typealias', + type: Type.struct(Struc(name: 'Struct2', members: [ + Member( + name: 'a', + type: Type.nativeType(SupportedNativeType.Double)) + ]))))) + ]), + Func( + name: 'WithTypealiasStruc', + returnType: Type.pointer(Type.nativeFunc( + NativeFunc.fromFunctionType(FunctionType( + returnType: Type.nativeType(SupportedNativeType.Void), + parameters: [])))), + parameters: [ + Parameter( + name: 't', + type: Type.typealias(Typealias( + name: 'Struct3Typealias', + type: Type.struct(Struc(name: 'Struct3'))))) + ]), + ], + ); + _matchLib(library, 'typealias'); + }); } /// Utility to match expected bindings to the generated bindings. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart index 7764524652..a35b620d87 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart @@ -28,21 +28,14 @@ class Bindings { 0; } - late final _test1_ptr = _lookup>('test1'); - late final _dart_test1 _test1 = _test1_ptr.asFunction<_dart_test1>(); + late final _test1_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Uint8, ffi.Pointer)>>('test1'); + late final _test1 = + _test1_ptr.asFunction)>(); } class test2 extends ffi.Struct { @ffi.Uint8() external int a; } - -typedef _c_test1 = ffi.Uint8 Function( - ffi.Uint8 a, - ffi.Pointer b, -); - -typedef _dart_test1 = int Function( - int a, - ffi.Pointer b, -); diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart index 5757ff03e7..30653c8d41 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart @@ -27,21 +27,14 @@ class Bindings { ); } - late final _test1_ptr = _lookup>('test1'); - late final _dart_test1 _test1 = _test1_ptr.asFunction<_dart_test1>(); + late final _test1_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Uint8, ffi.Pointer)>>('test1'); + late final _test1 = + _test1_ptr.asFunction)>(); } class test2 extends ffi.Struct { @ffi.Uint8() external int a; } - -typedef _c_test1 = ffi.Uint8 Function( - ffi.Uint8 a, - ffi.Pointer b, -); - -typedef _dart_test1 = int Function( - int a, - ffi.Pointer b, -); diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart index 30de175b7c..8b94f2b337 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart @@ -23,8 +23,9 @@ class Bindings { return _noParam(); } - late final _noParam_ptr = _lookup>('noParam'); - late final _dart_noParam _noParam = _noParam_ptr.asFunction<_dart_noParam>(); + late final _noParam_ptr = + _lookup>('noParam'); + late final _noParam = _noParam_ptr.asFunction(); int withPrimitiveParam( int a, @@ -37,9 +38,10 @@ class Bindings { } late final _withPrimitiveParam_ptr = - _lookup>('withPrimitiveParam'); - late final _dart_withPrimitiveParam _withPrimitiveParam = - _withPrimitiveParam_ptr.asFunction<_dart_withPrimitiveParam>(); + _lookup>( + 'withPrimitiveParam'); + late final _withPrimitiveParam = + _withPrimitiveParam_ptr.asFunction(); ffi.Pointer withPointerParam( ffi.Pointer a, @@ -51,32 +53,11 @@ class Bindings { ); } - late final _withPointerParam_ptr = - _lookup>('withPointerParam'); - late final _dart_withPointerParam _withPointerParam = - _withPointerParam_ptr.asFunction<_dart_withPointerParam>(); + late final _withPointerParam_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer>)>>('withPointerParam'); + late final _withPointerParam = _withPointerParam_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer>)>(); } - -typedef _c_noParam = ffi.Int32 Function(); - -typedef _dart_noParam = int Function(); - -typedef _c_withPrimitiveParam = ffi.Uint8 Function( - ffi.Int32 a, - ffi.Uint8 b, -); - -typedef _dart_withPrimitiveParam = int Function( - int a, - int b, -); - -typedef _c_withPointerParam = ffi.Pointer Function( - ffi.Pointer a, - ffi.Pointer> b, -); - -typedef _dart_withPointerParam = ffi.Pointer Function( - ffi.Pointer a, - ffi.Pointer> b, -); diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart index c4bfa273c5..d658e31d4e 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart @@ -25,10 +25,12 @@ class Bindings { ); } - late final _someFunc_ptr = - _lookup>('someFunc'); - late final _dart_someFunc _someFunc = - _someFunc_ptr.asFunction<_dart_someFunc>(); + late final _someFunc_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer>)>>('someFunc'); + late final _someFunc = _someFunc_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer>)>(); } class SomeStruc extends ffi.Struct { @@ -41,11 +43,3 @@ class SomeStruc extends ffi.Struct { @ffi.Uint8() external int c; } - -typedef _c_someFunc = ffi.Pointer Function( - ffi.Pointer> some, -); - -typedef _dart_someFunc = ffi.Pointer Function( - ffi.Pointer> some, -); diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart index 4556dfaefe..7a0cff24fe 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart @@ -24,38 +24,41 @@ class init_dylib_1 { return _test_1(); } - late final _test_ptr = _lookup>('test'); - late final _dart_test1 _test_1 = _test_ptr.asFunction<_dart_test1>(); + late final _test_ptr = + _lookup>('test'); + late final _test_1 = _test_ptr.asFunction(); void _test() { return __test(); } - late final __test_ptr = _lookup>('_test'); - late final _dart__test __test = __test_ptr.asFunction<_dart__test>(); + late final __test_ptr = + _lookup>('_test'); + late final __test = __test_ptr.asFunction(); void _c_test() { return __c_test(); } - late final __c_test_ptr = _lookup>('_c_test'); - late final _dart__c_test __c_test = __c_test_ptr.asFunction<_dart__c_test>(); + late final __c_test_ptr = + _lookup>('_c_test'); + late final __c_test = __c_test_ptr.asFunction(); void _dart_test() { return __dart_test(); } late final __dart_test_ptr = - _lookup>('_dart_test'); - late final _dart__dart_test __dart_test = - __dart_test_ptr.asFunction<_dart__dart_test>(); + _lookup>('_dart_test'); + late final __dart_test = __dart_test_ptr.asFunction(); void Test() { return _Test(); } - late final _Test_ptr = _lookup>('Test'); - late final _dart_Test _Test = _Test_ptr.asFunction<_dart_Test>(); + late final _Test_ptr = + _lookup>('Test'); + late final _Test = _Test_ptr.asFunction(); } class _Test extends ffi.Struct { @@ -68,23 +71,3 @@ class ArrayHelperPrefixCollisionTest extends ffi.Opaque {} abstract class _c_Test {} abstract class init_dylib {} - -typedef _c_test1 = ffi.Void Function(); - -typedef _dart_test1 = void Function(); - -typedef _c__test = ffi.Void Function(); - -typedef _dart__test = void Function(); - -typedef _c__c_test = ffi.Void Function(); - -typedef _dart__c_test = void Function(); - -typedef _c__dart_test = ffi.Void Function(); - -typedef _dart__dart_test = void Function(); - -typedef _c_Test1 = ffi.Void Function(); - -typedef _dart_Test = void Function(); diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart index aaa8f2d2d4..fd1b0beb06 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart @@ -21,25 +21,17 @@ class Bindings { return _a(); } - late final _a_ptr = _lookup>('a'); - late final _dart_a _a = _a_ptr.asFunction<_dart_a>(); + late final _a_ptr = _lookup>('a'); + late final _a = _a_ptr.asFunction(); void b() { return _b(); } - late final _b_ptr = _lookup>('b'); - late final _dart_b _b = _b_ptr.asFunction<_dart_b>(); + late final _b_ptr = _lookup>('b'); + late final _b = _b_ptr.asFunction(); } class c extends ffi.Opaque {} class d extends ffi.Opaque {} - -typedef _c_a = ffi.Void Function(); - -typedef _dart_a = void Function(); - -typedef _c_b = ffi.Void Function(); - -typedef _dart_b = void Function(); diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart new file mode 100644 index 0000000000..4b63376902 --- /dev/null +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart @@ -0,0 +1,54 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +class Bindings { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + Bindings(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + Bindings.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + ffi.Pointer> WithTypealiasStruc_1( + Struct3Typealias t, + ) { + return _WithTypealiasStruc_1( + t, + ); + } + + late final _WithTypealiasStruc_1_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer> Function( + Struct3Typealias)>>('WithTypealiasStruc'); + late final _WithTypealiasStruc_1 = _WithTypealiasStruc_1_ptr.asFunction< + ffi.Pointer> Function( + Struct3Typealias)>(); +} + +typedef RawUnused = Struct1; + +class Struct1 extends ffi.Opaque {} + +class WithTypealiasStruc extends ffi.Struct { + external Struct2Typealias t; +} + +typedef Struct2Typealias = Struct2; + +class Struct2 extends ffi.Struct { + @ffi.Double() + external double a; +} + +typedef Struct3Typealias = Struct3; + +class Struct3 extends ffi.Opaque {} diff --git a/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart index fb6645fea6..ac22f402ca 100644 --- a/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart @@ -36,6 +36,10 @@ void main() { rawType: 'int', rawValue: '0', ), + Typealias( + name: 'testAlias', type: Type.nativeType(SupportedNativeType.Void)), + Typealias( + name: 'testAlias', type: Type.nativeType(SupportedNativeType.Void)), /// Conflicts across declarations. Struc(name: 'testCrossDecl'), @@ -44,6 +48,9 @@ void main() { returnType: Type.nativeType(SupportedNativeType.Void)), Constant(name: 'testCrossDecl', rawValue: '0', rawType: 'int'), EnumClass(name: 'testCrossDecl'), + Typealias( + name: 'testCrossDecl', + type: Type.nativeType(SupportedNativeType.Void)), /// Conflicts with ffi library prefix, name of prefix is changed. Struc(name: 'ffi'), @@ -76,6 +83,11 @@ void main() { rawType: 'int', rawValue: '0', ), + Typealias( + name: 'testAlias', type: Type.nativeType(SupportedNativeType.Void)), + Typealias( + name: 'testAlias_1', + type: Type.nativeType(SupportedNativeType.Void)), Struc(name: 'testCrossDecl', originalName: 'testCrossDecl'), Func( name: 'testCrossDecl_1', @@ -83,6 +95,9 @@ void main() { returnType: Type.nativeType(SupportedNativeType.Void)), Constant(name: 'testCrossDecl_2', rawValue: '0', rawType: 'int'), EnumClass(name: 'testCrossDecl_3'), + Typealias( + name: 'testCrossDecl_4', + type: Type.nativeType(SupportedNativeType.Void)), Struc(name: 'ffi'), Func( name: 'ffi_1', diff --git a/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart b/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart index cc534e89f1..b11252f8bb 100644 --- a/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart @@ -36,7 +36,7 @@ void main() { matchLibraryWithExpected(actual, [ 'test', 'debug_generated', - 'decl_symbol_address_collision_output.dart' + 'collision_test_decl_symbol_address_collision_output.dart' ], [ 'test', 'collision_tests', diff --git a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart index b983034b06..a8d8a7b23a 100644 --- a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart +++ b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart @@ -25,8 +25,7 @@ class Bindings_1 { late final __library_ptr = _lookup>('_library'); - late final _dart__library __library = - __library_ptr.asFunction<_dart__library>(); + late final __library = __library_ptr.asFunction(); void _SymbolAddresses_1() { return __SymbolAddresses_1(); @@ -35,8 +34,8 @@ class Bindings_1 { late final __SymbolAddresses_1_ptr = _lookup>( '_SymbolAddresses_1'); - late final _dart__SymbolAddresses_1 __SymbolAddresses_1 = - __SymbolAddresses_1_ptr.asFunction<_dart__SymbolAddresses_1>(); + late final __SymbolAddresses_1 = + __SymbolAddresses_1_ptr.asFunction(); late final addresses = _SymbolAddresses_2(this); } @@ -57,9 +56,4 @@ class _SymbolAddresses extends ffi.Opaque {} abstract class Bindings {} typedef Native__library = ffi.Void Function(); - -typedef _dart__library = void Function(); - typedef Native__SymbolAddresses_1 = ffi.Void Function(); - -typedef _dart__SymbolAddresses_1 = void Function(); diff --git a/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart b/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart index b5b6931739..7764ee15fc 100644 --- a/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart @@ -45,6 +45,7 @@ void main() { rawType: 'int', rawValue: '0', ), + Typealias(name: 'var', type: Type.nativeType(SupportedNativeType.Void)), ]); final l2 = Library(name: 'Bindings', bindings: [ Struc(name: 'abstract_1'), @@ -79,6 +80,8 @@ void main() { rawType: 'int', rawValue: '0', ), + Typealias( + name: 'var_1', type: Type.nativeType(SupportedNativeType.Void)), ]); expect(l1.generate(), l2.generate()); }); diff --git a/pkgs/ffigen/test/example_tests/cjson_example_test.dart b/pkgs/ffigen/test/example_tests/cjson_example_test.dart index f6504a8186..7d094330a3 100644 --- a/pkgs/ffigen/test/example_tests/cjson_example_test.dart +++ b/pkgs/ffigen/test/example_tests/cjson_example_test.dart @@ -27,6 +27,8 @@ ${strings.headers}: ${strings.includeDirectives}: - '**cJSON.h' ${strings.comments}: false +${strings.typedefmap}: + 'size_t': 'IntPtr' ${strings.preamble}: | // Copyright (c) 2009-2017 Dave Gamble and cJSON contributors // @@ -52,7 +54,7 @@ ${strings.preamble}: | matchLibraryWithExpected( library, - ['test', 'debug_generated', 'c_json.dart'], + ['test', 'debug_generated', 'example_c_json.dart'], ['example', 'c_json', config.output], ); }); diff --git a/pkgs/ffigen/test/example_tests/libclang_example_test.dart b/pkgs/ffigen/test/example_tests/libclang_example_test.dart index 43407fc4c3..1c3b2b756c 100644 --- a/pkgs/ffigen/test/example_tests/libclang_example_test.dart +++ b/pkgs/ffigen/test/example_tests/libclang_example_test.dart @@ -40,7 +40,9 @@ ${strings.enums}: ${strings.include}: - 'CXTypeKind' - 'CXGlobalOptFlags' - +${strings.typedefmap}: + 'size_t': 'IntPtr' + 'time_t': 'Int64' ${strings.name}: 'LibClang' ${strings.description}: 'Holds bindings to LibClang.' ${strings.comments}: @@ -57,7 +59,7 @@ ${strings.preamble}: | matchLibraryWithExpected( library, - ['test', 'debug_generated', 'libclang-example.dart'], + ['test', 'debug_generated', 'example_libclang.dart'], ['example', 'libclang-example', config.output], ); }); diff --git a/pkgs/ffigen/test/example_tests/simple_example_test.dart b/pkgs/ffigen/test/example_tests/simple_example_test.dart index 8f4c1815e6..190e65e7d7 100644 --- a/pkgs/ffigen/test/example_tests/simple_example_test.dart +++ b/pkgs/ffigen/test/example_tests/simple_example_test.dart @@ -30,7 +30,7 @@ ${strings.headers}: matchLibraryWithExpected( library, - ['test', 'debug_generated', 'simple.dart'], + ['test', 'debug_generated', 'example_simple.dart'], ['example', 'simple', config.output], ); }); diff --git a/pkgs/ffigen/test/header_parser_tests/comment_markup_test.dart b/pkgs/ffigen/test/header_parser_tests/comment_markup_test.dart index 9771f632c0..3fadaea6b5 100644 --- a/pkgs/ffigen/test/header_parser_tests/comment_markup_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/comment_markup_test.dart @@ -36,7 +36,7 @@ ${strings.comments}: matchLibraryWithExpected(actual, [ 'test', 'debug_generated', - 'comment_markup_test_output.dart' + 'header_parser_comment_markup_test_output.dart' ], [ 'test', 'header_parser_tests', diff --git a/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart b/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart index ed9d1aa700..9089302644 100644 --- a/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart @@ -19,7 +19,6 @@ void main() { group('dart_handle_test', () { setUpAll(() { logWarnings(); - expected = expectedLibrary(); actual = parser.parse( Config.fromYaml(yaml.loadYaml(''' ${strings.name}: 'NativeLibrary' @@ -35,86 +34,17 @@ ${strings.headers}: ''') as yaml.YamlMap), ); }); - test('Total bindings count', () { - expect(actual.bindings.length, expected.bindings.length); - }); - - test('func1', () { - expect(actual.getBindingAsString('func1'), - expected.getBindingAsString('func1')); - }); - test('func2', () { - expect(actual.getBindingAsString('func2'), - expected.getBindingAsString('func2')); - }); - test('func3', () { - expect(actual.getBindingAsString('func3'), - expected.getBindingAsString('func3')); - }); - test('func4', () { - expect(actual.getBindingAsString('func4'), - expected.getBindingAsString('func4')); - }); - test('struc1', () { - expect(actual.getBindingAsString('struc1'), - expected.getBindingAsString('struc1')); - }); - test('struc2', () { - expect(actual.getBindingAsString('struc2'), - expected.getBindingAsString('struc2')); + test('Expected Bindings', () { + matchLibraryWithExpected(actual, [ + 'test', + 'debug_generated', + 'header_parser_dart_handle_test_output.dart' + ], [ + 'test', + 'header_parser_tests', + 'expected_bindings', + '_expected_dart_handle_bindings.dart' + ]); }); }); } - -Library expectedLibrary() { - final namedTypedef = Typedef( - name: 'typedef1', - typedefType: TypedefType.C, - returnType: Type.nativeType(SupportedNativeType.Void), - parameters: [Parameter(type: Type.handle())], - ); - return Library( - name: 'NativeLibrary', - bindings: [ - Func( - name: 'func1', - returnType: Type.nativeType( - SupportedNativeType.Void, - ), - parameters: [ - Parameter(type: Type.handle()), - ], - ), - Func( - name: 'func2', - returnType: Type.handle(), - ), - Func( - name: 'func3', - returnType: Type.pointer(Type.pointer(Type.handle())), - parameters: [ - Parameter( - type: Type.pointer(Type.handle()), - ), - ], - ), - Func( - name: 'func4', - returnType: Type.nativeType(SupportedNativeType.Void), - parameters: [ - Parameter( - type: Type.pointer(Type.nativeFunc(namedTypedef)), - ), - ], - ), - // struc1 should have no members. - Struc(name: 'struc1'), - Struc( - name: 'struc2', - members: [ - Member(name: 'h', type: Type.pointer(Type.handle())), - ], - ), - ], - ); -} diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart index 75bc7c7c5e..378bec0240 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart @@ -24,8 +24,9 @@ class NativeLibrary { return _com1(); } - late final _com1_ptr = _lookup>('com1'); - late final _dart_com1 _com1 = _com1_ptr.asFunction<_dart_com1>(); + late final _com1_ptr = + _lookup>('com1'); + late final _com1 = _com1_ptr.asFunction(); /// This is a multi-line /// test comment. @@ -33,8 +34,9 @@ class NativeLibrary { return _com2(); } - late final _com2_ptr = _lookup>('com2'); - late final _dart_com2 _com2 = _com2_ptr.asFunction<_dart_com2>(); + late final _com2_ptr = + _lookup>('com2'); + late final _com2 = _com2_ptr.asFunction(); /// This is a multi-line /// doxygen style @@ -43,8 +45,9 @@ class NativeLibrary { return _com3(); } - late final _com3_ptr = _lookup>('com3'); - late final _dart_com3 _com3 = _com3_ptr.asFunction<_dart_com3>(); + late final _com3_ptr = + _lookup>('com3'); + late final _com3 = _com3_ptr.asFunction(); } /// Test comment for struct. @@ -58,15 +61,3 @@ class com4 extends ffi.Struct { @ffi.Float() external double b; } - -typedef _c_com1 = ffi.Void Function(); - -typedef _dart_com1 = void Function(); - -typedef _c_com2 = ffi.Void Function(); - -typedef _dart_com2 = void Function(); - -typedef _c_com3 = ffi.Void Function(); - -typedef _dart_com3 = void Function(); diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart new file mode 100644 index 0000000000..7d87f98962 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart @@ -0,0 +1,77 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Dart_Handle Test +class NativeLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + NativeLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NativeLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + void func1( + Object arg0, + ) { + return _func1( + arg0, + ); + } + + late final _func1_ptr = + _lookup>('func1'); + late final _func1 = _func1_ptr.asFunction(); + + Object func2() { + return _func2(); + } + + late final _func2_ptr = + _lookup>('func2'); + late final _func2 = _func2_ptr.asFunction(); + + ffi.Pointer> func3( + ffi.Pointer arg0, + ) { + return _func3( + arg0, + ); + } + + late final _func3_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer> Function( + ffi.Pointer)>>('func3'); + late final _func3 = _func3_ptr.asFunction< + ffi.Pointer> Function(ffi.Pointer)>(); + + void func4( + typedef1 arg0, + ) { + return _func4( + arg0, + ); + } + + late final _func4_ptr = + _lookup>('func4'); + late final _func4 = _func4_ptr.asFunction(); +} + +typedef typedef1 + = ffi.Pointer>; + +class struc1 extends ffi.Opaque {} + +class struc2 extends ffi.Struct { + external ffi.Pointer h; +} diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart index 5fc47cdea4..355255bf74 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart @@ -29,8 +29,10 @@ class NativeLibrary { ); } - late final _func_ptr = _lookup>('func'); - late final _dart_func _func = _func_ptr.asFunction<_dart_func>(); + late final _func_ptr = + _lookup, ffi.Int32)>>( + 'func'); + late final _func = _func_ptr.asFunction, int)>(); } class A extends ffi.Struct { @@ -45,13 +47,3 @@ abstract class B { static const int a = 0; static const int b = 1; } - -typedef _c_func = ffi.Void Function( - ffi.Pointer a, - ffi.Int32 b, -); - -typedef _dart_func = void Function( - ffi.Pointer a, - int b, -); diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart new file mode 100644 index 0000000000..769371aea2 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart @@ -0,0 +1,114 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Functions Test +class NativeLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + NativeLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NativeLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + void func1() { + return _func1(); + } + + late final _func1_ptr = + _lookup>('func1'); + late final _func1 = _func1_ptr.asFunction(); + + int func2( + int arg0, + ) { + return _func2( + arg0, + ); + } + + late final _func2_ptr = + _lookup>('func2'); + late final _func2 = _func2_ptr.asFunction(); + + double func3( + double arg0, + int a, + int arg2, + int b, + ) { + return _func3( + arg0, + a, + arg2, + b, + ); + } + + late final _func3_ptr = _lookup>('func3'); + late final _func3 = + _func3_ptr.asFunction(); + + ffi.Pointer func4( + ffi.Pointer> arg0, + double arg1, + ffi.Pointer>> arg2, + ) { + return _func4( + arg0, + arg1, + arg2, + ); + } + + late final _func4_ptr = _lookup>('func4'); + late final _func4 = _func4_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer>, double, + ffi.Pointer>>)>(); + + void func5( + ffi.Pointer a, + ffi.Pointer> b, + ) { + return _func5( + a, + b, + ); + } + + late final _func5_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer>)>>('func5'); + late final _func5 = _func5_ptr.asFunction< + void Function(ffi.Pointer, + ffi.Pointer>)>(); + + late final addresses = _SymbolAddresses(this); +} + +class _SymbolAddresses { + final NativeLibrary _library; + _SymbolAddresses(this._library); + ffi.Pointer> get func3 => + _library._func3_ptr; + ffi.Pointer> get func4 => + _library._func4_ptr; +} + +typedef Native_func3 = ffi.Double Function( + ffi.Float arg0, ffi.Int8 a, ffi.Int64 arg2, ffi.Int32 b); +typedef Native_func4 = ffi.Pointer Function( + ffi.Pointer> arg0, + ffi.Double arg1, + ffi.Pointer>> arg2); +typedef shortHand = ffi.NativeFunction< + ffi.Void Function(ffi.Pointer>)>; diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart index ac068d2aaa..5cf12c3cc5 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart @@ -20,18 +20,36 @@ class NativeLibrary { : _lookup = lookup; void func( - ffi.Pointer> unnamed1, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer>)>> + unnamed1, ) { return _func( unnamed1, ); } - late final _func_ptr = _lookup>('func'); - late final _dart_func _func = _func_ptr.asFunction<_dart_func>(); + late final _func_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function()>>)>>)>>('func'); + late final _func = _func_ptr.asFunction< + void Function( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer< + ffi.NativeFunction>)>>)>(); void funcWithNativeFunc( - ffi.Pointer> named, + withTypedefReturnType named, ) { return _funcWithNativeFunc( named, @@ -39,50 +57,25 @@ class NativeLibrary { } late final _funcWithNativeFunc_ptr = - _lookup>('funcWithNativeFunc'); - late final _dart_funcWithNativeFunc _funcWithNativeFunc = - _funcWithNativeFunc_ptr.asFunction<_dart_funcWithNativeFunc>(); + _lookup>( + 'funcWithNativeFunc'); + late final _funcWithNativeFunc = _funcWithNativeFunc_ptr + .asFunction(); } class struc extends ffi.Struct { - external ffi.Pointer> unnamed1; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer>)>> unnamed1; } -class Struc2 extends ffi.Struct { - external ffi.Pointer> constFuncPointer; -} - -typedef _typedefC_3 = ffi.Void Function(); - -typedef _typedefC_4 = ffi.Void Function( - ffi.Pointer>, -); - -typedef _c_func = ffi.Void Function( - ffi.Pointer> unnamed1, -); - -typedef _dart_func = void Function( - ffi.Pointer> unnamed1, -); - -typedef insideReturnType = ffi.Void Function(); - typedef withTypedefReturnType - = ffi.Pointer> Function(); - -typedef _c_funcWithNativeFunc = ffi.Void Function( - ffi.Pointer> named, -); - -typedef _dart_funcWithNativeFunc = void Function( - ffi.Pointer> named, -); + = ffi.Pointer>; +typedef insideReturnType = ffi.Pointer>; -typedef _typedefC_1 = ffi.Void Function(); - -typedef _typedefC_2 = ffi.Void Function( - ffi.Pointer>, -); +class Struc2 extends ffi.Struct { + external VoidFuncPointer constFuncPointer; +} -typedef VoidFuncPointer = ffi.Void Function(); +typedef VoidFuncPointer = ffi.Pointer>; diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart index c37dbafcc1..c8cb2e0561 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart @@ -19,7 +19,7 @@ class NativeLibrary { lookup) : _lookup = lookup; - ffi.Pointer func( + ffi.Pointer func( ffi.Pointer a, ) { return _func( @@ -27,8 +27,11 @@ class NativeLibrary { ); } - late final _func_ptr = _lookup>('func'); - late final _dart_func _func = _func_ptr.asFunction<_dart_func>(); + late final _func_ptr = _lookup< + ffi.NativeFunction Function(ffi.Pointer)>>( + 'func'); + late final _func = + _func_ptr.asFunction Function(ffi.Pointer)>(); ffi.Pointer func2( ffi.Pointer a, @@ -38,56 +41,45 @@ class NativeLibrary { ); } - late final _func2_ptr = _lookup>('func2'); - late final _dart_func2 _func2 = _func2_ptr.asFunction<_dart_func2>(); + late final _func2_ptr = + _lookup Function(ffi.Pointer)>>( + 'func2'); + late final _func2 = + _func2_ptr.asFunction Function(ffi.Pointer)>(); } +typedef B_alias = B; + class B extends ffi.Opaque {} class A extends ffi.Opaque {} -class C extends ffi.Opaque {} - -class D extends ffi.Struct { - @ffi.Int32() - external int a; -} - class E extends ffi.Struct { external ffi.Pointer c; external D d; } -class UB extends ffi.Opaque {} - -class UA extends ffi.Opaque {} - -class UC extends ffi.Opaque {} +class C extends ffi.Opaque {} -class UD extends ffi.Union { +class D extends ffi.Struct { @ffi.Int32() external int a; } +class UB extends ffi.Opaque {} + +class UA extends ffi.Opaque {} + class UE extends ffi.Union { external ffi.Pointer c; external UD d; } -typedef _c_func = ffi.Pointer Function( - ffi.Pointer a, -); - -typedef _dart_func = ffi.Pointer Function( - ffi.Pointer a, -); - -typedef _c_func2 = ffi.Pointer Function( - ffi.Pointer a, -); +class UC extends ffi.Opaque {} -typedef _dart_func2 = ffi.Pointer Function( - ffi.Pointer a, -); +class UD extends ffi.Union { + @ffi.Int32() + external int a; +} diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart new file mode 100644 index 0000000000..fc0d39badf --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart @@ -0,0 +1,121 @@ +// ignore_for_file: unused_element +// ignore_for_file: unused_field + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +class Bindings { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + Bindings(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + Bindings.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + NamedFunctionProto func1( + NamedFunctionProto named, + ffi.Pointer> unnamed, + ) { + return _func1( + named, + unnamed, + ); + } + + late final _func1_ptr = _lookup< + ffi.NativeFunction< + NamedFunctionProto Function( + NamedFunctionProto, + ffi.Pointer< + ffi.NativeFunction>)>>('func1'); + late final _func1 = _func1_ptr.asFunction< + NamedFunctionProto Function(NamedFunctionProto, + ffi.Pointer>)>(); + + void func2( + ffi.Pointer arg0, + ) { + return _func2( + arg0, + ); + } + + late final _func2_ptr = + _lookup)>>( + 'func2'); + late final _func2 = + _func2_ptr.asFunction)>(); + + void func3( + int arg0, + int b, + ) { + return _func3( + arg0, + b, + ); + } + + late final _func3_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.IntPtr, nesting_a_specified_type)>>('func3'); + late final _func3 = _func3_ptr.asFunction(); + + bool func4( + ffi.Pointer a, + ) { + return _func4( + a, + ) != + 0; + } + + late final _func4_ptr = + _lookup)>>( + 'func4'); + late final _func4 = + _func4_ptr.asFunction)>(); +} + +class Struct1 extends ffi.Struct { + external NamedFunctionProto named; + + external ffi.Pointer> unnamed; +} + +typedef NamedFunctionProto + = ffi.Pointer>; + +class AnonymousStructInTypedef extends ffi.Opaque {} + +class _NamedStructInTypedef extends ffi.Opaque {} + +typedef NTyperef1 = ExcludedStruct; +typedef ExcludedStruct = _ExcludedStruct; + +class _ExcludedStruct extends ffi.Opaque {} + +abstract class AnonymousEnumInTypedef { + static const int a = 0; +} + +abstract class _NamedEnumInTypedef { + static const int b = 0; +} + +typedef nesting_a_specified_type = ffi.IntPtr; + +class Struct2 extends ffi.Opaque {} + +class withBoolAlias extends ffi.Struct { + @ffi.Uint8() + external int b; +} diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart index a06659ee48..d1024151e0 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart @@ -27,8 +27,11 @@ class NativeLibrary { ); } - late final _func1_ptr = _lookup>('func1'); - late final _dart_func1 _func1 = _func1_ptr.asFunction<_dart_func1>(); + late final _func1_ptr = + _lookup)>>( + 'func1'); + late final _func1 = + _func1_ptr.asFunction)>(); void func2( ffi.Pointer s, @@ -38,8 +41,11 @@ class NativeLibrary { ); } - late final _func2_ptr = _lookup>('func2'); - late final _dart_func2 _func2 = _func2_ptr.asFunction<_dart_func2>(); + late final _func2_ptr = + _lookup)>>( + 'func2'); + late final _func2 = + _func2_ptr.asFunction)>(); } class Union1 extends ffi.Union { @@ -56,19 +62,3 @@ class Union3 extends ffi.Opaque {} class Union4 extends ffi.Opaque {} class Union5 extends ffi.Opaque {} - -typedef _c_func1 = ffi.Void Function( - ffi.Pointer s, -); - -typedef _dart_func1 = void Function( - ffi.Pointer s, -); - -typedef _c_func2 = ffi.Void Function( - ffi.Pointer s, -); - -typedef _dart_func2 = void Function( - ffi.Pointer s, -); diff --git a/pkgs/ffigen/test/header_parser_tests/forward_decl_test.dart b/pkgs/ffigen/test/header_parser_tests/forward_decl_test.dart index 0d4488e33b..ca16de4ffc 100644 --- a/pkgs/ffigen/test/header_parser_tests/forward_decl_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/forward_decl_test.dart @@ -33,7 +33,7 @@ ${strings.headers}: matchLibraryWithExpected(actual, [ 'test', 'debug_generated', - 'forward_decl_test_output.dart' + 'header_parser_forward_decl_test_output.dart' ], [ 'test', 'header_parser_tests', diff --git a/pkgs/ffigen/test/header_parser_tests/function_n_struct.h b/pkgs/ffigen/test/header_parser_tests/function_n_struct.h index bae5f401ac..e428cf38f8 100644 --- a/pkgs/ffigen/test/header_parser_tests/function_n_struct.h +++ b/pkgs/ffigen/test/header_parser_tests/function_n_struct.h @@ -33,7 +33,16 @@ struct Struct5 struct Struct3 s; // Incomplete nested struct. }; +typedef int arr10[10]; + +struct Struct6 +{ + arr10 a[2]; +}; + void func1(struct Struct2 *s); // Incomplete array parameter will be treated as a pointer. void func2(struct Struct3 s[]); + +void func3(arr10 a); diff --git a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart index 861a6bfe39..3b34013e34 100644 --- a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart @@ -56,29 +56,37 @@ ${strings.headers}: test('Struct5 incompleted struct member', () { expect((actual.getBinding('Struct5') as Struc).members.isEmpty, true); }); + test('Struct6 typedef constant array', () { + expect(actual.getBindingAsString('Struct6'), + expected.getBindingAsString('Struct6')); + }); + test('func3 constant typedef array parameter', () { + expect(actual.getBindingAsString('func3'), + expected.getBindingAsString('func3')); + }); }); } Library expectedLibrary() { - final struc1 = Struc(name: 'Struct1', members: []); + final struc1 = Struc(name: 'Struct1', members: [ + Member( + name: 'a', + type: Type.nativeType(SupportedNativeType.Int32), + ), + ]); final struc2 = Struc(name: 'Struct2', members: [ Member( name: 'a', type: Type.struct(struc1), ), ]); - final struc3 = Struc(name: 'Struct3', members: []); + final struc3 = Struc(name: 'Struct3'); return Library( name: 'Bindings', bindings: [ + struc1, struc2, struc3, - Struc(name: 'Struct1', members: [ - Member( - name: 'a', - type: Type.nativeType(SupportedNativeType.Int32), - ), - ]), Func( name: 'func1', parameters: [ @@ -97,13 +105,27 @@ Library expectedLibrary() { SupportedNativeType.Void, ), ), - Struc(name: 'Struct4', members: [ - Member( - name: 'a', - type: Type.struct(struc1), + Func( + name: 'func3', + parameters: [ + Parameter( + name: 'a', + type: Type.pointer(Type.nativeType(SupportedNativeType.Int32))), + ], + returnType: Type.nativeType( + SupportedNativeType.Void, ), - ]), + ), + Struc(name: 'Struct4'), Struc(name: 'Struct5'), + Struc(name: 'Struct6', members: [ + Member( + name: 'a', + type: Type.constantArray( + 2, + Type.constantArray( + 10, Type.nativeType(SupportedNativeType.Int32)))) + ]), ], ); } diff --git a/pkgs/ffigen/test/header_parser_tests/functions_test.dart b/pkgs/ffigen/test/header_parser_tests/functions_test.dart index 6e526b15ad..1bfb733bc8 100644 --- a/pkgs/ffigen/test/header_parser_tests/functions_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/functions_test.dart @@ -17,7 +17,6 @@ void main() { group('functions_test', () { setUpAll(() { logWarnings(); - expected = expectedLibrary(); actual = parser.parse( Config.fromYaml(yaml.loadYaml(''' ${strings.name}: 'NativeLibrary' @@ -38,138 +37,17 @@ ${strings.functions}: ''') as yaml.YamlMap), ); }); - test('Total bindings count', () { - expect(actual.bindings.length, expected.bindings.length); - }); - - test('func1', () { - expect(actual.getBindingAsString('func1'), - expected.getBindingAsString('func1')); - }); - test('func2', () { - expect(actual.getBindingAsString('func2'), - expected.getBindingAsString('func2')); - }); - test('func3', () { - expect(actual.getBindingAsString('func3'), - expected.getBindingAsString('func3')); - }); - - test('func4', () { - expect(actual.getBindingAsString('func4'), - expected.getBindingAsString('func4')); - }); - - test('func5', () { - expect(actual.getBindingAsString('func5'), - expected.getBindingAsString('func5')); - }); - - test('Skip inline functions', () { - expect(() => actual.getBindingAsString('inlineFunc'), - throwsA(TypeMatcher())); + test('Expected Bindings', () { + matchLibraryWithExpected(actual, [ + 'test', + 'debug_generated', + 'header_parser_functions_test_output.dart' + ], [ + 'test', + 'header_parser_tests', + 'expected_bindings', + '_expected_functions_bindings.dart' + ]); }); }); } - -Library expectedLibrary() { - return Library( - name: 'Bindings', - bindings: [ - Func( - name: 'func1', - returnType: Type.nativeType( - SupportedNativeType.Void, - ), - ), - Func( - name: 'func2', - returnType: Type.nativeType( - SupportedNativeType.Int32, - ), - parameters: [ - Parameter( - name: '', - type: Type.nativeType( - SupportedNativeType.Int16, - ), - ), - ], - ), - Func( - name: 'func3', - exposeSymbolAddress: true, - returnType: Type.nativeType( - SupportedNativeType.Double, - ), - parameters: [ - Parameter( - type: Type.nativeType( - SupportedNativeType.Float, - ), - ), - Parameter( - name: 'a', - type: Type.nativeType( - SupportedNativeType.Int8, - ), - ), - Parameter( - name: '', - type: Type.nativeType( - SupportedNativeType.Int64, - ), - ), - Parameter( - name: 'b', - type: Type.nativeType( - SupportedNativeType.Int32, - ), - ), - ], - ), - Func( - name: 'func4', - exposeSymbolAddress: true, - returnType: Type.pointer(Type.nativeType(SupportedNativeType.Void)), - parameters: [ - Parameter( - type: Type.pointer( - Type.pointer(Type.nativeType(SupportedNativeType.Int8)))), - Parameter(type: Type.nativeType(SupportedNativeType.Double)), - Parameter( - type: Type.pointer(Type.pointer( - Type.pointer(Type.nativeType(SupportedNativeType.Int32)))), - ), - ]), - Func( - name: 'func5', - returnType: Type.nativeType(SupportedNativeType.Void), - parameters: [ - Parameter( - name: 'a', - type: Type.pointer(Type.nativeFunc(Typedef( - name: 'shortHand', - returnType: Type.nativeType(SupportedNativeType.Void), - typedefType: TypedefType.C, - parameters: [ - Parameter( - type: Type.pointer(Type.nativeFunc(Typedef( - name: 'b', - returnType: Type.nativeType(SupportedNativeType.Void), - typedefType: TypedefType.C, - )))), - ], - )))), - Parameter( - name: 'b', - type: Type.pointer(Type.nativeFunc(Typedef( - name: '_typedefC_2', - returnType: Type.nativeType(SupportedNativeType.Void), - typedefType: TypedefType.C, - )))), - ], - ), - ], - ); -} diff --git a/pkgs/ffigen/test/header_parser_tests/globals.h b/pkgs/ffigen/test/header_parser_tests/globals.h index 80da2b0a07..5ce3fc524f 100644 --- a/pkgs/ffigen/test/header_parser_tests/globals.h +++ b/pkgs/ffigen/test/header_parser_tests/globals.h @@ -19,3 +19,6 @@ struct EmptyStruct }; struct EmptyStruct globalStruct; + +typedef struct EmptyStruct EmptyStruct_Alias; +EmptyStruct_Alias globalStruct_from_alias; diff --git a/pkgs/ffigen/test/header_parser_tests/globals_test.dart b/pkgs/ffigen/test/header_parser_tests/globals_test.dart index 467be8a00a..be10f3c24b 100644 --- a/pkgs/ffigen/test/header_parser_tests/globals_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/globals_test.dart @@ -87,6 +87,16 @@ Library expectedLibrary() { type: Type.struct(globalStruc), exposeSymbolAddress: true, ), + Global( + name: 'globalStruct_from_alias', + type: Type.typealias( + Typealias( + name: 'EmptyStruct_Alias', + type: Type.struct(globalStruc), + ), + ), + exposeSymbolAddress: true, + ) ], ); } diff --git a/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart index cc348cbcc2..4f9187c5b8 100644 --- a/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart @@ -38,7 +38,7 @@ ${strings.headers}: matchLibraryWithExpected(actual, [ 'test', 'debug_generated', - 'native_func_typedef_test_output.dart' + 'header_parser_native_func_typedef_test_output.dart' ], [ 'test', 'header_parser_tests', diff --git a/pkgs/ffigen/test/header_parser_tests/opaque_dependencies.h b/pkgs/ffigen/test/header_parser_tests/opaque_dependencies.h index e30b260e7b..2825911a33 100644 --- a/pkgs/ffigen/test/header_parser_tests/opaque_dependencies.h +++ b/pkgs/ffigen/test/header_parser_tests/opaque_dependencies.h @@ -9,12 +9,12 @@ struct A }; // Opaque. -struct B +typedef struct B { int a; -}; +} B_alias; -struct B *func(struct A *a); +B_alias *func(struct A *a); // Opaque. struct C diff --git a/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart b/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart index 101e8db83c..782f761fbf 100644 --- a/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart @@ -36,12 +36,11 @@ ${strings.unions}: ''') as yaml.YamlMap), ); }); - test('Expected bindings', () { matchLibraryWithExpected(actual, [ 'test', 'debug_generated', - 'opaque_dependencies_test_output.dart' + 'header_parser_opaque_dependencies_test_output.dart' ], [ 'test', 'header_parser_tests', diff --git a/pkgs/ffigen/test/header_parser_tests/packed_structs_test.dart b/pkgs/ffigen/test/header_parser_tests/packed_structs_test.dart index 4e99c037f6..357412e42b 100644 --- a/pkgs/ffigen/test/header_parser_tests/packed_structs_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/packed_structs_test.dart @@ -33,7 +33,7 @@ ${strings.headers}: matchLibraryWithExpected(actual, [ 'test', 'debug_generated', - 'packed_structs_test_output.dart' + 'header_parser_packed_structs_test_output.dart' ], [ 'test', 'header_parser_tests', diff --git a/pkgs/ffigen/test/header_parser_tests/typedef.h b/pkgs/ffigen/test/header_parser_tests/typedef.h index a8e9cd6d5b..73e7e2e555 100644 --- a/pkgs/ffigen/test/header_parser_tests/typedef.h +++ b/pkgs/ffigen/test/header_parser_tests/typedef.h @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +#include + typedef void (*NamedFunctionProto)(); struct Struct1 @@ -59,3 +61,11 @@ void func3(specified_type_as_IntPtr, nesting_a_specified_type b); typedef struct { } Struct2, Struct3, *pStruct2, *pStruct3; + +typedef bool bool_alias; + +bool_alias func4(bool_alias *a); + +struct withBoolAlias{ + bool_alias b; +}; diff --git a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart index 4e3daa52b0..53417c29fc 100644 --- a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart @@ -18,7 +18,6 @@ void main() { group('typedef_test', () { setUpAll(() { logWarnings(Level.SEVERE); - expected = expectedLibrary(); actual = parser.parse( Config.fromYaml(yaml.loadYaml(''' ${strings.name}: 'Bindings' @@ -27,102 +26,33 @@ ${strings.output}: 'unused' ${strings.headers}: ${strings.entryPoints}: - 'test/header_parser_tests/typedef.h' + ${strings.includeDirectives}: + - '**typedef.h' ${strings.structs}: ${strings.exclude}: - ExcludedStruct - _ExcludedStruct ${strings.typedefmap}: 'specified_type_as_IntPtr': 'IntPtr' + +${strings.preamble}: | + // ignore_for_file: unused_element + // ignore_for_file: unused_field ''') as yaml.YamlMap), ); }); - test('Library output', () { - expect(actual.generate(), expected.generate()); + test('Expected Bindings', () { + matchLibraryWithExpected(actual, [ + 'test', + 'debug_generated', + 'header_parser_typedef_test_output.dart' + ], [ + 'test', + 'header_parser_tests', + 'expected_bindings', + '_expected_typedef_bindings.dart' + ]); }); }); } - -Library expectedLibrary() { - final namedTypedef = Typedef( - name: 'NamedFunctionProto', - typedefType: TypedefType.C, - returnType: Type.nativeType(SupportedNativeType.Void), - ); - - final excludedNtyperef = Struc(name: 'NTyperef1'); - return Library( - name: 'Bindings', - bindings: [ - Struc(name: 'Struct1', members: [ - Member( - name: 'named', - type: Type.pointer(Type.nativeFunc(namedTypedef)), - ), - Member( - name: 'unnamed', - type: Type.pointer(Type.nativeFunc(Typedef( - name: '_typedefC_1', - typedefType: TypedefType.C, - returnType: Type.nativeType(SupportedNativeType.Void), - ))), - ), - ]), - Func( - name: 'func1', - parameters: [ - Parameter( - name: 'named', - type: Type.pointer(Type.nativeFunc(namedTypedef)), - ), - Parameter( - name: 'unnamed', - type: Type.pointer(Type.nativeFunc(Typedef( - name: '_typedefC_2', - typedefType: TypedefType.C, - parameters: [ - Parameter(type: Type.nativeType(SupportedNativeType.Int32)), - ], - returnType: Type.nativeType(SupportedNativeType.Void), - ))), - ), - ], - returnType: Type.pointer(Type.nativeFunc(namedTypedef)), - ), - Struc(name: 'AnonymousStructInTypedef'), - Struc(name: 'NamedStructInTypedef'), - excludedNtyperef, - Func( - name: 'func2', - returnType: Type.nativeType(SupportedNativeType.Void), - parameters: [ - Parameter(type: Type.pointer(Type.struct(excludedNtyperef))) - ], - ), - EnumClass( - name: 'AnonymousEnumInTypedef', - enumConstants: [ - EnumConstant(name: 'a', value: 0), - ], - ), - EnumClass( - name: 'NamedEnumInTypedef', - enumConstants: [ - EnumConstant(name: 'b', value: 0), - ], - ), - Func( - name: 'func3', - returnType: Type.nativeType(SupportedNativeType.Void), - parameters: [ - Parameter(type: Type.nativeType(SupportedNativeType.IntPtr)), - Parameter( - type: Type.nativeType(SupportedNativeType.IntPtr), - name: 'b', - ), - ], - ), - Struc(name: 'Struct3'), - ], - ); -} diff --git a/pkgs/ffigen/test/header_parser_tests/unions_test.dart b/pkgs/ffigen/test/header_parser_tests/unions_test.dart index 699f93d0ba..5146d627d5 100644 --- a/pkgs/ffigen/test/header_parser_tests/unions_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/unions_test.dart @@ -33,7 +33,7 @@ ${strings.headers}: matchLibraryWithExpected(actual, [ 'test', 'debug_generated', - 'unions_test_output.dart' + 'header_parser_unions_test_output.dart' ], [ 'test', 'header_parser_tests', diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart index 818416a8b7..73257d0c25 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart @@ -23,9 +23,10 @@ class CJson { } late final _cJSON_Version_ptr = - _lookup>('cJSON_Version'); - late final _dart_cJSON_Version _cJSON_Version = - _cJSON_Version_ptr.asFunction<_dart_cJSON_Version>(); + _lookup Function()>>( + 'cJSON_Version'); + late final _cJSON_Version = + _cJSON_Version_ptr.asFunction Function()>(); void cJSON_InitHooks( ffi.Pointer hooks, @@ -36,9 +37,10 @@ class CJson { } late final _cJSON_InitHooks_ptr = - _lookup>('cJSON_InitHooks'); - late final _dart_cJSON_InitHooks _cJSON_InitHooks = - _cJSON_InitHooks_ptr.asFunction<_dart_cJSON_InitHooks>(); + _lookup)>>( + 'cJSON_InitHooks'); + late final _cJSON_InitHooks = _cJSON_InitHooks_ptr + .asFunction)>(); ffi.Pointer cJSON_Parse( ffi.Pointer value, @@ -48,10 +50,11 @@ class CJson { ); } - late final _cJSON_Parse_ptr = - _lookup>('cJSON_Parse'); - late final _dart_cJSON_Parse _cJSON_Parse = - _cJSON_Parse_ptr.asFunction<_dart_cJSON_Parse>(); + late final _cJSON_Parse_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>>('cJSON_Parse'); + late final _cJSON_Parse = _cJSON_Parse_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_ParseWithOpts( ffi.Pointer value, @@ -65,11 +68,15 @@ class CJson { ); } - late final _cJSON_ParseWithOpts_ptr = - _lookup>( - 'cJSON_ParseWithOpts'); - late final _dart_cJSON_ParseWithOpts _cJSON_ParseWithOpts = - _cJSON_ParseWithOpts_ptr.asFunction<_dart_cJSON_ParseWithOpts>(); + late final _cJSON_ParseWithOpts_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer>, + cJSON_bool)>>('cJSON_ParseWithOpts'); + late final _cJSON_ParseWithOpts = _cJSON_ParseWithOpts_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer>, int)>(); ffi.Pointer cJSON_Print( ffi.Pointer item, @@ -79,10 +86,11 @@ class CJson { ); } - late final _cJSON_Print_ptr = - _lookup>('cJSON_Print'); - late final _dart_cJSON_Print _cJSON_Print = - _cJSON_Print_ptr.asFunction<_dart_cJSON_Print>(); + late final _cJSON_Print_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>>('cJSON_Print'); + late final _cJSON_Print = _cJSON_Print_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_PrintUnformatted( ffi.Pointer item, @@ -92,11 +100,12 @@ class CJson { ); } - late final _cJSON_PrintUnformatted_ptr = - _lookup>( - 'cJSON_PrintUnformatted'); - late final _dart_cJSON_PrintUnformatted _cJSON_PrintUnformatted = - _cJSON_PrintUnformatted_ptr.asFunction<_dart_cJSON_PrintUnformatted>(); + late final _cJSON_PrintUnformatted_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_PrintUnformatted'); + late final _cJSON_PrintUnformatted = _cJSON_PrintUnformatted_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_PrintBuffered( ffi.Pointer item, @@ -110,11 +119,12 @@ class CJson { ); } - late final _cJSON_PrintBuffered_ptr = - _lookup>( - 'cJSON_PrintBuffered'); - late final _dart_cJSON_PrintBuffered _cJSON_PrintBuffered = - _cJSON_PrintBuffered_ptr.asFunction<_dart_cJSON_PrintBuffered>(); + late final _cJSON_PrintBuffered_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Int32, + cJSON_bool)>>('cJSON_PrintBuffered'); + late final _cJSON_PrintBuffered = _cJSON_PrintBuffered_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int, int)>(); int cJSON_PrintPreallocated( ffi.Pointer item, @@ -130,11 +140,12 @@ class CJson { ); } - late final _cJSON_PrintPreallocated_ptr = - _lookup>( - 'cJSON_PrintPreallocated'); - late final _dart_cJSON_PrintPreallocated _cJSON_PrintPreallocated = - _cJSON_PrintPreallocated_ptr.asFunction<_dart_cJSON_PrintPreallocated>(); + late final _cJSON_PrintPreallocated_ptr = _lookup< + ffi.NativeFunction< + cJSON_bool Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, cJSON_bool)>>('cJSON_PrintPreallocated'); + late final _cJSON_PrintPreallocated = _cJSON_PrintPreallocated_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, int)>(); void cJSON_Delete( ffi.Pointer item, @@ -145,9 +156,10 @@ class CJson { } late final _cJSON_Delete_ptr = - _lookup>('cJSON_Delete'); - late final _dart_cJSON_Delete _cJSON_Delete = - _cJSON_Delete_ptr.asFunction<_dart_cJSON_Delete>(); + _lookup)>>( + 'cJSON_Delete'); + late final _cJSON_Delete = + _cJSON_Delete_ptr.asFunction)>(); int cJSON_GetArraySize( ffi.Pointer array, @@ -158,9 +170,10 @@ class CJson { } late final _cJSON_GetArraySize_ptr = - _lookup>('cJSON_GetArraySize'); - late final _dart_cJSON_GetArraySize _cJSON_GetArraySize = - _cJSON_GetArraySize_ptr.asFunction<_dart_cJSON_GetArraySize>(); + _lookup)>>( + 'cJSON_GetArraySize'); + late final _cJSON_GetArraySize = + _cJSON_GetArraySize_ptr.asFunction)>(); ffi.Pointer cJSON_GetArrayItem( ffi.Pointer array, @@ -172,10 +185,12 @@ class CJson { ); } - late final _cJSON_GetArrayItem_ptr = - _lookup>('cJSON_GetArrayItem'); - late final _dart_cJSON_GetArrayItem _cJSON_GetArrayItem = - _cJSON_GetArrayItem_ptr.asFunction<_dart_cJSON_GetArrayItem>(); + late final _cJSON_GetArrayItem_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('cJSON_GetArrayItem'); + late final _cJSON_GetArrayItem = _cJSON_GetArrayItem_ptr + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_GetObjectItem( ffi.Pointer object, @@ -187,11 +202,12 @@ class CJson { ); } - late final _cJSON_GetObjectItem_ptr = - _lookup>( - 'cJSON_GetObjectItem'); - late final _dart_cJSON_GetObjectItem _cJSON_GetObjectItem = - _cJSON_GetObjectItem_ptr.asFunction<_dart_cJSON_GetObjectItem>(); + late final _cJSON_GetObjectItem_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_GetObjectItem'); + late final _cJSON_GetObjectItem = _cJSON_GetObjectItem_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_GetObjectItemCaseSensitive( ffi.Pointer object, @@ -203,12 +219,14 @@ class CJson { ); } - late final _cJSON_GetObjectItemCaseSensitive_ptr = - _lookup>( - 'cJSON_GetObjectItemCaseSensitive'); - late final _dart_cJSON_GetObjectItemCaseSensitive - _cJSON_GetObjectItemCaseSensitive = _cJSON_GetObjectItemCaseSensitive_ptr - .asFunction<_dart_cJSON_GetObjectItemCaseSensitive>(); + late final _cJSON_GetObjectItemCaseSensitive_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_GetObjectItemCaseSensitive'); + late final _cJSON_GetObjectItemCaseSensitive = + _cJSON_GetObjectItemCaseSensitive_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); int cJSON_HasObjectItem( ffi.Pointer object, @@ -220,20 +238,22 @@ class CJson { ); } - late final _cJSON_HasObjectItem_ptr = - _lookup>( - 'cJSON_HasObjectItem'); - late final _dart_cJSON_HasObjectItem _cJSON_HasObjectItem = - _cJSON_HasObjectItem_ptr.asFunction<_dart_cJSON_HasObjectItem>(); + late final _cJSON_HasObjectItem_ptr = _lookup< + ffi.NativeFunction< + cJSON_bool Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_HasObjectItem'); + late final _cJSON_HasObjectItem = _cJSON_HasObjectItem_ptr + .asFunction, ffi.Pointer)>(); ffi.Pointer cJSON_GetErrorPtr() { return _cJSON_GetErrorPtr(); } late final _cJSON_GetErrorPtr_ptr = - _lookup>('cJSON_GetErrorPtr'); - late final _dart_cJSON_GetErrorPtr _cJSON_GetErrorPtr = - _cJSON_GetErrorPtr_ptr.asFunction<_dart_cJSON_GetErrorPtr>(); + _lookup Function()>>( + 'cJSON_GetErrorPtr'); + late final _cJSON_GetErrorPtr = + _cJSON_GetErrorPtr_ptr.asFunction Function()>(); ffi.Pointer cJSON_GetStringValue( ffi.Pointer item, @@ -243,11 +263,12 @@ class CJson { ); } - late final _cJSON_GetStringValue_ptr = - _lookup>( - 'cJSON_GetStringValue'); - late final _dart_cJSON_GetStringValue _cJSON_GetStringValue = - _cJSON_GetStringValue_ptr.asFunction<_dart_cJSON_GetStringValue>(); + late final _cJSON_GetStringValue_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_GetStringValue'); + late final _cJSON_GetStringValue = _cJSON_GetStringValue_ptr + .asFunction Function(ffi.Pointer)>(); int cJSON_IsInvalid( ffi.Pointer item, @@ -258,9 +279,10 @@ class CJson { } late final _cJSON_IsInvalid_ptr = - _lookup>('cJSON_IsInvalid'); - late final _dart_cJSON_IsInvalid _cJSON_IsInvalid = - _cJSON_IsInvalid_ptr.asFunction<_dart_cJSON_IsInvalid>(); + _lookup)>>( + 'cJSON_IsInvalid'); + late final _cJSON_IsInvalid = + _cJSON_IsInvalid_ptr.asFunction)>(); int cJSON_IsFalse( ffi.Pointer item, @@ -271,9 +293,10 @@ class CJson { } late final _cJSON_IsFalse_ptr = - _lookup>('cJSON_IsFalse'); - late final _dart_cJSON_IsFalse _cJSON_IsFalse = - _cJSON_IsFalse_ptr.asFunction<_dart_cJSON_IsFalse>(); + _lookup)>>( + 'cJSON_IsFalse'); + late final _cJSON_IsFalse = + _cJSON_IsFalse_ptr.asFunction)>(); int cJSON_IsTrue( ffi.Pointer item, @@ -284,9 +307,10 @@ class CJson { } late final _cJSON_IsTrue_ptr = - _lookup>('cJSON_IsTrue'); - late final _dart_cJSON_IsTrue _cJSON_IsTrue = - _cJSON_IsTrue_ptr.asFunction<_dart_cJSON_IsTrue>(); + _lookup)>>( + 'cJSON_IsTrue'); + late final _cJSON_IsTrue = + _cJSON_IsTrue_ptr.asFunction)>(); int cJSON_IsBool( ffi.Pointer item, @@ -297,9 +321,10 @@ class CJson { } late final _cJSON_IsBool_ptr = - _lookup>('cJSON_IsBool'); - late final _dart_cJSON_IsBool _cJSON_IsBool = - _cJSON_IsBool_ptr.asFunction<_dart_cJSON_IsBool>(); + _lookup)>>( + 'cJSON_IsBool'); + late final _cJSON_IsBool = + _cJSON_IsBool_ptr.asFunction)>(); int cJSON_IsNull( ffi.Pointer item, @@ -310,9 +335,10 @@ class CJson { } late final _cJSON_IsNull_ptr = - _lookup>('cJSON_IsNull'); - late final _dart_cJSON_IsNull _cJSON_IsNull = - _cJSON_IsNull_ptr.asFunction<_dart_cJSON_IsNull>(); + _lookup)>>( + 'cJSON_IsNull'); + late final _cJSON_IsNull = + _cJSON_IsNull_ptr.asFunction)>(); int cJSON_IsNumber( ffi.Pointer item, @@ -323,9 +349,10 @@ class CJson { } late final _cJSON_IsNumber_ptr = - _lookup>('cJSON_IsNumber'); - late final _dart_cJSON_IsNumber _cJSON_IsNumber = - _cJSON_IsNumber_ptr.asFunction<_dart_cJSON_IsNumber>(); + _lookup)>>( + 'cJSON_IsNumber'); + late final _cJSON_IsNumber = + _cJSON_IsNumber_ptr.asFunction)>(); int cJSON_IsString( ffi.Pointer item, @@ -336,9 +363,10 @@ class CJson { } late final _cJSON_IsString_ptr = - _lookup>('cJSON_IsString'); - late final _dart_cJSON_IsString _cJSON_IsString = - _cJSON_IsString_ptr.asFunction<_dart_cJSON_IsString>(); + _lookup)>>( + 'cJSON_IsString'); + late final _cJSON_IsString = + _cJSON_IsString_ptr.asFunction)>(); int cJSON_IsArray( ffi.Pointer item, @@ -349,9 +377,10 @@ class CJson { } late final _cJSON_IsArray_ptr = - _lookup>('cJSON_IsArray'); - late final _dart_cJSON_IsArray _cJSON_IsArray = - _cJSON_IsArray_ptr.asFunction<_dart_cJSON_IsArray>(); + _lookup)>>( + 'cJSON_IsArray'); + late final _cJSON_IsArray = + _cJSON_IsArray_ptr.asFunction)>(); int cJSON_IsObject( ffi.Pointer item, @@ -362,9 +391,10 @@ class CJson { } late final _cJSON_IsObject_ptr = - _lookup>('cJSON_IsObject'); - late final _dart_cJSON_IsObject _cJSON_IsObject = - _cJSON_IsObject_ptr.asFunction<_dart_cJSON_IsObject>(); + _lookup)>>( + 'cJSON_IsObject'); + late final _cJSON_IsObject = + _cJSON_IsObject_ptr.asFunction)>(); int cJSON_IsRaw( ffi.Pointer item, @@ -375,36 +405,40 @@ class CJson { } late final _cJSON_IsRaw_ptr = - _lookup>('cJSON_IsRaw'); - late final _dart_cJSON_IsRaw _cJSON_IsRaw = - _cJSON_IsRaw_ptr.asFunction<_dart_cJSON_IsRaw>(); + _lookup)>>( + 'cJSON_IsRaw'); + late final _cJSON_IsRaw = + _cJSON_IsRaw_ptr.asFunction)>(); ffi.Pointer cJSON_CreateNull() { return _cJSON_CreateNull(); } late final _cJSON_CreateNull_ptr = - _lookup>('cJSON_CreateNull'); - late final _dart_cJSON_CreateNull _cJSON_CreateNull = - _cJSON_CreateNull_ptr.asFunction<_dart_cJSON_CreateNull>(); + _lookup Function()>>( + 'cJSON_CreateNull'); + late final _cJSON_CreateNull = + _cJSON_CreateNull_ptr.asFunction Function()>(); ffi.Pointer cJSON_CreateTrue() { return _cJSON_CreateTrue(); } late final _cJSON_CreateTrue_ptr = - _lookup>('cJSON_CreateTrue'); - late final _dart_cJSON_CreateTrue _cJSON_CreateTrue = - _cJSON_CreateTrue_ptr.asFunction<_dart_cJSON_CreateTrue>(); + _lookup Function()>>( + 'cJSON_CreateTrue'); + late final _cJSON_CreateTrue = + _cJSON_CreateTrue_ptr.asFunction Function()>(); ffi.Pointer cJSON_CreateFalse() { return _cJSON_CreateFalse(); } late final _cJSON_CreateFalse_ptr = - _lookup>('cJSON_CreateFalse'); - late final _dart_cJSON_CreateFalse _cJSON_CreateFalse = - _cJSON_CreateFalse_ptr.asFunction<_dart_cJSON_CreateFalse>(); + _lookup Function()>>( + 'cJSON_CreateFalse'); + late final _cJSON_CreateFalse = + _cJSON_CreateFalse_ptr.asFunction Function()>(); ffi.Pointer cJSON_CreateBool( int boolean, @@ -415,9 +449,10 @@ class CJson { } late final _cJSON_CreateBool_ptr = - _lookup>('cJSON_CreateBool'); - late final _dart_cJSON_CreateBool _cJSON_CreateBool = - _cJSON_CreateBool_ptr.asFunction<_dart_cJSON_CreateBool>(); + _lookup Function(cJSON_bool)>>( + 'cJSON_CreateBool'); + late final _cJSON_CreateBool = + _cJSON_CreateBool_ptr.asFunction Function(int)>(); ffi.Pointer cJSON_CreateNumber( double num, @@ -428,9 +463,10 @@ class CJson { } late final _cJSON_CreateNumber_ptr = - _lookup>('cJSON_CreateNumber'); - late final _dart_cJSON_CreateNumber _cJSON_CreateNumber = - _cJSON_CreateNumber_ptr.asFunction<_dart_cJSON_CreateNumber>(); + _lookup Function(ffi.Double)>>( + 'cJSON_CreateNumber'); + late final _cJSON_CreateNumber = + _cJSON_CreateNumber_ptr.asFunction Function(double)>(); ffi.Pointer cJSON_CreateString( ffi.Pointer string, @@ -440,10 +476,12 @@ class CJson { ); } - late final _cJSON_CreateString_ptr = - _lookup>('cJSON_CreateString'); - late final _dart_cJSON_CreateString _cJSON_CreateString = - _cJSON_CreateString_ptr.asFunction<_dart_cJSON_CreateString>(); + late final _cJSON_CreateString_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_CreateString'); + late final _cJSON_CreateString = _cJSON_CreateString_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateRaw( ffi.Pointer raw, @@ -453,28 +491,32 @@ class CJson { ); } - late final _cJSON_CreateRaw_ptr = - _lookup>('cJSON_CreateRaw'); - late final _dart_cJSON_CreateRaw _cJSON_CreateRaw = - _cJSON_CreateRaw_ptr.asFunction<_dart_cJSON_CreateRaw>(); + late final _cJSON_CreateRaw_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_CreateRaw'); + late final _cJSON_CreateRaw = _cJSON_CreateRaw_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateArray() { return _cJSON_CreateArray(); } late final _cJSON_CreateArray_ptr = - _lookup>('cJSON_CreateArray'); - late final _dart_cJSON_CreateArray _cJSON_CreateArray = - _cJSON_CreateArray_ptr.asFunction<_dart_cJSON_CreateArray>(); + _lookup Function()>>( + 'cJSON_CreateArray'); + late final _cJSON_CreateArray = + _cJSON_CreateArray_ptr.asFunction Function()>(); ffi.Pointer cJSON_CreateObject() { return _cJSON_CreateObject(); } late final _cJSON_CreateObject_ptr = - _lookup>('cJSON_CreateObject'); - late final _dart_cJSON_CreateObject _cJSON_CreateObject = - _cJSON_CreateObject_ptr.asFunction<_dart_cJSON_CreateObject>(); + _lookup Function()>>( + 'cJSON_CreateObject'); + late final _cJSON_CreateObject = + _cJSON_CreateObject_ptr.asFunction Function()>(); ffi.Pointer cJSON_CreateStringReference( ffi.Pointer string, @@ -484,12 +526,12 @@ class CJson { ); } - late final _cJSON_CreateStringReference_ptr = - _lookup>( - 'cJSON_CreateStringReference'); - late final _dart_cJSON_CreateStringReference _cJSON_CreateStringReference = - _cJSON_CreateStringReference_ptr - .asFunction<_dart_cJSON_CreateStringReference>(); + late final _cJSON_CreateStringReference_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_CreateStringReference'); + late final _cJSON_CreateStringReference = _cJSON_CreateStringReference_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateObjectReference( ffi.Pointer child, @@ -499,12 +541,11 @@ class CJson { ); } - late final _cJSON_CreateObjectReference_ptr = - _lookup>( - 'cJSON_CreateObjectReference'); - late final _dart_cJSON_CreateObjectReference _cJSON_CreateObjectReference = - _cJSON_CreateObjectReference_ptr - .asFunction<_dart_cJSON_CreateObjectReference>(); + late final _cJSON_CreateObjectReference_ptr = _lookup< + ffi.NativeFunction Function(ffi.Pointer)>>( + 'cJSON_CreateObjectReference'); + late final _cJSON_CreateObjectReference = _cJSON_CreateObjectReference_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateArrayReference( ffi.Pointer child, @@ -514,12 +555,11 @@ class CJson { ); } - late final _cJSON_CreateArrayReference_ptr = - _lookup>( - 'cJSON_CreateArrayReference'); - late final _dart_cJSON_CreateArrayReference _cJSON_CreateArrayReference = - _cJSON_CreateArrayReference_ptr - .asFunction<_dart_cJSON_CreateArrayReference>(); + late final _cJSON_CreateArrayReference_ptr = _lookup< + ffi.NativeFunction Function(ffi.Pointer)>>( + 'cJSON_CreateArrayReference'); + late final _cJSON_CreateArrayReference = _cJSON_CreateArrayReference_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateIntArray( ffi.Pointer numbers, @@ -531,11 +571,12 @@ class CJson { ); } - late final _cJSON_CreateIntArray_ptr = - _lookup>( - 'cJSON_CreateIntArray'); - late final _dart_cJSON_CreateIntArray _cJSON_CreateIntArray = - _cJSON_CreateIntArray_ptr.asFunction<_dart_cJSON_CreateIntArray>(); + late final _cJSON_CreateIntArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('cJSON_CreateIntArray'); + late final _cJSON_CreateIntArray = _cJSON_CreateIntArray_ptr + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateFloatArray( ffi.Pointer numbers, @@ -547,11 +588,12 @@ class CJson { ); } - late final _cJSON_CreateFloatArray_ptr = - _lookup>( - 'cJSON_CreateFloatArray'); - late final _dart_cJSON_CreateFloatArray _cJSON_CreateFloatArray = - _cJSON_CreateFloatArray_ptr.asFunction<_dart_cJSON_CreateFloatArray>(); + late final _cJSON_CreateFloatArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('cJSON_CreateFloatArray'); + late final _cJSON_CreateFloatArray = _cJSON_CreateFloatArray_ptr + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateDoubleArray( ffi.Pointer numbers, @@ -563,11 +605,12 @@ class CJson { ); } - late final _cJSON_CreateDoubleArray_ptr = - _lookup>( - 'cJSON_CreateDoubleArray'); - late final _dart_cJSON_CreateDoubleArray _cJSON_CreateDoubleArray = - _cJSON_CreateDoubleArray_ptr.asFunction<_dart_cJSON_CreateDoubleArray>(); + late final _cJSON_CreateDoubleArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('cJSON_CreateDoubleArray'); + late final _cJSON_CreateDoubleArray = _cJSON_CreateDoubleArray_ptr + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateStringArray( ffi.Pointer> strings, @@ -579,11 +622,12 @@ class CJson { ); } - late final _cJSON_CreateStringArray_ptr = - _lookup>( - 'cJSON_CreateStringArray'); - late final _dart_cJSON_CreateStringArray _cJSON_CreateStringArray = - _cJSON_CreateStringArray_ptr.asFunction<_dart_cJSON_CreateStringArray>(); + late final _cJSON_CreateStringArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer>, + ffi.Int32)>>('cJSON_CreateStringArray'); + late final _cJSON_CreateStringArray = _cJSON_CreateStringArray_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer>, int)>(); void cJSON_AddItemToArray( ffi.Pointer array, @@ -595,11 +639,12 @@ class CJson { ); } - late final _cJSON_AddItemToArray_ptr = - _lookup>( - 'cJSON_AddItemToArray'); - late final _dart_cJSON_AddItemToArray _cJSON_AddItemToArray = - _cJSON_AddItemToArray_ptr.asFunction<_dart_cJSON_AddItemToArray>(); + late final _cJSON_AddItemToArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemToArray'); + late final _cJSON_AddItemToArray = _cJSON_AddItemToArray_ptr + .asFunction, ffi.Pointer)>(); void cJSON_AddItemToObject( ffi.Pointer object, @@ -613,11 +658,13 @@ class CJson { ); } - late final _cJSON_AddItemToObject_ptr = - _lookup>( - 'cJSON_AddItemToObject'); - late final _dart_cJSON_AddItemToObject _cJSON_AddItemToObject = - _cJSON_AddItemToObject_ptr.asFunction<_dart_cJSON_AddItemToObject>(); + late final _cJSON_AddItemToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddItemToObject'); + late final _cJSON_AddItemToObject = _cJSON_AddItemToObject_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_AddItemToObjectCS( ffi.Pointer object, @@ -631,11 +678,13 @@ class CJson { ); } - late final _cJSON_AddItemToObjectCS_ptr = - _lookup>( - 'cJSON_AddItemToObjectCS'); - late final _dart_cJSON_AddItemToObjectCS _cJSON_AddItemToObjectCS = - _cJSON_AddItemToObjectCS_ptr.asFunction<_dart_cJSON_AddItemToObjectCS>(); + late final _cJSON_AddItemToObjectCS_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddItemToObjectCS'); + late final _cJSON_AddItemToObjectCS = _cJSON_AddItemToObjectCS_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_AddItemReferenceToArray( ffi.Pointer array, @@ -647,12 +696,12 @@ class CJson { ); } - late final _cJSON_AddItemReferenceToArray_ptr = - _lookup>( - 'cJSON_AddItemReferenceToArray'); - late final _dart_cJSON_AddItemReferenceToArray - _cJSON_AddItemReferenceToArray = _cJSON_AddItemReferenceToArray_ptr - .asFunction<_dart_cJSON_AddItemReferenceToArray>(); + late final _cJSON_AddItemReferenceToArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddItemReferenceToArray'); + late final _cJSON_AddItemReferenceToArray = _cJSON_AddItemReferenceToArray_ptr + .asFunction, ffi.Pointer)>(); void cJSON_AddItemReferenceToObject( ffi.Pointer object, @@ -666,12 +715,14 @@ class CJson { ); } - late final _cJSON_AddItemReferenceToObject_ptr = - _lookup>( - 'cJSON_AddItemReferenceToObject'); - late final _dart_cJSON_AddItemReferenceToObject - _cJSON_AddItemReferenceToObject = _cJSON_AddItemReferenceToObject_ptr - .asFunction<_dart_cJSON_AddItemReferenceToObject>(); + late final _cJSON_AddItemReferenceToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddItemReferenceToObject'); + late final _cJSON_AddItemReferenceToObject = + _cJSON_AddItemReferenceToObject_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_DetachItemViaPointer( ffi.Pointer parent, @@ -683,12 +734,14 @@ class CJson { ); } - late final _cJSON_DetachItemViaPointer_ptr = - _lookup>( - 'cJSON_DetachItemViaPointer'); - late final _dart_cJSON_DetachItemViaPointer _cJSON_DetachItemViaPointer = - _cJSON_DetachItemViaPointer_ptr - .asFunction<_dart_cJSON_DetachItemViaPointer>(); + late final _cJSON_DetachItemViaPointer_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_DetachItemViaPointer'); + late final _cJSON_DetachItemViaPointer = + _cJSON_DetachItemViaPointer_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_DetachItemFromArray( ffi.Pointer array, @@ -700,12 +753,12 @@ class CJson { ); } - late final _cJSON_DetachItemFromArray_ptr = - _lookup>( - 'cJSON_DetachItemFromArray'); - late final _dart_cJSON_DetachItemFromArray _cJSON_DetachItemFromArray = - _cJSON_DetachItemFromArray_ptr - .asFunction<_dart_cJSON_DetachItemFromArray>(); + late final _cJSON_DetachItemFromArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('cJSON_DetachItemFromArray'); + late final _cJSON_DetachItemFromArray = _cJSON_DetachItemFromArray_ptr + .asFunction Function(ffi.Pointer, int)>(); void cJSON_DeleteItemFromArray( ffi.Pointer array, @@ -717,12 +770,11 @@ class CJson { ); } - late final _cJSON_DeleteItemFromArray_ptr = - _lookup>( - 'cJSON_DeleteItemFromArray'); - late final _dart_cJSON_DeleteItemFromArray _cJSON_DeleteItemFromArray = - _cJSON_DeleteItemFromArray_ptr - .asFunction<_dart_cJSON_DeleteItemFromArray>(); + late final _cJSON_DeleteItemFromArray_ptr = _lookup< + ffi.NativeFunction, ffi.Int32)>>( + 'cJSON_DeleteItemFromArray'); + late final _cJSON_DeleteItemFromArray = _cJSON_DeleteItemFromArray_ptr + .asFunction, int)>(); ffi.Pointer cJSON_DetachItemFromObject( ffi.Pointer object, @@ -734,12 +786,14 @@ class CJson { ); } - late final _cJSON_DetachItemFromObject_ptr = - _lookup>( - 'cJSON_DetachItemFromObject'); - late final _dart_cJSON_DetachItemFromObject _cJSON_DetachItemFromObject = - _cJSON_DetachItemFromObject_ptr - .asFunction<_dart_cJSON_DetachItemFromObject>(); + late final _cJSON_DetachItemFromObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_DetachItemFromObject'); + late final _cJSON_DetachItemFromObject = + _cJSON_DetachItemFromObject_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_DetachItemFromObjectCaseSensitive( ffi.Pointer object, @@ -751,13 +805,15 @@ class CJson { ); } - late final _cJSON_DetachItemFromObjectCaseSensitive_ptr = - _lookup>( - 'cJSON_DetachItemFromObjectCaseSensitive'); - late final _dart_cJSON_DetachItemFromObjectCaseSensitive - _cJSON_DetachItemFromObjectCaseSensitive = - _cJSON_DetachItemFromObjectCaseSensitive_ptr - .asFunction<_dart_cJSON_DetachItemFromObjectCaseSensitive>(); + late final _cJSON_DetachItemFromObjectCaseSensitive_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>( + 'cJSON_DetachItemFromObjectCaseSensitive'); + late final _cJSON_DetachItemFromObjectCaseSensitive = + _cJSON_DetachItemFromObjectCaseSensitive_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); void cJSON_DeleteItemFromObject( ffi.Pointer object, @@ -769,12 +825,12 @@ class CJson { ); } - late final _cJSON_DeleteItemFromObject_ptr = - _lookup>( - 'cJSON_DeleteItemFromObject'); - late final _dart_cJSON_DeleteItemFromObject _cJSON_DeleteItemFromObject = - _cJSON_DeleteItemFromObject_ptr - .asFunction<_dart_cJSON_DeleteItemFromObject>(); + late final _cJSON_DeleteItemFromObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_DeleteItemFromObject'); + late final _cJSON_DeleteItemFromObject = _cJSON_DeleteItemFromObject_ptr + .asFunction, ffi.Pointer)>(); void cJSON_DeleteItemFromObjectCaseSensitive( ffi.Pointer object, @@ -786,13 +842,13 @@ class CJson { ); } - late final _cJSON_DeleteItemFromObjectCaseSensitive_ptr = - _lookup>( - 'cJSON_DeleteItemFromObjectCaseSensitive'); - late final _dart_cJSON_DeleteItemFromObjectCaseSensitive - _cJSON_DeleteItemFromObjectCaseSensitive = - _cJSON_DeleteItemFromObjectCaseSensitive_ptr - .asFunction<_dart_cJSON_DeleteItemFromObjectCaseSensitive>(); + late final _cJSON_DeleteItemFromObjectCaseSensitive_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer)>>( + 'cJSON_DeleteItemFromObjectCaseSensitive'); + late final _cJSON_DeleteItemFromObjectCaseSensitive = + _cJSON_DeleteItemFromObjectCaseSensitive_ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); void cJSON_InsertItemInArray( ffi.Pointer array, @@ -806,11 +862,12 @@ class CJson { ); } - late final _cJSON_InsertItemInArray_ptr = - _lookup>( - 'cJSON_InsertItemInArray'); - late final _dart_cJSON_InsertItemInArray _cJSON_InsertItemInArray = - _cJSON_InsertItemInArray_ptr.asFunction<_dart_cJSON_InsertItemInArray>(); + late final _cJSON_InsertItemInArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer)>>('cJSON_InsertItemInArray'); + late final _cJSON_InsertItemInArray = _cJSON_InsertItemInArray_ptr + .asFunction, int, ffi.Pointer)>(); int cJSON_ReplaceItemViaPointer( ffi.Pointer parent, @@ -824,12 +881,14 @@ class CJson { ); } - late final _cJSON_ReplaceItemViaPointer_ptr = - _lookup>( - 'cJSON_ReplaceItemViaPointer'); - late final _dart_cJSON_ReplaceItemViaPointer _cJSON_ReplaceItemViaPointer = - _cJSON_ReplaceItemViaPointer_ptr - .asFunction<_dart_cJSON_ReplaceItemViaPointer>(); + late final _cJSON_ReplaceItemViaPointer_ptr = _lookup< + ffi.NativeFunction< + cJSON_bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_ReplaceItemViaPointer'); + late final _cJSON_ReplaceItemViaPointer = + _cJSON_ReplaceItemViaPointer_ptr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_ReplaceItemInArray( ffi.Pointer array, @@ -843,12 +902,12 @@ class CJson { ); } - late final _cJSON_ReplaceItemInArray_ptr = - _lookup>( - 'cJSON_ReplaceItemInArray'); - late final _dart_cJSON_ReplaceItemInArray _cJSON_ReplaceItemInArray = - _cJSON_ReplaceItemInArray_ptr - .asFunction<_dart_cJSON_ReplaceItemInArray>(); + late final _cJSON_ReplaceItemInArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer)>>('cJSON_ReplaceItemInArray'); + late final _cJSON_ReplaceItemInArray = _cJSON_ReplaceItemInArray_ptr + .asFunction, int, ffi.Pointer)>(); void cJSON_ReplaceItemInObject( ffi.Pointer object, @@ -862,12 +921,14 @@ class CJson { ); } - late final _cJSON_ReplaceItemInObject_ptr = - _lookup>( - 'cJSON_ReplaceItemInObject'); - late final _dart_cJSON_ReplaceItemInObject _cJSON_ReplaceItemInObject = - _cJSON_ReplaceItemInObject_ptr - .asFunction<_dart_cJSON_ReplaceItemInObject>(); + late final _cJSON_ReplaceItemInObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_ReplaceItemInObject'); + late final _cJSON_ReplaceItemInObject = + _cJSON_ReplaceItemInObject_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_ReplaceItemInObjectCaseSensitive( ffi.Pointer object, @@ -881,13 +942,14 @@ class CJson { ); } - late final _cJSON_ReplaceItemInObjectCaseSensitive_ptr = - _lookup>( - 'cJSON_ReplaceItemInObjectCaseSensitive'); - late final _dart_cJSON_ReplaceItemInObjectCaseSensitive - _cJSON_ReplaceItemInObjectCaseSensitive = - _cJSON_ReplaceItemInObjectCaseSensitive_ptr - .asFunction<_dart_cJSON_ReplaceItemInObjectCaseSensitive>(); + late final _cJSON_ReplaceItemInObjectCaseSensitive_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_ReplaceItemInObjectCaseSensitive'); + late final _cJSON_ReplaceItemInObjectCaseSensitive = + _cJSON_ReplaceItemInObjectCaseSensitive_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_Duplicate( ffi.Pointer item, @@ -899,10 +961,12 @@ class CJson { ); } - late final _cJSON_Duplicate_ptr = - _lookup>('cJSON_Duplicate'); - late final _dart_cJSON_Duplicate _cJSON_Duplicate = - _cJSON_Duplicate_ptr.asFunction<_dart_cJSON_Duplicate>(); + late final _cJSON_Duplicate_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, cJSON_bool)>>('cJSON_Duplicate'); + late final _cJSON_Duplicate = _cJSON_Duplicate_ptr + .asFunction Function(ffi.Pointer, int)>(); int cJSON_Compare( ffi.Pointer a, @@ -916,10 +980,12 @@ class CJson { ); } - late final _cJSON_Compare_ptr = - _lookup>('cJSON_Compare'); - late final _dart_cJSON_Compare _cJSON_Compare = - _cJSON_Compare_ptr.asFunction<_dart_cJSON_Compare>(); + late final _cJSON_Compare_ptr = _lookup< + ffi.NativeFunction< + cJSON_bool Function(ffi.Pointer, ffi.Pointer, + cJSON_bool)>>('cJSON_Compare'); + late final _cJSON_Compare = _cJSON_Compare_ptr + .asFunction, ffi.Pointer, int)>(); void cJSON_Minify( ffi.Pointer json, @@ -930,9 +996,10 @@ class CJson { } late final _cJSON_Minify_ptr = - _lookup>('cJSON_Minify'); - late final _dart_cJSON_Minify _cJSON_Minify = - _cJSON_Minify_ptr.asFunction<_dart_cJSON_Minify>(); + _lookup)>>( + 'cJSON_Minify'); + late final _cJSON_Minify = + _cJSON_Minify_ptr.asFunction)>(); ffi.Pointer cJSON_AddNullToObject( ffi.Pointer object, @@ -944,11 +1011,12 @@ class CJson { ); } - late final _cJSON_AddNullToObject_ptr = - _lookup>( - 'cJSON_AddNullToObject'); - late final _dart_cJSON_AddNullToObject _cJSON_AddNullToObject = - _cJSON_AddNullToObject_ptr.asFunction<_dart_cJSON_AddNullToObject>(); + late final _cJSON_AddNullToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddNullToObject'); + late final _cJSON_AddNullToObject = _cJSON_AddNullToObject_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddTrueToObject( ffi.Pointer object, @@ -960,11 +1028,12 @@ class CJson { ); } - late final _cJSON_AddTrueToObject_ptr = - _lookup>( - 'cJSON_AddTrueToObject'); - late final _dart_cJSON_AddTrueToObject _cJSON_AddTrueToObject = - _cJSON_AddTrueToObject_ptr.asFunction<_dart_cJSON_AddTrueToObject>(); + late final _cJSON_AddTrueToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddTrueToObject'); + late final _cJSON_AddTrueToObject = _cJSON_AddTrueToObject_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddFalseToObject( ffi.Pointer object, @@ -976,11 +1045,12 @@ class CJson { ); } - late final _cJSON_AddFalseToObject_ptr = - _lookup>( - 'cJSON_AddFalseToObject'); - late final _dart_cJSON_AddFalseToObject _cJSON_AddFalseToObject = - _cJSON_AddFalseToObject_ptr.asFunction<_dart_cJSON_AddFalseToObject>(); + late final _cJSON_AddFalseToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddFalseToObject'); + late final _cJSON_AddFalseToObject = _cJSON_AddFalseToObject_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddBoolToObject( ffi.Pointer object, @@ -994,11 +1064,13 @@ class CJson { ); } - late final _cJSON_AddBoolToObject_ptr = - _lookup>( - 'cJSON_AddBoolToObject'); - late final _dart_cJSON_AddBoolToObject _cJSON_AddBoolToObject = - _cJSON_AddBoolToObject_ptr.asFunction<_dart_cJSON_AddBoolToObject>(); + late final _cJSON_AddBoolToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + cJSON_bool)>>('cJSON_AddBoolToObject'); + late final _cJSON_AddBoolToObject = _cJSON_AddBoolToObject_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); ffi.Pointer cJSON_AddNumberToObject( ffi.Pointer object, @@ -1012,11 +1084,13 @@ class CJson { ); } - late final _cJSON_AddNumberToObject_ptr = - _lookup>( - 'cJSON_AddNumberToObject'); - late final _dart_cJSON_AddNumberToObject _cJSON_AddNumberToObject = - _cJSON_AddNumberToObject_ptr.asFunction<_dart_cJSON_AddNumberToObject>(); + late final _cJSON_AddNumberToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Double)>>('cJSON_AddNumberToObject'); + late final _cJSON_AddNumberToObject = _cJSON_AddNumberToObject_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); ffi.Pointer cJSON_AddStringToObject( ffi.Pointer object, @@ -1030,11 +1104,13 @@ class CJson { ); } - late final _cJSON_AddStringToObject_ptr = - _lookup>( - 'cJSON_AddStringToObject'); - late final _dart_cJSON_AddStringToObject _cJSON_AddStringToObject = - _cJSON_AddStringToObject_ptr.asFunction<_dart_cJSON_AddStringToObject>(); + late final _cJSON_AddStringToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddStringToObject'); + late final _cJSON_AddStringToObject = _cJSON_AddStringToObject_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddRawToObject( ffi.Pointer object, @@ -1048,11 +1124,13 @@ class CJson { ); } - late final _cJSON_AddRawToObject_ptr = - _lookup>( - 'cJSON_AddRawToObject'); - late final _dart_cJSON_AddRawToObject _cJSON_AddRawToObject = - _cJSON_AddRawToObject_ptr.asFunction<_dart_cJSON_AddRawToObject>(); + late final _cJSON_AddRawToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddRawToObject'); + late final _cJSON_AddRawToObject = _cJSON_AddRawToObject_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddObjectToObject( ffi.Pointer object, @@ -1064,11 +1142,12 @@ class CJson { ); } - late final _cJSON_AddObjectToObject_ptr = - _lookup>( - 'cJSON_AddObjectToObject'); - late final _dart_cJSON_AddObjectToObject _cJSON_AddObjectToObject = - _cJSON_AddObjectToObject_ptr.asFunction<_dart_cJSON_AddObjectToObject>(); + late final _cJSON_AddObjectToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddObjectToObject'); + late final _cJSON_AddObjectToObject = _cJSON_AddObjectToObject_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddArrayToObject( ffi.Pointer object, @@ -1080,11 +1159,12 @@ class CJson { ); } - late final _cJSON_AddArrayToObject_ptr = - _lookup>( - 'cJSON_AddArrayToObject'); - late final _dart_cJSON_AddArrayToObject _cJSON_AddArrayToObject = - _cJSON_AddArrayToObject_ptr.asFunction<_dart_cJSON_AddArrayToObject>(); + late final _cJSON_AddArrayToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddArrayToObject'); + late final _cJSON_AddArrayToObject = _cJSON_AddArrayToObject_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); double cJSON_SetNumberHelper( ffi.Pointer object, @@ -1096,11 +1176,12 @@ class CJson { ); } - late final _cJSON_SetNumberHelper_ptr = - _lookup>( - 'cJSON_SetNumberHelper'); - late final _dart_cJSON_SetNumberHelper _cJSON_SetNumberHelper = - _cJSON_SetNumberHelper_ptr.asFunction<_dart_cJSON_SetNumberHelper>(); + late final _cJSON_SetNumberHelper_ptr = _lookup< + ffi.NativeFunction< + ffi.Double Function( + ffi.Pointer, ffi.Double)>>('cJSON_SetNumberHelper'); + late final _cJSON_SetNumberHelper = _cJSON_SetNumberHelper_ptr + .asFunction, double)>(); ffi.Pointer cJSON_malloc( int size, @@ -1111,9 +1192,10 @@ class CJson { } late final _cJSON_malloc_ptr = - _lookup>('cJSON_malloc'); - late final _dart_cJSON_malloc _cJSON_malloc = - _cJSON_malloc_ptr.asFunction<_dart_cJSON_malloc>(); + _lookup Function(ffi.IntPtr)>>( + 'cJSON_malloc'); + late final _cJSON_malloc = + _cJSON_malloc_ptr.asFunction Function(int)>(); void cJSON_free( ffi.Pointer object, @@ -1124,9 +1206,10 @@ class CJson { } late final _cJSON_free_ptr = - _lookup>('cJSON_free'); - late final _dart_cJSON_free _cJSON_free = - _cJSON_free_ptr.asFunction<_dart_cJSON_free>(); + _lookup)>>( + 'cJSON_free'); + late final _cJSON_free = + _cJSON_free_ptr.asFunction)>(); } class cJSON extends ffi.Struct { @@ -1151,11 +1234,16 @@ class cJSON extends ffi.Struct { } class cJSON_Hooks extends ffi.Struct { - external ffi.Pointer> malloc_fn; + external ffi.Pointer< + ffi.NativeFunction Function(ffi.IntPtr)>> malloc_fn; - external ffi.Pointer> free_fn; + external ffi + .Pointer)>> + free_fn; } +typedef cJSON_bool = ffi.Int32; + const int CJSON_VERSION_MAJOR = 1; const int CJSON_VERSION_MINOR = 7; @@ -1187,691 +1275,3 @@ const int cJSON_StringIsConst = 512; const int CJSON_NESTING_LIMIT = 1000; const double CJSON_DOUBLE_PRECISION = 1e-16; - -typedef _c_cJSON_Version = ffi.Pointer Function(); - -typedef _dart_cJSON_Version = ffi.Pointer Function(); - -typedef _c_cJSON_InitHooks = ffi.Void Function( - ffi.Pointer hooks, -); - -typedef _dart_cJSON_InitHooks = void Function( - ffi.Pointer hooks, -); - -typedef _c_cJSON_Parse = ffi.Pointer Function( - ffi.Pointer value, -); - -typedef _dart_cJSON_Parse = ffi.Pointer Function( - ffi.Pointer value, -); - -typedef _c_cJSON_ParseWithOpts = ffi.Pointer Function( - ffi.Pointer value, - ffi.Pointer> return_parse_end, - ffi.Int32 require_null_terminated, -); - -typedef _dart_cJSON_ParseWithOpts = ffi.Pointer Function( - ffi.Pointer value, - ffi.Pointer> return_parse_end, - int require_null_terminated, -); - -typedef _c_cJSON_Print = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_Print = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _c_cJSON_PrintUnformatted = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_PrintUnformatted = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _c_cJSON_PrintBuffered = ffi.Pointer Function( - ffi.Pointer item, - ffi.Int32 prebuffer, - ffi.Int32 fmt, -); - -typedef _dart_cJSON_PrintBuffered = ffi.Pointer Function( - ffi.Pointer item, - int prebuffer, - int fmt, -); - -typedef _c_cJSON_PrintPreallocated = ffi.Int32 Function( - ffi.Pointer item, - ffi.Pointer buffer, - ffi.Int32 length, - ffi.Int32 format, -); - -typedef _dart_cJSON_PrintPreallocated = int Function( - ffi.Pointer item, - ffi.Pointer buffer, - int length, - int format, -); - -typedef _c_cJSON_Delete = ffi.Void Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_Delete = void Function( - ffi.Pointer item, -); - -typedef _c_cJSON_GetArraySize = ffi.Int32 Function( - ffi.Pointer array, -); - -typedef _dart_cJSON_GetArraySize = int Function( - ffi.Pointer array, -); - -typedef _c_cJSON_GetArrayItem = ffi.Pointer Function( - ffi.Pointer array, - ffi.Int32 index, -); - -typedef _dart_cJSON_GetArrayItem = ffi.Pointer Function( - ffi.Pointer array, - int index, -); - -typedef _c_cJSON_GetObjectItem = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_GetObjectItem = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_GetObjectItemCaseSensitive = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_GetObjectItemCaseSensitive = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_HasObjectItem = ffi.Int32 Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_HasObjectItem = int Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_GetErrorPtr = ffi.Pointer Function(); - -typedef _dart_cJSON_GetErrorPtr = ffi.Pointer Function(); - -typedef _c_cJSON_GetStringValue = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_GetStringValue = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsInvalid = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsInvalid = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsFalse = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsFalse = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsTrue = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsTrue = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsBool = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsBool = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsNull = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsNull = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsNumber = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsNumber = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsString = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsString = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsArray = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsArray = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsObject = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsObject = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsRaw = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsRaw = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_CreateNull = ffi.Pointer Function(); - -typedef _dart_cJSON_CreateNull = ffi.Pointer Function(); - -typedef _c_cJSON_CreateTrue = ffi.Pointer Function(); - -typedef _dart_cJSON_CreateTrue = ffi.Pointer Function(); - -typedef _c_cJSON_CreateFalse = ffi.Pointer Function(); - -typedef _dart_cJSON_CreateFalse = ffi.Pointer Function(); - -typedef _c_cJSON_CreateBool = ffi.Pointer Function( - ffi.Int32 boolean, -); - -typedef _dart_cJSON_CreateBool = ffi.Pointer Function( - int boolean, -); - -typedef _c_cJSON_CreateNumber = ffi.Pointer Function( - ffi.Double num, -); - -typedef _dart_cJSON_CreateNumber = ffi.Pointer Function( - double num, -); - -typedef _c_cJSON_CreateString = ffi.Pointer Function( - ffi.Pointer string, -); - -typedef _dart_cJSON_CreateString = ffi.Pointer Function( - ffi.Pointer string, -); - -typedef _c_cJSON_CreateRaw = ffi.Pointer Function( - ffi.Pointer raw, -); - -typedef _dart_cJSON_CreateRaw = ffi.Pointer Function( - ffi.Pointer raw, -); - -typedef _c_cJSON_CreateArray = ffi.Pointer Function(); - -typedef _dart_cJSON_CreateArray = ffi.Pointer Function(); - -typedef _c_cJSON_CreateObject = ffi.Pointer Function(); - -typedef _dart_cJSON_CreateObject = ffi.Pointer Function(); - -typedef _c_cJSON_CreateStringReference = ffi.Pointer Function( - ffi.Pointer string, -); - -typedef _dart_cJSON_CreateStringReference = ffi.Pointer Function( - ffi.Pointer string, -); - -typedef _c_cJSON_CreateObjectReference = ffi.Pointer Function( - ffi.Pointer child, -); - -typedef _dart_cJSON_CreateObjectReference = ffi.Pointer Function( - ffi.Pointer child, -); - -typedef _c_cJSON_CreateArrayReference = ffi.Pointer Function( - ffi.Pointer child, -); - -typedef _dart_cJSON_CreateArrayReference = ffi.Pointer Function( - ffi.Pointer child, -); - -typedef _c_cJSON_CreateIntArray = ffi.Pointer Function( - ffi.Pointer numbers, - ffi.Int32 count, -); - -typedef _dart_cJSON_CreateIntArray = ffi.Pointer Function( - ffi.Pointer numbers, - int count, -); - -typedef _c_cJSON_CreateFloatArray = ffi.Pointer Function( - ffi.Pointer numbers, - ffi.Int32 count, -); - -typedef _dart_cJSON_CreateFloatArray = ffi.Pointer Function( - ffi.Pointer numbers, - int count, -); - -typedef _c_cJSON_CreateDoubleArray = ffi.Pointer Function( - ffi.Pointer numbers, - ffi.Int32 count, -); - -typedef _dart_cJSON_CreateDoubleArray = ffi.Pointer Function( - ffi.Pointer numbers, - int count, -); - -typedef _c_cJSON_CreateStringArray = ffi.Pointer Function( - ffi.Pointer> strings, - ffi.Int32 count, -); - -typedef _dart_cJSON_CreateStringArray = ffi.Pointer Function( - ffi.Pointer> strings, - int count, -); - -typedef _c_cJSON_AddItemToArray = ffi.Void Function( - ffi.Pointer array, - ffi.Pointer item, -); - -typedef _dart_cJSON_AddItemToArray = void Function( - ffi.Pointer array, - ffi.Pointer item, -); - -typedef _c_cJSON_AddItemToObject = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _dart_cJSON_AddItemToObject = void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _c_cJSON_AddItemToObjectCS = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _dart_cJSON_AddItemToObjectCS = void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _c_cJSON_AddItemReferenceToArray = ffi.Void Function( - ffi.Pointer array, - ffi.Pointer item, -); - -typedef _dart_cJSON_AddItemReferenceToArray = void Function( - ffi.Pointer array, - ffi.Pointer item, -); - -typedef _c_cJSON_AddItemReferenceToObject = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _dart_cJSON_AddItemReferenceToObject = void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _c_cJSON_DetachItemViaPointer = ffi.Pointer Function( - ffi.Pointer parent, - ffi.Pointer item, -); - -typedef _dart_cJSON_DetachItemViaPointer = ffi.Pointer Function( - ffi.Pointer parent, - ffi.Pointer item, -); - -typedef _c_cJSON_DetachItemFromArray = ffi.Pointer Function( - ffi.Pointer array, - ffi.Int32 which, -); - -typedef _dart_cJSON_DetachItemFromArray = ffi.Pointer Function( - ffi.Pointer array, - int which, -); - -typedef _c_cJSON_DeleteItemFromArray = ffi.Void Function( - ffi.Pointer array, - ffi.Int32 which, -); - -typedef _dart_cJSON_DeleteItemFromArray = void Function( - ffi.Pointer array, - int which, -); - -typedef _c_cJSON_DetachItemFromObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_DetachItemFromObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_DetachItemFromObjectCaseSensitive = ffi.Pointer - Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_DetachItemFromObjectCaseSensitive = ffi.Pointer - Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_DeleteItemFromObject = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_DeleteItemFromObject = void Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_DeleteItemFromObjectCaseSensitive = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_DeleteItemFromObjectCaseSensitive = void Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_InsertItemInArray = ffi.Void Function( - ffi.Pointer array, - ffi.Int32 which, - ffi.Pointer newitem, -); - -typedef _dart_cJSON_InsertItemInArray = void Function( - ffi.Pointer array, - int which, - ffi.Pointer newitem, -); - -typedef _c_cJSON_ReplaceItemViaPointer = ffi.Int32 Function( - ffi.Pointer parent, - ffi.Pointer item, - ffi.Pointer replacement, -); - -typedef _dart_cJSON_ReplaceItemViaPointer = int Function( - ffi.Pointer parent, - ffi.Pointer item, - ffi.Pointer replacement, -); - -typedef _c_cJSON_ReplaceItemInArray = ffi.Void Function( - ffi.Pointer array, - ffi.Int32 which, - ffi.Pointer newitem, -); - -typedef _dart_cJSON_ReplaceItemInArray = void Function( - ffi.Pointer array, - int which, - ffi.Pointer newitem, -); - -typedef _c_cJSON_ReplaceItemInObject = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer newitem, -); - -typedef _dart_cJSON_ReplaceItemInObject = void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer newitem, -); - -typedef _c_cJSON_ReplaceItemInObjectCaseSensitive = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer newitem, -); - -typedef _dart_cJSON_ReplaceItemInObjectCaseSensitive = void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer newitem, -); - -typedef _c_cJSON_Duplicate = ffi.Pointer Function( - ffi.Pointer item, - ffi.Int32 recurse, -); - -typedef _dart_cJSON_Duplicate = ffi.Pointer Function( - ffi.Pointer item, - int recurse, -); - -typedef _c_cJSON_Compare = ffi.Int32 Function( - ffi.Pointer a, - ffi.Pointer b, - ffi.Int32 case_sensitive, -); - -typedef _dart_cJSON_Compare = int Function( - ffi.Pointer a, - ffi.Pointer b, - int case_sensitive, -); - -typedef _c_cJSON_Minify = ffi.Void Function( - ffi.Pointer json, -); - -typedef _dart_cJSON_Minify = void Function( - ffi.Pointer json, -); - -typedef _c_cJSON_AddNullToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _dart_cJSON_AddNullToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _c_cJSON_AddTrueToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _dart_cJSON_AddTrueToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _c_cJSON_AddFalseToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _dart_cJSON_AddFalseToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _c_cJSON_AddBoolToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Int32 boolean, -); - -typedef _dart_cJSON_AddBoolToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - int boolean, -); - -typedef _c_cJSON_AddNumberToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Double number, -); - -typedef _dart_cJSON_AddNumberToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - double number, -); - -typedef _c_cJSON_AddStringToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer string, -); - -typedef _dart_cJSON_AddStringToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer string, -); - -typedef _c_cJSON_AddRawToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer raw, -); - -typedef _dart_cJSON_AddRawToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer raw, -); - -typedef _c_cJSON_AddObjectToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _dart_cJSON_AddObjectToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _c_cJSON_AddArrayToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _dart_cJSON_AddArrayToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _c_cJSON_SetNumberHelper = ffi.Double Function( - ffi.Pointer object, - ffi.Double number, -); - -typedef _dart_cJSON_SetNumberHelper = double Function( - ffi.Pointer object, - double number, -); - -typedef _c_cJSON_malloc = ffi.Pointer Function( - ffi.Uint64 size, -); - -typedef _dart_cJSON_malloc = ffi.Pointer Function( - int size, -); - -typedef _c_cJSON_free = ffi.Void Function( - ffi.Pointer object, -); - -typedef _dart_cJSON_free = void Function( - ffi.Pointer object, -); - -typedef _typedefC_1 = ffi.Pointer Function( - ffi.Uint64, -); - -typedef _typedefC_2 = ffi.Void Function( - ffi.Pointer, -); diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index be68fb586c..caf2392c19 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -28,9 +28,10 @@ class LibClang { } late final _clang_getCString_ptr = - _lookup>('clang_getCString'); - late final _dart_clang_getCString _clang_getCString = - _clang_getCString_ptr.asFunction<_dart_clang_getCString>(); + _lookup Function(CXString)>>( + 'clang_getCString'); + late final _clang_getCString = _clang_getCString_ptr + .asFunction Function(CXString)>(); /// Free the given string. void clang_disposeString( @@ -42,10 +43,10 @@ class LibClang { } late final _clang_disposeString_ptr = - _lookup>( + _lookup>( 'clang_disposeString'); - late final _dart_clang_disposeString _clang_disposeString = - _clang_disposeString_ptr.asFunction<_dart_clang_disposeString>(); + late final _clang_disposeString = + _clang_disposeString_ptr.asFunction(); /// Free the given string set. void clang_disposeStringSet( @@ -57,10 +58,10 @@ class LibClang { } late final _clang_disposeStringSet_ptr = - _lookup>( + _lookup)>>( 'clang_disposeStringSet'); - late final _dart_clang_disposeStringSet _clang_disposeStringSet = - _clang_disposeStringSet_ptr.asFunction<_dart_clang_disposeStringSet>(); + late final _clang_disposeStringSet = _clang_disposeStringSet_ptr + .asFunction)>(); /// Return the timestamp for use with Clang's -fbuild-session-timestamp= /// option. @@ -69,15 +70,14 @@ class LibClang { } late final _clang_getBuildSessionTimestamp_ptr = - _lookup>( + _lookup>( 'clang_getBuildSessionTimestamp'); - late final _dart_clang_getBuildSessionTimestamp - _clang_getBuildSessionTimestamp = _clang_getBuildSessionTimestamp_ptr - .asFunction<_dart_clang_getBuildSessionTimestamp>(); + late final _clang_getBuildSessionTimestamp = + _clang_getBuildSessionTimestamp_ptr.asFunction(); /// Create a CXVirtualFileOverlay object. Must be disposed with /// clang_VirtualFileOverlay_dispose(). - ffi.Pointer clang_VirtualFileOverlay_create( + CXVirtualFileOverlay clang_VirtualFileOverlay_create( int options, ) { return _clang_VirtualFileOverlay_create( @@ -86,16 +86,16 @@ class LibClang { } late final _clang_VirtualFileOverlay_create_ptr = - _lookup>( + _lookup>( 'clang_VirtualFileOverlay_create'); - late final _dart_clang_VirtualFileOverlay_create - _clang_VirtualFileOverlay_create = _clang_VirtualFileOverlay_create_ptr - .asFunction<_dart_clang_VirtualFileOverlay_create>(); + late final _clang_VirtualFileOverlay_create = + _clang_VirtualFileOverlay_create_ptr + .asFunction(); /// Map an absolute virtual file path to an absolute real one. The virtual /// path must be canonicalized (not contain "."/".."). int clang_VirtualFileOverlay_addFileMapping( - ffi.Pointer arg0, + CXVirtualFileOverlay arg0, ffi.Pointer virtualPath, ffi.Pointer realPath, ) { @@ -106,19 +106,21 @@ class LibClang { ); } - late final _clang_VirtualFileOverlay_addFileMapping_ptr = - _lookup>( - 'clang_VirtualFileOverlay_addFileMapping'); - late final _dart_clang_VirtualFileOverlay_addFileMapping - _clang_VirtualFileOverlay_addFileMapping = - _clang_VirtualFileOverlay_addFileMapping_ptr - .asFunction<_dart_clang_VirtualFileOverlay_addFileMapping>(); + late final _clang_VirtualFileOverlay_addFileMapping_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(CXVirtualFileOverlay, ffi.Pointer, + ffi.Pointer)>>( + 'clang_VirtualFileOverlay_addFileMapping'); + late final _clang_VirtualFileOverlay_addFileMapping = + _clang_VirtualFileOverlay_addFileMapping_ptr.asFunction< + int Function(CXVirtualFileOverlay, ffi.Pointer, + ffi.Pointer)>(); /// Set the case sensitivity for the CXVirtualFileOverlay object. The /// CXVirtualFileOverlay object is case-sensitive by default, this option can /// be used to override the default. int clang_VirtualFileOverlay_setCaseSensitivity( - ffi.Pointer arg0, + CXVirtualFileOverlay arg0, int caseSensitive, ) { return _clang_VirtualFileOverlay_setCaseSensitivity( @@ -128,16 +130,16 @@ class LibClang { } late final _clang_VirtualFileOverlay_setCaseSensitivity_ptr = _lookup< - ffi.NativeFunction<_c_clang_VirtualFileOverlay_setCaseSensitivity>>( - 'clang_VirtualFileOverlay_setCaseSensitivity'); - late final _dart_clang_VirtualFileOverlay_setCaseSensitivity - _clang_VirtualFileOverlay_setCaseSensitivity = + ffi.NativeFunction< + ffi.Int32 Function(CXVirtualFileOverlay, + ffi.Int32)>>('clang_VirtualFileOverlay_setCaseSensitivity'); + late final _clang_VirtualFileOverlay_setCaseSensitivity = _clang_VirtualFileOverlay_setCaseSensitivity_ptr - .asFunction<_dart_clang_VirtualFileOverlay_setCaseSensitivity>(); + .asFunction(); /// Write out the CXVirtualFileOverlay object to a char buffer. int clang_VirtualFileOverlay_writeToBuffer( - ffi.Pointer arg0, + CXVirtualFileOverlay arg0, int options, ffi.Pointer> out_buffer_ptr, ffi.Pointer out_buffer_size, @@ -150,13 +152,18 @@ class LibClang { ); } - late final _clang_VirtualFileOverlay_writeToBuffer_ptr = - _lookup>( - 'clang_VirtualFileOverlay_writeToBuffer'); - late final _dart_clang_VirtualFileOverlay_writeToBuffer - _clang_VirtualFileOverlay_writeToBuffer = - _clang_VirtualFileOverlay_writeToBuffer_ptr - .asFunction<_dart_clang_VirtualFileOverlay_writeToBuffer>(); + late final _clang_VirtualFileOverlay_writeToBuffer_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXVirtualFileOverlay, + ffi.Uint32, + ffi.Pointer>, + ffi.Pointer)>>( + 'clang_VirtualFileOverlay_writeToBuffer'); + late final _clang_VirtualFileOverlay_writeToBuffer = + _clang_VirtualFileOverlay_writeToBuffer_ptr.asFunction< + int Function(CXVirtualFileOverlay, int, + ffi.Pointer>, ffi.Pointer)>(); /// free memory allocated by libclang, such as the buffer returned by /// CXVirtualFileOverlay() or clang_ModuleMapDescriptor_writeToBuffer(). @@ -169,13 +176,14 @@ class LibClang { } late final _clang_free_ptr = - _lookup>('clang_free'); - late final _dart_clang_free _clang_free = - _clang_free_ptr.asFunction<_dart_clang_free>(); + _lookup)>>( + 'clang_free'); + late final _clang_free = + _clang_free_ptr.asFunction)>(); /// Dispose a CXVirtualFileOverlay object. void clang_VirtualFileOverlay_dispose( - ffi.Pointer arg0, + CXVirtualFileOverlay arg0, ) { return _clang_VirtualFileOverlay_dispose( arg0, @@ -183,15 +191,15 @@ class LibClang { } late final _clang_VirtualFileOverlay_dispose_ptr = - _lookup>( + _lookup>( 'clang_VirtualFileOverlay_dispose'); - late final _dart_clang_VirtualFileOverlay_dispose - _clang_VirtualFileOverlay_dispose = _clang_VirtualFileOverlay_dispose_ptr - .asFunction<_dart_clang_VirtualFileOverlay_dispose>(); + late final _clang_VirtualFileOverlay_dispose = + _clang_VirtualFileOverlay_dispose_ptr + .asFunction(); /// Create a CXModuleMapDescriptor object. Must be disposed with /// clang_ModuleMapDescriptor_dispose(). - ffi.Pointer clang_ModuleMapDescriptor_create( + CXModuleMapDescriptor clang_ModuleMapDescriptor_create( int options, ) { return _clang_ModuleMapDescriptor_create( @@ -200,15 +208,15 @@ class LibClang { } late final _clang_ModuleMapDescriptor_create_ptr = - _lookup>( + _lookup>( 'clang_ModuleMapDescriptor_create'); - late final _dart_clang_ModuleMapDescriptor_create - _clang_ModuleMapDescriptor_create = _clang_ModuleMapDescriptor_create_ptr - .asFunction<_dart_clang_ModuleMapDescriptor_create>(); + late final _clang_ModuleMapDescriptor_create = + _clang_ModuleMapDescriptor_create_ptr + .asFunction(); /// Sets the framework module name that the module.map describes. int clang_ModuleMapDescriptor_setFrameworkModuleName( - ffi.Pointer arg0, + CXModuleMapDescriptor arg0, ffi.Pointer name, ) { return _clang_ModuleMapDescriptor_setFrameworkModuleName( @@ -219,16 +227,16 @@ class LibClang { late final _clang_ModuleMapDescriptor_setFrameworkModuleName_ptr = _lookup< ffi.NativeFunction< - _c_clang_ModuleMapDescriptor_setFrameworkModuleName>>( + ffi.Int32 Function( + CXModuleMapDescriptor, ffi.Pointer)>>( 'clang_ModuleMapDescriptor_setFrameworkModuleName'); - late final _dart_clang_ModuleMapDescriptor_setFrameworkModuleName - _clang_ModuleMapDescriptor_setFrameworkModuleName = - _clang_ModuleMapDescriptor_setFrameworkModuleName_ptr - .asFunction<_dart_clang_ModuleMapDescriptor_setFrameworkModuleName>(); + late final _clang_ModuleMapDescriptor_setFrameworkModuleName = + _clang_ModuleMapDescriptor_setFrameworkModuleName_ptr.asFunction< + int Function(CXModuleMapDescriptor, ffi.Pointer)>(); /// Sets the umbrealla header name that the module.map describes. int clang_ModuleMapDescriptor_setUmbrellaHeader( - ffi.Pointer arg0, + CXModuleMapDescriptor arg0, ffi.Pointer name, ) { return _clang_ModuleMapDescriptor_setUmbrellaHeader( @@ -238,16 +246,17 @@ class LibClang { } late final _clang_ModuleMapDescriptor_setUmbrellaHeader_ptr = _lookup< - ffi.NativeFunction<_c_clang_ModuleMapDescriptor_setUmbrellaHeader>>( + ffi.NativeFunction< + ffi.Int32 Function( + CXModuleMapDescriptor, ffi.Pointer)>>( 'clang_ModuleMapDescriptor_setUmbrellaHeader'); - late final _dart_clang_ModuleMapDescriptor_setUmbrellaHeader - _clang_ModuleMapDescriptor_setUmbrellaHeader = - _clang_ModuleMapDescriptor_setUmbrellaHeader_ptr - .asFunction<_dart_clang_ModuleMapDescriptor_setUmbrellaHeader>(); + late final _clang_ModuleMapDescriptor_setUmbrellaHeader = + _clang_ModuleMapDescriptor_setUmbrellaHeader_ptr.asFunction< + int Function(CXModuleMapDescriptor, ffi.Pointer)>(); /// Write out the CXModuleMapDescriptor object to a char buffer. int clang_ModuleMapDescriptor_writeToBuffer( - ffi.Pointer arg0, + CXModuleMapDescriptor arg0, int options, ffi.Pointer> out_buffer_ptr, ffi.Pointer out_buffer_size, @@ -260,17 +269,22 @@ class LibClang { ); } - late final _clang_ModuleMapDescriptor_writeToBuffer_ptr = - _lookup>( - 'clang_ModuleMapDescriptor_writeToBuffer'); - late final _dart_clang_ModuleMapDescriptor_writeToBuffer - _clang_ModuleMapDescriptor_writeToBuffer = - _clang_ModuleMapDescriptor_writeToBuffer_ptr - .asFunction<_dart_clang_ModuleMapDescriptor_writeToBuffer>(); + late final _clang_ModuleMapDescriptor_writeToBuffer_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXModuleMapDescriptor, + ffi.Uint32, + ffi.Pointer>, + ffi.Pointer)>>( + 'clang_ModuleMapDescriptor_writeToBuffer'); + late final _clang_ModuleMapDescriptor_writeToBuffer = + _clang_ModuleMapDescriptor_writeToBuffer_ptr.asFunction< + int Function(CXModuleMapDescriptor, int, + ffi.Pointer>, ffi.Pointer)>(); /// Dispose a CXModuleMapDescriptor object. void clang_ModuleMapDescriptor_dispose( - ffi.Pointer arg0, + CXModuleMapDescriptor arg0, ) { return _clang_ModuleMapDescriptor_dispose( arg0, @@ -278,15 +292,14 @@ class LibClang { } late final _clang_ModuleMapDescriptor_dispose_ptr = - _lookup>( + _lookup>( 'clang_ModuleMapDescriptor_dispose'); - late final _dart_clang_ModuleMapDescriptor_dispose - _clang_ModuleMapDescriptor_dispose = + late final _clang_ModuleMapDescriptor_dispose = _clang_ModuleMapDescriptor_dispose_ptr - .asFunction<_dart_clang_ModuleMapDescriptor_dispose>(); + .asFunction(); /// Provides a shared context for creating translation units. - ffi.Pointer clang_createIndex( + CXIndex clang_createIndex( int excludeDeclarationsFromPCH, int displayDiagnostics, ) { @@ -297,13 +310,14 @@ class LibClang { } late final _clang_createIndex_ptr = - _lookup>('clang_createIndex'); - late final _dart_clang_createIndex _clang_createIndex = - _clang_createIndex_ptr.asFunction<_dart_clang_createIndex>(); + _lookup>( + 'clang_createIndex'); + late final _clang_createIndex = + _clang_createIndex_ptr.asFunction(); /// Destroy the given index. void clang_disposeIndex( - ffi.Pointer index, + CXIndex index, ) { return _clang_disposeIndex( index, @@ -311,13 +325,14 @@ class LibClang { } late final _clang_disposeIndex_ptr = - _lookup>('clang_disposeIndex'); - late final _dart_clang_disposeIndex _clang_disposeIndex = - _clang_disposeIndex_ptr.asFunction<_dart_clang_disposeIndex>(); + _lookup>( + 'clang_disposeIndex'); + late final _clang_disposeIndex = + _clang_disposeIndex_ptr.asFunction(); /// Sets general options associated with a CXIndex. void clang_CXIndex_setGlobalOptions( - ffi.Pointer arg0, + CXIndex arg0, int options, ) { return _clang_CXIndex_setGlobalOptions( @@ -327,15 +342,15 @@ class LibClang { } late final _clang_CXIndex_setGlobalOptions_ptr = - _lookup>( + _lookup>( 'clang_CXIndex_setGlobalOptions'); - late final _dart_clang_CXIndex_setGlobalOptions - _clang_CXIndex_setGlobalOptions = _clang_CXIndex_setGlobalOptions_ptr - .asFunction<_dart_clang_CXIndex_setGlobalOptions>(); + late final _clang_CXIndex_setGlobalOptions = + _clang_CXIndex_setGlobalOptions_ptr + .asFunction(); /// Gets the general options associated with a CXIndex. int clang_CXIndex_getGlobalOptions( - ffi.Pointer arg0, + CXIndex arg0, ) { return _clang_CXIndex_getGlobalOptions( arg0, @@ -343,15 +358,14 @@ class LibClang { } late final _clang_CXIndex_getGlobalOptions_ptr = - _lookup>( + _lookup>( 'clang_CXIndex_getGlobalOptions'); - late final _dart_clang_CXIndex_getGlobalOptions - _clang_CXIndex_getGlobalOptions = _clang_CXIndex_getGlobalOptions_ptr - .asFunction<_dart_clang_CXIndex_getGlobalOptions>(); + late final _clang_CXIndex_getGlobalOptions = + _clang_CXIndex_getGlobalOptions_ptr.asFunction(); /// Sets the invocation emission path option in a CXIndex. void clang_CXIndex_setInvocationEmissionPathOption( - ffi.Pointer arg0, + CXIndex arg0, ffi.Pointer Path, ) { return _clang_CXIndex_setInvocationEmissionPathOption( @@ -361,16 +375,16 @@ class LibClang { } late final _clang_CXIndex_setInvocationEmissionPathOption_ptr = _lookup< - ffi.NativeFunction<_c_clang_CXIndex_setInvocationEmissionPathOption>>( + ffi.NativeFunction< + ffi.Void Function(CXIndex, ffi.Pointer)>>( 'clang_CXIndex_setInvocationEmissionPathOption'); - late final _dart_clang_CXIndex_setInvocationEmissionPathOption - _clang_CXIndex_setInvocationEmissionPathOption = + late final _clang_CXIndex_setInvocationEmissionPathOption = _clang_CXIndex_setInvocationEmissionPathOption_ptr - .asFunction<_dart_clang_CXIndex_setInvocationEmissionPathOption>(); + .asFunction)>(); /// Retrieve the complete file and path name of the given file. CXString clang_getFileName( - ffi.Pointer SFile, + CXFile SFile, ) { return _clang_getFileName( SFile, @@ -378,13 +392,14 @@ class LibClang { } late final _clang_getFileName_ptr = - _lookup>('clang_getFileName'); - late final _dart_clang_getFileName _clang_getFileName = - _clang_getFileName_ptr.asFunction<_dart_clang_getFileName>(); + _lookup>( + 'clang_getFileName'); + late final _clang_getFileName = + _clang_getFileName_ptr.asFunction(); /// Retrieve the last modification time of the given file. int clang_getFileTime( - ffi.Pointer SFile, + CXFile SFile, ) { return _clang_getFileTime( SFile, @@ -392,13 +407,14 @@ class LibClang { } late final _clang_getFileTime_ptr = - _lookup>('clang_getFileTime'); - late final _dart_clang_getFileTime _clang_getFileTime = - _clang_getFileTime_ptr.asFunction<_dart_clang_getFileTime>(); + _lookup>( + 'clang_getFileTime'); + late final _clang_getFileTime = + _clang_getFileTime_ptr.asFunction(); /// Retrieve the unique ID for the given file. int clang_getFileUniqueID( - ffi.Pointer file, + CXFile file, ffi.Pointer outID, ) { return _clang_getFileUniqueID( @@ -407,18 +423,19 @@ class LibClang { ); } - late final _clang_getFileUniqueID_ptr = - _lookup>( - 'clang_getFileUniqueID'); - late final _dart_clang_getFileUniqueID _clang_getFileUniqueID = - _clang_getFileUniqueID_ptr.asFunction<_dart_clang_getFileUniqueID>(); + late final _clang_getFileUniqueID_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXFile, ffi.Pointer)>>('clang_getFileUniqueID'); + late final _clang_getFileUniqueID = _clang_getFileUniqueID_ptr + .asFunction)>(); /// Determine whether the given header is guarded against multiple inclusions, /// either with the conventional #ifndef/#define/#endif macro guards or with /// #pragma once. int clang_isFileMultipleIncludeGuarded( - ffi.Pointer tu, - ffi.Pointer file, + CXTranslationUnit tu, + CXFile file, ) { return _clang_isFileMultipleIncludeGuarded( tu, @@ -426,17 +443,16 @@ class LibClang { ); } - late final _clang_isFileMultipleIncludeGuarded_ptr = - _lookup>( - 'clang_isFileMultipleIncludeGuarded'); - late final _dart_clang_isFileMultipleIncludeGuarded - _clang_isFileMultipleIncludeGuarded = + late final _clang_isFileMultipleIncludeGuarded_ptr = _lookup< + ffi.NativeFunction>( + 'clang_isFileMultipleIncludeGuarded'); + late final _clang_isFileMultipleIncludeGuarded = _clang_isFileMultipleIncludeGuarded_ptr - .asFunction<_dart_clang_isFileMultipleIncludeGuarded>(); + .asFunction(); /// Retrieve a file handle within the given translation unit. - ffi.Pointer clang_getFile( - ffi.Pointer tu, + CXFile clang_getFile( + CXTranslationUnit tu, ffi.Pointer file_name, ) { return _clang_getFile( @@ -445,16 +461,18 @@ class LibClang { ); } - late final _clang_getFile_ptr = - _lookup>('clang_getFile'); - late final _dart_clang_getFile _clang_getFile = - _clang_getFile_ptr.asFunction<_dart_clang_getFile>(); + late final _clang_getFile_ptr = _lookup< + ffi.NativeFunction< + CXFile Function( + CXTranslationUnit, ffi.Pointer)>>('clang_getFile'); + late final _clang_getFile = _clang_getFile_ptr + .asFunction)>(); /// Retrieve the buffer associated with the given file. ffi.Pointer clang_getFileContents( - ffi.Pointer tu, - ffi.Pointer file, - ffi.Pointer size, + CXTranslationUnit tu, + CXFile file, + ffi.Pointer size, ) { return _clang_getFileContents( tu, @@ -463,17 +481,19 @@ class LibClang { ); } - late final _clang_getFileContents_ptr = - _lookup>( - 'clang_getFileContents'); - late final _dart_clang_getFileContents _clang_getFileContents = - _clang_getFileContents_ptr.asFunction<_dart_clang_getFileContents>(); + late final _clang_getFileContents_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(CXTranslationUnit, CXFile, + ffi.Pointer)>>('clang_getFileContents'); + late final _clang_getFileContents = _clang_getFileContents_ptr.asFunction< + ffi.Pointer Function( + CXTranslationUnit, CXFile, ffi.Pointer)>(); /// Returns non-zero if the file1 and file2 point to the same file, or they /// are both NULL. int clang_File_isEqual( - ffi.Pointer file1, - ffi.Pointer file2, + CXFile file1, + CXFile file2, ) { return _clang_File_isEqual( file1, @@ -482,13 +502,14 @@ class LibClang { } late final _clang_File_isEqual_ptr = - _lookup>('clang_File_isEqual'); - late final _dart_clang_File_isEqual _clang_File_isEqual = - _clang_File_isEqual_ptr.asFunction<_dart_clang_File_isEqual>(); + _lookup>( + 'clang_File_isEqual'); + late final _clang_File_isEqual = + _clang_File_isEqual_ptr.asFunction(); /// Returns the real path name of file. CXString clang_File_tryGetRealPathName( - ffi.Pointer file, + CXFile file, ) { return _clang_File_tryGetRealPathName( file, @@ -496,11 +517,10 @@ class LibClang { } late final _clang_File_tryGetRealPathName_ptr = - _lookup>( + _lookup>( 'clang_File_tryGetRealPathName'); - late final _dart_clang_File_tryGetRealPathName - _clang_File_tryGetRealPathName = _clang_File_tryGetRealPathName_ptr - .asFunction<_dart_clang_File_tryGetRealPathName>(); + late final _clang_File_tryGetRealPathName = _clang_File_tryGetRealPathName_ptr + .asFunction(); /// Retrieve a NULL (invalid) source location. CXSourceLocation clang_getNullLocation() { @@ -508,10 +528,10 @@ class LibClang { } late final _clang_getNullLocation_ptr = - _lookup>( + _lookup>( 'clang_getNullLocation'); - late final _dart_clang_getNullLocation _clang_getNullLocation = - _clang_getNullLocation_ptr.asFunction<_dart_clang_getNullLocation>(); + late final _clang_getNullLocation = + _clang_getNullLocation_ptr.asFunction(); /// Determine whether two source locations, which must refer into the same /// translation unit, refer to exactly the same point in the source code. @@ -525,17 +545,18 @@ class LibClang { ); } - late final _clang_equalLocations_ptr = - _lookup>( - 'clang_equalLocations'); - late final _dart_clang_equalLocations _clang_equalLocations = - _clang_equalLocations_ptr.asFunction<_dart_clang_equalLocations>(); + late final _clang_equalLocations_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint32 Function( + CXSourceLocation, CXSourceLocation)>>('clang_equalLocations'); + late final _clang_equalLocations = _clang_equalLocations_ptr + .asFunction(); /// 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, + CXTranslationUnit tu, + CXFile file, int line, int column, ) { @@ -547,16 +568,18 @@ class LibClang { ); } - late final _clang_getLocation_ptr = - _lookup>('clang_getLocation'); - late final _dart_clang_getLocation _clang_getLocation = - _clang_getLocation_ptr.asFunction<_dart_clang_getLocation>(); + late final _clang_getLocation_ptr = _lookup< + ffi.NativeFunction< + CXSourceLocation Function(CXTranslationUnit, CXFile, ffi.Uint32, + ffi.Uint32)>>('clang_getLocation'); + late final _clang_getLocation = _clang_getLocation_ptr.asFunction< + CXSourceLocation Function(CXTranslationUnit, CXFile, int, int)>(); /// Retrieves the source location associated with a given character offset in /// a particular translation unit. CXSourceLocation clang_getLocationForOffset( - ffi.Pointer tu, - ffi.Pointer file, + CXTranslationUnit tu, + CXFile file, int offset, ) { return _clang_getLocationForOffset( @@ -566,12 +589,12 @@ class LibClang { ); } - late final _clang_getLocationForOffset_ptr = - _lookup>( - 'clang_getLocationForOffset'); - late final _dart_clang_getLocationForOffset _clang_getLocationForOffset = - _clang_getLocationForOffset_ptr - .asFunction<_dart_clang_getLocationForOffset>(); + late final _clang_getLocationForOffset_ptr = _lookup< + ffi.NativeFunction< + CXSourceLocation Function(CXTranslationUnit, CXFile, + ffi.Uint32)>>('clang_getLocationForOffset'); + late final _clang_getLocationForOffset = _clang_getLocationForOffset_ptr + .asFunction(); /// Returns non-zero if the given source location is in a system header. int clang_Location_isInSystemHeader( @@ -583,11 +606,11 @@ class LibClang { } late final _clang_Location_isInSystemHeader_ptr = - _lookup>( + _lookup>( 'clang_Location_isInSystemHeader'); - late final _dart_clang_Location_isInSystemHeader - _clang_Location_isInSystemHeader = _clang_Location_isInSystemHeader_ptr - .asFunction<_dart_clang_Location_isInSystemHeader>(); + late final _clang_Location_isInSystemHeader = + _clang_Location_isInSystemHeader_ptr + .asFunction(); /// Returns non-zero if the given source location is in the main file of the /// corresponding translation unit. @@ -600,11 +623,10 @@ class LibClang { } late final _clang_Location_isFromMainFile_ptr = - _lookup>( + _lookup>( 'clang_Location_isFromMainFile'); - late final _dart_clang_Location_isFromMainFile - _clang_Location_isFromMainFile = _clang_Location_isFromMainFile_ptr - .asFunction<_dart_clang_Location_isFromMainFile>(); + late final _clang_Location_isFromMainFile = _clang_Location_isFromMainFile_ptr + .asFunction(); /// Retrieve a NULL (invalid) source range. CXSourceRange clang_getNullRange() { @@ -612,9 +634,10 @@ class LibClang { } late final _clang_getNullRange_ptr = - _lookup>('clang_getNullRange'); - late final _dart_clang_getNullRange _clang_getNullRange = - _clang_getNullRange_ptr.asFunction<_dart_clang_getNullRange>(); + _lookup>( + 'clang_getNullRange'); + late final _clang_getNullRange = + _clang_getNullRange_ptr.asFunction(); /// Retrieve a source range given the beginning and ending source locations. CXSourceRange clang_getRange( @@ -627,10 +650,12 @@ class LibClang { ); } - late final _clang_getRange_ptr = - _lookup>('clang_getRange'); - late final _dart_clang_getRange _clang_getRange = - _clang_getRange_ptr.asFunction<_dart_clang_getRange>(); + late final _clang_getRange_ptr = _lookup< + ffi.NativeFunction< + CXSourceRange Function( + CXSourceLocation, CXSourceLocation)>>('clang_getRange'); + late final _clang_getRange = _clang_getRange_ptr + .asFunction(); /// Determine whether two ranges are equivalent. int clang_equalRanges( @@ -643,10 +668,12 @@ class LibClang { ); } - late final _clang_equalRanges_ptr = - _lookup>('clang_equalRanges'); - late final _dart_clang_equalRanges _clang_equalRanges = - _clang_equalRanges_ptr.asFunction<_dart_clang_equalRanges>(); + late final _clang_equalRanges_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint32 Function( + CXSourceRange, CXSourceRange)>>('clang_equalRanges'); + late final _clang_equalRanges = _clang_equalRanges_ptr + .asFunction(); /// Returns non-zero if range is null. int clang_Range_isNull( @@ -658,15 +685,16 @@ class LibClang { } late final _clang_Range_isNull_ptr = - _lookup>('clang_Range_isNull'); - late final _dart_clang_Range_isNull _clang_Range_isNull = - _clang_Range_isNull_ptr.asFunction<_dart_clang_Range_isNull>(); + _lookup>( + 'clang_Range_isNull'); + late final _clang_Range_isNull = + _clang_Range_isNull_ptr.asFunction(); /// Retrieve the file, line, column, and offset represented by the given /// source location. void clang_getExpansionLocation( CXSourceLocation location, - ffi.Pointer> file, + ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -680,12 +708,22 @@ class LibClang { ); } - late final _clang_getExpansionLocation_ptr = - _lookup>( - 'clang_getExpansionLocation'); - late final _dart_clang_getExpansionLocation _clang_getExpansionLocation = - _clang_getExpansionLocation_ptr - .asFunction<_dart_clang_getExpansionLocation>(); + late final _clang_getExpansionLocation_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_getExpansionLocation'); + late final _clang_getExpansionLocation = + _clang_getExpansionLocation_ptr.asFunction< + void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve the file, line and column represented by the given source /// location, as specified in a # line directive. @@ -703,18 +741,23 @@ class LibClang { ); } - late final _clang_getPresumedLocation_ptr = - _lookup>( - 'clang_getPresumedLocation'); - late final _dart_clang_getPresumedLocation _clang_getPresumedLocation = - _clang_getPresumedLocation_ptr - .asFunction<_dart_clang_getPresumedLocation>(); + late final _clang_getPresumedLocation_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_getPresumedLocation'); + late final _clang_getPresumedLocation = + _clang_getPresumedLocation_ptr.asFunction< + void Function(CXSourceLocation, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// 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 file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -728,18 +771,28 @@ class LibClang { ); } - late final _clang_getInstantiationLocation_ptr = - _lookup>( - 'clang_getInstantiationLocation'); - late final _dart_clang_getInstantiationLocation - _clang_getInstantiationLocation = _clang_getInstantiationLocation_ptr - .asFunction<_dart_clang_getInstantiationLocation>(); + late final _clang_getInstantiationLocation_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_getInstantiationLocation'); + late final _clang_getInstantiationLocation = + _clang_getInstantiationLocation_ptr.asFunction< + void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve the file, line, column, and offset represented by the given /// source location. void clang_getSpellingLocation( CXSourceLocation location, - ffi.Pointer> file, + ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -753,18 +806,28 @@ class LibClang { ); } - late final _clang_getSpellingLocation_ptr = - _lookup>( - 'clang_getSpellingLocation'); - late final _dart_clang_getSpellingLocation _clang_getSpellingLocation = - _clang_getSpellingLocation_ptr - .asFunction<_dart_clang_getSpellingLocation>(); + late final _clang_getSpellingLocation_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_getSpellingLocation'); + late final _clang_getSpellingLocation = + _clang_getSpellingLocation_ptr.asFunction< + void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve the file, line, column, and offset represented by the given /// source location. void clang_getFileLocation( CXSourceLocation location, - ffi.Pointer> file, + ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -778,11 +841,21 @@ class LibClang { ); } - late final _clang_getFileLocation_ptr = - _lookup>( - 'clang_getFileLocation'); - late final _dart_clang_getFileLocation _clang_getFileLocation = - _clang_getFileLocation_ptr.asFunction<_dart_clang_getFileLocation>(); + late final _clang_getFileLocation_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_getFileLocation'); + late final _clang_getFileLocation = _clang_getFileLocation_ptr.asFunction< + void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve a source location representing the first character within a /// source range. @@ -795,10 +868,10 @@ class LibClang { } late final _clang_getRangeStart_ptr = - _lookup>( + _lookup>( 'clang_getRangeStart'); - late final _dart_clang_getRangeStart _clang_getRangeStart = - _clang_getRangeStart_ptr.asFunction<_dart_clang_getRangeStart>(); + late final _clang_getRangeStart = _clang_getRangeStart_ptr + .asFunction(); /// Retrieve a source location representing the last character within a source /// range. @@ -811,14 +884,15 @@ class LibClang { } late final _clang_getRangeEnd_ptr = - _lookup>('clang_getRangeEnd'); - late final _dart_clang_getRangeEnd _clang_getRangeEnd = - _clang_getRangeEnd_ptr.asFunction<_dart_clang_getRangeEnd>(); + _lookup>( + 'clang_getRangeEnd'); + late final _clang_getRangeEnd = _clang_getRangeEnd_ptr + .asFunction(); /// Retrieve all ranges that were skipped by the preprocessor. ffi.Pointer clang_getSkippedRanges( - ffi.Pointer tu, - ffi.Pointer file, + CXTranslationUnit tu, + CXFile file, ) { return _clang_getSkippedRanges( tu, @@ -826,27 +900,28 @@ class LibClang { ); } - late final _clang_getSkippedRanges_ptr = - _lookup>( - 'clang_getSkippedRanges'); - late final _dart_clang_getSkippedRanges _clang_getSkippedRanges = - _clang_getSkippedRanges_ptr.asFunction<_dart_clang_getSkippedRanges>(); + late final _clang_getSkippedRanges_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + CXTranslationUnit, CXFile)>>('clang_getSkippedRanges'); + late final _clang_getSkippedRanges = _clang_getSkippedRanges_ptr.asFunction< + ffi.Pointer Function(CXTranslationUnit, CXFile)>(); /// Retrieve all ranges from all files that were skipped by the preprocessor. ffi.Pointer clang_getAllSkippedRanges( - ffi.Pointer tu, + CXTranslationUnit tu, ) { return _clang_getAllSkippedRanges( tu, ); } - late final _clang_getAllSkippedRanges_ptr = - _lookup>( - 'clang_getAllSkippedRanges'); - late final _dart_clang_getAllSkippedRanges _clang_getAllSkippedRanges = - _clang_getAllSkippedRanges_ptr - .asFunction<_dart_clang_getAllSkippedRanges>(); + late final _clang_getAllSkippedRanges_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + CXTranslationUnit)>>('clang_getAllSkippedRanges'); + late final _clang_getAllSkippedRanges = _clang_getAllSkippedRanges_ptr + .asFunction Function(CXTranslationUnit)>(); /// Destroy the given CXSourceRangeList. void clang_disposeSourceRangeList( @@ -857,16 +932,16 @@ class LibClang { ); } - late final _clang_disposeSourceRangeList_ptr = - _lookup>( - 'clang_disposeSourceRangeList'); - late final _dart_clang_disposeSourceRangeList _clang_disposeSourceRangeList = - _clang_disposeSourceRangeList_ptr - .asFunction<_dart_clang_disposeSourceRangeList>(); + late final _clang_disposeSourceRangeList_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>('clang_disposeSourceRangeList'); + late final _clang_disposeSourceRangeList = _clang_disposeSourceRangeList_ptr + .asFunction)>(); /// Determine the number of diagnostics in a CXDiagnosticSet. int clang_getNumDiagnosticsInSet( - ffi.Pointer Diags, + CXDiagnosticSet Diags, ) { return _clang_getNumDiagnosticsInSet( Diags, @@ -874,15 +949,14 @@ class LibClang { } late final _clang_getNumDiagnosticsInSet_ptr = - _lookup>( + _lookup>( 'clang_getNumDiagnosticsInSet'); - late final _dart_clang_getNumDiagnosticsInSet _clang_getNumDiagnosticsInSet = - _clang_getNumDiagnosticsInSet_ptr - .asFunction<_dart_clang_getNumDiagnosticsInSet>(); + late final _clang_getNumDiagnosticsInSet = _clang_getNumDiagnosticsInSet_ptr + .asFunction(); /// Retrieve a diagnostic associated with the given CXDiagnosticSet. - ffi.Pointer clang_getDiagnosticInSet( - ffi.Pointer Diags, + CXDiagnostic clang_getDiagnosticInSet( + CXDiagnosticSet Diags, int Index, ) { return _clang_getDiagnosticInSet( @@ -891,15 +965,15 @@ class LibClang { ); } - late final _clang_getDiagnosticInSet_ptr = - _lookup>( - 'clang_getDiagnosticInSet'); - late final _dart_clang_getDiagnosticInSet _clang_getDiagnosticInSet = - _clang_getDiagnosticInSet_ptr - .asFunction<_dart_clang_getDiagnosticInSet>(); + late final _clang_getDiagnosticInSet_ptr = _lookup< + ffi.NativeFunction< + CXDiagnostic Function( + CXDiagnosticSet, ffi.Uint32)>>('clang_getDiagnosticInSet'); + late final _clang_getDiagnosticInSet = _clang_getDiagnosticInSet_ptr + .asFunction(); /// Deserialize a set of diagnostics from a Clang diagnostics bitcode file. - ffi.Pointer clang_loadDiagnostics( + CXDiagnosticSet clang_loadDiagnostics( ffi.Pointer file, ffi.Pointer error, ffi.Pointer errorString, @@ -911,15 +985,19 @@ class LibClang { ); } - late final _clang_loadDiagnostics_ptr = - _lookup>( - 'clang_loadDiagnostics'); - late final _dart_clang_loadDiagnostics _clang_loadDiagnostics = - _clang_loadDiagnostics_ptr.asFunction<_dart_clang_loadDiagnostics>(); + late final _clang_loadDiagnostics_ptr = _lookup< + ffi.NativeFunction< + CXDiagnosticSet Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_loadDiagnostics'); + late final _clang_loadDiagnostics = _clang_loadDiagnostics_ptr.asFunction< + CXDiagnosticSet Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Release a CXDiagnosticSet and all of its contained diagnostics. void clang_disposeDiagnosticSet( - ffi.Pointer Diags, + CXDiagnosticSet Diags, ) { return _clang_disposeDiagnosticSet( Diags, @@ -927,15 +1005,14 @@ class LibClang { } late final _clang_disposeDiagnosticSet_ptr = - _lookup>( + _lookup>( 'clang_disposeDiagnosticSet'); - late final _dart_clang_disposeDiagnosticSet _clang_disposeDiagnosticSet = - _clang_disposeDiagnosticSet_ptr - .asFunction<_dart_clang_disposeDiagnosticSet>(); + late final _clang_disposeDiagnosticSet = _clang_disposeDiagnosticSet_ptr + .asFunction(); /// Retrieve the child diagnostics of a CXDiagnostic. - ffi.Pointer clang_getChildDiagnostics( - ffi.Pointer D, + CXDiagnosticSet clang_getChildDiagnostics( + CXDiagnostic D, ) { return _clang_getChildDiagnostics( D, @@ -943,16 +1020,15 @@ class LibClang { } late final _clang_getChildDiagnostics_ptr = - _lookup>( + _lookup>( 'clang_getChildDiagnostics'); - late final _dart_clang_getChildDiagnostics _clang_getChildDiagnostics = - _clang_getChildDiagnostics_ptr - .asFunction<_dart_clang_getChildDiagnostics>(); + late final _clang_getChildDiagnostics = _clang_getChildDiagnostics_ptr + .asFunction(); /// Determine the number of diagnostics produced for the given translation /// unit. int clang_getNumDiagnostics( - ffi.Pointer Unit, + CXTranslationUnit Unit, ) { return _clang_getNumDiagnostics( Unit, @@ -960,14 +1036,14 @@ class LibClang { } late final _clang_getNumDiagnostics_ptr = - _lookup>( + _lookup>( 'clang_getNumDiagnostics'); - late final _dart_clang_getNumDiagnostics _clang_getNumDiagnostics = - _clang_getNumDiagnostics_ptr.asFunction<_dart_clang_getNumDiagnostics>(); + late final _clang_getNumDiagnostics = _clang_getNumDiagnostics_ptr + .asFunction(); /// Retrieve a diagnostic associated with the given translation unit. - ffi.Pointer clang_getDiagnostic( - ffi.Pointer Unit, + CXDiagnostic clang_getDiagnostic( + CXTranslationUnit Unit, int Index, ) { return _clang_getDiagnostic( @@ -976,16 +1052,17 @@ class LibClang { ); } - late final _clang_getDiagnostic_ptr = - _lookup>( - 'clang_getDiagnostic'); - late final _dart_clang_getDiagnostic _clang_getDiagnostic = - _clang_getDiagnostic_ptr.asFunction<_dart_clang_getDiagnostic>(); + late final _clang_getDiagnostic_ptr = _lookup< + ffi.NativeFunction< + CXDiagnostic Function( + CXTranslationUnit, ffi.Uint32)>>('clang_getDiagnostic'); + late final _clang_getDiagnostic = _clang_getDiagnostic_ptr + .asFunction(); /// Retrieve the complete set of diagnostics associated with a translation /// unit. - ffi.Pointer clang_getDiagnosticSetFromTU( - ffi.Pointer Unit, + CXDiagnosticSet clang_getDiagnosticSetFromTU( + CXTranslationUnit Unit, ) { return _clang_getDiagnosticSetFromTU( Unit, @@ -993,15 +1070,14 @@ class LibClang { } late final _clang_getDiagnosticSetFromTU_ptr = - _lookup>( + _lookup>( 'clang_getDiagnosticSetFromTU'); - late final _dart_clang_getDiagnosticSetFromTU _clang_getDiagnosticSetFromTU = - _clang_getDiagnosticSetFromTU_ptr - .asFunction<_dart_clang_getDiagnosticSetFromTU>(); + late final _clang_getDiagnosticSetFromTU = _clang_getDiagnosticSetFromTU_ptr + .asFunction(); /// Destroy a diagnostic. void clang_disposeDiagnostic( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, ) { return _clang_disposeDiagnostic( Diagnostic, @@ -1009,14 +1085,14 @@ class LibClang { } late final _clang_disposeDiagnostic_ptr = - _lookup>( + _lookup>( 'clang_disposeDiagnostic'); - late final _dart_clang_disposeDiagnostic _clang_disposeDiagnostic = - _clang_disposeDiagnostic_ptr.asFunction<_dart_clang_disposeDiagnostic>(); + late final _clang_disposeDiagnostic = + _clang_disposeDiagnostic_ptr.asFunction(); /// Format the given diagnostic in a manner that is suitable for display. CXString clang_formatDiagnostic( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, int Options, ) { return _clang_formatDiagnostic( @@ -1026,10 +1102,10 @@ class LibClang { } late final _clang_formatDiagnostic_ptr = - _lookup>( + _lookup>( 'clang_formatDiagnostic'); - late final _dart_clang_formatDiagnostic _clang_formatDiagnostic = - _clang_formatDiagnostic_ptr.asFunction<_dart_clang_formatDiagnostic>(); + late final _clang_formatDiagnostic = _clang_formatDiagnostic_ptr + .asFunction(); /// Retrieve the set of display options most similar to the default behavior /// of the clang compiler. @@ -1038,16 +1114,14 @@ class LibClang { } late final _clang_defaultDiagnosticDisplayOptions_ptr = - _lookup>( + _lookup>( 'clang_defaultDiagnosticDisplayOptions'); - late final _dart_clang_defaultDiagnosticDisplayOptions - _clang_defaultDiagnosticDisplayOptions = - _clang_defaultDiagnosticDisplayOptions_ptr - .asFunction<_dart_clang_defaultDiagnosticDisplayOptions>(); + late final _clang_defaultDiagnosticDisplayOptions = + _clang_defaultDiagnosticDisplayOptions_ptr.asFunction(); /// Determine the severity of the given diagnostic. int clang_getDiagnosticSeverity( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticSeverity( arg0, @@ -1055,15 +1129,14 @@ class LibClang { } late final _clang_getDiagnosticSeverity_ptr = - _lookup>( + _lookup>( 'clang_getDiagnosticSeverity'); - late final _dart_clang_getDiagnosticSeverity _clang_getDiagnosticSeverity = - _clang_getDiagnosticSeverity_ptr - .asFunction<_dart_clang_getDiagnosticSeverity>(); + late final _clang_getDiagnosticSeverity = + _clang_getDiagnosticSeverity_ptr.asFunction(); /// Retrieve the source location of the given diagnostic. CXSourceLocation clang_getDiagnosticLocation( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticLocation( arg0, @@ -1071,15 +1144,14 @@ class LibClang { } late final _clang_getDiagnosticLocation_ptr = - _lookup>( + _lookup>( 'clang_getDiagnosticLocation'); - late final _dart_clang_getDiagnosticLocation _clang_getDiagnosticLocation = - _clang_getDiagnosticLocation_ptr - .asFunction<_dart_clang_getDiagnosticLocation>(); + late final _clang_getDiagnosticLocation = _clang_getDiagnosticLocation_ptr + .asFunction(); /// Retrieve the text of the given diagnostic. CXString clang_getDiagnosticSpelling( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticSpelling( arg0, @@ -1087,15 +1159,14 @@ class LibClang { } late final _clang_getDiagnosticSpelling_ptr = - _lookup>( + _lookup>( 'clang_getDiagnosticSpelling'); - late final _dart_clang_getDiagnosticSpelling _clang_getDiagnosticSpelling = - _clang_getDiagnosticSpelling_ptr - .asFunction<_dart_clang_getDiagnosticSpelling>(); + late final _clang_getDiagnosticSpelling = _clang_getDiagnosticSpelling_ptr + .asFunction(); /// Retrieve the name of the command-line option that enabled this diagnostic. CXString clang_getDiagnosticOption( - ffi.Pointer Diag, + CXDiagnostic Diag, ffi.Pointer Disable, ) { return _clang_getDiagnosticOption( @@ -1104,16 +1175,16 @@ class LibClang { ); } - late final _clang_getDiagnosticOption_ptr = - _lookup>( - 'clang_getDiagnosticOption'); - late final _dart_clang_getDiagnosticOption _clang_getDiagnosticOption = - _clang_getDiagnosticOption_ptr - .asFunction<_dart_clang_getDiagnosticOption>(); + late final _clang_getDiagnosticOption_ptr = _lookup< + ffi.NativeFunction< + CXString Function(CXDiagnostic, + ffi.Pointer)>>('clang_getDiagnosticOption'); + late final _clang_getDiagnosticOption = _clang_getDiagnosticOption_ptr + .asFunction)>(); /// Retrieve the category number for this diagnostic. int clang_getDiagnosticCategory( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticCategory( arg0, @@ -1121,11 +1192,10 @@ class LibClang { } late final _clang_getDiagnosticCategory_ptr = - _lookup>( + _lookup>( 'clang_getDiagnosticCategory'); - late final _dart_clang_getDiagnosticCategory _clang_getDiagnosticCategory = - _clang_getDiagnosticCategory_ptr - .asFunction<_dart_clang_getDiagnosticCategory>(); + late final _clang_getDiagnosticCategory = + _clang_getDiagnosticCategory_ptr.asFunction(); /// Retrieve the name of a particular diagnostic category. This is now /// deprecated. Use clang_getDiagnosticCategoryText() instead. @@ -1138,15 +1208,14 @@ class LibClang { } late final _clang_getDiagnosticCategoryName_ptr = - _lookup>( + _lookup>( 'clang_getDiagnosticCategoryName'); - late final _dart_clang_getDiagnosticCategoryName - _clang_getDiagnosticCategoryName = _clang_getDiagnosticCategoryName_ptr - .asFunction<_dart_clang_getDiagnosticCategoryName>(); + late final _clang_getDiagnosticCategoryName = + _clang_getDiagnosticCategoryName_ptr.asFunction(); /// Retrieve the diagnostic category text for a given diagnostic. CXString clang_getDiagnosticCategoryText( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticCategoryText( arg0, @@ -1154,16 +1223,16 @@ class LibClang { } late final _clang_getDiagnosticCategoryText_ptr = - _lookup>( + _lookup>( 'clang_getDiagnosticCategoryText'); - late final _dart_clang_getDiagnosticCategoryText - _clang_getDiagnosticCategoryText = _clang_getDiagnosticCategoryText_ptr - .asFunction<_dart_clang_getDiagnosticCategoryText>(); + late final _clang_getDiagnosticCategoryText = + _clang_getDiagnosticCategoryText_ptr + .asFunction(); /// Determine the number of source ranges associated with the given /// diagnostic. int clang_getDiagnosticNumRanges( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticNumRanges( arg0, @@ -1171,15 +1240,14 @@ class LibClang { } late final _clang_getDiagnosticNumRanges_ptr = - _lookup>( + _lookup>( 'clang_getDiagnosticNumRanges'); - late final _dart_clang_getDiagnosticNumRanges _clang_getDiagnosticNumRanges = - _clang_getDiagnosticNumRanges_ptr - .asFunction<_dart_clang_getDiagnosticNumRanges>(); + late final _clang_getDiagnosticNumRanges = _clang_getDiagnosticNumRanges_ptr + .asFunction(); /// Retrieve a source range associated with the diagnostic. CXSourceRange clang_getDiagnosticRange( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, int Range, ) { return _clang_getDiagnosticRange( @@ -1188,16 +1256,15 @@ class LibClang { ); } - late final _clang_getDiagnosticRange_ptr = - _lookup>( - 'clang_getDiagnosticRange'); - late final _dart_clang_getDiagnosticRange _clang_getDiagnosticRange = - _clang_getDiagnosticRange_ptr - .asFunction<_dart_clang_getDiagnosticRange>(); + late final _clang_getDiagnosticRange_ptr = _lookup< + ffi.NativeFunction>( + 'clang_getDiagnosticRange'); + late final _clang_getDiagnosticRange = _clang_getDiagnosticRange_ptr + .asFunction(); /// Determine the number of fix-it hints associated with the given diagnostic. int clang_getDiagnosticNumFixIts( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, ) { return _clang_getDiagnosticNumFixIts( Diagnostic, @@ -1205,15 +1272,14 @@ class LibClang { } late final _clang_getDiagnosticNumFixIts_ptr = - _lookup>( + _lookup>( 'clang_getDiagnosticNumFixIts'); - late final _dart_clang_getDiagnosticNumFixIts _clang_getDiagnosticNumFixIts = - _clang_getDiagnosticNumFixIts_ptr - .asFunction<_dart_clang_getDiagnosticNumFixIts>(); + late final _clang_getDiagnosticNumFixIts = _clang_getDiagnosticNumFixIts_ptr + .asFunction(); /// Retrieve the replacement information for a given fix-it. CXString clang_getDiagnosticFixIt( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, int FixIt, ffi.Pointer ReplacementRange, ) { @@ -1224,16 +1290,17 @@ class LibClang { ); } - late final _clang_getDiagnosticFixIt_ptr = - _lookup>( - 'clang_getDiagnosticFixIt'); - late final _dart_clang_getDiagnosticFixIt _clang_getDiagnosticFixIt = - _clang_getDiagnosticFixIt_ptr - .asFunction<_dart_clang_getDiagnosticFixIt>(); + late final _clang_getDiagnosticFixIt_ptr = _lookup< + ffi.NativeFunction< + CXString Function(CXDiagnostic, ffi.Uint32, + ffi.Pointer)>>('clang_getDiagnosticFixIt'); + late final _clang_getDiagnosticFixIt = + _clang_getDiagnosticFixIt_ptr.asFunction< + CXString Function(CXDiagnostic, int, ffi.Pointer)>(); /// Get the original translation unit source file name. CXString clang_getTranslationUnitSpelling( - ffi.Pointer CTUnit, + CXTranslationUnit CTUnit, ) { return _clang_getTranslationUnitSpelling( CTUnit, @@ -1241,16 +1308,16 @@ class LibClang { } late final _clang_getTranslationUnitSpelling_ptr = - _lookup>( + _lookup>( 'clang_getTranslationUnitSpelling'); - late final _dart_clang_getTranslationUnitSpelling - _clang_getTranslationUnitSpelling = _clang_getTranslationUnitSpelling_ptr - .asFunction<_dart_clang_getTranslationUnitSpelling>(); + late final _clang_getTranslationUnitSpelling = + _clang_getTranslationUnitSpelling_ptr + .asFunction(); /// Return the CXTranslationUnit for a given source file and the provided /// command line arguments one would pass to the compiler. - ffi.Pointer clang_createTranslationUnitFromSourceFile( - ffi.Pointer CIdx, + CXTranslationUnit clang_createTranslationUnitFromSourceFile( + CXIndex CIdx, ffi.Pointer source_filename, int num_clang_command_line_args, ffi.Pointer> clang_command_line_args, @@ -1267,19 +1334,31 @@ class LibClang { ); } - late final _clang_createTranslationUnitFromSourceFile_ptr = - _lookup>( - 'clang_createTranslationUnitFromSourceFile'); - late final _dart_clang_createTranslationUnitFromSourceFile - _clang_createTranslationUnitFromSourceFile = - _clang_createTranslationUnitFromSourceFile_ptr - .asFunction<_dart_clang_createTranslationUnitFromSourceFile>(); + late final _clang_createTranslationUnitFromSourceFile_ptr = _lookup< + ffi.NativeFunction< + CXTranslationUnit Function( + CXIndex, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Uint32, + ffi.Pointer)>>( + 'clang_createTranslationUnitFromSourceFile'); + late final _clang_createTranslationUnitFromSourceFile = + _clang_createTranslationUnitFromSourceFile_ptr.asFunction< + CXTranslationUnit Function( + CXIndex, + ffi.Pointer, + int, + ffi.Pointer>, + int, + ffi.Pointer)>(); /// Same as clang_createTranslationUnit2, but returns the CXTranslationUnit /// instead of an error code. In case of an error this routine returns a NULL /// CXTranslationUnit, without further detailed error codes. - ffi.Pointer clang_createTranslationUnit( - ffi.Pointer CIdx, + CXTranslationUnit clang_createTranslationUnit( + CXIndex CIdx, ffi.Pointer ast_filename, ) { return _clang_createTranslationUnit( @@ -1288,18 +1367,18 @@ class LibClang { ); } - late final _clang_createTranslationUnit_ptr = - _lookup>( - 'clang_createTranslationUnit'); - late final _dart_clang_createTranslationUnit _clang_createTranslationUnit = - _clang_createTranslationUnit_ptr - .asFunction<_dart_clang_createTranslationUnit>(); + late final _clang_createTranslationUnit_ptr = _lookup< + ffi.NativeFunction< + CXTranslationUnit Function( + CXIndex, ffi.Pointer)>>('clang_createTranslationUnit'); + late final _clang_createTranslationUnit = _clang_createTranslationUnit_ptr + .asFunction)>(); /// Create a translation unit from an AST file ( -emit-ast). int clang_createTranslationUnit2( - ffi.Pointer CIdx, + CXIndex CIdx, ffi.Pointer ast_filename, - ffi.Pointer> out_TU, + ffi.Pointer out_TU, ) { return _clang_createTranslationUnit2( CIdx, @@ -1308,12 +1387,14 @@ class LibClang { ); } - late final _clang_createTranslationUnit2_ptr = - _lookup>( - 'clang_createTranslationUnit2'); - late final _dart_clang_createTranslationUnit2 _clang_createTranslationUnit2 = - _clang_createTranslationUnit2_ptr - .asFunction<_dart_clang_createTranslationUnit2>(); + late final _clang_createTranslationUnit2_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(CXIndex, ffi.Pointer, + ffi.Pointer)>>('clang_createTranslationUnit2'); + late final _clang_createTranslationUnit2 = + _clang_createTranslationUnit2_ptr.asFunction< + int Function(CXIndex, ffi.Pointer, + ffi.Pointer)>(); /// Returns the set of flags that is suitable for parsing a translation unit /// that is being edited. @@ -1321,19 +1402,18 @@ class LibClang { return _clang_defaultEditingTranslationUnitOptions(); } - late final _clang_defaultEditingTranslationUnitOptions_ptr = _lookup< - ffi.NativeFunction<_c_clang_defaultEditingTranslationUnitOptions>>( - 'clang_defaultEditingTranslationUnitOptions'); - late final _dart_clang_defaultEditingTranslationUnitOptions - _clang_defaultEditingTranslationUnitOptions = + late final _clang_defaultEditingTranslationUnitOptions_ptr = + _lookup>( + 'clang_defaultEditingTranslationUnitOptions'); + late final _clang_defaultEditingTranslationUnitOptions = _clang_defaultEditingTranslationUnitOptions_ptr - .asFunction<_dart_clang_defaultEditingTranslationUnitOptions>(); + .asFunction(); /// Same as clang_parseTranslationUnit2, but returns the CXTranslationUnit /// instead of an error code. In case of an error this routine returns a NULL /// CXTranslationUnit, without further detailed error codes. - ffi.Pointer clang_parseTranslationUnit( - ffi.Pointer CIdx, + CXTranslationUnit clang_parseTranslationUnit( + CXIndex CIdx, ffi.Pointer source_filename, ffi.Pointer> command_line_args, int num_command_line_args, @@ -1352,24 +1432,38 @@ class LibClang { ); } - late final _clang_parseTranslationUnit_ptr = - _lookup>( - 'clang_parseTranslationUnit'); - late final _dart_clang_parseTranslationUnit _clang_parseTranslationUnit = - _clang_parseTranslationUnit_ptr - .asFunction<_dart_clang_parseTranslationUnit>(); + late final _clang_parseTranslationUnit_ptr = _lookup< + ffi.NativeFunction< + CXTranslationUnit Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + ffi.Int32, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32)>>('clang_parseTranslationUnit'); + late final _clang_parseTranslationUnit = + _clang_parseTranslationUnit_ptr.asFunction< + CXTranslationUnit Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + int)>(); /// Parse the given source file and the translation unit corresponding to that /// file. int clang_parseTranslationUnit2( - ffi.Pointer CIdx, + CXIndex 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, + ffi.Pointer out_TU, ) { return _clang_parseTranslationUnit2( CIdx, @@ -1383,25 +1477,41 @@ class LibClang { ); } - late final _clang_parseTranslationUnit2_ptr = - _lookup>( - 'clang_parseTranslationUnit2'); - late final _dart_clang_parseTranslationUnit2 _clang_parseTranslationUnit2 = - _clang_parseTranslationUnit2_ptr - .asFunction<_dart_clang_parseTranslationUnit2>(); + late final _clang_parseTranslationUnit2_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + ffi.Int32, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32, + ffi.Pointer)>>('clang_parseTranslationUnit2'); + late final _clang_parseTranslationUnit2 = + _clang_parseTranslationUnit2_ptr.asFunction< + int Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + int, + ffi.Pointer)>(); /// Same as clang_parseTranslationUnit2 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_parseTranslationUnit2FullArgv( - ffi.Pointer CIdx, + CXIndex 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, + ffi.Pointer out_TU, ) { return _clang_parseTranslationUnit2FullArgv( CIdx, @@ -1415,17 +1525,33 @@ class LibClang { ); } - late final _clang_parseTranslationUnit2FullArgv_ptr = - _lookup>( - 'clang_parseTranslationUnit2FullArgv'); - late final _dart_clang_parseTranslationUnit2FullArgv - _clang_parseTranslationUnit2FullArgv = - _clang_parseTranslationUnit2FullArgv_ptr - .asFunction<_dart_clang_parseTranslationUnit2FullArgv>(); + late final _clang_parseTranslationUnit2FullArgv_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + ffi.Int32, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32, + ffi.Pointer)>>( + 'clang_parseTranslationUnit2FullArgv'); + late final _clang_parseTranslationUnit2FullArgv = + _clang_parseTranslationUnit2FullArgv_ptr.asFunction< + int Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + int, + ffi.Pointer)>(); /// Returns the set of flags that is suitable for saving a translation unit. int clang_defaultSaveOptions( - ffi.Pointer TU, + CXTranslationUnit TU, ) { return _clang_defaultSaveOptions( TU, @@ -1433,16 +1559,15 @@ class LibClang { } late final _clang_defaultSaveOptions_ptr = - _lookup>( + _lookup>( 'clang_defaultSaveOptions'); - late final _dart_clang_defaultSaveOptions _clang_defaultSaveOptions = - _clang_defaultSaveOptions_ptr - .asFunction<_dart_clang_defaultSaveOptions>(); + late final _clang_defaultSaveOptions = _clang_defaultSaveOptions_ptr + .asFunction(); /// Saves a translation unit into a serialized representation of that /// translation unit on disk. int clang_saveTranslationUnit( - ffi.Pointer TU, + CXTranslationUnit TU, ffi.Pointer FileName, int options, ) { @@ -1453,16 +1578,17 @@ class LibClang { ); } - late final _clang_saveTranslationUnit_ptr = - _lookup>( - 'clang_saveTranslationUnit'); - late final _dart_clang_saveTranslationUnit _clang_saveTranslationUnit = - _clang_saveTranslationUnit_ptr - .asFunction<_dart_clang_saveTranslationUnit>(); + late final _clang_saveTranslationUnit_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(CXTranslationUnit, ffi.Pointer, + ffi.Uint32)>>('clang_saveTranslationUnit'); + late final _clang_saveTranslationUnit = + _clang_saveTranslationUnit_ptr.asFunction< + int Function(CXTranslationUnit, ffi.Pointer, int)>(); /// Suspend a translation unit in order to free memory associated with it. int clang_suspendTranslationUnit( - ffi.Pointer arg0, + CXTranslationUnit arg0, ) { return _clang_suspendTranslationUnit( arg0, @@ -1470,15 +1596,14 @@ class LibClang { } late final _clang_suspendTranslationUnit_ptr = - _lookup>( + _lookup>( 'clang_suspendTranslationUnit'); - late final _dart_clang_suspendTranslationUnit _clang_suspendTranslationUnit = - _clang_suspendTranslationUnit_ptr - .asFunction<_dart_clang_suspendTranslationUnit>(); + late final _clang_suspendTranslationUnit = _clang_suspendTranslationUnit_ptr + .asFunction(); /// Destroy the specified CXTranslationUnit object. void clang_disposeTranslationUnit( - ffi.Pointer arg0, + CXTranslationUnit arg0, ) { return _clang_disposeTranslationUnit( arg0, @@ -1486,16 +1611,15 @@ class LibClang { } late final _clang_disposeTranslationUnit_ptr = - _lookup>( + _lookup>( 'clang_disposeTranslationUnit'); - late final _dart_clang_disposeTranslationUnit _clang_disposeTranslationUnit = - _clang_disposeTranslationUnit_ptr - .asFunction<_dart_clang_disposeTranslationUnit>(); + late final _clang_disposeTranslationUnit = _clang_disposeTranslationUnit_ptr + .asFunction(); /// Returns the set of flags that is suitable for reparsing a translation /// unit. int clang_defaultReparseOptions( - ffi.Pointer TU, + CXTranslationUnit TU, ) { return _clang_defaultReparseOptions( TU, @@ -1503,15 +1627,14 @@ class LibClang { } late final _clang_defaultReparseOptions_ptr = - _lookup>( + _lookup>( 'clang_defaultReparseOptions'); - late final _dart_clang_defaultReparseOptions _clang_defaultReparseOptions = - _clang_defaultReparseOptions_ptr - .asFunction<_dart_clang_defaultReparseOptions>(); + late final _clang_defaultReparseOptions = _clang_defaultReparseOptions_ptr + .asFunction(); /// Reparse the source files that produced this translation unit. int clang_reparseTranslationUnit( - ffi.Pointer TU, + CXTranslationUnit TU, int num_unsaved_files, ffi.Pointer unsaved_files, int options, @@ -1524,12 +1647,17 @@ class LibClang { ); } - late final _clang_reparseTranslationUnit_ptr = - _lookup>( - 'clang_reparseTranslationUnit'); - late final _dart_clang_reparseTranslationUnit _clang_reparseTranslationUnit = - _clang_reparseTranslationUnit_ptr - .asFunction<_dart_clang_reparseTranslationUnit>(); + late final _clang_reparseTranslationUnit_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXTranslationUnit, + ffi.Uint32, + ffi.Pointer, + ffi.Uint32)>>('clang_reparseTranslationUnit'); + late final _clang_reparseTranslationUnit = + _clang_reparseTranslationUnit_ptr.asFunction< + int Function( + CXTranslationUnit, int, ffi.Pointer, int)>(); /// Returns the human-readable null-terminated C string that represents the /// name of the memory category. This string should never be freed. @@ -1542,28 +1670,26 @@ class LibClang { } late final _clang_getTUResourceUsageName_ptr = - _lookup>( + _lookup Function(ffi.Int32)>>( 'clang_getTUResourceUsageName'); - late final _dart_clang_getTUResourceUsageName _clang_getTUResourceUsageName = - _clang_getTUResourceUsageName_ptr - .asFunction<_dart_clang_getTUResourceUsageName>(); + late final _clang_getTUResourceUsageName = _clang_getTUResourceUsageName_ptr + .asFunction Function(int)>(); /// Return the memory usage of a translation unit. This object should be /// released with clang_disposeCXTUResourceUsage(). CXTUResourceUsage clang_getCXTUResourceUsage( - ffi.Pointer TU, + CXTranslationUnit TU, ) { return _clang_getCXTUResourceUsage( TU, ); } - late final _clang_getCXTUResourceUsage_ptr = - _lookup>( - 'clang_getCXTUResourceUsage'); - late final _dart_clang_getCXTUResourceUsage _clang_getCXTUResourceUsage = - _clang_getCXTUResourceUsage_ptr - .asFunction<_dart_clang_getCXTUResourceUsage>(); + late final _clang_getCXTUResourceUsage_ptr = _lookup< + ffi.NativeFunction>( + 'clang_getCXTUResourceUsage'); + late final _clang_getCXTUResourceUsage = _clang_getCXTUResourceUsage_ptr + .asFunction(); void clang_disposeCXTUResourceUsage( CXTUResourceUsage usage, @@ -1574,15 +1700,15 @@ class LibClang { } late final _clang_disposeCXTUResourceUsage_ptr = - _lookup>( + _lookup>( 'clang_disposeCXTUResourceUsage'); - late final _dart_clang_disposeCXTUResourceUsage - _clang_disposeCXTUResourceUsage = _clang_disposeCXTUResourceUsage_ptr - .asFunction<_dart_clang_disposeCXTUResourceUsage>(); + late final _clang_disposeCXTUResourceUsage = + _clang_disposeCXTUResourceUsage_ptr + .asFunction(); /// Get target information for this translation unit. - ffi.Pointer clang_getTranslationUnitTargetInfo( - ffi.Pointer CTUnit, + CXTargetInfo clang_getTranslationUnitTargetInfo( + CXTranslationUnit CTUnit, ) { return _clang_getTranslationUnitTargetInfo( CTUnit, @@ -1590,16 +1716,15 @@ class LibClang { } late final _clang_getTranslationUnitTargetInfo_ptr = - _lookup>( + _lookup>( 'clang_getTranslationUnitTargetInfo'); - late final _dart_clang_getTranslationUnitTargetInfo - _clang_getTranslationUnitTargetInfo = + late final _clang_getTranslationUnitTargetInfo = _clang_getTranslationUnitTargetInfo_ptr - .asFunction<_dart_clang_getTranslationUnitTargetInfo>(); + .asFunction(); /// Destroy the CXTargetInfo object. void clang_TargetInfo_dispose( - ffi.Pointer Info, + CXTargetInfo Info, ) { return _clang_TargetInfo_dispose( Info, @@ -1607,15 +1732,14 @@ class LibClang { } late final _clang_TargetInfo_dispose_ptr = - _lookup>( + _lookup>( 'clang_TargetInfo_dispose'); - late final _dart_clang_TargetInfo_dispose _clang_TargetInfo_dispose = - _clang_TargetInfo_dispose_ptr - .asFunction<_dart_clang_TargetInfo_dispose>(); + late final _clang_TargetInfo_dispose = + _clang_TargetInfo_dispose_ptr.asFunction(); /// Get the normalized target triple as a string. CXString clang_TargetInfo_getTriple( - ffi.Pointer Info, + CXTargetInfo Info, ) { return _clang_TargetInfo_getTriple( Info, @@ -1623,15 +1747,14 @@ class LibClang { } late final _clang_TargetInfo_getTriple_ptr = - _lookup>( + _lookup>( 'clang_TargetInfo_getTriple'); - late final _dart_clang_TargetInfo_getTriple _clang_TargetInfo_getTriple = - _clang_TargetInfo_getTriple_ptr - .asFunction<_dart_clang_TargetInfo_getTriple>(); + late final _clang_TargetInfo_getTriple = _clang_TargetInfo_getTriple_ptr + .asFunction(); /// Get the pointer width of the target in bits. int clang_TargetInfo_getPointerWidth( - ffi.Pointer Info, + CXTargetInfo Info, ) { return _clang_TargetInfo_getPointerWidth( Info, @@ -1639,11 +1762,11 @@ class LibClang { } late final _clang_TargetInfo_getPointerWidth_ptr = - _lookup>( + _lookup>( 'clang_TargetInfo_getPointerWidth'); - late final _dart_clang_TargetInfo_getPointerWidth - _clang_TargetInfo_getPointerWidth = _clang_TargetInfo_getPointerWidth_ptr - .asFunction<_dart_clang_TargetInfo_getPointerWidth>(); + late final _clang_TargetInfo_getPointerWidth = + _clang_TargetInfo_getPointerWidth_ptr + .asFunction(); /// Retrieve the NULL cursor, which represents no entity. CXCursor clang_getNullCursor() { @@ -1651,14 +1774,13 @@ class LibClang { } late final _clang_getNullCursor_ptr = - _lookup>( - 'clang_getNullCursor'); - late final _dart_clang_getNullCursor _clang_getNullCursor = - _clang_getNullCursor_ptr.asFunction<_dart_clang_getNullCursor>(); + _lookup>('clang_getNullCursor'); + late final _clang_getNullCursor = + _clang_getNullCursor_ptr.asFunction(); /// Retrieve the cursor that represents the given translation unit. CXCursor clang_getTranslationUnitCursor( - ffi.Pointer arg0, + CXTranslationUnit arg0, ) { return _clang_getTranslationUnitCursor( arg0, @@ -1666,11 +1788,11 @@ class LibClang { } late final _clang_getTranslationUnitCursor_ptr = - _lookup>( + _lookup>( 'clang_getTranslationUnitCursor'); - late final _dart_clang_getTranslationUnitCursor - _clang_getTranslationUnitCursor = _clang_getTranslationUnitCursor_ptr - .asFunction<_dart_clang_getTranslationUnitCursor>(); + late final _clang_getTranslationUnitCursor = + _clang_getTranslationUnitCursor_ptr + .asFunction(); /// Determine whether two cursors are equivalent. int clang_equalCursors( @@ -1684,9 +1806,10 @@ class LibClang { } late final _clang_equalCursors_ptr = - _lookup>('clang_equalCursors'); - late final _dart_clang_equalCursors _clang_equalCursors = - _clang_equalCursors_ptr.asFunction<_dart_clang_equalCursors>(); + _lookup>( + 'clang_equalCursors'); + late final _clang_equalCursors = + _clang_equalCursors_ptr.asFunction(); /// Returns non-zero if cursor is null. int clang_Cursor_isNull( @@ -1698,10 +1821,10 @@ class LibClang { } late final _clang_Cursor_isNull_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isNull'); - late final _dart_clang_Cursor_isNull _clang_Cursor_isNull = - _clang_Cursor_isNull_ptr.asFunction<_dart_clang_Cursor_isNull>(); + late final _clang_Cursor_isNull = + _clang_Cursor_isNull_ptr.asFunction(); /// Compute a hash value for the given cursor. int clang_hashCursor( @@ -1713,9 +1836,10 @@ class LibClang { } late final _clang_hashCursor_ptr = - _lookup>('clang_hashCursor'); - late final _dart_clang_hashCursor _clang_hashCursor = - _clang_hashCursor_ptr.asFunction<_dart_clang_hashCursor>(); + _lookup>( + 'clang_hashCursor'); + late final _clang_hashCursor = + _clang_hashCursor_ptr.asFunction(); /// Retrieve the kind of the given cursor. int clang_getCursorKind( @@ -1727,10 +1851,10 @@ class LibClang { } late final _clang_getCursorKind_ptr = - _lookup>( + _lookup>( 'clang_getCursorKind'); - late final _dart_clang_getCursorKind _clang_getCursorKind = - _clang_getCursorKind_ptr.asFunction<_dart_clang_getCursorKind>(); + late final _clang_getCursorKind = + _clang_getCursorKind_ptr.asFunction(); /// Determine whether the given cursor kind represents a declaration. int clang_isDeclaration( @@ -1742,10 +1866,10 @@ class LibClang { } late final _clang_isDeclaration_ptr = - _lookup>( + _lookup>( 'clang_isDeclaration'); - late final _dart_clang_isDeclaration _clang_isDeclaration = - _clang_isDeclaration_ptr.asFunction<_dart_clang_isDeclaration>(); + late final _clang_isDeclaration = + _clang_isDeclaration_ptr.asFunction(); /// Determine whether the given declaration is invalid. int clang_isInvalidDeclaration( @@ -1757,11 +1881,10 @@ class LibClang { } late final _clang_isInvalidDeclaration_ptr = - _lookup>( + _lookup>( 'clang_isInvalidDeclaration'); - late final _dart_clang_isInvalidDeclaration _clang_isInvalidDeclaration = - _clang_isInvalidDeclaration_ptr - .asFunction<_dart_clang_isInvalidDeclaration>(); + late final _clang_isInvalidDeclaration = + _clang_isInvalidDeclaration_ptr.asFunction(); /// Determine whether the given cursor kind represents a simple reference. int clang_isReference( @@ -1773,9 +1896,10 @@ class LibClang { } late final _clang_isReference_ptr = - _lookup>('clang_isReference'); - late final _dart_clang_isReference _clang_isReference = - _clang_isReference_ptr.asFunction<_dart_clang_isReference>(); + _lookup>( + 'clang_isReference'); + late final _clang_isReference = + _clang_isReference_ptr.asFunction(); /// Determine whether the given cursor kind represents an expression. int clang_isExpression( @@ -1787,9 +1911,10 @@ class LibClang { } late final _clang_isExpression_ptr = - _lookup>('clang_isExpression'); - late final _dart_clang_isExpression _clang_isExpression = - _clang_isExpression_ptr.asFunction<_dart_clang_isExpression>(); + _lookup>( + 'clang_isExpression'); + late final _clang_isExpression = + _clang_isExpression_ptr.asFunction(); /// Determine whether the given cursor kind represents a statement. int clang_isStatement( @@ -1801,9 +1926,10 @@ class LibClang { } late final _clang_isStatement_ptr = - _lookup>('clang_isStatement'); - late final _dart_clang_isStatement _clang_isStatement = - _clang_isStatement_ptr.asFunction<_dart_clang_isStatement>(); + _lookup>( + 'clang_isStatement'); + late final _clang_isStatement = + _clang_isStatement_ptr.asFunction(); /// Determine whether the given cursor kind represents an attribute. int clang_isAttribute( @@ -1815,9 +1941,10 @@ class LibClang { } late final _clang_isAttribute_ptr = - _lookup>('clang_isAttribute'); - late final _dart_clang_isAttribute _clang_isAttribute = - _clang_isAttribute_ptr.asFunction<_dart_clang_isAttribute>(); + _lookup>( + 'clang_isAttribute'); + late final _clang_isAttribute = + _clang_isAttribute_ptr.asFunction(); /// Determine whether the given cursor has any attributes. int clang_Cursor_hasAttrs( @@ -1829,10 +1956,10 @@ class LibClang { } late final _clang_Cursor_hasAttrs_ptr = - _lookup>( + _lookup>( 'clang_Cursor_hasAttrs'); - late final _dart_clang_Cursor_hasAttrs _clang_Cursor_hasAttrs = - _clang_Cursor_hasAttrs_ptr.asFunction<_dart_clang_Cursor_hasAttrs>(); + late final _clang_Cursor_hasAttrs = + _clang_Cursor_hasAttrs_ptr.asFunction(); /// Determine whether the given cursor kind represents an invalid cursor. int clang_isInvalid( @@ -1844,9 +1971,10 @@ class LibClang { } late final _clang_isInvalid_ptr = - _lookup>('clang_isInvalid'); - late final _dart_clang_isInvalid _clang_isInvalid = - _clang_isInvalid_ptr.asFunction<_dart_clang_isInvalid>(); + _lookup>( + 'clang_isInvalid'); + late final _clang_isInvalid = + _clang_isInvalid_ptr.asFunction(); /// Determine whether the given cursor kind represents a translation unit. int clang_isTranslationUnit( @@ -1858,10 +1986,10 @@ class LibClang { } late final _clang_isTranslationUnit_ptr = - _lookup>( + _lookup>( 'clang_isTranslationUnit'); - late final _dart_clang_isTranslationUnit _clang_isTranslationUnit = - _clang_isTranslationUnit_ptr.asFunction<_dart_clang_isTranslationUnit>(); + late final _clang_isTranslationUnit = + _clang_isTranslationUnit_ptr.asFunction(); /// * Determine whether the given cursor represents a preprocessing element, /// such as a preprocessor directive or macro instantiation. @@ -1874,10 +2002,10 @@ class LibClang { } late final _clang_isPreprocessing_ptr = - _lookup>( + _lookup>( 'clang_isPreprocessing'); - late final _dart_clang_isPreprocessing _clang_isPreprocessing = - _clang_isPreprocessing_ptr.asFunction<_dart_clang_isPreprocessing>(); + late final _clang_isPreprocessing = + _clang_isPreprocessing_ptr.asFunction(); /// * Determine whether the given cursor represents a currently unexposed /// piece of the AST (e.g., CXCursor_UnexposedStmt). @@ -1890,9 +2018,10 @@ class LibClang { } late final _clang_isUnexposed_ptr = - _lookup>('clang_isUnexposed'); - late final _dart_clang_isUnexposed _clang_isUnexposed = - _clang_isUnexposed_ptr.asFunction<_dart_clang_isUnexposed>(); + _lookup>( + 'clang_isUnexposed'); + late final _clang_isUnexposed = + _clang_isUnexposed_ptr.asFunction(); /// Determine the linkage of the entity referred to by a given cursor. int clang_getCursorLinkage( @@ -1904,10 +2033,10 @@ class LibClang { } late final _clang_getCursorLinkage_ptr = - _lookup>( + _lookup>( 'clang_getCursorLinkage'); - late final _dart_clang_getCursorLinkage _clang_getCursorLinkage = - _clang_getCursorLinkage_ptr.asFunction<_dart_clang_getCursorLinkage>(); + late final _clang_getCursorLinkage = + _clang_getCursorLinkage_ptr.asFunction(); /// Describe the visibility of the entity referred to by a cursor. int clang_getCursorVisibility( @@ -1919,11 +2048,10 @@ class LibClang { } late final _clang_getCursorVisibility_ptr = - _lookup>( + _lookup>( 'clang_getCursorVisibility'); - late final _dart_clang_getCursorVisibility _clang_getCursorVisibility = - _clang_getCursorVisibility_ptr - .asFunction<_dart_clang_getCursorVisibility>(); + late final _clang_getCursorVisibility = + _clang_getCursorVisibility_ptr.asFunction(); /// Determine the availability of the entity that this cursor refers to, /// taking the current target platform into account. @@ -1936,11 +2064,10 @@ class LibClang { } late final _clang_getCursorAvailability_ptr = - _lookup>( + _lookup>( 'clang_getCursorAvailability'); - late final _dart_clang_getCursorAvailability _clang_getCursorAvailability = - _clang_getCursorAvailability_ptr - .asFunction<_dart_clang_getCursorAvailability>(); + late final _clang_getCursorAvailability = + _clang_getCursorAvailability_ptr.asFunction(); /// Determine the availability of the entity that this cursor refers to on any /// platforms for which availability information is known. @@ -1964,13 +2091,26 @@ class LibClang { ); } - late final _clang_getCursorPlatformAvailability_ptr = - _lookup>( - 'clang_getCursorPlatformAvailability'); - late final _dart_clang_getCursorPlatformAvailability - _clang_getCursorPlatformAvailability = - _clang_getCursorPlatformAvailability_ptr - .asFunction<_dart_clang_getCursorPlatformAvailability>(); + late final _clang_getCursorPlatformAvailability_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXCursor, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('clang_getCursorPlatformAvailability'); + late final _clang_getCursorPlatformAvailability = + _clang_getCursorPlatformAvailability_ptr.asFunction< + int Function( + CXCursor, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); /// Free the memory associated with a CXPlatformAvailability structure. void clang_disposeCXPlatformAvailability( @@ -1981,13 +2121,13 @@ class LibClang { ); } - late final _clang_disposeCXPlatformAvailability_ptr = - _lookup>( - 'clang_disposeCXPlatformAvailability'); - late final _dart_clang_disposeCXPlatformAvailability - _clang_disposeCXPlatformAvailability = + late final _clang_disposeCXPlatformAvailability_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>( + 'clang_disposeCXPlatformAvailability'); + late final _clang_disposeCXPlatformAvailability = _clang_disposeCXPlatformAvailability_ptr - .asFunction<_dart_clang_disposeCXPlatformAvailability>(); + .asFunction)>(); /// Determine the "language" of the entity referred to by a given cursor. int clang_getCursorLanguage( @@ -1999,10 +2139,10 @@ class LibClang { } late final _clang_getCursorLanguage_ptr = - _lookup>( + _lookup>( 'clang_getCursorLanguage'); - late final _dart_clang_getCursorLanguage _clang_getCursorLanguage = - _clang_getCursorLanguage_ptr.asFunction<_dart_clang_getCursorLanguage>(); + late final _clang_getCursorLanguage = + _clang_getCursorLanguage_ptr.asFunction(); /// Determine the "thread-local storage (TLS) kind" of the declaration /// referred to by a cursor. @@ -2015,13 +2155,13 @@ class LibClang { } late final _clang_getCursorTLSKind_ptr = - _lookup>( + _lookup>( 'clang_getCursorTLSKind'); - late final _dart_clang_getCursorTLSKind _clang_getCursorTLSKind = - _clang_getCursorTLSKind_ptr.asFunction<_dart_clang_getCursorTLSKind>(); + late final _clang_getCursorTLSKind = + _clang_getCursorTLSKind_ptr.asFunction(); /// Returns the translation unit that a cursor originated from. - ffi.Pointer clang_Cursor_getTranslationUnit( + CXTranslationUnit clang_Cursor_getTranslationUnit( CXCursor arg0, ) { return _clang_Cursor_getTranslationUnit( @@ -2030,26 +2170,26 @@ class LibClang { } late final _clang_Cursor_getTranslationUnit_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getTranslationUnit'); - late final _dart_clang_Cursor_getTranslationUnit - _clang_Cursor_getTranslationUnit = _clang_Cursor_getTranslationUnit_ptr - .asFunction<_dart_clang_Cursor_getTranslationUnit>(); + late final _clang_Cursor_getTranslationUnit = + _clang_Cursor_getTranslationUnit_ptr + .asFunction(); /// Creates an empty CXCursorSet. - ffi.Pointer clang_createCXCursorSet() { + CXCursorSet clang_createCXCursorSet() { return _clang_createCXCursorSet(); } late final _clang_createCXCursorSet_ptr = - _lookup>( + _lookup>( 'clang_createCXCursorSet'); - late final _dart_clang_createCXCursorSet _clang_createCXCursorSet = - _clang_createCXCursorSet_ptr.asFunction<_dart_clang_createCXCursorSet>(); + late final _clang_createCXCursorSet = + _clang_createCXCursorSet_ptr.asFunction(); /// Disposes a CXCursorSet and releases its associated memory. void clang_disposeCXCursorSet( - ffi.Pointer cset, + CXCursorSet cset, ) { return _clang_disposeCXCursorSet( cset, @@ -2057,15 +2197,14 @@ class LibClang { } late final _clang_disposeCXCursorSet_ptr = - _lookup>( + _lookup>( 'clang_disposeCXCursorSet'); - late final _dart_clang_disposeCXCursorSet _clang_disposeCXCursorSet = - _clang_disposeCXCursorSet_ptr - .asFunction<_dart_clang_disposeCXCursorSet>(); + late final _clang_disposeCXCursorSet = + _clang_disposeCXCursorSet_ptr.asFunction(); /// Queries a CXCursorSet to see if it contains a specific CXCursor. int clang_CXCursorSet_contains( - ffi.Pointer cset, + CXCursorSet cset, CXCursor cursor, ) { return _clang_CXCursorSet_contains( @@ -2075,15 +2214,14 @@ class LibClang { } late final _clang_CXCursorSet_contains_ptr = - _lookup>( + _lookup>( 'clang_CXCursorSet_contains'); - late final _dart_clang_CXCursorSet_contains _clang_CXCursorSet_contains = - _clang_CXCursorSet_contains_ptr - .asFunction<_dart_clang_CXCursorSet_contains>(); + late final _clang_CXCursorSet_contains = _clang_CXCursorSet_contains_ptr + .asFunction(); /// Inserts a CXCursor into a CXCursorSet. int clang_CXCursorSet_insert( - ffi.Pointer cset, + CXCursorSet cset, CXCursor cursor, ) { return _clang_CXCursorSet_insert( @@ -2093,11 +2231,10 @@ class LibClang { } late final _clang_CXCursorSet_insert_ptr = - _lookup>( + _lookup>( 'clang_CXCursorSet_insert'); - late final _dart_clang_CXCursorSet_insert _clang_CXCursorSet_insert = - _clang_CXCursorSet_insert_ptr - .asFunction<_dart_clang_CXCursorSet_insert>(); + late final _clang_CXCursorSet_insert = _clang_CXCursorSet_insert_ptr + .asFunction(); /// Determine the semantic parent of the given cursor. CXCursor clang_getCursorSemanticParent( @@ -2109,11 +2246,10 @@ class LibClang { } late final _clang_getCursorSemanticParent_ptr = - _lookup>( + _lookup>( 'clang_getCursorSemanticParent'); - late final _dart_clang_getCursorSemanticParent - _clang_getCursorSemanticParent = _clang_getCursorSemanticParent_ptr - .asFunction<_dart_clang_getCursorSemanticParent>(); + late final _clang_getCursorSemanticParent = _clang_getCursorSemanticParent_ptr + .asFunction(); /// Determine the lexical parent of the given cursor. CXCursor clang_getCursorLexicalParent( @@ -2125,11 +2261,10 @@ class LibClang { } late final _clang_getCursorLexicalParent_ptr = - _lookup>( + _lookup>( 'clang_getCursorLexicalParent'); - late final _dart_clang_getCursorLexicalParent _clang_getCursorLexicalParent = - _clang_getCursorLexicalParent_ptr - .asFunction<_dart_clang_getCursorLexicalParent>(); + late final _clang_getCursorLexicalParent = _clang_getCursorLexicalParent_ptr + .asFunction(); /// Determine the set of methods that are overridden by the given method. void clang_getOverriddenCursors( @@ -2144,12 +2279,14 @@ class LibClang { ); } - late final _clang_getOverriddenCursors_ptr = - _lookup>( - 'clang_getOverriddenCursors'); - late final _dart_clang_getOverriddenCursors _clang_getOverriddenCursors = - _clang_getOverriddenCursors_ptr - .asFunction<_dart_clang_getOverriddenCursors>(); + late final _clang_getOverriddenCursors_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CXCursor, ffi.Pointer>, + ffi.Pointer)>>('clang_getOverriddenCursors'); + late final _clang_getOverriddenCursors = + _clang_getOverriddenCursors_ptr.asFunction< + void Function(CXCursor, ffi.Pointer>, + ffi.Pointer)>(); /// Free the set of overridden cursors returned by /// clang_getOverriddenCursors(). @@ -2162,15 +2299,15 @@ class LibClang { } late final _clang_disposeOverriddenCursors_ptr = - _lookup>( + _lookup)>>( 'clang_disposeOverriddenCursors'); - late final _dart_clang_disposeOverriddenCursors - _clang_disposeOverriddenCursors = _clang_disposeOverriddenCursors_ptr - .asFunction<_dart_clang_disposeOverriddenCursors>(); + late final _clang_disposeOverriddenCursors = + _clang_disposeOverriddenCursors_ptr + .asFunction)>(); /// Retrieve the file that is included by the given inclusion directive /// cursor. - ffi.Pointer clang_getIncludedFile( + CXFile clang_getIncludedFile( CXCursor cursor, ) { return _clang_getIncludedFile( @@ -2179,15 +2316,15 @@ class LibClang { } late final _clang_getIncludedFile_ptr = - _lookup>( + _lookup>( 'clang_getIncludedFile'); - late final _dart_clang_getIncludedFile _clang_getIncludedFile = - _clang_getIncludedFile_ptr.asFunction<_dart_clang_getIncludedFile>(); + late final _clang_getIncludedFile = + _clang_getIncludedFile_ptr.asFunction(); /// Map a source location to the cursor that describes the entity at that /// location in the source code. CXCursor clang_getCursor( - ffi.Pointer arg0, + CXTranslationUnit arg0, CXSourceLocation arg1, ) { return _clang_getCursor( @@ -2196,10 +2333,12 @@ class LibClang { ); } - late final _clang_getCursor_ptr = - _lookup>('clang_getCursor'); - late final _dart_clang_getCursor _clang_getCursor = - _clang_getCursor_ptr.asFunction<_dart_clang_getCursor>(); + late final _clang_getCursor_ptr = _lookup< + ffi.NativeFunction< + CXCursor Function( + CXTranslationUnit, CXSourceLocation)>>('clang_getCursor'); + late final _clang_getCursor = _clang_getCursor_ptr + .asFunction(); /// Retrieve the physical location of the source constructor referenced by the /// given cursor. @@ -2212,10 +2351,10 @@ class LibClang { } late final _clang_getCursorLocation_ptr = - _lookup>( + _lookup>( 'clang_getCursorLocation'); - late final _dart_clang_getCursorLocation _clang_getCursorLocation = - _clang_getCursorLocation_ptr.asFunction<_dart_clang_getCursorLocation>(); + late final _clang_getCursorLocation = _clang_getCursorLocation_ptr + .asFunction(); /// Retrieve the physical extent of the source construct referenced by the /// given cursor. @@ -2228,10 +2367,10 @@ class LibClang { } late final _clang_getCursorExtent_ptr = - _lookup>( + _lookup>( 'clang_getCursorExtent'); - late final _dart_clang_getCursorExtent _clang_getCursorExtent = - _clang_getCursorExtent_ptr.asFunction<_dart_clang_getCursorExtent>(); + late final _clang_getCursorExtent = + _clang_getCursorExtent_ptr.asFunction(); /// Retrieve the type of a CXCursor (if any). CXType clang_getCursorType( @@ -2243,10 +2382,10 @@ class LibClang { } late final _clang_getCursorType_ptr = - _lookup>( + _lookup>( 'clang_getCursorType'); - late final _dart_clang_getCursorType _clang_getCursorType = - _clang_getCursorType_ptr.asFunction<_dart_clang_getCursorType>(); + late final _clang_getCursorType = + _clang_getCursorType_ptr.asFunction(); /// Pretty-print the underlying type using the rules of the language of the /// translation unit from which it came. @@ -2259,10 +2398,10 @@ class LibClang { } late final _clang_getTypeSpelling_ptr = - _lookup>( + _lookup>( 'clang_getTypeSpelling'); - late final _dart_clang_getTypeSpelling _clang_getTypeSpelling = - _clang_getTypeSpelling_ptr.asFunction<_dart_clang_getTypeSpelling>(); + late final _clang_getTypeSpelling = + _clang_getTypeSpelling_ptr.asFunction(); /// Retrieve the underlying type of a typedef declaration. CXType clang_getTypedefDeclUnderlyingType( @@ -2274,12 +2413,11 @@ class LibClang { } late final _clang_getTypedefDeclUnderlyingType_ptr = - _lookup>( + _lookup>( 'clang_getTypedefDeclUnderlyingType'); - late final _dart_clang_getTypedefDeclUnderlyingType - _clang_getTypedefDeclUnderlyingType = + late final _clang_getTypedefDeclUnderlyingType = _clang_getTypedefDeclUnderlyingType_ptr - .asFunction<_dart_clang_getTypedefDeclUnderlyingType>(); + .asFunction(); /// Retrieve the integer type of an enum declaration. CXType clang_getEnumDeclIntegerType( @@ -2291,11 +2429,10 @@ class LibClang { } late final _clang_getEnumDeclIntegerType_ptr = - _lookup>( + _lookup>( 'clang_getEnumDeclIntegerType'); - late final _dart_clang_getEnumDeclIntegerType _clang_getEnumDeclIntegerType = - _clang_getEnumDeclIntegerType_ptr - .asFunction<_dart_clang_getEnumDeclIntegerType>(); + late final _clang_getEnumDeclIntegerType = + _clang_getEnumDeclIntegerType_ptr.asFunction(); /// Retrieve the integer value of an enum constant declaration as a signed /// long long. @@ -2308,11 +2445,10 @@ class LibClang { } late final _clang_getEnumConstantDeclValue_ptr = - _lookup>( + _lookup>( 'clang_getEnumConstantDeclValue'); - late final _dart_clang_getEnumConstantDeclValue - _clang_getEnumConstantDeclValue = _clang_getEnumConstantDeclValue_ptr - .asFunction<_dart_clang_getEnumConstantDeclValue>(); + late final _clang_getEnumConstantDeclValue = + _clang_getEnumConstantDeclValue_ptr.asFunction(); /// Retrieve the integer value of an enum constant declaration as an unsigned /// long long. @@ -2325,12 +2461,11 @@ class LibClang { } late final _clang_getEnumConstantDeclUnsignedValue_ptr = - _lookup>( + _lookup>( 'clang_getEnumConstantDeclUnsignedValue'); - late final _dart_clang_getEnumConstantDeclUnsignedValue - _clang_getEnumConstantDeclUnsignedValue = + late final _clang_getEnumConstantDeclUnsignedValue = _clang_getEnumConstantDeclUnsignedValue_ptr - .asFunction<_dart_clang_getEnumConstantDeclUnsignedValue>(); + .asFunction(); /// Retrieve the bit width of a bit field declaration as an integer. int clang_getFieldDeclBitWidth( @@ -2342,11 +2477,10 @@ class LibClang { } late final _clang_getFieldDeclBitWidth_ptr = - _lookup>( + _lookup>( 'clang_getFieldDeclBitWidth'); - late final _dart_clang_getFieldDeclBitWidth _clang_getFieldDeclBitWidth = - _clang_getFieldDeclBitWidth_ptr - .asFunction<_dart_clang_getFieldDeclBitWidth>(); + late final _clang_getFieldDeclBitWidth = + _clang_getFieldDeclBitWidth_ptr.asFunction(); /// Retrieve the number of non-variadic arguments associated with a given /// cursor. @@ -2359,11 +2493,10 @@ class LibClang { } late final _clang_Cursor_getNumArguments_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getNumArguments'); - late final _dart_clang_Cursor_getNumArguments _clang_Cursor_getNumArguments = - _clang_Cursor_getNumArguments_ptr - .asFunction<_dart_clang_Cursor_getNumArguments>(); + late final _clang_Cursor_getNumArguments = + _clang_Cursor_getNumArguments_ptr.asFunction(); /// Retrieve the argument cursor of a function or method. CXCursor clang_Cursor_getArgument( @@ -2377,11 +2510,10 @@ class LibClang { } late final _clang_Cursor_getArgument_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getArgument'); - late final _dart_clang_Cursor_getArgument _clang_Cursor_getArgument = - _clang_Cursor_getArgument_ptr - .asFunction<_dart_clang_Cursor_getArgument>(); + late final _clang_Cursor_getArgument = _clang_Cursor_getArgument_ptr + .asFunction(); /// Returns the number of template args of a function decl representing a /// template specialization. @@ -2394,12 +2526,11 @@ class LibClang { } late final _clang_Cursor_getNumTemplateArguments_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getNumTemplateArguments'); - late final _dart_clang_Cursor_getNumTemplateArguments - _clang_Cursor_getNumTemplateArguments = + late final _clang_Cursor_getNumTemplateArguments = _clang_Cursor_getNumTemplateArguments_ptr - .asFunction<_dart_clang_Cursor_getNumTemplateArguments>(); + .asFunction(); /// Retrieve the kind of the I'th template argument of the CXCursor C. int clang_Cursor_getTemplateArgumentKind( @@ -2413,12 +2544,11 @@ class LibClang { } late final _clang_Cursor_getTemplateArgumentKind_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getTemplateArgumentKind'); - late final _dart_clang_Cursor_getTemplateArgumentKind - _clang_Cursor_getTemplateArgumentKind = + late final _clang_Cursor_getTemplateArgumentKind = _clang_Cursor_getTemplateArgumentKind_ptr - .asFunction<_dart_clang_Cursor_getTemplateArgumentKind>(); + .asFunction(); /// Retrieve a CXType representing the type of a TemplateArgument of a /// function decl representing a template specialization. @@ -2433,12 +2563,11 @@ class LibClang { } late final _clang_Cursor_getTemplateArgumentType_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getTemplateArgumentType'); - late final _dart_clang_Cursor_getTemplateArgumentType - _clang_Cursor_getTemplateArgumentType = + late final _clang_Cursor_getTemplateArgumentType = _clang_Cursor_getTemplateArgumentType_ptr - .asFunction<_dart_clang_Cursor_getTemplateArgumentType>(); + .asFunction(); /// Retrieve the value of an Integral TemplateArgument (of a function decl /// representing a template specialization) as a signed long long. @@ -2453,12 +2582,11 @@ class LibClang { } late final _clang_Cursor_getTemplateArgumentValue_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getTemplateArgumentValue'); - late final _dart_clang_Cursor_getTemplateArgumentValue - _clang_Cursor_getTemplateArgumentValue = + late final _clang_Cursor_getTemplateArgumentValue = _clang_Cursor_getTemplateArgumentValue_ptr - .asFunction<_dart_clang_Cursor_getTemplateArgumentValue>(); + .asFunction(); /// Retrieve the value of an Integral TemplateArgument (of a function decl /// representing a template specialization) as an unsigned long long. @@ -2472,13 +2600,12 @@ class LibClang { ); } - late final _clang_Cursor_getTemplateArgumentUnsignedValue_ptr = _lookup< - ffi.NativeFunction<_c_clang_Cursor_getTemplateArgumentUnsignedValue>>( - 'clang_Cursor_getTemplateArgumentUnsignedValue'); - late final _dart_clang_Cursor_getTemplateArgumentUnsignedValue - _clang_Cursor_getTemplateArgumentUnsignedValue = + late final _clang_Cursor_getTemplateArgumentUnsignedValue_ptr = + _lookup>( + 'clang_Cursor_getTemplateArgumentUnsignedValue'); + late final _clang_Cursor_getTemplateArgumentUnsignedValue = _clang_Cursor_getTemplateArgumentUnsignedValue_ptr - .asFunction<_dart_clang_Cursor_getTemplateArgumentUnsignedValue>(); + .asFunction(); /// Determine whether two CXTypes represent the same type. int clang_equalTypes( @@ -2492,9 +2619,10 @@ class LibClang { } late final _clang_equalTypes_ptr = - _lookup>('clang_equalTypes'); - late final _dart_clang_equalTypes _clang_equalTypes = - _clang_equalTypes_ptr.asFunction<_dart_clang_equalTypes>(); + _lookup>( + 'clang_equalTypes'); + late final _clang_equalTypes = + _clang_equalTypes_ptr.asFunction(); /// Return the canonical type for a CXType. CXType clang_getCanonicalType( @@ -2506,10 +2634,10 @@ class LibClang { } late final _clang_getCanonicalType_ptr = - _lookup>( + _lookup>( 'clang_getCanonicalType'); - late final _dart_clang_getCanonicalType _clang_getCanonicalType = - _clang_getCanonicalType_ptr.asFunction<_dart_clang_getCanonicalType>(); + late final _clang_getCanonicalType = + _clang_getCanonicalType_ptr.asFunction(); /// Determine whether a CXType has the "const" qualifier set, without looking /// through typedefs that may have added "const" at a different level. @@ -2522,11 +2650,10 @@ class LibClang { } late final _clang_isConstQualifiedType_ptr = - _lookup>( + _lookup>( 'clang_isConstQualifiedType'); - late final _dart_clang_isConstQualifiedType _clang_isConstQualifiedType = - _clang_isConstQualifiedType_ptr - .asFunction<_dart_clang_isConstQualifiedType>(); + late final _clang_isConstQualifiedType = + _clang_isConstQualifiedType_ptr.asFunction(); /// Determine whether a CXCursor that is a macro, is function like. int clang_Cursor_isMacroFunctionLike( @@ -2538,11 +2665,11 @@ class LibClang { } late final _clang_Cursor_isMacroFunctionLike_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isMacroFunctionLike'); - late final _dart_clang_Cursor_isMacroFunctionLike - _clang_Cursor_isMacroFunctionLike = _clang_Cursor_isMacroFunctionLike_ptr - .asFunction<_dart_clang_Cursor_isMacroFunctionLike>(); + late final _clang_Cursor_isMacroFunctionLike = + _clang_Cursor_isMacroFunctionLike_ptr + .asFunction(); /// Determine whether a CXCursor that is a macro, is a builtin one. int clang_Cursor_isMacroBuiltin( @@ -2554,11 +2681,10 @@ class LibClang { } late final _clang_Cursor_isMacroBuiltin_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isMacroBuiltin'); - late final _dart_clang_Cursor_isMacroBuiltin _clang_Cursor_isMacroBuiltin = - _clang_Cursor_isMacroBuiltin_ptr - .asFunction<_dart_clang_Cursor_isMacroBuiltin>(); + late final _clang_Cursor_isMacroBuiltin = + _clang_Cursor_isMacroBuiltin_ptr.asFunction(); /// Determine whether a CXCursor that is a function declaration, is an inline /// declaration. @@ -2571,11 +2697,10 @@ class LibClang { } late final _clang_Cursor_isFunctionInlined_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isFunctionInlined'); - late final _dart_clang_Cursor_isFunctionInlined - _clang_Cursor_isFunctionInlined = _clang_Cursor_isFunctionInlined_ptr - .asFunction<_dart_clang_Cursor_isFunctionInlined>(); + late final _clang_Cursor_isFunctionInlined = + _clang_Cursor_isFunctionInlined_ptr.asFunction(); /// Determine whether a CXType has the "volatile" qualifier set, without /// looking through typedefs that may have added "volatile" at a different @@ -2589,11 +2714,10 @@ class LibClang { } late final _clang_isVolatileQualifiedType_ptr = - _lookup>( + _lookup>( 'clang_isVolatileQualifiedType'); - late final _dart_clang_isVolatileQualifiedType - _clang_isVolatileQualifiedType = _clang_isVolatileQualifiedType_ptr - .asFunction<_dart_clang_isVolatileQualifiedType>(); + late final _clang_isVolatileQualifiedType = + _clang_isVolatileQualifiedType_ptr.asFunction(); /// Determine whether a CXType has the "restrict" qualifier set, without /// looking through typedefs that may have added "restrict" at a different @@ -2607,11 +2731,10 @@ class LibClang { } late final _clang_isRestrictQualifiedType_ptr = - _lookup>( + _lookup>( 'clang_isRestrictQualifiedType'); - late final _dart_clang_isRestrictQualifiedType - _clang_isRestrictQualifiedType = _clang_isRestrictQualifiedType_ptr - .asFunction<_dart_clang_isRestrictQualifiedType>(); + late final _clang_isRestrictQualifiedType = + _clang_isRestrictQualifiedType_ptr.asFunction(); /// Returns the address space of the given type. int clang_getAddressSpace( @@ -2623,10 +2746,10 @@ class LibClang { } late final _clang_getAddressSpace_ptr = - _lookup>( + _lookup>( 'clang_getAddressSpace'); - late final _dart_clang_getAddressSpace _clang_getAddressSpace = - _clang_getAddressSpace_ptr.asFunction<_dart_clang_getAddressSpace>(); + late final _clang_getAddressSpace = + _clang_getAddressSpace_ptr.asFunction(); /// Returns the typedef name of the given type. CXString clang_getTypedefName( @@ -2638,10 +2761,10 @@ class LibClang { } late final _clang_getTypedefName_ptr = - _lookup>( + _lookup>( 'clang_getTypedefName'); - late final _dart_clang_getTypedefName _clang_getTypedefName = - _clang_getTypedefName_ptr.asFunction<_dart_clang_getTypedefName>(); + late final _clang_getTypedefName = + _clang_getTypedefName_ptr.asFunction(); /// For pointer types, returns the type of the pointee. CXType clang_getPointeeType( @@ -2653,10 +2776,10 @@ class LibClang { } late final _clang_getPointeeType_ptr = - _lookup>( + _lookup>( 'clang_getPointeeType'); - late final _dart_clang_getPointeeType _clang_getPointeeType = - _clang_getPointeeType_ptr.asFunction<_dart_clang_getPointeeType>(); + late final _clang_getPointeeType = + _clang_getPointeeType_ptr.asFunction(); /// Return the cursor for the declaration of the given type. CXCursor clang_getTypeDeclaration( @@ -2668,11 +2791,10 @@ class LibClang { } late final _clang_getTypeDeclaration_ptr = - _lookup>( + _lookup>( 'clang_getTypeDeclaration'); - late final _dart_clang_getTypeDeclaration _clang_getTypeDeclaration = - _clang_getTypeDeclaration_ptr - .asFunction<_dart_clang_getTypeDeclaration>(); + late final _clang_getTypeDeclaration = + _clang_getTypeDeclaration_ptr.asFunction(); /// Returns the Objective-C type encoding for the specified declaration. CXString clang_getDeclObjCTypeEncoding( @@ -2684,11 +2806,10 @@ class LibClang { } late final _clang_getDeclObjCTypeEncoding_ptr = - _lookup>( + _lookup>( 'clang_getDeclObjCTypeEncoding'); - late final _dart_clang_getDeclObjCTypeEncoding - _clang_getDeclObjCTypeEncoding = _clang_getDeclObjCTypeEncoding_ptr - .asFunction<_dart_clang_getDeclObjCTypeEncoding>(); + late final _clang_getDeclObjCTypeEncoding = _clang_getDeclObjCTypeEncoding_ptr + .asFunction(); /// Returns the Objective-C type encoding for the specified CXType. CXString clang_Type_getObjCEncoding( @@ -2700,11 +2821,10 @@ class LibClang { } late final _clang_Type_getObjCEncoding_ptr = - _lookup>( + _lookup>( 'clang_Type_getObjCEncoding'); - late final _dart_clang_Type_getObjCEncoding _clang_Type_getObjCEncoding = - _clang_Type_getObjCEncoding_ptr - .asFunction<_dart_clang_Type_getObjCEncoding>(); + late final _clang_Type_getObjCEncoding = + _clang_Type_getObjCEncoding_ptr.asFunction(); /// Retrieve the spelling of a given CXTypeKind. CXString clang_getTypeKindSpelling( @@ -2716,11 +2836,10 @@ class LibClang { } late final _clang_getTypeKindSpelling_ptr = - _lookup>( + _lookup>( 'clang_getTypeKindSpelling'); - late final _dart_clang_getTypeKindSpelling _clang_getTypeKindSpelling = - _clang_getTypeKindSpelling_ptr - .asFunction<_dart_clang_getTypeKindSpelling>(); + late final _clang_getTypeKindSpelling = + _clang_getTypeKindSpelling_ptr.asFunction(); /// Retrieve the calling convention associated with a function type. int clang_getFunctionTypeCallingConv( @@ -2732,11 +2851,10 @@ class LibClang { } late final _clang_getFunctionTypeCallingConv_ptr = - _lookup>( + _lookup>( 'clang_getFunctionTypeCallingConv'); - late final _dart_clang_getFunctionTypeCallingConv - _clang_getFunctionTypeCallingConv = _clang_getFunctionTypeCallingConv_ptr - .asFunction<_dart_clang_getFunctionTypeCallingConv>(); + late final _clang_getFunctionTypeCallingConv = + _clang_getFunctionTypeCallingConv_ptr.asFunction(); /// Retrieve the return type associated with a function type. CXType clang_getResultType( @@ -2748,10 +2866,10 @@ class LibClang { } late final _clang_getResultType_ptr = - _lookup>( + _lookup>( 'clang_getResultType'); - late final _dart_clang_getResultType _clang_getResultType = - _clang_getResultType_ptr.asFunction<_dart_clang_getResultType>(); + late final _clang_getResultType = + _clang_getResultType_ptr.asFunction(); /// Retrieve the exception specification type associated with a function type. /// This is a value of type CXCursor_ExceptionSpecificationKind. @@ -2764,12 +2882,11 @@ class LibClang { } late final _clang_getExceptionSpecificationType_ptr = - _lookup>( + _lookup>( 'clang_getExceptionSpecificationType'); - late final _dart_clang_getExceptionSpecificationType - _clang_getExceptionSpecificationType = + late final _clang_getExceptionSpecificationType = _clang_getExceptionSpecificationType_ptr - .asFunction<_dart_clang_getExceptionSpecificationType>(); + .asFunction(); /// Retrieve the number of non-variadic parameters associated with a function /// type. @@ -2782,10 +2899,10 @@ class LibClang { } late final _clang_getNumArgTypes_ptr = - _lookup>( + _lookup>( 'clang_getNumArgTypes'); - late final _dart_clang_getNumArgTypes _clang_getNumArgTypes = - _clang_getNumArgTypes_ptr.asFunction<_dart_clang_getNumArgTypes>(); + late final _clang_getNumArgTypes = + _clang_getNumArgTypes_ptr.asFunction(); /// Retrieve the type of a parameter of a function type. CXType clang_getArgType( @@ -2799,9 +2916,10 @@ class LibClang { } late final _clang_getArgType_ptr = - _lookup>('clang_getArgType'); - late final _dart_clang_getArgType _clang_getArgType = - _clang_getArgType_ptr.asFunction<_dart_clang_getArgType>(); + _lookup>( + 'clang_getArgType'); + late final _clang_getArgType = + _clang_getArgType_ptr.asFunction(); /// Retrieves the base type of the ObjCObjectType. CXType clang_Type_getObjCObjectBaseType( @@ -2813,11 +2931,11 @@ class LibClang { } late final _clang_Type_getObjCObjectBaseType_ptr = - _lookup>( + _lookup>( 'clang_Type_getObjCObjectBaseType'); - late final _dart_clang_Type_getObjCObjectBaseType - _clang_Type_getObjCObjectBaseType = _clang_Type_getObjCObjectBaseType_ptr - .asFunction<_dart_clang_Type_getObjCObjectBaseType>(); + late final _clang_Type_getObjCObjectBaseType = + _clang_Type_getObjCObjectBaseType_ptr + .asFunction(); /// Retrieve the number of protocol references associated with an ObjC /// object/id. @@ -2830,12 +2948,10 @@ class LibClang { } late final _clang_Type_getNumObjCProtocolRefs_ptr = - _lookup>( + _lookup>( 'clang_Type_getNumObjCProtocolRefs'); - late final _dart_clang_Type_getNumObjCProtocolRefs - _clang_Type_getNumObjCProtocolRefs = - _clang_Type_getNumObjCProtocolRefs_ptr - .asFunction<_dart_clang_Type_getNumObjCProtocolRefs>(); + late final _clang_Type_getNumObjCProtocolRefs = + _clang_Type_getNumObjCProtocolRefs_ptr.asFunction(); /// Retrieve the decl for a protocol reference for an ObjC object/id. CXCursor clang_Type_getObjCProtocolDecl( @@ -2849,11 +2965,11 @@ class LibClang { } late final _clang_Type_getObjCProtocolDecl_ptr = - _lookup>( + _lookup>( 'clang_Type_getObjCProtocolDecl'); - late final _dart_clang_Type_getObjCProtocolDecl - _clang_Type_getObjCProtocolDecl = _clang_Type_getObjCProtocolDecl_ptr - .asFunction<_dart_clang_Type_getObjCProtocolDecl>(); + late final _clang_Type_getObjCProtocolDecl = + _clang_Type_getObjCProtocolDecl_ptr + .asFunction(); /// Retreive the number of type arguments associated with an ObjC object. int clang_Type_getNumObjCTypeArgs( @@ -2865,11 +2981,10 @@ class LibClang { } late final _clang_Type_getNumObjCTypeArgs_ptr = - _lookup>( + _lookup>( 'clang_Type_getNumObjCTypeArgs'); - late final _dart_clang_Type_getNumObjCTypeArgs - _clang_Type_getNumObjCTypeArgs = _clang_Type_getNumObjCTypeArgs_ptr - .asFunction<_dart_clang_Type_getNumObjCTypeArgs>(); + late final _clang_Type_getNumObjCTypeArgs = + _clang_Type_getNumObjCTypeArgs_ptr.asFunction(); /// Retrieve a type argument associated with an ObjC object. CXType clang_Type_getObjCTypeArg( @@ -2883,11 +2998,10 @@ class LibClang { } late final _clang_Type_getObjCTypeArg_ptr = - _lookup>( + _lookup>( 'clang_Type_getObjCTypeArg'); - late final _dart_clang_Type_getObjCTypeArg _clang_Type_getObjCTypeArg = - _clang_Type_getObjCTypeArg_ptr - .asFunction<_dart_clang_Type_getObjCTypeArg>(); + late final _clang_Type_getObjCTypeArg = + _clang_Type_getObjCTypeArg_ptr.asFunction(); /// Return 1 if the CXType is a variadic function type, and 0 otherwise. int clang_isFunctionTypeVariadic( @@ -2899,11 +3013,10 @@ class LibClang { } late final _clang_isFunctionTypeVariadic_ptr = - _lookup>( + _lookup>( 'clang_isFunctionTypeVariadic'); - late final _dart_clang_isFunctionTypeVariadic _clang_isFunctionTypeVariadic = - _clang_isFunctionTypeVariadic_ptr - .asFunction<_dart_clang_isFunctionTypeVariadic>(); + late final _clang_isFunctionTypeVariadic = + _clang_isFunctionTypeVariadic_ptr.asFunction(); /// Retrieve the return type associated with a given cursor. CXType clang_getCursorResultType( @@ -2915,11 +3028,10 @@ class LibClang { } late final _clang_getCursorResultType_ptr = - _lookup>( + _lookup>( 'clang_getCursorResultType'); - late final _dart_clang_getCursorResultType _clang_getCursorResultType = - _clang_getCursorResultType_ptr - .asFunction<_dart_clang_getCursorResultType>(); + late final _clang_getCursorResultType = + _clang_getCursorResultType_ptr.asFunction(); /// Retrieve the exception specification type associated with a given cursor. /// This is a value of type CXCursor_ExceptionSpecificationKind. @@ -2932,12 +3044,11 @@ class LibClang { } late final _clang_getCursorExceptionSpecificationType_ptr = - _lookup>( + _lookup>( 'clang_getCursorExceptionSpecificationType'); - late final _dart_clang_getCursorExceptionSpecificationType - _clang_getCursorExceptionSpecificationType = + late final _clang_getCursorExceptionSpecificationType = _clang_getCursorExceptionSpecificationType_ptr - .asFunction<_dart_clang_getCursorExceptionSpecificationType>(); + .asFunction(); /// Return 1 if the CXType is a POD (plain old data) type, and 0 otherwise. int clang_isPODType( @@ -2949,9 +3060,10 @@ class LibClang { } late final _clang_isPODType_ptr = - _lookup>('clang_isPODType'); - late final _dart_clang_isPODType _clang_isPODType = - _clang_isPODType_ptr.asFunction<_dart_clang_isPODType>(); + _lookup>( + 'clang_isPODType'); + late final _clang_isPODType = + _clang_isPODType_ptr.asFunction(); /// Return the element type of an array, complex, or vector type. CXType clang_getElementType( @@ -2963,10 +3075,10 @@ class LibClang { } late final _clang_getElementType_ptr = - _lookup>( + _lookup>( 'clang_getElementType'); - late final _dart_clang_getElementType _clang_getElementType = - _clang_getElementType_ptr.asFunction<_dart_clang_getElementType>(); + late final _clang_getElementType = + _clang_getElementType_ptr.asFunction(); /// Return the number of elements of an array or vector type. int clang_getNumElements( @@ -2978,10 +3090,10 @@ class LibClang { } late final _clang_getNumElements_ptr = - _lookup>( + _lookup>( 'clang_getNumElements'); - late final _dart_clang_getNumElements _clang_getNumElements = - _clang_getNumElements_ptr.asFunction<_dart_clang_getNumElements>(); + late final _clang_getNumElements = + _clang_getNumElements_ptr.asFunction(); /// Return the element type of an array type. CXType clang_getArrayElementType( @@ -2993,11 +3105,10 @@ class LibClang { } late final _clang_getArrayElementType_ptr = - _lookup>( + _lookup>( 'clang_getArrayElementType'); - late final _dart_clang_getArrayElementType _clang_getArrayElementType = - _clang_getArrayElementType_ptr - .asFunction<_dart_clang_getArrayElementType>(); + late final _clang_getArrayElementType = + _clang_getArrayElementType_ptr.asFunction(); /// Return the array size of a constant array. int clang_getArraySize( @@ -3009,9 +3120,10 @@ class LibClang { } late final _clang_getArraySize_ptr = - _lookup>('clang_getArraySize'); - late final _dart_clang_getArraySize _clang_getArraySize = - _clang_getArraySize_ptr.asFunction<_dart_clang_getArraySize>(); + _lookup>( + 'clang_getArraySize'); + late final _clang_getArraySize = + _clang_getArraySize_ptr.asFunction(); /// Retrieve the type named by the qualified-id. CXType clang_Type_getNamedType( @@ -3023,10 +3135,10 @@ class LibClang { } late final _clang_Type_getNamedType_ptr = - _lookup>( + _lookup>( 'clang_Type_getNamedType'); - late final _dart_clang_Type_getNamedType _clang_Type_getNamedType = - _clang_Type_getNamedType_ptr.asFunction<_dart_clang_Type_getNamedType>(); + late final _clang_Type_getNamedType = + _clang_Type_getNamedType_ptr.asFunction(); /// Determine if a typedef is 'transparent' tag. int clang_Type_isTransparentTagTypedef( @@ -3038,12 +3150,11 @@ class LibClang { } late final _clang_Type_isTransparentTagTypedef_ptr = - _lookup>( + _lookup>( 'clang_Type_isTransparentTagTypedef'); - late final _dart_clang_Type_isTransparentTagTypedef - _clang_Type_isTransparentTagTypedef = + late final _clang_Type_isTransparentTagTypedef = _clang_Type_isTransparentTagTypedef_ptr - .asFunction<_dart_clang_Type_isTransparentTagTypedef>(); + .asFunction(); /// Retrieve the nullability kind of a pointer type. int clang_Type_getNullability( @@ -3055,11 +3166,10 @@ class LibClang { } late final _clang_Type_getNullability_ptr = - _lookup>( + _lookup>( 'clang_Type_getNullability'); - late final _dart_clang_Type_getNullability _clang_Type_getNullability = - _clang_Type_getNullability_ptr - .asFunction<_dart_clang_Type_getNullability>(); + late final _clang_Type_getNullability = + _clang_Type_getNullability_ptr.asFunction(); /// Return the alignment of a type in bytes as per C++[expr.alignof] standard. int clang_Type_getAlignOf( @@ -3071,10 +3181,10 @@ class LibClang { } late final _clang_Type_getAlignOf_ptr = - _lookup>( + _lookup>( 'clang_Type_getAlignOf'); - late final _dart_clang_Type_getAlignOf _clang_Type_getAlignOf = - _clang_Type_getAlignOf_ptr.asFunction<_dart_clang_Type_getAlignOf>(); + late final _clang_Type_getAlignOf = + _clang_Type_getAlignOf_ptr.asFunction(); /// Return the class type of an member pointer type. CXType clang_Type_getClassType( @@ -3086,10 +3196,10 @@ class LibClang { } late final _clang_Type_getClassType_ptr = - _lookup>( + _lookup>( 'clang_Type_getClassType'); - late final _dart_clang_Type_getClassType _clang_Type_getClassType = - _clang_Type_getClassType_ptr.asFunction<_dart_clang_Type_getClassType>(); + late final _clang_Type_getClassType = + _clang_Type_getClassType_ptr.asFunction(); /// Return the size of a type in bytes as per C++[expr.sizeof] standard. int clang_Type_getSizeOf( @@ -3101,10 +3211,10 @@ class LibClang { } late final _clang_Type_getSizeOf_ptr = - _lookup>( + _lookup>( 'clang_Type_getSizeOf'); - late final _dart_clang_Type_getSizeOf _clang_Type_getSizeOf = - _clang_Type_getSizeOf_ptr.asFunction<_dart_clang_Type_getSizeOf>(); + late final _clang_Type_getSizeOf = + _clang_Type_getSizeOf_ptr.asFunction(); /// 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] @@ -3118,11 +3228,12 @@ class LibClang { ); } - late final _clang_Type_getOffsetOf_ptr = - _lookup>( - 'clang_Type_getOffsetOf'); - late final _dart_clang_Type_getOffsetOf _clang_Type_getOffsetOf = - _clang_Type_getOffsetOf_ptr.asFunction<_dart_clang_Type_getOffsetOf>(); + late final _clang_Type_getOffsetOf_ptr = _lookup< + ffi.NativeFunction< + ffi.Int64 Function( + CXType, ffi.Pointer)>>('clang_Type_getOffsetOf'); + late final _clang_Type_getOffsetOf = _clang_Type_getOffsetOf_ptr + .asFunction)>(); /// Return the type that was modified by this attributed type. CXType clang_Type_getModifiedType( @@ -3134,11 +3245,10 @@ class LibClang { } late final _clang_Type_getModifiedType_ptr = - _lookup>( + _lookup>( 'clang_Type_getModifiedType'); - late final _dart_clang_Type_getModifiedType _clang_Type_getModifiedType = - _clang_Type_getModifiedType_ptr - .asFunction<_dart_clang_Type_getModifiedType>(); + late final _clang_Type_getModifiedType = + _clang_Type_getModifiedType_ptr.asFunction(); /// Return the offset of the field represented by the Cursor. int clang_Cursor_getOffsetOfField( @@ -3150,11 +3260,10 @@ class LibClang { } late final _clang_Cursor_getOffsetOfField_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getOffsetOfField'); - late final _dart_clang_Cursor_getOffsetOfField - _clang_Cursor_getOffsetOfField = _clang_Cursor_getOffsetOfField_ptr - .asFunction<_dart_clang_Cursor_getOffsetOfField>(); + late final _clang_Cursor_getOffsetOfField = + _clang_Cursor_getOffsetOfField_ptr.asFunction(); /// Determine whether the given cursor represents an anonymous tag or /// namespace @@ -3167,11 +3276,10 @@ class LibClang { } late final _clang_Cursor_isAnonymous_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isAnonymous'); - late final _dart_clang_Cursor_isAnonymous _clang_Cursor_isAnonymous = - _clang_Cursor_isAnonymous_ptr - .asFunction<_dart_clang_Cursor_isAnonymous>(); + late final _clang_Cursor_isAnonymous = + _clang_Cursor_isAnonymous_ptr.asFunction(); /// Determine whether the given cursor represents an anonymous record /// declaration. @@ -3184,12 +3292,11 @@ class LibClang { } late final _clang_Cursor_isAnonymousRecordDecl_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isAnonymousRecordDecl'); - late final _dart_clang_Cursor_isAnonymousRecordDecl - _clang_Cursor_isAnonymousRecordDecl = + late final _clang_Cursor_isAnonymousRecordDecl = _clang_Cursor_isAnonymousRecordDecl_ptr - .asFunction<_dart_clang_Cursor_isAnonymousRecordDecl>(); + .asFunction(); /// Determine whether the given cursor represents an inline namespace /// declaration. @@ -3202,11 +3309,10 @@ class LibClang { } late final _clang_Cursor_isInlineNamespace_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isInlineNamespace'); - late final _dart_clang_Cursor_isInlineNamespace - _clang_Cursor_isInlineNamespace = _clang_Cursor_isInlineNamespace_ptr - .asFunction<_dart_clang_Cursor_isInlineNamespace>(); + late final _clang_Cursor_isInlineNamespace = + _clang_Cursor_isInlineNamespace_ptr.asFunction(); /// Returns the number of template arguments for given template /// specialization, or -1 if type T is not a template specialization. @@ -3219,12 +3325,11 @@ class LibClang { } late final _clang_Type_getNumTemplateArguments_ptr = - _lookup>( + _lookup>( 'clang_Type_getNumTemplateArguments'); - late final _dart_clang_Type_getNumTemplateArguments - _clang_Type_getNumTemplateArguments = + late final _clang_Type_getNumTemplateArguments = _clang_Type_getNumTemplateArguments_ptr - .asFunction<_dart_clang_Type_getNumTemplateArguments>(); + .asFunction(); /// Returns the type template argument of a template class specialization at /// given index. @@ -3239,12 +3344,11 @@ class LibClang { } late final _clang_Type_getTemplateArgumentAsType_ptr = - _lookup>( + _lookup>( 'clang_Type_getTemplateArgumentAsType'); - late final _dart_clang_Type_getTemplateArgumentAsType - _clang_Type_getTemplateArgumentAsType = + late final _clang_Type_getTemplateArgumentAsType = _clang_Type_getTemplateArgumentAsType_ptr - .asFunction<_dart_clang_Type_getTemplateArgumentAsType>(); + .asFunction(); /// Retrieve the ref-qualifier kind of a function or method. int clang_Type_getCXXRefQualifier( @@ -3256,11 +3360,10 @@ class LibClang { } late final _clang_Type_getCXXRefQualifier_ptr = - _lookup>( + _lookup>( 'clang_Type_getCXXRefQualifier'); - late final _dart_clang_Type_getCXXRefQualifier - _clang_Type_getCXXRefQualifier = _clang_Type_getCXXRefQualifier_ptr - .asFunction<_dart_clang_Type_getCXXRefQualifier>(); + late final _clang_Type_getCXXRefQualifier = + _clang_Type_getCXXRefQualifier_ptr.asFunction(); /// Returns non-zero if the cursor specifies a Record member that is a /// bitfield. @@ -3273,10 +3376,10 @@ class LibClang { } late final _clang_Cursor_isBitField_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isBitField'); - late final _dart_clang_Cursor_isBitField _clang_Cursor_isBitField = - _clang_Cursor_isBitField_ptr.asFunction<_dart_clang_Cursor_isBitField>(); + late final _clang_Cursor_isBitField = + _clang_Cursor_isBitField_ptr.asFunction(); /// Returns 1 if the base class specified by the cursor with kind /// CX_CXXBaseSpecifier is virtual. @@ -3289,10 +3392,10 @@ class LibClang { } late final _clang_isVirtualBase_ptr = - _lookup>( + _lookup>( 'clang_isVirtualBase'); - late final _dart_clang_isVirtualBase _clang_isVirtualBase = - _clang_isVirtualBase_ptr.asFunction<_dart_clang_isVirtualBase>(); + late final _clang_isVirtualBase = + _clang_isVirtualBase_ptr.asFunction(); /// Returns the access control level for the referenced object. int clang_getCXXAccessSpecifier( @@ -3304,11 +3407,10 @@ class LibClang { } late final _clang_getCXXAccessSpecifier_ptr = - _lookup>( + _lookup>( 'clang_getCXXAccessSpecifier'); - late final _dart_clang_getCXXAccessSpecifier _clang_getCXXAccessSpecifier = - _clang_getCXXAccessSpecifier_ptr - .asFunction<_dart_clang_getCXXAccessSpecifier>(); + late final _clang_getCXXAccessSpecifier = + _clang_getCXXAccessSpecifier_ptr.asFunction(); /// Returns the storage class for a function or variable declaration. int clang_Cursor_getStorageClass( @@ -3320,11 +3422,10 @@ class LibClang { } late final _clang_Cursor_getStorageClass_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getStorageClass'); - late final _dart_clang_Cursor_getStorageClass _clang_Cursor_getStorageClass = - _clang_Cursor_getStorageClass_ptr - .asFunction<_dart_clang_Cursor_getStorageClass>(); + late final _clang_Cursor_getStorageClass = + _clang_Cursor_getStorageClass_ptr.asFunction(); /// Determine the number of overloaded declarations referenced by a /// CXCursor_OverloadedDeclRef cursor. @@ -3337,11 +3438,10 @@ class LibClang { } late final _clang_getNumOverloadedDecls_ptr = - _lookup>( + _lookup>( 'clang_getNumOverloadedDecls'); - late final _dart_clang_getNumOverloadedDecls _clang_getNumOverloadedDecls = - _clang_getNumOverloadedDecls_ptr - .asFunction<_dart_clang_getNumOverloadedDecls>(); + late final _clang_getNumOverloadedDecls = + _clang_getNumOverloadedDecls_ptr.asFunction(); /// Retrieve a cursor for one of the overloaded declarations referenced by a /// CXCursor_OverloadedDeclRef cursor. @@ -3356,10 +3456,10 @@ class LibClang { } late final _clang_getOverloadedDecl_ptr = - _lookup>( + _lookup>( 'clang_getOverloadedDecl'); - late final _dart_clang_getOverloadedDecl _clang_getOverloadedDecl = - _clang_getOverloadedDecl_ptr.asFunction<_dart_clang_getOverloadedDecl>(); + late final _clang_getOverloadedDecl = _clang_getOverloadedDecl_ptr + .asFunction(); /// For cursors representing an iboutletcollection attribute, this function /// returns the collection element type. @@ -3372,17 +3472,17 @@ class LibClang { } late final _clang_getIBOutletCollectionType_ptr = - _lookup>( + _lookup>( 'clang_getIBOutletCollectionType'); - late final _dart_clang_getIBOutletCollectionType - _clang_getIBOutletCollectionType = _clang_getIBOutletCollectionType_ptr - .asFunction<_dart_clang_getIBOutletCollectionType>(); + late final _clang_getIBOutletCollectionType = + _clang_getIBOutletCollectionType_ptr + .asFunction(); /// Visit the children of a particular cursor. int clang_visitChildren( CXCursor parent, - ffi.Pointer> visitor, - ffi.Pointer client_data, + CXCursorVisitor visitor, + CXClientData client_data, ) { return _clang_visitChildren( parent, @@ -3391,11 +3491,12 @@ class LibClang { ); } - late final _clang_visitChildren_ptr = - _lookup>( - 'clang_visitChildren'); - late final _dart_clang_visitChildren _clang_visitChildren = - _clang_visitChildren_ptr.asFunction<_dart_clang_visitChildren>(); + late final _clang_visitChildren_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint32 Function( + CXCursor, CXCursorVisitor, CXClientData)>>('clang_visitChildren'); + late final _clang_visitChildren = _clang_visitChildren_ptr + .asFunction(); /// Retrieve a Unified Symbol Resolution (USR) for the entity referenced by /// the given cursor. @@ -3408,9 +3509,10 @@ class LibClang { } late final _clang_getCursorUSR_ptr = - _lookup>('clang_getCursorUSR'); - late final _dart_clang_getCursorUSR _clang_getCursorUSR = - _clang_getCursorUSR_ptr.asFunction<_dart_clang_getCursorUSR>(); + _lookup>( + 'clang_getCursorUSR'); + late final _clang_getCursorUSR = + _clang_getCursorUSR_ptr.asFunction(); /// Construct a USR for a specified Objective-C class. CXString clang_constructUSR_ObjCClass( @@ -3422,11 +3524,10 @@ class LibClang { } late final _clang_constructUSR_ObjCClass_ptr = - _lookup>( + _lookup)>>( 'clang_constructUSR_ObjCClass'); - late final _dart_clang_constructUSR_ObjCClass _clang_constructUSR_ObjCClass = - _clang_constructUSR_ObjCClass_ptr - .asFunction<_dart_clang_constructUSR_ObjCClass>(); + late final _clang_constructUSR_ObjCClass = _clang_constructUSR_ObjCClass_ptr + .asFunction)>(); /// Construct a USR for a specified Objective-C category. CXString clang_constructUSR_ObjCCategory( @@ -3439,12 +3540,13 @@ class LibClang { ); } - late final _clang_constructUSR_ObjCCategory_ptr = - _lookup>( - 'clang_constructUSR_ObjCCategory'); - late final _dart_clang_constructUSR_ObjCCategory - _clang_constructUSR_ObjCCategory = _clang_constructUSR_ObjCCategory_ptr - .asFunction<_dart_clang_constructUSR_ObjCCategory>(); + late final _clang_constructUSR_ObjCCategory_ptr = _lookup< + ffi.NativeFunction< + CXString Function(ffi.Pointer, + ffi.Pointer)>>('clang_constructUSR_ObjCCategory'); + late final _clang_constructUSR_ObjCCategory = + _clang_constructUSR_ObjCCategory_ptr.asFunction< + CXString Function(ffi.Pointer, ffi.Pointer)>(); /// Construct a USR for a specified Objective-C protocol. CXString clang_constructUSR_ObjCProtocol( @@ -3456,11 +3558,11 @@ class LibClang { } late final _clang_constructUSR_ObjCProtocol_ptr = - _lookup>( + _lookup)>>( 'clang_constructUSR_ObjCProtocol'); - late final _dart_clang_constructUSR_ObjCProtocol - _clang_constructUSR_ObjCProtocol = _clang_constructUSR_ObjCProtocol_ptr - .asFunction<_dart_clang_constructUSR_ObjCProtocol>(); + late final _clang_constructUSR_ObjCProtocol = + _clang_constructUSR_ObjCProtocol_ptr + .asFunction)>(); /// Construct a USR for a specified Objective-C instance variable and the USR /// for its containing class. @@ -3474,12 +3576,12 @@ class LibClang { ); } - late final _clang_constructUSR_ObjCIvar_ptr = - _lookup>( - 'clang_constructUSR_ObjCIvar'); - late final _dart_clang_constructUSR_ObjCIvar _clang_constructUSR_ObjCIvar = - _clang_constructUSR_ObjCIvar_ptr - .asFunction<_dart_clang_constructUSR_ObjCIvar>(); + late final _clang_constructUSR_ObjCIvar_ptr = _lookup< + ffi.NativeFunction< + CXString Function( + ffi.Pointer, CXString)>>('clang_constructUSR_ObjCIvar'); + late final _clang_constructUSR_ObjCIvar = _clang_constructUSR_ObjCIvar_ptr + .asFunction, CXString)>(); /// Construct a USR for a specified Objective-C method and the USR for its /// containing class. @@ -3495,12 +3597,12 @@ class LibClang { ); } - late final _clang_constructUSR_ObjCMethod_ptr = - _lookup>( - 'clang_constructUSR_ObjCMethod'); - late final _dart_clang_constructUSR_ObjCMethod - _clang_constructUSR_ObjCMethod = _clang_constructUSR_ObjCMethod_ptr - .asFunction<_dart_clang_constructUSR_ObjCMethod>(); + late final _clang_constructUSR_ObjCMethod_ptr = _lookup< + ffi.NativeFunction< + CXString Function(ffi.Pointer, ffi.Uint32, + CXString)>>('clang_constructUSR_ObjCMethod'); + late final _clang_constructUSR_ObjCMethod = _clang_constructUSR_ObjCMethod_ptr + .asFunction, int, CXString)>(); /// Construct a USR for a specified Objective-C property and the USR for its /// containing class. @@ -3514,12 +3616,13 @@ class LibClang { ); } - late final _clang_constructUSR_ObjCProperty_ptr = - _lookup>( - 'clang_constructUSR_ObjCProperty'); - late final _dart_clang_constructUSR_ObjCProperty - _clang_constructUSR_ObjCProperty = _clang_constructUSR_ObjCProperty_ptr - .asFunction<_dart_clang_constructUSR_ObjCProperty>(); + late final _clang_constructUSR_ObjCProperty_ptr = _lookup< + ffi.NativeFunction< + CXString Function(ffi.Pointer, + CXString)>>('clang_constructUSR_ObjCProperty'); + late final _clang_constructUSR_ObjCProperty = + _clang_constructUSR_ObjCProperty_ptr + .asFunction, CXString)>(); /// Retrieve a name for the entity referenced by this cursor. CXString clang_getCursorSpelling( @@ -3531,10 +3634,10 @@ class LibClang { } late final _clang_getCursorSpelling_ptr = - _lookup>( + _lookup>( 'clang_getCursorSpelling'); - late final _dart_clang_getCursorSpelling _clang_getCursorSpelling = - _clang_getCursorSpelling_ptr.asFunction<_dart_clang_getCursorSpelling>(); + late final _clang_getCursorSpelling = + _clang_getCursorSpelling_ptr.asFunction(); /// 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 @@ -3552,17 +3655,17 @@ class LibClang { ); } - late final _clang_Cursor_getSpellingNameRange_ptr = - _lookup>( - 'clang_Cursor_getSpellingNameRange'); - late final _dart_clang_Cursor_getSpellingNameRange - _clang_Cursor_getSpellingNameRange = + late final _clang_Cursor_getSpellingNameRange_ptr = _lookup< + ffi.NativeFunction< + CXSourceRange Function(CXCursor, ffi.Uint32, + ffi.Uint32)>>('clang_Cursor_getSpellingNameRange'); + late final _clang_Cursor_getSpellingNameRange = _clang_Cursor_getSpellingNameRange_ptr - .asFunction<_dart_clang_Cursor_getSpellingNameRange>(); + .asFunction(); /// Get a property value for the given printing policy. int clang_PrintingPolicy_getProperty( - ffi.Pointer Policy, + CXPrintingPolicy Policy, int Property, ) { return _clang_PrintingPolicy_getProperty( @@ -3571,16 +3674,16 @@ class LibClang { ); } - late final _clang_PrintingPolicy_getProperty_ptr = - _lookup>( - 'clang_PrintingPolicy_getProperty'); - late final _dart_clang_PrintingPolicy_getProperty - _clang_PrintingPolicy_getProperty = _clang_PrintingPolicy_getProperty_ptr - .asFunction<_dart_clang_PrintingPolicy_getProperty>(); + late final _clang_PrintingPolicy_getProperty_ptr = _lookup< + ffi.NativeFunction>( + 'clang_PrintingPolicy_getProperty'); + late final _clang_PrintingPolicy_getProperty = + _clang_PrintingPolicy_getProperty_ptr + .asFunction(); /// Set a property value for the given printing policy. void clang_PrintingPolicy_setProperty( - ffi.Pointer Policy, + CXPrintingPolicy Policy, int Property, int Value, ) { @@ -3591,15 +3694,16 @@ class LibClang { ); } - late final _clang_PrintingPolicy_setProperty_ptr = - _lookup>( - 'clang_PrintingPolicy_setProperty'); - late final _dart_clang_PrintingPolicy_setProperty - _clang_PrintingPolicy_setProperty = _clang_PrintingPolicy_setProperty_ptr - .asFunction<_dart_clang_PrintingPolicy_setProperty>(); + late final _clang_PrintingPolicy_setProperty_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CXPrintingPolicy, ffi.Int32, + ffi.Uint32)>>('clang_PrintingPolicy_setProperty'); + late final _clang_PrintingPolicy_setProperty = + _clang_PrintingPolicy_setProperty_ptr + .asFunction(); /// Retrieve the default policy for the cursor. - ffi.Pointer clang_getCursorPrintingPolicy( + CXPrintingPolicy clang_getCursorPrintingPolicy( CXCursor arg0, ) { return _clang_getCursorPrintingPolicy( @@ -3608,15 +3712,14 @@ class LibClang { } late final _clang_getCursorPrintingPolicy_ptr = - _lookup>( + _lookup>( 'clang_getCursorPrintingPolicy'); - late final _dart_clang_getCursorPrintingPolicy - _clang_getCursorPrintingPolicy = _clang_getCursorPrintingPolicy_ptr - .asFunction<_dart_clang_getCursorPrintingPolicy>(); + late final _clang_getCursorPrintingPolicy = _clang_getCursorPrintingPolicy_ptr + .asFunction(); /// Release a printing policy. void clang_PrintingPolicy_dispose( - ffi.Pointer Policy, + CXPrintingPolicy Policy, ) { return _clang_PrintingPolicy_dispose( Policy, @@ -3624,16 +3727,15 @@ class LibClang { } late final _clang_PrintingPolicy_dispose_ptr = - _lookup>( + _lookup>( 'clang_PrintingPolicy_dispose'); - late final _dart_clang_PrintingPolicy_dispose _clang_PrintingPolicy_dispose = - _clang_PrintingPolicy_dispose_ptr - .asFunction<_dart_clang_PrintingPolicy_dispose>(); + late final _clang_PrintingPolicy_dispose = _clang_PrintingPolicy_dispose_ptr + .asFunction(); /// Pretty print declarations. CXString clang_getCursorPrettyPrinted( CXCursor Cursor, - ffi.Pointer Policy, + CXPrintingPolicy Policy, ) { return _clang_getCursorPrettyPrinted( Cursor, @@ -3641,12 +3743,11 @@ class LibClang { ); } - late final _clang_getCursorPrettyPrinted_ptr = - _lookup>( - 'clang_getCursorPrettyPrinted'); - late final _dart_clang_getCursorPrettyPrinted _clang_getCursorPrettyPrinted = - _clang_getCursorPrettyPrinted_ptr - .asFunction<_dart_clang_getCursorPrettyPrinted>(); + late final _clang_getCursorPrettyPrinted_ptr = _lookup< + ffi.NativeFunction>( + 'clang_getCursorPrettyPrinted'); + late final _clang_getCursorPrettyPrinted = _clang_getCursorPrettyPrinted_ptr + .asFunction(); /// Retrieve the display name for the entity referenced by this cursor. CXString clang_getCursorDisplayName( @@ -3658,11 +3759,10 @@ class LibClang { } late final _clang_getCursorDisplayName_ptr = - _lookup>( + _lookup>( 'clang_getCursorDisplayName'); - late final _dart_clang_getCursorDisplayName _clang_getCursorDisplayName = - _clang_getCursorDisplayName_ptr - .asFunction<_dart_clang_getCursorDisplayName>(); + late final _clang_getCursorDisplayName = + _clang_getCursorDisplayName_ptr.asFunction(); /// For a cursor that is a reference, retrieve a cursor representing the /// entity that it references. @@ -3675,11 +3775,10 @@ class LibClang { } late final _clang_getCursorReferenced_ptr = - _lookup>( + _lookup>( 'clang_getCursorReferenced'); - late final _dart_clang_getCursorReferenced _clang_getCursorReferenced = - _clang_getCursorReferenced_ptr - .asFunction<_dart_clang_getCursorReferenced>(); + late final _clang_getCursorReferenced = + _clang_getCursorReferenced_ptr.asFunction(); /// 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. @@ -3692,11 +3791,10 @@ class LibClang { } late final _clang_getCursorDefinition_ptr = - _lookup>( + _lookup>( 'clang_getCursorDefinition'); - late final _dart_clang_getCursorDefinition _clang_getCursorDefinition = - _clang_getCursorDefinition_ptr - .asFunction<_dart_clang_getCursorDefinition>(); + late final _clang_getCursorDefinition = + _clang_getCursorDefinition_ptr.asFunction(); /// Determine whether the declaration pointed to by this cursor is also a /// definition of that entity. @@ -3709,11 +3807,10 @@ class LibClang { } late final _clang_isCursorDefinition_ptr = - _lookup>( + _lookup>( 'clang_isCursorDefinition'); - late final _dart_clang_isCursorDefinition _clang_isCursorDefinition = - _clang_isCursorDefinition_ptr - .asFunction<_dart_clang_isCursorDefinition>(); + late final _clang_isCursorDefinition = + _clang_isCursorDefinition_ptr.asFunction(); /// Retrieve the canonical cursor corresponding to the given cursor. CXCursor clang_getCanonicalCursor( @@ -3725,11 +3822,10 @@ class LibClang { } late final _clang_getCanonicalCursor_ptr = - _lookup>( + _lookup>( 'clang_getCanonicalCursor'); - late final _dart_clang_getCanonicalCursor _clang_getCanonicalCursor = - _clang_getCanonicalCursor_ptr - .asFunction<_dart_clang_getCanonicalCursor>(); + late final _clang_getCanonicalCursor = + _clang_getCanonicalCursor_ptr.asFunction(); /// If the cursor points to a selector identifier in an Objective-C method or /// message expression, this returns the selector index. @@ -3742,12 +3838,11 @@ class LibClang { } late final _clang_Cursor_getObjCSelectorIndex_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getObjCSelectorIndex'); - late final _dart_clang_Cursor_getObjCSelectorIndex - _clang_Cursor_getObjCSelectorIndex = + late final _clang_Cursor_getObjCSelectorIndex = _clang_Cursor_getObjCSelectorIndex_ptr - .asFunction<_dart_clang_Cursor_getObjCSelectorIndex>(); + .asFunction(); /// Given a cursor pointing to a C++ method call or an Objective-C message, /// returns non-zero if the method/message is "dynamic", meaning: @@ -3760,11 +3855,10 @@ class LibClang { } late final _clang_Cursor_isDynamicCall_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isDynamicCall'); - late final _dart_clang_Cursor_isDynamicCall _clang_Cursor_isDynamicCall = - _clang_Cursor_isDynamicCall_ptr - .asFunction<_dart_clang_Cursor_isDynamicCall>(); + late final _clang_Cursor_isDynamicCall = + _clang_Cursor_isDynamicCall_ptr.asFunction(); /// Given a cursor pointing to an Objective-C message or property reference, /// or C++ method call, returns the CXType of the receiver. @@ -3777,11 +3871,10 @@ class LibClang { } late final _clang_Cursor_getReceiverType_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getReceiverType'); - late final _dart_clang_Cursor_getReceiverType _clang_Cursor_getReceiverType = - _clang_Cursor_getReceiverType_ptr - .asFunction<_dart_clang_Cursor_getReceiverType>(); + late final _clang_Cursor_getReceiverType = + _clang_Cursor_getReceiverType_ptr.asFunction(); /// Given a cursor that represents a property declaration, return the /// associated property attributes. The bits are formed from @@ -3797,12 +3890,11 @@ class LibClang { } late final _clang_Cursor_getObjCPropertyAttributes_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getObjCPropertyAttributes'); - late final _dart_clang_Cursor_getObjCPropertyAttributes - _clang_Cursor_getObjCPropertyAttributes = + late final _clang_Cursor_getObjCPropertyAttributes = _clang_Cursor_getObjCPropertyAttributes_ptr - .asFunction<_dart_clang_Cursor_getObjCPropertyAttributes>(); + .asFunction(); /// Given a cursor that represents a property declaration, return the name of /// the method that implements the getter. @@ -3815,12 +3907,11 @@ class LibClang { } late final _clang_Cursor_getObjCPropertyGetterName_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getObjCPropertyGetterName'); - late final _dart_clang_Cursor_getObjCPropertyGetterName - _clang_Cursor_getObjCPropertyGetterName = + late final _clang_Cursor_getObjCPropertyGetterName = _clang_Cursor_getObjCPropertyGetterName_ptr - .asFunction<_dart_clang_Cursor_getObjCPropertyGetterName>(); + .asFunction(); /// Given a cursor that represents a property declaration, return the name of /// the method that implements the setter, if any. @@ -3833,12 +3924,11 @@ class LibClang { } late final _clang_Cursor_getObjCPropertySetterName_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getObjCPropertySetterName'); - late final _dart_clang_Cursor_getObjCPropertySetterName - _clang_Cursor_getObjCPropertySetterName = + late final _clang_Cursor_getObjCPropertySetterName = _clang_Cursor_getObjCPropertySetterName_ptr - .asFunction<_dart_clang_Cursor_getObjCPropertySetterName>(); + .asFunction(); /// Given a cursor that represents an Objective-C method or parameter /// declaration, return the associated Objective-C qualifiers for the return @@ -3853,12 +3943,11 @@ class LibClang { } late final _clang_Cursor_getObjCDeclQualifiers_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getObjCDeclQualifiers'); - late final _dart_clang_Cursor_getObjCDeclQualifiers - _clang_Cursor_getObjCDeclQualifiers = + late final _clang_Cursor_getObjCDeclQualifiers = _clang_Cursor_getObjCDeclQualifiers_ptr - .asFunction<_dart_clang_Cursor_getObjCDeclQualifiers>(); + .asFunction(); /// Given a cursor that represents an Objective-C method or property /// declaration, return non-zero if the declaration was affected by @@ -3873,11 +3962,10 @@ class LibClang { } late final _clang_Cursor_isObjCOptional_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isObjCOptional'); - late final _dart_clang_Cursor_isObjCOptional _clang_Cursor_isObjCOptional = - _clang_Cursor_isObjCOptional_ptr - .asFunction<_dart_clang_Cursor_isObjCOptional>(); + late final _clang_Cursor_isObjCOptional = + _clang_Cursor_isObjCOptional_ptr.asFunction(); /// Returns non-zero if the given cursor is a variadic function or method. int clang_Cursor_isVariadic( @@ -3889,10 +3977,10 @@ class LibClang { } late final _clang_Cursor_isVariadic_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isVariadic'); - late final _dart_clang_Cursor_isVariadic _clang_Cursor_isVariadic = - _clang_Cursor_isVariadic_ptr.asFunction<_dart_clang_Cursor_isVariadic>(); + late final _clang_Cursor_isVariadic = + _clang_Cursor_isVariadic_ptr.asFunction(); /// Returns non-zero if the given cursor points to a symbol marked with /// external_source_symbol attribute. @@ -3910,12 +3998,17 @@ class LibClang { ); } - late final _clang_Cursor_isExternalSymbol_ptr = - _lookup>( - 'clang_Cursor_isExternalSymbol'); - late final _dart_clang_Cursor_isExternalSymbol - _clang_Cursor_isExternalSymbol = _clang_Cursor_isExternalSymbol_ptr - .asFunction<_dart_clang_Cursor_isExternalSymbol>(); + late final _clang_Cursor_isExternalSymbol_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint32 Function( + CXCursor, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_Cursor_isExternalSymbol'); + late final _clang_Cursor_isExternalSymbol = + _clang_Cursor_isExternalSymbol_ptr.asFunction< + int Function(CXCursor, ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Given a cursor that represents a declaration, return the associated /// comment's source range. The range may include multiple consecutive @@ -3929,11 +4022,10 @@ class LibClang { } late final _clang_Cursor_getCommentRange_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getCommentRange'); - late final _dart_clang_Cursor_getCommentRange _clang_Cursor_getCommentRange = - _clang_Cursor_getCommentRange_ptr - .asFunction<_dart_clang_Cursor_getCommentRange>(); + late final _clang_Cursor_getCommentRange = _clang_Cursor_getCommentRange_ptr + .asFunction(); /// Given a cursor that represents a declaration, return the associated /// comment text, including comment markers. @@ -3946,11 +4038,11 @@ class LibClang { } late final _clang_Cursor_getRawCommentText_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getRawCommentText'); - late final _dart_clang_Cursor_getRawCommentText - _clang_Cursor_getRawCommentText = _clang_Cursor_getRawCommentText_ptr - .asFunction<_dart_clang_Cursor_getRawCommentText>(); + late final _clang_Cursor_getRawCommentText = + _clang_Cursor_getRawCommentText_ptr + .asFunction(); /// Given a cursor that represents a documentable entity (e.g., declaration), /// return the associated first paragraph. @@ -3963,11 +4055,11 @@ class LibClang { } late final _clang_Cursor_getBriefCommentText_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getBriefCommentText'); - late final _dart_clang_Cursor_getBriefCommentText - _clang_Cursor_getBriefCommentText = _clang_Cursor_getBriefCommentText_ptr - .asFunction<_dart_clang_Cursor_getBriefCommentText>(); + late final _clang_Cursor_getBriefCommentText = + _clang_Cursor_getBriefCommentText_ptr + .asFunction(); /// Retrieve the CXString representing the mangled name of the cursor. CXString clang_Cursor_getMangling( @@ -3979,11 +4071,10 @@ class LibClang { } late final _clang_Cursor_getMangling_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getMangling'); - late final _dart_clang_Cursor_getMangling _clang_Cursor_getMangling = - _clang_Cursor_getMangling_ptr - .asFunction<_dart_clang_Cursor_getMangling>(); + late final _clang_Cursor_getMangling = + _clang_Cursor_getMangling_ptr.asFunction(); /// Retrieve the CXStrings representing the mangled symbols of the C++ /// constructor or destructor at the cursor. @@ -3996,11 +4087,10 @@ class LibClang { } late final _clang_Cursor_getCXXManglings_ptr = - _lookup>( + _lookup Function(CXCursor)>>( 'clang_Cursor_getCXXManglings'); - late final _dart_clang_Cursor_getCXXManglings _clang_Cursor_getCXXManglings = - _clang_Cursor_getCXXManglings_ptr - .asFunction<_dart_clang_Cursor_getCXXManglings>(); + late final _clang_Cursor_getCXXManglings = _clang_Cursor_getCXXManglings_ptr + .asFunction Function(CXCursor)>(); /// Retrieve the CXStrings representing the mangled symbols of the ObjC class /// interface or implementation at the cursor. @@ -4013,14 +4103,13 @@ class LibClang { } late final _clang_Cursor_getObjCManglings_ptr = - _lookup>( + _lookup Function(CXCursor)>>( 'clang_Cursor_getObjCManglings'); - late final _dart_clang_Cursor_getObjCManglings - _clang_Cursor_getObjCManglings = _clang_Cursor_getObjCManglings_ptr - .asFunction<_dart_clang_Cursor_getObjCManglings>(); + late final _clang_Cursor_getObjCManglings = _clang_Cursor_getObjCManglings_ptr + .asFunction Function(CXCursor)>(); /// Given a CXCursor_ModuleImportDecl cursor, return the associated module. - ffi.Pointer clang_Cursor_getModule( + CXModule clang_Cursor_getModule( CXCursor C, ) { return _clang_Cursor_getModule( @@ -4029,16 +4118,16 @@ class LibClang { } late final _clang_Cursor_getModule_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getModule'); - late final _dart_clang_Cursor_getModule _clang_Cursor_getModule = - _clang_Cursor_getModule_ptr.asFunction<_dart_clang_Cursor_getModule>(); + late final _clang_Cursor_getModule = + _clang_Cursor_getModule_ptr.asFunction(); /// Given a CXFile header file, return the module that contains it, if one /// exists. - ffi.Pointer clang_getModuleForFile( - ffi.Pointer arg0, - ffi.Pointer arg1, + CXModule clang_getModuleForFile( + CXTranslationUnit arg0, + CXFile arg1, ) { return _clang_getModuleForFile( arg0, @@ -4047,14 +4136,14 @@ class LibClang { } late final _clang_getModuleForFile_ptr = - _lookup>( + _lookup>( 'clang_getModuleForFile'); - late final _dart_clang_getModuleForFile _clang_getModuleForFile = - _clang_getModuleForFile_ptr.asFunction<_dart_clang_getModuleForFile>(); + late final _clang_getModuleForFile = _clang_getModuleForFile_ptr + .asFunction(); /// Returns the module file where the provided module object came from. - ffi.Pointer clang_Module_getASTFile( - ffi.Pointer Module, + CXFile clang_Module_getASTFile( + CXModule Module, ) { return _clang_Module_getASTFile( Module, @@ -4062,15 +4151,15 @@ class LibClang { } late final _clang_Module_getASTFile_ptr = - _lookup>( + _lookup>( 'clang_Module_getASTFile'); - late final _dart_clang_Module_getASTFile _clang_Module_getASTFile = - _clang_Module_getASTFile_ptr.asFunction<_dart_clang_Module_getASTFile>(); + late final _clang_Module_getASTFile = + _clang_Module_getASTFile_ptr.asFunction(); /// 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, + CXModule clang_Module_getParent( + CXModule Module, ) { return _clang_Module_getParent( Module, @@ -4078,15 +4167,15 @@ class LibClang { } late final _clang_Module_getParent_ptr = - _lookup>( + _lookup>( 'clang_Module_getParent'); - late final _dart_clang_Module_getParent _clang_Module_getParent = - _clang_Module_getParent_ptr.asFunction<_dart_clang_Module_getParent>(); + late final _clang_Module_getParent = + _clang_Module_getParent_ptr.asFunction(); /// 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, + CXModule Module, ) { return _clang_Module_getName( Module, @@ -4094,14 +4183,14 @@ class LibClang { } late final _clang_Module_getName_ptr = - _lookup>( + _lookup>( 'clang_Module_getName'); - late final _dart_clang_Module_getName _clang_Module_getName = - _clang_Module_getName_ptr.asFunction<_dart_clang_Module_getName>(); + late final _clang_Module_getName = + _clang_Module_getName_ptr.asFunction(); /// Returns the full name of the module, e.g. "std.vector". CXString clang_Module_getFullName( - ffi.Pointer Module, + CXModule Module, ) { return _clang_Module_getFullName( Module, @@ -4109,15 +4198,14 @@ class LibClang { } late final _clang_Module_getFullName_ptr = - _lookup>( + _lookup>( 'clang_Module_getFullName'); - late final _dart_clang_Module_getFullName _clang_Module_getFullName = - _clang_Module_getFullName_ptr - .asFunction<_dart_clang_Module_getFullName>(); + late final _clang_Module_getFullName = + _clang_Module_getFullName_ptr.asFunction(); /// Returns non-zero if the module is a system one. int clang_Module_isSystem( - ffi.Pointer Module, + CXModule Module, ) { return _clang_Module_isSystem( Module, @@ -4125,15 +4213,15 @@ class LibClang { } late final _clang_Module_isSystem_ptr = - _lookup>( + _lookup>( 'clang_Module_isSystem'); - late final _dart_clang_Module_isSystem _clang_Module_isSystem = - _clang_Module_isSystem_ptr.asFunction<_dart_clang_Module_isSystem>(); + late final _clang_Module_isSystem = + _clang_Module_isSystem_ptr.asFunction(); /// Returns the number of top level headers associated with this module. int clang_Module_getNumTopLevelHeaders( - ffi.Pointer arg0, - ffi.Pointer Module, + CXTranslationUnit arg0, + CXModule Module, ) { return _clang_Module_getNumTopLevelHeaders( arg0, @@ -4141,18 +4229,17 @@ class LibClang { ); } - late final _clang_Module_getNumTopLevelHeaders_ptr = - _lookup>( - 'clang_Module_getNumTopLevelHeaders'); - late final _dart_clang_Module_getNumTopLevelHeaders - _clang_Module_getNumTopLevelHeaders = + late final _clang_Module_getNumTopLevelHeaders_ptr = _lookup< + ffi.NativeFunction>( + 'clang_Module_getNumTopLevelHeaders'); + late final _clang_Module_getNumTopLevelHeaders = _clang_Module_getNumTopLevelHeaders_ptr - .asFunction<_dart_clang_Module_getNumTopLevelHeaders>(); + .asFunction(); /// Returns the specified top level header associated with the module. - ffi.Pointer clang_Module_getTopLevelHeader( - ffi.Pointer arg0, - ffi.Pointer Module, + CXFile clang_Module_getTopLevelHeader( + CXTranslationUnit arg0, + CXModule Module, int Index, ) { return _clang_Module_getTopLevelHeader( @@ -4162,12 +4249,13 @@ class LibClang { ); } - late final _clang_Module_getTopLevelHeader_ptr = - _lookup>( - 'clang_Module_getTopLevelHeader'); - late final _dart_clang_Module_getTopLevelHeader - _clang_Module_getTopLevelHeader = _clang_Module_getTopLevelHeader_ptr - .asFunction<_dart_clang_Module_getTopLevelHeader>(); + late final _clang_Module_getTopLevelHeader_ptr = _lookup< + ffi.NativeFunction< + CXFile Function(CXTranslationUnit, CXModule, + ffi.Uint32)>>('clang_Module_getTopLevelHeader'); + late final _clang_Module_getTopLevelHeader = + _clang_Module_getTopLevelHeader_ptr + .asFunction(); /// Determine if a C++ constructor is a converting constructor. int clang_CXXConstructor_isConvertingConstructor( @@ -4178,13 +4266,12 @@ class LibClang { ); } - late final _clang_CXXConstructor_isConvertingConstructor_ptr = _lookup< - ffi.NativeFunction<_c_clang_CXXConstructor_isConvertingConstructor>>( - 'clang_CXXConstructor_isConvertingConstructor'); - late final _dart_clang_CXXConstructor_isConvertingConstructor - _clang_CXXConstructor_isConvertingConstructor = + late final _clang_CXXConstructor_isConvertingConstructor_ptr = + _lookup>( + 'clang_CXXConstructor_isConvertingConstructor'); + late final _clang_CXXConstructor_isConvertingConstructor = _clang_CXXConstructor_isConvertingConstructor_ptr - .asFunction<_dart_clang_CXXConstructor_isConvertingConstructor>(); + .asFunction(); /// Determine if a C++ constructor is a copy constructor. int clang_CXXConstructor_isCopyConstructor( @@ -4196,12 +4283,11 @@ class LibClang { } late final _clang_CXXConstructor_isCopyConstructor_ptr = - _lookup>( + _lookup>( 'clang_CXXConstructor_isCopyConstructor'); - late final _dart_clang_CXXConstructor_isCopyConstructor - _clang_CXXConstructor_isCopyConstructor = + late final _clang_CXXConstructor_isCopyConstructor = _clang_CXXConstructor_isCopyConstructor_ptr - .asFunction<_dart_clang_CXXConstructor_isCopyConstructor>(); + .asFunction(); /// Determine if a C++ constructor is the default constructor. int clang_CXXConstructor_isDefaultConstructor( @@ -4213,12 +4299,11 @@ class LibClang { } late final _clang_CXXConstructor_isDefaultConstructor_ptr = - _lookup>( + _lookup>( 'clang_CXXConstructor_isDefaultConstructor'); - late final _dart_clang_CXXConstructor_isDefaultConstructor - _clang_CXXConstructor_isDefaultConstructor = + late final _clang_CXXConstructor_isDefaultConstructor = _clang_CXXConstructor_isDefaultConstructor_ptr - .asFunction<_dart_clang_CXXConstructor_isDefaultConstructor>(); + .asFunction(); /// Determine if a C++ constructor is a move constructor. int clang_CXXConstructor_isMoveConstructor( @@ -4230,12 +4315,11 @@ class LibClang { } late final _clang_CXXConstructor_isMoveConstructor_ptr = - _lookup>( + _lookup>( 'clang_CXXConstructor_isMoveConstructor'); - late final _dart_clang_CXXConstructor_isMoveConstructor - _clang_CXXConstructor_isMoveConstructor = + late final _clang_CXXConstructor_isMoveConstructor = _clang_CXXConstructor_isMoveConstructor_ptr - .asFunction<_dart_clang_CXXConstructor_isMoveConstructor>(); + .asFunction(); /// Determine if a C++ field is declared 'mutable'. int clang_CXXField_isMutable( @@ -4247,11 +4331,10 @@ class LibClang { } late final _clang_CXXField_isMutable_ptr = - _lookup>( + _lookup>( 'clang_CXXField_isMutable'); - late final _dart_clang_CXXField_isMutable _clang_CXXField_isMutable = - _clang_CXXField_isMutable_ptr - .asFunction<_dart_clang_CXXField_isMutable>(); + late final _clang_CXXField_isMutable = + _clang_CXXField_isMutable_ptr.asFunction(); /// Determine if a C++ method is declared '= default'. int clang_CXXMethod_isDefaulted( @@ -4263,11 +4346,10 @@ class LibClang { } late final _clang_CXXMethod_isDefaulted_ptr = - _lookup>( + _lookup>( 'clang_CXXMethod_isDefaulted'); - late final _dart_clang_CXXMethod_isDefaulted _clang_CXXMethod_isDefaulted = - _clang_CXXMethod_isDefaulted_ptr - .asFunction<_dart_clang_CXXMethod_isDefaulted>(); + late final _clang_CXXMethod_isDefaulted = + _clang_CXXMethod_isDefaulted_ptr.asFunction(); /// Determine if a C++ member function or member function template is pure /// virtual. @@ -4280,11 +4362,10 @@ class LibClang { } late final _clang_CXXMethod_isPureVirtual_ptr = - _lookup>( + _lookup>( 'clang_CXXMethod_isPureVirtual'); - late final _dart_clang_CXXMethod_isPureVirtual - _clang_CXXMethod_isPureVirtual = _clang_CXXMethod_isPureVirtual_ptr - .asFunction<_dart_clang_CXXMethod_isPureVirtual>(); + late final _clang_CXXMethod_isPureVirtual = + _clang_CXXMethod_isPureVirtual_ptr.asFunction(); /// Determine if a C++ member function or member function template is declared /// 'static'. @@ -4297,11 +4378,10 @@ class LibClang { } late final _clang_CXXMethod_isStatic_ptr = - _lookup>( + _lookup>( 'clang_CXXMethod_isStatic'); - late final _dart_clang_CXXMethod_isStatic _clang_CXXMethod_isStatic = - _clang_CXXMethod_isStatic_ptr - .asFunction<_dart_clang_CXXMethod_isStatic>(); + late final _clang_CXXMethod_isStatic = + _clang_CXXMethod_isStatic_ptr.asFunction(); /// Determine if a C++ member function or member function template is /// explicitly declared 'virtual' or if it overrides a virtual method from one @@ -4315,11 +4395,10 @@ class LibClang { } late final _clang_CXXMethod_isVirtual_ptr = - _lookup>( + _lookup>( 'clang_CXXMethod_isVirtual'); - late final _dart_clang_CXXMethod_isVirtual _clang_CXXMethod_isVirtual = - _clang_CXXMethod_isVirtual_ptr - .asFunction<_dart_clang_CXXMethod_isVirtual>(); + late final _clang_CXXMethod_isVirtual = + _clang_CXXMethod_isVirtual_ptr.asFunction(); /// Determine if a C++ record is abstract, i.e. whether a class or struct has /// a pure virtual member function. @@ -4332,11 +4411,10 @@ class LibClang { } late final _clang_CXXRecord_isAbstract_ptr = - _lookup>( + _lookup>( 'clang_CXXRecord_isAbstract'); - late final _dart_clang_CXXRecord_isAbstract _clang_CXXRecord_isAbstract = - _clang_CXXRecord_isAbstract_ptr - .asFunction<_dart_clang_CXXRecord_isAbstract>(); + late final _clang_CXXRecord_isAbstract = + _clang_CXXRecord_isAbstract_ptr.asFunction(); /// Determine if an enum declaration refers to a scoped enum. int clang_EnumDecl_isScoped( @@ -4348,10 +4426,10 @@ class LibClang { } late final _clang_EnumDecl_isScoped_ptr = - _lookup>( + _lookup>( 'clang_EnumDecl_isScoped'); - late final _dart_clang_EnumDecl_isScoped _clang_EnumDecl_isScoped = - _clang_EnumDecl_isScoped_ptr.asFunction<_dart_clang_EnumDecl_isScoped>(); + late final _clang_EnumDecl_isScoped = + _clang_EnumDecl_isScoped_ptr.asFunction(); /// Determine if a C++ member function or member function template is declared /// 'const'. @@ -4364,10 +4442,10 @@ class LibClang { } late final _clang_CXXMethod_isConst_ptr = - _lookup>( + _lookup>( 'clang_CXXMethod_isConst'); - late final _dart_clang_CXXMethod_isConst _clang_CXXMethod_isConst = - _clang_CXXMethod_isConst_ptr.asFunction<_dart_clang_CXXMethod_isConst>(); + late final _clang_CXXMethod_isConst = + _clang_CXXMethod_isConst_ptr.asFunction(); /// Given a cursor that represents a template, determine the cursor kind of /// the specializations would be generated by instantiating the template. @@ -4380,11 +4458,10 @@ class LibClang { } late final _clang_getTemplateCursorKind_ptr = - _lookup>( + _lookup>( 'clang_getTemplateCursorKind'); - late final _dart_clang_getTemplateCursorKind _clang_getTemplateCursorKind = - _clang_getTemplateCursorKind_ptr - .asFunction<_dart_clang_getTemplateCursorKind>(); + late final _clang_getTemplateCursorKind = + _clang_getTemplateCursorKind_ptr.asFunction(); /// Given a cursor that may represent a specialization or instantiation of a /// template, retrieve the cursor that represents the template that it @@ -4398,12 +4475,11 @@ class LibClang { } late final _clang_getSpecializedCursorTemplate_ptr = - _lookup>( + _lookup>( 'clang_getSpecializedCursorTemplate'); - late final _dart_clang_getSpecializedCursorTemplate - _clang_getSpecializedCursorTemplate = + late final _clang_getSpecializedCursorTemplate = _clang_getSpecializedCursorTemplate_ptr - .asFunction<_dart_clang_getSpecializedCursorTemplate>(); + .asFunction(); /// Given a cursor that references something else, return the source range /// covering that reference. @@ -4419,17 +4495,17 @@ class LibClang { ); } - late final _clang_getCursorReferenceNameRange_ptr = - _lookup>( - 'clang_getCursorReferenceNameRange'); - late final _dart_clang_getCursorReferenceNameRange - _clang_getCursorReferenceNameRange = + late final _clang_getCursorReferenceNameRange_ptr = _lookup< + ffi.NativeFunction< + CXSourceRange Function(CXCursor, ffi.Uint32, + ffi.Uint32)>>('clang_getCursorReferenceNameRange'); + late final _clang_getCursorReferenceNameRange = _clang_getCursorReferenceNameRange_ptr - .asFunction<_dart_clang_getCursorReferenceNameRange>(); + .asFunction(); /// Get the raw lexical token starting with the given location. ffi.Pointer clang_getToken( - ffi.Pointer TU, + CXTranslationUnit TU, CXSourceLocation Location, ) { return _clang_getToken( @@ -4438,10 +4514,12 @@ class LibClang { ); } - late final _clang_getToken_ptr = - _lookup>('clang_getToken'); - late final _dart_clang_getToken _clang_getToken = - _clang_getToken_ptr.asFunction<_dart_clang_getToken>(); + late final _clang_getToken_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + CXTranslationUnit, CXSourceLocation)>>('clang_getToken'); + late final _clang_getToken = _clang_getToken_ptr.asFunction< + ffi.Pointer Function(CXTranslationUnit, CXSourceLocation)>(); /// Determine the kind of the given token. int clang_getTokenKind( @@ -4453,13 +4531,14 @@ class LibClang { } late final _clang_getTokenKind_ptr = - _lookup>('clang_getTokenKind'); - late final _dart_clang_getTokenKind _clang_getTokenKind = - _clang_getTokenKind_ptr.asFunction<_dart_clang_getTokenKind>(); + _lookup>( + 'clang_getTokenKind'); + late final _clang_getTokenKind = + _clang_getTokenKind_ptr.asFunction(); /// Determine the spelling of the given token. CXString clang_getTokenSpelling( - ffi.Pointer arg0, + CXTranslationUnit arg0, CXToken arg1, ) { return _clang_getTokenSpelling( @@ -4468,15 +4547,15 @@ class LibClang { ); } - late final _clang_getTokenSpelling_ptr = - _lookup>( - 'clang_getTokenSpelling'); - late final _dart_clang_getTokenSpelling _clang_getTokenSpelling = - _clang_getTokenSpelling_ptr.asFunction<_dart_clang_getTokenSpelling>(); + late final _clang_getTokenSpelling_ptr = _lookup< + ffi.NativeFunction>( + 'clang_getTokenSpelling'); + late final _clang_getTokenSpelling = _clang_getTokenSpelling_ptr + .asFunction(); /// Retrieve the source location of the given token. CXSourceLocation clang_getTokenLocation( - ffi.Pointer arg0, + CXTranslationUnit arg0, CXToken arg1, ) { return _clang_getTokenLocation( @@ -4485,15 +4564,16 @@ class LibClang { ); } - late final _clang_getTokenLocation_ptr = - _lookup>( - 'clang_getTokenLocation'); - late final _dart_clang_getTokenLocation _clang_getTokenLocation = - _clang_getTokenLocation_ptr.asFunction<_dart_clang_getTokenLocation>(); + late final _clang_getTokenLocation_ptr = _lookup< + ffi.NativeFunction< + CXSourceLocation Function( + CXTranslationUnit, CXToken)>>('clang_getTokenLocation'); + late final _clang_getTokenLocation = _clang_getTokenLocation_ptr + .asFunction(); /// Retrieve a source range that covers the given token. CXSourceRange clang_getTokenExtent( - ffi.Pointer arg0, + CXTranslationUnit arg0, CXToken arg1, ) { return _clang_getTokenExtent( @@ -4502,16 +4582,17 @@ class LibClang { ); } - late final _clang_getTokenExtent_ptr = - _lookup>( - 'clang_getTokenExtent'); - late final _dart_clang_getTokenExtent _clang_getTokenExtent = - _clang_getTokenExtent_ptr.asFunction<_dart_clang_getTokenExtent>(); + late final _clang_getTokenExtent_ptr = _lookup< + ffi.NativeFunction< + CXSourceRange Function( + CXTranslationUnit, CXToken)>>('clang_getTokenExtent'); + late final _clang_getTokenExtent = _clang_getTokenExtent_ptr + .asFunction(); /// Tokenize the source code described by the given range into raw lexical /// tokens. void clang_tokenize( - ffi.Pointer TU, + CXTranslationUnit TU, CXSourceRange Range, ffi.Pointer> Tokens, ffi.Pointer NumTokens, @@ -4524,15 +4605,21 @@ class LibClang { ); } - late final _clang_tokenize_ptr = - _lookup>('clang_tokenize'); - late final _dart_clang_tokenize _clang_tokenize = - _clang_tokenize_ptr.asFunction<_dart_clang_tokenize>(); + late final _clang_tokenize_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CXTranslationUnit, + CXSourceRange, + ffi.Pointer>, + ffi.Pointer)>>('clang_tokenize'); + late final _clang_tokenize = _clang_tokenize_ptr.asFunction< + void Function(CXTranslationUnit, CXSourceRange, + ffi.Pointer>, ffi.Pointer)>(); /// 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, + CXTranslationUnit TU, ffi.Pointer Tokens, int NumTokens, ffi.Pointer Cursors, @@ -4545,15 +4632,17 @@ class LibClang { ); } - late final _clang_annotateTokens_ptr = - _lookup>( - 'clang_annotateTokens'); - late final _dart_clang_annotateTokens _clang_annotateTokens = - _clang_annotateTokens_ptr.asFunction<_dart_clang_annotateTokens>(); + late final _clang_annotateTokens_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CXTranslationUnit, ffi.Pointer, ffi.Uint32, + ffi.Pointer)>>('clang_annotateTokens'); + late final _clang_annotateTokens = _clang_annotateTokens_ptr.asFunction< + void Function(CXTranslationUnit, ffi.Pointer, int, + ffi.Pointer)>(); /// Free the given set of tokens. void clang_disposeTokens( - ffi.Pointer TU, + CXTranslationUnit TU, ffi.Pointer Tokens, int NumTokens, ) { @@ -4564,11 +4653,12 @@ class LibClang { ); } - late final _clang_disposeTokens_ptr = - _lookup>( - 'clang_disposeTokens'); - late final _dart_clang_disposeTokens _clang_disposeTokens = - _clang_disposeTokens_ptr.asFunction<_dart_clang_disposeTokens>(); + late final _clang_disposeTokens_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CXTranslationUnit, ffi.Pointer, + ffi.Uint32)>>('clang_disposeTokens'); + late final _clang_disposeTokens = _clang_disposeTokens_ptr.asFunction< + void Function(CXTranslationUnit, ffi.Pointer, int)>(); /// These routines are used for testing and debugging, only, and should not be /// relied upon. @@ -4581,11 +4671,10 @@ class LibClang { } late final _clang_getCursorKindSpelling_ptr = - _lookup>( + _lookup>( 'clang_getCursorKindSpelling'); - late final _dart_clang_getCursorKindSpelling _clang_getCursorKindSpelling = - _clang_getCursorKindSpelling_ptr - .asFunction<_dart_clang_getCursorKindSpelling>(); + late final _clang_getCursorKindSpelling = + _clang_getCursorKindSpelling_ptr.asFunction(); void clang_getDefinitionSpellingAndExtent( CXCursor arg0, @@ -4607,26 +4696,41 @@ class LibClang { ); } - late final _clang_getDefinitionSpellingAndExtent_ptr = - _lookup>( - 'clang_getDefinitionSpellingAndExtent'); - late final _dart_clang_getDefinitionSpellingAndExtent - _clang_getDefinitionSpellingAndExtent = - _clang_getDefinitionSpellingAndExtent_ptr - .asFunction<_dart_clang_getDefinitionSpellingAndExtent>(); + late final _clang_getDefinitionSpellingAndExtent_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CXCursor, + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + 'clang_getDefinitionSpellingAndExtent'); + late final _clang_getDefinitionSpellingAndExtent = + _clang_getDefinitionSpellingAndExtent_ptr.asFunction< + void Function( + CXCursor, + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); void clang_enableStackTraces() { return _clang_enableStackTraces(); } late final _clang_enableStackTraces_ptr = - _lookup>( + _lookup>( 'clang_enableStackTraces'); - late final _dart_clang_enableStackTraces _clang_enableStackTraces = - _clang_enableStackTraces_ptr.asFunction<_dart_clang_enableStackTraces>(); + late final _clang_enableStackTraces = + _clang_enableStackTraces_ptr.asFunction(); void clang_executeOnThread( - ffi.Pointer> fn, + ffi.Pointer)>> + fn, ffi.Pointer user_data, int stack_size, ) { @@ -4637,15 +4741,23 @@ class LibClang { ); } - late final _clang_executeOnThread_ptr = - _lookup>( - 'clang_executeOnThread'); - late final _dart_clang_executeOnThread _clang_executeOnThread = - _clang_executeOnThread_ptr.asFunction<_dart_clang_executeOnThread>(); + late final _clang_executeOnThread_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer< + ffi.NativeFunction)>>, + ffi.Pointer, + ffi.Uint32)>>('clang_executeOnThread'); + late final _clang_executeOnThread = _clang_executeOnThread_ptr.asFunction< + void Function( + ffi.Pointer< + ffi.NativeFunction)>>, + ffi.Pointer, + int)>(); /// Determine the kind of a particular chunk within a completion string. int clang_getCompletionChunkKind( - ffi.Pointer completion_string, + CXCompletionString completion_string, int chunk_number, ) { return _clang_getCompletionChunkKind( @@ -4654,17 +4766,17 @@ class LibClang { ); } - late final _clang_getCompletionChunkKind_ptr = - _lookup>( - 'clang_getCompletionChunkKind'); - late final _dart_clang_getCompletionChunkKind _clang_getCompletionChunkKind = - _clang_getCompletionChunkKind_ptr - .asFunction<_dart_clang_getCompletionChunkKind>(); + late final _clang_getCompletionChunkKind_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXCompletionString, ffi.Uint32)>>('clang_getCompletionChunkKind'); + late final _clang_getCompletionChunkKind = _clang_getCompletionChunkKind_ptr + .asFunction(); /// Retrieve the text associated with a particular chunk within a completion /// string. CXString clang_getCompletionChunkText( - ffi.Pointer completion_string, + CXCompletionString completion_string, int chunk_number, ) { return _clang_getCompletionChunkText( @@ -4673,17 +4785,17 @@ class LibClang { ); } - late final _clang_getCompletionChunkText_ptr = - _lookup>( - 'clang_getCompletionChunkText'); - late final _dart_clang_getCompletionChunkText _clang_getCompletionChunkText = - _clang_getCompletionChunkText_ptr - .asFunction<_dart_clang_getCompletionChunkText>(); + late final _clang_getCompletionChunkText_ptr = _lookup< + ffi.NativeFunction< + CXString Function( + CXCompletionString, ffi.Uint32)>>('clang_getCompletionChunkText'); + late final _clang_getCompletionChunkText = _clang_getCompletionChunkText_ptr + .asFunction(); /// Retrieve the completion string associated with a particular chunk within a /// completion string. - ffi.Pointer clang_getCompletionChunkCompletionString( - ffi.Pointer completion_string, + CXCompletionString clang_getCompletionChunkCompletionString( + CXCompletionString completion_string, int chunk_number, ) { return _clang_getCompletionChunkCompletionString( @@ -4692,17 +4804,17 @@ class LibClang { ); } - late final _clang_getCompletionChunkCompletionString_ptr = - _lookup>( - 'clang_getCompletionChunkCompletionString'); - late final _dart_clang_getCompletionChunkCompletionString - _clang_getCompletionChunkCompletionString = + late final _clang_getCompletionChunkCompletionString_ptr = _lookup< + ffi.NativeFunction< + CXCompletionString Function(CXCompletionString, + ffi.Uint32)>>('clang_getCompletionChunkCompletionString'); + late final _clang_getCompletionChunkCompletionString = _clang_getCompletionChunkCompletionString_ptr - .asFunction<_dart_clang_getCompletionChunkCompletionString>(); + .asFunction(); /// Retrieve the number of chunks in the given code-completion string. int clang_getNumCompletionChunks( - ffi.Pointer completion_string, + CXCompletionString completion_string, ) { return _clang_getNumCompletionChunks( completion_string, @@ -4710,15 +4822,14 @@ class LibClang { } late final _clang_getNumCompletionChunks_ptr = - _lookup>( + _lookup>( 'clang_getNumCompletionChunks'); - late final _dart_clang_getNumCompletionChunks _clang_getNumCompletionChunks = - _clang_getNumCompletionChunks_ptr - .asFunction<_dart_clang_getNumCompletionChunks>(); + late final _clang_getNumCompletionChunks = _clang_getNumCompletionChunks_ptr + .asFunction(); /// Determine the priority of this code completion. int clang_getCompletionPriority( - ffi.Pointer completion_string, + CXCompletionString completion_string, ) { return _clang_getCompletionPriority( completion_string, @@ -4726,16 +4837,15 @@ class LibClang { } late final _clang_getCompletionPriority_ptr = - _lookup>( + _lookup>( 'clang_getCompletionPriority'); - late final _dart_clang_getCompletionPriority _clang_getCompletionPriority = - _clang_getCompletionPriority_ptr - .asFunction<_dart_clang_getCompletionPriority>(); + late final _clang_getCompletionPriority = _clang_getCompletionPriority_ptr + .asFunction(); /// Determine the availability of the entity that this code-completion string /// refers to. int clang_getCompletionAvailability( - ffi.Pointer completion_string, + CXCompletionString completion_string, ) { return _clang_getCompletionAvailability( completion_string, @@ -4743,16 +4853,16 @@ class LibClang { } late final _clang_getCompletionAvailability_ptr = - _lookup>( + _lookup>( 'clang_getCompletionAvailability'); - late final _dart_clang_getCompletionAvailability - _clang_getCompletionAvailability = _clang_getCompletionAvailability_ptr - .asFunction<_dart_clang_getCompletionAvailability>(); + late final _clang_getCompletionAvailability = + _clang_getCompletionAvailability_ptr + .asFunction(); /// Retrieve the number of annotations associated with the given completion /// string. int clang_getCompletionNumAnnotations( - ffi.Pointer completion_string, + CXCompletionString completion_string, ) { return _clang_getCompletionNumAnnotations( completion_string, @@ -4760,16 +4870,15 @@ class LibClang { } late final _clang_getCompletionNumAnnotations_ptr = - _lookup>( + _lookup>( 'clang_getCompletionNumAnnotations'); - late final _dart_clang_getCompletionNumAnnotations - _clang_getCompletionNumAnnotations = + late final _clang_getCompletionNumAnnotations = _clang_getCompletionNumAnnotations_ptr - .asFunction<_dart_clang_getCompletionNumAnnotations>(); + .asFunction(); /// Retrieve the annotation associated with the given completion string. CXString clang_getCompletionAnnotation( - ffi.Pointer completion_string, + CXCompletionString completion_string, int annotation_number, ) { return _clang_getCompletionAnnotation( @@ -4778,16 +4887,16 @@ class LibClang { ); } - late final _clang_getCompletionAnnotation_ptr = - _lookup>( - 'clang_getCompletionAnnotation'); - late final _dart_clang_getCompletionAnnotation - _clang_getCompletionAnnotation = _clang_getCompletionAnnotation_ptr - .asFunction<_dart_clang_getCompletionAnnotation>(); + late final _clang_getCompletionAnnotation_ptr = _lookup< + ffi.NativeFunction< + CXString Function(CXCompletionString, + ffi.Uint32)>>('clang_getCompletionAnnotation'); + late final _clang_getCompletionAnnotation = _clang_getCompletionAnnotation_ptr + .asFunction(); /// Retrieve the parent context of the given completion string. CXString clang_getCompletionParent( - ffi.Pointer completion_string, + CXCompletionString completion_string, ffi.Pointer kind, ) { return _clang_getCompletionParent( @@ -4796,17 +4905,18 @@ class LibClang { ); } - late final _clang_getCompletionParent_ptr = - _lookup>( - 'clang_getCompletionParent'); - late final _dart_clang_getCompletionParent _clang_getCompletionParent = - _clang_getCompletionParent_ptr - .asFunction<_dart_clang_getCompletionParent>(); + late final _clang_getCompletionParent_ptr = _lookup< + ffi.NativeFunction< + CXString Function(CXCompletionString, + ffi.Pointer)>>('clang_getCompletionParent'); + late final _clang_getCompletionParent = + _clang_getCompletionParent_ptr.asFunction< + CXString Function(CXCompletionString, ffi.Pointer)>(); /// Retrieve the brief documentation comment attached to the declaration that /// corresponds to the given completion string. CXString clang_getCompletionBriefComment( - ffi.Pointer completion_string, + CXCompletionString completion_string, ) { return _clang_getCompletionBriefComment( completion_string, @@ -4814,15 +4924,15 @@ class LibClang { } late final _clang_getCompletionBriefComment_ptr = - _lookup>( + _lookup>( 'clang_getCompletionBriefComment'); - late final _dart_clang_getCompletionBriefComment - _clang_getCompletionBriefComment = _clang_getCompletionBriefComment_ptr - .asFunction<_dart_clang_getCompletionBriefComment>(); + late final _clang_getCompletionBriefComment = + _clang_getCompletionBriefComment_ptr + .asFunction(); /// Retrieve a completion string for an arbitrary declaration or macro /// definition cursor. - ffi.Pointer clang_getCursorCompletionString( + CXCompletionString clang_getCursorCompletionString( CXCursor cursor, ) { return _clang_getCursorCompletionString( @@ -4831,11 +4941,11 @@ class LibClang { } late final _clang_getCursorCompletionString_ptr = - _lookup>( + _lookup>( 'clang_getCursorCompletionString'); - late final _dart_clang_getCursorCompletionString - _clang_getCursorCompletionString = _clang_getCursorCompletionString_ptr - .asFunction<_dart_clang_getCursorCompletionString>(); + late final _clang_getCursorCompletionString = + _clang_getCursorCompletionString_ptr + .asFunction(); /// Retrieve the number of fix-its for the given completion index. int clang_getCompletionNumFixIts( @@ -4848,12 +4958,12 @@ class LibClang { ); } - late final _clang_getCompletionNumFixIts_ptr = - _lookup>( - 'clang_getCompletionNumFixIts'); - late final _dart_clang_getCompletionNumFixIts _clang_getCompletionNumFixIts = - _clang_getCompletionNumFixIts_ptr - .asFunction<_dart_clang_getCompletionNumFixIts>(); + late final _clang_getCompletionNumFixIts_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint32 Function(ffi.Pointer, + ffi.Uint32)>>('clang_getCompletionNumFixIts'); + late final _clang_getCompletionNumFixIts = _clang_getCompletionNumFixIts_ptr + .asFunction, int)>(); /// Fix-its that *must* be applied before inserting the text for the /// corresponding completion. @@ -4871,12 +4981,17 @@ class LibClang { ); } - late final _clang_getCompletionFixIt_ptr = - _lookup>( - 'clang_getCompletionFixIt'); - late final _dart_clang_getCompletionFixIt _clang_getCompletionFixIt = - _clang_getCompletionFixIt_ptr - .asFunction<_dart_clang_getCompletionFixIt>(); + late final _clang_getCompletionFixIt_ptr = _lookup< + ffi.NativeFunction< + CXString Function( + ffi.Pointer, + ffi.Uint32, + ffi.Uint32, + ffi.Pointer)>>('clang_getCompletionFixIt'); + late final _clang_getCompletionFixIt = + _clang_getCompletionFixIt_ptr.asFunction< + CXString Function(ffi.Pointer, int, int, + ffi.Pointer)>(); /// Returns a default set of code-completion options that can be passed to /// clang_codeCompleteAt(). @@ -4885,15 +5000,14 @@ class LibClang { } late final _clang_defaultCodeCompleteOptions_ptr = - _lookup>( + _lookup>( 'clang_defaultCodeCompleteOptions'); - late final _dart_clang_defaultCodeCompleteOptions - _clang_defaultCodeCompleteOptions = _clang_defaultCodeCompleteOptions_ptr - .asFunction<_dart_clang_defaultCodeCompleteOptions>(); + late final _clang_defaultCodeCompleteOptions = + _clang_defaultCodeCompleteOptions_ptr.asFunction(); /// Perform code completion at a given location in a translation unit. ffi.Pointer clang_codeCompleteAt( - ffi.Pointer TU, + CXTranslationUnit TU, ffi.Pointer complete_filename, int complete_line, int complete_column, @@ -4912,11 +5026,25 @@ class LibClang { ); } - late final _clang_codeCompleteAt_ptr = - _lookup>( - 'clang_codeCompleteAt'); - late final _dart_clang_codeCompleteAt _clang_codeCompleteAt = - _clang_codeCompleteAt_ptr.asFunction<_dart_clang_codeCompleteAt>(); + late final _clang_codeCompleteAt_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + CXTranslationUnit, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32)>>('clang_codeCompleteAt'); + late final _clang_codeCompleteAt = _clang_codeCompleteAt_ptr.asFunction< + ffi.Pointer Function( + CXTranslationUnit, + ffi.Pointer, + int, + int, + ffi.Pointer, + int, + int)>(); /// Sort the code-completion results in case-insensitive alphabetical order. void clang_sortCodeCompletionResults( @@ -4929,12 +5057,13 @@ class LibClang { ); } - late final _clang_sortCodeCompletionResults_ptr = - _lookup>( - 'clang_sortCodeCompletionResults'); - late final _dart_clang_sortCodeCompletionResults - _clang_sortCodeCompletionResults = _clang_sortCodeCompletionResults_ptr - .asFunction<_dart_clang_sortCodeCompletionResults>(); + late final _clang_sortCodeCompletionResults_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Uint32)>>('clang_sortCodeCompletionResults'); + late final _clang_sortCodeCompletionResults = + _clang_sortCodeCompletionResults_ptr + .asFunction, int)>(); /// Free the given set of code-completion results. void clang_disposeCodeCompleteResults( @@ -4945,12 +5074,13 @@ class LibClang { ); } - late final _clang_disposeCodeCompleteResults_ptr = - _lookup>( - 'clang_disposeCodeCompleteResults'); - late final _dart_clang_disposeCodeCompleteResults - _clang_disposeCodeCompleteResults = _clang_disposeCodeCompleteResults_ptr - .asFunction<_dart_clang_disposeCodeCompleteResults>(); + late final _clang_disposeCodeCompleteResults_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>( + 'clang_disposeCodeCompleteResults'); + late final _clang_disposeCodeCompleteResults = + _clang_disposeCodeCompleteResults_ptr + .asFunction)>(); /// Determine the number of diagnostics produced prior to the location where /// code completion was performed. @@ -4962,16 +5092,16 @@ class LibClang { ); } - late final _clang_codeCompleteGetNumDiagnostics_ptr = - _lookup>( - 'clang_codeCompleteGetNumDiagnostics'); - late final _dart_clang_codeCompleteGetNumDiagnostics - _clang_codeCompleteGetNumDiagnostics = + late final _clang_codeCompleteGetNumDiagnostics_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint32 Function(ffi.Pointer)>>( + 'clang_codeCompleteGetNumDiagnostics'); + late final _clang_codeCompleteGetNumDiagnostics = _clang_codeCompleteGetNumDiagnostics_ptr - .asFunction<_dart_clang_codeCompleteGetNumDiagnostics>(); + .asFunction)>(); /// Retrieve a diagnostic associated with the given code completion. - ffi.Pointer clang_codeCompleteGetDiagnostic( + CXDiagnostic clang_codeCompleteGetDiagnostic( ffi.Pointer Results, int Index, ) { @@ -4981,12 +5111,13 @@ class LibClang { ); } - late final _clang_codeCompleteGetDiagnostic_ptr = - _lookup>( - 'clang_codeCompleteGetDiagnostic'); - late final _dart_clang_codeCompleteGetDiagnostic - _clang_codeCompleteGetDiagnostic = _clang_codeCompleteGetDiagnostic_ptr - .asFunction<_dart_clang_codeCompleteGetDiagnostic>(); + late final _clang_codeCompleteGetDiagnostic_ptr = _lookup< + ffi.NativeFunction< + CXDiagnostic Function(ffi.Pointer, + ffi.Uint32)>>('clang_codeCompleteGetDiagnostic'); + late final _clang_codeCompleteGetDiagnostic = + _clang_codeCompleteGetDiagnostic_ptr.asFunction< + CXDiagnostic Function(ffi.Pointer, int)>(); /// Determines what completions are appropriate for the context the given code /// completion. @@ -4998,12 +5129,12 @@ class LibClang { ); } - late final _clang_codeCompleteGetContexts_ptr = - _lookup>( - 'clang_codeCompleteGetContexts'); - late final _dart_clang_codeCompleteGetContexts - _clang_codeCompleteGetContexts = _clang_codeCompleteGetContexts_ptr - .asFunction<_dart_clang_codeCompleteGetContexts>(); + late final _clang_codeCompleteGetContexts_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint64 Function(ffi.Pointer)>>( + 'clang_codeCompleteGetContexts'); + late final _clang_codeCompleteGetContexts = _clang_codeCompleteGetContexts_ptr + .asFunction)>(); /// 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 @@ -5019,13 +5150,14 @@ class LibClang { ); } - late final _clang_codeCompleteGetContainerKind_ptr = - _lookup>( - 'clang_codeCompleteGetContainerKind'); - late final _dart_clang_codeCompleteGetContainerKind - _clang_codeCompleteGetContainerKind = - _clang_codeCompleteGetContainerKind_ptr - .asFunction<_dart_clang_codeCompleteGetContainerKind>(); + late final _clang_codeCompleteGetContainerKind_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('clang_codeCompleteGetContainerKind'); + late final _clang_codeCompleteGetContainerKind = + _clang_codeCompleteGetContainerKind_ptr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); /// 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 @@ -5038,13 +5170,13 @@ class LibClang { ); } - late final _clang_codeCompleteGetContainerUSR_ptr = - _lookup>( - 'clang_codeCompleteGetContainerUSR'); - late final _dart_clang_codeCompleteGetContainerUSR - _clang_codeCompleteGetContainerUSR = + late final _clang_codeCompleteGetContainerUSR_ptr = _lookup< + ffi.NativeFunction< + CXString Function(ffi.Pointer)>>( + 'clang_codeCompleteGetContainerUSR'); + late final _clang_codeCompleteGetContainerUSR = _clang_codeCompleteGetContainerUSR_ptr - .asFunction<_dart_clang_codeCompleteGetContainerUSR>(); + .asFunction)>(); /// Returns the currently-entered selector for an Objective-C message send, /// formatted like "initWithFoo:bar:". Only guaranteed to return a non-empty @@ -5058,13 +5190,13 @@ class LibClang { ); } - late final _clang_codeCompleteGetObjCSelector_ptr = - _lookup>( - 'clang_codeCompleteGetObjCSelector'); - late final _dart_clang_codeCompleteGetObjCSelector - _clang_codeCompleteGetObjCSelector = + late final _clang_codeCompleteGetObjCSelector_ptr = _lookup< + ffi.NativeFunction< + CXString Function(ffi.Pointer)>>( + 'clang_codeCompleteGetObjCSelector'); + late final _clang_codeCompleteGetObjCSelector = _clang_codeCompleteGetObjCSelector_ptr - .asFunction<_dart_clang_codeCompleteGetObjCSelector>(); + .asFunction)>(); /// Return a version string, suitable for showing to a user, but not intended /// to be parsed (the format is not guaranteed to be stable). @@ -5073,10 +5205,9 @@ class LibClang { } late final _clang_getClangVersion_ptr = - _lookup>( - 'clang_getClangVersion'); - late final _dart_clang_getClangVersion _clang_getClangVersion = - _clang_getClangVersion_ptr.asFunction<_dart_clang_getClangVersion>(); + _lookup>('clang_getClangVersion'); + late final _clang_getClangVersion = + _clang_getClangVersion_ptr.asFunction(); /// Enable/disable crash recovery. void clang_toggleCrashRecovery( @@ -5088,20 +5219,19 @@ class LibClang { } late final _clang_toggleCrashRecovery_ptr = - _lookup>( + _lookup>( 'clang_toggleCrashRecovery'); - late final _dart_clang_toggleCrashRecovery _clang_toggleCrashRecovery = - _clang_toggleCrashRecovery_ptr - .asFunction<_dart_clang_toggleCrashRecovery>(); + late final _clang_toggleCrashRecovery = + _clang_toggleCrashRecovery_ptr.asFunction(); /// 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, + CXTranslationUnit tu, + CXInclusionVisitor visitor, + CXClientData client_data, ) { return _clang_getInclusions( tu, @@ -5110,16 +5240,17 @@ class LibClang { ); } - late final _clang_getInclusions_ptr = - _lookup>( - 'clang_getInclusions'); - late final _dart_clang_getInclusions _clang_getInclusions = - _clang_getInclusions_ptr.asFunction<_dart_clang_getInclusions>(); + late final _clang_getInclusions_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CXTranslationUnit, CXInclusionVisitor, + CXClientData)>>('clang_getInclusions'); + late final _clang_getInclusions = _clang_getInclusions_ptr.asFunction< + void Function(CXTranslationUnit, CXInclusionVisitor, CXClientData)>(); /// 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( + CXEvalResult clang_Cursor_Evaluate( CXCursor C, ) { return _clang_Cursor_Evaluate( @@ -5128,14 +5259,14 @@ class LibClang { } late final _clang_Cursor_Evaluate_ptr = - _lookup>( + _lookup>( 'clang_Cursor_Evaluate'); - late final _dart_clang_Cursor_Evaluate _clang_Cursor_Evaluate = - _clang_Cursor_Evaluate_ptr.asFunction<_dart_clang_Cursor_Evaluate>(); + late final _clang_Cursor_Evaluate = + _clang_Cursor_Evaluate_ptr.asFunction(); /// Returns the kind of the evaluated result. int clang_EvalResult_getKind( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getKind( E, @@ -5143,15 +5274,14 @@ class LibClang { } late final _clang_EvalResult_getKind_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_getKind'); - late final _dart_clang_EvalResult_getKind _clang_EvalResult_getKind = - _clang_EvalResult_getKind_ptr - .asFunction<_dart_clang_EvalResult_getKind>(); + late final _clang_EvalResult_getKind = + _clang_EvalResult_getKind_ptr.asFunction(); /// Returns the evaluation result as integer if the kind is Int. int clang_EvalResult_getAsInt( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getAsInt( E, @@ -5159,17 +5289,16 @@ class LibClang { } late final _clang_EvalResult_getAsInt_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsInt'); - late final _dart_clang_EvalResult_getAsInt _clang_EvalResult_getAsInt = - _clang_EvalResult_getAsInt_ptr - .asFunction<_dart_clang_EvalResult_getAsInt>(); + late final _clang_EvalResult_getAsInt = + _clang_EvalResult_getAsInt_ptr.asFunction(); /// 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, + CXEvalResult E, ) { return _clang_EvalResult_getAsLongLong( E, @@ -5177,16 +5306,16 @@ class LibClang { } late final _clang_EvalResult_getAsLongLong_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsLongLong'); - late final _dart_clang_EvalResult_getAsLongLong - _clang_EvalResult_getAsLongLong = _clang_EvalResult_getAsLongLong_ptr - .asFunction<_dart_clang_EvalResult_getAsLongLong>(); + late final _clang_EvalResult_getAsLongLong = + _clang_EvalResult_getAsLongLong_ptr + .asFunction(); /// 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, + CXEvalResult E, ) { return _clang_EvalResult_isUnsignedInt( E, @@ -5194,16 +5323,16 @@ class LibClang { } late final _clang_EvalResult_isUnsignedInt_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_isUnsignedInt'); - late final _dart_clang_EvalResult_isUnsignedInt - _clang_EvalResult_isUnsignedInt = _clang_EvalResult_isUnsignedInt_ptr - .asFunction<_dart_clang_EvalResult_isUnsignedInt>(); + late final _clang_EvalResult_isUnsignedInt = + _clang_EvalResult_isUnsignedInt_ptr + .asFunction(); /// 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, + CXEvalResult E, ) { return _clang_EvalResult_getAsUnsigned( E, @@ -5211,15 +5340,15 @@ class LibClang { } late final _clang_EvalResult_getAsUnsigned_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsUnsigned'); - late final _dart_clang_EvalResult_getAsUnsigned - _clang_EvalResult_getAsUnsigned = _clang_EvalResult_getAsUnsigned_ptr - .asFunction<_dart_clang_EvalResult_getAsUnsigned>(); + late final _clang_EvalResult_getAsUnsigned = + _clang_EvalResult_getAsUnsigned_ptr + .asFunction(); /// Returns the evaluation result as double if the kind is double. double clang_EvalResult_getAsDouble( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getAsDouble( E, @@ -5227,18 +5356,17 @@ class LibClang { } late final _clang_EvalResult_getAsDouble_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsDouble'); - late final _dart_clang_EvalResult_getAsDouble _clang_EvalResult_getAsDouble = - _clang_EvalResult_getAsDouble_ptr - .asFunction<_dart_clang_EvalResult_getAsDouble>(); + late final _clang_EvalResult_getAsDouble = _clang_EvalResult_getAsDouble_ptr + .asFunction(); /// 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, + CXEvalResult E, ) { return _clang_EvalResult_getAsStr( E, @@ -5246,15 +5374,14 @@ class LibClang { } late final _clang_EvalResult_getAsStr_ptr = - _lookup>( + _lookup Function(CXEvalResult)>>( 'clang_EvalResult_getAsStr'); - late final _dart_clang_EvalResult_getAsStr _clang_EvalResult_getAsStr = - _clang_EvalResult_getAsStr_ptr - .asFunction<_dart_clang_EvalResult_getAsStr>(); + late final _clang_EvalResult_getAsStr = _clang_EvalResult_getAsStr_ptr + .asFunction Function(CXEvalResult)>(); /// Disposes the created Eval memory. void clang_EvalResult_dispose( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_dispose( E, @@ -5262,14 +5389,13 @@ class LibClang { } late final _clang_EvalResult_dispose_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_dispose'); - late final _dart_clang_EvalResult_dispose _clang_EvalResult_dispose = - _clang_EvalResult_dispose_ptr - .asFunction<_dart_clang_EvalResult_dispose>(); + late final _clang_EvalResult_dispose = + _clang_EvalResult_dispose_ptr.asFunction(); /// Retrieve a remapping. - ffi.Pointer clang_getRemappings( + CXRemapping clang_getRemappings( ffi.Pointer path, ) { return _clang_getRemappings( @@ -5278,13 +5404,13 @@ class LibClang { } late final _clang_getRemappings_ptr = - _lookup>( + _lookup)>>( 'clang_getRemappings'); - late final _dart_clang_getRemappings _clang_getRemappings = - _clang_getRemappings_ptr.asFunction<_dart_clang_getRemappings>(); + late final _clang_getRemappings = _clang_getRemappings_ptr + .asFunction)>(); /// Retrieve a remapping. - ffi.Pointer clang_getRemappingsFromFileList( + CXRemapping clang_getRemappingsFromFileList( ffi.Pointer> filePaths, int numFiles, ) { @@ -5294,16 +5420,17 @@ class LibClang { ); } - late final _clang_getRemappingsFromFileList_ptr = - _lookup>( - 'clang_getRemappingsFromFileList'); - late final _dart_clang_getRemappingsFromFileList - _clang_getRemappingsFromFileList = _clang_getRemappingsFromFileList_ptr - .asFunction<_dart_clang_getRemappingsFromFileList>(); + late final _clang_getRemappingsFromFileList_ptr = _lookup< + ffi.NativeFunction< + CXRemapping Function(ffi.Pointer>, + ffi.Uint32)>>('clang_getRemappingsFromFileList'); + late final _clang_getRemappingsFromFileList = + _clang_getRemappingsFromFileList_ptr.asFunction< + CXRemapping Function(ffi.Pointer>, int)>(); /// Determine the number of remappings. int clang_remap_getNumFiles( - ffi.Pointer arg0, + CXRemapping arg0, ) { return _clang_remap_getNumFiles( arg0, @@ -5311,14 +5438,14 @@ class LibClang { } late final _clang_remap_getNumFiles_ptr = - _lookup>( + _lookup>( 'clang_remap_getNumFiles'); - late final _dart_clang_remap_getNumFiles _clang_remap_getNumFiles = - _clang_remap_getNumFiles_ptr.asFunction<_dart_clang_remap_getNumFiles>(); + late final _clang_remap_getNumFiles = + _clang_remap_getNumFiles_ptr.asFunction(); /// Get the original and the associated filename from the remapping. void clang_remap_getFilenames( - ffi.Pointer arg0, + CXRemapping arg0, int index, ffi.Pointer original, ffi.Pointer transformed, @@ -5331,16 +5458,18 @@ class LibClang { ); } - late final _clang_remap_getFilenames_ptr = - _lookup>( - 'clang_remap_getFilenames'); - late final _dart_clang_remap_getFilenames _clang_remap_getFilenames = - _clang_remap_getFilenames_ptr - .asFunction<_dart_clang_remap_getFilenames>(); + late final _clang_remap_getFilenames_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CXRemapping, ffi.Uint32, ffi.Pointer, + ffi.Pointer)>>('clang_remap_getFilenames'); + late final _clang_remap_getFilenames = + _clang_remap_getFilenames_ptr.asFunction< + void Function(CXRemapping, int, ffi.Pointer, + ffi.Pointer)>(); /// Dispose the remapping. void clang_remap_dispose( - ffi.Pointer arg0, + CXRemapping arg0, ) { return _clang_remap_dispose( arg0, @@ -5348,15 +5477,15 @@ class LibClang { } late final _clang_remap_dispose_ptr = - _lookup>( + _lookup>( 'clang_remap_dispose'); - late final _dart_clang_remap_dispose _clang_remap_dispose = - _clang_remap_dispose_ptr.asFunction<_dart_clang_remap_dispose>(); + late final _clang_remap_dispose = + _clang_remap_dispose_ptr.asFunction(); /// Find references of a declaration in a specific file. int clang_findReferencesInFile( CXCursor cursor, - ffi.Pointer file, + CXFile file, CXCursorAndRangeVisitor visitor, ) { return _clang_findReferencesInFile( @@ -5366,17 +5495,17 @@ class LibClang { ); } - late final _clang_findReferencesInFile_ptr = - _lookup>( - 'clang_findReferencesInFile'); - late final _dart_clang_findReferencesInFile _clang_findReferencesInFile = - _clang_findReferencesInFile_ptr - .asFunction<_dart_clang_findReferencesInFile>(); + late final _clang_findReferencesInFile_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(CXCursor, CXFile, + CXCursorAndRangeVisitor)>>('clang_findReferencesInFile'); + late final _clang_findReferencesInFile = _clang_findReferencesInFile_ptr + .asFunction(); /// Find #import/#include directives in a specific file. int clang_findIncludesInFile( - ffi.Pointer TU, - ffi.Pointer file, + CXTranslationUnit TU, + CXFile file, CXCursorAndRangeVisitor visitor, ) { return _clang_findIncludesInFile( @@ -5386,12 +5515,13 @@ class LibClang { ); } - late final _clang_findIncludesInFile_ptr = - _lookup>( - 'clang_findIncludesInFile'); - late final _dart_clang_findIncludesInFile _clang_findIncludesInFile = - _clang_findIncludesInFile_ptr - .asFunction<_dart_clang_findIncludesInFile>(); + late final _clang_findIncludesInFile_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(CXTranslationUnit, CXFile, + CXCursorAndRangeVisitor)>>('clang_findIncludesInFile'); + late final _clang_findIncludesInFile = + _clang_findIncludesInFile_ptr.asFunction< + int Function(CXTranslationUnit, CXFile, CXCursorAndRangeVisitor)>(); int clang_index_isEntityObjCContainerKind( int arg0, @@ -5402,12 +5532,11 @@ class LibClang { } late final _clang_index_isEntityObjCContainerKind_ptr = - _lookup>( + _lookup>( 'clang_index_isEntityObjCContainerKind'); - late final _dart_clang_index_isEntityObjCContainerKind - _clang_index_isEntityObjCContainerKind = + late final _clang_index_isEntityObjCContainerKind = _clang_index_isEntityObjCContainerKind_ptr - .asFunction<_dart_clang_index_isEntityObjCContainerKind>(); + .asFunction(); ffi.Pointer clang_index_getObjCContainerDeclInfo( ffi.Pointer arg0, @@ -5417,13 +5546,15 @@ class LibClang { ); } - late final _clang_index_getObjCContainerDeclInfo_ptr = - _lookup>( - 'clang_index_getObjCContainerDeclInfo'); - late final _dart_clang_index_getObjCContainerDeclInfo - _clang_index_getObjCContainerDeclInfo = - _clang_index_getObjCContainerDeclInfo_ptr - .asFunction<_dart_clang_index_getObjCContainerDeclInfo>(); + late final _clang_index_getObjCContainerDeclInfo_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>( + 'clang_index_getObjCContainerDeclInfo'); + late final _clang_index_getObjCContainerDeclInfo = + _clang_index_getObjCContainerDeclInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getObjCInterfaceDeclInfo( ffi.Pointer arg0, @@ -5433,13 +5564,15 @@ class LibClang { ); } - late final _clang_index_getObjCInterfaceDeclInfo_ptr = - _lookup>( - 'clang_index_getObjCInterfaceDeclInfo'); - late final _dart_clang_index_getObjCInterfaceDeclInfo - _clang_index_getObjCInterfaceDeclInfo = - _clang_index_getObjCInterfaceDeclInfo_ptr - .asFunction<_dart_clang_index_getObjCInterfaceDeclInfo>(); + late final _clang_index_getObjCInterfaceDeclInfo_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>( + 'clang_index_getObjCInterfaceDeclInfo'); + late final _clang_index_getObjCInterfaceDeclInfo = + _clang_index_getObjCInterfaceDeclInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getObjCCategoryDeclInfo( ffi.Pointer arg0, @@ -5449,13 +5582,15 @@ class LibClang { ); } - late final _clang_index_getObjCCategoryDeclInfo_ptr = - _lookup>( - 'clang_index_getObjCCategoryDeclInfo'); - late final _dart_clang_index_getObjCCategoryDeclInfo - _clang_index_getObjCCategoryDeclInfo = - _clang_index_getObjCCategoryDeclInfo_ptr - .asFunction<_dart_clang_index_getObjCCategoryDeclInfo>(); + late final _clang_index_getObjCCategoryDeclInfo_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>( + 'clang_index_getObjCCategoryDeclInfo'); + late final _clang_index_getObjCCategoryDeclInfo = + _clang_index_getObjCCategoryDeclInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getObjCProtocolRefListInfo( @@ -5466,13 +5601,15 @@ class LibClang { ); } - late final _clang_index_getObjCProtocolRefListInfo_ptr = - _lookup>( - 'clang_index_getObjCProtocolRefListInfo'); - late final _dart_clang_index_getObjCProtocolRefListInfo - _clang_index_getObjCProtocolRefListInfo = - _clang_index_getObjCProtocolRefListInfo_ptr - .asFunction<_dart_clang_index_getObjCProtocolRefListInfo>(); + late final _clang_index_getObjCProtocolRefListInfo_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>( + 'clang_index_getObjCProtocolRefListInfo'); + late final _clang_index_getObjCProtocolRefListInfo = + _clang_index_getObjCProtocolRefListInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getObjCPropertyDeclInfo( ffi.Pointer arg0, @@ -5482,13 +5619,15 @@ class LibClang { ); } - late final _clang_index_getObjCPropertyDeclInfo_ptr = - _lookup>( - 'clang_index_getObjCPropertyDeclInfo'); - late final _dart_clang_index_getObjCPropertyDeclInfo - _clang_index_getObjCPropertyDeclInfo = - _clang_index_getObjCPropertyDeclInfo_ptr - .asFunction<_dart_clang_index_getObjCPropertyDeclInfo>(); + late final _clang_index_getObjCPropertyDeclInfo_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>( + 'clang_index_getObjCPropertyDeclInfo'); + late final _clang_index_getObjCPropertyDeclInfo = + _clang_index_getObjCPropertyDeclInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getIBOutletCollectionAttrInfo( @@ -5499,13 +5638,15 @@ class LibClang { ); } - late final _clang_index_getIBOutletCollectionAttrInfo_ptr = - _lookup>( - 'clang_index_getIBOutletCollectionAttrInfo'); - late final _dart_clang_index_getIBOutletCollectionAttrInfo - _clang_index_getIBOutletCollectionAttrInfo = - _clang_index_getIBOutletCollectionAttrInfo_ptr - .asFunction<_dart_clang_index_getIBOutletCollectionAttrInfo>(); + late final _clang_index_getIBOutletCollectionAttrInfo_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>( + 'clang_index_getIBOutletCollectionAttrInfo'); + late final _clang_index_getIBOutletCollectionAttrInfo = + _clang_index_getIBOutletCollectionAttrInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getCXXClassDeclInfo( ffi.Pointer arg0, @@ -5515,15 +5656,17 @@ class LibClang { ); } - late final _clang_index_getCXXClassDeclInfo_ptr = - _lookup>( - 'clang_index_getCXXClassDeclInfo'); - late final _dart_clang_index_getCXXClassDeclInfo - _clang_index_getCXXClassDeclInfo = _clang_index_getCXXClassDeclInfo_ptr - .asFunction<_dart_clang_index_getCXXClassDeclInfo>(); + late final _clang_index_getCXXClassDeclInfo_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('clang_index_getCXXClassDeclInfo'); + late final _clang_index_getCXXClassDeclInfo = + _clang_index_getCXXClassDeclInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); /// For retrieving a custom CXIdxClientContainer attached to a container. - ffi.Pointer clang_index_getClientContainer( + CXIdxClientContainer clang_index_getClientContainer( ffi.Pointer arg0, ) { return _clang_index_getClientContainer( @@ -5531,17 +5674,18 @@ class LibClang { ); } - late final _clang_index_getClientContainer_ptr = - _lookup>( - 'clang_index_getClientContainer'); - late final _dart_clang_index_getClientContainer - _clang_index_getClientContainer = _clang_index_getClientContainer_ptr - .asFunction<_dart_clang_index_getClientContainer>(); + late final _clang_index_getClientContainer_ptr = _lookup< + ffi.NativeFunction< + CXIdxClientContainer Function(ffi.Pointer)>>( + 'clang_index_getClientContainer'); + late final _clang_index_getClientContainer = + _clang_index_getClientContainer_ptr.asFunction< + CXIdxClientContainer Function(ffi.Pointer)>(); /// For setting a custom CXIdxClientContainer attached to a container. void clang_index_setClientContainer( ffi.Pointer arg0, - ffi.Pointer arg1, + CXIdxClientContainer arg1, ) { return _clang_index_setClientContainer( arg0, @@ -5549,15 +5693,17 @@ class LibClang { ); } - late final _clang_index_setClientContainer_ptr = - _lookup>( - 'clang_index_setClientContainer'); - late final _dart_clang_index_setClientContainer - _clang_index_setClientContainer = _clang_index_setClientContainer_ptr - .asFunction<_dart_clang_index_setClientContainer>(); + late final _clang_index_setClientContainer_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + CXIdxClientContainer)>>('clang_index_setClientContainer'); + late final _clang_index_setClientContainer = + _clang_index_setClientContainer_ptr.asFunction< + void Function( + ffi.Pointer, CXIdxClientContainer)>(); /// For retrieving a custom CXIdxClientEntity attached to an entity. - ffi.Pointer clang_index_getClientEntity( + CXIdxClientEntity clang_index_getClientEntity( ffi.Pointer arg0, ) { return _clang_index_getClientEntity( @@ -5565,17 +5711,17 @@ class LibClang { ); } - late final _clang_index_getClientEntity_ptr = - _lookup>( - 'clang_index_getClientEntity'); - late final _dart_clang_index_getClientEntity _clang_index_getClientEntity = - _clang_index_getClientEntity_ptr - .asFunction<_dart_clang_index_getClientEntity>(); + late final _clang_index_getClientEntity_ptr = _lookup< + ffi.NativeFunction< + CXIdxClientEntity Function( + ffi.Pointer)>>('clang_index_getClientEntity'); + late final _clang_index_getClientEntity = _clang_index_getClientEntity_ptr + .asFunction)>(); /// For setting a custom CXIdxClientEntity attached to an entity. void clang_index_setClientEntity( ffi.Pointer arg0, - ffi.Pointer arg1, + CXIdxClientEntity arg1, ) { return _clang_index_setClientEntity( arg0, @@ -5583,17 +5729,18 @@ class LibClang { ); } - late final _clang_index_setClientEntity_ptr = - _lookup>( - 'clang_index_setClientEntity'); - late final _dart_clang_index_setClientEntity _clang_index_setClientEntity = - _clang_index_setClientEntity_ptr - .asFunction<_dart_clang_index_setClientEntity>(); + late final _clang_index_setClientEntity_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + CXIdxClientEntity)>>('clang_index_setClientEntity'); + late final _clang_index_setClientEntity = + _clang_index_setClientEntity_ptr.asFunction< + void Function(ffi.Pointer, CXIdxClientEntity)>(); /// An indexing action/session, to be applied to one or multiple translation /// units. - ffi.Pointer clang_IndexAction_create( - ffi.Pointer CIdx, + CXIndexAction clang_IndexAction_create( + CXIndex CIdx, ) { return _clang_IndexAction_create( CIdx, @@ -5601,15 +5748,14 @@ class LibClang { } late final _clang_IndexAction_create_ptr = - _lookup>( + _lookup>( 'clang_IndexAction_create'); - late final _dart_clang_IndexAction_create _clang_IndexAction_create = - _clang_IndexAction_create_ptr - .asFunction<_dart_clang_IndexAction_create>(); + late final _clang_IndexAction_create = _clang_IndexAction_create_ptr + .asFunction(); /// Destroy the given index action. void clang_IndexAction_dispose( - ffi.Pointer arg0, + CXIndexAction arg0, ) { return _clang_IndexAction_dispose( arg0, @@ -5617,17 +5763,16 @@ class LibClang { } late final _clang_IndexAction_dispose_ptr = - _lookup>( + _lookup>( 'clang_IndexAction_dispose'); - late final _dart_clang_IndexAction_dispose _clang_IndexAction_dispose = - _clang_IndexAction_dispose_ptr - .asFunction<_dart_clang_IndexAction_dispose>(); + late final _clang_IndexAction_dispose = + _clang_IndexAction_dispose_ptr.asFunction(); /// 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, + CXIndexAction arg0, + CXClientData client_data, ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, @@ -5636,7 +5781,7 @@ class LibClang { int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, - ffi.Pointer> out_TU, + ffi.Pointer out_TU, int TU_options, ) { return _clang_indexSourceFile( @@ -5655,18 +5800,42 @@ class LibClang { ); } - late final _clang_indexSourceFile_ptr = - _lookup>( - 'clang_indexSourceFile'); - late final _dart_clang_indexSourceFile _clang_indexSourceFile = - _clang_indexSourceFile_ptr.asFunction<_dart_clang_indexSourceFile>(); + late final _clang_indexSourceFile_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXIndexAction, + CXClientData, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32, + ffi.Pointer, + ffi.Pointer>, + ffi.Int32, + ffi.Pointer, + ffi.Uint32, + ffi.Pointer, + ffi.Uint32)>>('clang_indexSourceFile'); + late final _clang_indexSourceFile = _clang_indexSourceFile_ptr.asFunction< + int Function( + CXIndexAction, + CXClientData, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + ffi.Pointer, + int)>(); /// 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, + CXIndexAction arg0, + CXClientData client_data, ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, @@ -5675,7 +5844,7 @@ class LibClang { int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, - ffi.Pointer> out_TU, + ffi.Pointer out_TU, int TU_options, ) { return _clang_indexSourceFileFullArgv( @@ -5694,22 +5863,46 @@ class LibClang { ); } - late final _clang_indexSourceFileFullArgv_ptr = - _lookup>( - 'clang_indexSourceFileFullArgv'); - late final _dart_clang_indexSourceFileFullArgv - _clang_indexSourceFileFullArgv = _clang_indexSourceFileFullArgv_ptr - .asFunction<_dart_clang_indexSourceFileFullArgv>(); + late final _clang_indexSourceFileFullArgv_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXIndexAction, + CXClientData, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32, + ffi.Pointer, + ffi.Pointer>, + ffi.Int32, + ffi.Pointer, + ffi.Uint32, + ffi.Pointer, + ffi.Uint32)>>('clang_indexSourceFileFullArgv'); + late final _clang_indexSourceFileFullArgv = + _clang_indexSourceFileFullArgv_ptr.asFunction< + int Function( + CXIndexAction, + CXClientData, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + ffi.Pointer, + int)>(); /// Index the given translation unit via callbacks implemented through /// #IndexerCallbacks. int clang_indexTranslationUnit( - ffi.Pointer arg0, - ffi.Pointer client_data, + CXIndexAction arg0, + CXClientData client_data, ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, - ffi.Pointer arg5, + CXTranslationUnit arg5, ) { return _clang_indexTranslationUnit( arg0, @@ -5721,19 +5914,26 @@ class LibClang { ); } - late final _clang_indexTranslationUnit_ptr = - _lookup>( - 'clang_indexTranslationUnit'); - late final _dart_clang_indexTranslationUnit _clang_indexTranslationUnit = - _clang_indexTranslationUnit_ptr - .asFunction<_dart_clang_indexTranslationUnit>(); + late final _clang_indexTranslationUnit_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXIndexAction, + CXClientData, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32, + CXTranslationUnit)>>('clang_indexTranslationUnit'); + late final _clang_indexTranslationUnit = + _clang_indexTranslationUnit_ptr.asFunction< + int Function(CXIndexAction, CXClientData, + ffi.Pointer, int, int, CXTranslationUnit)>(); /// 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 indexFile, + ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -5748,12 +5948,24 @@ class LibClang { ); } - late final _clang_indexLoc_getFileLocation_ptr = - _lookup>( - 'clang_indexLoc_getFileLocation'); - late final _dart_clang_indexLoc_getFileLocation - _clang_indexLoc_getFileLocation = _clang_indexLoc_getFileLocation_ptr - .asFunction<_dart_clang_indexLoc_getFileLocation>(); + late final _clang_indexLoc_getFileLocation_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CXIdxLoc, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_indexLoc_getFileLocation'); + late final _clang_indexLoc_getFileLocation = + _clang_indexLoc_getFileLocation_ptr.asFunction< + void Function( + CXIdxLoc, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve the CXSourceLocation represented by the given CXIdxLoc. CXSourceLocation clang_indexLoc_getCXSourceLocation( @@ -5765,18 +5977,17 @@ class LibClang { } late final _clang_indexLoc_getCXSourceLocation_ptr = - _lookup>( + _lookup>( 'clang_indexLoc_getCXSourceLocation'); - late final _dart_clang_indexLoc_getCXSourceLocation - _clang_indexLoc_getCXSourceLocation = + late final _clang_indexLoc_getCXSourceLocation = _clang_indexLoc_getCXSourceLocation_ptr - .asFunction<_dart_clang_indexLoc_getCXSourceLocation>(); + .asFunction(); /// Visit the fields of a particular type. int clang_Type_visitFields( CXType T, - ffi.Pointer> visitor, - ffi.Pointer client_data, + CXFieldVisitor visitor, + CXClientData client_data, ) { return _clang_Type_visitFields( T, @@ -5785,11 +5996,12 @@ class LibClang { ); } - late final _clang_Type_visitFields_ptr = - _lookup>( - 'clang_Type_visitFields'); - late final _dart_clang_Type_visitFields _clang_Type_visitFields = - _clang_Type_visitFields_ptr.asFunction<_dart_clang_Type_visitFields>(); + late final _clang_Type_visitFields_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint32 Function( + CXType, CXFieldVisitor, CXClientData)>>('clang_Type_visitFields'); + late final _clang_Type_visitFields = _clang_Type_visitFields_ptr + .asFunction(); } /// Error codes returned by libclang routines. @@ -5827,8 +6039,15 @@ class CXStringSet extends ffi.Struct { class CXVirtualFileOverlayImpl extends ffi.Opaque {} +/// Object encapsulating information about overlaying virtual file/directories +/// over the real file system. +typedef CXVirtualFileOverlay = ffi.Pointer; + class CXModuleMapDescriptorImpl extends ffi.Opaque {} +/// Object encapsulating information about a module.map file. +typedef CXModuleMapDescriptor = ffi.Pointer; + class CXTargetInfoImpl extends ffi.Opaque {} class CXTranslationUnitImpl extends ffi.Opaque {} @@ -5917,6 +6136,10 @@ abstract class CXCursor_ExceptionSpecificationKind { static const int CXCursor_ExceptionSpecificationKind_NoThrow = 9; } +/// An "index" that consists of a set of translation units that would typically +/// be linked together into an executable or library. +typedef CXIndex = ffi.Pointer; + abstract class CXGlobalOptFlags { /// Used to indicate that no special CXIndex options are needed. static const int CXGlobalOpt_None = 0; @@ -5934,6 +6157,9 @@ abstract class CXGlobalOptFlags { static const int CXGlobalOpt_ThreadBackgroundPriorityForAll = 3; } +/// A particular source file that is part of a translation unit. +typedef CXFile = ffi.Pointer; + /// Uniquely identifies a CXFile, that refers to the same underlying file, /// across an indexing session. class CXFileUniqueID extends ffi.Struct { @@ -5941,6 +6167,9 @@ class CXFileUniqueID extends ffi.Struct { external ffi.Array data; } +/// A single translation unit, which resides in an index. +typedef CXTranslationUnit = ffi.Pointer; + /// Identifies a specific source location within a translation unit. class CXSourceLocation extends ffi.Struct { @ffi.Array.multi([2]) @@ -5992,6 +6221,13 @@ abstract class CXDiagnosticSeverity { static const int CXDiagnostic_Fatal = 4; } +/// A group of CXDiagnostics. +typedef CXDiagnosticSet = ffi.Pointer; + +/// A single diagnostic, containing the diagnostic's severity, location, text, +/// source ranges, and fix-it hints. +typedef CXDiagnostic = ffi.Pointer; + /// Describes the kind of error that occurred (if any) in a call to /// clang_loadDiagnostics. abstract class CXLoadDiag_Error { @@ -6168,6 +6404,9 @@ class CXTUResourceUsage extends ffi.Struct { external ffi.Pointer entries; } +/// An opaque type representing target information for a given translation unit. +typedef CXTargetInfo = ffi.Pointer; + /// Describes the kind of entity that a cursor refers to. abstract class CXCursorKind { /// A declaration whose specific kind is not exposed via this interface. @@ -6914,6 +7153,9 @@ abstract class CXTLSKind { class CXCursorSetImpl extends ffi.Opaque {} +/// A fast container representing a set of CXCursors. +typedef CXCursorSet = ffi.Pointer; + /// Describes the kind of type abstract class CXTypeKind { /// Represents an invalid type (e.g., where no type is available). @@ -7174,6 +7416,14 @@ abstract class CXChildVisitResult { static const int CXChildVisit_Recurse = 2; } +/// Visitor invoked for each cursor found by a traversal. +typedef CXCursorVisitor = ffi.Pointer< + ffi.NativeFunction>; + +/// Opaque pointer representing client data that will be passed through to +/// various callbacks and visitors. +typedef CXClientData = ffi.Pointer; + /// Properties for the printing policy. abstract class CXPrintingPolicyProperty { static const int CXPrintingPolicy_Indentation = 0; @@ -7205,6 +7455,10 @@ abstract class CXPrintingPolicyProperty { static const int CXPrintingPolicy_LastProperty = 25; } +/// Opaque pointer representing a policy that controls pretty printing for +/// clang_getCursorPrettyPrinted. +typedef CXPrintingPolicy = ffi.Pointer; + /// Property attributes for a CXCursor_ObjCPropertyDecl. abstract class CXObjCPropertyAttrKind { static const int CXObjCPropertyAttr_noattr = 0; @@ -7235,6 +7489,9 @@ abstract class CXObjCDeclQualifierKind { static const int CXObjCDeclQualifier_Oneway = 32; } +/// The functions in this group provide access to information about modules. +typedef CXModule = ffi.Pointer; + abstract class CXNameRefFlags { /// Include the nested-name-specifier, e.g. Foo:: in x.Foo::y, in the range. static const int CXNameRange_WantQualifier = 1; @@ -7281,9 +7538,12 @@ class CXCompletionResult extends ffi.Struct { /// The code-completion string that describes how to insert this /// code-completion result into the editing buffer. - external ffi.Pointer CompletionString; + external CXCompletionString CompletionString; } +/// A semantic string that describes a code-completion result. +typedef CXCompletionString = ffi.Pointer; + /// 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 @@ -7484,6 +7744,13 @@ abstract class CXCompletionContext { static const int CXCompletionContext_Unknown = 8388607; } +/// Visitor invoked for each file in a translation unit (used with +/// clang_getInclusions()). +typedef CXInclusionVisitor = ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + CXFile, ffi.Pointer, ffi.Uint32, CXClientData)>>; + abstract class CXEvalResultKind { static const int CXEval_Int = 1; static const int CXEval_Float = 2; @@ -7494,6 +7761,12 @@ abstract class CXEvalResultKind { static const int CXEval_UnExposed = 0; } +/// Evaluation result of a cursor +typedef CXEvalResult = ffi.Pointer; + +/// A remapping of original source files and their translated files. +typedef CXRemapping = ffi.Pointer; + /// @{ abstract class CXVisitorResult { static const int CXVisit_Break = 0; @@ -7503,7 +7776,10 @@ abstract class CXVisitorResult { class CXCursorAndRangeVisitor extends ffi.Struct { external ffi.Pointer context; - external ffi.Pointer> visit; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, CXCursor, CXSourceRange)>> visit; } abstract class CXResult { @@ -7535,7 +7811,7 @@ class CXIdxIncludedFileInfo extends ffi.Struct { external ffi.Pointer filename; /// The actual file that the #include/#import directive resolved to. - external ffi.Pointer file; + external CXFile file; @ffi.Int32() external int isImport; @@ -7551,10 +7827,10 @@ class CXIdxIncludedFileInfo extends ffi.Struct { /// Data for IndexerCallbacks#importedASTFile. class CXIdxImportedASTFileInfo extends ffi.Struct { /// Top level AST file containing the imported PCH, module or submodule. - external ffi.Pointer file; + external CXFile file; /// The imported module or NULL if the AST file is a PCH. - external ffi.Pointer module; + external CXModule module; /// Location where the file is imported. Applicable only for modules. external CXIdxLoc loc; @@ -7834,28 +8110,72 @@ class CXIdxEntityRefInfo extends ffi.Struct { 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; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(CXClientData, ffi.Pointer)>> abortQuery; /// Called at the end of indexing; passes the complete diagnostic set. - external ffi.Pointer> diagnostic; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + CXClientData, CXDiagnosticSet, ffi.Pointer)>> + diagnostic; - external ffi.Pointer> enteredMainFile; + external ffi.Pointer< + ffi.NativeFunction< + CXIdxClientFile Function( + CXClientData, CXFile, ffi.Pointer)>> enteredMainFile; /// Called when a file gets #included/#imported. - external ffi.Pointer> ppIncludedFile; + external ffi.Pointer< + ffi.NativeFunction< + CXIdxClientFile Function( + CXClientData, ffi.Pointer)>> + ppIncludedFile; /// Called when a AST file (PCH or module) gets imported. - external ffi.Pointer> importedASTFile; + external ffi.Pointer< + ffi.NativeFunction< + CXIdxClientASTFile Function( + CXClientData, ffi.Pointer)>> + importedASTFile; /// Called at the beginning of indexing a translation unit. - external ffi.Pointer> startedTranslationUnit; + external ffi.Pointer< + ffi.NativeFunction< + CXIdxClientContainer Function( + CXClientData, ffi.Pointer)>> startedTranslationUnit; - external ffi.Pointer> indexDeclaration; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(CXClientData, ffi.Pointer)>> + indexDeclaration; /// Called to index a reference of an entity. - external ffi.Pointer> indexEntityReference; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(CXClientData, ffi.Pointer)>> + indexEntityReference; } +/// The client's data object that is associated with a CXFile. +typedef CXIdxClientFile = ffi.Pointer; + +/// The client's data object that is associated with an AST file (PCH or +/// module). +typedef CXIdxClientASTFile = ffi.Pointer; + +/// The client's data object that is associated with a semantic container of +/// entities. +typedef CXIdxClientContainer = ffi.Pointer; + +/// The client's data object that is associated with a semantic entity. +typedef CXIdxClientEntity = ffi.Pointer; + +/// An indexing action/session, to be applied to one or multiple translation +/// units. +typedef CXIndexAction = ffi.Pointer; + abstract class CXIndexOptFlags { /// Used to indicate that no special indexing options are needed. static const int CXIndexOpt_None = 0; @@ -7882,6 +8202,10 @@ abstract class CXIndexOptFlags { static const int CXIndexOpt_SkipParsedBodiesInSession = 16; } +/// Visitor invoked for each field found by a traversal. +typedef CXFieldVisitor = ffi + .Pointer>; + const int CINDEX_VERSION_MAJOR = 0; const int CINDEX_VERSION_MINOR = 59; @@ -7889,3156 +8213,3 @@ 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, -); - -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, -); - -typedef _dart_clang_getCanonicalType = CXType Function( - CXType T, -); - -typedef _c_clang_isConstQualifiedType = ffi.Uint32 Function( - CXType T, -); - -typedef _dart_clang_isConstQualifiedType = int Function( - CXType T, -); - -typedef _c_clang_Cursor_isMacroFunctionLike = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isMacroFunctionLike = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isMacroBuiltin = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isMacroBuiltin = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isFunctionInlined = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isFunctionInlined = int Function( - CXCursor C, -); - -typedef _c_clang_isVolatileQualifiedType = ffi.Uint32 Function( - CXType T, -); - -typedef _dart_clang_isVolatileQualifiedType = int Function( - CXType T, -); - -typedef _c_clang_isRestrictQualifiedType = ffi.Uint32 Function( - CXType T, -); - -typedef _dart_clang_isRestrictQualifiedType = int Function( - CXType T, -); - -typedef _c_clang_getAddressSpace = ffi.Uint32 Function( - CXType T, -); - -typedef _dart_clang_getAddressSpace = int Function( - CXType T, -); - -typedef _c_clang_getTypedefName = CXString Function( - CXType CT, -); - -typedef _dart_clang_getTypedefName = CXString Function( - CXType CT, -); - -typedef _c_clang_getPointeeType = CXType Function( - CXType T, -); - -typedef _dart_clang_getPointeeType = CXType Function( - CXType T, -); - -typedef _c_clang_getTypeDeclaration = CXCursor Function( - CXType T, -); - -typedef _dart_clang_getTypeDeclaration = CXCursor Function( - CXType T, -); - -typedef _c_clang_getDeclObjCTypeEncoding = CXString Function( - CXCursor C, -); - -typedef _dart_clang_getDeclObjCTypeEncoding = CXString Function( - CXCursor C, -); - -typedef _c_clang_Type_getObjCEncoding = CXString Function( - CXType type, -); - -typedef _dart_clang_Type_getObjCEncoding = CXString Function( - CXType type, -); - -typedef _c_clang_getTypeKindSpelling = CXString Function( - ffi.Int32 K, -); - -typedef _dart_clang_getTypeKindSpelling = CXString Function( - int K, -); - -typedef _c_clang_getFunctionTypeCallingConv = ffi.Int32 Function( - CXType T, -); - -typedef _dart_clang_getFunctionTypeCallingConv = int Function( - CXType T, -); - -typedef _c_clang_getResultType = CXType Function( - CXType T, -); - -typedef _dart_clang_getResultType = CXType Function( - CXType T, -); - -typedef _c_clang_getExceptionSpecificationType = ffi.Int32 Function( - CXType T, -); - -typedef _dart_clang_getExceptionSpecificationType = int Function( - CXType T, -); - -typedef _c_clang_getNumArgTypes = ffi.Int32 Function( - CXType T, -); - -typedef _dart_clang_getNumArgTypes = int Function( - CXType T, -); - -typedef _c_clang_getArgType = CXType Function( - CXType T, - ffi.Uint32 i, -); - -typedef _dart_clang_getArgType = CXType Function( - CXType T, - int i, -); - -typedef _c_clang_Type_getObjCObjectBaseType = CXType Function( - CXType T, -); - -typedef _dart_clang_Type_getObjCObjectBaseType = CXType Function( - CXType T, -); - -typedef _c_clang_Type_getNumObjCProtocolRefs = ffi.Uint32 Function( - CXType T, -); - -typedef _dart_clang_Type_getNumObjCProtocolRefs = int Function( - CXType T, -); - -typedef _c_clang_Type_getObjCProtocolDecl = CXCursor Function( - CXType T, - ffi.Uint32 i, -); - -typedef _dart_clang_Type_getObjCProtocolDecl = CXCursor Function( - CXType T, - int i, -); - -typedef _c_clang_Type_getNumObjCTypeArgs = ffi.Uint32 Function( - CXType T, -); - -typedef _dart_clang_Type_getNumObjCTypeArgs = int Function( - CXType T, -); - -typedef _c_clang_Type_getObjCTypeArg = CXType Function( - CXType T, - ffi.Uint32 i, -); - -typedef _dart_clang_Type_getObjCTypeArg = CXType Function( - CXType T, - int i, -); - -typedef _c_clang_isFunctionTypeVariadic = ffi.Uint32 Function( - CXType T, -); - -typedef _dart_clang_isFunctionTypeVariadic = int Function( - CXType T, -); - -typedef _c_clang_getCursorResultType = CXType Function( - CXCursor C, -); - -typedef _dart_clang_getCursorResultType = CXType Function( - CXCursor C, -); - -typedef _c_clang_getCursorExceptionSpecificationType = ffi.Int32 Function( - CXCursor C, -); - -typedef _dart_clang_getCursorExceptionSpecificationType = int Function( - CXCursor C, -); - -typedef _c_clang_isPODType = ffi.Uint32 Function( - CXType T, -); - -typedef _dart_clang_isPODType = int Function( - CXType T, -); - -typedef _c_clang_getElementType = CXType Function( - CXType T, -); - -typedef _dart_clang_getElementType = CXType Function( - CXType T, -); - -typedef _c_clang_getNumElements = ffi.Int64 Function( - CXType T, -); - -typedef _dart_clang_getNumElements = int Function( - CXType T, -); - -typedef _c_clang_getArrayElementType = CXType Function( - CXType T, -); - -typedef _dart_clang_getArrayElementType = CXType Function( - CXType T, -); - -typedef _c_clang_getArraySize = ffi.Int64 Function( - CXType T, -); - -typedef _dart_clang_getArraySize = int Function( - CXType T, -); - -typedef _c_clang_Type_getNamedType = CXType Function( - CXType T, -); - -typedef _dart_clang_Type_getNamedType = CXType Function( - CXType T, -); - -typedef _c_clang_Type_isTransparentTagTypedef = ffi.Uint32 Function( - CXType T, -); - -typedef _dart_clang_Type_isTransparentTagTypedef = int Function( - CXType T, -); - -typedef _c_clang_Type_getNullability = ffi.Int32 Function( - CXType T, -); - -typedef _dart_clang_Type_getNullability = int Function( - CXType T, -); - -typedef _c_clang_Type_getAlignOf = ffi.Int64 Function( - CXType T, -); - -typedef _dart_clang_Type_getAlignOf = int Function( - CXType T, -); - -typedef _c_clang_Type_getClassType = CXType Function( - CXType T, -); - -typedef _dart_clang_Type_getClassType = CXType Function( - CXType T, -); - -typedef _c_clang_Type_getSizeOf = ffi.Int64 Function( - CXType T, -); - -typedef _dart_clang_Type_getSizeOf = int Function( - CXType T, -); - -typedef _c_clang_Type_getOffsetOf = ffi.Int64 Function( - CXType T, - ffi.Pointer S, -); - -typedef _dart_clang_Type_getOffsetOf = int Function( - CXType T, - ffi.Pointer S, -); - -typedef _c_clang_Type_getModifiedType = CXType Function( - CXType T, -); - -typedef _dart_clang_Type_getModifiedType = CXType Function( - CXType T, -); - -typedef _c_clang_Cursor_getOffsetOfField = ffi.Int64 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getOffsetOfField = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isAnonymous = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isAnonymous = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isAnonymousRecordDecl = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isAnonymousRecordDecl = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isInlineNamespace = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isInlineNamespace = int Function( - CXCursor C, -); - -typedef _c_clang_Type_getNumTemplateArguments = ffi.Int32 Function( - CXType T, -); - -typedef _dart_clang_Type_getNumTemplateArguments = int Function( - CXType T, -); - -typedef _c_clang_Type_getTemplateArgumentAsType = CXType Function( - CXType T, - ffi.Uint32 i, -); - -typedef _dart_clang_Type_getTemplateArgumentAsType = CXType Function( - CXType T, - int i, -); - -typedef _c_clang_Type_getCXXRefQualifier = ffi.Int32 Function( - CXType T, -); - -typedef _dart_clang_Type_getCXXRefQualifier = int Function( - CXType T, -); - -typedef _c_clang_Cursor_isBitField = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isBitField = int Function( - CXCursor C, -); - -typedef _c_clang_isVirtualBase = ffi.Uint32 Function( - CXCursor arg0, -); - -typedef _dart_clang_isVirtualBase = int Function( - CXCursor arg0, -); - -typedef _c_clang_getCXXAccessSpecifier = ffi.Int32 Function( - CXCursor arg0, -); - -typedef _dart_clang_getCXXAccessSpecifier = int Function( - CXCursor arg0, -); - -typedef _c_clang_Cursor_getStorageClass = ffi.Int32 Function( - CXCursor arg0, -); - -typedef _dart_clang_Cursor_getStorageClass = int Function( - CXCursor arg0, -); - -typedef _c_clang_getNumOverloadedDecls = ffi.Uint32 Function( - CXCursor cursor, -); - -typedef _dart_clang_getNumOverloadedDecls = int Function( - CXCursor cursor, -); - -typedef _c_clang_getOverloadedDecl = CXCursor Function( - CXCursor cursor, - ffi.Uint32 index, -); - -typedef _dart_clang_getOverloadedDecl = CXCursor Function( - CXCursor cursor, - int index, -); - -typedef _c_clang_getIBOutletCollectionType = CXType Function( - CXCursor arg0, -); - -typedef _dart_clang_getIBOutletCollectionType = CXType Function( - CXCursor arg0, -); - -typedef CXCursorVisitor = ffi.Int32 Function( - CXCursor, - CXCursor, - ffi.Pointer, -); - -typedef _c_clang_visitChildren = ffi.Uint32 Function( - CXCursor parent, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); - -typedef _dart_clang_visitChildren = int Function( - CXCursor parent, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); - -typedef _c_clang_getCursorUSR = CXString Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorUSR = CXString Function( - CXCursor arg0, -); - -typedef _c_clang_constructUSR_ObjCClass = CXString Function( - ffi.Pointer class_name, -); - -typedef _dart_clang_constructUSR_ObjCClass = CXString Function( - ffi.Pointer class_name, -); - -typedef _c_clang_constructUSR_ObjCCategory = CXString Function( - ffi.Pointer class_name, - ffi.Pointer category_name, -); - -typedef _dart_clang_constructUSR_ObjCCategory = CXString Function( - ffi.Pointer class_name, - ffi.Pointer category_name, -); - -typedef _c_clang_constructUSR_ObjCProtocol = CXString Function( - ffi.Pointer protocol_name, -); - -typedef _dart_clang_constructUSR_ObjCProtocol = CXString Function( - ffi.Pointer protocol_name, -); - -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 _dart_clang_constructUSR_ObjCMethod = CXString Function( - ffi.Pointer name, - int isInstanceMethod, - CXString classUSR, -); - -typedef _c_clang_constructUSR_ObjCProperty = CXString Function( - ffi.Pointer property, - CXString classUSR, -); - -typedef _dart_clang_constructUSR_ObjCProperty = CXString Function( - ffi.Pointer property, - CXString classUSR, -); - -typedef _c_clang_getCursorSpelling = CXString Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorSpelling = CXString Function( - CXCursor arg0, -); - -typedef _c_clang_Cursor_getSpellingNameRange = CXSourceRange Function( - CXCursor arg0, - ffi.Uint32 pieceIndex, - ffi.Uint32 options, -); - -typedef _dart_clang_Cursor_getSpellingNameRange = CXSourceRange Function( - CXCursor arg0, - int pieceIndex, - int options, -); - -typedef _c_clang_PrintingPolicy_getProperty = ffi.Uint32 Function( - ffi.Pointer Policy, - ffi.Int32 Property, -); - -typedef _dart_clang_PrintingPolicy_getProperty = int Function( - ffi.Pointer Policy, - int Property, -); - -typedef _c_clang_PrintingPolicy_setProperty = ffi.Void Function( - ffi.Pointer Policy, - ffi.Int32 Property, - ffi.Uint32 Value, -); - -typedef _dart_clang_PrintingPolicy_setProperty = void Function( - ffi.Pointer Policy, - int Property, - int Value, -); - -typedef _c_clang_getCursorPrintingPolicy = ffi.Pointer Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorPrintingPolicy = ffi.Pointer Function( - CXCursor arg0, -); - -typedef _c_clang_PrintingPolicy_dispose = ffi.Void Function( - ffi.Pointer Policy, -); - -typedef _dart_clang_PrintingPolicy_dispose = void Function( - ffi.Pointer Policy, -); - -typedef _c_clang_getCursorPrettyPrinted = CXString Function( - CXCursor Cursor, - ffi.Pointer Policy, -); - -typedef _dart_clang_getCursorPrettyPrinted = CXString Function( - CXCursor Cursor, - ffi.Pointer Policy, -); - -typedef _c_clang_getCursorDisplayName = CXString Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorDisplayName = CXString Function( - CXCursor arg0, -); - -typedef _c_clang_getCursorReferenced = CXCursor Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorReferenced = CXCursor Function( - CXCursor arg0, -); - -typedef _c_clang_getCursorDefinition = CXCursor Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorDefinition = CXCursor Function( - CXCursor arg0, -); - -typedef _c_clang_isCursorDefinition = ffi.Uint32 Function( - CXCursor arg0, -); - -typedef _dart_clang_isCursorDefinition = int Function( - CXCursor arg0, -); - -typedef _c_clang_getCanonicalCursor = CXCursor Function( - CXCursor arg0, -); - -typedef _dart_clang_getCanonicalCursor = CXCursor Function( - CXCursor arg0, -); - -typedef _c_clang_Cursor_getObjCSelectorIndex = ffi.Int32 Function( - CXCursor arg0, -); - -typedef _dart_clang_Cursor_getObjCSelectorIndex = int Function( - CXCursor arg0, -); - -typedef _c_clang_Cursor_isDynamicCall = ffi.Int32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isDynamicCall = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getReceiverType = CXType Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getReceiverType = CXType Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getObjCPropertyAttributes = ffi.Uint32 Function( - CXCursor C, - ffi.Uint32 reserved, -); - -typedef _dart_clang_Cursor_getObjCPropertyAttributes = int Function( - CXCursor C, - int reserved, -); - -typedef _c_clang_Cursor_getObjCPropertyGetterName = CXString Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getObjCPropertyGetterName = CXString Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getObjCPropertySetterName = CXString Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getObjCPropertySetterName = CXString Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getObjCDeclQualifiers = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getObjCDeclQualifiers = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isObjCOptional = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isObjCOptional = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isVariadic = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isVariadic = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isExternalSymbol = ffi.Uint32 Function( - CXCursor C, - ffi.Pointer language, - ffi.Pointer definedIn, - ffi.Pointer isGenerated, -); - -typedef _dart_clang_Cursor_isExternalSymbol = int Function( - CXCursor C, - ffi.Pointer language, - ffi.Pointer definedIn, - ffi.Pointer isGenerated, -); - -typedef _c_clang_Cursor_getCommentRange = CXSourceRange Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getCommentRange = CXSourceRange Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getRawCommentText = CXString Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getRawCommentText = CXString Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getBriefCommentText = CXString Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getBriefCommentText = CXString Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getMangling = CXString Function( - CXCursor arg0, -); - -typedef _dart_clang_Cursor_getMangling = CXString Function( - CXCursor arg0, -); - -typedef _c_clang_Cursor_getCXXManglings = ffi.Pointer Function( - CXCursor arg0, -); - -typedef _dart_clang_Cursor_getCXXManglings = ffi.Pointer Function( - CXCursor arg0, -); - -typedef _c_clang_Cursor_getObjCManglings = ffi.Pointer Function( - CXCursor arg0, -); - -typedef _dart_clang_Cursor_getObjCManglings = ffi.Pointer Function( - CXCursor arg0, -); - -typedef _c_clang_Cursor_getModule = ffi.Pointer Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getModule = ffi.Pointer Function( - CXCursor C, -); - -typedef _c_clang_getModuleForFile = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _dart_clang_getModuleForFile = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _c_clang_Module_getASTFile = ffi.Pointer Function( - ffi.Pointer Module, -); - -typedef _dart_clang_Module_getASTFile = ffi.Pointer Function( - ffi.Pointer Module, -); - -typedef _c_clang_Module_getParent = ffi.Pointer Function( - ffi.Pointer Module, -); - -typedef _dart_clang_Module_getParent = ffi.Pointer Function( - ffi.Pointer Module, -); - -typedef _c_clang_Module_getName = CXString Function( - ffi.Pointer Module, -); - -typedef _dart_clang_Module_getName = CXString Function( - ffi.Pointer Module, -); - -typedef _c_clang_Module_getFullName = CXString Function( - ffi.Pointer Module, -); - -typedef _dart_clang_Module_getFullName = CXString Function( - ffi.Pointer Module, -); - -typedef _c_clang_Module_isSystem = ffi.Int32 Function( - ffi.Pointer Module, -); - -typedef _dart_clang_Module_isSystem = int Function( - ffi.Pointer Module, -); - -typedef _c_clang_Module_getNumTopLevelHeaders = ffi.Uint32 Function( - ffi.Pointer arg0, - ffi.Pointer Module, -); - -typedef _dart_clang_Module_getNumTopLevelHeaders = int Function( - ffi.Pointer arg0, - ffi.Pointer Module, -); - -typedef _c_clang_Module_getTopLevelHeader = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer Module, - ffi.Uint32 Index, -); - -typedef _dart_clang_Module_getTopLevelHeader = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer Module, - int Index, -); - -typedef _c_clang_CXXConstructor_isConvertingConstructor = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXConstructor_isConvertingConstructor = int Function( - CXCursor C, -); - -typedef _c_clang_CXXConstructor_isCopyConstructor = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXConstructor_isCopyConstructor = int Function( - CXCursor C, -); - -typedef _c_clang_CXXConstructor_isDefaultConstructor = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXConstructor_isDefaultConstructor = int Function( - CXCursor C, -); - -typedef _c_clang_CXXConstructor_isMoveConstructor = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXConstructor_isMoveConstructor = int Function( - CXCursor C, -); - -typedef _c_clang_CXXField_isMutable = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXField_isMutable = int Function( - CXCursor C, -); - -typedef _c_clang_CXXMethod_isDefaulted = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXMethod_isDefaulted = int Function( - CXCursor C, -); - -typedef _c_clang_CXXMethod_isPureVirtual = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXMethod_isPureVirtual = int Function( - CXCursor C, -); - -typedef _c_clang_CXXMethod_isStatic = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXMethod_isStatic = int Function( - CXCursor C, -); - -typedef _c_clang_CXXMethod_isVirtual = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXMethod_isVirtual = int Function( - CXCursor C, -); - -typedef _c_clang_CXXRecord_isAbstract = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXRecord_isAbstract = int Function( - CXCursor C, -); - -typedef _c_clang_EnumDecl_isScoped = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_EnumDecl_isScoped = int Function( - CXCursor C, -); - -typedef _c_clang_CXXMethod_isConst = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXMethod_isConst = int Function( - CXCursor C, -); - -typedef _c_clang_getTemplateCursorKind = ffi.Int32 Function( - CXCursor C, -); - -typedef _dart_clang_getTemplateCursorKind = int Function( - CXCursor C, -); - -typedef _c_clang_getSpecializedCursorTemplate = CXCursor Function( - CXCursor C, -); - -typedef _dart_clang_getSpecializedCursorTemplate = CXCursor Function( - CXCursor C, -); - -typedef _c_clang_getCursorReferenceNameRange = CXSourceRange Function( - CXCursor C, - ffi.Uint32 NameFlags, - ffi.Uint32 PieceIndex, -); - -typedef _dart_clang_getCursorReferenceNameRange = CXSourceRange Function( - CXCursor C, - int NameFlags, - int PieceIndex, -); - -typedef _c_clang_getToken = ffi.Pointer Function( - ffi.Pointer TU, - CXSourceLocation Location, -); - -typedef _dart_clang_getToken = ffi.Pointer Function( - ffi.Pointer TU, - CXSourceLocation Location, -); - -typedef _c_clang_getTokenKind = ffi.Int32 Function( - CXToken arg0, -); - -typedef _dart_clang_getTokenKind = int Function( - CXToken arg0, -); - -typedef _c_clang_getTokenSpelling = CXString Function( - ffi.Pointer arg0, - CXToken arg1, -); - -typedef _dart_clang_getTokenSpelling = CXString Function( - ffi.Pointer arg0, - CXToken arg1, -); - -typedef _c_clang_getTokenLocation = CXSourceLocation Function( - ffi.Pointer arg0, - CXToken arg1, -); - -typedef _dart_clang_getTokenLocation = CXSourceLocation Function( - ffi.Pointer arg0, - CXToken arg1, -); - -typedef _c_clang_getTokenExtent = CXSourceRange Function( - ffi.Pointer arg0, - CXToken arg1, -); - -typedef _dart_clang_getTokenExtent = CXSourceRange Function( - ffi.Pointer arg0, - 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( - ffi.Pointer TU, - ffi.Pointer Tokens, - ffi.Uint32 NumTokens, - ffi.Pointer Cursors, -); - -typedef _dart_clang_annotateTokens = void Function( - ffi.Pointer TU, - ffi.Pointer Tokens, - int NumTokens, - ffi.Pointer Cursors, -); - -typedef _c_clang_disposeTokens = ffi.Void Function( - ffi.Pointer TU, - ffi.Pointer Tokens, - ffi.Uint32 NumTokens, -); - -typedef _dart_clang_disposeTokens = void Function( - ffi.Pointer TU, - ffi.Pointer Tokens, - 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(); - -typedef _typedefC_1 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_clang_executeOnThread = ffi.Void Function( - ffi.Pointer> fn, - ffi.Pointer user_data, - ffi.Uint32 stack_size, -); - -typedef _dart_clang_executeOnThread = void Function( - ffi.Pointer> fn, - ffi.Pointer user_data, - int stack_size, -); - -typedef _c_clang_getCompletionChunkKind = ffi.Int32 Function( - ffi.Pointer completion_string, - ffi.Uint32 chunk_number, -); - -typedef _dart_clang_getCompletionChunkKind = int Function( - ffi.Pointer completion_string, - 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, - ffi.Uint32 chunk_number, -); - -typedef _dart_clang_getCompletionChunkCompletionString = ffi.Pointer - Function( - ffi.Pointer completion_string, - int chunk_number, -); - -typedef _c_clang_getNumCompletionChunks = ffi.Uint32 Function( - ffi.Pointer completion_string, -); - -typedef _dart_clang_getNumCompletionChunks = int Function( - ffi.Pointer completion_string, -); - -typedef _c_clang_getCompletionPriority = ffi.Uint32 Function( - ffi.Pointer completion_string, -); - -typedef _dart_clang_getCompletionPriority = int Function( - ffi.Pointer completion_string, -); - -typedef _c_clang_getCompletionAvailability = ffi.Int32 Function( - ffi.Pointer completion_string, -); - -typedef _dart_clang_getCompletionAvailability = int Function( - ffi.Pointer completion_string, -); - -typedef _c_clang_getCompletionNumAnnotations = ffi.Uint32 Function( - ffi.Pointer completion_string, -); - -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, -); - -typedef _dart_clang_getCompletionNumFixIts = int Function( - ffi.Pointer results, - 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(); - -typedef _c_clang_codeCompleteAt = ffi.Pointer Function( - ffi.Pointer TU, - ffi.Pointer complete_filename, - ffi.Uint32 complete_line, - ffi.Uint32 complete_column, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options, -); - -typedef _dart_clang_codeCompleteAt = ffi.Pointer - Function( - ffi.Pointer TU, - ffi.Pointer complete_filename, - int complete_line, - int complete_column, - ffi.Pointer unsaved_files, - int num_unsaved_files, - int options, -); - -typedef _c_clang_sortCodeCompletionResults = ffi.Void Function( - ffi.Pointer Results, - ffi.Uint32 NumResults, -); - -typedef _dart_clang_sortCodeCompletionResults = void Function( - ffi.Pointer Results, - int NumResults, -); - -typedef _c_clang_disposeCodeCompleteResults = ffi.Void Function( - ffi.Pointer Results, -); - -typedef _dart_clang_disposeCodeCompleteResults = void Function( - ffi.Pointer Results, -); - -typedef _c_clang_codeCompleteGetNumDiagnostics = ffi.Uint32 Function( - ffi.Pointer Results, -); - -typedef _dart_clang_codeCompleteGetNumDiagnostics = int Function( - ffi.Pointer Results, -); - -typedef _c_clang_codeCompleteGetDiagnostic = ffi.Pointer Function( - ffi.Pointer Results, - ffi.Uint32 Index, -); - -typedef _dart_clang_codeCompleteGetDiagnostic = ffi.Pointer Function( - ffi.Pointer Results, - int Index, -); - -typedef _c_clang_codeCompleteGetContexts = ffi.Uint64 Function( - ffi.Pointer Results, -); - -typedef _dart_clang_codeCompleteGetContexts = int Function( - ffi.Pointer Results, -); - -typedef _c_clang_codeCompleteGetContainerKind = ffi.Int32 Function( - ffi.Pointer Results, - ffi.Pointer IsIncomplete, -); - -typedef _dart_clang_codeCompleteGetContainerKind = int Function( - ffi.Pointer Results, - 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, -); - -typedef _dart_clang_toggleCrashRecovery = void Function( - int isEnabled, -); - -typedef CXInclusionVisitor = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Uint32, - ffi.Pointer, -); - -typedef _c_clang_getInclusions = ffi.Void Function( - ffi.Pointer tu, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); - -typedef _dart_clang_getInclusions = void Function( - ffi.Pointer tu, - ffi.Pointer> visitor, - 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, -); - -typedef _dart_clang_EvalResult_getKind = int Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsInt = ffi.Int32 Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsInt = int Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsLongLong = ffi.Int64 Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsLongLong = int Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_isUnsignedInt = ffi.Uint32 Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_isUnsignedInt = int Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsUnsigned = ffi.Uint64 Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsUnsigned = int Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsDouble = ffi.Double Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsDouble = double Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsStr = ffi.Pointer Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsStr = ffi.Pointer Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_dispose = ffi.Void Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_dispose = void Function( - ffi.Pointer E, -); - -typedef _c_clang_getRemappings = ffi.Pointer Function( - ffi.Pointer path, -); - -typedef _dart_clang_getRemappings = ffi.Pointer Function( - ffi.Pointer path, -); - -typedef _c_clang_getRemappingsFromFileList = ffi.Pointer Function( - ffi.Pointer> filePaths, - ffi.Uint32 numFiles, -); - -typedef _dart_clang_getRemappingsFromFileList = ffi.Pointer Function( - ffi.Pointer> filePaths, - int numFiles, -); - -typedef _c_clang_remap_getNumFiles = ffi.Uint32 Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_remap_getNumFiles = int Function( - ffi.Pointer arg0, -); - -typedef _c_clang_remap_getFilenames = ffi.Void Function( - ffi.Pointer arg0, - ffi.Uint32 index, - ffi.Pointer original, - ffi.Pointer transformed, -); - -typedef _dart_clang_remap_getFilenames = void Function( - ffi.Pointer arg0, - int index, - ffi.Pointer original, - ffi.Pointer transformed, -); - -typedef _c_clang_remap_dispose = ffi.Void Function( - ffi.Pointer arg0, -); - -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, -); - -typedef _dart_clang_index_isEntityObjCContainerKind = int Function( - int arg0, -); - -typedef _c_clang_index_getObjCContainerDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getObjCContainerDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_clang_index_getObjCInterfaceDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getObjCInterfaceDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_clang_index_getObjCCategoryDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getObjCCategoryDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_clang_index_getObjCProtocolRefListInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getObjCProtocolRefListInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_clang_index_getObjCPropertyDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getObjCPropertyDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_clang_index_getIBOutletCollectionAttrInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getIBOutletCollectionAttrInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_clang_index_getCXXClassDeclInfo = ffi.Pointer - Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getCXXClassDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_clang_index_getClientContainer = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getClientContainer = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_clang_index_setClientContainer = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _dart_clang_index_setClientContainer = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _c_clang_index_getClientEntity = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getClientEntity = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_clang_index_setClientEntity = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _dart_clang_index_setClientEntity = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _c_clang_IndexAction_create = ffi.Pointer Function( - ffi.Pointer CIdx, -); - -typedef _dart_clang_IndexAction_create = ffi.Pointer Function( - ffi.Pointer CIdx, -); - -typedef _c_clang_IndexAction_dispose = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_IndexAction_dispose = void Function( - ffi.Pointer arg0, -); - -typedef _c_clang_indexSourceFile = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - ffi.Uint32 index_callbacks_size, - ffi.Uint32 index_options, - 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.Pointer> out_TU, - ffi.Uint32 TU_options, -); - -typedef _dart_clang_indexSourceFile = int Function( - 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, -); - -typedef _c_clang_indexSourceFileFullArgv = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - ffi.Uint32 index_callbacks_size, - ffi.Uint32 index_options, - 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.Pointer> out_TU, - ffi.Uint32 TU_options, -); - -typedef _dart_clang_indexSourceFileFullArgv = int Function( - 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, -); - -typedef _c_clang_indexTranslationUnit = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - ffi.Uint32 index_callbacks_size, - ffi.Uint32 index_options, - ffi.Pointer arg5, -); - -typedef _dart_clang_indexTranslationUnit = int Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - int index_callbacks_size, - int index_options, - 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_4 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_5 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_6 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_7 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_8 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_9 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_10 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, -); diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index 9580bd19c4..b8b13ed528 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -61,29 +61,30 @@ class SQLite { } late final _sqlite3_libversion_ptr = - _lookup>('sqlite3_libversion'); - late final _dart_sqlite3_libversion _sqlite3_libversion = - _sqlite3_libversion_ptr.asFunction<_dart_sqlite3_libversion>(); + _lookup Function()>>( + 'sqlite3_libversion'); + late final _sqlite3_libversion = + _sqlite3_libversion_ptr.asFunction Function()>(); ffi.Pointer sqlite3_sourceid() { return _sqlite3_sourceid(); } late final _sqlite3_sourceid_ptr = - _lookup>('sqlite3_sourceid'); - late final _dart_sqlite3_sourceid _sqlite3_sourceid = - _sqlite3_sourceid_ptr.asFunction<_dart_sqlite3_sourceid>(); + _lookup Function()>>( + 'sqlite3_sourceid'); + late final _sqlite3_sourceid = + _sqlite3_sourceid_ptr.asFunction Function()>(); int sqlite3_libversion_number() { return _sqlite3_libversion_number(); } late final _sqlite3_libversion_number_ptr = - _lookup>( + _lookup>( 'sqlite3_libversion_number'); - late final _dart_sqlite3_libversion_number _sqlite3_libversion_number = - _sqlite3_libversion_number_ptr - .asFunction<_dart_sqlite3_libversion_number>(); + late final _sqlite3_libversion_number = + _sqlite3_libversion_number_ptr.asFunction(); int sqlite3_compileoption_used( ffi.Pointer zOptName, @@ -94,11 +95,10 @@ class SQLite { } late final _sqlite3_compileoption_used_ptr = - _lookup>( + _lookup)>>( 'sqlite3_compileoption_used'); - late final _dart_sqlite3_compileoption_used _sqlite3_compileoption_used = - _sqlite3_compileoption_used_ptr - .asFunction<_dart_sqlite3_compileoption_used>(); + late final _sqlite3_compileoption_used = _sqlite3_compileoption_used_ptr + .asFunction)>(); ffi.Pointer sqlite3_compileoption_get( int N, @@ -109,11 +109,10 @@ class SQLite { } late final _sqlite3_compileoption_get_ptr = - _lookup>( + _lookup Function(ffi.Int32)>>( 'sqlite3_compileoption_get'); - late final _dart_sqlite3_compileoption_get _sqlite3_compileoption_get = - _sqlite3_compileoption_get_ptr - .asFunction<_dart_sqlite3_compileoption_get>(); + late final _sqlite3_compileoption_get = _sqlite3_compileoption_get_ptr + .asFunction Function(int)>(); /// CAPI3REF: Test To See If The Library Is Threadsafe /// @@ -154,9 +153,9 @@ class SQLite { } late final _sqlite3_threadsafe_ptr = - _lookup>('sqlite3_threadsafe'); - late final _dart_sqlite3_threadsafe _sqlite3_threadsafe = - _sqlite3_threadsafe_ptr.asFunction<_dart_sqlite3_threadsafe>(); + _lookup>('sqlite3_threadsafe'); + late final _sqlite3_threadsafe = + _sqlite3_threadsafe_ptr.asFunction(); /// CAPI3REF: Closing A Database Connection /// DESTRUCTOR: sqlite3 @@ -203,9 +202,10 @@ class SQLite { } late final _sqlite3_close_ptr = - _lookup>('sqlite3_close'); - late final _dart_sqlite3_close _sqlite3_close = - _sqlite3_close_ptr.asFunction<_dart_sqlite3_close>(); + _lookup)>>( + 'sqlite3_close'); + late final _sqlite3_close = + _sqlite3_close_ptr.asFunction)>(); int sqlite3_close_v2( ffi.Pointer arg0, @@ -216,9 +216,10 @@ class SQLite { } late final _sqlite3_close_v2_ptr = - _lookup>('sqlite3_close_v2'); - late final _dart_sqlite3_close_v2 _sqlite3_close_v2 = - _sqlite3_close_v2_ptr.asFunction<_dart_sqlite3_close_v2>(); + _lookup)>>( + 'sqlite3_close_v2'); + late final _sqlite3_close_v2 = + _sqlite3_close_v2_ptr.asFunction)>(); /// CAPI3REF: One-Step Query Execution Interface /// METHOD: sqlite3 @@ -283,7 +284,14 @@ class SQLite { int sqlite3_exec( ffi.Pointer arg0, ffi.Pointer sql, - ffi.Pointer> callback, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>)>> + callback, ffi.Pointer arg3, ffi.Pointer> errmsg, ) { @@ -296,10 +304,33 @@ class SQLite { ); } - late final _sqlite3_exec_ptr = - _lookup>('sqlite3_exec'); - late final _dart_sqlite3_exec _sqlite3_exec = - _sqlite3_exec_ptr.asFunction<_dart_sqlite3_exec>(); + late final _sqlite3_exec_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>)>>, + ffi.Pointer, + ffi.Pointer>)>>('sqlite3_exec'); + late final _sqlite3_exec = _sqlite3_exec_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>)>>, + ffi.Pointer, + ffi.Pointer>)>(); /// CAPI3REF: Initialize The SQLite Library /// @@ -379,36 +410,35 @@ class SQLite { } late final _sqlite3_initialize_ptr = - _lookup>('sqlite3_initialize'); - late final _dart_sqlite3_initialize _sqlite3_initialize = - _sqlite3_initialize_ptr.asFunction<_dart_sqlite3_initialize>(); + _lookup>('sqlite3_initialize'); + late final _sqlite3_initialize = + _sqlite3_initialize_ptr.asFunction(); int sqlite3_shutdown() { return _sqlite3_shutdown(); } late final _sqlite3_shutdown_ptr = - _lookup>('sqlite3_shutdown'); - late final _dart_sqlite3_shutdown _sqlite3_shutdown = - _sqlite3_shutdown_ptr.asFunction<_dart_sqlite3_shutdown>(); + _lookup>('sqlite3_shutdown'); + late final _sqlite3_shutdown = + _sqlite3_shutdown_ptr.asFunction(); int sqlite3_os_init() { return _sqlite3_os_init(); } late final _sqlite3_os_init_ptr = - _lookup>('sqlite3_os_init'); - late final _dart_sqlite3_os_init _sqlite3_os_init = - _sqlite3_os_init_ptr.asFunction<_dart_sqlite3_os_init>(); + _lookup>('sqlite3_os_init'); + late final _sqlite3_os_init = + _sqlite3_os_init_ptr.asFunction(); int sqlite3_os_end() { return _sqlite3_os_end(); } late final _sqlite3_os_end_ptr = - _lookup>('sqlite3_os_end'); - late final _dart_sqlite3_os_end _sqlite3_os_end = - _sqlite3_os_end_ptr.asFunction<_dart_sqlite3_os_end>(); + _lookup>('sqlite3_os_end'); + late final _sqlite3_os_end = _sqlite3_os_end_ptr.asFunction(); /// CAPI3REF: Configuring The SQLite Library /// @@ -448,9 +478,10 @@ class SQLite { } late final _sqlite3_config_ptr = - _lookup>('sqlite3_config'); - late final _dart_sqlite3_config _sqlite3_config = - _sqlite3_config_ptr.asFunction<_dart_sqlite3_config>(); + _lookup>( + 'sqlite3_config'); + late final _sqlite3_config = + _sqlite3_config_ptr.asFunction(); /// CAPI3REF: Configure database connections /// METHOD: sqlite3 @@ -477,10 +508,12 @@ class SQLite { ); } - late final _sqlite3_db_config_ptr = - _lookup>('sqlite3_db_config'); - late final _dart_sqlite3_db_config _sqlite3_db_config = - _sqlite3_db_config_ptr.asFunction<_dart_sqlite3_db_config>(); + late final _sqlite3_db_config_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_db_config'); + late final _sqlite3_db_config = _sqlite3_db_config_ptr + .asFunction, int)>(); /// CAPI3REF: Enable Or Disable Extended Result Codes /// METHOD: sqlite3 @@ -498,12 +531,12 @@ class SQLite { ); } - late final _sqlite3_extended_result_codes_ptr = - _lookup>( - 'sqlite3_extended_result_codes'); - late final _dart_sqlite3_extended_result_codes - _sqlite3_extended_result_codes = _sqlite3_extended_result_codes_ptr - .asFunction<_dart_sqlite3_extended_result_codes>(); + late final _sqlite3_extended_result_codes_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_extended_result_codes'); + late final _sqlite3_extended_result_codes = _sqlite3_extended_result_codes_ptr + .asFunction, int)>(); /// CAPI3REF: Last Insert Rowid /// METHOD: sqlite3 @@ -572,11 +605,10 @@ class SQLite { } late final _sqlite3_last_insert_rowid_ptr = - _lookup>( + _lookup)>>( 'sqlite3_last_insert_rowid'); - late final _dart_sqlite3_last_insert_rowid _sqlite3_last_insert_rowid = - _sqlite3_last_insert_rowid_ptr - .asFunction<_dart_sqlite3_last_insert_rowid>(); + late final _sqlite3_last_insert_rowid = _sqlite3_last_insert_rowid_ptr + .asFunction)>(); /// CAPI3REF: Set the Last Insert Rowid value. /// METHOD: sqlite3 @@ -594,12 +626,12 @@ class SQLite { ); } - late final _sqlite3_set_last_insert_rowid_ptr = - _lookup>( - 'sqlite3_set_last_insert_rowid'); - late final _dart_sqlite3_set_last_insert_rowid - _sqlite3_set_last_insert_rowid = _sqlite3_set_last_insert_rowid_ptr - .asFunction<_dart_sqlite3_set_last_insert_rowid>(); + late final _sqlite3_set_last_insert_rowid_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + sqlite3_int64)>>('sqlite3_set_last_insert_rowid'); + late final _sqlite3_set_last_insert_rowid = _sqlite3_set_last_insert_rowid_ptr + .asFunction, int)>(); /// CAPI3REF: Count The Number Of Rows Modified /// METHOD: sqlite3 @@ -664,9 +696,10 @@ class SQLite { } late final _sqlite3_changes_ptr = - _lookup>('sqlite3_changes'); - late final _dart_sqlite3_changes _sqlite3_changes = - _sqlite3_changes_ptr.asFunction<_dart_sqlite3_changes>(); + _lookup)>>( + 'sqlite3_changes'); + late final _sqlite3_changes = + _sqlite3_changes_ptr.asFunction)>(); /// CAPI3REF: Total Number Of Rows Modified /// METHOD: sqlite3 @@ -710,10 +743,10 @@ class SQLite { } late final _sqlite3_total_changes_ptr = - _lookup>( + _lookup)>>( 'sqlite3_total_changes'); - late final _dart_sqlite3_total_changes _sqlite3_total_changes = - _sqlite3_total_changes_ptr.asFunction<_dart_sqlite3_total_changes>(); + late final _sqlite3_total_changes = _sqlite3_total_changes_ptr + .asFunction)>(); /// CAPI3REF: Interrupt A Long-Running Query /// METHOD: sqlite3 @@ -757,9 +790,10 @@ class SQLite { } late final _sqlite3_interrupt_ptr = - _lookup>('sqlite3_interrupt'); - late final _dart_sqlite3_interrupt _sqlite3_interrupt = - _sqlite3_interrupt_ptr.asFunction<_dart_sqlite3_interrupt>(); + _lookup)>>( + 'sqlite3_interrupt'); + late final _sqlite3_interrupt = + _sqlite3_interrupt_ptr.asFunction)>(); /// CAPI3REF: Determine If An SQL Statement Is Complete /// @@ -801,9 +835,10 @@ class SQLite { } late final _sqlite3_complete_ptr = - _lookup>('sqlite3_complete'); - late final _dart_sqlite3_complete _sqlite3_complete = - _sqlite3_complete_ptr.asFunction<_dart_sqlite3_complete>(); + _lookup)>>( + 'sqlite3_complete'); + late final _sqlite3_complete = + _sqlite3_complete_ptr.asFunction)>(); int sqlite3_complete16( ffi.Pointer sql, @@ -814,9 +849,10 @@ class SQLite { } late final _sqlite3_complete16_ptr = - _lookup>('sqlite3_complete16'); - late final _dart_sqlite3_complete16 _sqlite3_complete16 = - _sqlite3_complete16_ptr.asFunction<_dart_sqlite3_complete16>(); + _lookup)>>( + 'sqlite3_complete16'); + late final _sqlite3_complete16 = + _sqlite3_complete16_ptr.asFunction)>(); /// CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors /// KEYWORDS: {busy-handler callback} {busy handler} @@ -877,7 +913,10 @@ class SQLite { /// or [prepared statement] that invoked the busy handler. int sqlite3_busy_handler( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> + arg1, ffi.Pointer arg2, ) { return _sqlite3_busy_handler( @@ -887,11 +926,21 @@ class SQLite { ); } - late final _sqlite3_busy_handler_ptr = - _lookup>( - 'sqlite3_busy_handler'); - late final _dart_sqlite3_busy_handler _sqlite3_busy_handler = - _sqlite3_busy_handler_ptr.asFunction<_dart_sqlite3_busy_handler>(); + late final _sqlite3_busy_handler_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>>, + ffi.Pointer)>>('sqlite3_busy_handler'); + late final _sqlite3_busy_handler = _sqlite3_busy_handler_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>>, + ffi.Pointer)>(); /// CAPI3REF: Set A Busy Timeout /// METHOD: sqlite3 @@ -922,11 +971,12 @@ class SQLite { ); } - late final _sqlite3_busy_timeout_ptr = - _lookup>( - 'sqlite3_busy_timeout'); - late final _dart_sqlite3_busy_timeout _sqlite3_busy_timeout = - _sqlite3_busy_timeout_ptr.asFunction<_dart_sqlite3_busy_timeout>(); + late final _sqlite3_busy_timeout_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_busy_timeout'); + late final _sqlite3_busy_timeout = _sqlite3_busy_timeout_ptr + .asFunction, int)>(); /// CAPI3REF: Convenience Routines For Running Queries /// METHOD: sqlite3 @@ -1017,10 +1067,23 @@ class SQLite { ); } - late final _sqlite3_get_table_ptr = - _lookup>('sqlite3_get_table'); - late final _dart_sqlite3_get_table _sqlite3_get_table = - _sqlite3_get_table_ptr.asFunction<_dart_sqlite3_get_table>(); + late final _sqlite3_get_table_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('sqlite3_get_table'); + late final _sqlite3_get_table = _sqlite3_get_table_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); void sqlite3_free_table( ffi.Pointer> result, @@ -1030,10 +1093,12 @@ class SQLite { ); } - late final _sqlite3_free_table_ptr = - _lookup>('sqlite3_free_table'); - late final _dart_sqlite3_free_table _sqlite3_free_table = - _sqlite3_free_table_ptr.asFunction<_dart_sqlite3_free_table>(); + late final _sqlite3_free_table_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer>)>>('sqlite3_free_table'); + late final _sqlite3_free_table = _sqlite3_free_table_ptr + .asFunction>)>(); /// CAPI3REF: Formatted String Printing Functions /// @@ -1081,10 +1146,12 @@ class SQLite { ); } - late final _sqlite3_mprintf_ptr = - _lookup>('sqlite3_mprintf'); - late final _dart_sqlite3_mprintf _sqlite3_mprintf = - _sqlite3_mprintf_ptr.asFunction<_dart_sqlite3_mprintf>(); + late final _sqlite3_mprintf_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_mprintf'); + late final _sqlite3_mprintf = _sqlite3_mprintf_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_snprintf( int arg0, @@ -1098,10 +1165,13 @@ class SQLite { ); } - late final _sqlite3_snprintf_ptr = - _lookup>('sqlite3_snprintf'); - late final _dart_sqlite3_snprintf _sqlite3_snprintf = - _sqlite3_snprintf_ptr.asFunction<_dart_sqlite3_snprintf>(); + late final _sqlite3_snprintf_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Int32, ffi.Pointer, + ffi.Pointer)>>('sqlite3_snprintf'); + late final _sqlite3_snprintf = _sqlite3_snprintf_ptr.asFunction< + ffi.Pointer Function( + int, ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Memory Allocation Subsystem /// @@ -1185,9 +1255,10 @@ class SQLite { } late final _sqlite3_malloc_ptr = - _lookup>('sqlite3_malloc'); - late final _dart_sqlite3_malloc _sqlite3_malloc = - _sqlite3_malloc_ptr.asFunction<_dart_sqlite3_malloc>(); + _lookup Function(ffi.Int32)>>( + 'sqlite3_malloc'); + late final _sqlite3_malloc = + _sqlite3_malloc_ptr.asFunction Function(int)>(); ffi.Pointer sqlite3_malloc64( int arg0, @@ -1197,10 +1268,11 @@ class SQLite { ); } - late final _sqlite3_malloc64_ptr = - _lookup>('sqlite3_malloc64'); - late final _dart_sqlite3_malloc64 _sqlite3_malloc64 = - _sqlite3_malloc64_ptr.asFunction<_dart_sqlite3_malloc64>(); + late final _sqlite3_malloc64_ptr = _lookup< + ffi.NativeFunction Function(sqlite3_uint64)>>( + 'sqlite3_malloc64'); + late final _sqlite3_malloc64 = + _sqlite3_malloc64_ptr.asFunction Function(int)>(); ffi.Pointer sqlite3_realloc( ffi.Pointer arg0, @@ -1212,10 +1284,12 @@ class SQLite { ); } - late final _sqlite3_realloc_ptr = - _lookup>('sqlite3_realloc'); - late final _dart_sqlite3_realloc _sqlite3_realloc = - _sqlite3_realloc_ptr.asFunction<_dart_sqlite3_realloc>(); + late final _sqlite3_realloc_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_realloc'); + late final _sqlite3_realloc = _sqlite3_realloc_ptr + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_realloc64( ffi.Pointer arg0, @@ -1227,10 +1301,12 @@ class SQLite { ); } - late final _sqlite3_realloc64_ptr = - _lookup>('sqlite3_realloc64'); - late final _dart_sqlite3_realloc64 _sqlite3_realloc64 = - _sqlite3_realloc64_ptr.asFunction<_dart_sqlite3_realloc64>(); + late final _sqlite3_realloc64_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, sqlite3_uint64)>>('sqlite3_realloc64'); + late final _sqlite3_realloc64 = _sqlite3_realloc64_ptr + .asFunction Function(ffi.Pointer, int)>(); void sqlite3_free( ffi.Pointer arg0, @@ -1241,9 +1317,10 @@ class SQLite { } late final _sqlite3_free_ptr = - _lookup>('sqlite3_free'); - late final _dart_sqlite3_free _sqlite3_free = - _sqlite3_free_ptr.asFunction<_dart_sqlite3_free>(); + _lookup)>>( + 'sqlite3_free'); + late final _sqlite3_free = + _sqlite3_free_ptr.asFunction)>(); int sqlite3_msize( ffi.Pointer arg0, @@ -1253,10 +1330,11 @@ class SQLite { ); } - late final _sqlite3_msize_ptr = - _lookup>('sqlite3_msize'); - late final _dart_sqlite3_msize _sqlite3_msize = - _sqlite3_msize_ptr.asFunction<_dart_sqlite3_msize>(); + late final _sqlite3_msize_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_msize'); + late final _sqlite3_msize = + _sqlite3_msize_ptr.asFunction)>(); /// CAPI3REF: Memory Allocator Statistics /// @@ -1284,10 +1362,10 @@ class SQLite { } late final _sqlite3_memory_used_ptr = - _lookup>( + _lookup>( 'sqlite3_memory_used'); - late final _dart_sqlite3_memory_used _sqlite3_memory_used = - _sqlite3_memory_used_ptr.asFunction<_dart_sqlite3_memory_used>(); + late final _sqlite3_memory_used = + _sqlite3_memory_used_ptr.asFunction(); int sqlite3_memory_highwater( int resetFlag, @@ -1298,11 +1376,10 @@ class SQLite { } late final _sqlite3_memory_highwater_ptr = - _lookup>( + _lookup>( 'sqlite3_memory_highwater'); - late final _dart_sqlite3_memory_highwater _sqlite3_memory_highwater = - _sqlite3_memory_highwater_ptr - .asFunction<_dart_sqlite3_memory_highwater>(); + late final _sqlite3_memory_highwater = + _sqlite3_memory_highwater_ptr.asFunction(); /// CAPI3REF: Pseudo-Random Number Generator /// @@ -1333,10 +1410,12 @@ class SQLite { ); } - late final _sqlite3_randomness_ptr = - _lookup>('sqlite3_randomness'); - late final _dart_sqlite3_randomness _sqlite3_randomness = - _sqlite3_randomness_ptr.asFunction<_dart_sqlite3_randomness>(); + late final _sqlite3_randomness_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int32, ffi.Pointer)>>('sqlite3_randomness'); + late final _sqlite3_randomness = _sqlite3_randomness_ptr + .asFunction)>(); /// CAPI3REF: Compile-Time Authorization Callbacks /// METHOD: sqlite3 @@ -1427,7 +1506,16 @@ class SQLite { /// sqlite3_prepare_v2() to reprepare a statement after a schema change. int sqlite3_set_authorizer( ffi.Pointer arg0, - ffi.Pointer> xAuth, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>> + xAuth, ffi.Pointer pUserData, ) { return _sqlite3_set_authorizer( @@ -1437,11 +1525,33 @@ class SQLite { ); } - late final _sqlite3_set_authorizer_ptr = - _lookup>( - 'sqlite3_set_authorizer'); - late final _dart_sqlite3_set_authorizer _sqlite3_set_authorizer = - _sqlite3_set_authorizer_ptr.asFunction<_dart_sqlite3_set_authorizer>(); + late final _sqlite3_set_authorizer_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>, + ffi.Pointer)>>('sqlite3_set_authorizer'); + late final _sqlite3_set_authorizer = _sqlite3_set_authorizer_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>, + ffi.Pointer)>(); /// CAPI3REF: Tracing And Profiling Functions /// METHOD: sqlite3 @@ -1475,7 +1585,11 @@ class SQLite { /// profile callback. ffi.Pointer sqlite3_trace( ffi.Pointer arg0, - ffi.Pointer> xTrace, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>> + xTrace, ffi.Pointer arg2, ) { return _sqlite3_trace( @@ -1485,14 +1599,31 @@ class SQLite { ); } - late final _sqlite3_trace_ptr = - _lookup>('sqlite3_trace'); - late final _dart_sqlite3_trace _sqlite3_trace = - _sqlite3_trace_ptr.asFunction<_dart_sqlite3_trace>(); + late final _sqlite3_trace_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>>('sqlite3_trace'); + late final _sqlite3_trace = _sqlite3_trace_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>(); ffi.Pointer sqlite3_profile( ffi.Pointer arg0, - ffi.Pointer> xProfile, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + sqlite3_uint64)>> + xProfile, ffi.Pointer arg2, ) { return _sqlite3_profile( @@ -1502,10 +1633,23 @@ class SQLite { ); } - late final _sqlite3_profile_ptr = - _lookup>('sqlite3_profile'); - late final _dart_sqlite3_profile _sqlite3_profile = - _sqlite3_profile_ptr.asFunction<_dart_sqlite3_profile>(); + late final _sqlite3_profile_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, sqlite3_uint64)>>, + ffi.Pointer)>>('sqlite3_profile'); + late final _sqlite3_profile = _sqlite3_profile_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, sqlite3_uint64)>>, + ffi.Pointer)>(); /// CAPI3REF: SQL Trace Hook /// METHOD: sqlite3 @@ -1537,7 +1681,11 @@ class SQLite { int sqlite3_trace_v2( ffi.Pointer arg0, int uMask, - ffi.Pointer> xCallback, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Uint32, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + xCallback, ffi.Pointer pCtx, ) { return _sqlite3_trace_v2( @@ -1548,10 +1696,25 @@ class SQLite { ); } - late final _sqlite3_trace_v2_ptr = - _lookup>('sqlite3_trace_v2'); - late final _dart_sqlite3_trace_v2 _sqlite3_trace_v2 = - _sqlite3_trace_v2_ptr.asFunction<_dart_sqlite3_trace_v2>(); + late final _sqlite3_trace_v2_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Uint32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Uint32, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>>('sqlite3_trace_v2'); + late final _sqlite3_trace_v2 = _sqlite3_trace_v2_ptr.asFunction< + int Function( + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Uint32, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>(); /// CAPI3REF: Query Progress Callbacks /// METHOD: sqlite3 @@ -1585,7 +1748,8 @@ class SQLite { void sqlite3_progress_handler( ffi.Pointer arg0, int arg1, - ffi.Pointer> arg2, + ffi.Pointer)>> + arg2, ffi.Pointer arg3, ) { return _sqlite3_progress_handler( @@ -1596,12 +1760,24 @@ class SQLite { ); } - late final _sqlite3_progress_handler_ptr = - _lookup>( - 'sqlite3_progress_handler'); - late final _dart_sqlite3_progress_handler _sqlite3_progress_handler = - _sqlite3_progress_handler_ptr - .asFunction<_dart_sqlite3_progress_handler>(); + late final _sqlite3_progress_handler_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer)>>, + ffi.Pointer)>>('sqlite3_progress_handler'); + late final _sqlite3_progress_handler = + _sqlite3_progress_handler_ptr.asFunction< + void Function( + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer)>>, + ffi.Pointer)>(); /// CAPI3REF: Opening A New Database Connection /// CONSTRUCTOR: sqlite3 @@ -1864,10 +2040,12 @@ class SQLite { ); } - late final _sqlite3_open_ptr = - _lookup>('sqlite3_open'); - late final _dart_sqlite3_open _sqlite3_open = - _sqlite3_open_ptr.asFunction<_dart_sqlite3_open>(); + late final _sqlite3_open_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer>)>>('sqlite3_open'); + late final _sqlite3_open = _sqlite3_open_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer>)>(); int sqlite3_open16( ffi.Pointer filename, @@ -1879,10 +2057,12 @@ class SQLite { ); } - late final _sqlite3_open16_ptr = - _lookup>('sqlite3_open16'); - late final _dart_sqlite3_open16 _sqlite3_open16 = - _sqlite3_open16_ptr.asFunction<_dart_sqlite3_open16>(); + late final _sqlite3_open16_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer>)>>('sqlite3_open16'); + late final _sqlite3_open16 = _sqlite3_open16_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer>)>(); int sqlite3_open_v2( ffi.Pointer filename, @@ -1898,10 +2078,16 @@ class SQLite { ); } - late final _sqlite3_open_v2_ptr = - _lookup>('sqlite3_open_v2'); - late final _dart_sqlite3_open_v2 _sqlite3_open_v2 = - _sqlite3_open_v2_ptr.asFunction<_dart_sqlite3_open_v2>(); + late final _sqlite3_open_v2_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer>, + ffi.Int32, + ffi.Pointer)>>('sqlite3_open_v2'); + late final _sqlite3_open_v2 = _sqlite3_open_v2_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer>, + int, ffi.Pointer)>(); /// CAPI3REF: Obtain Values For URI Parameters /// @@ -1977,11 +2163,13 @@ class SQLite { ); } - late final _sqlite3_uri_parameter_ptr = - _lookup>( - 'sqlite3_uri_parameter'); - late final _dart_sqlite3_uri_parameter _sqlite3_uri_parameter = - _sqlite3_uri_parameter_ptr.asFunction<_dart_sqlite3_uri_parameter>(); + late final _sqlite3_uri_parameter_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_uri_parameter'); + late final _sqlite3_uri_parameter = _sqlite3_uri_parameter_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); int sqlite3_uri_boolean( ffi.Pointer zFile, @@ -1995,11 +2183,12 @@ class SQLite { ); } - late final _sqlite3_uri_boolean_ptr = - _lookup>( - 'sqlite3_uri_boolean'); - late final _dart_sqlite3_uri_boolean _sqlite3_uri_boolean = - _sqlite3_uri_boolean_ptr.asFunction<_dart_sqlite3_uri_boolean>(); + late final _sqlite3_uri_boolean_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('sqlite3_uri_boolean'); + late final _sqlite3_uri_boolean = _sqlite3_uri_boolean_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); int sqlite3_uri_int64( ffi.Pointer arg0, @@ -2013,10 +2202,12 @@ class SQLite { ); } - late final _sqlite3_uri_int64_ptr = - _lookup>('sqlite3_uri_int64'); - late final _dart_sqlite3_uri_int64 _sqlite3_uri_int64 = - _sqlite3_uri_int64_ptr.asFunction<_dart_sqlite3_uri_int64>(); + late final _sqlite3_uri_int64_ptr = _lookup< + ffi.NativeFunction< + sqlite3_int64 Function(ffi.Pointer, ffi.Pointer, + sqlite3_int64)>>('sqlite3_uri_int64'); + late final _sqlite3_uri_int64 = _sqlite3_uri_int64_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); ffi.Pointer sqlite3_uri_key( ffi.Pointer zFilename, @@ -2028,10 +2219,12 @@ class SQLite { ); } - late final _sqlite3_uri_key_ptr = - _lookup>('sqlite3_uri_key'); - late final _dart_sqlite3_uri_key _sqlite3_uri_key = - _sqlite3_uri_key_ptr.asFunction<_dart_sqlite3_uri_key>(); + late final _sqlite3_uri_key_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_uri_key'); + late final _sqlite3_uri_key = _sqlite3_uri_key_ptr + .asFunction Function(ffi.Pointer, int)>(); /// CAPI3REF: Translate filenames /// @@ -2066,12 +2259,12 @@ class SQLite { ); } - late final _sqlite3_filename_database_ptr = - _lookup>( - 'sqlite3_filename_database'); - late final _dart_sqlite3_filename_database _sqlite3_filename_database = - _sqlite3_filename_database_ptr - .asFunction<_dart_sqlite3_filename_database>(); + late final _sqlite3_filename_database_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_filename_database'); + late final _sqlite3_filename_database = _sqlite3_filename_database_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_filename_journal( ffi.Pointer arg0, @@ -2081,12 +2274,12 @@ class SQLite { ); } - late final _sqlite3_filename_journal_ptr = - _lookup>( - 'sqlite3_filename_journal'); - late final _dart_sqlite3_filename_journal _sqlite3_filename_journal = - _sqlite3_filename_journal_ptr - .asFunction<_dart_sqlite3_filename_journal>(); + late final _sqlite3_filename_journal_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_filename_journal'); + late final _sqlite3_filename_journal = _sqlite3_filename_journal_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_filename_wal( ffi.Pointer arg0, @@ -2096,11 +2289,12 @@ class SQLite { ); } - late final _sqlite3_filename_wal_ptr = - _lookup>( - 'sqlite3_filename_wal'); - late final _dart_sqlite3_filename_wal _sqlite3_filename_wal = - _sqlite3_filename_wal_ptr.asFunction<_dart_sqlite3_filename_wal>(); + late final _sqlite3_filename_wal_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_filename_wal'); + late final _sqlite3_filename_wal = _sqlite3_filename_wal_ptr + .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Database File Corresponding To A Journal /// @@ -2125,12 +2319,12 @@ class SQLite { ); } - late final _sqlite3_database_file_object_ptr = - _lookup>( - 'sqlite3_database_file_object'); - late final _dart_sqlite3_database_file_object _sqlite3_database_file_object = - _sqlite3_database_file_object_ptr - .asFunction<_dart_sqlite3_database_file_object>(); + late final _sqlite3_database_file_object_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_database_file_object'); + late final _sqlite3_database_file_object = _sqlite3_database_file_object_ptr + .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Create and Destroy VFS Filenames /// @@ -2191,11 +2385,21 @@ class SQLite { ); } - late final _sqlite3_create_filename_ptr = - _lookup>( - 'sqlite3_create_filename'); - late final _dart_sqlite3_create_filename _sqlite3_create_filename = - _sqlite3_create_filename_ptr.asFunction<_dart_sqlite3_create_filename>(); + late final _sqlite3_create_filename_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('sqlite3_create_filename'); + late final _sqlite3_create_filename = _sqlite3_create_filename_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); void sqlite3_free_filename( ffi.Pointer arg0, @@ -2206,10 +2410,10 @@ class SQLite { } late final _sqlite3_free_filename_ptr = - _lookup>( + _lookup)>>( 'sqlite3_free_filename'); - late final _dart_sqlite3_free_filename _sqlite3_free_filename = - _sqlite3_free_filename_ptr.asFunction<_dart_sqlite3_free_filename>(); + late final _sqlite3_free_filename = _sqlite3_free_filename_ptr + .asFunction)>(); /// CAPI3REF: Error Codes And Messages /// METHOD: sqlite3 @@ -2270,9 +2474,10 @@ class SQLite { } late final _sqlite3_errcode_ptr = - _lookup>('sqlite3_errcode'); - late final _dart_sqlite3_errcode _sqlite3_errcode = - _sqlite3_errcode_ptr.asFunction<_dart_sqlite3_errcode>(); + _lookup)>>( + 'sqlite3_errcode'); + late final _sqlite3_errcode = + _sqlite3_errcode_ptr.asFunction)>(); int sqlite3_extended_errcode( ffi.Pointer db, @@ -2283,11 +2488,10 @@ class SQLite { } late final _sqlite3_extended_errcode_ptr = - _lookup>( + _lookup)>>( 'sqlite3_extended_errcode'); - late final _dart_sqlite3_extended_errcode _sqlite3_extended_errcode = - _sqlite3_extended_errcode_ptr - .asFunction<_dart_sqlite3_extended_errcode>(); + late final _sqlite3_extended_errcode = _sqlite3_extended_errcode_ptr + .asFunction)>(); ffi.Pointer sqlite3_errmsg( ffi.Pointer arg0, @@ -2297,10 +2501,12 @@ class SQLite { ); } - late final _sqlite3_errmsg_ptr = - _lookup>('sqlite3_errmsg'); - late final _dart_sqlite3_errmsg _sqlite3_errmsg = - _sqlite3_errmsg_ptr.asFunction<_dart_sqlite3_errmsg>(); + late final _sqlite3_errmsg_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_errmsg'); + late final _sqlite3_errmsg = _sqlite3_errmsg_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_errmsg16( ffi.Pointer arg0, @@ -2310,10 +2516,12 @@ class SQLite { ); } - late final _sqlite3_errmsg16_ptr = - _lookup>('sqlite3_errmsg16'); - late final _dart_sqlite3_errmsg16 _sqlite3_errmsg16 = - _sqlite3_errmsg16_ptr.asFunction<_dart_sqlite3_errmsg16>(); + late final _sqlite3_errmsg16_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_errmsg16'); + late final _sqlite3_errmsg16 = _sqlite3_errmsg16_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_errstr( int arg0, @@ -2324,9 +2532,10 @@ class SQLite { } late final _sqlite3_errstr_ptr = - _lookup>('sqlite3_errstr'); - late final _dart_sqlite3_errstr _sqlite3_errstr = - _sqlite3_errstr_ptr.asFunction<_dart_sqlite3_errstr>(); + _lookup Function(ffi.Int32)>>( + 'sqlite3_errstr'); + late final _sqlite3_errstr = + _sqlite3_errstr_ptr.asFunction Function(int)>(); /// CAPI3REF: Run-time Limits /// METHOD: sqlite3 @@ -2378,10 +2587,12 @@ class SQLite { ); } - late final _sqlite3_limit_ptr = - _lookup>('sqlite3_limit'); - late final _dart_sqlite3_limit _sqlite3_limit = - _sqlite3_limit_ptr.asFunction<_dart_sqlite3_limit>(); + late final _sqlite3_limit_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32, ffi.Int32)>>('sqlite3_limit'); + late final _sqlite3_limit = _sqlite3_limit_ptr + .asFunction, int, int)>(); /// CAPI3REF: Compiling An SQL Statement /// KEYWORDS: {SQL statement compiler} @@ -2497,10 +2708,21 @@ class SQLite { ); } - late final _sqlite3_prepare_ptr = - _lookup>('sqlite3_prepare'); - late final _dart_sqlite3_prepare _sqlite3_prepare = - _sqlite3_prepare_ptr.asFunction<_dart_sqlite3_prepare>(); + late final _sqlite3_prepare_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>)>>('sqlite3_prepare'); + late final _sqlite3_prepare = _sqlite3_prepare_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer>)>(); int sqlite3_prepare_v2( ffi.Pointer db, @@ -2518,10 +2740,21 @@ class SQLite { ); } - late final _sqlite3_prepare_v2_ptr = - _lookup>('sqlite3_prepare_v2'); - late final _dart_sqlite3_prepare_v2 _sqlite3_prepare_v2 = - _sqlite3_prepare_v2_ptr.asFunction<_dart_sqlite3_prepare_v2>(); + late final _sqlite3_prepare_v2_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>)>>('sqlite3_prepare_v2'); + late final _sqlite3_prepare_v2 = _sqlite3_prepare_v2_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer>)>(); int sqlite3_prepare_v3( ffi.Pointer db, @@ -2541,10 +2774,23 @@ class SQLite { ); } - late final _sqlite3_prepare_v3_ptr = - _lookup>('sqlite3_prepare_v3'); - late final _dart_sqlite3_prepare_v3 _sqlite3_prepare_v3 = - _sqlite3_prepare_v3_ptr.asFunction<_dart_sqlite3_prepare_v3>(); + late final _sqlite3_prepare_v3_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Uint32, + ffi.Pointer>, + ffi.Pointer>)>>('sqlite3_prepare_v3'); + late final _sqlite3_prepare_v3 = _sqlite3_prepare_v3_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer>, + ffi.Pointer>)>(); int sqlite3_prepare16( ffi.Pointer db, @@ -2562,10 +2808,21 @@ class SQLite { ); } - late final _sqlite3_prepare16_ptr = - _lookup>('sqlite3_prepare16'); - late final _dart_sqlite3_prepare16 _sqlite3_prepare16 = - _sqlite3_prepare16_ptr.asFunction<_dart_sqlite3_prepare16>(); + late final _sqlite3_prepare16_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>)>>('sqlite3_prepare16'); + late final _sqlite3_prepare16 = _sqlite3_prepare16_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer>)>(); int sqlite3_prepare16_v2( ffi.Pointer db, @@ -2583,11 +2840,21 @@ class SQLite { ); } - late final _sqlite3_prepare16_v2_ptr = - _lookup>( - 'sqlite3_prepare16_v2'); - late final _dart_sqlite3_prepare16_v2 _sqlite3_prepare16_v2 = - _sqlite3_prepare16_v2_ptr.asFunction<_dart_sqlite3_prepare16_v2>(); + late final _sqlite3_prepare16_v2_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>)>>('sqlite3_prepare16_v2'); + late final _sqlite3_prepare16_v2 = _sqlite3_prepare16_v2_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer>)>(); int sqlite3_prepare16_v3( ffi.Pointer db, @@ -2607,11 +2874,23 @@ class SQLite { ); } - late final _sqlite3_prepare16_v3_ptr = - _lookup>( - 'sqlite3_prepare16_v3'); - late final _dart_sqlite3_prepare16_v3 _sqlite3_prepare16_v3 = - _sqlite3_prepare16_v3_ptr.asFunction<_dart_sqlite3_prepare16_v3>(); + late final _sqlite3_prepare16_v3_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Uint32, + ffi.Pointer>, + ffi.Pointer>)>>('sqlite3_prepare16_v3'); + late final _sqlite3_prepare16_v3 = _sqlite3_prepare16_v3_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer>, + ffi.Pointer>)>(); /// CAPI3REF: Retrieving Statement SQL /// METHOD: sqlite3_stmt @@ -2657,10 +2936,12 @@ class SQLite { ); } - late final _sqlite3_sql_ptr = - _lookup>('sqlite3_sql'); - late final _dart_sqlite3_sql _sqlite3_sql = - _sqlite3_sql_ptr.asFunction<_dart_sqlite3_sql>(); + late final _sqlite3_sql_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_sql'); + late final _sqlite3_sql = _sqlite3_sql_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_expanded_sql( ffi.Pointer pStmt, @@ -2670,11 +2951,12 @@ class SQLite { ); } - late final _sqlite3_expanded_sql_ptr = - _lookup>( - 'sqlite3_expanded_sql'); - late final _dart_sqlite3_expanded_sql _sqlite3_expanded_sql = - _sqlite3_expanded_sql_ptr.asFunction<_dart_sqlite3_expanded_sql>(); + late final _sqlite3_expanded_sql_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_expanded_sql'); + late final _sqlite3_expanded_sql = _sqlite3_expanded_sql_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_normalized_sql( ffi.Pointer pStmt, @@ -2684,11 +2966,12 @@ class SQLite { ); } - late final _sqlite3_normalized_sql_ptr = - _lookup>( - 'sqlite3_normalized_sql'); - late final _dart_sqlite3_normalized_sql _sqlite3_normalized_sql = - _sqlite3_normalized_sql_ptr.asFunction<_dart_sqlite3_normalized_sql>(); + late final _sqlite3_normalized_sql_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_normalized_sql'); + late final _sqlite3_normalized_sql = _sqlite3_normalized_sql_ptr + .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Determine If An SQL Statement Writes The Database /// METHOD: sqlite3_stmt @@ -2730,11 +3013,11 @@ class SQLite { ); } - late final _sqlite3_stmt_readonly_ptr = - _lookup>( - 'sqlite3_stmt_readonly'); - late final _dart_sqlite3_stmt_readonly _sqlite3_stmt_readonly = - _sqlite3_stmt_readonly_ptr.asFunction<_dart_sqlite3_stmt_readonly>(); + late final _sqlite3_stmt_readonly_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_stmt_readonly'); + late final _sqlite3_stmt_readonly = _sqlite3_stmt_readonly_ptr + .asFunction)>(); /// CAPI3REF: Query The EXPLAIN Setting For A Prepared Statement /// METHOD: sqlite3_stmt @@ -2752,11 +3035,11 @@ class SQLite { ); } - late final _sqlite3_stmt_isexplain_ptr = - _lookup>( - 'sqlite3_stmt_isexplain'); - late final _dart_sqlite3_stmt_isexplain _sqlite3_stmt_isexplain = - _sqlite3_stmt_isexplain_ptr.asFunction<_dart_sqlite3_stmt_isexplain>(); + late final _sqlite3_stmt_isexplain_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_stmt_isexplain'); + late final _sqlite3_stmt_isexplain = _sqlite3_stmt_isexplain_ptr + .asFunction)>(); /// CAPI3REF: Determine If A Prepared Statement Has Been Reset /// METHOD: sqlite3_stmt @@ -2783,10 +3066,11 @@ class SQLite { ); } - late final _sqlite3_stmt_busy_ptr = - _lookup>('sqlite3_stmt_busy'); - late final _dart_sqlite3_stmt_busy _sqlite3_stmt_busy = - _sqlite3_stmt_busy_ptr.asFunction<_dart_sqlite3_stmt_busy>(); + late final _sqlite3_stmt_busy_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_stmt_busy'); + late final _sqlite3_stmt_busy = _sqlite3_stmt_busy_ptr + .asFunction)>(); /// CAPI3REF: Binding Values To Prepared Statements /// KEYWORDS: {host parameter} {host parameters} {host parameter name} @@ -2927,7 +3211,8 @@ class SQLite { int arg1, ffi.Pointer arg2, int n, - ffi.Pointer> arg4, + ffi.Pointer)>> + arg4, ) { return _sqlite3_bind_blob( arg0, @@ -2938,17 +3223,33 @@ class SQLite { ); } - late final _sqlite3_bind_blob_ptr = - _lookup>('sqlite3_bind_blob'); - late final _dart_sqlite3_bind_blob _sqlite3_bind_blob = - _sqlite3_bind_blob_ptr.asFunction<_dart_sqlite3_bind_blob>(); + late final _sqlite3_bind_blob_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_bind_blob'); + late final _sqlite3_bind_blob = _sqlite3_bind_blob_ptr.asFunction< + int Function( + ffi.Pointer, + int, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>)>(); int sqlite3_bind_blob64( ffi.Pointer arg0, int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer)>> + arg4, ) { return _sqlite3_bind_blob64( arg0, @@ -2959,11 +3260,25 @@ class SQLite { ); } - late final _sqlite3_bind_blob64_ptr = - _lookup>( - 'sqlite3_bind_blob64'); - late final _dart_sqlite3_bind_blob64 _sqlite3_bind_blob64 = - _sqlite3_bind_blob64_ptr.asFunction<_dart_sqlite3_bind_blob64>(); + late final _sqlite3_bind_blob64_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + sqlite3_uint64, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_bind_blob64'); + late final _sqlite3_bind_blob64 = _sqlite3_bind_blob64_ptr.asFunction< + int Function( + ffi.Pointer, + int, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>)>(); int sqlite3_bind_double( ffi.Pointer arg0, @@ -2977,11 +3292,12 @@ class SQLite { ); } - late final _sqlite3_bind_double_ptr = - _lookup>( - 'sqlite3_bind_double'); - late final _dart_sqlite3_bind_double _sqlite3_bind_double = - _sqlite3_bind_double_ptr.asFunction<_dart_sqlite3_bind_double>(); + late final _sqlite3_bind_double_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + ffi.Double)>>('sqlite3_bind_double'); + late final _sqlite3_bind_double = _sqlite3_bind_double_ptr + .asFunction, int, double)>(); int sqlite3_bind_int( ffi.Pointer arg0, @@ -2995,10 +3311,12 @@ class SQLite { ); } - late final _sqlite3_bind_int_ptr = - _lookup>('sqlite3_bind_int'); - late final _dart_sqlite3_bind_int _sqlite3_bind_int = - _sqlite3_bind_int_ptr.asFunction<_dart_sqlite3_bind_int>(); + late final _sqlite3_bind_int_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + ffi.Int32)>>('sqlite3_bind_int'); + late final _sqlite3_bind_int = _sqlite3_bind_int_ptr + .asFunction, int, int)>(); int sqlite3_bind_int64( ffi.Pointer arg0, @@ -3012,10 +3330,12 @@ class SQLite { ); } - late final _sqlite3_bind_int64_ptr = - _lookup>('sqlite3_bind_int64'); - late final _dart_sqlite3_bind_int64 _sqlite3_bind_int64 = - _sqlite3_bind_int64_ptr.asFunction<_dart_sqlite3_bind_int64>(); + late final _sqlite3_bind_int64_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + sqlite3_int64)>>('sqlite3_bind_int64'); + late final _sqlite3_bind_int64 = _sqlite3_bind_int64_ptr + .asFunction, int, int)>(); int sqlite3_bind_null( ffi.Pointer arg0, @@ -3027,17 +3347,20 @@ class SQLite { ); } - late final _sqlite3_bind_null_ptr = - _lookup>('sqlite3_bind_null'); - late final _dart_sqlite3_bind_null _sqlite3_bind_null = - _sqlite3_bind_null_ptr.asFunction<_dart_sqlite3_bind_null>(); + late final _sqlite3_bind_null_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_bind_null'); + late final _sqlite3_bind_null = _sqlite3_bind_null_ptr + .asFunction, int)>(); int sqlite3_bind_text( ffi.Pointer arg0, int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer)>> + arg4, ) { return _sqlite3_bind_text( arg0, @@ -3048,17 +3371,33 @@ class SQLite { ); } - late final _sqlite3_bind_text_ptr = - _lookup>('sqlite3_bind_text'); - late final _dart_sqlite3_bind_text _sqlite3_bind_text = - _sqlite3_bind_text_ptr.asFunction<_dart_sqlite3_bind_text>(); + late final _sqlite3_bind_text_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_bind_text'); + late final _sqlite3_bind_text = _sqlite3_bind_text_ptr.asFunction< + int Function( + ffi.Pointer, + int, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>)>(); int sqlite3_bind_text16( ffi.Pointer arg0, int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer)>> + arg4, ) { return _sqlite3_bind_text16( arg0, @@ -3069,18 +3408,33 @@ class SQLite { ); } - late final _sqlite3_bind_text16_ptr = - _lookup>( - 'sqlite3_bind_text16'); - late final _dart_sqlite3_bind_text16 _sqlite3_bind_text16 = - _sqlite3_bind_text16_ptr.asFunction<_dart_sqlite3_bind_text16>(); + late final _sqlite3_bind_text16_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_bind_text16'); + late final _sqlite3_bind_text16 = _sqlite3_bind_text16_ptr.asFunction< + int Function( + ffi.Pointer, + int, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>)>(); int sqlite3_bind_text64( ffi.Pointer arg0, int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer)>> + arg4, int encoding, ) { return _sqlite3_bind_text64( @@ -3093,11 +3447,25 @@ class SQLite { ); } - late final _sqlite3_bind_text64_ptr = - _lookup>( - 'sqlite3_bind_text64'); - late final _dart_sqlite3_bind_text64 _sqlite3_bind_text64 = - _sqlite3_bind_text64_ptr.asFunction<_dart_sqlite3_bind_text64>(); + late final _sqlite3_bind_text64_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + sqlite3_uint64, + ffi.Pointer< + ffi.NativeFunction)>>, + ffi.Uint8)>>('sqlite3_bind_text64'); + late final _sqlite3_bind_text64 = _sqlite3_bind_text64_ptr.asFunction< + int Function( + ffi.Pointer, + int, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>, + int)>(); int sqlite3_bind_value( ffi.Pointer arg0, @@ -3111,17 +3479,21 @@ class SQLite { ); } - late final _sqlite3_bind_value_ptr = - _lookup>('sqlite3_bind_value'); - late final _dart_sqlite3_bind_value _sqlite3_bind_value = - _sqlite3_bind_value_ptr.asFunction<_dart_sqlite3_bind_value>(); + late final _sqlite3_bind_value_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + ffi.Pointer)>>('sqlite3_bind_value'); + late final _sqlite3_bind_value = _sqlite3_bind_value_ptr.asFunction< + int Function( + ffi.Pointer, int, ffi.Pointer)>(); int sqlite3_bind_pointer( ffi.Pointer arg0, int arg1, ffi.Pointer arg2, ffi.Pointer arg3, - ffi.Pointer> arg4, + ffi.Pointer)>> + arg4, ) { return _sqlite3_bind_pointer( arg0, @@ -3132,11 +3504,25 @@ class SQLite { ); } - late final _sqlite3_bind_pointer_ptr = - _lookup>( - 'sqlite3_bind_pointer'); - late final _dart_sqlite3_bind_pointer _sqlite3_bind_pointer = - _sqlite3_bind_pointer_ptr.asFunction<_dart_sqlite3_bind_pointer>(); + late final _sqlite3_bind_pointer_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_bind_pointer'); + late final _sqlite3_bind_pointer = _sqlite3_bind_pointer_ptr.asFunction< + int Function( + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction)>>)>(); int sqlite3_bind_zeroblob( ffi.Pointer arg0, @@ -3150,11 +3536,12 @@ class SQLite { ); } - late final _sqlite3_bind_zeroblob_ptr = - _lookup>( - 'sqlite3_bind_zeroblob'); - late final _dart_sqlite3_bind_zeroblob _sqlite3_bind_zeroblob = - _sqlite3_bind_zeroblob_ptr.asFunction<_dart_sqlite3_bind_zeroblob>(); + late final _sqlite3_bind_zeroblob_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + ffi.Int32)>>('sqlite3_bind_zeroblob'); + late final _sqlite3_bind_zeroblob = _sqlite3_bind_zeroblob_ptr + .asFunction, int, int)>(); int sqlite3_bind_zeroblob64( ffi.Pointer arg0, @@ -3168,11 +3555,12 @@ class SQLite { ); } - late final _sqlite3_bind_zeroblob64_ptr = - _lookup>( - 'sqlite3_bind_zeroblob64'); - late final _dart_sqlite3_bind_zeroblob64 _sqlite3_bind_zeroblob64 = - _sqlite3_bind_zeroblob64_ptr.asFunction<_dart_sqlite3_bind_zeroblob64>(); + late final _sqlite3_bind_zeroblob64_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + sqlite3_uint64)>>('sqlite3_bind_zeroblob64'); + late final _sqlite3_bind_zeroblob64 = _sqlite3_bind_zeroblob64_ptr + .asFunction, int, int)>(); /// CAPI3REF: Number Of SQL Parameters /// METHOD: sqlite3_stmt @@ -3199,12 +3587,11 @@ class SQLite { ); } - late final _sqlite3_bind_parameter_count_ptr = - _lookup>( - 'sqlite3_bind_parameter_count'); - late final _dart_sqlite3_bind_parameter_count _sqlite3_bind_parameter_count = - _sqlite3_bind_parameter_count_ptr - .asFunction<_dart_sqlite3_bind_parameter_count>(); + late final _sqlite3_bind_parameter_count_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_bind_parameter_count'); + late final _sqlite3_bind_parameter_count = _sqlite3_bind_parameter_count_ptr + .asFunction)>(); /// CAPI3REF: Name Of A Host Parameter /// METHOD: sqlite3_stmt @@ -3240,12 +3627,13 @@ class SQLite { ); } - late final _sqlite3_bind_parameter_name_ptr = - _lookup>( - 'sqlite3_bind_parameter_name'); - late final _dart_sqlite3_bind_parameter_name _sqlite3_bind_parameter_name = - _sqlite3_bind_parameter_name_ptr - .asFunction<_dart_sqlite3_bind_parameter_name>(); + late final _sqlite3_bind_parameter_name_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_bind_parameter_name'); + late final _sqlite3_bind_parameter_name = + _sqlite3_bind_parameter_name_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: Index Of A Parameter With A Given Name /// METHOD: sqlite3_stmt @@ -3271,12 +3659,13 @@ class SQLite { ); } - late final _sqlite3_bind_parameter_index_ptr = - _lookup>( - 'sqlite3_bind_parameter_index'); - late final _dart_sqlite3_bind_parameter_index _sqlite3_bind_parameter_index = - _sqlite3_bind_parameter_index_ptr - .asFunction<_dart_sqlite3_bind_parameter_index>(); + late final _sqlite3_bind_parameter_index_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_bind_parameter_index'); + late final _sqlite3_bind_parameter_index = + _sqlite3_bind_parameter_index_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Reset All Bindings On A Prepared Statement /// METHOD: sqlite3_stmt @@ -3292,11 +3681,11 @@ class SQLite { ); } - late final _sqlite3_clear_bindings_ptr = - _lookup>( - 'sqlite3_clear_bindings'); - late final _dart_sqlite3_clear_bindings _sqlite3_clear_bindings = - _sqlite3_clear_bindings_ptr.asFunction<_dart_sqlite3_clear_bindings>(); + late final _sqlite3_clear_bindings_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_clear_bindings'); + late final _sqlite3_clear_bindings = _sqlite3_clear_bindings_ptr + .asFunction)>(); /// CAPI3REF: Number Of Columns In A Result Set /// METHOD: sqlite3_stmt @@ -3318,11 +3707,11 @@ class SQLite { ); } - late final _sqlite3_column_count_ptr = - _lookup>( - 'sqlite3_column_count'); - late final _dart_sqlite3_column_count _sqlite3_column_count = - _sqlite3_column_count_ptr.asFunction<_dart_sqlite3_column_count>(); + late final _sqlite3_column_count_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_column_count'); + late final _sqlite3_column_count = _sqlite3_column_count_ptr + .asFunction)>(); /// CAPI3REF: Column Names In A Result Set /// METHOD: sqlite3_stmt @@ -3359,11 +3748,12 @@ class SQLite { ); } - late final _sqlite3_column_name_ptr = - _lookup>( - 'sqlite3_column_name'); - late final _dart_sqlite3_column_name _sqlite3_column_name = - _sqlite3_column_name_ptr.asFunction<_dart_sqlite3_column_name>(); + late final _sqlite3_column_name_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_name'); + late final _sqlite3_column_name = _sqlite3_column_name_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_name16( ffi.Pointer arg0, @@ -3375,11 +3765,12 @@ class SQLite { ); } - late final _sqlite3_column_name16_ptr = - _lookup>( - 'sqlite3_column_name16'); - late final _dart_sqlite3_column_name16 _sqlite3_column_name16 = - _sqlite3_column_name16_ptr.asFunction<_dart_sqlite3_column_name16>(); + late final _sqlite3_column_name16_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_name16'); + late final _sqlite3_column_name16 = _sqlite3_column_name16_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: Source Of Data In A Query Result /// METHOD: sqlite3_stmt @@ -3431,12 +3822,13 @@ class SQLite { ); } - late final _sqlite3_column_database_name_ptr = - _lookup>( - 'sqlite3_column_database_name'); - late final _dart_sqlite3_column_database_name _sqlite3_column_database_name = - _sqlite3_column_database_name_ptr - .asFunction<_dart_sqlite3_column_database_name>(); + late final _sqlite3_column_database_name_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_column_database_name'); + late final _sqlite3_column_database_name = + _sqlite3_column_database_name_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_database_name16( ffi.Pointer arg0, @@ -3448,12 +3840,13 @@ class SQLite { ); } - late final _sqlite3_column_database_name16_ptr = - _lookup>( - 'sqlite3_column_database_name16'); - late final _dart_sqlite3_column_database_name16 - _sqlite3_column_database_name16 = _sqlite3_column_database_name16_ptr - .asFunction<_dart_sqlite3_column_database_name16>(); + late final _sqlite3_column_database_name16_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_column_database_name16'); + late final _sqlite3_column_database_name16 = + _sqlite3_column_database_name16_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_table_name( ffi.Pointer arg0, @@ -3465,12 +3858,13 @@ class SQLite { ); } - late final _sqlite3_column_table_name_ptr = - _lookup>( - 'sqlite3_column_table_name'); - late final _dart_sqlite3_column_table_name _sqlite3_column_table_name = - _sqlite3_column_table_name_ptr - .asFunction<_dart_sqlite3_column_table_name>(); + late final _sqlite3_column_table_name_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_column_table_name'); + late final _sqlite3_column_table_name = + _sqlite3_column_table_name_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_table_name16( ffi.Pointer arg0, @@ -3482,12 +3876,13 @@ class SQLite { ); } - late final _sqlite3_column_table_name16_ptr = - _lookup>( - 'sqlite3_column_table_name16'); - late final _dart_sqlite3_column_table_name16 _sqlite3_column_table_name16 = - _sqlite3_column_table_name16_ptr - .asFunction<_dart_sqlite3_column_table_name16>(); + late final _sqlite3_column_table_name16_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_column_table_name16'); + late final _sqlite3_column_table_name16 = + _sqlite3_column_table_name16_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_origin_name( ffi.Pointer arg0, @@ -3499,12 +3894,13 @@ class SQLite { ); } - late final _sqlite3_column_origin_name_ptr = - _lookup>( - 'sqlite3_column_origin_name'); - late final _dart_sqlite3_column_origin_name _sqlite3_column_origin_name = - _sqlite3_column_origin_name_ptr - .asFunction<_dart_sqlite3_column_origin_name>(); + late final _sqlite3_column_origin_name_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_column_origin_name'); + late final _sqlite3_column_origin_name = + _sqlite3_column_origin_name_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_origin_name16( ffi.Pointer arg0, @@ -3516,12 +3912,13 @@ class SQLite { ); } - late final _sqlite3_column_origin_name16_ptr = - _lookup>( - 'sqlite3_column_origin_name16'); - late final _dart_sqlite3_column_origin_name16 _sqlite3_column_origin_name16 = - _sqlite3_column_origin_name16_ptr - .asFunction<_dart_sqlite3_column_origin_name16>(); + late final _sqlite3_column_origin_name16_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_column_origin_name16'); + late final _sqlite3_column_origin_name16 = + _sqlite3_column_origin_name16_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: Declared Datatype Of A Query Result /// METHOD: sqlite3_stmt @@ -3561,11 +3958,12 @@ class SQLite { ); } - late final _sqlite3_column_decltype_ptr = - _lookup>( - 'sqlite3_column_decltype'); - late final _dart_sqlite3_column_decltype _sqlite3_column_decltype = - _sqlite3_column_decltype_ptr.asFunction<_dart_sqlite3_column_decltype>(); + late final _sqlite3_column_decltype_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_column_decltype'); + late final _sqlite3_column_decltype = _sqlite3_column_decltype_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_decltype16( ffi.Pointer arg0, @@ -3577,12 +3975,13 @@ class SQLite { ); } - late final _sqlite3_column_decltype16_ptr = - _lookup>( - 'sqlite3_column_decltype16'); - late final _dart_sqlite3_column_decltype16 _sqlite3_column_decltype16 = - _sqlite3_column_decltype16_ptr - .asFunction<_dart_sqlite3_column_decltype16>(); + late final _sqlite3_column_decltype16_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_column_decltype16'); + late final _sqlite3_column_decltype16 = + _sqlite3_column_decltype16_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: Evaluate An SQL Statement /// METHOD: sqlite3_stmt @@ -3672,10 +4071,11 @@ class SQLite { ); } - late final _sqlite3_step_ptr = - _lookup>('sqlite3_step'); - late final _dart_sqlite3_step _sqlite3_step = - _sqlite3_step_ptr.asFunction<_dart_sqlite3_step>(); + late final _sqlite3_step_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_step'); + late final _sqlite3_step = + _sqlite3_step_ptr.asFunction)>(); /// CAPI3REF: Number of columns in a result set /// METHOD: sqlite3_stmt @@ -3702,10 +4102,11 @@ class SQLite { ); } - late final _sqlite3_data_count_ptr = - _lookup>('sqlite3_data_count'); - late final _dart_sqlite3_data_count _sqlite3_data_count = - _sqlite3_data_count_ptr.asFunction<_dart_sqlite3_data_count>(); + late final _sqlite3_data_count_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_data_count'); + late final _sqlite3_data_count = _sqlite3_data_count_ptr + .asFunction)>(); /// CAPI3REF: Result Values From A Query /// KEYWORDS: {column access functions} @@ -3924,11 +4325,12 @@ class SQLite { ); } - late final _sqlite3_column_blob_ptr = - _lookup>( - 'sqlite3_column_blob'); - late final _dart_sqlite3_column_blob _sqlite3_column_blob = - _sqlite3_column_blob_ptr.asFunction<_dart_sqlite3_column_blob>(); + late final _sqlite3_column_blob_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_blob'); + late final _sqlite3_column_blob = _sqlite3_column_blob_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); double sqlite3_column_double( ffi.Pointer arg0, @@ -3940,11 +4342,12 @@ class SQLite { ); } - late final _sqlite3_column_double_ptr = - _lookup>( - 'sqlite3_column_double'); - late final _dart_sqlite3_column_double _sqlite3_column_double = - _sqlite3_column_double_ptr.asFunction<_dart_sqlite3_column_double>(); + late final _sqlite3_column_double_ptr = _lookup< + ffi.NativeFunction< + ffi.Double Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_double'); + late final _sqlite3_column_double = _sqlite3_column_double_ptr + .asFunction, int)>(); int sqlite3_column_int( ffi.Pointer arg0, @@ -3956,10 +4359,12 @@ class SQLite { ); } - late final _sqlite3_column_int_ptr = - _lookup>('sqlite3_column_int'); - late final _dart_sqlite3_column_int _sqlite3_column_int = - _sqlite3_column_int_ptr.asFunction<_dart_sqlite3_column_int>(); + late final _sqlite3_column_int_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_int'); + late final _sqlite3_column_int = _sqlite3_column_int_ptr + .asFunction, int)>(); int sqlite3_column_int64( ffi.Pointer arg0, @@ -3971,11 +4376,12 @@ class SQLite { ); } - late final _sqlite3_column_int64_ptr = - _lookup>( - 'sqlite3_column_int64'); - late final _dart_sqlite3_column_int64 _sqlite3_column_int64 = - _sqlite3_column_int64_ptr.asFunction<_dart_sqlite3_column_int64>(); + late final _sqlite3_column_int64_ptr = _lookup< + ffi.NativeFunction< + sqlite3_int64 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_int64'); + late final _sqlite3_column_int64 = _sqlite3_column_int64_ptr + .asFunction, int)>(); ffi.Pointer sqlite3_column_text( ffi.Pointer arg0, @@ -3987,11 +4393,12 @@ class SQLite { ); } - late final _sqlite3_column_text_ptr = - _lookup>( - 'sqlite3_column_text'); - late final _dart_sqlite3_column_text _sqlite3_column_text = - _sqlite3_column_text_ptr.asFunction<_dart_sqlite3_column_text>(); + late final _sqlite3_column_text_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_text'); + late final _sqlite3_column_text = _sqlite3_column_text_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_text16( ffi.Pointer arg0, @@ -4003,11 +4410,12 @@ class SQLite { ); } - late final _sqlite3_column_text16_ptr = - _lookup>( - 'sqlite3_column_text16'); - late final _dart_sqlite3_column_text16 _sqlite3_column_text16 = - _sqlite3_column_text16_ptr.asFunction<_dart_sqlite3_column_text16>(); + late final _sqlite3_column_text16_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_text16'); + late final _sqlite3_column_text16 = _sqlite3_column_text16_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_value( ffi.Pointer arg0, @@ -4019,11 +4427,12 @@ class SQLite { ); } - late final _sqlite3_column_value_ptr = - _lookup>( - 'sqlite3_column_value'); - late final _dart_sqlite3_column_value _sqlite3_column_value = - _sqlite3_column_value_ptr.asFunction<_dart_sqlite3_column_value>(); + late final _sqlite3_column_value_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_value'); + late final _sqlite3_column_value = _sqlite3_column_value_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); int sqlite3_column_bytes( ffi.Pointer arg0, @@ -4035,11 +4444,12 @@ class SQLite { ); } - late final _sqlite3_column_bytes_ptr = - _lookup>( - 'sqlite3_column_bytes'); - late final _dart_sqlite3_column_bytes _sqlite3_column_bytes = - _sqlite3_column_bytes_ptr.asFunction<_dart_sqlite3_column_bytes>(); + late final _sqlite3_column_bytes_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_bytes'); + late final _sqlite3_column_bytes = _sqlite3_column_bytes_ptr + .asFunction, int)>(); int sqlite3_column_bytes16( ffi.Pointer arg0, @@ -4051,11 +4461,12 @@ class SQLite { ); } - late final _sqlite3_column_bytes16_ptr = - _lookup>( - 'sqlite3_column_bytes16'); - late final _dart_sqlite3_column_bytes16 _sqlite3_column_bytes16 = - _sqlite3_column_bytes16_ptr.asFunction<_dart_sqlite3_column_bytes16>(); + late final _sqlite3_column_bytes16_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_bytes16'); + late final _sqlite3_column_bytes16 = _sqlite3_column_bytes16_ptr + .asFunction, int)>(); int sqlite3_column_type( ffi.Pointer arg0, @@ -4067,11 +4478,12 @@ class SQLite { ); } - late final _sqlite3_column_type_ptr = - _lookup>( - 'sqlite3_column_type'); - late final _dart_sqlite3_column_type _sqlite3_column_type = - _sqlite3_column_type_ptr.asFunction<_dart_sqlite3_column_type>(); + late final _sqlite3_column_type_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_type'); + late final _sqlite3_column_type = _sqlite3_column_type_ptr + .asFunction, int)>(); /// CAPI3REF: Destroy A Prepared Statement Object /// DESTRUCTOR: sqlite3_stmt @@ -4105,10 +4517,11 @@ class SQLite { ); } - late final _sqlite3_finalize_ptr = - _lookup>('sqlite3_finalize'); - late final _dart_sqlite3_finalize _sqlite3_finalize = - _sqlite3_finalize_ptr.asFunction<_dart_sqlite3_finalize>(); + late final _sqlite3_finalize_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_finalize'); + late final _sqlite3_finalize = _sqlite3_finalize_ptr + .asFunction)>(); /// CAPI3REF: Reset A Prepared Statement Object /// METHOD: sqlite3_stmt @@ -4141,10 +4554,11 @@ class SQLite { ); } - late final _sqlite3_reset_ptr = - _lookup>('sqlite3_reset'); - late final _dart_sqlite3_reset _sqlite3_reset = - _sqlite3_reset_ptr.asFunction<_dart_sqlite3_reset>(); + late final _sqlite3_reset_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_reset'); + late final _sqlite3_reset = + _sqlite3_reset_ptr.asFunction)>(); /// CAPI3REF: Create Or Redefine SQL Functions /// KEYWORDS: {function creation routines} @@ -4275,9 +4689,19 @@ class SQLite { int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>> + xFunc, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>> + xStep, + ffi.Pointer< + ffi.NativeFunction)>> + xFinal, ) { return _sqlite3_create_function( db, @@ -4292,10 +4716,49 @@ class SQLite { } late final _sqlite3_create_function_ptr = - _lookup>( + _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>( 'sqlite3_create_function'); - late final _dart_sqlite3_create_function _sqlite3_create_function = - _sqlite3_create_function_ptr.asFunction<_dart_sqlite3_create_function>(); + late final _sqlite3_create_function = _sqlite3_create_function_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>(); int sqlite3_create_function16( ffi.Pointer db, @@ -4303,9 +4766,19 @@ class SQLite { int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>> + xFunc, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>> + xStep, + ffi.Pointer< + ffi.NativeFunction)>> + xFinal, ) { return _sqlite3_create_function16( db, @@ -4320,11 +4793,50 @@ class SQLite { } late final _sqlite3_create_function16_ptr = - _lookup>( + _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>( 'sqlite3_create_function16'); - late final _dart_sqlite3_create_function16 _sqlite3_create_function16 = - _sqlite3_create_function16_ptr - .asFunction<_dart_sqlite3_create_function16>(); + late final _sqlite3_create_function16 = + _sqlite3_create_function16_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>(); int sqlite3_create_function_v2( ffi.Pointer db, @@ -4332,10 +4844,21 @@ class SQLite { int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xDestroy, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>> + xFunc, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>> + xStep, + ffi.Pointer< + ffi.NativeFunction)>> + xFinal, + ffi.Pointer)>> + xDestroy, ) { return _sqlite3_create_function_v2( db, @@ -4351,11 +4874,55 @@ class SQLite { } late final _sqlite3_create_function_v2_ptr = - _lookup>( + _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( 'sqlite3_create_function_v2'); - late final _dart_sqlite3_create_function_v2 _sqlite3_create_function_v2 = - _sqlite3_create_function_v2_ptr - .asFunction<_dart_sqlite3_create_function_v2>(); + late final _sqlite3_create_function_v2 = + _sqlite3_create_function_v2_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>(); int sqlite3_create_window_function( ffi.Pointer db, @@ -4363,11 +4930,24 @@ class SQLite { int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xValue, - ffi.Pointer> xInverse, - ffi.Pointer> xDestroy, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>> + xStep, + ffi.Pointer< + ffi.NativeFunction)>> + xFinal, + ffi.Pointer< + ffi.NativeFunction)>> + xValue, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>> + xInverse, + ffi.Pointer)>> + xDestroy, ) { return _sqlite3_create_window_function( db, @@ -4384,11 +4964,61 @@ class SQLite { } late final _sqlite3_create_window_function_ptr = - _lookup>( + _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( 'sqlite3_create_window_function'); - late final _dart_sqlite3_create_window_function - _sqlite3_create_window_function = _sqlite3_create_window_function_ptr - .asFunction<_dart_sqlite3_create_window_function>(); + late final _sqlite3_create_window_function = + _sqlite3_create_window_function_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>(); int sqlite3_aggregate_count( ffi.Pointer arg0, @@ -4398,11 +5028,11 @@ class SQLite { ); } - late final _sqlite3_aggregate_count_ptr = - _lookup>( - 'sqlite3_aggregate_count'); - late final _dart_sqlite3_aggregate_count _sqlite3_aggregate_count = - _sqlite3_aggregate_count_ptr.asFunction<_dart_sqlite3_aggregate_count>(); + late final _sqlite3_aggregate_count_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_aggregate_count'); + late final _sqlite3_aggregate_count = _sqlite3_aggregate_count_ptr + .asFunction)>(); int sqlite3_expired( ffi.Pointer arg0, @@ -4412,10 +5042,11 @@ class SQLite { ); } - late final _sqlite3_expired_ptr = - _lookup>('sqlite3_expired'); - late final _dart_sqlite3_expired _sqlite3_expired = - _sqlite3_expired_ptr.asFunction<_dart_sqlite3_expired>(); + late final _sqlite3_expired_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_expired'); + late final _sqlite3_expired = _sqlite3_expired_ptr + .asFunction)>(); int sqlite3_transfer_bindings( ffi.Pointer arg0, @@ -4427,35 +5058,40 @@ class SQLite { ); } - late final _sqlite3_transfer_bindings_ptr = - _lookup>( - 'sqlite3_transfer_bindings'); - late final _dart_sqlite3_transfer_bindings _sqlite3_transfer_bindings = - _sqlite3_transfer_bindings_ptr - .asFunction<_dart_sqlite3_transfer_bindings>(); + late final _sqlite3_transfer_bindings_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_transfer_bindings'); + late final _sqlite3_transfer_bindings = + _sqlite3_transfer_bindings_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); int sqlite3_global_recover() { return _sqlite3_global_recover(); } late final _sqlite3_global_recover_ptr = - _lookup>( + _lookup>( 'sqlite3_global_recover'); - late final _dart_sqlite3_global_recover _sqlite3_global_recover = - _sqlite3_global_recover_ptr.asFunction<_dart_sqlite3_global_recover>(); + late final _sqlite3_global_recover = + _sqlite3_global_recover_ptr.asFunction(); void sqlite3_thread_cleanup() { return _sqlite3_thread_cleanup(); } late final _sqlite3_thread_cleanup_ptr = - _lookup>( + _lookup>( 'sqlite3_thread_cleanup'); - late final _dart_sqlite3_thread_cleanup _sqlite3_thread_cleanup = - _sqlite3_thread_cleanup_ptr.asFunction<_dart_sqlite3_thread_cleanup>(); + late final _sqlite3_thread_cleanup = + _sqlite3_thread_cleanup_ptr.asFunction(); int sqlite3_memory_alarm( - ffi.Pointer> arg0, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, sqlite3_int64, ffi.Int32)>> + arg0, ffi.Pointer arg1, int arg2, ) { @@ -4466,11 +5102,23 @@ class SQLite { ); } - late final _sqlite3_memory_alarm_ptr = - _lookup>( - 'sqlite3_memory_alarm'); - late final _dart_sqlite3_memory_alarm _sqlite3_memory_alarm = - _sqlite3_memory_alarm_ptr.asFunction<_dart_sqlite3_memory_alarm>(); + late final _sqlite3_memory_alarm_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, sqlite3_int64, ffi.Int32)>>, + ffi.Pointer, + sqlite3_int64)>>('sqlite3_memory_alarm'); + late final _sqlite3_memory_alarm = _sqlite3_memory_alarm_ptr.asFunction< + int Function( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, sqlite3_int64, ffi.Int32)>>, + ffi.Pointer, + int)>(); /// CAPI3REF: Obtaining SQL Values /// METHOD: sqlite3_value @@ -4606,10 +5254,12 @@ class SQLite { ); } - late final _sqlite3_value_blob_ptr = - _lookup>('sqlite3_value_blob'); - late final _dart_sqlite3_value_blob _sqlite3_value_blob = - _sqlite3_value_blob_ptr.asFunction<_dart_sqlite3_value_blob>(); + late final _sqlite3_value_blob_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_value_blob'); + late final _sqlite3_value_blob = _sqlite3_value_blob_ptr + .asFunction Function(ffi.Pointer)>(); double sqlite3_value_double( ffi.Pointer arg0, @@ -4619,11 +5269,11 @@ class SQLite { ); } - late final _sqlite3_value_double_ptr = - _lookup>( - 'sqlite3_value_double'); - late final _dart_sqlite3_value_double _sqlite3_value_double = - _sqlite3_value_double_ptr.asFunction<_dart_sqlite3_value_double>(); + late final _sqlite3_value_double_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_value_double'); + late final _sqlite3_value_double = _sqlite3_value_double_ptr + .asFunction)>(); int sqlite3_value_int( ffi.Pointer arg0, @@ -4633,10 +5283,11 @@ class SQLite { ); } - late final _sqlite3_value_int_ptr = - _lookup>('sqlite3_value_int'); - late final _dart_sqlite3_value_int _sqlite3_value_int = - _sqlite3_value_int_ptr.asFunction<_dart_sqlite3_value_int>(); + late final _sqlite3_value_int_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_value_int'); + late final _sqlite3_value_int = _sqlite3_value_int_ptr + .asFunction)>(); int sqlite3_value_int64( ffi.Pointer arg0, @@ -4646,11 +5297,12 @@ class SQLite { ); } - late final _sqlite3_value_int64_ptr = - _lookup>( - 'sqlite3_value_int64'); - late final _dart_sqlite3_value_int64 _sqlite3_value_int64 = - _sqlite3_value_int64_ptr.asFunction<_dart_sqlite3_value_int64>(); + late final _sqlite3_value_int64_ptr = _lookup< + ffi.NativeFunction< + sqlite3_int64 Function( + ffi.Pointer)>>('sqlite3_value_int64'); + late final _sqlite3_value_int64 = _sqlite3_value_int64_ptr + .asFunction)>(); ffi.Pointer sqlite3_value_pointer( ffi.Pointer arg0, @@ -4662,11 +5314,13 @@ class SQLite { ); } - late final _sqlite3_value_pointer_ptr = - _lookup>( - 'sqlite3_value_pointer'); - late final _dart_sqlite3_value_pointer _sqlite3_value_pointer = - _sqlite3_value_pointer_ptr.asFunction<_dart_sqlite3_value_pointer>(); + late final _sqlite3_value_pointer_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_value_pointer'); + late final _sqlite3_value_pointer = _sqlite3_value_pointer_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer sqlite3_value_text( ffi.Pointer arg0, @@ -4676,10 +5330,12 @@ class SQLite { ); } - late final _sqlite3_value_text_ptr = - _lookup>('sqlite3_value_text'); - late final _dart_sqlite3_value_text _sqlite3_value_text = - _sqlite3_value_text_ptr.asFunction<_dart_sqlite3_value_text>(); + late final _sqlite3_value_text_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_value_text'); + late final _sqlite3_value_text = _sqlite3_value_text_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); ffi.Pointer sqlite3_value_text16( ffi.Pointer arg0, @@ -4689,11 +5345,12 @@ class SQLite { ); } - late final _sqlite3_value_text16_ptr = - _lookup>( - 'sqlite3_value_text16'); - late final _dart_sqlite3_value_text16 _sqlite3_value_text16 = - _sqlite3_value_text16_ptr.asFunction<_dart_sqlite3_value_text16>(); + late final _sqlite3_value_text16_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_value_text16'); + late final _sqlite3_value_text16 = _sqlite3_value_text16_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_value_text16le( ffi.Pointer arg0, @@ -4703,11 +5360,12 @@ class SQLite { ); } - late final _sqlite3_value_text16le_ptr = - _lookup>( - 'sqlite3_value_text16le'); - late final _dart_sqlite3_value_text16le _sqlite3_value_text16le = - _sqlite3_value_text16le_ptr.asFunction<_dart_sqlite3_value_text16le>(); + late final _sqlite3_value_text16le_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_value_text16le'); + late final _sqlite3_value_text16le = _sqlite3_value_text16le_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_value_text16be( ffi.Pointer arg0, @@ -4717,11 +5375,12 @@ class SQLite { ); } - late final _sqlite3_value_text16be_ptr = - _lookup>( - 'sqlite3_value_text16be'); - late final _dart_sqlite3_value_text16be _sqlite3_value_text16be = - _sqlite3_value_text16be_ptr.asFunction<_dart_sqlite3_value_text16be>(); + late final _sqlite3_value_text16be_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_value_text16be'); + late final _sqlite3_value_text16be = _sqlite3_value_text16be_ptr + .asFunction Function(ffi.Pointer)>(); int sqlite3_value_bytes( ffi.Pointer arg0, @@ -4731,11 +5390,11 @@ class SQLite { ); } - late final _sqlite3_value_bytes_ptr = - _lookup>( - 'sqlite3_value_bytes'); - late final _dart_sqlite3_value_bytes _sqlite3_value_bytes = - _sqlite3_value_bytes_ptr.asFunction<_dart_sqlite3_value_bytes>(); + late final _sqlite3_value_bytes_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_value_bytes'); + late final _sqlite3_value_bytes = _sqlite3_value_bytes_ptr + .asFunction)>(); int sqlite3_value_bytes16( ffi.Pointer arg0, @@ -4745,11 +5404,11 @@ class SQLite { ); } - late final _sqlite3_value_bytes16_ptr = - _lookup>( - 'sqlite3_value_bytes16'); - late final _dart_sqlite3_value_bytes16 _sqlite3_value_bytes16 = - _sqlite3_value_bytes16_ptr.asFunction<_dart_sqlite3_value_bytes16>(); + late final _sqlite3_value_bytes16_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_value_bytes16'); + late final _sqlite3_value_bytes16 = _sqlite3_value_bytes16_ptr + .asFunction)>(); int sqlite3_value_type( ffi.Pointer arg0, @@ -4759,10 +5418,11 @@ class SQLite { ); } - late final _sqlite3_value_type_ptr = - _lookup>('sqlite3_value_type'); - late final _dart_sqlite3_value_type _sqlite3_value_type = - _sqlite3_value_type_ptr.asFunction<_dart_sqlite3_value_type>(); + late final _sqlite3_value_type_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_value_type'); + late final _sqlite3_value_type = _sqlite3_value_type_ptr + .asFunction)>(); int sqlite3_value_numeric_type( ffi.Pointer arg0, @@ -4772,12 +5432,11 @@ class SQLite { ); } - late final _sqlite3_value_numeric_type_ptr = - _lookup>( - 'sqlite3_value_numeric_type'); - late final _dart_sqlite3_value_numeric_type _sqlite3_value_numeric_type = - _sqlite3_value_numeric_type_ptr - .asFunction<_dart_sqlite3_value_numeric_type>(); + late final _sqlite3_value_numeric_type_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_value_numeric_type'); + late final _sqlite3_value_numeric_type = _sqlite3_value_numeric_type_ptr + .asFunction)>(); int sqlite3_value_nochange( ffi.Pointer arg0, @@ -4787,11 +5446,11 @@ class SQLite { ); } - late final _sqlite3_value_nochange_ptr = - _lookup>( - 'sqlite3_value_nochange'); - late final _dart_sqlite3_value_nochange _sqlite3_value_nochange = - _sqlite3_value_nochange_ptr.asFunction<_dart_sqlite3_value_nochange>(); + late final _sqlite3_value_nochange_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_value_nochange'); + late final _sqlite3_value_nochange = _sqlite3_value_nochange_ptr + .asFunction)>(); int sqlite3_value_frombind( ffi.Pointer arg0, @@ -4801,11 +5460,11 @@ class SQLite { ); } - late final _sqlite3_value_frombind_ptr = - _lookup>( - 'sqlite3_value_frombind'); - late final _dart_sqlite3_value_frombind _sqlite3_value_frombind = - _sqlite3_value_frombind_ptr.asFunction<_dart_sqlite3_value_frombind>(); + late final _sqlite3_value_frombind_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_value_frombind'); + late final _sqlite3_value_frombind = _sqlite3_value_frombind_ptr + .asFunction)>(); /// CAPI3REF: Finding The Subtype Of SQL Values /// METHOD: sqlite3_value @@ -4823,11 +5482,11 @@ class SQLite { ); } - late final _sqlite3_value_subtype_ptr = - _lookup>( - 'sqlite3_value_subtype'); - late final _dart_sqlite3_value_subtype _sqlite3_value_subtype = - _sqlite3_value_subtype_ptr.asFunction<_dart_sqlite3_value_subtype>(); + late final _sqlite3_value_subtype_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_value_subtype'); + late final _sqlite3_value_subtype = _sqlite3_value_subtype_ptr + .asFunction)>(); /// CAPI3REF: Copy And Free SQL Values /// METHOD: sqlite3_value @@ -4849,10 +5508,12 @@ class SQLite { ); } - late final _sqlite3_value_dup_ptr = - _lookup>('sqlite3_value_dup'); - late final _dart_sqlite3_value_dup _sqlite3_value_dup = - _sqlite3_value_dup_ptr.asFunction<_dart_sqlite3_value_dup>(); + late final _sqlite3_value_dup_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_value_dup'); + late final _sqlite3_value_dup = _sqlite3_value_dup_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); void sqlite3_value_free( ffi.Pointer arg0, @@ -4862,10 +5523,11 @@ class SQLite { ); } - late final _sqlite3_value_free_ptr = - _lookup>('sqlite3_value_free'); - late final _dart_sqlite3_value_free _sqlite3_value_free = - _sqlite3_value_free_ptr.asFunction<_dart_sqlite3_value_free>(); + late final _sqlite3_value_free_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_value_free'); + late final _sqlite3_value_free = _sqlite3_value_free_ptr + .asFunction)>(); /// CAPI3REF: Obtain Aggregate Function Context /// METHOD: sqlite3_context @@ -4918,12 +5580,13 @@ class SQLite { ); } - late final _sqlite3_aggregate_context_ptr = - _lookup>( - 'sqlite3_aggregate_context'); - late final _dart_sqlite3_aggregate_context _sqlite3_aggregate_context = - _sqlite3_aggregate_context_ptr - .asFunction<_dart_sqlite3_aggregate_context>(); + late final _sqlite3_aggregate_context_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_aggregate_context'); + late final _sqlite3_aggregate_context = + _sqlite3_aggregate_context_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: User Data For Functions /// METHOD: sqlite3_context @@ -4944,10 +5607,12 @@ class SQLite { ); } - late final _sqlite3_user_data_ptr = - _lookup>('sqlite3_user_data'); - late final _dart_sqlite3_user_data _sqlite3_user_data = - _sqlite3_user_data_ptr.asFunction<_dart_sqlite3_user_data>(); + late final _sqlite3_user_data_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_user_data'); + late final _sqlite3_user_data = _sqlite3_user_data_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); /// CAPI3REF: Database Connection For Functions /// METHOD: sqlite3_context @@ -4965,12 +5630,13 @@ class SQLite { ); } - late final _sqlite3_context_db_handle_ptr = - _lookup>( - 'sqlite3_context_db_handle'); - late final _dart_sqlite3_context_db_handle _sqlite3_context_db_handle = - _sqlite3_context_db_handle_ptr - .asFunction<_dart_sqlite3_context_db_handle>(); + late final _sqlite3_context_db_handle_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_context_db_handle'); + late final _sqlite3_context_db_handle = + _sqlite3_context_db_handle_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); /// CAPI3REF: Function Auxiliary Data /// METHOD: sqlite3_context @@ -5037,17 +5703,19 @@ class SQLite { ); } - late final _sqlite3_get_auxdata_ptr = - _lookup>( - 'sqlite3_get_auxdata'); - late final _dart_sqlite3_get_auxdata _sqlite3_get_auxdata = - _sqlite3_get_auxdata_ptr.asFunction<_dart_sqlite3_get_auxdata>(); + late final _sqlite3_get_auxdata_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_get_auxdata'); + late final _sqlite3_get_auxdata = _sqlite3_get_auxdata_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); void sqlite3_set_auxdata( ffi.Pointer arg0, int N, ffi.Pointer arg2, - ffi.Pointer> arg3, + ffi.Pointer)>> + arg3, ) { return _sqlite3_set_auxdata( arg0, @@ -5057,11 +5725,23 @@ class SQLite { ); } - late final _sqlite3_set_auxdata_ptr = - _lookup>( - 'sqlite3_set_auxdata'); - late final _dart_sqlite3_set_auxdata _sqlite3_set_auxdata = - _sqlite3_set_auxdata_ptr.asFunction<_dart_sqlite3_set_auxdata>(); + late final _sqlite3_set_auxdata_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_set_auxdata'); + late final _sqlite3_set_auxdata = _sqlite3_set_auxdata_ptr.asFunction< + void Function( + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction)>>)>(); /// CAPI3REF: Setting The Result Of An SQL Function /// METHOD: sqlite3_context @@ -5211,7 +5891,8 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer)>> + arg3, ) { return _sqlite3_result_blob( arg0, @@ -5221,17 +5902,30 @@ class SQLite { ); } - late final _sqlite3_result_blob_ptr = - _lookup>( - 'sqlite3_result_blob'); - late final _dart_sqlite3_result_blob _sqlite3_result_blob = - _sqlite3_result_blob_ptr.asFunction<_dart_sqlite3_result_blob>(); + late final _sqlite3_result_blob_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_result_blob'); + late final _sqlite3_result_blob = _sqlite3_result_blob_ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>)>(); void sqlite3_result_blob64( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer)>> + arg3, ) { return _sqlite3_result_blob64( arg0, @@ -5241,11 +5935,23 @@ class SQLite { ); } - late final _sqlite3_result_blob64_ptr = - _lookup>( - 'sqlite3_result_blob64'); - late final _dart_sqlite3_result_blob64 _sqlite3_result_blob64 = - _sqlite3_result_blob64_ptr.asFunction<_dart_sqlite3_result_blob64>(); + late final _sqlite3_result_blob64_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sqlite3_uint64, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_result_blob64'); + late final _sqlite3_result_blob64 = _sqlite3_result_blob64_ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>)>(); void sqlite3_result_double( ffi.Pointer arg0, @@ -5257,11 +5963,12 @@ class SQLite { ); } - late final _sqlite3_result_double_ptr = - _lookup>( - 'sqlite3_result_double'); - late final _dart_sqlite3_result_double _sqlite3_result_double = - _sqlite3_result_double_ptr.asFunction<_dart_sqlite3_result_double>(); + late final _sqlite3_result_double_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Double)>>('sqlite3_result_double'); + late final _sqlite3_result_double = _sqlite3_result_double_ptr + .asFunction, double)>(); void sqlite3_result_error( ffi.Pointer arg0, @@ -5275,11 +5982,13 @@ class SQLite { ); } - late final _sqlite3_result_error_ptr = - _lookup>( - 'sqlite3_result_error'); - late final _dart_sqlite3_result_error _sqlite3_result_error = - _sqlite3_result_error_ptr.asFunction<_dart_sqlite3_result_error>(); + late final _sqlite3_result_error_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('sqlite3_result_error'); + late final _sqlite3_result_error = _sqlite3_result_error_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, int)>(); void sqlite3_result_error16( ffi.Pointer arg0, @@ -5293,11 +6002,13 @@ class SQLite { ); } - late final _sqlite3_result_error16_ptr = - _lookup>( - 'sqlite3_result_error16'); - late final _dart_sqlite3_result_error16 _sqlite3_result_error16 = - _sqlite3_result_error16_ptr.asFunction<_dart_sqlite3_result_error16>(); + late final _sqlite3_result_error16_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('sqlite3_result_error16'); + late final _sqlite3_result_error16 = _sqlite3_result_error16_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, int)>(); void sqlite3_result_error_toobig( ffi.Pointer arg0, @@ -5307,12 +6018,11 @@ class SQLite { ); } - late final _sqlite3_result_error_toobig_ptr = - _lookup>( - 'sqlite3_result_error_toobig'); - late final _dart_sqlite3_result_error_toobig _sqlite3_result_error_toobig = - _sqlite3_result_error_toobig_ptr - .asFunction<_dart_sqlite3_result_error_toobig>(); + late final _sqlite3_result_error_toobig_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_result_error_toobig'); + late final _sqlite3_result_error_toobig = _sqlite3_result_error_toobig_ptr + .asFunction)>(); void sqlite3_result_error_nomem( ffi.Pointer arg0, @@ -5322,12 +6032,11 @@ class SQLite { ); } - late final _sqlite3_result_error_nomem_ptr = - _lookup>( - 'sqlite3_result_error_nomem'); - late final _dart_sqlite3_result_error_nomem _sqlite3_result_error_nomem = - _sqlite3_result_error_nomem_ptr - .asFunction<_dart_sqlite3_result_error_nomem>(); + late final _sqlite3_result_error_nomem_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_result_error_nomem'); + late final _sqlite3_result_error_nomem = _sqlite3_result_error_nomem_ptr + .asFunction)>(); void sqlite3_result_error_code( ffi.Pointer arg0, @@ -5339,12 +6048,12 @@ class SQLite { ); } - late final _sqlite3_result_error_code_ptr = - _lookup>( - 'sqlite3_result_error_code'); - late final _dart_sqlite3_result_error_code _sqlite3_result_error_code = - _sqlite3_result_error_code_ptr - .asFunction<_dart_sqlite3_result_error_code>(); + late final _sqlite3_result_error_code_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_result_error_code'); + late final _sqlite3_result_error_code = _sqlite3_result_error_code_ptr + .asFunction, int)>(); void sqlite3_result_int( ffi.Pointer arg0, @@ -5356,10 +6065,12 @@ class SQLite { ); } - late final _sqlite3_result_int_ptr = - _lookup>('sqlite3_result_int'); - late final _dart_sqlite3_result_int _sqlite3_result_int = - _sqlite3_result_int_ptr.asFunction<_dart_sqlite3_result_int>(); + late final _sqlite3_result_int_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_result_int'); + late final _sqlite3_result_int = _sqlite3_result_int_ptr + .asFunction, int)>(); void sqlite3_result_int64( ffi.Pointer arg0, @@ -5371,11 +6082,12 @@ class SQLite { ); } - late final _sqlite3_result_int64_ptr = - _lookup>( - 'sqlite3_result_int64'); - late final _dart_sqlite3_result_int64 _sqlite3_result_int64 = - _sqlite3_result_int64_ptr.asFunction<_dart_sqlite3_result_int64>(); + late final _sqlite3_result_int64_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + sqlite3_int64)>>('sqlite3_result_int64'); + late final _sqlite3_result_int64 = _sqlite3_result_int64_ptr + .asFunction, int)>(); void sqlite3_result_null( ffi.Pointer arg0, @@ -5385,17 +6097,18 @@ class SQLite { ); } - late final _sqlite3_result_null_ptr = - _lookup>( - 'sqlite3_result_null'); - late final _dart_sqlite3_result_null _sqlite3_result_null = - _sqlite3_result_null_ptr.asFunction<_dart_sqlite3_result_null>(); + late final _sqlite3_result_null_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_result_null'); + late final _sqlite3_result_null = _sqlite3_result_null_ptr + .asFunction)>(); void sqlite3_result_text( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer)>> + arg3, ) { return _sqlite3_result_text( arg0, @@ -5405,17 +6118,30 @@ class SQLite { ); } - late final _sqlite3_result_text_ptr = - _lookup>( - 'sqlite3_result_text'); - late final _dart_sqlite3_result_text _sqlite3_result_text = - _sqlite3_result_text_ptr.asFunction<_dart_sqlite3_result_text>(); + late final _sqlite3_result_text_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_result_text'); + late final _sqlite3_result_text = _sqlite3_result_text_ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>)>(); void sqlite3_result_text64( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer)>> + arg3, int encoding, ) { return _sqlite3_result_text64( @@ -5427,17 +6153,30 @@ class SQLite { ); } - late final _sqlite3_result_text64_ptr = - _lookup>( - 'sqlite3_result_text64'); - late final _dart_sqlite3_result_text64 _sqlite3_result_text64 = - _sqlite3_result_text64_ptr.asFunction<_dart_sqlite3_result_text64>(); + late final _sqlite3_result_text64_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sqlite3_uint64, + ffi.Pointer< + ffi.NativeFunction)>>, + ffi.Uint8)>>('sqlite3_result_text64'); + late final _sqlite3_result_text64 = _sqlite3_result_text64_ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>, + int)>(); void sqlite3_result_text16( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer)>> + arg3, ) { return _sqlite3_result_text16( arg0, @@ -5447,17 +6186,30 @@ class SQLite { ); } - late final _sqlite3_result_text16_ptr = - _lookup>( - 'sqlite3_result_text16'); - late final _dart_sqlite3_result_text16 _sqlite3_result_text16 = - _sqlite3_result_text16_ptr.asFunction<_dart_sqlite3_result_text16>(); + late final _sqlite3_result_text16_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_result_text16'); + late final _sqlite3_result_text16 = _sqlite3_result_text16_ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>)>(); void sqlite3_result_text16le( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer)>> + arg3, ) { return _sqlite3_result_text16le( arg0, @@ -5467,17 +6219,30 @@ class SQLite { ); } - late final _sqlite3_result_text16le_ptr = - _lookup>( - 'sqlite3_result_text16le'); - late final _dart_sqlite3_result_text16le _sqlite3_result_text16le = - _sqlite3_result_text16le_ptr.asFunction<_dart_sqlite3_result_text16le>(); + late final _sqlite3_result_text16le_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( + 'sqlite3_result_text16le'); + late final _sqlite3_result_text16le = _sqlite3_result_text16le_ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>)>(); void sqlite3_result_text16be( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer)>> + arg3, ) { return _sqlite3_result_text16be( arg0, @@ -5487,11 +6252,23 @@ class SQLite { ); } - late final _sqlite3_result_text16be_ptr = - _lookup>( - 'sqlite3_result_text16be'); - late final _dart_sqlite3_result_text16be _sqlite3_result_text16be = - _sqlite3_result_text16be_ptr.asFunction<_dart_sqlite3_result_text16be>(); + late final _sqlite3_result_text16be_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( + 'sqlite3_result_text16be'); + late final _sqlite3_result_text16be = _sqlite3_result_text16be_ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>)>(); void sqlite3_result_value( ffi.Pointer arg0, @@ -5503,17 +6280,20 @@ class SQLite { ); } - late final _sqlite3_result_value_ptr = - _lookup>( - 'sqlite3_result_value'); - late final _dart_sqlite3_result_value _sqlite3_result_value = - _sqlite3_result_value_ptr.asFunction<_dart_sqlite3_result_value>(); + late final _sqlite3_result_value_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_result_value'); + late final _sqlite3_result_value = _sqlite3_result_value_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer)>(); void sqlite3_result_pointer( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer> arg3, + ffi.Pointer)>> + arg3, ) { return _sqlite3_result_pointer( arg0, @@ -5523,11 +6303,23 @@ class SQLite { ); } - late final _sqlite3_result_pointer_ptr = - _lookup>( - 'sqlite3_result_pointer'); - late final _dart_sqlite3_result_pointer _sqlite3_result_pointer = - _sqlite3_result_pointer_ptr.asFunction<_dart_sqlite3_result_pointer>(); + late final _sqlite3_result_pointer_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_result_pointer'); + late final _sqlite3_result_pointer = _sqlite3_result_pointer_ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction)>>)>(); void sqlite3_result_zeroblob( ffi.Pointer arg0, @@ -5539,11 +6331,12 @@ class SQLite { ); } - late final _sqlite3_result_zeroblob_ptr = - _lookup>( - 'sqlite3_result_zeroblob'); - late final _dart_sqlite3_result_zeroblob _sqlite3_result_zeroblob = - _sqlite3_result_zeroblob_ptr.asFunction<_dart_sqlite3_result_zeroblob>(); + late final _sqlite3_result_zeroblob_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_result_zeroblob'); + late final _sqlite3_result_zeroblob = _sqlite3_result_zeroblob_ptr + .asFunction, int)>(); int sqlite3_result_zeroblob64( ffi.Pointer arg0, @@ -5555,12 +6348,12 @@ class SQLite { ); } - late final _sqlite3_result_zeroblob64_ptr = - _lookup>( - 'sqlite3_result_zeroblob64'); - late final _dart_sqlite3_result_zeroblob64 _sqlite3_result_zeroblob64 = - _sqlite3_result_zeroblob64_ptr - .asFunction<_dart_sqlite3_result_zeroblob64>(); + late final _sqlite3_result_zeroblob64_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + sqlite3_uint64)>>('sqlite3_result_zeroblob64'); + late final _sqlite3_result_zeroblob64 = _sqlite3_result_zeroblob64_ptr + .asFunction, int)>(); /// CAPI3REF: Setting The Subtype Of An SQL Function /// METHOD: sqlite3_context @@ -5582,11 +6375,12 @@ class SQLite { ); } - late final _sqlite3_result_subtype_ptr = - _lookup>( - 'sqlite3_result_subtype'); - late final _dart_sqlite3_result_subtype _sqlite3_result_subtype = - _sqlite3_result_subtype_ptr.asFunction<_dart_sqlite3_result_subtype>(); + late final _sqlite3_result_subtype_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Uint32)>>('sqlite3_result_subtype'); + late final _sqlite3_result_subtype = _sqlite3_result_subtype_ptr + .asFunction, int)>(); /// CAPI3REF: Define New Collating Sequences /// METHOD: sqlite3 @@ -5672,7 +6466,11 @@ class SQLite { ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + ffi.Pointer, ffi.Int32, ffi.Pointer)>> + xCompare, ) { return _sqlite3_create_collation( arg0, @@ -5683,20 +6481,50 @@ class SQLite { ); } - late final _sqlite3_create_collation_ptr = - _lookup>( - 'sqlite3_create_collation'); - late final _dart_sqlite3_create_collation _sqlite3_create_collation = - _sqlite3_create_collation_ptr - .asFunction<_dart_sqlite3_create_collation>(); + late final _sqlite3_create_collation_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>)>>( + 'sqlite3_create_collation'); + late final _sqlite3_create_collation = + _sqlite3_create_collation_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>)>(); int sqlite3_create_collation_v2( ffi.Pointer arg0, ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, - ffi.Pointer> xDestroy, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + ffi.Pointer, ffi.Int32, ffi.Pointer)>> + xCompare, + ffi.Pointer)>> + xDestroy, ) { return _sqlite3_create_collation_v2( arg0, @@ -5708,19 +6536,54 @@ class SQLite { ); } - late final _sqlite3_create_collation_v2_ptr = - _lookup>( - 'sqlite3_create_collation_v2'); - late final _dart_sqlite3_create_collation_v2 _sqlite3_create_collation_v2 = - _sqlite3_create_collation_v2_ptr - .asFunction<_dart_sqlite3_create_collation_v2>(); + late final _sqlite3_create_collation_v2_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( + 'sqlite3_create_collation_v2'); + late final _sqlite3_create_collation_v2 = + _sqlite3_create_collation_v2_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>(); int sqlite3_create_collation16( ffi.Pointer arg0, ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + ffi.Pointer, ffi.Int32, ffi.Pointer)>> + xCompare, ) { return _sqlite3_create_collation16( arg0, @@ -5731,12 +6594,37 @@ class SQLite { ); } - late final _sqlite3_create_collation16_ptr = - _lookup>( - 'sqlite3_create_collation16'); - late final _dart_sqlite3_create_collation16 _sqlite3_create_collation16 = - _sqlite3_create_collation16_ptr - .asFunction<_dart_sqlite3_create_collation16>(); + late final _sqlite3_create_collation16_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>)>>( + 'sqlite3_create_collation16'); + late final _sqlite3_create_collation16 = + _sqlite3_create_collation16_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>)>(); /// CAPI3REF: Collation Needed Callbacks /// METHOD: sqlite3 @@ -5766,7 +6654,11 @@ class SQLite { int sqlite3_collation_needed( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer> arg2, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>> + arg2, ) { return _sqlite3_collation_needed( arg0, @@ -5775,17 +6667,40 @@ class SQLite { ); } - late final _sqlite3_collation_needed_ptr = - _lookup>( - 'sqlite3_collation_needed'); - late final _dart_sqlite3_collation_needed _sqlite3_collation_needed = - _sqlite3_collation_needed_ptr - .asFunction<_dart_sqlite3_collation_needed>(); + late final _sqlite3_collation_needed_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>)>>( + 'sqlite3_collation_needed'); + late final _sqlite3_collation_needed = + _sqlite3_collation_needed_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>)>(); int sqlite3_collation_needed16( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer> arg2, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>> + arg2, ) { return _sqlite3_collation_needed16( arg0, @@ -5794,12 +6709,31 @@ class SQLite { ); } - late final _sqlite3_collation_needed16_ptr = - _lookup>( - 'sqlite3_collation_needed16'); - late final _dart_sqlite3_collation_needed16 _sqlite3_collation_needed16 = - _sqlite3_collation_needed16_ptr - .asFunction<_dart_sqlite3_collation_needed16>(); + late final _sqlite3_collation_needed16_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>)>>( + 'sqlite3_collation_needed16'); + late final _sqlite3_collation_needed16 = + _sqlite3_collation_needed16_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>)>(); /// CAPI3REF: Suspend Execution For A Short Time /// @@ -5825,9 +6759,10 @@ class SQLite { } late final _sqlite3_sleep_ptr = - _lookup>('sqlite3_sleep'); - late final _dart_sqlite3_sleep _sqlite3_sleep = - _sqlite3_sleep_ptr.asFunction<_dart_sqlite3_sleep>(); + _lookup>( + 'sqlite3_sleep'); + late final _sqlite3_sleep = + _sqlite3_sleep_ptr.asFunction(); /// CAPI3REF: Name Of The Folder Holding Temporary Files /// @@ -5961,12 +6896,12 @@ class SQLite { ); } - late final _sqlite3_win32_set_directory_ptr = - _lookup>( - 'sqlite3_win32_set_directory'); - late final _dart_sqlite3_win32_set_directory _sqlite3_win32_set_directory = - _sqlite3_win32_set_directory_ptr - .asFunction<_dart_sqlite3_win32_set_directory>(); + late final _sqlite3_win32_set_directory_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Uint64, + ffi.Pointer)>>('sqlite3_win32_set_directory'); + late final _sqlite3_win32_set_directory = _sqlite3_win32_set_directory_ptr + .asFunction)>(); int sqlite3_win32_set_directory8( int type, @@ -5978,12 +6913,12 @@ class SQLite { ); } - late final _sqlite3_win32_set_directory8_ptr = - _lookup>( - 'sqlite3_win32_set_directory8'); - late final _dart_sqlite3_win32_set_directory8 _sqlite3_win32_set_directory8 = - _sqlite3_win32_set_directory8_ptr - .asFunction<_dart_sqlite3_win32_set_directory8>(); + late final _sqlite3_win32_set_directory8_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Uint64, + ffi.Pointer)>>('sqlite3_win32_set_directory8'); + late final _sqlite3_win32_set_directory8 = _sqlite3_win32_set_directory8_ptr + .asFunction)>(); int sqlite3_win32_set_directory16( int type, @@ -5995,12 +6930,12 @@ class SQLite { ); } - late final _sqlite3_win32_set_directory16_ptr = - _lookup>( - 'sqlite3_win32_set_directory16'); - late final _dart_sqlite3_win32_set_directory16 - _sqlite3_win32_set_directory16 = _sqlite3_win32_set_directory16_ptr - .asFunction<_dart_sqlite3_win32_set_directory16>(); + late final _sqlite3_win32_set_directory16_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Uint64, + ffi.Pointer)>>('sqlite3_win32_set_directory16'); + late final _sqlite3_win32_set_directory16 = _sqlite3_win32_set_directory16_ptr + .asFunction)>(); /// CAPI3REF: Test For Auto-Commit Mode /// KEYWORDS: {autocommit mode} @@ -6031,10 +6966,10 @@ class SQLite { } late final _sqlite3_get_autocommit_ptr = - _lookup>( + _lookup)>>( 'sqlite3_get_autocommit'); - late final _dart_sqlite3_get_autocommit _sqlite3_get_autocommit = - _sqlite3_get_autocommit_ptr.asFunction<_dart_sqlite3_get_autocommit>(); + late final _sqlite3_get_autocommit = _sqlite3_get_autocommit_ptr + .asFunction)>(); /// CAPI3REF: Find The Database Handle Of A Prepared Statement /// METHOD: sqlite3_stmt @@ -6053,10 +6988,12 @@ class SQLite { ); } - late final _sqlite3_db_handle_ptr = - _lookup>('sqlite3_db_handle'); - late final _dart_sqlite3_db_handle _sqlite3_db_handle = - _sqlite3_db_handle_ptr.asFunction<_dart_sqlite3_db_handle>(); + late final _sqlite3_db_handle_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_db_handle'); + late final _sqlite3_db_handle = _sqlite3_db_handle_ptr + .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Return The Filename For A Database Connection /// METHOD: sqlite3 @@ -6096,11 +7033,13 @@ class SQLite { ); } - late final _sqlite3_db_filename_ptr = - _lookup>( - 'sqlite3_db_filename'); - late final _dart_sqlite3_db_filename _sqlite3_db_filename = - _sqlite3_db_filename_ptr.asFunction<_dart_sqlite3_db_filename>(); + late final _sqlite3_db_filename_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_db_filename'); + late final _sqlite3_db_filename = _sqlite3_db_filename_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Determine if a database is read-only /// METHOD: sqlite3 @@ -6118,11 +7057,12 @@ class SQLite { ); } - late final _sqlite3_db_readonly_ptr = - _lookup>( - 'sqlite3_db_readonly'); - late final _dart_sqlite3_db_readonly _sqlite3_db_readonly = - _sqlite3_db_readonly_ptr.asFunction<_dart_sqlite3_db_readonly>(); + late final _sqlite3_db_readonly_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_db_readonly'); + late final _sqlite3_db_readonly = _sqlite3_db_readonly_ptr + .asFunction, ffi.Pointer)>(); /// CAPI3REF: Find the next prepared statement /// METHOD: sqlite3 @@ -6146,10 +7086,13 @@ class SQLite { ); } - late final _sqlite3_next_stmt_ptr = - _lookup>('sqlite3_next_stmt'); - late final _dart_sqlite3_next_stmt _sqlite3_next_stmt = - _sqlite3_next_stmt_ptr.asFunction<_dart_sqlite3_next_stmt>(); + late final _sqlite3_next_stmt_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_next_stmt'); + late final _sqlite3_next_stmt = _sqlite3_next_stmt_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Commit And Rollback Notification Callbacks /// METHOD: sqlite3 @@ -6198,7 +7141,8 @@ class SQLite { /// See also the [sqlite3_update_hook()] interface. ffi.Pointer sqlite3_commit_hook( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer)>> + arg1, ffi.Pointer arg2, ) { return _sqlite3_commit_hook( @@ -6208,15 +7152,25 @@ class SQLite { ); } - late final _sqlite3_commit_hook_ptr = - _lookup>( - 'sqlite3_commit_hook'); - late final _dart_sqlite3_commit_hook _sqlite3_commit_hook = - _sqlite3_commit_hook_ptr.asFunction<_dart_sqlite3_commit_hook>(); + late final _sqlite3_commit_hook_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer)>>, + ffi.Pointer)>>('sqlite3_commit_hook'); + late final _sqlite3_commit_hook = _sqlite3_commit_hook_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction)>>, + ffi.Pointer)>(); ffi.Pointer sqlite3_rollback_hook( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer)>> + arg1, ffi.Pointer arg2, ) { return _sqlite3_rollback_hook( @@ -6226,11 +7180,19 @@ class SQLite { ); } - late final _sqlite3_rollback_hook_ptr = - _lookup>( - 'sqlite3_rollback_hook'); - late final _dart_sqlite3_rollback_hook _sqlite3_rollback_hook = - _sqlite3_rollback_hook_ptr.asFunction<_dart_sqlite3_rollback_hook>(); + late final _sqlite3_rollback_hook_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction)>>, + ffi.Pointer)>>('sqlite3_rollback_hook'); + late final _sqlite3_rollback_hook = _sqlite3_rollback_hook_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction)>>, + ffi.Pointer)>(); /// CAPI3REF: Data Change Notification Callbacks /// METHOD: sqlite3 @@ -6281,7 +7243,15 @@ class SQLite { /// and [sqlite3_preupdate_hook()] interfaces. ffi.Pointer sqlite3_update_hook( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + sqlite3_int64)>> + arg1, ffi.Pointer arg2, ) { return _sqlite3_update_hook( @@ -6291,11 +7261,31 @@ class SQLite { ); } - late final _sqlite3_update_hook_ptr = - _lookup>( - 'sqlite3_update_hook'); - late final _dart_sqlite3_update_hook _sqlite3_update_hook = - _sqlite3_update_hook_ptr.asFunction<_dart_sqlite3_update_hook>(); + late final _sqlite3_update_hook_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + sqlite3_int64)>>, + ffi.Pointer)>>('sqlite3_update_hook'); + late final _sqlite3_update_hook = _sqlite3_update_hook_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + sqlite3_int64)>>, + ffi.Pointer)>(); /// CAPI3REF: Enable Or Disable Shared Pager Cache /// @@ -6343,11 +7333,10 @@ class SQLite { } late final _sqlite3_enable_shared_cache_ptr = - _lookup>( + _lookup>( 'sqlite3_enable_shared_cache'); - late final _dart_sqlite3_enable_shared_cache _sqlite3_enable_shared_cache = - _sqlite3_enable_shared_cache_ptr - .asFunction<_dart_sqlite3_enable_shared_cache>(); + late final _sqlite3_enable_shared_cache = + _sqlite3_enable_shared_cache_ptr.asFunction(); /// CAPI3REF: Attempt To Free Heap Memory /// @@ -6370,10 +7359,10 @@ class SQLite { } late final _sqlite3_release_memory_ptr = - _lookup>( + _lookup>( 'sqlite3_release_memory'); - late final _dart_sqlite3_release_memory _sqlite3_release_memory = - _sqlite3_release_memory_ptr.asFunction<_dart_sqlite3_release_memory>(); + late final _sqlite3_release_memory = + _sqlite3_release_memory_ptr.asFunction(); /// CAPI3REF: Free Memory Used By A Database Connection /// METHOD: sqlite3 @@ -6394,11 +7383,10 @@ class SQLite { } late final _sqlite3_db_release_memory_ptr = - _lookup>( + _lookup)>>( 'sqlite3_db_release_memory'); - late final _dart_sqlite3_db_release_memory _sqlite3_db_release_memory = - _sqlite3_db_release_memory_ptr - .asFunction<_dart_sqlite3_db_release_memory>(); + late final _sqlite3_db_release_memory = _sqlite3_db_release_memory_ptr + .asFunction)>(); /// CAPI3REF: Impose A Limit On Heap Size /// @@ -6471,11 +7459,10 @@ class SQLite { } late final _sqlite3_soft_heap_limit64_ptr = - _lookup>( + _lookup>( 'sqlite3_soft_heap_limit64'); - late final _dart_sqlite3_soft_heap_limit64 _sqlite3_soft_heap_limit64 = - _sqlite3_soft_heap_limit64_ptr - .asFunction<_dart_sqlite3_soft_heap_limit64>(); + late final _sqlite3_soft_heap_limit64 = + _sqlite3_soft_heap_limit64_ptr.asFunction(); int sqlite3_hard_heap_limit64( int N, @@ -6486,11 +7473,10 @@ class SQLite { } late final _sqlite3_hard_heap_limit64_ptr = - _lookup>( + _lookup>( 'sqlite3_hard_heap_limit64'); - late final _dart_sqlite3_hard_heap_limit64 _sqlite3_hard_heap_limit64 = - _sqlite3_hard_heap_limit64_ptr - .asFunction<_dart_sqlite3_hard_heap_limit64>(); + late final _sqlite3_hard_heap_limit64 = + _sqlite3_hard_heap_limit64_ptr.asFunction(); /// CAPI3REF: Deprecated Soft Heap Limit Interface /// DEPRECATED @@ -6508,10 +7494,10 @@ class SQLite { } late final _sqlite3_soft_heap_limit_ptr = - _lookup>( + _lookup>( 'sqlite3_soft_heap_limit'); - late final _dart_sqlite3_soft_heap_limit _sqlite3_soft_heap_limit = - _sqlite3_soft_heap_limit_ptr.asFunction<_dart_sqlite3_soft_heap_limit>(); + late final _sqlite3_soft_heap_limit = + _sqlite3_soft_heap_limit_ptr.asFunction(); /// CAPI3REF: Extract Metadata About A Column Of A Table /// METHOD: sqlite3 @@ -6604,12 +7590,30 @@ class SQLite { ); } - late final _sqlite3_table_column_metadata_ptr = - _lookup>( - 'sqlite3_table_column_metadata'); - late final _dart_sqlite3_table_column_metadata - _sqlite3_table_column_metadata = _sqlite3_table_column_metadata_ptr - .asFunction<_dart_sqlite3_table_column_metadata>(); + late final _sqlite3_table_column_metadata_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('sqlite3_table_column_metadata'); + late final _sqlite3_table_column_metadata = + _sqlite3_table_column_metadata_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// CAPI3REF: Load An Extension /// METHOD: sqlite3 @@ -6667,11 +7671,16 @@ class SQLite { ); } - late final _sqlite3_load_extension_ptr = - _lookup>( - 'sqlite3_load_extension'); - late final _dart_sqlite3_load_extension _sqlite3_load_extension = - _sqlite3_load_extension_ptr.asFunction<_dart_sqlite3_load_extension>(); + late final _sqlite3_load_extension_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('sqlite3_load_extension'); + late final _sqlite3_load_extension = _sqlite3_load_extension_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); /// CAPI3REF: Enable Or Disable Extension Loading /// METHOD: sqlite3 @@ -6706,12 +7715,12 @@ class SQLite { ); } - late final _sqlite3_enable_load_extension_ptr = - _lookup>( - 'sqlite3_enable_load_extension'); - late final _dart_sqlite3_enable_load_extension - _sqlite3_enable_load_extension = _sqlite3_enable_load_extension_ptr - .asFunction<_dart_sqlite3_enable_load_extension>(); + late final _sqlite3_enable_load_extension_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_enable_load_extension'); + late final _sqlite3_enable_load_extension = _sqlite3_enable_load_extension_ptr + .asFunction, int)>(); /// CAPI3REF: Automatically Load Statically Linked Extensions /// @@ -6748,18 +7757,20 @@ class SQLite { /// See also: [sqlite3_reset_auto_extension()] /// and [sqlite3_cancel_auto_extension()] int sqlite3_auto_extension( - ffi.Pointer> xEntryPoint, + ffi.Pointer> xEntryPoint, ) { return _sqlite3_auto_extension( xEntryPoint, ); } - late final _sqlite3_auto_extension_ptr = - _lookup>( - 'sqlite3_auto_extension'); - late final _dart_sqlite3_auto_extension _sqlite3_auto_extension = - _sqlite3_auto_extension_ptr.asFunction<_dart_sqlite3_auto_extension>(); + late final _sqlite3_auto_extension_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer>)>>( + 'sqlite3_auto_extension'); + late final _sqlite3_auto_extension = _sqlite3_auto_extension_ptr.asFunction< + int Function(ffi.Pointer>)>(); /// CAPI3REF: Cancel Automatic Extension Loading /// @@ -6770,19 +7781,21 @@ class SQLite { /// unregistered and it returns 0 if X was not on the list of initialization /// routines. int sqlite3_cancel_auto_extension( - ffi.Pointer> xEntryPoint, + ffi.Pointer> xEntryPoint, ) { return _sqlite3_cancel_auto_extension( xEntryPoint, ); } - late final _sqlite3_cancel_auto_extension_ptr = - _lookup>( - 'sqlite3_cancel_auto_extension'); - late final _dart_sqlite3_cancel_auto_extension - _sqlite3_cancel_auto_extension = _sqlite3_cancel_auto_extension_ptr - .asFunction<_dart_sqlite3_cancel_auto_extension>(); + late final _sqlite3_cancel_auto_extension_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer>)>>( + 'sqlite3_cancel_auto_extension'); + late final _sqlite3_cancel_auto_extension = + _sqlite3_cancel_auto_extension_ptr.asFunction< + int Function(ffi.Pointer>)>(); /// CAPI3REF: Reset Automatic Extension Loading /// @@ -6793,11 +7806,10 @@ class SQLite { } late final _sqlite3_reset_auto_extension_ptr = - _lookup>( + _lookup>( 'sqlite3_reset_auto_extension'); - late final _dart_sqlite3_reset_auto_extension _sqlite3_reset_auto_extension = - _sqlite3_reset_auto_extension_ptr - .asFunction<_dart_sqlite3_reset_auto_extension>(); + late final _sqlite3_reset_auto_extension = + _sqlite3_reset_auto_extension_ptr.asFunction(); /// CAPI3REF: Register A Virtual Table Implementation /// METHOD: sqlite3 @@ -6843,18 +7855,24 @@ class SQLite { ); } - late final _sqlite3_create_module_ptr = - _lookup>( - 'sqlite3_create_module'); - late final _dart_sqlite3_create_module _sqlite3_create_module = - _sqlite3_create_module_ptr.asFunction<_dart_sqlite3_create_module>(); + late final _sqlite3_create_module_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('sqlite3_create_module'); + late final _sqlite3_create_module = _sqlite3_create_module_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); int sqlite3_create_module_v2( ffi.Pointer db, ffi.Pointer zName, ffi.Pointer p, ffi.Pointer pClientData, - ffi.Pointer> xDestroy, + ffi.Pointer)>> + xDestroy, ) { return _sqlite3_create_module_v2( db, @@ -6865,12 +7883,27 @@ class SQLite { ); } - late final _sqlite3_create_module_v2_ptr = - _lookup>( - 'sqlite3_create_module_v2'); - late final _dart_sqlite3_create_module_v2 _sqlite3_create_module_v2 = - _sqlite3_create_module_v2_ptr - .asFunction<_dart_sqlite3_create_module_v2>(); + late final _sqlite3_create_module_v2_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( + 'sqlite3_create_module_v2'); + late final _sqlite3_create_module_v2 = + _sqlite3_create_module_v2_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>(); /// CAPI3REF: Remove Unnecessary Virtual Table Implementations /// METHOD: sqlite3 @@ -6892,11 +7925,12 @@ class SQLite { ); } - late final _sqlite3_drop_modules_ptr = - _lookup>( - 'sqlite3_drop_modules'); - late final _dart_sqlite3_drop_modules _sqlite3_drop_modules = - _sqlite3_drop_modules_ptr.asFunction<_dart_sqlite3_drop_modules>(); + late final _sqlite3_drop_modules_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer>)>>('sqlite3_drop_modules'); + late final _sqlite3_drop_modules = _sqlite3_drop_modules_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer>)>(); /// CAPI3REF: Declare The Schema Of A Virtual Table /// @@ -6914,11 +7948,12 @@ class SQLite { ); } - late final _sqlite3_declare_vtab_ptr = - _lookup>( - 'sqlite3_declare_vtab'); - late final _dart_sqlite3_declare_vtab _sqlite3_declare_vtab = - _sqlite3_declare_vtab_ptr.asFunction<_dart_sqlite3_declare_vtab>(); + late final _sqlite3_declare_vtab_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_declare_vtab'); + late final _sqlite3_declare_vtab = _sqlite3_declare_vtab_ptr + .asFunction, ffi.Pointer)>(); /// CAPI3REF: Overload A Function For A Virtual Table /// METHOD: sqlite3 @@ -6947,12 +7982,13 @@ class SQLite { ); } - late final _sqlite3_overload_function_ptr = - _lookup>( - 'sqlite3_overload_function'); - late final _dart_sqlite3_overload_function _sqlite3_overload_function = - _sqlite3_overload_function_ptr - .asFunction<_dart_sqlite3_overload_function>(); + late final _sqlite3_overload_function_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('sqlite3_overload_function'); + late final _sqlite3_overload_function = + _sqlite3_overload_function_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); /// CAPI3REF: Open A BLOB For Incremental I/O /// METHOD: sqlite3 @@ -7055,10 +8091,25 @@ class SQLite { ); } - late final _sqlite3_blob_open_ptr = - _lookup>('sqlite3_blob_open'); - late final _dart_sqlite3_blob_open _sqlite3_blob_open = - _sqlite3_blob_open_ptr.asFunction<_dart_sqlite3_blob_open>(); + late final _sqlite3_blob_open_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + sqlite3_int64, + ffi.Int32, + ffi.Pointer>)>>('sqlite3_blob_open'); + late final _sqlite3_blob_open = _sqlite3_blob_open_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer>)>(); /// CAPI3REF: Move a BLOB Handle to a New Row /// METHOD: sqlite3_blob @@ -7091,11 +8142,12 @@ class SQLite { ); } - late final _sqlite3_blob_reopen_ptr = - _lookup>( - 'sqlite3_blob_reopen'); - late final _dart_sqlite3_blob_reopen _sqlite3_blob_reopen = - _sqlite3_blob_reopen_ptr.asFunction<_dart_sqlite3_blob_reopen>(); + late final _sqlite3_blob_reopen_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + sqlite3_int64)>>('sqlite3_blob_reopen'); + late final _sqlite3_blob_reopen = _sqlite3_blob_reopen_ptr + .asFunction, int)>(); /// CAPI3REF: Close A BLOB Handle /// DESTRUCTOR: sqlite3_blob @@ -7124,10 +8176,11 @@ class SQLite { ); } - late final _sqlite3_blob_close_ptr = - _lookup>('sqlite3_blob_close'); - late final _dart_sqlite3_blob_close _sqlite3_blob_close = - _sqlite3_blob_close_ptr.asFunction<_dart_sqlite3_blob_close>(); + late final _sqlite3_blob_close_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_blob_close'); + late final _sqlite3_blob_close = _sqlite3_blob_close_ptr + .asFunction)>(); /// CAPI3REF: Return The Size Of An Open BLOB /// METHOD: sqlite3_blob @@ -7149,10 +8202,11 @@ class SQLite { ); } - late final _sqlite3_blob_bytes_ptr = - _lookup>('sqlite3_blob_bytes'); - late final _dart_sqlite3_blob_bytes _sqlite3_blob_bytes = - _sqlite3_blob_bytes_ptr.asFunction<_dart_sqlite3_blob_bytes>(); + late final _sqlite3_blob_bytes_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_blob_bytes'); + late final _sqlite3_blob_bytes = _sqlite3_blob_bytes_ptr + .asFunction)>(); /// CAPI3REF: Read Data From A BLOB Incrementally /// METHOD: sqlite3_blob @@ -7193,10 +8247,13 @@ class SQLite { ); } - late final _sqlite3_blob_read_ptr = - _lookup>('sqlite3_blob_read'); - late final _dart_sqlite3_blob_read _sqlite3_blob_read = - _sqlite3_blob_read_ptr.asFunction<_dart_sqlite3_blob_read>(); + late final _sqlite3_blob_read_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Int32)>>('sqlite3_blob_read'); + late final _sqlite3_blob_read = _sqlite3_blob_read_ptr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer, int, int)>(); /// CAPI3REF: Write Data Into A BLOB Incrementally /// METHOD: sqlite3_blob @@ -7250,10 +8307,13 @@ class SQLite { ); } - late final _sqlite3_blob_write_ptr = - _lookup>('sqlite3_blob_write'); - late final _dart_sqlite3_blob_write _sqlite3_blob_write = - _sqlite3_blob_write_ptr.asFunction<_dart_sqlite3_blob_write>(); + late final _sqlite3_blob_write_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Int32)>>('sqlite3_blob_write'); + late final _sqlite3_blob_write = _sqlite3_blob_write_ptr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer, int, int)>(); /// CAPI3REF: Virtual File System Objects /// @@ -7290,10 +8350,12 @@ class SQLite { ); } - late final _sqlite3_vfs_find_ptr = - _lookup>('sqlite3_vfs_find'); - late final _dart_sqlite3_vfs_find _sqlite3_vfs_find = - _sqlite3_vfs_find_ptr.asFunction<_dart_sqlite3_vfs_find>(); + late final _sqlite3_vfs_find_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_vfs_find'); + late final _sqlite3_vfs_find = _sqlite3_vfs_find_ptr + .asFunction Function(ffi.Pointer)>(); int sqlite3_vfs_register( ffi.Pointer arg0, @@ -7305,11 +8367,12 @@ class SQLite { ); } - late final _sqlite3_vfs_register_ptr = - _lookup>( - 'sqlite3_vfs_register'); - late final _dart_sqlite3_vfs_register _sqlite3_vfs_register = - _sqlite3_vfs_register_ptr.asFunction<_dart_sqlite3_vfs_register>(); + late final _sqlite3_vfs_register_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_vfs_register'); + late final _sqlite3_vfs_register = _sqlite3_vfs_register_ptr + .asFunction, int)>(); int sqlite3_vfs_unregister( ffi.Pointer arg0, @@ -7320,10 +8383,10 @@ class SQLite { } late final _sqlite3_vfs_unregister_ptr = - _lookup>( + _lookup)>>( 'sqlite3_vfs_unregister'); - late final _dart_sqlite3_vfs_unregister _sqlite3_vfs_unregister = - _sqlite3_vfs_unregister_ptr.asFunction<_dart_sqlite3_vfs_unregister>(); + late final _sqlite3_vfs_unregister = _sqlite3_vfs_unregister_ptr + .asFunction)>(); /// CAPI3REF: Mutexes /// @@ -7445,11 +8508,11 @@ class SQLite { ); } - late final _sqlite3_mutex_alloc_ptr = - _lookup>( - 'sqlite3_mutex_alloc'); - late final _dart_sqlite3_mutex_alloc _sqlite3_mutex_alloc = - _sqlite3_mutex_alloc_ptr.asFunction<_dart_sqlite3_mutex_alloc>(); + late final _sqlite3_mutex_alloc_ptr = _lookup< + ffi.NativeFunction Function(ffi.Int32)>>( + 'sqlite3_mutex_alloc'); + late final _sqlite3_mutex_alloc = _sqlite3_mutex_alloc_ptr + .asFunction Function(int)>(); void sqlite3_mutex_free( ffi.Pointer arg0, @@ -7459,10 +8522,11 @@ class SQLite { ); } - late final _sqlite3_mutex_free_ptr = - _lookup>('sqlite3_mutex_free'); - late final _dart_sqlite3_mutex_free _sqlite3_mutex_free = - _sqlite3_mutex_free_ptr.asFunction<_dart_sqlite3_mutex_free>(); + late final _sqlite3_mutex_free_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_mutex_free'); + late final _sqlite3_mutex_free = _sqlite3_mutex_free_ptr + .asFunction)>(); void sqlite3_mutex_enter( ffi.Pointer arg0, @@ -7472,11 +8536,11 @@ class SQLite { ); } - late final _sqlite3_mutex_enter_ptr = - _lookup>( - 'sqlite3_mutex_enter'); - late final _dart_sqlite3_mutex_enter _sqlite3_mutex_enter = - _sqlite3_mutex_enter_ptr.asFunction<_dart_sqlite3_mutex_enter>(); + late final _sqlite3_mutex_enter_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_mutex_enter'); + late final _sqlite3_mutex_enter = _sqlite3_mutex_enter_ptr + .asFunction)>(); int sqlite3_mutex_try( ffi.Pointer arg0, @@ -7486,10 +8550,11 @@ class SQLite { ); } - late final _sqlite3_mutex_try_ptr = - _lookup>('sqlite3_mutex_try'); - late final _dart_sqlite3_mutex_try _sqlite3_mutex_try = - _sqlite3_mutex_try_ptr.asFunction<_dart_sqlite3_mutex_try>(); + late final _sqlite3_mutex_try_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_mutex_try'); + late final _sqlite3_mutex_try = _sqlite3_mutex_try_ptr + .asFunction)>(); void sqlite3_mutex_leave( ffi.Pointer arg0, @@ -7499,11 +8564,11 @@ class SQLite { ); } - late final _sqlite3_mutex_leave_ptr = - _lookup>( - 'sqlite3_mutex_leave'); - late final _dart_sqlite3_mutex_leave _sqlite3_mutex_leave = - _sqlite3_mutex_leave_ptr.asFunction<_dart_sqlite3_mutex_leave>(); + late final _sqlite3_mutex_leave_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_mutex_leave'); + late final _sqlite3_mutex_leave = _sqlite3_mutex_leave_ptr + .asFunction)>(); int sqlite3_mutex_held( ffi.Pointer arg0, @@ -7513,10 +8578,11 @@ class SQLite { ); } - late final _sqlite3_mutex_held_ptr = - _lookup>('sqlite3_mutex_held'); - late final _dart_sqlite3_mutex_held _sqlite3_mutex_held = - _sqlite3_mutex_held_ptr.asFunction<_dart_sqlite3_mutex_held>(); + late final _sqlite3_mutex_held_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_mutex_held'); + late final _sqlite3_mutex_held = _sqlite3_mutex_held_ptr + .asFunction)>(); int sqlite3_mutex_notheld( ffi.Pointer arg0, @@ -7526,11 +8592,11 @@ class SQLite { ); } - late final _sqlite3_mutex_notheld_ptr = - _lookup>( - 'sqlite3_mutex_notheld'); - late final _dart_sqlite3_mutex_notheld _sqlite3_mutex_notheld = - _sqlite3_mutex_notheld_ptr.asFunction<_dart_sqlite3_mutex_notheld>(); + late final _sqlite3_mutex_notheld_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_mutex_notheld'); + late final _sqlite3_mutex_notheld = _sqlite3_mutex_notheld_ptr + .asFunction)>(); /// CAPI3REF: Retrieve the mutex for a database connection /// METHOD: sqlite3 @@ -7548,10 +8614,12 @@ class SQLite { ); } - late final _sqlite3_db_mutex_ptr = - _lookup>('sqlite3_db_mutex'); - late final _dart_sqlite3_db_mutex _sqlite3_db_mutex = - _sqlite3_db_mutex_ptr.asFunction<_dart_sqlite3_db_mutex>(); + late final _sqlite3_db_mutex_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_db_mutex'); + late final _sqlite3_db_mutex = _sqlite3_db_mutex_ptr + .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Low-Level Control Of Database Files /// METHOD: sqlite3 @@ -7606,11 +8674,13 @@ class SQLite { ); } - late final _sqlite3_file_control_ptr = - _lookup>( - 'sqlite3_file_control'); - late final _dart_sqlite3_file_control _sqlite3_file_control = - _sqlite3_file_control_ptr.asFunction<_dart_sqlite3_file_control>(); + late final _sqlite3_file_control_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('sqlite3_file_control'); + late final _sqlite3_file_control = _sqlite3_file_control_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); /// CAPI3REF: Testing Interface /// @@ -7636,10 +8706,10 @@ class SQLite { } late final _sqlite3_test_control_ptr = - _lookup>( + _lookup>( 'sqlite3_test_control'); - late final _dart_sqlite3_test_control _sqlite3_test_control = - _sqlite3_test_control_ptr.asFunction<_dart_sqlite3_test_control>(); + late final _sqlite3_test_control = + _sqlite3_test_control_ptr.asFunction(); /// CAPI3REF: SQL Keyword Checking /// @@ -7691,10 +8761,10 @@ class SQLite { } late final _sqlite3_keyword_count_ptr = - _lookup>( + _lookup>( 'sqlite3_keyword_count'); - late final _dart_sqlite3_keyword_count _sqlite3_keyword_count = - _sqlite3_keyword_count_ptr.asFunction<_dart_sqlite3_keyword_count>(); + late final _sqlite3_keyword_count = + _sqlite3_keyword_count_ptr.asFunction(); int sqlite3_keyword_name( int arg0, @@ -7708,11 +8778,13 @@ class SQLite { ); } - late final _sqlite3_keyword_name_ptr = - _lookup>( - 'sqlite3_keyword_name'); - late final _dart_sqlite3_keyword_name _sqlite3_keyword_name = - _sqlite3_keyword_name_ptr.asFunction<_dart_sqlite3_keyword_name>(); + late final _sqlite3_keyword_name_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Int32, ffi.Pointer>, + ffi.Pointer)>>('sqlite3_keyword_name'); + late final _sqlite3_keyword_name = _sqlite3_keyword_name_ptr.asFunction< + int Function( + int, ffi.Pointer>, ffi.Pointer)>(); int sqlite3_keyword_check( ffi.Pointer arg0, @@ -7724,11 +8796,12 @@ class SQLite { ); } - late final _sqlite3_keyword_check_ptr = - _lookup>( - 'sqlite3_keyword_check'); - late final _dart_sqlite3_keyword_check _sqlite3_keyword_check = - _sqlite3_keyword_check_ptr.asFunction<_dart_sqlite3_keyword_check>(); + late final _sqlite3_keyword_check_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_keyword_check'); + late final _sqlite3_keyword_check = _sqlite3_keyword_check_ptr + .asFunction, int)>(); /// CAPI3REF: Create A New Dynamic String Object /// CONSTRUCTOR: sqlite3_str @@ -7761,10 +8834,12 @@ class SQLite { ); } - late final _sqlite3_str_new_ptr = - _lookup>('sqlite3_str_new'); - late final _dart_sqlite3_str_new _sqlite3_str_new = - _sqlite3_str_new_ptr.asFunction<_dart_sqlite3_str_new>(); + late final _sqlite3_str_new_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_str_new'); + late final _sqlite3_str_new = _sqlite3_str_new_ptr + .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Finalize A Dynamic String /// DESTRUCTOR: sqlite3_str @@ -7785,10 +8860,12 @@ class SQLite { ); } - late final _sqlite3_str_finish_ptr = - _lookup>('sqlite3_str_finish'); - late final _dart_sqlite3_str_finish _sqlite3_str_finish = - _sqlite3_str_finish_ptr.asFunction<_dart_sqlite3_str_finish>(); + late final _sqlite3_str_finish_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_str_finish'); + late final _sqlite3_str_finish = _sqlite3_str_finish_ptr + .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Add Content To A Dynamic String /// METHOD: sqlite3_str @@ -7830,11 +8907,12 @@ class SQLite { ); } - late final _sqlite3_str_appendf_ptr = - _lookup>( - 'sqlite3_str_appendf'); - late final _dart_sqlite3_str_appendf _sqlite3_str_appendf = - _sqlite3_str_appendf_ptr.asFunction<_dart_sqlite3_str_appendf>(); + late final _sqlite3_str_appendf_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_str_appendf'); + late final _sqlite3_str_appendf = _sqlite3_str_appendf_ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); void sqlite3_str_append( ffi.Pointer arg0, @@ -7848,10 +8926,12 @@ class SQLite { ); } - late final _sqlite3_str_append_ptr = - _lookup>('sqlite3_str_append'); - late final _dart_sqlite3_str_append _sqlite3_str_append = - _sqlite3_str_append_ptr.asFunction<_dart_sqlite3_str_append>(); + late final _sqlite3_str_append_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('sqlite3_str_append'); + late final _sqlite3_str_append = _sqlite3_str_append_ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); void sqlite3_str_appendall( ffi.Pointer arg0, @@ -7863,11 +8943,12 @@ class SQLite { ); } - late final _sqlite3_str_appendall_ptr = - _lookup>( - 'sqlite3_str_appendall'); - late final _dart_sqlite3_str_appendall _sqlite3_str_appendall = - _sqlite3_str_appendall_ptr.asFunction<_dart_sqlite3_str_appendall>(); + late final _sqlite3_str_appendall_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_str_appendall'); + late final _sqlite3_str_appendall = _sqlite3_str_appendall_ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); void sqlite3_str_appendchar( ffi.Pointer arg0, @@ -7881,11 +8962,12 @@ class SQLite { ); } - late final _sqlite3_str_appendchar_ptr = - _lookup>( - 'sqlite3_str_appendchar'); - late final _dart_sqlite3_str_appendchar _sqlite3_str_appendchar = - _sqlite3_str_appendchar_ptr.asFunction<_dart_sqlite3_str_appendchar>(); + late final _sqlite3_str_appendchar_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Int8)>>('sqlite3_str_appendchar'); + late final _sqlite3_str_appendchar = _sqlite3_str_appendchar_ptr + .asFunction, int, int)>(); void sqlite3_str_reset( ffi.Pointer arg0, @@ -7896,9 +8978,10 @@ class SQLite { } late final _sqlite3_str_reset_ptr = - _lookup>('sqlite3_str_reset'); - late final _dart_sqlite3_str_reset _sqlite3_str_reset = - _sqlite3_str_reset_ptr.asFunction<_dart_sqlite3_str_reset>(); + _lookup)>>( + 'sqlite3_str_reset'); + late final _sqlite3_str_reset = _sqlite3_str_reset_ptr + .asFunction)>(); /// CAPI3REF: Status Of A Dynamic String /// METHOD: sqlite3_str @@ -7936,10 +9019,10 @@ class SQLite { } late final _sqlite3_str_errcode_ptr = - _lookup>( + _lookup)>>( 'sqlite3_str_errcode'); - late final _dart_sqlite3_str_errcode _sqlite3_str_errcode = - _sqlite3_str_errcode_ptr.asFunction<_dart_sqlite3_str_errcode>(); + late final _sqlite3_str_errcode = _sqlite3_str_errcode_ptr + .asFunction)>(); int sqlite3_str_length( ffi.Pointer arg0, @@ -7950,9 +9033,10 @@ class SQLite { } late final _sqlite3_str_length_ptr = - _lookup>('sqlite3_str_length'); - late final _dart_sqlite3_str_length _sqlite3_str_length = - _sqlite3_str_length_ptr.asFunction<_dart_sqlite3_str_length>(); + _lookup)>>( + 'sqlite3_str_length'); + late final _sqlite3_str_length = _sqlite3_str_length_ptr + .asFunction)>(); ffi.Pointer sqlite3_str_value( ffi.Pointer arg0, @@ -7962,10 +9046,12 @@ class SQLite { ); } - late final _sqlite3_str_value_ptr = - _lookup>('sqlite3_str_value'); - late final _dart_sqlite3_str_value _sqlite3_str_value = - _sqlite3_str_value_ptr.asFunction<_dart_sqlite3_str_value>(); + late final _sqlite3_str_value_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_str_value'); + late final _sqlite3_str_value = _sqlite3_str_value_ptr + .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: SQLite Runtime Status /// @@ -8005,15 +9091,17 @@ class SQLite { ); } - late final _sqlite3_status_ptr = - _lookup>('sqlite3_status'); - late final _dart_sqlite3_status _sqlite3_status = - _sqlite3_status_ptr.asFunction<_dart_sqlite3_status>(); + late final _sqlite3_status_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Int32, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('sqlite3_status'); + late final _sqlite3_status = _sqlite3_status_ptr.asFunction< + int Function(int, ffi.Pointer, ffi.Pointer, int)>(); int sqlite3_status64( int op, - ffi.Pointer pCurrent, - ffi.Pointer pHighwater, + ffi.Pointer pCurrent, + ffi.Pointer pHighwater, int resetFlag, ) { return _sqlite3_status64( @@ -8024,10 +9112,13 @@ class SQLite { ); } - late final _sqlite3_status64_ptr = - _lookup>('sqlite3_status64'); - late final _dart_sqlite3_status64 _sqlite3_status64 = - _sqlite3_status64_ptr.asFunction<_dart_sqlite3_status64>(); + late final _sqlite3_status64_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Int32, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('sqlite3_status64'); + late final _sqlite3_status64 = _sqlite3_status64_ptr.asFunction< + int Function( + int, ffi.Pointer, ffi.Pointer, int)>(); /// CAPI3REF: Database Connection Status /// METHOD: sqlite3 @@ -8066,10 +9157,17 @@ class SQLite { ); } - late final _sqlite3_db_status_ptr = - _lookup>('sqlite3_db_status'); - late final _dart_sqlite3_db_status _sqlite3_db_status = - _sqlite3_db_status_ptr.asFunction<_dart_sqlite3_db_status>(); + late final _sqlite3_db_status_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('sqlite3_db_status'); + late final _sqlite3_db_status = _sqlite3_db_status_ptr.asFunction< + int Function(ffi.Pointer, int, ffi.Pointer, + ffi.Pointer, int)>(); /// CAPI3REF: Prepared Statement Status /// METHOD: sqlite3_stmt @@ -8105,11 +9203,12 @@ class SQLite { ); } - late final _sqlite3_stmt_status_ptr = - _lookup>( - 'sqlite3_stmt_status'); - late final _dart_sqlite3_stmt_status _sqlite3_stmt_status = - _sqlite3_stmt_status_ptr.asFunction<_dart_sqlite3_stmt_status>(); + late final _sqlite3_stmt_status_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + ffi.Int32)>>('sqlite3_stmt_status'); + late final _sqlite3_stmt_status = _sqlite3_stmt_status_ptr + .asFunction, int, int)>(); /// CAPI3REF: Online Backup API. /// @@ -8309,11 +9408,19 @@ class SQLite { ); } - late final _sqlite3_backup_init_ptr = - _lookup>( - 'sqlite3_backup_init'); - late final _dart_sqlite3_backup_init _sqlite3_backup_init = - _sqlite3_backup_init_ptr.asFunction<_dart_sqlite3_backup_init>(); + late final _sqlite3_backup_init_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('sqlite3_backup_init'); + late final _sqlite3_backup_init = _sqlite3_backup_init_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); int sqlite3_backup_step( ffi.Pointer p, @@ -8325,11 +9432,12 @@ class SQLite { ); } - late final _sqlite3_backup_step_ptr = - _lookup>( - 'sqlite3_backup_step'); - late final _dart_sqlite3_backup_step _sqlite3_backup_step = - _sqlite3_backup_step_ptr.asFunction<_dart_sqlite3_backup_step>(); + late final _sqlite3_backup_step_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_backup_step'); + late final _sqlite3_backup_step = _sqlite3_backup_step_ptr + .asFunction, int)>(); int sqlite3_backup_finish( ffi.Pointer p, @@ -8339,11 +9447,11 @@ class SQLite { ); } - late final _sqlite3_backup_finish_ptr = - _lookup>( - 'sqlite3_backup_finish'); - late final _dart_sqlite3_backup_finish _sqlite3_backup_finish = - _sqlite3_backup_finish_ptr.asFunction<_dart_sqlite3_backup_finish>(); + late final _sqlite3_backup_finish_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_backup_finish'); + late final _sqlite3_backup_finish = _sqlite3_backup_finish_ptr + .asFunction)>(); int sqlite3_backup_remaining( ffi.Pointer p, @@ -8353,12 +9461,11 @@ class SQLite { ); } - late final _sqlite3_backup_remaining_ptr = - _lookup>( - 'sqlite3_backup_remaining'); - late final _dart_sqlite3_backup_remaining _sqlite3_backup_remaining = - _sqlite3_backup_remaining_ptr - .asFunction<_dart_sqlite3_backup_remaining>(); + late final _sqlite3_backup_remaining_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_backup_remaining'); + late final _sqlite3_backup_remaining = _sqlite3_backup_remaining_ptr + .asFunction)>(); int sqlite3_backup_pagecount( ffi.Pointer p, @@ -8368,12 +9475,11 @@ class SQLite { ); } - late final _sqlite3_backup_pagecount_ptr = - _lookup>( - 'sqlite3_backup_pagecount'); - late final _dart_sqlite3_backup_pagecount _sqlite3_backup_pagecount = - _sqlite3_backup_pagecount_ptr - .asFunction<_dart_sqlite3_backup_pagecount>(); + late final _sqlite3_backup_pagecount_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_backup_pagecount'); + late final _sqlite3_backup_pagecount = _sqlite3_backup_pagecount_ptr + .asFunction)>(); /// CAPI3REF: Unlock Notification /// METHOD: sqlite3 @@ -8490,7 +9596,11 @@ class SQLite { /// SQLITE_LOCKED.)^ int sqlite3_unlock_notify( ffi.Pointer pBlocked, - ffi.Pointer> xNotify, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer>, ffi.Int32)>> + xNotify, ffi.Pointer pNotifyArg, ) { return _sqlite3_unlock_notify( @@ -8500,11 +9610,23 @@ class SQLite { ); } - late final _sqlite3_unlock_notify_ptr = - _lookup>( - 'sqlite3_unlock_notify'); - late final _dart_sqlite3_unlock_notify _sqlite3_unlock_notify = - _sqlite3_unlock_notify_ptr.asFunction<_dart_sqlite3_unlock_notify>(); + late final _sqlite3_unlock_notify_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer>, ffi.Int32)>>, + ffi.Pointer)>>('sqlite3_unlock_notify'); + late final _sqlite3_unlock_notify = _sqlite3_unlock_notify_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer>, ffi.Int32)>>, + ffi.Pointer)>(); /// CAPI3REF: String Comparison /// @@ -8522,10 +9644,12 @@ class SQLite { ); } - late final _sqlite3_stricmp_ptr = - _lookup>('sqlite3_stricmp'); - late final _dart_sqlite3_stricmp _sqlite3_stricmp = - _sqlite3_stricmp_ptr.asFunction<_dart_sqlite3_stricmp>(); + late final _sqlite3_stricmp_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_stricmp'); + late final _sqlite3_stricmp = _sqlite3_stricmp_ptr + .asFunction, ffi.Pointer)>(); int sqlite3_strnicmp( ffi.Pointer arg0, @@ -8539,10 +9663,12 @@ class SQLite { ); } - late final _sqlite3_strnicmp_ptr = - _lookup>('sqlite3_strnicmp'); - late final _dart_sqlite3_strnicmp _sqlite3_strnicmp = - _sqlite3_strnicmp_ptr.asFunction<_dart_sqlite3_strnicmp>(); + late final _sqlite3_strnicmp_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('sqlite3_strnicmp'); + late final _sqlite3_strnicmp = _sqlite3_strnicmp_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); /// CAPI3REF: String Globbing /// @@ -8567,10 +9693,12 @@ class SQLite { ); } - late final _sqlite3_strglob_ptr = - _lookup>('sqlite3_strglob'); - late final _dart_sqlite3_strglob _sqlite3_strglob = - _sqlite3_strglob_ptr.asFunction<_dart_sqlite3_strglob>(); + late final _sqlite3_strglob_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_strglob'); + late final _sqlite3_strglob = _sqlite3_strglob_ptr + .asFunction, ffi.Pointer)>(); /// CAPI3REF: String LIKE Matching /// @@ -8603,10 +9731,12 @@ class SQLite { ); } - late final _sqlite3_strlike_ptr = - _lookup>('sqlite3_strlike'); - late final _dart_sqlite3_strlike _sqlite3_strlike = - _sqlite3_strlike_ptr.asFunction<_dart_sqlite3_strlike>(); + late final _sqlite3_strlike_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Uint32)>>('sqlite3_strlike'); + late final _sqlite3_strlike = _sqlite3_strlike_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); /// CAPI3REF: Error Logging Interface /// @@ -8637,10 +9767,11 @@ class SQLite { ); } - late final _sqlite3_log_ptr = - _lookup>('sqlite3_log'); - late final _dart_sqlite3_log _sqlite3_log = - _sqlite3_log_ptr.asFunction<_dart_sqlite3_log>(); + late final _sqlite3_log_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Int32, ffi.Pointer)>>('sqlite3_log'); + late final _sqlite3_log = + _sqlite3_log_ptr.asFunction)>(); /// CAPI3REF: Write-Ahead Log Commit Hook /// METHOD: sqlite3 @@ -8676,7 +9807,11 @@ class SQLite { /// overwrite any prior [sqlite3_wal_hook()] settings. ffi.Pointer sqlite3_wal_hook( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>> + arg1, ffi.Pointer arg2, ) { return _sqlite3_wal_hook( @@ -8686,10 +9821,26 @@ class SQLite { ); } - late final _sqlite3_wal_hook_ptr = - _lookup>('sqlite3_wal_hook'); - late final _dart_sqlite3_wal_hook _sqlite3_wal_hook = - _sqlite3_wal_hook_ptr.asFunction<_dart_sqlite3_wal_hook>(); + late final _sqlite3_wal_hook_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>, + ffi.Pointer)>>('sqlite3_wal_hook'); + late final _sqlite3_wal_hook = _sqlite3_wal_hook_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Int32)>>, + ffi.Pointer)>(); /// CAPI3REF: Configure an auto-checkpoint /// METHOD: sqlite3 @@ -8728,12 +9879,12 @@ class SQLite { ); } - late final _sqlite3_wal_autocheckpoint_ptr = - _lookup>( - 'sqlite3_wal_autocheckpoint'); - late final _dart_sqlite3_wal_autocheckpoint _sqlite3_wal_autocheckpoint = - _sqlite3_wal_autocheckpoint_ptr - .asFunction<_dart_sqlite3_wal_autocheckpoint>(); + late final _sqlite3_wal_autocheckpoint_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_wal_autocheckpoint'); + late final _sqlite3_wal_autocheckpoint = _sqlite3_wal_autocheckpoint_ptr + .asFunction, int)>(); /// CAPI3REF: Checkpoint a database /// METHOD: sqlite3 @@ -8763,11 +9914,12 @@ class SQLite { ); } - late final _sqlite3_wal_checkpoint_ptr = - _lookup>( - 'sqlite3_wal_checkpoint'); - late final _dart_sqlite3_wal_checkpoint _sqlite3_wal_checkpoint = - _sqlite3_wal_checkpoint_ptr.asFunction<_dart_sqlite3_wal_checkpoint>(); + late final _sqlite3_wal_checkpoint_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_wal_checkpoint'); + late final _sqlite3_wal_checkpoint = _sqlite3_wal_checkpoint_ptr + .asFunction, ffi.Pointer)>(); /// CAPI3REF: Checkpoint a database /// METHOD: sqlite3 @@ -8875,12 +10027,18 @@ class SQLite { ); } - late final _sqlite3_wal_checkpoint_v2_ptr = - _lookup>( - 'sqlite3_wal_checkpoint_v2'); - late final _dart_sqlite3_wal_checkpoint_v2 _sqlite3_wal_checkpoint_v2 = - _sqlite3_wal_checkpoint_v2_ptr - .asFunction<_dart_sqlite3_wal_checkpoint_v2>(); + late final _sqlite3_wal_checkpoint_v2_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer)>>('sqlite3_wal_checkpoint_v2'); + late final _sqlite3_wal_checkpoint_v2 = + _sqlite3_wal_checkpoint_v2_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Virtual Table Interface Configuration /// @@ -8908,11 +10066,12 @@ class SQLite { ); } - late final _sqlite3_vtab_config_ptr = - _lookup>( - 'sqlite3_vtab_config'); - late final _dart_sqlite3_vtab_config _sqlite3_vtab_config = - _sqlite3_vtab_config_ptr.asFunction<_dart_sqlite3_vtab_config>(); + late final _sqlite3_vtab_config_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_vtab_config'); + late final _sqlite3_vtab_config = _sqlite3_vtab_config_ptr + .asFunction, int)>(); /// CAPI3REF: Determine The Virtual Table Conflict Policy /// @@ -8931,11 +10090,10 @@ class SQLite { } late final _sqlite3_vtab_on_conflict_ptr = - _lookup>( + _lookup)>>( 'sqlite3_vtab_on_conflict'); - late final _dart_sqlite3_vtab_on_conflict _sqlite3_vtab_on_conflict = - _sqlite3_vtab_on_conflict_ptr - .asFunction<_dart_sqlite3_vtab_on_conflict>(); + late final _sqlite3_vtab_on_conflict = _sqlite3_vtab_on_conflict_ptr + .asFunction)>(); /// CAPI3REF: Determine If Virtual Table Column Access Is For UPDATE /// @@ -8960,11 +10118,11 @@ class SQLite { ); } - late final _sqlite3_vtab_nochange_ptr = - _lookup>( - 'sqlite3_vtab_nochange'); - late final _dart_sqlite3_vtab_nochange _sqlite3_vtab_nochange = - _sqlite3_vtab_nochange_ptr.asFunction<_dart_sqlite3_vtab_nochange>(); + late final _sqlite3_vtab_nochange_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_vtab_nochange'); + late final _sqlite3_vtab_nochange = _sqlite3_vtab_nochange_ptr + .asFunction)>(); /// CAPI3REF: Determine The Collation For a Virtual Table Constraint /// @@ -8987,11 +10145,12 @@ class SQLite { ); } - late final _sqlite3_vtab_collation_ptr = - _lookup>( - 'sqlite3_vtab_collation'); - late final _dart_sqlite3_vtab_collation _sqlite3_vtab_collation = - _sqlite3_vtab_collation_ptr.asFunction<_dart_sqlite3_vtab_collation>(); + late final _sqlite3_vtab_collation_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_vtab_collation'); + late final _sqlite3_vtab_collation = _sqlite3_vtab_collation_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: Prepared Statement Scan Status /// METHOD: sqlite3_stmt @@ -9036,11 +10195,13 @@ class SQLite { ); } - late final _sqlite3_stmt_scanstatus_ptr = - _lookup>( - 'sqlite3_stmt_scanstatus'); - late final _dart_sqlite3_stmt_scanstatus _sqlite3_stmt_scanstatus = - _sqlite3_stmt_scanstatus_ptr.asFunction<_dart_sqlite3_stmt_scanstatus>(); + late final _sqlite3_stmt_scanstatus_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, ffi.Int32, + ffi.Pointer)>>('sqlite3_stmt_scanstatus'); + late final _sqlite3_stmt_scanstatus = _sqlite3_stmt_scanstatus_ptr.asFunction< + int Function( + ffi.Pointer, int, int, ffi.Pointer)>(); /// CAPI3REF: Zero Scan-Status Counters /// METHOD: sqlite3_stmt @@ -9058,11 +10219,10 @@ class SQLite { } late final _sqlite3_stmt_scanstatus_reset_ptr = - _lookup>( + _lookup)>>( 'sqlite3_stmt_scanstatus_reset'); - late final _dart_sqlite3_stmt_scanstatus_reset - _sqlite3_stmt_scanstatus_reset = _sqlite3_stmt_scanstatus_reset_ptr - .asFunction<_dart_sqlite3_stmt_scanstatus_reset>(); + late final _sqlite3_stmt_scanstatus_reset = _sqlite3_stmt_scanstatus_reset_ptr + .asFunction)>(); /// CAPI3REF: Flush caches to disk mid-transaction /// @@ -9101,10 +10261,10 @@ class SQLite { } late final _sqlite3_db_cacheflush_ptr = - _lookup>( + _lookup)>>( 'sqlite3_db_cacheflush'); - late final _dart_sqlite3_db_cacheflush _sqlite3_db_cacheflush = - _sqlite3_db_cacheflush_ptr.asFunction<_dart_sqlite3_db_cacheflush>(); + late final _sqlite3_db_cacheflush = _sqlite3_db_cacheflush_ptr + .asFunction)>(); /// CAPI3REF: Low-level system error code /// @@ -9123,10 +10283,10 @@ class SQLite { } late final _sqlite3_system_errno_ptr = - _lookup>( + _lookup)>>( 'sqlite3_system_errno'); - late final _dart_sqlite3_system_errno _sqlite3_system_errno = - _sqlite3_system_errno_ptr.asFunction<_dart_sqlite3_system_errno>(); + late final _sqlite3_system_errno = _sqlite3_system_errno_ptr + .asFunction)>(); /// CAPI3REF: Record A Database Snapshot /// CONSTRUCTOR: sqlite3_snapshot @@ -9181,11 +10341,14 @@ class SQLite { ); } - late final _sqlite3_snapshot_get_ptr = - _lookup>( - 'sqlite3_snapshot_get'); - late final _dart_sqlite3_snapshot_get _sqlite3_snapshot_get = - _sqlite3_snapshot_get_ptr.asFunction<_dart_sqlite3_snapshot_get>(); + late final _sqlite3_snapshot_get_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>>( + 'sqlite3_snapshot_get'); + late final _sqlite3_snapshot_get = _sqlite3_snapshot_get_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>(); /// CAPI3REF: Start a read transaction on an historical snapshot /// METHOD: sqlite3_snapshot @@ -9240,11 +10403,13 @@ class SQLite { ); } - late final _sqlite3_snapshot_open_ptr = - _lookup>( - 'sqlite3_snapshot_open'); - late final _dart_sqlite3_snapshot_open _sqlite3_snapshot_open = - _sqlite3_snapshot_open_ptr.asFunction<_dart_sqlite3_snapshot_open>(); + late final _sqlite3_snapshot_open_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('sqlite3_snapshot_open'); + late final _sqlite3_snapshot_open = _sqlite3_snapshot_open_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// CAPI3REF: Destroy a snapshot /// DESTRUCTOR: sqlite3_snapshot @@ -9263,11 +10428,11 @@ class SQLite { ); } - late final _sqlite3_snapshot_free_ptr = - _lookup>( - 'sqlite3_snapshot_free'); - late final _dart_sqlite3_snapshot_free _sqlite3_snapshot_free = - _sqlite3_snapshot_free_ptr.asFunction<_dart_sqlite3_snapshot_free>(); + late final _sqlite3_snapshot_free_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_snapshot_free'); + late final _sqlite3_snapshot_free = _sqlite3_snapshot_free_ptr + .asFunction)>(); /// CAPI3REF: Compare the ages of two snapshot handles. /// METHOD: sqlite3_snapshot @@ -9302,11 +10467,13 @@ class SQLite { ); } - late final _sqlite3_snapshot_cmp_ptr = - _lookup>( - 'sqlite3_snapshot_cmp'); - late final _dart_sqlite3_snapshot_cmp _sqlite3_snapshot_cmp = - _sqlite3_snapshot_cmp_ptr.asFunction<_dart_sqlite3_snapshot_cmp>(); + late final _sqlite3_snapshot_cmp_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_snapshot_cmp'); + late final _sqlite3_snapshot_cmp = _sqlite3_snapshot_cmp_ptr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Recover snapshots from a wal file /// METHOD: sqlite3_snapshot @@ -9339,12 +10506,12 @@ class SQLite { ); } - late final _sqlite3_snapshot_recover_ptr = - _lookup>( - 'sqlite3_snapshot_recover'); - late final _dart_sqlite3_snapshot_recover _sqlite3_snapshot_recover = - _sqlite3_snapshot_recover_ptr - .asFunction<_dart_sqlite3_snapshot_recover>(); + late final _sqlite3_snapshot_recover_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_snapshot_recover'); + late final _sqlite3_snapshot_recover = _sqlite3_snapshot_recover_ptr + .asFunction, ffi.Pointer)>(); /// CAPI3REF: Serialize a database /// @@ -9383,7 +10550,7 @@ class SQLite { ffi.Pointer sqlite3_serialize( ffi.Pointer db, ffi.Pointer zSchema, - ffi.Pointer piSize, + ffi.Pointer piSize, int mFlags, ) { return _sqlite3_serialize( @@ -9394,10 +10561,16 @@ class SQLite { ); } - late final _sqlite3_serialize_ptr = - _lookup>('sqlite3_serialize'); - late final _dart_sqlite3_serialize _sqlite3_serialize = - _sqlite3_serialize_ptr.asFunction<_dart_sqlite3_serialize>(); + late final _sqlite3_serialize_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Uint32)>>('sqlite3_serialize'); + late final _sqlite3_serialize = _sqlite3_serialize_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); /// CAPI3REF: Deserialize a database /// @@ -9444,11 +10617,18 @@ class SQLite { ); } - late final _sqlite3_deserialize_ptr = - _lookup>( - 'sqlite3_deserialize'); - late final _dart_sqlite3_deserialize _sqlite3_deserialize = - _sqlite3_deserialize_ptr.asFunction<_dart_sqlite3_deserialize>(); + late final _sqlite3_deserialize_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + sqlite3_int64, + sqlite3_int64, + ffi.Uint32)>>('sqlite3_deserialize'); + late final _sqlite3_deserialize = _sqlite3_deserialize_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, int)>(); /// Register a geometry callback named zGeom that can be used as part of an /// R-Tree geometry query as follows: @@ -9457,7 +10637,14 @@ class SQLite { int sqlite3_rtree_geometry_callback( ffi.Pointer db, ffi.Pointer zGeom, - ffi.Pointer> xGeom, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer)>> + xGeom, ffi.Pointer pContext, ) { return _sqlite3_rtree_geometry_callback( @@ -9468,12 +10655,32 @@ class SQLite { ); } - late final _sqlite3_rtree_geometry_callback_ptr = - _lookup>( - 'sqlite3_rtree_geometry_callback'); - late final _dart_sqlite3_rtree_geometry_callback - _sqlite3_rtree_geometry_callback = _sqlite3_rtree_geometry_callback_ptr - .asFunction<_dart_sqlite3_rtree_geometry_callback>(); + late final _sqlite3_rtree_geometry_callback_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer)>>, + ffi.Pointer)>>('sqlite3_rtree_geometry_callback'); + late final _sqlite3_rtree_geometry_callback = + _sqlite3_rtree_geometry_callback_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer)>>, + ffi.Pointer)>(); /// Register a 2nd-generation geometry callback named zScore that can be /// used as part of an R-Tree geometry query as follows: @@ -9482,9 +10689,13 @@ class SQLite { int sqlite3_rtree_query_callback( ffi.Pointer db, ffi.Pointer zQueryFunc, - ffi.Pointer> xQueryFunc, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer)>> + xQueryFunc, ffi.Pointer pContext, - ffi.Pointer> xDestructor, + ffi.Pointer)>> + xDestructor, ) { return _sqlite3_rtree_query_callback( db, @@ -9495,63 +10706,136 @@ class SQLite { ); } - late final _sqlite3_rtree_query_callback_ptr = - _lookup>( - 'sqlite3_rtree_query_callback'); - late final _dart_sqlite3_rtree_query_callback _sqlite3_rtree_query_callback = - _sqlite3_rtree_query_callback_ptr - .asFunction<_dart_sqlite3_rtree_query_callback>(); + late final _sqlite3_rtree_query_callback_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer)>>, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( + 'sqlite3_rtree_query_callback'); + late final _sqlite3_rtree_query_callback = + _sqlite3_rtree_query_callback_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer)>>, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>(); } class sqlite3 extends ffi.Opaque {} +class sqlite3_file extends ffi.Struct { + /// Methods for an open file + external ffi.Pointer pMethods; +} + class sqlite3_io_methods extends ffi.Struct { @ffi.Int32() external int iVersion; - external ffi.Pointer> xClose; - - external ffi.Pointer> xRead; - - external ffi.Pointer> xWrite; - - external ffi.Pointer> xTruncate; - - external ffi.Pointer> xSync; - - external ffi.Pointer> xFileSize; - - external ffi.Pointer> xLock; - - external ffi.Pointer> xUnlock; - - external ffi.Pointer> xCheckReservedLock; - - external ffi.Pointer> xFileControl; - - external ffi.Pointer> xSectorSize; - - external ffi.Pointer> xDeviceCharacteristics; + external ffi.Pointer< + ffi.NativeFunction)>> xClose; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, sqlite3_int64)>> xRead; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, sqlite3_int64)>> xWrite; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, sqlite3_int64)>> + xTruncate; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xSync; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>> + xFileSize; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xLock; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xUnlock; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>> + xCheckReservedLock; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32, ffi.Pointer)>> + xFileControl; + + external ffi.Pointer< + ffi.NativeFunction)>> + xSectorSize; + + external ffi.Pointer< + ffi.NativeFunction)>> + xDeviceCharacteristics; /// Methods above are valid for version 1 - external ffi.Pointer> xShmMap; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, ffi.Int32, + ffi.Int32, ffi.Pointer>)>> xShmMap; - external ffi.Pointer> xShmLock; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32, ffi.Int32, ffi.Int32)>> + xShmLock; - external ffi.Pointer> xShmBarrier; + external ffi.Pointer< + ffi.NativeFunction)>> + xShmBarrier; - external ffi.Pointer> xShmUnmap; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xShmUnmap; /// Methods above are valid for version 2 - external ffi.Pointer> xFetch; - - external ffi.Pointer> xUnfetch; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, sqlite3_int64, + ffi.Int32, ffi.Pointer>)>> xFetch; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, sqlite3_int64, + ffi.Pointer)>> xUnfetch; } -class sqlite3_file extends ffi.Struct { - /// Methods for an open file - external ffi.Pointer pMethods; -} +typedef sqlite3_int64 = sqlite_int64; +typedef sqlite_int64 = ffi.Int64; class sqlite3_mutex extends ffi.Opaque {} @@ -9579,112 +10863,329 @@ class sqlite3_vfs extends ffi.Struct { /// Pointer to application-specific data external ffi.Pointer pAppData; - external ffi.Pointer> xOpen; - - external ffi.Pointer> xDelete; - - external ffi.Pointer> xAccess; - - external ffi.Pointer> xFullPathname; - - external ffi.Pointer> xDlOpen; - - external ffi.Pointer> xDlError; - - external ffi.Pointer> xDlSym; - - external ffi.Pointer> xDlClose; - - external ffi.Pointer> xRandomness; - - external ffi.Pointer> xSleep; - - external ffi.Pointer> xCurrentTime; - - external ffi.Pointer> xGetLastError; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>> xOpen; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer, ffi.Int32)>> + xDelete; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>> xAccess; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>> xFullPathname; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>> xDlOpen; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Int32, ffi.Pointer)>> + xDlError; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer> Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>> xDlSym; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>> xDlClose; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32, ffi.Pointer)>> + xRandomness; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xSleep; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>> xCurrentTime; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32, ffi.Pointer)>> + xGetLastError; /// The methods above are in version 1 of the sqlite_vfs object /// definition. Those that follow are added in version 2 or later - external ffi.Pointer> xCurrentTimeInt64; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>> + xCurrentTimeInt64; /// The methods above are in versions 1 and 2 of the sqlite_vfs object. /// Those below are for version 3 and greater. - external ffi.Pointer> xSetSystemCall; - - external ffi.Pointer> xGetSystemCall; - - external ffi.Pointer> xNextSystemCall; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + sqlite3_syscall_ptr)>> xSetSystemCall; + + external ffi.Pointer< + ffi.NativeFunction< + sqlite3_syscall_ptr Function( + ffi.Pointer, ffi.Pointer)>> xGetSystemCall; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>> + xNextSystemCall; } +typedef sqlite3_syscall_ptr + = ffi.Pointer>; + class sqlite3_mem_methods extends ffi.Struct { /// Memory allocation function - external ffi.Pointer> xMalloc; + external ffi.Pointer< + ffi.NativeFunction Function(ffi.Int32)>> xMalloc; /// Free a prior allocation - external ffi.Pointer> xFree; + external ffi + .Pointer)>> + xFree; /// Resize an allocation - external ffi.Pointer> xRealloc; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Int32)>> + xRealloc; /// Return the size of an allocation - external ffi.Pointer> xSize; + external ffi.Pointer< + ffi.NativeFunction)>> xSize; /// Round up request size to allocation size - external ffi.Pointer> xRoundup; + external ffi.Pointer> + xRoundup; /// Initialize the memory allocator - external ffi.Pointer> xInit; + external ffi.Pointer< + ffi.NativeFunction)>> xInit; /// Deinitialize the memory allocator - external ffi.Pointer> xShutdown; + external ffi + .Pointer)>> + xShutdown; /// Argument to xInit() and xShutdown() external ffi.Pointer pAppData; } +typedef sqlite3_uint64 = sqlite_uint64; +typedef sqlite_uint64 = ffi.Uint64; + class sqlite3_stmt extends ffi.Opaque {} class sqlite3_value extends ffi.Opaque {} class sqlite3_context extends ffi.Opaque {} -class sqlite3_index_constraint extends ffi.Struct { - /// Column constrained. -1 for ROWID - @ffi.Int32() - external int iColumn; - - /// Constraint operator - @ffi.Uint8() - external int op; - - /// True if this constraint is usable - @ffi.Uint8() - external int usable; +/// CAPI3REF: Virtual Table Instance Object +/// KEYWORDS: sqlite3_vtab +/// +/// Every [virtual table module] implementation uses a subclass +/// of this object to describe a particular instance +/// of the [virtual table]. Each subclass will +/// be tailored to the specific needs of the module implementation. +/// The purpose of this superclass is to define certain fields that are +/// common to all module implementations. +/// +/// ^Virtual tables methods can set an error message by assigning a +/// string obtained from [sqlite3_mprintf()] to zErrMsg. The method should +/// take care that any prior string is freed by a call to [sqlite3_free()] +/// prior to assigning a new string to zErrMsg. ^After the error message +/// is delivered up to the client application, the string will be automatically +/// freed by sqlite3_free() and the zErrMsg field will be zeroed. +class sqlite3_vtab extends ffi.Struct { + /// The module for this virtual table + external ffi.Pointer pModule; - /// Used internally - xBestIndex should ignore + /// Number of open cursors @ffi.Int32() - external int iTermOffset; + external int nRef; + + /// Error message from sqlite3_mprintf() + external ffi.Pointer zErrMsg; } -class sqlite3_index_orderby extends ffi.Struct { - /// Column number +/// CAPI3REF: Virtual Table Object +/// KEYWORDS: sqlite3_module {virtual table module} +/// +/// This structure, sometimes called a "virtual table module", +/// defines the implementation of a [virtual table]. +/// This structure consists mostly of methods for the module. +/// +/// ^A virtual table module is created by filling in a persistent +/// instance of this structure and passing a pointer to that instance +/// to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. +/// ^The registration remains valid until it is replaced by a different +/// module or until the [database connection] closes. The content +/// of this structure must not change while it is registered with +/// any database connection. +class sqlite3_module extends ffi.Struct { @ffi.Int32() - external int iColumn; + external int iVersion; - /// True for DESC. False for ASC. - @ffi.Uint8() - external int desc; -} + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer>)>> xCreate; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer>)>> xConnect; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>> + xBestIndex; + + external ffi.Pointer< + ffi.NativeFunction)>> + xDisconnect; + + external ffi.Pointer< + ffi.NativeFunction)>> + xDestroy; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer>)>> xOpen; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer)>> xClose; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>> xFilter; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer)>> xNext; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer)>> xEof; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>> xColumn; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>> xRowid; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer)>> xUpdate; + + external ffi.Pointer< + ffi.NativeFunction)>> xBegin; + + external ffi.Pointer< + ffi.NativeFunction)>> xSync; + + external ffi.Pointer< + ffi.NativeFunction)>> + xCommit; + + external ffi.Pointer< + ffi.NativeFunction)>> + xRollback; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>>, + ffi.Pointer>)>> xFindFunction; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>> xRename; -/// Outputs -class sqlite3_index_constraint_usage extends ffi.Struct { - /// if >0, constraint is part of argv to xFilter - @ffi.Int32() - external int argvIndex; + /// The methods above are in version 1 of the sqlite_module object. Those + /// below are for version 2 and greater. + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xSavepoint; - /// Do not code a test for this constraint - @ffi.Uint8() - external int omit; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xRelease; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> + xRollbackTo; + + /// The methods above are in versions 1 and 2 of the sqlite_module object. + /// Those below are for version 3 and greater. + external ffi.Pointer< + ffi.NativeFunction)>> + xShadowName; } /// CAPI3REF: Virtual Table Indexing Information @@ -9824,7 +11325,7 @@ class sqlite3_index_info extends ffi.Struct { external double estimatedCost; /// Estimated number of rows returned - @ffi.Int64() + @sqlite3_int64() external int estimatedRows; /// Mask of SQLITE_INDEX_SCAN_* flags @@ -9832,10 +11333,49 @@ class sqlite3_index_info extends ffi.Struct { external int idxFlags; /// Input: Mask of columns used by statement - @ffi.Uint64() + @sqlite3_uint64() external int colUsed; } +class sqlite3_index_constraint extends ffi.Struct { + /// Column constrained. -1 for ROWID + @ffi.Int32() + external int iColumn; + + /// Constraint operator + @ffi.Uint8() + external int op; + + /// True if this constraint is usable + @ffi.Uint8() + external int usable; + + /// Used internally - xBestIndex should ignore + @ffi.Int32() + external int iTermOffset; +} + +class sqlite3_index_orderby extends ffi.Struct { + /// Column number + @ffi.Int32() + external int iColumn; + + /// True for DESC. False for ASC. + @ffi.Uint8() + external int desc; +} + +/// Outputs +class sqlite3_index_constraint_usage extends ffi.Struct { + /// if >0, constraint is part of argv to xFilter + @ffi.Int32() + external int argvIndex; + + /// Do not code a test for this constraint + @ffi.Uint8() + external int omit; +} + /// CAPI3REF: Virtual Table Cursor Object /// KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} /// @@ -9856,123 +11396,40 @@ class sqlite3_vtab_cursor extends ffi.Struct { external ffi.Pointer pVtab; } -/// CAPI3REF: Virtual Table Object -/// KEYWORDS: sqlite3_module {virtual table module} -/// -/// This structure, sometimes called a "virtual table module", -/// defines the implementation of a [virtual table]. -/// This structure consists mostly of methods for the module. -/// -/// ^A virtual table module is created by filling in a persistent -/// instance of this structure and passing a pointer to that instance -/// to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. -/// ^The registration remains valid until it is replaced by a different -/// module or until the [database connection] closes. The content -/// of this structure must not change while it is registered with -/// any database connection. -class sqlite3_module extends ffi.Struct { - @ffi.Int32() - external int iVersion; - - external ffi.Pointer> xCreate; - - external ffi.Pointer> xConnect; - - external ffi.Pointer> xBestIndex; - - external ffi.Pointer> xDisconnect; - - external ffi.Pointer> xDestroy; - - external ffi.Pointer> xOpen; - - external ffi.Pointer> xClose; - - external ffi.Pointer> xFilter; - - external ffi.Pointer> xNext; - - external ffi.Pointer> xEof; - - external ffi.Pointer> xColumn; - - external ffi.Pointer> xRowid; - - external ffi.Pointer> xUpdate; - - external ffi.Pointer> xBegin; - - external ffi.Pointer> xSync; - - external ffi.Pointer> xCommit; - - external ffi.Pointer> xRollback; - - external ffi.Pointer> xFindFunction; - - external ffi.Pointer> xRename; - - /// The methods above are in version 1 of the sqlite_module object. Those - /// below are for version 2 and greater. - external ffi.Pointer> xSavepoint; - - external ffi.Pointer> xRelease; - - external ffi.Pointer> xRollbackTo; - - /// The methods above are in versions 1 and 2 of the sqlite_module object. - /// Those below are for version 3 and greater. - external ffi.Pointer> xShadowName; -} - -/// CAPI3REF: Virtual Table Instance Object -/// KEYWORDS: sqlite3_vtab -/// -/// Every [virtual table module] implementation uses a subclass -/// of this object to describe a particular instance -/// of the [virtual table]. Each subclass will -/// be tailored to the specific needs of the module implementation. -/// The purpose of this superclass is to define certain fields that are -/// common to all module implementations. -/// -/// ^Virtual tables methods can set an error message by assigning a -/// string obtained from [sqlite3_mprintf()] to zErrMsg. The method should -/// take care that any prior string is freed by a call to [sqlite3_free()] -/// prior to assigning a new string to zErrMsg. ^After the error message -/// is delivered up to the client application, the string will be automatically -/// freed by sqlite3_free() and the zErrMsg field will be zeroed. -class sqlite3_vtab extends ffi.Struct { - /// The module for this virtual table - external ffi.Pointer pModule; - - /// Number of open cursors - @ffi.Int32() - external int nRef; - - /// Error message from sqlite3_mprintf() - external ffi.Pointer zErrMsg; -} - class sqlite3_blob extends ffi.Opaque {} class sqlite3_mutex_methods extends ffi.Struct { - external ffi.Pointer> xMutexInit; + external ffi.Pointer> xMutexInit; - external ffi.Pointer> xMutexEnd; + external ffi.Pointer> xMutexEnd; - external ffi.Pointer> xMutexAlloc; + external ffi.Pointer< + ffi.NativeFunction Function(ffi.Int32)>> + xMutexAlloc; - external ffi.Pointer> xMutexFree; + external ffi.Pointer< + ffi.NativeFunction)>> + xMutexFree; - external ffi.Pointer> xMutexEnter; + external ffi.Pointer< + ffi.NativeFunction)>> + xMutexEnter; - external ffi.Pointer> xMutexTry; + external ffi.Pointer< + ffi.NativeFunction)>> + xMutexTry; - external ffi.Pointer> xMutexLeave; + external ffi.Pointer< + ffi.NativeFunction)>> + xMutexLeave; - external ffi.Pointer> xMutexHeld; + external ffi.Pointer< + ffi.NativeFunction)>> + xMutexHeld; - external ffi.Pointer> xMutexNotheld; + external ffi.Pointer< + ffi.NativeFunction)>> + xMutexNotheld; } class sqlite3_str extends ffi.Opaque {} @@ -9993,51 +11450,105 @@ class sqlite3_pcache_methods2 extends ffi.Struct { external ffi.Pointer pArg; - external ffi.Pointer> xInit; - - external ffi.Pointer> xShutdown; - - external ffi.Pointer> xCreate; - - external ffi.Pointer> xCachesize; - - external ffi.Pointer> xPagecount; - - external ffi.Pointer> xFetch; - - external ffi.Pointer> xUnpin; - - external ffi.Pointer> xRekey; - - external ffi.Pointer> xTruncate; - - external ffi.Pointer> xDestroy; - - external ffi.Pointer> xShrink; + external ffi.Pointer< + ffi.NativeFunction)>> xInit; + + external ffi + .Pointer)>> + xShutdown; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Int32, ffi.Int32, ffi.Int32)>> xCreate; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32)>> + xCachesize; + + external ffi.Pointer< + ffi.NativeFunction)>> + xPagecount; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Uint32, ffi.Int32)>> xFetch; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>> xUnpin; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32)>> xRekey; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Uint32)>> + xTruncate; + + external ffi.Pointer< + ffi.NativeFunction)>> + xDestroy; + + external ffi.Pointer< + ffi.NativeFunction)>> + xShrink; } class sqlite3_pcache_methods extends ffi.Struct { external ffi.Pointer pArg; - external ffi.Pointer> xInit; - - external ffi.Pointer> xShutdown; - - external ffi.Pointer> xCreate; - - external ffi.Pointer> xCachesize; - - external ffi.Pointer> xPagecount; - - external ffi.Pointer> xFetch; - - external ffi.Pointer> xUnpin; - - external ffi.Pointer> xRekey; - - external ffi.Pointer> xTruncate; - - external ffi.Pointer> xDestroy; + external ffi.Pointer< + ffi.NativeFunction)>> xInit; + + external ffi + .Pointer)>> + xShutdown; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Int32, ffi.Int32)>> xCreate; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32)>> + xCachesize; + + external ffi.Pointer< + ffi.NativeFunction)>> + xPagecount; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Uint32, ffi.Int32)>> xFetch; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>> xUnpin; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Uint32, ffi.Uint32)>> xRekey; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Uint32)>> + xTruncate; + + external ffi.Pointer< + ffi.NativeFunction)>> + xDestroy; } class sqlite3_backup extends ffi.Opaque {} @@ -10076,15 +11587,19 @@ class sqlite3_rtree_geometry extends ffi.Struct { external int nParam; /// Parameters passed to SQL geom function - external ffi.Pointer aParam; + external ffi.Pointer aParam; /// Callback implementation user data external ffi.Pointer pUser; /// Called by SQLite to clean up pUser - external ffi.Pointer> xDelUser; + external ffi + .Pointer)>> + xDelUser; } +typedef sqlite3_rtree_dbl = ffi.Double; + /// A pointer to a structure of the following type is passed as the /// argument to scored geometry callback registered using /// sqlite3_rtree_query_callback(). @@ -10101,16 +11616,18 @@ class sqlite3_rtree_query_info extends ffi.Struct { external int nParam; /// value of function parameters - external ffi.Pointer aParam; + external ffi.Pointer aParam; /// callback can use this, if desired external ffi.Pointer pUser; /// function to free pUser - external ffi.Pointer> xDelUser; + external ffi + .Pointer)>> + xDelUser; /// Coordinates of node or entry to check - external ffi.Pointer aCoord; + external ffi.Pointer aCoord; /// Number of pending entries in the queue external ffi.Pointer anQueue; @@ -10128,11 +11645,11 @@ class sqlite3_rtree_query_info extends ffi.Struct { external int mxLevel; /// Rowid for current entry - @ffi.Int64() + @sqlite3_int64() external int iRowid; /// Score of parent node - @ffi.Double() + @sqlite3_rtree_dbl() external double rParentScore; /// Visibility of parent node @@ -10144,21 +11661,13 @@ class sqlite3_rtree_query_info extends ffi.Struct { external int eWithin; /// OUT: Write the score here - @ffi.Double() + @sqlite3_rtree_dbl() external double rScore; /// Original SQL values of parameters external ffi.Pointer> apSqlParam; } -class Fts5Context extends ffi.Opaque {} - -class Fts5PhraseIter extends ffi.Struct { - external ffi.Pointer a; - - external ffi.Pointer b; -} - /// EXTENSION API FUNCTIONS /// /// xUserData(pFts): @@ -10373,53 +11882,181 @@ class Fts5ExtensionApi extends ffi.Struct { @ffi.Int32() external int iVersion; - external ffi.Pointer> xUserData; - - external ffi.Pointer> xColumnCount; - - external ffi.Pointer> xRowCount; - - external ffi.Pointer> xColumnTotalSize; - - external ffi.Pointer> xTokenize; - - external ffi.Pointer> xPhraseCount; - - external ffi.Pointer> xPhraseSize; - - external ffi.Pointer> xInstCount; - - external ffi.Pointer> xInst; - - external ffi.Pointer> xRowid; - - external ffi.Pointer> xColumnText; - - external ffi.Pointer> xColumnSize; - - external ffi.Pointer> xQueryPhrase; - - external ffi.Pointer> xSetAuxdata; - - external ffi.Pointer> xGetAuxdata; - - external ffi.Pointer> xPhraseFirst; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>> xUserData; + + external ffi.Pointer< + ffi.NativeFunction)>> + xColumnCount; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>> xRowCount; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + ffi.Pointer)>> xColumnTotalSize; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Int32)>>)>> xTokenize; + + external ffi.Pointer< + ffi.NativeFunction)>> + xPhraseCount; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xPhraseSize; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>> xInstCount; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>> xInst; + + external ffi.Pointer< + ffi.NativeFunction)>> + xRowid; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer)>> xColumnText; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32, ffi.Pointer)>> + xColumnSize; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>)>> xQueryPhrase; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>> xSetAuxdata; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>> xGetAuxdata; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>> xPhraseFirst; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>> xPhraseNext; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer)>> xPhraseFirstColumn; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>> xPhraseNextColumn; +} - external ffi.Pointer> xPhraseNext; +class Fts5Context extends ffi.Opaque {} - external ffi.Pointer> xPhraseFirstColumn; +class Fts5PhraseIter extends ffi.Struct { + external ffi.Pointer a; - external ffi.Pointer> xPhraseNextColumn; + external ffi.Pointer b; } class Fts5Tokenizer extends ffi.Opaque {} class fts5_tokenizer extends ffi.Struct { - external ffi.Pointer> xCreate; - - external ffi.Pointer> xDelete; - - external ffi.Pointer> xTokenize; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer>, + ffi.Int32, + ffi.Pointer>)>> xCreate; + + external ffi.Pointer< + ffi.NativeFunction)>> + xDelete; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Int32)>>)>> xTokenize; } class fts5_api extends ffi.Struct { @@ -10428,15 +12065,50 @@ class fts5_api extends ffi.Struct { external int iVersion; /// Create a new tokenizer - external ffi.Pointer> xCreateTokenizer; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>> + xCreateTokenizer; /// Find an existing tokenizer - external ffi.Pointer> xFindTokenizer; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer)>> xFindTokenizer; /// Create a new auxiliary function - external ffi.Pointer> xCreateFunction; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + fts5_extension_function, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>> + xCreateFunction; } +typedef fts5_extension_function = ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>; + const String SQLITE_VERSION = '3.32.3'; const int SQLITE_VERSION_NUMBER = 3032003; @@ -11317,3801 +12989,3 @@ const int FTS5_TOKENIZE_DOCUMENT = 4; const int FTS5_TOKENIZE_AUX = 8; const int FTS5_TOKEN_COLOCATED = 1; - -typedef _c_sqlite3_libversion = ffi.Pointer Function(); - -typedef _dart_sqlite3_libversion = ffi.Pointer Function(); - -typedef _c_sqlite3_sourceid = ffi.Pointer Function(); - -typedef _dart_sqlite3_sourceid = ffi.Pointer Function(); - -typedef _c_sqlite3_libversion_number = ffi.Int32 Function(); - -typedef _dart_sqlite3_libversion_number = int Function(); - -typedef _c_sqlite3_compileoption_used = ffi.Int32 Function( - ffi.Pointer zOptName, -); - -typedef _dart_sqlite3_compileoption_used = int Function( - ffi.Pointer zOptName, -); - -typedef _c_sqlite3_compileoption_get = ffi.Pointer Function( - ffi.Int32 N, -); - -typedef _dart_sqlite3_compileoption_get = ffi.Pointer Function( - int N, -); - -typedef _c_sqlite3_threadsafe = ffi.Int32 Function(); - -typedef _dart_sqlite3_threadsafe = int Function(); - -typedef _c_sqlite3_close = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_close = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_close_v2 = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_close_v2 = int Function( - ffi.Pointer arg0, -); - -typedef _typedefC_1 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, - ffi.Pointer>, -); - -typedef _c_sqlite3_exec = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer sql, - ffi.Pointer> callback, - ffi.Pointer arg3, - ffi.Pointer> errmsg, -); - -typedef _dart_sqlite3_exec = int Function( - ffi.Pointer arg0, - ffi.Pointer sql, - ffi.Pointer> callback, - ffi.Pointer arg3, - ffi.Pointer> errmsg, -); - -typedef _c_sqlite3_initialize = ffi.Int32 Function(); - -typedef _dart_sqlite3_initialize = int Function(); - -typedef _c_sqlite3_shutdown = ffi.Int32 Function(); - -typedef _dart_sqlite3_shutdown = int Function(); - -typedef _c_sqlite3_os_init = ffi.Int32 Function(); - -typedef _dart_sqlite3_os_init = int Function(); - -typedef _c_sqlite3_os_end = ffi.Int32 Function(); - -typedef _dart_sqlite3_os_end = int Function(); - -typedef _c_sqlite3_config = ffi.Int32 Function( - ffi.Int32 arg0, -); - -typedef _dart_sqlite3_config = int Function( - int arg0, -); - -typedef _c_sqlite3_db_config = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 op, -); - -typedef _dart_sqlite3_db_config = int Function( - ffi.Pointer arg0, - int op, -); - -typedef _c_sqlite3_extended_result_codes = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 onoff, -); - -typedef _dart_sqlite3_extended_result_codes = int Function( - ffi.Pointer arg0, - int onoff, -); - -typedef _c_sqlite3_last_insert_rowid = ffi.Int64 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_last_insert_rowid = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_set_last_insert_rowid = ffi.Void Function( - ffi.Pointer arg0, - ffi.Int64 arg1, -); - -typedef _dart_sqlite3_set_last_insert_rowid = void Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_changes = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_changes = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_total_changes = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_total_changes = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_interrupt = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_interrupt = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_complete = ffi.Int32 Function( - ffi.Pointer sql, -); - -typedef _dart_sqlite3_complete = int Function( - ffi.Pointer sql, -); - -typedef _c_sqlite3_complete16 = ffi.Int32 Function( - ffi.Pointer sql, -); - -typedef _dart_sqlite3_complete16 = int Function( - ffi.Pointer sql, -); - -typedef _typedefC_44 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _c_sqlite3_busy_handler = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _dart_sqlite3_busy_handler = int Function( - ffi.Pointer arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _c_sqlite3_busy_timeout = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 ms, -); - -typedef _dart_sqlite3_busy_timeout = int Function( - ffi.Pointer arg0, - int ms, -); - -typedef _c_sqlite3_get_table = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zSql, - ffi.Pointer>> pazResult, - ffi.Pointer pnRow, - ffi.Pointer pnColumn, - ffi.Pointer> pzErrmsg, -); - -typedef _dart_sqlite3_get_table = int Function( - ffi.Pointer db, - ffi.Pointer zSql, - ffi.Pointer>> pazResult, - ffi.Pointer pnRow, - ffi.Pointer pnColumn, - ffi.Pointer> pzErrmsg, -); - -typedef _c_sqlite3_free_table = ffi.Void Function( - ffi.Pointer> result, -); - -typedef _dart_sqlite3_free_table = void Function( - ffi.Pointer> result, -); - -typedef _c_sqlite3_mprintf = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_mprintf = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_snprintf = ffi.Pointer Function( - ffi.Int32 arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -); - -typedef _dart_sqlite3_snprintf = ffi.Pointer Function( - int arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -); - -typedef _c_sqlite3_malloc = ffi.Pointer Function( - ffi.Int32 arg0, -); - -typedef _dart_sqlite3_malloc = ffi.Pointer Function( - int arg0, -); - -typedef _c_sqlite3_malloc64 = ffi.Pointer Function( - ffi.Uint64 arg0, -); - -typedef _dart_sqlite3_malloc64 = ffi.Pointer Function( - int arg0, -); - -typedef _c_sqlite3_realloc = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_realloc = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_realloc64 = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Uint64 arg1, -); - -typedef _dart_sqlite3_realloc64 = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_free = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_free = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_msize = ffi.Uint64 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_msize = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_memory_used = ffi.Int64 Function(); - -typedef _dart_sqlite3_memory_used = int Function(); - -typedef _c_sqlite3_memory_highwater = ffi.Int64 Function( - ffi.Int32 resetFlag, -); - -typedef _dart_sqlite3_memory_highwater = int Function( - int resetFlag, -); - -typedef _c_sqlite3_randomness = ffi.Void Function( - ffi.Int32 N, - ffi.Pointer P, -); - -typedef _dart_sqlite3_randomness = void Function( - int N, - ffi.Pointer P, -); - -typedef _typedefC_45 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _c_sqlite3_set_authorizer = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer> xAuth, - ffi.Pointer pUserData, -); - -typedef _dart_sqlite3_set_authorizer = int Function( - ffi.Pointer arg0, - ffi.Pointer> xAuth, - ffi.Pointer pUserData, -); - -typedef _typedefC_46 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _c_sqlite3_trace = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> xTrace, - ffi.Pointer arg2, -); - -typedef _dart_sqlite3_trace = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> xTrace, - ffi.Pointer arg2, -); - -typedef _typedefC_47 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Uint64, -); - -typedef _c_sqlite3_profile = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> xProfile, - ffi.Pointer arg2, -); - -typedef _dart_sqlite3_profile = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> xProfile, - ffi.Pointer arg2, -); - -typedef _typedefC_48 = ffi.Int32 Function( - ffi.Uint32, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _c_sqlite3_trace_v2 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Uint32 uMask, - ffi.Pointer> xCallback, - ffi.Pointer pCtx, -); - -typedef _dart_sqlite3_trace_v2 = int Function( - ffi.Pointer arg0, - int uMask, - ffi.Pointer> xCallback, - ffi.Pointer pCtx, -); - -typedef _typedefC_49 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _c_sqlite3_progress_handler = ffi.Void Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Pointer> arg2, - ffi.Pointer arg3, -); - -typedef _dart_sqlite3_progress_handler = void Function( - ffi.Pointer arg0, - int arg1, - ffi.Pointer> arg2, - ffi.Pointer arg3, -); - -typedef _c_sqlite3_open = ffi.Int32 Function( - ffi.Pointer filename, - ffi.Pointer> ppDb, -); - -typedef _dart_sqlite3_open = int Function( - ffi.Pointer filename, - ffi.Pointer> ppDb, -); - -typedef _c_sqlite3_open16 = ffi.Int32 Function( - ffi.Pointer filename, - ffi.Pointer> ppDb, -); - -typedef _dart_sqlite3_open16 = int Function( - ffi.Pointer filename, - ffi.Pointer> ppDb, -); - -typedef _c_sqlite3_open_v2 = ffi.Int32 Function( - ffi.Pointer filename, - ffi.Pointer> ppDb, - ffi.Int32 flags, - ffi.Pointer zVfs, -); - -typedef _dart_sqlite3_open_v2 = int Function( - ffi.Pointer filename, - ffi.Pointer> ppDb, - int flags, - ffi.Pointer zVfs, -); - -typedef _c_sqlite3_uri_parameter = ffi.Pointer Function( - ffi.Pointer zFilename, - ffi.Pointer zParam, -); - -typedef _dart_sqlite3_uri_parameter = ffi.Pointer Function( - ffi.Pointer zFilename, - ffi.Pointer zParam, -); - -typedef _c_sqlite3_uri_boolean = ffi.Int32 Function( - ffi.Pointer zFile, - ffi.Pointer zParam, - ffi.Int32 bDefault, -); - -typedef _dart_sqlite3_uri_boolean = int Function( - ffi.Pointer zFile, - ffi.Pointer zParam, - int bDefault, -); - -typedef _c_sqlite3_uri_int64 = ffi.Int64 Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Int64 arg2, -); - -typedef _dart_sqlite3_uri_int64 = int Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, -); - -typedef _c_sqlite3_uri_key = ffi.Pointer Function( - ffi.Pointer zFilename, - ffi.Int32 N, -); - -typedef _dart_sqlite3_uri_key = ffi.Pointer Function( - ffi.Pointer zFilename, - int N, -); - -typedef _c_sqlite3_filename_database = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_filename_database = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_filename_journal = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_filename_journal = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_filename_wal = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_filename_wal = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_database_file_object = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_database_file_object = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_create_filename = ffi.Pointer Function( - ffi.Pointer zDatabase, - ffi.Pointer zJournal, - ffi.Pointer zWal, - ffi.Int32 nParam, - ffi.Pointer> azParam, -); - -typedef _dart_sqlite3_create_filename = ffi.Pointer Function( - ffi.Pointer zDatabase, - ffi.Pointer zJournal, - ffi.Pointer zWal, - int nParam, - ffi.Pointer> azParam, -); - -typedef _c_sqlite3_free_filename = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_free_filename = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_errcode = ffi.Int32 Function( - ffi.Pointer db, -); - -typedef _dart_sqlite3_errcode = int Function( - ffi.Pointer db, -); - -typedef _c_sqlite3_extended_errcode = ffi.Int32 Function( - ffi.Pointer db, -); - -typedef _dart_sqlite3_extended_errcode = int Function( - ffi.Pointer db, -); - -typedef _c_sqlite3_errmsg = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_errmsg = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_errmsg16 = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_errmsg16 = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_errstr = ffi.Pointer Function( - ffi.Int32 arg0, -); - -typedef _dart_sqlite3_errstr = ffi.Pointer Function( - int arg0, -); - -typedef _c_sqlite3_limit = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 id, - ffi.Int32 newVal, -); - -typedef _dart_sqlite3_limit = int Function( - ffi.Pointer arg0, - int id, - int newVal, -); - -typedef _c_sqlite3_prepare = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zSql, - ffi.Int32 nByte, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _dart_sqlite3_prepare = int Function( - ffi.Pointer db, - ffi.Pointer zSql, - int nByte, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _c_sqlite3_prepare_v2 = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zSql, - ffi.Int32 nByte, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _dart_sqlite3_prepare_v2 = int Function( - ffi.Pointer db, - ffi.Pointer zSql, - int nByte, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _c_sqlite3_prepare_v3 = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zSql, - ffi.Int32 nByte, - ffi.Uint32 prepFlags, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _dart_sqlite3_prepare_v3 = int Function( - ffi.Pointer db, - ffi.Pointer zSql, - int nByte, - int prepFlags, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _c_sqlite3_prepare16 = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zSql, - ffi.Int32 nByte, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _dart_sqlite3_prepare16 = int Function( - ffi.Pointer db, - ffi.Pointer zSql, - int nByte, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _c_sqlite3_prepare16_v2 = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zSql, - ffi.Int32 nByte, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _dart_sqlite3_prepare16_v2 = int Function( - ffi.Pointer db, - ffi.Pointer zSql, - int nByte, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _c_sqlite3_prepare16_v3 = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zSql, - ffi.Int32 nByte, - ffi.Uint32 prepFlags, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _dart_sqlite3_prepare16_v3 = int Function( - ffi.Pointer db, - ffi.Pointer zSql, - int nByte, - int prepFlags, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _c_sqlite3_sql = ffi.Pointer Function( - ffi.Pointer pStmt, -); - -typedef _dart_sqlite3_sql = ffi.Pointer Function( - ffi.Pointer pStmt, -); - -typedef _c_sqlite3_expanded_sql = ffi.Pointer Function( - ffi.Pointer pStmt, -); - -typedef _dart_sqlite3_expanded_sql = ffi.Pointer Function( - ffi.Pointer pStmt, -); - -typedef _c_sqlite3_normalized_sql = ffi.Pointer Function( - ffi.Pointer pStmt, -); - -typedef _dart_sqlite3_normalized_sql = ffi.Pointer Function( - ffi.Pointer pStmt, -); - -typedef _c_sqlite3_stmt_readonly = ffi.Int32 Function( - ffi.Pointer pStmt, -); - -typedef _dart_sqlite3_stmt_readonly = int Function( - ffi.Pointer pStmt, -); - -typedef _c_sqlite3_stmt_isexplain = ffi.Int32 Function( - ffi.Pointer pStmt, -); - -typedef _dart_sqlite3_stmt_isexplain = int Function( - ffi.Pointer pStmt, -); - -typedef _c_sqlite3_stmt_busy = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_stmt_busy = int Function( - ffi.Pointer arg0, -); - -typedef _typedefC_50 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_bind_blob = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Pointer arg2, - ffi.Int32 n, - ffi.Pointer> arg4, -); - -typedef _dart_sqlite3_bind_blob = int Function( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - int n, - ffi.Pointer> arg4, -); - -typedef _typedefC_51 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_bind_blob64 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Pointer arg2, - ffi.Uint64 arg3, - ffi.Pointer> arg4, -); - -typedef _dart_sqlite3_bind_blob64 = int Function( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer> arg4, -); - -typedef _c_sqlite3_bind_double = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Double arg2, -); - -typedef _dart_sqlite3_bind_double = int Function( - ffi.Pointer arg0, - int arg1, - double arg2, -); - -typedef _c_sqlite3_bind_int = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Int32 arg2, -); - -typedef _dart_sqlite3_bind_int = int Function( - ffi.Pointer arg0, - int arg1, - int arg2, -); - -typedef _c_sqlite3_bind_int64 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Int64 arg2, -); - -typedef _dart_sqlite3_bind_int64 = int Function( - ffi.Pointer arg0, - int arg1, - int arg2, -); - -typedef _c_sqlite3_bind_null = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_bind_null = int Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _typedefC_52 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_bind_text = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Pointer arg2, - ffi.Int32 arg3, - ffi.Pointer> arg4, -); - -typedef _dart_sqlite3_bind_text = int Function( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer> arg4, -); - -typedef _typedefC_53 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_bind_text16 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Pointer arg2, - ffi.Int32 arg3, - ffi.Pointer> arg4, -); - -typedef _dart_sqlite3_bind_text16 = int Function( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer> arg4, -); - -typedef _typedefC_54 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_bind_text64 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Pointer arg2, - ffi.Uint64 arg3, - ffi.Pointer> arg4, - ffi.Uint8 encoding, -); - -typedef _dart_sqlite3_bind_text64 = int Function( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer> arg4, - int encoding, -); - -typedef _c_sqlite3_bind_value = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Pointer arg2, -); - -typedef _dart_sqlite3_bind_value = int Function( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, -); - -typedef _typedefC_55 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_bind_pointer = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer> arg4, -); - -typedef _dart_sqlite3_bind_pointer = int Function( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer> arg4, -); - -typedef _c_sqlite3_bind_zeroblob = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Int32 n, -); - -typedef _dart_sqlite3_bind_zeroblob = int Function( - ffi.Pointer arg0, - int arg1, - int n, -); - -typedef _c_sqlite3_bind_zeroblob64 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Uint64 arg2, -); - -typedef _dart_sqlite3_bind_zeroblob64 = int Function( - ffi.Pointer arg0, - int arg1, - int arg2, -); - -typedef _c_sqlite3_bind_parameter_count = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_bind_parameter_count = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_bind_parameter_name = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_bind_parameter_name = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_bind_parameter_index = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer zName, -); - -typedef _dart_sqlite3_bind_parameter_index = int Function( - ffi.Pointer arg0, - ffi.Pointer zName, -); - -typedef _c_sqlite3_clear_bindings = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_clear_bindings = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_column_count = ffi.Int32 Function( - ffi.Pointer pStmt, -); - -typedef _dart_sqlite3_column_count = int Function( - ffi.Pointer pStmt, -); - -typedef _c_sqlite3_column_name = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 N, -); - -typedef _dart_sqlite3_column_name = ffi.Pointer Function( - ffi.Pointer arg0, - int N, -); - -typedef _c_sqlite3_column_name16 = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 N, -); - -typedef _dart_sqlite3_column_name16 = ffi.Pointer Function( - ffi.Pointer arg0, - int N, -); - -typedef _c_sqlite3_column_database_name = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_column_database_name = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_column_database_name16 = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_column_database_name16 = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_column_table_name = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_column_table_name = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_column_table_name16 = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_column_table_name16 = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_column_origin_name = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_column_origin_name = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_column_origin_name16 = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_column_origin_name16 = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_column_decltype = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_column_decltype = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_column_decltype16 = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_column_decltype16 = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_step = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_step = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_data_count = ffi.Int32 Function( - ffi.Pointer pStmt, -); - -typedef _dart_sqlite3_data_count = int Function( - ffi.Pointer pStmt, -); - -typedef _c_sqlite3_column_blob = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 iCol, -); - -typedef _dart_sqlite3_column_blob = ffi.Pointer Function( - ffi.Pointer arg0, - int iCol, -); - -typedef _c_sqlite3_column_double = ffi.Double Function( - ffi.Pointer arg0, - ffi.Int32 iCol, -); - -typedef _dart_sqlite3_column_double = double Function( - ffi.Pointer arg0, - int iCol, -); - -typedef _c_sqlite3_column_int = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 iCol, -); - -typedef _dart_sqlite3_column_int = int Function( - ffi.Pointer arg0, - int iCol, -); - -typedef _c_sqlite3_column_int64 = ffi.Int64 Function( - ffi.Pointer arg0, - ffi.Int32 iCol, -); - -typedef _dart_sqlite3_column_int64 = int Function( - ffi.Pointer arg0, - int iCol, -); - -typedef _c_sqlite3_column_text = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 iCol, -); - -typedef _dart_sqlite3_column_text = ffi.Pointer Function( - ffi.Pointer arg0, - int iCol, -); - -typedef _c_sqlite3_column_text16 = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 iCol, -); - -typedef _dart_sqlite3_column_text16 = ffi.Pointer Function( - ffi.Pointer arg0, - int iCol, -); - -typedef _c_sqlite3_column_value = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 iCol, -); - -typedef _dart_sqlite3_column_value = ffi.Pointer Function( - ffi.Pointer arg0, - int iCol, -); - -typedef _c_sqlite3_column_bytes = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 iCol, -); - -typedef _dart_sqlite3_column_bytes = int Function( - ffi.Pointer arg0, - int iCol, -); - -typedef _c_sqlite3_column_bytes16 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 iCol, -); - -typedef _dart_sqlite3_column_bytes16 = int Function( - ffi.Pointer arg0, - int iCol, -); - -typedef _c_sqlite3_column_type = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 iCol, -); - -typedef _dart_sqlite3_column_type = int Function( - ffi.Pointer arg0, - int iCol, -); - -typedef _c_sqlite3_finalize = ffi.Int32 Function( - ffi.Pointer pStmt, -); - -typedef _dart_sqlite3_finalize = int Function( - ffi.Pointer pStmt, -); - -typedef _c_sqlite3_reset = ffi.Int32 Function( - ffi.Pointer pStmt, -); - -typedef _dart_sqlite3_reset = int Function( - ffi.Pointer pStmt, -); - -typedef _typedefC_56 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_57 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_58 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_create_function = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zFunctionName, - ffi.Int32 nArg, - ffi.Int32 eTextRep, - ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, -); - -typedef _dart_sqlite3_create_function = int Function( - ffi.Pointer db, - ffi.Pointer zFunctionName, - int nArg, - int eTextRep, - ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, -); - -typedef _typedefC_59 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_60 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_61 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_create_function16 = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zFunctionName, - ffi.Int32 nArg, - ffi.Int32 eTextRep, - ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, -); - -typedef _dart_sqlite3_create_function16 = int Function( - ffi.Pointer db, - ffi.Pointer zFunctionName, - int nArg, - int eTextRep, - ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, -); - -typedef _typedefC_62 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_63 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_64 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_65 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_create_function_v2 = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zFunctionName, - ffi.Int32 nArg, - ffi.Int32 eTextRep, - ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xDestroy, -); - -typedef _dart_sqlite3_create_function_v2 = int Function( - ffi.Pointer db, - ffi.Pointer zFunctionName, - int nArg, - int eTextRep, - ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xDestroy, -); - -typedef _typedefC_66 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_67 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_68 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_69 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_70 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_create_window_function = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zFunctionName, - ffi.Int32 nArg, - ffi.Int32 eTextRep, - ffi.Pointer pApp, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xValue, - ffi.Pointer> xInverse, - ffi.Pointer> xDestroy, -); - -typedef _dart_sqlite3_create_window_function = int Function( - ffi.Pointer db, - ffi.Pointer zFunctionName, - int nArg, - int eTextRep, - ffi.Pointer pApp, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xValue, - ffi.Pointer> xInverse, - ffi.Pointer> xDestroy, -); - -typedef _c_sqlite3_aggregate_count = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_aggregate_count = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_expired = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_expired = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_transfer_bindings = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _dart_sqlite3_transfer_bindings = int Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _c_sqlite3_global_recover = ffi.Int32 Function(); - -typedef _dart_sqlite3_global_recover = int Function(); - -typedef _c_sqlite3_thread_cleanup = ffi.Void Function(); - -typedef _dart_sqlite3_thread_cleanup = void Function(); - -typedef _typedefC_71 = ffi.Void Function( - ffi.Pointer, - ffi.Int64, - ffi.Int32, -); - -typedef _c_sqlite3_memory_alarm = ffi.Int32 Function( - ffi.Pointer> arg0, - ffi.Pointer arg1, - ffi.Int64 arg2, -); - -typedef _dart_sqlite3_memory_alarm = int Function( - ffi.Pointer> arg0, - ffi.Pointer arg1, - int arg2, -); - -typedef _c_sqlite3_value_blob = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_blob = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_double = ffi.Double Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_double = double Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_int = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_int = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_int64 = ffi.Int64 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_int64 = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_pointer = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _dart_sqlite3_value_pointer = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _c_sqlite3_value_text = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_text = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_text16 = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_text16 = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_text16le = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_text16le = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_text16be = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_text16be = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_bytes = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_bytes = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_bytes16 = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_bytes16 = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_type = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_type = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_numeric_type = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_numeric_type = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_nochange = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_nochange = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_frombind = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_frombind = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_subtype = ffi.Uint32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_subtype = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_dup = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_dup = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_free = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_free = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_aggregate_context = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 nBytes, -); - -typedef _dart_sqlite3_aggregate_context = ffi.Pointer Function( - ffi.Pointer arg0, - int nBytes, -); - -typedef _c_sqlite3_user_data = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_user_data = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_context_db_handle = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_context_db_handle = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_get_auxdata = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 N, -); - -typedef _dart_sqlite3_get_auxdata = ffi.Pointer Function( - ffi.Pointer arg0, - int N, -); - -typedef _typedefC_72 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_set_auxdata = ffi.Void Function( - ffi.Pointer arg0, - ffi.Int32 N, - ffi.Pointer arg2, - ffi.Pointer> arg3, -); - -typedef _dart_sqlite3_set_auxdata = void Function( - ffi.Pointer arg0, - int N, - ffi.Pointer arg2, - ffi.Pointer> arg3, -); - -typedef _typedefC_73 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_result_blob = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Int32 arg2, - ffi.Pointer> arg3, -); - -typedef _dart_sqlite3_result_blob = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ffi.Pointer> arg3, -); - -typedef _typedefC_74 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_result_blob64 = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Uint64 arg2, - ffi.Pointer> arg3, -); - -typedef _dart_sqlite3_result_blob64 = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ffi.Pointer> arg3, -); - -typedef _c_sqlite3_result_double = ffi.Void Function( - ffi.Pointer arg0, - ffi.Double arg1, -); - -typedef _dart_sqlite3_result_double = void Function( - ffi.Pointer arg0, - double arg1, -); - -typedef _c_sqlite3_result_error = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Int32 arg2, -); - -typedef _dart_sqlite3_result_error = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, -); - -typedef _c_sqlite3_result_error16 = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Int32 arg2, -); - -typedef _dart_sqlite3_result_error16 = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, -); - -typedef _c_sqlite3_result_error_toobig = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_result_error_toobig = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_result_error_nomem = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_result_error_nomem = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_result_error_code = ffi.Void Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_result_error_code = void Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_result_int = ffi.Void Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_result_int = void Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_result_int64 = ffi.Void Function( - ffi.Pointer arg0, - ffi.Int64 arg1, -); - -typedef _dart_sqlite3_result_int64 = void Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_result_null = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_result_null = void Function( - ffi.Pointer arg0, -); - -typedef _typedefC_75 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_result_text = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Int32 arg2, - ffi.Pointer> arg3, -); - -typedef _dart_sqlite3_result_text = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ffi.Pointer> arg3, -); - -typedef _typedefC_76 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_result_text64 = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Uint64 arg2, - ffi.Pointer> arg3, - ffi.Uint8 encoding, -); - -typedef _dart_sqlite3_result_text64 = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ffi.Pointer> arg3, - int encoding, -); - -typedef _typedefC_77 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_result_text16 = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Int32 arg2, - ffi.Pointer> arg3, -); - -typedef _dart_sqlite3_result_text16 = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ffi.Pointer> arg3, -); - -typedef _typedefC_78 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_result_text16le = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Int32 arg2, - ffi.Pointer> arg3, -); - -typedef _dart_sqlite3_result_text16le = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ffi.Pointer> arg3, -); - -typedef _typedefC_79 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_result_text16be = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Int32 arg2, - ffi.Pointer> arg3, -); - -typedef _dart_sqlite3_result_text16be = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ffi.Pointer> arg3, -); - -typedef _c_sqlite3_result_value = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _dart_sqlite3_result_value = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _typedefC_80 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_result_pointer = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, -); - -typedef _dart_sqlite3_result_pointer = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, -); - -typedef _c_sqlite3_result_zeroblob = ffi.Void Function( - ffi.Pointer arg0, - ffi.Int32 n, -); - -typedef _dart_sqlite3_result_zeroblob = void Function( - ffi.Pointer arg0, - int n, -); - -typedef _c_sqlite3_result_zeroblob64 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Uint64 n, -); - -typedef _dart_sqlite3_result_zeroblob64 = int Function( - ffi.Pointer arg0, - int n, -); - -typedef _c_sqlite3_result_subtype = ffi.Void Function( - ffi.Pointer arg0, - ffi.Uint32 arg1, -); - -typedef _dart_sqlite3_result_subtype = void Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _typedefC_81 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _c_sqlite3_create_collation = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer zName, - ffi.Int32 eTextRep, - ffi.Pointer pArg, - ffi.Pointer> xCompare, -); - -typedef _dart_sqlite3_create_collation = int Function( - ffi.Pointer arg0, - ffi.Pointer zName, - int eTextRep, - ffi.Pointer pArg, - ffi.Pointer> xCompare, -); - -typedef _typedefC_82 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _typedefC_83 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_create_collation_v2 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer zName, - ffi.Int32 eTextRep, - ffi.Pointer pArg, - ffi.Pointer> xCompare, - ffi.Pointer> xDestroy, -); - -typedef _dart_sqlite3_create_collation_v2 = int Function( - ffi.Pointer arg0, - ffi.Pointer zName, - int eTextRep, - ffi.Pointer pArg, - ffi.Pointer> xCompare, - ffi.Pointer> xDestroy, -); - -typedef _typedefC_84 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _c_sqlite3_create_collation16 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer zName, - ffi.Int32 eTextRep, - ffi.Pointer pArg, - ffi.Pointer> xCompare, -); - -typedef _dart_sqlite3_create_collation16 = int Function( - ffi.Pointer arg0, - ffi.Pointer zName, - int eTextRep, - ffi.Pointer pArg, - ffi.Pointer> xCompare, -); - -typedef _typedefC_85 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _c_sqlite3_collation_needed = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer> arg2, -); - -typedef _dart_sqlite3_collation_needed = int Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer> arg2, -); - -typedef _typedefC_86 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _c_sqlite3_collation_needed16 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer> arg2, -); - -typedef _dart_sqlite3_collation_needed16 = int Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer> arg2, -); - -typedef _c_sqlite3_sleep = ffi.Int32 Function( - ffi.Int32 arg0, -); - -typedef _dart_sqlite3_sleep = int Function( - int arg0, -); - -typedef _c_sqlite3_win32_set_directory = ffi.Int32 Function( - ffi.Uint64 type, - ffi.Pointer zValue, -); - -typedef _dart_sqlite3_win32_set_directory = int Function( - int type, - ffi.Pointer zValue, -); - -typedef _c_sqlite3_win32_set_directory8 = ffi.Int32 Function( - ffi.Uint64 type, - ffi.Pointer zValue, -); - -typedef _dart_sqlite3_win32_set_directory8 = int Function( - int type, - ffi.Pointer zValue, -); - -typedef _c_sqlite3_win32_set_directory16 = ffi.Int32 Function( - ffi.Uint64 type, - ffi.Pointer zValue, -); - -typedef _dart_sqlite3_win32_set_directory16 = int Function( - int type, - ffi.Pointer zValue, -); - -typedef _c_sqlite3_get_autocommit = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_get_autocommit = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_db_handle = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_db_handle = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_db_filename = ffi.Pointer Function( - ffi.Pointer db, - ffi.Pointer zDbName, -); - -typedef _dart_sqlite3_db_filename = ffi.Pointer Function( - ffi.Pointer db, - ffi.Pointer zDbName, -); - -typedef _c_sqlite3_db_readonly = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zDbName, -); - -typedef _dart_sqlite3_db_readonly = int Function( - ffi.Pointer db, - ffi.Pointer zDbName, -); - -typedef _c_sqlite3_next_stmt = ffi.Pointer Function( - ffi.Pointer pDb, - ffi.Pointer pStmt, -); - -typedef _dart_sqlite3_next_stmt = ffi.Pointer Function( - ffi.Pointer pDb, - ffi.Pointer pStmt, -); - -typedef _typedefC_87 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _c_sqlite3_commit_hook = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _dart_sqlite3_commit_hook = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _typedefC_88 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_rollback_hook = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _dart_sqlite3_rollback_hook = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _typedefC_89 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, -); - -typedef _c_sqlite3_update_hook = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _dart_sqlite3_update_hook = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _c_sqlite3_enable_shared_cache = ffi.Int32 Function( - ffi.Int32 arg0, -); - -typedef _dart_sqlite3_enable_shared_cache = int Function( - int arg0, -); - -typedef _c_sqlite3_release_memory = ffi.Int32 Function( - ffi.Int32 arg0, -); - -typedef _dart_sqlite3_release_memory = int Function( - int arg0, -); - -typedef _c_sqlite3_db_release_memory = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_db_release_memory = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_soft_heap_limit64 = ffi.Int64 Function( - ffi.Int64 N, -); - -typedef _dart_sqlite3_soft_heap_limit64 = int Function( - int N, -); - -typedef _c_sqlite3_hard_heap_limit64 = ffi.Int64 Function( - ffi.Int64 N, -); - -typedef _dart_sqlite3_hard_heap_limit64 = int Function( - int N, -); - -typedef _c_sqlite3_soft_heap_limit = ffi.Void Function( - ffi.Int32 N, -); - -typedef _dart_sqlite3_soft_heap_limit = void Function( - int N, -); - -typedef _c_sqlite3_table_column_metadata = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zDbName, - ffi.Pointer zTableName, - ffi.Pointer zColumnName, - ffi.Pointer> pzDataType, - ffi.Pointer> pzCollSeq, - ffi.Pointer pNotNull, - ffi.Pointer pPrimaryKey, - ffi.Pointer pAutoinc, -); - -typedef _dart_sqlite3_table_column_metadata = int Function( - ffi.Pointer db, - ffi.Pointer zDbName, - ffi.Pointer zTableName, - ffi.Pointer zColumnName, - ffi.Pointer> pzDataType, - ffi.Pointer> pzCollSeq, - ffi.Pointer pNotNull, - ffi.Pointer pPrimaryKey, - ffi.Pointer pAutoinc, -); - -typedef _c_sqlite3_load_extension = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zFile, - ffi.Pointer zProc, - ffi.Pointer> pzErrMsg, -); - -typedef _dart_sqlite3_load_extension = int Function( - ffi.Pointer db, - ffi.Pointer zFile, - ffi.Pointer zProc, - ffi.Pointer> pzErrMsg, -); - -typedef _c_sqlite3_enable_load_extension = ffi.Int32 Function( - ffi.Pointer db, - ffi.Int32 onoff, -); - -typedef _dart_sqlite3_enable_load_extension = int Function( - ffi.Pointer db, - int onoff, -); - -typedef _typedefC_90 = ffi.Void Function(); - -typedef _c_sqlite3_auto_extension = ffi.Int32 Function( - ffi.Pointer> xEntryPoint, -); - -typedef _dart_sqlite3_auto_extension = int Function( - ffi.Pointer> xEntryPoint, -); - -typedef _typedefC_91 = ffi.Void Function(); - -typedef _c_sqlite3_cancel_auto_extension = ffi.Int32 Function( - ffi.Pointer> xEntryPoint, -); - -typedef _dart_sqlite3_cancel_auto_extension = int Function( - ffi.Pointer> xEntryPoint, -); - -typedef _c_sqlite3_reset_auto_extension = ffi.Void Function(); - -typedef _dart_sqlite3_reset_auto_extension = void Function(); - -typedef _c_sqlite3_create_module = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zName, - ffi.Pointer p, - ffi.Pointer pClientData, -); - -typedef _dart_sqlite3_create_module = int Function( - ffi.Pointer db, - ffi.Pointer zName, - ffi.Pointer p, - ffi.Pointer pClientData, -); - -typedef _typedefC_116 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_create_module_v2 = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zName, - ffi.Pointer p, - ffi.Pointer pClientData, - ffi.Pointer> xDestroy, -); - -typedef _dart_sqlite3_create_module_v2 = int Function( - ffi.Pointer db, - ffi.Pointer zName, - ffi.Pointer p, - ffi.Pointer pClientData, - ffi.Pointer> xDestroy, -); - -typedef _c_sqlite3_drop_modules = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer> azKeep, -); - -typedef _dart_sqlite3_drop_modules = int Function( - ffi.Pointer db, - ffi.Pointer> azKeep, -); - -typedef _c_sqlite3_declare_vtab = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer zSQL, -); - -typedef _dart_sqlite3_declare_vtab = int Function( - ffi.Pointer arg0, - ffi.Pointer zSQL, -); - -typedef _c_sqlite3_overload_function = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer zFuncName, - ffi.Int32 nArg, -); - -typedef _dart_sqlite3_overload_function = int Function( - ffi.Pointer arg0, - ffi.Pointer zFuncName, - int nArg, -); - -typedef _c_sqlite3_blob_open = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer zDb, - ffi.Pointer zTable, - ffi.Pointer zColumn, - ffi.Int64 iRow, - ffi.Int32 flags, - ffi.Pointer> ppBlob, -); - -typedef _dart_sqlite3_blob_open = int Function( - ffi.Pointer arg0, - ffi.Pointer zDb, - ffi.Pointer zTable, - ffi.Pointer zColumn, - int iRow, - int flags, - ffi.Pointer> ppBlob, -); - -typedef _c_sqlite3_blob_reopen = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int64 arg1, -); - -typedef _dart_sqlite3_blob_reopen = int Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_blob_close = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_blob_close = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_blob_bytes = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_blob_bytes = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_blob_read = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer Z, - ffi.Int32 N, - ffi.Int32 iOffset, -); - -typedef _dart_sqlite3_blob_read = int Function( - ffi.Pointer arg0, - ffi.Pointer Z, - int N, - int iOffset, -); - -typedef _c_sqlite3_blob_write = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer z, - ffi.Int32 n, - ffi.Int32 iOffset, -); - -typedef _dart_sqlite3_blob_write = int Function( - ffi.Pointer arg0, - ffi.Pointer z, - int n, - int iOffset, -); - -typedef _c_sqlite3_vfs_find = ffi.Pointer Function( - ffi.Pointer zVfsName, -); - -typedef _dart_sqlite3_vfs_find = ffi.Pointer Function( - ffi.Pointer zVfsName, -); - -typedef _c_sqlite3_vfs_register = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 makeDflt, -); - -typedef _dart_sqlite3_vfs_register = int Function( - ffi.Pointer arg0, - int makeDflt, -); - -typedef _c_sqlite3_vfs_unregister = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_vfs_unregister = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_mutex_alloc = ffi.Pointer Function( - ffi.Int32 arg0, -); - -typedef _dart_sqlite3_mutex_alloc = ffi.Pointer Function( - int arg0, -); - -typedef _c_sqlite3_mutex_free = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_mutex_free = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_mutex_enter = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_mutex_enter = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_mutex_try = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_mutex_try = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_mutex_leave = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_mutex_leave = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_mutex_held = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_mutex_held = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_mutex_notheld = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_mutex_notheld = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_db_mutex = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_db_mutex = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_file_control = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer zDbName, - ffi.Int32 op, - ffi.Pointer arg3, -); - -typedef _dart_sqlite3_file_control = int Function( - ffi.Pointer arg0, - ffi.Pointer zDbName, - int op, - ffi.Pointer arg3, -); - -typedef _c_sqlite3_test_control = ffi.Int32 Function( - ffi.Int32 op, -); - -typedef _dart_sqlite3_test_control = int Function( - int op, -); - -typedef _c_sqlite3_keyword_count = ffi.Int32 Function(); - -typedef _dart_sqlite3_keyword_count = int Function(); - -typedef _c_sqlite3_keyword_name = ffi.Int32 Function( - ffi.Int32 arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _dart_sqlite3_keyword_name = int Function( - int arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _c_sqlite3_keyword_check = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_keyword_check = int Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_str_new = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_str_new = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_str_finish = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_str_finish = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_str_appendf = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer zFormat, -); - -typedef _dart_sqlite3_str_appendf = void Function( - ffi.Pointer arg0, - ffi.Pointer zFormat, -); - -typedef _c_sqlite3_str_append = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer zIn, - ffi.Int32 N, -); - -typedef _dart_sqlite3_str_append = void Function( - ffi.Pointer arg0, - ffi.Pointer zIn, - int N, -); - -typedef _c_sqlite3_str_appendall = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer zIn, -); - -typedef _dart_sqlite3_str_appendall = void Function( - ffi.Pointer arg0, - ffi.Pointer zIn, -); - -typedef _c_sqlite3_str_appendchar = ffi.Void Function( - ffi.Pointer arg0, - ffi.Int32 N, - ffi.Int8 C, -); - -typedef _dart_sqlite3_str_appendchar = void Function( - ffi.Pointer arg0, - int N, - int C, -); - -typedef _c_sqlite3_str_reset = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_str_reset = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_str_errcode = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_str_errcode = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_str_length = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_str_length = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_str_value = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_str_value = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_status = ffi.Int32 Function( - ffi.Int32 op, - ffi.Pointer pCurrent, - ffi.Pointer pHighwater, - ffi.Int32 resetFlag, -); - -typedef _dart_sqlite3_status = int Function( - int op, - ffi.Pointer pCurrent, - ffi.Pointer pHighwater, - int resetFlag, -); - -typedef _c_sqlite3_status64 = ffi.Int32 Function( - ffi.Int32 op, - ffi.Pointer pCurrent, - ffi.Pointer pHighwater, - ffi.Int32 resetFlag, -); - -typedef _dart_sqlite3_status64 = int Function( - int op, - ffi.Pointer pCurrent, - ffi.Pointer pHighwater, - int resetFlag, -); - -typedef _c_sqlite3_db_status = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 op, - ffi.Pointer pCur, - ffi.Pointer pHiwtr, - ffi.Int32 resetFlg, -); - -typedef _dart_sqlite3_db_status = int Function( - ffi.Pointer arg0, - int op, - ffi.Pointer pCur, - ffi.Pointer pHiwtr, - int resetFlg, -); - -typedef _c_sqlite3_stmt_status = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 op, - ffi.Int32 resetFlg, -); - -typedef _dart_sqlite3_stmt_status = int Function( - ffi.Pointer arg0, - int op, - int resetFlg, -); - -typedef _c_sqlite3_backup_init = ffi.Pointer Function( - ffi.Pointer pDest, - ffi.Pointer zDestName, - ffi.Pointer pSource, - ffi.Pointer zSourceName, -); - -typedef _dart_sqlite3_backup_init = ffi.Pointer Function( - ffi.Pointer pDest, - ffi.Pointer zDestName, - ffi.Pointer pSource, - ffi.Pointer zSourceName, -); - -typedef _c_sqlite3_backup_step = ffi.Int32 Function( - ffi.Pointer p, - ffi.Int32 nPage, -); - -typedef _dart_sqlite3_backup_step = int Function( - ffi.Pointer p, - int nPage, -); - -typedef _c_sqlite3_backup_finish = ffi.Int32 Function( - ffi.Pointer p, -); - -typedef _dart_sqlite3_backup_finish = int Function( - ffi.Pointer p, -); - -typedef _c_sqlite3_backup_remaining = ffi.Int32 Function( - ffi.Pointer p, -); - -typedef _dart_sqlite3_backup_remaining = int Function( - ffi.Pointer p, -); - -typedef _c_sqlite3_backup_pagecount = ffi.Int32 Function( - ffi.Pointer p, -); - -typedef _dart_sqlite3_backup_pagecount = int Function( - ffi.Pointer p, -); - -typedef _typedefC_147 = ffi.Void Function( - ffi.Pointer>, - ffi.Int32, -); - -typedef _c_sqlite3_unlock_notify = ffi.Int32 Function( - ffi.Pointer pBlocked, - ffi.Pointer> xNotify, - ffi.Pointer pNotifyArg, -); - -typedef _dart_sqlite3_unlock_notify = int Function( - ffi.Pointer pBlocked, - ffi.Pointer> xNotify, - ffi.Pointer pNotifyArg, -); - -typedef _c_sqlite3_stricmp = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _dart_sqlite3_stricmp = int Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _c_sqlite3_strnicmp = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Int32 arg2, -); - -typedef _dart_sqlite3_strnicmp = int Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, -); - -typedef _c_sqlite3_strglob = ffi.Int32 Function( - ffi.Pointer zGlob, - ffi.Pointer zStr, -); - -typedef _dart_sqlite3_strglob = int Function( - ffi.Pointer zGlob, - ffi.Pointer zStr, -); - -typedef _c_sqlite3_strlike = ffi.Int32 Function( - ffi.Pointer zGlob, - ffi.Pointer zStr, - ffi.Uint32 cEsc, -); - -typedef _dart_sqlite3_strlike = int Function( - ffi.Pointer zGlob, - ffi.Pointer zStr, - int cEsc, -); - -typedef _c_sqlite3_log = ffi.Void Function( - ffi.Int32 iErrCode, - ffi.Pointer zFormat, -); - -typedef _dart_sqlite3_log = void Function( - int iErrCode, - ffi.Pointer zFormat, -); - -typedef _typedefC_148 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, -); - -typedef _c_sqlite3_wal_hook = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _dart_sqlite3_wal_hook = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _c_sqlite3_wal_autocheckpoint = ffi.Int32 Function( - ffi.Pointer db, - ffi.Int32 N, -); - -typedef _dart_sqlite3_wal_autocheckpoint = int Function( - ffi.Pointer db, - int N, -); - -typedef _c_sqlite3_wal_checkpoint = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zDb, -); - -typedef _dart_sqlite3_wal_checkpoint = int Function( - ffi.Pointer db, - ffi.Pointer zDb, -); - -typedef _c_sqlite3_wal_checkpoint_v2 = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zDb, - ffi.Int32 eMode, - ffi.Pointer pnLog, - ffi.Pointer pnCkpt, -); - -typedef _dart_sqlite3_wal_checkpoint_v2 = int Function( - ffi.Pointer db, - ffi.Pointer zDb, - int eMode, - ffi.Pointer pnLog, - ffi.Pointer pnCkpt, -); - -typedef _c_sqlite3_vtab_config = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 op, -); - -typedef _dart_sqlite3_vtab_config = int Function( - ffi.Pointer arg0, - int op, -); - -typedef _c_sqlite3_vtab_on_conflict = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_vtab_on_conflict = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_vtab_nochange = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_vtab_nochange = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_vtab_collation = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_vtab_collation = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_stmt_scanstatus = ffi.Int32 Function( - ffi.Pointer pStmt, - ffi.Int32 idx, - ffi.Int32 iScanStatusOp, - ffi.Pointer pOut, -); - -typedef _dart_sqlite3_stmt_scanstatus = int Function( - ffi.Pointer pStmt, - int idx, - int iScanStatusOp, - ffi.Pointer pOut, -); - -typedef _c_sqlite3_stmt_scanstatus_reset = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_stmt_scanstatus_reset = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_db_cacheflush = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_db_cacheflush = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_system_errno = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_system_errno = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_snapshot_get = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zSchema, - ffi.Pointer> ppSnapshot, -); - -typedef _dart_sqlite3_snapshot_get = int Function( - ffi.Pointer db, - ffi.Pointer zSchema, - ffi.Pointer> ppSnapshot, -); - -typedef _c_sqlite3_snapshot_open = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zSchema, - ffi.Pointer pSnapshot, -); - -typedef _dart_sqlite3_snapshot_open = int Function( - ffi.Pointer db, - ffi.Pointer zSchema, - ffi.Pointer pSnapshot, -); - -typedef _c_sqlite3_snapshot_free = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_snapshot_free = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_snapshot_cmp = ffi.Int32 Function( - ffi.Pointer p1, - ffi.Pointer p2, -); - -typedef _dart_sqlite3_snapshot_cmp = int Function( - ffi.Pointer p1, - ffi.Pointer p2, -); - -typedef _c_sqlite3_snapshot_recover = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zDb, -); - -typedef _dart_sqlite3_snapshot_recover = int Function( - ffi.Pointer db, - ffi.Pointer zDb, -); - -typedef _c_sqlite3_serialize = ffi.Pointer Function( - ffi.Pointer db, - ffi.Pointer zSchema, - ffi.Pointer piSize, - ffi.Uint32 mFlags, -); - -typedef _dart_sqlite3_serialize = ffi.Pointer Function( - ffi.Pointer db, - ffi.Pointer zSchema, - ffi.Pointer piSize, - int mFlags, -); - -typedef _c_sqlite3_deserialize = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zSchema, - ffi.Pointer pData, - ffi.Int64 szDb, - ffi.Int64 szBuf, - ffi.Uint32 mFlags, -); - -typedef _dart_sqlite3_deserialize = int Function( - ffi.Pointer db, - ffi.Pointer zSchema, - ffi.Pointer pData, - int szDb, - int szBuf, - int mFlags, -); - -typedef _typedefC_151 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, -); - -typedef _c_sqlite3_rtree_geometry_callback = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zGeom, - ffi.Pointer> xGeom, - ffi.Pointer pContext, -); - -typedef _dart_sqlite3_rtree_geometry_callback = int Function( - ffi.Pointer db, - ffi.Pointer zGeom, - ffi.Pointer> xGeom, - ffi.Pointer pContext, -); - -typedef _typedefC_152 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_153 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_rtree_query_callback = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zQueryFunc, - ffi.Pointer> xQueryFunc, - ffi.Pointer pContext, - ffi.Pointer> xDestructor, -); - -typedef _dart_sqlite3_rtree_query_callback = int Function( - ffi.Pointer db, - ffi.Pointer zQueryFunc, - ffi.Pointer> xQueryFunc, - ffi.Pointer pContext, - ffi.Pointer> xDestructor, -); - -typedef _typedefC_2 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_3 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int64, -); - -typedef _typedefC_4 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int64, -); - -typedef _typedefC_5 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int64, -); - -typedef _typedefC_6 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_7 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_8 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_9 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_10 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_11 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _typedefC_12 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_13 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_14 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_15 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Int32, -); - -typedef _typedefC_16 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_17 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_18 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int64, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_19 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int64, - ffi.Pointer, -); - -typedef _typedefC_20 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _typedefC_21 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_22 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _typedefC_23 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _typedefC_24 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_25 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _typedefC_27 = ffi.Void Function(); - -typedef _typedefC_26 = ffi.Pointer> Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_28 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_29 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _typedefC_30 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_31 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_32 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _typedefC_33 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef sqlite3_syscall_ptr = ffi.Void Function(); - -typedef _typedefC_34 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, -); - -typedef _typedefC_35 = ffi.Pointer> - Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_36 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_37 = ffi.Pointer Function( - ffi.Int32, -); - -typedef _typedefC_38 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_39 = ffi.Pointer Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_40 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_41 = ffi.Int32 Function( - ffi.Int32, -); - -typedef _typedefC_42 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_43 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_92 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer>, -); - -typedef _typedefC_93 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer>, -); - -typedef _typedefC_94 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_95 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_96 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_97 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer>, -); - -typedef _typedefC_98 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_99 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_100 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_101 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_102 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_103 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_104 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, - ffi.Pointer, -); - -typedef _typedefC_105 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_106 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_107 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_108 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_109 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_110 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer>>, - ffi.Pointer>, -); - -typedef _typedefC_111 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_112 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_113 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_114 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_115 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_117 = ffi.Int32 Function(); - -typedef _typedefC_118 = ffi.Int32 Function(); - -typedef _typedefC_119 = ffi.Pointer Function( - ffi.Int32, -); - -typedef _typedefC_120 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_121 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_122 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_123 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_124 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_125 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_126 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_127 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_128 = ffi.Pointer Function( - ffi.Int32, - ffi.Int32, - ffi.Int32, -); - -typedef _typedefC_129 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_130 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_131 = ffi.Pointer Function( - ffi.Pointer, - ffi.Uint32, - ffi.Int32, -); - -typedef _typedefC_132 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_133 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Uint32, - ffi.Uint32, -); - -typedef _typedefC_134 = ffi.Void Function( - ffi.Pointer, - ffi.Uint32, -); - -typedef _typedefC_135 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_136 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_137 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_138 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_139 = ffi.Pointer Function( - ffi.Int32, - ffi.Int32, -); - -typedef _typedefC_140 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_141 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_142 = ffi.Pointer Function( - ffi.Pointer, - ffi.Uint32, - ffi.Int32, -); - -typedef _typedefC_143 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_144 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Uint32, - ffi.Uint32, -); - -typedef _typedefC_145 = ffi.Void Function( - ffi.Pointer, - ffi.Uint32, -); - -typedef _typedefC_146 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_149 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_150 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_154 = ffi.Pointer Function( - ffi.Pointer, -); - -typedef _typedefC_155 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_156 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_157 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _typedefC_158 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Int32, -); - -typedef _typedefC_159 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer>, -); - -typedef _typedefC_160 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_161 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_162 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_163 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_164 = ffi.Int64 Function( - ffi.Pointer, -); - -typedef _typedefC_165 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, - ffi.Pointer, -); - -typedef _typedefC_166 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _typedefC_167 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_168 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer>, -); - -typedef _typedefC_169 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_170 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, -); - -typedef _typedefC_171 = ffi.Pointer Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_172 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_173 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_174 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_175 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_176 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_177 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_178 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Int32, -); - -typedef _typedefC_179 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_180 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_181 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, -); - -typedef _typedefC_182 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer, -); - -typedef fts5_extension_function = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_183 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_184 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, -); diff --git a/pkgs/ffigen/test/large_integration_tests/large_test.dart b/pkgs/ffigen/test/large_integration_tests/large_test.dart index b7cf797d21..35bb635d1f 100644 --- a/pkgs/ffigen/test/large_integration_tests/large_test.dart +++ b/pkgs/ffigen/test/large_integration_tests/large_test.dart @@ -37,6 +37,9 @@ ${strings.headers}: - '**Documentation.h' - '**FataErrorHandler.h' - '**Index.h' +${strings.typedefmap}: + 'size_t': 'IntPtr' + 'time_t': 'Int64' ''') as YamlMap); final library = parse(config); @@ -59,6 +62,8 @@ ${strings.headers}: - third_party/cjson_library/cJSON.h ${strings.includeDirectives}: - '**cJSON.h' +${strings.typedefmap}: + 'size_t': 'IntPtr' ''') as YamlMap); final library = parse(config); diff --git a/pkgs/ffigen/test/native_test/native_test_bindings.dart b/pkgs/ffigen/test/native_test/native_test_bindings.dart index 620771c336..ef7ee4596b 100644 --- a/pkgs/ffigen/test/native_test/native_test_bindings.dart +++ b/pkgs/ffigen/test/native_test/native_test_bindings.dart @@ -29,9 +29,10 @@ class NativeLibrary { } late final _Function1Bool_ptr = - _lookup>('Function1Bool'); - late final _dart_Function1Bool _Function1Bool = - _Function1Bool_ptr.asFunction<_dart_Function1Bool>(); + _lookup>( + 'Function1Bool'); + late final _Function1Bool = + _Function1Bool_ptr.asFunction(); int Function1Uint8( int x, @@ -42,9 +43,10 @@ class NativeLibrary { } late final _Function1Uint8_ptr = - _lookup>('Function1Uint8'); - late final _dart_Function1Uint8 _Function1Uint8 = - _Function1Uint8_ptr.asFunction<_dart_Function1Uint8>(); + _lookup>( + 'Function1Uint8'); + late final _Function1Uint8 = + _Function1Uint8_ptr.asFunction(); int Function1Uint16( int x, @@ -55,9 +57,10 @@ class NativeLibrary { } late final _Function1Uint16_ptr = - _lookup>('Function1Uint16'); - late final _dart_Function1Uint16 _Function1Uint16 = - _Function1Uint16_ptr.asFunction<_dart_Function1Uint16>(); + _lookup>( + 'Function1Uint16'); + late final _Function1Uint16 = + _Function1Uint16_ptr.asFunction(); int Function1Uint32( int x, @@ -68,9 +71,10 @@ class NativeLibrary { } late final _Function1Uint32_ptr = - _lookup>('Function1Uint32'); - late final _dart_Function1Uint32 _Function1Uint32 = - _Function1Uint32_ptr.asFunction<_dart_Function1Uint32>(); + _lookup>( + 'Function1Uint32'); + late final _Function1Uint32 = + _Function1Uint32_ptr.asFunction(); int Function1Uint64( int x, @@ -81,9 +85,10 @@ class NativeLibrary { } late final _Function1Uint64_ptr = - _lookup>('Function1Uint64'); - late final _dart_Function1Uint64 _Function1Uint64 = - _Function1Uint64_ptr.asFunction<_dart_Function1Uint64>(); + _lookup>( + 'Function1Uint64'); + late final _Function1Uint64 = + _Function1Uint64_ptr.asFunction(); int Function1Int8( int x, @@ -94,9 +99,9 @@ class NativeLibrary { } late final _Function1Int8_ptr = - _lookup>('Function1Int8'); - late final _dart_Function1Int8 _Function1Int8 = - _Function1Int8_ptr.asFunction<_dart_Function1Int8>(); + _lookup>('Function1Int8'); + late final _Function1Int8 = + _Function1Int8_ptr.asFunction(); int Function1Int16( int x, @@ -107,9 +112,10 @@ class NativeLibrary { } late final _Function1Int16_ptr = - _lookup>('Function1Int16'); - late final _dart_Function1Int16 _Function1Int16 = - _Function1Int16_ptr.asFunction<_dart_Function1Int16>(); + _lookup>( + 'Function1Int16'); + late final _Function1Int16 = + _Function1Int16_ptr.asFunction(); int Function1Int32( int x, @@ -120,9 +126,10 @@ class NativeLibrary { } late final _Function1Int32_ptr = - _lookup>('Function1Int32'); - late final _dart_Function1Int32 _Function1Int32 = - _Function1Int32_ptr.asFunction<_dart_Function1Int32>(); + _lookup>( + 'Function1Int32'); + late final _Function1Int32 = + _Function1Int32_ptr.asFunction(); int Function1Int64( int x, @@ -133,9 +140,10 @@ class NativeLibrary { } late final _Function1Int64_ptr = - _lookup>('Function1Int64'); - late final _dart_Function1Int64 _Function1Int64 = - _Function1Int64_ptr.asFunction<_dart_Function1Int64>(); + _lookup>( + 'Function1Int64'); + late final _Function1Int64 = + _Function1Int64_ptr.asFunction(); int Function1IntPtr( int x, @@ -146,9 +154,10 @@ class NativeLibrary { } late final _Function1IntPtr_ptr = - _lookup>('Function1IntPtr'); - late final _dart_Function1IntPtr _Function1IntPtr = - _Function1IntPtr_ptr.asFunction<_dart_Function1IntPtr>(); + _lookup>( + 'Function1IntPtr'); + late final _Function1IntPtr = + _Function1IntPtr_ptr.asFunction(); double Function1Float( double x, @@ -159,9 +168,10 @@ class NativeLibrary { } late final _Function1Float_ptr = - _lookup>('Function1Float'); - late final _dart_Function1Float _Function1Float = - _Function1Float_ptr.asFunction<_dart_Function1Float>(); + _lookup>( + 'Function1Float'); + late final _Function1Float = + _Function1Float_ptr.asFunction(); double Function1Double( double x, @@ -172,18 +182,20 @@ class NativeLibrary { } late final _Function1Double_ptr = - _lookup>('Function1Double'); - late final _dart_Function1Double _Function1Double = - _Function1Double_ptr.asFunction<_dart_Function1Double>(); + _lookup>( + 'Function1Double'); + late final _Function1Double = + _Function1Double_ptr.asFunction(); ffi.Pointer getStruct1() { return _getStruct1(); } late final _getStruct1_ptr = - _lookup>('getStruct1'); - late final _dart_getStruct1 _getStruct1 = - _getStruct1_ptr.asFunction<_dart_getStruct1>(); + _lookup Function()>>( + 'getStruct1'); + late final _getStruct1 = + _getStruct1_ptr.asFunction Function()>(); Struct3 Function1StructReturnByValue( int a, @@ -197,12 +209,12 @@ class NativeLibrary { ); } - late final _Function1StructReturnByValue_ptr = - _lookup>( - 'Function1StructReturnByValue'); - late final _dart_Function1StructReturnByValue _Function1StructReturnByValue = - _Function1StructReturnByValue_ptr.asFunction< - _dart_Function1StructReturnByValue>(); + late final _Function1StructReturnByValue_ptr = _lookup< + ffi.NativeFunction< + Struct3 Function(ffi.Int32, ffi.Int32, + ffi.Int32)>>('Function1StructReturnByValue'); + late final _Function1StructReturnByValue = _Function1StructReturnByValue_ptr + .asFunction(); int Function1StructPassByValue( Struct3 sum_a_b_c, @@ -213,11 +225,10 @@ class NativeLibrary { } late final _Function1StructPassByValue_ptr = - _lookup>( + _lookup>( 'Function1StructPassByValue'); - late final _dart_Function1StructPassByValue _Function1StructPassByValue = - _Function1StructPassByValue_ptr.asFunction< - _dart_Function1StructPassByValue>(); + late final _Function1StructPassByValue = + _Function1StructPassByValue_ptr.asFunction(); } class Struct1 extends ffi.Struct { @@ -238,123 +249,3 @@ class Struct3 extends ffi.Struct { @ffi.Int32() external int c; } - -typedef _c_Function1Bool = ffi.Uint8 Function( - ffi.Uint8 x, -); - -typedef _dart_Function1Bool = int Function( - int x, -); - -typedef _c_Function1Uint8 = ffi.Uint8 Function( - ffi.Uint8 x, -); - -typedef _dart_Function1Uint8 = int Function( - int x, -); - -typedef _c_Function1Uint16 = ffi.Uint16 Function( - ffi.Uint16 x, -); - -typedef _dart_Function1Uint16 = int Function( - int x, -); - -typedef _c_Function1Uint32 = ffi.Uint32 Function( - ffi.Uint32 x, -); - -typedef _dart_Function1Uint32 = int Function( - int x, -); - -typedef _c_Function1Uint64 = ffi.Uint64 Function( - ffi.Uint64 x, -); - -typedef _dart_Function1Uint64 = int Function( - int x, -); - -typedef _c_Function1Int8 = ffi.Int8 Function( - ffi.Int8 x, -); - -typedef _dart_Function1Int8 = int Function( - int x, -); - -typedef _c_Function1Int16 = ffi.Int16 Function( - ffi.Int16 x, -); - -typedef _dart_Function1Int16 = int Function( - int x, -); - -typedef _c_Function1Int32 = ffi.Int32 Function( - ffi.Int32 x, -); - -typedef _dart_Function1Int32 = int Function( - int x, -); - -typedef _c_Function1Int64 = ffi.Int64 Function( - ffi.Int64 x, -); - -typedef _dart_Function1Int64 = int Function( - int x, -); - -typedef _c_Function1IntPtr = ffi.IntPtr Function( - ffi.IntPtr x, -); - -typedef _dart_Function1IntPtr = int Function( - int x, -); - -typedef _c_Function1Float = ffi.Float Function( - ffi.Float x, -); - -typedef _dart_Function1Float = double Function( - double x, -); - -typedef _c_Function1Double = ffi.Double Function( - ffi.Double x, -); - -typedef _dart_Function1Double = double Function( - double x, -); - -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, -); diff --git a/pkgs/ffigen/test/rename_tests/rename.h b/pkgs/ffigen/test/rename_tests/rename.h index 8ff6d88c65..71ec5bc5e9 100644 --- a/pkgs/ffigen/test/rename_tests/rename.h +++ b/pkgs/ffigen/test/rename_tests/rename.h @@ -26,10 +26,15 @@ struct AnyMatchStruct5 int _underscore; }; +typedef struct Struct5{ + int a; +} Struct5_Alias; + void func1(struct Struct1 *s); void test_func2(struct Test_Struct2 *s); void fullMatch_func3(struct FullMatchStruct3 *s); void memberRename_func4(int _underscore, float fullMatch, int); +void typedefRenameFunc(Struct5_Alias s); enum Enum1 { diff --git a/pkgs/ffigen/test/rename_tests/rename_test.dart b/pkgs/ffigen/test/rename_tests/rename_test.dart index bb4f0ee577..f362a114a3 100644 --- a/pkgs/ffigen/test/rename_tests/rename_test.dart +++ b/pkgs/ffigen/test/rename_tests/rename_test.dart @@ -31,7 +31,7 @@ ${strings.headers}: ${strings.entryPoints}: - 'test/rename_tests/rename.h' -functions: +${strings.functions}: ${strings.rename}: 'test_(.*)': '\$1' '.*': '$functionPrefix\$0' @@ -42,7 +42,7 @@ functions: 'fullMatch': 'fullMatchSuccess' '': 'unnamed' -structs: +${strings.structs}: ${strings.rename}: 'Test_(.*)': '\$1' '.*': '$structPrefix\$0' @@ -54,7 +54,7 @@ structs: '.*': '_(.*)': '\$1' -enums: +${strings.enums}: ${strings.rename}: 'Test_(.*)': '\$1' '.*': '$enumPrefix\$0' @@ -64,17 +64,20 @@ enums: '_(.*)': '\$1' 'fullMatch': 'fullMatchSuccess' -unnamed-enums: +${strings.unnamedEnums}: ${strings.rename}: '_(.*)': '\$1' 'unnamedFullMatch': 'unnamedFullMatchSuccess' -macros: +${strings.macros}: ${strings.rename}: 'Test_(.*)': '\$1' '.*': '$macroPrefix\$0' 'FullMatchMacro3': 'Macro3' +${strings.typedefs}: + ${strings.rename}: + 'Struct5_Alias': 'Struct5_Alias_Renamed' ''') as yaml.YamlMap)); }); @@ -150,6 +153,10 @@ macros: expect(actual.getBindingAsString('unnamedFullMatchSuccess'), expected.getBindingAsString('unnamedFullMatchSuccess')); }); + test('typedef rename', () { + expect(actual.getBindingAsString('Struct5_Alias_Renamed'), + expected.getBindingAsString('Struct5_Alias_Renamed')); + }); }); } @@ -220,6 +227,21 @@ Library expectedLibrary() { ), ], ), + Func( + name: '${functionPrefix}typedefRenameFunc', + originalName: 'typedefRenameFunc', + returnType: Type.nativeType( + SupportedNativeType.Void, + ), + parameters: [ + Parameter( + name: 's', + type: Type.typealias(Typealias( + name: 'Struct5_Alias_Renamed', + type: Type.struct(Struc(name: '${structPrefix}Struct5')))), + ), + ], + ), struc1, struc2, struc3, From 16ecf9f6a27039f8f7722916e16187e08f171b69 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Fri, 4 Jun 2021 15:46:50 +0530 Subject: [PATCH 089/276] [ffigen] Move from package:pedantic to pacakge:lints (#230) --- pkgs/ffigen/CHANGELOG.md | 6 + pkgs/ffigen/README.md | 9 +- pkgs/ffigen/analysis_options.yaml | 13 +- .../c_json/cjson_generated_bindings.dart | 300 +-- pkgs/ffigen/example/c_json/pubspec.yaml | 3 + .../libclang-example/generated_bindings.dart | 1952 ++++++++--------- .../example/libclang-example/pubspec.yaml | 3 + .../example/simple/generated_bindings.dart | 20 +- pkgs/ffigen/example/simple/pubspec.yaml | 1 + .../lib/src/code_generator/compound.dart | 4 +- .../lib/src/code_generator/enum_class.dart | 4 +- pkgs/ffigen/lib/src/code_generator/func.dart | 3 +- .../lib/src/code_generator/library.dart | 9 +- pkgs/ffigen/lib/src/code_generator/type.dart | 8 +- pkgs/ffigen/lib/src/code_generator/utils.dart | 12 +- .../lib/src/config_provider/config_types.dart | 4 +- .../clang_bindings/clang_bindings.dart | 233 +- .../sub_parsers/compounddecl_parser.dart | 2 +- pkgs/ffigen/lib/src/header_parser/utils.dart | 4 +- pkgs/ffigen/pubspec.yaml | 4 +- .../code_generator_test.dart | 26 +- .../_expected_boolean_dartbool_bindings.dart | 6 +- ...expected_boolean_no_dartbool_bindings.dart | 6 +- .../_expected_function_bindings.dart | 12 +- .../_expected_function_n_struct_bindings.dart | 4 +- ...internal_conflict_resolution_bindings.dart | 30 +- .../_expected_packed_structs_bindings.dart | 4 +- .../_expected_sort_bindings_bindings.dart | 12 +- .../_expected_typealias_bindings.dart | 10 +- .../_expected_unions_bindings.dart | 4 +- .../decl_decl_collision_test.dart | 22 +- .../decl_symbol_address_collision_test.dart | 3 +- ...ecl_symbol_address_collision_bindings.dart | 29 +- .../reserved_keyword_collision_test.dart | 24 +- .../example_tests/cjson_example_test.dart | 2 + .../example_tests/libclang_example_test.dart | 2 + .../test/header_parser_tests/comment_markup.h | 2 +- .../test/header_parser_tests/dart_handle.h | 8 +- .../_expected_comment_markup_bindings.dart | 14 +- .../_expected_dart_handle_bindings.dart | 26 +- .../_expected_forward_decl_bindings.dart | 4 +- .../_expected_functions_bindings.dart | 28 +- ...expected_native_func_typedef_bindings.dart | 22 +- ...expected_opaque_dependencies_bindings.dart | 16 +- .../_expected_typedef_bindings.dart | 25 +- .../_expected_unions_bindings.dart | 8 +- .../header_parser_tests/functions_test.dart | 3 + .../header_parser_tests/native_func_typedef.h | 8 +- .../nested_parsing_test.dart | 2 +- .../header_parser_tests/opaque_dependencies.h | 4 +- .../ffigen/test/header_parser_tests/typedef.h | 14 +- .../header_parser_tests/typedef_test.dart | 5 +- .../_expected_cjson_bindings.dart | 300 +-- .../_expected_libclang_bindings.dart | 1342 ++++++------ .../_expected_sqlite_bindings.dart | 1095 ++++----- .../large_integration_tests/large_test.dart | 6 + pkgs/ffigen/test/native_test/config.yaml | 3 + .../native_test/native_test_bindings.dart | 64 +- pkgs/ffigen/tool/libclang_config.yaml | 2 + 59 files changed, 2908 insertions(+), 2883 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index e8e031cd0c..82edf93079 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,9 @@ +# 4.0.0-dev.1 +- This package now targets package:lints for the generated code. The generated +code uses C symbol names as is. Use either `// ignore_for_file: lintRule1, lintRule2` +in the `preamble`, or rename the symbols to make package:lints happy. +- Name collisions are now resolved by suffixing `` instead of `_`. + # 4.0.0-dev.0 - Added support for generating typedefs (_referred_ typedefs only). diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index aa4ad94152..5fc7822c0f 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -36,7 +36,7 @@ class NativeLibrary { return _sum(a, b); } - late final _sum_ptr = _lookup>('sum'); + late final _sumPtr = _lookup>('sum'); late final _sum = _sum_ptr.asFunction(); } ``` @@ -381,9 +381,7 @@ use-dart-handle: true ```yaml preamble: | - /// AUTO GENERATED FILE, DO NOT EDIT. - /// - /// Generated by `package:ffigen`. + // ignore_for_file: camel_case_types, non_constant_identifier_names ``` @@ -532,8 +530,7 @@ unions: ### How to expose the native pointers and typedefs? By default all native pointers and typedefs are hidden, but you can use the -`symbol-address` subkey for functions/globals and make them public by matching with its name. The pointers are then accesible via `nativeLibrary.addresses` and the native -typedef are prefixed with `Native_`. +`symbol-address` subkey for functions/globals and make them public by matching with its name. The pointers are then accesible via `nativeLibrary.addresses` and the native typedef are prefixed with `Native_`. Example - ```yaml diff --git a/pkgs/ffigen/analysis_options.yaml b/pkgs/ffigen/analysis_options.yaml index 467460f4db..002a2c49a0 100644 --- a/pkgs/ffigen/analysis_options.yaml +++ b/pkgs/ffigen/analysis_options.yaml @@ -2,7 +2,7 @@ # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. -include: package:pedantic/analysis_options.yaml +include: package:lints/recommended.yaml analyzer: strong-mode: @@ -11,8 +11,9 @@ analyzer: linter: rules: - - directives_ordering - - prefer_final_fields - - prefer_final_locals - - prefer_final_in_for_each - - unnecessary_brace_in_string_interps + # Enabled. + directives_ordering: true + prefer_final_locals: true + prefer_final_in_for_each: true + # Disabled. + constant_identifier_names: false diff --git a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart index d0fb894d37..a518d8a350 100644 --- a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart +++ b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart @@ -18,6 +18,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +// ignore_for_file: camel_case_types, non_constant_identifier_names + // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. @@ -42,11 +44,11 @@ class CJson { return _cJSON_Version(); } - late final _cJSON_Version_ptr = + late final _cJSON_VersionPtr = _lookup Function()>>( 'cJSON_Version'); late final _cJSON_Version = - _cJSON_Version_ptr.asFunction Function()>(); + _cJSON_VersionPtr.asFunction Function()>(); void cJSON_InitHooks( ffi.Pointer hooks, @@ -56,11 +58,11 @@ class CJson { ); } - late final _cJSON_InitHooks_ptr = + late final _cJSON_InitHooksPtr = _lookup)>>( 'cJSON_InitHooks'); - late final _cJSON_InitHooks = _cJSON_InitHooks_ptr - .asFunction)>(); + late final _cJSON_InitHooks = + _cJSON_InitHooksPtr.asFunction)>(); ffi.Pointer cJSON_Parse( ffi.Pointer value, @@ -70,10 +72,10 @@ class CJson { ); } - late final _cJSON_Parse_ptr = _lookup< + late final _cJSON_ParsePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer)>>('cJSON_Parse'); - late final _cJSON_Parse = _cJSON_Parse_ptr + late final _cJSON_Parse = _cJSON_ParsePtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_ParseWithOpts( @@ -88,13 +90,13 @@ class CJson { ); } - late final _cJSON_ParseWithOpts_ptr = _lookup< + late final _cJSON_ParseWithOptsPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer>, cJSON_bool)>>('cJSON_ParseWithOpts'); - late final _cJSON_ParseWithOpts = _cJSON_ParseWithOpts_ptr.asFunction< + late final _cJSON_ParseWithOpts = _cJSON_ParseWithOptsPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer>, int)>(); @@ -106,10 +108,10 @@ class CJson { ); } - late final _cJSON_Print_ptr = _lookup< + late final _cJSON_PrintPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer)>>('cJSON_Print'); - late final _cJSON_Print = _cJSON_Print_ptr + late final _cJSON_Print = _cJSON_PrintPtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_PrintUnformatted( @@ -120,11 +122,11 @@ class CJson { ); } - late final _cJSON_PrintUnformatted_ptr = _lookup< + late final _cJSON_PrintUnformattedPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('cJSON_PrintUnformatted'); - late final _cJSON_PrintUnformatted = _cJSON_PrintUnformatted_ptr + late final _cJSON_PrintUnformatted = _cJSON_PrintUnformattedPtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_PrintBuffered( @@ -139,11 +141,11 @@ class CJson { ); } - late final _cJSON_PrintBuffered_ptr = _lookup< + late final _cJSON_PrintBufferedPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Int32, cJSON_bool)>>('cJSON_PrintBuffered'); - late final _cJSON_PrintBuffered = _cJSON_PrintBuffered_ptr.asFunction< + late final _cJSON_PrintBuffered = _cJSON_PrintBufferedPtr.asFunction< ffi.Pointer Function(ffi.Pointer, int, int)>(); int cJSON_PrintPreallocated( @@ -160,11 +162,11 @@ class CJson { ); } - late final _cJSON_PrintPreallocated_ptr = _lookup< + late final _cJSON_PrintPreallocatedPtr = _lookup< ffi.NativeFunction< cJSON_bool Function(ffi.Pointer, ffi.Pointer, ffi.Int32, cJSON_bool)>>('cJSON_PrintPreallocated'); - late final _cJSON_PrintPreallocated = _cJSON_PrintPreallocated_ptr.asFunction< + late final _cJSON_PrintPreallocated = _cJSON_PrintPreallocatedPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, int)>(); void cJSON_Delete( @@ -175,11 +177,11 @@ class CJson { ); } - late final _cJSON_Delete_ptr = + late final _cJSON_DeletePtr = _lookup)>>( 'cJSON_Delete'); late final _cJSON_Delete = - _cJSON_Delete_ptr.asFunction)>(); + _cJSON_DeletePtr.asFunction)>(); int cJSON_GetArraySize( ffi.Pointer array, @@ -189,11 +191,11 @@ class CJson { ); } - late final _cJSON_GetArraySize_ptr = + late final _cJSON_GetArraySizePtr = _lookup)>>( 'cJSON_GetArraySize'); late final _cJSON_GetArraySize = - _cJSON_GetArraySize_ptr.asFunction)>(); + _cJSON_GetArraySizePtr.asFunction)>(); ffi.Pointer cJSON_GetArrayItem( ffi.Pointer array, @@ -205,11 +207,11 @@ class CJson { ); } - late final _cJSON_GetArrayItem_ptr = _lookup< + late final _cJSON_GetArrayItemPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Int32)>>('cJSON_GetArrayItem'); - late final _cJSON_GetArrayItem = _cJSON_GetArrayItem_ptr + late final _cJSON_GetArrayItem = _cJSON_GetArrayItemPtr .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_GetObjectItem( @@ -222,11 +224,11 @@ class CJson { ); } - late final _cJSON_GetObjectItem_ptr = _lookup< + late final _cJSON_GetObjectItemPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('cJSON_GetObjectItem'); - late final _cJSON_GetObjectItem = _cJSON_GetObjectItem_ptr.asFunction< + late final _cJSON_GetObjectItem = _cJSON_GetObjectItemPtr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_GetObjectItemCaseSensitive( @@ -239,12 +241,12 @@ class CJson { ); } - late final _cJSON_GetObjectItemCaseSensitive_ptr = _lookup< + late final _cJSON_GetObjectItemCaseSensitivePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('cJSON_GetObjectItemCaseSensitive'); late final _cJSON_GetObjectItemCaseSensitive = - _cJSON_GetObjectItemCaseSensitive_ptr.asFunction< + _cJSON_GetObjectItemCaseSensitivePtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); @@ -258,22 +260,22 @@ class CJson { ); } - late final _cJSON_HasObjectItem_ptr = _lookup< + late final _cJSON_HasObjectItemPtr = _lookup< ffi.NativeFunction< cJSON_bool Function(ffi.Pointer, ffi.Pointer)>>('cJSON_HasObjectItem'); - late final _cJSON_HasObjectItem = _cJSON_HasObjectItem_ptr + late final _cJSON_HasObjectItem = _cJSON_HasObjectItemPtr .asFunction, ffi.Pointer)>(); ffi.Pointer cJSON_GetErrorPtr() { return _cJSON_GetErrorPtr(); } - late final _cJSON_GetErrorPtr_ptr = + late final _cJSON_GetErrorPtrPtr = _lookup Function()>>( 'cJSON_GetErrorPtr'); late final _cJSON_GetErrorPtr = - _cJSON_GetErrorPtr_ptr.asFunction Function()>(); + _cJSON_GetErrorPtrPtr.asFunction Function()>(); ffi.Pointer cJSON_GetStringValue( ffi.Pointer item, @@ -283,11 +285,11 @@ class CJson { ); } - late final _cJSON_GetStringValue_ptr = _lookup< + late final _cJSON_GetStringValuePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('cJSON_GetStringValue'); - late final _cJSON_GetStringValue = _cJSON_GetStringValue_ptr + late final _cJSON_GetStringValue = _cJSON_GetStringValuePtr .asFunction Function(ffi.Pointer)>(); int cJSON_IsInvalid( @@ -298,11 +300,11 @@ class CJson { ); } - late final _cJSON_IsInvalid_ptr = + late final _cJSON_IsInvalidPtr = _lookup)>>( 'cJSON_IsInvalid'); late final _cJSON_IsInvalid = - _cJSON_IsInvalid_ptr.asFunction)>(); + _cJSON_IsInvalidPtr.asFunction)>(); int cJSON_IsFalse( ffi.Pointer item, @@ -312,11 +314,11 @@ class CJson { ); } - late final _cJSON_IsFalse_ptr = + late final _cJSON_IsFalsePtr = _lookup)>>( 'cJSON_IsFalse'); late final _cJSON_IsFalse = - _cJSON_IsFalse_ptr.asFunction)>(); + _cJSON_IsFalsePtr.asFunction)>(); int cJSON_IsTrue( ffi.Pointer item, @@ -326,11 +328,11 @@ class CJson { ); } - late final _cJSON_IsTrue_ptr = + late final _cJSON_IsTruePtr = _lookup)>>( 'cJSON_IsTrue'); late final _cJSON_IsTrue = - _cJSON_IsTrue_ptr.asFunction)>(); + _cJSON_IsTruePtr.asFunction)>(); int cJSON_IsBool( ffi.Pointer item, @@ -340,11 +342,11 @@ class CJson { ); } - late final _cJSON_IsBool_ptr = + late final _cJSON_IsBoolPtr = _lookup)>>( 'cJSON_IsBool'); late final _cJSON_IsBool = - _cJSON_IsBool_ptr.asFunction)>(); + _cJSON_IsBoolPtr.asFunction)>(); int cJSON_IsNull( ffi.Pointer item, @@ -354,11 +356,11 @@ class CJson { ); } - late final _cJSON_IsNull_ptr = + late final _cJSON_IsNullPtr = _lookup)>>( 'cJSON_IsNull'); late final _cJSON_IsNull = - _cJSON_IsNull_ptr.asFunction)>(); + _cJSON_IsNullPtr.asFunction)>(); int cJSON_IsNumber( ffi.Pointer item, @@ -368,11 +370,11 @@ class CJson { ); } - late final _cJSON_IsNumber_ptr = + late final _cJSON_IsNumberPtr = _lookup)>>( 'cJSON_IsNumber'); late final _cJSON_IsNumber = - _cJSON_IsNumber_ptr.asFunction)>(); + _cJSON_IsNumberPtr.asFunction)>(); int cJSON_IsString( ffi.Pointer item, @@ -382,11 +384,11 @@ class CJson { ); } - late final _cJSON_IsString_ptr = + late final _cJSON_IsStringPtr = _lookup)>>( 'cJSON_IsString'); late final _cJSON_IsString = - _cJSON_IsString_ptr.asFunction)>(); + _cJSON_IsStringPtr.asFunction)>(); int cJSON_IsArray( ffi.Pointer item, @@ -396,11 +398,11 @@ class CJson { ); } - late final _cJSON_IsArray_ptr = + late final _cJSON_IsArrayPtr = _lookup)>>( 'cJSON_IsArray'); late final _cJSON_IsArray = - _cJSON_IsArray_ptr.asFunction)>(); + _cJSON_IsArrayPtr.asFunction)>(); int cJSON_IsObject( ffi.Pointer item, @@ -410,11 +412,11 @@ class CJson { ); } - late final _cJSON_IsObject_ptr = + late final _cJSON_IsObjectPtr = _lookup)>>( 'cJSON_IsObject'); late final _cJSON_IsObject = - _cJSON_IsObject_ptr.asFunction)>(); + _cJSON_IsObjectPtr.asFunction)>(); int cJSON_IsRaw( ffi.Pointer item, @@ -424,41 +426,41 @@ class CJson { ); } - late final _cJSON_IsRaw_ptr = + late final _cJSON_IsRawPtr = _lookup)>>( 'cJSON_IsRaw'); late final _cJSON_IsRaw = - _cJSON_IsRaw_ptr.asFunction)>(); + _cJSON_IsRawPtr.asFunction)>(); ffi.Pointer cJSON_CreateNull() { return _cJSON_CreateNull(); } - late final _cJSON_CreateNull_ptr = + late final _cJSON_CreateNullPtr = _lookup Function()>>( 'cJSON_CreateNull'); late final _cJSON_CreateNull = - _cJSON_CreateNull_ptr.asFunction Function()>(); + _cJSON_CreateNullPtr.asFunction Function()>(); ffi.Pointer cJSON_CreateTrue() { return _cJSON_CreateTrue(); } - late final _cJSON_CreateTrue_ptr = + late final _cJSON_CreateTruePtr = _lookup Function()>>( 'cJSON_CreateTrue'); late final _cJSON_CreateTrue = - _cJSON_CreateTrue_ptr.asFunction Function()>(); + _cJSON_CreateTruePtr.asFunction Function()>(); ffi.Pointer cJSON_CreateFalse() { return _cJSON_CreateFalse(); } - late final _cJSON_CreateFalse_ptr = + late final _cJSON_CreateFalsePtr = _lookup Function()>>( 'cJSON_CreateFalse'); late final _cJSON_CreateFalse = - _cJSON_CreateFalse_ptr.asFunction Function()>(); + _cJSON_CreateFalsePtr.asFunction Function()>(); ffi.Pointer cJSON_CreateBool( int boolean, @@ -468,11 +470,11 @@ class CJson { ); } - late final _cJSON_CreateBool_ptr = + late final _cJSON_CreateBoolPtr = _lookup Function(cJSON_bool)>>( 'cJSON_CreateBool'); late final _cJSON_CreateBool = - _cJSON_CreateBool_ptr.asFunction Function(int)>(); + _cJSON_CreateBoolPtr.asFunction Function(int)>(); ffi.Pointer cJSON_CreateNumber( double num, @@ -482,11 +484,11 @@ class CJson { ); } - late final _cJSON_CreateNumber_ptr = + late final _cJSON_CreateNumberPtr = _lookup Function(ffi.Double)>>( 'cJSON_CreateNumber'); late final _cJSON_CreateNumber = - _cJSON_CreateNumber_ptr.asFunction Function(double)>(); + _cJSON_CreateNumberPtr.asFunction Function(double)>(); ffi.Pointer cJSON_CreateString( ffi.Pointer string, @@ -496,11 +498,11 @@ class CJson { ); } - late final _cJSON_CreateString_ptr = _lookup< + late final _cJSON_CreateStringPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('cJSON_CreateString'); - late final _cJSON_CreateString = _cJSON_CreateString_ptr + late final _cJSON_CreateString = _cJSON_CreateStringPtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateRaw( @@ -511,32 +513,32 @@ class CJson { ); } - late final _cJSON_CreateRaw_ptr = _lookup< + late final _cJSON_CreateRawPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('cJSON_CreateRaw'); - late final _cJSON_CreateRaw = _cJSON_CreateRaw_ptr + late final _cJSON_CreateRaw = _cJSON_CreateRawPtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateArray() { return _cJSON_CreateArray(); } - late final _cJSON_CreateArray_ptr = + late final _cJSON_CreateArrayPtr = _lookup Function()>>( 'cJSON_CreateArray'); late final _cJSON_CreateArray = - _cJSON_CreateArray_ptr.asFunction Function()>(); + _cJSON_CreateArrayPtr.asFunction Function()>(); ffi.Pointer cJSON_CreateObject() { return _cJSON_CreateObject(); } - late final _cJSON_CreateObject_ptr = + late final _cJSON_CreateObjectPtr = _lookup Function()>>( 'cJSON_CreateObject'); late final _cJSON_CreateObject = - _cJSON_CreateObject_ptr.asFunction Function()>(); + _cJSON_CreateObjectPtr.asFunction Function()>(); ffi.Pointer cJSON_CreateStringReference( ffi.Pointer string, @@ -546,11 +548,11 @@ class CJson { ); } - late final _cJSON_CreateStringReference_ptr = _lookup< + late final _cJSON_CreateStringReferencePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('cJSON_CreateStringReference'); - late final _cJSON_CreateStringReference = _cJSON_CreateStringReference_ptr + late final _cJSON_CreateStringReference = _cJSON_CreateStringReferencePtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateObjectReference( @@ -561,10 +563,10 @@ class CJson { ); } - late final _cJSON_CreateObjectReference_ptr = _lookup< + late final _cJSON_CreateObjectReferencePtr = _lookup< ffi.NativeFunction Function(ffi.Pointer)>>( 'cJSON_CreateObjectReference'); - late final _cJSON_CreateObjectReference = _cJSON_CreateObjectReference_ptr + late final _cJSON_CreateObjectReference = _cJSON_CreateObjectReferencePtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateArrayReference( @@ -575,10 +577,10 @@ class CJson { ); } - late final _cJSON_CreateArrayReference_ptr = _lookup< + late final _cJSON_CreateArrayReferencePtr = _lookup< ffi.NativeFunction Function(ffi.Pointer)>>( 'cJSON_CreateArrayReference'); - late final _cJSON_CreateArrayReference = _cJSON_CreateArrayReference_ptr + late final _cJSON_CreateArrayReference = _cJSON_CreateArrayReferencePtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateIntArray( @@ -591,11 +593,11 @@ class CJson { ); } - late final _cJSON_CreateIntArray_ptr = _lookup< + late final _cJSON_CreateIntArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Int32)>>('cJSON_CreateIntArray'); - late final _cJSON_CreateIntArray = _cJSON_CreateIntArray_ptr + late final _cJSON_CreateIntArray = _cJSON_CreateIntArrayPtr .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateFloatArray( @@ -608,11 +610,11 @@ class CJson { ); } - late final _cJSON_CreateFloatArray_ptr = _lookup< + late final _cJSON_CreateFloatArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Int32)>>('cJSON_CreateFloatArray'); - late final _cJSON_CreateFloatArray = _cJSON_CreateFloatArray_ptr + late final _cJSON_CreateFloatArray = _cJSON_CreateFloatArrayPtr .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateDoubleArray( @@ -625,11 +627,11 @@ class CJson { ); } - late final _cJSON_CreateDoubleArray_ptr = _lookup< + late final _cJSON_CreateDoubleArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Int32)>>('cJSON_CreateDoubleArray'); - late final _cJSON_CreateDoubleArray = _cJSON_CreateDoubleArray_ptr + late final _cJSON_CreateDoubleArray = _cJSON_CreateDoubleArrayPtr .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateStringArray( @@ -642,11 +644,11 @@ class CJson { ); } - late final _cJSON_CreateStringArray_ptr = _lookup< + late final _cJSON_CreateStringArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer>, ffi.Int32)>>('cJSON_CreateStringArray'); - late final _cJSON_CreateStringArray = _cJSON_CreateStringArray_ptr.asFunction< + late final _cJSON_CreateStringArray = _cJSON_CreateStringArrayPtr.asFunction< ffi.Pointer Function(ffi.Pointer>, int)>(); void cJSON_AddItemToArray( @@ -659,11 +661,11 @@ class CJson { ); } - late final _cJSON_AddItemToArray_ptr = _lookup< + late final _cJSON_AddItemToArrayPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemToArray'); - late final _cJSON_AddItemToArray = _cJSON_AddItemToArray_ptr + late final _cJSON_AddItemToArray = _cJSON_AddItemToArrayPtr .asFunction, ffi.Pointer)>(); void cJSON_AddItemToObject( @@ -678,11 +680,11 @@ class CJson { ); } - late final _cJSON_AddItemToObject_ptr = _lookup< + late final _cJSON_AddItemToObjectPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemToObject'); - late final _cJSON_AddItemToObject = _cJSON_AddItemToObject_ptr.asFunction< + late final _cJSON_AddItemToObject = _cJSON_AddItemToObjectPtr.asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -698,11 +700,11 @@ class CJson { ); } - late final _cJSON_AddItemToObjectCS_ptr = _lookup< + late final _cJSON_AddItemToObjectCSPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemToObjectCS'); - late final _cJSON_AddItemToObjectCS = _cJSON_AddItemToObjectCS_ptr.asFunction< + late final _cJSON_AddItemToObjectCS = _cJSON_AddItemToObjectCSPtr.asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -716,11 +718,11 @@ class CJson { ); } - late final _cJSON_AddItemReferenceToArray_ptr = _lookup< + late final _cJSON_AddItemReferenceToArrayPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemReferenceToArray'); - late final _cJSON_AddItemReferenceToArray = _cJSON_AddItemReferenceToArray_ptr + late final _cJSON_AddItemReferenceToArray = _cJSON_AddItemReferenceToArrayPtr .asFunction, ffi.Pointer)>(); void cJSON_AddItemReferenceToObject( @@ -735,12 +737,12 @@ class CJson { ); } - late final _cJSON_AddItemReferenceToObject_ptr = _lookup< + late final _cJSON_AddItemReferenceToObjectPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemReferenceToObject'); late final _cJSON_AddItemReferenceToObject = - _cJSON_AddItemReferenceToObject_ptr.asFunction< + _cJSON_AddItemReferenceToObjectPtr.asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -754,12 +756,12 @@ class CJson { ); } - late final _cJSON_DetachItemViaPointer_ptr = _lookup< + late final _cJSON_DetachItemViaPointerPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('cJSON_DetachItemViaPointer'); late final _cJSON_DetachItemViaPointer = - _cJSON_DetachItemViaPointer_ptr.asFunction< + _cJSON_DetachItemViaPointerPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); @@ -773,11 +775,11 @@ class CJson { ); } - late final _cJSON_DetachItemFromArray_ptr = _lookup< + late final _cJSON_DetachItemFromArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Int32)>>('cJSON_DetachItemFromArray'); - late final _cJSON_DetachItemFromArray = _cJSON_DetachItemFromArray_ptr + late final _cJSON_DetachItemFromArray = _cJSON_DetachItemFromArrayPtr .asFunction Function(ffi.Pointer, int)>(); void cJSON_DeleteItemFromArray( @@ -790,10 +792,10 @@ class CJson { ); } - late final _cJSON_DeleteItemFromArray_ptr = _lookup< + late final _cJSON_DeleteItemFromArrayPtr = _lookup< ffi.NativeFunction, ffi.Int32)>>( 'cJSON_DeleteItemFromArray'); - late final _cJSON_DeleteItemFromArray = _cJSON_DeleteItemFromArray_ptr + late final _cJSON_DeleteItemFromArray = _cJSON_DeleteItemFromArrayPtr .asFunction, int)>(); ffi.Pointer cJSON_DetachItemFromObject( @@ -806,12 +808,12 @@ class CJson { ); } - late final _cJSON_DetachItemFromObject_ptr = _lookup< + late final _cJSON_DetachItemFromObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('cJSON_DetachItemFromObject'); late final _cJSON_DetachItemFromObject = - _cJSON_DetachItemFromObject_ptr.asFunction< + _cJSON_DetachItemFromObjectPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); @@ -825,13 +827,13 @@ class CJson { ); } - late final _cJSON_DetachItemFromObjectCaseSensitive_ptr = _lookup< + late final _cJSON_DetachItemFromObjectCaseSensitivePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>( 'cJSON_DetachItemFromObjectCaseSensitive'); late final _cJSON_DetachItemFromObjectCaseSensitive = - _cJSON_DetachItemFromObjectCaseSensitive_ptr.asFunction< + _cJSON_DetachItemFromObjectCaseSensitivePtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); @@ -845,11 +847,11 @@ class CJson { ); } - late final _cJSON_DeleteItemFromObject_ptr = _lookup< + late final _cJSON_DeleteItemFromObjectPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer)>>('cJSON_DeleteItemFromObject'); - late final _cJSON_DeleteItemFromObject = _cJSON_DeleteItemFromObject_ptr + late final _cJSON_DeleteItemFromObject = _cJSON_DeleteItemFromObjectPtr .asFunction, ffi.Pointer)>(); void cJSON_DeleteItemFromObjectCaseSensitive( @@ -862,12 +864,12 @@ class CJson { ); } - late final _cJSON_DeleteItemFromObjectCaseSensitive_ptr = _lookup< + late final _cJSON_DeleteItemFromObjectCaseSensitivePtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer)>>( 'cJSON_DeleteItemFromObjectCaseSensitive'); late final _cJSON_DeleteItemFromObjectCaseSensitive = - _cJSON_DeleteItemFromObjectCaseSensitive_ptr.asFunction< + _cJSON_DeleteItemFromObjectCaseSensitivePtr.asFunction< void Function(ffi.Pointer, ffi.Pointer)>(); void cJSON_InsertItemInArray( @@ -882,11 +884,11 @@ class CJson { ); } - late final _cJSON_InsertItemInArray_ptr = _lookup< + late final _cJSON_InsertItemInArrayPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Int32, ffi.Pointer)>>('cJSON_InsertItemInArray'); - late final _cJSON_InsertItemInArray = _cJSON_InsertItemInArray_ptr + late final _cJSON_InsertItemInArray = _cJSON_InsertItemInArrayPtr .asFunction, int, ffi.Pointer)>(); int cJSON_ReplaceItemViaPointer( @@ -901,12 +903,12 @@ class CJson { ); } - late final _cJSON_ReplaceItemViaPointer_ptr = _lookup< + late final _cJSON_ReplaceItemViaPointerPtr = _lookup< ffi.NativeFunction< cJSON_bool Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_ReplaceItemViaPointer'); late final _cJSON_ReplaceItemViaPointer = - _cJSON_ReplaceItemViaPointer_ptr.asFunction< + _cJSON_ReplaceItemViaPointerPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -922,11 +924,11 @@ class CJson { ); } - late final _cJSON_ReplaceItemInArray_ptr = _lookup< + late final _cJSON_ReplaceItemInArrayPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Int32, ffi.Pointer)>>('cJSON_ReplaceItemInArray'); - late final _cJSON_ReplaceItemInArray = _cJSON_ReplaceItemInArray_ptr + late final _cJSON_ReplaceItemInArray = _cJSON_ReplaceItemInArrayPtr .asFunction, int, ffi.Pointer)>(); void cJSON_ReplaceItemInObject( @@ -941,12 +943,12 @@ class CJson { ); } - late final _cJSON_ReplaceItemInObject_ptr = _lookup< + late final _cJSON_ReplaceItemInObjectPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_ReplaceItemInObject'); late final _cJSON_ReplaceItemInObject = - _cJSON_ReplaceItemInObject_ptr.asFunction< + _cJSON_ReplaceItemInObjectPtr.asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -962,12 +964,12 @@ class CJson { ); } - late final _cJSON_ReplaceItemInObjectCaseSensitive_ptr = _lookup< + late final _cJSON_ReplaceItemInObjectCaseSensitivePtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_ReplaceItemInObjectCaseSensitive'); late final _cJSON_ReplaceItemInObjectCaseSensitive = - _cJSON_ReplaceItemInObjectCaseSensitive_ptr.asFunction< + _cJSON_ReplaceItemInObjectCaseSensitivePtr.asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -981,11 +983,11 @@ class CJson { ); } - late final _cJSON_Duplicate_ptr = _lookup< + late final _cJSON_DuplicatePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, cJSON_bool)>>('cJSON_Duplicate'); - late final _cJSON_Duplicate = _cJSON_Duplicate_ptr + late final _cJSON_Duplicate = _cJSON_DuplicatePtr .asFunction Function(ffi.Pointer, int)>(); int cJSON_Compare( @@ -1000,11 +1002,11 @@ class CJson { ); } - late final _cJSON_Compare_ptr = _lookup< + late final _cJSON_ComparePtr = _lookup< ffi.NativeFunction< cJSON_bool Function(ffi.Pointer, ffi.Pointer, cJSON_bool)>>('cJSON_Compare'); - late final _cJSON_Compare = _cJSON_Compare_ptr + late final _cJSON_Compare = _cJSON_ComparePtr .asFunction, ffi.Pointer, int)>(); void cJSON_Minify( @@ -1015,11 +1017,11 @@ class CJson { ); } - late final _cJSON_Minify_ptr = + late final _cJSON_MinifyPtr = _lookup)>>( 'cJSON_Minify'); late final _cJSON_Minify = - _cJSON_Minify_ptr.asFunction)>(); + _cJSON_MinifyPtr.asFunction)>(); ffi.Pointer cJSON_AddNullToObject( ffi.Pointer object, @@ -1031,11 +1033,11 @@ class CJson { ); } - late final _cJSON_AddNullToObject_ptr = _lookup< + late final _cJSON_AddNullToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('cJSON_AddNullToObject'); - late final _cJSON_AddNullToObject = _cJSON_AddNullToObject_ptr.asFunction< + late final _cJSON_AddNullToObject = _cJSON_AddNullToObjectPtr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddTrueToObject( @@ -1048,11 +1050,11 @@ class CJson { ); } - late final _cJSON_AddTrueToObject_ptr = _lookup< + late final _cJSON_AddTrueToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('cJSON_AddTrueToObject'); - late final _cJSON_AddTrueToObject = _cJSON_AddTrueToObject_ptr.asFunction< + late final _cJSON_AddTrueToObject = _cJSON_AddTrueToObjectPtr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddFalseToObject( @@ -1065,11 +1067,11 @@ class CJson { ); } - late final _cJSON_AddFalseToObject_ptr = _lookup< + late final _cJSON_AddFalseToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('cJSON_AddFalseToObject'); - late final _cJSON_AddFalseToObject = _cJSON_AddFalseToObject_ptr.asFunction< + late final _cJSON_AddFalseToObject = _cJSON_AddFalseToObjectPtr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddBoolToObject( @@ -1084,11 +1086,11 @@ class CJson { ); } - late final _cJSON_AddBoolToObject_ptr = _lookup< + late final _cJSON_AddBoolToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, cJSON_bool)>>('cJSON_AddBoolToObject'); - late final _cJSON_AddBoolToObject = _cJSON_AddBoolToObject_ptr.asFunction< + late final _cJSON_AddBoolToObject = _cJSON_AddBoolToObjectPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); @@ -1104,11 +1106,11 @@ class CJson { ); } - late final _cJSON_AddNumberToObject_ptr = _lookup< + late final _cJSON_AddNumberToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Double)>>('cJSON_AddNumberToObject'); - late final _cJSON_AddNumberToObject = _cJSON_AddNumberToObject_ptr.asFunction< + late final _cJSON_AddNumberToObject = _cJSON_AddNumberToObjectPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, double)>(); @@ -1124,11 +1126,11 @@ class CJson { ); } - late final _cJSON_AddStringToObject_ptr = _lookup< + late final _cJSON_AddStringToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddStringToObject'); - late final _cJSON_AddStringToObject = _cJSON_AddStringToObject_ptr.asFunction< + late final _cJSON_AddStringToObject = _cJSON_AddStringToObjectPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -1144,11 +1146,11 @@ class CJson { ); } - late final _cJSON_AddRawToObject_ptr = _lookup< + late final _cJSON_AddRawToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddRawToObject'); - late final _cJSON_AddRawToObject = _cJSON_AddRawToObject_ptr.asFunction< + late final _cJSON_AddRawToObject = _cJSON_AddRawToObjectPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -1162,11 +1164,11 @@ class CJson { ); } - late final _cJSON_AddObjectToObject_ptr = _lookup< + late final _cJSON_AddObjectToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('cJSON_AddObjectToObject'); - late final _cJSON_AddObjectToObject = _cJSON_AddObjectToObject_ptr.asFunction< + late final _cJSON_AddObjectToObject = _cJSON_AddObjectToObjectPtr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddArrayToObject( @@ -1179,11 +1181,11 @@ class CJson { ); } - late final _cJSON_AddArrayToObject_ptr = _lookup< + late final _cJSON_AddArrayToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('cJSON_AddArrayToObject'); - late final _cJSON_AddArrayToObject = _cJSON_AddArrayToObject_ptr.asFunction< + late final _cJSON_AddArrayToObject = _cJSON_AddArrayToObjectPtr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); double cJSON_SetNumberHelper( @@ -1196,11 +1198,11 @@ class CJson { ); } - late final _cJSON_SetNumberHelper_ptr = _lookup< + late final _cJSON_SetNumberHelperPtr = _lookup< ffi.NativeFunction< ffi.Double Function( ffi.Pointer, ffi.Double)>>('cJSON_SetNumberHelper'); - late final _cJSON_SetNumberHelper = _cJSON_SetNumberHelper_ptr + late final _cJSON_SetNumberHelper = _cJSON_SetNumberHelperPtr .asFunction, double)>(); ffi.Pointer cJSON_malloc( @@ -1211,11 +1213,11 @@ class CJson { ); } - late final _cJSON_malloc_ptr = + late final _cJSON_mallocPtr = _lookup Function(ffi.IntPtr)>>( 'cJSON_malloc'); late final _cJSON_malloc = - _cJSON_malloc_ptr.asFunction Function(int)>(); + _cJSON_mallocPtr.asFunction Function(int)>(); void cJSON_free( ffi.Pointer object, @@ -1225,11 +1227,11 @@ class CJson { ); } - late final _cJSON_free_ptr = + late final _cJSON_freePtr = _lookup)>>( 'cJSON_free'); late final _cJSON_free = - _cJSON_free_ptr.asFunction)>(); + _cJSON_freePtr.asFunction)>(); } class cJSON extends ffi.Struct { diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index 03a913b3bf..e9b7960367 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -14,6 +14,7 @@ dependencies: dev_dependencies: ffigen: path: '../../' + lints: ^1.0.1 ffigen: output: 'cjson_generated_bindings.dart' @@ -48,3 +49,5 @@ ffigen: // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. + + // ignore_for_file: camel_case_types, non_constant_identifier_names diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index f8e77c4e6a..f77c7e64f1 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -3,6 +3,8 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// ignore_for_file: camel_case_types, non_constant_identifier_names + // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. @@ -32,9 +34,9 @@ class LibClang { ); } - late final _clang_getCString_ptr = + late final _clang_getCStringPtr = _lookup>('clang_getCString'); - late final _clang_getCString = _clang_getCString_ptr + late final _clang_getCString = _clang_getCStringPtr .asFunction Function(CXString)>(); /// Free the given string. @@ -46,25 +48,25 @@ class LibClang { ); } - late final _clang_disposeString_ptr = + late final _clang_disposeStringPtr = _lookup>( 'clang_disposeString'); late final _clang_disposeString = - _clang_disposeString_ptr.asFunction(); + _clang_disposeStringPtr.asFunction(); /// Free the given string set. void clang_disposeStringSet( - ffi.Pointer set_1, + ffi.Pointer set1, ) { return _clang_disposeStringSet( - set_1, + set1, ); } - late final _clang_disposeStringSet_ptr = + late final _clang_disposeStringSetPtr = _lookup>( 'clang_disposeStringSet'); - late final _clang_disposeStringSet = _clang_disposeStringSet_ptr + late final _clang_disposeStringSet = _clang_disposeStringSetPtr .asFunction)>(); /// Provides a shared context for creating translation units. @@ -115,11 +117,11 @@ class LibClang { ); } - late final _clang_createIndex_ptr = + late final _clang_createIndexPtr = _lookup>( 'clang_createIndex'); late final _clang_createIndex = - _clang_createIndex_ptr.asFunction(); + _clang_createIndexPtr.asFunction(); /// Destroy the given index. /// @@ -133,11 +135,11 @@ class LibClang { ); } - late final _clang_disposeIndex_ptr = + late final _clang_disposeIndexPtr = _lookup>( 'clang_disposeIndex'); late final _clang_disposeIndex = - _clang_disposeIndex_ptr.asFunction(); + _clang_disposeIndexPtr.asFunction(); /// Sets general options associated with a CXIndex. /// @@ -160,11 +162,11 @@ class LibClang { ); } - late final _clang_CXIndex_setGlobalOptions_ptr = + late final _clang_CXIndex_setGlobalOptionsPtr = _lookup>( 'clang_CXIndex_setGlobalOptions'); late final _clang_CXIndex_setGlobalOptions = - _clang_CXIndex_setGlobalOptions_ptr + _clang_CXIndex_setGlobalOptionsPtr .asFunction(); /// Gets the general options associated with a CXIndex. @@ -179,11 +181,11 @@ class LibClang { ); } - late final _clang_CXIndex_getGlobalOptions_ptr = + late final _clang_CXIndex_getGlobalOptionsPtr = _lookup>( 'clang_CXIndex_getGlobalOptions'); late final _clang_CXIndex_getGlobalOptions = - _clang_CXIndex_getGlobalOptions_ptr.asFunction(); + _clang_CXIndex_getGlobalOptionsPtr.asFunction(); /// Sets the invocation emission path option in a CXIndex. /// @@ -200,12 +202,12 @@ class LibClang { ); } - late final _clang_CXIndex_setInvocationEmissionPathOption_ptr = _lookup< + late final _clang_CXIndex_setInvocationEmissionPathOptionPtr = _lookup< ffi.NativeFunction< Native_clang_CXIndex_setInvocationEmissionPathOption>>( 'clang_CXIndex_setInvocationEmissionPathOption'); late final _clang_CXIndex_setInvocationEmissionPathOption = - _clang_CXIndex_setInvocationEmissionPathOption_ptr + _clang_CXIndex_setInvocationEmissionPathOptionPtr .asFunction)>(); /// Retrieve the complete file and path name of the given file. @@ -217,11 +219,11 @@ class LibClang { ); } - late final _clang_getFileName_ptr = + late final _clang_getFileNamePtr = _lookup>( 'clang_getFileName'); late final _clang_getFileName = - _clang_getFileName_ptr.asFunction(); + _clang_getFileNamePtr.asFunction(); /// Retrieve the last modification time of the given file. int clang_getFileTime( @@ -232,11 +234,11 @@ class LibClang { ); } - late final _clang_getFileTime_ptr = + late final _clang_getFileTimePtr = _lookup>( 'clang_getFileTime'); late final _clang_getFileTime = - _clang_getFileTime_ptr.asFunction(); + _clang_getFileTimePtr.asFunction(); /// Retrieve the unique ID for the given \c file. /// @@ -254,10 +256,10 @@ class LibClang { ); } - late final _clang_getFileUniqueID_ptr = + late final _clang_getFileUniqueIDPtr = _lookup>( 'clang_getFileUniqueID'); - late final _clang_getFileUniqueID = _clang_getFileUniqueID_ptr + late final _clang_getFileUniqueID = _clang_getFileUniqueIDPtr .asFunction)>(); /// Determine whether the given header is guarded against @@ -273,11 +275,11 @@ class LibClang { ); } - late final _clang_isFileMultipleIncludeGuarded_ptr = + late final _clang_isFileMultipleIncludeGuardedPtr = _lookup>( 'clang_isFileMultipleIncludeGuarded'); late final _clang_isFileMultipleIncludeGuarded = - _clang_isFileMultipleIncludeGuarded_ptr + _clang_isFileMultipleIncludeGuardedPtr .asFunction(); /// Retrieve a file handle within the given translation unit. @@ -298,9 +300,9 @@ class LibClang { ); } - late final _clang_getFile_ptr = + late final _clang_getFilePtr = _lookup>('clang_getFile'); - late final _clang_getFile = _clang_getFile_ptr + late final _clang_getFile = _clang_getFilePtr .asFunction)>(); /// Retrieve the buffer associated with the given file. @@ -325,10 +327,10 @@ class LibClang { ); } - late final _clang_getFileContents_ptr = + late final _clang_getFileContentsPtr = _lookup>( 'clang_getFileContents'); - late final _clang_getFileContents = _clang_getFileContents_ptr.asFunction< + late final _clang_getFileContents = _clang_getFileContentsPtr.asFunction< ffi.Pointer Function( CXTranslationUnit, CXFile, ffi.Pointer)>(); @@ -344,11 +346,11 @@ class LibClang { ); } - late final _clang_File_isEqual_ptr = + late final _clang_File_isEqualPtr = _lookup>( 'clang_File_isEqual'); late final _clang_File_isEqual = - _clang_File_isEqual_ptr.asFunction(); + _clang_File_isEqualPtr.asFunction(); /// Returns the real path name of \c file. /// @@ -361,22 +363,22 @@ class LibClang { ); } - late final _clang_File_tryGetRealPathName_ptr = + late final _clang_File_tryGetRealPathNamePtr = _lookup>( 'clang_File_tryGetRealPathName'); - late final _clang_File_tryGetRealPathName = _clang_File_tryGetRealPathName_ptr - .asFunction(); + late final _clang_File_tryGetRealPathName = + _clang_File_tryGetRealPathNamePtr.asFunction(); /// Retrieve a NULL (invalid) source location. CXSourceLocation clang_getNullLocation() { return _clang_getNullLocation(); } - late final _clang_getNullLocation_ptr = + late final _clang_getNullLocationPtr = _lookup>( 'clang_getNullLocation'); late final _clang_getNullLocation = - _clang_getNullLocation_ptr.asFunction(); + _clang_getNullLocationPtr.asFunction(); /// Determine whether two source locations, which must refer into /// the same translation unit, refer to exactly the same point in the source @@ -394,10 +396,10 @@ class LibClang { ); } - late final _clang_equalLocations_ptr = + late final _clang_equalLocationsPtr = _lookup>( 'clang_equalLocations'); - late final _clang_equalLocations = _clang_equalLocations_ptr + late final _clang_equalLocations = _clang_equalLocationsPtr .asFunction(); /// Retrieves the source location associated with a given file/line/column @@ -416,10 +418,10 @@ class LibClang { ); } - late final _clang_getLocation_ptr = + late final _clang_getLocationPtr = _lookup>( 'clang_getLocation'); - late final _clang_getLocation = _clang_getLocation_ptr.asFunction< + late final _clang_getLocation = _clang_getLocationPtr.asFunction< CXSourceLocation Function(CXTranslationUnit, CXFile, int, int)>(); /// Retrieves the source location associated with a given character offset @@ -436,10 +438,10 @@ class LibClang { ); } - late final _clang_getLocationForOffset_ptr = + late final _clang_getLocationForOffsetPtr = _lookup>( 'clang_getLocationForOffset'); - late final _clang_getLocationForOffset = _clang_getLocationForOffset_ptr + late final _clang_getLocationForOffset = _clang_getLocationForOffsetPtr .asFunction(); /// Returns non-zero if the given source location is in a system header. @@ -451,11 +453,11 @@ class LibClang { ); } - late final _clang_Location_isInSystemHeader_ptr = + late final _clang_Location_isInSystemHeaderPtr = _lookup>( 'clang_Location_isInSystemHeader'); late final _clang_Location_isInSystemHeader = - _clang_Location_isInSystemHeader_ptr + _clang_Location_isInSystemHeaderPtr .asFunction(); /// Returns non-zero if the given source location is in the main file of @@ -468,10 +470,10 @@ class LibClang { ); } - late final _clang_Location_isFromMainFile_ptr = + late final _clang_Location_isFromMainFilePtr = _lookup>( 'clang_Location_isFromMainFile'); - late final _clang_Location_isFromMainFile = _clang_Location_isFromMainFile_ptr + late final _clang_Location_isFromMainFile = _clang_Location_isFromMainFilePtr .asFunction(); /// Retrieve a NULL (invalid) source range. @@ -479,11 +481,11 @@ class LibClang { return _clang_getNullRange(); } - late final _clang_getNullRange_ptr = + late final _clang_getNullRangePtr = _lookup>( 'clang_getNullRange'); late final _clang_getNullRange = - _clang_getNullRange_ptr.asFunction(); + _clang_getNullRangePtr.asFunction(); /// Retrieve a source range given the beginning and ending source /// locations. @@ -497,9 +499,9 @@ class LibClang { ); } - late final _clang_getRange_ptr = + late final _clang_getRangePtr = _lookup>('clang_getRange'); - late final _clang_getRange = _clang_getRange_ptr + late final _clang_getRange = _clang_getRangePtr .asFunction(); /// Determine whether two ranges are equivalent. @@ -515,10 +517,10 @@ class LibClang { ); } - late final _clang_equalRanges_ptr = + late final _clang_equalRangesPtr = _lookup>( 'clang_equalRanges'); - late final _clang_equalRanges = _clang_equalRanges_ptr + late final _clang_equalRanges = _clang_equalRangesPtr .asFunction(); /// Returns non-zero if \p range is null. @@ -530,11 +532,11 @@ class LibClang { ); } - late final _clang_Range_isNull_ptr = + late final _clang_Range_isNullPtr = _lookup>( 'clang_Range_isNull'); late final _clang_Range_isNull = - _clang_Range_isNull_ptr.asFunction(); + _clang_Range_isNullPtr.asFunction(); /// Retrieve the file, line, column, and offset represented by /// the given source location. @@ -572,11 +574,11 @@ class LibClang { ); } - late final _clang_getExpansionLocation_ptr = + late final _clang_getExpansionLocationPtr = _lookup>( 'clang_getExpansionLocation'); late final _clang_getExpansionLocation = - _clang_getExpansionLocation_ptr.asFunction< + _clang_getExpansionLocationPtr.asFunction< void Function( CXSourceLocation, ffi.Pointer, @@ -636,11 +638,11 @@ class LibClang { ); } - late final _clang_getPresumedLocation_ptr = + late final _clang_getPresumedLocationPtr = _lookup>( 'clang_getPresumedLocation'); late final _clang_getPresumedLocation = - _clang_getPresumedLocation_ptr.asFunction< + _clang_getPresumedLocationPtr.asFunction< void Function(CXSourceLocation, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -666,11 +668,11 @@ class LibClang { ); } - late final _clang_getInstantiationLocation_ptr = + late final _clang_getInstantiationLocationPtr = _lookup>( 'clang_getInstantiationLocation'); late final _clang_getInstantiationLocation = - _clang_getInstantiationLocation_ptr.asFunction< + _clang_getInstantiationLocationPtr.asFunction< void Function( CXSourceLocation, ffi.Pointer, @@ -714,11 +716,11 @@ class LibClang { ); } - late final _clang_getSpellingLocation_ptr = + late final _clang_getSpellingLocationPtr = _lookup>( 'clang_getSpellingLocation'); late final _clang_getSpellingLocation = - _clang_getSpellingLocation_ptr.asFunction< + _clang_getSpellingLocationPtr.asFunction< void Function( CXSourceLocation, ffi.Pointer, @@ -763,10 +765,10 @@ class LibClang { ); } - late final _clang_getFileLocation_ptr = + late final _clang_getFileLocationPtr = _lookup>( 'clang_getFileLocation'); - late final _clang_getFileLocation = _clang_getFileLocation_ptr.asFunction< + late final _clang_getFileLocation = _clang_getFileLocationPtr.asFunction< void Function( CXSourceLocation, ffi.Pointer, @@ -784,10 +786,10 @@ class LibClang { ); } - late final _clang_getRangeStart_ptr = + late final _clang_getRangeStartPtr = _lookup>( 'clang_getRangeStart'); - late final _clang_getRangeStart = _clang_getRangeStart_ptr + late final _clang_getRangeStart = _clang_getRangeStartPtr .asFunction(); /// Retrieve a source location representing the last character within a @@ -800,10 +802,10 @@ class LibClang { ); } - late final _clang_getRangeEnd_ptr = + late final _clang_getRangeEndPtr = _lookup>( 'clang_getRangeEnd'); - late final _clang_getRangeEnd = _clang_getRangeEnd_ptr + late final _clang_getRangeEnd = _clang_getRangeEndPtr .asFunction(); /// Retrieve all ranges that were skipped by the preprocessor. @@ -820,10 +822,10 @@ class LibClang { ); } - late final _clang_getSkippedRanges_ptr = + late final _clang_getSkippedRangesPtr = _lookup>( 'clang_getSkippedRanges'); - late final _clang_getSkippedRanges = _clang_getSkippedRanges_ptr.asFunction< + late final _clang_getSkippedRanges = _clang_getSkippedRangesPtr.asFunction< ffi.Pointer Function(CXTranslationUnit, CXFile)>(); /// Retrieve all ranges from all files that were skipped by the @@ -839,10 +841,10 @@ class LibClang { ); } - late final _clang_getAllSkippedRanges_ptr = + late final _clang_getAllSkippedRangesPtr = _lookup>( 'clang_getAllSkippedRanges'); - late final _clang_getAllSkippedRanges = _clang_getAllSkippedRanges_ptr + late final _clang_getAllSkippedRanges = _clang_getAllSkippedRangesPtr .asFunction Function(CXTranslationUnit)>(); /// Destroy the given \c CXSourceRangeList. @@ -854,10 +856,10 @@ class LibClang { ); } - late final _clang_disposeSourceRangeList_ptr = + late final _clang_disposeSourceRangeListPtr = _lookup>( 'clang_disposeSourceRangeList'); - late final _clang_disposeSourceRangeList = _clang_disposeSourceRangeList_ptr + late final _clang_disposeSourceRangeList = _clang_disposeSourceRangeListPtr .asFunction)>(); /// Determine the number of diagnostics in a CXDiagnosticSet. @@ -869,10 +871,10 @@ class LibClang { ); } - late final _clang_getNumDiagnosticsInSet_ptr = + late final _clang_getNumDiagnosticsInSetPtr = _lookup>( 'clang_getNumDiagnosticsInSet'); - late final _clang_getNumDiagnosticsInSet = _clang_getNumDiagnosticsInSet_ptr + late final _clang_getNumDiagnosticsInSet = _clang_getNumDiagnosticsInSetPtr .asFunction(); /// Retrieve a diagnostic associated with the given CXDiagnosticSet. @@ -892,10 +894,10 @@ class LibClang { ); } - late final _clang_getDiagnosticInSet_ptr = + late final _clang_getDiagnosticInSetPtr = _lookup>( 'clang_getDiagnosticInSet'); - late final _clang_getDiagnosticInSet = _clang_getDiagnosticInSet_ptr + late final _clang_getDiagnosticInSet = _clang_getDiagnosticInSetPtr .asFunction(); /// Deserialize a set of diagnostics from a Clang diagnostics bitcode @@ -921,10 +923,10 @@ class LibClang { ); } - late final _clang_loadDiagnostics_ptr = + late final _clang_loadDiagnosticsPtr = _lookup>( 'clang_loadDiagnostics'); - late final _clang_loadDiagnostics = _clang_loadDiagnostics_ptr.asFunction< + late final _clang_loadDiagnostics = _clang_loadDiagnosticsPtr.asFunction< CXDiagnosticSet Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -937,10 +939,10 @@ class LibClang { ); } - late final _clang_disposeDiagnosticSet_ptr = + late final _clang_disposeDiagnosticSetPtr = _lookup>( 'clang_disposeDiagnosticSet'); - late final _clang_disposeDiagnosticSet = _clang_disposeDiagnosticSet_ptr + late final _clang_disposeDiagnosticSet = _clang_disposeDiagnosticSetPtr .asFunction(); /// Retrieve the child diagnostics of a CXDiagnostic. @@ -955,10 +957,10 @@ class LibClang { ); } - late final _clang_getChildDiagnostics_ptr = + late final _clang_getChildDiagnosticsPtr = _lookup>( 'clang_getChildDiagnostics'); - late final _clang_getChildDiagnostics = _clang_getChildDiagnostics_ptr + late final _clang_getChildDiagnostics = _clang_getChildDiagnosticsPtr .asFunction(); /// Determine the number of diagnostics produced for the given @@ -971,11 +973,11 @@ class LibClang { ); } - late final _clang_getNumDiagnostics_ptr = + late final _clang_getNumDiagnosticsPtr = _lookup>( 'clang_getNumDiagnostics'); - late final _clang_getNumDiagnostics = _clang_getNumDiagnostics_ptr - .asFunction(); + late final _clang_getNumDiagnostics = + _clang_getNumDiagnosticsPtr.asFunction(); /// Retrieve a diagnostic associated with the given translation unit. /// @@ -994,10 +996,10 @@ class LibClang { ); } - late final _clang_getDiagnostic_ptr = + late final _clang_getDiagnosticPtr = _lookup>( 'clang_getDiagnostic'); - late final _clang_getDiagnostic = _clang_getDiagnostic_ptr + late final _clang_getDiagnostic = _clang_getDiagnosticPtr .asFunction(); /// Retrieve the complete set of diagnostics associated with a @@ -1012,10 +1014,10 @@ class LibClang { ); } - late final _clang_getDiagnosticSetFromTU_ptr = + late final _clang_getDiagnosticSetFromTUPtr = _lookup>( 'clang_getDiagnosticSetFromTU'); - late final _clang_getDiagnosticSetFromTU = _clang_getDiagnosticSetFromTU_ptr + late final _clang_getDiagnosticSetFromTU = _clang_getDiagnosticSetFromTUPtr .asFunction(); /// Destroy a diagnostic. @@ -1027,11 +1029,11 @@ class LibClang { ); } - late final _clang_disposeDiagnostic_ptr = + late final _clang_disposeDiagnosticPtr = _lookup>( 'clang_disposeDiagnostic'); late final _clang_disposeDiagnostic = - _clang_disposeDiagnostic_ptr.asFunction(); + _clang_disposeDiagnosticPtr.asFunction(); /// Format the given diagnostic in a manner that is suitable for display. /// @@ -1056,10 +1058,10 @@ class LibClang { ); } - late final _clang_formatDiagnostic_ptr = + late final _clang_formatDiagnosticPtr = _lookup>( 'clang_formatDiagnostic'); - late final _clang_formatDiagnostic = _clang_formatDiagnostic_ptr + late final _clang_formatDiagnostic = _clang_formatDiagnosticPtr .asFunction(); /// Retrieve the set of display options most similar to the @@ -1071,11 +1073,11 @@ class LibClang { return _clang_defaultDiagnosticDisplayOptions(); } - late final _clang_defaultDiagnosticDisplayOptions_ptr = + late final _clang_defaultDiagnosticDisplayOptionsPtr = _lookup>( 'clang_defaultDiagnosticDisplayOptions'); late final _clang_defaultDiagnosticDisplayOptions = - _clang_defaultDiagnosticDisplayOptions_ptr.asFunction(); + _clang_defaultDiagnosticDisplayOptionsPtr.asFunction(); /// Determine the severity of the given diagnostic. int clang_getDiagnosticSeverity( @@ -1086,11 +1088,11 @@ class LibClang { ); } - late final _clang_getDiagnosticSeverity_ptr = + late final _clang_getDiagnosticSeverityPtr = _lookup>( 'clang_getDiagnosticSeverity'); late final _clang_getDiagnosticSeverity = - _clang_getDiagnosticSeverity_ptr.asFunction(); + _clang_getDiagnosticSeverityPtr.asFunction(); /// Retrieve the source location of the given diagnostic. /// @@ -1104,10 +1106,10 @@ class LibClang { ); } - late final _clang_getDiagnosticLocation_ptr = + late final _clang_getDiagnosticLocationPtr = _lookup>( 'clang_getDiagnosticLocation'); - late final _clang_getDiagnosticLocation = _clang_getDiagnosticLocation_ptr + late final _clang_getDiagnosticLocation = _clang_getDiagnosticLocationPtr .asFunction(); /// Retrieve the text of the given diagnostic. @@ -1119,10 +1121,10 @@ class LibClang { ); } - late final _clang_getDiagnosticSpelling_ptr = + late final _clang_getDiagnosticSpellingPtr = _lookup>( 'clang_getDiagnosticSpelling'); - late final _clang_getDiagnosticSpelling = _clang_getDiagnosticSpelling_ptr + late final _clang_getDiagnosticSpelling = _clang_getDiagnosticSpellingPtr .asFunction(); /// Retrieve the name of the command-line option that enabled this @@ -1145,10 +1147,10 @@ class LibClang { ); } - late final _clang_getDiagnosticOption_ptr = + late final _clang_getDiagnosticOptionPtr = _lookup>( 'clang_getDiagnosticOption'); - late final _clang_getDiagnosticOption = _clang_getDiagnosticOption_ptr + late final _clang_getDiagnosticOption = _clang_getDiagnosticOptionPtr .asFunction)>(); /// Retrieve the category number for this diagnostic. @@ -1167,11 +1169,11 @@ class LibClang { ); } - late final _clang_getDiagnosticCategory_ptr = + late final _clang_getDiagnosticCategoryPtr = _lookup>( 'clang_getDiagnosticCategory'); late final _clang_getDiagnosticCategory = - _clang_getDiagnosticCategory_ptr.asFunction(); + _clang_getDiagnosticCategoryPtr.asFunction(); /// Retrieve the name of a particular diagnostic category. This /// is now deprecated. Use clang_getDiagnosticCategoryText() @@ -1189,11 +1191,11 @@ class LibClang { ); } - late final _clang_getDiagnosticCategoryName_ptr = + late final _clang_getDiagnosticCategoryNamePtr = _lookup>( 'clang_getDiagnosticCategoryName'); late final _clang_getDiagnosticCategoryName = - _clang_getDiagnosticCategoryName_ptr.asFunction(); + _clang_getDiagnosticCategoryNamePtr.asFunction(); /// Retrieve the diagnostic category text for a given diagnostic. /// @@ -1206,11 +1208,11 @@ class LibClang { ); } - late final _clang_getDiagnosticCategoryText_ptr = + late final _clang_getDiagnosticCategoryTextPtr = _lookup>( 'clang_getDiagnosticCategoryText'); late final _clang_getDiagnosticCategoryText = - _clang_getDiagnosticCategoryText_ptr + _clang_getDiagnosticCategoryTextPtr .asFunction(); /// Determine the number of source ranges associated with the given @@ -1223,11 +1225,11 @@ class LibClang { ); } - late final _clang_getDiagnosticNumRanges_ptr = + late final _clang_getDiagnosticNumRangesPtr = _lookup>( 'clang_getDiagnosticNumRanges'); - late final _clang_getDiagnosticNumRanges = _clang_getDiagnosticNumRanges_ptr - .asFunction(); + late final _clang_getDiagnosticNumRanges = + _clang_getDiagnosticNumRangesPtr.asFunction(); /// Retrieve a source range associated with the diagnostic. /// @@ -1250,10 +1252,10 @@ class LibClang { ); } - late final _clang_getDiagnosticRange_ptr = + late final _clang_getDiagnosticRangePtr = _lookup>( 'clang_getDiagnosticRange'); - late final _clang_getDiagnosticRange = _clang_getDiagnosticRange_ptr + late final _clang_getDiagnosticRange = _clang_getDiagnosticRangePtr .asFunction(); /// Determine the number of fix-it hints associated with the @@ -1266,11 +1268,11 @@ class LibClang { ); } - late final _clang_getDiagnosticNumFixIts_ptr = + late final _clang_getDiagnosticNumFixItsPtr = _lookup>( 'clang_getDiagnosticNumFixIts'); - late final _clang_getDiagnosticNumFixIts = _clang_getDiagnosticNumFixIts_ptr - .asFunction(); + late final _clang_getDiagnosticNumFixIts = + _clang_getDiagnosticNumFixItsPtr.asFunction(); /// Retrieve the replacement information for a given fix-it. /// @@ -1307,11 +1309,11 @@ class LibClang { ); } - late final _clang_getDiagnosticFixIt_ptr = + late final _clang_getDiagnosticFixItPtr = _lookup>( 'clang_getDiagnosticFixIt'); late final _clang_getDiagnosticFixIt = - _clang_getDiagnosticFixIt_ptr.asFunction< + _clang_getDiagnosticFixItPtr.asFunction< CXString Function(CXDiagnostic, int, ffi.Pointer)>(); /// Get the original translation unit source file name. @@ -1323,11 +1325,11 @@ class LibClang { ); } - late final _clang_getTranslationUnitSpelling_ptr = + late final _clang_getTranslationUnitSpellingPtr = _lookup>( 'clang_getTranslationUnitSpelling'); late final _clang_getTranslationUnitSpelling = - _clang_getTranslationUnitSpelling_ptr + _clang_getTranslationUnitSpellingPtr .asFunction(); /// Return the CXTranslationUnit for a given source file and the provided @@ -1386,11 +1388,11 @@ class LibClang { ); } - late final _clang_createTranslationUnitFromSourceFile_ptr = _lookup< + late final _clang_createTranslationUnitFromSourceFilePtr = _lookup< ffi.NativeFunction>( 'clang_createTranslationUnitFromSourceFile'); late final _clang_createTranslationUnitFromSourceFile = - _clang_createTranslationUnitFromSourceFile_ptr.asFunction< + _clang_createTranslationUnitFromSourceFilePtr.asFunction< CXTranslationUnit Function( CXIndex, ffi.Pointer, @@ -1413,10 +1415,10 @@ class LibClang { ); } - late final _clang_createTranslationUnit_ptr = + late final _clang_createTranslationUnitPtr = _lookup>( 'clang_createTranslationUnit'); - late final _clang_createTranslationUnit = _clang_createTranslationUnit_ptr + late final _clang_createTranslationUnit = _clang_createTranslationUnitPtr .asFunction)>(); /// Create a translation unit from an AST file (\c -emit-ast). @@ -1437,11 +1439,11 @@ class LibClang { ); } - late final _clang_createTranslationUnit2_ptr = + late final _clang_createTranslationUnit2Ptr = _lookup>( 'clang_createTranslationUnit2'); late final _clang_createTranslationUnit2 = - _clang_createTranslationUnit2_ptr.asFunction< + _clang_createTranslationUnit2Ptr.asFunction< int Function(CXIndex, ffi.Pointer, ffi.Pointer)>(); @@ -1459,12 +1461,12 @@ class LibClang { return _clang_defaultEditingTranslationUnitOptions(); } - late final _clang_defaultEditingTranslationUnitOptions_ptr = _lookup< + late final _clang_defaultEditingTranslationUnitOptionsPtr = _lookup< ffi.NativeFunction< Native_clang_defaultEditingTranslationUnitOptions>>( 'clang_defaultEditingTranslationUnitOptions'); late final _clang_defaultEditingTranslationUnitOptions = - _clang_defaultEditingTranslationUnitOptions_ptr + _clang_defaultEditingTranslationUnitOptionsPtr .asFunction(); /// Same as \c clang_parseTranslationUnit2, but returns @@ -1491,11 +1493,11 @@ class LibClang { ); } - late final _clang_parseTranslationUnit_ptr = + late final _clang_parseTranslationUnitPtr = _lookup>( 'clang_parseTranslationUnit'); late final _clang_parseTranslationUnit = - _clang_parseTranslationUnit_ptr.asFunction< + _clang_parseTranslationUnitPtr.asFunction< CXTranslationUnit Function( CXIndex, ffi.Pointer, @@ -1569,11 +1571,11 @@ class LibClang { ); } - late final _clang_parseTranslationUnit2_ptr = + late final _clang_parseTranslationUnit2Ptr = _lookup>( 'clang_parseTranslationUnit2'); late final _clang_parseTranslationUnit2 = - _clang_parseTranslationUnit2_ptr.asFunction< + _clang_parseTranslationUnit2Ptr.asFunction< int Function( CXIndex, ffi.Pointer, @@ -1609,11 +1611,11 @@ class LibClang { ); } - late final _clang_parseTranslationUnit2FullArgv_ptr = + late final _clang_parseTranslationUnit2FullArgvPtr = _lookup>( 'clang_parseTranslationUnit2FullArgv'); late final _clang_parseTranslationUnit2FullArgv = - _clang_parseTranslationUnit2FullArgv_ptr.asFunction< + _clang_parseTranslationUnit2FullArgvPtr.asFunction< int Function( CXIndex, ffi.Pointer, @@ -1639,10 +1641,10 @@ class LibClang { ); } - late final _clang_defaultSaveOptions_ptr = + late final _clang_defaultSaveOptionsPtr = _lookup>( 'clang_defaultSaveOptions'); - late final _clang_defaultSaveOptions = _clang_defaultSaveOptions_ptr + late final _clang_defaultSaveOptions = _clang_defaultSaveOptionsPtr .asFunction(); /// Saves a translation unit into a serialized representation of @@ -1678,11 +1680,11 @@ class LibClang { ); } - late final _clang_saveTranslationUnit_ptr = + late final _clang_saveTranslationUnitPtr = _lookup>( 'clang_saveTranslationUnit'); late final _clang_saveTranslationUnit = - _clang_saveTranslationUnit_ptr.asFunction< + _clang_saveTranslationUnitPtr.asFunction< int Function(CXTranslationUnit, ffi.Pointer, int)>(); /// Suspend a translation unit in order to free memory associated with it. @@ -1698,10 +1700,10 @@ class LibClang { ); } - late final _clang_suspendTranslationUnit_ptr = + late final _clang_suspendTranslationUnitPtr = _lookup>( 'clang_suspendTranslationUnit'); - late final _clang_suspendTranslationUnit = _clang_suspendTranslationUnit_ptr + late final _clang_suspendTranslationUnit = _clang_suspendTranslationUnitPtr .asFunction(); /// Destroy the specified CXTranslationUnit object. @@ -1713,10 +1715,10 @@ class LibClang { ); } - late final _clang_disposeTranslationUnit_ptr = + late final _clang_disposeTranslationUnitPtr = _lookup>( 'clang_disposeTranslationUnit'); - late final _clang_disposeTranslationUnit = _clang_disposeTranslationUnit_ptr + late final _clang_disposeTranslationUnit = _clang_disposeTranslationUnitPtr .asFunction(); /// Returns the set of flags that is suitable for reparsing a translation @@ -1735,10 +1737,10 @@ class LibClang { ); } - late final _clang_defaultReparseOptions_ptr = + late final _clang_defaultReparseOptionsPtr = _lookup>( 'clang_defaultReparseOptions'); - late final _clang_defaultReparseOptions = _clang_defaultReparseOptions_ptr + late final _clang_defaultReparseOptions = _clang_defaultReparseOptionsPtr .asFunction(); /// Reparse the source files that produced this translation unit. @@ -1792,11 +1794,11 @@ class LibClang { ); } - late final _clang_reparseTranslationUnit_ptr = + late final _clang_reparseTranslationUnitPtr = _lookup>( 'clang_reparseTranslationUnit'); late final _clang_reparseTranslationUnit = - _clang_reparseTranslationUnit_ptr.asFunction< + _clang_reparseTranslationUnitPtr.asFunction< int Function( CXTranslationUnit, int, ffi.Pointer, int)>(); @@ -1810,10 +1812,10 @@ class LibClang { ); } - late final _clang_getTUResourceUsageName_ptr = + late final _clang_getTUResourceUsageNamePtr = _lookup>( 'clang_getTUResourceUsageName'); - late final _clang_getTUResourceUsageName = _clang_getTUResourceUsageName_ptr + late final _clang_getTUResourceUsageName = _clang_getTUResourceUsageNamePtr .asFunction Function(int)>(); /// Return the memory usage of a translation unit. This object @@ -1826,10 +1828,10 @@ class LibClang { ); } - late final _clang_getCXTUResourceUsage_ptr = + late final _clang_getCXTUResourceUsagePtr = _lookup>( 'clang_getCXTUResourceUsage'); - late final _clang_getCXTUResourceUsage = _clang_getCXTUResourceUsage_ptr + late final _clang_getCXTUResourceUsage = _clang_getCXTUResourceUsagePtr .asFunction(); void clang_disposeCXTUResourceUsage( @@ -1840,11 +1842,11 @@ class LibClang { ); } - late final _clang_disposeCXTUResourceUsage_ptr = + late final _clang_disposeCXTUResourceUsagePtr = _lookup>( 'clang_disposeCXTUResourceUsage'); late final _clang_disposeCXTUResourceUsage = - _clang_disposeCXTUResourceUsage_ptr + _clang_disposeCXTUResourceUsagePtr .asFunction(); /// Get target information for this translation unit. @@ -1858,11 +1860,11 @@ class LibClang { ); } - late final _clang_getTranslationUnitTargetInfo_ptr = + late final _clang_getTranslationUnitTargetInfoPtr = _lookup>( 'clang_getTranslationUnitTargetInfo'); late final _clang_getTranslationUnitTargetInfo = - _clang_getTranslationUnitTargetInfo_ptr + _clang_getTranslationUnitTargetInfoPtr .asFunction(); /// Destroy the CXTargetInfo object. @@ -1874,11 +1876,11 @@ class LibClang { ); } - late final _clang_TargetInfo_dispose_ptr = + late final _clang_TargetInfo_disposePtr = _lookup>( 'clang_TargetInfo_dispose'); late final _clang_TargetInfo_dispose = - _clang_TargetInfo_dispose_ptr.asFunction(); + _clang_TargetInfo_disposePtr.asFunction(); /// Get the normalized target triple as a string. /// @@ -1891,10 +1893,10 @@ class LibClang { ); } - late final _clang_TargetInfo_getTriple_ptr = + late final _clang_TargetInfo_getTriplePtr = _lookup>( 'clang_TargetInfo_getTriple'); - late final _clang_TargetInfo_getTriple = _clang_TargetInfo_getTriple_ptr + late final _clang_TargetInfo_getTriple = _clang_TargetInfo_getTriplePtr .asFunction(); /// Get the pointer width of the target in bits. @@ -1908,11 +1910,11 @@ class LibClang { ); } - late final _clang_TargetInfo_getPointerWidth_ptr = + late final _clang_TargetInfo_getPointerWidthPtr = _lookup>( 'clang_TargetInfo_getPointerWidth'); late final _clang_TargetInfo_getPointerWidth = - _clang_TargetInfo_getPointerWidth_ptr + _clang_TargetInfo_getPointerWidthPtr .asFunction(); /// Retrieve the NULL cursor, which represents no entity. @@ -1920,11 +1922,11 @@ class LibClang { return _clang_getNullCursor(); } - late final _clang_getNullCursor_ptr = + late final _clang_getNullCursorPtr = _lookup>( 'clang_getNullCursor'); late final _clang_getNullCursor = - _clang_getNullCursor_ptr.asFunction(); + _clang_getNullCursorPtr.asFunction(); /// Retrieve the cursor that represents the given translation unit. /// @@ -1938,11 +1940,11 @@ class LibClang { ); } - late final _clang_getTranslationUnitCursor_ptr = + late final _clang_getTranslationUnitCursorPtr = _lookup>( 'clang_getTranslationUnitCursor'); late final _clang_getTranslationUnitCursor = - _clang_getTranslationUnitCursor_ptr + _clang_getTranslationUnitCursorPtr .asFunction(); /// Determine whether two cursors are equivalent. @@ -1956,11 +1958,11 @@ class LibClang { ); } - late final _clang_equalCursors_ptr = + late final _clang_equalCursorsPtr = _lookup>( 'clang_equalCursors'); late final _clang_equalCursors = - _clang_equalCursors_ptr.asFunction(); + _clang_equalCursorsPtr.asFunction(); /// Returns non-zero if \p cursor is null. int clang_Cursor_isNull( @@ -1971,11 +1973,11 @@ class LibClang { ); } - late final _clang_Cursor_isNull_ptr = + late final _clang_Cursor_isNullPtr = _lookup>( 'clang_Cursor_isNull'); late final _clang_Cursor_isNull = - _clang_Cursor_isNull_ptr.asFunction(); + _clang_Cursor_isNullPtr.asFunction(); /// Compute a hash value for the given cursor. int clang_hashCursor( @@ -1986,10 +1988,10 @@ class LibClang { ); } - late final _clang_hashCursor_ptr = + late final _clang_hashCursorPtr = _lookup>('clang_hashCursor'); late final _clang_hashCursor = - _clang_hashCursor_ptr.asFunction(); + _clang_hashCursorPtr.asFunction(); /// Retrieve the kind of the given cursor. int clang_getCursorKind( @@ -2000,11 +2002,11 @@ class LibClang { ); } - late final _clang_getCursorKind_ptr = + late final _clang_getCursorKindPtr = _lookup>( 'clang_getCursorKind'); late final _clang_getCursorKind = - _clang_getCursorKind_ptr.asFunction(); + _clang_getCursorKindPtr.asFunction(); /// Determine whether the given cursor kind represents a declaration. int clang_isDeclaration( @@ -2015,11 +2017,11 @@ class LibClang { ); } - late final _clang_isDeclaration_ptr = + late final _clang_isDeclarationPtr = _lookup>( 'clang_isDeclaration'); late final _clang_isDeclaration = - _clang_isDeclaration_ptr.asFunction(); + _clang_isDeclarationPtr.asFunction(); /// Determine whether the given declaration is invalid. /// @@ -2035,11 +2037,11 @@ class LibClang { ); } - late final _clang_isInvalidDeclaration_ptr = + late final _clang_isInvalidDeclarationPtr = _lookup>( 'clang_isInvalidDeclaration'); late final _clang_isInvalidDeclaration = - _clang_isInvalidDeclaration_ptr.asFunction(); + _clang_isInvalidDeclarationPtr.asFunction(); /// Determine whether the given cursor kind represents a simple /// reference. @@ -2055,11 +2057,11 @@ class LibClang { ); } - late final _clang_isReference_ptr = + late final _clang_isReferencePtr = _lookup>( 'clang_isReference'); late final _clang_isReference = - _clang_isReference_ptr.asFunction(); + _clang_isReferencePtr.asFunction(); /// Determine whether the given cursor kind represents an expression. int clang_isExpression( @@ -2070,11 +2072,11 @@ class LibClang { ); } - late final _clang_isExpression_ptr = + late final _clang_isExpressionPtr = _lookup>( 'clang_isExpression'); late final _clang_isExpression = - _clang_isExpression_ptr.asFunction(); + _clang_isExpressionPtr.asFunction(); /// Determine whether the given cursor kind represents a statement. int clang_isStatement( @@ -2085,11 +2087,11 @@ class LibClang { ); } - late final _clang_isStatement_ptr = + late final _clang_isStatementPtr = _lookup>( 'clang_isStatement'); late final _clang_isStatement = - _clang_isStatement_ptr.asFunction(); + _clang_isStatementPtr.asFunction(); /// Determine whether the given cursor kind represents an attribute. int clang_isAttribute( @@ -2100,11 +2102,11 @@ class LibClang { ); } - late final _clang_isAttribute_ptr = + late final _clang_isAttributePtr = _lookup>( 'clang_isAttribute'); late final _clang_isAttribute = - _clang_isAttribute_ptr.asFunction(); + _clang_isAttributePtr.asFunction(); /// Determine whether the given cursor has any attributes. int clang_Cursor_hasAttrs( @@ -2115,11 +2117,11 @@ class LibClang { ); } - late final _clang_Cursor_hasAttrs_ptr = + late final _clang_Cursor_hasAttrsPtr = _lookup>( 'clang_Cursor_hasAttrs'); late final _clang_Cursor_hasAttrs = - _clang_Cursor_hasAttrs_ptr.asFunction(); + _clang_Cursor_hasAttrsPtr.asFunction(); /// Determine whether the given cursor kind represents an invalid /// cursor. @@ -2131,10 +2133,10 @@ class LibClang { ); } - late final _clang_isInvalid_ptr = + late final _clang_isInvalidPtr = _lookup>('clang_isInvalid'); late final _clang_isInvalid = - _clang_isInvalid_ptr.asFunction(); + _clang_isInvalidPtr.asFunction(); /// Determine whether the given cursor kind represents a translation /// unit. @@ -2146,11 +2148,11 @@ class LibClang { ); } - late final _clang_isTranslationUnit_ptr = + late final _clang_isTranslationUnitPtr = _lookup>( 'clang_isTranslationUnit'); late final _clang_isTranslationUnit = - _clang_isTranslationUnit_ptr.asFunction(); + _clang_isTranslationUnitPtr.asFunction(); /// Determine whether the given cursor represents a preprocessing /// element, such as a preprocessor directive or macro instantiation. @@ -2162,11 +2164,11 @@ class LibClang { ); } - late final _clang_isPreprocessing_ptr = + late final _clang_isPreprocessingPtr = _lookup>( 'clang_isPreprocessing'); late final _clang_isPreprocessing = - _clang_isPreprocessing_ptr.asFunction(); + _clang_isPreprocessingPtr.asFunction(); /// Determine whether the given cursor represents a currently /// unexposed piece of the AST (e.g., CXCursor_UnexposedStmt). @@ -2178,11 +2180,11 @@ class LibClang { ); } - late final _clang_isUnexposed_ptr = + late final _clang_isUnexposedPtr = _lookup>( 'clang_isUnexposed'); late final _clang_isUnexposed = - _clang_isUnexposed_ptr.asFunction(); + _clang_isUnexposedPtr.asFunction(); /// Determine the linkage of the entity referred to by a given cursor. int clang_getCursorLinkage( @@ -2193,11 +2195,11 @@ class LibClang { ); } - late final _clang_getCursorLinkage_ptr = + late final _clang_getCursorLinkagePtr = _lookup>( 'clang_getCursorLinkage'); late final _clang_getCursorLinkage = - _clang_getCursorLinkage_ptr.asFunction(); + _clang_getCursorLinkagePtr.asFunction(); /// Describe the visibility of the entity referred to by a cursor. /// @@ -2216,11 +2218,11 @@ class LibClang { ); } - late final _clang_getCursorVisibility_ptr = + late final _clang_getCursorVisibilityPtr = _lookup>( 'clang_getCursorVisibility'); late final _clang_getCursorVisibility = - _clang_getCursorVisibility_ptr.asFunction(); + _clang_getCursorVisibilityPtr.asFunction(); /// Determine the availability of the entity that this cursor refers to, /// taking the current target platform into account. @@ -2236,11 +2238,11 @@ class LibClang { ); } - late final _clang_getCursorAvailability_ptr = + late final _clang_getCursorAvailabilityPtr = _lookup>( 'clang_getCursorAvailability'); late final _clang_getCursorAvailability = - _clang_getCursorAvailability_ptr.asFunction(); + _clang_getCursorAvailabilityPtr.asFunction(); /// Determine the availability of the entity that this cursor refers to /// on any platforms for which availability information is known. @@ -2296,11 +2298,11 @@ class LibClang { ); } - late final _clang_getCursorPlatformAvailability_ptr = + late final _clang_getCursorPlatformAvailabilityPtr = _lookup>( 'clang_getCursorPlatformAvailability'); late final _clang_getCursorPlatformAvailability = - _clang_getCursorPlatformAvailability_ptr.asFunction< + _clang_getCursorPlatformAvailabilityPtr.asFunction< int Function( CXCursor, ffi.Pointer, @@ -2319,11 +2321,11 @@ class LibClang { ); } - late final _clang_disposeCXPlatformAvailability_ptr = + late final _clang_disposeCXPlatformAvailabilityPtr = _lookup>( 'clang_disposeCXPlatformAvailability'); late final _clang_disposeCXPlatformAvailability = - _clang_disposeCXPlatformAvailability_ptr + _clang_disposeCXPlatformAvailabilityPtr .asFunction)>(); /// Determine the "language" of the entity referred to by a given cursor. @@ -2335,11 +2337,11 @@ class LibClang { ); } - late final _clang_getCursorLanguage_ptr = + late final _clang_getCursorLanguagePtr = _lookup>( 'clang_getCursorLanguage'); late final _clang_getCursorLanguage = - _clang_getCursorLanguage_ptr.asFunction(); + _clang_getCursorLanguagePtr.asFunction(); /// Determine the "thread-local storage (TLS) kind" of the declaration /// referred to by a cursor. @@ -2351,11 +2353,11 @@ class LibClang { ); } - late final _clang_getCursorTLSKind_ptr = + late final _clang_getCursorTLSKindPtr = _lookup>( 'clang_getCursorTLSKind'); late final _clang_getCursorTLSKind = - _clang_getCursorTLSKind_ptr.asFunction(); + _clang_getCursorTLSKindPtr.asFunction(); /// Returns the translation unit that a cursor originated from. CXTranslationUnit clang_Cursor_getTranslationUnit( @@ -2366,11 +2368,11 @@ class LibClang { ); } - late final _clang_Cursor_getTranslationUnit_ptr = + late final _clang_Cursor_getTranslationUnitPtr = _lookup>( 'clang_Cursor_getTranslationUnit'); late final _clang_Cursor_getTranslationUnit = - _clang_Cursor_getTranslationUnit_ptr + _clang_Cursor_getTranslationUnitPtr .asFunction(); /// Creates an empty CXCursorSet. @@ -2378,11 +2380,11 @@ class LibClang { return _clang_createCXCursorSet(); } - late final _clang_createCXCursorSet_ptr = + late final _clang_createCXCursorSetPtr = _lookup>( 'clang_createCXCursorSet'); late final _clang_createCXCursorSet = - _clang_createCXCursorSet_ptr.asFunction(); + _clang_createCXCursorSetPtr.asFunction(); /// Disposes a CXCursorSet and releases its associated memory. void clang_disposeCXCursorSet( @@ -2393,11 +2395,11 @@ class LibClang { ); } - late final _clang_disposeCXCursorSet_ptr = + late final _clang_disposeCXCursorSetPtr = _lookup>( 'clang_disposeCXCursorSet'); late final _clang_disposeCXCursorSet = - _clang_disposeCXCursorSet_ptr.asFunction(); + _clang_disposeCXCursorSetPtr.asFunction(); /// Queries a CXCursorSet to see if it contains a specific CXCursor. /// @@ -2412,10 +2414,10 @@ class LibClang { ); } - late final _clang_CXCursorSet_contains_ptr = + late final _clang_CXCursorSet_containsPtr = _lookup>( 'clang_CXCursorSet_contains'); - late final _clang_CXCursorSet_contains = _clang_CXCursorSet_contains_ptr + late final _clang_CXCursorSet_contains = _clang_CXCursorSet_containsPtr .asFunction(); /// Inserts a CXCursor into a CXCursorSet. @@ -2431,10 +2433,10 @@ class LibClang { ); } - late final _clang_CXCursorSet_insert_ptr = + late final _clang_CXCursorSet_insertPtr = _lookup>( 'clang_CXCursorSet_insert'); - late final _clang_CXCursorSet_insert = _clang_CXCursorSet_insert_ptr + late final _clang_CXCursorSet_insert = _clang_CXCursorSet_insertPtr .asFunction(); /// Determine the semantic parent of the given cursor. @@ -2476,10 +2478,10 @@ class LibClang { ); } - late final _clang_getCursorSemanticParent_ptr = + late final _clang_getCursorSemanticParentPtr = _lookup>( 'clang_getCursorSemanticParent'); - late final _clang_getCursorSemanticParent = _clang_getCursorSemanticParent_ptr + late final _clang_getCursorSemanticParent = _clang_getCursorSemanticParentPtr .asFunction(); /// Determine the lexical parent of the given cursor. @@ -2522,10 +2524,10 @@ class LibClang { ); } - late final _clang_getCursorLexicalParent_ptr = + late final _clang_getCursorLexicalParentPtr = _lookup>( 'clang_getCursorLexicalParent'); - late final _clang_getCursorLexicalParent = _clang_getCursorLexicalParent_ptr + late final _clang_getCursorLexicalParent = _clang_getCursorLexicalParentPtr .asFunction(); /// Determine the set of methods that are overridden by the given @@ -2581,11 +2583,11 @@ class LibClang { ); } - late final _clang_getOverriddenCursors_ptr = + late final _clang_getOverriddenCursorsPtr = _lookup>( 'clang_getOverriddenCursors'); late final _clang_getOverriddenCursors = - _clang_getOverriddenCursors_ptr.asFunction< + _clang_getOverriddenCursorsPtr.asFunction< void Function(CXCursor, ffi.Pointer>, ffi.Pointer)>(); @@ -2599,11 +2601,11 @@ class LibClang { ); } - late final _clang_disposeOverriddenCursors_ptr = + late final _clang_disposeOverriddenCursorsPtr = _lookup>( 'clang_disposeOverriddenCursors'); late final _clang_disposeOverriddenCursors = - _clang_disposeOverriddenCursors_ptr + _clang_disposeOverriddenCursorsPtr .asFunction)>(); /// Retrieve the file that is included by the given inclusion directive @@ -2616,11 +2618,11 @@ class LibClang { ); } - late final _clang_getIncludedFile_ptr = + late final _clang_getIncludedFilePtr = _lookup>( 'clang_getIncludedFile'); late final _clang_getIncludedFile = - _clang_getIncludedFile_ptr.asFunction(); + _clang_getIncludedFilePtr.asFunction(); /// Map a source location to the cursor that describes the entity at that /// location in the source code. @@ -2645,9 +2647,9 @@ class LibClang { ); } - late final _clang_getCursor_ptr = + late final _clang_getCursorPtr = _lookup>('clang_getCursor'); - late final _clang_getCursor = _clang_getCursor_ptr + late final _clang_getCursor = _clang_getCursorPtr .asFunction(); /// Retrieve the physical location of the source constructor referenced @@ -2666,10 +2668,10 @@ class LibClang { ); } - late final _clang_getCursorLocation_ptr = + late final _clang_getCursorLocationPtr = _lookup>( 'clang_getCursorLocation'); - late final _clang_getCursorLocation = _clang_getCursorLocation_ptr + late final _clang_getCursorLocation = _clang_getCursorLocationPtr .asFunction(); /// Retrieve the physical extent of the source construct referenced by @@ -2689,11 +2691,11 @@ class LibClang { ); } - late final _clang_getCursorExtent_ptr = + late final _clang_getCursorExtentPtr = _lookup>( 'clang_getCursorExtent'); late final _clang_getCursorExtent = - _clang_getCursorExtent_ptr.asFunction(); + _clang_getCursorExtentPtr.asFunction(); /// Retrieve the type of a CXCursor (if any). CXType clang_getCursorType( @@ -2704,11 +2706,11 @@ class LibClang { ); } - late final _clang_getCursorType_ptr = + late final _clang_getCursorTypePtr = _lookup>( 'clang_getCursorType'); late final _clang_getCursorType = - _clang_getCursorType_ptr.asFunction(); + _clang_getCursorTypePtr.asFunction(); /// Pretty-print the underlying type using the rules of the /// language of the translation unit from which it came. @@ -2722,11 +2724,11 @@ class LibClang { ); } - late final _clang_getTypeSpelling_ptr = + late final _clang_getTypeSpellingPtr = _lookup>( 'clang_getTypeSpelling'); late final _clang_getTypeSpelling = - _clang_getTypeSpelling_ptr.asFunction(); + _clang_getTypeSpellingPtr.asFunction(); /// Retrieve the underlying type of a typedef declaration. /// @@ -2740,11 +2742,11 @@ class LibClang { ); } - late final _clang_getTypedefDeclUnderlyingType_ptr = + late final _clang_getTypedefDeclUnderlyingTypePtr = _lookup>( 'clang_getTypedefDeclUnderlyingType'); late final _clang_getTypedefDeclUnderlyingType = - _clang_getTypedefDeclUnderlyingType_ptr + _clang_getTypedefDeclUnderlyingTypePtr .asFunction(); /// Retrieve the integer type of an enum declaration. @@ -2759,11 +2761,11 @@ class LibClang { ); } - late final _clang_getEnumDeclIntegerType_ptr = + late final _clang_getEnumDeclIntegerTypePtr = _lookup>( 'clang_getEnumDeclIntegerType'); late final _clang_getEnumDeclIntegerType = - _clang_getEnumDeclIntegerType_ptr.asFunction(); + _clang_getEnumDeclIntegerTypePtr.asFunction(); /// Retrieve the integer value of an enum constant declaration as a signed /// long long. @@ -2779,11 +2781,11 @@ class LibClang { ); } - late final _clang_getEnumConstantDeclValue_ptr = + late final _clang_getEnumConstantDeclValuePtr = _lookup>( 'clang_getEnumConstantDeclValue'); late final _clang_getEnumConstantDeclValue = - _clang_getEnumConstantDeclValue_ptr.asFunction(); + _clang_getEnumConstantDeclValuePtr.asFunction(); /// Retrieve the integer value of an enum constant declaration as an unsigned /// long long. @@ -2799,11 +2801,11 @@ class LibClang { ); } - late final _clang_getEnumConstantDeclUnsignedValue_ptr = _lookup< + late final _clang_getEnumConstantDeclUnsignedValuePtr = _lookup< ffi.NativeFunction>( 'clang_getEnumConstantDeclUnsignedValue'); late final _clang_getEnumConstantDeclUnsignedValue = - _clang_getEnumConstantDeclUnsignedValue_ptr + _clang_getEnumConstantDeclUnsignedValuePtr .asFunction(); /// Retrieve the bit width of a bit field declaration as an integer. @@ -2817,11 +2819,11 @@ class LibClang { ); } - late final _clang_getFieldDeclBitWidth_ptr = + late final _clang_getFieldDeclBitWidthPtr = _lookup>( 'clang_getFieldDeclBitWidth'); late final _clang_getFieldDeclBitWidth = - _clang_getFieldDeclBitWidth_ptr.asFunction(); + _clang_getFieldDeclBitWidthPtr.asFunction(); /// Retrieve the number of non-variadic arguments associated with a given /// cursor. @@ -2836,11 +2838,11 @@ class LibClang { ); } - late final _clang_Cursor_getNumArguments_ptr = + late final _clang_Cursor_getNumArgumentsPtr = _lookup>( 'clang_Cursor_getNumArguments'); late final _clang_Cursor_getNumArguments = - _clang_Cursor_getNumArguments_ptr.asFunction(); + _clang_Cursor_getNumArgumentsPtr.asFunction(); /// Retrieve the argument cursor of a function or method. /// @@ -2857,10 +2859,10 @@ class LibClang { ); } - late final _clang_Cursor_getArgument_ptr = + late final _clang_Cursor_getArgumentPtr = _lookup>( 'clang_Cursor_getArgument'); - late final _clang_Cursor_getArgument = _clang_Cursor_getArgument_ptr + late final _clang_Cursor_getArgument = _clang_Cursor_getArgumentPtr .asFunction(); /// Returns the number of template args of a function decl representing a @@ -2885,11 +2887,11 @@ class LibClang { ); } - late final _clang_Cursor_getNumTemplateArguments_ptr = + late final _clang_Cursor_getNumTemplateArgumentsPtr = _lookup>( 'clang_Cursor_getNumTemplateArguments'); late final _clang_Cursor_getNumTemplateArguments = - _clang_Cursor_getNumTemplateArguments_ptr + _clang_Cursor_getNumTemplateArgumentsPtr .asFunction(); /// Retrieve the kind of the I'th template argument of the CXCursor C. @@ -2916,11 +2918,11 @@ class LibClang { ); } - late final _clang_Cursor_getTemplateArgumentKind_ptr = + late final _clang_Cursor_getTemplateArgumentKindPtr = _lookup>( 'clang_Cursor_getTemplateArgumentKind'); late final _clang_Cursor_getTemplateArgumentKind = - _clang_Cursor_getTemplateArgumentKind_ptr + _clang_Cursor_getTemplateArgumentKindPtr .asFunction(); /// Retrieve a CXType representing the type of a TemplateArgument of a @@ -2949,11 +2951,11 @@ class LibClang { ); } - late final _clang_Cursor_getTemplateArgumentType_ptr = + late final _clang_Cursor_getTemplateArgumentTypePtr = _lookup>( 'clang_Cursor_getTemplateArgumentType'); late final _clang_Cursor_getTemplateArgumentType = - _clang_Cursor_getTemplateArgumentType_ptr + _clang_Cursor_getTemplateArgumentTypePtr .asFunction(); /// Retrieve the value of an Integral TemplateArgument (of a function @@ -2981,11 +2983,11 @@ class LibClang { ); } - late final _clang_Cursor_getTemplateArgumentValue_ptr = + late final _clang_Cursor_getTemplateArgumentValuePtr = _lookup>( 'clang_Cursor_getTemplateArgumentValue'); late final _clang_Cursor_getTemplateArgumentValue = - _clang_Cursor_getTemplateArgumentValue_ptr + _clang_Cursor_getTemplateArgumentValuePtr .asFunction(); /// Retrieve the value of an Integral TemplateArgument (of a function @@ -3013,12 +3015,12 @@ class LibClang { ); } - late final _clang_Cursor_getTemplateArgumentUnsignedValue_ptr = _lookup< + late final _clang_Cursor_getTemplateArgumentUnsignedValuePtr = _lookup< ffi.NativeFunction< Native_clang_Cursor_getTemplateArgumentUnsignedValue>>( 'clang_Cursor_getTemplateArgumentUnsignedValue'); late final _clang_Cursor_getTemplateArgumentUnsignedValue = - _clang_Cursor_getTemplateArgumentUnsignedValue_ptr + _clang_Cursor_getTemplateArgumentUnsignedValuePtr .asFunction(); /// Determine whether two CXTypes represent the same type. @@ -3035,10 +3037,10 @@ class LibClang { ); } - late final _clang_equalTypes_ptr = + late final _clang_equalTypesPtr = _lookup>('clang_equalTypes'); late final _clang_equalTypes = - _clang_equalTypes_ptr.asFunction(); + _clang_equalTypesPtr.asFunction(); /// Return the canonical type for a CXType. /// @@ -3054,11 +3056,11 @@ class LibClang { ); } - late final _clang_getCanonicalType_ptr = + late final _clang_getCanonicalTypePtr = _lookup>( 'clang_getCanonicalType'); late final _clang_getCanonicalType = - _clang_getCanonicalType_ptr.asFunction(); + _clang_getCanonicalTypePtr.asFunction(); /// Determine whether a CXType has the "const" qualifier set, /// without looking through typedefs that may have added "const" at a @@ -3071,11 +3073,11 @@ class LibClang { ); } - late final _clang_isConstQualifiedType_ptr = + late final _clang_isConstQualifiedTypePtr = _lookup>( 'clang_isConstQualifiedType'); late final _clang_isConstQualifiedType = - _clang_isConstQualifiedType_ptr.asFunction(); + _clang_isConstQualifiedTypePtr.asFunction(); /// Determine whether a CXCursor that is a macro, is /// function like. @@ -3087,12 +3089,11 @@ class LibClang { ); } - late final _clang_Cursor_isMacroFunctionLike_ptr = + late final _clang_Cursor_isMacroFunctionLikePtr = _lookup>( 'clang_Cursor_isMacroFunctionLike'); late final _clang_Cursor_isMacroFunctionLike = - _clang_Cursor_isMacroFunctionLike_ptr - .asFunction(); + _clang_Cursor_isMacroFunctionLikePtr.asFunction(); /// Determine whether a CXCursor that is a macro, is a /// builtin one. @@ -3104,11 +3105,11 @@ class LibClang { ); } - late final _clang_Cursor_isMacroBuiltin_ptr = + late final _clang_Cursor_isMacroBuiltinPtr = _lookup>( 'clang_Cursor_isMacroBuiltin'); late final _clang_Cursor_isMacroBuiltin = - _clang_Cursor_isMacroBuiltin_ptr.asFunction(); + _clang_Cursor_isMacroBuiltinPtr.asFunction(); /// Determine whether a CXCursor that is a function declaration, is an /// inline declaration. @@ -3120,11 +3121,11 @@ class LibClang { ); } - late final _clang_Cursor_isFunctionInlined_ptr = + late final _clang_Cursor_isFunctionInlinedPtr = _lookup>( 'clang_Cursor_isFunctionInlined'); late final _clang_Cursor_isFunctionInlined = - _clang_Cursor_isFunctionInlined_ptr.asFunction(); + _clang_Cursor_isFunctionInlinedPtr.asFunction(); /// Determine whether a CXType has the "volatile" qualifier set, /// without looking through typedefs that may have added "volatile" at @@ -3137,11 +3138,11 @@ class LibClang { ); } - late final _clang_isVolatileQualifiedType_ptr = + late final _clang_isVolatileQualifiedTypePtr = _lookup>( 'clang_isVolatileQualifiedType'); late final _clang_isVolatileQualifiedType = - _clang_isVolatileQualifiedType_ptr.asFunction(); + _clang_isVolatileQualifiedTypePtr.asFunction(); /// Determine whether a CXType has the "restrict" qualifier set, /// without looking through typedefs that may have added "restrict" at a @@ -3154,11 +3155,11 @@ class LibClang { ); } - late final _clang_isRestrictQualifiedType_ptr = + late final _clang_isRestrictQualifiedTypePtr = _lookup>( 'clang_isRestrictQualifiedType'); late final _clang_isRestrictQualifiedType = - _clang_isRestrictQualifiedType_ptr.asFunction(); + _clang_isRestrictQualifiedTypePtr.asFunction(); /// Returns the address space of the given type. int clang_getAddressSpace( @@ -3169,11 +3170,11 @@ class LibClang { ); } - late final _clang_getAddressSpace_ptr = + late final _clang_getAddressSpacePtr = _lookup>( 'clang_getAddressSpace'); late final _clang_getAddressSpace = - _clang_getAddressSpace_ptr.asFunction(); + _clang_getAddressSpacePtr.asFunction(); /// Returns the typedef name of the given type. CXString clang_getTypedefName( @@ -3184,11 +3185,11 @@ class LibClang { ); } - late final _clang_getTypedefName_ptr = + late final _clang_getTypedefNamePtr = _lookup>( 'clang_getTypedefName'); late final _clang_getTypedefName = - _clang_getTypedefName_ptr.asFunction(); + _clang_getTypedefNamePtr.asFunction(); /// For pointer types, returns the type of the pointee. CXType clang_getPointeeType( @@ -3199,11 +3200,11 @@ class LibClang { ); } - late final _clang_getPointeeType_ptr = + late final _clang_getPointeeTypePtr = _lookup>( 'clang_getPointeeType'); late final _clang_getPointeeType = - _clang_getPointeeType_ptr.asFunction(); + _clang_getPointeeTypePtr.asFunction(); /// Return the cursor for the declaration of the given type. CXCursor clang_getTypeDeclaration( @@ -3214,11 +3215,11 @@ class LibClang { ); } - late final _clang_getTypeDeclaration_ptr = + late final _clang_getTypeDeclarationPtr = _lookup>( 'clang_getTypeDeclaration'); late final _clang_getTypeDeclaration = - _clang_getTypeDeclaration_ptr.asFunction(); + _clang_getTypeDeclarationPtr.asFunction(); /// Returns the Objective-C type encoding for the specified declaration. CXString clang_getDeclObjCTypeEncoding( @@ -3229,10 +3230,10 @@ class LibClang { ); } - late final _clang_getDeclObjCTypeEncoding_ptr = + late final _clang_getDeclObjCTypeEncodingPtr = _lookup>( 'clang_getDeclObjCTypeEncoding'); - late final _clang_getDeclObjCTypeEncoding = _clang_getDeclObjCTypeEncoding_ptr + late final _clang_getDeclObjCTypeEncoding = _clang_getDeclObjCTypeEncodingPtr .asFunction(); /// Returns the Objective-C type encoding for the specified CXType. @@ -3244,11 +3245,11 @@ class LibClang { ); } - late final _clang_Type_getObjCEncoding_ptr = + late final _clang_Type_getObjCEncodingPtr = _lookup>( 'clang_Type_getObjCEncoding'); late final _clang_Type_getObjCEncoding = - _clang_Type_getObjCEncoding_ptr.asFunction(); + _clang_Type_getObjCEncodingPtr.asFunction(); /// Retrieve the spelling of a given CXTypeKind. CXString clang_getTypeKindSpelling( @@ -3259,11 +3260,11 @@ class LibClang { ); } - late final _clang_getTypeKindSpelling_ptr = + late final _clang_getTypeKindSpellingPtr = _lookup>( 'clang_getTypeKindSpelling'); late final _clang_getTypeKindSpelling = - _clang_getTypeKindSpelling_ptr.asFunction(); + _clang_getTypeKindSpellingPtr.asFunction(); /// Retrieve the calling convention associated with a function type. /// @@ -3276,11 +3277,11 @@ class LibClang { ); } - late final _clang_getFunctionTypeCallingConv_ptr = + late final _clang_getFunctionTypeCallingConvPtr = _lookup>( 'clang_getFunctionTypeCallingConv'); late final _clang_getFunctionTypeCallingConv = - _clang_getFunctionTypeCallingConv_ptr.asFunction(); + _clang_getFunctionTypeCallingConvPtr.asFunction(); /// Retrieve the return type associated with a function type. /// @@ -3293,11 +3294,11 @@ class LibClang { ); } - late final _clang_getResultType_ptr = + late final _clang_getResultTypePtr = _lookup>( 'clang_getResultType'); late final _clang_getResultType = - _clang_getResultType_ptr.asFunction(); + _clang_getResultTypePtr.asFunction(); /// Retrieve the exception specification type associated with a function type. /// This is a value of type CXCursor_ExceptionSpecificationKind. @@ -3311,11 +3312,11 @@ class LibClang { ); } - late final _clang_getExceptionSpecificationType_ptr = + late final _clang_getExceptionSpecificationTypePtr = _lookup>( 'clang_getExceptionSpecificationType'); late final _clang_getExceptionSpecificationType = - _clang_getExceptionSpecificationType_ptr + _clang_getExceptionSpecificationTypePtr .asFunction(); /// Retrieve the number of non-variadic parameters associated with a @@ -3330,11 +3331,11 @@ class LibClang { ); } - late final _clang_getNumArgTypes_ptr = + late final _clang_getNumArgTypesPtr = _lookup>( 'clang_getNumArgTypes'); late final _clang_getNumArgTypes = - _clang_getNumArgTypes_ptr.asFunction(); + _clang_getNumArgTypesPtr.asFunction(); /// Retrieve the type of a parameter of a function type. /// @@ -3350,10 +3351,10 @@ class LibClang { ); } - late final _clang_getArgType_ptr = + late final _clang_getArgTypePtr = _lookup>('clang_getArgType'); late final _clang_getArgType = - _clang_getArgType_ptr.asFunction(); + _clang_getArgTypePtr.asFunction(); /// Retrieves the base type of the ObjCObjectType. /// @@ -3366,11 +3367,11 @@ class LibClang { ); } - late final _clang_Type_getObjCObjectBaseType_ptr = + late final _clang_Type_getObjCObjectBaseTypePtr = _lookup>( 'clang_Type_getObjCObjectBaseType'); late final _clang_Type_getObjCObjectBaseType = - _clang_Type_getObjCObjectBaseType_ptr + _clang_Type_getObjCObjectBaseTypePtr .asFunction(); /// Retrieve the number of protocol references associated with an ObjC object/id. @@ -3384,11 +3385,11 @@ class LibClang { ); } - late final _clang_Type_getNumObjCProtocolRefs_ptr = + late final _clang_Type_getNumObjCProtocolRefsPtr = _lookup>( 'clang_Type_getNumObjCProtocolRefs'); late final _clang_Type_getNumObjCProtocolRefs = - _clang_Type_getNumObjCProtocolRefs_ptr.asFunction(); + _clang_Type_getNumObjCProtocolRefsPtr.asFunction(); /// Retrieve the decl for a protocol reference for an ObjC object/id. /// @@ -3404,11 +3405,11 @@ class LibClang { ); } - late final _clang_Type_getObjCProtocolDecl_ptr = + late final _clang_Type_getObjCProtocolDeclPtr = _lookup>( 'clang_Type_getObjCProtocolDecl'); late final _clang_Type_getObjCProtocolDecl = - _clang_Type_getObjCProtocolDecl_ptr + _clang_Type_getObjCProtocolDeclPtr .asFunction(); /// Retreive the number of type arguments associated with an ObjC object. @@ -3422,11 +3423,11 @@ class LibClang { ); } - late final _clang_Type_getNumObjCTypeArgs_ptr = + late final _clang_Type_getNumObjCTypeArgsPtr = _lookup>( 'clang_Type_getNumObjCTypeArgs'); late final _clang_Type_getNumObjCTypeArgs = - _clang_Type_getNumObjCTypeArgs_ptr.asFunction(); + _clang_Type_getNumObjCTypeArgsPtr.asFunction(); /// Retrieve a type argument associated with an ObjC object. /// @@ -3442,11 +3443,11 @@ class LibClang { ); } - late final _clang_Type_getObjCTypeArg_ptr = + late final _clang_Type_getObjCTypeArgPtr = _lookup>( 'clang_Type_getObjCTypeArg'); late final _clang_Type_getObjCTypeArg = - _clang_Type_getObjCTypeArg_ptr.asFunction(); + _clang_Type_getObjCTypeArgPtr.asFunction(); /// Return 1 if the CXType is a variadic function type, and 0 otherwise. int clang_isFunctionTypeVariadic( @@ -3457,11 +3458,11 @@ class LibClang { ); } - late final _clang_isFunctionTypeVariadic_ptr = + late final _clang_isFunctionTypeVariadicPtr = _lookup>( 'clang_isFunctionTypeVariadic'); late final _clang_isFunctionTypeVariadic = - _clang_isFunctionTypeVariadic_ptr.asFunction(); + _clang_isFunctionTypeVariadicPtr.asFunction(); /// Retrieve the return type associated with a given cursor. /// @@ -3474,11 +3475,11 @@ class LibClang { ); } - late final _clang_getCursorResultType_ptr = + late final _clang_getCursorResultTypePtr = _lookup>( 'clang_getCursorResultType'); late final _clang_getCursorResultType = - _clang_getCursorResultType_ptr.asFunction(); + _clang_getCursorResultTypePtr.asFunction(); /// Retrieve the exception specification type associated with a given cursor. /// This is a value of type CXCursor_ExceptionSpecificationKind. @@ -3492,11 +3493,11 @@ class LibClang { ); } - late final _clang_getCursorExceptionSpecificationType_ptr = _lookup< + late final _clang_getCursorExceptionSpecificationTypePtr = _lookup< ffi.NativeFunction>( 'clang_getCursorExceptionSpecificationType'); late final _clang_getCursorExceptionSpecificationType = - _clang_getCursorExceptionSpecificationType_ptr + _clang_getCursorExceptionSpecificationTypePtr .asFunction(); /// Return 1 if the CXType is a POD (plain old data) type, and 0 @@ -3509,10 +3510,10 @@ class LibClang { ); } - late final _clang_isPODType_ptr = + late final _clang_isPODTypePtr = _lookup>('clang_isPODType'); late final _clang_isPODType = - _clang_isPODType_ptr.asFunction(); + _clang_isPODTypePtr.asFunction(); /// Return the element type of an array, complex, or vector type. /// @@ -3526,11 +3527,11 @@ class LibClang { ); } - late final _clang_getElementType_ptr = + late final _clang_getElementTypePtr = _lookup>( 'clang_getElementType'); late final _clang_getElementType = - _clang_getElementType_ptr.asFunction(); + _clang_getElementTypePtr.asFunction(); /// Return the number of elements of an array or vector type. /// @@ -3544,11 +3545,11 @@ class LibClang { ); } - late final _clang_getNumElements_ptr = + late final _clang_getNumElementsPtr = _lookup>( 'clang_getNumElements'); late final _clang_getNumElements = - _clang_getNumElements_ptr.asFunction(); + _clang_getNumElementsPtr.asFunction(); /// Return the element type of an array type. /// @@ -3561,11 +3562,11 @@ class LibClang { ); } - late final _clang_getArrayElementType_ptr = + late final _clang_getArrayElementTypePtr = _lookup>( 'clang_getArrayElementType'); late final _clang_getArrayElementType = - _clang_getArrayElementType_ptr.asFunction(); + _clang_getArrayElementTypePtr.asFunction(); /// Return the array size of a constant array. /// @@ -3578,11 +3579,11 @@ class LibClang { ); } - late final _clang_getArraySize_ptr = + late final _clang_getArraySizePtr = _lookup>( 'clang_getArraySize'); late final _clang_getArraySize = - _clang_getArraySize_ptr.asFunction(); + _clang_getArraySizePtr.asFunction(); /// Retrieve the type named by the qualified-id. /// @@ -3595,11 +3596,11 @@ class LibClang { ); } - late final _clang_Type_getNamedType_ptr = + late final _clang_Type_getNamedTypePtr = _lookup>( 'clang_Type_getNamedType'); late final _clang_Type_getNamedType = - _clang_Type_getNamedType_ptr.asFunction(); + _clang_Type_getNamedTypePtr.asFunction(); /// Determine if a typedef is 'transparent' tag. /// @@ -3615,12 +3616,11 @@ class LibClang { ); } - late final _clang_Type_isTransparentTagTypedef_ptr = + late final _clang_Type_isTransparentTagTypedefPtr = _lookup>( 'clang_Type_isTransparentTagTypedef'); late final _clang_Type_isTransparentTagTypedef = - _clang_Type_isTransparentTagTypedef_ptr - .asFunction(); + _clang_Type_isTransparentTagTypedefPtr.asFunction(); /// Retrieve the nullability kind of a pointer type. int clang_Type_getNullability( @@ -3631,11 +3631,11 @@ class LibClang { ); } - late final _clang_Type_getNullability_ptr = + late final _clang_Type_getNullabilityPtr = _lookup>( 'clang_Type_getNullability'); late final _clang_Type_getNullability = - _clang_Type_getNullability_ptr.asFunction(); + _clang_Type_getNullabilityPtr.asFunction(); /// Return the alignment of a type in bytes as per C++[expr.alignof] /// standard. @@ -3655,11 +3655,11 @@ class LibClang { ); } - late final _clang_Type_getAlignOf_ptr = + late final _clang_Type_getAlignOfPtr = _lookup>( 'clang_Type_getAlignOf'); late final _clang_Type_getAlignOf = - _clang_Type_getAlignOf_ptr.asFunction(); + _clang_Type_getAlignOfPtr.asFunction(); /// Return the class type of an member pointer type. /// @@ -3672,11 +3672,11 @@ class LibClang { ); } - late final _clang_Type_getClassType_ptr = + late final _clang_Type_getClassTypePtr = _lookup>( 'clang_Type_getClassType'); late final _clang_Type_getClassType = - _clang_Type_getClassType_ptr.asFunction(); + _clang_Type_getClassTypePtr.asFunction(); /// Return the size of a type in bytes as per C++[expr.sizeof] standard. /// @@ -3693,11 +3693,11 @@ class LibClang { ); } - late final _clang_Type_getSizeOf_ptr = + late final _clang_Type_getSizeOfPtr = _lookup>( 'clang_Type_getSizeOf'); late final _clang_Type_getSizeOf = - _clang_Type_getSizeOf_ptr.asFunction(); + _clang_Type_getSizeOfPtr.asFunction(); /// 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] @@ -3720,10 +3720,10 @@ class LibClang { ); } - late final _clang_Type_getOffsetOf_ptr = + late final _clang_Type_getOffsetOfPtr = _lookup>( 'clang_Type_getOffsetOf'); - late final _clang_Type_getOffsetOf = _clang_Type_getOffsetOf_ptr + late final _clang_Type_getOffsetOf = _clang_Type_getOffsetOfPtr .asFunction)>(); /// Return the type that was modified by this attributed type. @@ -3737,11 +3737,11 @@ class LibClang { ); } - late final _clang_Type_getModifiedType_ptr = + late final _clang_Type_getModifiedTypePtr = _lookup>( 'clang_Type_getModifiedType'); late final _clang_Type_getModifiedType = - _clang_Type_getModifiedType_ptr.asFunction(); + _clang_Type_getModifiedTypePtr.asFunction(); /// Return the offset of the field represented by the Cursor. /// @@ -3762,11 +3762,11 @@ class LibClang { ); } - late final _clang_Cursor_getOffsetOfField_ptr = + late final _clang_Cursor_getOffsetOfFieldPtr = _lookup>( 'clang_Cursor_getOffsetOfField'); late final _clang_Cursor_getOffsetOfField = - _clang_Cursor_getOffsetOfField_ptr.asFunction(); + _clang_Cursor_getOffsetOfFieldPtr.asFunction(); /// Determine whether the given cursor represents an anonymous /// tag or namespace @@ -3778,11 +3778,11 @@ class LibClang { ); } - late final _clang_Cursor_isAnonymous_ptr = + late final _clang_Cursor_isAnonymousPtr = _lookup>( 'clang_Cursor_isAnonymous'); late final _clang_Cursor_isAnonymous = - _clang_Cursor_isAnonymous_ptr.asFunction(); + _clang_Cursor_isAnonymousPtr.asFunction(); /// Determine whether the given cursor represents an anonymous record /// declaration. @@ -3794,11 +3794,11 @@ class LibClang { ); } - late final _clang_Cursor_isAnonymousRecordDecl_ptr = + late final _clang_Cursor_isAnonymousRecordDeclPtr = _lookup>( 'clang_Cursor_isAnonymousRecordDecl'); late final _clang_Cursor_isAnonymousRecordDecl = - _clang_Cursor_isAnonymousRecordDecl_ptr + _clang_Cursor_isAnonymousRecordDeclPtr .asFunction(); /// Determine whether the given cursor represents an inline namespace @@ -3811,11 +3811,11 @@ class LibClang { ); } - late final _clang_Cursor_isInlineNamespace_ptr = + late final _clang_Cursor_isInlineNamespacePtr = _lookup>( 'clang_Cursor_isInlineNamespace'); late final _clang_Cursor_isInlineNamespace = - _clang_Cursor_isInlineNamespace_ptr.asFunction(); + _clang_Cursor_isInlineNamespacePtr.asFunction(); /// Returns the number of template arguments for given template /// specialization, or -1 if type \c T is not a template specialization. @@ -3827,12 +3827,11 @@ class LibClang { ); } - late final _clang_Type_getNumTemplateArguments_ptr = + late final _clang_Type_getNumTemplateArgumentsPtr = _lookup>( 'clang_Type_getNumTemplateArguments'); late final _clang_Type_getNumTemplateArguments = - _clang_Type_getNumTemplateArguments_ptr - .asFunction(); + _clang_Type_getNumTemplateArgumentsPtr.asFunction(); /// Returns the type template argument of a template class specialization /// at given index. @@ -3849,11 +3848,11 @@ class LibClang { ); } - late final _clang_Type_getTemplateArgumentAsType_ptr = + late final _clang_Type_getTemplateArgumentAsTypePtr = _lookup>( 'clang_Type_getTemplateArgumentAsType'); late final _clang_Type_getTemplateArgumentAsType = - _clang_Type_getTemplateArgumentAsType_ptr + _clang_Type_getTemplateArgumentAsTypePtr .asFunction(); /// Retrieve the ref-qualifier kind of a function or method. @@ -3868,11 +3867,11 @@ class LibClang { ); } - late final _clang_Type_getCXXRefQualifier_ptr = + late final _clang_Type_getCXXRefQualifierPtr = _lookup>( 'clang_Type_getCXXRefQualifier'); late final _clang_Type_getCXXRefQualifier = - _clang_Type_getCXXRefQualifier_ptr.asFunction(); + _clang_Type_getCXXRefQualifierPtr.asFunction(); /// Returns non-zero if the cursor specifies a Record member that is a /// bitfield. @@ -3884,11 +3883,11 @@ class LibClang { ); } - late final _clang_Cursor_isBitField_ptr = + late final _clang_Cursor_isBitFieldPtr = _lookup>( 'clang_Cursor_isBitField'); late final _clang_Cursor_isBitField = - _clang_Cursor_isBitField_ptr.asFunction(); + _clang_Cursor_isBitFieldPtr.asFunction(); /// Returns 1 if the base class specified by the cursor with kind /// CX_CXXBaseSpecifier is virtual. @@ -3900,11 +3899,11 @@ class LibClang { ); } - late final _clang_isVirtualBase_ptr = + late final _clang_isVirtualBasePtr = _lookup>( 'clang_isVirtualBase'); late final _clang_isVirtualBase = - _clang_isVirtualBase_ptr.asFunction(); + _clang_isVirtualBasePtr.asFunction(); /// Returns the access control level for the referenced object. /// @@ -3919,11 +3918,11 @@ class LibClang { ); } - late final _clang_getCXXAccessSpecifier_ptr = + late final _clang_getCXXAccessSpecifierPtr = _lookup>( 'clang_getCXXAccessSpecifier'); late final _clang_getCXXAccessSpecifier = - _clang_getCXXAccessSpecifier_ptr.asFunction(); + _clang_getCXXAccessSpecifierPtr.asFunction(); /// Returns the storage class for a function or variable declaration. /// @@ -3937,11 +3936,11 @@ class LibClang { ); } - late final _clang_Cursor_getStorageClass_ptr = + late final _clang_Cursor_getStorageClassPtr = _lookup>( 'clang_Cursor_getStorageClass'); late final _clang_Cursor_getStorageClass = - _clang_Cursor_getStorageClass_ptr.asFunction(); + _clang_Cursor_getStorageClassPtr.asFunction(); /// Determine the number of overloaded declarations referenced by a /// \c CXCursor_OverloadedDeclRef cursor. @@ -3958,11 +3957,11 @@ class LibClang { ); } - late final _clang_getNumOverloadedDecls_ptr = + late final _clang_getNumOverloadedDeclsPtr = _lookup>( 'clang_getNumOverloadedDecls'); late final _clang_getNumOverloadedDecls = - _clang_getNumOverloadedDecls_ptr.asFunction(); + _clang_getNumOverloadedDeclsPtr.asFunction(); /// Retrieve a cursor for one of the overloaded declarations referenced /// by a \c CXCursor_OverloadedDeclRef cursor. @@ -3986,10 +3985,10 @@ class LibClang { ); } - late final _clang_getOverloadedDecl_ptr = + late final _clang_getOverloadedDeclPtr = _lookup>( 'clang_getOverloadedDecl'); - late final _clang_getOverloadedDecl = _clang_getOverloadedDecl_ptr + late final _clang_getOverloadedDecl = _clang_getOverloadedDeclPtr .asFunction(); /// For cursors representing an iboutletcollection attribute, @@ -4002,11 +4001,11 @@ class LibClang { ); } - late final _clang_getIBOutletCollectionType_ptr = + late final _clang_getIBOutletCollectionTypePtr = _lookup>( 'clang_getIBOutletCollectionType'); late final _clang_getIBOutletCollectionType = - _clang_getIBOutletCollectionType_ptr + _clang_getIBOutletCollectionTypePtr .asFunction(); /// Visit the children of a particular cursor. @@ -4041,10 +4040,10 @@ class LibClang { ); } - late final _clang_visitChildren_ptr = + late final _clang_visitChildrenPtr = _lookup>( 'clang_visitChildren'); - late final _clang_visitChildren = _clang_visitChildren_ptr + late final _clang_visitChildren = _clang_visitChildrenPtr .asFunction(); /// Retrieve a Unified Symbol Resolution (USR) for the entity referenced @@ -4062,11 +4061,11 @@ class LibClang { ); } - late final _clang_getCursorUSR_ptr = + late final _clang_getCursorUSRPtr = _lookup>( 'clang_getCursorUSR'); late final _clang_getCursorUSR = - _clang_getCursorUSR_ptr.asFunction(); + _clang_getCursorUSRPtr.asFunction(); /// Construct a USR for a specified Objective-C class. CXString clang_constructUSR_ObjCClass( @@ -4077,10 +4076,10 @@ class LibClang { ); } - late final _clang_constructUSR_ObjCClass_ptr = + late final _clang_constructUSR_ObjCClassPtr = _lookup>( 'clang_constructUSR_ObjCClass'); - late final _clang_constructUSR_ObjCClass = _clang_constructUSR_ObjCClass_ptr + late final _clang_constructUSR_ObjCClass = _clang_constructUSR_ObjCClassPtr .asFunction)>(); /// Construct a USR for a specified Objective-C category. @@ -4094,11 +4093,11 @@ class LibClang { ); } - late final _clang_constructUSR_ObjCCategory_ptr = + late final _clang_constructUSR_ObjCCategoryPtr = _lookup>( 'clang_constructUSR_ObjCCategory'); late final _clang_constructUSR_ObjCCategory = - _clang_constructUSR_ObjCCategory_ptr.asFunction< + _clang_constructUSR_ObjCCategoryPtr.asFunction< CXString Function(ffi.Pointer, ffi.Pointer)>(); /// Construct a USR for a specified Objective-C protocol. @@ -4110,11 +4109,11 @@ class LibClang { ); } - late final _clang_constructUSR_ObjCProtocol_ptr = + late final _clang_constructUSR_ObjCProtocolPtr = _lookup>( 'clang_constructUSR_ObjCProtocol'); late final _clang_constructUSR_ObjCProtocol = - _clang_constructUSR_ObjCProtocol_ptr + _clang_constructUSR_ObjCProtocolPtr .asFunction)>(); /// Construct a USR for a specified Objective-C instance variable and @@ -4129,10 +4128,10 @@ class LibClang { ); } - late final _clang_constructUSR_ObjCIvar_ptr = + late final _clang_constructUSR_ObjCIvarPtr = _lookup>( 'clang_constructUSR_ObjCIvar'); - late final _clang_constructUSR_ObjCIvar = _clang_constructUSR_ObjCIvar_ptr + late final _clang_constructUSR_ObjCIvar = _clang_constructUSR_ObjCIvarPtr .asFunction, CXString)>(); /// Construct a USR for a specified Objective-C method and @@ -4149,10 +4148,10 @@ class LibClang { ); } - late final _clang_constructUSR_ObjCMethod_ptr = + late final _clang_constructUSR_ObjCMethodPtr = _lookup>( 'clang_constructUSR_ObjCMethod'); - late final _clang_constructUSR_ObjCMethod = _clang_constructUSR_ObjCMethod_ptr + late final _clang_constructUSR_ObjCMethod = _clang_constructUSR_ObjCMethodPtr .asFunction, int, CXString)>(); /// Construct a USR for a specified Objective-C property and the USR @@ -4167,11 +4166,11 @@ class LibClang { ); } - late final _clang_constructUSR_ObjCProperty_ptr = + late final _clang_constructUSR_ObjCPropertyPtr = _lookup>( 'clang_constructUSR_ObjCProperty'); late final _clang_constructUSR_ObjCProperty = - _clang_constructUSR_ObjCProperty_ptr + _clang_constructUSR_ObjCPropertyPtr .asFunction, CXString)>(); /// Retrieve a name for the entity referenced by this cursor. @@ -4183,11 +4182,11 @@ class LibClang { ); } - late final _clang_getCursorSpelling_ptr = + late final _clang_getCursorSpellingPtr = _lookup>( 'clang_getCursorSpelling'); late final _clang_getCursorSpelling = - _clang_getCursorSpelling_ptr.asFunction(); + _clang_getCursorSpellingPtr.asFunction(); /// 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 @@ -4210,11 +4209,11 @@ class LibClang { ); } - late final _clang_Cursor_getSpellingNameRange_ptr = + late final _clang_Cursor_getSpellingNameRangePtr = _lookup>( 'clang_Cursor_getSpellingNameRange'); late final _clang_Cursor_getSpellingNameRange = - _clang_Cursor_getSpellingNameRange_ptr + _clang_Cursor_getSpellingNameRangePtr .asFunction(); /// Get a property value for the given printing policy. @@ -4228,11 +4227,11 @@ class LibClang { ); } - late final _clang_PrintingPolicy_getProperty_ptr = + late final _clang_PrintingPolicy_getPropertyPtr = _lookup>( 'clang_PrintingPolicy_getProperty'); late final _clang_PrintingPolicy_getProperty = - _clang_PrintingPolicy_getProperty_ptr + _clang_PrintingPolicy_getPropertyPtr .asFunction(); /// Set a property value for the given printing policy. @@ -4248,11 +4247,11 @@ class LibClang { ); } - late final _clang_PrintingPolicy_setProperty_ptr = + late final _clang_PrintingPolicy_setPropertyPtr = _lookup>( 'clang_PrintingPolicy_setProperty'); late final _clang_PrintingPolicy_setProperty = - _clang_PrintingPolicy_setProperty_ptr + _clang_PrintingPolicy_setPropertyPtr .asFunction(); /// Retrieve the default policy for the cursor. @@ -4267,10 +4266,10 @@ class LibClang { ); } - late final _clang_getCursorPrintingPolicy_ptr = + late final _clang_getCursorPrintingPolicyPtr = _lookup>( 'clang_getCursorPrintingPolicy'); - late final _clang_getCursorPrintingPolicy = _clang_getCursorPrintingPolicy_ptr + late final _clang_getCursorPrintingPolicy = _clang_getCursorPrintingPolicyPtr .asFunction(); /// Release a printing policy. @@ -4282,10 +4281,10 @@ class LibClang { ); } - late final _clang_PrintingPolicy_dispose_ptr = + late final _clang_PrintingPolicy_disposePtr = _lookup>( 'clang_PrintingPolicy_dispose'); - late final _clang_PrintingPolicy_dispose = _clang_PrintingPolicy_dispose_ptr + late final _clang_PrintingPolicy_dispose = _clang_PrintingPolicy_disposePtr .asFunction(); /// Pretty print declarations. @@ -4307,10 +4306,10 @@ class LibClang { ); } - late final _clang_getCursorPrettyPrinted_ptr = + late final _clang_getCursorPrettyPrintedPtr = _lookup>( 'clang_getCursorPrettyPrinted'); - late final _clang_getCursorPrettyPrinted = _clang_getCursorPrettyPrinted_ptr + late final _clang_getCursorPrettyPrinted = _clang_getCursorPrettyPrintedPtr .asFunction(); /// Retrieve the display name for the entity referenced by this cursor. @@ -4326,11 +4325,11 @@ class LibClang { ); } - late final _clang_getCursorDisplayName_ptr = + late final _clang_getCursorDisplayNamePtr = _lookup>( 'clang_getCursorDisplayName'); late final _clang_getCursorDisplayName = - _clang_getCursorDisplayName_ptr.asFunction(); + _clang_getCursorDisplayNamePtr.asFunction(); /// For a cursor that is a reference, retrieve a cursor representing the /// entity that it references. @@ -4349,11 +4348,11 @@ class LibClang { ); } - late final _clang_getCursorReferenced_ptr = + late final _clang_getCursorReferencedPtr = _lookup>( 'clang_getCursorReferenced'); late final _clang_getCursorReferenced = - _clang_getCursorReferenced_ptr.asFunction(); + _clang_getCursorReferencedPtr.asFunction(); /// For a cursor that is either a reference to or a declaration /// of some entity, retrieve a cursor that describes the definition of @@ -4389,11 +4388,11 @@ class LibClang { ); } - late final _clang_getCursorDefinition_ptr = + late final _clang_getCursorDefinitionPtr = _lookup>( 'clang_getCursorDefinition'); late final _clang_getCursorDefinition = - _clang_getCursorDefinition_ptr.asFunction(); + _clang_getCursorDefinitionPtr.asFunction(); /// Determine whether the declaration pointed to by this cursor /// is also a definition of that entity. @@ -4405,11 +4404,11 @@ class LibClang { ); } - late final _clang_isCursorDefinition_ptr = + late final _clang_isCursorDefinitionPtr = _lookup>( 'clang_isCursorDefinition'); late final _clang_isCursorDefinition = - _clang_isCursorDefinition_ptr.asFunction(); + _clang_isCursorDefinitionPtr.asFunction(); /// Retrieve the canonical cursor corresponding to the given cursor. /// @@ -4441,11 +4440,11 @@ class LibClang { ); } - late final _clang_getCanonicalCursor_ptr = + late final _clang_getCanonicalCursorPtr = _lookup>( 'clang_getCanonicalCursor'); late final _clang_getCanonicalCursor = - _clang_getCanonicalCursor_ptr.asFunction(); + _clang_getCanonicalCursorPtr.asFunction(); /// If the cursor points to a selector identifier in an Objective-C /// method or message expression, this returns the selector index. @@ -4464,11 +4463,11 @@ class LibClang { ); } - late final _clang_Cursor_getObjCSelectorIndex_ptr = + late final _clang_Cursor_getObjCSelectorIndexPtr = _lookup>( 'clang_Cursor_getObjCSelectorIndex'); late final _clang_Cursor_getObjCSelectorIndex = - _clang_Cursor_getObjCSelectorIndex_ptr + _clang_Cursor_getObjCSelectorIndexPtr .asFunction(); /// Given a cursor pointing to a C++ method call or an Objective-C @@ -4488,11 +4487,11 @@ class LibClang { ); } - late final _clang_Cursor_isDynamicCall_ptr = + late final _clang_Cursor_isDynamicCallPtr = _lookup>( 'clang_Cursor_isDynamicCall'); late final _clang_Cursor_isDynamicCall = - _clang_Cursor_isDynamicCall_ptr.asFunction(); + _clang_Cursor_isDynamicCallPtr.asFunction(); /// Given a cursor pointing to an Objective-C message or property /// reference, or C++ method call, returns the CXType of the receiver. @@ -4504,11 +4503,11 @@ class LibClang { ); } - late final _clang_Cursor_getReceiverType_ptr = + late final _clang_Cursor_getReceiverTypePtr = _lookup>( 'clang_Cursor_getReceiverType'); late final _clang_Cursor_getReceiverType = - _clang_Cursor_getReceiverType_ptr.asFunction(); + _clang_Cursor_getReceiverTypePtr.asFunction(); /// Given a cursor that represents a property declaration, return the /// associated property attributes. The bits are formed from @@ -4525,11 +4524,11 @@ class LibClang { ); } - late final _clang_Cursor_getObjCPropertyAttributes_ptr = _lookup< + late final _clang_Cursor_getObjCPropertyAttributesPtr = _lookup< ffi.NativeFunction>( 'clang_Cursor_getObjCPropertyAttributes'); late final _clang_Cursor_getObjCPropertyAttributes = - _clang_Cursor_getObjCPropertyAttributes_ptr + _clang_Cursor_getObjCPropertyAttributesPtr .asFunction(); /// Given a cursor that represents a property declaration, return the @@ -4542,11 +4541,11 @@ class LibClang { ); } - late final _clang_Cursor_getObjCPropertyGetterName_ptr = _lookup< + late final _clang_Cursor_getObjCPropertyGetterNamePtr = _lookup< ffi.NativeFunction>( 'clang_Cursor_getObjCPropertyGetterName'); late final _clang_Cursor_getObjCPropertyGetterName = - _clang_Cursor_getObjCPropertyGetterName_ptr + _clang_Cursor_getObjCPropertyGetterNamePtr .asFunction(); /// Given a cursor that represents a property declaration, return the @@ -4559,11 +4558,11 @@ class LibClang { ); } - late final _clang_Cursor_getObjCPropertySetterName_ptr = _lookup< + late final _clang_Cursor_getObjCPropertySetterNamePtr = _lookup< ffi.NativeFunction>( 'clang_Cursor_getObjCPropertySetterName'); late final _clang_Cursor_getObjCPropertySetterName = - _clang_Cursor_getObjCPropertySetterName_ptr + _clang_Cursor_getObjCPropertySetterNamePtr .asFunction(); /// Given a cursor that represents an Objective-C method or parameter @@ -4578,11 +4577,11 @@ class LibClang { ); } - late final _clang_Cursor_getObjCDeclQualifiers_ptr = + late final _clang_Cursor_getObjCDeclQualifiersPtr = _lookup>( 'clang_Cursor_getObjCDeclQualifiers'); late final _clang_Cursor_getObjCDeclQualifiers = - _clang_Cursor_getObjCDeclQualifiers_ptr + _clang_Cursor_getObjCDeclQualifiersPtr .asFunction(); /// Given a cursor that represents an Objective-C method or property @@ -4596,11 +4595,11 @@ class LibClang { ); } - late final _clang_Cursor_isObjCOptional_ptr = + late final _clang_Cursor_isObjCOptionalPtr = _lookup>( 'clang_Cursor_isObjCOptional'); late final _clang_Cursor_isObjCOptional = - _clang_Cursor_isObjCOptional_ptr.asFunction(); + _clang_Cursor_isObjCOptionalPtr.asFunction(); /// Returns non-zero if the given cursor is a variadic function or method. int clang_Cursor_isVariadic( @@ -4611,11 +4610,11 @@ class LibClang { ); } - late final _clang_Cursor_isVariadic_ptr = + late final _clang_Cursor_isVariadicPtr = _lookup>( 'clang_Cursor_isVariadic'); late final _clang_Cursor_isVariadic = - _clang_Cursor_isVariadic_ptr.asFunction(); + _clang_Cursor_isVariadicPtr.asFunction(); /// Returns non-zero if the given cursor points to a symbol marked with /// external_source_symbol attribute. @@ -4642,11 +4641,11 @@ class LibClang { ); } - late final _clang_Cursor_isExternalSymbol_ptr = + late final _clang_Cursor_isExternalSymbolPtr = _lookup>( 'clang_Cursor_isExternalSymbol'); late final _clang_Cursor_isExternalSymbol = - _clang_Cursor_isExternalSymbol_ptr.asFunction< + _clang_Cursor_isExternalSymbolPtr.asFunction< int Function(CXCursor, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -4661,10 +4660,10 @@ class LibClang { ); } - late final _clang_Cursor_getCommentRange_ptr = + late final _clang_Cursor_getCommentRangePtr = _lookup>( 'clang_Cursor_getCommentRange'); - late final _clang_Cursor_getCommentRange = _clang_Cursor_getCommentRange_ptr + late final _clang_Cursor_getCommentRange = _clang_Cursor_getCommentRangePtr .asFunction(); /// Given a cursor that represents a declaration, return the associated @@ -4677,11 +4676,11 @@ class LibClang { ); } - late final _clang_Cursor_getRawCommentText_ptr = + late final _clang_Cursor_getRawCommentTextPtr = _lookup>( 'clang_Cursor_getRawCommentText'); late final _clang_Cursor_getRawCommentText = - _clang_Cursor_getRawCommentText_ptr + _clang_Cursor_getRawCommentTextPtr .asFunction(); /// Given a cursor that represents a documentable entity (e.g., @@ -4695,11 +4694,11 @@ class LibClang { ); } - late final _clang_Cursor_getBriefCommentText_ptr = + late final _clang_Cursor_getBriefCommentTextPtr = _lookup>( 'clang_Cursor_getBriefCommentText'); late final _clang_Cursor_getBriefCommentText = - _clang_Cursor_getBriefCommentText_ptr + _clang_Cursor_getBriefCommentTextPtr .asFunction(); /// Retrieve the CXString representing the mangled name of the cursor. @@ -4711,11 +4710,11 @@ class LibClang { ); } - late final _clang_Cursor_getMangling_ptr = + late final _clang_Cursor_getManglingPtr = _lookup>( 'clang_Cursor_getMangling'); late final _clang_Cursor_getMangling = - _clang_Cursor_getMangling_ptr.asFunction(); + _clang_Cursor_getManglingPtr.asFunction(); /// Retrieve the CXStrings representing the mangled symbols of the C++ /// constructor or destructor at the cursor. @@ -4727,10 +4726,10 @@ class LibClang { ); } - late final _clang_Cursor_getCXXManglings_ptr = + late final _clang_Cursor_getCXXManglingsPtr = _lookup>( 'clang_Cursor_getCXXManglings'); - late final _clang_Cursor_getCXXManglings = _clang_Cursor_getCXXManglings_ptr + late final _clang_Cursor_getCXXManglings = _clang_Cursor_getCXXManglingsPtr .asFunction Function(CXCursor)>(); /// Retrieve the CXStrings representing the mangled symbols of the ObjC @@ -4743,10 +4742,10 @@ class LibClang { ); } - late final _clang_Cursor_getObjCManglings_ptr = + late final _clang_Cursor_getObjCManglingsPtr = _lookup>( 'clang_Cursor_getObjCManglings'); - late final _clang_Cursor_getObjCManglings = _clang_Cursor_getObjCManglings_ptr + late final _clang_Cursor_getObjCManglings = _clang_Cursor_getObjCManglingsPtr .asFunction Function(CXCursor)>(); /// Given a CXCursor_ModuleImportDecl cursor, return the associated module. @@ -4758,11 +4757,11 @@ class LibClang { ); } - late final _clang_Cursor_getModule_ptr = + late final _clang_Cursor_getModulePtr = _lookup>( 'clang_Cursor_getModule'); late final _clang_Cursor_getModule = - _clang_Cursor_getModule_ptr.asFunction(); + _clang_Cursor_getModulePtr.asFunction(); /// Given a CXFile header file, return the module that contains it, if one /// exists. @@ -4776,10 +4775,10 @@ class LibClang { ); } - late final _clang_getModuleForFile_ptr = + late final _clang_getModuleForFilePtr = _lookup>( 'clang_getModuleForFile'); - late final _clang_getModuleForFile = _clang_getModuleForFile_ptr + late final _clang_getModuleForFile = _clang_getModuleForFilePtr .asFunction(); /// \param Module a module object. @@ -4793,11 +4792,11 @@ class LibClang { ); } - late final _clang_Module_getASTFile_ptr = + late final _clang_Module_getASTFilePtr = _lookup>( 'clang_Module_getASTFile'); late final _clang_Module_getASTFile = - _clang_Module_getASTFile_ptr.asFunction(); + _clang_Module_getASTFilePtr.asFunction(); /// \param Module a module object. /// @@ -4811,11 +4810,11 @@ class LibClang { ); } - late final _clang_Module_getParent_ptr = + late final _clang_Module_getParentPtr = _lookup>( 'clang_Module_getParent'); late final _clang_Module_getParent = - _clang_Module_getParent_ptr.asFunction(); + _clang_Module_getParentPtr.asFunction(); /// \param Module a module object. /// @@ -4829,11 +4828,11 @@ class LibClang { ); } - late final _clang_Module_getName_ptr = + late final _clang_Module_getNamePtr = _lookup>( 'clang_Module_getName'); late final _clang_Module_getName = - _clang_Module_getName_ptr.asFunction(); + _clang_Module_getNamePtr.asFunction(); /// \param Module a module object. /// @@ -4846,11 +4845,11 @@ class LibClang { ); } - late final _clang_Module_getFullName_ptr = + late final _clang_Module_getFullNamePtr = _lookup>( 'clang_Module_getFullName'); late final _clang_Module_getFullName = - _clang_Module_getFullName_ptr.asFunction(); + _clang_Module_getFullNamePtr.asFunction(); /// \param Module a module object. /// @@ -4863,11 +4862,11 @@ class LibClang { ); } - late final _clang_Module_isSystem_ptr = + late final _clang_Module_isSystemPtr = _lookup>( 'clang_Module_isSystem'); late final _clang_Module_isSystem = - _clang_Module_isSystem_ptr.asFunction(); + _clang_Module_isSystemPtr.asFunction(); /// \param Module a module object. /// @@ -4882,11 +4881,11 @@ class LibClang { ); } - late final _clang_Module_getNumTopLevelHeaders_ptr = + late final _clang_Module_getNumTopLevelHeadersPtr = _lookup>( 'clang_Module_getNumTopLevelHeaders'); late final _clang_Module_getNumTopLevelHeaders = - _clang_Module_getNumTopLevelHeaders_ptr + _clang_Module_getNumTopLevelHeadersPtr .asFunction(); /// \param Module a module object. @@ -4906,11 +4905,11 @@ class LibClang { ); } - late final _clang_Module_getTopLevelHeader_ptr = + late final _clang_Module_getTopLevelHeaderPtr = _lookup>( 'clang_Module_getTopLevelHeader'); late final _clang_Module_getTopLevelHeader = - _clang_Module_getTopLevelHeader_ptr + _clang_Module_getTopLevelHeaderPtr .asFunction(); /// Determine if a C++ constructor is a converting constructor. @@ -4922,12 +4921,12 @@ class LibClang { ); } - late final _clang_CXXConstructor_isConvertingConstructor_ptr = _lookup< + late final _clang_CXXConstructor_isConvertingConstructorPtr = _lookup< ffi.NativeFunction< Native_clang_CXXConstructor_isConvertingConstructor>>( 'clang_CXXConstructor_isConvertingConstructor'); late final _clang_CXXConstructor_isConvertingConstructor = - _clang_CXXConstructor_isConvertingConstructor_ptr + _clang_CXXConstructor_isConvertingConstructorPtr .asFunction(); /// Determine if a C++ constructor is a copy constructor. @@ -4939,11 +4938,11 @@ class LibClang { ); } - late final _clang_CXXConstructor_isCopyConstructor_ptr = _lookup< + late final _clang_CXXConstructor_isCopyConstructorPtr = _lookup< ffi.NativeFunction>( 'clang_CXXConstructor_isCopyConstructor'); late final _clang_CXXConstructor_isCopyConstructor = - _clang_CXXConstructor_isCopyConstructor_ptr + _clang_CXXConstructor_isCopyConstructorPtr .asFunction(); /// Determine if a C++ constructor is the default constructor. @@ -4955,11 +4954,11 @@ class LibClang { ); } - late final _clang_CXXConstructor_isDefaultConstructor_ptr = _lookup< + late final _clang_CXXConstructor_isDefaultConstructorPtr = _lookup< ffi.NativeFunction>( 'clang_CXXConstructor_isDefaultConstructor'); late final _clang_CXXConstructor_isDefaultConstructor = - _clang_CXXConstructor_isDefaultConstructor_ptr + _clang_CXXConstructor_isDefaultConstructorPtr .asFunction(); /// Determine if a C++ constructor is a move constructor. @@ -4971,11 +4970,11 @@ class LibClang { ); } - late final _clang_CXXConstructor_isMoveConstructor_ptr = _lookup< + late final _clang_CXXConstructor_isMoveConstructorPtr = _lookup< ffi.NativeFunction>( 'clang_CXXConstructor_isMoveConstructor'); late final _clang_CXXConstructor_isMoveConstructor = - _clang_CXXConstructor_isMoveConstructor_ptr + _clang_CXXConstructor_isMoveConstructorPtr .asFunction(); /// Determine if a C++ field is declared 'mutable'. @@ -4987,11 +4986,11 @@ class LibClang { ); } - late final _clang_CXXField_isMutable_ptr = + late final _clang_CXXField_isMutablePtr = _lookup>( 'clang_CXXField_isMutable'); late final _clang_CXXField_isMutable = - _clang_CXXField_isMutable_ptr.asFunction(); + _clang_CXXField_isMutablePtr.asFunction(); /// Determine if a C++ method is declared '= default'. int clang_CXXMethod_isDefaulted( @@ -5002,11 +5001,11 @@ class LibClang { ); } - late final _clang_CXXMethod_isDefaulted_ptr = + late final _clang_CXXMethod_isDefaultedPtr = _lookup>( 'clang_CXXMethod_isDefaulted'); late final _clang_CXXMethod_isDefaulted = - _clang_CXXMethod_isDefaulted_ptr.asFunction(); + _clang_CXXMethod_isDefaultedPtr.asFunction(); /// Determine if a C++ member function or member function template is /// pure virtual. @@ -5018,11 +5017,11 @@ class LibClang { ); } - late final _clang_CXXMethod_isPureVirtual_ptr = + late final _clang_CXXMethod_isPureVirtualPtr = _lookup>( 'clang_CXXMethod_isPureVirtual'); late final _clang_CXXMethod_isPureVirtual = - _clang_CXXMethod_isPureVirtual_ptr.asFunction(); + _clang_CXXMethod_isPureVirtualPtr.asFunction(); /// Determine if a C++ member function or member function template is /// declared 'static'. @@ -5034,11 +5033,11 @@ class LibClang { ); } - late final _clang_CXXMethod_isStatic_ptr = + late final _clang_CXXMethod_isStaticPtr = _lookup>( 'clang_CXXMethod_isStatic'); late final _clang_CXXMethod_isStatic = - _clang_CXXMethod_isStatic_ptr.asFunction(); + _clang_CXXMethod_isStaticPtr.asFunction(); /// Determine if a C++ member function or member function template is /// explicitly declared 'virtual' or if it overrides a virtual method from @@ -5051,11 +5050,11 @@ class LibClang { ); } - late final _clang_CXXMethod_isVirtual_ptr = + late final _clang_CXXMethod_isVirtualPtr = _lookup>( 'clang_CXXMethod_isVirtual'); late final _clang_CXXMethod_isVirtual = - _clang_CXXMethod_isVirtual_ptr.asFunction(); + _clang_CXXMethod_isVirtualPtr.asFunction(); /// Determine if a C++ record is abstract, i.e. whether a class or struct /// has a pure virtual member function. @@ -5067,11 +5066,11 @@ class LibClang { ); } - late final _clang_CXXRecord_isAbstract_ptr = + late final _clang_CXXRecord_isAbstractPtr = _lookup>( 'clang_CXXRecord_isAbstract'); late final _clang_CXXRecord_isAbstract = - _clang_CXXRecord_isAbstract_ptr.asFunction(); + _clang_CXXRecord_isAbstractPtr.asFunction(); /// Determine if an enum declaration refers to a scoped enum. int clang_EnumDecl_isScoped( @@ -5082,11 +5081,11 @@ class LibClang { ); } - late final _clang_EnumDecl_isScoped_ptr = + late final _clang_EnumDecl_isScopedPtr = _lookup>( 'clang_EnumDecl_isScoped'); late final _clang_EnumDecl_isScoped = - _clang_EnumDecl_isScoped_ptr.asFunction(); + _clang_EnumDecl_isScopedPtr.asFunction(); /// Determine if a C++ member function or member function template is /// declared 'const'. @@ -5098,11 +5097,11 @@ class LibClang { ); } - late final _clang_CXXMethod_isConst_ptr = + late final _clang_CXXMethod_isConstPtr = _lookup>( 'clang_CXXMethod_isConst'); late final _clang_CXXMethod_isConst = - _clang_CXXMethod_isConst_ptr.asFunction(); + _clang_CXXMethod_isConstPtr.asFunction(); /// Given a cursor that represents a template, determine /// the cursor kind of the specializations would be generated by instantiating @@ -5127,11 +5126,11 @@ class LibClang { ); } - late final _clang_getTemplateCursorKind_ptr = + late final _clang_getTemplateCursorKindPtr = _lookup>( 'clang_getTemplateCursorKind'); late final _clang_getTemplateCursorKind = - _clang_getTemplateCursorKind_ptr.asFunction(); + _clang_getTemplateCursorKindPtr.asFunction(); /// Given a cursor that may represent a specialization or instantiation /// of a template, retrieve the cursor that represents the template that it @@ -5167,11 +5166,11 @@ class LibClang { ); } - late final _clang_getSpecializedCursorTemplate_ptr = + late final _clang_getSpecializedCursorTemplatePtr = _lookup>( 'clang_getSpecializedCursorTemplate'); late final _clang_getSpecializedCursorTemplate = - _clang_getSpecializedCursorTemplate_ptr + _clang_getSpecializedCursorTemplatePtr .asFunction(); /// Given a cursor that references something else, return the source range @@ -5202,11 +5201,11 @@ class LibClang { ); } - late final _clang_getCursorReferenceNameRange_ptr = + late final _clang_getCursorReferenceNameRangePtr = _lookup>( 'clang_getCursorReferenceNameRange'); late final _clang_getCursorReferenceNameRange = - _clang_getCursorReferenceNameRange_ptr + _clang_getCursorReferenceNameRangePtr .asFunction(); /// Get the raw lexical token starting with the given location. @@ -5228,9 +5227,9 @@ class LibClang { ); } - late final _clang_getToken_ptr = + late final _clang_getTokenPtr = _lookup>('clang_getToken'); - late final _clang_getToken = _clang_getToken_ptr.asFunction< + late final _clang_getToken = _clang_getTokenPtr.asFunction< ffi.Pointer Function(CXTranslationUnit, CXSourceLocation)>(); /// Determine the kind of the given token. @@ -5242,11 +5241,11 @@ class LibClang { ); } - late final _clang_getTokenKind_ptr = + late final _clang_getTokenKindPtr = _lookup>( 'clang_getTokenKind'); late final _clang_getTokenKind = - _clang_getTokenKind_ptr.asFunction(); + _clang_getTokenKindPtr.asFunction(); /// Determine the spelling of the given token. /// @@ -5262,10 +5261,10 @@ class LibClang { ); } - late final _clang_getTokenSpelling_ptr = + late final _clang_getTokenSpellingPtr = _lookup>( 'clang_getTokenSpelling'); - late final _clang_getTokenSpelling = _clang_getTokenSpelling_ptr + late final _clang_getTokenSpelling = _clang_getTokenSpellingPtr .asFunction(); /// Retrieve the source location of the given token. @@ -5279,10 +5278,10 @@ class LibClang { ); } - late final _clang_getTokenLocation_ptr = + late final _clang_getTokenLocationPtr = _lookup>( 'clang_getTokenLocation'); - late final _clang_getTokenLocation = _clang_getTokenLocation_ptr + late final _clang_getTokenLocation = _clang_getTokenLocationPtr .asFunction(); /// Retrieve a source range that covers the given token. @@ -5296,10 +5295,10 @@ class LibClang { ); } - late final _clang_getTokenExtent_ptr = + late final _clang_getTokenExtentPtr = _lookup>( 'clang_getTokenExtent'); - late final _clang_getTokenExtent = _clang_getTokenExtent_ptr + late final _clang_getTokenExtent = _clang_getTokenExtentPtr .asFunction(); /// Tokenize the source code described by the given range into raw @@ -5330,9 +5329,9 @@ class LibClang { ); } - late final _clang_tokenize_ptr = + late final _clang_tokenizePtr = _lookup>('clang_tokenize'); - late final _clang_tokenize = _clang_tokenize_ptr.asFunction< + late final _clang_tokenize = _clang_tokenizePtr.asFunction< void Function(CXTranslationUnit, CXSourceRange, ffi.Pointer>, ffi.Pointer)>(); @@ -5378,10 +5377,10 @@ class LibClang { ); } - late final _clang_annotateTokens_ptr = + late final _clang_annotateTokensPtr = _lookup>( 'clang_annotateTokens'); - late final _clang_annotateTokens = _clang_annotateTokens_ptr.asFunction< + late final _clang_annotateTokens = _clang_annotateTokensPtr.asFunction< void Function(CXTranslationUnit, ffi.Pointer, int, ffi.Pointer)>(); @@ -5398,10 +5397,10 @@ class LibClang { ); } - late final _clang_disposeTokens_ptr = + late final _clang_disposeTokensPtr = _lookup>( 'clang_disposeTokens'); - late final _clang_disposeTokens = _clang_disposeTokens_ptr.asFunction< + late final _clang_disposeTokens = _clang_disposeTokensPtr.asFunction< void Function(CXTranslationUnit, ffi.Pointer, int)>(); /// \defgroup CINDEX_DEBUG Debugging facilities @@ -5418,11 +5417,11 @@ class LibClang { ); } - late final _clang_getCursorKindSpelling_ptr = + late final _clang_getCursorKindSpellingPtr = _lookup>( 'clang_getCursorKindSpelling'); late final _clang_getCursorKindSpelling = - _clang_getCursorKindSpelling_ptr.asFunction(); + _clang_getCursorKindSpellingPtr.asFunction(); void clang_getDefinitionSpellingAndExtent( CXCursor arg0, @@ -5444,11 +5443,11 @@ class LibClang { ); } - late final _clang_getDefinitionSpellingAndExtent_ptr = + late final _clang_getDefinitionSpellingAndExtentPtr = _lookup>( 'clang_getDefinitionSpellingAndExtent'); late final _clang_getDefinitionSpellingAndExtent = - _clang_getDefinitionSpellingAndExtent_ptr.asFunction< + _clang_getDefinitionSpellingAndExtentPtr.asFunction< void Function( CXCursor, ffi.Pointer>, @@ -5462,11 +5461,11 @@ class LibClang { return _clang_enableStackTraces(); } - late final _clang_enableStackTraces_ptr = + late final _clang_enableStackTracesPtr = _lookup>( 'clang_enableStackTraces'); late final _clang_enableStackTraces = - _clang_enableStackTraces_ptr.asFunction(); + _clang_enableStackTracesPtr.asFunction(); void clang_executeOnThread( ffi.Pointer)>> @@ -5481,10 +5480,10 @@ class LibClang { ); } - late final _clang_executeOnThread_ptr = + late final _clang_executeOnThreadPtr = _lookup>( 'clang_executeOnThread'); - late final _clang_executeOnThread = _clang_executeOnThread_ptr.asFunction< + late final _clang_executeOnThread = _clang_executeOnThreadPtr.asFunction< void Function( ffi.Pointer< ffi.NativeFunction)>>, @@ -5508,10 +5507,10 @@ class LibClang { ); } - late final _clang_getCompletionChunkKind_ptr = + late final _clang_getCompletionChunkKindPtr = _lookup>( 'clang_getCompletionChunkKind'); - late final _clang_getCompletionChunkKind = _clang_getCompletionChunkKind_ptr + late final _clang_getCompletionChunkKind = _clang_getCompletionChunkKindPtr .asFunction(); /// Retrieve the text associated with a particular chunk within a @@ -5532,10 +5531,10 @@ class LibClang { ); } - late final _clang_getCompletionChunkText_ptr = + late final _clang_getCompletionChunkTextPtr = _lookup>( 'clang_getCompletionChunkText'); - late final _clang_getCompletionChunkText = _clang_getCompletionChunkText_ptr + late final _clang_getCompletionChunkText = _clang_getCompletionChunkTextPtr .asFunction(); /// Retrieve the completion string associated with a particular chunk @@ -5557,11 +5556,11 @@ class LibClang { ); } - late final _clang_getCompletionChunkCompletionString_ptr = _lookup< + late final _clang_getCompletionChunkCompletionStringPtr = _lookup< ffi.NativeFunction>( 'clang_getCompletionChunkCompletionString'); late final _clang_getCompletionChunkCompletionString = - _clang_getCompletionChunkCompletionString_ptr + _clang_getCompletionChunkCompletionStringPtr .asFunction(); /// Retrieve the number of chunks in the given code-completion string. @@ -5573,10 +5572,10 @@ class LibClang { ); } - late final _clang_getNumCompletionChunks_ptr = + late final _clang_getNumCompletionChunksPtr = _lookup>( 'clang_getNumCompletionChunks'); - late final _clang_getNumCompletionChunks = _clang_getNumCompletionChunks_ptr + late final _clang_getNumCompletionChunks = _clang_getNumCompletionChunksPtr .asFunction(); /// Determine the priority of this code completion. @@ -5597,10 +5596,10 @@ class LibClang { ); } - late final _clang_getCompletionPriority_ptr = + late final _clang_getCompletionPriorityPtr = _lookup>( 'clang_getCompletionPriority'); - late final _clang_getCompletionPriority = _clang_getCompletionPriority_ptr + late final _clang_getCompletionPriority = _clang_getCompletionPriorityPtr .asFunction(); /// Determine the availability of the entity that this code-completion @@ -5617,11 +5616,11 @@ class LibClang { ); } - late final _clang_getCompletionAvailability_ptr = + late final _clang_getCompletionAvailabilityPtr = _lookup>( 'clang_getCompletionAvailability'); late final _clang_getCompletionAvailability = - _clang_getCompletionAvailability_ptr + _clang_getCompletionAvailabilityPtr .asFunction(); /// Retrieve the number of annotations associated with the given @@ -5639,11 +5638,11 @@ class LibClang { ); } - late final _clang_getCompletionNumAnnotations_ptr = + late final _clang_getCompletionNumAnnotationsPtr = _lookup>( 'clang_getCompletionNumAnnotations'); late final _clang_getCompletionNumAnnotations = - _clang_getCompletionNumAnnotations_ptr + _clang_getCompletionNumAnnotationsPtr .asFunction(); /// Retrieve the annotation associated with the given completion string. @@ -5665,10 +5664,10 @@ class LibClang { ); } - late final _clang_getCompletionAnnotation_ptr = + late final _clang_getCompletionAnnotationPtr = _lookup>( 'clang_getCompletionAnnotation'); - late final _clang_getCompletionAnnotation = _clang_getCompletionAnnotation_ptr + late final _clang_getCompletionAnnotation = _clang_getCompletionAnnotationPtr .asFunction(); /// Retrieve the parent context of the given completion string. @@ -5695,11 +5694,11 @@ class LibClang { ); } - late final _clang_getCompletionParent_ptr = + late final _clang_getCompletionParentPtr = _lookup>( 'clang_getCompletionParent'); late final _clang_getCompletionParent = - _clang_getCompletionParent_ptr.asFunction< + _clang_getCompletionParentPtr.asFunction< CXString Function(CXCompletionString, ffi.Pointer)>(); /// Retrieve the brief documentation comment attached to the declaration @@ -5712,11 +5711,11 @@ class LibClang { ); } - late final _clang_getCompletionBriefComment_ptr = + late final _clang_getCompletionBriefCommentPtr = _lookup>( 'clang_getCompletionBriefComment'); late final _clang_getCompletionBriefComment = - _clang_getCompletionBriefComment_ptr + _clang_getCompletionBriefCommentPtr .asFunction(); /// Retrieve a completion string for an arbitrary declaration or macro @@ -5734,11 +5733,11 @@ class LibClang { ); } - late final _clang_getCursorCompletionString_ptr = + late final _clang_getCursorCompletionStringPtr = _lookup>( 'clang_getCursorCompletionString'); late final _clang_getCursorCompletionString = - _clang_getCursorCompletionString_ptr + _clang_getCursorCompletionStringPtr .asFunction(); /// Retrieve the number of fix-its for the given completion index. @@ -5762,10 +5761,10 @@ class LibClang { ); } - late final _clang_getCompletionNumFixIts_ptr = + late final _clang_getCompletionNumFixItsPtr = _lookup>( 'clang_getCompletionNumFixIts'); - late final _clang_getCompletionNumFixIts = _clang_getCompletionNumFixIts_ptr + late final _clang_getCompletionNumFixIts = _clang_getCompletionNumFixItsPtr .asFunction, int)>(); /// Fix-its that *must* be applied before inserting the text for the @@ -5823,11 +5822,11 @@ class LibClang { ); } - late final _clang_getCompletionFixIt_ptr = + late final _clang_getCompletionFixItPtr = _lookup>( 'clang_getCompletionFixIt'); late final _clang_getCompletionFixIt = - _clang_getCompletionFixIt_ptr.asFunction< + _clang_getCompletionFixItPtr.asFunction< CXString Function(ffi.Pointer, int, int, ffi.Pointer)>(); @@ -5837,11 +5836,11 @@ class LibClang { return _clang_defaultCodeCompleteOptions(); } - late final _clang_defaultCodeCompleteOptions_ptr = + late final _clang_defaultCodeCompleteOptionsPtr = _lookup>( 'clang_defaultCodeCompleteOptions'); late final _clang_defaultCodeCompleteOptions = - _clang_defaultCodeCompleteOptions_ptr.asFunction(); + _clang_defaultCodeCompleteOptionsPtr.asFunction(); /// Perform code completion at a given location in a translation unit. /// @@ -5929,10 +5928,10 @@ class LibClang { ); } - late final _clang_codeCompleteAt_ptr = + late final _clang_codeCompleteAtPtr = _lookup>( 'clang_codeCompleteAt'); - late final _clang_codeCompleteAt = _clang_codeCompleteAt_ptr.asFunction< + late final _clang_codeCompleteAt = _clang_codeCompleteAtPtr.asFunction< ffi.Pointer Function( CXTranslationUnit, ffi.Pointer, @@ -5957,11 +5956,11 @@ class LibClang { ); } - late final _clang_sortCodeCompletionResults_ptr = + late final _clang_sortCodeCompletionResultsPtr = _lookup>( 'clang_sortCodeCompletionResults'); late final _clang_sortCodeCompletionResults = - _clang_sortCodeCompletionResults_ptr + _clang_sortCodeCompletionResultsPtr .asFunction, int)>(); /// Free the given set of code-completion results. @@ -5973,11 +5972,11 @@ class LibClang { ); } - late final _clang_disposeCodeCompleteResults_ptr = + late final _clang_disposeCodeCompleteResultsPtr = _lookup>( 'clang_disposeCodeCompleteResults'); late final _clang_disposeCodeCompleteResults = - _clang_disposeCodeCompleteResults_ptr + _clang_disposeCodeCompleteResultsPtr .asFunction)>(); /// Determine the number of diagnostics produced prior to the @@ -5990,11 +5989,11 @@ class LibClang { ); } - late final _clang_codeCompleteGetNumDiagnostics_ptr = + late final _clang_codeCompleteGetNumDiagnosticsPtr = _lookup>( 'clang_codeCompleteGetNumDiagnostics'); late final _clang_codeCompleteGetNumDiagnostics = - _clang_codeCompleteGetNumDiagnostics_ptr + _clang_codeCompleteGetNumDiagnosticsPtr .asFunction)>(); /// Retrieve a diagnostic associated with the given code completion. @@ -6014,11 +6013,11 @@ class LibClang { ); } - late final _clang_codeCompleteGetDiagnostic_ptr = + late final _clang_codeCompleteGetDiagnosticPtr = _lookup>( 'clang_codeCompleteGetDiagnostic'); late final _clang_codeCompleteGetDiagnostic = - _clang_codeCompleteGetDiagnostic_ptr.asFunction< + _clang_codeCompleteGetDiagnosticPtr.asFunction< CXDiagnostic Function(ffi.Pointer, int)>(); /// Determines what completions are appropriate for the context @@ -6036,10 +6035,10 @@ class LibClang { ); } - late final _clang_codeCompleteGetContexts_ptr = + late final _clang_codeCompleteGetContextsPtr = _lookup>( 'clang_codeCompleteGetContexts'); - late final _clang_codeCompleteGetContexts = _clang_codeCompleteGetContexts_ptr + late final _clang_codeCompleteGetContexts = _clang_codeCompleteGetContextsPtr .asFunction)>(); /// Returns the cursor kind for the container for the current code @@ -6066,11 +6065,11 @@ class LibClang { ); } - late final _clang_codeCompleteGetContainerKind_ptr = + late final _clang_codeCompleteGetContainerKindPtr = _lookup>( 'clang_codeCompleteGetContainerKind'); late final _clang_codeCompleteGetContainerKind = - _clang_codeCompleteGetContainerKind_ptr.asFunction< + _clang_codeCompleteGetContainerKindPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer)>(); @@ -6089,11 +6088,11 @@ class LibClang { ); } - late final _clang_codeCompleteGetContainerUSR_ptr = + late final _clang_codeCompleteGetContainerUSRPtr = _lookup>( 'clang_codeCompleteGetContainerUSR'); late final _clang_codeCompleteGetContainerUSR = - _clang_codeCompleteGetContainerUSR_ptr + _clang_codeCompleteGetContainerUSRPtr .asFunction)>(); /// Returns the currently-entered selector for an Objective-C message @@ -6113,11 +6112,11 @@ class LibClang { ); } - late final _clang_codeCompleteGetObjCSelector_ptr = + late final _clang_codeCompleteGetObjCSelectorPtr = _lookup>( 'clang_codeCompleteGetObjCSelector'); late final _clang_codeCompleteGetObjCSelector = - _clang_codeCompleteGetObjCSelector_ptr + _clang_codeCompleteGetObjCSelectorPtr .asFunction)>(); /// Return a version string, suitable for showing to a user, but not @@ -6126,11 +6125,11 @@ class LibClang { return _clang_getClangVersion(); } - late final _clang_getClangVersion_ptr = + late final _clang_getClangVersionPtr = _lookup>( 'clang_getClangVersion'); late final _clang_getClangVersion = - _clang_getClangVersion_ptr.asFunction(); + _clang_getClangVersionPtr.asFunction(); /// Enable/disable crash recovery. /// @@ -6144,11 +6143,11 @@ class LibClang { ); } - late final _clang_toggleCrashRecovery_ptr = + late final _clang_toggleCrashRecoveryPtr = _lookup>( 'clang_toggleCrashRecovery'); late final _clang_toggleCrashRecovery = - _clang_toggleCrashRecovery_ptr.asFunction(); + _clang_toggleCrashRecoveryPtr.asFunction(); /// Visit the set of preprocessor inclusions in a translation unit. /// The visitor function is called with the provided data for every included @@ -6166,10 +6165,10 @@ class LibClang { ); } - late final _clang_getInclusions_ptr = + late final _clang_getInclusionsPtr = _lookup>( 'clang_getInclusions'); - late final _clang_getInclusions = _clang_getInclusions_ptr.asFunction< + late final _clang_getInclusions = _clang_getInclusionsPtr.asFunction< void Function(CXTranslationUnit, CXInclusionVisitor, CXClientData)>(); /// If cursor is a statement declaration tries to evaluate the @@ -6183,11 +6182,11 @@ class LibClang { ); } - late final _clang_Cursor_Evaluate_ptr = + late final _clang_Cursor_EvaluatePtr = _lookup>( 'clang_Cursor_Evaluate'); late final _clang_Cursor_Evaluate = - _clang_Cursor_Evaluate_ptr.asFunction(); + _clang_Cursor_EvaluatePtr.asFunction(); /// Returns the kind of the evaluated result. int clang_EvalResult_getKind( @@ -6198,11 +6197,11 @@ class LibClang { ); } - late final _clang_EvalResult_getKind_ptr = + late final _clang_EvalResult_getKindPtr = _lookup>( 'clang_EvalResult_getKind'); late final _clang_EvalResult_getKind = - _clang_EvalResult_getKind_ptr.asFunction(); + _clang_EvalResult_getKindPtr.asFunction(); /// Returns the evaluation result as integer if the /// kind is Int. @@ -6214,11 +6213,11 @@ class LibClang { ); } - late final _clang_EvalResult_getAsInt_ptr = + late final _clang_EvalResult_getAsIntPtr = _lookup>( 'clang_EvalResult_getAsInt'); late final _clang_EvalResult_getAsInt = - _clang_EvalResult_getAsInt_ptr.asFunction(); + _clang_EvalResult_getAsIntPtr.asFunction(); /// Returns the evaluation result as a long long integer if the /// kind is Int. This prevents overflows that may happen if the result is @@ -6231,11 +6230,11 @@ class LibClang { ); } - late final _clang_EvalResult_getAsLongLong_ptr = + late final _clang_EvalResult_getAsLongLongPtr = _lookup>( 'clang_EvalResult_getAsLongLong'); late final _clang_EvalResult_getAsLongLong = - _clang_EvalResult_getAsLongLong_ptr + _clang_EvalResult_getAsLongLongPtr .asFunction(); /// Returns a non-zero value if the kind is Int and the evaluation @@ -6248,11 +6247,11 @@ class LibClang { ); } - late final _clang_EvalResult_isUnsignedInt_ptr = + late final _clang_EvalResult_isUnsignedIntPtr = _lookup>( 'clang_EvalResult_isUnsignedInt'); late final _clang_EvalResult_isUnsignedInt = - _clang_EvalResult_isUnsignedInt_ptr + _clang_EvalResult_isUnsignedIntPtr .asFunction(); /// Returns the evaluation result as an unsigned integer if @@ -6265,11 +6264,11 @@ class LibClang { ); } - late final _clang_EvalResult_getAsUnsigned_ptr = + late final _clang_EvalResult_getAsUnsignedPtr = _lookup>( 'clang_EvalResult_getAsUnsigned'); late final _clang_EvalResult_getAsUnsigned = - _clang_EvalResult_getAsUnsigned_ptr + _clang_EvalResult_getAsUnsignedPtr .asFunction(); /// Returns the evaluation result as double if the @@ -6282,10 +6281,10 @@ class LibClang { ); } - late final _clang_EvalResult_getAsDouble_ptr = + late final _clang_EvalResult_getAsDoublePtr = _lookup>( 'clang_EvalResult_getAsDouble'); - late final _clang_EvalResult_getAsDouble = _clang_EvalResult_getAsDouble_ptr + late final _clang_EvalResult_getAsDouble = _clang_EvalResult_getAsDoublePtr .asFunction(); /// Returns the evaluation result as a constant string if the @@ -6300,10 +6299,10 @@ class LibClang { ); } - late final _clang_EvalResult_getAsStr_ptr = + late final _clang_EvalResult_getAsStrPtr = _lookup>( 'clang_EvalResult_getAsStr'); - late final _clang_EvalResult_getAsStr = _clang_EvalResult_getAsStr_ptr + late final _clang_EvalResult_getAsStr = _clang_EvalResult_getAsStrPtr .asFunction Function(CXEvalResult)>(); /// Disposes the created Eval memory. @@ -6315,11 +6314,11 @@ class LibClang { ); } - late final _clang_EvalResult_dispose_ptr = + late final _clang_EvalResult_disposePtr = _lookup>( 'clang_EvalResult_dispose'); late final _clang_EvalResult_dispose = - _clang_EvalResult_dispose_ptr.asFunction(); + _clang_EvalResult_disposePtr.asFunction(); /// Retrieve a remapping. /// @@ -6335,10 +6334,10 @@ class LibClang { ); } - late final _clang_getRemappings_ptr = + late final _clang_getRemappingsPtr = _lookup>( 'clang_getRemappings'); - late final _clang_getRemappings = _clang_getRemappings_ptr + late final _clang_getRemappings = _clang_getRemappingsPtr .asFunction)>(); /// Retrieve a remapping. @@ -6359,11 +6358,11 @@ class LibClang { ); } - late final _clang_getRemappingsFromFileList_ptr = + late final _clang_getRemappingsFromFileListPtr = _lookup>( 'clang_getRemappingsFromFileList'); late final _clang_getRemappingsFromFileList = - _clang_getRemappingsFromFileList_ptr.asFunction< + _clang_getRemappingsFromFileListPtr.asFunction< CXRemapping Function(ffi.Pointer>, int)>(); /// Determine the number of remappings. @@ -6375,11 +6374,11 @@ class LibClang { ); } - late final _clang_remap_getNumFiles_ptr = + late final _clang_remap_getNumFilesPtr = _lookup>( 'clang_remap_getNumFiles'); late final _clang_remap_getNumFiles = - _clang_remap_getNumFiles_ptr.asFunction(); + _clang_remap_getNumFilesPtr.asFunction(); /// Get the original and the associated filename from the remapping. /// @@ -6401,11 +6400,11 @@ class LibClang { ); } - late final _clang_remap_getFilenames_ptr = + late final _clang_remap_getFilenamesPtr = _lookup>( 'clang_remap_getFilenames'); late final _clang_remap_getFilenames = - _clang_remap_getFilenames_ptr.asFunction< + _clang_remap_getFilenamesPtr.asFunction< void Function(CXRemapping, int, ffi.Pointer, ffi.Pointer)>(); @@ -6418,11 +6417,11 @@ class LibClang { ); } - late final _clang_remap_dispose_ptr = + late final _clang_remap_disposePtr = _lookup>( 'clang_remap_dispose'); late final _clang_remap_dispose = - _clang_remap_dispose_ptr.asFunction(); + _clang_remap_disposePtr.asFunction(); /// Find references of a declaration in a specific file. /// @@ -6448,10 +6447,10 @@ class LibClang { ); } - late final _clang_findReferencesInFile_ptr = + late final _clang_findReferencesInFilePtr = _lookup>( 'clang_findReferencesInFile'); - late final _clang_findReferencesInFile = _clang_findReferencesInFile_ptr + late final _clang_findReferencesInFile = _clang_findReferencesInFilePtr .asFunction(); /// Find #import/#include directives in a specific file. @@ -6476,11 +6475,11 @@ class LibClang { ); } - late final _clang_findIncludesInFile_ptr = + late final _clang_findIncludesInFilePtr = _lookup>( 'clang_findIncludesInFile'); late final _clang_findIncludesInFile = - _clang_findIncludesInFile_ptr.asFunction< + _clang_findIncludesInFilePtr.asFunction< int Function(CXTranslationUnit, CXFile, CXCursorAndRangeVisitor)>(); int clang_index_isEntityObjCContainerKind( @@ -6491,12 +6490,11 @@ class LibClang { ); } - late final _clang_index_isEntityObjCContainerKind_ptr = + late final _clang_index_isEntityObjCContainerKindPtr = _lookup>( 'clang_index_isEntityObjCContainerKind'); late final _clang_index_isEntityObjCContainerKind = - _clang_index_isEntityObjCContainerKind_ptr - .asFunction(); + _clang_index_isEntityObjCContainerKindPtr.asFunction(); ffi.Pointer clang_index_getObjCContainerDeclInfo( ffi.Pointer arg0, @@ -6506,11 +6504,11 @@ class LibClang { ); } - late final _clang_index_getObjCContainerDeclInfo_ptr = + late final _clang_index_getObjCContainerDeclInfoPtr = _lookup>( 'clang_index_getObjCContainerDeclInfo'); late final _clang_index_getObjCContainerDeclInfo = - _clang_index_getObjCContainerDeclInfo_ptr.asFunction< + _clang_index_getObjCContainerDeclInfoPtr.asFunction< ffi.Pointer Function( ffi.Pointer)>(); @@ -6522,11 +6520,11 @@ class LibClang { ); } - late final _clang_index_getObjCInterfaceDeclInfo_ptr = + late final _clang_index_getObjCInterfaceDeclInfoPtr = _lookup>( 'clang_index_getObjCInterfaceDeclInfo'); late final _clang_index_getObjCInterfaceDeclInfo = - _clang_index_getObjCInterfaceDeclInfo_ptr.asFunction< + _clang_index_getObjCInterfaceDeclInfoPtr.asFunction< ffi.Pointer Function( ffi.Pointer)>(); @@ -6538,11 +6536,11 @@ class LibClang { ); } - late final _clang_index_getObjCCategoryDeclInfo_ptr = + late final _clang_index_getObjCCategoryDeclInfoPtr = _lookup>( 'clang_index_getObjCCategoryDeclInfo'); late final _clang_index_getObjCCategoryDeclInfo = - _clang_index_getObjCCategoryDeclInfo_ptr.asFunction< + _clang_index_getObjCCategoryDeclInfoPtr.asFunction< ffi.Pointer Function( ffi.Pointer)>(); @@ -6555,11 +6553,11 @@ class LibClang { ); } - late final _clang_index_getObjCProtocolRefListInfo_ptr = _lookup< + late final _clang_index_getObjCProtocolRefListInfoPtr = _lookup< ffi.NativeFunction>( 'clang_index_getObjCProtocolRefListInfo'); late final _clang_index_getObjCProtocolRefListInfo = - _clang_index_getObjCProtocolRefListInfo_ptr.asFunction< + _clang_index_getObjCProtocolRefListInfoPtr.asFunction< ffi.Pointer Function( ffi.Pointer)>(); @@ -6571,11 +6569,11 @@ class LibClang { ); } - late final _clang_index_getObjCPropertyDeclInfo_ptr = + late final _clang_index_getObjCPropertyDeclInfoPtr = _lookup>( 'clang_index_getObjCPropertyDeclInfo'); late final _clang_index_getObjCPropertyDeclInfo = - _clang_index_getObjCPropertyDeclInfo_ptr.asFunction< + _clang_index_getObjCPropertyDeclInfoPtr.asFunction< ffi.Pointer Function( ffi.Pointer)>(); @@ -6588,11 +6586,11 @@ class LibClang { ); } - late final _clang_index_getIBOutletCollectionAttrInfo_ptr = _lookup< + late final _clang_index_getIBOutletCollectionAttrInfoPtr = _lookup< ffi.NativeFunction>( 'clang_index_getIBOutletCollectionAttrInfo'); late final _clang_index_getIBOutletCollectionAttrInfo = - _clang_index_getIBOutletCollectionAttrInfo_ptr.asFunction< + _clang_index_getIBOutletCollectionAttrInfoPtr.asFunction< ffi.Pointer Function( ffi.Pointer)>(); @@ -6604,11 +6602,11 @@ class LibClang { ); } - late final _clang_index_getCXXClassDeclInfo_ptr = + late final _clang_index_getCXXClassDeclInfoPtr = _lookup>( 'clang_index_getCXXClassDeclInfo'); late final _clang_index_getCXXClassDeclInfo = - _clang_index_getCXXClassDeclInfo_ptr.asFunction< + _clang_index_getCXXClassDeclInfoPtr.asFunction< ffi.Pointer Function( ffi.Pointer)>(); @@ -6622,11 +6620,11 @@ class LibClang { ); } - late final _clang_index_getClientContainer_ptr = + late final _clang_index_getClientContainerPtr = _lookup>( 'clang_index_getClientContainer'); late final _clang_index_getClientContainer = - _clang_index_getClientContainer_ptr.asFunction< + _clang_index_getClientContainerPtr.asFunction< CXIdxClientContainer Function(ffi.Pointer)>(); /// For setting a custom CXIdxClientContainer attached to a @@ -6641,11 +6639,11 @@ class LibClang { ); } - late final _clang_index_setClientContainer_ptr = + late final _clang_index_setClientContainerPtr = _lookup>( 'clang_index_setClientContainer'); late final _clang_index_setClientContainer = - _clang_index_setClientContainer_ptr.asFunction< + _clang_index_setClientContainerPtr.asFunction< void Function( ffi.Pointer, CXIdxClientContainer)>(); @@ -6658,10 +6656,10 @@ class LibClang { ); } - late final _clang_index_getClientEntity_ptr = + late final _clang_index_getClientEntityPtr = _lookup>( 'clang_index_getClientEntity'); - late final _clang_index_getClientEntity = _clang_index_getClientEntity_ptr + late final _clang_index_getClientEntity = _clang_index_getClientEntityPtr .asFunction)>(); /// For setting a custom CXIdxClientEntity attached to an entity. @@ -6675,11 +6673,11 @@ class LibClang { ); } - late final _clang_index_setClientEntity_ptr = + late final _clang_index_setClientEntityPtr = _lookup>( 'clang_index_setClientEntity'); late final _clang_index_setClientEntity = - _clang_index_setClientEntity_ptr.asFunction< + _clang_index_setClientEntityPtr.asFunction< void Function(ffi.Pointer, CXIdxClientEntity)>(); /// An indexing action/session, to be applied to one or multiple @@ -6694,10 +6692,10 @@ class LibClang { ); } - late final _clang_IndexAction_create_ptr = + late final _clang_IndexAction_createPtr = _lookup>( 'clang_IndexAction_create'); - late final _clang_IndexAction_create = _clang_IndexAction_create_ptr + late final _clang_IndexAction_create = _clang_IndexAction_createPtr .asFunction(); /// Destroy the given index action. @@ -6712,11 +6710,11 @@ class LibClang { ); } - late final _clang_IndexAction_dispose_ptr = + late final _clang_IndexAction_disposePtr = _lookup>( 'clang_IndexAction_dispose'); late final _clang_IndexAction_dispose = - _clang_IndexAction_dispose_ptr.asFunction(); + _clang_IndexAction_disposePtr.asFunction(); /// Index the given source file and the translation unit corresponding /// to that file via callbacks implemented through #IndexerCallbacks. @@ -6771,10 +6769,10 @@ class LibClang { ); } - late final _clang_indexSourceFile_ptr = + late final _clang_indexSourceFilePtr = _lookup>( 'clang_indexSourceFile'); - late final _clang_indexSourceFile = _clang_indexSourceFile_ptr.asFunction< + late final _clang_indexSourceFile = _clang_indexSourceFilePtr.asFunction< int Function( CXIndexAction, CXClientData, @@ -6822,11 +6820,11 @@ class LibClang { ); } - late final _clang_indexSourceFileFullArgv_ptr = + late final _clang_indexSourceFileFullArgvPtr = _lookup>( 'clang_indexSourceFileFullArgv'); late final _clang_indexSourceFileFullArgv = - _clang_indexSourceFileFullArgv_ptr.asFunction< + _clang_indexSourceFileFullArgvPtr.asFunction< int Function( CXIndexAction, CXClientData, @@ -6873,11 +6871,11 @@ class LibClang { ); } - late final _clang_indexTranslationUnit_ptr = + late final _clang_indexTranslationUnitPtr = _lookup>( 'clang_indexTranslationUnit'); late final _clang_indexTranslationUnit = - _clang_indexTranslationUnit_ptr.asFunction< + _clang_indexTranslationUnitPtr.asFunction< int Function(CXIndexAction, CXClientData, ffi.Pointer, int, int, CXTranslationUnit)>(); @@ -6905,11 +6903,11 @@ class LibClang { ); } - late final _clang_indexLoc_getFileLocation_ptr = + late final _clang_indexLoc_getFileLocationPtr = _lookup>( 'clang_indexLoc_getFileLocation'); late final _clang_indexLoc_getFileLocation = - _clang_indexLoc_getFileLocation_ptr.asFunction< + _clang_indexLoc_getFileLocationPtr.asFunction< void Function( CXIdxLoc, ffi.Pointer, @@ -6927,11 +6925,11 @@ class LibClang { ); } - late final _clang_indexLoc_getCXSourceLocation_ptr = + late final _clang_indexLoc_getCXSourceLocationPtr = _lookup>( 'clang_indexLoc_getCXSourceLocation'); late final _clang_indexLoc_getCXSourceLocation = - _clang_indexLoc_getCXSourceLocation_ptr + _clang_indexLoc_getCXSourceLocationPtr .asFunction(); /// Visit the fields of a particular type. @@ -6963,10 +6961,10 @@ class LibClang { ); } - late final _clang_Type_visitFields_ptr = + late final _clang_Type_visitFieldsPtr = _lookup>( 'clang_Type_visitFields'); - late final _clang_Type_visitFields = _clang_Type_visitFields_ptr + late final _clang_Type_visitFields = _clang_Type_visitFieldsPtr .asFunction(); late final addresses = _SymbolAddresses(this); @@ -6976,829 +6974,811 @@ class _SymbolAddresses { final LibClang _library; _SymbolAddresses(this._library); ffi.Pointer> - get clang_getCString => _library._clang_getCString_ptr; + get clang_getCString => _library._clang_getCStringPtr; ffi.Pointer> - get clang_disposeString => _library._clang_disposeString_ptr; + get clang_disposeString => _library._clang_disposeStringPtr; ffi.Pointer> - get clang_disposeStringSet => _library._clang_disposeStringSet_ptr; + get clang_disposeStringSet => _library._clang_disposeStringSetPtr; ffi.Pointer> - get clang_createIndex => _library._clang_createIndex_ptr; + get clang_createIndex => _library._clang_createIndexPtr; ffi.Pointer> - get clang_disposeIndex => _library._clang_disposeIndex_ptr; + get clang_disposeIndex => _library._clang_disposeIndexPtr; ffi.Pointer> get clang_CXIndex_setGlobalOptions => - _library._clang_CXIndex_setGlobalOptions_ptr; + _library._clang_CXIndex_setGlobalOptionsPtr; ffi.Pointer> get clang_CXIndex_getGlobalOptions => - _library._clang_CXIndex_getGlobalOptions_ptr; + _library._clang_CXIndex_getGlobalOptionsPtr; ffi.Pointer< ffi.NativeFunction< Native_clang_CXIndex_setInvocationEmissionPathOption>> get clang_CXIndex_setInvocationEmissionPathOption => - _library._clang_CXIndex_setInvocationEmissionPathOption_ptr; + _library._clang_CXIndex_setInvocationEmissionPathOptionPtr; ffi.Pointer> - get clang_getFileName => _library._clang_getFileName_ptr; + get clang_getFileName => _library._clang_getFileNamePtr; ffi.Pointer> - get clang_getFileTime => _library._clang_getFileTime_ptr; + get clang_getFileTime => _library._clang_getFileTimePtr; ffi.Pointer> - get clang_getFileUniqueID => _library._clang_getFileUniqueID_ptr; + get clang_getFileUniqueID => _library._clang_getFileUniqueIDPtr; ffi.Pointer> get clang_isFileMultipleIncludeGuarded => - _library._clang_isFileMultipleIncludeGuarded_ptr; + _library._clang_isFileMultipleIncludeGuardedPtr; ffi.Pointer> get clang_getFile => - _library._clang_getFile_ptr; + _library._clang_getFilePtr; ffi.Pointer> - get clang_getFileContents => _library._clang_getFileContents_ptr; + get clang_getFileContents => _library._clang_getFileContentsPtr; ffi.Pointer> - get clang_File_isEqual => _library._clang_File_isEqual_ptr; + get clang_File_isEqual => _library._clang_File_isEqualPtr; ffi.Pointer> get clang_File_tryGetRealPathName => - _library._clang_File_tryGetRealPathName_ptr; + _library._clang_File_tryGetRealPathNamePtr; ffi.Pointer> - get clang_getNullLocation => _library._clang_getNullLocation_ptr; + get clang_getNullLocation => _library._clang_getNullLocationPtr; ffi.Pointer> - get clang_equalLocations => _library._clang_equalLocations_ptr; + get clang_equalLocations => _library._clang_equalLocationsPtr; ffi.Pointer> - get clang_getLocation => _library._clang_getLocation_ptr; + get clang_getLocation => _library._clang_getLocationPtr; ffi.Pointer> - get clang_getLocationForOffset => - _library._clang_getLocationForOffset_ptr; + get clang_getLocationForOffset => _library._clang_getLocationForOffsetPtr; ffi.Pointer> get clang_Location_isInSystemHeader => - _library._clang_Location_isInSystemHeader_ptr; + _library._clang_Location_isInSystemHeaderPtr; ffi.Pointer> get clang_Location_isFromMainFile => - _library._clang_Location_isFromMainFile_ptr; + _library._clang_Location_isFromMainFilePtr; ffi.Pointer> - get clang_getNullRange => _library._clang_getNullRange_ptr; + get clang_getNullRange => _library._clang_getNullRangePtr; ffi.Pointer> get clang_getRange => - _library._clang_getRange_ptr; + _library._clang_getRangePtr; ffi.Pointer> - get clang_equalRanges => _library._clang_equalRanges_ptr; + get clang_equalRanges => _library._clang_equalRangesPtr; ffi.Pointer> - get clang_Range_isNull => _library._clang_Range_isNull_ptr; + get clang_Range_isNull => _library._clang_Range_isNullPtr; ffi.Pointer> - get clang_getExpansionLocation => - _library._clang_getExpansionLocation_ptr; + get clang_getExpansionLocation => _library._clang_getExpansionLocationPtr; ffi.Pointer> - get clang_getPresumedLocation => _library._clang_getPresumedLocation_ptr; + get clang_getPresumedLocation => _library._clang_getPresumedLocationPtr; ffi.Pointer> get clang_getInstantiationLocation => - _library._clang_getInstantiationLocation_ptr; + _library._clang_getInstantiationLocationPtr; ffi.Pointer> - get clang_getSpellingLocation => _library._clang_getSpellingLocation_ptr; + get clang_getSpellingLocation => _library._clang_getSpellingLocationPtr; ffi.Pointer> - get clang_getFileLocation => _library._clang_getFileLocation_ptr; + get clang_getFileLocation => _library._clang_getFileLocationPtr; ffi.Pointer> - get clang_getRangeStart => _library._clang_getRangeStart_ptr; + get clang_getRangeStart => _library._clang_getRangeStartPtr; ffi.Pointer> - get clang_getRangeEnd => _library._clang_getRangeEnd_ptr; + get clang_getRangeEnd => _library._clang_getRangeEndPtr; ffi.Pointer> - get clang_getSkippedRanges => _library._clang_getSkippedRanges_ptr; + get clang_getSkippedRanges => _library._clang_getSkippedRangesPtr; ffi.Pointer> - get clang_getAllSkippedRanges => _library._clang_getAllSkippedRanges_ptr; + get clang_getAllSkippedRanges => _library._clang_getAllSkippedRangesPtr; ffi.Pointer> get clang_disposeSourceRangeList => - _library._clang_disposeSourceRangeList_ptr; + _library._clang_disposeSourceRangeListPtr; ffi.Pointer> get clang_getNumDiagnosticsInSet => - _library._clang_getNumDiagnosticsInSet_ptr; + _library._clang_getNumDiagnosticsInSetPtr; ffi.Pointer> - get clang_getDiagnosticInSet => _library._clang_getDiagnosticInSet_ptr; + get clang_getDiagnosticInSet => _library._clang_getDiagnosticInSetPtr; ffi.Pointer> - get clang_loadDiagnostics => _library._clang_loadDiagnostics_ptr; + get clang_loadDiagnostics => _library._clang_loadDiagnosticsPtr; ffi.Pointer> - get clang_disposeDiagnosticSet => - _library._clang_disposeDiagnosticSet_ptr; + get clang_disposeDiagnosticSet => _library._clang_disposeDiagnosticSetPtr; ffi.Pointer> - get clang_getChildDiagnostics => _library._clang_getChildDiagnostics_ptr; + get clang_getChildDiagnostics => _library._clang_getChildDiagnosticsPtr; ffi.Pointer> - get clang_getNumDiagnostics => _library._clang_getNumDiagnostics_ptr; + get clang_getNumDiagnostics => _library._clang_getNumDiagnosticsPtr; ffi.Pointer> - get clang_getDiagnostic => _library._clang_getDiagnostic_ptr; + get clang_getDiagnostic => _library._clang_getDiagnosticPtr; ffi.Pointer> get clang_getDiagnosticSetFromTU => - _library._clang_getDiagnosticSetFromTU_ptr; + _library._clang_getDiagnosticSetFromTUPtr; ffi.Pointer> - get clang_disposeDiagnostic => _library._clang_disposeDiagnostic_ptr; + get clang_disposeDiagnostic => _library._clang_disposeDiagnosticPtr; ffi.Pointer> - get clang_formatDiagnostic => _library._clang_formatDiagnostic_ptr; + get clang_formatDiagnostic => _library._clang_formatDiagnosticPtr; ffi.Pointer> get clang_defaultDiagnosticDisplayOptions => - _library._clang_defaultDiagnosticDisplayOptions_ptr; + _library._clang_defaultDiagnosticDisplayOptionsPtr; ffi.Pointer> get clang_getDiagnosticSeverity => - _library._clang_getDiagnosticSeverity_ptr; + _library._clang_getDiagnosticSeverityPtr; ffi.Pointer> get clang_getDiagnosticLocation => - _library._clang_getDiagnosticLocation_ptr; + _library._clang_getDiagnosticLocationPtr; ffi.Pointer> get clang_getDiagnosticSpelling => - _library._clang_getDiagnosticSpelling_ptr; + _library._clang_getDiagnosticSpellingPtr; ffi.Pointer> - get clang_getDiagnosticOption => _library._clang_getDiagnosticOption_ptr; + get clang_getDiagnosticOption => _library._clang_getDiagnosticOptionPtr; ffi.Pointer> get clang_getDiagnosticCategory => - _library._clang_getDiagnosticCategory_ptr; + _library._clang_getDiagnosticCategoryPtr; ffi.Pointer> get clang_getDiagnosticCategoryName => - _library._clang_getDiagnosticCategoryName_ptr; + _library._clang_getDiagnosticCategoryNamePtr; ffi.Pointer> get clang_getDiagnosticCategoryText => - _library._clang_getDiagnosticCategoryText_ptr; + _library._clang_getDiagnosticCategoryTextPtr; ffi.Pointer> get clang_getDiagnosticNumRanges => - _library._clang_getDiagnosticNumRanges_ptr; + _library._clang_getDiagnosticNumRangesPtr; ffi.Pointer> - get clang_getDiagnosticRange => _library._clang_getDiagnosticRange_ptr; + get clang_getDiagnosticRange => _library._clang_getDiagnosticRangePtr; ffi.Pointer> get clang_getDiagnosticNumFixIts => - _library._clang_getDiagnosticNumFixIts_ptr; + _library._clang_getDiagnosticNumFixItsPtr; ffi.Pointer> - get clang_getDiagnosticFixIt => _library._clang_getDiagnosticFixIt_ptr; + get clang_getDiagnosticFixIt => _library._clang_getDiagnosticFixItPtr; ffi.Pointer> get clang_getTranslationUnitSpelling => - _library._clang_getTranslationUnitSpelling_ptr; + _library._clang_getTranslationUnitSpellingPtr; ffi.Pointer< ffi.NativeFunction> get clang_createTranslationUnitFromSourceFile => - _library._clang_createTranslationUnitFromSourceFile_ptr; + _library._clang_createTranslationUnitFromSourceFilePtr; ffi.Pointer> get clang_createTranslationUnit => - _library._clang_createTranslationUnit_ptr; + _library._clang_createTranslationUnitPtr; ffi.Pointer> get clang_createTranslationUnit2 => - _library._clang_createTranslationUnit2_ptr; + _library._clang_createTranslationUnit2Ptr; ffi.Pointer< ffi.NativeFunction> get clang_defaultEditingTranslationUnitOptions => - _library._clang_defaultEditingTranslationUnitOptions_ptr; + _library._clang_defaultEditingTranslationUnitOptionsPtr; ffi.Pointer> - get clang_parseTranslationUnit => - _library._clang_parseTranslationUnit_ptr; + get clang_parseTranslationUnit => _library._clang_parseTranslationUnitPtr; ffi.Pointer> get clang_parseTranslationUnit2 => - _library._clang_parseTranslationUnit2_ptr; + _library._clang_parseTranslationUnit2Ptr; ffi.Pointer> get clang_parseTranslationUnit2FullArgv => - _library._clang_parseTranslationUnit2FullArgv_ptr; + _library._clang_parseTranslationUnit2FullArgvPtr; ffi.Pointer> - get clang_defaultSaveOptions => _library._clang_defaultSaveOptions_ptr; + get clang_defaultSaveOptions => _library._clang_defaultSaveOptionsPtr; ffi.Pointer> - get clang_saveTranslationUnit => _library._clang_saveTranslationUnit_ptr; + get clang_saveTranslationUnit => _library._clang_saveTranslationUnitPtr; ffi.Pointer> get clang_suspendTranslationUnit => - _library._clang_suspendTranslationUnit_ptr; + _library._clang_suspendTranslationUnitPtr; ffi.Pointer> get clang_disposeTranslationUnit => - _library._clang_disposeTranslationUnit_ptr; + _library._clang_disposeTranslationUnitPtr; ffi.Pointer> get clang_defaultReparseOptions => - _library._clang_defaultReparseOptions_ptr; + _library._clang_defaultReparseOptionsPtr; ffi.Pointer> get clang_reparseTranslationUnit => - _library._clang_reparseTranslationUnit_ptr; + _library._clang_reparseTranslationUnitPtr; ffi.Pointer> get clang_getTUResourceUsageName => - _library._clang_getTUResourceUsageName_ptr; + _library._clang_getTUResourceUsageNamePtr; ffi.Pointer> - get clang_getCXTUResourceUsage => - _library._clang_getCXTUResourceUsage_ptr; + get clang_getCXTUResourceUsage => _library._clang_getCXTUResourceUsagePtr; ffi.Pointer> get clang_disposeCXTUResourceUsage => - _library._clang_disposeCXTUResourceUsage_ptr; + _library._clang_disposeCXTUResourceUsagePtr; ffi.Pointer> get clang_getTranslationUnitTargetInfo => - _library._clang_getTranslationUnitTargetInfo_ptr; + _library._clang_getTranslationUnitTargetInfoPtr; ffi.Pointer> - get clang_TargetInfo_dispose => _library._clang_TargetInfo_dispose_ptr; + get clang_TargetInfo_dispose => _library._clang_TargetInfo_disposePtr; ffi.Pointer> - get clang_TargetInfo_getTriple => - _library._clang_TargetInfo_getTriple_ptr; + get clang_TargetInfo_getTriple => _library._clang_TargetInfo_getTriplePtr; ffi.Pointer> get clang_TargetInfo_getPointerWidth => - _library._clang_TargetInfo_getPointerWidth_ptr; + _library._clang_TargetInfo_getPointerWidthPtr; ffi.Pointer> - get clang_getNullCursor => _library._clang_getNullCursor_ptr; + get clang_getNullCursor => _library._clang_getNullCursorPtr; ffi.Pointer> get clang_getTranslationUnitCursor => - _library._clang_getTranslationUnitCursor_ptr; + _library._clang_getTranslationUnitCursorPtr; ffi.Pointer> - get clang_equalCursors => _library._clang_equalCursors_ptr; + get clang_equalCursors => _library._clang_equalCursorsPtr; ffi.Pointer> - get clang_Cursor_isNull => _library._clang_Cursor_isNull_ptr; + get clang_Cursor_isNull => _library._clang_Cursor_isNullPtr; ffi.Pointer> - get clang_hashCursor => _library._clang_hashCursor_ptr; + get clang_hashCursor => _library._clang_hashCursorPtr; ffi.Pointer> - get clang_getCursorKind => _library._clang_getCursorKind_ptr; + get clang_getCursorKind => _library._clang_getCursorKindPtr; ffi.Pointer> - get clang_isDeclaration => _library._clang_isDeclaration_ptr; + get clang_isDeclaration => _library._clang_isDeclarationPtr; ffi.Pointer> - get clang_isInvalidDeclaration => - _library._clang_isInvalidDeclaration_ptr; + get clang_isInvalidDeclaration => _library._clang_isInvalidDeclarationPtr; ffi.Pointer> - get clang_isReference => _library._clang_isReference_ptr; + get clang_isReference => _library._clang_isReferencePtr; ffi.Pointer> - get clang_isExpression => _library._clang_isExpression_ptr; + get clang_isExpression => _library._clang_isExpressionPtr; ffi.Pointer> - get clang_isStatement => _library._clang_isStatement_ptr; + get clang_isStatement => _library._clang_isStatementPtr; ffi.Pointer> - get clang_isAttribute => _library._clang_isAttribute_ptr; + get clang_isAttribute => _library._clang_isAttributePtr; ffi.Pointer> - get clang_Cursor_hasAttrs => _library._clang_Cursor_hasAttrs_ptr; + get clang_Cursor_hasAttrs => _library._clang_Cursor_hasAttrsPtr; ffi.Pointer> get clang_isInvalid => - _library._clang_isInvalid_ptr; + _library._clang_isInvalidPtr; ffi.Pointer> - get clang_isTranslationUnit => _library._clang_isTranslationUnit_ptr; + get clang_isTranslationUnit => _library._clang_isTranslationUnitPtr; ffi.Pointer> - get clang_isPreprocessing => _library._clang_isPreprocessing_ptr; + get clang_isPreprocessing => _library._clang_isPreprocessingPtr; ffi.Pointer> - get clang_isUnexposed => _library._clang_isUnexposed_ptr; + get clang_isUnexposed => _library._clang_isUnexposedPtr; ffi.Pointer> - get clang_getCursorLinkage => _library._clang_getCursorLinkage_ptr; + get clang_getCursorLinkage => _library._clang_getCursorLinkagePtr; ffi.Pointer> - get clang_getCursorVisibility => _library._clang_getCursorVisibility_ptr; + get clang_getCursorVisibility => _library._clang_getCursorVisibilityPtr; ffi.Pointer> get clang_getCursorAvailability => - _library._clang_getCursorAvailability_ptr; + _library._clang_getCursorAvailabilityPtr; ffi.Pointer> get clang_getCursorPlatformAvailability => - _library._clang_getCursorPlatformAvailability_ptr; + _library._clang_getCursorPlatformAvailabilityPtr; ffi.Pointer> get clang_disposeCXPlatformAvailability => - _library._clang_disposeCXPlatformAvailability_ptr; + _library._clang_disposeCXPlatformAvailabilityPtr; ffi.Pointer> - get clang_getCursorLanguage => _library._clang_getCursorLanguage_ptr; + get clang_getCursorLanguage => _library._clang_getCursorLanguagePtr; ffi.Pointer> - get clang_getCursorTLSKind => _library._clang_getCursorTLSKind_ptr; + get clang_getCursorTLSKind => _library._clang_getCursorTLSKindPtr; ffi.Pointer> get clang_Cursor_getTranslationUnit => - _library._clang_Cursor_getTranslationUnit_ptr; + _library._clang_Cursor_getTranslationUnitPtr; ffi.Pointer> - get clang_createCXCursorSet => _library._clang_createCXCursorSet_ptr; + get clang_createCXCursorSet => _library._clang_createCXCursorSetPtr; ffi.Pointer> - get clang_disposeCXCursorSet => _library._clang_disposeCXCursorSet_ptr; + get clang_disposeCXCursorSet => _library._clang_disposeCXCursorSetPtr; ffi.Pointer> - get clang_CXCursorSet_contains => - _library._clang_CXCursorSet_contains_ptr; + get clang_CXCursorSet_contains => _library._clang_CXCursorSet_containsPtr; ffi.Pointer> - get clang_CXCursorSet_insert => _library._clang_CXCursorSet_insert_ptr; + get clang_CXCursorSet_insert => _library._clang_CXCursorSet_insertPtr; ffi.Pointer> get clang_getCursorSemanticParent => - _library._clang_getCursorSemanticParent_ptr; + _library._clang_getCursorSemanticParentPtr; ffi.Pointer> get clang_getCursorLexicalParent => - _library._clang_getCursorLexicalParent_ptr; + _library._clang_getCursorLexicalParentPtr; ffi.Pointer> - get clang_getOverriddenCursors => - _library._clang_getOverriddenCursors_ptr; + get clang_getOverriddenCursors => _library._clang_getOverriddenCursorsPtr; ffi.Pointer> get clang_disposeOverriddenCursors => - _library._clang_disposeOverriddenCursors_ptr; + _library._clang_disposeOverriddenCursorsPtr; ffi.Pointer> - get clang_getIncludedFile => _library._clang_getIncludedFile_ptr; + get clang_getIncludedFile => _library._clang_getIncludedFilePtr; ffi.Pointer> get clang_getCursor => - _library._clang_getCursor_ptr; + _library._clang_getCursorPtr; ffi.Pointer> - get clang_getCursorLocation => _library._clang_getCursorLocation_ptr; + get clang_getCursorLocation => _library._clang_getCursorLocationPtr; ffi.Pointer> - get clang_getCursorExtent => _library._clang_getCursorExtent_ptr; + get clang_getCursorExtent => _library._clang_getCursorExtentPtr; ffi.Pointer> - get clang_getCursorType => _library._clang_getCursorType_ptr; + get clang_getCursorType => _library._clang_getCursorTypePtr; ffi.Pointer> - get clang_getTypeSpelling => _library._clang_getTypeSpelling_ptr; + get clang_getTypeSpelling => _library._clang_getTypeSpellingPtr; ffi.Pointer> get clang_getTypedefDeclUnderlyingType => - _library._clang_getTypedefDeclUnderlyingType_ptr; + _library._clang_getTypedefDeclUnderlyingTypePtr; ffi.Pointer> get clang_getEnumDeclIntegerType => - _library._clang_getEnumDeclIntegerType_ptr; + _library._clang_getEnumDeclIntegerTypePtr; ffi.Pointer> get clang_getEnumConstantDeclValue => - _library._clang_getEnumConstantDeclValue_ptr; + _library._clang_getEnumConstantDeclValuePtr; ffi.Pointer> get clang_getEnumConstantDeclUnsignedValue => - _library._clang_getEnumConstantDeclUnsignedValue_ptr; + _library._clang_getEnumConstantDeclUnsignedValuePtr; ffi.Pointer> - get clang_getFieldDeclBitWidth => - _library._clang_getFieldDeclBitWidth_ptr; + get clang_getFieldDeclBitWidth => _library._clang_getFieldDeclBitWidthPtr; ffi.Pointer> get clang_Cursor_getNumArguments => - _library._clang_Cursor_getNumArguments_ptr; + _library._clang_Cursor_getNumArgumentsPtr; ffi.Pointer> - get clang_Cursor_getArgument => _library._clang_Cursor_getArgument_ptr; + get clang_Cursor_getArgument => _library._clang_Cursor_getArgumentPtr; ffi.Pointer> get clang_Cursor_getNumTemplateArguments => - _library._clang_Cursor_getNumTemplateArguments_ptr; + _library._clang_Cursor_getNumTemplateArgumentsPtr; ffi.Pointer> get clang_Cursor_getTemplateArgumentKind => - _library._clang_Cursor_getTemplateArgumentKind_ptr; + _library._clang_Cursor_getTemplateArgumentKindPtr; ffi.Pointer> get clang_Cursor_getTemplateArgumentType => - _library._clang_Cursor_getTemplateArgumentType_ptr; + _library._clang_Cursor_getTemplateArgumentTypePtr; ffi.Pointer> get clang_Cursor_getTemplateArgumentValue => - _library._clang_Cursor_getTemplateArgumentValue_ptr; + _library._clang_Cursor_getTemplateArgumentValuePtr; ffi.Pointer< ffi.NativeFunction< Native_clang_Cursor_getTemplateArgumentUnsignedValue>> get clang_Cursor_getTemplateArgumentUnsignedValue => - _library._clang_Cursor_getTemplateArgumentUnsignedValue_ptr; + _library._clang_Cursor_getTemplateArgumentUnsignedValuePtr; ffi.Pointer> - get clang_equalTypes => _library._clang_equalTypes_ptr; + get clang_equalTypes => _library._clang_equalTypesPtr; ffi.Pointer> - get clang_getCanonicalType => _library._clang_getCanonicalType_ptr; + get clang_getCanonicalType => _library._clang_getCanonicalTypePtr; ffi.Pointer> - get clang_isConstQualifiedType => - _library._clang_isConstQualifiedType_ptr; + get clang_isConstQualifiedType => _library._clang_isConstQualifiedTypePtr; ffi.Pointer> get clang_Cursor_isMacroFunctionLike => - _library._clang_Cursor_isMacroFunctionLike_ptr; + _library._clang_Cursor_isMacroFunctionLikePtr; ffi.Pointer> get clang_Cursor_isMacroBuiltin => - _library._clang_Cursor_isMacroBuiltin_ptr; + _library._clang_Cursor_isMacroBuiltinPtr; ffi.Pointer> get clang_Cursor_isFunctionInlined => - _library._clang_Cursor_isFunctionInlined_ptr; + _library._clang_Cursor_isFunctionInlinedPtr; ffi.Pointer> get clang_isVolatileQualifiedType => - _library._clang_isVolatileQualifiedType_ptr; + _library._clang_isVolatileQualifiedTypePtr; ffi.Pointer> get clang_isRestrictQualifiedType => - _library._clang_isRestrictQualifiedType_ptr; + _library._clang_isRestrictQualifiedTypePtr; ffi.Pointer> - get clang_getAddressSpace => _library._clang_getAddressSpace_ptr; + get clang_getAddressSpace => _library._clang_getAddressSpacePtr; ffi.Pointer> - get clang_getTypedefName => _library._clang_getTypedefName_ptr; + get clang_getTypedefName => _library._clang_getTypedefNamePtr; ffi.Pointer> - get clang_getPointeeType => _library._clang_getPointeeType_ptr; + get clang_getPointeeType => _library._clang_getPointeeTypePtr; ffi.Pointer> - get clang_getTypeDeclaration => _library._clang_getTypeDeclaration_ptr; + get clang_getTypeDeclaration => _library._clang_getTypeDeclarationPtr; ffi.Pointer> get clang_getDeclObjCTypeEncoding => - _library._clang_getDeclObjCTypeEncoding_ptr; + _library._clang_getDeclObjCTypeEncodingPtr; ffi.Pointer> - get clang_Type_getObjCEncoding => - _library._clang_Type_getObjCEncoding_ptr; + get clang_Type_getObjCEncoding => _library._clang_Type_getObjCEncodingPtr; ffi.Pointer> - get clang_getTypeKindSpelling => _library._clang_getTypeKindSpelling_ptr; + get clang_getTypeKindSpelling => _library._clang_getTypeKindSpellingPtr; ffi.Pointer> get clang_getFunctionTypeCallingConv => - _library._clang_getFunctionTypeCallingConv_ptr; + _library._clang_getFunctionTypeCallingConvPtr; ffi.Pointer> - get clang_getResultType => _library._clang_getResultType_ptr; + get clang_getResultType => _library._clang_getResultTypePtr; ffi.Pointer> get clang_getExceptionSpecificationType => - _library._clang_getExceptionSpecificationType_ptr; + _library._clang_getExceptionSpecificationTypePtr; ffi.Pointer> - get clang_getNumArgTypes => _library._clang_getNumArgTypes_ptr; + get clang_getNumArgTypes => _library._clang_getNumArgTypesPtr; ffi.Pointer> - get clang_getArgType => _library._clang_getArgType_ptr; + get clang_getArgType => _library._clang_getArgTypePtr; ffi.Pointer> get clang_Type_getObjCObjectBaseType => - _library._clang_Type_getObjCObjectBaseType_ptr; + _library._clang_Type_getObjCObjectBaseTypePtr; ffi.Pointer> get clang_Type_getNumObjCProtocolRefs => - _library._clang_Type_getNumObjCProtocolRefs_ptr; + _library._clang_Type_getNumObjCProtocolRefsPtr; ffi.Pointer> get clang_Type_getObjCProtocolDecl => - _library._clang_Type_getObjCProtocolDecl_ptr; + _library._clang_Type_getObjCProtocolDeclPtr; ffi.Pointer> get clang_Type_getNumObjCTypeArgs => - _library._clang_Type_getNumObjCTypeArgs_ptr; + _library._clang_Type_getNumObjCTypeArgsPtr; ffi.Pointer> - get clang_Type_getObjCTypeArg => _library._clang_Type_getObjCTypeArg_ptr; + get clang_Type_getObjCTypeArg => _library._clang_Type_getObjCTypeArgPtr; ffi.Pointer> get clang_isFunctionTypeVariadic => - _library._clang_isFunctionTypeVariadic_ptr; + _library._clang_isFunctionTypeVariadicPtr; ffi.Pointer> - get clang_getCursorResultType => _library._clang_getCursorResultType_ptr; + get clang_getCursorResultType => _library._clang_getCursorResultTypePtr; ffi.Pointer< ffi.NativeFunction> get clang_getCursorExceptionSpecificationType => - _library._clang_getCursorExceptionSpecificationType_ptr; + _library._clang_getCursorExceptionSpecificationTypePtr; ffi.Pointer> get clang_isPODType => - _library._clang_isPODType_ptr; + _library._clang_isPODTypePtr; ffi.Pointer> - get clang_getElementType => _library._clang_getElementType_ptr; + get clang_getElementType => _library._clang_getElementTypePtr; ffi.Pointer> - get clang_getNumElements => _library._clang_getNumElements_ptr; + get clang_getNumElements => _library._clang_getNumElementsPtr; ffi.Pointer> - get clang_getArrayElementType => _library._clang_getArrayElementType_ptr; + get clang_getArrayElementType => _library._clang_getArrayElementTypePtr; ffi.Pointer> - get clang_getArraySize => _library._clang_getArraySize_ptr; + get clang_getArraySize => _library._clang_getArraySizePtr; ffi.Pointer> - get clang_Type_getNamedType => _library._clang_Type_getNamedType_ptr; + get clang_Type_getNamedType => _library._clang_Type_getNamedTypePtr; ffi.Pointer> get clang_Type_isTransparentTagTypedef => - _library._clang_Type_isTransparentTagTypedef_ptr; + _library._clang_Type_isTransparentTagTypedefPtr; ffi.Pointer> - get clang_Type_getNullability => _library._clang_Type_getNullability_ptr; + get clang_Type_getNullability => _library._clang_Type_getNullabilityPtr; ffi.Pointer> - get clang_Type_getAlignOf => _library._clang_Type_getAlignOf_ptr; + get clang_Type_getAlignOf => _library._clang_Type_getAlignOfPtr; ffi.Pointer> - get clang_Type_getClassType => _library._clang_Type_getClassType_ptr; + get clang_Type_getClassType => _library._clang_Type_getClassTypePtr; ffi.Pointer> - get clang_Type_getSizeOf => _library._clang_Type_getSizeOf_ptr; + get clang_Type_getSizeOf => _library._clang_Type_getSizeOfPtr; ffi.Pointer> - get clang_Type_getOffsetOf => _library._clang_Type_getOffsetOf_ptr; + get clang_Type_getOffsetOf => _library._clang_Type_getOffsetOfPtr; ffi.Pointer> - get clang_Type_getModifiedType => - _library._clang_Type_getModifiedType_ptr; + get clang_Type_getModifiedType => _library._clang_Type_getModifiedTypePtr; ffi.Pointer> get clang_Cursor_getOffsetOfField => - _library._clang_Cursor_getOffsetOfField_ptr; + _library._clang_Cursor_getOffsetOfFieldPtr; ffi.Pointer> - get clang_Cursor_isAnonymous => _library._clang_Cursor_isAnonymous_ptr; + get clang_Cursor_isAnonymous => _library._clang_Cursor_isAnonymousPtr; ffi.Pointer> get clang_Cursor_isAnonymousRecordDecl => - _library._clang_Cursor_isAnonymousRecordDecl_ptr; + _library._clang_Cursor_isAnonymousRecordDeclPtr; ffi.Pointer> get clang_Cursor_isInlineNamespace => - _library._clang_Cursor_isInlineNamespace_ptr; + _library._clang_Cursor_isInlineNamespacePtr; ffi.Pointer> get clang_Type_getNumTemplateArguments => - _library._clang_Type_getNumTemplateArguments_ptr; + _library._clang_Type_getNumTemplateArgumentsPtr; ffi.Pointer> get clang_Type_getTemplateArgumentAsType => - _library._clang_Type_getTemplateArgumentAsType_ptr; + _library._clang_Type_getTemplateArgumentAsTypePtr; ffi.Pointer> get clang_Type_getCXXRefQualifier => - _library._clang_Type_getCXXRefQualifier_ptr; + _library._clang_Type_getCXXRefQualifierPtr; ffi.Pointer> - get clang_Cursor_isBitField => _library._clang_Cursor_isBitField_ptr; + get clang_Cursor_isBitField => _library._clang_Cursor_isBitFieldPtr; ffi.Pointer> - get clang_isVirtualBase => _library._clang_isVirtualBase_ptr; + get clang_isVirtualBase => _library._clang_isVirtualBasePtr; ffi.Pointer> get clang_getCXXAccessSpecifier => - _library._clang_getCXXAccessSpecifier_ptr; + _library._clang_getCXXAccessSpecifierPtr; ffi.Pointer> get clang_Cursor_getStorageClass => - _library._clang_Cursor_getStorageClass_ptr; + _library._clang_Cursor_getStorageClassPtr; ffi.Pointer> get clang_getNumOverloadedDecls => - _library._clang_getNumOverloadedDecls_ptr; + _library._clang_getNumOverloadedDeclsPtr; ffi.Pointer> - get clang_getOverloadedDecl => _library._clang_getOverloadedDecl_ptr; + get clang_getOverloadedDecl => _library._clang_getOverloadedDeclPtr; ffi.Pointer> get clang_getIBOutletCollectionType => - _library._clang_getIBOutletCollectionType_ptr; + _library._clang_getIBOutletCollectionTypePtr; ffi.Pointer> - get clang_visitChildren => _library._clang_visitChildren_ptr; + get clang_visitChildren => _library._clang_visitChildrenPtr; ffi.Pointer> - get clang_getCursorUSR => _library._clang_getCursorUSR_ptr; + get clang_getCursorUSR => _library._clang_getCursorUSRPtr; ffi.Pointer> get clang_constructUSR_ObjCClass => - _library._clang_constructUSR_ObjCClass_ptr; + _library._clang_constructUSR_ObjCClassPtr; ffi.Pointer> get clang_constructUSR_ObjCCategory => - _library._clang_constructUSR_ObjCCategory_ptr; + _library._clang_constructUSR_ObjCCategoryPtr; ffi.Pointer> get clang_constructUSR_ObjCProtocol => - _library._clang_constructUSR_ObjCProtocol_ptr; + _library._clang_constructUSR_ObjCProtocolPtr; ffi.Pointer> get clang_constructUSR_ObjCIvar => - _library._clang_constructUSR_ObjCIvar_ptr; + _library._clang_constructUSR_ObjCIvarPtr; ffi.Pointer> get clang_constructUSR_ObjCMethod => - _library._clang_constructUSR_ObjCMethod_ptr; + _library._clang_constructUSR_ObjCMethodPtr; ffi.Pointer> get clang_constructUSR_ObjCProperty => - _library._clang_constructUSR_ObjCProperty_ptr; + _library._clang_constructUSR_ObjCPropertyPtr; ffi.Pointer> - get clang_getCursorSpelling => _library._clang_getCursorSpelling_ptr; + get clang_getCursorSpelling => _library._clang_getCursorSpellingPtr; ffi.Pointer> get clang_Cursor_getSpellingNameRange => - _library._clang_Cursor_getSpellingNameRange_ptr; + _library._clang_Cursor_getSpellingNameRangePtr; ffi.Pointer> get clang_PrintingPolicy_getProperty => - _library._clang_PrintingPolicy_getProperty_ptr; + _library._clang_PrintingPolicy_getPropertyPtr; ffi.Pointer> get clang_PrintingPolicy_setProperty => - _library._clang_PrintingPolicy_setProperty_ptr; + _library._clang_PrintingPolicy_setPropertyPtr; ffi.Pointer> get clang_getCursorPrintingPolicy => - _library._clang_getCursorPrintingPolicy_ptr; + _library._clang_getCursorPrintingPolicyPtr; ffi.Pointer> get clang_PrintingPolicy_dispose => - _library._clang_PrintingPolicy_dispose_ptr; + _library._clang_PrintingPolicy_disposePtr; ffi.Pointer> get clang_getCursorPrettyPrinted => - _library._clang_getCursorPrettyPrinted_ptr; + _library._clang_getCursorPrettyPrintedPtr; ffi.Pointer> - get clang_getCursorDisplayName => - _library._clang_getCursorDisplayName_ptr; + get clang_getCursorDisplayName => _library._clang_getCursorDisplayNamePtr; ffi.Pointer> - get clang_getCursorReferenced => _library._clang_getCursorReferenced_ptr; + get clang_getCursorReferenced => _library._clang_getCursorReferencedPtr; ffi.Pointer> - get clang_getCursorDefinition => _library._clang_getCursorDefinition_ptr; + get clang_getCursorDefinition => _library._clang_getCursorDefinitionPtr; ffi.Pointer> - get clang_isCursorDefinition => _library._clang_isCursorDefinition_ptr; + get clang_isCursorDefinition => _library._clang_isCursorDefinitionPtr; ffi.Pointer> - get clang_getCanonicalCursor => _library._clang_getCanonicalCursor_ptr; + get clang_getCanonicalCursor => _library._clang_getCanonicalCursorPtr; ffi.Pointer> get clang_Cursor_getObjCSelectorIndex => - _library._clang_Cursor_getObjCSelectorIndex_ptr; + _library._clang_Cursor_getObjCSelectorIndexPtr; ffi.Pointer> - get clang_Cursor_isDynamicCall => - _library._clang_Cursor_isDynamicCall_ptr; + get clang_Cursor_isDynamicCall => _library._clang_Cursor_isDynamicCallPtr; ffi.Pointer> get clang_Cursor_getReceiverType => - _library._clang_Cursor_getReceiverType_ptr; + _library._clang_Cursor_getReceiverTypePtr; ffi.Pointer> get clang_Cursor_getObjCPropertyAttributes => - _library._clang_Cursor_getObjCPropertyAttributes_ptr; + _library._clang_Cursor_getObjCPropertyAttributesPtr; ffi.Pointer> get clang_Cursor_getObjCPropertyGetterName => - _library._clang_Cursor_getObjCPropertyGetterName_ptr; + _library._clang_Cursor_getObjCPropertyGetterNamePtr; ffi.Pointer> get clang_Cursor_getObjCPropertySetterName => - _library._clang_Cursor_getObjCPropertySetterName_ptr; + _library._clang_Cursor_getObjCPropertySetterNamePtr; ffi.Pointer> get clang_Cursor_getObjCDeclQualifiers => - _library._clang_Cursor_getObjCDeclQualifiers_ptr; + _library._clang_Cursor_getObjCDeclQualifiersPtr; ffi.Pointer> get clang_Cursor_isObjCOptional => - _library._clang_Cursor_isObjCOptional_ptr; + _library._clang_Cursor_isObjCOptionalPtr; ffi.Pointer> - get clang_Cursor_isVariadic => _library._clang_Cursor_isVariadic_ptr; + get clang_Cursor_isVariadic => _library._clang_Cursor_isVariadicPtr; ffi.Pointer> get clang_Cursor_isExternalSymbol => - _library._clang_Cursor_isExternalSymbol_ptr; + _library._clang_Cursor_isExternalSymbolPtr; ffi.Pointer> get clang_Cursor_getCommentRange => - _library._clang_Cursor_getCommentRange_ptr; + _library._clang_Cursor_getCommentRangePtr; ffi.Pointer> get clang_Cursor_getRawCommentText => - _library._clang_Cursor_getRawCommentText_ptr; + _library._clang_Cursor_getRawCommentTextPtr; ffi.Pointer> get clang_Cursor_getBriefCommentText => - _library._clang_Cursor_getBriefCommentText_ptr; + _library._clang_Cursor_getBriefCommentTextPtr; ffi.Pointer> - get clang_Cursor_getMangling => _library._clang_Cursor_getMangling_ptr; + get clang_Cursor_getMangling => _library._clang_Cursor_getManglingPtr; ffi.Pointer> get clang_Cursor_getCXXManglings => - _library._clang_Cursor_getCXXManglings_ptr; + _library._clang_Cursor_getCXXManglingsPtr; ffi.Pointer> get clang_Cursor_getObjCManglings => - _library._clang_Cursor_getObjCManglings_ptr; + _library._clang_Cursor_getObjCManglingsPtr; ffi.Pointer> - get clang_Cursor_getModule => _library._clang_Cursor_getModule_ptr; + get clang_Cursor_getModule => _library._clang_Cursor_getModulePtr; ffi.Pointer> - get clang_getModuleForFile => _library._clang_getModuleForFile_ptr; + get clang_getModuleForFile => _library._clang_getModuleForFilePtr; ffi.Pointer> - get clang_Module_getASTFile => _library._clang_Module_getASTFile_ptr; + get clang_Module_getASTFile => _library._clang_Module_getASTFilePtr; ffi.Pointer> - get clang_Module_getParent => _library._clang_Module_getParent_ptr; + get clang_Module_getParent => _library._clang_Module_getParentPtr; ffi.Pointer> - get clang_Module_getName => _library._clang_Module_getName_ptr; + get clang_Module_getName => _library._clang_Module_getNamePtr; ffi.Pointer> - get clang_Module_getFullName => _library._clang_Module_getFullName_ptr; + get clang_Module_getFullName => _library._clang_Module_getFullNamePtr; ffi.Pointer> - get clang_Module_isSystem => _library._clang_Module_isSystem_ptr; + get clang_Module_isSystem => _library._clang_Module_isSystemPtr; ffi.Pointer> get clang_Module_getNumTopLevelHeaders => - _library._clang_Module_getNumTopLevelHeaders_ptr; + _library._clang_Module_getNumTopLevelHeadersPtr; ffi.Pointer> get clang_Module_getTopLevelHeader => - _library._clang_Module_getTopLevelHeader_ptr; + _library._clang_Module_getTopLevelHeaderPtr; ffi.Pointer< ffi.NativeFunction< Native_clang_CXXConstructor_isConvertingConstructor>> get clang_CXXConstructor_isConvertingConstructor => - _library._clang_CXXConstructor_isConvertingConstructor_ptr; + _library._clang_CXXConstructor_isConvertingConstructorPtr; ffi.Pointer> get clang_CXXConstructor_isCopyConstructor => - _library._clang_CXXConstructor_isCopyConstructor_ptr; + _library._clang_CXXConstructor_isCopyConstructorPtr; ffi.Pointer< ffi.NativeFunction> get clang_CXXConstructor_isDefaultConstructor => - _library._clang_CXXConstructor_isDefaultConstructor_ptr; + _library._clang_CXXConstructor_isDefaultConstructorPtr; ffi.Pointer> get clang_CXXConstructor_isMoveConstructor => - _library._clang_CXXConstructor_isMoveConstructor_ptr; + _library._clang_CXXConstructor_isMoveConstructorPtr; ffi.Pointer> - get clang_CXXField_isMutable => _library._clang_CXXField_isMutable_ptr; + get clang_CXXField_isMutable => _library._clang_CXXField_isMutablePtr; ffi.Pointer> get clang_CXXMethod_isDefaulted => - _library._clang_CXXMethod_isDefaulted_ptr; + _library._clang_CXXMethod_isDefaultedPtr; ffi.Pointer> get clang_CXXMethod_isPureVirtual => - _library._clang_CXXMethod_isPureVirtual_ptr; + _library._clang_CXXMethod_isPureVirtualPtr; ffi.Pointer> - get clang_CXXMethod_isStatic => _library._clang_CXXMethod_isStatic_ptr; + get clang_CXXMethod_isStatic => _library._clang_CXXMethod_isStaticPtr; ffi.Pointer> - get clang_CXXMethod_isVirtual => _library._clang_CXXMethod_isVirtual_ptr; + get clang_CXXMethod_isVirtual => _library._clang_CXXMethod_isVirtualPtr; ffi.Pointer> - get clang_CXXRecord_isAbstract => - _library._clang_CXXRecord_isAbstract_ptr; + get clang_CXXRecord_isAbstract => _library._clang_CXXRecord_isAbstractPtr; ffi.Pointer> - get clang_EnumDecl_isScoped => _library._clang_EnumDecl_isScoped_ptr; + get clang_EnumDecl_isScoped => _library._clang_EnumDecl_isScopedPtr; ffi.Pointer> - get clang_CXXMethod_isConst => _library._clang_CXXMethod_isConst_ptr; + get clang_CXXMethod_isConst => _library._clang_CXXMethod_isConstPtr; ffi.Pointer> get clang_getTemplateCursorKind => - _library._clang_getTemplateCursorKind_ptr; + _library._clang_getTemplateCursorKindPtr; ffi.Pointer> get clang_getSpecializedCursorTemplate => - _library._clang_getSpecializedCursorTemplate_ptr; + _library._clang_getSpecializedCursorTemplatePtr; ffi.Pointer> get clang_getCursorReferenceNameRange => - _library._clang_getCursorReferenceNameRange_ptr; + _library._clang_getCursorReferenceNameRangePtr; ffi.Pointer> get clang_getToken => - _library._clang_getToken_ptr; + _library._clang_getTokenPtr; ffi.Pointer> - get clang_getTokenKind => _library._clang_getTokenKind_ptr; + get clang_getTokenKind => _library._clang_getTokenKindPtr; ffi.Pointer> - get clang_getTokenSpelling => _library._clang_getTokenSpelling_ptr; + get clang_getTokenSpelling => _library._clang_getTokenSpellingPtr; ffi.Pointer> - get clang_getTokenLocation => _library._clang_getTokenLocation_ptr; + get clang_getTokenLocation => _library._clang_getTokenLocationPtr; ffi.Pointer> - get clang_getTokenExtent => _library._clang_getTokenExtent_ptr; + get clang_getTokenExtent => _library._clang_getTokenExtentPtr; ffi.Pointer> get clang_tokenize => - _library._clang_tokenize_ptr; + _library._clang_tokenizePtr; ffi.Pointer> - get clang_annotateTokens => _library._clang_annotateTokens_ptr; + get clang_annotateTokens => _library._clang_annotateTokensPtr; ffi.Pointer> - get clang_disposeTokens => _library._clang_disposeTokens_ptr; + get clang_disposeTokens => _library._clang_disposeTokensPtr; ffi.Pointer> get clang_getCursorKindSpelling => - _library._clang_getCursorKindSpelling_ptr; + _library._clang_getCursorKindSpellingPtr; ffi.Pointer> get clang_getDefinitionSpellingAndExtent => - _library._clang_getDefinitionSpellingAndExtent_ptr; + _library._clang_getDefinitionSpellingAndExtentPtr; ffi.Pointer> - get clang_enableStackTraces => _library._clang_enableStackTraces_ptr; + get clang_enableStackTraces => _library._clang_enableStackTracesPtr; ffi.Pointer> - get clang_executeOnThread => _library._clang_executeOnThread_ptr; + get clang_executeOnThread => _library._clang_executeOnThreadPtr; ffi.Pointer> get clang_getCompletionChunkKind => - _library._clang_getCompletionChunkKind_ptr; + _library._clang_getCompletionChunkKindPtr; ffi.Pointer> get clang_getCompletionChunkText => - _library._clang_getCompletionChunkText_ptr; + _library._clang_getCompletionChunkTextPtr; ffi.Pointer< ffi.NativeFunction> get clang_getCompletionChunkCompletionString => - _library._clang_getCompletionChunkCompletionString_ptr; + _library._clang_getCompletionChunkCompletionStringPtr; ffi.Pointer> get clang_getNumCompletionChunks => - _library._clang_getNumCompletionChunks_ptr; + _library._clang_getNumCompletionChunksPtr; ffi.Pointer> get clang_getCompletionPriority => - _library._clang_getCompletionPriority_ptr; + _library._clang_getCompletionPriorityPtr; ffi.Pointer> get clang_getCompletionAvailability => - _library._clang_getCompletionAvailability_ptr; + _library._clang_getCompletionAvailabilityPtr; ffi.Pointer> get clang_getCompletionNumAnnotations => - _library._clang_getCompletionNumAnnotations_ptr; + _library._clang_getCompletionNumAnnotationsPtr; ffi.Pointer> get clang_getCompletionAnnotation => - _library._clang_getCompletionAnnotation_ptr; + _library._clang_getCompletionAnnotationPtr; ffi.Pointer> - get clang_getCompletionParent => _library._clang_getCompletionParent_ptr; + get clang_getCompletionParent => _library._clang_getCompletionParentPtr; ffi.Pointer> get clang_getCompletionBriefComment => - _library._clang_getCompletionBriefComment_ptr; + _library._clang_getCompletionBriefCommentPtr; ffi.Pointer> get clang_getCursorCompletionString => - _library._clang_getCursorCompletionString_ptr; + _library._clang_getCursorCompletionStringPtr; ffi.Pointer> get clang_getCompletionNumFixIts => - _library._clang_getCompletionNumFixIts_ptr; + _library._clang_getCompletionNumFixItsPtr; ffi.Pointer> - get clang_getCompletionFixIt => _library._clang_getCompletionFixIt_ptr; + get clang_getCompletionFixIt => _library._clang_getCompletionFixItPtr; ffi.Pointer> get clang_defaultCodeCompleteOptions => - _library._clang_defaultCodeCompleteOptions_ptr; + _library._clang_defaultCodeCompleteOptionsPtr; ffi.Pointer> - get clang_codeCompleteAt => _library._clang_codeCompleteAt_ptr; + get clang_codeCompleteAt => _library._clang_codeCompleteAtPtr; ffi.Pointer> get clang_sortCodeCompletionResults => - _library._clang_sortCodeCompletionResults_ptr; + _library._clang_sortCodeCompletionResultsPtr; ffi.Pointer> get clang_disposeCodeCompleteResults => - _library._clang_disposeCodeCompleteResults_ptr; + _library._clang_disposeCodeCompleteResultsPtr; ffi.Pointer> get clang_codeCompleteGetNumDiagnostics => - _library._clang_codeCompleteGetNumDiagnostics_ptr; + _library._clang_codeCompleteGetNumDiagnosticsPtr; ffi.Pointer> get clang_codeCompleteGetDiagnostic => - _library._clang_codeCompleteGetDiagnostic_ptr; + _library._clang_codeCompleteGetDiagnosticPtr; ffi.Pointer> get clang_codeCompleteGetContexts => - _library._clang_codeCompleteGetContexts_ptr; + _library._clang_codeCompleteGetContextsPtr; ffi.Pointer> get clang_codeCompleteGetContainerKind => - _library._clang_codeCompleteGetContainerKind_ptr; + _library._clang_codeCompleteGetContainerKindPtr; ffi.Pointer> get clang_codeCompleteGetContainerUSR => - _library._clang_codeCompleteGetContainerUSR_ptr; + _library._clang_codeCompleteGetContainerUSRPtr; ffi.Pointer> get clang_codeCompleteGetObjCSelector => - _library._clang_codeCompleteGetObjCSelector_ptr; + _library._clang_codeCompleteGetObjCSelectorPtr; ffi.Pointer> - get clang_getClangVersion => _library._clang_getClangVersion_ptr; + get clang_getClangVersion => _library._clang_getClangVersionPtr; ffi.Pointer> - get clang_toggleCrashRecovery => _library._clang_toggleCrashRecovery_ptr; + get clang_toggleCrashRecovery => _library._clang_toggleCrashRecoveryPtr; ffi.Pointer> - get clang_getInclusions => _library._clang_getInclusions_ptr; + get clang_getInclusions => _library._clang_getInclusionsPtr; ffi.Pointer> - get clang_Cursor_Evaluate => _library._clang_Cursor_Evaluate_ptr; + get clang_Cursor_Evaluate => _library._clang_Cursor_EvaluatePtr; ffi.Pointer> - get clang_EvalResult_getKind => _library._clang_EvalResult_getKind_ptr; + get clang_EvalResult_getKind => _library._clang_EvalResult_getKindPtr; ffi.Pointer> - get clang_EvalResult_getAsInt => _library._clang_EvalResult_getAsInt_ptr; + get clang_EvalResult_getAsInt => _library._clang_EvalResult_getAsIntPtr; ffi.Pointer> get clang_EvalResult_getAsLongLong => - _library._clang_EvalResult_getAsLongLong_ptr; + _library._clang_EvalResult_getAsLongLongPtr; ffi.Pointer> get clang_EvalResult_isUnsignedInt => - _library._clang_EvalResult_isUnsignedInt_ptr; + _library._clang_EvalResult_isUnsignedIntPtr; ffi.Pointer> get clang_EvalResult_getAsUnsigned => - _library._clang_EvalResult_getAsUnsigned_ptr; + _library._clang_EvalResult_getAsUnsignedPtr; ffi.Pointer> get clang_EvalResult_getAsDouble => - _library._clang_EvalResult_getAsDouble_ptr; + _library._clang_EvalResult_getAsDoublePtr; ffi.Pointer> - get clang_EvalResult_getAsStr => _library._clang_EvalResult_getAsStr_ptr; + get clang_EvalResult_getAsStr => _library._clang_EvalResult_getAsStrPtr; ffi.Pointer> - get clang_EvalResult_dispose => _library._clang_EvalResult_dispose_ptr; + get clang_EvalResult_dispose => _library._clang_EvalResult_disposePtr; ffi.Pointer> - get clang_getRemappings => _library._clang_getRemappings_ptr; + get clang_getRemappings => _library._clang_getRemappingsPtr; ffi.Pointer> get clang_getRemappingsFromFileList => - _library._clang_getRemappingsFromFileList_ptr; + _library._clang_getRemappingsFromFileListPtr; ffi.Pointer> - get clang_remap_getNumFiles => _library._clang_remap_getNumFiles_ptr; + get clang_remap_getNumFiles => _library._clang_remap_getNumFilesPtr; ffi.Pointer> - get clang_remap_getFilenames => _library._clang_remap_getFilenames_ptr; + get clang_remap_getFilenames => _library._clang_remap_getFilenamesPtr; ffi.Pointer> - get clang_remap_dispose => _library._clang_remap_dispose_ptr; + get clang_remap_dispose => _library._clang_remap_disposePtr; ffi.Pointer> - get clang_findReferencesInFile => - _library._clang_findReferencesInFile_ptr; + get clang_findReferencesInFile => _library._clang_findReferencesInFilePtr; ffi.Pointer> - get clang_findIncludesInFile => _library._clang_findIncludesInFile_ptr; + get clang_findIncludesInFile => _library._clang_findIncludesInFilePtr; ffi.Pointer> get clang_index_isEntityObjCContainerKind => - _library._clang_index_isEntityObjCContainerKind_ptr; + _library._clang_index_isEntityObjCContainerKindPtr; ffi.Pointer> get clang_index_getObjCContainerDeclInfo => - _library._clang_index_getObjCContainerDeclInfo_ptr; + _library._clang_index_getObjCContainerDeclInfoPtr; ffi.Pointer> get clang_index_getObjCInterfaceDeclInfo => - _library._clang_index_getObjCInterfaceDeclInfo_ptr; + _library._clang_index_getObjCInterfaceDeclInfoPtr; ffi.Pointer> get clang_index_getObjCCategoryDeclInfo => - _library._clang_index_getObjCCategoryDeclInfo_ptr; + _library._clang_index_getObjCCategoryDeclInfoPtr; ffi.Pointer> get clang_index_getObjCProtocolRefListInfo => - _library._clang_index_getObjCProtocolRefListInfo_ptr; + _library._clang_index_getObjCProtocolRefListInfoPtr; ffi.Pointer> get clang_index_getObjCPropertyDeclInfo => - _library._clang_index_getObjCPropertyDeclInfo_ptr; + _library._clang_index_getObjCPropertyDeclInfoPtr; ffi.Pointer< ffi.NativeFunction> get clang_index_getIBOutletCollectionAttrInfo => - _library._clang_index_getIBOutletCollectionAttrInfo_ptr; + _library._clang_index_getIBOutletCollectionAttrInfoPtr; ffi.Pointer> get clang_index_getCXXClassDeclInfo => - _library._clang_index_getCXXClassDeclInfo_ptr; + _library._clang_index_getCXXClassDeclInfoPtr; ffi.Pointer> get clang_index_getClientContainer => - _library._clang_index_getClientContainer_ptr; + _library._clang_index_getClientContainerPtr; ffi.Pointer> get clang_index_setClientContainer => - _library._clang_index_setClientContainer_ptr; + _library._clang_index_setClientContainerPtr; ffi.Pointer> get clang_index_getClientEntity => - _library._clang_index_getClientEntity_ptr; + _library._clang_index_getClientEntityPtr; ffi.Pointer> get clang_index_setClientEntity => - _library._clang_index_setClientEntity_ptr; + _library._clang_index_setClientEntityPtr; ffi.Pointer> - get clang_IndexAction_create => _library._clang_IndexAction_create_ptr; + get clang_IndexAction_create => _library._clang_IndexAction_createPtr; ffi.Pointer> - get clang_IndexAction_dispose => _library._clang_IndexAction_dispose_ptr; + get clang_IndexAction_dispose => _library._clang_IndexAction_disposePtr; ffi.Pointer> - get clang_indexSourceFile => _library._clang_indexSourceFile_ptr; + get clang_indexSourceFile => _library._clang_indexSourceFilePtr; ffi.Pointer> get clang_indexSourceFileFullArgv => - _library._clang_indexSourceFileFullArgv_ptr; + _library._clang_indexSourceFileFullArgvPtr; ffi.Pointer> - get clang_indexTranslationUnit => - _library._clang_indexTranslationUnit_ptr; + get clang_indexTranslationUnit => _library._clang_indexTranslationUnitPtr; ffi.Pointer> get clang_indexLoc_getFileLocation => - _library._clang_indexLoc_getFileLocation_ptr; + _library._clang_indexLoc_getFileLocationPtr; ffi.Pointer> get clang_indexLoc_getCXSourceLocation => - _library._clang_indexLoc_getCXSourceLocation_ptr; + _library._clang_indexLoc_getCXSourceLocationPtr; ffi.Pointer> - get clang_Type_visitFields => _library._clang_Type_visitFields_ptr; + get clang_Type_visitFields => _library._clang_Type_visitFieldsPtr; } /// A character string. @@ -7825,7 +7805,7 @@ typedef Native_clang_getCString = ffi.Pointer Function( CXString string); typedef Native_clang_disposeString = ffi.Void Function(CXString string); typedef Native_clang_disposeStringSet = ffi.Void Function( - ffi.Pointer set_1); + ffi.Pointer set1); class CXTargetInfoImpl extends ffi.Opaque {} diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index f65a62335f..7e22ee0233 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -10,6 +10,7 @@ environment: dev_dependencies: ffigen: path: '../../' + lints: ^1.0.1 ffigen: output: 'generated_bindings.dart' @@ -84,3 +85,5 @@ ffigen: // Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + + // ignore_for_file: camel_case_types, non_constant_identifier_names diff --git a/pkgs/ffigen/example/simple/generated_bindings.dart b/pkgs/ffigen/example/simple/generated_bindings.dart index a964f5074f..66854389c5 100644 --- a/pkgs/ffigen/example/simple/generated_bindings.dart +++ b/pkgs/ffigen/example/simple/generated_bindings.dart @@ -30,10 +30,10 @@ class NativeLibrary { ); } - late final _sum_ptr = + late final _sumPtr = _lookup>( 'sum'); - late final _sum = _sum_ptr.asFunction(); + late final _sum = _sumPtr.asFunction(); /// Subtracts 2 integers. int subtract( @@ -46,11 +46,11 @@ class NativeLibrary { ); } - late final _subtract_ptr = _lookup< + late final _subtractPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Int32)>>('subtract'); late final _subtract = - _subtract_ptr.asFunction, int)>(); + _subtractPtr.asFunction, int)>(); /// Multiplies 2 integers, returns pointer to an integer,. ffi.Pointer multiply( @@ -63,11 +63,11 @@ class NativeLibrary { ); } - late final _multiply_ptr = _lookup< + late final _multiplyPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Int32, ffi.Int32)>>('multiply'); late final _multiply = - _multiply_ptr.asFunction Function(int, int)>(); + _multiplyPtr.asFunction Function(int, int)>(); /// Divides 2 integers, returns pointer to a float. ffi.Pointer divide( @@ -80,11 +80,11 @@ class NativeLibrary { ); } - late final _divide_ptr = _lookup< + late final _dividePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Int32, ffi.Int32)>>('divide'); late final _divide = - _divide_ptr.asFunction Function(int, int)>(); + _dividePtr.asFunction Function(int, int)>(); /// Divides 2 floats, returns a pointer to double. ffi.Pointer dividePercision( @@ -97,11 +97,11 @@ class NativeLibrary { ); } - late final _dividePercision_ptr = _lookup< + late final _dividePercisionPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('dividePercision'); - late final _dividePercision = _dividePercision_ptr.asFunction< + late final _dividePercision = _dividePercisionPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); } diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index f0a721a4b2..e419d1c9db 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -10,6 +10,7 @@ environment: dev_dependencies: ffigen: path: '../../' + lints: ^1.0.1 ffigen: name: NativeLibrary diff --git a/pkgs/ffigen/lib/src/code_generator/compound.dart b/pkgs/ffigen/lib/src/code_generator/compound.dart index b6b97a3427..887f523d99 100644 --- a/pkgs/ffigen/lib/src/code_generator/compound.dart +++ b/pkgs/ffigen/lib/src/code_generator/compound.dart @@ -155,7 +155,9 @@ abstract class Compound extends NoLookUpBinding { if (dependencies.contains(this)) return; dependencies.add(this); - members.forEach((m) => m.type.addDependencies(dependencies)); + for (final m in members) { + m.type.addDependencies(dependencies); + } } } diff --git a/pkgs/ffigen/lib/src/code_generator/enum_class.dart b/pkgs/ffigen/lib/src/code_generator/enum_class.dart index e1ed5c4db0..2765aef53c 100644 --- a/pkgs/ffigen/lib/src/code_generator/enum_class.dart +++ b/pkgs/ffigen/lib/src/code_generator/enum_class.dart @@ -55,13 +55,13 @@ class EnumClass extends NoLookUpBinding { s.write('abstract class $enclosingClassName {\n'); const depth = ' '; for (final ec in enumConstants) { - final enum_value_name = localUniqueNamer.makeUnique(ec.name); + final enumValueName = localUniqueNamer.makeUnique(ec.name); if (ec.dartDoc != null) { s.write(depth + '/// '); s.writeAll(ec.dartDoc!.split('\n'), '\n' + depth + '/// '); s.write('\n'); } - s.write(depth + 'static const int $enum_value_name = ${ec.value};\n'); + s.write(depth + 'static const int $enumValueName = ${ec.value};\n'); } s.write('}\n\n'); diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index 21aad75b7a..fd679b81ba 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -70,8 +70,7 @@ class Func extends LookUpBinding { final s = StringBuffer(); final enclosingFuncName = name; final funcVarName = w.wrapperLevelUniqueNamer.makeUnique('_$name'); - final funcPointerName = - w.wrapperLevelUniqueNamer.makeUnique('_${name}_ptr'); + final funcPointerName = w.wrapperLevelUniqueNamer.makeUnique('_${name}Ptr'); if (dartDoc != null) { s.write(makeDartDoc(dartDoc!)); diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index 57776bb4c4..0a6978a6f2 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -34,7 +34,9 @@ class Library { }) { /// Get all dependencies (includes itself). final dependencies = {}; - bindings.forEach((b) => b.addDependencies(dependencies)); + for (final b in bindings) { + b.addDependencies(dependencies); + } /// Save bindings. this.bindings = dependencies.toList(); @@ -131,5 +133,8 @@ class Library { } @override - bool operator ==(Object o) => o is Library && o.generate() == generate(); + bool operator ==(other) => other is Library && other.generate() == generate(); + + @override + int get hashCode => bindings.hashCode; } diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index 0a7e941884..e442a63267 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -255,7 +255,7 @@ class Type { case BroadType.Pointer: return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; case BroadType.Compound: - return '${compound!.name}'; + return compound!.name; case BroadType.Enum: return '${w.ffiLibraryPrefix}.${_primitives[enumNativeType]!.c}'; case BroadType.NativeFunction: @@ -286,7 +286,7 @@ class Type { case BroadType.Pointer: return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; case BroadType.Compound: - return '${compound!.name}'; + return compound!.name; case BroadType.Enum: return _primitives[enumNativeType]!.dart; case BroadType.NativeFunction: @@ -367,7 +367,9 @@ class FunctionType { void addDependencies(Set dependencies) { returnType.addDependencies(dependencies); - parameters.forEach((p) => p.type.addDependencies(dependencies)); + for (final p in parameters) { + p.type.addDependencies(dependencies); + } } } diff --git a/pkgs/ffigen/lib/src/code_generator/utils.dart b/pkgs/ffigen/lib/src/code_generator/utils.dart index 5ee0e302db..c000bdf92e 100644 --- a/pkgs/ffigen/lib/src/code_generator/utils.dart +++ b/pkgs/ffigen/lib/src/code_generator/utils.dart @@ -11,20 +11,20 @@ class UniqueNamer { /// Creates a UniqueNamer with given [usedUpNames] only. UniqueNamer._raw(this._usedUpNames); - /// Returns a unique name by appending `_` to it if necessary. + /// Returns a unique name by appending `` to it if necessary. /// /// Adds the resulting name to the used names by default. String makeUnique(String name, [bool addToUsedUpNames = true]) { - var cr_name = name; + var crName = name; var i = 1; - while (_usedUpNames.contains(cr_name)) { - cr_name = '${name}_$i'; + while (_usedUpNames.contains(crName)) { + crName = '$name$i'; i++; } if (addToUsedUpNames) { - _usedUpNames.add(cr_name); + _usedUpNames.add(crName); } - return cr_name; + return crName; } /// Adds a name to used names. diff --git a/pkgs/ffigen/lib/src/config_provider/config_types.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart index 42e99f0961..d9730135c5 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_types.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart @@ -109,10 +109,10 @@ class GlobHeaderFilter extends HeaderIncludeFilter { }); @override - bool shouldInclude(String header) { + bool shouldInclude(String headerSourceFile) { // Return true if header was included. for (final globPattern in includeGlobs!) { - if (quiver.matchesFull(globPattern, header)) { + if (quiver.matchesFull(globPattern, headerSourceFile)) { return true; } } diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 6f02100697..abfad7f2ef 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -3,6 +3,8 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// ignore_for_file: camel_case_types, non_constant_identifier_names + // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. @@ -32,10 +34,10 @@ class Clang { ); } - late final _clang_getCString_ptr = + late final _clang_getCStringPtr = _lookup Function(CXString)>>( 'clang_getCString'); - late final _clang_getCString = _clang_getCString_ptr + late final _clang_getCString = _clang_getCStringPtr .asFunction Function(CXString)>(); /// Free the given string. @@ -47,11 +49,11 @@ class Clang { ); } - late final _clang_disposeString_ptr = + late final _clang_disposeStringPtr = _lookup>( 'clang_disposeString'); late final _clang_disposeString = - _clang_disposeString_ptr.asFunction(); + _clang_disposeStringPtr.asFunction(); /// Provides a shared context for creating translation units. /// @@ -101,11 +103,11 @@ class Clang { ); } - late final _clang_createIndex_ptr = + late final _clang_createIndexPtr = _lookup>( 'clang_createIndex'); late final _clang_createIndex = - _clang_createIndex_ptr.asFunction(); + _clang_createIndexPtr.asFunction(); /// Destroy the given index. /// @@ -119,11 +121,11 @@ class Clang { ); } - late final _clang_disposeIndex_ptr = + late final _clang_disposeIndexPtr = _lookup>( 'clang_disposeIndex'); late final _clang_disposeIndex = - _clang_disposeIndex_ptr.asFunction(); + _clang_disposeIndexPtr.asFunction(); /// Retrieve the complete file and path name of the given file. CXString clang_getFileName( @@ -134,11 +136,11 @@ class Clang { ); } - late final _clang_getFileName_ptr = + late final _clang_getFileNamePtr = _lookup>( 'clang_getFileName'); late final _clang_getFileName = - _clang_getFileName_ptr.asFunction(); + _clang_getFileNamePtr.asFunction(); /// Determine whether two ranges are equivalent. /// @@ -153,11 +155,11 @@ class Clang { ); } - late final _clang_equalRanges_ptr = _lookup< + late final _clang_equalRangesPtr = _lookup< ffi.NativeFunction< ffi.Uint32 Function( CXSourceRange, CXSourceRange)>>('clang_equalRanges'); - late final _clang_equalRanges = _clang_equalRanges_ptr + late final _clang_equalRanges = _clang_equalRangesPtr .asFunction(); /// Retrieve the file, line, column, and offset represented by @@ -197,7 +199,7 @@ class Clang { ); } - late final _clang_getFileLocation_ptr = _lookup< + late final _clang_getFileLocationPtr = _lookup< ffi.NativeFunction< ffi.Void Function( CXSourceLocation, @@ -205,7 +207,7 @@ class Clang { ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('clang_getFileLocation'); - late final _clang_getFileLocation = _clang_getFileLocation_ptr.asFunction< + late final _clang_getFileLocation = _clang_getFileLocationPtr.asFunction< void Function( CXSourceLocation, ffi.Pointer, @@ -223,11 +225,11 @@ class Clang { ); } - late final _clang_getNumDiagnostics_ptr = + late final _clang_getNumDiagnosticsPtr = _lookup>( 'clang_getNumDiagnostics'); - late final _clang_getNumDiagnostics = _clang_getNumDiagnostics_ptr - .asFunction(); + late final _clang_getNumDiagnostics = + _clang_getNumDiagnosticsPtr.asFunction(); /// Retrieve a diagnostic associated with the given translation unit. /// @@ -246,11 +248,11 @@ class Clang { ); } - late final _clang_getDiagnostic_ptr = _lookup< + late final _clang_getDiagnosticPtr = _lookup< ffi.NativeFunction< CXDiagnostic Function( CXTranslationUnit, ffi.Uint32)>>('clang_getDiagnostic'); - late final _clang_getDiagnostic = _clang_getDiagnostic_ptr + late final _clang_getDiagnostic = _clang_getDiagnosticPtr .asFunction(); /// Destroy a diagnostic. @@ -262,11 +264,11 @@ class Clang { ); } - late final _clang_disposeDiagnostic_ptr = + late final _clang_disposeDiagnosticPtr = _lookup>( 'clang_disposeDiagnostic'); late final _clang_disposeDiagnostic = - _clang_disposeDiagnostic_ptr.asFunction(); + _clang_disposeDiagnosticPtr.asFunction(); /// Format the given diagnostic in a manner that is suitable for display. /// @@ -291,10 +293,10 @@ class Clang { ); } - late final _clang_formatDiagnostic_ptr = + late final _clang_formatDiagnosticPtr = _lookup>( 'clang_formatDiagnostic'); - late final _clang_formatDiagnostic = _clang_formatDiagnostic_ptr + late final _clang_formatDiagnostic = _clang_formatDiagnosticPtr .asFunction(); /// Same as \c clang_parseTranslationUnit2, but returns @@ -321,7 +323,7 @@ class Clang { ); } - late final _clang_parseTranslationUnit_ptr = _lookup< + late final _clang_parseTranslationUnitPtr = _lookup< ffi.NativeFunction< CXTranslationUnit Function( CXIndex, @@ -332,7 +334,7 @@ class Clang { ffi.Uint32, ffi.Uint32)>>('clang_parseTranslationUnit'); late final _clang_parseTranslationUnit = - _clang_parseTranslationUnit_ptr.asFunction< + _clang_parseTranslationUnitPtr.asFunction< CXTranslationUnit Function( CXIndex, ffi.Pointer, @@ -351,10 +353,10 @@ class Clang { ); } - late final _clang_disposeTranslationUnit_ptr = + late final _clang_disposeTranslationUnitPtr = _lookup>( 'clang_disposeTranslationUnit'); - late final _clang_disposeTranslationUnit = _clang_disposeTranslationUnit_ptr + late final _clang_disposeTranslationUnit = _clang_disposeTranslationUnitPtr .asFunction(); /// Retrieve the cursor that represents the given translation unit. @@ -369,11 +371,11 @@ class Clang { ); } - late final _clang_getTranslationUnitCursor_ptr = + late final _clang_getTranslationUnitCursorPtr = _lookup>( 'clang_getTranslationUnitCursor'); late final _clang_getTranslationUnitCursor = - _clang_getTranslationUnitCursor_ptr + _clang_getTranslationUnitCursorPtr .asFunction(); /// Returns non-zero if \p cursor is null. @@ -385,11 +387,11 @@ class Clang { ); } - late final _clang_Cursor_isNull_ptr = + late final _clang_Cursor_isNullPtr = _lookup>( 'clang_Cursor_isNull'); late final _clang_Cursor_isNull = - _clang_Cursor_isNull_ptr.asFunction(); + _clang_Cursor_isNullPtr.asFunction(); /// Retrieve the kind of the given cursor. int clang_getCursorKind( @@ -400,11 +402,11 @@ class Clang { ); } - late final _clang_getCursorKind_ptr = + late final _clang_getCursorKindPtr = _lookup>( 'clang_getCursorKind'); late final _clang_getCursorKind = - _clang_getCursorKind_ptr.asFunction(); + _clang_getCursorKindPtr.asFunction(); /// Determine whether the given cursor has any attributes. int clang_Cursor_hasAttrs( @@ -415,11 +417,11 @@ class Clang { ); } - late final _clang_Cursor_hasAttrs_ptr = + late final _clang_Cursor_hasAttrsPtr = _lookup>( 'clang_Cursor_hasAttrs'); late final _clang_Cursor_hasAttrs = - _clang_Cursor_hasAttrs_ptr.asFunction(); + _clang_Cursor_hasAttrsPtr.asFunction(); /// Retrieve the physical location of the source constructor referenced /// by the given cursor. @@ -437,10 +439,10 @@ class Clang { ); } - late final _clang_getCursorLocation_ptr = + late final _clang_getCursorLocationPtr = _lookup>( 'clang_getCursorLocation'); - late final _clang_getCursorLocation = _clang_getCursorLocation_ptr + late final _clang_getCursorLocation = _clang_getCursorLocationPtr .asFunction(); /// Retrieve the type of a CXCursor (if any). @@ -452,11 +454,11 @@ class Clang { ); } - late final _clang_getCursorType_ptr = + late final _clang_getCursorTypePtr = _lookup>( 'clang_getCursorType'); late final _clang_getCursorType = - _clang_getCursorType_ptr.asFunction(); + _clang_getCursorTypePtr.asFunction(); /// Pretty-print the underlying type using the rules of the /// language of the translation unit from which it came. @@ -470,11 +472,11 @@ class Clang { ); } - late final _clang_getTypeSpelling_ptr = + late final _clang_getTypeSpellingPtr = _lookup>( 'clang_getTypeSpelling'); late final _clang_getTypeSpelling = - _clang_getTypeSpelling_ptr.asFunction(); + _clang_getTypeSpellingPtr.asFunction(); /// Retrieve the underlying type of a typedef declaration. /// @@ -488,11 +490,11 @@ class Clang { ); } - late final _clang_getTypedefDeclUnderlyingType_ptr = + late final _clang_getTypedefDeclUnderlyingTypePtr = _lookup>( 'clang_getTypedefDeclUnderlyingType'); late final _clang_getTypedefDeclUnderlyingType = - _clang_getTypedefDeclUnderlyingType_ptr + _clang_getTypedefDeclUnderlyingTypePtr .asFunction(); /// Retrieve the integer value of an enum constant declaration as a signed @@ -509,11 +511,11 @@ class Clang { ); } - late final _clang_getEnumConstantDeclValue_ptr = + late final _clang_getEnumConstantDeclValuePtr = _lookup>( 'clang_getEnumConstantDeclValue'); late final _clang_getEnumConstantDeclValue = - _clang_getEnumConstantDeclValue_ptr.asFunction(); + _clang_getEnumConstantDeclValuePtr.asFunction(); /// Retrieve the bit width of a bit field declaration as an integer. /// @@ -526,11 +528,11 @@ class Clang { ); } - late final _clang_getFieldDeclBitWidth_ptr = + late final _clang_getFieldDeclBitWidthPtr = _lookup>( 'clang_getFieldDeclBitWidth'); late final _clang_getFieldDeclBitWidth = - _clang_getFieldDeclBitWidth_ptr.asFunction(); + _clang_getFieldDeclBitWidthPtr.asFunction(); /// Retrieve the number of non-variadic arguments associated with a given /// cursor. @@ -545,11 +547,11 @@ class Clang { ); } - late final _clang_Cursor_getNumArguments_ptr = + late final _clang_Cursor_getNumArgumentsPtr = _lookup>( 'clang_Cursor_getNumArguments'); late final _clang_Cursor_getNumArguments = - _clang_Cursor_getNumArguments_ptr.asFunction(); + _clang_Cursor_getNumArgumentsPtr.asFunction(); /// Retrieve the argument cursor of a function or method. /// @@ -566,10 +568,10 @@ class Clang { ); } - late final _clang_Cursor_getArgument_ptr = + late final _clang_Cursor_getArgumentPtr = _lookup>( 'clang_Cursor_getArgument'); - late final _clang_Cursor_getArgument = _clang_Cursor_getArgument_ptr + late final _clang_Cursor_getArgument = _clang_Cursor_getArgumentPtr .asFunction(); /// Return the canonical type for a CXType. @@ -586,11 +588,11 @@ class Clang { ); } - late final _clang_getCanonicalType_ptr = + late final _clang_getCanonicalTypePtr = _lookup>( 'clang_getCanonicalType'); late final _clang_getCanonicalType = - _clang_getCanonicalType_ptr.asFunction(); + _clang_getCanonicalTypePtr.asFunction(); /// Determine whether a CXCursor that is a macro, is /// function like. @@ -602,12 +604,11 @@ class Clang { ); } - late final _clang_Cursor_isMacroFunctionLike_ptr = + late final _clang_Cursor_isMacroFunctionLikePtr = _lookup>( 'clang_Cursor_isMacroFunctionLike'); late final _clang_Cursor_isMacroFunctionLike = - _clang_Cursor_isMacroFunctionLike_ptr - .asFunction(); + _clang_Cursor_isMacroFunctionLikePtr.asFunction(); /// Determine whether a CXCursor that is a macro, is a /// builtin one. @@ -619,11 +620,11 @@ class Clang { ); } - late final _clang_Cursor_isMacroBuiltin_ptr = + late final _clang_Cursor_isMacroBuiltinPtr = _lookup>( 'clang_Cursor_isMacroBuiltin'); late final _clang_Cursor_isMacroBuiltin = - _clang_Cursor_isMacroBuiltin_ptr.asFunction(); + _clang_Cursor_isMacroBuiltinPtr.asFunction(); /// Determine whether a CXCursor that is a function declaration, is an /// inline declaration. @@ -635,11 +636,11 @@ class Clang { ); } - late final _clang_Cursor_isFunctionInlined_ptr = + late final _clang_Cursor_isFunctionInlinedPtr = _lookup>( 'clang_Cursor_isFunctionInlined'); late final _clang_Cursor_isFunctionInlined = - _clang_Cursor_isFunctionInlined_ptr.asFunction(); + _clang_Cursor_isFunctionInlinedPtr.asFunction(); /// Returns the typedef name of the given type. CXString clang_getTypedefName( @@ -650,11 +651,11 @@ class Clang { ); } - late final _clang_getTypedefName_ptr = + late final _clang_getTypedefNamePtr = _lookup>( 'clang_getTypedefName'); late final _clang_getTypedefName = - _clang_getTypedefName_ptr.asFunction(); + _clang_getTypedefNamePtr.asFunction(); /// For pointer types, returns the type of the pointee. CXType clang_getPointeeType( @@ -665,11 +666,11 @@ class Clang { ); } - late final _clang_getPointeeType_ptr = + late final _clang_getPointeeTypePtr = _lookup>( 'clang_getPointeeType'); late final _clang_getPointeeType = - _clang_getPointeeType_ptr.asFunction(); + _clang_getPointeeTypePtr.asFunction(); /// Return the cursor for the declaration of the given type. CXCursor clang_getTypeDeclaration( @@ -680,11 +681,11 @@ class Clang { ); } - late final _clang_getTypeDeclaration_ptr = + late final _clang_getTypeDeclarationPtr = _lookup>( 'clang_getTypeDeclaration'); late final _clang_getTypeDeclaration = - _clang_getTypeDeclaration_ptr.asFunction(); + _clang_getTypeDeclarationPtr.asFunction(); /// Retrieve the spelling of a given CXTypeKind. CXString clang_getTypeKindSpelling( @@ -695,11 +696,11 @@ class Clang { ); } - late final _clang_getTypeKindSpelling_ptr = + late final _clang_getTypeKindSpellingPtr = _lookup>( 'clang_getTypeKindSpelling'); late final _clang_getTypeKindSpelling = - _clang_getTypeKindSpelling_ptr.asFunction(); + _clang_getTypeKindSpellingPtr.asFunction(); /// Retrieve the return type associated with a function type. /// @@ -712,11 +713,11 @@ class Clang { ); } - late final _clang_getResultType_ptr = + late final _clang_getResultTypePtr = _lookup>( 'clang_getResultType'); late final _clang_getResultType = - _clang_getResultType_ptr.asFunction(); + _clang_getResultTypePtr.asFunction(); /// Retrieve the number of non-variadic parameters associated with a /// function type. @@ -730,11 +731,11 @@ class Clang { ); } - late final _clang_getNumArgTypes_ptr = + late final _clang_getNumArgTypesPtr = _lookup>( 'clang_getNumArgTypes'); late final _clang_getNumArgTypes = - _clang_getNumArgTypes_ptr.asFunction(); + _clang_getNumArgTypesPtr.asFunction(); /// Retrieve the type of a parameter of a function type. /// @@ -750,11 +751,11 @@ class Clang { ); } - late final _clang_getArgType_ptr = + late final _clang_getArgTypePtr = _lookup>( 'clang_getArgType'); late final _clang_getArgType = - _clang_getArgType_ptr.asFunction(); + _clang_getArgTypePtr.asFunction(); /// Return the number of elements of an array or vector type. /// @@ -768,11 +769,11 @@ class Clang { ); } - late final _clang_getNumElements_ptr = + late final _clang_getNumElementsPtr = _lookup>( 'clang_getNumElements'); late final _clang_getNumElements = - _clang_getNumElements_ptr.asFunction(); + _clang_getNumElementsPtr.asFunction(); /// Return the element type of an array type. /// @@ -785,11 +786,11 @@ class Clang { ); } - late final _clang_getArrayElementType_ptr = + late final _clang_getArrayElementTypePtr = _lookup>( 'clang_getArrayElementType'); late final _clang_getArrayElementType = - _clang_getArrayElementType_ptr.asFunction(); + _clang_getArrayElementTypePtr.asFunction(); /// Retrieve the type named by the qualified-id. /// @@ -802,11 +803,11 @@ class Clang { ); } - late final _clang_Type_getNamedType_ptr = + late final _clang_Type_getNamedTypePtr = _lookup>( 'clang_Type_getNamedType'); late final _clang_Type_getNamedType = - _clang_Type_getNamedType_ptr.asFunction(); + _clang_Type_getNamedTypePtr.asFunction(); /// Return the alignment of a type in bytes as per C++[expr.alignof] /// standard. @@ -826,11 +827,11 @@ class Clang { ); } - late final _clang_Type_getAlignOf_ptr = + late final _clang_Type_getAlignOfPtr = _lookup>( 'clang_Type_getAlignOf'); late final _clang_Type_getAlignOf = - _clang_Type_getAlignOf_ptr.asFunction(); + _clang_Type_getAlignOfPtr.asFunction(); /// Determine whether the given cursor represents an anonymous /// tag or namespace @@ -842,11 +843,11 @@ class Clang { ); } - late final _clang_Cursor_isAnonymous_ptr = + late final _clang_Cursor_isAnonymousPtr = _lookup>( 'clang_Cursor_isAnonymous'); late final _clang_Cursor_isAnonymous = - _clang_Cursor_isAnonymous_ptr.asFunction(); + _clang_Cursor_isAnonymousPtr.asFunction(); /// Determine whether the given cursor represents an anonymous record /// declaration. @@ -858,11 +859,11 @@ class Clang { ); } - late final _clang_Cursor_isAnonymousRecordDecl_ptr = + late final _clang_Cursor_isAnonymousRecordDeclPtr = _lookup>( 'clang_Cursor_isAnonymousRecordDecl'); late final _clang_Cursor_isAnonymousRecordDecl = - _clang_Cursor_isAnonymousRecordDecl_ptr + _clang_Cursor_isAnonymousRecordDeclPtr .asFunction(); /// Visit the children of a particular cursor. @@ -897,11 +898,11 @@ class Clang { ); } - late final _clang_visitChildren_ptr = _lookup< + late final _clang_visitChildrenPtr = _lookup< ffi.NativeFunction< ffi.Uint32 Function( CXCursor, CXCursorVisitor, CXClientData)>>('clang_visitChildren'); - late final _clang_visitChildren = _clang_visitChildren_ptr + late final _clang_visitChildren = _clang_visitChildrenPtr .asFunction(); /// Retrieve a Unified Symbol Resolution (USR) for the entity referenced @@ -919,11 +920,11 @@ class Clang { ); } - late final _clang_getCursorUSR_ptr = + late final _clang_getCursorUSRPtr = _lookup>( 'clang_getCursorUSR'); late final _clang_getCursorUSR = - _clang_getCursorUSR_ptr.asFunction(); + _clang_getCursorUSRPtr.asFunction(); /// Retrieve a name for the entity referenced by this cursor. CXString clang_getCursorSpelling( @@ -934,11 +935,11 @@ class Clang { ); } - late final _clang_getCursorSpelling_ptr = + late final _clang_getCursorSpellingPtr = _lookup>( 'clang_getCursorSpelling'); late final _clang_getCursorSpelling = - _clang_getCursorSpelling_ptr.asFunction(); + _clang_getCursorSpellingPtr.asFunction(); /// For a cursor that is either a reference to or a declaration /// of some entity, retrieve a cursor that describes the definition of @@ -974,11 +975,11 @@ class Clang { ); } - late final _clang_getCursorDefinition_ptr = + late final _clang_getCursorDefinitionPtr = _lookup>( 'clang_getCursorDefinition'); late final _clang_getCursorDefinition = - _clang_getCursorDefinition_ptr.asFunction(); + _clang_getCursorDefinitionPtr.asFunction(); /// Given a cursor that represents a declaration, return the associated /// comment's source range. The range may include multiple consecutive comments @@ -991,10 +992,10 @@ class Clang { ); } - late final _clang_Cursor_getCommentRange_ptr = + late final _clang_Cursor_getCommentRangePtr = _lookup>( 'clang_Cursor_getCommentRange'); - late final _clang_Cursor_getCommentRange = _clang_Cursor_getCommentRange_ptr + late final _clang_Cursor_getCommentRange = _clang_Cursor_getCommentRangePtr .asFunction(); /// Given a cursor that represents a declaration, return the associated @@ -1007,11 +1008,11 @@ class Clang { ); } - late final _clang_Cursor_getRawCommentText_ptr = + late final _clang_Cursor_getRawCommentTextPtr = _lookup>( 'clang_Cursor_getRawCommentText'); late final _clang_Cursor_getRawCommentText = - _clang_Cursor_getRawCommentText_ptr + _clang_Cursor_getRawCommentTextPtr .asFunction(); /// Given a cursor that represents a documentable entity (e.g., @@ -1025,11 +1026,11 @@ class Clang { ); } - late final _clang_Cursor_getBriefCommentText_ptr = + late final _clang_Cursor_getBriefCommentTextPtr = _lookup>( 'clang_Cursor_getBriefCommentText'); late final _clang_Cursor_getBriefCommentText = - _clang_Cursor_getBriefCommentText_ptr + _clang_Cursor_getBriefCommentTextPtr .asFunction(); /// \defgroup CINDEX_DEBUG Debugging facilities @@ -1046,11 +1047,11 @@ class Clang { ); } - late final _clang_getCursorKindSpelling_ptr = + late final _clang_getCursorKindSpellingPtr = _lookup>( 'clang_getCursorKindSpelling'); late final _clang_getCursorKindSpelling = - _clang_getCursorKindSpelling_ptr.asFunction(); + _clang_getCursorKindSpellingPtr.asFunction(); /// If cursor is a statement declaration tries to evaluate the /// statement and if its variable, tries to evaluate its initializer, @@ -1063,11 +1064,11 @@ class Clang { ); } - late final _clang_Cursor_Evaluate_ptr = + late final _clang_Cursor_EvaluatePtr = _lookup>( 'clang_Cursor_Evaluate'); late final _clang_Cursor_Evaluate = - _clang_Cursor_Evaluate_ptr.asFunction(); + _clang_Cursor_EvaluatePtr.asFunction(); /// Returns the kind of the evaluated result. int clang_EvalResult_getKind( @@ -1078,11 +1079,11 @@ class Clang { ); } - late final _clang_EvalResult_getKind_ptr = + late final _clang_EvalResult_getKindPtr = _lookup>( 'clang_EvalResult_getKind'); late final _clang_EvalResult_getKind = - _clang_EvalResult_getKind_ptr.asFunction(); + _clang_EvalResult_getKindPtr.asFunction(); /// Returns the evaluation result as integer if the /// kind is Int. @@ -1094,11 +1095,11 @@ class Clang { ); } - late final _clang_EvalResult_getAsInt_ptr = + late final _clang_EvalResult_getAsIntPtr = _lookup>( 'clang_EvalResult_getAsInt'); late final _clang_EvalResult_getAsInt = - _clang_EvalResult_getAsInt_ptr.asFunction(); + _clang_EvalResult_getAsIntPtr.asFunction(); /// Returns the evaluation result as a long long integer if the /// kind is Int. This prevents overflows that may happen if the result is @@ -1111,11 +1112,11 @@ class Clang { ); } - late final _clang_EvalResult_getAsLongLong_ptr = + late final _clang_EvalResult_getAsLongLongPtr = _lookup>( 'clang_EvalResult_getAsLongLong'); late final _clang_EvalResult_getAsLongLong = - _clang_EvalResult_getAsLongLong_ptr + _clang_EvalResult_getAsLongLongPtr .asFunction(); /// Returns the evaluation result as double if the @@ -1128,10 +1129,10 @@ class Clang { ); } - late final _clang_EvalResult_getAsDouble_ptr = + late final _clang_EvalResult_getAsDoublePtr = _lookup>( 'clang_EvalResult_getAsDouble'); - late final _clang_EvalResult_getAsDouble = _clang_EvalResult_getAsDouble_ptr + late final _clang_EvalResult_getAsDouble = _clang_EvalResult_getAsDoublePtr .asFunction(); /// Returns the evaluation result as a constant string if the @@ -1146,10 +1147,10 @@ class Clang { ); } - late final _clang_EvalResult_getAsStr_ptr = + late final _clang_EvalResult_getAsStrPtr = _lookup Function(CXEvalResult)>>( 'clang_EvalResult_getAsStr'); - late final _clang_EvalResult_getAsStr = _clang_EvalResult_getAsStr_ptr + late final _clang_EvalResult_getAsStr = _clang_EvalResult_getAsStrPtr .asFunction Function(CXEvalResult)>(); /// Disposes the created Eval memory. @@ -1161,11 +1162,11 @@ class Clang { ); } - late final _clang_EvalResult_dispose_ptr = + late final _clang_EvalResult_disposePtr = _lookup>( 'clang_EvalResult_dispose'); late final _clang_EvalResult_dispose = - _clang_EvalResult_dispose_ptr.asFunction(); + _clang_EvalResult_disposePtr.asFunction(); } /// A character string. diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart index 0bee37d9f9..d0d5cd6d56 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart @@ -136,7 +136,7 @@ Compound? parseCompoundDeclaration( // must be generated. _stack.top.compound = Compound.fromType( type: compoundType, - name: incrementalNamer.name('unnamed$className'), + name: incrementalNamer.name('Unnamed$className'), usr: declUsr, dartDoc: getCursorDocComment(cursor), ); diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index 9ff09fe3e6..f602cdf22c 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -307,12 +307,12 @@ class Stack { class IncrementalNamer { final _incrementedStringCounters = {}; - /// Appends `_` to base. is incremented on every call. + /// Appends `` to base. is incremented on every call. String name(String base) { var i = _incrementedStringCounters[base] ?? 0; i++; _incrementedStringCounters[base] = i; - return '${base}_$i'; + return '$base$i'; } } diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 9c305e26dd..93239f4906 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 4.0.0-dev.0 +version: 4.0.0-dev.1 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. @@ -22,5 +22,5 @@ dependencies: file: ^6.0.0 dev_dependencies: - pedantic: ^1.10.0 + lints: ^1.0.1 test: ^1.16.2 diff --git a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart index b30f6347da..5d7f4c929a 100644 --- a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart @@ -140,7 +140,7 @@ void main() { }); test('Function and Struct Binding (pointer to Struct)', () { - final struct_some = Struc( + final structSome = Struc( name: 'SomeStruc', members: [ Member( @@ -166,7 +166,7 @@ void main() { final library = Library( name: 'Bindings', bindings: [ - struct_some, + structSome, Func( name: 'someFunc', parameters: [ @@ -175,7 +175,7 @@ void main() { type: Type.pointer( Type.pointer( Type.struct( - struct_some, + structSome, ), ), ), @@ -183,7 +183,7 @@ void main() { ], returnType: Type.pointer( Type.struct( - struct_some, + structSome, ), ), ), @@ -194,7 +194,7 @@ void main() { }); test('global (primitives, pointers, pointer to struct)', () { - final struc_some = Struc( + final strucSome = Struc( name: 'Some', ); final emptyGlobalStruc = Struc(name: 'EmptyStruct'); @@ -216,12 +216,12 @@ void main() { ), ), ), - struc_some, + strucSome, Global( name: 'test5', type: Type.pointer( Type.struct( - struc_some, + strucSome, ), ), ), @@ -275,7 +275,8 @@ void main() { test('Internal conflict resolution', () { final library = Library( name: 'init_dylib', - header: '// ignore_for_file: unused_element\n', + header: + '// ignore_for_file: unused_element, camel_case_types, non_constant_identifier_names\n', bindings: [ Func( name: 'test', @@ -333,7 +334,7 @@ void main() { ], ), Struc( - name: 'test2', + name: 'Test2', members: [ Member(name: 'a', type: Type.boolean()), ], @@ -356,7 +357,7 @@ void main() { ], ), Struc( - name: 'test2', + name: 'Test2', members: [ Member(name: 'a', type: Type.boolean()), ], @@ -372,8 +373,8 @@ void main() { bindings: [ Func(name: 'b', returnType: Type.nativeType(SupportedNativeType.Void)), Func(name: 'a', returnType: Type.nativeType(SupportedNativeType.Void)), - Struc(name: 'd'), - Struc(name: 'c'), + Struc(name: 'D'), + Struc(name: 'C'), ], ); _matchLib(library, 'sort_bindings'); @@ -450,6 +451,7 @@ void main() { test('Typealias Bindings', () { final library = Library( name: 'Bindings', + header: '// ignore_for_file: non_constant_identifier_names\n', bindings: [ Typealias( name: 'RawUnused', type: Type.compound(Struc(name: 'Struct1'))), diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart index a35b620d87..2e9412123d 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart @@ -28,14 +28,14 @@ class Bindings { 0; } - late final _test1_ptr = _lookup< + late final _test1Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Uint8, ffi.Pointer)>>('test1'); late final _test1 = - _test1_ptr.asFunction)>(); + _test1Ptr.asFunction)>(); } -class test2 extends ffi.Struct { +class Test2 extends ffi.Struct { @ffi.Uint8() external int a; } diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart index 30653c8d41..c44ddddb7d 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart @@ -27,14 +27,14 @@ class Bindings { ); } - late final _test1_ptr = _lookup< + late final _test1Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Uint8, ffi.Pointer)>>('test1'); late final _test1 = - _test1_ptr.asFunction)>(); + _test1Ptr.asFunction)>(); } -class test2 extends ffi.Struct { +class Test2 extends ffi.Struct { @ffi.Uint8() external int a; } diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart index 8b94f2b337..2a7dba579e 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart @@ -23,9 +23,9 @@ class Bindings { return _noParam(); } - late final _noParam_ptr = + late final _noParamPtr = _lookup>('noParam'); - late final _noParam = _noParam_ptr.asFunction(); + late final _noParam = _noParamPtr.asFunction(); int withPrimitiveParam( int a, @@ -37,11 +37,11 @@ class Bindings { ); } - late final _withPrimitiveParam_ptr = + late final _withPrimitiveParamPtr = _lookup>( 'withPrimitiveParam'); late final _withPrimitiveParam = - _withPrimitiveParam_ptr.asFunction(); + _withPrimitiveParamPtr.asFunction(); ffi.Pointer withPointerParam( ffi.Pointer a, @@ -53,11 +53,11 @@ class Bindings { ); } - late final _withPointerParam_ptr = _lookup< + late final _withPointerParamPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer>)>>('withPointerParam'); - late final _withPointerParam = _withPointerParam_ptr.asFunction< + late final _withPointerParam = _withPointerParamPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer>)>(); } diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart index d658e31d4e..6ccce4eb49 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart @@ -25,11 +25,11 @@ class Bindings { ); } - late final _someFunc_ptr = _lookup< + late final _someFuncPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer>)>>('someFunc'); - late final _someFunc = _someFunc_ptr.asFunction< + late final _someFunc = _someFuncPtr.asFunction< ffi.Pointer Function(ffi.Pointer>)>(); } diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart index 7a0cff24fe..b6e1378385 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart @@ -1,64 +1,64 @@ -// ignore_for_file: unused_element +// ignore_for_file: unused_element, camel_case_types, non_constant_identifier_names // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -class init_dylib_1 { +class init_dylib1 { /// Holds the symbol lookup function. final ffi.Pointer Function(String symbolName) _lookup; /// The symbols are looked up in [dynamicLibrary]. - init_dylib_1(ffi.DynamicLibrary dynamicLibrary) + init_dylib1(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; /// The symbols are looked up with [lookup]. - init_dylib_1.fromLookup( + init_dylib1.fromLookup( ffi.Pointer Function(String symbolName) lookup) : _lookup = lookup; void test() { - return _test_1(); + return _test1(); } - late final _test_ptr = + late final _testPtr = _lookup>('test'); - late final _test_1 = _test_ptr.asFunction(); + late final _test1 = _testPtr.asFunction(); void _test() { return __test(); } - late final __test_ptr = + late final __testPtr = _lookup>('_test'); - late final __test = __test_ptr.asFunction(); + late final __test = __testPtr.asFunction(); void _c_test() { return __c_test(); } - late final __c_test_ptr = + late final __c_testPtr = _lookup>('_c_test'); - late final __c_test = __c_test_ptr.asFunction(); + late final __c_test = __c_testPtr.asFunction(); void _dart_test() { return __dart_test(); } - late final __dart_test_ptr = + late final __dart_testPtr = _lookup>('_dart_test'); - late final __dart_test = __dart_test_ptr.asFunction(); + late final __dart_test = __dart_testPtr.asFunction(); void Test() { return _Test(); } - late final _Test_ptr = + late final _TestPtr = _lookup>('Test'); - late final _Test = _Test_ptr.asFunction(); + late final _Test = _TestPtr.asFunction(); } class _Test extends ffi.Struct { diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart index 9c647d7523..4aea89af06 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart @@ -21,13 +21,13 @@ class Pack2 extends ffi.Struct { } @ffi.Packed(4) -class Pack2_1 extends ffi.Struct { +class Pack21 extends ffi.Struct { @ffi.Uint8() external int a; } @ffi.Packed(8) -class Pack2_2 extends ffi.Struct { +class Pack22 extends ffi.Struct { @ffi.Uint8() external int a; } diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart index fd1b0beb06..cbae1f827e 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart @@ -21,17 +21,17 @@ class Bindings { return _a(); } - late final _a_ptr = _lookup>('a'); - late final _a = _a_ptr.asFunction(); + late final _aPtr = _lookup>('a'); + late final _a = _aPtr.asFunction(); void b() { return _b(); } - late final _b_ptr = _lookup>('b'); - late final _b = _b_ptr.asFunction(); + late final _bPtr = _lookup>('b'); + late final _b = _bPtr.asFunction(); } -class c extends ffi.Opaque {} +class C extends ffi.Opaque {} -class d extends ffi.Opaque {} +class D extends ffi.Opaque {} diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart index 4b63376902..e605db2826 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart @@ -1,3 +1,5 @@ +// ignore_for_file: non_constant_identifier_names + // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. @@ -17,19 +19,19 @@ class Bindings { lookup) : _lookup = lookup; - ffi.Pointer> WithTypealiasStruc_1( + ffi.Pointer> WithTypealiasStruc1( Struct3Typealias t, ) { - return _WithTypealiasStruc_1( + return _WithTypealiasStruc1( t, ); } - late final _WithTypealiasStruc_1_ptr = _lookup< + late final _WithTypealiasStruc1Ptr = _lookup< ffi.NativeFunction< ffi.Pointer> Function( Struct3Typealias)>>('WithTypealiasStruc'); - late final _WithTypealiasStruc_1 = _WithTypealiasStruc_1_ptr.asFunction< + late final _WithTypealiasStruc1 = _WithTypealiasStruc1Ptr.asFunction< ffi.Pointer> Function( Struct3Typealias)>(); } diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart index 60399e541d..c7e7680caf 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart @@ -40,7 +40,7 @@ class PrimitivesWithPointers extends ffi.Union { external ffi.Pointer d; - external ffi.Pointer d_1; + external ffi.Pointer d1; } class WithArray extends ffi.Union { @@ -51,7 +51,7 @@ class WithArray extends ffi.Union { external ffi.Array b; @ffi.Array.multi([10]) - external ffi.Array b_1; + external ffi.Array b1; @ffi.Array.multi([10]) external ffi.Array> c; diff --git a/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart index ac22f402ca..914563bf9b 100644 --- a/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart @@ -55,20 +55,20 @@ void main() { /// Conflicts with ffi library prefix, name of prefix is changed. Struc(name: 'ffi'), Func( - name: 'ffi_1', + name: 'ffi1', returnType: Type.nativeType(SupportedNativeType.Void)), ]); final l2 = Library(name: 'Bindings', bindings: [ Struc(name: 'TestStruc'), - Struc(name: 'TestStruc_1'), + Struc(name: 'TestStruc1'), EnumClass(name: 'TestEnum'), - EnumClass(name: 'TestEnum_1'), + EnumClass(name: 'TestEnum1'), Func( name: 'testFunc', originalName: 'testFunc', returnType: Type.nativeType(SupportedNativeType.Void)), Func( - name: 'testFunc_1', + name: 'testFunc1', originalName: 'testFunc', returnType: Type.nativeType(SupportedNativeType.Void)), Constant( @@ -79,28 +79,28 @@ void main() { ), Constant( originalName: 'Test_Macro', - name: 'Test_Macro_1', + name: 'Test_Macro1', rawType: 'int', rawValue: '0', ), Typealias( name: 'testAlias', type: Type.nativeType(SupportedNativeType.Void)), Typealias( - name: 'testAlias_1', + name: 'testAlias1', type: Type.nativeType(SupportedNativeType.Void)), Struc(name: 'testCrossDecl', originalName: 'testCrossDecl'), Func( - name: 'testCrossDecl_1', + name: 'testCrossDecl1', originalName: 'testCrossDecl', returnType: Type.nativeType(SupportedNativeType.Void)), - Constant(name: 'testCrossDecl_2', rawValue: '0', rawType: 'int'), - EnumClass(name: 'testCrossDecl_3'), + Constant(name: 'testCrossDecl2', rawValue: '0', rawType: 'int'), + EnumClass(name: 'testCrossDecl3'), Typealias( - name: 'testCrossDecl_4', + name: 'testCrossDecl4', type: Type.nativeType(SupportedNativeType.Void)), Struc(name: 'ffi'), Func( - name: 'ffi_1', + name: 'ffi1', returnType: Type.nativeType(SupportedNativeType.Void)), ]); diff --git a/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart b/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart index b11252f8bb..52cad514a2 100644 --- a/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart @@ -14,7 +14,8 @@ void main() { logWarnings(Level.SEVERE); actual = Library( name: 'Bindings', - header: '// ignore_for_file: unused_element', + header: + '// ignore_for_file: unused_element, camel_case_types, non_constant_identifier_names\n', bindings: [ Struc(name: 'addresses'), Struc(name: '_SymbolAddresses'), diff --git a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart index a8d8a7b23a..2f74f028fe 100644 --- a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart +++ b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart @@ -1,20 +1,21 @@ -// ignore_for_file: unused_element +// ignore_for_file: unused_element, camel_case_types, non_constant_identifier_names + // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -class Bindings_1 { +class Bindings1 { /// Holds the symbol lookup function. final ffi.Pointer Function(String symbolName) _lookup; /// The symbols are looked up in [dynamicLibrary]. - Bindings_1(ffi.DynamicLibrary dynamicLibrary) + Bindings1(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; /// The symbols are looked up with [lookup]. - Bindings_1.fromLookup( + Bindings1.fromLookup( ffi.Pointer Function(String symbolName) lookup) : _lookup = lookup; @@ -23,30 +24,30 @@ class Bindings_1 { return __library(); } - late final __library_ptr = + late final __libraryPtr = _lookup>('_library'); - late final __library = __library_ptr.asFunction(); + late final __library = __libraryPtr.asFunction(); void _SymbolAddresses_1() { return __SymbolAddresses_1(); } - late final __SymbolAddresses_1_ptr = + late final __SymbolAddresses_1Ptr = _lookup>( '_SymbolAddresses_1'); late final __SymbolAddresses_1 = - __SymbolAddresses_1_ptr.asFunction(); + __SymbolAddresses_1Ptr.asFunction(); - late final addresses = _SymbolAddresses_2(this); + late final addresses = _SymbolAddresses1(this); } -class _SymbolAddresses_2 { - final Bindings_1 _library_1; - _SymbolAddresses_2(this._library_1); +class _SymbolAddresses1 { + final Bindings1 _library1; + _SymbolAddresses1(this._library1); ffi.Pointer> get _library => - _library_1.__library_ptr; + _library1.__libraryPtr; ffi.Pointer> - get _SymbolAddresses_1 => _library_1.__SymbolAddresses_1_ptr; + get _SymbolAddresses_1 => _library1.__SymbolAddresses_1Ptr; } class addresses extends ffi.Opaque {} diff --git a/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart b/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart index 7764ee15fc..e38894dd0c 100644 --- a/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart @@ -48,40 +48,40 @@ void main() { Typealias(name: 'var', type: Type.nativeType(SupportedNativeType.Void)), ]); final l2 = Library(name: 'Bindings', bindings: [ - Struc(name: 'abstract_1'), - Struc(name: 'abstract_2'), - Struc(name: 'if_1'), - EnumClass(name: 'return_1'), - EnumClass(name: 'export_1'), + Struc(name: 'abstract1'), + Struc(name: 'abstract2'), + Struc(name: 'if1'), + EnumClass(name: 'return1'), + EnumClass(name: 'export1'), Func( - name: 'show_1', + name: 'show1', originalName: 'show', returnType: Type.nativeType(SupportedNativeType.Void)), Func( - name: 'implements_1', + name: 'implements1', originalName: 'implements', parameters: [ Parameter( type: Type.nativeType(SupportedNativeType.Int32), - name: 'if_1', + name: 'if1', ), Parameter( type: Type.nativeType(SupportedNativeType.Int32), - name: 'abstract_1', + name: 'abstract1', ), Parameter( type: Type.nativeType(SupportedNativeType.Int32), - name: 'in_1', + name: 'in1', ), ], returnType: Type.nativeType(SupportedNativeType.Void)), Constant( - name: 'else_1', + name: 'else1', rawType: 'int', rawValue: '0', ), Typealias( - name: 'var_1', type: Type.nativeType(SupportedNativeType.Void)), + name: 'var1', type: Type.nativeType(SupportedNativeType.Void)), ]); expect(l1.generate(), l2.generate()); }); diff --git a/pkgs/ffigen/test/example_tests/cjson_example_test.dart b/pkgs/ffigen/test/example_tests/cjson_example_test.dart index 7d094330a3..c95bcf200a 100644 --- a/pkgs/ffigen/test/example_tests/cjson_example_test.dart +++ b/pkgs/ffigen/test/example_tests/cjson_example_test.dart @@ -49,6 +49,8 @@ ${strings.preamble}: | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. + + // ignore_for_file: camel_case_types, non_constant_identifier_names ''') as YamlMap); final library = parse(config); diff --git a/pkgs/ffigen/test/example_tests/libclang_example_test.dart b/pkgs/ffigen/test/example_tests/libclang_example_test.dart index 1c3b2b756c..7ba17c548b 100644 --- a/pkgs/ffigen/test/example_tests/libclang_example_test.dart +++ b/pkgs/ffigen/test/example_tests/libclang_example_test.dart @@ -54,6 +54,8 @@ ${strings.preamble}: | // Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + + // ignore_for_file: camel_case_types, non_constant_identifier_names ''') as YamlMap); final library = parse(config); diff --git a/pkgs/ffigen/test/header_parser_tests/comment_markup.h b/pkgs/ffigen/test/header_parser_tests/comment_markup.h index 1201e87b50..b3912dabd4 100644 --- a/pkgs/ffigen/test/header_parser_tests/comment_markup.h +++ b/pkgs/ffigen/test/header_parser_tests/comment_markup.h @@ -16,7 +16,7 @@ void com2(); void com3(); // Test comment for struct. -struct com4{ +struct Com4{ /// Muli-line test comment for struct field // With multiple line and both // and ///. int a; diff --git a/pkgs/ffigen/test/header_parser_tests/dart_handle.h b/pkgs/ffigen/test/header_parser_tests/dart_handle.h index 72fa445708..8a2d802ceb 100644 --- a/pkgs/ffigen/test/header_parser_tests/dart_handle.h +++ b/pkgs/ffigen/test/header_parser_tests/dart_handle.h @@ -8,18 +8,18 @@ void func1(Dart_Handle); Dart_Handle func2(); Dart_Handle **func3(Dart_Handle *); -typedef void (*typedef1)(Dart_Handle); -void func4(typedef1); +typedef void (*Typedef1)(Dart_Handle); +void func4(Typedef1); // Dart_Handle isn't supported directly, so all members are removed. -struct struc1 +struct Struc1 { Dart_Handle h; int a; }; // Pointer works. -struct struc2 +struct Struc2 { Dart_Handle *h; }; diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart index 378bec0240..6a95e52483 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart @@ -24,9 +24,9 @@ class NativeLibrary { return _com1(); } - late final _com1_ptr = + late final _com1Ptr = _lookup>('com1'); - late final _com1 = _com1_ptr.asFunction(); + late final _com1 = _com1Ptr.asFunction(); /// This is a multi-line /// test comment. @@ -34,9 +34,9 @@ class NativeLibrary { return _com2(); } - late final _com2_ptr = + late final _com2Ptr = _lookup>('com2'); - late final _com2 = _com2_ptr.asFunction(); + late final _com2 = _com2Ptr.asFunction(); /// This is a multi-line /// doxygen style @@ -45,13 +45,13 @@ class NativeLibrary { return _com3(); } - late final _com3_ptr = + late final _com3Ptr = _lookup>('com3'); - late final _com3 = _com3_ptr.asFunction(); + late final _com3 = _com3Ptr.asFunction(); } /// Test comment for struct. -class com4 extends ffi.Struct { +class Com4 extends ffi.Struct { /// Muli-line test comment for struct field /// With multiple line and both // and ///. @ffi.Int32() diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart index 7d87f98962..b00eaf9007 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart @@ -27,17 +27,17 @@ class NativeLibrary { ); } - late final _func1_ptr = + late final _func1Ptr = _lookup>('func1'); - late final _func1 = _func1_ptr.asFunction(); + late final _func1 = _func1Ptr.asFunction(); Object func2() { return _func2(); } - late final _func2_ptr = + late final _func2Ptr = _lookup>('func2'); - late final _func2 = _func2_ptr.asFunction(); + late final _func2 = _func2Ptr.asFunction(); ffi.Pointer> func3( ffi.Pointer arg0, @@ -47,31 +47,31 @@ class NativeLibrary { ); } - late final _func3_ptr = _lookup< + late final _func3Ptr = _lookup< ffi.NativeFunction< ffi.Pointer> Function( ffi.Pointer)>>('func3'); - late final _func3 = _func3_ptr.asFunction< + late final _func3 = _func3Ptr.asFunction< ffi.Pointer> Function(ffi.Pointer)>(); void func4( - typedef1 arg0, + Typedef1 arg0, ) { return _func4( arg0, ); } - late final _func4_ptr = - _lookup>('func4'); - late final _func4 = _func4_ptr.asFunction(); + late final _func4Ptr = + _lookup>('func4'); + late final _func4 = _func4Ptr.asFunction(); } -typedef typedef1 +typedef Typedef1 = ffi.Pointer>; -class struc1 extends ffi.Opaque {} +class Struc1 extends ffi.Opaque {} -class struc2 extends ffi.Struct { +class Struc2 extends ffi.Struct { external ffi.Pointer h; } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart index 355255bf74..01fe05c81c 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart @@ -29,10 +29,10 @@ class NativeLibrary { ); } - late final _func_ptr = + late final _funcPtr = _lookup, ffi.Int32)>>( 'func'); - late final _func = _func_ptr.asFunction, int)>(); + late final _func = _funcPtr.asFunction, int)>(); } class A extends ffi.Struct { diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart index 769371aea2..01c1fdea63 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart @@ -1,3 +1,5 @@ +// ignore_for_file: camel_case_types + // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. @@ -23,9 +25,9 @@ class NativeLibrary { return _func1(); } - late final _func1_ptr = + late final _func1Ptr = _lookup>('func1'); - late final _func1 = _func1_ptr.asFunction(); + late final _func1 = _func1Ptr.asFunction(); int func2( int arg0, @@ -35,9 +37,9 @@ class NativeLibrary { ); } - late final _func2_ptr = + late final _func2Ptr = _lookup>('func2'); - late final _func2 = _func2_ptr.asFunction(); + late final _func2 = _func2Ptr.asFunction(); double func3( double arg0, @@ -53,9 +55,9 @@ class NativeLibrary { ); } - late final _func3_ptr = _lookup>('func3'); + late final _func3Ptr = _lookup>('func3'); late final _func3 = - _func3_ptr.asFunction(); + _func3Ptr.asFunction(); ffi.Pointer func4( ffi.Pointer> arg0, @@ -69,8 +71,8 @@ class NativeLibrary { ); } - late final _func4_ptr = _lookup>('func4'); - late final _func4 = _func4_ptr.asFunction< + late final _func4Ptr = _lookup>('func4'); + late final _func4 = _func4Ptr.asFunction< ffi.Pointer Function(ffi.Pointer>, double, ffi.Pointer>>)>(); @@ -84,11 +86,11 @@ class NativeLibrary { ); } - late final _func5_ptr = _lookup< + late final _func5Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer>)>>('func5'); - late final _func5 = _func5_ptr.asFunction< + late final _func5 = _func5Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer>)>(); @@ -98,10 +100,8 @@ class NativeLibrary { class _SymbolAddresses { final NativeLibrary _library; _SymbolAddresses(this._library); - ffi.Pointer> get func3 => - _library._func3_ptr; - ffi.Pointer> get func4 => - _library._func4_ptr; + ffi.Pointer> get func3 => _library._func3Ptr; + ffi.Pointer> get func4 => _library._func4Ptr; } typedef Native_func3 = ffi.Double Function( diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart index 5cf12c3cc5..802d838e0f 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart @@ -31,7 +31,7 @@ class NativeLibrary { ); } - late final _func_ptr = _lookup< + late final _funcPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer< @@ -40,7 +40,7 @@ class NativeLibrary { ffi.Pointer< ffi.NativeFunction< ffi.Void Function()>>)>>)>>('func'); - late final _func = _func_ptr.asFunction< + late final _func = _funcPtr.asFunction< void Function( ffi.Pointer< ffi.NativeFunction< @@ -49,30 +49,30 @@ class NativeLibrary { ffi.NativeFunction>)>>)>(); void funcWithNativeFunc( - withTypedefReturnType named, + WithTypedefReturnType named, ) { return _funcWithNativeFunc( named, ); } - late final _funcWithNativeFunc_ptr = - _lookup>( + late final _funcWithNativeFuncPtr = + _lookup>( 'funcWithNativeFunc'); - late final _funcWithNativeFunc = _funcWithNativeFunc_ptr - .asFunction(); + late final _funcWithNativeFunc = + _funcWithNativeFuncPtr.asFunction(); } -class struc extends ffi.Struct { +class Struc extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< ffi.Void Function( ffi.Pointer>)>> unnamed1; } -typedef withTypedefReturnType - = ffi.Pointer>; -typedef insideReturnType = ffi.Pointer>; +typedef WithTypedefReturnType + = ffi.Pointer>; +typedef InsideReturnType = ffi.Pointer>; class Struc2 extends ffi.Struct { external VoidFuncPointer constFuncPointer; diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart index c8cb2e0561..b891dd9b58 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart @@ -19,7 +19,7 @@ class NativeLibrary { lookup) : _lookup = lookup; - ffi.Pointer func( + ffi.Pointer func( ffi.Pointer a, ) { return _func( @@ -27,11 +27,11 @@ class NativeLibrary { ); } - late final _func_ptr = _lookup< - ffi.NativeFunction Function(ffi.Pointer)>>( - 'func'); + late final _funcPtr = + _lookup Function(ffi.Pointer)>>( + 'func'); late final _func = - _func_ptr.asFunction Function(ffi.Pointer)>(); + _funcPtr.asFunction Function(ffi.Pointer)>(); ffi.Pointer func2( ffi.Pointer a, @@ -41,14 +41,14 @@ class NativeLibrary { ); } - late final _func2_ptr = + late final _func2Ptr = _lookup Function(ffi.Pointer)>>( 'func2'); late final _func2 = - _func2_ptr.asFunction Function(ffi.Pointer)>(); + _func2Ptr.asFunction Function(ffi.Pointer)>(); } -typedef B_alias = B; +typedef BAlias = B; class B extends ffi.Opaque {} diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart index fc0d39badf..ec8eb3fbe7 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart @@ -1,5 +1,4 @@ -// ignore_for_file: unused_element -// ignore_for_file: unused_field +// ignore_for_file: unused_element, unused_field // AUTO GENERATED FILE, DO NOT EDIT. // @@ -30,13 +29,13 @@ class Bindings { ); } - late final _func1_ptr = _lookup< + late final _func1Ptr = _lookup< ffi.NativeFunction< NamedFunctionProto Function( NamedFunctionProto, ffi.Pointer< ffi.NativeFunction>)>>('func1'); - late final _func1 = _func1_ptr.asFunction< + late final _func1 = _func1Ptr.asFunction< NamedFunctionProto Function(NamedFunctionProto, ffi.Pointer>)>(); @@ -48,11 +47,11 @@ class Bindings { ); } - late final _func2_ptr = + late final _func2Ptr = _lookup)>>( 'func2'); late final _func2 = - _func2_ptr.asFunction)>(); + _func2Ptr.asFunction)>(); void func3( int arg0, @@ -64,10 +63,10 @@ class Bindings { ); } - late final _func3_ptr = _lookup< + late final _func3Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.IntPtr, nesting_a_specified_type)>>('func3'); - late final _func3 = _func3_ptr.asFunction(); + ffi.Void Function(ffi.IntPtr, NestingASpecifiedType)>>('func3'); + late final _func3 = _func3Ptr.asFunction(); bool func4( ffi.Pointer a, @@ -78,11 +77,11 @@ class Bindings { 0; } - late final _func4_ptr = + late final _func4Ptr = _lookup)>>( 'func4'); late final _func4 = - _func4_ptr.asFunction)>(); + _func4Ptr.asFunction)>(); } class Struct1 extends ffi.Struct { @@ -111,11 +110,11 @@ abstract class _NamedEnumInTypedef { static const int b = 0; } -typedef nesting_a_specified_type = ffi.IntPtr; +typedef NestingASpecifiedType = ffi.IntPtr; class Struct2 extends ffi.Opaque {} -class withBoolAlias extends ffi.Struct { +class WithBoolAlias extends ffi.Struct { @ffi.Uint8() external int b; } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart index d1024151e0..1f62444197 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart @@ -27,11 +27,11 @@ class NativeLibrary { ); } - late final _func1_ptr = + late final _func1Ptr = _lookup)>>( 'func1'); late final _func1 = - _func1_ptr.asFunction)>(); + _func1Ptr.asFunction)>(); void func2( ffi.Pointer s, @@ -41,11 +41,11 @@ class NativeLibrary { ); } - late final _func2_ptr = + late final _func2Ptr = _lookup)>>( 'func2'); late final _func2 = - _func2_ptr.asFunction)>(); + _func2Ptr.asFunction)>(); } class Union1 extends ffi.Union { diff --git a/pkgs/ffigen/test/header_parser_tests/functions_test.dart b/pkgs/ffigen/test/header_parser_tests/functions_test.dart index 1bfb733bc8..87a864274d 100644 --- a/pkgs/ffigen/test/header_parser_tests/functions_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/functions_test.dart @@ -34,6 +34,9 @@ ${strings.functions}: ${strings.include}: - func3 - func4 + +${strings.preamble}: | + // ignore_for_file: camel_case_types ''') as yaml.YamlMap), ); }); diff --git a/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h b/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h index 94bcba97b1..8b942d0e62 100644 --- a/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h +++ b/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -struct struc +struct Struc { void (*unnamed1)(void (*unnamed2)()); }; @@ -12,9 +12,9 @@ void func(void (*unnamed1)(void (*unnamed2)())); // This will be removed because 'long double' is unsupported. void funcNestedUnimplemented(void (*unnamed1)(void (*unnamed2)(long double))); -typedef void (*insideReturnType)(); -typedef insideReturnType (*withTypedefReturnType)(); -void funcWithNativeFunc(withTypedefReturnType named); +typedef void (*InsideReturnType)(); +typedef InsideReturnType (*WithTypedefReturnType)(); +void funcWithNativeFunc(WithTypedefReturnType named); typedef void (*VoidFuncPointer)(); struct Struc2{ diff --git a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart index 284d1701b9..d09d972eab 100644 --- a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart @@ -71,7 +71,7 @@ Library expectedLibrary() { type: Type.nativeType(SupportedNativeType.Int32), ), ]); - final unnamedInternalStruc = Struc(name: 'unnamedStruct_1', members: [ + final unnamedInternalStruc = Struc(name: 'UnnamedStruct1', members: [ Member( name: 'a', type: Type.nativeType(SupportedNativeType.Int32), diff --git a/pkgs/ffigen/test/header_parser_tests/opaque_dependencies.h b/pkgs/ffigen/test/header_parser_tests/opaque_dependencies.h index 2825911a33..c1607d4df2 100644 --- a/pkgs/ffigen/test/header_parser_tests/opaque_dependencies.h +++ b/pkgs/ffigen/test/header_parser_tests/opaque_dependencies.h @@ -12,9 +12,9 @@ struct A typedef struct B { int a; -} B_alias; +} BAlias; -B_alias *func(struct A *a); +BAlias *func(struct A *a); // Opaque. struct C diff --git a/pkgs/ffigen/test/header_parser_tests/typedef.h b/pkgs/ffigen/test/header_parser_tests/typedef.h index 73e7e2e555..5e4f7fb3b5 100644 --- a/pkgs/ffigen/test/header_parser_tests/typedef.h +++ b/pkgs/ffigen/test/header_parser_tests/typedef.h @@ -52,20 +52,20 @@ typedef enum _NamedEnumInTypedef } NamedEnumInTypedef; // Should be treated as IntPtr when used. -typedef char specified_type_as_IntPtr; -typedef specified_type_as_IntPtr nesting_a_specified_type; +typedef char SpecifiedTypeAsIntPtr; +typedef SpecifiedTypeAsIntPtr NestingASpecifiedType; -void func3(specified_type_as_IntPtr, nesting_a_specified_type b); +void func3(SpecifiedTypeAsIntPtr, NestingASpecifiedType b); // Struct3 is used. `pStruct2` and `pStruct3` are ignored. typedef struct { } Struct2, Struct3, *pStruct2, *pStruct3; -typedef bool bool_alias; +typedef bool BoolAlias; -bool_alias func4(bool_alias *a); +BoolAlias func4(BoolAlias *a); -struct withBoolAlias{ - bool_alias b; +struct WithBoolAlias{ + BoolAlias b; }; diff --git a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart index 53417c29fc..6759603767 100644 --- a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart @@ -33,11 +33,10 @@ ${strings.structs}: - ExcludedStruct - _ExcludedStruct ${strings.typedefmap}: - 'specified_type_as_IntPtr': 'IntPtr' + 'SpecifiedTypeAsIntPtr': 'IntPtr' ${strings.preamble}: | - // ignore_for_file: unused_element - // ignore_for_file: unused_field + // ignore_for_file: unused_element, unused_field ''') as yaml.YamlMap), ); }); diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart index 73257d0c25..f16ca6e030 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart @@ -1,3 +1,5 @@ +// ignore_for_file: camel_case_types, non_constant_identifier_names + // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. @@ -22,11 +24,11 @@ class CJson { return _cJSON_Version(); } - late final _cJSON_Version_ptr = + late final _cJSON_VersionPtr = _lookup Function()>>( 'cJSON_Version'); late final _cJSON_Version = - _cJSON_Version_ptr.asFunction Function()>(); + _cJSON_VersionPtr.asFunction Function()>(); void cJSON_InitHooks( ffi.Pointer hooks, @@ -36,11 +38,11 @@ class CJson { ); } - late final _cJSON_InitHooks_ptr = + late final _cJSON_InitHooksPtr = _lookup)>>( 'cJSON_InitHooks'); - late final _cJSON_InitHooks = _cJSON_InitHooks_ptr - .asFunction)>(); + late final _cJSON_InitHooks = + _cJSON_InitHooksPtr.asFunction)>(); ffi.Pointer cJSON_Parse( ffi.Pointer value, @@ -50,10 +52,10 @@ class CJson { ); } - late final _cJSON_Parse_ptr = _lookup< + late final _cJSON_ParsePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer)>>('cJSON_Parse'); - late final _cJSON_Parse = _cJSON_Parse_ptr + late final _cJSON_Parse = _cJSON_ParsePtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_ParseWithOpts( @@ -68,13 +70,13 @@ class CJson { ); } - late final _cJSON_ParseWithOpts_ptr = _lookup< + late final _cJSON_ParseWithOptsPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer>, cJSON_bool)>>('cJSON_ParseWithOpts'); - late final _cJSON_ParseWithOpts = _cJSON_ParseWithOpts_ptr.asFunction< + late final _cJSON_ParseWithOpts = _cJSON_ParseWithOptsPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer>, int)>(); @@ -86,10 +88,10 @@ class CJson { ); } - late final _cJSON_Print_ptr = _lookup< + late final _cJSON_PrintPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer)>>('cJSON_Print'); - late final _cJSON_Print = _cJSON_Print_ptr + late final _cJSON_Print = _cJSON_PrintPtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_PrintUnformatted( @@ -100,11 +102,11 @@ class CJson { ); } - late final _cJSON_PrintUnformatted_ptr = _lookup< + late final _cJSON_PrintUnformattedPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('cJSON_PrintUnformatted'); - late final _cJSON_PrintUnformatted = _cJSON_PrintUnformatted_ptr + late final _cJSON_PrintUnformatted = _cJSON_PrintUnformattedPtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_PrintBuffered( @@ -119,11 +121,11 @@ class CJson { ); } - late final _cJSON_PrintBuffered_ptr = _lookup< + late final _cJSON_PrintBufferedPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Int32, cJSON_bool)>>('cJSON_PrintBuffered'); - late final _cJSON_PrintBuffered = _cJSON_PrintBuffered_ptr.asFunction< + late final _cJSON_PrintBuffered = _cJSON_PrintBufferedPtr.asFunction< ffi.Pointer Function(ffi.Pointer, int, int)>(); int cJSON_PrintPreallocated( @@ -140,11 +142,11 @@ class CJson { ); } - late final _cJSON_PrintPreallocated_ptr = _lookup< + late final _cJSON_PrintPreallocatedPtr = _lookup< ffi.NativeFunction< cJSON_bool Function(ffi.Pointer, ffi.Pointer, ffi.Int32, cJSON_bool)>>('cJSON_PrintPreallocated'); - late final _cJSON_PrintPreallocated = _cJSON_PrintPreallocated_ptr.asFunction< + late final _cJSON_PrintPreallocated = _cJSON_PrintPreallocatedPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, int)>(); void cJSON_Delete( @@ -155,11 +157,11 @@ class CJson { ); } - late final _cJSON_Delete_ptr = + late final _cJSON_DeletePtr = _lookup)>>( 'cJSON_Delete'); late final _cJSON_Delete = - _cJSON_Delete_ptr.asFunction)>(); + _cJSON_DeletePtr.asFunction)>(); int cJSON_GetArraySize( ffi.Pointer array, @@ -169,11 +171,11 @@ class CJson { ); } - late final _cJSON_GetArraySize_ptr = + late final _cJSON_GetArraySizePtr = _lookup)>>( 'cJSON_GetArraySize'); late final _cJSON_GetArraySize = - _cJSON_GetArraySize_ptr.asFunction)>(); + _cJSON_GetArraySizePtr.asFunction)>(); ffi.Pointer cJSON_GetArrayItem( ffi.Pointer array, @@ -185,11 +187,11 @@ class CJson { ); } - late final _cJSON_GetArrayItem_ptr = _lookup< + late final _cJSON_GetArrayItemPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Int32)>>('cJSON_GetArrayItem'); - late final _cJSON_GetArrayItem = _cJSON_GetArrayItem_ptr + late final _cJSON_GetArrayItem = _cJSON_GetArrayItemPtr .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_GetObjectItem( @@ -202,11 +204,11 @@ class CJson { ); } - late final _cJSON_GetObjectItem_ptr = _lookup< + late final _cJSON_GetObjectItemPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('cJSON_GetObjectItem'); - late final _cJSON_GetObjectItem = _cJSON_GetObjectItem_ptr.asFunction< + late final _cJSON_GetObjectItem = _cJSON_GetObjectItemPtr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_GetObjectItemCaseSensitive( @@ -219,12 +221,12 @@ class CJson { ); } - late final _cJSON_GetObjectItemCaseSensitive_ptr = _lookup< + late final _cJSON_GetObjectItemCaseSensitivePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('cJSON_GetObjectItemCaseSensitive'); late final _cJSON_GetObjectItemCaseSensitive = - _cJSON_GetObjectItemCaseSensitive_ptr.asFunction< + _cJSON_GetObjectItemCaseSensitivePtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); @@ -238,22 +240,22 @@ class CJson { ); } - late final _cJSON_HasObjectItem_ptr = _lookup< + late final _cJSON_HasObjectItemPtr = _lookup< ffi.NativeFunction< cJSON_bool Function(ffi.Pointer, ffi.Pointer)>>('cJSON_HasObjectItem'); - late final _cJSON_HasObjectItem = _cJSON_HasObjectItem_ptr + late final _cJSON_HasObjectItem = _cJSON_HasObjectItemPtr .asFunction, ffi.Pointer)>(); ffi.Pointer cJSON_GetErrorPtr() { return _cJSON_GetErrorPtr(); } - late final _cJSON_GetErrorPtr_ptr = + late final _cJSON_GetErrorPtrPtr = _lookup Function()>>( 'cJSON_GetErrorPtr'); late final _cJSON_GetErrorPtr = - _cJSON_GetErrorPtr_ptr.asFunction Function()>(); + _cJSON_GetErrorPtrPtr.asFunction Function()>(); ffi.Pointer cJSON_GetStringValue( ffi.Pointer item, @@ -263,11 +265,11 @@ class CJson { ); } - late final _cJSON_GetStringValue_ptr = _lookup< + late final _cJSON_GetStringValuePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('cJSON_GetStringValue'); - late final _cJSON_GetStringValue = _cJSON_GetStringValue_ptr + late final _cJSON_GetStringValue = _cJSON_GetStringValuePtr .asFunction Function(ffi.Pointer)>(); int cJSON_IsInvalid( @@ -278,11 +280,11 @@ class CJson { ); } - late final _cJSON_IsInvalid_ptr = + late final _cJSON_IsInvalidPtr = _lookup)>>( 'cJSON_IsInvalid'); late final _cJSON_IsInvalid = - _cJSON_IsInvalid_ptr.asFunction)>(); + _cJSON_IsInvalidPtr.asFunction)>(); int cJSON_IsFalse( ffi.Pointer item, @@ -292,11 +294,11 @@ class CJson { ); } - late final _cJSON_IsFalse_ptr = + late final _cJSON_IsFalsePtr = _lookup)>>( 'cJSON_IsFalse'); late final _cJSON_IsFalse = - _cJSON_IsFalse_ptr.asFunction)>(); + _cJSON_IsFalsePtr.asFunction)>(); int cJSON_IsTrue( ffi.Pointer item, @@ -306,11 +308,11 @@ class CJson { ); } - late final _cJSON_IsTrue_ptr = + late final _cJSON_IsTruePtr = _lookup)>>( 'cJSON_IsTrue'); late final _cJSON_IsTrue = - _cJSON_IsTrue_ptr.asFunction)>(); + _cJSON_IsTruePtr.asFunction)>(); int cJSON_IsBool( ffi.Pointer item, @@ -320,11 +322,11 @@ class CJson { ); } - late final _cJSON_IsBool_ptr = + late final _cJSON_IsBoolPtr = _lookup)>>( 'cJSON_IsBool'); late final _cJSON_IsBool = - _cJSON_IsBool_ptr.asFunction)>(); + _cJSON_IsBoolPtr.asFunction)>(); int cJSON_IsNull( ffi.Pointer item, @@ -334,11 +336,11 @@ class CJson { ); } - late final _cJSON_IsNull_ptr = + late final _cJSON_IsNullPtr = _lookup)>>( 'cJSON_IsNull'); late final _cJSON_IsNull = - _cJSON_IsNull_ptr.asFunction)>(); + _cJSON_IsNullPtr.asFunction)>(); int cJSON_IsNumber( ffi.Pointer item, @@ -348,11 +350,11 @@ class CJson { ); } - late final _cJSON_IsNumber_ptr = + late final _cJSON_IsNumberPtr = _lookup)>>( 'cJSON_IsNumber'); late final _cJSON_IsNumber = - _cJSON_IsNumber_ptr.asFunction)>(); + _cJSON_IsNumberPtr.asFunction)>(); int cJSON_IsString( ffi.Pointer item, @@ -362,11 +364,11 @@ class CJson { ); } - late final _cJSON_IsString_ptr = + late final _cJSON_IsStringPtr = _lookup)>>( 'cJSON_IsString'); late final _cJSON_IsString = - _cJSON_IsString_ptr.asFunction)>(); + _cJSON_IsStringPtr.asFunction)>(); int cJSON_IsArray( ffi.Pointer item, @@ -376,11 +378,11 @@ class CJson { ); } - late final _cJSON_IsArray_ptr = + late final _cJSON_IsArrayPtr = _lookup)>>( 'cJSON_IsArray'); late final _cJSON_IsArray = - _cJSON_IsArray_ptr.asFunction)>(); + _cJSON_IsArrayPtr.asFunction)>(); int cJSON_IsObject( ffi.Pointer item, @@ -390,11 +392,11 @@ class CJson { ); } - late final _cJSON_IsObject_ptr = + late final _cJSON_IsObjectPtr = _lookup)>>( 'cJSON_IsObject'); late final _cJSON_IsObject = - _cJSON_IsObject_ptr.asFunction)>(); + _cJSON_IsObjectPtr.asFunction)>(); int cJSON_IsRaw( ffi.Pointer item, @@ -404,41 +406,41 @@ class CJson { ); } - late final _cJSON_IsRaw_ptr = + late final _cJSON_IsRawPtr = _lookup)>>( 'cJSON_IsRaw'); late final _cJSON_IsRaw = - _cJSON_IsRaw_ptr.asFunction)>(); + _cJSON_IsRawPtr.asFunction)>(); ffi.Pointer cJSON_CreateNull() { return _cJSON_CreateNull(); } - late final _cJSON_CreateNull_ptr = + late final _cJSON_CreateNullPtr = _lookup Function()>>( 'cJSON_CreateNull'); late final _cJSON_CreateNull = - _cJSON_CreateNull_ptr.asFunction Function()>(); + _cJSON_CreateNullPtr.asFunction Function()>(); ffi.Pointer cJSON_CreateTrue() { return _cJSON_CreateTrue(); } - late final _cJSON_CreateTrue_ptr = + late final _cJSON_CreateTruePtr = _lookup Function()>>( 'cJSON_CreateTrue'); late final _cJSON_CreateTrue = - _cJSON_CreateTrue_ptr.asFunction Function()>(); + _cJSON_CreateTruePtr.asFunction Function()>(); ffi.Pointer cJSON_CreateFalse() { return _cJSON_CreateFalse(); } - late final _cJSON_CreateFalse_ptr = + late final _cJSON_CreateFalsePtr = _lookup Function()>>( 'cJSON_CreateFalse'); late final _cJSON_CreateFalse = - _cJSON_CreateFalse_ptr.asFunction Function()>(); + _cJSON_CreateFalsePtr.asFunction Function()>(); ffi.Pointer cJSON_CreateBool( int boolean, @@ -448,11 +450,11 @@ class CJson { ); } - late final _cJSON_CreateBool_ptr = + late final _cJSON_CreateBoolPtr = _lookup Function(cJSON_bool)>>( 'cJSON_CreateBool'); late final _cJSON_CreateBool = - _cJSON_CreateBool_ptr.asFunction Function(int)>(); + _cJSON_CreateBoolPtr.asFunction Function(int)>(); ffi.Pointer cJSON_CreateNumber( double num, @@ -462,11 +464,11 @@ class CJson { ); } - late final _cJSON_CreateNumber_ptr = + late final _cJSON_CreateNumberPtr = _lookup Function(ffi.Double)>>( 'cJSON_CreateNumber'); late final _cJSON_CreateNumber = - _cJSON_CreateNumber_ptr.asFunction Function(double)>(); + _cJSON_CreateNumberPtr.asFunction Function(double)>(); ffi.Pointer cJSON_CreateString( ffi.Pointer string, @@ -476,11 +478,11 @@ class CJson { ); } - late final _cJSON_CreateString_ptr = _lookup< + late final _cJSON_CreateStringPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('cJSON_CreateString'); - late final _cJSON_CreateString = _cJSON_CreateString_ptr + late final _cJSON_CreateString = _cJSON_CreateStringPtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateRaw( @@ -491,32 +493,32 @@ class CJson { ); } - late final _cJSON_CreateRaw_ptr = _lookup< + late final _cJSON_CreateRawPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('cJSON_CreateRaw'); - late final _cJSON_CreateRaw = _cJSON_CreateRaw_ptr + late final _cJSON_CreateRaw = _cJSON_CreateRawPtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateArray() { return _cJSON_CreateArray(); } - late final _cJSON_CreateArray_ptr = + late final _cJSON_CreateArrayPtr = _lookup Function()>>( 'cJSON_CreateArray'); late final _cJSON_CreateArray = - _cJSON_CreateArray_ptr.asFunction Function()>(); + _cJSON_CreateArrayPtr.asFunction Function()>(); ffi.Pointer cJSON_CreateObject() { return _cJSON_CreateObject(); } - late final _cJSON_CreateObject_ptr = + late final _cJSON_CreateObjectPtr = _lookup Function()>>( 'cJSON_CreateObject'); late final _cJSON_CreateObject = - _cJSON_CreateObject_ptr.asFunction Function()>(); + _cJSON_CreateObjectPtr.asFunction Function()>(); ffi.Pointer cJSON_CreateStringReference( ffi.Pointer string, @@ -526,11 +528,11 @@ class CJson { ); } - late final _cJSON_CreateStringReference_ptr = _lookup< + late final _cJSON_CreateStringReferencePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('cJSON_CreateStringReference'); - late final _cJSON_CreateStringReference = _cJSON_CreateStringReference_ptr + late final _cJSON_CreateStringReference = _cJSON_CreateStringReferencePtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateObjectReference( @@ -541,10 +543,10 @@ class CJson { ); } - late final _cJSON_CreateObjectReference_ptr = _lookup< + late final _cJSON_CreateObjectReferencePtr = _lookup< ffi.NativeFunction Function(ffi.Pointer)>>( 'cJSON_CreateObjectReference'); - late final _cJSON_CreateObjectReference = _cJSON_CreateObjectReference_ptr + late final _cJSON_CreateObjectReference = _cJSON_CreateObjectReferencePtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateArrayReference( @@ -555,10 +557,10 @@ class CJson { ); } - late final _cJSON_CreateArrayReference_ptr = _lookup< + late final _cJSON_CreateArrayReferencePtr = _lookup< ffi.NativeFunction Function(ffi.Pointer)>>( 'cJSON_CreateArrayReference'); - late final _cJSON_CreateArrayReference = _cJSON_CreateArrayReference_ptr + late final _cJSON_CreateArrayReference = _cJSON_CreateArrayReferencePtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateIntArray( @@ -571,11 +573,11 @@ class CJson { ); } - late final _cJSON_CreateIntArray_ptr = _lookup< + late final _cJSON_CreateIntArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Int32)>>('cJSON_CreateIntArray'); - late final _cJSON_CreateIntArray = _cJSON_CreateIntArray_ptr + late final _cJSON_CreateIntArray = _cJSON_CreateIntArrayPtr .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateFloatArray( @@ -588,11 +590,11 @@ class CJson { ); } - late final _cJSON_CreateFloatArray_ptr = _lookup< + late final _cJSON_CreateFloatArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Int32)>>('cJSON_CreateFloatArray'); - late final _cJSON_CreateFloatArray = _cJSON_CreateFloatArray_ptr + late final _cJSON_CreateFloatArray = _cJSON_CreateFloatArrayPtr .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateDoubleArray( @@ -605,11 +607,11 @@ class CJson { ); } - late final _cJSON_CreateDoubleArray_ptr = _lookup< + late final _cJSON_CreateDoubleArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Int32)>>('cJSON_CreateDoubleArray'); - late final _cJSON_CreateDoubleArray = _cJSON_CreateDoubleArray_ptr + late final _cJSON_CreateDoubleArray = _cJSON_CreateDoubleArrayPtr .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateStringArray( @@ -622,11 +624,11 @@ class CJson { ); } - late final _cJSON_CreateStringArray_ptr = _lookup< + late final _cJSON_CreateStringArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer>, ffi.Int32)>>('cJSON_CreateStringArray'); - late final _cJSON_CreateStringArray = _cJSON_CreateStringArray_ptr.asFunction< + late final _cJSON_CreateStringArray = _cJSON_CreateStringArrayPtr.asFunction< ffi.Pointer Function(ffi.Pointer>, int)>(); void cJSON_AddItemToArray( @@ -639,11 +641,11 @@ class CJson { ); } - late final _cJSON_AddItemToArray_ptr = _lookup< + late final _cJSON_AddItemToArrayPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemToArray'); - late final _cJSON_AddItemToArray = _cJSON_AddItemToArray_ptr + late final _cJSON_AddItemToArray = _cJSON_AddItemToArrayPtr .asFunction, ffi.Pointer)>(); void cJSON_AddItemToObject( @@ -658,11 +660,11 @@ class CJson { ); } - late final _cJSON_AddItemToObject_ptr = _lookup< + late final _cJSON_AddItemToObjectPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemToObject'); - late final _cJSON_AddItemToObject = _cJSON_AddItemToObject_ptr.asFunction< + late final _cJSON_AddItemToObject = _cJSON_AddItemToObjectPtr.asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -678,11 +680,11 @@ class CJson { ); } - late final _cJSON_AddItemToObjectCS_ptr = _lookup< + late final _cJSON_AddItemToObjectCSPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemToObjectCS'); - late final _cJSON_AddItemToObjectCS = _cJSON_AddItemToObjectCS_ptr.asFunction< + late final _cJSON_AddItemToObjectCS = _cJSON_AddItemToObjectCSPtr.asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -696,11 +698,11 @@ class CJson { ); } - late final _cJSON_AddItemReferenceToArray_ptr = _lookup< + late final _cJSON_AddItemReferenceToArrayPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemReferenceToArray'); - late final _cJSON_AddItemReferenceToArray = _cJSON_AddItemReferenceToArray_ptr + late final _cJSON_AddItemReferenceToArray = _cJSON_AddItemReferenceToArrayPtr .asFunction, ffi.Pointer)>(); void cJSON_AddItemReferenceToObject( @@ -715,12 +717,12 @@ class CJson { ); } - late final _cJSON_AddItemReferenceToObject_ptr = _lookup< + late final _cJSON_AddItemReferenceToObjectPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemReferenceToObject'); late final _cJSON_AddItemReferenceToObject = - _cJSON_AddItemReferenceToObject_ptr.asFunction< + _cJSON_AddItemReferenceToObjectPtr.asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -734,12 +736,12 @@ class CJson { ); } - late final _cJSON_DetachItemViaPointer_ptr = _lookup< + late final _cJSON_DetachItemViaPointerPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('cJSON_DetachItemViaPointer'); late final _cJSON_DetachItemViaPointer = - _cJSON_DetachItemViaPointer_ptr.asFunction< + _cJSON_DetachItemViaPointerPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); @@ -753,11 +755,11 @@ class CJson { ); } - late final _cJSON_DetachItemFromArray_ptr = _lookup< + late final _cJSON_DetachItemFromArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Int32)>>('cJSON_DetachItemFromArray'); - late final _cJSON_DetachItemFromArray = _cJSON_DetachItemFromArray_ptr + late final _cJSON_DetachItemFromArray = _cJSON_DetachItemFromArrayPtr .asFunction Function(ffi.Pointer, int)>(); void cJSON_DeleteItemFromArray( @@ -770,10 +772,10 @@ class CJson { ); } - late final _cJSON_DeleteItemFromArray_ptr = _lookup< + late final _cJSON_DeleteItemFromArrayPtr = _lookup< ffi.NativeFunction, ffi.Int32)>>( 'cJSON_DeleteItemFromArray'); - late final _cJSON_DeleteItemFromArray = _cJSON_DeleteItemFromArray_ptr + late final _cJSON_DeleteItemFromArray = _cJSON_DeleteItemFromArrayPtr .asFunction, int)>(); ffi.Pointer cJSON_DetachItemFromObject( @@ -786,12 +788,12 @@ class CJson { ); } - late final _cJSON_DetachItemFromObject_ptr = _lookup< + late final _cJSON_DetachItemFromObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('cJSON_DetachItemFromObject'); late final _cJSON_DetachItemFromObject = - _cJSON_DetachItemFromObject_ptr.asFunction< + _cJSON_DetachItemFromObjectPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); @@ -805,13 +807,13 @@ class CJson { ); } - late final _cJSON_DetachItemFromObjectCaseSensitive_ptr = _lookup< + late final _cJSON_DetachItemFromObjectCaseSensitivePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>( 'cJSON_DetachItemFromObjectCaseSensitive'); late final _cJSON_DetachItemFromObjectCaseSensitive = - _cJSON_DetachItemFromObjectCaseSensitive_ptr.asFunction< + _cJSON_DetachItemFromObjectCaseSensitivePtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); @@ -825,11 +827,11 @@ class CJson { ); } - late final _cJSON_DeleteItemFromObject_ptr = _lookup< + late final _cJSON_DeleteItemFromObjectPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer)>>('cJSON_DeleteItemFromObject'); - late final _cJSON_DeleteItemFromObject = _cJSON_DeleteItemFromObject_ptr + late final _cJSON_DeleteItemFromObject = _cJSON_DeleteItemFromObjectPtr .asFunction, ffi.Pointer)>(); void cJSON_DeleteItemFromObjectCaseSensitive( @@ -842,12 +844,12 @@ class CJson { ); } - late final _cJSON_DeleteItemFromObjectCaseSensitive_ptr = _lookup< + late final _cJSON_DeleteItemFromObjectCaseSensitivePtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer)>>( 'cJSON_DeleteItemFromObjectCaseSensitive'); late final _cJSON_DeleteItemFromObjectCaseSensitive = - _cJSON_DeleteItemFromObjectCaseSensitive_ptr.asFunction< + _cJSON_DeleteItemFromObjectCaseSensitivePtr.asFunction< void Function(ffi.Pointer, ffi.Pointer)>(); void cJSON_InsertItemInArray( @@ -862,11 +864,11 @@ class CJson { ); } - late final _cJSON_InsertItemInArray_ptr = _lookup< + late final _cJSON_InsertItemInArrayPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Int32, ffi.Pointer)>>('cJSON_InsertItemInArray'); - late final _cJSON_InsertItemInArray = _cJSON_InsertItemInArray_ptr + late final _cJSON_InsertItemInArray = _cJSON_InsertItemInArrayPtr .asFunction, int, ffi.Pointer)>(); int cJSON_ReplaceItemViaPointer( @@ -881,12 +883,12 @@ class CJson { ); } - late final _cJSON_ReplaceItemViaPointer_ptr = _lookup< + late final _cJSON_ReplaceItemViaPointerPtr = _lookup< ffi.NativeFunction< cJSON_bool Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_ReplaceItemViaPointer'); late final _cJSON_ReplaceItemViaPointer = - _cJSON_ReplaceItemViaPointer_ptr.asFunction< + _cJSON_ReplaceItemViaPointerPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -902,11 +904,11 @@ class CJson { ); } - late final _cJSON_ReplaceItemInArray_ptr = _lookup< + late final _cJSON_ReplaceItemInArrayPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Int32, ffi.Pointer)>>('cJSON_ReplaceItemInArray'); - late final _cJSON_ReplaceItemInArray = _cJSON_ReplaceItemInArray_ptr + late final _cJSON_ReplaceItemInArray = _cJSON_ReplaceItemInArrayPtr .asFunction, int, ffi.Pointer)>(); void cJSON_ReplaceItemInObject( @@ -921,12 +923,12 @@ class CJson { ); } - late final _cJSON_ReplaceItemInObject_ptr = _lookup< + late final _cJSON_ReplaceItemInObjectPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_ReplaceItemInObject'); late final _cJSON_ReplaceItemInObject = - _cJSON_ReplaceItemInObject_ptr.asFunction< + _cJSON_ReplaceItemInObjectPtr.asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -942,12 +944,12 @@ class CJson { ); } - late final _cJSON_ReplaceItemInObjectCaseSensitive_ptr = _lookup< + late final _cJSON_ReplaceItemInObjectCaseSensitivePtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_ReplaceItemInObjectCaseSensitive'); late final _cJSON_ReplaceItemInObjectCaseSensitive = - _cJSON_ReplaceItemInObjectCaseSensitive_ptr.asFunction< + _cJSON_ReplaceItemInObjectCaseSensitivePtr.asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -961,11 +963,11 @@ class CJson { ); } - late final _cJSON_Duplicate_ptr = _lookup< + late final _cJSON_DuplicatePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, cJSON_bool)>>('cJSON_Duplicate'); - late final _cJSON_Duplicate = _cJSON_Duplicate_ptr + late final _cJSON_Duplicate = _cJSON_DuplicatePtr .asFunction Function(ffi.Pointer, int)>(); int cJSON_Compare( @@ -980,11 +982,11 @@ class CJson { ); } - late final _cJSON_Compare_ptr = _lookup< + late final _cJSON_ComparePtr = _lookup< ffi.NativeFunction< cJSON_bool Function(ffi.Pointer, ffi.Pointer, cJSON_bool)>>('cJSON_Compare'); - late final _cJSON_Compare = _cJSON_Compare_ptr + late final _cJSON_Compare = _cJSON_ComparePtr .asFunction, ffi.Pointer, int)>(); void cJSON_Minify( @@ -995,11 +997,11 @@ class CJson { ); } - late final _cJSON_Minify_ptr = + late final _cJSON_MinifyPtr = _lookup)>>( 'cJSON_Minify'); late final _cJSON_Minify = - _cJSON_Minify_ptr.asFunction)>(); + _cJSON_MinifyPtr.asFunction)>(); ffi.Pointer cJSON_AddNullToObject( ffi.Pointer object, @@ -1011,11 +1013,11 @@ class CJson { ); } - late final _cJSON_AddNullToObject_ptr = _lookup< + late final _cJSON_AddNullToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('cJSON_AddNullToObject'); - late final _cJSON_AddNullToObject = _cJSON_AddNullToObject_ptr.asFunction< + late final _cJSON_AddNullToObject = _cJSON_AddNullToObjectPtr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddTrueToObject( @@ -1028,11 +1030,11 @@ class CJson { ); } - late final _cJSON_AddTrueToObject_ptr = _lookup< + late final _cJSON_AddTrueToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('cJSON_AddTrueToObject'); - late final _cJSON_AddTrueToObject = _cJSON_AddTrueToObject_ptr.asFunction< + late final _cJSON_AddTrueToObject = _cJSON_AddTrueToObjectPtr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddFalseToObject( @@ -1045,11 +1047,11 @@ class CJson { ); } - late final _cJSON_AddFalseToObject_ptr = _lookup< + late final _cJSON_AddFalseToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('cJSON_AddFalseToObject'); - late final _cJSON_AddFalseToObject = _cJSON_AddFalseToObject_ptr.asFunction< + late final _cJSON_AddFalseToObject = _cJSON_AddFalseToObjectPtr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddBoolToObject( @@ -1064,11 +1066,11 @@ class CJson { ); } - late final _cJSON_AddBoolToObject_ptr = _lookup< + late final _cJSON_AddBoolToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, cJSON_bool)>>('cJSON_AddBoolToObject'); - late final _cJSON_AddBoolToObject = _cJSON_AddBoolToObject_ptr.asFunction< + late final _cJSON_AddBoolToObject = _cJSON_AddBoolToObjectPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); @@ -1084,11 +1086,11 @@ class CJson { ); } - late final _cJSON_AddNumberToObject_ptr = _lookup< + late final _cJSON_AddNumberToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Double)>>('cJSON_AddNumberToObject'); - late final _cJSON_AddNumberToObject = _cJSON_AddNumberToObject_ptr.asFunction< + late final _cJSON_AddNumberToObject = _cJSON_AddNumberToObjectPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, double)>(); @@ -1104,11 +1106,11 @@ class CJson { ); } - late final _cJSON_AddStringToObject_ptr = _lookup< + late final _cJSON_AddStringToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddStringToObject'); - late final _cJSON_AddStringToObject = _cJSON_AddStringToObject_ptr.asFunction< + late final _cJSON_AddStringToObject = _cJSON_AddStringToObjectPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -1124,11 +1126,11 @@ class CJson { ); } - late final _cJSON_AddRawToObject_ptr = _lookup< + late final _cJSON_AddRawToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddRawToObject'); - late final _cJSON_AddRawToObject = _cJSON_AddRawToObject_ptr.asFunction< + late final _cJSON_AddRawToObject = _cJSON_AddRawToObjectPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -1142,11 +1144,11 @@ class CJson { ); } - late final _cJSON_AddObjectToObject_ptr = _lookup< + late final _cJSON_AddObjectToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('cJSON_AddObjectToObject'); - late final _cJSON_AddObjectToObject = _cJSON_AddObjectToObject_ptr.asFunction< + late final _cJSON_AddObjectToObject = _cJSON_AddObjectToObjectPtr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddArrayToObject( @@ -1159,11 +1161,11 @@ class CJson { ); } - late final _cJSON_AddArrayToObject_ptr = _lookup< + late final _cJSON_AddArrayToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('cJSON_AddArrayToObject'); - late final _cJSON_AddArrayToObject = _cJSON_AddArrayToObject_ptr.asFunction< + late final _cJSON_AddArrayToObject = _cJSON_AddArrayToObjectPtr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); double cJSON_SetNumberHelper( @@ -1176,11 +1178,11 @@ class CJson { ); } - late final _cJSON_SetNumberHelper_ptr = _lookup< + late final _cJSON_SetNumberHelperPtr = _lookup< ffi.NativeFunction< ffi.Double Function( ffi.Pointer, ffi.Double)>>('cJSON_SetNumberHelper'); - late final _cJSON_SetNumberHelper = _cJSON_SetNumberHelper_ptr + late final _cJSON_SetNumberHelper = _cJSON_SetNumberHelperPtr .asFunction, double)>(); ffi.Pointer cJSON_malloc( @@ -1191,11 +1193,11 @@ class CJson { ); } - late final _cJSON_malloc_ptr = + late final _cJSON_mallocPtr = _lookup Function(ffi.IntPtr)>>( 'cJSON_malloc'); late final _cJSON_malloc = - _cJSON_malloc_ptr.asFunction Function(int)>(); + _cJSON_mallocPtr.asFunction Function(int)>(); void cJSON_free( ffi.Pointer object, @@ -1205,11 +1207,11 @@ class CJson { ); } - late final _cJSON_free_ptr = + late final _cJSON_freePtr = _lookup)>>( 'cJSON_free'); late final _cJSON_free = - _cJSON_free_ptr.asFunction)>(); + _cJSON_freePtr.asFunction)>(); } class cJSON extends ffi.Struct { diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index caf2392c19..78cc9c651d 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -1,3 +1,5 @@ +// ignore_for_file: camel_case_types, non_constant_identifier_names + // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. @@ -27,10 +29,10 @@ class LibClang { ); } - late final _clang_getCString_ptr = + late final _clang_getCStringPtr = _lookup Function(CXString)>>( 'clang_getCString'); - late final _clang_getCString = _clang_getCString_ptr + late final _clang_getCString = _clang_getCStringPtr .asFunction Function(CXString)>(); /// Free the given string. @@ -42,25 +44,25 @@ class LibClang { ); } - late final _clang_disposeString_ptr = + late final _clang_disposeStringPtr = _lookup>( 'clang_disposeString'); late final _clang_disposeString = - _clang_disposeString_ptr.asFunction(); + _clang_disposeStringPtr.asFunction(); /// Free the given string set. void clang_disposeStringSet( - ffi.Pointer set_1, + ffi.Pointer set1, ) { return _clang_disposeStringSet( - set_1, + set1, ); } - late final _clang_disposeStringSet_ptr = + late final _clang_disposeStringSetPtr = _lookup)>>( 'clang_disposeStringSet'); - late final _clang_disposeStringSet = _clang_disposeStringSet_ptr + late final _clang_disposeStringSet = _clang_disposeStringSetPtr .asFunction)>(); /// Return the timestamp for use with Clang's -fbuild-session-timestamp= @@ -69,11 +71,11 @@ class LibClang { return _clang_getBuildSessionTimestamp(); } - late final _clang_getBuildSessionTimestamp_ptr = + late final _clang_getBuildSessionTimestampPtr = _lookup>( 'clang_getBuildSessionTimestamp'); late final _clang_getBuildSessionTimestamp = - _clang_getBuildSessionTimestamp_ptr.asFunction(); + _clang_getBuildSessionTimestampPtr.asFunction(); /// Create a CXVirtualFileOverlay object. Must be disposed with /// clang_VirtualFileOverlay_dispose(). @@ -85,11 +87,11 @@ class LibClang { ); } - late final _clang_VirtualFileOverlay_create_ptr = + late final _clang_VirtualFileOverlay_createPtr = _lookup>( 'clang_VirtualFileOverlay_create'); late final _clang_VirtualFileOverlay_create = - _clang_VirtualFileOverlay_create_ptr + _clang_VirtualFileOverlay_createPtr .asFunction(); /// Map an absolute virtual file path to an absolute real one. The virtual @@ -106,13 +108,13 @@ class LibClang { ); } - late final _clang_VirtualFileOverlay_addFileMapping_ptr = _lookup< + late final _clang_VirtualFileOverlay_addFileMappingPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(CXVirtualFileOverlay, ffi.Pointer, ffi.Pointer)>>( 'clang_VirtualFileOverlay_addFileMapping'); late final _clang_VirtualFileOverlay_addFileMapping = - _clang_VirtualFileOverlay_addFileMapping_ptr.asFunction< + _clang_VirtualFileOverlay_addFileMappingPtr.asFunction< int Function(CXVirtualFileOverlay, ffi.Pointer, ffi.Pointer)>(); @@ -129,12 +131,12 @@ class LibClang { ); } - late final _clang_VirtualFileOverlay_setCaseSensitivity_ptr = _lookup< + late final _clang_VirtualFileOverlay_setCaseSensitivityPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(CXVirtualFileOverlay, ffi.Int32)>>('clang_VirtualFileOverlay_setCaseSensitivity'); late final _clang_VirtualFileOverlay_setCaseSensitivity = - _clang_VirtualFileOverlay_setCaseSensitivity_ptr + _clang_VirtualFileOverlay_setCaseSensitivityPtr .asFunction(); /// Write out the CXVirtualFileOverlay object to a char buffer. @@ -152,7 +154,7 @@ class LibClang { ); } - late final _clang_VirtualFileOverlay_writeToBuffer_ptr = _lookup< + late final _clang_VirtualFileOverlay_writeToBufferPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( CXVirtualFileOverlay, @@ -161,7 +163,7 @@ class LibClang { ffi.Pointer)>>( 'clang_VirtualFileOverlay_writeToBuffer'); late final _clang_VirtualFileOverlay_writeToBuffer = - _clang_VirtualFileOverlay_writeToBuffer_ptr.asFunction< + _clang_VirtualFileOverlay_writeToBufferPtr.asFunction< int Function(CXVirtualFileOverlay, int, ffi.Pointer>, ffi.Pointer)>(); @@ -175,11 +177,11 @@ class LibClang { ); } - late final _clang_free_ptr = + late final _clang_freePtr = _lookup)>>( 'clang_free'); late final _clang_free = - _clang_free_ptr.asFunction)>(); + _clang_freePtr.asFunction)>(); /// Dispose a CXVirtualFileOverlay object. void clang_VirtualFileOverlay_dispose( @@ -190,11 +192,11 @@ class LibClang { ); } - late final _clang_VirtualFileOverlay_dispose_ptr = + late final _clang_VirtualFileOverlay_disposePtr = _lookup>( 'clang_VirtualFileOverlay_dispose'); late final _clang_VirtualFileOverlay_dispose = - _clang_VirtualFileOverlay_dispose_ptr + _clang_VirtualFileOverlay_disposePtr .asFunction(); /// Create a CXModuleMapDescriptor object. Must be disposed with @@ -207,11 +209,11 @@ class LibClang { ); } - late final _clang_ModuleMapDescriptor_create_ptr = + late final _clang_ModuleMapDescriptor_createPtr = _lookup>( 'clang_ModuleMapDescriptor_create'); late final _clang_ModuleMapDescriptor_create = - _clang_ModuleMapDescriptor_create_ptr + _clang_ModuleMapDescriptor_createPtr .asFunction(); /// Sets the framework module name that the module.map describes. @@ -225,13 +227,13 @@ class LibClang { ); } - late final _clang_ModuleMapDescriptor_setFrameworkModuleName_ptr = _lookup< + late final _clang_ModuleMapDescriptor_setFrameworkModuleNamePtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( CXModuleMapDescriptor, ffi.Pointer)>>( 'clang_ModuleMapDescriptor_setFrameworkModuleName'); late final _clang_ModuleMapDescriptor_setFrameworkModuleName = - _clang_ModuleMapDescriptor_setFrameworkModuleName_ptr.asFunction< + _clang_ModuleMapDescriptor_setFrameworkModuleNamePtr.asFunction< int Function(CXModuleMapDescriptor, ffi.Pointer)>(); /// Sets the umbrealla header name that the module.map describes. @@ -245,13 +247,13 @@ class LibClang { ); } - late final _clang_ModuleMapDescriptor_setUmbrellaHeader_ptr = _lookup< + late final _clang_ModuleMapDescriptor_setUmbrellaHeaderPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( CXModuleMapDescriptor, ffi.Pointer)>>( 'clang_ModuleMapDescriptor_setUmbrellaHeader'); late final _clang_ModuleMapDescriptor_setUmbrellaHeader = - _clang_ModuleMapDescriptor_setUmbrellaHeader_ptr.asFunction< + _clang_ModuleMapDescriptor_setUmbrellaHeaderPtr.asFunction< int Function(CXModuleMapDescriptor, ffi.Pointer)>(); /// Write out the CXModuleMapDescriptor object to a char buffer. @@ -269,7 +271,7 @@ class LibClang { ); } - late final _clang_ModuleMapDescriptor_writeToBuffer_ptr = _lookup< + late final _clang_ModuleMapDescriptor_writeToBufferPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( CXModuleMapDescriptor, @@ -278,7 +280,7 @@ class LibClang { ffi.Pointer)>>( 'clang_ModuleMapDescriptor_writeToBuffer'); late final _clang_ModuleMapDescriptor_writeToBuffer = - _clang_ModuleMapDescriptor_writeToBuffer_ptr.asFunction< + _clang_ModuleMapDescriptor_writeToBufferPtr.asFunction< int Function(CXModuleMapDescriptor, int, ffi.Pointer>, ffi.Pointer)>(); @@ -291,11 +293,11 @@ class LibClang { ); } - late final _clang_ModuleMapDescriptor_dispose_ptr = + late final _clang_ModuleMapDescriptor_disposePtr = _lookup>( 'clang_ModuleMapDescriptor_dispose'); late final _clang_ModuleMapDescriptor_dispose = - _clang_ModuleMapDescriptor_dispose_ptr + _clang_ModuleMapDescriptor_disposePtr .asFunction(); /// Provides a shared context for creating translation units. @@ -309,11 +311,11 @@ class LibClang { ); } - late final _clang_createIndex_ptr = + late final _clang_createIndexPtr = _lookup>( 'clang_createIndex'); late final _clang_createIndex = - _clang_createIndex_ptr.asFunction(); + _clang_createIndexPtr.asFunction(); /// Destroy the given index. void clang_disposeIndex( @@ -324,11 +326,11 @@ class LibClang { ); } - late final _clang_disposeIndex_ptr = + late final _clang_disposeIndexPtr = _lookup>( 'clang_disposeIndex'); late final _clang_disposeIndex = - _clang_disposeIndex_ptr.asFunction(); + _clang_disposeIndexPtr.asFunction(); /// Sets general options associated with a CXIndex. void clang_CXIndex_setGlobalOptions( @@ -341,11 +343,11 @@ class LibClang { ); } - late final _clang_CXIndex_setGlobalOptions_ptr = + late final _clang_CXIndex_setGlobalOptionsPtr = _lookup>( 'clang_CXIndex_setGlobalOptions'); late final _clang_CXIndex_setGlobalOptions = - _clang_CXIndex_setGlobalOptions_ptr + _clang_CXIndex_setGlobalOptionsPtr .asFunction(); /// Gets the general options associated with a CXIndex. @@ -357,11 +359,11 @@ class LibClang { ); } - late final _clang_CXIndex_getGlobalOptions_ptr = + late final _clang_CXIndex_getGlobalOptionsPtr = _lookup>( 'clang_CXIndex_getGlobalOptions'); late final _clang_CXIndex_getGlobalOptions = - _clang_CXIndex_getGlobalOptions_ptr.asFunction(); + _clang_CXIndex_getGlobalOptionsPtr.asFunction(); /// Sets the invocation emission path option in a CXIndex. void clang_CXIndex_setInvocationEmissionPathOption( @@ -374,12 +376,12 @@ class LibClang { ); } - late final _clang_CXIndex_setInvocationEmissionPathOption_ptr = _lookup< + late final _clang_CXIndex_setInvocationEmissionPathOptionPtr = _lookup< ffi.NativeFunction< ffi.Void Function(CXIndex, ffi.Pointer)>>( 'clang_CXIndex_setInvocationEmissionPathOption'); late final _clang_CXIndex_setInvocationEmissionPathOption = - _clang_CXIndex_setInvocationEmissionPathOption_ptr + _clang_CXIndex_setInvocationEmissionPathOptionPtr .asFunction)>(); /// Retrieve the complete file and path name of the given file. @@ -391,11 +393,11 @@ class LibClang { ); } - late final _clang_getFileName_ptr = + late final _clang_getFileNamePtr = _lookup>( 'clang_getFileName'); late final _clang_getFileName = - _clang_getFileName_ptr.asFunction(); + _clang_getFileNamePtr.asFunction(); /// Retrieve the last modification time of the given file. int clang_getFileTime( @@ -406,11 +408,11 @@ class LibClang { ); } - late final _clang_getFileTime_ptr = + late final _clang_getFileTimePtr = _lookup>( 'clang_getFileTime'); late final _clang_getFileTime = - _clang_getFileTime_ptr.asFunction(); + _clang_getFileTimePtr.asFunction(); /// Retrieve the unique ID for the given file. int clang_getFileUniqueID( @@ -423,11 +425,11 @@ class LibClang { ); } - late final _clang_getFileUniqueID_ptr = _lookup< + late final _clang_getFileUniqueIDPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( CXFile, ffi.Pointer)>>('clang_getFileUniqueID'); - late final _clang_getFileUniqueID = _clang_getFileUniqueID_ptr + late final _clang_getFileUniqueID = _clang_getFileUniqueIDPtr .asFunction)>(); /// Determine whether the given header is guarded against multiple inclusions, @@ -443,11 +445,11 @@ class LibClang { ); } - late final _clang_isFileMultipleIncludeGuarded_ptr = _lookup< + late final _clang_isFileMultipleIncludeGuardedPtr = _lookup< ffi.NativeFunction>( 'clang_isFileMultipleIncludeGuarded'); late final _clang_isFileMultipleIncludeGuarded = - _clang_isFileMultipleIncludeGuarded_ptr + _clang_isFileMultipleIncludeGuardedPtr .asFunction(); /// Retrieve a file handle within the given translation unit. @@ -461,11 +463,11 @@ class LibClang { ); } - late final _clang_getFile_ptr = _lookup< + late final _clang_getFilePtr = _lookup< ffi.NativeFunction< CXFile Function( CXTranslationUnit, ffi.Pointer)>>('clang_getFile'); - late final _clang_getFile = _clang_getFile_ptr + late final _clang_getFile = _clang_getFilePtr .asFunction)>(); /// Retrieve the buffer associated with the given file. @@ -481,11 +483,11 @@ class LibClang { ); } - late final _clang_getFileContents_ptr = _lookup< + late final _clang_getFileContentsPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(CXTranslationUnit, CXFile, ffi.Pointer)>>('clang_getFileContents'); - late final _clang_getFileContents = _clang_getFileContents_ptr.asFunction< + late final _clang_getFileContents = _clang_getFileContentsPtr.asFunction< ffi.Pointer Function( CXTranslationUnit, CXFile, ffi.Pointer)>(); @@ -501,11 +503,11 @@ class LibClang { ); } - late final _clang_File_isEqual_ptr = + late final _clang_File_isEqualPtr = _lookup>( 'clang_File_isEqual'); late final _clang_File_isEqual = - _clang_File_isEqual_ptr.asFunction(); + _clang_File_isEqualPtr.asFunction(); /// Returns the real path name of file. CXString clang_File_tryGetRealPathName( @@ -516,22 +518,22 @@ class LibClang { ); } - late final _clang_File_tryGetRealPathName_ptr = + late final _clang_File_tryGetRealPathNamePtr = _lookup>( 'clang_File_tryGetRealPathName'); - late final _clang_File_tryGetRealPathName = _clang_File_tryGetRealPathName_ptr - .asFunction(); + late final _clang_File_tryGetRealPathName = + _clang_File_tryGetRealPathNamePtr.asFunction(); /// Retrieve a NULL (invalid) source location. CXSourceLocation clang_getNullLocation() { return _clang_getNullLocation(); } - late final _clang_getNullLocation_ptr = + late final _clang_getNullLocationPtr = _lookup>( 'clang_getNullLocation'); late final _clang_getNullLocation = - _clang_getNullLocation_ptr.asFunction(); + _clang_getNullLocationPtr.asFunction(); /// Determine whether two source locations, which must refer into the same /// translation unit, refer to exactly the same point in the source code. @@ -545,11 +547,11 @@ class LibClang { ); } - late final _clang_equalLocations_ptr = _lookup< + late final _clang_equalLocationsPtr = _lookup< ffi.NativeFunction< ffi.Uint32 Function( CXSourceLocation, CXSourceLocation)>>('clang_equalLocations'); - late final _clang_equalLocations = _clang_equalLocations_ptr + late final _clang_equalLocations = _clang_equalLocationsPtr .asFunction(); /// Retrieves the source location associated with a given file/line/column in @@ -568,11 +570,11 @@ class LibClang { ); } - late final _clang_getLocation_ptr = _lookup< + late final _clang_getLocationPtr = _lookup< ffi.NativeFunction< CXSourceLocation Function(CXTranslationUnit, CXFile, ffi.Uint32, ffi.Uint32)>>('clang_getLocation'); - late final _clang_getLocation = _clang_getLocation_ptr.asFunction< + late final _clang_getLocation = _clang_getLocationPtr.asFunction< CXSourceLocation Function(CXTranslationUnit, CXFile, int, int)>(); /// Retrieves the source location associated with a given character offset in @@ -589,11 +591,11 @@ class LibClang { ); } - late final _clang_getLocationForOffset_ptr = _lookup< + late final _clang_getLocationForOffsetPtr = _lookup< ffi.NativeFunction< CXSourceLocation Function(CXTranslationUnit, CXFile, ffi.Uint32)>>('clang_getLocationForOffset'); - late final _clang_getLocationForOffset = _clang_getLocationForOffset_ptr + late final _clang_getLocationForOffset = _clang_getLocationForOffsetPtr .asFunction(); /// Returns non-zero if the given source location is in a system header. @@ -605,11 +607,11 @@ class LibClang { ); } - late final _clang_Location_isInSystemHeader_ptr = + late final _clang_Location_isInSystemHeaderPtr = _lookup>( 'clang_Location_isInSystemHeader'); late final _clang_Location_isInSystemHeader = - _clang_Location_isInSystemHeader_ptr + _clang_Location_isInSystemHeaderPtr .asFunction(); /// Returns non-zero if the given source location is in the main file of the @@ -622,10 +624,10 @@ class LibClang { ); } - late final _clang_Location_isFromMainFile_ptr = + late final _clang_Location_isFromMainFilePtr = _lookup>( 'clang_Location_isFromMainFile'); - late final _clang_Location_isFromMainFile = _clang_Location_isFromMainFile_ptr + late final _clang_Location_isFromMainFile = _clang_Location_isFromMainFilePtr .asFunction(); /// Retrieve a NULL (invalid) source range. @@ -633,11 +635,11 @@ class LibClang { return _clang_getNullRange(); } - late final _clang_getNullRange_ptr = + late final _clang_getNullRangePtr = _lookup>( 'clang_getNullRange'); late final _clang_getNullRange = - _clang_getNullRange_ptr.asFunction(); + _clang_getNullRangePtr.asFunction(); /// Retrieve a source range given the beginning and ending source locations. CXSourceRange clang_getRange( @@ -650,11 +652,11 @@ class LibClang { ); } - late final _clang_getRange_ptr = _lookup< + late final _clang_getRangePtr = _lookup< ffi.NativeFunction< CXSourceRange Function( CXSourceLocation, CXSourceLocation)>>('clang_getRange'); - late final _clang_getRange = _clang_getRange_ptr + late final _clang_getRange = _clang_getRangePtr .asFunction(); /// Determine whether two ranges are equivalent. @@ -668,11 +670,11 @@ class LibClang { ); } - late final _clang_equalRanges_ptr = _lookup< + late final _clang_equalRangesPtr = _lookup< ffi.NativeFunction< ffi.Uint32 Function( CXSourceRange, CXSourceRange)>>('clang_equalRanges'); - late final _clang_equalRanges = _clang_equalRanges_ptr + late final _clang_equalRanges = _clang_equalRangesPtr .asFunction(); /// Returns non-zero if range is null. @@ -684,11 +686,11 @@ class LibClang { ); } - late final _clang_Range_isNull_ptr = + late final _clang_Range_isNullPtr = _lookup>( 'clang_Range_isNull'); late final _clang_Range_isNull = - _clang_Range_isNull_ptr.asFunction(); + _clang_Range_isNullPtr.asFunction(); /// Retrieve the file, line, column, and offset represented by the given /// source location. @@ -708,7 +710,7 @@ class LibClang { ); } - late final _clang_getExpansionLocation_ptr = _lookup< + late final _clang_getExpansionLocationPtr = _lookup< ffi.NativeFunction< ffi.Void Function( CXSourceLocation, @@ -717,7 +719,7 @@ class LibClang { ffi.Pointer, ffi.Pointer)>>('clang_getExpansionLocation'); late final _clang_getExpansionLocation = - _clang_getExpansionLocation_ptr.asFunction< + _clang_getExpansionLocationPtr.asFunction< void Function( CXSourceLocation, ffi.Pointer, @@ -741,7 +743,7 @@ class LibClang { ); } - late final _clang_getPresumedLocation_ptr = _lookup< + late final _clang_getPresumedLocationPtr = _lookup< ffi.NativeFunction< ffi.Void Function( CXSourceLocation, @@ -749,7 +751,7 @@ class LibClang { ffi.Pointer, ffi.Pointer)>>('clang_getPresumedLocation'); late final _clang_getPresumedLocation = - _clang_getPresumedLocation_ptr.asFunction< + _clang_getPresumedLocationPtr.asFunction< void Function(CXSourceLocation, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -771,7 +773,7 @@ class LibClang { ); } - late final _clang_getInstantiationLocation_ptr = _lookup< + late final _clang_getInstantiationLocationPtr = _lookup< ffi.NativeFunction< ffi.Void Function( CXSourceLocation, @@ -780,7 +782,7 @@ class LibClang { ffi.Pointer, ffi.Pointer)>>('clang_getInstantiationLocation'); late final _clang_getInstantiationLocation = - _clang_getInstantiationLocation_ptr.asFunction< + _clang_getInstantiationLocationPtr.asFunction< void Function( CXSourceLocation, ffi.Pointer, @@ -806,7 +808,7 @@ class LibClang { ); } - late final _clang_getSpellingLocation_ptr = _lookup< + late final _clang_getSpellingLocationPtr = _lookup< ffi.NativeFunction< ffi.Void Function( CXSourceLocation, @@ -815,7 +817,7 @@ class LibClang { ffi.Pointer, ffi.Pointer)>>('clang_getSpellingLocation'); late final _clang_getSpellingLocation = - _clang_getSpellingLocation_ptr.asFunction< + _clang_getSpellingLocationPtr.asFunction< void Function( CXSourceLocation, ffi.Pointer, @@ -841,7 +843,7 @@ class LibClang { ); } - late final _clang_getFileLocation_ptr = _lookup< + late final _clang_getFileLocationPtr = _lookup< ffi.NativeFunction< ffi.Void Function( CXSourceLocation, @@ -849,7 +851,7 @@ class LibClang { ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('clang_getFileLocation'); - late final _clang_getFileLocation = _clang_getFileLocation_ptr.asFunction< + late final _clang_getFileLocation = _clang_getFileLocationPtr.asFunction< void Function( CXSourceLocation, ffi.Pointer, @@ -867,10 +869,10 @@ class LibClang { ); } - late final _clang_getRangeStart_ptr = + late final _clang_getRangeStartPtr = _lookup>( 'clang_getRangeStart'); - late final _clang_getRangeStart = _clang_getRangeStart_ptr + late final _clang_getRangeStart = _clang_getRangeStartPtr .asFunction(); /// Retrieve a source location representing the last character within a source @@ -883,10 +885,10 @@ class LibClang { ); } - late final _clang_getRangeEnd_ptr = + late final _clang_getRangeEndPtr = _lookup>( 'clang_getRangeEnd'); - late final _clang_getRangeEnd = _clang_getRangeEnd_ptr + late final _clang_getRangeEnd = _clang_getRangeEndPtr .asFunction(); /// Retrieve all ranges that were skipped by the preprocessor. @@ -900,11 +902,11 @@ class LibClang { ); } - late final _clang_getSkippedRanges_ptr = _lookup< + late final _clang_getSkippedRangesPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( CXTranslationUnit, CXFile)>>('clang_getSkippedRanges'); - late final _clang_getSkippedRanges = _clang_getSkippedRanges_ptr.asFunction< + late final _clang_getSkippedRanges = _clang_getSkippedRangesPtr.asFunction< ffi.Pointer Function(CXTranslationUnit, CXFile)>(); /// Retrieve all ranges from all files that were skipped by the preprocessor. @@ -916,11 +918,11 @@ class LibClang { ); } - late final _clang_getAllSkippedRanges_ptr = _lookup< + late final _clang_getAllSkippedRangesPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( CXTranslationUnit)>>('clang_getAllSkippedRanges'); - late final _clang_getAllSkippedRanges = _clang_getAllSkippedRanges_ptr + late final _clang_getAllSkippedRanges = _clang_getAllSkippedRangesPtr .asFunction Function(CXTranslationUnit)>(); /// Destroy the given CXSourceRangeList. @@ -932,11 +934,11 @@ class LibClang { ); } - late final _clang_disposeSourceRangeList_ptr = _lookup< + late final _clang_disposeSourceRangeListPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer)>>('clang_disposeSourceRangeList'); - late final _clang_disposeSourceRangeList = _clang_disposeSourceRangeList_ptr + late final _clang_disposeSourceRangeList = _clang_disposeSourceRangeListPtr .asFunction)>(); /// Determine the number of diagnostics in a CXDiagnosticSet. @@ -948,10 +950,10 @@ class LibClang { ); } - late final _clang_getNumDiagnosticsInSet_ptr = + late final _clang_getNumDiagnosticsInSetPtr = _lookup>( 'clang_getNumDiagnosticsInSet'); - late final _clang_getNumDiagnosticsInSet = _clang_getNumDiagnosticsInSet_ptr + late final _clang_getNumDiagnosticsInSet = _clang_getNumDiagnosticsInSetPtr .asFunction(); /// Retrieve a diagnostic associated with the given CXDiagnosticSet. @@ -965,11 +967,11 @@ class LibClang { ); } - late final _clang_getDiagnosticInSet_ptr = _lookup< + late final _clang_getDiagnosticInSetPtr = _lookup< ffi.NativeFunction< CXDiagnostic Function( CXDiagnosticSet, ffi.Uint32)>>('clang_getDiagnosticInSet'); - late final _clang_getDiagnosticInSet = _clang_getDiagnosticInSet_ptr + late final _clang_getDiagnosticInSet = _clang_getDiagnosticInSetPtr .asFunction(); /// Deserialize a set of diagnostics from a Clang diagnostics bitcode file. @@ -985,13 +987,13 @@ class LibClang { ); } - late final _clang_loadDiagnostics_ptr = _lookup< + late final _clang_loadDiagnosticsPtr = _lookup< ffi.NativeFunction< CXDiagnosticSet Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('clang_loadDiagnostics'); - late final _clang_loadDiagnostics = _clang_loadDiagnostics_ptr.asFunction< + late final _clang_loadDiagnostics = _clang_loadDiagnosticsPtr.asFunction< CXDiagnosticSet Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -1004,10 +1006,10 @@ class LibClang { ); } - late final _clang_disposeDiagnosticSet_ptr = + late final _clang_disposeDiagnosticSetPtr = _lookup>( 'clang_disposeDiagnosticSet'); - late final _clang_disposeDiagnosticSet = _clang_disposeDiagnosticSet_ptr + late final _clang_disposeDiagnosticSet = _clang_disposeDiagnosticSetPtr .asFunction(); /// Retrieve the child diagnostics of a CXDiagnostic. @@ -1019,10 +1021,10 @@ class LibClang { ); } - late final _clang_getChildDiagnostics_ptr = + late final _clang_getChildDiagnosticsPtr = _lookup>( 'clang_getChildDiagnostics'); - late final _clang_getChildDiagnostics = _clang_getChildDiagnostics_ptr + late final _clang_getChildDiagnostics = _clang_getChildDiagnosticsPtr .asFunction(); /// Determine the number of diagnostics produced for the given translation @@ -1035,11 +1037,11 @@ class LibClang { ); } - late final _clang_getNumDiagnostics_ptr = + late final _clang_getNumDiagnosticsPtr = _lookup>( 'clang_getNumDiagnostics'); - late final _clang_getNumDiagnostics = _clang_getNumDiagnostics_ptr - .asFunction(); + late final _clang_getNumDiagnostics = + _clang_getNumDiagnosticsPtr.asFunction(); /// Retrieve a diagnostic associated with the given translation unit. CXDiagnostic clang_getDiagnostic( @@ -1052,11 +1054,11 @@ class LibClang { ); } - late final _clang_getDiagnostic_ptr = _lookup< + late final _clang_getDiagnosticPtr = _lookup< ffi.NativeFunction< CXDiagnostic Function( CXTranslationUnit, ffi.Uint32)>>('clang_getDiagnostic'); - late final _clang_getDiagnostic = _clang_getDiagnostic_ptr + late final _clang_getDiagnostic = _clang_getDiagnosticPtr .asFunction(); /// Retrieve the complete set of diagnostics associated with a translation @@ -1069,10 +1071,10 @@ class LibClang { ); } - late final _clang_getDiagnosticSetFromTU_ptr = + late final _clang_getDiagnosticSetFromTUPtr = _lookup>( 'clang_getDiagnosticSetFromTU'); - late final _clang_getDiagnosticSetFromTU = _clang_getDiagnosticSetFromTU_ptr + late final _clang_getDiagnosticSetFromTU = _clang_getDiagnosticSetFromTUPtr .asFunction(); /// Destroy a diagnostic. @@ -1084,11 +1086,11 @@ class LibClang { ); } - late final _clang_disposeDiagnostic_ptr = + late final _clang_disposeDiagnosticPtr = _lookup>( 'clang_disposeDiagnostic'); late final _clang_disposeDiagnostic = - _clang_disposeDiagnostic_ptr.asFunction(); + _clang_disposeDiagnosticPtr.asFunction(); /// Format the given diagnostic in a manner that is suitable for display. CXString clang_formatDiagnostic( @@ -1101,10 +1103,10 @@ class LibClang { ); } - late final _clang_formatDiagnostic_ptr = + late final _clang_formatDiagnosticPtr = _lookup>( 'clang_formatDiagnostic'); - late final _clang_formatDiagnostic = _clang_formatDiagnostic_ptr + late final _clang_formatDiagnostic = _clang_formatDiagnosticPtr .asFunction(); /// Retrieve the set of display options most similar to the default behavior @@ -1113,11 +1115,11 @@ class LibClang { return _clang_defaultDiagnosticDisplayOptions(); } - late final _clang_defaultDiagnosticDisplayOptions_ptr = + late final _clang_defaultDiagnosticDisplayOptionsPtr = _lookup>( 'clang_defaultDiagnosticDisplayOptions'); late final _clang_defaultDiagnosticDisplayOptions = - _clang_defaultDiagnosticDisplayOptions_ptr.asFunction(); + _clang_defaultDiagnosticDisplayOptionsPtr.asFunction(); /// Determine the severity of the given diagnostic. int clang_getDiagnosticSeverity( @@ -1128,11 +1130,11 @@ class LibClang { ); } - late final _clang_getDiagnosticSeverity_ptr = + late final _clang_getDiagnosticSeverityPtr = _lookup>( 'clang_getDiagnosticSeverity'); late final _clang_getDiagnosticSeverity = - _clang_getDiagnosticSeverity_ptr.asFunction(); + _clang_getDiagnosticSeverityPtr.asFunction(); /// Retrieve the source location of the given diagnostic. CXSourceLocation clang_getDiagnosticLocation( @@ -1143,10 +1145,10 @@ class LibClang { ); } - late final _clang_getDiagnosticLocation_ptr = + late final _clang_getDiagnosticLocationPtr = _lookup>( 'clang_getDiagnosticLocation'); - late final _clang_getDiagnosticLocation = _clang_getDiagnosticLocation_ptr + late final _clang_getDiagnosticLocation = _clang_getDiagnosticLocationPtr .asFunction(); /// Retrieve the text of the given diagnostic. @@ -1158,10 +1160,10 @@ class LibClang { ); } - late final _clang_getDiagnosticSpelling_ptr = + late final _clang_getDiagnosticSpellingPtr = _lookup>( 'clang_getDiagnosticSpelling'); - late final _clang_getDiagnosticSpelling = _clang_getDiagnosticSpelling_ptr + late final _clang_getDiagnosticSpelling = _clang_getDiagnosticSpellingPtr .asFunction(); /// Retrieve the name of the command-line option that enabled this diagnostic. @@ -1175,11 +1177,11 @@ class LibClang { ); } - late final _clang_getDiagnosticOption_ptr = _lookup< + late final _clang_getDiagnosticOptionPtr = _lookup< ffi.NativeFunction< CXString Function(CXDiagnostic, ffi.Pointer)>>('clang_getDiagnosticOption'); - late final _clang_getDiagnosticOption = _clang_getDiagnosticOption_ptr + late final _clang_getDiagnosticOption = _clang_getDiagnosticOptionPtr .asFunction)>(); /// Retrieve the category number for this diagnostic. @@ -1191,11 +1193,11 @@ class LibClang { ); } - late final _clang_getDiagnosticCategory_ptr = + late final _clang_getDiagnosticCategoryPtr = _lookup>( 'clang_getDiagnosticCategory'); late final _clang_getDiagnosticCategory = - _clang_getDiagnosticCategory_ptr.asFunction(); + _clang_getDiagnosticCategoryPtr.asFunction(); /// Retrieve the name of a particular diagnostic category. This is now /// deprecated. Use clang_getDiagnosticCategoryText() instead. @@ -1207,11 +1209,11 @@ class LibClang { ); } - late final _clang_getDiagnosticCategoryName_ptr = + late final _clang_getDiagnosticCategoryNamePtr = _lookup>( 'clang_getDiagnosticCategoryName'); late final _clang_getDiagnosticCategoryName = - _clang_getDiagnosticCategoryName_ptr.asFunction(); + _clang_getDiagnosticCategoryNamePtr.asFunction(); /// Retrieve the diagnostic category text for a given diagnostic. CXString clang_getDiagnosticCategoryText( @@ -1222,11 +1224,11 @@ class LibClang { ); } - late final _clang_getDiagnosticCategoryText_ptr = + late final _clang_getDiagnosticCategoryTextPtr = _lookup>( 'clang_getDiagnosticCategoryText'); late final _clang_getDiagnosticCategoryText = - _clang_getDiagnosticCategoryText_ptr + _clang_getDiagnosticCategoryTextPtr .asFunction(); /// Determine the number of source ranges associated with the given @@ -1239,11 +1241,11 @@ class LibClang { ); } - late final _clang_getDiagnosticNumRanges_ptr = + late final _clang_getDiagnosticNumRangesPtr = _lookup>( 'clang_getDiagnosticNumRanges'); - late final _clang_getDiagnosticNumRanges = _clang_getDiagnosticNumRanges_ptr - .asFunction(); + late final _clang_getDiagnosticNumRanges = + _clang_getDiagnosticNumRangesPtr.asFunction(); /// Retrieve a source range associated with the diagnostic. CXSourceRange clang_getDiagnosticRange( @@ -1256,10 +1258,10 @@ class LibClang { ); } - late final _clang_getDiagnosticRange_ptr = _lookup< + late final _clang_getDiagnosticRangePtr = _lookup< ffi.NativeFunction>( 'clang_getDiagnosticRange'); - late final _clang_getDiagnosticRange = _clang_getDiagnosticRange_ptr + late final _clang_getDiagnosticRange = _clang_getDiagnosticRangePtr .asFunction(); /// Determine the number of fix-it hints associated with the given diagnostic. @@ -1271,11 +1273,11 @@ class LibClang { ); } - late final _clang_getDiagnosticNumFixIts_ptr = + late final _clang_getDiagnosticNumFixItsPtr = _lookup>( 'clang_getDiagnosticNumFixIts'); - late final _clang_getDiagnosticNumFixIts = _clang_getDiagnosticNumFixIts_ptr - .asFunction(); + late final _clang_getDiagnosticNumFixIts = + _clang_getDiagnosticNumFixItsPtr.asFunction(); /// Retrieve the replacement information for a given fix-it. CXString clang_getDiagnosticFixIt( @@ -1290,12 +1292,12 @@ class LibClang { ); } - late final _clang_getDiagnosticFixIt_ptr = _lookup< + late final _clang_getDiagnosticFixItPtr = _lookup< ffi.NativeFunction< CXString Function(CXDiagnostic, ffi.Uint32, ffi.Pointer)>>('clang_getDiagnosticFixIt'); late final _clang_getDiagnosticFixIt = - _clang_getDiagnosticFixIt_ptr.asFunction< + _clang_getDiagnosticFixItPtr.asFunction< CXString Function(CXDiagnostic, int, ffi.Pointer)>(); /// Get the original translation unit source file name. @@ -1307,11 +1309,11 @@ class LibClang { ); } - late final _clang_getTranslationUnitSpelling_ptr = + late final _clang_getTranslationUnitSpellingPtr = _lookup>( 'clang_getTranslationUnitSpelling'); late final _clang_getTranslationUnitSpelling = - _clang_getTranslationUnitSpelling_ptr + _clang_getTranslationUnitSpellingPtr .asFunction(); /// Return the CXTranslationUnit for a given source file and the provided @@ -1334,7 +1336,7 @@ class LibClang { ); } - late final _clang_createTranslationUnitFromSourceFile_ptr = _lookup< + late final _clang_createTranslationUnitFromSourceFilePtr = _lookup< ffi.NativeFunction< CXTranslationUnit Function( CXIndex, @@ -1345,7 +1347,7 @@ class LibClang { ffi.Pointer)>>( 'clang_createTranslationUnitFromSourceFile'); late final _clang_createTranslationUnitFromSourceFile = - _clang_createTranslationUnitFromSourceFile_ptr.asFunction< + _clang_createTranslationUnitFromSourceFilePtr.asFunction< CXTranslationUnit Function( CXIndex, ffi.Pointer, @@ -1367,11 +1369,11 @@ class LibClang { ); } - late final _clang_createTranslationUnit_ptr = _lookup< + late final _clang_createTranslationUnitPtr = _lookup< ffi.NativeFunction< CXTranslationUnit Function( CXIndex, ffi.Pointer)>>('clang_createTranslationUnit'); - late final _clang_createTranslationUnit = _clang_createTranslationUnit_ptr + late final _clang_createTranslationUnit = _clang_createTranslationUnitPtr .asFunction)>(); /// Create a translation unit from an AST file ( -emit-ast). @@ -1387,12 +1389,12 @@ class LibClang { ); } - late final _clang_createTranslationUnit2_ptr = _lookup< + late final _clang_createTranslationUnit2Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function(CXIndex, ffi.Pointer, ffi.Pointer)>>('clang_createTranslationUnit2'); late final _clang_createTranslationUnit2 = - _clang_createTranslationUnit2_ptr.asFunction< + _clang_createTranslationUnit2Ptr.asFunction< int Function(CXIndex, ffi.Pointer, ffi.Pointer)>(); @@ -1402,11 +1404,11 @@ class LibClang { return _clang_defaultEditingTranslationUnitOptions(); } - late final _clang_defaultEditingTranslationUnitOptions_ptr = + late final _clang_defaultEditingTranslationUnitOptionsPtr = _lookup>( 'clang_defaultEditingTranslationUnitOptions'); late final _clang_defaultEditingTranslationUnitOptions = - _clang_defaultEditingTranslationUnitOptions_ptr + _clang_defaultEditingTranslationUnitOptionsPtr .asFunction(); /// Same as clang_parseTranslationUnit2, but returns the CXTranslationUnit @@ -1432,7 +1434,7 @@ class LibClang { ); } - late final _clang_parseTranslationUnit_ptr = _lookup< + late final _clang_parseTranslationUnitPtr = _lookup< ffi.NativeFunction< CXTranslationUnit Function( CXIndex, @@ -1443,7 +1445,7 @@ class LibClang { ffi.Uint32, ffi.Uint32)>>('clang_parseTranslationUnit'); late final _clang_parseTranslationUnit = - _clang_parseTranslationUnit_ptr.asFunction< + _clang_parseTranslationUnitPtr.asFunction< CXTranslationUnit Function( CXIndex, ffi.Pointer, @@ -1477,7 +1479,7 @@ class LibClang { ); } - late final _clang_parseTranslationUnit2_ptr = _lookup< + late final _clang_parseTranslationUnit2Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( CXIndex, @@ -1489,7 +1491,7 @@ class LibClang { ffi.Uint32, ffi.Pointer)>>('clang_parseTranslationUnit2'); late final _clang_parseTranslationUnit2 = - _clang_parseTranslationUnit2_ptr.asFunction< + _clang_parseTranslationUnit2Ptr.asFunction< int Function( CXIndex, ffi.Pointer, @@ -1525,7 +1527,7 @@ class LibClang { ); } - late final _clang_parseTranslationUnit2FullArgv_ptr = _lookup< + late final _clang_parseTranslationUnit2FullArgvPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( CXIndex, @@ -1538,7 +1540,7 @@ class LibClang { ffi.Pointer)>>( 'clang_parseTranslationUnit2FullArgv'); late final _clang_parseTranslationUnit2FullArgv = - _clang_parseTranslationUnit2FullArgv_ptr.asFunction< + _clang_parseTranslationUnit2FullArgvPtr.asFunction< int Function( CXIndex, ffi.Pointer, @@ -1558,10 +1560,10 @@ class LibClang { ); } - late final _clang_defaultSaveOptions_ptr = + late final _clang_defaultSaveOptionsPtr = _lookup>( 'clang_defaultSaveOptions'); - late final _clang_defaultSaveOptions = _clang_defaultSaveOptions_ptr + late final _clang_defaultSaveOptions = _clang_defaultSaveOptionsPtr .asFunction(); /// Saves a translation unit into a serialized representation of that @@ -1578,12 +1580,12 @@ class LibClang { ); } - late final _clang_saveTranslationUnit_ptr = _lookup< + late final _clang_saveTranslationUnitPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(CXTranslationUnit, ffi.Pointer, ffi.Uint32)>>('clang_saveTranslationUnit'); late final _clang_saveTranslationUnit = - _clang_saveTranslationUnit_ptr.asFunction< + _clang_saveTranslationUnitPtr.asFunction< int Function(CXTranslationUnit, ffi.Pointer, int)>(); /// Suspend a translation unit in order to free memory associated with it. @@ -1595,10 +1597,10 @@ class LibClang { ); } - late final _clang_suspendTranslationUnit_ptr = + late final _clang_suspendTranslationUnitPtr = _lookup>( 'clang_suspendTranslationUnit'); - late final _clang_suspendTranslationUnit = _clang_suspendTranslationUnit_ptr + late final _clang_suspendTranslationUnit = _clang_suspendTranslationUnitPtr .asFunction(); /// Destroy the specified CXTranslationUnit object. @@ -1610,10 +1612,10 @@ class LibClang { ); } - late final _clang_disposeTranslationUnit_ptr = + late final _clang_disposeTranslationUnitPtr = _lookup>( 'clang_disposeTranslationUnit'); - late final _clang_disposeTranslationUnit = _clang_disposeTranslationUnit_ptr + late final _clang_disposeTranslationUnit = _clang_disposeTranslationUnitPtr .asFunction(); /// Returns the set of flags that is suitable for reparsing a translation @@ -1626,10 +1628,10 @@ class LibClang { ); } - late final _clang_defaultReparseOptions_ptr = + late final _clang_defaultReparseOptionsPtr = _lookup>( 'clang_defaultReparseOptions'); - late final _clang_defaultReparseOptions = _clang_defaultReparseOptions_ptr + late final _clang_defaultReparseOptions = _clang_defaultReparseOptionsPtr .asFunction(); /// Reparse the source files that produced this translation unit. @@ -1647,7 +1649,7 @@ class LibClang { ); } - late final _clang_reparseTranslationUnit_ptr = _lookup< + late final _clang_reparseTranslationUnitPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( CXTranslationUnit, @@ -1655,7 +1657,7 @@ class LibClang { ffi.Pointer, ffi.Uint32)>>('clang_reparseTranslationUnit'); late final _clang_reparseTranslationUnit = - _clang_reparseTranslationUnit_ptr.asFunction< + _clang_reparseTranslationUnitPtr.asFunction< int Function( CXTranslationUnit, int, ffi.Pointer, int)>(); @@ -1669,10 +1671,10 @@ class LibClang { ); } - late final _clang_getTUResourceUsageName_ptr = + late final _clang_getTUResourceUsageNamePtr = _lookup Function(ffi.Int32)>>( 'clang_getTUResourceUsageName'); - late final _clang_getTUResourceUsageName = _clang_getTUResourceUsageName_ptr + late final _clang_getTUResourceUsageName = _clang_getTUResourceUsageNamePtr .asFunction Function(int)>(); /// Return the memory usage of a translation unit. This object should be @@ -1685,10 +1687,10 @@ class LibClang { ); } - late final _clang_getCXTUResourceUsage_ptr = _lookup< + late final _clang_getCXTUResourceUsagePtr = _lookup< ffi.NativeFunction>( 'clang_getCXTUResourceUsage'); - late final _clang_getCXTUResourceUsage = _clang_getCXTUResourceUsage_ptr + late final _clang_getCXTUResourceUsage = _clang_getCXTUResourceUsagePtr .asFunction(); void clang_disposeCXTUResourceUsage( @@ -1699,11 +1701,11 @@ class LibClang { ); } - late final _clang_disposeCXTUResourceUsage_ptr = + late final _clang_disposeCXTUResourceUsagePtr = _lookup>( 'clang_disposeCXTUResourceUsage'); late final _clang_disposeCXTUResourceUsage = - _clang_disposeCXTUResourceUsage_ptr + _clang_disposeCXTUResourceUsagePtr .asFunction(); /// Get target information for this translation unit. @@ -1715,11 +1717,11 @@ class LibClang { ); } - late final _clang_getTranslationUnitTargetInfo_ptr = + late final _clang_getTranslationUnitTargetInfoPtr = _lookup>( 'clang_getTranslationUnitTargetInfo'); late final _clang_getTranslationUnitTargetInfo = - _clang_getTranslationUnitTargetInfo_ptr + _clang_getTranslationUnitTargetInfoPtr .asFunction(); /// Destroy the CXTargetInfo object. @@ -1731,11 +1733,11 @@ class LibClang { ); } - late final _clang_TargetInfo_dispose_ptr = + late final _clang_TargetInfo_disposePtr = _lookup>( 'clang_TargetInfo_dispose'); late final _clang_TargetInfo_dispose = - _clang_TargetInfo_dispose_ptr.asFunction(); + _clang_TargetInfo_disposePtr.asFunction(); /// Get the normalized target triple as a string. CXString clang_TargetInfo_getTriple( @@ -1746,10 +1748,10 @@ class LibClang { ); } - late final _clang_TargetInfo_getTriple_ptr = + late final _clang_TargetInfo_getTriplePtr = _lookup>( 'clang_TargetInfo_getTriple'); - late final _clang_TargetInfo_getTriple = _clang_TargetInfo_getTriple_ptr + late final _clang_TargetInfo_getTriple = _clang_TargetInfo_getTriplePtr .asFunction(); /// Get the pointer width of the target in bits. @@ -1761,11 +1763,11 @@ class LibClang { ); } - late final _clang_TargetInfo_getPointerWidth_ptr = + late final _clang_TargetInfo_getPointerWidthPtr = _lookup>( 'clang_TargetInfo_getPointerWidth'); late final _clang_TargetInfo_getPointerWidth = - _clang_TargetInfo_getPointerWidth_ptr + _clang_TargetInfo_getPointerWidthPtr .asFunction(); /// Retrieve the NULL cursor, which represents no entity. @@ -1773,10 +1775,10 @@ class LibClang { return _clang_getNullCursor(); } - late final _clang_getNullCursor_ptr = + late final _clang_getNullCursorPtr = _lookup>('clang_getNullCursor'); late final _clang_getNullCursor = - _clang_getNullCursor_ptr.asFunction(); + _clang_getNullCursorPtr.asFunction(); /// Retrieve the cursor that represents the given translation unit. CXCursor clang_getTranslationUnitCursor( @@ -1787,11 +1789,11 @@ class LibClang { ); } - late final _clang_getTranslationUnitCursor_ptr = + late final _clang_getTranslationUnitCursorPtr = _lookup>( 'clang_getTranslationUnitCursor'); late final _clang_getTranslationUnitCursor = - _clang_getTranslationUnitCursor_ptr + _clang_getTranslationUnitCursorPtr .asFunction(); /// Determine whether two cursors are equivalent. @@ -1805,11 +1807,11 @@ class LibClang { ); } - late final _clang_equalCursors_ptr = + late final _clang_equalCursorsPtr = _lookup>( 'clang_equalCursors'); late final _clang_equalCursors = - _clang_equalCursors_ptr.asFunction(); + _clang_equalCursorsPtr.asFunction(); /// Returns non-zero if cursor is null. int clang_Cursor_isNull( @@ -1820,11 +1822,11 @@ class LibClang { ); } - late final _clang_Cursor_isNull_ptr = + late final _clang_Cursor_isNullPtr = _lookup>( 'clang_Cursor_isNull'); late final _clang_Cursor_isNull = - _clang_Cursor_isNull_ptr.asFunction(); + _clang_Cursor_isNullPtr.asFunction(); /// Compute a hash value for the given cursor. int clang_hashCursor( @@ -1835,11 +1837,11 @@ class LibClang { ); } - late final _clang_hashCursor_ptr = + late final _clang_hashCursorPtr = _lookup>( 'clang_hashCursor'); late final _clang_hashCursor = - _clang_hashCursor_ptr.asFunction(); + _clang_hashCursorPtr.asFunction(); /// Retrieve the kind of the given cursor. int clang_getCursorKind( @@ -1850,11 +1852,11 @@ class LibClang { ); } - late final _clang_getCursorKind_ptr = + late final _clang_getCursorKindPtr = _lookup>( 'clang_getCursorKind'); late final _clang_getCursorKind = - _clang_getCursorKind_ptr.asFunction(); + _clang_getCursorKindPtr.asFunction(); /// Determine whether the given cursor kind represents a declaration. int clang_isDeclaration( @@ -1865,11 +1867,11 @@ class LibClang { ); } - late final _clang_isDeclaration_ptr = + late final _clang_isDeclarationPtr = _lookup>( 'clang_isDeclaration'); late final _clang_isDeclaration = - _clang_isDeclaration_ptr.asFunction(); + _clang_isDeclarationPtr.asFunction(); /// Determine whether the given declaration is invalid. int clang_isInvalidDeclaration( @@ -1880,11 +1882,11 @@ class LibClang { ); } - late final _clang_isInvalidDeclaration_ptr = + late final _clang_isInvalidDeclarationPtr = _lookup>( 'clang_isInvalidDeclaration'); late final _clang_isInvalidDeclaration = - _clang_isInvalidDeclaration_ptr.asFunction(); + _clang_isInvalidDeclarationPtr.asFunction(); /// Determine whether the given cursor kind represents a simple reference. int clang_isReference( @@ -1895,11 +1897,11 @@ class LibClang { ); } - late final _clang_isReference_ptr = + late final _clang_isReferencePtr = _lookup>( 'clang_isReference'); late final _clang_isReference = - _clang_isReference_ptr.asFunction(); + _clang_isReferencePtr.asFunction(); /// Determine whether the given cursor kind represents an expression. int clang_isExpression( @@ -1910,11 +1912,11 @@ class LibClang { ); } - late final _clang_isExpression_ptr = + late final _clang_isExpressionPtr = _lookup>( 'clang_isExpression'); late final _clang_isExpression = - _clang_isExpression_ptr.asFunction(); + _clang_isExpressionPtr.asFunction(); /// Determine whether the given cursor kind represents a statement. int clang_isStatement( @@ -1925,11 +1927,11 @@ class LibClang { ); } - late final _clang_isStatement_ptr = + late final _clang_isStatementPtr = _lookup>( 'clang_isStatement'); late final _clang_isStatement = - _clang_isStatement_ptr.asFunction(); + _clang_isStatementPtr.asFunction(); /// Determine whether the given cursor kind represents an attribute. int clang_isAttribute( @@ -1940,11 +1942,11 @@ class LibClang { ); } - late final _clang_isAttribute_ptr = + late final _clang_isAttributePtr = _lookup>( 'clang_isAttribute'); late final _clang_isAttribute = - _clang_isAttribute_ptr.asFunction(); + _clang_isAttributePtr.asFunction(); /// Determine whether the given cursor has any attributes. int clang_Cursor_hasAttrs( @@ -1955,11 +1957,11 @@ class LibClang { ); } - late final _clang_Cursor_hasAttrs_ptr = + late final _clang_Cursor_hasAttrsPtr = _lookup>( 'clang_Cursor_hasAttrs'); late final _clang_Cursor_hasAttrs = - _clang_Cursor_hasAttrs_ptr.asFunction(); + _clang_Cursor_hasAttrsPtr.asFunction(); /// Determine whether the given cursor kind represents an invalid cursor. int clang_isInvalid( @@ -1970,11 +1972,11 @@ class LibClang { ); } - late final _clang_isInvalid_ptr = + late final _clang_isInvalidPtr = _lookup>( 'clang_isInvalid'); late final _clang_isInvalid = - _clang_isInvalid_ptr.asFunction(); + _clang_isInvalidPtr.asFunction(); /// Determine whether the given cursor kind represents a translation unit. int clang_isTranslationUnit( @@ -1985,11 +1987,11 @@ class LibClang { ); } - late final _clang_isTranslationUnit_ptr = + late final _clang_isTranslationUnitPtr = _lookup>( 'clang_isTranslationUnit'); late final _clang_isTranslationUnit = - _clang_isTranslationUnit_ptr.asFunction(); + _clang_isTranslationUnitPtr.asFunction(); /// * Determine whether the given cursor represents a preprocessing element, /// such as a preprocessor directive or macro instantiation. @@ -2001,11 +2003,11 @@ class LibClang { ); } - late final _clang_isPreprocessing_ptr = + late final _clang_isPreprocessingPtr = _lookup>( 'clang_isPreprocessing'); late final _clang_isPreprocessing = - _clang_isPreprocessing_ptr.asFunction(); + _clang_isPreprocessingPtr.asFunction(); /// * Determine whether the given cursor represents a currently unexposed /// piece of the AST (e.g., CXCursor_UnexposedStmt). @@ -2017,11 +2019,11 @@ class LibClang { ); } - late final _clang_isUnexposed_ptr = + late final _clang_isUnexposedPtr = _lookup>( 'clang_isUnexposed'); late final _clang_isUnexposed = - _clang_isUnexposed_ptr.asFunction(); + _clang_isUnexposedPtr.asFunction(); /// Determine the linkage of the entity referred to by a given cursor. int clang_getCursorLinkage( @@ -2032,11 +2034,11 @@ class LibClang { ); } - late final _clang_getCursorLinkage_ptr = + late final _clang_getCursorLinkagePtr = _lookup>( 'clang_getCursorLinkage'); late final _clang_getCursorLinkage = - _clang_getCursorLinkage_ptr.asFunction(); + _clang_getCursorLinkagePtr.asFunction(); /// Describe the visibility of the entity referred to by a cursor. int clang_getCursorVisibility( @@ -2047,11 +2049,11 @@ class LibClang { ); } - late final _clang_getCursorVisibility_ptr = + late final _clang_getCursorVisibilityPtr = _lookup>( 'clang_getCursorVisibility'); late final _clang_getCursorVisibility = - _clang_getCursorVisibility_ptr.asFunction(); + _clang_getCursorVisibilityPtr.asFunction(); /// Determine the availability of the entity that this cursor refers to, /// taking the current target platform into account. @@ -2063,11 +2065,11 @@ class LibClang { ); } - late final _clang_getCursorAvailability_ptr = + late final _clang_getCursorAvailabilityPtr = _lookup>( 'clang_getCursorAvailability'); late final _clang_getCursorAvailability = - _clang_getCursorAvailability_ptr.asFunction(); + _clang_getCursorAvailabilityPtr.asFunction(); /// Determine the availability of the entity that this cursor refers to on any /// platforms for which availability information is known. @@ -2091,7 +2093,7 @@ class LibClang { ); } - late final _clang_getCursorPlatformAvailability_ptr = _lookup< + late final _clang_getCursorPlatformAvailabilityPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( CXCursor, @@ -2102,7 +2104,7 @@ class LibClang { ffi.Pointer, ffi.Int32)>>('clang_getCursorPlatformAvailability'); late final _clang_getCursorPlatformAvailability = - _clang_getCursorPlatformAvailability_ptr.asFunction< + _clang_getCursorPlatformAvailabilityPtr.asFunction< int Function( CXCursor, ffi.Pointer, @@ -2121,12 +2123,12 @@ class LibClang { ); } - late final _clang_disposeCXPlatformAvailability_ptr = _lookup< + late final _clang_disposeCXPlatformAvailabilityPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer)>>( 'clang_disposeCXPlatformAvailability'); late final _clang_disposeCXPlatformAvailability = - _clang_disposeCXPlatformAvailability_ptr + _clang_disposeCXPlatformAvailabilityPtr .asFunction)>(); /// Determine the "language" of the entity referred to by a given cursor. @@ -2138,11 +2140,11 @@ class LibClang { ); } - late final _clang_getCursorLanguage_ptr = + late final _clang_getCursorLanguagePtr = _lookup>( 'clang_getCursorLanguage'); late final _clang_getCursorLanguage = - _clang_getCursorLanguage_ptr.asFunction(); + _clang_getCursorLanguagePtr.asFunction(); /// Determine the "thread-local storage (TLS) kind" of the declaration /// referred to by a cursor. @@ -2154,11 +2156,11 @@ class LibClang { ); } - late final _clang_getCursorTLSKind_ptr = + late final _clang_getCursorTLSKindPtr = _lookup>( 'clang_getCursorTLSKind'); late final _clang_getCursorTLSKind = - _clang_getCursorTLSKind_ptr.asFunction(); + _clang_getCursorTLSKindPtr.asFunction(); /// Returns the translation unit that a cursor originated from. CXTranslationUnit clang_Cursor_getTranslationUnit( @@ -2169,11 +2171,11 @@ class LibClang { ); } - late final _clang_Cursor_getTranslationUnit_ptr = + late final _clang_Cursor_getTranslationUnitPtr = _lookup>( 'clang_Cursor_getTranslationUnit'); late final _clang_Cursor_getTranslationUnit = - _clang_Cursor_getTranslationUnit_ptr + _clang_Cursor_getTranslationUnitPtr .asFunction(); /// Creates an empty CXCursorSet. @@ -2181,11 +2183,11 @@ class LibClang { return _clang_createCXCursorSet(); } - late final _clang_createCXCursorSet_ptr = + late final _clang_createCXCursorSetPtr = _lookup>( 'clang_createCXCursorSet'); late final _clang_createCXCursorSet = - _clang_createCXCursorSet_ptr.asFunction(); + _clang_createCXCursorSetPtr.asFunction(); /// Disposes a CXCursorSet and releases its associated memory. void clang_disposeCXCursorSet( @@ -2196,11 +2198,11 @@ class LibClang { ); } - late final _clang_disposeCXCursorSet_ptr = + late final _clang_disposeCXCursorSetPtr = _lookup>( 'clang_disposeCXCursorSet'); late final _clang_disposeCXCursorSet = - _clang_disposeCXCursorSet_ptr.asFunction(); + _clang_disposeCXCursorSetPtr.asFunction(); /// Queries a CXCursorSet to see if it contains a specific CXCursor. int clang_CXCursorSet_contains( @@ -2213,10 +2215,10 @@ class LibClang { ); } - late final _clang_CXCursorSet_contains_ptr = + late final _clang_CXCursorSet_containsPtr = _lookup>( 'clang_CXCursorSet_contains'); - late final _clang_CXCursorSet_contains = _clang_CXCursorSet_contains_ptr + late final _clang_CXCursorSet_contains = _clang_CXCursorSet_containsPtr .asFunction(); /// Inserts a CXCursor into a CXCursorSet. @@ -2230,10 +2232,10 @@ class LibClang { ); } - late final _clang_CXCursorSet_insert_ptr = + late final _clang_CXCursorSet_insertPtr = _lookup>( 'clang_CXCursorSet_insert'); - late final _clang_CXCursorSet_insert = _clang_CXCursorSet_insert_ptr + late final _clang_CXCursorSet_insert = _clang_CXCursorSet_insertPtr .asFunction(); /// Determine the semantic parent of the given cursor. @@ -2245,10 +2247,10 @@ class LibClang { ); } - late final _clang_getCursorSemanticParent_ptr = + late final _clang_getCursorSemanticParentPtr = _lookup>( 'clang_getCursorSemanticParent'); - late final _clang_getCursorSemanticParent = _clang_getCursorSemanticParent_ptr + late final _clang_getCursorSemanticParent = _clang_getCursorSemanticParentPtr .asFunction(); /// Determine the lexical parent of the given cursor. @@ -2260,10 +2262,10 @@ class LibClang { ); } - late final _clang_getCursorLexicalParent_ptr = + late final _clang_getCursorLexicalParentPtr = _lookup>( 'clang_getCursorLexicalParent'); - late final _clang_getCursorLexicalParent = _clang_getCursorLexicalParent_ptr + late final _clang_getCursorLexicalParent = _clang_getCursorLexicalParentPtr .asFunction(); /// Determine the set of methods that are overridden by the given method. @@ -2279,12 +2281,12 @@ class LibClang { ); } - late final _clang_getOverriddenCursors_ptr = _lookup< + late final _clang_getOverriddenCursorsPtr = _lookup< ffi.NativeFunction< ffi.Void Function(CXCursor, ffi.Pointer>, ffi.Pointer)>>('clang_getOverriddenCursors'); late final _clang_getOverriddenCursors = - _clang_getOverriddenCursors_ptr.asFunction< + _clang_getOverriddenCursorsPtr.asFunction< void Function(CXCursor, ffi.Pointer>, ffi.Pointer)>(); @@ -2298,11 +2300,11 @@ class LibClang { ); } - late final _clang_disposeOverriddenCursors_ptr = + late final _clang_disposeOverriddenCursorsPtr = _lookup)>>( 'clang_disposeOverriddenCursors'); late final _clang_disposeOverriddenCursors = - _clang_disposeOverriddenCursors_ptr + _clang_disposeOverriddenCursorsPtr .asFunction)>(); /// Retrieve the file that is included by the given inclusion directive @@ -2315,11 +2317,11 @@ class LibClang { ); } - late final _clang_getIncludedFile_ptr = + late final _clang_getIncludedFilePtr = _lookup>( 'clang_getIncludedFile'); late final _clang_getIncludedFile = - _clang_getIncludedFile_ptr.asFunction(); + _clang_getIncludedFilePtr.asFunction(); /// Map a source location to the cursor that describes the entity at that /// location in the source code. @@ -2333,11 +2335,11 @@ class LibClang { ); } - late final _clang_getCursor_ptr = _lookup< + late final _clang_getCursorPtr = _lookup< ffi.NativeFunction< CXCursor Function( CXTranslationUnit, CXSourceLocation)>>('clang_getCursor'); - late final _clang_getCursor = _clang_getCursor_ptr + late final _clang_getCursor = _clang_getCursorPtr .asFunction(); /// Retrieve the physical location of the source constructor referenced by the @@ -2350,10 +2352,10 @@ class LibClang { ); } - late final _clang_getCursorLocation_ptr = + late final _clang_getCursorLocationPtr = _lookup>( 'clang_getCursorLocation'); - late final _clang_getCursorLocation = _clang_getCursorLocation_ptr + late final _clang_getCursorLocation = _clang_getCursorLocationPtr .asFunction(); /// Retrieve the physical extent of the source construct referenced by the @@ -2366,11 +2368,11 @@ class LibClang { ); } - late final _clang_getCursorExtent_ptr = + late final _clang_getCursorExtentPtr = _lookup>( 'clang_getCursorExtent'); late final _clang_getCursorExtent = - _clang_getCursorExtent_ptr.asFunction(); + _clang_getCursorExtentPtr.asFunction(); /// Retrieve the type of a CXCursor (if any). CXType clang_getCursorType( @@ -2381,11 +2383,11 @@ class LibClang { ); } - late final _clang_getCursorType_ptr = + late final _clang_getCursorTypePtr = _lookup>( 'clang_getCursorType'); late final _clang_getCursorType = - _clang_getCursorType_ptr.asFunction(); + _clang_getCursorTypePtr.asFunction(); /// Pretty-print the underlying type using the rules of the language of the /// translation unit from which it came. @@ -2397,11 +2399,11 @@ class LibClang { ); } - late final _clang_getTypeSpelling_ptr = + late final _clang_getTypeSpellingPtr = _lookup>( 'clang_getTypeSpelling'); late final _clang_getTypeSpelling = - _clang_getTypeSpelling_ptr.asFunction(); + _clang_getTypeSpellingPtr.asFunction(); /// Retrieve the underlying type of a typedef declaration. CXType clang_getTypedefDeclUnderlyingType( @@ -2412,11 +2414,11 @@ class LibClang { ); } - late final _clang_getTypedefDeclUnderlyingType_ptr = + late final _clang_getTypedefDeclUnderlyingTypePtr = _lookup>( 'clang_getTypedefDeclUnderlyingType'); late final _clang_getTypedefDeclUnderlyingType = - _clang_getTypedefDeclUnderlyingType_ptr + _clang_getTypedefDeclUnderlyingTypePtr .asFunction(); /// Retrieve the integer type of an enum declaration. @@ -2428,11 +2430,11 @@ class LibClang { ); } - late final _clang_getEnumDeclIntegerType_ptr = + late final _clang_getEnumDeclIntegerTypePtr = _lookup>( 'clang_getEnumDeclIntegerType'); late final _clang_getEnumDeclIntegerType = - _clang_getEnumDeclIntegerType_ptr.asFunction(); + _clang_getEnumDeclIntegerTypePtr.asFunction(); /// Retrieve the integer value of an enum constant declaration as a signed /// long long. @@ -2444,11 +2446,11 @@ class LibClang { ); } - late final _clang_getEnumConstantDeclValue_ptr = + late final _clang_getEnumConstantDeclValuePtr = _lookup>( 'clang_getEnumConstantDeclValue'); late final _clang_getEnumConstantDeclValue = - _clang_getEnumConstantDeclValue_ptr.asFunction(); + _clang_getEnumConstantDeclValuePtr.asFunction(); /// Retrieve the integer value of an enum constant declaration as an unsigned /// long long. @@ -2460,11 +2462,11 @@ class LibClang { ); } - late final _clang_getEnumConstantDeclUnsignedValue_ptr = + late final _clang_getEnumConstantDeclUnsignedValuePtr = _lookup>( 'clang_getEnumConstantDeclUnsignedValue'); late final _clang_getEnumConstantDeclUnsignedValue = - _clang_getEnumConstantDeclUnsignedValue_ptr + _clang_getEnumConstantDeclUnsignedValuePtr .asFunction(); /// Retrieve the bit width of a bit field declaration as an integer. @@ -2476,11 +2478,11 @@ class LibClang { ); } - late final _clang_getFieldDeclBitWidth_ptr = + late final _clang_getFieldDeclBitWidthPtr = _lookup>( 'clang_getFieldDeclBitWidth'); late final _clang_getFieldDeclBitWidth = - _clang_getFieldDeclBitWidth_ptr.asFunction(); + _clang_getFieldDeclBitWidthPtr.asFunction(); /// Retrieve the number of non-variadic arguments associated with a given /// cursor. @@ -2492,11 +2494,11 @@ class LibClang { ); } - late final _clang_Cursor_getNumArguments_ptr = + late final _clang_Cursor_getNumArgumentsPtr = _lookup>( 'clang_Cursor_getNumArguments'); late final _clang_Cursor_getNumArguments = - _clang_Cursor_getNumArguments_ptr.asFunction(); + _clang_Cursor_getNumArgumentsPtr.asFunction(); /// Retrieve the argument cursor of a function or method. CXCursor clang_Cursor_getArgument( @@ -2509,10 +2511,10 @@ class LibClang { ); } - late final _clang_Cursor_getArgument_ptr = + late final _clang_Cursor_getArgumentPtr = _lookup>( 'clang_Cursor_getArgument'); - late final _clang_Cursor_getArgument = _clang_Cursor_getArgument_ptr + late final _clang_Cursor_getArgument = _clang_Cursor_getArgumentPtr .asFunction(); /// Returns the number of template args of a function decl representing a @@ -2525,11 +2527,11 @@ class LibClang { ); } - late final _clang_Cursor_getNumTemplateArguments_ptr = + late final _clang_Cursor_getNumTemplateArgumentsPtr = _lookup>( 'clang_Cursor_getNumTemplateArguments'); late final _clang_Cursor_getNumTemplateArguments = - _clang_Cursor_getNumTemplateArguments_ptr + _clang_Cursor_getNumTemplateArgumentsPtr .asFunction(); /// Retrieve the kind of the I'th template argument of the CXCursor C. @@ -2543,11 +2545,11 @@ class LibClang { ); } - late final _clang_Cursor_getTemplateArgumentKind_ptr = + late final _clang_Cursor_getTemplateArgumentKindPtr = _lookup>( 'clang_Cursor_getTemplateArgumentKind'); late final _clang_Cursor_getTemplateArgumentKind = - _clang_Cursor_getTemplateArgumentKind_ptr + _clang_Cursor_getTemplateArgumentKindPtr .asFunction(); /// Retrieve a CXType representing the type of a TemplateArgument of a @@ -2562,11 +2564,11 @@ class LibClang { ); } - late final _clang_Cursor_getTemplateArgumentType_ptr = + late final _clang_Cursor_getTemplateArgumentTypePtr = _lookup>( 'clang_Cursor_getTemplateArgumentType'); late final _clang_Cursor_getTemplateArgumentType = - _clang_Cursor_getTemplateArgumentType_ptr + _clang_Cursor_getTemplateArgumentTypePtr .asFunction(); /// Retrieve the value of an Integral TemplateArgument (of a function decl @@ -2581,11 +2583,11 @@ class LibClang { ); } - late final _clang_Cursor_getTemplateArgumentValue_ptr = + late final _clang_Cursor_getTemplateArgumentValuePtr = _lookup>( 'clang_Cursor_getTemplateArgumentValue'); late final _clang_Cursor_getTemplateArgumentValue = - _clang_Cursor_getTemplateArgumentValue_ptr + _clang_Cursor_getTemplateArgumentValuePtr .asFunction(); /// Retrieve the value of an Integral TemplateArgument (of a function decl @@ -2600,11 +2602,11 @@ class LibClang { ); } - late final _clang_Cursor_getTemplateArgumentUnsignedValue_ptr = + late final _clang_Cursor_getTemplateArgumentUnsignedValuePtr = _lookup>( 'clang_Cursor_getTemplateArgumentUnsignedValue'); late final _clang_Cursor_getTemplateArgumentUnsignedValue = - _clang_Cursor_getTemplateArgumentUnsignedValue_ptr + _clang_Cursor_getTemplateArgumentUnsignedValuePtr .asFunction(); /// Determine whether two CXTypes represent the same type. @@ -2618,11 +2620,11 @@ class LibClang { ); } - late final _clang_equalTypes_ptr = + late final _clang_equalTypesPtr = _lookup>( 'clang_equalTypes'); late final _clang_equalTypes = - _clang_equalTypes_ptr.asFunction(); + _clang_equalTypesPtr.asFunction(); /// Return the canonical type for a CXType. CXType clang_getCanonicalType( @@ -2633,11 +2635,11 @@ class LibClang { ); } - late final _clang_getCanonicalType_ptr = + late final _clang_getCanonicalTypePtr = _lookup>( 'clang_getCanonicalType'); late final _clang_getCanonicalType = - _clang_getCanonicalType_ptr.asFunction(); + _clang_getCanonicalTypePtr.asFunction(); /// Determine whether a CXType has the "const" qualifier set, without looking /// through typedefs that may have added "const" at a different level. @@ -2649,11 +2651,11 @@ class LibClang { ); } - late final _clang_isConstQualifiedType_ptr = + late final _clang_isConstQualifiedTypePtr = _lookup>( 'clang_isConstQualifiedType'); late final _clang_isConstQualifiedType = - _clang_isConstQualifiedType_ptr.asFunction(); + _clang_isConstQualifiedTypePtr.asFunction(); /// Determine whether a CXCursor that is a macro, is function like. int clang_Cursor_isMacroFunctionLike( @@ -2664,12 +2666,11 @@ class LibClang { ); } - late final _clang_Cursor_isMacroFunctionLike_ptr = + late final _clang_Cursor_isMacroFunctionLikePtr = _lookup>( 'clang_Cursor_isMacroFunctionLike'); late final _clang_Cursor_isMacroFunctionLike = - _clang_Cursor_isMacroFunctionLike_ptr - .asFunction(); + _clang_Cursor_isMacroFunctionLikePtr.asFunction(); /// Determine whether a CXCursor that is a macro, is a builtin one. int clang_Cursor_isMacroBuiltin( @@ -2680,11 +2681,11 @@ class LibClang { ); } - late final _clang_Cursor_isMacroBuiltin_ptr = + late final _clang_Cursor_isMacroBuiltinPtr = _lookup>( 'clang_Cursor_isMacroBuiltin'); late final _clang_Cursor_isMacroBuiltin = - _clang_Cursor_isMacroBuiltin_ptr.asFunction(); + _clang_Cursor_isMacroBuiltinPtr.asFunction(); /// Determine whether a CXCursor that is a function declaration, is an inline /// declaration. @@ -2696,11 +2697,11 @@ class LibClang { ); } - late final _clang_Cursor_isFunctionInlined_ptr = + late final _clang_Cursor_isFunctionInlinedPtr = _lookup>( 'clang_Cursor_isFunctionInlined'); late final _clang_Cursor_isFunctionInlined = - _clang_Cursor_isFunctionInlined_ptr.asFunction(); + _clang_Cursor_isFunctionInlinedPtr.asFunction(); /// Determine whether a CXType has the "volatile" qualifier set, without /// looking through typedefs that may have added "volatile" at a different @@ -2713,11 +2714,11 @@ class LibClang { ); } - late final _clang_isVolatileQualifiedType_ptr = + late final _clang_isVolatileQualifiedTypePtr = _lookup>( 'clang_isVolatileQualifiedType'); late final _clang_isVolatileQualifiedType = - _clang_isVolatileQualifiedType_ptr.asFunction(); + _clang_isVolatileQualifiedTypePtr.asFunction(); /// Determine whether a CXType has the "restrict" qualifier set, without /// looking through typedefs that may have added "restrict" at a different @@ -2730,11 +2731,11 @@ class LibClang { ); } - late final _clang_isRestrictQualifiedType_ptr = + late final _clang_isRestrictQualifiedTypePtr = _lookup>( 'clang_isRestrictQualifiedType'); late final _clang_isRestrictQualifiedType = - _clang_isRestrictQualifiedType_ptr.asFunction(); + _clang_isRestrictQualifiedTypePtr.asFunction(); /// Returns the address space of the given type. int clang_getAddressSpace( @@ -2745,11 +2746,11 @@ class LibClang { ); } - late final _clang_getAddressSpace_ptr = + late final _clang_getAddressSpacePtr = _lookup>( 'clang_getAddressSpace'); late final _clang_getAddressSpace = - _clang_getAddressSpace_ptr.asFunction(); + _clang_getAddressSpacePtr.asFunction(); /// Returns the typedef name of the given type. CXString clang_getTypedefName( @@ -2760,11 +2761,11 @@ class LibClang { ); } - late final _clang_getTypedefName_ptr = + late final _clang_getTypedefNamePtr = _lookup>( 'clang_getTypedefName'); late final _clang_getTypedefName = - _clang_getTypedefName_ptr.asFunction(); + _clang_getTypedefNamePtr.asFunction(); /// For pointer types, returns the type of the pointee. CXType clang_getPointeeType( @@ -2775,11 +2776,11 @@ class LibClang { ); } - late final _clang_getPointeeType_ptr = + late final _clang_getPointeeTypePtr = _lookup>( 'clang_getPointeeType'); late final _clang_getPointeeType = - _clang_getPointeeType_ptr.asFunction(); + _clang_getPointeeTypePtr.asFunction(); /// Return the cursor for the declaration of the given type. CXCursor clang_getTypeDeclaration( @@ -2790,11 +2791,11 @@ class LibClang { ); } - late final _clang_getTypeDeclaration_ptr = + late final _clang_getTypeDeclarationPtr = _lookup>( 'clang_getTypeDeclaration'); late final _clang_getTypeDeclaration = - _clang_getTypeDeclaration_ptr.asFunction(); + _clang_getTypeDeclarationPtr.asFunction(); /// Returns the Objective-C type encoding for the specified declaration. CXString clang_getDeclObjCTypeEncoding( @@ -2805,10 +2806,10 @@ class LibClang { ); } - late final _clang_getDeclObjCTypeEncoding_ptr = + late final _clang_getDeclObjCTypeEncodingPtr = _lookup>( 'clang_getDeclObjCTypeEncoding'); - late final _clang_getDeclObjCTypeEncoding = _clang_getDeclObjCTypeEncoding_ptr + late final _clang_getDeclObjCTypeEncoding = _clang_getDeclObjCTypeEncodingPtr .asFunction(); /// Returns the Objective-C type encoding for the specified CXType. @@ -2820,11 +2821,11 @@ class LibClang { ); } - late final _clang_Type_getObjCEncoding_ptr = + late final _clang_Type_getObjCEncodingPtr = _lookup>( 'clang_Type_getObjCEncoding'); late final _clang_Type_getObjCEncoding = - _clang_Type_getObjCEncoding_ptr.asFunction(); + _clang_Type_getObjCEncodingPtr.asFunction(); /// Retrieve the spelling of a given CXTypeKind. CXString clang_getTypeKindSpelling( @@ -2835,11 +2836,11 @@ class LibClang { ); } - late final _clang_getTypeKindSpelling_ptr = + late final _clang_getTypeKindSpellingPtr = _lookup>( 'clang_getTypeKindSpelling'); late final _clang_getTypeKindSpelling = - _clang_getTypeKindSpelling_ptr.asFunction(); + _clang_getTypeKindSpellingPtr.asFunction(); /// Retrieve the calling convention associated with a function type. int clang_getFunctionTypeCallingConv( @@ -2850,11 +2851,11 @@ class LibClang { ); } - late final _clang_getFunctionTypeCallingConv_ptr = + late final _clang_getFunctionTypeCallingConvPtr = _lookup>( 'clang_getFunctionTypeCallingConv'); late final _clang_getFunctionTypeCallingConv = - _clang_getFunctionTypeCallingConv_ptr.asFunction(); + _clang_getFunctionTypeCallingConvPtr.asFunction(); /// Retrieve the return type associated with a function type. CXType clang_getResultType( @@ -2865,11 +2866,11 @@ class LibClang { ); } - late final _clang_getResultType_ptr = + late final _clang_getResultTypePtr = _lookup>( 'clang_getResultType'); late final _clang_getResultType = - _clang_getResultType_ptr.asFunction(); + _clang_getResultTypePtr.asFunction(); /// Retrieve the exception specification type associated with a function type. /// This is a value of type CXCursor_ExceptionSpecificationKind. @@ -2881,11 +2882,11 @@ class LibClang { ); } - late final _clang_getExceptionSpecificationType_ptr = + late final _clang_getExceptionSpecificationTypePtr = _lookup>( 'clang_getExceptionSpecificationType'); late final _clang_getExceptionSpecificationType = - _clang_getExceptionSpecificationType_ptr + _clang_getExceptionSpecificationTypePtr .asFunction(); /// Retrieve the number of non-variadic parameters associated with a function @@ -2898,11 +2899,11 @@ class LibClang { ); } - late final _clang_getNumArgTypes_ptr = + late final _clang_getNumArgTypesPtr = _lookup>( 'clang_getNumArgTypes'); late final _clang_getNumArgTypes = - _clang_getNumArgTypes_ptr.asFunction(); + _clang_getNumArgTypesPtr.asFunction(); /// Retrieve the type of a parameter of a function type. CXType clang_getArgType( @@ -2915,11 +2916,11 @@ class LibClang { ); } - late final _clang_getArgType_ptr = + late final _clang_getArgTypePtr = _lookup>( 'clang_getArgType'); late final _clang_getArgType = - _clang_getArgType_ptr.asFunction(); + _clang_getArgTypePtr.asFunction(); /// Retrieves the base type of the ObjCObjectType. CXType clang_Type_getObjCObjectBaseType( @@ -2930,11 +2931,11 @@ class LibClang { ); } - late final _clang_Type_getObjCObjectBaseType_ptr = + late final _clang_Type_getObjCObjectBaseTypePtr = _lookup>( 'clang_Type_getObjCObjectBaseType'); late final _clang_Type_getObjCObjectBaseType = - _clang_Type_getObjCObjectBaseType_ptr + _clang_Type_getObjCObjectBaseTypePtr .asFunction(); /// Retrieve the number of protocol references associated with an ObjC @@ -2947,11 +2948,11 @@ class LibClang { ); } - late final _clang_Type_getNumObjCProtocolRefs_ptr = + late final _clang_Type_getNumObjCProtocolRefsPtr = _lookup>( 'clang_Type_getNumObjCProtocolRefs'); late final _clang_Type_getNumObjCProtocolRefs = - _clang_Type_getNumObjCProtocolRefs_ptr.asFunction(); + _clang_Type_getNumObjCProtocolRefsPtr.asFunction(); /// Retrieve the decl for a protocol reference for an ObjC object/id. CXCursor clang_Type_getObjCProtocolDecl( @@ -2964,11 +2965,11 @@ class LibClang { ); } - late final _clang_Type_getObjCProtocolDecl_ptr = + late final _clang_Type_getObjCProtocolDeclPtr = _lookup>( 'clang_Type_getObjCProtocolDecl'); late final _clang_Type_getObjCProtocolDecl = - _clang_Type_getObjCProtocolDecl_ptr + _clang_Type_getObjCProtocolDeclPtr .asFunction(); /// Retreive the number of type arguments associated with an ObjC object. @@ -2980,11 +2981,11 @@ class LibClang { ); } - late final _clang_Type_getNumObjCTypeArgs_ptr = + late final _clang_Type_getNumObjCTypeArgsPtr = _lookup>( 'clang_Type_getNumObjCTypeArgs'); late final _clang_Type_getNumObjCTypeArgs = - _clang_Type_getNumObjCTypeArgs_ptr.asFunction(); + _clang_Type_getNumObjCTypeArgsPtr.asFunction(); /// Retrieve a type argument associated with an ObjC object. CXType clang_Type_getObjCTypeArg( @@ -2997,11 +2998,11 @@ class LibClang { ); } - late final _clang_Type_getObjCTypeArg_ptr = + late final _clang_Type_getObjCTypeArgPtr = _lookup>( 'clang_Type_getObjCTypeArg'); late final _clang_Type_getObjCTypeArg = - _clang_Type_getObjCTypeArg_ptr.asFunction(); + _clang_Type_getObjCTypeArgPtr.asFunction(); /// Return 1 if the CXType is a variadic function type, and 0 otherwise. int clang_isFunctionTypeVariadic( @@ -3012,11 +3013,11 @@ class LibClang { ); } - late final _clang_isFunctionTypeVariadic_ptr = + late final _clang_isFunctionTypeVariadicPtr = _lookup>( 'clang_isFunctionTypeVariadic'); late final _clang_isFunctionTypeVariadic = - _clang_isFunctionTypeVariadic_ptr.asFunction(); + _clang_isFunctionTypeVariadicPtr.asFunction(); /// Retrieve the return type associated with a given cursor. CXType clang_getCursorResultType( @@ -3027,11 +3028,11 @@ class LibClang { ); } - late final _clang_getCursorResultType_ptr = + late final _clang_getCursorResultTypePtr = _lookup>( 'clang_getCursorResultType'); late final _clang_getCursorResultType = - _clang_getCursorResultType_ptr.asFunction(); + _clang_getCursorResultTypePtr.asFunction(); /// Retrieve the exception specification type associated with a given cursor. /// This is a value of type CXCursor_ExceptionSpecificationKind. @@ -3043,11 +3044,11 @@ class LibClang { ); } - late final _clang_getCursorExceptionSpecificationType_ptr = + late final _clang_getCursorExceptionSpecificationTypePtr = _lookup>( 'clang_getCursorExceptionSpecificationType'); late final _clang_getCursorExceptionSpecificationType = - _clang_getCursorExceptionSpecificationType_ptr + _clang_getCursorExceptionSpecificationTypePtr .asFunction(); /// Return 1 if the CXType is a POD (plain old data) type, and 0 otherwise. @@ -3059,11 +3060,11 @@ class LibClang { ); } - late final _clang_isPODType_ptr = + late final _clang_isPODTypePtr = _lookup>( 'clang_isPODType'); late final _clang_isPODType = - _clang_isPODType_ptr.asFunction(); + _clang_isPODTypePtr.asFunction(); /// Return the element type of an array, complex, or vector type. CXType clang_getElementType( @@ -3074,11 +3075,11 @@ class LibClang { ); } - late final _clang_getElementType_ptr = + late final _clang_getElementTypePtr = _lookup>( 'clang_getElementType'); late final _clang_getElementType = - _clang_getElementType_ptr.asFunction(); + _clang_getElementTypePtr.asFunction(); /// Return the number of elements of an array or vector type. int clang_getNumElements( @@ -3089,11 +3090,11 @@ class LibClang { ); } - late final _clang_getNumElements_ptr = + late final _clang_getNumElementsPtr = _lookup>( 'clang_getNumElements'); late final _clang_getNumElements = - _clang_getNumElements_ptr.asFunction(); + _clang_getNumElementsPtr.asFunction(); /// Return the element type of an array type. CXType clang_getArrayElementType( @@ -3104,11 +3105,11 @@ class LibClang { ); } - late final _clang_getArrayElementType_ptr = + late final _clang_getArrayElementTypePtr = _lookup>( 'clang_getArrayElementType'); late final _clang_getArrayElementType = - _clang_getArrayElementType_ptr.asFunction(); + _clang_getArrayElementTypePtr.asFunction(); /// Return the array size of a constant array. int clang_getArraySize( @@ -3119,11 +3120,11 @@ class LibClang { ); } - late final _clang_getArraySize_ptr = + late final _clang_getArraySizePtr = _lookup>( 'clang_getArraySize'); late final _clang_getArraySize = - _clang_getArraySize_ptr.asFunction(); + _clang_getArraySizePtr.asFunction(); /// Retrieve the type named by the qualified-id. CXType clang_Type_getNamedType( @@ -3134,11 +3135,11 @@ class LibClang { ); } - late final _clang_Type_getNamedType_ptr = + late final _clang_Type_getNamedTypePtr = _lookup>( 'clang_Type_getNamedType'); late final _clang_Type_getNamedType = - _clang_Type_getNamedType_ptr.asFunction(); + _clang_Type_getNamedTypePtr.asFunction(); /// Determine if a typedef is 'transparent' tag. int clang_Type_isTransparentTagTypedef( @@ -3149,12 +3150,11 @@ class LibClang { ); } - late final _clang_Type_isTransparentTagTypedef_ptr = + late final _clang_Type_isTransparentTagTypedefPtr = _lookup>( 'clang_Type_isTransparentTagTypedef'); late final _clang_Type_isTransparentTagTypedef = - _clang_Type_isTransparentTagTypedef_ptr - .asFunction(); + _clang_Type_isTransparentTagTypedefPtr.asFunction(); /// Retrieve the nullability kind of a pointer type. int clang_Type_getNullability( @@ -3165,11 +3165,11 @@ class LibClang { ); } - late final _clang_Type_getNullability_ptr = + late final _clang_Type_getNullabilityPtr = _lookup>( 'clang_Type_getNullability'); late final _clang_Type_getNullability = - _clang_Type_getNullability_ptr.asFunction(); + _clang_Type_getNullabilityPtr.asFunction(); /// Return the alignment of a type in bytes as per C++[expr.alignof] standard. int clang_Type_getAlignOf( @@ -3180,11 +3180,11 @@ class LibClang { ); } - late final _clang_Type_getAlignOf_ptr = + late final _clang_Type_getAlignOfPtr = _lookup>( 'clang_Type_getAlignOf'); late final _clang_Type_getAlignOf = - _clang_Type_getAlignOf_ptr.asFunction(); + _clang_Type_getAlignOfPtr.asFunction(); /// Return the class type of an member pointer type. CXType clang_Type_getClassType( @@ -3195,11 +3195,11 @@ class LibClang { ); } - late final _clang_Type_getClassType_ptr = + late final _clang_Type_getClassTypePtr = _lookup>( 'clang_Type_getClassType'); late final _clang_Type_getClassType = - _clang_Type_getClassType_ptr.asFunction(); + _clang_Type_getClassTypePtr.asFunction(); /// Return the size of a type in bytes as per C++[expr.sizeof] standard. int clang_Type_getSizeOf( @@ -3210,11 +3210,11 @@ class LibClang { ); } - late final _clang_Type_getSizeOf_ptr = + late final _clang_Type_getSizeOfPtr = _lookup>( 'clang_Type_getSizeOf'); late final _clang_Type_getSizeOf = - _clang_Type_getSizeOf_ptr.asFunction(); + _clang_Type_getSizeOfPtr.asFunction(); /// 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] @@ -3228,11 +3228,11 @@ class LibClang { ); } - late final _clang_Type_getOffsetOf_ptr = _lookup< + late final _clang_Type_getOffsetOfPtr = _lookup< ffi.NativeFunction< ffi.Int64 Function( CXType, ffi.Pointer)>>('clang_Type_getOffsetOf'); - late final _clang_Type_getOffsetOf = _clang_Type_getOffsetOf_ptr + late final _clang_Type_getOffsetOf = _clang_Type_getOffsetOfPtr .asFunction)>(); /// Return the type that was modified by this attributed type. @@ -3244,11 +3244,11 @@ class LibClang { ); } - late final _clang_Type_getModifiedType_ptr = + late final _clang_Type_getModifiedTypePtr = _lookup>( 'clang_Type_getModifiedType'); late final _clang_Type_getModifiedType = - _clang_Type_getModifiedType_ptr.asFunction(); + _clang_Type_getModifiedTypePtr.asFunction(); /// Return the offset of the field represented by the Cursor. int clang_Cursor_getOffsetOfField( @@ -3259,11 +3259,11 @@ class LibClang { ); } - late final _clang_Cursor_getOffsetOfField_ptr = + late final _clang_Cursor_getOffsetOfFieldPtr = _lookup>( 'clang_Cursor_getOffsetOfField'); late final _clang_Cursor_getOffsetOfField = - _clang_Cursor_getOffsetOfField_ptr.asFunction(); + _clang_Cursor_getOffsetOfFieldPtr.asFunction(); /// Determine whether the given cursor represents an anonymous tag or /// namespace @@ -3275,11 +3275,11 @@ class LibClang { ); } - late final _clang_Cursor_isAnonymous_ptr = + late final _clang_Cursor_isAnonymousPtr = _lookup>( 'clang_Cursor_isAnonymous'); late final _clang_Cursor_isAnonymous = - _clang_Cursor_isAnonymous_ptr.asFunction(); + _clang_Cursor_isAnonymousPtr.asFunction(); /// Determine whether the given cursor represents an anonymous record /// declaration. @@ -3291,11 +3291,11 @@ class LibClang { ); } - late final _clang_Cursor_isAnonymousRecordDecl_ptr = + late final _clang_Cursor_isAnonymousRecordDeclPtr = _lookup>( 'clang_Cursor_isAnonymousRecordDecl'); late final _clang_Cursor_isAnonymousRecordDecl = - _clang_Cursor_isAnonymousRecordDecl_ptr + _clang_Cursor_isAnonymousRecordDeclPtr .asFunction(); /// Determine whether the given cursor represents an inline namespace @@ -3308,11 +3308,11 @@ class LibClang { ); } - late final _clang_Cursor_isInlineNamespace_ptr = + late final _clang_Cursor_isInlineNamespacePtr = _lookup>( 'clang_Cursor_isInlineNamespace'); late final _clang_Cursor_isInlineNamespace = - _clang_Cursor_isInlineNamespace_ptr.asFunction(); + _clang_Cursor_isInlineNamespacePtr.asFunction(); /// Returns the number of template arguments for given template /// specialization, or -1 if type T is not a template specialization. @@ -3324,12 +3324,11 @@ class LibClang { ); } - late final _clang_Type_getNumTemplateArguments_ptr = + late final _clang_Type_getNumTemplateArgumentsPtr = _lookup>( 'clang_Type_getNumTemplateArguments'); late final _clang_Type_getNumTemplateArguments = - _clang_Type_getNumTemplateArguments_ptr - .asFunction(); + _clang_Type_getNumTemplateArgumentsPtr.asFunction(); /// Returns the type template argument of a template class specialization at /// given index. @@ -3343,11 +3342,11 @@ class LibClang { ); } - late final _clang_Type_getTemplateArgumentAsType_ptr = + late final _clang_Type_getTemplateArgumentAsTypePtr = _lookup>( 'clang_Type_getTemplateArgumentAsType'); late final _clang_Type_getTemplateArgumentAsType = - _clang_Type_getTemplateArgumentAsType_ptr + _clang_Type_getTemplateArgumentAsTypePtr .asFunction(); /// Retrieve the ref-qualifier kind of a function or method. @@ -3359,11 +3358,11 @@ class LibClang { ); } - late final _clang_Type_getCXXRefQualifier_ptr = + late final _clang_Type_getCXXRefQualifierPtr = _lookup>( 'clang_Type_getCXXRefQualifier'); late final _clang_Type_getCXXRefQualifier = - _clang_Type_getCXXRefQualifier_ptr.asFunction(); + _clang_Type_getCXXRefQualifierPtr.asFunction(); /// Returns non-zero if the cursor specifies a Record member that is a /// bitfield. @@ -3375,11 +3374,11 @@ class LibClang { ); } - late final _clang_Cursor_isBitField_ptr = + late final _clang_Cursor_isBitFieldPtr = _lookup>( 'clang_Cursor_isBitField'); late final _clang_Cursor_isBitField = - _clang_Cursor_isBitField_ptr.asFunction(); + _clang_Cursor_isBitFieldPtr.asFunction(); /// Returns 1 if the base class specified by the cursor with kind /// CX_CXXBaseSpecifier is virtual. @@ -3391,11 +3390,11 @@ class LibClang { ); } - late final _clang_isVirtualBase_ptr = + late final _clang_isVirtualBasePtr = _lookup>( 'clang_isVirtualBase'); late final _clang_isVirtualBase = - _clang_isVirtualBase_ptr.asFunction(); + _clang_isVirtualBasePtr.asFunction(); /// Returns the access control level for the referenced object. int clang_getCXXAccessSpecifier( @@ -3406,11 +3405,11 @@ class LibClang { ); } - late final _clang_getCXXAccessSpecifier_ptr = + late final _clang_getCXXAccessSpecifierPtr = _lookup>( 'clang_getCXXAccessSpecifier'); late final _clang_getCXXAccessSpecifier = - _clang_getCXXAccessSpecifier_ptr.asFunction(); + _clang_getCXXAccessSpecifierPtr.asFunction(); /// Returns the storage class for a function or variable declaration. int clang_Cursor_getStorageClass( @@ -3421,11 +3420,11 @@ class LibClang { ); } - late final _clang_Cursor_getStorageClass_ptr = + late final _clang_Cursor_getStorageClassPtr = _lookup>( 'clang_Cursor_getStorageClass'); late final _clang_Cursor_getStorageClass = - _clang_Cursor_getStorageClass_ptr.asFunction(); + _clang_Cursor_getStorageClassPtr.asFunction(); /// Determine the number of overloaded declarations referenced by a /// CXCursor_OverloadedDeclRef cursor. @@ -3437,11 +3436,11 @@ class LibClang { ); } - late final _clang_getNumOverloadedDecls_ptr = + late final _clang_getNumOverloadedDeclsPtr = _lookup>( 'clang_getNumOverloadedDecls'); late final _clang_getNumOverloadedDecls = - _clang_getNumOverloadedDecls_ptr.asFunction(); + _clang_getNumOverloadedDeclsPtr.asFunction(); /// Retrieve a cursor for one of the overloaded declarations referenced by a /// CXCursor_OverloadedDeclRef cursor. @@ -3455,10 +3454,10 @@ class LibClang { ); } - late final _clang_getOverloadedDecl_ptr = + late final _clang_getOverloadedDeclPtr = _lookup>( 'clang_getOverloadedDecl'); - late final _clang_getOverloadedDecl = _clang_getOverloadedDecl_ptr + late final _clang_getOverloadedDecl = _clang_getOverloadedDeclPtr .asFunction(); /// For cursors representing an iboutletcollection attribute, this function @@ -3471,11 +3470,11 @@ class LibClang { ); } - late final _clang_getIBOutletCollectionType_ptr = + late final _clang_getIBOutletCollectionTypePtr = _lookup>( 'clang_getIBOutletCollectionType'); late final _clang_getIBOutletCollectionType = - _clang_getIBOutletCollectionType_ptr + _clang_getIBOutletCollectionTypePtr .asFunction(); /// Visit the children of a particular cursor. @@ -3491,11 +3490,11 @@ class LibClang { ); } - late final _clang_visitChildren_ptr = _lookup< + late final _clang_visitChildrenPtr = _lookup< ffi.NativeFunction< ffi.Uint32 Function( CXCursor, CXCursorVisitor, CXClientData)>>('clang_visitChildren'); - late final _clang_visitChildren = _clang_visitChildren_ptr + late final _clang_visitChildren = _clang_visitChildrenPtr .asFunction(); /// Retrieve a Unified Symbol Resolution (USR) for the entity referenced by @@ -3508,11 +3507,11 @@ class LibClang { ); } - late final _clang_getCursorUSR_ptr = + late final _clang_getCursorUSRPtr = _lookup>( 'clang_getCursorUSR'); late final _clang_getCursorUSR = - _clang_getCursorUSR_ptr.asFunction(); + _clang_getCursorUSRPtr.asFunction(); /// Construct a USR for a specified Objective-C class. CXString clang_constructUSR_ObjCClass( @@ -3523,10 +3522,10 @@ class LibClang { ); } - late final _clang_constructUSR_ObjCClass_ptr = + late final _clang_constructUSR_ObjCClassPtr = _lookup)>>( 'clang_constructUSR_ObjCClass'); - late final _clang_constructUSR_ObjCClass = _clang_constructUSR_ObjCClass_ptr + late final _clang_constructUSR_ObjCClass = _clang_constructUSR_ObjCClassPtr .asFunction)>(); /// Construct a USR for a specified Objective-C category. @@ -3540,12 +3539,12 @@ class LibClang { ); } - late final _clang_constructUSR_ObjCCategory_ptr = _lookup< + late final _clang_constructUSR_ObjCCategoryPtr = _lookup< ffi.NativeFunction< CXString Function(ffi.Pointer, ffi.Pointer)>>('clang_constructUSR_ObjCCategory'); late final _clang_constructUSR_ObjCCategory = - _clang_constructUSR_ObjCCategory_ptr.asFunction< + _clang_constructUSR_ObjCCategoryPtr.asFunction< CXString Function(ffi.Pointer, ffi.Pointer)>(); /// Construct a USR for a specified Objective-C protocol. @@ -3557,11 +3556,11 @@ class LibClang { ); } - late final _clang_constructUSR_ObjCProtocol_ptr = + late final _clang_constructUSR_ObjCProtocolPtr = _lookup)>>( 'clang_constructUSR_ObjCProtocol'); late final _clang_constructUSR_ObjCProtocol = - _clang_constructUSR_ObjCProtocol_ptr + _clang_constructUSR_ObjCProtocolPtr .asFunction)>(); /// Construct a USR for a specified Objective-C instance variable and the USR @@ -3576,11 +3575,11 @@ class LibClang { ); } - late final _clang_constructUSR_ObjCIvar_ptr = _lookup< + late final _clang_constructUSR_ObjCIvarPtr = _lookup< ffi.NativeFunction< CXString Function( ffi.Pointer, CXString)>>('clang_constructUSR_ObjCIvar'); - late final _clang_constructUSR_ObjCIvar = _clang_constructUSR_ObjCIvar_ptr + late final _clang_constructUSR_ObjCIvar = _clang_constructUSR_ObjCIvarPtr .asFunction, CXString)>(); /// Construct a USR for a specified Objective-C method and the USR for its @@ -3597,11 +3596,11 @@ class LibClang { ); } - late final _clang_constructUSR_ObjCMethod_ptr = _lookup< + late final _clang_constructUSR_ObjCMethodPtr = _lookup< ffi.NativeFunction< CXString Function(ffi.Pointer, ffi.Uint32, CXString)>>('clang_constructUSR_ObjCMethod'); - late final _clang_constructUSR_ObjCMethod = _clang_constructUSR_ObjCMethod_ptr + late final _clang_constructUSR_ObjCMethod = _clang_constructUSR_ObjCMethodPtr .asFunction, int, CXString)>(); /// Construct a USR for a specified Objective-C property and the USR for its @@ -3616,12 +3615,12 @@ class LibClang { ); } - late final _clang_constructUSR_ObjCProperty_ptr = _lookup< + late final _clang_constructUSR_ObjCPropertyPtr = _lookup< ffi.NativeFunction< CXString Function(ffi.Pointer, CXString)>>('clang_constructUSR_ObjCProperty'); late final _clang_constructUSR_ObjCProperty = - _clang_constructUSR_ObjCProperty_ptr + _clang_constructUSR_ObjCPropertyPtr .asFunction, CXString)>(); /// Retrieve a name for the entity referenced by this cursor. @@ -3633,11 +3632,11 @@ class LibClang { ); } - late final _clang_getCursorSpelling_ptr = + late final _clang_getCursorSpellingPtr = _lookup>( 'clang_getCursorSpelling'); late final _clang_getCursorSpelling = - _clang_getCursorSpelling_ptr.asFunction(); + _clang_getCursorSpellingPtr.asFunction(); /// 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 @@ -3655,12 +3654,12 @@ class LibClang { ); } - late final _clang_Cursor_getSpellingNameRange_ptr = _lookup< + late final _clang_Cursor_getSpellingNameRangePtr = _lookup< ffi.NativeFunction< CXSourceRange Function(CXCursor, ffi.Uint32, ffi.Uint32)>>('clang_Cursor_getSpellingNameRange'); late final _clang_Cursor_getSpellingNameRange = - _clang_Cursor_getSpellingNameRange_ptr + _clang_Cursor_getSpellingNameRangePtr .asFunction(); /// Get a property value for the given printing policy. @@ -3674,11 +3673,11 @@ class LibClang { ); } - late final _clang_PrintingPolicy_getProperty_ptr = _lookup< + late final _clang_PrintingPolicy_getPropertyPtr = _lookup< ffi.NativeFunction>( 'clang_PrintingPolicy_getProperty'); late final _clang_PrintingPolicy_getProperty = - _clang_PrintingPolicy_getProperty_ptr + _clang_PrintingPolicy_getPropertyPtr .asFunction(); /// Set a property value for the given printing policy. @@ -3694,12 +3693,12 @@ class LibClang { ); } - late final _clang_PrintingPolicy_setProperty_ptr = _lookup< + late final _clang_PrintingPolicy_setPropertyPtr = _lookup< ffi.NativeFunction< ffi.Void Function(CXPrintingPolicy, ffi.Int32, ffi.Uint32)>>('clang_PrintingPolicy_setProperty'); late final _clang_PrintingPolicy_setProperty = - _clang_PrintingPolicy_setProperty_ptr + _clang_PrintingPolicy_setPropertyPtr .asFunction(); /// Retrieve the default policy for the cursor. @@ -3711,10 +3710,10 @@ class LibClang { ); } - late final _clang_getCursorPrintingPolicy_ptr = + late final _clang_getCursorPrintingPolicyPtr = _lookup>( 'clang_getCursorPrintingPolicy'); - late final _clang_getCursorPrintingPolicy = _clang_getCursorPrintingPolicy_ptr + late final _clang_getCursorPrintingPolicy = _clang_getCursorPrintingPolicyPtr .asFunction(); /// Release a printing policy. @@ -3726,10 +3725,10 @@ class LibClang { ); } - late final _clang_PrintingPolicy_dispose_ptr = + late final _clang_PrintingPolicy_disposePtr = _lookup>( 'clang_PrintingPolicy_dispose'); - late final _clang_PrintingPolicy_dispose = _clang_PrintingPolicy_dispose_ptr + late final _clang_PrintingPolicy_dispose = _clang_PrintingPolicy_disposePtr .asFunction(); /// Pretty print declarations. @@ -3743,10 +3742,10 @@ class LibClang { ); } - late final _clang_getCursorPrettyPrinted_ptr = _lookup< + late final _clang_getCursorPrettyPrintedPtr = _lookup< ffi.NativeFunction>( 'clang_getCursorPrettyPrinted'); - late final _clang_getCursorPrettyPrinted = _clang_getCursorPrettyPrinted_ptr + late final _clang_getCursorPrettyPrinted = _clang_getCursorPrettyPrintedPtr .asFunction(); /// Retrieve the display name for the entity referenced by this cursor. @@ -3758,11 +3757,11 @@ class LibClang { ); } - late final _clang_getCursorDisplayName_ptr = + late final _clang_getCursorDisplayNamePtr = _lookup>( 'clang_getCursorDisplayName'); late final _clang_getCursorDisplayName = - _clang_getCursorDisplayName_ptr.asFunction(); + _clang_getCursorDisplayNamePtr.asFunction(); /// For a cursor that is a reference, retrieve a cursor representing the /// entity that it references. @@ -3774,11 +3773,11 @@ class LibClang { ); } - late final _clang_getCursorReferenced_ptr = + late final _clang_getCursorReferencedPtr = _lookup>( 'clang_getCursorReferenced'); late final _clang_getCursorReferenced = - _clang_getCursorReferenced_ptr.asFunction(); + _clang_getCursorReferencedPtr.asFunction(); /// 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. @@ -3790,11 +3789,11 @@ class LibClang { ); } - late final _clang_getCursorDefinition_ptr = + late final _clang_getCursorDefinitionPtr = _lookup>( 'clang_getCursorDefinition'); late final _clang_getCursorDefinition = - _clang_getCursorDefinition_ptr.asFunction(); + _clang_getCursorDefinitionPtr.asFunction(); /// Determine whether the declaration pointed to by this cursor is also a /// definition of that entity. @@ -3806,11 +3805,11 @@ class LibClang { ); } - late final _clang_isCursorDefinition_ptr = + late final _clang_isCursorDefinitionPtr = _lookup>( 'clang_isCursorDefinition'); late final _clang_isCursorDefinition = - _clang_isCursorDefinition_ptr.asFunction(); + _clang_isCursorDefinitionPtr.asFunction(); /// Retrieve the canonical cursor corresponding to the given cursor. CXCursor clang_getCanonicalCursor( @@ -3821,11 +3820,11 @@ class LibClang { ); } - late final _clang_getCanonicalCursor_ptr = + late final _clang_getCanonicalCursorPtr = _lookup>( 'clang_getCanonicalCursor'); late final _clang_getCanonicalCursor = - _clang_getCanonicalCursor_ptr.asFunction(); + _clang_getCanonicalCursorPtr.asFunction(); /// If the cursor points to a selector identifier in an Objective-C method or /// message expression, this returns the selector index. @@ -3837,11 +3836,11 @@ class LibClang { ); } - late final _clang_Cursor_getObjCSelectorIndex_ptr = + late final _clang_Cursor_getObjCSelectorIndexPtr = _lookup>( 'clang_Cursor_getObjCSelectorIndex'); late final _clang_Cursor_getObjCSelectorIndex = - _clang_Cursor_getObjCSelectorIndex_ptr + _clang_Cursor_getObjCSelectorIndexPtr .asFunction(); /// Given a cursor pointing to a C++ method call or an Objective-C message, @@ -3854,11 +3853,11 @@ class LibClang { ); } - late final _clang_Cursor_isDynamicCall_ptr = + late final _clang_Cursor_isDynamicCallPtr = _lookup>( 'clang_Cursor_isDynamicCall'); late final _clang_Cursor_isDynamicCall = - _clang_Cursor_isDynamicCall_ptr.asFunction(); + _clang_Cursor_isDynamicCallPtr.asFunction(); /// Given a cursor pointing to an Objective-C message or property reference, /// or C++ method call, returns the CXType of the receiver. @@ -3870,11 +3869,11 @@ class LibClang { ); } - late final _clang_Cursor_getReceiverType_ptr = + late final _clang_Cursor_getReceiverTypePtr = _lookup>( 'clang_Cursor_getReceiverType'); late final _clang_Cursor_getReceiverType = - _clang_Cursor_getReceiverType_ptr.asFunction(); + _clang_Cursor_getReceiverTypePtr.asFunction(); /// Given a cursor that represents a property declaration, return the /// associated property attributes. The bits are formed from @@ -3889,11 +3888,11 @@ class LibClang { ); } - late final _clang_Cursor_getObjCPropertyAttributes_ptr = + late final _clang_Cursor_getObjCPropertyAttributesPtr = _lookup>( 'clang_Cursor_getObjCPropertyAttributes'); late final _clang_Cursor_getObjCPropertyAttributes = - _clang_Cursor_getObjCPropertyAttributes_ptr + _clang_Cursor_getObjCPropertyAttributesPtr .asFunction(); /// Given a cursor that represents a property declaration, return the name of @@ -3906,11 +3905,11 @@ class LibClang { ); } - late final _clang_Cursor_getObjCPropertyGetterName_ptr = + late final _clang_Cursor_getObjCPropertyGetterNamePtr = _lookup>( 'clang_Cursor_getObjCPropertyGetterName'); late final _clang_Cursor_getObjCPropertyGetterName = - _clang_Cursor_getObjCPropertyGetterName_ptr + _clang_Cursor_getObjCPropertyGetterNamePtr .asFunction(); /// Given a cursor that represents a property declaration, return the name of @@ -3923,11 +3922,11 @@ class LibClang { ); } - late final _clang_Cursor_getObjCPropertySetterName_ptr = + late final _clang_Cursor_getObjCPropertySetterNamePtr = _lookup>( 'clang_Cursor_getObjCPropertySetterName'); late final _clang_Cursor_getObjCPropertySetterName = - _clang_Cursor_getObjCPropertySetterName_ptr + _clang_Cursor_getObjCPropertySetterNamePtr .asFunction(); /// Given a cursor that represents an Objective-C method or parameter @@ -3942,11 +3941,11 @@ class LibClang { ); } - late final _clang_Cursor_getObjCDeclQualifiers_ptr = + late final _clang_Cursor_getObjCDeclQualifiersPtr = _lookup>( 'clang_Cursor_getObjCDeclQualifiers'); late final _clang_Cursor_getObjCDeclQualifiers = - _clang_Cursor_getObjCDeclQualifiers_ptr + _clang_Cursor_getObjCDeclQualifiersPtr .asFunction(); /// Given a cursor that represents an Objective-C method or property @@ -3961,11 +3960,11 @@ class LibClang { ); } - late final _clang_Cursor_isObjCOptional_ptr = + late final _clang_Cursor_isObjCOptionalPtr = _lookup>( 'clang_Cursor_isObjCOptional'); late final _clang_Cursor_isObjCOptional = - _clang_Cursor_isObjCOptional_ptr.asFunction(); + _clang_Cursor_isObjCOptionalPtr.asFunction(); /// Returns non-zero if the given cursor is a variadic function or method. int clang_Cursor_isVariadic( @@ -3976,11 +3975,11 @@ class LibClang { ); } - late final _clang_Cursor_isVariadic_ptr = + late final _clang_Cursor_isVariadicPtr = _lookup>( 'clang_Cursor_isVariadic'); late final _clang_Cursor_isVariadic = - _clang_Cursor_isVariadic_ptr.asFunction(); + _clang_Cursor_isVariadicPtr.asFunction(); /// Returns non-zero if the given cursor points to a symbol marked with /// external_source_symbol attribute. @@ -3998,7 +3997,7 @@ class LibClang { ); } - late final _clang_Cursor_isExternalSymbol_ptr = _lookup< + late final _clang_Cursor_isExternalSymbolPtr = _lookup< ffi.NativeFunction< ffi.Uint32 Function( CXCursor, @@ -4006,7 +4005,7 @@ class LibClang { ffi.Pointer, ffi.Pointer)>>('clang_Cursor_isExternalSymbol'); late final _clang_Cursor_isExternalSymbol = - _clang_Cursor_isExternalSymbol_ptr.asFunction< + _clang_Cursor_isExternalSymbolPtr.asFunction< int Function(CXCursor, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -4021,10 +4020,10 @@ class LibClang { ); } - late final _clang_Cursor_getCommentRange_ptr = + late final _clang_Cursor_getCommentRangePtr = _lookup>( 'clang_Cursor_getCommentRange'); - late final _clang_Cursor_getCommentRange = _clang_Cursor_getCommentRange_ptr + late final _clang_Cursor_getCommentRange = _clang_Cursor_getCommentRangePtr .asFunction(); /// Given a cursor that represents a declaration, return the associated @@ -4037,11 +4036,11 @@ class LibClang { ); } - late final _clang_Cursor_getRawCommentText_ptr = + late final _clang_Cursor_getRawCommentTextPtr = _lookup>( 'clang_Cursor_getRawCommentText'); late final _clang_Cursor_getRawCommentText = - _clang_Cursor_getRawCommentText_ptr + _clang_Cursor_getRawCommentTextPtr .asFunction(); /// Given a cursor that represents a documentable entity (e.g., declaration), @@ -4054,11 +4053,11 @@ class LibClang { ); } - late final _clang_Cursor_getBriefCommentText_ptr = + late final _clang_Cursor_getBriefCommentTextPtr = _lookup>( 'clang_Cursor_getBriefCommentText'); late final _clang_Cursor_getBriefCommentText = - _clang_Cursor_getBriefCommentText_ptr + _clang_Cursor_getBriefCommentTextPtr .asFunction(); /// Retrieve the CXString representing the mangled name of the cursor. @@ -4070,11 +4069,11 @@ class LibClang { ); } - late final _clang_Cursor_getMangling_ptr = + late final _clang_Cursor_getManglingPtr = _lookup>( 'clang_Cursor_getMangling'); late final _clang_Cursor_getMangling = - _clang_Cursor_getMangling_ptr.asFunction(); + _clang_Cursor_getManglingPtr.asFunction(); /// Retrieve the CXStrings representing the mangled symbols of the C++ /// constructor or destructor at the cursor. @@ -4086,10 +4085,10 @@ class LibClang { ); } - late final _clang_Cursor_getCXXManglings_ptr = + late final _clang_Cursor_getCXXManglingsPtr = _lookup Function(CXCursor)>>( 'clang_Cursor_getCXXManglings'); - late final _clang_Cursor_getCXXManglings = _clang_Cursor_getCXXManglings_ptr + late final _clang_Cursor_getCXXManglings = _clang_Cursor_getCXXManglingsPtr .asFunction Function(CXCursor)>(); /// Retrieve the CXStrings representing the mangled symbols of the ObjC class @@ -4102,10 +4101,10 @@ class LibClang { ); } - late final _clang_Cursor_getObjCManglings_ptr = + late final _clang_Cursor_getObjCManglingsPtr = _lookup Function(CXCursor)>>( 'clang_Cursor_getObjCManglings'); - late final _clang_Cursor_getObjCManglings = _clang_Cursor_getObjCManglings_ptr + late final _clang_Cursor_getObjCManglings = _clang_Cursor_getObjCManglingsPtr .asFunction Function(CXCursor)>(); /// Given a CXCursor_ModuleImportDecl cursor, return the associated module. @@ -4117,11 +4116,11 @@ class LibClang { ); } - late final _clang_Cursor_getModule_ptr = + late final _clang_Cursor_getModulePtr = _lookup>( 'clang_Cursor_getModule'); late final _clang_Cursor_getModule = - _clang_Cursor_getModule_ptr.asFunction(); + _clang_Cursor_getModulePtr.asFunction(); /// Given a CXFile header file, return the module that contains it, if one /// exists. @@ -4135,10 +4134,10 @@ class LibClang { ); } - late final _clang_getModuleForFile_ptr = + late final _clang_getModuleForFilePtr = _lookup>( 'clang_getModuleForFile'); - late final _clang_getModuleForFile = _clang_getModuleForFile_ptr + late final _clang_getModuleForFile = _clang_getModuleForFilePtr .asFunction(); /// Returns the module file where the provided module object came from. @@ -4150,11 +4149,11 @@ class LibClang { ); } - late final _clang_Module_getASTFile_ptr = + late final _clang_Module_getASTFilePtr = _lookup>( 'clang_Module_getASTFile'); late final _clang_Module_getASTFile = - _clang_Module_getASTFile_ptr.asFunction(); + _clang_Module_getASTFilePtr.asFunction(); /// 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. @@ -4166,11 +4165,11 @@ class LibClang { ); } - late final _clang_Module_getParent_ptr = + late final _clang_Module_getParentPtr = _lookup>( 'clang_Module_getParent'); late final _clang_Module_getParent = - _clang_Module_getParent_ptr.asFunction(); + _clang_Module_getParentPtr.asFunction(); /// Returns the name of the module, e.g. for the 'std.vector' sub-module it /// will return "vector". @@ -4182,11 +4181,11 @@ class LibClang { ); } - late final _clang_Module_getName_ptr = + late final _clang_Module_getNamePtr = _lookup>( 'clang_Module_getName'); late final _clang_Module_getName = - _clang_Module_getName_ptr.asFunction(); + _clang_Module_getNamePtr.asFunction(); /// Returns the full name of the module, e.g. "std.vector". CXString clang_Module_getFullName( @@ -4197,11 +4196,11 @@ class LibClang { ); } - late final _clang_Module_getFullName_ptr = + late final _clang_Module_getFullNamePtr = _lookup>( 'clang_Module_getFullName'); late final _clang_Module_getFullName = - _clang_Module_getFullName_ptr.asFunction(); + _clang_Module_getFullNamePtr.asFunction(); /// Returns non-zero if the module is a system one. int clang_Module_isSystem( @@ -4212,11 +4211,11 @@ class LibClang { ); } - late final _clang_Module_isSystem_ptr = + late final _clang_Module_isSystemPtr = _lookup>( 'clang_Module_isSystem'); late final _clang_Module_isSystem = - _clang_Module_isSystem_ptr.asFunction(); + _clang_Module_isSystemPtr.asFunction(); /// Returns the number of top level headers associated with this module. int clang_Module_getNumTopLevelHeaders( @@ -4229,11 +4228,11 @@ class LibClang { ); } - late final _clang_Module_getNumTopLevelHeaders_ptr = _lookup< + late final _clang_Module_getNumTopLevelHeadersPtr = _lookup< ffi.NativeFunction>( 'clang_Module_getNumTopLevelHeaders'); late final _clang_Module_getNumTopLevelHeaders = - _clang_Module_getNumTopLevelHeaders_ptr + _clang_Module_getNumTopLevelHeadersPtr .asFunction(); /// Returns the specified top level header associated with the module. @@ -4249,12 +4248,12 @@ class LibClang { ); } - late final _clang_Module_getTopLevelHeader_ptr = _lookup< + late final _clang_Module_getTopLevelHeaderPtr = _lookup< ffi.NativeFunction< CXFile Function(CXTranslationUnit, CXModule, ffi.Uint32)>>('clang_Module_getTopLevelHeader'); late final _clang_Module_getTopLevelHeader = - _clang_Module_getTopLevelHeader_ptr + _clang_Module_getTopLevelHeaderPtr .asFunction(); /// Determine if a C++ constructor is a converting constructor. @@ -4266,11 +4265,11 @@ class LibClang { ); } - late final _clang_CXXConstructor_isConvertingConstructor_ptr = + late final _clang_CXXConstructor_isConvertingConstructorPtr = _lookup>( 'clang_CXXConstructor_isConvertingConstructor'); late final _clang_CXXConstructor_isConvertingConstructor = - _clang_CXXConstructor_isConvertingConstructor_ptr + _clang_CXXConstructor_isConvertingConstructorPtr .asFunction(); /// Determine if a C++ constructor is a copy constructor. @@ -4282,11 +4281,11 @@ class LibClang { ); } - late final _clang_CXXConstructor_isCopyConstructor_ptr = + late final _clang_CXXConstructor_isCopyConstructorPtr = _lookup>( 'clang_CXXConstructor_isCopyConstructor'); late final _clang_CXXConstructor_isCopyConstructor = - _clang_CXXConstructor_isCopyConstructor_ptr + _clang_CXXConstructor_isCopyConstructorPtr .asFunction(); /// Determine if a C++ constructor is the default constructor. @@ -4298,11 +4297,11 @@ class LibClang { ); } - late final _clang_CXXConstructor_isDefaultConstructor_ptr = + late final _clang_CXXConstructor_isDefaultConstructorPtr = _lookup>( 'clang_CXXConstructor_isDefaultConstructor'); late final _clang_CXXConstructor_isDefaultConstructor = - _clang_CXXConstructor_isDefaultConstructor_ptr + _clang_CXXConstructor_isDefaultConstructorPtr .asFunction(); /// Determine if a C++ constructor is a move constructor. @@ -4314,11 +4313,11 @@ class LibClang { ); } - late final _clang_CXXConstructor_isMoveConstructor_ptr = + late final _clang_CXXConstructor_isMoveConstructorPtr = _lookup>( 'clang_CXXConstructor_isMoveConstructor'); late final _clang_CXXConstructor_isMoveConstructor = - _clang_CXXConstructor_isMoveConstructor_ptr + _clang_CXXConstructor_isMoveConstructorPtr .asFunction(); /// Determine if a C++ field is declared 'mutable'. @@ -4330,11 +4329,11 @@ class LibClang { ); } - late final _clang_CXXField_isMutable_ptr = + late final _clang_CXXField_isMutablePtr = _lookup>( 'clang_CXXField_isMutable'); late final _clang_CXXField_isMutable = - _clang_CXXField_isMutable_ptr.asFunction(); + _clang_CXXField_isMutablePtr.asFunction(); /// Determine if a C++ method is declared '= default'. int clang_CXXMethod_isDefaulted( @@ -4345,11 +4344,11 @@ class LibClang { ); } - late final _clang_CXXMethod_isDefaulted_ptr = + late final _clang_CXXMethod_isDefaultedPtr = _lookup>( 'clang_CXXMethod_isDefaulted'); late final _clang_CXXMethod_isDefaulted = - _clang_CXXMethod_isDefaulted_ptr.asFunction(); + _clang_CXXMethod_isDefaultedPtr.asFunction(); /// Determine if a C++ member function or member function template is pure /// virtual. @@ -4361,11 +4360,11 @@ class LibClang { ); } - late final _clang_CXXMethod_isPureVirtual_ptr = + late final _clang_CXXMethod_isPureVirtualPtr = _lookup>( 'clang_CXXMethod_isPureVirtual'); late final _clang_CXXMethod_isPureVirtual = - _clang_CXXMethod_isPureVirtual_ptr.asFunction(); + _clang_CXXMethod_isPureVirtualPtr.asFunction(); /// Determine if a C++ member function or member function template is declared /// 'static'. @@ -4377,11 +4376,11 @@ class LibClang { ); } - late final _clang_CXXMethod_isStatic_ptr = + late final _clang_CXXMethod_isStaticPtr = _lookup>( 'clang_CXXMethod_isStatic'); late final _clang_CXXMethod_isStatic = - _clang_CXXMethod_isStatic_ptr.asFunction(); + _clang_CXXMethod_isStaticPtr.asFunction(); /// Determine if a C++ member function or member function template is /// explicitly declared 'virtual' or if it overrides a virtual method from one @@ -4394,11 +4393,11 @@ class LibClang { ); } - late final _clang_CXXMethod_isVirtual_ptr = + late final _clang_CXXMethod_isVirtualPtr = _lookup>( 'clang_CXXMethod_isVirtual'); late final _clang_CXXMethod_isVirtual = - _clang_CXXMethod_isVirtual_ptr.asFunction(); + _clang_CXXMethod_isVirtualPtr.asFunction(); /// Determine if a C++ record is abstract, i.e. whether a class or struct has /// a pure virtual member function. @@ -4410,11 +4409,11 @@ class LibClang { ); } - late final _clang_CXXRecord_isAbstract_ptr = + late final _clang_CXXRecord_isAbstractPtr = _lookup>( 'clang_CXXRecord_isAbstract'); late final _clang_CXXRecord_isAbstract = - _clang_CXXRecord_isAbstract_ptr.asFunction(); + _clang_CXXRecord_isAbstractPtr.asFunction(); /// Determine if an enum declaration refers to a scoped enum. int clang_EnumDecl_isScoped( @@ -4425,11 +4424,11 @@ class LibClang { ); } - late final _clang_EnumDecl_isScoped_ptr = + late final _clang_EnumDecl_isScopedPtr = _lookup>( 'clang_EnumDecl_isScoped'); late final _clang_EnumDecl_isScoped = - _clang_EnumDecl_isScoped_ptr.asFunction(); + _clang_EnumDecl_isScopedPtr.asFunction(); /// Determine if a C++ member function or member function template is declared /// 'const'. @@ -4441,11 +4440,11 @@ class LibClang { ); } - late final _clang_CXXMethod_isConst_ptr = + late final _clang_CXXMethod_isConstPtr = _lookup>( 'clang_CXXMethod_isConst'); late final _clang_CXXMethod_isConst = - _clang_CXXMethod_isConst_ptr.asFunction(); + _clang_CXXMethod_isConstPtr.asFunction(); /// Given a cursor that represents a template, determine the cursor kind of /// the specializations would be generated by instantiating the template. @@ -4457,11 +4456,11 @@ class LibClang { ); } - late final _clang_getTemplateCursorKind_ptr = + late final _clang_getTemplateCursorKindPtr = _lookup>( 'clang_getTemplateCursorKind'); late final _clang_getTemplateCursorKind = - _clang_getTemplateCursorKind_ptr.asFunction(); + _clang_getTemplateCursorKindPtr.asFunction(); /// Given a cursor that may represent a specialization or instantiation of a /// template, retrieve the cursor that represents the template that it @@ -4474,11 +4473,11 @@ class LibClang { ); } - late final _clang_getSpecializedCursorTemplate_ptr = + late final _clang_getSpecializedCursorTemplatePtr = _lookup>( 'clang_getSpecializedCursorTemplate'); late final _clang_getSpecializedCursorTemplate = - _clang_getSpecializedCursorTemplate_ptr + _clang_getSpecializedCursorTemplatePtr .asFunction(); /// Given a cursor that references something else, return the source range @@ -4495,12 +4494,12 @@ class LibClang { ); } - late final _clang_getCursorReferenceNameRange_ptr = _lookup< + late final _clang_getCursorReferenceNameRangePtr = _lookup< ffi.NativeFunction< CXSourceRange Function(CXCursor, ffi.Uint32, ffi.Uint32)>>('clang_getCursorReferenceNameRange'); late final _clang_getCursorReferenceNameRange = - _clang_getCursorReferenceNameRange_ptr + _clang_getCursorReferenceNameRangePtr .asFunction(); /// Get the raw lexical token starting with the given location. @@ -4514,11 +4513,11 @@ class LibClang { ); } - late final _clang_getToken_ptr = _lookup< + late final _clang_getTokenPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( CXTranslationUnit, CXSourceLocation)>>('clang_getToken'); - late final _clang_getToken = _clang_getToken_ptr.asFunction< + late final _clang_getToken = _clang_getTokenPtr.asFunction< ffi.Pointer Function(CXTranslationUnit, CXSourceLocation)>(); /// Determine the kind of the given token. @@ -4530,11 +4529,11 @@ class LibClang { ); } - late final _clang_getTokenKind_ptr = + late final _clang_getTokenKindPtr = _lookup>( 'clang_getTokenKind'); late final _clang_getTokenKind = - _clang_getTokenKind_ptr.asFunction(); + _clang_getTokenKindPtr.asFunction(); /// Determine the spelling of the given token. CXString clang_getTokenSpelling( @@ -4547,10 +4546,10 @@ class LibClang { ); } - late final _clang_getTokenSpelling_ptr = _lookup< + late final _clang_getTokenSpellingPtr = _lookup< ffi.NativeFunction>( 'clang_getTokenSpelling'); - late final _clang_getTokenSpelling = _clang_getTokenSpelling_ptr + late final _clang_getTokenSpelling = _clang_getTokenSpellingPtr .asFunction(); /// Retrieve the source location of the given token. @@ -4564,11 +4563,11 @@ class LibClang { ); } - late final _clang_getTokenLocation_ptr = _lookup< + late final _clang_getTokenLocationPtr = _lookup< ffi.NativeFunction< CXSourceLocation Function( CXTranslationUnit, CXToken)>>('clang_getTokenLocation'); - late final _clang_getTokenLocation = _clang_getTokenLocation_ptr + late final _clang_getTokenLocation = _clang_getTokenLocationPtr .asFunction(); /// Retrieve a source range that covers the given token. @@ -4582,11 +4581,11 @@ class LibClang { ); } - late final _clang_getTokenExtent_ptr = _lookup< + late final _clang_getTokenExtentPtr = _lookup< ffi.NativeFunction< CXSourceRange Function( CXTranslationUnit, CXToken)>>('clang_getTokenExtent'); - late final _clang_getTokenExtent = _clang_getTokenExtent_ptr + late final _clang_getTokenExtent = _clang_getTokenExtentPtr .asFunction(); /// Tokenize the source code described by the given range into raw lexical @@ -4605,14 +4604,14 @@ class LibClang { ); } - late final _clang_tokenize_ptr = _lookup< + late final _clang_tokenizePtr = _lookup< ffi.NativeFunction< ffi.Void Function( CXTranslationUnit, CXSourceRange, ffi.Pointer>, ffi.Pointer)>>('clang_tokenize'); - late final _clang_tokenize = _clang_tokenize_ptr.asFunction< + late final _clang_tokenize = _clang_tokenizePtr.asFunction< void Function(CXTranslationUnit, CXSourceRange, ffi.Pointer>, ffi.Pointer)>(); @@ -4632,11 +4631,11 @@ class LibClang { ); } - late final _clang_annotateTokens_ptr = _lookup< + late final _clang_annotateTokensPtr = _lookup< ffi.NativeFunction< ffi.Void Function(CXTranslationUnit, ffi.Pointer, ffi.Uint32, ffi.Pointer)>>('clang_annotateTokens'); - late final _clang_annotateTokens = _clang_annotateTokens_ptr.asFunction< + late final _clang_annotateTokens = _clang_annotateTokensPtr.asFunction< void Function(CXTranslationUnit, ffi.Pointer, int, ffi.Pointer)>(); @@ -4653,11 +4652,11 @@ class LibClang { ); } - late final _clang_disposeTokens_ptr = _lookup< + late final _clang_disposeTokensPtr = _lookup< ffi.NativeFunction< ffi.Void Function(CXTranslationUnit, ffi.Pointer, ffi.Uint32)>>('clang_disposeTokens'); - late final _clang_disposeTokens = _clang_disposeTokens_ptr.asFunction< + late final _clang_disposeTokens = _clang_disposeTokensPtr.asFunction< void Function(CXTranslationUnit, ffi.Pointer, int)>(); /// These routines are used for testing and debugging, only, and should not be @@ -4670,11 +4669,11 @@ class LibClang { ); } - late final _clang_getCursorKindSpelling_ptr = + late final _clang_getCursorKindSpellingPtr = _lookup>( 'clang_getCursorKindSpelling'); late final _clang_getCursorKindSpelling = - _clang_getCursorKindSpelling_ptr.asFunction(); + _clang_getCursorKindSpellingPtr.asFunction(); void clang_getDefinitionSpellingAndExtent( CXCursor arg0, @@ -4696,7 +4695,7 @@ class LibClang { ); } - late final _clang_getDefinitionSpellingAndExtent_ptr = _lookup< + late final _clang_getDefinitionSpellingAndExtentPtr = _lookup< ffi.NativeFunction< ffi.Void Function( CXCursor, @@ -4708,7 +4707,7 @@ class LibClang { ffi.Pointer)>>( 'clang_getDefinitionSpellingAndExtent'); late final _clang_getDefinitionSpellingAndExtent = - _clang_getDefinitionSpellingAndExtent_ptr.asFunction< + _clang_getDefinitionSpellingAndExtentPtr.asFunction< void Function( CXCursor, ffi.Pointer>, @@ -4722,11 +4721,11 @@ class LibClang { return _clang_enableStackTraces(); } - late final _clang_enableStackTraces_ptr = + late final _clang_enableStackTracesPtr = _lookup>( 'clang_enableStackTraces'); late final _clang_enableStackTraces = - _clang_enableStackTraces_ptr.asFunction(); + _clang_enableStackTracesPtr.asFunction(); void clang_executeOnThread( ffi.Pointer)>> @@ -4741,14 +4740,14 @@ class LibClang { ); } - late final _clang_executeOnThread_ptr = _lookup< + late final _clang_executeOnThreadPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer< ffi.NativeFunction)>>, ffi.Pointer, ffi.Uint32)>>('clang_executeOnThread'); - late final _clang_executeOnThread = _clang_executeOnThread_ptr.asFunction< + late final _clang_executeOnThread = _clang_executeOnThreadPtr.asFunction< void Function( ffi.Pointer< ffi.NativeFunction)>>, @@ -4766,11 +4765,11 @@ class LibClang { ); } - late final _clang_getCompletionChunkKind_ptr = _lookup< + late final _clang_getCompletionChunkKindPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( CXCompletionString, ffi.Uint32)>>('clang_getCompletionChunkKind'); - late final _clang_getCompletionChunkKind = _clang_getCompletionChunkKind_ptr + late final _clang_getCompletionChunkKind = _clang_getCompletionChunkKindPtr .asFunction(); /// Retrieve the text associated with a particular chunk within a completion @@ -4785,11 +4784,11 @@ class LibClang { ); } - late final _clang_getCompletionChunkText_ptr = _lookup< + late final _clang_getCompletionChunkTextPtr = _lookup< ffi.NativeFunction< CXString Function( CXCompletionString, ffi.Uint32)>>('clang_getCompletionChunkText'); - late final _clang_getCompletionChunkText = _clang_getCompletionChunkText_ptr + late final _clang_getCompletionChunkText = _clang_getCompletionChunkTextPtr .asFunction(); /// Retrieve the completion string associated with a particular chunk within a @@ -4804,12 +4803,12 @@ class LibClang { ); } - late final _clang_getCompletionChunkCompletionString_ptr = _lookup< + late final _clang_getCompletionChunkCompletionStringPtr = _lookup< ffi.NativeFunction< CXCompletionString Function(CXCompletionString, ffi.Uint32)>>('clang_getCompletionChunkCompletionString'); late final _clang_getCompletionChunkCompletionString = - _clang_getCompletionChunkCompletionString_ptr + _clang_getCompletionChunkCompletionStringPtr .asFunction(); /// Retrieve the number of chunks in the given code-completion string. @@ -4821,10 +4820,10 @@ class LibClang { ); } - late final _clang_getNumCompletionChunks_ptr = + late final _clang_getNumCompletionChunksPtr = _lookup>( 'clang_getNumCompletionChunks'); - late final _clang_getNumCompletionChunks = _clang_getNumCompletionChunks_ptr + late final _clang_getNumCompletionChunks = _clang_getNumCompletionChunksPtr .asFunction(); /// Determine the priority of this code completion. @@ -4836,10 +4835,10 @@ class LibClang { ); } - late final _clang_getCompletionPriority_ptr = + late final _clang_getCompletionPriorityPtr = _lookup>( 'clang_getCompletionPriority'); - late final _clang_getCompletionPriority = _clang_getCompletionPriority_ptr + late final _clang_getCompletionPriority = _clang_getCompletionPriorityPtr .asFunction(); /// Determine the availability of the entity that this code-completion string @@ -4852,11 +4851,11 @@ class LibClang { ); } - late final _clang_getCompletionAvailability_ptr = + late final _clang_getCompletionAvailabilityPtr = _lookup>( 'clang_getCompletionAvailability'); late final _clang_getCompletionAvailability = - _clang_getCompletionAvailability_ptr + _clang_getCompletionAvailabilityPtr .asFunction(); /// Retrieve the number of annotations associated with the given completion @@ -4869,11 +4868,11 @@ class LibClang { ); } - late final _clang_getCompletionNumAnnotations_ptr = + late final _clang_getCompletionNumAnnotationsPtr = _lookup>( 'clang_getCompletionNumAnnotations'); late final _clang_getCompletionNumAnnotations = - _clang_getCompletionNumAnnotations_ptr + _clang_getCompletionNumAnnotationsPtr .asFunction(); /// Retrieve the annotation associated with the given completion string. @@ -4887,11 +4886,11 @@ class LibClang { ); } - late final _clang_getCompletionAnnotation_ptr = _lookup< + late final _clang_getCompletionAnnotationPtr = _lookup< ffi.NativeFunction< CXString Function(CXCompletionString, ffi.Uint32)>>('clang_getCompletionAnnotation'); - late final _clang_getCompletionAnnotation = _clang_getCompletionAnnotation_ptr + late final _clang_getCompletionAnnotation = _clang_getCompletionAnnotationPtr .asFunction(); /// Retrieve the parent context of the given completion string. @@ -4905,12 +4904,12 @@ class LibClang { ); } - late final _clang_getCompletionParent_ptr = _lookup< + late final _clang_getCompletionParentPtr = _lookup< ffi.NativeFunction< CXString Function(CXCompletionString, ffi.Pointer)>>('clang_getCompletionParent'); late final _clang_getCompletionParent = - _clang_getCompletionParent_ptr.asFunction< + _clang_getCompletionParentPtr.asFunction< CXString Function(CXCompletionString, ffi.Pointer)>(); /// Retrieve the brief documentation comment attached to the declaration that @@ -4923,11 +4922,11 @@ class LibClang { ); } - late final _clang_getCompletionBriefComment_ptr = + late final _clang_getCompletionBriefCommentPtr = _lookup>( 'clang_getCompletionBriefComment'); late final _clang_getCompletionBriefComment = - _clang_getCompletionBriefComment_ptr + _clang_getCompletionBriefCommentPtr .asFunction(); /// Retrieve a completion string for an arbitrary declaration or macro @@ -4940,11 +4939,11 @@ class LibClang { ); } - late final _clang_getCursorCompletionString_ptr = + late final _clang_getCursorCompletionStringPtr = _lookup>( 'clang_getCursorCompletionString'); late final _clang_getCursorCompletionString = - _clang_getCursorCompletionString_ptr + _clang_getCursorCompletionStringPtr .asFunction(); /// Retrieve the number of fix-its for the given completion index. @@ -4958,11 +4957,11 @@ class LibClang { ); } - late final _clang_getCompletionNumFixIts_ptr = _lookup< + late final _clang_getCompletionNumFixItsPtr = _lookup< ffi.NativeFunction< ffi.Uint32 Function(ffi.Pointer, ffi.Uint32)>>('clang_getCompletionNumFixIts'); - late final _clang_getCompletionNumFixIts = _clang_getCompletionNumFixIts_ptr + late final _clang_getCompletionNumFixIts = _clang_getCompletionNumFixItsPtr .asFunction, int)>(); /// Fix-its that *must* be applied before inserting the text for the @@ -4981,7 +4980,7 @@ class LibClang { ); } - late final _clang_getCompletionFixIt_ptr = _lookup< + late final _clang_getCompletionFixItPtr = _lookup< ffi.NativeFunction< CXString Function( ffi.Pointer, @@ -4989,7 +4988,7 @@ class LibClang { ffi.Uint32, ffi.Pointer)>>('clang_getCompletionFixIt'); late final _clang_getCompletionFixIt = - _clang_getCompletionFixIt_ptr.asFunction< + _clang_getCompletionFixItPtr.asFunction< CXString Function(ffi.Pointer, int, int, ffi.Pointer)>(); @@ -4999,11 +4998,11 @@ class LibClang { return _clang_defaultCodeCompleteOptions(); } - late final _clang_defaultCodeCompleteOptions_ptr = + late final _clang_defaultCodeCompleteOptionsPtr = _lookup>( 'clang_defaultCodeCompleteOptions'); late final _clang_defaultCodeCompleteOptions = - _clang_defaultCodeCompleteOptions_ptr.asFunction(); + _clang_defaultCodeCompleteOptionsPtr.asFunction(); /// Perform code completion at a given location in a translation unit. ffi.Pointer clang_codeCompleteAt( @@ -5026,7 +5025,7 @@ class LibClang { ); } - late final _clang_codeCompleteAt_ptr = _lookup< + late final _clang_codeCompleteAtPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( CXTranslationUnit, @@ -5036,7 +5035,7 @@ class LibClang { ffi.Pointer, ffi.Uint32, ffi.Uint32)>>('clang_codeCompleteAt'); - late final _clang_codeCompleteAt = _clang_codeCompleteAt_ptr.asFunction< + late final _clang_codeCompleteAt = _clang_codeCompleteAtPtr.asFunction< ffi.Pointer Function( CXTranslationUnit, ffi.Pointer, @@ -5057,12 +5056,12 @@ class LibClang { ); } - late final _clang_sortCodeCompletionResults_ptr = _lookup< + late final _clang_sortCodeCompletionResultsPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Uint32)>>('clang_sortCodeCompletionResults'); late final _clang_sortCodeCompletionResults = - _clang_sortCodeCompletionResults_ptr + _clang_sortCodeCompletionResultsPtr .asFunction, int)>(); /// Free the given set of code-completion results. @@ -5074,12 +5073,12 @@ class LibClang { ); } - late final _clang_disposeCodeCompleteResults_ptr = _lookup< + late final _clang_disposeCodeCompleteResultsPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer)>>( 'clang_disposeCodeCompleteResults'); late final _clang_disposeCodeCompleteResults = - _clang_disposeCodeCompleteResults_ptr + _clang_disposeCodeCompleteResultsPtr .asFunction)>(); /// Determine the number of diagnostics produced prior to the location where @@ -5092,12 +5091,12 @@ class LibClang { ); } - late final _clang_codeCompleteGetNumDiagnostics_ptr = _lookup< + late final _clang_codeCompleteGetNumDiagnosticsPtr = _lookup< ffi.NativeFunction< ffi.Uint32 Function(ffi.Pointer)>>( 'clang_codeCompleteGetNumDiagnostics'); late final _clang_codeCompleteGetNumDiagnostics = - _clang_codeCompleteGetNumDiagnostics_ptr + _clang_codeCompleteGetNumDiagnosticsPtr .asFunction)>(); /// Retrieve a diagnostic associated with the given code completion. @@ -5111,12 +5110,12 @@ class LibClang { ); } - late final _clang_codeCompleteGetDiagnostic_ptr = _lookup< + late final _clang_codeCompleteGetDiagnosticPtr = _lookup< ffi.NativeFunction< CXDiagnostic Function(ffi.Pointer, ffi.Uint32)>>('clang_codeCompleteGetDiagnostic'); late final _clang_codeCompleteGetDiagnostic = - _clang_codeCompleteGetDiagnostic_ptr.asFunction< + _clang_codeCompleteGetDiagnosticPtr.asFunction< CXDiagnostic Function(ffi.Pointer, int)>(); /// Determines what completions are appropriate for the context the given code @@ -5129,11 +5128,11 @@ class LibClang { ); } - late final _clang_codeCompleteGetContexts_ptr = _lookup< + late final _clang_codeCompleteGetContextsPtr = _lookup< ffi.NativeFunction< ffi.Uint64 Function(ffi.Pointer)>>( 'clang_codeCompleteGetContexts'); - late final _clang_codeCompleteGetContexts = _clang_codeCompleteGetContexts_ptr + late final _clang_codeCompleteGetContexts = _clang_codeCompleteGetContextsPtr .asFunction)>(); /// Returns the cursor kind for the container for the current code completion @@ -5150,12 +5149,12 @@ class LibClang { ); } - late final _clang_codeCompleteGetContainerKind_ptr = _lookup< + late final _clang_codeCompleteGetContainerKindPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('clang_codeCompleteGetContainerKind'); late final _clang_codeCompleteGetContainerKind = - _clang_codeCompleteGetContainerKind_ptr.asFunction< + _clang_codeCompleteGetContainerKindPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer)>(); @@ -5170,12 +5169,12 @@ class LibClang { ); } - late final _clang_codeCompleteGetContainerUSR_ptr = _lookup< + late final _clang_codeCompleteGetContainerUSRPtr = _lookup< ffi.NativeFunction< CXString Function(ffi.Pointer)>>( 'clang_codeCompleteGetContainerUSR'); late final _clang_codeCompleteGetContainerUSR = - _clang_codeCompleteGetContainerUSR_ptr + _clang_codeCompleteGetContainerUSRPtr .asFunction)>(); /// Returns the currently-entered selector for an Objective-C message send, @@ -5190,12 +5189,12 @@ class LibClang { ); } - late final _clang_codeCompleteGetObjCSelector_ptr = _lookup< + late final _clang_codeCompleteGetObjCSelectorPtr = _lookup< ffi.NativeFunction< CXString Function(ffi.Pointer)>>( 'clang_codeCompleteGetObjCSelector'); late final _clang_codeCompleteGetObjCSelector = - _clang_codeCompleteGetObjCSelector_ptr + _clang_codeCompleteGetObjCSelectorPtr .asFunction)>(); /// Return a version string, suitable for showing to a user, but not intended @@ -5204,10 +5203,10 @@ class LibClang { return _clang_getClangVersion(); } - late final _clang_getClangVersion_ptr = + late final _clang_getClangVersionPtr = _lookup>('clang_getClangVersion'); late final _clang_getClangVersion = - _clang_getClangVersion_ptr.asFunction(); + _clang_getClangVersionPtr.asFunction(); /// Enable/disable crash recovery. void clang_toggleCrashRecovery( @@ -5218,11 +5217,11 @@ class LibClang { ); } - late final _clang_toggleCrashRecovery_ptr = + late final _clang_toggleCrashRecoveryPtr = _lookup>( 'clang_toggleCrashRecovery'); late final _clang_toggleCrashRecovery = - _clang_toggleCrashRecovery_ptr.asFunction(); + _clang_toggleCrashRecoveryPtr.asFunction(); /// Visit the set of preprocessor inclusions in a translation unit. The /// visitor function is called with the provided data for every included file. @@ -5240,11 +5239,11 @@ class LibClang { ); } - late final _clang_getInclusions_ptr = _lookup< + late final _clang_getInclusionsPtr = _lookup< ffi.NativeFunction< ffi.Void Function(CXTranslationUnit, CXInclusionVisitor, CXClientData)>>('clang_getInclusions'); - late final _clang_getInclusions = _clang_getInclusions_ptr.asFunction< + late final _clang_getInclusions = _clang_getInclusionsPtr.asFunction< void Function(CXTranslationUnit, CXInclusionVisitor, CXClientData)>(); /// If cursor is a statement declaration tries to evaluate the statement and @@ -5258,11 +5257,11 @@ class LibClang { ); } - late final _clang_Cursor_Evaluate_ptr = + late final _clang_Cursor_EvaluatePtr = _lookup>( 'clang_Cursor_Evaluate'); late final _clang_Cursor_Evaluate = - _clang_Cursor_Evaluate_ptr.asFunction(); + _clang_Cursor_EvaluatePtr.asFunction(); /// Returns the kind of the evaluated result. int clang_EvalResult_getKind( @@ -5273,11 +5272,11 @@ class LibClang { ); } - late final _clang_EvalResult_getKind_ptr = + late final _clang_EvalResult_getKindPtr = _lookup>( 'clang_EvalResult_getKind'); late final _clang_EvalResult_getKind = - _clang_EvalResult_getKind_ptr.asFunction(); + _clang_EvalResult_getKindPtr.asFunction(); /// Returns the evaluation result as integer if the kind is Int. int clang_EvalResult_getAsInt( @@ -5288,11 +5287,11 @@ class LibClang { ); } - late final _clang_EvalResult_getAsInt_ptr = + late final _clang_EvalResult_getAsIntPtr = _lookup>( 'clang_EvalResult_getAsInt'); late final _clang_EvalResult_getAsInt = - _clang_EvalResult_getAsInt_ptr.asFunction(); + _clang_EvalResult_getAsIntPtr.asFunction(); /// 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 @@ -5305,11 +5304,11 @@ class LibClang { ); } - late final _clang_EvalResult_getAsLongLong_ptr = + late final _clang_EvalResult_getAsLongLongPtr = _lookup>( 'clang_EvalResult_getAsLongLong'); late final _clang_EvalResult_getAsLongLong = - _clang_EvalResult_getAsLongLong_ptr + _clang_EvalResult_getAsLongLongPtr .asFunction(); /// Returns a non-zero value if the kind is Int and the evaluation result @@ -5322,11 +5321,11 @@ class LibClang { ); } - late final _clang_EvalResult_isUnsignedInt_ptr = + late final _clang_EvalResult_isUnsignedIntPtr = _lookup>( 'clang_EvalResult_isUnsignedInt'); late final _clang_EvalResult_isUnsignedInt = - _clang_EvalResult_isUnsignedInt_ptr + _clang_EvalResult_isUnsignedIntPtr .asFunction(); /// Returns the evaluation result as an unsigned integer if the kind is Int @@ -5339,11 +5338,11 @@ class LibClang { ); } - late final _clang_EvalResult_getAsUnsigned_ptr = + late final _clang_EvalResult_getAsUnsignedPtr = _lookup>( 'clang_EvalResult_getAsUnsigned'); late final _clang_EvalResult_getAsUnsigned = - _clang_EvalResult_getAsUnsigned_ptr + _clang_EvalResult_getAsUnsignedPtr .asFunction(); /// Returns the evaluation result as double if the kind is double. @@ -5355,10 +5354,10 @@ class LibClang { ); } - late final _clang_EvalResult_getAsDouble_ptr = + late final _clang_EvalResult_getAsDoublePtr = _lookup>( 'clang_EvalResult_getAsDouble'); - late final _clang_EvalResult_getAsDouble = _clang_EvalResult_getAsDouble_ptr + late final _clang_EvalResult_getAsDouble = _clang_EvalResult_getAsDoublePtr .asFunction(); /// Returns the evaluation result as a constant string if the kind is other @@ -5373,10 +5372,10 @@ class LibClang { ); } - late final _clang_EvalResult_getAsStr_ptr = + late final _clang_EvalResult_getAsStrPtr = _lookup Function(CXEvalResult)>>( 'clang_EvalResult_getAsStr'); - late final _clang_EvalResult_getAsStr = _clang_EvalResult_getAsStr_ptr + late final _clang_EvalResult_getAsStr = _clang_EvalResult_getAsStrPtr .asFunction Function(CXEvalResult)>(); /// Disposes the created Eval memory. @@ -5388,11 +5387,11 @@ class LibClang { ); } - late final _clang_EvalResult_dispose_ptr = + late final _clang_EvalResult_disposePtr = _lookup>( 'clang_EvalResult_dispose'); late final _clang_EvalResult_dispose = - _clang_EvalResult_dispose_ptr.asFunction(); + _clang_EvalResult_disposePtr.asFunction(); /// Retrieve a remapping. CXRemapping clang_getRemappings( @@ -5403,10 +5402,10 @@ class LibClang { ); } - late final _clang_getRemappings_ptr = + late final _clang_getRemappingsPtr = _lookup)>>( 'clang_getRemappings'); - late final _clang_getRemappings = _clang_getRemappings_ptr + late final _clang_getRemappings = _clang_getRemappingsPtr .asFunction)>(); /// Retrieve a remapping. @@ -5420,12 +5419,12 @@ class LibClang { ); } - late final _clang_getRemappingsFromFileList_ptr = _lookup< + late final _clang_getRemappingsFromFileListPtr = _lookup< ffi.NativeFunction< CXRemapping Function(ffi.Pointer>, ffi.Uint32)>>('clang_getRemappingsFromFileList'); late final _clang_getRemappingsFromFileList = - _clang_getRemappingsFromFileList_ptr.asFunction< + _clang_getRemappingsFromFileListPtr.asFunction< CXRemapping Function(ffi.Pointer>, int)>(); /// Determine the number of remappings. @@ -5437,11 +5436,11 @@ class LibClang { ); } - late final _clang_remap_getNumFiles_ptr = + late final _clang_remap_getNumFilesPtr = _lookup>( 'clang_remap_getNumFiles'); late final _clang_remap_getNumFiles = - _clang_remap_getNumFiles_ptr.asFunction(); + _clang_remap_getNumFilesPtr.asFunction(); /// Get the original and the associated filename from the remapping. void clang_remap_getFilenames( @@ -5458,12 +5457,12 @@ class LibClang { ); } - late final _clang_remap_getFilenames_ptr = _lookup< + late final _clang_remap_getFilenamesPtr = _lookup< ffi.NativeFunction< ffi.Void Function(CXRemapping, ffi.Uint32, ffi.Pointer, ffi.Pointer)>>('clang_remap_getFilenames'); late final _clang_remap_getFilenames = - _clang_remap_getFilenames_ptr.asFunction< + _clang_remap_getFilenamesPtr.asFunction< void Function(CXRemapping, int, ffi.Pointer, ffi.Pointer)>(); @@ -5476,11 +5475,11 @@ class LibClang { ); } - late final _clang_remap_dispose_ptr = + late final _clang_remap_disposePtr = _lookup>( 'clang_remap_dispose'); late final _clang_remap_dispose = - _clang_remap_dispose_ptr.asFunction(); + _clang_remap_disposePtr.asFunction(); /// Find references of a declaration in a specific file. int clang_findReferencesInFile( @@ -5495,11 +5494,11 @@ class LibClang { ); } - late final _clang_findReferencesInFile_ptr = _lookup< + late final _clang_findReferencesInFilePtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(CXCursor, CXFile, CXCursorAndRangeVisitor)>>('clang_findReferencesInFile'); - late final _clang_findReferencesInFile = _clang_findReferencesInFile_ptr + late final _clang_findReferencesInFile = _clang_findReferencesInFilePtr .asFunction(); /// Find #import/#include directives in a specific file. @@ -5515,12 +5514,12 @@ class LibClang { ); } - late final _clang_findIncludesInFile_ptr = _lookup< + late final _clang_findIncludesInFilePtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(CXTranslationUnit, CXFile, CXCursorAndRangeVisitor)>>('clang_findIncludesInFile'); late final _clang_findIncludesInFile = - _clang_findIncludesInFile_ptr.asFunction< + _clang_findIncludesInFilePtr.asFunction< int Function(CXTranslationUnit, CXFile, CXCursorAndRangeVisitor)>(); int clang_index_isEntityObjCContainerKind( @@ -5531,12 +5530,11 @@ class LibClang { ); } - late final _clang_index_isEntityObjCContainerKind_ptr = + late final _clang_index_isEntityObjCContainerKindPtr = _lookup>( 'clang_index_isEntityObjCContainerKind'); late final _clang_index_isEntityObjCContainerKind = - _clang_index_isEntityObjCContainerKind_ptr - .asFunction(); + _clang_index_isEntityObjCContainerKindPtr.asFunction(); ffi.Pointer clang_index_getObjCContainerDeclInfo( ffi.Pointer arg0, @@ -5546,13 +5544,13 @@ class LibClang { ); } - late final _clang_index_getObjCContainerDeclInfo_ptr = _lookup< + late final _clang_index_getObjCContainerDeclInfoPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>( 'clang_index_getObjCContainerDeclInfo'); late final _clang_index_getObjCContainerDeclInfo = - _clang_index_getObjCContainerDeclInfo_ptr.asFunction< + _clang_index_getObjCContainerDeclInfoPtr.asFunction< ffi.Pointer Function( ffi.Pointer)>(); @@ -5564,13 +5562,13 @@ class LibClang { ); } - late final _clang_index_getObjCInterfaceDeclInfo_ptr = _lookup< + late final _clang_index_getObjCInterfaceDeclInfoPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>( 'clang_index_getObjCInterfaceDeclInfo'); late final _clang_index_getObjCInterfaceDeclInfo = - _clang_index_getObjCInterfaceDeclInfo_ptr.asFunction< + _clang_index_getObjCInterfaceDeclInfoPtr.asFunction< ffi.Pointer Function( ffi.Pointer)>(); @@ -5582,13 +5580,13 @@ class LibClang { ); } - late final _clang_index_getObjCCategoryDeclInfo_ptr = _lookup< + late final _clang_index_getObjCCategoryDeclInfoPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>( 'clang_index_getObjCCategoryDeclInfo'); late final _clang_index_getObjCCategoryDeclInfo = - _clang_index_getObjCCategoryDeclInfo_ptr.asFunction< + _clang_index_getObjCCategoryDeclInfoPtr.asFunction< ffi.Pointer Function( ffi.Pointer)>(); @@ -5601,13 +5599,13 @@ class LibClang { ); } - late final _clang_index_getObjCProtocolRefListInfo_ptr = _lookup< + late final _clang_index_getObjCProtocolRefListInfoPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>( 'clang_index_getObjCProtocolRefListInfo'); late final _clang_index_getObjCProtocolRefListInfo = - _clang_index_getObjCProtocolRefListInfo_ptr.asFunction< + _clang_index_getObjCProtocolRefListInfoPtr.asFunction< ffi.Pointer Function( ffi.Pointer)>(); @@ -5619,13 +5617,13 @@ class LibClang { ); } - late final _clang_index_getObjCPropertyDeclInfo_ptr = _lookup< + late final _clang_index_getObjCPropertyDeclInfoPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>( 'clang_index_getObjCPropertyDeclInfo'); late final _clang_index_getObjCPropertyDeclInfo = - _clang_index_getObjCPropertyDeclInfo_ptr.asFunction< + _clang_index_getObjCPropertyDeclInfoPtr.asFunction< ffi.Pointer Function( ffi.Pointer)>(); @@ -5638,13 +5636,13 @@ class LibClang { ); } - late final _clang_index_getIBOutletCollectionAttrInfo_ptr = _lookup< + late final _clang_index_getIBOutletCollectionAttrInfoPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>( 'clang_index_getIBOutletCollectionAttrInfo'); late final _clang_index_getIBOutletCollectionAttrInfo = - _clang_index_getIBOutletCollectionAttrInfo_ptr.asFunction< + _clang_index_getIBOutletCollectionAttrInfoPtr.asFunction< ffi.Pointer Function( ffi.Pointer)>(); @@ -5656,12 +5654,12 @@ class LibClang { ); } - late final _clang_index_getCXXClassDeclInfo_ptr = _lookup< + late final _clang_index_getCXXClassDeclInfoPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('clang_index_getCXXClassDeclInfo'); late final _clang_index_getCXXClassDeclInfo = - _clang_index_getCXXClassDeclInfo_ptr.asFunction< + _clang_index_getCXXClassDeclInfoPtr.asFunction< ffi.Pointer Function( ffi.Pointer)>(); @@ -5674,12 +5672,12 @@ class LibClang { ); } - late final _clang_index_getClientContainer_ptr = _lookup< + late final _clang_index_getClientContainerPtr = _lookup< ffi.NativeFunction< CXIdxClientContainer Function(ffi.Pointer)>>( 'clang_index_getClientContainer'); late final _clang_index_getClientContainer = - _clang_index_getClientContainer_ptr.asFunction< + _clang_index_getClientContainerPtr.asFunction< CXIdxClientContainer Function(ffi.Pointer)>(); /// For setting a custom CXIdxClientContainer attached to a container. @@ -5693,12 +5691,12 @@ class LibClang { ); } - late final _clang_index_setClientContainer_ptr = _lookup< + late final _clang_index_setClientContainerPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, CXIdxClientContainer)>>('clang_index_setClientContainer'); late final _clang_index_setClientContainer = - _clang_index_setClientContainer_ptr.asFunction< + _clang_index_setClientContainerPtr.asFunction< void Function( ffi.Pointer, CXIdxClientContainer)>(); @@ -5711,11 +5709,11 @@ class LibClang { ); } - late final _clang_index_getClientEntity_ptr = _lookup< + late final _clang_index_getClientEntityPtr = _lookup< ffi.NativeFunction< CXIdxClientEntity Function( ffi.Pointer)>>('clang_index_getClientEntity'); - late final _clang_index_getClientEntity = _clang_index_getClientEntity_ptr + late final _clang_index_getClientEntity = _clang_index_getClientEntityPtr .asFunction)>(); /// For setting a custom CXIdxClientEntity attached to an entity. @@ -5729,12 +5727,12 @@ class LibClang { ); } - late final _clang_index_setClientEntity_ptr = _lookup< + late final _clang_index_setClientEntityPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, CXIdxClientEntity)>>('clang_index_setClientEntity'); late final _clang_index_setClientEntity = - _clang_index_setClientEntity_ptr.asFunction< + _clang_index_setClientEntityPtr.asFunction< void Function(ffi.Pointer, CXIdxClientEntity)>(); /// An indexing action/session, to be applied to one or multiple translation @@ -5747,10 +5745,10 @@ class LibClang { ); } - late final _clang_IndexAction_create_ptr = + late final _clang_IndexAction_createPtr = _lookup>( 'clang_IndexAction_create'); - late final _clang_IndexAction_create = _clang_IndexAction_create_ptr + late final _clang_IndexAction_create = _clang_IndexAction_createPtr .asFunction(); /// Destroy the given index action. @@ -5762,11 +5760,11 @@ class LibClang { ); } - late final _clang_IndexAction_dispose_ptr = + late final _clang_IndexAction_disposePtr = _lookup>( 'clang_IndexAction_dispose'); late final _clang_IndexAction_dispose = - _clang_IndexAction_dispose_ptr.asFunction(); + _clang_IndexAction_disposePtr.asFunction(); /// Index the given source file and the translation unit corresponding to that /// file via callbacks implemented through #IndexerCallbacks. @@ -5800,7 +5798,7 @@ class LibClang { ); } - late final _clang_indexSourceFile_ptr = _lookup< + late final _clang_indexSourceFilePtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( CXIndexAction, @@ -5815,7 +5813,7 @@ class LibClang { ffi.Uint32, ffi.Pointer, ffi.Uint32)>>('clang_indexSourceFile'); - late final _clang_indexSourceFile = _clang_indexSourceFile_ptr.asFunction< + late final _clang_indexSourceFile = _clang_indexSourceFilePtr.asFunction< int Function( CXIndexAction, CXClientData, @@ -5863,7 +5861,7 @@ class LibClang { ); } - late final _clang_indexSourceFileFullArgv_ptr = _lookup< + late final _clang_indexSourceFileFullArgvPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( CXIndexAction, @@ -5879,7 +5877,7 @@ class LibClang { ffi.Pointer, ffi.Uint32)>>('clang_indexSourceFileFullArgv'); late final _clang_indexSourceFileFullArgv = - _clang_indexSourceFileFullArgv_ptr.asFunction< + _clang_indexSourceFileFullArgvPtr.asFunction< int Function( CXIndexAction, CXClientData, @@ -5914,7 +5912,7 @@ class LibClang { ); } - late final _clang_indexTranslationUnit_ptr = _lookup< + late final _clang_indexTranslationUnitPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( CXIndexAction, @@ -5924,7 +5922,7 @@ class LibClang { ffi.Uint32, CXTranslationUnit)>>('clang_indexTranslationUnit'); late final _clang_indexTranslationUnit = - _clang_indexTranslationUnit_ptr.asFunction< + _clang_indexTranslationUnitPtr.asFunction< int Function(CXIndexAction, CXClientData, ffi.Pointer, int, int, CXTranslationUnit)>(); @@ -5948,7 +5946,7 @@ class LibClang { ); } - late final _clang_indexLoc_getFileLocation_ptr = _lookup< + late final _clang_indexLoc_getFileLocationPtr = _lookup< ffi.NativeFunction< ffi.Void Function( CXIdxLoc, @@ -5958,7 +5956,7 @@ class LibClang { ffi.Pointer, ffi.Pointer)>>('clang_indexLoc_getFileLocation'); late final _clang_indexLoc_getFileLocation = - _clang_indexLoc_getFileLocation_ptr.asFunction< + _clang_indexLoc_getFileLocationPtr.asFunction< void Function( CXIdxLoc, ffi.Pointer, @@ -5976,11 +5974,11 @@ class LibClang { ); } - late final _clang_indexLoc_getCXSourceLocation_ptr = + late final _clang_indexLoc_getCXSourceLocationPtr = _lookup>( 'clang_indexLoc_getCXSourceLocation'); late final _clang_indexLoc_getCXSourceLocation = - _clang_indexLoc_getCXSourceLocation_ptr + _clang_indexLoc_getCXSourceLocationPtr .asFunction(); /// Visit the fields of a particular type. @@ -5996,11 +5994,11 @@ class LibClang { ); } - late final _clang_Type_visitFields_ptr = _lookup< + late final _clang_Type_visitFieldsPtr = _lookup< ffi.NativeFunction< ffi.Uint32 Function( CXType, CXFieldVisitor, CXClientData)>>('clang_Type_visitFields'); - late final _clang_Type_visitFields = _clang_Type_visitFields_ptr + late final _clang_Type_visitFields = _clang_Type_visitFieldsPtr .asFunction(); } diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index b8b13ed528..2980faa192 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -1,3 +1,5 @@ +// ignore_for_file: camel_case_types, non_constant_identifier_names + // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. @@ -60,31 +62,31 @@ class SQLite { return _sqlite3_libversion(); } - late final _sqlite3_libversion_ptr = + late final _sqlite3_libversionPtr = _lookup Function()>>( 'sqlite3_libversion'); late final _sqlite3_libversion = - _sqlite3_libversion_ptr.asFunction Function()>(); + _sqlite3_libversionPtr.asFunction Function()>(); ffi.Pointer sqlite3_sourceid() { return _sqlite3_sourceid(); } - late final _sqlite3_sourceid_ptr = + late final _sqlite3_sourceidPtr = _lookup Function()>>( 'sqlite3_sourceid'); late final _sqlite3_sourceid = - _sqlite3_sourceid_ptr.asFunction Function()>(); + _sqlite3_sourceidPtr.asFunction Function()>(); int sqlite3_libversion_number() { return _sqlite3_libversion_number(); } - late final _sqlite3_libversion_number_ptr = + late final _sqlite3_libversion_numberPtr = _lookup>( 'sqlite3_libversion_number'); late final _sqlite3_libversion_number = - _sqlite3_libversion_number_ptr.asFunction(); + _sqlite3_libversion_numberPtr.asFunction(); int sqlite3_compileoption_used( ffi.Pointer zOptName, @@ -94,10 +96,10 @@ class SQLite { ); } - late final _sqlite3_compileoption_used_ptr = + late final _sqlite3_compileoption_usedPtr = _lookup)>>( 'sqlite3_compileoption_used'); - late final _sqlite3_compileoption_used = _sqlite3_compileoption_used_ptr + late final _sqlite3_compileoption_used = _sqlite3_compileoption_usedPtr .asFunction)>(); ffi.Pointer sqlite3_compileoption_get( @@ -108,10 +110,10 @@ class SQLite { ); } - late final _sqlite3_compileoption_get_ptr = + late final _sqlite3_compileoption_getPtr = _lookup Function(ffi.Int32)>>( 'sqlite3_compileoption_get'); - late final _sqlite3_compileoption_get = _sqlite3_compileoption_get_ptr + late final _sqlite3_compileoption_get = _sqlite3_compileoption_getPtr .asFunction Function(int)>(); /// CAPI3REF: Test To See If The Library Is Threadsafe @@ -152,10 +154,10 @@ class SQLite { return _sqlite3_threadsafe(); } - late final _sqlite3_threadsafe_ptr = + late final _sqlite3_threadsafePtr = _lookup>('sqlite3_threadsafe'); late final _sqlite3_threadsafe = - _sqlite3_threadsafe_ptr.asFunction(); + _sqlite3_threadsafePtr.asFunction(); /// CAPI3REF: Closing A Database Connection /// DESTRUCTOR: sqlite3 @@ -201,11 +203,11 @@ class SQLite { ); } - late final _sqlite3_close_ptr = + late final _sqlite3_closePtr = _lookup)>>( 'sqlite3_close'); late final _sqlite3_close = - _sqlite3_close_ptr.asFunction)>(); + _sqlite3_closePtr.asFunction)>(); int sqlite3_close_v2( ffi.Pointer arg0, @@ -215,11 +217,11 @@ class SQLite { ); } - late final _sqlite3_close_v2_ptr = + late final _sqlite3_close_v2Ptr = _lookup)>>( 'sqlite3_close_v2'); late final _sqlite3_close_v2 = - _sqlite3_close_v2_ptr.asFunction)>(); + _sqlite3_close_v2Ptr.asFunction)>(); /// CAPI3REF: One-Step Query Execution Interface /// METHOD: sqlite3 @@ -304,7 +306,7 @@ class SQLite { ); } - late final _sqlite3_exec_ptr = _lookup< + late final _sqlite3_execPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -318,7 +320,7 @@ class SQLite { ffi.Pointer>)>>, ffi.Pointer, ffi.Pointer>)>>('sqlite3_exec'); - late final _sqlite3_exec = _sqlite3_exec_ptr.asFunction< + late final _sqlite3_exec = _sqlite3_execPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -409,36 +411,36 @@ class SQLite { return _sqlite3_initialize(); } - late final _sqlite3_initialize_ptr = + late final _sqlite3_initializePtr = _lookup>('sqlite3_initialize'); late final _sqlite3_initialize = - _sqlite3_initialize_ptr.asFunction(); + _sqlite3_initializePtr.asFunction(); int sqlite3_shutdown() { return _sqlite3_shutdown(); } - late final _sqlite3_shutdown_ptr = + late final _sqlite3_shutdownPtr = _lookup>('sqlite3_shutdown'); late final _sqlite3_shutdown = - _sqlite3_shutdown_ptr.asFunction(); + _sqlite3_shutdownPtr.asFunction(); int sqlite3_os_init() { return _sqlite3_os_init(); } - late final _sqlite3_os_init_ptr = + late final _sqlite3_os_initPtr = _lookup>('sqlite3_os_init'); late final _sqlite3_os_init = - _sqlite3_os_init_ptr.asFunction(); + _sqlite3_os_initPtr.asFunction(); int sqlite3_os_end() { return _sqlite3_os_end(); } - late final _sqlite3_os_end_ptr = + late final _sqlite3_os_endPtr = _lookup>('sqlite3_os_end'); - late final _sqlite3_os_end = _sqlite3_os_end_ptr.asFunction(); + late final _sqlite3_os_end = _sqlite3_os_endPtr.asFunction(); /// CAPI3REF: Configuring The SQLite Library /// @@ -477,11 +479,11 @@ class SQLite { ); } - late final _sqlite3_config_ptr = + late final _sqlite3_configPtr = _lookup>( 'sqlite3_config'); late final _sqlite3_config = - _sqlite3_config_ptr.asFunction(); + _sqlite3_configPtr.asFunction(); /// CAPI3REF: Configure database connections /// METHOD: sqlite3 @@ -508,11 +510,11 @@ class SQLite { ); } - late final _sqlite3_db_config_ptr = _lookup< + late final _sqlite3_db_configPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Int32)>>('sqlite3_db_config'); - late final _sqlite3_db_config = _sqlite3_db_config_ptr + late final _sqlite3_db_config = _sqlite3_db_configPtr .asFunction, int)>(); /// CAPI3REF: Enable Or Disable Extended Result Codes @@ -531,11 +533,11 @@ class SQLite { ); } - late final _sqlite3_extended_result_codes_ptr = _lookup< + late final _sqlite3_extended_result_codesPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Int32)>>('sqlite3_extended_result_codes'); - late final _sqlite3_extended_result_codes = _sqlite3_extended_result_codes_ptr + late final _sqlite3_extended_result_codes = _sqlite3_extended_result_codesPtr .asFunction, int)>(); /// CAPI3REF: Last Insert Rowid @@ -604,10 +606,10 @@ class SQLite { ); } - late final _sqlite3_last_insert_rowid_ptr = + late final _sqlite3_last_insert_rowidPtr = _lookup)>>( 'sqlite3_last_insert_rowid'); - late final _sqlite3_last_insert_rowid = _sqlite3_last_insert_rowid_ptr + late final _sqlite3_last_insert_rowid = _sqlite3_last_insert_rowidPtr .asFunction)>(); /// CAPI3REF: Set the Last Insert Rowid value. @@ -626,11 +628,11 @@ class SQLite { ); } - late final _sqlite3_set_last_insert_rowid_ptr = _lookup< + late final _sqlite3_set_last_insert_rowidPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, sqlite3_int64)>>('sqlite3_set_last_insert_rowid'); - late final _sqlite3_set_last_insert_rowid = _sqlite3_set_last_insert_rowid_ptr + late final _sqlite3_set_last_insert_rowid = _sqlite3_set_last_insert_rowidPtr .asFunction, int)>(); /// CAPI3REF: Count The Number Of Rows Modified @@ -695,11 +697,11 @@ class SQLite { ); } - late final _sqlite3_changes_ptr = + late final _sqlite3_changesPtr = _lookup)>>( 'sqlite3_changes'); late final _sqlite3_changes = - _sqlite3_changes_ptr.asFunction)>(); + _sqlite3_changesPtr.asFunction)>(); /// CAPI3REF: Total Number Of Rows Modified /// METHOD: sqlite3 @@ -742,10 +744,10 @@ class SQLite { ); } - late final _sqlite3_total_changes_ptr = + late final _sqlite3_total_changesPtr = _lookup)>>( 'sqlite3_total_changes'); - late final _sqlite3_total_changes = _sqlite3_total_changes_ptr + late final _sqlite3_total_changes = _sqlite3_total_changesPtr .asFunction)>(); /// CAPI3REF: Interrupt A Long-Running Query @@ -789,11 +791,11 @@ class SQLite { ); } - late final _sqlite3_interrupt_ptr = + late final _sqlite3_interruptPtr = _lookup)>>( 'sqlite3_interrupt'); late final _sqlite3_interrupt = - _sqlite3_interrupt_ptr.asFunction)>(); + _sqlite3_interruptPtr.asFunction)>(); /// CAPI3REF: Determine If An SQL Statement Is Complete /// @@ -834,11 +836,11 @@ class SQLite { ); } - late final _sqlite3_complete_ptr = + late final _sqlite3_completePtr = _lookup)>>( 'sqlite3_complete'); late final _sqlite3_complete = - _sqlite3_complete_ptr.asFunction)>(); + _sqlite3_completePtr.asFunction)>(); int sqlite3_complete16( ffi.Pointer sql, @@ -848,11 +850,11 @@ class SQLite { ); } - late final _sqlite3_complete16_ptr = + late final _sqlite3_complete16Ptr = _lookup)>>( 'sqlite3_complete16'); late final _sqlite3_complete16 = - _sqlite3_complete16_ptr.asFunction)>(); + _sqlite3_complete16Ptr.asFunction)>(); /// CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors /// KEYWORDS: {busy-handler callback} {busy handler} @@ -926,7 +928,7 @@ class SQLite { ); } - late final _sqlite3_busy_handler_ptr = _lookup< + late final _sqlite3_busy_handlerPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -934,7 +936,7 @@ class SQLite { ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Int32)>>, ffi.Pointer)>>('sqlite3_busy_handler'); - late final _sqlite3_busy_handler = _sqlite3_busy_handler_ptr.asFunction< + late final _sqlite3_busy_handler = _sqlite3_busy_handlerPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer< @@ -971,11 +973,11 @@ class SQLite { ); } - late final _sqlite3_busy_timeout_ptr = _lookup< + late final _sqlite3_busy_timeoutPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Int32)>>('sqlite3_busy_timeout'); - late final _sqlite3_busy_timeout = _sqlite3_busy_timeout_ptr + late final _sqlite3_busy_timeout = _sqlite3_busy_timeoutPtr .asFunction, int)>(); /// CAPI3REF: Convenience Routines For Running Queries @@ -1067,7 +1069,7 @@ class SQLite { ); } - late final _sqlite3_get_table_ptr = _lookup< + late final _sqlite3_get_tablePtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -1076,7 +1078,7 @@ class SQLite { ffi.Pointer, ffi.Pointer, ffi.Pointer>)>>('sqlite3_get_table'); - late final _sqlite3_get_table = _sqlite3_get_table_ptr.asFunction< + late final _sqlite3_get_table = _sqlite3_get_tablePtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -1093,11 +1095,11 @@ class SQLite { ); } - late final _sqlite3_free_table_ptr = _lookup< + late final _sqlite3_free_tablePtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer>)>>('sqlite3_free_table'); - late final _sqlite3_free_table = _sqlite3_free_table_ptr + late final _sqlite3_free_table = _sqlite3_free_tablePtr .asFunction>)>(); /// CAPI3REF: Formatted String Printing Functions @@ -1146,11 +1148,11 @@ class SQLite { ); } - late final _sqlite3_mprintf_ptr = _lookup< + late final _sqlite3_mprintfPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_mprintf'); - late final _sqlite3_mprintf = _sqlite3_mprintf_ptr + late final _sqlite3_mprintf = _sqlite3_mprintfPtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_snprintf( @@ -1165,11 +1167,11 @@ class SQLite { ); } - late final _sqlite3_snprintf_ptr = _lookup< + late final _sqlite3_snprintfPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Int32, ffi.Pointer, ffi.Pointer)>>('sqlite3_snprintf'); - late final _sqlite3_snprintf = _sqlite3_snprintf_ptr.asFunction< + late final _sqlite3_snprintf = _sqlite3_snprintfPtr.asFunction< ffi.Pointer Function( int, ffi.Pointer, ffi.Pointer)>(); @@ -1254,11 +1256,11 @@ class SQLite { ); } - late final _sqlite3_malloc_ptr = + late final _sqlite3_mallocPtr = _lookup Function(ffi.Int32)>>( 'sqlite3_malloc'); late final _sqlite3_malloc = - _sqlite3_malloc_ptr.asFunction Function(int)>(); + _sqlite3_mallocPtr.asFunction Function(int)>(); ffi.Pointer sqlite3_malloc64( int arg0, @@ -1268,11 +1270,11 @@ class SQLite { ); } - late final _sqlite3_malloc64_ptr = _lookup< + late final _sqlite3_malloc64Ptr = _lookup< ffi.NativeFunction Function(sqlite3_uint64)>>( 'sqlite3_malloc64'); late final _sqlite3_malloc64 = - _sqlite3_malloc64_ptr.asFunction Function(int)>(); + _sqlite3_malloc64Ptr.asFunction Function(int)>(); ffi.Pointer sqlite3_realloc( ffi.Pointer arg0, @@ -1284,11 +1286,11 @@ class SQLite { ); } - late final _sqlite3_realloc_ptr = _lookup< + late final _sqlite3_reallocPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Int32)>>('sqlite3_realloc'); - late final _sqlite3_realloc = _sqlite3_realloc_ptr + late final _sqlite3_realloc = _sqlite3_reallocPtr .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_realloc64( @@ -1301,11 +1303,11 @@ class SQLite { ); } - late final _sqlite3_realloc64_ptr = _lookup< + late final _sqlite3_realloc64Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, sqlite3_uint64)>>('sqlite3_realloc64'); - late final _sqlite3_realloc64 = _sqlite3_realloc64_ptr + late final _sqlite3_realloc64 = _sqlite3_realloc64Ptr .asFunction Function(ffi.Pointer, int)>(); void sqlite3_free( @@ -1316,11 +1318,11 @@ class SQLite { ); } - late final _sqlite3_free_ptr = + late final _sqlite3_freePtr = _lookup)>>( 'sqlite3_free'); late final _sqlite3_free = - _sqlite3_free_ptr.asFunction)>(); + _sqlite3_freePtr.asFunction)>(); int sqlite3_msize( ffi.Pointer arg0, @@ -1330,11 +1332,11 @@ class SQLite { ); } - late final _sqlite3_msize_ptr = _lookup< + late final _sqlite3_msizePtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_msize'); late final _sqlite3_msize = - _sqlite3_msize_ptr.asFunction)>(); + _sqlite3_msizePtr.asFunction)>(); /// CAPI3REF: Memory Allocator Statistics /// @@ -1361,11 +1363,11 @@ class SQLite { return _sqlite3_memory_used(); } - late final _sqlite3_memory_used_ptr = + late final _sqlite3_memory_usedPtr = _lookup>( 'sqlite3_memory_used'); late final _sqlite3_memory_used = - _sqlite3_memory_used_ptr.asFunction(); + _sqlite3_memory_usedPtr.asFunction(); int sqlite3_memory_highwater( int resetFlag, @@ -1375,11 +1377,11 @@ class SQLite { ); } - late final _sqlite3_memory_highwater_ptr = + late final _sqlite3_memory_highwaterPtr = _lookup>( 'sqlite3_memory_highwater'); late final _sqlite3_memory_highwater = - _sqlite3_memory_highwater_ptr.asFunction(); + _sqlite3_memory_highwaterPtr.asFunction(); /// CAPI3REF: Pseudo-Random Number Generator /// @@ -1410,11 +1412,11 @@ class SQLite { ); } - late final _sqlite3_randomness_ptr = _lookup< + late final _sqlite3_randomnessPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int32, ffi.Pointer)>>('sqlite3_randomness'); - late final _sqlite3_randomness = _sqlite3_randomness_ptr + late final _sqlite3_randomness = _sqlite3_randomnessPtr .asFunction)>(); /// CAPI3REF: Compile-Time Authorization Callbacks @@ -1525,7 +1527,7 @@ class SQLite { ); } - late final _sqlite3_set_authorizer_ptr = _lookup< + late final _sqlite3_set_authorizerPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -1539,7 +1541,7 @@ class SQLite { ffi.Pointer, ffi.Pointer)>>, ffi.Pointer)>>('sqlite3_set_authorizer'); - late final _sqlite3_set_authorizer = _sqlite3_set_authorizer_ptr.asFunction< + late final _sqlite3_set_authorizer = _sqlite3_set_authorizerPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer< @@ -1599,7 +1601,7 @@ class SQLite { ); } - late final _sqlite3_trace_ptr = _lookup< + late final _sqlite3_tracePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, @@ -1608,7 +1610,7 @@ class SQLite { ffi.Void Function( ffi.Pointer, ffi.Pointer)>>, ffi.Pointer)>>('sqlite3_trace'); - late final _sqlite3_trace = _sqlite3_trace_ptr.asFunction< + late final _sqlite3_trace = _sqlite3_tracePtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer< @@ -1633,7 +1635,7 @@ class SQLite { ); } - late final _sqlite3_profile_ptr = _lookup< + late final _sqlite3_profilePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, @@ -1642,7 +1644,7 @@ class SQLite { ffi.Void Function(ffi.Pointer, ffi.Pointer, sqlite3_uint64)>>, ffi.Pointer)>>('sqlite3_profile'); - late final _sqlite3_profile = _sqlite3_profile_ptr.asFunction< + late final _sqlite3_profile = _sqlite3_profilePtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer< @@ -1696,7 +1698,7 @@ class SQLite { ); } - late final _sqlite3_trace_v2_ptr = _lookup< + late final _sqlite3_trace_v2Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -1706,7 +1708,7 @@ class SQLite { ffi.Int32 Function(ffi.Uint32, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>, ffi.Pointer)>>('sqlite3_trace_v2'); - late final _sqlite3_trace_v2 = _sqlite3_trace_v2_ptr.asFunction< + late final _sqlite3_trace_v2 = _sqlite3_trace_v2Ptr.asFunction< int Function( ffi.Pointer, int, @@ -1760,7 +1762,7 @@ class SQLite { ); } - late final _sqlite3_progress_handler_ptr = _lookup< + late final _sqlite3_progress_handlerPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -1770,7 +1772,7 @@ class SQLite { ffi.Int32 Function(ffi.Pointer)>>, ffi.Pointer)>>('sqlite3_progress_handler'); late final _sqlite3_progress_handler = - _sqlite3_progress_handler_ptr.asFunction< + _sqlite3_progress_handlerPtr.asFunction< void Function( ffi.Pointer, int, @@ -2040,11 +2042,11 @@ class SQLite { ); } - late final _sqlite3_open_ptr = _lookup< + late final _sqlite3_openPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer>)>>('sqlite3_open'); - late final _sqlite3_open = _sqlite3_open_ptr.asFunction< + late final _sqlite3_open = _sqlite3_openPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer>)>(); int sqlite3_open16( @@ -2057,11 +2059,11 @@ class SQLite { ); } - late final _sqlite3_open16_ptr = _lookup< + late final _sqlite3_open16Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer>)>>('sqlite3_open16'); - late final _sqlite3_open16 = _sqlite3_open16_ptr.asFunction< + late final _sqlite3_open16 = _sqlite3_open16Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer>)>(); int sqlite3_open_v2( @@ -2078,14 +2080,14 @@ class SQLite { ); } - late final _sqlite3_open_v2_ptr = _lookup< + late final _sqlite3_open_v2Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Pointer>, ffi.Int32, ffi.Pointer)>>('sqlite3_open_v2'); - late final _sqlite3_open_v2 = _sqlite3_open_v2_ptr.asFunction< + late final _sqlite3_open_v2 = _sqlite3_open_v2Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer>, int, ffi.Pointer)>(); @@ -2163,11 +2165,11 @@ class SQLite { ); } - late final _sqlite3_uri_parameter_ptr = _lookup< + late final _sqlite3_uri_parameterPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('sqlite3_uri_parameter'); - late final _sqlite3_uri_parameter = _sqlite3_uri_parameter_ptr.asFunction< + late final _sqlite3_uri_parameter = _sqlite3_uri_parameterPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); @@ -2183,11 +2185,11 @@ class SQLite { ); } - late final _sqlite3_uri_boolean_ptr = _lookup< + late final _sqlite3_uri_booleanPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('sqlite3_uri_boolean'); - late final _sqlite3_uri_boolean = _sqlite3_uri_boolean_ptr.asFunction< + late final _sqlite3_uri_boolean = _sqlite3_uri_booleanPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); int sqlite3_uri_int64( @@ -2202,11 +2204,11 @@ class SQLite { ); } - late final _sqlite3_uri_int64_ptr = _lookup< + late final _sqlite3_uri_int64Ptr = _lookup< ffi.NativeFunction< sqlite3_int64 Function(ffi.Pointer, ffi.Pointer, sqlite3_int64)>>('sqlite3_uri_int64'); - late final _sqlite3_uri_int64 = _sqlite3_uri_int64_ptr.asFunction< + late final _sqlite3_uri_int64 = _sqlite3_uri_int64Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); ffi.Pointer sqlite3_uri_key( @@ -2219,11 +2221,11 @@ class SQLite { ); } - late final _sqlite3_uri_key_ptr = _lookup< + late final _sqlite3_uri_keyPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Int32)>>('sqlite3_uri_key'); - late final _sqlite3_uri_key = _sqlite3_uri_key_ptr + late final _sqlite3_uri_key = _sqlite3_uri_keyPtr .asFunction Function(ffi.Pointer, int)>(); /// CAPI3REF: Translate filenames @@ -2259,11 +2261,11 @@ class SQLite { ); } - late final _sqlite3_filename_database_ptr = _lookup< + late final _sqlite3_filename_databasePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_filename_database'); - late final _sqlite3_filename_database = _sqlite3_filename_database_ptr + late final _sqlite3_filename_database = _sqlite3_filename_databasePtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_filename_journal( @@ -2274,11 +2276,11 @@ class SQLite { ); } - late final _sqlite3_filename_journal_ptr = _lookup< + late final _sqlite3_filename_journalPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_filename_journal'); - late final _sqlite3_filename_journal = _sqlite3_filename_journal_ptr + late final _sqlite3_filename_journal = _sqlite3_filename_journalPtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_filename_wal( @@ -2289,11 +2291,11 @@ class SQLite { ); } - late final _sqlite3_filename_wal_ptr = _lookup< + late final _sqlite3_filename_walPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_filename_wal'); - late final _sqlite3_filename_wal = _sqlite3_filename_wal_ptr + late final _sqlite3_filename_wal = _sqlite3_filename_walPtr .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Database File Corresponding To A Journal @@ -2319,11 +2321,11 @@ class SQLite { ); } - late final _sqlite3_database_file_object_ptr = _lookup< + late final _sqlite3_database_file_objectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_database_file_object'); - late final _sqlite3_database_file_object = _sqlite3_database_file_object_ptr + late final _sqlite3_database_file_object = _sqlite3_database_file_objectPtr .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Create and Destroy VFS Filenames @@ -2385,7 +2387,7 @@ class SQLite { ); } - late final _sqlite3_create_filename_ptr = _lookup< + late final _sqlite3_create_filenamePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, @@ -2393,7 +2395,7 @@ class SQLite { ffi.Pointer, ffi.Int32, ffi.Pointer>)>>('sqlite3_create_filename'); - late final _sqlite3_create_filename = _sqlite3_create_filename_ptr.asFunction< + late final _sqlite3_create_filename = _sqlite3_create_filenamePtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, @@ -2409,10 +2411,10 @@ class SQLite { ); } - late final _sqlite3_free_filename_ptr = + late final _sqlite3_free_filenamePtr = _lookup)>>( 'sqlite3_free_filename'); - late final _sqlite3_free_filename = _sqlite3_free_filename_ptr + late final _sqlite3_free_filename = _sqlite3_free_filenamePtr .asFunction)>(); /// CAPI3REF: Error Codes And Messages @@ -2473,11 +2475,11 @@ class SQLite { ); } - late final _sqlite3_errcode_ptr = + late final _sqlite3_errcodePtr = _lookup)>>( 'sqlite3_errcode'); late final _sqlite3_errcode = - _sqlite3_errcode_ptr.asFunction)>(); + _sqlite3_errcodePtr.asFunction)>(); int sqlite3_extended_errcode( ffi.Pointer db, @@ -2487,10 +2489,10 @@ class SQLite { ); } - late final _sqlite3_extended_errcode_ptr = + late final _sqlite3_extended_errcodePtr = _lookup)>>( 'sqlite3_extended_errcode'); - late final _sqlite3_extended_errcode = _sqlite3_extended_errcode_ptr + late final _sqlite3_extended_errcode = _sqlite3_extended_errcodePtr .asFunction)>(); ffi.Pointer sqlite3_errmsg( @@ -2501,11 +2503,11 @@ class SQLite { ); } - late final _sqlite3_errmsg_ptr = _lookup< + late final _sqlite3_errmsgPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_errmsg'); - late final _sqlite3_errmsg = _sqlite3_errmsg_ptr + late final _sqlite3_errmsg = _sqlite3_errmsgPtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_errmsg16( @@ -2516,11 +2518,11 @@ class SQLite { ); } - late final _sqlite3_errmsg16_ptr = _lookup< + late final _sqlite3_errmsg16Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_errmsg16'); - late final _sqlite3_errmsg16 = _sqlite3_errmsg16_ptr + late final _sqlite3_errmsg16 = _sqlite3_errmsg16Ptr .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_errstr( @@ -2531,11 +2533,11 @@ class SQLite { ); } - late final _sqlite3_errstr_ptr = + late final _sqlite3_errstrPtr = _lookup Function(ffi.Int32)>>( 'sqlite3_errstr'); late final _sqlite3_errstr = - _sqlite3_errstr_ptr.asFunction Function(int)>(); + _sqlite3_errstrPtr.asFunction Function(int)>(); /// CAPI3REF: Run-time Limits /// METHOD: sqlite3 @@ -2587,11 +2589,11 @@ class SQLite { ); } - late final _sqlite3_limit_ptr = _lookup< + late final _sqlite3_limitPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Int32, ffi.Int32)>>('sqlite3_limit'); - late final _sqlite3_limit = _sqlite3_limit_ptr + late final _sqlite3_limit = _sqlite3_limitPtr .asFunction, int, int)>(); /// CAPI3REF: Compiling An SQL Statement @@ -2708,7 +2710,7 @@ class SQLite { ); } - late final _sqlite3_prepare_ptr = _lookup< + late final _sqlite3_preparePtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -2716,7 +2718,7 @@ class SQLite { ffi.Int32, ffi.Pointer>, ffi.Pointer>)>>('sqlite3_prepare'); - late final _sqlite3_prepare = _sqlite3_prepare_ptr.asFunction< + late final _sqlite3_prepare = _sqlite3_preparePtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -2740,7 +2742,7 @@ class SQLite { ); } - late final _sqlite3_prepare_v2_ptr = _lookup< + late final _sqlite3_prepare_v2Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -2748,7 +2750,7 @@ class SQLite { ffi.Int32, ffi.Pointer>, ffi.Pointer>)>>('sqlite3_prepare_v2'); - late final _sqlite3_prepare_v2 = _sqlite3_prepare_v2_ptr.asFunction< + late final _sqlite3_prepare_v2 = _sqlite3_prepare_v2Ptr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -2774,7 +2776,7 @@ class SQLite { ); } - late final _sqlite3_prepare_v3_ptr = _lookup< + late final _sqlite3_prepare_v3Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -2783,7 +2785,7 @@ class SQLite { ffi.Uint32, ffi.Pointer>, ffi.Pointer>)>>('sqlite3_prepare_v3'); - late final _sqlite3_prepare_v3 = _sqlite3_prepare_v3_ptr.asFunction< + late final _sqlite3_prepare_v3 = _sqlite3_prepare_v3Ptr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -2808,7 +2810,7 @@ class SQLite { ); } - late final _sqlite3_prepare16_ptr = _lookup< + late final _sqlite3_prepare16Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -2816,7 +2818,7 @@ class SQLite { ffi.Int32, ffi.Pointer>, ffi.Pointer>)>>('sqlite3_prepare16'); - late final _sqlite3_prepare16 = _sqlite3_prepare16_ptr.asFunction< + late final _sqlite3_prepare16 = _sqlite3_prepare16Ptr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -2840,7 +2842,7 @@ class SQLite { ); } - late final _sqlite3_prepare16_v2_ptr = _lookup< + late final _sqlite3_prepare16_v2Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -2848,7 +2850,7 @@ class SQLite { ffi.Int32, ffi.Pointer>, ffi.Pointer>)>>('sqlite3_prepare16_v2'); - late final _sqlite3_prepare16_v2 = _sqlite3_prepare16_v2_ptr.asFunction< + late final _sqlite3_prepare16_v2 = _sqlite3_prepare16_v2Ptr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -2874,7 +2876,7 @@ class SQLite { ); } - late final _sqlite3_prepare16_v3_ptr = _lookup< + late final _sqlite3_prepare16_v3Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -2883,7 +2885,7 @@ class SQLite { ffi.Uint32, ffi.Pointer>, ffi.Pointer>)>>('sqlite3_prepare16_v3'); - late final _sqlite3_prepare16_v3 = _sqlite3_prepare16_v3_ptr.asFunction< + late final _sqlite3_prepare16_v3 = _sqlite3_prepare16_v3Ptr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -2936,11 +2938,11 @@ class SQLite { ); } - late final _sqlite3_sql_ptr = _lookup< + late final _sqlite3_sqlPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_sql'); - late final _sqlite3_sql = _sqlite3_sql_ptr + late final _sqlite3_sql = _sqlite3_sqlPtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_expanded_sql( @@ -2951,11 +2953,11 @@ class SQLite { ); } - late final _sqlite3_expanded_sql_ptr = _lookup< + late final _sqlite3_expanded_sqlPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_expanded_sql'); - late final _sqlite3_expanded_sql = _sqlite3_expanded_sql_ptr + late final _sqlite3_expanded_sql = _sqlite3_expanded_sqlPtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_normalized_sql( @@ -2966,11 +2968,11 @@ class SQLite { ); } - late final _sqlite3_normalized_sql_ptr = _lookup< + late final _sqlite3_normalized_sqlPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_normalized_sql'); - late final _sqlite3_normalized_sql = _sqlite3_normalized_sql_ptr + late final _sqlite3_normalized_sql = _sqlite3_normalized_sqlPtr .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Determine If An SQL Statement Writes The Database @@ -3013,10 +3015,10 @@ class SQLite { ); } - late final _sqlite3_stmt_readonly_ptr = _lookup< + late final _sqlite3_stmt_readonlyPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_stmt_readonly'); - late final _sqlite3_stmt_readonly = _sqlite3_stmt_readonly_ptr + late final _sqlite3_stmt_readonly = _sqlite3_stmt_readonlyPtr .asFunction)>(); /// CAPI3REF: Query The EXPLAIN Setting For A Prepared Statement @@ -3035,10 +3037,10 @@ class SQLite { ); } - late final _sqlite3_stmt_isexplain_ptr = _lookup< + late final _sqlite3_stmt_isexplainPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_stmt_isexplain'); - late final _sqlite3_stmt_isexplain = _sqlite3_stmt_isexplain_ptr + late final _sqlite3_stmt_isexplain = _sqlite3_stmt_isexplainPtr .asFunction)>(); /// CAPI3REF: Determine If A Prepared Statement Has Been Reset @@ -3066,10 +3068,10 @@ class SQLite { ); } - late final _sqlite3_stmt_busy_ptr = _lookup< + late final _sqlite3_stmt_busyPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_stmt_busy'); - late final _sqlite3_stmt_busy = _sqlite3_stmt_busy_ptr + late final _sqlite3_stmt_busy = _sqlite3_stmt_busyPtr .asFunction)>(); /// CAPI3REF: Binding Values To Prepared Statements @@ -3223,7 +3225,7 @@ class SQLite { ); } - late final _sqlite3_bind_blob_ptr = _lookup< + late final _sqlite3_bind_blobPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -3234,7 +3236,7 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer)>>)>>('sqlite3_bind_blob'); - late final _sqlite3_bind_blob = _sqlite3_bind_blob_ptr.asFunction< + late final _sqlite3_bind_blob = _sqlite3_bind_blobPtr.asFunction< int Function( ffi.Pointer, int, @@ -3260,7 +3262,7 @@ class SQLite { ); } - late final _sqlite3_bind_blob64_ptr = _lookup< + late final _sqlite3_bind_blob64Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -3271,7 +3273,7 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer)>>)>>('sqlite3_bind_blob64'); - late final _sqlite3_bind_blob64 = _sqlite3_bind_blob64_ptr.asFunction< + late final _sqlite3_bind_blob64 = _sqlite3_bind_blob64Ptr.asFunction< int Function( ffi.Pointer, int, @@ -3292,11 +3294,11 @@ class SQLite { ); } - late final _sqlite3_bind_double_ptr = _lookup< + late final _sqlite3_bind_doublePtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Int32, ffi.Double)>>('sqlite3_bind_double'); - late final _sqlite3_bind_double = _sqlite3_bind_double_ptr + late final _sqlite3_bind_double = _sqlite3_bind_doublePtr .asFunction, int, double)>(); int sqlite3_bind_int( @@ -3311,11 +3313,11 @@ class SQLite { ); } - late final _sqlite3_bind_int_ptr = _lookup< + late final _sqlite3_bind_intPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Int32, ffi.Int32)>>('sqlite3_bind_int'); - late final _sqlite3_bind_int = _sqlite3_bind_int_ptr + late final _sqlite3_bind_int = _sqlite3_bind_intPtr .asFunction, int, int)>(); int sqlite3_bind_int64( @@ -3330,11 +3332,11 @@ class SQLite { ); } - late final _sqlite3_bind_int64_ptr = _lookup< + late final _sqlite3_bind_int64Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Int32, sqlite3_int64)>>('sqlite3_bind_int64'); - late final _sqlite3_bind_int64 = _sqlite3_bind_int64_ptr + late final _sqlite3_bind_int64 = _sqlite3_bind_int64Ptr .asFunction, int, int)>(); int sqlite3_bind_null( @@ -3347,11 +3349,11 @@ class SQLite { ); } - late final _sqlite3_bind_null_ptr = _lookup< + late final _sqlite3_bind_nullPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Int32)>>('sqlite3_bind_null'); - late final _sqlite3_bind_null = _sqlite3_bind_null_ptr + late final _sqlite3_bind_null = _sqlite3_bind_nullPtr .asFunction, int)>(); int sqlite3_bind_text( @@ -3371,7 +3373,7 @@ class SQLite { ); } - late final _sqlite3_bind_text_ptr = _lookup< + late final _sqlite3_bind_textPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -3382,7 +3384,7 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer)>>)>>('sqlite3_bind_text'); - late final _sqlite3_bind_text = _sqlite3_bind_text_ptr.asFunction< + late final _sqlite3_bind_text = _sqlite3_bind_textPtr.asFunction< int Function( ffi.Pointer, int, @@ -3408,7 +3410,7 @@ class SQLite { ); } - late final _sqlite3_bind_text16_ptr = _lookup< + late final _sqlite3_bind_text16Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -3419,7 +3421,7 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer)>>)>>('sqlite3_bind_text16'); - late final _sqlite3_bind_text16 = _sqlite3_bind_text16_ptr.asFunction< + late final _sqlite3_bind_text16 = _sqlite3_bind_text16Ptr.asFunction< int Function( ffi.Pointer, int, @@ -3447,7 +3449,7 @@ class SQLite { ); } - late final _sqlite3_bind_text64_ptr = _lookup< + late final _sqlite3_bind_text64Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -3457,7 +3459,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction)>>, ffi.Uint8)>>('sqlite3_bind_text64'); - late final _sqlite3_bind_text64 = _sqlite3_bind_text64_ptr.asFunction< + late final _sqlite3_bind_text64 = _sqlite3_bind_text64Ptr.asFunction< int Function( ffi.Pointer, int, @@ -3479,11 +3481,11 @@ class SQLite { ); } - late final _sqlite3_bind_value_ptr = _lookup< + late final _sqlite3_bind_valuePtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Int32, ffi.Pointer)>>('sqlite3_bind_value'); - late final _sqlite3_bind_value = _sqlite3_bind_value_ptr.asFunction< + late final _sqlite3_bind_value = _sqlite3_bind_valuePtr.asFunction< int Function( ffi.Pointer, int, ffi.Pointer)>(); @@ -3504,7 +3506,7 @@ class SQLite { ); } - late final _sqlite3_bind_pointer_ptr = _lookup< + late final _sqlite3_bind_pointerPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -3515,7 +3517,7 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer)>>)>>('sqlite3_bind_pointer'); - late final _sqlite3_bind_pointer = _sqlite3_bind_pointer_ptr.asFunction< + late final _sqlite3_bind_pointer = _sqlite3_bind_pointerPtr.asFunction< int Function( ffi.Pointer, int, @@ -3536,11 +3538,11 @@ class SQLite { ); } - late final _sqlite3_bind_zeroblob_ptr = _lookup< + late final _sqlite3_bind_zeroblobPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Int32, ffi.Int32)>>('sqlite3_bind_zeroblob'); - late final _sqlite3_bind_zeroblob = _sqlite3_bind_zeroblob_ptr + late final _sqlite3_bind_zeroblob = _sqlite3_bind_zeroblobPtr .asFunction, int, int)>(); int sqlite3_bind_zeroblob64( @@ -3555,11 +3557,11 @@ class SQLite { ); } - late final _sqlite3_bind_zeroblob64_ptr = _lookup< + late final _sqlite3_bind_zeroblob64Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Int32, sqlite3_uint64)>>('sqlite3_bind_zeroblob64'); - late final _sqlite3_bind_zeroblob64 = _sqlite3_bind_zeroblob64_ptr + late final _sqlite3_bind_zeroblob64 = _sqlite3_bind_zeroblob64Ptr .asFunction, int, int)>(); /// CAPI3REF: Number Of SQL Parameters @@ -3587,10 +3589,10 @@ class SQLite { ); } - late final _sqlite3_bind_parameter_count_ptr = _lookup< + late final _sqlite3_bind_parameter_countPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_bind_parameter_count'); - late final _sqlite3_bind_parameter_count = _sqlite3_bind_parameter_count_ptr + late final _sqlite3_bind_parameter_count = _sqlite3_bind_parameter_countPtr .asFunction)>(); /// CAPI3REF: Name Of A Host Parameter @@ -3627,12 +3629,12 @@ class SQLite { ); } - late final _sqlite3_bind_parameter_name_ptr = _lookup< + late final _sqlite3_bind_parameter_namePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Int32)>>('sqlite3_bind_parameter_name'); late final _sqlite3_bind_parameter_name = - _sqlite3_bind_parameter_name_ptr.asFunction< + _sqlite3_bind_parameter_namePtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: Index Of A Parameter With A Given Name @@ -3659,12 +3661,12 @@ class SQLite { ); } - late final _sqlite3_bind_parameter_index_ptr = _lookup< + late final _sqlite3_bind_parameter_indexPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('sqlite3_bind_parameter_index'); late final _sqlite3_bind_parameter_index = - _sqlite3_bind_parameter_index_ptr.asFunction< + _sqlite3_bind_parameter_indexPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Reset All Bindings On A Prepared Statement @@ -3681,10 +3683,10 @@ class SQLite { ); } - late final _sqlite3_clear_bindings_ptr = _lookup< + late final _sqlite3_clear_bindingsPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_clear_bindings'); - late final _sqlite3_clear_bindings = _sqlite3_clear_bindings_ptr + late final _sqlite3_clear_bindings = _sqlite3_clear_bindingsPtr .asFunction)>(); /// CAPI3REF: Number Of Columns In A Result Set @@ -3707,10 +3709,10 @@ class SQLite { ); } - late final _sqlite3_column_count_ptr = _lookup< + late final _sqlite3_column_countPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_column_count'); - late final _sqlite3_column_count = _sqlite3_column_count_ptr + late final _sqlite3_column_count = _sqlite3_column_countPtr .asFunction)>(); /// CAPI3REF: Column Names In A Result Set @@ -3748,11 +3750,11 @@ class SQLite { ); } - late final _sqlite3_column_name_ptr = _lookup< + late final _sqlite3_column_namePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Int32)>>('sqlite3_column_name'); - late final _sqlite3_column_name = _sqlite3_column_name_ptr.asFunction< + late final _sqlite3_column_name = _sqlite3_column_namePtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_name16( @@ -3765,11 +3767,11 @@ class SQLite { ); } - late final _sqlite3_column_name16_ptr = _lookup< + late final _sqlite3_column_name16Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Int32)>>('sqlite3_column_name16'); - late final _sqlite3_column_name16 = _sqlite3_column_name16_ptr.asFunction< + late final _sqlite3_column_name16 = _sqlite3_column_name16Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: Source Of Data In A Query Result @@ -3822,12 +3824,12 @@ class SQLite { ); } - late final _sqlite3_column_database_name_ptr = _lookup< + late final _sqlite3_column_database_namePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Int32)>>('sqlite3_column_database_name'); late final _sqlite3_column_database_name = - _sqlite3_column_database_name_ptr.asFunction< + _sqlite3_column_database_namePtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_database_name16( @@ -3840,12 +3842,12 @@ class SQLite { ); } - late final _sqlite3_column_database_name16_ptr = _lookup< + late final _sqlite3_column_database_name16Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Int32)>>('sqlite3_column_database_name16'); late final _sqlite3_column_database_name16 = - _sqlite3_column_database_name16_ptr.asFunction< + _sqlite3_column_database_name16Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_table_name( @@ -3858,12 +3860,12 @@ class SQLite { ); } - late final _sqlite3_column_table_name_ptr = _lookup< + late final _sqlite3_column_table_namePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Int32)>>('sqlite3_column_table_name'); late final _sqlite3_column_table_name = - _sqlite3_column_table_name_ptr.asFunction< + _sqlite3_column_table_namePtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_table_name16( @@ -3876,12 +3878,12 @@ class SQLite { ); } - late final _sqlite3_column_table_name16_ptr = _lookup< + late final _sqlite3_column_table_name16Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Int32)>>('sqlite3_column_table_name16'); late final _sqlite3_column_table_name16 = - _sqlite3_column_table_name16_ptr.asFunction< + _sqlite3_column_table_name16Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_origin_name( @@ -3894,12 +3896,12 @@ class SQLite { ); } - late final _sqlite3_column_origin_name_ptr = _lookup< + late final _sqlite3_column_origin_namePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Int32)>>('sqlite3_column_origin_name'); late final _sqlite3_column_origin_name = - _sqlite3_column_origin_name_ptr.asFunction< + _sqlite3_column_origin_namePtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_origin_name16( @@ -3912,12 +3914,12 @@ class SQLite { ); } - late final _sqlite3_column_origin_name16_ptr = _lookup< + late final _sqlite3_column_origin_name16Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Int32)>>('sqlite3_column_origin_name16'); late final _sqlite3_column_origin_name16 = - _sqlite3_column_origin_name16_ptr.asFunction< + _sqlite3_column_origin_name16Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: Declared Datatype Of A Query Result @@ -3958,11 +3960,11 @@ class SQLite { ); } - late final _sqlite3_column_decltype_ptr = _lookup< + late final _sqlite3_column_decltypePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Int32)>>('sqlite3_column_decltype'); - late final _sqlite3_column_decltype = _sqlite3_column_decltype_ptr.asFunction< + late final _sqlite3_column_decltype = _sqlite3_column_decltypePtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_decltype16( @@ -3975,12 +3977,12 @@ class SQLite { ); } - late final _sqlite3_column_decltype16_ptr = _lookup< + late final _sqlite3_column_decltype16Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Int32)>>('sqlite3_column_decltype16'); late final _sqlite3_column_decltype16 = - _sqlite3_column_decltype16_ptr.asFunction< + _sqlite3_column_decltype16Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: Evaluate An SQL Statement @@ -4071,11 +4073,11 @@ class SQLite { ); } - late final _sqlite3_step_ptr = _lookup< + late final _sqlite3_stepPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_step'); late final _sqlite3_step = - _sqlite3_step_ptr.asFunction)>(); + _sqlite3_stepPtr.asFunction)>(); /// CAPI3REF: Number of columns in a result set /// METHOD: sqlite3_stmt @@ -4102,10 +4104,10 @@ class SQLite { ); } - late final _sqlite3_data_count_ptr = _lookup< + late final _sqlite3_data_countPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_data_count'); - late final _sqlite3_data_count = _sqlite3_data_count_ptr + late final _sqlite3_data_count = _sqlite3_data_countPtr .asFunction)>(); /// CAPI3REF: Result Values From A Query @@ -4325,11 +4327,11 @@ class SQLite { ); } - late final _sqlite3_column_blob_ptr = _lookup< + late final _sqlite3_column_blobPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Int32)>>('sqlite3_column_blob'); - late final _sqlite3_column_blob = _sqlite3_column_blob_ptr.asFunction< + late final _sqlite3_column_blob = _sqlite3_column_blobPtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); double sqlite3_column_double( @@ -4342,11 +4344,11 @@ class SQLite { ); } - late final _sqlite3_column_double_ptr = _lookup< + late final _sqlite3_column_doublePtr = _lookup< ffi.NativeFunction< ffi.Double Function( ffi.Pointer, ffi.Int32)>>('sqlite3_column_double'); - late final _sqlite3_column_double = _sqlite3_column_double_ptr + late final _sqlite3_column_double = _sqlite3_column_doublePtr .asFunction, int)>(); int sqlite3_column_int( @@ -4359,11 +4361,11 @@ class SQLite { ); } - late final _sqlite3_column_int_ptr = _lookup< + late final _sqlite3_column_intPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Int32)>>('sqlite3_column_int'); - late final _sqlite3_column_int = _sqlite3_column_int_ptr + late final _sqlite3_column_int = _sqlite3_column_intPtr .asFunction, int)>(); int sqlite3_column_int64( @@ -4376,11 +4378,11 @@ class SQLite { ); } - late final _sqlite3_column_int64_ptr = _lookup< + late final _sqlite3_column_int64Ptr = _lookup< ffi.NativeFunction< sqlite3_int64 Function( ffi.Pointer, ffi.Int32)>>('sqlite3_column_int64'); - late final _sqlite3_column_int64 = _sqlite3_column_int64_ptr + late final _sqlite3_column_int64 = _sqlite3_column_int64Ptr .asFunction, int)>(); ffi.Pointer sqlite3_column_text( @@ -4393,11 +4395,11 @@ class SQLite { ); } - late final _sqlite3_column_text_ptr = _lookup< + late final _sqlite3_column_textPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Int32)>>('sqlite3_column_text'); - late final _sqlite3_column_text = _sqlite3_column_text_ptr.asFunction< + late final _sqlite3_column_text = _sqlite3_column_textPtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_text16( @@ -4410,11 +4412,11 @@ class SQLite { ); } - late final _sqlite3_column_text16_ptr = _lookup< + late final _sqlite3_column_text16Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Int32)>>('sqlite3_column_text16'); - late final _sqlite3_column_text16 = _sqlite3_column_text16_ptr.asFunction< + late final _sqlite3_column_text16 = _sqlite3_column_text16Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_value( @@ -4427,11 +4429,11 @@ class SQLite { ); } - late final _sqlite3_column_value_ptr = _lookup< + late final _sqlite3_column_valuePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Int32)>>('sqlite3_column_value'); - late final _sqlite3_column_value = _sqlite3_column_value_ptr.asFunction< + late final _sqlite3_column_value = _sqlite3_column_valuePtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); int sqlite3_column_bytes( @@ -4444,11 +4446,11 @@ class SQLite { ); } - late final _sqlite3_column_bytes_ptr = _lookup< + late final _sqlite3_column_bytesPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Int32)>>('sqlite3_column_bytes'); - late final _sqlite3_column_bytes = _sqlite3_column_bytes_ptr + late final _sqlite3_column_bytes = _sqlite3_column_bytesPtr .asFunction, int)>(); int sqlite3_column_bytes16( @@ -4461,11 +4463,11 @@ class SQLite { ); } - late final _sqlite3_column_bytes16_ptr = _lookup< + late final _sqlite3_column_bytes16Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Int32)>>('sqlite3_column_bytes16'); - late final _sqlite3_column_bytes16 = _sqlite3_column_bytes16_ptr + late final _sqlite3_column_bytes16 = _sqlite3_column_bytes16Ptr .asFunction, int)>(); int sqlite3_column_type( @@ -4478,11 +4480,11 @@ class SQLite { ); } - late final _sqlite3_column_type_ptr = _lookup< + late final _sqlite3_column_typePtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Int32)>>('sqlite3_column_type'); - late final _sqlite3_column_type = _sqlite3_column_type_ptr + late final _sqlite3_column_type = _sqlite3_column_typePtr .asFunction, int)>(); /// CAPI3REF: Destroy A Prepared Statement Object @@ -4517,10 +4519,10 @@ class SQLite { ); } - late final _sqlite3_finalize_ptr = _lookup< + late final _sqlite3_finalizePtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_finalize'); - late final _sqlite3_finalize = _sqlite3_finalize_ptr + late final _sqlite3_finalize = _sqlite3_finalizePtr .asFunction)>(); /// CAPI3REF: Reset A Prepared Statement Object @@ -4554,11 +4556,11 @@ class SQLite { ); } - late final _sqlite3_reset_ptr = _lookup< + late final _sqlite3_resetPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_reset'); late final _sqlite3_reset = - _sqlite3_reset_ptr.asFunction)>(); + _sqlite3_resetPtr.asFunction)>(); /// CAPI3REF: Create Or Redefine SQL Functions /// KEYWORDS: {function creation routines} @@ -4715,7 +4717,7 @@ class SQLite { ); } - late final _sqlite3_create_function_ptr = + late final _sqlite3_create_functionPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( @@ -4741,7 +4743,7 @@ class SQLite { ffi.Void Function( ffi.Pointer)>>)>>( 'sqlite3_create_function'); - late final _sqlite3_create_function = _sqlite3_create_function_ptr.asFunction< + late final _sqlite3_create_function = _sqlite3_create_functionPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -4792,7 +4794,7 @@ class SQLite { ); } - late final _sqlite3_create_function16_ptr = + late final _sqlite3_create_function16Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( @@ -4819,7 +4821,7 @@ class SQLite { ffi.Pointer)>>)>>( 'sqlite3_create_function16'); late final _sqlite3_create_function16 = - _sqlite3_create_function16_ptr.asFunction< + _sqlite3_create_function16Ptr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -4873,7 +4875,7 @@ class SQLite { ); } - late final _sqlite3_create_function_v2_ptr = + late final _sqlite3_create_function_v2Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( @@ -4902,7 +4904,7 @@ class SQLite { ffi.Void Function(ffi.Pointer)>>)>>( 'sqlite3_create_function_v2'); late final _sqlite3_create_function_v2 = - _sqlite3_create_function_v2_ptr.asFunction< + _sqlite3_create_function_v2Ptr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -4963,7 +4965,7 @@ class SQLite { ); } - late final _sqlite3_create_window_function_ptr = + late final _sqlite3_create_window_functionPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( @@ -4995,7 +4997,7 @@ class SQLite { ffi.Void Function(ffi.Pointer)>>)>>( 'sqlite3_create_window_function'); late final _sqlite3_create_window_function = - _sqlite3_create_window_function_ptr.asFunction< + _sqlite3_create_window_functionPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -5028,10 +5030,10 @@ class SQLite { ); } - late final _sqlite3_aggregate_count_ptr = _lookup< + late final _sqlite3_aggregate_countPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_aggregate_count'); - late final _sqlite3_aggregate_count = _sqlite3_aggregate_count_ptr + late final _sqlite3_aggregate_count = _sqlite3_aggregate_countPtr .asFunction)>(); int sqlite3_expired( @@ -5042,11 +5044,11 @@ class SQLite { ); } - late final _sqlite3_expired_ptr = _lookup< + late final _sqlite3_expiredPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_expired'); - late final _sqlite3_expired = _sqlite3_expired_ptr - .asFunction)>(); + late final _sqlite3_expired = + _sqlite3_expiredPtr.asFunction)>(); int sqlite3_transfer_bindings( ffi.Pointer arg0, @@ -5058,33 +5060,33 @@ class SQLite { ); } - late final _sqlite3_transfer_bindings_ptr = _lookup< + late final _sqlite3_transfer_bindingsPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('sqlite3_transfer_bindings'); late final _sqlite3_transfer_bindings = - _sqlite3_transfer_bindings_ptr.asFunction< + _sqlite3_transfer_bindingsPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); int sqlite3_global_recover() { return _sqlite3_global_recover(); } - late final _sqlite3_global_recover_ptr = + late final _sqlite3_global_recoverPtr = _lookup>( 'sqlite3_global_recover'); late final _sqlite3_global_recover = - _sqlite3_global_recover_ptr.asFunction(); + _sqlite3_global_recoverPtr.asFunction(); void sqlite3_thread_cleanup() { return _sqlite3_thread_cleanup(); } - late final _sqlite3_thread_cleanup_ptr = + late final _sqlite3_thread_cleanupPtr = _lookup>( 'sqlite3_thread_cleanup'); late final _sqlite3_thread_cleanup = - _sqlite3_thread_cleanup_ptr.asFunction(); + _sqlite3_thread_cleanupPtr.asFunction(); int sqlite3_memory_alarm( ffi.Pointer< @@ -5102,7 +5104,7 @@ class SQLite { ); } - late final _sqlite3_memory_alarm_ptr = _lookup< + late final _sqlite3_memory_alarmPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer< @@ -5111,7 +5113,7 @@ class SQLite { ffi.Pointer, sqlite3_int64, ffi.Int32)>>, ffi.Pointer, sqlite3_int64)>>('sqlite3_memory_alarm'); - late final _sqlite3_memory_alarm = _sqlite3_memory_alarm_ptr.asFunction< + late final _sqlite3_memory_alarm = _sqlite3_memory_alarmPtr.asFunction< int Function( ffi.Pointer< ffi.NativeFunction< @@ -5254,11 +5256,11 @@ class SQLite { ); } - late final _sqlite3_value_blob_ptr = _lookup< + late final _sqlite3_value_blobPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_value_blob'); - late final _sqlite3_value_blob = _sqlite3_value_blob_ptr + late final _sqlite3_value_blob = _sqlite3_value_blobPtr .asFunction Function(ffi.Pointer)>(); double sqlite3_value_double( @@ -5269,10 +5271,10 @@ class SQLite { ); } - late final _sqlite3_value_double_ptr = _lookup< + late final _sqlite3_value_doublePtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_value_double'); - late final _sqlite3_value_double = _sqlite3_value_double_ptr + late final _sqlite3_value_double = _sqlite3_value_doublePtr .asFunction)>(); int sqlite3_value_int( @@ -5283,10 +5285,10 @@ class SQLite { ); } - late final _sqlite3_value_int_ptr = _lookup< + late final _sqlite3_value_intPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_value_int'); - late final _sqlite3_value_int = _sqlite3_value_int_ptr + late final _sqlite3_value_int = _sqlite3_value_intPtr .asFunction)>(); int sqlite3_value_int64( @@ -5297,11 +5299,11 @@ class SQLite { ); } - late final _sqlite3_value_int64_ptr = _lookup< + late final _sqlite3_value_int64Ptr = _lookup< ffi.NativeFunction< sqlite3_int64 Function( ffi.Pointer)>>('sqlite3_value_int64'); - late final _sqlite3_value_int64 = _sqlite3_value_int64_ptr + late final _sqlite3_value_int64 = _sqlite3_value_int64Ptr .asFunction)>(); ffi.Pointer sqlite3_value_pointer( @@ -5314,11 +5316,11 @@ class SQLite { ); } - late final _sqlite3_value_pointer_ptr = _lookup< + late final _sqlite3_value_pointerPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('sqlite3_value_pointer'); - late final _sqlite3_value_pointer = _sqlite3_value_pointer_ptr.asFunction< + late final _sqlite3_value_pointer = _sqlite3_value_pointerPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); @@ -5330,11 +5332,11 @@ class SQLite { ); } - late final _sqlite3_value_text_ptr = _lookup< + late final _sqlite3_value_textPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_value_text'); - late final _sqlite3_value_text = _sqlite3_value_text_ptr.asFunction< + late final _sqlite3_value_text = _sqlite3_value_textPtr.asFunction< ffi.Pointer Function(ffi.Pointer)>(); ffi.Pointer sqlite3_value_text16( @@ -5345,11 +5347,11 @@ class SQLite { ); } - late final _sqlite3_value_text16_ptr = _lookup< + late final _sqlite3_value_text16Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_value_text16'); - late final _sqlite3_value_text16 = _sqlite3_value_text16_ptr + late final _sqlite3_value_text16 = _sqlite3_value_text16Ptr .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_value_text16le( @@ -5360,11 +5362,11 @@ class SQLite { ); } - late final _sqlite3_value_text16le_ptr = _lookup< + late final _sqlite3_value_text16lePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_value_text16le'); - late final _sqlite3_value_text16le = _sqlite3_value_text16le_ptr + late final _sqlite3_value_text16le = _sqlite3_value_text16lePtr .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_value_text16be( @@ -5375,11 +5377,11 @@ class SQLite { ); } - late final _sqlite3_value_text16be_ptr = _lookup< + late final _sqlite3_value_text16bePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_value_text16be'); - late final _sqlite3_value_text16be = _sqlite3_value_text16be_ptr + late final _sqlite3_value_text16be = _sqlite3_value_text16bePtr .asFunction Function(ffi.Pointer)>(); int sqlite3_value_bytes( @@ -5390,10 +5392,10 @@ class SQLite { ); } - late final _sqlite3_value_bytes_ptr = _lookup< + late final _sqlite3_value_bytesPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_value_bytes'); - late final _sqlite3_value_bytes = _sqlite3_value_bytes_ptr + late final _sqlite3_value_bytes = _sqlite3_value_bytesPtr .asFunction)>(); int sqlite3_value_bytes16( @@ -5404,10 +5406,10 @@ class SQLite { ); } - late final _sqlite3_value_bytes16_ptr = _lookup< + late final _sqlite3_value_bytes16Ptr = _lookup< ffi.NativeFunction)>>( 'sqlite3_value_bytes16'); - late final _sqlite3_value_bytes16 = _sqlite3_value_bytes16_ptr + late final _sqlite3_value_bytes16 = _sqlite3_value_bytes16Ptr .asFunction)>(); int sqlite3_value_type( @@ -5418,10 +5420,10 @@ class SQLite { ); } - late final _sqlite3_value_type_ptr = _lookup< + late final _sqlite3_value_typePtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_value_type'); - late final _sqlite3_value_type = _sqlite3_value_type_ptr + late final _sqlite3_value_type = _sqlite3_value_typePtr .asFunction)>(); int sqlite3_value_numeric_type( @@ -5432,10 +5434,10 @@ class SQLite { ); } - late final _sqlite3_value_numeric_type_ptr = _lookup< + late final _sqlite3_value_numeric_typePtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_value_numeric_type'); - late final _sqlite3_value_numeric_type = _sqlite3_value_numeric_type_ptr + late final _sqlite3_value_numeric_type = _sqlite3_value_numeric_typePtr .asFunction)>(); int sqlite3_value_nochange( @@ -5446,10 +5448,10 @@ class SQLite { ); } - late final _sqlite3_value_nochange_ptr = _lookup< + late final _sqlite3_value_nochangePtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_value_nochange'); - late final _sqlite3_value_nochange = _sqlite3_value_nochange_ptr + late final _sqlite3_value_nochange = _sqlite3_value_nochangePtr .asFunction)>(); int sqlite3_value_frombind( @@ -5460,10 +5462,10 @@ class SQLite { ); } - late final _sqlite3_value_frombind_ptr = _lookup< + late final _sqlite3_value_frombindPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_value_frombind'); - late final _sqlite3_value_frombind = _sqlite3_value_frombind_ptr + late final _sqlite3_value_frombind = _sqlite3_value_frombindPtr .asFunction)>(); /// CAPI3REF: Finding The Subtype Of SQL Values @@ -5482,10 +5484,10 @@ class SQLite { ); } - late final _sqlite3_value_subtype_ptr = _lookup< + late final _sqlite3_value_subtypePtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_value_subtype'); - late final _sqlite3_value_subtype = _sqlite3_value_subtype_ptr + late final _sqlite3_value_subtype = _sqlite3_value_subtypePtr .asFunction)>(); /// CAPI3REF: Copy And Free SQL Values @@ -5508,11 +5510,11 @@ class SQLite { ); } - late final _sqlite3_value_dup_ptr = _lookup< + late final _sqlite3_value_dupPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_value_dup'); - late final _sqlite3_value_dup = _sqlite3_value_dup_ptr.asFunction< + late final _sqlite3_value_dup = _sqlite3_value_dupPtr.asFunction< ffi.Pointer Function(ffi.Pointer)>(); void sqlite3_value_free( @@ -5523,10 +5525,10 @@ class SQLite { ); } - late final _sqlite3_value_free_ptr = _lookup< + late final _sqlite3_value_freePtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_value_free'); - late final _sqlite3_value_free = _sqlite3_value_free_ptr + late final _sqlite3_value_free = _sqlite3_value_freePtr .asFunction)>(); /// CAPI3REF: Obtain Aggregate Function Context @@ -5580,12 +5582,12 @@ class SQLite { ); } - late final _sqlite3_aggregate_context_ptr = _lookup< + late final _sqlite3_aggregate_contextPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Int32)>>('sqlite3_aggregate_context'); late final _sqlite3_aggregate_context = - _sqlite3_aggregate_context_ptr.asFunction< + _sqlite3_aggregate_contextPtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: User Data For Functions @@ -5607,11 +5609,11 @@ class SQLite { ); } - late final _sqlite3_user_data_ptr = _lookup< + late final _sqlite3_user_dataPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_user_data'); - late final _sqlite3_user_data = _sqlite3_user_data_ptr.asFunction< + late final _sqlite3_user_data = _sqlite3_user_dataPtr.asFunction< ffi.Pointer Function(ffi.Pointer)>(); /// CAPI3REF: Database Connection For Functions @@ -5630,12 +5632,12 @@ class SQLite { ); } - late final _sqlite3_context_db_handle_ptr = _lookup< + late final _sqlite3_context_db_handlePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_context_db_handle'); late final _sqlite3_context_db_handle = - _sqlite3_context_db_handle_ptr.asFunction< + _sqlite3_context_db_handlePtr.asFunction< ffi.Pointer Function(ffi.Pointer)>(); /// CAPI3REF: Function Auxiliary Data @@ -5703,11 +5705,11 @@ class SQLite { ); } - late final _sqlite3_get_auxdata_ptr = _lookup< + late final _sqlite3_get_auxdataPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Int32)>>('sqlite3_get_auxdata'); - late final _sqlite3_get_auxdata = _sqlite3_get_auxdata_ptr.asFunction< + late final _sqlite3_get_auxdata = _sqlite3_get_auxdataPtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); void sqlite3_set_auxdata( @@ -5725,7 +5727,7 @@ class SQLite { ); } - late final _sqlite3_set_auxdata_ptr = _lookup< + late final _sqlite3_set_auxdataPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -5735,7 +5737,7 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer)>>)>>('sqlite3_set_auxdata'); - late final _sqlite3_set_auxdata = _sqlite3_set_auxdata_ptr.asFunction< + late final _sqlite3_set_auxdata = _sqlite3_set_auxdataPtr.asFunction< void Function( ffi.Pointer, int, @@ -5902,7 +5904,7 @@ class SQLite { ); } - late final _sqlite3_result_blob_ptr = _lookup< + late final _sqlite3_result_blobPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -5912,7 +5914,7 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer)>>)>>('sqlite3_result_blob'); - late final _sqlite3_result_blob = _sqlite3_result_blob_ptr.asFunction< + late final _sqlite3_result_blob = _sqlite3_result_blobPtr.asFunction< void Function( ffi.Pointer, ffi.Pointer, @@ -5935,7 +5937,7 @@ class SQLite { ); } - late final _sqlite3_result_blob64_ptr = _lookup< + late final _sqlite3_result_blob64Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -5945,7 +5947,7 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer)>>)>>('sqlite3_result_blob64'); - late final _sqlite3_result_blob64 = _sqlite3_result_blob64_ptr.asFunction< + late final _sqlite3_result_blob64 = _sqlite3_result_blob64Ptr.asFunction< void Function( ffi.Pointer, ffi.Pointer, @@ -5963,11 +5965,11 @@ class SQLite { ); } - late final _sqlite3_result_double_ptr = _lookup< + late final _sqlite3_result_doublePtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Double)>>('sqlite3_result_double'); - late final _sqlite3_result_double = _sqlite3_result_double_ptr + late final _sqlite3_result_double = _sqlite3_result_doublePtr .asFunction, double)>(); void sqlite3_result_error( @@ -5982,11 +5984,11 @@ class SQLite { ); } - late final _sqlite3_result_error_ptr = _lookup< + late final _sqlite3_result_errorPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('sqlite3_result_error'); - late final _sqlite3_result_error = _sqlite3_result_error_ptr.asFunction< + late final _sqlite3_result_error = _sqlite3_result_errorPtr.asFunction< void Function( ffi.Pointer, ffi.Pointer, int)>(); @@ -6002,11 +6004,11 @@ class SQLite { ); } - late final _sqlite3_result_error16_ptr = _lookup< + late final _sqlite3_result_error16Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('sqlite3_result_error16'); - late final _sqlite3_result_error16 = _sqlite3_result_error16_ptr.asFunction< + late final _sqlite3_result_error16 = _sqlite3_result_error16Ptr.asFunction< void Function( ffi.Pointer, ffi.Pointer, int)>(); @@ -6018,10 +6020,10 @@ class SQLite { ); } - late final _sqlite3_result_error_toobig_ptr = _lookup< + late final _sqlite3_result_error_toobigPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_result_error_toobig'); - late final _sqlite3_result_error_toobig = _sqlite3_result_error_toobig_ptr + late final _sqlite3_result_error_toobig = _sqlite3_result_error_toobigPtr .asFunction)>(); void sqlite3_result_error_nomem( @@ -6032,10 +6034,10 @@ class SQLite { ); } - late final _sqlite3_result_error_nomem_ptr = _lookup< + late final _sqlite3_result_error_nomemPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_result_error_nomem'); - late final _sqlite3_result_error_nomem = _sqlite3_result_error_nomem_ptr + late final _sqlite3_result_error_nomem = _sqlite3_result_error_nomemPtr .asFunction)>(); void sqlite3_result_error_code( @@ -6048,11 +6050,11 @@ class SQLite { ); } - late final _sqlite3_result_error_code_ptr = _lookup< + late final _sqlite3_result_error_codePtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Int32)>>('sqlite3_result_error_code'); - late final _sqlite3_result_error_code = _sqlite3_result_error_code_ptr + late final _sqlite3_result_error_code = _sqlite3_result_error_codePtr .asFunction, int)>(); void sqlite3_result_int( @@ -6065,11 +6067,11 @@ class SQLite { ); } - late final _sqlite3_result_int_ptr = _lookup< + late final _sqlite3_result_intPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Int32)>>('sqlite3_result_int'); - late final _sqlite3_result_int = _sqlite3_result_int_ptr + late final _sqlite3_result_int = _sqlite3_result_intPtr .asFunction, int)>(); void sqlite3_result_int64( @@ -6082,11 +6084,11 @@ class SQLite { ); } - late final _sqlite3_result_int64_ptr = _lookup< + late final _sqlite3_result_int64Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, sqlite3_int64)>>('sqlite3_result_int64'); - late final _sqlite3_result_int64 = _sqlite3_result_int64_ptr + late final _sqlite3_result_int64 = _sqlite3_result_int64Ptr .asFunction, int)>(); void sqlite3_result_null( @@ -6097,10 +6099,10 @@ class SQLite { ); } - late final _sqlite3_result_null_ptr = _lookup< + late final _sqlite3_result_nullPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_result_null'); - late final _sqlite3_result_null = _sqlite3_result_null_ptr + late final _sqlite3_result_null = _sqlite3_result_nullPtr .asFunction)>(); void sqlite3_result_text( @@ -6118,7 +6120,7 @@ class SQLite { ); } - late final _sqlite3_result_text_ptr = _lookup< + late final _sqlite3_result_textPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -6128,7 +6130,7 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer)>>)>>('sqlite3_result_text'); - late final _sqlite3_result_text = _sqlite3_result_text_ptr.asFunction< + late final _sqlite3_result_text = _sqlite3_result_textPtr.asFunction< void Function( ffi.Pointer, ffi.Pointer, @@ -6153,7 +6155,7 @@ class SQLite { ); } - late final _sqlite3_result_text64_ptr = _lookup< + late final _sqlite3_result_text64Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -6162,7 +6164,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction)>>, ffi.Uint8)>>('sqlite3_result_text64'); - late final _sqlite3_result_text64 = _sqlite3_result_text64_ptr.asFunction< + late final _sqlite3_result_text64 = _sqlite3_result_text64Ptr.asFunction< void Function( ffi.Pointer, ffi.Pointer, @@ -6186,7 +6188,7 @@ class SQLite { ); } - late final _sqlite3_result_text16_ptr = _lookup< + late final _sqlite3_result_text16Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -6196,7 +6198,7 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer)>>)>>('sqlite3_result_text16'); - late final _sqlite3_result_text16 = _sqlite3_result_text16_ptr.asFunction< + late final _sqlite3_result_text16 = _sqlite3_result_text16Ptr.asFunction< void Function( ffi.Pointer, ffi.Pointer, @@ -6219,7 +6221,7 @@ class SQLite { ); } - late final _sqlite3_result_text16le_ptr = _lookup< + late final _sqlite3_result_text16lePtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -6229,7 +6231,7 @@ class SQLite { ffi.NativeFunction< ffi.Void Function(ffi.Pointer)>>)>>( 'sqlite3_result_text16le'); - late final _sqlite3_result_text16le = _sqlite3_result_text16le_ptr.asFunction< + late final _sqlite3_result_text16le = _sqlite3_result_text16lePtr.asFunction< void Function( ffi.Pointer, ffi.Pointer, @@ -6252,7 +6254,7 @@ class SQLite { ); } - late final _sqlite3_result_text16be_ptr = _lookup< + late final _sqlite3_result_text16bePtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -6262,7 +6264,7 @@ class SQLite { ffi.NativeFunction< ffi.Void Function(ffi.Pointer)>>)>>( 'sqlite3_result_text16be'); - late final _sqlite3_result_text16be = _sqlite3_result_text16be_ptr.asFunction< + late final _sqlite3_result_text16be = _sqlite3_result_text16bePtr.asFunction< void Function( ffi.Pointer, ffi.Pointer, @@ -6280,11 +6282,11 @@ class SQLite { ); } - late final _sqlite3_result_value_ptr = _lookup< + late final _sqlite3_result_valuePtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer)>>('sqlite3_result_value'); - late final _sqlite3_result_value = _sqlite3_result_value_ptr.asFunction< + late final _sqlite3_result_value = _sqlite3_result_valuePtr.asFunction< void Function( ffi.Pointer, ffi.Pointer)>(); @@ -6303,7 +6305,7 @@ class SQLite { ); } - late final _sqlite3_result_pointer_ptr = _lookup< + late final _sqlite3_result_pointerPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -6313,7 +6315,7 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer)>>)>>('sqlite3_result_pointer'); - late final _sqlite3_result_pointer = _sqlite3_result_pointer_ptr.asFunction< + late final _sqlite3_result_pointer = _sqlite3_result_pointerPtr.asFunction< void Function( ffi.Pointer, ffi.Pointer, @@ -6331,11 +6333,11 @@ class SQLite { ); } - late final _sqlite3_result_zeroblob_ptr = _lookup< + late final _sqlite3_result_zeroblobPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Int32)>>('sqlite3_result_zeroblob'); - late final _sqlite3_result_zeroblob = _sqlite3_result_zeroblob_ptr + late final _sqlite3_result_zeroblob = _sqlite3_result_zeroblobPtr .asFunction, int)>(); int sqlite3_result_zeroblob64( @@ -6348,11 +6350,11 @@ class SQLite { ); } - late final _sqlite3_result_zeroblob64_ptr = _lookup< + late final _sqlite3_result_zeroblob64Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, sqlite3_uint64)>>('sqlite3_result_zeroblob64'); - late final _sqlite3_result_zeroblob64 = _sqlite3_result_zeroblob64_ptr + late final _sqlite3_result_zeroblob64 = _sqlite3_result_zeroblob64Ptr .asFunction, int)>(); /// CAPI3REF: Setting The Subtype Of An SQL Function @@ -6375,11 +6377,11 @@ class SQLite { ); } - late final _sqlite3_result_subtype_ptr = _lookup< + late final _sqlite3_result_subtypePtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Uint32)>>('sqlite3_result_subtype'); - late final _sqlite3_result_subtype = _sqlite3_result_subtype_ptr + late final _sqlite3_result_subtype = _sqlite3_result_subtypePtr .asFunction, int)>(); /// CAPI3REF: Define New Collating Sequences @@ -6481,7 +6483,7 @@ class SQLite { ); } - late final _sqlite3_create_collation_ptr = _lookup< + late final _sqlite3_create_collationPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -6498,7 +6500,7 @@ class SQLite { ffi.Pointer)>>)>>( 'sqlite3_create_collation'); late final _sqlite3_create_collation = - _sqlite3_create_collation_ptr.asFunction< + _sqlite3_create_collationPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -6536,7 +6538,7 @@ class SQLite { ); } - late final _sqlite3_create_collation_v2_ptr = _lookup< + late final _sqlite3_create_collation_v2Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -6556,7 +6558,7 @@ class SQLite { ffi.Void Function(ffi.Pointer)>>)>>( 'sqlite3_create_collation_v2'); late final _sqlite3_create_collation_v2 = - _sqlite3_create_collation_v2_ptr.asFunction< + _sqlite3_create_collation_v2Ptr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -6594,7 +6596,7 @@ class SQLite { ); } - late final _sqlite3_create_collation16_ptr = _lookup< + late final _sqlite3_create_collation16Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -6611,7 +6613,7 @@ class SQLite { ffi.Pointer)>>)>>( 'sqlite3_create_collation16'); late final _sqlite3_create_collation16 = - _sqlite3_create_collation16_ptr.asFunction< + _sqlite3_create_collation16Ptr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -6667,7 +6669,7 @@ class SQLite { ); } - late final _sqlite3_collation_needed_ptr = _lookup< + late final _sqlite3_collation_neededPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -6681,7 +6683,7 @@ class SQLite { ffi.Pointer)>>)>>( 'sqlite3_collation_needed'); late final _sqlite3_collation_needed = - _sqlite3_collation_needed_ptr.asFunction< + _sqlite3_collation_neededPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -6709,7 +6711,7 @@ class SQLite { ); } - late final _sqlite3_collation_needed16_ptr = _lookup< + late final _sqlite3_collation_needed16Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -6723,7 +6725,7 @@ class SQLite { ffi.Pointer)>>)>>( 'sqlite3_collation_needed16'); late final _sqlite3_collation_needed16 = - _sqlite3_collation_needed16_ptr.asFunction< + _sqlite3_collation_needed16Ptr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -6758,11 +6760,10 @@ class SQLite { ); } - late final _sqlite3_sleep_ptr = + late final _sqlite3_sleepPtr = _lookup>( 'sqlite3_sleep'); - late final _sqlite3_sleep = - _sqlite3_sleep_ptr.asFunction(); + late final _sqlite3_sleep = _sqlite3_sleepPtr.asFunction(); /// CAPI3REF: Name Of The Folder Holding Temporary Files /// @@ -6896,11 +6897,11 @@ class SQLite { ); } - late final _sqlite3_win32_set_directory_ptr = _lookup< + late final _sqlite3_win32_set_directoryPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Uint64, ffi.Pointer)>>('sqlite3_win32_set_directory'); - late final _sqlite3_win32_set_directory = _sqlite3_win32_set_directory_ptr + late final _sqlite3_win32_set_directory = _sqlite3_win32_set_directoryPtr .asFunction)>(); int sqlite3_win32_set_directory8( @@ -6913,11 +6914,11 @@ class SQLite { ); } - late final _sqlite3_win32_set_directory8_ptr = _lookup< + late final _sqlite3_win32_set_directory8Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Uint64, ffi.Pointer)>>('sqlite3_win32_set_directory8'); - late final _sqlite3_win32_set_directory8 = _sqlite3_win32_set_directory8_ptr + late final _sqlite3_win32_set_directory8 = _sqlite3_win32_set_directory8Ptr .asFunction)>(); int sqlite3_win32_set_directory16( @@ -6930,11 +6931,11 @@ class SQLite { ); } - late final _sqlite3_win32_set_directory16_ptr = _lookup< + late final _sqlite3_win32_set_directory16Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Uint64, ffi.Pointer)>>('sqlite3_win32_set_directory16'); - late final _sqlite3_win32_set_directory16 = _sqlite3_win32_set_directory16_ptr + late final _sqlite3_win32_set_directory16 = _sqlite3_win32_set_directory16Ptr .asFunction)>(); /// CAPI3REF: Test For Auto-Commit Mode @@ -6965,10 +6966,10 @@ class SQLite { ); } - late final _sqlite3_get_autocommit_ptr = + late final _sqlite3_get_autocommitPtr = _lookup)>>( 'sqlite3_get_autocommit'); - late final _sqlite3_get_autocommit = _sqlite3_get_autocommit_ptr + late final _sqlite3_get_autocommit = _sqlite3_get_autocommitPtr .asFunction)>(); /// CAPI3REF: Find The Database Handle Of A Prepared Statement @@ -6988,11 +6989,11 @@ class SQLite { ); } - late final _sqlite3_db_handle_ptr = _lookup< + late final _sqlite3_db_handlePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_db_handle'); - late final _sqlite3_db_handle = _sqlite3_db_handle_ptr + late final _sqlite3_db_handle = _sqlite3_db_handlePtr .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Return The Filename For A Database Connection @@ -7033,11 +7034,11 @@ class SQLite { ); } - late final _sqlite3_db_filename_ptr = _lookup< + late final _sqlite3_db_filenamePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('sqlite3_db_filename'); - late final _sqlite3_db_filename = _sqlite3_db_filename_ptr.asFunction< + late final _sqlite3_db_filename = _sqlite3_db_filenamePtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); @@ -7057,11 +7058,11 @@ class SQLite { ); } - late final _sqlite3_db_readonly_ptr = _lookup< + late final _sqlite3_db_readonlyPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('sqlite3_db_readonly'); - late final _sqlite3_db_readonly = _sqlite3_db_readonly_ptr + late final _sqlite3_db_readonly = _sqlite3_db_readonlyPtr .asFunction, ffi.Pointer)>(); /// CAPI3REF: Find the next prepared statement @@ -7086,11 +7087,11 @@ class SQLite { ); } - late final _sqlite3_next_stmt_ptr = _lookup< + late final _sqlite3_next_stmtPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>('sqlite3_next_stmt'); - late final _sqlite3_next_stmt = _sqlite3_next_stmt_ptr.asFunction< + late final _sqlite3_next_stmt = _sqlite3_next_stmtPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); @@ -7152,7 +7153,7 @@ class SQLite { ); } - late final _sqlite3_commit_hook_ptr = _lookup< + late final _sqlite3_commit_hookPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, @@ -7160,7 +7161,7 @@ class SQLite { ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer)>>, ffi.Pointer)>>('sqlite3_commit_hook'); - late final _sqlite3_commit_hook = _sqlite3_commit_hook_ptr.asFunction< + late final _sqlite3_commit_hook = _sqlite3_commit_hookPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer< @@ -7180,14 +7181,14 @@ class SQLite { ); } - late final _sqlite3_rollback_hook_ptr = _lookup< + late final _sqlite3_rollback_hookPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer< ffi.NativeFunction)>>, ffi.Pointer)>>('sqlite3_rollback_hook'); - late final _sqlite3_rollback_hook = _sqlite3_rollback_hook_ptr.asFunction< + late final _sqlite3_rollback_hook = _sqlite3_rollback_hookPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer< @@ -7261,7 +7262,7 @@ class SQLite { ); } - late final _sqlite3_update_hook_ptr = _lookup< + late final _sqlite3_update_hookPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, @@ -7274,7 +7275,7 @@ class SQLite { ffi.Pointer, sqlite3_int64)>>, ffi.Pointer)>>('sqlite3_update_hook'); - late final _sqlite3_update_hook = _sqlite3_update_hook_ptr.asFunction< + late final _sqlite3_update_hook = _sqlite3_update_hookPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer< @@ -7332,11 +7333,11 @@ class SQLite { ); } - late final _sqlite3_enable_shared_cache_ptr = + late final _sqlite3_enable_shared_cachePtr = _lookup>( 'sqlite3_enable_shared_cache'); late final _sqlite3_enable_shared_cache = - _sqlite3_enable_shared_cache_ptr.asFunction(); + _sqlite3_enable_shared_cachePtr.asFunction(); /// CAPI3REF: Attempt To Free Heap Memory /// @@ -7358,11 +7359,11 @@ class SQLite { ); } - late final _sqlite3_release_memory_ptr = + late final _sqlite3_release_memoryPtr = _lookup>( 'sqlite3_release_memory'); late final _sqlite3_release_memory = - _sqlite3_release_memory_ptr.asFunction(); + _sqlite3_release_memoryPtr.asFunction(); /// CAPI3REF: Free Memory Used By A Database Connection /// METHOD: sqlite3 @@ -7382,10 +7383,10 @@ class SQLite { ); } - late final _sqlite3_db_release_memory_ptr = + late final _sqlite3_db_release_memoryPtr = _lookup)>>( 'sqlite3_db_release_memory'); - late final _sqlite3_db_release_memory = _sqlite3_db_release_memory_ptr + late final _sqlite3_db_release_memory = _sqlite3_db_release_memoryPtr .asFunction)>(); /// CAPI3REF: Impose A Limit On Heap Size @@ -7458,11 +7459,11 @@ class SQLite { ); } - late final _sqlite3_soft_heap_limit64_ptr = + late final _sqlite3_soft_heap_limit64Ptr = _lookup>( 'sqlite3_soft_heap_limit64'); late final _sqlite3_soft_heap_limit64 = - _sqlite3_soft_heap_limit64_ptr.asFunction(); + _sqlite3_soft_heap_limit64Ptr.asFunction(); int sqlite3_hard_heap_limit64( int N, @@ -7472,11 +7473,11 @@ class SQLite { ); } - late final _sqlite3_hard_heap_limit64_ptr = + late final _sqlite3_hard_heap_limit64Ptr = _lookup>( 'sqlite3_hard_heap_limit64'); late final _sqlite3_hard_heap_limit64 = - _sqlite3_hard_heap_limit64_ptr.asFunction(); + _sqlite3_hard_heap_limit64Ptr.asFunction(); /// CAPI3REF: Deprecated Soft Heap Limit Interface /// DEPRECATED @@ -7493,11 +7494,11 @@ class SQLite { ); } - late final _sqlite3_soft_heap_limit_ptr = + late final _sqlite3_soft_heap_limitPtr = _lookup>( 'sqlite3_soft_heap_limit'); late final _sqlite3_soft_heap_limit = - _sqlite3_soft_heap_limit_ptr.asFunction(); + _sqlite3_soft_heap_limitPtr.asFunction(); /// CAPI3REF: Extract Metadata About A Column Of A Table /// METHOD: sqlite3 @@ -7590,7 +7591,7 @@ class SQLite { ); } - late final _sqlite3_table_column_metadata_ptr = _lookup< + late final _sqlite3_table_column_metadataPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -7603,7 +7604,7 @@ class SQLite { ffi.Pointer, ffi.Pointer)>>('sqlite3_table_column_metadata'); late final _sqlite3_table_column_metadata = - _sqlite3_table_column_metadata_ptr.asFunction< + _sqlite3_table_column_metadataPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -7671,14 +7672,14 @@ class SQLite { ); } - late final _sqlite3_load_extension_ptr = _lookup< + late final _sqlite3_load_extensionPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer>)>>('sqlite3_load_extension'); - late final _sqlite3_load_extension = _sqlite3_load_extension_ptr.asFunction< + late final _sqlite3_load_extension = _sqlite3_load_extensionPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer>)>(); @@ -7715,11 +7716,11 @@ class SQLite { ); } - late final _sqlite3_enable_load_extension_ptr = _lookup< + late final _sqlite3_enable_load_extensionPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Int32)>>('sqlite3_enable_load_extension'); - late final _sqlite3_enable_load_extension = _sqlite3_enable_load_extension_ptr + late final _sqlite3_enable_load_extension = _sqlite3_enable_load_extensionPtr .asFunction, int)>(); /// CAPI3REF: Automatically Load Statically Linked Extensions @@ -7764,12 +7765,12 @@ class SQLite { ); } - late final _sqlite3_auto_extension_ptr = _lookup< + late final _sqlite3_auto_extensionPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer>)>>( 'sqlite3_auto_extension'); - late final _sqlite3_auto_extension = _sqlite3_auto_extension_ptr.asFunction< + late final _sqlite3_auto_extension = _sqlite3_auto_extensionPtr.asFunction< int Function(ffi.Pointer>)>(); /// CAPI3REF: Cancel Automatic Extension Loading @@ -7788,13 +7789,13 @@ class SQLite { ); } - late final _sqlite3_cancel_auto_extension_ptr = _lookup< + late final _sqlite3_cancel_auto_extensionPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer>)>>( 'sqlite3_cancel_auto_extension'); late final _sqlite3_cancel_auto_extension = - _sqlite3_cancel_auto_extension_ptr.asFunction< + _sqlite3_cancel_auto_extensionPtr.asFunction< int Function(ffi.Pointer>)>(); /// CAPI3REF: Reset Automatic Extension Loading @@ -7805,11 +7806,11 @@ class SQLite { return _sqlite3_reset_auto_extension(); } - late final _sqlite3_reset_auto_extension_ptr = + late final _sqlite3_reset_auto_extensionPtr = _lookup>( 'sqlite3_reset_auto_extension'); late final _sqlite3_reset_auto_extension = - _sqlite3_reset_auto_extension_ptr.asFunction(); + _sqlite3_reset_auto_extensionPtr.asFunction(); /// CAPI3REF: Register A Virtual Table Implementation /// METHOD: sqlite3 @@ -7855,14 +7856,14 @@ class SQLite { ); } - late final _sqlite3_create_module_ptr = _lookup< + late final _sqlite3_create_modulePtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('sqlite3_create_module'); - late final _sqlite3_create_module = _sqlite3_create_module_ptr.asFunction< + late final _sqlite3_create_module = _sqlite3_create_modulePtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -7883,7 +7884,7 @@ class SQLite { ); } - late final _sqlite3_create_module_v2_ptr = _lookup< + late final _sqlite3_create_module_v2Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -7895,7 +7896,7 @@ class SQLite { ffi.Void Function(ffi.Pointer)>>)>>( 'sqlite3_create_module_v2'); late final _sqlite3_create_module_v2 = - _sqlite3_create_module_v2_ptr.asFunction< + _sqlite3_create_module_v2Ptr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -7925,11 +7926,11 @@ class SQLite { ); } - late final _sqlite3_drop_modules_ptr = _lookup< + late final _sqlite3_drop_modulesPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer>)>>('sqlite3_drop_modules'); - late final _sqlite3_drop_modules = _sqlite3_drop_modules_ptr.asFunction< + late final _sqlite3_drop_modules = _sqlite3_drop_modulesPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer>)>(); /// CAPI3REF: Declare The Schema Of A Virtual Table @@ -7948,11 +7949,11 @@ class SQLite { ); } - late final _sqlite3_declare_vtab_ptr = _lookup< + late final _sqlite3_declare_vtabPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('sqlite3_declare_vtab'); - late final _sqlite3_declare_vtab = _sqlite3_declare_vtab_ptr + late final _sqlite3_declare_vtab = _sqlite3_declare_vtabPtr .asFunction, ffi.Pointer)>(); /// CAPI3REF: Overload A Function For A Virtual Table @@ -7982,12 +7983,12 @@ class SQLite { ); } - late final _sqlite3_overload_function_ptr = _lookup< + late final _sqlite3_overload_functionPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('sqlite3_overload_function'); late final _sqlite3_overload_function = - _sqlite3_overload_function_ptr.asFunction< + _sqlite3_overload_functionPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); /// CAPI3REF: Open A BLOB For Incremental I/O @@ -8091,7 +8092,7 @@ class SQLite { ); } - late final _sqlite3_blob_open_ptr = _lookup< + late final _sqlite3_blob_openPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -8101,7 +8102,7 @@ class SQLite { sqlite3_int64, ffi.Int32, ffi.Pointer>)>>('sqlite3_blob_open'); - late final _sqlite3_blob_open = _sqlite3_blob_open_ptr.asFunction< + late final _sqlite3_blob_open = _sqlite3_blob_openPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -8142,11 +8143,11 @@ class SQLite { ); } - late final _sqlite3_blob_reopen_ptr = _lookup< + late final _sqlite3_blob_reopenPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, sqlite3_int64)>>('sqlite3_blob_reopen'); - late final _sqlite3_blob_reopen = _sqlite3_blob_reopen_ptr + late final _sqlite3_blob_reopen = _sqlite3_blob_reopenPtr .asFunction, int)>(); /// CAPI3REF: Close A BLOB Handle @@ -8176,10 +8177,10 @@ class SQLite { ); } - late final _sqlite3_blob_close_ptr = _lookup< + late final _sqlite3_blob_closePtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_blob_close'); - late final _sqlite3_blob_close = _sqlite3_blob_close_ptr + late final _sqlite3_blob_close = _sqlite3_blob_closePtr .asFunction)>(); /// CAPI3REF: Return The Size Of An Open BLOB @@ -8202,10 +8203,10 @@ class SQLite { ); } - late final _sqlite3_blob_bytes_ptr = _lookup< + late final _sqlite3_blob_bytesPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_blob_bytes'); - late final _sqlite3_blob_bytes = _sqlite3_blob_bytes_ptr + late final _sqlite3_blob_bytes = _sqlite3_blob_bytesPtr .asFunction)>(); /// CAPI3REF: Read Data From A BLOB Incrementally @@ -8247,11 +8248,11 @@ class SQLite { ); } - late final _sqlite3_blob_read_ptr = _lookup< + late final _sqlite3_blob_readPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Int32)>>('sqlite3_blob_read'); - late final _sqlite3_blob_read = _sqlite3_blob_read_ptr.asFunction< + late final _sqlite3_blob_read = _sqlite3_blob_readPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, int, int)>(); @@ -8307,11 +8308,11 @@ class SQLite { ); } - late final _sqlite3_blob_write_ptr = _lookup< + late final _sqlite3_blob_writePtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Int32)>>('sqlite3_blob_write'); - late final _sqlite3_blob_write = _sqlite3_blob_write_ptr.asFunction< + late final _sqlite3_blob_write = _sqlite3_blob_writePtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, int, int)>(); @@ -8350,11 +8351,11 @@ class SQLite { ); } - late final _sqlite3_vfs_find_ptr = _lookup< + late final _sqlite3_vfs_findPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_vfs_find'); - late final _sqlite3_vfs_find = _sqlite3_vfs_find_ptr + late final _sqlite3_vfs_find = _sqlite3_vfs_findPtr .asFunction Function(ffi.Pointer)>(); int sqlite3_vfs_register( @@ -8367,11 +8368,11 @@ class SQLite { ); } - late final _sqlite3_vfs_register_ptr = _lookup< + late final _sqlite3_vfs_registerPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Int32)>>('sqlite3_vfs_register'); - late final _sqlite3_vfs_register = _sqlite3_vfs_register_ptr + late final _sqlite3_vfs_register = _sqlite3_vfs_registerPtr .asFunction, int)>(); int sqlite3_vfs_unregister( @@ -8382,10 +8383,10 @@ class SQLite { ); } - late final _sqlite3_vfs_unregister_ptr = + late final _sqlite3_vfs_unregisterPtr = _lookup)>>( 'sqlite3_vfs_unregister'); - late final _sqlite3_vfs_unregister = _sqlite3_vfs_unregister_ptr + late final _sqlite3_vfs_unregister = _sqlite3_vfs_unregisterPtr .asFunction)>(); /// CAPI3REF: Mutexes @@ -8508,10 +8509,10 @@ class SQLite { ); } - late final _sqlite3_mutex_alloc_ptr = _lookup< + late final _sqlite3_mutex_allocPtr = _lookup< ffi.NativeFunction Function(ffi.Int32)>>( 'sqlite3_mutex_alloc'); - late final _sqlite3_mutex_alloc = _sqlite3_mutex_alloc_ptr + late final _sqlite3_mutex_alloc = _sqlite3_mutex_allocPtr .asFunction Function(int)>(); void sqlite3_mutex_free( @@ -8522,10 +8523,10 @@ class SQLite { ); } - late final _sqlite3_mutex_free_ptr = _lookup< + late final _sqlite3_mutex_freePtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_mutex_free'); - late final _sqlite3_mutex_free = _sqlite3_mutex_free_ptr + late final _sqlite3_mutex_free = _sqlite3_mutex_freePtr .asFunction)>(); void sqlite3_mutex_enter( @@ -8536,10 +8537,10 @@ class SQLite { ); } - late final _sqlite3_mutex_enter_ptr = _lookup< + late final _sqlite3_mutex_enterPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_mutex_enter'); - late final _sqlite3_mutex_enter = _sqlite3_mutex_enter_ptr + late final _sqlite3_mutex_enter = _sqlite3_mutex_enterPtr .asFunction)>(); int sqlite3_mutex_try( @@ -8550,10 +8551,10 @@ class SQLite { ); } - late final _sqlite3_mutex_try_ptr = _lookup< + late final _sqlite3_mutex_tryPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_mutex_try'); - late final _sqlite3_mutex_try = _sqlite3_mutex_try_ptr + late final _sqlite3_mutex_try = _sqlite3_mutex_tryPtr .asFunction)>(); void sqlite3_mutex_leave( @@ -8564,10 +8565,10 @@ class SQLite { ); } - late final _sqlite3_mutex_leave_ptr = _lookup< + late final _sqlite3_mutex_leavePtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_mutex_leave'); - late final _sqlite3_mutex_leave = _sqlite3_mutex_leave_ptr + late final _sqlite3_mutex_leave = _sqlite3_mutex_leavePtr .asFunction)>(); int sqlite3_mutex_held( @@ -8578,10 +8579,10 @@ class SQLite { ); } - late final _sqlite3_mutex_held_ptr = _lookup< + late final _sqlite3_mutex_heldPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_mutex_held'); - late final _sqlite3_mutex_held = _sqlite3_mutex_held_ptr + late final _sqlite3_mutex_held = _sqlite3_mutex_heldPtr .asFunction)>(); int sqlite3_mutex_notheld( @@ -8592,10 +8593,10 @@ class SQLite { ); } - late final _sqlite3_mutex_notheld_ptr = _lookup< + late final _sqlite3_mutex_notheldPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_mutex_notheld'); - late final _sqlite3_mutex_notheld = _sqlite3_mutex_notheld_ptr + late final _sqlite3_mutex_notheld = _sqlite3_mutex_notheldPtr .asFunction)>(); /// CAPI3REF: Retrieve the mutex for a database connection @@ -8614,11 +8615,11 @@ class SQLite { ); } - late final _sqlite3_db_mutex_ptr = _lookup< + late final _sqlite3_db_mutexPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_db_mutex'); - late final _sqlite3_db_mutex = _sqlite3_db_mutex_ptr + late final _sqlite3_db_mutex = _sqlite3_db_mutexPtr .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Low-Level Control Of Database Files @@ -8674,11 +8675,11 @@ class SQLite { ); } - late final _sqlite3_file_control_ptr = _lookup< + late final _sqlite3_file_controlPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Pointer)>>('sqlite3_file_control'); - late final _sqlite3_file_control = _sqlite3_file_control_ptr.asFunction< + late final _sqlite3_file_control = _sqlite3_file_controlPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); @@ -8705,11 +8706,11 @@ class SQLite { ); } - late final _sqlite3_test_control_ptr = + late final _sqlite3_test_controlPtr = _lookup>( 'sqlite3_test_control'); late final _sqlite3_test_control = - _sqlite3_test_control_ptr.asFunction(); + _sqlite3_test_controlPtr.asFunction(); /// CAPI3REF: SQL Keyword Checking /// @@ -8760,11 +8761,11 @@ class SQLite { return _sqlite3_keyword_count(); } - late final _sqlite3_keyword_count_ptr = + late final _sqlite3_keyword_countPtr = _lookup>( 'sqlite3_keyword_count'); late final _sqlite3_keyword_count = - _sqlite3_keyword_count_ptr.asFunction(); + _sqlite3_keyword_countPtr.asFunction(); int sqlite3_keyword_name( int arg0, @@ -8778,11 +8779,11 @@ class SQLite { ); } - late final _sqlite3_keyword_name_ptr = _lookup< + late final _sqlite3_keyword_namePtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Int32, ffi.Pointer>, ffi.Pointer)>>('sqlite3_keyword_name'); - late final _sqlite3_keyword_name = _sqlite3_keyword_name_ptr.asFunction< + late final _sqlite3_keyword_name = _sqlite3_keyword_namePtr.asFunction< int Function( int, ffi.Pointer>, ffi.Pointer)>(); @@ -8796,11 +8797,11 @@ class SQLite { ); } - late final _sqlite3_keyword_check_ptr = _lookup< + late final _sqlite3_keyword_checkPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Int32)>>('sqlite3_keyword_check'); - late final _sqlite3_keyword_check = _sqlite3_keyword_check_ptr + late final _sqlite3_keyword_check = _sqlite3_keyword_checkPtr .asFunction, int)>(); /// CAPI3REF: Create A New Dynamic String Object @@ -8834,11 +8835,11 @@ class SQLite { ); } - late final _sqlite3_str_new_ptr = _lookup< + late final _sqlite3_str_newPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_str_new'); - late final _sqlite3_str_new = _sqlite3_str_new_ptr + late final _sqlite3_str_new = _sqlite3_str_newPtr .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Finalize A Dynamic String @@ -8860,11 +8861,11 @@ class SQLite { ); } - late final _sqlite3_str_finish_ptr = _lookup< + late final _sqlite3_str_finishPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_str_finish'); - late final _sqlite3_str_finish = _sqlite3_str_finish_ptr + late final _sqlite3_str_finish = _sqlite3_str_finishPtr .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Add Content To A Dynamic String @@ -8907,11 +8908,11 @@ class SQLite { ); } - late final _sqlite3_str_appendf_ptr = _lookup< + late final _sqlite3_str_appendfPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer)>>('sqlite3_str_appendf'); - late final _sqlite3_str_appendf = _sqlite3_str_appendf_ptr.asFunction< + late final _sqlite3_str_appendf = _sqlite3_str_appendfPtr.asFunction< void Function(ffi.Pointer, ffi.Pointer)>(); void sqlite3_str_append( @@ -8926,11 +8927,11 @@ class SQLite { ); } - late final _sqlite3_str_append_ptr = _lookup< + late final _sqlite3_str_appendPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('sqlite3_str_append'); - late final _sqlite3_str_append = _sqlite3_str_append_ptr.asFunction< + late final _sqlite3_str_append = _sqlite3_str_appendPtr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); void sqlite3_str_appendall( @@ -8943,11 +8944,11 @@ class SQLite { ); } - late final _sqlite3_str_appendall_ptr = _lookup< + late final _sqlite3_str_appendallPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer)>>('sqlite3_str_appendall'); - late final _sqlite3_str_appendall = _sqlite3_str_appendall_ptr.asFunction< + late final _sqlite3_str_appendall = _sqlite3_str_appendallPtr.asFunction< void Function(ffi.Pointer, ffi.Pointer)>(); void sqlite3_str_appendchar( @@ -8962,11 +8963,11 @@ class SQLite { ); } - late final _sqlite3_str_appendchar_ptr = _lookup< + late final _sqlite3_str_appendcharPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Int32, ffi.Int8)>>('sqlite3_str_appendchar'); - late final _sqlite3_str_appendchar = _sqlite3_str_appendchar_ptr + late final _sqlite3_str_appendchar = _sqlite3_str_appendcharPtr .asFunction, int, int)>(); void sqlite3_str_reset( @@ -8977,10 +8978,10 @@ class SQLite { ); } - late final _sqlite3_str_reset_ptr = + late final _sqlite3_str_resetPtr = _lookup)>>( 'sqlite3_str_reset'); - late final _sqlite3_str_reset = _sqlite3_str_reset_ptr + late final _sqlite3_str_reset = _sqlite3_str_resetPtr .asFunction)>(); /// CAPI3REF: Status Of A Dynamic String @@ -9018,10 +9019,10 @@ class SQLite { ); } - late final _sqlite3_str_errcode_ptr = + late final _sqlite3_str_errcodePtr = _lookup)>>( 'sqlite3_str_errcode'); - late final _sqlite3_str_errcode = _sqlite3_str_errcode_ptr + late final _sqlite3_str_errcode = _sqlite3_str_errcodePtr .asFunction)>(); int sqlite3_str_length( @@ -9032,10 +9033,10 @@ class SQLite { ); } - late final _sqlite3_str_length_ptr = + late final _sqlite3_str_lengthPtr = _lookup)>>( 'sqlite3_str_length'); - late final _sqlite3_str_length = _sqlite3_str_length_ptr + late final _sqlite3_str_length = _sqlite3_str_lengthPtr .asFunction)>(); ffi.Pointer sqlite3_str_value( @@ -9046,11 +9047,11 @@ class SQLite { ); } - late final _sqlite3_str_value_ptr = _lookup< + late final _sqlite3_str_valuePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer)>>('sqlite3_str_value'); - late final _sqlite3_str_value = _sqlite3_str_value_ptr + late final _sqlite3_str_value = _sqlite3_str_valuePtr .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: SQLite Runtime Status @@ -9091,11 +9092,11 @@ class SQLite { ); } - late final _sqlite3_status_ptr = _lookup< + late final _sqlite3_statusPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Int32, ffi.Pointer, ffi.Pointer, ffi.Int32)>>('sqlite3_status'); - late final _sqlite3_status = _sqlite3_status_ptr.asFunction< + late final _sqlite3_status = _sqlite3_statusPtr.asFunction< int Function(int, ffi.Pointer, ffi.Pointer, int)>(); int sqlite3_status64( @@ -9112,11 +9113,11 @@ class SQLite { ); } - late final _sqlite3_status64_ptr = _lookup< + late final _sqlite3_status64Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Int32, ffi.Pointer, ffi.Pointer, ffi.Int32)>>('sqlite3_status64'); - late final _sqlite3_status64 = _sqlite3_status64_ptr.asFunction< + late final _sqlite3_status64 = _sqlite3_status64Ptr.asFunction< int Function( int, ffi.Pointer, ffi.Pointer, int)>(); @@ -9157,7 +9158,7 @@ class SQLite { ); } - late final _sqlite3_db_status_ptr = _lookup< + late final _sqlite3_db_statusPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -9165,7 +9166,7 @@ class SQLite { ffi.Pointer, ffi.Pointer, ffi.Int32)>>('sqlite3_db_status'); - late final _sqlite3_db_status = _sqlite3_db_status_ptr.asFunction< + late final _sqlite3_db_status = _sqlite3_db_statusPtr.asFunction< int Function(ffi.Pointer, int, ffi.Pointer, ffi.Pointer, int)>(); @@ -9203,11 +9204,11 @@ class SQLite { ); } - late final _sqlite3_stmt_status_ptr = _lookup< + late final _sqlite3_stmt_statusPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Int32, ffi.Int32)>>('sqlite3_stmt_status'); - late final _sqlite3_stmt_status = _sqlite3_stmt_status_ptr + late final _sqlite3_stmt_status = _sqlite3_stmt_statusPtr .asFunction, int, int)>(); /// CAPI3REF: Online Backup API. @@ -9408,14 +9409,14 @@ class SQLite { ); } - late final _sqlite3_backup_init_ptr = _lookup< + late final _sqlite3_backup_initPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('sqlite3_backup_init'); - late final _sqlite3_backup_init = _sqlite3_backup_init_ptr.asFunction< + late final _sqlite3_backup_init = _sqlite3_backup_initPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, @@ -9432,11 +9433,11 @@ class SQLite { ); } - late final _sqlite3_backup_step_ptr = _lookup< + late final _sqlite3_backup_stepPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Int32)>>('sqlite3_backup_step'); - late final _sqlite3_backup_step = _sqlite3_backup_step_ptr + late final _sqlite3_backup_step = _sqlite3_backup_stepPtr .asFunction, int)>(); int sqlite3_backup_finish( @@ -9447,10 +9448,10 @@ class SQLite { ); } - late final _sqlite3_backup_finish_ptr = _lookup< + late final _sqlite3_backup_finishPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_backup_finish'); - late final _sqlite3_backup_finish = _sqlite3_backup_finish_ptr + late final _sqlite3_backup_finish = _sqlite3_backup_finishPtr .asFunction)>(); int sqlite3_backup_remaining( @@ -9461,10 +9462,10 @@ class SQLite { ); } - late final _sqlite3_backup_remaining_ptr = _lookup< + late final _sqlite3_backup_remainingPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_backup_remaining'); - late final _sqlite3_backup_remaining = _sqlite3_backup_remaining_ptr + late final _sqlite3_backup_remaining = _sqlite3_backup_remainingPtr .asFunction)>(); int sqlite3_backup_pagecount( @@ -9475,10 +9476,10 @@ class SQLite { ); } - late final _sqlite3_backup_pagecount_ptr = _lookup< + late final _sqlite3_backup_pagecountPtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_backup_pagecount'); - late final _sqlite3_backup_pagecount = _sqlite3_backup_pagecount_ptr + late final _sqlite3_backup_pagecount = _sqlite3_backup_pagecountPtr .asFunction)>(); /// CAPI3REF: Unlock Notification @@ -9610,7 +9611,7 @@ class SQLite { ); } - late final _sqlite3_unlock_notify_ptr = _lookup< + late final _sqlite3_unlock_notifyPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -9619,7 +9620,7 @@ class SQLite { ffi.Void Function( ffi.Pointer>, ffi.Int32)>>, ffi.Pointer)>>('sqlite3_unlock_notify'); - late final _sqlite3_unlock_notify = _sqlite3_unlock_notify_ptr.asFunction< + late final _sqlite3_unlock_notify = _sqlite3_unlock_notifyPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer< @@ -9644,11 +9645,11 @@ class SQLite { ); } - late final _sqlite3_stricmp_ptr = _lookup< + late final _sqlite3_stricmpPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('sqlite3_stricmp'); - late final _sqlite3_stricmp = _sqlite3_stricmp_ptr + late final _sqlite3_stricmp = _sqlite3_stricmpPtr .asFunction, ffi.Pointer)>(); int sqlite3_strnicmp( @@ -9663,11 +9664,11 @@ class SQLite { ); } - late final _sqlite3_strnicmp_ptr = _lookup< + late final _sqlite3_strnicmpPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('sqlite3_strnicmp'); - late final _sqlite3_strnicmp = _sqlite3_strnicmp_ptr.asFunction< + late final _sqlite3_strnicmp = _sqlite3_strnicmpPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); /// CAPI3REF: String Globbing @@ -9693,11 +9694,11 @@ class SQLite { ); } - late final _sqlite3_strglob_ptr = _lookup< + late final _sqlite3_strglobPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('sqlite3_strglob'); - late final _sqlite3_strglob = _sqlite3_strglob_ptr + late final _sqlite3_strglob = _sqlite3_strglobPtr .asFunction, ffi.Pointer)>(); /// CAPI3REF: String LIKE Matching @@ -9731,11 +9732,11 @@ class SQLite { ); } - late final _sqlite3_strlike_ptr = _lookup< + late final _sqlite3_strlikePtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Uint32)>>('sqlite3_strlike'); - late final _sqlite3_strlike = _sqlite3_strlike_ptr.asFunction< + late final _sqlite3_strlike = _sqlite3_strlikePtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); /// CAPI3REF: Error Logging Interface @@ -9767,11 +9768,11 @@ class SQLite { ); } - late final _sqlite3_log_ptr = _lookup< + late final _sqlite3_logPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Int32, ffi.Pointer)>>('sqlite3_log'); late final _sqlite3_log = - _sqlite3_log_ptr.asFunction)>(); + _sqlite3_logPtr.asFunction)>(); /// CAPI3REF: Write-Ahead Log Commit Hook /// METHOD: sqlite3 @@ -9821,7 +9822,7 @@ class SQLite { ); } - late final _sqlite3_wal_hook_ptr = _lookup< + late final _sqlite3_wal_hookPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, @@ -9833,7 +9834,7 @@ class SQLite { ffi.Pointer, ffi.Int32)>>, ffi.Pointer)>>('sqlite3_wal_hook'); - late final _sqlite3_wal_hook = _sqlite3_wal_hook_ptr.asFunction< + late final _sqlite3_wal_hook = _sqlite3_wal_hookPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer< @@ -9879,11 +9880,11 @@ class SQLite { ); } - late final _sqlite3_wal_autocheckpoint_ptr = _lookup< + late final _sqlite3_wal_autocheckpointPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Int32)>>('sqlite3_wal_autocheckpoint'); - late final _sqlite3_wal_autocheckpoint = _sqlite3_wal_autocheckpoint_ptr + late final _sqlite3_wal_autocheckpoint = _sqlite3_wal_autocheckpointPtr .asFunction, int)>(); /// CAPI3REF: Checkpoint a database @@ -9914,11 +9915,11 @@ class SQLite { ); } - late final _sqlite3_wal_checkpoint_ptr = _lookup< + late final _sqlite3_wal_checkpointPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('sqlite3_wal_checkpoint'); - late final _sqlite3_wal_checkpoint = _sqlite3_wal_checkpoint_ptr + late final _sqlite3_wal_checkpoint = _sqlite3_wal_checkpointPtr .asFunction, ffi.Pointer)>(); /// CAPI3REF: Checkpoint a database @@ -10027,7 +10028,7 @@ class SQLite { ); } - late final _sqlite3_wal_checkpoint_v2_ptr = _lookup< + late final _sqlite3_wal_checkpoint_v2Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -10036,7 +10037,7 @@ class SQLite { ffi.Pointer, ffi.Pointer)>>('sqlite3_wal_checkpoint_v2'); late final _sqlite3_wal_checkpoint_v2 = - _sqlite3_wal_checkpoint_v2_ptr.asFunction< + _sqlite3_wal_checkpoint_v2Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer, ffi.Pointer)>(); @@ -10066,11 +10067,11 @@ class SQLite { ); } - late final _sqlite3_vtab_config_ptr = _lookup< + late final _sqlite3_vtab_configPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Int32)>>('sqlite3_vtab_config'); - late final _sqlite3_vtab_config = _sqlite3_vtab_config_ptr + late final _sqlite3_vtab_config = _sqlite3_vtab_configPtr .asFunction, int)>(); /// CAPI3REF: Determine The Virtual Table Conflict Policy @@ -10089,10 +10090,10 @@ class SQLite { ); } - late final _sqlite3_vtab_on_conflict_ptr = + late final _sqlite3_vtab_on_conflictPtr = _lookup)>>( 'sqlite3_vtab_on_conflict'); - late final _sqlite3_vtab_on_conflict = _sqlite3_vtab_on_conflict_ptr + late final _sqlite3_vtab_on_conflict = _sqlite3_vtab_on_conflictPtr .asFunction)>(); /// CAPI3REF: Determine If Virtual Table Column Access Is For UPDATE @@ -10118,10 +10119,10 @@ class SQLite { ); } - late final _sqlite3_vtab_nochange_ptr = _lookup< + late final _sqlite3_vtab_nochangePtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_vtab_nochange'); - late final _sqlite3_vtab_nochange = _sqlite3_vtab_nochange_ptr + late final _sqlite3_vtab_nochange = _sqlite3_vtab_nochangePtr .asFunction)>(); /// CAPI3REF: Determine The Collation For a Virtual Table Constraint @@ -10145,11 +10146,11 @@ class SQLite { ); } - late final _sqlite3_vtab_collation_ptr = _lookup< + late final _sqlite3_vtab_collationPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Int32)>>('sqlite3_vtab_collation'); - late final _sqlite3_vtab_collation = _sqlite3_vtab_collation_ptr.asFunction< + late final _sqlite3_vtab_collation = _sqlite3_vtab_collationPtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: Prepared Statement Scan Status @@ -10195,11 +10196,11 @@ class SQLite { ); } - late final _sqlite3_stmt_scanstatus_ptr = _lookup< + late final _sqlite3_stmt_scanstatusPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Int32, ffi.Int32, ffi.Pointer)>>('sqlite3_stmt_scanstatus'); - late final _sqlite3_stmt_scanstatus = _sqlite3_stmt_scanstatus_ptr.asFunction< + late final _sqlite3_stmt_scanstatus = _sqlite3_stmt_scanstatusPtr.asFunction< int Function( ffi.Pointer, int, int, ffi.Pointer)>(); @@ -10218,10 +10219,10 @@ class SQLite { ); } - late final _sqlite3_stmt_scanstatus_reset_ptr = + late final _sqlite3_stmt_scanstatus_resetPtr = _lookup)>>( 'sqlite3_stmt_scanstatus_reset'); - late final _sqlite3_stmt_scanstatus_reset = _sqlite3_stmt_scanstatus_reset_ptr + late final _sqlite3_stmt_scanstatus_reset = _sqlite3_stmt_scanstatus_resetPtr .asFunction)>(); /// CAPI3REF: Flush caches to disk mid-transaction @@ -10260,10 +10261,10 @@ class SQLite { ); } - late final _sqlite3_db_cacheflush_ptr = + late final _sqlite3_db_cacheflushPtr = _lookup)>>( 'sqlite3_db_cacheflush'); - late final _sqlite3_db_cacheflush = _sqlite3_db_cacheflush_ptr + late final _sqlite3_db_cacheflush = _sqlite3_db_cacheflushPtr .asFunction)>(); /// CAPI3REF: Low-level system error code @@ -10282,11 +10283,11 @@ class SQLite { ); } - late final _sqlite3_system_errno_ptr = + late final _sqlite3_system_errnoPtr = _lookup)>>( 'sqlite3_system_errno'); - late final _sqlite3_system_errno = _sqlite3_system_errno_ptr - .asFunction)>(); + late final _sqlite3_system_errno = + _sqlite3_system_errnoPtr.asFunction)>(); /// CAPI3REF: Record A Database Snapshot /// CONSTRUCTOR: sqlite3_snapshot @@ -10341,12 +10342,12 @@ class SQLite { ); } - late final _sqlite3_snapshot_get_ptr = _lookup< + late final _sqlite3_snapshot_getPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer>)>>( 'sqlite3_snapshot_get'); - late final _sqlite3_snapshot_get = _sqlite3_snapshot_get_ptr.asFunction< + late final _sqlite3_snapshot_get = _sqlite3_snapshot_getPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer>)>(); @@ -10403,11 +10404,11 @@ class SQLite { ); } - late final _sqlite3_snapshot_open_ptr = _lookup< + late final _sqlite3_snapshot_openPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('sqlite3_snapshot_open'); - late final _sqlite3_snapshot_open = _sqlite3_snapshot_open_ptr.asFunction< + late final _sqlite3_snapshot_open = _sqlite3_snapshot_openPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -10428,10 +10429,10 @@ class SQLite { ); } - late final _sqlite3_snapshot_free_ptr = _lookup< + late final _sqlite3_snapshot_freePtr = _lookup< ffi.NativeFunction)>>( 'sqlite3_snapshot_free'); - late final _sqlite3_snapshot_free = _sqlite3_snapshot_free_ptr + late final _sqlite3_snapshot_free = _sqlite3_snapshot_freePtr .asFunction)>(); /// CAPI3REF: Compare the ages of two snapshot handles. @@ -10467,11 +10468,11 @@ class SQLite { ); } - late final _sqlite3_snapshot_cmp_ptr = _lookup< + late final _sqlite3_snapshot_cmpPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('sqlite3_snapshot_cmp'); - late final _sqlite3_snapshot_cmp = _sqlite3_snapshot_cmp_ptr.asFunction< + late final _sqlite3_snapshot_cmp = _sqlite3_snapshot_cmpPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer)>(); @@ -10506,11 +10507,11 @@ class SQLite { ); } - late final _sqlite3_snapshot_recover_ptr = _lookup< + late final _sqlite3_snapshot_recoverPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('sqlite3_snapshot_recover'); - late final _sqlite3_snapshot_recover = _sqlite3_snapshot_recover_ptr + late final _sqlite3_snapshot_recover = _sqlite3_snapshot_recoverPtr .asFunction, ffi.Pointer)>(); /// CAPI3REF: Serialize a database @@ -10561,14 +10562,14 @@ class SQLite { ); } - late final _sqlite3_serialize_ptr = _lookup< + late final _sqlite3_serializePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Uint32)>>('sqlite3_serialize'); - late final _sqlite3_serialize = _sqlite3_serialize_ptr.asFunction< + late final _sqlite3_serialize = _sqlite3_serializePtr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); @@ -10617,7 +10618,7 @@ class SQLite { ); } - late final _sqlite3_deserialize_ptr = _lookup< + late final _sqlite3_deserializePtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -10626,7 +10627,7 @@ class SQLite { sqlite3_int64, sqlite3_int64, ffi.Uint32)>>('sqlite3_deserialize'); - late final _sqlite3_deserialize = _sqlite3_deserialize_ptr.asFunction< + late final _sqlite3_deserialize = _sqlite3_deserializePtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, int, int)>(); @@ -10655,7 +10656,7 @@ class SQLite { ); } - late final _sqlite3_rtree_geometry_callback_ptr = _lookup< + late final _sqlite3_rtree_geometry_callbackPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -10669,7 +10670,7 @@ class SQLite { ffi.Pointer)>>, ffi.Pointer)>>('sqlite3_rtree_geometry_callback'); late final _sqlite3_rtree_geometry_callback = - _sqlite3_rtree_geometry_callback_ptr.asFunction< + _sqlite3_rtree_geometry_callbackPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -10706,7 +10707,7 @@ class SQLite { ); } - late final _sqlite3_rtree_query_callback_ptr = _lookup< + late final _sqlite3_rtree_query_callbackPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, @@ -10721,7 +10722,7 @@ class SQLite { ffi.Void Function(ffi.Pointer)>>)>>( 'sqlite3_rtree_query_callback'); late final _sqlite3_rtree_query_callback = - _sqlite3_rtree_query_callback_ptr.asFunction< + _sqlite3_rtree_query_callbackPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, diff --git a/pkgs/ffigen/test/large_integration_tests/large_test.dart b/pkgs/ffigen/test/large_integration_tests/large_test.dart index 35bb635d1f..a3fadae169 100644 --- a/pkgs/ffigen/test/large_integration_tests/large_test.dart +++ b/pkgs/ffigen/test/large_integration_tests/large_test.dart @@ -40,6 +40,8 @@ ${strings.headers}: ${strings.typedefmap}: 'size_t': 'IntPtr' 'time_t': 'Int64' +${strings.preamble}: | + // ignore_for_file: camel_case_types, non_constant_identifier_names ''') as YamlMap); final library = parse(config); @@ -64,6 +66,8 @@ ${strings.headers}: - '**cJSON.h' ${strings.typedefmap}: 'size_t': 'IntPtr' +${strings.preamble}: | + // ignore_for_file: camel_case_types, non_constant_identifier_names ''') as YamlMap); final library = parse(config); @@ -94,6 +98,8 @@ ${strings.functions}: - sqlite3_vmprintf - sqlite3_vsnprintf - sqlite3_str_vappendf +${strings.preamble}: | + // ignore_for_file: camel_case_types, non_constant_identifier_names ''') as YamlMap); final library = parse(config); diff --git a/pkgs/ffigen/test/native_test/config.yaml b/pkgs/ffigen/test/native_test/config.yaml index d68a62fdf7..6d8e475284 100644 --- a/pkgs/ffigen/test/native_test/config.yaml +++ b/pkgs/ffigen/test/native_test/config.yaml @@ -16,3 +16,6 @@ headers: - '**native_test.c' compiler-opts: '-Wno-nullability-completeness' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names + diff --git a/pkgs/ffigen/test/native_test/native_test_bindings.dart b/pkgs/ffigen/test/native_test/native_test_bindings.dart index ef7ee4596b..8c4d0ea802 100644 --- a/pkgs/ffigen/test/native_test/native_test_bindings.dart +++ b/pkgs/ffigen/test/native_test/native_test_bindings.dart @@ -1,3 +1,5 @@ +// ignore_for_file: camel_case_types, non_constant_identifier_names + // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. @@ -28,11 +30,10 @@ class NativeLibrary { 0; } - late final _Function1Bool_ptr = + late final _Function1BoolPtr = _lookup>( 'Function1Bool'); - late final _Function1Bool = - _Function1Bool_ptr.asFunction(); + late final _Function1Bool = _Function1BoolPtr.asFunction(); int Function1Uint8( int x, @@ -42,11 +43,11 @@ class NativeLibrary { ); } - late final _Function1Uint8_ptr = + late final _Function1Uint8Ptr = _lookup>( 'Function1Uint8'); late final _Function1Uint8 = - _Function1Uint8_ptr.asFunction(); + _Function1Uint8Ptr.asFunction(); int Function1Uint16( int x, @@ -56,11 +57,11 @@ class NativeLibrary { ); } - late final _Function1Uint16_ptr = + late final _Function1Uint16Ptr = _lookup>( 'Function1Uint16'); late final _Function1Uint16 = - _Function1Uint16_ptr.asFunction(); + _Function1Uint16Ptr.asFunction(); int Function1Uint32( int x, @@ -70,11 +71,11 @@ class NativeLibrary { ); } - late final _Function1Uint32_ptr = + late final _Function1Uint32Ptr = _lookup>( 'Function1Uint32'); late final _Function1Uint32 = - _Function1Uint32_ptr.asFunction(); + _Function1Uint32Ptr.asFunction(); int Function1Uint64( int x, @@ -84,11 +85,11 @@ class NativeLibrary { ); } - late final _Function1Uint64_ptr = + late final _Function1Uint64Ptr = _lookup>( 'Function1Uint64'); late final _Function1Uint64 = - _Function1Uint64_ptr.asFunction(); + _Function1Uint64Ptr.asFunction(); int Function1Int8( int x, @@ -98,10 +99,9 @@ class NativeLibrary { ); } - late final _Function1Int8_ptr = + late final _Function1Int8Ptr = _lookup>('Function1Int8'); - late final _Function1Int8 = - _Function1Int8_ptr.asFunction(); + late final _Function1Int8 = _Function1Int8Ptr.asFunction(); int Function1Int16( int x, @@ -111,11 +111,11 @@ class NativeLibrary { ); } - late final _Function1Int16_ptr = + late final _Function1Int16Ptr = _lookup>( 'Function1Int16'); late final _Function1Int16 = - _Function1Int16_ptr.asFunction(); + _Function1Int16Ptr.asFunction(); int Function1Int32( int x, @@ -125,11 +125,11 @@ class NativeLibrary { ); } - late final _Function1Int32_ptr = + late final _Function1Int32Ptr = _lookup>( 'Function1Int32'); late final _Function1Int32 = - _Function1Int32_ptr.asFunction(); + _Function1Int32Ptr.asFunction(); int Function1Int64( int x, @@ -139,11 +139,11 @@ class NativeLibrary { ); } - late final _Function1Int64_ptr = + late final _Function1Int64Ptr = _lookup>( 'Function1Int64'); late final _Function1Int64 = - _Function1Int64_ptr.asFunction(); + _Function1Int64Ptr.asFunction(); int Function1IntPtr( int x, @@ -153,11 +153,11 @@ class NativeLibrary { ); } - late final _Function1IntPtr_ptr = + late final _Function1IntPtrPtr = _lookup>( 'Function1IntPtr'); late final _Function1IntPtr = - _Function1IntPtr_ptr.asFunction(); + _Function1IntPtrPtr.asFunction(); double Function1Float( double x, @@ -167,11 +167,11 @@ class NativeLibrary { ); } - late final _Function1Float_ptr = + late final _Function1FloatPtr = _lookup>( 'Function1Float'); late final _Function1Float = - _Function1Float_ptr.asFunction(); + _Function1FloatPtr.asFunction(); double Function1Double( double x, @@ -181,21 +181,21 @@ class NativeLibrary { ); } - late final _Function1Double_ptr = + late final _Function1DoublePtr = _lookup>( 'Function1Double'); late final _Function1Double = - _Function1Double_ptr.asFunction(); + _Function1DoublePtr.asFunction(); ffi.Pointer getStruct1() { return _getStruct1(); } - late final _getStruct1_ptr = + late final _getStruct1Ptr = _lookup Function()>>( 'getStruct1'); late final _getStruct1 = - _getStruct1_ptr.asFunction Function()>(); + _getStruct1Ptr.asFunction Function()>(); Struct3 Function1StructReturnByValue( int a, @@ -209,11 +209,11 @@ class NativeLibrary { ); } - late final _Function1StructReturnByValue_ptr = _lookup< + late final _Function1StructReturnByValuePtr = _lookup< ffi.NativeFunction< Struct3 Function(ffi.Int32, ffi.Int32, ffi.Int32)>>('Function1StructReturnByValue'); - late final _Function1StructReturnByValue = _Function1StructReturnByValue_ptr + late final _Function1StructReturnByValue = _Function1StructReturnByValuePtr .asFunction(); int Function1StructPassByValue( @@ -224,11 +224,11 @@ class NativeLibrary { ); } - late final _Function1StructPassByValue_ptr = + late final _Function1StructPassByValuePtr = _lookup>( 'Function1StructPassByValue'); late final _Function1StructPassByValue = - _Function1StructPassByValue_ptr.asFunction(); + _Function1StructPassByValuePtr.asFunction(); } class Struct1 extends ffi.Struct { diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index b6af5e10f1..c6940ac283 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -29,6 +29,8 @@ preamble: | // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + // ignore_for_file: camel_case_types, non_constant_identifier_names + enums: include: - CXChildVisitResult From 9a5ceb7764bbdd97f1c60278d1631d9b8e382228 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 7 Jun 2021 19:20:31 +0530 Subject: [PATCH 090/276] [ffigen] Added config for exposing typedefs to Native and Dart type. (#231) --- pkgs/ffigen/CHANGELOG.md | 6 + pkgs/ffigen/README.md | 57 +- .../libclang-example/generated_bindings.dart | 3632 +++++++++-------- .../example/libclang-example/pubspec.yaml | 5 +- pkgs/ffigen/lib/src/code_generator/func.dart | 36 +- .../lib/src/code_generator/typealias.dart | 12 +- .../lib/src/config_provider/config.dart | 12 + .../lib/src/config_provider/spec_utils.dart | 25 + .../sub_parsers/functiondecl_parser.dart | 2 + pkgs/ffigen/lib/src/strings.dart | 3 + pkgs/ffigen/pubspec.yaml | 2 +- .../decl_symbol_address_collision_test.dart | 1 + ...ecl_symbol_address_collision_bindings.dart | 17 +- .../example_tests/libclang_example_test.dart | 3 + .../_expected_functions_bindings.dart | 31 +- 15 files changed, 2209 insertions(+), 1635 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 82edf93079..47b2a05f93 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,9 @@ +# 4.0.0-dev.2 +- Added config key `functions -> expose-typedefs` to expose the typedef +to Native and Dart type. +- Config key `function`->`symbol-address` no longer exposes the typedef +to Native type. Use `expose-typedefs` to get the native type. + # 4.0.0-dev.1 - This package now targets package:lints for the generated code. The generated code uses C symbol names as is. Use either `// ignore_for_file: lintRule1, lintRule2` diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 5fc7822c0f..e89ceb2e75 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -188,7 +188,7 @@ compiler-opts-automatic: - Include/Exclude declarations.
- Rename declarations.
- Rename enum and struct members.
- - Expose symbol-address and typedef for functions and globals.
+ - Expose symbol-address for functions and globals.
+ + + + + @@ -527,18 +550,38 @@ unions: dependency-only: opaque ``` -### How to expose the native pointers and typedefs? +### How to expose the native pointers? -By default all native pointers and typedefs are hidden, but you can use the -`symbol-address` subkey for functions/globals and make them public by matching with its name. The pointers are then accesible via `nativeLibrary.addresses` and the native typedef are prefixed with `Native_`. +By default the native pointers are private, but you can use the +`symbol-address` subkey for functions/globals and make them public by matching with its name. The pointers are then accesible via `nativeLibrary.addresses`. Example - ```yaml functions: symbol-address: include: - - 'myFunc' - - '.*' # Do this to expose all pointers. + - 'myFunc' # Match function name. + - '.*' # Do this to expose all function pointers. + exclude: # If you only use exclude, then everything not excluded is generated. + - 'dispose' +``` + +### How to get typedefs to Native and Dart type of a function? + +By default these types are inline. But you can use the `expose-typedef` subkey +for functions to generate them. This will expose the Native and Dart type. +E.g - for a function named `hello`, the generated typedefs are named +as `NativeHello` and `DartHello`. + +Example - +```yaml +functions: + expose-typedefs: + include: + - 'myFunc' # Match function name. + - '.*' # Do this to expose types for all function. + exclude: # If you only use exclude, then everything not excluded is generated. + - 'dispose' ``` ### How are Structs/Unions/Enums that are reffered to via typedefs handled? diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index f77c7e64f1..1c7c15b633 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -35,9 +35,9 @@ class LibClang { } late final _clang_getCStringPtr = - _lookup>('clang_getCString'); - late final _clang_getCString = _clang_getCStringPtr - .asFunction Function(CXString)>(); + _lookup>('clang_getCString'); + late final _clang_getCString = + _clang_getCStringPtr.asFunction(); /// Free the given string. void clang_disposeString( @@ -49,10 +49,10 @@ class LibClang { } late final _clang_disposeStringPtr = - _lookup>( + _lookup>( 'clang_disposeString'); late final _clang_disposeString = - _clang_disposeStringPtr.asFunction(); + _clang_disposeStringPtr.asFunction(); /// Free the given string set. void clang_disposeStringSet( @@ -64,10 +64,10 @@ class LibClang { } late final _clang_disposeStringSetPtr = - _lookup>( + _lookup>( 'clang_disposeStringSet'); - late final _clang_disposeStringSet = _clang_disposeStringSetPtr - .asFunction)>(); + late final _clang_disposeStringSet = + _clang_disposeStringSetPtr.asFunction(); /// Provides a shared context for creating translation units. /// @@ -118,10 +118,9 @@ class LibClang { } late final _clang_createIndexPtr = - _lookup>( - 'clang_createIndex'); + _lookup>('clang_createIndex'); late final _clang_createIndex = - _clang_createIndexPtr.asFunction(); + _clang_createIndexPtr.asFunction(); /// Destroy the given index. /// @@ -136,10 +135,10 @@ class LibClang { } late final _clang_disposeIndexPtr = - _lookup>( + _lookup>( 'clang_disposeIndex'); late final _clang_disposeIndex = - _clang_disposeIndexPtr.asFunction(); + _clang_disposeIndexPtr.asFunction(); /// Sets general options associated with a CXIndex. /// @@ -163,11 +162,11 @@ class LibClang { } late final _clang_CXIndex_setGlobalOptionsPtr = - _lookup>( + _lookup>( 'clang_CXIndex_setGlobalOptions'); late final _clang_CXIndex_setGlobalOptions = _clang_CXIndex_setGlobalOptionsPtr - .asFunction(); + .asFunction(); /// Gets the general options associated with a CXIndex. /// @@ -182,10 +181,11 @@ class LibClang { } late final _clang_CXIndex_getGlobalOptionsPtr = - _lookup>( + _lookup>( 'clang_CXIndex_getGlobalOptions'); late final _clang_CXIndex_getGlobalOptions = - _clang_CXIndex_getGlobalOptionsPtr.asFunction(); + _clang_CXIndex_getGlobalOptionsPtr + .asFunction(); /// Sets the invocation emission path option in a CXIndex. /// @@ -204,11 +204,11 @@ class LibClang { late final _clang_CXIndex_setInvocationEmissionPathOptionPtr = _lookup< ffi.NativeFunction< - Native_clang_CXIndex_setInvocationEmissionPathOption>>( + NativeClang_CXIndex_setInvocationEmissionPathOption>>( 'clang_CXIndex_setInvocationEmissionPathOption'); late final _clang_CXIndex_setInvocationEmissionPathOption = _clang_CXIndex_setInvocationEmissionPathOptionPtr - .asFunction)>(); + .asFunction(); /// Retrieve the complete file and path name of the given file. CXString clang_getFileName( @@ -220,10 +220,9 @@ class LibClang { } late final _clang_getFileNamePtr = - _lookup>( - 'clang_getFileName'); + _lookup>('clang_getFileName'); late final _clang_getFileName = - _clang_getFileNamePtr.asFunction(); + _clang_getFileNamePtr.asFunction(); /// Retrieve the last modification time of the given file. int clang_getFileTime( @@ -235,10 +234,9 @@ class LibClang { } late final _clang_getFileTimePtr = - _lookup>( - 'clang_getFileTime'); + _lookup>('clang_getFileTime'); late final _clang_getFileTime = - _clang_getFileTimePtr.asFunction(); + _clang_getFileTimePtr.asFunction(); /// Retrieve the unique ID for the given \c file. /// @@ -257,10 +255,10 @@ class LibClang { } late final _clang_getFileUniqueIDPtr = - _lookup>( + _lookup>( 'clang_getFileUniqueID'); - late final _clang_getFileUniqueID = _clang_getFileUniqueIDPtr - .asFunction)>(); + late final _clang_getFileUniqueID = + _clang_getFileUniqueIDPtr.asFunction(); /// Determine whether the given header is guarded against /// multiple inclusions, either with the conventional @@ -276,11 +274,11 @@ class LibClang { } late final _clang_isFileMultipleIncludeGuardedPtr = - _lookup>( + _lookup>( 'clang_isFileMultipleIncludeGuarded'); late final _clang_isFileMultipleIncludeGuarded = _clang_isFileMultipleIncludeGuardedPtr - .asFunction(); + .asFunction(); /// Retrieve a file handle within the given translation unit. /// @@ -301,9 +299,8 @@ class LibClang { } late final _clang_getFilePtr = - _lookup>('clang_getFile'); - late final _clang_getFile = _clang_getFilePtr - .asFunction)>(); + _lookup>('clang_getFile'); + late final _clang_getFile = _clang_getFilePtr.asFunction(); /// Retrieve the buffer associated with the given file. /// @@ -328,11 +325,10 @@ class LibClang { } late final _clang_getFileContentsPtr = - _lookup>( + _lookup>( 'clang_getFileContents'); - late final _clang_getFileContents = _clang_getFileContentsPtr.asFunction< - ffi.Pointer Function( - CXTranslationUnit, CXFile, ffi.Pointer)>(); + late final _clang_getFileContents = + _clang_getFileContentsPtr.asFunction(); /// Returns non-zero if the \c file1 and \c file2 point to the same file, /// or they are both NULL. @@ -347,10 +343,10 @@ class LibClang { } late final _clang_File_isEqualPtr = - _lookup>( + _lookup>( 'clang_File_isEqual'); late final _clang_File_isEqual = - _clang_File_isEqualPtr.asFunction(); + _clang_File_isEqualPtr.asFunction(); /// Returns the real path name of \c file. /// @@ -364,10 +360,10 @@ class LibClang { } late final _clang_File_tryGetRealPathNamePtr = - _lookup>( + _lookup>( 'clang_File_tryGetRealPathName'); - late final _clang_File_tryGetRealPathName = - _clang_File_tryGetRealPathNamePtr.asFunction(); + late final _clang_File_tryGetRealPathName = _clang_File_tryGetRealPathNamePtr + .asFunction(); /// Retrieve a NULL (invalid) source location. CXSourceLocation clang_getNullLocation() { @@ -375,10 +371,10 @@ class LibClang { } late final _clang_getNullLocationPtr = - _lookup>( + _lookup>( 'clang_getNullLocation'); late final _clang_getNullLocation = - _clang_getNullLocationPtr.asFunction(); + _clang_getNullLocationPtr.asFunction(); /// Determine whether two source locations, which must refer into /// the same translation unit, refer to exactly the same point in the source @@ -397,10 +393,10 @@ class LibClang { } late final _clang_equalLocationsPtr = - _lookup>( + _lookup>( 'clang_equalLocations'); - late final _clang_equalLocations = _clang_equalLocationsPtr - .asFunction(); + late final _clang_equalLocations = + _clang_equalLocationsPtr.asFunction(); /// Retrieves the source location associated with a given file/line/column /// in a particular translation unit. @@ -419,10 +415,9 @@ class LibClang { } late final _clang_getLocationPtr = - _lookup>( - 'clang_getLocation'); - late final _clang_getLocation = _clang_getLocationPtr.asFunction< - CXSourceLocation Function(CXTranslationUnit, CXFile, int, int)>(); + _lookup>('clang_getLocation'); + late final _clang_getLocation = + _clang_getLocationPtr.asFunction(); /// Retrieves the source location associated with a given character offset /// in a particular translation unit. @@ -439,10 +434,10 @@ class LibClang { } late final _clang_getLocationForOffsetPtr = - _lookup>( + _lookup>( 'clang_getLocationForOffset'); late final _clang_getLocationForOffset = _clang_getLocationForOffsetPtr - .asFunction(); + .asFunction(); /// Returns non-zero if the given source location is in a system header. int clang_Location_isInSystemHeader( @@ -454,11 +449,11 @@ class LibClang { } late final _clang_Location_isInSystemHeaderPtr = - _lookup>( + _lookup>( 'clang_Location_isInSystemHeader'); late final _clang_Location_isInSystemHeader = _clang_Location_isInSystemHeaderPtr - .asFunction(); + .asFunction(); /// Returns non-zero if the given source location is in the main file of /// the corresponding translation unit. @@ -471,10 +466,10 @@ class LibClang { } late final _clang_Location_isFromMainFilePtr = - _lookup>( + _lookup>( 'clang_Location_isFromMainFile'); late final _clang_Location_isFromMainFile = _clang_Location_isFromMainFilePtr - .asFunction(); + .asFunction(); /// Retrieve a NULL (invalid) source range. CXSourceRange clang_getNullRange() { @@ -482,10 +477,10 @@ class LibClang { } late final _clang_getNullRangePtr = - _lookup>( + _lookup>( 'clang_getNullRange'); late final _clang_getNullRange = - _clang_getNullRangePtr.asFunction(); + _clang_getNullRangePtr.asFunction(); /// Retrieve a source range given the beginning and ending source /// locations. @@ -500,9 +495,9 @@ class LibClang { } late final _clang_getRangePtr = - _lookup>('clang_getRange'); - late final _clang_getRange = _clang_getRangePtr - .asFunction(); + _lookup>('clang_getRange'); + late final _clang_getRange = + _clang_getRangePtr.asFunction(); /// Determine whether two ranges are equivalent. /// @@ -518,10 +513,9 @@ class LibClang { } late final _clang_equalRangesPtr = - _lookup>( - 'clang_equalRanges'); - late final _clang_equalRanges = _clang_equalRangesPtr - .asFunction(); + _lookup>('clang_equalRanges'); + late final _clang_equalRanges = + _clang_equalRangesPtr.asFunction(); /// Returns non-zero if \p range is null. int clang_Range_isNull( @@ -533,10 +527,10 @@ class LibClang { } late final _clang_Range_isNullPtr = - _lookup>( + _lookup>( 'clang_Range_isNull'); late final _clang_Range_isNull = - _clang_Range_isNullPtr.asFunction(); + _clang_Range_isNullPtr.asFunction(); /// Retrieve the file, line, column, and offset represented by /// the given source location. @@ -575,16 +569,10 @@ class LibClang { } late final _clang_getExpansionLocationPtr = - _lookup>( + _lookup>( 'clang_getExpansionLocation'); - late final _clang_getExpansionLocation = - _clang_getExpansionLocationPtr.asFunction< - void Function( - CXSourceLocation, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + late final _clang_getExpansionLocation = _clang_getExpansionLocationPtr + .asFunction(); /// Retrieve the file, line and column represented by the given source /// location, as specified in a # line directive. @@ -639,12 +627,10 @@ class LibClang { } late final _clang_getPresumedLocationPtr = - _lookup>( + _lookup>( 'clang_getPresumedLocation'); late final _clang_getPresumedLocation = - _clang_getPresumedLocationPtr.asFunction< - void Function(CXSourceLocation, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + _clang_getPresumedLocationPtr.asFunction(); /// Legacy API to retrieve the file, line, column, and offset represented /// by the given source location. @@ -669,16 +655,11 @@ class LibClang { } late final _clang_getInstantiationLocationPtr = - _lookup>( + _lookup>( 'clang_getInstantiationLocation'); late final _clang_getInstantiationLocation = - _clang_getInstantiationLocationPtr.asFunction< - void Function( - CXSourceLocation, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + _clang_getInstantiationLocationPtr + .asFunction(); /// Retrieve the file, line, column, and offset represented by /// the given source location. @@ -717,16 +698,10 @@ class LibClang { } late final _clang_getSpellingLocationPtr = - _lookup>( + _lookup>( 'clang_getSpellingLocation'); late final _clang_getSpellingLocation = - _clang_getSpellingLocationPtr.asFunction< - void Function( - CXSourceLocation, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + _clang_getSpellingLocationPtr.asFunction(); /// Retrieve the file, line, column, and offset represented by /// the given source location. @@ -766,15 +741,10 @@ class LibClang { } late final _clang_getFileLocationPtr = - _lookup>( + _lookup>( 'clang_getFileLocation'); - late final _clang_getFileLocation = _clang_getFileLocationPtr.asFunction< - void Function( - CXSourceLocation, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + late final _clang_getFileLocation = + _clang_getFileLocationPtr.asFunction(); /// Retrieve a source location representing the first character within a /// source range. @@ -787,10 +757,10 @@ class LibClang { } late final _clang_getRangeStartPtr = - _lookup>( + _lookup>( 'clang_getRangeStart'); - late final _clang_getRangeStart = _clang_getRangeStartPtr - .asFunction(); + late final _clang_getRangeStart = + _clang_getRangeStartPtr.asFunction(); /// Retrieve a source location representing the last character within a /// source range. @@ -803,10 +773,9 @@ class LibClang { } late final _clang_getRangeEndPtr = - _lookup>( - 'clang_getRangeEnd'); - late final _clang_getRangeEnd = _clang_getRangeEndPtr - .asFunction(); + _lookup>('clang_getRangeEnd'); + late final _clang_getRangeEnd = + _clang_getRangeEndPtr.asFunction(); /// Retrieve all ranges that were skipped by the preprocessor. /// @@ -823,10 +792,10 @@ class LibClang { } late final _clang_getSkippedRangesPtr = - _lookup>( + _lookup>( 'clang_getSkippedRanges'); - late final _clang_getSkippedRanges = _clang_getSkippedRangesPtr.asFunction< - ffi.Pointer Function(CXTranslationUnit, CXFile)>(); + late final _clang_getSkippedRanges = + _clang_getSkippedRangesPtr.asFunction(); /// Retrieve all ranges from all files that were skipped by the /// preprocessor. @@ -842,10 +811,10 @@ class LibClang { } late final _clang_getAllSkippedRangesPtr = - _lookup>( + _lookup>( 'clang_getAllSkippedRanges'); - late final _clang_getAllSkippedRanges = _clang_getAllSkippedRangesPtr - .asFunction Function(CXTranslationUnit)>(); + late final _clang_getAllSkippedRanges = + _clang_getAllSkippedRangesPtr.asFunction(); /// Destroy the given \c CXSourceRangeList. void clang_disposeSourceRangeList( @@ -857,10 +826,10 @@ class LibClang { } late final _clang_disposeSourceRangeListPtr = - _lookup>( + _lookup>( 'clang_disposeSourceRangeList'); late final _clang_disposeSourceRangeList = _clang_disposeSourceRangeListPtr - .asFunction)>(); + .asFunction(); /// Determine the number of diagnostics in a CXDiagnosticSet. int clang_getNumDiagnosticsInSet( @@ -872,10 +841,10 @@ class LibClang { } late final _clang_getNumDiagnosticsInSetPtr = - _lookup>( + _lookup>( 'clang_getNumDiagnosticsInSet'); late final _clang_getNumDiagnosticsInSet = _clang_getNumDiagnosticsInSetPtr - .asFunction(); + .asFunction(); /// Retrieve a diagnostic associated with the given CXDiagnosticSet. /// @@ -895,10 +864,10 @@ class LibClang { } late final _clang_getDiagnosticInSetPtr = - _lookup>( + _lookup>( 'clang_getDiagnosticInSet'); - late final _clang_getDiagnosticInSet = _clang_getDiagnosticInSetPtr - .asFunction(); + late final _clang_getDiagnosticInSet = + _clang_getDiagnosticInSetPtr.asFunction(); /// Deserialize a set of diagnostics from a Clang diagnostics bitcode /// file. @@ -924,11 +893,10 @@ class LibClang { } late final _clang_loadDiagnosticsPtr = - _lookup>( + _lookup>( 'clang_loadDiagnostics'); - late final _clang_loadDiagnostics = _clang_loadDiagnosticsPtr.asFunction< - CXDiagnosticSet Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _clang_loadDiagnostics = + _clang_loadDiagnosticsPtr.asFunction(); /// Release a CXDiagnosticSet and all of its contained diagnostics. void clang_disposeDiagnosticSet( @@ -940,10 +908,10 @@ class LibClang { } late final _clang_disposeDiagnosticSetPtr = - _lookup>( + _lookup>( 'clang_disposeDiagnosticSet'); late final _clang_disposeDiagnosticSet = _clang_disposeDiagnosticSetPtr - .asFunction(); + .asFunction(); /// Retrieve the child diagnostics of a CXDiagnostic. /// @@ -958,10 +926,10 @@ class LibClang { } late final _clang_getChildDiagnosticsPtr = - _lookup>( + _lookup>( 'clang_getChildDiagnostics'); - late final _clang_getChildDiagnostics = _clang_getChildDiagnosticsPtr - .asFunction(); + late final _clang_getChildDiagnostics = + _clang_getChildDiagnosticsPtr.asFunction(); /// Determine the number of diagnostics produced for the given /// translation unit. @@ -974,10 +942,10 @@ class LibClang { } late final _clang_getNumDiagnosticsPtr = - _lookup>( + _lookup>( 'clang_getNumDiagnostics'); late final _clang_getNumDiagnostics = - _clang_getNumDiagnosticsPtr.asFunction(); + _clang_getNumDiagnosticsPtr.asFunction(); /// Retrieve a diagnostic associated with the given translation unit. /// @@ -997,10 +965,10 @@ class LibClang { } late final _clang_getDiagnosticPtr = - _lookup>( + _lookup>( 'clang_getDiagnostic'); - late final _clang_getDiagnostic = _clang_getDiagnosticPtr - .asFunction(); + late final _clang_getDiagnostic = + _clang_getDiagnosticPtr.asFunction(); /// Retrieve the complete set of diagnostics associated with a /// translation unit. @@ -1015,10 +983,10 @@ class LibClang { } late final _clang_getDiagnosticSetFromTUPtr = - _lookup>( + _lookup>( 'clang_getDiagnosticSetFromTU'); late final _clang_getDiagnosticSetFromTU = _clang_getDiagnosticSetFromTUPtr - .asFunction(); + .asFunction(); /// Destroy a diagnostic. void clang_disposeDiagnostic( @@ -1030,10 +998,10 @@ class LibClang { } late final _clang_disposeDiagnosticPtr = - _lookup>( + _lookup>( 'clang_disposeDiagnostic'); late final _clang_disposeDiagnostic = - _clang_disposeDiagnosticPtr.asFunction(); + _clang_disposeDiagnosticPtr.asFunction(); /// Format the given diagnostic in a manner that is suitable for display. /// @@ -1059,10 +1027,10 @@ class LibClang { } late final _clang_formatDiagnosticPtr = - _lookup>( + _lookup>( 'clang_formatDiagnostic'); - late final _clang_formatDiagnostic = _clang_formatDiagnosticPtr - .asFunction(); + late final _clang_formatDiagnostic = + _clang_formatDiagnosticPtr.asFunction(); /// Retrieve the set of display options most similar to the /// default behavior of the clang compiler. @@ -1074,10 +1042,11 @@ class LibClang { } late final _clang_defaultDiagnosticDisplayOptionsPtr = - _lookup>( + _lookup>( 'clang_defaultDiagnosticDisplayOptions'); late final _clang_defaultDiagnosticDisplayOptions = - _clang_defaultDiagnosticDisplayOptionsPtr.asFunction(); + _clang_defaultDiagnosticDisplayOptionsPtr + .asFunction(); /// Determine the severity of the given diagnostic. int clang_getDiagnosticSeverity( @@ -1089,10 +1058,10 @@ class LibClang { } late final _clang_getDiagnosticSeverityPtr = - _lookup>( + _lookup>( 'clang_getDiagnosticSeverity'); - late final _clang_getDiagnosticSeverity = - _clang_getDiagnosticSeverityPtr.asFunction(); + late final _clang_getDiagnosticSeverity = _clang_getDiagnosticSeverityPtr + .asFunction(); /// Retrieve the source location of the given diagnostic. /// @@ -1107,10 +1076,10 @@ class LibClang { } late final _clang_getDiagnosticLocationPtr = - _lookup>( + _lookup>( 'clang_getDiagnosticLocation'); late final _clang_getDiagnosticLocation = _clang_getDiagnosticLocationPtr - .asFunction(); + .asFunction(); /// Retrieve the text of the given diagnostic. CXString clang_getDiagnosticSpelling( @@ -1122,10 +1091,10 @@ class LibClang { } late final _clang_getDiagnosticSpellingPtr = - _lookup>( + _lookup>( 'clang_getDiagnosticSpelling'); late final _clang_getDiagnosticSpelling = _clang_getDiagnosticSpellingPtr - .asFunction(); + .asFunction(); /// Retrieve the name of the command-line option that enabled this /// diagnostic. @@ -1148,10 +1117,10 @@ class LibClang { } late final _clang_getDiagnosticOptionPtr = - _lookup>( + _lookup>( 'clang_getDiagnosticOption'); - late final _clang_getDiagnosticOption = _clang_getDiagnosticOptionPtr - .asFunction)>(); + late final _clang_getDiagnosticOption = + _clang_getDiagnosticOptionPtr.asFunction(); /// Retrieve the category number for this diagnostic. /// @@ -1170,10 +1139,10 @@ class LibClang { } late final _clang_getDiagnosticCategoryPtr = - _lookup>( + _lookup>( 'clang_getDiagnosticCategory'); - late final _clang_getDiagnosticCategory = - _clang_getDiagnosticCategoryPtr.asFunction(); + late final _clang_getDiagnosticCategory = _clang_getDiagnosticCategoryPtr + .asFunction(); /// Retrieve the name of a particular diagnostic category. This /// is now deprecated. Use clang_getDiagnosticCategoryText() @@ -1192,10 +1161,11 @@ class LibClang { } late final _clang_getDiagnosticCategoryNamePtr = - _lookup>( + _lookup>( 'clang_getDiagnosticCategoryName'); late final _clang_getDiagnosticCategoryName = - _clang_getDiagnosticCategoryNamePtr.asFunction(); + _clang_getDiagnosticCategoryNamePtr + .asFunction(); /// Retrieve the diagnostic category text for a given diagnostic. /// @@ -1209,11 +1179,11 @@ class LibClang { } late final _clang_getDiagnosticCategoryTextPtr = - _lookup>( + _lookup>( 'clang_getDiagnosticCategoryText'); late final _clang_getDiagnosticCategoryText = _clang_getDiagnosticCategoryTextPtr - .asFunction(); + .asFunction(); /// Determine the number of source ranges associated with the given /// diagnostic. @@ -1226,10 +1196,10 @@ class LibClang { } late final _clang_getDiagnosticNumRangesPtr = - _lookup>( + _lookup>( 'clang_getDiagnosticNumRanges'); - late final _clang_getDiagnosticNumRanges = - _clang_getDiagnosticNumRangesPtr.asFunction(); + late final _clang_getDiagnosticNumRanges = _clang_getDiagnosticNumRangesPtr + .asFunction(); /// Retrieve a source range associated with the diagnostic. /// @@ -1253,10 +1223,10 @@ class LibClang { } late final _clang_getDiagnosticRangePtr = - _lookup>( + _lookup>( 'clang_getDiagnosticRange'); - late final _clang_getDiagnosticRange = _clang_getDiagnosticRangePtr - .asFunction(); + late final _clang_getDiagnosticRange = + _clang_getDiagnosticRangePtr.asFunction(); /// Determine the number of fix-it hints associated with the /// given diagnostic. @@ -1269,10 +1239,10 @@ class LibClang { } late final _clang_getDiagnosticNumFixItsPtr = - _lookup>( + _lookup>( 'clang_getDiagnosticNumFixIts'); - late final _clang_getDiagnosticNumFixIts = - _clang_getDiagnosticNumFixItsPtr.asFunction(); + late final _clang_getDiagnosticNumFixIts = _clang_getDiagnosticNumFixItsPtr + .asFunction(); /// Retrieve the replacement information for a given fix-it. /// @@ -1310,11 +1280,10 @@ class LibClang { } late final _clang_getDiagnosticFixItPtr = - _lookup>( + _lookup>( 'clang_getDiagnosticFixIt'); late final _clang_getDiagnosticFixIt = - _clang_getDiagnosticFixItPtr.asFunction< - CXString Function(CXDiagnostic, int, ffi.Pointer)>(); + _clang_getDiagnosticFixItPtr.asFunction(); /// Get the original translation unit source file name. CXString clang_getTranslationUnitSpelling( @@ -1326,11 +1295,11 @@ class LibClang { } late final _clang_getTranslationUnitSpellingPtr = - _lookup>( + _lookup>( 'clang_getTranslationUnitSpelling'); late final _clang_getTranslationUnitSpelling = _clang_getTranslationUnitSpellingPtr - .asFunction(); + .asFunction(); /// Return the CXTranslationUnit for a given source file and the provided /// command line arguments one would pass to the compiler. @@ -1389,17 +1358,11 @@ class LibClang { } late final _clang_createTranslationUnitFromSourceFilePtr = _lookup< - ffi.NativeFunction>( + ffi.NativeFunction>( 'clang_createTranslationUnitFromSourceFile'); late final _clang_createTranslationUnitFromSourceFile = - _clang_createTranslationUnitFromSourceFilePtr.asFunction< - CXTranslationUnit Function( - CXIndex, - ffi.Pointer, - int, - ffi.Pointer>, - int, - ffi.Pointer)>(); + _clang_createTranslationUnitFromSourceFilePtr + .asFunction(); /// Same as \c clang_createTranslationUnit2, but returns /// the \c CXTranslationUnit instead of an error code. In case of an error this @@ -1416,10 +1379,10 @@ class LibClang { } late final _clang_createTranslationUnitPtr = - _lookup>( + _lookup>( 'clang_createTranslationUnit'); late final _clang_createTranslationUnit = _clang_createTranslationUnitPtr - .asFunction)>(); + .asFunction(); /// Create a translation unit from an AST file (\c -emit-ast). /// @@ -1440,12 +1403,10 @@ class LibClang { } late final _clang_createTranslationUnit2Ptr = - _lookup>( + _lookup>( 'clang_createTranslationUnit2'); - late final _clang_createTranslationUnit2 = - _clang_createTranslationUnit2Ptr.asFunction< - int Function(CXIndex, ffi.Pointer, - ffi.Pointer)>(); + late final _clang_createTranslationUnit2 = _clang_createTranslationUnit2Ptr + .asFunction(); /// Returns the set of flags that is suitable for parsing a translation /// unit that is being edited. @@ -1462,12 +1423,11 @@ class LibClang { } late final _clang_defaultEditingTranslationUnitOptionsPtr = _lookup< - ffi.NativeFunction< - Native_clang_defaultEditingTranslationUnitOptions>>( + ffi.NativeFunction>( 'clang_defaultEditingTranslationUnitOptions'); late final _clang_defaultEditingTranslationUnitOptions = _clang_defaultEditingTranslationUnitOptionsPtr - .asFunction(); + .asFunction(); /// Same as \c clang_parseTranslationUnit2, but returns /// the \c CXTranslationUnit instead of an error code. In case of an error this @@ -1494,18 +1454,10 @@ class LibClang { } late final _clang_parseTranslationUnitPtr = - _lookup>( + _lookup>( 'clang_parseTranslationUnit'); - late final _clang_parseTranslationUnit = - _clang_parseTranslationUnitPtr.asFunction< - CXTranslationUnit Function( - CXIndex, - ffi.Pointer, - ffi.Pointer>, - int, - ffi.Pointer, - int, - int)>(); + late final _clang_parseTranslationUnit = _clang_parseTranslationUnitPtr + .asFunction(); /// Parse the given source file and the translation unit corresponding /// to that file. @@ -1572,19 +1524,10 @@ class LibClang { } late final _clang_parseTranslationUnit2Ptr = - _lookup>( + _lookup>( 'clang_parseTranslationUnit2'); - late final _clang_parseTranslationUnit2 = - _clang_parseTranslationUnit2Ptr.asFunction< - int Function( - CXIndex, - ffi.Pointer, - ffi.Pointer>, - int, - ffi.Pointer, - int, - int, - ffi.Pointer)>(); + late final _clang_parseTranslationUnit2 = _clang_parseTranslationUnit2Ptr + .asFunction(); /// Same as clang_parseTranslationUnit2 but requires a full command line /// for \c command_line_args including argv[0]. This is useful if the standard @@ -1612,19 +1555,11 @@ class LibClang { } late final _clang_parseTranslationUnit2FullArgvPtr = - _lookup>( + _lookup>( 'clang_parseTranslationUnit2FullArgv'); late final _clang_parseTranslationUnit2FullArgv = - _clang_parseTranslationUnit2FullArgvPtr.asFunction< - int Function( - CXIndex, - ffi.Pointer, - ffi.Pointer>, - int, - ffi.Pointer, - int, - int, - ffi.Pointer)>(); + _clang_parseTranslationUnit2FullArgvPtr + .asFunction(); /// Returns the set of flags that is suitable for saving a translation /// unit. @@ -1642,10 +1577,10 @@ class LibClang { } late final _clang_defaultSaveOptionsPtr = - _lookup>( + _lookup>( 'clang_defaultSaveOptions'); - late final _clang_defaultSaveOptions = _clang_defaultSaveOptionsPtr - .asFunction(); + late final _clang_defaultSaveOptions = + _clang_defaultSaveOptionsPtr.asFunction(); /// Saves a translation unit into a serialized representation of /// that translation unit on disk. @@ -1681,11 +1616,10 @@ class LibClang { } late final _clang_saveTranslationUnitPtr = - _lookup>( + _lookup>( 'clang_saveTranslationUnit'); late final _clang_saveTranslationUnit = - _clang_saveTranslationUnitPtr.asFunction< - int Function(CXTranslationUnit, ffi.Pointer, int)>(); + _clang_saveTranslationUnitPtr.asFunction(); /// Suspend a translation unit in order to free memory associated with it. /// @@ -1701,10 +1635,10 @@ class LibClang { } late final _clang_suspendTranslationUnitPtr = - _lookup>( + _lookup>( 'clang_suspendTranslationUnit'); late final _clang_suspendTranslationUnit = _clang_suspendTranslationUnitPtr - .asFunction(); + .asFunction(); /// Destroy the specified CXTranslationUnit object. void clang_disposeTranslationUnit( @@ -1716,10 +1650,10 @@ class LibClang { } late final _clang_disposeTranslationUnitPtr = - _lookup>( + _lookup>( 'clang_disposeTranslationUnit'); late final _clang_disposeTranslationUnit = _clang_disposeTranslationUnitPtr - .asFunction(); + .asFunction(); /// Returns the set of flags that is suitable for reparsing a translation /// unit. @@ -1738,10 +1672,10 @@ class LibClang { } late final _clang_defaultReparseOptionsPtr = - _lookup>( + _lookup>( 'clang_defaultReparseOptions'); late final _clang_defaultReparseOptions = _clang_defaultReparseOptionsPtr - .asFunction(); + .asFunction(); /// Reparse the source files that produced this translation unit. /// @@ -1795,12 +1729,10 @@ class LibClang { } late final _clang_reparseTranslationUnitPtr = - _lookup>( + _lookup>( 'clang_reparseTranslationUnit'); - late final _clang_reparseTranslationUnit = - _clang_reparseTranslationUnitPtr.asFunction< - int Function( - CXTranslationUnit, int, ffi.Pointer, int)>(); + late final _clang_reparseTranslationUnit = _clang_reparseTranslationUnitPtr + .asFunction(); /// Returns the human-readable null-terminated C string that represents /// the name of the memory category. This string should never be freed. @@ -1813,10 +1745,10 @@ class LibClang { } late final _clang_getTUResourceUsageNamePtr = - _lookup>( + _lookup>( 'clang_getTUResourceUsageName'); late final _clang_getTUResourceUsageName = _clang_getTUResourceUsageNamePtr - .asFunction Function(int)>(); + .asFunction(); /// Return the memory usage of a translation unit. This object /// should be released with clang_disposeCXTUResourceUsage(). @@ -1829,10 +1761,10 @@ class LibClang { } late final _clang_getCXTUResourceUsagePtr = - _lookup>( + _lookup>( 'clang_getCXTUResourceUsage'); late final _clang_getCXTUResourceUsage = _clang_getCXTUResourceUsagePtr - .asFunction(); + .asFunction(); void clang_disposeCXTUResourceUsage( CXTUResourceUsage usage, @@ -1843,11 +1775,11 @@ class LibClang { } late final _clang_disposeCXTUResourceUsagePtr = - _lookup>( + _lookup>( 'clang_disposeCXTUResourceUsage'); late final _clang_disposeCXTUResourceUsage = _clang_disposeCXTUResourceUsagePtr - .asFunction(); + .asFunction(); /// Get target information for this translation unit. /// @@ -1861,11 +1793,11 @@ class LibClang { } late final _clang_getTranslationUnitTargetInfoPtr = - _lookup>( + _lookup>( 'clang_getTranslationUnitTargetInfo'); late final _clang_getTranslationUnitTargetInfo = _clang_getTranslationUnitTargetInfoPtr - .asFunction(); + .asFunction(); /// Destroy the CXTargetInfo object. void clang_TargetInfo_dispose( @@ -1877,10 +1809,10 @@ class LibClang { } late final _clang_TargetInfo_disposePtr = - _lookup>( + _lookup>( 'clang_TargetInfo_dispose'); late final _clang_TargetInfo_dispose = - _clang_TargetInfo_disposePtr.asFunction(); + _clang_TargetInfo_disposePtr.asFunction(); /// Get the normalized target triple as a string. /// @@ -1894,10 +1826,10 @@ class LibClang { } late final _clang_TargetInfo_getTriplePtr = - _lookup>( + _lookup>( 'clang_TargetInfo_getTriple'); late final _clang_TargetInfo_getTriple = _clang_TargetInfo_getTriplePtr - .asFunction(); + .asFunction(); /// Get the pointer width of the target in bits. /// @@ -1911,11 +1843,11 @@ class LibClang { } late final _clang_TargetInfo_getPointerWidthPtr = - _lookup>( + _lookup>( 'clang_TargetInfo_getPointerWidth'); late final _clang_TargetInfo_getPointerWidth = _clang_TargetInfo_getPointerWidthPtr - .asFunction(); + .asFunction(); /// Retrieve the NULL cursor, which represents no entity. CXCursor clang_getNullCursor() { @@ -1923,10 +1855,10 @@ class LibClang { } late final _clang_getNullCursorPtr = - _lookup>( + _lookup>( 'clang_getNullCursor'); late final _clang_getNullCursor = - _clang_getNullCursorPtr.asFunction(); + _clang_getNullCursorPtr.asFunction(); /// Retrieve the cursor that represents the given translation unit. /// @@ -1941,11 +1873,11 @@ class LibClang { } late final _clang_getTranslationUnitCursorPtr = - _lookup>( + _lookup>( 'clang_getTranslationUnitCursor'); late final _clang_getTranslationUnitCursor = _clang_getTranslationUnitCursorPtr - .asFunction(); + .asFunction(); /// Determine whether two cursors are equivalent. int clang_equalCursors( @@ -1959,10 +1891,10 @@ class LibClang { } late final _clang_equalCursorsPtr = - _lookup>( + _lookup>( 'clang_equalCursors'); late final _clang_equalCursors = - _clang_equalCursorsPtr.asFunction(); + _clang_equalCursorsPtr.asFunction(); /// Returns non-zero if \p cursor is null. int clang_Cursor_isNull( @@ -1974,10 +1906,10 @@ class LibClang { } late final _clang_Cursor_isNullPtr = - _lookup>( + _lookup>( 'clang_Cursor_isNull'); late final _clang_Cursor_isNull = - _clang_Cursor_isNullPtr.asFunction(); + _clang_Cursor_isNullPtr.asFunction(); /// Compute a hash value for the given cursor. int clang_hashCursor( @@ -1989,9 +1921,9 @@ class LibClang { } late final _clang_hashCursorPtr = - _lookup>('clang_hashCursor'); + _lookup>('clang_hashCursor'); late final _clang_hashCursor = - _clang_hashCursorPtr.asFunction(); + _clang_hashCursorPtr.asFunction(); /// Retrieve the kind of the given cursor. int clang_getCursorKind( @@ -2003,10 +1935,10 @@ class LibClang { } late final _clang_getCursorKindPtr = - _lookup>( + _lookup>( 'clang_getCursorKind'); late final _clang_getCursorKind = - _clang_getCursorKindPtr.asFunction(); + _clang_getCursorKindPtr.asFunction(); /// Determine whether the given cursor kind represents a declaration. int clang_isDeclaration( @@ -2018,10 +1950,10 @@ class LibClang { } late final _clang_isDeclarationPtr = - _lookup>( + _lookup>( 'clang_isDeclaration'); late final _clang_isDeclaration = - _clang_isDeclarationPtr.asFunction(); + _clang_isDeclarationPtr.asFunction(); /// Determine whether the given declaration is invalid. /// @@ -2038,10 +1970,10 @@ class LibClang { } late final _clang_isInvalidDeclarationPtr = - _lookup>( + _lookup>( 'clang_isInvalidDeclaration'); - late final _clang_isInvalidDeclaration = - _clang_isInvalidDeclarationPtr.asFunction(); + late final _clang_isInvalidDeclaration = _clang_isInvalidDeclarationPtr + .asFunction(); /// Determine whether the given cursor kind represents a simple /// reference. @@ -2058,10 +1990,9 @@ class LibClang { } late final _clang_isReferencePtr = - _lookup>( - 'clang_isReference'); + _lookup>('clang_isReference'); late final _clang_isReference = - _clang_isReferencePtr.asFunction(); + _clang_isReferencePtr.asFunction(); /// Determine whether the given cursor kind represents an expression. int clang_isExpression( @@ -2073,10 +2004,10 @@ class LibClang { } late final _clang_isExpressionPtr = - _lookup>( + _lookup>( 'clang_isExpression'); late final _clang_isExpression = - _clang_isExpressionPtr.asFunction(); + _clang_isExpressionPtr.asFunction(); /// Determine whether the given cursor kind represents a statement. int clang_isStatement( @@ -2088,10 +2019,9 @@ class LibClang { } late final _clang_isStatementPtr = - _lookup>( - 'clang_isStatement'); + _lookup>('clang_isStatement'); late final _clang_isStatement = - _clang_isStatementPtr.asFunction(); + _clang_isStatementPtr.asFunction(); /// Determine whether the given cursor kind represents an attribute. int clang_isAttribute( @@ -2103,10 +2033,9 @@ class LibClang { } late final _clang_isAttributePtr = - _lookup>( - 'clang_isAttribute'); + _lookup>('clang_isAttribute'); late final _clang_isAttribute = - _clang_isAttributePtr.asFunction(); + _clang_isAttributePtr.asFunction(); /// Determine whether the given cursor has any attributes. int clang_Cursor_hasAttrs( @@ -2118,10 +2047,10 @@ class LibClang { } late final _clang_Cursor_hasAttrsPtr = - _lookup>( + _lookup>( 'clang_Cursor_hasAttrs'); late final _clang_Cursor_hasAttrs = - _clang_Cursor_hasAttrsPtr.asFunction(); + _clang_Cursor_hasAttrsPtr.asFunction(); /// Determine whether the given cursor kind represents an invalid /// cursor. @@ -2134,9 +2063,9 @@ class LibClang { } late final _clang_isInvalidPtr = - _lookup>('clang_isInvalid'); + _lookup>('clang_isInvalid'); late final _clang_isInvalid = - _clang_isInvalidPtr.asFunction(); + _clang_isInvalidPtr.asFunction(); /// Determine whether the given cursor kind represents a translation /// unit. @@ -2149,10 +2078,10 @@ class LibClang { } late final _clang_isTranslationUnitPtr = - _lookup>( + _lookup>( 'clang_isTranslationUnit'); late final _clang_isTranslationUnit = - _clang_isTranslationUnitPtr.asFunction(); + _clang_isTranslationUnitPtr.asFunction(); /// Determine whether the given cursor represents a preprocessing /// element, such as a preprocessor directive or macro instantiation. @@ -2165,10 +2094,10 @@ class LibClang { } late final _clang_isPreprocessingPtr = - _lookup>( + _lookup>( 'clang_isPreprocessing'); late final _clang_isPreprocessing = - _clang_isPreprocessingPtr.asFunction(); + _clang_isPreprocessingPtr.asFunction(); /// Determine whether the given cursor represents a currently /// unexposed piece of the AST (e.g., CXCursor_UnexposedStmt). @@ -2181,10 +2110,9 @@ class LibClang { } late final _clang_isUnexposedPtr = - _lookup>( - 'clang_isUnexposed'); + _lookup>('clang_isUnexposed'); late final _clang_isUnexposed = - _clang_isUnexposedPtr.asFunction(); + _clang_isUnexposedPtr.asFunction(); /// Determine the linkage of the entity referred to by a given cursor. int clang_getCursorLinkage( @@ -2196,10 +2124,10 @@ class LibClang { } late final _clang_getCursorLinkagePtr = - _lookup>( + _lookup>( 'clang_getCursorLinkage'); late final _clang_getCursorLinkage = - _clang_getCursorLinkagePtr.asFunction(); + _clang_getCursorLinkagePtr.asFunction(); /// Describe the visibility of the entity referred to by a cursor. /// @@ -2219,10 +2147,10 @@ class LibClang { } late final _clang_getCursorVisibilityPtr = - _lookup>( + _lookup>( 'clang_getCursorVisibility'); late final _clang_getCursorVisibility = - _clang_getCursorVisibilityPtr.asFunction(); + _clang_getCursorVisibilityPtr.asFunction(); /// Determine the availability of the entity that this cursor refers to, /// taking the current target platform into account. @@ -2239,10 +2167,10 @@ class LibClang { } late final _clang_getCursorAvailabilityPtr = - _lookup>( + _lookup>( 'clang_getCursorAvailability'); - late final _clang_getCursorAvailability = - _clang_getCursorAvailabilityPtr.asFunction(); + late final _clang_getCursorAvailability = _clang_getCursorAvailabilityPtr + .asFunction(); /// Determine the availability of the entity that this cursor refers to /// on any platforms for which availability information is known. @@ -2299,18 +2227,11 @@ class LibClang { } late final _clang_getCursorPlatformAvailabilityPtr = - _lookup>( + _lookup>( 'clang_getCursorPlatformAvailability'); late final _clang_getCursorPlatformAvailability = - _clang_getCursorPlatformAvailabilityPtr.asFunction< - int Function( - CXCursor, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); + _clang_getCursorPlatformAvailabilityPtr + .asFunction(); /// Free the memory associated with a \c CXPlatformAvailability structure. void clang_disposeCXPlatformAvailability( @@ -2322,11 +2243,11 @@ class LibClang { } late final _clang_disposeCXPlatformAvailabilityPtr = - _lookup>( + _lookup>( 'clang_disposeCXPlatformAvailability'); late final _clang_disposeCXPlatformAvailability = _clang_disposeCXPlatformAvailabilityPtr - .asFunction)>(); + .asFunction(); /// Determine the "language" of the entity referred to by a given cursor. int clang_getCursorLanguage( @@ -2338,10 +2259,10 @@ class LibClang { } late final _clang_getCursorLanguagePtr = - _lookup>( + _lookup>( 'clang_getCursorLanguage'); late final _clang_getCursorLanguage = - _clang_getCursorLanguagePtr.asFunction(); + _clang_getCursorLanguagePtr.asFunction(); /// Determine the "thread-local storage (TLS) kind" of the declaration /// referred to by a cursor. @@ -2354,10 +2275,10 @@ class LibClang { } late final _clang_getCursorTLSKindPtr = - _lookup>( + _lookup>( 'clang_getCursorTLSKind'); late final _clang_getCursorTLSKind = - _clang_getCursorTLSKindPtr.asFunction(); + _clang_getCursorTLSKindPtr.asFunction(); /// Returns the translation unit that a cursor originated from. CXTranslationUnit clang_Cursor_getTranslationUnit( @@ -2369,11 +2290,11 @@ class LibClang { } late final _clang_Cursor_getTranslationUnitPtr = - _lookup>( + _lookup>( 'clang_Cursor_getTranslationUnit'); late final _clang_Cursor_getTranslationUnit = _clang_Cursor_getTranslationUnitPtr - .asFunction(); + .asFunction(); /// Creates an empty CXCursorSet. CXCursorSet clang_createCXCursorSet() { @@ -2381,10 +2302,10 @@ class LibClang { } late final _clang_createCXCursorSetPtr = - _lookup>( + _lookup>( 'clang_createCXCursorSet'); late final _clang_createCXCursorSet = - _clang_createCXCursorSetPtr.asFunction(); + _clang_createCXCursorSetPtr.asFunction(); /// Disposes a CXCursorSet and releases its associated memory. void clang_disposeCXCursorSet( @@ -2396,10 +2317,10 @@ class LibClang { } late final _clang_disposeCXCursorSetPtr = - _lookup>( + _lookup>( 'clang_disposeCXCursorSet'); late final _clang_disposeCXCursorSet = - _clang_disposeCXCursorSetPtr.asFunction(); + _clang_disposeCXCursorSetPtr.asFunction(); /// Queries a CXCursorSet to see if it contains a specific CXCursor. /// @@ -2415,10 +2336,10 @@ class LibClang { } late final _clang_CXCursorSet_containsPtr = - _lookup>( + _lookup>( 'clang_CXCursorSet_contains'); late final _clang_CXCursorSet_contains = _clang_CXCursorSet_containsPtr - .asFunction(); + .asFunction(); /// Inserts a CXCursor into a CXCursorSet. /// @@ -2434,10 +2355,10 @@ class LibClang { } late final _clang_CXCursorSet_insertPtr = - _lookup>( + _lookup>( 'clang_CXCursorSet_insert'); - late final _clang_CXCursorSet_insert = _clang_CXCursorSet_insertPtr - .asFunction(); + late final _clang_CXCursorSet_insert = + _clang_CXCursorSet_insertPtr.asFunction(); /// Determine the semantic parent of the given cursor. /// @@ -2479,10 +2400,10 @@ class LibClang { } late final _clang_getCursorSemanticParentPtr = - _lookup>( + _lookup>( 'clang_getCursorSemanticParent'); late final _clang_getCursorSemanticParent = _clang_getCursorSemanticParentPtr - .asFunction(); + .asFunction(); /// Determine the lexical parent of the given cursor. /// @@ -2525,10 +2446,10 @@ class LibClang { } late final _clang_getCursorLexicalParentPtr = - _lookup>( + _lookup>( 'clang_getCursorLexicalParent'); late final _clang_getCursorLexicalParent = _clang_getCursorLexicalParentPtr - .asFunction(); + .asFunction(); /// Determine the set of methods that are overridden by the given /// method. @@ -2584,12 +2505,10 @@ class LibClang { } late final _clang_getOverriddenCursorsPtr = - _lookup>( + _lookup>( 'clang_getOverriddenCursors'); - late final _clang_getOverriddenCursors = - _clang_getOverriddenCursorsPtr.asFunction< - void Function(CXCursor, ffi.Pointer>, - ffi.Pointer)>(); + late final _clang_getOverriddenCursors = _clang_getOverriddenCursorsPtr + .asFunction(); /// Free the set of overridden cursors returned by \c /// clang_getOverriddenCursors(). @@ -2602,11 +2521,11 @@ class LibClang { } late final _clang_disposeOverriddenCursorsPtr = - _lookup>( + _lookup>( 'clang_disposeOverriddenCursors'); late final _clang_disposeOverriddenCursors = _clang_disposeOverriddenCursorsPtr - .asFunction)>(); + .asFunction(); /// Retrieve the file that is included by the given inclusion directive /// cursor. @@ -2619,10 +2538,10 @@ class LibClang { } late final _clang_getIncludedFilePtr = - _lookup>( + _lookup>( 'clang_getIncludedFile'); late final _clang_getIncludedFile = - _clang_getIncludedFilePtr.asFunction(); + _clang_getIncludedFilePtr.asFunction(); /// Map a source location to the cursor that describes the entity at that /// location in the source code. @@ -2648,9 +2567,9 @@ class LibClang { } late final _clang_getCursorPtr = - _lookup>('clang_getCursor'); - late final _clang_getCursor = _clang_getCursorPtr - .asFunction(); + _lookup>('clang_getCursor'); + late final _clang_getCursor = + _clang_getCursorPtr.asFunction(); /// Retrieve the physical location of the source constructor referenced /// by the given cursor. @@ -2669,10 +2588,10 @@ class LibClang { } late final _clang_getCursorLocationPtr = - _lookup>( + _lookup>( 'clang_getCursorLocation'); - late final _clang_getCursorLocation = _clang_getCursorLocationPtr - .asFunction(); + late final _clang_getCursorLocation = + _clang_getCursorLocationPtr.asFunction(); /// Retrieve the physical extent of the source construct referenced by /// the given cursor. @@ -2692,10 +2611,10 @@ class LibClang { } late final _clang_getCursorExtentPtr = - _lookup>( + _lookup>( 'clang_getCursorExtent'); late final _clang_getCursorExtent = - _clang_getCursorExtentPtr.asFunction(); + _clang_getCursorExtentPtr.asFunction(); /// Retrieve the type of a CXCursor (if any). CXType clang_getCursorType( @@ -2707,10 +2626,10 @@ class LibClang { } late final _clang_getCursorTypePtr = - _lookup>( + _lookup>( 'clang_getCursorType'); late final _clang_getCursorType = - _clang_getCursorTypePtr.asFunction(); + _clang_getCursorTypePtr.asFunction(); /// Pretty-print the underlying type using the rules of the /// language of the translation unit from which it came. @@ -2725,10 +2644,10 @@ class LibClang { } late final _clang_getTypeSpellingPtr = - _lookup>( + _lookup>( 'clang_getTypeSpelling'); late final _clang_getTypeSpelling = - _clang_getTypeSpellingPtr.asFunction(); + _clang_getTypeSpellingPtr.asFunction(); /// Retrieve the underlying type of a typedef declaration. /// @@ -2743,11 +2662,11 @@ class LibClang { } late final _clang_getTypedefDeclUnderlyingTypePtr = - _lookup>( + _lookup>( 'clang_getTypedefDeclUnderlyingType'); late final _clang_getTypedefDeclUnderlyingType = _clang_getTypedefDeclUnderlyingTypePtr - .asFunction(); + .asFunction(); /// Retrieve the integer type of an enum declaration. /// @@ -2762,10 +2681,10 @@ class LibClang { } late final _clang_getEnumDeclIntegerTypePtr = - _lookup>( + _lookup>( 'clang_getEnumDeclIntegerType'); - late final _clang_getEnumDeclIntegerType = - _clang_getEnumDeclIntegerTypePtr.asFunction(); + late final _clang_getEnumDeclIntegerType = _clang_getEnumDeclIntegerTypePtr + .asFunction(); /// Retrieve the integer value of an enum constant declaration as a signed /// long long. @@ -2782,10 +2701,11 @@ class LibClang { } late final _clang_getEnumConstantDeclValuePtr = - _lookup>( + _lookup>( 'clang_getEnumConstantDeclValue'); late final _clang_getEnumConstantDeclValue = - _clang_getEnumConstantDeclValuePtr.asFunction(); + _clang_getEnumConstantDeclValuePtr + .asFunction(); /// Retrieve the integer value of an enum constant declaration as an unsigned /// long long. @@ -2801,12 +2721,12 @@ class LibClang { ); } - late final _clang_getEnumConstantDeclUnsignedValuePtr = _lookup< - ffi.NativeFunction>( - 'clang_getEnumConstantDeclUnsignedValue'); + late final _clang_getEnumConstantDeclUnsignedValuePtr = + _lookup>( + 'clang_getEnumConstantDeclUnsignedValue'); late final _clang_getEnumConstantDeclUnsignedValue = _clang_getEnumConstantDeclUnsignedValuePtr - .asFunction(); + .asFunction(); /// Retrieve the bit width of a bit field declaration as an integer. /// @@ -2820,10 +2740,10 @@ class LibClang { } late final _clang_getFieldDeclBitWidthPtr = - _lookup>( + _lookup>( 'clang_getFieldDeclBitWidth'); - late final _clang_getFieldDeclBitWidth = - _clang_getFieldDeclBitWidthPtr.asFunction(); + late final _clang_getFieldDeclBitWidth = _clang_getFieldDeclBitWidthPtr + .asFunction(); /// Retrieve the number of non-variadic arguments associated with a given /// cursor. @@ -2839,10 +2759,10 @@ class LibClang { } late final _clang_Cursor_getNumArgumentsPtr = - _lookup>( + _lookup>( 'clang_Cursor_getNumArguments'); - late final _clang_Cursor_getNumArguments = - _clang_Cursor_getNumArgumentsPtr.asFunction(); + late final _clang_Cursor_getNumArguments = _clang_Cursor_getNumArgumentsPtr + .asFunction(); /// Retrieve the argument cursor of a function or method. /// @@ -2860,10 +2780,10 @@ class LibClang { } late final _clang_Cursor_getArgumentPtr = - _lookup>( + _lookup>( 'clang_Cursor_getArgument'); - late final _clang_Cursor_getArgument = _clang_Cursor_getArgumentPtr - .asFunction(); + late final _clang_Cursor_getArgument = + _clang_Cursor_getArgumentPtr.asFunction(); /// Returns the number of template args of a function decl representing a /// template specialization. @@ -2888,11 +2808,11 @@ class LibClang { } late final _clang_Cursor_getNumTemplateArgumentsPtr = - _lookup>( + _lookup>( 'clang_Cursor_getNumTemplateArguments'); late final _clang_Cursor_getNumTemplateArguments = _clang_Cursor_getNumTemplateArgumentsPtr - .asFunction(); + .asFunction(); /// Retrieve the kind of the I'th template argument of the CXCursor C. /// @@ -2919,11 +2839,11 @@ class LibClang { } late final _clang_Cursor_getTemplateArgumentKindPtr = - _lookup>( + _lookup>( 'clang_Cursor_getTemplateArgumentKind'); late final _clang_Cursor_getTemplateArgumentKind = _clang_Cursor_getTemplateArgumentKindPtr - .asFunction(); + .asFunction(); /// Retrieve a CXType representing the type of a TemplateArgument of a /// function decl representing a template specialization. @@ -2952,11 +2872,11 @@ class LibClang { } late final _clang_Cursor_getTemplateArgumentTypePtr = - _lookup>( + _lookup>( 'clang_Cursor_getTemplateArgumentType'); late final _clang_Cursor_getTemplateArgumentType = _clang_Cursor_getTemplateArgumentTypePtr - .asFunction(); + .asFunction(); /// Retrieve the value of an Integral TemplateArgument (of a function /// decl representing a template specialization) as a signed long long. @@ -2984,11 +2904,11 @@ class LibClang { } late final _clang_Cursor_getTemplateArgumentValuePtr = - _lookup>( + _lookup>( 'clang_Cursor_getTemplateArgumentValue'); late final _clang_Cursor_getTemplateArgumentValue = _clang_Cursor_getTemplateArgumentValuePtr - .asFunction(); + .asFunction(); /// Retrieve the value of an Integral TemplateArgument (of a function /// decl representing a template specialization) as an unsigned long long. @@ -3017,11 +2937,11 @@ class LibClang { late final _clang_Cursor_getTemplateArgumentUnsignedValuePtr = _lookup< ffi.NativeFunction< - Native_clang_Cursor_getTemplateArgumentUnsignedValue>>( + NativeClang_Cursor_getTemplateArgumentUnsignedValue>>( 'clang_Cursor_getTemplateArgumentUnsignedValue'); late final _clang_Cursor_getTemplateArgumentUnsignedValue = _clang_Cursor_getTemplateArgumentUnsignedValuePtr - .asFunction(); + .asFunction(); /// Determine whether two CXTypes represent the same type. /// @@ -3038,9 +2958,9 @@ class LibClang { } late final _clang_equalTypesPtr = - _lookup>('clang_equalTypes'); + _lookup>('clang_equalTypes'); late final _clang_equalTypes = - _clang_equalTypesPtr.asFunction(); + _clang_equalTypesPtr.asFunction(); /// Return the canonical type for a CXType. /// @@ -3057,10 +2977,10 @@ class LibClang { } late final _clang_getCanonicalTypePtr = - _lookup>( + _lookup>( 'clang_getCanonicalType'); late final _clang_getCanonicalType = - _clang_getCanonicalTypePtr.asFunction(); + _clang_getCanonicalTypePtr.asFunction(); /// Determine whether a CXType has the "const" qualifier set, /// without looking through typedefs that may have added "const" at a @@ -3074,10 +2994,10 @@ class LibClang { } late final _clang_isConstQualifiedTypePtr = - _lookup>( + _lookup>( 'clang_isConstQualifiedType'); - late final _clang_isConstQualifiedType = - _clang_isConstQualifiedTypePtr.asFunction(); + late final _clang_isConstQualifiedType = _clang_isConstQualifiedTypePtr + .asFunction(); /// Determine whether a CXCursor that is a macro, is /// function like. @@ -3090,10 +3010,11 @@ class LibClang { } late final _clang_Cursor_isMacroFunctionLikePtr = - _lookup>( + _lookup>( 'clang_Cursor_isMacroFunctionLike'); late final _clang_Cursor_isMacroFunctionLike = - _clang_Cursor_isMacroFunctionLikePtr.asFunction(); + _clang_Cursor_isMacroFunctionLikePtr + .asFunction(); /// Determine whether a CXCursor that is a macro, is a /// builtin one. @@ -3106,10 +3027,10 @@ class LibClang { } late final _clang_Cursor_isMacroBuiltinPtr = - _lookup>( + _lookup>( 'clang_Cursor_isMacroBuiltin'); - late final _clang_Cursor_isMacroBuiltin = - _clang_Cursor_isMacroBuiltinPtr.asFunction(); + late final _clang_Cursor_isMacroBuiltin = _clang_Cursor_isMacroBuiltinPtr + .asFunction(); /// Determine whether a CXCursor that is a function declaration, is an /// inline declaration. @@ -3122,10 +3043,11 @@ class LibClang { } late final _clang_Cursor_isFunctionInlinedPtr = - _lookup>( + _lookup>( 'clang_Cursor_isFunctionInlined'); late final _clang_Cursor_isFunctionInlined = - _clang_Cursor_isFunctionInlinedPtr.asFunction(); + _clang_Cursor_isFunctionInlinedPtr + .asFunction(); /// Determine whether a CXType has the "volatile" qualifier set, /// without looking through typedefs that may have added "volatile" at @@ -3139,10 +3061,10 @@ class LibClang { } late final _clang_isVolatileQualifiedTypePtr = - _lookup>( + _lookup>( 'clang_isVolatileQualifiedType'); - late final _clang_isVolatileQualifiedType = - _clang_isVolatileQualifiedTypePtr.asFunction(); + late final _clang_isVolatileQualifiedType = _clang_isVolatileQualifiedTypePtr + .asFunction(); /// Determine whether a CXType has the "restrict" qualifier set, /// without looking through typedefs that may have added "restrict" at a @@ -3156,10 +3078,10 @@ class LibClang { } late final _clang_isRestrictQualifiedTypePtr = - _lookup>( + _lookup>( 'clang_isRestrictQualifiedType'); - late final _clang_isRestrictQualifiedType = - _clang_isRestrictQualifiedTypePtr.asFunction(); + late final _clang_isRestrictQualifiedType = _clang_isRestrictQualifiedTypePtr + .asFunction(); /// Returns the address space of the given type. int clang_getAddressSpace( @@ -3171,10 +3093,10 @@ class LibClang { } late final _clang_getAddressSpacePtr = - _lookup>( + _lookup>( 'clang_getAddressSpace'); late final _clang_getAddressSpace = - _clang_getAddressSpacePtr.asFunction(); + _clang_getAddressSpacePtr.asFunction(); /// Returns the typedef name of the given type. CXString clang_getTypedefName( @@ -3186,10 +3108,10 @@ class LibClang { } late final _clang_getTypedefNamePtr = - _lookup>( + _lookup>( 'clang_getTypedefName'); late final _clang_getTypedefName = - _clang_getTypedefNamePtr.asFunction(); + _clang_getTypedefNamePtr.asFunction(); /// For pointer types, returns the type of the pointee. CXType clang_getPointeeType( @@ -3201,10 +3123,10 @@ class LibClang { } late final _clang_getPointeeTypePtr = - _lookup>( + _lookup>( 'clang_getPointeeType'); late final _clang_getPointeeType = - _clang_getPointeeTypePtr.asFunction(); + _clang_getPointeeTypePtr.asFunction(); /// Return the cursor for the declaration of the given type. CXCursor clang_getTypeDeclaration( @@ -3216,10 +3138,10 @@ class LibClang { } late final _clang_getTypeDeclarationPtr = - _lookup>( + _lookup>( 'clang_getTypeDeclaration'); late final _clang_getTypeDeclaration = - _clang_getTypeDeclarationPtr.asFunction(); + _clang_getTypeDeclarationPtr.asFunction(); /// Returns the Objective-C type encoding for the specified declaration. CXString clang_getDeclObjCTypeEncoding( @@ -3231,10 +3153,10 @@ class LibClang { } late final _clang_getDeclObjCTypeEncodingPtr = - _lookup>( + _lookup>( 'clang_getDeclObjCTypeEncoding'); late final _clang_getDeclObjCTypeEncoding = _clang_getDeclObjCTypeEncodingPtr - .asFunction(); + .asFunction(); /// Returns the Objective-C type encoding for the specified CXType. CXString clang_Type_getObjCEncoding( @@ -3246,10 +3168,10 @@ class LibClang { } late final _clang_Type_getObjCEncodingPtr = - _lookup>( + _lookup>( 'clang_Type_getObjCEncoding'); - late final _clang_Type_getObjCEncoding = - _clang_Type_getObjCEncodingPtr.asFunction(); + late final _clang_Type_getObjCEncoding = _clang_Type_getObjCEncodingPtr + .asFunction(); /// Retrieve the spelling of a given CXTypeKind. CXString clang_getTypeKindSpelling( @@ -3261,10 +3183,10 @@ class LibClang { } late final _clang_getTypeKindSpellingPtr = - _lookup>( + _lookup>( 'clang_getTypeKindSpelling'); late final _clang_getTypeKindSpelling = - _clang_getTypeKindSpellingPtr.asFunction(); + _clang_getTypeKindSpellingPtr.asFunction(); /// Retrieve the calling convention associated with a function type. /// @@ -3278,10 +3200,11 @@ class LibClang { } late final _clang_getFunctionTypeCallingConvPtr = - _lookup>( + _lookup>( 'clang_getFunctionTypeCallingConv'); late final _clang_getFunctionTypeCallingConv = - _clang_getFunctionTypeCallingConvPtr.asFunction(); + _clang_getFunctionTypeCallingConvPtr + .asFunction(); /// Retrieve the return type associated with a function type. /// @@ -3295,10 +3218,10 @@ class LibClang { } late final _clang_getResultTypePtr = - _lookup>( + _lookup>( 'clang_getResultType'); late final _clang_getResultType = - _clang_getResultTypePtr.asFunction(); + _clang_getResultTypePtr.asFunction(); /// Retrieve the exception specification type associated with a function type. /// This is a value of type CXCursor_ExceptionSpecificationKind. @@ -3313,11 +3236,11 @@ class LibClang { } late final _clang_getExceptionSpecificationTypePtr = - _lookup>( + _lookup>( 'clang_getExceptionSpecificationType'); late final _clang_getExceptionSpecificationType = _clang_getExceptionSpecificationTypePtr - .asFunction(); + .asFunction(); /// Retrieve the number of non-variadic parameters associated with a /// function type. @@ -3332,10 +3255,10 @@ class LibClang { } late final _clang_getNumArgTypesPtr = - _lookup>( + _lookup>( 'clang_getNumArgTypes'); late final _clang_getNumArgTypes = - _clang_getNumArgTypesPtr.asFunction(); + _clang_getNumArgTypesPtr.asFunction(); /// Retrieve the type of a parameter of a function type. /// @@ -3352,9 +3275,9 @@ class LibClang { } late final _clang_getArgTypePtr = - _lookup>('clang_getArgType'); + _lookup>('clang_getArgType'); late final _clang_getArgType = - _clang_getArgTypePtr.asFunction(); + _clang_getArgTypePtr.asFunction(); /// Retrieves the base type of the ObjCObjectType. /// @@ -3368,11 +3291,11 @@ class LibClang { } late final _clang_Type_getObjCObjectBaseTypePtr = - _lookup>( + _lookup>( 'clang_Type_getObjCObjectBaseType'); late final _clang_Type_getObjCObjectBaseType = _clang_Type_getObjCObjectBaseTypePtr - .asFunction(); + .asFunction(); /// Retrieve the number of protocol references associated with an ObjC object/id. /// @@ -3386,10 +3309,11 @@ class LibClang { } late final _clang_Type_getNumObjCProtocolRefsPtr = - _lookup>( + _lookup>( 'clang_Type_getNumObjCProtocolRefs'); late final _clang_Type_getNumObjCProtocolRefs = - _clang_Type_getNumObjCProtocolRefsPtr.asFunction(); + _clang_Type_getNumObjCProtocolRefsPtr + .asFunction(); /// Retrieve the decl for a protocol reference for an ObjC object/id. /// @@ -3406,11 +3330,11 @@ class LibClang { } late final _clang_Type_getObjCProtocolDeclPtr = - _lookup>( + _lookup>( 'clang_Type_getObjCProtocolDecl'); late final _clang_Type_getObjCProtocolDecl = _clang_Type_getObjCProtocolDeclPtr - .asFunction(); + .asFunction(); /// Retreive the number of type arguments associated with an ObjC object. /// @@ -3424,10 +3348,10 @@ class LibClang { } late final _clang_Type_getNumObjCTypeArgsPtr = - _lookup>( + _lookup>( 'clang_Type_getNumObjCTypeArgs'); - late final _clang_Type_getNumObjCTypeArgs = - _clang_Type_getNumObjCTypeArgsPtr.asFunction(); + late final _clang_Type_getNumObjCTypeArgs = _clang_Type_getNumObjCTypeArgsPtr + .asFunction(); /// Retrieve a type argument associated with an ObjC object. /// @@ -3444,10 +3368,10 @@ class LibClang { } late final _clang_Type_getObjCTypeArgPtr = - _lookup>( + _lookup>( 'clang_Type_getObjCTypeArg'); late final _clang_Type_getObjCTypeArg = - _clang_Type_getObjCTypeArgPtr.asFunction(); + _clang_Type_getObjCTypeArgPtr.asFunction(); /// Return 1 if the CXType is a variadic function type, and 0 otherwise. int clang_isFunctionTypeVariadic( @@ -3459,10 +3383,10 @@ class LibClang { } late final _clang_isFunctionTypeVariadicPtr = - _lookup>( + _lookup>( 'clang_isFunctionTypeVariadic'); - late final _clang_isFunctionTypeVariadic = - _clang_isFunctionTypeVariadicPtr.asFunction(); + late final _clang_isFunctionTypeVariadic = _clang_isFunctionTypeVariadicPtr + .asFunction(); /// Retrieve the return type associated with a given cursor. /// @@ -3476,10 +3400,10 @@ class LibClang { } late final _clang_getCursorResultTypePtr = - _lookup>( + _lookup>( 'clang_getCursorResultType'); late final _clang_getCursorResultType = - _clang_getCursorResultTypePtr.asFunction(); + _clang_getCursorResultTypePtr.asFunction(); /// Retrieve the exception specification type associated with a given cursor. /// This is a value of type CXCursor_ExceptionSpecificationKind. @@ -3494,11 +3418,11 @@ class LibClang { } late final _clang_getCursorExceptionSpecificationTypePtr = _lookup< - ffi.NativeFunction>( + ffi.NativeFunction>( 'clang_getCursorExceptionSpecificationType'); late final _clang_getCursorExceptionSpecificationType = _clang_getCursorExceptionSpecificationTypePtr - .asFunction(); + .asFunction(); /// Return 1 if the CXType is a POD (plain old data) type, and 0 /// otherwise. @@ -3511,9 +3435,9 @@ class LibClang { } late final _clang_isPODTypePtr = - _lookup>('clang_isPODType'); + _lookup>('clang_isPODType'); late final _clang_isPODType = - _clang_isPODTypePtr.asFunction(); + _clang_isPODTypePtr.asFunction(); /// Return the element type of an array, complex, or vector type. /// @@ -3528,10 +3452,10 @@ class LibClang { } late final _clang_getElementTypePtr = - _lookup>( + _lookup>( 'clang_getElementType'); late final _clang_getElementType = - _clang_getElementTypePtr.asFunction(); + _clang_getElementTypePtr.asFunction(); /// Return the number of elements of an array or vector type. /// @@ -3546,10 +3470,10 @@ class LibClang { } late final _clang_getNumElementsPtr = - _lookup>( + _lookup>( 'clang_getNumElements'); late final _clang_getNumElements = - _clang_getNumElementsPtr.asFunction(); + _clang_getNumElementsPtr.asFunction(); /// Return the element type of an array type. /// @@ -3563,10 +3487,10 @@ class LibClang { } late final _clang_getArrayElementTypePtr = - _lookup>( + _lookup>( 'clang_getArrayElementType'); late final _clang_getArrayElementType = - _clang_getArrayElementTypePtr.asFunction(); + _clang_getArrayElementTypePtr.asFunction(); /// Return the array size of a constant array. /// @@ -3580,10 +3504,10 @@ class LibClang { } late final _clang_getArraySizePtr = - _lookup>( + _lookup>( 'clang_getArraySize'); late final _clang_getArraySize = - _clang_getArraySizePtr.asFunction(); + _clang_getArraySizePtr.asFunction(); /// Retrieve the type named by the qualified-id. /// @@ -3597,10 +3521,10 @@ class LibClang { } late final _clang_Type_getNamedTypePtr = - _lookup>( + _lookup>( 'clang_Type_getNamedType'); late final _clang_Type_getNamedType = - _clang_Type_getNamedTypePtr.asFunction(); + _clang_Type_getNamedTypePtr.asFunction(); /// Determine if a typedef is 'transparent' tag. /// @@ -3617,10 +3541,11 @@ class LibClang { } late final _clang_Type_isTransparentTagTypedefPtr = - _lookup>( + _lookup>( 'clang_Type_isTransparentTagTypedef'); late final _clang_Type_isTransparentTagTypedef = - _clang_Type_isTransparentTagTypedefPtr.asFunction(); + _clang_Type_isTransparentTagTypedefPtr + .asFunction(); /// Retrieve the nullability kind of a pointer type. int clang_Type_getNullability( @@ -3632,10 +3557,10 @@ class LibClang { } late final _clang_Type_getNullabilityPtr = - _lookup>( + _lookup>( 'clang_Type_getNullability'); late final _clang_Type_getNullability = - _clang_Type_getNullabilityPtr.asFunction(); + _clang_Type_getNullabilityPtr.asFunction(); /// Return the alignment of a type in bytes as per C++[expr.alignof] /// standard. @@ -3656,10 +3581,10 @@ class LibClang { } late final _clang_Type_getAlignOfPtr = - _lookup>( + _lookup>( 'clang_Type_getAlignOf'); late final _clang_Type_getAlignOf = - _clang_Type_getAlignOfPtr.asFunction(); + _clang_Type_getAlignOfPtr.asFunction(); /// Return the class type of an member pointer type. /// @@ -3673,10 +3598,10 @@ class LibClang { } late final _clang_Type_getClassTypePtr = - _lookup>( + _lookup>( 'clang_Type_getClassType'); late final _clang_Type_getClassType = - _clang_Type_getClassTypePtr.asFunction(); + _clang_Type_getClassTypePtr.asFunction(); /// Return the size of a type in bytes as per C++[expr.sizeof] standard. /// @@ -3694,10 +3619,10 @@ class LibClang { } late final _clang_Type_getSizeOfPtr = - _lookup>( + _lookup>( 'clang_Type_getSizeOf'); late final _clang_Type_getSizeOf = - _clang_Type_getSizeOfPtr.asFunction(); + _clang_Type_getSizeOfPtr.asFunction(); /// 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] @@ -3721,10 +3646,10 @@ class LibClang { } late final _clang_Type_getOffsetOfPtr = - _lookup>( + _lookup>( 'clang_Type_getOffsetOf'); - late final _clang_Type_getOffsetOf = _clang_Type_getOffsetOfPtr - .asFunction)>(); + late final _clang_Type_getOffsetOf = + _clang_Type_getOffsetOfPtr.asFunction(); /// Return the type that was modified by this attributed type. /// @@ -3738,10 +3663,10 @@ class LibClang { } late final _clang_Type_getModifiedTypePtr = - _lookup>( + _lookup>( 'clang_Type_getModifiedType'); - late final _clang_Type_getModifiedType = - _clang_Type_getModifiedTypePtr.asFunction(); + late final _clang_Type_getModifiedType = _clang_Type_getModifiedTypePtr + .asFunction(); /// Return the offset of the field represented by the Cursor. /// @@ -3763,10 +3688,10 @@ class LibClang { } late final _clang_Cursor_getOffsetOfFieldPtr = - _lookup>( + _lookup>( 'clang_Cursor_getOffsetOfField'); - late final _clang_Cursor_getOffsetOfField = - _clang_Cursor_getOffsetOfFieldPtr.asFunction(); + late final _clang_Cursor_getOffsetOfField = _clang_Cursor_getOffsetOfFieldPtr + .asFunction(); /// Determine whether the given cursor represents an anonymous /// tag or namespace @@ -3779,10 +3704,10 @@ class LibClang { } late final _clang_Cursor_isAnonymousPtr = - _lookup>( + _lookup>( 'clang_Cursor_isAnonymous'); late final _clang_Cursor_isAnonymous = - _clang_Cursor_isAnonymousPtr.asFunction(); + _clang_Cursor_isAnonymousPtr.asFunction(); /// Determine whether the given cursor represents an anonymous record /// declaration. @@ -3795,11 +3720,11 @@ class LibClang { } late final _clang_Cursor_isAnonymousRecordDeclPtr = - _lookup>( + _lookup>( 'clang_Cursor_isAnonymousRecordDecl'); late final _clang_Cursor_isAnonymousRecordDecl = _clang_Cursor_isAnonymousRecordDeclPtr - .asFunction(); + .asFunction(); /// Determine whether the given cursor represents an inline namespace /// declaration. @@ -3812,10 +3737,11 @@ class LibClang { } late final _clang_Cursor_isInlineNamespacePtr = - _lookup>( + _lookup>( 'clang_Cursor_isInlineNamespace'); late final _clang_Cursor_isInlineNamespace = - _clang_Cursor_isInlineNamespacePtr.asFunction(); + _clang_Cursor_isInlineNamespacePtr + .asFunction(); /// Returns the number of template arguments for given template /// specialization, or -1 if type \c T is not a template specialization. @@ -3828,10 +3754,11 @@ class LibClang { } late final _clang_Type_getNumTemplateArgumentsPtr = - _lookup>( + _lookup>( 'clang_Type_getNumTemplateArguments'); late final _clang_Type_getNumTemplateArguments = - _clang_Type_getNumTemplateArgumentsPtr.asFunction(); + _clang_Type_getNumTemplateArgumentsPtr + .asFunction(); /// Returns the type template argument of a template class specialization /// at given index. @@ -3849,11 +3776,11 @@ class LibClang { } late final _clang_Type_getTemplateArgumentAsTypePtr = - _lookup>( + _lookup>( 'clang_Type_getTemplateArgumentAsType'); late final _clang_Type_getTemplateArgumentAsType = _clang_Type_getTemplateArgumentAsTypePtr - .asFunction(); + .asFunction(); /// Retrieve the ref-qualifier kind of a function or method. /// @@ -3868,10 +3795,10 @@ class LibClang { } late final _clang_Type_getCXXRefQualifierPtr = - _lookup>( + _lookup>( 'clang_Type_getCXXRefQualifier'); - late final _clang_Type_getCXXRefQualifier = - _clang_Type_getCXXRefQualifierPtr.asFunction(); + late final _clang_Type_getCXXRefQualifier = _clang_Type_getCXXRefQualifierPtr + .asFunction(); /// Returns non-zero if the cursor specifies a Record member that is a /// bitfield. @@ -3884,10 +3811,10 @@ class LibClang { } late final _clang_Cursor_isBitFieldPtr = - _lookup>( + _lookup>( 'clang_Cursor_isBitField'); late final _clang_Cursor_isBitField = - _clang_Cursor_isBitFieldPtr.asFunction(); + _clang_Cursor_isBitFieldPtr.asFunction(); /// Returns 1 if the base class specified by the cursor with kind /// CX_CXXBaseSpecifier is virtual. @@ -3900,10 +3827,10 @@ class LibClang { } late final _clang_isVirtualBasePtr = - _lookup>( + _lookup>( 'clang_isVirtualBase'); late final _clang_isVirtualBase = - _clang_isVirtualBasePtr.asFunction(); + _clang_isVirtualBasePtr.asFunction(); /// Returns the access control level for the referenced object. /// @@ -3919,10 +3846,10 @@ class LibClang { } late final _clang_getCXXAccessSpecifierPtr = - _lookup>( + _lookup>( 'clang_getCXXAccessSpecifier'); - late final _clang_getCXXAccessSpecifier = - _clang_getCXXAccessSpecifierPtr.asFunction(); + late final _clang_getCXXAccessSpecifier = _clang_getCXXAccessSpecifierPtr + .asFunction(); /// Returns the storage class for a function or variable declaration. /// @@ -3937,10 +3864,10 @@ class LibClang { } late final _clang_Cursor_getStorageClassPtr = - _lookup>( + _lookup>( 'clang_Cursor_getStorageClass'); - late final _clang_Cursor_getStorageClass = - _clang_Cursor_getStorageClassPtr.asFunction(); + late final _clang_Cursor_getStorageClass = _clang_Cursor_getStorageClassPtr + .asFunction(); /// Determine the number of overloaded declarations referenced by a /// \c CXCursor_OverloadedDeclRef cursor. @@ -3958,10 +3885,10 @@ class LibClang { } late final _clang_getNumOverloadedDeclsPtr = - _lookup>( + _lookup>( 'clang_getNumOverloadedDecls'); - late final _clang_getNumOverloadedDecls = - _clang_getNumOverloadedDeclsPtr.asFunction(); + late final _clang_getNumOverloadedDecls = _clang_getNumOverloadedDeclsPtr + .asFunction(); /// Retrieve a cursor for one of the overloaded declarations referenced /// by a \c CXCursor_OverloadedDeclRef cursor. @@ -3986,10 +3913,10 @@ class LibClang { } late final _clang_getOverloadedDeclPtr = - _lookup>( + _lookup>( 'clang_getOverloadedDecl'); - late final _clang_getOverloadedDecl = _clang_getOverloadedDeclPtr - .asFunction(); + late final _clang_getOverloadedDecl = + _clang_getOverloadedDeclPtr.asFunction(); /// For cursors representing an iboutletcollection attribute, /// this function returns the collection element type. @@ -4002,11 +3929,11 @@ class LibClang { } late final _clang_getIBOutletCollectionTypePtr = - _lookup>( + _lookup>( 'clang_getIBOutletCollectionType'); late final _clang_getIBOutletCollectionType = _clang_getIBOutletCollectionTypePtr - .asFunction(); + .asFunction(); /// Visit the children of a particular cursor. /// @@ -4041,10 +3968,10 @@ class LibClang { } late final _clang_visitChildrenPtr = - _lookup>( + _lookup>( 'clang_visitChildren'); - late final _clang_visitChildren = _clang_visitChildrenPtr - .asFunction(); + late final _clang_visitChildren = + _clang_visitChildrenPtr.asFunction(); /// Retrieve a Unified Symbol Resolution (USR) for the entity referenced /// by the given cursor. @@ -4062,10 +3989,10 @@ class LibClang { } late final _clang_getCursorUSRPtr = - _lookup>( + _lookup>( 'clang_getCursorUSR'); late final _clang_getCursorUSR = - _clang_getCursorUSRPtr.asFunction(); + _clang_getCursorUSRPtr.asFunction(); /// Construct a USR for a specified Objective-C class. CXString clang_constructUSR_ObjCClass( @@ -4077,10 +4004,10 @@ class LibClang { } late final _clang_constructUSR_ObjCClassPtr = - _lookup>( + _lookup>( 'clang_constructUSR_ObjCClass'); late final _clang_constructUSR_ObjCClass = _clang_constructUSR_ObjCClassPtr - .asFunction)>(); + .asFunction(); /// Construct a USR for a specified Objective-C category. CXString clang_constructUSR_ObjCCategory( @@ -4094,11 +4021,11 @@ class LibClang { } late final _clang_constructUSR_ObjCCategoryPtr = - _lookup>( + _lookup>( 'clang_constructUSR_ObjCCategory'); late final _clang_constructUSR_ObjCCategory = - _clang_constructUSR_ObjCCategoryPtr.asFunction< - CXString Function(ffi.Pointer, ffi.Pointer)>(); + _clang_constructUSR_ObjCCategoryPtr + .asFunction(); /// Construct a USR for a specified Objective-C protocol. CXString clang_constructUSR_ObjCProtocol( @@ -4110,11 +4037,11 @@ class LibClang { } late final _clang_constructUSR_ObjCProtocolPtr = - _lookup>( + _lookup>( 'clang_constructUSR_ObjCProtocol'); late final _clang_constructUSR_ObjCProtocol = _clang_constructUSR_ObjCProtocolPtr - .asFunction)>(); + .asFunction(); /// Construct a USR for a specified Objective-C instance variable and /// the USR for its containing class. @@ -4129,10 +4056,10 @@ class LibClang { } late final _clang_constructUSR_ObjCIvarPtr = - _lookup>( + _lookup>( 'clang_constructUSR_ObjCIvar'); late final _clang_constructUSR_ObjCIvar = _clang_constructUSR_ObjCIvarPtr - .asFunction, CXString)>(); + .asFunction(); /// Construct a USR for a specified Objective-C method and /// the USR for its containing class. @@ -4149,10 +4076,10 @@ class LibClang { } late final _clang_constructUSR_ObjCMethodPtr = - _lookup>( + _lookup>( 'clang_constructUSR_ObjCMethod'); late final _clang_constructUSR_ObjCMethod = _clang_constructUSR_ObjCMethodPtr - .asFunction, int, CXString)>(); + .asFunction(); /// Construct a USR for a specified Objective-C property and the USR /// for its containing class. @@ -4167,11 +4094,11 @@ class LibClang { } late final _clang_constructUSR_ObjCPropertyPtr = - _lookup>( + _lookup>( 'clang_constructUSR_ObjCProperty'); late final _clang_constructUSR_ObjCProperty = _clang_constructUSR_ObjCPropertyPtr - .asFunction, CXString)>(); + .asFunction(); /// Retrieve a name for the entity referenced by this cursor. CXString clang_getCursorSpelling( @@ -4183,10 +4110,10 @@ class LibClang { } late final _clang_getCursorSpellingPtr = - _lookup>( + _lookup>( 'clang_getCursorSpelling'); late final _clang_getCursorSpelling = - _clang_getCursorSpellingPtr.asFunction(); + _clang_getCursorSpellingPtr.asFunction(); /// 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 @@ -4210,11 +4137,11 @@ class LibClang { } late final _clang_Cursor_getSpellingNameRangePtr = - _lookup>( + _lookup>( 'clang_Cursor_getSpellingNameRange'); late final _clang_Cursor_getSpellingNameRange = _clang_Cursor_getSpellingNameRangePtr - .asFunction(); + .asFunction(); /// Get a property value for the given printing policy. int clang_PrintingPolicy_getProperty( @@ -4228,11 +4155,11 @@ class LibClang { } late final _clang_PrintingPolicy_getPropertyPtr = - _lookup>( + _lookup>( 'clang_PrintingPolicy_getProperty'); late final _clang_PrintingPolicy_getProperty = _clang_PrintingPolicy_getPropertyPtr - .asFunction(); + .asFunction(); /// Set a property value for the given printing policy. void clang_PrintingPolicy_setProperty( @@ -4248,11 +4175,11 @@ class LibClang { } late final _clang_PrintingPolicy_setPropertyPtr = - _lookup>( + _lookup>( 'clang_PrintingPolicy_setProperty'); late final _clang_PrintingPolicy_setProperty = _clang_PrintingPolicy_setPropertyPtr - .asFunction(); + .asFunction(); /// Retrieve the default policy for the cursor. /// @@ -4267,10 +4194,10 @@ class LibClang { } late final _clang_getCursorPrintingPolicyPtr = - _lookup>( + _lookup>( 'clang_getCursorPrintingPolicy'); late final _clang_getCursorPrintingPolicy = _clang_getCursorPrintingPolicyPtr - .asFunction(); + .asFunction(); /// Release a printing policy. void clang_PrintingPolicy_dispose( @@ -4282,10 +4209,10 @@ class LibClang { } late final _clang_PrintingPolicy_disposePtr = - _lookup>( + _lookup>( 'clang_PrintingPolicy_dispose'); late final _clang_PrintingPolicy_dispose = _clang_PrintingPolicy_disposePtr - .asFunction(); + .asFunction(); /// Pretty print declarations. /// @@ -4307,10 +4234,10 @@ class LibClang { } late final _clang_getCursorPrettyPrintedPtr = - _lookup>( + _lookup>( 'clang_getCursorPrettyPrinted'); late final _clang_getCursorPrettyPrinted = _clang_getCursorPrettyPrintedPtr - .asFunction(); + .asFunction(); /// Retrieve the display name for the entity referenced by this cursor. /// @@ -4326,10 +4253,10 @@ class LibClang { } late final _clang_getCursorDisplayNamePtr = - _lookup>( + _lookup>( 'clang_getCursorDisplayName'); - late final _clang_getCursorDisplayName = - _clang_getCursorDisplayNamePtr.asFunction(); + late final _clang_getCursorDisplayName = _clang_getCursorDisplayNamePtr + .asFunction(); /// For a cursor that is a reference, retrieve a cursor representing the /// entity that it references. @@ -4349,10 +4276,10 @@ class LibClang { } late final _clang_getCursorReferencedPtr = - _lookup>( + _lookup>( 'clang_getCursorReferenced'); late final _clang_getCursorReferenced = - _clang_getCursorReferencedPtr.asFunction(); + _clang_getCursorReferencedPtr.asFunction(); /// For a cursor that is either a reference to or a declaration /// of some entity, retrieve a cursor that describes the definition of @@ -4389,10 +4316,10 @@ class LibClang { } late final _clang_getCursorDefinitionPtr = - _lookup>( + _lookup>( 'clang_getCursorDefinition'); late final _clang_getCursorDefinition = - _clang_getCursorDefinitionPtr.asFunction(); + _clang_getCursorDefinitionPtr.asFunction(); /// Determine whether the declaration pointed to by this cursor /// is also a definition of that entity. @@ -4405,10 +4332,10 @@ class LibClang { } late final _clang_isCursorDefinitionPtr = - _lookup>( + _lookup>( 'clang_isCursorDefinition'); late final _clang_isCursorDefinition = - _clang_isCursorDefinitionPtr.asFunction(); + _clang_isCursorDefinitionPtr.asFunction(); /// Retrieve the canonical cursor corresponding to the given cursor. /// @@ -4441,10 +4368,10 @@ class LibClang { } late final _clang_getCanonicalCursorPtr = - _lookup>( + _lookup>( 'clang_getCanonicalCursor'); late final _clang_getCanonicalCursor = - _clang_getCanonicalCursorPtr.asFunction(); + _clang_getCanonicalCursorPtr.asFunction(); /// If the cursor points to a selector identifier in an Objective-C /// method or message expression, this returns the selector index. @@ -4464,11 +4391,11 @@ class LibClang { } late final _clang_Cursor_getObjCSelectorIndexPtr = - _lookup>( + _lookup>( 'clang_Cursor_getObjCSelectorIndex'); late final _clang_Cursor_getObjCSelectorIndex = _clang_Cursor_getObjCSelectorIndexPtr - .asFunction(); + .asFunction(); /// Given a cursor pointing to a C++ method call or an Objective-C /// message, returns non-zero if the method/message is "dynamic", meaning: @@ -4488,10 +4415,10 @@ class LibClang { } late final _clang_Cursor_isDynamicCallPtr = - _lookup>( + _lookup>( 'clang_Cursor_isDynamicCall'); - late final _clang_Cursor_isDynamicCall = - _clang_Cursor_isDynamicCallPtr.asFunction(); + late final _clang_Cursor_isDynamicCall = _clang_Cursor_isDynamicCallPtr + .asFunction(); /// Given a cursor pointing to an Objective-C message or property /// reference, or C++ method call, returns the CXType of the receiver. @@ -4504,10 +4431,10 @@ class LibClang { } late final _clang_Cursor_getReceiverTypePtr = - _lookup>( + _lookup>( 'clang_Cursor_getReceiverType'); - late final _clang_Cursor_getReceiverType = - _clang_Cursor_getReceiverTypePtr.asFunction(); + late final _clang_Cursor_getReceiverType = _clang_Cursor_getReceiverTypePtr + .asFunction(); /// Given a cursor that represents a property declaration, return the /// associated property attributes. The bits are formed from @@ -4524,12 +4451,12 @@ class LibClang { ); } - late final _clang_Cursor_getObjCPropertyAttributesPtr = _lookup< - ffi.NativeFunction>( - 'clang_Cursor_getObjCPropertyAttributes'); + late final _clang_Cursor_getObjCPropertyAttributesPtr = + _lookup>( + 'clang_Cursor_getObjCPropertyAttributes'); late final _clang_Cursor_getObjCPropertyAttributes = _clang_Cursor_getObjCPropertyAttributesPtr - .asFunction(); + .asFunction(); /// Given a cursor that represents a property declaration, return the /// name of the method that implements the getter. @@ -4541,12 +4468,12 @@ class LibClang { ); } - late final _clang_Cursor_getObjCPropertyGetterNamePtr = _lookup< - ffi.NativeFunction>( - 'clang_Cursor_getObjCPropertyGetterName'); + late final _clang_Cursor_getObjCPropertyGetterNamePtr = + _lookup>( + 'clang_Cursor_getObjCPropertyGetterName'); late final _clang_Cursor_getObjCPropertyGetterName = _clang_Cursor_getObjCPropertyGetterNamePtr - .asFunction(); + .asFunction(); /// Given a cursor that represents a property declaration, return the /// name of the method that implements the setter, if any. @@ -4558,12 +4485,12 @@ class LibClang { ); } - late final _clang_Cursor_getObjCPropertySetterNamePtr = _lookup< - ffi.NativeFunction>( - 'clang_Cursor_getObjCPropertySetterName'); + late final _clang_Cursor_getObjCPropertySetterNamePtr = + _lookup>( + 'clang_Cursor_getObjCPropertySetterName'); late final _clang_Cursor_getObjCPropertySetterName = _clang_Cursor_getObjCPropertySetterNamePtr - .asFunction(); + .asFunction(); /// Given a cursor that represents an Objective-C method or parameter /// declaration, return the associated Objective-C qualifiers for the return @@ -4578,11 +4505,11 @@ class LibClang { } late final _clang_Cursor_getObjCDeclQualifiersPtr = - _lookup>( + _lookup>( 'clang_Cursor_getObjCDeclQualifiers'); late final _clang_Cursor_getObjCDeclQualifiers = _clang_Cursor_getObjCDeclQualifiersPtr - .asFunction(); + .asFunction(); /// Given a cursor that represents an Objective-C method or property /// declaration, return non-zero if the declaration was affected by "\@optional". @@ -4596,10 +4523,10 @@ class LibClang { } late final _clang_Cursor_isObjCOptionalPtr = - _lookup>( + _lookup>( 'clang_Cursor_isObjCOptional'); - late final _clang_Cursor_isObjCOptional = - _clang_Cursor_isObjCOptionalPtr.asFunction(); + late final _clang_Cursor_isObjCOptional = _clang_Cursor_isObjCOptionalPtr + .asFunction(); /// Returns non-zero if the given cursor is a variadic function or method. int clang_Cursor_isVariadic( @@ -4611,10 +4538,10 @@ class LibClang { } late final _clang_Cursor_isVariadicPtr = - _lookup>( + _lookup>( 'clang_Cursor_isVariadic'); late final _clang_Cursor_isVariadic = - _clang_Cursor_isVariadicPtr.asFunction(); + _clang_Cursor_isVariadicPtr.asFunction(); /// Returns non-zero if the given cursor points to a symbol marked with /// external_source_symbol attribute. @@ -4642,12 +4569,10 @@ class LibClang { } late final _clang_Cursor_isExternalSymbolPtr = - _lookup>( + _lookup>( 'clang_Cursor_isExternalSymbol'); - late final _clang_Cursor_isExternalSymbol = - _clang_Cursor_isExternalSymbolPtr.asFunction< - int Function(CXCursor, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _clang_Cursor_isExternalSymbol = _clang_Cursor_isExternalSymbolPtr + .asFunction(); /// Given a cursor that represents a declaration, return the associated /// comment's source range. The range may include multiple consecutive comments @@ -4661,10 +4586,10 @@ class LibClang { } late final _clang_Cursor_getCommentRangePtr = - _lookup>( + _lookup>( 'clang_Cursor_getCommentRange'); late final _clang_Cursor_getCommentRange = _clang_Cursor_getCommentRangePtr - .asFunction(); + .asFunction(); /// Given a cursor that represents a declaration, return the associated /// comment text, including comment markers. @@ -4677,11 +4602,11 @@ class LibClang { } late final _clang_Cursor_getRawCommentTextPtr = - _lookup>( + _lookup>( 'clang_Cursor_getRawCommentText'); late final _clang_Cursor_getRawCommentText = _clang_Cursor_getRawCommentTextPtr - .asFunction(); + .asFunction(); /// Given a cursor that represents a documentable entity (e.g., /// declaration), return the associated \paragraph; otherwise return the @@ -4695,11 +4620,11 @@ class LibClang { } late final _clang_Cursor_getBriefCommentTextPtr = - _lookup>( + _lookup>( 'clang_Cursor_getBriefCommentText'); late final _clang_Cursor_getBriefCommentText = _clang_Cursor_getBriefCommentTextPtr - .asFunction(); + .asFunction(); /// Retrieve the CXString representing the mangled name of the cursor. CXString clang_Cursor_getMangling( @@ -4711,10 +4636,10 @@ class LibClang { } late final _clang_Cursor_getManglingPtr = - _lookup>( + _lookup>( 'clang_Cursor_getMangling'); late final _clang_Cursor_getMangling = - _clang_Cursor_getManglingPtr.asFunction(); + _clang_Cursor_getManglingPtr.asFunction(); /// Retrieve the CXStrings representing the mangled symbols of the C++ /// constructor or destructor at the cursor. @@ -4727,10 +4652,10 @@ class LibClang { } late final _clang_Cursor_getCXXManglingsPtr = - _lookup>( + _lookup>( 'clang_Cursor_getCXXManglings'); late final _clang_Cursor_getCXXManglings = _clang_Cursor_getCXXManglingsPtr - .asFunction Function(CXCursor)>(); + .asFunction(); /// Retrieve the CXStrings representing the mangled symbols of the ObjC /// class interface or implementation at the cursor. @@ -4743,10 +4668,10 @@ class LibClang { } late final _clang_Cursor_getObjCManglingsPtr = - _lookup>( + _lookup>( 'clang_Cursor_getObjCManglings'); late final _clang_Cursor_getObjCManglings = _clang_Cursor_getObjCManglingsPtr - .asFunction Function(CXCursor)>(); + .asFunction(); /// Given a CXCursor_ModuleImportDecl cursor, return the associated module. CXModule clang_Cursor_getModule( @@ -4758,10 +4683,10 @@ class LibClang { } late final _clang_Cursor_getModulePtr = - _lookup>( + _lookup>( 'clang_Cursor_getModule'); late final _clang_Cursor_getModule = - _clang_Cursor_getModulePtr.asFunction(); + _clang_Cursor_getModulePtr.asFunction(); /// Given a CXFile header file, return the module that contains it, if one /// exists. @@ -4776,10 +4701,10 @@ class LibClang { } late final _clang_getModuleForFilePtr = - _lookup>( + _lookup>( 'clang_getModuleForFile'); - late final _clang_getModuleForFile = _clang_getModuleForFilePtr - .asFunction(); + late final _clang_getModuleForFile = + _clang_getModuleForFilePtr.asFunction(); /// \param Module a module object. /// @@ -4793,10 +4718,10 @@ class LibClang { } late final _clang_Module_getASTFilePtr = - _lookup>( + _lookup>( 'clang_Module_getASTFile'); late final _clang_Module_getASTFile = - _clang_Module_getASTFilePtr.asFunction(); + _clang_Module_getASTFilePtr.asFunction(); /// \param Module a module object. /// @@ -4811,10 +4736,10 @@ class LibClang { } late final _clang_Module_getParentPtr = - _lookup>( + _lookup>( 'clang_Module_getParent'); late final _clang_Module_getParent = - _clang_Module_getParentPtr.asFunction(); + _clang_Module_getParentPtr.asFunction(); /// \param Module a module object. /// @@ -4829,10 +4754,10 @@ class LibClang { } late final _clang_Module_getNamePtr = - _lookup>( + _lookup>( 'clang_Module_getName'); late final _clang_Module_getName = - _clang_Module_getNamePtr.asFunction(); + _clang_Module_getNamePtr.asFunction(); /// \param Module a module object. /// @@ -4846,10 +4771,10 @@ class LibClang { } late final _clang_Module_getFullNamePtr = - _lookup>( + _lookup>( 'clang_Module_getFullName'); late final _clang_Module_getFullName = - _clang_Module_getFullNamePtr.asFunction(); + _clang_Module_getFullNamePtr.asFunction(); /// \param Module a module object. /// @@ -4863,10 +4788,10 @@ class LibClang { } late final _clang_Module_isSystemPtr = - _lookup>( + _lookup>( 'clang_Module_isSystem'); late final _clang_Module_isSystem = - _clang_Module_isSystemPtr.asFunction(); + _clang_Module_isSystemPtr.asFunction(); /// \param Module a module object. /// @@ -4882,11 +4807,11 @@ class LibClang { } late final _clang_Module_getNumTopLevelHeadersPtr = - _lookup>( + _lookup>( 'clang_Module_getNumTopLevelHeaders'); late final _clang_Module_getNumTopLevelHeaders = _clang_Module_getNumTopLevelHeadersPtr - .asFunction(); + .asFunction(); /// \param Module a module object. /// @@ -4906,11 +4831,11 @@ class LibClang { } late final _clang_Module_getTopLevelHeaderPtr = - _lookup>( + _lookup>( 'clang_Module_getTopLevelHeader'); late final _clang_Module_getTopLevelHeader = _clang_Module_getTopLevelHeaderPtr - .asFunction(); + .asFunction(); /// Determine if a C++ constructor is a converting constructor. int clang_CXXConstructor_isConvertingConstructor( @@ -4923,11 +4848,11 @@ class LibClang { late final _clang_CXXConstructor_isConvertingConstructorPtr = _lookup< ffi.NativeFunction< - Native_clang_CXXConstructor_isConvertingConstructor>>( + NativeClang_CXXConstructor_isConvertingConstructor>>( 'clang_CXXConstructor_isConvertingConstructor'); late final _clang_CXXConstructor_isConvertingConstructor = _clang_CXXConstructor_isConvertingConstructorPtr - .asFunction(); + .asFunction(); /// Determine if a C++ constructor is a copy constructor. int clang_CXXConstructor_isCopyConstructor( @@ -4938,12 +4863,12 @@ class LibClang { ); } - late final _clang_CXXConstructor_isCopyConstructorPtr = _lookup< - ffi.NativeFunction>( - 'clang_CXXConstructor_isCopyConstructor'); + late final _clang_CXXConstructor_isCopyConstructorPtr = + _lookup>( + 'clang_CXXConstructor_isCopyConstructor'); late final _clang_CXXConstructor_isCopyConstructor = _clang_CXXConstructor_isCopyConstructorPtr - .asFunction(); + .asFunction(); /// Determine if a C++ constructor is the default constructor. int clang_CXXConstructor_isDefaultConstructor( @@ -4955,11 +4880,11 @@ class LibClang { } late final _clang_CXXConstructor_isDefaultConstructorPtr = _lookup< - ffi.NativeFunction>( + ffi.NativeFunction>( 'clang_CXXConstructor_isDefaultConstructor'); late final _clang_CXXConstructor_isDefaultConstructor = _clang_CXXConstructor_isDefaultConstructorPtr - .asFunction(); + .asFunction(); /// Determine if a C++ constructor is a move constructor. int clang_CXXConstructor_isMoveConstructor( @@ -4970,12 +4895,12 @@ class LibClang { ); } - late final _clang_CXXConstructor_isMoveConstructorPtr = _lookup< - ffi.NativeFunction>( - 'clang_CXXConstructor_isMoveConstructor'); + late final _clang_CXXConstructor_isMoveConstructorPtr = + _lookup>( + 'clang_CXXConstructor_isMoveConstructor'); late final _clang_CXXConstructor_isMoveConstructor = _clang_CXXConstructor_isMoveConstructorPtr - .asFunction(); + .asFunction(); /// Determine if a C++ field is declared 'mutable'. int clang_CXXField_isMutable( @@ -4987,10 +4912,10 @@ class LibClang { } late final _clang_CXXField_isMutablePtr = - _lookup>( + _lookup>( 'clang_CXXField_isMutable'); late final _clang_CXXField_isMutable = - _clang_CXXField_isMutablePtr.asFunction(); + _clang_CXXField_isMutablePtr.asFunction(); /// Determine if a C++ method is declared '= default'. int clang_CXXMethod_isDefaulted( @@ -5002,10 +4927,10 @@ class LibClang { } late final _clang_CXXMethod_isDefaultedPtr = - _lookup>( + _lookup>( 'clang_CXXMethod_isDefaulted'); - late final _clang_CXXMethod_isDefaulted = - _clang_CXXMethod_isDefaultedPtr.asFunction(); + late final _clang_CXXMethod_isDefaulted = _clang_CXXMethod_isDefaultedPtr + .asFunction(); /// Determine if a C++ member function or member function template is /// pure virtual. @@ -5018,10 +4943,10 @@ class LibClang { } late final _clang_CXXMethod_isPureVirtualPtr = - _lookup>( + _lookup>( 'clang_CXXMethod_isPureVirtual'); - late final _clang_CXXMethod_isPureVirtual = - _clang_CXXMethod_isPureVirtualPtr.asFunction(); + late final _clang_CXXMethod_isPureVirtual = _clang_CXXMethod_isPureVirtualPtr + .asFunction(); /// Determine if a C++ member function or member function template is /// declared 'static'. @@ -5034,10 +4959,10 @@ class LibClang { } late final _clang_CXXMethod_isStaticPtr = - _lookup>( + _lookup>( 'clang_CXXMethod_isStatic'); late final _clang_CXXMethod_isStatic = - _clang_CXXMethod_isStaticPtr.asFunction(); + _clang_CXXMethod_isStaticPtr.asFunction(); /// Determine if a C++ member function or member function template is /// explicitly declared 'virtual' or if it overrides a virtual method from @@ -5051,10 +4976,10 @@ class LibClang { } late final _clang_CXXMethod_isVirtualPtr = - _lookup>( + _lookup>( 'clang_CXXMethod_isVirtual'); late final _clang_CXXMethod_isVirtual = - _clang_CXXMethod_isVirtualPtr.asFunction(); + _clang_CXXMethod_isVirtualPtr.asFunction(); /// Determine if a C++ record is abstract, i.e. whether a class or struct /// has a pure virtual member function. @@ -5067,10 +4992,10 @@ class LibClang { } late final _clang_CXXRecord_isAbstractPtr = - _lookup>( + _lookup>( 'clang_CXXRecord_isAbstract'); - late final _clang_CXXRecord_isAbstract = - _clang_CXXRecord_isAbstractPtr.asFunction(); + late final _clang_CXXRecord_isAbstract = _clang_CXXRecord_isAbstractPtr + .asFunction(); /// Determine if an enum declaration refers to a scoped enum. int clang_EnumDecl_isScoped( @@ -5082,10 +5007,10 @@ class LibClang { } late final _clang_EnumDecl_isScopedPtr = - _lookup>( + _lookup>( 'clang_EnumDecl_isScoped'); late final _clang_EnumDecl_isScoped = - _clang_EnumDecl_isScopedPtr.asFunction(); + _clang_EnumDecl_isScopedPtr.asFunction(); /// Determine if a C++ member function or member function template is /// declared 'const'. @@ -5098,10 +5023,10 @@ class LibClang { } late final _clang_CXXMethod_isConstPtr = - _lookup>( + _lookup>( 'clang_CXXMethod_isConst'); late final _clang_CXXMethod_isConst = - _clang_CXXMethod_isConstPtr.asFunction(); + _clang_CXXMethod_isConstPtr.asFunction(); /// Given a cursor that represents a template, determine /// the cursor kind of the specializations would be generated by instantiating @@ -5127,10 +5052,10 @@ class LibClang { } late final _clang_getTemplateCursorKindPtr = - _lookup>( + _lookup>( 'clang_getTemplateCursorKind'); - late final _clang_getTemplateCursorKind = - _clang_getTemplateCursorKindPtr.asFunction(); + late final _clang_getTemplateCursorKind = _clang_getTemplateCursorKindPtr + .asFunction(); /// Given a cursor that may represent a specialization or instantiation /// of a template, retrieve the cursor that represents the template that it @@ -5167,11 +5092,11 @@ class LibClang { } late final _clang_getSpecializedCursorTemplatePtr = - _lookup>( + _lookup>( 'clang_getSpecializedCursorTemplate'); late final _clang_getSpecializedCursorTemplate = _clang_getSpecializedCursorTemplatePtr - .asFunction(); + .asFunction(); /// Given a cursor that references something else, return the source range /// covering that reference. @@ -5202,11 +5127,11 @@ class LibClang { } late final _clang_getCursorReferenceNameRangePtr = - _lookup>( + _lookup>( 'clang_getCursorReferenceNameRange'); late final _clang_getCursorReferenceNameRange = _clang_getCursorReferenceNameRangePtr - .asFunction(); + .asFunction(); /// Get the raw lexical token starting with the given location. /// @@ -5228,9 +5153,9 @@ class LibClang { } late final _clang_getTokenPtr = - _lookup>('clang_getToken'); - late final _clang_getToken = _clang_getTokenPtr.asFunction< - ffi.Pointer Function(CXTranslationUnit, CXSourceLocation)>(); + _lookup>('clang_getToken'); + late final _clang_getToken = + _clang_getTokenPtr.asFunction(); /// Determine the kind of the given token. int clang_getTokenKind( @@ -5242,10 +5167,10 @@ class LibClang { } late final _clang_getTokenKindPtr = - _lookup>( + _lookup>( 'clang_getTokenKind'); late final _clang_getTokenKind = - _clang_getTokenKindPtr.asFunction(); + _clang_getTokenKindPtr.asFunction(); /// Determine the spelling of the given token. /// @@ -5262,10 +5187,10 @@ class LibClang { } late final _clang_getTokenSpellingPtr = - _lookup>( + _lookup>( 'clang_getTokenSpelling'); - late final _clang_getTokenSpelling = _clang_getTokenSpellingPtr - .asFunction(); + late final _clang_getTokenSpelling = + _clang_getTokenSpellingPtr.asFunction(); /// Retrieve the source location of the given token. CXSourceLocation clang_getTokenLocation( @@ -5279,10 +5204,10 @@ class LibClang { } late final _clang_getTokenLocationPtr = - _lookup>( + _lookup>( 'clang_getTokenLocation'); - late final _clang_getTokenLocation = _clang_getTokenLocationPtr - .asFunction(); + late final _clang_getTokenLocation = + _clang_getTokenLocationPtr.asFunction(); /// Retrieve a source range that covers the given token. CXSourceRange clang_getTokenExtent( @@ -5296,10 +5221,10 @@ class LibClang { } late final _clang_getTokenExtentPtr = - _lookup>( + _lookup>( 'clang_getTokenExtent'); - late final _clang_getTokenExtent = _clang_getTokenExtentPtr - .asFunction(); + late final _clang_getTokenExtent = + _clang_getTokenExtentPtr.asFunction(); /// Tokenize the source code described by the given range into raw /// lexical tokens. @@ -5330,10 +5255,9 @@ class LibClang { } late final _clang_tokenizePtr = - _lookup>('clang_tokenize'); - late final _clang_tokenize = _clang_tokenizePtr.asFunction< - void Function(CXTranslationUnit, CXSourceRange, - ffi.Pointer>, ffi.Pointer)>(); + _lookup>('clang_tokenize'); + late final _clang_tokenize = + _clang_tokenizePtr.asFunction(); /// 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. @@ -5378,11 +5302,10 @@ class LibClang { } late final _clang_annotateTokensPtr = - _lookup>( + _lookup>( 'clang_annotateTokens'); - late final _clang_annotateTokens = _clang_annotateTokensPtr.asFunction< - void Function(CXTranslationUnit, ffi.Pointer, int, - ffi.Pointer)>(); + late final _clang_annotateTokens = + _clang_annotateTokensPtr.asFunction(); /// Free the given set of tokens. void clang_disposeTokens( @@ -5398,10 +5321,10 @@ class LibClang { } late final _clang_disposeTokensPtr = - _lookup>( + _lookup>( 'clang_disposeTokens'); - late final _clang_disposeTokens = _clang_disposeTokensPtr.asFunction< - void Function(CXTranslationUnit, ffi.Pointer, int)>(); + late final _clang_disposeTokens = + _clang_disposeTokensPtr.asFunction(); /// \defgroup CINDEX_DEBUG Debugging facilities /// @@ -5418,10 +5341,10 @@ class LibClang { } late final _clang_getCursorKindSpellingPtr = - _lookup>( + _lookup>( 'clang_getCursorKindSpelling'); - late final _clang_getCursorKindSpelling = - _clang_getCursorKindSpellingPtr.asFunction(); + late final _clang_getCursorKindSpelling = _clang_getCursorKindSpellingPtr + .asFunction(); void clang_getDefinitionSpellingAndExtent( CXCursor arg0, @@ -5444,28 +5367,21 @@ class LibClang { } late final _clang_getDefinitionSpellingAndExtentPtr = - _lookup>( + _lookup>( 'clang_getDefinitionSpellingAndExtent'); late final _clang_getDefinitionSpellingAndExtent = - _clang_getDefinitionSpellingAndExtentPtr.asFunction< - void Function( - CXCursor, - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + _clang_getDefinitionSpellingAndExtentPtr + .asFunction(); void clang_enableStackTraces() { return _clang_enableStackTraces(); } late final _clang_enableStackTracesPtr = - _lookup>( + _lookup>( 'clang_enableStackTraces'); late final _clang_enableStackTraces = - _clang_enableStackTracesPtr.asFunction(); + _clang_enableStackTracesPtr.asFunction(); void clang_executeOnThread( ffi.Pointer)>> @@ -5481,14 +5397,10 @@ class LibClang { } late final _clang_executeOnThreadPtr = - _lookup>( + _lookup>( 'clang_executeOnThread'); - late final _clang_executeOnThread = _clang_executeOnThreadPtr.asFunction< - void Function( - ffi.Pointer< - ffi.NativeFunction)>>, - ffi.Pointer, - int)>(); + late final _clang_executeOnThread = + _clang_executeOnThreadPtr.asFunction(); /// Determine the kind of a particular chunk within a completion string. /// @@ -5508,10 +5420,10 @@ class LibClang { } late final _clang_getCompletionChunkKindPtr = - _lookup>( + _lookup>( 'clang_getCompletionChunkKind'); late final _clang_getCompletionChunkKind = _clang_getCompletionChunkKindPtr - .asFunction(); + .asFunction(); /// Retrieve the text associated with a particular chunk within a /// completion string. @@ -5532,10 +5444,10 @@ class LibClang { } late final _clang_getCompletionChunkTextPtr = - _lookup>( + _lookup>( 'clang_getCompletionChunkText'); late final _clang_getCompletionChunkText = _clang_getCompletionChunkTextPtr - .asFunction(); + .asFunction(); /// Retrieve the completion string associated with a particular chunk /// within a completion string. @@ -5557,11 +5469,11 @@ class LibClang { } late final _clang_getCompletionChunkCompletionStringPtr = _lookup< - ffi.NativeFunction>( + ffi.NativeFunction>( 'clang_getCompletionChunkCompletionString'); late final _clang_getCompletionChunkCompletionString = _clang_getCompletionChunkCompletionStringPtr - .asFunction(); + .asFunction(); /// Retrieve the number of chunks in the given code-completion string. int clang_getNumCompletionChunks( @@ -5573,10 +5485,10 @@ class LibClang { } late final _clang_getNumCompletionChunksPtr = - _lookup>( + _lookup>( 'clang_getNumCompletionChunks'); late final _clang_getNumCompletionChunks = _clang_getNumCompletionChunksPtr - .asFunction(); + .asFunction(); /// Determine the priority of this code completion. /// @@ -5597,10 +5509,10 @@ class LibClang { } late final _clang_getCompletionPriorityPtr = - _lookup>( + _lookup>( 'clang_getCompletionPriority'); late final _clang_getCompletionPriority = _clang_getCompletionPriorityPtr - .asFunction(); + .asFunction(); /// Determine the availability of the entity that this code-completion /// string refers to. @@ -5617,11 +5529,11 @@ class LibClang { } late final _clang_getCompletionAvailabilityPtr = - _lookup>( + _lookup>( 'clang_getCompletionAvailability'); late final _clang_getCompletionAvailability = _clang_getCompletionAvailabilityPtr - .asFunction(); + .asFunction(); /// Retrieve the number of annotations associated with the given /// completion string. @@ -5639,11 +5551,11 @@ class LibClang { } late final _clang_getCompletionNumAnnotationsPtr = - _lookup>( + _lookup>( 'clang_getCompletionNumAnnotations'); late final _clang_getCompletionNumAnnotations = _clang_getCompletionNumAnnotationsPtr - .asFunction(); + .asFunction(); /// Retrieve the annotation associated with the given completion string. /// @@ -5665,10 +5577,10 @@ class LibClang { } late final _clang_getCompletionAnnotationPtr = - _lookup>( + _lookup>( 'clang_getCompletionAnnotation'); late final _clang_getCompletionAnnotation = _clang_getCompletionAnnotationPtr - .asFunction(); + .asFunction(); /// Retrieve the parent context of the given completion string. /// @@ -5695,11 +5607,10 @@ class LibClang { } late final _clang_getCompletionParentPtr = - _lookup>( + _lookup>( 'clang_getCompletionParent'); late final _clang_getCompletionParent = - _clang_getCompletionParentPtr.asFunction< - CXString Function(CXCompletionString, ffi.Pointer)>(); + _clang_getCompletionParentPtr.asFunction(); /// Retrieve the brief documentation comment attached to the declaration /// that corresponds to the given completion string. @@ -5712,11 +5623,11 @@ class LibClang { } late final _clang_getCompletionBriefCommentPtr = - _lookup>( + _lookup>( 'clang_getCompletionBriefComment'); late final _clang_getCompletionBriefComment = _clang_getCompletionBriefCommentPtr - .asFunction(); + .asFunction(); /// Retrieve a completion string for an arbitrary declaration or macro /// definition cursor. @@ -5734,11 +5645,11 @@ class LibClang { } late final _clang_getCursorCompletionStringPtr = - _lookup>( + _lookup>( 'clang_getCursorCompletionString'); late final _clang_getCursorCompletionString = _clang_getCursorCompletionStringPtr - .asFunction(); + .asFunction(); /// Retrieve the number of fix-its for the given completion index. /// @@ -5762,10 +5673,10 @@ class LibClang { } late final _clang_getCompletionNumFixItsPtr = - _lookup>( + _lookup>( 'clang_getCompletionNumFixIts'); late final _clang_getCompletionNumFixIts = _clang_getCompletionNumFixItsPtr - .asFunction, int)>(); + .asFunction(); /// Fix-its that *must* be applied before inserting the text for the /// corresponding completion. @@ -5823,12 +5734,10 @@ class LibClang { } late final _clang_getCompletionFixItPtr = - _lookup>( + _lookup>( 'clang_getCompletionFixIt'); late final _clang_getCompletionFixIt = - _clang_getCompletionFixItPtr.asFunction< - CXString Function(ffi.Pointer, int, int, - ffi.Pointer)>(); + _clang_getCompletionFixItPtr.asFunction(); /// Returns a default set of code-completion options that can be /// passed to\c clang_codeCompleteAt(). @@ -5837,10 +5746,11 @@ class LibClang { } late final _clang_defaultCodeCompleteOptionsPtr = - _lookup>( + _lookup>( 'clang_defaultCodeCompleteOptions'); late final _clang_defaultCodeCompleteOptions = - _clang_defaultCodeCompleteOptionsPtr.asFunction(); + _clang_defaultCodeCompleteOptionsPtr + .asFunction(); /// Perform code completion at a given location in a translation unit. /// @@ -5929,17 +5839,10 @@ class LibClang { } late final _clang_codeCompleteAtPtr = - _lookup>( + _lookup>( 'clang_codeCompleteAt'); - late final _clang_codeCompleteAt = _clang_codeCompleteAtPtr.asFunction< - ffi.Pointer Function( - CXTranslationUnit, - ffi.Pointer, - int, - int, - ffi.Pointer, - int, - int)>(); + late final _clang_codeCompleteAt = + _clang_codeCompleteAtPtr.asFunction(); /// Sort the code-completion results in case-insensitive alphabetical /// order. @@ -5957,11 +5860,11 @@ class LibClang { } late final _clang_sortCodeCompletionResultsPtr = - _lookup>( + _lookup>( 'clang_sortCodeCompletionResults'); late final _clang_sortCodeCompletionResults = _clang_sortCodeCompletionResultsPtr - .asFunction, int)>(); + .asFunction(); /// Free the given set of code-completion results. void clang_disposeCodeCompleteResults( @@ -5973,11 +5876,11 @@ class LibClang { } late final _clang_disposeCodeCompleteResultsPtr = - _lookup>( + _lookup>( 'clang_disposeCodeCompleteResults'); late final _clang_disposeCodeCompleteResults = _clang_disposeCodeCompleteResultsPtr - .asFunction)>(); + .asFunction(); /// Determine the number of diagnostics produced prior to the /// location where code completion was performed. @@ -5990,11 +5893,11 @@ class LibClang { } late final _clang_codeCompleteGetNumDiagnosticsPtr = - _lookup>( + _lookup>( 'clang_codeCompleteGetNumDiagnostics'); late final _clang_codeCompleteGetNumDiagnostics = _clang_codeCompleteGetNumDiagnosticsPtr - .asFunction)>(); + .asFunction(); /// Retrieve a diagnostic associated with the given code completion. /// @@ -6014,11 +5917,11 @@ class LibClang { } late final _clang_codeCompleteGetDiagnosticPtr = - _lookup>( + _lookup>( 'clang_codeCompleteGetDiagnostic'); late final _clang_codeCompleteGetDiagnostic = - _clang_codeCompleteGetDiagnosticPtr.asFunction< - CXDiagnostic Function(ffi.Pointer, int)>(); + _clang_codeCompleteGetDiagnosticPtr + .asFunction(); /// Determines what completions are appropriate for the context /// the given code completion. @@ -6036,10 +5939,10 @@ class LibClang { } late final _clang_codeCompleteGetContextsPtr = - _lookup>( + _lookup>( 'clang_codeCompleteGetContexts'); late final _clang_codeCompleteGetContexts = _clang_codeCompleteGetContextsPtr - .asFunction)>(); + .asFunction(); /// Returns the cursor kind for the container for the current code /// completion context. The container is only guaranteed to be set for @@ -6066,12 +5969,11 @@ class LibClang { } late final _clang_codeCompleteGetContainerKindPtr = - _lookup>( + _lookup>( 'clang_codeCompleteGetContainerKind'); late final _clang_codeCompleteGetContainerKind = - _clang_codeCompleteGetContainerKindPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); + _clang_codeCompleteGetContainerKindPtr + .asFunction(); /// Returns the USR for the container for the current code completion /// context. If there is not a container for the current context, this @@ -6089,11 +5991,11 @@ class LibClang { } late final _clang_codeCompleteGetContainerUSRPtr = - _lookup>( + _lookup>( 'clang_codeCompleteGetContainerUSR'); late final _clang_codeCompleteGetContainerUSR = _clang_codeCompleteGetContainerUSRPtr - .asFunction)>(); + .asFunction(); /// Returns the currently-entered selector for an Objective-C message /// send, formatted like "initWithFoo:bar:". Only guaranteed to return a @@ -6113,11 +6015,11 @@ class LibClang { } late final _clang_codeCompleteGetObjCSelectorPtr = - _lookup>( + _lookup>( 'clang_codeCompleteGetObjCSelector'); late final _clang_codeCompleteGetObjCSelector = _clang_codeCompleteGetObjCSelectorPtr - .asFunction)>(); + .asFunction(); /// Return a version string, suitable for showing to a user, but not /// intended to be parsed (the format is not guaranteed to be stable). @@ -6126,10 +6028,10 @@ class LibClang { } late final _clang_getClangVersionPtr = - _lookup>( + _lookup>( 'clang_getClangVersion'); late final _clang_getClangVersion = - _clang_getClangVersionPtr.asFunction(); + _clang_getClangVersionPtr.asFunction(); /// Enable/disable crash recovery. /// @@ -6144,10 +6046,10 @@ class LibClang { } late final _clang_toggleCrashRecoveryPtr = - _lookup>( + _lookup>( 'clang_toggleCrashRecovery'); late final _clang_toggleCrashRecovery = - _clang_toggleCrashRecoveryPtr.asFunction(); + _clang_toggleCrashRecoveryPtr.asFunction(); /// Visit the set of preprocessor inclusions in a translation unit. /// The visitor function is called with the provided data for every included @@ -6166,10 +6068,10 @@ class LibClang { } late final _clang_getInclusionsPtr = - _lookup>( + _lookup>( 'clang_getInclusions'); - late final _clang_getInclusions = _clang_getInclusionsPtr.asFunction< - void Function(CXTranslationUnit, CXInclusionVisitor, CXClientData)>(); + late final _clang_getInclusions = + _clang_getInclusionsPtr.asFunction(); /// If cursor is a statement declaration tries to evaluate the /// statement and if its variable, tries to evaluate its initializer, @@ -6183,10 +6085,10 @@ class LibClang { } late final _clang_Cursor_EvaluatePtr = - _lookup>( + _lookup>( 'clang_Cursor_Evaluate'); late final _clang_Cursor_Evaluate = - _clang_Cursor_EvaluatePtr.asFunction(); + _clang_Cursor_EvaluatePtr.asFunction(); /// Returns the kind of the evaluated result. int clang_EvalResult_getKind( @@ -6198,10 +6100,10 @@ class LibClang { } late final _clang_EvalResult_getKindPtr = - _lookup>( + _lookup>( 'clang_EvalResult_getKind'); late final _clang_EvalResult_getKind = - _clang_EvalResult_getKindPtr.asFunction(); + _clang_EvalResult_getKindPtr.asFunction(); /// Returns the evaluation result as integer if the /// kind is Int. @@ -6214,10 +6116,10 @@ class LibClang { } late final _clang_EvalResult_getAsIntPtr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsInt'); late final _clang_EvalResult_getAsInt = - _clang_EvalResult_getAsIntPtr.asFunction(); + _clang_EvalResult_getAsIntPtr.asFunction(); /// Returns the evaluation result as a long long integer if the /// kind is Int. This prevents overflows that may happen if the result is @@ -6231,11 +6133,11 @@ class LibClang { } late final _clang_EvalResult_getAsLongLongPtr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsLongLong'); late final _clang_EvalResult_getAsLongLong = _clang_EvalResult_getAsLongLongPtr - .asFunction(); + .asFunction(); /// Returns a non-zero value if the kind is Int and the evaluation /// result resulted in an unsigned integer. @@ -6248,11 +6150,11 @@ class LibClang { } late final _clang_EvalResult_isUnsignedIntPtr = - _lookup>( + _lookup>( 'clang_EvalResult_isUnsignedInt'); late final _clang_EvalResult_isUnsignedInt = _clang_EvalResult_isUnsignedIntPtr - .asFunction(); + .asFunction(); /// Returns the evaluation result as an unsigned integer if /// the kind is Int and clang_EvalResult_isUnsignedInt is non-zero. @@ -6265,11 +6167,11 @@ class LibClang { } late final _clang_EvalResult_getAsUnsignedPtr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsUnsigned'); late final _clang_EvalResult_getAsUnsigned = _clang_EvalResult_getAsUnsignedPtr - .asFunction(); + .asFunction(); /// Returns the evaluation result as double if the /// kind is double. @@ -6282,10 +6184,10 @@ class LibClang { } late final _clang_EvalResult_getAsDoublePtr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsDouble'); late final _clang_EvalResult_getAsDouble = _clang_EvalResult_getAsDoublePtr - .asFunction(); + .asFunction(); /// Returns the evaluation result as a constant string if the /// kind is other than Int or float. User must not free this pointer, @@ -6300,10 +6202,10 @@ class LibClang { } late final _clang_EvalResult_getAsStrPtr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsStr'); - late final _clang_EvalResult_getAsStr = _clang_EvalResult_getAsStrPtr - .asFunction Function(CXEvalResult)>(); + late final _clang_EvalResult_getAsStr = + _clang_EvalResult_getAsStrPtr.asFunction(); /// Disposes the created Eval memory. void clang_EvalResult_dispose( @@ -6315,10 +6217,10 @@ class LibClang { } late final _clang_EvalResult_disposePtr = - _lookup>( + _lookup>( 'clang_EvalResult_dispose'); late final _clang_EvalResult_dispose = - _clang_EvalResult_disposePtr.asFunction(); + _clang_EvalResult_disposePtr.asFunction(); /// Retrieve a remapping. /// @@ -6335,10 +6237,10 @@ class LibClang { } late final _clang_getRemappingsPtr = - _lookup>( + _lookup>( 'clang_getRemappings'); - late final _clang_getRemappings = _clang_getRemappingsPtr - .asFunction)>(); + late final _clang_getRemappings = + _clang_getRemappingsPtr.asFunction(); /// Retrieve a remapping. /// @@ -6359,11 +6261,11 @@ class LibClang { } late final _clang_getRemappingsFromFileListPtr = - _lookup>( + _lookup>( 'clang_getRemappingsFromFileList'); late final _clang_getRemappingsFromFileList = - _clang_getRemappingsFromFileListPtr.asFunction< - CXRemapping Function(ffi.Pointer>, int)>(); + _clang_getRemappingsFromFileListPtr + .asFunction(); /// Determine the number of remappings. int clang_remap_getNumFiles( @@ -6375,10 +6277,10 @@ class LibClang { } late final _clang_remap_getNumFilesPtr = - _lookup>( + _lookup>( 'clang_remap_getNumFiles'); late final _clang_remap_getNumFiles = - _clang_remap_getNumFilesPtr.asFunction(); + _clang_remap_getNumFilesPtr.asFunction(); /// Get the original and the associated filename from the remapping. /// @@ -6401,12 +6303,10 @@ class LibClang { } late final _clang_remap_getFilenamesPtr = - _lookup>( + _lookup>( 'clang_remap_getFilenames'); late final _clang_remap_getFilenames = - _clang_remap_getFilenamesPtr.asFunction< - void Function(CXRemapping, int, ffi.Pointer, - ffi.Pointer)>(); + _clang_remap_getFilenamesPtr.asFunction(); /// Dispose the remapping. void clang_remap_dispose( @@ -6418,10 +6318,10 @@ class LibClang { } late final _clang_remap_disposePtr = - _lookup>( + _lookup>( 'clang_remap_dispose'); late final _clang_remap_dispose = - _clang_remap_disposePtr.asFunction(); + _clang_remap_disposePtr.asFunction(); /// Find references of a declaration in a specific file. /// @@ -6448,10 +6348,10 @@ class LibClang { } late final _clang_findReferencesInFilePtr = - _lookup>( + _lookup>( 'clang_findReferencesInFile'); late final _clang_findReferencesInFile = _clang_findReferencesInFilePtr - .asFunction(); + .asFunction(); /// Find #import/#include directives in a specific file. /// @@ -6476,11 +6376,10 @@ class LibClang { } late final _clang_findIncludesInFilePtr = - _lookup>( + _lookup>( 'clang_findIncludesInFile'); late final _clang_findIncludesInFile = - _clang_findIncludesInFilePtr.asFunction< - int Function(CXTranslationUnit, CXFile, CXCursorAndRangeVisitor)>(); + _clang_findIncludesInFilePtr.asFunction(); int clang_index_isEntityObjCContainerKind( int arg0, @@ -6491,10 +6390,11 @@ class LibClang { } late final _clang_index_isEntityObjCContainerKindPtr = - _lookup>( + _lookup>( 'clang_index_isEntityObjCContainerKind'); late final _clang_index_isEntityObjCContainerKind = - _clang_index_isEntityObjCContainerKindPtr.asFunction(); + _clang_index_isEntityObjCContainerKindPtr + .asFunction(); ffi.Pointer clang_index_getObjCContainerDeclInfo( ffi.Pointer arg0, @@ -6505,12 +6405,11 @@ class LibClang { } late final _clang_index_getObjCContainerDeclInfoPtr = - _lookup>( + _lookup>( 'clang_index_getObjCContainerDeclInfo'); late final _clang_index_getObjCContainerDeclInfo = - _clang_index_getObjCContainerDeclInfoPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer)>(); + _clang_index_getObjCContainerDeclInfoPtr + .asFunction(); ffi.Pointer clang_index_getObjCInterfaceDeclInfo( ffi.Pointer arg0, @@ -6521,12 +6420,11 @@ class LibClang { } late final _clang_index_getObjCInterfaceDeclInfoPtr = - _lookup>( + _lookup>( 'clang_index_getObjCInterfaceDeclInfo'); late final _clang_index_getObjCInterfaceDeclInfo = - _clang_index_getObjCInterfaceDeclInfoPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer)>(); + _clang_index_getObjCInterfaceDeclInfoPtr + .asFunction(); ffi.Pointer clang_index_getObjCCategoryDeclInfo( ffi.Pointer arg0, @@ -6537,12 +6435,11 @@ class LibClang { } late final _clang_index_getObjCCategoryDeclInfoPtr = - _lookup>( + _lookup>( 'clang_index_getObjCCategoryDeclInfo'); late final _clang_index_getObjCCategoryDeclInfo = - _clang_index_getObjCCategoryDeclInfoPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer)>(); + _clang_index_getObjCCategoryDeclInfoPtr + .asFunction(); ffi.Pointer clang_index_getObjCProtocolRefListInfo( @@ -6553,13 +6450,12 @@ class LibClang { ); } - late final _clang_index_getObjCProtocolRefListInfoPtr = _lookup< - ffi.NativeFunction>( - 'clang_index_getObjCProtocolRefListInfo'); + late final _clang_index_getObjCProtocolRefListInfoPtr = + _lookup>( + 'clang_index_getObjCProtocolRefListInfo'); late final _clang_index_getObjCProtocolRefListInfo = - _clang_index_getObjCProtocolRefListInfoPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer)>(); + _clang_index_getObjCProtocolRefListInfoPtr + .asFunction(); ffi.Pointer clang_index_getObjCPropertyDeclInfo( ffi.Pointer arg0, @@ -6570,12 +6466,11 @@ class LibClang { } late final _clang_index_getObjCPropertyDeclInfoPtr = - _lookup>( + _lookup>( 'clang_index_getObjCPropertyDeclInfo'); late final _clang_index_getObjCPropertyDeclInfo = - _clang_index_getObjCPropertyDeclInfoPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer)>(); + _clang_index_getObjCPropertyDeclInfoPtr + .asFunction(); ffi.Pointer clang_index_getIBOutletCollectionAttrInfo( @@ -6587,12 +6482,11 @@ class LibClang { } late final _clang_index_getIBOutletCollectionAttrInfoPtr = _lookup< - ffi.NativeFunction>( + ffi.NativeFunction>( 'clang_index_getIBOutletCollectionAttrInfo'); late final _clang_index_getIBOutletCollectionAttrInfo = - _clang_index_getIBOutletCollectionAttrInfoPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer)>(); + _clang_index_getIBOutletCollectionAttrInfoPtr + .asFunction(); ffi.Pointer clang_index_getCXXClassDeclInfo( ffi.Pointer arg0, @@ -6603,12 +6497,11 @@ class LibClang { } late final _clang_index_getCXXClassDeclInfoPtr = - _lookup>( + _lookup>( 'clang_index_getCXXClassDeclInfo'); late final _clang_index_getCXXClassDeclInfo = - _clang_index_getCXXClassDeclInfoPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer)>(); + _clang_index_getCXXClassDeclInfoPtr + .asFunction(); /// For retrieving a custom CXIdxClientContainer attached to a /// container. @@ -6621,11 +6514,11 @@ class LibClang { } late final _clang_index_getClientContainerPtr = - _lookup>( + _lookup>( 'clang_index_getClientContainer'); late final _clang_index_getClientContainer = - _clang_index_getClientContainerPtr.asFunction< - CXIdxClientContainer Function(ffi.Pointer)>(); + _clang_index_getClientContainerPtr + .asFunction(); /// For setting a custom CXIdxClientContainer attached to a /// container. @@ -6640,12 +6533,11 @@ class LibClang { } late final _clang_index_setClientContainerPtr = - _lookup>( + _lookup>( 'clang_index_setClientContainer'); late final _clang_index_setClientContainer = - _clang_index_setClientContainerPtr.asFunction< - void Function( - ffi.Pointer, CXIdxClientContainer)>(); + _clang_index_setClientContainerPtr + .asFunction(); /// For retrieving a custom CXIdxClientEntity attached to an entity. CXIdxClientEntity clang_index_getClientEntity( @@ -6657,10 +6549,10 @@ class LibClang { } late final _clang_index_getClientEntityPtr = - _lookup>( + _lookup>( 'clang_index_getClientEntity'); late final _clang_index_getClientEntity = _clang_index_getClientEntityPtr - .asFunction)>(); + .asFunction(); /// For setting a custom CXIdxClientEntity attached to an entity. void clang_index_setClientEntity( @@ -6674,11 +6566,10 @@ class LibClang { } late final _clang_index_setClientEntityPtr = - _lookup>( + _lookup>( 'clang_index_setClientEntity'); - late final _clang_index_setClientEntity = - _clang_index_setClientEntityPtr.asFunction< - void Function(ffi.Pointer, CXIdxClientEntity)>(); + late final _clang_index_setClientEntity = _clang_index_setClientEntityPtr + .asFunction(); /// An indexing action/session, to be applied to one or multiple /// translation units. @@ -6693,10 +6584,10 @@ class LibClang { } late final _clang_IndexAction_createPtr = - _lookup>( + _lookup>( 'clang_IndexAction_create'); - late final _clang_IndexAction_create = _clang_IndexAction_createPtr - .asFunction(); + late final _clang_IndexAction_create = + _clang_IndexAction_createPtr.asFunction(); /// Destroy the given index action. /// @@ -6711,10 +6602,10 @@ class LibClang { } late final _clang_IndexAction_disposePtr = - _lookup>( + _lookup>( 'clang_IndexAction_dispose'); late final _clang_IndexAction_dispose = - _clang_IndexAction_disposePtr.asFunction(); + _clang_IndexAction_disposePtr.asFunction(); /// Index the given source file and the translation unit corresponding /// to that file via callbacks implemented through #IndexerCallbacks. @@ -6770,22 +6661,10 @@ class LibClang { } late final _clang_indexSourceFilePtr = - _lookup>( + _lookup>( 'clang_indexSourceFile'); - late final _clang_indexSourceFile = _clang_indexSourceFilePtr.asFunction< - int Function( - CXIndexAction, - CXClientData, - ffi.Pointer, - int, - int, - ffi.Pointer, - ffi.Pointer>, - int, - ffi.Pointer, - int, - ffi.Pointer, - int)>(); + late final _clang_indexSourceFile = + _clang_indexSourceFilePtr.asFunction(); /// Same as clang_indexSourceFile but requires a full command line /// for \c command_line_args including argv[0]. This is useful if the standard @@ -6821,23 +6700,10 @@ class LibClang { } late final _clang_indexSourceFileFullArgvPtr = - _lookup>( + _lookup>( 'clang_indexSourceFileFullArgv'); - late final _clang_indexSourceFileFullArgv = - _clang_indexSourceFileFullArgvPtr.asFunction< - int Function( - CXIndexAction, - CXClientData, - ffi.Pointer, - int, - int, - ffi.Pointer, - ffi.Pointer>, - int, - ffi.Pointer, - int, - ffi.Pointer, - int)>(); + late final _clang_indexSourceFileFullArgv = _clang_indexSourceFileFullArgvPtr + .asFunction(); /// Index the given translation unit via callbacks implemented through /// #IndexerCallbacks. @@ -6872,12 +6738,10 @@ class LibClang { } late final _clang_indexTranslationUnitPtr = - _lookup>( + _lookup>( 'clang_indexTranslationUnit'); - late final _clang_indexTranslationUnit = - _clang_indexTranslationUnitPtr.asFunction< - int Function(CXIndexAction, CXClientData, - ffi.Pointer, int, int, CXTranslationUnit)>(); + late final _clang_indexTranslationUnit = _clang_indexTranslationUnitPtr + .asFunction(); /// Retrieve the CXIdxFile, file, line, column, and offset represented by /// the given CXIdxLoc. @@ -6904,17 +6768,11 @@ class LibClang { } late final _clang_indexLoc_getFileLocationPtr = - _lookup>( + _lookup>( 'clang_indexLoc_getFileLocation'); late final _clang_indexLoc_getFileLocation = - _clang_indexLoc_getFileLocationPtr.asFunction< - void Function( - CXIdxLoc, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + _clang_indexLoc_getFileLocationPtr + .asFunction(); /// Retrieve the CXSourceLocation represented by the given CXIdxLoc. CXSourceLocation clang_indexLoc_getCXSourceLocation( @@ -6926,11 +6784,11 @@ class LibClang { } late final _clang_indexLoc_getCXSourceLocationPtr = - _lookup>( + _lookup>( 'clang_indexLoc_getCXSourceLocation'); late final _clang_indexLoc_getCXSourceLocation = _clang_indexLoc_getCXSourceLocationPtr - .asFunction(); + .asFunction(); /// Visit the fields of a particular type. /// @@ -6962,10 +6820,10 @@ class LibClang { } late final _clang_Type_visitFieldsPtr = - _lookup>( + _lookup>( 'clang_Type_visitFields'); - late final _clang_Type_visitFields = _clang_Type_visitFieldsPtr - .asFunction(); + late final _clang_Type_visitFields = + _clang_Type_visitFieldsPtr.asFunction(); late final addresses = _SymbolAddresses(this); } @@ -6973,811 +6831,811 @@ class LibClang { class _SymbolAddresses { final LibClang _library; _SymbolAddresses(this._library); - ffi.Pointer> + ffi.Pointer> get clang_getCString => _library._clang_getCStringPtr; - ffi.Pointer> + ffi.Pointer> get clang_disposeString => _library._clang_disposeStringPtr; - ffi.Pointer> + ffi.Pointer> get clang_disposeStringSet => _library._clang_disposeStringSetPtr; - ffi.Pointer> + ffi.Pointer> get clang_createIndex => _library._clang_createIndexPtr; - ffi.Pointer> + ffi.Pointer> get clang_disposeIndex => _library._clang_disposeIndexPtr; - ffi.Pointer> + ffi.Pointer> get clang_CXIndex_setGlobalOptions => _library._clang_CXIndex_setGlobalOptionsPtr; - ffi.Pointer> + ffi.Pointer> get clang_CXIndex_getGlobalOptions => _library._clang_CXIndex_getGlobalOptionsPtr; ffi.Pointer< ffi.NativeFunction< - Native_clang_CXIndex_setInvocationEmissionPathOption>> + NativeClang_CXIndex_setInvocationEmissionPathOption>> get clang_CXIndex_setInvocationEmissionPathOption => _library._clang_CXIndex_setInvocationEmissionPathOptionPtr; - ffi.Pointer> + ffi.Pointer> get clang_getFileName => _library._clang_getFileNamePtr; - ffi.Pointer> + ffi.Pointer> get clang_getFileTime => _library._clang_getFileTimePtr; - ffi.Pointer> + ffi.Pointer> get clang_getFileUniqueID => _library._clang_getFileUniqueIDPtr; - ffi.Pointer> + ffi.Pointer> get clang_isFileMultipleIncludeGuarded => _library._clang_isFileMultipleIncludeGuardedPtr; - ffi.Pointer> get clang_getFile => + ffi.Pointer> get clang_getFile => _library._clang_getFilePtr; - ffi.Pointer> + ffi.Pointer> get clang_getFileContents => _library._clang_getFileContentsPtr; - ffi.Pointer> + ffi.Pointer> get clang_File_isEqual => _library._clang_File_isEqualPtr; - ffi.Pointer> + ffi.Pointer> get clang_File_tryGetRealPathName => _library._clang_File_tryGetRealPathNamePtr; - ffi.Pointer> + ffi.Pointer> get clang_getNullLocation => _library._clang_getNullLocationPtr; - ffi.Pointer> + ffi.Pointer> get clang_equalLocations => _library._clang_equalLocationsPtr; - ffi.Pointer> + ffi.Pointer> get clang_getLocation => _library._clang_getLocationPtr; - ffi.Pointer> + ffi.Pointer> get clang_getLocationForOffset => _library._clang_getLocationForOffsetPtr; - ffi.Pointer> + ffi.Pointer> get clang_Location_isInSystemHeader => _library._clang_Location_isInSystemHeaderPtr; - ffi.Pointer> + ffi.Pointer> get clang_Location_isFromMainFile => _library._clang_Location_isFromMainFilePtr; - ffi.Pointer> + ffi.Pointer> get clang_getNullRange => _library._clang_getNullRangePtr; - ffi.Pointer> get clang_getRange => + ffi.Pointer> get clang_getRange => _library._clang_getRangePtr; - ffi.Pointer> + ffi.Pointer> get clang_equalRanges => _library._clang_equalRangesPtr; - ffi.Pointer> + ffi.Pointer> get clang_Range_isNull => _library._clang_Range_isNullPtr; - ffi.Pointer> + ffi.Pointer> get clang_getExpansionLocation => _library._clang_getExpansionLocationPtr; - ffi.Pointer> + ffi.Pointer> get clang_getPresumedLocation => _library._clang_getPresumedLocationPtr; - ffi.Pointer> + ffi.Pointer> get clang_getInstantiationLocation => _library._clang_getInstantiationLocationPtr; - ffi.Pointer> + ffi.Pointer> get clang_getSpellingLocation => _library._clang_getSpellingLocationPtr; - ffi.Pointer> + ffi.Pointer> get clang_getFileLocation => _library._clang_getFileLocationPtr; - ffi.Pointer> + ffi.Pointer> get clang_getRangeStart => _library._clang_getRangeStartPtr; - ffi.Pointer> + ffi.Pointer> get clang_getRangeEnd => _library._clang_getRangeEndPtr; - ffi.Pointer> + ffi.Pointer> get clang_getSkippedRanges => _library._clang_getSkippedRangesPtr; - ffi.Pointer> + ffi.Pointer> get clang_getAllSkippedRanges => _library._clang_getAllSkippedRangesPtr; - ffi.Pointer> + ffi.Pointer> get clang_disposeSourceRangeList => _library._clang_disposeSourceRangeListPtr; - ffi.Pointer> + ffi.Pointer> get clang_getNumDiagnosticsInSet => _library._clang_getNumDiagnosticsInSetPtr; - ffi.Pointer> + ffi.Pointer> get clang_getDiagnosticInSet => _library._clang_getDiagnosticInSetPtr; - ffi.Pointer> + ffi.Pointer> get clang_loadDiagnostics => _library._clang_loadDiagnosticsPtr; - ffi.Pointer> + ffi.Pointer> get clang_disposeDiagnosticSet => _library._clang_disposeDiagnosticSetPtr; - ffi.Pointer> + ffi.Pointer> get clang_getChildDiagnostics => _library._clang_getChildDiagnosticsPtr; - ffi.Pointer> + ffi.Pointer> get clang_getNumDiagnostics => _library._clang_getNumDiagnosticsPtr; - ffi.Pointer> + ffi.Pointer> get clang_getDiagnostic => _library._clang_getDiagnosticPtr; - ffi.Pointer> + ffi.Pointer> get clang_getDiagnosticSetFromTU => _library._clang_getDiagnosticSetFromTUPtr; - ffi.Pointer> + ffi.Pointer> get clang_disposeDiagnostic => _library._clang_disposeDiagnosticPtr; - ffi.Pointer> + ffi.Pointer> get clang_formatDiagnostic => _library._clang_formatDiagnosticPtr; - ffi.Pointer> + ffi.Pointer> get clang_defaultDiagnosticDisplayOptions => _library._clang_defaultDiagnosticDisplayOptionsPtr; - ffi.Pointer> + ffi.Pointer> get clang_getDiagnosticSeverity => _library._clang_getDiagnosticSeverityPtr; - ffi.Pointer> + ffi.Pointer> get clang_getDiagnosticLocation => _library._clang_getDiagnosticLocationPtr; - ffi.Pointer> + ffi.Pointer> get clang_getDiagnosticSpelling => _library._clang_getDiagnosticSpellingPtr; - ffi.Pointer> + ffi.Pointer> get clang_getDiagnosticOption => _library._clang_getDiagnosticOptionPtr; - ffi.Pointer> + ffi.Pointer> get clang_getDiagnosticCategory => _library._clang_getDiagnosticCategoryPtr; - ffi.Pointer> + ffi.Pointer> get clang_getDiagnosticCategoryName => _library._clang_getDiagnosticCategoryNamePtr; - ffi.Pointer> + ffi.Pointer> get clang_getDiagnosticCategoryText => _library._clang_getDiagnosticCategoryTextPtr; - ffi.Pointer> + ffi.Pointer> get clang_getDiagnosticNumRanges => _library._clang_getDiagnosticNumRangesPtr; - ffi.Pointer> + ffi.Pointer> get clang_getDiagnosticRange => _library._clang_getDiagnosticRangePtr; - ffi.Pointer> + ffi.Pointer> get clang_getDiagnosticNumFixIts => _library._clang_getDiagnosticNumFixItsPtr; - ffi.Pointer> + ffi.Pointer> get clang_getDiagnosticFixIt => _library._clang_getDiagnosticFixItPtr; - ffi.Pointer> + ffi.Pointer> get clang_getTranslationUnitSpelling => _library._clang_getTranslationUnitSpellingPtr; ffi.Pointer< - ffi.NativeFunction> + ffi.NativeFunction> get clang_createTranslationUnitFromSourceFile => _library._clang_createTranslationUnitFromSourceFilePtr; - ffi.Pointer> + ffi.Pointer> get clang_createTranslationUnit => _library._clang_createTranslationUnitPtr; - ffi.Pointer> + ffi.Pointer> get clang_createTranslationUnit2 => _library._clang_createTranslationUnit2Ptr; ffi.Pointer< - ffi.NativeFunction> + ffi.NativeFunction> get clang_defaultEditingTranslationUnitOptions => _library._clang_defaultEditingTranslationUnitOptionsPtr; - ffi.Pointer> + ffi.Pointer> get clang_parseTranslationUnit => _library._clang_parseTranslationUnitPtr; - ffi.Pointer> + ffi.Pointer> get clang_parseTranslationUnit2 => _library._clang_parseTranslationUnit2Ptr; - ffi.Pointer> + ffi.Pointer> get clang_parseTranslationUnit2FullArgv => _library._clang_parseTranslationUnit2FullArgvPtr; - ffi.Pointer> + ffi.Pointer> get clang_defaultSaveOptions => _library._clang_defaultSaveOptionsPtr; - ffi.Pointer> + ffi.Pointer> get clang_saveTranslationUnit => _library._clang_saveTranslationUnitPtr; - ffi.Pointer> + ffi.Pointer> get clang_suspendTranslationUnit => _library._clang_suspendTranslationUnitPtr; - ffi.Pointer> + ffi.Pointer> get clang_disposeTranslationUnit => _library._clang_disposeTranslationUnitPtr; - ffi.Pointer> + ffi.Pointer> get clang_defaultReparseOptions => _library._clang_defaultReparseOptionsPtr; - ffi.Pointer> + ffi.Pointer> get clang_reparseTranslationUnit => _library._clang_reparseTranslationUnitPtr; - ffi.Pointer> + ffi.Pointer> get clang_getTUResourceUsageName => _library._clang_getTUResourceUsageNamePtr; - ffi.Pointer> + ffi.Pointer> get clang_getCXTUResourceUsage => _library._clang_getCXTUResourceUsagePtr; - ffi.Pointer> + ffi.Pointer> get clang_disposeCXTUResourceUsage => _library._clang_disposeCXTUResourceUsagePtr; - ffi.Pointer> + ffi.Pointer> get clang_getTranslationUnitTargetInfo => _library._clang_getTranslationUnitTargetInfoPtr; - ffi.Pointer> + ffi.Pointer> get clang_TargetInfo_dispose => _library._clang_TargetInfo_disposePtr; - ffi.Pointer> + ffi.Pointer> get clang_TargetInfo_getTriple => _library._clang_TargetInfo_getTriplePtr; - ffi.Pointer> + ffi.Pointer> get clang_TargetInfo_getPointerWidth => _library._clang_TargetInfo_getPointerWidthPtr; - ffi.Pointer> + ffi.Pointer> get clang_getNullCursor => _library._clang_getNullCursorPtr; - ffi.Pointer> + ffi.Pointer> get clang_getTranslationUnitCursor => _library._clang_getTranslationUnitCursorPtr; - ffi.Pointer> + ffi.Pointer> get clang_equalCursors => _library._clang_equalCursorsPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_isNull => _library._clang_Cursor_isNullPtr; - ffi.Pointer> + ffi.Pointer> get clang_hashCursor => _library._clang_hashCursorPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorKind => _library._clang_getCursorKindPtr; - ffi.Pointer> + ffi.Pointer> get clang_isDeclaration => _library._clang_isDeclarationPtr; - ffi.Pointer> + ffi.Pointer> get clang_isInvalidDeclaration => _library._clang_isInvalidDeclarationPtr; - ffi.Pointer> + ffi.Pointer> get clang_isReference => _library._clang_isReferencePtr; - ffi.Pointer> + ffi.Pointer> get clang_isExpression => _library._clang_isExpressionPtr; - ffi.Pointer> + ffi.Pointer> get clang_isStatement => _library._clang_isStatementPtr; - ffi.Pointer> + ffi.Pointer> get clang_isAttribute => _library._clang_isAttributePtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_hasAttrs => _library._clang_Cursor_hasAttrsPtr; - ffi.Pointer> get clang_isInvalid => + ffi.Pointer> get clang_isInvalid => _library._clang_isInvalidPtr; - ffi.Pointer> + ffi.Pointer> get clang_isTranslationUnit => _library._clang_isTranslationUnitPtr; - ffi.Pointer> + ffi.Pointer> get clang_isPreprocessing => _library._clang_isPreprocessingPtr; - ffi.Pointer> + ffi.Pointer> get clang_isUnexposed => _library._clang_isUnexposedPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorLinkage => _library._clang_getCursorLinkagePtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorVisibility => _library._clang_getCursorVisibilityPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorAvailability => _library._clang_getCursorAvailabilityPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorPlatformAvailability => _library._clang_getCursorPlatformAvailabilityPtr; - ffi.Pointer> + ffi.Pointer> get clang_disposeCXPlatformAvailability => _library._clang_disposeCXPlatformAvailabilityPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorLanguage => _library._clang_getCursorLanguagePtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorTLSKind => _library._clang_getCursorTLSKindPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getTranslationUnit => _library._clang_Cursor_getTranslationUnitPtr; - ffi.Pointer> + ffi.Pointer> get clang_createCXCursorSet => _library._clang_createCXCursorSetPtr; - ffi.Pointer> + ffi.Pointer> get clang_disposeCXCursorSet => _library._clang_disposeCXCursorSetPtr; - ffi.Pointer> + ffi.Pointer> get clang_CXCursorSet_contains => _library._clang_CXCursorSet_containsPtr; - ffi.Pointer> + ffi.Pointer> get clang_CXCursorSet_insert => _library._clang_CXCursorSet_insertPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorSemanticParent => _library._clang_getCursorSemanticParentPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorLexicalParent => _library._clang_getCursorLexicalParentPtr; - ffi.Pointer> + ffi.Pointer> get clang_getOverriddenCursors => _library._clang_getOverriddenCursorsPtr; - ffi.Pointer> + ffi.Pointer> get clang_disposeOverriddenCursors => _library._clang_disposeOverriddenCursorsPtr; - ffi.Pointer> + ffi.Pointer> get clang_getIncludedFile => _library._clang_getIncludedFilePtr; - ffi.Pointer> get clang_getCursor => + ffi.Pointer> get clang_getCursor => _library._clang_getCursorPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorLocation => _library._clang_getCursorLocationPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorExtent => _library._clang_getCursorExtentPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorType => _library._clang_getCursorTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_getTypeSpelling => _library._clang_getTypeSpellingPtr; - ffi.Pointer> + ffi.Pointer> get clang_getTypedefDeclUnderlyingType => _library._clang_getTypedefDeclUnderlyingTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_getEnumDeclIntegerType => _library._clang_getEnumDeclIntegerTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_getEnumConstantDeclValue => _library._clang_getEnumConstantDeclValuePtr; - ffi.Pointer> + ffi.Pointer> get clang_getEnumConstantDeclUnsignedValue => _library._clang_getEnumConstantDeclUnsignedValuePtr; - ffi.Pointer> + ffi.Pointer> get clang_getFieldDeclBitWidth => _library._clang_getFieldDeclBitWidthPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getNumArguments => _library._clang_Cursor_getNumArgumentsPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getArgument => _library._clang_Cursor_getArgumentPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getNumTemplateArguments => _library._clang_Cursor_getNumTemplateArgumentsPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getTemplateArgumentKind => _library._clang_Cursor_getTemplateArgumentKindPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getTemplateArgumentType => _library._clang_Cursor_getTemplateArgumentTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getTemplateArgumentValue => _library._clang_Cursor_getTemplateArgumentValuePtr; ffi.Pointer< ffi.NativeFunction< - Native_clang_Cursor_getTemplateArgumentUnsignedValue>> + NativeClang_Cursor_getTemplateArgumentUnsignedValue>> get clang_Cursor_getTemplateArgumentUnsignedValue => _library._clang_Cursor_getTemplateArgumentUnsignedValuePtr; - ffi.Pointer> + ffi.Pointer> get clang_equalTypes => _library._clang_equalTypesPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCanonicalType => _library._clang_getCanonicalTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_isConstQualifiedType => _library._clang_isConstQualifiedTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_isMacroFunctionLike => _library._clang_Cursor_isMacroFunctionLikePtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_isMacroBuiltin => _library._clang_Cursor_isMacroBuiltinPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_isFunctionInlined => _library._clang_Cursor_isFunctionInlinedPtr; - ffi.Pointer> + ffi.Pointer> get clang_isVolatileQualifiedType => _library._clang_isVolatileQualifiedTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_isRestrictQualifiedType => _library._clang_isRestrictQualifiedTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_getAddressSpace => _library._clang_getAddressSpacePtr; - ffi.Pointer> + ffi.Pointer> get clang_getTypedefName => _library._clang_getTypedefNamePtr; - ffi.Pointer> + ffi.Pointer> get clang_getPointeeType => _library._clang_getPointeeTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_getTypeDeclaration => _library._clang_getTypeDeclarationPtr; - ffi.Pointer> + ffi.Pointer> get clang_getDeclObjCTypeEncoding => _library._clang_getDeclObjCTypeEncodingPtr; - ffi.Pointer> + ffi.Pointer> get clang_Type_getObjCEncoding => _library._clang_Type_getObjCEncodingPtr; - ffi.Pointer> + ffi.Pointer> get clang_getTypeKindSpelling => _library._clang_getTypeKindSpellingPtr; - ffi.Pointer> + ffi.Pointer> get clang_getFunctionTypeCallingConv => _library._clang_getFunctionTypeCallingConvPtr; - ffi.Pointer> + ffi.Pointer> get clang_getResultType => _library._clang_getResultTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_getExceptionSpecificationType => _library._clang_getExceptionSpecificationTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_getNumArgTypes => _library._clang_getNumArgTypesPtr; - ffi.Pointer> + ffi.Pointer> get clang_getArgType => _library._clang_getArgTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_Type_getObjCObjectBaseType => _library._clang_Type_getObjCObjectBaseTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_Type_getNumObjCProtocolRefs => _library._clang_Type_getNumObjCProtocolRefsPtr; - ffi.Pointer> + ffi.Pointer> get clang_Type_getObjCProtocolDecl => _library._clang_Type_getObjCProtocolDeclPtr; - ffi.Pointer> + ffi.Pointer> get clang_Type_getNumObjCTypeArgs => _library._clang_Type_getNumObjCTypeArgsPtr; - ffi.Pointer> + ffi.Pointer> get clang_Type_getObjCTypeArg => _library._clang_Type_getObjCTypeArgPtr; - ffi.Pointer> + ffi.Pointer> get clang_isFunctionTypeVariadic => _library._clang_isFunctionTypeVariadicPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorResultType => _library._clang_getCursorResultTypePtr; ffi.Pointer< - ffi.NativeFunction> + ffi.NativeFunction> get clang_getCursorExceptionSpecificationType => _library._clang_getCursorExceptionSpecificationTypePtr; - ffi.Pointer> get clang_isPODType => + ffi.Pointer> get clang_isPODType => _library._clang_isPODTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_getElementType => _library._clang_getElementTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_getNumElements => _library._clang_getNumElementsPtr; - ffi.Pointer> + ffi.Pointer> get clang_getArrayElementType => _library._clang_getArrayElementTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_getArraySize => _library._clang_getArraySizePtr; - ffi.Pointer> + ffi.Pointer> get clang_Type_getNamedType => _library._clang_Type_getNamedTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_Type_isTransparentTagTypedef => _library._clang_Type_isTransparentTagTypedefPtr; - ffi.Pointer> + ffi.Pointer> get clang_Type_getNullability => _library._clang_Type_getNullabilityPtr; - ffi.Pointer> + ffi.Pointer> get clang_Type_getAlignOf => _library._clang_Type_getAlignOfPtr; - ffi.Pointer> + ffi.Pointer> get clang_Type_getClassType => _library._clang_Type_getClassTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_Type_getSizeOf => _library._clang_Type_getSizeOfPtr; - ffi.Pointer> + ffi.Pointer> get clang_Type_getOffsetOf => _library._clang_Type_getOffsetOfPtr; - ffi.Pointer> + ffi.Pointer> get clang_Type_getModifiedType => _library._clang_Type_getModifiedTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getOffsetOfField => _library._clang_Cursor_getOffsetOfFieldPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_isAnonymous => _library._clang_Cursor_isAnonymousPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_isAnonymousRecordDecl => _library._clang_Cursor_isAnonymousRecordDeclPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_isInlineNamespace => _library._clang_Cursor_isInlineNamespacePtr; - ffi.Pointer> + ffi.Pointer> get clang_Type_getNumTemplateArguments => _library._clang_Type_getNumTemplateArgumentsPtr; - ffi.Pointer> + ffi.Pointer> get clang_Type_getTemplateArgumentAsType => _library._clang_Type_getTemplateArgumentAsTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_Type_getCXXRefQualifier => _library._clang_Type_getCXXRefQualifierPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_isBitField => _library._clang_Cursor_isBitFieldPtr; - ffi.Pointer> + ffi.Pointer> get clang_isVirtualBase => _library._clang_isVirtualBasePtr; - ffi.Pointer> + ffi.Pointer> get clang_getCXXAccessSpecifier => _library._clang_getCXXAccessSpecifierPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getStorageClass => _library._clang_Cursor_getStorageClassPtr; - ffi.Pointer> + ffi.Pointer> get clang_getNumOverloadedDecls => _library._clang_getNumOverloadedDeclsPtr; - ffi.Pointer> + ffi.Pointer> get clang_getOverloadedDecl => _library._clang_getOverloadedDeclPtr; - ffi.Pointer> + ffi.Pointer> get clang_getIBOutletCollectionType => _library._clang_getIBOutletCollectionTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_visitChildren => _library._clang_visitChildrenPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorUSR => _library._clang_getCursorUSRPtr; - ffi.Pointer> + ffi.Pointer> get clang_constructUSR_ObjCClass => _library._clang_constructUSR_ObjCClassPtr; - ffi.Pointer> + ffi.Pointer> get clang_constructUSR_ObjCCategory => _library._clang_constructUSR_ObjCCategoryPtr; - ffi.Pointer> + ffi.Pointer> get clang_constructUSR_ObjCProtocol => _library._clang_constructUSR_ObjCProtocolPtr; - ffi.Pointer> + ffi.Pointer> get clang_constructUSR_ObjCIvar => _library._clang_constructUSR_ObjCIvarPtr; - ffi.Pointer> + ffi.Pointer> get clang_constructUSR_ObjCMethod => _library._clang_constructUSR_ObjCMethodPtr; - ffi.Pointer> + ffi.Pointer> get clang_constructUSR_ObjCProperty => _library._clang_constructUSR_ObjCPropertyPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorSpelling => _library._clang_getCursorSpellingPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getSpellingNameRange => _library._clang_Cursor_getSpellingNameRangePtr; - ffi.Pointer> + ffi.Pointer> get clang_PrintingPolicy_getProperty => _library._clang_PrintingPolicy_getPropertyPtr; - ffi.Pointer> + ffi.Pointer> get clang_PrintingPolicy_setProperty => _library._clang_PrintingPolicy_setPropertyPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorPrintingPolicy => _library._clang_getCursorPrintingPolicyPtr; - ffi.Pointer> + ffi.Pointer> get clang_PrintingPolicy_dispose => _library._clang_PrintingPolicy_disposePtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorPrettyPrinted => _library._clang_getCursorPrettyPrintedPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorDisplayName => _library._clang_getCursorDisplayNamePtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorReferenced => _library._clang_getCursorReferencedPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorDefinition => _library._clang_getCursorDefinitionPtr; - ffi.Pointer> + ffi.Pointer> get clang_isCursorDefinition => _library._clang_isCursorDefinitionPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCanonicalCursor => _library._clang_getCanonicalCursorPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getObjCSelectorIndex => _library._clang_Cursor_getObjCSelectorIndexPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_isDynamicCall => _library._clang_Cursor_isDynamicCallPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getReceiverType => _library._clang_Cursor_getReceiverTypePtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getObjCPropertyAttributes => _library._clang_Cursor_getObjCPropertyAttributesPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getObjCPropertyGetterName => _library._clang_Cursor_getObjCPropertyGetterNamePtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getObjCPropertySetterName => _library._clang_Cursor_getObjCPropertySetterNamePtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getObjCDeclQualifiers => _library._clang_Cursor_getObjCDeclQualifiersPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_isObjCOptional => _library._clang_Cursor_isObjCOptionalPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_isVariadic => _library._clang_Cursor_isVariadicPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_isExternalSymbol => _library._clang_Cursor_isExternalSymbolPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getCommentRange => _library._clang_Cursor_getCommentRangePtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getRawCommentText => _library._clang_Cursor_getRawCommentTextPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getBriefCommentText => _library._clang_Cursor_getBriefCommentTextPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getMangling => _library._clang_Cursor_getManglingPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getCXXManglings => _library._clang_Cursor_getCXXManglingsPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getObjCManglings => _library._clang_Cursor_getObjCManglingsPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_getModule => _library._clang_Cursor_getModulePtr; - ffi.Pointer> + ffi.Pointer> get clang_getModuleForFile => _library._clang_getModuleForFilePtr; - ffi.Pointer> + ffi.Pointer> get clang_Module_getASTFile => _library._clang_Module_getASTFilePtr; - ffi.Pointer> + ffi.Pointer> get clang_Module_getParent => _library._clang_Module_getParentPtr; - ffi.Pointer> + ffi.Pointer> get clang_Module_getName => _library._clang_Module_getNamePtr; - ffi.Pointer> + ffi.Pointer> get clang_Module_getFullName => _library._clang_Module_getFullNamePtr; - ffi.Pointer> + ffi.Pointer> get clang_Module_isSystem => _library._clang_Module_isSystemPtr; - ffi.Pointer> + ffi.Pointer> get clang_Module_getNumTopLevelHeaders => _library._clang_Module_getNumTopLevelHeadersPtr; - ffi.Pointer> + ffi.Pointer> get clang_Module_getTopLevelHeader => _library._clang_Module_getTopLevelHeaderPtr; ffi.Pointer< ffi.NativeFunction< - Native_clang_CXXConstructor_isConvertingConstructor>> + NativeClang_CXXConstructor_isConvertingConstructor>> get clang_CXXConstructor_isConvertingConstructor => _library._clang_CXXConstructor_isConvertingConstructorPtr; - ffi.Pointer> + ffi.Pointer> get clang_CXXConstructor_isCopyConstructor => _library._clang_CXXConstructor_isCopyConstructorPtr; ffi.Pointer< - ffi.NativeFunction> + ffi.NativeFunction> get clang_CXXConstructor_isDefaultConstructor => _library._clang_CXXConstructor_isDefaultConstructorPtr; - ffi.Pointer> + ffi.Pointer> get clang_CXXConstructor_isMoveConstructor => _library._clang_CXXConstructor_isMoveConstructorPtr; - ffi.Pointer> + ffi.Pointer> get clang_CXXField_isMutable => _library._clang_CXXField_isMutablePtr; - ffi.Pointer> + ffi.Pointer> get clang_CXXMethod_isDefaulted => _library._clang_CXXMethod_isDefaultedPtr; - ffi.Pointer> + ffi.Pointer> get clang_CXXMethod_isPureVirtual => _library._clang_CXXMethod_isPureVirtualPtr; - ffi.Pointer> + ffi.Pointer> get clang_CXXMethod_isStatic => _library._clang_CXXMethod_isStaticPtr; - ffi.Pointer> + ffi.Pointer> get clang_CXXMethod_isVirtual => _library._clang_CXXMethod_isVirtualPtr; - ffi.Pointer> + ffi.Pointer> get clang_CXXRecord_isAbstract => _library._clang_CXXRecord_isAbstractPtr; - ffi.Pointer> + ffi.Pointer> get clang_EnumDecl_isScoped => _library._clang_EnumDecl_isScopedPtr; - ffi.Pointer> + ffi.Pointer> get clang_CXXMethod_isConst => _library._clang_CXXMethod_isConstPtr; - ffi.Pointer> + ffi.Pointer> get clang_getTemplateCursorKind => _library._clang_getTemplateCursorKindPtr; - ffi.Pointer> + ffi.Pointer> get clang_getSpecializedCursorTemplate => _library._clang_getSpecializedCursorTemplatePtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorReferenceNameRange => _library._clang_getCursorReferenceNameRangePtr; - ffi.Pointer> get clang_getToken => + ffi.Pointer> get clang_getToken => _library._clang_getTokenPtr; - ffi.Pointer> + ffi.Pointer> get clang_getTokenKind => _library._clang_getTokenKindPtr; - ffi.Pointer> + ffi.Pointer> get clang_getTokenSpelling => _library._clang_getTokenSpellingPtr; - ffi.Pointer> + ffi.Pointer> get clang_getTokenLocation => _library._clang_getTokenLocationPtr; - ffi.Pointer> + ffi.Pointer> get clang_getTokenExtent => _library._clang_getTokenExtentPtr; - ffi.Pointer> get clang_tokenize => + ffi.Pointer> get clang_tokenize => _library._clang_tokenizePtr; - ffi.Pointer> + ffi.Pointer> get clang_annotateTokens => _library._clang_annotateTokensPtr; - ffi.Pointer> + ffi.Pointer> get clang_disposeTokens => _library._clang_disposeTokensPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorKindSpelling => _library._clang_getCursorKindSpellingPtr; - ffi.Pointer> + ffi.Pointer> get clang_getDefinitionSpellingAndExtent => _library._clang_getDefinitionSpellingAndExtentPtr; - ffi.Pointer> + ffi.Pointer> get clang_enableStackTraces => _library._clang_enableStackTracesPtr; - ffi.Pointer> + ffi.Pointer> get clang_executeOnThread => _library._clang_executeOnThreadPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCompletionChunkKind => _library._clang_getCompletionChunkKindPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCompletionChunkText => _library._clang_getCompletionChunkTextPtr; ffi.Pointer< - ffi.NativeFunction> + ffi.NativeFunction> get clang_getCompletionChunkCompletionString => _library._clang_getCompletionChunkCompletionStringPtr; - ffi.Pointer> + ffi.Pointer> get clang_getNumCompletionChunks => _library._clang_getNumCompletionChunksPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCompletionPriority => _library._clang_getCompletionPriorityPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCompletionAvailability => _library._clang_getCompletionAvailabilityPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCompletionNumAnnotations => _library._clang_getCompletionNumAnnotationsPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCompletionAnnotation => _library._clang_getCompletionAnnotationPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCompletionParent => _library._clang_getCompletionParentPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCompletionBriefComment => _library._clang_getCompletionBriefCommentPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCursorCompletionString => _library._clang_getCursorCompletionStringPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCompletionNumFixIts => _library._clang_getCompletionNumFixItsPtr; - ffi.Pointer> + ffi.Pointer> get clang_getCompletionFixIt => _library._clang_getCompletionFixItPtr; - ffi.Pointer> + ffi.Pointer> get clang_defaultCodeCompleteOptions => _library._clang_defaultCodeCompleteOptionsPtr; - ffi.Pointer> + ffi.Pointer> get clang_codeCompleteAt => _library._clang_codeCompleteAtPtr; - ffi.Pointer> + ffi.Pointer> get clang_sortCodeCompletionResults => _library._clang_sortCodeCompletionResultsPtr; - ffi.Pointer> + ffi.Pointer> get clang_disposeCodeCompleteResults => _library._clang_disposeCodeCompleteResultsPtr; - ffi.Pointer> + ffi.Pointer> get clang_codeCompleteGetNumDiagnostics => _library._clang_codeCompleteGetNumDiagnosticsPtr; - ffi.Pointer> + ffi.Pointer> get clang_codeCompleteGetDiagnostic => _library._clang_codeCompleteGetDiagnosticPtr; - ffi.Pointer> + ffi.Pointer> get clang_codeCompleteGetContexts => _library._clang_codeCompleteGetContextsPtr; - ffi.Pointer> + ffi.Pointer> get clang_codeCompleteGetContainerKind => _library._clang_codeCompleteGetContainerKindPtr; - ffi.Pointer> + ffi.Pointer> get clang_codeCompleteGetContainerUSR => _library._clang_codeCompleteGetContainerUSRPtr; - ffi.Pointer> + ffi.Pointer> get clang_codeCompleteGetObjCSelector => _library._clang_codeCompleteGetObjCSelectorPtr; - ffi.Pointer> + ffi.Pointer> get clang_getClangVersion => _library._clang_getClangVersionPtr; - ffi.Pointer> + ffi.Pointer> get clang_toggleCrashRecovery => _library._clang_toggleCrashRecoveryPtr; - ffi.Pointer> + ffi.Pointer> get clang_getInclusions => _library._clang_getInclusionsPtr; - ffi.Pointer> + ffi.Pointer> get clang_Cursor_Evaluate => _library._clang_Cursor_EvaluatePtr; - ffi.Pointer> + ffi.Pointer> get clang_EvalResult_getKind => _library._clang_EvalResult_getKindPtr; - ffi.Pointer> + ffi.Pointer> get clang_EvalResult_getAsInt => _library._clang_EvalResult_getAsIntPtr; - ffi.Pointer> + ffi.Pointer> get clang_EvalResult_getAsLongLong => _library._clang_EvalResult_getAsLongLongPtr; - ffi.Pointer> + ffi.Pointer> get clang_EvalResult_isUnsignedInt => _library._clang_EvalResult_isUnsignedIntPtr; - ffi.Pointer> + ffi.Pointer> get clang_EvalResult_getAsUnsigned => _library._clang_EvalResult_getAsUnsignedPtr; - ffi.Pointer> + ffi.Pointer> get clang_EvalResult_getAsDouble => _library._clang_EvalResult_getAsDoublePtr; - ffi.Pointer> + ffi.Pointer> get clang_EvalResult_getAsStr => _library._clang_EvalResult_getAsStrPtr; - ffi.Pointer> + ffi.Pointer> get clang_EvalResult_dispose => _library._clang_EvalResult_disposePtr; - ffi.Pointer> + ffi.Pointer> get clang_getRemappings => _library._clang_getRemappingsPtr; - ffi.Pointer> + ffi.Pointer> get clang_getRemappingsFromFileList => _library._clang_getRemappingsFromFileListPtr; - ffi.Pointer> + ffi.Pointer> get clang_remap_getNumFiles => _library._clang_remap_getNumFilesPtr; - ffi.Pointer> + ffi.Pointer> get clang_remap_getFilenames => _library._clang_remap_getFilenamesPtr; - ffi.Pointer> + ffi.Pointer> get clang_remap_dispose => _library._clang_remap_disposePtr; - ffi.Pointer> + ffi.Pointer> get clang_findReferencesInFile => _library._clang_findReferencesInFilePtr; - ffi.Pointer> + ffi.Pointer> get clang_findIncludesInFile => _library._clang_findIncludesInFilePtr; - ffi.Pointer> + ffi.Pointer> get clang_index_isEntityObjCContainerKind => _library._clang_index_isEntityObjCContainerKindPtr; - ffi.Pointer> + ffi.Pointer> get clang_index_getObjCContainerDeclInfo => _library._clang_index_getObjCContainerDeclInfoPtr; - ffi.Pointer> + ffi.Pointer> get clang_index_getObjCInterfaceDeclInfo => _library._clang_index_getObjCInterfaceDeclInfoPtr; - ffi.Pointer> + ffi.Pointer> get clang_index_getObjCCategoryDeclInfo => _library._clang_index_getObjCCategoryDeclInfoPtr; - ffi.Pointer> + ffi.Pointer> get clang_index_getObjCProtocolRefListInfo => _library._clang_index_getObjCProtocolRefListInfoPtr; - ffi.Pointer> + ffi.Pointer> get clang_index_getObjCPropertyDeclInfo => _library._clang_index_getObjCPropertyDeclInfoPtr; ffi.Pointer< - ffi.NativeFunction> + ffi.NativeFunction> get clang_index_getIBOutletCollectionAttrInfo => _library._clang_index_getIBOutletCollectionAttrInfoPtr; - ffi.Pointer> + ffi.Pointer> get clang_index_getCXXClassDeclInfo => _library._clang_index_getCXXClassDeclInfoPtr; - ffi.Pointer> + ffi.Pointer> get clang_index_getClientContainer => _library._clang_index_getClientContainerPtr; - ffi.Pointer> + ffi.Pointer> get clang_index_setClientContainer => _library._clang_index_setClientContainerPtr; - ffi.Pointer> + ffi.Pointer> get clang_index_getClientEntity => _library._clang_index_getClientEntityPtr; - ffi.Pointer> + ffi.Pointer> get clang_index_setClientEntity => _library._clang_index_setClientEntityPtr; - ffi.Pointer> + ffi.Pointer> get clang_IndexAction_create => _library._clang_IndexAction_createPtr; - ffi.Pointer> + ffi.Pointer> get clang_IndexAction_dispose => _library._clang_IndexAction_disposePtr; - ffi.Pointer> + ffi.Pointer> get clang_indexSourceFile => _library._clang_indexSourceFilePtr; - ffi.Pointer> + ffi.Pointer> get clang_indexSourceFileFullArgv => _library._clang_indexSourceFileFullArgvPtr; - ffi.Pointer> + ffi.Pointer> get clang_indexTranslationUnit => _library._clang_indexTranslationUnitPtr; - ffi.Pointer> + ffi.Pointer> get clang_indexLoc_getFileLocation => _library._clang_indexLoc_getFileLocationPtr; - ffi.Pointer> + ffi.Pointer> get clang_indexLoc_getCXSourceLocation => _library._clang_indexLoc_getCXSourceLocationPtr; - ffi.Pointer> + ffi.Pointer> get clang_Type_visitFields => _library._clang_Type_visitFieldsPtr; } @@ -7801,10 +7659,14 @@ class CXStringSet extends ffi.Struct { external int Count; } -typedef Native_clang_getCString = ffi.Pointer Function( +typedef NativeClang_getCString = ffi.Pointer Function( CXString string); -typedef Native_clang_disposeString = ffi.Void Function(CXString string); -typedef Native_clang_disposeStringSet = ffi.Void Function( +typedef DartClang_getCString = ffi.Pointer Function(CXString string); +typedef NativeClang_disposeString = ffi.Void Function(CXString string); +typedef DartClang_disposeString = void Function(CXString string); +typedef NativeClang_disposeStringSet = ffi.Void Function( + ffi.Pointer set1); +typedef DartClang_disposeStringSet = void Function( ffi.Pointer set1); class CXTargetInfoImpl extends ffi.Opaque {} @@ -7850,13 +7712,15 @@ class CXVersion extends ffi.Struct { external int Subminor; } -typedef Native_clang_createIndex = CXIndex Function( - ffi.Int32 excludeDeclarationsFromPCH, ffi.Int32 displayDiagnostics); - /// An "index" that consists of a set of translation units that would /// typically be linked together into an executable or library. typedef CXIndex = ffi.Pointer; -typedef Native_clang_disposeIndex = ffi.Void Function(CXIndex index); +typedef NativeClang_createIndex = CXIndex Function( + ffi.Int32 excludeDeclarationsFromPCH, ffi.Int32 displayDiagnostics); +typedef DartClang_createIndex = CXIndex Function( + int excludeDeclarationsFromPCH, int displayDiagnostics); +typedef NativeClang_disposeIndex = ffi.Void Function(CXIndex index); +typedef DartClang_disposeIndex = void Function(CXIndex index); abstract class CXGlobalOptFlags { /// Used to indicate that no special CXIndex options are needed. @@ -7881,17 +7745,24 @@ abstract class CXGlobalOptFlags { static const int CXGlobalOpt_ThreadBackgroundPriorityForAll = 3; } -typedef Native_clang_CXIndex_setGlobalOptions = ffi.Void Function( +typedef NativeClang_CXIndex_setGlobalOptions = ffi.Void Function( CXIndex arg0, ffi.Uint32 options); -typedef Native_clang_CXIndex_getGlobalOptions = ffi.Uint32 Function( +typedef DartClang_CXIndex_setGlobalOptions = void Function( + CXIndex arg0, int options); +typedef NativeClang_CXIndex_getGlobalOptions = ffi.Uint32 Function( CXIndex arg0); -typedef Native_clang_CXIndex_setInvocationEmissionPathOption = ffi.Void - Function(CXIndex arg0, ffi.Pointer Path); -typedef Native_clang_getFileName = CXString Function(CXFile SFile); +typedef DartClang_CXIndex_getGlobalOptions = int Function(CXIndex arg0); +typedef NativeClang_CXIndex_setInvocationEmissionPathOption = ffi.Void Function( + CXIndex arg0, ffi.Pointer Path); +typedef DartClang_CXIndex_setInvocationEmissionPathOption = void Function( + CXIndex arg0, ffi.Pointer Path); /// A particular source file that is part of a translation unit. typedef CXFile = ffi.Pointer; -typedef Native_clang_getFileTime = ffi.Int64 Function(CXFile SFile); +typedef NativeClang_getFileName = CXString Function(CXFile SFile); +typedef DartClang_getFileName = CXString Function(CXFile SFile); +typedef NativeClang_getFileTime = ffi.Int64 Function(CXFile SFile); +typedef DartClang_getFileTime = int Function(CXFile SFile); /// Uniquely identifies a CXFile, that refers to the same underlying file, /// across an indexing session. @@ -7900,20 +7771,30 @@ class CXFileUniqueID extends ffi.Struct { external ffi.Array data; } -typedef Native_clang_getFileUniqueID = ffi.Int32 Function( +typedef NativeClang_getFileUniqueID = ffi.Int32 Function( + CXFile file, ffi.Pointer outID); +typedef DartClang_getFileUniqueID = int Function( CXFile file, ffi.Pointer outID); -typedef Native_clang_isFileMultipleIncludeGuarded = ffi.Uint32 Function( - CXTranslationUnit tu, CXFile file); /// A single translation unit, which resides in an index. typedef CXTranslationUnit = ffi.Pointer; -typedef Native_clang_getFile = CXFile Function( +typedef NativeClang_isFileMultipleIncludeGuarded = ffi.Uint32 Function( + CXTranslationUnit tu, CXFile file); +typedef DartClang_isFileMultipleIncludeGuarded = int Function( + CXTranslationUnit tu, CXFile file); +typedef NativeClang_getFile = CXFile Function( + CXTranslationUnit tu, ffi.Pointer file_name); +typedef DartClang_getFile = CXFile Function( CXTranslationUnit tu, ffi.Pointer file_name); -typedef Native_clang_getFileContents = ffi.Pointer Function( +typedef NativeClang_getFileContents = ffi.Pointer Function( CXTranslationUnit tu, CXFile file, ffi.Pointer size); -typedef Native_clang_File_isEqual = ffi.Int32 Function( +typedef DartClang_getFileContents = ffi.Pointer Function( + CXTranslationUnit tu, CXFile file, ffi.Pointer size); +typedef NativeClang_File_isEqual = ffi.Int32 Function( CXFile file1, CXFile file2); -typedef Native_clang_File_tryGetRealPathName = CXString Function(CXFile file); +typedef DartClang_File_isEqual = int Function(CXFile file1, CXFile file2); +typedef NativeClang_File_tryGetRealPathName = CXString Function(CXFile file); +typedef DartClang_File_tryGetRealPathName = CXString Function(CXFile file); /// Identifies a specific source location within a translation /// unit. @@ -7943,56 +7824,105 @@ class CXSourceRange extends ffi.Struct { external int end_int_data; } -typedef Native_clang_getNullLocation = CXSourceLocation Function(); -typedef Native_clang_equalLocations = ffi.Uint32 Function( +typedef NativeClang_getNullLocation = CXSourceLocation Function(); +typedef DartClang_getNullLocation = CXSourceLocation Function(); +typedef NativeClang_equalLocations = ffi.Uint32 Function( + CXSourceLocation loc1, CXSourceLocation loc2); +typedef DartClang_equalLocations = int Function( CXSourceLocation loc1, CXSourceLocation loc2); -typedef Native_clang_getLocation = CXSourceLocation Function( +typedef NativeClang_getLocation = CXSourceLocation Function( CXTranslationUnit tu, CXFile file, ffi.Uint32 line, ffi.Uint32 column); -typedef Native_clang_getLocationForOffset = CXSourceLocation Function( +typedef DartClang_getLocation = CXSourceLocation Function( + CXTranslationUnit tu, CXFile file, int line, int column); +typedef NativeClang_getLocationForOffset = CXSourceLocation Function( CXTranslationUnit tu, CXFile file, ffi.Uint32 offset); -typedef Native_clang_Location_isInSystemHeader = ffi.Int32 Function( +typedef DartClang_getLocationForOffset = CXSourceLocation Function( + CXTranslationUnit tu, CXFile file, int offset); +typedef NativeClang_Location_isInSystemHeader = ffi.Int32 Function( + CXSourceLocation location); +typedef DartClang_Location_isInSystemHeader = int Function( CXSourceLocation location); -typedef Native_clang_Location_isFromMainFile = ffi.Int32 Function( +typedef NativeClang_Location_isFromMainFile = ffi.Int32 Function( CXSourceLocation location); -typedef Native_clang_getNullRange = CXSourceRange Function(); -typedef Native_clang_getRange = CXSourceRange Function( +typedef DartClang_Location_isFromMainFile = int Function( + CXSourceLocation location); +typedef NativeClang_getNullRange = CXSourceRange Function(); +typedef DartClang_getNullRange = CXSourceRange Function(); +typedef NativeClang_getRange = CXSourceRange Function( + CXSourceLocation begin, CXSourceLocation end); +typedef DartClang_getRange = CXSourceRange Function( CXSourceLocation begin, CXSourceLocation end); -typedef Native_clang_equalRanges = ffi.Uint32 Function( +typedef NativeClang_equalRanges = ffi.Uint32 Function( CXSourceRange range1, CXSourceRange range2); -typedef Native_clang_Range_isNull = ffi.Int32 Function(CXSourceRange range); -typedef Native_clang_getExpansionLocation = ffi.Void Function( +typedef DartClang_equalRanges = int Function( + CXSourceRange range1, CXSourceRange range2); +typedef NativeClang_Range_isNull = ffi.Int32 Function(CXSourceRange range); +typedef DartClang_Range_isNull = int Function(CXSourceRange range); +typedef NativeClang_getExpansionLocation = ffi.Void Function( CXSourceLocation location, ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset); -typedef Native_clang_getPresumedLocation = ffi.Void Function( +typedef DartClang_getExpansionLocation = void Function( + CXSourceLocation location, + ffi.Pointer file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); +typedef NativeClang_getPresumedLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer filename, + ffi.Pointer line, + ffi.Pointer column); +typedef DartClang_getPresumedLocation = void Function( CXSourceLocation location, ffi.Pointer filename, ffi.Pointer line, ffi.Pointer column); -typedef Native_clang_getInstantiationLocation = ffi.Void Function( +typedef NativeClang_getInstantiationLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); +typedef DartClang_getInstantiationLocation = void Function( CXSourceLocation location, ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset); -typedef Native_clang_getSpellingLocation = ffi.Void Function( +typedef NativeClang_getSpellingLocation = ffi.Void Function( CXSourceLocation location, ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset); -typedef Native_clang_getFileLocation = ffi.Void Function( +typedef DartClang_getSpellingLocation = void Function( CXSourceLocation location, ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset); -typedef Native_clang_getRangeStart = CXSourceLocation Function( +typedef NativeClang_getFileLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); +typedef DartClang_getFileLocation = void Function( + CXSourceLocation location, + ffi.Pointer file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); +typedef NativeClang_getRangeStart = CXSourceLocation Function( + CXSourceRange range); +typedef DartClang_getRangeStart = CXSourceLocation Function( CXSourceRange range); -typedef Native_clang_getRangeEnd = CXSourceLocation Function( +typedef NativeClang_getRangeEnd = CXSourceLocation Function( CXSourceRange range); +typedef DartClang_getRangeEnd = CXSourceLocation Function(CXSourceRange range); /// Identifies an array of ranges. class CXSourceRangeList extends ffi.Struct { @@ -8004,27 +7934,32 @@ class CXSourceRangeList extends ffi.Struct { external ffi.Pointer ranges; } -typedef Native_clang_getSkippedRanges = ffi.Pointer Function( +typedef NativeClang_getSkippedRanges = ffi.Pointer Function( + CXTranslationUnit tu, CXFile file); +typedef DartClang_getSkippedRanges = ffi.Pointer Function( CXTranslationUnit tu, CXFile file); -typedef Native_clang_getAllSkippedRanges = ffi.Pointer +typedef NativeClang_getAllSkippedRanges = ffi.Pointer Function(CXTranslationUnit tu); -typedef Native_clang_disposeSourceRangeList = ffi.Void Function( +typedef DartClang_getAllSkippedRanges = ffi.Pointer Function( + CXTranslationUnit tu); +typedef NativeClang_disposeSourceRangeList = ffi.Void Function( + ffi.Pointer ranges); +typedef DartClang_disposeSourceRangeList = void Function( ffi.Pointer ranges); -typedef Native_clang_getNumDiagnosticsInSet = ffi.Uint32 Function( - CXDiagnosticSet Diags); /// A group of CXDiagnostics. typedef CXDiagnosticSet = ffi.Pointer; -typedef Native_clang_getDiagnosticInSet = CXDiagnostic Function( - CXDiagnosticSet Diags, ffi.Uint32 Index); +typedef NativeClang_getNumDiagnosticsInSet = ffi.Uint32 Function( + CXDiagnosticSet Diags); +typedef DartClang_getNumDiagnosticsInSet = int Function(CXDiagnosticSet Diags); /// A single diagnostic, containing the diagnostic's severity, /// location, text, source ranges, and fix-it hints. typedef CXDiagnostic = ffi.Pointer; -typedef Native_clang_loadDiagnostics = CXDiagnosticSet Function( - ffi.Pointer file, - ffi.Pointer error, - ffi.Pointer errorString); +typedef NativeClang_getDiagnosticInSet = CXDiagnostic Function( + CXDiagnosticSet Diags, ffi.Uint32 Index); +typedef DartClang_getDiagnosticInSet = CXDiagnostic Function( + CXDiagnosticSet Diags, int Index); /// Describes the kind of error that occurred (if any) in a call to /// \c clang_loadDiagnostics. @@ -8045,23 +7980,41 @@ abstract class CXLoadDiag_Error { static const int CXLoadDiag_InvalidFile = 3; } -typedef Native_clang_disposeDiagnosticSet = ffi.Void Function( +typedef NativeClang_loadDiagnostics = CXDiagnosticSet Function( + ffi.Pointer file, + ffi.Pointer error, + ffi.Pointer errorString); +typedef DartClang_loadDiagnostics = CXDiagnosticSet Function( + ffi.Pointer file, + ffi.Pointer error, + ffi.Pointer errorString); +typedef NativeClang_disposeDiagnosticSet = ffi.Void Function( CXDiagnosticSet Diags); -typedef Native_clang_getChildDiagnostics = CXDiagnosticSet Function( +typedef DartClang_disposeDiagnosticSet = void Function(CXDiagnosticSet Diags); +typedef NativeClang_getChildDiagnostics = CXDiagnosticSet Function( CXDiagnostic D); -typedef Native_clang_getNumDiagnostics = ffi.Uint32 Function( +typedef DartClang_getChildDiagnostics = CXDiagnosticSet Function( + CXDiagnostic D); +typedef NativeClang_getNumDiagnostics = ffi.Uint32 Function( CXTranslationUnit Unit); -typedef Native_clang_getDiagnostic = CXDiagnostic Function( +typedef DartClang_getNumDiagnostics = int Function(CXTranslationUnit Unit); +typedef NativeClang_getDiagnostic = CXDiagnostic Function( CXTranslationUnit Unit, ffi.Uint32 Index); -typedef Native_clang_getDiagnosticSetFromTU = CXDiagnosticSet Function( +typedef DartClang_getDiagnostic = CXDiagnostic Function( + CXTranslationUnit Unit, int Index); +typedef NativeClang_getDiagnosticSetFromTU = CXDiagnosticSet Function( + CXTranslationUnit Unit); +typedef DartClang_getDiagnosticSetFromTU = CXDiagnosticSet Function( CXTranslationUnit Unit); -typedef Native_clang_disposeDiagnostic = ffi.Void Function( +typedef NativeClang_disposeDiagnostic = ffi.Void Function( CXDiagnostic Diagnostic); -typedef Native_clang_formatDiagnostic = CXString Function( +typedef DartClang_disposeDiagnostic = void Function(CXDiagnostic Diagnostic); +typedef NativeClang_formatDiagnostic = CXString Function( CXDiagnostic Diagnostic, ffi.Uint32 Options); -typedef Native_clang_defaultDiagnosticDisplayOptions = ffi.Uint32 Function(); -typedef Native_clang_getDiagnosticSeverity = ffi.Int32 Function( - CXDiagnostic arg0); +typedef DartClang_formatDiagnostic = CXString Function( + CXDiagnostic Diagnostic, int Options); +typedef NativeClang_defaultDiagnosticDisplayOptions = ffi.Uint32 Function(); +typedef DartClang_defaultDiagnosticDisplayOptions = int Function(); /// Describes the severity of a particular diagnostic. abstract class CXDiagnosticSeverity { @@ -8086,31 +8039,54 @@ abstract class CXDiagnosticSeverity { static const int CXDiagnostic_Fatal = 4; } -typedef Native_clang_getDiagnosticLocation = CXSourceLocation Function( +typedef NativeClang_getDiagnosticSeverity = ffi.Int32 Function( + CXDiagnostic arg0); +typedef DartClang_getDiagnosticSeverity = int Function(CXDiagnostic arg0); +typedef NativeClang_getDiagnosticLocation = CXSourceLocation Function( + CXDiagnostic arg0); +typedef DartClang_getDiagnosticLocation = CXSourceLocation Function( CXDiagnostic arg0); -typedef Native_clang_getDiagnosticSpelling = CXString Function( +typedef NativeClang_getDiagnosticSpelling = CXString Function( CXDiagnostic arg0); -typedef Native_clang_getDiagnosticOption = CXString Function( +typedef DartClang_getDiagnosticSpelling = CXString Function(CXDiagnostic arg0); +typedef NativeClang_getDiagnosticOption = CXString Function( CXDiagnostic Diag, ffi.Pointer Disable); -typedef Native_clang_getDiagnosticCategory = ffi.Uint32 Function( +typedef DartClang_getDiagnosticOption = CXString Function( + CXDiagnostic Diag, ffi.Pointer Disable); +typedef NativeClang_getDiagnosticCategory = ffi.Uint32 Function( CXDiagnostic arg0); -typedef Native_clang_getDiagnosticCategoryName = CXString Function( +typedef DartClang_getDiagnosticCategory = int Function(CXDiagnostic arg0); +typedef NativeClang_getDiagnosticCategoryName = CXString Function( ffi.Uint32 Category); -typedef Native_clang_getDiagnosticCategoryText = CXString Function( +typedef DartClang_getDiagnosticCategoryName = CXString Function(int Category); +typedef NativeClang_getDiagnosticCategoryText = CXString Function( + CXDiagnostic arg0); +typedef DartClang_getDiagnosticCategoryText = CXString Function( CXDiagnostic arg0); -typedef Native_clang_getDiagnosticNumRanges = ffi.Uint32 Function( +typedef NativeClang_getDiagnosticNumRanges = ffi.Uint32 Function( CXDiagnostic arg0); -typedef Native_clang_getDiagnosticRange = CXSourceRange Function( +typedef DartClang_getDiagnosticNumRanges = int Function(CXDiagnostic arg0); +typedef NativeClang_getDiagnosticRange = CXSourceRange Function( CXDiagnostic Diagnostic, ffi.Uint32 Range); -typedef Native_clang_getDiagnosticNumFixIts = ffi.Uint32 Function( +typedef DartClang_getDiagnosticRange = CXSourceRange Function( + CXDiagnostic Diagnostic, int Range); +typedef NativeClang_getDiagnosticNumFixIts = ffi.Uint32 Function( CXDiagnostic Diagnostic); -typedef Native_clang_getDiagnosticFixIt = CXString Function( +typedef DartClang_getDiagnosticNumFixIts = int Function( + CXDiagnostic Diagnostic); +typedef NativeClang_getDiagnosticFixIt = CXString Function( CXDiagnostic Diagnostic, ffi.Uint32 FixIt, ffi.Pointer ReplacementRange); -typedef Native_clang_getTranslationUnitSpelling = CXString Function( +typedef DartClang_getDiagnosticFixIt = CXString Function( + CXDiagnostic Diagnostic, + int FixIt, + ffi.Pointer ReplacementRange); +typedef NativeClang_getTranslationUnitSpelling = CXString Function( + CXTranslationUnit CTUnit); +typedef DartClang_getTranslationUnitSpelling = CXString Function( CXTranslationUnit CTUnit); -typedef Native_clang_createTranslationUnitFromSourceFile +typedef NativeClang_createTranslationUnitFromSourceFile = CXTranslationUnit Function( CXIndex CIdx, ffi.Pointer source_filename, @@ -8118,10 +8094,18 @@ typedef Native_clang_createTranslationUnitFromSourceFile ffi.Pointer> clang_command_line_args, ffi.Uint32 num_unsaved_files, ffi.Pointer unsaved_files); -typedef Native_clang_createTranslationUnit = CXTranslationUnit Function( +typedef DartClang_createTranslationUnitFromSourceFile + = CXTranslationUnit Function( + CXIndex 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 NativeClang_createTranslationUnit = CXTranslationUnit Function( + CXIndex CIdx, ffi.Pointer ast_filename); +typedef DartClang_createTranslationUnit = CXTranslationUnit Function( CXIndex CIdx, ffi.Pointer ast_filename); -typedef Native_clang_createTranslationUnit2 = ffi.Int32 Function(CXIndex CIdx, - ffi.Pointer ast_filename, ffi.Pointer out_TU); /// Error codes returned by libclang routines. /// @@ -8148,9 +8132,14 @@ abstract class CXErrorCode { static const int CXError_ASTReadError = 4; } -typedef Native_clang_defaultEditingTranslationUnitOptions = ffi.Uint32 +typedef NativeClang_createTranslationUnit2 = ffi.Int32 Function(CXIndex CIdx, + ffi.Pointer ast_filename, ffi.Pointer out_TU); +typedef DartClang_createTranslationUnit2 = int Function(CXIndex CIdx, + ffi.Pointer ast_filename, ffi.Pointer out_TU); +typedef NativeClang_defaultEditingTranslationUnitOptions = ffi.Uint32 Function(); -typedef Native_clang_parseTranslationUnit = CXTranslationUnit Function( +typedef DartClang_defaultEditingTranslationUnitOptions = int Function(); +typedef NativeClang_parseTranslationUnit = CXTranslationUnit Function( CXIndex CIdx, ffi.Pointer source_filename, ffi.Pointer> command_line_args, @@ -8158,7 +8147,15 @@ typedef Native_clang_parseTranslationUnit = CXTranslationUnit Function( ffi.Pointer unsaved_files, ffi.Uint32 num_unsaved_files, ffi.Uint32 options); -typedef Native_clang_parseTranslationUnit2 = ffi.Int32 Function( +typedef DartClang_parseTranslationUnit = CXTranslationUnit Function( + CXIndex 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 NativeClang_parseTranslationUnit2 = ffi.Int32 Function( CXIndex CIdx, ffi.Pointer source_filename, ffi.Pointer> command_line_args, @@ -8167,7 +8164,16 @@ typedef Native_clang_parseTranslationUnit2 = ffi.Int32 Function( ffi.Uint32 num_unsaved_files, ffi.Uint32 options, ffi.Pointer out_TU); -typedef Native_clang_parseTranslationUnit2FullArgv = ffi.Int32 Function( +typedef DartClang_parseTranslationUnit2 = int Function( + CXIndex 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 NativeClang_parseTranslationUnit2FullArgv = ffi.Int32 Function( CXIndex CIdx, ffi.Pointer source_filename, ffi.Pointer> command_line_args, @@ -8176,23 +8182,42 @@ typedef Native_clang_parseTranslationUnit2FullArgv = ffi.Int32 Function( ffi.Uint32 num_unsaved_files, ffi.Uint32 options, ffi.Pointer out_TU); -typedef Native_clang_defaultSaveOptions = ffi.Uint32 Function( +typedef DartClang_parseTranslationUnit2FullArgv = int Function( + CXIndex 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 NativeClang_defaultSaveOptions = ffi.Uint32 Function( CXTranslationUnit TU); -typedef Native_clang_saveTranslationUnit = ffi.Int32 Function( +typedef DartClang_defaultSaveOptions = int Function(CXTranslationUnit TU); +typedef NativeClang_saveTranslationUnit = ffi.Int32 Function( CXTranslationUnit TU, ffi.Pointer FileName, ffi.Uint32 options); -typedef Native_clang_suspendTranslationUnit = ffi.Uint32 Function( +typedef DartClang_saveTranslationUnit = int Function( + CXTranslationUnit TU, ffi.Pointer FileName, int options); +typedef NativeClang_suspendTranslationUnit = ffi.Uint32 Function( + CXTranslationUnit arg0); +typedef DartClang_suspendTranslationUnit = int Function(CXTranslationUnit arg0); +typedef NativeClang_disposeTranslationUnit = ffi.Void Function( CXTranslationUnit arg0); -typedef Native_clang_disposeTranslationUnit = ffi.Void Function( +typedef DartClang_disposeTranslationUnit = void Function( CXTranslationUnit arg0); -typedef Native_clang_defaultReparseOptions = ffi.Uint32 Function( +typedef NativeClang_defaultReparseOptions = ffi.Uint32 Function( CXTranslationUnit TU); -typedef Native_clang_reparseTranslationUnit = ffi.Int32 Function( +typedef DartClang_defaultReparseOptions = int Function(CXTranslationUnit TU); +typedef NativeClang_reparseTranslationUnit = ffi.Int32 Function( CXTranslationUnit TU, ffi.Uint32 num_unsaved_files, ffi.Pointer unsaved_files, ffi.Uint32 options); -typedef Native_clang_getTUResourceUsageName = ffi.Pointer Function( - ffi.Int32 kind); +typedef DartClang_reparseTranslationUnit = int Function( + CXTranslationUnit TU, + int num_unsaved_files, + ffi.Pointer unsaved_files, + int options); /// Categorizes how memory is being used by a translation unit. abstract class CXTUResourceUsageKind { @@ -8216,6 +8241,11 @@ abstract class CXTUResourceUsageKind { static const int CXTUResourceUsage_Last = 14; } +typedef NativeClang_getTUResourceUsageName = ffi.Pointer Function( + ffi.Int32 kind); +typedef DartClang_getTUResourceUsageName = ffi.Pointer Function( + int kind); + class CXTUResourceUsageEntry extends ffi.Struct { @ffi.Int32() external int kind; @@ -8234,21 +8264,29 @@ class CXTUResourceUsage extends ffi.Struct { external ffi.Pointer entries; } -typedef Native_clang_getCXTUResourceUsage = CXTUResourceUsage Function( +typedef NativeClang_getCXTUResourceUsage = CXTUResourceUsage Function( + CXTranslationUnit TU); +typedef DartClang_getCXTUResourceUsage = CXTUResourceUsage Function( CXTranslationUnit TU); -typedef Native_clang_disposeCXTUResourceUsage = ffi.Void Function( +typedef NativeClang_disposeCXTUResourceUsage = ffi.Void Function( + CXTUResourceUsage usage); +typedef DartClang_disposeCXTUResourceUsage = void Function( CXTUResourceUsage usage); -typedef Native_clang_getTranslationUnitTargetInfo = CXTargetInfo Function( - CXTranslationUnit CTUnit); /// An opaque type representing target information for a given translation /// unit. typedef CXTargetInfo = ffi.Pointer; -typedef Native_clang_TargetInfo_dispose = ffi.Void Function(CXTargetInfo Info); -typedef Native_clang_TargetInfo_getTriple = CXString Function( - CXTargetInfo Info); -typedef Native_clang_TargetInfo_getPointerWidth = ffi.Int32 Function( +typedef NativeClang_getTranslationUnitTargetInfo = CXTargetInfo Function( + CXTranslationUnit CTUnit); +typedef DartClang_getTranslationUnitTargetInfo = CXTargetInfo Function( + CXTranslationUnit CTUnit); +typedef NativeClang_TargetInfo_dispose = ffi.Void Function(CXTargetInfo Info); +typedef DartClang_TargetInfo_dispose = void Function(CXTargetInfo Info); +typedef NativeClang_TargetInfo_getTriple = CXString Function(CXTargetInfo Info); +typedef DartClang_TargetInfo_getTriple = CXString Function(CXTargetInfo Info); +typedef NativeClang_TargetInfo_getPointerWidth = ffi.Int32 Function( CXTargetInfo Info); +typedef DartClang_TargetInfo_getPointerWidth = int Function(CXTargetInfo Info); /// A cursor representing some element in the abstract syntax tree for /// a translation unit. @@ -9063,26 +9101,43 @@ abstract class CXCursorKind { static const int CXCursor_OverloadCandidate = 700; } -typedef Native_clang_getNullCursor = CXCursor Function(); -typedef Native_clang_getTranslationUnitCursor = CXCursor Function( +typedef NativeClang_getNullCursor = CXCursor Function(); +typedef DartClang_getNullCursor = CXCursor Function(); +typedef NativeClang_getTranslationUnitCursor = CXCursor Function( CXTranslationUnit arg0); -typedef Native_clang_equalCursors = ffi.Uint32 Function( +typedef DartClang_getTranslationUnitCursor = CXCursor Function( + CXTranslationUnit arg0); +typedef NativeClang_equalCursors = ffi.Uint32 Function( CXCursor arg0, CXCursor arg1); -typedef Native_clang_Cursor_isNull = ffi.Int32 Function(CXCursor cursor); -typedef Native_clang_hashCursor = ffi.Uint32 Function(CXCursor arg0); -typedef Native_clang_getCursorKind = ffi.Int32 Function(CXCursor arg0); -typedef Native_clang_isDeclaration = ffi.Uint32 Function(ffi.Int32 arg0); -typedef Native_clang_isInvalidDeclaration = ffi.Uint32 Function(CXCursor arg0); -typedef Native_clang_isReference = ffi.Uint32 Function(ffi.Int32 arg0); -typedef Native_clang_isExpression = ffi.Uint32 Function(ffi.Int32 arg0); -typedef Native_clang_isStatement = ffi.Uint32 Function(ffi.Int32 arg0); -typedef Native_clang_isAttribute = ffi.Uint32 Function(ffi.Int32 arg0); -typedef Native_clang_Cursor_hasAttrs = ffi.Uint32 Function(CXCursor C); -typedef Native_clang_isInvalid = ffi.Uint32 Function(ffi.Int32 arg0); -typedef Native_clang_isTranslationUnit = ffi.Uint32 Function(ffi.Int32 arg0); -typedef Native_clang_isPreprocessing = ffi.Uint32 Function(ffi.Int32 arg0); -typedef Native_clang_isUnexposed = ffi.Uint32 Function(ffi.Int32 arg0); -typedef Native_clang_getCursorLinkage = ffi.Int32 Function(CXCursor cursor); +typedef DartClang_equalCursors = int Function(CXCursor arg0, CXCursor arg1); +typedef NativeClang_Cursor_isNull = ffi.Int32 Function(CXCursor cursor); +typedef DartClang_Cursor_isNull = int Function(CXCursor cursor); +typedef NativeClang_hashCursor = ffi.Uint32 Function(CXCursor arg0); +typedef DartClang_hashCursor = int Function(CXCursor arg0); +typedef NativeClang_getCursorKind = ffi.Int32 Function(CXCursor arg0); +typedef DartClang_getCursorKind = int Function(CXCursor arg0); +typedef NativeClang_isDeclaration = ffi.Uint32 Function(ffi.Int32 arg0); +typedef DartClang_isDeclaration = int Function(int arg0); +typedef NativeClang_isInvalidDeclaration = ffi.Uint32 Function(CXCursor arg0); +typedef DartClang_isInvalidDeclaration = int Function(CXCursor arg0); +typedef NativeClang_isReference = ffi.Uint32 Function(ffi.Int32 arg0); +typedef DartClang_isReference = int Function(int arg0); +typedef NativeClang_isExpression = ffi.Uint32 Function(ffi.Int32 arg0); +typedef DartClang_isExpression = int Function(int arg0); +typedef NativeClang_isStatement = ffi.Uint32 Function(ffi.Int32 arg0); +typedef DartClang_isStatement = int Function(int arg0); +typedef NativeClang_isAttribute = ffi.Uint32 Function(ffi.Int32 arg0); +typedef DartClang_isAttribute = int Function(int arg0); +typedef NativeClang_Cursor_hasAttrs = ffi.Uint32 Function(CXCursor C); +typedef DartClang_Cursor_hasAttrs = int Function(CXCursor C); +typedef NativeClang_isInvalid = ffi.Uint32 Function(ffi.Int32 arg0); +typedef DartClang_isInvalid = int Function(int arg0); +typedef NativeClang_isTranslationUnit = ffi.Uint32 Function(ffi.Int32 arg0); +typedef DartClang_isTranslationUnit = int Function(int arg0); +typedef NativeClang_isPreprocessing = ffi.Uint32 Function(ffi.Int32 arg0); +typedef DartClang_isPreprocessing = int Function(int arg0); +typedef NativeClang_isUnexposed = ffi.Uint32 Function(ffi.Int32 arg0); +typedef DartClang_isUnexposed = int Function(int arg0); /// Describe the linkage of the entity referred to by a cursor. abstract class CXLinkageKind { @@ -9105,7 +9160,8 @@ abstract class CXLinkageKind { static const int CXLinkage_External = 4; } -typedef Native_clang_getCursorVisibility = ffi.Int32 Function(CXCursor cursor); +typedef NativeClang_getCursorLinkage = ffi.Int32 Function(CXCursor cursor); +typedef DartClang_getCursorLinkage = int Function(CXCursor cursor); abstract class CXVisibilityKind { /// This value indicates that no visibility information is available @@ -9122,8 +9178,8 @@ abstract class CXVisibilityKind { static const int CXVisibility_Default = 3; } -typedef Native_clang_getCursorAvailability = ffi.Int32 Function( - CXCursor cursor); +typedef NativeClang_getCursorVisibility = ffi.Int32 Function(CXCursor cursor); +typedef DartClang_getCursorVisibility = int Function(CXCursor cursor); /// Describes the availability of a particular entity, which indicates /// whether the use of this entity will result in a warning or error due to @@ -9144,6 +9200,9 @@ abstract class CXAvailabilityKind { static const int CXAvailability_NotAccessible = 3; } +typedef NativeClang_getCursorAvailability = ffi.Int32 Function(CXCursor cursor); +typedef DartClang_getCursorAvailability = int Function(CXCursor cursor); + /// 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 { @@ -9173,7 +9232,7 @@ class CXPlatformAvailability extends ffi.Struct { external CXString Message; } -typedef Native_clang_getCursorPlatformAvailability = ffi.Int32 Function( +typedef NativeClang_getCursorPlatformAvailability = ffi.Int32 Function( CXCursor cursor, ffi.Pointer always_deprecated, ffi.Pointer deprecated_message, @@ -9181,9 +9240,18 @@ typedef Native_clang_getCursorPlatformAvailability = ffi.Int32 Function( ffi.Pointer unavailable_message, ffi.Pointer availability, ffi.Int32 availability_size); -typedef Native_clang_disposeCXPlatformAvailability = ffi.Void Function( +typedef DartClang_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 NativeClang_disposeCXPlatformAvailability = ffi.Void Function( + ffi.Pointer availability); +typedef DartClang_disposeCXPlatformAvailability = void Function( ffi.Pointer availability); -typedef Native_clang_getCursorLanguage = ffi.Int32 Function(CXCursor cursor); /// Describe the "language" of the entity referred to by a cursor. abstract class CXLanguageKind { @@ -9193,7 +9261,8 @@ abstract class CXLanguageKind { static const int CXLanguage_CPlusPlus = 3; } -typedef Native_clang_getCursorTLSKind = ffi.Int32 Function(CXCursor cursor); +typedef NativeClang_getCursorLanguage = ffi.Int32 Function(CXCursor cursor); +typedef DartClang_getCursorLanguage = int Function(CXCursor cursor); /// Describe the "thread-local storage (TLS) kind" of the declaration /// referred to by a cursor. @@ -9203,36 +9272,57 @@ abstract class CXTLSKind { static const int CXTLS_Static = 2; } -typedef Native_clang_Cursor_getTranslationUnit = CXTranslationUnit Function( +typedef NativeClang_getCursorTLSKind = ffi.Int32 Function(CXCursor cursor); +typedef DartClang_getCursorTLSKind = int Function(CXCursor cursor); +typedef NativeClang_Cursor_getTranslationUnit = CXTranslationUnit Function( + CXCursor arg0); +typedef DartClang_Cursor_getTranslationUnit = CXTranslationUnit Function( CXCursor arg0); class CXCursorSetImpl extends ffi.Opaque {} -typedef Native_clang_createCXCursorSet = CXCursorSet Function(); - /// A fast container representing a set of CXCursors. typedef CXCursorSet = ffi.Pointer; -typedef Native_clang_disposeCXCursorSet = ffi.Void Function(CXCursorSet cset); -typedef Native_clang_CXCursorSet_contains = ffi.Uint32 Function( +typedef NativeClang_createCXCursorSet = CXCursorSet Function(); +typedef DartClang_createCXCursorSet = CXCursorSet Function(); +typedef NativeClang_disposeCXCursorSet = ffi.Void Function(CXCursorSet cset); +typedef DartClang_disposeCXCursorSet = void Function(CXCursorSet cset); +typedef NativeClang_CXCursorSet_contains = ffi.Uint32 Function( CXCursorSet cset, CXCursor cursor); -typedef Native_clang_CXCursorSet_insert = ffi.Uint32 Function( +typedef DartClang_CXCursorSet_contains = int Function( CXCursorSet cset, CXCursor cursor); -typedef Native_clang_getCursorSemanticParent = CXCursor Function( - CXCursor cursor); -typedef Native_clang_getCursorLexicalParent = CXCursor Function( +typedef NativeClang_CXCursorSet_insert = ffi.Uint32 Function( + CXCursorSet cset, CXCursor cursor); +typedef DartClang_CXCursorSet_insert = int Function( + CXCursorSet cset, CXCursor cursor); +typedef NativeClang_getCursorSemanticParent = CXCursor Function( CXCursor cursor); -typedef Native_clang_getOverriddenCursors = ffi.Void Function( +typedef DartClang_getCursorSemanticParent = CXCursor Function(CXCursor cursor); +typedef NativeClang_getCursorLexicalParent = CXCursor Function(CXCursor cursor); +typedef DartClang_getCursorLexicalParent = CXCursor Function(CXCursor cursor); +typedef NativeClang_getOverriddenCursors = ffi.Void Function( CXCursor cursor, ffi.Pointer> overridden, ffi.Pointer num_overridden); -typedef Native_clang_disposeOverriddenCursors = ffi.Void Function( +typedef DartClang_getOverriddenCursors = void Function( + CXCursor cursor, + ffi.Pointer> overridden, + ffi.Pointer num_overridden); +typedef NativeClang_disposeOverriddenCursors = ffi.Void Function( + ffi.Pointer overridden); +typedef DartClang_disposeOverriddenCursors = void Function( ffi.Pointer overridden); -typedef Native_clang_getIncludedFile = CXFile Function(CXCursor cursor); -typedef Native_clang_getCursor = CXCursor Function( +typedef NativeClang_getIncludedFile = CXFile Function(CXCursor cursor); +typedef DartClang_getIncludedFile = CXFile Function(CXCursor cursor); +typedef NativeClang_getCursor = CXCursor Function( CXTranslationUnit arg0, CXSourceLocation arg1); -typedef Native_clang_getCursorLocation = CXSourceLocation Function( +typedef DartClang_getCursor = CXCursor Function( + CXTranslationUnit arg0, CXSourceLocation arg1); +typedef NativeClang_getCursorLocation = CXSourceLocation Function( CXCursor arg0); -typedef Native_clang_getCursorExtent = CXSourceRange Function(CXCursor arg0); +typedef DartClang_getCursorLocation = CXSourceLocation Function(CXCursor arg0); +typedef NativeClang_getCursorExtent = CXSourceRange Function(CXCursor arg0); +typedef DartClang_getCursorExtent = CXSourceRange Function(CXCursor arg0); /// Describes the kind of type abstract class CXTypeKind { @@ -9373,21 +9463,29 @@ class CXType extends ffi.Struct { external ffi.Array> data; } -typedef Native_clang_getCursorType = CXType Function(CXCursor C); -typedef Native_clang_getTypeSpelling = CXString Function(CXType CT); -typedef Native_clang_getTypedefDeclUnderlyingType = CXType Function(CXCursor C); -typedef Native_clang_getEnumDeclIntegerType = CXType Function(CXCursor C); -typedef Native_clang_getEnumConstantDeclValue = ffi.Int64 Function(CXCursor C); -typedef Native_clang_getEnumConstantDeclUnsignedValue = ffi.Uint64 Function( +typedef NativeClang_getCursorType = CXType Function(CXCursor C); +typedef DartClang_getCursorType = CXType Function(CXCursor C); +typedef NativeClang_getTypeSpelling = CXString Function(CXType CT); +typedef DartClang_getTypeSpelling = CXString Function(CXType CT); +typedef NativeClang_getTypedefDeclUnderlyingType = CXType Function(CXCursor C); +typedef DartClang_getTypedefDeclUnderlyingType = CXType Function(CXCursor C); +typedef NativeClang_getEnumDeclIntegerType = CXType Function(CXCursor C); +typedef DartClang_getEnumDeclIntegerType = CXType Function(CXCursor C); +typedef NativeClang_getEnumConstantDeclValue = ffi.Int64 Function(CXCursor C); +typedef DartClang_getEnumConstantDeclValue = int Function(CXCursor C); +typedef NativeClang_getEnumConstantDeclUnsignedValue = ffi.Uint64 Function( CXCursor C); -typedef Native_clang_getFieldDeclBitWidth = ffi.Int32 Function(CXCursor C); -typedef Native_clang_Cursor_getNumArguments = ffi.Int32 Function(CXCursor C); -typedef Native_clang_Cursor_getArgument = CXCursor Function( +typedef DartClang_getEnumConstantDeclUnsignedValue = int Function(CXCursor C); +typedef NativeClang_getFieldDeclBitWidth = ffi.Int32 Function(CXCursor C); +typedef DartClang_getFieldDeclBitWidth = int Function(CXCursor C); +typedef NativeClang_Cursor_getNumArguments = ffi.Int32 Function(CXCursor C); +typedef DartClang_Cursor_getNumArguments = int Function(CXCursor C); +typedef NativeClang_Cursor_getArgument = CXCursor Function( CXCursor C, ffi.Uint32 i); -typedef Native_clang_Cursor_getNumTemplateArguments = ffi.Int32 Function( +typedef DartClang_Cursor_getArgument = CXCursor Function(CXCursor C, int i); +typedef NativeClang_Cursor_getNumTemplateArguments = ffi.Int32 Function( CXCursor C); -typedef Native_clang_Cursor_getTemplateArgumentKind = ffi.Int32 Function( - CXCursor C, ffi.Uint32 I); +typedef DartClang_Cursor_getNumTemplateArguments = int Function(CXCursor C); /// Describes the kind of a template argument. /// @@ -9406,29 +9504,53 @@ abstract class CXTemplateArgumentKind { static const int CXTemplateArgumentKind_Invalid = 9; } -typedef Native_clang_Cursor_getTemplateArgumentType = CXType Function( +typedef NativeClang_Cursor_getTemplateArgumentKind = ffi.Int32 Function( CXCursor C, ffi.Uint32 I); -typedef Native_clang_Cursor_getTemplateArgumentValue = ffi.Int64 Function( +typedef DartClang_Cursor_getTemplateArgumentKind = int Function( + CXCursor C, int I); +typedef NativeClang_Cursor_getTemplateArgumentType = CXType Function( CXCursor C, ffi.Uint32 I); -typedef Native_clang_Cursor_getTemplateArgumentUnsignedValue = ffi.Uint64 +typedef DartClang_Cursor_getTemplateArgumentType = CXType Function( + CXCursor C, int I); +typedef NativeClang_Cursor_getTemplateArgumentValue = ffi.Int64 Function( + CXCursor C, ffi.Uint32 I); +typedef DartClang_Cursor_getTemplateArgumentValue = int Function( + CXCursor C, int I); +typedef NativeClang_Cursor_getTemplateArgumentUnsignedValue = ffi.Uint64 Function(CXCursor C, ffi.Uint32 I); -typedef Native_clang_equalTypes = ffi.Uint32 Function(CXType A, CXType B); -typedef Native_clang_getCanonicalType = CXType Function(CXType T); -typedef Native_clang_isConstQualifiedType = ffi.Uint32 Function(CXType T); -typedef Native_clang_Cursor_isMacroFunctionLike = ffi.Uint32 Function( +typedef DartClang_Cursor_getTemplateArgumentUnsignedValue = int Function( + CXCursor C, int I); +typedef NativeClang_equalTypes = ffi.Uint32 Function(CXType A, CXType B); +typedef DartClang_equalTypes = int Function(CXType A, CXType B); +typedef NativeClang_getCanonicalType = CXType Function(CXType T); +typedef DartClang_getCanonicalType = CXType Function(CXType T); +typedef NativeClang_isConstQualifiedType = ffi.Uint32 Function(CXType T); +typedef DartClang_isConstQualifiedType = int Function(CXType T); +typedef NativeClang_Cursor_isMacroFunctionLike = ffi.Uint32 Function( CXCursor C); -typedef Native_clang_Cursor_isMacroBuiltin = ffi.Uint32 Function(CXCursor C); -typedef Native_clang_Cursor_isFunctionInlined = ffi.Uint32 Function(CXCursor C); -typedef Native_clang_isVolatileQualifiedType = ffi.Uint32 Function(CXType T); -typedef Native_clang_isRestrictQualifiedType = ffi.Uint32 Function(CXType T); -typedef Native_clang_getAddressSpace = ffi.Uint32 Function(CXType T); -typedef Native_clang_getTypedefName = CXString Function(CXType CT); -typedef Native_clang_getPointeeType = CXType Function(CXType T); -typedef Native_clang_getTypeDeclaration = CXCursor Function(CXType T); -typedef Native_clang_getDeclObjCTypeEncoding = CXString Function(CXCursor C); -typedef Native_clang_Type_getObjCEncoding = CXString Function(CXType type); -typedef Native_clang_getTypeKindSpelling = CXString Function(ffi.Int32 K); -typedef Native_clang_getFunctionTypeCallingConv = ffi.Int32 Function(CXType T); +typedef DartClang_Cursor_isMacroFunctionLike = int Function(CXCursor C); +typedef NativeClang_Cursor_isMacroBuiltin = ffi.Uint32 Function(CXCursor C); +typedef DartClang_Cursor_isMacroBuiltin = int Function(CXCursor C); +typedef NativeClang_Cursor_isFunctionInlined = ffi.Uint32 Function(CXCursor C); +typedef DartClang_Cursor_isFunctionInlined = int Function(CXCursor C); +typedef NativeClang_isVolatileQualifiedType = ffi.Uint32 Function(CXType T); +typedef DartClang_isVolatileQualifiedType = int Function(CXType T); +typedef NativeClang_isRestrictQualifiedType = ffi.Uint32 Function(CXType T); +typedef DartClang_isRestrictQualifiedType = int Function(CXType T); +typedef NativeClang_getAddressSpace = ffi.Uint32 Function(CXType T); +typedef DartClang_getAddressSpace = int Function(CXType T); +typedef NativeClang_getTypedefName = CXString Function(CXType CT); +typedef DartClang_getTypedefName = CXString Function(CXType CT); +typedef NativeClang_getPointeeType = CXType Function(CXType T); +typedef DartClang_getPointeeType = CXType Function(CXType T); +typedef NativeClang_getTypeDeclaration = CXCursor Function(CXType T); +typedef DartClang_getTypeDeclaration = CXCursor Function(CXType T); +typedef NativeClang_getDeclObjCTypeEncoding = CXString Function(CXCursor C); +typedef DartClang_getDeclObjCTypeEncoding = CXString Function(CXCursor C); +typedef NativeClang_Type_getObjCEncoding = CXString Function(CXType type); +typedef DartClang_Type_getObjCEncoding = CXString Function(CXType type); +typedef NativeClang_getTypeKindSpelling = CXString Function(ffi.Int32 K); +typedef DartClang_getTypeKindSpelling = CXString Function(int K); /// Describes the calling convention of a function type abstract class CXCallingConv { @@ -9454,32 +9576,52 @@ abstract class CXCallingConv { static const int CXCallingConv_Unexposed = 200; } -typedef Native_clang_getResultType = CXType Function(CXType T); -typedef Native_clang_getExceptionSpecificationType = ffi.Int32 Function( - CXType T); -typedef Native_clang_getNumArgTypes = ffi.Int32 Function(CXType T); -typedef Native_clang_getArgType = CXType Function(CXType T, ffi.Uint32 i); -typedef Native_clang_Type_getObjCObjectBaseType = CXType Function(CXType T); -typedef Native_clang_Type_getNumObjCProtocolRefs = ffi.Uint32 Function( +typedef NativeClang_getFunctionTypeCallingConv = ffi.Int32 Function(CXType T); +typedef DartClang_getFunctionTypeCallingConv = int Function(CXType T); +typedef NativeClang_getResultType = CXType Function(CXType T); +typedef DartClang_getResultType = CXType Function(CXType T); +typedef NativeClang_getExceptionSpecificationType = ffi.Int32 Function( CXType T); -typedef Native_clang_Type_getObjCProtocolDecl = CXCursor Function( +typedef DartClang_getExceptionSpecificationType = int Function(CXType T); +typedef NativeClang_getNumArgTypes = ffi.Int32 Function(CXType T); +typedef DartClang_getNumArgTypes = int Function(CXType T); +typedef NativeClang_getArgType = CXType Function(CXType T, ffi.Uint32 i); +typedef DartClang_getArgType = CXType Function(CXType T, int i); +typedef NativeClang_Type_getObjCObjectBaseType = CXType Function(CXType T); +typedef DartClang_Type_getObjCObjectBaseType = CXType Function(CXType T); +typedef NativeClang_Type_getNumObjCProtocolRefs = ffi.Uint32 Function(CXType T); +typedef DartClang_Type_getNumObjCProtocolRefs = int Function(CXType T); +typedef NativeClang_Type_getObjCProtocolDecl = CXCursor Function( CXType T, ffi.Uint32 i); -typedef Native_clang_Type_getNumObjCTypeArgs = ffi.Uint32 Function(CXType T); -typedef Native_clang_Type_getObjCTypeArg = CXType Function( +typedef DartClang_Type_getObjCProtocolDecl = CXCursor Function(CXType T, int i); +typedef NativeClang_Type_getNumObjCTypeArgs = ffi.Uint32 Function(CXType T); +typedef DartClang_Type_getNumObjCTypeArgs = int Function(CXType T); +typedef NativeClang_Type_getObjCTypeArg = CXType Function( CXType T, ffi.Uint32 i); -typedef Native_clang_isFunctionTypeVariadic = ffi.Uint32 Function(CXType T); -typedef Native_clang_getCursorResultType = CXType Function(CXCursor C); -typedef Native_clang_getCursorExceptionSpecificationType = ffi.Int32 Function( +typedef DartClang_Type_getObjCTypeArg = CXType Function(CXType T, int i); +typedef NativeClang_isFunctionTypeVariadic = ffi.Uint32 Function(CXType T); +typedef DartClang_isFunctionTypeVariadic = int Function(CXType T); +typedef NativeClang_getCursorResultType = CXType Function(CXCursor C); +typedef DartClang_getCursorResultType = CXType Function(CXCursor C); +typedef NativeClang_getCursorExceptionSpecificationType = ffi.Int32 Function( CXCursor C); -typedef Native_clang_isPODType = ffi.Uint32 Function(CXType T); -typedef Native_clang_getElementType = CXType Function(CXType T); -typedef Native_clang_getNumElements = ffi.Int64 Function(CXType T); -typedef Native_clang_getArrayElementType = CXType Function(CXType T); -typedef Native_clang_getArraySize = ffi.Int64 Function(CXType T); -typedef Native_clang_Type_getNamedType = CXType Function(CXType T); -typedef Native_clang_Type_isTransparentTagTypedef = ffi.Uint32 Function( +typedef DartClang_getCursorExceptionSpecificationType = int Function( + CXCursor C); +typedef NativeClang_isPODType = ffi.Uint32 Function(CXType T); +typedef DartClang_isPODType = int Function(CXType T); +typedef NativeClang_getElementType = CXType Function(CXType T); +typedef DartClang_getElementType = CXType Function(CXType T); +typedef NativeClang_getNumElements = ffi.Int64 Function(CXType T); +typedef DartClang_getNumElements = int Function(CXType T); +typedef NativeClang_getArrayElementType = CXType Function(CXType T); +typedef DartClang_getArrayElementType = CXType Function(CXType T); +typedef NativeClang_getArraySize = ffi.Int64 Function(CXType T); +typedef DartClang_getArraySize = int Function(CXType T); +typedef NativeClang_Type_getNamedType = CXType Function(CXType T); +typedef DartClang_Type_getNamedType = CXType Function(CXType T); +typedef NativeClang_Type_isTransparentTagTypedef = ffi.Uint32 Function( CXType T); -typedef Native_clang_Type_getNullability = ffi.Int32 Function(CXType T); +typedef DartClang_Type_isTransparentTagTypedef = int Function(CXType T); abstract class CXTypeNullabilityKind { /// Values of this type can never be null. @@ -9498,22 +9640,35 @@ abstract class CXTypeNullabilityKind { static const int CXTypeNullability_Invalid = 3; } -typedef Native_clang_Type_getAlignOf = ffi.Int64 Function(CXType T); -typedef Native_clang_Type_getClassType = CXType Function(CXType T); -typedef Native_clang_Type_getSizeOf = ffi.Int64 Function(CXType T); -typedef Native_clang_Type_getOffsetOf = ffi.Int64 Function( +typedef NativeClang_Type_getNullability = ffi.Int32 Function(CXType T); +typedef DartClang_Type_getNullability = int Function(CXType T); +typedef NativeClang_Type_getAlignOf = ffi.Int64 Function(CXType T); +typedef DartClang_Type_getAlignOf = int Function(CXType T); +typedef NativeClang_Type_getClassType = CXType Function(CXType T); +typedef DartClang_Type_getClassType = CXType Function(CXType T); +typedef NativeClang_Type_getSizeOf = ffi.Int64 Function(CXType T); +typedef DartClang_Type_getSizeOf = int Function(CXType T); +typedef NativeClang_Type_getOffsetOf = ffi.Int64 Function( + CXType T, ffi.Pointer S); +typedef DartClang_Type_getOffsetOf = int Function( CXType T, ffi.Pointer S); -typedef Native_clang_Type_getModifiedType = CXType Function(CXType T); -typedef Native_clang_Cursor_getOffsetOfField = ffi.Int64 Function(CXCursor C); -typedef Native_clang_Cursor_isAnonymous = ffi.Uint32 Function(CXCursor C); -typedef Native_clang_Cursor_isAnonymousRecordDecl = ffi.Uint32 Function( +typedef NativeClang_Type_getModifiedType = CXType Function(CXType T); +typedef DartClang_Type_getModifiedType = CXType Function(CXType T); +typedef NativeClang_Cursor_getOffsetOfField = ffi.Int64 Function(CXCursor C); +typedef DartClang_Cursor_getOffsetOfField = int Function(CXCursor C); +typedef NativeClang_Cursor_isAnonymous = ffi.Uint32 Function(CXCursor C); +typedef DartClang_Cursor_isAnonymous = int Function(CXCursor C); +typedef NativeClang_Cursor_isAnonymousRecordDecl = ffi.Uint32 Function( CXCursor C); -typedef Native_clang_Cursor_isInlineNamespace = ffi.Uint32 Function(CXCursor C); -typedef Native_clang_Type_getNumTemplateArguments = ffi.Int32 Function( - CXType T); -typedef Native_clang_Type_getTemplateArgumentAsType = CXType Function( +typedef DartClang_Cursor_isAnonymousRecordDecl = int Function(CXCursor C); +typedef NativeClang_Cursor_isInlineNamespace = ffi.Uint32 Function(CXCursor C); +typedef DartClang_Cursor_isInlineNamespace = int Function(CXCursor C); +typedef NativeClang_Type_getNumTemplateArguments = ffi.Int32 Function(CXType T); +typedef DartClang_Type_getNumTemplateArguments = int Function(CXType T); +typedef NativeClang_Type_getTemplateArgumentAsType = CXType Function( CXType T, ffi.Uint32 i); -typedef Native_clang_Type_getCXXRefQualifier = ffi.Int32 Function(CXType T); +typedef DartClang_Type_getTemplateArgumentAsType = CXType Function( + CXType T, int i); abstract class CXRefQualifierKind { /// No ref-qualifier was provided. @@ -9526,9 +9681,12 @@ abstract class CXRefQualifierKind { static const int CXRefQualifier_RValue = 2; } -typedef Native_clang_Cursor_isBitField = ffi.Uint32 Function(CXCursor C); -typedef Native_clang_isVirtualBase = ffi.Uint32 Function(CXCursor arg0); -typedef Native_clang_getCXXAccessSpecifier = ffi.Int32 Function(CXCursor arg0); +typedef NativeClang_Type_getCXXRefQualifier = ffi.Int32 Function(CXType T); +typedef DartClang_Type_getCXXRefQualifier = int Function(CXType T); +typedef NativeClang_Cursor_isBitField = ffi.Uint32 Function(CXCursor C); +typedef DartClang_Cursor_isBitField = int Function(CXCursor C); +typedef NativeClang_isVirtualBase = ffi.Uint32 Function(CXCursor arg0); +typedef DartClang_isVirtualBase = int Function(CXCursor arg0); /// Represents the C++ access control level to a base class for a /// cursor with kind CX_CXXBaseSpecifier. @@ -9539,7 +9697,8 @@ abstract class CX_CXXAccessSpecifier { static const int CX_CXXPrivate = 3; } -typedef Native_clang_Cursor_getStorageClass = ffi.Int32 Function(CXCursor arg0); +typedef NativeClang_getCXXAccessSpecifier = ffi.Int32 Function(CXCursor arg0); +typedef DartClang_getCXXAccessSpecifier = int Function(CXCursor arg0); /// 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. @@ -9554,13 +9713,17 @@ abstract class CX_StorageClass { static const int CX_SC_Register = 7; } -typedef Native_clang_getNumOverloadedDecls = ffi.Uint32 Function( +typedef NativeClang_Cursor_getStorageClass = ffi.Int32 Function(CXCursor arg0); +typedef DartClang_Cursor_getStorageClass = int Function(CXCursor arg0); +typedef NativeClang_getNumOverloadedDecls = ffi.Uint32 Function( CXCursor cursor); -typedef Native_clang_getOverloadedDecl = CXCursor Function( +typedef DartClang_getNumOverloadedDecls = int Function(CXCursor cursor); +typedef NativeClang_getOverloadedDecl = CXCursor Function( CXCursor cursor, ffi.Uint32 index); -typedef Native_clang_getIBOutletCollectionType = CXType Function(CXCursor arg0); -typedef Native_clang_visitChildren = ffi.Uint32 Function( - CXCursor parent, CXCursorVisitor visitor, CXClientData client_data); +typedef DartClang_getOverloadedDecl = CXCursor Function( + CXCursor cursor, int index); +typedef NativeClang_getIBOutletCollectionType = CXType Function(CXCursor arg0); +typedef DartClang_getIBOutletCollectionType = CXType Function(CXCursor arg0); /// Visitor invoked for each cursor found by a traversal. /// @@ -9596,24 +9759,42 @@ abstract class CXChildVisitResult { /// Opaque pointer representing client data that will be passed through /// to various callbacks and visitors. typedef CXClientData = ffi.Pointer; -typedef Native_clang_getCursorUSR = CXString Function(CXCursor arg0); -typedef Native_clang_constructUSR_ObjCClass = CXString Function( +typedef NativeClang_visitChildren = ffi.Uint32 Function( + CXCursor parent, CXCursorVisitor visitor, CXClientData client_data); +typedef DartClang_visitChildren = int Function( + CXCursor parent, CXCursorVisitor visitor, CXClientData client_data); +typedef NativeClang_getCursorUSR = CXString Function(CXCursor arg0); +typedef DartClang_getCursorUSR = CXString Function(CXCursor arg0); +typedef NativeClang_constructUSR_ObjCClass = CXString Function( + ffi.Pointer class_name); +typedef DartClang_constructUSR_ObjCClass = CXString Function( ffi.Pointer class_name); -typedef Native_clang_constructUSR_ObjCCategory = CXString Function( +typedef NativeClang_constructUSR_ObjCCategory = CXString Function( + ffi.Pointer class_name, ffi.Pointer category_name); +typedef DartClang_constructUSR_ObjCCategory = CXString Function( ffi.Pointer class_name, ffi.Pointer category_name); -typedef Native_clang_constructUSR_ObjCProtocol = CXString Function( +typedef NativeClang_constructUSR_ObjCProtocol = CXString Function( ffi.Pointer protocol_name); -typedef Native_clang_constructUSR_ObjCIvar = CXString Function( +typedef DartClang_constructUSR_ObjCProtocol = CXString Function( + ffi.Pointer protocol_name); +typedef NativeClang_constructUSR_ObjCIvar = CXString Function( + ffi.Pointer name, CXString classUSR); +typedef DartClang_constructUSR_ObjCIvar = CXString Function( ffi.Pointer name, CXString classUSR); -typedef Native_clang_constructUSR_ObjCMethod = CXString Function( +typedef NativeClang_constructUSR_ObjCMethod = CXString Function( ffi.Pointer name, ffi.Uint32 isInstanceMethod, CXString classUSR); -typedef Native_clang_constructUSR_ObjCProperty = CXString Function( +typedef DartClang_constructUSR_ObjCMethod = CXString Function( + ffi.Pointer name, int isInstanceMethod, CXString classUSR); +typedef NativeClang_constructUSR_ObjCProperty = CXString Function( ffi.Pointer property, CXString classUSR); -typedef Native_clang_getCursorSpelling = CXString Function(CXCursor arg0); -typedef Native_clang_Cursor_getSpellingNameRange = CXSourceRange Function( +typedef DartClang_constructUSR_ObjCProperty = CXString Function( + ffi.Pointer property, CXString classUSR); +typedef NativeClang_getCursorSpelling = CXString Function(CXCursor arg0); +typedef DartClang_getCursorSpelling = CXString Function(CXCursor arg0); +typedef NativeClang_Cursor_getSpellingNameRange = CXSourceRange Function( CXCursor arg0, ffi.Uint32 pieceIndex, ffi.Uint32 options); -typedef Native_clang_PrintingPolicy_getProperty = ffi.Uint32 Function( - CXPrintingPolicy Policy, ffi.Int32 Property); +typedef DartClang_Cursor_getSpellingNameRange = CXSourceRange Function( + CXCursor arg0, int pieceIndex, int options); /// Opaque pointer representing a policy that controls pretty printing /// for \c clang_getCursorPrettyPrinted. @@ -9652,48 +9833,88 @@ abstract class CXPrintingPolicyProperty { static const int CXPrintingPolicy_LastProperty = 25; } -typedef Native_clang_PrintingPolicy_setProperty = ffi.Void Function( +typedef NativeClang_PrintingPolicy_getProperty = ffi.Uint32 Function( + CXPrintingPolicy Policy, ffi.Int32 Property); +typedef DartClang_PrintingPolicy_getProperty = int Function( + CXPrintingPolicy Policy, int Property); +typedef NativeClang_PrintingPolicy_setProperty = ffi.Void Function( CXPrintingPolicy Policy, ffi.Int32 Property, ffi.Uint32 Value); -typedef Native_clang_getCursorPrintingPolicy = CXPrintingPolicy Function( +typedef DartClang_PrintingPolicy_setProperty = void Function( + CXPrintingPolicy Policy, int Property, int Value); +typedef NativeClang_getCursorPrintingPolicy = CXPrintingPolicy Function( CXCursor arg0); -typedef Native_clang_PrintingPolicy_dispose = ffi.Void Function( +typedef DartClang_getCursorPrintingPolicy = CXPrintingPolicy Function( + CXCursor arg0); +typedef NativeClang_PrintingPolicy_dispose = ffi.Void Function( + CXPrintingPolicy Policy); +typedef DartClang_PrintingPolicy_dispose = void Function( CXPrintingPolicy Policy); -typedef Native_clang_getCursorPrettyPrinted = CXString Function( +typedef NativeClang_getCursorPrettyPrinted = CXString Function( CXCursor Cursor, CXPrintingPolicy Policy); -typedef Native_clang_getCursorDisplayName = CXString Function(CXCursor arg0); -typedef Native_clang_getCursorReferenced = CXCursor Function(CXCursor arg0); -typedef Native_clang_getCursorDefinition = CXCursor Function(CXCursor arg0); -typedef Native_clang_isCursorDefinition = ffi.Uint32 Function(CXCursor arg0); -typedef Native_clang_getCanonicalCursor = CXCursor Function(CXCursor arg0); -typedef Native_clang_Cursor_getObjCSelectorIndex = ffi.Int32 Function( +typedef DartClang_getCursorPrettyPrinted = CXString Function( + CXCursor Cursor, CXPrintingPolicy Policy); +typedef NativeClang_getCursorDisplayName = CXString Function(CXCursor arg0); +typedef DartClang_getCursorDisplayName = CXString Function(CXCursor arg0); +typedef NativeClang_getCursorReferenced = CXCursor Function(CXCursor arg0); +typedef DartClang_getCursorReferenced = CXCursor Function(CXCursor arg0); +typedef NativeClang_getCursorDefinition = CXCursor Function(CXCursor arg0); +typedef DartClang_getCursorDefinition = CXCursor Function(CXCursor arg0); +typedef NativeClang_isCursorDefinition = ffi.Uint32 Function(CXCursor arg0); +typedef DartClang_isCursorDefinition = int Function(CXCursor arg0); +typedef NativeClang_getCanonicalCursor = CXCursor Function(CXCursor arg0); +typedef DartClang_getCanonicalCursor = CXCursor Function(CXCursor arg0); +typedef NativeClang_Cursor_getObjCSelectorIndex = ffi.Int32 Function( CXCursor arg0); -typedef Native_clang_Cursor_isDynamicCall = ffi.Int32 Function(CXCursor C); -typedef Native_clang_Cursor_getReceiverType = CXType Function(CXCursor C); -typedef Native_clang_Cursor_getObjCPropertyAttributes = ffi.Uint32 Function( +typedef DartClang_Cursor_getObjCSelectorIndex = int Function(CXCursor arg0); +typedef NativeClang_Cursor_isDynamicCall = ffi.Int32 Function(CXCursor C); +typedef DartClang_Cursor_isDynamicCall = int Function(CXCursor C); +typedef NativeClang_Cursor_getReceiverType = CXType Function(CXCursor C); +typedef DartClang_Cursor_getReceiverType = CXType Function(CXCursor C); +typedef NativeClang_Cursor_getObjCPropertyAttributes = ffi.Uint32 Function( CXCursor C, ffi.Uint32 reserved); -typedef Native_clang_Cursor_getObjCPropertyGetterName = CXString Function( +typedef DartClang_Cursor_getObjCPropertyAttributes = int Function( + CXCursor C, int reserved); +typedef NativeClang_Cursor_getObjCPropertyGetterName = CXString Function( + CXCursor C); +typedef DartClang_Cursor_getObjCPropertyGetterName = CXString Function( CXCursor C); -typedef Native_clang_Cursor_getObjCPropertySetterName = CXString Function( +typedef NativeClang_Cursor_getObjCPropertySetterName = CXString Function( CXCursor C); -typedef Native_clang_Cursor_getObjCDeclQualifiers = ffi.Uint32 Function( +typedef DartClang_Cursor_getObjCPropertySetterName = CXString Function( CXCursor C); -typedef Native_clang_Cursor_isObjCOptional = ffi.Uint32 Function(CXCursor C); -typedef Native_clang_Cursor_isVariadic = ffi.Uint32 Function(CXCursor C); -typedef Native_clang_Cursor_isExternalSymbol = ffi.Uint32 Function( +typedef NativeClang_Cursor_getObjCDeclQualifiers = ffi.Uint32 Function( + CXCursor C); +typedef DartClang_Cursor_getObjCDeclQualifiers = int Function(CXCursor C); +typedef NativeClang_Cursor_isObjCOptional = ffi.Uint32 Function(CXCursor C); +typedef DartClang_Cursor_isObjCOptional = int Function(CXCursor C); +typedef NativeClang_Cursor_isVariadic = ffi.Uint32 Function(CXCursor C); +typedef DartClang_Cursor_isVariadic = int Function(CXCursor C); +typedef NativeClang_Cursor_isExternalSymbol = ffi.Uint32 Function( CXCursor C, ffi.Pointer language, ffi.Pointer definedIn, ffi.Pointer isGenerated); -typedef Native_clang_Cursor_getCommentRange = CXSourceRange Function( - CXCursor C); -typedef Native_clang_Cursor_getRawCommentText = CXString Function(CXCursor C); -typedef Native_clang_Cursor_getBriefCommentText = CXString Function(CXCursor C); -typedef Native_clang_Cursor_getMangling = CXString Function(CXCursor arg0); -typedef Native_clang_Cursor_getCXXManglings = ffi.Pointer Function( +typedef DartClang_Cursor_isExternalSymbol = int Function( + CXCursor C, + ffi.Pointer language, + ffi.Pointer definedIn, + ffi.Pointer isGenerated); +typedef NativeClang_Cursor_getCommentRange = CXSourceRange Function(CXCursor C); +typedef DartClang_Cursor_getCommentRange = CXSourceRange Function(CXCursor C); +typedef NativeClang_Cursor_getRawCommentText = CXString Function(CXCursor C); +typedef DartClang_Cursor_getRawCommentText = CXString Function(CXCursor C); +typedef NativeClang_Cursor_getBriefCommentText = CXString Function(CXCursor C); +typedef DartClang_Cursor_getBriefCommentText = CXString Function(CXCursor C); +typedef NativeClang_Cursor_getMangling = CXString Function(CXCursor arg0); +typedef DartClang_Cursor_getMangling = CXString Function(CXCursor arg0); +typedef NativeClang_Cursor_getCXXManglings = ffi.Pointer Function( + CXCursor arg0); +typedef DartClang_Cursor_getCXXManglings = ffi.Pointer Function( + CXCursor arg0); +typedef NativeClang_Cursor_getObjCManglings = ffi.Pointer Function( + CXCursor arg0); +typedef DartClang_Cursor_getObjCManglings = ffi.Pointer Function( CXCursor arg0); -typedef Native_clang_Cursor_getObjCManglings = ffi.Pointer - Function(CXCursor arg0); -typedef Native_clang_Cursor_getModule = CXModule Function(CXCursor C); /// \defgroup CINDEX_MODULE Module introspection /// @@ -9701,38 +9922,69 @@ typedef Native_clang_Cursor_getModule = CXModule Function(CXCursor C); /// /// @{ typedef CXModule = ffi.Pointer; -typedef Native_clang_getModuleForFile = CXModule Function( +typedef NativeClang_Cursor_getModule = CXModule Function(CXCursor C); +typedef DartClang_Cursor_getModule = CXModule Function(CXCursor C); +typedef NativeClang_getModuleForFile = CXModule Function( + CXTranslationUnit arg0, CXFile arg1); +typedef DartClang_getModuleForFile = CXModule Function( CXTranslationUnit arg0, CXFile arg1); -typedef Native_clang_Module_getASTFile = CXFile Function(CXModule Module); -typedef Native_clang_Module_getParent = CXModule Function(CXModule Module); -typedef Native_clang_Module_getName = CXString Function(CXModule Module); -typedef Native_clang_Module_getFullName = CXString Function(CXModule Module); -typedef Native_clang_Module_isSystem = ffi.Int32 Function(CXModule Module); -typedef Native_clang_Module_getNumTopLevelHeaders = ffi.Uint32 Function( +typedef NativeClang_Module_getASTFile = CXFile Function(CXModule Module); +typedef DartClang_Module_getASTFile = CXFile Function(CXModule Module); +typedef NativeClang_Module_getParent = CXModule Function(CXModule Module); +typedef DartClang_Module_getParent = CXModule Function(CXModule Module); +typedef NativeClang_Module_getName = CXString Function(CXModule Module); +typedef DartClang_Module_getName = CXString Function(CXModule Module); +typedef NativeClang_Module_getFullName = CXString Function(CXModule Module); +typedef DartClang_Module_getFullName = CXString Function(CXModule Module); +typedef NativeClang_Module_isSystem = ffi.Int32 Function(CXModule Module); +typedef DartClang_Module_isSystem = int Function(CXModule Module); +typedef NativeClang_Module_getNumTopLevelHeaders = ffi.Uint32 Function( CXTranslationUnit arg0, CXModule Module); -typedef Native_clang_Module_getTopLevelHeader = CXFile Function( +typedef DartClang_Module_getNumTopLevelHeaders = int Function( + CXTranslationUnit arg0, CXModule Module); +typedef NativeClang_Module_getTopLevelHeader = CXFile Function( CXTranslationUnit arg0, CXModule Module, ffi.Uint32 Index); -typedef Native_clang_CXXConstructor_isConvertingConstructor = ffi.Uint32 +typedef DartClang_Module_getTopLevelHeader = CXFile Function( + CXTranslationUnit arg0, CXModule Module, int Index); +typedef NativeClang_CXXConstructor_isConvertingConstructor = ffi.Uint32 Function(CXCursor C); -typedef Native_clang_CXXConstructor_isCopyConstructor = ffi.Uint32 Function( +typedef DartClang_CXXConstructor_isConvertingConstructor = int Function( + CXCursor C); +typedef NativeClang_CXXConstructor_isCopyConstructor = ffi.Uint32 Function( CXCursor C); -typedef Native_clang_CXXConstructor_isDefaultConstructor = ffi.Uint32 Function( +typedef DartClang_CXXConstructor_isCopyConstructor = int Function(CXCursor C); +typedef NativeClang_CXXConstructor_isDefaultConstructor = ffi.Uint32 Function( CXCursor C); -typedef Native_clang_CXXConstructor_isMoveConstructor = ffi.Uint32 Function( +typedef DartClang_CXXConstructor_isDefaultConstructor = int Function( CXCursor C); -typedef Native_clang_CXXField_isMutable = ffi.Uint32 Function(CXCursor C); -typedef Native_clang_CXXMethod_isDefaulted = ffi.Uint32 Function(CXCursor C); -typedef Native_clang_CXXMethod_isPureVirtual = ffi.Uint32 Function(CXCursor C); -typedef Native_clang_CXXMethod_isStatic = ffi.Uint32 Function(CXCursor C); -typedef Native_clang_CXXMethod_isVirtual = ffi.Uint32 Function(CXCursor C); -typedef Native_clang_CXXRecord_isAbstract = ffi.Uint32 Function(CXCursor C); -typedef Native_clang_EnumDecl_isScoped = ffi.Uint32 Function(CXCursor C); -typedef Native_clang_CXXMethod_isConst = ffi.Uint32 Function(CXCursor C); -typedef Native_clang_getTemplateCursorKind = ffi.Int32 Function(CXCursor C); -typedef Native_clang_getSpecializedCursorTemplate = CXCursor Function( +typedef NativeClang_CXXConstructor_isMoveConstructor = ffi.Uint32 Function( CXCursor C); -typedef Native_clang_getCursorReferenceNameRange = CXSourceRange Function( +typedef DartClang_CXXConstructor_isMoveConstructor = int Function(CXCursor C); +typedef NativeClang_CXXField_isMutable = ffi.Uint32 Function(CXCursor C); +typedef DartClang_CXXField_isMutable = int Function(CXCursor C); +typedef NativeClang_CXXMethod_isDefaulted = ffi.Uint32 Function(CXCursor C); +typedef DartClang_CXXMethod_isDefaulted = int Function(CXCursor C); +typedef NativeClang_CXXMethod_isPureVirtual = ffi.Uint32 Function(CXCursor C); +typedef DartClang_CXXMethod_isPureVirtual = int Function(CXCursor C); +typedef NativeClang_CXXMethod_isStatic = ffi.Uint32 Function(CXCursor C); +typedef DartClang_CXXMethod_isStatic = int Function(CXCursor C); +typedef NativeClang_CXXMethod_isVirtual = ffi.Uint32 Function(CXCursor C); +typedef DartClang_CXXMethod_isVirtual = int Function(CXCursor C); +typedef NativeClang_CXXRecord_isAbstract = ffi.Uint32 Function(CXCursor C); +typedef DartClang_CXXRecord_isAbstract = int Function(CXCursor C); +typedef NativeClang_EnumDecl_isScoped = ffi.Uint32 Function(CXCursor C); +typedef DartClang_EnumDecl_isScoped = int Function(CXCursor C); +typedef NativeClang_CXXMethod_isConst = ffi.Uint32 Function(CXCursor C); +typedef DartClang_CXXMethod_isConst = int Function(CXCursor C); +typedef NativeClang_getTemplateCursorKind = ffi.Int32 Function(CXCursor C); +typedef DartClang_getTemplateCursorKind = int Function(CXCursor C); +typedef NativeClang_getSpecializedCursorTemplate = CXCursor Function( + CXCursor C); +typedef DartClang_getSpecializedCursorTemplate = CXCursor Function(CXCursor C); +typedef NativeClang_getCursorReferenceNameRange = CXSourceRange Function( CXCursor C, ffi.Uint32 NameFlags, ffi.Uint32 PieceIndex); +typedef DartClang_getCursorReferenceNameRange = CXSourceRange Function( + CXCursor C, int NameFlags, int PieceIndex); /// Describes a single preprocessing token. class CXToken extends ffi.Struct { @@ -9742,9 +9994,10 @@ class CXToken extends ffi.Struct { external ffi.Pointer ptr_data; } -typedef Native_clang_getToken = ffi.Pointer Function( +typedef NativeClang_getToken = ffi.Pointer Function( + CXTranslationUnit TU, CXSourceLocation Location); +typedef DartClang_getToken = ffi.Pointer Function( CXTranslationUnit TU, CXSourceLocation Location); -typedef Native_clang_getTokenKind = ffi.Int32 Function(CXToken arg0); /// Describes a kind of token. abstract class CXTokenKind { @@ -9764,26 +10017,44 @@ abstract class CXTokenKind { static const int CXToken_Comment = 4; } -typedef Native_clang_getTokenSpelling = CXString Function( +typedef NativeClang_getTokenKind = ffi.Int32 Function(CXToken arg0); +typedef DartClang_getTokenKind = int Function(CXToken arg0); +typedef NativeClang_getTokenSpelling = CXString Function( + CXTranslationUnit arg0, CXToken arg1); +typedef DartClang_getTokenSpelling = CXString Function( + CXTranslationUnit arg0, CXToken arg1); +typedef NativeClang_getTokenLocation = CXSourceLocation Function( + CXTranslationUnit arg0, CXToken arg1); +typedef DartClang_getTokenLocation = CXSourceLocation Function( CXTranslationUnit arg0, CXToken arg1); -typedef Native_clang_getTokenLocation = CXSourceLocation Function( +typedef NativeClang_getTokenExtent = CXSourceRange Function( CXTranslationUnit arg0, CXToken arg1); -typedef Native_clang_getTokenExtent = CXSourceRange Function( +typedef DartClang_getTokenExtent = CXSourceRange Function( CXTranslationUnit arg0, CXToken arg1); -typedef Native_clang_tokenize = ffi.Void Function( +typedef NativeClang_tokenize = ffi.Void Function( CXTranslationUnit TU, CXSourceRange Range, ffi.Pointer> Tokens, ffi.Pointer NumTokens); -typedef Native_clang_annotateTokens = ffi.Void Function( +typedef DartClang_tokenize = void Function( + CXTranslationUnit TU, + CXSourceRange Range, + ffi.Pointer> Tokens, + ffi.Pointer NumTokens); +typedef NativeClang_annotateTokens = ffi.Void Function( CXTranslationUnit TU, ffi.Pointer Tokens, ffi.Uint32 NumTokens, ffi.Pointer Cursors); -typedef Native_clang_disposeTokens = ffi.Void Function( +typedef DartClang_annotateTokens = void Function(CXTranslationUnit TU, + ffi.Pointer Tokens, int NumTokens, ffi.Pointer Cursors); +typedef NativeClang_disposeTokens = ffi.Void Function( CXTranslationUnit TU, ffi.Pointer Tokens, ffi.Uint32 NumTokens); -typedef Native_clang_getCursorKindSpelling = CXString Function(ffi.Int32 Kind); -typedef Native_clang_getDefinitionSpellingAndExtent = ffi.Void Function( +typedef DartClang_disposeTokens = void Function( + CXTranslationUnit TU, ffi.Pointer Tokens, int NumTokens); +typedef NativeClang_getCursorKindSpelling = CXString Function(ffi.Int32 Kind); +typedef DartClang_getCursorKindSpelling = CXString Function(int Kind); +typedef NativeClang_getDefinitionSpellingAndExtent = ffi.Void Function( CXCursor arg0, ffi.Pointer> startBuf, ffi.Pointer> endBuf, @@ -9791,12 +10062,26 @@ typedef Native_clang_getDefinitionSpellingAndExtent = ffi.Void Function( ffi.Pointer startColumn, ffi.Pointer endLine, ffi.Pointer endColumn); -typedef Native_clang_enableStackTraces = ffi.Void Function(); -typedef Native_clang_executeOnThread = ffi.Void Function( +typedef DartClang_getDefinitionSpellingAndExtent = void Function( + CXCursor arg0, + ffi.Pointer> startBuf, + ffi.Pointer> endBuf, + ffi.Pointer startLine, + ffi.Pointer startColumn, + ffi.Pointer endLine, + ffi.Pointer endColumn); +typedef NativeClang_enableStackTraces = ffi.Void Function(); +typedef DartClang_enableStackTraces = void Function(); +typedef NativeClang_executeOnThread = ffi.Void Function( ffi.Pointer)>> fn, ffi.Pointer user_data, ffi.Uint32 stack_size); +typedef DartClang_executeOnThread = void Function( + ffi.Pointer)>> + fn, + ffi.Pointer user_data, + int stack_size); /// A single result of code completion. class CXCompletionResult extends ffi.Struct { @@ -9828,8 +10113,6 @@ class CXCompletionResult extends ffi.Struct { /// with actual code,of a specific kind. See \c CXCompletionChunkKind for a /// description of the different kinds of chunks. typedef CXCompletionString = ffi.Pointer; -typedef Native_clang_getCompletionChunkKind = ffi.Int32 Function( - CXCompletionString completion_string, ffi.Uint32 chunk_number); /// Describes a single piece of text within a code-completion string. /// @@ -9978,25 +10261,49 @@ abstract class CXCompletionChunkKind { static const int CXCompletionChunk_VerticalSpace = 20; } -typedef Native_clang_getCompletionChunkText = CXString Function( +typedef NativeClang_getCompletionChunkKind = ffi.Int32 Function( CXCompletionString completion_string, ffi.Uint32 chunk_number); -typedef Native_clang_getCompletionChunkCompletionString = CXCompletionString +typedef DartClang_getCompletionChunkKind = int Function( + CXCompletionString completion_string, int chunk_number); +typedef NativeClang_getCompletionChunkText = CXString Function( + CXCompletionString completion_string, ffi.Uint32 chunk_number); +typedef DartClang_getCompletionChunkText = CXString Function( + CXCompletionString completion_string, int chunk_number); +typedef NativeClang_getCompletionChunkCompletionString = CXCompletionString Function(CXCompletionString completion_string, ffi.Uint32 chunk_number); -typedef Native_clang_getNumCompletionChunks = ffi.Uint32 Function( +typedef DartClang_getCompletionChunkCompletionString = CXCompletionString + Function(CXCompletionString completion_string, int chunk_number); +typedef NativeClang_getNumCompletionChunks = ffi.Uint32 Function( + CXCompletionString completion_string); +typedef DartClang_getNumCompletionChunks = int Function( + CXCompletionString completion_string); +typedef NativeClang_getCompletionPriority = ffi.Uint32 Function( + CXCompletionString completion_string); +typedef DartClang_getCompletionPriority = int Function( + CXCompletionString completion_string); +typedef NativeClang_getCompletionAvailability = ffi.Int32 Function( CXCompletionString completion_string); -typedef Native_clang_getCompletionPriority = ffi.Uint32 Function( +typedef DartClang_getCompletionAvailability = int Function( CXCompletionString completion_string); -typedef Native_clang_getCompletionAvailability = ffi.Int32 Function( +typedef NativeClang_getCompletionNumAnnotations = ffi.Uint32 Function( CXCompletionString completion_string); -typedef Native_clang_getCompletionNumAnnotations = ffi.Uint32 Function( +typedef DartClang_getCompletionNumAnnotations = int Function( CXCompletionString completion_string); -typedef Native_clang_getCompletionAnnotation = CXString Function( +typedef NativeClang_getCompletionAnnotation = CXString Function( CXCompletionString completion_string, ffi.Uint32 annotation_number); -typedef Native_clang_getCompletionParent = CXString Function( +typedef DartClang_getCompletionAnnotation = CXString Function( + CXCompletionString completion_string, int annotation_number); +typedef NativeClang_getCompletionParent = CXString Function( CXCompletionString completion_string, ffi.Pointer kind); -typedef Native_clang_getCompletionBriefComment = CXString Function( +typedef DartClang_getCompletionParent = CXString Function( + CXCompletionString completion_string, ffi.Pointer kind); +typedef NativeClang_getCompletionBriefComment = CXString Function( + CXCompletionString completion_string); +typedef DartClang_getCompletionBriefComment = CXString Function( CXCompletionString completion_string); -typedef Native_clang_getCursorCompletionString = CXCompletionString Function( +typedef NativeClang_getCursorCompletionString = CXCompletionString Function( + CXCursor cursor); +typedef DartClang_getCursorCompletionString = CXCompletionString Function( CXCursor cursor); /// Contains the results of code-completion. @@ -10014,15 +10321,23 @@ class CXCodeCompleteResults extends ffi.Struct { external int NumResults; } -typedef Native_clang_getCompletionNumFixIts = ffi.Uint32 Function( +typedef NativeClang_getCompletionNumFixIts = ffi.Uint32 Function( ffi.Pointer results, ffi.Uint32 completion_index); -typedef Native_clang_getCompletionFixIt = CXString Function( +typedef DartClang_getCompletionNumFixIts = int Function( + ffi.Pointer results, int completion_index); +typedef NativeClang_getCompletionFixIt = CXString Function( ffi.Pointer results, ffi.Uint32 completion_index, ffi.Uint32 fixit_index, ffi.Pointer replacement_range); -typedef Native_clang_defaultCodeCompleteOptions = ffi.Uint32 Function(); -typedef Native_clang_codeCompleteAt +typedef DartClang_getCompletionFixIt = CXString Function( + ffi.Pointer results, + int completion_index, + int fixit_index, + ffi.Pointer replacement_range); +typedef NativeClang_defaultCodeCompleteOptions = ffi.Uint32 Function(); +typedef DartClang_defaultCodeCompleteOptions = int Function(); +typedef NativeClang_codeCompleteAt = ffi.Pointer Function( CXTranslationUnit TU, ffi.Pointer complete_filename, @@ -10031,28 +10346,53 @@ typedef Native_clang_codeCompleteAt ffi.Pointer unsaved_files, ffi.Uint32 num_unsaved_files, ffi.Uint32 options); -typedef Native_clang_sortCodeCompletionResults = ffi.Void Function( +typedef DartClang_codeCompleteAt = ffi.Pointer Function( + CXTranslationUnit TU, + ffi.Pointer complete_filename, + int complete_line, + int complete_column, + ffi.Pointer unsaved_files, + int num_unsaved_files, + int options); +typedef NativeClang_sortCodeCompletionResults = ffi.Void Function( ffi.Pointer Results, ffi.Uint32 NumResults); -typedef Native_clang_disposeCodeCompleteResults = ffi.Void Function( +typedef DartClang_sortCodeCompletionResults = void Function( + ffi.Pointer Results, int NumResults); +typedef NativeClang_disposeCodeCompleteResults = ffi.Void Function( + ffi.Pointer Results); +typedef DartClang_disposeCodeCompleteResults = void Function( ffi.Pointer Results); -typedef Native_clang_codeCompleteGetNumDiagnostics = ffi.Uint32 Function( +typedef NativeClang_codeCompleteGetNumDiagnostics = ffi.Uint32 Function( ffi.Pointer Results); -typedef Native_clang_codeCompleteGetDiagnostic = CXDiagnostic Function( +typedef DartClang_codeCompleteGetNumDiagnostics = int Function( + ffi.Pointer Results); +typedef NativeClang_codeCompleteGetDiagnostic = CXDiagnostic Function( ffi.Pointer Results, ffi.Uint32 Index); -typedef Native_clang_codeCompleteGetContexts = ffi.Uint64 Function( +typedef DartClang_codeCompleteGetDiagnostic = CXDiagnostic Function( + ffi.Pointer Results, int Index); +typedef NativeClang_codeCompleteGetContexts = ffi.Uint64 Function( + ffi.Pointer Results); +typedef DartClang_codeCompleteGetContexts = int Function( ffi.Pointer Results); -typedef Native_clang_codeCompleteGetContainerKind = ffi.Int32 Function( +typedef NativeClang_codeCompleteGetContainerKind = ffi.Int32 Function( ffi.Pointer Results, ffi.Pointer IsIncomplete); -typedef Native_clang_codeCompleteGetContainerUSR = CXString Function( +typedef DartClang_codeCompleteGetContainerKind = int Function( + ffi.Pointer Results, + ffi.Pointer IsIncomplete); +typedef NativeClang_codeCompleteGetContainerUSR = CXString Function( + ffi.Pointer Results); +typedef DartClang_codeCompleteGetContainerUSR = CXString Function( ffi.Pointer Results); -typedef Native_clang_codeCompleteGetObjCSelector = CXString Function( +typedef NativeClang_codeCompleteGetObjCSelector = CXString Function( ffi.Pointer Results); -typedef Native_clang_getClangVersion = CXString Function(); -typedef Native_clang_toggleCrashRecovery = ffi.Void Function( +typedef DartClang_codeCompleteGetObjCSelector = CXString Function( + ffi.Pointer Results); +typedef NativeClang_getClangVersion = CXString Function(); +typedef DartClang_getClangVersion = CXString Function(); +typedef NativeClang_toggleCrashRecovery = ffi.Void Function( ffi.Uint32 isEnabled); -typedef Native_clang_getInclusions = ffi.Void Function( - CXTranslationUnit tu, CXInclusionVisitor visitor, CXClientData client_data); +typedef DartClang_toggleCrashRecovery = void Function(int isEnabled); /// Visitor invoked for each file in a translation unit /// (used with clang_getInclusions()). @@ -10067,11 +10407,15 @@ typedef CXInclusionVisitor = ffi.Pointer< ffi.NativeFunction< ffi.Void Function( CXFile, ffi.Pointer, ffi.Uint32, CXClientData)>>; -typedef Native_clang_Cursor_Evaluate = CXEvalResult Function(CXCursor C); +typedef NativeClang_getInclusions = ffi.Void Function( + CXTranslationUnit tu, CXInclusionVisitor visitor, CXClientData client_data); +typedef DartClang_getInclusions = void Function( + CXTranslationUnit tu, CXInclusionVisitor visitor, CXClientData client_data); /// Evaluation result of a cursor typedef CXEvalResult = ffi.Pointer; -typedef Native_clang_EvalResult_getKind = ffi.Int32 Function(CXEvalResult E); +typedef NativeClang_Cursor_Evaluate = CXEvalResult Function(CXCursor C); +typedef DartClang_Cursor_Evaluate = CXEvalResult Function(CXCursor C); abstract class CXEvalResultKind { static const int CXEval_Int = 1; @@ -10083,32 +10427,53 @@ abstract class CXEvalResultKind { static const int CXEval_UnExposed = 0; } -typedef Native_clang_EvalResult_getAsInt = ffi.Int32 Function(CXEvalResult E); -typedef Native_clang_EvalResult_getAsLongLong = ffi.Int64 Function( +typedef NativeClang_EvalResult_getKind = ffi.Int32 Function(CXEvalResult E); +typedef DartClang_EvalResult_getKind = int Function(CXEvalResult E); +typedef NativeClang_EvalResult_getAsInt = ffi.Int32 Function(CXEvalResult E); +typedef DartClang_EvalResult_getAsInt = int Function(CXEvalResult E); +typedef NativeClang_EvalResult_getAsLongLong = ffi.Int64 Function( CXEvalResult E); -typedef Native_clang_EvalResult_isUnsignedInt = ffi.Uint32 Function( +typedef DartClang_EvalResult_getAsLongLong = int Function(CXEvalResult E); +typedef NativeClang_EvalResult_isUnsignedInt = ffi.Uint32 Function( CXEvalResult E); -typedef Native_clang_EvalResult_getAsUnsigned = ffi.Uint64 Function( +typedef DartClang_EvalResult_isUnsignedInt = int Function(CXEvalResult E); +typedef NativeClang_EvalResult_getAsUnsigned = ffi.Uint64 Function( CXEvalResult E); -typedef Native_clang_EvalResult_getAsDouble = ffi.Double Function( +typedef DartClang_EvalResult_getAsUnsigned = int Function(CXEvalResult E); +typedef NativeClang_EvalResult_getAsDouble = ffi.Double Function( CXEvalResult E); -typedef Native_clang_EvalResult_getAsStr = ffi.Pointer Function( +typedef DartClang_EvalResult_getAsDouble = double Function(CXEvalResult E); +typedef NativeClang_EvalResult_getAsStr = ffi.Pointer Function( CXEvalResult E); -typedef Native_clang_EvalResult_dispose = ffi.Void Function(CXEvalResult E); -typedef Native_clang_getRemappings = CXRemapping Function( - ffi.Pointer path); +typedef DartClang_EvalResult_getAsStr = ffi.Pointer Function( + CXEvalResult E); +typedef NativeClang_EvalResult_dispose = ffi.Void Function(CXEvalResult E); +typedef DartClang_EvalResult_dispose = void Function(CXEvalResult E); /// A remapping of original source files and their translated files. typedef CXRemapping = ffi.Pointer; -typedef Native_clang_getRemappingsFromFileList = CXRemapping Function( +typedef NativeClang_getRemappings = CXRemapping Function( + ffi.Pointer path); +typedef DartClang_getRemappings = CXRemapping Function( + ffi.Pointer path); +typedef NativeClang_getRemappingsFromFileList = CXRemapping Function( ffi.Pointer> filePaths, ffi.Uint32 numFiles); -typedef Native_clang_remap_getNumFiles = ffi.Uint32 Function(CXRemapping arg0); -typedef Native_clang_remap_getFilenames = ffi.Void Function( +typedef DartClang_getRemappingsFromFileList = CXRemapping Function( + ffi.Pointer> filePaths, int numFiles); +typedef NativeClang_remap_getNumFiles = ffi.Uint32 Function(CXRemapping arg0); +typedef DartClang_remap_getNumFiles = int Function(CXRemapping arg0); +typedef NativeClang_remap_getFilenames = ffi.Void Function( CXRemapping arg0, ffi.Uint32 index, ffi.Pointer original, ffi.Pointer transformed); -typedef Native_clang_remap_dispose = ffi.Void Function(CXRemapping arg0); +typedef DartClang_remap_getFilenames = void Function( + CXRemapping arg0, + int index, + ffi.Pointer original, + ffi.Pointer transformed); +typedef NativeClang_remap_dispose = ffi.Void Function(CXRemapping arg0); +typedef DartClang_remap_dispose = void Function(CXRemapping arg0); class CXCursorAndRangeVisitor extends ffi.Struct { external ffi.Pointer context; @@ -10127,9 +10492,6 @@ abstract class CXVisitorResult { static const int CXVisit_Continue = 1; } -typedef Native_clang_findReferencesInFile = ffi.Int32 Function( - CXCursor cursor, CXFile file, CXCursorAndRangeVisitor visitor); - abstract class CXResult { /// Function returned successfully. static const int CXResult_Success = 0; @@ -10142,7 +10504,13 @@ abstract class CXResult { static const int CXResult_VisitBreak = 2; } -typedef Native_clang_findIncludesInFile = ffi.Int32 Function( +typedef NativeClang_findReferencesInFile = ffi.Int32 Function( + CXCursor cursor, CXFile file, CXCursorAndRangeVisitor visitor); +typedef DartClang_findReferencesInFile = int Function( + CXCursor cursor, CXFile file, CXCursorAndRangeVisitor visitor); +typedef NativeClang_findIncludesInFile = ffi.Int32 Function( + CXTranslationUnit TU, CXFile file, CXCursorAndRangeVisitor visitor); +typedef DartClang_findIncludesInFile = int Function( CXTranslationUnit TU, CXFile file, CXCursorAndRangeVisitor visitor); /// Source location passed to index callbacks. @@ -10472,64 +10840,81 @@ abstract class CXSymbolRole { static const int CXSymbolRole_Implicit = 256; } -typedef Native_clang_index_isEntityObjCContainerKind = ffi.Int32 Function( +typedef NativeClang_index_isEntityObjCContainerKind = ffi.Int32 Function( ffi.Int32 arg0); -typedef Native_clang_index_getObjCContainerDeclInfo +typedef DartClang_index_isEntityObjCContainerKind = int Function(int arg0); +typedef NativeClang_index_getObjCContainerDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0); +typedef DartClang_index_getObjCContainerDeclInfo = ffi.Pointer Function( ffi.Pointer arg0); -typedef Native_clang_index_getObjCInterfaceDeclInfo +typedef NativeClang_index_getObjCInterfaceDeclInfo = ffi.Pointer Function( ffi.Pointer arg0); -typedef Native_clang_index_getObjCCategoryDeclInfo +typedef DartClang_index_getObjCInterfaceDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0); +typedef NativeClang_index_getObjCCategoryDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0); +typedef DartClang_index_getObjCCategoryDeclInfo = ffi.Pointer Function( ffi.Pointer arg0); -typedef Native_clang_index_getObjCProtocolRefListInfo +typedef NativeClang_index_getObjCProtocolRefListInfo = ffi.Pointer Function( ffi.Pointer arg0); -typedef Native_clang_index_getObjCPropertyDeclInfo +typedef DartClang_index_getObjCProtocolRefListInfo + = ffi.Pointer Function( + ffi.Pointer arg0); +typedef NativeClang_index_getObjCPropertyDeclInfo = ffi.Pointer Function( ffi.Pointer arg0); -typedef Native_clang_index_getIBOutletCollectionAttrInfo +typedef DartClang_index_getObjCPropertyDeclInfo + = ffi.Pointer Function( + ffi.Pointer arg0); +typedef NativeClang_index_getIBOutletCollectionAttrInfo + = ffi.Pointer Function( + ffi.Pointer arg0); +typedef DartClang_index_getIBOutletCollectionAttrInfo = ffi.Pointer Function( ffi.Pointer arg0); -typedef Native_clang_index_getCXXClassDeclInfo +typedef NativeClang_index_getCXXClassDeclInfo = ffi.Pointer Function( ffi.Pointer arg0); -typedef Native_clang_index_getClientContainer = CXIdxClientContainer Function( - ffi.Pointer arg0); +typedef DartClang_index_getCXXClassDeclInfo = ffi.Pointer + Function(ffi.Pointer arg0); /// The client's data object that is associated with a semantic container /// of entities. typedef CXIdxClientContainer = ffi.Pointer; -typedef Native_clang_index_setClientContainer = ffi.Void Function( +typedef NativeClang_index_getClientContainer = CXIdxClientContainer Function( + ffi.Pointer arg0); +typedef DartClang_index_getClientContainer = CXIdxClientContainer Function( + ffi.Pointer arg0); +typedef NativeClang_index_setClientContainer = ffi.Void Function( + ffi.Pointer arg0, CXIdxClientContainer arg1); +typedef DartClang_index_setClientContainer = void Function( ffi.Pointer arg0, CXIdxClientContainer arg1); -typedef Native_clang_index_getClientEntity = CXIdxClientEntity Function( - ffi.Pointer arg0); /// The client's data object that is associated with a semantic entity. typedef CXIdxClientEntity = ffi.Pointer; -typedef Native_clang_index_setClientEntity = ffi.Void Function( +typedef NativeClang_index_getClientEntity = CXIdxClientEntity Function( + ffi.Pointer arg0); +typedef DartClang_index_getClientEntity = CXIdxClientEntity Function( + ffi.Pointer arg0); +typedef NativeClang_index_setClientEntity = ffi.Void Function( + ffi.Pointer arg0, CXIdxClientEntity arg1); +typedef DartClang_index_setClientEntity = void Function( ffi.Pointer arg0, CXIdxClientEntity arg1); -typedef Native_clang_IndexAction_create = CXIndexAction Function(CXIndex CIdx); /// An indexing action/session, to be applied to one or multiple /// translation units. typedef CXIndexAction = ffi.Pointer; -typedef Native_clang_IndexAction_dispose = ffi.Void Function( - CXIndexAction arg0); -typedef Native_clang_indexSourceFile = ffi.Int32 Function( - CXIndexAction arg0, - CXClientData client_data, - ffi.Pointer index_callbacks, - ffi.Uint32 index_callbacks_size, - ffi.Uint32 index_options, - 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.Pointer out_TU, - ffi.Uint32 TU_options); +typedef NativeClang_IndexAction_create = CXIndexAction Function(CXIndex CIdx); +typedef DartClang_IndexAction_create = CXIndexAction Function(CXIndex CIdx); +typedef NativeClang_IndexAction_dispose = ffi.Void Function(CXIndexAction arg0); +typedef DartClang_IndexAction_dispose = void Function(CXIndexAction arg0); /// A group of callbacks used by #clang_indexSourceFile and /// #clang_indexTranslationUnit. @@ -10595,7 +10980,33 @@ typedef CXIdxClientFile = ffi.Pointer; /// The client's data object that is associated with an AST file (PCH /// or module). typedef CXIdxClientASTFile = ffi.Pointer; -typedef Native_clang_indexSourceFileFullArgv = ffi.Int32 Function( +typedef NativeClang_indexSourceFile = ffi.Int32 Function( + CXIndexAction arg0, + CXClientData client_data, + ffi.Pointer index_callbacks, + ffi.Uint32 index_callbacks_size, + ffi.Uint32 index_options, + 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.Pointer out_TU, + ffi.Uint32 TU_options); +typedef DartClang_indexSourceFile = int Function( + CXIndexAction arg0, + CXClientData 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); +typedef NativeClang_indexSourceFileFullArgv = ffi.Int32 Function( CXIndexAction arg0, CXClientData client_data, ffi.Pointer index_callbacks, @@ -10608,24 +11019,51 @@ typedef Native_clang_indexSourceFileFullArgv = ffi.Int32 Function( ffi.Uint32 num_unsaved_files, ffi.Pointer out_TU, ffi.Uint32 TU_options); -typedef Native_clang_indexTranslationUnit = ffi.Int32 Function( +typedef DartClang_indexSourceFileFullArgv = int Function( + CXIndexAction arg0, + CXClientData 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); +typedef NativeClang_indexTranslationUnit = ffi.Int32 Function( CXIndexAction arg0, CXClientData client_data, ffi.Pointer index_callbacks, ffi.Uint32 index_callbacks_size, ffi.Uint32 index_options, CXTranslationUnit arg5); -typedef Native_clang_indexLoc_getFileLocation = ffi.Void Function( +typedef DartClang_indexTranslationUnit = int Function( + CXIndexAction arg0, + CXClientData client_data, + ffi.Pointer index_callbacks, + int index_callbacks_size, + int index_options, + CXTranslationUnit arg5); +typedef NativeClang_indexLoc_getFileLocation = ffi.Void Function( CXIdxLoc loc, ffi.Pointer indexFile, ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset); -typedef Native_clang_indexLoc_getCXSourceLocation = CXSourceLocation Function( +typedef DartClang_indexLoc_getFileLocation = void Function( + CXIdxLoc loc, + ffi.Pointer indexFile, + ffi.Pointer file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); +typedef NativeClang_indexLoc_getCXSourceLocation = CXSourceLocation Function( + CXIdxLoc loc); +typedef DartClang_indexLoc_getCXSourceLocation = CXSourceLocation Function( CXIdxLoc loc); -typedef Native_clang_Type_visitFields = ffi.Uint32 Function( - CXType T, CXFieldVisitor visitor, CXClientData client_data); /// Visitor invoked for each field found by a traversal. /// @@ -10638,6 +11076,10 @@ typedef Native_clang_Type_visitFields = ffi.Uint32 Function( /// to direct \c clang_Type_visitFields. typedef CXFieldVisitor = ffi .Pointer>; +typedef NativeClang_Type_visitFields = ffi.Uint32 Function( + CXType T, CXFieldVisitor visitor, CXClientData client_data); +typedef DartClang_Type_visitFields = int Function( + CXType T, CXFieldVisitor visitor, CXClientData client_data); const int CINDEX_VERSION_MAJOR = 0; diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index 7e22ee0233..f10498b56d 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -39,7 +39,10 @@ ffigen: - 'clang_.*' # Can be a regexp, '.' matches any character. symbol-address: include: - - 'clang_.*' # Symbol Address and Typedefs for these functions will be exposed via addresses. + - 'clang_.*' # Symbol Address for these functions will be exposed via addresses. + expose-typedefs: + include: + - 'clang_.*' # Typedefs for Native and Dart type for these functions will be generated. structs: include: - 'CX.*' diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index fd679b81ba..e779c77c80 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -31,9 +31,10 @@ import 'writer.dart'; class Func extends LookUpBinding { final FunctionType functionType; final bool exposeSymbolAddress; + final bool exposeFunctionTypedefs; - /// Contains typealias for function type if [exposeSymbolAddress] is true. - Type? _exposedFunctionType; + /// Contains typealias for function type if [exposeFunctionTypedefs] is true. + Typealias? _exposedCFunctionTypealias, _exposedDartFunctionTypealias; /// [originalName] is looked up in dynamic library, if not /// provided, takes the value of [name]. @@ -45,6 +46,7 @@ class Func extends LookUpBinding { required Type returnType, List? parameters, this.exposeSymbolAddress = false, + this.exposeFunctionTypedefs = false, }) : functionType = FunctionType( returnType: returnType, parameters: parameters ?? const [], @@ -61,8 +63,19 @@ class Func extends LookUpBinding { } } - _exposedFunctionType = Type.typealias( - Typealias(name: 'Native_$name', type: Type.functionType(functionType))); + // Get function name with first letter in upper case. + final upperCaseName = name[0].toUpperCase() + name.substring(1); + if (exposeFunctionTypedefs) { + _exposedCFunctionTypealias = Typealias( + name: 'Native$upperCaseName', + type: Type.functionType(functionType), + ); + _exposedDartFunctionTypealias = Typealias( + name: 'Dart$upperCaseName', + type: Type.functionType(functionType), + useDartType: true, + ); + } } @override @@ -120,10 +133,12 @@ class Func extends LookUpBinding { } s.write('}\n'); - final cType = exposeSymbolAddress - ? _exposedFunctionType!.getCType(w) + final cType = exposeFunctionTypedefs + ? _exposedCFunctionTypealias!.name : functionType.getCType(w, writeArgumentNames: false); - final dartType = functionType.getDartType(w, writeArgumentNames: false); + final dartType = exposeFunctionTypedefs + ? _exposedDartFunctionTypealias!.name + : functionType.getDartType(w, writeArgumentNames: false); if (exposeSymbolAddress) { // Add to SymbolAddress in writer. @@ -148,10 +163,11 @@ class Func extends LookUpBinding { if (dependencies.contains(this)) return; dependencies.add(this); - if (exposeSymbolAddress) { - _exposedFunctionType!.addDependencies(dependencies); - } functionType.addDependencies(dependencies); + if (exposeFunctionTypedefs) { + _exposedCFunctionTypealias!.addDependencies(dependencies); + _exposedDartFunctionTypealias!.addDependencies(dependencies); + } } } diff --git a/pkgs/ffigen/lib/src/code_generator/typealias.dart b/pkgs/ffigen/lib/src/code_generator/typealias.dart index ada848efcd..7320957628 100644 --- a/pkgs/ffigen/lib/src/code_generator/typealias.dart +++ b/pkgs/ffigen/lib/src/code_generator/typealias.dart @@ -17,6 +17,7 @@ import 'writer.dart'; /// ``` class Typealias extends NoLookUpBinding { final Type type; + final bool _useDartType; Typealias({ String? usr, @@ -24,7 +25,13 @@ class Typealias extends NoLookUpBinding { String? dartDoc, required String name, required this.type, - }) : super( + + /// If true, the binding string uses Dart type instead of C type. + /// + /// E.g if C type is ffi.Void func(ffi.Int32), Dart type is void func(int). + bool useDartType = false, + }) : _useDartType = useDartType, + super( usr: usr, name: name, dartDoc: dartDoc, @@ -45,7 +52,8 @@ class Typealias extends NoLookUpBinding { if (dartDoc != null) { sb.write(makeDartDoc(dartDoc!)); } - sb.write('typedef $name = ${type.getCType(w)};\n'); + sb.write( + 'typedef $name = ${_useDartType ? type.getDartType(w) : type.getCType(w)};\n'); return BindingString( type: BindingStringType.typeDef, string: sb.toString()); } diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 57c0019efd..7d8c261b62 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -116,6 +116,9 @@ class Config { bool get useDartHandle => _useDartHandle; late bool _useDartHandle; + Includer get exposeFunctionTypedefs => _exposeFunctionTypedefs; + late Includer _exposeFunctionTypedefs; + Config._(); /// Create config from Yaml map. @@ -404,6 +407,15 @@ class Config { defaultValue: () => true, extractedResult: (dynamic result) => _useDartHandle = result as bool, ), + [strings.functions, strings.exposeFunctionTypedefs]: + Specification( + requirement: Requirement.no, + validator: exposeFunctionTypeValidator, + extractor: exposeFunctionTypeExtractor, + defaultValue: () => Includer.excludeByDefault(), + extractedResult: (dynamic result) => + _exposeFunctionTypedefs = result as Includer, + ), }; } } diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 52a5df9897..5acd29eaa8 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -567,6 +567,31 @@ bool declarationConfigValidator(List name, dynamic value) { return _result; } +Includer exposeFunctionTypeExtractor(dynamic value) => + _extractIncluderFromYaml(value); + +bool exposeFunctionTypeValidator(List name, dynamic value) { + var _result = true; + + if (!checkType(name, value)) { + _result = false; + } else { + final mp = value as YamlMap; + for (final key in mp.keys) { + if (key == strings.include || key == strings.exclude) { + if (!checkType([...name, key as String], value[key])) { + _result = false; + } + } else { + _logger.severe("Unknown subkey '$key' in '$name'."); + _result = false; + } + } + } + + return _result; +} + SupportedNativeType nativeSupportedType(int value, {bool signed = true}) { switch (value) { case 1: diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index a715f0e1b6..7a0bb20583 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -78,6 +78,8 @@ Func? parseFunctionDeclaration(clang_types.CXCursor cursor) { parameters: parameters, exposeSymbolAddress: config.functionDecl.shouldIncludeSymbolAddress(funcName), + exposeFunctionTypedefs: + config.exposeFunctionTypedefs.shouldInclude(funcName), ); bindingsIndex.addFuncToSeen(funcUsr, _stack.top.func!); } else if (bindingsIndex.isSeenFunc(funcUsr)) { diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 46bdb09963..84e767c9d5 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -60,6 +60,9 @@ const rename = 'rename'; const memberRename = 'member-rename'; const symbolAddress = 'symbol-address'; +// Nested under `functions` +const exposeFunctionTypedefs = 'expose-typedefs'; + const dependencyOnly = 'dependency-only'; // Values for `compoundDependencies`. const fullCompoundDependencies = 'full'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 93239f4906..3633464db1 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 4.0.0-dev.1 +version: 4.0.0-dev.2 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart b/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart index 52cad514a2..9520139796 100644 --- a/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart @@ -24,6 +24,7 @@ void main() { name: '_library', returnType: Type.nativeType(SupportedNativeType.Void), exposeSymbolAddress: true, + exposeFunctionTypedefs: true, ), Func( name: '_SymbolAddresses_1', diff --git a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart index 2f74f028fe..b45cdcd88d 100644 --- a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart +++ b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart @@ -25,16 +25,15 @@ class Bindings1 { } late final __libraryPtr = - _lookup>('_library'); - late final __library = __libraryPtr.asFunction(); + _lookup>('_library'); + late final __library = __libraryPtr.asFunction(); void _SymbolAddresses_1() { return __SymbolAddresses_1(); } late final __SymbolAddresses_1Ptr = - _lookup>( - '_SymbolAddresses_1'); + _lookup>('_SymbolAddresses_1'); late final __SymbolAddresses_1 = __SymbolAddresses_1Ptr.asFunction(); @@ -44,10 +43,10 @@ class Bindings1 { class _SymbolAddresses1 { final Bindings1 _library1; _SymbolAddresses1(this._library1); - ffi.Pointer> get _library => + ffi.Pointer> get _library => _library1.__libraryPtr; - ffi.Pointer> - get _SymbolAddresses_1 => _library1.__SymbolAddresses_1Ptr; + ffi.Pointer> get _SymbolAddresses_1 => + _library1.__SymbolAddresses_1Ptr; } class addresses extends ffi.Opaque {} @@ -56,5 +55,5 @@ class _SymbolAddresses extends ffi.Opaque {} abstract class Bindings {} -typedef Native__library = ffi.Void Function(); -typedef Native__SymbolAddresses_1 = ffi.Void Function(); +typedef Native_library = ffi.Void Function(); +typedef Dart_library = void Function(); diff --git a/pkgs/ffigen/test/example_tests/libclang_example_test.dart b/pkgs/ffigen/test/example_tests/libclang_example_test.dart index 7ba17c548b..1ca9600ec6 100644 --- a/pkgs/ffigen/test/example_tests/libclang_example_test.dart +++ b/pkgs/ffigen/test/example_tests/libclang_example_test.dart @@ -33,6 +33,9 @@ ${strings.functions}: ${strings.symbolAddress}: ${strings.include}: - 'clang_.*' + ${strings.exposeFunctionTypedefs}: + ${strings.include}: + - 'clang_.*' ${strings.structs}: ${strings.include}: - 'CX.*' diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart index 01c1fdea63..a5e3276b90 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart @@ -55,7 +55,10 @@ class NativeLibrary { ); } - late final _func3Ptr = _lookup>('func3'); + late final _func3Ptr = _lookup< + ffi.NativeFunction< + ffi.Double Function( + ffi.Float, ffi.Int8, ffi.Int64, ffi.Int32)>>('func3'); late final _func3 = _func3Ptr.asFunction(); @@ -71,7 +74,12 @@ class NativeLibrary { ); } - late final _func4Ptr = _lookup>('func4'); + late final _func4Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer>, + ffi.Double, + ffi.Pointer>>)>>('func4'); late final _func4 = _func4Ptr.asFunction< ffi.Pointer Function(ffi.Pointer>, double, ffi.Pointer>>)>(); @@ -100,15 +108,18 @@ class NativeLibrary { class _SymbolAddresses { final NativeLibrary _library; _SymbolAddresses(this._library); - ffi.Pointer> get func3 => _library._func3Ptr; - ffi.Pointer> get func4 => _library._func4Ptr; + ffi.Pointer< + ffi.NativeFunction< + ffi.Double Function(ffi.Float, ffi.Int8, ffi.Int64, ffi.Int32)>> + get func3 => _library._func3Ptr; + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer>, + ffi.Double, + ffi.Pointer>>)>> get func4 => + _library._func4Ptr; } -typedef Native_func3 = ffi.Double Function( - ffi.Float arg0, ffi.Int8 a, ffi.Int64 arg2, ffi.Int32 b); -typedef Native_func4 = ffi.Pointer Function( - ffi.Pointer> arg0, - ffi.Double arg1, - ffi.Pointer>> arg2); typedef shortHand = ffi.NativeFunction< ffi.Void Function(ffi.Pointer>)>; From 76464220cbfeea0bb1921318faf167211e846492 Mon Sep 17 00:00:00 2001 From: Michael Thomsen Date: Mon, 21 Jun 2021 10:10:21 +0200 Subject: [PATCH 091/276] [ffigen] Update library.dart dartfmt comment (#234) --- pkgs/ffigen/lib/src/code_generator/library.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index 0a6978a6f2..080f09909e 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -106,17 +106,17 @@ class Library { /// Generates [file] by generating C bindings. /// - /// If format is true(default), 'dartfmt -w $PATH' will be called to format the generated file. + /// If format is true(default), the formatter will be called to format the generated file. void generateFile(File file, {bool format = true}) { if (!file.existsSync()) file.createSync(recursive: true); file.writeAsStringSync(generate()); if (format) { - _dartFmt(file.path); + _dartFormat(file.path); } } - /// Formats a file using `dartfmt`. - void _dartFmt(String path) { + /// Formats a file using the Dart formatter. + void _dartFormat(String path) { final sdkPath = getSdkPath(); final result = Process.runSync( p.join(sdkPath, 'bin', 'dart'), ['format', path], From c7a25fb44e091d9575a83fc40a16583e71ac4035 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Wed, 8 Sep 2021 14:47:20 +0200 Subject: [PATCH 092/276] [ffigen] Bump version to 4.0.0 (#247) --- pkgs/ffigen/.github/workflows/test-package.yml | 4 ++-- pkgs/ffigen/CHANGELOG.md | 3 +++ pkgs/ffigen/pubspec.yaml | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 7cc704e646..3bd7e68c8f 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: [2.14.0-115.0.dev] # TODO: revert to 2.14 + sdk: [2.14.0] steps: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1.0 @@ -43,7 +43,7 @@ jobs: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1.0 with: - sdk: 2.14.0-115.0.dev # TODO: revert to 2.14. + sdk: 2.14.0 - name: Install dependencies run: dart pub get - name: Install libclang-10-dev diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 47b2a05f93..02b880ed0f 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 4.0.0 +- Release for Dart SDK `>=2.14`. + # 4.0.0-dev.2 - Added config key `functions -> expose-typedefs` to expose the typedef to Native and Dart type. diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 3633464db1..ae3782f9b2 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,12 +3,12 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 4.0.0-dev.2 +version: 4.0.0 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. environment: - sdk: '>=2.14.0-115.0.dev <3.0.0' + sdk: '>=2.14.0 <3.0.0' dependencies: ffi: ^1.0.0 From 94464ea2c148342746e7f6084edeed7f9d36d5c3 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 4 Oct 2021 13:26:24 +0530 Subject: [PATCH 093/276] [ffigen] Added support for marking functions as Leaf. (#252) * Add support for specifying leaf functions. * Remove folder debug_generated to prevent warning when publishing. * Add an FAQ for explaining generated logs. --- pkgs/ffigen/CHANGELOG.md | 3 ++ pkgs/ffigen/README.md | 47 +++++++++++++++++-- pkgs/ffigen/lib/src/code_generator/func.dart | 5 +- .../lib/src/config_provider/config.dart | 11 +++++ .../lib/src/config_provider/spec_utils.dart | 25 ++++++++++ .../sub_parsers/functiondecl_parser.dart | 1 + pkgs/ffigen/lib/src/strings.dart | 1 + pkgs/ffigen/pubspec.yaml | 2 +- .../code_generator_test.dart | 16 +++++++ .../_expected_function_bindings.dart | 14 ++++++ pkgs/ffigen/test/debug_generated/README.md | 3 -- .../_expected_functions_bindings.dart | 2 +- .../header_parser_tests/functions_test.dart | 3 ++ 13 files changed, 124 insertions(+), 9 deletions(-) delete mode 100644 pkgs/ffigen/test/debug_generated/README.md diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 02b880ed0f..9cdf028499 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 4.1.0 +- Add config key `functions -> leaf` for specifying `isLeaf:true` for functions. + # 4.0.0 - Release for Dart SDK `>=2.14`. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index e89ceb2e75..0cf4247cf1 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -288,6 +288,28 @@ functions: # If you only use exclude, then everything # not excluded is generated. - 'dispose' +``` + + + + + + @@ -593,6 +615,25 @@ that refers to them. ### Why are some typedefs not generated? The following typedefs are not generated - -- They are not referred to anywhere in the included declarations. -- They refer to a struct/union having the same name as itself. -- They refer to a boolean, enum, inline array, Handle or any unsupported type. + - They are not referred to anywhere in the included declarations. + - They refer to a struct/union having the same name as itself. + - They refer to a boolean, enum, inline array, Handle or any unsupported type. + +### What are these logs generated by ffigen and how to fix them? + +Ffigen can sometimes generate a lot of logs, especially when it's parsing a lot of code. + - `SEVERE` logs are something you *definitely need to address*. They can be + caused due to syntax errors, or more generally missing header files + (which need to be specified using `compiler-opts` in config) + - `WARNING` logs are something *you can ignore*, but should probably look into. + These are mostly indications of declarations ffigen couldn't generate due + to limitations of dart:ffi, private declarations (which can be resolved + by renaming them via ffigen config) or other minor issues in the config + file itself. + - Everything else can be safely ignored. It's purpose is to simply + let you know what ffigen is doing. + - The verbosity of the logs can be changed by adding a flag with + the log level. E.g - `dart run ffigen --verbose `. + Level options are - `[all, fine, info (default), warning, severe]`. + The `all` and `fine` will print a ton of logs are meant for debugging + purposes only. diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index e779c77c80..425ee47e54 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -32,6 +32,7 @@ class Func extends LookUpBinding { final FunctionType functionType; final bool exposeSymbolAddress; final bool exposeFunctionTypedefs; + final bool isLeaf; /// Contains typealias for function type if [exposeFunctionTypedefs] is true. Typealias? _exposedCFunctionTypealias, _exposedDartFunctionTypealias; @@ -47,6 +48,7 @@ class Func extends LookUpBinding { List? parameters, this.exposeSymbolAddress = false, this.exposeFunctionTypedefs = false, + this.isLeaf = false, }) : functionType = FunctionType( returnType: returnType, parameters: parameters ?? const [], @@ -152,8 +154,9 @@ class Func extends LookUpBinding { // Write function pointer. s.write( "late final $funcPointerName = ${w.lookupFuncIdentifier}<${w.ffiLibraryPrefix}.NativeFunction<$cType>>('$originalName');\n"); + final isLeafString = isLeaf ? 'isLeaf:true' : ''; s.write( - 'late final $funcVarName = $funcPointerName.asFunction<$dartType>();\n\n'); + 'late final $funcVarName = $funcPointerName.asFunction<$dartType>($isLeafString);\n\n'); return BindingString(type: BindingStringType.func, string: s.toString()); } diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 7d8c261b62..88d5d8d994 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -119,6 +119,9 @@ class Config { Includer get exposeFunctionTypedefs => _exposeFunctionTypedefs; late Includer _exposeFunctionTypedefs; + Includer get leafFunctions => _leafFunctions; + late Includer _leafFunctions; + Config._(); /// Create config from Yaml map. @@ -416,6 +419,14 @@ class Config { extractedResult: (dynamic result) => _exposeFunctionTypedefs = result as Includer, ), + [strings.functions, strings.leafFunctions]: Specification( + requirement: Requirement.no, + validator: leafFunctionValidator, + extractor: leafFunctionExtractor, + defaultValue: () => Includer.excludeByDefault(), + extractedResult: (dynamic result) => + _leafFunctions = result as Includer, + ), }; } } diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 5acd29eaa8..ad76cc9a75 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -592,6 +592,31 @@ bool exposeFunctionTypeValidator(List name, dynamic value) { return _result; } +Includer leafFunctionExtractor(dynamic value) => + _extractIncluderFromYaml(value); + +bool leafFunctionValidator(List name, dynamic value) { + var _result = true; + + if (!checkType(name, value)) { + _result = false; + } else { + final mp = value as YamlMap; + for (final key in mp.keys) { + if (key == strings.include || key == strings.exclude) { + if (!checkType([...name, key as String], value[key])) { + _result = false; + } + } else { + _logger.severe("Unknown subkey '$key' in '$name'."); + _result = false; + } + } + } + + return _result; +} + SupportedNativeType nativeSupportedType(int value, {bool signed = true}) { switch (value) { case 1: diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index 7a0bb20583..41d877ca3a 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -80,6 +80,7 @@ Func? parseFunctionDeclaration(clang_types.CXCursor cursor) { config.functionDecl.shouldIncludeSymbolAddress(funcName), exposeFunctionTypedefs: config.exposeFunctionTypedefs.shouldInclude(funcName), + isLeaf: config.leafFunctions.shouldInclude(funcName), ); bindingsIndex.addFuncToSeen(funcUsr, _stack.top.func!); } else if (bindingsIndex.isSeenFunc(funcUsr)) { diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 84e767c9d5..5ae3e35599 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -62,6 +62,7 @@ const symbolAddress = 'symbol-address'; // Nested under `functions` const exposeFunctionTypedefs = 'expose-typedefs'; +const leafFunctions = 'leaf'; const dependencyOnly = 'dependency-only'; // Values for `compoundDependencies`. diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index ae3782f9b2..f4e7135d0f 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 4.0.0 +version: 4.1.0 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart index 5d7f4c929a..34905a45d3 100644 --- a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart @@ -67,6 +67,22 @@ void main() { ), ), ), + Func( + isLeaf: true, + name: 'leafFunc', + dartDoc: 'A function with isLeaf: true', + parameters: [ + Parameter( + name: 'a', + type: Type.nativeType( + SupportedNativeType.Int32, + ), + ), + ], + returnType: Type.nativeType( + SupportedNativeType.Int32, + ), + ), ], ); diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart index 2a7dba579e..ada968c86e 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart @@ -60,4 +60,18 @@ class Bindings { late final _withPointerParam = _withPointerParamPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer>)>(); + + /// A function with isLeaf: true + int leafFunc( + int a, + ) { + return _leafFunc( + a, + ); + } + + late final _leafFuncPtr = + _lookup>('leafFunc'); + late final _leafFunc = + _leafFuncPtr.asFunction(isLeaf: true); } diff --git a/pkgs/ffigen/test/debug_generated/README.md b/pkgs/ffigen/test/debug_generated/README.md deleted file mode 100644 index f8fe72f638..0000000000 --- a/pkgs/ffigen/test/debug_generated/README.md +++ /dev/null @@ -1,3 +0,0 @@ -This folder is used in tests. -These files are deleted if tests are successful, but -will contain debug files from failed tests. diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart index a5e3276b90..d42ec32b62 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart @@ -27,7 +27,7 @@ class NativeLibrary { late final _func1Ptr = _lookup>('func1'); - late final _func1 = _func1Ptr.asFunction(); + late final _func1 = _func1Ptr.asFunction(isLeaf: true); int func2( int arg0, diff --git a/pkgs/ffigen/test/header_parser_tests/functions_test.dart b/pkgs/ffigen/test/header_parser_tests/functions_test.dart index 87a864274d..7b075628e3 100644 --- a/pkgs/ffigen/test/header_parser_tests/functions_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/functions_test.dart @@ -34,6 +34,9 @@ ${strings.functions}: ${strings.include}: - func3 - func4 + ${strings.leafFunctions}: + ${strings.include}: + - func1 ${strings.preamble}: | // ignore_for_file: camel_case_types From ba4d058ee32243a857ba9fec38c3de8e5fe72c0e Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Thu, 28 Oct 2021 11:13:49 +0530 Subject: [PATCH 094/276] [ffigen] Added fix for member name and type name collision in structs/unions. (#256) --- pkgs/ffigen/CHANGELOG.md | 4 ++ .../lib/src/code_generator/compound.dart | 6 +++ pkgs/ffigen/pubspec.yaml | 2 +- .../decl_type_name_collision.h | 22 +++++++++ .../decl_type_name_collision_test.dart | 47 +++++++++++++++++++ ...ted_decl_type_name_collision_bindings.dart | 31 ++++++++++++ 6 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 pkgs/ffigen/test/collision_tests/decl_type_name_collision.h create mode 100644 pkgs/ffigen/test/collision_tests/decl_type_name_collision_test.dart create mode 100644 pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_type_name_collision_bindings.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 9cdf028499..1c36c42f05 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 4.1.1 +- Added fix for errors due to name collision between member name +and type name used internally in structs/unions. + # 4.1.0 - Add config key `functions -> leaf` for specifying `isLeaf:true` for functions. diff --git a/pkgs/ffigen/lib/src/code_generator/compound.dart b/pkgs/ffigen/lib/src/code_generator/compound.dart index 887f523d99..8bdee9bb7e 100644 --- a/pkgs/ffigen/lib/src/code_generator/compound.dart +++ b/pkgs/ffigen/lib/src/code_generator/compound.dart @@ -115,6 +115,12 @@ abstract class Compound extends NoLookUpBinding { /// to have the same name as the class. final localUniqueNamer = UniqueNamer({enclosingClassName}); + /// Marking type names because dart doesn't allow class member to have the + /// same name as a type name used internally. + for (final m in members) { + localUniqueNamer.markUsed(m.type.getDartType(w)); + } + /// Write @Packed(X) annotation if struct is packed. if (isStruct && pack != null) { s.write('@${w.ffiLibraryPrefix}.Packed($pack)\n'); diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index f4e7135d0f..4f902abd16 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 4.1.0 +version: 4.1.1 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/collision_tests/decl_type_name_collision.h b/pkgs/ffigen/test/collision_tests/decl_type_name_collision.h new file mode 100644 index 0000000000..9d25f38992 --- /dev/null +++ b/pkgs/ffigen/test/collision_tests/decl_type_name_collision.h @@ -0,0 +1,22 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +struct A { + int a; +}; + +struct B { + int B; + int A; +}; + +struct C { + struct A A; + struct B B; +}; + +struct D { + struct B A; + struct A B; +}; diff --git a/pkgs/ffigen/test/collision_tests/decl_type_name_collision_test.dart b/pkgs/ffigen/test/collision_tests/decl_type_name_collision_test.dart new file mode 100644 index 0000000000..5bb8f8229e --- /dev/null +++ b/pkgs/ffigen/test/collision_tests/decl_type_name_collision_test.dart @@ -0,0 +1,47 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; + +import '../test_utils.dart'; + +late Library actual; +void main() { + group('decl_type_name_collision test', () { + setUpAll(() { + logWarnings(Level.SEVERE); + actual = parser.parse( + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Decl type name collision test' +${strings.output}: 'unused' +${strings.headers}: + ${strings.entryPoints}: + - 'test/collision_tests/decl_type_name_collision.h' +${strings.preamble}: | + // ignore_for_file: non_constant_identifier_names, + ''') as yaml.YamlMap), + ); + }); + + test('Expected bindings', () { + matchLibraryWithExpected(actual, [ + 'test', + 'debug_generated', + 'decl_type_name_collision_test_output.dart' + ], [ + 'test', + 'collision_tests', + 'expected_bindings', + '_expected_decl_type_name_collision_bindings.dart' + ]); + }); + }); +} diff --git a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_type_name_collision_bindings.dart b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_type_name_collision_bindings.dart new file mode 100644 index 0000000000..5dab4a23d4 --- /dev/null +++ b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_type_name_collision_bindings.dart @@ -0,0 +1,31 @@ +// ignore_for_file: non_constant_identifier_names, + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +class A extends ffi.Struct { + @ffi.Int32() + external int a; +} + +class B extends ffi.Struct { + @ffi.Int32() + external int B1; + + @ffi.Int32() + external int A; +} + +class C extends ffi.Struct { + external A A1; + + external B B1; +} + +class D extends ffi.Struct { + external B A1; + + external A B1; +} From b74c78a296cbe113cbe28dd4797359d7d9774251 Mon Sep 17 00:00:00 2001 From: Lukas Lihotzki Date: Fri, 12 Nov 2021 20:29:59 +0100 Subject: [PATCH 095/276] [ffigen] Exclude all on empty include list (#254) --- pkgs/ffigen/CHANGELOG.md | 3 +++ pkgs/ffigen/lib/src/config_provider/spec_utils.dart | 3 +++ pkgs/ffigen/pubspec.yaml | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 1c36c42f05..b5b025924e 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 4.1.2 +- Added fix for empty include list to exclude all + # 4.1.1 - Added fix for errors due to name collision between member name and type name used internally in structs/unions. diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index ad76cc9a75..22a6e1af54 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -397,6 +397,9 @@ Includer _extractIncluderFromYaml(dynamic yamlMap) { final include = (yamlMap[strings.include] as YamlList?)?.cast(); if (include != null) { + if (include.isEmpty) { + return Includer.excludeByDefault(); + } for (final str in include) { if (isFullDeclarationName(str)) { includeFull.add(str); diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 4f902abd16..34a5c3c919 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 4.1.1 +version: 4.1.2 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. From 68a2e76eda5a1d527132ab79298ae0e4017e4c2f Mon Sep 17 00:00:00 2001 From: Jonas Finnemann Jensen Date: Wed, 8 Dec 2021 18:29:50 +0100 Subject: [PATCH 096/276] [ffigen] Suggest using `dart pub add -d ffigen` (#259) --- pkgs/ffigen/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 0cf4247cf1..a4439bb3ed 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -41,7 +41,7 @@ class NativeLibrary { } ``` ## Using this package -- Add `ffigen` under `dev_dependencies` in your `pubspec.yaml`. +- Add `ffigen` under `dev_dependencies` in your `pubspec.yaml` (run `dart pub add -d ffigen`). - Install LLVM (see [Installing LLVM](#installing-llvm)). - Configurations must be provided in `pubspec.yaml` or in a custom YAML file (see [configurations](#configurations)). - Run the tool- `dart run ffigen`. From 0f708a7b0274c8b31b8858497be67c06d859f837 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Sat, 22 Jan 2022 16:06:46 +0530 Subject: [PATCH 097/276] [ffigen] Support for ABI-specific integers (#261) --- .../ffigen/.github/workflows/test-package.yml | 4 +- pkgs/ffigen/CHANGELOG.md | 5 + pkgs/ffigen/README.md | 67 +- pkgs/ffigen/analysis_options.yaml | 2 + .../c_json/cjson_generated_bindings.dart | 304 +- pkgs/ffigen/example/c_json/pubspec.yaml | 10 +- .../libclang-example/custom_import.dart | 63 + .../libclang-example/generated_bindings.dart | 900 +++--- .../example/libclang-example/pubspec.yaml | 43 +- .../example/simple/generated_bindings.dart | 23 +- pkgs/ffigen/example/simple/pubspec.yaml | 2 + pkgs/ffigen/lib/src/code_generator.dart | 1 + .../lib/src/code_generator/compound.dart | 2 - pkgs/ffigen/lib/src/code_generator/func.dart | 2 - .../lib/src/code_generator/imports.dart | 55 + .../lib/src/code_generator/library.dart | 11 + pkgs/ffigen/lib/src/code_generator/type.dart | 21 +- .../lib/src/code_generator/typealias.dart | 1 - .../ffigen/lib/src/code_generator/writer.dart | 36 +- .../lib/src/config_provider/config.dart | 91 +- .../lib/src/config_provider/spec_utils.dart | 136 +- .../clang_bindings/clang_bindings.dart | 128 +- pkgs/ffigen/lib/src/header_parser/parser.dart | 1 + .../sub_parsers/compounddecl_parser.dart | 3 +- .../sub_parsers/enumdecl_parser.dart | 3 +- .../sub_parsers/functiondecl_parser.dart | 1 - .../sub_parsers/macro_parser.dart | 5 +- .../sub_parsers/unnamed_enumdecl_parser.dart | 3 +- .../translation_unit_parser.dart | 3 +- .../type_extractor/cxtypekindmap.dart | 42 +- .../type_extractor/extractor.dart | 32 +- pkgs/ffigen/lib/src/header_parser/utils.dart | 13 +- pkgs/ffigen/lib/src/strings.dart | 26 +- pkgs/ffigen/pubspec.yaml | 6 +- .../code_generator_test.dart | 35 +- .../_expected_boolean_dartbool_bindings.dart | 1 + ...expected_boolean_no_dartbool_bindings.dart | 1 + .../_expected_constant_bindings.dart | 1 + .../_expected_enumclass_bindings.dart | 1 + .../_expected_function_bindings.dart | 1 + .../_expected_function_n_struct_bindings.dart | 1 + .../_expected_global_bindings.dart | 1 + ...internal_conflict_resolution_bindings.dart | 1 + .../_expected_packed_structs_bindings.dart | 1 + .../_expected_sort_bindings_bindings.dart | 1 + .../_expected_struct_bindings.dart | 1 + .../_expected_typealias_bindings.dart | 1 + .../_expected_unions_bindings.dart | 13 +- ...ecl_symbol_address_collision_bindings.dart | 1 + ...ted_decl_type_name_collision_bindings.dart | 7 +- .../reserved_keyword_collision_test.dart | 12 +- .../test/config_tests/compiler_opts_test.dart | 1 - .../config_tests/unknown_keys_warn_test.dart | 52 + .../example_tests/cjson_example_test.dart | 8 +- .../example_tests/libclang_example_test.dart | 25 +- .../_expected_comment_markup_bindings.dart | 3 +- .../_expected_dart_handle_bindings.dart | 1 + .../_expected_forward_decl_bindings.dart | 5 +- .../_expected_functions_bindings.dart | 17 + ...expected_native_func_typedef_bindings.dart | 1 + ...expected_opaque_dependencies_bindings.dart | 5 +- .../_expected_packed_structs_bindings.dart | 17 +- .../_expected_typedef_bindings.dart | 16 +- .../_expected_unions_bindings.dart | 3 +- .../function_n_struct_test.dart | 10 +- .../test/header_parser_tests/functions.h | 2 + .../nested_parsing_test.dart | 14 +- .../header_parser_tests/typedef_test.dart | 9 +- .../_expected_cjson_bindings.dart | 304 +- .../_expected_libclang_bindings.dart | 1101 ++++---- .../_expected_sqlite_bindings.dart | 2440 ++++++++--------- .../large_integration_tests/large_test.dart | 21 +- .../native_test/native_test_bindings.dart | 13 +- .../ffigen/test/rename_tests/rename_test.dart | 12 +- pkgs/ffigen/test/test_utils.dart | 7 + 75 files changed, 3390 insertions(+), 2822 deletions(-) create mode 100644 pkgs/ffigen/example/libclang-example/custom_import.dart create mode 100644 pkgs/ffigen/lib/src/code_generator/imports.dart create mode 100644 pkgs/ffigen/test/config_tests/unknown_keys_warn_test.dart diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 3bd7e68c8f..4070746a43 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: [2.14.0] + sdk: [2.16.0-124.0.dev] # TODO(#262) steps: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1.0 @@ -43,7 +43,7 @@ jobs: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1.0 with: - sdk: 2.14.0 + sdk: 2.16.0-124.0.dev # TODO(#262) - name: Install dependencies run: dart pub get - name: Install libclang-10-dev diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index b5b025924e..6c5a9e5901 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,8 @@ +# 5.0.0-dev.0 +- Added support for generating ABI Specific integers. +- Breaking: removed config keys - `size-map` and `typedef-map`. +- Added config keys - `library-imports` and `type-map`. + # 4.1.2 - Added fix for empty include list to exclude all diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index a4439bb3ed..32137b9d0d 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -22,6 +22,7 @@ ffigen: ``` Output (_generated_bindings.dart_). ```dart +import 'package:ffi/ffi.dart' as pkg_ffi; class NativeLibrary { final Pointer Function(String symbolName) _lookup; @@ -36,12 +37,13 @@ class NativeLibrary { return _sum(a, b); } - late final _sumPtr = _lookup>('sum'); + late final _sumPtr = _lookup>('sum'); late final _sum = _sum_ptr.asFunction(); } ``` ## Using this package - Add `ffigen` under `dev_dependencies` in your `pubspec.yaml` (run `dart pub add -d ffigen`). +- Add `package:ffi` under `dependencies` in your `pubspec.yaml` (run `dart pub add ffigen`). - Install LLVM (see [Installing LLVM](#installing-llvm)). - Configurations must be provided in `pubspec.yaml` or in a custom YAML file (see [configurations](#configurations)). - Run the tool- `dart run ffigen`. @@ -385,7 +387,7 @@ sort: true - - - + - - + diff --git a/pkgs/ffigen/analysis_options.yaml b/pkgs/ffigen/analysis_options.yaml index 002a2c49a0..2a3bc8cb73 100644 --- a/pkgs/ffigen/analysis_options.yaml +++ b/pkgs/ffigen/analysis_options.yaml @@ -5,6 +5,8 @@ include: package:lints/recommended.yaml analyzer: + exclude: + - 'test/**_expected*' strong-mode: implicit-casts: false implicit-dynamic: false diff --git a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart index a518d8a350..3f5d92ed9f 100644 --- a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart +++ b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart @@ -24,6 +24,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; /// Holds bindings to cJSON. class CJson { @@ -40,15 +41,15 @@ class CJson { lookup) : _lookup = lookup; - ffi.Pointer cJSON_Version() { + ffi.Pointer cJSON_Version() { return _cJSON_Version(); } late final _cJSON_VersionPtr = - _lookup Function()>>( + _lookup Function()>>( 'cJSON_Version'); late final _cJSON_Version = - _cJSON_VersionPtr.asFunction Function()>(); + _cJSON_VersionPtr.asFunction Function()>(); void cJSON_InitHooks( ffi.Pointer hooks, @@ -65,7 +66,7 @@ class CJson { _cJSON_InitHooksPtr.asFunction)>(); ffi.Pointer cJSON_Parse( - ffi.Pointer value, + ffi.Pointer value, ) { return _cJSON_Parse( value, @@ -74,13 +75,14 @@ class CJson { late final _cJSON_ParsePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('cJSON_Parse'); + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_Parse'); late final _cJSON_Parse = _cJSON_ParsePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_ParseWithOpts( - ffi.Pointer value, - ffi.Pointer> return_parse_end, + ffi.Pointer value, + ffi.Pointer> return_parse_end, int require_null_terminated, ) { return _cJSON_ParseWithOpts( @@ -93,14 +95,14 @@ class CJson { late final _cJSON_ParseWithOptsPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>, cJSON_bool)>>('cJSON_ParseWithOpts'); late final _cJSON_ParseWithOpts = _cJSON_ParseWithOptsPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer>, int)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer>, int)>(); - ffi.Pointer cJSON_Print( + ffi.Pointer cJSON_Print( ffi.Pointer item, ) { return _cJSON_Print( @@ -110,11 +112,12 @@ class CJson { late final _cJSON_PrintPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('cJSON_Print'); + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_Print'); late final _cJSON_Print = _cJSON_PrintPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); - ffi.Pointer cJSON_PrintUnformatted( + ffi.Pointer cJSON_PrintUnformatted( ffi.Pointer item, ) { return _cJSON_PrintUnformatted( @@ -124,12 +127,12 @@ class CJson { late final _cJSON_PrintUnformattedPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('cJSON_PrintUnformatted'); late final _cJSON_PrintUnformatted = _cJSON_PrintUnformattedPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); - ffi.Pointer cJSON_PrintBuffered( + ffi.Pointer cJSON_PrintBuffered( ffi.Pointer item, int prebuffer, int fmt, @@ -143,14 +146,14 @@ class CJson { late final _cJSON_PrintBufferedPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Int32, + ffi.Pointer Function(ffi.Pointer, pkg_ffi.Int, cJSON_bool)>>('cJSON_PrintBuffered'); late final _cJSON_PrintBuffered = _cJSON_PrintBufferedPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int)>(); + ffi.Pointer Function(ffi.Pointer, int, int)>(); int cJSON_PrintPreallocated( ffi.Pointer item, - ffi.Pointer buffer, + ffi.Pointer buffer, int length, int format, ) { @@ -164,10 +167,10 @@ class CJson { late final _cJSON_PrintPreallocatedPtr = _lookup< ffi.NativeFunction< - cJSON_bool Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, cJSON_bool)>>('cJSON_PrintPreallocated'); + cJSON_bool Function(ffi.Pointer, ffi.Pointer, + pkg_ffi.Int, cJSON_bool)>>('cJSON_PrintPreallocated'); late final _cJSON_PrintPreallocated = _cJSON_PrintPreallocatedPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int, int)>(); void cJSON_Delete( ffi.Pointer item, @@ -192,7 +195,7 @@ class CJson { } late final _cJSON_GetArraySizePtr = - _lookup)>>( + _lookup)>>( 'cJSON_GetArraySize'); late final _cJSON_GetArraySize = _cJSON_GetArraySizePtr.asFunction)>(); @@ -210,13 +213,13 @@ class CJson { late final _cJSON_GetArrayItemPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Int32)>>('cJSON_GetArrayItem'); + ffi.Pointer, pkg_ffi.Int)>>('cJSON_GetArrayItem'); late final _cJSON_GetArrayItem = _cJSON_GetArrayItemPtr .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_GetObjectItem( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_GetObjectItem( object, @@ -227,13 +230,14 @@ class CJson { late final _cJSON_GetObjectItemPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_GetObjectItem'); + ffi.Pointer)>>('cJSON_GetObjectItem'); late final _cJSON_GetObjectItem = _cJSON_GetObjectItemPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_GetObjectItemCaseSensitive( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_GetObjectItemCaseSensitive( object, @@ -244,15 +248,15 @@ class CJson { late final _cJSON_GetObjectItemCaseSensitivePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_GetObjectItemCaseSensitive'); + ffi.Pointer)>>('cJSON_GetObjectItemCaseSensitive'); late final _cJSON_GetObjectItemCaseSensitive = _cJSON_GetObjectItemCaseSensitivePtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); int cJSON_HasObjectItem( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_HasObjectItem( object, @@ -263,21 +267,21 @@ class CJson { late final _cJSON_HasObjectItemPtr = _lookup< ffi.NativeFunction< cJSON_bool Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_HasObjectItem'); - late final _cJSON_HasObjectItem = _cJSON_HasObjectItemPtr - .asFunction, ffi.Pointer)>(); + ffi.Pointer)>>('cJSON_HasObjectItem'); + late final _cJSON_HasObjectItem = _cJSON_HasObjectItemPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer cJSON_GetErrorPtr() { + ffi.Pointer cJSON_GetErrorPtr() { return _cJSON_GetErrorPtr(); } late final _cJSON_GetErrorPtrPtr = - _lookup Function()>>( + _lookup Function()>>( 'cJSON_GetErrorPtr'); late final _cJSON_GetErrorPtr = - _cJSON_GetErrorPtrPtr.asFunction Function()>(); + _cJSON_GetErrorPtrPtr.asFunction Function()>(); - ffi.Pointer cJSON_GetStringValue( + ffi.Pointer cJSON_GetStringValue( ffi.Pointer item, ) { return _cJSON_GetStringValue( @@ -287,10 +291,10 @@ class CJson { late final _cJSON_GetStringValuePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('cJSON_GetStringValue'); late final _cJSON_GetStringValue = _cJSON_GetStringValuePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); int cJSON_IsInvalid( ffi.Pointer item, @@ -491,7 +495,7 @@ class CJson { _cJSON_CreateNumberPtr.asFunction Function(double)>(); ffi.Pointer cJSON_CreateString( - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_CreateString( string, @@ -501,12 +505,12 @@ class CJson { late final _cJSON_CreateStringPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer)>>('cJSON_CreateString'); + ffi.Pointer)>>('cJSON_CreateString'); late final _cJSON_CreateString = _cJSON_CreateStringPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateRaw( - ffi.Pointer raw, + ffi.Pointer raw, ) { return _cJSON_CreateRaw( raw, @@ -516,9 +520,9 @@ class CJson { late final _cJSON_CreateRawPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer)>>('cJSON_CreateRaw'); + ffi.Pointer)>>('cJSON_CreateRaw'); late final _cJSON_CreateRaw = _cJSON_CreateRawPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateArray() { return _cJSON_CreateArray(); @@ -541,7 +545,7 @@ class CJson { _cJSON_CreateObjectPtr.asFunction Function()>(); ffi.Pointer cJSON_CreateStringReference( - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_CreateStringReference( string, @@ -551,9 +555,9 @@ class CJson { late final _cJSON_CreateStringReferencePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer)>>('cJSON_CreateStringReference'); + ffi.Pointer)>>('cJSON_CreateStringReference'); late final _cJSON_CreateStringReference = _cJSON_CreateStringReferencePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateObjectReference( ffi.Pointer child, @@ -584,7 +588,7 @@ class CJson { .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateIntArray( - ffi.Pointer numbers, + ffi.Pointer numbers, int count, ) { return _cJSON_CreateIntArray( @@ -596,9 +600,9 @@ class CJson { late final _cJSON_CreateIntArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Int32)>>('cJSON_CreateIntArray'); + ffi.Pointer, pkg_ffi.Int)>>('cJSON_CreateIntArray'); late final _cJSON_CreateIntArray = _cJSON_CreateIntArrayPtr - .asFunction Function(ffi.Pointer, int)>(); + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateFloatArray( ffi.Pointer numbers, @@ -613,7 +617,7 @@ class CJson { late final _cJSON_CreateFloatArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Int32)>>('cJSON_CreateFloatArray'); + ffi.Pointer, pkg_ffi.Int)>>('cJSON_CreateFloatArray'); late final _cJSON_CreateFloatArray = _cJSON_CreateFloatArrayPtr .asFunction Function(ffi.Pointer, int)>(); @@ -629,13 +633,13 @@ class CJson { late final _cJSON_CreateDoubleArrayPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int32)>>('cJSON_CreateDoubleArray'); + ffi.Pointer Function(ffi.Pointer, + pkg_ffi.Int)>>('cJSON_CreateDoubleArray'); late final _cJSON_CreateDoubleArray = _cJSON_CreateDoubleArrayPtr .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateStringArray( - ffi.Pointer> strings, + ffi.Pointer> strings, int count, ) { return _cJSON_CreateStringArray( @@ -646,10 +650,11 @@ class CJson { late final _cJSON_CreateStringArrayPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer>, - ffi.Int32)>>('cJSON_CreateStringArray'); + ffi.Pointer Function(ffi.Pointer>, + pkg_ffi.Int)>>('cJSON_CreateStringArray'); late final _cJSON_CreateStringArray = _cJSON_CreateStringArrayPtr.asFunction< - ffi.Pointer Function(ffi.Pointer>, int)>(); + ffi.Pointer Function( + ffi.Pointer>, int)>(); void cJSON_AddItemToArray( ffi.Pointer array, @@ -670,7 +675,7 @@ class CJson { void cJSON_AddItemToObject( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ffi.Pointer item, ) { return _cJSON_AddItemToObject( @@ -682,15 +687,15 @@ class CJson { late final _cJSON_AddItemToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemToObject'); late final _cJSON_AddItemToObject = _cJSON_AddItemToObjectPtr.asFunction< void Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_AddItemToObjectCS( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ffi.Pointer item, ) { return _cJSON_AddItemToObjectCS( @@ -702,11 +707,11 @@ class CJson { late final _cJSON_AddItemToObjectCSPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemToObjectCS'); late final _cJSON_AddItemToObjectCS = _cJSON_AddItemToObjectCSPtr.asFunction< void Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_AddItemReferenceToArray( ffi.Pointer array, @@ -727,7 +732,7 @@ class CJson { void cJSON_AddItemReferenceToObject( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ffi.Pointer item, ) { return _cJSON_AddItemReferenceToObject( @@ -739,12 +744,12 @@ class CJson { late final _cJSON_AddItemReferenceToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemReferenceToObject'); late final _cJSON_AddItemReferenceToObject = _cJSON_AddItemReferenceToObjectPtr.asFunction< - void Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); ffi.Pointer cJSON_DetachItemViaPointer( ffi.Pointer parent, @@ -778,7 +783,7 @@ class CJson { late final _cJSON_DetachItemFromArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Int32)>>('cJSON_DetachItemFromArray'); + ffi.Pointer, pkg_ffi.Int)>>('cJSON_DetachItemFromArray'); late final _cJSON_DetachItemFromArray = _cJSON_DetachItemFromArrayPtr .asFunction Function(ffi.Pointer, int)>(); @@ -793,14 +798,15 @@ class CJson { } late final _cJSON_DeleteItemFromArrayPtr = _lookup< - ffi.NativeFunction, ffi.Int32)>>( - 'cJSON_DeleteItemFromArray'); + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, pkg_ffi.Int)>>('cJSON_DeleteItemFromArray'); late final _cJSON_DeleteItemFromArray = _cJSON_DeleteItemFromArrayPtr .asFunction, int)>(); ffi.Pointer cJSON_DetachItemFromObject( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_DetachItemFromObject( object, @@ -811,15 +817,15 @@ class CJson { late final _cJSON_DetachItemFromObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_DetachItemFromObject'); + ffi.Pointer)>>('cJSON_DetachItemFromObject'); late final _cJSON_DetachItemFromObject = _cJSON_DetachItemFromObjectPtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_DetachItemFromObjectCaseSensitive( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_DetachItemFromObjectCaseSensitive( object, @@ -830,16 +836,16 @@ class CJson { late final _cJSON_DetachItemFromObjectCaseSensitivePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>( + ffi.Pointer, ffi.Pointer)>>( 'cJSON_DetachItemFromObjectCaseSensitive'); late final _cJSON_DetachItemFromObjectCaseSensitive = _cJSON_DetachItemFromObjectCaseSensitivePtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); void cJSON_DeleteItemFromObject( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_DeleteItemFromObject( object, @@ -850,13 +856,14 @@ class CJson { late final _cJSON_DeleteItemFromObjectPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_DeleteItemFromObject'); - late final _cJSON_DeleteItemFromObject = _cJSON_DeleteItemFromObjectPtr - .asFunction, ffi.Pointer)>(); + ffi.Pointer)>>('cJSON_DeleteItemFromObject'); + late final _cJSON_DeleteItemFromObject = + _cJSON_DeleteItemFromObjectPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); void cJSON_DeleteItemFromObjectCaseSensitive( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_DeleteItemFromObjectCaseSensitive( object, @@ -866,11 +873,12 @@ class CJson { late final _cJSON_DeleteItemFromObjectCaseSensitivePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer)>>( + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>( 'cJSON_DeleteItemFromObjectCaseSensitive'); late final _cJSON_DeleteItemFromObjectCaseSensitive = _cJSON_DeleteItemFromObjectCaseSensitivePtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer)>(); void cJSON_InsertItemInArray( ffi.Pointer array, @@ -886,7 +894,7 @@ class CJson { late final _cJSON_InsertItemInArrayPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Void Function(ffi.Pointer, pkg_ffi.Int, ffi.Pointer)>>('cJSON_InsertItemInArray'); late final _cJSON_InsertItemInArray = _cJSON_InsertItemInArrayPtr .asFunction, int, ffi.Pointer)>(); @@ -926,14 +934,14 @@ class CJson { late final _cJSON_ReplaceItemInArrayPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Void Function(ffi.Pointer, pkg_ffi.Int, ffi.Pointer)>>('cJSON_ReplaceItemInArray'); late final _cJSON_ReplaceItemInArray = _cJSON_ReplaceItemInArrayPtr .asFunction, int, ffi.Pointer)>(); void cJSON_ReplaceItemInObject( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ffi.Pointer newitem, ) { return _cJSON_ReplaceItemInObject( @@ -945,16 +953,16 @@ class CJson { late final _cJSON_ReplaceItemInObjectPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_ReplaceItemInObject'); late final _cJSON_ReplaceItemInObject = _cJSON_ReplaceItemInObjectPtr.asFunction< - void Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); void cJSON_ReplaceItemInObjectCaseSensitive( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ffi.Pointer newitem, ) { return _cJSON_ReplaceItemInObjectCaseSensitive( @@ -966,12 +974,12 @@ class CJson { late final _cJSON_ReplaceItemInObjectCaseSensitivePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_ReplaceItemInObjectCaseSensitive'); late final _cJSON_ReplaceItemInObjectCaseSensitive = _cJSON_ReplaceItemInObjectCaseSensitivePtr.asFunction< - void Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); ffi.Pointer cJSON_Duplicate( ffi.Pointer item, @@ -1010,7 +1018,7 @@ class CJson { .asFunction, ffi.Pointer, int)>(); void cJSON_Minify( - ffi.Pointer json, + ffi.Pointer json, ) { return _cJSON_Minify( json, @@ -1018,14 +1026,14 @@ class CJson { } late final _cJSON_MinifyPtr = - _lookup)>>( + _lookup)>>( 'cJSON_Minify'); late final _cJSON_Minify = - _cJSON_MinifyPtr.asFunction)>(); + _cJSON_MinifyPtr.asFunction)>(); ffi.Pointer cJSON_AddNullToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, ) { return _cJSON_AddNullToObject( object, @@ -1036,13 +1044,14 @@ class CJson { late final _cJSON_AddNullToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_AddNullToObject'); + ffi.Pointer)>>('cJSON_AddNullToObject'); late final _cJSON_AddNullToObject = _cJSON_AddNullToObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddTrueToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, ) { return _cJSON_AddTrueToObject( object, @@ -1053,13 +1062,14 @@ class CJson { late final _cJSON_AddTrueToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_AddTrueToObject'); + ffi.Pointer)>>('cJSON_AddTrueToObject'); late final _cJSON_AddTrueToObject = _cJSON_AddTrueToObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddFalseToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, ) { return _cJSON_AddFalseToObject( object, @@ -1070,13 +1080,14 @@ class CJson { late final _cJSON_AddFalseToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_AddFalseToObject'); + ffi.Pointer)>>('cJSON_AddFalseToObject'); late final _cJSON_AddFalseToObject = _cJSON_AddFalseToObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddBoolToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, int boolean, ) { return _cJSON_AddBoolToObject( @@ -1088,15 +1099,15 @@ class CJson { late final _cJSON_AddBoolToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer, - cJSON_bool)>>('cJSON_AddBoolToObject'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, cJSON_bool)>>('cJSON_AddBoolToObject'); late final _cJSON_AddBoolToObject = _cJSON_AddBoolToObjectPtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer, ffi.Pointer, int)>(); ffi.Pointer cJSON_AddNumberToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, double number, ) { return _cJSON_AddNumberToObject( @@ -1108,16 +1119,18 @@ class CJson { late final _cJSON_AddNumberToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, ffi.Double)>>('cJSON_AddNumberToObject'); late final _cJSON_AddNumberToObject = _cJSON_AddNumberToObjectPtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); + ffi.Pointer, ffi.Pointer, double)>(); ffi.Pointer cJSON_AddStringToObject( ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer string, + ffi.Pointer name, + ffi.Pointer string, ) { return _cJSON_AddStringToObject( object, @@ -1128,16 +1141,18 @@ class CJson { late final _cJSON_AddStringToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('cJSON_AddStringToObject'); + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('cJSON_AddStringToObject'); late final _cJSON_AddStringToObject = _cJSON_AddStringToObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); ffi.Pointer cJSON_AddRawToObject( ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer raw, + ffi.Pointer name, + ffi.Pointer raw, ) { return _cJSON_AddRawToObject( object, @@ -1148,15 +1163,17 @@ class CJson { late final _cJSON_AddRawToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('cJSON_AddRawToObject'); + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('cJSON_AddRawToObject'); late final _cJSON_AddRawToObject = _cJSON_AddRawToObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); ffi.Pointer cJSON_AddObjectToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, ) { return _cJSON_AddObjectToObject( object, @@ -1167,13 +1184,14 @@ class CJson { late final _cJSON_AddObjectToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_AddObjectToObject'); + ffi.Pointer)>>('cJSON_AddObjectToObject'); late final _cJSON_AddObjectToObject = _cJSON_AddObjectToObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddArrayToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, ) { return _cJSON_AddArrayToObject( object, @@ -1184,9 +1202,10 @@ class CJson { late final _cJSON_AddArrayToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_AddArrayToObject'); + ffi.Pointer)>>('cJSON_AddArrayToObject'); late final _cJSON_AddArrayToObject = _cJSON_AddArrayToObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); double cJSON_SetNumberHelper( ffi.Pointer object, @@ -1214,7 +1233,7 @@ class CJson { } late final _cJSON_mallocPtr = - _lookup Function(ffi.IntPtr)>>( + _lookup Function(pkg_ffi.Size)>>( 'cJSON_malloc'); late final _cJSON_malloc = _cJSON_mallocPtr.asFunction Function(int)>(); @@ -1241,30 +1260,31 @@ class cJSON extends ffi.Struct { external ffi.Pointer child; - @ffi.Int32() + @pkg_ffi.Int() external int type; - external ffi.Pointer valuestring; + external ffi.Pointer valuestring; - @ffi.Int32() + @pkg_ffi.Int() external int valueint; @ffi.Double() external double valuedouble; - external ffi.Pointer string; + external ffi.Pointer string; } class cJSON_Hooks extends ffi.Struct { external ffi.Pointer< - ffi.NativeFunction Function(ffi.IntPtr)>> malloc_fn; + ffi.NativeFunction Function(pkg_ffi.Size)>> + malloc_fn; external ffi .Pointer)>> free_fn; } -typedef cJSON_bool = ffi.Int32; +typedef cJSON_bool = pkg_ffi.Int; const int CJSON_VERSION_MAJOR = 1; diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index e9b7960367..f4180fb6af 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=2.13.0 <3.0.0' dependencies: - ffi: ^1.0.0 + ffi: ^1.2.0-dev.0 path: ^1.8.0 dev_dependencies: @@ -26,8 +26,12 @@ ffigen: include-directives: - '**cJSON.h' comments: false - typedef-map: - 'size_t': 'IntPtr' + type-map: + typedefs: + 'size_t': + lib: 'pkg_ffi' + c-type: 'Size' + dart-type: 'int' preamble: | // Copyright (c) 2009-2017 Dave Gamble and cJSON contributors diff --git a/pkgs/ffigen/example/libclang-example/custom_import.dart b/pkgs/ffigen/example/libclang-example/custom_import.dart new file mode 100644 index 0000000000..df11af43ca --- /dev/null +++ b/pkgs/ffigen/example/libclang-example/custom_import.dart @@ -0,0 +1,63 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:ffi'; + +/// Represents a native unsigned pointer-sized integer in C. +/// +/// [UintPtr] is not constructible in the Dart code and serves purely as marker in +/// type signatures. +@AbiSpecificIntegerMapping({ + Abi.androidArm: Uint32(), + Abi.androidArm64: Uint64(), + Abi.androidIA32: Uint32(), + Abi.androidX64: Uint64(), + Abi.fuchsiaArm64: Uint64(), + Abi.fuchsiaX64: Uint64(), + Abi.iosArm: Uint32(), + Abi.iosArm64: Uint64(), + Abi.iosX64: Uint64(), + Abi.linuxArm: Uint32(), + Abi.linuxArm64: Uint64(), + Abi.linuxIA32: Uint32(), + Abi.linuxX64: Uint64(), + Abi.macosArm64: Uint64(), + Abi.macosX64: Uint64(), + Abi.windowsArm64: Uint64(), + Abi.windowsIA32: Uint32(), + Abi.windowsX64: Uint64(), +}) +class UintPtr extends AbiSpecificInteger { + const UintPtr(); +} + +/// `unsigned long` in C. +/// +/// [UnsignedLong] is not constructible in the Dart code and serves purely as marker in +/// type signatures. +@AbiSpecificIntegerMapping({ + Abi.androidArm: Uint32(), + Abi.androidArm64: Uint64(), + Abi.androidIA32: Uint32(), + Abi.androidX64: Uint64(), + Abi.fuchsiaArm64: Uint64(), + Abi.fuchsiaX64: Uint64(), + Abi.iosArm: Uint32(), + Abi.iosArm64: Uint64(), + Abi.iosX64: Uint64(), + Abi.linuxArm: Uint32(), + Abi.linuxArm64: Uint64(), + Abi.linuxIA32: Uint32(), + Abi.linuxX64: Uint64(), + Abi.macosArm64: Uint64(), + Abi.macosX64: Uint64(), + Abi.windowsArm64: Uint32(), + Abi.windowsIA32: Uint32(), + Abi.windowsX64: Uint32(), +}) +class UnsignedLong extends AbiSpecificInteger { + const UnsignedLong(); +} + +class CXCursorSetImpl extends Opaque {} diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index 1c7c15b633..125e78c72f 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -9,6 +9,8 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; +import 'custom_import.dart' as custom_import; /// Holds bindings to LibClang. class LibClang { @@ -26,7 +28,7 @@ class LibClang { : _lookup = lookup; /// Retrieve the character data associated with the given string. - ffi.Pointer clang_getCString( + ffi.Pointer clang_getCString( CXString string, ) { return _clang_getCString( @@ -194,7 +196,7 @@ class LibClang { /// libclang invocations are not logged.. void clang_CXIndex_setInvocationEmissionPathOption( CXIndex arg0, - ffi.Pointer Path, + ffi.Pointer Path, ) { return _clang_CXIndex_setInvocationEmissionPathOption( arg0, @@ -290,7 +292,7 @@ class LibClang { /// or a NULL file handle if the file was not a part of this translation unit. CXFile clang_getFile( CXTranslationUnit tu, - ffi.Pointer file_name, + ffi.Pointer file_name, ) { return _clang_getFile( tu, @@ -312,10 +314,10 @@ class LibClang { /// /// \returns a pointer to the buffer in memory that holds the contents of /// \p file, or a NULL pointer when the file is not loaded. - ffi.Pointer clang_getFileContents( + ffi.Pointer clang_getFileContents( CXTranslationUnit tu, CXFile file, - ffi.Pointer size, + ffi.Pointer size, ) { return _clang_getFileContents( tu, @@ -555,9 +557,9 @@ class LibClang { void clang_getExpansionLocation( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_getExpansionLocation( location, @@ -615,8 +617,8 @@ class LibClang { void clang_getPresumedLocation( CXSourceLocation location, ffi.Pointer filename, - ffi.Pointer line, - ffi.Pointer column, + ffi.Pointer line, + ffi.Pointer column, ) { return _clang_getPresumedLocation( location, @@ -641,9 +643,9 @@ class LibClang { void clang_getInstantiationLocation( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_getInstantiationLocation( location, @@ -684,9 +686,9 @@ class LibClang { void clang_getSpellingLocation( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_getSpellingLocation( location, @@ -727,9 +729,9 @@ class LibClang { void clang_getFileLocation( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_getFileLocation( location, @@ -881,7 +883,7 @@ class LibClang { /// \returns A loaded CXDiagnosticSet if successful, and NULL otherwise. These /// diagnostics should be released using clang_disposeDiagnosticSet(). CXDiagnosticSet clang_loadDiagnostics( - ffi.Pointer file, + ffi.Pointer file, ffi.Pointer error, ffi.Pointer errorString, ) { @@ -1341,9 +1343,9 @@ class LibClang { /// guarantee their validity until the call to this function returns. CXTranslationUnit clang_createTranslationUnitFromSourceFile( CXIndex CIdx, - ffi.Pointer source_filename, + ffi.Pointer source_filename, int num_clang_command_line_args, - ffi.Pointer> clang_command_line_args, + ffi.Pointer> clang_command_line_args, int num_unsaved_files, ffi.Pointer unsaved_files, ) { @@ -1370,7 +1372,7 @@ class LibClang { /// error codes. CXTranslationUnit clang_createTranslationUnit( CXIndex CIdx, - ffi.Pointer ast_filename, + ffi.Pointer ast_filename, ) { return _clang_createTranslationUnit( CIdx, @@ -1392,7 +1394,7 @@ class LibClang { /// \returns Zero on success, otherwise returns an error code. int clang_createTranslationUnit2( CXIndex CIdx, - ffi.Pointer ast_filename, + ffi.Pointer ast_filename, ffi.Pointer out_TU, ) { return _clang_createTranslationUnit2( @@ -1435,8 +1437,8 @@ class LibClang { /// error codes. CXTranslationUnit clang_parseTranslationUnit( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -1503,8 +1505,8 @@ class LibClang { /// \returns Zero on success, otherwise returns an error code. int clang_parseTranslationUnit2( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -1534,8 +1536,8 @@ class LibClang { /// library paths are relative to the binary. int clang_parseTranslationUnit2FullArgv( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -1605,7 +1607,7 @@ class LibClang { /// saved successfully, while a non-zero value indicates that a problem occurred. int clang_saveTranslationUnit( CXTranslationUnit TU, - ffi.Pointer FileName, + ffi.Pointer FileName, int options, ) { return _clang_saveTranslationUnit( @@ -1736,7 +1738,7 @@ class LibClang { /// Returns the human-readable null-terminated C string that represents /// the name of the memory category. This string should never be freed. - ffi.Pointer clang_getTUResourceUsageName( + ffi.Pointer clang_getTUResourceUsageName( int kind, ) { return _clang_getTUResourceUsageName( @@ -2208,9 +2210,9 @@ class LibClang { /// \c min(N, availability_size) such structures. int clang_getCursorPlatformAvailability( CXCursor cursor, - ffi.Pointer always_deprecated, + ffi.Pointer always_deprecated, ffi.Pointer deprecated_message, - ffi.Pointer always_unavailable, + ffi.Pointer always_unavailable, ffi.Pointer unavailable_message, ffi.Pointer availability, int availability_size, @@ -2495,7 +2497,7 @@ class LibClang { void clang_getOverriddenCursors( CXCursor cursor, ffi.Pointer> overridden, - ffi.Pointer num_overridden, + ffi.Pointer num_overridden, ) { return _clang_getOverriddenCursors( cursor, @@ -3637,7 +3639,7 @@ class LibClang { /// CXTypeLayoutError_InvalidFieldName is returned. int clang_Type_getOffsetOf( CXType T, - ffi.Pointer S, + ffi.Pointer S, ) { return _clang_Type_getOffsetOf( T, @@ -3996,7 +3998,7 @@ class LibClang { /// Construct a USR for a specified Objective-C class. CXString clang_constructUSR_ObjCClass( - ffi.Pointer class_name, + ffi.Pointer class_name, ) { return _clang_constructUSR_ObjCClass( class_name, @@ -4011,8 +4013,8 @@ class LibClang { /// Construct a USR for a specified Objective-C category. CXString clang_constructUSR_ObjCCategory( - ffi.Pointer class_name, - ffi.Pointer category_name, + ffi.Pointer class_name, + ffi.Pointer category_name, ) { return _clang_constructUSR_ObjCCategory( class_name, @@ -4029,7 +4031,7 @@ class LibClang { /// Construct a USR for a specified Objective-C protocol. CXString clang_constructUSR_ObjCProtocol( - ffi.Pointer protocol_name, + ffi.Pointer protocol_name, ) { return _clang_constructUSR_ObjCProtocol( protocol_name, @@ -4046,7 +4048,7 @@ class LibClang { /// Construct a USR for a specified Objective-C instance variable and /// the USR for its containing class. CXString clang_constructUSR_ObjCIvar( - ffi.Pointer name, + ffi.Pointer name, CXString classUSR, ) { return _clang_constructUSR_ObjCIvar( @@ -4064,7 +4066,7 @@ class LibClang { /// Construct a USR for a specified Objective-C method and /// the USR for its containing class. CXString clang_constructUSR_ObjCMethod( - ffi.Pointer name, + ffi.Pointer name, int isInstanceMethod, CXString classUSR, ) { @@ -4084,7 +4086,7 @@ class LibClang { /// Construct a USR for a specified Objective-C property and the USR /// for its containing class. CXString clang_constructUSR_ObjCProperty( - ffi.Pointer property, + ffi.Pointer property, CXString classUSR, ) { return _clang_constructUSR_ObjCProperty( @@ -4558,7 +4560,7 @@ class LibClang { CXCursor C, ffi.Pointer language, ffi.Pointer definedIn, - ffi.Pointer isGenerated, + ffi.Pointer isGenerated, ) { return _clang_Cursor_isExternalSymbol( C, @@ -5244,7 +5246,7 @@ class LibClang { CXTranslationUnit TU, CXSourceRange Range, ffi.Pointer> Tokens, - ffi.Pointer NumTokens, + ffi.Pointer NumTokens, ) { return _clang_tokenize( TU, @@ -5348,12 +5350,12 @@ class LibClang { void clang_getDefinitionSpellingAndExtent( CXCursor arg0, - ffi.Pointer> startBuf, - ffi.Pointer> endBuf, - ffi.Pointer startLine, - ffi.Pointer startColumn, - ffi.Pointer endLine, - ffi.Pointer endColumn, + ffi.Pointer> startBuf, + ffi.Pointer> endBuf, + ffi.Pointer startLine, + ffi.Pointer startColumn, + ffi.Pointer endLine, + ffi.Pointer endColumn, ) { return _clang_getDefinitionSpellingAndExtent( arg0, @@ -5820,7 +5822,7 @@ class LibClang { /// completion fails, returns NULL. ffi.Pointer clang_codeCompleteAt( CXTranslationUnit TU, - ffi.Pointer complete_filename, + ffi.Pointer complete_filename, int complete_line, int complete_column, ffi.Pointer unsaved_files, @@ -5960,7 +5962,7 @@ class LibClang { /// container int clang_codeCompleteGetContainerKind( ffi.Pointer Results, - ffi.Pointer IsIncomplete, + ffi.Pointer IsIncomplete, ) { return _clang_codeCompleteGetContainerKind( Results, @@ -6193,7 +6195,7 @@ class LibClang { /// 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 clang_EvalResult_getAsStr( CXEvalResult E, ) { return _clang_EvalResult_getAsStr( @@ -6229,7 +6231,7 @@ class LibClang { /// \returns the requested remapping. This remapping must be freed /// via a call to \c clang_remap_dispose(). Can return NULL if an error occurred. CXRemapping clang_getRemappings( - ffi.Pointer path, + ffi.Pointer path, ) { return _clang_getRemappings( path, @@ -6251,7 +6253,7 @@ class LibClang { /// \returns the requested remapping. This remapping must be freed /// via a call to \c clang_remap_dispose(). Can return NULL if an error occurred. CXRemapping clang_getRemappingsFromFileList( - ffi.Pointer> filePaths, + ffi.Pointer> filePaths, int numFiles, ) { return _clang_getRemappingsFromFileList( @@ -6636,8 +6638,8 @@ class LibClang { ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -6675,8 +6677,8 @@ class LibClang { ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -6753,9 +6755,9 @@ class LibClang { CXIdxLoc loc, ffi.Pointer indexFile, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_indexLoc_getFileLocation( loc, @@ -7648,20 +7650,21 @@ class _SymbolAddresses { class CXString extends ffi.Struct { external ffi.Pointer data; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int private_flags; } class CXStringSet extends ffi.Struct { external ffi.Pointer Strings; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int Count; } -typedef NativeClang_getCString = ffi.Pointer Function( +typedef NativeClang_getCString = ffi.Pointer Function( + CXString string); +typedef DartClang_getCString = ffi.Pointer Function( CXString string); -typedef DartClang_getCString = ffi.Pointer Function(CXString string); typedef NativeClang_disposeString = ffi.Void Function(CXString string); typedef DartClang_disposeString = void Function(CXString string); typedef NativeClang_disposeStringSet = ffi.Void Function( @@ -7682,13 +7685,13 @@ 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; + external ffi.Pointer Filename; /// A buffer containing the unsaved contents of this file. - external ffi.Pointer Contents; + external ffi.Pointer Contents; /// The length of the unsaved contents of this buffer. - @ffi.Uint64() + @custom_import.UnsignedLong() external int Length; } @@ -7696,19 +7699,19 @@ class CXUnsavedFile extends ffi.Struct { 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() + @pkg_ffi.Int() 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() + @pkg_ffi.Int() 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() + @pkg_ffi.Int() external int Subminor; } @@ -7716,7 +7719,7 @@ class CXVersion extends ffi.Struct { /// typically be linked together into an executable or library. typedef CXIndex = ffi.Pointer; typedef NativeClang_createIndex = CXIndex Function( - ffi.Int32 excludeDeclarationsFromPCH, ffi.Int32 displayDiagnostics); + pkg_ffi.Int excludeDeclarationsFromPCH, pkg_ffi.Int displayDiagnostics); typedef DartClang_createIndex = CXIndex Function( int excludeDeclarationsFromPCH, int displayDiagnostics); typedef NativeClang_disposeIndex = ffi.Void Function(CXIndex index); @@ -7746,16 +7749,16 @@ abstract class CXGlobalOptFlags { } typedef NativeClang_CXIndex_setGlobalOptions = ffi.Void Function( - CXIndex arg0, ffi.Uint32 options); + CXIndex arg0, pkg_ffi.UnsignedInt options); typedef DartClang_CXIndex_setGlobalOptions = void Function( CXIndex arg0, int options); -typedef NativeClang_CXIndex_getGlobalOptions = ffi.Uint32 Function( +typedef NativeClang_CXIndex_getGlobalOptions = pkg_ffi.UnsignedInt Function( CXIndex arg0); typedef DartClang_CXIndex_getGlobalOptions = int Function(CXIndex arg0); typedef NativeClang_CXIndex_setInvocationEmissionPathOption = ffi.Void Function( - CXIndex arg0, ffi.Pointer Path); + CXIndex arg0, ffi.Pointer Path); typedef DartClang_CXIndex_setInvocationEmissionPathOption = void Function( - CXIndex arg0, ffi.Pointer Path); + CXIndex arg0, ffi.Pointer Path); /// A particular source file that is part of a translation unit. typedef CXFile = ffi.Pointer; @@ -7768,29 +7771,29 @@ typedef DartClang_getFileTime = int Function(CXFile SFile); /// across an indexing session. class CXFileUniqueID extends ffi.Struct { @ffi.Array.multi([3]) - external ffi.Array data; + external ffi.Array data; } -typedef NativeClang_getFileUniqueID = ffi.Int32 Function( +typedef NativeClang_getFileUniqueID = pkg_ffi.Int Function( CXFile file, ffi.Pointer outID); typedef DartClang_getFileUniqueID = int Function( CXFile file, ffi.Pointer outID); /// A single translation unit, which resides in an index. typedef CXTranslationUnit = ffi.Pointer; -typedef NativeClang_isFileMultipleIncludeGuarded = ffi.Uint32 Function( +typedef NativeClang_isFileMultipleIncludeGuarded = pkg_ffi.UnsignedInt Function( CXTranslationUnit tu, CXFile file); typedef DartClang_isFileMultipleIncludeGuarded = int Function( CXTranslationUnit tu, CXFile file); typedef NativeClang_getFile = CXFile Function( - CXTranslationUnit tu, ffi.Pointer file_name); + CXTranslationUnit tu, ffi.Pointer file_name); typedef DartClang_getFile = CXFile Function( - CXTranslationUnit tu, ffi.Pointer file_name); -typedef NativeClang_getFileContents = ffi.Pointer Function( - CXTranslationUnit tu, CXFile file, ffi.Pointer size); -typedef DartClang_getFileContents = ffi.Pointer Function( - CXTranslationUnit tu, CXFile file, ffi.Pointer size); -typedef NativeClang_File_isEqual = ffi.Int32 Function( + CXTranslationUnit tu, ffi.Pointer file_name); +typedef NativeClang_getFileContents = ffi.Pointer Function( + CXTranslationUnit tu, CXFile file, ffi.Pointer size); +typedef DartClang_getFileContents = ffi.Pointer Function( + CXTranslationUnit tu, CXFile file, ffi.Pointer size); +typedef NativeClang_File_isEqual = pkg_ffi.Int Function( CXFile file1, CXFile file2); typedef DartClang_File_isEqual = int Function(CXFile file1, CXFile file2); typedef NativeClang_File_tryGetRealPathName = CXString Function(CXFile file); @@ -7805,7 +7808,7 @@ class CXSourceLocation extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int int_data; } @@ -7817,32 +7820,35 @@ class CXSourceRange extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int begin_int_data; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int end_int_data; } typedef NativeClang_getNullLocation = CXSourceLocation Function(); typedef DartClang_getNullLocation = CXSourceLocation Function(); -typedef NativeClang_equalLocations = ffi.Uint32 Function( +typedef NativeClang_equalLocations = pkg_ffi.UnsignedInt Function( CXSourceLocation loc1, CXSourceLocation loc2); typedef DartClang_equalLocations = int Function( CXSourceLocation loc1, CXSourceLocation loc2); typedef NativeClang_getLocation = CXSourceLocation Function( - CXTranslationUnit tu, CXFile file, ffi.Uint32 line, ffi.Uint32 column); + CXTranslationUnit tu, + CXFile file, + pkg_ffi.UnsignedInt line, + pkg_ffi.UnsignedInt column); typedef DartClang_getLocation = CXSourceLocation Function( CXTranslationUnit tu, CXFile file, int line, int column); typedef NativeClang_getLocationForOffset = CXSourceLocation Function( - CXTranslationUnit tu, CXFile file, ffi.Uint32 offset); + CXTranslationUnit tu, CXFile file, pkg_ffi.UnsignedInt offset); typedef DartClang_getLocationForOffset = CXSourceLocation Function( CXTranslationUnit tu, CXFile file, int offset); -typedef NativeClang_Location_isInSystemHeader = ffi.Int32 Function( +typedef NativeClang_Location_isInSystemHeader = pkg_ffi.Int Function( CXSourceLocation location); typedef DartClang_Location_isInSystemHeader = int Function( CXSourceLocation location); -typedef NativeClang_Location_isFromMainFile = ffi.Int32 Function( +typedef NativeClang_Location_isFromMainFile = pkg_ffi.Int Function( CXSourceLocation location); typedef DartClang_Location_isFromMainFile = int Function( CXSourceLocation location); @@ -7852,70 +7858,70 @@ typedef NativeClang_getRange = CXSourceRange Function( CXSourceLocation begin, CXSourceLocation end); typedef DartClang_getRange = CXSourceRange Function( CXSourceLocation begin, CXSourceLocation end); -typedef NativeClang_equalRanges = ffi.Uint32 Function( +typedef NativeClang_equalRanges = pkg_ffi.UnsignedInt Function( CXSourceRange range1, CXSourceRange range2); typedef DartClang_equalRanges = int Function( CXSourceRange range1, CXSourceRange range2); -typedef NativeClang_Range_isNull = ffi.Int32 Function(CXSourceRange range); +typedef NativeClang_Range_isNull = pkg_ffi.Int Function(CXSourceRange range); typedef DartClang_Range_isNull = int Function(CXSourceRange range); typedef NativeClang_getExpansionLocation = ffi.Void Function( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset); + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef DartClang_getExpansionLocation = void Function( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset); + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef NativeClang_getPresumedLocation = ffi.Void Function( CXSourceLocation location, ffi.Pointer filename, - ffi.Pointer line, - ffi.Pointer column); + ffi.Pointer line, + ffi.Pointer column); typedef DartClang_getPresumedLocation = void Function( CXSourceLocation location, ffi.Pointer filename, - ffi.Pointer line, - ffi.Pointer column); + ffi.Pointer line, + ffi.Pointer column); typedef NativeClang_getInstantiationLocation = ffi.Void Function( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset); + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef DartClang_getInstantiationLocation = void Function( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset); + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef NativeClang_getSpellingLocation = ffi.Void Function( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset); + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef DartClang_getSpellingLocation = void Function( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset); + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef NativeClang_getFileLocation = ffi.Void Function( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset); + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef DartClang_getFileLocation = void Function( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset); + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef NativeClang_getRangeStart = CXSourceLocation Function( CXSourceRange range); typedef DartClang_getRangeStart = CXSourceLocation Function( @@ -7927,7 +7933,7 @@ typedef DartClang_getRangeEnd = CXSourceLocation Function(CXSourceRange range); /// Identifies an array of ranges. class CXSourceRangeList extends ffi.Struct { /// The number of ranges in the \c ranges array. - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int count; /// An array of \c CXSourceRanges. @@ -7949,7 +7955,7 @@ typedef DartClang_disposeSourceRangeList = void Function( /// A group of CXDiagnostics. typedef CXDiagnosticSet = ffi.Pointer; -typedef NativeClang_getNumDiagnosticsInSet = ffi.Uint32 Function( +typedef NativeClang_getNumDiagnosticsInSet = pkg_ffi.UnsignedInt Function( CXDiagnosticSet Diags); typedef DartClang_getNumDiagnosticsInSet = int Function(CXDiagnosticSet Diags); @@ -7957,7 +7963,7 @@ typedef DartClang_getNumDiagnosticsInSet = int Function(CXDiagnosticSet Diags); /// location, text, source ranges, and fix-it hints. typedef CXDiagnostic = ffi.Pointer; typedef NativeClang_getDiagnosticInSet = CXDiagnostic Function( - CXDiagnosticSet Diags, ffi.Uint32 Index); + CXDiagnosticSet Diags, pkg_ffi.UnsignedInt Index); typedef DartClang_getDiagnosticInSet = CXDiagnostic Function( CXDiagnosticSet Diags, int Index); @@ -7981,11 +7987,11 @@ abstract class CXLoadDiag_Error { } typedef NativeClang_loadDiagnostics = CXDiagnosticSet Function( - ffi.Pointer file, + ffi.Pointer file, ffi.Pointer error, ffi.Pointer errorString); typedef DartClang_loadDiagnostics = CXDiagnosticSet Function( - ffi.Pointer file, + ffi.Pointer file, ffi.Pointer error, ffi.Pointer errorString); typedef NativeClang_disposeDiagnosticSet = ffi.Void Function( @@ -7995,11 +8001,11 @@ typedef NativeClang_getChildDiagnostics = CXDiagnosticSet Function( CXDiagnostic D); typedef DartClang_getChildDiagnostics = CXDiagnosticSet Function( CXDiagnostic D); -typedef NativeClang_getNumDiagnostics = ffi.Uint32 Function( +typedef NativeClang_getNumDiagnostics = pkg_ffi.UnsignedInt Function( CXTranslationUnit Unit); typedef DartClang_getNumDiagnostics = int Function(CXTranslationUnit Unit); typedef NativeClang_getDiagnostic = CXDiagnostic Function( - CXTranslationUnit Unit, ffi.Uint32 Index); + CXTranslationUnit Unit, pkg_ffi.UnsignedInt Index); typedef DartClang_getDiagnostic = CXDiagnostic Function( CXTranslationUnit Unit, int Index); typedef NativeClang_getDiagnosticSetFromTU = CXDiagnosticSet Function( @@ -8010,10 +8016,11 @@ typedef NativeClang_disposeDiagnostic = ffi.Void Function( CXDiagnostic Diagnostic); typedef DartClang_disposeDiagnostic = void Function(CXDiagnostic Diagnostic); typedef NativeClang_formatDiagnostic = CXString Function( - CXDiagnostic Diagnostic, ffi.Uint32 Options); + CXDiagnostic Diagnostic, pkg_ffi.UnsignedInt Options); typedef DartClang_formatDiagnostic = CXString Function( CXDiagnostic Diagnostic, int Options); -typedef NativeClang_defaultDiagnosticDisplayOptions = ffi.Uint32 Function(); +typedef NativeClang_defaultDiagnosticDisplayOptions = pkg_ffi.UnsignedInt + Function(); typedef DartClang_defaultDiagnosticDisplayOptions = int Function(); /// Describes the severity of a particular diagnostic. @@ -8053,30 +8060,30 @@ typedef NativeClang_getDiagnosticOption = CXString Function( CXDiagnostic Diag, ffi.Pointer Disable); typedef DartClang_getDiagnosticOption = CXString Function( CXDiagnostic Diag, ffi.Pointer Disable); -typedef NativeClang_getDiagnosticCategory = ffi.Uint32 Function( +typedef NativeClang_getDiagnosticCategory = pkg_ffi.UnsignedInt Function( CXDiagnostic arg0); typedef DartClang_getDiagnosticCategory = int Function(CXDiagnostic arg0); typedef NativeClang_getDiagnosticCategoryName = CXString Function( - ffi.Uint32 Category); + pkg_ffi.UnsignedInt Category); typedef DartClang_getDiagnosticCategoryName = CXString Function(int Category); typedef NativeClang_getDiagnosticCategoryText = CXString Function( CXDiagnostic arg0); typedef DartClang_getDiagnosticCategoryText = CXString Function( CXDiagnostic arg0); -typedef NativeClang_getDiagnosticNumRanges = ffi.Uint32 Function( +typedef NativeClang_getDiagnosticNumRanges = pkg_ffi.UnsignedInt Function( CXDiagnostic arg0); typedef DartClang_getDiagnosticNumRanges = int Function(CXDiagnostic arg0); typedef NativeClang_getDiagnosticRange = CXSourceRange Function( - CXDiagnostic Diagnostic, ffi.Uint32 Range); + CXDiagnostic Diagnostic, pkg_ffi.UnsignedInt Range); typedef DartClang_getDiagnosticRange = CXSourceRange Function( CXDiagnostic Diagnostic, int Range); -typedef NativeClang_getDiagnosticNumFixIts = ffi.Uint32 Function( +typedef NativeClang_getDiagnosticNumFixIts = pkg_ffi.UnsignedInt Function( CXDiagnostic Diagnostic); typedef DartClang_getDiagnosticNumFixIts = int Function( CXDiagnostic Diagnostic); typedef NativeClang_getDiagnosticFixIt = CXString Function( CXDiagnostic Diagnostic, - ffi.Uint32 FixIt, + pkg_ffi.UnsignedInt FixIt, ffi.Pointer ReplacementRange); typedef DartClang_getDiagnosticFixIt = CXString Function( CXDiagnostic Diagnostic, @@ -8089,23 +8096,23 @@ typedef DartClang_getTranslationUnitSpelling = CXString Function( typedef NativeClang_createTranslationUnitFromSourceFile = CXTranslationUnit Function( CXIndex 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 source_filename, + pkg_ffi.Int num_clang_command_line_args, + ffi.Pointer> clang_command_line_args, + pkg_ffi.UnsignedInt num_unsaved_files, ffi.Pointer unsaved_files); typedef DartClang_createTranslationUnitFromSourceFile = CXTranslationUnit Function( CXIndex CIdx, - ffi.Pointer source_filename, + ffi.Pointer source_filename, int num_clang_command_line_args, - ffi.Pointer> clang_command_line_args, + ffi.Pointer> clang_command_line_args, int num_unsaved_files, ffi.Pointer unsaved_files); typedef NativeClang_createTranslationUnit = CXTranslationUnit Function( - CXIndex CIdx, ffi.Pointer ast_filename); + CXIndex CIdx, ffi.Pointer ast_filename); typedef DartClang_createTranslationUnit = CXTranslationUnit Function( - CXIndex CIdx, ffi.Pointer ast_filename); + CXIndex CIdx, ffi.Pointer ast_filename); /// Error codes returned by libclang routines. /// @@ -8132,42 +8139,46 @@ abstract class CXErrorCode { static const int CXError_ASTReadError = 4; } -typedef NativeClang_createTranslationUnit2 = ffi.Int32 Function(CXIndex CIdx, - ffi.Pointer ast_filename, ffi.Pointer out_TU); -typedef DartClang_createTranslationUnit2 = int Function(CXIndex CIdx, - ffi.Pointer ast_filename, ffi.Pointer out_TU); -typedef NativeClang_defaultEditingTranslationUnitOptions = ffi.Uint32 +typedef NativeClang_createTranslationUnit2 = ffi.Int32 Function( + CXIndex CIdx, + ffi.Pointer ast_filename, + ffi.Pointer out_TU); +typedef DartClang_createTranslationUnit2 = int Function( + CXIndex CIdx, + ffi.Pointer ast_filename, + ffi.Pointer out_TU); +typedef NativeClang_defaultEditingTranslationUnitOptions = pkg_ffi.UnsignedInt Function(); typedef DartClang_defaultEditingTranslationUnitOptions = int Function(); typedef NativeClang_parseTranslationUnit = CXTranslationUnit Function( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + pkg_ffi.Int num_command_line_args, ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options); + pkg_ffi.UnsignedInt num_unsaved_files, + pkg_ffi.UnsignedInt options); typedef DartClang_parseTranslationUnit = CXTranslationUnit Function( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + 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 NativeClang_parseTranslationUnit2 = ffi.Int32 Function( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + pkg_ffi.Int num_command_line_args, ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options, + pkg_ffi.UnsignedInt num_unsaved_files, + pkg_ffi.UnsignedInt options, ffi.Pointer out_TU); typedef DartClang_parseTranslationUnit2 = int Function( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -8175,44 +8186,46 @@ typedef DartClang_parseTranslationUnit2 = int Function( ffi.Pointer out_TU); typedef NativeClang_parseTranslationUnit2FullArgv = ffi.Int32 Function( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + pkg_ffi.Int num_command_line_args, ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options, + pkg_ffi.UnsignedInt num_unsaved_files, + pkg_ffi.UnsignedInt options, ffi.Pointer out_TU); typedef DartClang_parseTranslationUnit2FullArgv = int Function( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + 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 NativeClang_defaultSaveOptions = ffi.Uint32 Function( +typedef NativeClang_defaultSaveOptions = pkg_ffi.UnsignedInt Function( CXTranslationUnit TU); typedef DartClang_defaultSaveOptions = int Function(CXTranslationUnit TU); -typedef NativeClang_saveTranslationUnit = ffi.Int32 Function( - CXTranslationUnit TU, ffi.Pointer FileName, ffi.Uint32 options); +typedef NativeClang_saveTranslationUnit = pkg_ffi.Int Function( + CXTranslationUnit TU, + ffi.Pointer FileName, + pkg_ffi.UnsignedInt options); typedef DartClang_saveTranslationUnit = int Function( - CXTranslationUnit TU, ffi.Pointer FileName, int options); -typedef NativeClang_suspendTranslationUnit = ffi.Uint32 Function( + CXTranslationUnit TU, ffi.Pointer FileName, int options); +typedef NativeClang_suspendTranslationUnit = pkg_ffi.UnsignedInt Function( CXTranslationUnit arg0); typedef DartClang_suspendTranslationUnit = int Function(CXTranslationUnit arg0); typedef NativeClang_disposeTranslationUnit = ffi.Void Function( CXTranslationUnit arg0); typedef DartClang_disposeTranslationUnit = void Function( CXTranslationUnit arg0); -typedef NativeClang_defaultReparseOptions = ffi.Uint32 Function( +typedef NativeClang_defaultReparseOptions = pkg_ffi.UnsignedInt Function( CXTranslationUnit TU); typedef DartClang_defaultReparseOptions = int Function(CXTranslationUnit TU); -typedef NativeClang_reparseTranslationUnit = ffi.Int32 Function( +typedef NativeClang_reparseTranslationUnit = pkg_ffi.Int Function( CXTranslationUnit TU, - ffi.Uint32 num_unsaved_files, + pkg_ffi.UnsignedInt num_unsaved_files, ffi.Pointer unsaved_files, - ffi.Uint32 options); + pkg_ffi.UnsignedInt options); typedef DartClang_reparseTranslationUnit = int Function( CXTranslationUnit TU, int num_unsaved_files, @@ -8241,16 +8254,16 @@ abstract class CXTUResourceUsageKind { static const int CXTUResourceUsage_Last = 14; } -typedef NativeClang_getTUResourceUsageName = ffi.Pointer Function( +typedef NativeClang_getTUResourceUsageName = ffi.Pointer Function( ffi.Int32 kind); -typedef DartClang_getTUResourceUsageName = ffi.Pointer Function( +typedef DartClang_getTUResourceUsageName = ffi.Pointer Function( int kind); class CXTUResourceUsageEntry extends ffi.Struct { @ffi.Int32() external int kind; - @ffi.Uint64() + @custom_import.UnsignedLong() external int amount; } @@ -8258,7 +8271,7 @@ class CXTUResourceUsageEntry extends ffi.Struct { class CXTUResourceUsage extends ffi.Struct { external ffi.Pointer data; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int numEntries; external ffi.Pointer entries; @@ -8284,7 +8297,7 @@ typedef NativeClang_TargetInfo_dispose = ffi.Void Function(CXTargetInfo Info); typedef DartClang_TargetInfo_dispose = void Function(CXTargetInfo Info); typedef NativeClang_TargetInfo_getTriple = CXString Function(CXTargetInfo Info); typedef DartClang_TargetInfo_getTriple = CXString Function(CXTargetInfo Info); -typedef NativeClang_TargetInfo_getPointerWidth = ffi.Int32 Function( +typedef NativeClang_TargetInfo_getPointerWidth = pkg_ffi.Int Function( CXTargetInfo Info); typedef DartClang_TargetInfo_getPointerWidth = int Function(CXTargetInfo Info); @@ -8308,7 +8321,7 @@ class CXCursor extends ffi.Struct { @ffi.Int32() external int kind; - @ffi.Int32() + @pkg_ffi.Int() external int xdata; @ffi.Array.multi([3]) @@ -9107,36 +9120,40 @@ typedef NativeClang_getTranslationUnitCursor = CXCursor Function( CXTranslationUnit arg0); typedef DartClang_getTranslationUnitCursor = CXCursor Function( CXTranslationUnit arg0); -typedef NativeClang_equalCursors = ffi.Uint32 Function( +typedef NativeClang_equalCursors = pkg_ffi.UnsignedInt Function( CXCursor arg0, CXCursor arg1); typedef DartClang_equalCursors = int Function(CXCursor arg0, CXCursor arg1); -typedef NativeClang_Cursor_isNull = ffi.Int32 Function(CXCursor cursor); +typedef NativeClang_Cursor_isNull = pkg_ffi.Int Function(CXCursor cursor); typedef DartClang_Cursor_isNull = int Function(CXCursor cursor); -typedef NativeClang_hashCursor = ffi.Uint32 Function(CXCursor arg0); +typedef NativeClang_hashCursor = pkg_ffi.UnsignedInt Function(CXCursor arg0); typedef DartClang_hashCursor = int Function(CXCursor arg0); typedef NativeClang_getCursorKind = ffi.Int32 Function(CXCursor arg0); typedef DartClang_getCursorKind = int Function(CXCursor arg0); -typedef NativeClang_isDeclaration = ffi.Uint32 Function(ffi.Int32 arg0); +typedef NativeClang_isDeclaration = pkg_ffi.UnsignedInt Function( + ffi.Int32 arg0); typedef DartClang_isDeclaration = int Function(int arg0); -typedef NativeClang_isInvalidDeclaration = ffi.Uint32 Function(CXCursor arg0); +typedef NativeClang_isInvalidDeclaration = pkg_ffi.UnsignedInt Function( + CXCursor arg0); typedef DartClang_isInvalidDeclaration = int Function(CXCursor arg0); -typedef NativeClang_isReference = ffi.Uint32 Function(ffi.Int32 arg0); +typedef NativeClang_isReference = pkg_ffi.UnsignedInt Function(ffi.Int32 arg0); typedef DartClang_isReference = int Function(int arg0); -typedef NativeClang_isExpression = ffi.Uint32 Function(ffi.Int32 arg0); +typedef NativeClang_isExpression = pkg_ffi.UnsignedInt Function(ffi.Int32 arg0); typedef DartClang_isExpression = int Function(int arg0); -typedef NativeClang_isStatement = ffi.Uint32 Function(ffi.Int32 arg0); +typedef NativeClang_isStatement = pkg_ffi.UnsignedInt Function(ffi.Int32 arg0); typedef DartClang_isStatement = int Function(int arg0); -typedef NativeClang_isAttribute = ffi.Uint32 Function(ffi.Int32 arg0); +typedef NativeClang_isAttribute = pkg_ffi.UnsignedInt Function(ffi.Int32 arg0); typedef DartClang_isAttribute = int Function(int arg0); -typedef NativeClang_Cursor_hasAttrs = ffi.Uint32 Function(CXCursor C); +typedef NativeClang_Cursor_hasAttrs = pkg_ffi.UnsignedInt Function(CXCursor C); typedef DartClang_Cursor_hasAttrs = int Function(CXCursor C); -typedef NativeClang_isInvalid = ffi.Uint32 Function(ffi.Int32 arg0); +typedef NativeClang_isInvalid = pkg_ffi.UnsignedInt Function(ffi.Int32 arg0); typedef DartClang_isInvalid = int Function(int arg0); -typedef NativeClang_isTranslationUnit = ffi.Uint32 Function(ffi.Int32 arg0); +typedef NativeClang_isTranslationUnit = pkg_ffi.UnsignedInt Function( + ffi.Int32 arg0); typedef DartClang_isTranslationUnit = int Function(int arg0); -typedef NativeClang_isPreprocessing = ffi.Uint32 Function(ffi.Int32 arg0); +typedef NativeClang_isPreprocessing = pkg_ffi.UnsignedInt Function( + ffi.Int32 arg0); typedef DartClang_isPreprocessing = int Function(int arg0); -typedef NativeClang_isUnexposed = ffi.Uint32 Function(ffi.Int32 arg0); +typedef NativeClang_isUnexposed = pkg_ffi.UnsignedInt Function(ffi.Int32 arg0); typedef DartClang_isUnexposed = int Function(int arg0); /// Describe the linkage of the entity referred to by a cursor. @@ -9224,7 +9241,7 @@ class CXPlatformAvailability extends ffi.Struct { external CXVersion Obsoleted; /// Whether the entity is unconditionally unavailable on this platform. - @ffi.Int32() + @pkg_ffi.Int() external int Unavailable; /// An optional message to provide to a user of this API, e.g., to @@ -9232,19 +9249,19 @@ class CXPlatformAvailability extends ffi.Struct { external CXString Message; } -typedef NativeClang_getCursorPlatformAvailability = ffi.Int32 Function( +typedef NativeClang_getCursorPlatformAvailability = pkg_ffi.Int Function( CXCursor cursor, - ffi.Pointer always_deprecated, + ffi.Pointer always_deprecated, ffi.Pointer deprecated_message, - ffi.Pointer always_unavailable, + ffi.Pointer always_unavailable, ffi.Pointer unavailable_message, ffi.Pointer availability, - ffi.Int32 availability_size); + pkg_ffi.Int availability_size); typedef DartClang_getCursorPlatformAvailability = int Function( CXCursor cursor, - ffi.Pointer always_deprecated, + ffi.Pointer always_deprecated, ffi.Pointer deprecated_message, - ffi.Pointer always_unavailable, + ffi.Pointer always_unavailable, ffi.Pointer unavailable_message, ffi.Pointer availability, int availability_size); @@ -9282,16 +9299,16 @@ typedef DartClang_Cursor_getTranslationUnit = CXTranslationUnit Function( class CXCursorSetImpl extends ffi.Opaque {} /// A fast container representing a set of CXCursors. -typedef CXCursorSet = ffi.Pointer; +typedef CXCursorSet = ffi.Pointer; typedef NativeClang_createCXCursorSet = CXCursorSet Function(); typedef DartClang_createCXCursorSet = CXCursorSet Function(); typedef NativeClang_disposeCXCursorSet = ffi.Void Function(CXCursorSet cset); typedef DartClang_disposeCXCursorSet = void Function(CXCursorSet cset); -typedef NativeClang_CXCursorSet_contains = ffi.Uint32 Function( +typedef NativeClang_CXCursorSet_contains = pkg_ffi.UnsignedInt Function( CXCursorSet cset, CXCursor cursor); typedef DartClang_CXCursorSet_contains = int Function( CXCursorSet cset, CXCursor cursor); -typedef NativeClang_CXCursorSet_insert = ffi.Uint32 Function( +typedef NativeClang_CXCursorSet_insert = pkg_ffi.UnsignedInt Function( CXCursorSet cset, CXCursor cursor); typedef DartClang_CXCursorSet_insert = int Function( CXCursorSet cset, CXCursor cursor); @@ -9303,11 +9320,11 @@ typedef DartClang_getCursorLexicalParent = CXCursor Function(CXCursor cursor); typedef NativeClang_getOverriddenCursors = ffi.Void Function( CXCursor cursor, ffi.Pointer> overridden, - ffi.Pointer num_overridden); + ffi.Pointer num_overridden); typedef DartClang_getOverriddenCursors = void Function( CXCursor cursor, ffi.Pointer> overridden, - ffi.Pointer num_overridden); + ffi.Pointer num_overridden); typedef NativeClang_disposeOverriddenCursors = ffi.Void Function( ffi.Pointer overridden); typedef DartClang_disposeOverriddenCursors = void Function( @@ -9471,19 +9488,20 @@ typedef NativeClang_getTypedefDeclUnderlyingType = CXType Function(CXCursor C); typedef DartClang_getTypedefDeclUnderlyingType = CXType Function(CXCursor C); typedef NativeClang_getEnumDeclIntegerType = CXType Function(CXCursor C); typedef DartClang_getEnumDeclIntegerType = CXType Function(CXCursor C); -typedef NativeClang_getEnumConstantDeclValue = ffi.Int64 Function(CXCursor C); -typedef DartClang_getEnumConstantDeclValue = int Function(CXCursor C); -typedef NativeClang_getEnumConstantDeclUnsignedValue = ffi.Uint64 Function( +typedef NativeClang_getEnumConstantDeclValue = pkg_ffi.LongLong Function( CXCursor C); +typedef DartClang_getEnumConstantDeclValue = int Function(CXCursor C); +typedef NativeClang_getEnumConstantDeclUnsignedValue = pkg_ffi.UnsignedLongLong + Function(CXCursor C); typedef DartClang_getEnumConstantDeclUnsignedValue = int Function(CXCursor C); -typedef NativeClang_getFieldDeclBitWidth = ffi.Int32 Function(CXCursor C); +typedef NativeClang_getFieldDeclBitWidth = pkg_ffi.Int Function(CXCursor C); typedef DartClang_getFieldDeclBitWidth = int Function(CXCursor C); -typedef NativeClang_Cursor_getNumArguments = ffi.Int32 Function(CXCursor C); +typedef NativeClang_Cursor_getNumArguments = pkg_ffi.Int Function(CXCursor C); typedef DartClang_Cursor_getNumArguments = int Function(CXCursor C); typedef NativeClang_Cursor_getArgument = CXCursor Function( - CXCursor C, ffi.Uint32 i); + CXCursor C, pkg_ffi.UnsignedInt i); typedef DartClang_Cursor_getArgument = CXCursor Function(CXCursor C, int i); -typedef NativeClang_Cursor_getNumTemplateArguments = ffi.Int32 Function( +typedef NativeClang_Cursor_getNumTemplateArguments = pkg_ffi.Int Function( CXCursor C); typedef DartClang_Cursor_getNumTemplateArguments = int Function(CXCursor C); @@ -9505,39 +9523,45 @@ abstract class CXTemplateArgumentKind { } typedef NativeClang_Cursor_getTemplateArgumentKind = ffi.Int32 Function( - CXCursor C, ffi.Uint32 I); + CXCursor C, pkg_ffi.UnsignedInt I); typedef DartClang_Cursor_getTemplateArgumentKind = int Function( CXCursor C, int I); typedef NativeClang_Cursor_getTemplateArgumentType = CXType Function( - CXCursor C, ffi.Uint32 I); + CXCursor C, pkg_ffi.UnsignedInt I); typedef DartClang_Cursor_getTemplateArgumentType = CXType Function( CXCursor C, int I); -typedef NativeClang_Cursor_getTemplateArgumentValue = ffi.Int64 Function( - CXCursor C, ffi.Uint32 I); +typedef NativeClang_Cursor_getTemplateArgumentValue = pkg_ffi.LongLong Function( + CXCursor C, pkg_ffi.UnsignedInt I); typedef DartClang_Cursor_getTemplateArgumentValue = int Function( CXCursor C, int I); -typedef NativeClang_Cursor_getTemplateArgumentUnsignedValue = ffi.Uint64 - Function(CXCursor C, ffi.Uint32 I); +typedef NativeClang_Cursor_getTemplateArgumentUnsignedValue + = pkg_ffi.UnsignedLongLong Function(CXCursor C, pkg_ffi.UnsignedInt I); typedef DartClang_Cursor_getTemplateArgumentUnsignedValue = int Function( CXCursor C, int I); -typedef NativeClang_equalTypes = ffi.Uint32 Function(CXType A, CXType B); +typedef NativeClang_equalTypes = pkg_ffi.UnsignedInt Function( + CXType A, CXType B); typedef DartClang_equalTypes = int Function(CXType A, CXType B); typedef NativeClang_getCanonicalType = CXType Function(CXType T); typedef DartClang_getCanonicalType = CXType Function(CXType T); -typedef NativeClang_isConstQualifiedType = ffi.Uint32 Function(CXType T); +typedef NativeClang_isConstQualifiedType = pkg_ffi.UnsignedInt Function( + CXType T); typedef DartClang_isConstQualifiedType = int Function(CXType T); -typedef NativeClang_Cursor_isMacroFunctionLike = ffi.Uint32 Function( +typedef NativeClang_Cursor_isMacroFunctionLike = pkg_ffi.UnsignedInt Function( CXCursor C); typedef DartClang_Cursor_isMacroFunctionLike = int Function(CXCursor C); -typedef NativeClang_Cursor_isMacroBuiltin = ffi.Uint32 Function(CXCursor C); +typedef NativeClang_Cursor_isMacroBuiltin = pkg_ffi.UnsignedInt Function( + CXCursor C); typedef DartClang_Cursor_isMacroBuiltin = int Function(CXCursor C); -typedef NativeClang_Cursor_isFunctionInlined = ffi.Uint32 Function(CXCursor C); +typedef NativeClang_Cursor_isFunctionInlined = pkg_ffi.UnsignedInt Function( + CXCursor C); typedef DartClang_Cursor_isFunctionInlined = int Function(CXCursor C); -typedef NativeClang_isVolatileQualifiedType = ffi.Uint32 Function(CXType T); +typedef NativeClang_isVolatileQualifiedType = pkg_ffi.UnsignedInt Function( + CXType T); typedef DartClang_isVolatileQualifiedType = int Function(CXType T); -typedef NativeClang_isRestrictQualifiedType = ffi.Uint32 Function(CXType T); +typedef NativeClang_isRestrictQualifiedType = pkg_ffi.UnsignedInt Function( + CXType T); typedef DartClang_isRestrictQualifiedType = int Function(CXType T); -typedef NativeClang_getAddressSpace = ffi.Uint32 Function(CXType T); +typedef NativeClang_getAddressSpace = pkg_ffi.UnsignedInt Function(CXType T); typedef DartClang_getAddressSpace = int Function(CXType T); typedef NativeClang_getTypedefName = CXString Function(CXType CT); typedef DartClang_getTypedefName = CXString Function(CXType CT); @@ -9580,46 +9604,50 @@ typedef NativeClang_getFunctionTypeCallingConv = ffi.Int32 Function(CXType T); typedef DartClang_getFunctionTypeCallingConv = int Function(CXType T); typedef NativeClang_getResultType = CXType Function(CXType T); typedef DartClang_getResultType = CXType Function(CXType T); -typedef NativeClang_getExceptionSpecificationType = ffi.Int32 Function( +typedef NativeClang_getExceptionSpecificationType = pkg_ffi.Int Function( CXType T); typedef DartClang_getExceptionSpecificationType = int Function(CXType T); -typedef NativeClang_getNumArgTypes = ffi.Int32 Function(CXType T); +typedef NativeClang_getNumArgTypes = pkg_ffi.Int Function(CXType T); typedef DartClang_getNumArgTypes = int Function(CXType T); -typedef NativeClang_getArgType = CXType Function(CXType T, ffi.Uint32 i); +typedef NativeClang_getArgType = CXType Function( + CXType T, pkg_ffi.UnsignedInt i); typedef DartClang_getArgType = CXType Function(CXType T, int i); typedef NativeClang_Type_getObjCObjectBaseType = CXType Function(CXType T); typedef DartClang_Type_getObjCObjectBaseType = CXType Function(CXType T); -typedef NativeClang_Type_getNumObjCProtocolRefs = ffi.Uint32 Function(CXType T); +typedef NativeClang_Type_getNumObjCProtocolRefs = pkg_ffi.UnsignedInt Function( + CXType T); typedef DartClang_Type_getNumObjCProtocolRefs = int Function(CXType T); typedef NativeClang_Type_getObjCProtocolDecl = CXCursor Function( - CXType T, ffi.Uint32 i); + CXType T, pkg_ffi.UnsignedInt i); typedef DartClang_Type_getObjCProtocolDecl = CXCursor Function(CXType T, int i); -typedef NativeClang_Type_getNumObjCTypeArgs = ffi.Uint32 Function(CXType T); +typedef NativeClang_Type_getNumObjCTypeArgs = pkg_ffi.UnsignedInt Function( + CXType T); typedef DartClang_Type_getNumObjCTypeArgs = int Function(CXType T); typedef NativeClang_Type_getObjCTypeArg = CXType Function( - CXType T, ffi.Uint32 i); + CXType T, pkg_ffi.UnsignedInt i); typedef DartClang_Type_getObjCTypeArg = CXType Function(CXType T, int i); -typedef NativeClang_isFunctionTypeVariadic = ffi.Uint32 Function(CXType T); +typedef NativeClang_isFunctionTypeVariadic = pkg_ffi.UnsignedInt Function( + CXType T); typedef DartClang_isFunctionTypeVariadic = int Function(CXType T); typedef NativeClang_getCursorResultType = CXType Function(CXCursor C); typedef DartClang_getCursorResultType = CXType Function(CXCursor C); -typedef NativeClang_getCursorExceptionSpecificationType = ffi.Int32 Function( +typedef NativeClang_getCursorExceptionSpecificationType = pkg_ffi.Int Function( CXCursor C); typedef DartClang_getCursorExceptionSpecificationType = int Function( CXCursor C); -typedef NativeClang_isPODType = ffi.Uint32 Function(CXType T); +typedef NativeClang_isPODType = pkg_ffi.UnsignedInt Function(CXType T); typedef DartClang_isPODType = int Function(CXType T); typedef NativeClang_getElementType = CXType Function(CXType T); typedef DartClang_getElementType = CXType Function(CXType T); -typedef NativeClang_getNumElements = ffi.Int64 Function(CXType T); +typedef NativeClang_getNumElements = pkg_ffi.LongLong Function(CXType T); typedef DartClang_getNumElements = int Function(CXType T); typedef NativeClang_getArrayElementType = CXType Function(CXType T); typedef DartClang_getArrayElementType = CXType Function(CXType T); -typedef NativeClang_getArraySize = ffi.Int64 Function(CXType T); +typedef NativeClang_getArraySize = pkg_ffi.LongLong Function(CXType T); typedef DartClang_getArraySize = int Function(CXType T); typedef NativeClang_Type_getNamedType = CXType Function(CXType T); typedef DartClang_Type_getNamedType = CXType Function(CXType T); -typedef NativeClang_Type_isTransparentTagTypedef = ffi.Uint32 Function( +typedef NativeClang_Type_isTransparentTagTypedef = pkg_ffi.UnsignedInt Function( CXType T); typedef DartClang_Type_isTransparentTagTypedef = int Function(CXType T); @@ -9642,31 +9670,35 @@ abstract class CXTypeNullabilityKind { typedef NativeClang_Type_getNullability = ffi.Int32 Function(CXType T); typedef DartClang_Type_getNullability = int Function(CXType T); -typedef NativeClang_Type_getAlignOf = ffi.Int64 Function(CXType T); +typedef NativeClang_Type_getAlignOf = pkg_ffi.LongLong Function(CXType T); typedef DartClang_Type_getAlignOf = int Function(CXType T); typedef NativeClang_Type_getClassType = CXType Function(CXType T); typedef DartClang_Type_getClassType = CXType Function(CXType T); -typedef NativeClang_Type_getSizeOf = ffi.Int64 Function(CXType T); +typedef NativeClang_Type_getSizeOf = pkg_ffi.LongLong Function(CXType T); typedef DartClang_Type_getSizeOf = int Function(CXType T); -typedef NativeClang_Type_getOffsetOf = ffi.Int64 Function( - CXType T, ffi.Pointer S); +typedef NativeClang_Type_getOffsetOf = pkg_ffi.LongLong Function( + CXType T, ffi.Pointer S); typedef DartClang_Type_getOffsetOf = int Function( - CXType T, ffi.Pointer S); + CXType T, ffi.Pointer S); typedef NativeClang_Type_getModifiedType = CXType Function(CXType T); typedef DartClang_Type_getModifiedType = CXType Function(CXType T); -typedef NativeClang_Cursor_getOffsetOfField = ffi.Int64 Function(CXCursor C); +typedef NativeClang_Cursor_getOffsetOfField = pkg_ffi.LongLong Function( + CXCursor C); typedef DartClang_Cursor_getOffsetOfField = int Function(CXCursor C); -typedef NativeClang_Cursor_isAnonymous = ffi.Uint32 Function(CXCursor C); +typedef NativeClang_Cursor_isAnonymous = pkg_ffi.UnsignedInt Function( + CXCursor C); typedef DartClang_Cursor_isAnonymous = int Function(CXCursor C); -typedef NativeClang_Cursor_isAnonymousRecordDecl = ffi.Uint32 Function( +typedef NativeClang_Cursor_isAnonymousRecordDecl = pkg_ffi.UnsignedInt Function( CXCursor C); typedef DartClang_Cursor_isAnonymousRecordDecl = int Function(CXCursor C); -typedef NativeClang_Cursor_isInlineNamespace = ffi.Uint32 Function(CXCursor C); +typedef NativeClang_Cursor_isInlineNamespace = pkg_ffi.UnsignedInt Function( + CXCursor C); typedef DartClang_Cursor_isInlineNamespace = int Function(CXCursor C); -typedef NativeClang_Type_getNumTemplateArguments = ffi.Int32 Function(CXType T); +typedef NativeClang_Type_getNumTemplateArguments = pkg_ffi.Int Function( + CXType T); typedef DartClang_Type_getNumTemplateArguments = int Function(CXType T); typedef NativeClang_Type_getTemplateArgumentAsType = CXType Function( - CXType T, ffi.Uint32 i); + CXType T, pkg_ffi.UnsignedInt i); typedef DartClang_Type_getTemplateArgumentAsType = CXType Function( CXType T, int i); @@ -9683,9 +9715,10 @@ abstract class CXRefQualifierKind { typedef NativeClang_Type_getCXXRefQualifier = ffi.Int32 Function(CXType T); typedef DartClang_Type_getCXXRefQualifier = int Function(CXType T); -typedef NativeClang_Cursor_isBitField = ffi.Uint32 Function(CXCursor C); +typedef NativeClang_Cursor_isBitField = pkg_ffi.UnsignedInt Function( + CXCursor C); typedef DartClang_Cursor_isBitField = int Function(CXCursor C); -typedef NativeClang_isVirtualBase = ffi.Uint32 Function(CXCursor arg0); +typedef NativeClang_isVirtualBase = pkg_ffi.UnsignedInt Function(CXCursor arg0); typedef DartClang_isVirtualBase = int Function(CXCursor arg0); /// Represents the C++ access control level to a base class for a @@ -9715,11 +9748,11 @@ abstract class CX_StorageClass { typedef NativeClang_Cursor_getStorageClass = ffi.Int32 Function(CXCursor arg0); typedef DartClang_Cursor_getStorageClass = int Function(CXCursor arg0); -typedef NativeClang_getNumOverloadedDecls = ffi.Uint32 Function( +typedef NativeClang_getNumOverloadedDecls = pkg_ffi.UnsignedInt Function( CXCursor cursor); typedef DartClang_getNumOverloadedDecls = int Function(CXCursor cursor); typedef NativeClang_getOverloadedDecl = CXCursor Function( - CXCursor cursor, ffi.Uint32 index); + CXCursor cursor, pkg_ffi.UnsignedInt index); typedef DartClang_getOverloadedDecl = CXCursor Function( CXCursor cursor, int index); typedef NativeClang_getIBOutletCollectionType = CXType Function(CXCursor arg0); @@ -9759,40 +9792,44 @@ abstract class CXChildVisitResult { /// Opaque pointer representing client data that will be passed through /// to various callbacks and visitors. typedef CXClientData = ffi.Pointer; -typedef NativeClang_visitChildren = ffi.Uint32 Function( +typedef NativeClang_visitChildren = pkg_ffi.UnsignedInt Function( CXCursor parent, CXCursorVisitor visitor, CXClientData client_data); typedef DartClang_visitChildren = int Function( CXCursor parent, CXCursorVisitor visitor, CXClientData client_data); typedef NativeClang_getCursorUSR = CXString Function(CXCursor arg0); typedef DartClang_getCursorUSR = CXString Function(CXCursor arg0); typedef NativeClang_constructUSR_ObjCClass = CXString Function( - ffi.Pointer class_name); + ffi.Pointer class_name); typedef DartClang_constructUSR_ObjCClass = CXString Function( - ffi.Pointer class_name); + ffi.Pointer class_name); typedef NativeClang_constructUSR_ObjCCategory = CXString Function( - ffi.Pointer class_name, ffi.Pointer category_name); + ffi.Pointer class_name, + ffi.Pointer category_name); typedef DartClang_constructUSR_ObjCCategory = CXString Function( - ffi.Pointer class_name, ffi.Pointer category_name); + ffi.Pointer class_name, + ffi.Pointer category_name); typedef NativeClang_constructUSR_ObjCProtocol = CXString Function( - ffi.Pointer protocol_name); + ffi.Pointer protocol_name); typedef DartClang_constructUSR_ObjCProtocol = CXString Function( - ffi.Pointer protocol_name); + ffi.Pointer protocol_name); typedef NativeClang_constructUSR_ObjCIvar = CXString Function( - ffi.Pointer name, CXString classUSR); + ffi.Pointer name, CXString classUSR); typedef DartClang_constructUSR_ObjCIvar = CXString Function( - ffi.Pointer name, CXString classUSR); + ffi.Pointer name, CXString classUSR); typedef NativeClang_constructUSR_ObjCMethod = CXString Function( - ffi.Pointer name, ffi.Uint32 isInstanceMethod, CXString classUSR); + ffi.Pointer name, + pkg_ffi.UnsignedInt isInstanceMethod, + CXString classUSR); typedef DartClang_constructUSR_ObjCMethod = CXString Function( - ffi.Pointer name, int isInstanceMethod, CXString classUSR); + ffi.Pointer name, int isInstanceMethod, CXString classUSR); typedef NativeClang_constructUSR_ObjCProperty = CXString Function( - ffi.Pointer property, CXString classUSR); + ffi.Pointer property, CXString classUSR); typedef DartClang_constructUSR_ObjCProperty = CXString Function( - ffi.Pointer property, CXString classUSR); + ffi.Pointer property, CXString classUSR); typedef NativeClang_getCursorSpelling = CXString Function(CXCursor arg0); typedef DartClang_getCursorSpelling = CXString Function(CXCursor arg0); typedef NativeClang_Cursor_getSpellingNameRange = CXSourceRange Function( - CXCursor arg0, ffi.Uint32 pieceIndex, ffi.Uint32 options); + CXCursor arg0, pkg_ffi.UnsignedInt pieceIndex, pkg_ffi.UnsignedInt options); typedef DartClang_Cursor_getSpellingNameRange = CXSourceRange Function( CXCursor arg0, int pieceIndex, int options); @@ -9833,12 +9870,12 @@ abstract class CXPrintingPolicyProperty { static const int CXPrintingPolicy_LastProperty = 25; } -typedef NativeClang_PrintingPolicy_getProperty = ffi.Uint32 Function( +typedef NativeClang_PrintingPolicy_getProperty = pkg_ffi.UnsignedInt Function( CXPrintingPolicy Policy, ffi.Int32 Property); typedef DartClang_PrintingPolicy_getProperty = int Function( CXPrintingPolicy Policy, int Property); typedef NativeClang_PrintingPolicy_setProperty = ffi.Void Function( - CXPrintingPolicy Policy, ffi.Int32 Property, ffi.Uint32 Value); + CXPrintingPolicy Policy, ffi.Int32 Property, pkg_ffi.UnsignedInt Value); typedef DartClang_PrintingPolicy_setProperty = void Function( CXPrintingPolicy Policy, int Property, int Value); typedef NativeClang_getCursorPrintingPolicy = CXPrintingPolicy Function( @@ -9859,19 +9896,20 @@ typedef NativeClang_getCursorReferenced = CXCursor Function(CXCursor arg0); typedef DartClang_getCursorReferenced = CXCursor Function(CXCursor arg0); typedef NativeClang_getCursorDefinition = CXCursor Function(CXCursor arg0); typedef DartClang_getCursorDefinition = CXCursor Function(CXCursor arg0); -typedef NativeClang_isCursorDefinition = ffi.Uint32 Function(CXCursor arg0); +typedef NativeClang_isCursorDefinition = pkg_ffi.UnsignedInt Function( + CXCursor arg0); typedef DartClang_isCursorDefinition = int Function(CXCursor arg0); typedef NativeClang_getCanonicalCursor = CXCursor Function(CXCursor arg0); typedef DartClang_getCanonicalCursor = CXCursor Function(CXCursor arg0); -typedef NativeClang_Cursor_getObjCSelectorIndex = ffi.Int32 Function( +typedef NativeClang_Cursor_getObjCSelectorIndex = pkg_ffi.Int Function( CXCursor arg0); typedef DartClang_Cursor_getObjCSelectorIndex = int Function(CXCursor arg0); -typedef NativeClang_Cursor_isDynamicCall = ffi.Int32 Function(CXCursor C); +typedef NativeClang_Cursor_isDynamicCall = pkg_ffi.Int Function(CXCursor C); typedef DartClang_Cursor_isDynamicCall = int Function(CXCursor C); typedef NativeClang_Cursor_getReceiverType = CXType Function(CXCursor C); typedef DartClang_Cursor_getReceiverType = CXType Function(CXCursor C); -typedef NativeClang_Cursor_getObjCPropertyAttributes = ffi.Uint32 Function( - CXCursor C, ffi.Uint32 reserved); +typedef NativeClang_Cursor_getObjCPropertyAttributes = pkg_ffi.UnsignedInt + Function(CXCursor C, pkg_ffi.UnsignedInt reserved); typedef DartClang_Cursor_getObjCPropertyAttributes = int Function( CXCursor C, int reserved); typedef NativeClang_Cursor_getObjCPropertyGetterName = CXString Function( @@ -9882,23 +9920,25 @@ typedef NativeClang_Cursor_getObjCPropertySetterName = CXString Function( CXCursor C); typedef DartClang_Cursor_getObjCPropertySetterName = CXString Function( CXCursor C); -typedef NativeClang_Cursor_getObjCDeclQualifiers = ffi.Uint32 Function( +typedef NativeClang_Cursor_getObjCDeclQualifiers = pkg_ffi.UnsignedInt Function( CXCursor C); typedef DartClang_Cursor_getObjCDeclQualifiers = int Function(CXCursor C); -typedef NativeClang_Cursor_isObjCOptional = ffi.Uint32 Function(CXCursor C); +typedef NativeClang_Cursor_isObjCOptional = pkg_ffi.UnsignedInt Function( + CXCursor C); typedef DartClang_Cursor_isObjCOptional = int Function(CXCursor C); -typedef NativeClang_Cursor_isVariadic = ffi.Uint32 Function(CXCursor C); +typedef NativeClang_Cursor_isVariadic = pkg_ffi.UnsignedInt Function( + CXCursor C); typedef DartClang_Cursor_isVariadic = int Function(CXCursor C); -typedef NativeClang_Cursor_isExternalSymbol = ffi.Uint32 Function( +typedef NativeClang_Cursor_isExternalSymbol = pkg_ffi.UnsignedInt Function( CXCursor C, ffi.Pointer language, ffi.Pointer definedIn, - ffi.Pointer isGenerated); + ffi.Pointer isGenerated); typedef DartClang_Cursor_isExternalSymbol = int Function( CXCursor C, ffi.Pointer language, ffi.Pointer definedIn, - ffi.Pointer isGenerated); + ffi.Pointer isGenerated); typedef NativeClang_Cursor_getCommentRange = CXSourceRange Function(CXCursor C); typedef DartClang_Cursor_getCommentRange = CXSourceRange Function(CXCursor C); typedef NativeClang_Cursor_getRawCommentText = CXString Function(CXCursor C); @@ -9936,45 +9976,53 @@ typedef NativeClang_Module_getName = CXString Function(CXModule Module); typedef DartClang_Module_getName = CXString Function(CXModule Module); typedef NativeClang_Module_getFullName = CXString Function(CXModule Module); typedef DartClang_Module_getFullName = CXString Function(CXModule Module); -typedef NativeClang_Module_isSystem = ffi.Int32 Function(CXModule Module); +typedef NativeClang_Module_isSystem = pkg_ffi.Int Function(CXModule Module); typedef DartClang_Module_isSystem = int Function(CXModule Module); -typedef NativeClang_Module_getNumTopLevelHeaders = ffi.Uint32 Function( +typedef NativeClang_Module_getNumTopLevelHeaders = pkg_ffi.UnsignedInt Function( CXTranslationUnit arg0, CXModule Module); typedef DartClang_Module_getNumTopLevelHeaders = int Function( CXTranslationUnit arg0, CXModule Module); typedef NativeClang_Module_getTopLevelHeader = CXFile Function( - CXTranslationUnit arg0, CXModule Module, ffi.Uint32 Index); + CXTranslationUnit arg0, CXModule Module, pkg_ffi.UnsignedInt Index); typedef DartClang_Module_getTopLevelHeader = CXFile Function( CXTranslationUnit arg0, CXModule Module, int Index); -typedef NativeClang_CXXConstructor_isConvertingConstructor = ffi.Uint32 +typedef NativeClang_CXXConstructor_isConvertingConstructor = pkg_ffi.UnsignedInt Function(CXCursor C); typedef DartClang_CXXConstructor_isConvertingConstructor = int Function( CXCursor C); -typedef NativeClang_CXXConstructor_isCopyConstructor = ffi.Uint32 Function( - CXCursor C); +typedef NativeClang_CXXConstructor_isCopyConstructor = pkg_ffi.UnsignedInt + Function(CXCursor C); typedef DartClang_CXXConstructor_isCopyConstructor = int Function(CXCursor C); -typedef NativeClang_CXXConstructor_isDefaultConstructor = ffi.Uint32 Function( - CXCursor C); +typedef NativeClang_CXXConstructor_isDefaultConstructor = pkg_ffi.UnsignedInt + Function(CXCursor C); typedef DartClang_CXXConstructor_isDefaultConstructor = int Function( CXCursor C); -typedef NativeClang_CXXConstructor_isMoveConstructor = ffi.Uint32 Function( - CXCursor C); +typedef NativeClang_CXXConstructor_isMoveConstructor = pkg_ffi.UnsignedInt + Function(CXCursor C); typedef DartClang_CXXConstructor_isMoveConstructor = int Function(CXCursor C); -typedef NativeClang_CXXField_isMutable = ffi.Uint32 Function(CXCursor C); +typedef NativeClang_CXXField_isMutable = pkg_ffi.UnsignedInt Function( + CXCursor C); typedef DartClang_CXXField_isMutable = int Function(CXCursor C); -typedef NativeClang_CXXMethod_isDefaulted = ffi.Uint32 Function(CXCursor C); +typedef NativeClang_CXXMethod_isDefaulted = pkg_ffi.UnsignedInt Function( + CXCursor C); typedef DartClang_CXXMethod_isDefaulted = int Function(CXCursor C); -typedef NativeClang_CXXMethod_isPureVirtual = ffi.Uint32 Function(CXCursor C); +typedef NativeClang_CXXMethod_isPureVirtual = pkg_ffi.UnsignedInt Function( + CXCursor C); typedef DartClang_CXXMethod_isPureVirtual = int Function(CXCursor C); -typedef NativeClang_CXXMethod_isStatic = ffi.Uint32 Function(CXCursor C); +typedef NativeClang_CXXMethod_isStatic = pkg_ffi.UnsignedInt Function( + CXCursor C); typedef DartClang_CXXMethod_isStatic = int Function(CXCursor C); -typedef NativeClang_CXXMethod_isVirtual = ffi.Uint32 Function(CXCursor C); +typedef NativeClang_CXXMethod_isVirtual = pkg_ffi.UnsignedInt Function( + CXCursor C); typedef DartClang_CXXMethod_isVirtual = int Function(CXCursor C); -typedef NativeClang_CXXRecord_isAbstract = ffi.Uint32 Function(CXCursor C); +typedef NativeClang_CXXRecord_isAbstract = pkg_ffi.UnsignedInt Function( + CXCursor C); typedef DartClang_CXXRecord_isAbstract = int Function(CXCursor C); -typedef NativeClang_EnumDecl_isScoped = ffi.Uint32 Function(CXCursor C); +typedef NativeClang_EnumDecl_isScoped = pkg_ffi.UnsignedInt Function( + CXCursor C); typedef DartClang_EnumDecl_isScoped = int Function(CXCursor C); -typedef NativeClang_CXXMethod_isConst = ffi.Uint32 Function(CXCursor C); +typedef NativeClang_CXXMethod_isConst = pkg_ffi.UnsignedInt Function( + CXCursor C); typedef DartClang_CXXMethod_isConst = int Function(CXCursor C); typedef NativeClang_getTemplateCursorKind = ffi.Int32 Function(CXCursor C); typedef DartClang_getTemplateCursorKind = int Function(CXCursor C); @@ -9982,14 +10030,14 @@ typedef NativeClang_getSpecializedCursorTemplate = CXCursor Function( CXCursor C); typedef DartClang_getSpecializedCursorTemplate = CXCursor Function(CXCursor C); typedef NativeClang_getCursorReferenceNameRange = CXSourceRange Function( - CXCursor C, ffi.Uint32 NameFlags, ffi.Uint32 PieceIndex); + CXCursor C, pkg_ffi.UnsignedInt NameFlags, pkg_ffi.UnsignedInt PieceIndex); typedef DartClang_getCursorReferenceNameRange = CXSourceRange Function( CXCursor C, int NameFlags, int PieceIndex); /// Describes a single preprocessing token. class CXToken extends ffi.Struct { @ffi.Array.multi([4]) - external ffi.Array int_data; + external ffi.Array int_data; external ffi.Pointer ptr_data; } @@ -10035,48 +10083,48 @@ typedef NativeClang_tokenize = ffi.Void Function( CXTranslationUnit TU, CXSourceRange Range, ffi.Pointer> Tokens, - ffi.Pointer NumTokens); + ffi.Pointer NumTokens); typedef DartClang_tokenize = void Function( CXTranslationUnit TU, CXSourceRange Range, ffi.Pointer> Tokens, - ffi.Pointer NumTokens); + ffi.Pointer NumTokens); typedef NativeClang_annotateTokens = ffi.Void Function( CXTranslationUnit TU, ffi.Pointer Tokens, - ffi.Uint32 NumTokens, + pkg_ffi.UnsignedInt NumTokens, ffi.Pointer Cursors); typedef DartClang_annotateTokens = void Function(CXTranslationUnit TU, ffi.Pointer Tokens, int NumTokens, ffi.Pointer Cursors); -typedef NativeClang_disposeTokens = ffi.Void Function( - CXTranslationUnit TU, ffi.Pointer Tokens, ffi.Uint32 NumTokens); +typedef NativeClang_disposeTokens = ffi.Void Function(CXTranslationUnit TU, + ffi.Pointer Tokens, pkg_ffi.UnsignedInt NumTokens); typedef DartClang_disposeTokens = void Function( CXTranslationUnit TU, ffi.Pointer Tokens, int NumTokens); typedef NativeClang_getCursorKindSpelling = CXString Function(ffi.Int32 Kind); typedef DartClang_getCursorKindSpelling = CXString Function(int Kind); typedef NativeClang_getDefinitionSpellingAndExtent = ffi.Void Function( CXCursor arg0, - ffi.Pointer> startBuf, - ffi.Pointer> endBuf, - ffi.Pointer startLine, - ffi.Pointer startColumn, - ffi.Pointer endLine, - ffi.Pointer endColumn); + ffi.Pointer> startBuf, + ffi.Pointer> endBuf, + ffi.Pointer startLine, + ffi.Pointer startColumn, + ffi.Pointer endLine, + ffi.Pointer endColumn); typedef DartClang_getDefinitionSpellingAndExtent = void Function( CXCursor arg0, - ffi.Pointer> startBuf, - ffi.Pointer> endBuf, - ffi.Pointer startLine, - ffi.Pointer startColumn, - ffi.Pointer endLine, - ffi.Pointer endColumn); + ffi.Pointer> startBuf, + ffi.Pointer> endBuf, + ffi.Pointer startLine, + ffi.Pointer startColumn, + ffi.Pointer endLine, + ffi.Pointer endColumn); typedef NativeClang_enableStackTraces = ffi.Void Function(); typedef DartClang_enableStackTraces = void Function(); typedef NativeClang_executeOnThread = ffi.Void Function( ffi.Pointer)>> fn, ffi.Pointer user_data, - ffi.Uint32 stack_size); + pkg_ffi.UnsignedInt stack_size); typedef DartClang_executeOnThread = void Function( ffi.Pointer)>> fn, @@ -10262,22 +10310,23 @@ abstract class CXCompletionChunkKind { } typedef NativeClang_getCompletionChunkKind = ffi.Int32 Function( - CXCompletionString completion_string, ffi.Uint32 chunk_number); + CXCompletionString completion_string, pkg_ffi.UnsignedInt chunk_number); typedef DartClang_getCompletionChunkKind = int Function( CXCompletionString completion_string, int chunk_number); typedef NativeClang_getCompletionChunkText = CXString Function( - CXCompletionString completion_string, ffi.Uint32 chunk_number); + CXCompletionString completion_string, pkg_ffi.UnsignedInt chunk_number); typedef DartClang_getCompletionChunkText = CXString Function( CXCompletionString completion_string, int chunk_number); -typedef NativeClang_getCompletionChunkCompletionString = CXCompletionString - Function(CXCompletionString completion_string, ffi.Uint32 chunk_number); +typedef NativeClang_getCompletionChunkCompletionString + = CXCompletionString Function( + CXCompletionString completion_string, pkg_ffi.UnsignedInt chunk_number); typedef DartClang_getCompletionChunkCompletionString = CXCompletionString Function(CXCompletionString completion_string, int chunk_number); -typedef NativeClang_getNumCompletionChunks = ffi.Uint32 Function( +typedef NativeClang_getNumCompletionChunks = pkg_ffi.UnsignedInt Function( CXCompletionString completion_string); typedef DartClang_getNumCompletionChunks = int Function( CXCompletionString completion_string); -typedef NativeClang_getCompletionPriority = ffi.Uint32 Function( +typedef NativeClang_getCompletionPriority = pkg_ffi.UnsignedInt Function( CXCompletionString completion_string); typedef DartClang_getCompletionPriority = int Function( CXCompletionString completion_string); @@ -10285,12 +10334,13 @@ typedef NativeClang_getCompletionAvailability = ffi.Int32 Function( CXCompletionString completion_string); typedef DartClang_getCompletionAvailability = int Function( CXCompletionString completion_string); -typedef NativeClang_getCompletionNumAnnotations = ffi.Uint32 Function( +typedef NativeClang_getCompletionNumAnnotations = pkg_ffi.UnsignedInt Function( CXCompletionString completion_string); typedef DartClang_getCompletionNumAnnotations = int Function( CXCompletionString completion_string); typedef NativeClang_getCompletionAnnotation = CXString Function( - CXCompletionString completion_string, ffi.Uint32 annotation_number); + CXCompletionString completion_string, + pkg_ffi.UnsignedInt annotation_number); typedef DartClang_getCompletionAnnotation = CXString Function( CXCompletionString completion_string, int annotation_number); typedef NativeClang_getCompletionParent = CXString Function( @@ -10317,69 +10367,70 @@ class CXCodeCompleteResults extends ffi.Struct { /// The number of code-completion results stored in the /// \c Results array. - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int NumResults; } -typedef NativeClang_getCompletionNumFixIts = ffi.Uint32 Function( - ffi.Pointer results, ffi.Uint32 completion_index); +typedef NativeClang_getCompletionNumFixIts = pkg_ffi.UnsignedInt Function( + ffi.Pointer results, + pkg_ffi.UnsignedInt completion_index); typedef DartClang_getCompletionNumFixIts = int Function( ffi.Pointer results, int completion_index); typedef NativeClang_getCompletionFixIt = CXString Function( ffi.Pointer results, - ffi.Uint32 completion_index, - ffi.Uint32 fixit_index, + pkg_ffi.UnsignedInt completion_index, + pkg_ffi.UnsignedInt fixit_index, ffi.Pointer replacement_range); typedef DartClang_getCompletionFixIt = CXString Function( ffi.Pointer results, int completion_index, int fixit_index, ffi.Pointer replacement_range); -typedef NativeClang_defaultCodeCompleteOptions = ffi.Uint32 Function(); +typedef NativeClang_defaultCodeCompleteOptions = pkg_ffi.UnsignedInt Function(); typedef DartClang_defaultCodeCompleteOptions = int Function(); typedef NativeClang_codeCompleteAt = ffi.Pointer Function( CXTranslationUnit TU, - ffi.Pointer complete_filename, - ffi.Uint32 complete_line, - ffi.Uint32 complete_column, + ffi.Pointer complete_filename, + pkg_ffi.UnsignedInt complete_line, + pkg_ffi.UnsignedInt complete_column, ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options); + pkg_ffi.UnsignedInt num_unsaved_files, + pkg_ffi.UnsignedInt options); typedef DartClang_codeCompleteAt = ffi.Pointer Function( CXTranslationUnit TU, - ffi.Pointer complete_filename, + ffi.Pointer complete_filename, int complete_line, int complete_column, ffi.Pointer unsaved_files, int num_unsaved_files, int options); typedef NativeClang_sortCodeCompletionResults = ffi.Void Function( - ffi.Pointer Results, ffi.Uint32 NumResults); + ffi.Pointer Results, pkg_ffi.UnsignedInt NumResults); typedef DartClang_sortCodeCompletionResults = void Function( ffi.Pointer Results, int NumResults); typedef NativeClang_disposeCodeCompleteResults = ffi.Void Function( ffi.Pointer Results); typedef DartClang_disposeCodeCompleteResults = void Function( ffi.Pointer Results); -typedef NativeClang_codeCompleteGetNumDiagnostics = ffi.Uint32 Function( - ffi.Pointer Results); +typedef NativeClang_codeCompleteGetNumDiagnostics = pkg_ffi.UnsignedInt + Function(ffi.Pointer Results); typedef DartClang_codeCompleteGetNumDiagnostics = int Function( ffi.Pointer Results); typedef NativeClang_codeCompleteGetDiagnostic = CXDiagnostic Function( - ffi.Pointer Results, ffi.Uint32 Index); + ffi.Pointer Results, pkg_ffi.UnsignedInt Index); typedef DartClang_codeCompleteGetDiagnostic = CXDiagnostic Function( ffi.Pointer Results, int Index); -typedef NativeClang_codeCompleteGetContexts = ffi.Uint64 Function( +typedef NativeClang_codeCompleteGetContexts = pkg_ffi.UnsignedLongLong Function( ffi.Pointer Results); typedef DartClang_codeCompleteGetContexts = int Function( ffi.Pointer Results); typedef NativeClang_codeCompleteGetContainerKind = ffi.Int32 Function( ffi.Pointer Results, - ffi.Pointer IsIncomplete); + ffi.Pointer IsIncomplete); typedef DartClang_codeCompleteGetContainerKind = int Function( ffi.Pointer Results, - ffi.Pointer IsIncomplete); + ffi.Pointer IsIncomplete); typedef NativeClang_codeCompleteGetContainerUSR = CXString Function( ffi.Pointer Results); typedef DartClang_codeCompleteGetContainerUSR = CXString Function( @@ -10391,7 +10442,7 @@ typedef DartClang_codeCompleteGetObjCSelector = CXString Function( typedef NativeClang_getClangVersion = CXString Function(); typedef DartClang_getClangVersion = CXString Function(); typedef NativeClang_toggleCrashRecovery = ffi.Void Function( - ffi.Uint32 isEnabled); + pkg_ffi.UnsignedInt isEnabled); typedef DartClang_toggleCrashRecovery = void Function(int isEnabled); /// Visitor invoked for each file in a translation unit @@ -10405,8 +10456,8 @@ typedef DartClang_toggleCrashRecovery = void Function(int isEnabled); /// the first element refers to the location that included 'included_file'. typedef CXInclusionVisitor = ffi.Pointer< ffi.NativeFunction< - ffi.Void Function( - CXFile, ffi.Pointer, ffi.Uint32, CXClientData)>>; + ffi.Void Function(CXFile, ffi.Pointer, + pkg_ffi.UnsignedInt, CXClientData)>>; typedef NativeClang_getInclusions = ffi.Void Function( CXTranslationUnit tu, CXInclusionVisitor visitor, CXClientData client_data); typedef DartClang_getInclusions = void Function( @@ -10429,23 +10480,23 @@ abstract class CXEvalResultKind { typedef NativeClang_EvalResult_getKind = ffi.Int32 Function(CXEvalResult E); typedef DartClang_EvalResult_getKind = int Function(CXEvalResult E); -typedef NativeClang_EvalResult_getAsInt = ffi.Int32 Function(CXEvalResult E); +typedef NativeClang_EvalResult_getAsInt = pkg_ffi.Int Function(CXEvalResult E); typedef DartClang_EvalResult_getAsInt = int Function(CXEvalResult E); -typedef NativeClang_EvalResult_getAsLongLong = ffi.Int64 Function( +typedef NativeClang_EvalResult_getAsLongLong = pkg_ffi.LongLong Function( CXEvalResult E); typedef DartClang_EvalResult_getAsLongLong = int Function(CXEvalResult E); -typedef NativeClang_EvalResult_isUnsignedInt = ffi.Uint32 Function( +typedef NativeClang_EvalResult_isUnsignedInt = pkg_ffi.UnsignedInt Function( CXEvalResult E); typedef DartClang_EvalResult_isUnsignedInt = int Function(CXEvalResult E); -typedef NativeClang_EvalResult_getAsUnsigned = ffi.Uint64 Function( - CXEvalResult E); +typedef NativeClang_EvalResult_getAsUnsigned = pkg_ffi.UnsignedLongLong + Function(CXEvalResult E); typedef DartClang_EvalResult_getAsUnsigned = int Function(CXEvalResult E); typedef NativeClang_EvalResult_getAsDouble = ffi.Double Function( CXEvalResult E); typedef DartClang_EvalResult_getAsDouble = double Function(CXEvalResult E); -typedef NativeClang_EvalResult_getAsStr = ffi.Pointer Function( +typedef NativeClang_EvalResult_getAsStr = ffi.Pointer Function( CXEvalResult E); -typedef DartClang_EvalResult_getAsStr = ffi.Pointer Function( +typedef DartClang_EvalResult_getAsStr = ffi.Pointer Function( CXEvalResult E); typedef NativeClang_EvalResult_dispose = ffi.Void Function(CXEvalResult E); typedef DartClang_EvalResult_dispose = void Function(CXEvalResult E); @@ -10453,18 +10504,20 @@ typedef DartClang_EvalResult_dispose = void Function(CXEvalResult E); /// A remapping of original source files and their translated files. typedef CXRemapping = ffi.Pointer; typedef NativeClang_getRemappings = CXRemapping Function( - ffi.Pointer path); + ffi.Pointer path); typedef DartClang_getRemappings = CXRemapping Function( - ffi.Pointer path); + ffi.Pointer path); typedef NativeClang_getRemappingsFromFileList = CXRemapping Function( - ffi.Pointer> filePaths, ffi.Uint32 numFiles); + ffi.Pointer> filePaths, + pkg_ffi.UnsignedInt numFiles); typedef DartClang_getRemappingsFromFileList = CXRemapping Function( - ffi.Pointer> filePaths, int numFiles); -typedef NativeClang_remap_getNumFiles = ffi.Uint32 Function(CXRemapping arg0); + ffi.Pointer> filePaths, int numFiles); +typedef NativeClang_remap_getNumFiles = pkg_ffi.UnsignedInt Function( + CXRemapping arg0); typedef DartClang_remap_getNumFiles = int Function(CXRemapping arg0); typedef NativeClang_remap_getFilenames = ffi.Void Function( CXRemapping arg0, - ffi.Uint32 index, + pkg_ffi.UnsignedInt index, ffi.Pointer original, ffi.Pointer transformed); typedef DartClang_remap_getFilenames = void Function( @@ -10518,7 +10571,7 @@ class CXIdxLoc extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int int_data; } @@ -10528,20 +10581,20 @@ class CXIdxIncludedFileInfo extends ffi.Struct { external CXIdxLoc hashLoc; /// Filename as written in the \#include/\#import directive. - external ffi.Pointer filename; + external ffi.Pointer filename; /// The actual file that the \#include/\#import directive resolved to. external CXFile file; - @ffi.Int32() + @pkg_ffi.Int() external int isImport; - @ffi.Int32() + @pkg_ffi.Int() external int isAngled; /// Non-zero if the directive was automatically turned into a module /// import. - @ffi.Int32() + @pkg_ffi.Int() external int isModuleImport; } @@ -10558,7 +10611,7 @@ class CXIdxImportedASTFileInfo extends ffi.Struct { /// Non-zero if an inclusion directive was automatically turned into /// a module import. Applicable only for modules. - @ffi.Int32() + @pkg_ffi.Int() external int isImplicit; } @@ -10588,15 +10641,15 @@ class CXIdxEntityInfo extends ffi.Struct { @ffi.Int32() external int lang; - external ffi.Pointer name; + external ffi.Pointer name; - external ffi.Pointer USR; + external ffi.Pointer USR; external CXCursor cursor; external ffi.Pointer> attributes; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int numAttributes; } @@ -10680,28 +10733,28 @@ class CXIdxDeclInfo extends ffi.Struct { /// cases like out-of-line C++ member functions. external ffi.Pointer lexicalContainer; - @ffi.Int32() + @pkg_ffi.Int() external int isRedeclaration; - @ffi.Int32() + @pkg_ffi.Int() external int isDefinition; - @ffi.Int32() + @pkg_ffi.Int() 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() + @pkg_ffi.Int() external int isImplicit; external ffi.Pointer> attributes; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int numAttributes; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int flags; } @@ -10737,7 +10790,7 @@ class CXIdxObjCProtocolRefInfo extends ffi.Struct { class CXIdxObjCProtocolRefListInfo extends ffi.Struct { external ffi.Pointer> protocols; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int numProtocols; } @@ -10774,7 +10827,7 @@ class CXIdxCXXClassDeclInfo extends ffi.Struct { external ffi.Pointer> bases; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int numBases; } @@ -10840,7 +10893,7 @@ abstract class CXSymbolRole { static const int CXSymbolRole_Implicit = 256; } -typedef NativeClang_index_isEntityObjCContainerKind = ffi.Int32 Function( +typedef NativeClang_index_isEntityObjCContainerKind = pkg_ffi.Int Function( ffi.Int32 arg0); typedef DartClang_index_isEntityObjCContainerKind = int Function(int arg0); typedef NativeClang_index_getObjCContainerDeclInfo @@ -10922,8 +10975,9 @@ 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< - ffi.NativeFunction< - ffi.Int32 Function(CXClientData, ffi.Pointer)>> abortQuery; + ffi.NativeFunction< + pkg_ffi.Int Function(CXClientData, ffi.Pointer)>> + abortQuery; /// Called at the end of indexing; passes the complete diagnostic set. external ffi.Pointer< @@ -10980,64 +11034,64 @@ typedef CXIdxClientFile = ffi.Pointer; /// The client's data object that is associated with an AST file (PCH /// or module). typedef CXIdxClientASTFile = ffi.Pointer; -typedef NativeClang_indexSourceFile = ffi.Int32 Function( +typedef NativeClang_indexSourceFile = pkg_ffi.Int Function( CXIndexAction arg0, CXClientData client_data, ffi.Pointer index_callbacks, - ffi.Uint32 index_callbacks_size, - ffi.Uint32 index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, + pkg_ffi.UnsignedInt index_callbacks_size, + pkg_ffi.UnsignedInt index_options, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + pkg_ffi.Int num_command_line_args, ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, + pkg_ffi.UnsignedInt num_unsaved_files, ffi.Pointer out_TU, - ffi.Uint32 TU_options); + pkg_ffi.UnsignedInt TU_options); typedef DartClang_indexSourceFile = int Function( CXIndexAction arg0, CXClientData client_data, ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + 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); -typedef NativeClang_indexSourceFileFullArgv = ffi.Int32 Function( +typedef NativeClang_indexSourceFileFullArgv = pkg_ffi.Int Function( CXIndexAction arg0, CXClientData client_data, ffi.Pointer index_callbacks, - ffi.Uint32 index_callbacks_size, - ffi.Uint32 index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, + pkg_ffi.UnsignedInt index_callbacks_size, + pkg_ffi.UnsignedInt index_options, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + pkg_ffi.Int num_command_line_args, ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, + pkg_ffi.UnsignedInt num_unsaved_files, ffi.Pointer out_TU, - ffi.Uint32 TU_options); + pkg_ffi.UnsignedInt TU_options); typedef DartClang_indexSourceFileFullArgv = int Function( CXIndexAction arg0, CXClientData client_data, ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + 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); -typedef NativeClang_indexTranslationUnit = ffi.Int32 Function( +typedef NativeClang_indexTranslationUnit = pkg_ffi.Int Function( CXIndexAction arg0, CXClientData client_data, ffi.Pointer index_callbacks, - ffi.Uint32 index_callbacks_size, - ffi.Uint32 index_options, + pkg_ffi.UnsignedInt index_callbacks_size, + pkg_ffi.UnsignedInt index_options, CXTranslationUnit arg5); typedef DartClang_indexTranslationUnit = int Function( CXIndexAction arg0, @@ -11050,16 +11104,16 @@ typedef NativeClang_indexLoc_getFileLocation = ffi.Void Function( CXIdxLoc loc, ffi.Pointer indexFile, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset); + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef DartClang_indexLoc_getFileLocation = void Function( CXIdxLoc loc, ffi.Pointer indexFile, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset); + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef NativeClang_indexLoc_getCXSourceLocation = CXSourceLocation Function( CXIdxLoc loc); typedef DartClang_indexLoc_getCXSourceLocation = CXSourceLocation Function( @@ -11076,7 +11130,7 @@ typedef DartClang_indexLoc_getCXSourceLocation = CXSourceLocation Function( /// to direct \c clang_Type_visitFields. typedef CXFieldVisitor = ffi .Pointer>; -typedef NativeClang_Type_visitFields = ffi.Uint32 Function( +typedef NativeClang_Type_visitFields = pkg_ffi.UnsignedInt Function( CXType T, CXFieldVisitor visitor, CXClientData client_data); typedef DartClang_Type_visitFields = int Function( CXType T, CXFieldVisitor visitor, CXClientData client_data); diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index f10498b56d..677e3c91f0 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -5,8 +5,10 @@ name: libclang_example environment: - sdk: '>=2.13.0 <3.0.0' + sdk: '>=2.16.0-124.0.dev <3.0.0' +dependencies: + ffi: ^1.2.0-dev.0 dev_dependencies: ffigen: path: '../../' @@ -51,25 +53,30 @@ ffigen: - 'CXTypeKind' # Full names are given higher priority than regexp. - 'CXGlobalOptFlags' - # These are optional and also default, - # Omitting any and the default will be used. - size-map: - char: 1 - unsigned char: 1 - short: 2 - unsigned short: 2 - int: 4 - unsigned int: 4 - long: 8 - unsigned long: 8 - long long: 8 - unsigned long long: 8 - enum: 4 + library-imports: + custom_import: 'custom_import.dart' # These can be used to map any typedef to a specific native type. - typedef-map: - 'size_t': 'IntPtr' - 'time_t': 'Int64' + type-map: + typedefs: + 'size_t': + lib: 'pkg_ffi' + c-type: 'Size' + dart-type: 'int' + 'time_t': + lib: 'ffi' + c-type: 'Int64' + dart-type: 'int' + native-types: + 'unsigned long': + lib: 'custom_import' + c-type: 'UnsignedLong' + dart-type: 'int' + structs: + 'CXCursorSetImpl': + lib: 'custom_import' + c-type: 'CXCursorSetImpl' + dart-type: 'CXCursorSetImpl' # Default is 'NativeLibrary' name: 'LibClang' diff --git a/pkgs/ffigen/example/simple/generated_bindings.dart b/pkgs/ffigen/example/simple/generated_bindings.dart index 66854389c5..60c8a127e4 100644 --- a/pkgs/ffigen/example/simple/generated_bindings.dart +++ b/pkgs/ffigen/example/simple/generated_bindings.dart @@ -2,6 +2,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; /// Bindings to `headers/example.h`. class NativeLibrary { @@ -30,14 +31,14 @@ class NativeLibrary { ); } - late final _sumPtr = - _lookup>( - 'sum'); + late final _sumPtr = _lookup< + ffi.NativeFunction>( + 'sum'); late final _sum = _sumPtr.asFunction(); /// Subtracts 2 integers. int subtract( - ffi.Pointer a, + ffi.Pointer a, int b, ) { return _subtract( @@ -48,12 +49,13 @@ class NativeLibrary { late final _subtractPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32)>>('subtract'); + pkg_ffi.Int Function( + ffi.Pointer, pkg_ffi.Int)>>('subtract'); late final _subtract = - _subtractPtr.asFunction, int)>(); + _subtractPtr.asFunction, int)>(); /// Multiplies 2 integers, returns pointer to an integer,. - ffi.Pointer multiply( + ffi.Pointer multiply( int a, int b, ) { @@ -65,9 +67,10 @@ class NativeLibrary { late final _multiplyPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Int32, ffi.Int32)>>('multiply'); + ffi.Pointer Function( + pkg_ffi.Int, pkg_ffi.Int)>>('multiply'); late final _multiply = - _multiplyPtr.asFunction Function(int, int)>(); + _multiplyPtr.asFunction Function(int, int)>(); /// Divides 2 integers, returns pointer to a float. ffi.Pointer divide( @@ -82,7 +85,7 @@ class NativeLibrary { late final _dividePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Int32, ffi.Int32)>>('divide'); + ffi.Pointer Function(pkg_ffi.Int, pkg_ffi.Int)>>('divide'); late final _divide = _dividePtr.asFunction Function(int, int)>(); diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index e419d1c9db..b7b8823c0f 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -7,6 +7,8 @@ name: simple_example environment: sdk: '>=2.12.0 <3.0.0' +dependencies: + ffi: ^1.2.0-dev.0 dev_dependencies: ffigen: path: '../../' diff --git a/pkgs/ffigen/lib/src/code_generator.dart b/pkgs/ffigen/lib/src/code_generator.dart index 710b32fad3..0e175e68d8 100644 --- a/pkgs/ffigen/lib/src/code_generator.dart +++ b/pkgs/ffigen/lib/src/code_generator.dart @@ -11,6 +11,7 @@ export 'code_generator/constant.dart'; export 'code_generator/enum_class.dart'; export 'code_generator/func.dart'; export 'code_generator/global.dart'; +export 'code_generator/imports.dart'; export 'code_generator/library.dart'; export 'code_generator/struc.dart'; export 'code_generator/type.dart'; diff --git a/pkgs/ffigen/lib/src/code_generator/compound.dart b/pkgs/ffigen/lib/src/code_generator/compound.dart index 8bdee9bb7e..067e64fe3e 100644 --- a/pkgs/ffigen/lib/src/code_generator/compound.dart +++ b/pkgs/ffigen/lib/src/code_generator/compound.dart @@ -4,9 +4,7 @@ import 'package:ffigen/src/code_generator.dart'; -import 'binding.dart'; import 'binding_string.dart'; -import 'type.dart'; import 'utils.dart'; import 'writer.dart'; diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index 425ee47e54..d33f135d82 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -4,9 +4,7 @@ import 'package:ffigen/src/code_generator.dart'; -import 'binding.dart'; import 'binding_string.dart'; -import 'type.dart'; import 'utils.dart'; import 'writer.dart'; diff --git a/pkgs/ffigen/lib/src/code_generator/imports.dart b/pkgs/ffigen/lib/src/code_generator/imports.dart new file mode 100644 index 0000000000..7a92aa30e1 --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/imports.dart @@ -0,0 +1,55 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// A library import which will be written as an import in the generated file. +class LibraryImport { + final String name; + final String importPath; + String prefix; + + LibraryImport(this.name, this.importPath) : prefix = name; + + @override + bool operator ==(other) { + return other is LibraryImport && name == other.name; + } + + @override + int get hashCode => name.hashCode; +} + +/// An imported type which will be used in the generated code. +class ImportedType { + final LibraryImport libraryImport; + final String cType; + final String dartType; + + ImportedType(this.libraryImport, this.cType, this.dartType); +} + +final ffiImport = LibraryImport('ffi', 'dart:ffi'); +final ffiPkgImport = LibraryImport('pkg_ffi', 'package:ffi/ffi.dart'); + +final voidType = ImportedType(ffiImport, 'Void', 'void'); + +final unsignedCharType = ImportedType(ffiPkgImport, 'UnsignedChar', 'int'); +final signedCharType = ImportedType(ffiPkgImport, 'SignedChar', 'int'); +final charType = ImportedType(ffiPkgImport, 'Char', 'int'); +final unsignedShortType = ImportedType(ffiPkgImport, 'UnsignedShort', 'int'); +final shortType = ImportedType(ffiPkgImport, 'Short', 'int'); +final unsignedIntType = ImportedType(ffiPkgImport, 'UnsignedInt', 'int'); +final intType = ImportedType(ffiPkgImport, 'Int', 'int'); +final unsignedLongType = ImportedType(ffiPkgImport, 'UnsignedLong', 'int'); +final longType = ImportedType(ffiPkgImport, 'Long', 'int'); +final unsignedLongLongType = + ImportedType(ffiPkgImport, 'UnsignedLongLong', 'int'); +final longLongType = ImportedType(ffiPkgImport, 'LongLong', 'int'); + +final floatType = ImportedType(ffiImport, 'Float', 'double'); +final doubleType = ImportedType(ffiImport, 'Double', 'double'); + +final sizeType = ImportedType(ffiPkgImport, 'Size', 'Size'); +final sSizeType = ImportedType(ffiPkgImport, 'SSize', 'SSize'); +final offType = ImportedType(ffiPkgImport, 'Off', 'Off'); +final wCharType = ImportedType(ffiPkgImport, 'WChar', 'WChar'); diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index 080f09909e..20c0e24a3a 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -6,9 +6,11 @@ import 'dart:io'; import 'package:cli_util/cli_util.dart'; import 'package:ffigen/src/config_provider/config_types.dart'; +import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:path/path.dart' as p; import 'binding.dart'; +import 'imports.dart'; import 'struc.dart'; import 'utils.dart'; import 'writer.dart'; @@ -31,6 +33,7 @@ class Library { bool dartBool = true, bool sort = false, StructPackingOverride? packingOverride, + Set? libraryImports, }) { /// Get all dependencies (includes itself). final dependencies = {}; @@ -67,6 +70,13 @@ class Library { final noLookUpBindings = this.bindings.whereType().toList(); + // Add predefined imports. + final _libraryImports = {}; + _libraryImports.addAll(strings.predefinedLibraryImports.values); + if (libraryImports != null) { + _libraryImports.addAll(libraryImports); + } + _writer = Writer( lookUpBindings: lookUpBindings, noLookUpBindings: noLookUpBindings, @@ -74,6 +84,7 @@ class Library { classDocComment: description, header: header, dartBool: dartBool, + libraryImports: _libraryImports, ); } diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index e442a63267..b70b4ecddb 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -4,8 +4,6 @@ import 'package:ffigen/src/code_generator.dart'; -import 'compound.dart'; -import 'typealias.dart'; import 'writer.dart'; class _SubType { @@ -42,6 +40,9 @@ enum BroadType { /// Represents a function type. FunctionType, + /// Represents an imported type. + ImportedType, + /// Represents a typealias. Typealias, @@ -94,6 +95,9 @@ class Type { /// Reference to the [EnumClass] this type refers to. EnumClass? enumClass; + /// Reference to the [ImportedType] this type refers to. + ImportedType? importedType; + /// For providing [SupportedNativeType] only. final SupportedNativeType? nativeType; @@ -118,6 +122,7 @@ class Type { this.nativeFunc, this.typealias, this.functionType, + this.importedType, this.length, this.unimplementedReason, }); @@ -141,6 +146,10 @@ class Type { return Type._( broadType: BroadType.FunctionType, functionType: functionType); } + factory Type.importedType(ImportedType importedType) { + return Type._( + broadType: BroadType.ImportedType, importedType: importedType); + } factory Type.nativeFunc(NativeFunc nativeFunc) { return Type._(broadType: BroadType.NativeFunction, nativeFunc: nativeFunc); } @@ -272,6 +281,8 @@ class Type { return '${w.ffiLibraryPrefix}.Handle'; case BroadType.FunctionType: return functionType!.getCType(w); + case BroadType.ImportedType: + return '${importedType!.libraryImport.prefix}.${importedType!.cType}'; case BroadType.Typealias: return typealias!.name; case BroadType.Unimplemented: @@ -303,6 +314,12 @@ class Type { return 'Object'; case BroadType.FunctionType: return functionType!.getDartType(w); + case BroadType.ImportedType: + if (importedType!.cType == importedType!.dartType) { + return getCType(w); + } else { + return importedType!.dartType; + } case BroadType.Typealias: // Typealias cannot be used by name in Dart types unless both the C and // Dart type of the underlying types are same. diff --git a/pkgs/ffigen/lib/src/code_generator/typealias.dart b/pkgs/ffigen/lib/src/code_generator/typealias.dart index 7320957628..ea8ef9597c 100644 --- a/pkgs/ffigen/lib/src/code_generator/typealias.dart +++ b/pkgs/ffigen/lib/src/code_generator/typealias.dart @@ -5,7 +5,6 @@ import 'package:ffigen/src/code_generator.dart'; import 'binding_string.dart'; -import 'type.dart'; import 'utils.dart'; import 'writer.dart'; diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index 2b9a0c9636..0fd7515757 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -2,6 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:ffigen/src/code_generator/imports.dart'; import 'package:ffigen/src/code_generator/utils.dart'; import 'binding.dart'; @@ -22,8 +23,15 @@ class Writer { late String _className; final String? classDocComment; - late String _ffiLibraryPrefix; - String get ffiLibraryPrefix => _ffiLibraryPrefix; + String? _ffiLibraryPrefix; + String get ffiLibraryPrefix { + _ffiLibraryPrefix ??= libraryImports + .firstWhere((element) => element.name == ffiImport.name) + .prefix; + return _ffiLibraryPrefix!; + } + + final Set libraryImports; late String _lookupFuncIdentifier; String get lookupFuncIdentifier => _lookupFuncIdentifier; @@ -55,6 +63,7 @@ class Writer { required this.noLookUpBindings, required String className, required this.dartBool, + required this.libraryImports, this.classDocComment, this.header, }) { @@ -75,12 +84,17 @@ class Writer { markUsed: [_initialWrapperLevelUniqueNamer, _initialTopLevelUniqueNamer], ); - /// [_ffiLibraryPrefix] should be unique unique among all names. - _ffiLibraryPrefix = _resolveNameConflict( - name: 'ffi', - makeUnique: allLevelsUniqueNamer, - markUsed: [_initialWrapperLevelUniqueNamer, _initialTopLevelUniqueNamer], - ); + /// Library imports prefix should be unique unique among all names. + for (final lib in libraryImports) { + lib.prefix = _resolveNameConflict( + name: lib.prefix, + makeUnique: allLevelsUniqueNamer, + markUsed: [ + _initialWrapperLevelUniqueNamer, + _initialTopLevelUniqueNamer + ], + ); + } /// [_lookupFuncIdentifier] should be unique in top level. _lookupFuncIdentifier = _resolveNameConflict( @@ -161,8 +175,10 @@ class Writer { 'AUTO GENERATED FILE, DO NOT EDIT.\n\nGenerated by `package:ffigen`.')); // Write neccesary imports. - s.write("import 'dart:ffi' as $ffiLibraryPrefix;\n"); - s.write('\n'); + for (final lib in libraryImports) { + s.write("import '${lib.importPath}' as ${lib.prefix};"); + s.write('\n'); + } /// Write [lookUpBindings]. if (lookUpBindings.isNotEmpty) { diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 88d5d8d994..7acb2c8892 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -5,7 +5,6 @@ /// Validates the yaml input by the user, prints useful info for the user import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/header_parser/type_extractor/cxtypekindmap.dart'; import 'package:logging/logging.dart'; import 'package:yaml/yaml.dart'; @@ -75,10 +74,25 @@ class Config { bool get useSupportedTypedefs => _useSupportedTypedefs; late bool _useSupportedTypedefs; - /// Stores typedef name to NativeType mappings specified by user. - Map get typedefNativeTypeMappings => - _typedefNativeTypeMappings; - late Map _typedefNativeTypeMappings; + /// Stores all the library imports specified by user including those for ffi and pkg_ffi. + Map get libraryImports => _libraryImports; + late Map _libraryImports; + + /// Stores typedef name to ImportedType mappings specified by user. + Map get typedefTypeMappings => _typedefTypeMappings; + late Map _typedefTypeMappings; + + /// Stores struct name to ImportedType mappings specified by user. + Map get structTypeMappings => _structTypeMappings; + late Map _structTypeMappings; + + /// Stores union name to ImportedType mappings specified by user. + Map get unionTypeMappings => _unionTypeMappings; + late Map _unionTypeMappings; + + /// Stores native int name to ImportedType mappings specified by user. + Map get nativeTypeMappings => _nativeTypeMappings; + late Map _nativeTypeMappings; /// Extracted Doc comment type. CommentType get commentType => _commentType; @@ -167,12 +181,7 @@ class Config { } } // Warn about unknown keys. - for (final key in map.keys) { - final specString = specs.keys.map((e) => e.join(':')).toSet(); - if (!specString.contains(key)) { - _logger.warning("Unknown key '$key' found."); - } - } + warnUnknownKeys(specs.keys.toList(), map); return _result; } @@ -305,25 +314,53 @@ class Config { _typedefs = result as Declaration; }, ), - [strings.sizemap]: Specification>( - validator: sizemapValidator, - extractor: sizemapExtractor, - defaultValue: () => {}, + [strings.libraryImports]: Specification>( + validator: libraryImportsValidator, + extractor: libraryImportsExtractor, + defaultValue: () => {}, + extractedResult: (dynamic result) { + _libraryImports = result as Map; + }, + ), + [strings.typeMap, strings.typeMapTypedefs]: + Specification>>( + validator: typeMapValidator, + extractor: typeMapExtractor, + defaultValue: () => >{}, extractedResult: (dynamic result) { - final map = result as Map; - for (final key in map.keys) { - if (cxTypeKindToSupportedNativeTypes.containsKey(key)) { - cxTypeKindToSupportedNativeTypes[key] = map[key]!; - } - } + _typedefTypeMappings = makeImportTypeMapping( + result as Map>, _libraryImports); }, ), - [strings.typedefmap]: Specification>( - validator: typedefmapValidator, - extractor: typedefmapExtractor, - defaultValue: () => {}, - extractedResult: (dynamic result) => _typedefNativeTypeMappings = - result as Map, + [strings.typeMap, strings.typeMapStructs]: + Specification>>( + validator: typeMapValidator, + extractor: typeMapExtractor, + defaultValue: () => >{}, + extractedResult: (dynamic result) { + _structTypeMappings = makeImportTypeMapping( + result as Map>, _libraryImports); + }, + ), + [strings.typeMap, strings.typeMapUnions]: + Specification>>( + validator: typeMapValidator, + extractor: typeMapExtractor, + defaultValue: () => >{}, + extractedResult: (dynamic result) { + _unionTypeMappings = makeImportTypeMapping( + result as Map>, _libraryImports); + }, + ), + [strings.typeMap, strings.typeMapNativeTypes]: + Specification>>( + validator: typeMapValidator, + extractor: typeMapExtractor, + defaultValue: () => >{}, + extractedResult: (dynamic result) { + _nativeTypeMappings = makeImportTypeMapping( + result as Map>, _libraryImports); + }, ), [strings.sort]: Specification( requirement: Requirement.no, diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 22a6e1af54..06899146ad 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -65,69 +65,139 @@ dynamic getKeyValueFromYaml(List key, YamlMap map) { return null; } +/// Recursively checks the keys in [configKeyMap] from [allowedKeyList]. +void warnUnknownKeys(List> allowedKeyList, YamlMap configKeyMap) { + final allowedKeyMap = {}; + for (final specKeys in allowedKeyList) { + var _item = allowedKeyMap; + for (final specSubKey in specKeys) { + _item.putIfAbsent(specSubKey, () => {}); + _item = _item[specSubKey] as Map; + } + // Add empty key to mark that any sub-keys of this key are allowed. + _item[''] = {}; + } + _warnUnknownKeysInMap(allowedKeyMap, configKeyMap, []); +} + +/// Recursive function to check a key set in a configKeyMap. +void _warnUnknownKeysInMap(Map allowedKeyMap, + dynamic configKeyMap, List prev) { + if (allowedKeyMap.containsKey('') || configKeyMap is! YamlMap) { + return; + } + for (final key in configKeyMap.keys) { + if (allowedKeyMap.containsKey(key)) { + prev.add(key); + _warnUnknownKeysInMap( + allowedKeyMap[key] as Map, configKeyMap[key], prev); + prev.removeLast(); + } else { + prev.add(key); + _logger.warning('Unknown key - ${prev.join(' -> ')}.'); + prev.removeLast(); + } + } +} + bool booleanExtractor(dynamic value) => value as bool; bool booleanValidator(List name, dynamic value) => checkType(name, value); -Map sizemapExtractor(dynamic yamlConfig) { - final resultMap = {}; - final sizemap = yamlConfig as YamlMap?; - if (sizemap != null) { - for (final typeName in strings.sizemap_native_mapping.keys) { - if (sizemap.containsKey(typeName)) { - final cxTypeInt = strings.sizemap_native_mapping[typeName] as int; - final byteSize = sizemap[typeName] as int; - resultMap[cxTypeInt] = nativeSupportedType(byteSize, - signed: typeName.contains('unsigned') ? false : true); - } +Map libraryImportsExtractor(dynamic yamlConfig) { + final resultMap = {}; + final typeMap = yamlConfig as YamlMap?; + if (typeMap != null) { + for (final typeName in typeMap.keys) { + resultMap[typeName as String] = + LibraryImport(typeName, typeMap[typeName] as String); } } return resultMap; } -bool sizemapValidator(List name, dynamic yamlConfig) { +bool libraryImportsValidator(List name, dynamic yamlConfig) { if (!checkType(name, yamlConfig)) { return false; } for (final key in (yamlConfig as YamlMap).keys) { - if (!strings.sizemap_native_mapping.containsKey(key)) { - _logger.warning("Unknown subkey '$key' in '$name'."); + if (!checkType([...name, key as String], yamlConfig[key])) { + return false; + } + if (strings.predefinedLibraryImports.containsKey(key)) { + _logger.severe( + 'library-import -> $key should not collide with any predefined imports - ${strings.predefinedLibraryImports.keys}.'); + return false; } } - return true; } -Map typedefmapExtractor(dynamic yamlConfig) { - final resultMap = {}; - final typedefmap = yamlConfig as YamlMap?; - if (typedefmap != null) { - for (final typeName in typedefmap.keys) { - if (typedefmap[typeName] is String && - strings.supportedNativeType_mappings - .containsKey(typedefmap[typeName])) { - // Map this typename to specified supportedNativeType. - resultMap[typeName as String] = - strings.supportedNativeType_mappings[typedefmap[typeName]]!; - } +Map> typeMapExtractor(dynamic yamlConfig) { + // Key - type_name, Value - [lib, cType, dartType]. + final resultMap = >{}; + final typeMap = yamlConfig as YamlMap?; + if (typeMap != null) { + for (final typeName in typeMap.keys) { + final typeConfigItem = typeMap[typeName] as YamlMap; + resultMap[typeName as String] = [ + typeConfigItem[strings.lib] as String, + typeConfigItem[strings.cType] as String, + typeConfigItem[strings.dartType] as String, + ]; } } return resultMap; } -bool typedefmapValidator(List name, dynamic yamlConfig) { +bool typeMapValidator(List name, dynamic yamlConfig) { if (!checkType(name, yamlConfig)) { return false; } - for (final value in (yamlConfig as YamlMap).values) { - if (value is! String || - !strings.supportedNativeType_mappings.containsKey(value)) { - _logger.severe("Unknown value of subkey '$value' in '$name'."); + var result = true; + for (final key in (yamlConfig as YamlMap).keys) { + if (!checkType([...name, key as String], yamlConfig[key])) { + return false; + } + final lib = (yamlConfig[key] as YamlMap).containsKey(strings.lib); + if (!lib) { + _logger.severe("Key '${strings.lib}' in $name -> $key is required."); + result = false; + } + final cType = (yamlConfig[key] as YamlMap).containsKey(strings.cType); + if (!cType) { + _logger.severe("Key '${strings.cType}' in $name -> $key is required."); + result = false; + } + final dartType = (yamlConfig[key] as YamlMap).containsKey(strings.dartType); + if (!dartType) { + _logger.severe("Key '${strings.dartType}' in $name -> $key is required."); + result = false; } } + return result; +} - return true; +Map makeImportTypeMapping( + Map> rawTypeMappings, + Map libraryImportsMap) { + final typeMappings = {}; + for (final key in rawTypeMappings.keys) { + final lib = rawTypeMappings[key]![0]; + final cType = rawTypeMappings[key]![1]; + final dartType = rawTypeMappings[key]![2]; + if (strings.predefinedLibraryImports.containsKey(lib)) { + typeMappings[key] = + ImportedType(strings.predefinedLibraryImports[lib]!, cType, dartType); + } else if (libraryImportsMap.containsKey(lib)) { + typeMappings[key] = + ImportedType(libraryImportsMap[lib]!, cType, dartType); + } else { + throw Exception("Please declare $lib under library-imports."); + } + } + return typeMappings; } final _quoteMatcher = RegExp(r'''^["'](.*)["']$''', dotAll: true); diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index abfad7f2ef..2c0c33feb6 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -9,6 +9,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; /// Holds bindings to LibClang. class Clang { @@ -26,7 +27,7 @@ class Clang { : _lookup = lookup; /// Retrieve the character data associated with the given string. - ffi.Pointer clang_getCString( + ffi.Pointer clang_getCString( CXString string, ) { return _clang_getCString( @@ -35,10 +36,10 @@ class Clang { } late final _clang_getCStringPtr = - _lookup Function(CXString)>>( + _lookup Function(CXString)>>( 'clang_getCString'); late final _clang_getCString = _clang_getCStringPtr - .asFunction Function(CXString)>(); + .asFunction Function(CXString)>(); /// Free the given string. void clang_disposeString( @@ -104,7 +105,7 @@ class Clang { } late final _clang_createIndexPtr = - _lookup>( + _lookup>( 'clang_createIndex'); late final _clang_createIndex = _clang_createIndexPtr.asFunction(); @@ -157,7 +158,7 @@ class Clang { late final _clang_equalRangesPtr = _lookup< ffi.NativeFunction< - ffi.Uint32 Function( + pkg_ffi.UnsignedInt Function( CXSourceRange, CXSourceRange)>>('clang_equalRanges'); late final _clang_equalRanges = _clang_equalRangesPtr .asFunction(); @@ -186,9 +187,9 @@ class Clang { void clang_getFileLocation( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_getFileLocation( location, @@ -204,16 +205,16 @@ class Clang { ffi.Void Function( CXSourceLocation, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('clang_getFileLocation'); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_getFileLocation'); late final _clang_getFileLocation = _clang_getFileLocationPtr.asFunction< void Function( CXSourceLocation, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Determine the number of diagnostics produced for the given /// translation unit. @@ -225,9 +226,9 @@ class Clang { ); } - late final _clang_getNumDiagnosticsPtr = - _lookup>( - 'clang_getNumDiagnostics'); + late final _clang_getNumDiagnosticsPtr = _lookup< + ffi.NativeFunction>( + 'clang_getNumDiagnostics'); late final _clang_getNumDiagnostics = _clang_getNumDiagnosticsPtr.asFunction(); @@ -251,7 +252,7 @@ class Clang { late final _clang_getDiagnosticPtr = _lookup< ffi.NativeFunction< CXDiagnostic Function( - CXTranslationUnit, ffi.Uint32)>>('clang_getDiagnostic'); + CXTranslationUnit, pkg_ffi.UnsignedInt)>>('clang_getDiagnostic'); late final _clang_getDiagnostic = _clang_getDiagnosticPtr .asFunction(); @@ -293,9 +294,10 @@ class Clang { ); } - late final _clang_formatDiagnosticPtr = - _lookup>( - 'clang_formatDiagnostic'); + late final _clang_formatDiagnosticPtr = _lookup< + ffi.NativeFunction< + CXString Function( + CXDiagnostic, pkg_ffi.UnsignedInt)>>('clang_formatDiagnostic'); late final _clang_formatDiagnostic = _clang_formatDiagnosticPtr .asFunction(); @@ -305,8 +307,8 @@ class Clang { /// error codes. CXTranslationUnit clang_parseTranslationUnit( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -327,18 +329,18 @@ class Clang { ffi.NativeFunction< CXTranslationUnit Function( CXIndex, - ffi.Pointer, - ffi.Pointer>, - ffi.Int32, + ffi.Pointer, + ffi.Pointer>, + pkg_ffi.Int, ffi.Pointer, - ffi.Uint32, - ffi.Uint32)>>('clang_parseTranslationUnit'); + pkg_ffi.UnsignedInt, + pkg_ffi.UnsignedInt)>>('clang_parseTranslationUnit'); late final _clang_parseTranslationUnit = _clang_parseTranslationUnitPtr.asFunction< CXTranslationUnit Function( CXIndex, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>, int, ffi.Pointer, int, @@ -388,7 +390,7 @@ class Clang { } late final _clang_Cursor_isNullPtr = - _lookup>( + _lookup>( 'clang_Cursor_isNull'); late final _clang_Cursor_isNull = _clang_Cursor_isNullPtr.asFunction(); @@ -418,7 +420,7 @@ class Clang { } late final _clang_Cursor_hasAttrsPtr = - _lookup>( + _lookup>( 'clang_Cursor_hasAttrs'); late final _clang_Cursor_hasAttrs = _clang_Cursor_hasAttrsPtr.asFunction(); @@ -512,7 +514,7 @@ class Clang { } late final _clang_getEnumConstantDeclValuePtr = - _lookup>( + _lookup>( 'clang_getEnumConstantDeclValue'); late final _clang_getEnumConstantDeclValue = _clang_getEnumConstantDeclValuePtr.asFunction(); @@ -529,7 +531,7 @@ class Clang { } late final _clang_getFieldDeclBitWidthPtr = - _lookup>( + _lookup>( 'clang_getFieldDeclBitWidth'); late final _clang_getFieldDeclBitWidth = _clang_getFieldDeclBitWidthPtr.asFunction(); @@ -548,7 +550,7 @@ class Clang { } late final _clang_Cursor_getNumArgumentsPtr = - _lookup>( + _lookup>( 'clang_Cursor_getNumArguments'); late final _clang_Cursor_getNumArguments = _clang_Cursor_getNumArgumentsPtr.asFunction(); @@ -568,9 +570,9 @@ class Clang { ); } - late final _clang_Cursor_getArgumentPtr = - _lookup>( - 'clang_Cursor_getArgument'); + late final _clang_Cursor_getArgumentPtr = _lookup< + ffi.NativeFunction>( + 'clang_Cursor_getArgument'); late final _clang_Cursor_getArgument = _clang_Cursor_getArgumentPtr .asFunction(); @@ -605,7 +607,7 @@ class Clang { } late final _clang_Cursor_isMacroFunctionLikePtr = - _lookup>( + _lookup>( 'clang_Cursor_isMacroFunctionLike'); late final _clang_Cursor_isMacroFunctionLike = _clang_Cursor_isMacroFunctionLikePtr.asFunction(); @@ -621,7 +623,7 @@ class Clang { } late final _clang_Cursor_isMacroBuiltinPtr = - _lookup>( + _lookup>( 'clang_Cursor_isMacroBuiltin'); late final _clang_Cursor_isMacroBuiltin = _clang_Cursor_isMacroBuiltinPtr.asFunction(); @@ -637,7 +639,7 @@ class Clang { } late final _clang_Cursor_isFunctionInlinedPtr = - _lookup>( + _lookup>( 'clang_Cursor_isFunctionInlined'); late final _clang_Cursor_isFunctionInlined = _clang_Cursor_isFunctionInlinedPtr.asFunction(); @@ -732,7 +734,7 @@ class Clang { } late final _clang_getNumArgTypesPtr = - _lookup>( + _lookup>( 'clang_getNumArgTypes'); late final _clang_getNumArgTypes = _clang_getNumArgTypesPtr.asFunction(); @@ -752,7 +754,7 @@ class Clang { } late final _clang_getArgTypePtr = - _lookup>( + _lookup>( 'clang_getArgType'); late final _clang_getArgType = _clang_getArgTypePtr.asFunction(); @@ -770,7 +772,7 @@ class Clang { } late final _clang_getNumElementsPtr = - _lookup>( + _lookup>( 'clang_getNumElements'); late final _clang_getNumElements = _clang_getNumElementsPtr.asFunction(); @@ -828,7 +830,7 @@ class Clang { } late final _clang_Type_getAlignOfPtr = - _lookup>( + _lookup>( 'clang_Type_getAlignOf'); late final _clang_Type_getAlignOf = _clang_Type_getAlignOfPtr.asFunction(); @@ -844,7 +846,7 @@ class Clang { } late final _clang_Cursor_isAnonymousPtr = - _lookup>( + _lookup>( 'clang_Cursor_isAnonymous'); late final _clang_Cursor_isAnonymous = _clang_Cursor_isAnonymousPtr.asFunction(); @@ -860,7 +862,7 @@ class Clang { } late final _clang_Cursor_isAnonymousRecordDeclPtr = - _lookup>( + _lookup>( 'clang_Cursor_isAnonymousRecordDecl'); late final _clang_Cursor_isAnonymousRecordDecl = _clang_Cursor_isAnonymousRecordDeclPtr @@ -900,7 +902,7 @@ class Clang { late final _clang_visitChildrenPtr = _lookup< ffi.NativeFunction< - ffi.Uint32 Function( + pkg_ffi.UnsignedInt Function( CXCursor, CXCursorVisitor, CXClientData)>>('clang_visitChildren'); late final _clang_visitChildren = _clang_visitChildrenPtr .asFunction(); @@ -1096,7 +1098,7 @@ class Clang { } late final _clang_EvalResult_getAsIntPtr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsInt'); late final _clang_EvalResult_getAsInt = _clang_EvalResult_getAsIntPtr.asFunction(); @@ -1113,7 +1115,7 @@ class Clang { } late final _clang_EvalResult_getAsLongLongPtr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsLongLong'); late final _clang_EvalResult_getAsLongLong = _clang_EvalResult_getAsLongLongPtr @@ -1139,7 +1141,7 @@ class Clang { /// 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 clang_EvalResult_getAsStr( CXEvalResult E, ) { return _clang_EvalResult_getAsStr( @@ -1147,11 +1149,11 @@ class Clang { ); } - late final _clang_EvalResult_getAsStrPtr = - _lookup Function(CXEvalResult)>>( - 'clang_EvalResult_getAsStr'); + late final _clang_EvalResult_getAsStrPtr = _lookup< + ffi.NativeFunction Function(CXEvalResult)>>( + 'clang_EvalResult_getAsStr'); late final _clang_EvalResult_getAsStr = _clang_EvalResult_getAsStrPtr - .asFunction Function(CXEvalResult)>(); + .asFunction Function(CXEvalResult)>(); /// Disposes the created Eval memory. void clang_EvalResult_dispose( @@ -1178,7 +1180,7 @@ class Clang { class CXString extends ffi.Struct { external ffi.Pointer data; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int private_flags; } @@ -1193,13 +1195,13 @@ 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; + external ffi.Pointer Filename; /// A buffer containing the unsaved contents of this file. - external ffi.Pointer Contents; + external ffi.Pointer Contents; /// The length of the unsaved contents of this buffer. - @ffi.Uint64() + @pkg_ffi.UnsignedLong() external int Length; } @@ -1219,7 +1221,7 @@ class CXSourceLocation extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int int_data; } @@ -1231,10 +1233,10 @@ class CXSourceRange extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int begin_int_data; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int end_int_data; } @@ -2225,7 +2227,7 @@ class CXCursor extends ffi.Struct { @ffi.Int32() external int kind; - @ffi.Int32() + @pkg_ffi.Int() external int xdata; @ffi.Array.multi([3]) diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index 93dfaa1989..ffcfc8f187 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -31,6 +31,7 @@ Library parse(Config c) { dartBool: config.dartBool, sort: config.sort, packingOverride: config.structPackingOverride, + libraryImports: c.libraryImports.values.toSet(), ); return library; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart index d0d5cd6d56..431334a3a5 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart @@ -192,8 +192,7 @@ void _setMembers(clang_types.CXCursor cursor, String className) { final resultCode = clang.clang_visitChildren( cursor, - Pointer.fromFunction(_compoundMembersVisitor, - clang_types.CXChildVisitResult.CXChildVisit_Break), + Pointer.fromFunction(_compoundMembersVisitor, exceptional_visitor_return), nullptr, ); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index 52cb4ba013..c4b2ab8bda 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -76,8 +76,7 @@ EnumClass? parseEnumDeclaration( void _addEnumConstant(clang_types.CXCursor cursor) { final resultCode = clang.clang_visitChildren( cursor, - Pointer.fromFunction( - _enumCursorVisitor, clang_types.CXChildVisitResult.CXChildVisit_Break), + Pointer.fromFunction(_enumCursorVisitor, exceptional_visitor_return), nullptr, ); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index 41d877ca3a..3b8cd638d4 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -7,7 +7,6 @@ import 'package:ffigen/src/header_parser/data.dart'; import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang_types; -import '../data.dart' show clang; import '../includer.dart'; import '../utils.dart'; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart index 61db5372bb..cdfe078d1a 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart @@ -80,8 +80,7 @@ List? parseSavedMacros() { final resultCode = clang.clang_visitChildren( rootCursor, - Pointer.fromFunction(_macroVariablevisitor, - clang_types.CXChildVisitResult.CXChildVisit_Break), + Pointer.fromFunction(_macroVariablevisitor, exceptional_visitor_return), nullptr, ); @@ -240,7 +239,7 @@ class MacroVariableString { /// E.g- For a string "Hello\nWorld", The new line character is converted to \n. /// Note: The string is considered to be Utf8, but is treated as Extended ASCII, /// if the conversion fails. -String _getWrittenRepresentation(String macroName, Pointer strPtr) { +String _getWrittenRepresentation(String macroName, Pointer strPtr) { final sb = StringBuffer(); try { // Consider string to be Utf8 encoded by default. diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart index 4cac558e7d..940369ae26 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart @@ -19,8 +19,7 @@ final _logger = Logger('ffigen.header_parser.unnamed_enumdecl_parser'); void saveUnNamedEnum(clang_types.CXCursor cursor) { final resultCode = clang.clang_visitChildren( cursor, - Pointer.fromFunction(_unnamedenumCursorVisitor, - clang_types.CXChildVisitResult.CXChildVisit_Break), + Pointer.fromFunction(_unnamedenumCursorVisitor, exceptional_visitor_return), nullptr, ); diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart index 3e5a677cc5..9a576c0529 100644 --- a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -26,8 +26,7 @@ Set parseTranslationUnit(clang_types.CXCursor translationUnitCursor) { _bindings = {}; final resultCode = clang.clang_visitChildren( translationUnitCursor, - Pointer.fromFunction( - _rootCursorVisitor, clang_types.CXChildVisitResult.CXChildVisit_Break), + Pointer.fromFunction(_rootCursorVisitor, exceptional_visitor_return), nullptr, ); diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart index eae99bc4d2..41af99a9da 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart @@ -3,28 +3,23 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart' show SupportedNativeType; -import 'package:ffigen/src/header_parser/clang_bindings/clang_bindings.dart' - as clang; +import 'package:ffigen/src/code_generator/imports.dart'; -/// Utility to convert CXType to [code_generator.Type]. -/// -/// Key: CXTypekindEnum, Value: TypeString for code_generator -var cxTypeKindToSupportedNativeTypes = { - clang.CXTypeKind.CXType_Void: SupportedNativeType.Void, - clang.CXTypeKind.CXType_UChar: SupportedNativeType.Uint8, - clang.CXTypeKind.CXType_UShort: SupportedNativeType.Uint16, - clang.CXTypeKind.CXType_UInt: SupportedNativeType.Uint32, - clang.CXTypeKind.CXType_ULong: SupportedNativeType.Uint64, - clang.CXTypeKind.CXType_ULongLong: SupportedNativeType.Uint64, - clang.CXTypeKind.CXType_SChar: SupportedNativeType.Int8, - clang.CXTypeKind.CXType_Short: SupportedNativeType.Int16, - clang.CXTypeKind.CXType_Int: SupportedNativeType.Int32, - clang.CXTypeKind.CXType_Long: SupportedNativeType.Int64, - clang.CXTypeKind.CXType_LongLong: SupportedNativeType.Int64, - clang.CXTypeKind.CXType_Float: SupportedNativeType.Float, - clang.CXTypeKind.CXType_Double: SupportedNativeType.Double, - clang.CXTypeKind.CXType_Char_S: SupportedNativeType.Int8, - clang.CXTypeKind.CXType_Char_U: SupportedNativeType.Uint8, +var cxTypeKindToImportedTypes = { + 'void': voidType, + 'unsigned char': unsignedCharType, + 'signed char': signedCharType, + 'char': charType, + 'unsigned short': unsignedShortType, + 'short': shortType, + 'unsigned int': unsignedIntType, + 'int': intType, + 'unsigned long': unsignedLongType, + 'long': longType, + 'unsigned long long': unsignedLongLongType, + 'long long': longLongType, + 'float': floatType, + 'double': doubleType, }; var suportedTypedefToSuportedNativeType = { @@ -38,3 +33,8 @@ var suportedTypedefToSuportedNativeType = { 'int64_t': SupportedNativeType.Int64, 'intptr_t': SupportedNativeType.IntPtr, }; + +var supportedTypedefToImportedType = { + 'size_t': sizeType, + 'wchar_t': wCharType, +}; diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 43d964cd55..6063035617 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -43,9 +43,9 @@ Type getCodeGenType( return Type.pointer(s); case clang_types.CXTypeKind.CXType_Typedef: final spelling = clang.clang_getTypedefName(cxtype).toStringAndDispose(); - if (config.typedefNativeTypeMappings.containsKey(spelling)) { - _logger.fine(' Type Mapped from typedef-map'); - return Type.nativeType(config.typedefNativeTypeMappings[spelling]!); + if (config.typedefTypeMappings.containsKey(spelling)) { + _logger.fine(' Type $spelling mapped from type-map'); + return Type.importedType(config.typedefTypeMappings[spelling]!); } // Get name from supported typedef name if config allows. if (config.useSupportedTypedefs) { @@ -53,6 +53,9 @@ Type getCodeGenType( _logger.fine(' Type Mapped from supported typedef'); return Type.nativeType( suportedTypedefToSuportedNativeType[spelling]!); + } else if (supportedTypedefToImportedType.containsKey(spelling)) { + _logger.fine(' Type Mapped from supported typedef'); + return Type.importedType(supportedTypedefToImportedType[spelling]!); } } @@ -119,10 +122,16 @@ Type getCodeGenType( case clang_types.CXTypeKind.CXType_Bool: return Type.boolean(); default: - if (cxTypeKindToSupportedNativeTypes.containsKey(kind)) { - return Type.nativeType( - cxTypeKindToSupportedNativeTypes[kind]!, - ); + var typeSpellKey = + clang.clang_getTypeSpelling(cxtype).toStringAndDispose(); + if (typeSpellKey.startsWith('const ')) { + typeSpellKey = typeSpellKey.replaceFirst('const ', ''); + } + if (config.nativeTypeMappings.containsKey(typeSpellKey)) { + _logger.fine(' Type $typeSpellKey mapped from type-map.'); + return Type.importedType(config.nativeTypeMappings[typeSpellKey]!); + } else if (cxTypeKindToImportedTypes.containsKey(typeSpellKey)) { + return Type.importedType(cxTypeKindToImportedTypes[typeSpellKey]!); } else { _logger.fine( 'typedeclarationCursorVisitor: getCodeGenType: Type Not Implemented, ${cxtype.completeStringRepr()}'); @@ -142,22 +151,26 @@ Type _extractfromRecord(clang_types.CXType cxtype, bool pointerReference) { if (cursorKind == clang_types.CXCursorKind.CXCursor_StructDecl || cursorKind == clang_types.CXCursorKind.CXCursor_UnionDecl) { final declUsr = cursor.usr(); + final declSpelling = cursor.spelling(); // Set includer functions according to compoundType. final bool Function(String) isSeenDecl; final Compound? Function(String) getSeenDecl; final CompoundType compoundType; + final Map compoundTypeMappings; switch (cursorKind) { case clang_types.CXCursorKind.CXCursor_StructDecl: isSeenDecl = bindingsIndex.isSeenStruct; getSeenDecl = bindingsIndex.getSeenStruct; compoundType = CompoundType.struct; + compoundTypeMappings = config.structTypeMappings; break; case clang_types.CXCursorKind.CXCursor_UnionDecl: isSeenDecl = bindingsIndex.isSeenUnion; getSeenDecl = bindingsIndex.getSeenUnion; compoundType = CompoundType.union; + compoundTypeMappings = config.unionTypeMappings; break; default: throw Exception('Unhandled compound type cursorkind.'); @@ -165,7 +178,10 @@ Type _extractfromRecord(clang_types.CXType cxtype, bool pointerReference) { // Also add a struct binding, if its unseen. // TODO(23): Check if we should auto add compound declarations. - if (isSeenDecl(declUsr)) { + if (compoundTypeMappings.containsKey(declSpelling)) { + _logger.fine(' Type Mapped from type-map'); + return Type.importedType(compoundTypeMappings[declSpelling]!); + } else if (isSeenDecl(declUsr)) { type = Type.compound(getSeenDecl(declUsr)!); // This will parse the dependencies if needed. diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index f602cdf22c..bac2eaf598 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -13,11 +13,14 @@ import 'clang_bindings/clang_bindings.dart' as clang_types; import 'data.dart'; import 'type_extractor/extractor.dart'; +const exceptional_visitor_return = + clang_types.CXChildVisitResult.CXChildVisit_Break; + /// Check [resultCode] of [clang.clang_visitChildren_wrap]. /// -/// Throws exception if resultCode is not 0. +/// Throws exception if resultCode is not [exceptional_visitor_return]. void visitChildrenResultChecker(int resultCode) { - if (resultCode != 0) { + if (resultCode != exceptional_visitor_return) { throw Exception( 'Exception thrown in a dart function called via C, use --verbose to see more details'); } @@ -101,9 +104,9 @@ extension CXCursorExt on clang_types.CXCursor { String sourceFileName() { final cxsource = clang.clang_getCursorLocation(this); final cxfilePtr = calloc>(); - final line = calloc(); - final column = calloc(); - final offset = calloc(); + final line = calloc(); + final column = calloc(); + final offset = calloc(); // Puts the values in these pointers. clang.clang_getFileLocation(cxsource, cxfilePtr, line, column, offset); diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 5ae3e35599..fbbd6b76fa 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:io'; -import 'package:ffigen/src/code_generator/type.dart'; +import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/header_parser/clang_bindings/clang_bindings.dart' as clang; @@ -79,9 +79,6 @@ const Map packingValuesMap = { 16: 16, }; -const sizemap = 'size-map'; -const typedefmap = 'typedef-map'; - // Sizemap values. const SChar = 'char'; const UChar = 'unsigned char'; @@ -110,6 +107,27 @@ const sizemap_native_mapping = { Enum: clang.CXTypeKind.CXType_Enum }; +// Library imports. +const libraryImports = 'library-imports'; + +final predefinedLibraryImports = { + ffiImport.name: ffiImport, + ffiPkgImport.name: ffiPkgImport +}; + +const typeMap = 'type-map'; + +// Sub-fields for type-map. +const typeMapTypedefs = 'typedefs'; +const typeMapStructs = 'structs'; +const typeMapUnions = 'unions'; +const typeMapNativeTypes = 'native-types'; + +// Sub-sub-keys for fields under typeMap. +const lib = 'lib'; +const cType = 'c-type'; +const dartType = 'dart-type'; + const supportedNativeType_mappings = { 'Void': SupportedNativeType.Void, 'Uint8': SupportedNativeType.Uint8, diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 34a5c3c919..e0e03b0544 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,15 +3,15 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 4.1.2 +version: 5.0.0-dev.0 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. environment: - sdk: '>=2.14.0 <3.0.0' + sdk: '>=2.16.0-124.0.dev <3.0.0' dependencies: - ffi: ^1.0.0 + ffi: ^1.2.0-dev.0 yaml: ^3.0.0 path: ^1.8.0 quiver: ^3.0.0 diff --git a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart index 34905a45d3..9178cf01d0 100644 --- a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart @@ -422,12 +422,12 @@ void main() { _matchLib(library, 'packed_structs'); }); test('Union Bindings', () { - final struct1 = Struc(name: 'Struct1', members: [ - Member(name: 'a', type: Type.nativeType(SupportedNativeType.Int8)) - ]); - final union1 = Union(name: 'Union1', members: [ - Member(name: 'a', type: Type.nativeType(SupportedNativeType.Int8)) - ]); + final struct1 = Struc( + name: 'Struct1', + members: [Member(name: 'a', type: Type.importedType(charType))]); + final union1 = Union( + name: 'Union1', + members: [Member(name: 'a', type: Type.importedType(charType))]); final library = Library( name: 'Bindings', bindings: [ @@ -435,25 +435,22 @@ void main() { union1, Union(name: 'EmptyUnion'), Union(name: 'Primitives', members: [ - Member(name: 'a', type: Type.nativeType(SupportedNativeType.Int8)), - Member(name: 'b', type: Type.nativeType(SupportedNativeType.Int32)), - Member(name: 'c', type: Type.nativeType(SupportedNativeType.Float)), - Member(name: 'd', type: Type.nativeType(SupportedNativeType.Double)), + Member(name: 'a', type: Type.importedType(charType)), + Member(name: 'b', type: Type.importedType(intType)), + Member(name: 'c', type: Type.importedType(floatType)), + Member(name: 'd', type: Type.importedType(doubleType)), ]), Union(name: 'PrimitivesWithPointers', members: [ - Member(name: 'a', type: Type.nativeType(SupportedNativeType.Int8)), - Member(name: 'b', type: Type.nativeType(SupportedNativeType.Float)), - Member( - name: 'c', - type: Type.pointer(Type.nativeType(SupportedNativeType.Double))), + Member(name: 'a', type: Type.importedType(charType)), + Member(name: 'b', type: Type.importedType(floatType)), + Member(name: 'c', type: Type.pointer(Type.importedType(doubleType))), Member(name: 'd', type: Type.pointer(Type.union(union1))), Member(name: 'd', type: Type.pointer(Type.struct(struct1))), ]), Union(name: 'WithArray', members: [ Member( name: 'a', - type: Type.constantArray( - 10, Type.nativeType(SupportedNativeType.Int8))), + type: Type.constantArray(10, Type.importedType(charType))), Member(name: 'b', type: Type.constantArray(10, Type.union(union1))), Member(name: 'b', type: Type.constantArray(10, Type.struct(struct1))), Member( @@ -477,9 +474,7 @@ void main() { type: Type.typealias(Typealias( name: 'Struct2Typealias', type: Type.struct(Struc(name: 'Struct2', members: [ - Member( - name: 'a', - type: Type.nativeType(SupportedNativeType.Double)) + Member(name: 'a', type: Type.importedType(doubleType)) ]))))) ]), Func( diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart index 2e9412123d..6d81198c17 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart @@ -2,6 +2,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; class Bindings { /// Holds the symbol lookup function. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart index c44ddddb7d..88d3ce3313 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart @@ -2,6 +2,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; class Bindings { /// Holds the symbol lookup function. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart index d01f2b1d01..4696f26e9b 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart @@ -4,6 +4,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; const int test1 = 20; diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart index 0aa2dbbd68..910654f981 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart @@ -4,6 +4,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; /// test line 1 /// test line 2 diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart index ada968c86e..0912744dd4 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart @@ -2,6 +2,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; class Bindings { /// Holds the symbol lookup function. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart index 6ccce4eb49..df895e3412 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart @@ -2,6 +2,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; class Bindings { /// Holds the symbol lookup function. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart index 0a531fac85..766baa1ff1 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart @@ -2,6 +2,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; class Bindings { /// Holds the symbol lookup function. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart index b6e1378385..7b5eca4271 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart @@ -4,6 +4,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; class init_dylib1 { /// Holds the symbol lookup function. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart index 4aea89af06..b0e76bde1c 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart @@ -2,6 +2,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; class NoPacking extends ffi.Struct { @ffi.Uint8() diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart index cbae1f827e..3bb980f6a4 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart @@ -2,6 +2,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; class Bindings { /// Holds the symbol lookup function. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart index f84642b090..5c39d9294d 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart @@ -2,6 +2,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; /// Just a test struct /// heres another line diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart index e605db2826..e0c4884ec0 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart @@ -4,6 +4,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; class Bindings { /// Holds the symbol lookup function. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart index c7e7680caf..3483cb89c0 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart @@ -2,24 +2,25 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; class Struct1 extends ffi.Struct { - @ffi.Int8() + @pkg_ffi.Char() external int a; } class Union1 extends ffi.Union { - @ffi.Int8() + @pkg_ffi.Char() external int a; } class EmptyUnion extends ffi.Opaque {} class Primitives extends ffi.Union { - @ffi.Int8() + @pkg_ffi.Char() external int a; - @ffi.Int32() + @pkg_ffi.Int() external int b; @ffi.Float() @@ -30,7 +31,7 @@ class Primitives extends ffi.Union { } class PrimitivesWithPointers extends ffi.Union { - @ffi.Int8() + @pkg_ffi.Char() external int a; @ffi.Float() @@ -45,7 +46,7 @@ class PrimitivesWithPointers extends ffi.Union { class WithArray extends ffi.Union { @ffi.Array.multi([10]) - external ffi.Array a; + external ffi.Array a; @ffi.Array.multi([10]) external ffi.Array b; diff --git a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart index b45cdcd88d..e107a2c232 100644 --- a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart +++ b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart @@ -4,6 +4,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; class Bindings1 { /// Holds the symbol lookup function. diff --git a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_type_name_collision_bindings.dart b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_type_name_collision_bindings.dart index 5dab4a23d4..7af357a1fd 100644 --- a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_type_name_collision_bindings.dart +++ b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_type_name_collision_bindings.dart @@ -4,17 +4,18 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; class A extends ffi.Struct { - @ffi.Int32() + @pkg_ffi.Int() external int a; } class B extends ffi.Struct { - @ffi.Int32() + @pkg_ffi.Int() external int B1; - @ffi.Int32() + @pkg_ffi.Int() external int A; } diff --git a/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart b/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart index e38894dd0c..eb2e61c13e 100644 --- a/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart @@ -27,15 +27,15 @@ void main() { name: 'implements', parameters: [ Parameter( - type: Type.nativeType(SupportedNativeType.Int32), + type: Type.importedType(intType), name: 'if', ), Parameter( - type: Type.nativeType(SupportedNativeType.Int32), + type: Type.importedType(intType), name: 'abstract', ), Parameter( - type: Type.nativeType(SupportedNativeType.Int32), + type: Type.importedType(intType), name: 'in', ), ], @@ -62,15 +62,15 @@ void main() { originalName: 'implements', parameters: [ Parameter( - type: Type.nativeType(SupportedNativeType.Int32), + type: Type.importedType(intType), name: 'if1', ), Parameter( - type: Type.nativeType(SupportedNativeType.Int32), + type: Type.importedType(intType), name: 'abstract1', ), Parameter( - type: Type.nativeType(SupportedNativeType.Int32), + type: Type.importedType(intType), name: 'in1', ), ], diff --git a/pkgs/ffigen/test/config_tests/compiler_opts_test.dart b/pkgs/ffigen/test/config_tests/compiler_opts_test.dart index b5e644b65f..5193d4dba2 100644 --- a/pkgs/ffigen/test/config_tests/compiler_opts_test.dart +++ b/pkgs/ffigen/test/config_tests/compiler_opts_test.dart @@ -3,7 +3,6 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/ffigen.dart'; -import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/config_provider/spec_utils.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:test/test.dart'; diff --git a/pkgs/ffigen/test/config_tests/unknown_keys_warn_test.dart b/pkgs/ffigen/test/config_tests/unknown_keys_warn_test.dart new file mode 100644 index 0000000000..4fcb680ec1 --- /dev/null +++ b/pkgs/ffigen/test/config_tests/unknown_keys_warn_test.dart @@ -0,0 +1,52 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/ffigen.dart'; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; + +import '../test_utils.dart'; + +late Library actual, expected; + +void main() { + var logString = ''; + group('unknown_keys_warn_test', () { + setUpAll(() { + final logArr = []; + logWarningsToArray(logArr, Level.WARNING); + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Warn for unknown keys.' +${strings.output}: 'unused' +${strings.headers}: + ${strings.entryPoints}: + - 'test/header_parser_tests/packed_structs.h' +'warn-1': 'warn' +${strings.typeMap}: + 'warn-2': 'warn' + 'warn-3': 'warn' +${strings.functions}: + 'warn-4': 'skip' +${strings.structs}: + 'warn-5': 'skip' +${strings.unions}: + 'warn-6': 'skip' + ''') as yaml.YamlMap); + logString = logArr.join("\n"); + }); + test('Warn for unknown keys.', () { + expect(logString.contains('warn-1'), true); + expect(logString.contains('warn-2'), true); + expect(logString.contains('warn-3'), true); + }); + test('Do not warn for unknown keys in declarations.', () { + expect(logString.contains('warn-4'), false); + expect(logString.contains('warn-5'), false); + expect(logString.contains('warn-6'), false); + }); + }); +} diff --git a/pkgs/ffigen/test/example_tests/cjson_example_test.dart b/pkgs/ffigen/test/example_tests/cjson_example_test.dart index c95bcf200a..65d5611954 100644 --- a/pkgs/ffigen/test/example_tests/cjson_example_test.dart +++ b/pkgs/ffigen/test/example_tests/cjson_example_test.dart @@ -27,8 +27,12 @@ ${strings.headers}: ${strings.includeDirectives}: - '**cJSON.h' ${strings.comments}: false -${strings.typedefmap}: - 'size_t': 'IntPtr' +${strings.typeMap}: + ${strings.typeMapTypedefs}: + 'size_t': + lib: 'pkg_ffi' + c-type: 'Size' + dart-type: 'int' ${strings.preamble}: | // Copyright (c) 2009-2017 Dave Gamble and cJSON contributors // diff --git a/pkgs/ffigen/test/example_tests/libclang_example_test.dart b/pkgs/ffigen/test/example_tests/libclang_example_test.dart index 1ca9600ec6..e22bd86167 100644 --- a/pkgs/ffigen/test/example_tests/libclang_example_test.dart +++ b/pkgs/ffigen/test/example_tests/libclang_example_test.dart @@ -43,9 +43,28 @@ ${strings.enums}: ${strings.include}: - 'CXTypeKind' - 'CXGlobalOptFlags' -${strings.typedefmap}: - 'size_t': 'IntPtr' - 'time_t': 'Int64' +${strings.libraryImports}: + custom_import: 'custom_import.dart' +${strings.typeMap}: + ${strings.typeMapTypedefs}: + 'size_t': + lib: 'pkg_ffi' + c-type: 'Size' + dart-type: 'int' + 'time_t': + lib: 'ffi' + c-type: 'Int64' + dart-type: 'int' + ${strings.typeMapNativeTypes}: + 'unsigned long': + lib: 'custom_import' + c-type: 'UnsignedLong' + dart-type: 'int' + ${strings.typeMapStructs}: + 'CXCursorSetImpl': + lib: 'custom_import' + c-type: 'CXCursorSetImpl' + dart-type: 'CXCursorSetImpl' ${strings.name}: 'LibClang' ${strings.description}: 'Holds bindings to LibClang.' ${strings.comments}: diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart index 6a95e52483..b0f806a347 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart @@ -2,6 +2,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; /// Comment Markup Test class NativeLibrary { @@ -54,7 +55,7 @@ class NativeLibrary { class Com4 extends ffi.Struct { /// Muli-line test comment for struct field /// With multiple line and both // and ///. - @ffi.Int32() + @pkg_ffi.Int() external int a; /// Single line field comment. diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart index b00eaf9007..14b429c665 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart @@ -2,6 +2,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; /// Dart_Handle Test class NativeLibrary { diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart index 01fe05c81c..c5c194bdbb 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart @@ -2,6 +2,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; /// Forward Declaration Test class NativeLibrary { @@ -36,10 +37,10 @@ class NativeLibrary { } class A extends ffi.Struct { - @ffi.Int32() + @pkg_ffi.Int() external int a; - @ffi.Int32() + @pkg_ffi.Int() external int b; } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart index d42ec32b62..ae8eb0adf7 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart @@ -4,6 +4,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; /// Functions Test class NativeLibrary { @@ -102,6 +103,22 @@ class NativeLibrary { void Function(ffi.Pointer, ffi.Pointer>)>(); + int diffChars( + int a, + int b, + ) { + return _diffChars( + a, + b, + ); + } + + late final _diffCharsPtr = _lookup< + ffi.NativeFunction< + pkg_ffi.Char Function( + pkg_ffi.UnsignedChar, pkg_ffi.SignedChar)>>('diffChars'); + late final _diffChars = _diffCharsPtr.asFunction(); + late final addresses = _SymbolAddresses(this); } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart index 802d838e0f..baf9c6eb82 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart @@ -2,6 +2,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; /// Native Func Typedef Test. class NativeLibrary { diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart index b891dd9b58..2f07ba03d0 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart @@ -2,6 +2,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; /// Opaque Dependencies Test class NativeLibrary { @@ -63,7 +64,7 @@ class E extends ffi.Struct { class C extends ffi.Opaque {} class D extends ffi.Struct { - @ffi.Int32() + @pkg_ffi.Int() external int a; } @@ -80,6 +81,6 @@ class UE extends ffi.Union { class UC extends ffi.Opaque {} class UD extends ffi.Union { - @ffi.Int32() + @pkg_ffi.Int() external int a; } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_packed_structs_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_packed_structs_bindings.dart index d27adc4cc8..2e4740f6b4 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_packed_structs_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_packed_structs_bindings.dart @@ -2,48 +2,49 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; class NormalStruct1 extends ffi.Struct { - @ffi.Int8() + @pkg_ffi.Char() external int a; } /// Should not be packed. class StructWithAttr extends ffi.Struct { - external ffi.Pointer a; + external ffi.Pointer a; - external ffi.Pointer b; + external ffi.Pointer b; } /// Should be packed with 1. @ffi.Packed(1) class PackedAttr extends ffi.Struct { - @ffi.Int32() + @pkg_ffi.Int() external int a; } /// Should be packed with 8. @ffi.Packed(8) class PackedAttrAlign8 extends ffi.Struct { - @ffi.Int32() + @pkg_ffi.Int() external int a; } /// Should be packed with 2. @ffi.Packed(2) class Pack2WithPragma extends ffi.Struct { - @ffi.Int32() + @pkg_ffi.Int() external int a; } /// Should be packed with 4. @ffi.Packed(4) class Pack4WithPragma extends ffi.Struct { - @ffi.Int64() + @pkg_ffi.LongLong() external int a; } class NormalStruct2 extends ffi.Struct { - @ffi.Int8() + @pkg_ffi.Char() external int a; } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart index ec8eb3fbe7..35b0daca53 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart @@ -4,6 +4,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; class Bindings { /// Holds the symbol lookup function. @@ -21,7 +22,7 @@ class Bindings { NamedFunctionProto func1( NamedFunctionProto named, - ffi.Pointer> unnamed, + ffi.Pointer> unnamed, ) { return _func1( named, @@ -30,14 +31,15 @@ class Bindings { } late final _func1Ptr = _lookup< - ffi.NativeFunction< - NamedFunctionProto Function( - NamedFunctionProto, - ffi.Pointer< - ffi.NativeFunction>)>>('func1'); + ffi.NativeFunction< + NamedFunctionProto Function( + NamedFunctionProto, + ffi.Pointer< + ffi.NativeFunction>)>>( + 'func1'); late final _func1 = _func1Ptr.asFunction< NamedFunctionProto Function(NamedFunctionProto, - ffi.Pointer>)>(); + ffi.Pointer>)>(); void func2( ffi.Pointer arg0, diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart index 1f62444197..d17d65afaa 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart @@ -2,6 +2,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; /// Unions Test class NativeLibrary { @@ -49,7 +50,7 @@ class NativeLibrary { } class Union1 extends ffi.Union { - @ffi.Int32() + @pkg_ffi.Int() external int a; } diff --git a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart index 3b34013e34..d56cd4e620 100644 --- a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart @@ -71,7 +71,7 @@ Library expectedLibrary() { final struc1 = Struc(name: 'Struct1', members: [ Member( name: 'a', - type: Type.nativeType(SupportedNativeType.Int32), + type: Type.importedType(intType), ), ]); final struc2 = Struc(name: 'Struct2', members: [ @@ -108,9 +108,7 @@ Library expectedLibrary() { Func( name: 'func3', parameters: [ - Parameter( - name: 'a', - type: Type.pointer(Type.nativeType(SupportedNativeType.Int32))), + Parameter(name: 'a', type: Type.pointer(Type.importedType(intType))), ], returnType: Type.nativeType( SupportedNativeType.Void, @@ -122,9 +120,7 @@ Library expectedLibrary() { Member( name: 'a', type: Type.constantArray( - 2, - Type.constantArray( - 10, Type.nativeType(SupportedNativeType.Int32)))) + 2, Type.constantArray(10, Type.importedType(intType)))) ]), ], ); diff --git a/pkgs/ffigen/test/header_parser_tests/functions.h b/pkgs/ffigen/test/header_parser_tests/functions.h index 56ec2bef74..28b8546358 100644 --- a/pkgs/ffigen/test/header_parser_tests/functions.h +++ b/pkgs/ffigen/test/header_parser_tests/functions.h @@ -19,3 +19,5 @@ void func5(shortHand a, void(b)()); // Should be skipped as inline functions are not supported. static inline void inlineFunc(); + +char diffChars(unsigned char a, signed char b); diff --git a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart index d09d972eab..10dc3906f7 100644 --- a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart @@ -64,21 +64,21 @@ Library expectedLibrary() { final struc2 = Struc(name: 'Struct2', members: [ Member( name: 'e', - type: Type.nativeType(SupportedNativeType.Int32), + type: Type.importedType(intType), ), Member( name: 'f', - type: Type.nativeType(SupportedNativeType.Int32), + type: Type.importedType(intType), ), ]); final unnamedInternalStruc = Struc(name: 'UnnamedStruct1', members: [ Member( name: 'a', - type: Type.nativeType(SupportedNativeType.Int32), + type: Type.importedType(intType), ), Member( name: 'b', - type: Type.nativeType(SupportedNativeType.Int32), + type: Type.importedType(intType), ), ]); return Library( @@ -89,18 +89,18 @@ Library expectedLibrary() { Struc(name: 'Struct1', members: [ Member( name: 'a', - type: Type.nativeType(SupportedNativeType.Int32), + type: Type.importedType(intType), ), Member( name: 'b', - type: Type.nativeType(SupportedNativeType.Int32), + type: Type.importedType(intType), ), Member(name: 'struct2', type: Type.pointer(Type.struct(struc2))), ]), Struc(name: 'Struct3', members: [ Member( name: 'a', - type: Type.nativeType(SupportedNativeType.Int32), + type: Type.importedType(intType), ), Member( name: 'b', diff --git a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart index 6759603767..abac0e09b1 100644 --- a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart @@ -32,9 +32,12 @@ ${strings.structs}: ${strings.exclude}: - ExcludedStruct - _ExcludedStruct -${strings.typedefmap}: - 'SpecifiedTypeAsIntPtr': 'IntPtr' - +${strings.typeMap}: + ${strings.typeMapTypedefs}: + 'SpecifiedTypeAsIntPtr': + lib: 'ffi' + c-type: 'IntPtr' + dart-type: 'int' ${strings.preamble}: | // ignore_for_file: unused_element, unused_field ''') as yaml.YamlMap), diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart index f16ca6e030..794ef5c43d 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart @@ -4,6 +4,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; /// Bindings to Cjson. class CJson { @@ -20,15 +21,15 @@ class CJson { lookup) : _lookup = lookup; - ffi.Pointer cJSON_Version() { + ffi.Pointer cJSON_Version() { return _cJSON_Version(); } late final _cJSON_VersionPtr = - _lookup Function()>>( + _lookup Function()>>( 'cJSON_Version'); late final _cJSON_Version = - _cJSON_VersionPtr.asFunction Function()>(); + _cJSON_VersionPtr.asFunction Function()>(); void cJSON_InitHooks( ffi.Pointer hooks, @@ -45,7 +46,7 @@ class CJson { _cJSON_InitHooksPtr.asFunction)>(); ffi.Pointer cJSON_Parse( - ffi.Pointer value, + ffi.Pointer value, ) { return _cJSON_Parse( value, @@ -54,13 +55,14 @@ class CJson { late final _cJSON_ParsePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('cJSON_Parse'); + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_Parse'); late final _cJSON_Parse = _cJSON_ParsePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_ParseWithOpts( - ffi.Pointer value, - ffi.Pointer> return_parse_end, + ffi.Pointer value, + ffi.Pointer> return_parse_end, int require_null_terminated, ) { return _cJSON_ParseWithOpts( @@ -73,14 +75,14 @@ class CJson { late final _cJSON_ParseWithOptsPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>, cJSON_bool)>>('cJSON_ParseWithOpts'); late final _cJSON_ParseWithOpts = _cJSON_ParseWithOptsPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer>, int)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer>, int)>(); - ffi.Pointer cJSON_Print( + ffi.Pointer cJSON_Print( ffi.Pointer item, ) { return _cJSON_Print( @@ -90,11 +92,12 @@ class CJson { late final _cJSON_PrintPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('cJSON_Print'); + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_Print'); late final _cJSON_Print = _cJSON_PrintPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); - ffi.Pointer cJSON_PrintUnformatted( + ffi.Pointer cJSON_PrintUnformatted( ffi.Pointer item, ) { return _cJSON_PrintUnformatted( @@ -104,12 +107,12 @@ class CJson { late final _cJSON_PrintUnformattedPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('cJSON_PrintUnformatted'); late final _cJSON_PrintUnformatted = _cJSON_PrintUnformattedPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); - ffi.Pointer cJSON_PrintBuffered( + ffi.Pointer cJSON_PrintBuffered( ffi.Pointer item, int prebuffer, int fmt, @@ -123,14 +126,14 @@ class CJson { late final _cJSON_PrintBufferedPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Int32, + ffi.Pointer Function(ffi.Pointer, pkg_ffi.Int, cJSON_bool)>>('cJSON_PrintBuffered'); late final _cJSON_PrintBuffered = _cJSON_PrintBufferedPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int)>(); + ffi.Pointer Function(ffi.Pointer, int, int)>(); int cJSON_PrintPreallocated( ffi.Pointer item, - ffi.Pointer buffer, + ffi.Pointer buffer, int length, int format, ) { @@ -144,10 +147,10 @@ class CJson { late final _cJSON_PrintPreallocatedPtr = _lookup< ffi.NativeFunction< - cJSON_bool Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, cJSON_bool)>>('cJSON_PrintPreallocated'); + cJSON_bool Function(ffi.Pointer, ffi.Pointer, + pkg_ffi.Int, cJSON_bool)>>('cJSON_PrintPreallocated'); late final _cJSON_PrintPreallocated = _cJSON_PrintPreallocatedPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int, int)>(); void cJSON_Delete( ffi.Pointer item, @@ -172,7 +175,7 @@ class CJson { } late final _cJSON_GetArraySizePtr = - _lookup)>>( + _lookup)>>( 'cJSON_GetArraySize'); late final _cJSON_GetArraySize = _cJSON_GetArraySizePtr.asFunction)>(); @@ -190,13 +193,13 @@ class CJson { late final _cJSON_GetArrayItemPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Int32)>>('cJSON_GetArrayItem'); + ffi.Pointer, pkg_ffi.Int)>>('cJSON_GetArrayItem'); late final _cJSON_GetArrayItem = _cJSON_GetArrayItemPtr .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_GetObjectItem( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_GetObjectItem( object, @@ -207,13 +210,14 @@ class CJson { late final _cJSON_GetObjectItemPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_GetObjectItem'); + ffi.Pointer)>>('cJSON_GetObjectItem'); late final _cJSON_GetObjectItem = _cJSON_GetObjectItemPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_GetObjectItemCaseSensitive( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_GetObjectItemCaseSensitive( object, @@ -224,15 +228,15 @@ class CJson { late final _cJSON_GetObjectItemCaseSensitivePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_GetObjectItemCaseSensitive'); + ffi.Pointer)>>('cJSON_GetObjectItemCaseSensitive'); late final _cJSON_GetObjectItemCaseSensitive = _cJSON_GetObjectItemCaseSensitivePtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); int cJSON_HasObjectItem( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_HasObjectItem( object, @@ -243,21 +247,21 @@ class CJson { late final _cJSON_HasObjectItemPtr = _lookup< ffi.NativeFunction< cJSON_bool Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_HasObjectItem'); - late final _cJSON_HasObjectItem = _cJSON_HasObjectItemPtr - .asFunction, ffi.Pointer)>(); + ffi.Pointer)>>('cJSON_HasObjectItem'); + late final _cJSON_HasObjectItem = _cJSON_HasObjectItemPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer cJSON_GetErrorPtr() { + ffi.Pointer cJSON_GetErrorPtr() { return _cJSON_GetErrorPtr(); } late final _cJSON_GetErrorPtrPtr = - _lookup Function()>>( + _lookup Function()>>( 'cJSON_GetErrorPtr'); late final _cJSON_GetErrorPtr = - _cJSON_GetErrorPtrPtr.asFunction Function()>(); + _cJSON_GetErrorPtrPtr.asFunction Function()>(); - ffi.Pointer cJSON_GetStringValue( + ffi.Pointer cJSON_GetStringValue( ffi.Pointer item, ) { return _cJSON_GetStringValue( @@ -267,10 +271,10 @@ class CJson { late final _cJSON_GetStringValuePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('cJSON_GetStringValue'); late final _cJSON_GetStringValue = _cJSON_GetStringValuePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); int cJSON_IsInvalid( ffi.Pointer item, @@ -471,7 +475,7 @@ class CJson { _cJSON_CreateNumberPtr.asFunction Function(double)>(); ffi.Pointer cJSON_CreateString( - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_CreateString( string, @@ -481,12 +485,12 @@ class CJson { late final _cJSON_CreateStringPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer)>>('cJSON_CreateString'); + ffi.Pointer)>>('cJSON_CreateString'); late final _cJSON_CreateString = _cJSON_CreateStringPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateRaw( - ffi.Pointer raw, + ffi.Pointer raw, ) { return _cJSON_CreateRaw( raw, @@ -496,9 +500,9 @@ class CJson { late final _cJSON_CreateRawPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer)>>('cJSON_CreateRaw'); + ffi.Pointer)>>('cJSON_CreateRaw'); late final _cJSON_CreateRaw = _cJSON_CreateRawPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateArray() { return _cJSON_CreateArray(); @@ -521,7 +525,7 @@ class CJson { _cJSON_CreateObjectPtr.asFunction Function()>(); ffi.Pointer cJSON_CreateStringReference( - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_CreateStringReference( string, @@ -531,9 +535,9 @@ class CJson { late final _cJSON_CreateStringReferencePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer)>>('cJSON_CreateStringReference'); + ffi.Pointer)>>('cJSON_CreateStringReference'); late final _cJSON_CreateStringReference = _cJSON_CreateStringReferencePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateObjectReference( ffi.Pointer child, @@ -564,7 +568,7 @@ class CJson { .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateIntArray( - ffi.Pointer numbers, + ffi.Pointer numbers, int count, ) { return _cJSON_CreateIntArray( @@ -576,9 +580,9 @@ class CJson { late final _cJSON_CreateIntArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Int32)>>('cJSON_CreateIntArray'); + ffi.Pointer, pkg_ffi.Int)>>('cJSON_CreateIntArray'); late final _cJSON_CreateIntArray = _cJSON_CreateIntArrayPtr - .asFunction Function(ffi.Pointer, int)>(); + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateFloatArray( ffi.Pointer numbers, @@ -593,7 +597,7 @@ class CJson { late final _cJSON_CreateFloatArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Int32)>>('cJSON_CreateFloatArray'); + ffi.Pointer, pkg_ffi.Int)>>('cJSON_CreateFloatArray'); late final _cJSON_CreateFloatArray = _cJSON_CreateFloatArrayPtr .asFunction Function(ffi.Pointer, int)>(); @@ -609,13 +613,13 @@ class CJson { late final _cJSON_CreateDoubleArrayPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int32)>>('cJSON_CreateDoubleArray'); + ffi.Pointer Function(ffi.Pointer, + pkg_ffi.Int)>>('cJSON_CreateDoubleArray'); late final _cJSON_CreateDoubleArray = _cJSON_CreateDoubleArrayPtr .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateStringArray( - ffi.Pointer> strings, + ffi.Pointer> strings, int count, ) { return _cJSON_CreateStringArray( @@ -626,10 +630,11 @@ class CJson { late final _cJSON_CreateStringArrayPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer>, - ffi.Int32)>>('cJSON_CreateStringArray'); + ffi.Pointer Function(ffi.Pointer>, + pkg_ffi.Int)>>('cJSON_CreateStringArray'); late final _cJSON_CreateStringArray = _cJSON_CreateStringArrayPtr.asFunction< - ffi.Pointer Function(ffi.Pointer>, int)>(); + ffi.Pointer Function( + ffi.Pointer>, int)>(); void cJSON_AddItemToArray( ffi.Pointer array, @@ -650,7 +655,7 @@ class CJson { void cJSON_AddItemToObject( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ffi.Pointer item, ) { return _cJSON_AddItemToObject( @@ -662,15 +667,15 @@ class CJson { late final _cJSON_AddItemToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemToObject'); late final _cJSON_AddItemToObject = _cJSON_AddItemToObjectPtr.asFunction< void Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_AddItemToObjectCS( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ffi.Pointer item, ) { return _cJSON_AddItemToObjectCS( @@ -682,11 +687,11 @@ class CJson { late final _cJSON_AddItemToObjectCSPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemToObjectCS'); late final _cJSON_AddItemToObjectCS = _cJSON_AddItemToObjectCSPtr.asFunction< void Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_AddItemReferenceToArray( ffi.Pointer array, @@ -707,7 +712,7 @@ class CJson { void cJSON_AddItemReferenceToObject( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ffi.Pointer item, ) { return _cJSON_AddItemReferenceToObject( @@ -719,12 +724,12 @@ class CJson { late final _cJSON_AddItemReferenceToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemReferenceToObject'); late final _cJSON_AddItemReferenceToObject = _cJSON_AddItemReferenceToObjectPtr.asFunction< - void Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); ffi.Pointer cJSON_DetachItemViaPointer( ffi.Pointer parent, @@ -758,7 +763,7 @@ class CJson { late final _cJSON_DetachItemFromArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Int32)>>('cJSON_DetachItemFromArray'); + ffi.Pointer, pkg_ffi.Int)>>('cJSON_DetachItemFromArray'); late final _cJSON_DetachItemFromArray = _cJSON_DetachItemFromArrayPtr .asFunction Function(ffi.Pointer, int)>(); @@ -773,14 +778,15 @@ class CJson { } late final _cJSON_DeleteItemFromArrayPtr = _lookup< - ffi.NativeFunction, ffi.Int32)>>( - 'cJSON_DeleteItemFromArray'); + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, pkg_ffi.Int)>>('cJSON_DeleteItemFromArray'); late final _cJSON_DeleteItemFromArray = _cJSON_DeleteItemFromArrayPtr .asFunction, int)>(); ffi.Pointer cJSON_DetachItemFromObject( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_DetachItemFromObject( object, @@ -791,15 +797,15 @@ class CJson { late final _cJSON_DetachItemFromObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_DetachItemFromObject'); + ffi.Pointer)>>('cJSON_DetachItemFromObject'); late final _cJSON_DetachItemFromObject = _cJSON_DetachItemFromObjectPtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_DetachItemFromObjectCaseSensitive( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_DetachItemFromObjectCaseSensitive( object, @@ -810,16 +816,16 @@ class CJson { late final _cJSON_DetachItemFromObjectCaseSensitivePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>( + ffi.Pointer, ffi.Pointer)>>( 'cJSON_DetachItemFromObjectCaseSensitive'); late final _cJSON_DetachItemFromObjectCaseSensitive = _cJSON_DetachItemFromObjectCaseSensitivePtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); void cJSON_DeleteItemFromObject( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_DeleteItemFromObject( object, @@ -830,13 +836,14 @@ class CJson { late final _cJSON_DeleteItemFromObjectPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_DeleteItemFromObject'); - late final _cJSON_DeleteItemFromObject = _cJSON_DeleteItemFromObjectPtr - .asFunction, ffi.Pointer)>(); + ffi.Pointer)>>('cJSON_DeleteItemFromObject'); + late final _cJSON_DeleteItemFromObject = + _cJSON_DeleteItemFromObjectPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); void cJSON_DeleteItemFromObjectCaseSensitive( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_DeleteItemFromObjectCaseSensitive( object, @@ -846,11 +853,12 @@ class CJson { late final _cJSON_DeleteItemFromObjectCaseSensitivePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer)>>( + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>( 'cJSON_DeleteItemFromObjectCaseSensitive'); late final _cJSON_DeleteItemFromObjectCaseSensitive = _cJSON_DeleteItemFromObjectCaseSensitivePtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer)>(); void cJSON_InsertItemInArray( ffi.Pointer array, @@ -866,7 +874,7 @@ class CJson { late final _cJSON_InsertItemInArrayPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Void Function(ffi.Pointer, pkg_ffi.Int, ffi.Pointer)>>('cJSON_InsertItemInArray'); late final _cJSON_InsertItemInArray = _cJSON_InsertItemInArrayPtr .asFunction, int, ffi.Pointer)>(); @@ -906,14 +914,14 @@ class CJson { late final _cJSON_ReplaceItemInArrayPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Void Function(ffi.Pointer, pkg_ffi.Int, ffi.Pointer)>>('cJSON_ReplaceItemInArray'); late final _cJSON_ReplaceItemInArray = _cJSON_ReplaceItemInArrayPtr .asFunction, int, ffi.Pointer)>(); void cJSON_ReplaceItemInObject( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ffi.Pointer newitem, ) { return _cJSON_ReplaceItemInObject( @@ -925,16 +933,16 @@ class CJson { late final _cJSON_ReplaceItemInObjectPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_ReplaceItemInObject'); late final _cJSON_ReplaceItemInObject = _cJSON_ReplaceItemInObjectPtr.asFunction< - void Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); void cJSON_ReplaceItemInObjectCaseSensitive( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ffi.Pointer newitem, ) { return _cJSON_ReplaceItemInObjectCaseSensitive( @@ -946,12 +954,12 @@ class CJson { late final _cJSON_ReplaceItemInObjectCaseSensitivePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_ReplaceItemInObjectCaseSensitive'); late final _cJSON_ReplaceItemInObjectCaseSensitive = _cJSON_ReplaceItemInObjectCaseSensitivePtr.asFunction< - void Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); ffi.Pointer cJSON_Duplicate( ffi.Pointer item, @@ -990,7 +998,7 @@ class CJson { .asFunction, ffi.Pointer, int)>(); void cJSON_Minify( - ffi.Pointer json, + ffi.Pointer json, ) { return _cJSON_Minify( json, @@ -998,14 +1006,14 @@ class CJson { } late final _cJSON_MinifyPtr = - _lookup)>>( + _lookup)>>( 'cJSON_Minify'); late final _cJSON_Minify = - _cJSON_MinifyPtr.asFunction)>(); + _cJSON_MinifyPtr.asFunction)>(); ffi.Pointer cJSON_AddNullToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, ) { return _cJSON_AddNullToObject( object, @@ -1016,13 +1024,14 @@ class CJson { late final _cJSON_AddNullToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_AddNullToObject'); + ffi.Pointer)>>('cJSON_AddNullToObject'); late final _cJSON_AddNullToObject = _cJSON_AddNullToObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddTrueToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, ) { return _cJSON_AddTrueToObject( object, @@ -1033,13 +1042,14 @@ class CJson { late final _cJSON_AddTrueToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_AddTrueToObject'); + ffi.Pointer)>>('cJSON_AddTrueToObject'); late final _cJSON_AddTrueToObject = _cJSON_AddTrueToObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddFalseToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, ) { return _cJSON_AddFalseToObject( object, @@ -1050,13 +1060,14 @@ class CJson { late final _cJSON_AddFalseToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_AddFalseToObject'); + ffi.Pointer)>>('cJSON_AddFalseToObject'); late final _cJSON_AddFalseToObject = _cJSON_AddFalseToObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddBoolToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, int boolean, ) { return _cJSON_AddBoolToObject( @@ -1068,15 +1079,15 @@ class CJson { late final _cJSON_AddBoolToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer, - cJSON_bool)>>('cJSON_AddBoolToObject'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, cJSON_bool)>>('cJSON_AddBoolToObject'); late final _cJSON_AddBoolToObject = _cJSON_AddBoolToObjectPtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer, ffi.Pointer, int)>(); ffi.Pointer cJSON_AddNumberToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, double number, ) { return _cJSON_AddNumberToObject( @@ -1088,16 +1099,18 @@ class CJson { late final _cJSON_AddNumberToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, ffi.Double)>>('cJSON_AddNumberToObject'); late final _cJSON_AddNumberToObject = _cJSON_AddNumberToObjectPtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); + ffi.Pointer, ffi.Pointer, double)>(); ffi.Pointer cJSON_AddStringToObject( ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer string, + ffi.Pointer name, + ffi.Pointer string, ) { return _cJSON_AddStringToObject( object, @@ -1108,16 +1121,18 @@ class CJson { late final _cJSON_AddStringToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('cJSON_AddStringToObject'); + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('cJSON_AddStringToObject'); late final _cJSON_AddStringToObject = _cJSON_AddStringToObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); ffi.Pointer cJSON_AddRawToObject( ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer raw, + ffi.Pointer name, + ffi.Pointer raw, ) { return _cJSON_AddRawToObject( object, @@ -1128,15 +1143,17 @@ class CJson { late final _cJSON_AddRawToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('cJSON_AddRawToObject'); + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('cJSON_AddRawToObject'); late final _cJSON_AddRawToObject = _cJSON_AddRawToObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); ffi.Pointer cJSON_AddObjectToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, ) { return _cJSON_AddObjectToObject( object, @@ -1147,13 +1164,14 @@ class CJson { late final _cJSON_AddObjectToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_AddObjectToObject'); + ffi.Pointer)>>('cJSON_AddObjectToObject'); late final _cJSON_AddObjectToObject = _cJSON_AddObjectToObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddArrayToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, ) { return _cJSON_AddArrayToObject( object, @@ -1164,9 +1182,10 @@ class CJson { late final _cJSON_AddArrayToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_AddArrayToObject'); + ffi.Pointer)>>('cJSON_AddArrayToObject'); late final _cJSON_AddArrayToObject = _cJSON_AddArrayToObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); double cJSON_SetNumberHelper( ffi.Pointer object, @@ -1194,7 +1213,7 @@ class CJson { } late final _cJSON_mallocPtr = - _lookup Function(ffi.IntPtr)>>( + _lookup Function(pkg_ffi.Size)>>( 'cJSON_malloc'); late final _cJSON_malloc = _cJSON_mallocPtr.asFunction Function(int)>(); @@ -1221,30 +1240,31 @@ class cJSON extends ffi.Struct { external ffi.Pointer child; - @ffi.Int32() + @pkg_ffi.Int() external int type; - external ffi.Pointer valuestring; + external ffi.Pointer valuestring; - @ffi.Int32() + @pkg_ffi.Int() external int valueint; @ffi.Double() external double valuedouble; - external ffi.Pointer string; + external ffi.Pointer string; } class cJSON_Hooks extends ffi.Struct { external ffi.Pointer< - ffi.NativeFunction Function(ffi.IntPtr)>> malloc_fn; + ffi.NativeFunction Function(pkg_ffi.Size)>> + malloc_fn; external ffi .Pointer)>> free_fn; } -typedef cJSON_bool = ffi.Int32; +typedef cJSON_bool = pkg_ffi.Int; const int CJSON_VERSION_MAJOR = 1; diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index 78cc9c651d..2255e6fc07 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -4,6 +4,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; /// Bindings to LibClang. class LibClang { @@ -21,7 +22,7 @@ class LibClang { : _lookup = lookup; /// Retrieve the character data associated with the given string. - ffi.Pointer clang_getCString( + ffi.Pointer clang_getCString( CXString string, ) { return _clang_getCString( @@ -30,10 +31,10 @@ class LibClang { } late final _clang_getCStringPtr = - _lookup Function(CXString)>>( + _lookup Function(CXString)>>( 'clang_getCString'); late final _clang_getCString = _clang_getCStringPtr - .asFunction Function(CXString)>(); + .asFunction Function(CXString)>(); /// Free the given string. void clang_disposeString( @@ -72,7 +73,7 @@ class LibClang { } late final _clang_getBuildSessionTimestampPtr = - _lookup>( + _lookup>( 'clang_getBuildSessionTimestamp'); late final _clang_getBuildSessionTimestamp = _clang_getBuildSessionTimestampPtr.asFunction(); @@ -87,9 +88,10 @@ class LibClang { ); } - late final _clang_VirtualFileOverlay_createPtr = - _lookup>( - 'clang_VirtualFileOverlay_create'); + late final _clang_VirtualFileOverlay_createPtr = _lookup< + ffi.NativeFunction< + CXVirtualFileOverlay Function( + pkg_ffi.UnsignedInt)>>('clang_VirtualFileOverlay_create'); late final _clang_VirtualFileOverlay_create = _clang_VirtualFileOverlay_createPtr .asFunction(); @@ -98,8 +100,8 @@ class LibClang { /// path must be canonicalized (not contain "."/".."). int clang_VirtualFileOverlay_addFileMapping( CXVirtualFileOverlay arg0, - ffi.Pointer virtualPath, - ffi.Pointer realPath, + ffi.Pointer virtualPath, + ffi.Pointer realPath, ) { return _clang_VirtualFileOverlay_addFileMapping( arg0, @@ -110,13 +112,13 @@ class LibClang { late final _clang_VirtualFileOverlay_addFileMappingPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(CXVirtualFileOverlay, ffi.Pointer, - ffi.Pointer)>>( + ffi.Int32 Function(CXVirtualFileOverlay, + ffi.Pointer, ffi.Pointer)>>( 'clang_VirtualFileOverlay_addFileMapping'); late final _clang_VirtualFileOverlay_addFileMapping = _clang_VirtualFileOverlay_addFileMappingPtr.asFunction< - int Function(CXVirtualFileOverlay, ffi.Pointer, - ffi.Pointer)>(); + int Function(CXVirtualFileOverlay, ffi.Pointer, + ffi.Pointer)>(); /// Set the case sensitivity for the CXVirtualFileOverlay object. The /// CXVirtualFileOverlay object is case-sensitive by default, this option can @@ -134,7 +136,7 @@ class LibClang { late final _clang_VirtualFileOverlay_setCaseSensitivityPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(CXVirtualFileOverlay, - ffi.Int32)>>('clang_VirtualFileOverlay_setCaseSensitivity'); + pkg_ffi.Int)>>('clang_VirtualFileOverlay_setCaseSensitivity'); late final _clang_VirtualFileOverlay_setCaseSensitivity = _clang_VirtualFileOverlay_setCaseSensitivityPtr .asFunction(); @@ -143,8 +145,8 @@ class LibClang { int clang_VirtualFileOverlay_writeToBuffer( CXVirtualFileOverlay arg0, int options, - ffi.Pointer> out_buffer_ptr, - ffi.Pointer out_buffer_size, + ffi.Pointer> out_buffer_ptr, + ffi.Pointer out_buffer_size, ) { return _clang_VirtualFileOverlay_writeToBuffer( arg0, @@ -158,14 +160,17 @@ class LibClang { ffi.NativeFunction< ffi.Int32 Function( CXVirtualFileOverlay, - ffi.Uint32, - ffi.Pointer>, - ffi.Pointer)>>( + pkg_ffi.UnsignedInt, + ffi.Pointer>, + ffi.Pointer)>>( 'clang_VirtualFileOverlay_writeToBuffer'); late final _clang_VirtualFileOverlay_writeToBuffer = _clang_VirtualFileOverlay_writeToBufferPtr.asFunction< - int Function(CXVirtualFileOverlay, int, - ffi.Pointer>, ffi.Pointer)>(); + int Function( + CXVirtualFileOverlay, + int, + ffi.Pointer>, + ffi.Pointer)>(); /// free memory allocated by libclang, such as the buffer returned by /// CXVirtualFileOverlay() or clang_ModuleMapDescriptor_writeToBuffer(). @@ -209,9 +214,10 @@ class LibClang { ); } - late final _clang_ModuleMapDescriptor_createPtr = - _lookup>( - 'clang_ModuleMapDescriptor_create'); + late final _clang_ModuleMapDescriptor_createPtr = _lookup< + ffi.NativeFunction< + CXModuleMapDescriptor Function( + pkg_ffi.UnsignedInt)>>('clang_ModuleMapDescriptor_create'); late final _clang_ModuleMapDescriptor_create = _clang_ModuleMapDescriptor_createPtr .asFunction(); @@ -219,7 +225,7 @@ class LibClang { /// Sets the framework module name that the module.map describes. int clang_ModuleMapDescriptor_setFrameworkModuleName( CXModuleMapDescriptor arg0, - ffi.Pointer name, + ffi.Pointer name, ) { return _clang_ModuleMapDescriptor_setFrameworkModuleName( arg0, @@ -230,16 +236,16 @@ class LibClang { late final _clang_ModuleMapDescriptor_setFrameworkModuleNamePtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( - CXModuleMapDescriptor, ffi.Pointer)>>( + CXModuleMapDescriptor, ffi.Pointer)>>( 'clang_ModuleMapDescriptor_setFrameworkModuleName'); late final _clang_ModuleMapDescriptor_setFrameworkModuleName = _clang_ModuleMapDescriptor_setFrameworkModuleNamePtr.asFunction< - int Function(CXModuleMapDescriptor, ffi.Pointer)>(); + int Function(CXModuleMapDescriptor, ffi.Pointer)>(); /// Sets the umbrealla header name that the module.map describes. int clang_ModuleMapDescriptor_setUmbrellaHeader( CXModuleMapDescriptor arg0, - ffi.Pointer name, + ffi.Pointer name, ) { return _clang_ModuleMapDescriptor_setUmbrellaHeader( arg0, @@ -250,18 +256,18 @@ class LibClang { late final _clang_ModuleMapDescriptor_setUmbrellaHeaderPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( - CXModuleMapDescriptor, ffi.Pointer)>>( + CXModuleMapDescriptor, ffi.Pointer)>>( 'clang_ModuleMapDescriptor_setUmbrellaHeader'); late final _clang_ModuleMapDescriptor_setUmbrellaHeader = _clang_ModuleMapDescriptor_setUmbrellaHeaderPtr.asFunction< - int Function(CXModuleMapDescriptor, ffi.Pointer)>(); + int Function(CXModuleMapDescriptor, ffi.Pointer)>(); /// Write out the CXModuleMapDescriptor object to a char buffer. int clang_ModuleMapDescriptor_writeToBuffer( CXModuleMapDescriptor arg0, int options, - ffi.Pointer> out_buffer_ptr, - ffi.Pointer out_buffer_size, + ffi.Pointer> out_buffer_ptr, + ffi.Pointer out_buffer_size, ) { return _clang_ModuleMapDescriptor_writeToBuffer( arg0, @@ -275,14 +281,17 @@ class LibClang { ffi.NativeFunction< ffi.Int32 Function( CXModuleMapDescriptor, - ffi.Uint32, - ffi.Pointer>, - ffi.Pointer)>>( + pkg_ffi.UnsignedInt, + ffi.Pointer>, + ffi.Pointer)>>( 'clang_ModuleMapDescriptor_writeToBuffer'); late final _clang_ModuleMapDescriptor_writeToBuffer = _clang_ModuleMapDescriptor_writeToBufferPtr.asFunction< - int Function(CXModuleMapDescriptor, int, - ffi.Pointer>, ffi.Pointer)>(); + int Function( + CXModuleMapDescriptor, + int, + ffi.Pointer>, + ffi.Pointer)>(); /// Dispose a CXModuleMapDescriptor object. void clang_ModuleMapDescriptor_dispose( @@ -312,7 +321,7 @@ class LibClang { } late final _clang_createIndexPtr = - _lookup>( + _lookup>( 'clang_createIndex'); late final _clang_createIndex = _clang_createIndexPtr.asFunction(); @@ -343,9 +352,9 @@ class LibClang { ); } - late final _clang_CXIndex_setGlobalOptionsPtr = - _lookup>( - 'clang_CXIndex_setGlobalOptions'); + late final _clang_CXIndex_setGlobalOptionsPtr = _lookup< + ffi.NativeFunction>( + 'clang_CXIndex_setGlobalOptions'); late final _clang_CXIndex_setGlobalOptions = _clang_CXIndex_setGlobalOptionsPtr .asFunction(); @@ -360,7 +369,7 @@ class LibClang { } late final _clang_CXIndex_getGlobalOptionsPtr = - _lookup>( + _lookup>( 'clang_CXIndex_getGlobalOptions'); late final _clang_CXIndex_getGlobalOptions = _clang_CXIndex_getGlobalOptionsPtr.asFunction(); @@ -368,7 +377,7 @@ class LibClang { /// Sets the invocation emission path option in a CXIndex. void clang_CXIndex_setInvocationEmissionPathOption( CXIndex arg0, - ffi.Pointer Path, + ffi.Pointer Path, ) { return _clang_CXIndex_setInvocationEmissionPathOption( arg0, @@ -378,11 +387,11 @@ class LibClang { late final _clang_CXIndex_setInvocationEmissionPathOptionPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CXIndex, ffi.Pointer)>>( + ffi.Void Function(CXIndex, ffi.Pointer)>>( 'clang_CXIndex_setInvocationEmissionPathOption'); late final _clang_CXIndex_setInvocationEmissionPathOption = _clang_CXIndex_setInvocationEmissionPathOptionPtr - .asFunction)>(); + .asFunction)>(); /// Retrieve the complete file and path name of the given file. CXString clang_getFileName( @@ -427,7 +436,7 @@ class LibClang { late final _clang_getFileUniqueIDPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( CXFile, ffi.Pointer)>>('clang_getFileUniqueID'); late final _clang_getFileUniqueID = _clang_getFileUniqueIDPtr .asFunction)>(); @@ -446,8 +455,9 @@ class LibClang { } late final _clang_isFileMultipleIncludeGuardedPtr = _lookup< - ffi.NativeFunction>( - 'clang_isFileMultipleIncludeGuarded'); + ffi.NativeFunction< + pkg_ffi.UnsignedInt Function(CXTranslationUnit, + CXFile)>>('clang_isFileMultipleIncludeGuarded'); late final _clang_isFileMultipleIncludeGuarded = _clang_isFileMultipleIncludeGuardedPtr .asFunction(); @@ -455,7 +465,7 @@ class LibClang { /// Retrieve a file handle within the given translation unit. CXFile clang_getFile( CXTranslationUnit tu, - ffi.Pointer file_name, + ffi.Pointer file_name, ) { return _clang_getFile( tu, @@ -466,15 +476,15 @@ class LibClang { late final _clang_getFilePtr = _lookup< ffi.NativeFunction< CXFile Function( - CXTranslationUnit, ffi.Pointer)>>('clang_getFile'); - late final _clang_getFile = _clang_getFilePtr - .asFunction)>(); + CXTranslationUnit, ffi.Pointer)>>('clang_getFile'); + late final _clang_getFile = _clang_getFilePtr.asFunction< + CXFile Function(CXTranslationUnit, ffi.Pointer)>(); /// Retrieve the buffer associated with the given file. - ffi.Pointer clang_getFileContents( + ffi.Pointer clang_getFileContents( CXTranslationUnit tu, CXFile file, - ffi.Pointer size, + ffi.Pointer size, ) { return _clang_getFileContents( tu, @@ -485,11 +495,11 @@ class LibClang { late final _clang_getFileContentsPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(CXTranslationUnit, CXFile, - ffi.Pointer)>>('clang_getFileContents'); + ffi.Pointer Function(CXTranslationUnit, CXFile, + ffi.Pointer)>>('clang_getFileContents'); late final _clang_getFileContents = _clang_getFileContentsPtr.asFunction< - ffi.Pointer Function( - CXTranslationUnit, CXFile, ffi.Pointer)>(); + ffi.Pointer Function( + CXTranslationUnit, CXFile, ffi.Pointer)>(); /// Returns non-zero if the file1 and file2 point to the same file, or they /// are both NULL. @@ -504,7 +514,7 @@ class LibClang { } late final _clang_File_isEqualPtr = - _lookup>( + _lookup>( 'clang_File_isEqual'); late final _clang_File_isEqual = _clang_File_isEqualPtr.asFunction(); @@ -549,7 +559,7 @@ class LibClang { late final _clang_equalLocationsPtr = _lookup< ffi.NativeFunction< - ffi.Uint32 Function( + pkg_ffi.UnsignedInt Function( CXSourceLocation, CXSourceLocation)>>('clang_equalLocations'); late final _clang_equalLocations = _clang_equalLocationsPtr .asFunction(); @@ -572,8 +582,8 @@ class LibClang { late final _clang_getLocationPtr = _lookup< ffi.NativeFunction< - CXSourceLocation Function(CXTranslationUnit, CXFile, ffi.Uint32, - ffi.Uint32)>>('clang_getLocation'); + CXSourceLocation Function(CXTranslationUnit, CXFile, + pkg_ffi.UnsignedInt, pkg_ffi.UnsignedInt)>>('clang_getLocation'); late final _clang_getLocation = _clang_getLocationPtr.asFunction< CXSourceLocation Function(CXTranslationUnit, CXFile, int, int)>(); @@ -594,7 +604,7 @@ class LibClang { late final _clang_getLocationForOffsetPtr = _lookup< ffi.NativeFunction< CXSourceLocation Function(CXTranslationUnit, CXFile, - ffi.Uint32)>>('clang_getLocationForOffset'); + pkg_ffi.UnsignedInt)>>('clang_getLocationForOffset'); late final _clang_getLocationForOffset = _clang_getLocationForOffsetPtr .asFunction(); @@ -608,7 +618,7 @@ class LibClang { } late final _clang_Location_isInSystemHeaderPtr = - _lookup>( + _lookup>( 'clang_Location_isInSystemHeader'); late final _clang_Location_isInSystemHeader = _clang_Location_isInSystemHeaderPtr @@ -625,7 +635,7 @@ class LibClang { } late final _clang_Location_isFromMainFilePtr = - _lookup>( + _lookup>( 'clang_Location_isFromMainFile'); late final _clang_Location_isFromMainFile = _clang_Location_isFromMainFilePtr .asFunction(); @@ -672,7 +682,7 @@ class LibClang { late final _clang_equalRangesPtr = _lookup< ffi.NativeFunction< - ffi.Uint32 Function( + pkg_ffi.UnsignedInt Function( CXSourceRange, CXSourceRange)>>('clang_equalRanges'); late final _clang_equalRanges = _clang_equalRangesPtr .asFunction(); @@ -687,7 +697,7 @@ class LibClang { } late final _clang_Range_isNullPtr = - _lookup>( + _lookup>( 'clang_Range_isNull'); late final _clang_Range_isNull = _clang_Range_isNullPtr.asFunction(); @@ -697,9 +707,9 @@ class LibClang { void clang_getExpansionLocation( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_getExpansionLocation( location, @@ -715,25 +725,25 @@ class LibClang { ffi.Void Function( CXSourceLocation, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('clang_getExpansionLocation'); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_getExpansionLocation'); late final _clang_getExpansionLocation = _clang_getExpansionLocationPtr.asFunction< void Function( CXSourceLocation, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// 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, + ffi.Pointer line, + ffi.Pointer column, ) { return _clang_getPresumedLocation( location, @@ -748,21 +758,24 @@ class LibClang { ffi.Void Function( CXSourceLocation, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('clang_getPresumedLocation'); + ffi.Pointer, + ffi.Pointer)>>('clang_getPresumedLocation'); late final _clang_getPresumedLocation = _clang_getPresumedLocationPtr.asFunction< - void Function(CXSourceLocation, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// 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, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_getInstantiationLocation( location, @@ -774,30 +787,31 @@ class LibClang { } late final _clang_getInstantiationLocationPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CXSourceLocation, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('clang_getInstantiationLocation'); + ffi.NativeFunction< + ffi.Void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + 'clang_getInstantiationLocation'); late final _clang_getInstantiationLocation = _clang_getInstantiationLocationPtr.asFunction< void Function( CXSourceLocation, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// 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, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_getSpellingLocation( location, @@ -813,26 +827,26 @@ class LibClang { ffi.Void Function( CXSourceLocation, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('clang_getSpellingLocation'); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_getSpellingLocation'); late final _clang_getSpellingLocation = _clang_getSpellingLocationPtr.asFunction< void Function( CXSourceLocation, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// 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, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_getFileLocation( location, @@ -848,16 +862,16 @@ class LibClang { ffi.Void Function( CXSourceLocation, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('clang_getFileLocation'); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_getFileLocation'); late final _clang_getFileLocation = _clang_getFileLocationPtr.asFunction< void Function( CXSourceLocation, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve a source location representing the first character within a /// source range. @@ -950,9 +964,9 @@ class LibClang { ); } - late final _clang_getNumDiagnosticsInSetPtr = - _lookup>( - 'clang_getNumDiagnosticsInSet'); + late final _clang_getNumDiagnosticsInSetPtr = _lookup< + ffi.NativeFunction>( + 'clang_getNumDiagnosticsInSet'); late final _clang_getNumDiagnosticsInSet = _clang_getNumDiagnosticsInSetPtr .asFunction(); @@ -969,14 +983,14 @@ class LibClang { late final _clang_getDiagnosticInSetPtr = _lookup< ffi.NativeFunction< - CXDiagnostic Function( - CXDiagnosticSet, ffi.Uint32)>>('clang_getDiagnosticInSet'); + CXDiagnostic Function(CXDiagnosticSet, + pkg_ffi.UnsignedInt)>>('clang_getDiagnosticInSet'); late final _clang_getDiagnosticInSet = _clang_getDiagnosticInSetPtr .asFunction(); /// Deserialize a set of diagnostics from a Clang diagnostics bitcode file. CXDiagnosticSet clang_loadDiagnostics( - ffi.Pointer file, + ffi.Pointer file, ffi.Pointer error, ffi.Pointer errorString, ) { @@ -990,12 +1004,12 @@ class LibClang { late final _clang_loadDiagnosticsPtr = _lookup< ffi.NativeFunction< CXDiagnosticSet Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('clang_loadDiagnostics'); late final _clang_loadDiagnostics = _clang_loadDiagnosticsPtr.asFunction< - CXDiagnosticSet Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + CXDiagnosticSet Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// Release a CXDiagnosticSet and all of its contained diagnostics. void clang_disposeDiagnosticSet( @@ -1037,9 +1051,9 @@ class LibClang { ); } - late final _clang_getNumDiagnosticsPtr = - _lookup>( - 'clang_getNumDiagnostics'); + late final _clang_getNumDiagnosticsPtr = _lookup< + ffi.NativeFunction>( + 'clang_getNumDiagnostics'); late final _clang_getNumDiagnostics = _clang_getNumDiagnosticsPtr.asFunction(); @@ -1057,7 +1071,7 @@ class LibClang { late final _clang_getDiagnosticPtr = _lookup< ffi.NativeFunction< CXDiagnostic Function( - CXTranslationUnit, ffi.Uint32)>>('clang_getDiagnostic'); + CXTranslationUnit, pkg_ffi.UnsignedInt)>>('clang_getDiagnostic'); late final _clang_getDiagnostic = _clang_getDiagnosticPtr .asFunction(); @@ -1103,9 +1117,10 @@ class LibClang { ); } - late final _clang_formatDiagnosticPtr = - _lookup>( - 'clang_formatDiagnostic'); + late final _clang_formatDiagnosticPtr = _lookup< + ffi.NativeFunction< + CXString Function( + CXDiagnostic, pkg_ffi.UnsignedInt)>>('clang_formatDiagnostic'); late final _clang_formatDiagnostic = _clang_formatDiagnosticPtr .asFunction(); @@ -1116,7 +1131,7 @@ class LibClang { } late final _clang_defaultDiagnosticDisplayOptionsPtr = - _lookup>( + _lookup>( 'clang_defaultDiagnosticDisplayOptions'); late final _clang_defaultDiagnosticDisplayOptions = _clang_defaultDiagnosticDisplayOptionsPtr.asFunction(); @@ -1194,7 +1209,7 @@ class LibClang { } late final _clang_getDiagnosticCategoryPtr = - _lookup>( + _lookup>( 'clang_getDiagnosticCategory'); late final _clang_getDiagnosticCategory = _clang_getDiagnosticCategoryPtr.asFunction(); @@ -1210,7 +1225,7 @@ class LibClang { } late final _clang_getDiagnosticCategoryNamePtr = - _lookup>( + _lookup>( 'clang_getDiagnosticCategoryName'); late final _clang_getDiagnosticCategoryName = _clang_getDiagnosticCategoryNamePtr.asFunction(); @@ -1242,7 +1257,7 @@ class LibClang { } late final _clang_getDiagnosticNumRangesPtr = - _lookup>( + _lookup>( 'clang_getDiagnosticNumRanges'); late final _clang_getDiagnosticNumRanges = _clang_getDiagnosticNumRangesPtr.asFunction(); @@ -1259,8 +1274,9 @@ class LibClang { } late final _clang_getDiagnosticRangePtr = _lookup< - ffi.NativeFunction>( - 'clang_getDiagnosticRange'); + ffi.NativeFunction< + CXSourceRange Function( + CXDiagnostic, pkg_ffi.UnsignedInt)>>('clang_getDiagnosticRange'); late final _clang_getDiagnosticRange = _clang_getDiagnosticRangePtr .asFunction(); @@ -1274,7 +1290,7 @@ class LibClang { } late final _clang_getDiagnosticNumFixItsPtr = - _lookup>( + _lookup>( 'clang_getDiagnosticNumFixIts'); late final _clang_getDiagnosticNumFixIts = _clang_getDiagnosticNumFixItsPtr.asFunction(); @@ -1294,7 +1310,7 @@ class LibClang { late final _clang_getDiagnosticFixItPtr = _lookup< ffi.NativeFunction< - CXString Function(CXDiagnostic, ffi.Uint32, + CXString Function(CXDiagnostic, pkg_ffi.UnsignedInt, ffi.Pointer)>>('clang_getDiagnosticFixIt'); late final _clang_getDiagnosticFixIt = _clang_getDiagnosticFixItPtr.asFunction< @@ -1320,9 +1336,9 @@ class LibClang { /// command line arguments one would pass to the compiler. CXTranslationUnit clang_createTranslationUnitFromSourceFile( CXIndex CIdx, - ffi.Pointer source_filename, + ffi.Pointer source_filename, int num_clang_command_line_args, - ffi.Pointer> clang_command_line_args, + ffi.Pointer> clang_command_line_args, int num_unsaved_files, ffi.Pointer unsaved_files, ) { @@ -1340,19 +1356,19 @@ class LibClang { ffi.NativeFunction< CXTranslationUnit Function( CXIndex, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, - ffi.Uint32, + ffi.Pointer, + pkg_ffi.Int, + ffi.Pointer>, + pkg_ffi.UnsignedInt, ffi.Pointer)>>( 'clang_createTranslationUnitFromSourceFile'); late final _clang_createTranslationUnitFromSourceFile = _clang_createTranslationUnitFromSourceFilePtr.asFunction< CXTranslationUnit Function( CXIndex, - ffi.Pointer, + ffi.Pointer, int, - ffi.Pointer>, + ffi.Pointer>, int, ffi.Pointer)>(); @@ -1361,7 +1377,7 @@ class LibClang { /// CXTranslationUnit, without further detailed error codes. CXTranslationUnit clang_createTranslationUnit( CXIndex CIdx, - ffi.Pointer ast_filename, + ffi.Pointer ast_filename, ) { return _clang_createTranslationUnit( CIdx, @@ -1371,15 +1387,16 @@ class LibClang { late final _clang_createTranslationUnitPtr = _lookup< ffi.NativeFunction< - CXTranslationUnit Function( - CXIndex, ffi.Pointer)>>('clang_createTranslationUnit'); - late final _clang_createTranslationUnit = _clang_createTranslationUnitPtr - .asFunction)>(); + CXTranslationUnit Function(CXIndex, + ffi.Pointer)>>('clang_createTranslationUnit'); + late final _clang_createTranslationUnit = + _clang_createTranslationUnitPtr.asFunction< + CXTranslationUnit Function(CXIndex, ffi.Pointer)>(); /// Create a translation unit from an AST file ( -emit-ast). int clang_createTranslationUnit2( CXIndex CIdx, - ffi.Pointer ast_filename, + ffi.Pointer ast_filename, ffi.Pointer out_TU, ) { return _clang_createTranslationUnit2( @@ -1391,11 +1408,11 @@ class LibClang { late final _clang_createTranslationUnit2Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(CXIndex, ffi.Pointer, + ffi.Int32 Function(CXIndex, ffi.Pointer, ffi.Pointer)>>('clang_createTranslationUnit2'); late final _clang_createTranslationUnit2 = _clang_createTranslationUnit2Ptr.asFunction< - int Function(CXIndex, ffi.Pointer, + int Function(CXIndex, ffi.Pointer, ffi.Pointer)>(); /// Returns the set of flags that is suitable for parsing a translation unit @@ -1405,7 +1422,7 @@ class LibClang { } late final _clang_defaultEditingTranslationUnitOptionsPtr = - _lookup>( + _lookup>( 'clang_defaultEditingTranslationUnitOptions'); late final _clang_defaultEditingTranslationUnitOptions = _clang_defaultEditingTranslationUnitOptionsPtr @@ -1416,8 +1433,8 @@ class LibClang { /// CXTranslationUnit, without further detailed error codes. CXTranslationUnit clang_parseTranslationUnit( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -1438,18 +1455,18 @@ class LibClang { ffi.NativeFunction< CXTranslationUnit Function( CXIndex, - ffi.Pointer, - ffi.Pointer>, - ffi.Int32, + ffi.Pointer, + ffi.Pointer>, + pkg_ffi.Int, ffi.Pointer, - ffi.Uint32, - ffi.Uint32)>>('clang_parseTranslationUnit'); + pkg_ffi.UnsignedInt, + pkg_ffi.UnsignedInt)>>('clang_parseTranslationUnit'); late final _clang_parseTranslationUnit = _clang_parseTranslationUnitPtr.asFunction< CXTranslationUnit Function( CXIndex, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>, int, ffi.Pointer, int, @@ -1459,8 +1476,8 @@ class LibClang { /// file. int clang_parseTranslationUnit2( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -1483,19 +1500,19 @@ class LibClang { ffi.NativeFunction< ffi.Int32 Function( CXIndex, - ffi.Pointer, - ffi.Pointer>, - ffi.Int32, + ffi.Pointer, + ffi.Pointer>, + pkg_ffi.Int, ffi.Pointer, - ffi.Uint32, - ffi.Uint32, + pkg_ffi.UnsignedInt, + pkg_ffi.UnsignedInt, ffi.Pointer)>>('clang_parseTranslationUnit2'); late final _clang_parseTranslationUnit2 = _clang_parseTranslationUnit2Ptr.asFunction< int Function( CXIndex, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>, int, ffi.Pointer, int, @@ -1507,8 +1524,8 @@ class LibClang { /// library paths are relative to the binary. int clang_parseTranslationUnit2FullArgv( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -1531,20 +1548,20 @@ class LibClang { ffi.NativeFunction< ffi.Int32 Function( CXIndex, - ffi.Pointer, - ffi.Pointer>, - ffi.Int32, + ffi.Pointer, + ffi.Pointer>, + pkg_ffi.Int, ffi.Pointer, - ffi.Uint32, - ffi.Uint32, + pkg_ffi.UnsignedInt, + pkg_ffi.UnsignedInt, ffi.Pointer)>>( 'clang_parseTranslationUnit2FullArgv'); late final _clang_parseTranslationUnit2FullArgv = _clang_parseTranslationUnit2FullArgvPtr.asFunction< int Function( CXIndex, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>, int, ffi.Pointer, int, @@ -1560,9 +1577,9 @@ class LibClang { ); } - late final _clang_defaultSaveOptionsPtr = - _lookup>( - 'clang_defaultSaveOptions'); + late final _clang_defaultSaveOptionsPtr = _lookup< + ffi.NativeFunction>( + 'clang_defaultSaveOptions'); late final _clang_defaultSaveOptions = _clang_defaultSaveOptionsPtr .asFunction(); @@ -1570,7 +1587,7 @@ class LibClang { /// translation unit on disk. int clang_saveTranslationUnit( CXTranslationUnit TU, - ffi.Pointer FileName, + ffi.Pointer FileName, int options, ) { return _clang_saveTranslationUnit( @@ -1582,11 +1599,11 @@ class LibClang { late final _clang_saveTranslationUnitPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(CXTranslationUnit, ffi.Pointer, - ffi.Uint32)>>('clang_saveTranslationUnit'); + pkg_ffi.Int Function(CXTranslationUnit, ffi.Pointer, + pkg_ffi.UnsignedInt)>>('clang_saveTranslationUnit'); late final _clang_saveTranslationUnit = _clang_saveTranslationUnitPtr.asFunction< - int Function(CXTranslationUnit, ffi.Pointer, int)>(); + int Function(CXTranslationUnit, ffi.Pointer, int)>(); /// Suspend a translation unit in order to free memory associated with it. int clang_suspendTranslationUnit( @@ -1597,9 +1614,9 @@ class LibClang { ); } - late final _clang_suspendTranslationUnitPtr = - _lookup>( - 'clang_suspendTranslationUnit'); + late final _clang_suspendTranslationUnitPtr = _lookup< + ffi.NativeFunction>( + 'clang_suspendTranslationUnit'); late final _clang_suspendTranslationUnit = _clang_suspendTranslationUnitPtr .asFunction(); @@ -1628,9 +1645,9 @@ class LibClang { ); } - late final _clang_defaultReparseOptionsPtr = - _lookup>( - 'clang_defaultReparseOptions'); + late final _clang_defaultReparseOptionsPtr = _lookup< + ffi.NativeFunction>( + 'clang_defaultReparseOptions'); late final _clang_defaultReparseOptions = _clang_defaultReparseOptionsPtr .asFunction(); @@ -1651,11 +1668,11 @@ class LibClang { late final _clang_reparseTranslationUnitPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( CXTranslationUnit, - ffi.Uint32, + pkg_ffi.UnsignedInt, ffi.Pointer, - ffi.Uint32)>>('clang_reparseTranslationUnit'); + pkg_ffi.UnsignedInt)>>('clang_reparseTranslationUnit'); late final _clang_reparseTranslationUnit = _clang_reparseTranslationUnitPtr.asFunction< int Function( @@ -1663,7 +1680,7 @@ class LibClang { /// Returns the human-readable null-terminated C string that represents the /// name of the memory category. This string should never be freed. - ffi.Pointer clang_getTUResourceUsageName( + ffi.Pointer clang_getTUResourceUsageName( int kind, ) { return _clang_getTUResourceUsageName( @@ -1671,11 +1688,11 @@ class LibClang { ); } - late final _clang_getTUResourceUsageNamePtr = - _lookup Function(ffi.Int32)>>( - 'clang_getTUResourceUsageName'); + late final _clang_getTUResourceUsageNamePtr = _lookup< + ffi.NativeFunction Function(ffi.Int32)>>( + 'clang_getTUResourceUsageName'); late final _clang_getTUResourceUsageName = _clang_getTUResourceUsageNamePtr - .asFunction Function(int)>(); + .asFunction Function(int)>(); /// Return the memory usage of a translation unit. This object should be /// released with clang_disposeCXTUResourceUsage(). @@ -1764,7 +1781,7 @@ class LibClang { } late final _clang_TargetInfo_getPointerWidthPtr = - _lookup>( + _lookup>( 'clang_TargetInfo_getPointerWidth'); late final _clang_TargetInfo_getPointerWidth = _clang_TargetInfo_getPointerWidthPtr @@ -1807,9 +1824,9 @@ class LibClang { ); } - late final _clang_equalCursorsPtr = - _lookup>( - 'clang_equalCursors'); + late final _clang_equalCursorsPtr = _lookup< + ffi.NativeFunction>( + 'clang_equalCursors'); late final _clang_equalCursors = _clang_equalCursorsPtr.asFunction(); @@ -1823,7 +1840,7 @@ class LibClang { } late final _clang_Cursor_isNullPtr = - _lookup>( + _lookup>( 'clang_Cursor_isNull'); late final _clang_Cursor_isNull = _clang_Cursor_isNullPtr.asFunction(); @@ -1838,7 +1855,7 @@ class LibClang { } late final _clang_hashCursorPtr = - _lookup>( + _lookup>( 'clang_hashCursor'); late final _clang_hashCursor = _clang_hashCursorPtr.asFunction(); @@ -1868,7 +1885,7 @@ class LibClang { } late final _clang_isDeclarationPtr = - _lookup>( + _lookup>( 'clang_isDeclaration'); late final _clang_isDeclaration = _clang_isDeclarationPtr.asFunction(); @@ -1883,7 +1900,7 @@ class LibClang { } late final _clang_isInvalidDeclarationPtr = - _lookup>( + _lookup>( 'clang_isInvalidDeclaration'); late final _clang_isInvalidDeclaration = _clang_isInvalidDeclarationPtr.asFunction(); @@ -1898,7 +1915,7 @@ class LibClang { } late final _clang_isReferencePtr = - _lookup>( + _lookup>( 'clang_isReference'); late final _clang_isReference = _clang_isReferencePtr.asFunction(); @@ -1913,7 +1930,7 @@ class LibClang { } late final _clang_isExpressionPtr = - _lookup>( + _lookup>( 'clang_isExpression'); late final _clang_isExpression = _clang_isExpressionPtr.asFunction(); @@ -1928,7 +1945,7 @@ class LibClang { } late final _clang_isStatementPtr = - _lookup>( + _lookup>( 'clang_isStatement'); late final _clang_isStatement = _clang_isStatementPtr.asFunction(); @@ -1943,7 +1960,7 @@ class LibClang { } late final _clang_isAttributePtr = - _lookup>( + _lookup>( 'clang_isAttribute'); late final _clang_isAttribute = _clang_isAttributePtr.asFunction(); @@ -1958,7 +1975,7 @@ class LibClang { } late final _clang_Cursor_hasAttrsPtr = - _lookup>( + _lookup>( 'clang_Cursor_hasAttrs'); late final _clang_Cursor_hasAttrs = _clang_Cursor_hasAttrsPtr.asFunction(); @@ -1973,7 +1990,7 @@ class LibClang { } late final _clang_isInvalidPtr = - _lookup>( + _lookup>( 'clang_isInvalid'); late final _clang_isInvalid = _clang_isInvalidPtr.asFunction(); @@ -1988,7 +2005,7 @@ class LibClang { } late final _clang_isTranslationUnitPtr = - _lookup>( + _lookup>( 'clang_isTranslationUnit'); late final _clang_isTranslationUnit = _clang_isTranslationUnitPtr.asFunction(); @@ -2004,7 +2021,7 @@ class LibClang { } late final _clang_isPreprocessingPtr = - _lookup>( + _lookup>( 'clang_isPreprocessing'); late final _clang_isPreprocessing = _clang_isPreprocessingPtr.asFunction(); @@ -2020,7 +2037,7 @@ class LibClang { } late final _clang_isUnexposedPtr = - _lookup>( + _lookup>( 'clang_isUnexposed'); late final _clang_isUnexposed = _clang_isUnexposedPtr.asFunction(); @@ -2075,9 +2092,9 @@ class LibClang { /// platforms for which availability information is known. int clang_getCursorPlatformAvailability( CXCursor cursor, - ffi.Pointer always_deprecated, + ffi.Pointer always_deprecated, ffi.Pointer deprecated_message, - ffi.Pointer always_unavailable, + ffi.Pointer always_unavailable, ffi.Pointer unavailable_message, ffi.Pointer availability, int availability_size, @@ -2095,21 +2112,21 @@ class LibClang { late final _clang_getCursorPlatformAvailabilityPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( CXCursor, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('clang_getCursorPlatformAvailability'); + pkg_ffi.Int)>>('clang_getCursorPlatformAvailability'); late final _clang_getCursorPlatformAvailability = _clang_getCursorPlatformAvailabilityPtr.asFunction< int Function( CXCursor, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); @@ -2215,9 +2232,10 @@ class LibClang { ); } - late final _clang_CXCursorSet_containsPtr = - _lookup>( - 'clang_CXCursorSet_contains'); + late final _clang_CXCursorSet_containsPtr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedInt Function( + CXCursorSet, CXCursor)>>('clang_CXCursorSet_contains'); late final _clang_CXCursorSet_contains = _clang_CXCursorSet_containsPtr .asFunction(); @@ -2232,9 +2250,10 @@ class LibClang { ); } - late final _clang_CXCursorSet_insertPtr = - _lookup>( - 'clang_CXCursorSet_insert'); + late final _clang_CXCursorSet_insertPtr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedInt Function( + CXCursorSet, CXCursor)>>('clang_CXCursorSet_insert'); late final _clang_CXCursorSet_insert = _clang_CXCursorSet_insertPtr .asFunction(); @@ -2272,7 +2291,7 @@ class LibClang { void clang_getOverriddenCursors( CXCursor cursor, ffi.Pointer> overridden, - ffi.Pointer num_overridden, + ffi.Pointer num_overridden, ) { return _clang_getOverriddenCursors( cursor, @@ -2284,11 +2303,11 @@ class LibClang { late final _clang_getOverriddenCursorsPtr = _lookup< ffi.NativeFunction< ffi.Void Function(CXCursor, ffi.Pointer>, - ffi.Pointer)>>('clang_getOverriddenCursors'); + ffi.Pointer)>>('clang_getOverriddenCursors'); late final _clang_getOverriddenCursors = _clang_getOverriddenCursorsPtr.asFunction< void Function(CXCursor, ffi.Pointer>, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Free the set of overridden cursors returned by /// clang_getOverriddenCursors(). @@ -2447,7 +2466,7 @@ class LibClang { } late final _clang_getEnumConstantDeclValuePtr = - _lookup>( + _lookup>( 'clang_getEnumConstantDeclValue'); late final _clang_getEnumConstantDeclValue = _clang_getEnumConstantDeclValuePtr.asFunction(); @@ -2463,7 +2482,7 @@ class LibClang { } late final _clang_getEnumConstantDeclUnsignedValuePtr = - _lookup>( + _lookup>( 'clang_getEnumConstantDeclUnsignedValue'); late final _clang_getEnumConstantDeclUnsignedValue = _clang_getEnumConstantDeclUnsignedValuePtr @@ -2479,7 +2498,7 @@ class LibClang { } late final _clang_getFieldDeclBitWidthPtr = - _lookup>( + _lookup>( 'clang_getFieldDeclBitWidth'); late final _clang_getFieldDeclBitWidth = _clang_getFieldDeclBitWidthPtr.asFunction(); @@ -2495,7 +2514,7 @@ class LibClang { } late final _clang_Cursor_getNumArgumentsPtr = - _lookup>( + _lookup>( 'clang_Cursor_getNumArguments'); late final _clang_Cursor_getNumArguments = _clang_Cursor_getNumArgumentsPtr.asFunction(); @@ -2511,9 +2530,9 @@ class LibClang { ); } - late final _clang_Cursor_getArgumentPtr = - _lookup>( - 'clang_Cursor_getArgument'); + late final _clang_Cursor_getArgumentPtr = _lookup< + ffi.NativeFunction>( + 'clang_Cursor_getArgument'); late final _clang_Cursor_getArgument = _clang_Cursor_getArgumentPtr .asFunction(); @@ -2528,7 +2547,7 @@ class LibClang { } late final _clang_Cursor_getNumTemplateArgumentsPtr = - _lookup>( + _lookup>( 'clang_Cursor_getNumTemplateArguments'); late final _clang_Cursor_getNumTemplateArguments = _clang_Cursor_getNumTemplateArgumentsPtr @@ -2545,9 +2564,10 @@ class LibClang { ); } - late final _clang_Cursor_getTemplateArgumentKindPtr = - _lookup>( - 'clang_Cursor_getTemplateArgumentKind'); + late final _clang_Cursor_getTemplateArgumentKindPtr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(CXCursor, + pkg_ffi.UnsignedInt)>>('clang_Cursor_getTemplateArgumentKind'); late final _clang_Cursor_getTemplateArgumentKind = _clang_Cursor_getTemplateArgumentKindPtr .asFunction(); @@ -2564,9 +2584,9 @@ class LibClang { ); } - late final _clang_Cursor_getTemplateArgumentTypePtr = - _lookup>( - 'clang_Cursor_getTemplateArgumentType'); + late final _clang_Cursor_getTemplateArgumentTypePtr = _lookup< + ffi.NativeFunction>( + 'clang_Cursor_getTemplateArgumentType'); late final _clang_Cursor_getTemplateArgumentType = _clang_Cursor_getTemplateArgumentTypePtr .asFunction(); @@ -2583,9 +2603,10 @@ class LibClang { ); } - late final _clang_Cursor_getTemplateArgumentValuePtr = - _lookup>( - 'clang_Cursor_getTemplateArgumentValue'); + late final _clang_Cursor_getTemplateArgumentValuePtr = _lookup< + ffi.NativeFunction< + pkg_ffi.LongLong Function(CXCursor, + pkg_ffi.UnsignedInt)>>('clang_Cursor_getTemplateArgumentValue'); late final _clang_Cursor_getTemplateArgumentValue = _clang_Cursor_getTemplateArgumentValuePtr .asFunction(); @@ -2602,9 +2623,11 @@ class LibClang { ); } - late final _clang_Cursor_getTemplateArgumentUnsignedValuePtr = - _lookup>( - 'clang_Cursor_getTemplateArgumentUnsignedValue'); + late final _clang_Cursor_getTemplateArgumentUnsignedValuePtr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedLongLong Function( + CXCursor, pkg_ffi.UnsignedInt)>>( + 'clang_Cursor_getTemplateArgumentUnsignedValue'); late final _clang_Cursor_getTemplateArgumentUnsignedValue = _clang_Cursor_getTemplateArgumentUnsignedValuePtr .asFunction(); @@ -2621,7 +2644,7 @@ class LibClang { } late final _clang_equalTypesPtr = - _lookup>( + _lookup>( 'clang_equalTypes'); late final _clang_equalTypes = _clang_equalTypesPtr.asFunction(); @@ -2652,7 +2675,7 @@ class LibClang { } late final _clang_isConstQualifiedTypePtr = - _lookup>( + _lookup>( 'clang_isConstQualifiedType'); late final _clang_isConstQualifiedType = _clang_isConstQualifiedTypePtr.asFunction(); @@ -2667,7 +2690,7 @@ class LibClang { } late final _clang_Cursor_isMacroFunctionLikePtr = - _lookup>( + _lookup>( 'clang_Cursor_isMacroFunctionLike'); late final _clang_Cursor_isMacroFunctionLike = _clang_Cursor_isMacroFunctionLikePtr.asFunction(); @@ -2682,7 +2705,7 @@ class LibClang { } late final _clang_Cursor_isMacroBuiltinPtr = - _lookup>( + _lookup>( 'clang_Cursor_isMacroBuiltin'); late final _clang_Cursor_isMacroBuiltin = _clang_Cursor_isMacroBuiltinPtr.asFunction(); @@ -2698,7 +2721,7 @@ class LibClang { } late final _clang_Cursor_isFunctionInlinedPtr = - _lookup>( + _lookup>( 'clang_Cursor_isFunctionInlined'); late final _clang_Cursor_isFunctionInlined = _clang_Cursor_isFunctionInlinedPtr.asFunction(); @@ -2715,7 +2738,7 @@ class LibClang { } late final _clang_isVolatileQualifiedTypePtr = - _lookup>( + _lookup>( 'clang_isVolatileQualifiedType'); late final _clang_isVolatileQualifiedType = _clang_isVolatileQualifiedTypePtr.asFunction(); @@ -2732,7 +2755,7 @@ class LibClang { } late final _clang_isRestrictQualifiedTypePtr = - _lookup>( + _lookup>( 'clang_isRestrictQualifiedType'); late final _clang_isRestrictQualifiedType = _clang_isRestrictQualifiedTypePtr.asFunction(); @@ -2747,7 +2770,7 @@ class LibClang { } late final _clang_getAddressSpacePtr = - _lookup>( + _lookup>( 'clang_getAddressSpace'); late final _clang_getAddressSpace = _clang_getAddressSpacePtr.asFunction(); @@ -2883,7 +2906,7 @@ class LibClang { } late final _clang_getExceptionSpecificationTypePtr = - _lookup>( + _lookup>( 'clang_getExceptionSpecificationType'); late final _clang_getExceptionSpecificationType = _clang_getExceptionSpecificationTypePtr @@ -2900,7 +2923,7 @@ class LibClang { } late final _clang_getNumArgTypesPtr = - _lookup>( + _lookup>( 'clang_getNumArgTypes'); late final _clang_getNumArgTypes = _clang_getNumArgTypesPtr.asFunction(); @@ -2917,7 +2940,7 @@ class LibClang { } late final _clang_getArgTypePtr = - _lookup>( + _lookup>( 'clang_getArgType'); late final _clang_getArgType = _clang_getArgTypePtr.asFunction(); @@ -2949,7 +2972,7 @@ class LibClang { } late final _clang_Type_getNumObjCProtocolRefsPtr = - _lookup>( + _lookup>( 'clang_Type_getNumObjCProtocolRefs'); late final _clang_Type_getNumObjCProtocolRefs = _clang_Type_getNumObjCProtocolRefsPtr.asFunction(); @@ -2965,9 +2988,9 @@ class LibClang { ); } - late final _clang_Type_getObjCProtocolDeclPtr = - _lookup>( - 'clang_Type_getObjCProtocolDecl'); + late final _clang_Type_getObjCProtocolDeclPtr = _lookup< + ffi.NativeFunction>( + 'clang_Type_getObjCProtocolDecl'); late final _clang_Type_getObjCProtocolDecl = _clang_Type_getObjCProtocolDeclPtr .asFunction(); @@ -2982,7 +3005,7 @@ class LibClang { } late final _clang_Type_getNumObjCTypeArgsPtr = - _lookup>( + _lookup>( 'clang_Type_getNumObjCTypeArgs'); late final _clang_Type_getNumObjCTypeArgs = _clang_Type_getNumObjCTypeArgsPtr.asFunction(); @@ -2999,7 +3022,7 @@ class LibClang { } late final _clang_Type_getObjCTypeArgPtr = - _lookup>( + _lookup>( 'clang_Type_getObjCTypeArg'); late final _clang_Type_getObjCTypeArg = _clang_Type_getObjCTypeArgPtr.asFunction(); @@ -3014,7 +3037,7 @@ class LibClang { } late final _clang_isFunctionTypeVariadicPtr = - _lookup>( + _lookup>( 'clang_isFunctionTypeVariadic'); late final _clang_isFunctionTypeVariadic = _clang_isFunctionTypeVariadicPtr.asFunction(); @@ -3045,7 +3068,7 @@ class LibClang { } late final _clang_getCursorExceptionSpecificationTypePtr = - _lookup>( + _lookup>( 'clang_getCursorExceptionSpecificationType'); late final _clang_getCursorExceptionSpecificationType = _clang_getCursorExceptionSpecificationTypePtr @@ -3061,7 +3084,7 @@ class LibClang { } late final _clang_isPODTypePtr = - _lookup>( + _lookup>( 'clang_isPODType'); late final _clang_isPODType = _clang_isPODTypePtr.asFunction(); @@ -3091,7 +3114,7 @@ class LibClang { } late final _clang_getNumElementsPtr = - _lookup>( + _lookup>( 'clang_getNumElements'); late final _clang_getNumElements = _clang_getNumElementsPtr.asFunction(); @@ -3121,7 +3144,7 @@ class LibClang { } late final _clang_getArraySizePtr = - _lookup>( + _lookup>( 'clang_getArraySize'); late final _clang_getArraySize = _clang_getArraySizePtr.asFunction(); @@ -3151,7 +3174,7 @@ class LibClang { } late final _clang_Type_isTransparentTagTypedefPtr = - _lookup>( + _lookup>( 'clang_Type_isTransparentTagTypedef'); late final _clang_Type_isTransparentTagTypedef = _clang_Type_isTransparentTagTypedefPtr.asFunction(); @@ -3181,7 +3204,7 @@ class LibClang { } late final _clang_Type_getAlignOfPtr = - _lookup>( + _lookup>( 'clang_Type_getAlignOf'); late final _clang_Type_getAlignOf = _clang_Type_getAlignOfPtr.asFunction(); @@ -3211,7 +3234,7 @@ class LibClang { } late final _clang_Type_getSizeOfPtr = - _lookup>( + _lookup>( 'clang_Type_getSizeOf'); late final _clang_Type_getSizeOf = _clang_Type_getSizeOfPtr.asFunction(); @@ -3220,7 +3243,7 @@ class LibClang { /// would be returned by __offsetof__ as per C++11[18.2p4] int clang_Type_getOffsetOf( CXType T, - ffi.Pointer S, + ffi.Pointer S, ) { return _clang_Type_getOffsetOf( T, @@ -3230,10 +3253,10 @@ class LibClang { late final _clang_Type_getOffsetOfPtr = _lookup< ffi.NativeFunction< - ffi.Int64 Function( - CXType, ffi.Pointer)>>('clang_Type_getOffsetOf'); + pkg_ffi.LongLong Function( + CXType, ffi.Pointer)>>('clang_Type_getOffsetOf'); late final _clang_Type_getOffsetOf = _clang_Type_getOffsetOfPtr - .asFunction)>(); + .asFunction)>(); /// Return the type that was modified by this attributed type. CXType clang_Type_getModifiedType( @@ -3260,7 +3283,7 @@ class LibClang { } late final _clang_Cursor_getOffsetOfFieldPtr = - _lookup>( + _lookup>( 'clang_Cursor_getOffsetOfField'); late final _clang_Cursor_getOffsetOfField = _clang_Cursor_getOffsetOfFieldPtr.asFunction(); @@ -3276,7 +3299,7 @@ class LibClang { } late final _clang_Cursor_isAnonymousPtr = - _lookup>( + _lookup>( 'clang_Cursor_isAnonymous'); late final _clang_Cursor_isAnonymous = _clang_Cursor_isAnonymousPtr.asFunction(); @@ -3292,7 +3315,7 @@ class LibClang { } late final _clang_Cursor_isAnonymousRecordDeclPtr = - _lookup>( + _lookup>( 'clang_Cursor_isAnonymousRecordDecl'); late final _clang_Cursor_isAnonymousRecordDecl = _clang_Cursor_isAnonymousRecordDeclPtr @@ -3309,7 +3332,7 @@ class LibClang { } late final _clang_Cursor_isInlineNamespacePtr = - _lookup>( + _lookup>( 'clang_Cursor_isInlineNamespace'); late final _clang_Cursor_isInlineNamespace = _clang_Cursor_isInlineNamespacePtr.asFunction(); @@ -3325,7 +3348,7 @@ class LibClang { } late final _clang_Type_getNumTemplateArgumentsPtr = - _lookup>( + _lookup>( 'clang_Type_getNumTemplateArguments'); late final _clang_Type_getNumTemplateArguments = _clang_Type_getNumTemplateArgumentsPtr.asFunction(); @@ -3343,7 +3366,7 @@ class LibClang { } late final _clang_Type_getTemplateArgumentAsTypePtr = - _lookup>( + _lookup>( 'clang_Type_getTemplateArgumentAsType'); late final _clang_Type_getTemplateArgumentAsType = _clang_Type_getTemplateArgumentAsTypePtr @@ -3375,7 +3398,7 @@ class LibClang { } late final _clang_Cursor_isBitFieldPtr = - _lookup>( + _lookup>( 'clang_Cursor_isBitField'); late final _clang_Cursor_isBitField = _clang_Cursor_isBitFieldPtr.asFunction(); @@ -3391,7 +3414,7 @@ class LibClang { } late final _clang_isVirtualBasePtr = - _lookup>( + _lookup>( 'clang_isVirtualBase'); late final _clang_isVirtualBase = _clang_isVirtualBasePtr.asFunction(); @@ -3437,7 +3460,7 @@ class LibClang { } late final _clang_getNumOverloadedDeclsPtr = - _lookup>( + _lookup>( 'clang_getNumOverloadedDecls'); late final _clang_getNumOverloadedDecls = _clang_getNumOverloadedDeclsPtr.asFunction(); @@ -3454,9 +3477,9 @@ class LibClang { ); } - late final _clang_getOverloadedDeclPtr = - _lookup>( - 'clang_getOverloadedDecl'); + late final _clang_getOverloadedDeclPtr = _lookup< + ffi.NativeFunction>( + 'clang_getOverloadedDecl'); late final _clang_getOverloadedDecl = _clang_getOverloadedDeclPtr .asFunction(); @@ -3492,7 +3515,7 @@ class LibClang { late final _clang_visitChildrenPtr = _lookup< ffi.NativeFunction< - ffi.Uint32 Function( + pkg_ffi.UnsignedInt Function( CXCursor, CXCursorVisitor, CXClientData)>>('clang_visitChildren'); late final _clang_visitChildren = _clang_visitChildrenPtr .asFunction(); @@ -3515,7 +3538,7 @@ class LibClang { /// Construct a USR for a specified Objective-C class. CXString clang_constructUSR_ObjCClass( - ffi.Pointer class_name, + ffi.Pointer class_name, ) { return _clang_constructUSR_ObjCClass( class_name, @@ -3523,15 +3546,15 @@ class LibClang { } late final _clang_constructUSR_ObjCClassPtr = - _lookup)>>( + _lookup)>>( 'clang_constructUSR_ObjCClass'); late final _clang_constructUSR_ObjCClass = _clang_constructUSR_ObjCClassPtr - .asFunction)>(); + .asFunction)>(); /// Construct a USR for a specified Objective-C category. CXString clang_constructUSR_ObjCCategory( - ffi.Pointer class_name, - ffi.Pointer category_name, + ffi.Pointer class_name, + ffi.Pointer category_name, ) { return _clang_constructUSR_ObjCCategory( class_name, @@ -3541,15 +3564,16 @@ class LibClang { late final _clang_constructUSR_ObjCCategoryPtr = _lookup< ffi.NativeFunction< - CXString Function(ffi.Pointer, - ffi.Pointer)>>('clang_constructUSR_ObjCCategory'); + CXString Function(ffi.Pointer, + ffi.Pointer)>>('clang_constructUSR_ObjCCategory'); late final _clang_constructUSR_ObjCCategory = _clang_constructUSR_ObjCCategoryPtr.asFunction< - CXString Function(ffi.Pointer, ffi.Pointer)>(); + CXString Function( + ffi.Pointer, ffi.Pointer)>(); /// Construct a USR for a specified Objective-C protocol. CXString clang_constructUSR_ObjCProtocol( - ffi.Pointer protocol_name, + ffi.Pointer protocol_name, ) { return _clang_constructUSR_ObjCProtocol( protocol_name, @@ -3557,16 +3581,16 @@ class LibClang { } late final _clang_constructUSR_ObjCProtocolPtr = - _lookup)>>( + _lookup)>>( 'clang_constructUSR_ObjCProtocol'); late final _clang_constructUSR_ObjCProtocol = _clang_constructUSR_ObjCProtocolPtr - .asFunction)>(); + .asFunction)>(); /// Construct a USR for a specified Objective-C instance variable and the USR /// for its containing class. CXString clang_constructUSR_ObjCIvar( - ffi.Pointer name, + ffi.Pointer name, CXString classUSR, ) { return _clang_constructUSR_ObjCIvar( @@ -3577,15 +3601,15 @@ class LibClang { late final _clang_constructUSR_ObjCIvarPtr = _lookup< ffi.NativeFunction< - CXString Function( - ffi.Pointer, CXString)>>('clang_constructUSR_ObjCIvar'); + CXString Function(ffi.Pointer, + CXString)>>('clang_constructUSR_ObjCIvar'); late final _clang_constructUSR_ObjCIvar = _clang_constructUSR_ObjCIvarPtr - .asFunction, CXString)>(); + .asFunction, CXString)>(); /// Construct a USR for a specified Objective-C method and the USR for its /// containing class. CXString clang_constructUSR_ObjCMethod( - ffi.Pointer name, + ffi.Pointer name, int isInstanceMethod, CXString classUSR, ) { @@ -3598,15 +3622,16 @@ class LibClang { late final _clang_constructUSR_ObjCMethodPtr = _lookup< ffi.NativeFunction< - CXString Function(ffi.Pointer, ffi.Uint32, + CXString Function(ffi.Pointer, pkg_ffi.UnsignedInt, CXString)>>('clang_constructUSR_ObjCMethod'); - late final _clang_constructUSR_ObjCMethod = _clang_constructUSR_ObjCMethodPtr - .asFunction, int, CXString)>(); + late final _clang_constructUSR_ObjCMethod = + _clang_constructUSR_ObjCMethodPtr.asFunction< + CXString Function(ffi.Pointer, int, CXString)>(); /// Construct a USR for a specified Objective-C property and the USR for its /// containing class. CXString clang_constructUSR_ObjCProperty( - ffi.Pointer property, + ffi.Pointer property, CXString classUSR, ) { return _clang_constructUSR_ObjCProperty( @@ -3617,11 +3642,11 @@ class LibClang { late final _clang_constructUSR_ObjCPropertyPtr = _lookup< ffi.NativeFunction< - CXString Function(ffi.Pointer, + CXString Function(ffi.Pointer, CXString)>>('clang_constructUSR_ObjCProperty'); late final _clang_constructUSR_ObjCProperty = _clang_constructUSR_ObjCPropertyPtr - .asFunction, CXString)>(); + .asFunction, CXString)>(); /// Retrieve a name for the entity referenced by this cursor. CXString clang_getCursorSpelling( @@ -3656,8 +3681,8 @@ class LibClang { late final _clang_Cursor_getSpellingNameRangePtr = _lookup< ffi.NativeFunction< - CXSourceRange Function(CXCursor, ffi.Uint32, - ffi.Uint32)>>('clang_Cursor_getSpellingNameRange'); + CXSourceRange Function(CXCursor, pkg_ffi.UnsignedInt, + pkg_ffi.UnsignedInt)>>('clang_Cursor_getSpellingNameRange'); late final _clang_Cursor_getSpellingNameRange = _clang_Cursor_getSpellingNameRangePtr .asFunction(); @@ -3674,8 +3699,9 @@ class LibClang { } late final _clang_PrintingPolicy_getPropertyPtr = _lookup< - ffi.NativeFunction>( - 'clang_PrintingPolicy_getProperty'); + ffi.NativeFunction< + pkg_ffi.UnsignedInt Function(CXPrintingPolicy, + ffi.Int32)>>('clang_PrintingPolicy_getProperty'); late final _clang_PrintingPolicy_getProperty = _clang_PrintingPolicy_getPropertyPtr .asFunction(); @@ -3696,7 +3722,7 @@ class LibClang { late final _clang_PrintingPolicy_setPropertyPtr = _lookup< ffi.NativeFunction< ffi.Void Function(CXPrintingPolicy, ffi.Int32, - ffi.Uint32)>>('clang_PrintingPolicy_setProperty'); + pkg_ffi.UnsignedInt)>>('clang_PrintingPolicy_setProperty'); late final _clang_PrintingPolicy_setProperty = _clang_PrintingPolicy_setPropertyPtr .asFunction(); @@ -3806,7 +3832,7 @@ class LibClang { } late final _clang_isCursorDefinitionPtr = - _lookup>( + _lookup>( 'clang_isCursorDefinition'); late final _clang_isCursorDefinition = _clang_isCursorDefinitionPtr.asFunction(); @@ -3837,7 +3863,7 @@ class LibClang { } late final _clang_Cursor_getObjCSelectorIndexPtr = - _lookup>( + _lookup>( 'clang_Cursor_getObjCSelectorIndex'); late final _clang_Cursor_getObjCSelectorIndex = _clang_Cursor_getObjCSelectorIndexPtr @@ -3854,7 +3880,7 @@ class LibClang { } late final _clang_Cursor_isDynamicCallPtr = - _lookup>( + _lookup>( 'clang_Cursor_isDynamicCall'); late final _clang_Cursor_isDynamicCall = _clang_Cursor_isDynamicCallPtr.asFunction(); @@ -3888,9 +3914,10 @@ class LibClang { ); } - late final _clang_Cursor_getObjCPropertyAttributesPtr = - _lookup>( - 'clang_Cursor_getObjCPropertyAttributes'); + late final _clang_Cursor_getObjCPropertyAttributesPtr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedInt Function(CXCursor, + pkg_ffi.UnsignedInt)>>('clang_Cursor_getObjCPropertyAttributes'); late final _clang_Cursor_getObjCPropertyAttributes = _clang_Cursor_getObjCPropertyAttributesPtr .asFunction(); @@ -3942,7 +3969,7 @@ class LibClang { } late final _clang_Cursor_getObjCDeclQualifiersPtr = - _lookup>( + _lookup>( 'clang_Cursor_getObjCDeclQualifiers'); late final _clang_Cursor_getObjCDeclQualifiers = _clang_Cursor_getObjCDeclQualifiersPtr @@ -3961,7 +3988,7 @@ class LibClang { } late final _clang_Cursor_isObjCOptionalPtr = - _lookup>( + _lookup>( 'clang_Cursor_isObjCOptional'); late final _clang_Cursor_isObjCOptional = _clang_Cursor_isObjCOptionalPtr.asFunction(); @@ -3976,7 +4003,7 @@ class LibClang { } late final _clang_Cursor_isVariadicPtr = - _lookup>( + _lookup>( 'clang_Cursor_isVariadic'); late final _clang_Cursor_isVariadic = _clang_Cursor_isVariadicPtr.asFunction(); @@ -3987,7 +4014,7 @@ class LibClang { CXCursor C, ffi.Pointer language, ffi.Pointer definedIn, - ffi.Pointer isGenerated, + ffi.Pointer isGenerated, ) { return _clang_Cursor_isExternalSymbol( C, @@ -3998,16 +4025,14 @@ class LibClang { } late final _clang_Cursor_isExternalSymbolPtr = _lookup< - ffi.NativeFunction< - ffi.Uint32 Function( - CXCursor, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('clang_Cursor_isExternalSymbol'); + ffi.NativeFunction< + pkg_ffi.UnsignedInt Function(CXCursor, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>( + 'clang_Cursor_isExternalSymbol'); late final _clang_Cursor_isExternalSymbol = _clang_Cursor_isExternalSymbolPtr.asFunction< int Function(CXCursor, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Given a cursor that represents a declaration, return the associated /// comment's source range. The range may include multiple consecutive @@ -4212,7 +4237,7 @@ class LibClang { } late final _clang_Module_isSystemPtr = - _lookup>( + _lookup>( 'clang_Module_isSystem'); late final _clang_Module_isSystem = _clang_Module_isSystemPtr.asFunction(); @@ -4229,8 +4254,9 @@ class LibClang { } late final _clang_Module_getNumTopLevelHeadersPtr = _lookup< - ffi.NativeFunction>( - 'clang_Module_getNumTopLevelHeaders'); + ffi.NativeFunction< + pkg_ffi.UnsignedInt Function(CXTranslationUnit, + CXModule)>>('clang_Module_getNumTopLevelHeaders'); late final _clang_Module_getNumTopLevelHeaders = _clang_Module_getNumTopLevelHeadersPtr .asFunction(); @@ -4251,7 +4277,7 @@ class LibClang { late final _clang_Module_getTopLevelHeaderPtr = _lookup< ffi.NativeFunction< CXFile Function(CXTranslationUnit, CXModule, - ffi.Uint32)>>('clang_Module_getTopLevelHeader'); + pkg_ffi.UnsignedInt)>>('clang_Module_getTopLevelHeader'); late final _clang_Module_getTopLevelHeader = _clang_Module_getTopLevelHeaderPtr .asFunction(); @@ -4266,7 +4292,7 @@ class LibClang { } late final _clang_CXXConstructor_isConvertingConstructorPtr = - _lookup>( + _lookup>( 'clang_CXXConstructor_isConvertingConstructor'); late final _clang_CXXConstructor_isConvertingConstructor = _clang_CXXConstructor_isConvertingConstructorPtr @@ -4282,7 +4308,7 @@ class LibClang { } late final _clang_CXXConstructor_isCopyConstructorPtr = - _lookup>( + _lookup>( 'clang_CXXConstructor_isCopyConstructor'); late final _clang_CXXConstructor_isCopyConstructor = _clang_CXXConstructor_isCopyConstructorPtr @@ -4298,7 +4324,7 @@ class LibClang { } late final _clang_CXXConstructor_isDefaultConstructorPtr = - _lookup>( + _lookup>( 'clang_CXXConstructor_isDefaultConstructor'); late final _clang_CXXConstructor_isDefaultConstructor = _clang_CXXConstructor_isDefaultConstructorPtr @@ -4314,7 +4340,7 @@ class LibClang { } late final _clang_CXXConstructor_isMoveConstructorPtr = - _lookup>( + _lookup>( 'clang_CXXConstructor_isMoveConstructor'); late final _clang_CXXConstructor_isMoveConstructor = _clang_CXXConstructor_isMoveConstructorPtr @@ -4330,7 +4356,7 @@ class LibClang { } late final _clang_CXXField_isMutablePtr = - _lookup>( + _lookup>( 'clang_CXXField_isMutable'); late final _clang_CXXField_isMutable = _clang_CXXField_isMutablePtr.asFunction(); @@ -4345,7 +4371,7 @@ class LibClang { } late final _clang_CXXMethod_isDefaultedPtr = - _lookup>( + _lookup>( 'clang_CXXMethod_isDefaulted'); late final _clang_CXXMethod_isDefaulted = _clang_CXXMethod_isDefaultedPtr.asFunction(); @@ -4361,7 +4387,7 @@ class LibClang { } late final _clang_CXXMethod_isPureVirtualPtr = - _lookup>( + _lookup>( 'clang_CXXMethod_isPureVirtual'); late final _clang_CXXMethod_isPureVirtual = _clang_CXXMethod_isPureVirtualPtr.asFunction(); @@ -4377,7 +4403,7 @@ class LibClang { } late final _clang_CXXMethod_isStaticPtr = - _lookup>( + _lookup>( 'clang_CXXMethod_isStatic'); late final _clang_CXXMethod_isStatic = _clang_CXXMethod_isStaticPtr.asFunction(); @@ -4394,7 +4420,7 @@ class LibClang { } late final _clang_CXXMethod_isVirtualPtr = - _lookup>( + _lookup>( 'clang_CXXMethod_isVirtual'); late final _clang_CXXMethod_isVirtual = _clang_CXXMethod_isVirtualPtr.asFunction(); @@ -4410,7 +4436,7 @@ class LibClang { } late final _clang_CXXRecord_isAbstractPtr = - _lookup>( + _lookup>( 'clang_CXXRecord_isAbstract'); late final _clang_CXXRecord_isAbstract = _clang_CXXRecord_isAbstractPtr.asFunction(); @@ -4425,7 +4451,7 @@ class LibClang { } late final _clang_EnumDecl_isScopedPtr = - _lookup>( + _lookup>( 'clang_EnumDecl_isScoped'); late final _clang_EnumDecl_isScoped = _clang_EnumDecl_isScopedPtr.asFunction(); @@ -4441,7 +4467,7 @@ class LibClang { } late final _clang_CXXMethod_isConstPtr = - _lookup>( + _lookup>( 'clang_CXXMethod_isConst'); late final _clang_CXXMethod_isConst = _clang_CXXMethod_isConstPtr.asFunction(); @@ -4496,8 +4522,8 @@ class LibClang { late final _clang_getCursorReferenceNameRangePtr = _lookup< ffi.NativeFunction< - CXSourceRange Function(CXCursor, ffi.Uint32, - ffi.Uint32)>>('clang_getCursorReferenceNameRange'); + CXSourceRange Function(CXCursor, pkg_ffi.UnsignedInt, + pkg_ffi.UnsignedInt)>>('clang_getCursorReferenceNameRange'); late final _clang_getCursorReferenceNameRange = _clang_getCursorReferenceNameRangePtr .asFunction(); @@ -4594,7 +4620,7 @@ class LibClang { CXTranslationUnit TU, CXSourceRange Range, ffi.Pointer> Tokens, - ffi.Pointer NumTokens, + ffi.Pointer NumTokens, ) { return _clang_tokenize( TU, @@ -4610,10 +4636,13 @@ class LibClang { CXTranslationUnit, CXSourceRange, ffi.Pointer>, - ffi.Pointer)>>('clang_tokenize'); + ffi.Pointer)>>('clang_tokenize'); late final _clang_tokenize = _clang_tokenizePtr.asFunction< - void Function(CXTranslationUnit, CXSourceRange, - ffi.Pointer>, ffi.Pointer)>(); + void Function( + CXTranslationUnit, + CXSourceRange, + ffi.Pointer>, + ffi.Pointer)>(); /// 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. @@ -4633,7 +4662,10 @@ class LibClang { late final _clang_annotateTokensPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CXTranslationUnit, ffi.Pointer, ffi.Uint32, + ffi.Void Function( + CXTranslationUnit, + ffi.Pointer, + pkg_ffi.UnsignedInt, ffi.Pointer)>>('clang_annotateTokens'); late final _clang_annotateTokens = _clang_annotateTokensPtr.asFunction< void Function(CXTranslationUnit, ffi.Pointer, int, @@ -4655,7 +4687,7 @@ class LibClang { late final _clang_disposeTokensPtr = _lookup< ffi.NativeFunction< ffi.Void Function(CXTranslationUnit, ffi.Pointer, - ffi.Uint32)>>('clang_disposeTokens'); + pkg_ffi.UnsignedInt)>>('clang_disposeTokens'); late final _clang_disposeTokens = _clang_disposeTokensPtr.asFunction< void Function(CXTranslationUnit, ffi.Pointer, int)>(); @@ -4677,12 +4709,12 @@ class LibClang { void clang_getDefinitionSpellingAndExtent( CXCursor arg0, - ffi.Pointer> startBuf, - ffi.Pointer> endBuf, - ffi.Pointer startLine, - ffi.Pointer startColumn, - ffi.Pointer endLine, - ffi.Pointer endColumn, + ffi.Pointer> startBuf, + ffi.Pointer> endBuf, + ffi.Pointer startLine, + ffi.Pointer startColumn, + ffi.Pointer endLine, + ffi.Pointer endColumn, ) { return _clang_getDefinitionSpellingAndExtent( arg0, @@ -4699,23 +4731,23 @@ class LibClang { ffi.NativeFunction< ffi.Void Function( CXCursor, - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>( + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( 'clang_getDefinitionSpellingAndExtent'); late final _clang_getDefinitionSpellingAndExtent = _clang_getDefinitionSpellingAndExtentPtr.asFunction< void Function( CXCursor, - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); void clang_enableStackTraces() { return _clang_enableStackTraces(); @@ -4746,7 +4778,7 @@ class LibClang { ffi.Pointer< ffi.NativeFunction)>>, ffi.Pointer, - ffi.Uint32)>>('clang_executeOnThread'); + pkg_ffi.UnsignedInt)>>('clang_executeOnThread'); late final _clang_executeOnThread = _clang_executeOnThreadPtr.asFunction< void Function( ffi.Pointer< @@ -4767,8 +4799,8 @@ class LibClang { late final _clang_getCompletionChunkKindPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - CXCompletionString, ffi.Uint32)>>('clang_getCompletionChunkKind'); + ffi.Int32 Function(CXCompletionString, + pkg_ffi.UnsignedInt)>>('clang_getCompletionChunkKind'); late final _clang_getCompletionChunkKind = _clang_getCompletionChunkKindPtr .asFunction(); @@ -4786,8 +4818,8 @@ class LibClang { late final _clang_getCompletionChunkTextPtr = _lookup< ffi.NativeFunction< - CXString Function( - CXCompletionString, ffi.Uint32)>>('clang_getCompletionChunkText'); + CXString Function(CXCompletionString, + pkg_ffi.UnsignedInt)>>('clang_getCompletionChunkText'); late final _clang_getCompletionChunkText = _clang_getCompletionChunkTextPtr .asFunction(); @@ -4804,9 +4836,10 @@ class LibClang { } late final _clang_getCompletionChunkCompletionStringPtr = _lookup< - ffi.NativeFunction< - CXCompletionString Function(CXCompletionString, - ffi.Uint32)>>('clang_getCompletionChunkCompletionString'); + ffi.NativeFunction< + CXCompletionString Function( + CXCompletionString, pkg_ffi.UnsignedInt)>>( + 'clang_getCompletionChunkCompletionString'); late final _clang_getCompletionChunkCompletionString = _clang_getCompletionChunkCompletionStringPtr .asFunction(); @@ -4820,9 +4853,9 @@ class LibClang { ); } - late final _clang_getNumCompletionChunksPtr = - _lookup>( - 'clang_getNumCompletionChunks'); + late final _clang_getNumCompletionChunksPtr = _lookup< + ffi.NativeFunction>( + 'clang_getNumCompletionChunks'); late final _clang_getNumCompletionChunks = _clang_getNumCompletionChunksPtr .asFunction(); @@ -4835,9 +4868,9 @@ class LibClang { ); } - late final _clang_getCompletionPriorityPtr = - _lookup>( - 'clang_getCompletionPriority'); + late final _clang_getCompletionPriorityPtr = _lookup< + ffi.NativeFunction>( + 'clang_getCompletionPriority'); late final _clang_getCompletionPriority = _clang_getCompletionPriorityPtr .asFunction(); @@ -4868,9 +4901,9 @@ class LibClang { ); } - late final _clang_getCompletionNumAnnotationsPtr = - _lookup>( - 'clang_getCompletionNumAnnotations'); + late final _clang_getCompletionNumAnnotationsPtr = _lookup< + ffi.NativeFunction>( + 'clang_getCompletionNumAnnotations'); late final _clang_getCompletionNumAnnotations = _clang_getCompletionNumAnnotationsPtr .asFunction(); @@ -4889,7 +4922,7 @@ class LibClang { late final _clang_getCompletionAnnotationPtr = _lookup< ffi.NativeFunction< CXString Function(CXCompletionString, - ffi.Uint32)>>('clang_getCompletionAnnotation'); + pkg_ffi.UnsignedInt)>>('clang_getCompletionAnnotation'); late final _clang_getCompletionAnnotation = _clang_getCompletionAnnotationPtr .asFunction(); @@ -4959,8 +4992,8 @@ class LibClang { late final _clang_getCompletionNumFixItsPtr = _lookup< ffi.NativeFunction< - ffi.Uint32 Function(ffi.Pointer, - ffi.Uint32)>>('clang_getCompletionNumFixIts'); + pkg_ffi.UnsignedInt Function(ffi.Pointer, + pkg_ffi.UnsignedInt)>>('clang_getCompletionNumFixIts'); late final _clang_getCompletionNumFixIts = _clang_getCompletionNumFixItsPtr .asFunction, int)>(); @@ -4984,8 +5017,8 @@ class LibClang { ffi.NativeFunction< CXString Function( ffi.Pointer, - ffi.Uint32, - ffi.Uint32, + pkg_ffi.UnsignedInt, + pkg_ffi.UnsignedInt, ffi.Pointer)>>('clang_getCompletionFixIt'); late final _clang_getCompletionFixIt = _clang_getCompletionFixItPtr.asFunction< @@ -4999,7 +5032,7 @@ class LibClang { } late final _clang_defaultCodeCompleteOptionsPtr = - _lookup>( + _lookup>( 'clang_defaultCodeCompleteOptions'); late final _clang_defaultCodeCompleteOptions = _clang_defaultCodeCompleteOptionsPtr.asFunction(); @@ -5007,7 +5040,7 @@ class LibClang { /// Perform code completion at a given location in a translation unit. ffi.Pointer clang_codeCompleteAt( CXTranslationUnit TU, - ffi.Pointer complete_filename, + ffi.Pointer complete_filename, int complete_line, int complete_column, ffi.Pointer unsaved_files, @@ -5029,16 +5062,16 @@ class LibClang { ffi.NativeFunction< ffi.Pointer Function( CXTranslationUnit, - ffi.Pointer, - ffi.Uint32, - ffi.Uint32, + ffi.Pointer, + pkg_ffi.UnsignedInt, + pkg_ffi.UnsignedInt, ffi.Pointer, - ffi.Uint32, - ffi.Uint32)>>('clang_codeCompleteAt'); + pkg_ffi.UnsignedInt, + pkg_ffi.UnsignedInt)>>('clang_codeCompleteAt'); late final _clang_codeCompleteAt = _clang_codeCompleteAtPtr.asFunction< ffi.Pointer Function( CXTranslationUnit, - ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer, @@ -5059,7 +5092,7 @@ class LibClang { late final _clang_sortCodeCompletionResultsPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - ffi.Uint32)>>('clang_sortCodeCompletionResults'); + pkg_ffi.UnsignedInt)>>('clang_sortCodeCompletionResults'); late final _clang_sortCodeCompletionResults = _clang_sortCodeCompletionResultsPtr .asFunction, int)>(); @@ -5093,7 +5126,8 @@ class LibClang { late final _clang_codeCompleteGetNumDiagnosticsPtr = _lookup< ffi.NativeFunction< - ffi.Uint32 Function(ffi.Pointer)>>( + pkg_ffi.UnsignedInt Function( + ffi.Pointer)>>( 'clang_codeCompleteGetNumDiagnostics'); late final _clang_codeCompleteGetNumDiagnostics = _clang_codeCompleteGetNumDiagnosticsPtr @@ -5113,7 +5147,7 @@ class LibClang { late final _clang_codeCompleteGetDiagnosticPtr = _lookup< ffi.NativeFunction< CXDiagnostic Function(ffi.Pointer, - ffi.Uint32)>>('clang_codeCompleteGetDiagnostic'); + pkg_ffi.UnsignedInt)>>('clang_codeCompleteGetDiagnostic'); late final _clang_codeCompleteGetDiagnostic = _clang_codeCompleteGetDiagnosticPtr.asFunction< CXDiagnostic Function(ffi.Pointer, int)>(); @@ -5130,7 +5164,8 @@ class LibClang { late final _clang_codeCompleteGetContextsPtr = _lookup< ffi.NativeFunction< - ffi.Uint64 Function(ffi.Pointer)>>( + pkg_ffi.UnsignedLongLong Function( + ffi.Pointer)>>( 'clang_codeCompleteGetContexts'); late final _clang_codeCompleteGetContexts = _clang_codeCompleteGetContextsPtr .asFunction)>(); @@ -5141,7 +5176,7 @@ class LibClang { /// there is not a container, this function will return CXCursor_InvalidCode. int clang_codeCompleteGetContainerKind( ffi.Pointer Results, - ffi.Pointer IsIncomplete, + ffi.Pointer IsIncomplete, ) { return _clang_codeCompleteGetContainerKind( Results, @@ -5150,13 +5185,14 @@ class LibClang { } late final _clang_codeCompleteGetContainerKindPtr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, - ffi.Pointer)>>('clang_codeCompleteGetContainerKind'); + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>( + 'clang_codeCompleteGetContainerKind'); late final _clang_codeCompleteGetContainerKind = _clang_codeCompleteGetContainerKindPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, + ffi.Pointer)>(); /// 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 @@ -5218,7 +5254,7 @@ class LibClang { } late final _clang_toggleCrashRecoveryPtr = - _lookup>( + _lookup>( 'clang_toggleCrashRecovery'); late final _clang_toggleCrashRecovery = _clang_toggleCrashRecoveryPtr.asFunction(); @@ -5288,7 +5324,7 @@ class LibClang { } late final _clang_EvalResult_getAsIntPtr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsInt'); late final _clang_EvalResult_getAsInt = _clang_EvalResult_getAsIntPtr.asFunction(); @@ -5305,7 +5341,7 @@ class LibClang { } late final _clang_EvalResult_getAsLongLongPtr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsLongLong'); late final _clang_EvalResult_getAsLongLong = _clang_EvalResult_getAsLongLongPtr @@ -5322,7 +5358,7 @@ class LibClang { } late final _clang_EvalResult_isUnsignedIntPtr = - _lookup>( + _lookup>( 'clang_EvalResult_isUnsignedInt'); late final _clang_EvalResult_isUnsignedInt = _clang_EvalResult_isUnsignedIntPtr @@ -5338,9 +5374,9 @@ class LibClang { ); } - late final _clang_EvalResult_getAsUnsignedPtr = - _lookup>( - 'clang_EvalResult_getAsUnsigned'); + late final _clang_EvalResult_getAsUnsignedPtr = _lookup< + ffi.NativeFunction>( + 'clang_EvalResult_getAsUnsigned'); late final _clang_EvalResult_getAsUnsigned = _clang_EvalResult_getAsUnsignedPtr .asFunction(); @@ -5364,7 +5400,7 @@ class LibClang { /// 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 clang_EvalResult_getAsStr( CXEvalResult E, ) { return _clang_EvalResult_getAsStr( @@ -5372,11 +5408,11 @@ class LibClang { ); } - late final _clang_EvalResult_getAsStrPtr = - _lookup Function(CXEvalResult)>>( - 'clang_EvalResult_getAsStr'); + late final _clang_EvalResult_getAsStrPtr = _lookup< + ffi.NativeFunction Function(CXEvalResult)>>( + 'clang_EvalResult_getAsStr'); late final _clang_EvalResult_getAsStr = _clang_EvalResult_getAsStrPtr - .asFunction Function(CXEvalResult)>(); + .asFunction Function(CXEvalResult)>(); /// Disposes the created Eval memory. void clang_EvalResult_dispose( @@ -5395,22 +5431,22 @@ class LibClang { /// Retrieve a remapping. CXRemapping clang_getRemappings( - ffi.Pointer path, + ffi.Pointer path, ) { return _clang_getRemappings( path, ); } - late final _clang_getRemappingsPtr = - _lookup)>>( - 'clang_getRemappings'); + late final _clang_getRemappingsPtr = _lookup< + ffi.NativeFunction)>>( + 'clang_getRemappings'); late final _clang_getRemappings = _clang_getRemappingsPtr - .asFunction)>(); + .asFunction)>(); /// Retrieve a remapping. CXRemapping clang_getRemappingsFromFileList( - ffi.Pointer> filePaths, + ffi.Pointer> filePaths, int numFiles, ) { return _clang_getRemappingsFromFileList( @@ -5421,11 +5457,11 @@ class LibClang { late final _clang_getRemappingsFromFileListPtr = _lookup< ffi.NativeFunction< - CXRemapping Function(ffi.Pointer>, - ffi.Uint32)>>('clang_getRemappingsFromFileList'); + CXRemapping Function(ffi.Pointer>, + pkg_ffi.UnsignedInt)>>('clang_getRemappingsFromFileList'); late final _clang_getRemappingsFromFileList = _clang_getRemappingsFromFileListPtr.asFunction< - CXRemapping Function(ffi.Pointer>, int)>(); + CXRemapping Function(ffi.Pointer>, int)>(); /// Determine the number of remappings. int clang_remap_getNumFiles( @@ -5437,7 +5473,7 @@ class LibClang { } late final _clang_remap_getNumFilesPtr = - _lookup>( + _lookup>( 'clang_remap_getNumFiles'); late final _clang_remap_getNumFiles = _clang_remap_getNumFilesPtr.asFunction(); @@ -5459,7 +5495,10 @@ class LibClang { late final _clang_remap_getFilenamesPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CXRemapping, ffi.Uint32, ffi.Pointer, + ffi.Void Function( + CXRemapping, + pkg_ffi.UnsignedInt, + ffi.Pointer, ffi.Pointer)>>('clang_remap_getFilenames'); late final _clang_remap_getFilenames = _clang_remap_getFilenamesPtr.asFunction< @@ -5531,7 +5570,7 @@ class LibClang { } late final _clang_index_isEntityObjCContainerKindPtr = - _lookup>( + _lookup>( 'clang_index_isEntityObjCContainerKind'); late final _clang_index_isEntityObjCContainerKind = _clang_index_isEntityObjCContainerKindPtr.asFunction(); @@ -5774,8 +5813,8 @@ class LibClang { ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -5800,19 +5839,19 @@ class LibClang { late final _clang_indexSourceFilePtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( CXIndexAction, CXClientData, ffi.Pointer, - ffi.Uint32, - ffi.Uint32, - ffi.Pointer, - ffi.Pointer>, - ffi.Int32, + pkg_ffi.UnsignedInt, + pkg_ffi.UnsignedInt, + ffi.Pointer, + ffi.Pointer>, + pkg_ffi.Int, ffi.Pointer, - ffi.Uint32, + pkg_ffi.UnsignedInt, ffi.Pointer, - ffi.Uint32)>>('clang_indexSourceFile'); + pkg_ffi.UnsignedInt)>>('clang_indexSourceFile'); late final _clang_indexSourceFile = _clang_indexSourceFilePtr.asFunction< int Function( CXIndexAction, @@ -5820,8 +5859,8 @@ class LibClang { ffi.Pointer, int, int, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>, int, ffi.Pointer, int, @@ -5837,8 +5876,8 @@ class LibClang { ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -5863,19 +5902,19 @@ class LibClang { late final _clang_indexSourceFileFullArgvPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( CXIndexAction, CXClientData, ffi.Pointer, - ffi.Uint32, - ffi.Uint32, - ffi.Pointer, - ffi.Pointer>, - ffi.Int32, + pkg_ffi.UnsignedInt, + pkg_ffi.UnsignedInt, + ffi.Pointer, + ffi.Pointer>, + pkg_ffi.Int, ffi.Pointer, - ffi.Uint32, + pkg_ffi.UnsignedInt, ffi.Pointer, - ffi.Uint32)>>('clang_indexSourceFileFullArgv'); + pkg_ffi.UnsignedInt)>>('clang_indexSourceFileFullArgv'); late final _clang_indexSourceFileFullArgv = _clang_indexSourceFileFullArgvPtr.asFunction< int Function( @@ -5884,8 +5923,8 @@ class LibClang { ffi.Pointer, int, int, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>, int, ffi.Pointer, int, @@ -5914,12 +5953,12 @@ class LibClang { late final _clang_indexTranslationUnitPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( CXIndexAction, CXClientData, ffi.Pointer, - ffi.Uint32, - ffi.Uint32, + pkg_ffi.UnsignedInt, + pkg_ffi.UnsignedInt, CXTranslationUnit)>>('clang_indexTranslationUnit'); late final _clang_indexTranslationUnit = _clang_indexTranslationUnitPtr.asFunction< @@ -5932,9 +5971,9 @@ class LibClang { CXIdxLoc loc, ffi.Pointer indexFile, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_indexLoc_getFileLocation( loc, @@ -5947,23 +5986,24 @@ class LibClang { } late final _clang_indexLoc_getFileLocationPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CXIdxLoc, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('clang_indexLoc_getFileLocation'); + ffi.NativeFunction< + ffi.Void Function( + CXIdxLoc, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + 'clang_indexLoc_getFileLocation'); late final _clang_indexLoc_getFileLocation = _clang_indexLoc_getFileLocationPtr.asFunction< void Function( CXIdxLoc, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve the CXSourceLocation represented by the given CXIdxLoc. CXSourceLocation clang_indexLoc_getCXSourceLocation( @@ -5996,7 +6036,7 @@ class LibClang { late final _clang_Type_visitFieldsPtr = _lookup< ffi.NativeFunction< - ffi.Uint32 Function( + pkg_ffi.UnsignedInt Function( CXType, CXFieldVisitor, CXClientData)>>('clang_Type_visitFields'); late final _clang_Type_visitFields = _clang_Type_visitFieldsPtr .asFunction(); @@ -6024,14 +6064,14 @@ abstract class CXErrorCode { class CXString extends ffi.Struct { external ffi.Pointer data; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int private_flags; } class CXStringSet extends ffi.Struct { external ffi.Pointer Strings; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int Count; } @@ -6053,13 +6093,13 @@ class CXTranslationUnitImpl extends ffi.Opaque {} /// 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; + external ffi.Pointer Filename; /// A buffer containing the unsaved contents of this file. - external ffi.Pointer Contents; + external ffi.Pointer Contents; /// The length of the unsaved contents of this buffer. - @ffi.Uint64() + @pkg_ffi.UnsignedLong() external int Length; } @@ -6086,18 +6126,18 @@ abstract class CXAvailabilityKind { 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() + @pkg_ffi.Int() 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() + @pkg_ffi.Int() 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() + @pkg_ffi.Int() external int Subminor; } @@ -6162,7 +6202,7 @@ typedef CXFile = ffi.Pointer; /// across an indexing session. class CXFileUniqueID extends ffi.Struct { @ffi.Array.multi([3]) - external ffi.Array data; + external ffi.Array data; } /// A single translation unit, which resides in an index. @@ -6173,7 +6213,7 @@ class CXSourceLocation extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int int_data; } @@ -6182,17 +6222,17 @@ class CXSourceRange extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int begin_int_data; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int end_int_data; } /// Identifies an array of ranges. class CXSourceRangeList extends ffi.Struct { /// The number of ranges in the ranges array. - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int count; /// An array of CXSourceRanges. @@ -6388,7 +6428,7 @@ class CXTUResourceUsageEntry extends ffi.Struct { @ffi.Int32() external int kind; - @ffi.Uint64() + @pkg_ffi.UnsignedLong() external int amount; } @@ -6396,7 +6436,7 @@ class CXTUResourceUsageEntry extends ffi.Struct { class CXTUResourceUsage extends ffi.Struct { external ffi.Pointer data; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int numEntries; external ffi.Pointer entries; @@ -7063,7 +7103,7 @@ class CXCursor extends ffi.Struct { @ffi.Int32() external int kind; - @ffi.Int32() + @pkg_ffi.Int() external int xdata; @ffi.Array.multi([3]) @@ -7125,7 +7165,7 @@ class CXPlatformAvailability extends ffi.Struct { external CXVersion Obsoleted; /// Whether the entity is unconditionally unavailable on this platform. - @ffi.Int32() + @pkg_ffi.Int() external int Unavailable; /// An optional message to provide to a user of this API, e.g., to suggest @@ -7523,7 +7563,7 @@ abstract class CXTokenKind { /// Describes a single preprocessing token. class CXToken extends ffi.Struct { @ffi.Array.multi([4]) - external ffi.Array int_data; + external ffi.Array int_data; external ffi.Pointer ptr_data; } @@ -7621,7 +7661,7 @@ class CXCodeCompleteResults extends ffi.Struct { external ffi.Pointer Results; /// The number of code-completion results stored in the Results array. - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int NumResults; } @@ -7746,8 +7786,8 @@ abstract class CXCompletionContext { /// clang_getInclusions()). typedef CXInclusionVisitor = ffi.Pointer< ffi.NativeFunction< - ffi.Void Function( - CXFile, ffi.Pointer, ffi.Uint32, CXClientData)>>; + ffi.Void Function(CXFile, ffi.Pointer, + pkg_ffi.UnsignedInt, CXClientData)>>; abstract class CXEvalResultKind { static const int CXEval_Int = 1; @@ -7796,7 +7836,7 @@ class CXIdxLoc extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int int_data; } @@ -7806,19 +7846,19 @@ class CXIdxIncludedFileInfo extends ffi.Struct { external CXIdxLoc hashLoc; /// Filename as written in the #include/#import directive. - external ffi.Pointer filename; + external ffi.Pointer filename; /// The actual file that the #include/#import directive resolved to. external CXFile file; - @ffi.Int32() + @pkg_ffi.Int() external int isImport; - @ffi.Int32() + @pkg_ffi.Int() external int isAngled; /// Non-zero if the directive was automatically turned into a module import. - @ffi.Int32() + @pkg_ffi.Int() external int isModuleImport; } @@ -7835,7 +7875,7 @@ class CXIdxImportedASTFileInfo extends ffi.Struct { /// Non-zero if an inclusion directive was automatically turned into a module /// import. Applicable only for modules. - @ffi.Int32() + @pkg_ffi.Int() external int isImplicit; } @@ -7914,15 +7954,15 @@ class CXIdxEntityInfo extends ffi.Struct { @ffi.Int32() external int lang; - external ffi.Pointer name; + external ffi.Pointer name; - external ffi.Pointer USR; + external ffi.Pointer USR; external CXCursor cursor; external ffi.Pointer> attributes; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int numAttributes; } @@ -7957,28 +7997,28 @@ class CXIdxDeclInfo extends ffi.Struct { /// out-of-line C++ member functions. external ffi.Pointer lexicalContainer; - @ffi.Int32() + @pkg_ffi.Int() external int isRedeclaration; - @ffi.Int32() + @pkg_ffi.Int() external int isDefinition; - @ffi.Int32() + @pkg_ffi.Int() 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() + @pkg_ffi.Int() external int isImplicit; external ffi.Pointer> attributes; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int numAttributes; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int flags; } @@ -8014,7 +8054,7 @@ class CXIdxObjCProtocolRefInfo extends ffi.Struct { class CXIdxObjCProtocolRefListInfo extends ffi.Struct { external ffi.Pointer> protocols; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int numProtocols; } @@ -8051,7 +8091,7 @@ class CXIdxCXXClassDeclInfo extends ffi.Struct { external ffi.Pointer> bases; - @ffi.Uint32() + @pkg_ffi.UnsignedInt() external int numBases; } @@ -8109,8 +8149,9 @@ 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< - ffi.NativeFunction< - ffi.Int32 Function(CXClientData, ffi.Pointer)>> abortQuery; + ffi.NativeFunction< + pkg_ffi.Int Function(CXClientData, ffi.Pointer)>> + abortQuery; /// Called at the end of indexing; passes the complete diagnostic set. external ffi.Pointer< diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index 2980faa192..6e13fec5c4 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -4,6 +4,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; /// Bindings to SQLite. class SQLite { @@ -50,59 +51,59 @@ class SQLite { /// of the hash might be different from [SQLITE_SOURCE_ID].)^ /// /// See also: [sqlite_version()] and [sqlite_source_id()]. - late final ffi.Pointer> _sqlite3_version = - _lookup>('sqlite3_version'); + late final ffi.Pointer> _sqlite3_version = + _lookup>('sqlite3_version'); - ffi.Pointer get sqlite3_version => _sqlite3_version.value; + ffi.Pointer get sqlite3_version => _sqlite3_version.value; - set sqlite3_version(ffi.Pointer value) => + set sqlite3_version(ffi.Pointer value) => _sqlite3_version.value = value; - ffi.Pointer sqlite3_libversion() { + ffi.Pointer sqlite3_libversion() { return _sqlite3_libversion(); } late final _sqlite3_libversionPtr = - _lookup Function()>>( + _lookup Function()>>( 'sqlite3_libversion'); late final _sqlite3_libversion = - _sqlite3_libversionPtr.asFunction Function()>(); + _sqlite3_libversionPtr.asFunction Function()>(); - ffi.Pointer sqlite3_sourceid() { + ffi.Pointer sqlite3_sourceid() { return _sqlite3_sourceid(); } late final _sqlite3_sourceidPtr = - _lookup Function()>>( + _lookup Function()>>( 'sqlite3_sourceid'); late final _sqlite3_sourceid = - _sqlite3_sourceidPtr.asFunction Function()>(); + _sqlite3_sourceidPtr.asFunction Function()>(); int sqlite3_libversion_number() { return _sqlite3_libversion_number(); } late final _sqlite3_libversion_numberPtr = - _lookup>( + _lookup>( 'sqlite3_libversion_number'); late final _sqlite3_libversion_number = _sqlite3_libversion_numberPtr.asFunction(); int sqlite3_compileoption_used( - ffi.Pointer zOptName, + ffi.Pointer zOptName, ) { return _sqlite3_compileoption_used( zOptName, ); } - late final _sqlite3_compileoption_usedPtr = - _lookup)>>( - 'sqlite3_compileoption_used'); + late final _sqlite3_compileoption_usedPtr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_compileoption_used'); late final _sqlite3_compileoption_used = _sqlite3_compileoption_usedPtr - .asFunction)>(); + .asFunction)>(); - ffi.Pointer sqlite3_compileoption_get( + ffi.Pointer sqlite3_compileoption_get( int N, ) { return _sqlite3_compileoption_get( @@ -110,11 +111,11 @@ class SQLite { ); } - late final _sqlite3_compileoption_getPtr = - _lookup Function(ffi.Int32)>>( - 'sqlite3_compileoption_get'); + late final _sqlite3_compileoption_getPtr = _lookup< + ffi.NativeFunction Function(pkg_ffi.Int)>>( + 'sqlite3_compileoption_get'); late final _sqlite3_compileoption_get = _sqlite3_compileoption_getPtr - .asFunction Function(int)>(); + .asFunction Function(int)>(); /// CAPI3REF: Test To See If The Library Is Threadsafe /// @@ -155,7 +156,7 @@ class SQLite { } late final _sqlite3_threadsafePtr = - _lookup>('sqlite3_threadsafe'); + _lookup>('sqlite3_threadsafe'); late final _sqlite3_threadsafe = _sqlite3_threadsafePtr.asFunction(); @@ -204,7 +205,7 @@ class SQLite { } late final _sqlite3_closePtr = - _lookup)>>( + _lookup)>>( 'sqlite3_close'); late final _sqlite3_close = _sqlite3_closePtr.asFunction)>(); @@ -218,7 +219,7 @@ class SQLite { } late final _sqlite3_close_v2Ptr = - _lookup)>>( + _lookup)>>( 'sqlite3_close_v2'); late final _sqlite3_close_v2 = _sqlite3_close_v2Ptr.asFunction)>(); @@ -285,17 +286,17 @@ class SQLite { /// int sqlite3_exec( ffi.Pointer arg0, - ffi.Pointer sql, + ffi.Pointer sql, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, - ffi.Pointer>, - ffi.Pointer>)>> + pkg_ffi.Int, + ffi.Pointer>, + ffi.Pointer>)>> callback, ffi.Pointer arg3, - ffi.Pointer> errmsg, + ffi.Pointer> errmsg, ) { return _sqlite3_exec( arg0, @@ -308,31 +309,31 @@ class SQLite { late final _sqlite3_execPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, - ffi.Pointer>, - ffi.Pointer>)>>, + pkg_ffi.Int, + ffi.Pointer>, + ffi.Pointer>)>>, ffi.Pointer, - ffi.Pointer>)>>('sqlite3_exec'); + ffi.Pointer>)>>('sqlite3_exec'); late final _sqlite3_exec = _sqlite3_execPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, - ffi.Pointer>, - ffi.Pointer>)>>, + pkg_ffi.Int, + ffi.Pointer>, + ffi.Pointer>)>>, ffi.Pointer, - ffi.Pointer>)>(); + ffi.Pointer>)>(); /// CAPI3REF: Initialize The SQLite Library /// @@ -412,7 +413,7 @@ class SQLite { } late final _sqlite3_initializePtr = - _lookup>('sqlite3_initialize'); + _lookup>('sqlite3_initialize'); late final _sqlite3_initialize = _sqlite3_initializePtr.asFunction(); @@ -421,7 +422,7 @@ class SQLite { } late final _sqlite3_shutdownPtr = - _lookup>('sqlite3_shutdown'); + _lookup>('sqlite3_shutdown'); late final _sqlite3_shutdown = _sqlite3_shutdownPtr.asFunction(); @@ -430,7 +431,7 @@ class SQLite { } late final _sqlite3_os_initPtr = - _lookup>('sqlite3_os_init'); + _lookup>('sqlite3_os_init'); late final _sqlite3_os_init = _sqlite3_os_initPtr.asFunction(); @@ -439,7 +440,7 @@ class SQLite { } late final _sqlite3_os_endPtr = - _lookup>('sqlite3_os_end'); + _lookup>('sqlite3_os_end'); late final _sqlite3_os_end = _sqlite3_os_endPtr.asFunction(); /// CAPI3REF: Configuring The SQLite Library @@ -480,7 +481,7 @@ class SQLite { } late final _sqlite3_configPtr = - _lookup>( + _lookup>( 'sqlite3_config'); late final _sqlite3_config = _sqlite3_configPtr.asFunction(); @@ -512,8 +513,8 @@ class SQLite { late final _sqlite3_db_configPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_db_config'); + pkg_ffi.Int Function( + ffi.Pointer, pkg_ffi.Int)>>('sqlite3_db_config'); late final _sqlite3_db_config = _sqlite3_db_configPtr .asFunction, int)>(); @@ -535,8 +536,8 @@ class SQLite { late final _sqlite3_extended_result_codesPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, - ffi.Int32)>>('sqlite3_extended_result_codes'); + pkg_ffi.Int Function(ffi.Pointer, + pkg_ffi.Int)>>('sqlite3_extended_result_codes'); late final _sqlite3_extended_result_codes = _sqlite3_extended_result_codesPtr .asFunction, int)>(); @@ -698,7 +699,7 @@ class SQLite { } late final _sqlite3_changesPtr = - _lookup)>>( + _lookup)>>( 'sqlite3_changes'); late final _sqlite3_changes = _sqlite3_changesPtr.asFunction)>(); @@ -745,7 +746,7 @@ class SQLite { } late final _sqlite3_total_changesPtr = - _lookup)>>( + _lookup)>>( 'sqlite3_total_changes'); late final _sqlite3_total_changes = _sqlite3_total_changesPtr .asFunction)>(); @@ -829,18 +830,18 @@ class SQLite { /// The input to [sqlite3_complete16()] must be a zero-terminated /// UTF-16 string in native byte order. int sqlite3_complete( - ffi.Pointer sql, + ffi.Pointer sql, ) { return _sqlite3_complete( sql, ); } - late final _sqlite3_completePtr = - _lookup)>>( - 'sqlite3_complete'); - late final _sqlite3_complete = - _sqlite3_completePtr.asFunction)>(); + late final _sqlite3_completePtr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_complete'); + late final _sqlite3_complete = _sqlite3_completePtr + .asFunction)>(); int sqlite3_complete16( ffi.Pointer sql, @@ -851,7 +852,7 @@ class SQLite { } late final _sqlite3_complete16Ptr = - _lookup)>>( + _lookup)>>( 'sqlite3_complete16'); late final _sqlite3_complete16 = _sqlite3_complete16Ptr.asFunction)>(); @@ -917,7 +918,7 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int)>> arg1, ffi.Pointer arg2, ) { @@ -930,18 +931,19 @@ class SQLite { late final _sqlite3_busy_handlerPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32)>>, + pkg_ffi.Int Function( + ffi.Pointer, pkg_ffi.Int)>>, ffi.Pointer)>>('sqlite3_busy_handler'); late final _sqlite3_busy_handler = _sqlite3_busy_handlerPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32)>>, + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int)>>, ffi.Pointer)>(); /// CAPI3REF: Set A Busy Timeout @@ -975,8 +977,8 @@ class SQLite { late final _sqlite3_busy_timeoutPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_busy_timeout'); + pkg_ffi.Int Function( + ffi.Pointer, pkg_ffi.Int)>>('sqlite3_busy_timeout'); late final _sqlite3_busy_timeout = _sqlite3_busy_timeoutPtr .asFunction, int)>(); @@ -1053,11 +1055,11 @@ class SQLite { /// [sqlite3_errmsg()]. int sqlite3_get_table( ffi.Pointer db, - ffi.Pointer zSql, - ffi.Pointer>> pazResult, - ffi.Pointer pnRow, - ffi.Pointer pnColumn, - ffi.Pointer> pzErrmsg, + ffi.Pointer zSql, + ffi.Pointer>> pazResult, + ffi.Pointer pnRow, + ffi.Pointer pnColumn, + ffi.Pointer> pzErrmsg, ) { return _sqlite3_get_table( db, @@ -1071,24 +1073,24 @@ class SQLite { late final _sqlite3_get_tablePtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer>>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('sqlite3_get_table'); + ffi.Pointer, + ffi.Pointer>>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('sqlite3_get_table'); late final _sqlite3_get_table = _sqlite3_get_tablePtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer>>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); + ffi.Pointer, + ffi.Pointer>>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); void sqlite3_free_table( - ffi.Pointer> result, + ffi.Pointer> result, ) { return _sqlite3_free_table( result, @@ -1098,9 +1100,9 @@ class SQLite { late final _sqlite3_free_tablePtr = _lookup< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer>)>>('sqlite3_free_table'); + ffi.Pointer>)>>('sqlite3_free_table'); late final _sqlite3_free_table = _sqlite3_free_tablePtr - .asFunction>)>(); + .asFunction>)>(); /// CAPI3REF: Formatted String Printing Functions /// @@ -1140,8 +1142,8 @@ class SQLite { /// ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf(). /// /// See also: [built-in printf()], [printf() SQL function] - ffi.Pointer sqlite3_mprintf( - ffi.Pointer arg0, + ffi.Pointer sqlite3_mprintf( + ffi.Pointer arg0, ) { return _sqlite3_mprintf( arg0, @@ -1150,15 +1152,15 @@ class SQLite { late final _sqlite3_mprintfPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sqlite3_mprintf'); - late final _sqlite3_mprintf = _sqlite3_mprintfPtr - .asFunction Function(ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_mprintf'); + late final _sqlite3_mprintf = _sqlite3_mprintfPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); - ffi.Pointer sqlite3_snprintf( + ffi.Pointer sqlite3_snprintf( int arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ) { return _sqlite3_snprintf( arg0, @@ -1169,11 +1171,13 @@ class SQLite { late final _sqlite3_snprintfPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Int32, ffi.Pointer, - ffi.Pointer)>>('sqlite3_snprintf'); + ffi.Pointer Function( + pkg_ffi.Int, + ffi.Pointer, + ffi.Pointer)>>('sqlite3_snprintf'); late final _sqlite3_snprintf = _sqlite3_snprintfPtr.asFunction< - ffi.Pointer Function( - int, ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + int, ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Memory Allocation Subsystem /// @@ -1257,7 +1261,7 @@ class SQLite { } late final _sqlite3_mallocPtr = - _lookup Function(ffi.Int32)>>( + _lookup Function(pkg_ffi.Int)>>( 'sqlite3_malloc'); late final _sqlite3_malloc = _sqlite3_mallocPtr.asFunction Function(int)>(); @@ -1289,7 +1293,7 @@ class SQLite { late final _sqlite3_reallocPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_realloc'); + ffi.Pointer, pkg_ffi.Int)>>('sqlite3_realloc'); late final _sqlite3_realloc = _sqlite3_reallocPtr .asFunction Function(ffi.Pointer, int)>(); @@ -1378,7 +1382,7 @@ class SQLite { } late final _sqlite3_memory_highwaterPtr = - _lookup>( + _lookup>( 'sqlite3_memory_highwater'); late final _sqlite3_memory_highwater = _sqlite3_memory_highwaterPtr.asFunction(); @@ -1415,7 +1419,7 @@ class SQLite { late final _sqlite3_randomnessPtr = _lookup< ffi.NativeFunction< ffi.Void Function( - ffi.Int32, ffi.Pointer)>>('sqlite3_randomness'); + pkg_ffi.Int, ffi.Pointer)>>('sqlite3_randomness'); late final _sqlite3_randomness = _sqlite3_randomnessPtr .asFunction)>(); @@ -1510,13 +1514,13 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>> + pkg_ffi.Int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>> xAuth, ffi.Pointer pUserData, ) { @@ -1529,30 +1533,30 @@ class SQLite { late final _sqlite3_set_authorizerPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>, + pkg_ffi.Int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>, ffi.Pointer)>>('sqlite3_set_authorizer'); late final _sqlite3_set_authorizer = _sqlite3_set_authorizerPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>, + pkg_ffi.Int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>, ffi.Pointer)>(); /// CAPI3REF: Tracing And Profiling Functions @@ -1590,7 +1594,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, ffi.Pointer)>> + ffi.Pointer, ffi.Pointer)>> xTrace, ffi.Pointer arg2, ) { @@ -1608,7 +1612,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer, ffi.Pointer)>>, ffi.Pointer)>>('sqlite3_trace'); late final _sqlite3_trace = _sqlite3_tracePtr.asFunction< ffi.Pointer Function( @@ -1616,15 +1620,15 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer, ffi.Pointer)>>, ffi.Pointer)>(); ffi.Pointer sqlite3_profile( ffi.Pointer arg0, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - sqlite3_uint64)>> + ffi.Void Function(ffi.Pointer, + ffi.Pointer, sqlite3_uint64)>> xProfile, ffi.Pointer arg2, ) { @@ -1642,7 +1646,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - ffi.Pointer, sqlite3_uint64)>>, + ffi.Pointer, sqlite3_uint64)>>, ffi.Pointer)>>('sqlite3_profile'); late final _sqlite3_profile = _sqlite3_profilePtr.asFunction< ffi.Pointer Function( @@ -1650,7 +1654,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - ffi.Pointer, sqlite3_uint64)>>, + ffi.Pointer, sqlite3_uint64)>>, ffi.Pointer)>(); /// CAPI3REF: SQL Trace Hook @@ -1685,7 +1689,7 @@ class SQLite { int uMask, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Uint32, ffi.Pointer, + pkg_ffi.Int Function(pkg_ffi.UnsignedInt, ffi.Pointer, ffi.Pointer, ffi.Pointer)>> xCallback, ffi.Pointer pCtx, @@ -1700,13 +1704,16 @@ class SQLite { late final _sqlite3_trace_v2Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Uint32, + pkg_ffi.UnsignedInt, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Uint32, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>, + pkg_ffi.Int Function( + pkg_ffi.UnsignedInt, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>, ffi.Pointer)>>('sqlite3_trace_v2'); late final _sqlite3_trace_v2 = _sqlite3_trace_v2Ptr.asFunction< int Function( @@ -1714,8 +1721,11 @@ class SQLite { int, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Uint32, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>, + pkg_ffi.Int Function( + pkg_ffi.UnsignedInt, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>, ffi.Pointer)>(); /// CAPI3REF: Query Progress Callbacks @@ -1750,7 +1760,7 @@ class SQLite { void sqlite3_progress_handler( ffi.Pointer arg0, int arg1, - ffi.Pointer)>> + ffi.Pointer)>> arg2, ffi.Pointer arg3, ) { @@ -1766,10 +1776,10 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer)>>, + pkg_ffi.Int Function(ffi.Pointer)>>, ffi.Pointer)>>('sqlite3_progress_handler'); late final _sqlite3_progress_handler = _sqlite3_progress_handlerPtr.asFunction< @@ -1778,7 +1788,7 @@ class SQLite { int, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer)>>, + pkg_ffi.Int Function(ffi.Pointer)>>, ffi.Pointer)>(); /// CAPI3REF: Opening A New Database Connection @@ -2033,7 +2043,7 @@ class SQLite { /// /// See also: [sqlite3_temp_directory] int sqlite3_open( - ffi.Pointer filename, + ffi.Pointer filename, ffi.Pointer> ppDb, ) { return _sqlite3_open( @@ -2044,10 +2054,11 @@ class SQLite { late final _sqlite3_openPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, + pkg_ffi.Int Function(ffi.Pointer, ffi.Pointer>)>>('sqlite3_open'); late final _sqlite3_open = _sqlite3_openPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer>)>(); + int Function( + ffi.Pointer, ffi.Pointer>)>(); int sqlite3_open16( ffi.Pointer filename, @@ -2061,16 +2072,16 @@ class SQLite { late final _sqlite3_open16Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, + pkg_ffi.Int Function(ffi.Pointer, ffi.Pointer>)>>('sqlite3_open16'); late final _sqlite3_open16 = _sqlite3_open16Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer>)>(); int sqlite3_open_v2( - ffi.Pointer filename, + ffi.Pointer filename, ffi.Pointer> ppDb, int flags, - ffi.Pointer zVfs, + ffi.Pointer zVfs, ) { return _sqlite3_open_v2( filename, @@ -2082,14 +2093,14 @@ class SQLite { late final _sqlite3_open_v2Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, + pkg_ffi.Int Function( + ffi.Pointer, ffi.Pointer>, - ffi.Int32, - ffi.Pointer)>>('sqlite3_open_v2'); + pkg_ffi.Int, + ffi.Pointer)>>('sqlite3_open_v2'); late final _sqlite3_open_v2 = _sqlite3_open_v2Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer>, - int, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer>, + int, ffi.Pointer)>(); /// CAPI3REF: Obtain Values For URI Parameters /// @@ -2155,9 +2166,9 @@ class SQLite { /// main database file. /// /// See the [URI filename] documentation for additional information. - ffi.Pointer sqlite3_uri_parameter( - ffi.Pointer zFilename, - ffi.Pointer zParam, + ffi.Pointer sqlite3_uri_parameter( + ffi.Pointer zFilename, + ffi.Pointer zParam, ) { return _sqlite3_uri_parameter( zFilename, @@ -2167,15 +2178,15 @@ class SQLite { late final _sqlite3_uri_parameterPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_uri_parameter'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_uri_parameter'); late final _sqlite3_uri_parameter = _sqlite3_uri_parameterPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); int sqlite3_uri_boolean( - ffi.Pointer zFile, - ffi.Pointer zParam, + ffi.Pointer zFile, + ffi.Pointer zParam, int bDefault, ) { return _sqlite3_uri_boolean( @@ -2187,14 +2198,15 @@ class SQLite { late final _sqlite3_uri_booleanPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('sqlite3_uri_boolean'); + pkg_ffi.Int Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Int)>>('sqlite3_uri_boolean'); late final _sqlite3_uri_boolean = _sqlite3_uri_booleanPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function( + ffi.Pointer, ffi.Pointer, int)>(); int sqlite3_uri_int64( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, int arg2, ) { return _sqlite3_uri_int64( @@ -2206,13 +2218,14 @@ class SQLite { late final _sqlite3_uri_int64Ptr = _lookup< ffi.NativeFunction< - sqlite3_int64 Function(ffi.Pointer, ffi.Pointer, - sqlite3_int64)>>('sqlite3_uri_int64'); + sqlite3_int64 Function(ffi.Pointer, + ffi.Pointer, sqlite3_int64)>>('sqlite3_uri_int64'); late final _sqlite3_uri_int64 = _sqlite3_uri_int64Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function( + ffi.Pointer, ffi.Pointer, int)>(); - ffi.Pointer sqlite3_uri_key( - ffi.Pointer zFilename, + ffi.Pointer sqlite3_uri_key( + ffi.Pointer zFilename, int N, ) { return _sqlite3_uri_key( @@ -2223,10 +2236,10 @@ class SQLite { late final _sqlite3_uri_keyPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_uri_key'); - late final _sqlite3_uri_key = _sqlite3_uri_keyPtr - .asFunction Function(ffi.Pointer, int)>(); + ffi.Pointer Function( + ffi.Pointer, pkg_ffi.Int)>>('sqlite3_uri_key'); + late final _sqlite3_uri_key = _sqlite3_uri_keyPtr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: Translate filenames /// @@ -2253,8 +2266,8 @@ class SQLite { /// filename passed into the VFS from the SQLite core and F is not the /// return value from [sqlite3_db_filename()], then the result is /// undefined and is likely a memory access violation. - ffi.Pointer sqlite3_filename_database( - ffi.Pointer arg0, + ffi.Pointer sqlite3_filename_database( + ffi.Pointer arg0, ) { return _sqlite3_filename_database( arg0, @@ -2263,13 +2276,14 @@ class SQLite { late final _sqlite3_filename_databasePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sqlite3_filename_database'); - late final _sqlite3_filename_database = _sqlite3_filename_databasePtr - .asFunction Function(ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_filename_database'); + late final _sqlite3_filename_database = + _sqlite3_filename_databasePtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); - ffi.Pointer sqlite3_filename_journal( - ffi.Pointer arg0, + ffi.Pointer sqlite3_filename_journal( + ffi.Pointer arg0, ) { return _sqlite3_filename_journal( arg0, @@ -2278,13 +2292,14 @@ class SQLite { late final _sqlite3_filename_journalPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sqlite3_filename_journal'); - late final _sqlite3_filename_journal = _sqlite3_filename_journalPtr - .asFunction Function(ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_filename_journal'); + late final _sqlite3_filename_journal = + _sqlite3_filename_journalPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); - ffi.Pointer sqlite3_filename_wal( - ffi.Pointer arg0, + ffi.Pointer sqlite3_filename_wal( + ffi.Pointer arg0, ) { return _sqlite3_filename_wal( arg0, @@ -2293,10 +2308,10 @@ class SQLite { late final _sqlite3_filename_walPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sqlite3_filename_wal'); - late final _sqlite3_filename_wal = _sqlite3_filename_walPtr - .asFunction Function(ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_filename_wal'); + late final _sqlite3_filename_wal = _sqlite3_filename_walPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); /// CAPI3REF: Database File Corresponding To A Journal /// @@ -2314,7 +2329,7 @@ class SQLite { /// of this routine results in undefined and probably undesirable /// behavior. ffi.Pointer sqlite3_database_file_object( - ffi.Pointer arg0, + ffi.Pointer arg0, ) { return _sqlite3_database_file_object( arg0, @@ -2324,9 +2339,10 @@ class SQLite { late final _sqlite3_database_file_objectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer)>>('sqlite3_database_file_object'); - late final _sqlite3_database_file_object = _sqlite3_database_file_objectPtr - .asFunction Function(ffi.Pointer)>(); + ffi.Pointer)>>('sqlite3_database_file_object'); + late final _sqlite3_database_file_object = + _sqlite3_database_file_objectPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); /// CAPI3REF: Create and Destroy VFS Filenames /// @@ -2371,12 +2387,12 @@ class SQLite { /// that if the [sqlite3_vfs.xOpen()] method of a VFS has been called using Y, /// then the corresponding [sqlite3_module.xClose() method should also be /// invoked prior to calling sqlite3_free_filename(Y). - ffi.Pointer sqlite3_create_filename( - ffi.Pointer zDatabase, - ffi.Pointer zJournal, - ffi.Pointer zWal, + ffi.Pointer sqlite3_create_filename( + ffi.Pointer zDatabase, + ffi.Pointer zJournal, + ffi.Pointer zWal, int nParam, - ffi.Pointer> azParam, + ffi.Pointer> azParam, ) { return _sqlite3_create_filename( zDatabase, @@ -2388,23 +2404,24 @@ class SQLite { } late final _sqlite3_create_filenamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('sqlite3_create_filename'); + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + pkg_ffi.Int, + ffi.Pointer>)>>( + 'sqlite3_create_filename'); late final _sqlite3_create_filename = _sqlite3_create_filenamePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, int, - ffi.Pointer>)>(); + ffi.Pointer>)>(); void sqlite3_free_filename( - ffi.Pointer arg0, + ffi.Pointer arg0, ) { return _sqlite3_free_filename( arg0, @@ -2412,10 +2429,10 @@ class SQLite { } late final _sqlite3_free_filenamePtr = - _lookup)>>( + _lookup)>>( 'sqlite3_free_filename'); late final _sqlite3_free_filename = _sqlite3_free_filenamePtr - .asFunction)>(); + .asFunction)>(); /// CAPI3REF: Error Codes And Messages /// METHOD: sqlite3 @@ -2476,7 +2493,7 @@ class SQLite { } late final _sqlite3_errcodePtr = - _lookup)>>( + _lookup)>>( 'sqlite3_errcode'); late final _sqlite3_errcode = _sqlite3_errcodePtr.asFunction)>(); @@ -2490,12 +2507,12 @@ class SQLite { } late final _sqlite3_extended_errcodePtr = - _lookup)>>( + _lookup)>>( 'sqlite3_extended_errcode'); late final _sqlite3_extended_errcode = _sqlite3_extended_errcodePtr .asFunction)>(); - ffi.Pointer sqlite3_errmsg( + ffi.Pointer sqlite3_errmsg( ffi.Pointer arg0, ) { return _sqlite3_errmsg( @@ -2505,10 +2522,10 @@ class SQLite { late final _sqlite3_errmsgPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('sqlite3_errmsg'); late final _sqlite3_errmsg = _sqlite3_errmsgPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_errmsg16( ffi.Pointer arg0, @@ -2525,7 +2542,7 @@ class SQLite { late final _sqlite3_errmsg16 = _sqlite3_errmsg16Ptr .asFunction Function(ffi.Pointer)>(); - ffi.Pointer sqlite3_errstr( + ffi.Pointer sqlite3_errstr( int arg0, ) { return _sqlite3_errstr( @@ -2533,11 +2550,11 @@ class SQLite { ); } - late final _sqlite3_errstrPtr = - _lookup Function(ffi.Int32)>>( - 'sqlite3_errstr'); + late final _sqlite3_errstrPtr = _lookup< + ffi.NativeFunction Function(pkg_ffi.Int)>>( + 'sqlite3_errstr'); late final _sqlite3_errstr = - _sqlite3_errstrPtr.asFunction Function(int)>(); + _sqlite3_errstrPtr.asFunction Function(int)>(); /// CAPI3REF: Run-time Limits /// METHOD: sqlite3 @@ -2591,8 +2608,8 @@ class SQLite { late final _sqlite3_limitPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Int32, ffi.Int32)>>('sqlite3_limit'); + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, + pkg_ffi.Int)>>('sqlite3_limit'); late final _sqlite3_limit = _sqlite3_limitPtr .asFunction, int, int)>(); @@ -2696,10 +2713,10 @@ class SQLite { /// sqlite3_prepare_v3() with a zero prepFlags parameter. int sqlite3_prepare( ffi.Pointer db, - ffi.Pointer zSql, + ffi.Pointer zSql, int nByte, ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, + ffi.Pointer> pzTail, ) { return _sqlite3_prepare( db, @@ -2712,26 +2729,26 @@ class SQLite { late final _sqlite3_preparePtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Pointer, - ffi.Int32, + ffi.Pointer, + pkg_ffi.Int, ffi.Pointer>, - ffi.Pointer>)>>('sqlite3_prepare'); + ffi.Pointer>)>>('sqlite3_prepare'); late final _sqlite3_prepare = _sqlite3_preparePtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, ffi.Pointer>, - ffi.Pointer>)>(); + ffi.Pointer>)>(); int sqlite3_prepare_v2( ffi.Pointer db, - ffi.Pointer zSql, + ffi.Pointer zSql, int nByte, ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, + ffi.Pointer> pzTail, ) { return _sqlite3_prepare_v2( db, @@ -2744,27 +2761,27 @@ class SQLite { late final _sqlite3_prepare_v2Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Pointer, - ffi.Int32, + ffi.Pointer, + pkg_ffi.Int, ffi.Pointer>, - ffi.Pointer>)>>('sqlite3_prepare_v2'); + ffi.Pointer>)>>('sqlite3_prepare_v2'); late final _sqlite3_prepare_v2 = _sqlite3_prepare_v2Ptr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, ffi.Pointer>, - ffi.Pointer>)>(); + ffi.Pointer>)>(); int sqlite3_prepare_v3( ffi.Pointer db, - ffi.Pointer zSql, + ffi.Pointer zSql, int nByte, int prepFlags, ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, + ffi.Pointer> pzTail, ) { return _sqlite3_prepare_v3( db, @@ -2778,21 +2795,21 @@ class SQLite { late final _sqlite3_prepare_v3Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Uint32, + ffi.Pointer, + pkg_ffi.Int, + pkg_ffi.UnsignedInt, ffi.Pointer>, - ffi.Pointer>)>>('sqlite3_prepare_v3'); + ffi.Pointer>)>>('sqlite3_prepare_v3'); late final _sqlite3_prepare_v3 = _sqlite3_prepare_v3Ptr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer>, - ffi.Pointer>)>(); + ffi.Pointer>)>(); int sqlite3_prepare16( ffi.Pointer db, @@ -2812,10 +2829,10 @@ class SQLite { late final _sqlite3_prepare16Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer>, ffi.Pointer>)>>('sqlite3_prepare16'); late final _sqlite3_prepare16 = _sqlite3_prepare16Ptr.asFunction< @@ -2844,10 +2861,10 @@ class SQLite { late final _sqlite3_prepare16_v2Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer>, ffi.Pointer>)>>('sqlite3_prepare16_v2'); late final _sqlite3_prepare16_v2 = _sqlite3_prepare16_v2Ptr.asFunction< @@ -2878,11 +2895,11 @@ class SQLite { late final _sqlite3_prepare16_v3Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, ffi.Pointer, - ffi.Int32, - ffi.Uint32, + pkg_ffi.Int, + pkg_ffi.UnsignedInt, ffi.Pointer>, ffi.Pointer>)>>('sqlite3_prepare16_v3'); late final _sqlite3_prepare16_v3 = _sqlite3_prepare16_v3Ptr.asFunction< @@ -2930,7 +2947,7 @@ class SQLite { /// ^The string returned by sqlite3_expanded_sql(P), on the other hand, /// is obtained from [sqlite3_malloc()] and must be free by the application /// by passing it to [sqlite3_free()]. - ffi.Pointer sqlite3_sql( + ffi.Pointer sqlite3_sql( ffi.Pointer pStmt, ) { return _sqlite3_sql( @@ -2940,12 +2957,12 @@ class SQLite { late final _sqlite3_sqlPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('sqlite3_sql'); - late final _sqlite3_sql = _sqlite3_sqlPtr - .asFunction Function(ffi.Pointer)>(); + late final _sqlite3_sql = _sqlite3_sqlPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); - ffi.Pointer sqlite3_expanded_sql( + ffi.Pointer sqlite3_expanded_sql( ffi.Pointer pStmt, ) { return _sqlite3_expanded_sql( @@ -2955,12 +2972,12 @@ class SQLite { late final _sqlite3_expanded_sqlPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('sqlite3_expanded_sql'); - late final _sqlite3_expanded_sql = _sqlite3_expanded_sqlPtr - .asFunction Function(ffi.Pointer)>(); + late final _sqlite3_expanded_sql = _sqlite3_expanded_sqlPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); - ffi.Pointer sqlite3_normalized_sql( + ffi.Pointer sqlite3_normalized_sql( ffi.Pointer pStmt, ) { return _sqlite3_normalized_sql( @@ -2970,10 +2987,10 @@ class SQLite { late final _sqlite3_normalized_sqlPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('sqlite3_normalized_sql'); - late final _sqlite3_normalized_sql = _sqlite3_normalized_sqlPtr - .asFunction Function(ffi.Pointer)>(); + late final _sqlite3_normalized_sql = _sqlite3_normalized_sqlPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); /// CAPI3REF: Determine If An SQL Statement Writes The Database /// METHOD: sqlite3_stmt @@ -3016,7 +3033,7 @@ class SQLite { } late final _sqlite3_stmt_readonlyPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_stmt_readonly'); late final _sqlite3_stmt_readonly = _sqlite3_stmt_readonlyPtr .asFunction)>(); @@ -3038,7 +3055,7 @@ class SQLite { } late final _sqlite3_stmt_isexplainPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_stmt_isexplain'); late final _sqlite3_stmt_isexplain = _sqlite3_stmt_isexplainPtr .asFunction)>(); @@ -3069,7 +3086,7 @@ class SQLite { } late final _sqlite3_stmt_busyPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_stmt_busy'); late final _sqlite3_stmt_busy = _sqlite3_stmt_busyPtr .asFunction)>(); @@ -3227,11 +3244,11 @@ class SQLite { late final _sqlite3_bind_blobPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -3264,9 +3281,9 @@ class SQLite { late final _sqlite3_bind_blob64Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer, sqlite3_uint64, ffi.Pointer< @@ -3296,7 +3313,7 @@ class SQLite { late final _sqlite3_bind_doublePtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32, + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, ffi.Double)>>('sqlite3_bind_double'); late final _sqlite3_bind_double = _sqlite3_bind_doublePtr .asFunction, int, double)>(); @@ -3315,8 +3332,8 @@ class SQLite { late final _sqlite3_bind_intPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32, - ffi.Int32)>>('sqlite3_bind_int'); + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, + pkg_ffi.Int)>>('sqlite3_bind_int'); late final _sqlite3_bind_int = _sqlite3_bind_intPtr .asFunction, int, int)>(); @@ -3334,7 +3351,7 @@ class SQLite { late final _sqlite3_bind_int64Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32, + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, sqlite3_int64)>>('sqlite3_bind_int64'); late final _sqlite3_bind_int64 = _sqlite3_bind_int64Ptr .asFunction, int, int)>(); @@ -3351,15 +3368,15 @@ class SQLite { late final _sqlite3_bind_nullPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_bind_null'); + pkg_ffi.Int Function( + ffi.Pointer, pkg_ffi.Int)>>('sqlite3_bind_null'); late final _sqlite3_bind_null = _sqlite3_bind_nullPtr .asFunction, int)>(); int sqlite3_bind_text( ffi.Pointer arg0, int arg1, - ffi.Pointer arg2, + ffi.Pointer arg2, int arg3, ffi.Pointer)>> arg4, @@ -3375,11 +3392,11 @@ class SQLite { late final _sqlite3_bind_textPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, + ffi.Pointer, + pkg_ffi.Int, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -3388,7 +3405,7 @@ class SQLite { int Function( ffi.Pointer, int, - ffi.Pointer, + ffi.Pointer, int, ffi.Pointer< ffi.NativeFunction)>>)>(); @@ -3412,11 +3429,11 @@ class SQLite { late final _sqlite3_bind_text16Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -3433,7 +3450,7 @@ class SQLite { int sqlite3_bind_text64( ffi.Pointer arg0, int arg1, - ffi.Pointer arg2, + ffi.Pointer arg2, int arg3, ffi.Pointer)>> arg4, @@ -3451,19 +3468,19 @@ class SQLite { late final _sqlite3_bind_text64Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, - ffi.Pointer, + pkg_ffi.Int, + ffi.Pointer, sqlite3_uint64, ffi.Pointer< ffi.NativeFunction)>>, - ffi.Uint8)>>('sqlite3_bind_text64'); + pkg_ffi.UnsignedChar)>>('sqlite3_bind_text64'); late final _sqlite3_bind_text64 = _sqlite3_bind_text64Ptr.asFunction< int Function( ffi.Pointer, int, - ffi.Pointer, + ffi.Pointer, int, ffi.Pointer< ffi.NativeFunction)>>, @@ -3483,7 +3500,7 @@ class SQLite { late final _sqlite3_bind_valuePtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32, + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, ffi.Pointer)>>('sqlite3_bind_value'); late final _sqlite3_bind_value = _sqlite3_bind_valuePtr.asFunction< int Function( @@ -3493,7 +3510,7 @@ class SQLite { ffi.Pointer arg0, int arg1, ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg3, ffi.Pointer)>> arg4, ) { @@ -3508,11 +3525,11 @@ class SQLite { late final _sqlite3_bind_pointerPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -3522,7 +3539,7 @@ class SQLite { ffi.Pointer, int, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer< ffi.NativeFunction)>>)>(); @@ -3540,8 +3557,8 @@ class SQLite { late final _sqlite3_bind_zeroblobPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32, - ffi.Int32)>>('sqlite3_bind_zeroblob'); + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, + pkg_ffi.Int)>>('sqlite3_bind_zeroblob'); late final _sqlite3_bind_zeroblob = _sqlite3_bind_zeroblobPtr .asFunction, int, int)>(); @@ -3559,7 +3576,7 @@ class SQLite { late final _sqlite3_bind_zeroblob64Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32, + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, sqlite3_uint64)>>('sqlite3_bind_zeroblob64'); late final _sqlite3_bind_zeroblob64 = _sqlite3_bind_zeroblob64Ptr .asFunction, int, int)>(); @@ -3590,7 +3607,7 @@ class SQLite { } late final _sqlite3_bind_parameter_countPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_bind_parameter_count'); late final _sqlite3_bind_parameter_count = _sqlite3_bind_parameter_countPtr .asFunction)>(); @@ -3619,7 +3636,7 @@ class SQLite { /// See also: [sqlite3_bind_blob|sqlite3_bind()], /// [sqlite3_bind_parameter_count()], and /// [sqlite3_bind_parameter_index()]. - ffi.Pointer sqlite3_bind_parameter_name( + ffi.Pointer sqlite3_bind_parameter_name( ffi.Pointer arg0, int arg1, ) { @@ -3631,11 +3648,11 @@ class SQLite { late final _sqlite3_bind_parameter_namePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Int32)>>('sqlite3_bind_parameter_name'); + ffi.Pointer Function(ffi.Pointer, + pkg_ffi.Int)>>('sqlite3_bind_parameter_name'); late final _sqlite3_bind_parameter_name = _sqlite3_bind_parameter_namePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: Index Of A Parameter With A Given Name /// METHOD: sqlite3_stmt @@ -3653,7 +3670,7 @@ class SQLite { /// [sqlite3_bind_parameter_name()]. int sqlite3_bind_parameter_index( ffi.Pointer arg0, - ffi.Pointer zName, + ffi.Pointer zName, ) { return _sqlite3_bind_parameter_index( arg0, @@ -3663,11 +3680,11 @@ class SQLite { late final _sqlite3_bind_parameter_indexPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_bind_parameter_index'); + pkg_ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_bind_parameter_index'); late final _sqlite3_bind_parameter_index = _sqlite3_bind_parameter_indexPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Reset All Bindings On A Prepared Statement /// METHOD: sqlite3_stmt @@ -3684,7 +3701,7 @@ class SQLite { } late final _sqlite3_clear_bindingsPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_clear_bindings'); late final _sqlite3_clear_bindings = _sqlite3_clear_bindingsPtr .asFunction)>(); @@ -3710,7 +3727,7 @@ class SQLite { } late final _sqlite3_column_countPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_column_count'); late final _sqlite3_column_count = _sqlite3_column_countPtr .asFunction)>(); @@ -3740,7 +3757,7 @@ class SQLite { /// that column, if there is an AS clause. If there is no AS clause /// then the name of the column is unspecified and may change from /// one release of SQLite to the next. - ffi.Pointer sqlite3_column_name( + ffi.Pointer sqlite3_column_name( ffi.Pointer arg0, int N, ) { @@ -3752,10 +3769,10 @@ class SQLite { late final _sqlite3_column_namePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_column_name'); + ffi.Pointer Function( + ffi.Pointer, pkg_ffi.Int)>>('sqlite3_column_name'); late final _sqlite3_column_name = _sqlite3_column_namePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_name16( ffi.Pointer arg0, @@ -3769,8 +3786,8 @@ class SQLite { late final _sqlite3_column_name16Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_column_name16'); + ffi.Pointer Function(ffi.Pointer, + pkg_ffi.Int)>>('sqlite3_column_name16'); late final _sqlite3_column_name16 = _sqlite3_column_name16Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -3814,7 +3831,7 @@ class SQLite { /// [sqlite3_column_database_name | column metadata interfaces] /// for the same [prepared statement] and result column /// at the same time then the results are undefined. - ffi.Pointer sqlite3_column_database_name( + ffi.Pointer sqlite3_column_database_name( ffi.Pointer arg0, int arg1, ) { @@ -3826,11 +3843,11 @@ class SQLite { late final _sqlite3_column_database_namePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Int32)>>('sqlite3_column_database_name'); + ffi.Pointer Function(ffi.Pointer, + pkg_ffi.Int)>>('sqlite3_column_database_name'); late final _sqlite3_column_database_name = _sqlite3_column_database_namePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_database_name16( ffi.Pointer arg0, @@ -3845,12 +3862,12 @@ class SQLite { late final _sqlite3_column_database_name16Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Int32)>>('sqlite3_column_database_name16'); + pkg_ffi.Int)>>('sqlite3_column_database_name16'); late final _sqlite3_column_database_name16 = _sqlite3_column_database_name16Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); - ffi.Pointer sqlite3_column_table_name( + ffi.Pointer sqlite3_column_table_name( ffi.Pointer arg0, int arg1, ) { @@ -3862,11 +3879,11 @@ class SQLite { late final _sqlite3_column_table_namePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Int32)>>('sqlite3_column_table_name'); + ffi.Pointer Function(ffi.Pointer, + pkg_ffi.Int)>>('sqlite3_column_table_name'); late final _sqlite3_column_table_name = _sqlite3_column_table_namePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_table_name16( ffi.Pointer arg0, @@ -3881,12 +3898,12 @@ class SQLite { late final _sqlite3_column_table_name16Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Int32)>>('sqlite3_column_table_name16'); + pkg_ffi.Int)>>('sqlite3_column_table_name16'); late final _sqlite3_column_table_name16 = _sqlite3_column_table_name16Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); - ffi.Pointer sqlite3_column_origin_name( + ffi.Pointer sqlite3_column_origin_name( ffi.Pointer arg0, int arg1, ) { @@ -3898,11 +3915,11 @@ class SQLite { late final _sqlite3_column_origin_namePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Int32)>>('sqlite3_column_origin_name'); + ffi.Pointer Function(ffi.Pointer, + pkg_ffi.Int)>>('sqlite3_column_origin_name'); late final _sqlite3_column_origin_name = _sqlite3_column_origin_namePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_origin_name16( ffi.Pointer arg0, @@ -3917,7 +3934,7 @@ class SQLite { late final _sqlite3_column_origin_name16Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Int32)>>('sqlite3_column_origin_name16'); + pkg_ffi.Int)>>('sqlite3_column_origin_name16'); late final _sqlite3_column_origin_name16 = _sqlite3_column_origin_name16Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -3950,7 +3967,7 @@ class SQLite { /// strongly typed, but the typing is dynamic not static. ^Type /// is associated with individual values, not with the containers /// used to hold those values. - ffi.Pointer sqlite3_column_decltype( + ffi.Pointer sqlite3_column_decltype( ffi.Pointer arg0, int arg1, ) { @@ -3962,10 +3979,10 @@ class SQLite { late final _sqlite3_column_decltypePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Int32)>>('sqlite3_column_decltype'); + ffi.Pointer Function(ffi.Pointer, + pkg_ffi.Int)>>('sqlite3_column_decltype'); late final _sqlite3_column_decltype = _sqlite3_column_decltypePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_decltype16( ffi.Pointer arg0, @@ -3980,7 +3997,7 @@ class SQLite { late final _sqlite3_column_decltype16Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Int32)>>('sqlite3_column_decltype16'); + pkg_ffi.Int)>>('sqlite3_column_decltype16'); late final _sqlite3_column_decltype16 = _sqlite3_column_decltype16Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -4074,7 +4091,7 @@ class SQLite { } late final _sqlite3_stepPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_step'); late final _sqlite3_step = _sqlite3_stepPtr.asFunction)>(); @@ -4105,7 +4122,7 @@ class SQLite { } late final _sqlite3_data_countPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_data_count'); late final _sqlite3_data_count = _sqlite3_data_countPtr .asFunction)>(); @@ -4330,7 +4347,7 @@ class SQLite { late final _sqlite3_column_blobPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_column_blob'); + ffi.Pointer, pkg_ffi.Int)>>('sqlite3_column_blob'); late final _sqlite3_column_blob = _sqlite3_column_blobPtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -4346,8 +4363,8 @@ class SQLite { late final _sqlite3_column_doublePtr = _lookup< ffi.NativeFunction< - ffi.Double Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_column_double'); + ffi.Double Function(ffi.Pointer, + pkg_ffi.Int)>>('sqlite3_column_double'); late final _sqlite3_column_double = _sqlite3_column_doublePtr .asFunction, int)>(); @@ -4363,8 +4380,8 @@ class SQLite { late final _sqlite3_column_intPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_column_int'); + pkg_ffi.Int Function( + ffi.Pointer, pkg_ffi.Int)>>('sqlite3_column_int'); late final _sqlite3_column_int = _sqlite3_column_intPtr .asFunction, int)>(); @@ -4381,11 +4398,11 @@ class SQLite { late final _sqlite3_column_int64Ptr = _lookup< ffi.NativeFunction< sqlite3_int64 Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_column_int64'); + ffi.Pointer, pkg_ffi.Int)>>('sqlite3_column_int64'); late final _sqlite3_column_int64 = _sqlite3_column_int64Ptr .asFunction, int)>(); - ffi.Pointer sqlite3_column_text( + ffi.Pointer sqlite3_column_text( ffi.Pointer arg0, int iCol, ) { @@ -4397,10 +4414,11 @@ class SQLite { late final _sqlite3_column_textPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_column_text'); + ffi.Pointer Function( + ffi.Pointer, pkg_ffi.Int)>>('sqlite3_column_text'); late final _sqlite3_column_text = _sqlite3_column_textPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); + ffi.Pointer Function( + ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_text16( ffi.Pointer arg0, @@ -4414,8 +4432,8 @@ class SQLite { late final _sqlite3_column_text16Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_column_text16'); + ffi.Pointer Function(ffi.Pointer, + pkg_ffi.Int)>>('sqlite3_column_text16'); late final _sqlite3_column_text16 = _sqlite3_column_text16Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -4432,7 +4450,7 @@ class SQLite { late final _sqlite3_column_valuePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_column_value'); + ffi.Pointer, pkg_ffi.Int)>>('sqlite3_column_value'); late final _sqlite3_column_value = _sqlite3_column_valuePtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -4448,8 +4466,8 @@ class SQLite { late final _sqlite3_column_bytesPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_column_bytes'); + pkg_ffi.Int Function( + ffi.Pointer, pkg_ffi.Int)>>('sqlite3_column_bytes'); late final _sqlite3_column_bytes = _sqlite3_column_bytesPtr .asFunction, int)>(); @@ -4465,8 +4483,8 @@ class SQLite { late final _sqlite3_column_bytes16Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_column_bytes16'); + pkg_ffi.Int Function(ffi.Pointer, + pkg_ffi.Int)>>('sqlite3_column_bytes16'); late final _sqlite3_column_bytes16 = _sqlite3_column_bytes16Ptr .asFunction, int)>(); @@ -4482,8 +4500,8 @@ class SQLite { late final _sqlite3_column_typePtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_column_type'); + pkg_ffi.Int Function( + ffi.Pointer, pkg_ffi.Int)>>('sqlite3_column_type'); late final _sqlite3_column_type = _sqlite3_column_typePtr .asFunction, int)>(); @@ -4520,7 +4538,7 @@ class SQLite { } late final _sqlite3_finalizePtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_finalize'); late final _sqlite3_finalize = _sqlite3_finalizePtr .asFunction)>(); @@ -4557,7 +4575,7 @@ class SQLite { } late final _sqlite3_resetPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_reset'); late final _sqlite3_reset = _sqlite3_resetPtr.asFunction)>(); @@ -4687,18 +4705,18 @@ class SQLite { /// statement in which the function is running. int sqlite3_create_function( ffi.Pointer db, - ffi.Pointer zFunctionName, + ffi.Pointer zFunctionName, int nArg, int eTextRep, ffi.Pointer pApp, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Void Function(ffi.Pointer, pkg_ffi.Int, ffi.Pointer>)>> xFunc, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Void Function(ffi.Pointer, pkg_ffi.Int, ffi.Pointer>)>> xStep, ffi.Pointer< @@ -4717,46 +4735,44 @@ class SQLite { ); } - late final _sqlite3_create_functionPtr = - _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer)>>)>>( - 'sqlite3_create_function'); + late final _sqlite3_create_functionPtr = _lookup< + ffi.NativeFunction< + pkg_ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + pkg_ffi.Int, + pkg_ffi.Int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + pkg_ffi.Int, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + pkg_ffi.Int, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( + 'sqlite3_create_function'); late final _sqlite3_create_function = _sqlite3_create_functionPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Void Function(ffi.Pointer, pkg_ffi.Int, ffi.Pointer>)>>, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Void Function(ffi.Pointer, pkg_ffi.Int, ffi.Pointer>)>>, ffi.Pointer< ffi.NativeFunction< @@ -4770,12 +4786,12 @@ class SQLite { ffi.Pointer pApp, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Void Function(ffi.Pointer, pkg_ffi.Int, ffi.Pointer>)>> xFunc, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Void Function(ffi.Pointer, pkg_ffi.Int, ffi.Pointer>)>> xStep, ffi.Pointer< @@ -4794,32 +4810,30 @@ class SQLite { ); } - late final _sqlite3_create_function16Ptr = - _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer)>>)>>( - 'sqlite3_create_function16'); + late final _sqlite3_create_function16Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + pkg_ffi.Int, + pkg_ffi.Int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + pkg_ffi.Int, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + pkg_ffi.Int, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( + 'sqlite3_create_function16'); late final _sqlite3_create_function16 = _sqlite3_create_function16Ptr.asFunction< int Function( @@ -4830,11 +4844,15 @@ class SQLite { ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Void Function( + ffi.Pointer, + pkg_ffi.Int, ffi.Pointer>)>>, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Void Function( + ffi.Pointer, + pkg_ffi.Int, ffi.Pointer>)>>, ffi.Pointer< ffi.NativeFunction< @@ -4842,18 +4860,18 @@ class SQLite { int sqlite3_create_function_v2( ffi.Pointer db, - ffi.Pointer zFunctionName, + ffi.Pointer zFunctionName, int nArg, int eTextRep, ffi.Pointer pApp, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Void Function(ffi.Pointer, pkg_ffi.Int, ffi.Pointer>)>> xFunc, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Void Function(ffi.Pointer, pkg_ffi.Int, ffi.Pointer>)>> xStep, ffi.Pointer< @@ -4875,49 +4893,52 @@ class SQLite { ); } - late final _sqlite3_create_function_v2Ptr = - _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>)>>( - 'sqlite3_create_function_v2'); + late final _sqlite3_create_function_v2Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + pkg_ffi.Int, + pkg_ffi.Int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + pkg_ffi.Int, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + pkg_ffi.Int, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( + 'sqlite3_create_function_v2'); late final _sqlite3_create_function_v2 = _sqlite3_create_function_v2Ptr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Void Function( + ffi.Pointer, + pkg_ffi.Int, ffi.Pointer>)>>, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Void Function( + ffi.Pointer, + pkg_ffi.Int, ffi.Pointer>)>>, ffi.Pointer< ffi.NativeFunction< @@ -4928,13 +4949,13 @@ class SQLite { int sqlite3_create_window_function( ffi.Pointer db, - ffi.Pointer zFunctionName, + ffi.Pointer zFunctionName, int nArg, int eTextRep, ffi.Pointer pApp, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Void Function(ffi.Pointer, pkg_ffi.Int, ffi.Pointer>)>> xStep, ffi.Pointer< @@ -4945,7 +4966,7 @@ class SQLite { xValue, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Void Function(ffi.Pointer, pkg_ffi.Int, ffi.Pointer>)>> xInverse, ffi.Pointer)>> @@ -4965,48 +4986,49 @@ class SQLite { ); } - late final _sqlite3_create_window_functionPtr = - _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>)>>( - 'sqlite3_create_window_function'); + late final _sqlite3_create_window_functionPtr = _lookup< + ffi.NativeFunction< + pkg_ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + pkg_ffi.Int, + pkg_ffi.Int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + pkg_ffi.Int, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + pkg_ffi.Int, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( + 'sqlite3_create_window_function'); late final _sqlite3_create_window_function = _sqlite3_create_window_functionPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Void Function( + ffi.Pointer, + pkg_ffi.Int, ffi.Pointer>)>>, ffi.Pointer< ffi.NativeFunction< @@ -5016,7 +5038,9 @@ class SQLite { ffi.Void Function(ffi.Pointer)>>, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Void Function( + ffi.Pointer, + pkg_ffi.Int, ffi.Pointer>)>>, ffi.Pointer< ffi.NativeFunction< @@ -5031,8 +5055,9 @@ class SQLite { } late final _sqlite3_aggregate_countPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_aggregate_count'); + ffi.NativeFunction< + pkg_ffi.Int Function( + ffi.Pointer)>>('sqlite3_aggregate_count'); late final _sqlite3_aggregate_count = _sqlite3_aggregate_countPtr .asFunction)>(); @@ -5045,7 +5070,7 @@ class SQLite { } late final _sqlite3_expiredPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_expired'); late final _sqlite3_expired = _sqlite3_expiredPtr.asFunction)>(); @@ -5062,7 +5087,7 @@ class SQLite { late final _sqlite3_transfer_bindingsPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, + pkg_ffi.Int Function(ffi.Pointer, ffi.Pointer)>>('sqlite3_transfer_bindings'); late final _sqlite3_transfer_bindings = _sqlite3_transfer_bindingsPtr.asFunction< @@ -5073,7 +5098,7 @@ class SQLite { } late final _sqlite3_global_recoverPtr = - _lookup>( + _lookup>( 'sqlite3_global_recover'); late final _sqlite3_global_recover = _sqlite3_global_recoverPtr.asFunction(); @@ -5092,7 +5117,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, sqlite3_int64, ffi.Int32)>> + ffi.Pointer, sqlite3_int64, pkg_ffi.Int)>> arg0, ffi.Pointer arg1, int arg2, @@ -5106,11 +5131,11 @@ class SQLite { late final _sqlite3_memory_alarmPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, sqlite3_int64, ffi.Int32)>>, + ffi.Pointer, sqlite3_int64, pkg_ffi.Int)>>, ffi.Pointer, sqlite3_int64)>>('sqlite3_memory_alarm'); late final _sqlite3_memory_alarm = _sqlite3_memory_alarmPtr.asFunction< @@ -5118,7 +5143,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, sqlite3_int64, ffi.Int32)>>, + ffi.Pointer, sqlite3_int64, pkg_ffi.Int)>>, ffi.Pointer, int)>(); @@ -5286,7 +5311,7 @@ class SQLite { } late final _sqlite3_value_intPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_value_int'); late final _sqlite3_value_int = _sqlite3_value_intPtr .asFunction)>(); @@ -5308,7 +5333,7 @@ class SQLite { ffi.Pointer sqlite3_value_pointer( ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, ) { return _sqlite3_value_pointer( arg0, @@ -5319,12 +5344,12 @@ class SQLite { late final _sqlite3_value_pointerPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_value_pointer'); + ffi.Pointer)>>('sqlite3_value_pointer'); late final _sqlite3_value_pointer = _sqlite3_value_pointerPtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer sqlite3_value_text( + ffi.Pointer sqlite3_value_text( ffi.Pointer arg0, ) { return _sqlite3_value_text( @@ -5334,10 +5359,10 @@ class SQLite { late final _sqlite3_value_textPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('sqlite3_value_text'); late final _sqlite3_value_text = _sqlite3_value_textPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer)>(); ffi.Pointer sqlite3_value_text16( ffi.Pointer arg0, @@ -5393,7 +5418,7 @@ class SQLite { } late final _sqlite3_value_bytesPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_value_bytes'); late final _sqlite3_value_bytes = _sqlite3_value_bytesPtr .asFunction)>(); @@ -5407,7 +5432,7 @@ class SQLite { } late final _sqlite3_value_bytes16Ptr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_value_bytes16'); late final _sqlite3_value_bytes16 = _sqlite3_value_bytes16Ptr .asFunction)>(); @@ -5421,7 +5446,7 @@ class SQLite { } late final _sqlite3_value_typePtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_value_type'); late final _sqlite3_value_type = _sqlite3_value_typePtr .asFunction)>(); @@ -5435,7 +5460,7 @@ class SQLite { } late final _sqlite3_value_numeric_typePtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_value_numeric_type'); late final _sqlite3_value_numeric_type = _sqlite3_value_numeric_typePtr .asFunction)>(); @@ -5449,7 +5474,7 @@ class SQLite { } late final _sqlite3_value_nochangePtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_value_nochange'); late final _sqlite3_value_nochange = _sqlite3_value_nochangePtr .asFunction)>(); @@ -5463,7 +5488,7 @@ class SQLite { } late final _sqlite3_value_frombindPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_value_frombind'); late final _sqlite3_value_frombind = _sqlite3_value_frombindPtr .asFunction)>(); @@ -5485,8 +5510,9 @@ class SQLite { } late final _sqlite3_value_subtypePtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_value_subtype'); + ffi.NativeFunction< + pkg_ffi.UnsignedInt Function( + ffi.Pointer)>>('sqlite3_value_subtype'); late final _sqlite3_value_subtype = _sqlite3_value_subtypePtr .asFunction)>(); @@ -5585,7 +5611,7 @@ class SQLite { late final _sqlite3_aggregate_contextPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Int32)>>('sqlite3_aggregate_context'); + pkg_ffi.Int)>>('sqlite3_aggregate_context'); late final _sqlite3_aggregate_context = _sqlite3_aggregate_contextPtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -5707,8 +5733,8 @@ class SQLite { late final _sqlite3_get_auxdataPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_get_auxdata'); + ffi.Pointer Function(ffi.Pointer, + pkg_ffi.Int)>>('sqlite3_get_auxdata'); late final _sqlite3_get_auxdata = _sqlite3_get_auxdataPtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -5731,7 +5757,7 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< @@ -5909,7 +5935,7 @@ class SQLite { ffi.Void Function( ffi.Pointer, ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -5974,7 +6000,7 @@ class SQLite { void sqlite3_result_error( ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, int arg2, ) { return _sqlite3_result_error( @@ -5986,11 +6012,11 @@ class SQLite { late final _sqlite3_result_errorPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('sqlite3_result_error'); + ffi.Void Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Int)>>('sqlite3_result_error'); late final _sqlite3_result_error = _sqlite3_result_errorPtr.asFunction< void Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer, ffi.Pointer, int)>(); void sqlite3_result_error16( ffi.Pointer arg0, @@ -6007,7 +6033,7 @@ class SQLite { late final _sqlite3_result_error16Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('sqlite3_result_error16'); + pkg_ffi.Int)>>('sqlite3_result_error16'); late final _sqlite3_result_error16 = _sqlite3_result_error16Ptr.asFunction< void Function( ffi.Pointer, ffi.Pointer, int)>(); @@ -6053,7 +6079,7 @@ class SQLite { late final _sqlite3_result_error_codePtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - ffi.Int32)>>('sqlite3_result_error_code'); + pkg_ffi.Int)>>('sqlite3_result_error_code'); late final _sqlite3_result_error_code = _sqlite3_result_error_codePtr .asFunction, int)>(); @@ -6069,8 +6095,8 @@ class SQLite { late final _sqlite3_result_intPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_result_int'); + ffi.Void Function(ffi.Pointer, + pkg_ffi.Int)>>('sqlite3_result_int'); late final _sqlite3_result_int = _sqlite3_result_intPtr .asFunction, int)>(); @@ -6107,7 +6133,7 @@ class SQLite { void sqlite3_result_text( ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, int arg2, ffi.Pointer)>> arg3, @@ -6124,8 +6150,8 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Int32, + ffi.Pointer, + pkg_ffi.Int, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -6133,14 +6159,14 @@ class SQLite { late final _sqlite3_result_text = _sqlite3_result_textPtr.asFunction< void Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, ffi.Pointer< ffi.NativeFunction)>>)>(); void sqlite3_result_text64( ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, int arg2, ffi.Pointer)>> arg3, @@ -6159,15 +6185,15 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, sqlite3_uint64, ffi.Pointer< ffi.NativeFunction)>>, - ffi.Uint8)>>('sqlite3_result_text64'); + pkg_ffi.UnsignedChar)>>('sqlite3_result_text64'); late final _sqlite3_result_text64 = _sqlite3_result_text64Ptr.asFunction< void Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, ffi.Pointer< ffi.NativeFunction)>>, @@ -6193,7 +6219,7 @@ class SQLite { ffi.Void Function( ffi.Pointer, ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -6226,7 +6252,7 @@ class SQLite { ffi.Void Function( ffi.Pointer, ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer)>>)>>( @@ -6259,7 +6285,7 @@ class SQLite { ffi.Void Function( ffi.Pointer, ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer)>>)>>( @@ -6293,7 +6319,7 @@ class SQLite { void sqlite3_result_pointer( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg2, ffi.Pointer)>> arg3, ) { @@ -6310,7 +6336,7 @@ class SQLite { ffi.Void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -6319,7 +6345,7 @@ class SQLite { void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer< ffi.NativeFunction)>>)>(); @@ -6336,7 +6362,7 @@ class SQLite { late final _sqlite3_result_zeroblobPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - ffi.Int32)>>('sqlite3_result_zeroblob'); + pkg_ffi.Int)>>('sqlite3_result_zeroblob'); late final _sqlite3_result_zeroblob = _sqlite3_result_zeroblobPtr .asFunction, int)>(); @@ -6352,7 +6378,7 @@ class SQLite { late final _sqlite3_result_zeroblob64Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, + pkg_ffi.Int Function(ffi.Pointer, sqlite3_uint64)>>('sqlite3_result_zeroblob64'); late final _sqlite3_result_zeroblob64 = _sqlite3_result_zeroblob64Ptr .asFunction, int)>(); @@ -6380,7 +6406,7 @@ class SQLite { late final _sqlite3_result_subtypePtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - ffi.Uint32)>>('sqlite3_result_subtype'); + pkg_ffi.UnsignedInt)>>('sqlite3_result_subtype'); late final _sqlite3_result_subtype = _sqlite3_result_subtypePtr .asFunction, int)>(); @@ -6465,13 +6491,13 @@ class SQLite { /// See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()]. int sqlite3_create_collation( ffi.Pointer arg0, - ffi.Pointer zName, + ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32, - ffi.Pointer, ffi.Int32, ffi.Pointer)>> + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, + ffi.Pointer, pkg_ffi.Int, ffi.Pointer)>> xCompare, ) { return _sqlite3_create_collation( @@ -6485,45 +6511,45 @@ class SQLite { late final _sqlite3_create_collationPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Pointer, - ffi.Int32, + ffi.Pointer, + pkg_ffi.Int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer)>>)>>( 'sqlite3_create_collation'); late final _sqlite3_create_collation = _sqlite3_create_collationPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer)>>)>(); int sqlite3_create_collation_v2( ffi.Pointer arg0, - ffi.Pointer zName, + ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32, - ffi.Pointer, ffi.Int32, ffi.Pointer)>> + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, + ffi.Pointer, pkg_ffi.Int, ffi.Pointer)>> xCompare, ffi.Pointer)>> xDestroy, @@ -6540,18 +6566,18 @@ class SQLite { late final _sqlite3_create_collation_v2Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Pointer, - ffi.Int32, + ffi.Pointer, + pkg_ffi.Int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer)>>, ffi.Pointer< ffi.NativeFunction< @@ -6561,16 +6587,16 @@ class SQLite { _sqlite3_create_collation_v2Ptr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer)>>, ffi.Pointer< ffi.NativeFunction< @@ -6583,8 +6609,8 @@ class SQLite { ffi.Pointer pArg, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32, - ffi.Pointer, ffi.Int32, ffi.Pointer)>> + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, + ffi.Pointer, pkg_ffi.Int, ffi.Pointer)>> xCompare, ) { return _sqlite3_create_collation16( @@ -6598,18 +6624,18 @@ class SQLite { late final _sqlite3_create_collation16Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer)>>)>>( 'sqlite3_create_collation16'); late final _sqlite3_create_collation16 = @@ -6621,11 +6647,11 @@ class SQLite { ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer)>>)>(); /// CAPI3REF: Collation Needed Callbacks @@ -6659,7 +6685,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>> + pkg_ffi.Int, ffi.Pointer)>> arg2, ) { return _sqlite3_collation_needed( @@ -6671,7 +6697,7 @@ class SQLite { late final _sqlite3_collation_neededPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, ffi.Pointer, ffi.Pointer< @@ -6679,8 +6705,8 @@ class SQLite { ffi.Void Function( ffi.Pointer, ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>)>>( + pkg_ffi.Int, + ffi.Pointer)>>)>>( 'sqlite3_collation_needed'); late final _sqlite3_collation_needed = _sqlite3_collation_neededPtr.asFunction< @@ -6692,8 +6718,8 @@ class SQLite { ffi.Void Function( ffi.Pointer, ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>)>(); + pkg_ffi.Int, + ffi.Pointer)>>)>(); int sqlite3_collation_needed16( ffi.Pointer arg0, @@ -6701,7 +6727,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>> + pkg_ffi.Int, ffi.Pointer)>> arg2, ) { return _sqlite3_collation_needed16( @@ -6713,7 +6739,7 @@ class SQLite { late final _sqlite3_collation_needed16Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, ffi.Pointer, ffi.Pointer< @@ -6721,7 +6747,7 @@ class SQLite { ffi.Void Function( ffi.Pointer, ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer)>>)>>( 'sqlite3_collation_needed16'); late final _sqlite3_collation_needed16 = @@ -6734,7 +6760,7 @@ class SQLite { ffi.Void Function( ffi.Pointer, ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer)>>)>(); /// CAPI3REF: Suspend Execution For A Short Time @@ -6761,7 +6787,7 @@ class SQLite { } late final _sqlite3_sleepPtr = - _lookup>( + _lookup>( 'sqlite3_sleep'); late final _sqlite3_sleep = _sqlite3_sleepPtr.asFunction(); @@ -6819,13 +6845,13 @@ class SQLite { ///   NULL, NULL); /// sqlite3_temp_directory = sqlite3_mprintf("%s", zPathBuf); /// - late final ffi.Pointer> _sqlite3_temp_directory = - _lookup>('sqlite3_temp_directory'); + late final ffi.Pointer> _sqlite3_temp_directory = + _lookup>('sqlite3_temp_directory'); - ffi.Pointer get sqlite3_temp_directory => + ffi.Pointer get sqlite3_temp_directory => _sqlite3_temp_directory.value; - set sqlite3_temp_directory(ffi.Pointer value) => + set sqlite3_temp_directory(ffi.Pointer value) => _sqlite3_temp_directory.value = value; /// CAPI3REF: Name Of The Folder Holding Database Files @@ -6861,13 +6887,13 @@ class SQLite { /// Hence, if this variable is modified directly, either it should be /// made NULL or made to point to memory obtained from [sqlite3_malloc] /// or else the use of the [data_store_directory pragma] should be avoided. - late final ffi.Pointer> _sqlite3_data_directory = - _lookup>('sqlite3_data_directory'); + late final ffi.Pointer> _sqlite3_data_directory = + _lookup>('sqlite3_data_directory'); - ffi.Pointer get sqlite3_data_directory => + ffi.Pointer get sqlite3_data_directory => _sqlite3_data_directory.value; - set sqlite3_data_directory(ffi.Pointer value) => + set sqlite3_data_directory(ffi.Pointer value) => _sqlite3_data_directory.value = value; /// CAPI3REF: Win32 Specific Interface @@ -6899,14 +6925,14 @@ class SQLite { late final _sqlite3_win32_set_directoryPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Uint64, + pkg_ffi.Int Function(pkg_ffi.UnsignedLong, ffi.Pointer)>>('sqlite3_win32_set_directory'); late final _sqlite3_win32_set_directory = _sqlite3_win32_set_directoryPtr .asFunction)>(); int sqlite3_win32_set_directory8( int type, - ffi.Pointer zValue, + ffi.Pointer zValue, ) { return _sqlite3_win32_set_directory8( type, @@ -6916,10 +6942,10 @@ class SQLite { late final _sqlite3_win32_set_directory8Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Uint64, - ffi.Pointer)>>('sqlite3_win32_set_directory8'); + pkg_ffi.Int Function(pkg_ffi.UnsignedLong, + ffi.Pointer)>>('sqlite3_win32_set_directory8'); late final _sqlite3_win32_set_directory8 = _sqlite3_win32_set_directory8Ptr - .asFunction)>(); + .asFunction)>(); int sqlite3_win32_set_directory16( int type, @@ -6933,7 +6959,7 @@ class SQLite { late final _sqlite3_win32_set_directory16Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Uint64, + pkg_ffi.Int Function(pkg_ffi.UnsignedLong, ffi.Pointer)>>('sqlite3_win32_set_directory16'); late final _sqlite3_win32_set_directory16 = _sqlite3_win32_set_directory16Ptr .asFunction)>(); @@ -6967,7 +6993,7 @@ class SQLite { } late final _sqlite3_get_autocommitPtr = - _lookup)>>( + _lookup)>>( 'sqlite3_get_autocommit'); late final _sqlite3_get_autocommit = _sqlite3_get_autocommitPtr .asFunction)>(); @@ -7024,9 +7050,9 @@ class SQLite { ///
  • [sqlite3_filename_journal()] ///
  • [sqlite3_filename_wal()] /// - ffi.Pointer sqlite3_db_filename( + ffi.Pointer sqlite3_db_filename( ffi.Pointer db, - ffi.Pointer zDbName, + ffi.Pointer zDbName, ) { return _sqlite3_db_filename( db, @@ -7036,11 +7062,11 @@ class SQLite { late final _sqlite3_db_filenamePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_db_filename'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_db_filename'); late final _sqlite3_db_filename = _sqlite3_db_filenamePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Determine if a database is read-only /// METHOD: sqlite3 @@ -7050,7 +7076,7 @@ class SQLite { /// the name of a database on connection D. int sqlite3_db_readonly( ffi.Pointer db, - ffi.Pointer zDbName, + ffi.Pointer zDbName, ) { return _sqlite3_db_readonly( db, @@ -7060,10 +7086,10 @@ class SQLite { late final _sqlite3_db_readonlyPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_db_readonly'); - late final _sqlite3_db_readonly = _sqlite3_db_readonlyPtr - .asFunction, ffi.Pointer)>(); + pkg_ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_db_readonly'); + late final _sqlite3_db_readonly = _sqlite3_db_readonlyPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Find the next prepared statement /// METHOD: sqlite3 @@ -7142,7 +7168,7 @@ class SQLite { /// See also the [sqlite3_update_hook()] interface. ffi.Pointer sqlite3_commit_hook( ffi.Pointer arg0, - ffi.Pointer)>> + ffi.Pointer)>> arg1, ffi.Pointer arg2, ) { @@ -7159,13 +7185,13 @@ class SQLite { ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer)>>, + pkg_ffi.Int Function(ffi.Pointer)>>, ffi.Pointer)>>('sqlite3_commit_hook'); late final _sqlite3_commit_hook = _sqlite3_commit_hookPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer< - ffi.NativeFunction)>>, + ffi.NativeFunction)>>, ffi.Pointer)>(); ffi.Pointer sqlite3_rollback_hook( @@ -7248,9 +7274,9 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, + pkg_ffi.Int, + ffi.Pointer, + ffi.Pointer, sqlite3_int64)>> arg1, ffi.Pointer arg2, @@ -7270,9 +7296,9 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, + pkg_ffi.Int, + ffi.Pointer, + ffi.Pointer, sqlite3_int64)>>, ffi.Pointer)>>('sqlite3_update_hook'); late final _sqlite3_update_hook = _sqlite3_update_hookPtr.asFunction< @@ -7282,9 +7308,9 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, + pkg_ffi.Int, + ffi.Pointer, + ffi.Pointer, sqlite3_int64)>>, ffi.Pointer)>(); @@ -7334,7 +7360,7 @@ class SQLite { } late final _sqlite3_enable_shared_cachePtr = - _lookup>( + _lookup>( 'sqlite3_enable_shared_cache'); late final _sqlite3_enable_shared_cache = _sqlite3_enable_shared_cachePtr.asFunction(); @@ -7360,7 +7386,7 @@ class SQLite { } late final _sqlite3_release_memoryPtr = - _lookup>( + _lookup>( 'sqlite3_release_memory'); late final _sqlite3_release_memory = _sqlite3_release_memoryPtr.asFunction(); @@ -7384,7 +7410,7 @@ class SQLite { } late final _sqlite3_db_release_memoryPtr = - _lookup)>>( + _lookup)>>( 'sqlite3_db_release_memory'); late final _sqlite3_db_release_memory = _sqlite3_db_release_memoryPtr .asFunction)>(); @@ -7495,7 +7521,7 @@ class SQLite { } late final _sqlite3_soft_heap_limitPtr = - _lookup>( + _lookup>( 'sqlite3_soft_heap_limit'); late final _sqlite3_soft_heap_limit = _sqlite3_soft_heap_limitPtr.asFunction(); @@ -7569,14 +7595,14 @@ class SQLite { /// any errors are encountered while loading the schema. int sqlite3_table_column_metadata( ffi.Pointer db, - ffi.Pointer zDbName, - ffi.Pointer zTableName, - ffi.Pointer zColumnName, - ffi.Pointer> pzDataType, - ffi.Pointer> pzCollSeq, - ffi.Pointer pNotNull, - ffi.Pointer pPrimaryKey, - ffi.Pointer pAutoinc, + ffi.Pointer zDbName, + ffi.Pointer zTableName, + ffi.Pointer zColumnName, + ffi.Pointer> pzDataType, + ffi.Pointer> pzCollSeq, + ffi.Pointer pNotNull, + ffi.Pointer pPrimaryKey, + ffi.Pointer pAutoinc, ) { return _sqlite3_table_column_metadata( db, @@ -7593,28 +7619,28 @@ class SQLite { late final _sqlite3_table_column_metadataPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('sqlite3_table_column_metadata'); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('sqlite3_table_column_metadata'); late final _sqlite3_table_column_metadata = _sqlite3_table_column_metadataPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// CAPI3REF: Load An Extension /// METHOD: sqlite3 @@ -7660,9 +7686,9 @@ class SQLite { /// See also the [load_extension() SQL function]. int sqlite3_load_extension( ffi.Pointer db, - ffi.Pointer zFile, - ffi.Pointer zProc, - ffi.Pointer> pzErrMsg, + ffi.Pointer zFile, + ffi.Pointer zProc, + ffi.Pointer> pzErrMsg, ) { return _sqlite3_load_extension( db, @@ -7673,15 +7699,16 @@ class SQLite { } late final _sqlite3_load_extensionPtr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('sqlite3_load_extension'); + ffi.NativeFunction< + pkg_ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>( + 'sqlite3_load_extension'); late final _sqlite3_load_extension = _sqlite3_load_extensionPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer>)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); /// CAPI3REF: Enable Or Disable Extension Loading /// METHOD: sqlite3 @@ -7718,8 +7745,8 @@ class SQLite { late final _sqlite3_enable_load_extensionPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, - ffi.Int32)>>('sqlite3_enable_load_extension'); + pkg_ffi.Int Function(ffi.Pointer, + pkg_ffi.Int)>>('sqlite3_enable_load_extension'); late final _sqlite3_enable_load_extension = _sqlite3_enable_load_extensionPtr .asFunction, int)>(); @@ -7767,7 +7794,7 @@ class SQLite { late final _sqlite3_auto_extensionPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer>)>>( 'sqlite3_auto_extension'); late final _sqlite3_auto_extension = _sqlite3_auto_extensionPtr.asFunction< @@ -7791,7 +7818,7 @@ class SQLite { late final _sqlite3_cancel_auto_extensionPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer>)>>( 'sqlite3_cancel_auto_extension'); late final _sqlite3_cancel_auto_extension = @@ -7844,7 +7871,7 @@ class SQLite { /// See also: [sqlite3_drop_modules()] int sqlite3_create_module( ffi.Pointer db, - ffi.Pointer zName, + ffi.Pointer zName, ffi.Pointer p, ffi.Pointer pClientData, ) { @@ -7858,18 +7885,18 @@ class SQLite { late final _sqlite3_create_modulePtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('sqlite3_create_module'); late final _sqlite3_create_module = _sqlite3_create_modulePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, + int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); int sqlite3_create_module_v2( ffi.Pointer db, - ffi.Pointer zName, + ffi.Pointer zName, ffi.Pointer p, ffi.Pointer pClientData, ffi.Pointer)>> @@ -7886,9 +7913,9 @@ class SQLite { late final _sqlite3_create_module_v2Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer< @@ -7899,7 +7926,7 @@ class SQLite { _sqlite3_create_module_v2Ptr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer< @@ -7918,7 +7945,7 @@ class SQLite { /// See also: [sqlite3_create_module()] int sqlite3_drop_modules( ffi.Pointer db, - ffi.Pointer> azKeep, + ffi.Pointer> azKeep, ) { return _sqlite3_drop_modules( db, @@ -7928,10 +7955,11 @@ class SQLite { late final _sqlite3_drop_modulesPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, - ffi.Pointer>)>>('sqlite3_drop_modules'); + pkg_ffi.Int Function(ffi.Pointer, + ffi.Pointer>)>>('sqlite3_drop_modules'); late final _sqlite3_drop_modules = _sqlite3_drop_modulesPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer>)>(); + int Function( + ffi.Pointer, ffi.Pointer>)>(); /// CAPI3REF: Declare The Schema Of A Virtual Table /// @@ -7941,7 +7969,7 @@ class SQLite { /// the virtual tables they implement. int sqlite3_declare_vtab( ffi.Pointer arg0, - ffi.Pointer zSQL, + ffi.Pointer zSQL, ) { return _sqlite3_declare_vtab( arg0, @@ -7951,10 +7979,10 @@ class SQLite { late final _sqlite3_declare_vtabPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_declare_vtab'); - late final _sqlite3_declare_vtab = _sqlite3_declare_vtabPtr - .asFunction, ffi.Pointer)>(); + pkg_ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_declare_vtab'); + late final _sqlite3_declare_vtab = _sqlite3_declare_vtabPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Overload A Function For A Virtual Table /// METHOD: sqlite3 @@ -7973,7 +8001,7 @@ class SQLite { /// by a [virtual table]. int sqlite3_overload_function( ffi.Pointer arg0, - ffi.Pointer zFuncName, + ffi.Pointer zFuncName, int nArg, ) { return _sqlite3_overload_function( @@ -7985,11 +8013,11 @@ class SQLite { late final _sqlite3_overload_functionPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('sqlite3_overload_function'); + pkg_ffi.Int Function(ffi.Pointer, ffi.Pointer, + pkg_ffi.Int)>>('sqlite3_overload_function'); late final _sqlite3_overload_function = _sqlite3_overload_functionPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); /// CAPI3REF: Open A BLOB For Incremental I/O /// METHOD: sqlite3 @@ -8074,9 +8102,9 @@ class SQLite { /// [sqlite3_blob_bytes()], [sqlite3_blob_write()]. int sqlite3_blob_open( ffi.Pointer arg0, - ffi.Pointer zDb, - ffi.Pointer zTable, - ffi.Pointer zColumn, + ffi.Pointer zDb, + ffi.Pointer zTable, + ffi.Pointer zColumn, int iRow, int flags, ffi.Pointer> ppBlob, @@ -8094,20 +8122,20 @@ class SQLite { late final _sqlite3_blob_openPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, sqlite3_int64, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer>)>>('sqlite3_blob_open'); late final _sqlite3_blob_open = _sqlite3_blob_openPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer>)>(); @@ -8145,7 +8173,7 @@ class SQLite { late final _sqlite3_blob_reopenPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, + pkg_ffi.Int Function(ffi.Pointer, sqlite3_int64)>>('sqlite3_blob_reopen'); late final _sqlite3_blob_reopen = _sqlite3_blob_reopenPtr .asFunction, int)>(); @@ -8178,7 +8206,7 @@ class SQLite { } late final _sqlite3_blob_closePtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_blob_close'); late final _sqlite3_blob_close = _sqlite3_blob_closePtr .asFunction)>(); @@ -8204,7 +8232,7 @@ class SQLite { } late final _sqlite3_blob_bytesPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_blob_bytes'); late final _sqlite3_blob_bytes = _sqlite3_blob_bytesPtr .asFunction)>(); @@ -8250,8 +8278,8 @@ class SQLite { late final _sqlite3_blob_readPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Int32)>>('sqlite3_blob_read'); + pkg_ffi.Int Function(ffi.Pointer, ffi.Pointer, + pkg_ffi.Int, pkg_ffi.Int)>>('sqlite3_blob_read'); late final _sqlite3_blob_read = _sqlite3_blob_readPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, int, int)>(); @@ -8310,8 +8338,8 @@ class SQLite { late final _sqlite3_blob_writePtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Int32)>>('sqlite3_blob_write'); + pkg_ffi.Int Function(ffi.Pointer, ffi.Pointer, + pkg_ffi.Int, pkg_ffi.Int)>>('sqlite3_blob_write'); late final _sqlite3_blob_write = _sqlite3_blob_writePtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, int, int)>(); @@ -8344,7 +8372,7 @@ class SQLite { /// ^(If the default VFS is unregistered, another VFS is chosen as /// the default. The choice for the new VFS is arbitrary.)^ ffi.Pointer sqlite3_vfs_find( - ffi.Pointer zVfsName, + ffi.Pointer zVfsName, ) { return _sqlite3_vfs_find( zVfsName, @@ -8354,9 +8382,9 @@ class SQLite { late final _sqlite3_vfs_findPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer)>>('sqlite3_vfs_find'); - late final _sqlite3_vfs_find = _sqlite3_vfs_findPtr - .asFunction Function(ffi.Pointer)>(); + ffi.Pointer)>>('sqlite3_vfs_find'); + late final _sqlite3_vfs_find = _sqlite3_vfs_findPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); int sqlite3_vfs_register( ffi.Pointer arg0, @@ -8370,8 +8398,8 @@ class SQLite { late final _sqlite3_vfs_registerPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_vfs_register'); + pkg_ffi.Int Function( + ffi.Pointer, pkg_ffi.Int)>>('sqlite3_vfs_register'); late final _sqlite3_vfs_register = _sqlite3_vfs_registerPtr .asFunction, int)>(); @@ -8383,9 +8411,9 @@ class SQLite { ); } - late final _sqlite3_vfs_unregisterPtr = - _lookup)>>( - 'sqlite3_vfs_unregister'); + late final _sqlite3_vfs_unregisterPtr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_vfs_unregister'); late final _sqlite3_vfs_unregister = _sqlite3_vfs_unregisterPtr .asFunction)>(); @@ -8510,7 +8538,7 @@ class SQLite { } late final _sqlite3_mutex_allocPtr = _lookup< - ffi.NativeFunction Function(ffi.Int32)>>( + ffi.NativeFunction Function(pkg_ffi.Int)>>( 'sqlite3_mutex_alloc'); late final _sqlite3_mutex_alloc = _sqlite3_mutex_allocPtr .asFunction Function(int)>(); @@ -8552,7 +8580,7 @@ class SQLite { } late final _sqlite3_mutex_tryPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_mutex_try'); late final _sqlite3_mutex_try = _sqlite3_mutex_tryPtr .asFunction)>(); @@ -8580,7 +8608,7 @@ class SQLite { } late final _sqlite3_mutex_heldPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_mutex_held'); late final _sqlite3_mutex_held = _sqlite3_mutex_heldPtr .asFunction)>(); @@ -8594,7 +8622,7 @@ class SQLite { } late final _sqlite3_mutex_notheldPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'sqlite3_mutex_notheld'); late final _sqlite3_mutex_notheld = _sqlite3_mutex_notheldPtr .asFunction)>(); @@ -8663,7 +8691,7 @@ class SQLite { /// See also: [file control opcodes] int sqlite3_file_control( ffi.Pointer arg0, - ffi.Pointer zDbName, + ffi.Pointer zDbName, int op, ffi.Pointer arg3, ) { @@ -8677,10 +8705,10 @@ class SQLite { late final _sqlite3_file_controlPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>>('sqlite3_file_control'); + pkg_ffi.Int Function(ffi.Pointer, ffi.Pointer, + pkg_ffi.Int, ffi.Pointer)>>('sqlite3_file_control'); late final _sqlite3_file_control = _sqlite3_file_controlPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, + int Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); /// CAPI3REF: Testing Interface @@ -8707,7 +8735,7 @@ class SQLite { } late final _sqlite3_test_controlPtr = - _lookup>( + _lookup>( 'sqlite3_test_control'); late final _sqlite3_test_control = _sqlite3_test_controlPtr.asFunction(); @@ -8762,15 +8790,15 @@ class SQLite { } late final _sqlite3_keyword_countPtr = - _lookup>( + _lookup>( 'sqlite3_keyword_count'); late final _sqlite3_keyword_count = _sqlite3_keyword_countPtr.asFunction(); int sqlite3_keyword_name( int arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, + ffi.Pointer> arg1, + ffi.Pointer arg2, ) { return _sqlite3_keyword_name( arg0, @@ -8781,14 +8809,16 @@ class SQLite { late final _sqlite3_keyword_namePtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Int32, ffi.Pointer>, - ffi.Pointer)>>('sqlite3_keyword_name'); + pkg_ffi.Int Function( + pkg_ffi.Int, + ffi.Pointer>, + ffi.Pointer)>>('sqlite3_keyword_name'); late final _sqlite3_keyword_name = _sqlite3_keyword_namePtr.asFunction< - int Function( - int, ffi.Pointer>, ffi.Pointer)>(); + int Function(int, ffi.Pointer>, + ffi.Pointer)>(); int sqlite3_keyword_check( - ffi.Pointer arg0, + ffi.Pointer arg0, int arg1, ) { return _sqlite3_keyword_check( @@ -8799,10 +8829,10 @@ class SQLite { late final _sqlite3_keyword_checkPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_keyword_check'); + pkg_ffi.Int Function(ffi.Pointer, + pkg_ffi.Int)>>('sqlite3_keyword_check'); late final _sqlite3_keyword_check = _sqlite3_keyword_checkPtr - .asFunction, int)>(); + .asFunction, int)>(); /// CAPI3REF: Create A New Dynamic String Object /// CONSTRUCTOR: sqlite3_str @@ -8853,7 +8883,7 @@ class SQLite { /// errors were encountered during construction of the string. ^The /// [sqlite3_str_finish(X)] interface will also return a NULL pointer if the /// string in [sqlite3_str] object X is zero bytes long. - ffi.Pointer sqlite3_str_finish( + ffi.Pointer sqlite3_str_finish( ffi.Pointer arg0, ) { return _sqlite3_str_finish( @@ -8863,10 +8893,10 @@ class SQLite { late final _sqlite3_str_finishPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('sqlite3_str_finish'); - late final _sqlite3_str_finish = _sqlite3_str_finishPtr - .asFunction Function(ffi.Pointer)>(); + late final _sqlite3_str_finish = _sqlite3_str_finishPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); /// CAPI3REF: Add Content To A Dynamic String /// METHOD: sqlite3_str @@ -8900,7 +8930,7 @@ class SQLite { /// subsequent call to [sqlite3_str_errcode(X)]. void sqlite3_str_appendf( ffi.Pointer arg0, - ffi.Pointer zFormat, + ffi.Pointer zFormat, ) { return _sqlite3_str_appendf( arg0, @@ -8911,13 +8941,13 @@ class SQLite { late final _sqlite3_str_appendfPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_str_appendf'); + ffi.Pointer)>>('sqlite3_str_appendf'); late final _sqlite3_str_appendf = _sqlite3_str_appendfPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer)>(); void sqlite3_str_append( ffi.Pointer arg0, - ffi.Pointer zIn, + ffi.Pointer zIn, int N, ) { return _sqlite3_str_append( @@ -8929,14 +8959,15 @@ class SQLite { late final _sqlite3_str_appendPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('sqlite3_str_append'); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + pkg_ffi.Int)>>('sqlite3_str_append'); late final _sqlite3_str_append = _sqlite3_str_appendPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + void Function( + ffi.Pointer, ffi.Pointer, int)>(); void sqlite3_str_appendall( ffi.Pointer arg0, - ffi.Pointer zIn, + ffi.Pointer zIn, ) { return _sqlite3_str_appendall( arg0, @@ -8947,9 +8978,9 @@ class SQLite { late final _sqlite3_str_appendallPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_str_appendall'); + ffi.Pointer)>>('sqlite3_str_appendall'); late final _sqlite3_str_appendall = _sqlite3_str_appendallPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer)>(); void sqlite3_str_appendchar( ffi.Pointer arg0, @@ -8965,8 +8996,8 @@ class SQLite { late final _sqlite3_str_appendcharPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32, - ffi.Int8)>>('sqlite3_str_appendchar'); + ffi.Void Function(ffi.Pointer, pkg_ffi.Int, + pkg_ffi.Char)>>('sqlite3_str_appendchar'); late final _sqlite3_str_appendchar = _sqlite3_str_appendcharPtr .asFunction, int, int)>(); @@ -9019,9 +9050,9 @@ class SQLite { ); } - late final _sqlite3_str_errcodePtr = - _lookup)>>( - 'sqlite3_str_errcode'); + late final _sqlite3_str_errcodePtr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_str_errcode'); late final _sqlite3_str_errcode = _sqlite3_str_errcodePtr .asFunction)>(); @@ -9033,13 +9064,13 @@ class SQLite { ); } - late final _sqlite3_str_lengthPtr = - _lookup)>>( - 'sqlite3_str_length'); + late final _sqlite3_str_lengthPtr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_str_length'); late final _sqlite3_str_length = _sqlite3_str_lengthPtr .asFunction)>(); - ffi.Pointer sqlite3_str_value( + ffi.Pointer sqlite3_str_value( ffi.Pointer arg0, ) { return _sqlite3_str_value( @@ -9049,10 +9080,10 @@ class SQLite { late final _sqlite3_str_valuePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('sqlite3_str_value'); - late final _sqlite3_str_value = _sqlite3_str_valuePtr - .asFunction Function(ffi.Pointer)>(); + late final _sqlite3_str_value = _sqlite3_str_valuePtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); /// CAPI3REF: SQLite Runtime Status /// @@ -9080,8 +9111,8 @@ class SQLite { /// See also: [sqlite3_db_status()] int sqlite3_status( int op, - ffi.Pointer pCurrent, - ffi.Pointer pHighwater, + ffi.Pointer pCurrent, + ffi.Pointer pHighwater, int resetFlag, ) { return _sqlite3_status( @@ -9094,10 +9125,11 @@ class SQLite { late final _sqlite3_statusPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Int32, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('sqlite3_status'); + pkg_ffi.Int Function(pkg_ffi.Int, ffi.Pointer, + ffi.Pointer, pkg_ffi.Int)>>('sqlite3_status'); late final _sqlite3_status = _sqlite3_statusPtr.asFunction< - int Function(int, ffi.Pointer, ffi.Pointer, int)>(); + int Function( + int, ffi.Pointer, ffi.Pointer, int)>(); int sqlite3_status64( int op, @@ -9115,8 +9147,8 @@ class SQLite { late final _sqlite3_status64Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Int32, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('sqlite3_status64'); + pkg_ffi.Int Function(pkg_ffi.Int, ffi.Pointer, + ffi.Pointer, pkg_ffi.Int)>>('sqlite3_status64'); late final _sqlite3_status64 = _sqlite3_status64Ptr.asFunction< int Function( int, ffi.Pointer, ffi.Pointer, int)>(); @@ -9145,8 +9177,8 @@ class SQLite { int sqlite3_db_status( ffi.Pointer arg0, int op, - ffi.Pointer pCur, - ffi.Pointer pHiwtr, + ffi.Pointer pCur, + ffi.Pointer pHiwtr, int resetFlg, ) { return _sqlite3_db_status( @@ -9160,15 +9192,15 @@ class SQLite { late final _sqlite3_db_statusPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>('sqlite3_db_status'); + pkg_ffi.Int, + ffi.Pointer, + ffi.Pointer, + pkg_ffi.Int)>>('sqlite3_db_status'); late final _sqlite3_db_status = _sqlite3_db_statusPtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer, - ffi.Pointer, int)>(); + int Function(ffi.Pointer, int, ffi.Pointer, + ffi.Pointer, int)>(); /// CAPI3REF: Prepared Statement Status /// METHOD: sqlite3_stmt @@ -9206,8 +9238,8 @@ class SQLite { late final _sqlite3_stmt_statusPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32, - ffi.Int32)>>('sqlite3_stmt_status'); + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, + pkg_ffi.Int)>>('sqlite3_stmt_status'); late final _sqlite3_stmt_status = _sqlite3_stmt_statusPtr .asFunction, int, int)>(); @@ -9397,9 +9429,9 @@ class SQLite { /// possible that they return invalid values. ffi.Pointer sqlite3_backup_init( ffi.Pointer pDest, - ffi.Pointer zDestName, + ffi.Pointer zDestName, ffi.Pointer pSource, - ffi.Pointer zSourceName, + ffi.Pointer zSourceName, ) { return _sqlite3_backup_init( pDest, @@ -9413,15 +9445,15 @@ class SQLite { ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('sqlite3_backup_init'); + ffi.Pointer)>>('sqlite3_backup_init'); late final _sqlite3_backup_init = _sqlite3_backup_initPtr.asFunction< ffi.Pointer Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); int sqlite3_backup_step( ffi.Pointer p, @@ -9435,8 +9467,8 @@ class SQLite { late final _sqlite3_backup_stepPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_backup_step'); + pkg_ffi.Int Function(ffi.Pointer, + pkg_ffi.Int)>>('sqlite3_backup_step'); late final _sqlite3_backup_step = _sqlite3_backup_stepPtr .asFunction, int)>(); @@ -9449,8 +9481,9 @@ class SQLite { } late final _sqlite3_backup_finishPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_backup_finish'); + ffi.NativeFunction< + pkg_ffi.Int Function( + ffi.Pointer)>>('sqlite3_backup_finish'); late final _sqlite3_backup_finish = _sqlite3_backup_finishPtr .asFunction)>(); @@ -9463,8 +9496,9 @@ class SQLite { } late final _sqlite3_backup_remainingPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_backup_remaining'); + ffi.NativeFunction< + pkg_ffi.Int Function( + ffi.Pointer)>>('sqlite3_backup_remaining'); late final _sqlite3_backup_remaining = _sqlite3_backup_remainingPtr .asFunction)>(); @@ -9477,8 +9511,9 @@ class SQLite { } late final _sqlite3_backup_pagecountPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_backup_pagecount'); + ffi.NativeFunction< + pkg_ffi.Int Function( + ffi.Pointer)>>('sqlite3_backup_pagecount'); late final _sqlite3_backup_pagecount = _sqlite3_backup_pagecountPtr .asFunction)>(); @@ -9600,7 +9635,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer>, ffi.Int32)>> + ffi.Pointer>, pkg_ffi.Int)>> xNotify, ffi.Pointer pNotifyArg, ) { @@ -9613,12 +9648,12 @@ class SQLite { late final _sqlite3_unlock_notifyPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer>, ffi.Int32)>>, + ffi.Pointer>, pkg_ffi.Int)>>, ffi.Pointer)>>('sqlite3_unlock_notify'); late final _sqlite3_unlock_notify = _sqlite3_unlock_notifyPtr.asFunction< int Function( @@ -9626,7 +9661,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer>, ffi.Int32)>>, + ffi.Pointer>, pkg_ffi.Int)>>, ffi.Pointer)>(); /// CAPI3REF: String Comparison @@ -9636,8 +9671,8 @@ class SQLite { /// strings in a case-independent fashion, using the same definition of "case /// independence" that SQLite uses internally when comparing identifiers. int sqlite3_stricmp( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, ) { return _sqlite3_stricmp( arg0, @@ -9647,14 +9682,14 @@ class SQLite { late final _sqlite3_stricmpPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_stricmp'); - late final _sqlite3_stricmp = _sqlite3_stricmpPtr - .asFunction, ffi.Pointer)>(); + pkg_ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_stricmp'); + late final _sqlite3_stricmp = _sqlite3_stricmpPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); int sqlite3_strnicmp( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, int arg2, ) { return _sqlite3_strnicmp( @@ -9666,10 +9701,11 @@ class SQLite { late final _sqlite3_strnicmpPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('sqlite3_strnicmp'); + pkg_ffi.Int Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Int)>>('sqlite3_strnicmp'); late final _sqlite3_strnicmp = _sqlite3_strnicmpPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function( + ffi.Pointer, ffi.Pointer, int)>(); /// CAPI3REF: String Globbing /// @@ -9685,8 +9721,8 @@ class SQLite { /// /// See also: [sqlite3_strlike()]. int sqlite3_strglob( - ffi.Pointer zGlob, - ffi.Pointer zStr, + ffi.Pointer zGlob, + ffi.Pointer zStr, ) { return _sqlite3_strglob( zGlob, @@ -9696,10 +9732,10 @@ class SQLite { late final _sqlite3_strglobPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_strglob'); - late final _sqlite3_strglob = _sqlite3_strglobPtr - .asFunction, ffi.Pointer)>(); + pkg_ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_strglob'); + late final _sqlite3_strglob = _sqlite3_strglobPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: String LIKE Matching /// @@ -9721,8 +9757,8 @@ class SQLite { /// /// See also: [sqlite3_strglob()]. int sqlite3_strlike( - ffi.Pointer zGlob, - ffi.Pointer zStr, + ffi.Pointer zGlob, + ffi.Pointer zStr, int cEsc, ) { return _sqlite3_strlike( @@ -9734,10 +9770,13 @@ class SQLite { late final _sqlite3_strlikePtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Uint32)>>('sqlite3_strlike'); + pkg_ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + pkg_ffi.UnsignedInt)>>('sqlite3_strlike'); late final _sqlite3_strlike = _sqlite3_strlikePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function( + ffi.Pointer, ffi.Pointer, int)>(); /// CAPI3REF: Error Logging Interface /// @@ -9760,7 +9799,7 @@ class SQLite { /// buffer. void sqlite3_log( int iErrCode, - ffi.Pointer zFormat, + ffi.Pointer zFormat, ) { return _sqlite3_log( iErrCode, @@ -9770,9 +9809,10 @@ class SQLite { late final _sqlite3_logPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int32, ffi.Pointer)>>('sqlite3_log'); - late final _sqlite3_log = - _sqlite3_logPtr.asFunction)>(); + ffi.Void Function( + pkg_ffi.Int, ffi.Pointer)>>('sqlite3_log'); + late final _sqlite3_log = _sqlite3_logPtr + .asFunction)>(); /// CAPI3REF: Write-Ahead Log Commit Hook /// METHOD: sqlite3 @@ -9810,8 +9850,11 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>> + pkg_ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + pkg_ffi.Int)>> arg1, ffi.Pointer arg2, ) { @@ -9828,19 +9871,22 @@ class SQLite { ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>, + ffi.Pointer, + pkg_ffi.Int)>>, ffi.Pointer)>>('sqlite3_wal_hook'); late final _sqlite3_wal_hook = _sqlite3_wal_hookPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, ffi.Int32)>>, + pkg_ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + pkg_ffi.Int)>>, ffi.Pointer)>(); /// CAPI3REF: Configure an auto-checkpoint @@ -9882,8 +9928,8 @@ class SQLite { late final _sqlite3_wal_autocheckpointPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_wal_autocheckpoint'); + pkg_ffi.Int Function(ffi.Pointer, + pkg_ffi.Int)>>('sqlite3_wal_autocheckpoint'); late final _sqlite3_wal_autocheckpoint = _sqlite3_wal_autocheckpointPtr .asFunction, int)>(); @@ -9907,7 +9953,7 @@ class SQLite { /// complication) of [sqlite3_wal_checkpoint_v2()]. int sqlite3_wal_checkpoint( ffi.Pointer db, - ffi.Pointer zDb, + ffi.Pointer zDb, ) { return _sqlite3_wal_checkpoint( db, @@ -9917,10 +9963,10 @@ class SQLite { late final _sqlite3_wal_checkpointPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_wal_checkpoint'); - late final _sqlite3_wal_checkpoint = _sqlite3_wal_checkpointPtr - .asFunction, ffi.Pointer)>(); + pkg_ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_wal_checkpoint'); + late final _sqlite3_wal_checkpoint = _sqlite3_wal_checkpointPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Checkpoint a database /// METHOD: sqlite3 @@ -10014,10 +10060,10 @@ class SQLite { /// from SQL. int sqlite3_wal_checkpoint_v2( ffi.Pointer db, - ffi.Pointer zDb, + ffi.Pointer zDb, int eMode, - ffi.Pointer pnLog, - ffi.Pointer pnCkpt, + ffi.Pointer pnLog, + ffi.Pointer pnCkpt, ) { return _sqlite3_wal_checkpoint_v2( db, @@ -10030,16 +10076,16 @@ class SQLite { late final _sqlite3_wal_checkpoint_v2Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer)>>('sqlite3_wal_checkpoint_v2'); + ffi.Pointer, + pkg_ffi.Int, + ffi.Pointer, + ffi.Pointer)>>('sqlite3_wal_checkpoint_v2'); late final _sqlite3_wal_checkpoint_v2 = _sqlite3_wal_checkpoint_v2Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Virtual Table Interface Configuration /// @@ -10069,8 +10115,8 @@ class SQLite { late final _sqlite3_vtab_configPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Int32)>>('sqlite3_vtab_config'); + pkg_ffi.Int Function( + ffi.Pointer, pkg_ffi.Int)>>('sqlite3_vtab_config'); late final _sqlite3_vtab_config = _sqlite3_vtab_configPtr .asFunction, int)>(); @@ -10091,7 +10137,7 @@ class SQLite { } late final _sqlite3_vtab_on_conflictPtr = - _lookup)>>( + _lookup)>>( 'sqlite3_vtab_on_conflict'); late final _sqlite3_vtab_on_conflict = _sqlite3_vtab_on_conflictPtr .asFunction)>(); @@ -10120,8 +10166,9 @@ class SQLite { } late final _sqlite3_vtab_nochangePtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_vtab_nochange'); + ffi.NativeFunction< + pkg_ffi.Int Function( + ffi.Pointer)>>('sqlite3_vtab_nochange'); late final _sqlite3_vtab_nochange = _sqlite3_vtab_nochangePtr .asFunction)>(); @@ -10136,7 +10183,7 @@ class SQLite { /// structure passed to xBestIndex. This function returns a pointer to a buffer /// containing the name of the collation sequence for the corresponding /// constraint. - ffi.Pointer sqlite3_vtab_collation( + ffi.Pointer sqlite3_vtab_collation( ffi.Pointer arg0, int arg1, ) { @@ -10148,10 +10195,11 @@ class SQLite { late final _sqlite3_vtab_collationPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Int32)>>('sqlite3_vtab_collation'); + ffi.Pointer Function(ffi.Pointer, + pkg_ffi.Int)>>('sqlite3_vtab_collation'); late final _sqlite3_vtab_collation = _sqlite3_vtab_collationPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); + ffi.Pointer Function( + ffi.Pointer, int)>(); /// CAPI3REF: Prepared Statement Scan Status /// METHOD: sqlite3_stmt @@ -10198,8 +10246,8 @@ class SQLite { late final _sqlite3_stmt_scanstatusPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32, ffi.Int32, - ffi.Pointer)>>('sqlite3_stmt_scanstatus'); + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, + pkg_ffi.Int, ffi.Pointer)>>('sqlite3_stmt_scanstatus'); late final _sqlite3_stmt_scanstatus = _sqlite3_stmt_scanstatusPtr.asFunction< int Function( ffi.Pointer, int, int, ffi.Pointer)>(); @@ -10262,7 +10310,7 @@ class SQLite { } late final _sqlite3_db_cacheflushPtr = - _lookup)>>( + _lookup)>>( 'sqlite3_db_cacheflush'); late final _sqlite3_db_cacheflush = _sqlite3_db_cacheflushPtr .asFunction)>(); @@ -10284,7 +10332,7 @@ class SQLite { } late final _sqlite3_system_errnoPtr = - _lookup)>>( + _lookup)>>( 'sqlite3_system_errno'); late final _sqlite3_system_errno = _sqlite3_system_errnoPtr.asFunction)>(); @@ -10332,7 +10380,7 @@ class SQLite { /// [SQLITE_ENABLE_SNAPSHOT] compile-time option is used. int sqlite3_snapshot_get( ffi.Pointer db, - ffi.Pointer zSchema, + ffi.Pointer zSchema, ffi.Pointer> ppSnapshot, ) { return _sqlite3_snapshot_get( @@ -10344,11 +10392,13 @@ class SQLite { late final _sqlite3_snapshot_getPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + pkg_ffi.Int Function( + ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>>( 'sqlite3_snapshot_get'); late final _sqlite3_snapshot_get = _sqlite3_snapshot_getPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, + int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer>)>(); /// CAPI3REF: Start a read transaction on an historical snapshot @@ -10394,7 +10444,7 @@ class SQLite { /// [SQLITE_ENABLE_SNAPSHOT] compile-time option is used. int sqlite3_snapshot_open( ffi.Pointer db, - ffi.Pointer zSchema, + ffi.Pointer zSchema, ffi.Pointer pSnapshot, ) { return _sqlite3_snapshot_open( @@ -10406,10 +10456,10 @@ class SQLite { late final _sqlite3_snapshot_openPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + pkg_ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('sqlite3_snapshot_open'); late final _sqlite3_snapshot_open = _sqlite3_snapshot_openPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, + int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Destroy a snapshot @@ -10470,7 +10520,7 @@ class SQLite { late final _sqlite3_snapshot_cmpPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, + pkg_ffi.Int Function(ffi.Pointer, ffi.Pointer)>>('sqlite3_snapshot_cmp'); late final _sqlite3_snapshot_cmp = _sqlite3_snapshot_cmpPtr.asFunction< int Function( @@ -10499,7 +10549,7 @@ class SQLite { /// [SQLITE_ENABLE_SNAPSHOT] option. int sqlite3_snapshot_recover( ffi.Pointer db, - ffi.Pointer zDb, + ffi.Pointer zDb, ) { return _sqlite3_snapshot_recover( db, @@ -10509,10 +10559,11 @@ class SQLite { late final _sqlite3_snapshot_recoverPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_snapshot_recover'); - late final _sqlite3_snapshot_recover = _sqlite3_snapshot_recoverPtr - .asFunction, ffi.Pointer)>(); + pkg_ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_snapshot_recover'); + late final _sqlite3_snapshot_recover = + _sqlite3_snapshot_recoverPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Serialize a database /// @@ -10548,9 +10599,9 @@ class SQLite { /// /// This interface is only available if SQLite is compiled with the /// [SQLITE_ENABLE_DESERIALIZE] option. - ffi.Pointer sqlite3_serialize( + ffi.Pointer sqlite3_serialize( ffi.Pointer db, - ffi.Pointer zSchema, + ffi.Pointer zSchema, ffi.Pointer piSize, int mFlags, ) { @@ -10564,14 +10615,14 @@ class SQLite { late final _sqlite3_serializePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Uint32)>>('sqlite3_serialize'); + pkg_ffi.UnsignedInt)>>('sqlite3_serialize'); late final _sqlite3_serialize = _sqlite3_serializePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); /// CAPI3REF: Deserialize a database /// @@ -10602,8 +10653,8 @@ class SQLite { /// [SQLITE_ENABLE_DESERIALIZE] option. int sqlite3_deserialize( ffi.Pointer db, - ffi.Pointer zSchema, - ffi.Pointer pData, + ffi.Pointer zSchema, + ffi.Pointer pData, int szDb, int szBuf, int mFlags, @@ -10620,16 +10671,16 @@ class SQLite { late final _sqlite3_deserializePtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, sqlite3_int64, sqlite3_int64, - ffi.Uint32)>>('sqlite3_deserialize'); + pkg_ffi.UnsignedInt)>>('sqlite3_deserialize'); late final _sqlite3_deserialize = _sqlite3_deserializePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, int)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, int)>(); /// Register a geometry callback named zGeom that can be used as part of an /// R-Tree geometry query as follows: @@ -10637,14 +10688,14 @@ class SQLite { /// SELECT ... FROM WHERE MATCH $zGeom(... params ...) int sqlite3_rtree_geometry_callback( ffi.Pointer db, - ffi.Pointer zGeom, + ffi.Pointer zGeom, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer, - ffi.Pointer)>> + ffi.Pointer)>> xGeom, ffi.Pointer pContext, ) { @@ -10658,29 +10709,29 @@ class SQLite { late final _sqlite3_rtree_geometry_callbackPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer, - ffi.Pointer)>>, + ffi.Pointer)>>, ffi.Pointer)>>('sqlite3_rtree_geometry_callback'); late final _sqlite3_rtree_geometry_callback = _sqlite3_rtree_geometry_callbackPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer, - ffi.Pointer)>>, + ffi.Pointer)>>, ffi.Pointer)>(); /// Register a 2nd-generation geometry callback named zScore that can be @@ -10689,10 +10740,10 @@ class SQLite { /// SELECT ... FROM WHERE MATCH $zQueryFunc(... params ...) int sqlite3_rtree_query_callback( ffi.Pointer db, - ffi.Pointer zQueryFunc, + ffi.Pointer zQueryFunc, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer)>> + pkg_ffi.Int Function(ffi.Pointer)>> xQueryFunc, ffi.Pointer pContext, ffi.Pointer)>> @@ -10709,12 +10760,12 @@ class SQLite { late final _sqlite3_rtree_query_callbackPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer)>>, ffi.Pointer, ffi.Pointer< @@ -10725,10 +10776,10 @@ class SQLite { _sqlite3_rtree_query_callbackPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer)>>, ffi.Pointer, ffi.Pointer< @@ -10743,100 +10794,7 @@ class sqlite3_file extends ffi.Struct { external ffi.Pointer pMethods; } -class sqlite3_io_methods extends ffi.Struct { - @ffi.Int32() - external int iVersion; - - external ffi.Pointer< - ffi.NativeFunction)>> xClose; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, sqlite3_int64)>> xRead; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, sqlite3_int64)>> xWrite; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, sqlite3_int64)>> - xTruncate; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xSync; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>> - xFileSize; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xLock; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xUnlock; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>> - xCheckReservedLock; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Int32, ffi.Pointer)>> - xFileControl; - - external ffi.Pointer< - ffi.NativeFunction)>> - xSectorSize; - - external ffi.Pointer< - ffi.NativeFunction)>> - xDeviceCharacteristics; - - /// Methods above are valid for version 1 - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32, ffi.Int32, - ffi.Int32, ffi.Pointer>)>> xShmMap; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Int32, ffi.Int32, ffi.Int32)>> - xShmLock; - - external ffi.Pointer< - ffi.NativeFunction)>> - xShmBarrier; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xShmUnmap; - - /// Methods above are valid for version 2 - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, sqlite3_int64, - ffi.Int32, ffi.Pointer>)>> xFetch; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, sqlite3_int64, - ffi.Pointer)>> xUnfetch; -} - -typedef sqlite3_int64 = sqlite_int64; -typedef sqlite_int64 = ffi.Int64; +class sqlite3_io_methods extends ffi.Opaque {} class sqlite3_mutex extends ffi.Opaque {} @@ -10844,68 +10802,72 @@ class sqlite3_api_routines extends ffi.Opaque {} class sqlite3_vfs extends ffi.Struct { /// Structure version number (currently 3) - @ffi.Int32() + @pkg_ffi.Int() external int iVersion; /// Size of subclassed sqlite3_file - @ffi.Int32() + @pkg_ffi.Int() external int szOsFile; /// Maximum file pathname length - @ffi.Int32() + @pkg_ffi.Int() external int mxPathname; /// Next registered VFS external ffi.Pointer pNext; /// Name of this virtual file system - external ffi.Pointer zName; + external ffi.Pointer zName; /// Pointer to application-specific data external ffi.Pointer pAppData; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Int32, - ffi.Pointer)>> xOpen; + pkg_ffi.Int, + ffi.Pointer)>> xOpen; external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer, ffi.Int32)>> - xDelete; + ffi.NativeFunction< + pkg_ffi.Int Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Int)>> xDelete; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>> xAccess; + pkg_ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + pkg_ffi.Int, + ffi.Pointer)>> xAccess; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>> xFullPathname; + pkg_ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + pkg_ffi.Int, + ffi.Pointer)>> xFullPathname; external ffi.Pointer< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>> xDlOpen; + ffi.Pointer, ffi.Pointer)>> xDlOpen; external ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Int32, ffi.Pointer)>> - xDlError; + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, pkg_ffi.Int, + ffi.Pointer)>> xDlError; external ffi.Pointer< ffi.NativeFunction< ffi.Pointer> Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer)>> xDlSym; + ffi.Pointer)>> xDlSym; external ffi.Pointer< ffi.NativeFunction< @@ -10913,31 +10875,29 @@ class sqlite3_vfs extends ffi.Struct { ffi.Pointer, ffi.Pointer)>> xDlClose; external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Int32, ffi.Pointer)>> - xRandomness; + ffi.NativeFunction< + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, + ffi.Pointer)>> xRandomness; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xSleep; + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int)>> xSleep; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, ffi.Pointer)>> xCurrentTime; external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Int32, ffi.Pointer)>> - xGetLastError; + ffi.NativeFunction< + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, + ffi.Pointer)>> xGetLastError; /// The methods above are in version 1 of the sqlite_vfs object /// definition. Those that follow are added in version 2 or later external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, ffi.Pointer)>> xCurrentTimeInt64; @@ -10945,28 +10905,31 @@ class sqlite3_vfs extends ffi.Struct { /// Those below are for version 3 and greater. external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - sqlite3_syscall_ptr)>> xSetSystemCall; + pkg_ffi.Int Function(ffi.Pointer, + ffi.Pointer, sqlite3_syscall_ptr)>> xSetSystemCall; external ffi.Pointer< - ffi.NativeFunction< - sqlite3_syscall_ptr Function( - ffi.Pointer, ffi.Pointer)>> xGetSystemCall; + ffi.NativeFunction< + sqlite3_syscall_ptr Function( + ffi.Pointer, ffi.Pointer)>> + xGetSystemCall; external ffi.Pointer< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>> + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>> xNextSystemCall; } +typedef sqlite3_int64 = sqlite_int64; +typedef sqlite_int64 = pkg_ffi.LongLong; typedef sqlite3_syscall_ptr = ffi.Pointer>; class sqlite3_mem_methods extends ffi.Struct { /// Memory allocation function external ffi.Pointer< - ffi.NativeFunction Function(ffi.Int32)>> xMalloc; + ffi.NativeFunction Function(pkg_ffi.Int)>> xMalloc; /// Free a prior allocation external ffi @@ -10975,21 +10938,21 @@ class sqlite3_mem_methods extends ffi.Struct { /// Resize an allocation external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Int32)>> - xRealloc; + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, pkg_ffi.Int)>> xRealloc; /// Return the size of an allocation external ffi.Pointer< - ffi.NativeFunction)>> xSize; + ffi.NativeFunction)>> xSize; /// Round up request size to allocation size - external ffi.Pointer> + external ffi.Pointer> xRoundup; /// Initialize the memory allocator external ffi.Pointer< - ffi.NativeFunction)>> xInit; + ffi.NativeFunction)>> xInit; /// Deinitialize the memory allocator external ffi @@ -11001,7 +10964,7 @@ class sqlite3_mem_methods extends ffi.Struct { } typedef sqlite3_uint64 = sqlite_uint64; -typedef sqlite_uint64 = ffi.Uint64; +typedef sqlite_uint64 = pkg_ffi.UnsignedLongLong; class sqlite3_stmt extends ffi.Opaque {} @@ -11030,11 +10993,11 @@ class sqlite3_vtab extends ffi.Struct { external ffi.Pointer pModule; /// Number of open cursors - @ffi.Int32() + @pkg_ffi.Int() external int nRef; /// Error message from sqlite3_mprintf() - external ffi.Pointer zErrMsg; + external ffi.Pointer zErrMsg; } /// CAPI3REF: Virtual Table Object @@ -11052,140 +11015,144 @@ class sqlite3_vtab extends ffi.Struct { /// of this structure must not change while it is registered with /// any database connection. class sqlite3_module extends ffi.Struct { - @ffi.Int32() + @pkg_ffi.Int() external int iVersion; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, ffi.Pointer, - ffi.Int32, - ffi.Pointer>, + pkg_ffi.Int, + ffi.Pointer>, ffi.Pointer>, - ffi.Pointer>)>> xCreate; + ffi.Pointer>)>> xCreate; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, ffi.Pointer, - ffi.Int32, - ffi.Pointer>, + pkg_ffi.Int, + ffi.Pointer>, ffi.Pointer>, - ffi.Pointer>)>> xConnect; + ffi.Pointer>)>> xConnect; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, ffi.Pointer)>> xBestIndex; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction)>> xDisconnect; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction)>> xDestroy; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, + pkg_ffi.Int Function(ffi.Pointer, ffi.Pointer>)>> xOpen; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer)>> xClose; + pkg_ffi.Int Function(ffi.Pointer)>> xClose; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, + ffi.Pointer, + pkg_ffi.Int, ffi.Pointer>)>> xFilter; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer)>> xNext; + pkg_ffi.Int Function(ffi.Pointer)>> xNext; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer)>> xEof; + pkg_ffi.Int Function(ffi.Pointer)>> xEof; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, - ffi.Pointer, ffi.Int32)>> xColumn; + pkg_ffi.Int Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Int)>> xColumn; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, + pkg_ffi.Int Function(ffi.Pointer, ffi.Pointer)>> xRowid; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer>, ffi.Pointer)>> xUpdate; external ffi.Pointer< - ffi.NativeFunction)>> xBegin; + ffi.NativeFunction)>> + xBegin; external ffi.Pointer< - ffi.NativeFunction)>> xSync; + ffi.NativeFunction)>> + xSync; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction)>> xCommit; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction)>> xRollback; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, - ffi.Pointer, + pkg_ffi.Int, + ffi.Pointer, ffi.Pointer< ffi.Pointer< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer>)>>>, ffi.Pointer>)>> xFindFunction; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>> xRename; + pkg_ffi.Int Function( + ffi.Pointer, ffi.Pointer)>> xRename; /// The methods above are in version 1 of the sqlite_module object. Those /// below are for version 2 and greater. external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xSavepoint; + ffi.NativeFunction< + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int)>> + xSavepoint; external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xRelease; + ffi.NativeFunction< + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int)>> + xRelease; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int)>> xRollbackTo; /// The methods above are in versions 1 and 2 of the sqlite_module object. /// Those below are for version 3 and greater. external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction)>> xShadowName; } @@ -11291,14 +11258,14 @@ class sqlite3_module extends ffi.Struct { /// 3009000. class sqlite3_index_info extends ffi.Struct { /// Number of entries in aConstraint - @ffi.Int32() + @pkg_ffi.Int() external int nConstraint; /// Table of WHERE clause constraints external ffi.Pointer aConstraint; /// Number of terms in the ORDER BY clause - @ffi.Int32() + @pkg_ffi.Int() external int nOrderBy; /// The ORDER BY clause @@ -11307,18 +11274,18 @@ class sqlite3_index_info extends ffi.Struct { external ffi.Pointer aConstraintUsage; /// Number used to identify the index - @ffi.Int32() + @pkg_ffi.Int() external int idxNum; /// String, possibly obtained from sqlite3_malloc - external ffi.Pointer idxStr; + external ffi.Pointer idxStr; /// Free idxStr using sqlite3_free() if true - @ffi.Int32() + @pkg_ffi.Int() external int needToFreeIdxStr; /// True if output is already ordered - @ffi.Int32() + @pkg_ffi.Int() external int orderByConsumed; /// Estimated cost of using this index @@ -11330,7 +11297,7 @@ class sqlite3_index_info extends ffi.Struct { external int estimatedRows; /// Mask of SQLITE_INDEX_SCAN_* flags - @ffi.Int32() + @pkg_ffi.Int() external int idxFlags; /// Input: Mask of columns used by statement @@ -11340,40 +11307,40 @@ class sqlite3_index_info extends ffi.Struct { class sqlite3_index_constraint extends ffi.Struct { /// Column constrained. -1 for ROWID - @ffi.Int32() + @pkg_ffi.Int() external int iColumn; /// Constraint operator - @ffi.Uint8() + @pkg_ffi.UnsignedChar() external int op; /// True if this constraint is usable - @ffi.Uint8() + @pkg_ffi.UnsignedChar() external int usable; /// Used internally - xBestIndex should ignore - @ffi.Int32() + @pkg_ffi.Int() external int iTermOffset; } class sqlite3_index_orderby extends ffi.Struct { /// Column number - @ffi.Int32() + @pkg_ffi.Int() external int iColumn; /// True for DESC. False for ASC. - @ffi.Uint8() + @pkg_ffi.UnsignedChar() external int desc; } /// Outputs class sqlite3_index_constraint_usage extends ffi.Struct { /// if >0, constraint is part of argv to xFilter - @ffi.Int32() + @pkg_ffi.Int() external int argvIndex; /// Do not code a test for this constraint - @ffi.Uint8() + @pkg_ffi.UnsignedChar() external int omit; } @@ -11400,12 +11367,12 @@ class sqlite3_vtab_cursor extends ffi.Struct { class sqlite3_blob extends ffi.Opaque {} class sqlite3_mutex_methods extends ffi.Struct { - external ffi.Pointer> xMutexInit; + external ffi.Pointer> xMutexInit; - external ffi.Pointer> xMutexEnd; + external ffi.Pointer> xMutexEnd; external ffi.Pointer< - ffi.NativeFunction Function(ffi.Int32)>> + ffi.NativeFunction Function(pkg_ffi.Int)>> xMutexAlloc; external ffi.Pointer< @@ -11417,7 +11384,7 @@ class sqlite3_mutex_methods extends ffi.Struct { xMutexEnter; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction)>> xMutexTry; external ffi.Pointer< @@ -11425,11 +11392,11 @@ class sqlite3_mutex_methods extends ffi.Struct { xMutexLeave; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction)>> xMutexHeld; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction)>> xMutexNotheld; } @@ -11446,13 +11413,13 @@ class sqlite3_pcache_page extends ffi.Struct { } class sqlite3_pcache_methods2 extends ffi.Struct { - @ffi.Int32() + @pkg_ffi.Int() external int iVersion; external ffi.Pointer pArg; external ffi.Pointer< - ffi.NativeFunction)>> xInit; + ffi.NativeFunction)>> xInit; external ffi .Pointer)>> @@ -11461,39 +11428,39 @@ class sqlite3_pcache_methods2 extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< ffi.Pointer Function( - ffi.Int32, ffi.Int32, ffi.Int32)>> xCreate; + pkg_ffi.Int, pkg_ffi.Int, pkg_ffi.Int)>> xCreate; external ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32)>> + ffi.Void Function(ffi.Pointer, pkg_ffi.Int)>> xCachesize; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction)>> xPagecount; external ffi.Pointer< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Uint32, ffi.Int32)>> xFetch; + ffi.Pointer Function(ffi.Pointer, + pkg_ffi.UnsignedInt, pkg_ffi.Int)>> xFetch; external ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Int32)>> xUnpin; + ffi.Pointer, pkg_ffi.Int)>> xUnpin; external ffi.Pointer< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, - ffi.Uint32, - ffi.Uint32)>> xRekey; + pkg_ffi.UnsignedInt, + pkg_ffi.UnsignedInt)>> xRekey; external ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Uint32)>> - xTruncate; + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, pkg_ffi.UnsignedInt)>> xTruncate; external ffi.Pointer< ffi.NativeFunction)>> @@ -11508,44 +11475,45 @@ class sqlite3_pcache_methods extends ffi.Struct { external ffi.Pointer pArg; external ffi.Pointer< - ffi.NativeFunction)>> xInit; + ffi.NativeFunction)>> xInit; external ffi .Pointer)>> xShutdown; external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Int32, ffi.Int32)>> xCreate; + ffi.NativeFunction< + ffi.Pointer Function(pkg_ffi.Int, pkg_ffi.Int)>> + xCreate; external ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int32)>> + ffi.Void Function(ffi.Pointer, pkg_ffi.Int)>> xCachesize; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction)>> xPagecount; external ffi.Pointer< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Uint32, ffi.Int32)>> xFetch; + ffi.Pointer Function(ffi.Pointer, + pkg_ffi.UnsignedInt, pkg_ffi.Int)>> xFetch; external ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>> xUnpin; + pkg_ffi.Int)>> xUnpin; external ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Uint32, ffi.Uint32)>> xRekey; + pkg_ffi.UnsignedInt, pkg_ffi.UnsignedInt)>> xRekey; external ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Uint32)>> - xTruncate; + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, pkg_ffi.UnsignedInt)>> xTruncate; external ffi.Pointer< ffi.NativeFunction)>> @@ -11574,7 +11542,7 @@ class sqlite3_backup extends ffi.Opaque {} /// the most recent version. class sqlite3_snapshot extends ffi.Struct { @ffi.Array.multi([48]) - external ffi.Array hidden; + external ffi.Array hidden; } /// A pointer to a structure of the following type is passed as the first @@ -11584,7 +11552,7 @@ class sqlite3_rtree_geometry extends ffi.Struct { external ffi.Pointer pContext; /// Size of array aParam[] - @ffi.Int32() + @pkg_ffi.Int() external int nParam; /// Parameters passed to SQL geom function @@ -11613,7 +11581,7 @@ class sqlite3_rtree_query_info extends ffi.Struct { external ffi.Pointer pContext; /// Number of function parameters - @ffi.Int32() + @pkg_ffi.Int() external int nParam; /// value of function parameters @@ -11631,18 +11599,18 @@ class sqlite3_rtree_query_info extends ffi.Struct { external ffi.Pointer aCoord; /// Number of pending entries in the queue - external ffi.Pointer anQueue; + external ffi.Pointer anQueue; /// Number of coordinates - @ffi.Int32() + @pkg_ffi.Int() external int nCoord; /// Level of current node or entry - @ffi.Int32() + @pkg_ffi.Int() external int iLevel; /// The largest iLevel value in the tree - @ffi.Int32() + @pkg_ffi.Int() external int mxLevel; /// Rowid for current entry @@ -11654,11 +11622,11 @@ class sqlite3_rtree_query_info extends ffi.Struct { external double rParentScore; /// Visibility of parent node - @ffi.Int32() + @pkg_ffi.Int() external int eParentWithin; /// OUT: Visibility - @ffi.Int32() + @pkg_ffi.Int() external int eWithin; /// OUT: Write the score here @@ -11880,7 +11848,7 @@ class sqlite3_rtree_query_info extends ffi.Struct { /// See xPhraseFirstColumn above. class Fts5ExtensionApi extends ffi.Struct { /// Currently always set to 3 - @ffi.Int32() + @pkg_ffi.Int() external int iVersion; external ffi.Pointer< @@ -11888,57 +11856,58 @@ class Fts5ExtensionApi extends ffi.Struct { ffi.Pointer Function(ffi.Pointer)>> xUserData; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction)>> xColumnCount; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, ffi.Pointer)>> xRowCount; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32, + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, ffi.Pointer)>> xColumnTotalSize; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Pointer, - ffi.Int32, + ffi.Pointer, + pkg_ffi.Int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Int32)>>)>> xTokenize; + pkg_ffi.Int, + ffi.Pointer, + pkg_ffi.Int, + pkg_ffi.Int, + pkg_ffi.Int)>>)>> xTokenize; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction)>> xPhraseCount; external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xPhraseSize; + ffi.NativeFunction< + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int)>> + xPhraseSize; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>> xInstCount; + pkg_ffi.Int Function( + ffi.Pointer, ffi.Pointer)>> xInstCount; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>> xInst; + pkg_ffi.Int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>> xInst; external ffi.Pointer< ffi.NativeFunction)>> @@ -11946,34 +11915,33 @@ class Fts5ExtensionApi extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, - ffi.Pointer>, - ffi.Pointer)>> xColumnText; + pkg_ffi.Int, + ffi.Pointer>, + ffi.Pointer)>> xColumnText; external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Int32, ffi.Pointer)>> - xColumnSize; + ffi.NativeFunction< + pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, + ffi.Pointer)>> xColumnSize; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>>)>> xQueryPhrase; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, ffi.Pointer, ffi.Pointer< @@ -11983,47 +11951,47 @@ class Fts5ExtensionApi extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Int32)>> xGetAuxdata; + ffi.Pointer, pkg_ffi.Int)>> xGetAuxdata; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>> xPhraseFirst; + ffi.Pointer, + ffi.Pointer)>> xPhraseFirst; external ffi.Pointer< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>> xPhraseNext; + ffi.Pointer, + ffi.Pointer)>> xPhraseNext; external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer, - ffi.Pointer)>> xPhraseFirstColumn; + ffi.Pointer)>> xPhraseFirstColumn; external ffi.Pointer< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer)>> xPhraseNextColumn; + ffi.Pointer)>> xPhraseNextColumn; } class Fts5Context extends ffi.Opaque {} class Fts5PhraseIter extends ffi.Struct { - external ffi.Pointer a; + external ffi.Pointer a; - external ffi.Pointer b; + external ffi.Pointer b; } class Fts5Tokenizer extends ffi.Opaque {} @@ -12031,10 +11999,10 @@ class Fts5Tokenizer extends ffi.Opaque {} class fts5_tokenizer extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Pointer>, - ffi.Int32, + ffi.Pointer>, + pkg_ffi.Int, ffi.Pointer>)>> xCreate; external ffi.Pointer< @@ -12043,34 +12011,34 @@ class fts5_tokenizer extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, + ffi.Pointer, + pkg_ffi.Int, ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Int32)>>)>> xTokenize; + pkg_ffi.Int, + ffi.Pointer, + pkg_ffi.Int, + pkg_ffi.Int, + pkg_ffi.Int)>>)>> xTokenize; } class fts5_api extends ffi.Struct { /// Currently always set to 2 - @ffi.Int32() + @pkg_ffi.Int() external int iVersion; /// Create a new tokenizer external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer< @@ -12081,18 +12049,18 @@ class fts5_api extends ffi.Struct { /// Find an existing tokenizer external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer>, ffi.Pointer)>> xFindTokenizer; /// Create a new auxiliary function external ffi.Pointer< ffi.NativeFunction< - ffi.Int32 Function( + pkg_ffi.Int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, fts5_extension_function, ffi.Pointer< @@ -12107,7 +12075,7 @@ typedef fts5_extension_function = ffi.Pointer< ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Int32, + pkg_ffi.Int, ffi.Pointer>)>>; const String SQLITE_VERSION = '3.32.3'; diff --git a/pkgs/ffigen/test/large_integration_tests/large_test.dart b/pkgs/ffigen/test/large_integration_tests/large_test.dart index a3fadae169..14c54bf243 100644 --- a/pkgs/ffigen/test/large_integration_tests/large_test.dart +++ b/pkgs/ffigen/test/large_integration_tests/large_test.dart @@ -37,9 +37,16 @@ ${strings.headers}: - '**Documentation.h' - '**FataErrorHandler.h' - '**Index.h' -${strings.typedefmap}: - 'size_t': 'IntPtr' - 'time_t': 'Int64' +${strings.typeMap}: + ${strings.typeMapTypedefs}: + 'size_t': + lib: 'pkg_ffi' + c-type: 'Size' + dart-type: 'int' + 'time_t': + lib: 'ffi' + c-type: 'Int64' + dart-type: 'int' ${strings.preamble}: | // ignore_for_file: camel_case_types, non_constant_identifier_names ''') as YamlMap); @@ -64,8 +71,12 @@ ${strings.headers}: - third_party/cjson_library/cJSON.h ${strings.includeDirectives}: - '**cJSON.h' -${strings.typedefmap}: - 'size_t': 'IntPtr' +${strings.typeMap}: + ${strings.typeMapTypedefs}: + 'size_t': + lib: 'pkg_ffi' + c-type: 'Size' + dart-type: 'int' ${strings.preamble}: | // ignore_for_file: camel_case_types, non_constant_identifier_names ''') as YamlMap); diff --git a/pkgs/ffigen/test/native_test/native_test_bindings.dart b/pkgs/ffigen/test/native_test/native_test_bindings.dart index 8c4d0ea802..70e877574a 100644 --- a/pkgs/ffigen/test/native_test/native_test_bindings.dart +++ b/pkgs/ffigen/test/native_test/native_test_bindings.dart @@ -4,6 +4,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; /// Native tests. class NativeLibrary { @@ -211,8 +212,8 @@ class NativeLibrary { late final _Function1StructReturnByValuePtr = _lookup< ffi.NativeFunction< - Struct3 Function(ffi.Int32, ffi.Int32, - ffi.Int32)>>('Function1StructReturnByValue'); + Struct3 Function(pkg_ffi.Int, pkg_ffi.Int, + pkg_ffi.Int)>>('Function1StructReturnByValue'); late final _Function1StructReturnByValue = _Function1StructReturnByValuePtr .asFunction(); @@ -225,7 +226,7 @@ class NativeLibrary { } late final _Function1StructPassByValuePtr = - _lookup>( + _lookup>( 'Function1StructPassByValue'); late final _Function1StructPassByValue = _Function1StructPassByValuePtr.asFunction(); @@ -240,12 +241,12 @@ class Struct1 extends ffi.Struct { } class Struct3 extends ffi.Struct { - @ffi.Int32() + @pkg_ffi.Int() external int a; - @ffi.Int32() + @pkg_ffi.Int() external int b; - @ffi.Int32() + @pkg_ffi.Int() external int c; } diff --git a/pkgs/ffigen/test/rename_tests/rename_test.dart b/pkgs/ffigen/test/rename_tests/rename_test.dart index f362a114a3..896b3dbde9 100644 --- a/pkgs/ffigen/test/rename_tests/rename_test.dart +++ b/pkgs/ffigen/test/rename_tests/rename_test.dart @@ -215,15 +215,15 @@ Library expectedLibrary() { parameters: [ Parameter( name: 'underscore', - type: Type.nativeType(SupportedNativeType.Int32), + type: Type.importedType(intType), ), Parameter( name: 'fullMatchSuccess', - type: Type.nativeType(SupportedNativeType.Float), + type: Type.importedType(floatType), ), Parameter( name: 'unnamed', - type: Type.nativeType(SupportedNativeType.Int32), + type: Type.importedType(intType), ), ], ), @@ -250,11 +250,11 @@ Library expectedLibrary() { members: [ Member( name: 'underscore', - type: Type.nativeType(SupportedNativeType.Int32), + type: Type.importedType(intType), ), Member( name: 'fullMatchSuccess', - type: Type.nativeType(SupportedNativeType.Float), + type: Type.importedType(floatType), ), ], ), @@ -263,7 +263,7 @@ Library expectedLibrary() { members: [ Member( name: 'underscore', - type: Type.nativeType(SupportedNativeType.Int32), + type: Type.importedType(intType), ), ], ), diff --git a/pkgs/ffigen/test/test_utils.dart b/pkgs/ffigen/test/test_utils.dart index a967f66eee..624e62611c 100644 --- a/pkgs/ffigen/test/test_utils.dart +++ b/pkgs/ffigen/test/test_utils.dart @@ -70,3 +70,10 @@ void logWarnings([Level level = Level.WARNING]) { print('${record.level.name.padRight(8)}: ${record.message}'); }); } + +void logWarningsToArray(List logArr, [Level level = Level.WARNING]) { + Logger.root.level = level; + Logger.root.onRecord.listen((record) { + logArr.add('${record.level.name.padRight(8)}: ${record.message}'); + }); +} From a8305d643a3cf868419a811ff5447996f0827ebc Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Tue, 1 Feb 2022 00:33:45 -0800 Subject: [PATCH 098/276] [ffigen] Move to new analyzer checks (#264) --- pkgs/ffigen/analysis_options.yaml | 6 +++--- pkgs/ffigen/lib/src/config_provider/spec_utils.dart | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pkgs/ffigen/analysis_options.yaml b/pkgs/ffigen/analysis_options.yaml index 2a3bc8cb73..06af095b2b 100644 --- a/pkgs/ffigen/analysis_options.yaml +++ b/pkgs/ffigen/analysis_options.yaml @@ -7,9 +7,9 @@ include: package:lints/recommended.yaml analyzer: exclude: - 'test/**_expected*' - strong-mode: - implicit-casts: false - implicit-dynamic: false + language: + strict-casts: true + strict-inference: true linter: rules: diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 06899146ad..e5f0f41b1c 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -586,7 +586,7 @@ bool declarationConfigValidator(List name, dynamic value) { if (!checkType([...name, key as String], value[key])) { _result = false; } else { - for (final subkey in value[key].keys) { + for (final subkey in (value[key] as YamlMap).keys) { if (!checkType( [...name, key, subkey as String], value[key][subkey])) { _result = false; @@ -597,12 +597,13 @@ bool declarationConfigValidator(List name, dynamic value) { if (!checkType([...name, key as String], value[key])) { _result = false; } else { - for (final declNameKey in value[key].keys) { + for (final declNameKey in (value[key] as YamlMap).keys) { if (!checkType([...name, key, declNameKey as String], value[key][declNameKey])) { _result = false; } else { - for (final memberNameKey in value[key][declNameKey].keys) { + for (final memberNameKey + in ((value[key] as YamlMap)[declNameKey] as YamlMap).keys) { if (!checkType([ ...name, key, @@ -619,7 +620,7 @@ bool declarationConfigValidator(List name, dynamic value) { if (!checkType([...name, key as String], value[key])) { _result = false; } else { - for (final subkey in value[key].keys) { + for (final subkey in (value[key] as YamlMap).keys) { if (subkey == strings.include || subkey == strings.exclude) { if (!checkType( [...name, key, subkey as String], value[key][subkey])) { @@ -811,7 +812,7 @@ bool dependencyOnlyValidator(List name, dynamic value) { StructPackingOverride structPackingOverrideExtractor(dynamic value) { final matcherMap = {}; - for (final key in value.keys) { + for (final key in (value as YamlMap).keys) { matcherMap[RegExp(key as String, dotAll: true)] = strings.packingValuesMap[value[key]]; } @@ -824,7 +825,7 @@ bool structPackingOverrideValidator(List name, dynamic value) { if (!checkType([...name], value)) { _result = false; } else { - for (final key in value.keys) { + for (final key in (value as YamlMap).keys) { if (!(strings.packingValuesMap.keys.contains(value[key]))) { _logger.severe( "'$name -> $key' must be one of the following - ${strings.packingValuesMap.keys.toList()}"); From f210680f758a917b5ec49541157ea832ecc13345 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Tue, 1 Feb 2022 23:57:06 +0530 Subject: [PATCH 099/276] [ffigen] Release Patch 4.1.3 (#266) --- pkgs/ffigen/.github/workflows/test-package.yml | 4 ++-- pkgs/ffigen/CHANGELOG.md | 3 +++ pkgs/ffigen/lib/src/code_generator/compound.dart | 2 -- pkgs/ffigen/lib/src/code_generator/func.dart | 2 -- pkgs/ffigen/lib/src/code_generator/type.dart | 2 -- pkgs/ffigen/lib/src/code_generator/typealias.dart | 1 - .../src/header_parser/sub_parsers/compounddecl_parser.dart | 3 +-- .../lib/src/header_parser/sub_parsers/enumdecl_parser.dart | 3 +-- .../src/header_parser/sub_parsers/functiondecl_parser.dart | 1 - .../lib/src/header_parser/sub_parsers/macro_parser.dart | 3 +-- .../header_parser/sub_parsers/unnamed_enumdecl_parser.dart | 3 +-- .../lib/src/header_parser/translation_unit_parser.dart | 3 +-- pkgs/ffigen/lib/src/header_parser/utils.dart | 5 ++++- pkgs/ffigen/pubspec.yaml | 2 +- pkgs/ffigen/test/config_tests/compiler_opts_test.dart | 1 - 15 files changed, 15 insertions(+), 23 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 3bd7e68c8f..3c4d53577f 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -3,9 +3,9 @@ name: Dart CI on: # Run on PRs and pushes to the default branch. push: - branches: [ master ] + branches: [ master, stable] pull_request: - branches: [ master ] + branches: [ master, stable] schedule: - cron: "0 0 * * 0" diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index b5b025924e..73861a3625 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 4.1.3 +- Analyzer fixes. + # 4.1.2 - Added fix for empty include list to exclude all diff --git a/pkgs/ffigen/lib/src/code_generator/compound.dart b/pkgs/ffigen/lib/src/code_generator/compound.dart index 8bdee9bb7e..067e64fe3e 100644 --- a/pkgs/ffigen/lib/src/code_generator/compound.dart +++ b/pkgs/ffigen/lib/src/code_generator/compound.dart @@ -4,9 +4,7 @@ import 'package:ffigen/src/code_generator.dart'; -import 'binding.dart'; import 'binding_string.dart'; -import 'type.dart'; import 'utils.dart'; import 'writer.dart'; diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index 425ee47e54..d33f135d82 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -4,9 +4,7 @@ import 'package:ffigen/src/code_generator.dart'; -import 'binding.dart'; import 'binding_string.dart'; -import 'type.dart'; import 'utils.dart'; import 'writer.dart'; diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index e442a63267..ba16841acb 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -4,8 +4,6 @@ import 'package:ffigen/src/code_generator.dart'; -import 'compound.dart'; -import 'typealias.dart'; import 'writer.dart'; class _SubType { diff --git a/pkgs/ffigen/lib/src/code_generator/typealias.dart b/pkgs/ffigen/lib/src/code_generator/typealias.dart index 7320957628..ea8ef9597c 100644 --- a/pkgs/ffigen/lib/src/code_generator/typealias.dart +++ b/pkgs/ffigen/lib/src/code_generator/typealias.dart @@ -5,7 +5,6 @@ import 'package:ffigen/src/code_generator.dart'; import 'binding_string.dart'; -import 'type.dart'; import 'utils.dart'; import 'writer.dart'; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart index d0d5cd6d56..431334a3a5 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart @@ -192,8 +192,7 @@ void _setMembers(clang_types.CXCursor cursor, String className) { final resultCode = clang.clang_visitChildren( cursor, - Pointer.fromFunction(_compoundMembersVisitor, - clang_types.CXChildVisitResult.CXChildVisit_Break), + Pointer.fromFunction(_compoundMembersVisitor, exceptional_visitor_return), nullptr, ); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index 52cb4ba013..c4b2ab8bda 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -76,8 +76,7 @@ EnumClass? parseEnumDeclaration( void _addEnumConstant(clang_types.CXCursor cursor) { final resultCode = clang.clang_visitChildren( cursor, - Pointer.fromFunction( - _enumCursorVisitor, clang_types.CXChildVisitResult.CXChildVisit_Break), + Pointer.fromFunction(_enumCursorVisitor, exceptional_visitor_return), nullptr, ); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index 41d877ca3a..3b8cd638d4 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -7,7 +7,6 @@ import 'package:ffigen/src/header_parser/data.dart'; import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang_types; -import '../data.dart' show clang; import '../includer.dart'; import '../utils.dart'; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart index 61db5372bb..68bc08036b 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart @@ -80,8 +80,7 @@ List? parseSavedMacros() { final resultCode = clang.clang_visitChildren( rootCursor, - Pointer.fromFunction(_macroVariablevisitor, - clang_types.CXChildVisitResult.CXChildVisit_Break), + Pointer.fromFunction(_macroVariablevisitor, exceptional_visitor_return), nullptr, ); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart index 4cac558e7d..940369ae26 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart @@ -19,8 +19,7 @@ final _logger = Logger('ffigen.header_parser.unnamed_enumdecl_parser'); void saveUnNamedEnum(clang_types.CXCursor cursor) { final resultCode = clang.clang_visitChildren( cursor, - Pointer.fromFunction(_unnamedenumCursorVisitor, - clang_types.CXChildVisitResult.CXChildVisit_Break), + Pointer.fromFunction(_unnamedenumCursorVisitor, exceptional_visitor_return), nullptr, ); diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart index 3e5a677cc5..9a576c0529 100644 --- a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -26,8 +26,7 @@ Set parseTranslationUnit(clang_types.CXCursor translationUnitCursor) { _bindings = {}; final resultCode = clang.clang_visitChildren( translationUnitCursor, - Pointer.fromFunction( - _rootCursorVisitor, clang_types.CXChildVisitResult.CXChildVisit_Break), + Pointer.fromFunction(_rootCursorVisitor, exceptional_visitor_return), nullptr, ); diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index f602cdf22c..471cc36971 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -13,11 +13,14 @@ import 'clang_bindings/clang_bindings.dart' as clang_types; import 'data.dart'; import 'type_extractor/extractor.dart'; +const exceptional_visitor_return = + clang_types.CXChildVisitResult.CXChildVisit_Break; + /// Check [resultCode] of [clang.clang_visitChildren_wrap]. /// /// Throws exception if resultCode is not 0. void visitChildrenResultChecker(int resultCode) { - if (resultCode != 0) { + if (resultCode != exceptional_visitor_return) { throw Exception( 'Exception thrown in a dart function called via C, use --verbose to see more details'); } diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 34a5c3c919..34b851e6c5 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 4.1.2 +version: 4.1.3 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/config_tests/compiler_opts_test.dart b/pkgs/ffigen/test/config_tests/compiler_opts_test.dart index b5e644b65f..5193d4dba2 100644 --- a/pkgs/ffigen/test/config_tests/compiler_opts_test.dart +++ b/pkgs/ffigen/test/config_tests/compiler_opts_test.dart @@ -3,7 +3,6 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/ffigen.dart'; -import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/config_provider/spec_utils.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:test/test.dart'; From 3f80cd0d7894b06d8357b60faefd8fd0ccd2dbdb Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Wed, 9 Feb 2022 23:00:38 +0530 Subject: [PATCH 100/276] [ffigen] Fix size_t and wchar_t default dart types. (#274) --- pkgs/ffigen/CHANGELOG.md | 3 + pkgs/ffigen/example/c_json/pubspec.yaml | 7 -- .../lib/src/code_generator/imports.dart | 6 +- pkgs/ffigen/pubspec.yaml | 2 +- .../example_tests/cjson_example_test.dart | 6 -- .../_expected_imported_types_bindings.dart | 82 +++++++++++++++++++ .../test/header_parser_tests/imported_types.h | 23 ++++++ .../imported_types_test.dart | 50 +++++++++++ 8 files changed, 161 insertions(+), 18 deletions(-) create mode 100644 pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_imported_types_bindings.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/imported_types.h create mode 100644 pkgs/ffigen/test/header_parser_tests/imported_types_test.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index fd75d432b6..93663e8113 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 5.0.0-dev.1 +- Fixed invalid default dart types being generated for `size_t` and `wchar_t`. + # 5.0.0-dev.0 - Added support for generating ABI Specific integers. - Breaking: removed config keys - `size-map` and `typedef-map`. diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index f4180fb6af..9493d21057 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -26,13 +26,6 @@ ffigen: include-directives: - '**cJSON.h' comments: false - type-map: - typedefs: - 'size_t': - lib: 'pkg_ffi' - c-type: 'Size' - dart-type: 'int' - preamble: | // Copyright (c) 2009-2017 Dave Gamble and cJSON contributors // diff --git a/pkgs/ffigen/lib/src/code_generator/imports.dart b/pkgs/ffigen/lib/src/code_generator/imports.dart index 7a92aa30e1..ab5e6c05e2 100644 --- a/pkgs/ffigen/lib/src/code_generator/imports.dart +++ b/pkgs/ffigen/lib/src/code_generator/imports.dart @@ -49,7 +49,5 @@ final longLongType = ImportedType(ffiPkgImport, 'LongLong', 'int'); final floatType = ImportedType(ffiImport, 'Float', 'double'); final doubleType = ImportedType(ffiImport, 'Double', 'double'); -final sizeType = ImportedType(ffiPkgImport, 'Size', 'Size'); -final sSizeType = ImportedType(ffiPkgImport, 'SSize', 'SSize'); -final offType = ImportedType(ffiPkgImport, 'Off', 'Off'); -final wCharType = ImportedType(ffiPkgImport, 'WChar', 'WChar'); +final sizeType = ImportedType(ffiPkgImport, 'Size', 'int'); +final wCharType = ImportedType(ffiPkgImport, 'WChar', 'int'); diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index e0e03b0544..967ccdf3a6 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 5.0.0-dev.0 +version: 5.0.0-dev.1 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. diff --git a/pkgs/ffigen/test/example_tests/cjson_example_test.dart b/pkgs/ffigen/test/example_tests/cjson_example_test.dart index 65d5611954..15d0c5406d 100644 --- a/pkgs/ffigen/test/example_tests/cjson_example_test.dart +++ b/pkgs/ffigen/test/example_tests/cjson_example_test.dart @@ -27,12 +27,6 @@ ${strings.headers}: ${strings.includeDirectives}: - '**cJSON.h' ${strings.comments}: false -${strings.typeMap}: - ${strings.typeMapTypedefs}: - 'size_t': - lib: 'pkg_ffi' - c-type: 'Size' - dart-type: 'int' ${strings.preamble}: | // Copyright (c) 2009-2017 Dave Gamble and cJSON contributors // diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_imported_types_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_imported_types_bindings.dart new file mode 100644 index 0000000000..dc8ca23d87 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_imported_types_bindings.dart @@ -0,0 +1,82 @@ +// ignore_for_file: camel_case_types + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; + +/// Imported types test +class NativeLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + NativeLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NativeLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + void default_imported_types( + int arg0, + int arg1, + int arg2, + int arg3, + int arg4, + int arg5, + int arg6, + int arg7, + int arg8, + int arg9, + int arg10, + double arg11, + double arg12, + int arg13, + int arg14, + ) { + return _default_imported_types( + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, + arg6, + arg7, + arg8, + arg9, + arg10, + arg11, + arg12, + arg13, + arg14, + ); + } + + late final _default_imported_typesPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + pkg_ffi.UnsignedChar, + pkg_ffi.SignedChar, + pkg_ffi.Char, + pkg_ffi.UnsignedShort, + pkg_ffi.Short, + pkg_ffi.UnsignedInt, + pkg_ffi.Int, + pkg_ffi.UnsignedLong, + pkg_ffi.Long, + pkg_ffi.UnsignedLongLong, + pkg_ffi.LongLong, + ffi.Float, + ffi.Double, + pkg_ffi.Size, + pkg_ffi.WChar)>>('default_imported_types'); + late final _default_imported_types = _default_imported_typesPtr.asFunction< + void Function(int, int, int, int, int, int, int, int, int, int, int, + double, double, int, int)>(); +} diff --git a/pkgs/ffigen/test/header_parser_tests/imported_types.h b/pkgs/ffigen/test/header_parser_tests/imported_types.h new file mode 100644 index 0000000000..685e47c811 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/imported_types.h @@ -0,0 +1,23 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#include + +void default_imported_types( + unsigned char, + signed char, + char, + unsigned short, + short, + unsigned int, + int, + unsigned long, + long, + unsigned long long, + long long, + float, + double, + size_t, + wchar_t +); diff --git a/pkgs/ffigen/test/header_parser_tests/imported_types_test.dart b/pkgs/ffigen/test/header_parser_tests/imported_types_test.dart new file mode 100644 index 0000000000..a018af2833 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/imported_types_test.dart @@ -0,0 +1,50 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; + +import '../test_utils.dart'; + +late Library actual, expected; + +void main() { + group('imported_types_test', () { + setUpAll(() { + logWarnings(); + actual = parser.parse( + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Imported types test' +${strings.output}: 'unused' + +${strings.headers}: + ${strings.entryPoints}: + - 'test/header_parser_tests/imported_types.h' + ${strings.includeDirectives}: + - '**imported_types.h' + +${strings.preamble}: | + // ignore_for_file: camel_case_types + ''') as yaml.YamlMap), + ); + }); + test('Expected Bindings', () { + matchLibraryWithExpected(actual, [ + 'test', + 'debug_generated', + 'header_parser_imported_types_test_output.dart' + ], [ + 'test', + 'header_parser_tests', + 'expected_bindings', + '_expected_imported_types_bindings.dart' + ]); + }); + }); +} From b570afb665082eed867454bead54ab27bb520827 Mon Sep 17 00:00:00 2001 From: Kyle Finlinson Date: Fri, 25 Feb 2022 00:33:34 -0800 Subject: [PATCH 101/276] [ffigen] Add default location for LLVM on M1 Mac (#278) --- pkgs/ffigen/lib/src/strings.dart | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index fbbd6b76fa..cbfc6105ce 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -174,19 +174,20 @@ const libclang_dylib_macos = 'libclang.dylib'; const libclang_dylib_windows = 'libclang.dll'; // Dynamic library default locations. -const linuxDylibLocations = [ +const linuxDylibLocations = { '/usr/lib/llvm-9/lib/', '/usr/lib/llvm-10/lib/', '/usr/lib/llvm-11/lib/', '/usr/lib/', '/usr/lib64/', -]; -const windowsDylibLocations = [ +}; +const windowsDylibLocations = { r'C:\Program Files\LLVM\bin\', -]; -const macOsDylibLocations = [ +}; +const macOsDylibLocations = { '/usr/local/opt/llvm/lib/', -]; + '/opt/homebrew/opt/llvm/lib/', +}; // Writen doubles. const doubleInfinity = 'double.infinity'; From 489e1e64cac462027e07457f2e1fcc56a2e92e5c Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 16 Mar 2022 01:21:39 -0700 Subject: [PATCH 102/276] [ffigen] BindingsIndex refactor (#283) Unify and simplify how Types are cached and cycles are broken in the type graph. - All types that need to be cached (those that have a declaration cursor) are cached in `BindingsIndex._declaredTypes` - All calls to convert a `CXType` to an ffigen `Type` now go through `getCodeGenType` - All calls to the related sub-parsers (`parseCompoundDeclaration`, `parseEnumDeclaration`, `parseTypedefDeclaration`) also go through `getCodeGenType` - Those sub-parsers (mostly) don't know about `BindingsIndex`, and don't know about caching or cycle breaking. That's all handled in one place in `getCodeGenType` - Cycles are broken by dividing type conversion into 2 stages (the only conversion this matters for is compound types): - First the `Type` is created, with as many fields filled in as possible, without a recursive call to `getCodeGenType` (everything except the list of members) - Next, `getCodeGenType` inserts the type into the cache - Finally, the members are filled in. Recursive calls to `getCodeGenType` are allowed here, as they will hit the cache, breaking any cycles. --- .../libclang-example/generated_bindings.dart | 2 - .../lib/src/header_parser/includer.dart | 12 +- .../sub_parsers/compounddecl_parser.dart | 162 +++++++------ .../sub_parsers/enumdecl_parser.dart | 7 +- .../sub_parsers/functiondecl_parser.dart | 15 +- .../sub_parsers/typedefdecl_parser.dart | 24 +- .../translation_unit_parser.dart | 13 +- .../type_extractor/extractor.dart | 216 ++++++++++-------- pkgs/ffigen/lib/src/header_parser/utils.dart | 154 +++---------- pkgs/ffigen/lib/src/strings.dart | 2 + 10 files changed, 257 insertions(+), 350 deletions(-) diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index 125e78c72f..6f7323259b 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -9296,8 +9296,6 @@ typedef NativeClang_Cursor_getTranslationUnit = CXTranslationUnit Function( typedef DartClang_Cursor_getTranslationUnit = CXTranslationUnit Function( CXCursor arg0); -class CXCursorSetImpl extends ffi.Opaque {} - /// A fast container representing a set of CXCursors. typedef CXCursorSet = ffi.Pointer; typedef NativeClang_createCXCursorSet = CXCursorSet Function(); diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart index 9211d5fa0b..aaad6939e6 100644 --- a/pkgs/ffigen/lib/src/header_parser/includer.dart +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -20,22 +20,22 @@ bool _shouldIncludeDecl(String usr, String name, bool shouldIncludeStruct(String usr, String name) { return _shouldIncludeDecl( - usr, name, bindingsIndex.isSeenStruct, config.structDecl.shouldInclude); + usr, name, bindingsIndex.isSeenType, config.structDecl.shouldInclude); } bool shouldIncludeUnion(String usr, String name) { return _shouldIncludeDecl( - usr, name, bindingsIndex.isSeenUnion, config.unionDecl.shouldInclude); + usr, name, bindingsIndex.isSeenType, config.unionDecl.shouldInclude); } bool shouldIncludeFunc(String usr, String name) { return _shouldIncludeDecl( - usr, name, bindingsIndex.isSeenFunc, config.functionDecl.shouldInclude); + usr, name, bindingsIndex.isSeenType, config.functionDecl.shouldInclude); } bool shouldIncludeEnumClass(String usr, String name) { - return _shouldIncludeDecl(usr, name, bindingsIndex.isSeenEnumClass, - config.enumClassDecl.shouldInclude); + return _shouldIncludeDecl( + usr, name, bindingsIndex.isSeenType, config.enumClassDecl.shouldInclude); } bool shouldIncludeUnnamedEnumConstant(String usr, String name) { @@ -55,7 +55,7 @@ bool shouldIncludeMacro(String usr, String name) { bool shouldIncludeTypealias(String usr, String name) { return _shouldIncludeDecl( - usr, name, bindingsIndex.isSeenTypealias, config.typedefs.shouldInclude); + usr, name, bindingsIndex.isSeenType, config.typedefs.shouldInclude); } /// True if a cursor should be included based on headers config, used on root diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart index 431334a3a5..f1eb651b7b 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart @@ -18,13 +18,15 @@ final _logger = Logger('ffigen.header_parser.compounddecl_parser'); /// Holds temporary information regarding [compound] while parsing. class _ParsedCompound { - Compound? compound; + Compound compound; bool unimplementedMemberType = false; bool flexibleArrayMember = false; bool bitFieldMember = false; bool dartHandleMember = false; bool incompleteCompoundMember = false; + _ParsedCompound(this.compound); + bool get isInComplete => unimplementedMemberType || flexibleArrayMember || @@ -40,32 +42,30 @@ class _ParsedCompound { // Stores the maximum alignment from all the children. int maxChildAlignment = 0; // Alignment of this struct. - int allignment = 0; + int alignment = 0; bool get _isPacked { if (!hasAttr || isInComplete) return false; if (hasPackedAttr) return true; - return maxChildAlignment > allignment; + return maxChildAlignment > alignment; } /// Returns pack value of a struct depending on config, returns null for no /// packing. int? get packValue { - if (compound!.isStruct && _isPacked) { - if (strings.packingValuesMap.containsKey(allignment)) { - return allignment; + if (compound.isStruct && _isPacked) { + if (strings.packingValuesMap.containsKey(alignment)) { + return alignment; } else { _logger.warning( - 'Unsupported pack value "$allignment" for Struct "${compound!.name}".'); + 'Unsupported pack value "$alignment" for Struct "${compound.name}".'); return null; } } else { return null; } } - - _ParsedCompound(); } final _stack = Stack<_ParsedCompound>(); @@ -83,31 +83,18 @@ Compound? parseCompoundDeclaration( /// generate these as opaque if `dependency-only` was set to opaque). bool pointerReference = false, }) { - _stack.push(_ParsedCompound()); - // Set includer functions according to compoundType. final bool Function(String, String) shouldIncludeDecl; - final bool Function(String) isSeenDecl; - final Compound? Function(String) getSeenDecl; - final void Function(String, Compound) addDeclToSeen; final Declaration configDecl; - final String className; + final String className = _compoundTypeDebugName(compoundType); switch (compoundType) { case CompoundType.struct: shouldIncludeDecl = shouldIncludeStruct; - isSeenDecl = bindingsIndex.isSeenStruct; - getSeenDecl = bindingsIndex.getSeenStruct; - addDeclToSeen = bindingsIndex.addStructToSeen; configDecl = config.structDecl; - className = 'Struct'; break; case CompoundType.union: shouldIncludeDecl = shouldIncludeUnion; - isSeenDecl = bindingsIndex.isSeenUnion; - getSeenDecl = bindingsIndex.getSeenUnion; - addDeclToSeen = bindingsIndex.addUnionToSeen; configDecl = config.unionDecl; - className = 'Union'; break; } @@ -134,110 +121,110 @@ Compound? parseCompoundDeclaration( if (ignoreFilter) { // This declaration is defined inside some other declaration and hence // must be generated. - _stack.top.compound = Compound.fromType( + return Compound.fromType( type: compoundType, name: incrementalNamer.name('Unnamed$className'), usr: declUsr, dartDoc: getCursorDocComment(cursor), ); - _setMembers(cursor, className); } else { _logger.finest('unnamed $className declaration'); } - } else if ((ignoreFilter || shouldIncludeDecl(declUsr, declName)) && - (!isSeenDecl(declUsr))) { + } else if (ignoreFilter || shouldIncludeDecl(declUsr, declName)) { _logger.fine( '++++ Adding $className: Name: $declName, ${cursor.completeStringRepr()}'); - _stack.top.compound = Compound.fromType( + return Compound.fromType( type: compoundType, usr: declUsr, originalName: declName, name: configDecl.renameUsingConfig(declName), dartDoc: getCursorDocComment(cursor), ); - // Adding to seen here to stop recursion if a declaration has itself as a - // member, members are updated later. - addDeclToSeen(declUsr, _stack.top.compound!); } - - if (isSeenDecl(declUsr)) { - _stack.top.compound = getSeenDecl(declUsr); - - // Skip dependencies if already seen OR user has specified `dependency-only` - // as opaque AND this is a pointer reference AND the declaration was not - // included according to config (ignoreFilter). - final skipDependencies = _stack.top.compound!.parsedDependencies || - (pointerReference && - ignoreFilter && - ((compoundType == CompoundType.struct && - config.structDependencies == CompoundDependencies.opaque) || - (compoundType == CompoundType.union && - config.unionDependencies == CompoundDependencies.opaque))); - - if (!skipDependencies) { - // Prevents infinite recursion if struct has a pointer to itself. - _stack.top.compound!.parsedDependencies = true; - _setMembers(cursor, className); - } else if (!_stack.top.compound!.parsedDependencies) { - _logger.fine('Skipped dependencies.'); - } - } - - return _stack.pop().compound; + return null; } -void _setMembers(clang_types.CXCursor cursor, String className) { - _stack.top.hasAttr = clang.clang_Cursor_hasAttrs(cursor) != 0; - _stack.top.allignment = cursor.type().alignment(); +void fillCompoundMembersIfNeeded( + Compound compound, + clang_types.CXCursor cursor, { + /// Option to ignore declaration filter (Useful in case of extracting + /// declarations when they are passed/returned by an included function.) + bool ignoreFilter = false, + + /// To track if the declaration was used by reference(i.e T*). (Used to only + /// generate these as opaque if `dependency-only` was set to opaque). + bool pointerReference = false, +}) { + final compoundType = compound.compoundType; + + // Skip dependencies if already seen OR user has specified `dependency-only` + // as opaque AND this is a pointer reference AND the declaration was not + // included according to config (ignoreFilter). + final skipDependencies = compound.parsedDependencies || + (pointerReference && + ignoreFilter && + ((compoundType == CompoundType.struct && + config.structDependencies == CompoundDependencies.opaque) || + (compoundType == CompoundType.union && + config.unionDependencies == CompoundDependencies.opaque))); + if (skipDependencies) return; + + final parsed = _ParsedCompound(compound); + final String className = _compoundTypeDebugName(compoundType); + parsed.hasAttr = clang.clang_Cursor_hasAttrs(cursor) != 0; + parsed.alignment = cursor.type().alignment(); + compound.parsedDependencies = true; // Break cycles. + + _stack.push(parsed); final resultCode = clang.clang_visitChildren( cursor, Pointer.fromFunction(_compoundMembersVisitor, exceptional_visitor_return), nullptr, ); + _stack.pop(); _logger.finest( - 'Opaque: ${_stack.top.isInComplete}, HasAttr: ${_stack.top.hasAttr}, AlignValue: ${_stack.top.allignment}, MaxChildAlignValue: ${_stack.top.maxChildAlignment}, PackValue: ${_stack.top.packValue}.'); - _stack.top.compound!.pack = _stack.top.packValue; + 'Opaque: ${parsed.isInComplete}, HasAttr: ${parsed.hasAttr}, AlignValue: ${parsed.alignment}, MaxChildAlignValue: ${parsed.maxChildAlignment}, PackValue: ${parsed.packValue}.'); + compound.pack = parsed.packValue; visitChildrenResultChecker(resultCode); - if (_stack.top.unimplementedMemberType) { + if (parsed.unimplementedMemberType) { _logger.fine( '---- Removed $className members, reason: member with unimplementedtype ${cursor.completeStringRepr()}'); _logger.warning( - 'Removed All $className Members from ${_stack.top.compound!.name}(${_stack.top.compound!.originalName}), struct member has an unsupported type.'); - } else if (_stack.top.flexibleArrayMember) { + 'Removed All $className Members from ${compound.name}(${compound.originalName}), struct member has an unsupported type.'); + } else if (parsed.flexibleArrayMember) { _logger.fine( '---- Removed $className members, reason: incomplete array member ${cursor.completeStringRepr()}'); _logger.warning( - 'Removed All $className Members from ${_stack.top.compound!.name}(${_stack.top.compound!.originalName}), Flexible array members not supported.'); - } else if (_stack.top.bitFieldMember) { + 'Removed All $className Members from ${compound.name}(${compound.originalName}), Flexible array members not supported.'); + } else if (parsed.bitFieldMember) { _logger.fine( '---- Removed $className members, reason: bitfield members ${cursor.completeStringRepr()}'); _logger.warning( - 'Removed All $className Members from ${_stack.top.compound!.name}(${_stack.top.compound!.originalName}), Bit Field members not supported.'); - } else if (_stack.top.dartHandleMember && config.useDartHandle) { + 'Removed All $className Members from ${compound.name}(${compound.originalName}), Bit Field members not supported.'); + } else if (parsed.dartHandleMember && config.useDartHandle) { _logger.fine( '---- Removed $className members, reason: Dart_Handle member. ${cursor.completeStringRepr()}'); _logger.warning( - 'Removed All $className Members from ${_stack.top.compound!.name}(${_stack.top.compound!.originalName}), Dart_Handle member not supported.'); - } else if (_stack.top.incompleteCompoundMember) { + 'Removed All $className Members from ${compound.name}(${compound.originalName}), Dart_Handle member not supported.'); + } else if (parsed.incompleteCompoundMember) { _logger.fine( '---- Removed $className members, reason: Incomplete Nested Struct member. ${cursor.completeStringRepr()}'); _logger.warning( - 'Removed All $className Members from ${_stack.top.compound!.name}(${_stack.top.compound!.originalName}), Incomplete Nested Struct member not supported.'); + 'Removed All $className Members from ${compound.name}(${compound.originalName}), Incomplete Nested Struct member not supported.'); } // Clear all members if declaration is incomplete. - if (_stack.top.isInComplete) { - _stack.top.compound!.members.clear(); + if (parsed.isInComplete) { + compound.members.clear(); } // C allows empty structs/union, but it's undefined behaviour at runtine. // So we need to mark a declaration incomplete if it has no members. - _stack.top.compound!.isInComplete = - _stack.top.isInComplete || _stack.top.compound!.members.isEmpty; + compound.isInComplete = parsed.isInComplete || compound.members.isEmpty; } /// Visitor for the struct/union cursor [CXCursorKind.CXCursor_StructDecl]/ @@ -246,36 +233,37 @@ void _setMembers(clang_types.CXCursor cursor, String className) { /// Child visitor invoked on struct/union cursor. int _compoundMembersVisitor(clang_types.CXCursor cursor, clang_types.CXCursor parent, Pointer clientData) { + final parsed = _stack.top; try { if (cursor.kind == clang_types.CXCursorKind.CXCursor_FieldDecl) { _logger.finer('===== member: ${cursor.completeStringRepr()}'); // Set maxChildAlignValue. final align = cursor.type().alignment(); - if (align > _stack.top.maxChildAlignment) { - _stack.top.maxChildAlignment = align; + if (align > parsed.maxChildAlignment) { + parsed.maxChildAlignment = align; } final mt = cursor.type().toCodeGenType(); if (mt.broadType == BroadType.IncompleteArray) { // TODO(68): Structs with flexible Array Members are not supported. - _stack.top.flexibleArrayMember = true; + parsed.flexibleArrayMember = true; } if (clang.clang_getFieldDeclBitWidth(cursor) != -1) { // TODO(84): Struct with bitfields are not suppoorted. - _stack.top.bitFieldMember = true; + parsed.bitFieldMember = true; } if (mt.broadType == BroadType.Handle) { - _stack.top.dartHandleMember = true; + parsed.dartHandleMember = true; } if (mt.isIncompleteCompound) { - _stack.top.incompleteCompoundMember = true; + parsed.incompleteCompoundMember = true; } if (mt.getBaseType().broadType == BroadType.Unimplemented) { - _stack.top.unimplementedMemberType = true; + parsed.unimplementedMemberType = true; } - _stack.top.compound!.members.add( + parsed.compound.members.add( Member( dartDoc: getCursorDocComment( cursor, @@ -283,14 +271,14 @@ int _compoundMembersVisitor(clang_types.CXCursor cursor, ), originalName: cursor.spelling(), name: config.structDecl.renameMemberUsingConfig( - _stack.top.compound!.originalName, + parsed.compound.originalName, cursor.spelling(), ), type: mt, ), ); } else if (cursor.kind == clang_types.CXCursorKind.CXCursor_PackedAttr) { - _stack.top.hasPackedAttr = true; + parsed.hasPackedAttr = true; } } catch (e, s) { _logger.severe(e); @@ -299,3 +287,7 @@ int _compoundMembersVisitor(clang_types.CXCursor cursor, } return clang_types.CXChildVisitResult.CXChildVisit_Continue; } + +String _compoundTypeDebugName(CompoundType compoundType) { + return compoundType == CompoundType.struct ? "Struct" : "Union"; +} diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index c4b2ab8bda..4e5e1506c9 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -54,8 +54,7 @@ EnumClass? parseEnumDeclaration( if (enumName.isEmpty) { _logger.fine('Saving anonymous enum.'); saveUnNamedEnum(cursor); - } else if ((ignoreFilter || shouldIncludeEnumClass(enumUsr, enumName)) && - (!bindingsIndex.isSeenEnumClass(enumUsr))) { + } else if (ignoreFilter || shouldIncludeEnumClass(enumUsr, enumName)) { _logger.fine('++++ Adding Enum: ${cursor.completeStringRepr()}'); _stack.top.enumClass = EnumClass( usr: enumUsr, @@ -63,12 +62,8 @@ EnumClass? parseEnumDeclaration( originalName: enumName, name: config.enumClassDecl.renameUsingConfig(enumName), ); - bindingsIndex.addEnumClassToSeen(enumUsr, _stack.top.enumClass!); _addEnumConstant(cursor); } - if (bindingsIndex.isSeenEnumClass(enumUsr)) { - _stack.top.enumClass = bindingsIndex.getSeenEnumClass(enumUsr); - } return _stack.pop().enumClass; } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index 3b8cd638d4..870cf47210 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -39,9 +39,8 @@ Func? parseFunctionDeclaration(clang_types.CXCursor cursor) { '---- Removed Function, reason: inline function: ${cursor.completeStringRepr()}'); _logger.warning( "Skipped Function '$funcName', inline functions are not supported."); - return _stack - .pop() - .func; // Returning null so that [addToBindings] function excludes this. + // Returning null so that [addToBindings] function excludes this. + return _stack.pop().func; } if (rt.isIncompleteCompound || _stack.top.incompleteStructParameter) { @@ -49,9 +48,8 @@ Func? parseFunctionDeclaration(clang_types.CXCursor cursor) { '---- Removed Function, reason: Incomplete struct pass/return by value: ${cursor.completeStringRepr()}'); _logger.warning( "Skipped Function '$funcName', Incomplete struct pass/return by value not supported."); - return _stack - .pop() - .func; // Returning null so that [addToBindings] function excludes this. + // Returning null so that [addToBindings] function excludes this. + return _stack.pop().func; } if (rt.getBaseType().broadType == BroadType.Unimplemented || @@ -60,9 +58,8 @@ Func? parseFunctionDeclaration(clang_types.CXCursor cursor) { '---- Removed Function, reason: unsupported return type or parameter type: ${cursor.completeStringRepr()}'); _logger.warning( "Skipped Function '$funcName', function has unsupported return type or parameter type."); - return _stack - .pop() - .func; // Returning null so that [addToBindings] function excludes this. + // Returning null so that [addToBindings] function excludes this. + return _stack.pop().func; } _stack.top.func = Func( diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart index 90d5664d67..d8f84cf089 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart @@ -13,8 +13,7 @@ import '../utils.dart'; final _logger = Logger('ffigen.header_parser.typedefdecl_parser'); -/// Holds temporary information regarding a typedef referenced [Binding] -/// while parsing. +/// Parses a typedef declaration. /// /// Notes: /// - Pointer to Typedefs structs are skipped if the struct is seen. @@ -30,16 +29,6 @@ final _logger = Logger('ffigen.header_parser.typedefdecl_parser'); /// /// typedef A D; // Typeref. /// ``` -class _ParsedTypealias { - Typealias? typealias; - String? typedefName; - bool typedefToPointer = false; - _ParsedTypealias(); -} - -final _stack = Stack<_ParsedTypealias>(); - -/// Parses a typedef declaration. /// /// Returns `null` if the typedef could not be generated or has been excluded /// by the config. @@ -47,7 +36,6 @@ Typealias? parseTypedefDeclaration( clang_types.CXCursor cursor, { bool pointerReference = false, }) { - _stack.push(_ParsedTypealias()); final typedefName = cursor.spelling(); final typedefUsr = cursor.usr(); if (shouldIncludeTypealias(typedefUsr, typedefName)) { @@ -85,20 +73,14 @@ Typealias? parseTypedefDeclaration( bindingsIndex.addUnsupportedTypealiasToSeen(typedefUsr); } else { // Create typealias. - _stack.top.typealias = Typealias( + return Typealias( usr: typedefUsr, originalName: typedefName, name: config.typedefs.renameUsingConfig(typedefName), type: s, dartDoc: getCursorDocComment(cursor), ); - bindingsIndex.addTypealiasToSeen(typedefUsr, _stack.top.typealias!); } } - - if (bindingsIndex.isSeenTypealias(typedefUsr)) { - _stack.top.typealias = bindingsIndex.getSeenTypealias(typedefUsr); - } - - return _stack.pop().typealias; + return null; } diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart index 9a576c0529..60c623e3ce 100644 --- a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -12,9 +12,8 @@ import 'package:logging/logging.dart'; import 'clang_bindings/clang_bindings.dart' as clang_types; import 'data.dart'; import 'includer.dart'; -import 'sub_parsers/compounddecl_parser.dart'; -import 'sub_parsers/enumdecl_parser.dart'; import 'sub_parsers/functiondecl_parser.dart'; +import 'type_extractor/extractor.dart'; import 'utils.dart'; final _logger = Logger('ffigen.header_parser.translation_unit_parser'); @@ -46,13 +45,11 @@ int _rootCursorVisitor(clang_types.CXCursor cursor, clang_types.CXCursor parent, addToBindings(parseFunctionDeclaration(cursor)); break; case clang_types.CXCursorKind.CXCursor_StructDecl: - addToBindings(parseCompoundDeclaration(cursor, CompoundType.struct)); - break; case clang_types.CXCursorKind.CXCursor_UnionDecl: - addToBindings(parseCompoundDeclaration(cursor, CompoundType.union)); + addToBindings(_getCodeGenTypeFromCursor(cursor)?.compound); break; case clang_types.CXCursorKind.CXCursor_EnumDecl: - addToBindings(parseEnumDeclaration(cursor)); + addToBindings(_getCodeGenTypeFromCursor(cursor)?.enumClass); break; case clang_types.CXCursorKind.CXCursor_MacroDefinition: saveMacroDefinition(cursor); @@ -82,3 +79,7 @@ void addToBindings(Binding? b) { _bindings.add(b); } } + +Type? _getCodeGenTypeFromCursor(clang_types.CXCursor cursor) { + return getCodeGenType(cursor.type(), ignoreFilter: false); +} diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 6063035617..8ea5d96649 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -22,13 +22,47 @@ const _padding = ' '; Type getCodeGenType( clang_types.CXType cxtype, { + /// Option to ignore declaration filter (Useful in case of extracting + /// declarations when they are passed/returned by an included function.) + bool ignoreFilter = true, + /// Passed on if a value was marked as a pointer before this one. bool pointerReference = false, }) { _logger.fine('${_padding}getCodeGenType ${cxtype.completeStringRepr()}'); - final kind = cxtype.kind; - switch (kind) { + // Special case: Elaborated types just refer to another type. + if (cxtype.kind == clang_types.CXTypeKind.CXType_Elaborated) { + return getCodeGenType(clang.clang_Type_getNamedType(cxtype), + ignoreFilter: ignoreFilter, pointerReference: pointerReference); + } + + // If the type has a declaration cursor, then use the BindingsIndex to break + // any potential cycles, and dedupe the Type. + final cursor = clang.clang_getTypeDeclaration(cxtype); + if (cursor.kind != clang_types.CXCursorKind.CXCursor_NoDeclFound) { + final usr = cursor.usr(); + var type = bindingsIndex.getSeenType(usr); + if (type == null) { + final result = + _createTypeFromCursor(cxtype, cursor, ignoreFilter, pointerReference); + type = result.type; + if (type == null) { + return Type.unimplemented( + 'Type: ${cxtype.kindSpelling()} not implemented'); + } + if (result.addToCache) { + bindingsIndex.addTypeToSeen(usr, type); + } + } + _fillFromCursorIfNeeded(type, cursor, ignoreFilter, pointerReference); + return type; + } + + // If the type doesn't have a declaration cursor, then it's a basic type such + // as int, or a simple derived type like a pointer, so doesn't need to be + // cached. + switch (cxtype.kind) { case clang_types.CXTypeKind.CXType_Pointer: final pt = clang.clang_getPointeeType(cxtype); final s = getCodeGenType(pt, pointerReference: true); @@ -41,67 +75,6 @@ Type getCodeGenType( return Type.handle(); } return Type.pointer(s); - case clang_types.CXTypeKind.CXType_Typedef: - final spelling = clang.clang_getTypedefName(cxtype).toStringAndDispose(); - if (config.typedefTypeMappings.containsKey(spelling)) { - _logger.fine(' Type $spelling mapped from type-map'); - return Type.importedType(config.typedefTypeMappings[spelling]!); - } - // Get name from supported typedef name if config allows. - if (config.useSupportedTypedefs) { - if (suportedTypedefToSuportedNativeType.containsKey(spelling)) { - _logger.fine(' Type Mapped from supported typedef'); - return Type.nativeType( - suportedTypedefToSuportedNativeType[spelling]!); - } else if (supportedTypedefToImportedType.containsKey(spelling)) { - _logger.fine(' Type Mapped from supported typedef'); - return Type.importedType(supportedTypedefToImportedType[spelling]!); - } - } - - // This is important or we get stuck in infinite recursion. - final cursor = clang.clang_getTypeDeclaration(cxtype); - final typedefUsr = cursor.usr(); - - if (bindingsIndex.isSeenTypealias(typedefUsr)) { - return Type.typealias(bindingsIndex.getSeenTypealias(typedefUsr)!); - } else { - final typealias = - parseTypedefDeclaration(cursor, pointerReference: pointerReference); - - if (typealias != null) { - return Type.typealias(typealias); - } else { - // Use underlying type if typealias couldn't be created or if - // the user excluded this typedef. - final ct = clang.clang_getTypedefDeclUnderlyingType(cursor); - return getCodeGenType(ct, pointerReference: pointerReference); - } - } - case clang_types.CXTypeKind.CXType_Elaborated: - final et = clang.clang_Type_getNamedType(cxtype); - final s = getCodeGenType(et, pointerReference: pointerReference); - return s; - case clang_types.CXTypeKind.CXType_Record: - return _extractfromRecord(cxtype, pointerReference); - case clang_types.CXTypeKind.CXType_Enum: - final cursor = clang.clang_getTypeDeclaration(cxtype); - final usr = cursor.usr(); - - if (bindingsIndex.isSeenEnumClass(usr)) { - return Type.enumClass(bindingsIndex.getSeenEnumClass(usr)!); - } else { - final enumClass = parseEnumDeclaration( - cursor, - ignoreFilter: true, - ); - if (enumClass == null) { - // Handle anonymous enum declarations within another declaration. - return Type.nativeType(Type.enumNativeType); - } else { - return Type.enumClass(enumClass); - } - } case clang_types.CXTypeKind.CXType_FunctionProto: // Primarily used for function pointers. return _extractFromFunctionProto(cxtype); @@ -141,34 +114,105 @@ Type getCodeGenType( } } -Type _extractfromRecord(clang_types.CXType cxtype, bool pointerReference) { - Type type; +class _CreateTypeFromCursorResult { + final Type? type; - final cursor = clang.clang_getTypeDeclaration(cxtype); + // Flag that controls whether the type is added to the cache. It should not + // be added to the cache if it's just a fallback implementation, such as the + // int that is returned when an enum is excluded by the config. Later we might + // need to build the full enum type (eg if it's part of an included struct), + // and if we put the fallback int in the cache then the full enum will never + // be created. + final bool addToCache; + + _CreateTypeFromCursorResult(this.type, {this.addToCache = true}); +} + +_CreateTypeFromCursorResult _createTypeFromCursor(clang_types.CXType cxtype, + clang_types.CXCursor cursor, bool ignoreFilter, bool pointerReference) { + switch (cxtype.kind) { + case clang_types.CXTypeKind.CXType_Typedef: + final spelling = clang.clang_getTypedefName(cxtype).toStringAndDispose(); + if (config.typedefTypeMappings.containsKey(spelling)) { + _logger.fine(' Type $spelling mapped from type-map'); + return _CreateTypeFromCursorResult( + Type.importedType(config.typedefTypeMappings[spelling]!)); + } + // Get name from supported typedef name if config allows. + if (config.useSupportedTypedefs) { + if (suportedTypedefToSuportedNativeType.containsKey(spelling)) { + _logger.fine(' Type Mapped from supported typedef'); + return _CreateTypeFromCursorResult( + Type.nativeType(suportedTypedefToSuportedNativeType[spelling]!)); + } else if (supportedTypedefToImportedType.containsKey(spelling)) { + _logger.fine(' Type Mapped from supported typedef'); + return _CreateTypeFromCursorResult( + Type.importedType(supportedTypedefToImportedType[spelling]!)); + } + } + + final typealias = + parseTypedefDeclaration(cursor, pointerReference: pointerReference); + + if (typealias != null) { + return _CreateTypeFromCursorResult(Type.typealias(typealias)); + } else { + // Use underlying type if typealias couldn't be created or if the user + // excluded this typedef. + final ct = clang.clang_getTypedefDeclUnderlyingType(cursor); + return _CreateTypeFromCursorResult( + getCodeGenType(ct, pointerReference: pointerReference), + addToCache: false); + } + case clang_types.CXTypeKind.CXType_Record: + return _CreateTypeFromCursorResult( + _extractfromRecord(cxtype, cursor, ignoreFilter, pointerReference)); + case clang_types.CXTypeKind.CXType_Enum: + final enumClass = parseEnumDeclaration( + cursor, + ignoreFilter: ignoreFilter, + ); + if (enumClass == null) { + // Handle anonymous enum declarations within another declaration. + return _CreateTypeFromCursorResult(Type.nativeType(Type.enumNativeType), + addToCache: false); + } else { + return _CreateTypeFromCursorResult(Type.enumClass(enumClass)); + } + default: + throw UnimplementedError( + 'Unknown cursor kind: ${cursor.completeStringRepr()}'); + } +} + +void _fillFromCursorIfNeeded(Type? type, clang_types.CXCursor cursor, + bool ignoreFilter, bool pointerReference) { + if (type == null) return; + if (type.compound != null) { + fillCompoundMembersIfNeeded(type.compound!, cursor, + ignoreFilter: ignoreFilter, pointerReference: pointerReference); + } +} + +Type? _extractfromRecord(clang_types.CXType cxtype, clang_types.CXCursor cursor, + bool ignoreFilter, bool pointerReference) { _logger.fine('${_padding}_extractfromRecord: ${cursor.completeStringRepr()}'); final cursorKind = clang.clang_getCursorKind(cursor); if (cursorKind == clang_types.CXCursorKind.CXCursor_StructDecl || cursorKind == clang_types.CXCursorKind.CXCursor_UnionDecl) { - final declUsr = cursor.usr(); final declSpelling = cursor.spelling(); // Set includer functions according to compoundType. - final bool Function(String) isSeenDecl; - final Compound? Function(String) getSeenDecl; final CompoundType compoundType; final Map compoundTypeMappings; switch (cursorKind) { case clang_types.CXCursorKind.CXCursor_StructDecl: - isSeenDecl = bindingsIndex.isSeenStruct; - getSeenDecl = bindingsIndex.getSeenStruct; compoundType = CompoundType.struct; compoundTypeMappings = config.structTypeMappings; break; case clang_types.CXCursorKind.CXCursor_UnionDecl: - isSeenDecl = bindingsIndex.isSeenUnion; - getSeenDecl = bindingsIndex.getSeenUnion; compoundType = CompoundType.union; compoundTypeMappings = config.unionTypeMappings; break; @@ -181,32 +225,20 @@ Type _extractfromRecord(clang_types.CXType cxtype, bool pointerReference) { if (compoundTypeMappings.containsKey(declSpelling)) { _logger.fine(' Type Mapped from type-map'); return Type.importedType(compoundTypeMappings[declSpelling]!); - } else if (isSeenDecl(declUsr)) { - type = Type.compound(getSeenDecl(declUsr)!); - - // This will parse the dependencies if needed. - parseCompoundDeclaration( - cursor, - compoundType, - ignoreFilter: true, - pointerReference: pointerReference, - ); } else { - final struc = parseCompoundDeclaration( + final struct = parseCompoundDeclaration( cursor, compoundType, - ignoreFilter: true, + ignoreFilter: ignoreFilter, pointerReference: pointerReference, ); - type = Type.compound(struc!); + if (struct == null) return null; + return Type.compound(struct); } - } else { - _logger.fine( - 'typedeclarationCursorVisitor: _extractfromRecord: Not Implemented, ${cursor.completeStringRepr()}'); - return Type.unimplemented('Type: ${cxtype.kindSpelling()} not implemented'); } - - return type; + _logger.fine( + 'typedeclarationCursorVisitor: _extractfromRecord: Not Implemented, ${cursor.completeStringRepr()}'); + return Type.unimplemented('Type: ${cxtype.kindSpelling()} not implemented'); } // Used for function pointer arguments. diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index bac2eaf598..b110134592 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -89,14 +89,14 @@ extension CXCursorExt on clang_types.CXCursor { return s; } - /// Dispose type using [type.dispose]. + /// Type associated with the pointer if any. Type will have kind + /// [clang.CXTypeKind.CXType_Invalid] otherwise. clang_types.CXType type() { return clang.clang_getCursorType(this); } - /// Only valid for [clang.CXCursorKind.CXCursor_FunctionDecl]. - /// - /// Dispose type using [type.dispose]. + /// Only valid for [clang.CXCursorKind.CXCursor_FunctionDecl]. Type will have + /// kind [clang.CXTypeKind.CXType_Invalid] otherwise. clang_types.CXType returnType() { return clang.clang_getResultType(type()); } @@ -329,134 +329,42 @@ class Macro { /// Tracks if a binding is 'seen' or not. class BindingsIndex { // Tracks if bindings are already seen, Map key is USR obtained from libclang. - final Map _structs = {}; - final Map _unions = {}; + final Map _declaredTypes = {}; final Map _functions = {}; - final Map _enumClass = {}; final Map _unnamedEnumConstants = {}; final Map _macros = {}; final Map _globals = {}; /// Contains usr for typedefs which cannot be generated. final Set _unsupportedTypealiases = {}; - final Map _typealiases = {}; /// Index for headers. final Map _headerCache = {}; - bool isSeenStruct(String usr) { - return _structs.containsKey(usr); - } - - void addStructToSeen(String usr, Compound struc) { - _structs[usr] = struc as Struc; - } - - Struc? getSeenStruct(String usr) { - return _structs[usr]; - } - - bool isSeenUnion(String usr) { - return _unions.containsKey(usr); - } - - void addUnionToSeen(String usr, Compound union) { - _unions[usr] = union as Union; - } - - Union? getSeenUnion(String usr) { - return _unions[usr]; - } - - bool isSeenFunc(String usr) { - return _functions.containsKey(usr); - } - - void addFuncToSeen(String usr, Func func) { - _functions[usr] = func; - } - - Func? getSeenFunc(String usr) { - return _functions[usr]; - } - - bool isSeenEnumClass(String usr) { - return _enumClass.containsKey(usr); - } - - void addEnumClassToSeen(String usr, EnumClass enumClass) { - _enumClass[usr] = enumClass; - } - - EnumClass? getSeenEnumClass(String usr) { - return _enumClass[usr]; - } - - bool isSeenUnnamedEnumConstant(String usr) { - return _unnamedEnumConstants.containsKey(usr); - } - - void addUnnamedEnumConstantToSeen(String usr, Constant enumConstant) { - _unnamedEnumConstants[usr] = enumConstant; - } - - Constant? getSeenUnnamedEnumConstant(String usr) { - return _unnamedEnumConstants[usr]; - } - - bool isSeenGlobalVar(String usr) { - return _globals.containsKey(usr); - } - - void addGlobalVarToSeen(String usr, Global global) { - _globals[usr] = global; - } - - Global? getSeenGlobalVar(String usr) { - return _globals[usr]; - } - - bool isSeenMacro(String usr) { - return _macros.containsKey(usr); - } - - void addMacroToSeen(String usr, String macro) { - _macros[usr] = macro; - } - - String? getSeenMacro(String usr) { - return _macros[usr]; - } - - bool isSeenTypealias(String usr) { - return _typealiases.containsKey(usr); - } - - void addTypealiasToSeen(String usr, Typealias t) { - _typealiases[usr] = t; - } - - bool isSeenUnsupportedTypealias(String usr) { - return _unsupportedTypealiases.contains(usr); - } - - void addUnsupportedTypealiasToSeen(String usr) { - _unsupportedTypealiases.add(usr); - } - - Typealias? getSeenTypealias(String usr) { - return _typealiases[usr]; - } - - bool isSeenHeader(String source) { - return _headerCache.containsKey(source); - } - - void addHeaderToSeen(String source, bool includeStatus) { - _headerCache[source] = includeStatus; - } - - bool? getSeenHeaderStatus(String source) { - return _headerCache[source]; - } + bool isSeenType(String usr) => _declaredTypes.containsKey(usr); + void addTypeToSeen(String usr, Type type) => _declaredTypes[usr] = type; + Type? getSeenType(String usr) => _declaredTypes[usr]; + bool isSeenFunc(String usr) => _functions.containsKey(usr); + void addFuncToSeen(String usr, Func func) => _functions[usr] = func; + Func? getSeenFunc(String usr) => _functions[usr]; + bool isSeenUnnamedEnumConstant(String usr) => + _unnamedEnumConstants.containsKey(usr); + void addUnnamedEnumConstantToSeen(String usr, Constant enumConstant) => + _unnamedEnumConstants[usr] = enumConstant; + Constant? getSeenUnnamedEnumConstant(String usr) => + _unnamedEnumConstants[usr]; + bool isSeenGlobalVar(String usr) => _globals.containsKey(usr); + void addGlobalVarToSeen(String usr, Global global) => _globals[usr] = global; + Global? getSeenGlobalVar(String usr) => _globals[usr]; + bool isSeenMacro(String usr) => _macros.containsKey(usr); + void addMacroToSeen(String usr, String macro) => _macros[usr] = macro; + String? getSeenMacro(String usr) => _macros[usr]; + bool isSeenUnsupportedTypealias(String usr) => + _unsupportedTypealiases.contains(usr); + void addUnsupportedTypealiasToSeen(String usr) => + _unsupportedTypealiases.add(usr); + bool isSeenHeader(String source) => _headerCache.containsKey(source); + void addHeaderToSeen(String source, bool includeStatus) => + _headerCache[source] = includeStatus; + bool? getSeenHeaderStatus(String source) => _headerCache[source]; } diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index cbfc6105ce..58e9b5dbc1 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -178,6 +178,8 @@ const linuxDylibLocations = { '/usr/lib/llvm-9/lib/', '/usr/lib/llvm-10/lib/', '/usr/lib/llvm-11/lib/', + '/usr/lib/llvm-12/lib/', + '/usr/lib/llvm-13/lib/', '/usr/lib/', '/usr/lib64/', }; From f2a923981e9f4219606bc1da18ac99304ce82e98 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Fri, 18 Mar 2022 11:34:06 -0700 Subject: [PATCH 103/276] [ffigen] First bits of Objective C support (#281) --- .../lib/src/code_generator/imports.dart | 5 ++ .../lib/src/config_provider/config.dart | 14 ++++- .../lib/src/config_provider/config_types.dart | 2 + .../lib/src/config_provider/spec_utils.dart | 22 ++++++++ .../lib/src/header_parser/includer.dart | 8 +++ pkgs/ffigen/lib/src/header_parser/parser.dart | 22 +++++--- .../type_extractor/extractor.dart | 15 ++++++ pkgs/ffigen/lib/src/strings.dart | 13 +++++ .../_expected_objc_basic_types_bindings.dart | 30 +++++++++++ .../header_parser_tests/objc_basic_types.h | 8 +++ .../objc_basic_types_test.dart | 51 +++++++++++++++++++ 11 files changed, 183 insertions(+), 7 deletions(-) create mode 100644 pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/objc_basic_types.h create mode 100644 pkgs/ffigen/test/header_parser_tests/objc_basic_types_test.dart diff --git a/pkgs/ffigen/lib/src/code_generator/imports.dart b/pkgs/ffigen/lib/src/code_generator/imports.dart index ab5e6c05e2..e62062641e 100644 --- a/pkgs/ffigen/lib/src/code_generator/imports.dart +++ b/pkgs/ffigen/lib/src/code_generator/imports.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'struc.dart'; + /// A library import which will be written as an import in the generated file. class LibraryImport { final String name; @@ -51,3 +53,6 @@ final doubleType = ImportedType(ffiImport, 'Double', 'double'); final sizeType = ImportedType(ffiPkgImport, 'Size', 'int'); final wCharType = ImportedType(ffiPkgImport, 'WChar', 'int'); + +final objCObjectType = Struc(name: 'ObjCObject'); +final objCSelType = Struc(name: 'ObjCSel'); diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 7acb2c8892..29673a6629 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -23,9 +23,14 @@ class Config { String get libclangDylib => _libclangDylib; late String _libclangDylib; - /// output file name. + /// Output file name. String get output => _output; late String _output; + + /// Language that ffigen is consuming. + Language get language => _language; + late Language _language; + // Holds headers and filters for header. Headers get headers => _headers; late Headers _headers; @@ -220,6 +225,13 @@ class Config { extractor: outputExtractor, extractedResult: (dynamic result) => _output = result as String, ), + [strings.language]: Specification( + requirement: Requirement.no, + validator: languageValidator, + extractor: languageExtractor, + defaultValue: () => Language.c, + extractedResult: (dynamic result) => _language = result as Language, + ), [strings.headers]: Specification( requirement: Requirement.yes, validator: headersValidator, diff --git a/pkgs/ffigen/lib/src/config_provider/config_types.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart index d9730135c5..1f0c7a68cf 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_types.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart @@ -9,6 +9,8 @@ import 'package:quiver/pattern.dart' as quiver; import 'path_finder.dart'; +enum Language { c, objc } + class CommentType { CommentStyle style; CommentLength length; diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index e5f0f41b1c..aff84b2db5 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -453,6 +453,28 @@ String outputExtractor(dynamic value) => _replaceSeparators(value as String); bool outputValidator(List name, dynamic value) => checkType(name, value); +Language languageExtractor(dynamic value) { + if (value == strings.langC) { + return Language.c; + } else if (value == strings.langObjC) { + return Language.objc; + } + return Language.c; +} + +bool languageValidator(List name, dynamic value) { + if (value is String) { + if (value == strings.langC || value == strings.langObjC) { + return true; + } + _logger.severe("'$name' must be one of the following - " + "{${strings.langC}, ${strings.langObjC}}"); + return false; + } + _logger.severe("Expected value of key '$name' to be a String."); + return false; +} + /// Returns true if [str] is not a full name. /// /// E.g `abc` is a full name, `abc.*` is not. diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart index aaad6939e6..0b3505b7a8 100644 --- a/pkgs/ffigen/lib/src/header_parser/includer.dart +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -5,6 +5,8 @@ /// Utility functions to check whether a binding should be parsed or not /// based on filters. +import '../config_provider/config_types.dart'; +import '../strings.dart' as strings; import 'data.dart'; bool _shouldIncludeDecl(String usr, String name, @@ -66,6 +68,12 @@ bool shouldIncludeRootCursor(String sourceFile) { return false; } + // Objective C has some extra system headers that have a non-empty sourceFile. + if (config.language == Language.objc && + sourceFile.startsWith(strings.clangDefaultObjCSystemHeaderPath)) { + return false; + } + // Add header to seen if it's not. if (!bindingsIndex.isSeenHeader(sourceFile)) { bindingsIndex.addHeaderToSeen( diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index ffcfc8f187..33c707286b 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -56,17 +56,27 @@ List parseToBindings() { final index = clang.clang_createIndex(0, 0); Pointer> clangCmdArgs = nullptr; - var cmdLen = 0; + final compilerOpts = List.from(config.compilerOpts); /// Add compiler opt for comment parsing for clang based on config. if (config.commentType.length != CommentLength.none && config.commentType.style == CommentStyle.any) { - config.compilerOpts.add(strings.fparseAllComments); + compilerOpts.add(strings.fparseAllComments); } - _logger.fine('CompilerOpts used: ${config.compilerOpts}'); - clangCmdArgs = createDynamicStringArray(config.compilerOpts); - cmdLen = config.compilerOpts.length; + /// If the config targets Objective C, add a compiler opt for it. + if (config.language == Language.objc) { + compilerOpts.addAll(strings.clangLangObjC); + compilerOpts.add('-I' + strings.clangDefaultObjCSystemHeaderPath); + for (final sysHdr in strings.clangDefaultObjCSystemHeaders) { + compilerOpts.add(strings.clangInclude); + compilerOpts.add(sysHdr); + } + } + + _logger.fine('CompilerOpts used: $compilerOpts'); + clangCmdArgs = createDynamicStringArray(compilerOpts); + final cmdLen = compilerOpts.length; // Contains all bindings. A set ensures we never have duplicates. final bindings = {}; @@ -111,7 +121,7 @@ List parseToBindings() { // Parse all saved macros. bindings.addAll(parseSavedMacros()!); - clangCmdArgs.dispose(config.compilerOpts.length); + clangCmdArgs.dispose(cmdLen); clang.clang_disposeIndex(index); return bindings.toList(); } diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 8ea5d96649..3c2f2dc388 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -8,6 +8,7 @@ import 'package:ffigen/src/header_parser/sub_parsers/typedefdecl_parser.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; +import '../../config_provider/config_types.dart'; import '../clang_bindings/clang_bindings.dart' as clang_types; import '../data.dart'; import '../sub_parsers/compounddecl_parser.dart'; @@ -37,6 +38,20 @@ Type getCodeGenType( ignoreFilter: ignoreFilter, pointerReference: pointerReference); } + // Objective C types skip the cache, and are conditional on the language flag. + if (config.language == Language.objc) { + switch (cxtype.kind) { + case clang_types.CXTypeKind.CXType_ObjCObjectPointer: + case clang_types.CXTypeKind.CXType_BlockPointer: + case clang_types.CXTypeKind.CXType_ObjCId: + return Type.pointer(Type.struct(objCObjectType)); + case clang_types.CXTypeKind.CXType_ObjCSel: + return Type.pointer(Type.struct(objCSelType)); + case clang_types.CXTypeKind.CXType_ObjCClass: + return Type.struct(objCObjectType); + } + } + // If the type has a declaration cursor, then use the BindingsIndex to break // any potential cycles, and dedupe the Type. final cursor = clang.clang_getTypeDeclaration(cxtype); diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 58e9b5dbc1..2e57de7fa2 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -29,6 +29,19 @@ String get dynamicLibParentName => Platform.isWindows ? 'bin' : 'lib'; const output = 'output'; +const language = 'language'; + +// String mappings for the Language enum. +const langC = 'c'; +const langObjC = 'objc'; + +// Clang command line args for Objective C. +const clangLangObjC = ['-x', 'objective-c']; +const clangInclude = '-include'; +const clangDefaultObjCSystemHeaderPath = + '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include'; +const clangDefaultObjCSystemHeaders = ['objc/NSObject.h']; + const headers = 'headers'; // Sub-fields of headers diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart new file mode 100644 index 0000000000..5cd80967a7 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart @@ -0,0 +1,30 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; + +class Foo extends ffi.Struct { + @BOOL() + external int someBool; + + external ffi.Pointer anId; + + external ffi.Pointer selector; + + external ffi.Pointer object; + + external ffi.Pointer clazz; + + external ffi.Pointer blockThatReturnsAnInt; +} + +typedef BOOL = pkg_ffi.SignedChar; + +class ObjCObject extends ffi.Opaque {} + +class ObjCSel extends ffi.Opaque {} + +const int true1 = 1; + +const int false1 = 0; diff --git a/pkgs/ffigen/test/header_parser_tests/objc_basic_types.h b/pkgs/ffigen/test/header_parser_tests/objc_basic_types.h new file mode 100644 index 0000000000..a2f7fc9975 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/objc_basic_types.h @@ -0,0 +1,8 @@ +struct Foo { + BOOL someBool; + id anId; + SEL selector; + NSObject* object; + Class* clazz; + int32_t (^blockThatReturnsAnInt)(void); +}; diff --git a/pkgs/ffigen/test/header_parser_tests/objc_basic_types_test.dart b/pkgs/ffigen/test/header_parser_tests/objc_basic_types_test.dart new file mode 100644 index 0000000000..8ee93f47c4 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/objc_basic_types_test.dart @@ -0,0 +1,51 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; + +import '../test_utils.dart'; + +late Library actual; +void main() { + group('objc_basic_types_test', () { + setUpAll(() { + logWarnings(Level.SEVERE); + actual = parser.parse( + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Opaque Dependencies Test' +${strings.output}: 'unused' +${strings.language}: '${strings.langObjC}' +${strings.headers}: + ${strings.entryPoints}: + - 'test/header_parser_tests/objc_basic_types.h' +${strings.structs}: + ${strings.include}: + - 'Foo' + ''') as yaml.YamlMap), + ); + }); + test('Expected bindings', () { + matchLibraryWithExpected(actual, [ + 'test', + 'debug_generated', + 'header_parser_objc_basic_types_test_output.dart' + ], [ + 'test', + 'header_parser_tests', + 'expected_bindings', + '_expected_objc_basic_types_bindings.dart' + ]); + }); + }); +} From 793585f881bba3fcdbf0ecefcab36e9cbdc4a2f3 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Sat, 26 Mar 2022 00:49:32 -0700 Subject: [PATCH 104/276] [ffigen] Test on mac, to cover objective C (#289) --- .../ffigen/.github/workflows/test-package.yml | 22 +++++++++++++++++++ .../lib/src/header_parser/includer.dart | 3 ++- pkgs/ffigen/lib/src/strings.dart | 8 +++++++ .../_expected_objc_basic_types_bindings.dart | 4 ---- 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 8da431dfcc..67a6c954e0 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -59,3 +59,25 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: lcov.info + + mac-test: + needs: analyze + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - uses: dart-lang/setup-dart@v1.0 + with: + sdk: stable + - name: Install dependencies + run: dart pub get + - name: Build test dylib + run: cd test/native_test && dart build_test_dylib.dart && cd ../.. + - name: Run VM tests + run: dart test --platform vm + - name: Collect coverage + run: ./tool/coverage.sh + - name: Upload coverage + uses: coverallsapp/github-action@v1.1.2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: lcov.info diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart index 0b3505b7a8..4f3bbbfd6f 100644 --- a/pkgs/ffigen/lib/src/header_parser/includer.dart +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -70,7 +70,8 @@ bool shouldIncludeRootCursor(String sourceFile) { // Objective C has some extra system headers that have a non-empty sourceFile. if (config.language == Language.objc && - sourceFile.startsWith(strings.clangDefaultObjCSystemHeaderPath)) { + strings.objCInternalDirectories + .any((path) => sourceFile.startsWith(path))) { return false; } diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 2e57de7fa2..2140572551 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -42,6 +42,14 @@ const clangDefaultObjCSystemHeaderPath = '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include'; const clangDefaultObjCSystemHeaders = ['objc/NSObject.h']; +// Internal objective C directories that are automatically pulled in by clang, +// and should be excluded from output (unless explicitly used). +const objCInternalDirectories = [ + clangDefaultObjCSystemHeaderPath, + '/Applications/Xcode.app/Contents/Developer', + '/usr/local/opt/llvm/lib', +]; + const headers = 'headers'; // Sub-fields of headers diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart index 5cd80967a7..8fe008bc9c 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart @@ -24,7 +24,3 @@ typedef BOOL = pkg_ffi.SignedChar; class ObjCObject extends ffi.Opaque {} class ObjCSel extends ffi.Opaque {} - -const int true1 = 1; - -const int false1 = 0; From 730572f88cb36c199a340d7b0dcdd0d428c41713 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 6 Apr 2022 01:14:25 -0700 Subject: [PATCH 105/276] [ffigen] Objective C interfaces (#287) --- pkgs/ffigen/lib/src/code_generator.dart | 1 + .../src/code_generator/binding_string.dart | 1 + .../lib/src/code_generator/dart_keywords.dart | 89 +- .../src/code_generator/objc_interface.dart | 380 ++++++++ pkgs/ffigen/lib/src/code_generator/type.dart | 39 +- .../ffigen/lib/src/code_generator/writer.dart | 10 + .../lib/src/config_provider/config_types.dart | 1 + .../clang_bindings/clang_bindings.dart | 52 ++ .../lib/src/header_parser/includer.dart | 5 + .../sub_parsers/objcinterfacedecl_parser.dart | 190 ++++ .../translation_unit_parser.dart | 3 + .../type_extractor/extractor.dart | 15 +- .../_expected_objc_interface_bindings.dart | 852 ++++++++++++++++++ .../header_parser_tests/objc_basic_types.h | 2 +- .../objc_basic_types_test.dart | 2 +- .../test/header_parser_tests/objc_interface.h | 16 + .../objc_interface_test.dart | 48 + pkgs/ffigen/tool/libclang_config.yaml | 3 + 18 files changed, 1648 insertions(+), 61 deletions(-) create mode 100644 pkgs/ffigen/lib/src/code_generator/objc_interface.dart create mode 100644 pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/objc_interface.h create mode 100644 pkgs/ffigen/test/header_parser_tests/objc_interface_test.dart diff --git a/pkgs/ffigen/lib/src/code_generator.dart b/pkgs/ffigen/lib/src/code_generator.dart index 0e175e68d8..6944957c70 100644 --- a/pkgs/ffigen/lib/src/code_generator.dart +++ b/pkgs/ffigen/lib/src/code_generator.dart @@ -13,6 +13,7 @@ export 'code_generator/func.dart'; export 'code_generator/global.dart'; export 'code_generator/imports.dart'; export 'code_generator/library.dart'; +export 'code_generator/objc_interface.dart'; export 'code_generator/struc.dart'; export 'code_generator/type.dart'; export 'code_generator/typealias.dart'; diff --git a/pkgs/ffigen/lib/src/code_generator/binding_string.dart b/pkgs/ffigen/lib/src/code_generator/binding_string.dart index 2929ee8765..031bf5a674 100644 --- a/pkgs/ffigen/lib/src/code_generator/binding_string.dart +++ b/pkgs/ffigen/lib/src/code_generator/binding_string.dart @@ -23,4 +23,5 @@ enum BindingStringType { global, enumClass, typeDef, + objcInterface, } diff --git a/pkgs/ffigen/lib/src/code_generator/dart_keywords.dart b/pkgs/ffigen/lib/src/code_generator/dart_keywords.dart index 8e0de3c22a..93d5877ad7 100644 --- a/pkgs/ffigen/lib/src/code_generator/dart_keywords.dart +++ b/pkgs/ffigen/lib/src/code_generator/dart_keywords.dart @@ -7,65 +7,66 @@ /// Source: https://dart.dev/guides/language/language-tour#keywords. const keywords = { 'abstract', - 'else', - 'import', - 'super', 'as', - 'enum', - 'in', - 'switch', 'assert', - 'export', - 'interface', - 'sync', 'async', - 'extends', - 'is', - 'this', 'await', - 'extension', - 'library', - 'throw', 'break', - 'external', - 'mixin', - 'true', 'case', - 'factory', - 'new', - 'try', 'catch', - 'false', - 'null', - 'typedef', 'class', - 'final', - 'on', - 'var', 'const', - 'finally', - 'operator', - 'void', 'continue', - 'for', - 'part', - 'while', 'covariant', - 'Function', - 'rethrow', - 'with', 'default', - 'get', - 'return', - 'yield', 'deferred', - 'hide', - 'set', 'do', - 'if', - 'show', 'dynamic', + 'else', + 'enum', + 'export', + 'extends', + 'extension', + 'external', + 'factory', + 'false', + 'final', + 'finally', + 'for', + 'Function', + 'get', + 'hide', + 'if', 'implements', - 'static', + 'import', + 'in', + 'interface', + 'is', 'late', + 'library', + 'mixin', + 'new', + 'null', + 'on', + 'operator', + 'part', + 'required', + 'rethrow', + 'return', + 'set', + 'show', + 'static', + 'super', + 'switch', + 'sync', + 'this', + 'throw', + 'true', + 'try', + 'typedef', + 'var', + 'void', + 'while', + 'with', + 'yield', }; diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart new file mode 100644 index 0000000000..de76111a8d --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -0,0 +1,380 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; + +import 'binding_string.dart'; +import 'utils.dart'; +import 'writer.dart'; + +// Class methods defined on NSObject that we don't want to copy to child objects +// by default. +const _excludedNSObjectClassMethods = { + 'allocWithZone:', + 'copyWithZone:', + 'mutableCopyWithZone:', + 'instancesRespondToSelector:', + 'conformsToProtocol:', + 'instanceMethodForSelector:', + 'instanceMethodSignatureForSelector:', + 'isSubclassOfClass:', + 'resolveClassMethod:', + 'resolveInstanceMethod:', + 'hash', + 'superclass', + 'class', + 'description', + 'debugDescription', +}; + +class _ObjCBuiltInFunctions { + late final _registerNameFunc = Func( + name: '_sel_registerName', + originalName: 'sel_registerName', + returnType: Type.pointer(Type.struct(objCSelType)), + parameters: [ + Parameter(name: 'str', type: Type.pointer(Type.importedType(charType))) + ], + ); + late final String registerName; + + late final _getClassFunc = Func( + name: '_objc_getClass', + originalName: 'objc_getClass', + returnType: Type.pointer(Type.struct(objCObjectType)), + parameters: [ + Parameter(name: 'str', type: Type.pointer(Type.importedType(charType))) + ], + ); + late final String getClass; + + // We need to load a separate instance of objc_msgSend for each signature. + final _msgSendFuncs = {}; + Func getMsgSendFunc(Type returnType, List params) { + // TODO(#279): These keys don't dedupe sufficiently. + var key = returnType.hashCode.toRadixString(36); + for (final p in params) { + key += ' ' + p.type.hashCode.toRadixString(36); + } + _msgSendFuncs[key] ??= Func( + name: '_objc_msgSend_${_msgSendFuncs.length}', + originalName: 'objc_msgSend', + returnType: returnType, + parameters: [ + Parameter(name: 'obj', type: Type.pointer(Type.struct(objCObjectType))), + Parameter(name: 'sel', type: Type.pointer(Type.struct(objCSelType))), + for (final p in params) Parameter(name: p.name, type: p.type.type), + ], + ); + return _msgSendFuncs[key]!; + } + + bool utilsExist = false; + void ensureUtilsExist(Writer w, StringBuffer s) { + if (utilsExist) return; + utilsExist = true; + + registerName = w.topLevelUniqueNamer.makeUnique('_registerName'); + final selType = _registerNameFunc.functionType.returnType.getCType(w); + s.write('\n$selType $registerName(${w.className} _lib, String name) {\n'); + s.write(' final cstr = name.toNativeUtf8();\n'); + s.write(' final sel = _lib.${_registerNameFunc.name}(cstr.cast());\n'); + s.write(' ${w.ffiPkgLibraryPrefix}.calloc.free(cstr);\n'); + s.write(' return sel;\n'); + s.write('}\n'); + + getClass = w.topLevelUniqueNamer.makeUnique('_getClass'); + final objType = _getClassFunc.functionType.returnType.getCType(w); + s.write('\n$objType $getClass(${w.className} _lib, String name) {\n'); + s.write(' final cstr = name.toNativeUtf8();\n'); + s.write(' final clazz = _lib.${_getClassFunc.name}(cstr.cast());\n'); + s.write(' ${w.ffiPkgLibraryPrefix}.calloc.free(cstr);\n'); + s.write(' return clazz;\n'); + s.write('}\n'); + + s.write('\nclass _ObjCWrapper {\n'); + s.write(' final $objType _id;\n'); + s.write(' final ${w.className} _lib;\n'); + s.write(' _ObjCWrapper._(this._id, this._lib);\n'); + s.write('}\n'); + } + + void addDependencies(Set dependencies) { + _registerNameFunc.addDependencies(dependencies); + _getClassFunc.addDependencies(dependencies); + for (final func in _msgSendFuncs.values) { + func.addDependencies(dependencies); + } + } +} + +final _builtInFunctions = _ObjCBuiltInFunctions(); + +class ObjCInterface extends NoLookUpBinding { + ObjCInterface? superType; + final methods = []; + bool filled = false; + + // Objective C supports overriding class methods, but Dart doesn't support + // overriding static methods. So in our generated Dart code, child classes + // must explicitly implement all the class methods of their super type. To + // help with this, we store the class methods in this map, as well as in the + // methods list. + final classMethods = {}; + + ObjCInterface({ + String? usr, + required String originalName, + required String name, + String? dartDoc, + }) : super( + usr: usr, + originalName: originalName, + name: name, + dartDoc: dartDoc, + ); + + @override + BindingString toBindingString(Writer w) { + final s = StringBuffer(); + if (dartDoc != null) { + s.write(makeDartDoc(dartDoc!)); + } + + final uniqueNamer = UniqueNamer({name}); + final natLib = w.className; + + _builtInFunctions.ensureUtilsExist(w, s); + final objType = Type.pointer(Type.struct(objCObjectType)).getCType(w); + final selType = Type.pointer(Type.struct(objCSelType)).getCType(w); + + // Class declaration. + s.write('class $name '); + uniqueNamer.markUsed('_id'); + s.write('extends ${superType?.name ?? '_ObjCWrapper'} {\n'); + s.write(' $name._($objType id, $natLib lib) : super._(id, lib);\n\n'); + + // Class object, used to call static methods. + final classObject = uniqueNamer.makeUnique('_class'); + s.write(' static $objType? $classObject;\n\n'); + + // Cast method. + s.write(' static $name castFrom(T other) {\n'); + s.write(' return $name._(other._id, other._lib);\n'); + s.write(' }\n\n'); + + // Methods. + for (final m in methods) { + final methodName = m._getDartMethodName(uniqueNamer); + final selName = uniqueNamer.makeUnique('_sel_$methodName'); + final isStatic = m.kind == ObjCMethodKind.classMethod; + + // SEL object for the method. + s.write(' static $selType? $selName;'); + + // The method declaration. + if (m.dartDoc != null) { + s.write(makeDartDoc(m.dartDoc!)); + } + s.write(' '); + if (isStatic) s.write('static '); + s.write('${m.returnType!.getConvertedType(w, name)} '); + if (m.kind == ObjCMethodKind.propertyGetter) s.write('get '); + if (m.kind == ObjCMethodKind.propertySetter) s.write('set '); + s.write(methodName); + if (m.kind != ObjCMethodKind.propertyGetter) { + s.write('('); + var first = true; + if (isStatic) { + first = false; + s.write('$natLib _lib'); + } + for (final p in m.params) { + if (first) { + first = false; + } else { + s.write(', '); + } + s.write('${p.type.getConvertedType(w, name)} ${p.name}'); + } + s.write(')'); + } + s.write(' {\n'); + + // Implementation. + if (isStatic) { + s.write(' $classObject ??= ' + '${_builtInFunctions.getClass}(_lib, "$originalName");\n'); + } + s.write(' $selName ??= ' + '${_builtInFunctions.registerName}(_lib, "${m.originalName}");\n'); + final convertReturn = m.returnType!.needsConverting; + s.write(' ${convertReturn ? 'final _ret = ' : 'return '}'); + s.write('_lib.${m.msgSend!.name}('); + s.write(isStatic ? '_class!' : '_id'); + s.write(', $selName!'); + for (final p in m.params) { + s.write(', ${p.type.doArgConversion(p.name)}'); + } + s.write(');\n'); + if (convertReturn) { + final result = m.returnType!.doReturnConversion('_ret', name, '_lib'); + s.write(' return $result;'); + } + + s.write(' }\n\n'); + } + + s.write('}\n\n'); + + return BindingString( + type: BindingStringType.objcInterface, string: s.toString()); + } + + @override + void addDependencies(Set dependencies) { + if (dependencies.contains(this)) return; + dependencies.add(this); + + if (superType != null) { + superType!.addDependencies(dependencies); + // Copy class methods from the super type, because Dart classes don't + // inherit static methods. + for (final m in superType!.classMethods.values) { + if (!_excludedNSObjectClassMethods.contains(m.originalName)) { + addMethod(m); + } + } + } + + for (final m in methods) { + m.addDependencies(dependencies); + } + + _builtInFunctions.addDependencies(dependencies); + } + + void addMethod(ObjCMethod method) { + methods.add(method); + if (method.kind == ObjCMethodKind.classMethod) { + classMethods[method.originalName] ??= method; + } + } +} + +enum ObjCMethodKind { + instanceMethod, + classMethod, + propertyGetter, + propertySetter, +} + +class ObjCProperty { + final String originalName; + String? dartName; + ObjCProperty(this.originalName); +} + +class ObjCMethod { + final String? dartDoc; + final String originalName; + final ObjCProperty? property; + ObjCMethodType? returnType; + final params = []; + final ObjCMethodKind kind; + Func? msgSend; + + ObjCMethod({ + required this.originalName, + this.property, + this.dartDoc, + required this.kind, + }); + + void addDependencies(Set dependencies) { + returnType!.type.addDependencies(dependencies); + for (final p in params) { + p.type.type.addDependencies(dependencies); + } + msgSend = _builtInFunctions.getMsgSendFunc(returnType!.type, params); + } + + String _getDartMethodName(UniqueNamer uniqueNamer) { + if (property != null) { + // A getter and a setter are allowed to have the same name, so we can't + // just run the name through uniqueNamer. Instead they need to share + // the dartName, which is run through uniqueNamer. + if (property!.dartName == null) { + property!.dartName = uniqueNamer.makeUnique(property!.originalName); + } + return property!.dartName!; + } + // Objective C methods can look like: + // foo + // foo: + // foo:someArgName: + // If there is a trailing ':', omit it. Replace all other ':' with '_'. + var name = originalName; + final index = name.indexOf(':'); + if (index != -1) name = name.substring(0, index); + return uniqueNamer.makeUnique(name.replaceAll(':', '_')); + } +} + +class ObjCMethodParam { + final ObjCMethodType type; + final String name; + ObjCMethodParam(Type t, this.name) : type = ObjCMethodType(t); +} + +// Wrapper around Type with helper methods for converting between the internal +// types passed to native code, and the external types visible to the user. For +// example, ObjCInterfaces are passed to native as Pointer, but the +// user sees the Dart wrapper class. +class ObjCMethodType { + final Type type; + ObjCMethodType(this.type); + + bool get isObject { + if (type.broadType != BroadType.Pointer) return false; + final child = type.child!; + if (child.broadType != BroadType.Compound) return false; + return child.compound == objCObjectType; + } + + bool get isInstanceType { + if (type.broadType != BroadType.Typealias) return false; + final alias = type.typealias!; + if (alias.name != 'instancetype') return false; + return ObjCMethodType(alias.type).isObject; + } + + bool get isInterface => type.broadType == BroadType.ObjCInterface; + bool get isBool => type.broadType == BroadType.Boolean; + bool get needsConverting => + isInterface || isBool || isObject || isInstanceType; + + String getConvertedType(Writer w, String enclosingClass) { + if (isBool) return 'bool'; + if (isInterface) return type.objCInterface!.name; + if (isObject) return 'NSObject'; + if (isInstanceType) return enclosingClass; + return type.getDartType(w); + } + + String doArgConversion(String value) { + if (isBool) return '$value ? 1 : 0'; + if (isInterface || isObject || isInstanceType) return '$value._id'; + return value; + } + + String doReturnConversion( + String value, String enclosingClass, String library) { + if (isBool) return '$value != 0'; + if (isInterface) return '${type.objCInterface!.name}._($value, $library)'; + if (isObject) return 'NSObject._($value, $library)'; + if (isInstanceType) return '$enclosingClass._($value, $library)'; + return value; + } +} diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index b70b4ecddb..a708167e72 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -55,6 +55,9 @@ enum BroadType { ConstantArray, IncompleteArray, + /// Represents an Objective C interface. + ObjCInterface, + /// Used as a marker, so that declarations having these can exclude them. Unimplemented, } @@ -98,6 +101,9 @@ class Type { /// Reference to the [ImportedType] this type refers to. ImportedType? importedType; + /// Reference to the [ObjCInterface] this type refers to. + ObjCInterface? objCInterface; + /// For providing [SupportedNativeType] only. final SupportedNativeType? nativeType; @@ -123,6 +129,7 @@ class Type { this.typealias, this.functionType, this.importedType, + this.objCInterface, this.length, this.unimplementedReason, }); @@ -184,6 +191,10 @@ class Type { factory Type.handle() { return Type._(broadType: BroadType.Handle); } + factory Type.objCInterface(ObjCInterface objCInterface) { + return Type._( + broadType: BroadType.ObjCInterface, objCInterface: objCInterface); + } /// Get all dependencies of this type and save them in [dependencies]. void addDependencies(Set dependencies) { @@ -198,6 +209,8 @@ class Type { return typealias!.addDependencies(dependencies); case BroadType.Enum: return enumClass!.addDependencies(dependencies); + case BroadType.ObjCInterface: + return objCInterface!.addDependencies(dependencies); default: if (child != null) { return child!.addDependencies(dependencies); @@ -269,13 +282,14 @@ class Type { return '${w.ffiLibraryPrefix}.${_primitives[enumNativeType]!.c}'; case BroadType.NativeFunction: return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFunc!.type.getCType(w)}>'; - case BroadType - .IncompleteArray: // Array parameters are treated as Pointers in C. + case BroadType.IncompleteArray: + // Array parameters are treated as Pointers in C. return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; - case BroadType - .ConstantArray: // Array parameters are treated as Pointers in C. + case BroadType.ConstantArray: + // Array parameters are treated as Pointers in C. return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; - case BroadType.Boolean: // Booleans are treated as uint8. + case BroadType.Boolean: + // Booleans are treated as uint8. return '${w.ffiLibraryPrefix}.${_primitives[SupportedNativeType.Uint8]!.c}'; case BroadType.Handle: return '${w.ffiLibraryPrefix}.Handle'; @@ -283,6 +297,8 @@ class Type { return functionType!.getCType(w); case BroadType.ImportedType: return '${importedType!.libraryImport.prefix}.${importedType!.cType}'; + case BroadType.ObjCInterface: + return Type.pointer(Type.struct(objCObjectType)).getCType(w); case BroadType.Typealias: return typealias!.name; case BroadType.Unimplemented: @@ -302,13 +318,14 @@ class Type { return _primitives[enumNativeType]!.dart; case BroadType.NativeFunction: return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFunc!.type.getDartType(w)}>'; - case BroadType - .IncompleteArray: // Array parameters are treated as Pointers in C. + case BroadType.IncompleteArray: + // Array parameters are treated as Pointers in C. return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; - case BroadType - .ConstantArray: // Array parameters are treated as Pointers in C. + case BroadType.ConstantArray: + // Array parameters are treated as Pointers in C. return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; - case BroadType.Boolean: // Booleans are treated as uint8. + case BroadType.Boolean: + // Booleans are treated as uint8. return _primitives[SupportedNativeType.Uint8]!.dart; case BroadType.Handle: return 'Object'; @@ -320,6 +337,8 @@ class Type { } else { return importedType!.dartType; } + case BroadType.ObjCInterface: + return getCType(w); case BroadType.Typealias: // Typealias cannot be used by name in Dart types unless both the C and // Dart type of the underlying types are same. diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index 0fd7515757..d3ff4958ef 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -21,6 +21,8 @@ class Writer { final symbolAddressWriter = SymbolAddressWriter(); late String _className; + String get className => _className; + final String? classDocComment; String? _ffiLibraryPrefix; @@ -31,6 +33,14 @@ class Writer { return _ffiLibraryPrefix!; } + String? _ffiPkgLibraryPrefix; + String get ffiPkgLibraryPrefix { + _ffiPkgLibraryPrefix ??= libraryImports + .firstWhere((element) => element.name == ffiPkgImport.name) + .prefix; + return _ffiPkgLibraryPrefix!; + } + final Set libraryImports; late String _lookupFuncIdentifier; diff --git a/pkgs/ffigen/lib/src/config_provider/config_types.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart index 1f0c7a68cf..6ba4f4e5b8 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_types.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart @@ -29,6 +29,7 @@ class CommentType { } enum CommentStyle { doxygen, any } + enum CommentLength { none, brief, full } enum CompoundDependencies { full, opaque } diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 2c0c33feb6..0b76fcb432 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -759,6 +759,24 @@ class Clang { late final _clang_getArgType = _clang_getArgTypePtr.asFunction(); + /// Retrieves the base type of the ObjCObjectType. + /// + /// If the type is not an ObjC object, an invalid type is returned. + CXType clang_Type_getObjCObjectBaseType( + CXType T, + ) { + return _clang_Type_getObjCObjectBaseType( + T, + ); + } + + late final _clang_Type_getObjCObjectBaseTypePtr = + _lookup>( + 'clang_Type_getObjCObjectBaseType'); + late final _clang_Type_getObjCObjectBaseType = + _clang_Type_getObjCObjectBaseTypePtr + .asFunction(); + /// 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, @@ -983,6 +1001,40 @@ class Clang { late final _clang_getCursorDefinition = _clang_getCursorDefinitionPtr.asFunction(); + /// 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( + C, + ); + } + + late final _clang_Cursor_getObjCPropertyGetterNamePtr = + _lookup>( + 'clang_Cursor_getObjCPropertyGetterName'); + late final _clang_Cursor_getObjCPropertyGetterName = + _clang_Cursor_getObjCPropertyGetterNamePtr + .asFunction(); + + /// 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( + C, + ); + } + + late final _clang_Cursor_getObjCPropertySetterNamePtr = + _lookup>( + 'clang_Cursor_getObjCPropertySetterName'); + late final _clang_Cursor_getObjCPropertySetterName = + _clang_Cursor_getObjCPropertySetterNamePtr + .asFunction(); + /// 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. diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart index 4f3bbbfd6f..b2791f84d0 100644 --- a/pkgs/ffigen/lib/src/header_parser/includer.dart +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -35,6 +35,11 @@ bool shouldIncludeFunc(String usr, String name) { usr, name, bindingsIndex.isSeenType, config.functionDecl.shouldInclude); } +bool shouldIncludeInterface(String usr, String name) { + // TODO(#279): Check config YAML. + return true; +} + bool shouldIncludeEnumClass(String usr, String name) { return _shouldIncludeDecl( usr, name, bindingsIndex.isSeenType, config.enumClassDecl.shouldInclude); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart new file mode 100644 index 0000000000..1905c53ae6 --- /dev/null +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -0,0 +1,190 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:ffi'; + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser/data.dart'; +import 'package:logging/logging.dart'; + +import '../clang_bindings/clang_bindings.dart' as clang_types; +import '../includer.dart'; +import '../utils.dart'; + +final _logger = Logger('ffigen.header_parser.objcinterfacedecl_parser'); + +class _ParsedObjCInterface { + ObjCInterface interface; + _ParsedObjCInterface(this.interface); +} + +class _ParsedObjCMethod { + ObjCMethod method; + bool hasError = false; + _ParsedObjCMethod(this.method); +} + +final _interfaceStack = Stack<_ParsedObjCInterface>(); +final _methodStack = Stack<_ParsedObjCMethod>(); + +Type? parseObjCInterfaceDeclaration(clang_types.CXCursor cursor) { + final itfUsr = cursor.usr(); + final itfName = cursor.spelling(); + if (!shouldIncludeInterface(itfUsr, itfName)) { + return null; + } + + final t = cursor.type(); + final name = t.spelling(); + + _logger.fine('++++ Adding ObjC interface: ' + 'Name: $name, ${cursor.completeStringRepr()}'); + + return Type.objCInterface(ObjCInterface( + usr: itfUsr, originalName: name, + name: name, // TODO(#279): config.interfaceDecl.renameUsingConfig(name), + dartDoc: getCursorDocComment(cursor), + )); +} + +void fillObjCInterfaceMethodsIfNeeded( + ObjCInterface itf, clang_types.CXCursor cursor) { + if (itf.filled) return; + itf.filled = true; // Break cycles. + + _logger.fine('++++ Filling ObjC interface: ' + 'Name: ${itf.originalName}, ${cursor.completeStringRepr()}'); + + _interfaceStack.push(_ParsedObjCInterface(itf)); + clang.clang_visitChildren( + cursor, + Pointer.fromFunction(_parseInterfaceVisitor, exceptional_visitor_return), + nullptr); + _interfaceStack.pop(); + + _logger.fine('++++ Finished ObjC interface: ' + 'Name: ${itf.originalName}, ${cursor.completeStringRepr()}'); +} + +int _parseInterfaceVisitor(clang_types.CXCursor cursor, + clang_types.CXCursor parent, Pointer clientData) { + switch (cursor.kind) { + case clang_types.CXCursorKind.CXCursor_ObjCSuperClassRef: + _parseSuperType(cursor); + break; + case clang_types.CXCursorKind.CXCursor_ObjCPropertyDecl: + _parseProperty(cursor); + break; + case clang_types.CXCursorKind.CXCursor_ObjCInstanceMethodDecl: + case clang_types.CXCursorKind.CXCursor_ObjCClassMethodDecl: + _parseMethod(cursor); + break; + } + return clang_types.CXChildVisitResult.CXChildVisit_Continue; +} + +void _parseSuperType(clang_types.CXCursor cursor) { + final superType = cursor.type().toCodeGenType(); + _logger.fine(' > Super type: ' + '$superType ${cursor.completeStringRepr()}'); + _interfaceStack.top.interface.superType = superType.objCInterface; +} + +void _parseProperty(clang_types.CXCursor cursor) { + final itf = _interfaceStack.top.interface; + final fieldName = cursor.spelling(); + final fieldType = cursor.type().toCodeGenType(); + final dartDoc = getCursorDocComment(cursor); + final property = ObjCProperty(fieldName); + _logger.fine(' > Property: ' + '$fieldType $fieldName ${cursor.completeStringRepr()}'); + + final getter = ObjCMethod( + originalName: clang + .clang_Cursor_getObjCPropertyGetterName(cursor) + .toStringAndDispose(), + property: property, + dartDoc: dartDoc, + kind: ObjCMethodKind.propertyGetter, + ); + getter.returnType = ObjCMethodType(fieldType); + itf.addMethod(getter); + + final setter = ObjCMethod( + originalName: clang + .clang_Cursor_getObjCPropertySetterName(cursor) + .toStringAndDispose(), + property: property, + dartDoc: dartDoc, + kind: ObjCMethodKind.propertySetter, + ); + setter.returnType = ObjCMethodType(Type.nativeType(SupportedNativeType.Void)); + setter.params.add(ObjCMethodParam(fieldType, 'value')); + itf.addMethod(setter); +} + +void _parseMethod(clang_types.CXCursor cursor) { + final isClassMethod = + cursor.kind == clang_types.CXCursorKind.CXCursor_ObjCClassMethodDecl; + final method = ObjCMethod( + originalName: cursor.spelling(), + dartDoc: getCursorDocComment(cursor), + kind: isClassMethod + ? ObjCMethodKind.classMethod + : ObjCMethodKind.instanceMethod, + ); + final parsed = _ParsedObjCMethod(method); + _logger.fine(' > ${isClassMethod ? 'Class' : 'Instance'} method: ' + '${method.originalName} ${cursor.completeStringRepr()}'); + _methodStack.push(parsed); + clang.clang_visitChildren( + cursor, + Pointer.fromFunction(_parseMethodVisitor, exceptional_visitor_return), + nullptr); + _methodStack.pop(); + if (parsed.hasError || method.returnType == null) { + // Discard it. + return; + } + _interfaceStack.top.interface.addMethod(method); +} + +int _parseMethodVisitor(clang_types.CXCursor cursor, + clang_types.CXCursor parent, Pointer clientData) { + switch (cursor.kind) { + case clang_types.CXCursorKind.CXCursor_TypeRef: + case clang_types.CXCursorKind.CXCursor_ObjCClassRef: + _parseMethodReturnType(cursor); + break; + case clang_types.CXCursorKind.CXCursor_ParmDecl: + _parseMethodParam(cursor); + break; + default: + } + return clang_types.CXChildVisitResult.CXChildVisit_Continue; +} + +void _parseMethodReturnType(clang_types.CXCursor cursor) { + final parsed = _methodStack.top; + if (parsed.method.returnType != null) { + parsed.hasError = true; + _logger.fine( + ' >> Extra return type: ${cursor.completeStringRepr()}'); + _logger.warning('Method "${parsed.method.originalName}" in instance ' + '"${_interfaceStack.top.interface.originalName}" has multiple return ' + 'types.'); + } else { + parsed.method.returnType = ObjCMethodType(cursor.type().toCodeGenType()); + _logger.fine(' >> Return type: ' + '${parsed.method.returnType} ${cursor.completeStringRepr()}'); + } +} + +void _parseMethodParam(clang_types.CXCursor cursor) { + final name = cursor.spelling(); + final type = cursor.type().toCodeGenType(); + _logger.fine( + ' >> Parameter: $type $name ${cursor.completeStringRepr()}'); + _methodStack.top.method.params.add(ObjCMethodParam(type, name)); +} diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart index 60c623e3ce..7778ddf505 100644 --- a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -57,6 +57,9 @@ int _rootCursorVisitor(clang_types.CXCursor cursor, clang_types.CXCursor parent, case clang_types.CXCursorKind.CXCursor_VarDecl: addToBindings(parseVarDeclaration(cursor)); break; + case clang_types.CXCursorKind.CXCursor_ObjCInterfaceDecl: + addToBindings(_getCodeGenTypeFromCursor(cursor)?.objCInterface); + break; default: _logger.finer('rootCursorVisitor: CursorKind not implemented'); } diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 3c2f2dc388..0f487a937f 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -13,6 +13,7 @@ import '../clang_bindings/clang_bindings.dart' as clang_types; import '../data.dart'; import '../sub_parsers/compounddecl_parser.dart'; import '../sub_parsers/enumdecl_parser.dart'; +import '../sub_parsers/objcinterfacedecl_parser.dart'; import '../type_extractor/cxtypekindmap.dart'; import '../utils.dart'; @@ -38,17 +39,18 @@ Type getCodeGenType( ignoreFilter: ignoreFilter, pointerReference: pointerReference); } - // Objective C types skip the cache, and are conditional on the language flag. + // These basic Objective C types skip the cache, and are conditional on the + // language flag. if (config.language == Language.objc) { switch (cxtype.kind) { case clang_types.CXTypeKind.CXType_ObjCObjectPointer: case clang_types.CXTypeKind.CXType_BlockPointer: case clang_types.CXTypeKind.CXType_ObjCId: + case clang_types.CXTypeKind.CXType_ObjCClass: + case clang_types.CXTypeKind.CXType_ObjCTypeParam: return Type.pointer(Type.struct(objCObjectType)); case clang_types.CXTypeKind.CXType_ObjCSel: return Type.pointer(Type.struct(objCSelType)); - case clang_types.CXTypeKind.CXType_ObjCClass: - return Type.struct(objCObjectType); } } @@ -194,9 +196,10 @@ _CreateTypeFromCursorResult _createTypeFromCursor(clang_types.CXType cxtype, } else { return _CreateTypeFromCursorResult(Type.enumClass(enumClass)); } + case clang_types.CXTypeKind.CXType_ObjCInterface: + return _CreateTypeFromCursorResult(parseObjCInterfaceDeclaration(cursor)); default: - throw UnimplementedError( - 'Unknown cursor kind: ${cursor.completeStringRepr()}'); + throw UnimplementedError('Unknown type: ${cxtype.completeStringRepr()}'); } } @@ -206,6 +209,8 @@ void _fillFromCursorIfNeeded(Type? type, clang_types.CXCursor cursor, if (type.compound != null) { fillCompoundMembersIfNeeded(type.compound!, cursor, ignoreFilter: ignoreFilter, pointerReference: pointerReference); + } else if (type.objCInterface != null) { + fillObjCInterfaceMethodsIfNeeded(type.objCInterface!, cursor); } } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart new file mode 100644 index 0000000000..e584704e91 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart @@ -0,0 +1,852 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; + +/// ObjC Interface Test +class NativeLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + NativeLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NativeLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + ffi.Pointer _sel_registerName( + ffi.Pointer str, + ) { + return __sel_registerName( + str, + ); + } + + late final __sel_registerNamePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sel_registerName'); + late final __sel_registerName = __sel_registerNamePtr + .asFunction Function(ffi.Pointer)>(); + + ffi.Pointer _objc_getClass( + ffi.Pointer str, + ) { + return __objc_getClass( + str, + ); + } + + late final __objc_getClassPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('objc_getClass'); + late final __objc_getClass = __objc_getClassPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); + + instancetype _objc_msgSend_0( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_0( + obj, + sel, + ); + } + + late final __objc_msgSend_0Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer)>(); + + instancetype _objc_msgSend_1( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_1( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_1Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>(); + + ffi.Pointer _objc_msgSend_2( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_2( + obj, + sel, + ); + } + + late final __objc_msgSend_2Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_3( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_3( + obj, + sel, + ); + } + + late final __objc_msgSend_3Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_4( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_4( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_4Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); + + ffi.Pointer _objc_msgSend_5( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_5( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_5Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); + + int _objc_msgSend_6( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_6( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_6Ptr = _lookup< + ffi.NativeFunction< + BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_7( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer protocol, + ) { + return __objc_msgSend_7( + obj, + sel, + protocol, + ); + } + + late final __objc_msgSend_7Ptr = _lookup< + ffi.NativeFunction< + BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + IMP _objc_msgSend_8( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_8( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_8Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + IMP _objc_msgSend_9( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_9( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_9Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_10( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_10( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_10Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_11( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_11( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_11Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_12( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_12( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_12Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_13( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_13( + obj, + sel, + ); + } + + late final __objc_msgSend_13Ptr = _lookup< + ffi.NativeFunction< + BOOL Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_14( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ) { + return __objc_msgSend_14( + obj, + sel, + aClass, + ); + } + + late final __objc_msgSend_14Ptr = _lookup< + ffi.NativeFunction< + BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_15( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sel1, + ) { + return __objc_msgSend_15( + obj, + sel, + sel1, + ); + } + + late final __objc_msgSend_15Ptr = _lookup< + ffi.NativeFunction< + BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sel1, + ) { + return __objc_msgSend_16( + obj, + sel, + sel1, + ); + } + + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_17( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_17( + obj, + sel, + ); + } + + late final __objc_msgSend_17Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_18( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_18( + obj, + sel, + ); + } + + late final __objc_msgSend_18Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_19( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_19( + obj, + sel, + ); + } + + late final __objc_msgSend_19Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_20( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_20( + obj, + sel, + ); + } + + late final __objc_msgSend_20Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_21( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_21( + obj, + sel, + ); + } + + late final __objc_msgSend_21Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_22( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_22( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_22Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_23( + ffi.Pointer obj, + ffi.Pointer sel, + double someArg, + ) { + return __objc_msgSend_23( + obj, + sel, + someArg, + ); + } + + late final __objc_msgSend_23Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); + + int _objc_msgSend_24( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer someArg, + ffi.Pointer otherArg, + ) { + return __objc_msgSend_24( + obj, + sel, + someArg, + otherArg, + ); + } + + late final __objc_msgSend_24Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +} + +ffi.Pointer _registerName(NativeLibrary _lib, String name) { + final cstr = name.toNativeUtf8(); + final sel = _lib._sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; +} + +ffi.Pointer _getClass(NativeLibrary _lib, String name) { + final cstr = name.toNativeUtf8(); + final clazz = _lib._objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; +} + +class _ObjCWrapper { + final ffi.Pointer _id; + final NativeLibrary _lib; + _ObjCWrapper._(this._id, this._lib); +} + +class Foo extends NSObject { + Foo._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); + + static ffi.Pointer? _class; + + static Foo castFrom(T other) { + return Foo._(other._id, other._lib); + } + + static ffi.Pointer? _sel_someProperty; + int get someProperty { + _sel_someProperty ??= _registerName(_lib, "someProperty"); + return _lib._objc_msgSend_21(_id, _sel_someProperty!); + } + + static ffi.Pointer? _sel_someProperty1; + void set someProperty(int value) { + _sel_someProperty1 ??= _registerName(_lib, "setSomeProperty:"); + return _lib._objc_msgSend_22(_id, _sel_someProperty1!, value); + } + + static ffi.Pointer? _sel_aClassMethod; + static Foo aClassMethod(NativeLibrary _lib, double someArg) { + _class ??= _getClass(_lib, "Foo"); + _sel_aClassMethod ??= _registerName(_lib, "aClassMethod:"); + final _ret = _lib._objc_msgSend_23(_class!, _sel_aClassMethod!, someArg); + return Foo._(_ret, _lib); + } + + static ffi.Pointer? _sel_anInstanceMethod; + int anInstanceMethod(NSObject someArg, NSObject otherArg) { + _sel_anInstanceMethod ??= + _registerName(_lib, "anInstanceMethod:withOtherArg:"); + return _lib._objc_msgSend_24( + _id, _sel_anInstanceMethod!, someArg._id, otherArg._id); + } + + static ffi.Pointer? _sel_new1; + static Foo new1(NativeLibrary _lib) { + _class ??= _getClass(_lib, "Foo"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_0(_class!, _sel_new1!); + return Foo._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static Foo alloc(NativeLibrary _lib) { + _class ??= _getClass(_lib, "Foo"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_0(_class!, _sel_alloc!); + return Foo._(_ret, _lib); + } +} + +class NSObject extends _ObjCWrapper { + NSObject._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); + + static ffi.Pointer? _class; + + static NSObject castFrom(T other) { + return NSObject._(other._id, other._lib); + } + + static ffi.Pointer? _sel_init; + NSObject init() { + _sel_init ??= _registerName(_lib, "init"); + final _ret = _lib._objc_msgSend_0(_id, _sel_init!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSObject new1(NativeLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_0(_class!, _sel_new1!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_allocWithZone; + static NSObject allocWithZone(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_allocWithZone ??= _registerName(_lib, "allocWithZone:"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_allocWithZone!, zone); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSObject alloc(NativeLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_0(_class!, _sel_alloc!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_copy; + NSObject copy() { + _sel_copy ??= _registerName(_lib, "copy"); + final _ret = _lib._objc_msgSend_2(_id, _sel_copy!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_mutableCopy; + NSObject mutableCopy() { + _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); + final _ret = _lib._objc_msgSend_3(_id, _sel_mutableCopy!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_copyWithZone; + static NSObject copyWithZone(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); + final _ret = _lib._objc_msgSend_4(_class!, _sel_copyWithZone!, zone); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_mutableCopyWithZone; + static NSObject mutableCopyWithZone( + NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); + final _ret = _lib._objc_msgSend_5(_class!, _sel_mutableCopyWithZone!, zone); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_instancesRespondToSelector; + static int instancesRespondToSelector( + NativeLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instancesRespondToSelector ??= + _registerName(_lib, "instancesRespondToSelector:"); + return _lib._objc_msgSend_6( + _class!, _sel_instancesRespondToSelector!, aSelector); + } + + static ffi.Pointer? _sel_conformsToProtocol; + static int conformsToProtocol(NativeLibrary _lib, NSObject protocol) { + _class ??= _getClass(_lib, "NSObject"); + _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); + return _lib._objc_msgSend_7( + _class!, _sel_conformsToProtocol!, protocol._id); + } + + static ffi.Pointer? _sel_methodForSelector; + IMP methodForSelector(ffi.Pointer aSelector) { + _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); + return _lib._objc_msgSend_8(_id, _sel_methodForSelector!, aSelector); + } + + static ffi.Pointer? _sel_instanceMethodForSelector; + static IMP instanceMethodForSelector( + NativeLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instanceMethodForSelector ??= + _registerName(_lib, "instanceMethodForSelector:"); + return _lib._objc_msgSend_9( + _class!, _sel_instanceMethodForSelector!, aSelector); + } + + static ffi.Pointer? _sel_forwardingTargetForSelector; + NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + _sel_forwardingTargetForSelector ??= + _registerName(_lib, "forwardingTargetForSelector:"); + final _ret = _lib._objc_msgSend_10( + _id, _sel_forwardingTargetForSelector!, aSelector); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_methodSignatureForSelector; + NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + _sel_methodSignatureForSelector ??= + _registerName(_lib, "methodSignatureForSelector:"); + final _ret = + _lib._objc_msgSend_11(_id, _sel_methodSignatureForSelector!, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static ffi.Pointer? _sel_instanceMethodSignatureForSelector; + static NSMethodSignature instanceMethodSignatureForSelector( + NativeLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instanceMethodSignatureForSelector ??= + _registerName(_lib, "instanceMethodSignatureForSelector:"); + final _ret = _lib._objc_msgSend_12( + _class!, _sel_instanceMethodSignatureForSelector!, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static ffi.Pointer? _sel_allowsWeakReference; + int allowsWeakReference() { + _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); + return _lib._objc_msgSend_13(_id, _sel_allowsWeakReference!); + } + + static ffi.Pointer? _sel_retainWeakReference; + int retainWeakReference() { + _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); + return _lib._objc_msgSend_13(_id, _sel_retainWeakReference!); + } + + static ffi.Pointer? _sel_isSubclassOfClass; + static int isSubclassOfClass(NativeLibrary _lib, NSObject aClass) { + _class ??= _getClass(_lib, "NSObject"); + _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); + return _lib._objc_msgSend_14(_class!, _sel_isSubclassOfClass!, aClass._id); + } + + static ffi.Pointer? _sel_resolveClassMethod; + static int resolveClassMethod(NativeLibrary _lib, ffi.Pointer sel) { + _class ??= _getClass(_lib, "NSObject"); + _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); + return _lib._objc_msgSend_15(_class!, _sel_resolveClassMethod!, sel); + } + + static ffi.Pointer? _sel_resolveInstanceMethod; + static int resolveInstanceMethod( + NativeLibrary _lib, ffi.Pointer sel) { + _class ??= _getClass(_lib, "NSObject"); + _sel_resolveInstanceMethod ??= + _registerName(_lib, "resolveInstanceMethod:"); + return _lib._objc_msgSend_16(_class!, _sel_resolveInstanceMethod!, sel); + } + + static ffi.Pointer? _sel_hash; + static int hash(NativeLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_hash ??= _registerName(_lib, "hash"); + return _lib._objc_msgSend_17(_class!, _sel_hash!); + } + + static ffi.Pointer? _sel_superclass; + static NSObject superclass(NativeLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_superclass ??= _registerName(_lib, "superclass"); + final _ret = _lib._objc_msgSend_18(_class!, _sel_superclass!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_class1; + static NSObject class1(NativeLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_class1 ??= _registerName(_lib, "class"); + final _ret = _lib._objc_msgSend_19(_class!, _sel_class1!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_description; + static NSString description(NativeLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_description ??= _registerName(_lib, "description"); + final _ret = _lib._objc_msgSend_20(_class!, _sel_description!); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_debugDescription; + static NSString debugDescription(NativeLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_debugDescription ??= _registerName(_lib, "debugDescription"); + final _ret = _lib._objc_msgSend_20(_class!, _sel_debugDescription!); + return NSString._(_ret, _lib); + } +} + +typedef instancetype = ffi.Pointer; + +class ObjCObject extends ffi.Opaque {} + +class _NSZone extends ffi.Opaque {} + +typedef BOOL = pkg_ffi.SignedChar; + +class ObjCSel extends ffi.Opaque {} + +typedef IMP = ffi.Pointer>; + +class NSMethodSignature extends _ObjCWrapper { + NSMethodSignature._(ffi.Pointer id, NativeLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSMethodSignature castFrom(T other) { + return NSMethodSignature._(other._id, other._lib); + } +} + +typedef NSUInteger = pkg_ffi.UnsignedLong; + +class NSString extends _ObjCWrapper { + NSString._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); + + static ffi.Pointer? _class; + + static NSString castFrom(T other) { + return NSString._(other._id, other._lib); + } +} diff --git a/pkgs/ffigen/test/header_parser_tests/objc_basic_types.h b/pkgs/ffigen/test/header_parser_tests/objc_basic_types.h index a2f7fc9975..c8d4f311a7 100644 --- a/pkgs/ffigen/test/header_parser_tests/objc_basic_types.h +++ b/pkgs/ffigen/test/header_parser_tests/objc_basic_types.h @@ -3,6 +3,6 @@ struct Foo { id anId; SEL selector; NSObject* object; - Class* clazz; + Class clazz; int32_t (^blockThatReturnsAnInt)(void); }; diff --git a/pkgs/ffigen/test/header_parser_tests/objc_basic_types_test.dart b/pkgs/ffigen/test/header_parser_tests/objc_basic_types_test.dart index 8ee93f47c4..252683e825 100644 --- a/pkgs/ffigen/test/header_parser_tests/objc_basic_types_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/objc_basic_types_test.dart @@ -23,7 +23,7 @@ void main() { actual = parser.parse( Config.fromYaml(yaml.loadYaml(''' ${strings.name}: 'NativeLibrary' -${strings.description}: 'Opaque Dependencies Test' +${strings.description}: 'ObjC Basic Types Test' ${strings.output}: 'unused' ${strings.language}: '${strings.langObjC}' ${strings.headers}: diff --git a/pkgs/ffigen/test/header_parser_tests/objc_interface.h b/pkgs/ffigen/test/header_parser_tests/objc_interface.h new file mode 100644 index 0000000000..ee299bfa7f --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/objc_interface.h @@ -0,0 +1,16 @@ +// This is the Foo interface. +@interface Foo : NSObject { + // This is an instance variable. They are private, so are ignored. + double instVar; +} + +// This is a property. We generate getters and setters for them. +@property int32_t someProperty; + +// This is a class method, so becomes a static function. ++ (Foo*)aClassMethod:(double)someArg; + +// This is an instance method, so becomes a regular method. +- (int32_t)anInstanceMethod:(NSString*)someArg withOtherArg:(Foo*)otherArg; + +@end diff --git a/pkgs/ffigen/test/header_parser_tests/objc_interface_test.dart b/pkgs/ffigen/test/header_parser_tests/objc_interface_test.dart new file mode 100644 index 0000000000..b614f3d8a6 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/objc_interface_test.dart @@ -0,0 +1,48 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; + +import '../test_utils.dart'; + +late Library actual; +void main() { + group('objc_interface_test', () { + setUpAll(() { + logWarnings(Level.SEVERE); + actual = parser.parse( + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'ObjC Interface Test' +${strings.output}: 'unused' +${strings.language}: '${strings.langObjC}' +${strings.headers}: + ${strings.entryPoints}: + - 'test/header_parser_tests/objc_interface.h' +''') as yaml.YamlMap), + ); + }); + test('Expected bindings', () { + matchLibraryWithExpected(actual, [ + 'test', + 'debug_generated', + 'header_parser_objc_interface_test_output.dart' + ], [ + 'test', + 'header_parser_tests', + 'expected_bindings', + '_expected_objc_interface_bindings.dart' + ]); + }); + }); +} diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index c6940ac283..37d96f9dc9 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -109,3 +109,6 @@ functions: - clang_getCursorDefinition - clang_Cursor_isNull - clang_Cursor_hasAttrs + - clang_Type_getObjCObjectBaseType + - clang_Cursor_getObjCPropertyGetterName + - clang_Cursor_getObjCPropertySetterName From ecbdca2dd6a42fa709d36ca9cf1882dd472df0bb Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Wed, 6 Apr 2022 13:36:49 +0200 Subject: [PATCH 106/276] [ffigen] Add contributing info (#291) --- pkgs/ffigen/CONTRIBUTING.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 pkgs/ffigen/CONTRIBUTING.md diff --git a/pkgs/ffigen/CONTRIBUTING.md b/pkgs/ffigen/CONTRIBUTING.md new file mode 100644 index 0000000000..1ef4cd9221 --- /dev/null +++ b/pkgs/ffigen/CONTRIBUTING.md @@ -0,0 +1,35 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. There are +just a few small guidelines you need to follow. + +## Contributor License Agreement + +Contributions to this project must be accompanied by a Contributor License +Agreement. You (or your employer) retain the copyright to your contribution; +this simply gives us permission to use and redistribute your contributions as +part of the project. Head over to to see +your current agreements on file or to sign a new one. + +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. + +## Code reviews + +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more +information on using pull requests. + +## Process + +Some of our branching and releasing process is described on the +[wiki](https://github.com/dart-lang/ffigen/wiki). Please familiarize yourself +with the info there. + +## Community Guidelines + +This project follows [Google's Open Source Community +Guidelines](https://opensource.google/conduct/) and the [Dart code of +conduct](https://dart.dev/code-of-conduct). From bdfd97a376f6292259b9abe1fdaca7f3def34094 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Thu, 7 Apr 2022 11:13:35 -0700 Subject: [PATCH 107/276] [ffigen] Add a warning message to objective C support (#292) * Add a warning message to objective C support * Upgrade warning to severe, and add to readme --- pkgs/ffigen/README.md | 14 ++++++++++++++ .../ffigen/lib/src/config_provider/spec_utils.dart | 7 ++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 32137b9d0d..3665b12179 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -481,6 +481,20 @@ type-map: 'lib': 'custom_lib' 'c-type': 'CustomType3' 'dart-type': 'CustomType3' +``` + +
  • + + + diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index aff84b2db5..9d7263e6b5 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -464,7 +464,12 @@ Language languageExtractor(dynamic value) { bool languageValidator(List name, dynamic value) { if (value is String) { - if (value == strings.langC || value == strings.langObjC) { + if (value == strings.langC) { + return true; + } + if (value == strings.langObjC) { + _logger.severe('Objective C support is EXPERIMENTAL. The API may change ' + 'in a breaking way without notice.'); return true; } _logger.severe("'$name' must be one of the following - " From cecaba72f00e2394bcc78cfa068009a04cbad7de Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Fri, 8 Apr 2022 09:11:31 -0700 Subject: [PATCH 108/276] [ffigen] Remove bool special casing (#294) --- pkgs/ffigen/lib/src/code_generator/objc_interface.dart | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index de76111a8d..bc00b7c29d 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -351,12 +351,9 @@ class ObjCMethodType { } bool get isInterface => type.broadType == BroadType.ObjCInterface; - bool get isBool => type.broadType == BroadType.Boolean; - bool get needsConverting => - isInterface || isBool || isObject || isInstanceType; + bool get needsConverting => isInterface || isObject || isInstanceType; String getConvertedType(Writer w, String enclosingClass) { - if (isBool) return 'bool'; if (isInterface) return type.objCInterface!.name; if (isObject) return 'NSObject'; if (isInstanceType) return enclosingClass; @@ -364,14 +361,12 @@ class ObjCMethodType { } String doArgConversion(String value) { - if (isBool) return '$value ? 1 : 0'; if (isInterface || isObject || isInstanceType) return '$value._id'; return value; } String doReturnConversion( String value, String enclosingClass, String library) { - if (isBool) return '$value != 0'; if (isInterface) return '${type.objCInterface!.name}._($value, $library)'; if (isObject) return 'NSObject._($value, $library)'; if (isInstanceType) return '$enclosingClass._($value, $library)'; From 4f93f6e8ac18f3a54ccfef52fad9fbd104d7f1b0 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Fri, 8 Apr 2022 09:18:43 -0700 Subject: [PATCH 109/276] [ffigen] Make type polymorphic (#290) * Make Type polymorphic * Migrate tests * Fix analysis errors * Fix analysis --- pkgs/ffigen/lib/src/code_generator.dart | 6 +- .../src/code_generator/binding_string.dart | 2 +- .../lib/src/code_generator/compound.dart | 52 ++- .../lib/src/code_generator/enum_class.dart | 12 +- pkgs/ffigen/lib/src/code_generator/func.dart | 27 +- .../lib/src/code_generator/func_type.dart | 77 +++ .../ffigen/lib/src/code_generator/global.dart | 7 +- .../ffigen/lib/src/code_generator/handle.dart | 23 + .../lib/src/code_generator/imports.dart | 19 +- .../lib/src/code_generator/library.dart | 4 +- .../lib/src/code_generator/native_type.dart | 68 +++ .../src/code_generator/objc_interface.dart | 132 +++--- .../lib/src/code_generator/pointer.dart | 54 +++ .../{struc.dart => struct.dart} | 8 +- pkgs/ffigen/lib/src/code_generator/type.dart | 441 +++--------------- .../lib/src/code_generator/typealias.dart | 26 +- pkgs/ffigen/lib/src/code_generator/union.dart | 4 +- .../sub_parsers/compounddecl_parser.dart | 16 +- .../sub_parsers/functiondecl_parser.dart | 24 +- .../sub_parsers/objcinterfacedecl_parser.dart | 18 +- .../sub_parsers/typedefdecl_parser.dart | 22 +- .../header_parser/sub_parsers/var_parser.dart | 6 +- .../translation_unit_parser.dart | 11 +- .../type_extractor/extractor.dart | 77 ++- .../code_generator_test.dart | 233 +++++---- .../_expected_function_n_struct_bindings.dart | 12 +- .../_expected_typealias_bindings.dart | 12 +- .../decl_decl_collision_test.dart | 53 +-- .../decl_symbol_address_collision_test.dart | 8 +- .../reserved_keyword_collision_test.dart | 39 +- .../packed_struct_override_test.dart | 6 +- .../test/header_parser_tests/dart_handle.h | 4 +- .../_expected_dart_handle_bindings.dart | 4 +- ...expected_native_func_typedef_bindings.dart | 4 +- .../function_n_struct_test.dart | 45 +- .../header_parser_tests/globals_test.dart | 20 +- .../header_parser_tests/native_func_typedef.h | 4 +- .../nested_parsing_test.dart | 36 +- .../ffigen/test/rename_tests/rename_test.dart | 48 +- 39 files changed, 785 insertions(+), 879 deletions(-) create mode 100644 pkgs/ffigen/lib/src/code_generator/func_type.dart create mode 100644 pkgs/ffigen/lib/src/code_generator/handle.dart create mode 100644 pkgs/ffigen/lib/src/code_generator/native_type.dart create mode 100644 pkgs/ffigen/lib/src/code_generator/pointer.dart rename pkgs/ffigen/lib/src/code_generator/{struc.dart => struct.dart} (89%) diff --git a/pkgs/ffigen/lib/src/code_generator.dart b/pkgs/ffigen/lib/src/code_generator.dart index 6944957c70..a0c5d7e63f 100644 --- a/pkgs/ffigen/lib/src/code_generator.dart +++ b/pkgs/ffigen/lib/src/code_generator.dart @@ -10,11 +10,15 @@ export 'code_generator/compound.dart'; export 'code_generator/constant.dart'; export 'code_generator/enum_class.dart'; export 'code_generator/func.dart'; +export 'code_generator/func_type.dart'; export 'code_generator/global.dart'; +export 'code_generator/handle.dart'; export 'code_generator/imports.dart'; export 'code_generator/library.dart'; +export 'code_generator/native_type.dart'; export 'code_generator/objc_interface.dart'; -export 'code_generator/struc.dart'; +export 'code_generator/pointer.dart'; +export 'code_generator/struct.dart'; export 'code_generator/type.dart'; export 'code_generator/typealias.dart'; export 'code_generator/union.dart'; diff --git a/pkgs/ffigen/lib/src/code_generator/binding_string.dart b/pkgs/ffigen/lib/src/code_generator/binding_string.dart index 031bf5a674..84c4da8bdc 100644 --- a/pkgs/ffigen/lib/src/code_generator/binding_string.dart +++ b/pkgs/ffigen/lib/src/code_generator/binding_string.dart @@ -17,7 +17,7 @@ class BindingString { /// A [BindingString]'s type. enum BindingStringType { func, - struc, + struct, union, constant, global, diff --git a/pkgs/ffigen/lib/src/code_generator/compound.dart b/pkgs/ffigen/lib/src/code_generator/compound.dart index 067e64fe3e..2656e04c10 100644 --- a/pkgs/ffigen/lib/src/code_generator/compound.dart +++ b/pkgs/ffigen/lib/src/code_generator/compound.dart @@ -11,17 +11,18 @@ import 'writer.dart'; enum CompoundType { struct, union } /// A binding for Compound type - Struct/Union. -abstract class Compound extends NoLookUpBinding { +abstract class Compound extends BindingType { /// Marker for if a struct definition is complete. /// /// A function can be safely pass this struct by value if it's complete. - bool isInComplete; + bool isIncomplete; List members; bool get isOpaque => members.isEmpty; - /// Value for `@Packed(X)` annotation. Can be null(no packing), 1, 2, 4, 8, 16. + /// Value for `@Packed(X)` annotation. Can be null (no packing), 1, 2, 4, 8, + /// or 16. /// /// Only supported for [CompoundType.struct]. int? pack; @@ -38,7 +39,7 @@ abstract class Compound extends NoLookUpBinding { String? originalName, required String name, required this.compoundType, - this.isInComplete = false, + this.isIncomplete = false, this.pack, String? dartDoc, List? members, @@ -55,18 +56,18 @@ abstract class Compound extends NoLookUpBinding { String? usr, String? originalName, required String name, - bool isInComplete = false, + bool isIncomplete = false, int? pack, String? dartDoc, List? members, }) { switch (type) { case CompoundType.struct: - return Struc( + return Struct( usr: usr, originalName: originalName, name: name, - isInComplete: isInComplete, + isIncomplete: isIncomplete, pack: pack, dartDoc: dartDoc, members: members, @@ -76,7 +77,7 @@ abstract class Compound extends NoLookUpBinding { usr: usr, originalName: originalName, name: name, - isInComplete: isInComplete, + isIncomplete: isIncomplete, pack: pack, dartDoc: dartDoc, members: members, @@ -87,16 +88,17 @@ abstract class Compound extends NoLookUpBinding { List _getArrayDimensionLengths(Type type) { final array = []; var startType = type; - while (startType.broadType == BroadType.ConstantArray) { - array.add(startType.length!); - startType = startType.child!; + while (startType is ConstantArray) { + array.add(startType.length); + startType = startType.child; } return array; } String _getInlineArrayTypeString(Type type, Writer w) { - if (type.broadType == BroadType.ConstantArray) { - return '${w.ffiLibraryPrefix}.Array<${_getInlineArrayTypeString(type.child!, w)}>'; + if (type is ConstantArray) { + return '${w.ffiLibraryPrefix}.Array<' + '${_getInlineArrayTypeString(type.child, w)}>'; } return type.getCType(w); } @@ -125,23 +127,23 @@ abstract class Compound extends NoLookUpBinding { } final dartClassName = isStruct ? 'Struct' : 'Union'; // Write class declaration. - s.write( - 'class $enclosingClassName extends ${w.ffiLibraryPrefix}.${isOpaque ? 'Opaque' : dartClassName}{\n'); + s.write('class $enclosingClassName extends '); + s.write('${w.ffiLibraryPrefix}.${isOpaque ? 'Opaque' : dartClassName}{\n'); const depth = ' '; for (final m in members) { final memberName = localUniqueNamer.makeUnique(m.name); - if (m.type.broadType == BroadType.ConstantArray) { - s.write( - '$depth@${w.ffiLibraryPrefix}.Array.multi(${_getArrayDimensionLengths(m.type)})\n'); - s.write( - '${depth}external ${_getInlineArrayTypeString(m.type, w)} $memberName;\n\n'); + if (m.type is ConstantArray) { + s.write('$depth@${w.ffiLibraryPrefix}.Array.multi('); + s.write('${_getArrayDimensionLengths(m.type)})\n'); + s.write('${depth}external ${_getInlineArrayTypeString(m.type, w)} '); + s.write('$memberName;\n\n'); } else { if (m.dartDoc != null) { s.write(depth + '/// '); s.writeAll(m.dartDoc!.split('\n'), '\n' + depth + '/// '); s.write('\n'); } - if (!m.type.sameDartAndCType(w)) { + if (!sameDartAndCType(m.type, w)) { s.write('$depth@${m.type.getCType(w)}()\n'); } s.write('${depth}external ${m.type.getDartType(w)} $memberName;\n\n'); @@ -150,7 +152,7 @@ abstract class Compound extends NoLookUpBinding { s.write('}\n\n'); return BindingString( - type: isStruct ? BindingStringType.struc : BindingStringType.union, + type: isStruct ? BindingStringType.struct : BindingStringType.union, string: s.toString()); } @@ -163,6 +165,12 @@ abstract class Compound extends NoLookUpBinding { m.type.addDependencies(dependencies); } } + + @override + bool get isIncompleteCompound => isIncomplete; + + @override + String getCType(Writer w) => name; } class Member { diff --git a/pkgs/ffigen/lib/src/code_generator/enum_class.dart b/pkgs/ffigen/lib/src/code_generator/enum_class.dart index 2765aef53c..07b9eede31 100644 --- a/pkgs/ffigen/lib/src/code_generator/enum_class.dart +++ b/pkgs/ffigen/lib/src/code_generator/enum_class.dart @@ -4,6 +4,8 @@ import 'binding.dart'; import 'binding_string.dart'; +import 'native_type.dart'; +import 'type.dart'; import 'utils.dart'; import 'writer.dart'; @@ -21,7 +23,9 @@ import 'writer.dart'; /// static const banana = 10; /// } /// ``` -class EnumClass extends NoLookUpBinding { +class EnumClass extends BindingType { + static final nativeType = NativeType(SupportedNativeType.Int32); + final List enumConstants; EnumClass({ @@ -75,6 +79,12 @@ class EnumClass extends NoLookUpBinding { dependencies.add(this); } + + @override + String getCType(Writer w) => nativeType.getCType(w); + + @override + String getDartType(Writer w) => nativeType.getDartType(w); } /// Represents a single value in an enum. diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index d33f135d82..815c3036ee 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -33,7 +33,8 @@ class Func extends LookUpBinding { final bool isLeaf; /// Contains typealias for function type if [exposeFunctionTypedefs] is true. - Typealias? _exposedCFunctionTypealias, _exposedDartFunctionTypealias; + Typealias? _exposedCFunctionTypealias; + Typealias? _exposedDartFunctionTypealias; /// [originalName] is looked up in dynamic library, if not /// provided, takes the value of [name]. @@ -68,11 +69,11 @@ class Func extends LookUpBinding { if (exposeFunctionTypedefs) { _exposedCFunctionTypealias = Typealias( name: 'Native$upperCaseName', - type: Type.functionType(functionType), + type: functionType, ); _exposedDartFunctionTypealias = Typealias( name: 'Dart$upperCaseName', - type: Type.functionType(functionType), + type: functionType, useDartType: true, ); } @@ -94,9 +95,7 @@ class Func extends LookUpBinding { p.name = paramNamer.makeUnique(p.name); } // Write enclosing function. - if (w.dartBool && - functionType.returnType.getBaseTypealiasType().broadType == - BroadType.Boolean) { + if (w.dartBool && functionType.returnType.typealiasType is BooleanType) { // Use bool return type in enclosing function. s.write('bool $enclosingFuncName(\n'); } else { @@ -104,8 +103,7 @@ class Func extends LookUpBinding { '${functionType.returnType.getDartType(w)} $enclosingFuncName(\n'); } for (final p in functionType.parameters) { - if (w.dartBool && - p.type.getBaseTypealiasType().broadType == BroadType.Boolean) { + if (w.dartBool && p.type.typealiasType is BooleanType) { // Use bool parameter type in enclosing function. s.write(' bool ${p.name},\n'); } else { @@ -117,15 +115,14 @@ class Func extends LookUpBinding { s.write('(\n'); for (final p in functionType.parameters) { - if (w.dartBool && - p.type.getBaseTypealiasType().broadType == BroadType.Boolean) { + if (w.dartBool && p.type.typealiasType is BooleanType) { // Convert bool parameter to int before calling. s.write(' ${p.name}?1:0,\n'); } else { s.write(' ${p.name},\n'); } } - if (w.dartBool && functionType.returnType.broadType == BroadType.Boolean) { + if (w.dartBool && functionType.returnType.typealiasType is BooleanType) { // Convert int return type to bool. s.write(' )!=0;\n'); } else { @@ -180,9 +177,7 @@ class Parameter { Parameter({String? originalName, this.name = '', required Type type}) : originalName = originalName ?? name, - // A type with broadtype [BroadType.NativeFunction] is wrapped with a - // pointer because this is a shorthand used in C for Pointer to function. - type = type.getBaseTypealiasType().broadType == BroadType.NativeFunction - ? Type.pointer(type) - : type; + // A [NativeFunc] is wrapped with a pointer because this is a shorthand + // used in C for Pointer to function. + type = type.typealiasType is NativeFunc ? PointerType(type) : type; } diff --git a/pkgs/ffigen/lib/src/code_generator/func_type.dart b/pkgs/ffigen/lib/src/code_generator/func_type.dart new file mode 100644 index 0000000000..7f4050249b --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/func_type.dart @@ -0,0 +1,77 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; + +import 'writer.dart'; + +/// Represents a function type. +class FunctionType extends Type { + final Type returnType; + final List parameters; + + FunctionType({ + required this.returnType, + required this.parameters, + }); + + String _getTypeString( + bool writeArgumentNames, String Function(Type) typeToString) { + final sb = StringBuffer(); + + // Write return Type. + sb.write(typeToString(returnType)); + + // Write Function. + sb.write(' Function('); + sb.write(parameters.map((p) { + return '${typeToString(p.type)} ${writeArgumentNames ? p.name : ""}'; + }).join(', ')); + sb.write(')'); + + return sb.toString(); + } + + @override + String getCType(Writer w, {bool writeArgumentNames = true}) => + _getTypeString(writeArgumentNames, (Type t) => t.getCType(w)); + + @override + String getDartType(Writer w, {bool writeArgumentNames = true}) => + _getTypeString(writeArgumentNames, (Type t) => t.getDartType(w)); + + @override + String toString() => _getTypeString(false, (Type t) => t.toString()); + + @override + void addDependencies(Set dependencies) { + returnType.addDependencies(dependencies); + for (final p in parameters) { + p.type.addDependencies(dependencies); + } + } +} + +/// Represents a NativeFunction. +class NativeFunc extends Type { + final Type type; + + NativeFunc(this.type); + + @override + void addDependencies(Set dependencies) { + type.addDependencies(dependencies); + } + + @override + String getCType(Writer w) => + '${w.ffiLibraryPrefix}.NativeFunction<${type.getCType(w)}>'; + + @override + String getDartType(Writer w) => + '${w.ffiLibraryPrefix}.NativeFunction<${type.getCType(w)}>'; + + @override + String toString() => 'NativeFunction<${type.toString()}>'; +} diff --git a/pkgs/ffigen/lib/src/code_generator/global.dart b/pkgs/ffigen/lib/src/code_generator/global.dart index df4c7f059a..579d8ddaf4 100644 --- a/pkgs/ffigen/lib/src/code_generator/global.dart +++ b/pkgs/ffigen/lib/src/code_generator/global.dart @@ -4,6 +4,7 @@ import 'binding.dart'; import 'binding_string.dart'; +import 'compound.dart'; import 'type.dart'; import 'utils.dart'; import 'writer.dart'; @@ -49,9 +50,9 @@ class Global extends LookUpBinding { s.write( "late final ${w.ffiLibraryPrefix}.Pointer<$cType> $pointerName = ${w.lookupFuncIdentifier}<$cType>('$originalName');\n\n"); - final baseTypealiasType = type.getBaseTypealiasType(); - if (baseTypealiasType.broadType == BroadType.Compound) { - if (baseTypealiasType.compound!.isOpaque) { + final baseTypealiasType = type.typealiasType; + if (baseTypealiasType is Compound) { + if (baseTypealiasType.isOpaque) { s.write( '${w.ffiLibraryPrefix}.Pointer<$cType> get $globalVarName => $pointerName;\n\n'); } else { diff --git a/pkgs/ffigen/lib/src/code_generator/handle.dart b/pkgs/ffigen/lib/src/code_generator/handle.dart new file mode 100644 index 0000000000..a1b2d47e3f --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/handle.dart @@ -0,0 +1,23 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; + +import 'writer.dart'; + +/// Represents a Dart_Handle. +class HandleType extends Type { + const HandleType._(); + static const _handle = HandleType._(); + factory HandleType() => _handle; + + @override + String getCType(Writer w) => '${w.ffiLibraryPrefix}.Handle'; + + @override + String getDartType(Writer w) => 'Object'; + + @override + String toString() => 'Handle'; +} diff --git a/pkgs/ffigen/lib/src/code_generator/imports.dart b/pkgs/ffigen/lib/src/code_generator/imports.dart index e62062641e..1a516112b7 100644 --- a/pkgs/ffigen/lib/src/code_generator/imports.dart +++ b/pkgs/ffigen/lib/src/code_generator/imports.dart @@ -2,7 +2,9 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'struc.dart'; +import 'struct.dart'; +import 'type.dart'; +import 'writer.dart'; /// A library import which will be written as an import in the generated file. class LibraryImport { @@ -22,12 +24,21 @@ class LibraryImport { } /// An imported type which will be used in the generated code. -class ImportedType { +class ImportedType extends Type { final LibraryImport libraryImport; final String cType; final String dartType; ImportedType(this.libraryImport, this.cType, this.dartType); + + @override + String getCType(Writer w) => '${libraryImport.prefix}.$cType'; + + @override + String getDartType(Writer w) => cType == dartType ? getCType(w) : dartType; + + @override + String toString() => '${libraryImport.name}.$cType'; } final ffiImport = LibraryImport('ffi', 'dart:ffi'); @@ -54,5 +65,5 @@ final doubleType = ImportedType(ffiImport, 'Double', 'double'); final sizeType = ImportedType(ffiPkgImport, 'Size', 'int'); final wCharType = ImportedType(ffiPkgImport, 'WChar', 'int'); -final objCObjectType = Struc(name: 'ObjCObject'); -final objCSelType = Struc(name: 'ObjCSel'); +final objCObjectType = Struct(name: 'ObjCObject'); +final objCSelType = Struct(name: 'ObjCSel'); diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index 20c0e24a3a..e00215ce7f 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -11,7 +11,7 @@ import 'package:logging/logging.dart'; import 'package:path/path.dart' as p; import 'binding.dart'; import 'imports.dart'; -import 'struc.dart'; +import 'struct.dart'; import 'utils.dart'; import 'writer.dart'; @@ -59,7 +59,7 @@ class Library { // conflicts have been handled so that users can target the generated names. if (packingOverride != null) { for (final b in this.bindings) { - if (b is Struc && packingOverride.isOverriden(b.name)) { + if (b is Struct && packingOverride.isOverriden(b.name)) { b.pack = packingOverride.getOverridenPackValue(b.name); } } diff --git a/pkgs/ffigen/lib/src/code_generator/native_type.dart b/pkgs/ffigen/lib/src/code_generator/native_type.dart new file mode 100644 index 0000000000..e51581d074 --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/native_type.dart @@ -0,0 +1,68 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; + +import 'writer.dart'; + +enum SupportedNativeType { + Void, + Char, + Int8, + Int16, + Int32, + Int64, + Uint8, + Uint16, + Uint32, + Uint64, + Float, + Double, + IntPtr, +} + +/// Represents a primitive native type, such as float. +class NativeType extends Type { + static const _primitives = { + SupportedNativeType.Void: NativeType._('Void', 'void'), + SupportedNativeType.Char: NativeType._('Uint8', 'int'), + SupportedNativeType.Int8: NativeType._('Int8', 'int'), + SupportedNativeType.Int16: NativeType._('Int16', 'int'), + SupportedNativeType.Int32: NativeType._('Int32', 'int'), + SupportedNativeType.Int64: NativeType._('Int64', 'int'), + SupportedNativeType.Uint8: NativeType._('Uint8', 'int'), + SupportedNativeType.Uint16: NativeType._('Uint16', 'int'), + SupportedNativeType.Uint32: NativeType._('Uint32', 'int'), + SupportedNativeType.Uint64: NativeType._('Uint64', 'int'), + SupportedNativeType.Float: NativeType._('Float', 'double'), + SupportedNativeType.Double: NativeType._('Double', 'double'), + SupportedNativeType.IntPtr: NativeType._('IntPtr', 'int'), + }; + + final String _cType; + final String _dartType; + + const NativeType._(this._cType, this._dartType); + + factory NativeType(SupportedNativeType type) => _primitives[type]!; + + @override + String getCType(Writer w) => '${w.ffiLibraryPrefix}.$_cType'; + + @override + String getDartType(Writer w) => _dartType; + + @override + String toString() => _cType; +} + +class BooleanType extends NativeType { + // Booleans are treated as uint8. + const BooleanType._() : super._('Uint8', 'int'); + static const _boolean = BooleanType._(); + factory BooleanType() => _boolean; + + @override + String toString() => 'bool'; +} diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index bc00b7c29d..23724855d3 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -32,20 +32,16 @@ class _ObjCBuiltInFunctions { late final _registerNameFunc = Func( name: '_sel_registerName', originalName: 'sel_registerName', - returnType: Type.pointer(Type.struct(objCSelType)), - parameters: [ - Parameter(name: 'str', type: Type.pointer(Type.importedType(charType))) - ], + returnType: PointerType(objCSelType), + parameters: [Parameter(name: 'str', type: PointerType(charType))], ); late final String registerName; late final _getClassFunc = Func( name: '_objc_getClass', originalName: 'objc_getClass', - returnType: Type.pointer(Type.struct(objCObjectType)), - parameters: [ - Parameter(name: 'str', type: Type.pointer(Type.importedType(charType))) - ], + returnType: PointerType(objCObjectType), + parameters: [Parameter(name: 'str', type: PointerType(charType))], ); late final String getClass; @@ -62,9 +58,9 @@ class _ObjCBuiltInFunctions { originalName: 'objc_msgSend', returnType: returnType, parameters: [ - Parameter(name: 'obj', type: Type.pointer(Type.struct(objCObjectType))), - Parameter(name: 'sel', type: Type.pointer(Type.struct(objCSelType))), - for (final p in params) Parameter(name: p.name, type: p.type.type), + Parameter(name: 'obj', type: PointerType(objCObjectType)), + Parameter(name: 'sel', type: PointerType(objCSelType)), + for (final p in params) Parameter(name: p.name, type: p.type), ], ); return _msgSendFuncs[key]!; @@ -111,7 +107,7 @@ class _ObjCBuiltInFunctions { final _builtInFunctions = _ObjCBuiltInFunctions(); -class ObjCInterface extends NoLookUpBinding { +class ObjCInterface extends BindingType { ObjCInterface? superType; final methods = []; bool filled = false; @@ -146,8 +142,8 @@ class ObjCInterface extends NoLookUpBinding { final natLib = w.className; _builtInFunctions.ensureUtilsExist(w, s); - final objType = Type.pointer(Type.struct(objCObjectType)).getCType(w); - final selType = Type.pointer(Type.struct(objCSelType)).getCType(w); + final objType = PointerType(objCObjectType).getCType(w); + final selType = PointerType(objCSelType).getCType(w); // Class declaration. s.write('class $name '); @@ -179,7 +175,7 @@ class ObjCInterface extends NoLookUpBinding { } s.write(' '); if (isStatic) s.write('static '); - s.write('${m.returnType!.getConvertedType(w, name)} '); + s.write('${_getConvertedType(m.returnType!, w, name)} '); if (m.kind == ObjCMethodKind.propertyGetter) s.write('get '); if (m.kind == ObjCMethodKind.propertySetter) s.write('set '); s.write(methodName); @@ -196,7 +192,7 @@ class ObjCInterface extends NoLookUpBinding { } else { s.write(', '); } - s.write('${p.type.getConvertedType(w, name)} ${p.name}'); + s.write('${_getConvertedType(p.type, w, name)} ${p.name}'); } s.write(')'); } @@ -209,17 +205,17 @@ class ObjCInterface extends NoLookUpBinding { } s.write(' $selName ??= ' '${_builtInFunctions.registerName}(_lib, "${m.originalName}");\n'); - final convertReturn = m.returnType!.needsConverting; + final convertReturn = _needsConverting(m.returnType!); s.write(' ${convertReturn ? 'final _ret = ' : 'return '}'); s.write('_lib.${m.msgSend!.name}('); s.write(isStatic ? '_class!' : '_id'); s.write(', $selName!'); for (final p in m.params) { - s.write(', ${p.type.doArgConversion(p.name)}'); + s.write(', ${_doArgConversion(p.type, p.name)}'); } s.write(');\n'); if (convertReturn) { - final result = m.returnType!.doReturnConversion('_ret', name, '_lib'); + final result = _doReturnConversion(m.returnType!, '_ret', name, '_lib'); s.write(' return $result;'); } @@ -261,6 +257,46 @@ class ObjCInterface extends NoLookUpBinding { classMethods[method.originalName] ??= method; } } + + @override + String getCType(Writer w) => PointerType(objCObjectType).getCType(w); + + bool _isObject(Type type) => + type is PointerType && type.child == objCObjectType; + + bool _isInstanceType(Type type) => + type is Typealias && + type.originalName == 'instancetype' && + _isObject(type.type); + + // Utils for converting between the internal types passed to native code, and + // the external types visible to the user. For example, ObjCInterfaces are + // passed to native as Pointer, but the user sees the Dart wrapper + // class. These methods need to be kept in sync. + bool _needsConverting(Type type) => + type is ObjCInterface || _isObject(type) || _isInstanceType(type); + + String _getConvertedType(Type type, Writer w, String enclosingClass) { + if (type is ObjCInterface) return type.name; + if (_isObject(type)) return 'NSObject'; + if (_isInstanceType(type)) return enclosingClass; + return type.getDartType(w); + } + + String _doArgConversion(Type type, String value) { + if (type is ObjCInterface || _isObject(type) || _isInstanceType(type)) { + return '$value._id'; + } + return value; + } + + String _doReturnConversion( + Type type, String value, String enclosingClass, String library) { + if (type is ObjCInterface) return '${type.name}._($value, $library)'; + if (_isObject(type)) return 'NSObject._($value, $library)'; + if (_isInstanceType(type)) return '$enclosingClass._($value, $library)'; + return value; + } } enum ObjCMethodKind { @@ -280,7 +316,7 @@ class ObjCMethod { final String? dartDoc; final String originalName; final ObjCProperty? property; - ObjCMethodType? returnType; + Type? returnType; final params = []; final ObjCMethodKind kind; Func? msgSend; @@ -293,11 +329,11 @@ class ObjCMethod { }); void addDependencies(Set dependencies) { - returnType!.type.addDependencies(dependencies); + returnType!.addDependencies(dependencies); for (final p in params) { - p.type.type.addDependencies(dependencies); + p.type.addDependencies(dependencies); } - msgSend = _builtInFunctions.getMsgSendFunc(returnType!.type, params); + msgSend = _builtInFunctions.getMsgSendFunc(returnType!, params); } String _getDartMethodName(UniqueNamer uniqueNamer) { @@ -323,53 +359,7 @@ class ObjCMethod { } class ObjCMethodParam { - final ObjCMethodType type; - final String name; - ObjCMethodParam(Type t, this.name) : type = ObjCMethodType(t); -} - -// Wrapper around Type with helper methods for converting between the internal -// types passed to native code, and the external types visible to the user. For -// example, ObjCInterfaces are passed to native as Pointer, but the -// user sees the Dart wrapper class. -class ObjCMethodType { final Type type; - ObjCMethodType(this.type); - - bool get isObject { - if (type.broadType != BroadType.Pointer) return false; - final child = type.child!; - if (child.broadType != BroadType.Compound) return false; - return child.compound == objCObjectType; - } - - bool get isInstanceType { - if (type.broadType != BroadType.Typealias) return false; - final alias = type.typealias!; - if (alias.name != 'instancetype') return false; - return ObjCMethodType(alias.type).isObject; - } - - bool get isInterface => type.broadType == BroadType.ObjCInterface; - bool get needsConverting => isInterface || isObject || isInstanceType; - - String getConvertedType(Writer w, String enclosingClass) { - if (isInterface) return type.objCInterface!.name; - if (isObject) return 'NSObject'; - if (isInstanceType) return enclosingClass; - return type.getDartType(w); - } - - String doArgConversion(String value) { - if (isInterface || isObject || isInstanceType) return '$value._id'; - return value; - } - - String doReturnConversion( - String value, String enclosingClass, String library) { - if (isInterface) return '${type.objCInterface!.name}._($value, $library)'; - if (isObject) return 'NSObject._($value, $library)'; - if (isInstanceType) return '$enclosingClass._($value, $library)'; - return value; - } + final String name; + ObjCMethodParam(this.type, this.name); } diff --git a/pkgs/ffigen/lib/src/code_generator/pointer.dart b/pkgs/ffigen/lib/src/code_generator/pointer.dart new file mode 100644 index 0000000000..445c360037 --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/pointer.dart @@ -0,0 +1,54 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; + +import 'writer.dart'; + +/// Represents a pointer. +class PointerType extends Type { + final Type child; + PointerType(this.child); + + @override + void addDependencies(Set dependencies) { + child.addDependencies(dependencies); + } + + @override + Type get baseType => child.baseType; + + @override + String getCType(Writer w) => + '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; + + @override + String toString() => '*$child'; +} + +/// Represents a constant array, which has a fixed size. +class ConstantArray extends PointerType { + final int length; + ConstantArray(this.length, Type child) : super(child); + + @override + Type get baseArrayType => child.baseArrayType; + + @override + bool get isIncompleteCompound => baseArrayType.isIncompleteCompound; + + @override + String toString() => '$child[$length]'; +} + +/// Represents an incomplete array, which has an unknown size. +class IncompleteArray extends PointerType { + IncompleteArray(Type child) : super(child); + + @override + Type get baseArrayType => child.baseArrayType; + + @override + String toString() => '$child[]'; +} diff --git a/pkgs/ffigen/lib/src/code_generator/struc.dart b/pkgs/ffigen/lib/src/code_generator/struct.dart similarity index 89% rename from pkgs/ffigen/lib/src/code_generator/struc.dart rename to pkgs/ffigen/lib/src/code_generator/struct.dart index 4f06369b6f..f430d0f81f 100644 --- a/pkgs/ffigen/lib/src/code_generator/struc.dart +++ b/pkgs/ffigen/lib/src/code_generator/struct.dart @@ -28,12 +28,12 @@ import 'package:ffigen/src/code_generator/compound.dart'; /// /// } /// ``` -class Struc extends Compound { - Struc({ +class Struct extends Compound { + Struct({ String? usr, String? originalName, required String name, - bool isInComplete = false, + bool isIncomplete = false, int? pack, String? dartDoc, List? members, @@ -42,7 +42,7 @@ class Struc extends Compound { originalName: originalName, name: name, dartDoc: dartDoc, - isInComplete: isInComplete, + isIncomplete: isIncomplete, members: members, pack: pack, compoundType: CompoundType.struct, diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index a708167e72..af580b3f3e 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -6,420 +6,95 @@ import 'package:ffigen/src/code_generator.dart'; import 'writer.dart'; -class _SubType { - final String c; - final String dart; - - const _SubType({required this.c, required this.dart}); -} - -enum SupportedNativeType { - Void, - Char, - Int8, - Int16, - Int32, - Int64, - Uint8, - Uint16, - Uint32, - Uint64, - Float, - Double, - IntPtr, -} - -/// The basic types in which all types can be broadly classified into. -enum BroadType { - Boolean, - NativeType, - Pointer, - Compound, - NativeFunction, - - /// Represents a function type. - FunctionType, - - /// Represents an imported type. - ImportedType, - - /// Represents a typealias. - Typealias, - - /// Represents a Dart_Handle. - Handle, - - Enum, - - /// Represents an Array type. - ConstantArray, - IncompleteArray, - - /// Represents an Objective C interface. - ObjCInterface, - - /// Used as a marker, so that declarations having these can exclude them. - Unimplemented, -} - /// Type class for return types, variable types, etc. -class Type { - static const _primitives = { - SupportedNativeType.Void: _SubType(c: 'Void', dart: 'void'), - SupportedNativeType.Char: _SubType(c: 'Uint8', dart: 'int'), - SupportedNativeType.Int8: _SubType(c: 'Int8', dart: 'int'), - SupportedNativeType.Int16: _SubType(c: 'Int16', dart: 'int'), - SupportedNativeType.Int32: _SubType(c: 'Int32', dart: 'int'), - SupportedNativeType.Int64: _SubType(c: 'Int64', dart: 'int'), - SupportedNativeType.Uint8: _SubType(c: 'Uint8', dart: 'int'), - SupportedNativeType.Uint16: _SubType(c: 'Uint16', dart: 'int'), - SupportedNativeType.Uint32: _SubType(c: 'Uint32', dart: 'int'), - SupportedNativeType.Uint64: _SubType(c: 'Uint64', dart: 'int'), - SupportedNativeType.Float: _SubType(c: 'Float', dart: 'double'), - SupportedNativeType.Double: _SubType(c: 'Double', dart: 'double'), - SupportedNativeType.IntPtr: _SubType(c: 'IntPtr', dart: 'int'), - }; - - /// Enum type is mapped to [SupportedNativeType.Int32]. - static const enumNativeType = SupportedNativeType.Int32; - - /// Reference to the [Compound] binding this type refers to. - Compound? compound; - - /// Reference to the [NativeFunc] this type refers to. - NativeFunc? nativeFunc; - - /// Reference to the [Typealias] this type refers to. - Typealias? typealias; - - /// Reference to the [FunctionType] this type refers to. - FunctionType? functionType; - - /// Reference to the [EnumClass] this type refers to. - EnumClass? enumClass; - - /// Reference to the [ImportedType] this type refers to. - ImportedType? importedType; - - /// Reference to the [ObjCInterface] this type refers to. - ObjCInterface? objCInterface; - - /// For providing [SupportedNativeType] only. - final SupportedNativeType? nativeType; - - /// The BroadType of this Type. - final BroadType broadType; - - /// Child Type, e.g Pointer(Parent) to Int(Child), or Child Type of an Array. - final Type? child; - - /// For ConstantArray and IncompleteArray type. - final int? length; - - /// For storing cursor type info for an unimplemented type. - String? unimplementedReason; - - Type._({ - required this.broadType, - this.child, - this.compound, - this.enumClass, - this.nativeType, - this.nativeFunc, - this.typealias, - this.functionType, - this.importedType, - this.objCInterface, - this.length, - this.unimplementedReason, - }); - - factory Type.pointer(Type child) { - return Type._(broadType: BroadType.Pointer, child: child); - } - factory Type.compound(Compound compound) { - return Type._(broadType: BroadType.Compound, compound: compound); - } - factory Type.struct(Struc struc) { - return Type._(broadType: BroadType.Compound, compound: struc); - } - factory Type.union(Union union) { - return Type._(broadType: BroadType.Compound, compound: union); - } - factory Type.enumClass(EnumClass enumClass) { - return Type._(broadType: BroadType.Enum, enumClass: enumClass); - } - factory Type.functionType(FunctionType functionType) { - return Type._( - broadType: BroadType.FunctionType, functionType: functionType); - } - factory Type.importedType(ImportedType importedType) { - return Type._( - broadType: BroadType.ImportedType, importedType: importedType); - } - factory Type.nativeFunc(NativeFunc nativeFunc) { - return Type._(broadType: BroadType.NativeFunction, nativeFunc: nativeFunc); - } - factory Type.typealias(Typealias typealias) { - return Type._(broadType: BroadType.Typealias, typealias: typealias); - } - factory Type.nativeType(SupportedNativeType nativeType) { - return Type._(broadType: BroadType.NativeType, nativeType: nativeType); - } - factory Type.constantArray(int length, Type elementType) { - return Type._( - broadType: BroadType.ConstantArray, - child: elementType, - length: length, - ); - } - factory Type.incompleteArray(Type elementType) { - return Type._( - broadType: BroadType.IncompleteArray, - child: elementType, - ); - } - factory Type.boolean() { - return Type._( - broadType: BroadType.Boolean, - ); - } - factory Type.unimplemented(String reason) { - return Type._( - broadType: BroadType.Unimplemented, unimplementedReason: reason); - } - factory Type.handle() { - return Type._(broadType: BroadType.Handle); - } - factory Type.objCInterface(ObjCInterface objCInterface) { - return Type._( - broadType: BroadType.ObjCInterface, objCInterface: objCInterface); - } +/// +/// Implementers should extend either Type, or BindingType if the type is also a +/// binding, and override at least getCType and toString. +abstract class Type { + const Type(); /// Get all dependencies of this type and save them in [dependencies]. - void addDependencies(Set dependencies) { - switch (broadType) { - case BroadType.Compound: - return compound!.addDependencies(dependencies); - case BroadType.NativeFunction: - return nativeFunc!.addDependencies(dependencies); - case BroadType.FunctionType: - return functionType!.addDependencies(dependencies); - case BroadType.Typealias: - return typealias!.addDependencies(dependencies); - case BroadType.Enum: - return enumClass!.addDependencies(dependencies); - case BroadType.ObjCInterface: - return objCInterface!.addDependencies(dependencies); - default: - if (child != null) { - return child!.addDependencies(dependencies); - } - } - } + void addDependencies(Set dependencies) {} /// Get base type for any type. /// /// E.g int** has base [Type] of int. /// double[2][3] has base [Type] of double. - Type getBaseType() { - if (child != null) { - return child!.getBaseType(); - } else { - return this; - } - } + Type get baseType => this; /// Get base Array type. /// /// Returns itself if it's not an Array Type. - Type getBaseArrayType() { - if (broadType == BroadType.ConstantArray || - broadType == BroadType.IncompleteArray) { - return child!.getBaseArrayType(); - } else { - return this; - } - } + Type get baseArrayType => this; /// Get base typealias type. /// /// Returns itself if it's not a Typealias. - Type getBaseTypealiasType() { - if (broadType == BroadType.Typealias) { - return typealias!.type.getBaseTypealiasType(); - } else { - return this; - } - } - - /// Function to check if the dart and C type string are same. - bool sameDartAndCType(Writer w) => getCType(w) == getDartType(w); + Type get typealiasType => this; /// Returns true if the type is a [Compound] and is incomplete. - bool get isIncompleteCompound { - final baseTypealiasType = getBaseTypealiasType(); - if (baseTypealiasType == this) { - return (broadType == BroadType.Compound && - compound != null && - compound!.isInComplete) || - (broadType == BroadType.ConstantArray && - getBaseArrayType().isIncompleteCompound); - } else { - return baseTypealiasType.isIncompleteCompound; - } - } + bool get isIncompleteCompound => false; - String getCType(Writer w) { - switch (broadType) { - case BroadType.NativeType: - return '${w.ffiLibraryPrefix}.${_primitives[nativeType!]!.c}'; - case BroadType.Pointer: - return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; - case BroadType.Compound: - return compound!.name; - case BroadType.Enum: - return '${w.ffiLibraryPrefix}.${_primitives[enumNativeType]!.c}'; - case BroadType.NativeFunction: - return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFunc!.type.getCType(w)}>'; - case BroadType.IncompleteArray: - // Array parameters are treated as Pointers in C. - return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; - case BroadType.ConstantArray: - // Array parameters are treated as Pointers in C. - return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; - case BroadType.Boolean: - // Booleans are treated as uint8. - return '${w.ffiLibraryPrefix}.${_primitives[SupportedNativeType.Uint8]!.c}'; - case BroadType.Handle: - return '${w.ffiLibraryPrefix}.Handle'; - case BroadType.FunctionType: - return functionType!.getCType(w); - case BroadType.ImportedType: - return '${importedType!.libraryImport.prefix}.${importedType!.cType}'; - case BroadType.ObjCInterface: - return Type.pointer(Type.struct(objCObjectType)).getCType(w); - case BroadType.Typealias: - return typealias!.name; - case BroadType.Unimplemented: - throw UnimplementedError('C type unknown for ${broadType.toString()}'); - } - } + /// Returns the C type of the Type. This is the FFI compatible type that is + /// passed to native code. + String getCType(Writer w) => throw 'No mapping for type: $this'; - String getDartType(Writer w) { - switch (broadType) { - case BroadType.NativeType: - return _primitives[nativeType!]!.dart; - case BroadType.Pointer: - return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; - case BroadType.Compound: - return compound!.name; - case BroadType.Enum: - return _primitives[enumNativeType]!.dart; - case BroadType.NativeFunction: - return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFunc!.type.getDartType(w)}>'; - case BroadType.IncompleteArray: - // Array parameters are treated as Pointers in C. - return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; - case BroadType.ConstantArray: - // Array parameters are treated as Pointers in C. - return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; - case BroadType.Boolean: - // Booleans are treated as uint8. - return _primitives[SupportedNativeType.Uint8]!.dart; - case BroadType.Handle: - return 'Object'; - case BroadType.FunctionType: - return functionType!.getDartType(w); - case BroadType.ImportedType: - if (importedType!.cType == importedType!.dartType) { - return getCType(w); - } else { - return importedType!.dartType; - } - case BroadType.ObjCInterface: - return getCType(w); - case BroadType.Typealias: - // Typealias cannot be used by name in Dart types unless both the C and - // Dart type of the underlying types are same. - if (typealias!.type.sameDartAndCType(w)) { - return typealias!.name; - } else { - return typealias!.type.getDartType(w); - } - case BroadType.Unimplemented: - throw UnimplementedError( - 'dart type unknown for ${broadType.toString()}'); - } - } + /// Returns the Dart type of the Type. This is the user visible type that is + /// passed to Dart code. + String getDartType(Writer w) => getCType(w); + /// Returns the string representation of the Type, for debugging purposes + /// only. This string should not be printed as generated code. @override - String toString() { - return 'Type: $broadType'; - } + String toString(); } -/// Represents a function type. -class FunctionType { - final Type returnType; - final List parameters; - - FunctionType({ - required this.returnType, - required this.parameters, - }); - - String getCType(Writer w, {bool writeArgumentNames = true}) { - final sb = StringBuffer(); +/// Function to check if the dart and C type string are same. +bool sameDartAndCType(Type t, Writer w) => t.getCType(w) == t.getDartType(w); + +/// Base class for all Type bindings. +/// +/// Since Dart doesn't have multiple inheritance, this type exists so that we +/// don't have to reimplement the default methods in all the classes that want +/// to extend both NoLookUpBinding and Type. +abstract class BindingType extends NoLookUpBinding implements Type { + BindingType({ + String? usr, + String? originalName, + required String name, + String? dartDoc, + }) : super( + usr: usr, + originalName: originalName, + name: name, + dartDoc: dartDoc, + ); - // Write return Type. - sb.write(returnType.getCType(w)); - - // Write Function. - sb.write(' Function('); - sb.write(parameters.map((p) { - return '${p.type.getCType(w)} ${writeArgumentNames ? p.name : ""}'; - }).join(', ')); - sb.write(')'); - - return sb.toString(); - } + @override + Type get baseType => this; - String getDartType(Writer w, {bool writeArgumentNames = true}) { - final sb = StringBuffer(); + @override + Type get baseArrayType => this; - // Write return Type. - sb.write(returnType.getDartType(w)); + @override + Type get typealiasType => this; - // Write Function. - sb.write(' Function('); - sb.write(parameters.map((p) { - return '${p.type.getDartType(w)} ${writeArgumentNames ? p.name : ""}'; - }).join(', ')); - sb.write(')'); + @override + bool get isIncompleteCompound => false; - return sb.toString(); - } + @override + String getDartType(Writer w) => getCType(w); - void addDependencies(Set dependencies) { - returnType.addDependencies(dependencies); - for (final p in parameters) { - p.type.addDependencies(dependencies); - } - } + @override + String toString() => originalName; } -/// Represents a NativeFunction. -class NativeFunc { - final Type type; - - NativeFunc.fromFunctionType(FunctionType functionType) - : type = Type.functionType(functionType); +/// Represents an unimplemented type. Used as a marker, so that declarations +/// having these can exclude them. +class UnimplementedType extends Type { + String reason; + UnimplementedType(this.reason); - NativeFunc.fromFunctionTypealias(Typealias typealias) - : type = Type.typealias(typealias); - - void addDependencies(Set dependencies) { - type.addDependencies(dependencies); - } + @override + String toString() => '(Unimplemented: $reason)'; } diff --git a/pkgs/ffigen/lib/src/code_generator/typealias.dart b/pkgs/ffigen/lib/src/code_generator/typealias.dart index ea8ef9597c..f83c0ba8e0 100644 --- a/pkgs/ffigen/lib/src/code_generator/typealias.dart +++ b/pkgs/ffigen/lib/src/code_generator/typealias.dart @@ -14,7 +14,7 @@ import 'writer.dart'; /// typedef $name = $type; /// ); /// ``` -class Typealias extends NoLookUpBinding { +class Typealias extends BindingType { final Type type; final bool _useDartType; @@ -51,9 +51,29 @@ class Typealias extends NoLookUpBinding { if (dartDoc != null) { sb.write(makeDartDoc(dartDoc!)); } - sb.write( - 'typedef $name = ${_useDartType ? type.getDartType(w) : type.getCType(w)};\n'); + sb.write('typedef $name = '); + sb.write('${_useDartType ? type.getDartType(w) : type.getCType(w)};\n'); return BindingString( type: BindingStringType.typeDef, string: sb.toString()); } + + @override + Type get typealiasType => type.typealiasType; + + @override + bool get isIncompleteCompound => type.isIncompleteCompound; + + @override + String getCType(Writer w) => name; + + @override + String getDartType(Writer w) { + // Typealias cannot be used by name in Dart types unless both the C and Dart + // type of the underlying types are same. + if (sameDartAndCType(type, w)) { + return name; + } else { + return type.getDartType(w); + } + } } diff --git a/pkgs/ffigen/lib/src/code_generator/union.dart b/pkgs/ffigen/lib/src/code_generator/union.dart index a8a08611ca..fc7be967c7 100644 --- a/pkgs/ffigen/lib/src/code_generator/union.dart +++ b/pkgs/ffigen/lib/src/code_generator/union.dart @@ -32,7 +32,7 @@ class Union extends Compound { String? usr, String? originalName, required String name, - bool isInComplete = false, + bool isIncomplete = false, int? pack, String? dartDoc, List? members, @@ -41,7 +41,7 @@ class Union extends Compound { originalName: originalName, name: name, dartDoc: dartDoc, - isInComplete: isInComplete, + isIncomplete: isIncomplete, members: members, pack: pack, compoundType: CompoundType.union, diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart index f1eb651b7b..49e241867e 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart @@ -27,7 +27,7 @@ class _ParsedCompound { _ParsedCompound(this.compound); - bool get isInComplete => + bool get isIncomplete => unimplementedMemberType || flexibleArrayMember || bitFieldMember || @@ -45,7 +45,7 @@ class _ParsedCompound { int alignment = 0; bool get _isPacked { - if (!hasAttr || isInComplete) return false; + if (!hasAttr || isIncomplete) return false; if (hasPackedAttr) return true; return maxChildAlignment > alignment; @@ -185,7 +185,7 @@ void fillCompoundMembersIfNeeded( _stack.pop(); _logger.finest( - 'Opaque: ${parsed.isInComplete}, HasAttr: ${parsed.hasAttr}, AlignValue: ${parsed.alignment}, MaxChildAlignValue: ${parsed.maxChildAlignment}, PackValue: ${parsed.packValue}.'); + 'Opaque: ${parsed.isIncomplete}, HasAttr: ${parsed.hasAttr}, AlignValue: ${parsed.alignment}, MaxChildAlignValue: ${parsed.maxChildAlignment}, PackValue: ${parsed.packValue}.'); compound.pack = parsed.packValue; visitChildrenResultChecker(resultCode); @@ -218,13 +218,13 @@ void fillCompoundMembersIfNeeded( } // Clear all members if declaration is incomplete. - if (parsed.isInComplete) { + if (parsed.isIncomplete) { compound.members.clear(); } // C allows empty structs/union, but it's undefined behaviour at runtine. // So we need to mark a declaration incomplete if it has no members. - compound.isInComplete = parsed.isInComplete || compound.members.isEmpty; + compound.isIncomplete = parsed.isIncomplete || compound.members.isEmpty; } /// Visitor for the struct/union cursor [CXCursorKind.CXCursor_StructDecl]/ @@ -245,7 +245,7 @@ int _compoundMembersVisitor(clang_types.CXCursor cursor, } final mt = cursor.type().toCodeGenType(); - if (mt.broadType == BroadType.IncompleteArray) { + if (mt is IncompleteArray) { // TODO(68): Structs with flexible Array Members are not supported. parsed.flexibleArrayMember = true; } @@ -253,13 +253,13 @@ int _compoundMembersVisitor(clang_types.CXCursor cursor, // TODO(84): Struct with bitfields are not suppoorted. parsed.bitFieldMember = true; } - if (mt.broadType == BroadType.Handle) { + if (mt is HandleType) { parsed.dartHandleMember = true; } if (mt.isIncompleteCompound) { parsed.incompleteCompoundMember = true; } - if (mt.getBaseType().broadType == BroadType.Unimplemented) { + if (mt.baseType is UnimplementedType) { parsed.unimplementedMemberType = true; } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index 870cf47210..b4c40fc22e 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -35,8 +35,8 @@ Func? parseFunctionDeclaration(clang_types.CXCursor cursor) { final parameters = _getParameters(cursor, funcName); if (clang.clang_Cursor_isFunctionInlined(cursor) != 0) { - _logger.fine( - '---- Removed Function, reason: inline function: ${cursor.completeStringRepr()}'); + _logger.fine('---- Removed Function, reason: inline function: ' + '${cursor.completeStringRepr()}'); _logger.warning( "Skipped Function '$funcName', inline functions are not supported."); // Returning null so that [addToBindings] function excludes this. @@ -45,19 +45,22 @@ Func? parseFunctionDeclaration(clang_types.CXCursor cursor) { if (rt.isIncompleteCompound || _stack.top.incompleteStructParameter) { _logger.fine( - '---- Removed Function, reason: Incomplete struct pass/return by value: ${cursor.completeStringRepr()}'); + '---- Removed Function, reason: Incomplete struct pass/return by ' + 'value: ${cursor.completeStringRepr()}'); _logger.warning( - "Skipped Function '$funcName', Incomplete struct pass/return by value not supported."); + "Skipped Function '$funcName', Incomplete struct pass/return by " + 'value not supported.'); // Returning null so that [addToBindings] function excludes this. return _stack.pop().func; } - if (rt.getBaseType().broadType == BroadType.Unimplemented || + if (rt.baseType is UnimplementedType || _stack.top.unimplementedParameterType) { - _logger.fine( - '---- Removed Function, reason: unsupported return type or parameter type: ${cursor.completeStringRepr()}'); + _logger.fine('---- Removed Function, reason: unsupported return type or ' + 'parameter type: ${cursor.completeStringRepr()}'); _logger.warning( - "Skipped Function '$funcName', function has unsupported return type or parameter type."); + "Skipped Function '$funcName', function has unsupported return type " + 'or parameter type.'); // Returning null so that [addToBindings] function excludes this. return _stack.pop().func; } @@ -102,9 +105,8 @@ List _getParameters(clang_types.CXCursor cursor, String funcName) { final pt = _getParameterType(paramCursor); if (pt.isIncompleteCompound) { _stack.top.incompleteStructParameter = true; - } else if (pt.getBaseType().broadType == BroadType.Unimplemented) { - _logger - .finer('Unimplemented type: ${pt.getBaseType().unimplementedReason}'); + } else if (pt.baseType is UnimplementedType) { + _logger.finer('Unimplemented type: ${pt.baseType}'); _stack.top.unimplementedParameterType = true; } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index 1905c53ae6..41aae404df 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -41,11 +41,11 @@ Type? parseObjCInterfaceDeclaration(clang_types.CXCursor cursor) { _logger.fine('++++ Adding ObjC interface: ' 'Name: $name, ${cursor.completeStringRepr()}'); - return Type.objCInterface(ObjCInterface( + return ObjCInterface( usr: itfUsr, originalName: name, name: name, // TODO(#279): config.interfaceDecl.renameUsingConfig(name), dartDoc: getCursorDocComment(cursor), - )); + ); } void fillObjCInterfaceMethodsIfNeeded( @@ -88,7 +88,13 @@ void _parseSuperType(clang_types.CXCursor cursor) { final superType = cursor.type().toCodeGenType(); _logger.fine(' > Super type: ' '$superType ${cursor.completeStringRepr()}'); - _interfaceStack.top.interface.superType = superType.objCInterface; + final itf = _interfaceStack.top.interface; + if (superType is ObjCInterface) { + itf.superType = superType; + } else { + _logger.severe( + 'Super type of $itf is $superType, which is not a valid interface.'); + } } void _parseProperty(clang_types.CXCursor cursor) { @@ -108,7 +114,7 @@ void _parseProperty(clang_types.CXCursor cursor) { dartDoc: dartDoc, kind: ObjCMethodKind.propertyGetter, ); - getter.returnType = ObjCMethodType(fieldType); + getter.returnType = fieldType; itf.addMethod(getter); final setter = ObjCMethod( @@ -119,7 +125,7 @@ void _parseProperty(clang_types.CXCursor cursor) { dartDoc: dartDoc, kind: ObjCMethodKind.propertySetter, ); - setter.returnType = ObjCMethodType(Type.nativeType(SupportedNativeType.Void)); + setter.returnType = NativeType(SupportedNativeType.Void); setter.params.add(ObjCMethodParam(fieldType, 'value')); itf.addMethod(setter); } @@ -175,7 +181,7 @@ void _parseMethodReturnType(clang_types.CXCursor cursor) { '"${_interfaceStack.top.interface.originalName}" has multiple return ' 'types.'); } else { - parsed.method.returnType = ObjCMethodType(cursor.type().toCodeGenType()); + parsed.method.returnType = cursor.type().toCodeGenType(); _logger.fine(' >> Return type: ' '${parsed.method.returnType} ${cursor.completeStringRepr()}'); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart index d8f84cf089..988a45e39b 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart @@ -44,30 +44,28 @@ Typealias? parseTypedefDeclaration( if (bindingsIndex.isSeenUnsupportedTypealias(typedefUsr)) { // Do not process unsupported typealiases again. - } else if (s.broadType == BroadType.Unimplemented) { - _logger - .fine("Skipped Typedef '$typedefName': Unimplemented type referred."); + } else if (s is UnimplementedType) { + _logger.fine("Skipped Typedef '$typedefName': " + 'Unimplemented type referred.'); bindingsIndex.addUnsupportedTypealiasToSeen(typedefUsr); - } else if (s.broadType == BroadType.Compound && - s.compound!.originalName == typedefName) { + } else if (s is Compound && s.originalName == typedefName) { // Ignore typedef if it refers to a compound with the same original name. bindingsIndex.addUnsupportedTypealiasToSeen(typedefUsr); - _logger.fine( - "Skipped Typedef '$typedefName': Name matches with referred struct/union."); - } else if (s.broadType == BroadType.Enum) { + _logger.fine("Skipped Typedef '$typedefName': " + 'Name matches with referred struct/union.'); + } else if (s is EnumClass) { // Ignore typedefs to Enum. bindingsIndex.addUnsupportedTypealiasToSeen(typedefUsr); _logger.fine("Skipped Typedef '$typedefName': typedef to enum."); - } else if (s.broadType == BroadType.Handle) { + } else if (s is HandleType) { // Ignore typedefs to Handle. _logger.fine("Skipped Typedef '$typedefName': typedef to Dart Handle."); bindingsIndex.addUnsupportedTypealiasToSeen(typedefUsr); - } else if (s.broadType == BroadType.ConstantArray || - s.broadType == BroadType.IncompleteArray) { + } else if (s is ConstantArray || s is IncompleteArray) { // Ignore typedefs to Constant Array. _logger.fine("Skipped Typedef '$typedefName': typedef to array."); bindingsIndex.addUnsupportedTypealiasToSeen(typedefUsr); - } else if (s.broadType == BroadType.Boolean) { + } else if (s is BooleanType) { // Ignore typedefs to Boolean. _logger.fine("Skipped Typedef '$typedefName': typedef to bool."); bindingsIndex.addUnsupportedTypealiasToSeen(typedefUsr); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart index 9114f82e89..8376199fbf 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart @@ -27,9 +27,9 @@ Global? parseVarDeclaration(clang_types.CXCursor cursor) { _logger.fine('++++ Adding Global: ${cursor.completeStringRepr()}'); final type = cursor.type().toCodeGenType(); - if (type.getBaseType().broadType == BroadType.Unimplemented) { - _logger.fine( - '---- Removed Global, reason: unsupported type: ${cursor.completeStringRepr()}'); + if (type.baseType is UnimplementedType) { + _logger.fine('---- Removed Global, reason: unsupported type: ' + '${cursor.completeStringRepr()}'); _logger.warning("Skipped global variable '$name', type not supported."); return null; } diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart index 7778ddf505..f64397955d 100644 --- a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -46,10 +46,8 @@ int _rootCursorVisitor(clang_types.CXCursor cursor, clang_types.CXCursor parent, break; case clang_types.CXCursorKind.CXCursor_StructDecl: case clang_types.CXCursorKind.CXCursor_UnionDecl: - addToBindings(_getCodeGenTypeFromCursor(cursor)?.compound); - break; case clang_types.CXCursorKind.CXCursor_EnumDecl: - addToBindings(_getCodeGenTypeFromCursor(cursor)?.enumClass); + addToBindings(_getCodeGenTypeFromCursor(cursor)); break; case clang_types.CXCursorKind.CXCursor_MacroDefinition: saveMacroDefinition(cursor); @@ -58,7 +56,7 @@ int _rootCursorVisitor(clang_types.CXCursor cursor, clang_types.CXCursor parent, addToBindings(parseVarDeclaration(cursor)); break; case clang_types.CXCursorKind.CXCursor_ObjCInterfaceDecl: - addToBindings(_getCodeGenTypeFromCursor(cursor)?.objCInterface); + addToBindings(_getCodeGenTypeFromCursor(cursor)); break; default: _logger.finer('rootCursorVisitor: CursorKind not implemented'); @@ -83,6 +81,7 @@ void addToBindings(Binding? b) { } } -Type? _getCodeGenTypeFromCursor(clang_types.CXCursor cursor) { - return getCodeGenType(cursor.type(), ignoreFilter: false); +BindingType? _getCodeGenTypeFromCursor(clang_types.CXCursor cursor) { + final t = getCodeGenType(cursor.type(), ignoreFilter: false); + return t is BindingType ? t : null; } diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 0f487a937f..ae96a5a36c 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -46,11 +46,11 @@ Type getCodeGenType( case clang_types.CXTypeKind.CXType_ObjCObjectPointer: case clang_types.CXTypeKind.CXType_BlockPointer: case clang_types.CXTypeKind.CXType_ObjCId: - case clang_types.CXTypeKind.CXType_ObjCClass: case clang_types.CXTypeKind.CXType_ObjCTypeParam: - return Type.pointer(Type.struct(objCObjectType)); + case clang_types.CXTypeKind.CXType_ObjCClass: + return PointerType(objCObjectType); case clang_types.CXTypeKind.CXType_ObjCSel: - return Type.pointer(Type.struct(objCSelType)); + return PointerType(objCSelType); } } @@ -65,8 +65,7 @@ Type getCodeGenType( _createTypeFromCursor(cxtype, cursor, ignoreFilter, pointerReference); type = result.type; if (type == null) { - return Type.unimplemented( - 'Type: ${cxtype.kindSpelling()} not implemented'); + return UnimplementedType('${cxtype.kindSpelling()} not implemented'); } if (result.addToCache) { bindingsIndex.addTypeToSeen(usr, type); @@ -86,12 +85,12 @@ Type getCodeGenType( // Replace Pointer<_Dart_Handle> with Handle. if (config.useDartHandle && - s.broadType == BroadType.Compound && - s.compound!.compoundType == CompoundType.struct && - s.compound!.usr == strings.dartHandleUsr) { - return Type.handle(); + s is Compound && + s.compoundType == CompoundType.struct && + s.usr == strings.dartHandleUsr) { + return HandleType(); } - return Type.pointer(s); + return PointerType(s); case clang_types.CXTypeKind.CXType_FunctionProto: // Primarily used for function pointers. return _extractFromFunctionProto(cxtype); @@ -100,17 +99,17 @@ Type getCodeGenType( return _extractFromFunctionProto(cxtype); case clang_types.CXTypeKind .CXType_ConstantArray: // Primarily used for constant array in struct members. - return Type.constantArray( + return ConstantArray( clang.clang_getNumElements(cxtype), clang.clang_getArrayElementType(cxtype).toCodeGenType(), ); case clang_types.CXTypeKind .CXType_IncompleteArray: // Primarily used for incomplete array in function parameters. - return Type.incompleteArray( + return IncompleteArray( clang.clang_getArrayElementType(cxtype).toCodeGenType(), ); case clang_types.CXTypeKind.CXType_Bool: - return Type.boolean(); + return BooleanType(); default: var typeSpellKey = clang.clang_getTypeSpelling(cxtype).toStringAndDispose(); @@ -119,14 +118,13 @@ Type getCodeGenType( } if (config.nativeTypeMappings.containsKey(typeSpellKey)) { _logger.fine(' Type $typeSpellKey mapped from type-map.'); - return Type.importedType(config.nativeTypeMappings[typeSpellKey]!); + return config.nativeTypeMappings[typeSpellKey]!; } else if (cxTypeKindToImportedTypes.containsKey(typeSpellKey)) { - return Type.importedType(cxTypeKindToImportedTypes[typeSpellKey]!); + return cxTypeKindToImportedTypes[typeSpellKey]!; } else { - _logger.fine( - 'typedeclarationCursorVisitor: getCodeGenType: Type Not Implemented, ${cxtype.completeStringRepr()}'); - return Type.unimplemented( - 'Type: ${cxtype.kindSpelling()} not implemented'); + _logger.fine('typedeclarationCursorVisitor: getCodeGenType: Type Not ' + 'Implemented, ${cxtype.completeStringRepr()}'); + return UnimplementedType('${cxtype.kindSpelling()} not implemented'); } } } @@ -153,18 +151,18 @@ _CreateTypeFromCursorResult _createTypeFromCursor(clang_types.CXType cxtype, if (config.typedefTypeMappings.containsKey(spelling)) { _logger.fine(' Type $spelling mapped from type-map'); return _CreateTypeFromCursorResult( - Type.importedType(config.typedefTypeMappings[spelling]!)); + config.typedefTypeMappings[spelling]!); } // Get name from supported typedef name if config allows. if (config.useSupportedTypedefs) { if (suportedTypedefToSuportedNativeType.containsKey(spelling)) { _logger.fine(' Type Mapped from supported typedef'); return _CreateTypeFromCursorResult( - Type.nativeType(suportedTypedefToSuportedNativeType[spelling]!)); + NativeType(suportedTypedefToSuportedNativeType[spelling]!)); } else if (supportedTypedefToImportedType.containsKey(spelling)) { _logger.fine(' Type Mapped from supported typedef'); return _CreateTypeFromCursorResult( - Type.importedType(supportedTypedefToImportedType[spelling]!)); + supportedTypedefToImportedType[spelling]!); } } @@ -172,7 +170,7 @@ _CreateTypeFromCursorResult _createTypeFromCursor(clang_types.CXType cxtype, parseTypedefDeclaration(cursor, pointerReference: pointerReference); if (typealias != null) { - return _CreateTypeFromCursorResult(Type.typealias(typealias)); + return _CreateTypeFromCursorResult(typealias); } else { // Use underlying type if typealias couldn't be created or if the user // excluded this typedef. @@ -191,10 +189,10 @@ _CreateTypeFromCursorResult _createTypeFromCursor(clang_types.CXType cxtype, ); if (enumClass == null) { // Handle anonymous enum declarations within another declaration. - return _CreateTypeFromCursorResult(Type.nativeType(Type.enumNativeType), + return _CreateTypeFromCursorResult(EnumClass.nativeType, addToCache: false); } else { - return _CreateTypeFromCursorResult(Type.enumClass(enumClass)); + return _CreateTypeFromCursorResult(enumClass); } case clang_types.CXTypeKind.CXType_ObjCInterface: return _CreateTypeFromCursorResult(parseObjCInterfaceDeclaration(cursor)); @@ -206,11 +204,11 @@ _CreateTypeFromCursorResult _createTypeFromCursor(clang_types.CXType cxtype, void _fillFromCursorIfNeeded(Type? type, clang_types.CXCursor cursor, bool ignoreFilter, bool pointerReference) { if (type == null) return; - if (type.compound != null) { - fillCompoundMembersIfNeeded(type.compound!, cursor, + if (type is Compound) { + fillCompoundMembersIfNeeded(type, cursor, ignoreFilter: ignoreFilter, pointerReference: pointerReference); - } else if (type.objCInterface != null) { - fillObjCInterfaceMethodsIfNeeded(type.objCInterface!, cursor); + } else if (type is ObjCInterface) { + fillObjCInterfaceMethodsIfNeeded(type, cursor); } } @@ -244,7 +242,7 @@ Type? _extractfromRecord(clang_types.CXType cxtype, clang_types.CXCursor cursor, // TODO(23): Check if we should auto add compound declarations. if (compoundTypeMappings.containsKey(declSpelling)) { _logger.fine(' Type Mapped from type-map'); - return Type.importedType(compoundTypeMappings[declSpelling]!); + return compoundTypeMappings[declSpelling]!; } else { final struct = parseCompoundDeclaration( cursor, @@ -252,13 +250,12 @@ Type? _extractfromRecord(clang_types.CXType cxtype, clang_types.CXCursor cursor, ignoreFilter: ignoreFilter, pointerReference: pointerReference, ); - if (struct == null) return null; - return Type.compound(struct); + return struct; } } - _logger.fine( - 'typedeclarationCursorVisitor: _extractfromRecord: Not Implemented, ${cursor.completeStringRepr()}'); - return Type.unimplemented('Type: ${cxtype.kindSpelling()} not implemented'); + _logger.fine('typedeclarationCursorVisitor: _extractfromRecord: ' + 'Not Implemented, ${cursor.completeStringRepr()}'); + return UnimplementedType('${cxtype.kindSpelling()} not implemented'); } // Used for function pointer arguments. @@ -270,10 +267,10 @@ Type _extractFromFunctionProto(clang_types.CXType cxtype) { final pt = t.toCodeGenType(); if (pt.isIncompleteCompound) { - return Type.unimplemented( + return UnimplementedType( 'Incomplete Struct by value in function parameter.'); - } else if (pt.getBaseType().broadType == BroadType.Unimplemented) { - return Type.unimplemented('Function parameter has an unsupported type.'); + } else if (pt.baseType is UnimplementedType) { + return UnimplementedType('Function parameter has an unsupported type.'); } _parameters.add( @@ -281,8 +278,8 @@ Type _extractFromFunctionProto(clang_types.CXType cxtype) { ); } - return Type.nativeFunc(NativeFunc.fromFunctionType(FunctionType( + return NativeFunc(FunctionType( parameters: _parameters, returnType: clang.clang_getResultType(cxtype).toCodeGenType(), - ))); + )); } diff --git a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart index 9178cf01d0..5ef4980b02 100644 --- a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart @@ -15,7 +15,7 @@ void main() { Func( name: 'noParam', dartDoc: 'Just a test function\nheres another line', - returnType: Type.nativeType( + returnType: NativeType( SupportedNativeType.Int32, ), ), @@ -24,18 +24,18 @@ void main() { parameters: [ Parameter( name: 'a', - type: Type.nativeType( + type: NativeType( SupportedNativeType.Int32, ), ), Parameter( name: 'b', - type: Type.nativeType( + type: NativeType( SupportedNativeType.Uint8, ), ), ], - returnType: Type.nativeType( + returnType: NativeType( SupportedNativeType.Char, ), ), @@ -44,25 +44,25 @@ void main() { parameters: [ Parameter( name: 'a', - type: Type.pointer( - Type.nativeType( + type: PointerType( + NativeType( SupportedNativeType.Int32, ), ), ), Parameter( name: 'b', - type: Type.pointer( - Type.pointer( - Type.nativeType( + type: PointerType( + PointerType( + NativeType( SupportedNativeType.Uint8, ), ), ), ), ], - returnType: Type.pointer( - Type.nativeType( + returnType: PointerType( + NativeType( SupportedNativeType.Double, ), ), @@ -74,12 +74,12 @@ void main() { parameters: [ Parameter( name: 'a', - type: Type.nativeType( + type: NativeType( SupportedNativeType.Int32, ), ), ], - returnType: Type.nativeType( + returnType: NativeType( SupportedNativeType.Int32, ), ), @@ -93,49 +93,49 @@ void main() { final library = Library( name: 'Bindings', bindings: [ - Struc( + Struct( name: 'NoMember', dartDoc: 'Just a test struct\nheres another line', ), - Struc( + Struct( name: 'WithPrimitiveMember', members: [ Member( name: 'a', - type: Type.nativeType( + type: NativeType( SupportedNativeType.Int32, ), ), Member( name: 'b', - type: Type.nativeType( + type: NativeType( SupportedNativeType.Double, ), ), Member( name: 'c', - type: Type.nativeType( + type: NativeType( SupportedNativeType.Char, ), ), ], ), - Struc( + Struct( name: 'WithPointerMember', members: [ Member( name: 'a', - type: Type.pointer( - Type.nativeType( + type: PointerType( + NativeType( SupportedNativeType.Int32, ), ), ), Member( name: 'b', - type: Type.pointer( - Type.pointer( - Type.nativeType( + type: PointerType( + PointerType( + NativeType( SupportedNativeType.Double, ), ), @@ -143,7 +143,7 @@ void main() { ), Member( name: 'c', - type: Type.nativeType( + type: NativeType( SupportedNativeType.Char, ), ), @@ -156,24 +156,24 @@ void main() { }); test('Function and Struct Binding (pointer to Struct)', () { - final structSome = Struc( - name: 'SomeStruc', + final structSome = Struct( + name: 'SomeStruct', members: [ Member( name: 'a', - type: Type.nativeType( + type: NativeType( SupportedNativeType.Int32, ), ), Member( name: 'b', - type: Type.nativeType( + type: NativeType( SupportedNativeType.Double, ), ), Member( name: 'c', - type: Type.nativeType( + type: NativeType( SupportedNativeType.Char, ), ), @@ -188,19 +188,15 @@ void main() { parameters: [ Parameter( name: 'some', - type: Type.pointer( - Type.pointer( - Type.struct( - structSome, - ), + type: PointerType( + PointerType( + structSome, ), ), ), ], - returnType: Type.pointer( - Type.struct( - structSome, - ), + returnType: PointerType( + structSome, ), ), ], @@ -210,39 +206,37 @@ void main() { }); test('global (primitives, pointers, pointer to struct)', () { - final strucSome = Struc( + final structSome = Struct( name: 'Some', ); - final emptyGlobalStruc = Struc(name: 'EmptyStruct'); + final emptyGlobalStruct = Struct(name: 'EmptyStruct'); final library = Library( name: 'Bindings', bindings: [ Global( name: 'test1', - type: Type.nativeType( + type: NativeType( SupportedNativeType.Int32, ), ), Global( name: 'test2', - type: Type.pointer( - Type.nativeType( + type: PointerType( + NativeType( SupportedNativeType.Float, ), ), ), - strucSome, + structSome, Global( name: 'test5', - type: Type.pointer( - Type.struct( - strucSome, - ), + type: PointerType( + structSome, ), ), - emptyGlobalStruc, - Global(name: 'globalStruct', type: Type.struct(emptyGlobalStruc)), + emptyGlobalStruct, + Global(name: 'globalStruct', type: emptyGlobalStruct), ], ); _matchLib(library, 'global'); @@ -296,38 +290,38 @@ void main() { bindings: [ Func( name: 'test', - returnType: Type.nativeType(SupportedNativeType.Void), + returnType: NativeType(SupportedNativeType.Void), ), Func( name: '_test', - returnType: Type.nativeType(SupportedNativeType.Void), + returnType: NativeType(SupportedNativeType.Void), ), Func( name: '_c_test', - returnType: Type.nativeType(SupportedNativeType.Void), + returnType: NativeType(SupportedNativeType.Void), ), Func( name: '_dart_test', - returnType: Type.nativeType(SupportedNativeType.Void), + returnType: NativeType(SupportedNativeType.Void), ), - Struc( + Struct( name: '_Test', members: [ Member( name: 'array', - type: Type.constantArray( + type: ConstantArray( 2, - Type.nativeType( + NativeType( SupportedNativeType.Int8, ), ), ), ], ), - Struc(name: 'ArrayHelperPrefixCollisionTest'), + Struct(name: 'ArrayHelperPrefixCollisionTest'), Func( name: 'Test', - returnType: Type.nativeType(SupportedNativeType.Void), + returnType: NativeType(SupportedNativeType.Void), ), EnumClass(name: '_c_Test'), EnumClass(name: 'init_dylib'), @@ -343,16 +337,16 @@ void main() { bindings: [ Func( name: 'test1', - returnType: Type.boolean(), + returnType: BooleanType(), parameters: [ - Parameter(name: 'a', type: Type.boolean()), - Parameter(name: 'b', type: Type.pointer(Type.boolean())), + Parameter(name: 'a', type: BooleanType()), + Parameter(name: 'b', type: PointerType(BooleanType())), ], ), - Struc( + Struct( name: 'Test2', members: [ - Member(name: 'a', type: Type.boolean()), + Member(name: 'a', type: BooleanType()), ], ), ], @@ -366,16 +360,16 @@ void main() { bindings: [ Func( name: 'test1', - returnType: Type.boolean(), + returnType: BooleanType(), parameters: [ - Parameter(name: 'a', type: Type.boolean()), - Parameter(name: 'b', type: Type.pointer(Type.boolean())), + Parameter(name: 'a', type: BooleanType()), + Parameter(name: 'b', type: PointerType(BooleanType())), ], ), - Struc( + Struct( name: 'Test2', members: [ - Member(name: 'a', type: Type.boolean()), + Member(name: 'a', type: BooleanType()), ], ), ], @@ -387,10 +381,10 @@ void main() { name: 'Bindings', sort: true, bindings: [ - Func(name: 'b', returnType: Type.nativeType(SupportedNativeType.Void)), - Func(name: 'a', returnType: Type.nativeType(SupportedNativeType.Void)), - Struc(name: 'D'), - Struc(name: 'C'), + Func(name: 'b', returnType: NativeType(SupportedNativeType.Void)), + Func(name: 'a', returnType: NativeType(SupportedNativeType.Void)), + Struct(name: 'D'), + Struct(name: 'C'), ], ); _matchLib(library, 'sort_bindings'); @@ -399,35 +393,33 @@ void main() { final library = Library( name: 'Bindings', bindings: [ - Struc(name: 'NoPacking', pack: null, members: [ - Member(name: 'a', type: Type.nativeType(SupportedNativeType.Char)), + Struct(name: 'NoPacking', pack: null, members: [ + Member(name: 'a', type: NativeType(SupportedNativeType.Char)), ]), - Struc(name: 'Pack1', pack: 1, members: [ - Member(name: 'a', type: Type.nativeType(SupportedNativeType.Char)), + Struct(name: 'Pack1', pack: 1, members: [ + Member(name: 'a', type: NativeType(SupportedNativeType.Char)), ]), - Struc(name: 'Pack2', pack: 2, members: [ - Member(name: 'a', type: Type.nativeType(SupportedNativeType.Char)), + Struct(name: 'Pack2', pack: 2, members: [ + Member(name: 'a', type: NativeType(SupportedNativeType.Char)), ]), - Struc(name: 'Pack2', pack: 4, members: [ - Member(name: 'a', type: Type.nativeType(SupportedNativeType.Char)), + Struct(name: 'Pack2', pack: 4, members: [ + Member(name: 'a', type: NativeType(SupportedNativeType.Char)), ]), - Struc(name: 'Pack2', pack: 8, members: [ - Member(name: 'a', type: Type.nativeType(SupportedNativeType.Char)), + Struct(name: 'Pack2', pack: 8, members: [ + Member(name: 'a', type: NativeType(SupportedNativeType.Char)), ]), - Struc(name: 'Pack16', pack: 16, members: [ - Member(name: 'a', type: Type.nativeType(SupportedNativeType.Char)), + Struct(name: 'Pack16', pack: 16, members: [ + Member(name: 'a', type: NativeType(SupportedNativeType.Char)), ]), ], ); _matchLib(library, 'packed_structs'); }); test('Union Bindings', () { - final struct1 = Struc( - name: 'Struct1', - members: [Member(name: 'a', type: Type.importedType(charType))]); - final union1 = Union( - name: 'Union1', - members: [Member(name: 'a', type: Type.importedType(charType))]); + final struct1 = + Struct(name: 'Struct1', members: [Member(name: 'a', type: charType)]); + final union1 = + Union(name: 'Union1', members: [Member(name: 'a', type: charType)]); final library = Library( name: 'Bindings', bindings: [ @@ -435,27 +427,23 @@ void main() { union1, Union(name: 'EmptyUnion'), Union(name: 'Primitives', members: [ - Member(name: 'a', type: Type.importedType(charType)), - Member(name: 'b', type: Type.importedType(intType)), - Member(name: 'c', type: Type.importedType(floatType)), - Member(name: 'd', type: Type.importedType(doubleType)), + Member(name: 'a', type: charType), + Member(name: 'b', type: intType), + Member(name: 'c', type: floatType), + Member(name: 'd', type: doubleType), ]), Union(name: 'PrimitivesWithPointers', members: [ - Member(name: 'a', type: Type.importedType(charType)), - Member(name: 'b', type: Type.importedType(floatType)), - Member(name: 'c', type: Type.pointer(Type.importedType(doubleType))), - Member(name: 'd', type: Type.pointer(Type.union(union1))), - Member(name: 'd', type: Type.pointer(Type.struct(struct1))), + Member(name: 'a', type: charType), + Member(name: 'b', type: floatType), + Member(name: 'c', type: PointerType(doubleType)), + Member(name: 'd', type: PointerType(union1)), + Member(name: 'd', type: PointerType(struct1)), ]), Union(name: 'WithArray', members: [ - Member( - name: 'a', - type: Type.constantArray(10, Type.importedType(charType))), - Member(name: 'b', type: Type.constantArray(10, Type.union(union1))), - Member(name: 'b', type: Type.constantArray(10, Type.struct(struct1))), - Member( - name: 'c', - type: Type.constantArray(10, Type.pointer(Type.union(union1)))), + Member(name: 'a', type: ConstantArray(10, charType)), + Member(name: 'b', type: ConstantArray(10, union1)), + Member(name: 'b', type: ConstantArray(10, struct1)), + Member(name: 'c', type: ConstantArray(10, PointerType(union1))), ]), ], ); @@ -466,29 +454,26 @@ void main() { name: 'Bindings', header: '// ignore_for_file: non_constant_identifier_names\n', bindings: [ - Typealias( - name: 'RawUnused', type: Type.compound(Struc(name: 'Struct1'))), - Struc(name: 'WithTypealiasStruc', members: [ + Typealias(name: 'RawUnused', type: Struct(name: 'Struct1')), + Struct(name: 'WithTypealiasStruct', members: [ Member( name: 't', - type: Type.typealias(Typealias( + type: Typealias( name: 'Struct2Typealias', - type: Type.struct(Struc(name: 'Struct2', members: [ - Member(name: 'a', type: Type.importedType(doubleType)) - ]))))) + type: Struct( + name: 'Struct2', + members: [Member(name: 'a', type: doubleType)]))) ]), Func( - name: 'WithTypealiasStruc', - returnType: Type.pointer(Type.nativeFunc( - NativeFunc.fromFunctionType(FunctionType( - returnType: Type.nativeType(SupportedNativeType.Void), - parameters: [])))), + name: 'WithTypealiasStruct', + returnType: PointerType(NativeFunc(FunctionType( + returnType: NativeType(SupportedNativeType.Void), + parameters: []))), parameters: [ Parameter( name: 't', - type: Type.typealias(Typealias( - name: 'Struct3Typealias', - type: Type.struct(Struc(name: 'Struct3'))))) + type: Typealias( + name: 'Struct3Typealias', type: Struct(name: 'Struct3'))) ]), ], ); diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart index df895e3412..73a44cc01f 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart @@ -18,8 +18,8 @@ class Bindings { lookup) : _lookup = lookup; - ffi.Pointer someFunc( - ffi.Pointer> some, + ffi.Pointer someFunc( + ffi.Pointer> some, ) { return _someFunc( some, @@ -28,13 +28,13 @@ class Bindings { late final _someFuncPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer>)>>('someFunc'); + ffi.Pointer Function( + ffi.Pointer>)>>('someFunc'); late final _someFunc = _someFuncPtr.asFunction< - ffi.Pointer Function(ffi.Pointer>)>(); + ffi.Pointer Function(ffi.Pointer>)>(); } -class SomeStruc extends ffi.Struct { +class SomeStruct extends ffi.Struct { @ffi.Int32() external int a; diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart index e0c4884ec0..206a36ccd2 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart @@ -20,19 +20,19 @@ class Bindings { lookup) : _lookup = lookup; - ffi.Pointer> WithTypealiasStruc1( + ffi.Pointer> WithTypealiasStruct1( Struct3Typealias t, ) { - return _WithTypealiasStruc1( + return _WithTypealiasStruct1( t, ); } - late final _WithTypealiasStruc1Ptr = _lookup< + late final _WithTypealiasStruct1Ptr = _lookup< ffi.NativeFunction< ffi.Pointer> Function( - Struct3Typealias)>>('WithTypealiasStruc'); - late final _WithTypealiasStruc1 = _WithTypealiasStruc1Ptr.asFunction< + Struct3Typealias)>>('WithTypealiasStruct'); + late final _WithTypealiasStruct1 = _WithTypealiasStruct1Ptr.asFunction< ffi.Pointer> Function( Struct3Typealias)>(); } @@ -41,7 +41,7 @@ typedef RawUnused = Struct1; class Struct1 extends ffi.Opaque {} -class WithTypealiasStruc extends ffi.Struct { +class WithTypealiasStruct extends ffi.Struct { external Struct2Typealias t; } diff --git a/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart index 914563bf9b..4529f29014 100644 --- a/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart @@ -14,16 +14,14 @@ void main() { }); test('declaration conflict', () { final l1 = Library(name: 'Bindings', bindings: [ - Struc(name: 'TestStruc'), - Struc(name: 'TestStruc'), + Struct(name: 'TestStruct'), + Struct(name: 'TestStruct'), EnumClass(name: 'TestEnum'), EnumClass(name: 'TestEnum'), Func( - name: 'testFunc', - returnType: Type.nativeType(SupportedNativeType.Void)), + name: 'testFunc', returnType: NativeType(SupportedNativeType.Void)), Func( - name: 'testFunc', - returnType: Type.nativeType(SupportedNativeType.Void)), + name: 'testFunc', returnType: NativeType(SupportedNativeType.Void)), Constant( originalName: 'Test_Macro', name: 'Test_Macro', @@ -37,40 +35,37 @@ void main() { rawValue: '0', ), Typealias( - name: 'testAlias', type: Type.nativeType(SupportedNativeType.Void)), + name: 'testAlias', type: NativeType(SupportedNativeType.Void)), Typealias( - name: 'testAlias', type: Type.nativeType(SupportedNativeType.Void)), + name: 'testAlias', type: NativeType(SupportedNativeType.Void)), /// Conflicts across declarations. - Struc(name: 'testCrossDecl'), + Struct(name: 'testCrossDecl'), Func( name: 'testCrossDecl', - returnType: Type.nativeType(SupportedNativeType.Void)), + returnType: NativeType(SupportedNativeType.Void)), Constant(name: 'testCrossDecl', rawValue: '0', rawType: 'int'), EnumClass(name: 'testCrossDecl'), Typealias( - name: 'testCrossDecl', - type: Type.nativeType(SupportedNativeType.Void)), + name: 'testCrossDecl', type: NativeType(SupportedNativeType.Void)), /// Conflicts with ffi library prefix, name of prefix is changed. - Struc(name: 'ffi'), - Func( - name: 'ffi1', - returnType: Type.nativeType(SupportedNativeType.Void)), + Struct(name: 'ffi'), + Func(name: 'ffi1', returnType: NativeType(SupportedNativeType.Void)), ]); final l2 = Library(name: 'Bindings', bindings: [ - Struc(name: 'TestStruc'), - Struc(name: 'TestStruc1'), + Struct(name: 'TestStruct'), + Struct(name: 'TestStruct1'), EnumClass(name: 'TestEnum'), EnumClass(name: 'TestEnum1'), Func( name: 'testFunc', originalName: 'testFunc', - returnType: Type.nativeType(SupportedNativeType.Void)), + returnType: NativeType(SupportedNativeType.Void)), Func( name: 'testFunc1', originalName: 'testFunc', - returnType: Type.nativeType(SupportedNativeType.Void)), + returnType: NativeType(SupportedNativeType.Void)), Constant( originalName: 'Test_Macro', name: 'Test_Macro', @@ -84,24 +79,20 @@ void main() { rawValue: '0', ), Typealias( - name: 'testAlias', type: Type.nativeType(SupportedNativeType.Void)), + name: 'testAlias', type: NativeType(SupportedNativeType.Void)), Typealias( - name: 'testAlias1', - type: Type.nativeType(SupportedNativeType.Void)), - Struc(name: 'testCrossDecl', originalName: 'testCrossDecl'), + name: 'testAlias1', type: NativeType(SupportedNativeType.Void)), + Struct(name: 'testCrossDecl', originalName: 'testCrossDecl'), Func( name: 'testCrossDecl1', originalName: 'testCrossDecl', - returnType: Type.nativeType(SupportedNativeType.Void)), + returnType: NativeType(SupportedNativeType.Void)), Constant(name: 'testCrossDecl2', rawValue: '0', rawType: 'int'), EnumClass(name: 'testCrossDecl3'), Typealias( - name: 'testCrossDecl4', - type: Type.nativeType(SupportedNativeType.Void)), - Struc(name: 'ffi'), - Func( - name: 'ffi1', - returnType: Type.nativeType(SupportedNativeType.Void)), + name: 'testCrossDecl4', type: NativeType(SupportedNativeType.Void)), + Struct(name: 'ffi'), + Func(name: 'ffi1', returnType: NativeType(SupportedNativeType.Void)), ]); expect(l1.generate(), l2.generate()); diff --git a/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart b/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart index 9520139796..1d2744b135 100644 --- a/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart @@ -17,18 +17,18 @@ void main() { header: '// ignore_for_file: unused_element, camel_case_types, non_constant_identifier_names\n', bindings: [ - Struc(name: 'addresses'), - Struc(name: '_SymbolAddresses'), + Struct(name: 'addresses'), + Struct(name: '_SymbolAddresses'), EnumClass(name: 'Bindings'), Func( name: '_library', - returnType: Type.nativeType(SupportedNativeType.Void), + returnType: NativeType(SupportedNativeType.Void), exposeSymbolAddress: true, exposeFunctionTypedefs: true, ), Func( name: '_SymbolAddresses_1', - returnType: Type.nativeType(SupportedNativeType.Void), + returnType: NativeType(SupportedNativeType.Void), exposeSymbolAddress: true, ), ], diff --git a/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart b/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart index eb2e61c13e..c6873f295c 100644 --- a/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart @@ -15,73 +15,70 @@ void main() { }); test('reserved keyword collision', () { final l1 = Library(name: 'Bindings', bindings: [ - Struc(name: 'abstract'), - Struc(name: 'abstract'), - Struc(name: 'if'), + Struct(name: 'abstract'), + Struct(name: 'abstract'), + Struct(name: 'if'), EnumClass(name: 'return'), EnumClass(name: 'export'), - Func( - name: 'show', - returnType: Type.nativeType(SupportedNativeType.Void)), + Func(name: 'show', returnType: NativeType(SupportedNativeType.Void)), Func( name: 'implements', parameters: [ Parameter( - type: Type.importedType(intType), + type: intType, name: 'if', ), Parameter( - type: Type.importedType(intType), + type: intType, name: 'abstract', ), Parameter( - type: Type.importedType(intType), + type: intType, name: 'in', ), ], - returnType: Type.nativeType(SupportedNativeType.Void)), + returnType: NativeType(SupportedNativeType.Void)), Constant( name: 'else', rawType: 'int', rawValue: '0', ), - Typealias(name: 'var', type: Type.nativeType(SupportedNativeType.Void)), + Typealias(name: 'var', type: NativeType(SupportedNativeType.Void)), ]); final l2 = Library(name: 'Bindings', bindings: [ - Struc(name: 'abstract1'), - Struc(name: 'abstract2'), - Struc(name: 'if1'), + Struct(name: 'abstract1'), + Struct(name: 'abstract2'), + Struct(name: 'if1'), EnumClass(name: 'return1'), EnumClass(name: 'export1'), Func( name: 'show1', originalName: 'show', - returnType: Type.nativeType(SupportedNativeType.Void)), + returnType: NativeType(SupportedNativeType.Void)), Func( name: 'implements1', originalName: 'implements', parameters: [ Parameter( - type: Type.importedType(intType), + type: intType, name: 'if1', ), Parameter( - type: Type.importedType(intType), + type: intType, name: 'abstract1', ), Parameter( - type: Type.importedType(intType), + type: intType, name: 'in1', ), ], - returnType: Type.nativeType(SupportedNativeType.Void)), + returnType: NativeType(SupportedNativeType.Void)), Constant( name: 'else1', rawType: 'int', rawValue: '0', ), - Typealias( - name: 'var1', type: Type.nativeType(SupportedNativeType.Void)), + Typealias(name: 'var1', type: NativeType(SupportedNativeType.Void)), ]); expect(l1.generate(), l2.generate()); }); diff --git a/pkgs/ffigen/test/config_tests/packed_struct_override_test.dart b/pkgs/ffigen/test/config_tests/packed_struct_override_test.dart index ca371d8f56..9f9726dfce 100644 --- a/pkgs/ffigen/test/config_tests/packed_struct_override_test.dart +++ b/pkgs/ffigen/test/config_tests/packed_struct_override_test.dart @@ -54,9 +54,9 @@ ${strings.structs}: final library = parse(config); - expect((library.getBinding('NormalStruct1') as Struc).pack, 1); - expect((library.getBinding('StructWithAttr') as Struc).pack, 2); - expect((library.getBinding('PackedAttr') as Struc).pack, null); + expect((library.getBinding('NormalStruct1') as Struct).pack, 1); + expect((library.getBinding('StructWithAttr') as Struct).pack, 2); + expect((library.getBinding('PackedAttr') as Struct).pack, null); }); }); } diff --git a/pkgs/ffigen/test/header_parser_tests/dart_handle.h b/pkgs/ffigen/test/header_parser_tests/dart_handle.h index 8a2d802ceb..26d73fa82a 100644 --- a/pkgs/ffigen/test/header_parser_tests/dart_handle.h +++ b/pkgs/ffigen/test/header_parser_tests/dart_handle.h @@ -12,14 +12,14 @@ typedef void (*Typedef1)(Dart_Handle); void func4(Typedef1); // Dart_Handle isn't supported directly, so all members are removed. -struct Struc1 +struct Struct1 { Dart_Handle h; int a; }; // Pointer works. -struct Struc2 +struct Struct2 { Dart_Handle *h; }; diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart index 14b429c665..e9ebee7340 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart @@ -71,8 +71,8 @@ class NativeLibrary { typedef Typedef1 = ffi.Pointer>; -class Struc1 extends ffi.Opaque {} +class Struct1 extends ffi.Opaque {} -class Struc2 extends ffi.Struct { +class Struct2 extends ffi.Struct { external ffi.Pointer h; } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart index baf9c6eb82..a980d68abf 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart @@ -64,7 +64,7 @@ class NativeLibrary { _funcWithNativeFuncPtr.asFunction(); } -class Struc extends ffi.Struct { +class Struct extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -75,7 +75,7 @@ typedef WithTypedefReturnType = ffi.Pointer>; typedef InsideReturnType = ffi.Pointer>; -class Struc2 extends ffi.Struct { +class Struct2 extends ffi.Struct { external VoidFuncPointer constFuncPointer; } diff --git a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart index d56cd4e620..98dfafec4d 100644 --- a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart @@ -48,13 +48,13 @@ ${strings.headers}: expected.getBindingAsString('Struct2')); }); test('Struct3 flexible array member', () { - expect((actual.getBinding('Struct3') as Struc).members.isEmpty, true); + expect((actual.getBinding('Struct3') as Struct).members.isEmpty, true); }); test('Struct4 bit field member', () { - expect((actual.getBinding('Struct4') as Struc).members.isEmpty, true); + expect((actual.getBinding('Struct4') as Struct).members.isEmpty, true); }); test('Struct5 incompleted struct member', () { - expect((actual.getBinding('Struct5') as Struc).members.isEmpty, true); + expect((actual.getBinding('Struct5') as Struct).members.isEmpty, true); }); test('Struct6 typedef constant array', () { expect(actual.getBindingAsString('Struct6'), @@ -68,59 +68,56 @@ ${strings.headers}: } Library expectedLibrary() { - final struc1 = Struc(name: 'Struct1', members: [ + final struct1 = Struct(name: 'Struct1', members: [ Member( name: 'a', - type: Type.importedType(intType), + type: intType, ), ]); - final struc2 = Struc(name: 'Struct2', members: [ + final struct2 = Struct(name: 'Struct2', members: [ Member( name: 'a', - type: Type.struct(struc1), + type: struct1, ), ]); - final struc3 = Struc(name: 'Struct3'); + final struct3 = Struct(name: 'Struct3'); return Library( name: 'Bindings', bindings: [ - struc1, - struc2, - struc3, + struct1, + struct2, + struct3, Func( name: 'func1', parameters: [ - Parameter(name: 's', type: Type.pointer(Type.struct(struc2))), + Parameter(name: 's', type: PointerType(struct2)), ], - returnType: Type.nativeType( + returnType: NativeType( SupportedNativeType.Void, ), ), Func( name: 'func2', parameters: [ - Parameter(name: 's', type: Type.pointer(Type.struct(struc3))), + Parameter(name: 's', type: PointerType(struct3)), ], - returnType: Type.nativeType( + returnType: NativeType( SupportedNativeType.Void, ), ), Func( name: 'func3', parameters: [ - Parameter(name: 'a', type: Type.pointer(Type.importedType(intType))), + Parameter(name: 'a', type: PointerType(intType)), ], - returnType: Type.nativeType( + returnType: NativeType( SupportedNativeType.Void, ), ), - Struc(name: 'Struct4'), - Struc(name: 'Struct5'), - Struc(name: 'Struct6', members: [ - Member( - name: 'a', - type: Type.constantArray( - 2, Type.constantArray(10, Type.importedType(intType)))) + Struct(name: 'Struct4'), + Struct(name: 'Struct5'), + Struct(name: 'Struct6', members: [ + Member(name: 'a', type: ConstantArray(2, ConstantArray(10, intType))) ]), ], ); diff --git a/pkgs/ffigen/test/header_parser_tests/globals_test.dart b/pkgs/ffigen/test/header_parser_tests/globals_test.dart index be10f3c24b..1872ced9ce 100644 --- a/pkgs/ffigen/test/header_parser_tests/globals_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/globals_test.dart @@ -66,34 +66,32 @@ ${strings.compilerOpts}: '-Wno-nullability-completeness' } Library expectedLibrary() { - final globalStruc = Struc(name: 'EmptyStruct'); + final globalStruct = Struct(name: 'EmptyStruct'); return Library( name: 'Bindings', bindings: [ - Global(type: Type.boolean(), name: 'coolGlobal'), + Global(type: BooleanType(), name: 'coolGlobal'), Global( - type: Type.nativeType(SupportedNativeType.Int32), + type: NativeType(SupportedNativeType.Int32), name: 'myInt', exposeSymbolAddress: true, ), Global( - type: Type.pointer(Type.nativeType(SupportedNativeType.Int32)), + type: PointerType(NativeType(SupportedNativeType.Int32)), name: 'aGlobalPointer', exposeSymbolAddress: true, ), - globalStruc, + globalStruct, Global( name: 'globalStruct', - type: Type.struct(globalStruc), + type: globalStruct, exposeSymbolAddress: true, ), Global( name: 'globalStruct_from_alias', - type: Type.typealias( - Typealias( - name: 'EmptyStruct_Alias', - type: Type.struct(globalStruc), - ), + type: Typealias( + name: 'EmptyStruct_Alias', + type: globalStruct, ), exposeSymbolAddress: true, ) diff --git a/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h b/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h index 8b942d0e62..0c6f7a0017 100644 --- a/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h +++ b/pkgs/ffigen/test/header_parser_tests/native_func_typedef.h @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -struct Struc +struct Struct { void (*unnamed1)(void (*unnamed2)()); }; @@ -17,6 +17,6 @@ typedef InsideReturnType (*WithTypedefReturnType)(); void funcWithNativeFunc(WithTypedefReturnType named); typedef void (*VoidFuncPointer)(); -struct Struc2{ +struct Struct2{ const VoidFuncPointer constFuncPointer; }; diff --git a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart index 10dc3906f7..70c205d764 100644 --- a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart @@ -61,55 +61,55 @@ ${strings.structs}: } Library expectedLibrary() { - final struc2 = Struc(name: 'Struct2', members: [ + final struct2 = Struct(name: 'Struct2', members: [ Member( name: 'e', - type: Type.importedType(intType), + type: intType, ), Member( name: 'f', - type: Type.importedType(intType), + type: intType, ), ]); - final unnamedInternalStruc = Struc(name: 'UnnamedStruct1', members: [ + final unnamedInternalStruct = Struct(name: 'UnnamedStruct1', members: [ Member( name: 'a', - type: Type.importedType(intType), + type: intType, ), Member( name: 'b', - type: Type.importedType(intType), + type: intType, ), ]); return Library( name: 'Bindings', bindings: [ - unnamedInternalStruc, - struc2, - Struc(name: 'Struct1', members: [ + unnamedInternalStruct, + struct2, + Struct(name: 'Struct1', members: [ Member( name: 'a', - type: Type.importedType(intType), + type: intType, ), Member( name: 'b', - type: Type.importedType(intType), + type: intType, ), - Member(name: 'struct2', type: Type.pointer(Type.struct(struc2))), + Member(name: 'struct2', type: PointerType(struct2)), ]), - Struc(name: 'Struct3', members: [ + Struct(name: 'Struct3', members: [ Member( name: 'a', - type: Type.importedType(intType), + type: intType, ), Member( name: 'b', - type: Type.struct(unnamedInternalStruc), + type: unnamedInternalStruct, ), ]), - Struc(name: 'EmptyStruct'), - Struc(name: 'Struct4'), - Struc(name: 'Struct5'), + Struct(name: 'EmptyStruct'), + Struct(name: 'Struct4'), + Struct(name: 'Struct5'), ], ); } diff --git a/pkgs/ffigen/test/rename_tests/rename_test.dart b/pkgs/ffigen/test/rename_tests/rename_test.dart index 896b3dbde9..0b976a89cb 100644 --- a/pkgs/ffigen/test/rename_tests/rename_test.dart +++ b/pkgs/ffigen/test/rename_tests/rename_test.dart @@ -161,109 +161,109 @@ ${strings.typedefs}: } Library expectedLibrary() { - final struc1 = Struc(name: '${structPrefix}Struct1'); - final struc2 = Struc(name: 'Struct2'); - final struc3 = Struc(name: 'Struct3'); + final struct1 = Struct(name: '${structPrefix}Struct1'); + final struct2 = Struct(name: 'Struct2'); + final struct3 = Struct(name: 'Struct3'); return Library( name: 'Bindings', bindings: [ Func( name: '${functionPrefix}func1', originalName: 'func1', - returnType: Type.nativeType( + returnType: NativeType( SupportedNativeType.Void, ), parameters: [ Parameter( name: 's', - type: Type.pointer(Type.struct(struc1)), + type: PointerType(struct1), ), ], ), Func( name: 'func2', originalName: 'test_func2', - returnType: Type.nativeType( + returnType: NativeType( SupportedNativeType.Void, ), parameters: [ Parameter( name: 's', - type: Type.pointer(Type.struct(struc2)), + type: PointerType(struct2), ), ], ), Func( name: 'func3', originalName: 'fullMatch_func3', - returnType: Type.nativeType( + returnType: NativeType( SupportedNativeType.Void, ), parameters: [ Parameter( name: 's', - type: Type.pointer(Type.struct(struc3)), + type: PointerType(struct3), ), ], ), Func( name: '${functionPrefix}memberRename_func4', originalName: 'memberRename_func4', - returnType: Type.nativeType( + returnType: NativeType( SupportedNativeType.Void, ), parameters: [ Parameter( name: 'underscore', - type: Type.importedType(intType), + type: intType, ), Parameter( name: 'fullMatchSuccess', - type: Type.importedType(floatType), + type: floatType, ), Parameter( name: 'unnamed', - type: Type.importedType(intType), + type: intType, ), ], ), Func( name: '${functionPrefix}typedefRenameFunc', originalName: 'typedefRenameFunc', - returnType: Type.nativeType( + returnType: NativeType( SupportedNativeType.Void, ), parameters: [ Parameter( name: 's', - type: Type.typealias(Typealias( + type: Typealias( name: 'Struct5_Alias_Renamed', - type: Type.struct(Struc(name: '${structPrefix}Struct5')))), + type: Struct(name: '${structPrefix}Struct5')), ), ], ), - struc1, - struc2, - struc3, - Struc( + struct1, + struct2, + struct3, + Struct( name: '${structPrefix}MemberRenameStruct4', members: [ Member( name: 'underscore', - type: Type.importedType(intType), + type: intType, ), Member( name: 'fullMatchSuccess', - type: Type.importedType(floatType), + type: floatType, ), ], ), - Struc( + Struct( name: '${structPrefix}AnyMatchStruct5', members: [ Member( name: 'underscore', - type: Type.importedType(intType), + type: intType, ), ], ), From 54ced0d7d79026913883500fde2d83f8ffe4190b Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Fri, 8 Apr 2022 09:32:10 -0700 Subject: [PATCH 110/276] [ffigen] Add an integration test for objective C (#293) * Add an integration test for objective C * Switch CI to use test/setup.dart * Trying to fix CI * Report generated file --- .../ffigen/.github/workflows/test-package.yml | 4 +- pkgs/ffigen/README.md | 5 +- .../lib/src/code_generator/binding.dart | 6 + pkgs/ffigen/lib/src/code_generator/func.dart | 2 + .../lib/src/code_generator/library.dart | 2 +- .../src/code_generator/objc_interface.dart | 10 +- .../_expected_objc_interface_bindings.dart | 2 +- pkgs/ffigen/test/native_objc_test/config.yaml | 17 + .../native_objc_test/native_objc_test.dart | 62 + .../test/native_objc_test/native_objc_test.m | 32 + .../native_objc_test_bindings.dart | 2285 +++++++++++++++++ pkgs/ffigen/test/native_objc_test/setup.dart | 36 + pkgs/ffigen/test/setup.dart | 36 + 13 files changed, 2490 insertions(+), 9 deletions(-) create mode 100644 pkgs/ffigen/test/native_objc_test/config.yaml create mode 100644 pkgs/ffigen/test/native_objc_test/native_objc_test.dart create mode 100644 pkgs/ffigen/test/native_objc_test/native_objc_test.m create mode 100644 pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart create mode 100644 pkgs/ffigen/test/native_objc_test/setup.dart create mode 100644 pkgs/ffigen/test/setup.dart diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 67a6c954e0..90e290eecf 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -49,7 +49,7 @@ jobs: - name: Install libclang-10-dev run: sudo apt-get install libclang-10-dev - name: Build test dylib - run: cd test/native_test && dart build_test_dylib.dart && cd ../.. + run: dart test/setup.dart - name: Run VM tests run: dart test --platform vm - name: Collect coverage @@ -71,7 +71,7 @@ jobs: - name: Install dependencies run: dart pub get - name: Build test dylib - run: cd test/native_test && dart build_test_dylib.dart && cd ../.. + run: dart test/setup.dart - name: Run VM tests run: dart test --platform vm - name: Collect coverage diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 3665b12179..bc718b8425 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -509,9 +509,8 @@ language: 'objc' 2. Run `dart run ffigen`. ## Running Tests -1. Dynamic library for some tests need to be built before running the examples. - 1. `cd test/native_test`. - 2. Run `dart build_test_dylib.dart`. +Dynamic library for some tests need to be built before running the examples. +Run `dart test/setup.dart` to build the libraries. Run tests from the root of the package with `dart run test`. > Note: If llvm is not installed in one of the default locations, tests may fail. diff --git a/pkgs/ffigen/lib/src/code_generator/binding.dart b/pkgs/ffigen/lib/src/code_generator/binding.dart index 105d6f00fa..2e2f189ef2 100644 --- a/pkgs/ffigen/lib/src/code_generator/binding.dart +++ b/pkgs/ffigen/lib/src/code_generator/binding.dart @@ -19,12 +19,14 @@ abstract class Binding { String name; final String? dartDoc; + final bool isInternal; Binding({ required this.usr, required this.originalName, required this.name, this.dartDoc, + this.isInternal = false, }); /// Get all dependencies, including itself and save them in [dependencies]. @@ -44,11 +46,13 @@ abstract class LookUpBinding extends Binding { String? originalName, required String name, String? dartDoc, + bool isInternal = false, }) : super( usr: usr ?? name, originalName: originalName ?? name, name: name, dartDoc: dartDoc, + isInternal: isInternal, ); } @@ -59,10 +63,12 @@ abstract class NoLookUpBinding extends Binding { String? originalName, required String name, String? dartDoc, + bool isInternal = false, }) : super( usr: usr ?? name, originalName: originalName ?? name, name: name, dartDoc: dartDoc, + isInternal: isInternal, ); } diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index 815c3036ee..2f64de19d7 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -48,6 +48,7 @@ class Func extends LookUpBinding { this.exposeSymbolAddress = false, this.exposeFunctionTypedefs = false, this.isLeaf = false, + bool isInternal = false, }) : functionType = FunctionType( returnType: returnType, parameters: parameters ?? const [], @@ -57,6 +58,7 @@ class Func extends LookUpBinding { originalName: originalName, name: name, dartDoc: dartDoc, + isInternal: isInternal, ) { for (var i = 0; i < functionType.parameters.length; i++) { if (functionType.parameters[i].name.trim() == '') { diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index e00215ce7f..87eb9de3c1 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -90,7 +90,7 @@ class Library { /// Logs a warning if generated declaration will be private. void _warnIfPrivateDeclaration(Binding b) { - if (b.name.startsWith('_')) { + if (b.name.startsWith('_') && !b.isInternal) { _logger.warning( "Generated declaration '${b.name}' start's with '_' and therefore will be private."); } diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 23724855d3..3425a077c1 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -34,6 +34,7 @@ class _ObjCBuiltInFunctions { originalName: 'sel_registerName', returnType: PointerType(objCSelType), parameters: [Parameter(name: 'str', type: PointerType(charType))], + isInternal: true, ); late final String registerName; @@ -42,6 +43,7 @@ class _ObjCBuiltInFunctions { originalName: 'objc_getClass', returnType: PointerType(objCObjectType), parameters: [Parameter(name: 'str', type: PointerType(charType))], + isInternal: true, ); late final String getClass; @@ -62,6 +64,7 @@ class _ObjCBuiltInFunctions { Parameter(name: 'sel', type: PointerType(objCSelType)), for (final p in params) Parameter(name: p.name, type: p.type), ], + isInternal: true, ); return _msgSendFuncs[key]!; } @@ -175,9 +178,12 @@ class ObjCInterface extends BindingType { } s.write(' '); if (isStatic) s.write('static '); - s.write('${_getConvertedType(m.returnType!, w, name)} '); + if (m.kind == ObjCMethodKind.propertySetter) { + s.write('set '); + } else { + s.write('${_getConvertedType(m.returnType!, w, name)} '); + } if (m.kind == ObjCMethodKind.propertyGetter) s.write('get '); - if (m.kind == ObjCMethodKind.propertySetter) s.write('set '); s.write(methodName); if (m.kind != ObjCMethodKind.propertyGetter) { s.write('('); diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart index e584704e91..6342aadde1 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart @@ -569,7 +569,7 @@ class Foo extends NSObject { } static ffi.Pointer? _sel_someProperty1; - void set someProperty(int value) { + set someProperty(int value) { _sel_someProperty1 ??= _registerName(_lib, "setSomeProperty:"); return _lib._objc_msgSend_22(_id, _sel_someProperty1!, value); } diff --git a/pkgs/ffigen/test/native_objc_test/config.yaml b/pkgs/ffigen/test/native_objc_test/config.yaml new file mode 100644 index 0000000000..d7bb00245f --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/config.yaml @@ -0,0 +1,17 @@ +# Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +# =================== GENERATING TEST BINDINGS ================== +# dart run ffigen --config test/native_objc_test/config.yaml +# =============================================================== + +name: NativeObjCLibrary +description: 'Native Objective C test' +language: objc +output: 'test/native_objc_test/native_objc_test_bindings.dart' +headers: + entry-points: + - 'test/native_objc_test/native_objc_test.m' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart new file mode 100644 index 0000000000..9f2e219de5 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart @@ -0,0 +1,62 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:ffigen/ffigen.dart'; +import 'package:path/path.dart' as path; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart'; +import '../test_utils.dart'; +import 'native_objc_test_bindings.dart'; + +void main() { + late NativeObjCLibrary lib; + group('native_objc_test', () { + setUpAll(() { + logWarnings(); + lib = NativeObjCLibrary(DynamicLibrary.open( + File('test/native_objc_test/native_objc_test.dylib').absolute.path)); + }); + + test('generate_bindings', () { + final config = Config.fromYaml(loadYaml( + File(path.join('test', 'native_objc_test', 'config.yaml')) + .readAsStringSync()) as YamlMap); + final library = parse(config); + final file = File( + path.join('test', 'debug_generated', 'native_objc_test_bindings.dart'), + ); + library.generateFile(file); + + try { + final actual = file.readAsStringSync(); + final expected = File(path.join(config.output)).readAsStringSync(); + expect(actual, expected); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + print('Failed test: Debug generated file: ${file.absolute.path}'); + rethrow; + } + }); + + test('Interface basics, with Foo', () { + final foo1 = Foo.makeFoo(lib, 3.14159); + final foo2 = Foo.makeFoo(lib, 2.71828); + expect(foo1.intVal, 3); + expect(foo2.intVal, 2); + expect(foo1.multiply(0, foo2), 8); + expect(foo1.multiply(1, foo2), 6); + foo1.intVal = 100; + expect(foo1.multiply(0, foo2), 8); + expect(foo1.multiply(1, foo2), 200); + }); + }); +} diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test.m b/pkgs/ffigen/test/native_objc_test/native_objc_test.m new file mode 100644 index 0000000000..98f9acaaef --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test.m @@ -0,0 +1,32 @@ +#import + +@interface Foo : NSObject { + double doubleVal; +} + +@property int32_t intVal; + ++ (Foo*)makeFoo:(double)x; + +- (int32_t)multiply:(BOOL)useIntVals withOtherFoo:(Foo*)other; + +@end + +@implementation Foo + ++ (Foo*)makeFoo:(double)x { + Foo* foo = [Foo new]; + foo->doubleVal = x; + [foo setIntVal:((int32_t)x)]; + return foo; +} + +- (int32_t)multiply:(BOOL)useIntVals withOtherFoo:(Foo*)other { + if (useIntVals) { + return [self intVal] * [other intVal]; + } else { + return (int32_t)(self->doubleVal * other->doubleVal); + } +} + +@end diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart new file mode 100644 index 0000000000..9c86588ce7 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart @@ -0,0 +1,2285 @@ +// ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; + +/// Native Objective C test +class NativeObjCLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + NativeObjCLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NativeObjCLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + late final ffi.Pointer _NSFoundationVersionNumber = + _lookup('NSFoundationVersionNumber'); + + double get NSFoundationVersionNumber => _NSFoundationVersionNumber.value; + + set NSFoundationVersionNumber(double value) => + _NSFoundationVersionNumber.value = value; + + ffi.Pointer NSStringFromSelector( + ffi.Pointer aSelector, + ) { + return _NSStringFromSelector( + aSelector, + ); + } + + late final _NSStringFromSelectorPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('NSStringFromSelector'); + late final _NSStringFromSelector = _NSStringFromSelectorPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); + + ffi.Pointer NSSelectorFromString( + ffi.Pointer aSelectorName, + ) { + return _NSSelectorFromString( + aSelectorName, + ); + } + + late final _NSSelectorFromStringPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('NSSelectorFromString'); + late final _NSSelectorFromString = _NSSelectorFromStringPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); + + ffi.Pointer NSStringFromClass( + ffi.Pointer aClass, + ) { + return _NSStringFromClass( + aClass, + ); + } + + late final _NSStringFromClassPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('NSStringFromClass'); + late final _NSStringFromClass = _NSStringFromClassPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); + + ffi.Pointer NSClassFromString( + ffi.Pointer aClassName, + ) { + return _NSClassFromString( + aClassName, + ); + } + + late final _NSClassFromStringPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('NSClassFromString'); + late final _NSClassFromString = _NSClassFromStringPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); + + ffi.Pointer NSStringFromProtocol( + ffi.Pointer proto, + ) { + return _NSStringFromProtocol( + proto, + ); + } + + late final _NSStringFromProtocolPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('NSStringFromProtocol'); + late final _NSStringFromProtocol = _NSStringFromProtocolPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); + + ffi.Pointer NSProtocolFromString( + ffi.Pointer namestr, + ) { + return _NSProtocolFromString( + namestr, + ); + } + + late final _NSProtocolFromStringPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('NSProtocolFromString'); + late final _NSProtocolFromString = _NSProtocolFromStringPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); + + ffi.Pointer NSGetSizeAndAlignment( + ffi.Pointer typePtr, + ffi.Pointer sizep, + ffi.Pointer alignp, + ) { + return _NSGetSizeAndAlignment( + typePtr, + sizep, + alignp, + ); + } + + late final _NSGetSizeAndAlignmentPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('NSGetSizeAndAlignment'); + late final _NSGetSizeAndAlignment = _NSGetSizeAndAlignmentPtr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + void NSLog( + ffi.Pointer format, + ) { + return _NSLog( + format, + ); + } + + late final _NSLogPtr = + _lookup)>>( + 'NSLog'); + late final _NSLog = + _NSLogPtr.asFunction)>(); + + void NSLogv( + ffi.Pointer format, + ffi.Pointer<__va_list_tag> args, + ) { + return _NSLogv( + format, + args, + ); + } + + late final _NSLogvPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer<__va_list_tag>)>>('NSLogv'); + late final _NSLogv = _NSLogvPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer<__va_list_tag>)>(); + + late final ffi.Pointer _NSNotFound = + _lookup('NSNotFound'); + + int get NSNotFound => _NSNotFound.value; + + set NSNotFound(int value) => _NSNotFound.value = value; + + late final ffi.Pointer _kCFCoreFoundationVersionNumber = + _lookup('kCFCoreFoundationVersionNumber'); + + double get kCFCoreFoundationVersionNumber => + _kCFCoreFoundationVersionNumber.value; + + set kCFCoreFoundationVersionNumber(double value) => + _kCFCoreFoundationVersionNumber.value = value; + + late final ffi.Pointer _kCFNotFound = + _lookup('kCFNotFound'); + + int get kCFNotFound => _kCFNotFound.value; + + set kCFNotFound(int value) => _kCFNotFound.value = value; + + CFRange __CFRangeMake( + int loc, + int len, + ) { + return ___CFRangeMake( + loc, + len, + ); + } + + late final ___CFRangeMakePtr = + _lookup>( + '__CFRangeMake'); + late final ___CFRangeMake = + ___CFRangeMakePtr.asFunction(); + + int CFNullGetTypeID() { + return _CFNullGetTypeID(); + } + + late final _CFNullGetTypeIDPtr = + _lookup>('CFNullGetTypeID'); + late final _CFNullGetTypeID = + _CFNullGetTypeIDPtr.asFunction(); + + late final ffi.Pointer _kCFNull = _lookup('kCFNull'); + + CFNullRef get kCFNull => _kCFNull.value; + + set kCFNull(CFNullRef value) => _kCFNull.value = value; + + late final ffi.Pointer _kCFAllocatorDefault = + _lookup('kCFAllocatorDefault'); + + CFAllocatorRef get kCFAllocatorDefault => _kCFAllocatorDefault.value; + + set kCFAllocatorDefault(CFAllocatorRef value) => + _kCFAllocatorDefault.value = value; + + late final ffi.Pointer _kCFAllocatorSystemDefault = + _lookup('kCFAllocatorSystemDefault'); + + CFAllocatorRef get kCFAllocatorSystemDefault => + _kCFAllocatorSystemDefault.value; + + set kCFAllocatorSystemDefault(CFAllocatorRef value) => + _kCFAllocatorSystemDefault.value = value; + + late final ffi.Pointer _kCFAllocatorMalloc = + _lookup('kCFAllocatorMalloc'); + + CFAllocatorRef get kCFAllocatorMalloc => _kCFAllocatorMalloc.value; + + set kCFAllocatorMalloc(CFAllocatorRef value) => + _kCFAllocatorMalloc.value = value; + + late final ffi.Pointer _kCFAllocatorMallocZone = + _lookup('kCFAllocatorMallocZone'); + + CFAllocatorRef get kCFAllocatorMallocZone => _kCFAllocatorMallocZone.value; + + set kCFAllocatorMallocZone(CFAllocatorRef value) => + _kCFAllocatorMallocZone.value = value; + + late final ffi.Pointer _kCFAllocatorNull = + _lookup('kCFAllocatorNull'); + + CFAllocatorRef get kCFAllocatorNull => _kCFAllocatorNull.value; + + set kCFAllocatorNull(CFAllocatorRef value) => _kCFAllocatorNull.value = value; + + late final ffi.Pointer _kCFAllocatorUseContext = + _lookup('kCFAllocatorUseContext'); + + CFAllocatorRef get kCFAllocatorUseContext => _kCFAllocatorUseContext.value; + + set kCFAllocatorUseContext(CFAllocatorRef value) => + _kCFAllocatorUseContext.value = value; + + int CFAllocatorGetTypeID() { + return _CFAllocatorGetTypeID(); + } + + late final _CFAllocatorGetTypeIDPtr = + _lookup>('CFAllocatorGetTypeID'); + late final _CFAllocatorGetTypeID = + _CFAllocatorGetTypeIDPtr.asFunction(); + + void CFAllocatorSetDefault( + CFAllocatorRef allocator, + ) { + return _CFAllocatorSetDefault( + allocator, + ); + } + + late final _CFAllocatorSetDefaultPtr = + _lookup>( + 'CFAllocatorSetDefault'); + late final _CFAllocatorSetDefault = + _CFAllocatorSetDefaultPtr.asFunction(); + + CFAllocatorRef CFAllocatorGetDefault() { + return _CFAllocatorGetDefault(); + } + + late final _CFAllocatorGetDefaultPtr = + _lookup>( + 'CFAllocatorGetDefault'); + late final _CFAllocatorGetDefault = + _CFAllocatorGetDefaultPtr.asFunction(); + + CFAllocatorRef CFAllocatorCreate( + CFAllocatorRef allocator, + ffi.Pointer context, + ) { + return _CFAllocatorCreate( + allocator, + context, + ); + } + + late final _CFAllocatorCreatePtr = _lookup< + ffi.NativeFunction< + CFAllocatorRef Function(CFAllocatorRef, + ffi.Pointer)>>('CFAllocatorCreate'); + late final _CFAllocatorCreate = _CFAllocatorCreatePtr.asFunction< + CFAllocatorRef Function( + CFAllocatorRef, ffi.Pointer)>(); + + ffi.Pointer CFAllocatorAllocate( + CFAllocatorRef allocator, + int size, + int hint, + ) { + return _CFAllocatorAllocate( + allocator, + size, + hint, + ); + } + + late final _CFAllocatorAllocatePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + CFAllocatorRef, CFIndex, CFOptionFlags)>>('CFAllocatorAllocate'); + late final _CFAllocatorAllocate = _CFAllocatorAllocatePtr.asFunction< + ffi.Pointer Function(CFAllocatorRef, int, int)>(); + + ffi.Pointer CFAllocatorReallocate( + CFAllocatorRef allocator, + ffi.Pointer ptr, + int newsize, + int hint, + ) { + return _CFAllocatorReallocate( + allocator, + ptr, + newsize, + hint, + ); + } + + late final _CFAllocatorReallocatePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(CFAllocatorRef, ffi.Pointer, + CFIndex, CFOptionFlags)>>('CFAllocatorReallocate'); + late final _CFAllocatorReallocate = _CFAllocatorReallocatePtr.asFunction< + ffi.Pointer Function( + CFAllocatorRef, ffi.Pointer, int, int)>(); + + void CFAllocatorDeallocate( + CFAllocatorRef allocator, + ffi.Pointer ptr, + ) { + return _CFAllocatorDeallocate( + allocator, + ptr, + ); + } + + late final _CFAllocatorDeallocatePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFAllocatorRef, ffi.Pointer)>>('CFAllocatorDeallocate'); + late final _CFAllocatorDeallocate = _CFAllocatorDeallocatePtr.asFunction< + void Function(CFAllocatorRef, ffi.Pointer)>(); + + int CFAllocatorGetPreferredSizeForSize( + CFAllocatorRef allocator, + int size, + int hint, + ) { + return _CFAllocatorGetPreferredSizeForSize( + allocator, + size, + hint, + ); + } + + late final _CFAllocatorGetPreferredSizeForSizePtr = _lookup< + ffi.NativeFunction< + CFIndex Function(CFAllocatorRef, CFIndex, + CFOptionFlags)>>('CFAllocatorGetPreferredSizeForSize'); + late final _CFAllocatorGetPreferredSizeForSize = + _CFAllocatorGetPreferredSizeForSizePtr.asFunction< + int Function(CFAllocatorRef, int, int)>(); + + void CFAllocatorGetContext( + CFAllocatorRef allocator, + ffi.Pointer context, + ) { + return _CFAllocatorGetContext( + allocator, + context, + ); + } + + late final _CFAllocatorGetContextPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFAllocatorRef, + ffi.Pointer)>>('CFAllocatorGetContext'); + late final _CFAllocatorGetContext = _CFAllocatorGetContextPtr.asFunction< + void Function(CFAllocatorRef, ffi.Pointer)>(); + + int CFGetTypeID( + CFTypeRef cf, + ) { + return _CFGetTypeID( + cf, + ); + } + + late final _CFGetTypeIDPtr = + _lookup>('CFGetTypeID'); + late final _CFGetTypeID = + _CFGetTypeIDPtr.asFunction(); + + CFStringRef CFCopyTypeIDDescription( + int type_id, + ) { + return _CFCopyTypeIDDescription( + type_id, + ); + } + + late final _CFCopyTypeIDDescriptionPtr = + _lookup>( + 'CFCopyTypeIDDescription'); + late final _CFCopyTypeIDDescription = + _CFCopyTypeIDDescriptionPtr.asFunction(); + + CFTypeRef CFRetain( + CFTypeRef cf, + ) { + return _CFRetain( + cf, + ); + } + + late final _CFRetainPtr = + _lookup>('CFRetain'); + late final _CFRetain = + _CFRetainPtr.asFunction(); + + void CFRelease( + CFTypeRef cf, + ) { + return _CFRelease( + cf, + ); + } + + late final _CFReleasePtr = + _lookup>('CFRelease'); + late final _CFRelease = _CFReleasePtr.asFunction(); + + CFTypeRef CFAutorelease( + CFTypeRef arg, + ) { + return _CFAutorelease( + arg, + ); + } + + late final _CFAutoreleasePtr = + _lookup>( + 'CFAutorelease'); + late final _CFAutorelease = + _CFAutoreleasePtr.asFunction(); + + int CFGetRetainCount( + CFTypeRef cf, + ) { + return _CFGetRetainCount( + cf, + ); + } + + late final _CFGetRetainCountPtr = + _lookup>( + 'CFGetRetainCount'); + late final _CFGetRetainCount = + _CFGetRetainCountPtr.asFunction(); + + int CFEqual( + CFTypeRef cf1, + CFTypeRef cf2, + ) { + return _CFEqual( + cf1, + cf2, + ); + } + + late final _CFEqualPtr = + _lookup>( + 'CFEqual'); + late final _CFEqual = + _CFEqualPtr.asFunction(); + + int CFHash( + CFTypeRef cf, + ) { + return _CFHash( + cf, + ); + } + + late final _CFHashPtr = + _lookup>('CFHash'); + late final _CFHash = _CFHashPtr.asFunction(); + + CFStringRef CFCopyDescription( + CFTypeRef cf, + ) { + return _CFCopyDescription( + cf, + ); + } + + late final _CFCopyDescriptionPtr = + _lookup>( + 'CFCopyDescription'); + late final _CFCopyDescription = + _CFCopyDescriptionPtr.asFunction(); + + CFAllocatorRef CFGetAllocator( + CFTypeRef cf, + ) { + return _CFGetAllocator( + cf, + ); + } + + late final _CFGetAllocatorPtr = + _lookup>( + 'CFGetAllocator'); + late final _CFGetAllocator = + _CFGetAllocatorPtr.asFunction(); + + CFTypeRef CFMakeCollectable( + CFTypeRef cf, + ) { + return _CFMakeCollectable( + cf, + ); + } + + late final _CFMakeCollectablePtr = + _lookup>( + 'CFMakeCollectable'); + late final _CFMakeCollectable = + _CFMakeCollectablePtr.asFunction(); + + ffi.Pointer NSDefaultMallocZone() { + return _NSDefaultMallocZone(); + } + + late final _NSDefaultMallocZonePtr = + _lookup Function()>>( + 'NSDefaultMallocZone'); + late final _NSDefaultMallocZone = + _NSDefaultMallocZonePtr.asFunction Function()>(); + + ffi.Pointer NSCreateZone( + int startSize, + int granularity, + int canFree, + ) { + return _NSCreateZone( + startSize, + granularity, + canFree, + ); + } + + late final _NSCreateZonePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + NSUInteger, NSUInteger, BOOL)>>('NSCreateZone'); + late final _NSCreateZone = _NSCreateZonePtr.asFunction< + ffi.Pointer Function(int, int, int)>(); + + void NSRecycleZone( + ffi.Pointer zone, + ) { + return _NSRecycleZone( + zone, + ); + } + + late final _NSRecycleZonePtr = + _lookup)>>( + 'NSRecycleZone'); + late final _NSRecycleZone = + _NSRecycleZonePtr.asFunction)>(); + + void NSSetZoneName( + ffi.Pointer zone, + ffi.Pointer name, + ) { + return _NSSetZoneName( + zone, + name, + ); + } + + late final _NSSetZoneNamePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('NSSetZoneName'); + late final _NSSetZoneName = _NSSetZoneNamePtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer NSZoneName( + ffi.Pointer zone, + ) { + return _NSZoneName( + zone, + ); + } + + late final _NSZoneNamePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>>('NSZoneName'); + late final _NSZoneName = _NSZoneNamePtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); + + ffi.Pointer NSZoneFromPointer( + ffi.Pointer ptr, + ) { + return _NSZoneFromPointer( + ptr, + ); + } + + late final _NSZoneFromPointerPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('NSZoneFromPointer'); + late final _NSZoneFromPointer = _NSZoneFromPointerPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); + + ffi.Pointer NSZoneMalloc( + ffi.Pointer zone, + int size, + ) { + return _NSZoneMalloc( + zone, + size, + ); + } + + late final _NSZoneMallocPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, NSUInteger)>>('NSZoneMalloc'); + late final _NSZoneMalloc = _NSZoneMallocPtr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); + + ffi.Pointer NSZoneCalloc( + ffi.Pointer zone, + int numElems, + int byteSize, + ) { + return _NSZoneCalloc( + zone, + numElems, + byteSize, + ); + } + + late final _NSZoneCallocPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, NSUInteger, NSUInteger)>>('NSZoneCalloc'); + late final _NSZoneCalloc = _NSZoneCallocPtr.asFunction< + ffi.Pointer Function(ffi.Pointer, int, int)>(); + + ffi.Pointer NSZoneRealloc( + ffi.Pointer zone, + ffi.Pointer ptr, + int size, + ) { + return _NSZoneRealloc( + zone, + ptr, + size, + ); + } + + late final _NSZoneReallocPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('NSZoneRealloc'); + late final _NSZoneRealloc = _NSZoneReallocPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + void NSZoneFree( + ffi.Pointer zone, + ffi.Pointer ptr, + ) { + return _NSZoneFree( + zone, + ptr, + ); + } + + late final _NSZoneFreePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('NSZoneFree'); + late final _NSZoneFree = _NSZoneFreePtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer NSAllocateCollectable( + int size, + int options, + ) { + return _NSAllocateCollectable( + size, + options, + ); + } + + late final _NSAllocateCollectablePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + NSUInteger, NSUInteger)>>('NSAllocateCollectable'); + late final _NSAllocateCollectable = _NSAllocateCollectablePtr.asFunction< + ffi.Pointer Function(int, int)>(); + + ffi.Pointer NSReallocateCollectable( + ffi.Pointer ptr, + int size, + int options, + ) { + return _NSReallocateCollectable( + ptr, + size, + options, + ); + } + + late final _NSReallocateCollectablePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, NSUInteger, + NSUInteger)>>('NSReallocateCollectable'); + late final _NSReallocateCollectable = _NSReallocateCollectablePtr.asFunction< + ffi.Pointer Function(ffi.Pointer, int, int)>(); + + int NSPageSize() { + return _NSPageSize(); + } + + late final _NSPageSizePtr = + _lookup>('NSPageSize'); + late final _NSPageSize = _NSPageSizePtr.asFunction(); + + int NSLogPageSize() { + return _NSLogPageSize(); + } + + late final _NSLogPageSizePtr = + _lookup>('NSLogPageSize'); + late final _NSLogPageSize = _NSLogPageSizePtr.asFunction(); + + int NSRoundUpToMultipleOfPageSize( + int bytes, + ) { + return _NSRoundUpToMultipleOfPageSize( + bytes, + ); + } + + late final _NSRoundUpToMultipleOfPageSizePtr = + _lookup>( + 'NSRoundUpToMultipleOfPageSize'); + late final _NSRoundUpToMultipleOfPageSize = + _NSRoundUpToMultipleOfPageSizePtr.asFunction(); + + int NSRoundDownToMultipleOfPageSize( + int bytes, + ) { + return _NSRoundDownToMultipleOfPageSize( + bytes, + ); + } + + late final _NSRoundDownToMultipleOfPageSizePtr = + _lookup>( + 'NSRoundDownToMultipleOfPageSize'); + late final _NSRoundDownToMultipleOfPageSize = + _NSRoundDownToMultipleOfPageSizePtr.asFunction(); + + ffi.Pointer NSAllocateMemoryPages( + int bytes, + ) { + return _NSAllocateMemoryPages( + bytes, + ); + } + + late final _NSAllocateMemoryPagesPtr = + _lookup Function(NSUInteger)>>( + 'NSAllocateMemoryPages'); + late final _NSAllocateMemoryPages = _NSAllocateMemoryPagesPtr.asFunction< + ffi.Pointer Function(int)>(); + + void NSDeallocateMemoryPages( + ffi.Pointer ptr, + int bytes, + ) { + return _NSDeallocateMemoryPages( + ptr, + bytes, + ); + } + + late final _NSDeallocateMemoryPagesPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, NSUInteger)>>('NSDeallocateMemoryPages'); + late final _NSDeallocateMemoryPages = _NSDeallocateMemoryPagesPtr.asFunction< + void Function(ffi.Pointer, int)>(); + + void NSCopyMemoryPages( + ffi.Pointer source, + ffi.Pointer dest, + int bytes, + ) { + return _NSCopyMemoryPages( + source, + dest, + bytes, + ); + } + + late final _NSCopyMemoryPagesPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('NSCopyMemoryPages'); + late final _NSCopyMemoryPages = _NSCopyMemoryPagesPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + int NSRealMemoryAvailable() { + return _NSRealMemoryAvailable(); + } + + late final _NSRealMemoryAvailablePtr = + _lookup>( + 'NSRealMemoryAvailable'); + late final _NSRealMemoryAvailable = + _NSRealMemoryAvailablePtr.asFunction(); + + ffi.Pointer NSAllocateObject( + ffi.Pointer aClass, + int extraBytes, + ffi.Pointer zone, + ) { + return _NSAllocateObject( + aClass, + extraBytes, + zone, + ); + } + + late final _NSAllocateObjectPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, NSUInteger, + ffi.Pointer)>>('NSAllocateObject'); + late final _NSAllocateObject = _NSAllocateObjectPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, int, ffi.Pointer)>(); + + void NSDeallocateObject( + ffi.Pointer object, + ) { + return _NSDeallocateObject( + object, + ); + } + + late final _NSDeallocateObjectPtr = + _lookup)>>( + 'NSDeallocateObject'); + late final _NSDeallocateObject = _NSDeallocateObjectPtr.asFunction< + void Function(ffi.Pointer)>(); + + ffi.Pointer NSCopyObject( + ffi.Pointer object, + int extraBytes, + ffi.Pointer zone, + ) { + return _NSCopyObject( + object, + extraBytes, + zone, + ); + } + + late final _NSCopyObjectPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, NSUInteger, + ffi.Pointer)>>('NSCopyObject'); + late final _NSCopyObject = _NSCopyObjectPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, int, ffi.Pointer)>(); + + int NSShouldRetainWithZone( + ffi.Pointer anObject, + ffi.Pointer requestedZone, + ) { + return _NSShouldRetainWithZone( + anObject, + requestedZone, + ); + } + + late final _NSShouldRetainWithZonePtr = _lookup< + ffi.NativeFunction< + BOOL Function(ffi.Pointer, + ffi.Pointer)>>('NSShouldRetainWithZone'); + late final _NSShouldRetainWithZone = _NSShouldRetainWithZonePtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + void NSIncrementExtraRefCount( + ffi.Pointer object, + ) { + return _NSIncrementExtraRefCount( + object, + ); + } + + late final _NSIncrementExtraRefCountPtr = + _lookup)>>( + 'NSIncrementExtraRefCount'); + late final _NSIncrementExtraRefCount = _NSIncrementExtraRefCountPtr + .asFunction)>(); + + int NSDecrementExtraRefCountWasZero( + ffi.Pointer object, + ) { + return _NSDecrementExtraRefCountWasZero( + object, + ); + } + + late final _NSDecrementExtraRefCountWasZeroPtr = + _lookup)>>( + 'NSDecrementExtraRefCountWasZero'); + late final _NSDecrementExtraRefCountWasZero = + _NSDecrementExtraRefCountWasZeroPtr.asFunction< + int Function(ffi.Pointer)>(); + + int NSExtraRefCount( + ffi.Pointer object, + ) { + return _NSExtraRefCount( + object, + ); + } + + late final _NSExtraRefCountPtr = + _lookup)>>( + 'NSExtraRefCount'); + late final _NSExtraRefCount = + _NSExtraRefCountPtr.asFunction)>(); + + ffi.Pointer _sel_registerName( + ffi.Pointer str, + ) { + return __sel_registerName( + str, + ); + } + + late final __sel_registerNamePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sel_registerName'); + late final __sel_registerName = __sel_registerNamePtr + .asFunction Function(ffi.Pointer)>(); + + ffi.Pointer _objc_getClass( + ffi.Pointer str, + ) { + return __objc_getClass( + str, + ); + } + + late final __objc_getClassPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('objc_getClass'); + late final __objc_getClass = __objc_getClassPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); + + instancetype _objc_msgSend_0( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_0( + obj, + sel, + ); + } + + late final __objc_msgSend_0Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer)>(); + + instancetype _objc_msgSend_1( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_1( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_1Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>(); + + ffi.Pointer _objc_msgSend_2( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_2( + obj, + sel, + ); + } + + late final __objc_msgSend_2Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_3( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_3( + obj, + sel, + ); + } + + late final __objc_msgSend_3Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_4( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_4( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_4Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); + + ffi.Pointer _objc_msgSend_5( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_5( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_5Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); + + int _objc_msgSend_6( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_6( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_6Ptr = _lookup< + ffi.NativeFunction< + BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_7( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer protocol, + ) { + return __objc_msgSend_7( + obj, + sel, + protocol, + ); + } + + late final __objc_msgSend_7Ptr = _lookup< + ffi.NativeFunction< + BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + IMP _objc_msgSend_8( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_8( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_8Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + IMP _objc_msgSend_9( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_9( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_9Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_10( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_10( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_10Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_11( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_11( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_11Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_12( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_12( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_12Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_13( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_13( + obj, + sel, + ); + } + + late final __objc_msgSend_13Ptr = _lookup< + ffi.NativeFunction< + BOOL Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_14( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ) { + return __objc_msgSend_14( + obj, + sel, + aClass, + ); + } + + late final __objc_msgSend_14Ptr = _lookup< + ffi.NativeFunction< + BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_15( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sel1, + ) { + return __objc_msgSend_15( + obj, + sel, + sel1, + ); + } + + late final __objc_msgSend_15Ptr = _lookup< + ffi.NativeFunction< + BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sel1, + ) { + return __objc_msgSend_16( + obj, + sel, + sel1, + ); + } + + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_17( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_17( + obj, + sel, + ); + } + + late final __objc_msgSend_17Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_18( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_18( + obj, + sel, + ); + } + + late final __objc_msgSend_18Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_19( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_19( + obj, + sel, + ); + } + + late final __objc_msgSend_19Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_20( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_20( + obj, + sel, + ); + } + + late final __objc_msgSend_20Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_21( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_21( + obj, + sel, + ); + } + + late final __objc_msgSend_21Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_22( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_22( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_22Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_23( + ffi.Pointer obj, + ffi.Pointer sel, + double x, + ) { + return __objc_msgSend_23( + obj, + sel, + x, + ); + } + + late final __objc_msgSend_23Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); + + int _objc_msgSend_24( + ffi.Pointer obj, + ffi.Pointer sel, + int useIntVals, + ffi.Pointer other, + ) { + return __objc_msgSend_24( + obj, + sel, + useIntVals, + other, + ); + } + + late final __objc_msgSend_24Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + BOOL, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); +} + +class ObjCObject extends ffi.Opaque {} + +class ObjCSel extends ffi.Opaque {} + +typedef NSUInteger = pkg_ffi.UnsignedLong; + +class __va_list_tag extends ffi.Struct { + @pkg_ffi.UnsignedInt() + external int gp_offset; + + @pkg_ffi.UnsignedInt() + external int fp_offset; + + external ffi.Pointer overflow_arg_area; + + external ffi.Pointer reg_save_area; +} + +abstract class NSComparisonResult { + static const int NSOrderedAscending = -1; + static const int NSOrderedSame = 0; + static const int NSOrderedDescending = 1; +} + +abstract class NSEnumerationOptions { + static const int NSEnumerationConcurrent = 1; + static const int NSEnumerationReverse = 2; +} + +abstract class NSSortOptions { + static const int NSSortConcurrent = 1; + static const int NSSortStable = 16; +} + +abstract class NSQualityOfService { + static const int NSQualityOfServiceUserInteractive = 33; + static const int NSQualityOfServiceUserInitiated = 25; + static const int NSQualityOfServiceUtility = 17; + static const int NSQualityOfServiceBackground = 9; + static const int NSQualityOfServiceDefault = -1; +} + +typedef NSInteger = pkg_ffi.Long; + +class __CFString extends ffi.Opaque {} + +abstract class CFComparisonResult { + static const int kCFCompareLessThan = -1; + static const int kCFCompareEqualTo = 0; + static const int kCFCompareGreaterThan = 1; +} + +typedef CFIndex = pkg_ffi.Long; + +class CFRange extends ffi.Struct { + @CFIndex() + external int location; + + @CFIndex() + external int length; +} + +class __CFNull extends ffi.Opaque {} + +typedef CFTypeID = pkg_ffi.UnsignedLong; +typedef CFNullRef = ffi.Pointer<__CFNull>; + +class __CFAllocator extends ffi.Opaque {} + +typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; + +class CFAllocatorContext extends ffi.Struct { + @CFIndex() + external int version; + + external ffi.Pointer info; + + external CFAllocatorRetainCallBack retain; + + external CFAllocatorReleaseCallBack release; + + external CFAllocatorCopyDescriptionCallBack copyDescription; + + external CFAllocatorAllocateCallBack allocate; + + external CFAllocatorReallocateCallBack reallocate; + + external CFAllocatorDeallocateCallBack deallocate; + + external CFAllocatorPreferredSizeCallBack preferredSize; +} + +typedef CFAllocatorRetainCallBack = ffi.Pointer< + ffi.NativeFunction Function(ffi.Pointer)>>; +typedef CFAllocatorReleaseCallBack + = ffi.Pointer)>>; +typedef CFAllocatorCopyDescriptionCallBack = ffi + .Pointer)>>; +typedef CFStringRef = ffi.Pointer<__CFString>; +typedef CFAllocatorAllocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + CFIndex, CFOptionFlags, ffi.Pointer)>>; +typedef CFOptionFlags = pkg_ffi.UnsignedLong; +typedef CFAllocatorReallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, CFIndex, + CFOptionFlags, ffi.Pointer)>>; +typedef CFAllocatorDeallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; +typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< + ffi.NativeFunction< + CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; +typedef CFTypeRef = ffi.Pointer; +typedef Boolean = pkg_ffi.UnsignedChar; +typedef CFHashCode = pkg_ffi.UnsignedLong; +typedef NSZone = _NSZone; + +class _NSZone extends ffi.Opaque {} + +typedef BOOL = pkg_ffi.SignedChar; + +ffi.Pointer _registerName(NativeObjCLibrary _lib, String name) { + final cstr = name.toNativeUtf8(); + final sel = _lib._sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; +} + +ffi.Pointer _getClass(NativeObjCLibrary _lib, String name) { + final cstr = name.toNativeUtf8(); + final clazz = _lib._objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; +} + +class _ObjCWrapper { + final ffi.Pointer _id; + final NativeObjCLibrary _lib; + _ObjCWrapper._(this._id, this._lib); +} + +class Foo extends NSObject { + Foo._(ffi.Pointer id, NativeObjCLibrary lib) : super._(id, lib); + + static ffi.Pointer? _class; + + static Foo castFrom(T other) { + return Foo._(other._id, other._lib); + } + + static ffi.Pointer? _sel_intVal; + int get intVal { + _sel_intVal ??= _registerName(_lib, "intVal"); + return _lib._objc_msgSend_21(_id, _sel_intVal!); + } + + static ffi.Pointer? _sel_intVal1; + set intVal(int value) { + _sel_intVal1 ??= _registerName(_lib, "setIntVal:"); + return _lib._objc_msgSend_22(_id, _sel_intVal1!, value); + } + + static ffi.Pointer? _sel_makeFoo; + static Foo makeFoo(NativeObjCLibrary _lib, double x) { + _class ??= _getClass(_lib, "Foo"); + _sel_makeFoo ??= _registerName(_lib, "makeFoo:"); + final _ret = _lib._objc_msgSend_23(_class!, _sel_makeFoo!, x); + return Foo._(_ret, _lib); + } + + static ffi.Pointer? _sel_multiply; + int multiply(int useIntVals, NSObject other) { + _sel_multiply ??= _registerName(_lib, "multiply:withOtherFoo:"); + return _lib._objc_msgSend_24(_id, _sel_multiply!, useIntVals, other._id); + } + + static ffi.Pointer? _sel_new1; + static Foo new1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "Foo"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_0(_class!, _sel_new1!); + return Foo._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static Foo alloc(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "Foo"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_0(_class!, _sel_alloc!); + return Foo._(_ret, _lib); + } +} + +class NSObject extends _ObjCWrapper { + NSObject._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSObject castFrom(T other) { + return NSObject._(other._id, other._lib); + } + + static ffi.Pointer? _sel_init; + NSObject init() { + _sel_init ??= _registerName(_lib, "init"); + final _ret = _lib._objc_msgSend_0(_id, _sel_init!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSObject new1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_0(_class!, _sel_new1!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_allocWithZone; + static NSObject allocWithZone( + NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_allocWithZone ??= _registerName(_lib, "allocWithZone:"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_allocWithZone!, zone); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSObject alloc(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_0(_class!, _sel_alloc!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_copy; + NSObject copy() { + _sel_copy ??= _registerName(_lib, "copy"); + final _ret = _lib._objc_msgSend_2(_id, _sel_copy!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_mutableCopy; + NSObject mutableCopy() { + _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); + final _ret = _lib._objc_msgSend_3(_id, _sel_mutableCopy!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_copyWithZone; + static NSObject copyWithZone( + NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); + final _ret = _lib._objc_msgSend_4(_class!, _sel_copyWithZone!, zone); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_mutableCopyWithZone; + static NSObject mutableCopyWithZone( + NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); + final _ret = _lib._objc_msgSend_5(_class!, _sel_mutableCopyWithZone!, zone); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_instancesRespondToSelector; + static int instancesRespondToSelector( + NativeObjCLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instancesRespondToSelector ??= + _registerName(_lib, "instancesRespondToSelector:"); + return _lib._objc_msgSend_6( + _class!, _sel_instancesRespondToSelector!, aSelector); + } + + static ffi.Pointer? _sel_conformsToProtocol; + static int conformsToProtocol(NativeObjCLibrary _lib, NSObject protocol) { + _class ??= _getClass(_lib, "NSObject"); + _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); + return _lib._objc_msgSend_7( + _class!, _sel_conformsToProtocol!, protocol._id); + } + + static ffi.Pointer? _sel_methodForSelector; + IMP methodForSelector(ffi.Pointer aSelector) { + _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); + return _lib._objc_msgSend_8(_id, _sel_methodForSelector!, aSelector); + } + + static ffi.Pointer? _sel_instanceMethodForSelector; + static IMP instanceMethodForSelector( + NativeObjCLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instanceMethodForSelector ??= + _registerName(_lib, "instanceMethodForSelector:"); + return _lib._objc_msgSend_9( + _class!, _sel_instanceMethodForSelector!, aSelector); + } + + static ffi.Pointer? _sel_forwardingTargetForSelector; + NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + _sel_forwardingTargetForSelector ??= + _registerName(_lib, "forwardingTargetForSelector:"); + final _ret = _lib._objc_msgSend_10( + _id, _sel_forwardingTargetForSelector!, aSelector); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_methodSignatureForSelector; + NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + _sel_methodSignatureForSelector ??= + _registerName(_lib, "methodSignatureForSelector:"); + final _ret = + _lib._objc_msgSend_11(_id, _sel_methodSignatureForSelector!, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static ffi.Pointer? _sel_instanceMethodSignatureForSelector; + static NSMethodSignature instanceMethodSignatureForSelector( + NativeObjCLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instanceMethodSignatureForSelector ??= + _registerName(_lib, "instanceMethodSignatureForSelector:"); + final _ret = _lib._objc_msgSend_12( + _class!, _sel_instanceMethodSignatureForSelector!, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static ffi.Pointer? _sel_allowsWeakReference; + int allowsWeakReference() { + _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); + return _lib._objc_msgSend_13(_id, _sel_allowsWeakReference!); + } + + static ffi.Pointer? _sel_retainWeakReference; + int retainWeakReference() { + _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); + return _lib._objc_msgSend_13(_id, _sel_retainWeakReference!); + } + + static ffi.Pointer? _sel_isSubclassOfClass; + static int isSubclassOfClass(NativeObjCLibrary _lib, NSObject aClass) { + _class ??= _getClass(_lib, "NSObject"); + _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); + return _lib._objc_msgSend_14(_class!, _sel_isSubclassOfClass!, aClass._id); + } + + static ffi.Pointer? _sel_resolveClassMethod; + static int resolveClassMethod( + NativeObjCLibrary _lib, ffi.Pointer sel) { + _class ??= _getClass(_lib, "NSObject"); + _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); + return _lib._objc_msgSend_15(_class!, _sel_resolveClassMethod!, sel); + } + + static ffi.Pointer? _sel_resolveInstanceMethod; + static int resolveInstanceMethod( + NativeObjCLibrary _lib, ffi.Pointer sel) { + _class ??= _getClass(_lib, "NSObject"); + _sel_resolveInstanceMethod ??= + _registerName(_lib, "resolveInstanceMethod:"); + return _lib._objc_msgSend_16(_class!, _sel_resolveInstanceMethod!, sel); + } + + static ffi.Pointer? _sel_hash; + static int hash(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_hash ??= _registerName(_lib, "hash"); + return _lib._objc_msgSend_17(_class!, _sel_hash!); + } + + static ffi.Pointer? _sel_superclass; + static NSObject superclass(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_superclass ??= _registerName(_lib, "superclass"); + final _ret = _lib._objc_msgSend_18(_class!, _sel_superclass!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_class1; + static NSObject class1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_class1 ??= _registerName(_lib, "class"); + final _ret = _lib._objc_msgSend_19(_class!, _sel_class1!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_description; + static NSString description(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_description ??= _registerName(_lib, "description"); + final _ret = _lib._objc_msgSend_20(_class!, _sel_description!); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_debugDescription; + static NSString debugDescription(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_debugDescription ??= _registerName(_lib, "debugDescription"); + final _ret = _lib._objc_msgSend_20(_class!, _sel_debugDescription!); + return NSString._(_ret, _lib); + } +} + +typedef instancetype = ffi.Pointer; +typedef IMP = ffi.Pointer>; + +class NSMethodSignature extends _ObjCWrapper { + NSMethodSignature._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSMethodSignature castFrom(T other) { + return NSMethodSignature._(other._id, other._lib); + } +} + +class NSString extends _ObjCWrapper { + NSString._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSString castFrom(T other) { + return NSString._(other._id, other._lib); + } +} + +const int NSScannedOption = 1; + +const int NSCollectorDisabledOption = 2; + +const int NS_BLOCKS_AVAILABLE = 1; + +const int __COREFOUNDATION_CFAVAILABILITY__ = 1; + +const int __CF_ENUM_FIXED_IS_AVAILABLE = 1; + +const double NSFoundationVersionNumber10_0 = 397.4; + +const double NSFoundationVersionNumber10_1 = 425.0; + +const double NSFoundationVersionNumber10_1_1 = 425.0; + +const double NSFoundationVersionNumber10_1_2 = 425.0; + +const double NSFoundationVersionNumber10_1_3 = 425.0; + +const double NSFoundationVersionNumber10_1_4 = 425.0; + +const double NSFoundationVersionNumber10_2 = 462.0; + +const double NSFoundationVersionNumber10_2_1 = 462.0; + +const double NSFoundationVersionNumber10_2_2 = 462.0; + +const double NSFoundationVersionNumber10_2_3 = 462.0; + +const double NSFoundationVersionNumber10_2_4 = 462.0; + +const double NSFoundationVersionNumber10_2_5 = 462.0; + +const double NSFoundationVersionNumber10_2_6 = 462.0; + +const double NSFoundationVersionNumber10_2_7 = 462.7; + +const double NSFoundationVersionNumber10_2_8 = 462.7; + +const double NSFoundationVersionNumber10_3 = 500.0; + +const double NSFoundationVersionNumber10_3_1 = 500.0; + +const double NSFoundationVersionNumber10_3_2 = 500.3; + +const double NSFoundationVersionNumber10_3_3 = 500.54; + +const double NSFoundationVersionNumber10_3_4 = 500.56; + +const double NSFoundationVersionNumber10_3_5 = 500.56; + +const double NSFoundationVersionNumber10_3_6 = 500.56; + +const double NSFoundationVersionNumber10_3_7 = 500.56; + +const double NSFoundationVersionNumber10_3_8 = 500.56; + +const double NSFoundationVersionNumber10_3_9 = 500.58; + +const double NSFoundationVersionNumber10_4 = 567.0; + +const double NSFoundationVersionNumber10_4_1 = 567.0; + +const double NSFoundationVersionNumber10_4_2 = 567.12; + +const double NSFoundationVersionNumber10_4_3 = 567.21; + +const double NSFoundationVersionNumber10_4_4_Intel = 567.23; + +const double NSFoundationVersionNumber10_4_4_PowerPC = 567.21; + +const double NSFoundationVersionNumber10_4_5 = 567.25; + +const double NSFoundationVersionNumber10_4_6 = 567.26; + +const double NSFoundationVersionNumber10_4_7 = 567.27; + +const double NSFoundationVersionNumber10_4_8 = 567.28; + +const double NSFoundationVersionNumber10_4_9 = 567.29; + +const double NSFoundationVersionNumber10_4_10 = 567.29; + +const double NSFoundationVersionNumber10_4_11 = 567.36; + +const double NSFoundationVersionNumber10_5 = 677.0; + +const double NSFoundationVersionNumber10_5_1 = 677.1; + +const double NSFoundationVersionNumber10_5_2 = 677.15; + +const double NSFoundationVersionNumber10_5_3 = 677.19; + +const double NSFoundationVersionNumber10_5_4 = 677.19; + +const double NSFoundationVersionNumber10_5_5 = 677.21; + +const double NSFoundationVersionNumber10_5_6 = 677.22; + +const double NSFoundationVersionNumber10_5_7 = 677.24; + +const double NSFoundationVersionNumber10_5_8 = 677.26; + +const double NSFoundationVersionNumber10_6 = 751.0; + +const double NSFoundationVersionNumber10_6_1 = 751.0; + +const double NSFoundationVersionNumber10_6_2 = 751.14; + +const double NSFoundationVersionNumber10_6_3 = 751.21; + +const double NSFoundationVersionNumber10_6_4 = 751.29; + +const double NSFoundationVersionNumber10_6_5 = 751.42; + +const double NSFoundationVersionNumber10_6_6 = 751.53; + +const double NSFoundationVersionNumber10_6_7 = 751.53; + +const double NSFoundationVersionNumber10_6_8 = 751.62; + +const double NSFoundationVersionNumber10_7 = 833.1; + +const double NSFoundationVersionNumber10_7_1 = 833.1; + +const double NSFoundationVersionNumber10_7_2 = 833.2; + +const double NSFoundationVersionNumber10_7_3 = 833.24; + +const double NSFoundationVersionNumber10_7_4 = 833.25; + +const double NSFoundationVersionNumber10_8 = 945.0; + +const double NSFoundationVersionNumber10_8_1 = 945.0; + +const double NSFoundationVersionNumber10_8_2 = 945.11; + +const double NSFoundationVersionNumber10_8_3 = 945.16; + +const double NSFoundationVersionNumber10_8_4 = 945.18; + +const int NSFoundationVersionNumber10_9 = 1056; + +const int NSFoundationVersionNumber10_9_1 = 1056; + +const double NSFoundationVersionNumber10_9_2 = 1056.13; + +const double NSFoundationVersionNumber10_10 = 1151.16; + +const double NSFoundationVersionNumber10_10_1 = 1151.16; + +const double NSFoundationVersionNumber10_10_2 = 1152.14; + +const double NSFoundationVersionNumber10_10_3 = 1153.2; + +const double NSFoundationVersionNumber10_10_4 = 1153.2; + +const int NSFoundationVersionNumber10_10_5 = 1154; + +const int NSFoundationVersionNumber10_10_Max = 1199; + +const int NSFoundationVersionNumber10_11 = 1252; + +const double NSFoundationVersionNumber10_11_1 = 1255.1; + +const double NSFoundationVersionNumber10_11_2 = 1256.1; + +const double NSFoundationVersionNumber10_11_3 = 1256.1; + +const int NSFoundationVersionNumber10_11_4 = 1258; + +const int NSFoundationVersionNumber10_11_Max = 1299; + +const int __COREFOUNDATION_CFBASE__ = 1; + +const int TRUE = 1; + +const int FALSE = 0; + +const double kCFCoreFoundationVersionNumber10_0 = 196.4; + +const double kCFCoreFoundationVersionNumber10_0_3 = 196.5; + +const double kCFCoreFoundationVersionNumber10_1 = 226.0; + +const double kCFCoreFoundationVersionNumber10_1_1 = 226.0; + +const double kCFCoreFoundationVersionNumber10_1_2 = 227.2; + +const double kCFCoreFoundationVersionNumber10_1_3 = 227.2; + +const double kCFCoreFoundationVersionNumber10_1_4 = 227.3; + +const double kCFCoreFoundationVersionNumber10_2 = 263.0; + +const double kCFCoreFoundationVersionNumber10_2_1 = 263.1; + +const double kCFCoreFoundationVersionNumber10_2_2 = 263.1; + +const double kCFCoreFoundationVersionNumber10_2_3 = 263.3; + +const double kCFCoreFoundationVersionNumber10_2_4 = 263.3; + +const double kCFCoreFoundationVersionNumber10_2_5 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_6 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_7 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_8 = 263.5; + +const double kCFCoreFoundationVersionNumber10_3 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_1 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_2 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_3 = 299.3; + +const double kCFCoreFoundationVersionNumber10_3_4 = 299.31; + +const double kCFCoreFoundationVersionNumber10_3_5 = 299.31; + +const double kCFCoreFoundationVersionNumber10_3_6 = 299.32; + +const double kCFCoreFoundationVersionNumber10_3_7 = 299.33; + +const double kCFCoreFoundationVersionNumber10_3_8 = 299.33; + +const double kCFCoreFoundationVersionNumber10_3_9 = 299.35; + +const double kCFCoreFoundationVersionNumber10_4 = 368.0; + +const double kCFCoreFoundationVersionNumber10_4_1 = 368.1; + +const double kCFCoreFoundationVersionNumber10_4_2 = 368.11; + +const double kCFCoreFoundationVersionNumber10_4_3 = 368.18; + +const double kCFCoreFoundationVersionNumber10_4_4_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_4_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_5_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_5_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_6_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_6_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_7 = 368.27; + +const double kCFCoreFoundationVersionNumber10_4_8 = 368.27; + +const double kCFCoreFoundationVersionNumber10_4_9 = 368.28; + +const double kCFCoreFoundationVersionNumber10_4_10 = 368.28; + +const double kCFCoreFoundationVersionNumber10_4_11 = 368.31; + +const double kCFCoreFoundationVersionNumber10_5 = 476.0; + +const double kCFCoreFoundationVersionNumber10_5_1 = 476.0; + +const double kCFCoreFoundationVersionNumber10_5_2 = 476.1; + +const double kCFCoreFoundationVersionNumber10_5_3 = 476.13; + +const double kCFCoreFoundationVersionNumber10_5_4 = 476.14; + +const double kCFCoreFoundationVersionNumber10_5_5 = 476.15; + +const double kCFCoreFoundationVersionNumber10_5_6 = 476.17; + +const double kCFCoreFoundationVersionNumber10_5_7 = 476.18; + +const double kCFCoreFoundationVersionNumber10_5_8 = 476.19; + +const double kCFCoreFoundationVersionNumber10_6 = 550.0; + +const double kCFCoreFoundationVersionNumber10_6_1 = 550.0; + +const double kCFCoreFoundationVersionNumber10_6_2 = 550.13; + +const double kCFCoreFoundationVersionNumber10_6_3 = 550.19; + +const double kCFCoreFoundationVersionNumber10_6_4 = 550.29; + +const double kCFCoreFoundationVersionNumber10_6_5 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_6 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_7 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_8 = 550.43; + +const double kCFCoreFoundationVersionNumber10_7 = 635.0; + +const double kCFCoreFoundationVersionNumber10_7_1 = 635.0; + +const double kCFCoreFoundationVersionNumber10_7_2 = 635.15; + +const double kCFCoreFoundationVersionNumber10_7_3 = 635.19; + +const double kCFCoreFoundationVersionNumber10_7_4 = 635.21; + +const double kCFCoreFoundationVersionNumber10_7_5 = 635.21; + +const double kCFCoreFoundationVersionNumber10_8 = 744.0; + +const double kCFCoreFoundationVersionNumber10_8_1 = 744.0; + +const double kCFCoreFoundationVersionNumber10_8_2 = 744.12; + +const double kCFCoreFoundationVersionNumber10_8_3 = 744.18; + +const double kCFCoreFoundationVersionNumber10_8_4 = 744.19; + +const double kCFCoreFoundationVersionNumber10_9 = 855.11; + +const double kCFCoreFoundationVersionNumber10_9_1 = 855.11; + +const double kCFCoreFoundationVersionNumber10_9_2 = 855.14; + +const double kCFCoreFoundationVersionNumber10_10 = 1151.16; + +const double kCFCoreFoundationVersionNumber10_10_1 = 1151.16; + +const int kCFCoreFoundationVersionNumber10_10_2 = 1152; + +const double kCFCoreFoundationVersionNumber10_10_3 = 1153.18; + +const double kCFCoreFoundationVersionNumber10_10_4 = 1153.18; + +const double kCFCoreFoundationVersionNumber10_10_5 = 1153.18; + +const int kCFCoreFoundationVersionNumber10_10_Max = 1199; + +const int kCFCoreFoundationVersionNumber10_11 = 1253; + +const double kCFCoreFoundationVersionNumber10_11_1 = 1255.1; + +const double kCFCoreFoundationVersionNumber10_11_2 = 1256.14; + +const double kCFCoreFoundationVersionNumber10_11_3 = 1256.14; + +const double kCFCoreFoundationVersionNumber10_11_4 = 1258.1; + +const int kCFCoreFoundationVersionNumber10_11_Max = 1299; + +const int ISA_PTRAUTH_DISCRIMINATOR = 27361; diff --git a/pkgs/ffigen/test/native_objc_test/setup.dart b/pkgs/ffigen/test/native_objc_test/setup.dart new file mode 100644 index 0000000000..c9dbf05fed --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/setup.dart @@ -0,0 +1,36 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:async'; +import 'dart:io'; + +Future _buildLib(String input, String output) async { + final args = [ + '-shared', + '-fpic', + '-x', + 'objective-c', + input, + '-framework', + 'Foundation', + '-o', + output, + ]; + final process = await Process.start('clang', args); + unawaited(stdout.addStream(process.stdout)); + unawaited(stderr.addStream(process.stderr)); + final result = await process.exitCode; + if (result != 0) { + throw ProcessException('clang', args, 'Build failed', result); + } + print('Generated file: $output'); +} + +Future main(List arguments) async { + if (!Platform.isMacOS) { + throw OSError('Objective C tests are only supported on MacOS'); + } + print('Building Dynamic Library for Objective C Native Tests...'); + await _buildLib('native_objc_test.m', 'native_objc_test.dylib'); +} diff --git a/pkgs/ffigen/test/setup.dart b/pkgs/ffigen/test/setup.dart new file mode 100644 index 0000000000..e660598d7f --- /dev/null +++ b/pkgs/ffigen/test/setup.dart @@ -0,0 +1,36 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Runs all the test setup scripts. Usage: +// dart run test/setup.dart + +import 'dart:async'; +import 'dart:io'; + +import 'package:path/path.dart' as path; + +Future _run(String subdir, String script) async { + final dir = path.join(path.dirname(Platform.script.path), subdir); + print('\nRunning $script in $dir'); + final args = ['run', path.join(dir, script)]; + final process = await Process.start( + Platform.executable, + args, + workingDirectory: dir, + ); + unawaited(stdout.addStream(process.stdout)); + unawaited(stderr.addStream(process.stderr)); + final result = await process.exitCode; + if (result != 0) { + throw ProcessException(Platform.executable, args, '$script failed', result); + } +} + +Future main() async { + await _run('native_test', 'build_test_dylib.dart'); + if (Platform.isMacOS) { + await _run('native_objc_test', 'setup.dart'); + } + print('\nSuccess :)\n'); +} From 3c6c3761647fec105219596d4c29880b8016d32e Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Mon, 11 Apr 2022 08:33:17 -0700 Subject: [PATCH 111/276] [ffigen] Fix handling of void methods (#308) * Add an integration test for objective C * Switch CI to use test/setup.dart * Trying to fix CI * Fix handling of void functions and property setters and getters --- .../src/code_generator/objc_interface.dart | 59 ++- .../sub_parsers/objcinterfacedecl_parser.dart | 2 +- .../_expected_objc_interface_bindings.dart | 348 ++++++++++------ .../native_objc_test/native_objc_test.dart | 7 + .../test/native_objc_test/native_objc_test.m | 6 + .../native_objc_test_bindings.dart | 373 ++++++++++++------ 6 files changed, 527 insertions(+), 268 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 3425a077c1..2fdd283f52 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -12,20 +12,22 @@ import 'writer.dart'; // by default. const _excludedNSObjectClassMethods = { 'allocWithZone:', - 'copyWithZone:', - 'mutableCopyWithZone:', - 'instancesRespondToSelector:', + 'class', 'conformsToProtocol:', + 'copyWithZone:', + 'debugDescription', + 'description', + 'hash', + 'initialize', 'instanceMethodForSelector:', 'instanceMethodSignatureForSelector:', + 'instancesRespondToSelector:', 'isSubclassOfClass:', + 'load', + 'mutableCopyWithZone:', 'resolveClassMethod:', 'resolveInstanceMethod:', - 'hash', 'superclass', - 'class', - 'description', - 'debugDescription', }; class _ObjCBuiltInFunctions { @@ -168,6 +170,7 @@ class ObjCInterface extends BindingType { final methodName = m._getDartMethodName(uniqueNamer); final selName = uniqueNamer.makeUnique('_sel_$methodName'); final isStatic = m.kind == ObjCMethodKind.classMethod; + final returnType = m.returnType!; // SEL object for the method. s.write(' static $selType? $selName;'); @@ -181,7 +184,7 @@ class ObjCInterface extends BindingType { if (m.kind == ObjCMethodKind.propertySetter) { s.write('set '); } else { - s.write('${_getConvertedType(m.returnType!, w, name)} '); + s.write('${_getConvertedType(returnType, w, name)} '); } if (m.kind == ObjCMethodKind.propertyGetter) s.write('get '); s.write(methodName); @@ -211,7 +214,7 @@ class ObjCInterface extends BindingType { } s.write(' $selName ??= ' '${_builtInFunctions.registerName}(_lib, "${m.originalName}");\n'); - final convertReturn = _needsConverting(m.returnType!); + final convertReturn = _needsConverting(returnType); s.write(' ${convertReturn ? 'final _ret = ' : 'return '}'); s.write('_lib.${m.msgSend!.name}('); s.write(isStatic ? '_class!' : '_id'); @@ -221,7 +224,7 @@ class ObjCInterface extends BindingType { } s.write(');\n'); if (convertReturn) { - final result = _doReturnConversion(m.returnType!, '_ret', name, '_lib'); + final result = _doReturnConversion(returnType, '_ret', name, '_lib'); s.write(' return $result;'); } @@ -239,15 +242,11 @@ class ObjCInterface extends BindingType { if (dependencies.contains(this)) return; dependencies.add(this); + _filterPropertyMethods(); + if (superType != null) { superType!.addDependencies(dependencies); - // Copy class methods from the super type, because Dart classes don't - // inherit static methods. - for (final m in superType!.classMethods.values) { - if (!_excludedNSObjectClassMethods.contains(m.originalName)) { - addMethod(m); - } - } + _copyClassMethodsFromSuperType(); } for (final m in methods) { @@ -257,6 +256,27 @@ class ObjCInterface extends BindingType { _builtInFunctions.addDependencies(dependencies); } + void _filterPropertyMethods() { + // Properties setters and getters are duplicated in the AST. One copy is + // marked it with ObjCMethodKind.propertyGetter/Setter. The other copy is + // missing important information, and is a plain old instanceMethod. So we + // need to discard the second copy. + final properties = Set.from( + methods.where((m) => m.isProperty).map((m) => m.originalName)); + methods.removeWhere( + (m) => !m.isProperty && properties.contains(m.originalName)); + } + + void _copyClassMethodsFromSuperType() { + // Copy class methods from the super type, because Dart classes don't + // inherit static methods. + for (final m in superType!.classMethods.values) { + if (!_excludedNSObjectClassMethods.contains(m.originalName)) { + addMethod(m); + } + } + } + void addMethod(ObjCMethod method) { methods.add(method); if (method.kind == ObjCMethodKind.classMethod) { @@ -334,7 +354,12 @@ class ObjCMethod { required this.kind, }); + bool get isProperty => + kind == ObjCMethodKind.propertyGetter || + kind == ObjCMethodKind.propertySetter; + void addDependencies(Set dependencies) { + returnType ??= NativeType(SupportedNativeType.Void); returnType!.addDependencies(dependencies); for (final p in params) { p.type.addDependencies(dependencies); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index 41aae404df..cdd7914743 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -149,7 +149,7 @@ void _parseMethod(clang_types.CXCursor cursor) { Pointer.fromFunction(_parseMethodVisitor, exceptional_visitor_return), nullptr); _methodStack.pop(); - if (parsed.hasError || method.returnType == null) { + if (parsed.hasError) { // Discard it. return; } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart index 6342aadde1..b1c239112e 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart @@ -50,7 +50,7 @@ class NativeLibrary { late final __objc_getClass = __objc_getClassPtr.asFunction< ffi.Pointer Function(ffi.Pointer)>(); - instancetype _objc_msgSend_0( + void _objc_msgSend_0( ffi.Pointer obj, ffi.Pointer sel, ) { @@ -62,48 +62,47 @@ class NativeLibrary { late final __objc_msgSend_0Ptr = _lookup< ffi.NativeFunction< - instancetype Function( + ffi.Void Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer)>(); instancetype _objc_msgSend_1( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, ) { return __objc_msgSend_1( obj, sel, - zone, ); } late final __objc_msgSend_1Ptr = _lookup< ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>>('objc_msgSend'); + instancetype Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>(); + instancetype Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_2( + instancetype _objc_msgSend_2( ffi.Pointer obj, ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, ) { return __objc_msgSend_2( obj, sel, + zone, ); } late final __objc_msgSend_2Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>>('objc_msgSend'); late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>(); ffi.Pointer _objc_msgSend_3( ffi.Pointer obj, @@ -126,22 +125,20 @@ class NativeLibrary { ffi.Pointer _objc_msgSend_4( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, ) { return __objc_msgSend_4( obj, sel, - zone, ); } late final __objc_msgSend_4Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer _objc_msgSend_5( ffi.Pointer obj, @@ -163,65 +160,65 @@ class NativeLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer<_NSZone>)>(); - int _objc_msgSend_6( + ffi.Pointer _objc_msgSend_6( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer aSelector, + ffi.Pointer<_NSZone> zone, ) { return __objc_msgSend_6( obj, sel, - aSelector, + zone, ); } late final __objc_msgSend_6Ptr = _lookup< ffi.NativeFunction< - BOOL Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); int _objc_msgSend_7( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer protocol, + ffi.Pointer aSelector, ) { return __objc_msgSend_7( obj, sel, - protocol, + aSelector, ); } late final __objc_msgSend_7Ptr = _lookup< ffi.NativeFunction< BOOL Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); - IMP _objc_msgSend_8( + int _objc_msgSend_8( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer aSelector, + ffi.Pointer protocol, ) { return __objc_msgSend_8( obj, sel, - aSelector, + protocol, ); } late final __objc_msgSend_8Ptr = _lookup< ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); IMP _objc_msgSend_9( ffi.Pointer obj, @@ -243,7 +240,7 @@ class NativeLibrary { IMP Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_10( + IMP _objc_msgSend_10( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, @@ -257,13 +254,13 @@ class NativeLibrary { late final __objc_msgSend_10Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_11( + void _objc_msgSend_11( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, @@ -277,11 +274,11 @@ class NativeLibrary { late final __objc_msgSend_11Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); ffi.Pointer _objc_msgSend_12( ffi.Pointer obj, @@ -303,217 +300,277 @@ class NativeLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_13( + void _objc_msgSend_13( ffi.Pointer obj, ffi.Pointer sel, + ffi.Pointer anInvocation, ) { return __objc_msgSend_13( obj, sel, + anInvocation, ); } late final __objc_msgSend_13Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_14( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_14( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_14Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_15( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_15( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_15Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_16( + obj, + sel, + ); + } + + late final __objc_msgSend_16Ptr = _lookup< ffi.NativeFunction< BOOL Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_14( + int _objc_msgSend_17( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aClass, ) { - return __objc_msgSend_14( + return __objc_msgSend_17( obj, sel, aClass, ); } - late final __objc_msgSend_14Ptr = _lookup< + late final __objc_msgSend_17Ptr = _lookup< ffi.NativeFunction< BOOL Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_15( + int _objc_msgSend_18( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer sel1, ) { - return __objc_msgSend_15( + return __objc_msgSend_18( obj, sel, sel1, ); } - late final __objc_msgSend_15Ptr = _lookup< + late final __objc_msgSend_18Ptr = _lookup< ffi.NativeFunction< BOOL Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_16( + int _objc_msgSend_19( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer sel1, ) { - return __objc_msgSend_16( + return __objc_msgSend_19( obj, sel, sel1, ); } - late final __objc_msgSend_16Ptr = _lookup< + late final __objc_msgSend_19Ptr = _lookup< ffi.NativeFunction< BOOL Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_17( + int _objc_msgSend_20( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_17( + return __objc_msgSend_20( obj, sel, ); } - late final __objc_msgSend_17Ptr = _lookup< + late final __objc_msgSend_20Ptr = _lookup< ffi.NativeFunction< NSUInteger Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_18( + ffi.Pointer _objc_msgSend_21( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_18( + return __objc_msgSend_21( obj, sel, ); } - late final __objc_msgSend_18Ptr = _lookup< + late final __objc_msgSend_21Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< + late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_19( + ffi.Pointer _objc_msgSend_22( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_19( + return __objc_msgSend_22( obj, sel, ); } - late final __objc_msgSend_19Ptr = _lookup< + late final __objc_msgSend_22Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< + late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_20( + ffi.Pointer _objc_msgSend_23( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_20( + return __objc_msgSend_23( obj, sel, ); } - late final __objc_msgSend_20Ptr = _lookup< + late final __objc_msgSend_23Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< + late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_21( + int _objc_msgSend_24( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_21( + return __objc_msgSend_24( obj, sel, ); } - late final __objc_msgSend_21Ptr = _lookup< + late final __objc_msgSend_24Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< + late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_22( + void _objc_msgSend_25( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_22( + return __objc_msgSend_25( obj, sel, value, ); } - late final __objc_msgSend_22Ptr = _lookup< + late final __objc_msgSend_25Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< + late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); - ffi.Pointer _objc_msgSend_23( + ffi.Pointer _objc_msgSend_26( ffi.Pointer obj, ffi.Pointer sel, double someArg, ) { - return __objc_msgSend_23( + return __objc_msgSend_26( obj, sel, someArg, ); } - late final __objc_msgSend_23Ptr = _lookup< + late final __objc_msgSend_26Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< + late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, double)>(); - int _objc_msgSend_24( + int _objc_msgSend_27( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer someArg, ffi.Pointer otherArg, ) { - return __objc_msgSend_24( + return __objc_msgSend_27( obj, sel, someArg, @@ -521,14 +578,14 @@ class NativeLibrary { ); } - late final __objc_msgSend_24Ptr = _lookup< + late final __objc_msgSend_27Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< + late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); } @@ -565,20 +622,20 @@ class Foo extends NSObject { static ffi.Pointer? _sel_someProperty; int get someProperty { _sel_someProperty ??= _registerName(_lib, "someProperty"); - return _lib._objc_msgSend_21(_id, _sel_someProperty!); + return _lib._objc_msgSend_24(_id, _sel_someProperty!); } static ffi.Pointer? _sel_someProperty1; set someProperty(int value) { _sel_someProperty1 ??= _registerName(_lib, "setSomeProperty:"); - return _lib._objc_msgSend_22(_id, _sel_someProperty1!, value); + return _lib._objc_msgSend_25(_id, _sel_someProperty1!, value); } static ffi.Pointer? _sel_aClassMethod; static Foo aClassMethod(NativeLibrary _lib, double someArg) { _class ??= _getClass(_lib, "Foo"); _sel_aClassMethod ??= _registerName(_lib, "aClassMethod:"); - final _ret = _lib._objc_msgSend_23(_class!, _sel_aClassMethod!, someArg); + final _ret = _lib._objc_msgSend_26(_class!, _sel_aClassMethod!, someArg); return Foo._(_ret, _lib); } @@ -586,7 +643,7 @@ class Foo extends NSObject { int anInstanceMethod(NSObject someArg, NSObject otherArg) { _sel_anInstanceMethod ??= _registerName(_lib, "anInstanceMethod:withOtherArg:"); - return _lib._objc_msgSend_24( + return _lib._objc_msgSend_27( _id, _sel_anInstanceMethod!, someArg._id, otherArg._id); } @@ -594,7 +651,7 @@ class Foo extends NSObject { static Foo new1(NativeLibrary _lib) { _class ??= _getClass(_lib, "Foo"); _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_0(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); return Foo._(_ret, _lib); } @@ -602,7 +659,7 @@ class Foo extends NSObject { static Foo alloc(NativeLibrary _lib) { _class ??= _getClass(_lib, "Foo"); _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_0(_class!, _sel_alloc!); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); return Foo._(_ret, _lib); } } @@ -616,10 +673,24 @@ class NSObject extends _ObjCWrapper { return NSObject._(other._id, other._lib); } + static ffi.Pointer? _sel_load; + static void load(NativeLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_load ??= _registerName(_lib, "load"); + return _lib._objc_msgSend_0(_class!, _sel_load!); + } + + static ffi.Pointer? _sel_initialize; + static void initialize(NativeLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_initialize ??= _registerName(_lib, "initialize"); + return _lib._objc_msgSend_0(_class!, _sel_initialize!); + } + static ffi.Pointer? _sel_init; NSObject init() { _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_0(_id, _sel_init!); + final _ret = _lib._objc_msgSend_1(_id, _sel_init!); return NSObject._(_ret, _lib); } @@ -627,7 +698,7 @@ class NSObject extends _ObjCWrapper { static NSObject new1(NativeLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_0(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); return NSObject._(_ret, _lib); } @@ -635,7 +706,7 @@ class NSObject extends _ObjCWrapper { static NSObject allocWithZone(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { _class ??= _getClass(_lib, "NSObject"); _sel_allocWithZone ??= _registerName(_lib, "allocWithZone:"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_allocWithZone!, zone); + final _ret = _lib._objc_msgSend_2(_class!, _sel_allocWithZone!, zone); return NSObject._(_ret, _lib); } @@ -643,21 +714,33 @@ class NSObject extends _ObjCWrapper { static NSObject alloc(NativeLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_0(_class!, _sel_alloc!); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); return NSObject._(_ret, _lib); } + static ffi.Pointer? _sel_dealloc; + void dealloc() { + _sel_dealloc ??= _registerName(_lib, "dealloc"); + return _lib._objc_msgSend_0(_id, _sel_dealloc!); + } + + static ffi.Pointer? _sel_finalize; + void finalize() { + _sel_finalize ??= _registerName(_lib, "finalize"); + return _lib._objc_msgSend_0(_id, _sel_finalize!); + } + static ffi.Pointer? _sel_copy; NSObject copy() { _sel_copy ??= _registerName(_lib, "copy"); - final _ret = _lib._objc_msgSend_2(_id, _sel_copy!); + final _ret = _lib._objc_msgSend_3(_id, _sel_copy!); return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_mutableCopy; NSObject mutableCopy() { _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); - final _ret = _lib._objc_msgSend_3(_id, _sel_mutableCopy!); + final _ret = _lib._objc_msgSend_4(_id, _sel_mutableCopy!); return NSObject._(_ret, _lib); } @@ -665,7 +748,7 @@ class NSObject extends _ObjCWrapper { static NSObject copyWithZone(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { _class ??= _getClass(_lib, "NSObject"); _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); - final _ret = _lib._objc_msgSend_4(_class!, _sel_copyWithZone!, zone); + final _ret = _lib._objc_msgSend_5(_class!, _sel_copyWithZone!, zone); return NSObject._(_ret, _lib); } @@ -674,7 +757,7 @@ class NSObject extends _ObjCWrapper { NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { _class ??= _getClass(_lib, "NSObject"); _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); - final _ret = _lib._objc_msgSend_5(_class!, _sel_mutableCopyWithZone!, zone); + final _ret = _lib._objc_msgSend_6(_class!, _sel_mutableCopyWithZone!, zone); return NSObject._(_ret, _lib); } @@ -684,7 +767,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instancesRespondToSelector ??= _registerName(_lib, "instancesRespondToSelector:"); - return _lib._objc_msgSend_6( + return _lib._objc_msgSend_7( _class!, _sel_instancesRespondToSelector!, aSelector); } @@ -692,14 +775,14 @@ class NSObject extends _ObjCWrapper { static int conformsToProtocol(NativeLibrary _lib, NSObject protocol) { _class ??= _getClass(_lib, "NSObject"); _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); - return _lib._objc_msgSend_7( + return _lib._objc_msgSend_8( _class!, _sel_conformsToProtocol!, protocol._id); } static ffi.Pointer? _sel_methodForSelector; IMP methodForSelector(ffi.Pointer aSelector) { _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); - return _lib._objc_msgSend_8(_id, _sel_methodForSelector!, aSelector); + return _lib._objc_msgSend_9(_id, _sel_methodForSelector!, aSelector); } static ffi.Pointer? _sel_instanceMethodForSelector; @@ -708,25 +791,40 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instanceMethodForSelector ??= _registerName(_lib, "instanceMethodForSelector:"); - return _lib._objc_msgSend_9( + return _lib._objc_msgSend_10( _class!, _sel_instanceMethodForSelector!, aSelector); } + static ffi.Pointer? _sel_doesNotRecognizeSelector; + void doesNotRecognizeSelector(ffi.Pointer aSelector) { + _sel_doesNotRecognizeSelector ??= + _registerName(_lib, "doesNotRecognizeSelector:"); + return _lib._objc_msgSend_11( + _id, _sel_doesNotRecognizeSelector!, aSelector); + } + static ffi.Pointer? _sel_forwardingTargetForSelector; NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { _sel_forwardingTargetForSelector ??= _registerName(_lib, "forwardingTargetForSelector:"); - final _ret = _lib._objc_msgSend_10( + final _ret = _lib._objc_msgSend_12( _id, _sel_forwardingTargetForSelector!, aSelector); return NSObject._(_ret, _lib); } + static ffi.Pointer? _sel_forwardInvocation; + void forwardInvocation(NSObject anInvocation) { + _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); + return _lib._objc_msgSend_13( + _id, _sel_forwardInvocation!, anInvocation._id); + } + static ffi.Pointer? _sel_methodSignatureForSelector; NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { _sel_methodSignatureForSelector ??= _registerName(_lib, "methodSignatureForSelector:"); final _ret = - _lib._objc_msgSend_11(_id, _sel_methodSignatureForSelector!, aSelector); + _lib._objc_msgSend_14(_id, _sel_methodSignatureForSelector!, aSelector); return NSMethodSignature._(_ret, _lib); } @@ -736,7 +834,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instanceMethodSignatureForSelector ??= _registerName(_lib, "instanceMethodSignatureForSelector:"); - final _ret = _lib._objc_msgSend_12( + final _ret = _lib._objc_msgSend_15( _class!, _sel_instanceMethodSignatureForSelector!, aSelector); return NSMethodSignature._(_ret, _lib); } @@ -744,27 +842,27 @@ class NSObject extends _ObjCWrapper { static ffi.Pointer? _sel_allowsWeakReference; int allowsWeakReference() { _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); - return _lib._objc_msgSend_13(_id, _sel_allowsWeakReference!); + return _lib._objc_msgSend_16(_id, _sel_allowsWeakReference!); } static ffi.Pointer? _sel_retainWeakReference; int retainWeakReference() { _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); - return _lib._objc_msgSend_13(_id, _sel_retainWeakReference!); + return _lib._objc_msgSend_16(_id, _sel_retainWeakReference!); } static ffi.Pointer? _sel_isSubclassOfClass; static int isSubclassOfClass(NativeLibrary _lib, NSObject aClass) { _class ??= _getClass(_lib, "NSObject"); _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); - return _lib._objc_msgSend_14(_class!, _sel_isSubclassOfClass!, aClass._id); + return _lib._objc_msgSend_17(_class!, _sel_isSubclassOfClass!, aClass._id); } static ffi.Pointer? _sel_resolveClassMethod; static int resolveClassMethod(NativeLibrary _lib, ffi.Pointer sel) { _class ??= _getClass(_lib, "NSObject"); _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); - return _lib._objc_msgSend_15(_class!, _sel_resolveClassMethod!, sel); + return _lib._objc_msgSend_18(_class!, _sel_resolveClassMethod!, sel); } static ffi.Pointer? _sel_resolveInstanceMethod; @@ -773,21 +871,21 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_resolveInstanceMethod ??= _registerName(_lib, "resolveInstanceMethod:"); - return _lib._objc_msgSend_16(_class!, _sel_resolveInstanceMethod!, sel); + return _lib._objc_msgSend_19(_class!, _sel_resolveInstanceMethod!, sel); } static ffi.Pointer? _sel_hash; static int hash(NativeLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_hash ??= _registerName(_lib, "hash"); - return _lib._objc_msgSend_17(_class!, _sel_hash!); + return _lib._objc_msgSend_20(_class!, _sel_hash!); } static ffi.Pointer? _sel_superclass; static NSObject superclass(NativeLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_superclass ??= _registerName(_lib, "superclass"); - final _ret = _lib._objc_msgSend_18(_class!, _sel_superclass!); + final _ret = _lib._objc_msgSend_21(_class!, _sel_superclass!); return NSObject._(_ret, _lib); } @@ -795,7 +893,7 @@ class NSObject extends _ObjCWrapper { static NSObject class1(NativeLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_class1 ??= _registerName(_lib, "class"); - final _ret = _lib._objc_msgSend_19(_class!, _sel_class1!); + final _ret = _lib._objc_msgSend_22(_class!, _sel_class1!); return NSObject._(_ret, _lib); } @@ -803,7 +901,7 @@ class NSObject extends _ObjCWrapper { static NSString description(NativeLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_description ??= _registerName(_lib, "description"); - final _ret = _lib._objc_msgSend_20(_class!, _sel_description!); + final _ret = _lib._objc_msgSend_23(_class!, _sel_description!); return NSString._(_ret, _lib); } @@ -811,7 +909,7 @@ class NSObject extends _ObjCWrapper { static NSString debugDescription(NativeLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_debugDescription ??= _registerName(_lib, "debugDescription"); - final _ret = _lib._objc_msgSend_20(_class!, _sel_debugDescription!); + final _ret = _lib._objc_msgSend_23(_class!, _sel_debugDescription!); return NSString._(_ret, _lib); } } diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart index 9f2e219de5..5e2b16030c 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart @@ -50,13 +50,20 @@ void main() { test('Interface basics, with Foo', () { final foo1 = Foo.makeFoo(lib, 3.14159); final foo2 = Foo.makeFoo(lib, 2.71828); + expect(foo1.intVal, 3); expect(foo2.intVal, 2); + expect(foo1.multiply(0, foo2), 8); expect(foo1.multiply(1, foo2), 6); + foo1.intVal = 100; expect(foo1.multiply(0, foo2), 8); expect(foo1.multiply(1, foo2), 200); + + foo2.setDoubleVal(1.61803); + expect(foo1.multiply(0, foo2), 5); + expect(foo1.multiply(1, foo2), 200); }); }); } diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test.m b/pkgs/ffigen/test/native_objc_test/native_objc_test.m index 98f9acaaef..41027c0f85 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test.m +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test.m @@ -10,6 +10,8 @@ + (Foo*)makeFoo:(double)x; - (int32_t)multiply:(BOOL)useIntVals withOtherFoo:(Foo*)other; +- (void)setDoubleVal:(double)x; + @end @implementation Foo @@ -29,4 +31,8 @@ - (int32_t)multiply:(BOOL)useIntVals withOtherFoo:(Foo*)other { } } +- (void)setDoubleVal:(double)x { + self->doubleVal = x; +} + @end diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart index 9c86588ce7..2fac4feb33 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart @@ -1017,7 +1017,7 @@ class NativeObjCLibrary { late final __objc_getClass = __objc_getClassPtr.asFunction< ffi.Pointer Function(ffi.Pointer)>(); - instancetype _objc_msgSend_0( + void _objc_msgSend_0( ffi.Pointer obj, ffi.Pointer sel, ) { @@ -1029,48 +1029,47 @@ class NativeObjCLibrary { late final __objc_msgSend_0Ptr = _lookup< ffi.NativeFunction< - instancetype Function( + ffi.Void Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer)>(); instancetype _objc_msgSend_1( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, ) { return __objc_msgSend_1( obj, sel, - zone, ); } late final __objc_msgSend_1Ptr = _lookup< ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>>('objc_msgSend'); + instancetype Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>(); + instancetype Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_2( + instancetype _objc_msgSend_2( ffi.Pointer obj, ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, ) { return __objc_msgSend_2( obj, sel, + zone, ); } late final __objc_msgSend_2Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>>('objc_msgSend'); late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>(); ffi.Pointer _objc_msgSend_3( ffi.Pointer obj, @@ -1093,22 +1092,20 @@ class NativeObjCLibrary { ffi.Pointer _objc_msgSend_4( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, ) { return __objc_msgSend_4( obj, sel, - zone, ); } late final __objc_msgSend_4Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer _objc_msgSend_5( ffi.Pointer obj, @@ -1130,65 +1127,65 @@ class NativeObjCLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer<_NSZone>)>(); - int _objc_msgSend_6( + ffi.Pointer _objc_msgSend_6( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer aSelector, + ffi.Pointer<_NSZone> zone, ) { return __objc_msgSend_6( obj, sel, - aSelector, + zone, ); } late final __objc_msgSend_6Ptr = _lookup< ffi.NativeFunction< - BOOL Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); int _objc_msgSend_7( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer protocol, + ffi.Pointer aSelector, ) { return __objc_msgSend_7( obj, sel, - protocol, + aSelector, ); } late final __objc_msgSend_7Ptr = _lookup< ffi.NativeFunction< BOOL Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); - IMP _objc_msgSend_8( + int _objc_msgSend_8( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer aSelector, + ffi.Pointer protocol, ) { return __objc_msgSend_8( obj, sel, - aSelector, + protocol, ); } late final __objc_msgSend_8Ptr = _lookup< ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); IMP _objc_msgSend_9( ffi.Pointer obj, @@ -1210,7 +1207,7 @@ class NativeObjCLibrary { IMP Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_10( + IMP _objc_msgSend_10( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, @@ -1224,13 +1221,13 @@ class NativeObjCLibrary { late final __objc_msgSend_10Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_11( + void _objc_msgSend_11( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, @@ -1244,11 +1241,11 @@ class NativeObjCLibrary { late final __objc_msgSend_11Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); ffi.Pointer _objc_msgSend_12( ffi.Pointer obj, @@ -1270,217 +1267,277 @@ class NativeObjCLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_13( + void _objc_msgSend_13( ffi.Pointer obj, ffi.Pointer sel, + ffi.Pointer anInvocation, ) { return __objc_msgSend_13( obj, sel, + anInvocation, ); } late final __objc_msgSend_13Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_14( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_14( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_14Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_15( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_15( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_15Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_16( + obj, + sel, + ); + } + + late final __objc_msgSend_16Ptr = _lookup< ffi.NativeFunction< BOOL Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_14( + int _objc_msgSend_17( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aClass, ) { - return __objc_msgSend_14( + return __objc_msgSend_17( obj, sel, aClass, ); } - late final __objc_msgSend_14Ptr = _lookup< + late final __objc_msgSend_17Ptr = _lookup< ffi.NativeFunction< BOOL Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_15( + int _objc_msgSend_18( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer sel1, ) { - return __objc_msgSend_15( + return __objc_msgSend_18( obj, sel, sel1, ); } - late final __objc_msgSend_15Ptr = _lookup< + late final __objc_msgSend_18Ptr = _lookup< ffi.NativeFunction< BOOL Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_16( + int _objc_msgSend_19( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer sel1, ) { - return __objc_msgSend_16( + return __objc_msgSend_19( obj, sel, sel1, ); } - late final __objc_msgSend_16Ptr = _lookup< + late final __objc_msgSend_19Ptr = _lookup< ffi.NativeFunction< BOOL Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_17( + int _objc_msgSend_20( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_17( + return __objc_msgSend_20( obj, sel, ); } - late final __objc_msgSend_17Ptr = _lookup< + late final __objc_msgSend_20Ptr = _lookup< ffi.NativeFunction< NSUInteger Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_18( + ffi.Pointer _objc_msgSend_21( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_18( + return __objc_msgSend_21( obj, sel, ); } - late final __objc_msgSend_18Ptr = _lookup< + late final __objc_msgSend_21Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< + late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_19( + ffi.Pointer _objc_msgSend_22( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_19( + return __objc_msgSend_22( obj, sel, ); } - late final __objc_msgSend_19Ptr = _lookup< + late final __objc_msgSend_22Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< + late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_20( + ffi.Pointer _objc_msgSend_23( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_20( + return __objc_msgSend_23( obj, sel, ); } - late final __objc_msgSend_20Ptr = _lookup< + late final __objc_msgSend_23Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< + late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_21( + int _objc_msgSend_24( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_21( + return __objc_msgSend_24( obj, sel, ); } - late final __objc_msgSend_21Ptr = _lookup< + late final __objc_msgSend_24Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< + late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_22( + void _objc_msgSend_25( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_22( + return __objc_msgSend_25( obj, sel, value, ); } - late final __objc_msgSend_22Ptr = _lookup< + late final __objc_msgSend_25Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< + late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); - ffi.Pointer _objc_msgSend_23( + ffi.Pointer _objc_msgSend_26( ffi.Pointer obj, ffi.Pointer sel, double x, ) { - return __objc_msgSend_23( + return __objc_msgSend_26( obj, sel, x, ); } - late final __objc_msgSend_23Ptr = _lookup< + late final __objc_msgSend_26Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< + late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, double)>(); - int _objc_msgSend_24( + int _objc_msgSend_27( ffi.Pointer obj, ffi.Pointer sel, int useIntVals, ffi.Pointer other, ) { - return __objc_msgSend_24( + return __objc_msgSend_27( obj, sel, useIntVals, @@ -1488,13 +1545,32 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_24Ptr = _lookup< + late final __objc_msgSend_27Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer, BOOL, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< + late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); + + void _objc_msgSend_28( + ffi.Pointer obj, + ffi.Pointer sel, + double x, + ) { + return __objc_msgSend_28( + obj, + sel, + x, + ); + } + + late final __objc_msgSend_28Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_28 = __objc_msgSend_28Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double)>(); } class ObjCObject extends ffi.Opaque {} @@ -1652,34 +1728,40 @@ class Foo extends NSObject { static ffi.Pointer? _sel_intVal; int get intVal { _sel_intVal ??= _registerName(_lib, "intVal"); - return _lib._objc_msgSend_21(_id, _sel_intVal!); + return _lib._objc_msgSend_24(_id, _sel_intVal!); } static ffi.Pointer? _sel_intVal1; set intVal(int value) { _sel_intVal1 ??= _registerName(_lib, "setIntVal:"); - return _lib._objc_msgSend_22(_id, _sel_intVal1!, value); + return _lib._objc_msgSend_25(_id, _sel_intVal1!, value); } static ffi.Pointer? _sel_makeFoo; static Foo makeFoo(NativeObjCLibrary _lib, double x) { _class ??= _getClass(_lib, "Foo"); _sel_makeFoo ??= _registerName(_lib, "makeFoo:"); - final _ret = _lib._objc_msgSend_23(_class!, _sel_makeFoo!, x); + final _ret = _lib._objc_msgSend_26(_class!, _sel_makeFoo!, x); return Foo._(_ret, _lib); } static ffi.Pointer? _sel_multiply; int multiply(int useIntVals, NSObject other) { _sel_multiply ??= _registerName(_lib, "multiply:withOtherFoo:"); - return _lib._objc_msgSend_24(_id, _sel_multiply!, useIntVals, other._id); + return _lib._objc_msgSend_27(_id, _sel_multiply!, useIntVals, other._id); + } + + static ffi.Pointer? _sel_setDoubleVal; + void setDoubleVal(double x) { + _sel_setDoubleVal ??= _registerName(_lib, "setDoubleVal:"); + return _lib._objc_msgSend_28(_id, _sel_setDoubleVal!, x); } static ffi.Pointer? _sel_new1; static Foo new1(NativeObjCLibrary _lib) { _class ??= _getClass(_lib, "Foo"); _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_0(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); return Foo._(_ret, _lib); } @@ -1687,7 +1769,7 @@ class Foo extends NSObject { static Foo alloc(NativeObjCLibrary _lib) { _class ??= _getClass(_lib, "Foo"); _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_0(_class!, _sel_alloc!); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); return Foo._(_ret, _lib); } } @@ -1702,10 +1784,24 @@ class NSObject extends _ObjCWrapper { return NSObject._(other._id, other._lib); } + static ffi.Pointer? _sel_load; + static void load(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_load ??= _registerName(_lib, "load"); + return _lib._objc_msgSend_0(_class!, _sel_load!); + } + + static ffi.Pointer? _sel_initialize; + static void initialize(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_initialize ??= _registerName(_lib, "initialize"); + return _lib._objc_msgSend_0(_class!, _sel_initialize!); + } + static ffi.Pointer? _sel_init; NSObject init() { _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_0(_id, _sel_init!); + final _ret = _lib._objc_msgSend_1(_id, _sel_init!); return NSObject._(_ret, _lib); } @@ -1713,7 +1809,7 @@ class NSObject extends _ObjCWrapper { static NSObject new1(NativeObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_0(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); return NSObject._(_ret, _lib); } @@ -1722,7 +1818,7 @@ class NSObject extends _ObjCWrapper { NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { _class ??= _getClass(_lib, "NSObject"); _sel_allocWithZone ??= _registerName(_lib, "allocWithZone:"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_allocWithZone!, zone); + final _ret = _lib._objc_msgSend_2(_class!, _sel_allocWithZone!, zone); return NSObject._(_ret, _lib); } @@ -1730,21 +1826,33 @@ class NSObject extends _ObjCWrapper { static NSObject alloc(NativeObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_0(_class!, _sel_alloc!); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); return NSObject._(_ret, _lib); } + static ffi.Pointer? _sel_dealloc; + void dealloc() { + _sel_dealloc ??= _registerName(_lib, "dealloc"); + return _lib._objc_msgSend_0(_id, _sel_dealloc!); + } + + static ffi.Pointer? _sel_finalize; + void finalize() { + _sel_finalize ??= _registerName(_lib, "finalize"); + return _lib._objc_msgSend_0(_id, _sel_finalize!); + } + static ffi.Pointer? _sel_copy; NSObject copy() { _sel_copy ??= _registerName(_lib, "copy"); - final _ret = _lib._objc_msgSend_2(_id, _sel_copy!); + final _ret = _lib._objc_msgSend_3(_id, _sel_copy!); return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_mutableCopy; NSObject mutableCopy() { _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); - final _ret = _lib._objc_msgSend_3(_id, _sel_mutableCopy!); + final _ret = _lib._objc_msgSend_4(_id, _sel_mutableCopy!); return NSObject._(_ret, _lib); } @@ -1753,7 +1861,7 @@ class NSObject extends _ObjCWrapper { NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { _class ??= _getClass(_lib, "NSObject"); _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); - final _ret = _lib._objc_msgSend_4(_class!, _sel_copyWithZone!, zone); + final _ret = _lib._objc_msgSend_5(_class!, _sel_copyWithZone!, zone); return NSObject._(_ret, _lib); } @@ -1762,7 +1870,7 @@ class NSObject extends _ObjCWrapper { NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { _class ??= _getClass(_lib, "NSObject"); _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); - final _ret = _lib._objc_msgSend_5(_class!, _sel_mutableCopyWithZone!, zone); + final _ret = _lib._objc_msgSend_6(_class!, _sel_mutableCopyWithZone!, zone); return NSObject._(_ret, _lib); } @@ -1772,7 +1880,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instancesRespondToSelector ??= _registerName(_lib, "instancesRespondToSelector:"); - return _lib._objc_msgSend_6( + return _lib._objc_msgSend_7( _class!, _sel_instancesRespondToSelector!, aSelector); } @@ -1780,14 +1888,14 @@ class NSObject extends _ObjCWrapper { static int conformsToProtocol(NativeObjCLibrary _lib, NSObject protocol) { _class ??= _getClass(_lib, "NSObject"); _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); - return _lib._objc_msgSend_7( + return _lib._objc_msgSend_8( _class!, _sel_conformsToProtocol!, protocol._id); } static ffi.Pointer? _sel_methodForSelector; IMP methodForSelector(ffi.Pointer aSelector) { _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); - return _lib._objc_msgSend_8(_id, _sel_methodForSelector!, aSelector); + return _lib._objc_msgSend_9(_id, _sel_methodForSelector!, aSelector); } static ffi.Pointer? _sel_instanceMethodForSelector; @@ -1796,25 +1904,40 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instanceMethodForSelector ??= _registerName(_lib, "instanceMethodForSelector:"); - return _lib._objc_msgSend_9( + return _lib._objc_msgSend_10( _class!, _sel_instanceMethodForSelector!, aSelector); } + static ffi.Pointer? _sel_doesNotRecognizeSelector; + void doesNotRecognizeSelector(ffi.Pointer aSelector) { + _sel_doesNotRecognizeSelector ??= + _registerName(_lib, "doesNotRecognizeSelector:"); + return _lib._objc_msgSend_11( + _id, _sel_doesNotRecognizeSelector!, aSelector); + } + static ffi.Pointer? _sel_forwardingTargetForSelector; NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { _sel_forwardingTargetForSelector ??= _registerName(_lib, "forwardingTargetForSelector:"); - final _ret = _lib._objc_msgSend_10( + final _ret = _lib._objc_msgSend_12( _id, _sel_forwardingTargetForSelector!, aSelector); return NSObject._(_ret, _lib); } + static ffi.Pointer? _sel_forwardInvocation; + void forwardInvocation(NSObject anInvocation) { + _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); + return _lib._objc_msgSend_13( + _id, _sel_forwardInvocation!, anInvocation._id); + } + static ffi.Pointer? _sel_methodSignatureForSelector; NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { _sel_methodSignatureForSelector ??= _registerName(_lib, "methodSignatureForSelector:"); final _ret = - _lib._objc_msgSend_11(_id, _sel_methodSignatureForSelector!, aSelector); + _lib._objc_msgSend_14(_id, _sel_methodSignatureForSelector!, aSelector); return NSMethodSignature._(_ret, _lib); } @@ -1824,7 +1947,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instanceMethodSignatureForSelector ??= _registerName(_lib, "instanceMethodSignatureForSelector:"); - final _ret = _lib._objc_msgSend_12( + final _ret = _lib._objc_msgSend_15( _class!, _sel_instanceMethodSignatureForSelector!, aSelector); return NSMethodSignature._(_ret, _lib); } @@ -1832,20 +1955,20 @@ class NSObject extends _ObjCWrapper { static ffi.Pointer? _sel_allowsWeakReference; int allowsWeakReference() { _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); - return _lib._objc_msgSend_13(_id, _sel_allowsWeakReference!); + return _lib._objc_msgSend_16(_id, _sel_allowsWeakReference!); } static ffi.Pointer? _sel_retainWeakReference; int retainWeakReference() { _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); - return _lib._objc_msgSend_13(_id, _sel_retainWeakReference!); + return _lib._objc_msgSend_16(_id, _sel_retainWeakReference!); } static ffi.Pointer? _sel_isSubclassOfClass; static int isSubclassOfClass(NativeObjCLibrary _lib, NSObject aClass) { _class ??= _getClass(_lib, "NSObject"); _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); - return _lib._objc_msgSend_14(_class!, _sel_isSubclassOfClass!, aClass._id); + return _lib._objc_msgSend_17(_class!, _sel_isSubclassOfClass!, aClass._id); } static ffi.Pointer? _sel_resolveClassMethod; @@ -1853,7 +1976,7 @@ class NSObject extends _ObjCWrapper { NativeObjCLibrary _lib, ffi.Pointer sel) { _class ??= _getClass(_lib, "NSObject"); _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); - return _lib._objc_msgSend_15(_class!, _sel_resolveClassMethod!, sel); + return _lib._objc_msgSend_18(_class!, _sel_resolveClassMethod!, sel); } static ffi.Pointer? _sel_resolveInstanceMethod; @@ -1862,21 +1985,21 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_resolveInstanceMethod ??= _registerName(_lib, "resolveInstanceMethod:"); - return _lib._objc_msgSend_16(_class!, _sel_resolveInstanceMethod!, sel); + return _lib._objc_msgSend_19(_class!, _sel_resolveInstanceMethod!, sel); } static ffi.Pointer? _sel_hash; static int hash(NativeObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_hash ??= _registerName(_lib, "hash"); - return _lib._objc_msgSend_17(_class!, _sel_hash!); + return _lib._objc_msgSend_20(_class!, _sel_hash!); } static ffi.Pointer? _sel_superclass; static NSObject superclass(NativeObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_superclass ??= _registerName(_lib, "superclass"); - final _ret = _lib._objc_msgSend_18(_class!, _sel_superclass!); + final _ret = _lib._objc_msgSend_21(_class!, _sel_superclass!); return NSObject._(_ret, _lib); } @@ -1884,7 +2007,7 @@ class NSObject extends _ObjCWrapper { static NSObject class1(NativeObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_class1 ??= _registerName(_lib, "class"); - final _ret = _lib._objc_msgSend_19(_class!, _sel_class1!); + final _ret = _lib._objc_msgSend_22(_class!, _sel_class1!); return NSObject._(_ret, _lib); } @@ -1892,7 +2015,7 @@ class NSObject extends _ObjCWrapper { static NSString description(NativeObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_description ??= _registerName(_lib, "description"); - final _ret = _lib._objc_msgSend_20(_class!, _sel_description!); + final _ret = _lib._objc_msgSend_23(_class!, _sel_description!); return NSString._(_ret, _lib); } @@ -1900,7 +2023,7 @@ class NSObject extends _ObjCWrapper { static NSString debugDescription(NativeObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_debugDescription ??= _registerName(_lib, "debugDescription"); - final _ret = _lib._objc_msgSend_20(_class!, _sel_debugDescription!); + final _ret = _lib._objc_msgSend_23(_class!, _sel_debugDescription!); return NSString._(_ret, _lib); } } From eece4afebf79aa8fcbfaf1b594370e617049510c Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Mon, 11 Apr 2022 11:46:31 -0700 Subject: [PATCH 112/276] [ffigen] NSString <-> String converters (#310) * NSString utils * Add an extension method to String --- .../src/code_generator/objc_interface.dart | 76 +- .../_expected_objc_interface_bindings.dart | 120 +- .../native_objc_test/native_objc_test.dart | 15 + .../test/native_objc_test/native_objc_test.m | 12 + .../native_objc_test_bindings.dart | 5633 +++++++++++++++-- 5 files changed, 5444 insertions(+), 412 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 2fdd283f52..a3e8b3c60b 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -108,6 +108,30 @@ class _ObjCBuiltInFunctions { func.addDependencies(dependencies); } } + + void generateNSStringUtils(Writer w, StringBuffer s) { + // Generate a constructor that wraps stringWithCString. + s.write(' factory NSString(${w.className} _lib, String str) {\n'); + s.write(' final cstr = str.toNativeUtf8();\n'); + s.write(' final nsstr = stringWithCString(' + '_lib, cstr.cast(), 4 /* UTF8 */);\n'); + s.write(' ${w.ffiPkgLibraryPrefix}.calloc.free(cstr);\n'); + s.write(' return nsstr;\n'); + s.write(' }\n\n'); + + // Generate a toString method that wraps UTF8String. + s.write(' @override\n'); + s.write(' String toString() => UTF8String().cast<' + '${w.ffiPkgLibraryPrefix}.Utf8>().toDartString();\n\n'); + } + + void generateStringUtils(Writer w, StringBuffer s) { + // Generate an extension on String to convert to NSString + s.write('extension StringToNSString on String {\n'); + s.write(' NSString toNSString(${w.className} lib) => ' + 'NSString(lib, this);\n'); + s.write('}\n\n'); + } } final _builtInFunctions = _ObjCBuiltInFunctions(); @@ -136,6 +160,8 @@ class ObjCInterface extends BindingType { dartDoc: dartDoc, ); + bool get isNSString => name == "NSString"; + @override BindingString toBindingString(Writer w) { final s = StringBuffer(); @@ -165,6 +191,10 @@ class ObjCInterface extends BindingType { s.write(' return $name._(other._id, other._lib);\n'); s.write(' }\n\n'); + if (isNSString) { + _builtInFunctions.generateNSStringUtils(w, s); + } + // Methods. for (final m in methods) { final methodName = m._getDartMethodName(uniqueNamer); @@ -179,6 +209,9 @@ class ObjCInterface extends BindingType { if (m.dartDoc != null) { s.write(makeDartDoc(m.dartDoc!)); } + if (!isStatic && (superType?.hasMethod(m) ?? false)) { + s.write(' @override\n'); + } s.write(' '); if (isStatic) s.write('static '); if (m.kind == ObjCMethodKind.propertySetter) { @@ -233,6 +266,10 @@ class ObjCInterface extends BindingType { s.write('}\n\n'); + if (isNSString) { + _builtInFunctions.generateStringUtils(w, s); + } + return BindingString( type: BindingStringType.objcInterface, string: s.toString()); } @@ -242,6 +279,10 @@ class ObjCInterface extends BindingType { if (dependencies.contains(this)) return; dependencies.add(this); + if (isNSString) { + _addNSStringMethods(); + } + _filterPropertyMethods(); if (superType != null) { @@ -284,6 +325,35 @@ class ObjCInterface extends BindingType { } } + bool hasMethod(ObjCMethod method) { + return methods.any( + (m) => m.originalName == method.originalName && m.kind == method.kind); + } + + void addMethodIfMissing(ObjCMethod method) { + if (!hasMethod(method)) { + addMethod(method); + } + } + + void _addNSStringMethods() { + addMethodIfMissing(ObjCMethod( + originalName: 'stringWithCString:encoding:', + kind: ObjCMethodKind.classMethod, + returnType: this, + params_: [ + ObjCMethodParam(PointerType(charType), 'cString'), + ObjCMethodParam(unsignedIntType, 'enc'), + ], + )); + addMethodIfMissing(ObjCMethod( + originalName: 'UTF8String', + kind: ObjCMethodKind.instanceMethod, + returnType: PointerType(charType), + params_: [], + )); + } + @override String getCType(Writer w) => PointerType(objCObjectType).getCType(w); @@ -343,7 +413,7 @@ class ObjCMethod { final String originalName; final ObjCProperty? property; Type? returnType; - final params = []; + final List params; final ObjCMethodKind kind; Func? msgSend; @@ -352,7 +422,9 @@ class ObjCMethod { this.property, this.dartDoc, required this.kind, - }); + this.returnType, + List? params_, + }) : params = params_ ?? []; bool get isProperty => kind == ObjCMethodKind.propertyGetter || diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart index b1c239112e..96b638f0ba 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart @@ -493,22 +493,29 @@ class NativeLibrary { ffi.Pointer _objc_msgSend_23( ffi.Pointer obj, ffi.Pointer sel, + ffi.Pointer cString, + int enc, ) { return __objc_msgSend_23( obj, sel, + cString, + enc, ); } late final __objc_msgSend_23Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + pkg_ffi.UnsignedInt)>>('objc_msgSend'); late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); - int _objc_msgSend_24( + ffi.Pointer _objc_msgSend_24( ffi.Pointer obj, ffi.Pointer sel, ) { @@ -520,57 +527,93 @@ class NativeLibrary { late final __objc_msgSend_24Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_25( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_25( + obj, + sel, + ); + } + + late final __objc_msgSend_25Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_26( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_26( + obj, + sel, + ); + } + + late final __objc_msgSend_26Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_25( + void _objc_msgSend_27( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_25( + return __objc_msgSend_27( obj, sel, value, ); } - late final __objc_msgSend_25Ptr = _lookup< + late final __objc_msgSend_27Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< + late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); - ffi.Pointer _objc_msgSend_26( + ffi.Pointer _objc_msgSend_28( ffi.Pointer obj, ffi.Pointer sel, double someArg, ) { - return __objc_msgSend_26( + return __objc_msgSend_28( obj, sel, someArg, ); } - late final __objc_msgSend_26Ptr = _lookup< + late final __objc_msgSend_28Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< + late final __objc_msgSend_28 = __objc_msgSend_28Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, double)>(); - int _objc_msgSend_27( + int _objc_msgSend_29( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer someArg, ffi.Pointer otherArg, ) { - return __objc_msgSend_27( + return __objc_msgSend_29( obj, sel, someArg, @@ -578,14 +621,14 @@ class NativeLibrary { ); } - late final __objc_msgSend_27Ptr = _lookup< + late final __objc_msgSend_29Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< + late final __objc_msgSend_29 = __objc_msgSend_29Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); } @@ -622,20 +665,20 @@ class Foo extends NSObject { static ffi.Pointer? _sel_someProperty; int get someProperty { _sel_someProperty ??= _registerName(_lib, "someProperty"); - return _lib._objc_msgSend_24(_id, _sel_someProperty!); + return _lib._objc_msgSend_26(_id, _sel_someProperty!); } static ffi.Pointer? _sel_someProperty1; set someProperty(int value) { _sel_someProperty1 ??= _registerName(_lib, "setSomeProperty:"); - return _lib._objc_msgSend_25(_id, _sel_someProperty1!, value); + return _lib._objc_msgSend_27(_id, _sel_someProperty1!, value); } static ffi.Pointer? _sel_aClassMethod; static Foo aClassMethod(NativeLibrary _lib, double someArg) { _class ??= _getClass(_lib, "Foo"); _sel_aClassMethod ??= _registerName(_lib, "aClassMethod:"); - final _ret = _lib._objc_msgSend_26(_class!, _sel_aClassMethod!, someArg); + final _ret = _lib._objc_msgSend_28(_class!, _sel_aClassMethod!, someArg); return Foo._(_ret, _lib); } @@ -643,7 +686,7 @@ class Foo extends NSObject { int anInstanceMethod(NSObject someArg, NSObject otherArg) { _sel_anInstanceMethod ??= _registerName(_lib, "anInstanceMethod:withOtherArg:"); - return _lib._objc_msgSend_27( + return _lib._objc_msgSend_29( _id, _sel_anInstanceMethod!, someArg._id, otherArg._id); } @@ -901,7 +944,7 @@ class NSObject extends _ObjCWrapper { static NSString description(NativeLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_description ??= _registerName(_lib, "description"); - final _ret = _lib._objc_msgSend_23(_class!, _sel_description!); + final _ret = _lib._objc_msgSend_25(_class!, _sel_description!); return NSString._(_ret, _lib); } @@ -909,7 +952,7 @@ class NSObject extends _ObjCWrapper { static NSString debugDescription(NativeLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_debugDescription ??= _registerName(_lib, "debugDescription"); - final _ret = _lib._objc_msgSend_23(_class!, _sel_debugDescription!); + final _ret = _lib._objc_msgSend_25(_class!, _sel_debugDescription!); return NSString._(_ret, _lib); } } @@ -947,4 +990,35 @@ class NSString extends _ObjCWrapper { static NSString castFrom(T other) { return NSString._(other._id, other._lib); } + + factory NSString(NativeLibrary _lib, String str) { + final cstr = str.toNativeUtf8(); + final nsstr = stringWithCString(_lib, cstr.cast(), 4 /* UTF8 */); + pkg_ffi.calloc.free(cstr); + return nsstr; + } + + @override + String toString() => UTF8String().cast().toDartString(); + + static ffi.Pointer? _sel_stringWithCString; + static NSString stringWithCString( + NativeLibrary _lib, ffi.Pointer cString, int enc) { + _class ??= _getClass(_lib, "NSString"); + _sel_stringWithCString ??= + _registerName(_lib, "stringWithCString:encoding:"); + final _ret = + _lib._objc_msgSend_23(_class!, _sel_stringWithCString!, cString, enc); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_UTF8String; + ffi.Pointer UTF8String() { + _sel_UTF8String ??= _registerName(_lib, "UTF8String"); + return _lib._objc_msgSend_24(_id, _sel_UTF8String!); + } +} + +extension StringToNSString on String { + NSString toNSString(NativeLibrary lib) => NSString(lib, this); } diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart index 5e2b16030c..1feaa9a079 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart @@ -65,5 +65,20 @@ void main() { expect(foo1.multiply(0, foo2), 5); expect(foo1.multiply(1, foo2), 200); }); + + test('NSString manipulations', () { + final str1 = NSString(lib, "Hello"); + final str2 = "World!".toNSString(lib); + + expect(str1.length, 5); + expect(str2.length, 6); + + expect(str1.toString(), "Hello"); + expect(str2.toString(), "World!"); + + final str3 = StringUtil.strConcat(lib, str1, str2); + expect(str3.length, 11); + expect(str3.toString(), "HelloWorld!"); + }); }); } diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test.m b/pkgs/ffigen/test/native_objc_test/native_objc_test.m index 41027c0f85..207282ae59 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test.m +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test.m @@ -1,4 +1,5 @@ #import +#import @interface Foo : NSObject { double doubleVal; @@ -36,3 +37,14 @@ - (void)setDoubleVal:(double)x { } @end + +// TODO(#309): strConcat should just be a static function. +@interface StringUtil : NSObject {} ++ (NSString*)strConcat:(NSString*)a with:(NSString*)b; +@end + +@implementation StringUtil ++ (NSString*)strConcat:(NSString*)a with:(NSString*)b { + return [a stringByAppendingString:b]; +} +@end diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart index 2fac4feb33..e40b0d567a 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart @@ -1457,263 +1457,5314 @@ class NativeObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_23( + void _objc_msgSend_23( ffi.Pointer obj, ffi.Pointer sel, + int value, ) { return __objc_msgSend_23( obj, sel, + value, ); } late final __objc_msgSend_23Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer, int)>(); int _objc_msgSend_24( ffi.Pointer obj, ffi.Pointer sel, + int index, ) { return __objc_msgSend_24( obj, sel, + index, ); } late final __objc_msgSend_24Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + unichar Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); - void _objc_msgSend_25( + instancetype _objc_msgSend_25( ffi.Pointer obj, ffi.Pointer sel, - int value, + ffi.Pointer coder, ) { return __objc_msgSend_25( obj, sel, - value, + coder, ); } late final __objc_msgSend_25Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); ffi.Pointer _objc_msgSend_26( ffi.Pointer obj, ffi.Pointer sel, - double x, + ffi.Pointer cString, + int enc, ) { return __objc_msgSend_26( obj, sel, - x, + cString, + enc, ); } late final __objc_msgSend_26Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Double)>>('objc_msgSend'); + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + pkg_ffi.UnsignedInt)>>('objc_msgSend'); late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); - int _objc_msgSend_27( + ffi.Pointer _objc_msgSend_27( ffi.Pointer obj, ffi.Pointer sel, - int useIntVals, - ffi.Pointer other, ) { return __objc_msgSend_27( obj, sel, - useIntVals, - other, ); } late final __objc_msgSend_27Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - BOOL, ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_28( + ffi.Pointer _objc_msgSend_28( ffi.Pointer obj, ffi.Pointer sel, - double x, ) { return __objc_msgSend_28( obj, sel, - x, ); } late final __objc_msgSend_28Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Double)>>('objc_msgSend'); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_28 = __objc_msgSend_28Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, double)>(); -} - -class ObjCObject extends ffi.Opaque {} - -class ObjCSel extends ffi.Opaque {} - -typedef NSUInteger = pkg_ffi.UnsignedLong; - -class __va_list_tag extends ffi.Struct { - @pkg_ffi.UnsignedInt() - external int gp_offset; + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - @pkg_ffi.UnsignedInt() - external int fp_offset; + void _objc_msgSend_29( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + int size, + ) { + return __objc_msgSend_29( + obj, + sel, + value, + size, + ); + } - external ffi.Pointer overflow_arg_area; + late final __objc_msgSend_29Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_29 = __objc_msgSend_29Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); - external ffi.Pointer reg_save_area; -} + ffi.Pointer _objc_msgSend_30( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_30( + obj, + sel, + ); + } -abstract class NSComparisonResult { - static const int NSOrderedAscending = -1; - static const int NSOrderedSame = 0; - static const int NSOrderedDescending = 1; -} + late final __objc_msgSend_30Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_30 = __objc_msgSend_30Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); -abstract class NSEnumerationOptions { - static const int NSEnumerationConcurrent = 1; - static const int NSEnumerationReverse = 2; -} + void _objc_msgSend_31( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_31( + obj, + sel, + value, + ); + } -abstract class NSSortOptions { - static const int NSSortConcurrent = 1; - static const int NSSortStable = 16; -} + late final __objc_msgSend_31Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_31 = __objc_msgSend_31Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); -abstract class NSQualityOfService { - static const int NSQualityOfServiceUserInteractive = 33; - static const int NSQualityOfServiceUserInitiated = 25; - static const int NSQualityOfServiceUtility = 17; - static const int NSQualityOfServiceBackground = 9; - static const int NSQualityOfServiceDefault = -1; -} + instancetype _objc_msgSend_32( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ffi.Pointer type, + ) { + return __objc_msgSend_32( + obj, + sel, + value, + type, + ); + } -typedef NSInteger = pkg_ffi.Long; + late final __objc_msgSend_32Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_32 = __objc_msgSend_32Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); -class __CFString extends ffi.Opaque {} + instancetype _objc_msgSend_33( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_33( + obj, + sel, + coder, + ); + } -abstract class CFComparisonResult { - static const int kCFCompareLessThan = -1; - static const int kCFCompareEqualTo = 0; - static const int kCFCompareGreaterThan = 1; -} + late final __objc_msgSend_33Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_33 = __objc_msgSend_33Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); -typedef CFIndex = pkg_ffi.Long; + instancetype _objc_msgSend_34( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_34( + obj, + sel, + coder, + ); + } -class CFRange extends ffi.Struct { - @CFIndex() - external int location; + late final __objc_msgSend_34Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_34 = __objc_msgSend_34Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - @CFIndex() - external int length; -} + ffi.Pointer _objc_msgSend_35( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_35( + obj, + sel, + value, + ); + } -class __CFNull extends ffi.Opaque {} + late final __objc_msgSend_35Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Char)>>('objc_msgSend'); + late final __objc_msgSend_35 = __objc_msgSend_35Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); -typedef CFTypeID = pkg_ffi.UnsignedLong; -typedef CFNullRef = ffi.Pointer<__CFNull>; + ffi.Pointer _objc_msgSend_36( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_36( + obj, + sel, + value, + ); + } -class __CFAllocator extends ffi.Opaque {} + late final __objc_msgSend_36Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedChar)>>('objc_msgSend'); + late final __objc_msgSend_36 = __objc_msgSend_36Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); -typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; + ffi.Pointer _objc_msgSend_37( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_37( + obj, + sel, + value, + ); + } -class CFAllocatorContext extends ffi.Struct { - @CFIndex() - external int version; + late final __objc_msgSend_37Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Short)>>('objc_msgSend'); + late final __objc_msgSend_37 = __objc_msgSend_37Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); - external ffi.Pointer info; + ffi.Pointer _objc_msgSend_38( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_38( + obj, + sel, + value, + ); + } - external CFAllocatorRetainCallBack retain; + late final __objc_msgSend_38Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedShort)>>('objc_msgSend'); + late final __objc_msgSend_38 = __objc_msgSend_38Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); - external CFAllocatorReleaseCallBack release; + ffi.Pointer _objc_msgSend_39( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_39( + obj, + sel, + value, + ); + } - external CFAllocatorCopyDescriptionCallBack copyDescription; + late final __objc_msgSend_39Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Int)>>('objc_msgSend'); + late final __objc_msgSend_39 = __objc_msgSend_39Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); - external CFAllocatorAllocateCallBack allocate; + ffi.Pointer _objc_msgSend_40( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_40( + obj, + sel, + value, + ); + } - external CFAllocatorReallocateCallBack reallocate; + late final __objc_msgSend_40Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_40 = __objc_msgSend_40Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); - external CFAllocatorDeallocateCallBack deallocate; + ffi.Pointer _objc_msgSend_41( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_41( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_41Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Long)>>('objc_msgSend'); + late final __objc_msgSend_41 = __objc_msgSend_41Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_42( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_42( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_42Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_42 = __objc_msgSend_42Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_43( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_43( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_43Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.LongLong)>>('objc_msgSend'); + late final __objc_msgSend_43 = __objc_msgSend_43Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_44( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_44( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_44Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedLongLong)>>('objc_msgSend'); + late final __objc_msgSend_44 = __objc_msgSend_44Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_45( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_45( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_45Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Float)>>('objc_msgSend'); + late final __objc_msgSend_45 = __objc_msgSend_45Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); + + ffi.Pointer _objc_msgSend_46( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_46( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_46Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_46 = __objc_msgSend_46Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); + + ffi.Pointer _objc_msgSend_47( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_47( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_47Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, BOOL)>>('objc_msgSend'); + late final __objc_msgSend_47 = __objc_msgSend_47Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_48( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_48( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_48Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_48 = __objc_msgSend_48Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_49( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_49( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_49Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_49 = __objc_msgSend_49Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + int _objc_msgSend_50( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_50( + obj, + sel, + ); + } + + late final __objc_msgSend_50Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.Char Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_50 = __objc_msgSend_50Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_51( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_51( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_51Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + pkg_ffi.Char)>>('objc_msgSend'); + late final __objc_msgSend_51 = __objc_msgSend_51Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + int _objc_msgSend_52( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_52( + obj, + sel, + ); + } + + late final __objc_msgSend_52Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedChar Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_52 = __objc_msgSend_52Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_53( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_53( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_53Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + pkg_ffi.UnsignedChar)>>('objc_msgSend'); + late final __objc_msgSend_53 = __objc_msgSend_53Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + int _objc_msgSend_54( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_54( + obj, + sel, + ); + } + + late final __objc_msgSend_54Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.Short Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_55( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_55( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_55Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + pkg_ffi.Short)>>('objc_msgSend'); + late final __objc_msgSend_55 = __objc_msgSend_55Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + int _objc_msgSend_56( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_56( + obj, + sel, + ); + } + + late final __objc_msgSend_56Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedShort Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_56 = __objc_msgSend_56Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_57( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_57( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_57Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + pkg_ffi.UnsignedShort)>>('objc_msgSend'); + late final __objc_msgSend_57 = __objc_msgSend_57Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + int _objc_msgSend_58( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_58( + obj, + sel, + ); + } + + late final __objc_msgSend_58Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_58 = __objc_msgSend_58Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_59( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_59( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_59Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + pkg_ffi.Int)>>('objc_msgSend'); + late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + int _objc_msgSend_60( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_60( + obj, + sel, + ); + } + + late final __objc_msgSend_60Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedInt Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_61( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_61( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_61Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + pkg_ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_61 = __objc_msgSend_61Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + int _objc_msgSend_62( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_62( + obj, + sel, + ); + } + + late final __objc_msgSend_62Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.Long Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_63( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_63( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_63Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + pkg_ffi.Long)>>('objc_msgSend'); + late final __objc_msgSend_63 = __objc_msgSend_63Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + int _objc_msgSend_64( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_64( + obj, + sel, + ); + } + + late final __objc_msgSend_64Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedLong Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_64 = __objc_msgSend_64Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_65( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_65( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_65Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + pkg_ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_65 = __objc_msgSend_65Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + int _objc_msgSend_66( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_66( + obj, + sel, + ); + } + + late final __objc_msgSend_66Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.LongLong Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_66 = __objc_msgSend_66Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_67( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_67( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_67Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + pkg_ffi.LongLong)>>('objc_msgSend'); + late final __objc_msgSend_67 = __objc_msgSend_67Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + int _objc_msgSend_68( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_68( + obj, + sel, + ); + } + + late final __objc_msgSend_68Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedLongLong Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_68 = __objc_msgSend_68Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_69( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_69( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_69Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + pkg_ffi.UnsignedLongLong)>>('objc_msgSend'); + late final __objc_msgSend_69 = __objc_msgSend_69Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + double _objc_msgSend_70( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_70( + obj, + sel, + ); + } + + late final __objc_msgSend_70Ptr = _lookup< + ffi.NativeFunction< + ffi.Float Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_70 = __objc_msgSend_70Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_71( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_71( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_71Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Float)>>('objc_msgSend'); + late final __objc_msgSend_71 = __objc_msgSend_71Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double)>(); + + double _objc_msgSend_72( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_72( + obj, + sel, + ); + } + + late final __objc_msgSend_72Ptr = _lookup< + ffi.NativeFunction< + ffi.Double Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_72 = __objc_msgSend_72Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_73( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_73( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_73Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_73 = __objc_msgSend_73Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double)>(); + + void _objc_msgSend_74( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_74( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_74Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + BOOL)>>('objc_msgSend'); + late final __objc_msgSend_74 = __objc_msgSend_74Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + int _objc_msgSend_75( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_75( + obj, + sel, + ); + } + + late final __objc_msgSend_75Ptr = _lookup< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_75 = __objc_msgSend_75Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_76( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_76( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_76Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_76 = __objc_msgSend_76Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_77( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_77( + obj, + sel, + ); + } + + late final __objc_msgSend_77Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_77 = __objc_msgSend_77Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_78( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_78( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_78Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_78 = __objc_msgSend_78Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_79( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherNumber, + ) { + return __objc_msgSend_79( + obj, + sel, + otherNumber, + ); + } + + late final __objc_msgSend_79Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_79 = __objc_msgSend_79Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_80( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer number, + ) { + return __objc_msgSend_80( + obj, + sel, + number, + ); + } + + late final __objc_msgSend_80Ptr = _lookup< + ffi.NativeFunction< + BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_81( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer locale, + ) { + return __objc_msgSend_81( + obj, + sel, + locale, + ); + } + + late final __objc_msgSend_81Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_81 = __objc_msgSend_81Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + NSRange NSUnionRange( + NSRange range1, + NSRange range2, + ) { + return _NSUnionRange( + range1, + range2, + ); + } + + late final _NSUnionRangePtr = + _lookup>( + 'NSUnionRange'); + late final _NSUnionRange = + _NSUnionRangePtr.asFunction(); + + NSRange NSIntersectionRange( + NSRange range1, + NSRange range2, + ) { + return _NSIntersectionRange( + range1, + range2, + ); + } + + late final _NSIntersectionRangePtr = + _lookup>( + 'NSIntersectionRange'); + late final _NSIntersectionRange = + _NSIntersectionRangePtr.asFunction(); + + ffi.Pointer NSStringFromRange( + NSRange range, + ) { + return _NSStringFromRange( + range, + ); + } + + late final _NSStringFromRangePtr = + _lookup Function(NSRange)>>( + 'NSStringFromRange'); + late final _NSStringFromRange = _NSStringFromRangePtr.asFunction< + ffi.Pointer Function(NSRange)>(); + + NSRange NSRangeFromString( + ffi.Pointer aString, + ) { + return _NSRangeFromString( + aString, + ); + } + + late final _NSRangeFromStringPtr = + _lookup)>>( + 'NSRangeFromString'); + late final _NSRangeFromString = _NSRangeFromStringPtr.asFunction< + NSRange Function(ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_82( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_82( + obj, + sel, + ); + } + + late final __objc_msgSend_82Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_82 = __objc_msgSend_82Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_83( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_83( + obj, + sel, + ); + } + + late final __objc_msgSend_83Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_83 = __objc_msgSend_83Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_84( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_84( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_84Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_84 = __objc_msgSend_84Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_85( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_85( + obj, + sel, + ); + } + + late final __objc_msgSend_85Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_85 = __objc_msgSend_85Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_86( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_86( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_86Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_86 = __objc_msgSend_86Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_87( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_87( + obj, + sel, + ); + } + + late final __objc_msgSend_87Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_87 = __objc_msgSend_87Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + instancetype _objc_msgSend_88( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + int type, + int index, + ) { + return __objc_msgSend_88( + obj, + sel, + anObject, + type, + index, + ); + } + + late final __objc_msgSend_88Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_88 = __objc_msgSend_88Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int)>(); + + instancetype _objc_msgSend_89( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + int type, + int index, + int associatedIndex, + ) { + return __objc_msgSend_89( + obj, + sel, + anObject, + type, + index, + associatedIndex, + ); + } + + late final __objc_msgSend_89Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSUInteger, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_89 = __objc_msgSend_89Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, int)>(); + + instancetype _objc_msgSend_90( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_90( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_90Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_90 = __objc_msgSend_90Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int)>(); + + instancetype _objc_msgSend_91( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_91( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_91Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_91 = __objc_msgSend_91Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + instancetype _objc_msgSend_92( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexSet, + ) { + return __objc_msgSend_92( + obj, + sel, + indexSet, + ); + } + + late final __objc_msgSend_92Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_92 = __objc_msgSend_92Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_93( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexSet, + ) { + return __objc_msgSend_93( + obj, + sel, + indexSet, + ); + } + + late final __objc_msgSend_93Ptr = _lookup< + ffi.NativeFunction< + BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_93 = __objc_msgSend_93Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_94( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_94( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_94Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_94 = __objc_msgSend_94Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + int _objc_msgSend_95( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexBuffer, + int bufferSize, + NSRangePointer range, + ) { + return __objc_msgSend_95( + obj, + sel, + indexBuffer, + bufferSize, + range, + ); + } + + late final __objc_msgSend_95Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSRangePointer)>>('objc_msgSend'); + late final __objc_msgSend_95 = __objc_msgSend_95Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRangePointer)>(); + + int _objc_msgSend_96( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_96( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_96Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_96 = __objc_msgSend_96Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + + int _objc_msgSend_97( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_97( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_97Ptr = _lookup< + ffi.NativeFunction< + BOOL Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_97 = __objc_msgSend_97Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + int _objc_msgSend_98( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_98( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_98Ptr = _lookup< + ffi.NativeFunction< + BOOL Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_98 = __objc_msgSend_98Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + + int _objc_msgSend_99( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexSet, + ) { + return __objc_msgSend_99( + obj, + sel, + indexSet, + ); + } + + late final __objc_msgSend_99Ptr = _lookup< + ffi.NativeFunction< + BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_99 = __objc_msgSend_99Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_100( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer block, + ) { + return __objc_msgSend_100( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_100Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_100 = __objc_msgSend_100Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_101( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer block, + ) { + return __objc_msgSend_101( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_101Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_101 = __objc_msgSend_101Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + void _objc_msgSend_102( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer block, + ) { + return __objc_msgSend_102( + obj, + sel, + range, + opts, + block, + ); + } + + late final __objc_msgSend_102Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_102 = __objc_msgSend_102Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer)>(); + + int _objc_msgSend_103( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicate, + ) { + return __objc_msgSend_103( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_103Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_103 = __objc_msgSend_103Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_104( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer predicate, + ) { + return __objc_msgSend_104( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_104Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_104 = __objc_msgSend_104Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + int _objc_msgSend_105( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer predicate, + ) { + return __objc_msgSend_105( + obj, + sel, + range, + opts, + predicate, + ); + } + + late final __objc_msgSend_105Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_105 = __objc_msgSend_105Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_106( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicate, + ) { + return __objc_msgSend_106( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_106Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_106 = __objc_msgSend_106Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_107( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer predicate, + ) { + return __objc_msgSend_107( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_107Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_107 = __objc_msgSend_107Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_108( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer predicate, + ) { + return __objc_msgSend_108( + obj, + sel, + range, + opts, + predicate, + ); + } + + late final __objc_msgSend_108Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_108 = __objc_msgSend_108Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, int, ffi.Pointer)>(); + + void _objc_msgSend_109( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer block, + ) { + return __objc_msgSend_109( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_109Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_109 = __objc_msgSend_109Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_110( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer block, + ) { + return __objc_msgSend_110( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_110Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_110 = __objc_msgSend_110Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + void _objc_msgSend_111( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer block, + ) { + return __objc_msgSend_111( + obj, + sel, + range, + opts, + block, + ); + } + + late final __objc_msgSend_111Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_111 = __objc_msgSend_111Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer)>(); + + void _objc_msgSend_112( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexSet, + ) { + return __objc_msgSend_112( + obj, + sel, + indexSet, + ); + } + + late final __objc_msgSend_112Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_112 = __objc_msgSend_112Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_113( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexSet, + ) { + return __objc_msgSend_113( + obj, + sel, + indexSet, + ); + } + + late final __objc_msgSend_113Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_113 = __objc_msgSend_113Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_114( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_114( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_114Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_114 = __objc_msgSend_114Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + + void _objc_msgSend_115( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + int delta, + ) { + return __objc_msgSend_115( + obj, + sel, + index, + delta, + ); + } + + late final __objc_msgSend_115Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger, NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_115 = __objc_msgSend_115Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, int)>(); + + instancetype _objc_msgSend_116( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer changes, + ) { + return __objc_msgSend_116( + obj, + sel, + changes, + ); + } + + late final __objc_msgSend_116Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_116 = __objc_msgSend_116Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + instancetype _objc_msgSend_117( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer inserts, + ffi.Pointer insertedObjects, + ffi.Pointer removes, + ffi.Pointer removedObjects, + ffi.Pointer changes, + ) { + return __objc_msgSend_117( + obj, + sel, + inserts, + insertedObjects, + removes, + removedObjects, + changes, + ); + } + + late final __objc_msgSend_117Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_117 = __objc_msgSend_117Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + instancetype _objc_msgSend_118( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer inserts, + ffi.Pointer insertedObjects, + ffi.Pointer removes, + ffi.Pointer removedObjects, + ) { + return __objc_msgSend_118( + obj, + sel, + inserts, + insertedObjects, + removes, + removedObjects, + ); + } + + late final __objc_msgSend_118Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_118 = __objc_msgSend_118Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_119( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_119( + obj, + sel, + ); + } + + late final __objc_msgSend_119Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_119 = __objc_msgSend_119Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_120( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_120( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_120Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_120 = __objc_msgSend_120Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_121( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_121( + obj, + sel, + ); + } + + late final __objc_msgSend_121Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_121 = __objc_msgSend_121Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_122( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_122( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_122Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_122 = __objc_msgSend_122Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_123( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_123( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_123Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_123 = __objc_msgSend_123Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + instancetype _objc_msgSend_124( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + int cnt, + ) { + return __objc_msgSend_124( + obj, + sel, + objects, + cnt, + ); + } + + late final __objc_msgSend_124Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_124 = __objc_msgSend_124Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, int)>(); + + instancetype _objc_msgSend_125( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_125( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_125Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_125 = __objc_msgSend_125Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_126( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ) { + return __objc_msgSend_126( + obj, + sel, + anObject, + ); + } + + late final __objc_msgSend_126Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_126 = __objc_msgSend_126Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_127( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + int index, + ) { + return __objc_msgSend_127( + obj, + sel, + anObject, + index, + ); + } + + late final __objc_msgSend_127Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_127 = __objc_msgSend_127Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + void _objc_msgSend_128( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer anObject, + ) { + return __objc_msgSend_128( + obj, + sel, + index, + anObject, + ); + } + + late final __objc_msgSend_128Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_128 = __objc_msgSend_128Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + instancetype _objc_msgSend_129( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_129( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_129Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_129 = __objc_msgSend_129Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_130( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + int visibility, + ffi.Pointer loadHandler, + ) { + return __objc_msgSend_130( + obj, + sel, + typeIdentifier, + visibility, + loadHandler, + ); + } + + late final __objc_msgSend_130Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_130 = __objc_msgSend_130Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + void _objc_msgSend_131( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + int fileOptions, + int visibility, + ffi.Pointer loadHandler, + ) { + return __objc_msgSend_131( + obj, + sel, + typeIdentifier, + fileOptions, + visibility, + loadHandler, + ); + } + + late final __objc_msgSend_131Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_131 = __objc_msgSend_131Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_132( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_132( + obj, + sel, + ); + } + + late final __objc_msgSend_132Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_132 = __objc_msgSend_132Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_133( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_133( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_133Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_133 = __objc_msgSend_133Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_134( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ) { + return __objc_msgSend_134( + obj, + sel, + typeIdentifier, + ); + } + + late final __objc_msgSend_134Ptr = _lookup< + ffi.NativeFunction< + BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_134 = __objc_msgSend_134Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_135( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + int fileOptions, + ) { + return __objc_msgSend_135( + obj, + sel, + typeIdentifier, + fileOptions, + ); + } + + late final __objc_msgSend_135Ptr = _lookup< + ffi.NativeFunction< + BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_135 = __objc_msgSend_135Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_136( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer completionHandler, + ) { + return __objc_msgSend_136( + obj, + sel, + typeIdentifier, + completionHandler, + ); + } + + late final __objc_msgSend_136Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_136 = __objc_msgSend_136Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_137( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer completionHandler, + ) { + return __objc_msgSend_137( + obj, + sel, + typeIdentifier, + completionHandler, + ); + } + + late final __objc_msgSend_137Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_137 = __objc_msgSend_137Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_138( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer completionHandler, + ) { + return __objc_msgSend_138( + obj, + sel, + typeIdentifier, + completionHandler, + ); + } + + late final __objc_msgSend_138Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_138 = __objc_msgSend_138Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_139( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_139( + obj, + sel, + ); + } + + late final __objc_msgSend_139Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_139 = __objc_msgSend_139Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_140( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_140( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_140Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_140 = __objc_msgSend_140Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + instancetype _objc_msgSend_141( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer object, + ) { + return __objc_msgSend_141( + obj, + sel, + object, + ); + } + + late final __objc_msgSend_141Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_141 = __objc_msgSend_141Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_142( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer object, + int visibility, + ) { + return __objc_msgSend_142( + obj, + sel, + object, + visibility, + ); + } + + late final __objc_msgSend_142Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_142 = __objc_msgSend_142Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + void _objc_msgSend_143( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + int visibility, + ffi.Pointer loadHandler, + ) { + return __objc_msgSend_143( + obj, + sel, + aClass, + visibility, + loadHandler, + ); + } + + late final __objc_msgSend_143Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_143 = __objc_msgSend_143Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + int _objc_msgSend_144( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ) { + return __objc_msgSend_144( + obj, + sel, + aClass, + ); + } + + late final __objc_msgSend_144Ptr = _lookup< + ffi.NativeFunction< + BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_144 = __objc_msgSend_144Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_145( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ffi.Pointer completionHandler, + ) { + return __objc_msgSend_145( + obj, + sel, + aClass, + completionHandler, + ); + } + + late final __objc_msgSend_145Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_145 = __objc_msgSend_145Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + instancetype _objc_msgSend_146( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer item, + ffi.Pointer typeIdentifier, + ) { + return __objc_msgSend_146( + obj, + sel, + item, + typeIdentifier, + ); + } + + late final __objc_msgSend_146Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_146 = __objc_msgSend_146Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + instancetype _objc_msgSend_147( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer fileURL, + ) { + return __objc_msgSend_147( + obj, + sel, + fileURL, + ); + } + + late final __objc_msgSend_147Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_147 = __objc_msgSend_147Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_148( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + NSItemProviderLoadHandler loadHandler, + ) { + return __objc_msgSend_148( + obj, + sel, + typeIdentifier, + loadHandler, + ); + } + + late final __objc_msgSend_148Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderLoadHandler)>>('objc_msgSend'); + late final __objc_msgSend_148 = __objc_msgSend_148Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSItemProviderLoadHandler)>(); + + void _objc_msgSend_149( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer options, + NSItemProviderCompletionHandler completionHandler, + ) { + return __objc_msgSend_149( + obj, + sel, + typeIdentifier, + options, + completionHandler, + ); + } + + late final __objc_msgSend_149Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler)>>('objc_msgSend'); + late final __objc_msgSend_149 = __objc_msgSend_149Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler)>(); + + late final ffi.Pointer> + _NSItemProviderPreferredImageSizeKey = + _lookup>('NSItemProviderPreferredImageSizeKey'); + + ffi.Pointer get NSItemProviderPreferredImageSizeKey => + _NSItemProviderPreferredImageSizeKey.value; + + set NSItemProviderPreferredImageSizeKey(ffi.Pointer value) => + _NSItemProviderPreferredImageSizeKey.value = value; + + late final ffi.Pointer> + _NSExtensionJavaScriptPreprocessingResultsKey = + _lookup>( + 'NSExtensionJavaScriptPreprocessingResultsKey'); + + ffi.Pointer get NSExtensionJavaScriptPreprocessingResultsKey => + _NSExtensionJavaScriptPreprocessingResultsKey.value; + + set NSExtensionJavaScriptPreprocessingResultsKey( + ffi.Pointer value) => + _NSExtensionJavaScriptPreprocessingResultsKey.value = value; + + late final ffi.Pointer> + _NSExtensionJavaScriptFinalizeArgumentKey = + _lookup>( + 'NSExtensionJavaScriptFinalizeArgumentKey'); + + ffi.Pointer get NSExtensionJavaScriptFinalizeArgumentKey => + _NSExtensionJavaScriptFinalizeArgumentKey.value; + + set NSExtensionJavaScriptFinalizeArgumentKey(ffi.Pointer value) => + _NSExtensionJavaScriptFinalizeArgumentKey.value = value; + + late final ffi.Pointer> _NSItemProviderErrorDomain = + _lookup>('NSItemProviderErrorDomain'); + + ffi.Pointer get NSItemProviderErrorDomain => + _NSItemProviderErrorDomain.value; + + set NSItemProviderErrorDomain(ffi.Pointer value) => + _NSItemProviderErrorDomain.value = value; + + late final ffi.Pointer _NSStringTransformLatinToKatakana = + _lookup('NSStringTransformLatinToKatakana'); + + NSStringTransform get NSStringTransformLatinToKatakana => + _NSStringTransformLatinToKatakana.value; + + set NSStringTransformLatinToKatakana(NSStringTransform value) => + _NSStringTransformLatinToKatakana.value = value; + + late final ffi.Pointer _NSStringTransformLatinToHiragana = + _lookup('NSStringTransformLatinToHiragana'); + + NSStringTransform get NSStringTransformLatinToHiragana => + _NSStringTransformLatinToHiragana.value; + + set NSStringTransformLatinToHiragana(NSStringTransform value) => + _NSStringTransformLatinToHiragana.value = value; + + late final ffi.Pointer _NSStringTransformLatinToHangul = + _lookup('NSStringTransformLatinToHangul'); + + NSStringTransform get NSStringTransformLatinToHangul => + _NSStringTransformLatinToHangul.value; + + set NSStringTransformLatinToHangul(NSStringTransform value) => + _NSStringTransformLatinToHangul.value = value; + + late final ffi.Pointer _NSStringTransformLatinToArabic = + _lookup('NSStringTransformLatinToArabic'); + + NSStringTransform get NSStringTransformLatinToArabic => + _NSStringTransformLatinToArabic.value; + + set NSStringTransformLatinToArabic(NSStringTransform value) => + _NSStringTransformLatinToArabic.value = value; + + late final ffi.Pointer _NSStringTransformLatinToHebrew = + _lookup('NSStringTransformLatinToHebrew'); + + NSStringTransform get NSStringTransformLatinToHebrew => + _NSStringTransformLatinToHebrew.value; + + set NSStringTransformLatinToHebrew(NSStringTransform value) => + _NSStringTransformLatinToHebrew.value = value; + + late final ffi.Pointer _NSStringTransformLatinToThai = + _lookup('NSStringTransformLatinToThai'); + + NSStringTransform get NSStringTransformLatinToThai => + _NSStringTransformLatinToThai.value; + + set NSStringTransformLatinToThai(NSStringTransform value) => + _NSStringTransformLatinToThai.value = value; + + late final ffi.Pointer _NSStringTransformLatinToCyrillic = + _lookup('NSStringTransformLatinToCyrillic'); + + NSStringTransform get NSStringTransformLatinToCyrillic => + _NSStringTransformLatinToCyrillic.value; + + set NSStringTransformLatinToCyrillic(NSStringTransform value) => + _NSStringTransformLatinToCyrillic.value = value; + + late final ffi.Pointer _NSStringTransformLatinToGreek = + _lookup('NSStringTransformLatinToGreek'); + + NSStringTransform get NSStringTransformLatinToGreek => + _NSStringTransformLatinToGreek.value; + + set NSStringTransformLatinToGreek(NSStringTransform value) => + _NSStringTransformLatinToGreek.value = value; + + late final ffi.Pointer _NSStringTransformToLatin = + _lookup('NSStringTransformToLatin'); + + NSStringTransform get NSStringTransformToLatin => + _NSStringTransformToLatin.value; + + set NSStringTransformToLatin(NSStringTransform value) => + _NSStringTransformToLatin.value = value; + + late final ffi.Pointer _NSStringTransformMandarinToLatin = + _lookup('NSStringTransformMandarinToLatin'); + + NSStringTransform get NSStringTransformMandarinToLatin => + _NSStringTransformMandarinToLatin.value; + + set NSStringTransformMandarinToLatin(NSStringTransform value) => + _NSStringTransformMandarinToLatin.value = value; + + late final ffi.Pointer + _NSStringTransformHiraganaToKatakana = + _lookup('NSStringTransformHiraganaToKatakana'); + + NSStringTransform get NSStringTransformHiraganaToKatakana => + _NSStringTransformHiraganaToKatakana.value; + + set NSStringTransformHiraganaToKatakana(NSStringTransform value) => + _NSStringTransformHiraganaToKatakana.value = value; + + late final ffi.Pointer + _NSStringTransformFullwidthToHalfwidth = + _lookup('NSStringTransformFullwidthToHalfwidth'); + + NSStringTransform get NSStringTransformFullwidthToHalfwidth => + _NSStringTransformFullwidthToHalfwidth.value; + + set NSStringTransformFullwidthToHalfwidth(NSStringTransform value) => + _NSStringTransformFullwidthToHalfwidth.value = value; + + late final ffi.Pointer _NSStringTransformToXMLHex = + _lookup('NSStringTransformToXMLHex'); + + NSStringTransform get NSStringTransformToXMLHex => + _NSStringTransformToXMLHex.value; + + set NSStringTransformToXMLHex(NSStringTransform value) => + _NSStringTransformToXMLHex.value = value; + + late final ffi.Pointer _NSStringTransformToUnicodeName = + _lookup('NSStringTransformToUnicodeName'); + + NSStringTransform get NSStringTransformToUnicodeName => + _NSStringTransformToUnicodeName.value; + + set NSStringTransformToUnicodeName(NSStringTransform value) => + _NSStringTransformToUnicodeName.value = value; + + late final ffi.Pointer + _NSStringTransformStripCombiningMarks = + _lookup('NSStringTransformStripCombiningMarks'); + + NSStringTransform get NSStringTransformStripCombiningMarks => + _NSStringTransformStripCombiningMarks.value; + + set NSStringTransformStripCombiningMarks(NSStringTransform value) => + _NSStringTransformStripCombiningMarks.value = value; + + late final ffi.Pointer _NSStringTransformStripDiacritics = + _lookup('NSStringTransformStripDiacritics'); + + NSStringTransform get NSStringTransformStripDiacritics => + _NSStringTransformStripDiacritics.value; + + set NSStringTransformStripDiacritics(NSStringTransform value) => + _NSStringTransformStripDiacritics.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionSuggestedEncodingsKey = + _lookup( + 'NSStringEncodingDetectionSuggestedEncodingsKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionSuggestedEncodingsKey => + _NSStringEncodingDetectionSuggestedEncodingsKey.value; + + set NSStringEncodingDetectionSuggestedEncodingsKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionSuggestedEncodingsKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionDisallowedEncodingsKey = + _lookup( + 'NSStringEncodingDetectionDisallowedEncodingsKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionDisallowedEncodingsKey => + _NSStringEncodingDetectionDisallowedEncodingsKey.value; + + set NSStringEncodingDetectionDisallowedEncodingsKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionDisallowedEncodingsKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey = + _lookup( + 'NSStringEncodingDetectionUseOnlySuggestedEncodingsKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionUseOnlySuggestedEncodingsKey => + _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value; + + set NSStringEncodingDetectionUseOnlySuggestedEncodingsKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionAllowLossyKey = + _lookup( + 'NSStringEncodingDetectionAllowLossyKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionAllowLossyKey => + _NSStringEncodingDetectionAllowLossyKey.value; + + set NSStringEncodingDetectionAllowLossyKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionAllowLossyKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionFromWindowsKey = + _lookup( + 'NSStringEncodingDetectionFromWindowsKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionFromWindowsKey => + _NSStringEncodingDetectionFromWindowsKey.value; + + set NSStringEncodingDetectionFromWindowsKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionFromWindowsKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionLossySubstitutionKey = + _lookup( + 'NSStringEncodingDetectionLossySubstitutionKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionLossySubstitutionKey => + _NSStringEncodingDetectionLossySubstitutionKey.value; + + set NSStringEncodingDetectionLossySubstitutionKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionLossySubstitutionKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionLikelyLanguageKey = + _lookup( + 'NSStringEncodingDetectionLikelyLanguageKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionLikelyLanguageKey => + _NSStringEncodingDetectionLikelyLanguageKey.value; + + set NSStringEncodingDetectionLikelyLanguageKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionLikelyLanguageKey.value = value; + + void _objc_msgSend_150( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer aString, + ) { + return __objc_msgSend_150( + obj, + sel, + range, + aString, + ); + } + + late final __objc_msgSend_150Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_150 = __objc_msgSend_150Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, + ffi.Pointer)>(); + + late final ffi.Pointer _NSCharacterConversionException = + _lookup('NSCharacterConversionException'); + + NSExceptionName get NSCharacterConversionException => + _NSCharacterConversionException.value; + + set NSCharacterConversionException(NSExceptionName value) => + _NSCharacterConversionException.value = value; + + late final ffi.Pointer _NSParseErrorException = + _lookup('NSParseErrorException'); + + NSExceptionName get NSParseErrorException => _NSParseErrorException.value; + + set NSParseErrorException(NSExceptionName value) => + _NSParseErrorException.value = value; + + int _objc_msgSend_151( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_151( + obj, + sel, + ); + } + + late final __objc_msgSend_151Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_151 = __objc_msgSend_151Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_152( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_152( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_152Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_152 = __objc_msgSend_152Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_153( + ffi.Pointer obj, + ffi.Pointer sel, + double x, + ) { + return __objc_msgSend_153( + obj, + sel, + x, + ); + } + + late final __objc_msgSend_153Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_153 = __objc_msgSend_153Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); + + int _objc_msgSend_154( + ffi.Pointer obj, + ffi.Pointer sel, + int useIntVals, + ffi.Pointer other, + ) { + return __objc_msgSend_154( + obj, + sel, + useIntVals, + other, + ); + } + + late final __objc_msgSend_154Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + BOOL, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_154 = __objc_msgSend_154Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_155( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer a, + ffi.Pointer b, + ) { + return __objc_msgSend_155( + obj, + sel, + a, + b, + ); + } + + late final __objc_msgSend_155Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_155 = __objc_msgSend_155Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +} + +class ObjCObject extends ffi.Opaque {} + +class ObjCSel extends ffi.Opaque {} + +typedef NSUInteger = pkg_ffi.UnsignedLong; + +class __va_list_tag extends ffi.Struct { + @pkg_ffi.UnsignedInt() + external int gp_offset; + + @pkg_ffi.UnsignedInt() + external int fp_offset; + + external ffi.Pointer overflow_arg_area; + + external ffi.Pointer reg_save_area; +} + +abstract class NSComparisonResult { + static const int NSOrderedAscending = -1; + static const int NSOrderedSame = 0; + static const int NSOrderedDescending = 1; +} + +abstract class NSEnumerationOptions { + static const int NSEnumerationConcurrent = 1; + static const int NSEnumerationReverse = 2; +} + +abstract class NSSortOptions { + static const int NSSortConcurrent = 1; + static const int NSSortStable = 16; +} + +abstract class NSQualityOfService { + static const int NSQualityOfServiceUserInteractive = 33; + static const int NSQualityOfServiceUserInitiated = 25; + static const int NSQualityOfServiceUtility = 17; + static const int NSQualityOfServiceBackground = 9; + static const int NSQualityOfServiceDefault = -1; +} + +typedef NSInteger = pkg_ffi.Long; + +class __CFString extends ffi.Opaque {} + +abstract class CFComparisonResult { + static const int kCFCompareLessThan = -1; + static const int kCFCompareEqualTo = 0; + static const int kCFCompareGreaterThan = 1; +} + +typedef CFIndex = pkg_ffi.Long; + +class CFRange extends ffi.Struct { + @CFIndex() + external int location; + + @CFIndex() + external int length; +} + +class __CFNull extends ffi.Opaque {} + +typedef CFTypeID = pkg_ffi.UnsignedLong; +typedef CFNullRef = ffi.Pointer<__CFNull>; + +class __CFAllocator extends ffi.Opaque {} + +typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; + +class CFAllocatorContext extends ffi.Struct { + @CFIndex() + external int version; + + external ffi.Pointer info; + + external CFAllocatorRetainCallBack retain; + + external CFAllocatorReleaseCallBack release; + + external CFAllocatorCopyDescriptionCallBack copyDescription; + + external CFAllocatorAllocateCallBack allocate; + + external CFAllocatorReallocateCallBack reallocate; + + external CFAllocatorDeallocateCallBack deallocate; + + external CFAllocatorPreferredSizeCallBack preferredSize; +} + +typedef CFAllocatorRetainCallBack = ffi.Pointer< + ffi.NativeFunction Function(ffi.Pointer)>>; +typedef CFAllocatorReleaseCallBack + = ffi.Pointer)>>; +typedef CFAllocatorCopyDescriptionCallBack = ffi + .Pointer)>>; +typedef CFStringRef = ffi.Pointer<__CFString>; +typedef CFAllocatorAllocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + CFIndex, CFOptionFlags, ffi.Pointer)>>; +typedef CFOptionFlags = pkg_ffi.UnsignedLong; +typedef CFAllocatorReallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, CFIndex, + CFOptionFlags, ffi.Pointer)>>; +typedef CFAllocatorDeallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; +typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< + ffi.NativeFunction< + CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; +typedef CFTypeRef = ffi.Pointer; +typedef Boolean = pkg_ffi.UnsignedChar; +typedef CFHashCode = pkg_ffi.UnsignedLong; +typedef NSZone = _NSZone; + +class _NSZone extends ffi.Opaque {} + +typedef BOOL = pkg_ffi.SignedChar; + +ffi.Pointer _registerName(NativeObjCLibrary _lib, String name) { + final cstr = name.toNativeUtf8(); + final sel = _lib._sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; +} + +ffi.Pointer _getClass(NativeObjCLibrary _lib, String name) { + final cstr = name.toNativeUtf8(); + final clazz = _lib._objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; +} + +class _ObjCWrapper { + final ffi.Pointer _id; + final NativeObjCLibrary _lib; + _ObjCWrapper._(this._id, this._lib); +} + +class NSValue extends NSObject { + NSValue._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSValue castFrom(T other) { + return NSValue._(other._id, other._lib); + } + + static ffi.Pointer? _sel_getValue; + void getValue(ffi.Pointer value, int size) { + _sel_getValue ??= _registerName(_lib, "getValue:size:"); + return _lib._objc_msgSend_29(_id, _sel_getValue!, value, size); + } + + static ffi.Pointer? _sel_objCType; + ffi.Pointer get objCType { + _sel_objCType ??= _registerName(_lib, "objCType"); + return _lib._objc_msgSend_30(_id, _sel_objCType!); + } + + static ffi.Pointer? _sel_objCType1; + set objCType(ffi.Pointer value) { + _sel_objCType1 ??= _registerName(_lib, "setObjCType:"); + return _lib._objc_msgSend_31(_id, _sel_objCType1!, value); + } + + static ffi.Pointer? _sel_initWithBytes; + NSValue initWithBytes( + ffi.Pointer value, ffi.Pointer type) { + _sel_initWithBytes ??= _registerName(_lib, "initWithBytes:objCType:"); + final _ret = _lib._objc_msgSend_32(_id, _sel_initWithBytes!, value, type); + return NSValue._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithCoder; + NSValue initWithCoder(NSObject coder) { + _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); + final _ret = _lib._objc_msgSend_33(_id, _sel_initWithCoder!, coder._id); + return NSValue._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSValue new1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSValue"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSValue._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSValue alloc(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSValue"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSValue._(_ret, _lib); + } +} + +class NSObject extends _ObjCWrapper { + NSObject._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSObject castFrom(T other) { + return NSObject._(other._id, other._lib); + } + + static ffi.Pointer? _sel_load; + static void load(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_load ??= _registerName(_lib, "load"); + return _lib._objc_msgSend_0(_class!, _sel_load!); + } + + static ffi.Pointer? _sel_initialize; + static void initialize(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_initialize ??= _registerName(_lib, "initialize"); + return _lib._objc_msgSend_0(_class!, _sel_initialize!); + } + + static ffi.Pointer? _sel_init; + NSObject init() { + _sel_init ??= _registerName(_lib, "init"); + final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSObject new1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_allocWithZone; + static NSObject allocWithZone( + NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_allocWithZone ??= _registerName(_lib, "allocWithZone:"); + final _ret = _lib._objc_msgSend_2(_class!, _sel_allocWithZone!, zone); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSObject alloc(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_dealloc; + void dealloc() { + _sel_dealloc ??= _registerName(_lib, "dealloc"); + return _lib._objc_msgSend_0(_id, _sel_dealloc!); + } + + static ffi.Pointer? _sel_finalize; + void finalize() { + _sel_finalize ??= _registerName(_lib, "finalize"); + return _lib._objc_msgSend_0(_id, _sel_finalize!); + } + + static ffi.Pointer? _sel_copy; + NSObject copy() { + _sel_copy ??= _registerName(_lib, "copy"); + final _ret = _lib._objc_msgSend_3(_id, _sel_copy!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_mutableCopy; + NSObject mutableCopy() { + _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); + final _ret = _lib._objc_msgSend_4(_id, _sel_mutableCopy!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_copyWithZone; + static NSObject copyWithZone( + NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); + final _ret = _lib._objc_msgSend_5(_class!, _sel_copyWithZone!, zone); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_mutableCopyWithZone; + static NSObject mutableCopyWithZone( + NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); + final _ret = _lib._objc_msgSend_6(_class!, _sel_mutableCopyWithZone!, zone); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_instancesRespondToSelector; + static int instancesRespondToSelector( + NativeObjCLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instancesRespondToSelector ??= + _registerName(_lib, "instancesRespondToSelector:"); + return _lib._objc_msgSend_7( + _class!, _sel_instancesRespondToSelector!, aSelector); + } + + static ffi.Pointer? _sel_conformsToProtocol; + static int conformsToProtocol(NativeObjCLibrary _lib, NSObject protocol) { + _class ??= _getClass(_lib, "NSObject"); + _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); + return _lib._objc_msgSend_8( + _class!, _sel_conformsToProtocol!, protocol._id); + } + + static ffi.Pointer? _sel_methodForSelector; + IMP methodForSelector(ffi.Pointer aSelector) { + _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); + return _lib._objc_msgSend_9(_id, _sel_methodForSelector!, aSelector); + } + + static ffi.Pointer? _sel_instanceMethodForSelector; + static IMP instanceMethodForSelector( + NativeObjCLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instanceMethodForSelector ??= + _registerName(_lib, "instanceMethodForSelector:"); + return _lib._objc_msgSend_10( + _class!, _sel_instanceMethodForSelector!, aSelector); + } + + static ffi.Pointer? _sel_doesNotRecognizeSelector; + void doesNotRecognizeSelector(ffi.Pointer aSelector) { + _sel_doesNotRecognizeSelector ??= + _registerName(_lib, "doesNotRecognizeSelector:"); + return _lib._objc_msgSend_11( + _id, _sel_doesNotRecognizeSelector!, aSelector); + } + + static ffi.Pointer? _sel_forwardingTargetForSelector; + NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + _sel_forwardingTargetForSelector ??= + _registerName(_lib, "forwardingTargetForSelector:"); + final _ret = _lib._objc_msgSend_12( + _id, _sel_forwardingTargetForSelector!, aSelector); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_forwardInvocation; + void forwardInvocation(NSObject anInvocation) { + _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); + return _lib._objc_msgSend_13( + _id, _sel_forwardInvocation!, anInvocation._id); + } + + static ffi.Pointer? _sel_methodSignatureForSelector; + NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + _sel_methodSignatureForSelector ??= + _registerName(_lib, "methodSignatureForSelector:"); + final _ret = + _lib._objc_msgSend_14(_id, _sel_methodSignatureForSelector!, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static ffi.Pointer? _sel_instanceMethodSignatureForSelector; + static NSMethodSignature instanceMethodSignatureForSelector( + NativeObjCLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instanceMethodSignatureForSelector ??= + _registerName(_lib, "instanceMethodSignatureForSelector:"); + final _ret = _lib._objc_msgSend_15( + _class!, _sel_instanceMethodSignatureForSelector!, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static ffi.Pointer? _sel_allowsWeakReference; + int allowsWeakReference() { + _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); + return _lib._objc_msgSend_16(_id, _sel_allowsWeakReference!); + } + + static ffi.Pointer? _sel_retainWeakReference; + int retainWeakReference() { + _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); + return _lib._objc_msgSend_16(_id, _sel_retainWeakReference!); + } + + static ffi.Pointer? _sel_isSubclassOfClass; + static int isSubclassOfClass(NativeObjCLibrary _lib, NSObject aClass) { + _class ??= _getClass(_lib, "NSObject"); + _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); + return _lib._objc_msgSend_17(_class!, _sel_isSubclassOfClass!, aClass._id); + } + + static ffi.Pointer? _sel_resolveClassMethod; + static int resolveClassMethod( + NativeObjCLibrary _lib, ffi.Pointer sel) { + _class ??= _getClass(_lib, "NSObject"); + _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); + return _lib._objc_msgSend_18(_class!, _sel_resolveClassMethod!, sel); + } + + static ffi.Pointer? _sel_resolveInstanceMethod; + static int resolveInstanceMethod( + NativeObjCLibrary _lib, ffi.Pointer sel) { + _class ??= _getClass(_lib, "NSObject"); + _sel_resolveInstanceMethod ??= + _registerName(_lib, "resolveInstanceMethod:"); + return _lib._objc_msgSend_19(_class!, _sel_resolveInstanceMethod!, sel); + } + + static ffi.Pointer? _sel_hash; + static int hash(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_hash ??= _registerName(_lib, "hash"); + return _lib._objc_msgSend_20(_class!, _sel_hash!); + } + + static ffi.Pointer? _sel_superclass; + static NSObject superclass(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_superclass ??= _registerName(_lib, "superclass"); + final _ret = _lib._objc_msgSend_21(_class!, _sel_superclass!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_class1; + static NSObject class1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_class1 ??= _registerName(_lib, "class"); + final _ret = _lib._objc_msgSend_22(_class!, _sel_class1!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_description; + static NSString description(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_description ??= _registerName(_lib, "description"); + final _ret = _lib._objc_msgSend_28(_class!, _sel_description!); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_debugDescription; + static NSString debugDescription(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_debugDescription ??= _registerName(_lib, "debugDescription"); + final _ret = _lib._objc_msgSend_28(_class!, _sel_debugDescription!); + return NSString._(_ret, _lib); + } +} + +typedef instancetype = ffi.Pointer; +typedef IMP = ffi.Pointer>; + +class NSMethodSignature extends _ObjCWrapper { + NSMethodSignature._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSMethodSignature castFrom(T other) { + return NSMethodSignature._(other._id, other._lib); + } +} + +class NSString extends NSObject { + NSString._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSString castFrom(T other) { + return NSString._(other._id, other._lib); + } + + factory NSString(NativeObjCLibrary _lib, String str) { + final cstr = str.toNativeUtf8(); + final nsstr = stringWithCString(_lib, cstr.cast(), 4 /* UTF8 */); + pkg_ffi.calloc.free(cstr); + return nsstr; + } + + @override + String toString() => UTF8String().cast().toDartString(); + + static ffi.Pointer? _sel_length; + int get length { + _sel_length ??= _registerName(_lib, "length"); + return _lib._objc_msgSend_20(_id, _sel_length!); + } + + static ffi.Pointer? _sel_length1; + set length(int value) { + _sel_length1 ??= _registerName(_lib, "setLength:"); + return _lib._objc_msgSend_23(_id, _sel_length1!, value); + } + + static ffi.Pointer? _sel_characterAtIndex; + int characterAtIndex(int index) { + _sel_characterAtIndex ??= _registerName(_lib, "characterAtIndex:"); + return _lib._objc_msgSend_24(_id, _sel_characterAtIndex!, index); + } + + static ffi.Pointer? _sel_init; + @override + NSString init() { + _sel_init ??= _registerName(_lib, "init"); + final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithCoder; + NSString initWithCoder(NSObject coder) { + _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); + final _ret = _lib._objc_msgSend_25(_id, _sel_initWithCoder!, coder._id); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_stringWithCString; + static NSString stringWithCString( + NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { + _class ??= _getClass(_lib, "NSString"); + _sel_stringWithCString ??= + _registerName(_lib, "stringWithCString:encoding:"); + final _ret = + _lib._objc_msgSend_26(_class!, _sel_stringWithCString!, cString, enc); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_UTF8String; + ffi.Pointer UTF8String() { + _sel_UTF8String ??= _registerName(_lib, "UTF8String"); + return _lib._objc_msgSend_27(_id, _sel_UTF8String!); + } + + static ffi.Pointer? _sel_new1; + static NSString new1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSString"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSString alloc(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSString"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSString._(_ret, _lib); + } +} + +extension StringToNSString on String { + NSString toNSString(NativeObjCLibrary lib) => NSString(lib, this); +} + +typedef unichar = pkg_ffi.UnsignedShort; + +class NSNumber extends NSValue { + NSNumber._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSNumber castFrom(T other) { + return NSNumber._(other._id, other._lib); + } + + static ffi.Pointer? _sel_initWithCoder; + @override + NSNumber initWithCoder(NSObject coder) { + _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); + final _ret = _lib._objc_msgSend_34(_id, _sel_initWithCoder!, coder._id); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithChar; + NSNumber initWithChar(int value) { + _sel_initWithChar ??= _registerName(_lib, "initWithChar:"); + final _ret = _lib._objc_msgSend_35(_id, _sel_initWithChar!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithUnsignedChar; + NSNumber initWithUnsignedChar(int value) { + _sel_initWithUnsignedChar ??= _registerName(_lib, "initWithUnsignedChar:"); + final _ret = _lib._objc_msgSend_36(_id, _sel_initWithUnsignedChar!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithShort; + NSNumber initWithShort(int value) { + _sel_initWithShort ??= _registerName(_lib, "initWithShort:"); + final _ret = _lib._objc_msgSend_37(_id, _sel_initWithShort!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithUnsignedShort; + NSNumber initWithUnsignedShort(int value) { + _sel_initWithUnsignedShort ??= + _registerName(_lib, "initWithUnsignedShort:"); + final _ret = _lib._objc_msgSend_38(_id, _sel_initWithUnsignedShort!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithInt; + NSNumber initWithInt(int value) { + _sel_initWithInt ??= _registerName(_lib, "initWithInt:"); + final _ret = _lib._objc_msgSend_39(_id, _sel_initWithInt!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithUnsignedInt; + NSNumber initWithUnsignedInt(int value) { + _sel_initWithUnsignedInt ??= _registerName(_lib, "initWithUnsignedInt:"); + final _ret = _lib._objc_msgSend_40(_id, _sel_initWithUnsignedInt!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithLong; + NSNumber initWithLong(int value) { + _sel_initWithLong ??= _registerName(_lib, "initWithLong:"); + final _ret = _lib._objc_msgSend_41(_id, _sel_initWithLong!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithUnsignedLong; + NSNumber initWithUnsignedLong(int value) { + _sel_initWithUnsignedLong ??= _registerName(_lib, "initWithUnsignedLong:"); + final _ret = _lib._objc_msgSend_42(_id, _sel_initWithUnsignedLong!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithLongLong; + NSNumber initWithLongLong(int value) { + _sel_initWithLongLong ??= _registerName(_lib, "initWithLongLong:"); + final _ret = _lib._objc_msgSend_43(_id, _sel_initWithLongLong!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithUnsignedLongLong; + NSNumber initWithUnsignedLongLong(int value) { + _sel_initWithUnsignedLongLong ??= + _registerName(_lib, "initWithUnsignedLongLong:"); + final _ret = + _lib._objc_msgSend_44(_id, _sel_initWithUnsignedLongLong!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithFloat; + NSNumber initWithFloat(double value) { + _sel_initWithFloat ??= _registerName(_lib, "initWithFloat:"); + final _ret = _lib._objc_msgSend_45(_id, _sel_initWithFloat!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithDouble; + NSNumber initWithDouble(double value) { + _sel_initWithDouble ??= _registerName(_lib, "initWithDouble:"); + final _ret = _lib._objc_msgSend_46(_id, _sel_initWithDouble!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithBool; + NSNumber initWithBool(int value) { + _sel_initWithBool ??= _registerName(_lib, "initWithBool:"); + final _ret = _lib._objc_msgSend_47(_id, _sel_initWithBool!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithInteger; + NSNumber initWithInteger(int value) { + _sel_initWithInteger ??= _registerName(_lib, "initWithInteger:"); + final _ret = _lib._objc_msgSend_48(_id, _sel_initWithInteger!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithUnsignedInteger; + NSNumber initWithUnsignedInteger(int value) { + _sel_initWithUnsignedInteger ??= + _registerName(_lib, "initWithUnsignedInteger:"); + final _ret = + _lib._objc_msgSend_49(_id, _sel_initWithUnsignedInteger!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_charValue; + int get charValue { + _sel_charValue ??= _registerName(_lib, "charValue"); + return _lib._objc_msgSend_50(_id, _sel_charValue!); + } + + static ffi.Pointer? _sel_charValue1; + set charValue(int value) { + _sel_charValue1 ??= _registerName(_lib, "setCharValue:"); + return _lib._objc_msgSend_51(_id, _sel_charValue1!, value); + } + + static ffi.Pointer? _sel_unsignedCharValue; + int get unsignedCharValue { + _sel_unsignedCharValue ??= _registerName(_lib, "unsignedCharValue"); + return _lib._objc_msgSend_52(_id, _sel_unsignedCharValue!); + } + + static ffi.Pointer? _sel_unsignedCharValue1; + set unsignedCharValue(int value) { + _sel_unsignedCharValue1 ??= _registerName(_lib, "setUnsignedCharValue:"); + return _lib._objc_msgSend_53(_id, _sel_unsignedCharValue1!, value); + } + + static ffi.Pointer? _sel_shortValue; + int get shortValue { + _sel_shortValue ??= _registerName(_lib, "shortValue"); + return _lib._objc_msgSend_54(_id, _sel_shortValue!); + } + + static ffi.Pointer? _sel_shortValue1; + set shortValue(int value) { + _sel_shortValue1 ??= _registerName(_lib, "setShortValue:"); + return _lib._objc_msgSend_55(_id, _sel_shortValue1!, value); + } + + static ffi.Pointer? _sel_unsignedShortValue; + int get unsignedShortValue { + _sel_unsignedShortValue ??= _registerName(_lib, "unsignedShortValue"); + return _lib._objc_msgSend_56(_id, _sel_unsignedShortValue!); + } + + static ffi.Pointer? _sel_unsignedShortValue1; + set unsignedShortValue(int value) { + _sel_unsignedShortValue1 ??= _registerName(_lib, "setUnsignedShortValue:"); + return _lib._objc_msgSend_57(_id, _sel_unsignedShortValue1!, value); + } + + static ffi.Pointer? _sel_intValue; + int get intValue { + _sel_intValue ??= _registerName(_lib, "intValue"); + return _lib._objc_msgSend_58(_id, _sel_intValue!); + } + + static ffi.Pointer? _sel_intValue1; + set intValue(int value) { + _sel_intValue1 ??= _registerName(_lib, "setIntValue:"); + return _lib._objc_msgSend_59(_id, _sel_intValue1!, value); + } + + static ffi.Pointer? _sel_unsignedIntValue; + int get unsignedIntValue { + _sel_unsignedIntValue ??= _registerName(_lib, "unsignedIntValue"); + return _lib._objc_msgSend_60(_id, _sel_unsignedIntValue!); + } + + static ffi.Pointer? _sel_unsignedIntValue1; + set unsignedIntValue(int value) { + _sel_unsignedIntValue1 ??= _registerName(_lib, "setUnsignedIntValue:"); + return _lib._objc_msgSend_61(_id, _sel_unsignedIntValue1!, value); + } + + static ffi.Pointer? _sel_longValue; + int get longValue { + _sel_longValue ??= _registerName(_lib, "longValue"); + return _lib._objc_msgSend_62(_id, _sel_longValue!); + } + + static ffi.Pointer? _sel_longValue1; + set longValue(int value) { + _sel_longValue1 ??= _registerName(_lib, "setLongValue:"); + return _lib._objc_msgSend_63(_id, _sel_longValue1!, value); + } + + static ffi.Pointer? _sel_unsignedLongValue; + int get unsignedLongValue { + _sel_unsignedLongValue ??= _registerName(_lib, "unsignedLongValue"); + return _lib._objc_msgSend_64(_id, _sel_unsignedLongValue!); + } + + static ffi.Pointer? _sel_unsignedLongValue1; + set unsignedLongValue(int value) { + _sel_unsignedLongValue1 ??= _registerName(_lib, "setUnsignedLongValue:"); + return _lib._objc_msgSend_65(_id, _sel_unsignedLongValue1!, value); + } + + static ffi.Pointer? _sel_longLongValue; + int get longLongValue { + _sel_longLongValue ??= _registerName(_lib, "longLongValue"); + return _lib._objc_msgSend_66(_id, _sel_longLongValue!); + } + + static ffi.Pointer? _sel_longLongValue1; + set longLongValue(int value) { + _sel_longLongValue1 ??= _registerName(_lib, "setLongLongValue:"); + return _lib._objc_msgSend_67(_id, _sel_longLongValue1!, value); + } + + static ffi.Pointer? _sel_unsignedLongLongValue; + int get unsignedLongLongValue { + _sel_unsignedLongLongValue ??= _registerName(_lib, "unsignedLongLongValue"); + return _lib._objc_msgSend_68(_id, _sel_unsignedLongLongValue!); + } + + static ffi.Pointer? _sel_unsignedLongLongValue1; + set unsignedLongLongValue(int value) { + _sel_unsignedLongLongValue1 ??= + _registerName(_lib, "setUnsignedLongLongValue:"); + return _lib._objc_msgSend_69(_id, _sel_unsignedLongLongValue1!, value); + } + + static ffi.Pointer? _sel_floatValue; + double get floatValue { + _sel_floatValue ??= _registerName(_lib, "floatValue"); + return _lib._objc_msgSend_70(_id, _sel_floatValue!); + } + + static ffi.Pointer? _sel_floatValue1; + set floatValue(double value) { + _sel_floatValue1 ??= _registerName(_lib, "setFloatValue:"); + return _lib._objc_msgSend_71(_id, _sel_floatValue1!, value); + } + + static ffi.Pointer? _sel_doubleValue; + double get doubleValue { + _sel_doubleValue ??= _registerName(_lib, "doubleValue"); + return _lib._objc_msgSend_72(_id, _sel_doubleValue!); + } + + static ffi.Pointer? _sel_doubleValue1; + set doubleValue(double value) { + _sel_doubleValue1 ??= _registerName(_lib, "setDoubleValue:"); + return _lib._objc_msgSend_73(_id, _sel_doubleValue1!, value); + } + + static ffi.Pointer? _sel_boolValue; + int get boolValue { + _sel_boolValue ??= _registerName(_lib, "boolValue"); + return _lib._objc_msgSend_16(_id, _sel_boolValue!); + } + + static ffi.Pointer? _sel_boolValue1; + set boolValue(int value) { + _sel_boolValue1 ??= _registerName(_lib, "setBoolValue:"); + return _lib._objc_msgSend_74(_id, _sel_boolValue1!, value); + } + + static ffi.Pointer? _sel_integerValue; + int get integerValue { + _sel_integerValue ??= _registerName(_lib, "integerValue"); + return _lib._objc_msgSend_75(_id, _sel_integerValue!); + } + + static ffi.Pointer? _sel_integerValue1; + set integerValue(int value) { + _sel_integerValue1 ??= _registerName(_lib, "setIntegerValue:"); + return _lib._objc_msgSend_76(_id, _sel_integerValue1!, value); + } + + static ffi.Pointer? _sel_unsignedIntegerValue; + int get unsignedIntegerValue { + _sel_unsignedIntegerValue ??= _registerName(_lib, "unsignedIntegerValue"); + return _lib._objc_msgSend_20(_id, _sel_unsignedIntegerValue!); + } + + static ffi.Pointer? _sel_unsignedIntegerValue1; + set unsignedIntegerValue(int value) { + _sel_unsignedIntegerValue1 ??= + _registerName(_lib, "setUnsignedIntegerValue:"); + return _lib._objc_msgSend_23(_id, _sel_unsignedIntegerValue1!, value); + } + + static ffi.Pointer? _sel_stringValue; + NSObject get stringValue { + _sel_stringValue ??= _registerName(_lib, "stringValue"); + final _ret = _lib._objc_msgSend_77(_id, _sel_stringValue!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_stringValue1; + set stringValue(NSObject value) { + _sel_stringValue1 ??= _registerName(_lib, "setStringValue:"); + return _lib._objc_msgSend_78(_id, _sel_stringValue1!, value._id); + } + + static ffi.Pointer? _sel_compare; + int compare(NSObject otherNumber) { + _sel_compare ??= _registerName(_lib, "compare:"); + return _lib._objc_msgSend_79(_id, _sel_compare!, otherNumber._id); + } + + static ffi.Pointer? _sel_isEqualToNumber; + int isEqualToNumber(NSObject number) { + _sel_isEqualToNumber ??= _registerName(_lib, "isEqualToNumber:"); + return _lib._objc_msgSend_80(_id, _sel_isEqualToNumber!, number._id); + } + + static ffi.Pointer? _sel_descriptionWithLocale; + NSString descriptionWithLocale(NSObject locale) { + _sel_descriptionWithLocale ??= + _registerName(_lib, "descriptionWithLocale:"); + final _ret = + _lib._objc_msgSend_81(_id, _sel_descriptionWithLocale!, locale._id); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSNumber new1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSNumber"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSNumber alloc(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSNumber"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSNumber._(_ret, _lib); + } +} + +class _NSRange extends ffi.Struct { + @NSUInteger() + external int location; + + @NSUInteger() + external int length; +} + +typedef NSRange = _NSRange; + +class NSFastEnumerationState extends ffi.Struct { + @pkg_ffi.UnsignedLong() + external int state; + + external ffi.Pointer> itemsPtr; + + external ffi.Pointer mutationsPtr; + + @ffi.Array.multi([5]) + external ffi.Array extra; +} + +class NSEnumerator extends NSObject { + NSEnumerator._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSEnumerator castFrom(T other) { + return NSEnumerator._(other._id, other._lib); + } + + static ffi.Pointer? _sel_nextObject; + NSObject nextObject() { + _sel_nextObject ??= _registerName(_lib, "nextObject"); + final _ret = _lib._objc_msgSend_82(_id, _sel_nextObject!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSEnumerator new1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSEnumerator"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSEnumerator._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSEnumerator alloc(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSEnumerator"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSEnumerator._(_ret, _lib); + } +} + +abstract class NSCollectionChangeType { + static const int NSCollectionChangeInsert = 0; + static const int NSCollectionChangeRemove = 1; +} + +class NSOrderedCollectionChange extends NSObject { + NSOrderedCollectionChange._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSOrderedCollectionChange castFrom(T other) { + return NSOrderedCollectionChange._(other._id, other._lib); + } + + static ffi.Pointer? _sel_object; + NSObject get object { + _sel_object ??= _registerName(_lib, "object"); + final _ret = _lib._objc_msgSend_83(_id, _sel_object!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_object1; + set object(NSObject value) { + _sel_object1 ??= _registerName(_lib, "setObject:"); + return _lib._objc_msgSend_84(_id, _sel_object1!, value._id); + } + + static ffi.Pointer? _sel_changeType; + int get changeType { + _sel_changeType ??= _registerName(_lib, "changeType"); + return _lib._objc_msgSend_85(_id, _sel_changeType!); + } + + static ffi.Pointer? _sel_changeType1; + set changeType(int value) { + _sel_changeType1 ??= _registerName(_lib, "setChangeType:"); + return _lib._objc_msgSend_86(_id, _sel_changeType1!, value); + } + + static ffi.Pointer? _sel_index; + int get index { + _sel_index ??= _registerName(_lib, "index"); + return _lib._objc_msgSend_20(_id, _sel_index!); + } + + static ffi.Pointer? _sel_index1; + set index(int value) { + _sel_index1 ??= _registerName(_lib, "setIndex:"); + return _lib._objc_msgSend_23(_id, _sel_index1!, value); + } + + static ffi.Pointer? _sel_associatedIndex; + int get associatedIndex { + _sel_associatedIndex ??= _registerName(_lib, "associatedIndex"); + return _lib._objc_msgSend_20(_id, _sel_associatedIndex!); + } + + static ffi.Pointer? _sel_associatedIndex1; + set associatedIndex(int value) { + _sel_associatedIndex1 ??= _registerName(_lib, "setAssociatedIndex:"); + return _lib._objc_msgSend_23(_id, _sel_associatedIndex1!, value); + } + + static ffi.Pointer? _sel_init; + @override + NSObject init() { + _sel_init ??= _registerName(_lib, "init"); + final _ret = _lib._objc_msgSend_87(_id, _sel_init!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithObject; + NSOrderedCollectionChange initWithObject( + NSObject anObject, int type, int index) { + _sel_initWithObject ??= _registerName(_lib, "initWithObject:type:index:"); + final _ret = _lib._objc_msgSend_88( + _id, _sel_initWithObject!, anObject._id, type, index); + return NSOrderedCollectionChange._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithObject1; + NSOrderedCollectionChange initWithObject1( + NSObject anObject, int type, int index, int associatedIndex) { + _sel_initWithObject1 ??= + _registerName(_lib, "initWithObject:type:index:associatedIndex:"); + final _ret = _lib._objc_msgSend_89( + _id, _sel_initWithObject1!, anObject._id, type, index, associatedIndex); + return NSOrderedCollectionChange._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSOrderedCollectionChange new1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSOrderedCollectionChange"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSOrderedCollectionChange._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSOrderedCollectionChange alloc(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSOrderedCollectionChange"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSOrderedCollectionChange._(_ret, _lib); + } +} + +class NSIndexSet extends NSObject { + NSIndexSet._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSIndexSet castFrom(T other) { + return NSIndexSet._(other._id, other._lib); + } + + static ffi.Pointer? _sel_indexSet; + static NSIndexSet indexSet(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSIndexSet"); + _sel_indexSet ??= _registerName(_lib, "indexSet"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_indexSet!); + return NSIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_indexSetWithIndex; + static NSIndexSet indexSetWithIndex(NativeObjCLibrary _lib, int value) { + _class ??= _getClass(_lib, "NSIndexSet"); + _sel_indexSetWithIndex ??= _registerName(_lib, "indexSetWithIndex:"); + final _ret = _lib._objc_msgSend_90(_class!, _sel_indexSetWithIndex!, value); + return NSIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_indexSetWithIndexesInRange; + static NSIndexSet indexSetWithIndexesInRange( + NativeObjCLibrary _lib, NSRange range) { + _class ??= _getClass(_lib, "NSIndexSet"); + _sel_indexSetWithIndexesInRange ??= + _registerName(_lib, "indexSetWithIndexesInRange:"); + final _ret = + _lib._objc_msgSend_91(_class!, _sel_indexSetWithIndexesInRange!, range); + return NSIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithIndexesInRange; + NSIndexSet initWithIndexesInRange(NSRange range) { + _sel_initWithIndexesInRange ??= + _registerName(_lib, "initWithIndexesInRange:"); + final _ret = + _lib._objc_msgSend_91(_id, _sel_initWithIndexesInRange!, range); + return NSIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithIndexSet; + NSIndexSet initWithIndexSet(NSObject indexSet) { + _sel_initWithIndexSet ??= _registerName(_lib, "initWithIndexSet:"); + final _ret = + _lib._objc_msgSend_92(_id, _sel_initWithIndexSet!, indexSet._id); + return NSIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithIndex; + NSIndexSet initWithIndex(int value) { + _sel_initWithIndex ??= _registerName(_lib, "initWithIndex:"); + final _ret = _lib._objc_msgSend_90(_id, _sel_initWithIndex!, value); + return NSIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_isEqualToIndexSet; + int isEqualToIndexSet(NSObject indexSet) { + _sel_isEqualToIndexSet ??= _registerName(_lib, "isEqualToIndexSet:"); + return _lib._objc_msgSend_93(_id, _sel_isEqualToIndexSet!, indexSet._id); + } + + static ffi.Pointer? _sel_count; + int get count { + _sel_count ??= _registerName(_lib, "count"); + return _lib._objc_msgSend_20(_id, _sel_count!); + } + + static ffi.Pointer? _sel_count1; + set count(int value) { + _sel_count1 ??= _registerName(_lib, "setCount:"); + return _lib._objc_msgSend_23(_id, _sel_count1!, value); + } + + static ffi.Pointer? _sel_firstIndex; + int get firstIndex { + _sel_firstIndex ??= _registerName(_lib, "firstIndex"); + return _lib._objc_msgSend_20(_id, _sel_firstIndex!); + } + + static ffi.Pointer? _sel_firstIndex1; + set firstIndex(int value) { + _sel_firstIndex1 ??= _registerName(_lib, "setFirstIndex:"); + return _lib._objc_msgSend_23(_id, _sel_firstIndex1!, value); + } + + static ffi.Pointer? _sel_lastIndex; + int get lastIndex { + _sel_lastIndex ??= _registerName(_lib, "lastIndex"); + return _lib._objc_msgSend_20(_id, _sel_lastIndex!); + } + + static ffi.Pointer? _sel_lastIndex1; + set lastIndex(int value) { + _sel_lastIndex1 ??= _registerName(_lib, "setLastIndex:"); + return _lib._objc_msgSend_23(_id, _sel_lastIndex1!, value); + } + + static ffi.Pointer? _sel_indexGreaterThanIndex; + int indexGreaterThanIndex(int value) { + _sel_indexGreaterThanIndex ??= + _registerName(_lib, "indexGreaterThanIndex:"); + return _lib._objc_msgSend_94(_id, _sel_indexGreaterThanIndex!, value); + } + + static ffi.Pointer? _sel_indexLessThanIndex; + int indexLessThanIndex(int value) { + _sel_indexLessThanIndex ??= _registerName(_lib, "indexLessThanIndex:"); + return _lib._objc_msgSend_94(_id, _sel_indexLessThanIndex!, value); + } + + static ffi.Pointer? _sel_indexGreaterThanOrEqualToIndex; + int indexGreaterThanOrEqualToIndex(int value) { + _sel_indexGreaterThanOrEqualToIndex ??= + _registerName(_lib, "indexGreaterThanOrEqualToIndex:"); + return _lib._objc_msgSend_94( + _id, _sel_indexGreaterThanOrEqualToIndex!, value); + } + + static ffi.Pointer? _sel_indexLessThanOrEqualToIndex; + int indexLessThanOrEqualToIndex(int value) { + _sel_indexLessThanOrEqualToIndex ??= + _registerName(_lib, "indexLessThanOrEqualToIndex:"); + return _lib._objc_msgSend_94(_id, _sel_indexLessThanOrEqualToIndex!, value); + } + + static ffi.Pointer? _sel_getIndexes; + int getIndexes(ffi.Pointer indexBuffer, int bufferSize, + NSRangePointer range) { + _sel_getIndexes ??= + _registerName(_lib, "getIndexes:maxCount:inIndexRange:"); + return _lib._objc_msgSend_95( + _id, _sel_getIndexes!, indexBuffer, bufferSize, range); + } + + static ffi.Pointer? _sel_countOfIndexesInRange; + int countOfIndexesInRange(NSRange range) { + _sel_countOfIndexesInRange ??= + _registerName(_lib, "countOfIndexesInRange:"); + return _lib._objc_msgSend_96(_id, _sel_countOfIndexesInRange!, range); + } + + static ffi.Pointer? _sel_containsIndex; + int containsIndex(int value) { + _sel_containsIndex ??= _registerName(_lib, "containsIndex:"); + return _lib._objc_msgSend_97(_id, _sel_containsIndex!, value); + } + + static ffi.Pointer? _sel_containsIndexesInRange; + int containsIndexesInRange(NSRange range) { + _sel_containsIndexesInRange ??= + _registerName(_lib, "containsIndexesInRange:"); + return _lib._objc_msgSend_98(_id, _sel_containsIndexesInRange!, range); + } + + static ffi.Pointer? _sel_containsIndexes; + int containsIndexes(NSObject indexSet) { + _sel_containsIndexes ??= _registerName(_lib, "containsIndexes:"); + return _lib._objc_msgSend_99(_id, _sel_containsIndexes!, indexSet._id); + } + + static ffi.Pointer? _sel_intersectsIndexesInRange; + int intersectsIndexesInRange(NSRange range) { + _sel_intersectsIndexesInRange ??= + _registerName(_lib, "intersectsIndexesInRange:"); + return _lib._objc_msgSend_98(_id, _sel_intersectsIndexesInRange!, range); + } + + static ffi.Pointer? _sel_enumerateIndexesUsingBlock; + void enumerateIndexesUsingBlock(NSObject block) { + _sel_enumerateIndexesUsingBlock ??= + _registerName(_lib, "enumerateIndexesUsingBlock:"); + return _lib._objc_msgSend_100( + _id, _sel_enumerateIndexesUsingBlock!, block._id); + } + + static ffi.Pointer? _sel_enumerateIndexesWithOptions; + void enumerateIndexesWithOptions(int opts, NSObject block) { + _sel_enumerateIndexesWithOptions ??= + _registerName(_lib, "enumerateIndexesWithOptions:usingBlock:"); + return _lib._objc_msgSend_101( + _id, _sel_enumerateIndexesWithOptions!, opts, block._id); + } + + static ffi.Pointer? _sel_enumerateIndexesInRange; + void enumerateIndexesInRange(NSRange range, int opts, NSObject block) { + _sel_enumerateIndexesInRange ??= + _registerName(_lib, "enumerateIndexesInRange:options:usingBlock:"); + return _lib._objc_msgSend_102( + _id, _sel_enumerateIndexesInRange!, range, opts, block._id); + } + + static ffi.Pointer? _sel_indexPassingTest; + int indexPassingTest(NSObject predicate) { + _sel_indexPassingTest ??= _registerName(_lib, "indexPassingTest:"); + return _lib._objc_msgSend_103(_id, _sel_indexPassingTest!, predicate._id); + } + + static ffi.Pointer? _sel_indexWithOptions; + int indexWithOptions(int opts, NSObject predicate) { + _sel_indexWithOptions ??= + _registerName(_lib, "indexWithOptions:passingTest:"); + return _lib._objc_msgSend_104( + _id, _sel_indexWithOptions!, opts, predicate._id); + } + + static ffi.Pointer? _sel_indexInRange; + int indexInRange(NSRange range, int opts, NSObject predicate) { + _sel_indexInRange ??= + _registerName(_lib, "indexInRange:options:passingTest:"); + return _lib._objc_msgSend_105( + _id, _sel_indexInRange!, range, opts, predicate._id); + } + + static ffi.Pointer? _sel_indexesPassingTest; + NSIndexSet indexesPassingTest(NSObject predicate) { + _sel_indexesPassingTest ??= _registerName(_lib, "indexesPassingTest:"); + final _ret = + _lib._objc_msgSend_106(_id, _sel_indexesPassingTest!, predicate._id); + return NSIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_indexesWithOptions; + NSIndexSet indexesWithOptions(int opts, NSObject predicate) { + _sel_indexesWithOptions ??= + _registerName(_lib, "indexesWithOptions:passingTest:"); + final _ret = _lib._objc_msgSend_107( + _id, _sel_indexesWithOptions!, opts, predicate._id); + return NSIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_indexesInRange; + NSIndexSet indexesInRange(NSRange range, int opts, NSObject predicate) { + _sel_indexesInRange ??= + _registerName(_lib, "indexesInRange:options:passingTest:"); + final _ret = _lib._objc_msgSend_108( + _id, _sel_indexesInRange!, range, opts, predicate._id); + return NSIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_enumerateRangesUsingBlock; + void enumerateRangesUsingBlock(NSObject block) { + _sel_enumerateRangesUsingBlock ??= + _registerName(_lib, "enumerateRangesUsingBlock:"); + return _lib._objc_msgSend_109( + _id, _sel_enumerateRangesUsingBlock!, block._id); + } + + static ffi.Pointer? _sel_enumerateRangesWithOptions; + void enumerateRangesWithOptions(int opts, NSObject block) { + _sel_enumerateRangesWithOptions ??= + _registerName(_lib, "enumerateRangesWithOptions:usingBlock:"); + return _lib._objc_msgSend_110( + _id, _sel_enumerateRangesWithOptions!, opts, block._id); + } + + static ffi.Pointer? _sel_enumerateRangesInRange; + void enumerateRangesInRange(NSRange range, int opts, NSObject block) { + _sel_enumerateRangesInRange ??= + _registerName(_lib, "enumerateRangesInRange:options:usingBlock:"); + return _lib._objc_msgSend_111( + _id, _sel_enumerateRangesInRange!, range, opts, block._id); + } + + static ffi.Pointer? _sel_new1; + static NSIndexSet new1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSIndexSet"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSIndexSet alloc(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSIndexSet"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSIndexSet._(_ret, _lib); + } +} + +typedef NSRangePointer = ffi.Pointer; + +class NSMutableIndexSet extends NSIndexSet { + NSMutableIndexSet._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSMutableIndexSet castFrom(T other) { + return NSMutableIndexSet._(other._id, other._lib); + } + + static ffi.Pointer? _sel_addIndexes; + void addIndexes(NSObject indexSet) { + _sel_addIndexes ??= _registerName(_lib, "addIndexes:"); + return _lib._objc_msgSend_112(_id, _sel_addIndexes!, indexSet._id); + } + + static ffi.Pointer? _sel_removeIndexes; + void removeIndexes(NSObject indexSet) { + _sel_removeIndexes ??= _registerName(_lib, "removeIndexes:"); + return _lib._objc_msgSend_113(_id, _sel_removeIndexes!, indexSet._id); + } + + static ffi.Pointer? _sel_removeAllIndexes; + void removeAllIndexes() { + _sel_removeAllIndexes ??= _registerName(_lib, "removeAllIndexes"); + return _lib._objc_msgSend_0(_id, _sel_removeAllIndexes!); + } + + static ffi.Pointer? _sel_addIndex; + void addIndex(int value) { + _sel_addIndex ??= _registerName(_lib, "addIndex:"); + return _lib._objc_msgSend_23(_id, _sel_addIndex!, value); + } + + static ffi.Pointer? _sel_removeIndex; + void removeIndex(int value) { + _sel_removeIndex ??= _registerName(_lib, "removeIndex:"); + return _lib._objc_msgSend_23(_id, _sel_removeIndex!, value); + } + + static ffi.Pointer? _sel_addIndexesInRange; + void addIndexesInRange(NSRange range) { + _sel_addIndexesInRange ??= _registerName(_lib, "addIndexesInRange:"); + return _lib._objc_msgSend_114(_id, _sel_addIndexesInRange!, range); + } + + static ffi.Pointer? _sel_removeIndexesInRange; + void removeIndexesInRange(NSRange range) { + _sel_removeIndexesInRange ??= _registerName(_lib, "removeIndexesInRange:"); + return _lib._objc_msgSend_114(_id, _sel_removeIndexesInRange!, range); + } + + static ffi.Pointer? _sel_shiftIndexesStartingAtIndex; + void shiftIndexesStartingAtIndex(int index, int delta) { + _sel_shiftIndexesStartingAtIndex ??= + _registerName(_lib, "shiftIndexesStartingAtIndex:by:"); + return _lib._objc_msgSend_115( + _id, _sel_shiftIndexesStartingAtIndex!, index, delta); + } + + static ffi.Pointer? _sel_indexSet; + static NSMutableIndexSet indexSet(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSMutableIndexSet"); + _sel_indexSet ??= _registerName(_lib, "indexSet"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_indexSet!); + return NSMutableIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_indexSetWithIndex; + static NSMutableIndexSet indexSetWithIndex( + NativeObjCLibrary _lib, int value) { + _class ??= _getClass(_lib, "NSMutableIndexSet"); + _sel_indexSetWithIndex ??= _registerName(_lib, "indexSetWithIndex:"); + final _ret = _lib._objc_msgSend_90(_class!, _sel_indexSetWithIndex!, value); + return NSMutableIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_indexSetWithIndexesInRange; + static NSMutableIndexSet indexSetWithIndexesInRange( + NativeObjCLibrary _lib, NSRange range) { + _class ??= _getClass(_lib, "NSMutableIndexSet"); + _sel_indexSetWithIndexesInRange ??= + _registerName(_lib, "indexSetWithIndexesInRange:"); + final _ret = + _lib._objc_msgSend_91(_class!, _sel_indexSetWithIndexesInRange!, range); + return NSMutableIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSMutableIndexSet new1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSMutableIndexSet"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSMutableIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSMutableIndexSet alloc(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSMutableIndexSet"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSMutableIndexSet._(_ret, _lib); + } +} + +abstract class NSOrderedCollectionDifferenceCalculationOptions { + static const int NSOrderedCollectionDifferenceCalculationOmitInsertedObjects = + 1; + static const int NSOrderedCollectionDifferenceCalculationOmitRemovedObjects = + 2; + static const int NSOrderedCollectionDifferenceCalculationInferMoves = 4; +} + +class NSOrderedCollectionDifference extends NSObject { + NSOrderedCollectionDifference._( + ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); - external CFAllocatorPreferredSizeCallBack preferredSize; + static ffi.Pointer? _class; + + static NSOrderedCollectionDifference castFrom( + T other) { + return NSOrderedCollectionDifference._(other._id, other._lib); + } + + static ffi.Pointer? _sel_initWithChanges; + NSOrderedCollectionDifference initWithChanges(NSObject changes) { + _sel_initWithChanges ??= _registerName(_lib, "initWithChanges:"); + final _ret = + _lib._objc_msgSend_116(_id, _sel_initWithChanges!, changes._id); + return NSOrderedCollectionDifference._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithInsertIndexes; + NSOrderedCollectionDifference initWithInsertIndexes( + NSObject inserts, + NSObject insertedObjects, + NSObject removes, + NSObject removedObjects, + NSObject changes) { + _sel_initWithInsertIndexes ??= _registerName(_lib, + "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:additionalChanges:"); + final _ret = _lib._objc_msgSend_117( + _id, + _sel_initWithInsertIndexes!, + inserts._id, + insertedObjects._id, + removes._id, + removedObjects._id, + changes._id); + return NSOrderedCollectionDifference._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithInsertIndexes1; + NSOrderedCollectionDifference initWithInsertIndexes1(NSObject inserts, + NSObject insertedObjects, NSObject removes, NSObject removedObjects) { + _sel_initWithInsertIndexes1 ??= _registerName(_lib, + "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:"); + final _ret = _lib._objc_msgSend_118(_id, _sel_initWithInsertIndexes1!, + inserts._id, insertedObjects._id, removes._id, removedObjects._id); + return NSOrderedCollectionDifference._(_ret, _lib); + } + + static ffi.Pointer? _sel_insertions; + NSObject get insertions { + _sel_insertions ??= _registerName(_lib, "insertions"); + final _ret = _lib._objc_msgSend_119(_id, _sel_insertions!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_insertions1; + set insertions(NSObject value) { + _sel_insertions1 ??= _registerName(_lib, "setInsertions:"); + return _lib._objc_msgSend_120(_id, _sel_insertions1!, value._id); + } + + static ffi.Pointer? _sel_removals; + NSObject get removals { + _sel_removals ??= _registerName(_lib, "removals"); + final _ret = _lib._objc_msgSend_121(_id, _sel_removals!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_removals1; + set removals(NSObject value) { + _sel_removals1 ??= _registerName(_lib, "setRemovals:"); + return _lib._objc_msgSend_122(_id, _sel_removals1!, value._id); + } + + static ffi.Pointer? _sel_hasChanges; + int get hasChanges { + _sel_hasChanges ??= _registerName(_lib, "hasChanges"); + return _lib._objc_msgSend_16(_id, _sel_hasChanges!); + } + + static ffi.Pointer? _sel_hasChanges1; + set hasChanges(int value) { + _sel_hasChanges1 ??= _registerName(_lib, "setHasChanges:"); + return _lib._objc_msgSend_74(_id, _sel_hasChanges1!, value); + } + + static ffi.Pointer? _sel_inverseDifference; + NSOrderedCollectionDifference inverseDifference() { + _sel_inverseDifference ??= _registerName(_lib, "inverseDifference"); + final _ret = _lib._objc_msgSend_1(_id, _sel_inverseDifference!); + return NSOrderedCollectionDifference._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSOrderedCollectionDifference new1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSOrderedCollectionDifference"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSOrderedCollectionDifference._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSOrderedCollectionDifference alloc(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSOrderedCollectionDifference"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSOrderedCollectionDifference._(_ret, _lib); + } } -typedef CFAllocatorRetainCallBack = ffi.Pointer< - ffi.NativeFunction Function(ffi.Pointer)>>; -typedef CFAllocatorReleaseCallBack - = ffi.Pointer)>>; -typedef CFAllocatorCopyDescriptionCallBack = ffi - .Pointer)>>; -typedef CFStringRef = ffi.Pointer<__CFString>; -typedef CFAllocatorAllocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - CFIndex, CFOptionFlags, ffi.Pointer)>>; -typedef CFOptionFlags = pkg_ffi.UnsignedLong; -typedef CFAllocatorReallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, CFIndex, - CFOptionFlags, ffi.Pointer)>>; -typedef CFAllocatorDeallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; -typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< - ffi.NativeFunction< - CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; -typedef CFTypeRef = ffi.Pointer; -typedef Boolean = pkg_ffi.UnsignedChar; -typedef CFHashCode = pkg_ffi.UnsignedLong; -typedef NSZone = _NSZone; +class NSArray extends NSObject { + NSArray._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); -class _NSZone extends ffi.Opaque {} + static ffi.Pointer? _class; -typedef BOOL = pkg_ffi.SignedChar; + static NSArray castFrom(T other) { + return NSArray._(other._id, other._lib); + } -ffi.Pointer _registerName(NativeObjCLibrary _lib, String name) { - final cstr = name.toNativeUtf8(); - final sel = _lib._sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; + static ffi.Pointer? _sel_count; + int get count { + _sel_count ??= _registerName(_lib, "count"); + return _lib._objc_msgSend_20(_id, _sel_count!); + } + + static ffi.Pointer? _sel_count1; + set count(int value) { + _sel_count1 ??= _registerName(_lib, "setCount:"); + return _lib._objc_msgSend_23(_id, _sel_count1!, value); + } + + static ffi.Pointer? _sel_objectAtIndex; + NSObject objectAtIndex(int index) { + _sel_objectAtIndex ??= _registerName(_lib, "objectAtIndex:"); + final _ret = _lib._objc_msgSend_123(_id, _sel_objectAtIndex!, index); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_init; + @override + NSArray init() { + _sel_init ??= _registerName(_lib, "init"); + final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + return NSArray._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithObjects; + NSArray initWithObjects( + ffi.Pointer> objects, int cnt) { + _sel_initWithObjects ??= _registerName(_lib, "initWithObjects:count:"); + final _ret = + _lib._objc_msgSend_124(_id, _sel_initWithObjects!, objects, cnt); + return NSArray._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithCoder; + NSArray initWithCoder(NSObject coder) { + _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); + final _ret = _lib._objc_msgSend_125(_id, _sel_initWithCoder!, coder._id); + return NSArray._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSArray new1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSArray"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSArray._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSArray alloc(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSArray"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSArray._(_ret, _lib); + } } -ffi.Pointer _getClass(NativeObjCLibrary _lib, String name) { - final cstr = name.toNativeUtf8(); - final clazz = _lib._objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return clazz; +abstract class NSBinarySearchingOptions { + static const int NSBinarySearchingFirstEqual = 256; + static const int NSBinarySearchingLastEqual = 512; + static const int NSBinarySearchingInsertionIndex = 1024; +} + +class NSMutableArray extends NSArray { + NSMutableArray._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSMutableArray castFrom(T other) { + return NSMutableArray._(other._id, other._lib); + } + + static ffi.Pointer? _sel_addObject; + void addObject(NSObject anObject) { + _sel_addObject ??= _registerName(_lib, "addObject:"); + return _lib._objc_msgSend_126(_id, _sel_addObject!, anObject._id); + } + + static ffi.Pointer? _sel_insertObject; + void insertObject(NSObject anObject, int index) { + _sel_insertObject ??= _registerName(_lib, "insertObject:atIndex:"); + return _lib._objc_msgSend_127(_id, _sel_insertObject!, anObject._id, index); + } + + static ffi.Pointer? _sel_removeLastObject; + void removeLastObject() { + _sel_removeLastObject ??= _registerName(_lib, "removeLastObject"); + return _lib._objc_msgSend_0(_id, _sel_removeLastObject!); + } + + static ffi.Pointer? _sel_removeObjectAtIndex; + void removeObjectAtIndex(int index) { + _sel_removeObjectAtIndex ??= _registerName(_lib, "removeObjectAtIndex:"); + return _lib._objc_msgSend_23(_id, _sel_removeObjectAtIndex!, index); + } + + static ffi.Pointer? _sel_replaceObjectAtIndex; + void replaceObjectAtIndex(int index, NSObject anObject) { + _sel_replaceObjectAtIndex ??= + _registerName(_lib, "replaceObjectAtIndex:withObject:"); + return _lib._objc_msgSend_128( + _id, _sel_replaceObjectAtIndex!, index, anObject._id); + } + + static ffi.Pointer? _sel_init; + @override + NSMutableArray init() { + _sel_init ??= _registerName(_lib, "init"); + final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + return NSMutableArray._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithCapacity; + NSMutableArray initWithCapacity(int numItems) { + _sel_initWithCapacity ??= _registerName(_lib, "initWithCapacity:"); + final _ret = _lib._objc_msgSend_90(_id, _sel_initWithCapacity!, numItems); + return NSMutableArray._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithCoder; + @override + NSMutableArray initWithCoder(NSObject coder) { + _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); + final _ret = _lib._objc_msgSend_129(_id, _sel_initWithCoder!, coder._id); + return NSMutableArray._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSMutableArray new1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSMutableArray"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSMutableArray._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSMutableArray alloc(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSMutableArray"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSMutableArray._(_ret, _lib); + } +} + +abstract class NSItemProviderRepresentationVisibility { + static const int NSItemProviderRepresentationVisibilityAll = 0; + static const int NSItemProviderRepresentationVisibilityTeam = 1; + static const int NSItemProviderRepresentationVisibilityGroup = 2; + static const int NSItemProviderRepresentationVisibilityOwnProcess = 3; +} + +abstract class NSItemProviderFileOptions { + static const int NSItemProviderFileOptionOpenInPlace = 1; +} + +class NSItemProvider extends NSObject { + NSItemProvider._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSItemProvider castFrom(T other) { + return NSItemProvider._(other._id, other._lib); + } + + static ffi.Pointer? _sel_init; + @override + NSItemProvider init() { + _sel_init ??= _registerName(_lib, "init"); + final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + return NSItemProvider._(_ret, _lib); + } + + static ffi.Pointer? _sel_registerDataRepresentationForTypeIdentifier; + void registerDataRepresentationForTypeIdentifier( + NSObject typeIdentifier, int visibility, NSObject loadHandler) { + _sel_registerDataRepresentationForTypeIdentifier ??= _registerName(_lib, + "registerDataRepresentationForTypeIdentifier:visibility:loadHandler:"); + return _lib._objc_msgSend_130( + _id, + _sel_registerDataRepresentationForTypeIdentifier!, + typeIdentifier._id, + visibility, + loadHandler._id); + } + + static ffi.Pointer? _sel_registerFileRepresentationForTypeIdentifier; + void registerFileRepresentationForTypeIdentifier(NSObject typeIdentifier, + int fileOptions, int visibility, NSObject loadHandler) { + _sel_registerFileRepresentationForTypeIdentifier ??= _registerName(_lib, + "registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:"); + return _lib._objc_msgSend_131( + _id, + _sel_registerFileRepresentationForTypeIdentifier!, + typeIdentifier._id, + fileOptions, + visibility, + loadHandler._id); + } + + static ffi.Pointer? _sel_registeredTypeIdentifiers; + NSObject get registeredTypeIdentifiers { + _sel_registeredTypeIdentifiers ??= + _registerName(_lib, "registeredTypeIdentifiers"); + final _ret = _lib._objc_msgSend_132(_id, _sel_registeredTypeIdentifiers!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_registeredTypeIdentifiers1; + set registeredTypeIdentifiers(NSObject value) { + _sel_registeredTypeIdentifiers1 ??= + _registerName(_lib, "setRegisteredTypeIdentifiers:"); + return _lib._objc_msgSend_133( + _id, _sel_registeredTypeIdentifiers1!, value._id); + } + + static ffi.Pointer? _sel_hasItemConformingToTypeIdentifier; + int hasItemConformingToTypeIdentifier(NSObject typeIdentifier) { + _sel_hasItemConformingToTypeIdentifier ??= + _registerName(_lib, "hasItemConformingToTypeIdentifier:"); + return _lib._objc_msgSend_134( + _id, _sel_hasItemConformingToTypeIdentifier!, typeIdentifier._id); + } + + static ffi.Pointer? _sel_hasRepresentationConformingToTypeIdentifier; + int hasRepresentationConformingToTypeIdentifier( + NSObject typeIdentifier, int fileOptions) { + _sel_hasRepresentationConformingToTypeIdentifier ??= _registerName( + _lib, "hasRepresentationConformingToTypeIdentifier:fileOptions:"); + return _lib._objc_msgSend_135( + _id, + _sel_hasRepresentationConformingToTypeIdentifier!, + typeIdentifier._id, + fileOptions); + } + + static ffi.Pointer? _sel_loadDataRepresentationForTypeIdentifier; + NSProgress loadDataRepresentationForTypeIdentifier( + NSObject typeIdentifier, NSObject completionHandler) { + _sel_loadDataRepresentationForTypeIdentifier ??= _registerName( + _lib, "loadDataRepresentationForTypeIdentifier:completionHandler:"); + final _ret = _lib._objc_msgSend_136( + _id, + _sel_loadDataRepresentationForTypeIdentifier!, + typeIdentifier._id, + completionHandler._id); + return NSProgress._(_ret, _lib); + } + + static ffi.Pointer? _sel_loadFileRepresentationForTypeIdentifier; + NSProgress loadFileRepresentationForTypeIdentifier( + NSObject typeIdentifier, NSObject completionHandler) { + _sel_loadFileRepresentationForTypeIdentifier ??= _registerName( + _lib, "loadFileRepresentationForTypeIdentifier:completionHandler:"); + final _ret = _lib._objc_msgSend_137( + _id, + _sel_loadFileRepresentationForTypeIdentifier!, + typeIdentifier._id, + completionHandler._id); + return NSProgress._(_ret, _lib); + } + + static ffi.Pointer? + _sel_loadInPlaceFileRepresentationForTypeIdentifier; + NSProgress loadInPlaceFileRepresentationForTypeIdentifier( + NSObject typeIdentifier, NSObject completionHandler) { + _sel_loadInPlaceFileRepresentationForTypeIdentifier ??= _registerName(_lib, + "loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:"); + final _ret = _lib._objc_msgSend_138( + _id, + _sel_loadInPlaceFileRepresentationForTypeIdentifier!, + typeIdentifier._id, + completionHandler._id); + return NSProgress._(_ret, _lib); + } + + static ffi.Pointer? _sel_suggestedName; + NSObject get suggestedName { + _sel_suggestedName ??= _registerName(_lib, "suggestedName"); + final _ret = _lib._objc_msgSend_139(_id, _sel_suggestedName!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_suggestedName1; + set suggestedName(NSObject value) { + _sel_suggestedName1 ??= _registerName(_lib, "setSuggestedName:"); + return _lib._objc_msgSend_140(_id, _sel_suggestedName1!, value._id); + } + + static ffi.Pointer? _sel_initWithObject; + NSItemProvider initWithObject(NSObject object) { + _sel_initWithObject ??= _registerName(_lib, "initWithObject:"); + final _ret = _lib._objc_msgSend_141(_id, _sel_initWithObject!, object._id); + return NSItemProvider._(_ret, _lib); + } + + static ffi.Pointer? _sel_registerObject; + void registerObject(NSObject object, int visibility) { + _sel_registerObject ??= _registerName(_lib, "registerObject:visibility:"); + return _lib._objc_msgSend_142( + _id, _sel_registerObject!, object._id, visibility); + } + + static ffi.Pointer? _sel_registerObjectOfClass; + void registerObjectOfClass( + NSObject aClass, int visibility, NSObject loadHandler) { + _sel_registerObjectOfClass ??= + _registerName(_lib, "registerObjectOfClass:visibility:loadHandler:"); + return _lib._objc_msgSend_143(_id, _sel_registerObjectOfClass!, aClass._id, + visibility, loadHandler._id); + } + + static ffi.Pointer? _sel_canLoadObjectOfClass; + int canLoadObjectOfClass(NSObject aClass) { + _sel_canLoadObjectOfClass ??= _registerName(_lib, "canLoadObjectOfClass:"); + return _lib._objc_msgSend_144(_id, _sel_canLoadObjectOfClass!, aClass._id); + } + + static ffi.Pointer? _sel_loadObjectOfClass; + NSProgress loadObjectOfClass(NSObject aClass, NSObject completionHandler) { + _sel_loadObjectOfClass ??= + _registerName(_lib, "loadObjectOfClass:completionHandler:"); + final _ret = _lib._objc_msgSend_145( + _id, _sel_loadObjectOfClass!, aClass._id, completionHandler._id); + return NSProgress._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithItem; + NSItemProvider initWithItem(NSObject item, NSObject typeIdentifier) { + _sel_initWithItem ??= _registerName(_lib, "initWithItem:typeIdentifier:"); + final _ret = _lib._objc_msgSend_146( + _id, _sel_initWithItem!, item._id, typeIdentifier._id); + return NSItemProvider._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithContentsOfURL; + NSItemProvider initWithContentsOfURL(NSObject fileURL) { + _sel_initWithContentsOfURL ??= + _registerName(_lib, "initWithContentsOfURL:"); + final _ret = + _lib._objc_msgSend_147(_id, _sel_initWithContentsOfURL!, fileURL._id); + return NSItemProvider._(_ret, _lib); + } + + static ffi.Pointer? _sel_registerItemForTypeIdentifier; + void registerItemForTypeIdentifier( + NSObject typeIdentifier, NSItemProviderLoadHandler loadHandler) { + _sel_registerItemForTypeIdentifier ??= + _registerName(_lib, "registerItemForTypeIdentifier:loadHandler:"); + return _lib._objc_msgSend_148(_id, _sel_registerItemForTypeIdentifier!, + typeIdentifier._id, loadHandler); + } + + static ffi.Pointer? _sel_loadItemForTypeIdentifier; + void loadItemForTypeIdentifier(NSObject typeIdentifier, NSObject options, + NSItemProviderCompletionHandler completionHandler) { + _sel_loadItemForTypeIdentifier ??= _registerName( + _lib, "loadItemForTypeIdentifier:options:completionHandler:"); + return _lib._objc_msgSend_149(_id, _sel_loadItemForTypeIdentifier!, + typeIdentifier._id, options._id, completionHandler); + } + + static ffi.Pointer? _sel_new1; + static NSItemProvider new1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSItemProvider"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSItemProvider._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSItemProvider alloc(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSItemProvider"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSItemProvider._(_ret, _lib); + } +} + +class NSProgress extends _ObjCWrapper { + NSProgress._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSProgress castFrom(T other) { + return NSProgress._(other._id, other._lib); + } } -class _ObjCWrapper { - final ffi.Pointer _id; - final NativeObjCLibrary _lib; - _ObjCWrapper._(this._id, this._lib); +typedef NSItemProviderLoadHandler = ffi.Pointer; +typedef NSItemProviderCompletionHandler = ffi.Pointer; + +abstract class NSItemProviderErrorCode { + static const int NSItemProviderUnknownError = -1; + static const int NSItemProviderItemUnavailableError = -1000; + static const int NSItemProviderUnexpectedValueClassError = -1100; + static const int NSItemProviderUnavailableCoercionError = -1200; +} + +abstract class NSStringCompareOptions { + static const int NSCaseInsensitiveSearch = 1; + static const int NSLiteralSearch = 2; + static const int NSBackwardsSearch = 4; + static const int NSAnchoredSearch = 8; + static const int NSNumericSearch = 64; + static const int NSDiacriticInsensitiveSearch = 128; + static const int NSWidthInsensitiveSearch = 256; + static const int NSForcedOrderingSearch = 512; + static const int NSRegularExpressionSearch = 1024; +} + +abstract class NSStringEncodingConversionOptions { + static const int NSStringEncodingConversionAllowLossy = 1; + static const int NSStringEncodingConversionExternalRepresentation = 2; +} + +abstract class NSStringEnumerationOptions { + static const int NSStringEnumerationByLines = 0; + static const int NSStringEnumerationByParagraphs = 1; + static const int NSStringEnumerationByComposedCharacterSequences = 2; + static const int NSStringEnumerationByWords = 3; + static const int NSStringEnumerationBySentences = 4; + static const int NSStringEnumerationByCaretPositions = 5; + static const int NSStringEnumerationByDeletionClusters = 6; + static const int NSStringEnumerationReverse = 256; + static const int NSStringEnumerationSubstringNotRequired = 512; + static const int NSStringEnumerationLocalized = 1024; +} + +typedef NSStringTransform = ffi.Pointer; +typedef NSStringEncodingDetectionOptionsKey = ffi.Pointer; + +class NSMutableString extends NSString { + NSMutableString._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSMutableString castFrom(T other) { + return NSMutableString._(other._id, other._lib); + } + + static ffi.Pointer? _sel_replaceCharactersInRange; + void replaceCharactersInRange(NSRange range, NSObject aString) { + _sel_replaceCharactersInRange ??= + _registerName(_lib, "replaceCharactersInRange:withString:"); + return _lib._objc_msgSend_150( + _id, _sel_replaceCharactersInRange!, range, aString._id); + } + + static ffi.Pointer? _sel_stringWithCString; + static NSString stringWithCString( + NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { + _class ??= _getClass(_lib, "NSMutableString"); + _sel_stringWithCString ??= + _registerName(_lib, "stringWithCString:encoding:"); + final _ret = + _lib._objc_msgSend_26(_class!, _sel_stringWithCString!, cString, enc); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSMutableString new1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSMutableString"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSMutableString._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSMutableString alloc(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSMutableString"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSMutableString._(_ret, _lib); + } +} + +typedef NSExceptionName = ffi.Pointer; + +class NSSimpleCString extends NSString { + NSSimpleCString._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSSimpleCString castFrom(T other) { + return NSSimpleCString._(other._id, other._lib); + } + + static ffi.Pointer? _sel_stringWithCString; + static NSString stringWithCString( + NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { + _class ??= _getClass(_lib, "NSSimpleCString"); + _sel_stringWithCString ??= + _registerName(_lib, "stringWithCString:encoding:"); + final _ret = + _lib._objc_msgSend_26(_class!, _sel_stringWithCString!, cString, enc); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSSimpleCString new1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSSimpleCString"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSSimpleCString._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSSimpleCString alloc(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSSimpleCString"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSSimpleCString._(_ret, _lib); + } +} + +class NSConstantString extends NSSimpleCString { + NSConstantString._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSConstantString castFrom(T other) { + return NSConstantString._(other._id, other._lib); + } + + static ffi.Pointer? _sel_stringWithCString; + static NSString stringWithCString( + NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { + _class ??= _getClass(_lib, "NSConstantString"); + _sel_stringWithCString ??= + _registerName(_lib, "stringWithCString:encoding:"); + final _ret = + _lib._objc_msgSend_26(_class!, _sel_stringWithCString!, cString, enc); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSConstantString new1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSConstantString"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSConstantString._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSConstantString alloc(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSConstantString"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSConstantString._(_ret, _lib); + } } class Foo extends NSObject { @@ -1728,33 +6779,33 @@ class Foo extends NSObject { static ffi.Pointer? _sel_intVal; int get intVal { _sel_intVal ??= _registerName(_lib, "intVal"); - return _lib._objc_msgSend_24(_id, _sel_intVal!); + return _lib._objc_msgSend_151(_id, _sel_intVal!); } static ffi.Pointer? _sel_intVal1; set intVal(int value) { _sel_intVal1 ??= _registerName(_lib, "setIntVal:"); - return _lib._objc_msgSend_25(_id, _sel_intVal1!, value); + return _lib._objc_msgSend_152(_id, _sel_intVal1!, value); } static ffi.Pointer? _sel_makeFoo; static Foo makeFoo(NativeObjCLibrary _lib, double x) { _class ??= _getClass(_lib, "Foo"); _sel_makeFoo ??= _registerName(_lib, "makeFoo:"); - final _ret = _lib._objc_msgSend_26(_class!, _sel_makeFoo!, x); + final _ret = _lib._objc_msgSend_153(_class!, _sel_makeFoo!, x); return Foo._(_ret, _lib); } static ffi.Pointer? _sel_multiply; int multiply(int useIntVals, NSObject other) { _sel_multiply ??= _registerName(_lib, "multiply:withOtherFoo:"); - return _lib._objc_msgSend_27(_id, _sel_multiply!, useIntVals, other._id); + return _lib._objc_msgSend_154(_id, _sel_multiply!, useIntVals, other._id); } static ffi.Pointer? _sel_setDoubleVal; void setDoubleVal(double x) { _sel_setDoubleVal ??= _registerName(_lib, "setDoubleVal:"); - return _lib._objc_msgSend_28(_id, _sel_setDoubleVal!, x); + return _lib._objc_msgSend_73(_id, _sel_setDoubleVal!, x); } static ffi.Pointer? _sel_new1; @@ -1774,288 +6825,92 @@ class Foo extends NSObject { } } -class NSObject extends _ObjCWrapper { - NSObject._(ffi.Pointer id, NativeObjCLibrary lib) +class StringUtil extends NSObject { + StringUtil._(ffi.Pointer id, NativeObjCLibrary lib) : super._(id, lib); static ffi.Pointer? _class; - static NSObject castFrom(T other) { - return NSObject._(other._id, other._lib); - } - - static ffi.Pointer? _sel_load; - static void load(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_load ??= _registerName(_lib, "load"); - return _lib._objc_msgSend_0(_class!, _sel_load!); - } - - static ffi.Pointer? _sel_initialize; - static void initialize(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_initialize ??= _registerName(_lib, "initialize"); - return _lib._objc_msgSend_0(_class!, _sel_initialize!); + static StringUtil castFrom(T other) { + return StringUtil._(other._id, other._lib); } - static ffi.Pointer? _sel_init; - NSObject init() { - _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_1(_id, _sel_init!); - return NSObject._(_ret, _lib); + static ffi.Pointer? _sel_strConcat; + static NSString strConcat(NativeObjCLibrary _lib, NSObject a, NSObject b) { + _class ??= _getClass(_lib, "StringUtil"); + _sel_strConcat ??= _registerName(_lib, "strConcat:with:"); + final _ret = _lib._objc_msgSend_155(_class!, _sel_strConcat!, a._id, b._id); + return NSString._(_ret, _lib); } static ffi.Pointer? _sel_new1; - static NSObject new1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); + static StringUtil new1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "StringUtil"); _sel_new1 ??= _registerName(_lib, "new"); final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); - return NSObject._(_ret, _lib); - } - - static ffi.Pointer? _sel_allocWithZone; - static NSObject allocWithZone( - NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_allocWithZone ??= _registerName(_lib, "allocWithZone:"); - final _ret = _lib._objc_msgSend_2(_class!, _sel_allocWithZone!, zone); - return NSObject._(_ret, _lib); + return StringUtil._(_ret, _lib); } static ffi.Pointer? _sel_alloc; - static NSObject alloc(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); + static StringUtil alloc(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "StringUtil"); _sel_alloc ??= _registerName(_lib, "alloc"); final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); - return NSObject._(_ret, _lib); - } - - static ffi.Pointer? _sel_dealloc; - void dealloc() { - _sel_dealloc ??= _registerName(_lib, "dealloc"); - return _lib._objc_msgSend_0(_id, _sel_dealloc!); - } - - static ffi.Pointer? _sel_finalize; - void finalize() { - _sel_finalize ??= _registerName(_lib, "finalize"); - return _lib._objc_msgSend_0(_id, _sel_finalize!); - } - - static ffi.Pointer? _sel_copy; - NSObject copy() { - _sel_copy ??= _registerName(_lib, "copy"); - final _ret = _lib._objc_msgSend_3(_id, _sel_copy!); - return NSObject._(_ret, _lib); - } - - static ffi.Pointer? _sel_mutableCopy; - NSObject mutableCopy() { - _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); - final _ret = _lib._objc_msgSend_4(_id, _sel_mutableCopy!); - return NSObject._(_ret, _lib); - } - - static ffi.Pointer? _sel_copyWithZone; - static NSObject copyWithZone( - NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); - final _ret = _lib._objc_msgSend_5(_class!, _sel_copyWithZone!, zone); - return NSObject._(_ret, _lib); - } - - static ffi.Pointer? _sel_mutableCopyWithZone; - static NSObject mutableCopyWithZone( - NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); - final _ret = _lib._objc_msgSend_6(_class!, _sel_mutableCopyWithZone!, zone); - return NSObject._(_ret, _lib); - } - - static ffi.Pointer? _sel_instancesRespondToSelector; - static int instancesRespondToSelector( - NativeObjCLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instancesRespondToSelector ??= - _registerName(_lib, "instancesRespondToSelector:"); - return _lib._objc_msgSend_7( - _class!, _sel_instancesRespondToSelector!, aSelector); - } - - static ffi.Pointer? _sel_conformsToProtocol; - static int conformsToProtocol(NativeObjCLibrary _lib, NSObject protocol) { - _class ??= _getClass(_lib, "NSObject"); - _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); - return _lib._objc_msgSend_8( - _class!, _sel_conformsToProtocol!, protocol._id); + return StringUtil._(_ret, _lib); } +} - static ffi.Pointer? _sel_methodForSelector; - IMP methodForSelector(ffi.Pointer aSelector) { - _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); - return _lib._objc_msgSend_9(_id, _sel_methodForSelector!, aSelector); - } +const int NSScannedOption = 1; - static ffi.Pointer? _sel_instanceMethodForSelector; - static IMP instanceMethodForSelector( - NativeObjCLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instanceMethodForSelector ??= - _registerName(_lib, "instanceMethodForSelector:"); - return _lib._objc_msgSend_10( - _class!, _sel_instanceMethodForSelector!, aSelector); - } +const int NSCollectorDisabledOption = 2; - static ffi.Pointer? _sel_doesNotRecognizeSelector; - void doesNotRecognizeSelector(ffi.Pointer aSelector) { - _sel_doesNotRecognizeSelector ??= - _registerName(_lib, "doesNotRecognizeSelector:"); - return _lib._objc_msgSend_11( - _id, _sel_doesNotRecognizeSelector!, aSelector); - } +const int NSASCIIStringEncoding = 1; - static ffi.Pointer? _sel_forwardingTargetForSelector; - NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { - _sel_forwardingTargetForSelector ??= - _registerName(_lib, "forwardingTargetForSelector:"); - final _ret = _lib._objc_msgSend_12( - _id, _sel_forwardingTargetForSelector!, aSelector); - return NSObject._(_ret, _lib); - } +const int NSNEXTSTEPStringEncoding = 2; - static ffi.Pointer? _sel_forwardInvocation; - void forwardInvocation(NSObject anInvocation) { - _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); - return _lib._objc_msgSend_13( - _id, _sel_forwardInvocation!, anInvocation._id); - } +const int NSJapaneseEUCStringEncoding = 3; - static ffi.Pointer? _sel_methodSignatureForSelector; - NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { - _sel_methodSignatureForSelector ??= - _registerName(_lib, "methodSignatureForSelector:"); - final _ret = - _lib._objc_msgSend_14(_id, _sel_methodSignatureForSelector!, aSelector); - return NSMethodSignature._(_ret, _lib); - } +const int NSUTF8StringEncoding = 4; - static ffi.Pointer? _sel_instanceMethodSignatureForSelector; - static NSMethodSignature instanceMethodSignatureForSelector( - NativeObjCLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instanceMethodSignatureForSelector ??= - _registerName(_lib, "instanceMethodSignatureForSelector:"); - final _ret = _lib._objc_msgSend_15( - _class!, _sel_instanceMethodSignatureForSelector!, aSelector); - return NSMethodSignature._(_ret, _lib); - } +const int NSISOLatin1StringEncoding = 5; - static ffi.Pointer? _sel_allowsWeakReference; - int allowsWeakReference() { - _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); - return _lib._objc_msgSend_16(_id, _sel_allowsWeakReference!); - } +const int NSSymbolStringEncoding = 6; - static ffi.Pointer? _sel_retainWeakReference; - int retainWeakReference() { - _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); - return _lib._objc_msgSend_16(_id, _sel_retainWeakReference!); - } +const int NSNonLossyASCIIStringEncoding = 7; - static ffi.Pointer? _sel_isSubclassOfClass; - static int isSubclassOfClass(NativeObjCLibrary _lib, NSObject aClass) { - _class ??= _getClass(_lib, "NSObject"); - _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); - return _lib._objc_msgSend_17(_class!, _sel_isSubclassOfClass!, aClass._id); - } +const int NSShiftJISStringEncoding = 8; - static ffi.Pointer? _sel_resolveClassMethod; - static int resolveClassMethod( - NativeObjCLibrary _lib, ffi.Pointer sel) { - _class ??= _getClass(_lib, "NSObject"); - _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); - return _lib._objc_msgSend_18(_class!, _sel_resolveClassMethod!, sel); - } +const int NSISOLatin2StringEncoding = 9; - static ffi.Pointer? _sel_resolveInstanceMethod; - static int resolveInstanceMethod( - NativeObjCLibrary _lib, ffi.Pointer sel) { - _class ??= _getClass(_lib, "NSObject"); - _sel_resolveInstanceMethod ??= - _registerName(_lib, "resolveInstanceMethod:"); - return _lib._objc_msgSend_19(_class!, _sel_resolveInstanceMethod!, sel); - } +const int NSUnicodeStringEncoding = 10; - static ffi.Pointer? _sel_hash; - static int hash(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_hash ??= _registerName(_lib, "hash"); - return _lib._objc_msgSend_20(_class!, _sel_hash!); - } +const int NSWindowsCP1251StringEncoding = 11; - static ffi.Pointer? _sel_superclass; - static NSObject superclass(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_superclass ??= _registerName(_lib, "superclass"); - final _ret = _lib._objc_msgSend_21(_class!, _sel_superclass!); - return NSObject._(_ret, _lib); - } +const int NSWindowsCP1252StringEncoding = 12; - static ffi.Pointer? _sel_class1; - static NSObject class1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_class1 ??= _registerName(_lib, "class"); - final _ret = _lib._objc_msgSend_22(_class!, _sel_class1!); - return NSObject._(_ret, _lib); - } +const int NSWindowsCP1253StringEncoding = 13; - static ffi.Pointer? _sel_description; - static NSString description(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_description ??= _registerName(_lib, "description"); - final _ret = _lib._objc_msgSend_23(_class!, _sel_description!); - return NSString._(_ret, _lib); - } +const int NSWindowsCP1254StringEncoding = 14; - static ffi.Pointer? _sel_debugDescription; - static NSString debugDescription(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_debugDescription ??= _registerName(_lib, "debugDescription"); - final _ret = _lib._objc_msgSend_23(_class!, _sel_debugDescription!); - return NSString._(_ret, _lib); - } -} +const int NSWindowsCP1250StringEncoding = 15; -typedef instancetype = ffi.Pointer; -typedef IMP = ffi.Pointer>; +const int NSISO2022JPStringEncoding = 21; -class NSMethodSignature extends _ObjCWrapper { - NSMethodSignature._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); +const int NSMacOSRomanStringEncoding = 30; - static ffi.Pointer? _class; +const int NSUTF16StringEncoding = 10; - static NSMethodSignature castFrom(T other) { - return NSMethodSignature._(other._id, other._lib); - } -} +const int NSUTF16BigEndianStringEncoding = 2415919360; -class NSString extends _ObjCWrapper { - NSString._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); +const int NSUTF16LittleEndianStringEncoding = 2483028224; - static ffi.Pointer? _class; +const int NSUTF32StringEncoding = 2348810496; - static NSString castFrom(T other) { - return NSString._(other._id, other._lib); - } -} +const int NSUTF32BigEndianStringEncoding = 2550137088; -const int NSScannedOption = 1; +const int NSUTF32LittleEndianStringEncoding = 2617245952; -const int NSCollectorDisabledOption = 2; +const int NSProprietaryStringEncoding = 65536; const int NS_BLOCKS_AVAILABLE = 1; @@ -2406,3 +7261,7 @@ const double kCFCoreFoundationVersionNumber10_11_4 = 1258.1; const int kCFCoreFoundationVersionNumber10_11_Max = 1299; const int ISA_PTRAUTH_DISCRIMINATOR = 27361; + +const int NSMaximumStringLength = 2147483646; + +const int NS_UNICHAR_IS_EIGHT_BIT = 0; From 01511cfafd2633c5c25179bb6fcd7b96e9cc945f Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Tue, 12 Apr 2022 10:57:51 -0700 Subject: [PATCH 113/276] [ffigen] Coerce BOOL to bool (#311) * Make bool handling configurable * Just force bool instead * Fix va_list test inconsistencies by excluding unused functions --- .../src/code_generator/objc_interface.dart | 1 + .../type_extractor/extractor.dart | 6 + pkgs/ffigen/lib/src/strings.dart | 2 + .../_expected_objc_basic_types_bindings.dart | 4 +- .../_expected_objc_interface_bindings.dart | 92 +- pkgs/ffigen/test/native_objc_test/config.yaml | 3 + .../native_objc_test/native_objc_test.dart | 12 +- .../native_objc_test_bindings.dart | 1223 ++--------------- 8 files changed, 206 insertions(+), 1137 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index a3e8b3c60b..f7f15b9cc5 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -373,6 +373,7 @@ class ObjCInterface extends BindingType { type is ObjCInterface || _isObject(type) || _isInstanceType(type); String _getConvertedType(Type type, Writer w, String enclosingClass) { + if (type is BooleanType) return 'bool'; if (type is ObjCInterface) return type.name; if (_isObject(type)) return 'NSObject'; if (_isInstanceType(type)) return enclosingClass; diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index ae96a5a36c..7026c7a18c 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -148,6 +148,12 @@ _CreateTypeFromCursorResult _createTypeFromCursor(clang_types.CXType cxtype, switch (cxtype.kind) { case clang_types.CXTypeKind.CXType_Typedef: final spelling = clang.clang_getTypedefName(cxtype).toStringAndDispose(); + if (config.language == Language.objc && spelling == strings.objcBOOL) { + // Objective C's BOOL type can be either bool or signed char, depending + // on the platform. We want to present a consistent API to the user, and + // those two types are ABI compatible, so just return bool regardless. + return _CreateTypeFromCursorResult(BooleanType()); + } if (config.typedefTypeMappings.containsKey(spelling)) { _logger.fine(' Type $spelling mapped from type-map'); return _CreateTypeFromCursorResult( diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 2140572551..cc0c6c7e9d 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -37,10 +37,12 @@ const langObjC = 'objc'; // Clang command line args for Objective C. const clangLangObjC = ['-x', 'objective-c']; +const clangObjCBoolDefine = '__OBJC_BOOL_IS_BOOL'; const clangInclude = '-include'; const clangDefaultObjCSystemHeaderPath = '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include'; const clangDefaultObjCSystemHeaders = ['objc/NSObject.h']; +const objcBOOL = 'BOOL'; // Internal objective C directories that are automatically pulled in by clang, // and should be excluded from output (unless explicitly used). diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart index 8fe008bc9c..7622bb9ad6 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart @@ -5,7 +5,7 @@ import 'dart:ffi' as ffi; import 'package:ffi/ffi.dart' as pkg_ffi; class Foo extends ffi.Struct { - @BOOL() + @ffi.Uint8() external int someBool; external ffi.Pointer anId; @@ -19,8 +19,6 @@ class Foo extends ffi.Struct { external ffi.Pointer blockThatReturnsAnInt; } -typedef BOOL = pkg_ffi.SignedChar; - class ObjCObject extends ffi.Opaque {} class ObjCSel extends ffi.Opaque {} diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart index 96b638f0ba..8d9273f447 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart @@ -180,41 +180,43 @@ class NativeLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer<_NSZone>)>(); - int _objc_msgSend_7( + bool _objc_msgSend_7( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { return __objc_msgSend_7( - obj, - sel, - aSelector, - ); + obj, + sel, + aSelector, + ) != + 0; } late final __objc_msgSend_7Ptr = _lookup< ffi.NativeFunction< - BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_8( + bool _objc_msgSend_8( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer protocol, ) { return __objc_msgSend_8( - obj, - sel, - protocol, - ); + obj, + sel, + protocol, + ) != + 0; } late final __objc_msgSend_8Ptr = _lookup< ffi.NativeFunction< - BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -360,78 +362,82 @@ class NativeLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_16( + bool _objc_msgSend_16( ffi.Pointer obj, ffi.Pointer sel, ) { return __objc_msgSend_16( - obj, - sel, - ); + obj, + sel, + ) != + 0; } late final __objc_msgSend_16Ptr = _lookup< ffi.NativeFunction< - BOOL Function( + ffi.Uint8 Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_17( + bool _objc_msgSend_17( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aClass, ) { return __objc_msgSend_17( - obj, - sel, - aClass, - ); + obj, + sel, + aClass, + ) != + 0; } late final __objc_msgSend_17Ptr = _lookup< ffi.NativeFunction< - BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_18( + bool _objc_msgSend_18( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer sel1, ) { return __objc_msgSend_18( - obj, - sel, - sel1, - ); + obj, + sel, + sel1, + ) != + 0; } late final __objc_msgSend_18Ptr = _lookup< ffi.NativeFunction< - BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_19( + bool _objc_msgSend_19( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer sel1, ) { return __objc_msgSend_19( - obj, - sel, - sel1, - ); + obj, + sel, + sel1, + ) != + 0; } late final __objc_msgSend_19Ptr = _lookup< ffi.NativeFunction< - BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -805,7 +811,7 @@ class NSObject extends _ObjCWrapper { } static ffi.Pointer? _sel_instancesRespondToSelector; - static int instancesRespondToSelector( + static bool instancesRespondToSelector( NativeLibrary _lib, ffi.Pointer aSelector) { _class ??= _getClass(_lib, "NSObject"); _sel_instancesRespondToSelector ??= @@ -815,7 +821,7 @@ class NSObject extends _ObjCWrapper { } static ffi.Pointer? _sel_conformsToProtocol; - static int conformsToProtocol(NativeLibrary _lib, NSObject protocol) { + static bool conformsToProtocol(NativeLibrary _lib, NSObject protocol) { _class ??= _getClass(_lib, "NSObject"); _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); return _lib._objc_msgSend_8( @@ -883,33 +889,33 @@ class NSObject extends _ObjCWrapper { } static ffi.Pointer? _sel_allowsWeakReference; - int allowsWeakReference() { + bool allowsWeakReference() { _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); return _lib._objc_msgSend_16(_id, _sel_allowsWeakReference!); } static ffi.Pointer? _sel_retainWeakReference; - int retainWeakReference() { + bool retainWeakReference() { _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); return _lib._objc_msgSend_16(_id, _sel_retainWeakReference!); } static ffi.Pointer? _sel_isSubclassOfClass; - static int isSubclassOfClass(NativeLibrary _lib, NSObject aClass) { + static bool isSubclassOfClass(NativeLibrary _lib, NSObject aClass) { _class ??= _getClass(_lib, "NSObject"); _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); return _lib._objc_msgSend_17(_class!, _sel_isSubclassOfClass!, aClass._id); } static ffi.Pointer? _sel_resolveClassMethod; - static int resolveClassMethod(NativeLibrary _lib, ffi.Pointer sel) { + static bool resolveClassMethod(NativeLibrary _lib, ffi.Pointer sel) { _class ??= _getClass(_lib, "NSObject"); _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); return _lib._objc_msgSend_18(_class!, _sel_resolveClassMethod!, sel); } static ffi.Pointer? _sel_resolveInstanceMethod; - static int resolveInstanceMethod( + static bool resolveInstanceMethod( NativeLibrary _lib, ffi.Pointer sel) { _class ??= _getClass(_lib, "NSObject"); _sel_resolveInstanceMethod ??= @@ -963,8 +969,6 @@ class ObjCObject extends ffi.Opaque {} class _NSZone extends ffi.Opaque {} -typedef BOOL = pkg_ffi.SignedChar; - class ObjCSel extends ffi.Opaque {} typedef IMP = ffi.Pointer>; diff --git a/pkgs/ffigen/test/native_objc_test/config.yaml b/pkgs/ffigen/test/native_objc_test/config.yaml index d7bb00245f..1083214f64 100644 --- a/pkgs/ffigen/test/native_objc_test/config.yaml +++ b/pkgs/ffigen/test/native_objc_test/config.yaml @@ -10,6 +10,9 @@ name: NativeObjCLibrary description: 'Native Objective C test' language: objc output: 'test/native_objc_test/native_objc_test_bindings.dart' +functions: + exclude: + - '.*' headers: entry-points: - 'test/native_objc_test/native_objc_test.m' diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart index 1feaa9a079..ada15b1519 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart @@ -54,16 +54,16 @@ void main() { expect(foo1.intVal, 3); expect(foo2.intVal, 2); - expect(foo1.multiply(0, foo2), 8); - expect(foo1.multiply(1, foo2), 6); + expect(foo1.multiply(false, foo2), 8); + expect(foo1.multiply(true, foo2), 6); foo1.intVal = 100; - expect(foo1.multiply(0, foo2), 8); - expect(foo1.multiply(1, foo2), 200); + expect(foo1.multiply(false, foo2), 8); + expect(foo1.multiply(true, foo2), 200); foo2.setDoubleVal(1.61803); - expect(foo1.multiply(0, foo2), 5); - expect(foo1.multiply(1, foo2), 200); + expect(foo1.multiply(false, foo2), 5); + expect(foo1.multiply(true, foo2), 200); }); test('NSString manipulations', () { diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart index e40b0d567a..0643f706b2 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart @@ -30,149 +30,6 @@ class NativeObjCLibrary { set NSFoundationVersionNumber(double value) => _NSFoundationVersionNumber.value = value; - ffi.Pointer NSStringFromSelector( - ffi.Pointer aSelector, - ) { - return _NSStringFromSelector( - aSelector, - ); - } - - late final _NSStringFromSelectorPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('NSStringFromSelector'); - late final _NSStringFromSelector = _NSStringFromSelectorPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer NSSelectorFromString( - ffi.Pointer aSelectorName, - ) { - return _NSSelectorFromString( - aSelectorName, - ); - } - - late final _NSSelectorFromStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('NSSelectorFromString'); - late final _NSSelectorFromString = _NSSelectorFromStringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer NSStringFromClass( - ffi.Pointer aClass, - ) { - return _NSStringFromClass( - aClass, - ); - } - - late final _NSStringFromClassPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('NSStringFromClass'); - late final _NSStringFromClass = _NSStringFromClassPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer NSClassFromString( - ffi.Pointer aClassName, - ) { - return _NSClassFromString( - aClassName, - ); - } - - late final _NSClassFromStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('NSClassFromString'); - late final _NSClassFromString = _NSClassFromStringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer NSStringFromProtocol( - ffi.Pointer proto, - ) { - return _NSStringFromProtocol( - proto, - ); - } - - late final _NSStringFromProtocolPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('NSStringFromProtocol'); - late final _NSStringFromProtocol = _NSStringFromProtocolPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer NSProtocolFromString( - ffi.Pointer namestr, - ) { - return _NSProtocolFromString( - namestr, - ); - } - - late final _NSProtocolFromStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('NSProtocolFromString'); - late final _NSProtocolFromString = _NSProtocolFromStringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer NSGetSizeAndAlignment( - ffi.Pointer typePtr, - ffi.Pointer sizep, - ffi.Pointer alignp, - ) { - return _NSGetSizeAndAlignment( - typePtr, - sizep, - alignp, - ); - } - - late final _NSGetSizeAndAlignmentPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('NSGetSizeAndAlignment'); - late final _NSGetSizeAndAlignment = _NSGetSizeAndAlignmentPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - void NSLog( - ffi.Pointer format, - ) { - return _NSLog( - format, - ); - } - - late final _NSLogPtr = - _lookup)>>( - 'NSLog'); - late final _NSLog = - _NSLogPtr.asFunction)>(); - - void NSLogv( - ffi.Pointer format, - ffi.Pointer<__va_list_tag> args, - ) { - return _NSLogv( - format, - args, - ); - } - - late final _NSLogvPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer<__va_list_tag>)>>('NSLogv'); - late final _NSLogv = _NSLogvPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer<__va_list_tag>)>(); - late final ffi.Pointer _NSNotFound = _lookup('NSNotFound'); @@ -196,31 +53,6 @@ class NativeObjCLibrary { set kCFNotFound(int value) => _kCFNotFound.value = value; - CFRange __CFRangeMake( - int loc, - int len, - ) { - return ___CFRangeMake( - loc, - len, - ); - } - - late final ___CFRangeMakePtr = - _lookup>( - '__CFRangeMake'); - late final ___CFRangeMake = - ___CFRangeMakePtr.asFunction(); - - int CFNullGetTypeID() { - return _CFNullGetTypeID(); - } - - late final _CFNullGetTypeIDPtr = - _lookup>('CFNullGetTypeID'); - late final _CFNullGetTypeID = - _CFNullGetTypeIDPtr.asFunction(); - late final ffi.Pointer _kCFNull = _lookup('kCFNull'); CFNullRef get kCFNull => _kCFNull.value; @@ -275,718 +107,6 @@ class NativeObjCLibrary { set kCFAllocatorUseContext(CFAllocatorRef value) => _kCFAllocatorUseContext.value = value; - int CFAllocatorGetTypeID() { - return _CFAllocatorGetTypeID(); - } - - late final _CFAllocatorGetTypeIDPtr = - _lookup>('CFAllocatorGetTypeID'); - late final _CFAllocatorGetTypeID = - _CFAllocatorGetTypeIDPtr.asFunction(); - - void CFAllocatorSetDefault( - CFAllocatorRef allocator, - ) { - return _CFAllocatorSetDefault( - allocator, - ); - } - - late final _CFAllocatorSetDefaultPtr = - _lookup>( - 'CFAllocatorSetDefault'); - late final _CFAllocatorSetDefault = - _CFAllocatorSetDefaultPtr.asFunction(); - - CFAllocatorRef CFAllocatorGetDefault() { - return _CFAllocatorGetDefault(); - } - - late final _CFAllocatorGetDefaultPtr = - _lookup>( - 'CFAllocatorGetDefault'); - late final _CFAllocatorGetDefault = - _CFAllocatorGetDefaultPtr.asFunction(); - - CFAllocatorRef CFAllocatorCreate( - CFAllocatorRef allocator, - ffi.Pointer context, - ) { - return _CFAllocatorCreate( - allocator, - context, - ); - } - - late final _CFAllocatorCreatePtr = _lookup< - ffi.NativeFunction< - CFAllocatorRef Function(CFAllocatorRef, - ffi.Pointer)>>('CFAllocatorCreate'); - late final _CFAllocatorCreate = _CFAllocatorCreatePtr.asFunction< - CFAllocatorRef Function( - CFAllocatorRef, ffi.Pointer)>(); - - ffi.Pointer CFAllocatorAllocate( - CFAllocatorRef allocator, - int size, - int hint, - ) { - return _CFAllocatorAllocate( - allocator, - size, - hint, - ); - } - - late final _CFAllocatorAllocatePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - CFAllocatorRef, CFIndex, CFOptionFlags)>>('CFAllocatorAllocate'); - late final _CFAllocatorAllocate = _CFAllocatorAllocatePtr.asFunction< - ffi.Pointer Function(CFAllocatorRef, int, int)>(); - - ffi.Pointer CFAllocatorReallocate( - CFAllocatorRef allocator, - ffi.Pointer ptr, - int newsize, - int hint, - ) { - return _CFAllocatorReallocate( - allocator, - ptr, - newsize, - hint, - ); - } - - late final _CFAllocatorReallocatePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(CFAllocatorRef, ffi.Pointer, - CFIndex, CFOptionFlags)>>('CFAllocatorReallocate'); - late final _CFAllocatorReallocate = _CFAllocatorReallocatePtr.asFunction< - ffi.Pointer Function( - CFAllocatorRef, ffi.Pointer, int, int)>(); - - void CFAllocatorDeallocate( - CFAllocatorRef allocator, - ffi.Pointer ptr, - ) { - return _CFAllocatorDeallocate( - allocator, - ptr, - ); - } - - late final _CFAllocatorDeallocatePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFAllocatorRef, ffi.Pointer)>>('CFAllocatorDeallocate'); - late final _CFAllocatorDeallocate = _CFAllocatorDeallocatePtr.asFunction< - void Function(CFAllocatorRef, ffi.Pointer)>(); - - int CFAllocatorGetPreferredSizeForSize( - CFAllocatorRef allocator, - int size, - int hint, - ) { - return _CFAllocatorGetPreferredSizeForSize( - allocator, - size, - hint, - ); - } - - late final _CFAllocatorGetPreferredSizeForSizePtr = _lookup< - ffi.NativeFunction< - CFIndex Function(CFAllocatorRef, CFIndex, - CFOptionFlags)>>('CFAllocatorGetPreferredSizeForSize'); - late final _CFAllocatorGetPreferredSizeForSize = - _CFAllocatorGetPreferredSizeForSizePtr.asFunction< - int Function(CFAllocatorRef, int, int)>(); - - void CFAllocatorGetContext( - CFAllocatorRef allocator, - ffi.Pointer context, - ) { - return _CFAllocatorGetContext( - allocator, - context, - ); - } - - late final _CFAllocatorGetContextPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFAllocatorRef, - ffi.Pointer)>>('CFAllocatorGetContext'); - late final _CFAllocatorGetContext = _CFAllocatorGetContextPtr.asFunction< - void Function(CFAllocatorRef, ffi.Pointer)>(); - - int CFGetTypeID( - CFTypeRef cf, - ) { - return _CFGetTypeID( - cf, - ); - } - - late final _CFGetTypeIDPtr = - _lookup>('CFGetTypeID'); - late final _CFGetTypeID = - _CFGetTypeIDPtr.asFunction(); - - CFStringRef CFCopyTypeIDDescription( - int type_id, - ) { - return _CFCopyTypeIDDescription( - type_id, - ); - } - - late final _CFCopyTypeIDDescriptionPtr = - _lookup>( - 'CFCopyTypeIDDescription'); - late final _CFCopyTypeIDDescription = - _CFCopyTypeIDDescriptionPtr.asFunction(); - - CFTypeRef CFRetain( - CFTypeRef cf, - ) { - return _CFRetain( - cf, - ); - } - - late final _CFRetainPtr = - _lookup>('CFRetain'); - late final _CFRetain = - _CFRetainPtr.asFunction(); - - void CFRelease( - CFTypeRef cf, - ) { - return _CFRelease( - cf, - ); - } - - late final _CFReleasePtr = - _lookup>('CFRelease'); - late final _CFRelease = _CFReleasePtr.asFunction(); - - CFTypeRef CFAutorelease( - CFTypeRef arg, - ) { - return _CFAutorelease( - arg, - ); - } - - late final _CFAutoreleasePtr = - _lookup>( - 'CFAutorelease'); - late final _CFAutorelease = - _CFAutoreleasePtr.asFunction(); - - int CFGetRetainCount( - CFTypeRef cf, - ) { - return _CFGetRetainCount( - cf, - ); - } - - late final _CFGetRetainCountPtr = - _lookup>( - 'CFGetRetainCount'); - late final _CFGetRetainCount = - _CFGetRetainCountPtr.asFunction(); - - int CFEqual( - CFTypeRef cf1, - CFTypeRef cf2, - ) { - return _CFEqual( - cf1, - cf2, - ); - } - - late final _CFEqualPtr = - _lookup>( - 'CFEqual'); - late final _CFEqual = - _CFEqualPtr.asFunction(); - - int CFHash( - CFTypeRef cf, - ) { - return _CFHash( - cf, - ); - } - - late final _CFHashPtr = - _lookup>('CFHash'); - late final _CFHash = _CFHashPtr.asFunction(); - - CFStringRef CFCopyDescription( - CFTypeRef cf, - ) { - return _CFCopyDescription( - cf, - ); - } - - late final _CFCopyDescriptionPtr = - _lookup>( - 'CFCopyDescription'); - late final _CFCopyDescription = - _CFCopyDescriptionPtr.asFunction(); - - CFAllocatorRef CFGetAllocator( - CFTypeRef cf, - ) { - return _CFGetAllocator( - cf, - ); - } - - late final _CFGetAllocatorPtr = - _lookup>( - 'CFGetAllocator'); - late final _CFGetAllocator = - _CFGetAllocatorPtr.asFunction(); - - CFTypeRef CFMakeCollectable( - CFTypeRef cf, - ) { - return _CFMakeCollectable( - cf, - ); - } - - late final _CFMakeCollectablePtr = - _lookup>( - 'CFMakeCollectable'); - late final _CFMakeCollectable = - _CFMakeCollectablePtr.asFunction(); - - ffi.Pointer NSDefaultMallocZone() { - return _NSDefaultMallocZone(); - } - - late final _NSDefaultMallocZonePtr = - _lookup Function()>>( - 'NSDefaultMallocZone'); - late final _NSDefaultMallocZone = - _NSDefaultMallocZonePtr.asFunction Function()>(); - - ffi.Pointer NSCreateZone( - int startSize, - int granularity, - int canFree, - ) { - return _NSCreateZone( - startSize, - granularity, - canFree, - ); - } - - late final _NSCreateZonePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - NSUInteger, NSUInteger, BOOL)>>('NSCreateZone'); - late final _NSCreateZone = _NSCreateZonePtr.asFunction< - ffi.Pointer Function(int, int, int)>(); - - void NSRecycleZone( - ffi.Pointer zone, - ) { - return _NSRecycleZone( - zone, - ); - } - - late final _NSRecycleZonePtr = - _lookup)>>( - 'NSRecycleZone'); - late final _NSRecycleZone = - _NSRecycleZonePtr.asFunction)>(); - - void NSSetZoneName( - ffi.Pointer zone, - ffi.Pointer name, - ) { - return _NSSetZoneName( - zone, - name, - ); - } - - late final _NSSetZoneNamePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>('NSSetZoneName'); - late final _NSSetZoneName = _NSSetZoneNamePtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer NSZoneName( - ffi.Pointer zone, - ) { - return _NSZoneName( - zone, - ); - } - - late final _NSZoneNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('NSZoneName'); - late final _NSZoneName = _NSZoneNamePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer NSZoneFromPointer( - ffi.Pointer ptr, - ) { - return _NSZoneFromPointer( - ptr, - ); - } - - late final _NSZoneFromPointerPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('NSZoneFromPointer'); - late final _NSZoneFromPointer = _NSZoneFromPointerPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - ffi.Pointer NSZoneMalloc( - ffi.Pointer zone, - int size, - ) { - return _NSZoneMalloc( - zone, - size, - ); - } - - late final _NSZoneMallocPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, NSUInteger)>>('NSZoneMalloc'); - late final _NSZoneMalloc = _NSZoneMallocPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); - - ffi.Pointer NSZoneCalloc( - ffi.Pointer zone, - int numElems, - int byteSize, - ) { - return _NSZoneCalloc( - zone, - numElems, - byteSize, - ); - } - - late final _NSZoneCallocPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, NSUInteger, NSUInteger)>>('NSZoneCalloc'); - late final _NSZoneCalloc = _NSZoneCallocPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int)>(); - - ffi.Pointer NSZoneRealloc( - ffi.Pointer zone, - ffi.Pointer ptr, - int size, - ) { - return _NSZoneRealloc( - zone, - ptr, - size, - ); - } - - late final _NSZoneReallocPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>('NSZoneRealloc'); - late final _NSZoneRealloc = _NSZoneReallocPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - void NSZoneFree( - ffi.Pointer zone, - ffi.Pointer ptr, - ) { - return _NSZoneFree( - zone, - ptr, - ); - } - - late final _NSZoneFreePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>('NSZoneFree'); - late final _NSZoneFree = _NSZoneFreePtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer NSAllocateCollectable( - int size, - int options, - ) { - return _NSAllocateCollectable( - size, - options, - ); - } - - late final _NSAllocateCollectablePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - NSUInteger, NSUInteger)>>('NSAllocateCollectable'); - late final _NSAllocateCollectable = _NSAllocateCollectablePtr.asFunction< - ffi.Pointer Function(int, int)>(); - - ffi.Pointer NSReallocateCollectable( - ffi.Pointer ptr, - int size, - int options, - ) { - return _NSReallocateCollectable( - ptr, - size, - options, - ); - } - - late final _NSReallocateCollectablePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, NSUInteger, - NSUInteger)>>('NSReallocateCollectable'); - late final _NSReallocateCollectable = _NSReallocateCollectablePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int)>(); - - int NSPageSize() { - return _NSPageSize(); - } - - late final _NSPageSizePtr = - _lookup>('NSPageSize'); - late final _NSPageSize = _NSPageSizePtr.asFunction(); - - int NSLogPageSize() { - return _NSLogPageSize(); - } - - late final _NSLogPageSizePtr = - _lookup>('NSLogPageSize'); - late final _NSLogPageSize = _NSLogPageSizePtr.asFunction(); - - int NSRoundUpToMultipleOfPageSize( - int bytes, - ) { - return _NSRoundUpToMultipleOfPageSize( - bytes, - ); - } - - late final _NSRoundUpToMultipleOfPageSizePtr = - _lookup>( - 'NSRoundUpToMultipleOfPageSize'); - late final _NSRoundUpToMultipleOfPageSize = - _NSRoundUpToMultipleOfPageSizePtr.asFunction(); - - int NSRoundDownToMultipleOfPageSize( - int bytes, - ) { - return _NSRoundDownToMultipleOfPageSize( - bytes, - ); - } - - late final _NSRoundDownToMultipleOfPageSizePtr = - _lookup>( - 'NSRoundDownToMultipleOfPageSize'); - late final _NSRoundDownToMultipleOfPageSize = - _NSRoundDownToMultipleOfPageSizePtr.asFunction(); - - ffi.Pointer NSAllocateMemoryPages( - int bytes, - ) { - return _NSAllocateMemoryPages( - bytes, - ); - } - - late final _NSAllocateMemoryPagesPtr = - _lookup Function(NSUInteger)>>( - 'NSAllocateMemoryPages'); - late final _NSAllocateMemoryPages = _NSAllocateMemoryPagesPtr.asFunction< - ffi.Pointer Function(int)>(); - - void NSDeallocateMemoryPages( - ffi.Pointer ptr, - int bytes, - ) { - return _NSDeallocateMemoryPages( - ptr, - bytes, - ); - } - - late final _NSDeallocateMemoryPagesPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, NSUInteger)>>('NSDeallocateMemoryPages'); - late final _NSDeallocateMemoryPages = _NSDeallocateMemoryPagesPtr.asFunction< - void Function(ffi.Pointer, int)>(); - - void NSCopyMemoryPages( - ffi.Pointer source, - ffi.Pointer dest, - int bytes, - ) { - return _NSCopyMemoryPages( - source, - dest, - bytes, - ); - } - - late final _NSCopyMemoryPagesPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('NSCopyMemoryPages'); - late final _NSCopyMemoryPages = _NSCopyMemoryPagesPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - int NSRealMemoryAvailable() { - return _NSRealMemoryAvailable(); - } - - late final _NSRealMemoryAvailablePtr = - _lookup>( - 'NSRealMemoryAvailable'); - late final _NSRealMemoryAvailable = - _NSRealMemoryAvailablePtr.asFunction(); - - ffi.Pointer NSAllocateObject( - ffi.Pointer aClass, - int extraBytes, - ffi.Pointer zone, - ) { - return _NSAllocateObject( - aClass, - extraBytes, - zone, - ); - } - - late final _NSAllocateObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, NSUInteger, - ffi.Pointer)>>('NSAllocateObject'); - late final _NSAllocateObject = _NSAllocateObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int, ffi.Pointer)>(); - - void NSDeallocateObject( - ffi.Pointer object, - ) { - return _NSDeallocateObject( - object, - ); - } - - late final _NSDeallocateObjectPtr = - _lookup)>>( - 'NSDeallocateObject'); - late final _NSDeallocateObject = _NSDeallocateObjectPtr.asFunction< - void Function(ffi.Pointer)>(); - - ffi.Pointer NSCopyObject( - ffi.Pointer object, - int extraBytes, - ffi.Pointer zone, - ) { - return _NSCopyObject( - object, - extraBytes, - zone, - ); - } - - late final _NSCopyObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, NSUInteger, - ffi.Pointer)>>('NSCopyObject'); - late final _NSCopyObject = _NSCopyObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int, ffi.Pointer)>(); - - int NSShouldRetainWithZone( - ffi.Pointer anObject, - ffi.Pointer requestedZone, - ) { - return _NSShouldRetainWithZone( - anObject, - requestedZone, - ); - } - - late final _NSShouldRetainWithZonePtr = _lookup< - ffi.NativeFunction< - BOOL Function(ffi.Pointer, - ffi.Pointer)>>('NSShouldRetainWithZone'); - late final _NSShouldRetainWithZone = _NSShouldRetainWithZonePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - void NSIncrementExtraRefCount( - ffi.Pointer object, - ) { - return _NSIncrementExtraRefCount( - object, - ); - } - - late final _NSIncrementExtraRefCountPtr = - _lookup)>>( - 'NSIncrementExtraRefCount'); - late final _NSIncrementExtraRefCount = _NSIncrementExtraRefCountPtr - .asFunction)>(); - - int NSDecrementExtraRefCountWasZero( - ffi.Pointer object, - ) { - return _NSDecrementExtraRefCountWasZero( - object, - ); - } - - late final _NSDecrementExtraRefCountWasZeroPtr = - _lookup)>>( - 'NSDecrementExtraRefCountWasZero'); - late final _NSDecrementExtraRefCountWasZero = - _NSDecrementExtraRefCountWasZeroPtr.asFunction< - int Function(ffi.Pointer)>(); - - int NSExtraRefCount( - ffi.Pointer object, - ) { - return _NSExtraRefCount( - object, - ); - } - - late final _NSExtraRefCountPtr = - _lookup)>>( - 'NSExtraRefCount'); - late final _NSExtraRefCount = - _NSExtraRefCountPtr.asFunction)>(); - ffi.Pointer _sel_registerName( ffi.Pointer str, ) { @@ -1147,41 +267,43 @@ class NativeObjCLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer<_NSZone>)>(); - int _objc_msgSend_7( + bool _objc_msgSend_7( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { return __objc_msgSend_7( - obj, - sel, - aSelector, - ); + obj, + sel, + aSelector, + ) != + 0; } late final __objc_msgSend_7Ptr = _lookup< ffi.NativeFunction< - BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_8( + bool _objc_msgSend_8( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer protocol, ) { return __objc_msgSend_8( - obj, - sel, - protocol, - ); + obj, + sel, + protocol, + ) != + 0; } late final __objc_msgSend_8Ptr = _lookup< ffi.NativeFunction< - BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -1327,78 +449,82 @@ class NativeObjCLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_16( + bool _objc_msgSend_16( ffi.Pointer obj, ffi.Pointer sel, ) { return __objc_msgSend_16( - obj, - sel, - ); + obj, + sel, + ) != + 0; } late final __objc_msgSend_16Ptr = _lookup< ffi.NativeFunction< - BOOL Function( + ffi.Uint8 Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_17( + bool _objc_msgSend_17( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aClass, ) { return __objc_msgSend_17( - obj, - sel, - aClass, - ); + obj, + sel, + aClass, + ) != + 0; } late final __objc_msgSend_17Ptr = _lookup< ffi.NativeFunction< - BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_18( + bool _objc_msgSend_18( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer sel1, ) { return __objc_msgSend_18( - obj, - sel, - sel1, - ); + obj, + sel, + sel1, + ) != + 0; } late final __objc_msgSend_18Ptr = _lookup< ffi.NativeFunction< - BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_19( + bool _objc_msgSend_19( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer sel1, ) { return __objc_msgSend_19( - obj, - sel, - sel1, - ); + obj, + sel, + sel1, + ) != + 0; } late final __objc_msgSend_19Ptr = _lookup< ffi.NativeFunction< - BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -1944,19 +1070,19 @@ class NativeObjCLibrary { ffi.Pointer _objc_msgSend_47( ffi.Pointer obj, ffi.Pointer sel, - int value, + bool value, ) { return __objc_msgSend_47( obj, sel, - value, + value ? 1 : 0, ); } late final __objc_msgSend_47Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, BOOL)>>('objc_msgSend'); + ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); late final __objc_msgSend_47 = __objc_msgSend_47Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); @@ -2436,19 +1562,19 @@ class NativeObjCLibrary { void _objc_msgSend_74( ffi.Pointer obj, ffi.Pointer sel, - int value, + bool value, ) { return __objc_msgSend_74( obj, sel, - value, + value ? 1 : 0, ); } late final __objc_msgSend_74Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, - BOOL)>>('objc_msgSend'); + ffi.Uint8)>>('objc_msgSend'); late final __objc_msgSend_74 = __objc_msgSend_74Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); @@ -2546,21 +1672,22 @@ class NativeObjCLibrary { int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_80( + bool _objc_msgSend_80( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer number, ) { return __objc_msgSend_80( - obj, - sel, - number, - ); + obj, + sel, + number, + ) != + 0; } late final __objc_msgSend_80Ptr = _lookup< ffi.NativeFunction< - BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -2586,66 +1713,6 @@ class NativeObjCLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - NSRange NSUnionRange( - NSRange range1, - NSRange range2, - ) { - return _NSUnionRange( - range1, - range2, - ); - } - - late final _NSUnionRangePtr = - _lookup>( - 'NSUnionRange'); - late final _NSUnionRange = - _NSUnionRangePtr.asFunction(); - - NSRange NSIntersectionRange( - NSRange range1, - NSRange range2, - ) { - return _NSIntersectionRange( - range1, - range2, - ); - } - - late final _NSIntersectionRangePtr = - _lookup>( - 'NSIntersectionRange'); - late final _NSIntersectionRange = - _NSIntersectionRangePtr.asFunction(); - - ffi.Pointer NSStringFromRange( - NSRange range, - ) { - return _NSStringFromRange( - range, - ); - } - - late final _NSStringFromRangePtr = - _lookup Function(NSRange)>>( - 'NSStringFromRange'); - late final _NSStringFromRange = _NSStringFromRangePtr.asFunction< - ffi.Pointer Function(NSRange)>(); - - NSRange NSRangeFromString( - ffi.Pointer aString, - ) { - return _NSRangeFromString( - aString, - ); - } - - late final _NSRangeFromStringPtr = - _lookup)>>( - 'NSRangeFromString'); - late final _NSRangeFromString = _NSRangeFromStringPtr.asFunction< - NSRange Function(ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_82( ffi.Pointer obj, ffi.Pointer sel, @@ -2871,21 +1938,22 @@ class NativeObjCLibrary { instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_93( + bool _objc_msgSend_93( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer indexSet, ) { return __objc_msgSend_93( - obj, - sel, - indexSet, - ); + obj, + sel, + indexSet, + ) != + 0; } late final __objc_msgSend_93Ptr = _lookup< ffi.NativeFunction< - BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_93 = __objc_msgSend_93Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -2957,59 +2025,62 @@ class NativeObjCLibrary { late final __objc_msgSend_96 = __objc_msgSend_96Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); - int _objc_msgSend_97( + bool _objc_msgSend_97( ffi.Pointer obj, ffi.Pointer sel, int value, ) { return __objc_msgSend_97( - obj, - sel, - value, - ); + obj, + sel, + value, + ) != + 0; } late final __objc_msgSend_97Ptr = _lookup< ffi.NativeFunction< - BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); late final __objc_msgSend_97 = __objc_msgSend_97Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); - int _objc_msgSend_98( + bool _objc_msgSend_98( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ) { return __objc_msgSend_98( - obj, - sel, - range, - ); + obj, + sel, + range, + ) != + 0; } late final __objc_msgSend_98Ptr = _lookup< ffi.NativeFunction< - BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, NSRange)>>('objc_msgSend'); late final __objc_msgSend_98 = __objc_msgSend_98Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); - int _objc_msgSend_99( + bool _objc_msgSend_99( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer indexSet, ) { return __objc_msgSend_99( - obj, - sel, - indexSet, - ); + obj, + sel, + indexSet, + ) != + 0; } late final __objc_msgSend_99Ptr = _lookup< ffi.NativeFunction< - BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_99 = __objc_msgSend_99Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -3784,43 +2855,45 @@ class NativeObjCLibrary { void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_134( + bool _objc_msgSend_134( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, ) { return __objc_msgSend_134( - obj, - sel, - typeIdentifier, - ); + obj, + sel, + typeIdentifier, + ) != + 0; } late final __objc_msgSend_134Ptr = _lookup< ffi.NativeFunction< - BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_134 = __objc_msgSend_134Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_135( + bool _objc_msgSend_135( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, int fileOptions, ) { return __objc_msgSend_135( - obj, - sel, - typeIdentifier, - fileOptions, - ); + obj, + sel, + typeIdentifier, + fileOptions, + ) != + 0; } late final __objc_msgSend_135Ptr = _lookup< ffi.NativeFunction< - BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend'); late final __objc_msgSend_135 = __objc_msgSend_135Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -4018,21 +3091,22 @@ class NativeObjCLibrary { void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); - int _objc_msgSend_144( + bool _objc_msgSend_144( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aClass, ) { return __objc_msgSend_144( - obj, - sel, - aClass, - ); + obj, + sel, + aClass, + ) != + 0; } late final __objc_msgSend_144Ptr = _lookup< ffi.NativeFunction< - BOOL Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_144 = __objc_msgSend_144Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -4546,13 +3620,13 @@ class NativeObjCLibrary { int _objc_msgSend_154( ffi.Pointer obj, ffi.Pointer sel, - int useIntVals, + bool useIntVals, ffi.Pointer other, ) { return __objc_msgSend_154( obj, sel, - useIntVals, + useIntVals ? 1 : 0, other, ); } @@ -4560,7 +3634,7 @@ class NativeObjCLibrary { late final __objc_msgSend_154Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - BOOL, ffi.Pointer)>>('objc_msgSend'); + ffi.Uint8, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_154 = __objc_msgSend_154Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); @@ -4594,24 +3668,6 @@ class NativeObjCLibrary { ffi.Pointer)>(); } -class ObjCObject extends ffi.Opaque {} - -class ObjCSel extends ffi.Opaque {} - -typedef NSUInteger = pkg_ffi.UnsignedLong; - -class __va_list_tag extends ffi.Struct { - @pkg_ffi.UnsignedInt() - external int gp_offset; - - @pkg_ffi.UnsignedInt() - external int fp_offset; - - external ffi.Pointer overflow_arg_area; - - external ffi.Pointer reg_save_area; -} - abstract class NSComparisonResult { static const int NSOrderedAscending = -1; static const int NSOrderedSame = 0; @@ -4658,7 +3714,6 @@ class CFRange extends ffi.Struct { class __CFNull extends ffi.Opaque {} -typedef CFTypeID = pkg_ffi.UnsignedLong; typedef CFNullRef = ffi.Pointer<__CFNull>; class __CFAllocator extends ffi.Opaque {} @@ -4708,14 +3763,6 @@ typedef CFAllocatorDeallocateCallBack = ffi.Pointer< typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< ffi.NativeFunction< CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; -typedef CFTypeRef = ffi.Pointer; -typedef Boolean = pkg_ffi.UnsignedChar; -typedef CFHashCode = pkg_ffi.UnsignedLong; -typedef NSZone = _NSZone; - -class _NSZone extends ffi.Opaque {} - -typedef BOOL = pkg_ffi.SignedChar; ffi.Pointer _registerName(NativeObjCLibrary _lib, String name) { final cstr = name.toNativeUtf8(); @@ -4898,7 +3945,7 @@ class NSObject extends _ObjCWrapper { } static ffi.Pointer? _sel_instancesRespondToSelector; - static int instancesRespondToSelector( + static bool instancesRespondToSelector( NativeObjCLibrary _lib, ffi.Pointer aSelector) { _class ??= _getClass(_lib, "NSObject"); _sel_instancesRespondToSelector ??= @@ -4908,7 +3955,7 @@ class NSObject extends _ObjCWrapper { } static ffi.Pointer? _sel_conformsToProtocol; - static int conformsToProtocol(NativeObjCLibrary _lib, NSObject protocol) { + static bool conformsToProtocol(NativeObjCLibrary _lib, NSObject protocol) { _class ??= _getClass(_lib, "NSObject"); _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); return _lib._objc_msgSend_8( @@ -4976,26 +4023,26 @@ class NSObject extends _ObjCWrapper { } static ffi.Pointer? _sel_allowsWeakReference; - int allowsWeakReference() { + bool allowsWeakReference() { _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); return _lib._objc_msgSend_16(_id, _sel_allowsWeakReference!); } static ffi.Pointer? _sel_retainWeakReference; - int retainWeakReference() { + bool retainWeakReference() { _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); return _lib._objc_msgSend_16(_id, _sel_retainWeakReference!); } static ffi.Pointer? _sel_isSubclassOfClass; - static int isSubclassOfClass(NativeObjCLibrary _lib, NSObject aClass) { + static bool isSubclassOfClass(NativeObjCLibrary _lib, NSObject aClass) { _class ??= _getClass(_lib, "NSObject"); _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); return _lib._objc_msgSend_17(_class!, _sel_isSubclassOfClass!, aClass._id); } static ffi.Pointer? _sel_resolveClassMethod; - static int resolveClassMethod( + static bool resolveClassMethod( NativeObjCLibrary _lib, ffi.Pointer sel) { _class ??= _getClass(_lib, "NSObject"); _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); @@ -5003,7 +4050,7 @@ class NSObject extends _ObjCWrapper { } static ffi.Pointer? _sel_resolveInstanceMethod; - static int resolveInstanceMethod( + static bool resolveInstanceMethod( NativeObjCLibrary _lib, ffi.Pointer sel) { _class ??= _getClass(_lib, "NSObject"); _sel_resolveInstanceMethod ??= @@ -5052,6 +4099,13 @@ class NSObject extends _ObjCWrapper { } typedef instancetype = ffi.Pointer; + +class ObjCObject extends ffi.Opaque {} + +class _NSZone extends ffi.Opaque {} + +class ObjCSel extends ffi.Opaque {} + typedef IMP = ffi.Pointer>; class NSMethodSignature extends _ObjCWrapper { @@ -5065,6 +4119,8 @@ class NSMethodSignature extends _ObjCWrapper { } } +typedef NSUInteger = pkg_ffi.UnsignedLong; + class NSString extends NSObject { NSString._(ffi.Pointer id, NativeObjCLibrary lib) : super._(id, lib); @@ -5264,7 +4320,7 @@ class NSNumber extends NSValue { } static ffi.Pointer? _sel_initWithBool; - NSNumber initWithBool(int value) { + NSNumber initWithBool(bool value) { _sel_initWithBool ??= _registerName(_lib, "initWithBool:"); final _ret = _lib._objc_msgSend_47(_id, _sel_initWithBool!, value); return NSNumber._(_ret, _lib); @@ -5432,13 +4488,13 @@ class NSNumber extends NSValue { } static ffi.Pointer? _sel_boolValue; - int get boolValue { + bool get boolValue { _sel_boolValue ??= _registerName(_lib, "boolValue"); return _lib._objc_msgSend_16(_id, _sel_boolValue!); } static ffi.Pointer? _sel_boolValue1; - set boolValue(int value) { + set boolValue(bool value) { _sel_boolValue1 ??= _registerName(_lib, "setBoolValue:"); return _lib._objc_msgSend_74(_id, _sel_boolValue1!, value); } @@ -5488,7 +4544,7 @@ class NSNumber extends NSValue { } static ffi.Pointer? _sel_isEqualToNumber; - int isEqualToNumber(NSObject number) { + bool isEqualToNumber(NSObject number) { _sel_isEqualToNumber ??= _registerName(_lib, "isEqualToNumber:"); return _lib._objc_msgSend_80(_id, _sel_isEqualToNumber!, number._id); } @@ -5527,8 +4583,6 @@ class _NSRange extends ffi.Struct { external int length; } -typedef NSRange = _NSRange; - class NSFastEnumerationState extends ffi.Struct { @pkg_ffi.UnsignedLong() external int state; @@ -5745,7 +4799,7 @@ class NSIndexSet extends NSObject { } static ffi.Pointer? _sel_isEqualToIndexSet; - int isEqualToIndexSet(NSObject indexSet) { + bool isEqualToIndexSet(NSObject indexSet) { _sel_isEqualToIndexSet ??= _registerName(_lib, "isEqualToIndexSet:"); return _lib._objc_msgSend_93(_id, _sel_isEqualToIndexSet!, indexSet._id); } @@ -5831,26 +4885,26 @@ class NSIndexSet extends NSObject { } static ffi.Pointer? _sel_containsIndex; - int containsIndex(int value) { + bool containsIndex(int value) { _sel_containsIndex ??= _registerName(_lib, "containsIndex:"); return _lib._objc_msgSend_97(_id, _sel_containsIndex!, value); } static ffi.Pointer? _sel_containsIndexesInRange; - int containsIndexesInRange(NSRange range) { + bool containsIndexesInRange(NSRange range) { _sel_containsIndexesInRange ??= _registerName(_lib, "containsIndexesInRange:"); return _lib._objc_msgSend_98(_id, _sel_containsIndexesInRange!, range); } static ffi.Pointer? _sel_containsIndexes; - int containsIndexes(NSObject indexSet) { + bool containsIndexes(NSObject indexSet) { _sel_containsIndexes ??= _registerName(_lib, "containsIndexes:"); return _lib._objc_msgSend_99(_id, _sel_containsIndexes!, indexSet._id); } static ffi.Pointer? _sel_intersectsIndexesInRange; - int intersectsIndexesInRange(NSRange range) { + bool intersectsIndexesInRange(NSRange range) { _sel_intersectsIndexesInRange ??= _registerName(_lib, "intersectsIndexesInRange:"); return _lib._objc_msgSend_98(_id, _sel_intersectsIndexesInRange!, range); @@ -5969,6 +5023,7 @@ class NSIndexSet extends NSObject { } } +typedef NSRange = _NSRange; typedef NSRangePointer = ffi.Pointer; class NSMutableIndexSet extends NSIndexSet { @@ -6161,13 +5216,13 @@ class NSOrderedCollectionDifference extends NSObject { } static ffi.Pointer? _sel_hasChanges; - int get hasChanges { + bool get hasChanges { _sel_hasChanges ??= _registerName(_lib, "hasChanges"); return _lib._objc_msgSend_16(_id, _sel_hasChanges!); } static ffi.Pointer? _sel_hasChanges1; - set hasChanges(int value) { + set hasChanges(bool value) { _sel_hasChanges1 ??= _registerName(_lib, "setHasChanges:"); return _lib._objc_msgSend_74(_id, _sel_hasChanges1!, value); } @@ -6427,7 +5482,7 @@ class NSItemProvider extends NSObject { } static ffi.Pointer? _sel_hasItemConformingToTypeIdentifier; - int hasItemConformingToTypeIdentifier(NSObject typeIdentifier) { + bool hasItemConformingToTypeIdentifier(NSObject typeIdentifier) { _sel_hasItemConformingToTypeIdentifier ??= _registerName(_lib, "hasItemConformingToTypeIdentifier:"); return _lib._objc_msgSend_134( @@ -6435,7 +5490,7 @@ class NSItemProvider extends NSObject { } static ffi.Pointer? _sel_hasRepresentationConformingToTypeIdentifier; - int hasRepresentationConformingToTypeIdentifier( + bool hasRepresentationConformingToTypeIdentifier( NSObject typeIdentifier, int fileOptions) { _sel_hasRepresentationConformingToTypeIdentifier ??= _registerName( _lib, "hasRepresentationConformingToTypeIdentifier:fileOptions:"); @@ -6523,7 +5578,7 @@ class NSItemProvider extends NSObject { } static ffi.Pointer? _sel_canLoadObjectOfClass; - int canLoadObjectOfClass(NSObject aClass) { + bool canLoadObjectOfClass(NSObject aClass) { _sel_canLoadObjectOfClass ??= _registerName(_lib, "canLoadObjectOfClass:"); return _lib._objc_msgSend_144(_id, _sel_canLoadObjectOfClass!, aClass._id); } @@ -6797,7 +5852,7 @@ class Foo extends NSObject { } static ffi.Pointer? _sel_multiply; - int multiply(int useIntVals, NSObject other) { + int multiply(bool useIntVals, NSObject other) { _sel_multiply ??= _registerName(_lib, "multiply:withOtherFoo:"); return _lib._objc_msgSend_154(_id, _sel_multiply!, useIntVals, other._id); } From fc201ac2a1ef93de70710e17643209fafc5f9cbe Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Wed, 13 Apr 2022 10:16:54 -0700 Subject: [PATCH 114/276] [ffigen] Add support for readonly and class properties (#314) --- .../src/code_generator/objc_interface.dart | 102 +- .../clang_bindings/clang_bindings.dart | 41 + .../sub_parsers/objcinterfacedecl_parser.dart | 41 +- .../_expected_objc_interface_bindings.dart | 45 +- .../test/header_parser_tests/objc_interface.h | 9 + .../native_objc_test/native_objc_test.dart | 13 + .../test/native_objc_test/native_objc_test.m | 21 + .../native_objc_test_bindings.dart | 1824 ++++++----------- pkgs/ffigen/tool/libclang_config.yaml | 2 + 9 files changed, 861 insertions(+), 1237 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index f7f15b9cc5..98ba81d81b 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -164,6 +164,18 @@ class ObjCInterface extends BindingType { @override BindingString toBindingString(Writer w) { + String paramsToString(List params, + {required bool isStatic}) { + final List stringParams = []; + + if (isStatic) { + stringParams.add('${w.className} _lib'); + } + stringParams.addAll( + params.map((p) => '${_getConvertedType(p.type, w, name)} ${p.name}')); + return '(' + stringParams.join(", ") + ')'; + } + final s = StringBuffer(); if (dartDoc != null) { s.write(makeDartDoc(dartDoc!)); @@ -199,7 +211,7 @@ class ObjCInterface extends BindingType { for (final m in methods) { final methodName = m._getDartMethodName(uniqueNamer); final selName = uniqueNamer.makeUnique('_sel_$methodName'); - final isStatic = m.kind == ObjCMethodKind.classMethod; + final isStatic = m.isClass; final returnType = m.returnType!; // SEL object for the method. @@ -209,35 +221,53 @@ class ObjCInterface extends BindingType { if (m.dartDoc != null) { s.write(makeDartDoc(m.dartDoc!)); } - if (!isStatic && (superType?.hasMethod(m) ?? false)) { - s.write(' @override\n'); - } + s.write(' '); - if (isStatic) s.write('static '); - if (m.kind == ObjCMethodKind.propertySetter) { - s.write('set '); + if (isStatic) { + s.write('static '); + s.write(_getConvertedType(returnType, w, name)); + + switch (m.kind) { + case ObjCMethodKind.method: + // static returnType methodName(NativeLibrary _lib, ...) + s.write(' $methodName'); + break; + case ObjCMethodKind.propertyGetter: + // static returnType getMethodName(NativeLibrary _lib) + s.write(' get'); + s.write(methodName[0].toUpperCase() + methodName.substring(1)); + break; + case ObjCMethodKind.propertySetter: + // static void setMethodName(NativeLibrary _lib, ...) + s.write(' set'); + s.write(methodName[0].toUpperCase() + methodName.substring(1)); + break; + } + s.write(paramsToString(m.params, isStatic: true)); } else { - s.write('${_getConvertedType(returnType, w, name)} '); - } - if (m.kind == ObjCMethodKind.propertyGetter) s.write('get '); - s.write(methodName); - if (m.kind != ObjCMethodKind.propertyGetter) { - s.write('('); - var first = true; - if (isStatic) { - first = false; - s.write('$natLib _lib'); + if (superType?.hasMethod(m) ?? false) { + s.write('@override\n '); } - for (final p in m.params) { - if (first) { - first = false; - } else { - s.write(', '); - } - s.write('${_getConvertedType(p.type, w, name)} ${p.name}'); + switch (m.kind) { + case ObjCMethodKind.method: + // returnType methodName(...) + s.write(_getConvertedType(returnType, w, name)); + s.write(' $methodName'); + s.write(paramsToString(m.params, isStatic: false)); + break; + case ObjCMethodKind.propertyGetter: + // returnType get methodName + s.write(_getConvertedType(returnType, w, name)); + s.write(' get $methodName'); + break; + case ObjCMethodKind.propertySetter: + // set methodName(...) + s.write('set $methodName'); + s.write(paramsToString(m.params, isStatic: false)); + break; } - s.write(')'); } + s.write(' {\n'); // Implementation. @@ -247,8 +277,12 @@ class ObjCInterface extends BindingType { } s.write(' $selName ??= ' '${_builtInFunctions.registerName}(_lib, "${m.originalName}");\n'); - final convertReturn = _needsConverting(returnType); - s.write(' ${convertReturn ? 'final _ret = ' : 'return '}'); + final convertReturn = m.kind != ObjCMethodKind.propertySetter && + _needsConverting(returnType); + + if (returnType != NativeType(SupportedNativeType.Void)) { + s.write(' ${convertReturn ? 'final _ret = ' : 'return '}'); + } s.write('_lib.${m.msgSend!.name}('); s.write(isStatic ? '_class!' : '_id'); s.write(', $selName!'); @@ -320,7 +354,7 @@ class ObjCInterface extends BindingType { void addMethod(ObjCMethod method) { methods.add(method); - if (method.kind == ObjCMethodKind.classMethod) { + if (method.kind == ObjCMethodKind.method && method.isClass) { classMethods[method.originalName] ??= method; } } @@ -339,7 +373,8 @@ class ObjCInterface extends BindingType { void _addNSStringMethods() { addMethodIfMissing(ObjCMethod( originalName: 'stringWithCString:encoding:', - kind: ObjCMethodKind.classMethod, + kind: ObjCMethodKind.method, + isClass: true, returnType: this, params_: [ ObjCMethodParam(PointerType(charType), 'cString'), @@ -348,7 +383,8 @@ class ObjCInterface extends BindingType { )); addMethodIfMissing(ObjCMethod( originalName: 'UTF8String', - kind: ObjCMethodKind.instanceMethod, + kind: ObjCMethodKind.method, + isClass: false, returnType: PointerType(charType), params_: [], )); @@ -397,8 +433,7 @@ class ObjCInterface extends BindingType { } enum ObjCMethodKind { - instanceMethod, - classMethod, + method, propertyGetter, propertySetter, } @@ -406,6 +441,7 @@ enum ObjCMethodKind { class ObjCProperty { final String originalName; String? dartName; + ObjCProperty(this.originalName); } @@ -416,6 +452,7 @@ class ObjCMethod { Type? returnType; final List params; final ObjCMethodKind kind; + final bool isClass; Func? msgSend; ObjCMethod({ @@ -423,6 +460,7 @@ class ObjCMethod { this.property, this.dartDoc, required this.kind, + required this.isClass, this.returnType, List? params_, }) : params = params_ ?? []; diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 0b76fcb432..0075ca912c 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -1001,6 +1001,29 @@ class Clang { late final _clang_getCursorDefinition = _clang_getCursorDefinitionPtr.asFunction(); + /// 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( + C, + reserved, + ); + } + + late final _clang_Cursor_getObjCPropertyAttributesPtr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedInt Function(CXCursor, + pkg_ffi.UnsignedInt)>>('clang_Cursor_getObjCPropertyAttributes'); + late final _clang_Cursor_getObjCPropertyAttributes = + _clang_Cursor_getObjCPropertyAttributesPtr + .asFunction(); + /// Given a cursor that represents a property declaration, return the /// name of the method that implements the getter. CXString clang_Cursor_getObjCPropertyGetterName( @@ -2460,6 +2483,24 @@ typedef CXCursorVisitor = ffi.Pointer< /// to various callbacks and visitors. typedef CXClientData = ffi.Pointer; +/// Property attributes for a \c 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; +} + abstract class CXEvalResultKind { static const int CXEval_Int = 1; static const int CXEval_Float = 2; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index cdd7914743..26dd1b398a 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -102,7 +102,18 @@ void _parseProperty(clang_types.CXCursor cursor) { final fieldName = cursor.spelling(); final fieldType = cursor.type().toCodeGenType(); final dartDoc = getCursorDocComment(cursor); + + final propertyAttributes = + clang.clang_Cursor_getObjCPropertyAttributes(cursor, 0); + final isClass = propertyAttributes & + clang_types.CXObjCPropertyAttrKind.CXObjCPropertyAttr_class > + 0; + final isReadOnly = propertyAttributes & + clang_types.CXObjCPropertyAttrKind.CXObjCPropertyAttr_readonly > + 0; + final property = ObjCProperty(fieldName); + _logger.fine(' > Property: ' '$fieldType $fieldName ${cursor.completeStringRepr()}'); @@ -113,21 +124,24 @@ void _parseProperty(clang_types.CXCursor cursor) { property: property, dartDoc: dartDoc, kind: ObjCMethodKind.propertyGetter, + isClass: isClass, ); getter.returnType = fieldType; itf.addMethod(getter); - final setter = ObjCMethod( - originalName: clang - .clang_Cursor_getObjCPropertySetterName(cursor) - .toStringAndDispose(), - property: property, - dartDoc: dartDoc, - kind: ObjCMethodKind.propertySetter, - ); - setter.returnType = NativeType(SupportedNativeType.Void); - setter.params.add(ObjCMethodParam(fieldType, 'value')); - itf.addMethod(setter); + if (!isReadOnly) { + final setter = ObjCMethod( + originalName: clang + .clang_Cursor_getObjCPropertySetterName(cursor) + .toStringAndDispose(), + property: property, + dartDoc: dartDoc, + kind: ObjCMethodKind.propertySetter, + isClass: isClass); + setter.returnType = NativeType(SupportedNativeType.Void); + setter.params.add(ObjCMethodParam(fieldType, 'value')); + itf.addMethod(setter); + } } void _parseMethod(clang_types.CXCursor cursor) { @@ -136,9 +150,8 @@ void _parseMethod(clang_types.CXCursor cursor) { final method = ObjCMethod( originalName: cursor.spelling(), dartDoc: getCursorDocComment(cursor), - kind: isClassMethod - ? ObjCMethodKind.classMethod - : ObjCMethodKind.instanceMethod, + kind: ObjCMethodKind.method, + isClass: isClassMethod, ); final parsed = _ParsedObjCMethod(method); _logger.fine(' > ${isClassMethod ? 'Class' : 'Instance'} method: ' diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart index 8d9273f447..da35a90ed8 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart @@ -677,7 +677,36 @@ class Foo extends NSObject { static ffi.Pointer? _sel_someProperty1; set someProperty(int value) { _sel_someProperty1 ??= _registerName(_lib, "setSomeProperty:"); - return _lib._objc_msgSend_27(_id, _sel_someProperty1!, value); + _lib._objc_msgSend_27(_id, _sel_someProperty1!, value); + } + + static ffi.Pointer? _sel_readOnlyProperty; + int get readOnlyProperty { + _sel_readOnlyProperty ??= _registerName(_lib, "readOnlyProperty"); + return _lib._objc_msgSend_26(_id, _sel_readOnlyProperty!); + } + + static ffi.Pointer? _sel_classReadOnlyProperty; + static int getClassReadOnlyProperty(NativeLibrary _lib) { + _class ??= _getClass(_lib, "Foo"); + _sel_classReadOnlyProperty ??= _registerName(_lib, "classReadOnlyProperty"); + return _lib._objc_msgSend_26(_class!, _sel_classReadOnlyProperty!); + } + + static ffi.Pointer? _sel_classReadWriteProperty; + static int getClassReadWriteProperty(NativeLibrary _lib) { + _class ??= _getClass(_lib, "Foo"); + _sel_classReadWriteProperty ??= + _registerName(_lib, "classReadWriteProperty"); + return _lib._objc_msgSend_26(_class!, _sel_classReadWriteProperty!); + } + + static ffi.Pointer? _sel_classReadWriteProperty1; + static void setClassReadWriteProperty(NativeLibrary _lib, int value) { + _class ??= _getClass(_lib, "Foo"); + _sel_classReadWriteProperty1 ??= + _registerName(_lib, "setClassReadWriteProperty:"); + _lib._objc_msgSend_27(_class!, _sel_classReadWriteProperty1!, value); } static ffi.Pointer? _sel_aClassMethod; @@ -726,14 +755,14 @@ class NSObject extends _ObjCWrapper { static void load(NativeLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_load ??= _registerName(_lib, "load"); - return _lib._objc_msgSend_0(_class!, _sel_load!); + _lib._objc_msgSend_0(_class!, _sel_load!); } static ffi.Pointer? _sel_initialize; static void initialize(NativeLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_initialize ??= _registerName(_lib, "initialize"); - return _lib._objc_msgSend_0(_class!, _sel_initialize!); + _lib._objc_msgSend_0(_class!, _sel_initialize!); } static ffi.Pointer? _sel_init; @@ -770,13 +799,13 @@ class NSObject extends _ObjCWrapper { static ffi.Pointer? _sel_dealloc; void dealloc() { _sel_dealloc ??= _registerName(_lib, "dealloc"); - return _lib._objc_msgSend_0(_id, _sel_dealloc!); + _lib._objc_msgSend_0(_id, _sel_dealloc!); } static ffi.Pointer? _sel_finalize; void finalize() { _sel_finalize ??= _registerName(_lib, "finalize"); - return _lib._objc_msgSend_0(_id, _sel_finalize!); + _lib._objc_msgSend_0(_id, _sel_finalize!); } static ffi.Pointer? _sel_copy; @@ -848,8 +877,7 @@ class NSObject extends _ObjCWrapper { void doesNotRecognizeSelector(ffi.Pointer aSelector) { _sel_doesNotRecognizeSelector ??= _registerName(_lib, "doesNotRecognizeSelector:"); - return _lib._objc_msgSend_11( - _id, _sel_doesNotRecognizeSelector!, aSelector); + _lib._objc_msgSend_11(_id, _sel_doesNotRecognizeSelector!, aSelector); } static ffi.Pointer? _sel_forwardingTargetForSelector; @@ -864,8 +892,7 @@ class NSObject extends _ObjCWrapper { static ffi.Pointer? _sel_forwardInvocation; void forwardInvocation(NSObject anInvocation) { _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); - return _lib._objc_msgSend_13( - _id, _sel_forwardInvocation!, anInvocation._id); + _lib._objc_msgSend_13(_id, _sel_forwardInvocation!, anInvocation._id); } static ffi.Pointer? _sel_methodSignatureForSelector; diff --git a/pkgs/ffigen/test/header_parser_tests/objc_interface.h b/pkgs/ffigen/test/header_parser_tests/objc_interface.h index ee299bfa7f..9af0352ca6 100644 --- a/pkgs/ffigen/test/header_parser_tests/objc_interface.h +++ b/pkgs/ffigen/test/header_parser_tests/objc_interface.h @@ -7,6 +7,15 @@ // This is a property. We generate getters and setters for them. @property int32_t someProperty; +// This should only generate a getter. +@property (readonly) int32_t readOnlyProperty; + +// This should only generate a getter static function. +@property (class, readonly) int32_t classReadOnlyProperty; + +// This should generate getter and setter static functions. +@property (class) int32_t classReadWriteProperty; + // This is a class method, so becomes a static function. + (Foo*)aClassMethod:(double)someArg; diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart index ada15b1519..5e16be57b3 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart @@ -81,4 +81,17 @@ void main() { expect(str3.toString(), "HelloWorld!"); }); }); + + test('Instance read-only property', () { + expect(Foo.makeFoo(lib, 42).readOnlyProperty, 7); + }); + + test('Class read-only property', () { + expect(Foo.getClassReadOnlyProperty(lib), 42); + }); + + test('Class read-write property', () { + Foo.setClassReadWriteProperty(lib, 101); + expect(Foo.getClassReadWriteProperty(lib), 101); + }); } diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test.m b/pkgs/ffigen/test/native_objc_test/native_objc_test.m index 207282ae59..549cf359bb 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test.m +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test.m @@ -6,6 +6,9 @@ @interface Foo : NSObject { } @property int32_t intVal; +@property (readonly) int32_t readOnlyProperty; +@property (class, readonly) int32_t classReadOnlyProperty; +@property (class) int32_t classReadWriteProperty; + (Foo*)makeFoo:(double)x; @@ -17,6 +20,24 @@ - (void)setDoubleVal:(double)x; @implementation Foo +static int32_t _classReadWriteProperty = 0; + +- (int32_t)readOnlyProperty { + return 7; +} + ++ (int32_t)classReadOnlyProperty { + return 42; +} + ++ (int32_t)classReadWriteProperty { + return _classReadWriteProperty; +} + ++ (void)setClassReadWriteProperty:(int32_t)x { + _classReadWriteProperty = x; +} + + (Foo*)makeFoo:(double)x { Foo* foo = [Foo new]; foo->doubleVal = x; diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart index 0643f706b2..151834aa38 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart @@ -583,71 +583,52 @@ class NativeObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_23( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_23( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_23Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - int _objc_msgSend_24( + int _objc_msgSend_23( ffi.Pointer obj, ffi.Pointer sel, int index, ) { - return __objc_msgSend_24( + return __objc_msgSend_23( obj, sel, index, ); } - late final __objc_msgSend_24Ptr = _lookup< + late final __objc_msgSend_23Ptr = _lookup< ffi.NativeFunction< unichar Function(ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< + late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); - instancetype _objc_msgSend_25( + instancetype _objc_msgSend_24( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer coder, ) { - return __objc_msgSend_25( + return __objc_msgSend_24( obj, sel, coder, ); } - late final __objc_msgSend_25Ptr = _lookup< + late final __objc_msgSend_24Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< + late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_26( + ffi.Pointer _objc_msgSend_25( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer cString, int enc, ) { - return __objc_msgSend_26( + return __objc_msgSend_25( obj, sel, cString, @@ -655,60 +636,60 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_26Ptr = _lookup< + late final __objc_msgSend_25Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< + late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); - ffi.Pointer _objc_msgSend_27( + ffi.Pointer _objc_msgSend_26( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_27( + return __objc_msgSend_26( obj, sel, ); } - late final __objc_msgSend_27Ptr = _lookup< + late final __objc_msgSend_26Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< + late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_28( + ffi.Pointer _objc_msgSend_27( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_28( + return __objc_msgSend_27( obj, sel, ); } - late final __objc_msgSend_28Ptr = _lookup< + late final __objc_msgSend_27Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_28 = __objc_msgSend_28Ptr.asFunction< + late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_29( + void _objc_msgSend_28( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer value, int size, ) { - return __objc_msgSend_29( + return __objc_msgSend_28( obj, sel, value, @@ -716,116 +697,136 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_29Ptr = _lookup< + late final __objc_msgSend_28Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_29 = __objc_msgSend_29Ptr.asFunction< + late final __objc_msgSend_28 = __objc_msgSend_28Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); - ffi.Pointer _objc_msgSend_30( + ffi.Pointer _objc_msgSend_29( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_30( + return __objc_msgSend_29( obj, sel, ); } - late final __objc_msgSend_30Ptr = _lookup< + late final __objc_msgSend_29Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_30 = __objc_msgSend_30Ptr.asFunction< + late final __objc_msgSend_29 = __objc_msgSend_29Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_31( + instancetype _objc_msgSend_30( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer value, + ffi.Pointer value, + ffi.Pointer type, ) { - return __objc_msgSend_31( + return __objc_msgSend_30( obj, sel, value, + type, ); } - late final __objc_msgSend_31Ptr = _lookup< + late final __objc_msgSend_30Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_30 = __objc_msgSend_30Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + instancetype _objc_msgSend_31( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_31( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_31Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_31 = __objc_msgSend_31Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); instancetype _objc_msgSend_32( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer value, - ffi.Pointer type, + ffi.Pointer coder, ) { return __objc_msgSend_32( obj, sel, - value, - type, + coder, ); } late final __objc_msgSend_32Ptr = _lookup< ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_32 = __objc_msgSend_32Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer)>(); - instancetype _objc_msgSend_33( + ffi.Pointer _objc_msgSend_33( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer coder, + int value, ) { return __objc_msgSend_33( obj, sel, - coder, + value, ); } late final __objc_msgSend_33Ptr = _lookup< ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Char)>>('objc_msgSend'); late final __objc_msgSend_33 = __objc_msgSend_33Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); - instancetype _objc_msgSend_34( + ffi.Pointer _objc_msgSend_34( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer coder, + int value, ) { return __objc_msgSend_34( obj, sel, - coder, + value, ); } late final __objc_msgSend_34Ptr = _lookup< ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedChar)>>('objc_msgSend'); late final __objc_msgSend_34 = __objc_msgSend_34Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); ffi.Pointer _objc_msgSend_35( ffi.Pointer obj, @@ -842,7 +843,7 @@ class NativeObjCLibrary { late final __objc_msgSend_35Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Char)>>('objc_msgSend'); + ffi.Pointer, pkg_ffi.Short)>>('objc_msgSend'); late final __objc_msgSend_35 = __objc_msgSend_35Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); @@ -862,7 +863,7 @@ class NativeObjCLibrary { late final __objc_msgSend_36Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedChar)>>('objc_msgSend'); + ffi.Pointer, pkg_ffi.UnsignedShort)>>('objc_msgSend'); late final __objc_msgSend_36 = __objc_msgSend_36Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); @@ -882,7 +883,7 @@ class NativeObjCLibrary { late final __objc_msgSend_37Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Short)>>('objc_msgSend'); + ffi.Pointer, pkg_ffi.Int)>>('objc_msgSend'); late final __objc_msgSend_37 = __objc_msgSend_37Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); @@ -902,7 +903,7 @@ class NativeObjCLibrary { late final __objc_msgSend_38Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedShort)>>('objc_msgSend'); + ffi.Pointer, pkg_ffi.UnsignedInt)>>('objc_msgSend'); late final __objc_msgSend_38 = __objc_msgSend_38Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); @@ -922,7 +923,7 @@ class NativeObjCLibrary { late final __objc_msgSend_39Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Int)>>('objc_msgSend'); + ffi.Pointer, pkg_ffi.Long)>>('objc_msgSend'); late final __objc_msgSend_39 = __objc_msgSend_39Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); @@ -942,7 +943,7 @@ class NativeObjCLibrary { late final __objc_msgSend_40Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedInt)>>('objc_msgSend'); + ffi.Pointer, pkg_ffi.UnsignedLong)>>('objc_msgSend'); late final __objc_msgSend_40 = __objc_msgSend_40Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); @@ -962,7 +963,7 @@ class NativeObjCLibrary { late final __objc_msgSend_41Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Long)>>('objc_msgSend'); + ffi.Pointer, pkg_ffi.LongLong)>>('objc_msgSend'); late final __objc_msgSend_41 = __objc_msgSend_41Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); @@ -982,7 +983,7 @@ class NativeObjCLibrary { late final __objc_msgSend_42Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedLong)>>('objc_msgSend'); + ffi.Pointer, pkg_ffi.UnsignedLongLong)>>('objc_msgSend'); late final __objc_msgSend_42 = __objc_msgSend_42Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); @@ -990,7 +991,7 @@ class NativeObjCLibrary { ffi.Pointer _objc_msgSend_43( ffi.Pointer obj, ffi.Pointer sel, - int value, + double value, ) { return __objc_msgSend_43( obj, @@ -1002,15 +1003,15 @@ class NativeObjCLibrary { late final __objc_msgSend_43Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.LongLong)>>('objc_msgSend'); + ffi.Pointer, ffi.Float)>>('objc_msgSend'); late final __objc_msgSend_43 = __objc_msgSend_43Ptr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer, ffi.Pointer, double)>(); ffi.Pointer _objc_msgSend_44( ffi.Pointer obj, ffi.Pointer sel, - int value, + double value, ) { return __objc_msgSend_44( obj, @@ -1022,35 +1023,35 @@ class NativeObjCLibrary { late final __objc_msgSend_44Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedLongLong)>>('objc_msgSend'); + ffi.Pointer, ffi.Double)>>('objc_msgSend'); late final __objc_msgSend_44 = __objc_msgSend_44Ptr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer, ffi.Pointer, double)>(); ffi.Pointer _objc_msgSend_45( ffi.Pointer obj, ffi.Pointer sel, - double value, + bool value, ) { return __objc_msgSend_45( obj, sel, - value, + value ? 1 : 0, ); } late final __objc_msgSend_45Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Float)>>('objc_msgSend'); + ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); late final __objc_msgSend_45 = __objc_msgSend_45Ptr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); + ffi.Pointer, ffi.Pointer, int)>(); ffi.Pointer _objc_msgSend_46( ffi.Pointer obj, ffi.Pointer sel, - double value, + int value, ) { return __objc_msgSend_46( obj, @@ -1062,70 +1063,64 @@ class NativeObjCLibrary { late final __objc_msgSend_46Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Double)>>('objc_msgSend'); + ffi.Pointer, NSInteger)>>('objc_msgSend'); late final __objc_msgSend_46 = __objc_msgSend_46Ptr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); + ffi.Pointer, ffi.Pointer, int)>(); ffi.Pointer _objc_msgSend_47( ffi.Pointer obj, ffi.Pointer sel, - bool value, + int value, ) { return __objc_msgSend_47( obj, sel, - value ? 1 : 0, + value, ); } late final __objc_msgSend_47Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); + ffi.Pointer, NSUInteger)>>('objc_msgSend'); late final __objc_msgSend_47 = __objc_msgSend_47Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); - ffi.Pointer _objc_msgSend_48( + int _objc_msgSend_48( ffi.Pointer obj, ffi.Pointer sel, - int value, ) { return __objc_msgSend_48( obj, sel, - value, ); } late final __objc_msgSend_48Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSInteger)>>('objc_msgSend'); + pkg_ffi.Char Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_48 = __objc_msgSend_48Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_49( + int _objc_msgSend_49( ffi.Pointer obj, ffi.Pointer sel, - int value, ) { return __objc_msgSend_49( obj, sel, - value, ); } late final __objc_msgSend_49Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); + pkg_ffi.UnsignedChar Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_49 = __objc_msgSend_49Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); int _objc_msgSend_50( ffi.Pointer obj, @@ -1139,29 +1134,27 @@ class NativeObjCLibrary { late final __objc_msgSend_50Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Char Function( + pkg_ffi.Short Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_50 = __objc_msgSend_50Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_51( + int _objc_msgSend_51( ffi.Pointer obj, ffi.Pointer sel, - int value, ) { return __objc_msgSend_51( obj, sel, - value, ); } late final __objc_msgSend_51Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.Char)>>('objc_msgSend'); + pkg_ffi.UnsignedShort Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_51 = __objc_msgSend_51Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); int _objc_msgSend_52( ffi.Pointer obj, @@ -1175,29 +1168,27 @@ class NativeObjCLibrary { late final __objc_msgSend_52Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedChar Function( + pkg_ffi.Int Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_52 = __objc_msgSend_52Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_53( + int _objc_msgSend_53( ffi.Pointer obj, ffi.Pointer sel, - int value, ) { return __objc_msgSend_53( obj, sel, - value, ); } late final __objc_msgSend_53Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.UnsignedChar)>>('objc_msgSend'); + pkg_ffi.UnsignedInt Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_53 = __objc_msgSend_53Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); int _objc_msgSend_54( ffi.Pointer obj, @@ -1211,29 +1202,27 @@ class NativeObjCLibrary { late final __objc_msgSend_54Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Short Function( + pkg_ffi.Long Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_55( + int _objc_msgSend_55( ffi.Pointer obj, ffi.Pointer sel, - int value, ) { return __objc_msgSend_55( obj, sel, - value, ); } late final __objc_msgSend_55Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.Short)>>('objc_msgSend'); + pkg_ffi.UnsignedLong Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_55 = __objc_msgSend_55Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); int _objc_msgSend_56( ffi.Pointer obj, @@ -1247,31 +1236,29 @@ class NativeObjCLibrary { late final __objc_msgSend_56Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedShort Function( + pkg_ffi.LongLong Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_56 = __objc_msgSend_56Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_57( + int _objc_msgSend_57( ffi.Pointer obj, ffi.Pointer sel, - int value, ) { return __objc_msgSend_57( obj, sel, - value, ); } late final __objc_msgSend_57Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.UnsignedShort)>>('objc_msgSend'); + pkg_ffi.UnsignedLongLong Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_57 = __objc_msgSend_57Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_58( + double _objc_msgSend_58( ffi.Pointer obj, ffi.Pointer sel, ) { @@ -1283,29 +1270,27 @@ class NativeObjCLibrary { late final __objc_msgSend_58Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Float Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_58 = __objc_msgSend_58Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + double Function(ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_59( + double _objc_msgSend_59( ffi.Pointer obj, ffi.Pointer sel, - int value, ) { return __objc_msgSend_59( obj, sel, - value, ); } late final __objc_msgSend_59Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.Int)>>('objc_msgSend'); + ffi.Double Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + double Function(ffi.Pointer, ffi.Pointer)>(); int _objc_msgSend_60( ffi.Pointer obj, @@ -1319,365 +1304,55 @@ class NativeObjCLibrary { late final __objc_msgSend_60Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedInt Function( + NSInteger Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_61( + ffi.Pointer _objc_msgSend_61( ffi.Pointer obj, ffi.Pointer sel, - int value, ) { return __objc_msgSend_61( obj, sel, - value, ); } late final __objc_msgSend_61Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.UnsignedInt)>>('objc_msgSend'); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_61 = __objc_msgSend_61Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - int _objc_msgSend_62( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_62( - obj, - sel, - ); - } - - late final __objc_msgSend_62Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.Long Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_63( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_63( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_63Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.Long)>>('objc_msgSend'); - late final __objc_msgSend_63 = __objc_msgSend_63Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - int _objc_msgSend_64( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_64( - obj, - sel, - ); - } - - late final __objc_msgSend_64Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.UnsignedLong Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_64 = __objc_msgSend_64Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_65( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_65( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_65Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_65 = __objc_msgSend_65Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - int _objc_msgSend_66( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_66( - obj, - sel, - ); - } - - late final __objc_msgSend_66Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.LongLong Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_66 = __objc_msgSend_66Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_67( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_67( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_67Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.LongLong)>>('objc_msgSend'); - late final __objc_msgSend_67 = __objc_msgSend_67Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - int _objc_msgSend_68( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_68( - obj, - sel, - ); - } - - late final __objc_msgSend_68Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.UnsignedLongLong Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_68 = __objc_msgSend_68Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_69( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_69( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_69Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.UnsignedLongLong)>>('objc_msgSend'); - late final __objc_msgSend_69 = __objc_msgSend_69Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - double _objc_msgSend_70( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_70( - obj, - sel, - ); - } - - late final __objc_msgSend_70Ptr = _lookup< - ffi.NativeFunction< - ffi.Float Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_70 = __objc_msgSend_70Ptr.asFunction< - double Function(ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_71( - ffi.Pointer obj, - ffi.Pointer sel, - double value, - ) { - return __objc_msgSend_71( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_71Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Float)>>('objc_msgSend'); - late final __objc_msgSend_71 = __objc_msgSend_71Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, double)>(); - - double _objc_msgSend_72( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_72( - obj, - sel, - ); - } - - late final __objc_msgSend_72Ptr = _lookup< - ffi.NativeFunction< - ffi.Double Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_72 = __objc_msgSend_72Ptr.asFunction< - double Function(ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_73( - ffi.Pointer obj, - ffi.Pointer sel, - double value, - ) { - return __objc_msgSend_73( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_73Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_73 = __objc_msgSend_73Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, double)>(); - - void _objc_msgSend_74( - ffi.Pointer obj, - ffi.Pointer sel, - bool value, - ) { - return __objc_msgSend_74( - obj, - sel, - value ? 1 : 0, - ); - } - - late final __objc_msgSend_74Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_74 = __objc_msgSend_74Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - int _objc_msgSend_75( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_75( - obj, - sel, - ); - } - - late final __objc_msgSend_75Ptr = _lookup< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_75 = __objc_msgSend_75Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_76( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_76( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_76Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_76 = __objc_msgSend_76Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer _objc_msgSend_77( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_77( - obj, - sel, - ); - } - - late final __objc_msgSend_77Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_77 = __objc_msgSend_77Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_78( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_78( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_78Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_78 = __objc_msgSend_78Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int _objc_msgSend_79( + int _objc_msgSend_62( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer otherNumber, ) { - return __objc_msgSend_79( + return __objc_msgSend_62( obj, sel, otherNumber, ); } - late final __objc_msgSend_79Ptr = _lookup< + late final __objc_msgSend_62Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_79 = __objc_msgSend_79Ptr.asFunction< + late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_80( + bool _objc_msgSend_63( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer number, ) { - return __objc_msgSend_80( + return __objc_msgSend_63( obj, sel, number, @@ -1685,152 +1360,113 @@ class NativeObjCLibrary { 0; } - late final __objc_msgSend_80Ptr = _lookup< + late final __objc_msgSend_63Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< + late final __objc_msgSend_63 = __objc_msgSend_63Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_81( + ffi.Pointer _objc_msgSend_64( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer locale, ) { - return __objc_msgSend_81( + return __objc_msgSend_64( obj, sel, locale, ); } - late final __objc_msgSend_81Ptr = _lookup< + late final __objc_msgSend_64Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_81 = __objc_msgSend_81Ptr.asFunction< + late final __objc_msgSend_64 = __objc_msgSend_64Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_82( + ffi.Pointer _objc_msgSend_65( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_82( + return __objc_msgSend_65( obj, sel, ); } - late final __objc_msgSend_82Ptr = _lookup< + late final __objc_msgSend_65Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_82 = __objc_msgSend_82Ptr.asFunction< + late final __objc_msgSend_65 = __objc_msgSend_65Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_83( + ffi.Pointer _objc_msgSend_66( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_83( + return __objc_msgSend_66( obj, sel, ); } - late final __objc_msgSend_83Ptr = _lookup< + late final __objc_msgSend_66Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_83 = __objc_msgSend_83Ptr.asFunction< + late final __objc_msgSend_66 = __objc_msgSend_66Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_84( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_84( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_84Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_84 = __objc_msgSend_84Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int _objc_msgSend_85( + int _objc_msgSend_67( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_85( + return __objc_msgSend_67( obj, sel, ); } - late final __objc_msgSend_85Ptr = _lookup< + late final __objc_msgSend_67Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_85 = __objc_msgSend_85Ptr.asFunction< + late final __objc_msgSend_67 = __objc_msgSend_67Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_86( + ffi.Pointer _objc_msgSend_68( ffi.Pointer obj, ffi.Pointer sel, - int value, ) { - return __objc_msgSend_86( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_86Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_86 = __objc_msgSend_86Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer _objc_msgSend_87( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_87( + return __objc_msgSend_68( obj, sel, ); } - late final __objc_msgSend_87Ptr = _lookup< + late final __objc_msgSend_68Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_87 = __objc_msgSend_87Ptr.asFunction< + late final __objc_msgSend_68 = __objc_msgSend_68Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - instancetype _objc_msgSend_88( + instancetype _objc_msgSend_69( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer anObject, int type, int index, ) { - return __objc_msgSend_88( + return __objc_msgSend_69( obj, sel, anObject, @@ -1839,15 +1475,15 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_88Ptr = _lookup< + late final __objc_msgSend_69Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Int32, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_88 = __objc_msgSend_88Ptr.asFunction< + late final __objc_msgSend_69 = __objc_msgSend_69Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, int)>(); - instancetype _objc_msgSend_89( + instancetype _objc_msgSend_70( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer anObject, @@ -1855,7 +1491,7 @@ class NativeObjCLibrary { int index, int associatedIndex, ) { - return __objc_msgSend_89( + return __objc_msgSend_70( obj, sel, anObject, @@ -1865,7 +1501,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_89Ptr = _lookup< + late final __objc_msgSend_70Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, @@ -1874,76 +1510,76 @@ class NativeObjCLibrary { ffi.Int32, NSUInteger, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_89 = __objc_msgSend_89Ptr.asFunction< + late final __objc_msgSend_70 = __objc_msgSend_70Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, int, int)>(); - instancetype _objc_msgSend_90( + instancetype _objc_msgSend_71( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_90( + return __objc_msgSend_71( obj, sel, value, ); } - late final __objc_msgSend_90Ptr = _lookup< + late final __objc_msgSend_71Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_90 = __objc_msgSend_90Ptr.asFunction< + late final __objc_msgSend_71 = __objc_msgSend_71Ptr.asFunction< instancetype Function( ffi.Pointer, ffi.Pointer, int)>(); - instancetype _objc_msgSend_91( + instancetype _objc_msgSend_72( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ) { - return __objc_msgSend_91( + return __objc_msgSend_72( obj, sel, range, ); } - late final __objc_msgSend_91Ptr = _lookup< + late final __objc_msgSend_72Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_91 = __objc_msgSend_91Ptr.asFunction< + late final __objc_msgSend_72 = __objc_msgSend_72Ptr.asFunction< instancetype Function( ffi.Pointer, ffi.Pointer, NSRange)>(); - instancetype _objc_msgSend_92( + instancetype _objc_msgSend_73( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer indexSet, ) { - return __objc_msgSend_92( + return __objc_msgSend_73( obj, sel, indexSet, ); } - late final __objc_msgSend_92Ptr = _lookup< + late final __objc_msgSend_73Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_92 = __objc_msgSend_92Ptr.asFunction< + late final __objc_msgSend_73 = __objc_msgSend_73Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_93( + bool _objc_msgSend_74( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer indexSet, ) { - return __objc_msgSend_93( + return __objc_msgSend_74( obj, sel, indexSet, @@ -1951,41 +1587,41 @@ class NativeObjCLibrary { 0; } - late final __objc_msgSend_93Ptr = _lookup< + late final __objc_msgSend_74Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_93 = __objc_msgSend_93Ptr.asFunction< + late final __objc_msgSend_74 = __objc_msgSend_74Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_94( + int _objc_msgSend_75( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_94( + return __objc_msgSend_75( obj, sel, value, ); } - late final __objc_msgSend_94Ptr = _lookup< + late final __objc_msgSend_75Ptr = _lookup< ffi.NativeFunction< NSUInteger Function(ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_94 = __objc_msgSend_94Ptr.asFunction< + late final __objc_msgSend_75 = __objc_msgSend_75Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); - int _objc_msgSend_95( + int _objc_msgSend_76( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer indexBuffer, int bufferSize, NSRangePointer range, ) { - return __objc_msgSend_95( + return __objc_msgSend_76( obj, sel, indexBuffer, @@ -1994,7 +1630,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_95Ptr = _lookup< + late final __objc_msgSend_76Ptr = _lookup< ffi.NativeFunction< NSUInteger Function( ffi.Pointer, @@ -2002,35 +1638,35 @@ class NativeObjCLibrary { ffi.Pointer, NSUInteger, NSRangePointer)>>('objc_msgSend'); - late final __objc_msgSend_95 = __objc_msgSend_95Ptr.asFunction< + late final __objc_msgSend_76 = __objc_msgSend_76Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, NSRangePointer)>(); - int _objc_msgSend_96( + int _objc_msgSend_77( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ) { - return __objc_msgSend_96( + return __objc_msgSend_77( obj, sel, range, ); } - late final __objc_msgSend_96Ptr = _lookup< + late final __objc_msgSend_77Ptr = _lookup< ffi.NativeFunction< NSUInteger Function(ffi.Pointer, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_96 = __objc_msgSend_96Ptr.asFunction< + late final __objc_msgSend_77 = __objc_msgSend_77Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); - bool _objc_msgSend_97( + bool _objc_msgSend_78( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_97( + return __objc_msgSend_78( obj, sel, value, @@ -2038,19 +1674,19 @@ class NativeObjCLibrary { 0; } - late final __objc_msgSend_97Ptr = _lookup< + late final __objc_msgSend_78Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_97 = __objc_msgSend_97Ptr.asFunction< + late final __objc_msgSend_78 = __objc_msgSend_78Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); - bool _objc_msgSend_98( + bool _objc_msgSend_79( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ) { - return __objc_msgSend_98( + return __objc_msgSend_79( obj, sel, range, @@ -2058,19 +1694,19 @@ class NativeObjCLibrary { 0; } - late final __objc_msgSend_98Ptr = _lookup< + late final __objc_msgSend_79Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_98 = __objc_msgSend_98Ptr.asFunction< + late final __objc_msgSend_79 = __objc_msgSend_79Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); - bool _objc_msgSend_99( + bool _objc_msgSend_80( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer indexSet, ) { - return __objc_msgSend_99( + return __objc_msgSend_80( obj, sel, indexSet, @@ -2078,41 +1714,41 @@ class NativeObjCLibrary { 0; } - late final __objc_msgSend_99Ptr = _lookup< + late final __objc_msgSend_80Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_99 = __objc_msgSend_99Ptr.asFunction< + late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_100( + void _objc_msgSend_81( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer block, ) { - return __objc_msgSend_100( + return __objc_msgSend_81( obj, sel, block, ); } - late final __objc_msgSend_100Ptr = _lookup< + late final __objc_msgSend_81Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_100 = __objc_msgSend_100Ptr.asFunction< + late final __objc_msgSend_81 = __objc_msgSend_81Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_101( + void _objc_msgSend_82( ffi.Pointer obj, ffi.Pointer sel, int opts, ffi.Pointer block, ) { - return __objc_msgSend_101( + return __objc_msgSend_82( obj, sel, opts, @@ -2120,22 +1756,22 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_101Ptr = _lookup< + late final __objc_msgSend_82Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_101 = __objc_msgSend_101Ptr.asFunction< + late final __objc_msgSend_82 = __objc_msgSend_82Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); - void _objc_msgSend_102( + void _objc_msgSend_83( ffi.Pointer obj, ffi.Pointer sel, NSRange range, int opts, ffi.Pointer block, ) { - return __objc_msgSend_102( + return __objc_msgSend_83( obj, sel, range, @@ -2144,41 +1780,41 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_102Ptr = _lookup< + late final __objc_msgSend_83Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_102 = __objc_msgSend_102Ptr.asFunction< + late final __objc_msgSend_83 = __objc_msgSend_83Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, NSRange, int, ffi.Pointer)>(); - int _objc_msgSend_103( + int _objc_msgSend_84( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer predicate, ) { - return __objc_msgSend_103( + return __objc_msgSend_84( obj, sel, predicate, ); } - late final __objc_msgSend_103Ptr = _lookup< + late final __objc_msgSend_84Ptr = _lookup< ffi.NativeFunction< NSUInteger Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_103 = __objc_msgSend_103Ptr.asFunction< + late final __objc_msgSend_84 = __objc_msgSend_84Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_104( + int _objc_msgSend_85( ffi.Pointer obj, ffi.Pointer sel, int opts, ffi.Pointer predicate, ) { - return __objc_msgSend_104( + return __objc_msgSend_85( obj, sel, opts, @@ -2186,22 +1822,22 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_104Ptr = _lookup< + late final __objc_msgSend_85Ptr = _lookup< ffi.NativeFunction< NSUInteger Function(ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_104 = __objc_msgSend_104Ptr.asFunction< + late final __objc_msgSend_85 = __objc_msgSend_85Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); - int _objc_msgSend_105( + int _objc_msgSend_86( ffi.Pointer obj, ffi.Pointer sel, NSRange range, int opts, ffi.Pointer predicate, ) { - return __objc_msgSend_105( + return __objc_msgSend_86( obj, sel, range, @@ -2210,41 +1846,41 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_105Ptr = _lookup< + late final __objc_msgSend_86Ptr = _lookup< ffi.NativeFunction< NSUInteger Function(ffi.Pointer, ffi.Pointer, NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_105 = __objc_msgSend_105Ptr.asFunction< + late final __objc_msgSend_86 = __objc_msgSend_86Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, NSRange, int, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_106( + ffi.Pointer _objc_msgSend_87( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer predicate, ) { - return __objc_msgSend_106( + return __objc_msgSend_87( obj, sel, predicate, ); } - late final __objc_msgSend_106Ptr = _lookup< + late final __objc_msgSend_87Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_106 = __objc_msgSend_106Ptr.asFunction< + late final __objc_msgSend_87 = __objc_msgSend_87Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_107( + ffi.Pointer _objc_msgSend_88( ffi.Pointer obj, ffi.Pointer sel, int opts, ffi.Pointer predicate, ) { - return __objc_msgSend_107( + return __objc_msgSend_88( obj, sel, opts, @@ -2252,25 +1888,25 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_107Ptr = _lookup< + late final __objc_msgSend_88Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_107 = __objc_msgSend_107Ptr.asFunction< + late final __objc_msgSend_88 = __objc_msgSend_88Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_108( + ffi.Pointer _objc_msgSend_89( ffi.Pointer obj, ffi.Pointer sel, NSRange range, int opts, ffi.Pointer predicate, ) { - return __objc_msgSend_108( + return __objc_msgSend_89( obj, sel, range, @@ -2279,7 +1915,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_108Ptr = _lookup< + late final __objc_msgSend_89Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, @@ -2287,37 +1923,37 @@ class NativeObjCLibrary { NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_108 = __objc_msgSend_108Ptr.asFunction< + late final __objc_msgSend_89 = __objc_msgSend_89Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, NSRange, int, ffi.Pointer)>(); - void _objc_msgSend_109( + void _objc_msgSend_90( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer block, ) { - return __objc_msgSend_109( + return __objc_msgSend_90( obj, sel, block, ); } - late final __objc_msgSend_109Ptr = _lookup< + late final __objc_msgSend_90Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_109 = __objc_msgSend_109Ptr.asFunction< + late final __objc_msgSend_90 = __objc_msgSend_90Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_110( + void _objc_msgSend_91( ffi.Pointer obj, ffi.Pointer sel, int opts, ffi.Pointer block, ) { - return __objc_msgSend_110( + return __objc_msgSend_91( obj, sel, opts, @@ -2325,22 +1961,22 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_110Ptr = _lookup< + late final __objc_msgSend_91Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_110 = __objc_msgSend_110Ptr.asFunction< + late final __objc_msgSend_91 = __objc_msgSend_91Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); - void _objc_msgSend_111( + void _objc_msgSend_92( ffi.Pointer obj, ffi.Pointer sel, NSRange range, int opts, ffi.Pointer block, ) { - return __objc_msgSend_111( + return __objc_msgSend_92( obj, sel, range, @@ -2349,80 +1985,99 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_111Ptr = _lookup< + late final __objc_msgSend_92Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_111 = __objc_msgSend_111Ptr.asFunction< + late final __objc_msgSend_92 = __objc_msgSend_92Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, NSRange, int, ffi.Pointer)>(); - void _objc_msgSend_112( + void _objc_msgSend_93( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer indexSet, ) { - return __objc_msgSend_112( + return __objc_msgSend_93( obj, sel, indexSet, ); } - late final __objc_msgSend_112Ptr = _lookup< + late final __objc_msgSend_93Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_112 = __objc_msgSend_112Ptr.asFunction< + late final __objc_msgSend_93 = __objc_msgSend_93Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_113( + void _objc_msgSend_94( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer indexSet, ) { - return __objc_msgSend_113( + return __objc_msgSend_94( obj, sel, indexSet, ); } - late final __objc_msgSend_113Ptr = _lookup< + late final __objc_msgSend_94Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_113 = __objc_msgSend_113Ptr.asFunction< + late final __objc_msgSend_94 = __objc_msgSend_94Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_114( + void _objc_msgSend_95( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_95( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_95Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_95 = __objc_msgSend_95Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + void _objc_msgSend_96( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ) { - return __objc_msgSend_114( + return __objc_msgSend_96( obj, sel, range, ); } - late final __objc_msgSend_114Ptr = _lookup< + late final __objc_msgSend_96Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_114 = __objc_msgSend_114Ptr.asFunction< + late final __objc_msgSend_96 = __objc_msgSend_96Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, NSRange)>(); - void _objc_msgSend_115( + void _objc_msgSend_97( ffi.Pointer obj, ffi.Pointer sel, int index, int delta, ) { - return __objc_msgSend_115( + return __objc_msgSend_97( obj, sel, index, @@ -2430,34 +2085,34 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_115Ptr = _lookup< + late final __objc_msgSend_97Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSUInteger, NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_115 = __objc_msgSend_115Ptr.asFunction< + late final __objc_msgSend_97 = __objc_msgSend_97Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int, int)>(); - instancetype _objc_msgSend_116( + instancetype _objc_msgSend_98( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer changes, ) { - return __objc_msgSend_116( + return __objc_msgSend_98( obj, sel, changes, ); } - late final __objc_msgSend_116Ptr = _lookup< + late final __objc_msgSend_98Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_116 = __objc_msgSend_116Ptr.asFunction< + late final __objc_msgSend_98 = __objc_msgSend_98Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - instancetype _objc_msgSend_117( + instancetype _objc_msgSend_99( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer inserts, @@ -2466,7 +2121,7 @@ class NativeObjCLibrary { ffi.Pointer removedObjects, ffi.Pointer changes, ) { - return __objc_msgSend_117( + return __objc_msgSend_99( obj, sel, inserts, @@ -2477,7 +2132,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_117Ptr = _lookup< + late final __objc_msgSend_99Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, @@ -2487,7 +2142,7 @@ class NativeObjCLibrary { ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_117 = __objc_msgSend_117Ptr.asFunction< + late final __objc_msgSend_99 = __objc_msgSend_99Ptr.asFunction< instancetype Function( ffi.Pointer, ffi.Pointer, @@ -2497,7 +2152,7 @@ class NativeObjCLibrary { ffi.Pointer, ffi.Pointer)>(); - instancetype _objc_msgSend_118( + instancetype _objc_msgSend_100( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer inserts, @@ -2505,7 +2160,7 @@ class NativeObjCLibrary { ffi.Pointer removes, ffi.Pointer removedObjects, ) { - return __objc_msgSend_118( + return __objc_msgSend_100( obj, sel, inserts, @@ -2515,7 +2170,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_118Ptr = _lookup< + late final __objc_msgSend_100Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, @@ -2524,7 +2179,7 @@ class NativeObjCLibrary { ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_118 = __objc_msgSend_118Ptr.asFunction< + late final __objc_msgSend_100 = __objc_msgSend_100Ptr.asFunction< instancetype Function( ffi.Pointer, ffi.Pointer, @@ -2533,109 +2188,69 @@ class NativeObjCLibrary { ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_119( + ffi.Pointer _objc_msgSend_101( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_119( + return __objc_msgSend_101( obj, sel, ); } - late final __objc_msgSend_119Ptr = _lookup< + late final __objc_msgSend_101Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_119 = __objc_msgSend_119Ptr.asFunction< + late final __objc_msgSend_101 = __objc_msgSend_101Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_120( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_120( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_120Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_120 = __objc_msgSend_120Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_121( + ffi.Pointer _objc_msgSend_102( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_121( + return __objc_msgSend_102( obj, sel, ); } - late final __objc_msgSend_121Ptr = _lookup< + late final __objc_msgSend_102Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_121 = __objc_msgSend_121Ptr.asFunction< + late final __objc_msgSend_102 = __objc_msgSend_102Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_122( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_122( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_122Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_122 = __objc_msgSend_122Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_123( + ffi.Pointer _objc_msgSend_103( ffi.Pointer obj, ffi.Pointer sel, int index, ) { - return __objc_msgSend_123( + return __objc_msgSend_103( obj, sel, index, ); } - late final __objc_msgSend_123Ptr = _lookup< + late final __objc_msgSend_103Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_123 = __objc_msgSend_123Ptr.asFunction< + late final __objc_msgSend_103 = __objc_msgSend_103Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); - instancetype _objc_msgSend_124( + instancetype _objc_msgSend_104( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer> objects, int cnt, ) { - return __objc_msgSend_124( + return __objc_msgSend_104( obj, sel, objects, @@ -2643,64 +2258,64 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_124Ptr = _lookup< + late final __objc_msgSend_104Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, ffi.Pointer, ffi.Pointer>, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_124 = __objc_msgSend_124Ptr.asFunction< + late final __objc_msgSend_104 = __objc_msgSend_104Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer>, int)>(); - instancetype _objc_msgSend_125( + instancetype _objc_msgSend_105( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer coder, ) { - return __objc_msgSend_125( + return __objc_msgSend_105( obj, sel, coder, ); } - late final __objc_msgSend_125Ptr = _lookup< + late final __objc_msgSend_105Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_125 = __objc_msgSend_125Ptr.asFunction< + late final __objc_msgSend_105 = __objc_msgSend_105Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_126( + void _objc_msgSend_106( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer anObject, ) { - return __objc_msgSend_126( + return __objc_msgSend_106( obj, sel, anObject, ); } - late final __objc_msgSend_126Ptr = _lookup< + late final __objc_msgSend_106Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_126 = __objc_msgSend_126Ptr.asFunction< + late final __objc_msgSend_106 = __objc_msgSend_106Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_127( + void _objc_msgSend_107( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer anObject, int index, ) { - return __objc_msgSend_127( + return __objc_msgSend_107( obj, sel, anObject, @@ -2708,21 +2323,21 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_127Ptr = _lookup< + late final __objc_msgSend_107Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_127 = __objc_msgSend_127Ptr.asFunction< + late final __objc_msgSend_107 = __objc_msgSend_107Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); - void _objc_msgSend_128( + void _objc_msgSend_108( ffi.Pointer obj, ffi.Pointer sel, int index, ffi.Pointer anObject, ) { - return __objc_msgSend_128( + return __objc_msgSend_108( obj, sel, index, @@ -2730,42 +2345,42 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_128Ptr = _lookup< + late final __objc_msgSend_108Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSUInteger, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_128 = __objc_msgSend_128Ptr.asFunction< + late final __objc_msgSend_108 = __objc_msgSend_108Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); - instancetype _objc_msgSend_129( + instancetype _objc_msgSend_109( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer coder, ) { - return __objc_msgSend_129( + return __objc_msgSend_109( obj, sel, coder, ); } - late final __objc_msgSend_129Ptr = _lookup< + late final __objc_msgSend_109Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_129 = __objc_msgSend_129Ptr.asFunction< + late final __objc_msgSend_109 = __objc_msgSend_109Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_130( + void _objc_msgSend_110( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, int visibility, ffi.Pointer loadHandler, ) { - return __objc_msgSend_130( + return __objc_msgSend_110( obj, sel, typeIdentifier, @@ -2774,7 +2389,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_130Ptr = _lookup< + late final __objc_msgSend_110Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -2782,11 +2397,11 @@ class NativeObjCLibrary { ffi.Pointer, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_130 = __objc_msgSend_130Ptr.asFunction< + late final __objc_msgSend_110 = __objc_msgSend_110Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); - void _objc_msgSend_131( + void _objc_msgSend_111( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, @@ -2794,7 +2409,7 @@ class NativeObjCLibrary { int visibility, ffi.Pointer loadHandler, ) { - return __objc_msgSend_131( + return __objc_msgSend_111( obj, sel, typeIdentifier, @@ -2804,7 +2419,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_131Ptr = _lookup< + late final __objc_msgSend_111Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -2813,54 +2428,34 @@ class NativeObjCLibrary { ffi.Int32, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_131 = __objc_msgSend_131Ptr.asFunction< + late final __objc_msgSend_111 = __objc_msgSend_111Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, int, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_132( + ffi.Pointer _objc_msgSend_112( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_132( + return __objc_msgSend_112( obj, sel, ); } - late final __objc_msgSend_132Ptr = _lookup< + late final __objc_msgSend_112Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_132 = __objc_msgSend_132Ptr.asFunction< + late final __objc_msgSend_112 = __objc_msgSend_112Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_133( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_133( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_133Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_133 = __objc_msgSend_133Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - bool _objc_msgSend_134( + bool _objc_msgSend_113( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, ) { - return __objc_msgSend_134( + return __objc_msgSend_113( obj, sel, typeIdentifier, @@ -2868,21 +2463,21 @@ class NativeObjCLibrary { 0; } - late final __objc_msgSend_134Ptr = _lookup< + late final __objc_msgSend_113Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_134 = __objc_msgSend_134Ptr.asFunction< + late final __objc_msgSend_113 = __objc_msgSend_113Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_135( + bool _objc_msgSend_114( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, int fileOptions, ) { - return __objc_msgSend_135( + return __objc_msgSend_114( obj, sel, typeIdentifier, @@ -2891,21 +2486,21 @@ class NativeObjCLibrary { 0; } - late final __objc_msgSend_135Ptr = _lookup< + late final __objc_msgSend_114Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_135 = __objc_msgSend_135Ptr.asFunction< + late final __objc_msgSend_114 = __objc_msgSend_114Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); - ffi.Pointer _objc_msgSend_136( + ffi.Pointer _objc_msgSend_115( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, ffi.Pointer completionHandler, ) { - return __objc_msgSend_136( + return __objc_msgSend_115( obj, sel, typeIdentifier, @@ -2913,27 +2508,27 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_136Ptr = _lookup< + late final __objc_msgSend_115Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_136 = __objc_msgSend_136Ptr.asFunction< + late final __objc_msgSend_115 = __objc_msgSend_115Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_137( + ffi.Pointer _objc_msgSend_116( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, ffi.Pointer completionHandler, ) { - return __objc_msgSend_137( + return __objc_msgSend_116( obj, sel, typeIdentifier, @@ -2941,27 +2536,27 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_137Ptr = _lookup< + late final __objc_msgSend_116Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_137 = __objc_msgSend_137Ptr.asFunction< + late final __objc_msgSend_116 = __objc_msgSend_116Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_138( + ffi.Pointer _objc_msgSend_117( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, ffi.Pointer completionHandler, ) { - return __objc_msgSend_138( + return __objc_msgSend_117( obj, sel, typeIdentifier, @@ -2969,85 +2564,85 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_138Ptr = _lookup< + late final __objc_msgSend_117Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_138 = __objc_msgSend_138Ptr.asFunction< + late final __objc_msgSend_117 = __objc_msgSend_117Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_139( + ffi.Pointer _objc_msgSend_118( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_139( + return __objc_msgSend_118( obj, sel, ); } - late final __objc_msgSend_139Ptr = _lookup< + late final __objc_msgSend_118Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_139 = __objc_msgSend_139Ptr.asFunction< + late final __objc_msgSend_118 = __objc_msgSend_118Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_140( + void _objc_msgSend_119( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer value, ) { - return __objc_msgSend_140( + return __objc_msgSend_119( obj, sel, value, ); } - late final __objc_msgSend_140Ptr = _lookup< + late final __objc_msgSend_119Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_140 = __objc_msgSend_140Ptr.asFunction< + late final __objc_msgSend_119 = __objc_msgSend_119Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - instancetype _objc_msgSend_141( + instancetype _objc_msgSend_120( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer object, ) { - return __objc_msgSend_141( + return __objc_msgSend_120( obj, sel, object, ); } - late final __objc_msgSend_141Ptr = _lookup< + late final __objc_msgSend_120Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_141 = __objc_msgSend_141Ptr.asFunction< + late final __objc_msgSend_120 = __objc_msgSend_120Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_142( + void _objc_msgSend_121( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer object, int visibility, ) { - return __objc_msgSend_142( + return __objc_msgSend_121( obj, sel, object, @@ -3055,22 +2650,22 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_142Ptr = _lookup< + late final __objc_msgSend_121Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_142 = __objc_msgSend_142Ptr.asFunction< + late final __objc_msgSend_121 = __objc_msgSend_121Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); - void _objc_msgSend_143( + void _objc_msgSend_122( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aClass, int visibility, ffi.Pointer loadHandler, ) { - return __objc_msgSend_143( + return __objc_msgSend_122( obj, sel, aClass, @@ -3079,7 +2674,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_143Ptr = _lookup< + late final __objc_msgSend_122Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -3087,16 +2682,16 @@ class NativeObjCLibrary { ffi.Pointer, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_143 = __objc_msgSend_143Ptr.asFunction< + late final __objc_msgSend_122 = __objc_msgSend_122Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); - bool _objc_msgSend_144( + bool _objc_msgSend_123( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aClass, ) { - return __objc_msgSend_144( + return __objc_msgSend_123( obj, sel, aClass, @@ -3104,21 +2699,21 @@ class NativeObjCLibrary { 0; } - late final __objc_msgSend_144Ptr = _lookup< + late final __objc_msgSend_123Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_144 = __objc_msgSend_144Ptr.asFunction< + late final __objc_msgSend_123 = __objc_msgSend_123Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_145( + ffi.Pointer _objc_msgSend_124( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aClass, ffi.Pointer completionHandler, ) { - return __objc_msgSend_145( + return __objc_msgSend_124( obj, sel, aClass, @@ -3126,27 +2721,27 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_145Ptr = _lookup< + late final __objc_msgSend_124Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_145 = __objc_msgSend_145Ptr.asFunction< + late final __objc_msgSend_124 = __objc_msgSend_124Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - instancetype _objc_msgSend_146( + instancetype _objc_msgSend_125( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer item, ffi.Pointer typeIdentifier, ) { - return __objc_msgSend_146( + return __objc_msgSend_125( obj, sel, item, @@ -3154,44 +2749,44 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_146Ptr = _lookup< + late final __objc_msgSend_125Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_146 = __objc_msgSend_146Ptr.asFunction< + late final __objc_msgSend_125 = __objc_msgSend_125Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - instancetype _objc_msgSend_147( + instancetype _objc_msgSend_126( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer fileURL, ) { - return __objc_msgSend_147( + return __objc_msgSend_126( obj, sel, fileURL, ); } - late final __objc_msgSend_147Ptr = _lookup< + late final __objc_msgSend_126Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_147 = __objc_msgSend_147Ptr.asFunction< + late final __objc_msgSend_126 = __objc_msgSend_126Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_148( + void _objc_msgSend_127( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, NSItemProviderLoadHandler loadHandler, ) { - return __objc_msgSend_148( + return __objc_msgSend_127( obj, sel, typeIdentifier, @@ -3199,25 +2794,25 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_148Ptr = _lookup< + late final __objc_msgSend_127Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, NSItemProviderLoadHandler)>>('objc_msgSend'); - late final __objc_msgSend_148 = __objc_msgSend_148Ptr.asFunction< + late final __objc_msgSend_127 = __objc_msgSend_127Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSItemProviderLoadHandler)>(); - void _objc_msgSend_149( + void _objc_msgSend_128( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, ffi.Pointer options, NSItemProviderCompletionHandler completionHandler, ) { - return __objc_msgSend_149( + return __objc_msgSend_128( obj, sel, typeIdentifier, @@ -3226,7 +2821,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_149Ptr = _lookup< + late final __objc_msgSend_128Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -3234,7 +2829,7 @@ class NativeObjCLibrary { ffi.Pointer, ffi.Pointer, NSItemProviderCompletionHandler)>>('objc_msgSend'); - late final __objc_msgSend_149 = __objc_msgSend_149Ptr.asFunction< + late final __objc_msgSend_128 = __objc_msgSend_128Ptr.asFunction< void Function( ffi.Pointer, ffi.Pointer, @@ -3522,13 +3117,13 @@ class NativeObjCLibrary { NSStringEncodingDetectionOptionsKey value) => _NSStringEncodingDetectionLikelyLanguageKey.value = value; - void _objc_msgSend_150( + void _objc_msgSend_129( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ffi.Pointer aString, ) { - return __objc_msgSend_150( + return __objc_msgSend_129( obj, sel, range, @@ -3536,11 +3131,11 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_150Ptr = _lookup< + late final __objc_msgSend_129Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSRange, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_150 = __objc_msgSend_150Ptr.asFunction< + late final __objc_msgSend_129 = __objc_msgSend_129Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, NSRange, ffi.Pointer)>(); @@ -3561,69 +3156,69 @@ class NativeObjCLibrary { set NSParseErrorException(NSExceptionName value) => _NSParseErrorException.value = value; - int _objc_msgSend_151( + int _objc_msgSend_130( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_151( + return __objc_msgSend_130( obj, sel, ); } - late final __objc_msgSend_151Ptr = _lookup< + late final __objc_msgSend_130Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_151 = __objc_msgSend_151Ptr.asFunction< + late final __objc_msgSend_130 = __objc_msgSend_130Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_152( + void _objc_msgSend_131( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_152( + return __objc_msgSend_131( obj, sel, value, ); } - late final __objc_msgSend_152Ptr = _lookup< + late final __objc_msgSend_131Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_152 = __objc_msgSend_152Ptr.asFunction< + late final __objc_msgSend_131 = __objc_msgSend_131Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); - ffi.Pointer _objc_msgSend_153( + ffi.Pointer _objc_msgSend_132( ffi.Pointer obj, ffi.Pointer sel, double x, ) { - return __objc_msgSend_153( + return __objc_msgSend_132( obj, sel, x, ); } - late final __objc_msgSend_153Ptr = _lookup< + late final __objc_msgSend_132Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_153 = __objc_msgSend_153Ptr.asFunction< + late final __objc_msgSend_132 = __objc_msgSend_132Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, double)>(); - int _objc_msgSend_154( + int _objc_msgSend_133( ffi.Pointer obj, ffi.Pointer sel, bool useIntVals, ffi.Pointer other, ) { - return __objc_msgSend_154( + return __objc_msgSend_133( obj, sel, useIntVals ? 1 : 0, @@ -3631,21 +3226,48 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_154Ptr = _lookup< + late final __objc_msgSend_133Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Uint8, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_154 = __objc_msgSend_154Ptr.asFunction< + late final __objc_msgSend_133 = __objc_msgSend_133Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_155( + void _objc_msgSend_134( + ffi.Pointer obj, + ffi.Pointer sel, + double x, + ) { + return __objc_msgSend_134( + obj, + sel, + x, + ); + } + + late final __objc_msgSend_134Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_134 = __objc_msgSend_134Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double)>(); + + late final ffi.Pointer __classReadWriteProperty = + _lookup('_classReadWriteProperty'); + + int get _classReadWriteProperty => __classReadWriteProperty.value; + + set _classReadWriteProperty(int value) => + __classReadWriteProperty.value = value; + + ffi.Pointer _objc_msgSend_135( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer a, ffi.Pointer b, ) { - return __objc_msgSend_155( + return __objc_msgSend_135( obj, sel, a, @@ -3653,14 +3275,14 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_155Ptr = _lookup< + late final __objc_msgSend_135Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_155 = __objc_msgSend_155Ptr.asFunction< + late final __objc_msgSend_135 = __objc_msgSend_135Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, @@ -3797,33 +3419,27 @@ class NSValue extends NSObject { static ffi.Pointer? _sel_getValue; void getValue(ffi.Pointer value, int size) { _sel_getValue ??= _registerName(_lib, "getValue:size:"); - return _lib._objc_msgSend_29(_id, _sel_getValue!, value, size); + _lib._objc_msgSend_28(_id, _sel_getValue!, value, size); } static ffi.Pointer? _sel_objCType; ffi.Pointer get objCType { _sel_objCType ??= _registerName(_lib, "objCType"); - return _lib._objc_msgSend_30(_id, _sel_objCType!); - } - - static ffi.Pointer? _sel_objCType1; - set objCType(ffi.Pointer value) { - _sel_objCType1 ??= _registerName(_lib, "setObjCType:"); - return _lib._objc_msgSend_31(_id, _sel_objCType1!, value); + return _lib._objc_msgSend_29(_id, _sel_objCType!); } static ffi.Pointer? _sel_initWithBytes; NSValue initWithBytes( ffi.Pointer value, ffi.Pointer type) { _sel_initWithBytes ??= _registerName(_lib, "initWithBytes:objCType:"); - final _ret = _lib._objc_msgSend_32(_id, _sel_initWithBytes!, value, type); + final _ret = _lib._objc_msgSend_30(_id, _sel_initWithBytes!, value, type); return NSValue._(_ret, _lib); } static ffi.Pointer? _sel_initWithCoder; NSValue initWithCoder(NSObject coder) { _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_33(_id, _sel_initWithCoder!, coder._id); + final _ret = _lib._objc_msgSend_31(_id, _sel_initWithCoder!, coder._id); return NSValue._(_ret, _lib); } @@ -3858,14 +3474,14 @@ class NSObject extends _ObjCWrapper { static void load(NativeObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_load ??= _registerName(_lib, "load"); - return _lib._objc_msgSend_0(_class!, _sel_load!); + _lib._objc_msgSend_0(_class!, _sel_load!); } static ffi.Pointer? _sel_initialize; static void initialize(NativeObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_initialize ??= _registerName(_lib, "initialize"); - return _lib._objc_msgSend_0(_class!, _sel_initialize!); + _lib._objc_msgSend_0(_class!, _sel_initialize!); } static ffi.Pointer? _sel_init; @@ -3903,13 +3519,13 @@ class NSObject extends _ObjCWrapper { static ffi.Pointer? _sel_dealloc; void dealloc() { _sel_dealloc ??= _registerName(_lib, "dealloc"); - return _lib._objc_msgSend_0(_id, _sel_dealloc!); + _lib._objc_msgSend_0(_id, _sel_dealloc!); } static ffi.Pointer? _sel_finalize; void finalize() { _sel_finalize ??= _registerName(_lib, "finalize"); - return _lib._objc_msgSend_0(_id, _sel_finalize!); + _lib._objc_msgSend_0(_id, _sel_finalize!); } static ffi.Pointer? _sel_copy; @@ -3982,8 +3598,7 @@ class NSObject extends _ObjCWrapper { void doesNotRecognizeSelector(ffi.Pointer aSelector) { _sel_doesNotRecognizeSelector ??= _registerName(_lib, "doesNotRecognizeSelector:"); - return _lib._objc_msgSend_11( - _id, _sel_doesNotRecognizeSelector!, aSelector); + _lib._objc_msgSend_11(_id, _sel_doesNotRecognizeSelector!, aSelector); } static ffi.Pointer? _sel_forwardingTargetForSelector; @@ -3998,8 +3613,7 @@ class NSObject extends _ObjCWrapper { static ffi.Pointer? _sel_forwardInvocation; void forwardInvocation(NSObject anInvocation) { _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); - return _lib._objc_msgSend_13( - _id, _sel_forwardInvocation!, anInvocation._id); + _lib._objc_msgSend_13(_id, _sel_forwardInvocation!, anInvocation._id); } static ffi.Pointer? _sel_methodSignatureForSelector; @@ -4085,7 +3699,7 @@ class NSObject extends _ObjCWrapper { static NSString description(NativeObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_description ??= _registerName(_lib, "description"); - final _ret = _lib._objc_msgSend_28(_class!, _sel_description!); + final _ret = _lib._objc_msgSend_27(_class!, _sel_description!); return NSString._(_ret, _lib); } @@ -4093,7 +3707,7 @@ class NSObject extends _ObjCWrapper { static NSString debugDescription(NativeObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_debugDescription ??= _registerName(_lib, "debugDescription"); - final _ret = _lib._objc_msgSend_28(_class!, _sel_debugDescription!); + final _ret = _lib._objc_msgSend_27(_class!, _sel_debugDescription!); return NSString._(_ret, _lib); } } @@ -4147,16 +3761,10 @@ class NSString extends NSObject { return _lib._objc_msgSend_20(_id, _sel_length!); } - static ffi.Pointer? _sel_length1; - set length(int value) { - _sel_length1 ??= _registerName(_lib, "setLength:"); - return _lib._objc_msgSend_23(_id, _sel_length1!, value); - } - static ffi.Pointer? _sel_characterAtIndex; int characterAtIndex(int index) { _sel_characterAtIndex ??= _registerName(_lib, "characterAtIndex:"); - return _lib._objc_msgSend_24(_id, _sel_characterAtIndex!, index); + return _lib._objc_msgSend_23(_id, _sel_characterAtIndex!, index); } static ffi.Pointer? _sel_init; @@ -4170,7 +3778,7 @@ class NSString extends NSObject { static ffi.Pointer? _sel_initWithCoder; NSString initWithCoder(NSObject coder) { _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_25(_id, _sel_initWithCoder!, coder._id); + final _ret = _lib._objc_msgSend_24(_id, _sel_initWithCoder!, coder._id); return NSString._(_ret, _lib); } @@ -4181,14 +3789,14 @@ class NSString extends NSObject { _sel_stringWithCString ??= _registerName(_lib, "stringWithCString:encoding:"); final _ret = - _lib._objc_msgSend_26(_class!, _sel_stringWithCString!, cString, enc); + _lib._objc_msgSend_25(_class!, _sel_stringWithCString!, cString, enc); return NSString._(_ret, _lib); } static ffi.Pointer? _sel_UTF8String; ffi.Pointer UTF8String() { _sel_UTF8String ??= _registerName(_lib, "UTF8String"); - return _lib._objc_msgSend_27(_id, _sel_UTF8String!); + return _lib._objc_msgSend_26(_id, _sel_UTF8String!); } static ffi.Pointer? _sel_new1; @@ -4228,28 +3836,28 @@ class NSNumber extends NSValue { @override NSNumber initWithCoder(NSObject coder) { _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_34(_id, _sel_initWithCoder!, coder._id); + final _ret = _lib._objc_msgSend_32(_id, _sel_initWithCoder!, coder._id); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithChar; NSNumber initWithChar(int value) { _sel_initWithChar ??= _registerName(_lib, "initWithChar:"); - final _ret = _lib._objc_msgSend_35(_id, _sel_initWithChar!, value); + final _ret = _lib._objc_msgSend_33(_id, _sel_initWithChar!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithUnsignedChar; NSNumber initWithUnsignedChar(int value) { _sel_initWithUnsignedChar ??= _registerName(_lib, "initWithUnsignedChar:"); - final _ret = _lib._objc_msgSend_36(_id, _sel_initWithUnsignedChar!, value); + final _ret = _lib._objc_msgSend_34(_id, _sel_initWithUnsignedChar!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithShort; NSNumber initWithShort(int value) { _sel_initWithShort ??= _registerName(_lib, "initWithShort:"); - final _ret = _lib._objc_msgSend_37(_id, _sel_initWithShort!, value); + final _ret = _lib._objc_msgSend_35(_id, _sel_initWithShort!, value); return NSNumber._(_ret, _lib); } @@ -4257,42 +3865,42 @@ class NSNumber extends NSValue { NSNumber initWithUnsignedShort(int value) { _sel_initWithUnsignedShort ??= _registerName(_lib, "initWithUnsignedShort:"); - final _ret = _lib._objc_msgSend_38(_id, _sel_initWithUnsignedShort!, value); + final _ret = _lib._objc_msgSend_36(_id, _sel_initWithUnsignedShort!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithInt; NSNumber initWithInt(int value) { _sel_initWithInt ??= _registerName(_lib, "initWithInt:"); - final _ret = _lib._objc_msgSend_39(_id, _sel_initWithInt!, value); + final _ret = _lib._objc_msgSend_37(_id, _sel_initWithInt!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithUnsignedInt; NSNumber initWithUnsignedInt(int value) { _sel_initWithUnsignedInt ??= _registerName(_lib, "initWithUnsignedInt:"); - final _ret = _lib._objc_msgSend_40(_id, _sel_initWithUnsignedInt!, value); + final _ret = _lib._objc_msgSend_38(_id, _sel_initWithUnsignedInt!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithLong; NSNumber initWithLong(int value) { _sel_initWithLong ??= _registerName(_lib, "initWithLong:"); - final _ret = _lib._objc_msgSend_41(_id, _sel_initWithLong!, value); + final _ret = _lib._objc_msgSend_39(_id, _sel_initWithLong!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithUnsignedLong; NSNumber initWithUnsignedLong(int value) { _sel_initWithUnsignedLong ??= _registerName(_lib, "initWithUnsignedLong:"); - final _ret = _lib._objc_msgSend_42(_id, _sel_initWithUnsignedLong!, value); + final _ret = _lib._objc_msgSend_40(_id, _sel_initWithUnsignedLong!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithLongLong; NSNumber initWithLongLong(int value) { _sel_initWithLongLong ??= _registerName(_lib, "initWithLongLong:"); - final _ret = _lib._objc_msgSend_43(_id, _sel_initWithLongLong!, value); + final _ret = _lib._objc_msgSend_41(_id, _sel_initWithLongLong!, value); return NSNumber._(_ret, _lib); } @@ -4301,35 +3909,35 @@ class NSNumber extends NSValue { _sel_initWithUnsignedLongLong ??= _registerName(_lib, "initWithUnsignedLongLong:"); final _ret = - _lib._objc_msgSend_44(_id, _sel_initWithUnsignedLongLong!, value); + _lib._objc_msgSend_42(_id, _sel_initWithUnsignedLongLong!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithFloat; NSNumber initWithFloat(double value) { _sel_initWithFloat ??= _registerName(_lib, "initWithFloat:"); - final _ret = _lib._objc_msgSend_45(_id, _sel_initWithFloat!, value); + final _ret = _lib._objc_msgSend_43(_id, _sel_initWithFloat!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithDouble; NSNumber initWithDouble(double value) { _sel_initWithDouble ??= _registerName(_lib, "initWithDouble:"); - final _ret = _lib._objc_msgSend_46(_id, _sel_initWithDouble!, value); + final _ret = _lib._objc_msgSend_44(_id, _sel_initWithDouble!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithBool; NSNumber initWithBool(bool value) { _sel_initWithBool ??= _registerName(_lib, "initWithBool:"); - final _ret = _lib._objc_msgSend_47(_id, _sel_initWithBool!, value); + final _ret = _lib._objc_msgSend_45(_id, _sel_initWithBool!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithInteger; NSNumber initWithInteger(int value) { _sel_initWithInteger ??= _registerName(_lib, "initWithInteger:"); - final _ret = _lib._objc_msgSend_48(_id, _sel_initWithInteger!, value); + final _ret = _lib._objc_msgSend_46(_id, _sel_initWithInteger!, value); return NSNumber._(_ret, _lib); } @@ -4338,153 +3946,80 @@ class NSNumber extends NSValue { _sel_initWithUnsignedInteger ??= _registerName(_lib, "initWithUnsignedInteger:"); final _ret = - _lib._objc_msgSend_49(_id, _sel_initWithUnsignedInteger!, value); + _lib._objc_msgSend_47(_id, _sel_initWithUnsignedInteger!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_charValue; int get charValue { _sel_charValue ??= _registerName(_lib, "charValue"); - return _lib._objc_msgSend_50(_id, _sel_charValue!); - } - - static ffi.Pointer? _sel_charValue1; - set charValue(int value) { - _sel_charValue1 ??= _registerName(_lib, "setCharValue:"); - return _lib._objc_msgSend_51(_id, _sel_charValue1!, value); + return _lib._objc_msgSend_48(_id, _sel_charValue!); } static ffi.Pointer? _sel_unsignedCharValue; int get unsignedCharValue { _sel_unsignedCharValue ??= _registerName(_lib, "unsignedCharValue"); - return _lib._objc_msgSend_52(_id, _sel_unsignedCharValue!); - } - - static ffi.Pointer? _sel_unsignedCharValue1; - set unsignedCharValue(int value) { - _sel_unsignedCharValue1 ??= _registerName(_lib, "setUnsignedCharValue:"); - return _lib._objc_msgSend_53(_id, _sel_unsignedCharValue1!, value); + return _lib._objc_msgSend_49(_id, _sel_unsignedCharValue!); } static ffi.Pointer? _sel_shortValue; int get shortValue { _sel_shortValue ??= _registerName(_lib, "shortValue"); - return _lib._objc_msgSend_54(_id, _sel_shortValue!); - } - - static ffi.Pointer? _sel_shortValue1; - set shortValue(int value) { - _sel_shortValue1 ??= _registerName(_lib, "setShortValue:"); - return _lib._objc_msgSend_55(_id, _sel_shortValue1!, value); + return _lib._objc_msgSend_50(_id, _sel_shortValue!); } static ffi.Pointer? _sel_unsignedShortValue; int get unsignedShortValue { _sel_unsignedShortValue ??= _registerName(_lib, "unsignedShortValue"); - return _lib._objc_msgSend_56(_id, _sel_unsignedShortValue!); - } - - static ffi.Pointer? _sel_unsignedShortValue1; - set unsignedShortValue(int value) { - _sel_unsignedShortValue1 ??= _registerName(_lib, "setUnsignedShortValue:"); - return _lib._objc_msgSend_57(_id, _sel_unsignedShortValue1!, value); + return _lib._objc_msgSend_51(_id, _sel_unsignedShortValue!); } static ffi.Pointer? _sel_intValue; int get intValue { _sel_intValue ??= _registerName(_lib, "intValue"); - return _lib._objc_msgSend_58(_id, _sel_intValue!); - } - - static ffi.Pointer? _sel_intValue1; - set intValue(int value) { - _sel_intValue1 ??= _registerName(_lib, "setIntValue:"); - return _lib._objc_msgSend_59(_id, _sel_intValue1!, value); + return _lib._objc_msgSend_52(_id, _sel_intValue!); } static ffi.Pointer? _sel_unsignedIntValue; int get unsignedIntValue { _sel_unsignedIntValue ??= _registerName(_lib, "unsignedIntValue"); - return _lib._objc_msgSend_60(_id, _sel_unsignedIntValue!); - } - - static ffi.Pointer? _sel_unsignedIntValue1; - set unsignedIntValue(int value) { - _sel_unsignedIntValue1 ??= _registerName(_lib, "setUnsignedIntValue:"); - return _lib._objc_msgSend_61(_id, _sel_unsignedIntValue1!, value); + return _lib._objc_msgSend_53(_id, _sel_unsignedIntValue!); } static ffi.Pointer? _sel_longValue; int get longValue { _sel_longValue ??= _registerName(_lib, "longValue"); - return _lib._objc_msgSend_62(_id, _sel_longValue!); - } - - static ffi.Pointer? _sel_longValue1; - set longValue(int value) { - _sel_longValue1 ??= _registerName(_lib, "setLongValue:"); - return _lib._objc_msgSend_63(_id, _sel_longValue1!, value); + return _lib._objc_msgSend_54(_id, _sel_longValue!); } static ffi.Pointer? _sel_unsignedLongValue; int get unsignedLongValue { _sel_unsignedLongValue ??= _registerName(_lib, "unsignedLongValue"); - return _lib._objc_msgSend_64(_id, _sel_unsignedLongValue!); - } - - static ffi.Pointer? _sel_unsignedLongValue1; - set unsignedLongValue(int value) { - _sel_unsignedLongValue1 ??= _registerName(_lib, "setUnsignedLongValue:"); - return _lib._objc_msgSend_65(_id, _sel_unsignedLongValue1!, value); + return _lib._objc_msgSend_55(_id, _sel_unsignedLongValue!); } static ffi.Pointer? _sel_longLongValue; int get longLongValue { _sel_longLongValue ??= _registerName(_lib, "longLongValue"); - return _lib._objc_msgSend_66(_id, _sel_longLongValue!); - } - - static ffi.Pointer? _sel_longLongValue1; - set longLongValue(int value) { - _sel_longLongValue1 ??= _registerName(_lib, "setLongLongValue:"); - return _lib._objc_msgSend_67(_id, _sel_longLongValue1!, value); + return _lib._objc_msgSend_56(_id, _sel_longLongValue!); } static ffi.Pointer? _sel_unsignedLongLongValue; int get unsignedLongLongValue { _sel_unsignedLongLongValue ??= _registerName(_lib, "unsignedLongLongValue"); - return _lib._objc_msgSend_68(_id, _sel_unsignedLongLongValue!); - } - - static ffi.Pointer? _sel_unsignedLongLongValue1; - set unsignedLongLongValue(int value) { - _sel_unsignedLongLongValue1 ??= - _registerName(_lib, "setUnsignedLongLongValue:"); - return _lib._objc_msgSend_69(_id, _sel_unsignedLongLongValue1!, value); + return _lib._objc_msgSend_57(_id, _sel_unsignedLongLongValue!); } static ffi.Pointer? _sel_floatValue; double get floatValue { _sel_floatValue ??= _registerName(_lib, "floatValue"); - return _lib._objc_msgSend_70(_id, _sel_floatValue!); - } - - static ffi.Pointer? _sel_floatValue1; - set floatValue(double value) { - _sel_floatValue1 ??= _registerName(_lib, "setFloatValue:"); - return _lib._objc_msgSend_71(_id, _sel_floatValue1!, value); + return _lib._objc_msgSend_58(_id, _sel_floatValue!); } static ffi.Pointer? _sel_doubleValue; double get doubleValue { _sel_doubleValue ??= _registerName(_lib, "doubleValue"); - return _lib._objc_msgSend_72(_id, _sel_doubleValue!); - } - - static ffi.Pointer? _sel_doubleValue1; - set doubleValue(double value) { - _sel_doubleValue1 ??= _registerName(_lib, "setDoubleValue:"); - return _lib._objc_msgSend_73(_id, _sel_doubleValue1!, value); + return _lib._objc_msgSend_59(_id, _sel_doubleValue!); } static ffi.Pointer? _sel_boolValue; @@ -4493,22 +4028,10 @@ class NSNumber extends NSValue { return _lib._objc_msgSend_16(_id, _sel_boolValue!); } - static ffi.Pointer? _sel_boolValue1; - set boolValue(bool value) { - _sel_boolValue1 ??= _registerName(_lib, "setBoolValue:"); - return _lib._objc_msgSend_74(_id, _sel_boolValue1!, value); - } - static ffi.Pointer? _sel_integerValue; int get integerValue { _sel_integerValue ??= _registerName(_lib, "integerValue"); - return _lib._objc_msgSend_75(_id, _sel_integerValue!); - } - - static ffi.Pointer? _sel_integerValue1; - set integerValue(int value) { - _sel_integerValue1 ??= _registerName(_lib, "setIntegerValue:"); - return _lib._objc_msgSend_76(_id, _sel_integerValue1!, value); + return _lib._objc_msgSend_60(_id, _sel_integerValue!); } static ffi.Pointer? _sel_unsignedIntegerValue; @@ -4517,36 +4040,23 @@ class NSNumber extends NSValue { return _lib._objc_msgSend_20(_id, _sel_unsignedIntegerValue!); } - static ffi.Pointer? _sel_unsignedIntegerValue1; - set unsignedIntegerValue(int value) { - _sel_unsignedIntegerValue1 ??= - _registerName(_lib, "setUnsignedIntegerValue:"); - return _lib._objc_msgSend_23(_id, _sel_unsignedIntegerValue1!, value); - } - static ffi.Pointer? _sel_stringValue; NSObject get stringValue { _sel_stringValue ??= _registerName(_lib, "stringValue"); - final _ret = _lib._objc_msgSend_77(_id, _sel_stringValue!); + final _ret = _lib._objc_msgSend_61(_id, _sel_stringValue!); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_stringValue1; - set stringValue(NSObject value) { - _sel_stringValue1 ??= _registerName(_lib, "setStringValue:"); - return _lib._objc_msgSend_78(_id, _sel_stringValue1!, value._id); - } - static ffi.Pointer? _sel_compare; int compare(NSObject otherNumber) { _sel_compare ??= _registerName(_lib, "compare:"); - return _lib._objc_msgSend_79(_id, _sel_compare!, otherNumber._id); + return _lib._objc_msgSend_62(_id, _sel_compare!, otherNumber._id); } static ffi.Pointer? _sel_isEqualToNumber; bool isEqualToNumber(NSObject number) { _sel_isEqualToNumber ??= _registerName(_lib, "isEqualToNumber:"); - return _lib._objc_msgSend_80(_id, _sel_isEqualToNumber!, number._id); + return _lib._objc_msgSend_63(_id, _sel_isEqualToNumber!, number._id); } static ffi.Pointer? _sel_descriptionWithLocale; @@ -4554,7 +4064,7 @@ class NSNumber extends NSValue { _sel_descriptionWithLocale ??= _registerName(_lib, "descriptionWithLocale:"); final _ret = - _lib._objc_msgSend_81(_id, _sel_descriptionWithLocale!, locale._id); + _lib._objc_msgSend_64(_id, _sel_descriptionWithLocale!, locale._id); return NSString._(_ret, _lib); } @@ -4608,7 +4118,7 @@ class NSEnumerator extends NSObject { static ffi.Pointer? _sel_nextObject; NSObject nextObject() { _sel_nextObject ??= _registerName(_lib, "nextObject"); - final _ret = _lib._objc_msgSend_82(_id, _sel_nextObject!); + final _ret = _lib._objc_msgSend_65(_id, _sel_nextObject!); return NSObject._(_ret, _lib); } @@ -4647,26 +4157,14 @@ class NSOrderedCollectionChange extends NSObject { static ffi.Pointer? _sel_object; NSObject get object { _sel_object ??= _registerName(_lib, "object"); - final _ret = _lib._objc_msgSend_83(_id, _sel_object!); + final _ret = _lib._objc_msgSend_66(_id, _sel_object!); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_object1; - set object(NSObject value) { - _sel_object1 ??= _registerName(_lib, "setObject:"); - return _lib._objc_msgSend_84(_id, _sel_object1!, value._id); - } - static ffi.Pointer? _sel_changeType; int get changeType { _sel_changeType ??= _registerName(_lib, "changeType"); - return _lib._objc_msgSend_85(_id, _sel_changeType!); - } - - static ffi.Pointer? _sel_changeType1; - set changeType(int value) { - _sel_changeType1 ??= _registerName(_lib, "setChangeType:"); - return _lib._objc_msgSend_86(_id, _sel_changeType1!, value); + return _lib._objc_msgSend_67(_id, _sel_changeType!); } static ffi.Pointer? _sel_index; @@ -4675,29 +4173,17 @@ class NSOrderedCollectionChange extends NSObject { return _lib._objc_msgSend_20(_id, _sel_index!); } - static ffi.Pointer? _sel_index1; - set index(int value) { - _sel_index1 ??= _registerName(_lib, "setIndex:"); - return _lib._objc_msgSend_23(_id, _sel_index1!, value); - } - static ffi.Pointer? _sel_associatedIndex; int get associatedIndex { _sel_associatedIndex ??= _registerName(_lib, "associatedIndex"); return _lib._objc_msgSend_20(_id, _sel_associatedIndex!); } - static ffi.Pointer? _sel_associatedIndex1; - set associatedIndex(int value) { - _sel_associatedIndex1 ??= _registerName(_lib, "setAssociatedIndex:"); - return _lib._objc_msgSend_23(_id, _sel_associatedIndex1!, value); - } - static ffi.Pointer? _sel_init; @override NSObject init() { _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_87(_id, _sel_init!); + final _ret = _lib._objc_msgSend_68(_id, _sel_init!); return NSObject._(_ret, _lib); } @@ -4705,7 +4191,7 @@ class NSOrderedCollectionChange extends NSObject { NSOrderedCollectionChange initWithObject( NSObject anObject, int type, int index) { _sel_initWithObject ??= _registerName(_lib, "initWithObject:type:index:"); - final _ret = _lib._objc_msgSend_88( + final _ret = _lib._objc_msgSend_69( _id, _sel_initWithObject!, anObject._id, type, index); return NSOrderedCollectionChange._(_ret, _lib); } @@ -4715,7 +4201,7 @@ class NSOrderedCollectionChange extends NSObject { NSObject anObject, int type, int index, int associatedIndex) { _sel_initWithObject1 ??= _registerName(_lib, "initWithObject:type:index:associatedIndex:"); - final _ret = _lib._objc_msgSend_89( + final _ret = _lib._objc_msgSend_70( _id, _sel_initWithObject1!, anObject._id, type, index, associatedIndex); return NSOrderedCollectionChange._(_ret, _lib); } @@ -4759,7 +4245,7 @@ class NSIndexSet extends NSObject { static NSIndexSet indexSetWithIndex(NativeObjCLibrary _lib, int value) { _class ??= _getClass(_lib, "NSIndexSet"); _sel_indexSetWithIndex ??= _registerName(_lib, "indexSetWithIndex:"); - final _ret = _lib._objc_msgSend_90(_class!, _sel_indexSetWithIndex!, value); + final _ret = _lib._objc_msgSend_71(_class!, _sel_indexSetWithIndex!, value); return NSIndexSet._(_ret, _lib); } @@ -4770,7 +4256,7 @@ class NSIndexSet extends NSObject { _sel_indexSetWithIndexesInRange ??= _registerName(_lib, "indexSetWithIndexesInRange:"); final _ret = - _lib._objc_msgSend_91(_class!, _sel_indexSetWithIndexesInRange!, range); + _lib._objc_msgSend_72(_class!, _sel_indexSetWithIndexesInRange!, range); return NSIndexSet._(_ret, _lib); } @@ -4779,7 +4265,7 @@ class NSIndexSet extends NSObject { _sel_initWithIndexesInRange ??= _registerName(_lib, "initWithIndexesInRange:"); final _ret = - _lib._objc_msgSend_91(_id, _sel_initWithIndexesInRange!, range); + _lib._objc_msgSend_72(_id, _sel_initWithIndexesInRange!, range); return NSIndexSet._(_ret, _lib); } @@ -4787,21 +4273,21 @@ class NSIndexSet extends NSObject { NSIndexSet initWithIndexSet(NSObject indexSet) { _sel_initWithIndexSet ??= _registerName(_lib, "initWithIndexSet:"); final _ret = - _lib._objc_msgSend_92(_id, _sel_initWithIndexSet!, indexSet._id); + _lib._objc_msgSend_73(_id, _sel_initWithIndexSet!, indexSet._id); return NSIndexSet._(_ret, _lib); } static ffi.Pointer? _sel_initWithIndex; NSIndexSet initWithIndex(int value) { _sel_initWithIndex ??= _registerName(_lib, "initWithIndex:"); - final _ret = _lib._objc_msgSend_90(_id, _sel_initWithIndex!, value); + final _ret = _lib._objc_msgSend_71(_id, _sel_initWithIndex!, value); return NSIndexSet._(_ret, _lib); } static ffi.Pointer? _sel_isEqualToIndexSet; bool isEqualToIndexSet(NSObject indexSet) { _sel_isEqualToIndexSet ??= _registerName(_lib, "isEqualToIndexSet:"); - return _lib._objc_msgSend_93(_id, _sel_isEqualToIndexSet!, indexSet._id); + return _lib._objc_msgSend_74(_id, _sel_isEqualToIndexSet!, indexSet._id); } static ffi.Pointer? _sel_count; @@ -4810,54 +4296,36 @@ class NSIndexSet extends NSObject { return _lib._objc_msgSend_20(_id, _sel_count!); } - static ffi.Pointer? _sel_count1; - set count(int value) { - _sel_count1 ??= _registerName(_lib, "setCount:"); - return _lib._objc_msgSend_23(_id, _sel_count1!, value); - } - static ffi.Pointer? _sel_firstIndex; int get firstIndex { _sel_firstIndex ??= _registerName(_lib, "firstIndex"); return _lib._objc_msgSend_20(_id, _sel_firstIndex!); } - static ffi.Pointer? _sel_firstIndex1; - set firstIndex(int value) { - _sel_firstIndex1 ??= _registerName(_lib, "setFirstIndex:"); - return _lib._objc_msgSend_23(_id, _sel_firstIndex1!, value); - } - static ffi.Pointer? _sel_lastIndex; int get lastIndex { _sel_lastIndex ??= _registerName(_lib, "lastIndex"); return _lib._objc_msgSend_20(_id, _sel_lastIndex!); } - static ffi.Pointer? _sel_lastIndex1; - set lastIndex(int value) { - _sel_lastIndex1 ??= _registerName(_lib, "setLastIndex:"); - return _lib._objc_msgSend_23(_id, _sel_lastIndex1!, value); - } - static ffi.Pointer? _sel_indexGreaterThanIndex; int indexGreaterThanIndex(int value) { _sel_indexGreaterThanIndex ??= _registerName(_lib, "indexGreaterThanIndex:"); - return _lib._objc_msgSend_94(_id, _sel_indexGreaterThanIndex!, value); + return _lib._objc_msgSend_75(_id, _sel_indexGreaterThanIndex!, value); } static ffi.Pointer? _sel_indexLessThanIndex; int indexLessThanIndex(int value) { _sel_indexLessThanIndex ??= _registerName(_lib, "indexLessThanIndex:"); - return _lib._objc_msgSend_94(_id, _sel_indexLessThanIndex!, value); + return _lib._objc_msgSend_75(_id, _sel_indexLessThanIndex!, value); } static ffi.Pointer? _sel_indexGreaterThanOrEqualToIndex; int indexGreaterThanOrEqualToIndex(int value) { _sel_indexGreaterThanOrEqualToIndex ??= _registerName(_lib, "indexGreaterThanOrEqualToIndex:"); - return _lib._objc_msgSend_94( + return _lib._objc_msgSend_75( _id, _sel_indexGreaterThanOrEqualToIndex!, value); } @@ -4865,7 +4333,7 @@ class NSIndexSet extends NSObject { int indexLessThanOrEqualToIndex(int value) { _sel_indexLessThanOrEqualToIndex ??= _registerName(_lib, "indexLessThanOrEqualToIndex:"); - return _lib._objc_msgSend_94(_id, _sel_indexLessThanOrEqualToIndex!, value); + return _lib._objc_msgSend_75(_id, _sel_indexLessThanOrEqualToIndex!, value); } static ffi.Pointer? _sel_getIndexes; @@ -4873,7 +4341,7 @@ class NSIndexSet extends NSObject { NSRangePointer range) { _sel_getIndexes ??= _registerName(_lib, "getIndexes:maxCount:inIndexRange:"); - return _lib._objc_msgSend_95( + return _lib._objc_msgSend_76( _id, _sel_getIndexes!, indexBuffer, bufferSize, range); } @@ -4881,48 +4349,47 @@ class NSIndexSet extends NSObject { int countOfIndexesInRange(NSRange range) { _sel_countOfIndexesInRange ??= _registerName(_lib, "countOfIndexesInRange:"); - return _lib._objc_msgSend_96(_id, _sel_countOfIndexesInRange!, range); + return _lib._objc_msgSend_77(_id, _sel_countOfIndexesInRange!, range); } static ffi.Pointer? _sel_containsIndex; bool containsIndex(int value) { _sel_containsIndex ??= _registerName(_lib, "containsIndex:"); - return _lib._objc_msgSend_97(_id, _sel_containsIndex!, value); + return _lib._objc_msgSend_78(_id, _sel_containsIndex!, value); } static ffi.Pointer? _sel_containsIndexesInRange; bool containsIndexesInRange(NSRange range) { _sel_containsIndexesInRange ??= _registerName(_lib, "containsIndexesInRange:"); - return _lib._objc_msgSend_98(_id, _sel_containsIndexesInRange!, range); + return _lib._objc_msgSend_79(_id, _sel_containsIndexesInRange!, range); } static ffi.Pointer? _sel_containsIndexes; bool containsIndexes(NSObject indexSet) { _sel_containsIndexes ??= _registerName(_lib, "containsIndexes:"); - return _lib._objc_msgSend_99(_id, _sel_containsIndexes!, indexSet._id); + return _lib._objc_msgSend_80(_id, _sel_containsIndexes!, indexSet._id); } static ffi.Pointer? _sel_intersectsIndexesInRange; bool intersectsIndexesInRange(NSRange range) { _sel_intersectsIndexesInRange ??= _registerName(_lib, "intersectsIndexesInRange:"); - return _lib._objc_msgSend_98(_id, _sel_intersectsIndexesInRange!, range); + return _lib._objc_msgSend_79(_id, _sel_intersectsIndexesInRange!, range); } static ffi.Pointer? _sel_enumerateIndexesUsingBlock; void enumerateIndexesUsingBlock(NSObject block) { _sel_enumerateIndexesUsingBlock ??= _registerName(_lib, "enumerateIndexesUsingBlock:"); - return _lib._objc_msgSend_100( - _id, _sel_enumerateIndexesUsingBlock!, block._id); + _lib._objc_msgSend_81(_id, _sel_enumerateIndexesUsingBlock!, block._id); } static ffi.Pointer? _sel_enumerateIndexesWithOptions; void enumerateIndexesWithOptions(int opts, NSObject block) { _sel_enumerateIndexesWithOptions ??= _registerName(_lib, "enumerateIndexesWithOptions:usingBlock:"); - return _lib._objc_msgSend_101( + _lib._objc_msgSend_82( _id, _sel_enumerateIndexesWithOptions!, opts, block._id); } @@ -4930,21 +4397,21 @@ class NSIndexSet extends NSObject { void enumerateIndexesInRange(NSRange range, int opts, NSObject block) { _sel_enumerateIndexesInRange ??= _registerName(_lib, "enumerateIndexesInRange:options:usingBlock:"); - return _lib._objc_msgSend_102( + _lib._objc_msgSend_83( _id, _sel_enumerateIndexesInRange!, range, opts, block._id); } static ffi.Pointer? _sel_indexPassingTest; int indexPassingTest(NSObject predicate) { _sel_indexPassingTest ??= _registerName(_lib, "indexPassingTest:"); - return _lib._objc_msgSend_103(_id, _sel_indexPassingTest!, predicate._id); + return _lib._objc_msgSend_84(_id, _sel_indexPassingTest!, predicate._id); } static ffi.Pointer? _sel_indexWithOptions; int indexWithOptions(int opts, NSObject predicate) { _sel_indexWithOptions ??= _registerName(_lib, "indexWithOptions:passingTest:"); - return _lib._objc_msgSend_104( + return _lib._objc_msgSend_85( _id, _sel_indexWithOptions!, opts, predicate._id); } @@ -4952,7 +4419,7 @@ class NSIndexSet extends NSObject { int indexInRange(NSRange range, int opts, NSObject predicate) { _sel_indexInRange ??= _registerName(_lib, "indexInRange:options:passingTest:"); - return _lib._objc_msgSend_105( + return _lib._objc_msgSend_86( _id, _sel_indexInRange!, range, opts, predicate._id); } @@ -4960,7 +4427,7 @@ class NSIndexSet extends NSObject { NSIndexSet indexesPassingTest(NSObject predicate) { _sel_indexesPassingTest ??= _registerName(_lib, "indexesPassingTest:"); final _ret = - _lib._objc_msgSend_106(_id, _sel_indexesPassingTest!, predicate._id); + _lib._objc_msgSend_87(_id, _sel_indexesPassingTest!, predicate._id); return NSIndexSet._(_ret, _lib); } @@ -4968,7 +4435,7 @@ class NSIndexSet extends NSObject { NSIndexSet indexesWithOptions(int opts, NSObject predicate) { _sel_indexesWithOptions ??= _registerName(_lib, "indexesWithOptions:passingTest:"); - final _ret = _lib._objc_msgSend_107( + final _ret = _lib._objc_msgSend_88( _id, _sel_indexesWithOptions!, opts, predicate._id); return NSIndexSet._(_ret, _lib); } @@ -4977,7 +4444,7 @@ class NSIndexSet extends NSObject { NSIndexSet indexesInRange(NSRange range, int opts, NSObject predicate) { _sel_indexesInRange ??= _registerName(_lib, "indexesInRange:options:passingTest:"); - final _ret = _lib._objc_msgSend_108( + final _ret = _lib._objc_msgSend_89( _id, _sel_indexesInRange!, range, opts, predicate._id); return NSIndexSet._(_ret, _lib); } @@ -4986,15 +4453,14 @@ class NSIndexSet extends NSObject { void enumerateRangesUsingBlock(NSObject block) { _sel_enumerateRangesUsingBlock ??= _registerName(_lib, "enumerateRangesUsingBlock:"); - return _lib._objc_msgSend_109( - _id, _sel_enumerateRangesUsingBlock!, block._id); + _lib._objc_msgSend_90(_id, _sel_enumerateRangesUsingBlock!, block._id); } static ffi.Pointer? _sel_enumerateRangesWithOptions; void enumerateRangesWithOptions(int opts, NSObject block) { _sel_enumerateRangesWithOptions ??= _registerName(_lib, "enumerateRangesWithOptions:usingBlock:"); - return _lib._objc_msgSend_110( + _lib._objc_msgSend_91( _id, _sel_enumerateRangesWithOptions!, opts, block._id); } @@ -5002,7 +4468,7 @@ class NSIndexSet extends NSObject { void enumerateRangesInRange(NSRange range, int opts, NSObject block) { _sel_enumerateRangesInRange ??= _registerName(_lib, "enumerateRangesInRange:options:usingBlock:"); - return _lib._objc_msgSend_111( + _lib._objc_msgSend_92( _id, _sel_enumerateRangesInRange!, range, opts, block._id); } @@ -5039,51 +4505,50 @@ class NSMutableIndexSet extends NSIndexSet { static ffi.Pointer? _sel_addIndexes; void addIndexes(NSObject indexSet) { _sel_addIndexes ??= _registerName(_lib, "addIndexes:"); - return _lib._objc_msgSend_112(_id, _sel_addIndexes!, indexSet._id); + _lib._objc_msgSend_93(_id, _sel_addIndexes!, indexSet._id); } static ffi.Pointer? _sel_removeIndexes; void removeIndexes(NSObject indexSet) { _sel_removeIndexes ??= _registerName(_lib, "removeIndexes:"); - return _lib._objc_msgSend_113(_id, _sel_removeIndexes!, indexSet._id); + _lib._objc_msgSend_94(_id, _sel_removeIndexes!, indexSet._id); } static ffi.Pointer? _sel_removeAllIndexes; void removeAllIndexes() { _sel_removeAllIndexes ??= _registerName(_lib, "removeAllIndexes"); - return _lib._objc_msgSend_0(_id, _sel_removeAllIndexes!); + _lib._objc_msgSend_0(_id, _sel_removeAllIndexes!); } static ffi.Pointer? _sel_addIndex; void addIndex(int value) { _sel_addIndex ??= _registerName(_lib, "addIndex:"); - return _lib._objc_msgSend_23(_id, _sel_addIndex!, value); + _lib._objc_msgSend_95(_id, _sel_addIndex!, value); } static ffi.Pointer? _sel_removeIndex; void removeIndex(int value) { _sel_removeIndex ??= _registerName(_lib, "removeIndex:"); - return _lib._objc_msgSend_23(_id, _sel_removeIndex!, value); + _lib._objc_msgSend_95(_id, _sel_removeIndex!, value); } static ffi.Pointer? _sel_addIndexesInRange; void addIndexesInRange(NSRange range) { _sel_addIndexesInRange ??= _registerName(_lib, "addIndexesInRange:"); - return _lib._objc_msgSend_114(_id, _sel_addIndexesInRange!, range); + _lib._objc_msgSend_96(_id, _sel_addIndexesInRange!, range); } static ffi.Pointer? _sel_removeIndexesInRange; void removeIndexesInRange(NSRange range) { _sel_removeIndexesInRange ??= _registerName(_lib, "removeIndexesInRange:"); - return _lib._objc_msgSend_114(_id, _sel_removeIndexesInRange!, range); + _lib._objc_msgSend_96(_id, _sel_removeIndexesInRange!, range); } static ffi.Pointer? _sel_shiftIndexesStartingAtIndex; void shiftIndexesStartingAtIndex(int index, int delta) { _sel_shiftIndexesStartingAtIndex ??= _registerName(_lib, "shiftIndexesStartingAtIndex:by:"); - return _lib._objc_msgSend_115( - _id, _sel_shiftIndexesStartingAtIndex!, index, delta); + _lib._objc_msgSend_97(_id, _sel_shiftIndexesStartingAtIndex!, index, delta); } static ffi.Pointer? _sel_indexSet; @@ -5099,7 +4564,7 @@ class NSMutableIndexSet extends NSIndexSet { NativeObjCLibrary _lib, int value) { _class ??= _getClass(_lib, "NSMutableIndexSet"); _sel_indexSetWithIndex ??= _registerName(_lib, "indexSetWithIndex:"); - final _ret = _lib._objc_msgSend_90(_class!, _sel_indexSetWithIndex!, value); + final _ret = _lib._objc_msgSend_71(_class!, _sel_indexSetWithIndex!, value); return NSMutableIndexSet._(_ret, _lib); } @@ -5110,7 +4575,7 @@ class NSMutableIndexSet extends NSIndexSet { _sel_indexSetWithIndexesInRange ??= _registerName(_lib, "indexSetWithIndexesInRange:"); final _ret = - _lib._objc_msgSend_91(_class!, _sel_indexSetWithIndexesInRange!, range); + _lib._objc_msgSend_72(_class!, _sel_indexSetWithIndexesInRange!, range); return NSMutableIndexSet._(_ret, _lib); } @@ -5154,8 +4619,7 @@ class NSOrderedCollectionDifference extends NSObject { static ffi.Pointer? _sel_initWithChanges; NSOrderedCollectionDifference initWithChanges(NSObject changes) { _sel_initWithChanges ??= _registerName(_lib, "initWithChanges:"); - final _ret = - _lib._objc_msgSend_116(_id, _sel_initWithChanges!, changes._id); + final _ret = _lib._objc_msgSend_98(_id, _sel_initWithChanges!, changes._id); return NSOrderedCollectionDifference._(_ret, _lib); } @@ -5168,7 +4632,7 @@ class NSOrderedCollectionDifference extends NSObject { NSObject changes) { _sel_initWithInsertIndexes ??= _registerName(_lib, "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:additionalChanges:"); - final _ret = _lib._objc_msgSend_117( + final _ret = _lib._objc_msgSend_99( _id, _sel_initWithInsertIndexes!, inserts._id, @@ -5184,7 +4648,7 @@ class NSOrderedCollectionDifference extends NSObject { NSObject insertedObjects, NSObject removes, NSObject removedObjects) { _sel_initWithInsertIndexes1 ??= _registerName(_lib, "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:"); - final _ret = _lib._objc_msgSend_118(_id, _sel_initWithInsertIndexes1!, + final _ret = _lib._objc_msgSend_100(_id, _sel_initWithInsertIndexes1!, inserts._id, insertedObjects._id, removes._id, removedObjects._id); return NSOrderedCollectionDifference._(_ret, _lib); } @@ -5192,41 +4656,23 @@ class NSOrderedCollectionDifference extends NSObject { static ffi.Pointer? _sel_insertions; NSObject get insertions { _sel_insertions ??= _registerName(_lib, "insertions"); - final _ret = _lib._objc_msgSend_119(_id, _sel_insertions!); + final _ret = _lib._objc_msgSend_101(_id, _sel_insertions!); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_insertions1; - set insertions(NSObject value) { - _sel_insertions1 ??= _registerName(_lib, "setInsertions:"); - return _lib._objc_msgSend_120(_id, _sel_insertions1!, value._id); - } - static ffi.Pointer? _sel_removals; NSObject get removals { _sel_removals ??= _registerName(_lib, "removals"); - final _ret = _lib._objc_msgSend_121(_id, _sel_removals!); + final _ret = _lib._objc_msgSend_102(_id, _sel_removals!); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_removals1; - set removals(NSObject value) { - _sel_removals1 ??= _registerName(_lib, "setRemovals:"); - return _lib._objc_msgSend_122(_id, _sel_removals1!, value._id); - } - static ffi.Pointer? _sel_hasChanges; bool get hasChanges { _sel_hasChanges ??= _registerName(_lib, "hasChanges"); return _lib._objc_msgSend_16(_id, _sel_hasChanges!); } - static ffi.Pointer? _sel_hasChanges1; - set hasChanges(bool value) { - _sel_hasChanges1 ??= _registerName(_lib, "setHasChanges:"); - return _lib._objc_msgSend_74(_id, _sel_hasChanges1!, value); - } - static ffi.Pointer? _sel_inverseDifference; NSOrderedCollectionDifference inverseDifference() { _sel_inverseDifference ??= _registerName(_lib, "inverseDifference"); @@ -5267,16 +4713,10 @@ class NSArray extends NSObject { return _lib._objc_msgSend_20(_id, _sel_count!); } - static ffi.Pointer? _sel_count1; - set count(int value) { - _sel_count1 ??= _registerName(_lib, "setCount:"); - return _lib._objc_msgSend_23(_id, _sel_count1!, value); - } - static ffi.Pointer? _sel_objectAtIndex; NSObject objectAtIndex(int index) { _sel_objectAtIndex ??= _registerName(_lib, "objectAtIndex:"); - final _ret = _lib._objc_msgSend_123(_id, _sel_objectAtIndex!, index); + final _ret = _lib._objc_msgSend_103(_id, _sel_objectAtIndex!, index); return NSObject._(_ret, _lib); } @@ -5293,14 +4733,14 @@ class NSArray extends NSObject { ffi.Pointer> objects, int cnt) { _sel_initWithObjects ??= _registerName(_lib, "initWithObjects:count:"); final _ret = - _lib._objc_msgSend_124(_id, _sel_initWithObjects!, objects, cnt); + _lib._objc_msgSend_104(_id, _sel_initWithObjects!, objects, cnt); return NSArray._(_ret, _lib); } static ffi.Pointer? _sel_initWithCoder; NSArray initWithCoder(NSObject coder) { _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_125(_id, _sel_initWithCoder!, coder._id); + final _ret = _lib._objc_msgSend_105(_id, _sel_initWithCoder!, coder._id); return NSArray._(_ret, _lib); } @@ -5340,32 +4780,32 @@ class NSMutableArray extends NSArray { static ffi.Pointer? _sel_addObject; void addObject(NSObject anObject) { _sel_addObject ??= _registerName(_lib, "addObject:"); - return _lib._objc_msgSend_126(_id, _sel_addObject!, anObject._id); + _lib._objc_msgSend_106(_id, _sel_addObject!, anObject._id); } static ffi.Pointer? _sel_insertObject; void insertObject(NSObject anObject, int index) { _sel_insertObject ??= _registerName(_lib, "insertObject:atIndex:"); - return _lib._objc_msgSend_127(_id, _sel_insertObject!, anObject._id, index); + _lib._objc_msgSend_107(_id, _sel_insertObject!, anObject._id, index); } static ffi.Pointer? _sel_removeLastObject; void removeLastObject() { _sel_removeLastObject ??= _registerName(_lib, "removeLastObject"); - return _lib._objc_msgSend_0(_id, _sel_removeLastObject!); + _lib._objc_msgSend_0(_id, _sel_removeLastObject!); } static ffi.Pointer? _sel_removeObjectAtIndex; void removeObjectAtIndex(int index) { _sel_removeObjectAtIndex ??= _registerName(_lib, "removeObjectAtIndex:"); - return _lib._objc_msgSend_23(_id, _sel_removeObjectAtIndex!, index); + _lib._objc_msgSend_95(_id, _sel_removeObjectAtIndex!, index); } static ffi.Pointer? _sel_replaceObjectAtIndex; void replaceObjectAtIndex(int index, NSObject anObject) { _sel_replaceObjectAtIndex ??= _registerName(_lib, "replaceObjectAtIndex:withObject:"); - return _lib._objc_msgSend_128( + _lib._objc_msgSend_108( _id, _sel_replaceObjectAtIndex!, index, anObject._id); } @@ -5380,7 +4820,7 @@ class NSMutableArray extends NSArray { static ffi.Pointer? _sel_initWithCapacity; NSMutableArray initWithCapacity(int numItems) { _sel_initWithCapacity ??= _registerName(_lib, "initWithCapacity:"); - final _ret = _lib._objc_msgSend_90(_id, _sel_initWithCapacity!, numItems); + final _ret = _lib._objc_msgSend_71(_id, _sel_initWithCapacity!, numItems); return NSMutableArray._(_ret, _lib); } @@ -5388,7 +4828,7 @@ class NSMutableArray extends NSArray { @override NSMutableArray initWithCoder(NSObject coder) { _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_129(_id, _sel_initWithCoder!, coder._id); + final _ret = _lib._objc_msgSend_109(_id, _sel_initWithCoder!, coder._id); return NSMutableArray._(_ret, _lib); } @@ -5443,7 +4883,7 @@ class NSItemProvider extends NSObject { NSObject typeIdentifier, int visibility, NSObject loadHandler) { _sel_registerDataRepresentationForTypeIdentifier ??= _registerName(_lib, "registerDataRepresentationForTypeIdentifier:visibility:loadHandler:"); - return _lib._objc_msgSend_130( + _lib._objc_msgSend_110( _id, _sel_registerDataRepresentationForTypeIdentifier!, typeIdentifier._id, @@ -5456,7 +4896,7 @@ class NSItemProvider extends NSObject { int fileOptions, int visibility, NSObject loadHandler) { _sel_registerFileRepresentationForTypeIdentifier ??= _registerName(_lib, "registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:"); - return _lib._objc_msgSend_131( + _lib._objc_msgSend_111( _id, _sel_registerFileRepresentationForTypeIdentifier!, typeIdentifier._id, @@ -5469,23 +4909,15 @@ class NSItemProvider extends NSObject { NSObject get registeredTypeIdentifiers { _sel_registeredTypeIdentifiers ??= _registerName(_lib, "registeredTypeIdentifiers"); - final _ret = _lib._objc_msgSend_132(_id, _sel_registeredTypeIdentifiers!); + final _ret = _lib._objc_msgSend_112(_id, _sel_registeredTypeIdentifiers!); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_registeredTypeIdentifiers1; - set registeredTypeIdentifiers(NSObject value) { - _sel_registeredTypeIdentifiers1 ??= - _registerName(_lib, "setRegisteredTypeIdentifiers:"); - return _lib._objc_msgSend_133( - _id, _sel_registeredTypeIdentifiers1!, value._id); - } - static ffi.Pointer? _sel_hasItemConformingToTypeIdentifier; bool hasItemConformingToTypeIdentifier(NSObject typeIdentifier) { _sel_hasItemConformingToTypeIdentifier ??= _registerName(_lib, "hasItemConformingToTypeIdentifier:"); - return _lib._objc_msgSend_134( + return _lib._objc_msgSend_113( _id, _sel_hasItemConformingToTypeIdentifier!, typeIdentifier._id); } @@ -5494,7 +4926,7 @@ class NSItemProvider extends NSObject { NSObject typeIdentifier, int fileOptions) { _sel_hasRepresentationConformingToTypeIdentifier ??= _registerName( _lib, "hasRepresentationConformingToTypeIdentifier:fileOptions:"); - return _lib._objc_msgSend_135( + return _lib._objc_msgSend_114( _id, _sel_hasRepresentationConformingToTypeIdentifier!, typeIdentifier._id, @@ -5506,7 +4938,7 @@ class NSItemProvider extends NSObject { NSObject typeIdentifier, NSObject completionHandler) { _sel_loadDataRepresentationForTypeIdentifier ??= _registerName( _lib, "loadDataRepresentationForTypeIdentifier:completionHandler:"); - final _ret = _lib._objc_msgSend_136( + final _ret = _lib._objc_msgSend_115( _id, _sel_loadDataRepresentationForTypeIdentifier!, typeIdentifier._id, @@ -5519,7 +4951,7 @@ class NSItemProvider extends NSObject { NSObject typeIdentifier, NSObject completionHandler) { _sel_loadFileRepresentationForTypeIdentifier ??= _registerName( _lib, "loadFileRepresentationForTypeIdentifier:completionHandler:"); - final _ret = _lib._objc_msgSend_137( + final _ret = _lib._objc_msgSend_116( _id, _sel_loadFileRepresentationForTypeIdentifier!, typeIdentifier._id, @@ -5533,7 +4965,7 @@ class NSItemProvider extends NSObject { NSObject typeIdentifier, NSObject completionHandler) { _sel_loadInPlaceFileRepresentationForTypeIdentifier ??= _registerName(_lib, "loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:"); - final _ret = _lib._objc_msgSend_138( + final _ret = _lib._objc_msgSend_117( _id, _sel_loadInPlaceFileRepresentationForTypeIdentifier!, typeIdentifier._id, @@ -5544,28 +4976,27 @@ class NSItemProvider extends NSObject { static ffi.Pointer? _sel_suggestedName; NSObject get suggestedName { _sel_suggestedName ??= _registerName(_lib, "suggestedName"); - final _ret = _lib._objc_msgSend_139(_id, _sel_suggestedName!); + final _ret = _lib._objc_msgSend_118(_id, _sel_suggestedName!); return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_suggestedName1; set suggestedName(NSObject value) { _sel_suggestedName1 ??= _registerName(_lib, "setSuggestedName:"); - return _lib._objc_msgSend_140(_id, _sel_suggestedName1!, value._id); + _lib._objc_msgSend_119(_id, _sel_suggestedName1!, value._id); } static ffi.Pointer? _sel_initWithObject; NSItemProvider initWithObject(NSObject object) { _sel_initWithObject ??= _registerName(_lib, "initWithObject:"); - final _ret = _lib._objc_msgSend_141(_id, _sel_initWithObject!, object._id); + final _ret = _lib._objc_msgSend_120(_id, _sel_initWithObject!, object._id); return NSItemProvider._(_ret, _lib); } static ffi.Pointer? _sel_registerObject; void registerObject(NSObject object, int visibility) { _sel_registerObject ??= _registerName(_lib, "registerObject:visibility:"); - return _lib._objc_msgSend_142( - _id, _sel_registerObject!, object._id, visibility); + _lib._objc_msgSend_121(_id, _sel_registerObject!, object._id, visibility); } static ffi.Pointer? _sel_registerObjectOfClass; @@ -5573,21 +5004,21 @@ class NSItemProvider extends NSObject { NSObject aClass, int visibility, NSObject loadHandler) { _sel_registerObjectOfClass ??= _registerName(_lib, "registerObjectOfClass:visibility:loadHandler:"); - return _lib._objc_msgSend_143(_id, _sel_registerObjectOfClass!, aClass._id, + _lib._objc_msgSend_122(_id, _sel_registerObjectOfClass!, aClass._id, visibility, loadHandler._id); } static ffi.Pointer? _sel_canLoadObjectOfClass; bool canLoadObjectOfClass(NSObject aClass) { _sel_canLoadObjectOfClass ??= _registerName(_lib, "canLoadObjectOfClass:"); - return _lib._objc_msgSend_144(_id, _sel_canLoadObjectOfClass!, aClass._id); + return _lib._objc_msgSend_123(_id, _sel_canLoadObjectOfClass!, aClass._id); } static ffi.Pointer? _sel_loadObjectOfClass; NSProgress loadObjectOfClass(NSObject aClass, NSObject completionHandler) { _sel_loadObjectOfClass ??= _registerName(_lib, "loadObjectOfClass:completionHandler:"); - final _ret = _lib._objc_msgSend_145( + final _ret = _lib._objc_msgSend_124( _id, _sel_loadObjectOfClass!, aClass._id, completionHandler._id); return NSProgress._(_ret, _lib); } @@ -5595,7 +5026,7 @@ class NSItemProvider extends NSObject { static ffi.Pointer? _sel_initWithItem; NSItemProvider initWithItem(NSObject item, NSObject typeIdentifier) { _sel_initWithItem ??= _registerName(_lib, "initWithItem:typeIdentifier:"); - final _ret = _lib._objc_msgSend_146( + final _ret = _lib._objc_msgSend_125( _id, _sel_initWithItem!, item._id, typeIdentifier._id); return NSItemProvider._(_ret, _lib); } @@ -5605,7 +5036,7 @@ class NSItemProvider extends NSObject { _sel_initWithContentsOfURL ??= _registerName(_lib, "initWithContentsOfURL:"); final _ret = - _lib._objc_msgSend_147(_id, _sel_initWithContentsOfURL!, fileURL._id); + _lib._objc_msgSend_126(_id, _sel_initWithContentsOfURL!, fileURL._id); return NSItemProvider._(_ret, _lib); } @@ -5614,7 +5045,7 @@ class NSItemProvider extends NSObject { NSObject typeIdentifier, NSItemProviderLoadHandler loadHandler) { _sel_registerItemForTypeIdentifier ??= _registerName(_lib, "registerItemForTypeIdentifier:loadHandler:"); - return _lib._objc_msgSend_148(_id, _sel_registerItemForTypeIdentifier!, + _lib._objc_msgSend_127(_id, _sel_registerItemForTypeIdentifier!, typeIdentifier._id, loadHandler); } @@ -5623,7 +5054,7 @@ class NSItemProvider extends NSObject { NSItemProviderCompletionHandler completionHandler) { _sel_loadItemForTypeIdentifier ??= _registerName( _lib, "loadItemForTypeIdentifier:options:completionHandler:"); - return _lib._objc_msgSend_149(_id, _sel_loadItemForTypeIdentifier!, + _lib._objc_msgSend_128(_id, _sel_loadItemForTypeIdentifier!, typeIdentifier._id, options._id, completionHandler); } @@ -5712,7 +5143,7 @@ class NSMutableString extends NSString { void replaceCharactersInRange(NSRange range, NSObject aString) { _sel_replaceCharactersInRange ??= _registerName(_lib, "replaceCharactersInRange:withString:"); - return _lib._objc_msgSend_150( + _lib._objc_msgSend_129( _id, _sel_replaceCharactersInRange!, range, aString._id); } @@ -5723,7 +5154,7 @@ class NSMutableString extends NSString { _sel_stringWithCString ??= _registerName(_lib, "stringWithCString:encoding:"); final _ret = - _lib._objc_msgSend_26(_class!, _sel_stringWithCString!, cString, enc); + _lib._objc_msgSend_25(_class!, _sel_stringWithCString!, cString, enc); return NSString._(_ret, _lib); } @@ -5763,7 +5194,7 @@ class NSSimpleCString extends NSString { _sel_stringWithCString ??= _registerName(_lib, "stringWithCString:encoding:"); final _ret = - _lib._objc_msgSend_26(_class!, _sel_stringWithCString!, cString, enc); + _lib._objc_msgSend_25(_class!, _sel_stringWithCString!, cString, enc); return NSString._(_ret, _lib); } @@ -5801,7 +5232,7 @@ class NSConstantString extends NSSimpleCString { _sel_stringWithCString ??= _registerName(_lib, "stringWithCString:encoding:"); final _ret = - _lib._objc_msgSend_26(_class!, _sel_stringWithCString!, cString, enc); + _lib._objc_msgSend_25(_class!, _sel_stringWithCString!, cString, enc); return NSString._(_ret, _lib); } @@ -5834,33 +5265,62 @@ class Foo extends NSObject { static ffi.Pointer? _sel_intVal; int get intVal { _sel_intVal ??= _registerName(_lib, "intVal"); - return _lib._objc_msgSend_151(_id, _sel_intVal!); + return _lib._objc_msgSend_130(_id, _sel_intVal!); } static ffi.Pointer? _sel_intVal1; set intVal(int value) { _sel_intVal1 ??= _registerName(_lib, "setIntVal:"); - return _lib._objc_msgSend_152(_id, _sel_intVal1!, value); + _lib._objc_msgSend_131(_id, _sel_intVal1!, value); + } + + static ffi.Pointer? _sel_readOnlyProperty; + int get readOnlyProperty { + _sel_readOnlyProperty ??= _registerName(_lib, "readOnlyProperty"); + return _lib._objc_msgSend_130(_id, _sel_readOnlyProperty!); + } + + static ffi.Pointer? _sel_classReadOnlyProperty; + static int getClassReadOnlyProperty(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "Foo"); + _sel_classReadOnlyProperty ??= _registerName(_lib, "classReadOnlyProperty"); + return _lib._objc_msgSend_130(_class!, _sel_classReadOnlyProperty!); + } + + static ffi.Pointer? _sel_classReadWriteProperty; + static int getClassReadWriteProperty(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "Foo"); + _sel_classReadWriteProperty ??= + _registerName(_lib, "classReadWriteProperty"); + return _lib._objc_msgSend_130(_class!, _sel_classReadWriteProperty!); + } + + static ffi.Pointer? _sel_classReadWriteProperty1; + static void setClassReadWriteProperty(NativeObjCLibrary _lib, int value) { + _class ??= _getClass(_lib, "Foo"); + _sel_classReadWriteProperty1 ??= + _registerName(_lib, "setClassReadWriteProperty:"); + _lib._objc_msgSend_131(_class!, _sel_classReadWriteProperty1!, value); } static ffi.Pointer? _sel_makeFoo; static Foo makeFoo(NativeObjCLibrary _lib, double x) { _class ??= _getClass(_lib, "Foo"); _sel_makeFoo ??= _registerName(_lib, "makeFoo:"); - final _ret = _lib._objc_msgSend_153(_class!, _sel_makeFoo!, x); + final _ret = _lib._objc_msgSend_132(_class!, _sel_makeFoo!, x); return Foo._(_ret, _lib); } static ffi.Pointer? _sel_multiply; int multiply(bool useIntVals, NSObject other) { _sel_multiply ??= _registerName(_lib, "multiply:withOtherFoo:"); - return _lib._objc_msgSend_154(_id, _sel_multiply!, useIntVals, other._id); + return _lib._objc_msgSend_133(_id, _sel_multiply!, useIntVals, other._id); } static ffi.Pointer? _sel_setDoubleVal; void setDoubleVal(double x) { _sel_setDoubleVal ??= _registerName(_lib, "setDoubleVal:"); - return _lib._objc_msgSend_73(_id, _sel_setDoubleVal!, x); + _lib._objc_msgSend_134(_id, _sel_setDoubleVal!, x); } static ffi.Pointer? _sel_new1; @@ -5894,7 +5354,7 @@ class StringUtil extends NSObject { static NSString strConcat(NativeObjCLibrary _lib, NSObject a, NSObject b) { _class ??= _getClass(_lib, "StringUtil"); _sel_strConcat ??= _registerName(_lib, "strConcat:with:"); - final _ret = _lib._objc_msgSend_155(_class!, _sel_strConcat!, a._id, b._id); + final _ret = _lib._objc_msgSend_135(_class!, _sel_strConcat!, a._id, b._id); return NSString._(_ret, _lib); } diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index 37d96f9dc9..2c398ed4e0 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -39,6 +39,7 @@ enums: - CXDiagnosticDisplayOptions - CXTranslationUnit_Flags - CXEvalResultKind + - CXObjCPropertyAttrKind structs: include: @@ -110,5 +111,6 @@ functions: - clang_Cursor_isNull - clang_Cursor_hasAttrs - clang_Type_getObjCObjectBaseType + - clang_Cursor_getObjCPropertyAttributes - clang_Cursor_getObjCPropertyGetterName - clang_Cursor_getObjCPropertySetterName From 2015d3e1ef65811d864c7df85cd1962fedb2a2cd Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Wed, 13 Apr 2022 14:08:37 -0700 Subject: [PATCH 115/276] [ffigen] Generate complete method signatures. (#319) --- .../src/code_generator/objc_interface.dart | 9 +- .../_expected_objc_interface_bindings.dart | 20 +- .../native_objc_test/native_objc_test.dart | 14 +- .../native_objc_test_bindings.dart | 430 ++++++++++-------- 4 files changed, 270 insertions(+), 203 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 98ba81d81b..4b59379985 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -113,7 +113,7 @@ class _ObjCBuiltInFunctions { // Generate a constructor that wraps stringWithCString. s.write(' factory NSString(${w.className} _lib, String str) {\n'); s.write(' final cstr = str.toNativeUtf8();\n'); - s.write(' final nsstr = stringWithCString(' + s.write(' final nsstr = stringWithCString_encoding(' '_lib, cstr.cast(), 4 /* UTF8 */);\n'); s.write(' ${w.ffiPkgLibraryPrefix}.calloc.free(cstr);\n'); s.write(' return nsstr;\n'); @@ -493,10 +493,9 @@ class ObjCMethod { // foo: // foo:someArgName: // If there is a trailing ':', omit it. Replace all other ':' with '_'. - var name = originalName; - final index = name.indexOf(':'); - if (index != -1) name = name.substring(0, index); - return uniqueNamer.makeUnique(name.replaceAll(':', '_')); + final name = + originalName.replaceAll(RegExp(r":$"), "").replaceAll(":", "_"); + return uniqueNamer.makeUnique(name); } } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart index da35a90ed8..93b66b24c3 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart @@ -717,12 +717,12 @@ class Foo extends NSObject { return Foo._(_ret, _lib); } - static ffi.Pointer? _sel_anInstanceMethod; - int anInstanceMethod(NSObject someArg, NSObject otherArg) { - _sel_anInstanceMethod ??= + static ffi.Pointer? _sel_anInstanceMethod_withOtherArg; + int anInstanceMethod_withOtherArg(NSObject someArg, NSObject otherArg) { + _sel_anInstanceMethod_withOtherArg ??= _registerName(_lib, "anInstanceMethod:withOtherArg:"); return _lib._objc_msgSend_29( - _id, _sel_anInstanceMethod!, someArg._id, otherArg._id); + _id, _sel_anInstanceMethod_withOtherArg!, someArg._id, otherArg._id); } static ffi.Pointer? _sel_new1; @@ -1024,7 +1024,7 @@ class NSString extends _ObjCWrapper { factory NSString(NativeLibrary _lib, String str) { final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString(_lib, cstr.cast(), 4 /* UTF8 */); + final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); pkg_ffi.calloc.free(cstr); return nsstr; } @@ -1032,14 +1032,14 @@ class NSString extends _ObjCWrapper { @override String toString() => UTF8String().cast().toDartString(); - static ffi.Pointer? _sel_stringWithCString; - static NSString stringWithCString( + static ffi.Pointer? _sel_stringWithCString_encoding; + static NSString stringWithCString_encoding( NativeLibrary _lib, ffi.Pointer cString, int enc) { _class ??= _getClass(_lib, "NSString"); - _sel_stringWithCString ??= + _sel_stringWithCString_encoding ??= _registerName(_lib, "stringWithCString:encoding:"); - final _ret = - _lib._objc_msgSend_23(_class!, _sel_stringWithCString!, cString, enc); + final _ret = _lib._objc_msgSend_23( + _class!, _sel_stringWithCString_encoding!, cString, enc); return NSString._(_ret, _lib); } diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart index 5e16be57b3..f32b0b7c73 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart @@ -54,16 +54,16 @@ void main() { expect(foo1.intVal, 3); expect(foo2.intVal, 2); - expect(foo1.multiply(false, foo2), 8); - expect(foo1.multiply(true, foo2), 6); + expect(foo1.multiply_withOtherFoo(false, foo2), 8); + expect(foo1.multiply_withOtherFoo(true, foo2), 6); foo1.intVal = 100; - expect(foo1.multiply(false, foo2), 8); - expect(foo1.multiply(true, foo2), 200); + expect(foo1.multiply_withOtherFoo(false, foo2), 8); + expect(foo1.multiply_withOtherFoo(true, foo2), 200); foo2.setDoubleVal(1.61803); - expect(foo1.multiply(false, foo2), 5); - expect(foo1.multiply(true, foo2), 200); + expect(foo1.multiply_withOtherFoo(false, foo2), 5); + expect(foo1.multiply_withOtherFoo(true, foo2), 200); }); test('NSString manipulations', () { @@ -76,7 +76,7 @@ void main() { expect(str1.toString(), "Hello"); expect(str2.toString(), "World!"); - final str3 = StringUtil.strConcat(lib, str1, str2); + final str3 = StringUtil.strConcat_with(lib, str1, str2); expect(str3.length, 11); expect(str3.toString(), "HelloWorld!"); }); diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart index 151834aa38..25c41cf949 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart @@ -3416,10 +3416,10 @@ class NSValue extends NSObject { return NSValue._(other._id, other._lib); } - static ffi.Pointer? _sel_getValue; - void getValue(ffi.Pointer value, int size) { - _sel_getValue ??= _registerName(_lib, "getValue:size:"); - _lib._objc_msgSend_28(_id, _sel_getValue!, value, size); + static ffi.Pointer? _sel_getValue_size; + void getValue_size(ffi.Pointer value, int size) { + _sel_getValue_size ??= _registerName(_lib, "getValue:size:"); + _lib._objc_msgSend_28(_id, _sel_getValue_size!, value, size); } static ffi.Pointer? _sel_objCType; @@ -3428,11 +3428,13 @@ class NSValue extends NSObject { return _lib._objc_msgSend_29(_id, _sel_objCType!); } - static ffi.Pointer? _sel_initWithBytes; - NSValue initWithBytes( + static ffi.Pointer? _sel_initWithBytes_objCType; + NSValue initWithBytes_objCType( ffi.Pointer value, ffi.Pointer type) { - _sel_initWithBytes ??= _registerName(_lib, "initWithBytes:objCType:"); - final _ret = _lib._objc_msgSend_30(_id, _sel_initWithBytes!, value, type); + _sel_initWithBytes_objCType ??= + _registerName(_lib, "initWithBytes:objCType:"); + final _ret = + _lib._objc_msgSend_30(_id, _sel_initWithBytes_objCType!, value, type); return NSValue._(_ret, _lib); } @@ -3747,7 +3749,7 @@ class NSString extends NSObject { factory NSString(NativeObjCLibrary _lib, String str) { final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString(_lib, cstr.cast(), 4 /* UTF8 */); + final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); pkg_ffi.calloc.free(cstr); return nsstr; } @@ -3782,14 +3784,14 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_stringWithCString; - static NSString stringWithCString( + static ffi.Pointer? _sel_stringWithCString_encoding; + static NSString stringWithCString_encoding( NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { _class ??= _getClass(_lib, "NSString"); - _sel_stringWithCString ??= + _sel_stringWithCString_encoding ??= _registerName(_lib, "stringWithCString:encoding:"); - final _ret = - _lib._objc_msgSend_25(_class!, _sel_stringWithCString!, cString, enc); + final _ret = _lib._objc_msgSend_25( + _class!, _sel_stringWithCString_encoding!, cString, enc); return NSString._(_ret, _lib); } @@ -4187,22 +4189,28 @@ class NSOrderedCollectionChange extends NSObject { return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_initWithObject; - NSOrderedCollectionChange initWithObject( + static ffi.Pointer? _sel_initWithObject_type_index; + NSOrderedCollectionChange initWithObject_type_index( NSObject anObject, int type, int index) { - _sel_initWithObject ??= _registerName(_lib, "initWithObject:type:index:"); + _sel_initWithObject_type_index ??= + _registerName(_lib, "initWithObject:type:index:"); final _ret = _lib._objc_msgSend_69( - _id, _sel_initWithObject!, anObject._id, type, index); + _id, _sel_initWithObject_type_index!, anObject._id, type, index); return NSOrderedCollectionChange._(_ret, _lib); } - static ffi.Pointer? _sel_initWithObject1; - NSOrderedCollectionChange initWithObject1( + static ffi.Pointer? _sel_initWithObject_type_index_associatedIndex; + NSOrderedCollectionChange initWithObject_type_index_associatedIndex( NSObject anObject, int type, int index, int associatedIndex) { - _sel_initWithObject1 ??= + _sel_initWithObject_type_index_associatedIndex ??= _registerName(_lib, "initWithObject:type:index:associatedIndex:"); final _ret = _lib._objc_msgSend_70( - _id, _sel_initWithObject1!, anObject._id, type, index, associatedIndex); + _id, + _sel_initWithObject_type_index_associatedIndex!, + anObject._id, + type, + index, + associatedIndex); return NSOrderedCollectionChange._(_ret, _lib); } @@ -4336,13 +4344,13 @@ class NSIndexSet extends NSObject { return _lib._objc_msgSend_75(_id, _sel_indexLessThanOrEqualToIndex!, value); } - static ffi.Pointer? _sel_getIndexes; - int getIndexes(ffi.Pointer indexBuffer, int bufferSize, - NSRangePointer range) { - _sel_getIndexes ??= + static ffi.Pointer? _sel_getIndexes_maxCount_inIndexRange; + int getIndexes_maxCount_inIndexRange(ffi.Pointer indexBuffer, + int bufferSize, NSRangePointer range) { + _sel_getIndexes_maxCount_inIndexRange ??= _registerName(_lib, "getIndexes:maxCount:inIndexRange:"); - return _lib._objc_msgSend_76( - _id, _sel_getIndexes!, indexBuffer, bufferSize, range); + return _lib._objc_msgSend_76(_id, _sel_getIndexes_maxCount_inIndexRange!, + indexBuffer, bufferSize, range); } static ffi.Pointer? _sel_countOfIndexesInRange; @@ -4385,20 +4393,21 @@ class NSIndexSet extends NSObject { _lib._objc_msgSend_81(_id, _sel_enumerateIndexesUsingBlock!, block._id); } - static ffi.Pointer? _sel_enumerateIndexesWithOptions; - void enumerateIndexesWithOptions(int opts, NSObject block) { - _sel_enumerateIndexesWithOptions ??= + static ffi.Pointer? _sel_enumerateIndexesWithOptions_usingBlock; + void enumerateIndexesWithOptions_usingBlock(int opts, NSObject block) { + _sel_enumerateIndexesWithOptions_usingBlock ??= _registerName(_lib, "enumerateIndexesWithOptions:usingBlock:"); _lib._objc_msgSend_82( - _id, _sel_enumerateIndexesWithOptions!, opts, block._id); + _id, _sel_enumerateIndexesWithOptions_usingBlock!, opts, block._id); } - static ffi.Pointer? _sel_enumerateIndexesInRange; - void enumerateIndexesInRange(NSRange range, int opts, NSObject block) { - _sel_enumerateIndexesInRange ??= + static ffi.Pointer? _sel_enumerateIndexesInRange_options_usingBlock; + void enumerateIndexesInRange_options_usingBlock( + NSRange range, int opts, NSObject block) { + _sel_enumerateIndexesInRange_options_usingBlock ??= _registerName(_lib, "enumerateIndexesInRange:options:usingBlock:"); - _lib._objc_msgSend_83( - _id, _sel_enumerateIndexesInRange!, range, opts, block._id); + _lib._objc_msgSend_83(_id, _sel_enumerateIndexesInRange_options_usingBlock!, + range, opts, block._id); } static ffi.Pointer? _sel_indexPassingTest; @@ -4407,20 +4416,21 @@ class NSIndexSet extends NSObject { return _lib._objc_msgSend_84(_id, _sel_indexPassingTest!, predicate._id); } - static ffi.Pointer? _sel_indexWithOptions; - int indexWithOptions(int opts, NSObject predicate) { - _sel_indexWithOptions ??= + static ffi.Pointer? _sel_indexWithOptions_passingTest; + int indexWithOptions_passingTest(int opts, NSObject predicate) { + _sel_indexWithOptions_passingTest ??= _registerName(_lib, "indexWithOptions:passingTest:"); return _lib._objc_msgSend_85( - _id, _sel_indexWithOptions!, opts, predicate._id); + _id, _sel_indexWithOptions_passingTest!, opts, predicate._id); } - static ffi.Pointer? _sel_indexInRange; - int indexInRange(NSRange range, int opts, NSObject predicate) { - _sel_indexInRange ??= + static ffi.Pointer? _sel_indexInRange_options_passingTest; + int indexInRange_options_passingTest( + NSRange range, int opts, NSObject predicate) { + _sel_indexInRange_options_passingTest ??= _registerName(_lib, "indexInRange:options:passingTest:"); - return _lib._objc_msgSend_86( - _id, _sel_indexInRange!, range, opts, predicate._id); + return _lib._objc_msgSend_86(_id, _sel_indexInRange_options_passingTest!, + range, opts, predicate._id); } static ffi.Pointer? _sel_indexesPassingTest; @@ -4431,21 +4441,22 @@ class NSIndexSet extends NSObject { return NSIndexSet._(_ret, _lib); } - static ffi.Pointer? _sel_indexesWithOptions; - NSIndexSet indexesWithOptions(int opts, NSObject predicate) { - _sel_indexesWithOptions ??= + static ffi.Pointer? _sel_indexesWithOptions_passingTest; + NSIndexSet indexesWithOptions_passingTest(int opts, NSObject predicate) { + _sel_indexesWithOptions_passingTest ??= _registerName(_lib, "indexesWithOptions:passingTest:"); final _ret = _lib._objc_msgSend_88( - _id, _sel_indexesWithOptions!, opts, predicate._id); + _id, _sel_indexesWithOptions_passingTest!, opts, predicate._id); return NSIndexSet._(_ret, _lib); } - static ffi.Pointer? _sel_indexesInRange; - NSIndexSet indexesInRange(NSRange range, int opts, NSObject predicate) { - _sel_indexesInRange ??= + static ffi.Pointer? _sel_indexesInRange_options_passingTest; + NSIndexSet indexesInRange_options_passingTest( + NSRange range, int opts, NSObject predicate) { + _sel_indexesInRange_options_passingTest ??= _registerName(_lib, "indexesInRange:options:passingTest:"); - final _ret = _lib._objc_msgSend_89( - _id, _sel_indexesInRange!, range, opts, predicate._id); + final _ret = _lib._objc_msgSend_89(_id, + _sel_indexesInRange_options_passingTest!, range, opts, predicate._id); return NSIndexSet._(_ret, _lib); } @@ -4456,20 +4467,21 @@ class NSIndexSet extends NSObject { _lib._objc_msgSend_90(_id, _sel_enumerateRangesUsingBlock!, block._id); } - static ffi.Pointer? _sel_enumerateRangesWithOptions; - void enumerateRangesWithOptions(int opts, NSObject block) { - _sel_enumerateRangesWithOptions ??= + static ffi.Pointer? _sel_enumerateRangesWithOptions_usingBlock; + void enumerateRangesWithOptions_usingBlock(int opts, NSObject block) { + _sel_enumerateRangesWithOptions_usingBlock ??= _registerName(_lib, "enumerateRangesWithOptions:usingBlock:"); _lib._objc_msgSend_91( - _id, _sel_enumerateRangesWithOptions!, opts, block._id); + _id, _sel_enumerateRangesWithOptions_usingBlock!, opts, block._id); } - static ffi.Pointer? _sel_enumerateRangesInRange; - void enumerateRangesInRange(NSRange range, int opts, NSObject block) { - _sel_enumerateRangesInRange ??= + static ffi.Pointer? _sel_enumerateRangesInRange_options_usingBlock; + void enumerateRangesInRange_options_usingBlock( + NSRange range, int opts, NSObject block) { + _sel_enumerateRangesInRange_options_usingBlock ??= _registerName(_lib, "enumerateRangesInRange:options:usingBlock:"); - _lib._objc_msgSend_92( - _id, _sel_enumerateRangesInRange!, range, opts, block._id); + _lib._objc_msgSend_92(_id, _sel_enumerateRangesInRange_options_usingBlock!, + range, opts, block._id); } static ffi.Pointer? _sel_new1; @@ -4544,11 +4556,12 @@ class NSMutableIndexSet extends NSIndexSet { _lib._objc_msgSend_96(_id, _sel_removeIndexesInRange!, range); } - static ffi.Pointer? _sel_shiftIndexesStartingAtIndex; - void shiftIndexesStartingAtIndex(int index, int delta) { - _sel_shiftIndexesStartingAtIndex ??= + static ffi.Pointer? _sel_shiftIndexesStartingAtIndex_by; + void shiftIndexesStartingAtIndex_by(int index, int delta) { + _sel_shiftIndexesStartingAtIndex_by ??= _registerName(_lib, "shiftIndexesStartingAtIndex:by:"); - _lib._objc_msgSend_97(_id, _sel_shiftIndexesStartingAtIndex!, index, delta); + _lib._objc_msgSend_97( + _id, _sel_shiftIndexesStartingAtIndex_by!, index, delta); } static ffi.Pointer? _sel_indexSet; @@ -4623,18 +4636,21 @@ class NSOrderedCollectionDifference extends NSObject { return NSOrderedCollectionDifference._(_ret, _lib); } - static ffi.Pointer? _sel_initWithInsertIndexes; - NSOrderedCollectionDifference initWithInsertIndexes( - NSObject inserts, - NSObject insertedObjects, - NSObject removes, - NSObject removedObjects, - NSObject changes) { - _sel_initWithInsertIndexes ??= _registerName(_lib, - "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:additionalChanges:"); + static ffi.Pointer? + _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges; + NSOrderedCollectionDifference + initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges( + NSObject inserts, + NSObject insertedObjects, + NSObject removes, + NSObject removedObjects, + NSObject changes) { + _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges ??= + _registerName(_lib, + "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:additionalChanges:"); final _ret = _lib._objc_msgSend_99( _id, - _sel_initWithInsertIndexes!, + _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges!, inserts._id, insertedObjects._id, removes._id, @@ -4643,13 +4659,24 @@ class NSOrderedCollectionDifference extends NSObject { return NSOrderedCollectionDifference._(_ret, _lib); } - static ffi.Pointer? _sel_initWithInsertIndexes1; - NSOrderedCollectionDifference initWithInsertIndexes1(NSObject inserts, - NSObject insertedObjects, NSObject removes, NSObject removedObjects) { - _sel_initWithInsertIndexes1 ??= _registerName(_lib, - "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:"); - final _ret = _lib._objc_msgSend_100(_id, _sel_initWithInsertIndexes1!, - inserts._id, insertedObjects._id, removes._id, removedObjects._id); + static ffi.Pointer? + _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects; + NSOrderedCollectionDifference + initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects( + NSObject inserts, + NSObject insertedObjects, + NSObject removes, + NSObject removedObjects) { + _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects ??= + _registerName(_lib, + "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:"); + final _ret = _lib._objc_msgSend_100( + _id, + _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects!, + inserts._id, + insertedObjects._id, + removes._id, + removedObjects._id); return NSOrderedCollectionDifference._(_ret, _lib); } @@ -4728,12 +4755,13 @@ class NSArray extends NSObject { return NSArray._(_ret, _lib); } - static ffi.Pointer? _sel_initWithObjects; - NSArray initWithObjects( + static ffi.Pointer? _sel_initWithObjects_count; + NSArray initWithObjects_count( ffi.Pointer> objects, int cnt) { - _sel_initWithObjects ??= _registerName(_lib, "initWithObjects:count:"); + _sel_initWithObjects_count ??= + _registerName(_lib, "initWithObjects:count:"); final _ret = - _lib._objc_msgSend_104(_id, _sel_initWithObjects!, objects, cnt); + _lib._objc_msgSend_104(_id, _sel_initWithObjects_count!, objects, cnt); return NSArray._(_ret, _lib); } @@ -4783,10 +4811,11 @@ class NSMutableArray extends NSArray { _lib._objc_msgSend_106(_id, _sel_addObject!, anObject._id); } - static ffi.Pointer? _sel_insertObject; - void insertObject(NSObject anObject, int index) { - _sel_insertObject ??= _registerName(_lib, "insertObject:atIndex:"); - _lib._objc_msgSend_107(_id, _sel_insertObject!, anObject._id, index); + static ffi.Pointer? _sel_insertObject_atIndex; + void insertObject_atIndex(NSObject anObject, int index) { + _sel_insertObject_atIndex ??= _registerName(_lib, "insertObject:atIndex:"); + _lib._objc_msgSend_107( + _id, _sel_insertObject_atIndex!, anObject._id, index); } static ffi.Pointer? _sel_removeLastObject; @@ -4801,12 +4830,12 @@ class NSMutableArray extends NSArray { _lib._objc_msgSend_95(_id, _sel_removeObjectAtIndex!, index); } - static ffi.Pointer? _sel_replaceObjectAtIndex; - void replaceObjectAtIndex(int index, NSObject anObject) { - _sel_replaceObjectAtIndex ??= + static ffi.Pointer? _sel_replaceObjectAtIndex_withObject; + void replaceObjectAtIndex_withObject(int index, NSObject anObject) { + _sel_replaceObjectAtIndex_withObject ??= _registerName(_lib, "replaceObjectAtIndex:withObject:"); _lib._objc_msgSend_108( - _id, _sel_replaceObjectAtIndex!, index, anObject._id); + _id, _sel_replaceObjectAtIndex_withObject!, index, anObject._id); } static ffi.Pointer? _sel_init; @@ -4878,27 +4907,35 @@ class NSItemProvider extends NSObject { return NSItemProvider._(_ret, _lib); } - static ffi.Pointer? _sel_registerDataRepresentationForTypeIdentifier; - void registerDataRepresentationForTypeIdentifier( + static ffi.Pointer? + _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler; + void registerDataRepresentationForTypeIdentifier_visibility_loadHandler( NSObject typeIdentifier, int visibility, NSObject loadHandler) { - _sel_registerDataRepresentationForTypeIdentifier ??= _registerName(_lib, - "registerDataRepresentationForTypeIdentifier:visibility:loadHandler:"); + _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler ??= + _registerName(_lib, + "registerDataRepresentationForTypeIdentifier:visibility:loadHandler:"); _lib._objc_msgSend_110( _id, - _sel_registerDataRepresentationForTypeIdentifier!, + _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler!, typeIdentifier._id, visibility, loadHandler._id); } - static ffi.Pointer? _sel_registerFileRepresentationForTypeIdentifier; - void registerFileRepresentationForTypeIdentifier(NSObject typeIdentifier, - int fileOptions, int visibility, NSObject loadHandler) { - _sel_registerFileRepresentationForTypeIdentifier ??= _registerName(_lib, - "registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:"); + static ffi.Pointer? + _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler; + void + registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler( + NSObject typeIdentifier, + int fileOptions, + int visibility, + NSObject loadHandler) { + _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler ??= + _registerName(_lib, + "registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:"); _lib._objc_msgSend_111( _id, - _sel_registerFileRepresentationForTypeIdentifier!, + _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler!, typeIdentifier._id, fileOptions, visibility, @@ -4921,53 +4958,60 @@ class NSItemProvider extends NSObject { _id, _sel_hasItemConformingToTypeIdentifier!, typeIdentifier._id); } - static ffi.Pointer? _sel_hasRepresentationConformingToTypeIdentifier; - bool hasRepresentationConformingToTypeIdentifier( + static ffi.Pointer? + _sel_hasRepresentationConformingToTypeIdentifier_fileOptions; + bool hasRepresentationConformingToTypeIdentifier_fileOptions( NSObject typeIdentifier, int fileOptions) { - _sel_hasRepresentationConformingToTypeIdentifier ??= _registerName( - _lib, "hasRepresentationConformingToTypeIdentifier:fileOptions:"); + _sel_hasRepresentationConformingToTypeIdentifier_fileOptions ??= + _registerName( + _lib, "hasRepresentationConformingToTypeIdentifier:fileOptions:"); return _lib._objc_msgSend_114( _id, - _sel_hasRepresentationConformingToTypeIdentifier!, + _sel_hasRepresentationConformingToTypeIdentifier_fileOptions!, typeIdentifier._id, fileOptions); } - static ffi.Pointer? _sel_loadDataRepresentationForTypeIdentifier; - NSProgress loadDataRepresentationForTypeIdentifier( + static ffi.Pointer? + _sel_loadDataRepresentationForTypeIdentifier_completionHandler; + NSProgress loadDataRepresentationForTypeIdentifier_completionHandler( NSObject typeIdentifier, NSObject completionHandler) { - _sel_loadDataRepresentationForTypeIdentifier ??= _registerName( - _lib, "loadDataRepresentationForTypeIdentifier:completionHandler:"); + _sel_loadDataRepresentationForTypeIdentifier_completionHandler ??= + _registerName( + _lib, "loadDataRepresentationForTypeIdentifier:completionHandler:"); final _ret = _lib._objc_msgSend_115( _id, - _sel_loadDataRepresentationForTypeIdentifier!, + _sel_loadDataRepresentationForTypeIdentifier_completionHandler!, typeIdentifier._id, completionHandler._id); return NSProgress._(_ret, _lib); } - static ffi.Pointer? _sel_loadFileRepresentationForTypeIdentifier; - NSProgress loadFileRepresentationForTypeIdentifier( + static ffi.Pointer? + _sel_loadFileRepresentationForTypeIdentifier_completionHandler; + NSProgress loadFileRepresentationForTypeIdentifier_completionHandler( NSObject typeIdentifier, NSObject completionHandler) { - _sel_loadFileRepresentationForTypeIdentifier ??= _registerName( - _lib, "loadFileRepresentationForTypeIdentifier:completionHandler:"); + _sel_loadFileRepresentationForTypeIdentifier_completionHandler ??= + _registerName( + _lib, "loadFileRepresentationForTypeIdentifier:completionHandler:"); final _ret = _lib._objc_msgSend_116( _id, - _sel_loadFileRepresentationForTypeIdentifier!, + _sel_loadFileRepresentationForTypeIdentifier_completionHandler!, typeIdentifier._id, completionHandler._id); return NSProgress._(_ret, _lib); } static ffi.Pointer? - _sel_loadInPlaceFileRepresentationForTypeIdentifier; - NSProgress loadInPlaceFileRepresentationForTypeIdentifier( + _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler; + NSProgress loadInPlaceFileRepresentationForTypeIdentifier_completionHandler( NSObject typeIdentifier, NSObject completionHandler) { - _sel_loadInPlaceFileRepresentationForTypeIdentifier ??= _registerName(_lib, - "loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:"); + _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler ??= + _registerName(_lib, + "loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:"); final _ret = _lib._objc_msgSend_117( _id, - _sel_loadInPlaceFileRepresentationForTypeIdentifier!, + _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler!, typeIdentifier._id, completionHandler._id); return NSProgress._(_ret, _lib); @@ -4993,19 +5037,26 @@ class NSItemProvider extends NSObject { return NSItemProvider._(_ret, _lib); } - static ffi.Pointer? _sel_registerObject; - void registerObject(NSObject object, int visibility) { - _sel_registerObject ??= _registerName(_lib, "registerObject:visibility:"); - _lib._objc_msgSend_121(_id, _sel_registerObject!, object._id, visibility); + static ffi.Pointer? _sel_registerObject_visibility; + void registerObject_visibility(NSObject object, int visibility) { + _sel_registerObject_visibility ??= + _registerName(_lib, "registerObject:visibility:"); + _lib._objc_msgSend_121( + _id, _sel_registerObject_visibility!, object._id, visibility); } - static ffi.Pointer? _sel_registerObjectOfClass; - void registerObjectOfClass( + static ffi.Pointer? + _sel_registerObjectOfClass_visibility_loadHandler; + void registerObjectOfClass_visibility_loadHandler( NSObject aClass, int visibility, NSObject loadHandler) { - _sel_registerObjectOfClass ??= + _sel_registerObjectOfClass_visibility_loadHandler ??= _registerName(_lib, "registerObjectOfClass:visibility:loadHandler:"); - _lib._objc_msgSend_122(_id, _sel_registerObjectOfClass!, aClass._id, - visibility, loadHandler._id); + _lib._objc_msgSend_122( + _id, + _sel_registerObjectOfClass_visibility_loadHandler!, + aClass._id, + visibility, + loadHandler._id); } static ffi.Pointer? _sel_canLoadObjectOfClass; @@ -5014,20 +5065,26 @@ class NSItemProvider extends NSObject { return _lib._objc_msgSend_123(_id, _sel_canLoadObjectOfClass!, aClass._id); } - static ffi.Pointer? _sel_loadObjectOfClass; - NSProgress loadObjectOfClass(NSObject aClass, NSObject completionHandler) { - _sel_loadObjectOfClass ??= + static ffi.Pointer? _sel_loadObjectOfClass_completionHandler; + NSProgress loadObjectOfClass_completionHandler( + NSObject aClass, NSObject completionHandler) { + _sel_loadObjectOfClass_completionHandler ??= _registerName(_lib, "loadObjectOfClass:completionHandler:"); final _ret = _lib._objc_msgSend_124( - _id, _sel_loadObjectOfClass!, aClass._id, completionHandler._id); + _id, + _sel_loadObjectOfClass_completionHandler!, + aClass._id, + completionHandler._id); return NSProgress._(_ret, _lib); } - static ffi.Pointer? _sel_initWithItem; - NSItemProvider initWithItem(NSObject item, NSObject typeIdentifier) { - _sel_initWithItem ??= _registerName(_lib, "initWithItem:typeIdentifier:"); + static ffi.Pointer? _sel_initWithItem_typeIdentifier; + NSItemProvider initWithItem_typeIdentifier( + NSObject item, NSObject typeIdentifier) { + _sel_initWithItem_typeIdentifier ??= + _registerName(_lib, "initWithItem:typeIdentifier:"); final _ret = _lib._objc_msgSend_125( - _id, _sel_initWithItem!, item._id, typeIdentifier._id); + _id, _sel_initWithItem_typeIdentifier!, item._id, typeIdentifier._id); return NSItemProvider._(_ret, _lib); } @@ -5040,22 +5097,29 @@ class NSItemProvider extends NSObject { return NSItemProvider._(_ret, _lib); } - static ffi.Pointer? _sel_registerItemForTypeIdentifier; - void registerItemForTypeIdentifier( + static ffi.Pointer? _sel_registerItemForTypeIdentifier_loadHandler; + void registerItemForTypeIdentifier_loadHandler( NSObject typeIdentifier, NSItemProviderLoadHandler loadHandler) { - _sel_registerItemForTypeIdentifier ??= + _sel_registerItemForTypeIdentifier_loadHandler ??= _registerName(_lib, "registerItemForTypeIdentifier:loadHandler:"); - _lib._objc_msgSend_127(_id, _sel_registerItemForTypeIdentifier!, + _lib._objc_msgSend_127(_id, _sel_registerItemForTypeIdentifier_loadHandler!, typeIdentifier._id, loadHandler); } - static ffi.Pointer? _sel_loadItemForTypeIdentifier; - void loadItemForTypeIdentifier(NSObject typeIdentifier, NSObject options, + static ffi.Pointer? + _sel_loadItemForTypeIdentifier_options_completionHandler; + void loadItemForTypeIdentifier_options_completionHandler( + NSObject typeIdentifier, + NSObject options, NSItemProviderCompletionHandler completionHandler) { - _sel_loadItemForTypeIdentifier ??= _registerName( + _sel_loadItemForTypeIdentifier_options_completionHandler ??= _registerName( _lib, "loadItemForTypeIdentifier:options:completionHandler:"); - _lib._objc_msgSend_128(_id, _sel_loadItemForTypeIdentifier!, - typeIdentifier._id, options._id, completionHandler); + _lib._objc_msgSend_128( + _id, + _sel_loadItemForTypeIdentifier_options_completionHandler!, + typeIdentifier._id, + options._id, + completionHandler); } static ffi.Pointer? _sel_new1; @@ -5139,22 +5203,22 @@ class NSMutableString extends NSString { return NSMutableString._(other._id, other._lib); } - static ffi.Pointer? _sel_replaceCharactersInRange; - void replaceCharactersInRange(NSRange range, NSObject aString) { - _sel_replaceCharactersInRange ??= + static ffi.Pointer? _sel_replaceCharactersInRange_withString; + void replaceCharactersInRange_withString(NSRange range, NSObject aString) { + _sel_replaceCharactersInRange_withString ??= _registerName(_lib, "replaceCharactersInRange:withString:"); _lib._objc_msgSend_129( - _id, _sel_replaceCharactersInRange!, range, aString._id); + _id, _sel_replaceCharactersInRange_withString!, range, aString._id); } - static ffi.Pointer? _sel_stringWithCString; - static NSString stringWithCString( + static ffi.Pointer? _sel_stringWithCString_encoding; + static NSString stringWithCString_encoding( NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { _class ??= _getClass(_lib, "NSMutableString"); - _sel_stringWithCString ??= + _sel_stringWithCString_encoding ??= _registerName(_lib, "stringWithCString:encoding:"); - final _ret = - _lib._objc_msgSend_25(_class!, _sel_stringWithCString!, cString, enc); + final _ret = _lib._objc_msgSend_25( + _class!, _sel_stringWithCString_encoding!, cString, enc); return NSString._(_ret, _lib); } @@ -5187,14 +5251,14 @@ class NSSimpleCString extends NSString { return NSSimpleCString._(other._id, other._lib); } - static ffi.Pointer? _sel_stringWithCString; - static NSString stringWithCString( + static ffi.Pointer? _sel_stringWithCString_encoding; + static NSString stringWithCString_encoding( NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { _class ??= _getClass(_lib, "NSSimpleCString"); - _sel_stringWithCString ??= + _sel_stringWithCString_encoding ??= _registerName(_lib, "stringWithCString:encoding:"); - final _ret = - _lib._objc_msgSend_25(_class!, _sel_stringWithCString!, cString, enc); + final _ret = _lib._objc_msgSend_25( + _class!, _sel_stringWithCString_encoding!, cString, enc); return NSString._(_ret, _lib); } @@ -5225,14 +5289,14 @@ class NSConstantString extends NSSimpleCString { return NSConstantString._(other._id, other._lib); } - static ffi.Pointer? _sel_stringWithCString; - static NSString stringWithCString( + static ffi.Pointer? _sel_stringWithCString_encoding; + static NSString stringWithCString_encoding( NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { _class ??= _getClass(_lib, "NSConstantString"); - _sel_stringWithCString ??= + _sel_stringWithCString_encoding ??= _registerName(_lib, "stringWithCString:encoding:"); - final _ret = - _lib._objc_msgSend_25(_class!, _sel_stringWithCString!, cString, enc); + final _ret = _lib._objc_msgSend_25( + _class!, _sel_stringWithCString_encoding!, cString, enc); return NSString._(_ret, _lib); } @@ -5311,10 +5375,12 @@ class Foo extends NSObject { return Foo._(_ret, _lib); } - static ffi.Pointer? _sel_multiply; - int multiply(bool useIntVals, NSObject other) { - _sel_multiply ??= _registerName(_lib, "multiply:withOtherFoo:"); - return _lib._objc_msgSend_133(_id, _sel_multiply!, useIntVals, other._id); + static ffi.Pointer? _sel_multiply_withOtherFoo; + int multiply_withOtherFoo(bool useIntVals, NSObject other) { + _sel_multiply_withOtherFoo ??= + _registerName(_lib, "multiply:withOtherFoo:"); + return _lib._objc_msgSend_133( + _id, _sel_multiply_withOtherFoo!, useIntVals, other._id); } static ffi.Pointer? _sel_setDoubleVal; @@ -5350,11 +5416,13 @@ class StringUtil extends NSObject { return StringUtil._(other._id, other._lib); } - static ffi.Pointer? _sel_strConcat; - static NSString strConcat(NativeObjCLibrary _lib, NSObject a, NSObject b) { + static ffi.Pointer? _sel_strConcat_with; + static NSString strConcat_with( + NativeObjCLibrary _lib, NSObject a, NSObject b) { _class ??= _getClass(_lib, "StringUtil"); - _sel_strConcat ??= _registerName(_lib, "strConcat:with:"); - final _ret = _lib._objc_msgSend_135(_class!, _sel_strConcat!, a._id, b._id); + _sel_strConcat_with ??= _registerName(_lib, "strConcat:with:"); + final _ret = + _lib._objc_msgSend_135(_class!, _sel_strConcat_with!, a._id, b._id); return NSString._(_ret, _lib); } From d461aa8780f6926be3378633687702c962388052 Mon Sep 17 00:00:00 2001 From: Michael Debertol Date: Thu, 14 Apr 2022 08:44:08 +0200 Subject: [PATCH 116/276] [ffigen] Fix instructions for adding `package:ffi` (#318) --- pkgs/ffigen/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index bc718b8425..acf3b174ee 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -43,7 +43,7 @@ class NativeLibrary { ``` ## Using this package - Add `ffigen` under `dev_dependencies` in your `pubspec.yaml` (run `dart pub add -d ffigen`). -- Add `package:ffi` under `dependencies` in your `pubspec.yaml` (run `dart pub add ffigen`). +- Add `package:ffi` under `dependencies` in your `pubspec.yaml` (run `dart pub add ffi`). - Install LLVM (see [Installing LLVM](#installing-llvm)). - Configurations must be provided in `pubspec.yaml` or in a custom YAML file (see [configurations](#configurations)). - Run the tool- `dart run ffigen`. From 07af7fb7a5c7757565a73a5739919cbe13986152 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Thu, 14 Apr 2022 10:08:13 -0700 Subject: [PATCH 117/276] [ffigen] Move property tests into "native_objc_test" group --- .../native_objc_test/native_objc_test.dart | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart index f32b0b7c73..a4f2a577b0 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart @@ -80,18 +80,18 @@ void main() { expect(str3.length, 11); expect(str3.toString(), "HelloWorld!"); }); - }); - test('Instance read-only property', () { - expect(Foo.makeFoo(lib, 42).readOnlyProperty, 7); - }); + test('Instance read-only property', () { + expect(Foo.makeFoo(lib, 42).readOnlyProperty, 7); + }); - test('Class read-only property', () { - expect(Foo.getClassReadOnlyProperty(lib), 42); - }); + test('Class read-only property', () { + expect(Foo.getClassReadOnlyProperty(lib), 42); + }); - test('Class read-write property', () { - Foo.setClassReadWriteProperty(lib, 101); - expect(Foo.getClassReadWriteProperty(lib), 101); + test('Class read-write property', () { + Foo.setClassReadWriteProperty(lib, 101); + expect(Foo.getClassReadWriteProperty(lib), 101); + }); }); } From a6c2e2349153eadbb594e9665c4efacb88613835 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Thu, 14 Apr 2022 10:09:06 -0700 Subject: [PATCH 118/276] [ffigen] Generate a nice error if files generated by test/setup.dart are not present --- pkgs/ffigen/test/native_objc_test/native_objc_test.dart | 5 +++-- pkgs/ffigen/test/native_test/native_test.dart | 5 +++-- pkgs/ffigen/test/test_utils.dart | 9 +++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart index a4f2a577b0..8b23c2d99b 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart @@ -20,8 +20,9 @@ void main() { group('native_objc_test', () { setUpAll(() { logWarnings(); - lib = NativeObjCLibrary(DynamicLibrary.open( - File('test/native_objc_test/native_objc_test.dylib').absolute.path)); + final dylib = File('test/native_objc_test/native_objc_test.dylib'); + verifySetupFile(dylib); + lib = NativeObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); }); test('generate_bindings', () { diff --git a/pkgs/ffigen/test/native_test/native_test.dart b/pkgs/ffigen/test/native_test/native_test.dart index 08e1475eb4..d98b686176 100644 --- a/pkgs/ffigen/test/native_test/native_test.dart +++ b/pkgs/ffigen/test/native_test/native_test.dart @@ -24,8 +24,9 @@ void main() { } else if (Platform.isWindows) { dylibName = r'test\native_test\native_test.dll'; } - bindings = - NativeLibrary(DynamicLibrary.open(File(dylibName).absolute.path)); + final dylib = File(dylibName); + verifySetupFile(dylib); + bindings = NativeLibrary(DynamicLibrary.open(dylib.absolute.path)); }); test('generate_bindings', () { diff --git a/pkgs/ffigen/test/test_utils.dart b/pkgs/ffigen/test/test_utils.dart index 624e62611c..196da1e5ea 100644 --- a/pkgs/ffigen/test/test_utils.dart +++ b/pkgs/ffigen/test/test_utils.dart @@ -31,6 +31,15 @@ extension LibraryTestExt on Library { } } +/// Check whether a file generated by test/setup.dart exists and throw a helpful +/// exception if it does not. +void verifySetupFile(File file) { + if (!file.existsSync()) { + throw NotFoundException("The file ${file.path} does not exist.\n\n" + "You may need to run: dart run test/setup.dart\n"); + } +} + /// Generates actual file using library and tests using [expect] with expected /// /// This will not delete the actual debug file incase [expect] throws an error. From 205549b184b273fcf8232457331a486458e4ad7d Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Fri, 15 Apr 2022 14:48:48 -0700 Subject: [PATCH 119/276] [ffigen] Move ObjCBuiltInFunctions to its own file and its singleton to data.dart (#325) --- pkgs/ffigen/lib/src/code_generator.dart | 1 + .../objc_built_in_functions.dart | 112 +++++++++++++++ .../src/code_generator/objc_interface.dart | 128 ++---------------- pkgs/ffigen/lib/src/header_parser/data.dart | 8 +- .../sub_parsers/objcinterfacedecl_parser.dart | 1 + 5 files changed, 134 insertions(+), 116 deletions(-) create mode 100644 pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart diff --git a/pkgs/ffigen/lib/src/code_generator.dart b/pkgs/ffigen/lib/src/code_generator.dart index a0c5d7e63f..f599c7b8fd 100644 --- a/pkgs/ffigen/lib/src/code_generator.dart +++ b/pkgs/ffigen/lib/src/code_generator.dart @@ -16,6 +16,7 @@ export 'code_generator/handle.dart'; export 'code_generator/imports.dart'; export 'code_generator/library.dart'; export 'code_generator/native_type.dart'; +export 'code_generator/objc_built_in_functions.dart'; export 'code_generator/objc_interface.dart'; export 'code_generator/pointer.dart'; export 'code_generator/struct.dart'; diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart new file mode 100644 index 0000000000..3c170c02b9 --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -0,0 +1,112 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; + +import 'writer.dart'; + +/// Built in functions used by the Objective C bindings. +class ObjCBuiltInFunctions { + late final _registerNameFunc = Func( + name: '_sel_registerName', + originalName: 'sel_registerName', + returnType: PointerType(objCSelType), + parameters: [Parameter(name: 'str', type: PointerType(charType))], + isInternal: true, + ); + late final String registerName; + + late final _getClassFunc = Func( + name: '_objc_getClass', + originalName: 'objc_getClass', + returnType: PointerType(objCObjectType), + parameters: [Parameter(name: 'str', type: PointerType(charType))], + isInternal: true, + ); + late final String getClass; + + // We need to load a separate instance of objc_msgSend for each signature. + final _msgSendFuncs = {}; + Func getMsgSendFunc(Type returnType, List params) { + // TODO(#279): These keys don't dedupe sufficiently. + var key = returnType.hashCode.toRadixString(36); + for (final p in params) { + key += ' ' + p.type.hashCode.toRadixString(36); + } + _msgSendFuncs[key] ??= Func( + name: '_objc_msgSend_${_msgSendFuncs.length}', + originalName: 'objc_msgSend', + returnType: returnType, + parameters: [ + Parameter(name: 'obj', type: PointerType(objCObjectType)), + Parameter(name: 'sel', type: PointerType(objCSelType)), + for (final p in params) Parameter(name: p.name, type: p.type), + ], + isInternal: true, + ); + return _msgSendFuncs[key]!; + } + + bool utilsExist = false; + void ensureUtilsExist(Writer w, StringBuffer s) { + if (utilsExist) return; + utilsExist = true; + + registerName = w.topLevelUniqueNamer.makeUnique('_registerName'); + final selType = _registerNameFunc.functionType.returnType.getCType(w); + s.write('\n$selType $registerName(${w.className} _lib, String name) {\n'); + s.write(' final cstr = name.toNativeUtf8();\n'); + s.write(' final sel = _lib.${_registerNameFunc.name}(cstr.cast());\n'); + s.write(' ${w.ffiPkgLibraryPrefix}.calloc.free(cstr);\n'); + s.write(' return sel;\n'); + s.write('}\n'); + + getClass = w.topLevelUniqueNamer.makeUnique('_getClass'); + final objType = _getClassFunc.functionType.returnType.getCType(w); + s.write('\n$objType $getClass(${w.className} _lib, String name) {\n'); + s.write(' final cstr = name.toNativeUtf8();\n'); + s.write(' final clazz = _lib.${_getClassFunc.name}(cstr.cast());\n'); + s.write(' ${w.ffiPkgLibraryPrefix}.calloc.free(cstr);\n'); + s.write(' return clazz;\n'); + s.write('}\n'); + + s.write('\nclass _ObjCWrapper {\n'); + s.write(' final $objType _id;\n'); + s.write(' final ${w.className} _lib;\n'); + s.write(' _ObjCWrapper._(this._id, this._lib);\n'); + s.write('}\n'); + } + + void addDependencies(Set dependencies) { + _registerNameFunc.addDependencies(dependencies); + _getClassFunc.addDependencies(dependencies); + for (final func in _msgSendFuncs.values) { + func.addDependencies(dependencies); + } + } + + void generateNSStringUtils(Writer w, StringBuffer s) { + // Generate a constructor that wraps stringWithCString. + s.write(' factory NSString(${w.className} _lib, String str) {\n'); + s.write(' final cstr = str.toNativeUtf8();\n'); + s.write(' final nsstr = stringWithCString_encoding(' + '_lib, cstr.cast(), 4 /* UTF8 */);\n'); + s.write(' ${w.ffiPkgLibraryPrefix}.calloc.free(cstr);\n'); + s.write(' return nsstr;\n'); + s.write(' }\n\n'); + + // Generate a toString method that wraps UTF8String. + s.write(' @override\n'); + s.write(' String toString() => UTF8String().cast<' + '${w.ffiPkgLibraryPrefix}.Utf8>().toDartString();\n\n'); + } + + void generateStringUtils(Writer w, StringBuffer s) { + // Generate an extension on String to convert to NSString + s.write('extension StringToNSString on String {\n'); + s.write(' NSString toNSString(${w.className} lib) => ' + 'NSString(lib, this);\n'); + s.write('}\n\n'); + } +} diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 4b59379985..ed9e1c3bcd 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -30,112 +30,6 @@ const _excludedNSObjectClassMethods = { 'superclass', }; -class _ObjCBuiltInFunctions { - late final _registerNameFunc = Func( - name: '_sel_registerName', - originalName: 'sel_registerName', - returnType: PointerType(objCSelType), - parameters: [Parameter(name: 'str', type: PointerType(charType))], - isInternal: true, - ); - late final String registerName; - - late final _getClassFunc = Func( - name: '_objc_getClass', - originalName: 'objc_getClass', - returnType: PointerType(objCObjectType), - parameters: [Parameter(name: 'str', type: PointerType(charType))], - isInternal: true, - ); - late final String getClass; - - // We need to load a separate instance of objc_msgSend for each signature. - final _msgSendFuncs = {}; - Func getMsgSendFunc(Type returnType, List params) { - // TODO(#279): These keys don't dedupe sufficiently. - var key = returnType.hashCode.toRadixString(36); - for (final p in params) { - key += ' ' + p.type.hashCode.toRadixString(36); - } - _msgSendFuncs[key] ??= Func( - name: '_objc_msgSend_${_msgSendFuncs.length}', - originalName: 'objc_msgSend', - returnType: returnType, - parameters: [ - Parameter(name: 'obj', type: PointerType(objCObjectType)), - Parameter(name: 'sel', type: PointerType(objCSelType)), - for (final p in params) Parameter(name: p.name, type: p.type), - ], - isInternal: true, - ); - return _msgSendFuncs[key]!; - } - - bool utilsExist = false; - void ensureUtilsExist(Writer w, StringBuffer s) { - if (utilsExist) return; - utilsExist = true; - - registerName = w.topLevelUniqueNamer.makeUnique('_registerName'); - final selType = _registerNameFunc.functionType.returnType.getCType(w); - s.write('\n$selType $registerName(${w.className} _lib, String name) {\n'); - s.write(' final cstr = name.toNativeUtf8();\n'); - s.write(' final sel = _lib.${_registerNameFunc.name}(cstr.cast());\n'); - s.write(' ${w.ffiPkgLibraryPrefix}.calloc.free(cstr);\n'); - s.write(' return sel;\n'); - s.write('}\n'); - - getClass = w.topLevelUniqueNamer.makeUnique('_getClass'); - final objType = _getClassFunc.functionType.returnType.getCType(w); - s.write('\n$objType $getClass(${w.className} _lib, String name) {\n'); - s.write(' final cstr = name.toNativeUtf8();\n'); - s.write(' final clazz = _lib.${_getClassFunc.name}(cstr.cast());\n'); - s.write(' ${w.ffiPkgLibraryPrefix}.calloc.free(cstr);\n'); - s.write(' return clazz;\n'); - s.write('}\n'); - - s.write('\nclass _ObjCWrapper {\n'); - s.write(' final $objType _id;\n'); - s.write(' final ${w.className} _lib;\n'); - s.write(' _ObjCWrapper._(this._id, this._lib);\n'); - s.write('}\n'); - } - - void addDependencies(Set dependencies) { - _registerNameFunc.addDependencies(dependencies); - _getClassFunc.addDependencies(dependencies); - for (final func in _msgSendFuncs.values) { - func.addDependencies(dependencies); - } - } - - void generateNSStringUtils(Writer w, StringBuffer s) { - // Generate a constructor that wraps stringWithCString. - s.write(' factory NSString(${w.className} _lib, String str) {\n'); - s.write(' final cstr = str.toNativeUtf8();\n'); - s.write(' final nsstr = stringWithCString_encoding(' - '_lib, cstr.cast(), 4 /* UTF8 */);\n'); - s.write(' ${w.ffiPkgLibraryPrefix}.calloc.free(cstr);\n'); - s.write(' return nsstr;\n'); - s.write(' }\n\n'); - - // Generate a toString method that wraps UTF8String. - s.write(' @override\n'); - s.write(' String toString() => UTF8String().cast<' - '${w.ffiPkgLibraryPrefix}.Utf8>().toDartString();\n\n'); - } - - void generateStringUtils(Writer w, StringBuffer s) { - // Generate an extension on String to convert to NSString - s.write('extension StringToNSString on String {\n'); - s.write(' NSString toNSString(${w.className} lib) => ' - 'NSString(lib, this);\n'); - s.write('}\n\n'); - } -} - -final _builtInFunctions = _ObjCBuiltInFunctions(); - class ObjCInterface extends BindingType { ObjCInterface? superType; final methods = []; @@ -148,11 +42,14 @@ class ObjCInterface extends BindingType { // methods list. final classMethods = {}; + final ObjCBuiltInFunctions builtInFunctions; + ObjCInterface({ String? usr, required String originalName, required String name, String? dartDoc, + required this.builtInFunctions, }) : super( usr: usr, originalName: originalName, @@ -184,7 +81,7 @@ class ObjCInterface extends BindingType { final uniqueNamer = UniqueNamer({name}); final natLib = w.className; - _builtInFunctions.ensureUtilsExist(w, s); + builtInFunctions.ensureUtilsExist(w, s); final objType = PointerType(objCObjectType).getCType(w); final selType = PointerType(objCSelType).getCType(w); @@ -204,7 +101,7 @@ class ObjCInterface extends BindingType { s.write(' }\n\n'); if (isNSString) { - _builtInFunctions.generateNSStringUtils(w, s); + builtInFunctions.generateNSStringUtils(w, s); } // Methods. @@ -273,10 +170,10 @@ class ObjCInterface extends BindingType { // Implementation. if (isStatic) { s.write(' $classObject ??= ' - '${_builtInFunctions.getClass}(_lib, "$originalName");\n'); + '${builtInFunctions.getClass}(_lib, "$originalName");\n'); } s.write(' $selName ??= ' - '${_builtInFunctions.registerName}(_lib, "${m.originalName}");\n'); + '${builtInFunctions.registerName}(_lib, "${m.originalName}");\n'); final convertReturn = m.kind != ObjCMethodKind.propertySetter && _needsConverting(returnType); @@ -301,7 +198,7 @@ class ObjCInterface extends BindingType { s.write('}\n\n'); if (isNSString) { - _builtInFunctions.generateStringUtils(w, s); + builtInFunctions.generateStringUtils(w, s); } return BindingString( @@ -325,10 +222,10 @@ class ObjCInterface extends BindingType { } for (final m in methods) { - m.addDependencies(dependencies); + m.addDependencies(dependencies, builtInFunctions); } - _builtInFunctions.addDependencies(dependencies); + builtInFunctions.addDependencies(dependencies); } void _filterPropertyMethods() { @@ -469,13 +366,14 @@ class ObjCMethod { kind == ObjCMethodKind.propertyGetter || kind == ObjCMethodKind.propertySetter; - void addDependencies(Set dependencies) { + void addDependencies( + Set dependencies, ObjCBuiltInFunctions builtInFunctions) { returnType ??= NativeType(SupportedNativeType.Void); returnType!.addDependencies(dependencies); for (final p in params) { p.type.addDependencies(dependencies); } - msgSend = _builtInFunctions.getMsgSendFunc(returnType!, params); + msgSend = builtInFunctions.getMsgSendFunc(returnType!, params); } String _getDartMethodName(UniqueNamer uniqueNamer) { diff --git a/pkgs/ffigen/lib/src/header_parser/data.dart b/pkgs/ffigen/lib/src/header_parser/data.dart index ac16572a91..1381fd3c3b 100644 --- a/pkgs/ffigen/lib/src/header_parser/data.dart +++ b/pkgs/ffigen/lib/src/header_parser/data.dart @@ -4,7 +4,8 @@ import 'dart:ffi'; -import 'package:ffigen/src/code_generator.dart' show Constant; +import 'package:ffigen/src/code_generator.dart' + show Constant, ObjCBuiltInFunctions; import 'package:ffigen/src/config_provider.dart' show Config; import 'clang_bindings/clang_bindings.dart' show Clang; @@ -36,6 +37,10 @@ Map _savedMacros = {}; List get unnamedEnumConstants => _unnamedEnumConstants; List _unnamedEnumConstants = []; +/// Built in functions used by the Objective C bindings. +ObjCBuiltInFunctions get objCBuiltInFunctions => _objCBuiltInFunctions; +late ObjCBuiltInFunctions _objCBuiltInFunctions; + void initializeGlobals({required Config config}) { _config = config; _clang = Clang(DynamicLibrary.open(config.libclangDylib)); @@ -43,4 +48,5 @@ void initializeGlobals({required Config config}) { _savedMacros = {}; _unnamedEnumConstants = []; _bindingsIndex = BindingsIndex(); + _objCBuiltInFunctions = ObjCBuiltInFunctions(); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index 26dd1b398a..d90f56c35e 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -45,6 +45,7 @@ Type? parseObjCInterfaceDeclaration(clang_types.CXCursor cursor) { usr: itfUsr, originalName: name, name: name, // TODO(#279): config.interfaceDecl.renameUsingConfig(name), dartDoc: getCursorDocComment(cursor), + builtInFunctions: objCBuiltInFunctions, ); } From 66f0cc0b5c803ae449cc021a4149c60b6085bf42 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Mon, 18 Apr 2022 09:31:32 -0700 Subject: [PATCH 120/276] [ffigen] Provide a command to regenerate golden bindings. (#322) --- pkgs/ffigen/README.md | 6 +-- pkgs/ffigen/test/README.md | 64 ++++++++++++++++++++++++++ pkgs/ffigen/test/regen.dart | 91 +++++++++++++++++++++++++++++++++++++ 3 files changed, 157 insertions(+), 4 deletions(-) create mode 100644 pkgs/ffigen/test/README.md create mode 100644 pkgs/ffigen/test/regen.dart diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index acf3b174ee..98c7f76cec 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -509,11 +509,9 @@ language: 'objc' 2. Run `dart run ffigen`. ## Running Tests -Dynamic library for some tests need to be built before running the examples. -Run `dart test/setup.dart` to build the libraries. -Run tests from the root of the package with `dart run test`. -> Note: If llvm is not installed in one of the default locations, tests may fail. +See [test/README.md](test/README.md) + ## FAQ ### Can ffigen be used for removing underscores or renaming declarations? Ffigen supports **regexp based renaming**, the regexp must be a diff --git a/pkgs/ffigen/test/README.md b/pkgs/ffigen/test/README.md new file mode 100644 index 0000000000..1a499a4717 --- /dev/null +++ b/pkgs/ffigen/test/README.md @@ -0,0 +1,64 @@ +[![Build Status](https://github.com/dart-lang/ffigen/workflows/Dart%20CI/badge.svg)](https://github.com/dart-lang/ffigen/actions?query=workflow%3A"Dart+CI") +[![Coverage Status](https://coveralls.io/repos/github/dart-lang/ffigen/badge.svg?branch=master)](https://coveralls.io/github/dart-lang/ffigen?branch=master) + +# ffigen testing + +## Running Tests + +1. Some tests require that dynamic libraries be built before running the tests. + You can do so with: + + ```shell + dart run test/setup.dart + ``` + +2. Run the tests with: + + ```shell + dart test + ``` + +## Development + +Some tests verify that the generated Dart FFI bindings match a golden file. + +For example, the test +[`test/native_test/native_test.dart`](https://github.com/dart-lang/ffigen/blob/master/test/native_test/native_test.dart) +works by: + +1. Loading the dynamic library for + [`test/native_test/native_test.c`](https://github.com/dart-lang/ffigen/blob/master/test/native_test/native_test.c) + (which was generated by `dart run test/setup.dart`). + +2. Generating binding files for that dynamic library in the + `test/debug_generated` directory. + +3. Comparing the golden file (i.e. + [`test/native_test/native_test_bindings.dart`](https://github.com/dart-lang/ffigen/blob/master/test/native_test/native_test_bindings.dart)) + to the generated file and generating a test failure if they do not match. + +4. Using the *golden* bindings to excercise the dynamic library. + +If you modify any source for a dynamic library (e.g. any `.c`, `.h` or `.m` +files), then you should run: + +```shell + dart run test/setup.dart # Rebuild the dynamic libraries. + dart run test/regen.dart # Rebuild the golden FFI bindings. +``` + +If you modify any code that changes how FFI bindings are generated, then you +should run: + + ```shell + dart run test/regen.dart # Rebuild the golden FFI bindings. + ``` + +A conservative way to run tests is with: + + ```shell + dart run test/setup.dart && dart run test/regen.dart && dart test + ``` + +> Note: you should verify that the changes to the golden bindings are +> reasonable with `git diff`. diff --git a/pkgs/ffigen/test/regen.dart b/pkgs/ffigen/test/regen.dart new file mode 100644 index 0000000000..1bc2021dc5 --- /dev/null +++ b/pkgs/ffigen/test/regen.dart @@ -0,0 +1,91 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:async'; +import 'dart:io'; + +import 'package:args/args.dart'; +import 'package:ffigen/ffigen.dart'; +import 'package:logging/logging.dart'; +import 'package:yaml/yaml.dart'; + +const usage = r'''Regenerates the Dart FFI bindings used in tests and examples. + +Use this command when developing features that change the generated bindings +e.g. with this command: + +$ dart run test/setup.dart && dart run test/regen.dart && dart test +'''; + +Future _regenConfig(File yamlConfig, File bindingOutput, + {bool chDir = false}) async { + yamlConfig = yamlConfig.absolute; + bindingOutput = bindingOutput.absolute; + + Directory? oldDir; + var yaml = loadYaml(await yamlConfig.readAsString()) as YamlMap; + + if (chDir) { + oldDir = Directory.current; + Directory.current = yamlConfig.parent; + } + try { + if (yaml.containsKey("ffigen")) { + yaml = yaml["ffigen"] as YamlMap; + } + + final config = Config.fromYaml(yaml); + final library = parse(config); + library.generateFile(bindingOutput); + } finally { + if (oldDir != null) { + Directory.current = oldDir; + } + } +} + +Future main(List args) async { + final parser = ArgParser(); + parser.addSeparator(usage); + parser.addFlag( + 'help', + abbr: 'h', + help: 'Prints this usage', + negatable: false, + ); + + final parseArgs = parser.parse(args); + if (parseArgs.wasParsed('help')) { + print(parser.usage); + exit(0); + } else if (parseArgs.rest.isNotEmpty) { + print(parser.usage); + exit(1); + } + + Logger.root.level = Level.WARNING; + Logger.root.onRecord.listen((record) { + print('${record.level.name}: ${record.time}: ${record.message}'); + }); + + await _regenConfig( + File('test/native_objc_test/config.yaml'), + File('test/native_objc_test/native_objc_test_bindings.dart'), + ); + + await _regenConfig(File('test/native_test/config.yaml'), + File('test/native_test/native_test_bindings.dart')); + + await _regenConfig(File('example/libclang-example/pubspec.yaml'), + File('example/libclang-example/generated_bindings.dart'), + chDir: true); + + await _regenConfig(File('example/simple/pubspec.yaml'), + File('example/simple/generated_bindings.dart'), + chDir: true); + + await _regenConfig(File('example/c_json/pubspec.yaml'), + File('example/c_json/cjson_generated_bindings.dart'), + chDir: true); +} From cb7825b04f2b820f75a6353169d2eeb374b535f0 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Mon, 18 Apr 2022 13:50:17 -0700 Subject: [PATCH 121/276] [ffigen] Create more tests and move them to separate files. (#330) --- .../native_objc_test/method_bindings.dart | 1594 +++++ .../test/native_objc_test/method_config.yaml | 12 + .../test/native_objc_test/method_test.dart | 90 + .../test/native_objc_test/method_test.m | 53 + .../native_objc_test/native_objc_test.dart | 28 - .../test/native_objc_test/native_objc_test.m | 32 - .../native_objc_test_bindings.dart | 102 - .../native_objc_test/property_bindings.dart | 1547 +++++ .../native_objc_test/property_config.yaml | 12 + .../test/native_objc_test/property_test.dart | 76 + .../test/native_objc_test/property_test.m | 33 + pkgs/ffigen/test/native_objc_test/setup.dart | 3 + .../native_objc_test/string_bindings.dart | 5658 +++++++++++++++++ .../test/native_objc_test/string_config.yaml | 12 + .../test/native_objc_test/string_test.dart | 48 + .../test/native_objc_test/string_test.m | 13 + pkgs/ffigen/test/regen.dart | 15 + 17 files changed, 9166 insertions(+), 162 deletions(-) create mode 100644 pkgs/ffigen/test/native_objc_test/method_bindings.dart create mode 100644 pkgs/ffigen/test/native_objc_test/method_config.yaml create mode 100644 pkgs/ffigen/test/native_objc_test/method_test.dart create mode 100644 pkgs/ffigen/test/native_objc_test/method_test.m create mode 100644 pkgs/ffigen/test/native_objc_test/property_bindings.dart create mode 100644 pkgs/ffigen/test/native_objc_test/property_config.yaml create mode 100644 pkgs/ffigen/test/native_objc_test/property_test.dart create mode 100644 pkgs/ffigen/test/native_objc_test/property_test.m create mode 100644 pkgs/ffigen/test/native_objc_test/string_bindings.dart create mode 100644 pkgs/ffigen/test/native_objc_test/string_config.yaml create mode 100644 pkgs/ffigen/test/native_objc_test/string_test.dart create mode 100644 pkgs/ffigen/test/native_objc_test/string_test.m diff --git a/pkgs/ffigen/test/native_objc_test/method_bindings.dart b/pkgs/ffigen/test/native_objc_test/method_bindings.dart new file mode 100644 index 0000000000..4c74d24e13 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/method_bindings.dart @@ -0,0 +1,1594 @@ +// ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; + +/// Tests calling Objective-C methods +class MethodTestObjCLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + MethodTestObjCLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + MethodTestObjCLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + late final ffi.Pointer _NSFoundationVersionNumber = + _lookup('NSFoundationVersionNumber'); + + double get NSFoundationVersionNumber => _NSFoundationVersionNumber.value; + + set NSFoundationVersionNumber(double value) => + _NSFoundationVersionNumber.value = value; + + late final ffi.Pointer _NSNotFound = + _lookup('NSNotFound'); + + int get NSNotFound => _NSNotFound.value; + + set NSNotFound(int value) => _NSNotFound.value = value; + + late final ffi.Pointer _kCFCoreFoundationVersionNumber = + _lookup('kCFCoreFoundationVersionNumber'); + + double get kCFCoreFoundationVersionNumber => + _kCFCoreFoundationVersionNumber.value; + + set kCFCoreFoundationVersionNumber(double value) => + _kCFCoreFoundationVersionNumber.value = value; + + late final ffi.Pointer _kCFNotFound = + _lookup('kCFNotFound'); + + int get kCFNotFound => _kCFNotFound.value; + + set kCFNotFound(int value) => _kCFNotFound.value = value; + + late final ffi.Pointer _kCFNull = _lookup('kCFNull'); + + CFNullRef get kCFNull => _kCFNull.value; + + set kCFNull(CFNullRef value) => _kCFNull.value = value; + + late final ffi.Pointer _kCFAllocatorDefault = + _lookup('kCFAllocatorDefault'); + + CFAllocatorRef get kCFAllocatorDefault => _kCFAllocatorDefault.value; + + set kCFAllocatorDefault(CFAllocatorRef value) => + _kCFAllocatorDefault.value = value; + + late final ffi.Pointer _kCFAllocatorSystemDefault = + _lookup('kCFAllocatorSystemDefault'); + + CFAllocatorRef get kCFAllocatorSystemDefault => + _kCFAllocatorSystemDefault.value; + + set kCFAllocatorSystemDefault(CFAllocatorRef value) => + _kCFAllocatorSystemDefault.value = value; + + late final ffi.Pointer _kCFAllocatorMalloc = + _lookup('kCFAllocatorMalloc'); + + CFAllocatorRef get kCFAllocatorMalloc => _kCFAllocatorMalloc.value; + + set kCFAllocatorMalloc(CFAllocatorRef value) => + _kCFAllocatorMalloc.value = value; + + late final ffi.Pointer _kCFAllocatorMallocZone = + _lookup('kCFAllocatorMallocZone'); + + CFAllocatorRef get kCFAllocatorMallocZone => _kCFAllocatorMallocZone.value; + + set kCFAllocatorMallocZone(CFAllocatorRef value) => + _kCFAllocatorMallocZone.value = value; + + late final ffi.Pointer _kCFAllocatorNull = + _lookup('kCFAllocatorNull'); + + CFAllocatorRef get kCFAllocatorNull => _kCFAllocatorNull.value; + + set kCFAllocatorNull(CFAllocatorRef value) => _kCFAllocatorNull.value = value; + + late final ffi.Pointer _kCFAllocatorUseContext = + _lookup('kCFAllocatorUseContext'); + + CFAllocatorRef get kCFAllocatorUseContext => _kCFAllocatorUseContext.value; + + set kCFAllocatorUseContext(CFAllocatorRef value) => + _kCFAllocatorUseContext.value = value; + + ffi.Pointer _sel_registerName( + ffi.Pointer str, + ) { + return __sel_registerName( + str, + ); + } + + late final __sel_registerNamePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sel_registerName'); + late final __sel_registerName = __sel_registerNamePtr + .asFunction Function(ffi.Pointer)>(); + + ffi.Pointer _objc_getClass( + ffi.Pointer str, + ) { + return __objc_getClass( + str, + ); + } + + late final __objc_getClassPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('objc_getClass'); + late final __objc_getClass = __objc_getClassPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); + + void _objc_msgSend_0( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_0( + obj, + sel, + ); + } + + late final __objc_msgSend_0Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); + + instancetype _objc_msgSend_1( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1( + obj, + sel, + ); + } + + late final __objc_msgSend_1Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer)>(); + + instancetype _objc_msgSend_2( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_2( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_2Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>(); + + ffi.Pointer _objc_msgSend_3( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_3( + obj, + sel, + ); + } + + late final __objc_msgSend_3Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_4( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_4( + obj, + sel, + ); + } + + late final __objc_msgSend_4Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_5( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_5( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_5Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); + + ffi.Pointer _objc_msgSend_6( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_6( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_6Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); + + bool _objc_msgSend_7( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_7( + obj, + sel, + aSelector, + ) != + 0; + } + + late final __objc_msgSend_7Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + bool _objc_msgSend_8( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer protocol, + ) { + return __objc_msgSend_8( + obj, + sel, + protocol, + ) != + 0; + } + + late final __objc_msgSend_8Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + IMP _objc_msgSend_9( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_9( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_9Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + IMP _objc_msgSend_10( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_10( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_10Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_11( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_11( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_11Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_12( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_12( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_12Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_13( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anInvocation, + ) { + return __objc_msgSend_13( + obj, + sel, + anInvocation, + ); + } + + late final __objc_msgSend_13Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_14( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_14( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_14Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_15( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_15( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_15Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + bool _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_16( + obj, + sel, + ) != + 0; + } + + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + bool _objc_msgSend_17( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ) { + return __objc_msgSend_17( + obj, + sel, + aClass, + ) != + 0; + } + + late final __objc_msgSend_17Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + bool _objc_msgSend_18( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sel1, + ) { + return __objc_msgSend_18( + obj, + sel, + sel1, + ) != + 0; + } + + late final __objc_msgSend_18Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + bool _objc_msgSend_19( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sel1, + ) { + return __objc_msgSend_19( + obj, + sel, + sel1, + ) != + 0; + } + + late final __objc_msgSend_19Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_20( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_20( + obj, + sel, + ); + } + + late final __objc_msgSend_20Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_21( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_21( + obj, + sel, + ); + } + + late final __objc_msgSend_21Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_22( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_22( + obj, + sel, + ); + } + + late final __objc_msgSend_22Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_23( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cString, + int enc, + ) { + return __objc_msgSend_23( + obj, + sel, + cString, + enc, + ); + } + + late final __objc_msgSend_23Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + pkg_ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_24( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_24( + obj, + sel, + ); + } + + late final __objc_msgSend_24Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_25( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_25( + obj, + sel, + ); + } + + late final __objc_msgSend_25Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_26( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_26( + obj, + sel, + ); + } + + late final __objc_msgSend_26Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_27( + ffi.Pointer obj, + ffi.Pointer sel, + int x, + ) { + return __objc_msgSend_27( + obj, + sel, + x, + ); + } + + late final __objc_msgSend_27Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + int _objc_msgSend_28( + ffi.Pointer obj, + ffi.Pointer sel, + int x, + int y, + ) { + return __objc_msgSend_28( + obj, + sel, + x, + y, + ); + } + + late final __objc_msgSend_28Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_28 = __objc_msgSend_28Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, int)>(); + + int _objc_msgSend_29( + ffi.Pointer obj, + ffi.Pointer sel, + int x, + int y, + int z, + ) { + return __objc_msgSend_29( + obj, + sel, + x, + y, + z, + ); + } + + late final __objc_msgSend_29Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Int32, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_29 = __objc_msgSend_29Ptr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer, int, int, int)>(); +} + +abstract class NSComparisonResult { + static const int NSOrderedAscending = -1; + static const int NSOrderedSame = 0; + static const int NSOrderedDescending = 1; +} + +abstract class NSEnumerationOptions { + static const int NSEnumerationConcurrent = 1; + static const int NSEnumerationReverse = 2; +} + +abstract class NSSortOptions { + static const int NSSortConcurrent = 1; + static const int NSSortStable = 16; +} + +abstract class NSQualityOfService { + static const int NSQualityOfServiceUserInteractive = 33; + static const int NSQualityOfServiceUserInitiated = 25; + static const int NSQualityOfServiceUtility = 17; + static const int NSQualityOfServiceBackground = 9; + static const int NSQualityOfServiceDefault = -1; +} + +typedef NSInteger = pkg_ffi.Long; + +class __CFString extends ffi.Opaque {} + +abstract class CFComparisonResult { + static const int kCFCompareLessThan = -1; + static const int kCFCompareEqualTo = 0; + static const int kCFCompareGreaterThan = 1; +} + +typedef CFIndex = pkg_ffi.Long; + +class CFRange extends ffi.Struct { + @CFIndex() + external int location; + + @CFIndex() + external int length; +} + +class __CFNull extends ffi.Opaque {} + +typedef CFNullRef = ffi.Pointer<__CFNull>; + +class __CFAllocator extends ffi.Opaque {} + +typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; + +class CFAllocatorContext extends ffi.Struct { + @CFIndex() + external int version; + + external ffi.Pointer info; + + external CFAllocatorRetainCallBack retain; + + external CFAllocatorReleaseCallBack release; + + external CFAllocatorCopyDescriptionCallBack copyDescription; + + external CFAllocatorAllocateCallBack allocate; + + external CFAllocatorReallocateCallBack reallocate; + + external CFAllocatorDeallocateCallBack deallocate; + + external CFAllocatorPreferredSizeCallBack preferredSize; +} + +typedef CFAllocatorRetainCallBack = ffi.Pointer< + ffi.NativeFunction Function(ffi.Pointer)>>; +typedef CFAllocatorReleaseCallBack + = ffi.Pointer)>>; +typedef CFAllocatorCopyDescriptionCallBack = ffi + .Pointer)>>; +typedef CFStringRef = ffi.Pointer<__CFString>; +typedef CFAllocatorAllocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + CFIndex, CFOptionFlags, ffi.Pointer)>>; +typedef CFOptionFlags = pkg_ffi.UnsignedLong; +typedef CFAllocatorReallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, CFIndex, + CFOptionFlags, ffi.Pointer)>>; +typedef CFAllocatorDeallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; +typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< + ffi.NativeFunction< + CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; + +ffi.Pointer _registerName(MethodTestObjCLibrary _lib, String name) { + final cstr = name.toNativeUtf8(); + final sel = _lib._sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; +} + +ffi.Pointer _getClass(MethodTestObjCLibrary _lib, String name) { + final cstr = name.toNativeUtf8(); + final clazz = _lib._objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; +} + +class _ObjCWrapper { + final ffi.Pointer _id; + final MethodTestObjCLibrary _lib; + _ObjCWrapper._(this._id, this._lib); +} + +class MethodInterface extends NSObject { + MethodInterface._(ffi.Pointer id, MethodTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static MethodInterface castFrom(T other) { + return MethodInterface._(other._id, other._lib); + } + + static ffi.Pointer? _sel_add; + int add() { + _sel_add ??= _registerName(_lib, "add"); + return _lib._objc_msgSend_26(_id, _sel_add!); + } + + static ffi.Pointer? _sel_add1; + int add1(int x) { + _sel_add1 ??= _registerName(_lib, "add:"); + return _lib._objc_msgSend_27(_id, _sel_add1!, x); + } + + static ffi.Pointer? _sel_add_Y; + int add_Y(int x, int y) { + _sel_add_Y ??= _registerName(_lib, "add:Y:"); + return _lib._objc_msgSend_28(_id, _sel_add_Y!, x, y); + } + + static ffi.Pointer? _sel_add_Y_Z; + int add_Y_Z(int x, int y, int z) { + _sel_add_Y_Z ??= _registerName(_lib, "add:Y:Z:"); + return _lib._objc_msgSend_29(_id, _sel_add_Y_Z!, x, y, z); + } + + static ffi.Pointer? _sel_sub; + static int sub(MethodTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "MethodInterface"); + _sel_sub ??= _registerName(_lib, "sub"); + return _lib._objc_msgSend_26(_class!, _sel_sub!); + } + + static ffi.Pointer? _sel_sub1; + static int sub1(MethodTestObjCLibrary _lib, int x) { + _class ??= _getClass(_lib, "MethodInterface"); + _sel_sub1 ??= _registerName(_lib, "sub:"); + return _lib._objc_msgSend_27(_class!, _sel_sub1!, x); + } + + static ffi.Pointer? _sel_sub_Y; + static int sub_Y(MethodTestObjCLibrary _lib, int x, int y) { + _class ??= _getClass(_lib, "MethodInterface"); + _sel_sub_Y ??= _registerName(_lib, "sub:Y:"); + return _lib._objc_msgSend_28(_class!, _sel_sub_Y!, x, y); + } + + static ffi.Pointer? _sel_sub_Y_Z; + static int sub_Y_Z(MethodTestObjCLibrary _lib, int x, int y, int z) { + _class ??= _getClass(_lib, "MethodInterface"); + _sel_sub_Y_Z ??= _registerName(_lib, "sub:Y:Z:"); + return _lib._objc_msgSend_29(_class!, _sel_sub_Y_Z!, x, y, z); + } + + static ffi.Pointer? _sel_new1; + static MethodInterface new1(MethodTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "MethodInterface"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return MethodInterface._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static MethodInterface alloc(MethodTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "MethodInterface"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return MethodInterface._(_ret, _lib); + } +} + +class NSObject extends _ObjCWrapper { + NSObject._(ffi.Pointer id, MethodTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSObject castFrom(T other) { + return NSObject._(other._id, other._lib); + } + + static ffi.Pointer? _sel_load; + static void load(MethodTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_load ??= _registerName(_lib, "load"); + _lib._objc_msgSend_0(_class!, _sel_load!); + } + + static ffi.Pointer? _sel_initialize; + static void initialize(MethodTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_initialize ??= _registerName(_lib, "initialize"); + _lib._objc_msgSend_0(_class!, _sel_initialize!); + } + + static ffi.Pointer? _sel_init; + NSObject init() { + _sel_init ??= _registerName(_lib, "init"); + final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSObject new1(MethodTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_allocWithZone; + static NSObject allocWithZone( + MethodTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_allocWithZone ??= _registerName(_lib, "allocWithZone:"); + final _ret = _lib._objc_msgSend_2(_class!, _sel_allocWithZone!, zone); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSObject alloc(MethodTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_dealloc; + void dealloc() { + _sel_dealloc ??= _registerName(_lib, "dealloc"); + _lib._objc_msgSend_0(_id, _sel_dealloc!); + } + + static ffi.Pointer? _sel_finalize; + void finalize() { + _sel_finalize ??= _registerName(_lib, "finalize"); + _lib._objc_msgSend_0(_id, _sel_finalize!); + } + + static ffi.Pointer? _sel_copy; + NSObject copy() { + _sel_copy ??= _registerName(_lib, "copy"); + final _ret = _lib._objc_msgSend_3(_id, _sel_copy!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_mutableCopy; + NSObject mutableCopy() { + _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); + final _ret = _lib._objc_msgSend_4(_id, _sel_mutableCopy!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_copyWithZone; + static NSObject copyWithZone( + MethodTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); + final _ret = _lib._objc_msgSend_5(_class!, _sel_copyWithZone!, zone); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_mutableCopyWithZone; + static NSObject mutableCopyWithZone( + MethodTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); + final _ret = _lib._objc_msgSend_6(_class!, _sel_mutableCopyWithZone!, zone); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_instancesRespondToSelector; + static bool instancesRespondToSelector( + MethodTestObjCLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instancesRespondToSelector ??= + _registerName(_lib, "instancesRespondToSelector:"); + return _lib._objc_msgSend_7( + _class!, _sel_instancesRespondToSelector!, aSelector); + } + + static ffi.Pointer? _sel_conformsToProtocol; + static bool conformsToProtocol( + MethodTestObjCLibrary _lib, NSObject protocol) { + _class ??= _getClass(_lib, "NSObject"); + _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); + return _lib._objc_msgSend_8( + _class!, _sel_conformsToProtocol!, protocol._id); + } + + static ffi.Pointer? _sel_methodForSelector; + IMP methodForSelector(ffi.Pointer aSelector) { + _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); + return _lib._objc_msgSend_9(_id, _sel_methodForSelector!, aSelector); + } + + static ffi.Pointer? _sel_instanceMethodForSelector; + static IMP instanceMethodForSelector( + MethodTestObjCLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instanceMethodForSelector ??= + _registerName(_lib, "instanceMethodForSelector:"); + return _lib._objc_msgSend_10( + _class!, _sel_instanceMethodForSelector!, aSelector); + } + + static ffi.Pointer? _sel_doesNotRecognizeSelector; + void doesNotRecognizeSelector(ffi.Pointer aSelector) { + _sel_doesNotRecognizeSelector ??= + _registerName(_lib, "doesNotRecognizeSelector:"); + _lib._objc_msgSend_11(_id, _sel_doesNotRecognizeSelector!, aSelector); + } + + static ffi.Pointer? _sel_forwardingTargetForSelector; + NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + _sel_forwardingTargetForSelector ??= + _registerName(_lib, "forwardingTargetForSelector:"); + final _ret = _lib._objc_msgSend_12( + _id, _sel_forwardingTargetForSelector!, aSelector); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_forwardInvocation; + void forwardInvocation(NSObject anInvocation) { + _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); + _lib._objc_msgSend_13(_id, _sel_forwardInvocation!, anInvocation._id); + } + + static ffi.Pointer? _sel_methodSignatureForSelector; + NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + _sel_methodSignatureForSelector ??= + _registerName(_lib, "methodSignatureForSelector:"); + final _ret = + _lib._objc_msgSend_14(_id, _sel_methodSignatureForSelector!, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static ffi.Pointer? _sel_instanceMethodSignatureForSelector; + static NSMethodSignature instanceMethodSignatureForSelector( + MethodTestObjCLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instanceMethodSignatureForSelector ??= + _registerName(_lib, "instanceMethodSignatureForSelector:"); + final _ret = _lib._objc_msgSend_15( + _class!, _sel_instanceMethodSignatureForSelector!, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static ffi.Pointer? _sel_allowsWeakReference; + bool allowsWeakReference() { + _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); + return _lib._objc_msgSend_16(_id, _sel_allowsWeakReference!); + } + + static ffi.Pointer? _sel_retainWeakReference; + bool retainWeakReference() { + _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); + return _lib._objc_msgSend_16(_id, _sel_retainWeakReference!); + } + + static ffi.Pointer? _sel_isSubclassOfClass; + static bool isSubclassOfClass(MethodTestObjCLibrary _lib, NSObject aClass) { + _class ??= _getClass(_lib, "NSObject"); + _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); + return _lib._objc_msgSend_17(_class!, _sel_isSubclassOfClass!, aClass._id); + } + + static ffi.Pointer? _sel_resolveClassMethod; + static bool resolveClassMethod( + MethodTestObjCLibrary _lib, ffi.Pointer sel) { + _class ??= _getClass(_lib, "NSObject"); + _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); + return _lib._objc_msgSend_18(_class!, _sel_resolveClassMethod!, sel); + } + + static ffi.Pointer? _sel_resolveInstanceMethod; + static bool resolveInstanceMethod( + MethodTestObjCLibrary _lib, ffi.Pointer sel) { + _class ??= _getClass(_lib, "NSObject"); + _sel_resolveInstanceMethod ??= + _registerName(_lib, "resolveInstanceMethod:"); + return _lib._objc_msgSend_19(_class!, _sel_resolveInstanceMethod!, sel); + } + + static ffi.Pointer? _sel_hash; + static int hash(MethodTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_hash ??= _registerName(_lib, "hash"); + return _lib._objc_msgSend_20(_class!, _sel_hash!); + } + + static ffi.Pointer? _sel_superclass; + static NSObject superclass(MethodTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_superclass ??= _registerName(_lib, "superclass"); + final _ret = _lib._objc_msgSend_21(_class!, _sel_superclass!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_class1; + static NSObject class1(MethodTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_class1 ??= _registerName(_lib, "class"); + final _ret = _lib._objc_msgSend_22(_class!, _sel_class1!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_description; + static NSString description(MethodTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_description ??= _registerName(_lib, "description"); + final _ret = _lib._objc_msgSend_25(_class!, _sel_description!); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_debugDescription; + static NSString debugDescription(MethodTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_debugDescription ??= _registerName(_lib, "debugDescription"); + final _ret = _lib._objc_msgSend_25(_class!, _sel_debugDescription!); + return NSString._(_ret, _lib); + } +} + +typedef instancetype = ffi.Pointer; + +class ObjCObject extends ffi.Opaque {} + +class _NSZone extends ffi.Opaque {} + +class ObjCSel extends ffi.Opaque {} + +typedef IMP = ffi.Pointer>; + +class NSMethodSignature extends _ObjCWrapper { + NSMethodSignature._(ffi.Pointer id, MethodTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSMethodSignature castFrom(T other) { + return NSMethodSignature._(other._id, other._lib); + } +} + +typedef NSUInteger = pkg_ffi.UnsignedLong; + +class NSString extends _ObjCWrapper { + NSString._(ffi.Pointer id, MethodTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSString castFrom(T other) { + return NSString._(other._id, other._lib); + } + + factory NSString(MethodTestObjCLibrary _lib, String str) { + final cstr = str.toNativeUtf8(); + final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + pkg_ffi.calloc.free(cstr); + return nsstr; + } + + @override + String toString() => UTF8String().cast().toDartString(); + + static ffi.Pointer? _sel_stringWithCString_encoding; + static NSString stringWithCString_encoding( + MethodTestObjCLibrary _lib, ffi.Pointer cString, int enc) { + _class ??= _getClass(_lib, "NSString"); + _sel_stringWithCString_encoding ??= + _registerName(_lib, "stringWithCString:encoding:"); + final _ret = _lib._objc_msgSend_23( + _class!, _sel_stringWithCString_encoding!, cString, enc); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_UTF8String; + ffi.Pointer UTF8String() { + _sel_UTF8String ??= _registerName(_lib, "UTF8String"); + return _lib._objc_msgSend_24(_id, _sel_UTF8String!); + } +} + +extension StringToNSString on String { + NSString toNSString(MethodTestObjCLibrary lib) => NSString(lib, this); +} + +const int NSScannedOption = 1; + +const int NSCollectorDisabledOption = 2; + +const int NS_BLOCKS_AVAILABLE = 1; + +const int __COREFOUNDATION_CFAVAILABILITY__ = 1; + +const int __CF_ENUM_FIXED_IS_AVAILABLE = 1; + +const double NSFoundationVersionNumber10_0 = 397.4; + +const double NSFoundationVersionNumber10_1 = 425.0; + +const double NSFoundationVersionNumber10_1_1 = 425.0; + +const double NSFoundationVersionNumber10_1_2 = 425.0; + +const double NSFoundationVersionNumber10_1_3 = 425.0; + +const double NSFoundationVersionNumber10_1_4 = 425.0; + +const double NSFoundationVersionNumber10_2 = 462.0; + +const double NSFoundationVersionNumber10_2_1 = 462.0; + +const double NSFoundationVersionNumber10_2_2 = 462.0; + +const double NSFoundationVersionNumber10_2_3 = 462.0; + +const double NSFoundationVersionNumber10_2_4 = 462.0; + +const double NSFoundationVersionNumber10_2_5 = 462.0; + +const double NSFoundationVersionNumber10_2_6 = 462.0; + +const double NSFoundationVersionNumber10_2_7 = 462.7; + +const double NSFoundationVersionNumber10_2_8 = 462.7; + +const double NSFoundationVersionNumber10_3 = 500.0; + +const double NSFoundationVersionNumber10_3_1 = 500.0; + +const double NSFoundationVersionNumber10_3_2 = 500.3; + +const double NSFoundationVersionNumber10_3_3 = 500.54; + +const double NSFoundationVersionNumber10_3_4 = 500.56; + +const double NSFoundationVersionNumber10_3_5 = 500.56; + +const double NSFoundationVersionNumber10_3_6 = 500.56; + +const double NSFoundationVersionNumber10_3_7 = 500.56; + +const double NSFoundationVersionNumber10_3_8 = 500.56; + +const double NSFoundationVersionNumber10_3_9 = 500.58; + +const double NSFoundationVersionNumber10_4 = 567.0; + +const double NSFoundationVersionNumber10_4_1 = 567.0; + +const double NSFoundationVersionNumber10_4_2 = 567.12; + +const double NSFoundationVersionNumber10_4_3 = 567.21; + +const double NSFoundationVersionNumber10_4_4_Intel = 567.23; + +const double NSFoundationVersionNumber10_4_4_PowerPC = 567.21; + +const double NSFoundationVersionNumber10_4_5 = 567.25; + +const double NSFoundationVersionNumber10_4_6 = 567.26; + +const double NSFoundationVersionNumber10_4_7 = 567.27; + +const double NSFoundationVersionNumber10_4_8 = 567.28; + +const double NSFoundationVersionNumber10_4_9 = 567.29; + +const double NSFoundationVersionNumber10_4_10 = 567.29; + +const double NSFoundationVersionNumber10_4_11 = 567.36; + +const double NSFoundationVersionNumber10_5 = 677.0; + +const double NSFoundationVersionNumber10_5_1 = 677.1; + +const double NSFoundationVersionNumber10_5_2 = 677.15; + +const double NSFoundationVersionNumber10_5_3 = 677.19; + +const double NSFoundationVersionNumber10_5_4 = 677.19; + +const double NSFoundationVersionNumber10_5_5 = 677.21; + +const double NSFoundationVersionNumber10_5_6 = 677.22; + +const double NSFoundationVersionNumber10_5_7 = 677.24; + +const double NSFoundationVersionNumber10_5_8 = 677.26; + +const double NSFoundationVersionNumber10_6 = 751.0; + +const double NSFoundationVersionNumber10_6_1 = 751.0; + +const double NSFoundationVersionNumber10_6_2 = 751.14; + +const double NSFoundationVersionNumber10_6_3 = 751.21; + +const double NSFoundationVersionNumber10_6_4 = 751.29; + +const double NSFoundationVersionNumber10_6_5 = 751.42; + +const double NSFoundationVersionNumber10_6_6 = 751.53; + +const double NSFoundationVersionNumber10_6_7 = 751.53; + +const double NSFoundationVersionNumber10_6_8 = 751.62; + +const double NSFoundationVersionNumber10_7 = 833.1; + +const double NSFoundationVersionNumber10_7_1 = 833.1; + +const double NSFoundationVersionNumber10_7_2 = 833.2; + +const double NSFoundationVersionNumber10_7_3 = 833.24; + +const double NSFoundationVersionNumber10_7_4 = 833.25; + +const double NSFoundationVersionNumber10_8 = 945.0; + +const double NSFoundationVersionNumber10_8_1 = 945.0; + +const double NSFoundationVersionNumber10_8_2 = 945.11; + +const double NSFoundationVersionNumber10_8_3 = 945.16; + +const double NSFoundationVersionNumber10_8_4 = 945.18; + +const int NSFoundationVersionNumber10_9 = 1056; + +const int NSFoundationVersionNumber10_9_1 = 1056; + +const double NSFoundationVersionNumber10_9_2 = 1056.13; + +const double NSFoundationVersionNumber10_10 = 1151.16; + +const double NSFoundationVersionNumber10_10_1 = 1151.16; + +const double NSFoundationVersionNumber10_10_2 = 1152.14; + +const double NSFoundationVersionNumber10_10_3 = 1153.2; + +const double NSFoundationVersionNumber10_10_4 = 1153.2; + +const int NSFoundationVersionNumber10_10_5 = 1154; + +const int NSFoundationVersionNumber10_10_Max = 1199; + +const int NSFoundationVersionNumber10_11 = 1252; + +const double NSFoundationVersionNumber10_11_1 = 1255.1; + +const double NSFoundationVersionNumber10_11_2 = 1256.1; + +const double NSFoundationVersionNumber10_11_3 = 1256.1; + +const int NSFoundationVersionNumber10_11_4 = 1258; + +const int NSFoundationVersionNumber10_11_Max = 1299; + +const int __COREFOUNDATION_CFBASE__ = 1; + +const int TRUE = 1; + +const int FALSE = 0; + +const double kCFCoreFoundationVersionNumber10_0 = 196.4; + +const double kCFCoreFoundationVersionNumber10_0_3 = 196.5; + +const double kCFCoreFoundationVersionNumber10_1 = 226.0; + +const double kCFCoreFoundationVersionNumber10_1_1 = 226.0; + +const double kCFCoreFoundationVersionNumber10_1_2 = 227.2; + +const double kCFCoreFoundationVersionNumber10_1_3 = 227.2; + +const double kCFCoreFoundationVersionNumber10_1_4 = 227.3; + +const double kCFCoreFoundationVersionNumber10_2 = 263.0; + +const double kCFCoreFoundationVersionNumber10_2_1 = 263.1; + +const double kCFCoreFoundationVersionNumber10_2_2 = 263.1; + +const double kCFCoreFoundationVersionNumber10_2_3 = 263.3; + +const double kCFCoreFoundationVersionNumber10_2_4 = 263.3; + +const double kCFCoreFoundationVersionNumber10_2_5 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_6 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_7 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_8 = 263.5; + +const double kCFCoreFoundationVersionNumber10_3 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_1 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_2 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_3 = 299.3; + +const double kCFCoreFoundationVersionNumber10_3_4 = 299.31; + +const double kCFCoreFoundationVersionNumber10_3_5 = 299.31; + +const double kCFCoreFoundationVersionNumber10_3_6 = 299.32; + +const double kCFCoreFoundationVersionNumber10_3_7 = 299.33; + +const double kCFCoreFoundationVersionNumber10_3_8 = 299.33; + +const double kCFCoreFoundationVersionNumber10_3_9 = 299.35; + +const double kCFCoreFoundationVersionNumber10_4 = 368.0; + +const double kCFCoreFoundationVersionNumber10_4_1 = 368.1; + +const double kCFCoreFoundationVersionNumber10_4_2 = 368.11; + +const double kCFCoreFoundationVersionNumber10_4_3 = 368.18; + +const double kCFCoreFoundationVersionNumber10_4_4_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_4_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_5_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_5_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_6_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_6_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_7 = 368.27; + +const double kCFCoreFoundationVersionNumber10_4_8 = 368.27; + +const double kCFCoreFoundationVersionNumber10_4_9 = 368.28; + +const double kCFCoreFoundationVersionNumber10_4_10 = 368.28; + +const double kCFCoreFoundationVersionNumber10_4_11 = 368.31; + +const double kCFCoreFoundationVersionNumber10_5 = 476.0; + +const double kCFCoreFoundationVersionNumber10_5_1 = 476.0; + +const double kCFCoreFoundationVersionNumber10_5_2 = 476.1; + +const double kCFCoreFoundationVersionNumber10_5_3 = 476.13; + +const double kCFCoreFoundationVersionNumber10_5_4 = 476.14; + +const double kCFCoreFoundationVersionNumber10_5_5 = 476.15; + +const double kCFCoreFoundationVersionNumber10_5_6 = 476.17; + +const double kCFCoreFoundationVersionNumber10_5_7 = 476.18; + +const double kCFCoreFoundationVersionNumber10_5_8 = 476.19; + +const double kCFCoreFoundationVersionNumber10_6 = 550.0; + +const double kCFCoreFoundationVersionNumber10_6_1 = 550.0; + +const double kCFCoreFoundationVersionNumber10_6_2 = 550.13; + +const double kCFCoreFoundationVersionNumber10_6_3 = 550.19; + +const double kCFCoreFoundationVersionNumber10_6_4 = 550.29; + +const double kCFCoreFoundationVersionNumber10_6_5 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_6 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_7 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_8 = 550.43; + +const double kCFCoreFoundationVersionNumber10_7 = 635.0; + +const double kCFCoreFoundationVersionNumber10_7_1 = 635.0; + +const double kCFCoreFoundationVersionNumber10_7_2 = 635.15; + +const double kCFCoreFoundationVersionNumber10_7_3 = 635.19; + +const double kCFCoreFoundationVersionNumber10_7_4 = 635.21; + +const double kCFCoreFoundationVersionNumber10_7_5 = 635.21; + +const double kCFCoreFoundationVersionNumber10_8 = 744.0; + +const double kCFCoreFoundationVersionNumber10_8_1 = 744.0; + +const double kCFCoreFoundationVersionNumber10_8_2 = 744.12; + +const double kCFCoreFoundationVersionNumber10_8_3 = 744.18; + +const double kCFCoreFoundationVersionNumber10_8_4 = 744.19; + +const double kCFCoreFoundationVersionNumber10_9 = 855.11; + +const double kCFCoreFoundationVersionNumber10_9_1 = 855.11; + +const double kCFCoreFoundationVersionNumber10_9_2 = 855.14; + +const double kCFCoreFoundationVersionNumber10_10 = 1151.16; + +const double kCFCoreFoundationVersionNumber10_10_1 = 1151.16; + +const int kCFCoreFoundationVersionNumber10_10_2 = 1152; + +const double kCFCoreFoundationVersionNumber10_10_3 = 1153.18; + +const double kCFCoreFoundationVersionNumber10_10_4 = 1153.18; + +const double kCFCoreFoundationVersionNumber10_10_5 = 1153.18; + +const int kCFCoreFoundationVersionNumber10_10_Max = 1199; + +const int kCFCoreFoundationVersionNumber10_11 = 1253; + +const double kCFCoreFoundationVersionNumber10_11_1 = 1255.1; + +const double kCFCoreFoundationVersionNumber10_11_2 = 1256.14; + +const double kCFCoreFoundationVersionNumber10_11_3 = 1256.14; + +const double kCFCoreFoundationVersionNumber10_11_4 = 1258.1; + +const int kCFCoreFoundationVersionNumber10_11_Max = 1299; + +const int ISA_PTRAUTH_DISCRIMINATOR = 27361; diff --git a/pkgs/ffigen/test/native_objc_test/method_config.yaml b/pkgs/ffigen/test/native_objc_test/method_config.yaml new file mode 100644 index 0000000000..0f68e597a4 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/method_config.yaml @@ -0,0 +1,12 @@ +name: MethodTestObjCLibrary +description: 'Tests calling Objective-C methods' +language: objc +output: 'test/native_objc_test/method_bindings.dart' +functions: + exclude: + - '.*' +headers: + entry-points: + - 'test/native_objc_test/method_test.m' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/method_test.dart b/pkgs/ffigen/test/native_objc_test/method_test.dart new file mode 100644 index 0000000000..d6c29902d1 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/method_test.dart @@ -0,0 +1,90 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:ffigen/ffigen.dart'; +import 'package:path/path.dart' as path; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart'; +import '../test_utils.dart'; +import 'method_bindings.dart'; + +void main() { + late MethodInterface testInstance; + late MethodTestObjCLibrary lib; + + group('method calls', () { + setUpAll(() { + logWarnings(); + final dylib = File('test/native_objc_test/method_test.dylib'); + verifySetupFile(dylib); + lib = MethodTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); + testInstance = MethodInterface.new1(lib); + }); + + test('generate_bindings', () { + final config = Config.fromYaml(loadYaml( + File(path.join('test', 'native_objc_test', 'method_config.yaml')) + .readAsStringSync()) as YamlMap); + final library = parse(config); + final file = File( + path.join('test', 'debug_generated', 'method_test.dart'), + ); + library.generateFile(file); + + try { + final actual = file.readAsStringSync(); + final expected = File(path.join(config.output)).readAsStringSync(); + expect(actual, expected); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + print('Failed test: Debug generated file: ${file.absolute.path}'); + rethrow; + } + }); + + group('Instance methods', () { + test('No arguments', () { + expect(testInstance.add(), 5); + }); + + test('One argument', () { + expect(testInstance.add1(23), 23); + }); + + test('Two arguments', () { + expect(testInstance.add_Y(23, 17), 40); + }); + + test('Three arguments', () { + expect(testInstance.add_Y_Z(23, 17, 60), 100); + }); + }); + + group('Class methods', () { + test('No arguments', () { + expect(MethodInterface.sub(lib), -5); + }); + + test('One argument', () { + expect(MethodInterface.sub1(lib, 7), -7); + }); + + test('Two arguments', () { + expect(MethodInterface.sub_Y(lib, 7, 3), -10); + }); + + test('Three arguments', () { + expect(MethodInterface.sub_Y_Z(lib, 10, 7, 3), -20); + }); + }); + }); +} diff --git a/pkgs/ffigen/test/native_objc_test/method_test.m b/pkgs/ffigen/test/native_objc_test/method_test.m new file mode 100644 index 0000000000..86ea09040e --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/method_test.m @@ -0,0 +1,53 @@ +#import + +@interface MethodInterface : NSObject { +} + + +-(int32_t)add; +-(int32_t)add:(int32_t)x; +-(int32_t)add:(int32_t)x Y:(int32_t) y; +-(int32_t)add:(int32_t)x Y:(int32_t) y Z:(int32_t) z; + ++(int32_t)sub; ++(int32_t)sub:(int32_t)x; ++(int32_t)sub:(int32_t)x Y:(int32_t) y; ++(int32_t)sub:(int32_t)x Y:(int32_t) y Z:(int32_t) z; + +@end + +@implementation MethodInterface + +-(int32_t)add { + return 5; +} + +-(int32_t)add:(int32_t)x { + return x; +} + +-(int32_t)add:(int32_t)x Y:(int32_t) y { + return x + y; +} + +-(int32_t)add:(int32_t)x Y:(int32_t) y Z:(int32_t) z { + return x + y + z; +} + ++(int32_t)sub { + return -5; +} + ++(int32_t)sub:(int32_t)x { + return -x; +} + ++(int32_t)sub:(int32_t)x Y:(int32_t) y { + return -x - y; +} + ++(int32_t)sub:(int32_t)x Y:(int32_t) y Z:(int32_t) z { + return - x - y - z; +} + +@end diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart index 8b23c2d99b..b1b9eed92b 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart @@ -66,33 +66,5 @@ void main() { expect(foo1.multiply_withOtherFoo(false, foo2), 5); expect(foo1.multiply_withOtherFoo(true, foo2), 200); }); - - test('NSString manipulations', () { - final str1 = NSString(lib, "Hello"); - final str2 = "World!".toNSString(lib); - - expect(str1.length, 5); - expect(str2.length, 6); - - expect(str1.toString(), "Hello"); - expect(str2.toString(), "World!"); - - final str3 = StringUtil.strConcat_with(lib, str1, str2); - expect(str3.length, 11); - expect(str3.toString(), "HelloWorld!"); - }); - - test('Instance read-only property', () { - expect(Foo.makeFoo(lib, 42).readOnlyProperty, 7); - }); - - test('Class read-only property', () { - expect(Foo.getClassReadOnlyProperty(lib), 42); - }); - - test('Class read-write property', () { - Foo.setClassReadWriteProperty(lib, 101); - expect(Foo.getClassReadWriteProperty(lib), 101); - }); }); } diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test.m b/pkgs/ffigen/test/native_objc_test/native_objc_test.m index 549cf359bb..ab7018eb3d 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test.m +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test.m @@ -6,9 +6,6 @@ @interface Foo : NSObject { } @property int32_t intVal; -@property (readonly) int32_t readOnlyProperty; -@property (class, readonly) int32_t classReadOnlyProperty; -@property (class) int32_t classReadWriteProperty; + (Foo*)makeFoo:(double)x; @@ -20,24 +17,6 @@ - (void)setDoubleVal:(double)x; @implementation Foo -static int32_t _classReadWriteProperty = 0; - -- (int32_t)readOnlyProperty { - return 7; -} - -+ (int32_t)classReadOnlyProperty { - return 42; -} - -+ (int32_t)classReadWriteProperty { - return _classReadWriteProperty; -} - -+ (void)setClassReadWriteProperty:(int32_t)x { - _classReadWriteProperty = x; -} - + (Foo*)makeFoo:(double)x { Foo* foo = [Foo new]; foo->doubleVal = x; @@ -58,14 +37,3 @@ - (void)setDoubleVal:(double)x { } @end - -// TODO(#309): strConcat should just be a static function. -@interface StringUtil : NSObject {} -+ (NSString*)strConcat:(NSString*)a with:(NSString*)b; -@end - -@implementation StringUtil -+ (NSString*)strConcat:(NSString*)a with:(NSString*)b { - return [a stringByAppendingString:b]; -} -@end diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart index 25c41cf949..ebcd7c673c 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart @@ -3252,42 +3252,6 @@ class NativeObjCLibrary { ffi.Double)>>('objc_msgSend'); late final __objc_msgSend_134 = __objc_msgSend_134Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, double)>(); - - late final ffi.Pointer __classReadWriteProperty = - _lookup('_classReadWriteProperty'); - - int get _classReadWriteProperty => __classReadWriteProperty.value; - - set _classReadWriteProperty(int value) => - __classReadWriteProperty.value = value; - - ffi.Pointer _objc_msgSend_135( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer a, - ffi.Pointer b, - ) { - return __objc_msgSend_135( - obj, - sel, - a, - b, - ); - } - - late final __objc_msgSend_135Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_135 = __objc_msgSend_135Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); } abstract class NSComparisonResult { @@ -5338,35 +5302,6 @@ class Foo extends NSObject { _lib._objc_msgSend_131(_id, _sel_intVal1!, value); } - static ffi.Pointer? _sel_readOnlyProperty; - int get readOnlyProperty { - _sel_readOnlyProperty ??= _registerName(_lib, "readOnlyProperty"); - return _lib._objc_msgSend_130(_id, _sel_readOnlyProperty!); - } - - static ffi.Pointer? _sel_classReadOnlyProperty; - static int getClassReadOnlyProperty(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "Foo"); - _sel_classReadOnlyProperty ??= _registerName(_lib, "classReadOnlyProperty"); - return _lib._objc_msgSend_130(_class!, _sel_classReadOnlyProperty!); - } - - static ffi.Pointer? _sel_classReadWriteProperty; - static int getClassReadWriteProperty(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "Foo"); - _sel_classReadWriteProperty ??= - _registerName(_lib, "classReadWriteProperty"); - return _lib._objc_msgSend_130(_class!, _sel_classReadWriteProperty!); - } - - static ffi.Pointer? _sel_classReadWriteProperty1; - static void setClassReadWriteProperty(NativeObjCLibrary _lib, int value) { - _class ??= _getClass(_lib, "Foo"); - _sel_classReadWriteProperty1 ??= - _registerName(_lib, "setClassReadWriteProperty:"); - _lib._objc_msgSend_131(_class!, _sel_classReadWriteProperty1!, value); - } - static ffi.Pointer? _sel_makeFoo; static Foo makeFoo(NativeObjCLibrary _lib, double x) { _class ??= _getClass(_lib, "Foo"); @@ -5406,43 +5341,6 @@ class Foo extends NSObject { } } -class StringUtil extends NSObject { - StringUtil._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); - - static ffi.Pointer? _class; - - static StringUtil castFrom(T other) { - return StringUtil._(other._id, other._lib); - } - - static ffi.Pointer? _sel_strConcat_with; - static NSString strConcat_with( - NativeObjCLibrary _lib, NSObject a, NSObject b) { - _class ??= _getClass(_lib, "StringUtil"); - _sel_strConcat_with ??= _registerName(_lib, "strConcat:with:"); - final _ret = - _lib._objc_msgSend_135(_class!, _sel_strConcat_with!, a._id, b._id); - return NSString._(_ret, _lib); - } - - static ffi.Pointer? _sel_new1; - static StringUtil new1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "StringUtil"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); - return StringUtil._(_ret, _lib); - } - - static ffi.Pointer? _sel_alloc; - static StringUtil alloc(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "StringUtil"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); - return StringUtil._(_ret, _lib); - } -} - const int NSScannedOption = 1; const int NSCollectorDisabledOption = 2; diff --git a/pkgs/ffigen/test/native_objc_test/property_bindings.dart b/pkgs/ffigen/test/native_objc_test/property_bindings.dart new file mode 100644 index 0000000000..85485e7f4c --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/property_bindings.dart @@ -0,0 +1,1547 @@ +// ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; + +/// Tests calling Objective-C properties i.e. getters and setters +class PropertyTestObjCLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + PropertyTestObjCLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + PropertyTestObjCLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + late final ffi.Pointer _NSFoundationVersionNumber = + _lookup('NSFoundationVersionNumber'); + + double get NSFoundationVersionNumber => _NSFoundationVersionNumber.value; + + set NSFoundationVersionNumber(double value) => + _NSFoundationVersionNumber.value = value; + + late final ffi.Pointer _NSNotFound = + _lookup('NSNotFound'); + + int get NSNotFound => _NSNotFound.value; + + set NSNotFound(int value) => _NSNotFound.value = value; + + late final ffi.Pointer _kCFCoreFoundationVersionNumber = + _lookup('kCFCoreFoundationVersionNumber'); + + double get kCFCoreFoundationVersionNumber => + _kCFCoreFoundationVersionNumber.value; + + set kCFCoreFoundationVersionNumber(double value) => + _kCFCoreFoundationVersionNumber.value = value; + + late final ffi.Pointer _kCFNotFound = + _lookup('kCFNotFound'); + + int get kCFNotFound => _kCFNotFound.value; + + set kCFNotFound(int value) => _kCFNotFound.value = value; + + late final ffi.Pointer _kCFNull = _lookup('kCFNull'); + + CFNullRef get kCFNull => _kCFNull.value; + + set kCFNull(CFNullRef value) => _kCFNull.value = value; + + late final ffi.Pointer _kCFAllocatorDefault = + _lookup('kCFAllocatorDefault'); + + CFAllocatorRef get kCFAllocatorDefault => _kCFAllocatorDefault.value; + + set kCFAllocatorDefault(CFAllocatorRef value) => + _kCFAllocatorDefault.value = value; + + late final ffi.Pointer _kCFAllocatorSystemDefault = + _lookup('kCFAllocatorSystemDefault'); + + CFAllocatorRef get kCFAllocatorSystemDefault => + _kCFAllocatorSystemDefault.value; + + set kCFAllocatorSystemDefault(CFAllocatorRef value) => + _kCFAllocatorSystemDefault.value = value; + + late final ffi.Pointer _kCFAllocatorMalloc = + _lookup('kCFAllocatorMalloc'); + + CFAllocatorRef get kCFAllocatorMalloc => _kCFAllocatorMalloc.value; + + set kCFAllocatorMalloc(CFAllocatorRef value) => + _kCFAllocatorMalloc.value = value; + + late final ffi.Pointer _kCFAllocatorMallocZone = + _lookup('kCFAllocatorMallocZone'); + + CFAllocatorRef get kCFAllocatorMallocZone => _kCFAllocatorMallocZone.value; + + set kCFAllocatorMallocZone(CFAllocatorRef value) => + _kCFAllocatorMallocZone.value = value; + + late final ffi.Pointer _kCFAllocatorNull = + _lookup('kCFAllocatorNull'); + + CFAllocatorRef get kCFAllocatorNull => _kCFAllocatorNull.value; + + set kCFAllocatorNull(CFAllocatorRef value) => _kCFAllocatorNull.value = value; + + late final ffi.Pointer _kCFAllocatorUseContext = + _lookup('kCFAllocatorUseContext'); + + CFAllocatorRef get kCFAllocatorUseContext => _kCFAllocatorUseContext.value; + + set kCFAllocatorUseContext(CFAllocatorRef value) => + _kCFAllocatorUseContext.value = value; + + ffi.Pointer _sel_registerName( + ffi.Pointer str, + ) { + return __sel_registerName( + str, + ); + } + + late final __sel_registerNamePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sel_registerName'); + late final __sel_registerName = __sel_registerNamePtr + .asFunction Function(ffi.Pointer)>(); + + ffi.Pointer _objc_getClass( + ffi.Pointer str, + ) { + return __objc_getClass( + str, + ); + } + + late final __objc_getClassPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('objc_getClass'); + late final __objc_getClass = __objc_getClassPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); + + void _objc_msgSend_0( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_0( + obj, + sel, + ); + } + + late final __objc_msgSend_0Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); + + instancetype _objc_msgSend_1( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1( + obj, + sel, + ); + } + + late final __objc_msgSend_1Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer)>(); + + instancetype _objc_msgSend_2( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_2( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_2Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>(); + + ffi.Pointer _objc_msgSend_3( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_3( + obj, + sel, + ); + } + + late final __objc_msgSend_3Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_4( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_4( + obj, + sel, + ); + } + + late final __objc_msgSend_4Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_5( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_5( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_5Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); + + ffi.Pointer _objc_msgSend_6( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_6( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_6Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); + + bool _objc_msgSend_7( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_7( + obj, + sel, + aSelector, + ) != + 0; + } + + late final __objc_msgSend_7Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + bool _objc_msgSend_8( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer protocol, + ) { + return __objc_msgSend_8( + obj, + sel, + protocol, + ) != + 0; + } + + late final __objc_msgSend_8Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + IMP _objc_msgSend_9( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_9( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_9Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + IMP _objc_msgSend_10( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_10( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_10Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_11( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_11( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_11Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_12( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_12( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_12Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_13( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anInvocation, + ) { + return __objc_msgSend_13( + obj, + sel, + anInvocation, + ); + } + + late final __objc_msgSend_13Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_14( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_14( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_14Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_15( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_15( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_15Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + bool _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_16( + obj, + sel, + ) != + 0; + } + + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + bool _objc_msgSend_17( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ) { + return __objc_msgSend_17( + obj, + sel, + aClass, + ) != + 0; + } + + late final __objc_msgSend_17Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + bool _objc_msgSend_18( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sel1, + ) { + return __objc_msgSend_18( + obj, + sel, + sel1, + ) != + 0; + } + + late final __objc_msgSend_18Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + bool _objc_msgSend_19( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sel1, + ) { + return __objc_msgSend_19( + obj, + sel, + sel1, + ) != + 0; + } + + late final __objc_msgSend_19Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_20( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_20( + obj, + sel, + ); + } + + late final __objc_msgSend_20Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_21( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_21( + obj, + sel, + ); + } + + late final __objc_msgSend_21Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_22( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_22( + obj, + sel, + ); + } + + late final __objc_msgSend_22Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_23( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cString, + int enc, + ) { + return __objc_msgSend_23( + obj, + sel, + cString, + enc, + ); + } + + late final __objc_msgSend_23Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + pkg_ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_24( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_24( + obj, + sel, + ); + } + + late final __objc_msgSend_24Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_25( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_25( + obj, + sel, + ); + } + + late final __objc_msgSend_25Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_26( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_26( + obj, + sel, + ); + } + + late final __objc_msgSend_26Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_27( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_27( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_27Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer __classReadWriteProperty = + _lookup('_classReadWriteProperty'); + + int get _classReadWriteProperty => __classReadWriteProperty.value; + + set _classReadWriteProperty(int value) => + __classReadWriteProperty.value = value; +} + +abstract class NSComparisonResult { + static const int NSOrderedAscending = -1; + static const int NSOrderedSame = 0; + static const int NSOrderedDescending = 1; +} + +abstract class NSEnumerationOptions { + static const int NSEnumerationConcurrent = 1; + static const int NSEnumerationReverse = 2; +} + +abstract class NSSortOptions { + static const int NSSortConcurrent = 1; + static const int NSSortStable = 16; +} + +abstract class NSQualityOfService { + static const int NSQualityOfServiceUserInteractive = 33; + static const int NSQualityOfServiceUserInitiated = 25; + static const int NSQualityOfServiceUtility = 17; + static const int NSQualityOfServiceBackground = 9; + static const int NSQualityOfServiceDefault = -1; +} + +typedef NSInteger = pkg_ffi.Long; + +class __CFString extends ffi.Opaque {} + +abstract class CFComparisonResult { + static const int kCFCompareLessThan = -1; + static const int kCFCompareEqualTo = 0; + static const int kCFCompareGreaterThan = 1; +} + +typedef CFIndex = pkg_ffi.Long; + +class CFRange extends ffi.Struct { + @CFIndex() + external int location; + + @CFIndex() + external int length; +} + +class __CFNull extends ffi.Opaque {} + +typedef CFNullRef = ffi.Pointer<__CFNull>; + +class __CFAllocator extends ffi.Opaque {} + +typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; + +class CFAllocatorContext extends ffi.Struct { + @CFIndex() + external int version; + + external ffi.Pointer info; + + external CFAllocatorRetainCallBack retain; + + external CFAllocatorReleaseCallBack release; + + external CFAllocatorCopyDescriptionCallBack copyDescription; + + external CFAllocatorAllocateCallBack allocate; + + external CFAllocatorReallocateCallBack reallocate; + + external CFAllocatorDeallocateCallBack deallocate; + + external CFAllocatorPreferredSizeCallBack preferredSize; +} + +typedef CFAllocatorRetainCallBack = ffi.Pointer< + ffi.NativeFunction Function(ffi.Pointer)>>; +typedef CFAllocatorReleaseCallBack + = ffi.Pointer)>>; +typedef CFAllocatorCopyDescriptionCallBack = ffi + .Pointer)>>; +typedef CFStringRef = ffi.Pointer<__CFString>; +typedef CFAllocatorAllocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + CFIndex, CFOptionFlags, ffi.Pointer)>>; +typedef CFOptionFlags = pkg_ffi.UnsignedLong; +typedef CFAllocatorReallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, CFIndex, + CFOptionFlags, ffi.Pointer)>>; +typedef CFAllocatorDeallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; +typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< + ffi.NativeFunction< + CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; + +ffi.Pointer _registerName(PropertyTestObjCLibrary _lib, String name) { + final cstr = name.toNativeUtf8(); + final sel = _lib._sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; +} + +ffi.Pointer _getClass(PropertyTestObjCLibrary _lib, String name) { + final cstr = name.toNativeUtf8(); + final clazz = _lib._objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; +} + +class _ObjCWrapper { + final ffi.Pointer _id; + final PropertyTestObjCLibrary _lib; + _ObjCWrapper._(this._id, this._lib); +} + +class PropertyInterface extends NSObject { + PropertyInterface._(ffi.Pointer id, PropertyTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static PropertyInterface castFrom(T other) { + return PropertyInterface._(other._id, other._lib); + } + + static ffi.Pointer? _sel_readOnlyProperty; + int get readOnlyProperty { + _sel_readOnlyProperty ??= _registerName(_lib, "readOnlyProperty"); + return _lib._objc_msgSend_26(_id, _sel_readOnlyProperty!); + } + + static ffi.Pointer? _sel_readWriteProperty; + int get readWriteProperty { + _sel_readWriteProperty ??= _registerName(_lib, "readWriteProperty"); + return _lib._objc_msgSend_26(_id, _sel_readWriteProperty!); + } + + static ffi.Pointer? _sel_readWriteProperty1; + set readWriteProperty(int value) { + _sel_readWriteProperty1 ??= _registerName(_lib, "setReadWriteProperty:"); + _lib._objc_msgSend_27(_id, _sel_readWriteProperty1!, value); + } + + static ffi.Pointer? _sel_classReadOnlyProperty; + static int getClassReadOnlyProperty(PropertyTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "PropertyInterface"); + _sel_classReadOnlyProperty ??= _registerName(_lib, "classReadOnlyProperty"); + return _lib._objc_msgSend_26(_class!, _sel_classReadOnlyProperty!); + } + + static ffi.Pointer? _sel_classReadWriteProperty; + static int getClassReadWriteProperty(PropertyTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "PropertyInterface"); + _sel_classReadWriteProperty ??= + _registerName(_lib, "classReadWriteProperty"); + return _lib._objc_msgSend_26(_class!, _sel_classReadWriteProperty!); + } + + static ffi.Pointer? _sel_classReadWriteProperty1; + static void setClassReadWriteProperty( + PropertyTestObjCLibrary _lib, int value) { + _class ??= _getClass(_lib, "PropertyInterface"); + _sel_classReadWriteProperty1 ??= + _registerName(_lib, "setClassReadWriteProperty:"); + _lib._objc_msgSend_27(_class!, _sel_classReadWriteProperty1!, value); + } + + static ffi.Pointer? _sel_new1; + static PropertyInterface new1(PropertyTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "PropertyInterface"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return PropertyInterface._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static PropertyInterface alloc(PropertyTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "PropertyInterface"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return PropertyInterface._(_ret, _lib); + } +} + +class NSObject extends _ObjCWrapper { + NSObject._(ffi.Pointer id, PropertyTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSObject castFrom(T other) { + return NSObject._(other._id, other._lib); + } + + static ffi.Pointer? _sel_load; + static void load(PropertyTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_load ??= _registerName(_lib, "load"); + _lib._objc_msgSend_0(_class!, _sel_load!); + } + + static ffi.Pointer? _sel_initialize; + static void initialize(PropertyTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_initialize ??= _registerName(_lib, "initialize"); + _lib._objc_msgSend_0(_class!, _sel_initialize!); + } + + static ffi.Pointer? _sel_init; + NSObject init() { + _sel_init ??= _registerName(_lib, "init"); + final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSObject new1(PropertyTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_allocWithZone; + static NSObject allocWithZone( + PropertyTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_allocWithZone ??= _registerName(_lib, "allocWithZone:"); + final _ret = _lib._objc_msgSend_2(_class!, _sel_allocWithZone!, zone); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSObject alloc(PropertyTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_dealloc; + void dealloc() { + _sel_dealloc ??= _registerName(_lib, "dealloc"); + _lib._objc_msgSend_0(_id, _sel_dealloc!); + } + + static ffi.Pointer? _sel_finalize; + void finalize() { + _sel_finalize ??= _registerName(_lib, "finalize"); + _lib._objc_msgSend_0(_id, _sel_finalize!); + } + + static ffi.Pointer? _sel_copy; + NSObject copy() { + _sel_copy ??= _registerName(_lib, "copy"); + final _ret = _lib._objc_msgSend_3(_id, _sel_copy!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_mutableCopy; + NSObject mutableCopy() { + _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); + final _ret = _lib._objc_msgSend_4(_id, _sel_mutableCopy!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_copyWithZone; + static NSObject copyWithZone( + PropertyTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); + final _ret = _lib._objc_msgSend_5(_class!, _sel_copyWithZone!, zone); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_mutableCopyWithZone; + static NSObject mutableCopyWithZone( + PropertyTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); + final _ret = _lib._objc_msgSend_6(_class!, _sel_mutableCopyWithZone!, zone); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_instancesRespondToSelector; + static bool instancesRespondToSelector( + PropertyTestObjCLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instancesRespondToSelector ??= + _registerName(_lib, "instancesRespondToSelector:"); + return _lib._objc_msgSend_7( + _class!, _sel_instancesRespondToSelector!, aSelector); + } + + static ffi.Pointer? _sel_conformsToProtocol; + static bool conformsToProtocol( + PropertyTestObjCLibrary _lib, NSObject protocol) { + _class ??= _getClass(_lib, "NSObject"); + _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); + return _lib._objc_msgSend_8( + _class!, _sel_conformsToProtocol!, protocol._id); + } + + static ffi.Pointer? _sel_methodForSelector; + IMP methodForSelector(ffi.Pointer aSelector) { + _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); + return _lib._objc_msgSend_9(_id, _sel_methodForSelector!, aSelector); + } + + static ffi.Pointer? _sel_instanceMethodForSelector; + static IMP instanceMethodForSelector( + PropertyTestObjCLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instanceMethodForSelector ??= + _registerName(_lib, "instanceMethodForSelector:"); + return _lib._objc_msgSend_10( + _class!, _sel_instanceMethodForSelector!, aSelector); + } + + static ffi.Pointer? _sel_doesNotRecognizeSelector; + void doesNotRecognizeSelector(ffi.Pointer aSelector) { + _sel_doesNotRecognizeSelector ??= + _registerName(_lib, "doesNotRecognizeSelector:"); + _lib._objc_msgSend_11(_id, _sel_doesNotRecognizeSelector!, aSelector); + } + + static ffi.Pointer? _sel_forwardingTargetForSelector; + NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + _sel_forwardingTargetForSelector ??= + _registerName(_lib, "forwardingTargetForSelector:"); + final _ret = _lib._objc_msgSend_12( + _id, _sel_forwardingTargetForSelector!, aSelector); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_forwardInvocation; + void forwardInvocation(NSObject anInvocation) { + _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); + _lib._objc_msgSend_13(_id, _sel_forwardInvocation!, anInvocation._id); + } + + static ffi.Pointer? _sel_methodSignatureForSelector; + NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + _sel_methodSignatureForSelector ??= + _registerName(_lib, "methodSignatureForSelector:"); + final _ret = + _lib._objc_msgSend_14(_id, _sel_methodSignatureForSelector!, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static ffi.Pointer? _sel_instanceMethodSignatureForSelector; + static NSMethodSignature instanceMethodSignatureForSelector( + PropertyTestObjCLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instanceMethodSignatureForSelector ??= + _registerName(_lib, "instanceMethodSignatureForSelector:"); + final _ret = _lib._objc_msgSend_15( + _class!, _sel_instanceMethodSignatureForSelector!, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static ffi.Pointer? _sel_allowsWeakReference; + bool allowsWeakReference() { + _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); + return _lib._objc_msgSend_16(_id, _sel_allowsWeakReference!); + } + + static ffi.Pointer? _sel_retainWeakReference; + bool retainWeakReference() { + _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); + return _lib._objc_msgSend_16(_id, _sel_retainWeakReference!); + } + + static ffi.Pointer? _sel_isSubclassOfClass; + static bool isSubclassOfClass(PropertyTestObjCLibrary _lib, NSObject aClass) { + _class ??= _getClass(_lib, "NSObject"); + _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); + return _lib._objc_msgSend_17(_class!, _sel_isSubclassOfClass!, aClass._id); + } + + static ffi.Pointer? _sel_resolveClassMethod; + static bool resolveClassMethod( + PropertyTestObjCLibrary _lib, ffi.Pointer sel) { + _class ??= _getClass(_lib, "NSObject"); + _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); + return _lib._objc_msgSend_18(_class!, _sel_resolveClassMethod!, sel); + } + + static ffi.Pointer? _sel_resolveInstanceMethod; + static bool resolveInstanceMethod( + PropertyTestObjCLibrary _lib, ffi.Pointer sel) { + _class ??= _getClass(_lib, "NSObject"); + _sel_resolveInstanceMethod ??= + _registerName(_lib, "resolveInstanceMethod:"); + return _lib._objc_msgSend_19(_class!, _sel_resolveInstanceMethod!, sel); + } + + static ffi.Pointer? _sel_hash; + static int hash(PropertyTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_hash ??= _registerName(_lib, "hash"); + return _lib._objc_msgSend_20(_class!, _sel_hash!); + } + + static ffi.Pointer? _sel_superclass; + static NSObject superclass(PropertyTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_superclass ??= _registerName(_lib, "superclass"); + final _ret = _lib._objc_msgSend_21(_class!, _sel_superclass!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_class1; + static NSObject class1(PropertyTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_class1 ??= _registerName(_lib, "class"); + final _ret = _lib._objc_msgSend_22(_class!, _sel_class1!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_description; + static NSString description(PropertyTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_description ??= _registerName(_lib, "description"); + final _ret = _lib._objc_msgSend_25(_class!, _sel_description!); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_debugDescription; + static NSString debugDescription(PropertyTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_debugDescription ??= _registerName(_lib, "debugDescription"); + final _ret = _lib._objc_msgSend_25(_class!, _sel_debugDescription!); + return NSString._(_ret, _lib); + } +} + +typedef instancetype = ffi.Pointer; + +class ObjCObject extends ffi.Opaque {} + +class _NSZone extends ffi.Opaque {} + +class ObjCSel extends ffi.Opaque {} + +typedef IMP = ffi.Pointer>; + +class NSMethodSignature extends _ObjCWrapper { + NSMethodSignature._(ffi.Pointer id, PropertyTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSMethodSignature castFrom(T other) { + return NSMethodSignature._(other._id, other._lib); + } +} + +typedef NSUInteger = pkg_ffi.UnsignedLong; + +class NSString extends _ObjCWrapper { + NSString._(ffi.Pointer id, PropertyTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSString castFrom(T other) { + return NSString._(other._id, other._lib); + } + + factory NSString(PropertyTestObjCLibrary _lib, String str) { + final cstr = str.toNativeUtf8(); + final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + pkg_ffi.calloc.free(cstr); + return nsstr; + } + + @override + String toString() => UTF8String().cast().toDartString(); + + static ffi.Pointer? _sel_stringWithCString_encoding; + static NSString stringWithCString_encoding(PropertyTestObjCLibrary _lib, + ffi.Pointer cString, int enc) { + _class ??= _getClass(_lib, "NSString"); + _sel_stringWithCString_encoding ??= + _registerName(_lib, "stringWithCString:encoding:"); + final _ret = _lib._objc_msgSend_23( + _class!, _sel_stringWithCString_encoding!, cString, enc); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_UTF8String; + ffi.Pointer UTF8String() { + _sel_UTF8String ??= _registerName(_lib, "UTF8String"); + return _lib._objc_msgSend_24(_id, _sel_UTF8String!); + } +} + +extension StringToNSString on String { + NSString toNSString(PropertyTestObjCLibrary lib) => NSString(lib, this); +} + +const int NSScannedOption = 1; + +const int NSCollectorDisabledOption = 2; + +const int NS_BLOCKS_AVAILABLE = 1; + +const int __COREFOUNDATION_CFAVAILABILITY__ = 1; + +const int __CF_ENUM_FIXED_IS_AVAILABLE = 1; + +const double NSFoundationVersionNumber10_0 = 397.4; + +const double NSFoundationVersionNumber10_1 = 425.0; + +const double NSFoundationVersionNumber10_1_1 = 425.0; + +const double NSFoundationVersionNumber10_1_2 = 425.0; + +const double NSFoundationVersionNumber10_1_3 = 425.0; + +const double NSFoundationVersionNumber10_1_4 = 425.0; + +const double NSFoundationVersionNumber10_2 = 462.0; + +const double NSFoundationVersionNumber10_2_1 = 462.0; + +const double NSFoundationVersionNumber10_2_2 = 462.0; + +const double NSFoundationVersionNumber10_2_3 = 462.0; + +const double NSFoundationVersionNumber10_2_4 = 462.0; + +const double NSFoundationVersionNumber10_2_5 = 462.0; + +const double NSFoundationVersionNumber10_2_6 = 462.0; + +const double NSFoundationVersionNumber10_2_7 = 462.7; + +const double NSFoundationVersionNumber10_2_8 = 462.7; + +const double NSFoundationVersionNumber10_3 = 500.0; + +const double NSFoundationVersionNumber10_3_1 = 500.0; + +const double NSFoundationVersionNumber10_3_2 = 500.3; + +const double NSFoundationVersionNumber10_3_3 = 500.54; + +const double NSFoundationVersionNumber10_3_4 = 500.56; + +const double NSFoundationVersionNumber10_3_5 = 500.56; + +const double NSFoundationVersionNumber10_3_6 = 500.56; + +const double NSFoundationVersionNumber10_3_7 = 500.56; + +const double NSFoundationVersionNumber10_3_8 = 500.56; + +const double NSFoundationVersionNumber10_3_9 = 500.58; + +const double NSFoundationVersionNumber10_4 = 567.0; + +const double NSFoundationVersionNumber10_4_1 = 567.0; + +const double NSFoundationVersionNumber10_4_2 = 567.12; + +const double NSFoundationVersionNumber10_4_3 = 567.21; + +const double NSFoundationVersionNumber10_4_4_Intel = 567.23; + +const double NSFoundationVersionNumber10_4_4_PowerPC = 567.21; + +const double NSFoundationVersionNumber10_4_5 = 567.25; + +const double NSFoundationVersionNumber10_4_6 = 567.26; + +const double NSFoundationVersionNumber10_4_7 = 567.27; + +const double NSFoundationVersionNumber10_4_8 = 567.28; + +const double NSFoundationVersionNumber10_4_9 = 567.29; + +const double NSFoundationVersionNumber10_4_10 = 567.29; + +const double NSFoundationVersionNumber10_4_11 = 567.36; + +const double NSFoundationVersionNumber10_5 = 677.0; + +const double NSFoundationVersionNumber10_5_1 = 677.1; + +const double NSFoundationVersionNumber10_5_2 = 677.15; + +const double NSFoundationVersionNumber10_5_3 = 677.19; + +const double NSFoundationVersionNumber10_5_4 = 677.19; + +const double NSFoundationVersionNumber10_5_5 = 677.21; + +const double NSFoundationVersionNumber10_5_6 = 677.22; + +const double NSFoundationVersionNumber10_5_7 = 677.24; + +const double NSFoundationVersionNumber10_5_8 = 677.26; + +const double NSFoundationVersionNumber10_6 = 751.0; + +const double NSFoundationVersionNumber10_6_1 = 751.0; + +const double NSFoundationVersionNumber10_6_2 = 751.14; + +const double NSFoundationVersionNumber10_6_3 = 751.21; + +const double NSFoundationVersionNumber10_6_4 = 751.29; + +const double NSFoundationVersionNumber10_6_5 = 751.42; + +const double NSFoundationVersionNumber10_6_6 = 751.53; + +const double NSFoundationVersionNumber10_6_7 = 751.53; + +const double NSFoundationVersionNumber10_6_8 = 751.62; + +const double NSFoundationVersionNumber10_7 = 833.1; + +const double NSFoundationVersionNumber10_7_1 = 833.1; + +const double NSFoundationVersionNumber10_7_2 = 833.2; + +const double NSFoundationVersionNumber10_7_3 = 833.24; + +const double NSFoundationVersionNumber10_7_4 = 833.25; + +const double NSFoundationVersionNumber10_8 = 945.0; + +const double NSFoundationVersionNumber10_8_1 = 945.0; + +const double NSFoundationVersionNumber10_8_2 = 945.11; + +const double NSFoundationVersionNumber10_8_3 = 945.16; + +const double NSFoundationVersionNumber10_8_4 = 945.18; + +const int NSFoundationVersionNumber10_9 = 1056; + +const int NSFoundationVersionNumber10_9_1 = 1056; + +const double NSFoundationVersionNumber10_9_2 = 1056.13; + +const double NSFoundationVersionNumber10_10 = 1151.16; + +const double NSFoundationVersionNumber10_10_1 = 1151.16; + +const double NSFoundationVersionNumber10_10_2 = 1152.14; + +const double NSFoundationVersionNumber10_10_3 = 1153.2; + +const double NSFoundationVersionNumber10_10_4 = 1153.2; + +const int NSFoundationVersionNumber10_10_5 = 1154; + +const int NSFoundationVersionNumber10_10_Max = 1199; + +const int NSFoundationVersionNumber10_11 = 1252; + +const double NSFoundationVersionNumber10_11_1 = 1255.1; + +const double NSFoundationVersionNumber10_11_2 = 1256.1; + +const double NSFoundationVersionNumber10_11_3 = 1256.1; + +const int NSFoundationVersionNumber10_11_4 = 1258; + +const int NSFoundationVersionNumber10_11_Max = 1299; + +const int __COREFOUNDATION_CFBASE__ = 1; + +const int TRUE = 1; + +const int FALSE = 0; + +const double kCFCoreFoundationVersionNumber10_0 = 196.4; + +const double kCFCoreFoundationVersionNumber10_0_3 = 196.5; + +const double kCFCoreFoundationVersionNumber10_1 = 226.0; + +const double kCFCoreFoundationVersionNumber10_1_1 = 226.0; + +const double kCFCoreFoundationVersionNumber10_1_2 = 227.2; + +const double kCFCoreFoundationVersionNumber10_1_3 = 227.2; + +const double kCFCoreFoundationVersionNumber10_1_4 = 227.3; + +const double kCFCoreFoundationVersionNumber10_2 = 263.0; + +const double kCFCoreFoundationVersionNumber10_2_1 = 263.1; + +const double kCFCoreFoundationVersionNumber10_2_2 = 263.1; + +const double kCFCoreFoundationVersionNumber10_2_3 = 263.3; + +const double kCFCoreFoundationVersionNumber10_2_4 = 263.3; + +const double kCFCoreFoundationVersionNumber10_2_5 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_6 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_7 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_8 = 263.5; + +const double kCFCoreFoundationVersionNumber10_3 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_1 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_2 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_3 = 299.3; + +const double kCFCoreFoundationVersionNumber10_3_4 = 299.31; + +const double kCFCoreFoundationVersionNumber10_3_5 = 299.31; + +const double kCFCoreFoundationVersionNumber10_3_6 = 299.32; + +const double kCFCoreFoundationVersionNumber10_3_7 = 299.33; + +const double kCFCoreFoundationVersionNumber10_3_8 = 299.33; + +const double kCFCoreFoundationVersionNumber10_3_9 = 299.35; + +const double kCFCoreFoundationVersionNumber10_4 = 368.0; + +const double kCFCoreFoundationVersionNumber10_4_1 = 368.1; + +const double kCFCoreFoundationVersionNumber10_4_2 = 368.11; + +const double kCFCoreFoundationVersionNumber10_4_3 = 368.18; + +const double kCFCoreFoundationVersionNumber10_4_4_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_4_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_5_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_5_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_6_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_6_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_7 = 368.27; + +const double kCFCoreFoundationVersionNumber10_4_8 = 368.27; + +const double kCFCoreFoundationVersionNumber10_4_9 = 368.28; + +const double kCFCoreFoundationVersionNumber10_4_10 = 368.28; + +const double kCFCoreFoundationVersionNumber10_4_11 = 368.31; + +const double kCFCoreFoundationVersionNumber10_5 = 476.0; + +const double kCFCoreFoundationVersionNumber10_5_1 = 476.0; + +const double kCFCoreFoundationVersionNumber10_5_2 = 476.1; + +const double kCFCoreFoundationVersionNumber10_5_3 = 476.13; + +const double kCFCoreFoundationVersionNumber10_5_4 = 476.14; + +const double kCFCoreFoundationVersionNumber10_5_5 = 476.15; + +const double kCFCoreFoundationVersionNumber10_5_6 = 476.17; + +const double kCFCoreFoundationVersionNumber10_5_7 = 476.18; + +const double kCFCoreFoundationVersionNumber10_5_8 = 476.19; + +const double kCFCoreFoundationVersionNumber10_6 = 550.0; + +const double kCFCoreFoundationVersionNumber10_6_1 = 550.0; + +const double kCFCoreFoundationVersionNumber10_6_2 = 550.13; + +const double kCFCoreFoundationVersionNumber10_6_3 = 550.19; + +const double kCFCoreFoundationVersionNumber10_6_4 = 550.29; + +const double kCFCoreFoundationVersionNumber10_6_5 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_6 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_7 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_8 = 550.43; + +const double kCFCoreFoundationVersionNumber10_7 = 635.0; + +const double kCFCoreFoundationVersionNumber10_7_1 = 635.0; + +const double kCFCoreFoundationVersionNumber10_7_2 = 635.15; + +const double kCFCoreFoundationVersionNumber10_7_3 = 635.19; + +const double kCFCoreFoundationVersionNumber10_7_4 = 635.21; + +const double kCFCoreFoundationVersionNumber10_7_5 = 635.21; + +const double kCFCoreFoundationVersionNumber10_8 = 744.0; + +const double kCFCoreFoundationVersionNumber10_8_1 = 744.0; + +const double kCFCoreFoundationVersionNumber10_8_2 = 744.12; + +const double kCFCoreFoundationVersionNumber10_8_3 = 744.18; + +const double kCFCoreFoundationVersionNumber10_8_4 = 744.19; + +const double kCFCoreFoundationVersionNumber10_9 = 855.11; + +const double kCFCoreFoundationVersionNumber10_9_1 = 855.11; + +const double kCFCoreFoundationVersionNumber10_9_2 = 855.14; + +const double kCFCoreFoundationVersionNumber10_10 = 1151.16; + +const double kCFCoreFoundationVersionNumber10_10_1 = 1151.16; + +const int kCFCoreFoundationVersionNumber10_10_2 = 1152; + +const double kCFCoreFoundationVersionNumber10_10_3 = 1153.18; + +const double kCFCoreFoundationVersionNumber10_10_4 = 1153.18; + +const double kCFCoreFoundationVersionNumber10_10_5 = 1153.18; + +const int kCFCoreFoundationVersionNumber10_10_Max = 1199; + +const int kCFCoreFoundationVersionNumber10_11 = 1253; + +const double kCFCoreFoundationVersionNumber10_11_1 = 1255.1; + +const double kCFCoreFoundationVersionNumber10_11_2 = 1256.14; + +const double kCFCoreFoundationVersionNumber10_11_3 = 1256.14; + +const double kCFCoreFoundationVersionNumber10_11_4 = 1258.1; + +const int kCFCoreFoundationVersionNumber10_11_Max = 1299; + +const int ISA_PTRAUTH_DISCRIMINATOR = 27361; diff --git a/pkgs/ffigen/test/native_objc_test/property_config.yaml b/pkgs/ffigen/test/native_objc_test/property_config.yaml new file mode 100644 index 0000000000..5caaad215e --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/property_config.yaml @@ -0,0 +1,12 @@ +name: PropertyTestObjCLibrary +description: 'Tests calling Objective-C properties i.e. getters and setters' +language: objc +output: 'test/native_objc_test/property_bindings.dart' +functions: + exclude: + - '.*' +headers: + entry-points: + - 'test/native_objc_test/property_test.m' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/property_test.dart b/pkgs/ffigen/test/native_objc_test/property_test.dart new file mode 100644 index 0000000000..ada0cdf201 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/property_test.dart @@ -0,0 +1,76 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:ffigen/ffigen.dart'; +import 'package:path/path.dart' as path; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart'; +import '../test_utils.dart'; +import 'property_bindings.dart'; + +void main() { + late PropertyInterface testInstance; + late PropertyTestObjCLibrary lib; + + group('properties', () { + setUpAll(() { + logWarnings(); + final dylib = File('test/native_objc_test/property_test.dylib'); + verifySetupFile(dylib); + lib = PropertyTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); + testInstance = PropertyInterface.new1(lib); + }); + + test('generate_bindings', () { + final config = Config.fromYaml(loadYaml( + File(path.join('test', 'native_objc_test', 'property_config.yaml')) + .readAsStringSync()) as YamlMap); + final library = parse(config); + final file = File( + path.join('test', 'debug_generated', 'property_test.dart'), + ); + library.generateFile(file); + + try { + final actual = file.readAsStringSync(); + final expected = File(path.join(config.output)).readAsStringSync(); + expect(actual, expected); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + print('Failed test: Debug generated file: ${file.absolute.path}'); + rethrow; + } + }); + + group('instance properties', () { + test('read-only property', () { + expect(testInstance.readOnlyProperty, 7); + }); + + test('read-write property', () { + testInstance.readWriteProperty = 23; + expect(testInstance.readWriteProperty, 23); + }); + }); + + group('class properties', () { + test('read-only property', () { + expect(PropertyInterface.getClassReadOnlyProperty(lib), 42); + }); + + test('read-write property', () { + PropertyInterface.setClassReadWriteProperty(lib, 101); + expect(PropertyInterface.getClassReadWriteProperty(lib), 101); + }); + }); + }); +} diff --git a/pkgs/ffigen/test/native_objc_test/property_test.m b/pkgs/ffigen/test/native_objc_test/property_test.m new file mode 100644 index 0000000000..74728e55b9 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/property_test.m @@ -0,0 +1,33 @@ +#import + +@interface PropertyInterface : NSObject { +} + +@property (readonly) int32_t readOnlyProperty; +@property int32_t readWriteProperty; +@property (class, readonly) int32_t classReadOnlyProperty; +@property (class) int32_t classReadWriteProperty; + +@end + +@implementation PropertyInterface + +static int32_t _classReadWriteProperty = 0; + +- (int32_t)readOnlyProperty { + return 7; +} + ++ (int32_t)classReadOnlyProperty { + return 42; +} + ++ (int32_t)classReadWriteProperty { + return _classReadWriteProperty; +} + ++ (void)setClassReadWriteProperty:(int32_t)x { + _classReadWriteProperty = x; +} + +@end \ No newline at end of file diff --git a/pkgs/ffigen/test/native_objc_test/setup.dart b/pkgs/ffigen/test/native_objc_test/setup.dart index c9dbf05fed..86368a124e 100644 --- a/pkgs/ffigen/test/native_objc_test/setup.dart +++ b/pkgs/ffigen/test/native_objc_test/setup.dart @@ -33,4 +33,7 @@ Future main(List arguments) async { } print('Building Dynamic Library for Objective C Native Tests...'); await _buildLib('native_objc_test.m', 'native_objc_test.dylib'); + await _buildLib('method_test.m', 'method_test.dylib'); + await _buildLib('property_test.m', 'property_test.dylib'); + await _buildLib('string_test.m', 'string_test.dylib'); } diff --git a/pkgs/ffigen/test/native_objc_test/string_bindings.dart b/pkgs/ffigen/test/native_objc_test/string_bindings.dart new file mode 100644 index 0000000000..fc45deceed --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/string_bindings.dart @@ -0,0 +1,5658 @@ +// ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; + +/// Tests calling Objective-C string methods +class StringTestObjCLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + StringTestObjCLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + StringTestObjCLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + late final ffi.Pointer _NSFoundationVersionNumber = + _lookup('NSFoundationVersionNumber'); + + double get NSFoundationVersionNumber => _NSFoundationVersionNumber.value; + + set NSFoundationVersionNumber(double value) => + _NSFoundationVersionNumber.value = value; + + late final ffi.Pointer _NSNotFound = + _lookup('NSNotFound'); + + int get NSNotFound => _NSNotFound.value; + + set NSNotFound(int value) => _NSNotFound.value = value; + + late final ffi.Pointer _kCFCoreFoundationVersionNumber = + _lookup('kCFCoreFoundationVersionNumber'); + + double get kCFCoreFoundationVersionNumber => + _kCFCoreFoundationVersionNumber.value; + + set kCFCoreFoundationVersionNumber(double value) => + _kCFCoreFoundationVersionNumber.value = value; + + late final ffi.Pointer _kCFNotFound = + _lookup('kCFNotFound'); + + int get kCFNotFound => _kCFNotFound.value; + + set kCFNotFound(int value) => _kCFNotFound.value = value; + + late final ffi.Pointer _kCFNull = _lookup('kCFNull'); + + CFNullRef get kCFNull => _kCFNull.value; + + set kCFNull(CFNullRef value) => _kCFNull.value = value; + + late final ffi.Pointer _kCFAllocatorDefault = + _lookup('kCFAllocatorDefault'); + + CFAllocatorRef get kCFAllocatorDefault => _kCFAllocatorDefault.value; + + set kCFAllocatorDefault(CFAllocatorRef value) => + _kCFAllocatorDefault.value = value; + + late final ffi.Pointer _kCFAllocatorSystemDefault = + _lookup('kCFAllocatorSystemDefault'); + + CFAllocatorRef get kCFAllocatorSystemDefault => + _kCFAllocatorSystemDefault.value; + + set kCFAllocatorSystemDefault(CFAllocatorRef value) => + _kCFAllocatorSystemDefault.value = value; + + late final ffi.Pointer _kCFAllocatorMalloc = + _lookup('kCFAllocatorMalloc'); + + CFAllocatorRef get kCFAllocatorMalloc => _kCFAllocatorMalloc.value; + + set kCFAllocatorMalloc(CFAllocatorRef value) => + _kCFAllocatorMalloc.value = value; + + late final ffi.Pointer _kCFAllocatorMallocZone = + _lookup('kCFAllocatorMallocZone'); + + CFAllocatorRef get kCFAllocatorMallocZone => _kCFAllocatorMallocZone.value; + + set kCFAllocatorMallocZone(CFAllocatorRef value) => + _kCFAllocatorMallocZone.value = value; + + late final ffi.Pointer _kCFAllocatorNull = + _lookup('kCFAllocatorNull'); + + CFAllocatorRef get kCFAllocatorNull => _kCFAllocatorNull.value; + + set kCFAllocatorNull(CFAllocatorRef value) => _kCFAllocatorNull.value = value; + + late final ffi.Pointer _kCFAllocatorUseContext = + _lookup('kCFAllocatorUseContext'); + + CFAllocatorRef get kCFAllocatorUseContext => _kCFAllocatorUseContext.value; + + set kCFAllocatorUseContext(CFAllocatorRef value) => + _kCFAllocatorUseContext.value = value; + + ffi.Pointer _sel_registerName( + ffi.Pointer str, + ) { + return __sel_registerName( + str, + ); + } + + late final __sel_registerNamePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sel_registerName'); + late final __sel_registerName = __sel_registerNamePtr + .asFunction Function(ffi.Pointer)>(); + + ffi.Pointer _objc_getClass( + ffi.Pointer str, + ) { + return __objc_getClass( + str, + ); + } + + late final __objc_getClassPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('objc_getClass'); + late final __objc_getClass = __objc_getClassPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); + + void _objc_msgSend_0( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_0( + obj, + sel, + ); + } + + late final __objc_msgSend_0Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); + + instancetype _objc_msgSend_1( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1( + obj, + sel, + ); + } + + late final __objc_msgSend_1Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer)>(); + + instancetype _objc_msgSend_2( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_2( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_2Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>(); + + ffi.Pointer _objc_msgSend_3( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_3( + obj, + sel, + ); + } + + late final __objc_msgSend_3Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_4( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_4( + obj, + sel, + ); + } + + late final __objc_msgSend_4Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_5( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_5( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_5Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); + + ffi.Pointer _objc_msgSend_6( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_6( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_6Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); + + bool _objc_msgSend_7( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_7( + obj, + sel, + aSelector, + ) != + 0; + } + + late final __objc_msgSend_7Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + bool _objc_msgSend_8( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer protocol, + ) { + return __objc_msgSend_8( + obj, + sel, + protocol, + ) != + 0; + } + + late final __objc_msgSend_8Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + IMP _objc_msgSend_9( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_9( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_9Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + IMP _objc_msgSend_10( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_10( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_10Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_11( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_11( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_11Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_12( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_12( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_12Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_13( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anInvocation, + ) { + return __objc_msgSend_13( + obj, + sel, + anInvocation, + ); + } + + late final __objc_msgSend_13Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_14( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_14( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_14Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_15( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_15( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_15Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + bool _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_16( + obj, + sel, + ) != + 0; + } + + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + bool _objc_msgSend_17( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ) { + return __objc_msgSend_17( + obj, + sel, + aClass, + ) != + 0; + } + + late final __objc_msgSend_17Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + bool _objc_msgSend_18( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sel1, + ) { + return __objc_msgSend_18( + obj, + sel, + sel1, + ) != + 0; + } + + late final __objc_msgSend_18Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + bool _objc_msgSend_19( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sel1, + ) { + return __objc_msgSend_19( + obj, + sel, + sel1, + ) != + 0; + } + + late final __objc_msgSend_19Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_20( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_20( + obj, + sel, + ); + } + + late final __objc_msgSend_20Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_21( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_21( + obj, + sel, + ); + } + + late final __objc_msgSend_21Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_22( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_22( + obj, + sel, + ); + } + + late final __objc_msgSend_22Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_23( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_23( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_23Ptr = _lookup< + ffi.NativeFunction< + unichar Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + instancetype _objc_msgSend_24( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_24( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_24Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_25( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cString, + int enc, + ) { + return __objc_msgSend_25( + obj, + sel, + cString, + enc, + ); + } + + late final __objc_msgSend_25Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + pkg_ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_26( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_26( + obj, + sel, + ); + } + + late final __objc_msgSend_26Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_27( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_27( + obj, + sel, + ); + } + + late final __objc_msgSend_27Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_28( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + int size, + ) { + return __objc_msgSend_28( + obj, + sel, + value, + size, + ); + } + + late final __objc_msgSend_28Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_28 = __objc_msgSend_28Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_29( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_29( + obj, + sel, + ); + } + + late final __objc_msgSend_29Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_29 = __objc_msgSend_29Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + instancetype _objc_msgSend_30( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ffi.Pointer type, + ) { + return __objc_msgSend_30( + obj, + sel, + value, + type, + ); + } + + late final __objc_msgSend_30Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_30 = __objc_msgSend_30Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + instancetype _objc_msgSend_31( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_31( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_31Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_31 = __objc_msgSend_31Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + instancetype _objc_msgSend_32( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_32( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_32Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_32 = __objc_msgSend_32Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_33( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_33( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_33Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Char)>>('objc_msgSend'); + late final __objc_msgSend_33 = __objc_msgSend_33Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_34( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_34( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_34Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedChar)>>('objc_msgSend'); + late final __objc_msgSend_34 = __objc_msgSend_34Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_35( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_35( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_35Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Short)>>('objc_msgSend'); + late final __objc_msgSend_35 = __objc_msgSend_35Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_36( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_36( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_36Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedShort)>>('objc_msgSend'); + late final __objc_msgSend_36 = __objc_msgSend_36Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_37( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_37( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_37Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Int)>>('objc_msgSend'); + late final __objc_msgSend_37 = __objc_msgSend_37Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_38( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_38( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_38Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_38 = __objc_msgSend_38Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_39( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_39( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_39Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Long)>>('objc_msgSend'); + late final __objc_msgSend_39 = __objc_msgSend_39Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_40( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_40( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_40Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_40 = __objc_msgSend_40Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_41( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_41( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_41Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.LongLong)>>('objc_msgSend'); + late final __objc_msgSend_41 = __objc_msgSend_41Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_42( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_42( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_42Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedLongLong)>>('objc_msgSend'); + late final __objc_msgSend_42 = __objc_msgSend_42Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_43( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_43( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_43Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Float)>>('objc_msgSend'); + late final __objc_msgSend_43 = __objc_msgSend_43Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); + + ffi.Pointer _objc_msgSend_44( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_44( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_44Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_44 = __objc_msgSend_44Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); + + ffi.Pointer _objc_msgSend_45( + ffi.Pointer obj, + ffi.Pointer sel, + bool value, + ) { + return __objc_msgSend_45( + obj, + sel, + value ? 1 : 0, + ); + } + + late final __objc_msgSend_45Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); + late final __objc_msgSend_45 = __objc_msgSend_45Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_46( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_46( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_46Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_46 = __objc_msgSend_46Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_47( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_47( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_47Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_47 = __objc_msgSend_47Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + int _objc_msgSend_48( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_48( + obj, + sel, + ); + } + + late final __objc_msgSend_48Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.Char Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_48 = __objc_msgSend_48Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_49( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_49( + obj, + sel, + ); + } + + late final __objc_msgSend_49Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedChar Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_49 = __objc_msgSend_49Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_50( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_50( + obj, + sel, + ); + } + + late final __objc_msgSend_50Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.Short Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_50 = __objc_msgSend_50Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_51( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_51( + obj, + sel, + ); + } + + late final __objc_msgSend_51Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedShort Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_51 = __objc_msgSend_51Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_52( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_52( + obj, + sel, + ); + } + + late final __objc_msgSend_52Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_52 = __objc_msgSend_52Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_53( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_53( + obj, + sel, + ); + } + + late final __objc_msgSend_53Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedInt Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_53 = __objc_msgSend_53Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_54( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_54( + obj, + sel, + ); + } + + late final __objc_msgSend_54Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.Long Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_55( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_55( + obj, + sel, + ); + } + + late final __objc_msgSend_55Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedLong Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_55 = __objc_msgSend_55Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_56( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_56( + obj, + sel, + ); + } + + late final __objc_msgSend_56Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.LongLong Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_56 = __objc_msgSend_56Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_57( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_57( + obj, + sel, + ); + } + + late final __objc_msgSend_57Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedLongLong Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_57 = __objc_msgSend_57Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + double _objc_msgSend_58( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_58( + obj, + sel, + ); + } + + late final __objc_msgSend_58Ptr = _lookup< + ffi.NativeFunction< + ffi.Float Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_58 = __objc_msgSend_58Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer)>(); + + double _objc_msgSend_59( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_59( + obj, + sel, + ); + } + + late final __objc_msgSend_59Ptr = _lookup< + ffi.NativeFunction< + ffi.Double Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_60( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_60( + obj, + sel, + ); + } + + late final __objc_msgSend_60Ptr = _lookup< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_61( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_61( + obj, + sel, + ); + } + + late final __objc_msgSend_61Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_61 = __objc_msgSend_61Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_62( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherNumber, + ) { + return __objc_msgSend_62( + obj, + sel, + otherNumber, + ); + } + + late final __objc_msgSend_62Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + bool _objc_msgSend_63( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer number, + ) { + return __objc_msgSend_63( + obj, + sel, + number, + ) != + 0; + } + + late final __objc_msgSend_63Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_63 = __objc_msgSend_63Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_64( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer locale, + ) { + return __objc_msgSend_64( + obj, + sel, + locale, + ); + } + + late final __objc_msgSend_64Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_64 = __objc_msgSend_64Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_65( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_65( + obj, + sel, + ); + } + + late final __objc_msgSend_65Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_65 = __objc_msgSend_65Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_66( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_66( + obj, + sel, + ); + } + + late final __objc_msgSend_66Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_66 = __objc_msgSend_66Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_67( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_67( + obj, + sel, + ); + } + + late final __objc_msgSend_67Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_67 = __objc_msgSend_67Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_68( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_68( + obj, + sel, + ); + } + + late final __objc_msgSend_68Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_68 = __objc_msgSend_68Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + instancetype _objc_msgSend_69( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + int type, + int index, + ) { + return __objc_msgSend_69( + obj, + sel, + anObject, + type, + index, + ); + } + + late final __objc_msgSend_69Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_69 = __objc_msgSend_69Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int)>(); + + instancetype _objc_msgSend_70( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + int type, + int index, + int associatedIndex, + ) { + return __objc_msgSend_70( + obj, + sel, + anObject, + type, + index, + associatedIndex, + ); + } + + late final __objc_msgSend_70Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSUInteger, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_70 = __objc_msgSend_70Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, int)>(); + + instancetype _objc_msgSend_71( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_71( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_71Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_71 = __objc_msgSend_71Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int)>(); + + instancetype _objc_msgSend_72( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_72( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_72Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_72 = __objc_msgSend_72Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + instancetype _objc_msgSend_73( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexSet, + ) { + return __objc_msgSend_73( + obj, + sel, + indexSet, + ); + } + + late final __objc_msgSend_73Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_73 = __objc_msgSend_73Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + bool _objc_msgSend_74( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexSet, + ) { + return __objc_msgSend_74( + obj, + sel, + indexSet, + ) != + 0; + } + + late final __objc_msgSend_74Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_74 = __objc_msgSend_74Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_75( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_75( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_75Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_75 = __objc_msgSend_75Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + int _objc_msgSend_76( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexBuffer, + int bufferSize, + NSRangePointer range, + ) { + return __objc_msgSend_76( + obj, + sel, + indexBuffer, + bufferSize, + range, + ); + } + + late final __objc_msgSend_76Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSRangePointer)>>('objc_msgSend'); + late final __objc_msgSend_76 = __objc_msgSend_76Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRangePointer)>(); + + int _objc_msgSend_77( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_77( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_77Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_77 = __objc_msgSend_77Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + + bool _objc_msgSend_78( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_78( + obj, + sel, + value, + ) != + 0; + } + + late final __objc_msgSend_78Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_78 = __objc_msgSend_78Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + bool _objc_msgSend_79( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_79( + obj, + sel, + range, + ) != + 0; + } + + late final __objc_msgSend_79Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_79 = __objc_msgSend_79Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + + bool _objc_msgSend_80( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexSet, + ) { + return __objc_msgSend_80( + obj, + sel, + indexSet, + ) != + 0; + } + + late final __objc_msgSend_80Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_81( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer block, + ) { + return __objc_msgSend_81( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_81Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_81 = __objc_msgSend_81Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_82( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer block, + ) { + return __objc_msgSend_82( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_82Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_82 = __objc_msgSend_82Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + void _objc_msgSend_83( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer block, + ) { + return __objc_msgSend_83( + obj, + sel, + range, + opts, + block, + ); + } + + late final __objc_msgSend_83Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_83 = __objc_msgSend_83Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer)>(); + + int _objc_msgSend_84( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicate, + ) { + return __objc_msgSend_84( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_84Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_84 = __objc_msgSend_84Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_85( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer predicate, + ) { + return __objc_msgSend_85( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_85Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_85 = __objc_msgSend_85Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + int _objc_msgSend_86( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer predicate, + ) { + return __objc_msgSend_86( + obj, + sel, + range, + opts, + predicate, + ); + } + + late final __objc_msgSend_86Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_86 = __objc_msgSend_86Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_87( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicate, + ) { + return __objc_msgSend_87( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_87Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_87 = __objc_msgSend_87Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_88( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer predicate, + ) { + return __objc_msgSend_88( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_88Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_88 = __objc_msgSend_88Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_89( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer predicate, + ) { + return __objc_msgSend_89( + obj, + sel, + range, + opts, + predicate, + ); + } + + late final __objc_msgSend_89Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_89 = __objc_msgSend_89Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, int, ffi.Pointer)>(); + + void _objc_msgSend_90( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer block, + ) { + return __objc_msgSend_90( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_90Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_90 = __objc_msgSend_90Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_91( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer block, + ) { + return __objc_msgSend_91( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_91Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_91 = __objc_msgSend_91Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + void _objc_msgSend_92( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer block, + ) { + return __objc_msgSend_92( + obj, + sel, + range, + opts, + block, + ); + } + + late final __objc_msgSend_92Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_92 = __objc_msgSend_92Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer)>(); + + void _objc_msgSend_93( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexSet, + ) { + return __objc_msgSend_93( + obj, + sel, + indexSet, + ); + } + + late final __objc_msgSend_93Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_93 = __objc_msgSend_93Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_94( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexSet, + ) { + return __objc_msgSend_94( + obj, + sel, + indexSet, + ); + } + + late final __objc_msgSend_94Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_94 = __objc_msgSend_94Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_95( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_95( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_95Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_95 = __objc_msgSend_95Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + void _objc_msgSend_96( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_96( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_96Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_96 = __objc_msgSend_96Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + + void _objc_msgSend_97( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + int delta, + ) { + return __objc_msgSend_97( + obj, + sel, + index, + delta, + ); + } + + late final __objc_msgSend_97Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger, NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_97 = __objc_msgSend_97Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, int)>(); + + instancetype _objc_msgSend_98( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer changes, + ) { + return __objc_msgSend_98( + obj, + sel, + changes, + ); + } + + late final __objc_msgSend_98Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_98 = __objc_msgSend_98Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + instancetype _objc_msgSend_99( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer inserts, + ffi.Pointer insertedObjects, + ffi.Pointer removes, + ffi.Pointer removedObjects, + ffi.Pointer changes, + ) { + return __objc_msgSend_99( + obj, + sel, + inserts, + insertedObjects, + removes, + removedObjects, + changes, + ); + } + + late final __objc_msgSend_99Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_99 = __objc_msgSend_99Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + instancetype _objc_msgSend_100( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer inserts, + ffi.Pointer insertedObjects, + ffi.Pointer removes, + ffi.Pointer removedObjects, + ) { + return __objc_msgSend_100( + obj, + sel, + inserts, + insertedObjects, + removes, + removedObjects, + ); + } + + late final __objc_msgSend_100Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_100 = __objc_msgSend_100Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_101( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_101( + obj, + sel, + ); + } + + late final __objc_msgSend_101Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_101 = __objc_msgSend_101Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_102( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_102( + obj, + sel, + ); + } + + late final __objc_msgSend_102Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_102 = __objc_msgSend_102Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_103( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_103( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_103Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_103 = __objc_msgSend_103Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + instancetype _objc_msgSend_104( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + int cnt, + ) { + return __objc_msgSend_104( + obj, + sel, + objects, + cnt, + ); + } + + late final __objc_msgSend_104Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_104 = __objc_msgSend_104Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, int)>(); + + instancetype _objc_msgSend_105( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_105( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_105Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_105 = __objc_msgSend_105Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_106( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ) { + return __objc_msgSend_106( + obj, + sel, + anObject, + ); + } + + late final __objc_msgSend_106Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_106 = __objc_msgSend_106Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_107( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + int index, + ) { + return __objc_msgSend_107( + obj, + sel, + anObject, + index, + ); + } + + late final __objc_msgSend_107Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_107 = __objc_msgSend_107Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + void _objc_msgSend_108( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer anObject, + ) { + return __objc_msgSend_108( + obj, + sel, + index, + anObject, + ); + } + + late final __objc_msgSend_108Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_108 = __objc_msgSend_108Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + instancetype _objc_msgSend_109( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_109( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_109Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_109 = __objc_msgSend_109Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_110( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + int visibility, + ffi.Pointer loadHandler, + ) { + return __objc_msgSend_110( + obj, + sel, + typeIdentifier, + visibility, + loadHandler, + ); + } + + late final __objc_msgSend_110Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_110 = __objc_msgSend_110Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + void _objc_msgSend_111( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + int fileOptions, + int visibility, + ffi.Pointer loadHandler, + ) { + return __objc_msgSend_111( + obj, + sel, + typeIdentifier, + fileOptions, + visibility, + loadHandler, + ); + } + + late final __objc_msgSend_111Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_111 = __objc_msgSend_111Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_112( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_112( + obj, + sel, + ); + } + + late final __objc_msgSend_112Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_112 = __objc_msgSend_112Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + bool _objc_msgSend_113( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ) { + return __objc_msgSend_113( + obj, + sel, + typeIdentifier, + ) != + 0; + } + + late final __objc_msgSend_113Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_113 = __objc_msgSend_113Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + bool _objc_msgSend_114( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + int fileOptions, + ) { + return __objc_msgSend_114( + obj, + sel, + typeIdentifier, + fileOptions, + ) != + 0; + } + + late final __objc_msgSend_114Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_114 = __objc_msgSend_114Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_115( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer completionHandler, + ) { + return __objc_msgSend_115( + obj, + sel, + typeIdentifier, + completionHandler, + ); + } + + late final __objc_msgSend_115Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_115 = __objc_msgSend_115Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_116( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer completionHandler, + ) { + return __objc_msgSend_116( + obj, + sel, + typeIdentifier, + completionHandler, + ); + } + + late final __objc_msgSend_116Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_116 = __objc_msgSend_116Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_117( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer completionHandler, + ) { + return __objc_msgSend_117( + obj, + sel, + typeIdentifier, + completionHandler, + ); + } + + late final __objc_msgSend_117Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_117 = __objc_msgSend_117Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_118( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_118( + obj, + sel, + ); + } + + late final __objc_msgSend_118Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_118 = __objc_msgSend_118Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_119( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_119( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_119Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_119 = __objc_msgSend_119Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + instancetype _objc_msgSend_120( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer object, + ) { + return __objc_msgSend_120( + obj, + sel, + object, + ); + } + + late final __objc_msgSend_120Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_120 = __objc_msgSend_120Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_121( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer object, + int visibility, + ) { + return __objc_msgSend_121( + obj, + sel, + object, + visibility, + ); + } + + late final __objc_msgSend_121Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_121 = __objc_msgSend_121Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + void _objc_msgSend_122( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + int visibility, + ffi.Pointer loadHandler, + ) { + return __objc_msgSend_122( + obj, + sel, + aClass, + visibility, + loadHandler, + ); + } + + late final __objc_msgSend_122Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_122 = __objc_msgSend_122Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + bool _objc_msgSend_123( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ) { + return __objc_msgSend_123( + obj, + sel, + aClass, + ) != + 0; + } + + late final __objc_msgSend_123Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_123 = __objc_msgSend_123Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_124( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ffi.Pointer completionHandler, + ) { + return __objc_msgSend_124( + obj, + sel, + aClass, + completionHandler, + ); + } + + late final __objc_msgSend_124Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_124 = __objc_msgSend_124Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + instancetype _objc_msgSend_125( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer item, + ffi.Pointer typeIdentifier, + ) { + return __objc_msgSend_125( + obj, + sel, + item, + typeIdentifier, + ); + } + + late final __objc_msgSend_125Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_125 = __objc_msgSend_125Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + instancetype _objc_msgSend_126( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer fileURL, + ) { + return __objc_msgSend_126( + obj, + sel, + fileURL, + ); + } + + late final __objc_msgSend_126Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_126 = __objc_msgSend_126Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_127( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + NSItemProviderLoadHandler loadHandler, + ) { + return __objc_msgSend_127( + obj, + sel, + typeIdentifier, + loadHandler, + ); + } + + late final __objc_msgSend_127Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderLoadHandler)>>('objc_msgSend'); + late final __objc_msgSend_127 = __objc_msgSend_127Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSItemProviderLoadHandler)>(); + + void _objc_msgSend_128( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer options, + NSItemProviderCompletionHandler completionHandler, + ) { + return __objc_msgSend_128( + obj, + sel, + typeIdentifier, + options, + completionHandler, + ); + } + + late final __objc_msgSend_128Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler)>>('objc_msgSend'); + late final __objc_msgSend_128 = __objc_msgSend_128Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler)>(); + + late final ffi.Pointer> + _NSItemProviderPreferredImageSizeKey = + _lookup>('NSItemProviderPreferredImageSizeKey'); + + ffi.Pointer get NSItemProviderPreferredImageSizeKey => + _NSItemProviderPreferredImageSizeKey.value; + + set NSItemProviderPreferredImageSizeKey(ffi.Pointer value) => + _NSItemProviderPreferredImageSizeKey.value = value; + + late final ffi.Pointer> + _NSExtensionJavaScriptPreprocessingResultsKey = + _lookup>( + 'NSExtensionJavaScriptPreprocessingResultsKey'); + + ffi.Pointer get NSExtensionJavaScriptPreprocessingResultsKey => + _NSExtensionJavaScriptPreprocessingResultsKey.value; + + set NSExtensionJavaScriptPreprocessingResultsKey( + ffi.Pointer value) => + _NSExtensionJavaScriptPreprocessingResultsKey.value = value; + + late final ffi.Pointer> + _NSExtensionJavaScriptFinalizeArgumentKey = + _lookup>( + 'NSExtensionJavaScriptFinalizeArgumentKey'); + + ffi.Pointer get NSExtensionJavaScriptFinalizeArgumentKey => + _NSExtensionJavaScriptFinalizeArgumentKey.value; + + set NSExtensionJavaScriptFinalizeArgumentKey(ffi.Pointer value) => + _NSExtensionJavaScriptFinalizeArgumentKey.value = value; + + late final ffi.Pointer> _NSItemProviderErrorDomain = + _lookup>('NSItemProviderErrorDomain'); + + ffi.Pointer get NSItemProviderErrorDomain => + _NSItemProviderErrorDomain.value; + + set NSItemProviderErrorDomain(ffi.Pointer value) => + _NSItemProviderErrorDomain.value = value; + + late final ffi.Pointer _NSStringTransformLatinToKatakana = + _lookup('NSStringTransformLatinToKatakana'); + + NSStringTransform get NSStringTransformLatinToKatakana => + _NSStringTransformLatinToKatakana.value; + + set NSStringTransformLatinToKatakana(NSStringTransform value) => + _NSStringTransformLatinToKatakana.value = value; + + late final ffi.Pointer _NSStringTransformLatinToHiragana = + _lookup('NSStringTransformLatinToHiragana'); + + NSStringTransform get NSStringTransformLatinToHiragana => + _NSStringTransformLatinToHiragana.value; + + set NSStringTransformLatinToHiragana(NSStringTransform value) => + _NSStringTransformLatinToHiragana.value = value; + + late final ffi.Pointer _NSStringTransformLatinToHangul = + _lookup('NSStringTransformLatinToHangul'); + + NSStringTransform get NSStringTransformLatinToHangul => + _NSStringTransformLatinToHangul.value; + + set NSStringTransformLatinToHangul(NSStringTransform value) => + _NSStringTransformLatinToHangul.value = value; + + late final ffi.Pointer _NSStringTransformLatinToArabic = + _lookup('NSStringTransformLatinToArabic'); + + NSStringTransform get NSStringTransformLatinToArabic => + _NSStringTransformLatinToArabic.value; + + set NSStringTransformLatinToArabic(NSStringTransform value) => + _NSStringTransformLatinToArabic.value = value; + + late final ffi.Pointer _NSStringTransformLatinToHebrew = + _lookup('NSStringTransformLatinToHebrew'); + + NSStringTransform get NSStringTransformLatinToHebrew => + _NSStringTransformLatinToHebrew.value; + + set NSStringTransformLatinToHebrew(NSStringTransform value) => + _NSStringTransformLatinToHebrew.value = value; + + late final ffi.Pointer _NSStringTransformLatinToThai = + _lookup('NSStringTransformLatinToThai'); + + NSStringTransform get NSStringTransformLatinToThai => + _NSStringTransformLatinToThai.value; + + set NSStringTransformLatinToThai(NSStringTransform value) => + _NSStringTransformLatinToThai.value = value; + + late final ffi.Pointer _NSStringTransformLatinToCyrillic = + _lookup('NSStringTransformLatinToCyrillic'); + + NSStringTransform get NSStringTransformLatinToCyrillic => + _NSStringTransformLatinToCyrillic.value; + + set NSStringTransformLatinToCyrillic(NSStringTransform value) => + _NSStringTransformLatinToCyrillic.value = value; + + late final ffi.Pointer _NSStringTransformLatinToGreek = + _lookup('NSStringTransformLatinToGreek'); + + NSStringTransform get NSStringTransformLatinToGreek => + _NSStringTransformLatinToGreek.value; + + set NSStringTransformLatinToGreek(NSStringTransform value) => + _NSStringTransformLatinToGreek.value = value; + + late final ffi.Pointer _NSStringTransformToLatin = + _lookup('NSStringTransformToLatin'); + + NSStringTransform get NSStringTransformToLatin => + _NSStringTransformToLatin.value; + + set NSStringTransformToLatin(NSStringTransform value) => + _NSStringTransformToLatin.value = value; + + late final ffi.Pointer _NSStringTransformMandarinToLatin = + _lookup('NSStringTransformMandarinToLatin'); + + NSStringTransform get NSStringTransformMandarinToLatin => + _NSStringTransformMandarinToLatin.value; + + set NSStringTransformMandarinToLatin(NSStringTransform value) => + _NSStringTransformMandarinToLatin.value = value; + + late final ffi.Pointer + _NSStringTransformHiraganaToKatakana = + _lookup('NSStringTransformHiraganaToKatakana'); + + NSStringTransform get NSStringTransformHiraganaToKatakana => + _NSStringTransformHiraganaToKatakana.value; + + set NSStringTransformHiraganaToKatakana(NSStringTransform value) => + _NSStringTransformHiraganaToKatakana.value = value; + + late final ffi.Pointer + _NSStringTransformFullwidthToHalfwidth = + _lookup('NSStringTransformFullwidthToHalfwidth'); + + NSStringTransform get NSStringTransformFullwidthToHalfwidth => + _NSStringTransformFullwidthToHalfwidth.value; + + set NSStringTransformFullwidthToHalfwidth(NSStringTransform value) => + _NSStringTransformFullwidthToHalfwidth.value = value; + + late final ffi.Pointer _NSStringTransformToXMLHex = + _lookup('NSStringTransformToXMLHex'); + + NSStringTransform get NSStringTransformToXMLHex => + _NSStringTransformToXMLHex.value; + + set NSStringTransformToXMLHex(NSStringTransform value) => + _NSStringTransformToXMLHex.value = value; + + late final ffi.Pointer _NSStringTransformToUnicodeName = + _lookup('NSStringTransformToUnicodeName'); + + NSStringTransform get NSStringTransformToUnicodeName => + _NSStringTransformToUnicodeName.value; + + set NSStringTransformToUnicodeName(NSStringTransform value) => + _NSStringTransformToUnicodeName.value = value; + + late final ffi.Pointer + _NSStringTransformStripCombiningMarks = + _lookup('NSStringTransformStripCombiningMarks'); + + NSStringTransform get NSStringTransformStripCombiningMarks => + _NSStringTransformStripCombiningMarks.value; + + set NSStringTransformStripCombiningMarks(NSStringTransform value) => + _NSStringTransformStripCombiningMarks.value = value; + + late final ffi.Pointer _NSStringTransformStripDiacritics = + _lookup('NSStringTransformStripDiacritics'); + + NSStringTransform get NSStringTransformStripDiacritics => + _NSStringTransformStripDiacritics.value; + + set NSStringTransformStripDiacritics(NSStringTransform value) => + _NSStringTransformStripDiacritics.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionSuggestedEncodingsKey = + _lookup( + 'NSStringEncodingDetectionSuggestedEncodingsKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionSuggestedEncodingsKey => + _NSStringEncodingDetectionSuggestedEncodingsKey.value; + + set NSStringEncodingDetectionSuggestedEncodingsKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionSuggestedEncodingsKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionDisallowedEncodingsKey = + _lookup( + 'NSStringEncodingDetectionDisallowedEncodingsKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionDisallowedEncodingsKey => + _NSStringEncodingDetectionDisallowedEncodingsKey.value; + + set NSStringEncodingDetectionDisallowedEncodingsKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionDisallowedEncodingsKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey = + _lookup( + 'NSStringEncodingDetectionUseOnlySuggestedEncodingsKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionUseOnlySuggestedEncodingsKey => + _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value; + + set NSStringEncodingDetectionUseOnlySuggestedEncodingsKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionAllowLossyKey = + _lookup( + 'NSStringEncodingDetectionAllowLossyKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionAllowLossyKey => + _NSStringEncodingDetectionAllowLossyKey.value; + + set NSStringEncodingDetectionAllowLossyKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionAllowLossyKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionFromWindowsKey = + _lookup( + 'NSStringEncodingDetectionFromWindowsKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionFromWindowsKey => + _NSStringEncodingDetectionFromWindowsKey.value; + + set NSStringEncodingDetectionFromWindowsKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionFromWindowsKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionLossySubstitutionKey = + _lookup( + 'NSStringEncodingDetectionLossySubstitutionKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionLossySubstitutionKey => + _NSStringEncodingDetectionLossySubstitutionKey.value; + + set NSStringEncodingDetectionLossySubstitutionKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionLossySubstitutionKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionLikelyLanguageKey = + _lookup( + 'NSStringEncodingDetectionLikelyLanguageKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionLikelyLanguageKey => + _NSStringEncodingDetectionLikelyLanguageKey.value; + + set NSStringEncodingDetectionLikelyLanguageKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionLikelyLanguageKey.value = value; + + void _objc_msgSend_129( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer aString, + ) { + return __objc_msgSend_129( + obj, + sel, + range, + aString, + ); + } + + late final __objc_msgSend_129Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_129 = __objc_msgSend_129Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, + ffi.Pointer)>(); + + late final ffi.Pointer _NSCharacterConversionException = + _lookup('NSCharacterConversionException'); + + NSExceptionName get NSCharacterConversionException => + _NSCharacterConversionException.value; + + set NSCharacterConversionException(NSExceptionName value) => + _NSCharacterConversionException.value = value; + + late final ffi.Pointer _NSParseErrorException = + _lookup('NSParseErrorException'); + + NSExceptionName get NSParseErrorException => _NSParseErrorException.value; + + set NSParseErrorException(NSExceptionName value) => + _NSParseErrorException.value = value; + + ffi.Pointer _objc_msgSend_130( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer a, + ffi.Pointer b, + ) { + return __objc_msgSend_130( + obj, + sel, + a, + b, + ); + } + + late final __objc_msgSend_130Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_130 = __objc_msgSend_130Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +} + +abstract class NSComparisonResult { + static const int NSOrderedAscending = -1; + static const int NSOrderedSame = 0; + static const int NSOrderedDescending = 1; +} + +abstract class NSEnumerationOptions { + static const int NSEnumerationConcurrent = 1; + static const int NSEnumerationReverse = 2; +} + +abstract class NSSortOptions { + static const int NSSortConcurrent = 1; + static const int NSSortStable = 16; +} + +abstract class NSQualityOfService { + static const int NSQualityOfServiceUserInteractive = 33; + static const int NSQualityOfServiceUserInitiated = 25; + static const int NSQualityOfServiceUtility = 17; + static const int NSQualityOfServiceBackground = 9; + static const int NSQualityOfServiceDefault = -1; +} + +typedef NSInteger = pkg_ffi.Long; + +class __CFString extends ffi.Opaque {} + +abstract class CFComparisonResult { + static const int kCFCompareLessThan = -1; + static const int kCFCompareEqualTo = 0; + static const int kCFCompareGreaterThan = 1; +} + +typedef CFIndex = pkg_ffi.Long; + +class CFRange extends ffi.Struct { + @CFIndex() + external int location; + + @CFIndex() + external int length; +} + +class __CFNull extends ffi.Opaque {} + +typedef CFNullRef = ffi.Pointer<__CFNull>; + +class __CFAllocator extends ffi.Opaque {} + +typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; + +class CFAllocatorContext extends ffi.Struct { + @CFIndex() + external int version; + + external ffi.Pointer info; + + external CFAllocatorRetainCallBack retain; + + external CFAllocatorReleaseCallBack release; + + external CFAllocatorCopyDescriptionCallBack copyDescription; + + external CFAllocatorAllocateCallBack allocate; + + external CFAllocatorReallocateCallBack reallocate; + + external CFAllocatorDeallocateCallBack deallocate; + + external CFAllocatorPreferredSizeCallBack preferredSize; +} + +typedef CFAllocatorRetainCallBack = ffi.Pointer< + ffi.NativeFunction Function(ffi.Pointer)>>; +typedef CFAllocatorReleaseCallBack + = ffi.Pointer)>>; +typedef CFAllocatorCopyDescriptionCallBack = ffi + .Pointer)>>; +typedef CFStringRef = ffi.Pointer<__CFString>; +typedef CFAllocatorAllocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + CFIndex, CFOptionFlags, ffi.Pointer)>>; +typedef CFOptionFlags = pkg_ffi.UnsignedLong; +typedef CFAllocatorReallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, CFIndex, + CFOptionFlags, ffi.Pointer)>>; +typedef CFAllocatorDeallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; +typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< + ffi.NativeFunction< + CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; + +ffi.Pointer _registerName(StringTestObjCLibrary _lib, String name) { + final cstr = name.toNativeUtf8(); + final sel = _lib._sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; +} + +ffi.Pointer _getClass(StringTestObjCLibrary _lib, String name) { + final cstr = name.toNativeUtf8(); + final clazz = _lib._objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; +} + +class _ObjCWrapper { + final ffi.Pointer _id; + final StringTestObjCLibrary _lib; + _ObjCWrapper._(this._id, this._lib); +} + +class NSValue extends NSObject { + NSValue._(ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSValue castFrom(T other) { + return NSValue._(other._id, other._lib); + } + + static ffi.Pointer? _sel_getValue_size; + void getValue_size(ffi.Pointer value, int size) { + _sel_getValue_size ??= _registerName(_lib, "getValue:size:"); + _lib._objc_msgSend_28(_id, _sel_getValue_size!, value, size); + } + + static ffi.Pointer? _sel_objCType; + ffi.Pointer get objCType { + _sel_objCType ??= _registerName(_lib, "objCType"); + return _lib._objc_msgSend_29(_id, _sel_objCType!); + } + + static ffi.Pointer? _sel_initWithBytes_objCType; + NSValue initWithBytes_objCType( + ffi.Pointer value, ffi.Pointer type) { + _sel_initWithBytes_objCType ??= + _registerName(_lib, "initWithBytes:objCType:"); + final _ret = + _lib._objc_msgSend_30(_id, _sel_initWithBytes_objCType!, value, type); + return NSValue._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithCoder; + NSValue initWithCoder(NSObject coder) { + _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); + final _ret = _lib._objc_msgSend_31(_id, _sel_initWithCoder!, coder._id); + return NSValue._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSValue new1(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSValue"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSValue._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSValue alloc(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSValue"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSValue._(_ret, _lib); + } +} + +class NSObject extends _ObjCWrapper { + NSObject._(ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSObject castFrom(T other) { + return NSObject._(other._id, other._lib); + } + + static ffi.Pointer? _sel_load; + static void load(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_load ??= _registerName(_lib, "load"); + _lib._objc_msgSend_0(_class!, _sel_load!); + } + + static ffi.Pointer? _sel_initialize; + static void initialize(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_initialize ??= _registerName(_lib, "initialize"); + _lib._objc_msgSend_0(_class!, _sel_initialize!); + } + + static ffi.Pointer? _sel_init; + NSObject init() { + _sel_init ??= _registerName(_lib, "init"); + final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSObject new1(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_allocWithZone; + static NSObject allocWithZone( + StringTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_allocWithZone ??= _registerName(_lib, "allocWithZone:"); + final _ret = _lib._objc_msgSend_2(_class!, _sel_allocWithZone!, zone); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSObject alloc(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_dealloc; + void dealloc() { + _sel_dealloc ??= _registerName(_lib, "dealloc"); + _lib._objc_msgSend_0(_id, _sel_dealloc!); + } + + static ffi.Pointer? _sel_finalize; + void finalize() { + _sel_finalize ??= _registerName(_lib, "finalize"); + _lib._objc_msgSend_0(_id, _sel_finalize!); + } + + static ffi.Pointer? _sel_copy; + NSObject copy() { + _sel_copy ??= _registerName(_lib, "copy"); + final _ret = _lib._objc_msgSend_3(_id, _sel_copy!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_mutableCopy; + NSObject mutableCopy() { + _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); + final _ret = _lib._objc_msgSend_4(_id, _sel_mutableCopy!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_copyWithZone; + static NSObject copyWithZone( + StringTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); + final _ret = _lib._objc_msgSend_5(_class!, _sel_copyWithZone!, zone); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_mutableCopyWithZone; + static NSObject mutableCopyWithZone( + StringTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); + final _ret = _lib._objc_msgSend_6(_class!, _sel_mutableCopyWithZone!, zone); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_instancesRespondToSelector; + static bool instancesRespondToSelector( + StringTestObjCLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instancesRespondToSelector ??= + _registerName(_lib, "instancesRespondToSelector:"); + return _lib._objc_msgSend_7( + _class!, _sel_instancesRespondToSelector!, aSelector); + } + + static ffi.Pointer? _sel_conformsToProtocol; + static bool conformsToProtocol( + StringTestObjCLibrary _lib, NSObject protocol) { + _class ??= _getClass(_lib, "NSObject"); + _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); + return _lib._objc_msgSend_8( + _class!, _sel_conformsToProtocol!, protocol._id); + } + + static ffi.Pointer? _sel_methodForSelector; + IMP methodForSelector(ffi.Pointer aSelector) { + _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); + return _lib._objc_msgSend_9(_id, _sel_methodForSelector!, aSelector); + } + + static ffi.Pointer? _sel_instanceMethodForSelector; + static IMP instanceMethodForSelector( + StringTestObjCLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instanceMethodForSelector ??= + _registerName(_lib, "instanceMethodForSelector:"); + return _lib._objc_msgSend_10( + _class!, _sel_instanceMethodForSelector!, aSelector); + } + + static ffi.Pointer? _sel_doesNotRecognizeSelector; + void doesNotRecognizeSelector(ffi.Pointer aSelector) { + _sel_doesNotRecognizeSelector ??= + _registerName(_lib, "doesNotRecognizeSelector:"); + _lib._objc_msgSend_11(_id, _sel_doesNotRecognizeSelector!, aSelector); + } + + static ffi.Pointer? _sel_forwardingTargetForSelector; + NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + _sel_forwardingTargetForSelector ??= + _registerName(_lib, "forwardingTargetForSelector:"); + final _ret = _lib._objc_msgSend_12( + _id, _sel_forwardingTargetForSelector!, aSelector); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_forwardInvocation; + void forwardInvocation(NSObject anInvocation) { + _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); + _lib._objc_msgSend_13(_id, _sel_forwardInvocation!, anInvocation._id); + } + + static ffi.Pointer? _sel_methodSignatureForSelector; + NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + _sel_methodSignatureForSelector ??= + _registerName(_lib, "methodSignatureForSelector:"); + final _ret = + _lib._objc_msgSend_14(_id, _sel_methodSignatureForSelector!, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static ffi.Pointer? _sel_instanceMethodSignatureForSelector; + static NSMethodSignature instanceMethodSignatureForSelector( + StringTestObjCLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instanceMethodSignatureForSelector ??= + _registerName(_lib, "instanceMethodSignatureForSelector:"); + final _ret = _lib._objc_msgSend_15( + _class!, _sel_instanceMethodSignatureForSelector!, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static ffi.Pointer? _sel_allowsWeakReference; + bool allowsWeakReference() { + _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); + return _lib._objc_msgSend_16(_id, _sel_allowsWeakReference!); + } + + static ffi.Pointer? _sel_retainWeakReference; + bool retainWeakReference() { + _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); + return _lib._objc_msgSend_16(_id, _sel_retainWeakReference!); + } + + static ffi.Pointer? _sel_isSubclassOfClass; + static bool isSubclassOfClass(StringTestObjCLibrary _lib, NSObject aClass) { + _class ??= _getClass(_lib, "NSObject"); + _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); + return _lib._objc_msgSend_17(_class!, _sel_isSubclassOfClass!, aClass._id); + } + + static ffi.Pointer? _sel_resolveClassMethod; + static bool resolveClassMethod( + StringTestObjCLibrary _lib, ffi.Pointer sel) { + _class ??= _getClass(_lib, "NSObject"); + _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); + return _lib._objc_msgSend_18(_class!, _sel_resolveClassMethod!, sel); + } + + static ffi.Pointer? _sel_resolveInstanceMethod; + static bool resolveInstanceMethod( + StringTestObjCLibrary _lib, ffi.Pointer sel) { + _class ??= _getClass(_lib, "NSObject"); + _sel_resolveInstanceMethod ??= + _registerName(_lib, "resolveInstanceMethod:"); + return _lib._objc_msgSend_19(_class!, _sel_resolveInstanceMethod!, sel); + } + + static ffi.Pointer? _sel_hash; + static int hash(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_hash ??= _registerName(_lib, "hash"); + return _lib._objc_msgSend_20(_class!, _sel_hash!); + } + + static ffi.Pointer? _sel_superclass; + static NSObject superclass(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_superclass ??= _registerName(_lib, "superclass"); + final _ret = _lib._objc_msgSend_21(_class!, _sel_superclass!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_class1; + static NSObject class1(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_class1 ??= _registerName(_lib, "class"); + final _ret = _lib._objc_msgSend_22(_class!, _sel_class1!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_description; + static NSString description(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_description ??= _registerName(_lib, "description"); + final _ret = _lib._objc_msgSend_27(_class!, _sel_description!); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_debugDescription; + static NSString debugDescription(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_debugDescription ??= _registerName(_lib, "debugDescription"); + final _ret = _lib._objc_msgSend_27(_class!, _sel_debugDescription!); + return NSString._(_ret, _lib); + } +} + +typedef instancetype = ffi.Pointer; + +class ObjCObject extends ffi.Opaque {} + +class _NSZone extends ffi.Opaque {} + +class ObjCSel extends ffi.Opaque {} + +typedef IMP = ffi.Pointer>; + +class NSMethodSignature extends _ObjCWrapper { + NSMethodSignature._(ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSMethodSignature castFrom(T other) { + return NSMethodSignature._(other._id, other._lib); + } +} + +typedef NSUInteger = pkg_ffi.UnsignedLong; + +class NSString extends NSObject { + NSString._(ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSString castFrom(T other) { + return NSString._(other._id, other._lib); + } + + factory NSString(StringTestObjCLibrary _lib, String str) { + final cstr = str.toNativeUtf8(); + final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + pkg_ffi.calloc.free(cstr); + return nsstr; + } + + @override + String toString() => UTF8String().cast().toDartString(); + + static ffi.Pointer? _sel_length; + int get length { + _sel_length ??= _registerName(_lib, "length"); + return _lib._objc_msgSend_20(_id, _sel_length!); + } + + static ffi.Pointer? _sel_characterAtIndex; + int characterAtIndex(int index) { + _sel_characterAtIndex ??= _registerName(_lib, "characterAtIndex:"); + return _lib._objc_msgSend_23(_id, _sel_characterAtIndex!, index); + } + + static ffi.Pointer? _sel_init; + @override + NSString init() { + _sel_init ??= _registerName(_lib, "init"); + final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithCoder; + NSString initWithCoder(NSObject coder) { + _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); + final _ret = _lib._objc_msgSend_24(_id, _sel_initWithCoder!, coder._id); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_stringWithCString_encoding; + static NSString stringWithCString_encoding( + StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { + _class ??= _getClass(_lib, "NSString"); + _sel_stringWithCString_encoding ??= + _registerName(_lib, "stringWithCString:encoding:"); + final _ret = _lib._objc_msgSend_25( + _class!, _sel_stringWithCString_encoding!, cString, enc); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_UTF8String; + ffi.Pointer UTF8String() { + _sel_UTF8String ??= _registerName(_lib, "UTF8String"); + return _lib._objc_msgSend_26(_id, _sel_UTF8String!); + } + + static ffi.Pointer? _sel_new1; + static NSString new1(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSString"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSString alloc(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSString"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSString._(_ret, _lib); + } +} + +extension StringToNSString on String { + NSString toNSString(StringTestObjCLibrary lib) => NSString(lib, this); +} + +typedef unichar = pkg_ffi.UnsignedShort; + +class NSNumber extends NSValue { + NSNumber._(ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSNumber castFrom(T other) { + return NSNumber._(other._id, other._lib); + } + + static ffi.Pointer? _sel_initWithCoder; + @override + NSNumber initWithCoder(NSObject coder) { + _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); + final _ret = _lib._objc_msgSend_32(_id, _sel_initWithCoder!, coder._id); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithChar; + NSNumber initWithChar(int value) { + _sel_initWithChar ??= _registerName(_lib, "initWithChar:"); + final _ret = _lib._objc_msgSend_33(_id, _sel_initWithChar!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithUnsignedChar; + NSNumber initWithUnsignedChar(int value) { + _sel_initWithUnsignedChar ??= _registerName(_lib, "initWithUnsignedChar:"); + final _ret = _lib._objc_msgSend_34(_id, _sel_initWithUnsignedChar!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithShort; + NSNumber initWithShort(int value) { + _sel_initWithShort ??= _registerName(_lib, "initWithShort:"); + final _ret = _lib._objc_msgSend_35(_id, _sel_initWithShort!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithUnsignedShort; + NSNumber initWithUnsignedShort(int value) { + _sel_initWithUnsignedShort ??= + _registerName(_lib, "initWithUnsignedShort:"); + final _ret = _lib._objc_msgSend_36(_id, _sel_initWithUnsignedShort!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithInt; + NSNumber initWithInt(int value) { + _sel_initWithInt ??= _registerName(_lib, "initWithInt:"); + final _ret = _lib._objc_msgSend_37(_id, _sel_initWithInt!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithUnsignedInt; + NSNumber initWithUnsignedInt(int value) { + _sel_initWithUnsignedInt ??= _registerName(_lib, "initWithUnsignedInt:"); + final _ret = _lib._objc_msgSend_38(_id, _sel_initWithUnsignedInt!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithLong; + NSNumber initWithLong(int value) { + _sel_initWithLong ??= _registerName(_lib, "initWithLong:"); + final _ret = _lib._objc_msgSend_39(_id, _sel_initWithLong!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithUnsignedLong; + NSNumber initWithUnsignedLong(int value) { + _sel_initWithUnsignedLong ??= _registerName(_lib, "initWithUnsignedLong:"); + final _ret = _lib._objc_msgSend_40(_id, _sel_initWithUnsignedLong!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithLongLong; + NSNumber initWithLongLong(int value) { + _sel_initWithLongLong ??= _registerName(_lib, "initWithLongLong:"); + final _ret = _lib._objc_msgSend_41(_id, _sel_initWithLongLong!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithUnsignedLongLong; + NSNumber initWithUnsignedLongLong(int value) { + _sel_initWithUnsignedLongLong ??= + _registerName(_lib, "initWithUnsignedLongLong:"); + final _ret = + _lib._objc_msgSend_42(_id, _sel_initWithUnsignedLongLong!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithFloat; + NSNumber initWithFloat(double value) { + _sel_initWithFloat ??= _registerName(_lib, "initWithFloat:"); + final _ret = _lib._objc_msgSend_43(_id, _sel_initWithFloat!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithDouble; + NSNumber initWithDouble(double value) { + _sel_initWithDouble ??= _registerName(_lib, "initWithDouble:"); + final _ret = _lib._objc_msgSend_44(_id, _sel_initWithDouble!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithBool; + NSNumber initWithBool(bool value) { + _sel_initWithBool ??= _registerName(_lib, "initWithBool:"); + final _ret = _lib._objc_msgSend_45(_id, _sel_initWithBool!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithInteger; + NSNumber initWithInteger(int value) { + _sel_initWithInteger ??= _registerName(_lib, "initWithInteger:"); + final _ret = _lib._objc_msgSend_46(_id, _sel_initWithInteger!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithUnsignedInteger; + NSNumber initWithUnsignedInteger(int value) { + _sel_initWithUnsignedInteger ??= + _registerName(_lib, "initWithUnsignedInteger:"); + final _ret = + _lib._objc_msgSend_47(_id, _sel_initWithUnsignedInteger!, value); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_charValue; + int get charValue { + _sel_charValue ??= _registerName(_lib, "charValue"); + return _lib._objc_msgSend_48(_id, _sel_charValue!); + } + + static ffi.Pointer? _sel_unsignedCharValue; + int get unsignedCharValue { + _sel_unsignedCharValue ??= _registerName(_lib, "unsignedCharValue"); + return _lib._objc_msgSend_49(_id, _sel_unsignedCharValue!); + } + + static ffi.Pointer? _sel_shortValue; + int get shortValue { + _sel_shortValue ??= _registerName(_lib, "shortValue"); + return _lib._objc_msgSend_50(_id, _sel_shortValue!); + } + + static ffi.Pointer? _sel_unsignedShortValue; + int get unsignedShortValue { + _sel_unsignedShortValue ??= _registerName(_lib, "unsignedShortValue"); + return _lib._objc_msgSend_51(_id, _sel_unsignedShortValue!); + } + + static ffi.Pointer? _sel_intValue; + int get intValue { + _sel_intValue ??= _registerName(_lib, "intValue"); + return _lib._objc_msgSend_52(_id, _sel_intValue!); + } + + static ffi.Pointer? _sel_unsignedIntValue; + int get unsignedIntValue { + _sel_unsignedIntValue ??= _registerName(_lib, "unsignedIntValue"); + return _lib._objc_msgSend_53(_id, _sel_unsignedIntValue!); + } + + static ffi.Pointer? _sel_longValue; + int get longValue { + _sel_longValue ??= _registerName(_lib, "longValue"); + return _lib._objc_msgSend_54(_id, _sel_longValue!); + } + + static ffi.Pointer? _sel_unsignedLongValue; + int get unsignedLongValue { + _sel_unsignedLongValue ??= _registerName(_lib, "unsignedLongValue"); + return _lib._objc_msgSend_55(_id, _sel_unsignedLongValue!); + } + + static ffi.Pointer? _sel_longLongValue; + int get longLongValue { + _sel_longLongValue ??= _registerName(_lib, "longLongValue"); + return _lib._objc_msgSend_56(_id, _sel_longLongValue!); + } + + static ffi.Pointer? _sel_unsignedLongLongValue; + int get unsignedLongLongValue { + _sel_unsignedLongLongValue ??= _registerName(_lib, "unsignedLongLongValue"); + return _lib._objc_msgSend_57(_id, _sel_unsignedLongLongValue!); + } + + static ffi.Pointer? _sel_floatValue; + double get floatValue { + _sel_floatValue ??= _registerName(_lib, "floatValue"); + return _lib._objc_msgSend_58(_id, _sel_floatValue!); + } + + static ffi.Pointer? _sel_doubleValue; + double get doubleValue { + _sel_doubleValue ??= _registerName(_lib, "doubleValue"); + return _lib._objc_msgSend_59(_id, _sel_doubleValue!); + } + + static ffi.Pointer? _sel_boolValue; + bool get boolValue { + _sel_boolValue ??= _registerName(_lib, "boolValue"); + return _lib._objc_msgSend_16(_id, _sel_boolValue!); + } + + static ffi.Pointer? _sel_integerValue; + int get integerValue { + _sel_integerValue ??= _registerName(_lib, "integerValue"); + return _lib._objc_msgSend_60(_id, _sel_integerValue!); + } + + static ffi.Pointer? _sel_unsignedIntegerValue; + int get unsignedIntegerValue { + _sel_unsignedIntegerValue ??= _registerName(_lib, "unsignedIntegerValue"); + return _lib._objc_msgSend_20(_id, _sel_unsignedIntegerValue!); + } + + static ffi.Pointer? _sel_stringValue; + NSObject get stringValue { + _sel_stringValue ??= _registerName(_lib, "stringValue"); + final _ret = _lib._objc_msgSend_61(_id, _sel_stringValue!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_compare; + int compare(NSObject otherNumber) { + _sel_compare ??= _registerName(_lib, "compare:"); + return _lib._objc_msgSend_62(_id, _sel_compare!, otherNumber._id); + } + + static ffi.Pointer? _sel_isEqualToNumber; + bool isEqualToNumber(NSObject number) { + _sel_isEqualToNumber ??= _registerName(_lib, "isEqualToNumber:"); + return _lib._objc_msgSend_63(_id, _sel_isEqualToNumber!, number._id); + } + + static ffi.Pointer? _sel_descriptionWithLocale; + NSString descriptionWithLocale(NSObject locale) { + _sel_descriptionWithLocale ??= + _registerName(_lib, "descriptionWithLocale:"); + final _ret = + _lib._objc_msgSend_64(_id, _sel_descriptionWithLocale!, locale._id); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSNumber new1(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSNumber"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSNumber._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSNumber alloc(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSNumber"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSNumber._(_ret, _lib); + } +} + +class _NSRange extends ffi.Struct { + @NSUInteger() + external int location; + + @NSUInteger() + external int length; +} + +class NSFastEnumerationState extends ffi.Struct { + @pkg_ffi.UnsignedLong() + external int state; + + external ffi.Pointer> itemsPtr; + + external ffi.Pointer mutationsPtr; + + @ffi.Array.multi([5]) + external ffi.Array extra; +} + +class NSEnumerator extends NSObject { + NSEnumerator._(ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSEnumerator castFrom(T other) { + return NSEnumerator._(other._id, other._lib); + } + + static ffi.Pointer? _sel_nextObject; + NSObject nextObject() { + _sel_nextObject ??= _registerName(_lib, "nextObject"); + final _ret = _lib._objc_msgSend_65(_id, _sel_nextObject!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSEnumerator new1(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSEnumerator"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSEnumerator._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSEnumerator alloc(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSEnumerator"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSEnumerator._(_ret, _lib); + } +} + +abstract class NSCollectionChangeType { + static const int NSCollectionChangeInsert = 0; + static const int NSCollectionChangeRemove = 1; +} + +class NSOrderedCollectionChange extends NSObject { + NSOrderedCollectionChange._( + ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSOrderedCollectionChange castFrom(T other) { + return NSOrderedCollectionChange._(other._id, other._lib); + } + + static ffi.Pointer? _sel_object; + NSObject get object { + _sel_object ??= _registerName(_lib, "object"); + final _ret = _lib._objc_msgSend_66(_id, _sel_object!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_changeType; + int get changeType { + _sel_changeType ??= _registerName(_lib, "changeType"); + return _lib._objc_msgSend_67(_id, _sel_changeType!); + } + + static ffi.Pointer? _sel_index; + int get index { + _sel_index ??= _registerName(_lib, "index"); + return _lib._objc_msgSend_20(_id, _sel_index!); + } + + static ffi.Pointer? _sel_associatedIndex; + int get associatedIndex { + _sel_associatedIndex ??= _registerName(_lib, "associatedIndex"); + return _lib._objc_msgSend_20(_id, _sel_associatedIndex!); + } + + static ffi.Pointer? _sel_init; + @override + NSObject init() { + _sel_init ??= _registerName(_lib, "init"); + final _ret = _lib._objc_msgSend_68(_id, _sel_init!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithObject_type_index; + NSOrderedCollectionChange initWithObject_type_index( + NSObject anObject, int type, int index) { + _sel_initWithObject_type_index ??= + _registerName(_lib, "initWithObject:type:index:"); + final _ret = _lib._objc_msgSend_69( + _id, _sel_initWithObject_type_index!, anObject._id, type, index); + return NSOrderedCollectionChange._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithObject_type_index_associatedIndex; + NSOrderedCollectionChange initWithObject_type_index_associatedIndex( + NSObject anObject, int type, int index, int associatedIndex) { + _sel_initWithObject_type_index_associatedIndex ??= + _registerName(_lib, "initWithObject:type:index:associatedIndex:"); + final _ret = _lib._objc_msgSend_70( + _id, + _sel_initWithObject_type_index_associatedIndex!, + anObject._id, + type, + index, + associatedIndex); + return NSOrderedCollectionChange._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSOrderedCollectionChange new1(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSOrderedCollectionChange"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSOrderedCollectionChange._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSOrderedCollectionChange alloc(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSOrderedCollectionChange"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSOrderedCollectionChange._(_ret, _lib); + } +} + +class NSIndexSet extends NSObject { + NSIndexSet._(ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSIndexSet castFrom(T other) { + return NSIndexSet._(other._id, other._lib); + } + + static ffi.Pointer? _sel_indexSet; + static NSIndexSet indexSet(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSIndexSet"); + _sel_indexSet ??= _registerName(_lib, "indexSet"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_indexSet!); + return NSIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_indexSetWithIndex; + static NSIndexSet indexSetWithIndex(StringTestObjCLibrary _lib, int value) { + _class ??= _getClass(_lib, "NSIndexSet"); + _sel_indexSetWithIndex ??= _registerName(_lib, "indexSetWithIndex:"); + final _ret = _lib._objc_msgSend_71(_class!, _sel_indexSetWithIndex!, value); + return NSIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_indexSetWithIndexesInRange; + static NSIndexSet indexSetWithIndexesInRange( + StringTestObjCLibrary _lib, NSRange range) { + _class ??= _getClass(_lib, "NSIndexSet"); + _sel_indexSetWithIndexesInRange ??= + _registerName(_lib, "indexSetWithIndexesInRange:"); + final _ret = + _lib._objc_msgSend_72(_class!, _sel_indexSetWithIndexesInRange!, range); + return NSIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithIndexesInRange; + NSIndexSet initWithIndexesInRange(NSRange range) { + _sel_initWithIndexesInRange ??= + _registerName(_lib, "initWithIndexesInRange:"); + final _ret = + _lib._objc_msgSend_72(_id, _sel_initWithIndexesInRange!, range); + return NSIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithIndexSet; + NSIndexSet initWithIndexSet(NSObject indexSet) { + _sel_initWithIndexSet ??= _registerName(_lib, "initWithIndexSet:"); + final _ret = + _lib._objc_msgSend_73(_id, _sel_initWithIndexSet!, indexSet._id); + return NSIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithIndex; + NSIndexSet initWithIndex(int value) { + _sel_initWithIndex ??= _registerName(_lib, "initWithIndex:"); + final _ret = _lib._objc_msgSend_71(_id, _sel_initWithIndex!, value); + return NSIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_isEqualToIndexSet; + bool isEqualToIndexSet(NSObject indexSet) { + _sel_isEqualToIndexSet ??= _registerName(_lib, "isEqualToIndexSet:"); + return _lib._objc_msgSend_74(_id, _sel_isEqualToIndexSet!, indexSet._id); + } + + static ffi.Pointer? _sel_count; + int get count { + _sel_count ??= _registerName(_lib, "count"); + return _lib._objc_msgSend_20(_id, _sel_count!); + } + + static ffi.Pointer? _sel_firstIndex; + int get firstIndex { + _sel_firstIndex ??= _registerName(_lib, "firstIndex"); + return _lib._objc_msgSend_20(_id, _sel_firstIndex!); + } + + static ffi.Pointer? _sel_lastIndex; + int get lastIndex { + _sel_lastIndex ??= _registerName(_lib, "lastIndex"); + return _lib._objc_msgSend_20(_id, _sel_lastIndex!); + } + + static ffi.Pointer? _sel_indexGreaterThanIndex; + int indexGreaterThanIndex(int value) { + _sel_indexGreaterThanIndex ??= + _registerName(_lib, "indexGreaterThanIndex:"); + return _lib._objc_msgSend_75(_id, _sel_indexGreaterThanIndex!, value); + } + + static ffi.Pointer? _sel_indexLessThanIndex; + int indexLessThanIndex(int value) { + _sel_indexLessThanIndex ??= _registerName(_lib, "indexLessThanIndex:"); + return _lib._objc_msgSend_75(_id, _sel_indexLessThanIndex!, value); + } + + static ffi.Pointer? _sel_indexGreaterThanOrEqualToIndex; + int indexGreaterThanOrEqualToIndex(int value) { + _sel_indexGreaterThanOrEqualToIndex ??= + _registerName(_lib, "indexGreaterThanOrEqualToIndex:"); + return _lib._objc_msgSend_75( + _id, _sel_indexGreaterThanOrEqualToIndex!, value); + } + + static ffi.Pointer? _sel_indexLessThanOrEqualToIndex; + int indexLessThanOrEqualToIndex(int value) { + _sel_indexLessThanOrEqualToIndex ??= + _registerName(_lib, "indexLessThanOrEqualToIndex:"); + return _lib._objc_msgSend_75(_id, _sel_indexLessThanOrEqualToIndex!, value); + } + + static ffi.Pointer? _sel_getIndexes_maxCount_inIndexRange; + int getIndexes_maxCount_inIndexRange(ffi.Pointer indexBuffer, + int bufferSize, NSRangePointer range) { + _sel_getIndexes_maxCount_inIndexRange ??= + _registerName(_lib, "getIndexes:maxCount:inIndexRange:"); + return _lib._objc_msgSend_76(_id, _sel_getIndexes_maxCount_inIndexRange!, + indexBuffer, bufferSize, range); + } + + static ffi.Pointer? _sel_countOfIndexesInRange; + int countOfIndexesInRange(NSRange range) { + _sel_countOfIndexesInRange ??= + _registerName(_lib, "countOfIndexesInRange:"); + return _lib._objc_msgSend_77(_id, _sel_countOfIndexesInRange!, range); + } + + static ffi.Pointer? _sel_containsIndex; + bool containsIndex(int value) { + _sel_containsIndex ??= _registerName(_lib, "containsIndex:"); + return _lib._objc_msgSend_78(_id, _sel_containsIndex!, value); + } + + static ffi.Pointer? _sel_containsIndexesInRange; + bool containsIndexesInRange(NSRange range) { + _sel_containsIndexesInRange ??= + _registerName(_lib, "containsIndexesInRange:"); + return _lib._objc_msgSend_79(_id, _sel_containsIndexesInRange!, range); + } + + static ffi.Pointer? _sel_containsIndexes; + bool containsIndexes(NSObject indexSet) { + _sel_containsIndexes ??= _registerName(_lib, "containsIndexes:"); + return _lib._objc_msgSend_80(_id, _sel_containsIndexes!, indexSet._id); + } + + static ffi.Pointer? _sel_intersectsIndexesInRange; + bool intersectsIndexesInRange(NSRange range) { + _sel_intersectsIndexesInRange ??= + _registerName(_lib, "intersectsIndexesInRange:"); + return _lib._objc_msgSend_79(_id, _sel_intersectsIndexesInRange!, range); + } + + static ffi.Pointer? _sel_enumerateIndexesUsingBlock; + void enumerateIndexesUsingBlock(NSObject block) { + _sel_enumerateIndexesUsingBlock ??= + _registerName(_lib, "enumerateIndexesUsingBlock:"); + _lib._objc_msgSend_81(_id, _sel_enumerateIndexesUsingBlock!, block._id); + } + + static ffi.Pointer? _sel_enumerateIndexesWithOptions_usingBlock; + void enumerateIndexesWithOptions_usingBlock(int opts, NSObject block) { + _sel_enumerateIndexesWithOptions_usingBlock ??= + _registerName(_lib, "enumerateIndexesWithOptions:usingBlock:"); + _lib._objc_msgSend_82( + _id, _sel_enumerateIndexesWithOptions_usingBlock!, opts, block._id); + } + + static ffi.Pointer? _sel_enumerateIndexesInRange_options_usingBlock; + void enumerateIndexesInRange_options_usingBlock( + NSRange range, int opts, NSObject block) { + _sel_enumerateIndexesInRange_options_usingBlock ??= + _registerName(_lib, "enumerateIndexesInRange:options:usingBlock:"); + _lib._objc_msgSend_83(_id, _sel_enumerateIndexesInRange_options_usingBlock!, + range, opts, block._id); + } + + static ffi.Pointer? _sel_indexPassingTest; + int indexPassingTest(NSObject predicate) { + _sel_indexPassingTest ??= _registerName(_lib, "indexPassingTest:"); + return _lib._objc_msgSend_84(_id, _sel_indexPassingTest!, predicate._id); + } + + static ffi.Pointer? _sel_indexWithOptions_passingTest; + int indexWithOptions_passingTest(int opts, NSObject predicate) { + _sel_indexWithOptions_passingTest ??= + _registerName(_lib, "indexWithOptions:passingTest:"); + return _lib._objc_msgSend_85( + _id, _sel_indexWithOptions_passingTest!, opts, predicate._id); + } + + static ffi.Pointer? _sel_indexInRange_options_passingTest; + int indexInRange_options_passingTest( + NSRange range, int opts, NSObject predicate) { + _sel_indexInRange_options_passingTest ??= + _registerName(_lib, "indexInRange:options:passingTest:"); + return _lib._objc_msgSend_86(_id, _sel_indexInRange_options_passingTest!, + range, opts, predicate._id); + } + + static ffi.Pointer? _sel_indexesPassingTest; + NSIndexSet indexesPassingTest(NSObject predicate) { + _sel_indexesPassingTest ??= _registerName(_lib, "indexesPassingTest:"); + final _ret = + _lib._objc_msgSend_87(_id, _sel_indexesPassingTest!, predicate._id); + return NSIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_indexesWithOptions_passingTest; + NSIndexSet indexesWithOptions_passingTest(int opts, NSObject predicate) { + _sel_indexesWithOptions_passingTest ??= + _registerName(_lib, "indexesWithOptions:passingTest:"); + final _ret = _lib._objc_msgSend_88( + _id, _sel_indexesWithOptions_passingTest!, opts, predicate._id); + return NSIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_indexesInRange_options_passingTest; + NSIndexSet indexesInRange_options_passingTest( + NSRange range, int opts, NSObject predicate) { + _sel_indexesInRange_options_passingTest ??= + _registerName(_lib, "indexesInRange:options:passingTest:"); + final _ret = _lib._objc_msgSend_89(_id, + _sel_indexesInRange_options_passingTest!, range, opts, predicate._id); + return NSIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_enumerateRangesUsingBlock; + void enumerateRangesUsingBlock(NSObject block) { + _sel_enumerateRangesUsingBlock ??= + _registerName(_lib, "enumerateRangesUsingBlock:"); + _lib._objc_msgSend_90(_id, _sel_enumerateRangesUsingBlock!, block._id); + } + + static ffi.Pointer? _sel_enumerateRangesWithOptions_usingBlock; + void enumerateRangesWithOptions_usingBlock(int opts, NSObject block) { + _sel_enumerateRangesWithOptions_usingBlock ??= + _registerName(_lib, "enumerateRangesWithOptions:usingBlock:"); + _lib._objc_msgSend_91( + _id, _sel_enumerateRangesWithOptions_usingBlock!, opts, block._id); + } + + static ffi.Pointer? _sel_enumerateRangesInRange_options_usingBlock; + void enumerateRangesInRange_options_usingBlock( + NSRange range, int opts, NSObject block) { + _sel_enumerateRangesInRange_options_usingBlock ??= + _registerName(_lib, "enumerateRangesInRange:options:usingBlock:"); + _lib._objc_msgSend_92(_id, _sel_enumerateRangesInRange_options_usingBlock!, + range, opts, block._id); + } + + static ffi.Pointer? _sel_new1; + static NSIndexSet new1(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSIndexSet"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSIndexSet alloc(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSIndexSet"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSIndexSet._(_ret, _lib); + } +} + +typedef NSRange = _NSRange; +typedef NSRangePointer = ffi.Pointer; + +class NSMutableIndexSet extends NSIndexSet { + NSMutableIndexSet._(ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSMutableIndexSet castFrom(T other) { + return NSMutableIndexSet._(other._id, other._lib); + } + + static ffi.Pointer? _sel_addIndexes; + void addIndexes(NSObject indexSet) { + _sel_addIndexes ??= _registerName(_lib, "addIndexes:"); + _lib._objc_msgSend_93(_id, _sel_addIndexes!, indexSet._id); + } + + static ffi.Pointer? _sel_removeIndexes; + void removeIndexes(NSObject indexSet) { + _sel_removeIndexes ??= _registerName(_lib, "removeIndexes:"); + _lib._objc_msgSend_94(_id, _sel_removeIndexes!, indexSet._id); + } + + static ffi.Pointer? _sel_removeAllIndexes; + void removeAllIndexes() { + _sel_removeAllIndexes ??= _registerName(_lib, "removeAllIndexes"); + _lib._objc_msgSend_0(_id, _sel_removeAllIndexes!); + } + + static ffi.Pointer? _sel_addIndex; + void addIndex(int value) { + _sel_addIndex ??= _registerName(_lib, "addIndex:"); + _lib._objc_msgSend_95(_id, _sel_addIndex!, value); + } + + static ffi.Pointer? _sel_removeIndex; + void removeIndex(int value) { + _sel_removeIndex ??= _registerName(_lib, "removeIndex:"); + _lib._objc_msgSend_95(_id, _sel_removeIndex!, value); + } + + static ffi.Pointer? _sel_addIndexesInRange; + void addIndexesInRange(NSRange range) { + _sel_addIndexesInRange ??= _registerName(_lib, "addIndexesInRange:"); + _lib._objc_msgSend_96(_id, _sel_addIndexesInRange!, range); + } + + static ffi.Pointer? _sel_removeIndexesInRange; + void removeIndexesInRange(NSRange range) { + _sel_removeIndexesInRange ??= _registerName(_lib, "removeIndexesInRange:"); + _lib._objc_msgSend_96(_id, _sel_removeIndexesInRange!, range); + } + + static ffi.Pointer? _sel_shiftIndexesStartingAtIndex_by; + void shiftIndexesStartingAtIndex_by(int index, int delta) { + _sel_shiftIndexesStartingAtIndex_by ??= + _registerName(_lib, "shiftIndexesStartingAtIndex:by:"); + _lib._objc_msgSend_97( + _id, _sel_shiftIndexesStartingAtIndex_by!, index, delta); + } + + static ffi.Pointer? _sel_indexSet; + static NSMutableIndexSet indexSet(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSMutableIndexSet"); + _sel_indexSet ??= _registerName(_lib, "indexSet"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_indexSet!); + return NSMutableIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_indexSetWithIndex; + static NSMutableIndexSet indexSetWithIndex( + StringTestObjCLibrary _lib, int value) { + _class ??= _getClass(_lib, "NSMutableIndexSet"); + _sel_indexSetWithIndex ??= _registerName(_lib, "indexSetWithIndex:"); + final _ret = _lib._objc_msgSend_71(_class!, _sel_indexSetWithIndex!, value); + return NSMutableIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_indexSetWithIndexesInRange; + static NSMutableIndexSet indexSetWithIndexesInRange( + StringTestObjCLibrary _lib, NSRange range) { + _class ??= _getClass(_lib, "NSMutableIndexSet"); + _sel_indexSetWithIndexesInRange ??= + _registerName(_lib, "indexSetWithIndexesInRange:"); + final _ret = + _lib._objc_msgSend_72(_class!, _sel_indexSetWithIndexesInRange!, range); + return NSMutableIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSMutableIndexSet new1(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSMutableIndexSet"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSMutableIndexSet._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSMutableIndexSet alloc(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSMutableIndexSet"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSMutableIndexSet._(_ret, _lib); + } +} + +abstract class NSOrderedCollectionDifferenceCalculationOptions { + static const int NSOrderedCollectionDifferenceCalculationOmitInsertedObjects = + 1; + static const int NSOrderedCollectionDifferenceCalculationOmitRemovedObjects = + 2; + static const int NSOrderedCollectionDifferenceCalculationInferMoves = 4; +} + +class NSOrderedCollectionDifference extends NSObject { + NSOrderedCollectionDifference._( + ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSOrderedCollectionDifference castFrom( + T other) { + return NSOrderedCollectionDifference._(other._id, other._lib); + } + + static ffi.Pointer? _sel_initWithChanges; + NSOrderedCollectionDifference initWithChanges(NSObject changes) { + _sel_initWithChanges ??= _registerName(_lib, "initWithChanges:"); + final _ret = _lib._objc_msgSend_98(_id, _sel_initWithChanges!, changes._id); + return NSOrderedCollectionDifference._(_ret, _lib); + } + + static ffi.Pointer? + _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges; + NSOrderedCollectionDifference + initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges( + NSObject inserts, + NSObject insertedObjects, + NSObject removes, + NSObject removedObjects, + NSObject changes) { + _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges ??= + _registerName(_lib, + "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:additionalChanges:"); + final _ret = _lib._objc_msgSend_99( + _id, + _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges!, + inserts._id, + insertedObjects._id, + removes._id, + removedObjects._id, + changes._id); + return NSOrderedCollectionDifference._(_ret, _lib); + } + + static ffi.Pointer? + _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects; + NSOrderedCollectionDifference + initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects( + NSObject inserts, + NSObject insertedObjects, + NSObject removes, + NSObject removedObjects) { + _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects ??= + _registerName(_lib, + "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:"); + final _ret = _lib._objc_msgSend_100( + _id, + _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects!, + inserts._id, + insertedObjects._id, + removes._id, + removedObjects._id); + return NSOrderedCollectionDifference._(_ret, _lib); + } + + static ffi.Pointer? _sel_insertions; + NSObject get insertions { + _sel_insertions ??= _registerName(_lib, "insertions"); + final _ret = _lib._objc_msgSend_101(_id, _sel_insertions!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_removals; + NSObject get removals { + _sel_removals ??= _registerName(_lib, "removals"); + final _ret = _lib._objc_msgSend_102(_id, _sel_removals!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_hasChanges; + bool get hasChanges { + _sel_hasChanges ??= _registerName(_lib, "hasChanges"); + return _lib._objc_msgSend_16(_id, _sel_hasChanges!); + } + + static ffi.Pointer? _sel_inverseDifference; + NSOrderedCollectionDifference inverseDifference() { + _sel_inverseDifference ??= _registerName(_lib, "inverseDifference"); + final _ret = _lib._objc_msgSend_1(_id, _sel_inverseDifference!); + return NSOrderedCollectionDifference._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSOrderedCollectionDifference new1(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSOrderedCollectionDifference"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSOrderedCollectionDifference._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSOrderedCollectionDifference alloc(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSOrderedCollectionDifference"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSOrderedCollectionDifference._(_ret, _lib); + } +} + +class NSArray extends NSObject { + NSArray._(ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSArray castFrom(T other) { + return NSArray._(other._id, other._lib); + } + + static ffi.Pointer? _sel_count; + int get count { + _sel_count ??= _registerName(_lib, "count"); + return _lib._objc_msgSend_20(_id, _sel_count!); + } + + static ffi.Pointer? _sel_objectAtIndex; + NSObject objectAtIndex(int index) { + _sel_objectAtIndex ??= _registerName(_lib, "objectAtIndex:"); + final _ret = _lib._objc_msgSend_103(_id, _sel_objectAtIndex!, index); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_init; + @override + NSArray init() { + _sel_init ??= _registerName(_lib, "init"); + final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + return NSArray._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithObjects_count; + NSArray initWithObjects_count( + ffi.Pointer> objects, int cnt) { + _sel_initWithObjects_count ??= + _registerName(_lib, "initWithObjects:count:"); + final _ret = + _lib._objc_msgSend_104(_id, _sel_initWithObjects_count!, objects, cnt); + return NSArray._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithCoder; + NSArray initWithCoder(NSObject coder) { + _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); + final _ret = _lib._objc_msgSend_105(_id, _sel_initWithCoder!, coder._id); + return NSArray._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSArray new1(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSArray"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSArray._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSArray alloc(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSArray"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSArray._(_ret, _lib); + } +} + +abstract class NSBinarySearchingOptions { + static const int NSBinarySearchingFirstEqual = 256; + static const int NSBinarySearchingLastEqual = 512; + static const int NSBinarySearchingInsertionIndex = 1024; +} + +class NSMutableArray extends NSArray { + NSMutableArray._(ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSMutableArray castFrom(T other) { + return NSMutableArray._(other._id, other._lib); + } + + static ffi.Pointer? _sel_addObject; + void addObject(NSObject anObject) { + _sel_addObject ??= _registerName(_lib, "addObject:"); + _lib._objc_msgSend_106(_id, _sel_addObject!, anObject._id); + } + + static ffi.Pointer? _sel_insertObject_atIndex; + void insertObject_atIndex(NSObject anObject, int index) { + _sel_insertObject_atIndex ??= _registerName(_lib, "insertObject:atIndex:"); + _lib._objc_msgSend_107( + _id, _sel_insertObject_atIndex!, anObject._id, index); + } + + static ffi.Pointer? _sel_removeLastObject; + void removeLastObject() { + _sel_removeLastObject ??= _registerName(_lib, "removeLastObject"); + _lib._objc_msgSend_0(_id, _sel_removeLastObject!); + } + + static ffi.Pointer? _sel_removeObjectAtIndex; + void removeObjectAtIndex(int index) { + _sel_removeObjectAtIndex ??= _registerName(_lib, "removeObjectAtIndex:"); + _lib._objc_msgSend_95(_id, _sel_removeObjectAtIndex!, index); + } + + static ffi.Pointer? _sel_replaceObjectAtIndex_withObject; + void replaceObjectAtIndex_withObject(int index, NSObject anObject) { + _sel_replaceObjectAtIndex_withObject ??= + _registerName(_lib, "replaceObjectAtIndex:withObject:"); + _lib._objc_msgSend_108( + _id, _sel_replaceObjectAtIndex_withObject!, index, anObject._id); + } + + static ffi.Pointer? _sel_init; + @override + NSMutableArray init() { + _sel_init ??= _registerName(_lib, "init"); + final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + return NSMutableArray._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithCapacity; + NSMutableArray initWithCapacity(int numItems) { + _sel_initWithCapacity ??= _registerName(_lib, "initWithCapacity:"); + final _ret = _lib._objc_msgSend_71(_id, _sel_initWithCapacity!, numItems); + return NSMutableArray._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithCoder; + @override + NSMutableArray initWithCoder(NSObject coder) { + _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); + final _ret = _lib._objc_msgSend_109(_id, _sel_initWithCoder!, coder._id); + return NSMutableArray._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSMutableArray new1(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSMutableArray"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSMutableArray._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSMutableArray alloc(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSMutableArray"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSMutableArray._(_ret, _lib); + } +} + +abstract class NSItemProviderRepresentationVisibility { + static const int NSItemProviderRepresentationVisibilityAll = 0; + static const int NSItemProviderRepresentationVisibilityTeam = 1; + static const int NSItemProviderRepresentationVisibilityGroup = 2; + static const int NSItemProviderRepresentationVisibilityOwnProcess = 3; +} + +abstract class NSItemProviderFileOptions { + static const int NSItemProviderFileOptionOpenInPlace = 1; +} + +class NSItemProvider extends NSObject { + NSItemProvider._(ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSItemProvider castFrom(T other) { + return NSItemProvider._(other._id, other._lib); + } + + static ffi.Pointer? _sel_init; + @override + NSItemProvider init() { + _sel_init ??= _registerName(_lib, "init"); + final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + return NSItemProvider._(_ret, _lib); + } + + static ffi.Pointer? + _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler; + void registerDataRepresentationForTypeIdentifier_visibility_loadHandler( + NSObject typeIdentifier, int visibility, NSObject loadHandler) { + _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler ??= + _registerName(_lib, + "registerDataRepresentationForTypeIdentifier:visibility:loadHandler:"); + _lib._objc_msgSend_110( + _id, + _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler!, + typeIdentifier._id, + visibility, + loadHandler._id); + } + + static ffi.Pointer? + _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler; + void + registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler( + NSObject typeIdentifier, + int fileOptions, + int visibility, + NSObject loadHandler) { + _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler ??= + _registerName(_lib, + "registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:"); + _lib._objc_msgSend_111( + _id, + _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler!, + typeIdentifier._id, + fileOptions, + visibility, + loadHandler._id); + } + + static ffi.Pointer? _sel_registeredTypeIdentifiers; + NSObject get registeredTypeIdentifiers { + _sel_registeredTypeIdentifiers ??= + _registerName(_lib, "registeredTypeIdentifiers"); + final _ret = _lib._objc_msgSend_112(_id, _sel_registeredTypeIdentifiers!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_hasItemConformingToTypeIdentifier; + bool hasItemConformingToTypeIdentifier(NSObject typeIdentifier) { + _sel_hasItemConformingToTypeIdentifier ??= + _registerName(_lib, "hasItemConformingToTypeIdentifier:"); + return _lib._objc_msgSend_113( + _id, _sel_hasItemConformingToTypeIdentifier!, typeIdentifier._id); + } + + static ffi.Pointer? + _sel_hasRepresentationConformingToTypeIdentifier_fileOptions; + bool hasRepresentationConformingToTypeIdentifier_fileOptions( + NSObject typeIdentifier, int fileOptions) { + _sel_hasRepresentationConformingToTypeIdentifier_fileOptions ??= + _registerName( + _lib, "hasRepresentationConformingToTypeIdentifier:fileOptions:"); + return _lib._objc_msgSend_114( + _id, + _sel_hasRepresentationConformingToTypeIdentifier_fileOptions!, + typeIdentifier._id, + fileOptions); + } + + static ffi.Pointer? + _sel_loadDataRepresentationForTypeIdentifier_completionHandler; + NSProgress loadDataRepresentationForTypeIdentifier_completionHandler( + NSObject typeIdentifier, NSObject completionHandler) { + _sel_loadDataRepresentationForTypeIdentifier_completionHandler ??= + _registerName( + _lib, "loadDataRepresentationForTypeIdentifier:completionHandler:"); + final _ret = _lib._objc_msgSend_115( + _id, + _sel_loadDataRepresentationForTypeIdentifier_completionHandler!, + typeIdentifier._id, + completionHandler._id); + return NSProgress._(_ret, _lib); + } + + static ffi.Pointer? + _sel_loadFileRepresentationForTypeIdentifier_completionHandler; + NSProgress loadFileRepresentationForTypeIdentifier_completionHandler( + NSObject typeIdentifier, NSObject completionHandler) { + _sel_loadFileRepresentationForTypeIdentifier_completionHandler ??= + _registerName( + _lib, "loadFileRepresentationForTypeIdentifier:completionHandler:"); + final _ret = _lib._objc_msgSend_116( + _id, + _sel_loadFileRepresentationForTypeIdentifier_completionHandler!, + typeIdentifier._id, + completionHandler._id); + return NSProgress._(_ret, _lib); + } + + static ffi.Pointer? + _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler; + NSProgress loadInPlaceFileRepresentationForTypeIdentifier_completionHandler( + NSObject typeIdentifier, NSObject completionHandler) { + _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler ??= + _registerName(_lib, + "loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:"); + final _ret = _lib._objc_msgSend_117( + _id, + _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler!, + typeIdentifier._id, + completionHandler._id); + return NSProgress._(_ret, _lib); + } + + static ffi.Pointer? _sel_suggestedName; + NSObject get suggestedName { + _sel_suggestedName ??= _registerName(_lib, "suggestedName"); + final _ret = _lib._objc_msgSend_118(_id, _sel_suggestedName!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_suggestedName1; + set suggestedName(NSObject value) { + _sel_suggestedName1 ??= _registerName(_lib, "setSuggestedName:"); + _lib._objc_msgSend_119(_id, _sel_suggestedName1!, value._id); + } + + static ffi.Pointer? _sel_initWithObject; + NSItemProvider initWithObject(NSObject object) { + _sel_initWithObject ??= _registerName(_lib, "initWithObject:"); + final _ret = _lib._objc_msgSend_120(_id, _sel_initWithObject!, object._id); + return NSItemProvider._(_ret, _lib); + } + + static ffi.Pointer? _sel_registerObject_visibility; + void registerObject_visibility(NSObject object, int visibility) { + _sel_registerObject_visibility ??= + _registerName(_lib, "registerObject:visibility:"); + _lib._objc_msgSend_121( + _id, _sel_registerObject_visibility!, object._id, visibility); + } + + static ffi.Pointer? + _sel_registerObjectOfClass_visibility_loadHandler; + void registerObjectOfClass_visibility_loadHandler( + NSObject aClass, int visibility, NSObject loadHandler) { + _sel_registerObjectOfClass_visibility_loadHandler ??= + _registerName(_lib, "registerObjectOfClass:visibility:loadHandler:"); + _lib._objc_msgSend_122( + _id, + _sel_registerObjectOfClass_visibility_loadHandler!, + aClass._id, + visibility, + loadHandler._id); + } + + static ffi.Pointer? _sel_canLoadObjectOfClass; + bool canLoadObjectOfClass(NSObject aClass) { + _sel_canLoadObjectOfClass ??= _registerName(_lib, "canLoadObjectOfClass:"); + return _lib._objc_msgSend_123(_id, _sel_canLoadObjectOfClass!, aClass._id); + } + + static ffi.Pointer? _sel_loadObjectOfClass_completionHandler; + NSProgress loadObjectOfClass_completionHandler( + NSObject aClass, NSObject completionHandler) { + _sel_loadObjectOfClass_completionHandler ??= + _registerName(_lib, "loadObjectOfClass:completionHandler:"); + final _ret = _lib._objc_msgSend_124( + _id, + _sel_loadObjectOfClass_completionHandler!, + aClass._id, + completionHandler._id); + return NSProgress._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithItem_typeIdentifier; + NSItemProvider initWithItem_typeIdentifier( + NSObject item, NSObject typeIdentifier) { + _sel_initWithItem_typeIdentifier ??= + _registerName(_lib, "initWithItem:typeIdentifier:"); + final _ret = _lib._objc_msgSend_125( + _id, _sel_initWithItem_typeIdentifier!, item._id, typeIdentifier._id); + return NSItemProvider._(_ret, _lib); + } + + static ffi.Pointer? _sel_initWithContentsOfURL; + NSItemProvider initWithContentsOfURL(NSObject fileURL) { + _sel_initWithContentsOfURL ??= + _registerName(_lib, "initWithContentsOfURL:"); + final _ret = + _lib._objc_msgSend_126(_id, _sel_initWithContentsOfURL!, fileURL._id); + return NSItemProvider._(_ret, _lib); + } + + static ffi.Pointer? _sel_registerItemForTypeIdentifier_loadHandler; + void registerItemForTypeIdentifier_loadHandler( + NSObject typeIdentifier, NSItemProviderLoadHandler loadHandler) { + _sel_registerItemForTypeIdentifier_loadHandler ??= + _registerName(_lib, "registerItemForTypeIdentifier:loadHandler:"); + _lib._objc_msgSend_127(_id, _sel_registerItemForTypeIdentifier_loadHandler!, + typeIdentifier._id, loadHandler); + } + + static ffi.Pointer? + _sel_loadItemForTypeIdentifier_options_completionHandler; + void loadItemForTypeIdentifier_options_completionHandler( + NSObject typeIdentifier, + NSObject options, + NSItemProviderCompletionHandler completionHandler) { + _sel_loadItemForTypeIdentifier_options_completionHandler ??= _registerName( + _lib, "loadItemForTypeIdentifier:options:completionHandler:"); + _lib._objc_msgSend_128( + _id, + _sel_loadItemForTypeIdentifier_options_completionHandler!, + typeIdentifier._id, + options._id, + completionHandler); + } + + static ffi.Pointer? _sel_new1; + static NSItemProvider new1(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSItemProvider"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSItemProvider._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSItemProvider alloc(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSItemProvider"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSItemProvider._(_ret, _lib); + } +} + +class NSProgress extends _ObjCWrapper { + NSProgress._(ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSProgress castFrom(T other) { + return NSProgress._(other._id, other._lib); + } +} + +typedef NSItemProviderLoadHandler = ffi.Pointer; +typedef NSItemProviderCompletionHandler = ffi.Pointer; + +abstract class NSItemProviderErrorCode { + static const int NSItemProviderUnknownError = -1; + static const int NSItemProviderItemUnavailableError = -1000; + static const int NSItemProviderUnexpectedValueClassError = -1100; + static const int NSItemProviderUnavailableCoercionError = -1200; +} + +abstract class NSStringCompareOptions { + static const int NSCaseInsensitiveSearch = 1; + static const int NSLiteralSearch = 2; + static const int NSBackwardsSearch = 4; + static const int NSAnchoredSearch = 8; + static const int NSNumericSearch = 64; + static const int NSDiacriticInsensitiveSearch = 128; + static const int NSWidthInsensitiveSearch = 256; + static const int NSForcedOrderingSearch = 512; + static const int NSRegularExpressionSearch = 1024; +} + +abstract class NSStringEncodingConversionOptions { + static const int NSStringEncodingConversionAllowLossy = 1; + static const int NSStringEncodingConversionExternalRepresentation = 2; +} + +abstract class NSStringEnumerationOptions { + static const int NSStringEnumerationByLines = 0; + static const int NSStringEnumerationByParagraphs = 1; + static const int NSStringEnumerationByComposedCharacterSequences = 2; + static const int NSStringEnumerationByWords = 3; + static const int NSStringEnumerationBySentences = 4; + static const int NSStringEnumerationByCaretPositions = 5; + static const int NSStringEnumerationByDeletionClusters = 6; + static const int NSStringEnumerationReverse = 256; + static const int NSStringEnumerationSubstringNotRequired = 512; + static const int NSStringEnumerationLocalized = 1024; +} + +typedef NSStringTransform = ffi.Pointer; +typedef NSStringEncodingDetectionOptionsKey = ffi.Pointer; + +class NSMutableString extends NSString { + NSMutableString._(ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSMutableString castFrom(T other) { + return NSMutableString._(other._id, other._lib); + } + + static ffi.Pointer? _sel_replaceCharactersInRange_withString; + void replaceCharactersInRange_withString(NSRange range, NSObject aString) { + _sel_replaceCharactersInRange_withString ??= + _registerName(_lib, "replaceCharactersInRange:withString:"); + _lib._objc_msgSend_129( + _id, _sel_replaceCharactersInRange_withString!, range, aString._id); + } + + static ffi.Pointer? _sel_stringWithCString_encoding; + static NSString stringWithCString_encoding( + StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { + _class ??= _getClass(_lib, "NSMutableString"); + _sel_stringWithCString_encoding ??= + _registerName(_lib, "stringWithCString:encoding:"); + final _ret = _lib._objc_msgSend_25( + _class!, _sel_stringWithCString_encoding!, cString, enc); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSMutableString new1(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSMutableString"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSMutableString._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSMutableString alloc(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSMutableString"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSMutableString._(_ret, _lib); + } +} + +typedef NSExceptionName = ffi.Pointer; + +class NSSimpleCString extends NSString { + NSSimpleCString._(ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSSimpleCString castFrom(T other) { + return NSSimpleCString._(other._id, other._lib); + } + + static ffi.Pointer? _sel_stringWithCString_encoding; + static NSString stringWithCString_encoding( + StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { + _class ??= _getClass(_lib, "NSSimpleCString"); + _sel_stringWithCString_encoding ??= + _registerName(_lib, "stringWithCString:encoding:"); + final _ret = _lib._objc_msgSend_25( + _class!, _sel_stringWithCString_encoding!, cString, enc); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSSimpleCString new1(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSSimpleCString"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSSimpleCString._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSSimpleCString alloc(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSSimpleCString"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSSimpleCString._(_ret, _lib); + } +} + +class NSConstantString extends NSSimpleCString { + NSConstantString._(ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSConstantString castFrom(T other) { + return NSConstantString._(other._id, other._lib); + } + + static ffi.Pointer? _sel_stringWithCString_encoding; + static NSString stringWithCString_encoding( + StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { + _class ??= _getClass(_lib, "NSConstantString"); + _sel_stringWithCString_encoding ??= + _registerName(_lib, "stringWithCString:encoding:"); + final _ret = _lib._objc_msgSend_25( + _class!, _sel_stringWithCString_encoding!, cString, enc); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSConstantString new1(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSConstantString"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSConstantString._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSConstantString alloc(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSConstantString"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSConstantString._(_ret, _lib); + } +} + +class StringUtil extends NSObject { + StringUtil._(ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static StringUtil castFrom(T other) { + return StringUtil._(other._id, other._lib); + } + + static ffi.Pointer? _sel_strConcat_with; + static NSString strConcat_with( + StringTestObjCLibrary _lib, NSObject a, NSObject b) { + _class ??= _getClass(_lib, "StringUtil"); + _sel_strConcat_with ??= _registerName(_lib, "strConcat:with:"); + final _ret = + _lib._objc_msgSend_130(_class!, _sel_strConcat_with!, a._id, b._id); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static StringUtil new1(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "StringUtil"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return StringUtil._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static StringUtil alloc(StringTestObjCLibrary _lib) { + _class ??= _getClass(_lib, "StringUtil"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return StringUtil._(_ret, _lib); + } +} + +const int NSScannedOption = 1; + +const int NSCollectorDisabledOption = 2; + +const int NSASCIIStringEncoding = 1; + +const int NSNEXTSTEPStringEncoding = 2; + +const int NSJapaneseEUCStringEncoding = 3; + +const int NSUTF8StringEncoding = 4; + +const int NSISOLatin1StringEncoding = 5; + +const int NSSymbolStringEncoding = 6; + +const int NSNonLossyASCIIStringEncoding = 7; + +const int NSShiftJISStringEncoding = 8; + +const int NSISOLatin2StringEncoding = 9; + +const int NSUnicodeStringEncoding = 10; + +const int NSWindowsCP1251StringEncoding = 11; + +const int NSWindowsCP1252StringEncoding = 12; + +const int NSWindowsCP1253StringEncoding = 13; + +const int NSWindowsCP1254StringEncoding = 14; + +const int NSWindowsCP1250StringEncoding = 15; + +const int NSISO2022JPStringEncoding = 21; + +const int NSMacOSRomanStringEncoding = 30; + +const int NSUTF16StringEncoding = 10; + +const int NSUTF16BigEndianStringEncoding = 2415919360; + +const int NSUTF16LittleEndianStringEncoding = 2483028224; + +const int NSUTF32StringEncoding = 2348810496; + +const int NSUTF32BigEndianStringEncoding = 2550137088; + +const int NSUTF32LittleEndianStringEncoding = 2617245952; + +const int NSProprietaryStringEncoding = 65536; + +const int NS_BLOCKS_AVAILABLE = 1; + +const int __COREFOUNDATION_CFAVAILABILITY__ = 1; + +const int __CF_ENUM_FIXED_IS_AVAILABLE = 1; + +const double NSFoundationVersionNumber10_0 = 397.4; + +const double NSFoundationVersionNumber10_1 = 425.0; + +const double NSFoundationVersionNumber10_1_1 = 425.0; + +const double NSFoundationVersionNumber10_1_2 = 425.0; + +const double NSFoundationVersionNumber10_1_3 = 425.0; + +const double NSFoundationVersionNumber10_1_4 = 425.0; + +const double NSFoundationVersionNumber10_2 = 462.0; + +const double NSFoundationVersionNumber10_2_1 = 462.0; + +const double NSFoundationVersionNumber10_2_2 = 462.0; + +const double NSFoundationVersionNumber10_2_3 = 462.0; + +const double NSFoundationVersionNumber10_2_4 = 462.0; + +const double NSFoundationVersionNumber10_2_5 = 462.0; + +const double NSFoundationVersionNumber10_2_6 = 462.0; + +const double NSFoundationVersionNumber10_2_7 = 462.7; + +const double NSFoundationVersionNumber10_2_8 = 462.7; + +const double NSFoundationVersionNumber10_3 = 500.0; + +const double NSFoundationVersionNumber10_3_1 = 500.0; + +const double NSFoundationVersionNumber10_3_2 = 500.3; + +const double NSFoundationVersionNumber10_3_3 = 500.54; + +const double NSFoundationVersionNumber10_3_4 = 500.56; + +const double NSFoundationVersionNumber10_3_5 = 500.56; + +const double NSFoundationVersionNumber10_3_6 = 500.56; + +const double NSFoundationVersionNumber10_3_7 = 500.56; + +const double NSFoundationVersionNumber10_3_8 = 500.56; + +const double NSFoundationVersionNumber10_3_9 = 500.58; + +const double NSFoundationVersionNumber10_4 = 567.0; + +const double NSFoundationVersionNumber10_4_1 = 567.0; + +const double NSFoundationVersionNumber10_4_2 = 567.12; + +const double NSFoundationVersionNumber10_4_3 = 567.21; + +const double NSFoundationVersionNumber10_4_4_Intel = 567.23; + +const double NSFoundationVersionNumber10_4_4_PowerPC = 567.21; + +const double NSFoundationVersionNumber10_4_5 = 567.25; + +const double NSFoundationVersionNumber10_4_6 = 567.26; + +const double NSFoundationVersionNumber10_4_7 = 567.27; + +const double NSFoundationVersionNumber10_4_8 = 567.28; + +const double NSFoundationVersionNumber10_4_9 = 567.29; + +const double NSFoundationVersionNumber10_4_10 = 567.29; + +const double NSFoundationVersionNumber10_4_11 = 567.36; + +const double NSFoundationVersionNumber10_5 = 677.0; + +const double NSFoundationVersionNumber10_5_1 = 677.1; + +const double NSFoundationVersionNumber10_5_2 = 677.15; + +const double NSFoundationVersionNumber10_5_3 = 677.19; + +const double NSFoundationVersionNumber10_5_4 = 677.19; + +const double NSFoundationVersionNumber10_5_5 = 677.21; + +const double NSFoundationVersionNumber10_5_6 = 677.22; + +const double NSFoundationVersionNumber10_5_7 = 677.24; + +const double NSFoundationVersionNumber10_5_8 = 677.26; + +const double NSFoundationVersionNumber10_6 = 751.0; + +const double NSFoundationVersionNumber10_6_1 = 751.0; + +const double NSFoundationVersionNumber10_6_2 = 751.14; + +const double NSFoundationVersionNumber10_6_3 = 751.21; + +const double NSFoundationVersionNumber10_6_4 = 751.29; + +const double NSFoundationVersionNumber10_6_5 = 751.42; + +const double NSFoundationVersionNumber10_6_6 = 751.53; + +const double NSFoundationVersionNumber10_6_7 = 751.53; + +const double NSFoundationVersionNumber10_6_8 = 751.62; + +const double NSFoundationVersionNumber10_7 = 833.1; + +const double NSFoundationVersionNumber10_7_1 = 833.1; + +const double NSFoundationVersionNumber10_7_2 = 833.2; + +const double NSFoundationVersionNumber10_7_3 = 833.24; + +const double NSFoundationVersionNumber10_7_4 = 833.25; + +const double NSFoundationVersionNumber10_8 = 945.0; + +const double NSFoundationVersionNumber10_8_1 = 945.0; + +const double NSFoundationVersionNumber10_8_2 = 945.11; + +const double NSFoundationVersionNumber10_8_3 = 945.16; + +const double NSFoundationVersionNumber10_8_4 = 945.18; + +const int NSFoundationVersionNumber10_9 = 1056; + +const int NSFoundationVersionNumber10_9_1 = 1056; + +const double NSFoundationVersionNumber10_9_2 = 1056.13; + +const double NSFoundationVersionNumber10_10 = 1151.16; + +const double NSFoundationVersionNumber10_10_1 = 1151.16; + +const double NSFoundationVersionNumber10_10_2 = 1152.14; + +const double NSFoundationVersionNumber10_10_3 = 1153.2; + +const double NSFoundationVersionNumber10_10_4 = 1153.2; + +const int NSFoundationVersionNumber10_10_5 = 1154; + +const int NSFoundationVersionNumber10_10_Max = 1199; + +const int NSFoundationVersionNumber10_11 = 1252; + +const double NSFoundationVersionNumber10_11_1 = 1255.1; + +const double NSFoundationVersionNumber10_11_2 = 1256.1; + +const double NSFoundationVersionNumber10_11_3 = 1256.1; + +const int NSFoundationVersionNumber10_11_4 = 1258; + +const int NSFoundationVersionNumber10_11_Max = 1299; + +const int __COREFOUNDATION_CFBASE__ = 1; + +const int TRUE = 1; + +const int FALSE = 0; + +const double kCFCoreFoundationVersionNumber10_0 = 196.4; + +const double kCFCoreFoundationVersionNumber10_0_3 = 196.5; + +const double kCFCoreFoundationVersionNumber10_1 = 226.0; + +const double kCFCoreFoundationVersionNumber10_1_1 = 226.0; + +const double kCFCoreFoundationVersionNumber10_1_2 = 227.2; + +const double kCFCoreFoundationVersionNumber10_1_3 = 227.2; + +const double kCFCoreFoundationVersionNumber10_1_4 = 227.3; + +const double kCFCoreFoundationVersionNumber10_2 = 263.0; + +const double kCFCoreFoundationVersionNumber10_2_1 = 263.1; + +const double kCFCoreFoundationVersionNumber10_2_2 = 263.1; + +const double kCFCoreFoundationVersionNumber10_2_3 = 263.3; + +const double kCFCoreFoundationVersionNumber10_2_4 = 263.3; + +const double kCFCoreFoundationVersionNumber10_2_5 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_6 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_7 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_8 = 263.5; + +const double kCFCoreFoundationVersionNumber10_3 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_1 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_2 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_3 = 299.3; + +const double kCFCoreFoundationVersionNumber10_3_4 = 299.31; + +const double kCFCoreFoundationVersionNumber10_3_5 = 299.31; + +const double kCFCoreFoundationVersionNumber10_3_6 = 299.32; + +const double kCFCoreFoundationVersionNumber10_3_7 = 299.33; + +const double kCFCoreFoundationVersionNumber10_3_8 = 299.33; + +const double kCFCoreFoundationVersionNumber10_3_9 = 299.35; + +const double kCFCoreFoundationVersionNumber10_4 = 368.0; + +const double kCFCoreFoundationVersionNumber10_4_1 = 368.1; + +const double kCFCoreFoundationVersionNumber10_4_2 = 368.11; + +const double kCFCoreFoundationVersionNumber10_4_3 = 368.18; + +const double kCFCoreFoundationVersionNumber10_4_4_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_4_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_5_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_5_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_6_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_6_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_7 = 368.27; + +const double kCFCoreFoundationVersionNumber10_4_8 = 368.27; + +const double kCFCoreFoundationVersionNumber10_4_9 = 368.28; + +const double kCFCoreFoundationVersionNumber10_4_10 = 368.28; + +const double kCFCoreFoundationVersionNumber10_4_11 = 368.31; + +const double kCFCoreFoundationVersionNumber10_5 = 476.0; + +const double kCFCoreFoundationVersionNumber10_5_1 = 476.0; + +const double kCFCoreFoundationVersionNumber10_5_2 = 476.1; + +const double kCFCoreFoundationVersionNumber10_5_3 = 476.13; + +const double kCFCoreFoundationVersionNumber10_5_4 = 476.14; + +const double kCFCoreFoundationVersionNumber10_5_5 = 476.15; + +const double kCFCoreFoundationVersionNumber10_5_6 = 476.17; + +const double kCFCoreFoundationVersionNumber10_5_7 = 476.18; + +const double kCFCoreFoundationVersionNumber10_5_8 = 476.19; + +const double kCFCoreFoundationVersionNumber10_6 = 550.0; + +const double kCFCoreFoundationVersionNumber10_6_1 = 550.0; + +const double kCFCoreFoundationVersionNumber10_6_2 = 550.13; + +const double kCFCoreFoundationVersionNumber10_6_3 = 550.19; + +const double kCFCoreFoundationVersionNumber10_6_4 = 550.29; + +const double kCFCoreFoundationVersionNumber10_6_5 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_6 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_7 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_8 = 550.43; + +const double kCFCoreFoundationVersionNumber10_7 = 635.0; + +const double kCFCoreFoundationVersionNumber10_7_1 = 635.0; + +const double kCFCoreFoundationVersionNumber10_7_2 = 635.15; + +const double kCFCoreFoundationVersionNumber10_7_3 = 635.19; + +const double kCFCoreFoundationVersionNumber10_7_4 = 635.21; + +const double kCFCoreFoundationVersionNumber10_7_5 = 635.21; + +const double kCFCoreFoundationVersionNumber10_8 = 744.0; + +const double kCFCoreFoundationVersionNumber10_8_1 = 744.0; + +const double kCFCoreFoundationVersionNumber10_8_2 = 744.12; + +const double kCFCoreFoundationVersionNumber10_8_3 = 744.18; + +const double kCFCoreFoundationVersionNumber10_8_4 = 744.19; + +const double kCFCoreFoundationVersionNumber10_9 = 855.11; + +const double kCFCoreFoundationVersionNumber10_9_1 = 855.11; + +const double kCFCoreFoundationVersionNumber10_9_2 = 855.14; + +const double kCFCoreFoundationVersionNumber10_10 = 1151.16; + +const double kCFCoreFoundationVersionNumber10_10_1 = 1151.16; + +const int kCFCoreFoundationVersionNumber10_10_2 = 1152; + +const double kCFCoreFoundationVersionNumber10_10_3 = 1153.18; + +const double kCFCoreFoundationVersionNumber10_10_4 = 1153.18; + +const double kCFCoreFoundationVersionNumber10_10_5 = 1153.18; + +const int kCFCoreFoundationVersionNumber10_10_Max = 1199; + +const int kCFCoreFoundationVersionNumber10_11 = 1253; + +const double kCFCoreFoundationVersionNumber10_11_1 = 1255.1; + +const double kCFCoreFoundationVersionNumber10_11_2 = 1256.14; + +const double kCFCoreFoundationVersionNumber10_11_3 = 1256.14; + +const double kCFCoreFoundationVersionNumber10_11_4 = 1258.1; + +const int kCFCoreFoundationVersionNumber10_11_Max = 1299; + +const int ISA_PTRAUTH_DISCRIMINATOR = 27361; + +const int NSMaximumStringLength = 2147483646; + +const int NS_UNICHAR_IS_EIGHT_BIT = 0; diff --git a/pkgs/ffigen/test/native_objc_test/string_config.yaml b/pkgs/ffigen/test/native_objc_test/string_config.yaml new file mode 100644 index 0000000000..9f387a95b2 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/string_config.yaml @@ -0,0 +1,12 @@ +name: StringTestObjCLibrary +description: 'Tests calling Objective-C string methods' +language: objc +output: 'test/native_objc_test/string_bindings.dart' +functions: + exclude: + - '.*' +headers: + entry-points: + - 'test/native_objc_test/string_test.m' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/string_test.dart b/pkgs/ffigen/test/native_objc_test/string_test.dart new file mode 100644 index 0000000000..27c6359040 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/string_test.dart @@ -0,0 +1,48 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:test/test.dart'; +import '../test_utils.dart'; +import 'string_bindings.dart'; + +void main() { + late StringTestObjCLibrary lib; + + group('string', () { + setUpAll(() { + logWarnings(); + final dylib = File('test/native_objc_test/string_test.dylib'); + verifySetupFile(dylib); + lib = StringTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); + }); + + // TODO(#329): Add 'Embedded\u0000Null'. + for (final s in ['Hello', '🇵🇬']) { + test('NSString to/from Dart string [$s]', () { + final ns1 = NSString(lib, s); + expect(ns1.toString(), s); + expect(ns1.length, s.length); + + final ns2 = s.toNSString(lib); + expect(ns2.toString(), s); + expect(ns2.length, s.length); + }); + } + + test('strings usable', () { + final str1 = 'Hello'.toNSString(lib); + final str2 = 'World!'.toNSString(lib); + + final str3 = StringUtil.strConcat_with(lib, str1, str2); + expect(str3.length, 11); + expect(str3.toString(), "HelloWorld!"); + }); + }); +} diff --git a/pkgs/ffigen/test/native_objc_test/string_test.m b/pkgs/ffigen/test/native_objc_test/string_test.m new file mode 100644 index 0000000000..5add18c50e --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/string_test.m @@ -0,0 +1,13 @@ +#import +#import + +// TODO(#309): strConcat should just be a static function. +@interface StringUtil : NSObject {} ++ (NSString*)strConcat:(NSString*)a with:(NSString*)b; +@end + +@implementation StringUtil ++ (NSString*)strConcat:(NSString*)a with:(NSString*)b { + return [a stringByAppendingString:b]; +} +@end diff --git a/pkgs/ffigen/test/regen.dart b/pkgs/ffigen/test/regen.dart index 1bc2021dc5..7d78b6dbc1 100644 --- a/pkgs/ffigen/test/regen.dart +++ b/pkgs/ffigen/test/regen.dart @@ -74,6 +74,21 @@ Future main(List args) async { File('test/native_objc_test/native_objc_test_bindings.dart'), ); + await _regenConfig( + File('test/native_objc_test/method_config.yaml'), + File('test/native_objc_test/method_bindings.dart'), + ); + + await _regenConfig( + File('test/native_objc_test/property_config.yaml'), + File('test/native_objc_test/property_bindings.dart'), + ); + + await _regenConfig( + File('test/native_objc_test/string_config.yaml'), + File('test/native_objc_test/string_bindings.dart'), + ); + await _regenConfig(File('test/native_test/config.yaml'), File('test/native_test/native_test_bindings.dart')); From 5560f587f665241a8b0af9f24b86c802598568ac Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Tue, 19 Apr 2022 03:19:00 -0700 Subject: [PATCH 122/276] [ffigen] Update pubspec.yaml (#332) --- pkgs/ffigen/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 967ccdf3a6..a9b443c903 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -4,8 +4,8 @@ name: ffigen version: 5.0.0-dev.1 -homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. +repository: https://github.com/dart-lang/ffigen environment: sdk: '>=2.16.0-124.0.dev <3.0.0' From 4af99f995c2163f56f436284054da176515bdc9b Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Tue, 19 Apr 2022 09:16:24 -0700 Subject: [PATCH 123/276] [ffigen] Configurable filtering for ObjC interfaces (#313) * Configurable filtering for ObjC methods and interfaces * Revert unrelated fix * Add a test * Remove objc-methods config and improve testing * Fix readme * fmt --- pkgs/ffigen/README.md | 5 +- .../lib/src/config_provider/config.dart | 13 + .../lib/src/header_parser/includer.dart | 10 +- .../sub_parsers/objcinterfacedecl_parser.dart | 31 +- .../type_extractor/extractor.dart | 3 +- pkgs/ffigen/lib/src/strings.dart | 1 + .../_expected_objc_config_bindings.dart | 917 +++ .../header_parser_tests/objc_basic_types.h | 4 + .../test/header_parser_tests/objc_config.h | 12 + .../header_parser_tests/objc_config_test.dart | 55 + .../test/header_parser_tests/objc_interface.h | 4 + .../objc_interface_test.dart | 3 + pkgs/ffigen/test/native_objc_test/config.yaml | 4 + .../test/native_objc_test/native_objc_test.m | 4 + .../native_objc_test_bindings.dart | 6046 ++++------------- 15 files changed, 2254 insertions(+), 4858 deletions(-) create mode 100644 pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/objc_config.h create mode 100644 pkgs/ffigen/test/header_parser_tests/objc_config_test.dart diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 98c7f76cec..0655482829 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -184,7 +184,10 @@ compiler-opts-automatic: - + - - - - - @@ -504,9 +492,6 @@ language: 'objc'
    @@ -210,7 +210,7 @@ functions: # Removes '_' from beginning. '_(.*)': '$1' symbol-address: - # Used to expose symbol and typedef. + # Used to expose symbol address. include: - myFunc structs: @@ -265,6 +265,29 @@ typedefs: rename: # Removes '_' from beginning of a typedef. '_(.*)': '$1' +``` +
    functions -> expose-typedefsGenerate the typedefs to Native and Dart type of a function
    + Default: Inline types are used and no typedefs to Native/Dart + type are generated. +
    + +```yaml +functions: + expose-typedefs: + include: + # Match function name. + - 'myFunc' + # Do this to expose types for all function. + - '.*' + exclude: + # If you only use exclude, then everything + # not excluded is generated. + - 'dispose' ```
    functions -> leafSet isLeaf:true for functions.
    + Default: all functions are excluded. +
    + +```yaml +functions: + leaf: + include: + # Match function name. + - 'myFunc' + # Do this to set isLeaf:true for all functions. + - '.*' + exclude: + # If you only use exclude, then everything + # not excluded is generated. + - 'dispose' ```
    use-supported-typedefsShould automatically map typedefs, E.g uint8_t => Uint8, int16_t => Int16 etc.
    +
    Should automatically map typedefs, E.g uint8_t => Uint8, int16_t => Int16, size_t => Size etc.
    Default: true
    @@ -431,43 +433,54 @@ preamble: |
    typedef-mapMap typedefs to Native Types.
    Values can only be - Void, Uint8, Int8, Uint16, Int16, Uint32, Int32, Uint64, Int64, IntPtr, Float and Double. +
    library-importsSpecify library imports for use in type-map.

    + Note: ffi (dart:ffi) is already available as a predefined import.
    ```yaml -typedef-map: - 'my_custom_type': 'IntPtr' - 'size_t': 'Int64' +library-imports: + custom_lib: 'package:some_pkg/some_file.dart' ```
    size-mapSize of integers to use (in bytes).
    - The defaults (see example) may not be portable on all OS. - Do not change these unless absolutely sure. +
    type-mapMap types like integers, typedefs, structs, unions to any other type.

    + Sub-fields - typedefs, structs, unions, ints

    + lib must be specified in library-imports or be one of a predefined import.
    ```yaml -# These are optional and also default, -# Omitting any and the default -# will be used. -size-map: - char: 1 - unsigned char: 1 - short: 2 - unsigned short: 2 - int: 4 - unsigned int: 4 - long: 8 - unsigned long: 8 - long long: 8 - unsigned long long: 8 - enum: 4 +type-map: + 'native-types': # Targets native types. + 'char': + 'lib': 'pkg_ffi' # predefined import. + 'c-type': 'Char' + # For native-types dart-type can be be int, double or float + # but same otherwise. + 'dart-type': 'int' + 'int': + 'lib': 'custom_lib' + 'c-type': 'CustomType4' + 'dart-type': 'int' + 'typedefs': # Targets typedefs. + 'my_type1': + 'lib': 'custom_lib' + 'c-type': 'CustomType' + 'dart-type': 'CustomType' + 'structs': # Targets structs. + 'my_type2': + 'lib': 'custom_lib' + 'c-type': 'CustomType2' + 'dart-type': 'CustomType2' + 'unions': # Targets unions. + 'my_type3': + 'lib': 'custom_lib' + 'c-type': 'CustomType3' + 'dart-type': 'CustomType3' ```
    language + WARNING: Other language support is EXPERIMENTAL. The API may change + in a breaking way without notice. +

    + Choose the input langauge. Must be one of 'c', or 'objc'. Defaults to 'c'. +
    + +```yaml +language: 'objc' ```
    functions

    structs

    unions

    enums

    unnamed-enums

    macros

    globals
    + functions

    structs

    unions

    enums

    + unnamed-enums

    macros

    globals

    objcInterfaces +
    Filters for declarations.
    Default: all are included.

    Options -
    - Include/Exclude declarations.
    diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 29673a6629..0891c70e35 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -71,6 +71,10 @@ class Config { Declaration get typedefs => _typedefs; late Declaration _typedefs; + /// Declaration config for Objective C interfaces. + Declaration get objcInterfaces => _objcInterfaces; + late Declaration _objcInterfaces; + /// If generated bindings should be sorted alphabetically. bool get sort => _sort; late bool _sort; @@ -326,6 +330,15 @@ class Config { _typedefs = result as Declaration; }, ), + [strings.objcInterfaces]: Specification( + requirement: Requirement.no, + validator: declarationConfigValidator, + extractor: declarationConfigExtractor, + defaultValue: () => Declaration(), + extractedResult: (dynamic result) { + _objcInterfaces = result as Declaration; + }, + ), [strings.libraryImports]: Specification>( validator: libraryImportsValidator, extractor: libraryImportsExtractor, diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart index b2791f84d0..a9041a6123 100644 --- a/pkgs/ffigen/lib/src/header_parser/includer.dart +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -35,11 +35,6 @@ bool shouldIncludeFunc(String usr, String name) { usr, name, bindingsIndex.isSeenType, config.functionDecl.shouldInclude); } -bool shouldIncludeInterface(String usr, String name) { - // TODO(#279): Check config YAML. - return true; -} - bool shouldIncludeEnumClass(String usr, String name) { return _shouldIncludeDecl( usr, name, bindingsIndex.isSeenType, config.enumClassDecl.shouldInclude); @@ -65,6 +60,11 @@ bool shouldIncludeTypealias(String usr, String name) { usr, name, bindingsIndex.isSeenType, config.typedefs.shouldInclude); } +bool shouldIncludeObjCInterface(String usr, String name) { + return _shouldIncludeDecl( + usr, name, bindingsIndex.isSeenType, config.objcInterfaces.shouldInclude); +} + /// True if a cursor should be included based on headers config, used on root /// declarations. bool shouldIncludeRootCursor(String sourceFile) { diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index d90f56c35e..6d90c3d9e8 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -28,10 +28,16 @@ class _ParsedObjCMethod { final _interfaceStack = Stack<_ParsedObjCInterface>(); final _methodStack = Stack<_ParsedObjCMethod>(); -Type? parseObjCInterfaceDeclaration(clang_types.CXCursor cursor) { +Type? parseObjCInterfaceDeclaration( + clang_types.CXCursor cursor, { + + /// Option to ignore declaration filter (Useful in case of extracting + /// declarations when they are passed/returned by an included function.) + bool ignoreFilter = false, +}) { final itfUsr = cursor.usr(); final itfName = cursor.spelling(); - if (!shouldIncludeInterface(itfUsr, itfName)) { + if (!ignoreFilter && !shouldIncludeObjCInterface(itfUsr, itfName)) { return null; } @@ -42,8 +48,9 @@ Type? parseObjCInterfaceDeclaration(clang_types.CXCursor cursor) { 'Name: $name, ${cursor.completeStringRepr()}'); return ObjCInterface( - usr: itfUsr, originalName: name, - name: name, // TODO(#279): config.interfaceDecl.renameUsingConfig(name), + usr: itfUsr, + originalName: name, + name: config.objcInterfaces.renameUsingConfig(name), dartDoc: getCursorDocComment(cursor), builtInFunctions: objCBuiltInFunctions, ); @@ -118,10 +125,10 @@ void _parseProperty(clang_types.CXCursor cursor) { _logger.fine(' > Property: ' '$fieldType $fieldName ${cursor.completeStringRepr()}'); + final getterName = + clang.clang_Cursor_getObjCPropertyGetterName(cursor).toStringAndDispose(); final getter = ObjCMethod( - originalName: clang - .clang_Cursor_getObjCPropertyGetterName(cursor) - .toStringAndDispose(), + originalName: getterName, property: property, dartDoc: dartDoc, kind: ObjCMethodKind.propertyGetter, @@ -131,10 +138,11 @@ void _parseProperty(clang_types.CXCursor cursor) { itf.addMethod(getter); if (!isReadOnly) { + final setterName = clang + .clang_Cursor_getObjCPropertySetterName(cursor) + .toStringAndDispose(); final setter = ObjCMethod( - originalName: clang - .clang_Cursor_getObjCPropertySetterName(cursor) - .toStringAndDispose(), + originalName: setterName, property: property, dartDoc: dartDoc, kind: ObjCMethodKind.propertySetter, @@ -146,10 +154,11 @@ void _parseProperty(clang_types.CXCursor cursor) { } void _parseMethod(clang_types.CXCursor cursor) { + final methodName = cursor.spelling(); final isClassMethod = cursor.kind == clang_types.CXCursorKind.CXCursor_ObjCClassMethodDecl; final method = ObjCMethod( - originalName: cursor.spelling(), + originalName: methodName, dartDoc: getCursorDocComment(cursor), kind: ObjCMethodKind.method, isClass: isClassMethod, diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 7026c7a18c..de2a599bf6 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -201,7 +201,8 @@ _CreateTypeFromCursorResult _createTypeFromCursor(clang_types.CXType cxtype, return _CreateTypeFromCursorResult(enumClass); } case clang_types.CXTypeKind.CXType_ObjCInterface: - return _CreateTypeFromCursorResult(parseObjCInterfaceDeclaration(cursor)); + return _CreateTypeFromCursorResult( + parseObjCInterfaceDeclaration(cursor, ignoreFilter: ignoreFilter)); default: throw UnimplementedError('Unknown type: ${cxtype.completeStringRepr()}'); } diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index cc0c6c7e9d..8e138f8487 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -75,6 +75,7 @@ const unnamedEnums = 'unnamed-enums'; const globals = 'globals'; const macros = 'macros'; const typedefs = 'typedefs'; +const objcInterfaces = 'objc-interfaces'; // Sub-fields of Declarations. const include = 'include'; diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart new file mode 100644 index 0000000000..d43541e29f --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart @@ -0,0 +1,917 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; + +/// ObjC Config Test +class NativeLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + NativeLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NativeLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + ffi.Pointer _sel_registerName( + ffi.Pointer str, + ) { + return __sel_registerName( + str, + ); + } + + late final __sel_registerNamePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sel_registerName'); + late final __sel_registerName = __sel_registerNamePtr + .asFunction Function(ffi.Pointer)>(); + + ffi.Pointer _objc_getClass( + ffi.Pointer str, + ) { + return __objc_getClass( + str, + ); + } + + late final __objc_getClassPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('objc_getClass'); + late final __objc_getClass = __objc_getClassPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); + + void _objc_msgSend_0( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_0( + obj, + sel, + ); + } + + late final __objc_msgSend_0Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); + + instancetype _objc_msgSend_1( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1( + obj, + sel, + ); + } + + late final __objc_msgSend_1Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer)>(); + + instancetype _objc_msgSend_2( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_2( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_2Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>(); + + ffi.Pointer _objc_msgSend_3( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_3( + obj, + sel, + ); + } + + late final __objc_msgSend_3Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_4( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_4( + obj, + sel, + ); + } + + late final __objc_msgSend_4Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_5( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_5( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_5Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); + + ffi.Pointer _objc_msgSend_6( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_6( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_6Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); + + bool _objc_msgSend_7( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_7( + obj, + sel, + aSelector, + ) != + 0; + } + + late final __objc_msgSend_7Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + bool _objc_msgSend_8( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer protocol, + ) { + return __objc_msgSend_8( + obj, + sel, + protocol, + ) != + 0; + } + + late final __objc_msgSend_8Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + IMP _objc_msgSend_9( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_9( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_9Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + IMP _objc_msgSend_10( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_10( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_10Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_11( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_11( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_11Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_12( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_12( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_12Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_13( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anInvocation, + ) { + return __objc_msgSend_13( + obj, + sel, + anInvocation, + ); + } + + late final __objc_msgSend_13Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_14( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_14( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_14Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_15( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_15( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_15Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + bool _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_16( + obj, + sel, + ) != + 0; + } + + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + bool _objc_msgSend_17( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ) { + return __objc_msgSend_17( + obj, + sel, + aClass, + ) != + 0; + } + + late final __objc_msgSend_17Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + bool _objc_msgSend_18( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sel1, + ) { + return __objc_msgSend_18( + obj, + sel, + sel1, + ) != + 0; + } + + late final __objc_msgSend_18Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + bool _objc_msgSend_19( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sel1, + ) { + return __objc_msgSend_19( + obj, + sel, + sel1, + ) != + 0; + } + + late final __objc_msgSend_19Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_20( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_20( + obj, + sel, + ); + } + + late final __objc_msgSend_20Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_21( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_21( + obj, + sel, + ); + } + + late final __objc_msgSend_21Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_22( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_22( + obj, + sel, + ); + } + + late final __objc_msgSend_22Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_23( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cString, + int enc, + ) { + return __objc_msgSend_23( + obj, + sel, + cString, + enc, + ); + } + + late final __objc_msgSend_23Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + pkg_ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer _objc_msgSend_24( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_24( + obj, + sel, + ); + } + + late final __objc_msgSend_24Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_25( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_25( + obj, + sel, + ); + } + + late final __objc_msgSend_25Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +} + +ffi.Pointer _registerName(NativeLibrary _lib, String name) { + final cstr = name.toNativeUtf8(); + final sel = _lib._sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; +} + +ffi.Pointer _getClass(NativeLibrary _lib, String name) { + final cstr = name.toNativeUtf8(); + final clazz = _lib._objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; +} + +class _ObjCWrapper { + final ffi.Pointer _id; + final NativeLibrary _lib; + _ObjCWrapper._(this._id, this._lib); +} + +class Foo extends NSObject { + Foo._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); + + static ffi.Pointer? _class; + + static Foo castFrom(T other) { + return Foo._(other._id, other._lib); + } + + static ffi.Pointer? _sel_new1; + static Foo new1(NativeLibrary _lib) { + _class ??= _getClass(_lib, "Foo"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return Foo._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static Foo alloc(NativeLibrary _lib) { + _class ??= _getClass(_lib, "Foo"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return Foo._(_ret, _lib); + } +} + +class NSObject extends _ObjCWrapper { + NSObject._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); + + static ffi.Pointer? _class; + + static NSObject castFrom(T other) { + return NSObject._(other._id, other._lib); + } + + static ffi.Pointer? _sel_load; + static void load(NativeLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_load ??= _registerName(_lib, "load"); + _lib._objc_msgSend_0(_class!, _sel_load!); + } + + static ffi.Pointer? _sel_initialize; + static void initialize(NativeLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_initialize ??= _registerName(_lib, "initialize"); + _lib._objc_msgSend_0(_class!, _sel_initialize!); + } + + static ffi.Pointer? _sel_init; + NSObject init() { + _sel_init ??= _registerName(_lib, "init"); + final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_new1; + static NSObject new1(NativeLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_new1 ??= _registerName(_lib, "new"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_allocWithZone; + static NSObject allocWithZone(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_allocWithZone ??= _registerName(_lib, "allocWithZone:"); + final _ret = _lib._objc_msgSend_2(_class!, _sel_allocWithZone!, zone); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_alloc; + static NSObject alloc(NativeLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_alloc ??= _registerName(_lib, "alloc"); + final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_dealloc; + void dealloc() { + _sel_dealloc ??= _registerName(_lib, "dealloc"); + _lib._objc_msgSend_0(_id, _sel_dealloc!); + } + + static ffi.Pointer? _sel_finalize; + void finalize() { + _sel_finalize ??= _registerName(_lib, "finalize"); + _lib._objc_msgSend_0(_id, _sel_finalize!); + } + + static ffi.Pointer? _sel_copy; + NSObject copy() { + _sel_copy ??= _registerName(_lib, "copy"); + final _ret = _lib._objc_msgSend_3(_id, _sel_copy!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_mutableCopy; + NSObject mutableCopy() { + _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); + final _ret = _lib._objc_msgSend_4(_id, _sel_mutableCopy!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_copyWithZone; + static NSObject copyWithZone(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); + final _ret = _lib._objc_msgSend_5(_class!, _sel_copyWithZone!, zone); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_mutableCopyWithZone; + static NSObject mutableCopyWithZone( + NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); + final _ret = _lib._objc_msgSend_6(_class!, _sel_mutableCopyWithZone!, zone); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_instancesRespondToSelector; + static bool instancesRespondToSelector( + NativeLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instancesRespondToSelector ??= + _registerName(_lib, "instancesRespondToSelector:"); + return _lib._objc_msgSend_7( + _class!, _sel_instancesRespondToSelector!, aSelector); + } + + static ffi.Pointer? _sel_conformsToProtocol; + static bool conformsToProtocol(NativeLibrary _lib, NSObject protocol) { + _class ??= _getClass(_lib, "NSObject"); + _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); + return _lib._objc_msgSend_8( + _class!, _sel_conformsToProtocol!, protocol._id); + } + + static ffi.Pointer? _sel_methodForSelector; + IMP methodForSelector(ffi.Pointer aSelector) { + _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); + return _lib._objc_msgSend_9(_id, _sel_methodForSelector!, aSelector); + } + + static ffi.Pointer? _sel_instanceMethodForSelector; + static IMP instanceMethodForSelector( + NativeLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instanceMethodForSelector ??= + _registerName(_lib, "instanceMethodForSelector:"); + return _lib._objc_msgSend_10( + _class!, _sel_instanceMethodForSelector!, aSelector); + } + + static ffi.Pointer? _sel_doesNotRecognizeSelector; + void doesNotRecognizeSelector(ffi.Pointer aSelector) { + _sel_doesNotRecognizeSelector ??= + _registerName(_lib, "doesNotRecognizeSelector:"); + _lib._objc_msgSend_11(_id, _sel_doesNotRecognizeSelector!, aSelector); + } + + static ffi.Pointer? _sel_forwardingTargetForSelector; + NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + _sel_forwardingTargetForSelector ??= + _registerName(_lib, "forwardingTargetForSelector:"); + final _ret = _lib._objc_msgSend_12( + _id, _sel_forwardingTargetForSelector!, aSelector); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_forwardInvocation; + void forwardInvocation(NSObject anInvocation) { + _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); + _lib._objc_msgSend_13(_id, _sel_forwardInvocation!, anInvocation._id); + } + + static ffi.Pointer? _sel_methodSignatureForSelector; + NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + _sel_methodSignatureForSelector ??= + _registerName(_lib, "methodSignatureForSelector:"); + final _ret = + _lib._objc_msgSend_14(_id, _sel_methodSignatureForSelector!, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static ffi.Pointer? _sel_instanceMethodSignatureForSelector; + static NSMethodSignature instanceMethodSignatureForSelector( + NativeLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instanceMethodSignatureForSelector ??= + _registerName(_lib, "instanceMethodSignatureForSelector:"); + final _ret = _lib._objc_msgSend_15( + _class!, _sel_instanceMethodSignatureForSelector!, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static ffi.Pointer? _sel_allowsWeakReference; + bool allowsWeakReference() { + _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); + return _lib._objc_msgSend_16(_id, _sel_allowsWeakReference!); + } + + static ffi.Pointer? _sel_retainWeakReference; + bool retainWeakReference() { + _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); + return _lib._objc_msgSend_16(_id, _sel_retainWeakReference!); + } + + static ffi.Pointer? _sel_isSubclassOfClass; + static bool isSubclassOfClass(NativeLibrary _lib, NSObject aClass) { + _class ??= _getClass(_lib, "NSObject"); + _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); + return _lib._objc_msgSend_17(_class!, _sel_isSubclassOfClass!, aClass._id); + } + + static ffi.Pointer? _sel_resolveClassMethod; + static bool resolveClassMethod(NativeLibrary _lib, ffi.Pointer sel) { + _class ??= _getClass(_lib, "NSObject"); + _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); + return _lib._objc_msgSend_18(_class!, _sel_resolveClassMethod!, sel); + } + + static ffi.Pointer? _sel_resolveInstanceMethod; + static bool resolveInstanceMethod( + NativeLibrary _lib, ffi.Pointer sel) { + _class ??= _getClass(_lib, "NSObject"); + _sel_resolveInstanceMethod ??= + _registerName(_lib, "resolveInstanceMethod:"); + return _lib._objc_msgSend_19(_class!, _sel_resolveInstanceMethod!, sel); + } + + static ffi.Pointer? _sel_hash; + static int hash(NativeLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_hash ??= _registerName(_lib, "hash"); + return _lib._objc_msgSend_20(_class!, _sel_hash!); + } + + static ffi.Pointer? _sel_superclass; + static NSObject superclass(NativeLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_superclass ??= _registerName(_lib, "superclass"); + final _ret = _lib._objc_msgSend_21(_class!, _sel_superclass!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_class1; + static NSObject class1(NativeLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_class1 ??= _registerName(_lib, "class"); + final _ret = _lib._objc_msgSend_22(_class!, _sel_class1!); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_description; + static NSString description(NativeLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_description ??= _registerName(_lib, "description"); + final _ret = _lib._objc_msgSend_25(_class!, _sel_description!); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_debugDescription; + static NSString debugDescription(NativeLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_debugDescription ??= _registerName(_lib, "debugDescription"); + final _ret = _lib._objc_msgSend_25(_class!, _sel_debugDescription!); + return NSString._(_ret, _lib); + } +} + +typedef instancetype = ffi.Pointer; + +class ObjCObject extends ffi.Opaque {} + +class _NSZone extends ffi.Opaque {} + +class ObjCSel extends ffi.Opaque {} + +typedef IMP = ffi.Pointer>; + +class NSMethodSignature extends _ObjCWrapper { + NSMethodSignature._(ffi.Pointer id, NativeLibrary lib) + : super._(id, lib); + + static ffi.Pointer? _class; + + static NSMethodSignature castFrom(T other) { + return NSMethodSignature._(other._id, other._lib); + } +} + +typedef NSUInteger = pkg_ffi.UnsignedLong; + +class NSString extends _ObjCWrapper { + NSString._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); + + static ffi.Pointer? _class; + + static NSString castFrom(T other) { + return NSString._(other._id, other._lib); + } + + factory NSString(NativeLibrary _lib, String str) { + final cstr = str.toNativeUtf8(); + final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + pkg_ffi.calloc.free(cstr); + return nsstr; + } + + @override + String toString() => UTF8String().cast().toDartString(); + + static ffi.Pointer? _sel_stringWithCString_encoding; + static NSString stringWithCString_encoding( + NativeLibrary _lib, ffi.Pointer cString, int enc) { + _class ??= _getClass(_lib, "NSString"); + _sel_stringWithCString_encoding ??= + _registerName(_lib, "stringWithCString:encoding:"); + final _ret = _lib._objc_msgSend_23( + _class!, _sel_stringWithCString_encoding!, cString, enc); + return NSString._(_ret, _lib); + } + + static ffi.Pointer? _sel_UTF8String; + ffi.Pointer UTF8String() { + _sel_UTF8String ??= _registerName(_lib, "UTF8String"); + return _lib._objc_msgSend_24(_id, _sel_UTF8String!); + } +} + +extension StringToNSString on String { + NSString toNSString(NativeLibrary lib) => NSString(lib, this); +} diff --git a/pkgs/ffigen/test/header_parser_tests/objc_basic_types.h b/pkgs/ffigen/test/header_parser_tests/objc_basic_types.h index c8d4f311a7..f2e5125263 100644 --- a/pkgs/ffigen/test/header_parser_tests/objc_basic_types.h +++ b/pkgs/ffigen/test/header_parser_tests/objc_basic_types.h @@ -1,3 +1,7 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + struct Foo { BOOL someBool; id anId; diff --git a/pkgs/ffigen/test/header_parser_tests/objc_config.h b/pkgs/ffigen/test/header_parser_tests/objc_config.h new file mode 100644 index 0000000000..6d3685e0b7 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/objc_config.h @@ -0,0 +1,12 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +@interface Foo : NSObject {} +@end + +@interface Excluded : NSObject {} +@end + +@interface _Renamed : NSObject {} +@end diff --git a/pkgs/ffigen/test/header_parser_tests/objc_config_test.dart b/pkgs/ffigen/test/header_parser_tests/objc_config_test.dart new file mode 100644 index 0000000000..03d608ae04 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/objc_config_test.dart @@ -0,0 +1,55 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; + +import '../test_utils.dart'; + +late Library actual; +void main() { + group('objc_config_test', () { + setUpAll(() { + logWarnings(Level.SEVERE); + actual = parser.parse( + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'ObjC Config Test' +${strings.output}: 'unused' +${strings.language}: '${strings.langObjC}' +${strings.headers}: + ${strings.entryPoints}: + - 'test/header_parser_tests/objc_config.h' +${strings.objcInterfaces}: + ${strings.include}: + - 'Foo' + ${strings.exclude}: + - 'Excluded' + ${strings.rename}: + '_(.*)': '\$1' +''') as yaml.YamlMap), + ); + }); + test('Expected bindings', () { + matchLibraryWithExpected(actual, [ + 'test', + 'debug_generated', + 'header_parser_objc_config_test_output.dart' + ], [ + 'test', + 'header_parser_tests', + 'expected_bindings', + '_expected_objc_config_bindings.dart' + ]); + }); + }); +} diff --git a/pkgs/ffigen/test/header_parser_tests/objc_interface.h b/pkgs/ffigen/test/header_parser_tests/objc_interface.h index 9af0352ca6..cf9f5b2b40 100644 --- a/pkgs/ffigen/test/header_parser_tests/objc_interface.h +++ b/pkgs/ffigen/test/header_parser_tests/objc_interface.h @@ -1,3 +1,7 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + // This is the Foo interface. @interface Foo : NSObject { // This is an instance variable. They are private, so are ignored. diff --git a/pkgs/ffigen/test/header_parser_tests/objc_interface_test.dart b/pkgs/ffigen/test/header_parser_tests/objc_interface_test.dart index b614f3d8a6..5d77f874eb 100644 --- a/pkgs/ffigen/test/header_parser_tests/objc_interface_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/objc_interface_test.dart @@ -29,6 +29,9 @@ ${strings.language}: '${strings.langObjC}' ${strings.headers}: ${strings.entryPoints}: - 'test/header_parser_tests/objc_interface.h' +${strings.objcInterfaces}: + ${strings.include}: + - 'Foo' ''') as yaml.YamlMap), ); }); diff --git a/pkgs/ffigen/test/native_objc_test/config.yaml b/pkgs/ffigen/test/native_objc_test/config.yaml index 1083214f64..c111fca32d 100644 --- a/pkgs/ffigen/test/native_objc_test/config.yaml +++ b/pkgs/ffigen/test/native_objc_test/config.yaml @@ -10,6 +10,10 @@ name: NativeObjCLibrary description: 'Native Objective C test' language: objc output: 'test/native_objc_test/native_objc_test_bindings.dart' +objc-interfaces: + include: + - 'Foo' + - 'StringUtil' functions: exclude: - '.*' diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test.m b/pkgs/ffigen/test/native_objc_test/native_objc_test.m index ab7018eb3d..912803be31 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test.m +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test.m @@ -1,3 +1,7 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + #import #import diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart index ebcd7c673c..b4c7fac470 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart @@ -107,4470 +107,1100 @@ class NativeObjCLibrary { set kCFAllocatorUseContext(CFAllocatorRef value) => _kCFAllocatorUseContext.value = value; - ffi.Pointer _sel_registerName( - ffi.Pointer str, - ) { - return __sel_registerName( - str, - ); - } - - late final __sel_registerNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sel_registerName'); - late final __sel_registerName = __sel_registerNamePtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _objc_getClass( - ffi.Pointer str, - ) { - return __objc_getClass( - str, - ); - } - - late final __objc_getClassPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('objc_getClass'); - late final __objc_getClass = __objc_getClassPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - void _objc_msgSend_0( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_0( - obj, - sel, - ); - } - - late final __objc_msgSend_0Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - instancetype _objc_msgSend_1( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1( - obj, - sel, - ); - } - - late final __objc_msgSend_1Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer)>(); - - instancetype _objc_msgSend_2( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_2( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_2Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>(); - - ffi.Pointer _objc_msgSend_3( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_3( - obj, - sel, - ); - } - - late final __objc_msgSend_3Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_4( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_4( - obj, - sel, - ); - } - - late final __objc_msgSend_4Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_5( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_5( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_5Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); - - ffi.Pointer _objc_msgSend_6( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_6( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_6Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); - - bool _objc_msgSend_7( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_7( - obj, - sel, - aSelector, - ) != - 0; - } - - late final __objc_msgSend_7Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - bool _objc_msgSend_8( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer protocol, - ) { - return __objc_msgSend_8( - obj, - sel, - protocol, - ) != - 0; - } - - late final __objc_msgSend_8Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - IMP _objc_msgSend_9( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_9( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_9Ptr = _lookup< - ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - IMP _objc_msgSend_10( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_10( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_10Ptr = _lookup< - ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_11( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_11( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_11Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_12( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_12( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_12Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_13( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anInvocation, - ) { - return __objc_msgSend_13( - obj, - sel, - anInvocation, - ); - } - - late final __objc_msgSend_13Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_14( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_14( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_14Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_15( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_15( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_15Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - bool _objc_msgSend_16( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_16( - obj, - sel, - ) != - 0; - } - - late final __objc_msgSend_16Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - bool _objc_msgSend_17( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aClass, - ) { - return __objc_msgSend_17( - obj, - sel, - aClass, - ) != - 0; - } - - late final __objc_msgSend_17Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - bool _objc_msgSend_18( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer sel1, - ) { - return __objc_msgSend_18( - obj, - sel, - sel1, - ) != - 0; - } - - late final __objc_msgSend_18Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - bool _objc_msgSend_19( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer sel1, - ) { - return __objc_msgSend_19( - obj, - sel, - sel1, - ) != - 0; - } - - late final __objc_msgSend_19Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int _objc_msgSend_20( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_20( - obj, - sel, - ); - } - - late final __objc_msgSend_20Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_21( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_21( - obj, - sel, - ); - } - - late final __objc_msgSend_21Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_22( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_22( - obj, - sel, - ); - } - - late final __objc_msgSend_22Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int _objc_msgSend_23( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ) { - return __objc_msgSend_23( - obj, - sel, - index, - ); - } - - late final __objc_msgSend_23Ptr = _lookup< - ffi.NativeFunction< - unichar Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - instancetype _objc_msgSend_24( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_24( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_24Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_25( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cString, - int enc, - ) { - return __objc_msgSend_25( - obj, - sel, - cString, - enc, - ); - } - - late final __objc_msgSend_25Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer _objc_msgSend_26( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_26( - obj, - sel, - ); - } - - late final __objc_msgSend_26Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_27( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_27( - obj, - sel, - ); - } - - late final __objc_msgSend_27Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_28( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - int size, - ) { - return __objc_msgSend_28( - obj, - sel, - value, - size, - ); - } - - late final __objc_msgSend_28Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_28 = __objc_msgSend_28Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - ffi.Pointer _objc_msgSend_29( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_29( - obj, - sel, - ); - } - - late final __objc_msgSend_29Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_29 = __objc_msgSend_29Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - instancetype _objc_msgSend_30( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ffi.Pointer type, - ) { - return __objc_msgSend_30( - obj, - sel, - value, - type, - ); - } - - late final __objc_msgSend_30Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_30 = __objc_msgSend_30Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - instancetype _objc_msgSend_31( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_31( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_31Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_31 = __objc_msgSend_31Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - instancetype _objc_msgSend_32( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_32( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_32Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_32 = __objc_msgSend_32Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_33( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_33( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_33Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Char)>>('objc_msgSend'); - late final __objc_msgSend_33 = __objc_msgSend_33Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer _objc_msgSend_34( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_34( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_34Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedChar)>>('objc_msgSend'); - late final __objc_msgSend_34 = __objc_msgSend_34Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer _objc_msgSend_35( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_35( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_35Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Short)>>('objc_msgSend'); - late final __objc_msgSend_35 = __objc_msgSend_35Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer _objc_msgSend_36( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_36( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_36Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedShort)>>('objc_msgSend'); - late final __objc_msgSend_36 = __objc_msgSend_36Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer _objc_msgSend_37( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_37( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_37Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Int)>>('objc_msgSend'); - late final __objc_msgSend_37 = __objc_msgSend_37Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer _objc_msgSend_38( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_38( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_38Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_38 = __objc_msgSend_38Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer _objc_msgSend_39( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_39( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_39Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Long)>>('objc_msgSend'); - late final __objc_msgSend_39 = __objc_msgSend_39Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer _objc_msgSend_40( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_40( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_40Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_40 = __objc_msgSend_40Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer _objc_msgSend_41( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_41( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_41Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.LongLong)>>('objc_msgSend'); - late final __objc_msgSend_41 = __objc_msgSend_41Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer _objc_msgSend_42( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_42( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_42Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedLongLong)>>('objc_msgSend'); - late final __objc_msgSend_42 = __objc_msgSend_42Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer _objc_msgSend_43( - ffi.Pointer obj, - ffi.Pointer sel, - double value, - ) { - return __objc_msgSend_43( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_43Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Float)>>('objc_msgSend'); - late final __objc_msgSend_43 = __objc_msgSend_43Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); - - ffi.Pointer _objc_msgSend_44( - ffi.Pointer obj, - ffi.Pointer sel, - double value, - ) { - return __objc_msgSend_44( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_44Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_44 = __objc_msgSend_44Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); - - ffi.Pointer _objc_msgSend_45( - ffi.Pointer obj, - ffi.Pointer sel, - bool value, - ) { - return __objc_msgSend_45( - obj, - sel, - value ? 1 : 0, - ); - } - - late final __objc_msgSend_45Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_45 = __objc_msgSend_45Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer _objc_msgSend_46( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_46( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_46Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_46 = __objc_msgSend_46Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer _objc_msgSend_47( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_47( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_47Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_47 = __objc_msgSend_47Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - int _objc_msgSend_48( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_48( - obj, - sel, - ); - } - - late final __objc_msgSend_48Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.Char Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_48 = __objc_msgSend_48Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int _objc_msgSend_49( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_49( - obj, - sel, - ); - } - - late final __objc_msgSend_49Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.UnsignedChar Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_49 = __objc_msgSend_49Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int _objc_msgSend_50( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_50( - obj, - sel, - ); - } - - late final __objc_msgSend_50Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.Short Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_50 = __objc_msgSend_50Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int _objc_msgSend_51( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_51( - obj, - sel, - ); - } - - late final __objc_msgSend_51Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.UnsignedShort Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_51 = __objc_msgSend_51Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int _objc_msgSend_52( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_52( - obj, - sel, - ); - } - - late final __objc_msgSend_52Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_52 = __objc_msgSend_52Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int _objc_msgSend_53( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_53( - obj, - sel, - ); - } - - late final __objc_msgSend_53Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.UnsignedInt Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_53 = __objc_msgSend_53Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int _objc_msgSend_54( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_54( - obj, - sel, - ); - } - - late final __objc_msgSend_54Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.Long Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int _objc_msgSend_55( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_55( - obj, - sel, - ); - } - - late final __objc_msgSend_55Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.UnsignedLong Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_55 = __objc_msgSend_55Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int _objc_msgSend_56( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_56( - obj, - sel, - ); - } - - late final __objc_msgSend_56Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.LongLong Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_56 = __objc_msgSend_56Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int _objc_msgSend_57( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_57( - obj, - sel, - ); - } - - late final __objc_msgSend_57Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.UnsignedLongLong Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_57 = __objc_msgSend_57Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - double _objc_msgSend_58( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_58( - obj, - sel, - ); - } - - late final __objc_msgSend_58Ptr = _lookup< - ffi.NativeFunction< - ffi.Float Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_58 = __objc_msgSend_58Ptr.asFunction< - double Function(ffi.Pointer, ffi.Pointer)>(); - - double _objc_msgSend_59( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_59( - obj, - sel, - ); - } - - late final __objc_msgSend_59Ptr = _lookup< - ffi.NativeFunction< - ffi.Double Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< - double Function(ffi.Pointer, ffi.Pointer)>(); - - int _objc_msgSend_60( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_60( - obj, - sel, - ); - } - - late final __objc_msgSend_60Ptr = _lookup< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_61( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_61( - obj, - sel, - ); - } - - late final __objc_msgSend_61Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_61 = __objc_msgSend_61Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int _objc_msgSend_62( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer otherNumber, - ) { - return __objc_msgSend_62( - obj, - sel, - otherNumber, - ); - } - - late final __objc_msgSend_62Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - bool _objc_msgSend_63( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer number, - ) { - return __objc_msgSend_63( - obj, - sel, - number, - ) != - 0; - } - - late final __objc_msgSend_63Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_63 = __objc_msgSend_63Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_64( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer locale, - ) { - return __objc_msgSend_64( - obj, - sel, - locale, - ); - } - - late final __objc_msgSend_64Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_64 = __objc_msgSend_64Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_65( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_65( - obj, - sel, - ); - } - - late final __objc_msgSend_65Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_65 = __objc_msgSend_65Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_66( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_66( - obj, - sel, - ); - } - - late final __objc_msgSend_66Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_66 = __objc_msgSend_66Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int _objc_msgSend_67( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_67( - obj, - sel, - ); - } - - late final __objc_msgSend_67Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_67 = __objc_msgSend_67Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_68( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_68( - obj, - sel, - ); - } - - late final __objc_msgSend_68Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_68 = __objc_msgSend_68Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - instancetype _objc_msgSend_69( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - int type, - int index, - ) { - return __objc_msgSend_69( - obj, - sel, - anObject, - type, - index, - ); - } - - late final __objc_msgSend_69Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_69 = __objc_msgSend_69Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int)>(); - - instancetype _objc_msgSend_70( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - int type, - int index, - int associatedIndex, - ) { - return __objc_msgSend_70( - obj, - sel, - anObject, - type, - index, - associatedIndex, - ); - } - - late final __objc_msgSend_70Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - NSUInteger, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_70 = __objc_msgSend_70Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, int)>(); - - instancetype _objc_msgSend_71( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_71( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_71Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_71 = __objc_msgSend_71Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, int)>(); - - instancetype _objc_msgSend_72( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_72( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_72Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_72 = __objc_msgSend_72Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, NSRange)>(); - - instancetype _objc_msgSend_73( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexSet, - ) { - return __objc_msgSend_73( - obj, - sel, - indexSet, - ); - } - - late final __objc_msgSend_73Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_73 = __objc_msgSend_73Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - bool _objc_msgSend_74( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexSet, - ) { - return __objc_msgSend_74( - obj, - sel, - indexSet, - ) != - 0; - } - - late final __objc_msgSend_74Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_74 = __objc_msgSend_74Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int _objc_msgSend_75( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_75( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_75Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_75 = __objc_msgSend_75Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - int _objc_msgSend_76( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexBuffer, - int bufferSize, - NSRangePointer range, - ) { - return __objc_msgSend_76( - obj, - sel, - indexBuffer, - bufferSize, - range, - ); - } - - late final __objc_msgSend_76Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSRangePointer)>>('objc_msgSend'); - late final __objc_msgSend_76 = __objc_msgSend_76Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, NSRangePointer)>(); - - int _objc_msgSend_77( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_77( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_77Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_77 = __objc_msgSend_77Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); - - bool _objc_msgSend_78( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_78( - obj, - sel, - value, - ) != - 0; - } - - late final __objc_msgSend_78Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_78 = __objc_msgSend_78Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - bool _objc_msgSend_79( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_79( - obj, - sel, - range, - ) != - 0; - } - - late final __objc_msgSend_79Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_79 = __objc_msgSend_79Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); - - bool _objc_msgSend_80( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexSet, - ) { - return __objc_msgSend_80( - obj, - sel, - indexSet, - ) != - 0; - } - - late final __objc_msgSend_80Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_81( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer block, - ) { - return __objc_msgSend_81( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_81Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_81 = __objc_msgSend_81Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_82( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer block, - ) { - return __objc_msgSend_82( - obj, - sel, - opts, - block, - ); - } - - late final __objc_msgSend_82Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_82 = __objc_msgSend_82Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - void _objc_msgSend_83( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer block, - ) { - return __objc_msgSend_83( - obj, - sel, - range, - opts, - block, - ); - } - - late final __objc_msgSend_83Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_83 = __objc_msgSend_83Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer)>(); - - int _objc_msgSend_84( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer predicate, - ) { - return __objc_msgSend_84( - obj, - sel, - predicate, - ); - } - - late final __objc_msgSend_84Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_84 = __objc_msgSend_84Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int _objc_msgSend_85( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer predicate, - ) { - return __objc_msgSend_85( - obj, - sel, - opts, - predicate, - ); - } - - late final __objc_msgSend_85Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_85 = __objc_msgSend_85Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - int _objc_msgSend_86( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer predicate, - ) { - return __objc_msgSend_86( - obj, - sel, - range, - opts, - predicate, - ); - } - - late final __objc_msgSend_86Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_86 = __objc_msgSend_86Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_87( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer predicate, - ) { - return __objc_msgSend_87( - obj, - sel, - predicate, - ); - } - - late final __objc_msgSend_87Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_87 = __objc_msgSend_87Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_88( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer predicate, - ) { - return __objc_msgSend_88( - obj, - sel, - opts, - predicate, - ); - } - - late final __objc_msgSend_88Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_88 = __objc_msgSend_88Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_89( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer predicate, - ) { - return __objc_msgSend_89( - obj, - sel, - range, - opts, - predicate, - ); - } - - late final __objc_msgSend_89Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSRange, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_89 = __objc_msgSend_89Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSRange, int, ffi.Pointer)>(); - - void _objc_msgSend_90( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer block, - ) { - return __objc_msgSend_90( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_90Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_90 = __objc_msgSend_90Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_91( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer block, - ) { - return __objc_msgSend_91( - obj, - sel, - opts, - block, - ); - } - - late final __objc_msgSend_91Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_91 = __objc_msgSend_91Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - void _objc_msgSend_92( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer block, - ) { - return __objc_msgSend_92( - obj, - sel, - range, - opts, - block, - ); - } - - late final __objc_msgSend_92Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_92 = __objc_msgSend_92Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer)>(); - - void _objc_msgSend_93( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexSet, - ) { - return __objc_msgSend_93( - obj, - sel, - indexSet, - ); - } - - late final __objc_msgSend_93Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_93 = __objc_msgSend_93Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_94( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexSet, - ) { - return __objc_msgSend_94( - obj, - sel, - indexSet, - ); - } - - late final __objc_msgSend_94Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_94 = __objc_msgSend_94Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_95( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_95( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_95Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_95 = __objc_msgSend_95Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - void _objc_msgSend_96( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_96( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_96Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_96 = __objc_msgSend_96Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange)>(); - - void _objc_msgSend_97( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - int delta, - ) { - return __objc_msgSend_97( - obj, - sel, - index, - delta, - ); - } - - late final __objc_msgSend_97Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSUInteger, NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_97 = __objc_msgSend_97Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, int)>(); - - instancetype _objc_msgSend_98( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer changes, - ) { - return __objc_msgSend_98( - obj, - sel, - changes, - ); - } - - late final __objc_msgSend_98Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_98 = __objc_msgSend_98Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - instancetype _objc_msgSend_99( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer inserts, - ffi.Pointer insertedObjects, - ffi.Pointer removes, - ffi.Pointer removedObjects, - ffi.Pointer changes, - ) { - return __objc_msgSend_99( - obj, - sel, - inserts, - insertedObjects, - removes, - removedObjects, - changes, - ); - } - - late final __objc_msgSend_99Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_99 = __objc_msgSend_99Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - instancetype _objc_msgSend_100( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer inserts, - ffi.Pointer insertedObjects, - ffi.Pointer removes, - ffi.Pointer removedObjects, - ) { - return __objc_msgSend_100( - obj, - sel, - inserts, - insertedObjects, - removes, - removedObjects, - ); - } - - late final __objc_msgSend_100Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_100 = __objc_msgSend_100Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_101( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_101( - obj, - sel, - ); - } - - late final __objc_msgSend_101Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_101 = __objc_msgSend_101Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_102( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_102( - obj, - sel, - ); - } - - late final __objc_msgSend_102Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_102 = __objc_msgSend_102Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_103( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ) { - return __objc_msgSend_103( - obj, - sel, - index, - ); - } - - late final __objc_msgSend_103Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_103 = __objc_msgSend_103Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - instancetype _objc_msgSend_104( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> objects, - int cnt, - ) { - return __objc_msgSend_104( - obj, - sel, - objects, - cnt, - ); - } - - late final __objc_msgSend_104Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_104 = __objc_msgSend_104Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>, int)>(); - - instancetype _objc_msgSend_105( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_105( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_105Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_105 = __objc_msgSend_105Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_106( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - ) { - return __objc_msgSend_106( - obj, - sel, - anObject, - ); - } - - late final __objc_msgSend_106Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_106 = __objc_msgSend_106Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_107( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - int index, - ) { - return __objc_msgSend_107( - obj, - sel, - anObject, - index, - ); - } - - late final __objc_msgSend_107Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_107 = __objc_msgSend_107Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - void _objc_msgSend_108( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ffi.Pointer anObject, - ) { - return __objc_msgSend_108( - obj, - sel, - index, - anObject, - ); - } - - late final __objc_msgSend_108Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSUInteger, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_108 = __objc_msgSend_108Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - instancetype _objc_msgSend_109( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_109( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_109Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_109 = __objc_msgSend_109Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_110( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - int visibility, - ffi.Pointer loadHandler, - ) { - return __objc_msgSend_110( - obj, - sel, - typeIdentifier, - visibility, - loadHandler, - ); - } - - late final __objc_msgSend_110Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_110 = __objc_msgSend_110Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); - - void _objc_msgSend_111( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - int fileOptions, - int visibility, - ffi.Pointer loadHandler, - ) { - return __objc_msgSend_111( - obj, - sel, - typeIdentifier, - fileOptions, - visibility, - loadHandler, - ); - } - - late final __objc_msgSend_111Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_111 = __objc_msgSend_111Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_112( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_112( - obj, - sel, - ); - } - - late final __objc_msgSend_112Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_112 = __objc_msgSend_112Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - bool _objc_msgSend_113( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ) { - return __objc_msgSend_113( - obj, - sel, - typeIdentifier, - ) != - 0; - } - - late final __objc_msgSend_113Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_113 = __objc_msgSend_113Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - bool _objc_msgSend_114( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - int fileOptions, - ) { - return __objc_msgSend_114( - obj, - sel, - typeIdentifier, - fileOptions, - ) != - 0; - } - - late final __objc_msgSend_114Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_114 = __objc_msgSend_114Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - ffi.Pointer _objc_msgSend_115( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer completionHandler, - ) { - return __objc_msgSend_115( - obj, - sel, - typeIdentifier, - completionHandler, - ); - } - - late final __objc_msgSend_115Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_115 = __objc_msgSend_115Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_116( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer completionHandler, - ) { - return __objc_msgSend_116( - obj, - sel, - typeIdentifier, - completionHandler, - ); - } - - late final __objc_msgSend_116Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_116 = __objc_msgSend_116Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_117( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer completionHandler, - ) { - return __objc_msgSend_117( - obj, - sel, - typeIdentifier, - completionHandler, - ); - } - - late final __objc_msgSend_117Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_117 = __objc_msgSend_117Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_118( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_118( - obj, - sel, - ); - } - - late final __objc_msgSend_118Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_118 = __objc_msgSend_118Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_119( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_119( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_119Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_119 = __objc_msgSend_119Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - instancetype _objc_msgSend_120( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer object, - ) { - return __objc_msgSend_120( - obj, - sel, - object, - ); - } - - late final __objc_msgSend_120Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_120 = __objc_msgSend_120Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_121( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer object, - int visibility, - ) { - return __objc_msgSend_121( - obj, - sel, - object, - visibility, - ); - } - - late final __objc_msgSend_121Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_121 = __objc_msgSend_121Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - void _objc_msgSend_122( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aClass, - int visibility, - ffi.Pointer loadHandler, - ) { - return __objc_msgSend_122( - obj, - sel, - aClass, - visibility, - loadHandler, - ); - } - - late final __objc_msgSend_122Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_122 = __objc_msgSend_122Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); - - bool _objc_msgSend_123( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aClass, - ) { - return __objc_msgSend_123( - obj, - sel, - aClass, - ) != - 0; - } - - late final __objc_msgSend_123Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_123 = __objc_msgSend_123Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_124( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aClass, - ffi.Pointer completionHandler, - ) { - return __objc_msgSend_124( - obj, - sel, - aClass, - completionHandler, - ); - } - - late final __objc_msgSend_124Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_124 = __objc_msgSend_124Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - instancetype _objc_msgSend_125( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer item, - ffi.Pointer typeIdentifier, - ) { - return __objc_msgSend_125( - obj, - sel, - item, - typeIdentifier, - ); - } - - late final __objc_msgSend_125Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_125 = __objc_msgSend_125Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - instancetype _objc_msgSend_126( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer fileURL, - ) { - return __objc_msgSend_126( - obj, - sel, - fileURL, - ); - } - - late final __objc_msgSend_126Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_126 = __objc_msgSend_126Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_127( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - NSItemProviderLoadHandler loadHandler, - ) { - return __objc_msgSend_127( - obj, - sel, - typeIdentifier, - loadHandler, - ); - } - - late final __objc_msgSend_127Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSItemProviderLoadHandler)>>('objc_msgSend'); - late final __objc_msgSend_127 = __objc_msgSend_127Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSItemProviderLoadHandler)>(); - - void _objc_msgSend_128( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer options, - NSItemProviderCompletionHandler completionHandler, - ) { - return __objc_msgSend_128( - obj, - sel, - typeIdentifier, - options, - completionHandler, - ); - } - - late final __objc_msgSend_128Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSItemProviderCompletionHandler)>>('objc_msgSend'); - late final __objc_msgSend_128 = __objc_msgSend_128Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSItemProviderCompletionHandler)>(); - - late final ffi.Pointer> - _NSItemProviderPreferredImageSizeKey = - _lookup>('NSItemProviderPreferredImageSizeKey'); - - ffi.Pointer get NSItemProviderPreferredImageSizeKey => - _NSItemProviderPreferredImageSizeKey.value; - - set NSItemProviderPreferredImageSizeKey(ffi.Pointer value) => - _NSItemProviderPreferredImageSizeKey.value = value; - - late final ffi.Pointer> - _NSExtensionJavaScriptPreprocessingResultsKey = - _lookup>( - 'NSExtensionJavaScriptPreprocessingResultsKey'); - - ffi.Pointer get NSExtensionJavaScriptPreprocessingResultsKey => - _NSExtensionJavaScriptPreprocessingResultsKey.value; - - set NSExtensionJavaScriptPreprocessingResultsKey( - ffi.Pointer value) => - _NSExtensionJavaScriptPreprocessingResultsKey.value = value; - - late final ffi.Pointer> - _NSExtensionJavaScriptFinalizeArgumentKey = - _lookup>( - 'NSExtensionJavaScriptFinalizeArgumentKey'); - - ffi.Pointer get NSExtensionJavaScriptFinalizeArgumentKey => - _NSExtensionJavaScriptFinalizeArgumentKey.value; - - set NSExtensionJavaScriptFinalizeArgumentKey(ffi.Pointer value) => - _NSExtensionJavaScriptFinalizeArgumentKey.value = value; - - late final ffi.Pointer> _NSItemProviderErrorDomain = - _lookup>('NSItemProviderErrorDomain'); - - ffi.Pointer get NSItemProviderErrorDomain => - _NSItemProviderErrorDomain.value; - - set NSItemProviderErrorDomain(ffi.Pointer value) => - _NSItemProviderErrorDomain.value = value; - - late final ffi.Pointer _NSStringTransformLatinToKatakana = - _lookup('NSStringTransformLatinToKatakana'); - - NSStringTransform get NSStringTransformLatinToKatakana => - _NSStringTransformLatinToKatakana.value; - - set NSStringTransformLatinToKatakana(NSStringTransform value) => - _NSStringTransformLatinToKatakana.value = value; - - late final ffi.Pointer _NSStringTransformLatinToHiragana = - _lookup('NSStringTransformLatinToHiragana'); - - NSStringTransform get NSStringTransformLatinToHiragana => - _NSStringTransformLatinToHiragana.value; - - set NSStringTransformLatinToHiragana(NSStringTransform value) => - _NSStringTransformLatinToHiragana.value = value; - - late final ffi.Pointer _NSStringTransformLatinToHangul = - _lookup('NSStringTransformLatinToHangul'); - - NSStringTransform get NSStringTransformLatinToHangul => - _NSStringTransformLatinToHangul.value; - - set NSStringTransformLatinToHangul(NSStringTransform value) => - _NSStringTransformLatinToHangul.value = value; - - late final ffi.Pointer _NSStringTransformLatinToArabic = - _lookup('NSStringTransformLatinToArabic'); - - NSStringTransform get NSStringTransformLatinToArabic => - _NSStringTransformLatinToArabic.value; - - set NSStringTransformLatinToArabic(NSStringTransform value) => - _NSStringTransformLatinToArabic.value = value; - - late final ffi.Pointer _NSStringTransformLatinToHebrew = - _lookup('NSStringTransformLatinToHebrew'); - - NSStringTransform get NSStringTransformLatinToHebrew => - _NSStringTransformLatinToHebrew.value; - - set NSStringTransformLatinToHebrew(NSStringTransform value) => - _NSStringTransformLatinToHebrew.value = value; - - late final ffi.Pointer _NSStringTransformLatinToThai = - _lookup('NSStringTransformLatinToThai'); - - NSStringTransform get NSStringTransformLatinToThai => - _NSStringTransformLatinToThai.value; - - set NSStringTransformLatinToThai(NSStringTransform value) => - _NSStringTransformLatinToThai.value = value; - - late final ffi.Pointer _NSStringTransformLatinToCyrillic = - _lookup('NSStringTransformLatinToCyrillic'); - - NSStringTransform get NSStringTransformLatinToCyrillic => - _NSStringTransformLatinToCyrillic.value; - - set NSStringTransformLatinToCyrillic(NSStringTransform value) => - _NSStringTransformLatinToCyrillic.value = value; - - late final ffi.Pointer _NSStringTransformLatinToGreek = - _lookup('NSStringTransformLatinToGreek'); - - NSStringTransform get NSStringTransformLatinToGreek => - _NSStringTransformLatinToGreek.value; - - set NSStringTransformLatinToGreek(NSStringTransform value) => - _NSStringTransformLatinToGreek.value = value; - - late final ffi.Pointer _NSStringTransformToLatin = - _lookup('NSStringTransformToLatin'); - - NSStringTransform get NSStringTransformToLatin => - _NSStringTransformToLatin.value; - - set NSStringTransformToLatin(NSStringTransform value) => - _NSStringTransformToLatin.value = value; - - late final ffi.Pointer _NSStringTransformMandarinToLatin = - _lookup('NSStringTransformMandarinToLatin'); - - NSStringTransform get NSStringTransformMandarinToLatin => - _NSStringTransformMandarinToLatin.value; - - set NSStringTransformMandarinToLatin(NSStringTransform value) => - _NSStringTransformMandarinToLatin.value = value; - - late final ffi.Pointer - _NSStringTransformHiraganaToKatakana = - _lookup('NSStringTransformHiraganaToKatakana'); - - NSStringTransform get NSStringTransformHiraganaToKatakana => - _NSStringTransformHiraganaToKatakana.value; - - set NSStringTransformHiraganaToKatakana(NSStringTransform value) => - _NSStringTransformHiraganaToKatakana.value = value; - - late final ffi.Pointer - _NSStringTransformFullwidthToHalfwidth = - _lookup('NSStringTransformFullwidthToHalfwidth'); - - NSStringTransform get NSStringTransformFullwidthToHalfwidth => - _NSStringTransformFullwidthToHalfwidth.value; - - set NSStringTransformFullwidthToHalfwidth(NSStringTransform value) => - _NSStringTransformFullwidthToHalfwidth.value = value; - - late final ffi.Pointer _NSStringTransformToXMLHex = - _lookup('NSStringTransformToXMLHex'); - - NSStringTransform get NSStringTransformToXMLHex => - _NSStringTransformToXMLHex.value; - - set NSStringTransformToXMLHex(NSStringTransform value) => - _NSStringTransformToXMLHex.value = value; - - late final ffi.Pointer _NSStringTransformToUnicodeName = - _lookup('NSStringTransformToUnicodeName'); - - NSStringTransform get NSStringTransformToUnicodeName => - _NSStringTransformToUnicodeName.value; - - set NSStringTransformToUnicodeName(NSStringTransform value) => - _NSStringTransformToUnicodeName.value = value; - - late final ffi.Pointer - _NSStringTransformStripCombiningMarks = - _lookup('NSStringTransformStripCombiningMarks'); - - NSStringTransform get NSStringTransformStripCombiningMarks => - _NSStringTransformStripCombiningMarks.value; - - set NSStringTransformStripCombiningMarks(NSStringTransform value) => - _NSStringTransformStripCombiningMarks.value = value; - - late final ffi.Pointer _NSStringTransformStripDiacritics = - _lookup('NSStringTransformStripDiacritics'); - - NSStringTransform get NSStringTransformStripDiacritics => - _NSStringTransformStripDiacritics.value; - - set NSStringTransformStripDiacritics(NSStringTransform value) => - _NSStringTransformStripDiacritics.value = value; - - late final ffi.Pointer - _NSStringEncodingDetectionSuggestedEncodingsKey = - _lookup( - 'NSStringEncodingDetectionSuggestedEncodingsKey'); - - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionSuggestedEncodingsKey => - _NSStringEncodingDetectionSuggestedEncodingsKey.value; - - set NSStringEncodingDetectionSuggestedEncodingsKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionSuggestedEncodingsKey.value = value; - - late final ffi.Pointer - _NSStringEncodingDetectionDisallowedEncodingsKey = - _lookup( - 'NSStringEncodingDetectionDisallowedEncodingsKey'); - - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionDisallowedEncodingsKey => - _NSStringEncodingDetectionDisallowedEncodingsKey.value; - - set NSStringEncodingDetectionDisallowedEncodingsKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionDisallowedEncodingsKey.value = value; - - late final ffi.Pointer - _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey = - _lookup( - 'NSStringEncodingDetectionUseOnlySuggestedEncodingsKey'); - - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionUseOnlySuggestedEncodingsKey => - _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value; - - set NSStringEncodingDetectionUseOnlySuggestedEncodingsKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value = value; - - late final ffi.Pointer - _NSStringEncodingDetectionAllowLossyKey = - _lookup( - 'NSStringEncodingDetectionAllowLossyKey'); - - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionAllowLossyKey => - _NSStringEncodingDetectionAllowLossyKey.value; - - set NSStringEncodingDetectionAllowLossyKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionAllowLossyKey.value = value; - - late final ffi.Pointer - _NSStringEncodingDetectionFromWindowsKey = - _lookup( - 'NSStringEncodingDetectionFromWindowsKey'); - - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionFromWindowsKey => - _NSStringEncodingDetectionFromWindowsKey.value; - - set NSStringEncodingDetectionFromWindowsKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionFromWindowsKey.value = value; - - late final ffi.Pointer - _NSStringEncodingDetectionLossySubstitutionKey = - _lookup( - 'NSStringEncodingDetectionLossySubstitutionKey'); - - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionLossySubstitutionKey => - _NSStringEncodingDetectionLossySubstitutionKey.value; - - set NSStringEncodingDetectionLossySubstitutionKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionLossySubstitutionKey.value = value; - - late final ffi.Pointer - _NSStringEncodingDetectionLikelyLanguageKey = - _lookup( - 'NSStringEncodingDetectionLikelyLanguageKey'); - - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionLikelyLanguageKey => - _NSStringEncodingDetectionLikelyLanguageKey.value; - - set NSStringEncodingDetectionLikelyLanguageKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionLikelyLanguageKey.value = value; - - void _objc_msgSend_129( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ffi.Pointer aString, - ) { - return __objc_msgSend_129( - obj, - sel, - range, - aString, - ); - } - - late final __objc_msgSend_129Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_129 = __objc_msgSend_129Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, - ffi.Pointer)>(); - - late final ffi.Pointer _NSCharacterConversionException = - _lookup('NSCharacterConversionException'); - - NSExceptionName get NSCharacterConversionException => - _NSCharacterConversionException.value; - - set NSCharacterConversionException(NSExceptionName value) => - _NSCharacterConversionException.value = value; - - late final ffi.Pointer _NSParseErrorException = - _lookup('NSParseErrorException'); - - NSExceptionName get NSParseErrorException => _NSParseErrorException.value; - - set NSParseErrorException(NSExceptionName value) => - _NSParseErrorException.value = value; - - int _objc_msgSend_130( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_130( - obj, - sel, - ); - } - - late final __objc_msgSend_130Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_130 = __objc_msgSend_130Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - void _objc_msgSend_131( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_131( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_131Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_131 = __objc_msgSend_131Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - ffi.Pointer _objc_msgSend_132( - ffi.Pointer obj, - ffi.Pointer sel, - double x, - ) { - return __objc_msgSend_132( - obj, - sel, - x, - ); - } - - late final __objc_msgSend_132Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_132 = __objc_msgSend_132Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); - - int _objc_msgSend_133( - ffi.Pointer obj, - ffi.Pointer sel, - bool useIntVals, - ffi.Pointer other, - ) { - return __objc_msgSend_133( - obj, - sel, - useIntVals ? 1 : 0, - other, - ); - } - - late final __objc_msgSend_133Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Uint8, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_133 = __objc_msgSend_133Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - void _objc_msgSend_134( - ffi.Pointer obj, - ffi.Pointer sel, - double x, - ) { - return __objc_msgSend_134( - obj, - sel, - x, - ); - } - - late final __objc_msgSend_134Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_134 = __objc_msgSend_134Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, double)>(); -} - -abstract class NSComparisonResult { - static const int NSOrderedAscending = -1; - static const int NSOrderedSame = 0; - static const int NSOrderedDescending = 1; -} - -abstract class NSEnumerationOptions { - static const int NSEnumerationConcurrent = 1; - static const int NSEnumerationReverse = 2; -} - -abstract class NSSortOptions { - static const int NSSortConcurrent = 1; - static const int NSSortStable = 16; -} - -abstract class NSQualityOfService { - static const int NSQualityOfServiceUserInteractive = 33; - static const int NSQualityOfServiceUserInitiated = 25; - static const int NSQualityOfServiceUtility = 17; - static const int NSQualityOfServiceBackground = 9; - static const int NSQualityOfServiceDefault = -1; -} - -typedef NSInteger = pkg_ffi.Long; - -class __CFString extends ffi.Opaque {} - -abstract class CFComparisonResult { - static const int kCFCompareLessThan = -1; - static const int kCFCompareEqualTo = 0; - static const int kCFCompareGreaterThan = 1; -} - -typedef CFIndex = pkg_ffi.Long; - -class CFRange extends ffi.Struct { - @CFIndex() - external int location; - - @CFIndex() - external int length; -} - -class __CFNull extends ffi.Opaque {} - -typedef CFNullRef = ffi.Pointer<__CFNull>; - -class __CFAllocator extends ffi.Opaque {} - -typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; - -class CFAllocatorContext extends ffi.Struct { - @CFIndex() - external int version; - - external ffi.Pointer info; - - external CFAllocatorRetainCallBack retain; - - external CFAllocatorReleaseCallBack release; - - external CFAllocatorCopyDescriptionCallBack copyDescription; + late final ffi.Pointer> + _NSItemProviderPreferredImageSizeKey = + _lookup>('NSItemProviderPreferredImageSizeKey'); - external CFAllocatorAllocateCallBack allocate; + ffi.Pointer get NSItemProviderPreferredImageSizeKey => + _NSItemProviderPreferredImageSizeKey.value; - external CFAllocatorReallocateCallBack reallocate; + set NSItemProviderPreferredImageSizeKey(ffi.Pointer value) => + _NSItemProviderPreferredImageSizeKey.value = value; - external CFAllocatorDeallocateCallBack deallocate; + late final ffi.Pointer> + _NSExtensionJavaScriptPreprocessingResultsKey = + _lookup>( + 'NSExtensionJavaScriptPreprocessingResultsKey'); - external CFAllocatorPreferredSizeCallBack preferredSize; -} + ffi.Pointer get NSExtensionJavaScriptPreprocessingResultsKey => + _NSExtensionJavaScriptPreprocessingResultsKey.value; -typedef CFAllocatorRetainCallBack = ffi.Pointer< - ffi.NativeFunction Function(ffi.Pointer)>>; -typedef CFAllocatorReleaseCallBack - = ffi.Pointer)>>; -typedef CFAllocatorCopyDescriptionCallBack = ffi - .Pointer)>>; -typedef CFStringRef = ffi.Pointer<__CFString>; -typedef CFAllocatorAllocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - CFIndex, CFOptionFlags, ffi.Pointer)>>; -typedef CFOptionFlags = pkg_ffi.UnsignedLong; -typedef CFAllocatorReallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, CFIndex, - CFOptionFlags, ffi.Pointer)>>; -typedef CFAllocatorDeallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; -typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< - ffi.NativeFunction< - CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; + set NSExtensionJavaScriptPreprocessingResultsKey( + ffi.Pointer value) => + _NSExtensionJavaScriptPreprocessingResultsKey.value = value; -ffi.Pointer _registerName(NativeObjCLibrary _lib, String name) { - final cstr = name.toNativeUtf8(); - final sel = _lib._sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; -} + late final ffi.Pointer> + _NSExtensionJavaScriptFinalizeArgumentKey = + _lookup>( + 'NSExtensionJavaScriptFinalizeArgumentKey'); -ffi.Pointer _getClass(NativeObjCLibrary _lib, String name) { - final cstr = name.toNativeUtf8(); - final clazz = _lib._objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return clazz; -} + ffi.Pointer get NSExtensionJavaScriptFinalizeArgumentKey => + _NSExtensionJavaScriptFinalizeArgumentKey.value; -class _ObjCWrapper { - final ffi.Pointer _id; - final NativeObjCLibrary _lib; - _ObjCWrapper._(this._id, this._lib); -} + set NSExtensionJavaScriptFinalizeArgumentKey(ffi.Pointer value) => + _NSExtensionJavaScriptFinalizeArgumentKey.value = value; -class NSValue extends NSObject { - NSValue._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); + late final ffi.Pointer> _NSItemProviderErrorDomain = + _lookup>('NSItemProviderErrorDomain'); - static ffi.Pointer? _class; + ffi.Pointer get NSItemProviderErrorDomain => + _NSItemProviderErrorDomain.value; - static NSValue castFrom(T other) { - return NSValue._(other._id, other._lib); - } + set NSItemProviderErrorDomain(ffi.Pointer value) => + _NSItemProviderErrorDomain.value = value; - static ffi.Pointer? _sel_getValue_size; - void getValue_size(ffi.Pointer value, int size) { - _sel_getValue_size ??= _registerName(_lib, "getValue:size:"); - _lib._objc_msgSend_28(_id, _sel_getValue_size!, value, size); - } + late final ffi.Pointer _NSStringTransformLatinToKatakana = + _lookup('NSStringTransformLatinToKatakana'); - static ffi.Pointer? _sel_objCType; - ffi.Pointer get objCType { - _sel_objCType ??= _registerName(_lib, "objCType"); - return _lib._objc_msgSend_29(_id, _sel_objCType!); - } + NSStringTransform get NSStringTransformLatinToKatakana => + _NSStringTransformLatinToKatakana.value; - static ffi.Pointer? _sel_initWithBytes_objCType; - NSValue initWithBytes_objCType( - ffi.Pointer value, ffi.Pointer type) { - _sel_initWithBytes_objCType ??= - _registerName(_lib, "initWithBytes:objCType:"); - final _ret = - _lib._objc_msgSend_30(_id, _sel_initWithBytes_objCType!, value, type); - return NSValue._(_ret, _lib); - } + set NSStringTransformLatinToKatakana(NSStringTransform value) => + _NSStringTransformLatinToKatakana.value = value; - static ffi.Pointer? _sel_initWithCoder; - NSValue initWithCoder(NSObject coder) { - _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_31(_id, _sel_initWithCoder!, coder._id); - return NSValue._(_ret, _lib); - } + late final ffi.Pointer _NSStringTransformLatinToHiragana = + _lookup('NSStringTransformLatinToHiragana'); - static ffi.Pointer? _sel_new1; - static NSValue new1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSValue"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); - return NSValue._(_ret, _lib); - } + NSStringTransform get NSStringTransformLatinToHiragana => + _NSStringTransformLatinToHiragana.value; - static ffi.Pointer? _sel_alloc; - static NSValue alloc(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSValue"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); - return NSValue._(_ret, _lib); - } -} + set NSStringTransformLatinToHiragana(NSStringTransform value) => + _NSStringTransformLatinToHiragana.value = value; -class NSObject extends _ObjCWrapper { - NSObject._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); + late final ffi.Pointer _NSStringTransformLatinToHangul = + _lookup('NSStringTransformLatinToHangul'); - static ffi.Pointer? _class; + NSStringTransform get NSStringTransformLatinToHangul => + _NSStringTransformLatinToHangul.value; - static NSObject castFrom(T other) { - return NSObject._(other._id, other._lib); - } + set NSStringTransformLatinToHangul(NSStringTransform value) => + _NSStringTransformLatinToHangul.value = value; - static ffi.Pointer? _sel_load; - static void load(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_load ??= _registerName(_lib, "load"); - _lib._objc_msgSend_0(_class!, _sel_load!); - } + late final ffi.Pointer _NSStringTransformLatinToArabic = + _lookup('NSStringTransformLatinToArabic'); - static ffi.Pointer? _sel_initialize; - static void initialize(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_initialize ??= _registerName(_lib, "initialize"); - _lib._objc_msgSend_0(_class!, _sel_initialize!); - } + NSStringTransform get NSStringTransformLatinToArabic => + _NSStringTransformLatinToArabic.value; - static ffi.Pointer? _sel_init; - NSObject init() { - _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_1(_id, _sel_init!); - return NSObject._(_ret, _lib); - } + set NSStringTransformLatinToArabic(NSStringTransform value) => + _NSStringTransformLatinToArabic.value = value; - static ffi.Pointer? _sel_new1; - static NSObject new1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); - return NSObject._(_ret, _lib); - } + late final ffi.Pointer _NSStringTransformLatinToHebrew = + _lookup('NSStringTransformLatinToHebrew'); - static ffi.Pointer? _sel_allocWithZone; - static NSObject allocWithZone( - NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_allocWithZone ??= _registerName(_lib, "allocWithZone:"); - final _ret = _lib._objc_msgSend_2(_class!, _sel_allocWithZone!, zone); - return NSObject._(_ret, _lib); - } + NSStringTransform get NSStringTransformLatinToHebrew => + _NSStringTransformLatinToHebrew.value; - static ffi.Pointer? _sel_alloc; - static NSObject alloc(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); - return NSObject._(_ret, _lib); - } + set NSStringTransformLatinToHebrew(NSStringTransform value) => + _NSStringTransformLatinToHebrew.value = value; - static ffi.Pointer? _sel_dealloc; - void dealloc() { - _sel_dealloc ??= _registerName(_lib, "dealloc"); - _lib._objc_msgSend_0(_id, _sel_dealloc!); - } + late final ffi.Pointer _NSStringTransformLatinToThai = + _lookup('NSStringTransformLatinToThai'); - static ffi.Pointer? _sel_finalize; - void finalize() { - _sel_finalize ??= _registerName(_lib, "finalize"); - _lib._objc_msgSend_0(_id, _sel_finalize!); - } + NSStringTransform get NSStringTransformLatinToThai => + _NSStringTransformLatinToThai.value; - static ffi.Pointer? _sel_copy; - NSObject copy() { - _sel_copy ??= _registerName(_lib, "copy"); - final _ret = _lib._objc_msgSend_3(_id, _sel_copy!); - return NSObject._(_ret, _lib); - } + set NSStringTransformLatinToThai(NSStringTransform value) => + _NSStringTransformLatinToThai.value = value; - static ffi.Pointer? _sel_mutableCopy; - NSObject mutableCopy() { - _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); - final _ret = _lib._objc_msgSend_4(_id, _sel_mutableCopy!); - return NSObject._(_ret, _lib); - } + late final ffi.Pointer _NSStringTransformLatinToCyrillic = + _lookup('NSStringTransformLatinToCyrillic'); - static ffi.Pointer? _sel_copyWithZone; - static NSObject copyWithZone( - NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); - final _ret = _lib._objc_msgSend_5(_class!, _sel_copyWithZone!, zone); - return NSObject._(_ret, _lib); - } + NSStringTransform get NSStringTransformLatinToCyrillic => + _NSStringTransformLatinToCyrillic.value; - static ffi.Pointer? _sel_mutableCopyWithZone; - static NSObject mutableCopyWithZone( - NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); - final _ret = _lib._objc_msgSend_6(_class!, _sel_mutableCopyWithZone!, zone); - return NSObject._(_ret, _lib); - } + set NSStringTransformLatinToCyrillic(NSStringTransform value) => + _NSStringTransformLatinToCyrillic.value = value; - static ffi.Pointer? _sel_instancesRespondToSelector; - static bool instancesRespondToSelector( - NativeObjCLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instancesRespondToSelector ??= - _registerName(_lib, "instancesRespondToSelector:"); - return _lib._objc_msgSend_7( - _class!, _sel_instancesRespondToSelector!, aSelector); - } + late final ffi.Pointer _NSStringTransformLatinToGreek = + _lookup('NSStringTransformLatinToGreek'); - static ffi.Pointer? _sel_conformsToProtocol; - static bool conformsToProtocol(NativeObjCLibrary _lib, NSObject protocol) { - _class ??= _getClass(_lib, "NSObject"); - _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); - return _lib._objc_msgSend_8( - _class!, _sel_conformsToProtocol!, protocol._id); - } + NSStringTransform get NSStringTransformLatinToGreek => + _NSStringTransformLatinToGreek.value; - static ffi.Pointer? _sel_methodForSelector; - IMP methodForSelector(ffi.Pointer aSelector) { - _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); - return _lib._objc_msgSend_9(_id, _sel_methodForSelector!, aSelector); - } + set NSStringTransformLatinToGreek(NSStringTransform value) => + _NSStringTransformLatinToGreek.value = value; - static ffi.Pointer? _sel_instanceMethodForSelector; - static IMP instanceMethodForSelector( - NativeObjCLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instanceMethodForSelector ??= - _registerName(_lib, "instanceMethodForSelector:"); - return _lib._objc_msgSend_10( - _class!, _sel_instanceMethodForSelector!, aSelector); - } + late final ffi.Pointer _NSStringTransformToLatin = + _lookup('NSStringTransformToLatin'); - static ffi.Pointer? _sel_doesNotRecognizeSelector; - void doesNotRecognizeSelector(ffi.Pointer aSelector) { - _sel_doesNotRecognizeSelector ??= - _registerName(_lib, "doesNotRecognizeSelector:"); - _lib._objc_msgSend_11(_id, _sel_doesNotRecognizeSelector!, aSelector); - } + NSStringTransform get NSStringTransformToLatin => + _NSStringTransformToLatin.value; - static ffi.Pointer? _sel_forwardingTargetForSelector; - NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { - _sel_forwardingTargetForSelector ??= - _registerName(_lib, "forwardingTargetForSelector:"); - final _ret = _lib._objc_msgSend_12( - _id, _sel_forwardingTargetForSelector!, aSelector); - return NSObject._(_ret, _lib); - } + set NSStringTransformToLatin(NSStringTransform value) => + _NSStringTransformToLatin.value = value; - static ffi.Pointer? _sel_forwardInvocation; - void forwardInvocation(NSObject anInvocation) { - _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); - _lib._objc_msgSend_13(_id, _sel_forwardInvocation!, anInvocation._id); - } + late final ffi.Pointer _NSStringTransformMandarinToLatin = + _lookup('NSStringTransformMandarinToLatin'); - static ffi.Pointer? _sel_methodSignatureForSelector; - NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { - _sel_methodSignatureForSelector ??= - _registerName(_lib, "methodSignatureForSelector:"); - final _ret = - _lib._objc_msgSend_14(_id, _sel_methodSignatureForSelector!, aSelector); - return NSMethodSignature._(_ret, _lib); - } + NSStringTransform get NSStringTransformMandarinToLatin => + _NSStringTransformMandarinToLatin.value; - static ffi.Pointer? _sel_instanceMethodSignatureForSelector; - static NSMethodSignature instanceMethodSignatureForSelector( - NativeObjCLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instanceMethodSignatureForSelector ??= - _registerName(_lib, "instanceMethodSignatureForSelector:"); - final _ret = _lib._objc_msgSend_15( - _class!, _sel_instanceMethodSignatureForSelector!, aSelector); - return NSMethodSignature._(_ret, _lib); - } + set NSStringTransformMandarinToLatin(NSStringTransform value) => + _NSStringTransformMandarinToLatin.value = value; - static ffi.Pointer? _sel_allowsWeakReference; - bool allowsWeakReference() { - _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); - return _lib._objc_msgSend_16(_id, _sel_allowsWeakReference!); - } + late final ffi.Pointer + _NSStringTransformHiraganaToKatakana = + _lookup('NSStringTransformHiraganaToKatakana'); - static ffi.Pointer? _sel_retainWeakReference; - bool retainWeakReference() { - _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); - return _lib._objc_msgSend_16(_id, _sel_retainWeakReference!); - } + NSStringTransform get NSStringTransformHiraganaToKatakana => + _NSStringTransformHiraganaToKatakana.value; - static ffi.Pointer? _sel_isSubclassOfClass; - static bool isSubclassOfClass(NativeObjCLibrary _lib, NSObject aClass) { - _class ??= _getClass(_lib, "NSObject"); - _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); - return _lib._objc_msgSend_17(_class!, _sel_isSubclassOfClass!, aClass._id); - } + set NSStringTransformHiraganaToKatakana(NSStringTransform value) => + _NSStringTransformHiraganaToKatakana.value = value; - static ffi.Pointer? _sel_resolveClassMethod; - static bool resolveClassMethod( - NativeObjCLibrary _lib, ffi.Pointer sel) { - _class ??= _getClass(_lib, "NSObject"); - _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); - return _lib._objc_msgSend_18(_class!, _sel_resolveClassMethod!, sel); - } + late final ffi.Pointer + _NSStringTransformFullwidthToHalfwidth = + _lookup('NSStringTransformFullwidthToHalfwidth'); - static ffi.Pointer? _sel_resolveInstanceMethod; - static bool resolveInstanceMethod( - NativeObjCLibrary _lib, ffi.Pointer sel) { - _class ??= _getClass(_lib, "NSObject"); - _sel_resolveInstanceMethod ??= - _registerName(_lib, "resolveInstanceMethod:"); - return _lib._objc_msgSend_19(_class!, _sel_resolveInstanceMethod!, sel); - } + NSStringTransform get NSStringTransformFullwidthToHalfwidth => + _NSStringTransformFullwidthToHalfwidth.value; - static ffi.Pointer? _sel_hash; - static int hash(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_hash ??= _registerName(_lib, "hash"); - return _lib._objc_msgSend_20(_class!, _sel_hash!); - } + set NSStringTransformFullwidthToHalfwidth(NSStringTransform value) => + _NSStringTransformFullwidthToHalfwidth.value = value; - static ffi.Pointer? _sel_superclass; - static NSObject superclass(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_superclass ??= _registerName(_lib, "superclass"); - final _ret = _lib._objc_msgSend_21(_class!, _sel_superclass!); - return NSObject._(_ret, _lib); - } + late final ffi.Pointer _NSStringTransformToXMLHex = + _lookup('NSStringTransformToXMLHex'); - static ffi.Pointer? _sel_class1; - static NSObject class1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_class1 ??= _registerName(_lib, "class"); - final _ret = _lib._objc_msgSend_22(_class!, _sel_class1!); - return NSObject._(_ret, _lib); - } + NSStringTransform get NSStringTransformToXMLHex => + _NSStringTransformToXMLHex.value; - static ffi.Pointer? _sel_description; - static NSString description(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_description ??= _registerName(_lib, "description"); - final _ret = _lib._objc_msgSend_27(_class!, _sel_description!); - return NSString._(_ret, _lib); - } + set NSStringTransformToXMLHex(NSStringTransform value) => + _NSStringTransformToXMLHex.value = value; - static ffi.Pointer? _sel_debugDescription; - static NSString debugDescription(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_debugDescription ??= _registerName(_lib, "debugDescription"); - final _ret = _lib._objc_msgSend_27(_class!, _sel_debugDescription!); - return NSString._(_ret, _lib); - } -} + late final ffi.Pointer _NSStringTransformToUnicodeName = + _lookup('NSStringTransformToUnicodeName'); -typedef instancetype = ffi.Pointer; + NSStringTransform get NSStringTransformToUnicodeName => + _NSStringTransformToUnicodeName.value; -class ObjCObject extends ffi.Opaque {} + set NSStringTransformToUnicodeName(NSStringTransform value) => + _NSStringTransformToUnicodeName.value = value; -class _NSZone extends ffi.Opaque {} + late final ffi.Pointer + _NSStringTransformStripCombiningMarks = + _lookup('NSStringTransformStripCombiningMarks'); -class ObjCSel extends ffi.Opaque {} + NSStringTransform get NSStringTransformStripCombiningMarks => + _NSStringTransformStripCombiningMarks.value; -typedef IMP = ffi.Pointer>; + set NSStringTransformStripCombiningMarks(NSStringTransform value) => + _NSStringTransformStripCombiningMarks.value = value; -class NSMethodSignature extends _ObjCWrapper { - NSMethodSignature._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); + late final ffi.Pointer _NSStringTransformStripDiacritics = + _lookup('NSStringTransformStripDiacritics'); - static ffi.Pointer? _class; + NSStringTransform get NSStringTransformStripDiacritics => + _NSStringTransformStripDiacritics.value; - static NSMethodSignature castFrom(T other) { - return NSMethodSignature._(other._id, other._lib); - } -} + set NSStringTransformStripDiacritics(NSStringTransform value) => + _NSStringTransformStripDiacritics.value = value; -typedef NSUInteger = pkg_ffi.UnsignedLong; + late final ffi.Pointer + _NSStringEncodingDetectionSuggestedEncodingsKey = + _lookup( + 'NSStringEncodingDetectionSuggestedEncodingsKey'); -class NSString extends NSObject { - NSString._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionSuggestedEncodingsKey => + _NSStringEncodingDetectionSuggestedEncodingsKey.value; - static ffi.Pointer? _class; + set NSStringEncodingDetectionSuggestedEncodingsKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionSuggestedEncodingsKey.value = value; - static NSString castFrom(T other) { - return NSString._(other._id, other._lib); - } + late final ffi.Pointer + _NSStringEncodingDetectionDisallowedEncodingsKey = + _lookup( + 'NSStringEncodingDetectionDisallowedEncodingsKey'); - factory NSString(NativeObjCLibrary _lib, String str) { - final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); - pkg_ffi.calloc.free(cstr); - return nsstr; - } + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionDisallowedEncodingsKey => + _NSStringEncodingDetectionDisallowedEncodingsKey.value; - @override - String toString() => UTF8String().cast().toDartString(); + set NSStringEncodingDetectionDisallowedEncodingsKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionDisallowedEncodingsKey.value = value; - static ffi.Pointer? _sel_length; - int get length { - _sel_length ??= _registerName(_lib, "length"); - return _lib._objc_msgSend_20(_id, _sel_length!); - } + late final ffi.Pointer + _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey = + _lookup( + 'NSStringEncodingDetectionUseOnlySuggestedEncodingsKey'); - static ffi.Pointer? _sel_characterAtIndex; - int characterAtIndex(int index) { - _sel_characterAtIndex ??= _registerName(_lib, "characterAtIndex:"); - return _lib._objc_msgSend_23(_id, _sel_characterAtIndex!, index); - } + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionUseOnlySuggestedEncodingsKey => + _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value; - static ffi.Pointer? _sel_init; - @override - NSString init() { - _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_1(_id, _sel_init!); - return NSString._(_ret, _lib); - } + set NSStringEncodingDetectionUseOnlySuggestedEncodingsKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value = value; - static ffi.Pointer? _sel_initWithCoder; - NSString initWithCoder(NSObject coder) { - _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_24(_id, _sel_initWithCoder!, coder._id); - return NSString._(_ret, _lib); - } + late final ffi.Pointer + _NSStringEncodingDetectionAllowLossyKey = + _lookup( + 'NSStringEncodingDetectionAllowLossyKey'); - static ffi.Pointer? _sel_stringWithCString_encoding; - static NSString stringWithCString_encoding( - NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { - _class ??= _getClass(_lib, "NSString"); - _sel_stringWithCString_encoding ??= - _registerName(_lib, "stringWithCString:encoding:"); - final _ret = _lib._objc_msgSend_25( - _class!, _sel_stringWithCString_encoding!, cString, enc); - return NSString._(_ret, _lib); - } + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionAllowLossyKey => + _NSStringEncodingDetectionAllowLossyKey.value; - static ffi.Pointer? _sel_UTF8String; - ffi.Pointer UTF8String() { - _sel_UTF8String ??= _registerName(_lib, "UTF8String"); - return _lib._objc_msgSend_26(_id, _sel_UTF8String!); - } + set NSStringEncodingDetectionAllowLossyKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionAllowLossyKey.value = value; - static ffi.Pointer? _sel_new1; - static NSString new1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSString"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); - return NSString._(_ret, _lib); - } + late final ffi.Pointer + _NSStringEncodingDetectionFromWindowsKey = + _lookup( + 'NSStringEncodingDetectionFromWindowsKey'); - static ffi.Pointer? _sel_alloc; - static NSString alloc(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSString"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); - return NSString._(_ret, _lib); - } -} + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionFromWindowsKey => + _NSStringEncodingDetectionFromWindowsKey.value; -extension StringToNSString on String { - NSString toNSString(NativeObjCLibrary lib) => NSString(lib, this); -} + set NSStringEncodingDetectionFromWindowsKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionFromWindowsKey.value = value; -typedef unichar = pkg_ffi.UnsignedShort; + late final ffi.Pointer + _NSStringEncodingDetectionLossySubstitutionKey = + _lookup( + 'NSStringEncodingDetectionLossySubstitutionKey'); -class NSNumber extends NSValue { - NSNumber._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionLossySubstitutionKey => + _NSStringEncodingDetectionLossySubstitutionKey.value; - static ffi.Pointer? _class; + set NSStringEncodingDetectionLossySubstitutionKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionLossySubstitutionKey.value = value; - static NSNumber castFrom(T other) { - return NSNumber._(other._id, other._lib); - } + late final ffi.Pointer + _NSStringEncodingDetectionLikelyLanguageKey = + _lookup( + 'NSStringEncodingDetectionLikelyLanguageKey'); - static ffi.Pointer? _sel_initWithCoder; - @override - NSNumber initWithCoder(NSObject coder) { - _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_32(_id, _sel_initWithCoder!, coder._id); - return NSNumber._(_ret, _lib); - } + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionLikelyLanguageKey => + _NSStringEncodingDetectionLikelyLanguageKey.value; - static ffi.Pointer? _sel_initWithChar; - NSNumber initWithChar(int value) { - _sel_initWithChar ??= _registerName(_lib, "initWithChar:"); - final _ret = _lib._objc_msgSend_33(_id, _sel_initWithChar!, value); - return NSNumber._(_ret, _lib); - } + set NSStringEncodingDetectionLikelyLanguageKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionLikelyLanguageKey.value = value; - static ffi.Pointer? _sel_initWithUnsignedChar; - NSNumber initWithUnsignedChar(int value) { - _sel_initWithUnsignedChar ??= _registerName(_lib, "initWithUnsignedChar:"); - final _ret = _lib._objc_msgSend_34(_id, _sel_initWithUnsignedChar!, value); - return NSNumber._(_ret, _lib); - } + late final ffi.Pointer _NSCharacterConversionException = + _lookup('NSCharacterConversionException'); - static ffi.Pointer? _sel_initWithShort; - NSNumber initWithShort(int value) { - _sel_initWithShort ??= _registerName(_lib, "initWithShort:"); - final _ret = _lib._objc_msgSend_35(_id, _sel_initWithShort!, value); - return NSNumber._(_ret, _lib); - } + NSExceptionName get NSCharacterConversionException => + _NSCharacterConversionException.value; - static ffi.Pointer? _sel_initWithUnsignedShort; - NSNumber initWithUnsignedShort(int value) { - _sel_initWithUnsignedShort ??= - _registerName(_lib, "initWithUnsignedShort:"); - final _ret = _lib._objc_msgSend_36(_id, _sel_initWithUnsignedShort!, value); - return NSNumber._(_ret, _lib); - } + set NSCharacterConversionException(NSExceptionName value) => + _NSCharacterConversionException.value = value; - static ffi.Pointer? _sel_initWithInt; - NSNumber initWithInt(int value) { - _sel_initWithInt ??= _registerName(_lib, "initWithInt:"); - final _ret = _lib._objc_msgSend_37(_id, _sel_initWithInt!, value); - return NSNumber._(_ret, _lib); - } + late final ffi.Pointer _NSParseErrorException = + _lookup('NSParseErrorException'); - static ffi.Pointer? _sel_initWithUnsignedInt; - NSNumber initWithUnsignedInt(int value) { - _sel_initWithUnsignedInt ??= _registerName(_lib, "initWithUnsignedInt:"); - final _ret = _lib._objc_msgSend_38(_id, _sel_initWithUnsignedInt!, value); - return NSNumber._(_ret, _lib); - } + NSExceptionName get NSParseErrorException => _NSParseErrorException.value; - static ffi.Pointer? _sel_initWithLong; - NSNumber initWithLong(int value) { - _sel_initWithLong ??= _registerName(_lib, "initWithLong:"); - final _ret = _lib._objc_msgSend_39(_id, _sel_initWithLong!, value); - return NSNumber._(_ret, _lib); - } + set NSParseErrorException(NSExceptionName value) => + _NSParseErrorException.value = value; - static ffi.Pointer? _sel_initWithUnsignedLong; - NSNumber initWithUnsignedLong(int value) { - _sel_initWithUnsignedLong ??= _registerName(_lib, "initWithUnsignedLong:"); - final _ret = _lib._objc_msgSend_40(_id, _sel_initWithUnsignedLong!, value); - return NSNumber._(_ret, _lib); + ffi.Pointer _sel_registerName( + ffi.Pointer str, + ) { + return __sel_registerName( + str, + ); } - static ffi.Pointer? _sel_initWithLongLong; - NSNumber initWithLongLong(int value) { - _sel_initWithLongLong ??= _registerName(_lib, "initWithLongLong:"); - final _ret = _lib._objc_msgSend_41(_id, _sel_initWithLongLong!, value); - return NSNumber._(_ret, _lib); - } + late final __sel_registerNamePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sel_registerName'); + late final __sel_registerName = __sel_registerNamePtr + .asFunction Function(ffi.Pointer)>(); - static ffi.Pointer? _sel_initWithUnsignedLongLong; - NSNumber initWithUnsignedLongLong(int value) { - _sel_initWithUnsignedLongLong ??= - _registerName(_lib, "initWithUnsignedLongLong:"); - final _ret = - _lib._objc_msgSend_42(_id, _sel_initWithUnsignedLongLong!, value); - return NSNumber._(_ret, _lib); + ffi.Pointer _objc_getClass( + ffi.Pointer str, + ) { + return __objc_getClass( + str, + ); } - static ffi.Pointer? _sel_initWithFloat; - NSNumber initWithFloat(double value) { - _sel_initWithFloat ??= _registerName(_lib, "initWithFloat:"); - final _ret = _lib._objc_msgSend_43(_id, _sel_initWithFloat!, value); - return NSNumber._(_ret, _lib); - } + late final __objc_getClassPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('objc_getClass'); + late final __objc_getClass = __objc_getClassPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); - static ffi.Pointer? _sel_initWithDouble; - NSNumber initWithDouble(double value) { - _sel_initWithDouble ??= _registerName(_lib, "initWithDouble:"); - final _ret = _lib._objc_msgSend_44(_id, _sel_initWithDouble!, value); - return NSNumber._(_ret, _lib); + void _objc_msgSend_0( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_0( + obj, + sel, + ); } - static ffi.Pointer? _sel_initWithBool; - NSNumber initWithBool(bool value) { - _sel_initWithBool ??= _registerName(_lib, "initWithBool:"); - final _ret = _lib._objc_msgSend_45(_id, _sel_initWithBool!, value); - return NSNumber._(_ret, _lib); - } + late final __objc_msgSend_0Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); - static ffi.Pointer? _sel_initWithInteger; - NSNumber initWithInteger(int value) { - _sel_initWithInteger ??= _registerName(_lib, "initWithInteger:"); - final _ret = _lib._objc_msgSend_46(_id, _sel_initWithInteger!, value); - return NSNumber._(_ret, _lib); + instancetype _objc_msgSend_1( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1( + obj, + sel, + ); } - static ffi.Pointer? _sel_initWithUnsignedInteger; - NSNumber initWithUnsignedInteger(int value) { - _sel_initWithUnsignedInteger ??= - _registerName(_lib, "initWithUnsignedInteger:"); - final _ret = - _lib._objc_msgSend_47(_id, _sel_initWithUnsignedInteger!, value); - return NSNumber._(_ret, _lib); - } + late final __objc_msgSend_1Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer)>(); - static ffi.Pointer? _sel_charValue; - int get charValue { - _sel_charValue ??= _registerName(_lib, "charValue"); - return _lib._objc_msgSend_48(_id, _sel_charValue!); + instancetype _objc_msgSend_2( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_2( + obj, + sel, + zone, + ); } - static ffi.Pointer? _sel_unsignedCharValue; - int get unsignedCharValue { - _sel_unsignedCharValue ??= _registerName(_lib, "unsignedCharValue"); - return _lib._objc_msgSend_49(_id, _sel_unsignedCharValue!); - } + late final __objc_msgSend_2Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>(); - static ffi.Pointer? _sel_shortValue; - int get shortValue { - _sel_shortValue ??= _registerName(_lib, "shortValue"); - return _lib._objc_msgSend_50(_id, _sel_shortValue!); + ffi.Pointer _objc_msgSend_3( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_3( + obj, + sel, + ); } - static ffi.Pointer? _sel_unsignedShortValue; - int get unsignedShortValue { - _sel_unsignedShortValue ??= _registerName(_lib, "unsignedShortValue"); - return _lib._objc_msgSend_51(_id, _sel_unsignedShortValue!); - } + late final __objc_msgSend_3Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - static ffi.Pointer? _sel_intValue; - int get intValue { - _sel_intValue ??= _registerName(_lib, "intValue"); - return _lib._objc_msgSend_52(_id, _sel_intValue!); + ffi.Pointer _objc_msgSend_4( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_4( + obj, + sel, + ); } - static ffi.Pointer? _sel_unsignedIntValue; - int get unsignedIntValue { - _sel_unsignedIntValue ??= _registerName(_lib, "unsignedIntValue"); - return _lib._objc_msgSend_53(_id, _sel_unsignedIntValue!); - } + late final __objc_msgSend_4Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - static ffi.Pointer? _sel_longValue; - int get longValue { - _sel_longValue ??= _registerName(_lib, "longValue"); - return _lib._objc_msgSend_54(_id, _sel_longValue!); + ffi.Pointer _objc_msgSend_5( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_5( + obj, + sel, + zone, + ); } - static ffi.Pointer? _sel_unsignedLongValue; - int get unsignedLongValue { - _sel_unsignedLongValue ??= _registerName(_lib, "unsignedLongValue"); - return _lib._objc_msgSend_55(_id, _sel_unsignedLongValue!); - } + late final __objc_msgSend_5Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); - static ffi.Pointer? _sel_longLongValue; - int get longLongValue { - _sel_longLongValue ??= _registerName(_lib, "longLongValue"); - return _lib._objc_msgSend_56(_id, _sel_longLongValue!); + ffi.Pointer _objc_msgSend_6( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_6( + obj, + sel, + zone, + ); } - static ffi.Pointer? _sel_unsignedLongLongValue; - int get unsignedLongLongValue { - _sel_unsignedLongLongValue ??= _registerName(_lib, "unsignedLongLongValue"); - return _lib._objc_msgSend_57(_id, _sel_unsignedLongLongValue!); - } + late final __objc_msgSend_6Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); - static ffi.Pointer? _sel_floatValue; - double get floatValue { - _sel_floatValue ??= _registerName(_lib, "floatValue"); - return _lib._objc_msgSend_58(_id, _sel_floatValue!); + bool _objc_msgSend_7( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_7( + obj, + sel, + aSelector, + ) != + 0; } - static ffi.Pointer? _sel_doubleValue; - double get doubleValue { - _sel_doubleValue ??= _registerName(_lib, "doubleValue"); - return _lib._objc_msgSend_59(_id, _sel_doubleValue!); - } + late final __objc_msgSend_7Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - static ffi.Pointer? _sel_boolValue; - bool get boolValue { - _sel_boolValue ??= _registerName(_lib, "boolValue"); - return _lib._objc_msgSend_16(_id, _sel_boolValue!); + bool _objc_msgSend_8( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer protocol, + ) { + return __objc_msgSend_8( + obj, + sel, + protocol, + ) != + 0; } - static ffi.Pointer? _sel_integerValue; - int get integerValue { - _sel_integerValue ??= _registerName(_lib, "integerValue"); - return _lib._objc_msgSend_60(_id, _sel_integerValue!); - } + late final __objc_msgSend_8Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - static ffi.Pointer? _sel_unsignedIntegerValue; - int get unsignedIntegerValue { - _sel_unsignedIntegerValue ??= _registerName(_lib, "unsignedIntegerValue"); - return _lib._objc_msgSend_20(_id, _sel_unsignedIntegerValue!); + IMP _objc_msgSend_9( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_9( + obj, + sel, + aSelector, + ); } - static ffi.Pointer? _sel_stringValue; - NSObject get stringValue { - _sel_stringValue ??= _registerName(_lib, "stringValue"); - final _ret = _lib._objc_msgSend_61(_id, _sel_stringValue!); - return NSObject._(_ret, _lib); - } + late final __objc_msgSend_9Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - static ffi.Pointer? _sel_compare; - int compare(NSObject otherNumber) { - _sel_compare ??= _registerName(_lib, "compare:"); - return _lib._objc_msgSend_62(_id, _sel_compare!, otherNumber._id); + IMP _objc_msgSend_10( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_10( + obj, + sel, + aSelector, + ); } - static ffi.Pointer? _sel_isEqualToNumber; - bool isEqualToNumber(NSObject number) { - _sel_isEqualToNumber ??= _registerName(_lib, "isEqualToNumber:"); - return _lib._objc_msgSend_63(_id, _sel_isEqualToNumber!, number._id); - } + late final __objc_msgSend_10Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - static ffi.Pointer? _sel_descriptionWithLocale; - NSString descriptionWithLocale(NSObject locale) { - _sel_descriptionWithLocale ??= - _registerName(_lib, "descriptionWithLocale:"); - final _ret = - _lib._objc_msgSend_64(_id, _sel_descriptionWithLocale!, locale._id); - return NSString._(_ret, _lib); + void _objc_msgSend_11( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_11( + obj, + sel, + aSelector, + ); } - static ffi.Pointer? _sel_new1; - static NSNumber new1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSNumber"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); - return NSNumber._(_ret, _lib); - } + late final __objc_msgSend_11Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - static ffi.Pointer? _sel_alloc; - static NSNumber alloc(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSNumber"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); - return NSNumber._(_ret, _lib); + ffi.Pointer _objc_msgSend_12( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_12( + obj, + sel, + aSelector, + ); } -} - -class _NSRange extends ffi.Struct { - @NSUInteger() - external int location; - - @NSUInteger() - external int length; -} - -class NSFastEnumerationState extends ffi.Struct { - @pkg_ffi.UnsignedLong() - external int state; - - external ffi.Pointer> itemsPtr; - external ffi.Pointer mutationsPtr; - - @ffi.Array.multi([5]) - external ffi.Array extra; -} - -class NSEnumerator extends NSObject { - NSEnumerator._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); - - static ffi.Pointer? _class; + late final __objc_msgSend_12Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); - static NSEnumerator castFrom(T other) { - return NSEnumerator._(other._id, other._lib); + void _objc_msgSend_13( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anInvocation, + ) { + return __objc_msgSend_13( + obj, + sel, + anInvocation, + ); } - static ffi.Pointer? _sel_nextObject; - NSObject nextObject() { - _sel_nextObject ??= _registerName(_lib, "nextObject"); - final _ret = _lib._objc_msgSend_65(_id, _sel_nextObject!); - return NSObject._(_ret, _lib); - } + late final __objc_msgSend_13Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - static ffi.Pointer? _sel_new1; - static NSEnumerator new1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSEnumerator"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); - return NSEnumerator._(_ret, _lib); + ffi.Pointer _objc_msgSend_14( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_14( + obj, + sel, + aSelector, + ); } - static ffi.Pointer? _sel_alloc; - static NSEnumerator alloc(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSEnumerator"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); - return NSEnumerator._(_ret, _lib); + late final __objc_msgSend_14Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_15( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_15( + obj, + sel, + aSelector, + ); } -} -abstract class NSCollectionChangeType { - static const int NSCollectionChangeInsert = 0; - static const int NSCollectionChangeRemove = 1; -} + late final __objc_msgSend_15Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); -class NSOrderedCollectionChange extends NSObject { - NSOrderedCollectionChange._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); + bool _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_16( + obj, + sel, + ) != + 0; + } - static ffi.Pointer? _class; + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); - static NSOrderedCollectionChange castFrom(T other) { - return NSOrderedCollectionChange._(other._id, other._lib); + bool _objc_msgSend_17( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ) { + return __objc_msgSend_17( + obj, + sel, + aClass, + ) != + 0; } - static ffi.Pointer? _sel_object; - NSObject get object { - _sel_object ??= _registerName(_lib, "object"); - final _ret = _lib._objc_msgSend_66(_id, _sel_object!); - return NSObject._(_ret, _lib); - } + late final __objc_msgSend_17Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - static ffi.Pointer? _sel_changeType; - int get changeType { - _sel_changeType ??= _registerName(_lib, "changeType"); - return _lib._objc_msgSend_67(_id, _sel_changeType!); + bool _objc_msgSend_18( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sel1, + ) { + return __objc_msgSend_18( + obj, + sel, + sel1, + ) != + 0; } - static ffi.Pointer? _sel_index; - int get index { - _sel_index ??= _registerName(_lib, "index"); - return _lib._objc_msgSend_20(_id, _sel_index!); - } + late final __objc_msgSend_18Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - static ffi.Pointer? _sel_associatedIndex; - int get associatedIndex { - _sel_associatedIndex ??= _registerName(_lib, "associatedIndex"); - return _lib._objc_msgSend_20(_id, _sel_associatedIndex!); + bool _objc_msgSend_19( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sel1, + ) { + return __objc_msgSend_19( + obj, + sel, + sel1, + ) != + 0; } - static ffi.Pointer? _sel_init; - @override - NSObject init() { - _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_68(_id, _sel_init!); - return NSObject._(_ret, _lib); - } + late final __objc_msgSend_19Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - static ffi.Pointer? _sel_initWithObject_type_index; - NSOrderedCollectionChange initWithObject_type_index( - NSObject anObject, int type, int index) { - _sel_initWithObject_type_index ??= - _registerName(_lib, "initWithObject:type:index:"); - final _ret = _lib._objc_msgSend_69( - _id, _sel_initWithObject_type_index!, anObject._id, type, index); - return NSOrderedCollectionChange._(_ret, _lib); + int _objc_msgSend_20( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_20( + obj, + sel, + ); } - static ffi.Pointer? _sel_initWithObject_type_index_associatedIndex; - NSOrderedCollectionChange initWithObject_type_index_associatedIndex( - NSObject anObject, int type, int index, int associatedIndex) { - _sel_initWithObject_type_index_associatedIndex ??= - _registerName(_lib, "initWithObject:type:index:associatedIndex:"); - final _ret = _lib._objc_msgSend_70( - _id, - _sel_initWithObject_type_index_associatedIndex!, - anObject._id, - type, - index, - associatedIndex); - return NSOrderedCollectionChange._(_ret, _lib); - } + late final __objc_msgSend_20Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); - static ffi.Pointer? _sel_new1; - static NSOrderedCollectionChange new1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSOrderedCollectionChange"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); - return NSOrderedCollectionChange._(_ret, _lib); + ffi.Pointer _objc_msgSend_21( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_21( + obj, + sel, + ); } - static ffi.Pointer? _sel_alloc; - static NSOrderedCollectionChange alloc(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSOrderedCollectionChange"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); - return NSOrderedCollectionChange._(_ret, _lib); - } -} + late final __objc_msgSend_21Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); -class NSIndexSet extends NSObject { - NSIndexSet._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); + ffi.Pointer _objc_msgSend_22( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_22( + obj, + sel, + ); + } - static ffi.Pointer? _class; + late final __objc_msgSend_22Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - static NSIndexSet castFrom(T other) { - return NSIndexSet._(other._id, other._lib); + int _objc_msgSend_23( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_23( + obj, + sel, + index, + ); } - static ffi.Pointer? _sel_indexSet; - static NSIndexSet indexSet(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSIndexSet"); - _sel_indexSet ??= _registerName(_lib, "indexSet"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_indexSet!); - return NSIndexSet._(_ret, _lib); - } + late final __objc_msgSend_23Ptr = _lookup< + ffi.NativeFunction< + unichar Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); - static ffi.Pointer? _sel_indexSetWithIndex; - static NSIndexSet indexSetWithIndex(NativeObjCLibrary _lib, int value) { - _class ??= _getClass(_lib, "NSIndexSet"); - _sel_indexSetWithIndex ??= _registerName(_lib, "indexSetWithIndex:"); - final _ret = _lib._objc_msgSend_71(_class!, _sel_indexSetWithIndex!, value); - return NSIndexSet._(_ret, _lib); + instancetype _objc_msgSend_24( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_24( + obj, + sel, + coder, + ); } - static ffi.Pointer? _sel_indexSetWithIndexesInRange; - static NSIndexSet indexSetWithIndexesInRange( - NativeObjCLibrary _lib, NSRange range) { - _class ??= _getClass(_lib, "NSIndexSet"); - _sel_indexSetWithIndexesInRange ??= - _registerName(_lib, "indexSetWithIndexesInRange:"); - final _ret = - _lib._objc_msgSend_72(_class!, _sel_indexSetWithIndexesInRange!, range); - return NSIndexSet._(_ret, _lib); - } + late final __objc_msgSend_24Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - static ffi.Pointer? _sel_initWithIndexesInRange; - NSIndexSet initWithIndexesInRange(NSRange range) { - _sel_initWithIndexesInRange ??= - _registerName(_lib, "initWithIndexesInRange:"); - final _ret = - _lib._objc_msgSend_72(_id, _sel_initWithIndexesInRange!, range); - return NSIndexSet._(_ret, _lib); + ffi.Pointer _objc_msgSend_25( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cString, + int enc, + ) { + return __objc_msgSend_25( + obj, + sel, + cString, + enc, + ); } - static ffi.Pointer? _sel_initWithIndexSet; - NSIndexSet initWithIndexSet(NSObject indexSet) { - _sel_initWithIndexSet ??= _registerName(_lib, "initWithIndexSet:"); - final _ret = - _lib._objc_msgSend_73(_id, _sel_initWithIndexSet!, indexSet._id); - return NSIndexSet._(_ret, _lib); - } + late final __objc_msgSend_25Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + pkg_ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); - static ffi.Pointer? _sel_initWithIndex; - NSIndexSet initWithIndex(int value) { - _sel_initWithIndex ??= _registerName(_lib, "initWithIndex:"); - final _ret = _lib._objc_msgSend_71(_id, _sel_initWithIndex!, value); - return NSIndexSet._(_ret, _lib); + ffi.Pointer _objc_msgSend_26( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_26( + obj, + sel, + ); } - static ffi.Pointer? _sel_isEqualToIndexSet; - bool isEqualToIndexSet(NSObject indexSet) { - _sel_isEqualToIndexSet ??= _registerName(_lib, "isEqualToIndexSet:"); - return _lib._objc_msgSend_74(_id, _sel_isEqualToIndexSet!, indexSet._id); - } + late final __objc_msgSend_26Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - static ffi.Pointer? _sel_count; - int get count { - _sel_count ??= _registerName(_lib, "count"); - return _lib._objc_msgSend_20(_id, _sel_count!); + ffi.Pointer _objc_msgSend_27( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_27( + obj, + sel, + ); } - static ffi.Pointer? _sel_firstIndex; - int get firstIndex { - _sel_firstIndex ??= _registerName(_lib, "firstIndex"); - return _lib._objc_msgSend_20(_id, _sel_firstIndex!); + late final __objc_msgSend_27Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + int _objc_msgSend_28( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_28( + obj, + sel, + ); } - static ffi.Pointer? _sel_lastIndex; - int get lastIndex { - _sel_lastIndex ??= _registerName(_lib, "lastIndex"); - return _lib._objc_msgSend_20(_id, _sel_lastIndex!); - } + late final __objc_msgSend_28Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_28 = __objc_msgSend_28Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); - static ffi.Pointer? _sel_indexGreaterThanIndex; - int indexGreaterThanIndex(int value) { - _sel_indexGreaterThanIndex ??= - _registerName(_lib, "indexGreaterThanIndex:"); - return _lib._objc_msgSend_75(_id, _sel_indexGreaterThanIndex!, value); + void _objc_msgSend_29( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_29( + obj, + sel, + value, + ); } - static ffi.Pointer? _sel_indexLessThanIndex; - int indexLessThanIndex(int value) { - _sel_indexLessThanIndex ??= _registerName(_lib, "indexLessThanIndex:"); - return _lib._objc_msgSend_75(_id, _sel_indexLessThanIndex!, value); - } + late final __objc_msgSend_29Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_29 = __objc_msgSend_29Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); - static ffi.Pointer? _sel_indexGreaterThanOrEqualToIndex; - int indexGreaterThanOrEqualToIndex(int value) { - _sel_indexGreaterThanOrEqualToIndex ??= - _registerName(_lib, "indexGreaterThanOrEqualToIndex:"); - return _lib._objc_msgSend_75( - _id, _sel_indexGreaterThanOrEqualToIndex!, value); + ffi.Pointer _objc_msgSend_30( + ffi.Pointer obj, + ffi.Pointer sel, + double x, + ) { + return __objc_msgSend_30( + obj, + sel, + x, + ); } - static ffi.Pointer? _sel_indexLessThanOrEqualToIndex; - int indexLessThanOrEqualToIndex(int value) { - _sel_indexLessThanOrEqualToIndex ??= - _registerName(_lib, "indexLessThanOrEqualToIndex:"); - return _lib._objc_msgSend_75(_id, _sel_indexLessThanOrEqualToIndex!, value); - } + late final __objc_msgSend_30Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_30 = __objc_msgSend_30Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); - static ffi.Pointer? _sel_getIndexes_maxCount_inIndexRange; - int getIndexes_maxCount_inIndexRange(ffi.Pointer indexBuffer, - int bufferSize, NSRangePointer range) { - _sel_getIndexes_maxCount_inIndexRange ??= - _registerName(_lib, "getIndexes:maxCount:inIndexRange:"); - return _lib._objc_msgSend_76(_id, _sel_getIndexes_maxCount_inIndexRange!, - indexBuffer, bufferSize, range); + int _objc_msgSend_31( + ffi.Pointer obj, + ffi.Pointer sel, + bool useIntVals, + ffi.Pointer other, + ) { + return __objc_msgSend_31( + obj, + sel, + useIntVals ? 1 : 0, + other, + ); } - static ffi.Pointer? _sel_countOfIndexesInRange; - int countOfIndexesInRange(NSRange range) { - _sel_countOfIndexesInRange ??= - _registerName(_lib, "countOfIndexesInRange:"); - return _lib._objc_msgSend_77(_id, _sel_countOfIndexesInRange!, range); - } + late final __objc_msgSend_31Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_31 = __objc_msgSend_31Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); - static ffi.Pointer? _sel_containsIndex; - bool containsIndex(int value) { - _sel_containsIndex ??= _registerName(_lib, "containsIndex:"); - return _lib._objc_msgSend_78(_id, _sel_containsIndex!, value); + void _objc_msgSend_32( + ffi.Pointer obj, + ffi.Pointer sel, + double x, + ) { + return __objc_msgSend_32( + obj, + sel, + x, + ); } - static ffi.Pointer? _sel_containsIndexesInRange; - bool containsIndexesInRange(NSRange range) { - _sel_containsIndexesInRange ??= - _registerName(_lib, "containsIndexesInRange:"); - return _lib._objc_msgSend_79(_id, _sel_containsIndexesInRange!, range); - } + late final __objc_msgSend_32Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_32 = __objc_msgSend_32Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double)>(); +} - static ffi.Pointer? _sel_containsIndexes; - bool containsIndexes(NSObject indexSet) { - _sel_containsIndexes ??= _registerName(_lib, "containsIndexes:"); - return _lib._objc_msgSend_80(_id, _sel_containsIndexes!, indexSet._id); - } +abstract class NSComparisonResult { + static const int NSOrderedAscending = -1; + static const int NSOrderedSame = 0; + static const int NSOrderedDescending = 1; +} - static ffi.Pointer? _sel_intersectsIndexesInRange; - bool intersectsIndexesInRange(NSRange range) { - _sel_intersectsIndexesInRange ??= - _registerName(_lib, "intersectsIndexesInRange:"); - return _lib._objc_msgSend_79(_id, _sel_intersectsIndexesInRange!, range); - } +abstract class NSEnumerationOptions { + static const int NSEnumerationConcurrent = 1; + static const int NSEnumerationReverse = 2; +} - static ffi.Pointer? _sel_enumerateIndexesUsingBlock; - void enumerateIndexesUsingBlock(NSObject block) { - _sel_enumerateIndexesUsingBlock ??= - _registerName(_lib, "enumerateIndexesUsingBlock:"); - _lib._objc_msgSend_81(_id, _sel_enumerateIndexesUsingBlock!, block._id); - } +abstract class NSSortOptions { + static const int NSSortConcurrent = 1; + static const int NSSortStable = 16; +} - static ffi.Pointer? _sel_enumerateIndexesWithOptions_usingBlock; - void enumerateIndexesWithOptions_usingBlock(int opts, NSObject block) { - _sel_enumerateIndexesWithOptions_usingBlock ??= - _registerName(_lib, "enumerateIndexesWithOptions:usingBlock:"); - _lib._objc_msgSend_82( - _id, _sel_enumerateIndexesWithOptions_usingBlock!, opts, block._id); - } +abstract class NSQualityOfService { + static const int NSQualityOfServiceUserInteractive = 33; + static const int NSQualityOfServiceUserInitiated = 25; + static const int NSQualityOfServiceUtility = 17; + static const int NSQualityOfServiceBackground = 9; + static const int NSQualityOfServiceDefault = -1; +} - static ffi.Pointer? _sel_enumerateIndexesInRange_options_usingBlock; - void enumerateIndexesInRange_options_usingBlock( - NSRange range, int opts, NSObject block) { - _sel_enumerateIndexesInRange_options_usingBlock ??= - _registerName(_lib, "enumerateIndexesInRange:options:usingBlock:"); - _lib._objc_msgSend_83(_id, _sel_enumerateIndexesInRange_options_usingBlock!, - range, opts, block._id); - } +typedef NSInteger = pkg_ffi.Long; - static ffi.Pointer? _sel_indexPassingTest; - int indexPassingTest(NSObject predicate) { - _sel_indexPassingTest ??= _registerName(_lib, "indexPassingTest:"); - return _lib._objc_msgSend_84(_id, _sel_indexPassingTest!, predicate._id); - } +class __CFString extends ffi.Opaque {} - static ffi.Pointer? _sel_indexWithOptions_passingTest; - int indexWithOptions_passingTest(int opts, NSObject predicate) { - _sel_indexWithOptions_passingTest ??= - _registerName(_lib, "indexWithOptions:passingTest:"); - return _lib._objc_msgSend_85( - _id, _sel_indexWithOptions_passingTest!, opts, predicate._id); - } +abstract class CFComparisonResult { + static const int kCFCompareLessThan = -1; + static const int kCFCompareEqualTo = 0; + static const int kCFCompareGreaterThan = 1; +} - static ffi.Pointer? _sel_indexInRange_options_passingTest; - int indexInRange_options_passingTest( - NSRange range, int opts, NSObject predicate) { - _sel_indexInRange_options_passingTest ??= - _registerName(_lib, "indexInRange:options:passingTest:"); - return _lib._objc_msgSend_86(_id, _sel_indexInRange_options_passingTest!, - range, opts, predicate._id); - } +typedef CFIndex = pkg_ffi.Long; - static ffi.Pointer? _sel_indexesPassingTest; - NSIndexSet indexesPassingTest(NSObject predicate) { - _sel_indexesPassingTest ??= _registerName(_lib, "indexesPassingTest:"); - final _ret = - _lib._objc_msgSend_87(_id, _sel_indexesPassingTest!, predicate._id); - return NSIndexSet._(_ret, _lib); - } +class CFRange extends ffi.Struct { + @CFIndex() + external int location; - static ffi.Pointer? _sel_indexesWithOptions_passingTest; - NSIndexSet indexesWithOptions_passingTest(int opts, NSObject predicate) { - _sel_indexesWithOptions_passingTest ??= - _registerName(_lib, "indexesWithOptions:passingTest:"); - final _ret = _lib._objc_msgSend_88( - _id, _sel_indexesWithOptions_passingTest!, opts, predicate._id); - return NSIndexSet._(_ret, _lib); - } + @CFIndex() + external int length; +} - static ffi.Pointer? _sel_indexesInRange_options_passingTest; - NSIndexSet indexesInRange_options_passingTest( - NSRange range, int opts, NSObject predicate) { - _sel_indexesInRange_options_passingTest ??= - _registerName(_lib, "indexesInRange:options:passingTest:"); - final _ret = _lib._objc_msgSend_89(_id, - _sel_indexesInRange_options_passingTest!, range, opts, predicate._id); - return NSIndexSet._(_ret, _lib); - } +class __CFNull extends ffi.Opaque {} - static ffi.Pointer? _sel_enumerateRangesUsingBlock; - void enumerateRangesUsingBlock(NSObject block) { - _sel_enumerateRangesUsingBlock ??= - _registerName(_lib, "enumerateRangesUsingBlock:"); - _lib._objc_msgSend_90(_id, _sel_enumerateRangesUsingBlock!, block._id); - } +typedef CFNullRef = ffi.Pointer<__CFNull>; - static ffi.Pointer? _sel_enumerateRangesWithOptions_usingBlock; - void enumerateRangesWithOptions_usingBlock(int opts, NSObject block) { - _sel_enumerateRangesWithOptions_usingBlock ??= - _registerName(_lib, "enumerateRangesWithOptions:usingBlock:"); - _lib._objc_msgSend_91( - _id, _sel_enumerateRangesWithOptions_usingBlock!, opts, block._id); - } +class __CFAllocator extends ffi.Opaque {} - static ffi.Pointer? _sel_enumerateRangesInRange_options_usingBlock; - void enumerateRangesInRange_options_usingBlock( - NSRange range, int opts, NSObject block) { - _sel_enumerateRangesInRange_options_usingBlock ??= - _registerName(_lib, "enumerateRangesInRange:options:usingBlock:"); - _lib._objc_msgSend_92(_id, _sel_enumerateRangesInRange_options_usingBlock!, - range, opts, block._id); - } +typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; - static ffi.Pointer? _sel_new1; - static NSIndexSet new1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSIndexSet"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); - return NSIndexSet._(_ret, _lib); - } +class CFAllocatorContext extends ffi.Struct { + @CFIndex() + external int version; - static ffi.Pointer? _sel_alloc; - static NSIndexSet alloc(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSIndexSet"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); - return NSIndexSet._(_ret, _lib); - } -} + external ffi.Pointer info; -typedef NSRange = _NSRange; -typedef NSRangePointer = ffi.Pointer; + external CFAllocatorRetainCallBack retain; -class NSMutableIndexSet extends NSIndexSet { - NSMutableIndexSet._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); + external CFAllocatorReleaseCallBack release; - static ffi.Pointer? _class; + external CFAllocatorCopyDescriptionCallBack copyDescription; - static NSMutableIndexSet castFrom(T other) { - return NSMutableIndexSet._(other._id, other._lib); - } + external CFAllocatorAllocateCallBack allocate; - static ffi.Pointer? _sel_addIndexes; - void addIndexes(NSObject indexSet) { - _sel_addIndexes ??= _registerName(_lib, "addIndexes:"); - _lib._objc_msgSend_93(_id, _sel_addIndexes!, indexSet._id); - } + external CFAllocatorReallocateCallBack reallocate; - static ffi.Pointer? _sel_removeIndexes; - void removeIndexes(NSObject indexSet) { - _sel_removeIndexes ??= _registerName(_lib, "removeIndexes:"); - _lib._objc_msgSend_94(_id, _sel_removeIndexes!, indexSet._id); - } + external CFAllocatorDeallocateCallBack deallocate; - static ffi.Pointer? _sel_removeAllIndexes; - void removeAllIndexes() { - _sel_removeAllIndexes ??= _registerName(_lib, "removeAllIndexes"); - _lib._objc_msgSend_0(_id, _sel_removeAllIndexes!); - } + external CFAllocatorPreferredSizeCallBack preferredSize; +} - static ffi.Pointer? _sel_addIndex; - void addIndex(int value) { - _sel_addIndex ??= _registerName(_lib, "addIndex:"); - _lib._objc_msgSend_95(_id, _sel_addIndex!, value); - } +typedef CFAllocatorRetainCallBack = ffi.Pointer< + ffi.NativeFunction Function(ffi.Pointer)>>; +typedef CFAllocatorReleaseCallBack + = ffi.Pointer)>>; +typedef CFAllocatorCopyDescriptionCallBack = ffi + .Pointer)>>; +typedef CFStringRef = ffi.Pointer<__CFString>; +typedef CFAllocatorAllocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + CFIndex, CFOptionFlags, ffi.Pointer)>>; +typedef CFOptionFlags = pkg_ffi.UnsignedLong; +typedef CFAllocatorReallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, CFIndex, + CFOptionFlags, ffi.Pointer)>>; +typedef CFAllocatorDeallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; +typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< + ffi.NativeFunction< + CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; - static ffi.Pointer? _sel_removeIndex; - void removeIndex(int value) { - _sel_removeIndex ??= _registerName(_lib, "removeIndex:"); - _lib._objc_msgSend_95(_id, _sel_removeIndex!, value); - } +class _NSRange extends ffi.Struct { + @NSUInteger() + external int location; - static ffi.Pointer? _sel_addIndexesInRange; - void addIndexesInRange(NSRange range) { - _sel_addIndexesInRange ??= _registerName(_lib, "addIndexesInRange:"); - _lib._objc_msgSend_96(_id, _sel_addIndexesInRange!, range); - } + @NSUInteger() + external int length; +} - static ffi.Pointer? _sel_removeIndexesInRange; - void removeIndexesInRange(NSRange range) { - _sel_removeIndexesInRange ??= _registerName(_lib, "removeIndexesInRange:"); - _lib._objc_msgSend_96(_id, _sel_removeIndexesInRange!, range); - } +typedef NSUInteger = pkg_ffi.UnsignedLong; - static ffi.Pointer? _sel_shiftIndexesStartingAtIndex_by; - void shiftIndexesStartingAtIndex_by(int index, int delta) { - _sel_shiftIndexesStartingAtIndex_by ??= - _registerName(_lib, "shiftIndexesStartingAtIndex:by:"); - _lib._objc_msgSend_97( - _id, _sel_shiftIndexesStartingAtIndex_by!, index, delta); - } +class NSFastEnumerationState extends ffi.Struct { + @pkg_ffi.UnsignedLong() + external int state; - static ffi.Pointer? _sel_indexSet; - static NSMutableIndexSet indexSet(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSMutableIndexSet"); - _sel_indexSet ??= _registerName(_lib, "indexSet"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_indexSet!); - return NSMutableIndexSet._(_ret, _lib); - } + external ffi.Pointer> itemsPtr; - static ffi.Pointer? _sel_indexSetWithIndex; - static NSMutableIndexSet indexSetWithIndex( - NativeObjCLibrary _lib, int value) { - _class ??= _getClass(_lib, "NSMutableIndexSet"); - _sel_indexSetWithIndex ??= _registerName(_lib, "indexSetWithIndex:"); - final _ret = _lib._objc_msgSend_71(_class!, _sel_indexSetWithIndex!, value); - return NSMutableIndexSet._(_ret, _lib); - } + external ffi.Pointer mutationsPtr; - static ffi.Pointer? _sel_indexSetWithIndexesInRange; - static NSMutableIndexSet indexSetWithIndexesInRange( - NativeObjCLibrary _lib, NSRange range) { - _class ??= _getClass(_lib, "NSMutableIndexSet"); - _sel_indexSetWithIndexesInRange ??= - _registerName(_lib, "indexSetWithIndexesInRange:"); - final _ret = - _lib._objc_msgSend_72(_class!, _sel_indexSetWithIndexesInRange!, range); - return NSMutableIndexSet._(_ret, _lib); - } + @ffi.Array.multi([5]) + external ffi.Array extra; +} - static ffi.Pointer? _sel_new1; - static NSMutableIndexSet new1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSMutableIndexSet"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); - return NSMutableIndexSet._(_ret, _lib); - } +class ObjCObject extends ffi.Opaque {} - static ffi.Pointer? _sel_alloc; - static NSMutableIndexSet alloc(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSMutableIndexSet"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); - return NSMutableIndexSet._(_ret, _lib); - } +abstract class NSCollectionChangeType { + static const int NSCollectionChangeInsert = 0; + static const int NSCollectionChangeRemove = 1; } abstract class NSOrderedCollectionDifferenceCalculationOptions { @@ -4581,682 +1211,466 @@ abstract class NSOrderedCollectionDifferenceCalculationOptions { static const int NSOrderedCollectionDifferenceCalculationInferMoves = 4; } -class NSOrderedCollectionDifference extends NSObject { - NSOrderedCollectionDifference._( - ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); - - static ffi.Pointer? _class; +abstract class NSBinarySearchingOptions { + static const int NSBinarySearchingFirstEqual = 256; + static const int NSBinarySearchingLastEqual = 512; + static const int NSBinarySearchingInsertionIndex = 1024; +} - static NSOrderedCollectionDifference castFrom( - T other) { - return NSOrderedCollectionDifference._(other._id, other._lib); - } +abstract class NSItemProviderRepresentationVisibility { + static const int NSItemProviderRepresentationVisibilityAll = 0; + static const int NSItemProviderRepresentationVisibilityTeam = 1; + static const int NSItemProviderRepresentationVisibilityGroup = 2; + static const int NSItemProviderRepresentationVisibilityOwnProcess = 3; +} - static ffi.Pointer? _sel_initWithChanges; - NSOrderedCollectionDifference initWithChanges(NSObject changes) { - _sel_initWithChanges ??= _registerName(_lib, "initWithChanges:"); - final _ret = _lib._objc_msgSend_98(_id, _sel_initWithChanges!, changes._id); - return NSOrderedCollectionDifference._(_ret, _lib); - } +abstract class NSItemProviderFileOptions { + static const int NSItemProviderFileOptionOpenInPlace = 1; +} - static ffi.Pointer? - _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges; - NSOrderedCollectionDifference - initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges( - NSObject inserts, - NSObject insertedObjects, - NSObject removes, - NSObject removedObjects, - NSObject changes) { - _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges ??= - _registerName(_lib, - "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:additionalChanges:"); - final _ret = _lib._objc_msgSend_99( - _id, - _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges!, - inserts._id, - insertedObjects._id, - removes._id, - removedObjects._id, - changes._id); - return NSOrderedCollectionDifference._(_ret, _lib); - } +abstract class NSItemProviderErrorCode { + static const int NSItemProviderUnknownError = -1; + static const int NSItemProviderItemUnavailableError = -1000; + static const int NSItemProviderUnexpectedValueClassError = -1100; + static const int NSItemProviderUnavailableCoercionError = -1200; +} - static ffi.Pointer? - _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects; - NSOrderedCollectionDifference - initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects( - NSObject inserts, - NSObject insertedObjects, - NSObject removes, - NSObject removedObjects) { - _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects ??= - _registerName(_lib, - "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:"); - final _ret = _lib._objc_msgSend_100( - _id, - _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects!, - inserts._id, - insertedObjects._id, - removes._id, - removedObjects._id); - return NSOrderedCollectionDifference._(_ret, _lib); - } +abstract class NSStringCompareOptions { + static const int NSCaseInsensitiveSearch = 1; + static const int NSLiteralSearch = 2; + static const int NSBackwardsSearch = 4; + static const int NSAnchoredSearch = 8; + static const int NSNumericSearch = 64; + static const int NSDiacriticInsensitiveSearch = 128; + static const int NSWidthInsensitiveSearch = 256; + static const int NSForcedOrderingSearch = 512; + static const int NSRegularExpressionSearch = 1024; +} - static ffi.Pointer? _sel_insertions; - NSObject get insertions { - _sel_insertions ??= _registerName(_lib, "insertions"); - final _ret = _lib._objc_msgSend_101(_id, _sel_insertions!); - return NSObject._(_ret, _lib); - } +abstract class NSStringEncodingConversionOptions { + static const int NSStringEncodingConversionAllowLossy = 1; + static const int NSStringEncodingConversionExternalRepresentation = 2; +} - static ffi.Pointer? _sel_removals; - NSObject get removals { - _sel_removals ??= _registerName(_lib, "removals"); - final _ret = _lib._objc_msgSend_102(_id, _sel_removals!); - return NSObject._(_ret, _lib); - } +abstract class NSStringEnumerationOptions { + static const int NSStringEnumerationByLines = 0; + static const int NSStringEnumerationByParagraphs = 1; + static const int NSStringEnumerationByComposedCharacterSequences = 2; + static const int NSStringEnumerationByWords = 3; + static const int NSStringEnumerationBySentences = 4; + static const int NSStringEnumerationByCaretPositions = 5; + static const int NSStringEnumerationByDeletionClusters = 6; + static const int NSStringEnumerationReverse = 256; + static const int NSStringEnumerationSubstringNotRequired = 512; + static const int NSStringEnumerationLocalized = 1024; +} - static ffi.Pointer? _sel_hasChanges; - bool get hasChanges { - _sel_hasChanges ??= _registerName(_lib, "hasChanges"); - return _lib._objc_msgSend_16(_id, _sel_hasChanges!); - } +typedef NSStringTransform = ffi.Pointer; +typedef NSStringEncodingDetectionOptionsKey = ffi.Pointer; +typedef NSExceptionName = ffi.Pointer; - static ffi.Pointer? _sel_inverseDifference; - NSOrderedCollectionDifference inverseDifference() { - _sel_inverseDifference ??= _registerName(_lib, "inverseDifference"); - final _ret = _lib._objc_msgSend_1(_id, _sel_inverseDifference!); - return NSOrderedCollectionDifference._(_ret, _lib); - } +ffi.Pointer _registerName(NativeObjCLibrary _lib, String name) { + final cstr = name.toNativeUtf8(); + final sel = _lib._sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; +} - static ffi.Pointer? _sel_new1; - static NSOrderedCollectionDifference new1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSOrderedCollectionDifference"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); - return NSOrderedCollectionDifference._(_ret, _lib); - } +ffi.Pointer _getClass(NativeObjCLibrary _lib, String name) { + final cstr = name.toNativeUtf8(); + final clazz = _lib._objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; +} - static ffi.Pointer? _sel_alloc; - static NSOrderedCollectionDifference alloc(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSOrderedCollectionDifference"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); - return NSOrderedCollectionDifference._(_ret, _lib); - } +class _ObjCWrapper { + final ffi.Pointer _id; + final NativeObjCLibrary _lib; + _ObjCWrapper._(this._id, this._lib); } -class NSArray extends NSObject { - NSArray._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); +class Foo extends NSObject { + Foo._(ffi.Pointer id, NativeObjCLibrary lib) : super._(id, lib); static ffi.Pointer? _class; - static NSArray castFrom(T other) { - return NSArray._(other._id, other._lib); + static Foo castFrom(T other) { + return Foo._(other._id, other._lib); } - static ffi.Pointer? _sel_count; - int get count { - _sel_count ??= _registerName(_lib, "count"); - return _lib._objc_msgSend_20(_id, _sel_count!); + static ffi.Pointer? _sel_intVal; + int get intVal { + _sel_intVal ??= _registerName(_lib, "intVal"); + return _lib._objc_msgSend_28(_id, _sel_intVal!); } - static ffi.Pointer? _sel_objectAtIndex; - NSObject objectAtIndex(int index) { - _sel_objectAtIndex ??= _registerName(_lib, "objectAtIndex:"); - final _ret = _lib._objc_msgSend_103(_id, _sel_objectAtIndex!, index); - return NSObject._(_ret, _lib); + static ffi.Pointer? _sel_intVal1; + set intVal(int value) { + _sel_intVal1 ??= _registerName(_lib, "setIntVal:"); + _lib._objc_msgSend_29(_id, _sel_intVal1!, value); } - static ffi.Pointer? _sel_init; - @override - NSArray init() { - _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_1(_id, _sel_init!); - return NSArray._(_ret, _lib); + static ffi.Pointer? _sel_makeFoo; + static Foo makeFoo(NativeObjCLibrary _lib, double x) { + _class ??= _getClass(_lib, "Foo"); + _sel_makeFoo ??= _registerName(_lib, "makeFoo:"); + final _ret = _lib._objc_msgSend_30(_class!, _sel_makeFoo!, x); + return Foo._(_ret, _lib); } - static ffi.Pointer? _sel_initWithObjects_count; - NSArray initWithObjects_count( - ffi.Pointer> objects, int cnt) { - _sel_initWithObjects_count ??= - _registerName(_lib, "initWithObjects:count:"); - final _ret = - _lib._objc_msgSend_104(_id, _sel_initWithObjects_count!, objects, cnt); - return NSArray._(_ret, _lib); + static ffi.Pointer? _sel_multiply_withOtherFoo; + int multiply_withOtherFoo(bool useIntVals, NSObject other) { + _sel_multiply_withOtherFoo ??= + _registerName(_lib, "multiply:withOtherFoo:"); + return _lib._objc_msgSend_31( + _id, _sel_multiply_withOtherFoo!, useIntVals, other._id); } - static ffi.Pointer? _sel_initWithCoder; - NSArray initWithCoder(NSObject coder) { - _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_105(_id, _sel_initWithCoder!, coder._id); - return NSArray._(_ret, _lib); + static ffi.Pointer? _sel_setDoubleVal; + void setDoubleVal(double x) { + _sel_setDoubleVal ??= _registerName(_lib, "setDoubleVal:"); + _lib._objc_msgSend_32(_id, _sel_setDoubleVal!, x); } static ffi.Pointer? _sel_new1; - static NSArray new1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSArray"); + static Foo new1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "Foo"); _sel_new1 ??= _registerName(_lib, "new"); final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); - return NSArray._(_ret, _lib); + return Foo._(_ret, _lib); } static ffi.Pointer? _sel_alloc; - static NSArray alloc(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSArray"); + static Foo alloc(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "Foo"); _sel_alloc ??= _registerName(_lib, "alloc"); final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); - return NSArray._(_ret, _lib); + return Foo._(_ret, _lib); } } -abstract class NSBinarySearchingOptions { - static const int NSBinarySearchingFirstEqual = 256; - static const int NSBinarySearchingLastEqual = 512; - static const int NSBinarySearchingInsertionIndex = 1024; -} - -class NSMutableArray extends NSArray { - NSMutableArray._(ffi.Pointer id, NativeObjCLibrary lib) +class NSObject extends _ObjCWrapper { + NSObject._(ffi.Pointer id, NativeObjCLibrary lib) : super._(id, lib); static ffi.Pointer? _class; - static NSMutableArray castFrom(T other) { - return NSMutableArray._(other._id, other._lib); - } - - static ffi.Pointer? _sel_addObject; - void addObject(NSObject anObject) { - _sel_addObject ??= _registerName(_lib, "addObject:"); - _lib._objc_msgSend_106(_id, _sel_addObject!, anObject._id); - } - - static ffi.Pointer? _sel_insertObject_atIndex; - void insertObject_atIndex(NSObject anObject, int index) { - _sel_insertObject_atIndex ??= _registerName(_lib, "insertObject:atIndex:"); - _lib._objc_msgSend_107( - _id, _sel_insertObject_atIndex!, anObject._id, index); - } - - static ffi.Pointer? _sel_removeLastObject; - void removeLastObject() { - _sel_removeLastObject ??= _registerName(_lib, "removeLastObject"); - _lib._objc_msgSend_0(_id, _sel_removeLastObject!); + static NSObject castFrom(T other) { + return NSObject._(other._id, other._lib); } - static ffi.Pointer? _sel_removeObjectAtIndex; - void removeObjectAtIndex(int index) { - _sel_removeObjectAtIndex ??= _registerName(_lib, "removeObjectAtIndex:"); - _lib._objc_msgSend_95(_id, _sel_removeObjectAtIndex!, index); + static ffi.Pointer? _sel_load; + static void load(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_load ??= _registerName(_lib, "load"); + _lib._objc_msgSend_0(_class!, _sel_load!); } - static ffi.Pointer? _sel_replaceObjectAtIndex_withObject; - void replaceObjectAtIndex_withObject(int index, NSObject anObject) { - _sel_replaceObjectAtIndex_withObject ??= - _registerName(_lib, "replaceObjectAtIndex:withObject:"); - _lib._objc_msgSend_108( - _id, _sel_replaceObjectAtIndex_withObject!, index, anObject._id); + static ffi.Pointer? _sel_initialize; + static void initialize(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_initialize ??= _registerName(_lib, "initialize"); + _lib._objc_msgSend_0(_class!, _sel_initialize!); } static ffi.Pointer? _sel_init; - @override - NSMutableArray init() { + NSObject init() { _sel_init ??= _registerName(_lib, "init"); final _ret = _lib._objc_msgSend_1(_id, _sel_init!); - return NSMutableArray._(_ret, _lib); - } - - static ffi.Pointer? _sel_initWithCapacity; - NSMutableArray initWithCapacity(int numItems) { - _sel_initWithCapacity ??= _registerName(_lib, "initWithCapacity:"); - final _ret = _lib._objc_msgSend_71(_id, _sel_initWithCapacity!, numItems); - return NSMutableArray._(_ret, _lib); - } - - static ffi.Pointer? _sel_initWithCoder; - @override - NSMutableArray initWithCoder(NSObject coder) { - _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_109(_id, _sel_initWithCoder!, coder._id); - return NSMutableArray._(_ret, _lib); + return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_new1; - static NSMutableArray new1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSMutableArray"); + static NSObject new1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); _sel_new1 ??= _registerName(_lib, "new"); final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); - return NSMutableArray._(_ret, _lib); + return NSObject._(_ret, _lib); + } + + static ffi.Pointer? _sel_allocWithZone; + static NSObject allocWithZone( + NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_allocWithZone ??= _registerName(_lib, "allocWithZone:"); + final _ret = _lib._objc_msgSend_2(_class!, _sel_allocWithZone!, zone); + return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_alloc; - static NSMutableArray alloc(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSMutableArray"); + static NSObject alloc(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); _sel_alloc ??= _registerName(_lib, "alloc"); final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); - return NSMutableArray._(_ret, _lib); + return NSObject._(_ret, _lib); } -} - -abstract class NSItemProviderRepresentationVisibility { - static const int NSItemProviderRepresentationVisibilityAll = 0; - static const int NSItemProviderRepresentationVisibilityTeam = 1; - static const int NSItemProviderRepresentationVisibilityGroup = 2; - static const int NSItemProviderRepresentationVisibilityOwnProcess = 3; -} - -abstract class NSItemProviderFileOptions { - static const int NSItemProviderFileOptionOpenInPlace = 1; -} -class NSItemProvider extends NSObject { - NSItemProvider._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); - - static ffi.Pointer? _class; + static ffi.Pointer? _sel_dealloc; + void dealloc() { + _sel_dealloc ??= _registerName(_lib, "dealloc"); + _lib._objc_msgSend_0(_id, _sel_dealloc!); + } - static NSItemProvider castFrom(T other) { - return NSItemProvider._(other._id, other._lib); + static ffi.Pointer? _sel_finalize; + void finalize() { + _sel_finalize ??= _registerName(_lib, "finalize"); + _lib._objc_msgSend_0(_id, _sel_finalize!); } - static ffi.Pointer? _sel_init; - @override - NSItemProvider init() { - _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_1(_id, _sel_init!); - return NSItemProvider._(_ret, _lib); + static ffi.Pointer? _sel_copy; + NSObject copy() { + _sel_copy ??= _registerName(_lib, "copy"); + final _ret = _lib._objc_msgSend_3(_id, _sel_copy!); + return NSObject._(_ret, _lib); } - static ffi.Pointer? - _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler; - void registerDataRepresentationForTypeIdentifier_visibility_loadHandler( - NSObject typeIdentifier, int visibility, NSObject loadHandler) { - _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler ??= - _registerName(_lib, - "registerDataRepresentationForTypeIdentifier:visibility:loadHandler:"); - _lib._objc_msgSend_110( - _id, - _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler!, - typeIdentifier._id, - visibility, - loadHandler._id); + static ffi.Pointer? _sel_mutableCopy; + NSObject mutableCopy() { + _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); + final _ret = _lib._objc_msgSend_4(_id, _sel_mutableCopy!); + return NSObject._(_ret, _lib); } - static ffi.Pointer? - _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler; - void - registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler( - NSObject typeIdentifier, - int fileOptions, - int visibility, - NSObject loadHandler) { - _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler ??= - _registerName(_lib, - "registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:"); - _lib._objc_msgSend_111( - _id, - _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler!, - typeIdentifier._id, - fileOptions, - visibility, - loadHandler._id); + static ffi.Pointer? _sel_copyWithZone; + static NSObject copyWithZone( + NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); + final _ret = _lib._objc_msgSend_5(_class!, _sel_copyWithZone!, zone); + return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_registeredTypeIdentifiers; - NSObject get registeredTypeIdentifiers { - _sel_registeredTypeIdentifiers ??= - _registerName(_lib, "registeredTypeIdentifiers"); - final _ret = _lib._objc_msgSend_112(_id, _sel_registeredTypeIdentifiers!); + static ffi.Pointer? _sel_mutableCopyWithZone; + static NSObject mutableCopyWithZone( + NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + _class ??= _getClass(_lib, "NSObject"); + _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); + final _ret = _lib._objc_msgSend_6(_class!, _sel_mutableCopyWithZone!, zone); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_hasItemConformingToTypeIdentifier; - bool hasItemConformingToTypeIdentifier(NSObject typeIdentifier) { - _sel_hasItemConformingToTypeIdentifier ??= - _registerName(_lib, "hasItemConformingToTypeIdentifier:"); - return _lib._objc_msgSend_113( - _id, _sel_hasItemConformingToTypeIdentifier!, typeIdentifier._id); + static ffi.Pointer? _sel_instancesRespondToSelector; + static bool instancesRespondToSelector( + NativeObjCLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instancesRespondToSelector ??= + _registerName(_lib, "instancesRespondToSelector:"); + return _lib._objc_msgSend_7( + _class!, _sel_instancesRespondToSelector!, aSelector); } - static ffi.Pointer? - _sel_hasRepresentationConformingToTypeIdentifier_fileOptions; - bool hasRepresentationConformingToTypeIdentifier_fileOptions( - NSObject typeIdentifier, int fileOptions) { - _sel_hasRepresentationConformingToTypeIdentifier_fileOptions ??= - _registerName( - _lib, "hasRepresentationConformingToTypeIdentifier:fileOptions:"); - return _lib._objc_msgSend_114( - _id, - _sel_hasRepresentationConformingToTypeIdentifier_fileOptions!, - typeIdentifier._id, - fileOptions); + static ffi.Pointer? _sel_conformsToProtocol; + static bool conformsToProtocol(NativeObjCLibrary _lib, NSObject protocol) { + _class ??= _getClass(_lib, "NSObject"); + _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); + return _lib._objc_msgSend_8( + _class!, _sel_conformsToProtocol!, protocol._id); } - static ffi.Pointer? - _sel_loadDataRepresentationForTypeIdentifier_completionHandler; - NSProgress loadDataRepresentationForTypeIdentifier_completionHandler( - NSObject typeIdentifier, NSObject completionHandler) { - _sel_loadDataRepresentationForTypeIdentifier_completionHandler ??= - _registerName( - _lib, "loadDataRepresentationForTypeIdentifier:completionHandler:"); - final _ret = _lib._objc_msgSend_115( - _id, - _sel_loadDataRepresentationForTypeIdentifier_completionHandler!, - typeIdentifier._id, - completionHandler._id); - return NSProgress._(_ret, _lib); + static ffi.Pointer? _sel_methodForSelector; + IMP methodForSelector(ffi.Pointer aSelector) { + _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); + return _lib._objc_msgSend_9(_id, _sel_methodForSelector!, aSelector); } - static ffi.Pointer? - _sel_loadFileRepresentationForTypeIdentifier_completionHandler; - NSProgress loadFileRepresentationForTypeIdentifier_completionHandler( - NSObject typeIdentifier, NSObject completionHandler) { - _sel_loadFileRepresentationForTypeIdentifier_completionHandler ??= - _registerName( - _lib, "loadFileRepresentationForTypeIdentifier:completionHandler:"); - final _ret = _lib._objc_msgSend_116( - _id, - _sel_loadFileRepresentationForTypeIdentifier_completionHandler!, - typeIdentifier._id, - completionHandler._id); - return NSProgress._(_ret, _lib); + static ffi.Pointer? _sel_instanceMethodForSelector; + static IMP instanceMethodForSelector( + NativeObjCLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instanceMethodForSelector ??= + _registerName(_lib, "instanceMethodForSelector:"); + return _lib._objc_msgSend_10( + _class!, _sel_instanceMethodForSelector!, aSelector); } - static ffi.Pointer? - _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler; - NSProgress loadInPlaceFileRepresentationForTypeIdentifier_completionHandler( - NSObject typeIdentifier, NSObject completionHandler) { - _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler ??= - _registerName(_lib, - "loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:"); - final _ret = _lib._objc_msgSend_117( - _id, - _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler!, - typeIdentifier._id, - completionHandler._id); - return NSProgress._(_ret, _lib); + static ffi.Pointer? _sel_doesNotRecognizeSelector; + void doesNotRecognizeSelector(ffi.Pointer aSelector) { + _sel_doesNotRecognizeSelector ??= + _registerName(_lib, "doesNotRecognizeSelector:"); + _lib._objc_msgSend_11(_id, _sel_doesNotRecognizeSelector!, aSelector); } - static ffi.Pointer? _sel_suggestedName; - NSObject get suggestedName { - _sel_suggestedName ??= _registerName(_lib, "suggestedName"); - final _ret = _lib._objc_msgSend_118(_id, _sel_suggestedName!); + static ffi.Pointer? _sel_forwardingTargetForSelector; + NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + _sel_forwardingTargetForSelector ??= + _registerName(_lib, "forwardingTargetForSelector:"); + final _ret = _lib._objc_msgSend_12( + _id, _sel_forwardingTargetForSelector!, aSelector); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_suggestedName1; - set suggestedName(NSObject value) { - _sel_suggestedName1 ??= _registerName(_lib, "setSuggestedName:"); - _lib._objc_msgSend_119(_id, _sel_suggestedName1!, value._id); + static ffi.Pointer? _sel_forwardInvocation; + void forwardInvocation(NSObject anInvocation) { + _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); + _lib._objc_msgSend_13(_id, _sel_forwardInvocation!, anInvocation._id); } - static ffi.Pointer? _sel_initWithObject; - NSItemProvider initWithObject(NSObject object) { - _sel_initWithObject ??= _registerName(_lib, "initWithObject:"); - final _ret = _lib._objc_msgSend_120(_id, _sel_initWithObject!, object._id); - return NSItemProvider._(_ret, _lib); + static ffi.Pointer? _sel_methodSignatureForSelector; + NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + _sel_methodSignatureForSelector ??= + _registerName(_lib, "methodSignatureForSelector:"); + final _ret = + _lib._objc_msgSend_14(_id, _sel_methodSignatureForSelector!, aSelector); + return NSMethodSignature._(_ret, _lib); } - static ffi.Pointer? _sel_registerObject_visibility; - void registerObject_visibility(NSObject object, int visibility) { - _sel_registerObject_visibility ??= - _registerName(_lib, "registerObject:visibility:"); - _lib._objc_msgSend_121( - _id, _sel_registerObject_visibility!, object._id, visibility); + static ffi.Pointer? _sel_instanceMethodSignatureForSelector; + static NSMethodSignature instanceMethodSignatureForSelector( + NativeObjCLibrary _lib, ffi.Pointer aSelector) { + _class ??= _getClass(_lib, "NSObject"); + _sel_instanceMethodSignatureForSelector ??= + _registerName(_lib, "instanceMethodSignatureForSelector:"); + final _ret = _lib._objc_msgSend_15( + _class!, _sel_instanceMethodSignatureForSelector!, aSelector); + return NSMethodSignature._(_ret, _lib); } - static ffi.Pointer? - _sel_registerObjectOfClass_visibility_loadHandler; - void registerObjectOfClass_visibility_loadHandler( - NSObject aClass, int visibility, NSObject loadHandler) { - _sel_registerObjectOfClass_visibility_loadHandler ??= - _registerName(_lib, "registerObjectOfClass:visibility:loadHandler:"); - _lib._objc_msgSend_122( - _id, - _sel_registerObjectOfClass_visibility_loadHandler!, - aClass._id, - visibility, - loadHandler._id); + static ffi.Pointer? _sel_allowsWeakReference; + bool allowsWeakReference() { + _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); + return _lib._objc_msgSend_16(_id, _sel_allowsWeakReference!); } - static ffi.Pointer? _sel_canLoadObjectOfClass; - bool canLoadObjectOfClass(NSObject aClass) { - _sel_canLoadObjectOfClass ??= _registerName(_lib, "canLoadObjectOfClass:"); - return _lib._objc_msgSend_123(_id, _sel_canLoadObjectOfClass!, aClass._id); + static ffi.Pointer? _sel_retainWeakReference; + bool retainWeakReference() { + _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); + return _lib._objc_msgSend_16(_id, _sel_retainWeakReference!); } - static ffi.Pointer? _sel_loadObjectOfClass_completionHandler; - NSProgress loadObjectOfClass_completionHandler( - NSObject aClass, NSObject completionHandler) { - _sel_loadObjectOfClass_completionHandler ??= - _registerName(_lib, "loadObjectOfClass:completionHandler:"); - final _ret = _lib._objc_msgSend_124( - _id, - _sel_loadObjectOfClass_completionHandler!, - aClass._id, - completionHandler._id); - return NSProgress._(_ret, _lib); + static ffi.Pointer? _sel_isSubclassOfClass; + static bool isSubclassOfClass(NativeObjCLibrary _lib, NSObject aClass) { + _class ??= _getClass(_lib, "NSObject"); + _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); + return _lib._objc_msgSend_17(_class!, _sel_isSubclassOfClass!, aClass._id); } - static ffi.Pointer? _sel_initWithItem_typeIdentifier; - NSItemProvider initWithItem_typeIdentifier( - NSObject item, NSObject typeIdentifier) { - _sel_initWithItem_typeIdentifier ??= - _registerName(_lib, "initWithItem:typeIdentifier:"); - final _ret = _lib._objc_msgSend_125( - _id, _sel_initWithItem_typeIdentifier!, item._id, typeIdentifier._id); - return NSItemProvider._(_ret, _lib); + static ffi.Pointer? _sel_resolveClassMethod; + static bool resolveClassMethod( + NativeObjCLibrary _lib, ffi.Pointer sel) { + _class ??= _getClass(_lib, "NSObject"); + _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); + return _lib._objc_msgSend_18(_class!, _sel_resolveClassMethod!, sel); } - static ffi.Pointer? _sel_initWithContentsOfURL; - NSItemProvider initWithContentsOfURL(NSObject fileURL) { - _sel_initWithContentsOfURL ??= - _registerName(_lib, "initWithContentsOfURL:"); - final _ret = - _lib._objc_msgSend_126(_id, _sel_initWithContentsOfURL!, fileURL._id); - return NSItemProvider._(_ret, _lib); + static ffi.Pointer? _sel_resolveInstanceMethod; + static bool resolveInstanceMethod( + NativeObjCLibrary _lib, ffi.Pointer sel) { + _class ??= _getClass(_lib, "NSObject"); + _sel_resolveInstanceMethod ??= + _registerName(_lib, "resolveInstanceMethod:"); + return _lib._objc_msgSend_19(_class!, _sel_resolveInstanceMethod!, sel); } - static ffi.Pointer? _sel_registerItemForTypeIdentifier_loadHandler; - void registerItemForTypeIdentifier_loadHandler( - NSObject typeIdentifier, NSItemProviderLoadHandler loadHandler) { - _sel_registerItemForTypeIdentifier_loadHandler ??= - _registerName(_lib, "registerItemForTypeIdentifier:loadHandler:"); - _lib._objc_msgSend_127(_id, _sel_registerItemForTypeIdentifier_loadHandler!, - typeIdentifier._id, loadHandler); + static ffi.Pointer? _sel_hash; + static int hash(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_hash ??= _registerName(_lib, "hash"); + return _lib._objc_msgSend_20(_class!, _sel_hash!); } - static ffi.Pointer? - _sel_loadItemForTypeIdentifier_options_completionHandler; - void loadItemForTypeIdentifier_options_completionHandler( - NSObject typeIdentifier, - NSObject options, - NSItemProviderCompletionHandler completionHandler) { - _sel_loadItemForTypeIdentifier_options_completionHandler ??= _registerName( - _lib, "loadItemForTypeIdentifier:options:completionHandler:"); - _lib._objc_msgSend_128( - _id, - _sel_loadItemForTypeIdentifier_options_completionHandler!, - typeIdentifier._id, - options._id, - completionHandler); + static ffi.Pointer? _sel_superclass; + static NSObject superclass(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_superclass ??= _registerName(_lib, "superclass"); + final _ret = _lib._objc_msgSend_21(_class!, _sel_superclass!); + return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_new1; - static NSItemProvider new1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSItemProvider"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); - return NSItemProvider._(_ret, _lib); + static ffi.Pointer? _sel_class1; + static NSObject class1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_class1 ??= _registerName(_lib, "class"); + final _ret = _lib._objc_msgSend_22(_class!, _sel_class1!); + return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; - static NSItemProvider alloc(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSItemProvider"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); - return NSItemProvider._(_ret, _lib); + static ffi.Pointer? _sel_description; + static NSString description(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_description ??= _registerName(_lib, "description"); + final _ret = _lib._objc_msgSend_27(_class!, _sel_description!); + return NSString._(_ret, _lib); } -} - -class NSProgress extends _ObjCWrapper { - NSProgress._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); - - static ffi.Pointer? _class; - static NSProgress castFrom(T other) { - return NSProgress._(other._id, other._lib); + static ffi.Pointer? _sel_debugDescription; + static NSString debugDescription(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSObject"); + _sel_debugDescription ??= _registerName(_lib, "debugDescription"); + final _ret = _lib._objc_msgSend_27(_class!, _sel_debugDescription!); + return NSString._(_ret, _lib); } } -typedef NSItemProviderLoadHandler = ffi.Pointer; -typedef NSItemProviderCompletionHandler = ffi.Pointer; - -abstract class NSItemProviderErrorCode { - static const int NSItemProviderUnknownError = -1; - static const int NSItemProviderItemUnavailableError = -1000; - static const int NSItemProviderUnexpectedValueClassError = -1100; - static const int NSItemProviderUnavailableCoercionError = -1200; -} - -abstract class NSStringCompareOptions { - static const int NSCaseInsensitiveSearch = 1; - static const int NSLiteralSearch = 2; - static const int NSBackwardsSearch = 4; - static const int NSAnchoredSearch = 8; - static const int NSNumericSearch = 64; - static const int NSDiacriticInsensitiveSearch = 128; - static const int NSWidthInsensitiveSearch = 256; - static const int NSForcedOrderingSearch = 512; - static const int NSRegularExpressionSearch = 1024; -} +typedef instancetype = ffi.Pointer; -abstract class NSStringEncodingConversionOptions { - static const int NSStringEncodingConversionAllowLossy = 1; - static const int NSStringEncodingConversionExternalRepresentation = 2; -} +class _NSZone extends ffi.Opaque {} -abstract class NSStringEnumerationOptions { - static const int NSStringEnumerationByLines = 0; - static const int NSStringEnumerationByParagraphs = 1; - static const int NSStringEnumerationByComposedCharacterSequences = 2; - static const int NSStringEnumerationByWords = 3; - static const int NSStringEnumerationBySentences = 4; - static const int NSStringEnumerationByCaretPositions = 5; - static const int NSStringEnumerationByDeletionClusters = 6; - static const int NSStringEnumerationReverse = 256; - static const int NSStringEnumerationSubstringNotRequired = 512; - static const int NSStringEnumerationLocalized = 1024; -} +class ObjCSel extends ffi.Opaque {} -typedef NSStringTransform = ffi.Pointer; -typedef NSStringEncodingDetectionOptionsKey = ffi.Pointer; +typedef IMP = ffi.Pointer>; -class NSMutableString extends NSString { - NSMutableString._(ffi.Pointer id, NativeObjCLibrary lib) +class NSMethodSignature extends _ObjCWrapper { + NSMethodSignature._(ffi.Pointer id, NativeObjCLibrary lib) : super._(id, lib); static ffi.Pointer? _class; - static NSMutableString castFrom(T other) { - return NSMutableString._(other._id, other._lib); - } - - static ffi.Pointer? _sel_replaceCharactersInRange_withString; - void replaceCharactersInRange_withString(NSRange range, NSObject aString) { - _sel_replaceCharactersInRange_withString ??= - _registerName(_lib, "replaceCharactersInRange:withString:"); - _lib._objc_msgSend_129( - _id, _sel_replaceCharactersInRange_withString!, range, aString._id); - } - - static ffi.Pointer? _sel_stringWithCString_encoding; - static NSString stringWithCString_encoding( - NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { - _class ??= _getClass(_lib, "NSMutableString"); - _sel_stringWithCString_encoding ??= - _registerName(_lib, "stringWithCString:encoding:"); - final _ret = _lib._objc_msgSend_25( - _class!, _sel_stringWithCString_encoding!, cString, enc); - return NSString._(_ret, _lib); - } - - static ffi.Pointer? _sel_new1; - static NSMutableString new1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSMutableString"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); - return NSMutableString._(_ret, _lib); - } - - static ffi.Pointer? _sel_alloc; - static NSMutableString alloc(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSMutableString"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); - return NSMutableString._(_ret, _lib); + static NSMethodSignature castFrom(T other) { + return NSMethodSignature._(other._id, other._lib); } } -typedef NSExceptionName = ffi.Pointer; - -class NSSimpleCString extends NSString { - NSSimpleCString._(ffi.Pointer id, NativeObjCLibrary lib) +class NSString extends NSObject { + NSString._(ffi.Pointer id, NativeObjCLibrary lib) : super._(id, lib); static ffi.Pointer? _class; - static NSSimpleCString castFrom(T other) { - return NSSimpleCString._(other._id, other._lib); + static NSString castFrom(T other) { + return NSString._(other._id, other._lib); } - static ffi.Pointer? _sel_stringWithCString_encoding; - static NSString stringWithCString_encoding( - NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { - _class ??= _getClass(_lib, "NSSimpleCString"); - _sel_stringWithCString_encoding ??= - _registerName(_lib, "stringWithCString:encoding:"); - final _ret = _lib._objc_msgSend_25( - _class!, _sel_stringWithCString_encoding!, cString, enc); - return NSString._(_ret, _lib); + factory NSString(NativeObjCLibrary _lib, String str) { + final cstr = str.toNativeUtf8(); + final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + pkg_ffi.calloc.free(cstr); + return nsstr; } - static ffi.Pointer? _sel_new1; - static NSSimpleCString new1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSSimpleCString"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); - return NSSimpleCString._(_ret, _lib); - } + @override + String toString() => UTF8String().cast().toDartString(); - static ffi.Pointer? _sel_alloc; - static NSSimpleCString alloc(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSSimpleCString"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); - return NSSimpleCString._(_ret, _lib); + static ffi.Pointer? _sel_length; + int get length { + _sel_length ??= _registerName(_lib, "length"); + return _lib._objc_msgSend_20(_id, _sel_length!); } -} -class NSConstantString extends NSSimpleCString { - NSConstantString._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); + static ffi.Pointer? _sel_characterAtIndex; + int characterAtIndex(int index) { + _sel_characterAtIndex ??= _registerName(_lib, "characterAtIndex:"); + return _lib._objc_msgSend_23(_id, _sel_characterAtIndex!, index); + } - static ffi.Pointer? _class; + static ffi.Pointer? _sel_init; + @override + NSString init() { + _sel_init ??= _registerName(_lib, "init"); + final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + return NSString._(_ret, _lib); + } - static NSConstantString castFrom(T other) { - return NSConstantString._(other._id, other._lib); + static ffi.Pointer? _sel_initWithCoder; + NSString initWithCoder(NSObject coder) { + _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); + final _ret = _lib._objc_msgSend_24(_id, _sel_initWithCoder!, coder._id); + return NSString._(_ret, _lib); } static ffi.Pointer? _sel_stringWithCString_encoding; static NSString stringWithCString_encoding( NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { - _class ??= _getClass(_lib, "NSConstantString"); + _class ??= _getClass(_lib, "NSString"); _sel_stringWithCString_encoding ??= _registerName(_lib, "stringWithCString:encoding:"); final _ret = _lib._objc_msgSend_25( @@ -5264,83 +1678,35 @@ class NSConstantString extends NSSimpleCString { return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_new1; - static NSConstantString new1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSConstantString"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); - return NSConstantString._(_ret, _lib); - } - - static ffi.Pointer? _sel_alloc; - static NSConstantString alloc(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSConstantString"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); - return NSConstantString._(_ret, _lib); - } -} - -class Foo extends NSObject { - Foo._(ffi.Pointer id, NativeObjCLibrary lib) : super._(id, lib); - - static ffi.Pointer? _class; - - static Foo castFrom(T other) { - return Foo._(other._id, other._lib); - } - - static ffi.Pointer? _sel_intVal; - int get intVal { - _sel_intVal ??= _registerName(_lib, "intVal"); - return _lib._objc_msgSend_130(_id, _sel_intVal!); - } - - static ffi.Pointer? _sel_intVal1; - set intVal(int value) { - _sel_intVal1 ??= _registerName(_lib, "setIntVal:"); - _lib._objc_msgSend_131(_id, _sel_intVal1!, value); - } - - static ffi.Pointer? _sel_makeFoo; - static Foo makeFoo(NativeObjCLibrary _lib, double x) { - _class ??= _getClass(_lib, "Foo"); - _sel_makeFoo ??= _registerName(_lib, "makeFoo:"); - final _ret = _lib._objc_msgSend_132(_class!, _sel_makeFoo!, x); - return Foo._(_ret, _lib); - } - - static ffi.Pointer? _sel_multiply_withOtherFoo; - int multiply_withOtherFoo(bool useIntVals, NSObject other) { - _sel_multiply_withOtherFoo ??= - _registerName(_lib, "multiply:withOtherFoo:"); - return _lib._objc_msgSend_133( - _id, _sel_multiply_withOtherFoo!, useIntVals, other._id); - } - - static ffi.Pointer? _sel_setDoubleVal; - void setDoubleVal(double x) { - _sel_setDoubleVal ??= _registerName(_lib, "setDoubleVal:"); - _lib._objc_msgSend_134(_id, _sel_setDoubleVal!, x); + static ffi.Pointer? _sel_UTF8String; + ffi.Pointer UTF8String() { + _sel_UTF8String ??= _registerName(_lib, "UTF8String"); + return _lib._objc_msgSend_26(_id, _sel_UTF8String!); } static ffi.Pointer? _sel_new1; - static Foo new1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "Foo"); + static NSString new1(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSString"); _sel_new1 ??= _registerName(_lib, "new"); final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); - return Foo._(_ret, _lib); + return NSString._(_ret, _lib); } static ffi.Pointer? _sel_alloc; - static Foo alloc(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "Foo"); + static NSString alloc(NativeObjCLibrary _lib) { + _class ??= _getClass(_lib, "NSString"); _sel_alloc ??= _registerName(_lib, "alloc"); final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); - return Foo._(_ret, _lib); + return NSString._(_ret, _lib); } } +extension StringToNSString on String { + NSString toNSString(NativeObjCLibrary lib) => NSString(lib, this); +} + +typedef unichar = pkg_ffi.UnsignedShort; + const int NSScannedOption = 1; const int NSCollectorDisabledOption = 2; From e317fc2e8aa201d7e6ea63141cfeca438294bd62 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Tue, 19 Apr 2022 09:49:05 -0700 Subject: [PATCH 124/276] [ffigen] Improve Type deduping in objc_msgSend (#326) * Improve Type deduping in objc_msgSend * Comment why toString can't be a cache key * Fix test --- .../lib/src/code_generator/func_type.dart | 6 + .../lib/src/code_generator/native_type.dart | 6 + .../objc_built_in_functions.dart | 5 +- .../lib/src/code_generator/pointer.dart | 11 +- pkgs/ffigen/lib/src/code_generator/type.dart | 10 + .../lib/src/code_generator/typealias.dart | 3 + .../_expected_objc_config_bindings.dart | 363 +-- .../_expected_objc_interface_bindings.dart | 411 +-- .../native_objc_test/method_bindings.dart | 411 +-- .../native_objc_test_bindings.dart | 435 +-- .../native_objc_test/property_bindings.dart | 391 +-- .../native_objc_test/string_bindings.dart | 2589 +++++------------ 12 files changed, 1292 insertions(+), 3349 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/func_type.dart b/pkgs/ffigen/lib/src/code_generator/func_type.dart index 7f4050249b..0b8abfd1d4 100644 --- a/pkgs/ffigen/lib/src/code_generator/func_type.dart +++ b/pkgs/ffigen/lib/src/code_generator/func_type.dart @@ -44,6 +44,9 @@ class FunctionType extends Type { @override String toString() => _getTypeString(false, (Type t) => t.toString()); + @override + String cacheKey() => _getTypeString(false, (Type t) => t.cacheKey()); + @override void addDependencies(Set dependencies) { returnType.addDependencies(dependencies); @@ -74,4 +77,7 @@ class NativeFunc extends Type { @override String toString() => 'NativeFunction<${type.toString()}>'; + + @override + String cacheKey() => 'NatFn(${type.cacheKey()})'; } diff --git a/pkgs/ffigen/lib/src/code_generator/native_type.dart b/pkgs/ffigen/lib/src/code_generator/native_type.dart index e51581d074..ea65169395 100644 --- a/pkgs/ffigen/lib/src/code_generator/native_type.dart +++ b/pkgs/ffigen/lib/src/code_generator/native_type.dart @@ -55,6 +55,9 @@ class NativeType extends Type { @override String toString() => _cType; + + @override + String cacheKey() => _cType; } class BooleanType extends NativeType { @@ -65,4 +68,7 @@ class BooleanType extends NativeType { @override String toString() => 'bool'; + + @override + String cacheKey() => 'bool'; } diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index 3c170c02b9..6074a711a7 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -29,10 +29,9 @@ class ObjCBuiltInFunctions { // We need to load a separate instance of objc_msgSend for each signature. final _msgSendFuncs = {}; Func getMsgSendFunc(Type returnType, List params) { - // TODO(#279): These keys don't dedupe sufficiently. - var key = returnType.hashCode.toRadixString(36); + var key = returnType.cacheKey(); for (final p in params) { - key += ' ' + p.type.hashCode.toRadixString(36); + key += ' ' + p.type.cacheKey(); } _msgSendFuncs[key] ??= Func( name: '_objc_msgSend_${_msgSendFuncs.length}', diff --git a/pkgs/ffigen/lib/src/code_generator/pointer.dart b/pkgs/ffigen/lib/src/code_generator/pointer.dart index 445c360037..cacb5b2f6e 100644 --- a/pkgs/ffigen/lib/src/code_generator/pointer.dart +++ b/pkgs/ffigen/lib/src/code_generator/pointer.dart @@ -24,7 +24,10 @@ class PointerType extends Type { '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; @override - String toString() => '*$child'; + String toString() => '$child*'; + + @override + String cacheKey() => '${child.cacheKey()}*'; } /// Represents a constant array, which has a fixed size. @@ -40,6 +43,9 @@ class ConstantArray extends PointerType { @override String toString() => '$child[$length]'; + + @override + String cacheKey() => '${child.cacheKey()}[$length]'; } /// Represents an incomplete array, which has an unknown size. @@ -51,4 +57,7 @@ class IncompleteArray extends PointerType { @override String toString() => '$child[]'; + + @override + String cacheKey() => '${child.cacheKey()}[]'; } diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index af580b3f3e..0ad138ffef 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -47,6 +47,13 @@ abstract class Type { /// only. This string should not be printed as generated code. @override String toString(); + + /// Cache key used in various places to dedupe Types. By default this is just + /// the hash of the Type, but in many cases this does not dedupe sufficiently. + /// So Types that may be duplicated should override this to return a more + /// specific key. Types that are already deduped don't need to override this. + /// toString() is not a valid cache key as there may be name collisions. + String cacheKey() => hashCode.toRadixString(36); } /// Function to check if the dart and C type string are same. @@ -87,6 +94,9 @@ abstract class BindingType extends NoLookUpBinding implements Type { @override String toString() => originalName; + + @override + String cacheKey() => hashCode.toRadixString(36); } /// Represents an unimplemented type. Used as a marker, so that declarations diff --git a/pkgs/ffigen/lib/src/code_generator/typealias.dart b/pkgs/ffigen/lib/src/code_generator/typealias.dart index f83c0ba8e0..9211ae8454 100644 --- a/pkgs/ffigen/lib/src/code_generator/typealias.dart +++ b/pkgs/ffigen/lib/src/code_generator/typealias.dart @@ -76,4 +76,7 @@ class Typealias extends BindingType { return type.getDartType(w); } } + + @override + String cacheKey() => type.cacheKey(); } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart index d43541e29f..f837933de7 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart @@ -104,88 +104,12 @@ class NativeLibrary { instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer<_NSZone>)>(); - ffi.Pointer _objc_msgSend_3( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_3( - obj, - sel, - ); - } - - late final __objc_msgSend_3Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_4( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_4( - obj, - sel, - ); - } - - late final __objc_msgSend_4Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_5( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_5( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_5Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); - - ffi.Pointer _objc_msgSend_6( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_6( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_6Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); - - bool _objc_msgSend_7( + bool _objc_msgSend_3( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_7( + return __objc_msgSend_3( obj, sel, aSelector, @@ -193,20 +117,20 @@ class NativeLibrary { 0; } - late final __objc_msgSend_7Ptr = _lookup< + late final __objc_msgSend_3Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_8( + bool _objc_msgSend_4( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer protocol, ) { - return __objc_msgSend_8( + return __objc_msgSend_4( obj, sel, protocol, @@ -214,295 +138,156 @@ class NativeLibrary { 0; } - late final __objc_msgSend_8Ptr = _lookup< + late final __objc_msgSend_4Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - IMP _objc_msgSend_9( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_9( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_9Ptr = _lookup< - ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - IMP _objc_msgSend_10( + IMP _objc_msgSend_5( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_10( + return __objc_msgSend_5( obj, sel, aSelector, ); } - late final __objc_msgSend_10Ptr = _lookup< + late final __objc_msgSend_5Ptr = _lookup< ffi.NativeFunction< IMP Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< IMP Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_11( + void _objc_msgSend_6( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_11( + return __objc_msgSend_6( obj, sel, aSelector, ); } - late final __objc_msgSend_11Ptr = _lookup< + late final __objc_msgSend_6Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_12( + ffi.Pointer _objc_msgSend_7( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_12( + return __objc_msgSend_7( obj, sel, aSelector, ); } - late final __objc_msgSend_12Ptr = _lookup< + late final __objc_msgSend_7Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_13( + void _objc_msgSend_8( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer anInvocation, ) { - return __objc_msgSend_13( + return __objc_msgSend_8( obj, sel, anInvocation, ); } - late final __objc_msgSend_13Ptr = _lookup< + late final __objc_msgSend_8Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_14( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_14( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_14Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_15( + ffi.Pointer _objc_msgSend_9( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_15( + return __objc_msgSend_9( obj, sel, aSelector, ); } - late final __objc_msgSend_15Ptr = _lookup< + late final __objc_msgSend_9Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_16( + bool _objc_msgSend_10( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_16( + return __objc_msgSend_10( obj, sel, ) != 0; } - late final __objc_msgSend_16Ptr = _lookup< + late final __objc_msgSend_10Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_17( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aClass, - ) { - return __objc_msgSend_17( - obj, - sel, - aClass, - ) != - 0; - } - - late final __objc_msgSend_17Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - bool _objc_msgSend_18( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer sel1, - ) { - return __objc_msgSend_18( - obj, - sel, - sel1, - ) != - 0; - } - - late final __objc_msgSend_18Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - bool _objc_msgSend_19( + int _objc_msgSend_11( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer sel1, ) { - return __objc_msgSend_19( - obj, - sel, - sel1, - ) != - 0; - } - - late final __objc_msgSend_19Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int _objc_msgSend_20( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_20( + return __objc_msgSend_11( obj, sel, ); } - late final __objc_msgSend_20Ptr = _lookup< + late final __objc_msgSend_11Ptr = _lookup< ffi.NativeFunction< NSUInteger Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_21( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_21( - obj, - sel, - ); - } - - late final __objc_msgSend_21Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_22( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_22( - obj, - sel, - ); - } - - late final __objc_msgSend_22Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_23( + ffi.Pointer _objc_msgSend_12( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer cString, int enc, ) { - return __objc_msgSend_23( + return __objc_msgSend_12( obj, sel, cString, @@ -510,50 +295,50 @@ class NativeLibrary { ); } - late final __objc_msgSend_23Ptr = _lookup< + late final __objc_msgSend_12Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); - ffi.Pointer _objc_msgSend_24( + ffi.Pointer _objc_msgSend_13( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_24( + return __objc_msgSend_13( obj, sel, ); } - late final __objc_msgSend_24Ptr = _lookup< + late final __objc_msgSend_13Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_25( + ffi.Pointer _objc_msgSend_14( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_25( + return __objc_msgSend_14( obj, sel, ); } - late final __objc_msgSend_25Ptr = _lookup< + late final __objc_msgSend_14Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); } @@ -673,14 +458,14 @@ class NSObject extends _ObjCWrapper { static ffi.Pointer? _sel_copy; NSObject copy() { _sel_copy ??= _registerName(_lib, "copy"); - final _ret = _lib._objc_msgSend_3(_id, _sel_copy!); + final _ret = _lib._objc_msgSend_1(_id, _sel_copy!); return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_mutableCopy; NSObject mutableCopy() { _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); - final _ret = _lib._objc_msgSend_4(_id, _sel_mutableCopy!); + final _ret = _lib._objc_msgSend_1(_id, _sel_mutableCopy!); return NSObject._(_ret, _lib); } @@ -688,7 +473,7 @@ class NSObject extends _ObjCWrapper { static NSObject copyWithZone(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { _class ??= _getClass(_lib, "NSObject"); _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); - final _ret = _lib._objc_msgSend_5(_class!, _sel_copyWithZone!, zone); + final _ret = _lib._objc_msgSend_2(_class!, _sel_copyWithZone!, zone); return NSObject._(_ret, _lib); } @@ -697,7 +482,7 @@ class NSObject extends _ObjCWrapper { NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { _class ??= _getClass(_lib, "NSObject"); _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); - final _ret = _lib._objc_msgSend_6(_class!, _sel_mutableCopyWithZone!, zone); + final _ret = _lib._objc_msgSend_2(_class!, _sel_mutableCopyWithZone!, zone); return NSObject._(_ret, _lib); } @@ -707,7 +492,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instancesRespondToSelector ??= _registerName(_lib, "instancesRespondToSelector:"); - return _lib._objc_msgSend_7( + return _lib._objc_msgSend_3( _class!, _sel_instancesRespondToSelector!, aSelector); } @@ -715,14 +500,14 @@ class NSObject extends _ObjCWrapper { static bool conformsToProtocol(NativeLibrary _lib, NSObject protocol) { _class ??= _getClass(_lib, "NSObject"); _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); - return _lib._objc_msgSend_8( + return _lib._objc_msgSend_4( _class!, _sel_conformsToProtocol!, protocol._id); } static ffi.Pointer? _sel_methodForSelector; IMP methodForSelector(ffi.Pointer aSelector) { _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); - return _lib._objc_msgSend_9(_id, _sel_methodForSelector!, aSelector); + return _lib._objc_msgSend_5(_id, _sel_methodForSelector!, aSelector); } static ffi.Pointer? _sel_instanceMethodForSelector; @@ -731,7 +516,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instanceMethodForSelector ??= _registerName(_lib, "instanceMethodForSelector:"); - return _lib._objc_msgSend_10( + return _lib._objc_msgSend_5( _class!, _sel_instanceMethodForSelector!, aSelector); } @@ -739,22 +524,22 @@ class NSObject extends _ObjCWrapper { void doesNotRecognizeSelector(ffi.Pointer aSelector) { _sel_doesNotRecognizeSelector ??= _registerName(_lib, "doesNotRecognizeSelector:"); - _lib._objc_msgSend_11(_id, _sel_doesNotRecognizeSelector!, aSelector); + _lib._objc_msgSend_6(_id, _sel_doesNotRecognizeSelector!, aSelector); } static ffi.Pointer? _sel_forwardingTargetForSelector; NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { _sel_forwardingTargetForSelector ??= _registerName(_lib, "forwardingTargetForSelector:"); - final _ret = _lib._objc_msgSend_12( - _id, _sel_forwardingTargetForSelector!, aSelector); + final _ret = + _lib._objc_msgSend_7(_id, _sel_forwardingTargetForSelector!, aSelector); return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_forwardInvocation; void forwardInvocation(NSObject anInvocation) { _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); - _lib._objc_msgSend_13(_id, _sel_forwardInvocation!, anInvocation._id); + _lib._objc_msgSend_8(_id, _sel_forwardInvocation!, anInvocation._id); } static ffi.Pointer? _sel_methodSignatureForSelector; @@ -762,7 +547,7 @@ class NSObject extends _ObjCWrapper { _sel_methodSignatureForSelector ??= _registerName(_lib, "methodSignatureForSelector:"); final _ret = - _lib._objc_msgSend_14(_id, _sel_methodSignatureForSelector!, aSelector); + _lib._objc_msgSend_9(_id, _sel_methodSignatureForSelector!, aSelector); return NSMethodSignature._(_ret, _lib); } @@ -772,7 +557,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instanceMethodSignatureForSelector ??= _registerName(_lib, "instanceMethodSignatureForSelector:"); - final _ret = _lib._objc_msgSend_15( + final _ret = _lib._objc_msgSend_9( _class!, _sel_instanceMethodSignatureForSelector!, aSelector); return NSMethodSignature._(_ret, _lib); } @@ -780,27 +565,27 @@ class NSObject extends _ObjCWrapper { static ffi.Pointer? _sel_allowsWeakReference; bool allowsWeakReference() { _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); - return _lib._objc_msgSend_16(_id, _sel_allowsWeakReference!); + return _lib._objc_msgSend_10(_id, _sel_allowsWeakReference!); } static ffi.Pointer? _sel_retainWeakReference; bool retainWeakReference() { _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); - return _lib._objc_msgSend_16(_id, _sel_retainWeakReference!); + return _lib._objc_msgSend_10(_id, _sel_retainWeakReference!); } static ffi.Pointer? _sel_isSubclassOfClass; static bool isSubclassOfClass(NativeLibrary _lib, NSObject aClass) { _class ??= _getClass(_lib, "NSObject"); _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); - return _lib._objc_msgSend_17(_class!, _sel_isSubclassOfClass!, aClass._id); + return _lib._objc_msgSend_4(_class!, _sel_isSubclassOfClass!, aClass._id); } static ffi.Pointer? _sel_resolveClassMethod; static bool resolveClassMethod(NativeLibrary _lib, ffi.Pointer sel) { _class ??= _getClass(_lib, "NSObject"); _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); - return _lib._objc_msgSend_18(_class!, _sel_resolveClassMethod!, sel); + return _lib._objc_msgSend_3(_class!, _sel_resolveClassMethod!, sel); } static ffi.Pointer? _sel_resolveInstanceMethod; @@ -809,21 +594,21 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_resolveInstanceMethod ??= _registerName(_lib, "resolveInstanceMethod:"); - return _lib._objc_msgSend_19(_class!, _sel_resolveInstanceMethod!, sel); + return _lib._objc_msgSend_3(_class!, _sel_resolveInstanceMethod!, sel); } static ffi.Pointer? _sel_hash; static int hash(NativeLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_hash ??= _registerName(_lib, "hash"); - return _lib._objc_msgSend_20(_class!, _sel_hash!); + return _lib._objc_msgSend_11(_class!, _sel_hash!); } static ffi.Pointer? _sel_superclass; static NSObject superclass(NativeLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_superclass ??= _registerName(_lib, "superclass"); - final _ret = _lib._objc_msgSend_21(_class!, _sel_superclass!); + final _ret = _lib._objc_msgSend_1(_class!, _sel_superclass!); return NSObject._(_ret, _lib); } @@ -831,7 +616,7 @@ class NSObject extends _ObjCWrapper { static NSObject class1(NativeLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_class1 ??= _registerName(_lib, "class"); - final _ret = _lib._objc_msgSend_22(_class!, _sel_class1!); + final _ret = _lib._objc_msgSend_1(_class!, _sel_class1!); return NSObject._(_ret, _lib); } @@ -839,7 +624,7 @@ class NSObject extends _ObjCWrapper { static NSString description(NativeLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_description ??= _registerName(_lib, "description"); - final _ret = _lib._objc_msgSend_25(_class!, _sel_description!); + final _ret = _lib._objc_msgSend_14(_class!, _sel_description!); return NSString._(_ret, _lib); } @@ -847,7 +632,7 @@ class NSObject extends _ObjCWrapper { static NSString debugDescription(NativeLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_debugDescription ??= _registerName(_lib, "debugDescription"); - final _ret = _lib._objc_msgSend_25(_class!, _sel_debugDescription!); + final _ret = _lib._objc_msgSend_14(_class!, _sel_debugDescription!); return NSString._(_ret, _lib); } } @@ -900,7 +685,7 @@ class NSString extends _ObjCWrapper { _class ??= _getClass(_lib, "NSString"); _sel_stringWithCString_encoding ??= _registerName(_lib, "stringWithCString:encoding:"); - final _ret = _lib._objc_msgSend_23( + final _ret = _lib._objc_msgSend_12( _class!, _sel_stringWithCString_encoding!, cString, enc); return NSString._(_ret, _lib); } @@ -908,7 +693,7 @@ class NSString extends _ObjCWrapper { static ffi.Pointer? _sel_UTF8String; ffi.Pointer UTF8String() { _sel_UTF8String ??= _registerName(_lib, "UTF8String"); - return _lib._objc_msgSend_24(_id, _sel_UTF8String!); + return _lib._objc_msgSend_13(_id, _sel_UTF8String!); } } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart index 93b66b24c3..e85cef0378 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart @@ -104,88 +104,12 @@ class NativeLibrary { instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer<_NSZone>)>(); - ffi.Pointer _objc_msgSend_3( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_3( - obj, - sel, - ); - } - - late final __objc_msgSend_3Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_4( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_4( - obj, - sel, - ); - } - - late final __objc_msgSend_4Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_5( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_5( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_5Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); - - ffi.Pointer _objc_msgSend_6( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_6( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_6Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); - - bool _objc_msgSend_7( + bool _objc_msgSend_3( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_7( + return __objc_msgSend_3( obj, sel, aSelector, @@ -193,20 +117,20 @@ class NativeLibrary { 0; } - late final __objc_msgSend_7Ptr = _lookup< + late final __objc_msgSend_3Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_8( + bool _objc_msgSend_4( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer protocol, ) { - return __objc_msgSend_8( + return __objc_msgSend_4( obj, sel, protocol, @@ -214,295 +138,156 @@ class NativeLibrary { 0; } - late final __objc_msgSend_8Ptr = _lookup< + late final __objc_msgSend_4Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - IMP _objc_msgSend_9( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_9( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_9Ptr = _lookup< - ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - IMP _objc_msgSend_10( + IMP _objc_msgSend_5( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_10( + return __objc_msgSend_5( obj, sel, aSelector, ); } - late final __objc_msgSend_10Ptr = _lookup< + late final __objc_msgSend_5Ptr = _lookup< ffi.NativeFunction< IMP Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< IMP Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_11( + void _objc_msgSend_6( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_11( + return __objc_msgSend_6( obj, sel, aSelector, ); } - late final __objc_msgSend_11Ptr = _lookup< + late final __objc_msgSend_6Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_12( + ffi.Pointer _objc_msgSend_7( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_12( + return __objc_msgSend_7( obj, sel, aSelector, ); } - late final __objc_msgSend_12Ptr = _lookup< + late final __objc_msgSend_7Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_13( + void _objc_msgSend_8( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer anInvocation, ) { - return __objc_msgSend_13( + return __objc_msgSend_8( obj, sel, anInvocation, ); } - late final __objc_msgSend_13Ptr = _lookup< + late final __objc_msgSend_8Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_14( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_14( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_14Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_15( + ffi.Pointer _objc_msgSend_9( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_15( + return __objc_msgSend_9( obj, sel, aSelector, ); } - late final __objc_msgSend_15Ptr = _lookup< + late final __objc_msgSend_9Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_16( + bool _objc_msgSend_10( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_16( + return __objc_msgSend_10( obj, sel, ) != 0; } - late final __objc_msgSend_16Ptr = _lookup< + late final __objc_msgSend_10Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_17( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aClass, - ) { - return __objc_msgSend_17( - obj, - sel, - aClass, - ) != - 0; - } - - late final __objc_msgSend_17Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - bool _objc_msgSend_18( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer sel1, - ) { - return __objc_msgSend_18( - obj, - sel, - sel1, - ) != - 0; - } - - late final __objc_msgSend_18Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - bool _objc_msgSend_19( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer sel1, - ) { - return __objc_msgSend_19( - obj, - sel, - sel1, - ) != - 0; - } - - late final __objc_msgSend_19Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int _objc_msgSend_20( + int _objc_msgSend_11( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_20( + return __objc_msgSend_11( obj, sel, ); } - late final __objc_msgSend_20Ptr = _lookup< + late final __objc_msgSend_11Ptr = _lookup< ffi.NativeFunction< NSUInteger Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_21( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_21( - obj, - sel, - ); - } - - late final __objc_msgSend_21Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_22( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_22( - obj, - sel, - ); - } - - late final __objc_msgSend_22Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_23( + ffi.Pointer _objc_msgSend_12( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer cString, int enc, ) { - return __objc_msgSend_23( + return __objc_msgSend_12( obj, sel, cString, @@ -510,116 +295,116 @@ class NativeLibrary { ); } - late final __objc_msgSend_23Ptr = _lookup< + late final __objc_msgSend_12Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); - ffi.Pointer _objc_msgSend_24( + ffi.Pointer _objc_msgSend_13( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_24( + return __objc_msgSend_13( obj, sel, ); } - late final __objc_msgSend_24Ptr = _lookup< + late final __objc_msgSend_13Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_25( + ffi.Pointer _objc_msgSend_14( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_25( + return __objc_msgSend_14( obj, sel, ); } - late final __objc_msgSend_25Ptr = _lookup< + late final __objc_msgSend_14Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_26( + int _objc_msgSend_15( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_26( + return __objc_msgSend_15( obj, sel, ); } - late final __objc_msgSend_26Ptr = _lookup< + late final __objc_msgSend_15Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_27( + void _objc_msgSend_16( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_27( + return __objc_msgSend_16( obj, sel, value, ); } - late final __objc_msgSend_27Ptr = _lookup< + late final __objc_msgSend_16Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); - ffi.Pointer _objc_msgSend_28( + ffi.Pointer _objc_msgSend_17( ffi.Pointer obj, ffi.Pointer sel, double someArg, ) { - return __objc_msgSend_28( + return __objc_msgSend_17( obj, sel, someArg, ); } - late final __objc_msgSend_28Ptr = _lookup< + late final __objc_msgSend_17Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_28 = __objc_msgSend_28Ptr.asFunction< + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, double)>(); - int _objc_msgSend_29( + int _objc_msgSend_18( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer someArg, ffi.Pointer otherArg, ) { - return __objc_msgSend_29( + return __objc_msgSend_18( obj, sel, someArg, @@ -627,14 +412,14 @@ class NativeLibrary { ); } - late final __objc_msgSend_29Ptr = _lookup< + late final __objc_msgSend_18Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_29 = __objc_msgSend_29Ptr.asFunction< + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); } @@ -671,26 +456,26 @@ class Foo extends NSObject { static ffi.Pointer? _sel_someProperty; int get someProperty { _sel_someProperty ??= _registerName(_lib, "someProperty"); - return _lib._objc_msgSend_26(_id, _sel_someProperty!); + return _lib._objc_msgSend_15(_id, _sel_someProperty!); } static ffi.Pointer? _sel_someProperty1; set someProperty(int value) { _sel_someProperty1 ??= _registerName(_lib, "setSomeProperty:"); - _lib._objc_msgSend_27(_id, _sel_someProperty1!, value); + _lib._objc_msgSend_16(_id, _sel_someProperty1!, value); } static ffi.Pointer? _sel_readOnlyProperty; int get readOnlyProperty { _sel_readOnlyProperty ??= _registerName(_lib, "readOnlyProperty"); - return _lib._objc_msgSend_26(_id, _sel_readOnlyProperty!); + return _lib._objc_msgSend_15(_id, _sel_readOnlyProperty!); } static ffi.Pointer? _sel_classReadOnlyProperty; static int getClassReadOnlyProperty(NativeLibrary _lib) { _class ??= _getClass(_lib, "Foo"); _sel_classReadOnlyProperty ??= _registerName(_lib, "classReadOnlyProperty"); - return _lib._objc_msgSend_26(_class!, _sel_classReadOnlyProperty!); + return _lib._objc_msgSend_15(_class!, _sel_classReadOnlyProperty!); } static ffi.Pointer? _sel_classReadWriteProperty; @@ -698,7 +483,7 @@ class Foo extends NSObject { _class ??= _getClass(_lib, "Foo"); _sel_classReadWriteProperty ??= _registerName(_lib, "classReadWriteProperty"); - return _lib._objc_msgSend_26(_class!, _sel_classReadWriteProperty!); + return _lib._objc_msgSend_15(_class!, _sel_classReadWriteProperty!); } static ffi.Pointer? _sel_classReadWriteProperty1; @@ -706,14 +491,14 @@ class Foo extends NSObject { _class ??= _getClass(_lib, "Foo"); _sel_classReadWriteProperty1 ??= _registerName(_lib, "setClassReadWriteProperty:"); - _lib._objc_msgSend_27(_class!, _sel_classReadWriteProperty1!, value); + _lib._objc_msgSend_16(_class!, _sel_classReadWriteProperty1!, value); } static ffi.Pointer? _sel_aClassMethod; static Foo aClassMethod(NativeLibrary _lib, double someArg) { _class ??= _getClass(_lib, "Foo"); _sel_aClassMethod ??= _registerName(_lib, "aClassMethod:"); - final _ret = _lib._objc_msgSend_28(_class!, _sel_aClassMethod!, someArg); + final _ret = _lib._objc_msgSend_17(_class!, _sel_aClassMethod!, someArg); return Foo._(_ret, _lib); } @@ -721,7 +506,7 @@ class Foo extends NSObject { int anInstanceMethod_withOtherArg(NSObject someArg, NSObject otherArg) { _sel_anInstanceMethod_withOtherArg ??= _registerName(_lib, "anInstanceMethod:withOtherArg:"); - return _lib._objc_msgSend_29( + return _lib._objc_msgSend_18( _id, _sel_anInstanceMethod_withOtherArg!, someArg._id, otherArg._id); } @@ -811,14 +596,14 @@ class NSObject extends _ObjCWrapper { static ffi.Pointer? _sel_copy; NSObject copy() { _sel_copy ??= _registerName(_lib, "copy"); - final _ret = _lib._objc_msgSend_3(_id, _sel_copy!); + final _ret = _lib._objc_msgSend_1(_id, _sel_copy!); return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_mutableCopy; NSObject mutableCopy() { _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); - final _ret = _lib._objc_msgSend_4(_id, _sel_mutableCopy!); + final _ret = _lib._objc_msgSend_1(_id, _sel_mutableCopy!); return NSObject._(_ret, _lib); } @@ -826,7 +611,7 @@ class NSObject extends _ObjCWrapper { static NSObject copyWithZone(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { _class ??= _getClass(_lib, "NSObject"); _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); - final _ret = _lib._objc_msgSend_5(_class!, _sel_copyWithZone!, zone); + final _ret = _lib._objc_msgSend_2(_class!, _sel_copyWithZone!, zone); return NSObject._(_ret, _lib); } @@ -835,7 +620,7 @@ class NSObject extends _ObjCWrapper { NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { _class ??= _getClass(_lib, "NSObject"); _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); - final _ret = _lib._objc_msgSend_6(_class!, _sel_mutableCopyWithZone!, zone); + final _ret = _lib._objc_msgSend_2(_class!, _sel_mutableCopyWithZone!, zone); return NSObject._(_ret, _lib); } @@ -845,7 +630,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instancesRespondToSelector ??= _registerName(_lib, "instancesRespondToSelector:"); - return _lib._objc_msgSend_7( + return _lib._objc_msgSend_3( _class!, _sel_instancesRespondToSelector!, aSelector); } @@ -853,14 +638,14 @@ class NSObject extends _ObjCWrapper { static bool conformsToProtocol(NativeLibrary _lib, NSObject protocol) { _class ??= _getClass(_lib, "NSObject"); _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); - return _lib._objc_msgSend_8( + return _lib._objc_msgSend_4( _class!, _sel_conformsToProtocol!, protocol._id); } static ffi.Pointer? _sel_methodForSelector; IMP methodForSelector(ffi.Pointer aSelector) { _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); - return _lib._objc_msgSend_9(_id, _sel_methodForSelector!, aSelector); + return _lib._objc_msgSend_5(_id, _sel_methodForSelector!, aSelector); } static ffi.Pointer? _sel_instanceMethodForSelector; @@ -869,7 +654,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instanceMethodForSelector ??= _registerName(_lib, "instanceMethodForSelector:"); - return _lib._objc_msgSend_10( + return _lib._objc_msgSend_5( _class!, _sel_instanceMethodForSelector!, aSelector); } @@ -877,22 +662,22 @@ class NSObject extends _ObjCWrapper { void doesNotRecognizeSelector(ffi.Pointer aSelector) { _sel_doesNotRecognizeSelector ??= _registerName(_lib, "doesNotRecognizeSelector:"); - _lib._objc_msgSend_11(_id, _sel_doesNotRecognizeSelector!, aSelector); + _lib._objc_msgSend_6(_id, _sel_doesNotRecognizeSelector!, aSelector); } static ffi.Pointer? _sel_forwardingTargetForSelector; NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { _sel_forwardingTargetForSelector ??= _registerName(_lib, "forwardingTargetForSelector:"); - final _ret = _lib._objc_msgSend_12( - _id, _sel_forwardingTargetForSelector!, aSelector); + final _ret = + _lib._objc_msgSend_7(_id, _sel_forwardingTargetForSelector!, aSelector); return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_forwardInvocation; void forwardInvocation(NSObject anInvocation) { _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); - _lib._objc_msgSend_13(_id, _sel_forwardInvocation!, anInvocation._id); + _lib._objc_msgSend_8(_id, _sel_forwardInvocation!, anInvocation._id); } static ffi.Pointer? _sel_methodSignatureForSelector; @@ -900,7 +685,7 @@ class NSObject extends _ObjCWrapper { _sel_methodSignatureForSelector ??= _registerName(_lib, "methodSignatureForSelector:"); final _ret = - _lib._objc_msgSend_14(_id, _sel_methodSignatureForSelector!, aSelector); + _lib._objc_msgSend_9(_id, _sel_methodSignatureForSelector!, aSelector); return NSMethodSignature._(_ret, _lib); } @@ -910,7 +695,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instanceMethodSignatureForSelector ??= _registerName(_lib, "instanceMethodSignatureForSelector:"); - final _ret = _lib._objc_msgSend_15( + final _ret = _lib._objc_msgSend_9( _class!, _sel_instanceMethodSignatureForSelector!, aSelector); return NSMethodSignature._(_ret, _lib); } @@ -918,27 +703,27 @@ class NSObject extends _ObjCWrapper { static ffi.Pointer? _sel_allowsWeakReference; bool allowsWeakReference() { _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); - return _lib._objc_msgSend_16(_id, _sel_allowsWeakReference!); + return _lib._objc_msgSend_10(_id, _sel_allowsWeakReference!); } static ffi.Pointer? _sel_retainWeakReference; bool retainWeakReference() { _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); - return _lib._objc_msgSend_16(_id, _sel_retainWeakReference!); + return _lib._objc_msgSend_10(_id, _sel_retainWeakReference!); } static ffi.Pointer? _sel_isSubclassOfClass; static bool isSubclassOfClass(NativeLibrary _lib, NSObject aClass) { _class ??= _getClass(_lib, "NSObject"); _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); - return _lib._objc_msgSend_17(_class!, _sel_isSubclassOfClass!, aClass._id); + return _lib._objc_msgSend_4(_class!, _sel_isSubclassOfClass!, aClass._id); } static ffi.Pointer? _sel_resolveClassMethod; static bool resolveClassMethod(NativeLibrary _lib, ffi.Pointer sel) { _class ??= _getClass(_lib, "NSObject"); _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); - return _lib._objc_msgSend_18(_class!, _sel_resolveClassMethod!, sel); + return _lib._objc_msgSend_3(_class!, _sel_resolveClassMethod!, sel); } static ffi.Pointer? _sel_resolveInstanceMethod; @@ -947,21 +732,21 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_resolveInstanceMethod ??= _registerName(_lib, "resolveInstanceMethod:"); - return _lib._objc_msgSend_19(_class!, _sel_resolveInstanceMethod!, sel); + return _lib._objc_msgSend_3(_class!, _sel_resolveInstanceMethod!, sel); } static ffi.Pointer? _sel_hash; static int hash(NativeLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_hash ??= _registerName(_lib, "hash"); - return _lib._objc_msgSend_20(_class!, _sel_hash!); + return _lib._objc_msgSend_11(_class!, _sel_hash!); } static ffi.Pointer? _sel_superclass; static NSObject superclass(NativeLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_superclass ??= _registerName(_lib, "superclass"); - final _ret = _lib._objc_msgSend_21(_class!, _sel_superclass!); + final _ret = _lib._objc_msgSend_1(_class!, _sel_superclass!); return NSObject._(_ret, _lib); } @@ -969,7 +754,7 @@ class NSObject extends _ObjCWrapper { static NSObject class1(NativeLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_class1 ??= _registerName(_lib, "class"); - final _ret = _lib._objc_msgSend_22(_class!, _sel_class1!); + final _ret = _lib._objc_msgSend_1(_class!, _sel_class1!); return NSObject._(_ret, _lib); } @@ -977,7 +762,7 @@ class NSObject extends _ObjCWrapper { static NSString description(NativeLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_description ??= _registerName(_lib, "description"); - final _ret = _lib._objc_msgSend_25(_class!, _sel_description!); + final _ret = _lib._objc_msgSend_14(_class!, _sel_description!); return NSString._(_ret, _lib); } @@ -985,7 +770,7 @@ class NSObject extends _ObjCWrapper { static NSString debugDescription(NativeLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_debugDescription ??= _registerName(_lib, "debugDescription"); - final _ret = _lib._objc_msgSend_25(_class!, _sel_debugDescription!); + final _ret = _lib._objc_msgSend_14(_class!, _sel_debugDescription!); return NSString._(_ret, _lib); } } @@ -1038,7 +823,7 @@ class NSString extends _ObjCWrapper { _class ??= _getClass(_lib, "NSString"); _sel_stringWithCString_encoding ??= _registerName(_lib, "stringWithCString:encoding:"); - final _ret = _lib._objc_msgSend_23( + final _ret = _lib._objc_msgSend_12( _class!, _sel_stringWithCString_encoding!, cString, enc); return NSString._(_ret, _lib); } @@ -1046,7 +831,7 @@ class NSString extends _ObjCWrapper { static ffi.Pointer? _sel_UTF8String; ffi.Pointer UTF8String() { _sel_UTF8String ??= _registerName(_lib, "UTF8String"); - return _lib._objc_msgSend_24(_id, _sel_UTF8String!); + return _lib._objc_msgSend_13(_id, _sel_UTF8String!); } } diff --git a/pkgs/ffigen/test/native_objc_test/method_bindings.dart b/pkgs/ffigen/test/native_objc_test/method_bindings.dart index 4c74d24e13..d8390d3b69 100644 --- a/pkgs/ffigen/test/native_objc_test/method_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/method_bindings.dart @@ -191,88 +191,12 @@ class MethodTestObjCLibrary { instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer<_NSZone>)>(); - ffi.Pointer _objc_msgSend_3( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_3( - obj, - sel, - ); - } - - late final __objc_msgSend_3Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_4( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_4( - obj, - sel, - ); - } - - late final __objc_msgSend_4Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_5( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_5( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_5Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); - - ffi.Pointer _objc_msgSend_6( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_6( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_6Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); - - bool _objc_msgSend_7( + bool _objc_msgSend_3( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_7( + return __objc_msgSend_3( obj, sel, aSelector, @@ -280,20 +204,20 @@ class MethodTestObjCLibrary { 0; } - late final __objc_msgSend_7Ptr = _lookup< + late final __objc_msgSend_3Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_8( + bool _objc_msgSend_4( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer protocol, ) { - return __objc_msgSend_8( + return __objc_msgSend_4( obj, sel, protocol, @@ -301,295 +225,156 @@ class MethodTestObjCLibrary { 0; } - late final __objc_msgSend_8Ptr = _lookup< + late final __objc_msgSend_4Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - IMP _objc_msgSend_9( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_9( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_9Ptr = _lookup< - ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - IMP _objc_msgSend_10( + IMP _objc_msgSend_5( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_10( + return __objc_msgSend_5( obj, sel, aSelector, ); } - late final __objc_msgSend_10Ptr = _lookup< + late final __objc_msgSend_5Ptr = _lookup< ffi.NativeFunction< IMP Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< IMP Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_11( + void _objc_msgSend_6( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_11( + return __objc_msgSend_6( obj, sel, aSelector, ); } - late final __objc_msgSend_11Ptr = _lookup< + late final __objc_msgSend_6Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_12( + ffi.Pointer _objc_msgSend_7( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_12( + return __objc_msgSend_7( obj, sel, aSelector, ); } - late final __objc_msgSend_12Ptr = _lookup< + late final __objc_msgSend_7Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_13( + void _objc_msgSend_8( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer anInvocation, ) { - return __objc_msgSend_13( + return __objc_msgSend_8( obj, sel, anInvocation, ); } - late final __objc_msgSend_13Ptr = _lookup< + late final __objc_msgSend_8Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_14( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_14( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_14Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_15( + ffi.Pointer _objc_msgSend_9( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_15( + return __objc_msgSend_9( obj, sel, aSelector, ); } - late final __objc_msgSend_15Ptr = _lookup< + late final __objc_msgSend_9Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_16( + bool _objc_msgSend_10( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_16( + return __objc_msgSend_10( obj, sel, ) != 0; } - late final __objc_msgSend_16Ptr = _lookup< + late final __objc_msgSend_10Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_17( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aClass, - ) { - return __objc_msgSend_17( - obj, - sel, - aClass, - ) != - 0; - } - - late final __objc_msgSend_17Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - bool _objc_msgSend_18( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer sel1, - ) { - return __objc_msgSend_18( - obj, - sel, - sel1, - ) != - 0; - } - - late final __objc_msgSend_18Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - bool _objc_msgSend_19( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer sel1, - ) { - return __objc_msgSend_19( - obj, - sel, - sel1, - ) != - 0; - } - - late final __objc_msgSend_19Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int _objc_msgSend_20( + int _objc_msgSend_11( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_20( + return __objc_msgSend_11( obj, sel, ); } - late final __objc_msgSend_20Ptr = _lookup< + late final __objc_msgSend_11Ptr = _lookup< ffi.NativeFunction< NSUInteger Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_21( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_21( - obj, - sel, - ); - } - - late final __objc_msgSend_21Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_22( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_22( - obj, - sel, - ); - } - - late final __objc_msgSend_22Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_23( + ffi.Pointer _objc_msgSend_12( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer cString, int enc, ) { - return __objc_msgSend_23( + return __objc_msgSend_12( obj, sel, cString, @@ -597,96 +382,96 @@ class MethodTestObjCLibrary { ); } - late final __objc_msgSend_23Ptr = _lookup< + late final __objc_msgSend_12Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); - ffi.Pointer _objc_msgSend_24( + ffi.Pointer _objc_msgSend_13( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_24( + return __objc_msgSend_13( obj, sel, ); } - late final __objc_msgSend_24Ptr = _lookup< + late final __objc_msgSend_13Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_25( + ffi.Pointer _objc_msgSend_14( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_25( + return __objc_msgSend_14( obj, sel, ); } - late final __objc_msgSend_25Ptr = _lookup< + late final __objc_msgSend_14Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_26( + int _objc_msgSend_15( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_26( + return __objc_msgSend_15( obj, sel, ); } - late final __objc_msgSend_26Ptr = _lookup< + late final __objc_msgSend_15Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_27( + int _objc_msgSend_16( ffi.Pointer obj, ffi.Pointer sel, int x, ) { - return __objc_msgSend_27( + return __objc_msgSend_16( obj, sel, x, ); } - late final __objc_msgSend_27Ptr = _lookup< + late final __objc_msgSend_16Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); - int _objc_msgSend_28( + int _objc_msgSend_17( ffi.Pointer obj, ffi.Pointer sel, int x, int y, ) { - return __objc_msgSend_28( + return __objc_msgSend_17( obj, sel, x, @@ -694,21 +479,21 @@ class MethodTestObjCLibrary { ); } - late final __objc_msgSend_28Ptr = _lookup< + late final __objc_msgSend_17Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_28 = __objc_msgSend_28Ptr.asFunction< + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, int)>(); - int _objc_msgSend_29( + int _objc_msgSend_18( ffi.Pointer obj, ffi.Pointer sel, int x, int y, int z, ) { - return __objc_msgSend_29( + return __objc_msgSend_18( obj, sel, x, @@ -717,11 +502,11 @@ class MethodTestObjCLibrary { ); } - late final __objc_msgSend_29Ptr = _lookup< + late final __objc_msgSend_18Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Int32, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_29 = __objc_msgSend_29Ptr.asFunction< + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< int Function( ffi.Pointer, ffi.Pointer, int, int, int)>(); } @@ -855,53 +640,53 @@ class MethodInterface extends NSObject { static ffi.Pointer? _sel_add; int add() { _sel_add ??= _registerName(_lib, "add"); - return _lib._objc_msgSend_26(_id, _sel_add!); + return _lib._objc_msgSend_15(_id, _sel_add!); } static ffi.Pointer? _sel_add1; int add1(int x) { _sel_add1 ??= _registerName(_lib, "add:"); - return _lib._objc_msgSend_27(_id, _sel_add1!, x); + return _lib._objc_msgSend_16(_id, _sel_add1!, x); } static ffi.Pointer? _sel_add_Y; int add_Y(int x, int y) { _sel_add_Y ??= _registerName(_lib, "add:Y:"); - return _lib._objc_msgSend_28(_id, _sel_add_Y!, x, y); + return _lib._objc_msgSend_17(_id, _sel_add_Y!, x, y); } static ffi.Pointer? _sel_add_Y_Z; int add_Y_Z(int x, int y, int z) { _sel_add_Y_Z ??= _registerName(_lib, "add:Y:Z:"); - return _lib._objc_msgSend_29(_id, _sel_add_Y_Z!, x, y, z); + return _lib._objc_msgSend_18(_id, _sel_add_Y_Z!, x, y, z); } static ffi.Pointer? _sel_sub; static int sub(MethodTestObjCLibrary _lib) { _class ??= _getClass(_lib, "MethodInterface"); _sel_sub ??= _registerName(_lib, "sub"); - return _lib._objc_msgSend_26(_class!, _sel_sub!); + return _lib._objc_msgSend_15(_class!, _sel_sub!); } static ffi.Pointer? _sel_sub1; static int sub1(MethodTestObjCLibrary _lib, int x) { _class ??= _getClass(_lib, "MethodInterface"); _sel_sub1 ??= _registerName(_lib, "sub:"); - return _lib._objc_msgSend_27(_class!, _sel_sub1!, x); + return _lib._objc_msgSend_16(_class!, _sel_sub1!, x); } static ffi.Pointer? _sel_sub_Y; static int sub_Y(MethodTestObjCLibrary _lib, int x, int y) { _class ??= _getClass(_lib, "MethodInterface"); _sel_sub_Y ??= _registerName(_lib, "sub:Y:"); - return _lib._objc_msgSend_28(_class!, _sel_sub_Y!, x, y); + return _lib._objc_msgSend_17(_class!, _sel_sub_Y!, x, y); } static ffi.Pointer? _sel_sub_Y_Z; static int sub_Y_Z(MethodTestObjCLibrary _lib, int x, int y, int z) { _class ??= _getClass(_lib, "MethodInterface"); _sel_sub_Y_Z ??= _registerName(_lib, "sub:Y:Z:"); - return _lib._objc_msgSend_29(_class!, _sel_sub_Y_Z!, x, y, z); + return _lib._objc_msgSend_18(_class!, _sel_sub_Y_Z!, x, y, z); } static ffi.Pointer? _sel_new1; @@ -992,14 +777,14 @@ class NSObject extends _ObjCWrapper { static ffi.Pointer? _sel_copy; NSObject copy() { _sel_copy ??= _registerName(_lib, "copy"); - final _ret = _lib._objc_msgSend_3(_id, _sel_copy!); + final _ret = _lib._objc_msgSend_1(_id, _sel_copy!); return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_mutableCopy; NSObject mutableCopy() { _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); - final _ret = _lib._objc_msgSend_4(_id, _sel_mutableCopy!); + final _ret = _lib._objc_msgSend_1(_id, _sel_mutableCopy!); return NSObject._(_ret, _lib); } @@ -1008,7 +793,7 @@ class NSObject extends _ObjCWrapper { MethodTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { _class ??= _getClass(_lib, "NSObject"); _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); - final _ret = _lib._objc_msgSend_5(_class!, _sel_copyWithZone!, zone); + final _ret = _lib._objc_msgSend_2(_class!, _sel_copyWithZone!, zone); return NSObject._(_ret, _lib); } @@ -1017,7 +802,7 @@ class NSObject extends _ObjCWrapper { MethodTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { _class ??= _getClass(_lib, "NSObject"); _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); - final _ret = _lib._objc_msgSend_6(_class!, _sel_mutableCopyWithZone!, zone); + final _ret = _lib._objc_msgSend_2(_class!, _sel_mutableCopyWithZone!, zone); return NSObject._(_ret, _lib); } @@ -1027,7 +812,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instancesRespondToSelector ??= _registerName(_lib, "instancesRespondToSelector:"); - return _lib._objc_msgSend_7( + return _lib._objc_msgSend_3( _class!, _sel_instancesRespondToSelector!, aSelector); } @@ -1036,14 +821,14 @@ class NSObject extends _ObjCWrapper { MethodTestObjCLibrary _lib, NSObject protocol) { _class ??= _getClass(_lib, "NSObject"); _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); - return _lib._objc_msgSend_8( + return _lib._objc_msgSend_4( _class!, _sel_conformsToProtocol!, protocol._id); } static ffi.Pointer? _sel_methodForSelector; IMP methodForSelector(ffi.Pointer aSelector) { _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); - return _lib._objc_msgSend_9(_id, _sel_methodForSelector!, aSelector); + return _lib._objc_msgSend_5(_id, _sel_methodForSelector!, aSelector); } static ffi.Pointer? _sel_instanceMethodForSelector; @@ -1052,7 +837,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instanceMethodForSelector ??= _registerName(_lib, "instanceMethodForSelector:"); - return _lib._objc_msgSend_10( + return _lib._objc_msgSend_5( _class!, _sel_instanceMethodForSelector!, aSelector); } @@ -1060,22 +845,22 @@ class NSObject extends _ObjCWrapper { void doesNotRecognizeSelector(ffi.Pointer aSelector) { _sel_doesNotRecognizeSelector ??= _registerName(_lib, "doesNotRecognizeSelector:"); - _lib._objc_msgSend_11(_id, _sel_doesNotRecognizeSelector!, aSelector); + _lib._objc_msgSend_6(_id, _sel_doesNotRecognizeSelector!, aSelector); } static ffi.Pointer? _sel_forwardingTargetForSelector; NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { _sel_forwardingTargetForSelector ??= _registerName(_lib, "forwardingTargetForSelector:"); - final _ret = _lib._objc_msgSend_12( - _id, _sel_forwardingTargetForSelector!, aSelector); + final _ret = + _lib._objc_msgSend_7(_id, _sel_forwardingTargetForSelector!, aSelector); return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_forwardInvocation; void forwardInvocation(NSObject anInvocation) { _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); - _lib._objc_msgSend_13(_id, _sel_forwardInvocation!, anInvocation._id); + _lib._objc_msgSend_8(_id, _sel_forwardInvocation!, anInvocation._id); } static ffi.Pointer? _sel_methodSignatureForSelector; @@ -1083,7 +868,7 @@ class NSObject extends _ObjCWrapper { _sel_methodSignatureForSelector ??= _registerName(_lib, "methodSignatureForSelector:"); final _ret = - _lib._objc_msgSend_14(_id, _sel_methodSignatureForSelector!, aSelector); + _lib._objc_msgSend_9(_id, _sel_methodSignatureForSelector!, aSelector); return NSMethodSignature._(_ret, _lib); } @@ -1093,7 +878,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instanceMethodSignatureForSelector ??= _registerName(_lib, "instanceMethodSignatureForSelector:"); - final _ret = _lib._objc_msgSend_15( + final _ret = _lib._objc_msgSend_9( _class!, _sel_instanceMethodSignatureForSelector!, aSelector); return NSMethodSignature._(_ret, _lib); } @@ -1101,20 +886,20 @@ class NSObject extends _ObjCWrapper { static ffi.Pointer? _sel_allowsWeakReference; bool allowsWeakReference() { _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); - return _lib._objc_msgSend_16(_id, _sel_allowsWeakReference!); + return _lib._objc_msgSend_10(_id, _sel_allowsWeakReference!); } static ffi.Pointer? _sel_retainWeakReference; bool retainWeakReference() { _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); - return _lib._objc_msgSend_16(_id, _sel_retainWeakReference!); + return _lib._objc_msgSend_10(_id, _sel_retainWeakReference!); } static ffi.Pointer? _sel_isSubclassOfClass; static bool isSubclassOfClass(MethodTestObjCLibrary _lib, NSObject aClass) { _class ??= _getClass(_lib, "NSObject"); _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); - return _lib._objc_msgSend_17(_class!, _sel_isSubclassOfClass!, aClass._id); + return _lib._objc_msgSend_4(_class!, _sel_isSubclassOfClass!, aClass._id); } static ffi.Pointer? _sel_resolveClassMethod; @@ -1122,7 +907,7 @@ class NSObject extends _ObjCWrapper { MethodTestObjCLibrary _lib, ffi.Pointer sel) { _class ??= _getClass(_lib, "NSObject"); _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); - return _lib._objc_msgSend_18(_class!, _sel_resolveClassMethod!, sel); + return _lib._objc_msgSend_3(_class!, _sel_resolveClassMethod!, sel); } static ffi.Pointer? _sel_resolveInstanceMethod; @@ -1131,21 +916,21 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_resolveInstanceMethod ??= _registerName(_lib, "resolveInstanceMethod:"); - return _lib._objc_msgSend_19(_class!, _sel_resolveInstanceMethod!, sel); + return _lib._objc_msgSend_3(_class!, _sel_resolveInstanceMethod!, sel); } static ffi.Pointer? _sel_hash; static int hash(MethodTestObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_hash ??= _registerName(_lib, "hash"); - return _lib._objc_msgSend_20(_class!, _sel_hash!); + return _lib._objc_msgSend_11(_class!, _sel_hash!); } static ffi.Pointer? _sel_superclass; static NSObject superclass(MethodTestObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_superclass ??= _registerName(_lib, "superclass"); - final _ret = _lib._objc_msgSend_21(_class!, _sel_superclass!); + final _ret = _lib._objc_msgSend_1(_class!, _sel_superclass!); return NSObject._(_ret, _lib); } @@ -1153,7 +938,7 @@ class NSObject extends _ObjCWrapper { static NSObject class1(MethodTestObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_class1 ??= _registerName(_lib, "class"); - final _ret = _lib._objc_msgSend_22(_class!, _sel_class1!); + final _ret = _lib._objc_msgSend_1(_class!, _sel_class1!); return NSObject._(_ret, _lib); } @@ -1161,7 +946,7 @@ class NSObject extends _ObjCWrapper { static NSString description(MethodTestObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_description ??= _registerName(_lib, "description"); - final _ret = _lib._objc_msgSend_25(_class!, _sel_description!); + final _ret = _lib._objc_msgSend_14(_class!, _sel_description!); return NSString._(_ret, _lib); } @@ -1169,7 +954,7 @@ class NSObject extends _ObjCWrapper { static NSString debugDescription(MethodTestObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_debugDescription ??= _registerName(_lib, "debugDescription"); - final _ret = _lib._objc_msgSend_25(_class!, _sel_debugDescription!); + final _ret = _lib._objc_msgSend_14(_class!, _sel_debugDescription!); return NSString._(_ret, _lib); } } @@ -1223,7 +1008,7 @@ class NSString extends _ObjCWrapper { _class ??= _getClass(_lib, "NSString"); _sel_stringWithCString_encoding ??= _registerName(_lib, "stringWithCString:encoding:"); - final _ret = _lib._objc_msgSend_23( + final _ret = _lib._objc_msgSend_12( _class!, _sel_stringWithCString_encoding!, cString, enc); return NSString._(_ret, _lib); } @@ -1231,7 +1016,7 @@ class NSString extends _ObjCWrapper { static ffi.Pointer? _sel_UTF8String; ffi.Pointer UTF8String() { _sel_UTF8String ??= _registerName(_lib, "UTF8String"); - return _lib._objc_msgSend_24(_id, _sel_UTF8String!); + return _lib._objc_msgSend_13(_id, _sel_UTF8String!); } } diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart index b4c7fac470..9ffa2a8a94 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart @@ -488,88 +488,12 @@ class NativeObjCLibrary { instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer<_NSZone>)>(); - ffi.Pointer _objc_msgSend_3( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_3( - obj, - sel, - ); - } - - late final __objc_msgSend_3Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_4( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_4( - obj, - sel, - ); - } - - late final __objc_msgSend_4Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_5( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_5( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_5Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); - - ffi.Pointer _objc_msgSend_6( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_6( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_6Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); - - bool _objc_msgSend_7( + bool _objc_msgSend_3( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_7( + return __objc_msgSend_3( obj, sel, aSelector, @@ -577,20 +501,20 @@ class NativeObjCLibrary { 0; } - late final __objc_msgSend_7Ptr = _lookup< + late final __objc_msgSend_3Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_8( + bool _objc_msgSend_4( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer protocol, ) { - return __objc_msgSend_8( + return __objc_msgSend_4( obj, sel, protocol, @@ -598,334 +522,195 @@ class NativeObjCLibrary { 0; } - late final __objc_msgSend_8Ptr = _lookup< + late final __objc_msgSend_4Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - IMP _objc_msgSend_9( + IMP _objc_msgSend_5( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_9( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_9Ptr = _lookup< - ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - IMP _objc_msgSend_10( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_10( + return __objc_msgSend_5( obj, sel, aSelector, ); } - late final __objc_msgSend_10Ptr = _lookup< + late final __objc_msgSend_5Ptr = _lookup< ffi.NativeFunction< IMP Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< IMP Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_11( + void _objc_msgSend_6( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_11( + return __objc_msgSend_6( obj, sel, aSelector, ); } - late final __objc_msgSend_11Ptr = _lookup< + late final __objc_msgSend_6Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_12( + ffi.Pointer _objc_msgSend_7( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_12( + return __objc_msgSend_7( obj, sel, aSelector, ); } - late final __objc_msgSend_12Ptr = _lookup< + late final __objc_msgSend_7Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_13( + void _objc_msgSend_8( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer anInvocation, ) { - return __objc_msgSend_13( + return __objc_msgSend_8( obj, sel, anInvocation, ); } - late final __objc_msgSend_13Ptr = _lookup< + late final __objc_msgSend_8Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_14( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_14( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_14Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_15( + ffi.Pointer _objc_msgSend_9( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_15( + return __objc_msgSend_9( obj, sel, aSelector, ); } - late final __objc_msgSend_15Ptr = _lookup< + late final __objc_msgSend_9Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_16( + bool _objc_msgSend_10( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_16( + return __objc_msgSend_10( obj, sel, ) != 0; } - late final __objc_msgSend_16Ptr = _lookup< + late final __objc_msgSend_10Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_17( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aClass, - ) { - return __objc_msgSend_17( - obj, - sel, - aClass, - ) != - 0; - } - - late final __objc_msgSend_17Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - bool _objc_msgSend_18( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer sel1, - ) { - return __objc_msgSend_18( - obj, - sel, - sel1, - ) != - 0; - } - - late final __objc_msgSend_18Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - bool _objc_msgSend_19( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer sel1, - ) { - return __objc_msgSend_19( - obj, - sel, - sel1, - ) != - 0; - } - - late final __objc_msgSend_19Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int _objc_msgSend_20( + int _objc_msgSend_11( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_20( + return __objc_msgSend_11( obj, sel, ); } - late final __objc_msgSend_20Ptr = _lookup< + late final __objc_msgSend_11Ptr = _lookup< ffi.NativeFunction< NSUInteger Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_21( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_21( - obj, - sel, - ); - } - - late final __objc_msgSend_21Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_22( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_22( - obj, - sel, - ); - } - - late final __objc_msgSend_22Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int _objc_msgSend_23( + int _objc_msgSend_12( ffi.Pointer obj, ffi.Pointer sel, int index, ) { - return __objc_msgSend_23( + return __objc_msgSend_12( obj, sel, index, ); } - late final __objc_msgSend_23Ptr = _lookup< + late final __objc_msgSend_12Ptr = _lookup< ffi.NativeFunction< unichar Function(ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); - instancetype _objc_msgSend_24( + instancetype _objc_msgSend_13( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer coder, ) { - return __objc_msgSend_24( + return __objc_msgSend_13( obj, sel, coder, ); } - late final __objc_msgSend_24Ptr = _lookup< + late final __objc_msgSend_13Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_25( + ffi.Pointer _objc_msgSend_14( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer cString, int enc, ) { - return __objc_msgSend_25( + return __objc_msgSend_14( obj, sel, cString, @@ -933,116 +718,116 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_25Ptr = _lookup< + late final __objc_msgSend_14Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); - ffi.Pointer _objc_msgSend_26( + ffi.Pointer _objc_msgSend_15( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_26( + return __objc_msgSend_15( obj, sel, ); } - late final __objc_msgSend_26Ptr = _lookup< + late final __objc_msgSend_15Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_27( + ffi.Pointer _objc_msgSend_16( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_27( + return __objc_msgSend_16( obj, sel, ); } - late final __objc_msgSend_27Ptr = _lookup< + late final __objc_msgSend_16Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_28( + int _objc_msgSend_17( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_28( + return __objc_msgSend_17( obj, sel, ); } - late final __objc_msgSend_28Ptr = _lookup< + late final __objc_msgSend_17Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_28 = __objc_msgSend_28Ptr.asFunction< + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_29( + void _objc_msgSend_18( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_29( + return __objc_msgSend_18( obj, sel, value, ); } - late final __objc_msgSend_29Ptr = _lookup< + late final __objc_msgSend_18Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_29 = __objc_msgSend_29Ptr.asFunction< + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); - ffi.Pointer _objc_msgSend_30( + ffi.Pointer _objc_msgSend_19( ffi.Pointer obj, ffi.Pointer sel, double x, ) { - return __objc_msgSend_30( + return __objc_msgSend_19( obj, sel, x, ); } - late final __objc_msgSend_30Ptr = _lookup< + late final __objc_msgSend_19Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_30 = __objc_msgSend_30Ptr.asFunction< + late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, double)>(); - int _objc_msgSend_31( + int _objc_msgSend_20( ffi.Pointer obj, ffi.Pointer sel, bool useIntVals, ffi.Pointer other, ) { - return __objc_msgSend_31( + return __objc_msgSend_20( obj, sel, useIntVals ? 1 : 0, @@ -1050,31 +835,31 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_31Ptr = _lookup< + late final __objc_msgSend_20Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Uint8, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_31 = __objc_msgSend_31Ptr.asFunction< + late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); - void _objc_msgSend_32( + void _objc_msgSend_21( ffi.Pointer obj, ffi.Pointer sel, double x, ) { - return __objc_msgSend_32( + return __objc_msgSend_21( obj, sel, x, ); } - late final __objc_msgSend_32Ptr = _lookup< + late final __objc_msgSend_21Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_32 = __objc_msgSend_32Ptr.asFunction< + late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, double)>(); } @@ -1301,20 +1086,20 @@ class Foo extends NSObject { static ffi.Pointer? _sel_intVal; int get intVal { _sel_intVal ??= _registerName(_lib, "intVal"); - return _lib._objc_msgSend_28(_id, _sel_intVal!); + return _lib._objc_msgSend_17(_id, _sel_intVal!); } static ffi.Pointer? _sel_intVal1; set intVal(int value) { _sel_intVal1 ??= _registerName(_lib, "setIntVal:"); - _lib._objc_msgSend_29(_id, _sel_intVal1!, value); + _lib._objc_msgSend_18(_id, _sel_intVal1!, value); } static ffi.Pointer? _sel_makeFoo; static Foo makeFoo(NativeObjCLibrary _lib, double x) { _class ??= _getClass(_lib, "Foo"); _sel_makeFoo ??= _registerName(_lib, "makeFoo:"); - final _ret = _lib._objc_msgSend_30(_class!, _sel_makeFoo!, x); + final _ret = _lib._objc_msgSend_19(_class!, _sel_makeFoo!, x); return Foo._(_ret, _lib); } @@ -1322,14 +1107,14 @@ class Foo extends NSObject { int multiply_withOtherFoo(bool useIntVals, NSObject other) { _sel_multiply_withOtherFoo ??= _registerName(_lib, "multiply:withOtherFoo:"); - return _lib._objc_msgSend_31( + return _lib._objc_msgSend_20( _id, _sel_multiply_withOtherFoo!, useIntVals, other._id); } static ffi.Pointer? _sel_setDoubleVal; void setDoubleVal(double x) { _sel_setDoubleVal ??= _registerName(_lib, "setDoubleVal:"); - _lib._objc_msgSend_32(_id, _sel_setDoubleVal!, x); + _lib._objc_msgSend_21(_id, _sel_setDoubleVal!, x); } static ffi.Pointer? _sel_new1; @@ -1420,14 +1205,14 @@ class NSObject extends _ObjCWrapper { static ffi.Pointer? _sel_copy; NSObject copy() { _sel_copy ??= _registerName(_lib, "copy"); - final _ret = _lib._objc_msgSend_3(_id, _sel_copy!); + final _ret = _lib._objc_msgSend_1(_id, _sel_copy!); return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_mutableCopy; NSObject mutableCopy() { _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); - final _ret = _lib._objc_msgSend_4(_id, _sel_mutableCopy!); + final _ret = _lib._objc_msgSend_1(_id, _sel_mutableCopy!); return NSObject._(_ret, _lib); } @@ -1436,7 +1221,7 @@ class NSObject extends _ObjCWrapper { NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { _class ??= _getClass(_lib, "NSObject"); _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); - final _ret = _lib._objc_msgSend_5(_class!, _sel_copyWithZone!, zone); + final _ret = _lib._objc_msgSend_2(_class!, _sel_copyWithZone!, zone); return NSObject._(_ret, _lib); } @@ -1445,7 +1230,7 @@ class NSObject extends _ObjCWrapper { NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { _class ??= _getClass(_lib, "NSObject"); _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); - final _ret = _lib._objc_msgSend_6(_class!, _sel_mutableCopyWithZone!, zone); + final _ret = _lib._objc_msgSend_2(_class!, _sel_mutableCopyWithZone!, zone); return NSObject._(_ret, _lib); } @@ -1455,7 +1240,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instancesRespondToSelector ??= _registerName(_lib, "instancesRespondToSelector:"); - return _lib._objc_msgSend_7( + return _lib._objc_msgSend_3( _class!, _sel_instancesRespondToSelector!, aSelector); } @@ -1463,14 +1248,14 @@ class NSObject extends _ObjCWrapper { static bool conformsToProtocol(NativeObjCLibrary _lib, NSObject protocol) { _class ??= _getClass(_lib, "NSObject"); _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); - return _lib._objc_msgSend_8( + return _lib._objc_msgSend_4( _class!, _sel_conformsToProtocol!, protocol._id); } static ffi.Pointer? _sel_methodForSelector; IMP methodForSelector(ffi.Pointer aSelector) { _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); - return _lib._objc_msgSend_9(_id, _sel_methodForSelector!, aSelector); + return _lib._objc_msgSend_5(_id, _sel_methodForSelector!, aSelector); } static ffi.Pointer? _sel_instanceMethodForSelector; @@ -1479,7 +1264,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instanceMethodForSelector ??= _registerName(_lib, "instanceMethodForSelector:"); - return _lib._objc_msgSend_10( + return _lib._objc_msgSend_5( _class!, _sel_instanceMethodForSelector!, aSelector); } @@ -1487,22 +1272,22 @@ class NSObject extends _ObjCWrapper { void doesNotRecognizeSelector(ffi.Pointer aSelector) { _sel_doesNotRecognizeSelector ??= _registerName(_lib, "doesNotRecognizeSelector:"); - _lib._objc_msgSend_11(_id, _sel_doesNotRecognizeSelector!, aSelector); + _lib._objc_msgSend_6(_id, _sel_doesNotRecognizeSelector!, aSelector); } static ffi.Pointer? _sel_forwardingTargetForSelector; NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { _sel_forwardingTargetForSelector ??= _registerName(_lib, "forwardingTargetForSelector:"); - final _ret = _lib._objc_msgSend_12( - _id, _sel_forwardingTargetForSelector!, aSelector); + final _ret = + _lib._objc_msgSend_7(_id, _sel_forwardingTargetForSelector!, aSelector); return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_forwardInvocation; void forwardInvocation(NSObject anInvocation) { _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); - _lib._objc_msgSend_13(_id, _sel_forwardInvocation!, anInvocation._id); + _lib._objc_msgSend_8(_id, _sel_forwardInvocation!, anInvocation._id); } static ffi.Pointer? _sel_methodSignatureForSelector; @@ -1510,7 +1295,7 @@ class NSObject extends _ObjCWrapper { _sel_methodSignatureForSelector ??= _registerName(_lib, "methodSignatureForSelector:"); final _ret = - _lib._objc_msgSend_14(_id, _sel_methodSignatureForSelector!, aSelector); + _lib._objc_msgSend_9(_id, _sel_methodSignatureForSelector!, aSelector); return NSMethodSignature._(_ret, _lib); } @@ -1520,7 +1305,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instanceMethodSignatureForSelector ??= _registerName(_lib, "instanceMethodSignatureForSelector:"); - final _ret = _lib._objc_msgSend_15( + final _ret = _lib._objc_msgSend_9( _class!, _sel_instanceMethodSignatureForSelector!, aSelector); return NSMethodSignature._(_ret, _lib); } @@ -1528,20 +1313,20 @@ class NSObject extends _ObjCWrapper { static ffi.Pointer? _sel_allowsWeakReference; bool allowsWeakReference() { _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); - return _lib._objc_msgSend_16(_id, _sel_allowsWeakReference!); + return _lib._objc_msgSend_10(_id, _sel_allowsWeakReference!); } static ffi.Pointer? _sel_retainWeakReference; bool retainWeakReference() { _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); - return _lib._objc_msgSend_16(_id, _sel_retainWeakReference!); + return _lib._objc_msgSend_10(_id, _sel_retainWeakReference!); } static ffi.Pointer? _sel_isSubclassOfClass; static bool isSubclassOfClass(NativeObjCLibrary _lib, NSObject aClass) { _class ??= _getClass(_lib, "NSObject"); _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); - return _lib._objc_msgSend_17(_class!, _sel_isSubclassOfClass!, aClass._id); + return _lib._objc_msgSend_4(_class!, _sel_isSubclassOfClass!, aClass._id); } static ffi.Pointer? _sel_resolveClassMethod; @@ -1549,7 +1334,7 @@ class NSObject extends _ObjCWrapper { NativeObjCLibrary _lib, ffi.Pointer sel) { _class ??= _getClass(_lib, "NSObject"); _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); - return _lib._objc_msgSend_18(_class!, _sel_resolveClassMethod!, sel); + return _lib._objc_msgSend_3(_class!, _sel_resolveClassMethod!, sel); } static ffi.Pointer? _sel_resolveInstanceMethod; @@ -1558,21 +1343,21 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_resolveInstanceMethod ??= _registerName(_lib, "resolveInstanceMethod:"); - return _lib._objc_msgSend_19(_class!, _sel_resolveInstanceMethod!, sel); + return _lib._objc_msgSend_3(_class!, _sel_resolveInstanceMethod!, sel); } static ffi.Pointer? _sel_hash; static int hash(NativeObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_hash ??= _registerName(_lib, "hash"); - return _lib._objc_msgSend_20(_class!, _sel_hash!); + return _lib._objc_msgSend_11(_class!, _sel_hash!); } static ffi.Pointer? _sel_superclass; static NSObject superclass(NativeObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_superclass ??= _registerName(_lib, "superclass"); - final _ret = _lib._objc_msgSend_21(_class!, _sel_superclass!); + final _ret = _lib._objc_msgSend_1(_class!, _sel_superclass!); return NSObject._(_ret, _lib); } @@ -1580,7 +1365,7 @@ class NSObject extends _ObjCWrapper { static NSObject class1(NativeObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_class1 ??= _registerName(_lib, "class"); - final _ret = _lib._objc_msgSend_22(_class!, _sel_class1!); + final _ret = _lib._objc_msgSend_1(_class!, _sel_class1!); return NSObject._(_ret, _lib); } @@ -1588,7 +1373,7 @@ class NSObject extends _ObjCWrapper { static NSString description(NativeObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_description ??= _registerName(_lib, "description"); - final _ret = _lib._objc_msgSend_27(_class!, _sel_description!); + final _ret = _lib._objc_msgSend_16(_class!, _sel_description!); return NSString._(_ret, _lib); } @@ -1596,7 +1381,7 @@ class NSObject extends _ObjCWrapper { static NSString debugDescription(NativeObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_debugDescription ??= _registerName(_lib, "debugDescription"); - final _ret = _lib._objc_msgSend_27(_class!, _sel_debugDescription!); + final _ret = _lib._objc_msgSend_16(_class!, _sel_debugDescription!); return NSString._(_ret, _lib); } } @@ -1643,13 +1428,13 @@ class NSString extends NSObject { static ffi.Pointer? _sel_length; int get length { _sel_length ??= _registerName(_lib, "length"); - return _lib._objc_msgSend_20(_id, _sel_length!); + return _lib._objc_msgSend_11(_id, _sel_length!); } static ffi.Pointer? _sel_characterAtIndex; int characterAtIndex(int index) { _sel_characterAtIndex ??= _registerName(_lib, "characterAtIndex:"); - return _lib._objc_msgSend_23(_id, _sel_characterAtIndex!, index); + return _lib._objc_msgSend_12(_id, _sel_characterAtIndex!, index); } static ffi.Pointer? _sel_init; @@ -1663,7 +1448,7 @@ class NSString extends NSObject { static ffi.Pointer? _sel_initWithCoder; NSString initWithCoder(NSObject coder) { _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_24(_id, _sel_initWithCoder!, coder._id); + final _ret = _lib._objc_msgSend_13(_id, _sel_initWithCoder!, coder._id); return NSString._(_ret, _lib); } @@ -1673,7 +1458,7 @@ class NSString extends NSObject { _class ??= _getClass(_lib, "NSString"); _sel_stringWithCString_encoding ??= _registerName(_lib, "stringWithCString:encoding:"); - final _ret = _lib._objc_msgSend_25( + final _ret = _lib._objc_msgSend_14( _class!, _sel_stringWithCString_encoding!, cString, enc); return NSString._(_ret, _lib); } @@ -1681,7 +1466,7 @@ class NSString extends NSObject { static ffi.Pointer? _sel_UTF8String; ffi.Pointer UTF8String() { _sel_UTF8String ??= _registerName(_lib, "UTF8String"); - return _lib._objc_msgSend_26(_id, _sel_UTF8String!); + return _lib._objc_msgSend_15(_id, _sel_UTF8String!); } static ffi.Pointer? _sel_new1; diff --git a/pkgs/ffigen/test/native_objc_test/property_bindings.dart b/pkgs/ffigen/test/native_objc_test/property_bindings.dart index 85485e7f4c..9a18e7d1ac 100644 --- a/pkgs/ffigen/test/native_objc_test/property_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/property_bindings.dart @@ -191,88 +191,12 @@ class PropertyTestObjCLibrary { instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer<_NSZone>)>(); - ffi.Pointer _objc_msgSend_3( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_3( - obj, - sel, - ); - } - - late final __objc_msgSend_3Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_4( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_4( - obj, - sel, - ); - } - - late final __objc_msgSend_4Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_5( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_5( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_5Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); - - ffi.Pointer _objc_msgSend_6( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_6( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_6Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); - - bool _objc_msgSend_7( + bool _objc_msgSend_3( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_7( + return __objc_msgSend_3( obj, sel, aSelector, @@ -280,20 +204,20 @@ class PropertyTestObjCLibrary { 0; } - late final __objc_msgSend_7Ptr = _lookup< + late final __objc_msgSend_3Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_8( + bool _objc_msgSend_4( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer protocol, ) { - return __objc_msgSend_8( + return __objc_msgSend_4( obj, sel, protocol, @@ -301,295 +225,156 @@ class PropertyTestObjCLibrary { 0; } - late final __objc_msgSend_8Ptr = _lookup< + late final __objc_msgSend_4Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - IMP _objc_msgSend_9( + IMP _objc_msgSend_5( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_9( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_9Ptr = _lookup< - ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - IMP _objc_msgSend_10( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_10( + return __objc_msgSend_5( obj, sel, aSelector, ); } - late final __objc_msgSend_10Ptr = _lookup< + late final __objc_msgSend_5Ptr = _lookup< ffi.NativeFunction< IMP Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< IMP Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_11( + void _objc_msgSend_6( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_11( + return __objc_msgSend_6( obj, sel, aSelector, ); } - late final __objc_msgSend_11Ptr = _lookup< + late final __objc_msgSend_6Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_12( + ffi.Pointer _objc_msgSend_7( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_12( + return __objc_msgSend_7( obj, sel, aSelector, ); } - late final __objc_msgSend_12Ptr = _lookup< + late final __objc_msgSend_7Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_13( + void _objc_msgSend_8( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer anInvocation, ) { - return __objc_msgSend_13( + return __objc_msgSend_8( obj, sel, anInvocation, ); } - late final __objc_msgSend_13Ptr = _lookup< + late final __objc_msgSend_8Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_14( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_14( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_14Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_15( + ffi.Pointer _objc_msgSend_9( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { - return __objc_msgSend_15( + return __objc_msgSend_9( obj, sel, aSelector, ); } - late final __objc_msgSend_15Ptr = _lookup< + late final __objc_msgSend_9Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_16( + bool _objc_msgSend_10( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_16( + return __objc_msgSend_10( obj, sel, ) != 0; } - late final __objc_msgSend_16Ptr = _lookup< + late final __objc_msgSend_10Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_17( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aClass, - ) { - return __objc_msgSend_17( - obj, - sel, - aClass, - ) != - 0; - } - - late final __objc_msgSend_17Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - bool _objc_msgSend_18( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer sel1, - ) { - return __objc_msgSend_18( - obj, - sel, - sel1, - ) != - 0; - } - - late final __objc_msgSend_18Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - bool _objc_msgSend_19( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer sel1, - ) { - return __objc_msgSend_19( - obj, - sel, - sel1, - ) != - 0; - } - - late final __objc_msgSend_19Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int _objc_msgSend_20( + int _objc_msgSend_11( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_20( + return __objc_msgSend_11( obj, sel, ); } - late final __objc_msgSend_20Ptr = _lookup< + late final __objc_msgSend_11Ptr = _lookup< ffi.NativeFunction< NSUInteger Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_21( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_21( - obj, - sel, - ); - } - - late final __objc_msgSend_21Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_22( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_22( - obj, - sel, - ); - } - - late final __objc_msgSend_22Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_23( + ffi.Pointer _objc_msgSend_12( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer cString, int enc, ) { - return __objc_msgSend_23( + return __objc_msgSend_12( obj, sel, cString, @@ -597,87 +382,87 @@ class PropertyTestObjCLibrary { ); } - late final __objc_msgSend_23Ptr = _lookup< + late final __objc_msgSend_12Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); - ffi.Pointer _objc_msgSend_24( + ffi.Pointer _objc_msgSend_13( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_24( + return __objc_msgSend_13( obj, sel, ); } - late final __objc_msgSend_24Ptr = _lookup< + late final __objc_msgSend_13Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_25( + ffi.Pointer _objc_msgSend_14( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_25( + return __objc_msgSend_14( obj, sel, ); } - late final __objc_msgSend_25Ptr = _lookup< + late final __objc_msgSend_14Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); - int _objc_msgSend_26( + int _objc_msgSend_15( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_26( + return __objc_msgSend_15( obj, sel, ); } - late final __objc_msgSend_26Ptr = _lookup< + late final __objc_msgSend_15Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_27( + void _objc_msgSend_16( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_27( + return __objc_msgSend_16( obj, sel, value, ); } - late final __objc_msgSend_27Ptr = _lookup< + late final __objc_msgSend_16Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer __classReadWriteProperty = @@ -818,26 +603,26 @@ class PropertyInterface extends NSObject { static ffi.Pointer? _sel_readOnlyProperty; int get readOnlyProperty { _sel_readOnlyProperty ??= _registerName(_lib, "readOnlyProperty"); - return _lib._objc_msgSend_26(_id, _sel_readOnlyProperty!); + return _lib._objc_msgSend_15(_id, _sel_readOnlyProperty!); } static ffi.Pointer? _sel_readWriteProperty; int get readWriteProperty { _sel_readWriteProperty ??= _registerName(_lib, "readWriteProperty"); - return _lib._objc_msgSend_26(_id, _sel_readWriteProperty!); + return _lib._objc_msgSend_15(_id, _sel_readWriteProperty!); } static ffi.Pointer? _sel_readWriteProperty1; set readWriteProperty(int value) { _sel_readWriteProperty1 ??= _registerName(_lib, "setReadWriteProperty:"); - _lib._objc_msgSend_27(_id, _sel_readWriteProperty1!, value); + _lib._objc_msgSend_16(_id, _sel_readWriteProperty1!, value); } static ffi.Pointer? _sel_classReadOnlyProperty; static int getClassReadOnlyProperty(PropertyTestObjCLibrary _lib) { _class ??= _getClass(_lib, "PropertyInterface"); _sel_classReadOnlyProperty ??= _registerName(_lib, "classReadOnlyProperty"); - return _lib._objc_msgSend_26(_class!, _sel_classReadOnlyProperty!); + return _lib._objc_msgSend_15(_class!, _sel_classReadOnlyProperty!); } static ffi.Pointer? _sel_classReadWriteProperty; @@ -845,7 +630,7 @@ class PropertyInterface extends NSObject { _class ??= _getClass(_lib, "PropertyInterface"); _sel_classReadWriteProperty ??= _registerName(_lib, "classReadWriteProperty"); - return _lib._objc_msgSend_26(_class!, _sel_classReadWriteProperty!); + return _lib._objc_msgSend_15(_class!, _sel_classReadWriteProperty!); } static ffi.Pointer? _sel_classReadWriteProperty1; @@ -854,7 +639,7 @@ class PropertyInterface extends NSObject { _class ??= _getClass(_lib, "PropertyInterface"); _sel_classReadWriteProperty1 ??= _registerName(_lib, "setClassReadWriteProperty:"); - _lib._objc_msgSend_27(_class!, _sel_classReadWriteProperty1!, value); + _lib._objc_msgSend_16(_class!, _sel_classReadWriteProperty1!, value); } static ffi.Pointer? _sel_new1; @@ -945,14 +730,14 @@ class NSObject extends _ObjCWrapper { static ffi.Pointer? _sel_copy; NSObject copy() { _sel_copy ??= _registerName(_lib, "copy"); - final _ret = _lib._objc_msgSend_3(_id, _sel_copy!); + final _ret = _lib._objc_msgSend_1(_id, _sel_copy!); return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_mutableCopy; NSObject mutableCopy() { _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); - final _ret = _lib._objc_msgSend_4(_id, _sel_mutableCopy!); + final _ret = _lib._objc_msgSend_1(_id, _sel_mutableCopy!); return NSObject._(_ret, _lib); } @@ -961,7 +746,7 @@ class NSObject extends _ObjCWrapper { PropertyTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { _class ??= _getClass(_lib, "NSObject"); _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); - final _ret = _lib._objc_msgSend_5(_class!, _sel_copyWithZone!, zone); + final _ret = _lib._objc_msgSend_2(_class!, _sel_copyWithZone!, zone); return NSObject._(_ret, _lib); } @@ -970,7 +755,7 @@ class NSObject extends _ObjCWrapper { PropertyTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { _class ??= _getClass(_lib, "NSObject"); _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); - final _ret = _lib._objc_msgSend_6(_class!, _sel_mutableCopyWithZone!, zone); + final _ret = _lib._objc_msgSend_2(_class!, _sel_mutableCopyWithZone!, zone); return NSObject._(_ret, _lib); } @@ -980,7 +765,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instancesRespondToSelector ??= _registerName(_lib, "instancesRespondToSelector:"); - return _lib._objc_msgSend_7( + return _lib._objc_msgSend_3( _class!, _sel_instancesRespondToSelector!, aSelector); } @@ -989,14 +774,14 @@ class NSObject extends _ObjCWrapper { PropertyTestObjCLibrary _lib, NSObject protocol) { _class ??= _getClass(_lib, "NSObject"); _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); - return _lib._objc_msgSend_8( + return _lib._objc_msgSend_4( _class!, _sel_conformsToProtocol!, protocol._id); } static ffi.Pointer? _sel_methodForSelector; IMP methodForSelector(ffi.Pointer aSelector) { _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); - return _lib._objc_msgSend_9(_id, _sel_methodForSelector!, aSelector); + return _lib._objc_msgSend_5(_id, _sel_methodForSelector!, aSelector); } static ffi.Pointer? _sel_instanceMethodForSelector; @@ -1005,7 +790,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instanceMethodForSelector ??= _registerName(_lib, "instanceMethodForSelector:"); - return _lib._objc_msgSend_10( + return _lib._objc_msgSend_5( _class!, _sel_instanceMethodForSelector!, aSelector); } @@ -1013,22 +798,22 @@ class NSObject extends _ObjCWrapper { void doesNotRecognizeSelector(ffi.Pointer aSelector) { _sel_doesNotRecognizeSelector ??= _registerName(_lib, "doesNotRecognizeSelector:"); - _lib._objc_msgSend_11(_id, _sel_doesNotRecognizeSelector!, aSelector); + _lib._objc_msgSend_6(_id, _sel_doesNotRecognizeSelector!, aSelector); } static ffi.Pointer? _sel_forwardingTargetForSelector; NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { _sel_forwardingTargetForSelector ??= _registerName(_lib, "forwardingTargetForSelector:"); - final _ret = _lib._objc_msgSend_12( - _id, _sel_forwardingTargetForSelector!, aSelector); + final _ret = + _lib._objc_msgSend_7(_id, _sel_forwardingTargetForSelector!, aSelector); return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_forwardInvocation; void forwardInvocation(NSObject anInvocation) { _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); - _lib._objc_msgSend_13(_id, _sel_forwardInvocation!, anInvocation._id); + _lib._objc_msgSend_8(_id, _sel_forwardInvocation!, anInvocation._id); } static ffi.Pointer? _sel_methodSignatureForSelector; @@ -1036,7 +821,7 @@ class NSObject extends _ObjCWrapper { _sel_methodSignatureForSelector ??= _registerName(_lib, "methodSignatureForSelector:"); final _ret = - _lib._objc_msgSend_14(_id, _sel_methodSignatureForSelector!, aSelector); + _lib._objc_msgSend_9(_id, _sel_methodSignatureForSelector!, aSelector); return NSMethodSignature._(_ret, _lib); } @@ -1046,7 +831,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instanceMethodSignatureForSelector ??= _registerName(_lib, "instanceMethodSignatureForSelector:"); - final _ret = _lib._objc_msgSend_15( + final _ret = _lib._objc_msgSend_9( _class!, _sel_instanceMethodSignatureForSelector!, aSelector); return NSMethodSignature._(_ret, _lib); } @@ -1054,20 +839,20 @@ class NSObject extends _ObjCWrapper { static ffi.Pointer? _sel_allowsWeakReference; bool allowsWeakReference() { _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); - return _lib._objc_msgSend_16(_id, _sel_allowsWeakReference!); + return _lib._objc_msgSend_10(_id, _sel_allowsWeakReference!); } static ffi.Pointer? _sel_retainWeakReference; bool retainWeakReference() { _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); - return _lib._objc_msgSend_16(_id, _sel_retainWeakReference!); + return _lib._objc_msgSend_10(_id, _sel_retainWeakReference!); } static ffi.Pointer? _sel_isSubclassOfClass; static bool isSubclassOfClass(PropertyTestObjCLibrary _lib, NSObject aClass) { _class ??= _getClass(_lib, "NSObject"); _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); - return _lib._objc_msgSend_17(_class!, _sel_isSubclassOfClass!, aClass._id); + return _lib._objc_msgSend_4(_class!, _sel_isSubclassOfClass!, aClass._id); } static ffi.Pointer? _sel_resolveClassMethod; @@ -1075,7 +860,7 @@ class NSObject extends _ObjCWrapper { PropertyTestObjCLibrary _lib, ffi.Pointer sel) { _class ??= _getClass(_lib, "NSObject"); _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); - return _lib._objc_msgSend_18(_class!, _sel_resolveClassMethod!, sel); + return _lib._objc_msgSend_3(_class!, _sel_resolveClassMethod!, sel); } static ffi.Pointer? _sel_resolveInstanceMethod; @@ -1084,21 +869,21 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_resolveInstanceMethod ??= _registerName(_lib, "resolveInstanceMethod:"); - return _lib._objc_msgSend_19(_class!, _sel_resolveInstanceMethod!, sel); + return _lib._objc_msgSend_3(_class!, _sel_resolveInstanceMethod!, sel); } static ffi.Pointer? _sel_hash; static int hash(PropertyTestObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_hash ??= _registerName(_lib, "hash"); - return _lib._objc_msgSend_20(_class!, _sel_hash!); + return _lib._objc_msgSend_11(_class!, _sel_hash!); } static ffi.Pointer? _sel_superclass; static NSObject superclass(PropertyTestObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_superclass ??= _registerName(_lib, "superclass"); - final _ret = _lib._objc_msgSend_21(_class!, _sel_superclass!); + final _ret = _lib._objc_msgSend_1(_class!, _sel_superclass!); return NSObject._(_ret, _lib); } @@ -1106,7 +891,7 @@ class NSObject extends _ObjCWrapper { static NSObject class1(PropertyTestObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_class1 ??= _registerName(_lib, "class"); - final _ret = _lib._objc_msgSend_22(_class!, _sel_class1!); + final _ret = _lib._objc_msgSend_1(_class!, _sel_class1!); return NSObject._(_ret, _lib); } @@ -1114,7 +899,7 @@ class NSObject extends _ObjCWrapper { static NSString description(PropertyTestObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_description ??= _registerName(_lib, "description"); - final _ret = _lib._objc_msgSend_25(_class!, _sel_description!); + final _ret = _lib._objc_msgSend_14(_class!, _sel_description!); return NSString._(_ret, _lib); } @@ -1122,7 +907,7 @@ class NSObject extends _ObjCWrapper { static NSString debugDescription(PropertyTestObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_debugDescription ??= _registerName(_lib, "debugDescription"); - final _ret = _lib._objc_msgSend_25(_class!, _sel_debugDescription!); + final _ret = _lib._objc_msgSend_14(_class!, _sel_debugDescription!); return NSString._(_ret, _lib); } } @@ -1176,7 +961,7 @@ class NSString extends _ObjCWrapper { _class ??= _getClass(_lib, "NSString"); _sel_stringWithCString_encoding ??= _registerName(_lib, "stringWithCString:encoding:"); - final _ret = _lib._objc_msgSend_23( + final _ret = _lib._objc_msgSend_12( _class!, _sel_stringWithCString_encoding!, cString, enc); return NSString._(_ret, _lib); } @@ -1184,7 +969,7 @@ class NSString extends _ObjCWrapper { static ffi.Pointer? _sel_UTF8String; ffi.Pointer UTF8String() { _sel_UTF8String ??= _registerName(_lib, "UTF8String"); - return _lib._objc_msgSend_24(_id, _sel_UTF8String!); + return _lib._objc_msgSend_13(_id, _sel_UTF8String!); } } diff --git a/pkgs/ffigen/test/native_objc_test/string_bindings.dart b/pkgs/ffigen/test/native_objc_test/string_bindings.dart index fc45deceed..870df1999b 100644 --- a/pkgs/ffigen/test/native_objc_test/string_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/string_bindings.dart @@ -191,125 +191,129 @@ class StringTestObjCLibrary { instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer<_NSZone>)>(); - ffi.Pointer _objc_msgSend_3( + bool _objc_msgSend_3( ffi.Pointer obj, ffi.Pointer sel, + ffi.Pointer aSelector, ) { return __objc_msgSend_3( - obj, - sel, - ); + obj, + sel, + aSelector, + ) != + 0; } late final __objc_msgSend_3Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_4( + bool _objc_msgSend_4( ffi.Pointer obj, ffi.Pointer sel, + ffi.Pointer protocol, ) { return __objc_msgSend_4( - obj, - sel, - ); + obj, + sel, + protocol, + ) != + 0; } late final __objc_msgSend_4Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_5( + IMP _objc_msgSend_5( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, + ffi.Pointer aSelector, ) { return __objc_msgSend_5( obj, sel, - zone, + aSelector, ); } late final __objc_msgSend_5Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_6( + void _objc_msgSend_6( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, + ffi.Pointer aSelector, ) { return __objc_msgSend_6( obj, sel, - zone, + aSelector, ); } late final __objc_msgSend_6Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - bool _objc_msgSend_7( + ffi.Pointer _objc_msgSend_7( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ) { return __objc_msgSend_7( - obj, - sel, - aSelector, - ) != - 0; + obj, + sel, + aSelector, + ); } late final __objc_msgSend_7Ptr = _lookup< ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_8( + void _objc_msgSend_8( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer protocol, + ffi.Pointer anInvocation, ) { return __objc_msgSend_8( - obj, - sel, - protocol, - ) != - 0; + obj, + sel, + anInvocation, + ); } late final __objc_msgSend_8Ptr = _lookup< ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, + void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - IMP _objc_msgSend_9( + ffi.Pointer _objc_msgSend_9( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, @@ -323,2470 +327,1452 @@ class StringTestObjCLibrary { late final __objc_msgSend_9Ptr = _lookup< ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); - IMP _objc_msgSend_10( + bool _objc_msgSend_10( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer aSelector, ) { return __objc_msgSend_10( - obj, - sel, - aSelector, - ); + obj, + sel, + ) != + 0; } late final __objc_msgSend_10Ptr = _lookup< ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + ffi.Uint8 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_11( + int _objc_msgSend_11( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer aSelector, ) { return __objc_msgSend_11( obj, sel, - aSelector, ); } late final __objc_msgSend_11Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + NSUInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_12( + int _objc_msgSend_12( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer aSelector, + int index, ) { return __objc_msgSend_12( obj, sel, - aSelector, + index, ); } late final __objc_msgSend_12Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + unichar Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); - void _objc_msgSend_13( + instancetype _objc_msgSend_13( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer anInvocation, + ffi.Pointer coder, ) { return __objc_msgSend_13( obj, sel, - anInvocation, + coder, ); } late final __objc_msgSend_13Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, + instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer _objc_msgSend_14( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer aSelector, + ffi.Pointer cString, + int enc, ) { return __objc_msgSend_14( obj, sel, - aSelector, + cString, + enc, ); } late final __objc_msgSend_14Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + pkg_ffi.UnsignedInt)>>('objc_msgSend'); late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer, int)>(); - ffi.Pointer _objc_msgSend_15( + ffi.Pointer _objc_msgSend_15( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer aSelector, ) { return __objc_msgSend_15( obj, sel, - aSelector, ); } late final __objc_msgSend_15Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_16( + ffi.Pointer _objc_msgSend_16( ffi.Pointer obj, ffi.Pointer sel, ) { return __objc_msgSend_16( - obj, - sel, - ) != - 0; + obj, + sel, + ); } late final __objc_msgSend_16Ptr = _lookup< ffi.NativeFunction< - ffi.Uint8 Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_17( + void _objc_msgSend_17( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer aClass, + ffi.Pointer value, + int size, ) { return __objc_msgSend_17( - obj, - sel, - aClass, - ) != - 0; + obj, + sel, + value, + size, + ); } late final __objc_msgSend_17Ptr = _lookup< ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); - bool _objc_msgSend_18( + instancetype _objc_msgSend_18( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer sel1, + ffi.Pointer value, + ffi.Pointer type, ) { return __objc_msgSend_18( - obj, - sel, - sel1, - ) != - 0; + obj, + sel, + value, + type, + ); } late final __objc_msgSend_18Ptr = _lookup< ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_19( + ffi.Pointer _objc_msgSend_19( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer sel1, + int value, ) { return __objc_msgSend_19( - obj, - sel, - sel1, - ) != - 0; + obj, + sel, + value, + ); } late final __objc_msgSend_19Ptr = _lookup< ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Char)>>('objc_msgSend'); late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); - int _objc_msgSend_20( + ffi.Pointer _objc_msgSend_20( ffi.Pointer obj, ffi.Pointer sel, + int value, ) { return __objc_msgSend_20( obj, sel, + value, ); } late final __objc_msgSend_20Ptr = _lookup< ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedChar)>>('objc_msgSend'); late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); ffi.Pointer _objc_msgSend_21( ffi.Pointer obj, ffi.Pointer sel, + int value, ) { return __objc_msgSend_21( obj, sel, + value, ); } late final __objc_msgSend_21Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Short)>>('objc_msgSend'); late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer, int)>(); ffi.Pointer _objc_msgSend_22( ffi.Pointer obj, ffi.Pointer sel, + int value, ) { return __objc_msgSend_22( obj, sel, + value, ); } late final __objc_msgSend_22Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedShort)>>('objc_msgSend'); late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer, int)>(); - int _objc_msgSend_23( + ffi.Pointer _objc_msgSend_23( ffi.Pointer obj, ffi.Pointer sel, - int index, + int value, ) { return __objc_msgSend_23( obj, sel, - index, + value, ); } late final __objc_msgSend_23Ptr = _lookup< ffi.NativeFunction< - unichar Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Int)>>('objc_msgSend'); late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); - instancetype _objc_msgSend_24( + ffi.Pointer _objc_msgSend_24( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer coder, + int value, ) { return __objc_msgSend_24( obj, sel, - coder, + value, ); } late final __objc_msgSend_24Ptr = _lookup< ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedInt)>>('objc_msgSend'); late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); ffi.Pointer _objc_msgSend_25( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer cString, - int enc, + int value, ) { return __objc_msgSend_25( obj, sel, - cString, - enc, + value, ); } late final __objc_msgSend_25Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - pkg_ffi.UnsignedInt)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Long)>>('objc_msgSend'); late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); - ffi.Pointer _objc_msgSend_26( + ffi.Pointer _objc_msgSend_26( ffi.Pointer obj, ffi.Pointer sel, + int value, ) { return __objc_msgSend_26( obj, sel, + value, ); } late final __objc_msgSend_26Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedLong)>>('objc_msgSend'); late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); ffi.Pointer _objc_msgSend_27( ffi.Pointer obj, ffi.Pointer sel, + int value, ) { return __objc_msgSend_27( obj, sel, + value, ); } late final __objc_msgSend_27Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.LongLong)>>('objc_msgSend'); late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer, int)>(); - void _objc_msgSend_28( + ffi.Pointer _objc_msgSend_28( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer value, - int size, + int value, ) { return __objc_msgSend_28( obj, sel, value, - size, ); } late final __objc_msgSend_28Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedLongLong)>>('objc_msgSend'); late final __objc_msgSend_28 = __objc_msgSend_28Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); - ffi.Pointer _objc_msgSend_29( + ffi.Pointer _objc_msgSend_29( ffi.Pointer obj, ffi.Pointer sel, + double value, ) { return __objc_msgSend_29( obj, sel, + value, ); } late final __objc_msgSend_29Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Float)>>('objc_msgSend'); late final __objc_msgSend_29 = __objc_msgSend_29Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); - instancetype _objc_msgSend_30( + ffi.Pointer _objc_msgSend_30( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer value, - ffi.Pointer type, + double value, ) { return __objc_msgSend_30( obj, sel, value, - type, ); } late final __objc_msgSend_30Ptr = _lookup< ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>('objc_msgSend'); late final __objc_msgSend_30 = __objc_msgSend_30Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); - instancetype _objc_msgSend_31( + ffi.Pointer _objc_msgSend_31( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer coder, + bool value, ) { return __objc_msgSend_31( obj, sel, - coder, + value ? 1 : 0, ); } late final __objc_msgSend_31Ptr = _lookup< ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); late final __objc_msgSend_31 = __objc_msgSend_31Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); - instancetype _objc_msgSend_32( + int _objc_msgSend_32( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer coder, ) { return __objc_msgSend_32( obj, sel, - coder, ); } late final __objc_msgSend_32Ptr = _lookup< ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + pkg_ffi.Char Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_32 = __objc_msgSend_32Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_33( + int _objc_msgSend_33( ffi.Pointer obj, ffi.Pointer sel, - int value, ) { return __objc_msgSend_33( obj, sel, - value, ); } late final __objc_msgSend_33Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Char)>>('objc_msgSend'); + pkg_ffi.UnsignedChar Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_33 = __objc_msgSend_33Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_34( + int _objc_msgSend_34( ffi.Pointer obj, ffi.Pointer sel, - int value, ) { return __objc_msgSend_34( obj, sel, - value, ); } late final __objc_msgSend_34Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedChar)>>('objc_msgSend'); + pkg_ffi.Short Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_34 = __objc_msgSend_34Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_35( + int _objc_msgSend_35( ffi.Pointer obj, ffi.Pointer sel, - int value, ) { return __objc_msgSend_35( obj, sel, - value, ); } late final __objc_msgSend_35Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Short)>>('objc_msgSend'); + pkg_ffi.UnsignedShort Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_35 = __objc_msgSend_35Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_36( + int _objc_msgSend_36( ffi.Pointer obj, ffi.Pointer sel, - int value, ) { return __objc_msgSend_36( obj, sel, - value, ); } late final __objc_msgSend_36Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedShort)>>('objc_msgSend'); + pkg_ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_36 = __objc_msgSend_36Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_37( + int _objc_msgSend_37( ffi.Pointer obj, ffi.Pointer sel, - int value, ) { return __objc_msgSend_37( obj, sel, - value, ); } late final __objc_msgSend_37Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Int)>>('objc_msgSend'); + pkg_ffi.UnsignedInt Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_37 = __objc_msgSend_37Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_38( + int _objc_msgSend_38( ffi.Pointer obj, ffi.Pointer sel, - int value, ) { return __objc_msgSend_38( obj, sel, - value, ); } late final __objc_msgSend_38Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedInt)>>('objc_msgSend'); + pkg_ffi.Long Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_38 = __objc_msgSend_38Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_39( + int _objc_msgSend_39( ffi.Pointer obj, ffi.Pointer sel, - int value, ) { return __objc_msgSend_39( obj, sel, - value, ); } late final __objc_msgSend_39Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Long)>>('objc_msgSend'); + pkg_ffi.LongLong Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_39 = __objc_msgSend_39Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_40( + int _objc_msgSend_40( ffi.Pointer obj, ffi.Pointer sel, - int value, ) { return __objc_msgSend_40( obj, sel, - value, ); } late final __objc_msgSend_40Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedLong)>>('objc_msgSend'); + pkg_ffi.UnsignedLongLong Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_40 = __objc_msgSend_40Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_41( + double _objc_msgSend_41( ffi.Pointer obj, ffi.Pointer sel, - int value, ) { return __objc_msgSend_41( obj, sel, - value, ); } late final __objc_msgSend_41Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.LongLong)>>('objc_msgSend'); + ffi.Float Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_41 = __objc_msgSend_41Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + double Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_42( + double _objc_msgSend_42( ffi.Pointer obj, ffi.Pointer sel, - int value, ) { return __objc_msgSend_42( obj, sel, - value, ); } late final __objc_msgSend_42Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedLongLong)>>('objc_msgSend'); + ffi.Double Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_42 = __objc_msgSend_42Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + double Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_43( + int _objc_msgSend_43( ffi.Pointer obj, ffi.Pointer sel, - double value, + ffi.Pointer otherNumber, ) { return __objc_msgSend_43( obj, sel, - value, + otherNumber, ); } late final __objc_msgSend_43Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Float)>>('objc_msgSend'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_43 = __objc_msgSend_43Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); ffi.Pointer _objc_msgSend_44( ffi.Pointer obj, ffi.Pointer sel, - double value, + ffi.Pointer locale, ) { return __objc_msgSend_44( obj, sel, - value, + locale, ); } late final __objc_msgSend_44Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Double)>>('objc_msgSend'); + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_44 = __objc_msgSend_44Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_45( + int _objc_msgSend_45( ffi.Pointer obj, ffi.Pointer sel, - bool value, ) { return __objc_msgSend_45( obj, sel, - value ? 1 : 0, ); } late final __objc_msgSend_45Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_45 = __objc_msgSend_45Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_46( + instancetype _objc_msgSend_46( ffi.Pointer obj, ffi.Pointer sel, - int value, + ffi.Pointer anObject, + int type, + int index, ) { return __objc_msgSend_46( obj, sel, - value, + anObject, + type, + index, ); } late final __objc_msgSend_46Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSInteger)>>('objc_msgSend'); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, NSUInteger)>>('objc_msgSend'); late final __objc_msgSend_46 = __objc_msgSend_46Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int)>(); - ffi.Pointer _objc_msgSend_47( + instancetype _objc_msgSend_47( ffi.Pointer obj, ffi.Pointer sel, - int value, - ) { + ffi.Pointer anObject, + int type, + int index, + int associatedIndex, + ) { return __objc_msgSend_47( obj, sel, - value, + anObject, + type, + index, + associatedIndex, ); } late final __objc_msgSend_47Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSUInteger, + NSUInteger)>>('objc_msgSend'); late final __objc_msgSend_47 = __objc_msgSend_47Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, int)>(); - int _objc_msgSend_48( + instancetype _objc_msgSend_48( ffi.Pointer obj, ffi.Pointer sel, + int value, ) { return __objc_msgSend_48( obj, sel, + value, ); } late final __objc_msgSend_48Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Char Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + instancetype Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); late final __objc_msgSend_48 = __objc_msgSend_48Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + instancetype Function( + ffi.Pointer, ffi.Pointer, int)>(); - int _objc_msgSend_49( + instancetype _objc_msgSend_49( ffi.Pointer obj, ffi.Pointer sel, + NSRange range, ) { return __objc_msgSend_49( obj, sel, + range, ); } late final __objc_msgSend_49Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedChar Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + instancetype Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); late final __objc_msgSend_49 = __objc_msgSend_49Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + instancetype Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); int _objc_msgSend_50( ffi.Pointer obj, ffi.Pointer sel, + int value, ) { return __objc_msgSend_50( obj, sel, + value, ); } late final __objc_msgSend_50Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Short Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + NSUInteger Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); late final __objc_msgSend_50 = __objc_msgSend_50Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); int _objc_msgSend_51( ffi.Pointer obj, ffi.Pointer sel, + ffi.Pointer indexBuffer, + int bufferSize, + NSRangePointer range, ) { return __objc_msgSend_51( obj, sel, + indexBuffer, + bufferSize, + range, ); } late final __objc_msgSend_51Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedShort Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSRangePointer)>>('objc_msgSend'); late final __objc_msgSend_51 = __objc_msgSend_51Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRangePointer)>(); int _objc_msgSend_52( ffi.Pointer obj, ffi.Pointer sel, + NSRange range, ) { return __objc_msgSend_52( obj, sel, + range, ); } late final __objc_msgSend_52Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + NSUInteger Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); late final __objc_msgSend_52 = __objc_msgSend_52Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); - int _objc_msgSend_53( + bool _objc_msgSend_53( ffi.Pointer obj, ffi.Pointer sel, + int value, ) { return __objc_msgSend_53( - obj, - sel, - ); + obj, + sel, + value, + ) != + 0; } late final __objc_msgSend_53Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedInt Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); late final __objc_msgSend_53 = __objc_msgSend_53Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); - int _objc_msgSend_54( + bool _objc_msgSend_54( ffi.Pointer obj, ffi.Pointer sel, + NSRange range, ) { return __objc_msgSend_54( - obj, - sel, - ); + obj, + sel, + range, + ) != + 0; } late final __objc_msgSend_54Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Long Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); - int _objc_msgSend_55( + void _objc_msgSend_55( ffi.Pointer obj, ffi.Pointer sel, + int opts, + ffi.Pointer block, ) { return __objc_msgSend_55( obj, sel, + opts, + block, ); } late final __objc_msgSend_55Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedLong Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_55 = __objc_msgSend_55Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); - int _objc_msgSend_56( + void _objc_msgSend_56( ffi.Pointer obj, ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer block, ) { return __objc_msgSend_56( obj, sel, + range, + opts, + block, ); } late final __objc_msgSend_56Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.LongLong Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_56 = __objc_msgSend_56Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer)>(); int _objc_msgSend_57( ffi.Pointer obj, ffi.Pointer sel, + ffi.Pointer predicate, ) { return __objc_msgSend_57( obj, sel, + predicate, ); } late final __objc_msgSend_57Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedLongLong Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_57 = __objc_msgSend_57Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - double _objc_msgSend_58( + int _objc_msgSend_58( ffi.Pointer obj, ffi.Pointer sel, + int opts, + ffi.Pointer predicate, ) { return __objc_msgSend_58( obj, sel, + opts, + predicate, ); } late final __objc_msgSend_58Ptr = _lookup< ffi.NativeFunction< - ffi.Float Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_58 = __objc_msgSend_58Ptr.asFunction< - double Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); - double _objc_msgSend_59( + int _objc_msgSend_59( ffi.Pointer obj, ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer predicate, ) { return __objc_msgSend_59( obj, sel, + range, + opts, + predicate, ); } late final __objc_msgSend_59Ptr = _lookup< ffi.NativeFunction< - ffi.Double Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + NSUInteger Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< - double Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer)>(); - int _objc_msgSend_60( + ffi.Pointer _objc_msgSend_60( ffi.Pointer obj, ffi.Pointer sel, + ffi.Pointer predicate, ) { return __objc_msgSend_60( obj, sel, + predicate, ); } late final __objc_msgSend_60Ptr = _lookup< ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer _objc_msgSend_61( ffi.Pointer obj, ffi.Pointer sel, + int opts, + ffi.Pointer predicate, ) { return __objc_msgSend_61( obj, sel, + opts, + predicate, ); } late final __objc_msgSend_61Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_61 = __objc_msgSend_61Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); - int _objc_msgSend_62( + ffi.Pointer _objc_msgSend_62( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer otherNumber, + NSRange range, + int opts, + ffi.Pointer predicate, ) { return __objc_msgSend_62( obj, sel, - otherNumber, + range, + opts, + predicate, ); } late final __objc_msgSend_62Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - bool _objc_msgSend_63( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer number, - ) { - return __objc_msgSend_63( - obj, - sel, - number, - ) != - 0; - } - - late final __objc_msgSend_63Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_63 = __objc_msgSend_63Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_64( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer locale, - ) { - return __objc_msgSend_64( - obj, - sel, - locale, - ); - } - - late final __objc_msgSend_64Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_64 = __objc_msgSend_64Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_65( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_65( - obj, - sel, - ); - } - - late final __objc_msgSend_65Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_65 = __objc_msgSend_65Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, NSRange, int, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_66( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_66( - obj, - sel, - ); - } - - late final __objc_msgSend_66Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_66 = __objc_msgSend_66Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - int _objc_msgSend_67( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_67( - obj, - sel, - ); - } - - late final __objc_msgSend_67Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_67 = __objc_msgSend_67Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_68( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_68( - obj, - sel, - ); - } - - late final __objc_msgSend_68Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_68 = __objc_msgSend_68Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - instancetype _objc_msgSend_69( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - int type, - int index, - ) { - return __objc_msgSend_69( - obj, - sel, - anObject, - type, - index, - ); - } - - late final __objc_msgSend_69Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_69 = __objc_msgSend_69Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int)>(); - - instancetype _objc_msgSend_70( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - int type, - int index, - int associatedIndex, - ) { - return __objc_msgSend_70( - obj, - sel, - anObject, - type, - index, - associatedIndex, - ); - } - - late final __objc_msgSend_70Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - NSUInteger, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_70 = __objc_msgSend_70Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, int)>(); - - instancetype _objc_msgSend_71( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_71( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_71Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_71 = __objc_msgSend_71Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, int)>(); - - instancetype _objc_msgSend_72( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_72( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_72Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_72 = __objc_msgSend_72Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, NSRange)>(); - - instancetype _objc_msgSend_73( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexSet, - ) { - return __objc_msgSend_73( - obj, - sel, - indexSet, - ); - } - - late final __objc_msgSend_73Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_73 = __objc_msgSend_73Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - bool _objc_msgSend_74( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexSet, - ) { - return __objc_msgSend_74( - obj, - sel, - indexSet, - ) != - 0; - } - - late final __objc_msgSend_74Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_74 = __objc_msgSend_74Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int _objc_msgSend_75( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_75( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_75Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_75 = __objc_msgSend_75Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - int _objc_msgSend_76( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexBuffer, - int bufferSize, - NSRangePointer range, - ) { - return __objc_msgSend_76( - obj, - sel, - indexBuffer, - bufferSize, - range, - ); - } - - late final __objc_msgSend_76Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSRangePointer)>>('objc_msgSend'); - late final __objc_msgSend_76 = __objc_msgSend_76Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, NSRangePointer)>(); - - int _objc_msgSend_77( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_77( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_77Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_77 = __objc_msgSend_77Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); - - bool _objc_msgSend_78( + void _objc_msgSend_63( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_78( - obj, - sel, - value, - ) != - 0; - } - - late final __objc_msgSend_78Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_78 = __objc_msgSend_78Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - bool _objc_msgSend_79( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_79( - obj, - sel, - range, - ) != - 0; - } - - late final __objc_msgSend_79Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_79 = __objc_msgSend_79Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); - - bool _objc_msgSend_80( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexSet, - ) { - return __objc_msgSend_80( - obj, - sel, - indexSet, - ) != - 0; - } - - late final __objc_msgSend_80Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_81( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer block, - ) { - return __objc_msgSend_81( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_81Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_81 = __objc_msgSend_81Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_82( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer block, - ) { - return __objc_msgSend_82( - obj, - sel, - opts, - block, - ); - } - - late final __objc_msgSend_82Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_82 = __objc_msgSend_82Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - void _objc_msgSend_83( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer block, - ) { - return __objc_msgSend_83( - obj, - sel, - range, - opts, - block, - ); - } - - late final __objc_msgSend_83Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_83 = __objc_msgSend_83Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer)>(); - - int _objc_msgSend_84( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer predicate, - ) { - return __objc_msgSend_84( - obj, - sel, - predicate, - ); - } - - late final __objc_msgSend_84Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_84 = __objc_msgSend_84Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int _objc_msgSend_85( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer predicate, - ) { - return __objc_msgSend_85( - obj, - sel, - opts, - predicate, - ); - } - - late final __objc_msgSend_85Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_85 = __objc_msgSend_85Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - int _objc_msgSend_86( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer predicate, - ) { - return __objc_msgSend_86( - obj, - sel, - range, - opts, - predicate, - ); - } - - late final __objc_msgSend_86Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_86 = __objc_msgSend_86Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_87( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer predicate, - ) { - return __objc_msgSend_87( - obj, - sel, - predicate, - ); - } - - late final __objc_msgSend_87Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_87 = __objc_msgSend_87Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_88( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer predicate, - ) { - return __objc_msgSend_88( - obj, - sel, - opts, - predicate, - ); - } - - late final __objc_msgSend_88Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_88 = __objc_msgSend_88Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_89( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer predicate, - ) { - return __objc_msgSend_89( - obj, - sel, - range, - opts, - predicate, - ); - } - - late final __objc_msgSend_89Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSRange, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_89 = __objc_msgSend_89Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSRange, int, ffi.Pointer)>(); - - void _objc_msgSend_90( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer block, - ) { - return __objc_msgSend_90( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_90Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_90 = __objc_msgSend_90Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_91( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer block, - ) { - return __objc_msgSend_91( - obj, - sel, - opts, - block, - ); - } - - late final __objc_msgSend_91Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_91 = __objc_msgSend_91Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - void _objc_msgSend_92( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer block, - ) { - return __objc_msgSend_92( - obj, - sel, - range, - opts, - block, - ); - } - - late final __objc_msgSend_92Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_92 = __objc_msgSend_92Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer)>(); - - void _objc_msgSend_93( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexSet, - ) { - return __objc_msgSend_93( - obj, - sel, - indexSet, - ); - } - - late final __objc_msgSend_93Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_93 = __objc_msgSend_93Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_94( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexSet, - ) { - return __objc_msgSend_94( - obj, - sel, - indexSet, - ); - } - - late final __objc_msgSend_94Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_94 = __objc_msgSend_94Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_95( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_95( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_95Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_95 = __objc_msgSend_95Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - void _objc_msgSend_96( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_96( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_96Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_96 = __objc_msgSend_96Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange)>(); - - void _objc_msgSend_97( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - int delta, - ) { - return __objc_msgSend_97( - obj, - sel, - index, - delta, - ); - } - - late final __objc_msgSend_97Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSUInteger, NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_97 = __objc_msgSend_97Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, int)>(); - - instancetype _objc_msgSend_98( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer changes, - ) { - return __objc_msgSend_98( - obj, - sel, - changes, - ); - } - - late final __objc_msgSend_98Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_98 = __objc_msgSend_98Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - instancetype _objc_msgSend_99( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer inserts, - ffi.Pointer insertedObjects, - ffi.Pointer removes, - ffi.Pointer removedObjects, - ffi.Pointer changes, - ) { - return __objc_msgSend_99( - obj, - sel, - inserts, - insertedObjects, - removes, - removedObjects, - changes, - ); - } - - late final __objc_msgSend_99Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_99 = __objc_msgSend_99Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - instancetype _objc_msgSend_100( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer inserts, - ffi.Pointer insertedObjects, - ffi.Pointer removes, - ffi.Pointer removedObjects, - ) { - return __objc_msgSend_100( - obj, - sel, - inserts, - insertedObjects, - removes, - removedObjects, - ); - } - - late final __objc_msgSend_100Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_100 = __objc_msgSend_100Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_101( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_101( - obj, - sel, - ); - } - - late final __objc_msgSend_101Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_101 = __objc_msgSend_101Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_102( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_102( - obj, - sel, - ); - } - - late final __objc_msgSend_102Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_102 = __objc_msgSend_102Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_103( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ) { - return __objc_msgSend_103( - obj, - sel, - index, - ); - } - - late final __objc_msgSend_103Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_103 = __objc_msgSend_103Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - instancetype _objc_msgSend_104( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> objects, - int cnt, - ) { - return __objc_msgSend_104( - obj, - sel, - objects, - cnt, - ); - } - - late final __objc_msgSend_104Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_104 = __objc_msgSend_104Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>, int)>(); - - instancetype _objc_msgSend_105( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_105( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_105Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_105 = __objc_msgSend_105Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_106( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - ) { - return __objc_msgSend_106( - obj, - sel, - anObject, - ); - } - - late final __objc_msgSend_106Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_106 = __objc_msgSend_106Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_107( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - int index, - ) { - return __objc_msgSend_107( - obj, - sel, - anObject, - index, - ); - } - - late final __objc_msgSend_107Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_107 = __objc_msgSend_107Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - void _objc_msgSend_108( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ffi.Pointer anObject, - ) { - return __objc_msgSend_108( - obj, - sel, - index, - anObject, - ); - } - - late final __objc_msgSend_108Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSUInteger, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_108 = __objc_msgSend_108Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - instancetype _objc_msgSend_109( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_109( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_109Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_109 = __objc_msgSend_109Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _objc_msgSend_110( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - int visibility, - ffi.Pointer loadHandler, - ) { - return __objc_msgSend_110( - obj, - sel, - typeIdentifier, - visibility, - loadHandler, - ); - } - - late final __objc_msgSend_110Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_110 = __objc_msgSend_110Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); - - void _objc_msgSend_111( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - int fileOptions, - int visibility, - ffi.Pointer loadHandler, - ) { - return __objc_msgSend_111( - obj, - sel, - typeIdentifier, - fileOptions, - visibility, - loadHandler, - ); - } - - late final __objc_msgSend_111Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_111 = __objc_msgSend_111Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_112( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_112( - obj, - sel, - ); - } - - late final __objc_msgSend_112Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_112 = __objc_msgSend_112Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - bool _objc_msgSend_113( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ) { - return __objc_msgSend_113( - obj, - sel, - typeIdentifier, - ) != - 0; + return __objc_msgSend_63( + obj, + sel, + value, + ); } - late final __objc_msgSend_113Ptr = _lookup< + late final __objc_msgSend_63Ptr = _lookup< ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_113 = __objc_msgSend_113Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_63 = __objc_msgSend_63Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); - bool _objc_msgSend_114( + void _objc_msgSend_64( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer typeIdentifier, - int fileOptions, + NSRange range, ) { - return __objc_msgSend_114( - obj, - sel, - typeIdentifier, - fileOptions, - ) != - 0; + return __objc_msgSend_64( + obj, + sel, + range, + ); } - late final __objc_msgSend_114Ptr = _lookup< + late final __objc_msgSend_64Ptr = _lookup< ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_114 = __objc_msgSend_114Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_64 = __objc_msgSend_64Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange)>(); - ffi.Pointer _objc_msgSend_115( + void _objc_msgSend_65( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer completionHandler, + int index, + int delta, ) { - return __objc_msgSend_115( + return __objc_msgSend_65( obj, sel, - typeIdentifier, - completionHandler, + index, + delta, ); } - late final __objc_msgSend_115Ptr = _lookup< + late final __objc_msgSend_65Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_115 = __objc_msgSend_115Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger, NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_65 = __objc_msgSend_65Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, int)>(); - ffi.Pointer _objc_msgSend_116( + instancetype _objc_msgSend_66( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer completionHandler, + ffi.Pointer inserts, + ffi.Pointer insertedObjects, + ffi.Pointer removes, + ffi.Pointer removedObjects, + ffi.Pointer changes, ) { - return __objc_msgSend_116( + return __objc_msgSend_66( obj, sel, - typeIdentifier, - completionHandler, + inserts, + insertedObjects, + removes, + removedObjects, + changes, ); } - late final __objc_msgSend_116Ptr = _lookup< + late final __objc_msgSend_66Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + instancetype Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_116 = __objc_msgSend_116Ptr.asFunction< - ffi.Pointer Function( + late final __objc_msgSend_66 = __objc_msgSend_66Ptr.asFunction< + instancetype Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_117( + instancetype _objc_msgSend_67( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer completionHandler, + ffi.Pointer inserts, + ffi.Pointer insertedObjects, + ffi.Pointer removes, + ffi.Pointer removedObjects, ) { - return __objc_msgSend_117( + return __objc_msgSend_67( obj, sel, - typeIdentifier, - completionHandler, + inserts, + insertedObjects, + removes, + removedObjects, ); } - late final __objc_msgSend_117Ptr = _lookup< + late final __objc_msgSend_67Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + instancetype Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_117 = __objc_msgSend_117Ptr.asFunction< - ffi.Pointer Function( + late final __objc_msgSend_67 = __objc_msgSend_67Ptr.asFunction< + instancetype Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_118( + instancetype _objc_msgSend_68( ffi.Pointer obj, ffi.Pointer sel, + ffi.Pointer> objects, + int cnt, ) { - return __objc_msgSend_118( + return __objc_msgSend_68( obj, sel, + objects, + cnt, ); } - late final __objc_msgSend_118Ptr = _lookup< + late final __objc_msgSend_68Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_118 = __objc_msgSend_118Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_68 = __objc_msgSend_68Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, int)>(); - void _objc_msgSend_119( + void _objc_msgSend_69( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer value, + ffi.Pointer anObject, + int index, ) { - return __objc_msgSend_119( + return __objc_msgSend_69( obj, sel, - value, + anObject, + index, ); } - late final __objc_msgSend_119Ptr = _lookup< + late final __objc_msgSend_69Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_119 = __objc_msgSend_119Ptr.asFunction< + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_69 = __objc_msgSend_69Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, int)>(); - instancetype _objc_msgSend_120( + void _objc_msgSend_70( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer object, + int index, + ffi.Pointer anObject, ) { - return __objc_msgSend_120( + return __objc_msgSend_70( obj, sel, - object, + index, + anObject, ); } - late final __objc_msgSend_120Ptr = _lookup< + late final __objc_msgSend_70Ptr = _lookup< ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_120 = __objc_msgSend_120Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_70 = __objc_msgSend_70Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); - void _objc_msgSend_121( + void _objc_msgSend_71( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer object, + ffi.Pointer typeIdentifier, int visibility, + ffi.Pointer loadHandler, ) { - return __objc_msgSend_121( + return __objc_msgSend_71( obj, sel, - object, + typeIdentifier, visibility, + loadHandler, ); } - late final __objc_msgSend_121Ptr = _lookup< + late final __objc_msgSend_71Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_121 = __objc_msgSend_121Ptr.asFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_71 = __objc_msgSend_71Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + ffi.Pointer, int, ffi.Pointer)>(); - void _objc_msgSend_122( + void _objc_msgSend_72( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer aClass, + ffi.Pointer typeIdentifier, + int fileOptions, int visibility, ffi.Pointer loadHandler, ) { - return __objc_msgSend_122( + return __objc_msgSend_72( obj, sel, - aClass, + typeIdentifier, + fileOptions, visibility, loadHandler, ); } - late final __objc_msgSend_122Ptr = _lookup< + late final __objc_msgSend_72Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Int32, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_122 = __objc_msgSend_122Ptr.asFunction< + late final __objc_msgSend_72 = __objc_msgSend_72Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); + ffi.Pointer, int, int, ffi.Pointer)>(); - bool _objc_msgSend_123( + bool _objc_msgSend_73( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer aClass, + ffi.Pointer typeIdentifier, + int fileOptions, ) { - return __objc_msgSend_123( + return __objc_msgSend_73( obj, sel, - aClass, + typeIdentifier, + fileOptions, ) != 0; } - late final __objc_msgSend_123Ptr = _lookup< + late final __objc_msgSend_73Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_123 = __objc_msgSend_123Ptr.asFunction< + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_73 = __objc_msgSend_73Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, int)>(); - ffi.Pointer _objc_msgSend_124( + ffi.Pointer _objc_msgSend_74( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer aClass, + ffi.Pointer typeIdentifier, ffi.Pointer completionHandler, ) { - return __objc_msgSend_124( + return __objc_msgSend_74( obj, sel, - aClass, + typeIdentifier, completionHandler, ); } - late final __objc_msgSend_124Ptr = _lookup< + late final __objc_msgSend_74Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_124 = __objc_msgSend_124Ptr.asFunction< + late final __objc_msgSend_74 = __objc_msgSend_74Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - instancetype _objc_msgSend_125( + void _objc_msgSend_75( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer item, - ffi.Pointer typeIdentifier, + ffi.Pointer object, + int visibility, ) { - return __objc_msgSend_125( + return __objc_msgSend_75( obj, sel, - item, - typeIdentifier, + object, + visibility, ); } - late final __objc_msgSend_125Ptr = _lookup< + late final __objc_msgSend_75Ptr = _lookup< ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_125 = __objc_msgSend_125Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_75 = __objc_msgSend_75Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); - instancetype _objc_msgSend_126( + instancetype _objc_msgSend_76( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer fileURL, + ffi.Pointer item, + ffi.Pointer typeIdentifier, ) { - return __objc_msgSend_126( + return __objc_msgSend_76( obj, sel, - fileURL, + item, + typeIdentifier, ); } - late final __objc_msgSend_126Ptr = _lookup< + late final __objc_msgSend_76Ptr = _lookup< ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_126 = __objc_msgSend_126Ptr.asFunction< + late final __objc_msgSend_76 = __objc_msgSend_76Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); - void _objc_msgSend_127( + void _objc_msgSend_77( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, NSItemProviderLoadHandler loadHandler, ) { - return __objc_msgSend_127( + return __objc_msgSend_77( obj, sel, typeIdentifier, @@ -2794,25 +1780,25 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_127Ptr = _lookup< + late final __objc_msgSend_77Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, NSItemProviderLoadHandler)>>('objc_msgSend'); - late final __objc_msgSend_127 = __objc_msgSend_127Ptr.asFunction< + late final __objc_msgSend_77 = __objc_msgSend_77Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSItemProviderLoadHandler)>(); - void _objc_msgSend_128( + void _objc_msgSend_78( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, ffi.Pointer options, NSItemProviderCompletionHandler completionHandler, ) { - return __objc_msgSend_128( + return __objc_msgSend_78( obj, sel, typeIdentifier, @@ -2821,7 +1807,7 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_128Ptr = _lookup< + late final __objc_msgSend_78Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -2829,7 +1815,7 @@ class StringTestObjCLibrary { ffi.Pointer, ffi.Pointer, NSItemProviderCompletionHandler)>>('objc_msgSend'); - late final __objc_msgSend_128 = __objc_msgSend_128Ptr.asFunction< + late final __objc_msgSend_78 = __objc_msgSend_78Ptr.asFunction< void Function( ffi.Pointer, ffi.Pointer, @@ -3117,13 +2103,13 @@ class StringTestObjCLibrary { NSStringEncodingDetectionOptionsKey value) => _NSStringEncodingDetectionLikelyLanguageKey.value = value; - void _objc_msgSend_129( + void _objc_msgSend_79( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ffi.Pointer aString, ) { - return __objc_msgSend_129( + return __objc_msgSend_79( obj, sel, range, @@ -3131,11 +2117,11 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_129Ptr = _lookup< + late final __objc_msgSend_79Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSRange, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_129 = __objc_msgSend_129Ptr.asFunction< + late final __objc_msgSend_79 = __objc_msgSend_79Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, NSRange, ffi.Pointer)>(); @@ -3156,13 +2142,13 @@ class StringTestObjCLibrary { set NSParseErrorException(NSExceptionName value) => _NSParseErrorException.value = value; - ffi.Pointer _objc_msgSend_130( + ffi.Pointer _objc_msgSend_80( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer a, ffi.Pointer b, ) { - return __objc_msgSend_130( + return __objc_msgSend_80( obj, sel, a, @@ -3170,14 +2156,14 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_130Ptr = _lookup< + late final __objc_msgSend_80Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_130 = __objc_msgSend_130Ptr.asFunction< + late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, @@ -3314,13 +2300,13 @@ class NSValue extends NSObject { static ffi.Pointer? _sel_getValue_size; void getValue_size(ffi.Pointer value, int size) { _sel_getValue_size ??= _registerName(_lib, "getValue:size:"); - _lib._objc_msgSend_28(_id, _sel_getValue_size!, value, size); + _lib._objc_msgSend_17(_id, _sel_getValue_size!, value, size); } static ffi.Pointer? _sel_objCType; ffi.Pointer get objCType { _sel_objCType ??= _registerName(_lib, "objCType"); - return _lib._objc_msgSend_29(_id, _sel_objCType!); + return _lib._objc_msgSend_15(_id, _sel_objCType!); } static ffi.Pointer? _sel_initWithBytes_objCType; @@ -3329,14 +2315,14 @@ class NSValue extends NSObject { _sel_initWithBytes_objCType ??= _registerName(_lib, "initWithBytes:objCType:"); final _ret = - _lib._objc_msgSend_30(_id, _sel_initWithBytes_objCType!, value, type); + _lib._objc_msgSend_18(_id, _sel_initWithBytes_objCType!, value, type); return NSValue._(_ret, _lib); } static ffi.Pointer? _sel_initWithCoder; NSValue initWithCoder(NSObject coder) { _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_31(_id, _sel_initWithCoder!, coder._id); + final _ret = _lib._objc_msgSend_13(_id, _sel_initWithCoder!, coder._id); return NSValue._(_ret, _lib); } @@ -3428,14 +2414,14 @@ class NSObject extends _ObjCWrapper { static ffi.Pointer? _sel_copy; NSObject copy() { _sel_copy ??= _registerName(_lib, "copy"); - final _ret = _lib._objc_msgSend_3(_id, _sel_copy!); + final _ret = _lib._objc_msgSend_1(_id, _sel_copy!); return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_mutableCopy; NSObject mutableCopy() { _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); - final _ret = _lib._objc_msgSend_4(_id, _sel_mutableCopy!); + final _ret = _lib._objc_msgSend_1(_id, _sel_mutableCopy!); return NSObject._(_ret, _lib); } @@ -3444,7 +2430,7 @@ class NSObject extends _ObjCWrapper { StringTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { _class ??= _getClass(_lib, "NSObject"); _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); - final _ret = _lib._objc_msgSend_5(_class!, _sel_copyWithZone!, zone); + final _ret = _lib._objc_msgSend_2(_class!, _sel_copyWithZone!, zone); return NSObject._(_ret, _lib); } @@ -3453,7 +2439,7 @@ class NSObject extends _ObjCWrapper { StringTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { _class ??= _getClass(_lib, "NSObject"); _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); - final _ret = _lib._objc_msgSend_6(_class!, _sel_mutableCopyWithZone!, zone); + final _ret = _lib._objc_msgSend_2(_class!, _sel_mutableCopyWithZone!, zone); return NSObject._(_ret, _lib); } @@ -3463,7 +2449,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instancesRespondToSelector ??= _registerName(_lib, "instancesRespondToSelector:"); - return _lib._objc_msgSend_7( + return _lib._objc_msgSend_3( _class!, _sel_instancesRespondToSelector!, aSelector); } @@ -3472,14 +2458,14 @@ class NSObject extends _ObjCWrapper { StringTestObjCLibrary _lib, NSObject protocol) { _class ??= _getClass(_lib, "NSObject"); _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); - return _lib._objc_msgSend_8( + return _lib._objc_msgSend_4( _class!, _sel_conformsToProtocol!, protocol._id); } static ffi.Pointer? _sel_methodForSelector; IMP methodForSelector(ffi.Pointer aSelector) { _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); - return _lib._objc_msgSend_9(_id, _sel_methodForSelector!, aSelector); + return _lib._objc_msgSend_5(_id, _sel_methodForSelector!, aSelector); } static ffi.Pointer? _sel_instanceMethodForSelector; @@ -3488,7 +2474,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instanceMethodForSelector ??= _registerName(_lib, "instanceMethodForSelector:"); - return _lib._objc_msgSend_10( + return _lib._objc_msgSend_5( _class!, _sel_instanceMethodForSelector!, aSelector); } @@ -3496,22 +2482,22 @@ class NSObject extends _ObjCWrapper { void doesNotRecognizeSelector(ffi.Pointer aSelector) { _sel_doesNotRecognizeSelector ??= _registerName(_lib, "doesNotRecognizeSelector:"); - _lib._objc_msgSend_11(_id, _sel_doesNotRecognizeSelector!, aSelector); + _lib._objc_msgSend_6(_id, _sel_doesNotRecognizeSelector!, aSelector); } static ffi.Pointer? _sel_forwardingTargetForSelector; NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { _sel_forwardingTargetForSelector ??= _registerName(_lib, "forwardingTargetForSelector:"); - final _ret = _lib._objc_msgSend_12( - _id, _sel_forwardingTargetForSelector!, aSelector); + final _ret = + _lib._objc_msgSend_7(_id, _sel_forwardingTargetForSelector!, aSelector); return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_forwardInvocation; void forwardInvocation(NSObject anInvocation) { _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); - _lib._objc_msgSend_13(_id, _sel_forwardInvocation!, anInvocation._id); + _lib._objc_msgSend_8(_id, _sel_forwardInvocation!, anInvocation._id); } static ffi.Pointer? _sel_methodSignatureForSelector; @@ -3519,7 +2505,7 @@ class NSObject extends _ObjCWrapper { _sel_methodSignatureForSelector ??= _registerName(_lib, "methodSignatureForSelector:"); final _ret = - _lib._objc_msgSend_14(_id, _sel_methodSignatureForSelector!, aSelector); + _lib._objc_msgSend_9(_id, _sel_methodSignatureForSelector!, aSelector); return NSMethodSignature._(_ret, _lib); } @@ -3529,7 +2515,7 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_instanceMethodSignatureForSelector ??= _registerName(_lib, "instanceMethodSignatureForSelector:"); - final _ret = _lib._objc_msgSend_15( + final _ret = _lib._objc_msgSend_9( _class!, _sel_instanceMethodSignatureForSelector!, aSelector); return NSMethodSignature._(_ret, _lib); } @@ -3537,20 +2523,20 @@ class NSObject extends _ObjCWrapper { static ffi.Pointer? _sel_allowsWeakReference; bool allowsWeakReference() { _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); - return _lib._objc_msgSend_16(_id, _sel_allowsWeakReference!); + return _lib._objc_msgSend_10(_id, _sel_allowsWeakReference!); } static ffi.Pointer? _sel_retainWeakReference; bool retainWeakReference() { _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); - return _lib._objc_msgSend_16(_id, _sel_retainWeakReference!); + return _lib._objc_msgSend_10(_id, _sel_retainWeakReference!); } static ffi.Pointer? _sel_isSubclassOfClass; static bool isSubclassOfClass(StringTestObjCLibrary _lib, NSObject aClass) { _class ??= _getClass(_lib, "NSObject"); _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); - return _lib._objc_msgSend_17(_class!, _sel_isSubclassOfClass!, aClass._id); + return _lib._objc_msgSend_4(_class!, _sel_isSubclassOfClass!, aClass._id); } static ffi.Pointer? _sel_resolveClassMethod; @@ -3558,7 +2544,7 @@ class NSObject extends _ObjCWrapper { StringTestObjCLibrary _lib, ffi.Pointer sel) { _class ??= _getClass(_lib, "NSObject"); _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); - return _lib._objc_msgSend_18(_class!, _sel_resolveClassMethod!, sel); + return _lib._objc_msgSend_3(_class!, _sel_resolveClassMethod!, sel); } static ffi.Pointer? _sel_resolveInstanceMethod; @@ -3567,21 +2553,21 @@ class NSObject extends _ObjCWrapper { _class ??= _getClass(_lib, "NSObject"); _sel_resolveInstanceMethod ??= _registerName(_lib, "resolveInstanceMethod:"); - return _lib._objc_msgSend_19(_class!, _sel_resolveInstanceMethod!, sel); + return _lib._objc_msgSend_3(_class!, _sel_resolveInstanceMethod!, sel); } static ffi.Pointer? _sel_hash; static int hash(StringTestObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_hash ??= _registerName(_lib, "hash"); - return _lib._objc_msgSend_20(_class!, _sel_hash!); + return _lib._objc_msgSend_11(_class!, _sel_hash!); } static ffi.Pointer? _sel_superclass; static NSObject superclass(StringTestObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_superclass ??= _registerName(_lib, "superclass"); - final _ret = _lib._objc_msgSend_21(_class!, _sel_superclass!); + final _ret = _lib._objc_msgSend_1(_class!, _sel_superclass!); return NSObject._(_ret, _lib); } @@ -3589,7 +2575,7 @@ class NSObject extends _ObjCWrapper { static NSObject class1(StringTestObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_class1 ??= _registerName(_lib, "class"); - final _ret = _lib._objc_msgSend_22(_class!, _sel_class1!); + final _ret = _lib._objc_msgSend_1(_class!, _sel_class1!); return NSObject._(_ret, _lib); } @@ -3597,7 +2583,7 @@ class NSObject extends _ObjCWrapper { static NSString description(StringTestObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_description ??= _registerName(_lib, "description"); - final _ret = _lib._objc_msgSend_27(_class!, _sel_description!); + final _ret = _lib._objc_msgSend_16(_class!, _sel_description!); return NSString._(_ret, _lib); } @@ -3605,7 +2591,7 @@ class NSObject extends _ObjCWrapper { static NSString debugDescription(StringTestObjCLibrary _lib) { _class ??= _getClass(_lib, "NSObject"); _sel_debugDescription ??= _registerName(_lib, "debugDescription"); - final _ret = _lib._objc_msgSend_27(_class!, _sel_debugDescription!); + final _ret = _lib._objc_msgSend_16(_class!, _sel_debugDescription!); return NSString._(_ret, _lib); } } @@ -3656,13 +2642,13 @@ class NSString extends NSObject { static ffi.Pointer? _sel_length; int get length { _sel_length ??= _registerName(_lib, "length"); - return _lib._objc_msgSend_20(_id, _sel_length!); + return _lib._objc_msgSend_11(_id, _sel_length!); } static ffi.Pointer? _sel_characterAtIndex; int characterAtIndex(int index) { _sel_characterAtIndex ??= _registerName(_lib, "characterAtIndex:"); - return _lib._objc_msgSend_23(_id, _sel_characterAtIndex!, index); + return _lib._objc_msgSend_12(_id, _sel_characterAtIndex!, index); } static ffi.Pointer? _sel_init; @@ -3676,7 +2662,7 @@ class NSString extends NSObject { static ffi.Pointer? _sel_initWithCoder; NSString initWithCoder(NSObject coder) { _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_24(_id, _sel_initWithCoder!, coder._id); + final _ret = _lib._objc_msgSend_13(_id, _sel_initWithCoder!, coder._id); return NSString._(_ret, _lib); } @@ -3686,7 +2672,7 @@ class NSString extends NSObject { _class ??= _getClass(_lib, "NSString"); _sel_stringWithCString_encoding ??= _registerName(_lib, "stringWithCString:encoding:"); - final _ret = _lib._objc_msgSend_25( + final _ret = _lib._objc_msgSend_14( _class!, _sel_stringWithCString_encoding!, cString, enc); return NSString._(_ret, _lib); } @@ -3694,7 +2680,7 @@ class NSString extends NSObject { static ffi.Pointer? _sel_UTF8String; ffi.Pointer UTF8String() { _sel_UTF8String ??= _registerName(_lib, "UTF8String"); - return _lib._objc_msgSend_26(_id, _sel_UTF8String!); + return _lib._objc_msgSend_15(_id, _sel_UTF8String!); } static ffi.Pointer? _sel_new1; @@ -3734,28 +2720,28 @@ class NSNumber extends NSValue { @override NSNumber initWithCoder(NSObject coder) { _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_32(_id, _sel_initWithCoder!, coder._id); + final _ret = _lib._objc_msgSend_13(_id, _sel_initWithCoder!, coder._id); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithChar; NSNumber initWithChar(int value) { _sel_initWithChar ??= _registerName(_lib, "initWithChar:"); - final _ret = _lib._objc_msgSend_33(_id, _sel_initWithChar!, value); + final _ret = _lib._objc_msgSend_19(_id, _sel_initWithChar!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithUnsignedChar; NSNumber initWithUnsignedChar(int value) { _sel_initWithUnsignedChar ??= _registerName(_lib, "initWithUnsignedChar:"); - final _ret = _lib._objc_msgSend_34(_id, _sel_initWithUnsignedChar!, value); + final _ret = _lib._objc_msgSend_20(_id, _sel_initWithUnsignedChar!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithShort; NSNumber initWithShort(int value) { _sel_initWithShort ??= _registerName(_lib, "initWithShort:"); - final _ret = _lib._objc_msgSend_35(_id, _sel_initWithShort!, value); + final _ret = _lib._objc_msgSend_21(_id, _sel_initWithShort!, value); return NSNumber._(_ret, _lib); } @@ -3763,42 +2749,42 @@ class NSNumber extends NSValue { NSNumber initWithUnsignedShort(int value) { _sel_initWithUnsignedShort ??= _registerName(_lib, "initWithUnsignedShort:"); - final _ret = _lib._objc_msgSend_36(_id, _sel_initWithUnsignedShort!, value); + final _ret = _lib._objc_msgSend_22(_id, _sel_initWithUnsignedShort!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithInt; NSNumber initWithInt(int value) { _sel_initWithInt ??= _registerName(_lib, "initWithInt:"); - final _ret = _lib._objc_msgSend_37(_id, _sel_initWithInt!, value); + final _ret = _lib._objc_msgSend_23(_id, _sel_initWithInt!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithUnsignedInt; NSNumber initWithUnsignedInt(int value) { _sel_initWithUnsignedInt ??= _registerName(_lib, "initWithUnsignedInt:"); - final _ret = _lib._objc_msgSend_38(_id, _sel_initWithUnsignedInt!, value); + final _ret = _lib._objc_msgSend_24(_id, _sel_initWithUnsignedInt!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithLong; NSNumber initWithLong(int value) { _sel_initWithLong ??= _registerName(_lib, "initWithLong:"); - final _ret = _lib._objc_msgSend_39(_id, _sel_initWithLong!, value); + final _ret = _lib._objc_msgSend_25(_id, _sel_initWithLong!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithUnsignedLong; NSNumber initWithUnsignedLong(int value) { _sel_initWithUnsignedLong ??= _registerName(_lib, "initWithUnsignedLong:"); - final _ret = _lib._objc_msgSend_40(_id, _sel_initWithUnsignedLong!, value); + final _ret = _lib._objc_msgSend_26(_id, _sel_initWithUnsignedLong!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithLongLong; NSNumber initWithLongLong(int value) { _sel_initWithLongLong ??= _registerName(_lib, "initWithLongLong:"); - final _ret = _lib._objc_msgSend_41(_id, _sel_initWithLongLong!, value); + final _ret = _lib._objc_msgSend_27(_id, _sel_initWithLongLong!, value); return NSNumber._(_ret, _lib); } @@ -3807,35 +2793,35 @@ class NSNumber extends NSValue { _sel_initWithUnsignedLongLong ??= _registerName(_lib, "initWithUnsignedLongLong:"); final _ret = - _lib._objc_msgSend_42(_id, _sel_initWithUnsignedLongLong!, value); + _lib._objc_msgSend_28(_id, _sel_initWithUnsignedLongLong!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithFloat; NSNumber initWithFloat(double value) { _sel_initWithFloat ??= _registerName(_lib, "initWithFloat:"); - final _ret = _lib._objc_msgSend_43(_id, _sel_initWithFloat!, value); + final _ret = _lib._objc_msgSend_29(_id, _sel_initWithFloat!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithDouble; NSNumber initWithDouble(double value) { _sel_initWithDouble ??= _registerName(_lib, "initWithDouble:"); - final _ret = _lib._objc_msgSend_44(_id, _sel_initWithDouble!, value); + final _ret = _lib._objc_msgSend_30(_id, _sel_initWithDouble!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithBool; NSNumber initWithBool(bool value) { _sel_initWithBool ??= _registerName(_lib, "initWithBool:"); - final _ret = _lib._objc_msgSend_45(_id, _sel_initWithBool!, value); + final _ret = _lib._objc_msgSend_31(_id, _sel_initWithBool!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_initWithInteger; NSNumber initWithInteger(int value) { _sel_initWithInteger ??= _registerName(_lib, "initWithInteger:"); - final _ret = _lib._objc_msgSend_46(_id, _sel_initWithInteger!, value); + final _ret = _lib._objc_msgSend_25(_id, _sel_initWithInteger!, value); return NSNumber._(_ret, _lib); } @@ -3844,117 +2830,117 @@ class NSNumber extends NSValue { _sel_initWithUnsignedInteger ??= _registerName(_lib, "initWithUnsignedInteger:"); final _ret = - _lib._objc_msgSend_47(_id, _sel_initWithUnsignedInteger!, value); + _lib._objc_msgSend_26(_id, _sel_initWithUnsignedInteger!, value); return NSNumber._(_ret, _lib); } static ffi.Pointer? _sel_charValue; int get charValue { _sel_charValue ??= _registerName(_lib, "charValue"); - return _lib._objc_msgSend_48(_id, _sel_charValue!); + return _lib._objc_msgSend_32(_id, _sel_charValue!); } static ffi.Pointer? _sel_unsignedCharValue; int get unsignedCharValue { _sel_unsignedCharValue ??= _registerName(_lib, "unsignedCharValue"); - return _lib._objc_msgSend_49(_id, _sel_unsignedCharValue!); + return _lib._objc_msgSend_33(_id, _sel_unsignedCharValue!); } static ffi.Pointer? _sel_shortValue; int get shortValue { _sel_shortValue ??= _registerName(_lib, "shortValue"); - return _lib._objc_msgSend_50(_id, _sel_shortValue!); + return _lib._objc_msgSend_34(_id, _sel_shortValue!); } static ffi.Pointer? _sel_unsignedShortValue; int get unsignedShortValue { _sel_unsignedShortValue ??= _registerName(_lib, "unsignedShortValue"); - return _lib._objc_msgSend_51(_id, _sel_unsignedShortValue!); + return _lib._objc_msgSend_35(_id, _sel_unsignedShortValue!); } static ffi.Pointer? _sel_intValue; int get intValue { _sel_intValue ??= _registerName(_lib, "intValue"); - return _lib._objc_msgSend_52(_id, _sel_intValue!); + return _lib._objc_msgSend_36(_id, _sel_intValue!); } static ffi.Pointer? _sel_unsignedIntValue; int get unsignedIntValue { _sel_unsignedIntValue ??= _registerName(_lib, "unsignedIntValue"); - return _lib._objc_msgSend_53(_id, _sel_unsignedIntValue!); + return _lib._objc_msgSend_37(_id, _sel_unsignedIntValue!); } static ffi.Pointer? _sel_longValue; int get longValue { _sel_longValue ??= _registerName(_lib, "longValue"); - return _lib._objc_msgSend_54(_id, _sel_longValue!); + return _lib._objc_msgSend_38(_id, _sel_longValue!); } static ffi.Pointer? _sel_unsignedLongValue; int get unsignedLongValue { _sel_unsignedLongValue ??= _registerName(_lib, "unsignedLongValue"); - return _lib._objc_msgSend_55(_id, _sel_unsignedLongValue!); + return _lib._objc_msgSend_11(_id, _sel_unsignedLongValue!); } static ffi.Pointer? _sel_longLongValue; int get longLongValue { _sel_longLongValue ??= _registerName(_lib, "longLongValue"); - return _lib._objc_msgSend_56(_id, _sel_longLongValue!); + return _lib._objc_msgSend_39(_id, _sel_longLongValue!); } static ffi.Pointer? _sel_unsignedLongLongValue; int get unsignedLongLongValue { _sel_unsignedLongLongValue ??= _registerName(_lib, "unsignedLongLongValue"); - return _lib._objc_msgSend_57(_id, _sel_unsignedLongLongValue!); + return _lib._objc_msgSend_40(_id, _sel_unsignedLongLongValue!); } static ffi.Pointer? _sel_floatValue; double get floatValue { _sel_floatValue ??= _registerName(_lib, "floatValue"); - return _lib._objc_msgSend_58(_id, _sel_floatValue!); + return _lib._objc_msgSend_41(_id, _sel_floatValue!); } static ffi.Pointer? _sel_doubleValue; double get doubleValue { _sel_doubleValue ??= _registerName(_lib, "doubleValue"); - return _lib._objc_msgSend_59(_id, _sel_doubleValue!); + return _lib._objc_msgSend_42(_id, _sel_doubleValue!); } static ffi.Pointer? _sel_boolValue; bool get boolValue { _sel_boolValue ??= _registerName(_lib, "boolValue"); - return _lib._objc_msgSend_16(_id, _sel_boolValue!); + return _lib._objc_msgSend_10(_id, _sel_boolValue!); } static ffi.Pointer? _sel_integerValue; int get integerValue { _sel_integerValue ??= _registerName(_lib, "integerValue"); - return _lib._objc_msgSend_60(_id, _sel_integerValue!); + return _lib._objc_msgSend_38(_id, _sel_integerValue!); } static ffi.Pointer? _sel_unsignedIntegerValue; int get unsignedIntegerValue { _sel_unsignedIntegerValue ??= _registerName(_lib, "unsignedIntegerValue"); - return _lib._objc_msgSend_20(_id, _sel_unsignedIntegerValue!); + return _lib._objc_msgSend_11(_id, _sel_unsignedIntegerValue!); } static ffi.Pointer? _sel_stringValue; NSObject get stringValue { _sel_stringValue ??= _registerName(_lib, "stringValue"); - final _ret = _lib._objc_msgSend_61(_id, _sel_stringValue!); + final _ret = _lib._objc_msgSend_1(_id, _sel_stringValue!); return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_compare; int compare(NSObject otherNumber) { _sel_compare ??= _registerName(_lib, "compare:"); - return _lib._objc_msgSend_62(_id, _sel_compare!, otherNumber._id); + return _lib._objc_msgSend_43(_id, _sel_compare!, otherNumber._id); } static ffi.Pointer? _sel_isEqualToNumber; bool isEqualToNumber(NSObject number) { _sel_isEqualToNumber ??= _registerName(_lib, "isEqualToNumber:"); - return _lib._objc_msgSend_63(_id, _sel_isEqualToNumber!, number._id); + return _lib._objc_msgSend_4(_id, _sel_isEqualToNumber!, number._id); } static ffi.Pointer? _sel_descriptionWithLocale; @@ -3962,7 +2948,7 @@ class NSNumber extends NSValue { _sel_descriptionWithLocale ??= _registerName(_lib, "descriptionWithLocale:"); final _ret = - _lib._objc_msgSend_64(_id, _sel_descriptionWithLocale!, locale._id); + _lib._objc_msgSend_44(_id, _sel_descriptionWithLocale!, locale._id); return NSString._(_ret, _lib); } @@ -4016,7 +3002,7 @@ class NSEnumerator extends NSObject { static ffi.Pointer? _sel_nextObject; NSObject nextObject() { _sel_nextObject ??= _registerName(_lib, "nextObject"); - final _ret = _lib._objc_msgSend_65(_id, _sel_nextObject!); + final _ret = _lib._objc_msgSend_1(_id, _sel_nextObject!); return NSObject._(_ret, _lib); } @@ -4056,33 +3042,33 @@ class NSOrderedCollectionChange extends NSObject { static ffi.Pointer? _sel_object; NSObject get object { _sel_object ??= _registerName(_lib, "object"); - final _ret = _lib._objc_msgSend_66(_id, _sel_object!); + final _ret = _lib._objc_msgSend_1(_id, _sel_object!); return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_changeType; int get changeType { _sel_changeType ??= _registerName(_lib, "changeType"); - return _lib._objc_msgSend_67(_id, _sel_changeType!); + return _lib._objc_msgSend_45(_id, _sel_changeType!); } static ffi.Pointer? _sel_index; int get index { _sel_index ??= _registerName(_lib, "index"); - return _lib._objc_msgSend_20(_id, _sel_index!); + return _lib._objc_msgSend_11(_id, _sel_index!); } static ffi.Pointer? _sel_associatedIndex; int get associatedIndex { _sel_associatedIndex ??= _registerName(_lib, "associatedIndex"); - return _lib._objc_msgSend_20(_id, _sel_associatedIndex!); + return _lib._objc_msgSend_11(_id, _sel_associatedIndex!); } static ffi.Pointer? _sel_init; @override NSObject init() { _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_68(_id, _sel_init!); + final _ret = _lib._objc_msgSend_1(_id, _sel_init!); return NSObject._(_ret, _lib); } @@ -4091,7 +3077,7 @@ class NSOrderedCollectionChange extends NSObject { NSObject anObject, int type, int index) { _sel_initWithObject_type_index ??= _registerName(_lib, "initWithObject:type:index:"); - final _ret = _lib._objc_msgSend_69( + final _ret = _lib._objc_msgSend_46( _id, _sel_initWithObject_type_index!, anObject._id, type, index); return NSOrderedCollectionChange._(_ret, _lib); } @@ -4101,7 +3087,7 @@ class NSOrderedCollectionChange extends NSObject { NSObject anObject, int type, int index, int associatedIndex) { _sel_initWithObject_type_index_associatedIndex ??= _registerName(_lib, "initWithObject:type:index:associatedIndex:"); - final _ret = _lib._objc_msgSend_70( + final _ret = _lib._objc_msgSend_47( _id, _sel_initWithObject_type_index_associatedIndex!, anObject._id, @@ -4150,7 +3136,7 @@ class NSIndexSet extends NSObject { static NSIndexSet indexSetWithIndex(StringTestObjCLibrary _lib, int value) { _class ??= _getClass(_lib, "NSIndexSet"); _sel_indexSetWithIndex ??= _registerName(_lib, "indexSetWithIndex:"); - final _ret = _lib._objc_msgSend_71(_class!, _sel_indexSetWithIndex!, value); + final _ret = _lib._objc_msgSend_48(_class!, _sel_indexSetWithIndex!, value); return NSIndexSet._(_ret, _lib); } @@ -4161,7 +3147,7 @@ class NSIndexSet extends NSObject { _sel_indexSetWithIndexesInRange ??= _registerName(_lib, "indexSetWithIndexesInRange:"); final _ret = - _lib._objc_msgSend_72(_class!, _sel_indexSetWithIndexesInRange!, range); + _lib._objc_msgSend_49(_class!, _sel_indexSetWithIndexesInRange!, range); return NSIndexSet._(_ret, _lib); } @@ -4170,7 +3156,7 @@ class NSIndexSet extends NSObject { _sel_initWithIndexesInRange ??= _registerName(_lib, "initWithIndexesInRange:"); final _ret = - _lib._objc_msgSend_72(_id, _sel_initWithIndexesInRange!, range); + _lib._objc_msgSend_49(_id, _sel_initWithIndexesInRange!, range); return NSIndexSet._(_ret, _lib); } @@ -4178,59 +3164,59 @@ class NSIndexSet extends NSObject { NSIndexSet initWithIndexSet(NSObject indexSet) { _sel_initWithIndexSet ??= _registerName(_lib, "initWithIndexSet:"); final _ret = - _lib._objc_msgSend_73(_id, _sel_initWithIndexSet!, indexSet._id); + _lib._objc_msgSend_13(_id, _sel_initWithIndexSet!, indexSet._id); return NSIndexSet._(_ret, _lib); } static ffi.Pointer? _sel_initWithIndex; NSIndexSet initWithIndex(int value) { _sel_initWithIndex ??= _registerName(_lib, "initWithIndex:"); - final _ret = _lib._objc_msgSend_71(_id, _sel_initWithIndex!, value); + final _ret = _lib._objc_msgSend_48(_id, _sel_initWithIndex!, value); return NSIndexSet._(_ret, _lib); } static ffi.Pointer? _sel_isEqualToIndexSet; bool isEqualToIndexSet(NSObject indexSet) { _sel_isEqualToIndexSet ??= _registerName(_lib, "isEqualToIndexSet:"); - return _lib._objc_msgSend_74(_id, _sel_isEqualToIndexSet!, indexSet._id); + return _lib._objc_msgSend_4(_id, _sel_isEqualToIndexSet!, indexSet._id); } static ffi.Pointer? _sel_count; int get count { _sel_count ??= _registerName(_lib, "count"); - return _lib._objc_msgSend_20(_id, _sel_count!); + return _lib._objc_msgSend_11(_id, _sel_count!); } static ffi.Pointer? _sel_firstIndex; int get firstIndex { _sel_firstIndex ??= _registerName(_lib, "firstIndex"); - return _lib._objc_msgSend_20(_id, _sel_firstIndex!); + return _lib._objc_msgSend_11(_id, _sel_firstIndex!); } static ffi.Pointer? _sel_lastIndex; int get lastIndex { _sel_lastIndex ??= _registerName(_lib, "lastIndex"); - return _lib._objc_msgSend_20(_id, _sel_lastIndex!); + return _lib._objc_msgSend_11(_id, _sel_lastIndex!); } static ffi.Pointer? _sel_indexGreaterThanIndex; int indexGreaterThanIndex(int value) { _sel_indexGreaterThanIndex ??= _registerName(_lib, "indexGreaterThanIndex:"); - return _lib._objc_msgSend_75(_id, _sel_indexGreaterThanIndex!, value); + return _lib._objc_msgSend_50(_id, _sel_indexGreaterThanIndex!, value); } static ffi.Pointer? _sel_indexLessThanIndex; int indexLessThanIndex(int value) { _sel_indexLessThanIndex ??= _registerName(_lib, "indexLessThanIndex:"); - return _lib._objc_msgSend_75(_id, _sel_indexLessThanIndex!, value); + return _lib._objc_msgSend_50(_id, _sel_indexLessThanIndex!, value); } static ffi.Pointer? _sel_indexGreaterThanOrEqualToIndex; int indexGreaterThanOrEqualToIndex(int value) { _sel_indexGreaterThanOrEqualToIndex ??= _registerName(_lib, "indexGreaterThanOrEqualToIndex:"); - return _lib._objc_msgSend_75( + return _lib._objc_msgSend_50( _id, _sel_indexGreaterThanOrEqualToIndex!, value); } @@ -4238,7 +3224,7 @@ class NSIndexSet extends NSObject { int indexLessThanOrEqualToIndex(int value) { _sel_indexLessThanOrEqualToIndex ??= _registerName(_lib, "indexLessThanOrEqualToIndex:"); - return _lib._objc_msgSend_75(_id, _sel_indexLessThanOrEqualToIndex!, value); + return _lib._objc_msgSend_50(_id, _sel_indexLessThanOrEqualToIndex!, value); } static ffi.Pointer? _sel_getIndexes_maxCount_inIndexRange; @@ -4246,7 +3232,7 @@ class NSIndexSet extends NSObject { int bufferSize, NSRangePointer range) { _sel_getIndexes_maxCount_inIndexRange ??= _registerName(_lib, "getIndexes:maxCount:inIndexRange:"); - return _lib._objc_msgSend_76(_id, _sel_getIndexes_maxCount_inIndexRange!, + return _lib._objc_msgSend_51(_id, _sel_getIndexes_maxCount_inIndexRange!, indexBuffer, bufferSize, range); } @@ -4254,47 +3240,47 @@ class NSIndexSet extends NSObject { int countOfIndexesInRange(NSRange range) { _sel_countOfIndexesInRange ??= _registerName(_lib, "countOfIndexesInRange:"); - return _lib._objc_msgSend_77(_id, _sel_countOfIndexesInRange!, range); + return _lib._objc_msgSend_52(_id, _sel_countOfIndexesInRange!, range); } static ffi.Pointer? _sel_containsIndex; bool containsIndex(int value) { _sel_containsIndex ??= _registerName(_lib, "containsIndex:"); - return _lib._objc_msgSend_78(_id, _sel_containsIndex!, value); + return _lib._objc_msgSend_53(_id, _sel_containsIndex!, value); } static ffi.Pointer? _sel_containsIndexesInRange; bool containsIndexesInRange(NSRange range) { _sel_containsIndexesInRange ??= _registerName(_lib, "containsIndexesInRange:"); - return _lib._objc_msgSend_79(_id, _sel_containsIndexesInRange!, range); + return _lib._objc_msgSend_54(_id, _sel_containsIndexesInRange!, range); } static ffi.Pointer? _sel_containsIndexes; bool containsIndexes(NSObject indexSet) { _sel_containsIndexes ??= _registerName(_lib, "containsIndexes:"); - return _lib._objc_msgSend_80(_id, _sel_containsIndexes!, indexSet._id); + return _lib._objc_msgSend_4(_id, _sel_containsIndexes!, indexSet._id); } static ffi.Pointer? _sel_intersectsIndexesInRange; bool intersectsIndexesInRange(NSRange range) { _sel_intersectsIndexesInRange ??= _registerName(_lib, "intersectsIndexesInRange:"); - return _lib._objc_msgSend_79(_id, _sel_intersectsIndexesInRange!, range); + return _lib._objc_msgSend_54(_id, _sel_intersectsIndexesInRange!, range); } static ffi.Pointer? _sel_enumerateIndexesUsingBlock; void enumerateIndexesUsingBlock(NSObject block) { _sel_enumerateIndexesUsingBlock ??= _registerName(_lib, "enumerateIndexesUsingBlock:"); - _lib._objc_msgSend_81(_id, _sel_enumerateIndexesUsingBlock!, block._id); + _lib._objc_msgSend_8(_id, _sel_enumerateIndexesUsingBlock!, block._id); } static ffi.Pointer? _sel_enumerateIndexesWithOptions_usingBlock; void enumerateIndexesWithOptions_usingBlock(int opts, NSObject block) { _sel_enumerateIndexesWithOptions_usingBlock ??= _registerName(_lib, "enumerateIndexesWithOptions:usingBlock:"); - _lib._objc_msgSend_82( + _lib._objc_msgSend_55( _id, _sel_enumerateIndexesWithOptions_usingBlock!, opts, block._id); } @@ -4303,21 +3289,21 @@ class NSIndexSet extends NSObject { NSRange range, int opts, NSObject block) { _sel_enumerateIndexesInRange_options_usingBlock ??= _registerName(_lib, "enumerateIndexesInRange:options:usingBlock:"); - _lib._objc_msgSend_83(_id, _sel_enumerateIndexesInRange_options_usingBlock!, + _lib._objc_msgSend_56(_id, _sel_enumerateIndexesInRange_options_usingBlock!, range, opts, block._id); } static ffi.Pointer? _sel_indexPassingTest; int indexPassingTest(NSObject predicate) { _sel_indexPassingTest ??= _registerName(_lib, "indexPassingTest:"); - return _lib._objc_msgSend_84(_id, _sel_indexPassingTest!, predicate._id); + return _lib._objc_msgSend_57(_id, _sel_indexPassingTest!, predicate._id); } static ffi.Pointer? _sel_indexWithOptions_passingTest; int indexWithOptions_passingTest(int opts, NSObject predicate) { _sel_indexWithOptions_passingTest ??= _registerName(_lib, "indexWithOptions:passingTest:"); - return _lib._objc_msgSend_85( + return _lib._objc_msgSend_58( _id, _sel_indexWithOptions_passingTest!, opts, predicate._id); } @@ -4326,7 +3312,7 @@ class NSIndexSet extends NSObject { NSRange range, int opts, NSObject predicate) { _sel_indexInRange_options_passingTest ??= _registerName(_lib, "indexInRange:options:passingTest:"); - return _lib._objc_msgSend_86(_id, _sel_indexInRange_options_passingTest!, + return _lib._objc_msgSend_59(_id, _sel_indexInRange_options_passingTest!, range, opts, predicate._id); } @@ -4334,7 +3320,7 @@ class NSIndexSet extends NSObject { NSIndexSet indexesPassingTest(NSObject predicate) { _sel_indexesPassingTest ??= _registerName(_lib, "indexesPassingTest:"); final _ret = - _lib._objc_msgSend_87(_id, _sel_indexesPassingTest!, predicate._id); + _lib._objc_msgSend_60(_id, _sel_indexesPassingTest!, predicate._id); return NSIndexSet._(_ret, _lib); } @@ -4342,7 +3328,7 @@ class NSIndexSet extends NSObject { NSIndexSet indexesWithOptions_passingTest(int opts, NSObject predicate) { _sel_indexesWithOptions_passingTest ??= _registerName(_lib, "indexesWithOptions:passingTest:"); - final _ret = _lib._objc_msgSend_88( + final _ret = _lib._objc_msgSend_61( _id, _sel_indexesWithOptions_passingTest!, opts, predicate._id); return NSIndexSet._(_ret, _lib); } @@ -4352,7 +3338,7 @@ class NSIndexSet extends NSObject { NSRange range, int opts, NSObject predicate) { _sel_indexesInRange_options_passingTest ??= _registerName(_lib, "indexesInRange:options:passingTest:"); - final _ret = _lib._objc_msgSend_89(_id, + final _ret = _lib._objc_msgSend_62(_id, _sel_indexesInRange_options_passingTest!, range, opts, predicate._id); return NSIndexSet._(_ret, _lib); } @@ -4361,14 +3347,14 @@ class NSIndexSet extends NSObject { void enumerateRangesUsingBlock(NSObject block) { _sel_enumerateRangesUsingBlock ??= _registerName(_lib, "enumerateRangesUsingBlock:"); - _lib._objc_msgSend_90(_id, _sel_enumerateRangesUsingBlock!, block._id); + _lib._objc_msgSend_8(_id, _sel_enumerateRangesUsingBlock!, block._id); } static ffi.Pointer? _sel_enumerateRangesWithOptions_usingBlock; void enumerateRangesWithOptions_usingBlock(int opts, NSObject block) { _sel_enumerateRangesWithOptions_usingBlock ??= _registerName(_lib, "enumerateRangesWithOptions:usingBlock:"); - _lib._objc_msgSend_91( + _lib._objc_msgSend_55( _id, _sel_enumerateRangesWithOptions_usingBlock!, opts, block._id); } @@ -4377,7 +3363,7 @@ class NSIndexSet extends NSObject { NSRange range, int opts, NSObject block) { _sel_enumerateRangesInRange_options_usingBlock ??= _registerName(_lib, "enumerateRangesInRange:options:usingBlock:"); - _lib._objc_msgSend_92(_id, _sel_enumerateRangesInRange_options_usingBlock!, + _lib._objc_msgSend_56(_id, _sel_enumerateRangesInRange_options_usingBlock!, range, opts, block._id); } @@ -4414,13 +3400,13 @@ class NSMutableIndexSet extends NSIndexSet { static ffi.Pointer? _sel_addIndexes; void addIndexes(NSObject indexSet) { _sel_addIndexes ??= _registerName(_lib, "addIndexes:"); - _lib._objc_msgSend_93(_id, _sel_addIndexes!, indexSet._id); + _lib._objc_msgSend_8(_id, _sel_addIndexes!, indexSet._id); } static ffi.Pointer? _sel_removeIndexes; void removeIndexes(NSObject indexSet) { _sel_removeIndexes ??= _registerName(_lib, "removeIndexes:"); - _lib._objc_msgSend_94(_id, _sel_removeIndexes!, indexSet._id); + _lib._objc_msgSend_8(_id, _sel_removeIndexes!, indexSet._id); } static ffi.Pointer? _sel_removeAllIndexes; @@ -4432,32 +3418,32 @@ class NSMutableIndexSet extends NSIndexSet { static ffi.Pointer? _sel_addIndex; void addIndex(int value) { _sel_addIndex ??= _registerName(_lib, "addIndex:"); - _lib._objc_msgSend_95(_id, _sel_addIndex!, value); + _lib._objc_msgSend_63(_id, _sel_addIndex!, value); } static ffi.Pointer? _sel_removeIndex; void removeIndex(int value) { _sel_removeIndex ??= _registerName(_lib, "removeIndex:"); - _lib._objc_msgSend_95(_id, _sel_removeIndex!, value); + _lib._objc_msgSend_63(_id, _sel_removeIndex!, value); } static ffi.Pointer? _sel_addIndexesInRange; void addIndexesInRange(NSRange range) { _sel_addIndexesInRange ??= _registerName(_lib, "addIndexesInRange:"); - _lib._objc_msgSend_96(_id, _sel_addIndexesInRange!, range); + _lib._objc_msgSend_64(_id, _sel_addIndexesInRange!, range); } static ffi.Pointer? _sel_removeIndexesInRange; void removeIndexesInRange(NSRange range) { _sel_removeIndexesInRange ??= _registerName(_lib, "removeIndexesInRange:"); - _lib._objc_msgSend_96(_id, _sel_removeIndexesInRange!, range); + _lib._objc_msgSend_64(_id, _sel_removeIndexesInRange!, range); } static ffi.Pointer? _sel_shiftIndexesStartingAtIndex_by; void shiftIndexesStartingAtIndex_by(int index, int delta) { _sel_shiftIndexesStartingAtIndex_by ??= _registerName(_lib, "shiftIndexesStartingAtIndex:by:"); - _lib._objc_msgSend_97( + _lib._objc_msgSend_65( _id, _sel_shiftIndexesStartingAtIndex_by!, index, delta); } @@ -4474,7 +3460,7 @@ class NSMutableIndexSet extends NSIndexSet { StringTestObjCLibrary _lib, int value) { _class ??= _getClass(_lib, "NSMutableIndexSet"); _sel_indexSetWithIndex ??= _registerName(_lib, "indexSetWithIndex:"); - final _ret = _lib._objc_msgSend_71(_class!, _sel_indexSetWithIndex!, value); + final _ret = _lib._objc_msgSend_48(_class!, _sel_indexSetWithIndex!, value); return NSMutableIndexSet._(_ret, _lib); } @@ -4485,7 +3471,7 @@ class NSMutableIndexSet extends NSIndexSet { _sel_indexSetWithIndexesInRange ??= _registerName(_lib, "indexSetWithIndexesInRange:"); final _ret = - _lib._objc_msgSend_72(_class!, _sel_indexSetWithIndexesInRange!, range); + _lib._objc_msgSend_49(_class!, _sel_indexSetWithIndexesInRange!, range); return NSMutableIndexSet._(_ret, _lib); } @@ -4529,7 +3515,7 @@ class NSOrderedCollectionDifference extends NSObject { static ffi.Pointer? _sel_initWithChanges; NSOrderedCollectionDifference initWithChanges(NSObject changes) { _sel_initWithChanges ??= _registerName(_lib, "initWithChanges:"); - final _ret = _lib._objc_msgSend_98(_id, _sel_initWithChanges!, changes._id); + final _ret = _lib._objc_msgSend_13(_id, _sel_initWithChanges!, changes._id); return NSOrderedCollectionDifference._(_ret, _lib); } @@ -4545,7 +3531,7 @@ class NSOrderedCollectionDifference extends NSObject { _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges ??= _registerName(_lib, "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:additionalChanges:"); - final _ret = _lib._objc_msgSend_99( + final _ret = _lib._objc_msgSend_66( _id, _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges!, inserts._id, @@ -4567,7 +3553,7 @@ class NSOrderedCollectionDifference extends NSObject { _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects ??= _registerName(_lib, "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:"); - final _ret = _lib._objc_msgSend_100( + final _ret = _lib._objc_msgSend_67( _id, _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects!, inserts._id, @@ -4580,21 +3566,21 @@ class NSOrderedCollectionDifference extends NSObject { static ffi.Pointer? _sel_insertions; NSObject get insertions { _sel_insertions ??= _registerName(_lib, "insertions"); - final _ret = _lib._objc_msgSend_101(_id, _sel_insertions!); + final _ret = _lib._objc_msgSend_1(_id, _sel_insertions!); return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_removals; NSObject get removals { _sel_removals ??= _registerName(_lib, "removals"); - final _ret = _lib._objc_msgSend_102(_id, _sel_removals!); + final _ret = _lib._objc_msgSend_1(_id, _sel_removals!); return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_hasChanges; bool get hasChanges { _sel_hasChanges ??= _registerName(_lib, "hasChanges"); - return _lib._objc_msgSend_16(_id, _sel_hasChanges!); + return _lib._objc_msgSend_10(_id, _sel_hasChanges!); } static ffi.Pointer? _sel_inverseDifference; @@ -4634,13 +3620,13 @@ class NSArray extends NSObject { static ffi.Pointer? _sel_count; int get count { _sel_count ??= _registerName(_lib, "count"); - return _lib._objc_msgSend_20(_id, _sel_count!); + return _lib._objc_msgSend_11(_id, _sel_count!); } static ffi.Pointer? _sel_objectAtIndex; NSObject objectAtIndex(int index) { _sel_objectAtIndex ??= _registerName(_lib, "objectAtIndex:"); - final _ret = _lib._objc_msgSend_103(_id, _sel_objectAtIndex!, index); + final _ret = _lib._objc_msgSend_48(_id, _sel_objectAtIndex!, index); return NSObject._(_ret, _lib); } @@ -4658,14 +3644,14 @@ class NSArray extends NSObject { _sel_initWithObjects_count ??= _registerName(_lib, "initWithObjects:count:"); final _ret = - _lib._objc_msgSend_104(_id, _sel_initWithObjects_count!, objects, cnt); + _lib._objc_msgSend_68(_id, _sel_initWithObjects_count!, objects, cnt); return NSArray._(_ret, _lib); } static ffi.Pointer? _sel_initWithCoder; NSArray initWithCoder(NSObject coder) { _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_105(_id, _sel_initWithCoder!, coder._id); + final _ret = _lib._objc_msgSend_13(_id, _sel_initWithCoder!, coder._id); return NSArray._(_ret, _lib); } @@ -4705,14 +3691,13 @@ class NSMutableArray extends NSArray { static ffi.Pointer? _sel_addObject; void addObject(NSObject anObject) { _sel_addObject ??= _registerName(_lib, "addObject:"); - _lib._objc_msgSend_106(_id, _sel_addObject!, anObject._id); + _lib._objc_msgSend_8(_id, _sel_addObject!, anObject._id); } static ffi.Pointer? _sel_insertObject_atIndex; void insertObject_atIndex(NSObject anObject, int index) { _sel_insertObject_atIndex ??= _registerName(_lib, "insertObject:atIndex:"); - _lib._objc_msgSend_107( - _id, _sel_insertObject_atIndex!, anObject._id, index); + _lib._objc_msgSend_69(_id, _sel_insertObject_atIndex!, anObject._id, index); } static ffi.Pointer? _sel_removeLastObject; @@ -4724,14 +3709,14 @@ class NSMutableArray extends NSArray { static ffi.Pointer? _sel_removeObjectAtIndex; void removeObjectAtIndex(int index) { _sel_removeObjectAtIndex ??= _registerName(_lib, "removeObjectAtIndex:"); - _lib._objc_msgSend_95(_id, _sel_removeObjectAtIndex!, index); + _lib._objc_msgSend_63(_id, _sel_removeObjectAtIndex!, index); } static ffi.Pointer? _sel_replaceObjectAtIndex_withObject; void replaceObjectAtIndex_withObject(int index, NSObject anObject) { _sel_replaceObjectAtIndex_withObject ??= _registerName(_lib, "replaceObjectAtIndex:withObject:"); - _lib._objc_msgSend_108( + _lib._objc_msgSend_70( _id, _sel_replaceObjectAtIndex_withObject!, index, anObject._id); } @@ -4746,7 +3731,7 @@ class NSMutableArray extends NSArray { static ffi.Pointer? _sel_initWithCapacity; NSMutableArray initWithCapacity(int numItems) { _sel_initWithCapacity ??= _registerName(_lib, "initWithCapacity:"); - final _ret = _lib._objc_msgSend_71(_id, _sel_initWithCapacity!, numItems); + final _ret = _lib._objc_msgSend_48(_id, _sel_initWithCapacity!, numItems); return NSMutableArray._(_ret, _lib); } @@ -4754,7 +3739,7 @@ class NSMutableArray extends NSArray { @override NSMutableArray initWithCoder(NSObject coder) { _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_109(_id, _sel_initWithCoder!, coder._id); + final _ret = _lib._objc_msgSend_13(_id, _sel_initWithCoder!, coder._id); return NSMutableArray._(_ret, _lib); } @@ -4811,7 +3796,7 @@ class NSItemProvider extends NSObject { _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler ??= _registerName(_lib, "registerDataRepresentationForTypeIdentifier:visibility:loadHandler:"); - _lib._objc_msgSend_110( + _lib._objc_msgSend_71( _id, _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler!, typeIdentifier._id, @@ -4830,7 +3815,7 @@ class NSItemProvider extends NSObject { _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler ??= _registerName(_lib, "registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:"); - _lib._objc_msgSend_111( + _lib._objc_msgSend_72( _id, _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler!, typeIdentifier._id, @@ -4843,7 +3828,7 @@ class NSItemProvider extends NSObject { NSObject get registeredTypeIdentifiers { _sel_registeredTypeIdentifiers ??= _registerName(_lib, "registeredTypeIdentifiers"); - final _ret = _lib._objc_msgSend_112(_id, _sel_registeredTypeIdentifiers!); + final _ret = _lib._objc_msgSend_1(_id, _sel_registeredTypeIdentifiers!); return NSObject._(_ret, _lib); } @@ -4851,7 +3836,7 @@ class NSItemProvider extends NSObject { bool hasItemConformingToTypeIdentifier(NSObject typeIdentifier) { _sel_hasItemConformingToTypeIdentifier ??= _registerName(_lib, "hasItemConformingToTypeIdentifier:"); - return _lib._objc_msgSend_113( + return _lib._objc_msgSend_4( _id, _sel_hasItemConformingToTypeIdentifier!, typeIdentifier._id); } @@ -4862,7 +3847,7 @@ class NSItemProvider extends NSObject { _sel_hasRepresentationConformingToTypeIdentifier_fileOptions ??= _registerName( _lib, "hasRepresentationConformingToTypeIdentifier:fileOptions:"); - return _lib._objc_msgSend_114( + return _lib._objc_msgSend_73( _id, _sel_hasRepresentationConformingToTypeIdentifier_fileOptions!, typeIdentifier._id, @@ -4876,7 +3861,7 @@ class NSItemProvider extends NSObject { _sel_loadDataRepresentationForTypeIdentifier_completionHandler ??= _registerName( _lib, "loadDataRepresentationForTypeIdentifier:completionHandler:"); - final _ret = _lib._objc_msgSend_115( + final _ret = _lib._objc_msgSend_74( _id, _sel_loadDataRepresentationForTypeIdentifier_completionHandler!, typeIdentifier._id, @@ -4891,7 +3876,7 @@ class NSItemProvider extends NSObject { _sel_loadFileRepresentationForTypeIdentifier_completionHandler ??= _registerName( _lib, "loadFileRepresentationForTypeIdentifier:completionHandler:"); - final _ret = _lib._objc_msgSend_116( + final _ret = _lib._objc_msgSend_74( _id, _sel_loadFileRepresentationForTypeIdentifier_completionHandler!, typeIdentifier._id, @@ -4906,7 +3891,7 @@ class NSItemProvider extends NSObject { _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler ??= _registerName(_lib, "loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:"); - final _ret = _lib._objc_msgSend_117( + final _ret = _lib._objc_msgSend_74( _id, _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler!, typeIdentifier._id, @@ -4917,20 +3902,20 @@ class NSItemProvider extends NSObject { static ffi.Pointer? _sel_suggestedName; NSObject get suggestedName { _sel_suggestedName ??= _registerName(_lib, "suggestedName"); - final _ret = _lib._objc_msgSend_118(_id, _sel_suggestedName!); + final _ret = _lib._objc_msgSend_1(_id, _sel_suggestedName!); return NSObject._(_ret, _lib); } static ffi.Pointer? _sel_suggestedName1; set suggestedName(NSObject value) { _sel_suggestedName1 ??= _registerName(_lib, "setSuggestedName:"); - _lib._objc_msgSend_119(_id, _sel_suggestedName1!, value._id); + _lib._objc_msgSend_8(_id, _sel_suggestedName1!, value._id); } static ffi.Pointer? _sel_initWithObject; NSItemProvider initWithObject(NSObject object) { _sel_initWithObject ??= _registerName(_lib, "initWithObject:"); - final _ret = _lib._objc_msgSend_120(_id, _sel_initWithObject!, object._id); + final _ret = _lib._objc_msgSend_13(_id, _sel_initWithObject!, object._id); return NSItemProvider._(_ret, _lib); } @@ -4938,7 +3923,7 @@ class NSItemProvider extends NSObject { void registerObject_visibility(NSObject object, int visibility) { _sel_registerObject_visibility ??= _registerName(_lib, "registerObject:visibility:"); - _lib._objc_msgSend_121( + _lib._objc_msgSend_75( _id, _sel_registerObject_visibility!, object._id, visibility); } @@ -4948,7 +3933,7 @@ class NSItemProvider extends NSObject { NSObject aClass, int visibility, NSObject loadHandler) { _sel_registerObjectOfClass_visibility_loadHandler ??= _registerName(_lib, "registerObjectOfClass:visibility:loadHandler:"); - _lib._objc_msgSend_122( + _lib._objc_msgSend_71( _id, _sel_registerObjectOfClass_visibility_loadHandler!, aClass._id, @@ -4959,7 +3944,7 @@ class NSItemProvider extends NSObject { static ffi.Pointer? _sel_canLoadObjectOfClass; bool canLoadObjectOfClass(NSObject aClass) { _sel_canLoadObjectOfClass ??= _registerName(_lib, "canLoadObjectOfClass:"); - return _lib._objc_msgSend_123(_id, _sel_canLoadObjectOfClass!, aClass._id); + return _lib._objc_msgSend_4(_id, _sel_canLoadObjectOfClass!, aClass._id); } static ffi.Pointer? _sel_loadObjectOfClass_completionHandler; @@ -4967,7 +3952,7 @@ class NSItemProvider extends NSObject { NSObject aClass, NSObject completionHandler) { _sel_loadObjectOfClass_completionHandler ??= _registerName(_lib, "loadObjectOfClass:completionHandler:"); - final _ret = _lib._objc_msgSend_124( + final _ret = _lib._objc_msgSend_74( _id, _sel_loadObjectOfClass_completionHandler!, aClass._id, @@ -4980,7 +3965,7 @@ class NSItemProvider extends NSObject { NSObject item, NSObject typeIdentifier) { _sel_initWithItem_typeIdentifier ??= _registerName(_lib, "initWithItem:typeIdentifier:"); - final _ret = _lib._objc_msgSend_125( + final _ret = _lib._objc_msgSend_76( _id, _sel_initWithItem_typeIdentifier!, item._id, typeIdentifier._id); return NSItemProvider._(_ret, _lib); } @@ -4990,7 +3975,7 @@ class NSItemProvider extends NSObject { _sel_initWithContentsOfURL ??= _registerName(_lib, "initWithContentsOfURL:"); final _ret = - _lib._objc_msgSend_126(_id, _sel_initWithContentsOfURL!, fileURL._id); + _lib._objc_msgSend_13(_id, _sel_initWithContentsOfURL!, fileURL._id); return NSItemProvider._(_ret, _lib); } @@ -4999,7 +3984,7 @@ class NSItemProvider extends NSObject { NSObject typeIdentifier, NSItemProviderLoadHandler loadHandler) { _sel_registerItemForTypeIdentifier_loadHandler ??= _registerName(_lib, "registerItemForTypeIdentifier:loadHandler:"); - _lib._objc_msgSend_127(_id, _sel_registerItemForTypeIdentifier_loadHandler!, + _lib._objc_msgSend_77(_id, _sel_registerItemForTypeIdentifier_loadHandler!, typeIdentifier._id, loadHandler); } @@ -5011,7 +3996,7 @@ class NSItemProvider extends NSObject { NSItemProviderCompletionHandler completionHandler) { _sel_loadItemForTypeIdentifier_options_completionHandler ??= _registerName( _lib, "loadItemForTypeIdentifier:options:completionHandler:"); - _lib._objc_msgSend_128( + _lib._objc_msgSend_78( _id, _sel_loadItemForTypeIdentifier_options_completionHandler!, typeIdentifier._id, @@ -5104,7 +4089,7 @@ class NSMutableString extends NSString { void replaceCharactersInRange_withString(NSRange range, NSObject aString) { _sel_replaceCharactersInRange_withString ??= _registerName(_lib, "replaceCharactersInRange:withString:"); - _lib._objc_msgSend_129( + _lib._objc_msgSend_79( _id, _sel_replaceCharactersInRange_withString!, range, aString._id); } @@ -5114,7 +4099,7 @@ class NSMutableString extends NSString { _class ??= _getClass(_lib, "NSMutableString"); _sel_stringWithCString_encoding ??= _registerName(_lib, "stringWithCString:encoding:"); - final _ret = _lib._objc_msgSend_25( + final _ret = _lib._objc_msgSend_14( _class!, _sel_stringWithCString_encoding!, cString, enc); return NSString._(_ret, _lib); } @@ -5154,7 +4139,7 @@ class NSSimpleCString extends NSString { _class ??= _getClass(_lib, "NSSimpleCString"); _sel_stringWithCString_encoding ??= _registerName(_lib, "stringWithCString:encoding:"); - final _ret = _lib._objc_msgSend_25( + final _ret = _lib._objc_msgSend_14( _class!, _sel_stringWithCString_encoding!, cString, enc); return NSString._(_ret, _lib); } @@ -5192,7 +4177,7 @@ class NSConstantString extends NSSimpleCString { _class ??= _getClass(_lib, "NSConstantString"); _sel_stringWithCString_encoding ??= _registerName(_lib, "stringWithCString:encoding:"); - final _ret = _lib._objc_msgSend_25( + final _ret = _lib._objc_msgSend_14( _class!, _sel_stringWithCString_encoding!, cString, enc); return NSString._(_ret, _lib); } @@ -5230,7 +4215,7 @@ class StringUtil extends NSObject { _class ??= _getClass(_lib, "StringUtil"); _sel_strConcat_with ??= _registerName(_lib, "strConcat:with:"); final _ret = - _lib._objc_msgSend_130(_class!, _sel_strConcat_with!, a._id, b._id); + _lib._objc_msgSend_80(_class!, _sel_strConcat_with!, a._id, b._id); return NSString._(_ret, _lib); } From 4da279f3076303fce5d65c697aa0bc9f420adecf Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Tue, 19 Apr 2022 10:32:44 -0700 Subject: [PATCH 125/276] [ffigen] Move ObjC classes and SELs to NativeLibrary (#331) * Improve Type deduping in objc_msgSend * WIP * Finish cleanup * Fix analysis --- .../objc_built_in_functions.dart | 112 +- .../src/code_generator/objc_interface.dart | 35 +- .../_expected_objc_config_bindings.dart | 296 ++-- .../_expected_objc_interface_bindings.dart | 358 ++-- .../native_objc_test/method_bindings.dart | 348 ++-- .../native_objc_test_bindings.dart | 356 ++-- .../native_objc_test/property_bindings.dart | 344 ++-- .../native_objc_test/string_bindings.dart | 1492 ++++++++--------- 8 files changed, 1521 insertions(+), 1820 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index 6074a711a7..95bce8ba12 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -4,6 +4,7 @@ import 'package:ffigen/src/code_generator.dart'; +import 'binding_string.dart'; import 'writer.dart'; /// Built in functions used by the Objective C bindings. @@ -15,7 +16,18 @@ class ObjCBuiltInFunctions { parameters: [Parameter(name: 'str', type: PointerType(charType))], isInternal: true, ); - late final String registerName; + late final registerName = ObjCInternalFunction( + '_registerName', _registerNameFunc, (Writer w, String name) { + final s = StringBuffer(); + final selType = _registerNameFunc.functionType.returnType.getCType(w); + s.write('\n$selType $name(String name) {\n'); + s.write(' final cstr = name.toNativeUtf8();\n'); + s.write(' final sel = ${_registerNameFunc.name}(cstr.cast());\n'); + s.write(' ${w.ffiPkgLibraryPrefix}.calloc.free(cstr);\n'); + s.write(' return sel;\n'); + s.write('}\n'); + return s.toString(); + }); late final _getClassFunc = Func( name: '_objc_getClass', @@ -24,7 +36,18 @@ class ObjCBuiltInFunctions { parameters: [Parameter(name: 'str', type: PointerType(charType))], isInternal: true, ); - late final String getClass; + late final getClass = + ObjCInternalFunction('_getClass', _getClassFunc, (Writer w, String name) { + final s = StringBuffer(); + final objType = _getClassFunc.functionType.returnType.getCType(w); + s.write('\n$objType $name(String name) {\n'); + s.write(' final cstr = name.toNativeUtf8();\n'); + s.write(' final clazz = ${_getClassFunc.name}(cstr.cast());\n'); + s.write(' ${w.ffiPkgLibraryPrefix}.calloc.free(cstr);\n'); + s.write(' return clazz;\n'); + s.write('}\n'); + return s.toString(); + }); // We need to load a separate instance of objc_msgSend for each signature. final _msgSendFuncs = {}; @@ -33,7 +56,7 @@ class ObjCBuiltInFunctions { for (final p in params) { key += ' ' + p.type.cacheKey(); } - _msgSendFuncs[key] ??= Func( + return _msgSendFuncs[key] ??= Func( name: '_objc_msgSend_${_msgSendFuncs.length}', originalName: 'objc_msgSend', returnType: returnType, @@ -44,7 +67,14 @@ class ObjCBuiltInFunctions { ], isInternal: true, ); - return _msgSendFuncs[key]!; + } + + final _selObjects = {}; + ObjCInternalGlobal getSelObject(String methodName) { + return _selObjects[methodName] ??= ObjCInternalGlobal( + PointerType(objCSelType), + '_sel_${methodName.replaceAll(":", "_")}', + () => '${registerName.name}("$methodName")'); } bool utilsExist = false; @@ -52,24 +82,7 @@ class ObjCBuiltInFunctions { if (utilsExist) return; utilsExist = true; - registerName = w.topLevelUniqueNamer.makeUnique('_registerName'); - final selType = _registerNameFunc.functionType.returnType.getCType(w); - s.write('\n$selType $registerName(${w.className} _lib, String name) {\n'); - s.write(' final cstr = name.toNativeUtf8();\n'); - s.write(' final sel = _lib.${_registerNameFunc.name}(cstr.cast());\n'); - s.write(' ${w.ffiPkgLibraryPrefix}.calloc.free(cstr);\n'); - s.write(' return sel;\n'); - s.write('}\n'); - - getClass = w.topLevelUniqueNamer.makeUnique('_getClass'); - final objType = _getClassFunc.functionType.returnType.getCType(w); - s.write('\n$objType $getClass(${w.className} _lib, String name) {\n'); - s.write(' final cstr = name.toNativeUtf8();\n'); - s.write(' final clazz = _lib.${_getClassFunc.name}(cstr.cast());\n'); - s.write(' ${w.ffiPkgLibraryPrefix}.calloc.free(cstr);\n'); - s.write(' return clazz;\n'); - s.write('}\n'); - + final objType = PointerType(objCObjectType).getCType(w); s.write('\nclass _ObjCWrapper {\n'); s.write(' final $objType _id;\n'); s.write(' final ${w.className} _lib;\n'); @@ -78,11 +91,14 @@ class ObjCBuiltInFunctions { } void addDependencies(Set dependencies) { - _registerNameFunc.addDependencies(dependencies); - _getClassFunc.addDependencies(dependencies); + registerName.addDependencies(dependencies); + getClass.addDependencies(dependencies); for (final func in _msgSendFuncs.values) { func.addDependencies(dependencies); } + for (final sel in _selObjects.values) { + sel.addDependencies(dependencies); + } } void generateNSStringUtils(Writer w, StringBuffer s) { @@ -109,3 +125,51 @@ class ObjCBuiltInFunctions { s.write('}\n\n'); } } + +/// Functions only used internally by ObjC bindings, such as getClass. +class ObjCInternalFunction extends LookUpBinding { + final Func _wrappedFunction; + final String Function(Writer, String) _toBindingString; + + ObjCInternalFunction( + String name, this._wrappedFunction, this._toBindingString) + : super(originalName: name, name: name, isInternal: true); + + @override + BindingString toBindingString(Writer w) { + name = w.wrapperLevelUniqueNamer.makeUnique(name); + return BindingString( + type: BindingStringType.func, string: _toBindingString(w, name)); + } + + @override + void addDependencies(Set dependencies) { + if (dependencies.contains(this)) return; + dependencies.add(this); + _wrappedFunction.addDependencies(dependencies); + } +} + +/// Globals only used internally by ObjC bindings, such as classes and SELs. +class ObjCInternalGlobal extends LookUpBinding { + final Type type; + final String Function() makeValue; + + ObjCInternalGlobal(this.type, String name, this.makeValue) + : super(originalName: name, name: name, isInternal: true); + + @override + BindingString toBindingString(Writer w) { + final s = StringBuffer(); + name = w.wrapperLevelUniqueNamer.makeUnique(name); + s.write('late final ${type.getCType(w)} $name = ${makeValue()};'); + return BindingString(type: BindingStringType.global, string: s.toString()); + } + + @override + void addDependencies(Set dependencies) { + if (dependencies.contains(this)) return; + dependencies.add(this); + type.addDependencies(dependencies); + } +} diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index ed9e1c3bcd..65536ffa28 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -43,6 +43,7 @@ class ObjCInterface extends BindingType { final classMethods = {}; final ObjCBuiltInFunctions builtInFunctions; + late final ObjCInternalGlobal _classObject; ObjCInterface({ String? usr, @@ -83,7 +84,6 @@ class ObjCInterface extends BindingType { builtInFunctions.ensureUtilsExist(w, s); final objType = PointerType(objCObjectType).getCType(w); - final selType = PointerType(objCSelType).getCType(w); // Class declaration. s.write('class $name '); @@ -91,10 +91,6 @@ class ObjCInterface extends BindingType { s.write('extends ${superType?.name ?? '_ObjCWrapper'} {\n'); s.write(' $name._($objType id, $natLib lib) : super._(id, lib);\n\n'); - // Class object, used to call static methods. - final classObject = uniqueNamer.makeUnique('_class'); - s.write(' static $objType? $classObject;\n\n'); - // Cast method. s.write(' static $name castFrom(T other) {\n'); s.write(' return $name._(other._id, other._lib);\n'); @@ -107,13 +103,9 @@ class ObjCInterface extends BindingType { // Methods. for (final m in methods) { final methodName = m._getDartMethodName(uniqueNamer); - final selName = uniqueNamer.makeUnique('_sel_$methodName'); final isStatic = m.isClass; final returnType = m.returnType!; - // SEL object for the method. - s.write(' static $selType? $selName;'); - // The method declaration. if (m.dartDoc != null) { s.write(makeDartDoc(m.dartDoc!)); @@ -168,12 +160,6 @@ class ObjCInterface extends BindingType { s.write(' {\n'); // Implementation. - if (isStatic) { - s.write(' $classObject ??= ' - '${builtInFunctions.getClass}(_lib, "$originalName");\n'); - } - s.write(' $selName ??= ' - '${builtInFunctions.registerName}(_lib, "${m.originalName}");\n'); final convertReturn = m.kind != ObjCMethodKind.propertySetter && _needsConverting(returnType); @@ -181,8 +167,8 @@ class ObjCInterface extends BindingType { s.write(' ${convertReturn ? 'final _ret = ' : 'return '}'); } s.write('_lib.${m.msgSend!.name}('); - s.write(isStatic ? '_class!' : '_id'); - s.write(', $selName!'); + s.write(isStatic ? '_lib.${_classObject.name}' : '_id'); + s.write(', _lib.${m.selObject!.name}'); for (final p in m.params) { s.write(', ${_doArgConversion(p.type, p.name)}'); } @@ -209,6 +195,13 @@ class ObjCInterface extends BindingType { void addDependencies(Set dependencies) { if (dependencies.contains(this)) return; dependencies.add(this); + builtInFunctions.addDependencies(dependencies); + + _classObject = ObjCInternalGlobal( + PointerType(objCObjectType), + '_class_$originalName', + () => '${builtInFunctions.getClass.name}("$originalName")') + ..addDependencies(dependencies); if (isNSString) { _addNSStringMethods(); @@ -224,8 +217,6 @@ class ObjCInterface extends BindingType { for (final m in methods) { m.addDependencies(dependencies, builtInFunctions); } - - builtInFunctions.addDependencies(dependencies); } void _filterPropertyMethods() { @@ -350,6 +341,7 @@ class ObjCMethod { final List params; final ObjCMethodKind kind; final bool isClass; + ObjCInternalGlobal? selObject; Func? msgSend; ObjCMethod({ @@ -373,7 +365,10 @@ class ObjCMethod { for (final p in params) { p.type.addDependencies(dependencies); } - msgSend = builtInFunctions.getMsgSendFunc(returnType!, params); + selObject ??= builtInFunctions.getSelObject(originalName) + ..addDependencies(dependencies); + msgSend ??= builtInFunctions.getMsgSendFunc(returnType!, params) + ..addDependencies(dependencies); } String _getDartMethodName(UniqueNamer uniqueNamer) { diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart index f837933de7..e647802020 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart @@ -20,6 +20,13 @@ class NativeLibrary { lookup) : _lookup = lookup; + ffi.Pointer _registerName1(String name) { + final cstr = name.toNativeUtf8(); + final sel = _sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; + } + ffi.Pointer _sel_registerName( ffi.Pointer str, ) { @@ -35,6 +42,13 @@ class NativeLibrary { late final __sel_registerName = __sel_registerNamePtr .asFunction Function(ffi.Pointer)>(); + ffi.Pointer _getClass1(String name) { + final cstr = name.toNativeUtf8(); + final clazz = _objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; + } + ffi.Pointer _objc_getClass( ffi.Pointer str, ) { @@ -50,6 +64,9 @@ class NativeLibrary { late final __objc_getClass = __objc_getClassPtr.asFunction< ffi.Pointer Function(ffi.Pointer)>(); + late final ffi.Pointer _class_Foo1 = _getClass1("Foo"); + late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); + late final ffi.Pointer _sel_load1 = _registerName1("load"); void _objc_msgSend_0( ffi.Pointer obj, ffi.Pointer sel, @@ -67,6 +84,9 @@ class NativeLibrary { late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_initialize1 = + _registerName1("initialize"); + late final ffi.Pointer _sel_init1 = _registerName1("init"); instancetype _objc_msgSend_1( ffi.Pointer obj, ffi.Pointer sel, @@ -84,6 +104,9 @@ class NativeLibrary { late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_new1 = _registerName1("new"); + late final ffi.Pointer _sel_allocWithZone_1 = + _registerName1("allocWithZone:"); instancetype _objc_msgSend_2( ffi.Pointer obj, ffi.Pointer sel, @@ -104,6 +127,18 @@ class NativeLibrary { instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer<_NSZone>)>(); + late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); + late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); + late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); + late final ffi.Pointer _sel_copy1 = _registerName1("copy"); + late final ffi.Pointer _sel_mutableCopy1 = + _registerName1("mutableCopy"); + late final ffi.Pointer _sel_copyWithZone_1 = + _registerName1("copyWithZone:"); + late final ffi.Pointer _sel_mutableCopyWithZone_1 = + _registerName1("mutableCopyWithZone:"); + late final ffi.Pointer _sel_instancesRespondToSelector_1 = + _registerName1("instancesRespondToSelector:"); bool _objc_msgSend_3( ffi.Pointer obj, ffi.Pointer sel, @@ -125,6 +160,8 @@ class NativeLibrary { int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_conformsToProtocol_1 = + _registerName1("conformsToProtocol:"); bool _objc_msgSend_4( ffi.Pointer obj, ffi.Pointer sel, @@ -146,6 +183,8 @@ class NativeLibrary { int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_methodForSelector_1 = + _registerName1("methodForSelector:"); IMP _objc_msgSend_5( ffi.Pointer obj, ffi.Pointer sel, @@ -166,6 +205,10 @@ class NativeLibrary { IMP Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_instanceMethodForSelector_1 = + _registerName1("instanceMethodForSelector:"); + late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = + _registerName1("doesNotRecognizeSelector:"); void _objc_msgSend_6( ffi.Pointer obj, ffi.Pointer sel, @@ -186,6 +229,8 @@ class NativeLibrary { void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_forwardingTargetForSelector_1 = + _registerName1("forwardingTargetForSelector:"); ffi.Pointer _objc_msgSend_7( ffi.Pointer obj, ffi.Pointer sel, @@ -206,6 +251,8 @@ class NativeLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_forwardInvocation_1 = + _registerName1("forwardInvocation:"); void _objc_msgSend_8( ffi.Pointer obj, ffi.Pointer sel, @@ -226,6 +273,10 @@ class NativeLibrary { void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _class_NSMethodSignature1 = + _getClass1("NSMethodSignature"); + late final ffi.Pointer _sel_methodSignatureForSelector_1 = + _registerName1("methodSignatureForSelector:"); ffi.Pointer _objc_msgSend_9( ffi.Pointer obj, ffi.Pointer sel, @@ -246,6 +297,10 @@ class NativeLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = + _registerName1("instanceMethodSignatureForSelector:"); + late final ffi.Pointer _sel_allowsWeakReference1 = + _registerName1("allowsWeakReference"); bool _objc_msgSend_10( ffi.Pointer obj, ffi.Pointer sel, @@ -264,6 +319,15 @@ class NativeLibrary { late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_retainWeakReference1 = + _registerName1("retainWeakReference"); + late final ffi.Pointer _sel_isSubclassOfClass_1 = + _registerName1("isSubclassOfClass:"); + late final ffi.Pointer _sel_resolveClassMethod_1 = + _registerName1("resolveClassMethod:"); + late final ffi.Pointer _sel_resolveInstanceMethod_1 = + _registerName1("resolveInstanceMethod:"); + late final ffi.Pointer _sel_hash1 = _registerName1("hash"); int _objc_msgSend_11( ffi.Pointer obj, ffi.Pointer sel, @@ -281,6 +345,12 @@ class NativeLibrary { late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_superclass1 = + _registerName1("superclass"); + late final ffi.Pointer _sel_class1 = _registerName1("class"); + late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); + late final ffi.Pointer _sel_stringWithCString_encoding_1 = + _registerName1("stringWithCString:encoding:"); ffi.Pointer _objc_msgSend_12( ffi.Pointer obj, ffi.Pointer sel, @@ -306,6 +376,8 @@ class NativeLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_UTF8String1 = + _registerName1("UTF8String"); ffi.Pointer _objc_msgSend_13( ffi.Pointer obj, ffi.Pointer sel, @@ -324,6 +396,8 @@ class NativeLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_description1 = + _registerName1("description"); ffi.Pointer _objc_msgSend_14( ffi.Pointer obj, ffi.Pointer sel, @@ -341,20 +415,9 @@ class NativeLibrary { late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); -} - -ffi.Pointer _registerName(NativeLibrary _lib, String name) { - final cstr = name.toNativeUtf8(); - final sel = _lib._sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; -} -ffi.Pointer _getClass(NativeLibrary _lib, String name) { - final cstr = name.toNativeUtf8(); - final clazz = _lib._objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return clazz; + late final ffi.Pointer _sel_debugDescription1 = + _registerName1("debugDescription"); } class _ObjCWrapper { @@ -366,293 +429,202 @@ class _ObjCWrapper { class Foo extends NSObject { Foo._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static Foo castFrom(T other) { return Foo._(other._id, other._lib); } - static ffi.Pointer? _sel_new1; static Foo new1(NativeLibrary _lib) { - _class ??= _getClass(_lib, "Foo"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_new1); return Foo._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static Foo alloc(NativeLibrary _lib) { - _class ??= _getClass(_lib, "Foo"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_alloc1); return Foo._(_ret, _lib); } } +class ObjCSel extends ffi.Opaque {} + +class ObjCObject extends ffi.Opaque {} + class NSObject extends _ObjCWrapper { NSObject._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSObject castFrom(T other) { return NSObject._(other._id, other._lib); } - static ffi.Pointer? _sel_load; static void load(NativeLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_load ??= _registerName(_lib, "load"); - _lib._objc_msgSend_0(_class!, _sel_load!); + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); } - static ffi.Pointer? _sel_initialize; static void initialize(NativeLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_initialize ??= _registerName(_lib, "initialize"); - _lib._objc_msgSend_0(_class!, _sel_initialize!); + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); } - static ffi.Pointer? _sel_init; NSObject init() { - _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_new1; static NSObject new1(NativeLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_allocWithZone; static NSObject allocWithZone(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_allocWithZone ??= _registerName(_lib, "allocWithZone:"); - final _ret = _lib._objc_msgSend_2(_class!, _sel_allocWithZone!, zone); + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static NSObject alloc(NativeLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_dealloc; void dealloc() { - _sel_dealloc ??= _registerName(_lib, "dealloc"); - _lib._objc_msgSend_0(_id, _sel_dealloc!); + _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); } - static ffi.Pointer? _sel_finalize; void finalize() { - _sel_finalize ??= _registerName(_lib, "finalize"); - _lib._objc_msgSend_0(_id, _sel_finalize!); + _lib._objc_msgSend_0(_id, _lib._sel_finalize1); } - static ffi.Pointer? _sel_copy; NSObject copy() { - _sel_copy ??= _registerName(_lib, "copy"); - final _ret = _lib._objc_msgSend_1(_id, _sel_copy!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_mutableCopy; NSObject mutableCopy() { - _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); - final _ret = _lib._objc_msgSend_1(_id, _sel_mutableCopy!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_copyWithZone; static NSObject copyWithZone(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); - final _ret = _lib._objc_msgSend_2(_class!, _sel_copyWithZone!, zone); + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_mutableCopyWithZone; static NSObject mutableCopyWithZone( NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); - final _ret = _lib._objc_msgSend_2(_class!, _sel_mutableCopyWithZone!, zone); + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_instancesRespondToSelector; static bool instancesRespondToSelector( NativeLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instancesRespondToSelector ??= - _registerName(_lib, "instancesRespondToSelector:"); - return _lib._objc_msgSend_3( - _class!, _sel_instancesRespondToSelector!, aSelector); + return _lib._objc_msgSend_3(_lib._class_NSObject1, + _lib._sel_instancesRespondToSelector_1, aSelector); } - static ffi.Pointer? _sel_conformsToProtocol; static bool conformsToProtocol(NativeLibrary _lib, NSObject protocol) { - _class ??= _getClass(_lib, "NSObject"); - _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); return _lib._objc_msgSend_4( - _class!, _sel_conformsToProtocol!, protocol._id); + _lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol._id); } - static ffi.Pointer? _sel_methodForSelector; IMP methodForSelector(ffi.Pointer aSelector) { - _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); - return _lib._objc_msgSend_5(_id, _sel_methodForSelector!, aSelector); + return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); } - static ffi.Pointer? _sel_instanceMethodForSelector; static IMP instanceMethodForSelector( NativeLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instanceMethodForSelector ??= - _registerName(_lib, "instanceMethodForSelector:"); - return _lib._objc_msgSend_5( - _class!, _sel_instanceMethodForSelector!, aSelector); + return _lib._objc_msgSend_5(_lib._class_NSObject1, + _lib._sel_instanceMethodForSelector_1, aSelector); } - static ffi.Pointer? _sel_doesNotRecognizeSelector; void doesNotRecognizeSelector(ffi.Pointer aSelector) { - _sel_doesNotRecognizeSelector ??= - _registerName(_lib, "doesNotRecognizeSelector:"); - _lib._objc_msgSend_6(_id, _sel_doesNotRecognizeSelector!, aSelector); + _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); } - static ffi.Pointer? _sel_forwardingTargetForSelector; NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { - _sel_forwardingTargetForSelector ??= - _registerName(_lib, "forwardingTargetForSelector:"); - final _ret = - _lib._objc_msgSend_7(_id, _sel_forwardingTargetForSelector!, aSelector); + final _ret = _lib._objc_msgSend_7( + _id, _lib._sel_forwardingTargetForSelector_1, aSelector); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_forwardInvocation; void forwardInvocation(NSObject anInvocation) { - _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); - _lib._objc_msgSend_8(_id, _sel_forwardInvocation!, anInvocation._id); + _lib._objc_msgSend_8(_id, _lib._sel_forwardInvocation_1, anInvocation._id); } - static ffi.Pointer? _sel_methodSignatureForSelector; NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { - _sel_methodSignatureForSelector ??= - _registerName(_lib, "methodSignatureForSelector:"); - final _ret = - _lib._objc_msgSend_9(_id, _sel_methodSignatureForSelector!, aSelector); + final _ret = _lib._objc_msgSend_9( + _id, _lib._sel_methodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static ffi.Pointer? _sel_instanceMethodSignatureForSelector; static NSMethodSignature instanceMethodSignatureForSelector( NativeLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instanceMethodSignatureForSelector ??= - _registerName(_lib, "instanceMethodSignatureForSelector:"); - final _ret = _lib._objc_msgSend_9( - _class!, _sel_instanceMethodSignatureForSelector!, aSelector); + final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, + _lib._sel_instanceMethodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static ffi.Pointer? _sel_allowsWeakReference; bool allowsWeakReference() { - _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); - return _lib._objc_msgSend_10(_id, _sel_allowsWeakReference!); + return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); } - static ffi.Pointer? _sel_retainWeakReference; bool retainWeakReference() { - _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); - return _lib._objc_msgSend_10(_id, _sel_retainWeakReference!); + return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); } - static ffi.Pointer? _sel_isSubclassOfClass; static bool isSubclassOfClass(NativeLibrary _lib, NSObject aClass) { - _class ??= _getClass(_lib, "NSObject"); - _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); - return _lib._objc_msgSend_4(_class!, _sel_isSubclassOfClass!, aClass._id); + return _lib._objc_msgSend_4( + _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); } - static ffi.Pointer? _sel_resolveClassMethod; static bool resolveClassMethod(NativeLibrary _lib, ffi.Pointer sel) { - _class ??= _getClass(_lib, "NSObject"); - _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); - return _lib._objc_msgSend_3(_class!, _sel_resolveClassMethod!, sel); + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); } - static ffi.Pointer? _sel_resolveInstanceMethod; static bool resolveInstanceMethod( NativeLibrary _lib, ffi.Pointer sel) { - _class ??= _getClass(_lib, "NSObject"); - _sel_resolveInstanceMethod ??= - _registerName(_lib, "resolveInstanceMethod:"); - return _lib._objc_msgSend_3(_class!, _sel_resolveInstanceMethod!, sel); + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); } - static ffi.Pointer? _sel_hash; static int hash(NativeLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_hash ??= _registerName(_lib, "hash"); - return _lib._objc_msgSend_11(_class!, _sel_hash!); + return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); } - static ffi.Pointer? _sel_superclass; static NSObject superclass(NativeLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_superclass ??= _registerName(_lib, "superclass"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_superclass!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_class1; static NSObject class1(NativeLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_class1 ??= _registerName(_lib, "class"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_class1!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_description; static NSString description(NativeLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_description ??= _registerName(_lib, "description"); - final _ret = _lib._objc_msgSend_14(_class!, _sel_description!); + final _ret = + _lib._objc_msgSend_14(_lib._class_NSObject1, _lib._sel_description1); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_debugDescription; static NSString debugDescription(NativeLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_debugDescription ??= _registerName(_lib, "debugDescription"); - final _ret = _lib._objc_msgSend_14(_class!, _sel_debugDescription!); + final _ret = _lib._objc_msgSend_14( + _lib._class_NSObject1, _lib._sel_debugDescription1); return NSString._(_ret, _lib); } } typedef instancetype = ffi.Pointer; -class ObjCObject extends ffi.Opaque {} - class _NSZone extends ffi.Opaque {} -class ObjCSel extends ffi.Opaque {} - typedef IMP = ffi.Pointer>; class NSMethodSignature extends _ObjCWrapper { NSMethodSignature._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSMethodSignature castFrom(T other) { return NSMethodSignature._(other._id, other._lib); } @@ -663,8 +635,6 @@ typedef NSUInteger = pkg_ffi.UnsignedLong; class NSString extends _ObjCWrapper { NSString._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSString castFrom(T other) { return NSString._(other._id, other._lib); } @@ -679,21 +649,15 @@ class NSString extends _ObjCWrapper { @override String toString() => UTF8String().cast().toDartString(); - static ffi.Pointer? _sel_stringWithCString_encoding; static NSString stringWithCString_encoding( NativeLibrary _lib, ffi.Pointer cString, int enc) { - _class ??= _getClass(_lib, "NSString"); - _sel_stringWithCString_encoding ??= - _registerName(_lib, "stringWithCString:encoding:"); - final _ret = _lib._objc_msgSend_12( - _class!, _sel_stringWithCString_encoding!, cString, enc); + final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_UTF8String; ffi.Pointer UTF8String() { - _sel_UTF8String ??= _registerName(_lib, "UTF8String"); - return _lib._objc_msgSend_13(_id, _sel_UTF8String!); + return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); } } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart index e85cef0378..551e558f65 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart @@ -20,6 +20,13 @@ class NativeLibrary { lookup) : _lookup = lookup; + ffi.Pointer _registerName1(String name) { + final cstr = name.toNativeUtf8(); + final sel = _sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; + } + ffi.Pointer _sel_registerName( ffi.Pointer str, ) { @@ -35,6 +42,13 @@ class NativeLibrary { late final __sel_registerName = __sel_registerNamePtr .asFunction Function(ffi.Pointer)>(); + ffi.Pointer _getClass1(String name) { + final cstr = name.toNativeUtf8(); + final clazz = _objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; + } + ffi.Pointer _objc_getClass( ffi.Pointer str, ) { @@ -50,6 +64,9 @@ class NativeLibrary { late final __objc_getClass = __objc_getClassPtr.asFunction< ffi.Pointer Function(ffi.Pointer)>(); + late final ffi.Pointer _class_Foo1 = _getClass1("Foo"); + late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); + late final ffi.Pointer _sel_load1 = _registerName1("load"); void _objc_msgSend_0( ffi.Pointer obj, ffi.Pointer sel, @@ -67,6 +84,9 @@ class NativeLibrary { late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_initialize1 = + _registerName1("initialize"); + late final ffi.Pointer _sel_init1 = _registerName1("init"); instancetype _objc_msgSend_1( ffi.Pointer obj, ffi.Pointer sel, @@ -84,6 +104,9 @@ class NativeLibrary { late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_new1 = _registerName1("new"); + late final ffi.Pointer _sel_allocWithZone_1 = + _registerName1("allocWithZone:"); instancetype _objc_msgSend_2( ffi.Pointer obj, ffi.Pointer sel, @@ -104,6 +127,18 @@ class NativeLibrary { instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer<_NSZone>)>(); + late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); + late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); + late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); + late final ffi.Pointer _sel_copy1 = _registerName1("copy"); + late final ffi.Pointer _sel_mutableCopy1 = + _registerName1("mutableCopy"); + late final ffi.Pointer _sel_copyWithZone_1 = + _registerName1("copyWithZone:"); + late final ffi.Pointer _sel_mutableCopyWithZone_1 = + _registerName1("mutableCopyWithZone:"); + late final ffi.Pointer _sel_instancesRespondToSelector_1 = + _registerName1("instancesRespondToSelector:"); bool _objc_msgSend_3( ffi.Pointer obj, ffi.Pointer sel, @@ -125,6 +160,8 @@ class NativeLibrary { int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_conformsToProtocol_1 = + _registerName1("conformsToProtocol:"); bool _objc_msgSend_4( ffi.Pointer obj, ffi.Pointer sel, @@ -146,6 +183,8 @@ class NativeLibrary { int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_methodForSelector_1 = + _registerName1("methodForSelector:"); IMP _objc_msgSend_5( ffi.Pointer obj, ffi.Pointer sel, @@ -166,6 +205,10 @@ class NativeLibrary { IMP Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_instanceMethodForSelector_1 = + _registerName1("instanceMethodForSelector:"); + late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = + _registerName1("doesNotRecognizeSelector:"); void _objc_msgSend_6( ffi.Pointer obj, ffi.Pointer sel, @@ -186,6 +229,8 @@ class NativeLibrary { void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_forwardingTargetForSelector_1 = + _registerName1("forwardingTargetForSelector:"); ffi.Pointer _objc_msgSend_7( ffi.Pointer obj, ffi.Pointer sel, @@ -206,6 +251,8 @@ class NativeLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_forwardInvocation_1 = + _registerName1("forwardInvocation:"); void _objc_msgSend_8( ffi.Pointer obj, ffi.Pointer sel, @@ -226,6 +273,10 @@ class NativeLibrary { void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _class_NSMethodSignature1 = + _getClass1("NSMethodSignature"); + late final ffi.Pointer _sel_methodSignatureForSelector_1 = + _registerName1("methodSignatureForSelector:"); ffi.Pointer _objc_msgSend_9( ffi.Pointer obj, ffi.Pointer sel, @@ -246,6 +297,10 @@ class NativeLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = + _registerName1("instanceMethodSignatureForSelector:"); + late final ffi.Pointer _sel_allowsWeakReference1 = + _registerName1("allowsWeakReference"); bool _objc_msgSend_10( ffi.Pointer obj, ffi.Pointer sel, @@ -264,6 +319,15 @@ class NativeLibrary { late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_retainWeakReference1 = + _registerName1("retainWeakReference"); + late final ffi.Pointer _sel_isSubclassOfClass_1 = + _registerName1("isSubclassOfClass:"); + late final ffi.Pointer _sel_resolveClassMethod_1 = + _registerName1("resolveClassMethod:"); + late final ffi.Pointer _sel_resolveInstanceMethod_1 = + _registerName1("resolveInstanceMethod:"); + late final ffi.Pointer _sel_hash1 = _registerName1("hash"); int _objc_msgSend_11( ffi.Pointer obj, ffi.Pointer sel, @@ -281,6 +345,12 @@ class NativeLibrary { late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_superclass1 = + _registerName1("superclass"); + late final ffi.Pointer _sel_class1 = _registerName1("class"); + late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); + late final ffi.Pointer _sel_stringWithCString_encoding_1 = + _registerName1("stringWithCString:encoding:"); ffi.Pointer _objc_msgSend_12( ffi.Pointer obj, ffi.Pointer sel, @@ -306,6 +376,8 @@ class NativeLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_UTF8String1 = + _registerName1("UTF8String"); ffi.Pointer _objc_msgSend_13( ffi.Pointer obj, ffi.Pointer sel, @@ -324,6 +396,8 @@ class NativeLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_description1 = + _registerName1("description"); ffi.Pointer _objc_msgSend_14( ffi.Pointer obj, ffi.Pointer sel, @@ -342,6 +416,10 @@ class NativeLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_debugDescription1 = + _registerName1("debugDescription"); + late final ffi.Pointer _sel_someProperty1 = + _registerName1("someProperty"); int _objc_msgSend_15( ffi.Pointer obj, ffi.Pointer sel, @@ -359,6 +437,8 @@ class NativeLibrary { late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_setSomeProperty_1 = + _registerName1("setSomeProperty:"); void _objc_msgSend_16( ffi.Pointer obj, ffi.Pointer sel, @@ -378,6 +458,16 @@ class NativeLibrary { late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_readOnlyProperty1 = + _registerName1("readOnlyProperty"); + late final ffi.Pointer _sel_classReadOnlyProperty1 = + _registerName1("classReadOnlyProperty"); + late final ffi.Pointer _sel_classReadWriteProperty1 = + _registerName1("classReadWriteProperty"); + late final ffi.Pointer _sel_setClassReadWriteProperty_1 = + _registerName1("setClassReadWriteProperty:"); + late final ffi.Pointer _sel_aClassMethod_1 = + _registerName1("aClassMethod:"); ffi.Pointer _objc_msgSend_17( ffi.Pointer obj, ffi.Pointer sel, @@ -398,6 +488,8 @@ class NativeLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer, double)>(); + late final ffi.Pointer _sel_anInstanceMethod_withOtherArg_1 = + _registerName1("anInstanceMethod:withOtherArg:"); int _objc_msgSend_18( ffi.Pointer obj, ffi.Pointer sel, @@ -424,20 +516,6 @@ class NativeLibrary { ffi.Pointer, ffi.Pointer)>(); } -ffi.Pointer _registerName(NativeLibrary _lib, String name) { - final cstr = name.toNativeUtf8(); - final sel = _lib._sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; -} - -ffi.Pointer _getClass(NativeLibrary _lib, String name) { - final cstr = name.toNativeUtf8(); - final clazz = _lib._objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return clazz; -} - class _ObjCWrapper { final ffi.Pointer _id; final NativeLibrary _lib; @@ -447,350 +525,240 @@ class _ObjCWrapper { class Foo extends NSObject { Foo._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static Foo castFrom(T other) { return Foo._(other._id, other._lib); } - static ffi.Pointer? _sel_someProperty; int get someProperty { - _sel_someProperty ??= _registerName(_lib, "someProperty"); - return _lib._objc_msgSend_15(_id, _sel_someProperty!); + return _lib._objc_msgSend_15(_id, _lib._sel_someProperty1); } - static ffi.Pointer? _sel_someProperty1; set someProperty(int value) { - _sel_someProperty1 ??= _registerName(_lib, "setSomeProperty:"); - _lib._objc_msgSend_16(_id, _sel_someProperty1!, value); + _lib._objc_msgSend_16(_id, _lib._sel_setSomeProperty_1, value); } - static ffi.Pointer? _sel_readOnlyProperty; int get readOnlyProperty { - _sel_readOnlyProperty ??= _registerName(_lib, "readOnlyProperty"); - return _lib._objc_msgSend_15(_id, _sel_readOnlyProperty!); + return _lib._objc_msgSend_15(_id, _lib._sel_readOnlyProperty1); } - static ffi.Pointer? _sel_classReadOnlyProperty; static int getClassReadOnlyProperty(NativeLibrary _lib) { - _class ??= _getClass(_lib, "Foo"); - _sel_classReadOnlyProperty ??= _registerName(_lib, "classReadOnlyProperty"); - return _lib._objc_msgSend_15(_class!, _sel_classReadOnlyProperty!); + return _lib._objc_msgSend_15( + _lib._class_Foo1, _lib._sel_classReadOnlyProperty1); } - static ffi.Pointer? _sel_classReadWriteProperty; static int getClassReadWriteProperty(NativeLibrary _lib) { - _class ??= _getClass(_lib, "Foo"); - _sel_classReadWriteProperty ??= - _registerName(_lib, "classReadWriteProperty"); - return _lib._objc_msgSend_15(_class!, _sel_classReadWriteProperty!); + return _lib._objc_msgSend_15( + _lib._class_Foo1, _lib._sel_classReadWriteProperty1); } - static ffi.Pointer? _sel_classReadWriteProperty1; static void setClassReadWriteProperty(NativeLibrary _lib, int value) { - _class ??= _getClass(_lib, "Foo"); - _sel_classReadWriteProperty1 ??= - _registerName(_lib, "setClassReadWriteProperty:"); - _lib._objc_msgSend_16(_class!, _sel_classReadWriteProperty1!, value); + _lib._objc_msgSend_16( + _lib._class_Foo1, _lib._sel_setClassReadWriteProperty_1, value); } - static ffi.Pointer? _sel_aClassMethod; static Foo aClassMethod(NativeLibrary _lib, double someArg) { - _class ??= _getClass(_lib, "Foo"); - _sel_aClassMethod ??= _registerName(_lib, "aClassMethod:"); - final _ret = _lib._objc_msgSend_17(_class!, _sel_aClassMethod!, someArg); + final _ret = _lib._objc_msgSend_17( + _lib._class_Foo1, _lib._sel_aClassMethod_1, someArg); return Foo._(_ret, _lib); } - static ffi.Pointer? _sel_anInstanceMethod_withOtherArg; int anInstanceMethod_withOtherArg(NSObject someArg, NSObject otherArg) { - _sel_anInstanceMethod_withOtherArg ??= - _registerName(_lib, "anInstanceMethod:withOtherArg:"); - return _lib._objc_msgSend_18( - _id, _sel_anInstanceMethod_withOtherArg!, someArg._id, otherArg._id); + return _lib._objc_msgSend_18(_id, _lib._sel_anInstanceMethod_withOtherArg_1, + someArg._id, otherArg._id); } - static ffi.Pointer? _sel_new1; static Foo new1(NativeLibrary _lib) { - _class ??= _getClass(_lib, "Foo"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_new1); return Foo._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static Foo alloc(NativeLibrary _lib) { - _class ??= _getClass(_lib, "Foo"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_alloc1); return Foo._(_ret, _lib); } } +class ObjCSel extends ffi.Opaque {} + +class ObjCObject extends ffi.Opaque {} + class NSObject extends _ObjCWrapper { NSObject._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSObject castFrom(T other) { return NSObject._(other._id, other._lib); } - static ffi.Pointer? _sel_load; static void load(NativeLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_load ??= _registerName(_lib, "load"); - _lib._objc_msgSend_0(_class!, _sel_load!); + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); } - static ffi.Pointer? _sel_initialize; static void initialize(NativeLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_initialize ??= _registerName(_lib, "initialize"); - _lib._objc_msgSend_0(_class!, _sel_initialize!); + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); } - static ffi.Pointer? _sel_init; NSObject init() { - _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_new1; static NSObject new1(NativeLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_allocWithZone; static NSObject allocWithZone(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_allocWithZone ??= _registerName(_lib, "allocWithZone:"); - final _ret = _lib._objc_msgSend_2(_class!, _sel_allocWithZone!, zone); + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static NSObject alloc(NativeLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_dealloc; void dealloc() { - _sel_dealloc ??= _registerName(_lib, "dealloc"); - _lib._objc_msgSend_0(_id, _sel_dealloc!); + _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); } - static ffi.Pointer? _sel_finalize; void finalize() { - _sel_finalize ??= _registerName(_lib, "finalize"); - _lib._objc_msgSend_0(_id, _sel_finalize!); + _lib._objc_msgSend_0(_id, _lib._sel_finalize1); } - static ffi.Pointer? _sel_copy; NSObject copy() { - _sel_copy ??= _registerName(_lib, "copy"); - final _ret = _lib._objc_msgSend_1(_id, _sel_copy!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_mutableCopy; NSObject mutableCopy() { - _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); - final _ret = _lib._objc_msgSend_1(_id, _sel_mutableCopy!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_copyWithZone; static NSObject copyWithZone(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); - final _ret = _lib._objc_msgSend_2(_class!, _sel_copyWithZone!, zone); + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_mutableCopyWithZone; static NSObject mutableCopyWithZone( NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); - final _ret = _lib._objc_msgSend_2(_class!, _sel_mutableCopyWithZone!, zone); + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_instancesRespondToSelector; static bool instancesRespondToSelector( NativeLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instancesRespondToSelector ??= - _registerName(_lib, "instancesRespondToSelector:"); - return _lib._objc_msgSend_3( - _class!, _sel_instancesRespondToSelector!, aSelector); + return _lib._objc_msgSend_3(_lib._class_NSObject1, + _lib._sel_instancesRespondToSelector_1, aSelector); } - static ffi.Pointer? _sel_conformsToProtocol; static bool conformsToProtocol(NativeLibrary _lib, NSObject protocol) { - _class ??= _getClass(_lib, "NSObject"); - _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); return _lib._objc_msgSend_4( - _class!, _sel_conformsToProtocol!, protocol._id); + _lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol._id); } - static ffi.Pointer? _sel_methodForSelector; IMP methodForSelector(ffi.Pointer aSelector) { - _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); - return _lib._objc_msgSend_5(_id, _sel_methodForSelector!, aSelector); + return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); } - static ffi.Pointer? _sel_instanceMethodForSelector; static IMP instanceMethodForSelector( NativeLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instanceMethodForSelector ??= - _registerName(_lib, "instanceMethodForSelector:"); - return _lib._objc_msgSend_5( - _class!, _sel_instanceMethodForSelector!, aSelector); + return _lib._objc_msgSend_5(_lib._class_NSObject1, + _lib._sel_instanceMethodForSelector_1, aSelector); } - static ffi.Pointer? _sel_doesNotRecognizeSelector; void doesNotRecognizeSelector(ffi.Pointer aSelector) { - _sel_doesNotRecognizeSelector ??= - _registerName(_lib, "doesNotRecognizeSelector:"); - _lib._objc_msgSend_6(_id, _sel_doesNotRecognizeSelector!, aSelector); + _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); } - static ffi.Pointer? _sel_forwardingTargetForSelector; NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { - _sel_forwardingTargetForSelector ??= - _registerName(_lib, "forwardingTargetForSelector:"); - final _ret = - _lib._objc_msgSend_7(_id, _sel_forwardingTargetForSelector!, aSelector); + final _ret = _lib._objc_msgSend_7( + _id, _lib._sel_forwardingTargetForSelector_1, aSelector); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_forwardInvocation; void forwardInvocation(NSObject anInvocation) { - _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); - _lib._objc_msgSend_8(_id, _sel_forwardInvocation!, anInvocation._id); + _lib._objc_msgSend_8(_id, _lib._sel_forwardInvocation_1, anInvocation._id); } - static ffi.Pointer? _sel_methodSignatureForSelector; NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { - _sel_methodSignatureForSelector ??= - _registerName(_lib, "methodSignatureForSelector:"); - final _ret = - _lib._objc_msgSend_9(_id, _sel_methodSignatureForSelector!, aSelector); + final _ret = _lib._objc_msgSend_9( + _id, _lib._sel_methodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static ffi.Pointer? _sel_instanceMethodSignatureForSelector; static NSMethodSignature instanceMethodSignatureForSelector( NativeLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instanceMethodSignatureForSelector ??= - _registerName(_lib, "instanceMethodSignatureForSelector:"); - final _ret = _lib._objc_msgSend_9( - _class!, _sel_instanceMethodSignatureForSelector!, aSelector); + final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, + _lib._sel_instanceMethodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static ffi.Pointer? _sel_allowsWeakReference; bool allowsWeakReference() { - _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); - return _lib._objc_msgSend_10(_id, _sel_allowsWeakReference!); + return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); } - static ffi.Pointer? _sel_retainWeakReference; bool retainWeakReference() { - _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); - return _lib._objc_msgSend_10(_id, _sel_retainWeakReference!); + return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); } - static ffi.Pointer? _sel_isSubclassOfClass; static bool isSubclassOfClass(NativeLibrary _lib, NSObject aClass) { - _class ??= _getClass(_lib, "NSObject"); - _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); - return _lib._objc_msgSend_4(_class!, _sel_isSubclassOfClass!, aClass._id); + return _lib._objc_msgSend_4( + _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); } - static ffi.Pointer? _sel_resolveClassMethod; static bool resolveClassMethod(NativeLibrary _lib, ffi.Pointer sel) { - _class ??= _getClass(_lib, "NSObject"); - _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); - return _lib._objc_msgSend_3(_class!, _sel_resolveClassMethod!, sel); + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); } - static ffi.Pointer? _sel_resolveInstanceMethod; static bool resolveInstanceMethod( NativeLibrary _lib, ffi.Pointer sel) { - _class ??= _getClass(_lib, "NSObject"); - _sel_resolveInstanceMethod ??= - _registerName(_lib, "resolveInstanceMethod:"); - return _lib._objc_msgSend_3(_class!, _sel_resolveInstanceMethod!, sel); + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); } - static ffi.Pointer? _sel_hash; static int hash(NativeLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_hash ??= _registerName(_lib, "hash"); - return _lib._objc_msgSend_11(_class!, _sel_hash!); + return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); } - static ffi.Pointer? _sel_superclass; static NSObject superclass(NativeLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_superclass ??= _registerName(_lib, "superclass"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_superclass!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_class1; static NSObject class1(NativeLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_class1 ??= _registerName(_lib, "class"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_class1!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_description; static NSString description(NativeLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_description ??= _registerName(_lib, "description"); - final _ret = _lib._objc_msgSend_14(_class!, _sel_description!); + final _ret = + _lib._objc_msgSend_14(_lib._class_NSObject1, _lib._sel_description1); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_debugDescription; static NSString debugDescription(NativeLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_debugDescription ??= _registerName(_lib, "debugDescription"); - final _ret = _lib._objc_msgSend_14(_class!, _sel_debugDescription!); + final _ret = _lib._objc_msgSend_14( + _lib._class_NSObject1, _lib._sel_debugDescription1); return NSString._(_ret, _lib); } } typedef instancetype = ffi.Pointer; -class ObjCObject extends ffi.Opaque {} - class _NSZone extends ffi.Opaque {} -class ObjCSel extends ffi.Opaque {} - typedef IMP = ffi.Pointer>; class NSMethodSignature extends _ObjCWrapper { NSMethodSignature._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSMethodSignature castFrom(T other) { return NSMethodSignature._(other._id, other._lib); } @@ -801,8 +769,6 @@ typedef NSUInteger = pkg_ffi.UnsignedLong; class NSString extends _ObjCWrapper { NSString._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSString castFrom(T other) { return NSString._(other._id, other._lib); } @@ -817,21 +783,15 @@ class NSString extends _ObjCWrapper { @override String toString() => UTF8String().cast().toDartString(); - static ffi.Pointer? _sel_stringWithCString_encoding; static NSString stringWithCString_encoding( NativeLibrary _lib, ffi.Pointer cString, int enc) { - _class ??= _getClass(_lib, "NSString"); - _sel_stringWithCString_encoding ??= - _registerName(_lib, "stringWithCString:encoding:"); - final _ret = _lib._objc_msgSend_12( - _class!, _sel_stringWithCString_encoding!, cString, enc); + final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_UTF8String; ffi.Pointer UTF8String() { - _sel_UTF8String ??= _registerName(_lib, "UTF8String"); - return _lib._objc_msgSend_13(_id, _sel_UTF8String!); + return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); } } diff --git a/pkgs/ffigen/test/native_objc_test/method_bindings.dart b/pkgs/ffigen/test/native_objc_test/method_bindings.dart index d8390d3b69..2ebbe59a61 100644 --- a/pkgs/ffigen/test/native_objc_test/method_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/method_bindings.dart @@ -107,6 +107,13 @@ class MethodTestObjCLibrary { set kCFAllocatorUseContext(CFAllocatorRef value) => _kCFAllocatorUseContext.value = value; + ffi.Pointer _registerName1(String name) { + final cstr = name.toNativeUtf8(); + final sel = _sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; + } + ffi.Pointer _sel_registerName( ffi.Pointer str, ) { @@ -122,6 +129,13 @@ class MethodTestObjCLibrary { late final __sel_registerName = __sel_registerNamePtr .asFunction Function(ffi.Pointer)>(); + ffi.Pointer _getClass1(String name) { + final cstr = name.toNativeUtf8(); + final clazz = _objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; + } + ffi.Pointer _objc_getClass( ffi.Pointer str, ) { @@ -137,6 +151,10 @@ class MethodTestObjCLibrary { late final __objc_getClass = __objc_getClassPtr.asFunction< ffi.Pointer Function(ffi.Pointer)>(); + late final ffi.Pointer _class_MethodInterface1 = + _getClass1("MethodInterface"); + late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); + late final ffi.Pointer _sel_load1 = _registerName1("load"); void _objc_msgSend_0( ffi.Pointer obj, ffi.Pointer sel, @@ -154,6 +172,9 @@ class MethodTestObjCLibrary { late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_initialize1 = + _registerName1("initialize"); + late final ffi.Pointer _sel_init1 = _registerName1("init"); instancetype _objc_msgSend_1( ffi.Pointer obj, ffi.Pointer sel, @@ -171,6 +192,9 @@ class MethodTestObjCLibrary { late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_new1 = _registerName1("new"); + late final ffi.Pointer _sel_allocWithZone_1 = + _registerName1("allocWithZone:"); instancetype _objc_msgSend_2( ffi.Pointer obj, ffi.Pointer sel, @@ -191,6 +215,18 @@ class MethodTestObjCLibrary { instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer<_NSZone>)>(); + late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); + late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); + late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); + late final ffi.Pointer _sel_copy1 = _registerName1("copy"); + late final ffi.Pointer _sel_mutableCopy1 = + _registerName1("mutableCopy"); + late final ffi.Pointer _sel_copyWithZone_1 = + _registerName1("copyWithZone:"); + late final ffi.Pointer _sel_mutableCopyWithZone_1 = + _registerName1("mutableCopyWithZone:"); + late final ffi.Pointer _sel_instancesRespondToSelector_1 = + _registerName1("instancesRespondToSelector:"); bool _objc_msgSend_3( ffi.Pointer obj, ffi.Pointer sel, @@ -212,6 +248,8 @@ class MethodTestObjCLibrary { int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_conformsToProtocol_1 = + _registerName1("conformsToProtocol:"); bool _objc_msgSend_4( ffi.Pointer obj, ffi.Pointer sel, @@ -233,6 +271,8 @@ class MethodTestObjCLibrary { int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_methodForSelector_1 = + _registerName1("methodForSelector:"); IMP _objc_msgSend_5( ffi.Pointer obj, ffi.Pointer sel, @@ -253,6 +293,10 @@ class MethodTestObjCLibrary { IMP Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_instanceMethodForSelector_1 = + _registerName1("instanceMethodForSelector:"); + late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = + _registerName1("doesNotRecognizeSelector:"); void _objc_msgSend_6( ffi.Pointer obj, ffi.Pointer sel, @@ -273,6 +317,8 @@ class MethodTestObjCLibrary { void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_forwardingTargetForSelector_1 = + _registerName1("forwardingTargetForSelector:"); ffi.Pointer _objc_msgSend_7( ffi.Pointer obj, ffi.Pointer sel, @@ -293,6 +339,8 @@ class MethodTestObjCLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_forwardInvocation_1 = + _registerName1("forwardInvocation:"); void _objc_msgSend_8( ffi.Pointer obj, ffi.Pointer sel, @@ -313,6 +361,10 @@ class MethodTestObjCLibrary { void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _class_NSMethodSignature1 = + _getClass1("NSMethodSignature"); + late final ffi.Pointer _sel_methodSignatureForSelector_1 = + _registerName1("methodSignatureForSelector:"); ffi.Pointer _objc_msgSend_9( ffi.Pointer obj, ffi.Pointer sel, @@ -333,6 +385,10 @@ class MethodTestObjCLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = + _registerName1("instanceMethodSignatureForSelector:"); + late final ffi.Pointer _sel_allowsWeakReference1 = + _registerName1("allowsWeakReference"); bool _objc_msgSend_10( ffi.Pointer obj, ffi.Pointer sel, @@ -351,6 +407,15 @@ class MethodTestObjCLibrary { late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_retainWeakReference1 = + _registerName1("retainWeakReference"); + late final ffi.Pointer _sel_isSubclassOfClass_1 = + _registerName1("isSubclassOfClass:"); + late final ffi.Pointer _sel_resolveClassMethod_1 = + _registerName1("resolveClassMethod:"); + late final ffi.Pointer _sel_resolveInstanceMethod_1 = + _registerName1("resolveInstanceMethod:"); + late final ffi.Pointer _sel_hash1 = _registerName1("hash"); int _objc_msgSend_11( ffi.Pointer obj, ffi.Pointer sel, @@ -368,6 +433,12 @@ class MethodTestObjCLibrary { late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_superclass1 = + _registerName1("superclass"); + late final ffi.Pointer _sel_class1 = _registerName1("class"); + late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); + late final ffi.Pointer _sel_stringWithCString_encoding_1 = + _registerName1("stringWithCString:encoding:"); ffi.Pointer _objc_msgSend_12( ffi.Pointer obj, ffi.Pointer sel, @@ -393,6 +464,8 @@ class MethodTestObjCLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_UTF8String1 = + _registerName1("UTF8String"); ffi.Pointer _objc_msgSend_13( ffi.Pointer obj, ffi.Pointer sel, @@ -411,6 +484,8 @@ class MethodTestObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_description1 = + _registerName1("description"); ffi.Pointer _objc_msgSend_14( ffi.Pointer obj, ffi.Pointer sel, @@ -429,6 +504,9 @@ class MethodTestObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_debugDescription1 = + _registerName1("debugDescription"); + late final ffi.Pointer _sel_add1 = _registerName1("add"); int _objc_msgSend_15( ffi.Pointer obj, ffi.Pointer sel, @@ -446,6 +524,7 @@ class MethodTestObjCLibrary { late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_add_1 = _registerName1("add:"); int _objc_msgSend_16( ffi.Pointer obj, ffi.Pointer sel, @@ -465,6 +544,7 @@ class MethodTestObjCLibrary { late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_add_Y_1 = _registerName1("add:Y:"); int _objc_msgSend_17( ffi.Pointer obj, ffi.Pointer sel, @@ -486,6 +566,7 @@ class MethodTestObjCLibrary { late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, int)>(); + late final ffi.Pointer _sel_add_Y_Z_1 = _registerName1("add:Y:Z:"); int _objc_msgSend_18( ffi.Pointer obj, ffi.Pointer sel, @@ -509,6 +590,11 @@ class MethodTestObjCLibrary { late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< int Function( ffi.Pointer, ffi.Pointer, int, int, int)>(); + + late final ffi.Pointer _sel_sub1 = _registerName1("sub"); + late final ffi.Pointer _sel_sub_1 = _registerName1("sub:"); + late final ffi.Pointer _sel_sub_Y_1 = _registerName1("sub:Y:"); + late final ffi.Pointer _sel_sub_Y_Z_1 = _registerName1("sub:Y:Z:"); } abstract class NSComparisonResult { @@ -607,20 +693,6 @@ typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< ffi.NativeFunction< CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; -ffi.Pointer _registerName(MethodTestObjCLibrary _lib, String name) { - final cstr = name.toNativeUtf8(); - final sel = _lib._sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; -} - -ffi.Pointer _getClass(MethodTestObjCLibrary _lib, String name) { - final cstr = name.toNativeUtf8(); - final clazz = _lib._objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return clazz; -} - class _ObjCWrapper { final ffi.Pointer _id; final MethodTestObjCLibrary _lib; @@ -631,350 +703,244 @@ class MethodInterface extends NSObject { MethodInterface._(ffi.Pointer id, MethodTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static MethodInterface castFrom(T other) { return MethodInterface._(other._id, other._lib); } - static ffi.Pointer? _sel_add; int add() { - _sel_add ??= _registerName(_lib, "add"); - return _lib._objc_msgSend_15(_id, _sel_add!); + return _lib._objc_msgSend_15(_id, _lib._sel_add1); } - static ffi.Pointer? _sel_add1; int add1(int x) { - _sel_add1 ??= _registerName(_lib, "add:"); - return _lib._objc_msgSend_16(_id, _sel_add1!, x); + return _lib._objc_msgSend_16(_id, _lib._sel_add_1, x); } - static ffi.Pointer? _sel_add_Y; int add_Y(int x, int y) { - _sel_add_Y ??= _registerName(_lib, "add:Y:"); - return _lib._objc_msgSend_17(_id, _sel_add_Y!, x, y); + return _lib._objc_msgSend_17(_id, _lib._sel_add_Y_1, x, y); } - static ffi.Pointer? _sel_add_Y_Z; int add_Y_Z(int x, int y, int z) { - _sel_add_Y_Z ??= _registerName(_lib, "add:Y:Z:"); - return _lib._objc_msgSend_18(_id, _sel_add_Y_Z!, x, y, z); + return _lib._objc_msgSend_18(_id, _lib._sel_add_Y_Z_1, x, y, z); } - static ffi.Pointer? _sel_sub; static int sub(MethodTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "MethodInterface"); - _sel_sub ??= _registerName(_lib, "sub"); - return _lib._objc_msgSend_15(_class!, _sel_sub!); + return _lib._objc_msgSend_15(_lib._class_MethodInterface1, _lib._sel_sub1); } - static ffi.Pointer? _sel_sub1; static int sub1(MethodTestObjCLibrary _lib, int x) { - _class ??= _getClass(_lib, "MethodInterface"); - _sel_sub1 ??= _registerName(_lib, "sub:"); - return _lib._objc_msgSend_16(_class!, _sel_sub1!, x); + return _lib._objc_msgSend_16( + _lib._class_MethodInterface1, _lib._sel_sub_1, x); } - static ffi.Pointer? _sel_sub_Y; static int sub_Y(MethodTestObjCLibrary _lib, int x, int y) { - _class ??= _getClass(_lib, "MethodInterface"); - _sel_sub_Y ??= _registerName(_lib, "sub:Y:"); - return _lib._objc_msgSend_17(_class!, _sel_sub_Y!, x, y); + return _lib._objc_msgSend_17( + _lib._class_MethodInterface1, _lib._sel_sub_Y_1, x, y); } - static ffi.Pointer? _sel_sub_Y_Z; static int sub_Y_Z(MethodTestObjCLibrary _lib, int x, int y, int z) { - _class ??= _getClass(_lib, "MethodInterface"); - _sel_sub_Y_Z ??= _registerName(_lib, "sub:Y:Z:"); - return _lib._objc_msgSend_18(_class!, _sel_sub_Y_Z!, x, y, z); + return _lib._objc_msgSend_18( + _lib._class_MethodInterface1, _lib._sel_sub_Y_Z_1, x, y, z); } - static ffi.Pointer? _sel_new1; static MethodInterface new1(MethodTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "MethodInterface"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = + _lib._objc_msgSend_1(_lib._class_MethodInterface1, _lib._sel_new1); return MethodInterface._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static MethodInterface alloc(MethodTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "MethodInterface"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = + _lib._objc_msgSend_1(_lib._class_MethodInterface1, _lib._sel_alloc1); return MethodInterface._(_ret, _lib); } } +class ObjCSel extends ffi.Opaque {} + +class ObjCObject extends ffi.Opaque {} + class NSObject extends _ObjCWrapper { NSObject._(ffi.Pointer id, MethodTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSObject castFrom(T other) { return NSObject._(other._id, other._lib); } - static ffi.Pointer? _sel_load; static void load(MethodTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_load ??= _registerName(_lib, "load"); - _lib._objc_msgSend_0(_class!, _sel_load!); + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); } - static ffi.Pointer? _sel_initialize; static void initialize(MethodTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_initialize ??= _registerName(_lib, "initialize"); - _lib._objc_msgSend_0(_class!, _sel_initialize!); + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); } - static ffi.Pointer? _sel_init; NSObject init() { - _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_new1; static NSObject new1(MethodTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_allocWithZone; static NSObject allocWithZone( MethodTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_allocWithZone ??= _registerName(_lib, "allocWithZone:"); - final _ret = _lib._objc_msgSend_2(_class!, _sel_allocWithZone!, zone); + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static NSObject alloc(MethodTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_dealloc; void dealloc() { - _sel_dealloc ??= _registerName(_lib, "dealloc"); - _lib._objc_msgSend_0(_id, _sel_dealloc!); + _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); } - static ffi.Pointer? _sel_finalize; void finalize() { - _sel_finalize ??= _registerName(_lib, "finalize"); - _lib._objc_msgSend_0(_id, _sel_finalize!); + _lib._objc_msgSend_0(_id, _lib._sel_finalize1); } - static ffi.Pointer? _sel_copy; NSObject copy() { - _sel_copy ??= _registerName(_lib, "copy"); - final _ret = _lib._objc_msgSend_1(_id, _sel_copy!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_mutableCopy; NSObject mutableCopy() { - _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); - final _ret = _lib._objc_msgSend_1(_id, _sel_mutableCopy!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_copyWithZone; static NSObject copyWithZone( MethodTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); - final _ret = _lib._objc_msgSend_2(_class!, _sel_copyWithZone!, zone); + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_mutableCopyWithZone; static NSObject mutableCopyWithZone( MethodTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); - final _ret = _lib._objc_msgSend_2(_class!, _sel_mutableCopyWithZone!, zone); + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_instancesRespondToSelector; static bool instancesRespondToSelector( MethodTestObjCLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instancesRespondToSelector ??= - _registerName(_lib, "instancesRespondToSelector:"); - return _lib._objc_msgSend_3( - _class!, _sel_instancesRespondToSelector!, aSelector); + return _lib._objc_msgSend_3(_lib._class_NSObject1, + _lib._sel_instancesRespondToSelector_1, aSelector); } - static ffi.Pointer? _sel_conformsToProtocol; static bool conformsToProtocol( MethodTestObjCLibrary _lib, NSObject protocol) { - _class ??= _getClass(_lib, "NSObject"); - _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); return _lib._objc_msgSend_4( - _class!, _sel_conformsToProtocol!, protocol._id); + _lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol._id); } - static ffi.Pointer? _sel_methodForSelector; IMP methodForSelector(ffi.Pointer aSelector) { - _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); - return _lib._objc_msgSend_5(_id, _sel_methodForSelector!, aSelector); + return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); } - static ffi.Pointer? _sel_instanceMethodForSelector; static IMP instanceMethodForSelector( MethodTestObjCLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instanceMethodForSelector ??= - _registerName(_lib, "instanceMethodForSelector:"); - return _lib._objc_msgSend_5( - _class!, _sel_instanceMethodForSelector!, aSelector); + return _lib._objc_msgSend_5(_lib._class_NSObject1, + _lib._sel_instanceMethodForSelector_1, aSelector); } - static ffi.Pointer? _sel_doesNotRecognizeSelector; void doesNotRecognizeSelector(ffi.Pointer aSelector) { - _sel_doesNotRecognizeSelector ??= - _registerName(_lib, "doesNotRecognizeSelector:"); - _lib._objc_msgSend_6(_id, _sel_doesNotRecognizeSelector!, aSelector); + _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); } - static ffi.Pointer? _sel_forwardingTargetForSelector; NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { - _sel_forwardingTargetForSelector ??= - _registerName(_lib, "forwardingTargetForSelector:"); - final _ret = - _lib._objc_msgSend_7(_id, _sel_forwardingTargetForSelector!, aSelector); + final _ret = _lib._objc_msgSend_7( + _id, _lib._sel_forwardingTargetForSelector_1, aSelector); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_forwardInvocation; void forwardInvocation(NSObject anInvocation) { - _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); - _lib._objc_msgSend_8(_id, _sel_forwardInvocation!, anInvocation._id); + _lib._objc_msgSend_8(_id, _lib._sel_forwardInvocation_1, anInvocation._id); } - static ffi.Pointer? _sel_methodSignatureForSelector; NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { - _sel_methodSignatureForSelector ??= - _registerName(_lib, "methodSignatureForSelector:"); - final _ret = - _lib._objc_msgSend_9(_id, _sel_methodSignatureForSelector!, aSelector); + final _ret = _lib._objc_msgSend_9( + _id, _lib._sel_methodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static ffi.Pointer? _sel_instanceMethodSignatureForSelector; static NSMethodSignature instanceMethodSignatureForSelector( MethodTestObjCLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instanceMethodSignatureForSelector ??= - _registerName(_lib, "instanceMethodSignatureForSelector:"); - final _ret = _lib._objc_msgSend_9( - _class!, _sel_instanceMethodSignatureForSelector!, aSelector); + final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, + _lib._sel_instanceMethodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static ffi.Pointer? _sel_allowsWeakReference; bool allowsWeakReference() { - _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); - return _lib._objc_msgSend_10(_id, _sel_allowsWeakReference!); + return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); } - static ffi.Pointer? _sel_retainWeakReference; bool retainWeakReference() { - _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); - return _lib._objc_msgSend_10(_id, _sel_retainWeakReference!); + return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); } - static ffi.Pointer? _sel_isSubclassOfClass; static bool isSubclassOfClass(MethodTestObjCLibrary _lib, NSObject aClass) { - _class ??= _getClass(_lib, "NSObject"); - _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); - return _lib._objc_msgSend_4(_class!, _sel_isSubclassOfClass!, aClass._id); + return _lib._objc_msgSend_4( + _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); } - static ffi.Pointer? _sel_resolveClassMethod; static bool resolveClassMethod( MethodTestObjCLibrary _lib, ffi.Pointer sel) { - _class ??= _getClass(_lib, "NSObject"); - _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); - return _lib._objc_msgSend_3(_class!, _sel_resolveClassMethod!, sel); + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); } - static ffi.Pointer? _sel_resolveInstanceMethod; static bool resolveInstanceMethod( MethodTestObjCLibrary _lib, ffi.Pointer sel) { - _class ??= _getClass(_lib, "NSObject"); - _sel_resolveInstanceMethod ??= - _registerName(_lib, "resolveInstanceMethod:"); - return _lib._objc_msgSend_3(_class!, _sel_resolveInstanceMethod!, sel); + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); } - static ffi.Pointer? _sel_hash; static int hash(MethodTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_hash ??= _registerName(_lib, "hash"); - return _lib._objc_msgSend_11(_class!, _sel_hash!); + return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); } - static ffi.Pointer? _sel_superclass; static NSObject superclass(MethodTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_superclass ??= _registerName(_lib, "superclass"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_superclass!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_class1; static NSObject class1(MethodTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_class1 ??= _registerName(_lib, "class"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_class1!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_description; static NSString description(MethodTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_description ??= _registerName(_lib, "description"); - final _ret = _lib._objc_msgSend_14(_class!, _sel_description!); + final _ret = + _lib._objc_msgSend_14(_lib._class_NSObject1, _lib._sel_description1); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_debugDescription; static NSString debugDescription(MethodTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_debugDescription ??= _registerName(_lib, "debugDescription"); - final _ret = _lib._objc_msgSend_14(_class!, _sel_debugDescription!); + final _ret = _lib._objc_msgSend_14( + _lib._class_NSObject1, _lib._sel_debugDescription1); return NSString._(_ret, _lib); } } typedef instancetype = ffi.Pointer; -class ObjCObject extends ffi.Opaque {} - class _NSZone extends ffi.Opaque {} -class ObjCSel extends ffi.Opaque {} - typedef IMP = ffi.Pointer>; class NSMethodSignature extends _ObjCWrapper { NSMethodSignature._(ffi.Pointer id, MethodTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSMethodSignature castFrom(T other) { return NSMethodSignature._(other._id, other._lib); } @@ -986,8 +952,6 @@ class NSString extends _ObjCWrapper { NSString._(ffi.Pointer id, MethodTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSString castFrom(T other) { return NSString._(other._id, other._lib); } @@ -1002,21 +966,15 @@ class NSString extends _ObjCWrapper { @override String toString() => UTF8String().cast().toDartString(); - static ffi.Pointer? _sel_stringWithCString_encoding; static NSString stringWithCString_encoding( MethodTestObjCLibrary _lib, ffi.Pointer cString, int enc) { - _class ??= _getClass(_lib, "NSString"); - _sel_stringWithCString_encoding ??= - _registerName(_lib, "stringWithCString:encoding:"); - final _ret = _lib._objc_msgSend_12( - _class!, _sel_stringWithCString_encoding!, cString, enc); + final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_UTF8String; ffi.Pointer UTF8String() { - _sel_UTF8String ??= _registerName(_lib, "UTF8String"); - return _lib._objc_msgSend_13(_id, _sel_UTF8String!); + return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); } } diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart index 9ffa2a8a94..5b9e98f092 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart @@ -404,6 +404,13 @@ class NativeObjCLibrary { set NSParseErrorException(NSExceptionName value) => _NSParseErrorException.value = value; + ffi.Pointer _registerName1(String name) { + final cstr = name.toNativeUtf8(); + final sel = _sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; + } + ffi.Pointer _sel_registerName( ffi.Pointer str, ) { @@ -419,6 +426,13 @@ class NativeObjCLibrary { late final __sel_registerName = __sel_registerNamePtr .asFunction Function(ffi.Pointer)>(); + ffi.Pointer _getClass1(String name) { + final cstr = name.toNativeUtf8(); + final clazz = _objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; + } + ffi.Pointer _objc_getClass( ffi.Pointer str, ) { @@ -434,6 +448,9 @@ class NativeObjCLibrary { late final __objc_getClass = __objc_getClassPtr.asFunction< ffi.Pointer Function(ffi.Pointer)>(); + late final ffi.Pointer _class_Foo1 = _getClass1("Foo"); + late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); + late final ffi.Pointer _sel_load1 = _registerName1("load"); void _objc_msgSend_0( ffi.Pointer obj, ffi.Pointer sel, @@ -451,6 +468,9 @@ class NativeObjCLibrary { late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_initialize1 = + _registerName1("initialize"); + late final ffi.Pointer _sel_init1 = _registerName1("init"); instancetype _objc_msgSend_1( ffi.Pointer obj, ffi.Pointer sel, @@ -468,6 +488,9 @@ class NativeObjCLibrary { late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_new1 = _registerName1("new"); + late final ffi.Pointer _sel_allocWithZone_1 = + _registerName1("allocWithZone:"); instancetype _objc_msgSend_2( ffi.Pointer obj, ffi.Pointer sel, @@ -488,6 +511,18 @@ class NativeObjCLibrary { instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer<_NSZone>)>(); + late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); + late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); + late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); + late final ffi.Pointer _sel_copy1 = _registerName1("copy"); + late final ffi.Pointer _sel_mutableCopy1 = + _registerName1("mutableCopy"); + late final ffi.Pointer _sel_copyWithZone_1 = + _registerName1("copyWithZone:"); + late final ffi.Pointer _sel_mutableCopyWithZone_1 = + _registerName1("mutableCopyWithZone:"); + late final ffi.Pointer _sel_instancesRespondToSelector_1 = + _registerName1("instancesRespondToSelector:"); bool _objc_msgSend_3( ffi.Pointer obj, ffi.Pointer sel, @@ -509,6 +544,8 @@ class NativeObjCLibrary { int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_conformsToProtocol_1 = + _registerName1("conformsToProtocol:"); bool _objc_msgSend_4( ffi.Pointer obj, ffi.Pointer sel, @@ -530,6 +567,8 @@ class NativeObjCLibrary { int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_methodForSelector_1 = + _registerName1("methodForSelector:"); IMP _objc_msgSend_5( ffi.Pointer obj, ffi.Pointer sel, @@ -550,6 +589,10 @@ class NativeObjCLibrary { IMP Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_instanceMethodForSelector_1 = + _registerName1("instanceMethodForSelector:"); + late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = + _registerName1("doesNotRecognizeSelector:"); void _objc_msgSend_6( ffi.Pointer obj, ffi.Pointer sel, @@ -570,6 +613,8 @@ class NativeObjCLibrary { void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_forwardingTargetForSelector_1 = + _registerName1("forwardingTargetForSelector:"); ffi.Pointer _objc_msgSend_7( ffi.Pointer obj, ffi.Pointer sel, @@ -590,6 +635,8 @@ class NativeObjCLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_forwardInvocation_1 = + _registerName1("forwardInvocation:"); void _objc_msgSend_8( ffi.Pointer obj, ffi.Pointer sel, @@ -610,6 +657,10 @@ class NativeObjCLibrary { void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _class_NSMethodSignature1 = + _getClass1("NSMethodSignature"); + late final ffi.Pointer _sel_methodSignatureForSelector_1 = + _registerName1("methodSignatureForSelector:"); ffi.Pointer _objc_msgSend_9( ffi.Pointer obj, ffi.Pointer sel, @@ -630,6 +681,10 @@ class NativeObjCLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = + _registerName1("instanceMethodSignatureForSelector:"); + late final ffi.Pointer _sel_allowsWeakReference1 = + _registerName1("allowsWeakReference"); bool _objc_msgSend_10( ffi.Pointer obj, ffi.Pointer sel, @@ -648,6 +703,15 @@ class NativeObjCLibrary { late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_retainWeakReference1 = + _registerName1("retainWeakReference"); + late final ffi.Pointer _sel_isSubclassOfClass_1 = + _registerName1("isSubclassOfClass:"); + late final ffi.Pointer _sel_resolveClassMethod_1 = + _registerName1("resolveClassMethod:"); + late final ffi.Pointer _sel_resolveInstanceMethod_1 = + _registerName1("resolveInstanceMethod:"); + late final ffi.Pointer _sel_hash1 = _registerName1("hash"); int _objc_msgSend_11( ffi.Pointer obj, ffi.Pointer sel, @@ -665,6 +729,13 @@ class NativeObjCLibrary { late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_superclass1 = + _registerName1("superclass"); + late final ffi.Pointer _sel_class1 = _registerName1("class"); + late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); + late final ffi.Pointer _sel_length1 = _registerName1("length"); + late final ffi.Pointer _sel_characterAtIndex_1 = + _registerName1("characterAtIndex:"); int _objc_msgSend_12( ffi.Pointer obj, ffi.Pointer sel, @@ -684,6 +755,8 @@ class NativeObjCLibrary { late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_initWithCoder_1 = + _registerName1("initWithCoder:"); instancetype _objc_msgSend_13( ffi.Pointer obj, ffi.Pointer sel, @@ -704,6 +777,8 @@ class NativeObjCLibrary { instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_stringWithCString_encoding_1 = + _registerName1("stringWithCString:encoding:"); ffi.Pointer _objc_msgSend_14( ffi.Pointer obj, ffi.Pointer sel, @@ -729,6 +804,8 @@ class NativeObjCLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_UTF8String1 = + _registerName1("UTF8String"); ffi.Pointer _objc_msgSend_15( ffi.Pointer obj, ffi.Pointer sel, @@ -747,6 +824,8 @@ class NativeObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_description1 = + _registerName1("description"); ffi.Pointer _objc_msgSend_16( ffi.Pointer obj, ffi.Pointer sel, @@ -765,6 +844,9 @@ class NativeObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_debugDescription1 = + _registerName1("debugDescription"); + late final ffi.Pointer _sel_intVal1 = _registerName1("intVal"); int _objc_msgSend_17( ffi.Pointer obj, ffi.Pointer sel, @@ -782,6 +864,8 @@ class NativeObjCLibrary { late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_setIntVal_1 = + _registerName1("setIntVal:"); void _objc_msgSend_18( ffi.Pointer obj, ffi.Pointer sel, @@ -801,6 +885,7 @@ class NativeObjCLibrary { late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_makeFoo_1 = _registerName1("makeFoo:"); ffi.Pointer _objc_msgSend_19( ffi.Pointer obj, ffi.Pointer sel, @@ -821,6 +906,8 @@ class NativeObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer, double)>(); + late final ffi.Pointer _sel_multiply_withOtherFoo_1 = + _registerName1("multiply:withOtherFoo:"); int _objc_msgSend_20( ffi.Pointer obj, ffi.Pointer sel, @@ -843,6 +930,8 @@ class NativeObjCLibrary { int Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); + late final ffi.Pointer _sel_setDoubleVal_1 = + _registerName1("setDoubleVal:"); void _objc_msgSend_21( ffi.Pointer obj, ffi.Pointer sel, @@ -1054,20 +1143,6 @@ typedef NSStringTransform = ffi.Pointer; typedef NSStringEncodingDetectionOptionsKey = ffi.Pointer; typedef NSExceptionName = ffi.Pointer; -ffi.Pointer _registerName(NativeObjCLibrary _lib, String name) { - final cstr = name.toNativeUtf8(); - final sel = _lib._sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; -} - -ffi.Pointer _getClass(NativeObjCLibrary _lib, String name) { - final cstr = name.toNativeUtf8(); - final clazz = _lib._objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return clazz; -} - class _ObjCWrapper { final ffi.Pointer _id; final NativeObjCLibrary _lib; @@ -1077,311 +1152,213 @@ class _ObjCWrapper { class Foo extends NSObject { Foo._(ffi.Pointer id, NativeObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static Foo castFrom(T other) { return Foo._(other._id, other._lib); } - static ffi.Pointer? _sel_intVal; int get intVal { - _sel_intVal ??= _registerName(_lib, "intVal"); - return _lib._objc_msgSend_17(_id, _sel_intVal!); + return _lib._objc_msgSend_17(_id, _lib._sel_intVal1); } - static ffi.Pointer? _sel_intVal1; set intVal(int value) { - _sel_intVal1 ??= _registerName(_lib, "setIntVal:"); - _lib._objc_msgSend_18(_id, _sel_intVal1!, value); + _lib._objc_msgSend_18(_id, _lib._sel_setIntVal_1, value); } - static ffi.Pointer? _sel_makeFoo; static Foo makeFoo(NativeObjCLibrary _lib, double x) { - _class ??= _getClass(_lib, "Foo"); - _sel_makeFoo ??= _registerName(_lib, "makeFoo:"); - final _ret = _lib._objc_msgSend_19(_class!, _sel_makeFoo!, x); + final _ret = + _lib._objc_msgSend_19(_lib._class_Foo1, _lib._sel_makeFoo_1, x); return Foo._(_ret, _lib); } - static ffi.Pointer? _sel_multiply_withOtherFoo; int multiply_withOtherFoo(bool useIntVals, NSObject other) { - _sel_multiply_withOtherFoo ??= - _registerName(_lib, "multiply:withOtherFoo:"); return _lib._objc_msgSend_20( - _id, _sel_multiply_withOtherFoo!, useIntVals, other._id); + _id, _lib._sel_multiply_withOtherFoo_1, useIntVals, other._id); } - static ffi.Pointer? _sel_setDoubleVal; void setDoubleVal(double x) { - _sel_setDoubleVal ??= _registerName(_lib, "setDoubleVal:"); - _lib._objc_msgSend_21(_id, _sel_setDoubleVal!, x); + _lib._objc_msgSend_21(_id, _lib._sel_setDoubleVal_1, x); } - static ffi.Pointer? _sel_new1; static Foo new1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "Foo"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_new1); return Foo._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static Foo alloc(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "Foo"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_alloc1); return Foo._(_ret, _lib); } } +class ObjCSel extends ffi.Opaque {} + class NSObject extends _ObjCWrapper { NSObject._(ffi.Pointer id, NativeObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSObject castFrom(T other) { return NSObject._(other._id, other._lib); } - static ffi.Pointer? _sel_load; static void load(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_load ??= _registerName(_lib, "load"); - _lib._objc_msgSend_0(_class!, _sel_load!); + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); } - static ffi.Pointer? _sel_initialize; static void initialize(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_initialize ??= _registerName(_lib, "initialize"); - _lib._objc_msgSend_0(_class!, _sel_initialize!); + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); } - static ffi.Pointer? _sel_init; NSObject init() { - _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_new1; static NSObject new1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_allocWithZone; static NSObject allocWithZone( NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_allocWithZone ??= _registerName(_lib, "allocWithZone:"); - final _ret = _lib._objc_msgSend_2(_class!, _sel_allocWithZone!, zone); + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static NSObject alloc(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_dealloc; void dealloc() { - _sel_dealloc ??= _registerName(_lib, "dealloc"); - _lib._objc_msgSend_0(_id, _sel_dealloc!); + _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); } - static ffi.Pointer? _sel_finalize; void finalize() { - _sel_finalize ??= _registerName(_lib, "finalize"); - _lib._objc_msgSend_0(_id, _sel_finalize!); + _lib._objc_msgSend_0(_id, _lib._sel_finalize1); } - static ffi.Pointer? _sel_copy; NSObject copy() { - _sel_copy ??= _registerName(_lib, "copy"); - final _ret = _lib._objc_msgSend_1(_id, _sel_copy!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_mutableCopy; NSObject mutableCopy() { - _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); - final _ret = _lib._objc_msgSend_1(_id, _sel_mutableCopy!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_copyWithZone; static NSObject copyWithZone( NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); - final _ret = _lib._objc_msgSend_2(_class!, _sel_copyWithZone!, zone); + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_mutableCopyWithZone; static NSObject mutableCopyWithZone( NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); - final _ret = _lib._objc_msgSend_2(_class!, _sel_mutableCopyWithZone!, zone); + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_instancesRespondToSelector; static bool instancesRespondToSelector( NativeObjCLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instancesRespondToSelector ??= - _registerName(_lib, "instancesRespondToSelector:"); - return _lib._objc_msgSend_3( - _class!, _sel_instancesRespondToSelector!, aSelector); + return _lib._objc_msgSend_3(_lib._class_NSObject1, + _lib._sel_instancesRespondToSelector_1, aSelector); } - static ffi.Pointer? _sel_conformsToProtocol; static bool conformsToProtocol(NativeObjCLibrary _lib, NSObject protocol) { - _class ??= _getClass(_lib, "NSObject"); - _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); return _lib._objc_msgSend_4( - _class!, _sel_conformsToProtocol!, protocol._id); + _lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol._id); } - static ffi.Pointer? _sel_methodForSelector; IMP methodForSelector(ffi.Pointer aSelector) { - _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); - return _lib._objc_msgSend_5(_id, _sel_methodForSelector!, aSelector); + return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); } - static ffi.Pointer? _sel_instanceMethodForSelector; static IMP instanceMethodForSelector( NativeObjCLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instanceMethodForSelector ??= - _registerName(_lib, "instanceMethodForSelector:"); - return _lib._objc_msgSend_5( - _class!, _sel_instanceMethodForSelector!, aSelector); + return _lib._objc_msgSend_5(_lib._class_NSObject1, + _lib._sel_instanceMethodForSelector_1, aSelector); } - static ffi.Pointer? _sel_doesNotRecognizeSelector; void doesNotRecognizeSelector(ffi.Pointer aSelector) { - _sel_doesNotRecognizeSelector ??= - _registerName(_lib, "doesNotRecognizeSelector:"); - _lib._objc_msgSend_6(_id, _sel_doesNotRecognizeSelector!, aSelector); + _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); } - static ffi.Pointer? _sel_forwardingTargetForSelector; NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { - _sel_forwardingTargetForSelector ??= - _registerName(_lib, "forwardingTargetForSelector:"); - final _ret = - _lib._objc_msgSend_7(_id, _sel_forwardingTargetForSelector!, aSelector); + final _ret = _lib._objc_msgSend_7( + _id, _lib._sel_forwardingTargetForSelector_1, aSelector); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_forwardInvocation; void forwardInvocation(NSObject anInvocation) { - _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); - _lib._objc_msgSend_8(_id, _sel_forwardInvocation!, anInvocation._id); + _lib._objc_msgSend_8(_id, _lib._sel_forwardInvocation_1, anInvocation._id); } - static ffi.Pointer? _sel_methodSignatureForSelector; NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { - _sel_methodSignatureForSelector ??= - _registerName(_lib, "methodSignatureForSelector:"); - final _ret = - _lib._objc_msgSend_9(_id, _sel_methodSignatureForSelector!, aSelector); + final _ret = _lib._objc_msgSend_9( + _id, _lib._sel_methodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static ffi.Pointer? _sel_instanceMethodSignatureForSelector; static NSMethodSignature instanceMethodSignatureForSelector( NativeObjCLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instanceMethodSignatureForSelector ??= - _registerName(_lib, "instanceMethodSignatureForSelector:"); - final _ret = _lib._objc_msgSend_9( - _class!, _sel_instanceMethodSignatureForSelector!, aSelector); + final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, + _lib._sel_instanceMethodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static ffi.Pointer? _sel_allowsWeakReference; bool allowsWeakReference() { - _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); - return _lib._objc_msgSend_10(_id, _sel_allowsWeakReference!); + return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); } - static ffi.Pointer? _sel_retainWeakReference; bool retainWeakReference() { - _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); - return _lib._objc_msgSend_10(_id, _sel_retainWeakReference!); + return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); } - static ffi.Pointer? _sel_isSubclassOfClass; static bool isSubclassOfClass(NativeObjCLibrary _lib, NSObject aClass) { - _class ??= _getClass(_lib, "NSObject"); - _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); - return _lib._objc_msgSend_4(_class!, _sel_isSubclassOfClass!, aClass._id); + return _lib._objc_msgSend_4( + _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); } - static ffi.Pointer? _sel_resolveClassMethod; static bool resolveClassMethod( NativeObjCLibrary _lib, ffi.Pointer sel) { - _class ??= _getClass(_lib, "NSObject"); - _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); - return _lib._objc_msgSend_3(_class!, _sel_resolveClassMethod!, sel); + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); } - static ffi.Pointer? _sel_resolveInstanceMethod; static bool resolveInstanceMethod( NativeObjCLibrary _lib, ffi.Pointer sel) { - _class ??= _getClass(_lib, "NSObject"); - _sel_resolveInstanceMethod ??= - _registerName(_lib, "resolveInstanceMethod:"); - return _lib._objc_msgSend_3(_class!, _sel_resolveInstanceMethod!, sel); + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); } - static ffi.Pointer? _sel_hash; static int hash(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_hash ??= _registerName(_lib, "hash"); - return _lib._objc_msgSend_11(_class!, _sel_hash!); + return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); } - static ffi.Pointer? _sel_superclass; static NSObject superclass(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_superclass ??= _registerName(_lib, "superclass"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_superclass!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_class1; static NSObject class1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_class1 ??= _registerName(_lib, "class"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_class1!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_description; static NSString description(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_description ??= _registerName(_lib, "description"); - final _ret = _lib._objc_msgSend_16(_class!, _sel_description!); + final _ret = + _lib._objc_msgSend_16(_lib._class_NSObject1, _lib._sel_description1); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_debugDescription; static NSString debugDescription(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_debugDescription ??= _registerName(_lib, "debugDescription"); - final _ret = _lib._objc_msgSend_16(_class!, _sel_debugDescription!); + final _ret = _lib._objc_msgSend_16( + _lib._class_NSObject1, _lib._sel_debugDescription1); return NSString._(_ret, _lib); } } @@ -1390,16 +1367,12 @@ typedef instancetype = ffi.Pointer; class _NSZone extends ffi.Opaque {} -class ObjCSel extends ffi.Opaque {} - typedef IMP = ffi.Pointer>; class NSMethodSignature extends _ObjCWrapper { NSMethodSignature._(ffi.Pointer id, NativeObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSMethodSignature castFrom(T other) { return NSMethodSignature._(other._id, other._lib); } @@ -1409,8 +1382,6 @@ class NSString extends NSObject { NSString._(ffi.Pointer id, NativeObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSString castFrom(T other) { return NSString._(other._id, other._lib); } @@ -1425,63 +1396,44 @@ class NSString extends NSObject { @override String toString() => UTF8String().cast().toDartString(); - static ffi.Pointer? _sel_length; int get length { - _sel_length ??= _registerName(_lib, "length"); - return _lib._objc_msgSend_11(_id, _sel_length!); + return _lib._objc_msgSend_11(_id, _lib._sel_length1); } - static ffi.Pointer? _sel_characterAtIndex; int characterAtIndex(int index) { - _sel_characterAtIndex ??= _registerName(_lib, "characterAtIndex:"); - return _lib._objc_msgSend_12(_id, _sel_characterAtIndex!, index); + return _lib._objc_msgSend_12(_id, _lib._sel_characterAtIndex_1, index); } - static ffi.Pointer? _sel_init; @override NSString init() { - _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_initWithCoder; NSString initWithCoder(NSObject coder) { - _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_13(_id, _sel_initWithCoder!, coder._id); + final _ret = + _lib._objc_msgSend_13(_id, _lib._sel_initWithCoder_1, coder._id); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_stringWithCString_encoding; static NSString stringWithCString_encoding( NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { - _class ??= _getClass(_lib, "NSString"); - _sel_stringWithCString_encoding ??= - _registerName(_lib, "stringWithCString:encoding:"); - final _ret = _lib._objc_msgSend_14( - _class!, _sel_stringWithCString_encoding!, cString, enc); + final _ret = _lib._objc_msgSend_14(_lib._class_NSString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_UTF8String; ffi.Pointer UTF8String() { - _sel_UTF8String ??= _registerName(_lib, "UTF8String"); - return _lib._objc_msgSend_15(_id, _sel_UTF8String!); + return _lib._objc_msgSend_15(_id, _lib._sel_UTF8String1); } - static ffi.Pointer? _sel_new1; static NSString new1(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSString"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSString1, _lib._sel_new1); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static NSString alloc(NativeObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSString"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSString1, _lib._sel_alloc1); return NSString._(_ret, _lib); } } diff --git a/pkgs/ffigen/test/native_objc_test/property_bindings.dart b/pkgs/ffigen/test/native_objc_test/property_bindings.dart index 9a18e7d1ac..f8367742d4 100644 --- a/pkgs/ffigen/test/native_objc_test/property_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/property_bindings.dart @@ -107,6 +107,13 @@ class PropertyTestObjCLibrary { set kCFAllocatorUseContext(CFAllocatorRef value) => _kCFAllocatorUseContext.value = value; + ffi.Pointer _registerName1(String name) { + final cstr = name.toNativeUtf8(); + final sel = _sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; + } + ffi.Pointer _sel_registerName( ffi.Pointer str, ) { @@ -122,6 +129,13 @@ class PropertyTestObjCLibrary { late final __sel_registerName = __sel_registerNamePtr .asFunction Function(ffi.Pointer)>(); + ffi.Pointer _getClass1(String name) { + final cstr = name.toNativeUtf8(); + final clazz = _objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; + } + ffi.Pointer _objc_getClass( ffi.Pointer str, ) { @@ -137,6 +151,10 @@ class PropertyTestObjCLibrary { late final __objc_getClass = __objc_getClassPtr.asFunction< ffi.Pointer Function(ffi.Pointer)>(); + late final ffi.Pointer _class_PropertyInterface1 = + _getClass1("PropertyInterface"); + late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); + late final ffi.Pointer _sel_load1 = _registerName1("load"); void _objc_msgSend_0( ffi.Pointer obj, ffi.Pointer sel, @@ -154,6 +172,9 @@ class PropertyTestObjCLibrary { late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_initialize1 = + _registerName1("initialize"); + late final ffi.Pointer _sel_init1 = _registerName1("init"); instancetype _objc_msgSend_1( ffi.Pointer obj, ffi.Pointer sel, @@ -171,6 +192,9 @@ class PropertyTestObjCLibrary { late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_new1 = _registerName1("new"); + late final ffi.Pointer _sel_allocWithZone_1 = + _registerName1("allocWithZone:"); instancetype _objc_msgSend_2( ffi.Pointer obj, ffi.Pointer sel, @@ -191,6 +215,18 @@ class PropertyTestObjCLibrary { instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer<_NSZone>)>(); + late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); + late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); + late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); + late final ffi.Pointer _sel_copy1 = _registerName1("copy"); + late final ffi.Pointer _sel_mutableCopy1 = + _registerName1("mutableCopy"); + late final ffi.Pointer _sel_copyWithZone_1 = + _registerName1("copyWithZone:"); + late final ffi.Pointer _sel_mutableCopyWithZone_1 = + _registerName1("mutableCopyWithZone:"); + late final ffi.Pointer _sel_instancesRespondToSelector_1 = + _registerName1("instancesRespondToSelector:"); bool _objc_msgSend_3( ffi.Pointer obj, ffi.Pointer sel, @@ -212,6 +248,8 @@ class PropertyTestObjCLibrary { int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_conformsToProtocol_1 = + _registerName1("conformsToProtocol:"); bool _objc_msgSend_4( ffi.Pointer obj, ffi.Pointer sel, @@ -233,6 +271,8 @@ class PropertyTestObjCLibrary { int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_methodForSelector_1 = + _registerName1("methodForSelector:"); IMP _objc_msgSend_5( ffi.Pointer obj, ffi.Pointer sel, @@ -253,6 +293,10 @@ class PropertyTestObjCLibrary { IMP Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_instanceMethodForSelector_1 = + _registerName1("instanceMethodForSelector:"); + late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = + _registerName1("doesNotRecognizeSelector:"); void _objc_msgSend_6( ffi.Pointer obj, ffi.Pointer sel, @@ -273,6 +317,8 @@ class PropertyTestObjCLibrary { void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_forwardingTargetForSelector_1 = + _registerName1("forwardingTargetForSelector:"); ffi.Pointer _objc_msgSend_7( ffi.Pointer obj, ffi.Pointer sel, @@ -293,6 +339,8 @@ class PropertyTestObjCLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_forwardInvocation_1 = + _registerName1("forwardInvocation:"); void _objc_msgSend_8( ffi.Pointer obj, ffi.Pointer sel, @@ -313,6 +361,10 @@ class PropertyTestObjCLibrary { void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _class_NSMethodSignature1 = + _getClass1("NSMethodSignature"); + late final ffi.Pointer _sel_methodSignatureForSelector_1 = + _registerName1("methodSignatureForSelector:"); ffi.Pointer _objc_msgSend_9( ffi.Pointer obj, ffi.Pointer sel, @@ -333,6 +385,10 @@ class PropertyTestObjCLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = + _registerName1("instanceMethodSignatureForSelector:"); + late final ffi.Pointer _sel_allowsWeakReference1 = + _registerName1("allowsWeakReference"); bool _objc_msgSend_10( ffi.Pointer obj, ffi.Pointer sel, @@ -351,6 +407,15 @@ class PropertyTestObjCLibrary { late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_retainWeakReference1 = + _registerName1("retainWeakReference"); + late final ffi.Pointer _sel_isSubclassOfClass_1 = + _registerName1("isSubclassOfClass:"); + late final ffi.Pointer _sel_resolveClassMethod_1 = + _registerName1("resolveClassMethod:"); + late final ffi.Pointer _sel_resolveInstanceMethod_1 = + _registerName1("resolveInstanceMethod:"); + late final ffi.Pointer _sel_hash1 = _registerName1("hash"); int _objc_msgSend_11( ffi.Pointer obj, ffi.Pointer sel, @@ -368,6 +433,12 @@ class PropertyTestObjCLibrary { late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_superclass1 = + _registerName1("superclass"); + late final ffi.Pointer _sel_class1 = _registerName1("class"); + late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); + late final ffi.Pointer _sel_stringWithCString_encoding_1 = + _registerName1("stringWithCString:encoding:"); ffi.Pointer _objc_msgSend_12( ffi.Pointer obj, ffi.Pointer sel, @@ -393,6 +464,8 @@ class PropertyTestObjCLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_UTF8String1 = + _registerName1("UTF8String"); ffi.Pointer _objc_msgSend_13( ffi.Pointer obj, ffi.Pointer sel, @@ -411,6 +484,8 @@ class PropertyTestObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_description1 = + _registerName1("description"); ffi.Pointer _objc_msgSend_14( ffi.Pointer obj, ffi.Pointer sel, @@ -429,6 +504,10 @@ class PropertyTestObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_debugDescription1 = + _registerName1("debugDescription"); + late final ffi.Pointer _sel_readOnlyProperty1 = + _registerName1("readOnlyProperty"); int _objc_msgSend_15( ffi.Pointer obj, ffi.Pointer sel, @@ -446,6 +525,10 @@ class PropertyTestObjCLibrary { late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_readWriteProperty1 = + _registerName1("readWriteProperty"); + late final ffi.Pointer _sel_setReadWriteProperty_1 = + _registerName1("setReadWriteProperty:"); void _objc_msgSend_16( ffi.Pointer obj, ffi.Pointer sel, @@ -465,6 +548,12 @@ class PropertyTestObjCLibrary { late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_classReadOnlyProperty1 = + _registerName1("classReadOnlyProperty"); + late final ffi.Pointer _sel_classReadWriteProperty1 = + _registerName1("classReadWriteProperty"); + late final ffi.Pointer _sel_setClassReadWriteProperty_1 = + _registerName1("setClassReadWriteProperty:"); late final ffi.Pointer __classReadWriteProperty = _lookup('_classReadWriteProperty'); @@ -570,20 +659,6 @@ typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< ffi.NativeFunction< CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; -ffi.Pointer _registerName(PropertyTestObjCLibrary _lib, String name) { - final cstr = name.toNativeUtf8(); - final sel = _lib._sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; -} - -ffi.Pointer _getClass(PropertyTestObjCLibrary _lib, String name) { - final cstr = name.toNativeUtf8(); - final clazz = _lib._objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return clazz; -} - class _ObjCWrapper { final ffi.Pointer _id; final PropertyTestObjCLibrary _lib; @@ -594,340 +669,237 @@ class PropertyInterface extends NSObject { PropertyInterface._(ffi.Pointer id, PropertyTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static PropertyInterface castFrom(T other) { return PropertyInterface._(other._id, other._lib); } - static ffi.Pointer? _sel_readOnlyProperty; int get readOnlyProperty { - _sel_readOnlyProperty ??= _registerName(_lib, "readOnlyProperty"); - return _lib._objc_msgSend_15(_id, _sel_readOnlyProperty!); + return _lib._objc_msgSend_15(_id, _lib._sel_readOnlyProperty1); } - static ffi.Pointer? _sel_readWriteProperty; int get readWriteProperty { - _sel_readWriteProperty ??= _registerName(_lib, "readWriteProperty"); - return _lib._objc_msgSend_15(_id, _sel_readWriteProperty!); + return _lib._objc_msgSend_15(_id, _lib._sel_readWriteProperty1); } - static ffi.Pointer? _sel_readWriteProperty1; set readWriteProperty(int value) { - _sel_readWriteProperty1 ??= _registerName(_lib, "setReadWriteProperty:"); - _lib._objc_msgSend_16(_id, _sel_readWriteProperty1!, value); + _lib._objc_msgSend_16(_id, _lib._sel_setReadWriteProperty_1, value); } - static ffi.Pointer? _sel_classReadOnlyProperty; static int getClassReadOnlyProperty(PropertyTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "PropertyInterface"); - _sel_classReadOnlyProperty ??= _registerName(_lib, "classReadOnlyProperty"); - return _lib._objc_msgSend_15(_class!, _sel_classReadOnlyProperty!); + return _lib._objc_msgSend_15( + _lib._class_PropertyInterface1, _lib._sel_classReadOnlyProperty1); } - static ffi.Pointer? _sel_classReadWriteProperty; static int getClassReadWriteProperty(PropertyTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "PropertyInterface"); - _sel_classReadWriteProperty ??= - _registerName(_lib, "classReadWriteProperty"); - return _lib._objc_msgSend_15(_class!, _sel_classReadWriteProperty!); + return _lib._objc_msgSend_15( + _lib._class_PropertyInterface1, _lib._sel_classReadWriteProperty1); } - static ffi.Pointer? _sel_classReadWriteProperty1; static void setClassReadWriteProperty( PropertyTestObjCLibrary _lib, int value) { - _class ??= _getClass(_lib, "PropertyInterface"); - _sel_classReadWriteProperty1 ??= - _registerName(_lib, "setClassReadWriteProperty:"); - _lib._objc_msgSend_16(_class!, _sel_classReadWriteProperty1!, value); + _lib._objc_msgSend_16(_lib._class_PropertyInterface1, + _lib._sel_setClassReadWriteProperty_1, value); } - static ffi.Pointer? _sel_new1; static PropertyInterface new1(PropertyTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "PropertyInterface"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = + _lib._objc_msgSend_1(_lib._class_PropertyInterface1, _lib._sel_new1); return PropertyInterface._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static PropertyInterface alloc(PropertyTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "PropertyInterface"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = + _lib._objc_msgSend_1(_lib._class_PropertyInterface1, _lib._sel_alloc1); return PropertyInterface._(_ret, _lib); } } +class ObjCSel extends ffi.Opaque {} + +class ObjCObject extends ffi.Opaque {} + class NSObject extends _ObjCWrapper { NSObject._(ffi.Pointer id, PropertyTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSObject castFrom(T other) { return NSObject._(other._id, other._lib); } - static ffi.Pointer? _sel_load; static void load(PropertyTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_load ??= _registerName(_lib, "load"); - _lib._objc_msgSend_0(_class!, _sel_load!); + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); } - static ffi.Pointer? _sel_initialize; static void initialize(PropertyTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_initialize ??= _registerName(_lib, "initialize"); - _lib._objc_msgSend_0(_class!, _sel_initialize!); + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); } - static ffi.Pointer? _sel_init; NSObject init() { - _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_new1; static NSObject new1(PropertyTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_allocWithZone; static NSObject allocWithZone( PropertyTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_allocWithZone ??= _registerName(_lib, "allocWithZone:"); - final _ret = _lib._objc_msgSend_2(_class!, _sel_allocWithZone!, zone); + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static NSObject alloc(PropertyTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_dealloc; void dealloc() { - _sel_dealloc ??= _registerName(_lib, "dealloc"); - _lib._objc_msgSend_0(_id, _sel_dealloc!); + _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); } - static ffi.Pointer? _sel_finalize; void finalize() { - _sel_finalize ??= _registerName(_lib, "finalize"); - _lib._objc_msgSend_0(_id, _sel_finalize!); + _lib._objc_msgSend_0(_id, _lib._sel_finalize1); } - static ffi.Pointer? _sel_copy; NSObject copy() { - _sel_copy ??= _registerName(_lib, "copy"); - final _ret = _lib._objc_msgSend_1(_id, _sel_copy!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_mutableCopy; NSObject mutableCopy() { - _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); - final _ret = _lib._objc_msgSend_1(_id, _sel_mutableCopy!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_copyWithZone; static NSObject copyWithZone( PropertyTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); - final _ret = _lib._objc_msgSend_2(_class!, _sel_copyWithZone!, zone); + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_mutableCopyWithZone; static NSObject mutableCopyWithZone( PropertyTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); - final _ret = _lib._objc_msgSend_2(_class!, _sel_mutableCopyWithZone!, zone); + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_instancesRespondToSelector; static bool instancesRespondToSelector( PropertyTestObjCLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instancesRespondToSelector ??= - _registerName(_lib, "instancesRespondToSelector:"); - return _lib._objc_msgSend_3( - _class!, _sel_instancesRespondToSelector!, aSelector); + return _lib._objc_msgSend_3(_lib._class_NSObject1, + _lib._sel_instancesRespondToSelector_1, aSelector); } - static ffi.Pointer? _sel_conformsToProtocol; static bool conformsToProtocol( PropertyTestObjCLibrary _lib, NSObject protocol) { - _class ??= _getClass(_lib, "NSObject"); - _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); return _lib._objc_msgSend_4( - _class!, _sel_conformsToProtocol!, protocol._id); + _lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol._id); } - static ffi.Pointer? _sel_methodForSelector; IMP methodForSelector(ffi.Pointer aSelector) { - _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); - return _lib._objc_msgSend_5(_id, _sel_methodForSelector!, aSelector); + return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); } - static ffi.Pointer? _sel_instanceMethodForSelector; static IMP instanceMethodForSelector( PropertyTestObjCLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instanceMethodForSelector ??= - _registerName(_lib, "instanceMethodForSelector:"); - return _lib._objc_msgSend_5( - _class!, _sel_instanceMethodForSelector!, aSelector); + return _lib._objc_msgSend_5(_lib._class_NSObject1, + _lib._sel_instanceMethodForSelector_1, aSelector); } - static ffi.Pointer? _sel_doesNotRecognizeSelector; void doesNotRecognizeSelector(ffi.Pointer aSelector) { - _sel_doesNotRecognizeSelector ??= - _registerName(_lib, "doesNotRecognizeSelector:"); - _lib._objc_msgSend_6(_id, _sel_doesNotRecognizeSelector!, aSelector); + _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); } - static ffi.Pointer? _sel_forwardingTargetForSelector; NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { - _sel_forwardingTargetForSelector ??= - _registerName(_lib, "forwardingTargetForSelector:"); - final _ret = - _lib._objc_msgSend_7(_id, _sel_forwardingTargetForSelector!, aSelector); + final _ret = _lib._objc_msgSend_7( + _id, _lib._sel_forwardingTargetForSelector_1, aSelector); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_forwardInvocation; void forwardInvocation(NSObject anInvocation) { - _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); - _lib._objc_msgSend_8(_id, _sel_forwardInvocation!, anInvocation._id); + _lib._objc_msgSend_8(_id, _lib._sel_forwardInvocation_1, anInvocation._id); } - static ffi.Pointer? _sel_methodSignatureForSelector; NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { - _sel_methodSignatureForSelector ??= - _registerName(_lib, "methodSignatureForSelector:"); - final _ret = - _lib._objc_msgSend_9(_id, _sel_methodSignatureForSelector!, aSelector); + final _ret = _lib._objc_msgSend_9( + _id, _lib._sel_methodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static ffi.Pointer? _sel_instanceMethodSignatureForSelector; static NSMethodSignature instanceMethodSignatureForSelector( PropertyTestObjCLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instanceMethodSignatureForSelector ??= - _registerName(_lib, "instanceMethodSignatureForSelector:"); - final _ret = _lib._objc_msgSend_9( - _class!, _sel_instanceMethodSignatureForSelector!, aSelector); + final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, + _lib._sel_instanceMethodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static ffi.Pointer? _sel_allowsWeakReference; bool allowsWeakReference() { - _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); - return _lib._objc_msgSend_10(_id, _sel_allowsWeakReference!); + return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); } - static ffi.Pointer? _sel_retainWeakReference; bool retainWeakReference() { - _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); - return _lib._objc_msgSend_10(_id, _sel_retainWeakReference!); + return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); } - static ffi.Pointer? _sel_isSubclassOfClass; static bool isSubclassOfClass(PropertyTestObjCLibrary _lib, NSObject aClass) { - _class ??= _getClass(_lib, "NSObject"); - _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); - return _lib._objc_msgSend_4(_class!, _sel_isSubclassOfClass!, aClass._id); + return _lib._objc_msgSend_4( + _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); } - static ffi.Pointer? _sel_resolveClassMethod; static bool resolveClassMethod( PropertyTestObjCLibrary _lib, ffi.Pointer sel) { - _class ??= _getClass(_lib, "NSObject"); - _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); - return _lib._objc_msgSend_3(_class!, _sel_resolveClassMethod!, sel); + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); } - static ffi.Pointer? _sel_resolveInstanceMethod; static bool resolveInstanceMethod( PropertyTestObjCLibrary _lib, ffi.Pointer sel) { - _class ??= _getClass(_lib, "NSObject"); - _sel_resolveInstanceMethod ??= - _registerName(_lib, "resolveInstanceMethod:"); - return _lib._objc_msgSend_3(_class!, _sel_resolveInstanceMethod!, sel); + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); } - static ffi.Pointer? _sel_hash; static int hash(PropertyTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_hash ??= _registerName(_lib, "hash"); - return _lib._objc_msgSend_11(_class!, _sel_hash!); + return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); } - static ffi.Pointer? _sel_superclass; static NSObject superclass(PropertyTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_superclass ??= _registerName(_lib, "superclass"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_superclass!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_class1; static NSObject class1(PropertyTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_class1 ??= _registerName(_lib, "class"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_class1!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_description; static NSString description(PropertyTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_description ??= _registerName(_lib, "description"); - final _ret = _lib._objc_msgSend_14(_class!, _sel_description!); + final _ret = + _lib._objc_msgSend_14(_lib._class_NSObject1, _lib._sel_description1); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_debugDescription; static NSString debugDescription(PropertyTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_debugDescription ??= _registerName(_lib, "debugDescription"); - final _ret = _lib._objc_msgSend_14(_class!, _sel_debugDescription!); + final _ret = _lib._objc_msgSend_14( + _lib._class_NSObject1, _lib._sel_debugDescription1); return NSString._(_ret, _lib); } } typedef instancetype = ffi.Pointer; -class ObjCObject extends ffi.Opaque {} - class _NSZone extends ffi.Opaque {} -class ObjCSel extends ffi.Opaque {} - typedef IMP = ffi.Pointer>; class NSMethodSignature extends _ObjCWrapper { NSMethodSignature._(ffi.Pointer id, PropertyTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSMethodSignature castFrom(T other) { return NSMethodSignature._(other._id, other._lib); } @@ -939,8 +911,6 @@ class NSString extends _ObjCWrapper { NSString._(ffi.Pointer id, PropertyTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSString castFrom(T other) { return NSString._(other._id, other._lib); } @@ -955,21 +925,15 @@ class NSString extends _ObjCWrapper { @override String toString() => UTF8String().cast().toDartString(); - static ffi.Pointer? _sel_stringWithCString_encoding; static NSString stringWithCString_encoding(PropertyTestObjCLibrary _lib, ffi.Pointer cString, int enc) { - _class ??= _getClass(_lib, "NSString"); - _sel_stringWithCString_encoding ??= - _registerName(_lib, "stringWithCString:encoding:"); - final _ret = _lib._objc_msgSend_12( - _class!, _sel_stringWithCString_encoding!, cString, enc); + final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_UTF8String; ffi.Pointer UTF8String() { - _sel_UTF8String ??= _registerName(_lib, "UTF8String"); - return _lib._objc_msgSend_13(_id, _sel_UTF8String!); + return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); } } diff --git a/pkgs/ffigen/test/native_objc_test/string_bindings.dart b/pkgs/ffigen/test/native_objc_test/string_bindings.dart index 870df1999b..a4220e5814 100644 --- a/pkgs/ffigen/test/native_objc_test/string_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/string_bindings.dart @@ -107,6 +107,13 @@ class StringTestObjCLibrary { set kCFAllocatorUseContext(CFAllocatorRef value) => _kCFAllocatorUseContext.value = value; + ffi.Pointer _registerName1(String name) { + final cstr = name.toNativeUtf8(); + final sel = _sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; + } + ffi.Pointer _sel_registerName( ffi.Pointer str, ) { @@ -122,6 +129,13 @@ class StringTestObjCLibrary { late final __sel_registerName = __sel_registerNamePtr .asFunction Function(ffi.Pointer)>(); + ffi.Pointer _getClass1(String name) { + final cstr = name.toNativeUtf8(); + final clazz = _objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; + } + ffi.Pointer _objc_getClass( ffi.Pointer str, ) { @@ -137,6 +151,9 @@ class StringTestObjCLibrary { late final __objc_getClass = __objc_getClassPtr.asFunction< ffi.Pointer Function(ffi.Pointer)>(); + late final ffi.Pointer _class_NSValue1 = _getClass1("NSValue"); + late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); + late final ffi.Pointer _sel_load1 = _registerName1("load"); void _objc_msgSend_0( ffi.Pointer obj, ffi.Pointer sel, @@ -154,6 +171,9 @@ class StringTestObjCLibrary { late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_initialize1 = + _registerName1("initialize"); + late final ffi.Pointer _sel_init1 = _registerName1("init"); instancetype _objc_msgSend_1( ffi.Pointer obj, ffi.Pointer sel, @@ -171,6 +191,9 @@ class StringTestObjCLibrary { late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_new1 = _registerName1("new"); + late final ffi.Pointer _sel_allocWithZone_1 = + _registerName1("allocWithZone:"); instancetype _objc_msgSend_2( ffi.Pointer obj, ffi.Pointer sel, @@ -191,6 +214,18 @@ class StringTestObjCLibrary { instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer<_NSZone>)>(); + late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); + late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); + late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); + late final ffi.Pointer _sel_copy1 = _registerName1("copy"); + late final ffi.Pointer _sel_mutableCopy1 = + _registerName1("mutableCopy"); + late final ffi.Pointer _sel_copyWithZone_1 = + _registerName1("copyWithZone:"); + late final ffi.Pointer _sel_mutableCopyWithZone_1 = + _registerName1("mutableCopyWithZone:"); + late final ffi.Pointer _sel_instancesRespondToSelector_1 = + _registerName1("instancesRespondToSelector:"); bool _objc_msgSend_3( ffi.Pointer obj, ffi.Pointer sel, @@ -212,6 +247,8 @@ class StringTestObjCLibrary { int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_conformsToProtocol_1 = + _registerName1("conformsToProtocol:"); bool _objc_msgSend_4( ffi.Pointer obj, ffi.Pointer sel, @@ -233,6 +270,8 @@ class StringTestObjCLibrary { int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_methodForSelector_1 = + _registerName1("methodForSelector:"); IMP _objc_msgSend_5( ffi.Pointer obj, ffi.Pointer sel, @@ -253,6 +292,10 @@ class StringTestObjCLibrary { IMP Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_instanceMethodForSelector_1 = + _registerName1("instanceMethodForSelector:"); + late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = + _registerName1("doesNotRecognizeSelector:"); void _objc_msgSend_6( ffi.Pointer obj, ffi.Pointer sel, @@ -273,6 +316,8 @@ class StringTestObjCLibrary { void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_forwardingTargetForSelector_1 = + _registerName1("forwardingTargetForSelector:"); ffi.Pointer _objc_msgSend_7( ffi.Pointer obj, ffi.Pointer sel, @@ -293,6 +338,8 @@ class StringTestObjCLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_forwardInvocation_1 = + _registerName1("forwardInvocation:"); void _objc_msgSend_8( ffi.Pointer obj, ffi.Pointer sel, @@ -313,6 +360,10 @@ class StringTestObjCLibrary { void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _class_NSMethodSignature1 = + _getClass1("NSMethodSignature"); + late final ffi.Pointer _sel_methodSignatureForSelector_1 = + _registerName1("methodSignatureForSelector:"); ffi.Pointer _objc_msgSend_9( ffi.Pointer obj, ffi.Pointer sel, @@ -333,6 +384,10 @@ class StringTestObjCLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = + _registerName1("instanceMethodSignatureForSelector:"); + late final ffi.Pointer _sel_allowsWeakReference1 = + _registerName1("allowsWeakReference"); bool _objc_msgSend_10( ffi.Pointer obj, ffi.Pointer sel, @@ -351,6 +406,15 @@ class StringTestObjCLibrary { late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_retainWeakReference1 = + _registerName1("retainWeakReference"); + late final ffi.Pointer _sel_isSubclassOfClass_1 = + _registerName1("isSubclassOfClass:"); + late final ffi.Pointer _sel_resolveClassMethod_1 = + _registerName1("resolveClassMethod:"); + late final ffi.Pointer _sel_resolveInstanceMethod_1 = + _registerName1("resolveInstanceMethod:"); + late final ffi.Pointer _sel_hash1 = _registerName1("hash"); int _objc_msgSend_11( ffi.Pointer obj, ffi.Pointer sel, @@ -368,6 +432,13 @@ class StringTestObjCLibrary { late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_superclass1 = + _registerName1("superclass"); + late final ffi.Pointer _sel_class1 = _registerName1("class"); + late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); + late final ffi.Pointer _sel_length1 = _registerName1("length"); + late final ffi.Pointer _sel_characterAtIndex_1 = + _registerName1("characterAtIndex:"); int _objc_msgSend_12( ffi.Pointer obj, ffi.Pointer sel, @@ -387,6 +458,8 @@ class StringTestObjCLibrary { late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_initWithCoder_1 = + _registerName1("initWithCoder:"); instancetype _objc_msgSend_13( ffi.Pointer obj, ffi.Pointer sel, @@ -407,6 +480,8 @@ class StringTestObjCLibrary { instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_stringWithCString_encoding_1 = + _registerName1("stringWithCString:encoding:"); ffi.Pointer _objc_msgSend_14( ffi.Pointer obj, ffi.Pointer sel, @@ -432,6 +507,8 @@ class StringTestObjCLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_UTF8String1 = + _registerName1("UTF8String"); ffi.Pointer _objc_msgSend_15( ffi.Pointer obj, ffi.Pointer sel, @@ -450,6 +527,8 @@ class StringTestObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_description1 = + _registerName1("description"); ffi.Pointer _objc_msgSend_16( ffi.Pointer obj, ffi.Pointer sel, @@ -468,6 +547,10 @@ class StringTestObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_debugDescription1 = + _registerName1("debugDescription"); + late final ffi.Pointer _sel_getValue_size_1 = + _registerName1("getValue:size:"); void _objc_msgSend_17( ffi.Pointer obj, ffi.Pointer sel, @@ -490,6 +573,9 @@ class StringTestObjCLibrary { void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_objCType1 = _registerName1("objCType"); + late final ffi.Pointer _sel_initWithBytes_objCType_1 = + _registerName1("initWithBytes:objCType:"); instancetype _objc_msgSend_18( ffi.Pointer obj, ffi.Pointer sel, @@ -515,6 +601,9 @@ class StringTestObjCLibrary { instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _class_NSNumber1 = _getClass1("NSNumber"); + late final ffi.Pointer _sel_initWithChar_1 = + _registerName1("initWithChar:"); ffi.Pointer _objc_msgSend_19( ffi.Pointer obj, ffi.Pointer sel, @@ -535,6 +624,8 @@ class StringTestObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_initWithUnsignedChar_1 = + _registerName1("initWithUnsignedChar:"); ffi.Pointer _objc_msgSend_20( ffi.Pointer obj, ffi.Pointer sel, @@ -555,6 +646,8 @@ class StringTestObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_initWithShort_1 = + _registerName1("initWithShort:"); ffi.Pointer _objc_msgSend_21( ffi.Pointer obj, ffi.Pointer sel, @@ -575,6 +668,8 @@ class StringTestObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_initWithUnsignedShort_1 = + _registerName1("initWithUnsignedShort:"); ffi.Pointer _objc_msgSend_22( ffi.Pointer obj, ffi.Pointer sel, @@ -595,6 +690,8 @@ class StringTestObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_initWithInt_1 = + _registerName1("initWithInt:"); ffi.Pointer _objc_msgSend_23( ffi.Pointer obj, ffi.Pointer sel, @@ -615,6 +712,8 @@ class StringTestObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_initWithUnsignedInt_1 = + _registerName1("initWithUnsignedInt:"); ffi.Pointer _objc_msgSend_24( ffi.Pointer obj, ffi.Pointer sel, @@ -635,6 +734,8 @@ class StringTestObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_initWithLong_1 = + _registerName1("initWithLong:"); ffi.Pointer _objc_msgSend_25( ffi.Pointer obj, ffi.Pointer sel, @@ -655,6 +756,8 @@ class StringTestObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_initWithUnsignedLong_1 = + _registerName1("initWithUnsignedLong:"); ffi.Pointer _objc_msgSend_26( ffi.Pointer obj, ffi.Pointer sel, @@ -675,6 +778,8 @@ class StringTestObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_initWithLongLong_1 = + _registerName1("initWithLongLong:"); ffi.Pointer _objc_msgSend_27( ffi.Pointer obj, ffi.Pointer sel, @@ -695,6 +800,8 @@ class StringTestObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_initWithUnsignedLongLong_1 = + _registerName1("initWithUnsignedLongLong:"); ffi.Pointer _objc_msgSend_28( ffi.Pointer obj, ffi.Pointer sel, @@ -715,6 +822,8 @@ class StringTestObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_initWithFloat_1 = + _registerName1("initWithFloat:"); ffi.Pointer _objc_msgSend_29( ffi.Pointer obj, ffi.Pointer sel, @@ -735,6 +844,8 @@ class StringTestObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer, double)>(); + late final ffi.Pointer _sel_initWithDouble_1 = + _registerName1("initWithDouble:"); ffi.Pointer _objc_msgSend_30( ffi.Pointer obj, ffi.Pointer sel, @@ -755,6 +866,8 @@ class StringTestObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer, double)>(); + late final ffi.Pointer _sel_initWithBool_1 = + _registerName1("initWithBool:"); ffi.Pointer _objc_msgSend_31( ffi.Pointer obj, ffi.Pointer sel, @@ -775,6 +888,11 @@ class StringTestObjCLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_initWithInteger_1 = + _registerName1("initWithInteger:"); + late final ffi.Pointer _sel_initWithUnsignedInteger_1 = + _registerName1("initWithUnsignedInteger:"); + late final ffi.Pointer _sel_charValue1 = _registerName1("charValue"); int _objc_msgSend_32( ffi.Pointer obj, ffi.Pointer sel, @@ -792,6 +910,8 @@ class StringTestObjCLibrary { late final __objc_msgSend_32 = __objc_msgSend_32Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_unsignedCharValue1 = + _registerName1("unsignedCharValue"); int _objc_msgSend_33( ffi.Pointer obj, ffi.Pointer sel, @@ -809,6 +929,8 @@ class StringTestObjCLibrary { late final __objc_msgSend_33 = __objc_msgSend_33Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_shortValue1 = + _registerName1("shortValue"); int _objc_msgSend_34( ffi.Pointer obj, ffi.Pointer sel, @@ -826,6 +948,8 @@ class StringTestObjCLibrary { late final __objc_msgSend_34 = __objc_msgSend_34Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_unsignedShortValue1 = + _registerName1("unsignedShortValue"); int _objc_msgSend_35( ffi.Pointer obj, ffi.Pointer sel, @@ -843,6 +967,7 @@ class StringTestObjCLibrary { late final __objc_msgSend_35 = __objc_msgSend_35Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_intValue1 = _registerName1("intValue"); int _objc_msgSend_36( ffi.Pointer obj, ffi.Pointer sel, @@ -860,6 +985,8 @@ class StringTestObjCLibrary { late final __objc_msgSend_36 = __objc_msgSend_36Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_unsignedIntValue1 = + _registerName1("unsignedIntValue"); int _objc_msgSend_37( ffi.Pointer obj, ffi.Pointer sel, @@ -877,6 +1004,7 @@ class StringTestObjCLibrary { late final __objc_msgSend_37 = __objc_msgSend_37Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_longValue1 = _registerName1("longValue"); int _objc_msgSend_38( ffi.Pointer obj, ffi.Pointer sel, @@ -894,6 +1022,10 @@ class StringTestObjCLibrary { late final __objc_msgSend_38 = __objc_msgSend_38Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_unsignedLongValue1 = + _registerName1("unsignedLongValue"); + late final ffi.Pointer _sel_longLongValue1 = + _registerName1("longLongValue"); int _objc_msgSend_39( ffi.Pointer obj, ffi.Pointer sel, @@ -911,6 +1043,8 @@ class StringTestObjCLibrary { late final __objc_msgSend_39 = __objc_msgSend_39Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_unsignedLongLongValue1 = + _registerName1("unsignedLongLongValue"); int _objc_msgSend_40( ffi.Pointer obj, ffi.Pointer sel, @@ -928,6 +1062,8 @@ class StringTestObjCLibrary { late final __objc_msgSend_40 = __objc_msgSend_40Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_floatValue1 = + _registerName1("floatValue"); double _objc_msgSend_41( ffi.Pointer obj, ffi.Pointer sel, @@ -945,6 +1081,8 @@ class StringTestObjCLibrary { late final __objc_msgSend_41 = __objc_msgSend_41Ptr.asFunction< double Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_doubleValue1 = + _registerName1("doubleValue"); double _objc_msgSend_42( ffi.Pointer obj, ffi.Pointer sel, @@ -962,6 +1100,14 @@ class StringTestObjCLibrary { late final __objc_msgSend_42 = __objc_msgSend_42Ptr.asFunction< double Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_boolValue1 = _registerName1("boolValue"); + late final ffi.Pointer _sel_integerValue1 = + _registerName1("integerValue"); + late final ffi.Pointer _sel_unsignedIntegerValue1 = + _registerName1("unsignedIntegerValue"); + late final ffi.Pointer _sel_stringValue1 = + _registerName1("stringValue"); + late final ffi.Pointer _sel_compare_1 = _registerName1("compare:"); int _objc_msgSend_43( ffi.Pointer obj, ffi.Pointer sel, @@ -982,6 +1128,10 @@ class StringTestObjCLibrary { int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_isEqualToNumber_1 = + _registerName1("isEqualToNumber:"); + late final ffi.Pointer _sel_descriptionWithLocale_1 = + _registerName1("descriptionWithLocale:"); ffi.Pointer _objc_msgSend_44( ffi.Pointer obj, ffi.Pointer sel, @@ -1002,6 +1152,15 @@ class StringTestObjCLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _class_NSEnumerator1 = + _getClass1("NSEnumerator"); + late final ffi.Pointer _sel_nextObject1 = + _registerName1("nextObject"); + late final ffi.Pointer _class_NSOrderedCollectionChange1 = + _getClass1("NSOrderedCollectionChange"); + late final ffi.Pointer _sel_object1 = _registerName1("object"); + late final ffi.Pointer _sel_changeType1 = + _registerName1("changeType"); int _objc_msgSend_45( ffi.Pointer obj, ffi.Pointer sel, @@ -1019,6 +1178,11 @@ class StringTestObjCLibrary { late final __objc_msgSend_45 = __objc_msgSend_45Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_index1 = _registerName1("index"); + late final ffi.Pointer _sel_associatedIndex1 = + _registerName1("associatedIndex"); + late final ffi.Pointer _sel_initWithObject_type_index_1 = + _registerName1("initWithObject:type:index:"); instancetype _objc_msgSend_46( ffi.Pointer obj, ffi.Pointer sel, @@ -1043,6 +1207,9 @@ class StringTestObjCLibrary { instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, int)>(); + late final ffi.Pointer + _sel_initWithObject_type_index_associatedIndex_1 = + _registerName1("initWithObject:type:index:associatedIndex:"); instancetype _objc_msgSend_47( ffi.Pointer obj, ffi.Pointer sel, @@ -1074,6 +1241,11 @@ class StringTestObjCLibrary { instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, int, int)>(); + late final ffi.Pointer _class_NSIndexSet1 = + _getClass1("NSIndexSet"); + late final ffi.Pointer _sel_indexSet1 = _registerName1("indexSet"); + late final ffi.Pointer _sel_indexSetWithIndex_1 = + _registerName1("indexSetWithIndex:"); instancetype _objc_msgSend_48( ffi.Pointer obj, ffi.Pointer sel, @@ -1094,6 +1266,8 @@ class StringTestObjCLibrary { instancetype Function( ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_indexSetWithIndexesInRange_1 = + _registerName1("indexSetWithIndexesInRange:"); instancetype _objc_msgSend_49( ffi.Pointer obj, ffi.Pointer sel, @@ -1114,6 +1288,20 @@ class StringTestObjCLibrary { instancetype Function( ffi.Pointer, ffi.Pointer, NSRange)>(); + late final ffi.Pointer _sel_initWithIndexesInRange_1 = + _registerName1("initWithIndexesInRange:"); + late final ffi.Pointer _sel_initWithIndexSet_1 = + _registerName1("initWithIndexSet:"); + late final ffi.Pointer _sel_initWithIndex_1 = + _registerName1("initWithIndex:"); + late final ffi.Pointer _sel_isEqualToIndexSet_1 = + _registerName1("isEqualToIndexSet:"); + late final ffi.Pointer _sel_count1 = _registerName1("count"); + late final ffi.Pointer _sel_firstIndex1 = + _registerName1("firstIndex"); + late final ffi.Pointer _sel_lastIndex1 = _registerName1("lastIndex"); + late final ffi.Pointer _sel_indexGreaterThanIndex_1 = + _registerName1("indexGreaterThanIndex:"); int _objc_msgSend_50( ffi.Pointer obj, ffi.Pointer sel, @@ -1133,6 +1321,14 @@ class StringTestObjCLibrary { late final __objc_msgSend_50 = __objc_msgSend_50Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_indexLessThanIndex_1 = + _registerName1("indexLessThanIndex:"); + late final ffi.Pointer _sel_indexGreaterThanOrEqualToIndex_1 = + _registerName1("indexGreaterThanOrEqualToIndex:"); + late final ffi.Pointer _sel_indexLessThanOrEqualToIndex_1 = + _registerName1("indexLessThanOrEqualToIndex:"); + late final ffi.Pointer _sel_getIndexes_maxCount_inIndexRange_1 = + _registerName1("getIndexes:maxCount:inIndexRange:"); int _objc_msgSend_51( ffi.Pointer obj, ffi.Pointer sel, @@ -1161,6 +1357,8 @@ class StringTestObjCLibrary { int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, NSRangePointer)>(); + late final ffi.Pointer _sel_countOfIndexesInRange_1 = + _registerName1("countOfIndexesInRange:"); int _objc_msgSend_52( ffi.Pointer obj, ffi.Pointer sel, @@ -1180,6 +1378,8 @@ class StringTestObjCLibrary { late final __objc_msgSend_52 = __objc_msgSend_52Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + late final ffi.Pointer _sel_containsIndex_1 = + _registerName1("containsIndex:"); bool _objc_msgSend_53( ffi.Pointer obj, ffi.Pointer sel, @@ -1200,6 +1400,8 @@ class StringTestObjCLibrary { late final __objc_msgSend_53 = __objc_msgSend_53Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_containsIndexesInRange_1 = + _registerName1("containsIndexesInRange:"); bool _objc_msgSend_54( ffi.Pointer obj, ffi.Pointer sel, @@ -1220,6 +1422,15 @@ class StringTestObjCLibrary { late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + late final ffi.Pointer _sel_containsIndexes_1 = + _registerName1("containsIndexes:"); + late final ffi.Pointer _sel_intersectsIndexesInRange_1 = + _registerName1("intersectsIndexesInRange:"); + late final ffi.Pointer _sel_enumerateIndexesUsingBlock_1 = + _registerName1("enumerateIndexesUsingBlock:"); + late final ffi.Pointer + _sel_enumerateIndexesWithOptions_usingBlock_1 = + _registerName1("enumerateIndexesWithOptions:usingBlock:"); void _objc_msgSend_55( ffi.Pointer obj, ffi.Pointer sel, @@ -1242,6 +1453,9 @@ class StringTestObjCLibrary { void Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); + late final ffi.Pointer + _sel_enumerateIndexesInRange_options_usingBlock_1 = + _registerName1("enumerateIndexesInRange:options:usingBlock:"); void _objc_msgSend_56( ffi.Pointer obj, ffi.Pointer sel, @@ -1266,6 +1480,8 @@ class StringTestObjCLibrary { void Function(ffi.Pointer, ffi.Pointer, NSRange, int, ffi.Pointer)>(); + late final ffi.Pointer _sel_indexPassingTest_1 = + _registerName1("indexPassingTest:"); int _objc_msgSend_57( ffi.Pointer obj, ffi.Pointer sel, @@ -1286,6 +1502,8 @@ class StringTestObjCLibrary { int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_indexWithOptions_passingTest_1 = + _registerName1("indexWithOptions:passingTest:"); int _objc_msgSend_58( ffi.Pointer obj, ffi.Pointer sel, @@ -1308,6 +1526,8 @@ class StringTestObjCLibrary { int Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); + late final ffi.Pointer _sel_indexInRange_options_passingTest_1 = + _registerName1("indexInRange:options:passingTest:"); int _objc_msgSend_59( ffi.Pointer obj, ffi.Pointer sel, @@ -1332,6 +1552,8 @@ class StringTestObjCLibrary { int Function(ffi.Pointer, ffi.Pointer, NSRange, int, ffi.Pointer)>(); + late final ffi.Pointer _sel_indexesPassingTest_1 = + _registerName1("indexesPassingTest:"); ffi.Pointer _objc_msgSend_60( ffi.Pointer obj, ffi.Pointer sel, @@ -1352,6 +1574,8 @@ class StringTestObjCLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_indexesWithOptions_passingTest_1 = + _registerName1("indexesWithOptions:passingTest:"); ffi.Pointer _objc_msgSend_61( ffi.Pointer obj, ffi.Pointer sel, @@ -1377,6 +1601,8 @@ class StringTestObjCLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); + late final ffi.Pointer _sel_indexesInRange_options_passingTest_1 = + _registerName1("indexesInRange:options:passingTest:"); ffi.Pointer _objc_msgSend_62( ffi.Pointer obj, ffi.Pointer sel, @@ -1405,6 +1631,22 @@ class StringTestObjCLibrary { ffi.Pointer Function(ffi.Pointer, ffi.Pointer, NSRange, int, ffi.Pointer)>(); + late final ffi.Pointer _sel_enumerateRangesUsingBlock_1 = + _registerName1("enumerateRangesUsingBlock:"); + late final ffi.Pointer _sel_enumerateRangesWithOptions_usingBlock_1 = + _registerName1("enumerateRangesWithOptions:usingBlock:"); + late final ffi.Pointer + _sel_enumerateRangesInRange_options_usingBlock_1 = + _registerName1("enumerateRangesInRange:options:usingBlock:"); + late final ffi.Pointer _class_NSMutableIndexSet1 = + _getClass1("NSMutableIndexSet"); + late final ffi.Pointer _sel_addIndexes_1 = + _registerName1("addIndexes:"); + late final ffi.Pointer _sel_removeIndexes_1 = + _registerName1("removeIndexes:"); + late final ffi.Pointer _sel_removeAllIndexes1 = + _registerName1("removeAllIndexes"); + late final ffi.Pointer _sel_addIndex_1 = _registerName1("addIndex:"); void _objc_msgSend_63( ffi.Pointer obj, ffi.Pointer sel, @@ -1424,6 +1666,10 @@ class StringTestObjCLibrary { late final __objc_msgSend_63 = __objc_msgSend_63Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_removeIndex_1 = + _registerName1("removeIndex:"); + late final ffi.Pointer _sel_addIndexesInRange_1 = + _registerName1("addIndexesInRange:"); void _objc_msgSend_64( ffi.Pointer obj, ffi.Pointer sel, @@ -1443,6 +1689,10 @@ class StringTestObjCLibrary { late final __objc_msgSend_64 = __objc_msgSend_64Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + late final ffi.Pointer _sel_removeIndexesInRange_1 = + _registerName1("removeIndexesInRange:"); + late final ffi.Pointer _sel_shiftIndexesStartingAtIndex_by_1 = + _registerName1("shiftIndexesStartingAtIndex:by:"); void _objc_msgSend_65( ffi.Pointer obj, ffi.Pointer sel, @@ -1464,6 +1714,14 @@ class StringTestObjCLibrary { late final __objc_msgSend_65 = __objc_msgSend_65Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int, int)>(); + late final ffi.Pointer _class_NSOrderedCollectionDifference1 = + _getClass1("NSOrderedCollectionDifference"); + late final ffi.Pointer _sel_initWithChanges_1 = + _registerName1("initWithChanges:"); + late final ffi.Pointer + _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges_1 = + _registerName1( + "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:additionalChanges:"); instancetype _objc_msgSend_66( ffi.Pointer obj, ffi.Pointer sel, @@ -1504,6 +1762,10 @@ class StringTestObjCLibrary { ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer + _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_1 = + _registerName1( + "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:"); instancetype _objc_msgSend_67( ffi.Pointer obj, ffi.Pointer sel, @@ -1540,6 +1802,18 @@ class StringTestObjCLibrary { ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_insertions1 = + _registerName1("insertions"); + late final ffi.Pointer _sel_removals1 = _registerName1("removals"); + late final ffi.Pointer _sel_hasChanges1 = + _registerName1("hasChanges"); + late final ffi.Pointer _sel_inverseDifference1 = + _registerName1("inverseDifference"); + late final ffi.Pointer _class_NSArray1 = _getClass1("NSArray"); + late final ffi.Pointer _sel_objectAtIndex_1 = + _registerName1("objectAtIndex:"); + late final ffi.Pointer _sel_initWithObjects_count_1 = + _registerName1("initWithObjects:count:"); instancetype _objc_msgSend_68( ffi.Pointer obj, ffi.Pointer sel, @@ -1565,6 +1839,12 @@ class StringTestObjCLibrary { instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer>, int)>(); + late final ffi.Pointer _class_NSMutableArray1 = + _getClass1("NSMutableArray"); + late final ffi.Pointer _sel_addObject_1 = + _registerName1("addObject:"); + late final ffi.Pointer _sel_insertObject_atIndex_1 = + _registerName1("insertObject:atIndex:"); void _objc_msgSend_69( ffi.Pointer obj, ffi.Pointer sel, @@ -1587,6 +1867,12 @@ class StringTestObjCLibrary { void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _sel_removeLastObject1 = + _registerName1("removeLastObject"); + late final ffi.Pointer _sel_removeObjectAtIndex_1 = + _registerName1("removeObjectAtIndex:"); + late final ffi.Pointer _sel_replaceObjectAtIndex_withObject_1 = + _registerName1("replaceObjectAtIndex:withObject:"); void _objc_msgSend_70( ffi.Pointer obj, ffi.Pointer sel, @@ -1609,6 +1895,14 @@ class StringTestObjCLibrary { void Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); + late final ffi.Pointer _sel_initWithCapacity_1 = + _registerName1("initWithCapacity:"); + late final ffi.Pointer _class_NSItemProvider1 = + _getClass1("NSItemProvider"); + late final ffi.Pointer + _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1 = + _registerName1( + "registerDataRepresentationForTypeIdentifier:visibility:loadHandler:"); void _objc_msgSend_71( ffi.Pointer obj, ffi.Pointer sel, @@ -1637,6 +1931,10 @@ class StringTestObjCLibrary { void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); + late final ffi.Pointer + _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1 = + _registerName1( + "registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:"); void _objc_msgSend_72( ffi.Pointer obj, ffi.Pointer sel, @@ -1668,6 +1966,14 @@ class StringTestObjCLibrary { void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, int, ffi.Pointer)>(); + late final ffi.Pointer _sel_registeredTypeIdentifiers1 = + _registerName1("registeredTypeIdentifiers"); + late final ffi.Pointer _sel_hasItemConformingToTypeIdentifier_1 = + _registerName1("hasItemConformingToTypeIdentifier:"); + late final ffi.Pointer + _sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1 = + _registerName1( + "hasRepresentationConformingToTypeIdentifier:fileOptions:"); bool _objc_msgSend_73( ffi.Pointer obj, ffi.Pointer sel, @@ -1691,6 +1997,12 @@ class StringTestObjCLibrary { int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _class_NSProgress1 = + _getClass1("NSProgress"); + late final ffi.Pointer + _sel_loadDataRepresentationForTypeIdentifier_completionHandler_1 = + _registerName1( + "loadDataRepresentationForTypeIdentifier:completionHandler:"); ffi.Pointer _objc_msgSend_74( ffi.Pointer obj, ffi.Pointer sel, @@ -1719,6 +2031,22 @@ class StringTestObjCLibrary { ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer + _sel_loadFileRepresentationForTypeIdentifier_completionHandler_1 = + _registerName1( + "loadFileRepresentationForTypeIdentifier:completionHandler:"); + late final ffi.Pointer + _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1 = + _registerName1( + "loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:"); + late final ffi.Pointer _sel_suggestedName1 = + _registerName1("suggestedName"); + late final ffi.Pointer _sel_setSuggestedName_1 = + _registerName1("setSuggestedName:"); + late final ffi.Pointer _sel_initWithObject_1 = + _registerName1("initWithObject:"); + late final ffi.Pointer _sel_registerObject_visibility_1 = + _registerName1("registerObject:visibility:"); void _objc_msgSend_75( ffi.Pointer obj, ffi.Pointer sel, @@ -1741,6 +2069,15 @@ class StringTestObjCLibrary { void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer + _sel_registerObjectOfClass_visibility_loadHandler_1 = + _registerName1("registerObjectOfClass:visibility:loadHandler:"); + late final ffi.Pointer _sel_canLoadObjectOfClass_1 = + _registerName1("canLoadObjectOfClass:"); + late final ffi.Pointer _sel_loadObjectOfClass_completionHandler_1 = + _registerName1("loadObjectOfClass:completionHandler:"); + late final ffi.Pointer _sel_initWithItem_typeIdentifier_1 = + _registerName1("initWithItem:typeIdentifier:"); instancetype _objc_msgSend_76( ffi.Pointer obj, ffi.Pointer sel, @@ -1766,6 +2103,11 @@ class StringTestObjCLibrary { instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_initWithContentsOfURL_1 = + _registerName1("initWithContentsOfURL:"); + late final ffi.Pointer + _sel_registerItemForTypeIdentifier_loadHandler_1 = + _registerName1("registerItemForTypeIdentifier:loadHandler:"); void _objc_msgSend_77( ffi.Pointer obj, ffi.Pointer sel, @@ -1791,6 +2133,9 @@ class StringTestObjCLibrary { void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSItemProviderLoadHandler)>(); + late final ffi.Pointer + _sel_loadItemForTypeIdentifier_options_completionHandler_1 = + _registerName1("loadItemForTypeIdentifier:options:completionHandler:"); void _objc_msgSend_78( ffi.Pointer obj, ffi.Pointer sel, @@ -2103,6 +2448,10 @@ class StringTestObjCLibrary { NSStringEncodingDetectionOptionsKey value) => _NSStringEncodingDetectionLikelyLanguageKey.value = value; + late final ffi.Pointer _class_NSMutableString1 = + _getClass1("NSMutableString"); + late final ffi.Pointer _sel_replaceCharactersInRange_withString_1 = + _registerName1("replaceCharactersInRange:withString:"); void _objc_msgSend_79( ffi.Pointer obj, ffi.Pointer sel, @@ -2142,6 +2491,14 @@ class StringTestObjCLibrary { set NSParseErrorException(NSExceptionName value) => _NSParseErrorException.value = value; + late final ffi.Pointer _class_NSSimpleCString1 = + _getClass1("NSSimpleCString"); + late final ffi.Pointer _class_NSConstantString1 = + _getClass1("NSConstantString"); + late final ffi.Pointer _class_StringUtil1 = + _getClass1("StringUtil"); + late final ffi.Pointer _sel_strConcat_with_1 = + _registerName1("strConcat:with:"); ffi.Pointer _objc_msgSend_80( ffi.Pointer obj, ffi.Pointer sel, @@ -2267,20 +2624,6 @@ typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< ffi.NativeFunction< CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; -ffi.Pointer _registerName(StringTestObjCLibrary _lib, String name) { - final cstr = name.toNativeUtf8(); - final sel = _lib._sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; -} - -ffi.Pointer _getClass(StringTestObjCLibrary _lib, String name) { - final cstr = name.toNativeUtf8(); - final clazz = _lib._objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return clazz; -} - class _ObjCWrapper { final ffi.Pointer _id; final StringTestObjCLibrary _lib; @@ -2291,327 +2634,228 @@ class NSValue extends NSObject { NSValue._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSValue castFrom(T other) { return NSValue._(other._id, other._lib); } - static ffi.Pointer? _sel_getValue_size; void getValue_size(ffi.Pointer value, int size) { - _sel_getValue_size ??= _registerName(_lib, "getValue:size:"); - _lib._objc_msgSend_17(_id, _sel_getValue_size!, value, size); + _lib._objc_msgSend_17(_id, _lib._sel_getValue_size_1, value, size); } - static ffi.Pointer? _sel_objCType; ffi.Pointer get objCType { - _sel_objCType ??= _registerName(_lib, "objCType"); - return _lib._objc_msgSend_15(_id, _sel_objCType!); + return _lib._objc_msgSend_15(_id, _lib._sel_objCType1); } - static ffi.Pointer? _sel_initWithBytes_objCType; NSValue initWithBytes_objCType( ffi.Pointer value, ffi.Pointer type) { - _sel_initWithBytes_objCType ??= - _registerName(_lib, "initWithBytes:objCType:"); - final _ret = - _lib._objc_msgSend_18(_id, _sel_initWithBytes_objCType!, value, type); + final _ret = _lib._objc_msgSend_18( + _id, _lib._sel_initWithBytes_objCType_1, value, type); return NSValue._(_ret, _lib); } - static ffi.Pointer? _sel_initWithCoder; NSValue initWithCoder(NSObject coder) { - _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_13(_id, _sel_initWithCoder!, coder._id); + final _ret = + _lib._objc_msgSend_13(_id, _lib._sel_initWithCoder_1, coder._id); return NSValue._(_ret, _lib); } - static ffi.Pointer? _sel_new1; static NSValue new1(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSValue"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSValue1, _lib._sel_new1); return NSValue._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static NSValue alloc(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSValue"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSValue1, _lib._sel_alloc1); return NSValue._(_ret, _lib); } } +class ObjCSel extends ffi.Opaque {} + +class ObjCObject extends ffi.Opaque {} + class NSObject extends _ObjCWrapper { NSObject._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSObject castFrom(T other) { return NSObject._(other._id, other._lib); } - static ffi.Pointer? _sel_load; static void load(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_load ??= _registerName(_lib, "load"); - _lib._objc_msgSend_0(_class!, _sel_load!); + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); } - static ffi.Pointer? _sel_initialize; static void initialize(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_initialize ??= _registerName(_lib, "initialize"); - _lib._objc_msgSend_0(_class!, _sel_initialize!); + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); } - static ffi.Pointer? _sel_init; NSObject init() { - _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_new1; static NSObject new1(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_allocWithZone; static NSObject allocWithZone( StringTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_allocWithZone ??= _registerName(_lib, "allocWithZone:"); - final _ret = _lib._objc_msgSend_2(_class!, _sel_allocWithZone!, zone); + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static NSObject alloc(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_dealloc; void dealloc() { - _sel_dealloc ??= _registerName(_lib, "dealloc"); - _lib._objc_msgSend_0(_id, _sel_dealloc!); + _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); } - static ffi.Pointer? _sel_finalize; void finalize() { - _sel_finalize ??= _registerName(_lib, "finalize"); - _lib._objc_msgSend_0(_id, _sel_finalize!); + _lib._objc_msgSend_0(_id, _lib._sel_finalize1); } - static ffi.Pointer? _sel_copy; NSObject copy() { - _sel_copy ??= _registerName(_lib, "copy"); - final _ret = _lib._objc_msgSend_1(_id, _sel_copy!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_mutableCopy; NSObject mutableCopy() { - _sel_mutableCopy ??= _registerName(_lib, "mutableCopy"); - final _ret = _lib._objc_msgSend_1(_id, _sel_mutableCopy!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_copyWithZone; static NSObject copyWithZone( StringTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_copyWithZone ??= _registerName(_lib, "copyWithZone:"); - final _ret = _lib._objc_msgSend_2(_class!, _sel_copyWithZone!, zone); + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_mutableCopyWithZone; static NSObject mutableCopyWithZone( StringTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - _class ??= _getClass(_lib, "NSObject"); - _sel_mutableCopyWithZone ??= _registerName(_lib, "mutableCopyWithZone:"); - final _ret = _lib._objc_msgSend_2(_class!, _sel_mutableCopyWithZone!, zone); + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_instancesRespondToSelector; static bool instancesRespondToSelector( StringTestObjCLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instancesRespondToSelector ??= - _registerName(_lib, "instancesRespondToSelector:"); - return _lib._objc_msgSend_3( - _class!, _sel_instancesRespondToSelector!, aSelector); + return _lib._objc_msgSend_3(_lib._class_NSObject1, + _lib._sel_instancesRespondToSelector_1, aSelector); } - static ffi.Pointer? _sel_conformsToProtocol; static bool conformsToProtocol( StringTestObjCLibrary _lib, NSObject protocol) { - _class ??= _getClass(_lib, "NSObject"); - _sel_conformsToProtocol ??= _registerName(_lib, "conformsToProtocol:"); return _lib._objc_msgSend_4( - _class!, _sel_conformsToProtocol!, protocol._id); + _lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol._id); } - static ffi.Pointer? _sel_methodForSelector; IMP methodForSelector(ffi.Pointer aSelector) { - _sel_methodForSelector ??= _registerName(_lib, "methodForSelector:"); - return _lib._objc_msgSend_5(_id, _sel_methodForSelector!, aSelector); + return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); } - static ffi.Pointer? _sel_instanceMethodForSelector; static IMP instanceMethodForSelector( StringTestObjCLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instanceMethodForSelector ??= - _registerName(_lib, "instanceMethodForSelector:"); - return _lib._objc_msgSend_5( - _class!, _sel_instanceMethodForSelector!, aSelector); + return _lib._objc_msgSend_5(_lib._class_NSObject1, + _lib._sel_instanceMethodForSelector_1, aSelector); } - static ffi.Pointer? _sel_doesNotRecognizeSelector; void doesNotRecognizeSelector(ffi.Pointer aSelector) { - _sel_doesNotRecognizeSelector ??= - _registerName(_lib, "doesNotRecognizeSelector:"); - _lib._objc_msgSend_6(_id, _sel_doesNotRecognizeSelector!, aSelector); + _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); } - static ffi.Pointer? _sel_forwardingTargetForSelector; NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { - _sel_forwardingTargetForSelector ??= - _registerName(_lib, "forwardingTargetForSelector:"); - final _ret = - _lib._objc_msgSend_7(_id, _sel_forwardingTargetForSelector!, aSelector); + final _ret = _lib._objc_msgSend_7( + _id, _lib._sel_forwardingTargetForSelector_1, aSelector); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_forwardInvocation; void forwardInvocation(NSObject anInvocation) { - _sel_forwardInvocation ??= _registerName(_lib, "forwardInvocation:"); - _lib._objc_msgSend_8(_id, _sel_forwardInvocation!, anInvocation._id); + _lib._objc_msgSend_8(_id, _lib._sel_forwardInvocation_1, anInvocation._id); } - static ffi.Pointer? _sel_methodSignatureForSelector; NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { - _sel_methodSignatureForSelector ??= - _registerName(_lib, "methodSignatureForSelector:"); - final _ret = - _lib._objc_msgSend_9(_id, _sel_methodSignatureForSelector!, aSelector); + final _ret = _lib._objc_msgSend_9( + _id, _lib._sel_methodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static ffi.Pointer? _sel_instanceMethodSignatureForSelector; static NSMethodSignature instanceMethodSignatureForSelector( StringTestObjCLibrary _lib, ffi.Pointer aSelector) { - _class ??= _getClass(_lib, "NSObject"); - _sel_instanceMethodSignatureForSelector ??= - _registerName(_lib, "instanceMethodSignatureForSelector:"); - final _ret = _lib._objc_msgSend_9( - _class!, _sel_instanceMethodSignatureForSelector!, aSelector); + final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, + _lib._sel_instanceMethodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static ffi.Pointer? _sel_allowsWeakReference; bool allowsWeakReference() { - _sel_allowsWeakReference ??= _registerName(_lib, "allowsWeakReference"); - return _lib._objc_msgSend_10(_id, _sel_allowsWeakReference!); + return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); } - static ffi.Pointer? _sel_retainWeakReference; bool retainWeakReference() { - _sel_retainWeakReference ??= _registerName(_lib, "retainWeakReference"); - return _lib._objc_msgSend_10(_id, _sel_retainWeakReference!); + return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); } - static ffi.Pointer? _sel_isSubclassOfClass; static bool isSubclassOfClass(StringTestObjCLibrary _lib, NSObject aClass) { - _class ??= _getClass(_lib, "NSObject"); - _sel_isSubclassOfClass ??= _registerName(_lib, "isSubclassOfClass:"); - return _lib._objc_msgSend_4(_class!, _sel_isSubclassOfClass!, aClass._id); + return _lib._objc_msgSend_4( + _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); } - static ffi.Pointer? _sel_resolveClassMethod; static bool resolveClassMethod( StringTestObjCLibrary _lib, ffi.Pointer sel) { - _class ??= _getClass(_lib, "NSObject"); - _sel_resolveClassMethod ??= _registerName(_lib, "resolveClassMethod:"); - return _lib._objc_msgSend_3(_class!, _sel_resolveClassMethod!, sel); + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); } - static ffi.Pointer? _sel_resolveInstanceMethod; static bool resolveInstanceMethod( StringTestObjCLibrary _lib, ffi.Pointer sel) { - _class ??= _getClass(_lib, "NSObject"); - _sel_resolveInstanceMethod ??= - _registerName(_lib, "resolveInstanceMethod:"); - return _lib._objc_msgSend_3(_class!, _sel_resolveInstanceMethod!, sel); + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); } - static ffi.Pointer? _sel_hash; static int hash(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_hash ??= _registerName(_lib, "hash"); - return _lib._objc_msgSend_11(_class!, _sel_hash!); + return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); } - static ffi.Pointer? _sel_superclass; static NSObject superclass(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_superclass ??= _registerName(_lib, "superclass"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_superclass!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_class1; static NSObject class1(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_class1 ??= _registerName(_lib, "class"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_class1!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_description; static NSString description(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_description ??= _registerName(_lib, "description"); - final _ret = _lib._objc_msgSend_16(_class!, _sel_description!); + final _ret = + _lib._objc_msgSend_16(_lib._class_NSObject1, _lib._sel_description1); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_debugDescription; static NSString debugDescription(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSObject"); - _sel_debugDescription ??= _registerName(_lib, "debugDescription"); - final _ret = _lib._objc_msgSend_16(_class!, _sel_debugDescription!); + final _ret = _lib._objc_msgSend_16( + _lib._class_NSObject1, _lib._sel_debugDescription1); return NSString._(_ret, _lib); } } typedef instancetype = ffi.Pointer; -class ObjCObject extends ffi.Opaque {} - class _NSZone extends ffi.Opaque {} -class ObjCSel extends ffi.Opaque {} - typedef IMP = ffi.Pointer>; class NSMethodSignature extends _ObjCWrapper { NSMethodSignature._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSMethodSignature castFrom(T other) { return NSMethodSignature._(other._id, other._lib); } @@ -2623,8 +2867,6 @@ class NSString extends NSObject { NSString._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSString castFrom(T other) { return NSString._(other._id, other._lib); } @@ -2639,63 +2881,44 @@ class NSString extends NSObject { @override String toString() => UTF8String().cast().toDartString(); - static ffi.Pointer? _sel_length; int get length { - _sel_length ??= _registerName(_lib, "length"); - return _lib._objc_msgSend_11(_id, _sel_length!); + return _lib._objc_msgSend_11(_id, _lib._sel_length1); } - static ffi.Pointer? _sel_characterAtIndex; int characterAtIndex(int index) { - _sel_characterAtIndex ??= _registerName(_lib, "characterAtIndex:"); - return _lib._objc_msgSend_12(_id, _sel_characterAtIndex!, index); + return _lib._objc_msgSend_12(_id, _lib._sel_characterAtIndex_1, index); } - static ffi.Pointer? _sel_init; @override NSString init() { - _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_initWithCoder; NSString initWithCoder(NSObject coder) { - _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_13(_id, _sel_initWithCoder!, coder._id); + final _ret = + _lib._objc_msgSend_13(_id, _lib._sel_initWithCoder_1, coder._id); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_stringWithCString_encoding; static NSString stringWithCString_encoding( StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { - _class ??= _getClass(_lib, "NSString"); - _sel_stringWithCString_encoding ??= - _registerName(_lib, "stringWithCString:encoding:"); - final _ret = _lib._objc_msgSend_14( - _class!, _sel_stringWithCString_encoding!, cString, enc); + final _ret = _lib._objc_msgSend_14(_lib._class_NSString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_UTF8String; ffi.Pointer UTF8String() { - _sel_UTF8String ??= _registerName(_lib, "UTF8String"); - return _lib._objc_msgSend_15(_id, _sel_UTF8String!); + return _lib._objc_msgSend_15(_id, _lib._sel_UTF8String1); } - static ffi.Pointer? _sel_new1; static NSString new1(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSString"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSString1, _lib._sel_new1); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static NSString alloc(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSString"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSString1, _lib._sel_alloc1); return NSString._(_ret, _lib); } } @@ -2710,261 +2933,185 @@ class NSNumber extends NSValue { NSNumber._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSNumber castFrom(T other) { return NSNumber._(other._id, other._lib); } - static ffi.Pointer? _sel_initWithCoder; @override NSNumber initWithCoder(NSObject coder) { - _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_13(_id, _sel_initWithCoder!, coder._id); + final _ret = + _lib._objc_msgSend_13(_id, _lib._sel_initWithCoder_1, coder._id); return NSNumber._(_ret, _lib); } - static ffi.Pointer? _sel_initWithChar; NSNumber initWithChar(int value) { - _sel_initWithChar ??= _registerName(_lib, "initWithChar:"); - final _ret = _lib._objc_msgSend_19(_id, _sel_initWithChar!, value); + final _ret = _lib._objc_msgSend_19(_id, _lib._sel_initWithChar_1, value); return NSNumber._(_ret, _lib); } - static ffi.Pointer? _sel_initWithUnsignedChar; NSNumber initWithUnsignedChar(int value) { - _sel_initWithUnsignedChar ??= _registerName(_lib, "initWithUnsignedChar:"); - final _ret = _lib._objc_msgSend_20(_id, _sel_initWithUnsignedChar!, value); + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_initWithUnsignedChar_1, value); return NSNumber._(_ret, _lib); } - static ffi.Pointer? _sel_initWithShort; NSNumber initWithShort(int value) { - _sel_initWithShort ??= _registerName(_lib, "initWithShort:"); - final _ret = _lib._objc_msgSend_21(_id, _sel_initWithShort!, value); + final _ret = _lib._objc_msgSend_21(_id, _lib._sel_initWithShort_1, value); return NSNumber._(_ret, _lib); } - static ffi.Pointer? _sel_initWithUnsignedShort; NSNumber initWithUnsignedShort(int value) { - _sel_initWithUnsignedShort ??= - _registerName(_lib, "initWithUnsignedShort:"); - final _ret = _lib._objc_msgSend_22(_id, _sel_initWithUnsignedShort!, value); + final _ret = + _lib._objc_msgSend_22(_id, _lib._sel_initWithUnsignedShort_1, value); return NSNumber._(_ret, _lib); } - static ffi.Pointer? _sel_initWithInt; NSNumber initWithInt(int value) { - _sel_initWithInt ??= _registerName(_lib, "initWithInt:"); - final _ret = _lib._objc_msgSend_23(_id, _sel_initWithInt!, value); + final _ret = _lib._objc_msgSend_23(_id, _lib._sel_initWithInt_1, value); return NSNumber._(_ret, _lib); } - static ffi.Pointer? _sel_initWithUnsignedInt; NSNumber initWithUnsignedInt(int value) { - _sel_initWithUnsignedInt ??= _registerName(_lib, "initWithUnsignedInt:"); - final _ret = _lib._objc_msgSend_24(_id, _sel_initWithUnsignedInt!, value); + final _ret = + _lib._objc_msgSend_24(_id, _lib._sel_initWithUnsignedInt_1, value); return NSNumber._(_ret, _lib); } - static ffi.Pointer? _sel_initWithLong; NSNumber initWithLong(int value) { - _sel_initWithLong ??= _registerName(_lib, "initWithLong:"); - final _ret = _lib._objc_msgSend_25(_id, _sel_initWithLong!, value); + final _ret = _lib._objc_msgSend_25(_id, _lib._sel_initWithLong_1, value); return NSNumber._(_ret, _lib); } - static ffi.Pointer? _sel_initWithUnsignedLong; NSNumber initWithUnsignedLong(int value) { - _sel_initWithUnsignedLong ??= _registerName(_lib, "initWithUnsignedLong:"); - final _ret = _lib._objc_msgSend_26(_id, _sel_initWithUnsignedLong!, value); + final _ret = + _lib._objc_msgSend_26(_id, _lib._sel_initWithUnsignedLong_1, value); return NSNumber._(_ret, _lib); } - static ffi.Pointer? _sel_initWithLongLong; NSNumber initWithLongLong(int value) { - _sel_initWithLongLong ??= _registerName(_lib, "initWithLongLong:"); - final _ret = _lib._objc_msgSend_27(_id, _sel_initWithLongLong!, value); + final _ret = + _lib._objc_msgSend_27(_id, _lib._sel_initWithLongLong_1, value); return NSNumber._(_ret, _lib); } - static ffi.Pointer? _sel_initWithUnsignedLongLong; NSNumber initWithUnsignedLongLong(int value) { - _sel_initWithUnsignedLongLong ??= - _registerName(_lib, "initWithUnsignedLongLong:"); final _ret = - _lib._objc_msgSend_28(_id, _sel_initWithUnsignedLongLong!, value); + _lib._objc_msgSend_28(_id, _lib._sel_initWithUnsignedLongLong_1, value); return NSNumber._(_ret, _lib); } - static ffi.Pointer? _sel_initWithFloat; NSNumber initWithFloat(double value) { - _sel_initWithFloat ??= _registerName(_lib, "initWithFloat:"); - final _ret = _lib._objc_msgSend_29(_id, _sel_initWithFloat!, value); + final _ret = _lib._objc_msgSend_29(_id, _lib._sel_initWithFloat_1, value); return NSNumber._(_ret, _lib); } - static ffi.Pointer? _sel_initWithDouble; NSNumber initWithDouble(double value) { - _sel_initWithDouble ??= _registerName(_lib, "initWithDouble:"); - final _ret = _lib._objc_msgSend_30(_id, _sel_initWithDouble!, value); + final _ret = _lib._objc_msgSend_30(_id, _lib._sel_initWithDouble_1, value); return NSNumber._(_ret, _lib); } - static ffi.Pointer? _sel_initWithBool; NSNumber initWithBool(bool value) { - _sel_initWithBool ??= _registerName(_lib, "initWithBool:"); - final _ret = _lib._objc_msgSend_31(_id, _sel_initWithBool!, value); + final _ret = _lib._objc_msgSend_31(_id, _lib._sel_initWithBool_1, value); return NSNumber._(_ret, _lib); } - static ffi.Pointer? _sel_initWithInteger; NSNumber initWithInteger(int value) { - _sel_initWithInteger ??= _registerName(_lib, "initWithInteger:"); - final _ret = _lib._objc_msgSend_25(_id, _sel_initWithInteger!, value); + final _ret = _lib._objc_msgSend_25(_id, _lib._sel_initWithInteger_1, value); return NSNumber._(_ret, _lib); } - static ffi.Pointer? _sel_initWithUnsignedInteger; NSNumber initWithUnsignedInteger(int value) { - _sel_initWithUnsignedInteger ??= - _registerName(_lib, "initWithUnsignedInteger:"); final _ret = - _lib._objc_msgSend_26(_id, _sel_initWithUnsignedInteger!, value); + _lib._objc_msgSend_26(_id, _lib._sel_initWithUnsignedInteger_1, value); return NSNumber._(_ret, _lib); } - static ffi.Pointer? _sel_charValue; int get charValue { - _sel_charValue ??= _registerName(_lib, "charValue"); - return _lib._objc_msgSend_32(_id, _sel_charValue!); + return _lib._objc_msgSend_32(_id, _lib._sel_charValue1); } - static ffi.Pointer? _sel_unsignedCharValue; int get unsignedCharValue { - _sel_unsignedCharValue ??= _registerName(_lib, "unsignedCharValue"); - return _lib._objc_msgSend_33(_id, _sel_unsignedCharValue!); + return _lib._objc_msgSend_33(_id, _lib._sel_unsignedCharValue1); } - static ffi.Pointer? _sel_shortValue; int get shortValue { - _sel_shortValue ??= _registerName(_lib, "shortValue"); - return _lib._objc_msgSend_34(_id, _sel_shortValue!); + return _lib._objc_msgSend_34(_id, _lib._sel_shortValue1); } - static ffi.Pointer? _sel_unsignedShortValue; int get unsignedShortValue { - _sel_unsignedShortValue ??= _registerName(_lib, "unsignedShortValue"); - return _lib._objc_msgSend_35(_id, _sel_unsignedShortValue!); + return _lib._objc_msgSend_35(_id, _lib._sel_unsignedShortValue1); } - static ffi.Pointer? _sel_intValue; int get intValue { - _sel_intValue ??= _registerName(_lib, "intValue"); - return _lib._objc_msgSend_36(_id, _sel_intValue!); + return _lib._objc_msgSend_36(_id, _lib._sel_intValue1); } - static ffi.Pointer? _sel_unsignedIntValue; int get unsignedIntValue { - _sel_unsignedIntValue ??= _registerName(_lib, "unsignedIntValue"); - return _lib._objc_msgSend_37(_id, _sel_unsignedIntValue!); + return _lib._objc_msgSend_37(_id, _lib._sel_unsignedIntValue1); } - static ffi.Pointer? _sel_longValue; int get longValue { - _sel_longValue ??= _registerName(_lib, "longValue"); - return _lib._objc_msgSend_38(_id, _sel_longValue!); + return _lib._objc_msgSend_38(_id, _lib._sel_longValue1); } - static ffi.Pointer? _sel_unsignedLongValue; int get unsignedLongValue { - _sel_unsignedLongValue ??= _registerName(_lib, "unsignedLongValue"); - return _lib._objc_msgSend_11(_id, _sel_unsignedLongValue!); + return _lib._objc_msgSend_11(_id, _lib._sel_unsignedLongValue1); } - static ffi.Pointer? _sel_longLongValue; int get longLongValue { - _sel_longLongValue ??= _registerName(_lib, "longLongValue"); - return _lib._objc_msgSend_39(_id, _sel_longLongValue!); + return _lib._objc_msgSend_39(_id, _lib._sel_longLongValue1); } - static ffi.Pointer? _sel_unsignedLongLongValue; int get unsignedLongLongValue { - _sel_unsignedLongLongValue ??= _registerName(_lib, "unsignedLongLongValue"); - return _lib._objc_msgSend_40(_id, _sel_unsignedLongLongValue!); + return _lib._objc_msgSend_40(_id, _lib._sel_unsignedLongLongValue1); } - static ffi.Pointer? _sel_floatValue; double get floatValue { - _sel_floatValue ??= _registerName(_lib, "floatValue"); - return _lib._objc_msgSend_41(_id, _sel_floatValue!); + return _lib._objc_msgSend_41(_id, _lib._sel_floatValue1); } - static ffi.Pointer? _sel_doubleValue; double get doubleValue { - _sel_doubleValue ??= _registerName(_lib, "doubleValue"); - return _lib._objc_msgSend_42(_id, _sel_doubleValue!); + return _lib._objc_msgSend_42(_id, _lib._sel_doubleValue1); } - static ffi.Pointer? _sel_boolValue; bool get boolValue { - _sel_boolValue ??= _registerName(_lib, "boolValue"); - return _lib._objc_msgSend_10(_id, _sel_boolValue!); + return _lib._objc_msgSend_10(_id, _lib._sel_boolValue1); } - static ffi.Pointer? _sel_integerValue; int get integerValue { - _sel_integerValue ??= _registerName(_lib, "integerValue"); - return _lib._objc_msgSend_38(_id, _sel_integerValue!); + return _lib._objc_msgSend_38(_id, _lib._sel_integerValue1); } - static ffi.Pointer? _sel_unsignedIntegerValue; int get unsignedIntegerValue { - _sel_unsignedIntegerValue ??= _registerName(_lib, "unsignedIntegerValue"); - return _lib._objc_msgSend_11(_id, _sel_unsignedIntegerValue!); + return _lib._objc_msgSend_11(_id, _lib._sel_unsignedIntegerValue1); } - static ffi.Pointer? _sel_stringValue; NSObject get stringValue { - _sel_stringValue ??= _registerName(_lib, "stringValue"); - final _ret = _lib._objc_msgSend_1(_id, _sel_stringValue!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_stringValue1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_compare; int compare(NSObject otherNumber) { - _sel_compare ??= _registerName(_lib, "compare:"); - return _lib._objc_msgSend_43(_id, _sel_compare!, otherNumber._id); + return _lib._objc_msgSend_43(_id, _lib._sel_compare_1, otherNumber._id); } - static ffi.Pointer? _sel_isEqualToNumber; bool isEqualToNumber(NSObject number) { - _sel_isEqualToNumber ??= _registerName(_lib, "isEqualToNumber:"); - return _lib._objc_msgSend_4(_id, _sel_isEqualToNumber!, number._id); + return _lib._objc_msgSend_4(_id, _lib._sel_isEqualToNumber_1, number._id); } - static ffi.Pointer? _sel_descriptionWithLocale; NSString descriptionWithLocale(NSObject locale) { - _sel_descriptionWithLocale ??= - _registerName(_lib, "descriptionWithLocale:"); - final _ret = - _lib._objc_msgSend_44(_id, _sel_descriptionWithLocale!, locale._id); + final _ret = _lib._objc_msgSend_44( + _id, _lib._sel_descriptionWithLocale_1, locale._id); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_new1; static NSNumber new1(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSNumber"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSNumber1, _lib._sel_new1); return NSNumber._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static NSNumber alloc(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSNumber"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSNumber1, _lib._sel_alloc1); return NSNumber._(_ret, _lib); } } @@ -2993,32 +3140,24 @@ class NSEnumerator extends NSObject { NSEnumerator._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSEnumerator castFrom(T other) { return NSEnumerator._(other._id, other._lib); } - static ffi.Pointer? _sel_nextObject; NSObject nextObject() { - _sel_nextObject ??= _registerName(_lib, "nextObject"); - final _ret = _lib._objc_msgSend_1(_id, _sel_nextObject!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_nextObject1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_new1; static NSEnumerator new1(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSEnumerator"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSEnumerator1, _lib._sel_new1); return NSEnumerator._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static NSEnumerator alloc(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSEnumerator"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSEnumerator1, _lib._sel_alloc1); return NSEnumerator._(_ret, _lib); } } @@ -3033,63 +3172,45 @@ class NSOrderedCollectionChange extends NSObject { ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSOrderedCollectionChange castFrom(T other) { return NSOrderedCollectionChange._(other._id, other._lib); } - static ffi.Pointer? _sel_object; NSObject get object { - _sel_object ??= _registerName(_lib, "object"); - final _ret = _lib._objc_msgSend_1(_id, _sel_object!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_object1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_changeType; int get changeType { - _sel_changeType ??= _registerName(_lib, "changeType"); - return _lib._objc_msgSend_45(_id, _sel_changeType!); + return _lib._objc_msgSend_45(_id, _lib._sel_changeType1); } - static ffi.Pointer? _sel_index; int get index { - _sel_index ??= _registerName(_lib, "index"); - return _lib._objc_msgSend_11(_id, _sel_index!); + return _lib._objc_msgSend_11(_id, _lib._sel_index1); } - static ffi.Pointer? _sel_associatedIndex; int get associatedIndex { - _sel_associatedIndex ??= _registerName(_lib, "associatedIndex"); - return _lib._objc_msgSend_11(_id, _sel_associatedIndex!); + return _lib._objc_msgSend_11(_id, _lib._sel_associatedIndex1); } - static ffi.Pointer? _sel_init; @override NSObject init() { - _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_initWithObject_type_index; NSOrderedCollectionChange initWithObject_type_index( NSObject anObject, int type, int index) { - _sel_initWithObject_type_index ??= - _registerName(_lib, "initWithObject:type:index:"); final _ret = _lib._objc_msgSend_46( - _id, _sel_initWithObject_type_index!, anObject._id, type, index); + _id, _lib._sel_initWithObject_type_index_1, anObject._id, type, index); return NSOrderedCollectionChange._(_ret, _lib); } - static ffi.Pointer? _sel_initWithObject_type_index_associatedIndex; NSOrderedCollectionChange initWithObject_type_index_associatedIndex( NSObject anObject, int type, int index, int associatedIndex) { - _sel_initWithObject_type_index_associatedIndex ??= - _registerName(_lib, "initWithObject:type:index:associatedIndex:"); final _ret = _lib._objc_msgSend_47( _id, - _sel_initWithObject_type_index_associatedIndex!, + _lib._sel_initWithObject_type_index_associatedIndex_1, anObject._id, type, index, @@ -3097,19 +3218,15 @@ class NSOrderedCollectionChange extends NSObject { return NSOrderedCollectionChange._(_ret, _lib); } - static ffi.Pointer? _sel_new1; static NSOrderedCollectionChange new1(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSOrderedCollectionChange"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1( + _lib._class_NSOrderedCollectionChange1, _lib._sel_new1); return NSOrderedCollectionChange._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static NSOrderedCollectionChange alloc(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSOrderedCollectionChange"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = _lib._objc_msgSend_1( + _lib._class_NSOrderedCollectionChange1, _lib._sel_alloc1); return NSOrderedCollectionChange._(_ret, _lib); } } @@ -3118,268 +3235,203 @@ class NSIndexSet extends NSObject { NSIndexSet._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSIndexSet castFrom(T other) { return NSIndexSet._(other._id, other._lib); } - static ffi.Pointer? _sel_indexSet; static NSIndexSet indexSet(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSIndexSet"); - _sel_indexSet ??= _registerName(_lib, "indexSet"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_indexSet!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSIndexSet1, _lib._sel_indexSet1); return NSIndexSet._(_ret, _lib); } - static ffi.Pointer? _sel_indexSetWithIndex; static NSIndexSet indexSetWithIndex(StringTestObjCLibrary _lib, int value) { - _class ??= _getClass(_lib, "NSIndexSet"); - _sel_indexSetWithIndex ??= _registerName(_lib, "indexSetWithIndex:"); - final _ret = _lib._objc_msgSend_48(_class!, _sel_indexSetWithIndex!, value); + final _ret = _lib._objc_msgSend_48( + _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndex_1, value); return NSIndexSet._(_ret, _lib); } - static ffi.Pointer? _sel_indexSetWithIndexesInRange; static NSIndexSet indexSetWithIndexesInRange( StringTestObjCLibrary _lib, NSRange range) { - _class ??= _getClass(_lib, "NSIndexSet"); - _sel_indexSetWithIndexesInRange ??= - _registerName(_lib, "indexSetWithIndexesInRange:"); - final _ret = - _lib._objc_msgSend_49(_class!, _sel_indexSetWithIndexesInRange!, range); + final _ret = _lib._objc_msgSend_49( + _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndexesInRange_1, range); return NSIndexSet._(_ret, _lib); } - static ffi.Pointer? _sel_initWithIndexesInRange; NSIndexSet initWithIndexesInRange(NSRange range) { - _sel_initWithIndexesInRange ??= - _registerName(_lib, "initWithIndexesInRange:"); final _ret = - _lib._objc_msgSend_49(_id, _sel_initWithIndexesInRange!, range); + _lib._objc_msgSend_49(_id, _lib._sel_initWithIndexesInRange_1, range); return NSIndexSet._(_ret, _lib); } - static ffi.Pointer? _sel_initWithIndexSet; NSIndexSet initWithIndexSet(NSObject indexSet) { - _sel_initWithIndexSet ??= _registerName(_lib, "initWithIndexSet:"); final _ret = - _lib._objc_msgSend_13(_id, _sel_initWithIndexSet!, indexSet._id); + _lib._objc_msgSend_13(_id, _lib._sel_initWithIndexSet_1, indexSet._id); return NSIndexSet._(_ret, _lib); } - static ffi.Pointer? _sel_initWithIndex; NSIndexSet initWithIndex(int value) { - _sel_initWithIndex ??= _registerName(_lib, "initWithIndex:"); - final _ret = _lib._objc_msgSend_48(_id, _sel_initWithIndex!, value); + final _ret = _lib._objc_msgSend_48(_id, _lib._sel_initWithIndex_1, value); return NSIndexSet._(_ret, _lib); } - static ffi.Pointer? _sel_isEqualToIndexSet; bool isEqualToIndexSet(NSObject indexSet) { - _sel_isEqualToIndexSet ??= _registerName(_lib, "isEqualToIndexSet:"); - return _lib._objc_msgSend_4(_id, _sel_isEqualToIndexSet!, indexSet._id); + return _lib._objc_msgSend_4( + _id, _lib._sel_isEqualToIndexSet_1, indexSet._id); } - static ffi.Pointer? _sel_count; int get count { - _sel_count ??= _registerName(_lib, "count"); - return _lib._objc_msgSend_11(_id, _sel_count!); + return _lib._objc_msgSend_11(_id, _lib._sel_count1); } - static ffi.Pointer? _sel_firstIndex; int get firstIndex { - _sel_firstIndex ??= _registerName(_lib, "firstIndex"); - return _lib._objc_msgSend_11(_id, _sel_firstIndex!); + return _lib._objc_msgSend_11(_id, _lib._sel_firstIndex1); } - static ffi.Pointer? _sel_lastIndex; int get lastIndex { - _sel_lastIndex ??= _registerName(_lib, "lastIndex"); - return _lib._objc_msgSend_11(_id, _sel_lastIndex!); + return _lib._objc_msgSend_11(_id, _lib._sel_lastIndex1); } - static ffi.Pointer? _sel_indexGreaterThanIndex; int indexGreaterThanIndex(int value) { - _sel_indexGreaterThanIndex ??= - _registerName(_lib, "indexGreaterThanIndex:"); - return _lib._objc_msgSend_50(_id, _sel_indexGreaterThanIndex!, value); + return _lib._objc_msgSend_50(_id, _lib._sel_indexGreaterThanIndex_1, value); } - static ffi.Pointer? _sel_indexLessThanIndex; int indexLessThanIndex(int value) { - _sel_indexLessThanIndex ??= _registerName(_lib, "indexLessThanIndex:"); - return _lib._objc_msgSend_50(_id, _sel_indexLessThanIndex!, value); + return _lib._objc_msgSend_50(_id, _lib._sel_indexLessThanIndex_1, value); } - static ffi.Pointer? _sel_indexGreaterThanOrEqualToIndex; int indexGreaterThanOrEqualToIndex(int value) { - _sel_indexGreaterThanOrEqualToIndex ??= - _registerName(_lib, "indexGreaterThanOrEqualToIndex:"); return _lib._objc_msgSend_50( - _id, _sel_indexGreaterThanOrEqualToIndex!, value); + _id, _lib._sel_indexGreaterThanOrEqualToIndex_1, value); } - static ffi.Pointer? _sel_indexLessThanOrEqualToIndex; int indexLessThanOrEqualToIndex(int value) { - _sel_indexLessThanOrEqualToIndex ??= - _registerName(_lib, "indexLessThanOrEqualToIndex:"); - return _lib._objc_msgSend_50(_id, _sel_indexLessThanOrEqualToIndex!, value); + return _lib._objc_msgSend_50( + _id, _lib._sel_indexLessThanOrEqualToIndex_1, value); } - static ffi.Pointer? _sel_getIndexes_maxCount_inIndexRange; int getIndexes_maxCount_inIndexRange(ffi.Pointer indexBuffer, int bufferSize, NSRangePointer range) { - _sel_getIndexes_maxCount_inIndexRange ??= - _registerName(_lib, "getIndexes:maxCount:inIndexRange:"); - return _lib._objc_msgSend_51(_id, _sel_getIndexes_maxCount_inIndexRange!, - indexBuffer, bufferSize, range); + return _lib._objc_msgSend_51( + _id, + _lib._sel_getIndexes_maxCount_inIndexRange_1, + indexBuffer, + bufferSize, + range); } - static ffi.Pointer? _sel_countOfIndexesInRange; int countOfIndexesInRange(NSRange range) { - _sel_countOfIndexesInRange ??= - _registerName(_lib, "countOfIndexesInRange:"); - return _lib._objc_msgSend_52(_id, _sel_countOfIndexesInRange!, range); + return _lib._objc_msgSend_52(_id, _lib._sel_countOfIndexesInRange_1, range); } - static ffi.Pointer? _sel_containsIndex; bool containsIndex(int value) { - _sel_containsIndex ??= _registerName(_lib, "containsIndex:"); - return _lib._objc_msgSend_53(_id, _sel_containsIndex!, value); + return _lib._objc_msgSend_53(_id, _lib._sel_containsIndex_1, value); } - static ffi.Pointer? _sel_containsIndexesInRange; bool containsIndexesInRange(NSRange range) { - _sel_containsIndexesInRange ??= - _registerName(_lib, "containsIndexesInRange:"); - return _lib._objc_msgSend_54(_id, _sel_containsIndexesInRange!, range); + return _lib._objc_msgSend_54( + _id, _lib._sel_containsIndexesInRange_1, range); } - static ffi.Pointer? _sel_containsIndexes; bool containsIndexes(NSObject indexSet) { - _sel_containsIndexes ??= _registerName(_lib, "containsIndexes:"); - return _lib._objc_msgSend_4(_id, _sel_containsIndexes!, indexSet._id); + return _lib._objc_msgSend_4(_id, _lib._sel_containsIndexes_1, indexSet._id); } - static ffi.Pointer? _sel_intersectsIndexesInRange; bool intersectsIndexesInRange(NSRange range) { - _sel_intersectsIndexesInRange ??= - _registerName(_lib, "intersectsIndexesInRange:"); - return _lib._objc_msgSend_54(_id, _sel_intersectsIndexesInRange!, range); + return _lib._objc_msgSend_54( + _id, _lib._sel_intersectsIndexesInRange_1, range); } - static ffi.Pointer? _sel_enumerateIndexesUsingBlock; void enumerateIndexesUsingBlock(NSObject block) { - _sel_enumerateIndexesUsingBlock ??= - _registerName(_lib, "enumerateIndexesUsingBlock:"); - _lib._objc_msgSend_8(_id, _sel_enumerateIndexesUsingBlock!, block._id); + _lib._objc_msgSend_8( + _id, _lib._sel_enumerateIndexesUsingBlock_1, block._id); } - static ffi.Pointer? _sel_enumerateIndexesWithOptions_usingBlock; void enumerateIndexesWithOptions_usingBlock(int opts, NSObject block) { - _sel_enumerateIndexesWithOptions_usingBlock ??= - _registerName(_lib, "enumerateIndexesWithOptions:usingBlock:"); - _lib._objc_msgSend_55( - _id, _sel_enumerateIndexesWithOptions_usingBlock!, opts, block._id); + _lib._objc_msgSend_55(_id, + _lib._sel_enumerateIndexesWithOptions_usingBlock_1, opts, block._id); } - static ffi.Pointer? _sel_enumerateIndexesInRange_options_usingBlock; void enumerateIndexesInRange_options_usingBlock( NSRange range, int opts, NSObject block) { - _sel_enumerateIndexesInRange_options_usingBlock ??= - _registerName(_lib, "enumerateIndexesInRange:options:usingBlock:"); - _lib._objc_msgSend_56(_id, _sel_enumerateIndexesInRange_options_usingBlock!, - range, opts, block._id); + _lib._objc_msgSend_56( + _id, + _lib._sel_enumerateIndexesInRange_options_usingBlock_1, + range, + opts, + block._id); } - static ffi.Pointer? _sel_indexPassingTest; int indexPassingTest(NSObject predicate) { - _sel_indexPassingTest ??= _registerName(_lib, "indexPassingTest:"); - return _lib._objc_msgSend_57(_id, _sel_indexPassingTest!, predicate._id); + return _lib._objc_msgSend_57( + _id, _lib._sel_indexPassingTest_1, predicate._id); } - static ffi.Pointer? _sel_indexWithOptions_passingTest; int indexWithOptions_passingTest(int opts, NSObject predicate) { - _sel_indexWithOptions_passingTest ??= - _registerName(_lib, "indexWithOptions:passingTest:"); return _lib._objc_msgSend_58( - _id, _sel_indexWithOptions_passingTest!, opts, predicate._id); + _id, _lib._sel_indexWithOptions_passingTest_1, opts, predicate._id); } - static ffi.Pointer? _sel_indexInRange_options_passingTest; int indexInRange_options_passingTest( NSRange range, int opts, NSObject predicate) { - _sel_indexInRange_options_passingTest ??= - _registerName(_lib, "indexInRange:options:passingTest:"); - return _lib._objc_msgSend_59(_id, _sel_indexInRange_options_passingTest!, - range, opts, predicate._id); + return _lib._objc_msgSend_59( + _id, + _lib._sel_indexInRange_options_passingTest_1, + range, + opts, + predicate._id); } - static ffi.Pointer? _sel_indexesPassingTest; NSIndexSet indexesPassingTest(NSObject predicate) { - _sel_indexesPassingTest ??= _registerName(_lib, "indexesPassingTest:"); - final _ret = - _lib._objc_msgSend_60(_id, _sel_indexesPassingTest!, predicate._id); + final _ret = _lib._objc_msgSend_60( + _id, _lib._sel_indexesPassingTest_1, predicate._id); return NSIndexSet._(_ret, _lib); } - static ffi.Pointer? _sel_indexesWithOptions_passingTest; NSIndexSet indexesWithOptions_passingTest(int opts, NSObject predicate) { - _sel_indexesWithOptions_passingTest ??= - _registerName(_lib, "indexesWithOptions:passingTest:"); final _ret = _lib._objc_msgSend_61( - _id, _sel_indexesWithOptions_passingTest!, opts, predicate._id); + _id, _lib._sel_indexesWithOptions_passingTest_1, opts, predicate._id); return NSIndexSet._(_ret, _lib); } - static ffi.Pointer? _sel_indexesInRange_options_passingTest; NSIndexSet indexesInRange_options_passingTest( NSRange range, int opts, NSObject predicate) { - _sel_indexesInRange_options_passingTest ??= - _registerName(_lib, "indexesInRange:options:passingTest:"); - final _ret = _lib._objc_msgSend_62(_id, - _sel_indexesInRange_options_passingTest!, range, opts, predicate._id); + final _ret = _lib._objc_msgSend_62( + _id, + _lib._sel_indexesInRange_options_passingTest_1, + range, + opts, + predicate._id); return NSIndexSet._(_ret, _lib); } - static ffi.Pointer? _sel_enumerateRangesUsingBlock; void enumerateRangesUsingBlock(NSObject block) { - _sel_enumerateRangesUsingBlock ??= - _registerName(_lib, "enumerateRangesUsingBlock:"); - _lib._objc_msgSend_8(_id, _sel_enumerateRangesUsingBlock!, block._id); + _lib._objc_msgSend_8(_id, _lib._sel_enumerateRangesUsingBlock_1, block._id); } - static ffi.Pointer? _sel_enumerateRangesWithOptions_usingBlock; void enumerateRangesWithOptions_usingBlock(int opts, NSObject block) { - _sel_enumerateRangesWithOptions_usingBlock ??= - _registerName(_lib, "enumerateRangesWithOptions:usingBlock:"); - _lib._objc_msgSend_55( - _id, _sel_enumerateRangesWithOptions_usingBlock!, opts, block._id); + _lib._objc_msgSend_55(_id, + _lib._sel_enumerateRangesWithOptions_usingBlock_1, opts, block._id); } - static ffi.Pointer? _sel_enumerateRangesInRange_options_usingBlock; void enumerateRangesInRange_options_usingBlock( NSRange range, int opts, NSObject block) { - _sel_enumerateRangesInRange_options_usingBlock ??= - _registerName(_lib, "enumerateRangesInRange:options:usingBlock:"); - _lib._objc_msgSend_56(_id, _sel_enumerateRangesInRange_options_usingBlock!, - range, opts, block._id); + _lib._objc_msgSend_56( + _id, + _lib._sel_enumerateRangesInRange_options_usingBlock_1, + range, + opts, + block._id); } - static ffi.Pointer? _sel_new1; static NSIndexSet new1(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSIndexSet"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSIndexSet1, _lib._sel_new1); return NSIndexSet._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static NSIndexSet alloc(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSIndexSet"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSIndexSet1, _lib._sel_alloc1); return NSIndexSet._(_ret, _lib); } } @@ -3391,103 +3443,72 @@ class NSMutableIndexSet extends NSIndexSet { NSMutableIndexSet._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSMutableIndexSet castFrom(T other) { return NSMutableIndexSet._(other._id, other._lib); } - static ffi.Pointer? _sel_addIndexes; void addIndexes(NSObject indexSet) { - _sel_addIndexes ??= _registerName(_lib, "addIndexes:"); - _lib._objc_msgSend_8(_id, _sel_addIndexes!, indexSet._id); + _lib._objc_msgSend_8(_id, _lib._sel_addIndexes_1, indexSet._id); } - static ffi.Pointer? _sel_removeIndexes; void removeIndexes(NSObject indexSet) { - _sel_removeIndexes ??= _registerName(_lib, "removeIndexes:"); - _lib._objc_msgSend_8(_id, _sel_removeIndexes!, indexSet._id); + _lib._objc_msgSend_8(_id, _lib._sel_removeIndexes_1, indexSet._id); } - static ffi.Pointer? _sel_removeAllIndexes; void removeAllIndexes() { - _sel_removeAllIndexes ??= _registerName(_lib, "removeAllIndexes"); - _lib._objc_msgSend_0(_id, _sel_removeAllIndexes!); + _lib._objc_msgSend_0(_id, _lib._sel_removeAllIndexes1); } - static ffi.Pointer? _sel_addIndex; void addIndex(int value) { - _sel_addIndex ??= _registerName(_lib, "addIndex:"); - _lib._objc_msgSend_63(_id, _sel_addIndex!, value); + _lib._objc_msgSend_63(_id, _lib._sel_addIndex_1, value); } - static ffi.Pointer? _sel_removeIndex; void removeIndex(int value) { - _sel_removeIndex ??= _registerName(_lib, "removeIndex:"); - _lib._objc_msgSend_63(_id, _sel_removeIndex!, value); + _lib._objc_msgSend_63(_id, _lib._sel_removeIndex_1, value); } - static ffi.Pointer? _sel_addIndexesInRange; void addIndexesInRange(NSRange range) { - _sel_addIndexesInRange ??= _registerName(_lib, "addIndexesInRange:"); - _lib._objc_msgSend_64(_id, _sel_addIndexesInRange!, range); + _lib._objc_msgSend_64(_id, _lib._sel_addIndexesInRange_1, range); } - static ffi.Pointer? _sel_removeIndexesInRange; void removeIndexesInRange(NSRange range) { - _sel_removeIndexesInRange ??= _registerName(_lib, "removeIndexesInRange:"); - _lib._objc_msgSend_64(_id, _sel_removeIndexesInRange!, range); + _lib._objc_msgSend_64(_id, _lib._sel_removeIndexesInRange_1, range); } - static ffi.Pointer? _sel_shiftIndexesStartingAtIndex_by; void shiftIndexesStartingAtIndex_by(int index, int delta) { - _sel_shiftIndexesStartingAtIndex_by ??= - _registerName(_lib, "shiftIndexesStartingAtIndex:by:"); _lib._objc_msgSend_65( - _id, _sel_shiftIndexesStartingAtIndex_by!, index, delta); + _id, _lib._sel_shiftIndexesStartingAtIndex_by_1, index, delta); } - static ffi.Pointer? _sel_indexSet; static NSMutableIndexSet indexSet(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSMutableIndexSet"); - _sel_indexSet ??= _registerName(_lib, "indexSet"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_indexSet!); + final _ret = _lib._objc_msgSend_1( + _lib._class_NSMutableIndexSet1, _lib._sel_indexSet1); return NSMutableIndexSet._(_ret, _lib); } - static ffi.Pointer? _sel_indexSetWithIndex; static NSMutableIndexSet indexSetWithIndex( StringTestObjCLibrary _lib, int value) { - _class ??= _getClass(_lib, "NSMutableIndexSet"); - _sel_indexSetWithIndex ??= _registerName(_lib, "indexSetWithIndex:"); - final _ret = _lib._objc_msgSend_48(_class!, _sel_indexSetWithIndex!, value); + final _ret = _lib._objc_msgSend_48( + _lib._class_NSMutableIndexSet1, _lib._sel_indexSetWithIndex_1, value); return NSMutableIndexSet._(_ret, _lib); } - static ffi.Pointer? _sel_indexSetWithIndexesInRange; static NSMutableIndexSet indexSetWithIndexesInRange( StringTestObjCLibrary _lib, NSRange range) { - _class ??= _getClass(_lib, "NSMutableIndexSet"); - _sel_indexSetWithIndexesInRange ??= - _registerName(_lib, "indexSetWithIndexesInRange:"); - final _ret = - _lib._objc_msgSend_49(_class!, _sel_indexSetWithIndexesInRange!, range); + final _ret = _lib._objc_msgSend_49(_lib._class_NSMutableIndexSet1, + _lib._sel_indexSetWithIndexesInRange_1, range); return NSMutableIndexSet._(_ret, _lib); } - static ffi.Pointer? _sel_new1; static NSMutableIndexSet new1(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSMutableIndexSet"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSMutableIndexSet1, _lib._sel_new1); return NSMutableIndexSet._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static NSMutableIndexSet alloc(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSMutableIndexSet"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSMutableIndexSet1, _lib._sel_alloc1); return NSMutableIndexSet._(_ret, _lib); } } @@ -3505,22 +3526,17 @@ class NSOrderedCollectionDifference extends NSObject { ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSOrderedCollectionDifference castFrom( T other) { return NSOrderedCollectionDifference._(other._id, other._lib); } - static ffi.Pointer? _sel_initWithChanges; NSOrderedCollectionDifference initWithChanges(NSObject changes) { - _sel_initWithChanges ??= _registerName(_lib, "initWithChanges:"); - final _ret = _lib._objc_msgSend_13(_id, _sel_initWithChanges!, changes._id); + final _ret = + _lib._objc_msgSend_13(_id, _lib._sel_initWithChanges_1, changes._id); return NSOrderedCollectionDifference._(_ret, _lib); } - static ffi.Pointer? - _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges; NSOrderedCollectionDifference initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges( NSObject inserts, @@ -3528,12 +3544,9 @@ class NSOrderedCollectionDifference extends NSObject { NSObject removes, NSObject removedObjects, NSObject changes) { - _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges ??= - _registerName(_lib, - "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:additionalChanges:"); final _ret = _lib._objc_msgSend_66( _id, - _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges!, + _lib._sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges_1, inserts._id, insertedObjects._id, removes._id, @@ -3542,20 +3555,15 @@ class NSOrderedCollectionDifference extends NSObject { return NSOrderedCollectionDifference._(_ret, _lib); } - static ffi.Pointer? - _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects; NSOrderedCollectionDifference initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects( NSObject inserts, NSObject insertedObjects, NSObject removes, NSObject removedObjects) { - _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects ??= - _registerName(_lib, - "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:"); final _ret = _lib._objc_msgSend_67( _id, - _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects!, + _lib._sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_1, inserts._id, insertedObjects._id, removes._id, @@ -3563,46 +3571,34 @@ class NSOrderedCollectionDifference extends NSObject { return NSOrderedCollectionDifference._(_ret, _lib); } - static ffi.Pointer? _sel_insertions; NSObject get insertions { - _sel_insertions ??= _registerName(_lib, "insertions"); - final _ret = _lib._objc_msgSend_1(_id, _sel_insertions!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_insertions1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_removals; NSObject get removals { - _sel_removals ??= _registerName(_lib, "removals"); - final _ret = _lib._objc_msgSend_1(_id, _sel_removals!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_removals1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_hasChanges; bool get hasChanges { - _sel_hasChanges ??= _registerName(_lib, "hasChanges"); - return _lib._objc_msgSend_10(_id, _sel_hasChanges!); + return _lib._objc_msgSend_10(_id, _lib._sel_hasChanges1); } - static ffi.Pointer? _sel_inverseDifference; NSOrderedCollectionDifference inverseDifference() { - _sel_inverseDifference ??= _registerName(_lib, "inverseDifference"); - final _ret = _lib._objc_msgSend_1(_id, _sel_inverseDifference!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_inverseDifference1); return NSOrderedCollectionDifference._(_ret, _lib); } - static ffi.Pointer? _sel_new1; static NSOrderedCollectionDifference new1(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSOrderedCollectionDifference"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1( + _lib._class_NSOrderedCollectionDifference1, _lib._sel_new1); return NSOrderedCollectionDifference._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static NSOrderedCollectionDifference alloc(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSOrderedCollectionDifference"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = _lib._objc_msgSend_1( + _lib._class_NSOrderedCollectionDifference1, _lib._sel_alloc1); return NSOrderedCollectionDifference._(_ret, _lib); } } @@ -3611,63 +3607,45 @@ class NSArray extends NSObject { NSArray._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSArray castFrom(T other) { return NSArray._(other._id, other._lib); } - static ffi.Pointer? _sel_count; int get count { - _sel_count ??= _registerName(_lib, "count"); - return _lib._objc_msgSend_11(_id, _sel_count!); + return _lib._objc_msgSend_11(_id, _lib._sel_count1); } - static ffi.Pointer? _sel_objectAtIndex; NSObject objectAtIndex(int index) { - _sel_objectAtIndex ??= _registerName(_lib, "objectAtIndex:"); - final _ret = _lib._objc_msgSend_48(_id, _sel_objectAtIndex!, index); + final _ret = _lib._objc_msgSend_48(_id, _lib._sel_objectAtIndex_1, index); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_init; @override NSArray init() { - _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); return NSArray._(_ret, _lib); } - static ffi.Pointer? _sel_initWithObjects_count; NSArray initWithObjects_count( ffi.Pointer> objects, int cnt) { - _sel_initWithObjects_count ??= - _registerName(_lib, "initWithObjects:count:"); - final _ret = - _lib._objc_msgSend_68(_id, _sel_initWithObjects_count!, objects, cnt); + final _ret = _lib._objc_msgSend_68( + _id, _lib._sel_initWithObjects_count_1, objects, cnt); return NSArray._(_ret, _lib); } - static ffi.Pointer? _sel_initWithCoder; NSArray initWithCoder(NSObject coder) { - _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_13(_id, _sel_initWithCoder!, coder._id); + final _ret = + _lib._objc_msgSend_13(_id, _lib._sel_initWithCoder_1, coder._id); return NSArray._(_ret, _lib); } - static ffi.Pointer? _sel_new1; static NSArray new1(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSArray"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSArray1, _lib._sel_new1); return NSArray._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static NSArray alloc(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSArray"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = _lib._objc_msgSend_1(_lib._class_NSArray1, _lib._sel_alloc1); return NSArray._(_ret, _lib); } } @@ -3682,80 +3660,60 @@ class NSMutableArray extends NSArray { NSMutableArray._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSMutableArray castFrom(T other) { return NSMutableArray._(other._id, other._lib); } - static ffi.Pointer? _sel_addObject; void addObject(NSObject anObject) { - _sel_addObject ??= _registerName(_lib, "addObject:"); - _lib._objc_msgSend_8(_id, _sel_addObject!, anObject._id); + _lib._objc_msgSend_8(_id, _lib._sel_addObject_1, anObject._id); } - static ffi.Pointer? _sel_insertObject_atIndex; void insertObject_atIndex(NSObject anObject, int index) { - _sel_insertObject_atIndex ??= _registerName(_lib, "insertObject:atIndex:"); - _lib._objc_msgSend_69(_id, _sel_insertObject_atIndex!, anObject._id, index); + _lib._objc_msgSend_69( + _id, _lib._sel_insertObject_atIndex_1, anObject._id, index); } - static ffi.Pointer? _sel_removeLastObject; void removeLastObject() { - _sel_removeLastObject ??= _registerName(_lib, "removeLastObject"); - _lib._objc_msgSend_0(_id, _sel_removeLastObject!); + _lib._objc_msgSend_0(_id, _lib._sel_removeLastObject1); } - static ffi.Pointer? _sel_removeObjectAtIndex; void removeObjectAtIndex(int index) { - _sel_removeObjectAtIndex ??= _registerName(_lib, "removeObjectAtIndex:"); - _lib._objc_msgSend_63(_id, _sel_removeObjectAtIndex!, index); + _lib._objc_msgSend_63(_id, _lib._sel_removeObjectAtIndex_1, index); } - static ffi.Pointer? _sel_replaceObjectAtIndex_withObject; void replaceObjectAtIndex_withObject(int index, NSObject anObject) { - _sel_replaceObjectAtIndex_withObject ??= - _registerName(_lib, "replaceObjectAtIndex:withObject:"); _lib._objc_msgSend_70( - _id, _sel_replaceObjectAtIndex_withObject!, index, anObject._id); + _id, _lib._sel_replaceObjectAtIndex_withObject_1, index, anObject._id); } - static ffi.Pointer? _sel_init; @override NSMutableArray init() { - _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); return NSMutableArray._(_ret, _lib); } - static ffi.Pointer? _sel_initWithCapacity; NSMutableArray initWithCapacity(int numItems) { - _sel_initWithCapacity ??= _registerName(_lib, "initWithCapacity:"); - final _ret = _lib._objc_msgSend_48(_id, _sel_initWithCapacity!, numItems); + final _ret = + _lib._objc_msgSend_48(_id, _lib._sel_initWithCapacity_1, numItems); return NSMutableArray._(_ret, _lib); } - static ffi.Pointer? _sel_initWithCoder; @override NSMutableArray initWithCoder(NSObject coder) { - _sel_initWithCoder ??= _registerName(_lib, "initWithCoder:"); - final _ret = _lib._objc_msgSend_13(_id, _sel_initWithCoder!, coder._id); + final _ret = + _lib._objc_msgSend_13(_id, _lib._sel_initWithCoder_1, coder._id); return NSMutableArray._(_ret, _lib); } - static ffi.Pointer? _sel_new1; static NSMutableArray new1(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSMutableArray"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSMutableArray1, _lib._sel_new1); return NSMutableArray._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static NSMutableArray alloc(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSMutableArray"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSMutableArray1, _lib._sel_alloc1); return NSMutableArray._(_ret, _lib); } } @@ -3775,248 +3733,179 @@ class NSItemProvider extends NSObject { NSItemProvider._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSItemProvider castFrom(T other) { return NSItemProvider._(other._id, other._lib); } - static ffi.Pointer? _sel_init; @override NSItemProvider init() { - _sel_init ??= _registerName(_lib, "init"); - final _ret = _lib._objc_msgSend_1(_id, _sel_init!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); return NSItemProvider._(_ret, _lib); } - static ffi.Pointer? - _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler; void registerDataRepresentationForTypeIdentifier_visibility_loadHandler( NSObject typeIdentifier, int visibility, NSObject loadHandler) { - _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler ??= - _registerName(_lib, - "registerDataRepresentationForTypeIdentifier:visibility:loadHandler:"); _lib._objc_msgSend_71( _id, - _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler!, + _lib._sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1, typeIdentifier._id, visibility, loadHandler._id); } - static ffi.Pointer? - _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler; void registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler( NSObject typeIdentifier, int fileOptions, int visibility, NSObject loadHandler) { - _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler ??= - _registerName(_lib, - "registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:"); _lib._objc_msgSend_72( _id, - _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler!, + _lib._sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1, typeIdentifier._id, fileOptions, visibility, loadHandler._id); } - static ffi.Pointer? _sel_registeredTypeIdentifiers; NSObject get registeredTypeIdentifiers { - _sel_registeredTypeIdentifiers ??= - _registerName(_lib, "registeredTypeIdentifiers"); - final _ret = _lib._objc_msgSend_1(_id, _sel_registeredTypeIdentifiers!); + final _ret = + _lib._objc_msgSend_1(_id, _lib._sel_registeredTypeIdentifiers1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_hasItemConformingToTypeIdentifier; bool hasItemConformingToTypeIdentifier(NSObject typeIdentifier) { - _sel_hasItemConformingToTypeIdentifier ??= - _registerName(_lib, "hasItemConformingToTypeIdentifier:"); return _lib._objc_msgSend_4( - _id, _sel_hasItemConformingToTypeIdentifier!, typeIdentifier._id); + _id, _lib._sel_hasItemConformingToTypeIdentifier_1, typeIdentifier._id); } - static ffi.Pointer? - _sel_hasRepresentationConformingToTypeIdentifier_fileOptions; bool hasRepresentationConformingToTypeIdentifier_fileOptions( NSObject typeIdentifier, int fileOptions) { - _sel_hasRepresentationConformingToTypeIdentifier_fileOptions ??= - _registerName( - _lib, "hasRepresentationConformingToTypeIdentifier:fileOptions:"); return _lib._objc_msgSend_73( _id, - _sel_hasRepresentationConformingToTypeIdentifier_fileOptions!, + _lib._sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1, typeIdentifier._id, fileOptions); } - static ffi.Pointer? - _sel_loadDataRepresentationForTypeIdentifier_completionHandler; NSProgress loadDataRepresentationForTypeIdentifier_completionHandler( NSObject typeIdentifier, NSObject completionHandler) { - _sel_loadDataRepresentationForTypeIdentifier_completionHandler ??= - _registerName( - _lib, "loadDataRepresentationForTypeIdentifier:completionHandler:"); final _ret = _lib._objc_msgSend_74( _id, - _sel_loadDataRepresentationForTypeIdentifier_completionHandler!, + _lib._sel_loadDataRepresentationForTypeIdentifier_completionHandler_1, typeIdentifier._id, completionHandler._id); return NSProgress._(_ret, _lib); } - static ffi.Pointer? - _sel_loadFileRepresentationForTypeIdentifier_completionHandler; NSProgress loadFileRepresentationForTypeIdentifier_completionHandler( NSObject typeIdentifier, NSObject completionHandler) { - _sel_loadFileRepresentationForTypeIdentifier_completionHandler ??= - _registerName( - _lib, "loadFileRepresentationForTypeIdentifier:completionHandler:"); final _ret = _lib._objc_msgSend_74( _id, - _sel_loadFileRepresentationForTypeIdentifier_completionHandler!, + _lib._sel_loadFileRepresentationForTypeIdentifier_completionHandler_1, typeIdentifier._id, completionHandler._id); return NSProgress._(_ret, _lib); } - static ffi.Pointer? - _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler; NSProgress loadInPlaceFileRepresentationForTypeIdentifier_completionHandler( NSObject typeIdentifier, NSObject completionHandler) { - _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler ??= - _registerName(_lib, - "loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:"); final _ret = _lib._objc_msgSend_74( _id, - _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler!, + _lib._sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1, typeIdentifier._id, completionHandler._id); return NSProgress._(_ret, _lib); } - static ffi.Pointer? _sel_suggestedName; NSObject get suggestedName { - _sel_suggestedName ??= _registerName(_lib, "suggestedName"); - final _ret = _lib._objc_msgSend_1(_id, _sel_suggestedName!); + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_suggestedName1); return NSObject._(_ret, _lib); } - static ffi.Pointer? _sel_suggestedName1; set suggestedName(NSObject value) { - _sel_suggestedName1 ??= _registerName(_lib, "setSuggestedName:"); - _lib._objc_msgSend_8(_id, _sel_suggestedName1!, value._id); + _lib._objc_msgSend_8(_id, _lib._sel_setSuggestedName_1, value._id); } - static ffi.Pointer? _sel_initWithObject; NSItemProvider initWithObject(NSObject object) { - _sel_initWithObject ??= _registerName(_lib, "initWithObject:"); - final _ret = _lib._objc_msgSend_13(_id, _sel_initWithObject!, object._id); + final _ret = + _lib._objc_msgSend_13(_id, _lib._sel_initWithObject_1, object._id); return NSItemProvider._(_ret, _lib); } - static ffi.Pointer? _sel_registerObject_visibility; void registerObject_visibility(NSObject object, int visibility) { - _sel_registerObject_visibility ??= - _registerName(_lib, "registerObject:visibility:"); _lib._objc_msgSend_75( - _id, _sel_registerObject_visibility!, object._id, visibility); + _id, _lib._sel_registerObject_visibility_1, object._id, visibility); } - static ffi.Pointer? - _sel_registerObjectOfClass_visibility_loadHandler; void registerObjectOfClass_visibility_loadHandler( NSObject aClass, int visibility, NSObject loadHandler) { - _sel_registerObjectOfClass_visibility_loadHandler ??= - _registerName(_lib, "registerObjectOfClass:visibility:loadHandler:"); _lib._objc_msgSend_71( _id, - _sel_registerObjectOfClass_visibility_loadHandler!, + _lib._sel_registerObjectOfClass_visibility_loadHandler_1, aClass._id, visibility, loadHandler._id); } - static ffi.Pointer? _sel_canLoadObjectOfClass; bool canLoadObjectOfClass(NSObject aClass) { - _sel_canLoadObjectOfClass ??= _registerName(_lib, "canLoadObjectOfClass:"); - return _lib._objc_msgSend_4(_id, _sel_canLoadObjectOfClass!, aClass._id); + return _lib._objc_msgSend_4( + _id, _lib._sel_canLoadObjectOfClass_1, aClass._id); } - static ffi.Pointer? _sel_loadObjectOfClass_completionHandler; NSProgress loadObjectOfClass_completionHandler( NSObject aClass, NSObject completionHandler) { - _sel_loadObjectOfClass_completionHandler ??= - _registerName(_lib, "loadObjectOfClass:completionHandler:"); final _ret = _lib._objc_msgSend_74( _id, - _sel_loadObjectOfClass_completionHandler!, + _lib._sel_loadObjectOfClass_completionHandler_1, aClass._id, completionHandler._id); return NSProgress._(_ret, _lib); } - static ffi.Pointer? _sel_initWithItem_typeIdentifier; NSItemProvider initWithItem_typeIdentifier( NSObject item, NSObject typeIdentifier) { - _sel_initWithItem_typeIdentifier ??= - _registerName(_lib, "initWithItem:typeIdentifier:"); - final _ret = _lib._objc_msgSend_76( - _id, _sel_initWithItem_typeIdentifier!, item._id, typeIdentifier._id); + final _ret = _lib._objc_msgSend_76(_id, + _lib._sel_initWithItem_typeIdentifier_1, item._id, typeIdentifier._id); return NSItemProvider._(_ret, _lib); } - static ffi.Pointer? _sel_initWithContentsOfURL; NSItemProvider initWithContentsOfURL(NSObject fileURL) { - _sel_initWithContentsOfURL ??= - _registerName(_lib, "initWithContentsOfURL:"); - final _ret = - _lib._objc_msgSend_13(_id, _sel_initWithContentsOfURL!, fileURL._id); + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithContentsOfURL_1, fileURL._id); return NSItemProvider._(_ret, _lib); } - static ffi.Pointer? _sel_registerItemForTypeIdentifier_loadHandler; void registerItemForTypeIdentifier_loadHandler( NSObject typeIdentifier, NSItemProviderLoadHandler loadHandler) { - _sel_registerItemForTypeIdentifier_loadHandler ??= - _registerName(_lib, "registerItemForTypeIdentifier:loadHandler:"); - _lib._objc_msgSend_77(_id, _sel_registerItemForTypeIdentifier_loadHandler!, - typeIdentifier._id, loadHandler); + _lib._objc_msgSend_77( + _id, + _lib._sel_registerItemForTypeIdentifier_loadHandler_1, + typeIdentifier._id, + loadHandler); } - static ffi.Pointer? - _sel_loadItemForTypeIdentifier_options_completionHandler; void loadItemForTypeIdentifier_options_completionHandler( NSObject typeIdentifier, NSObject options, NSItemProviderCompletionHandler completionHandler) { - _sel_loadItemForTypeIdentifier_options_completionHandler ??= _registerName( - _lib, "loadItemForTypeIdentifier:options:completionHandler:"); _lib._objc_msgSend_78( _id, - _sel_loadItemForTypeIdentifier_options_completionHandler!, + _lib._sel_loadItemForTypeIdentifier_options_completionHandler_1, typeIdentifier._id, options._id, completionHandler); } - static ffi.Pointer? _sel_new1; static NSItemProvider new1(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSItemProvider"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSItemProvider1, _lib._sel_new1); return NSItemProvider._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static NSItemProvider alloc(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSItemProvider"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSItemProvider1, _lib._sel_alloc1); return NSItemProvider._(_ret, _lib); } } @@ -4025,8 +3914,6 @@ class NSProgress extends _ObjCWrapper { NSProgress._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSProgress castFrom(T other) { return NSProgress._(other._id, other._lib); } @@ -4079,44 +3966,31 @@ class NSMutableString extends NSString { NSMutableString._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSMutableString castFrom(T other) { return NSMutableString._(other._id, other._lib); } - static ffi.Pointer? _sel_replaceCharactersInRange_withString; void replaceCharactersInRange_withString(NSRange range, NSObject aString) { - _sel_replaceCharactersInRange_withString ??= - _registerName(_lib, "replaceCharactersInRange:withString:"); - _lib._objc_msgSend_79( - _id, _sel_replaceCharactersInRange_withString!, range, aString._id); + _lib._objc_msgSend_79(_id, _lib._sel_replaceCharactersInRange_withString_1, + range, aString._id); } - static ffi.Pointer? _sel_stringWithCString_encoding; static NSString stringWithCString_encoding( StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { - _class ??= _getClass(_lib, "NSMutableString"); - _sel_stringWithCString_encoding ??= - _registerName(_lib, "stringWithCString:encoding:"); - final _ret = _lib._objc_msgSend_14( - _class!, _sel_stringWithCString_encoding!, cString, enc); + final _ret = _lib._objc_msgSend_14(_lib._class_NSMutableString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_new1; static NSMutableString new1(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSMutableString"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSMutableString1, _lib._sel_new1); return NSMutableString._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static NSMutableString alloc(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSMutableString"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSMutableString1, _lib._sel_alloc1); return NSMutableString._(_ret, _lib); } } @@ -4127,36 +4001,26 @@ class NSSimpleCString extends NSString { NSSimpleCString._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSSimpleCString castFrom(T other) { return NSSimpleCString._(other._id, other._lib); } - static ffi.Pointer? _sel_stringWithCString_encoding; static NSString stringWithCString_encoding( StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { - _class ??= _getClass(_lib, "NSSimpleCString"); - _sel_stringWithCString_encoding ??= - _registerName(_lib, "stringWithCString:encoding:"); - final _ret = _lib._objc_msgSend_14( - _class!, _sel_stringWithCString_encoding!, cString, enc); + final _ret = _lib._objc_msgSend_14(_lib._class_NSSimpleCString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_new1; static NSSimpleCString new1(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSSimpleCString"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSSimpleCString1, _lib._sel_new1); return NSSimpleCString._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static NSSimpleCString alloc(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSSimpleCString"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSSimpleCString1, _lib._sel_alloc1); return NSSimpleCString._(_ret, _lib); } } @@ -4165,36 +4029,26 @@ class NSConstantString extends NSSimpleCString { NSConstantString._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static NSConstantString castFrom(T other) { return NSConstantString._(other._id, other._lib); } - static ffi.Pointer? _sel_stringWithCString_encoding; static NSString stringWithCString_encoding( StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { - _class ??= _getClass(_lib, "NSConstantString"); - _sel_stringWithCString_encoding ??= - _registerName(_lib, "stringWithCString:encoding:"); - final _ret = _lib._objc_msgSend_14( - _class!, _sel_stringWithCString_encoding!, cString, enc); + final _ret = _lib._objc_msgSend_14(_lib._class_NSConstantString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_new1; static NSConstantString new1(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSConstantString"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSConstantString1, _lib._sel_new1); return NSConstantString._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static NSConstantString alloc(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "NSConstantString"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = + _lib._objc_msgSend_1(_lib._class_NSConstantString1, _lib._sel_alloc1); return NSConstantString._(_ret, _lib); } } @@ -4203,35 +4057,25 @@ class StringUtil extends NSObject { StringUtil._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); - static ffi.Pointer? _class; - static StringUtil castFrom(T other) { return StringUtil._(other._id, other._lib); } - static ffi.Pointer? _sel_strConcat_with; static NSString strConcat_with( StringTestObjCLibrary _lib, NSObject a, NSObject b) { - _class ??= _getClass(_lib, "StringUtil"); - _sel_strConcat_with ??= _registerName(_lib, "strConcat:with:"); - final _ret = - _lib._objc_msgSend_80(_class!, _sel_strConcat_with!, a._id, b._id); + final _ret = _lib._objc_msgSend_80( + _lib._class_StringUtil1, _lib._sel_strConcat_with_1, a._id, b._id); return NSString._(_ret, _lib); } - static ffi.Pointer? _sel_new1; static StringUtil new1(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "StringUtil"); - _sel_new1 ??= _registerName(_lib, "new"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_new1!); + final _ret = _lib._objc_msgSend_1(_lib._class_StringUtil1, _lib._sel_new1); return StringUtil._(_ret, _lib); } - static ffi.Pointer? _sel_alloc; static StringUtil alloc(StringTestObjCLibrary _lib) { - _class ??= _getClass(_lib, "StringUtil"); - _sel_alloc ??= _registerName(_lib, "alloc"); - final _ret = _lib._objc_msgSend_1(_class!, _sel_alloc!); + final _ret = + _lib._objc_msgSend_1(_lib._class_StringUtil1, _lib._sel_alloc1); return StringUtil._(_ret, _lib); } } From 0b95430fba885bdcf4d23141dd4d4e772b658ac7 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Wed, 27 Apr 2022 07:03:48 -0700 Subject: [PATCH 126/276] [ffigen] Make all NSObject references nullable in the generated dart bindings. (#339) --- .../src/code_generator/objc_interface.dart | 25 +- .../clang_bindings/clang_bindings.dart | 32 + .../sub_parsers/objcinterfacedecl_parser.dart | 18 +- .../_expected_objc_config_bindings.dart | 11 +- .../_expected_objc_interface_bindings.dart | 15 +- .../native_objc_test/method_bindings.dart | 11 +- .../native_objc_test_bindings.dart | 23 +- .../native_objc_test/nullable_bindings.dart | 1230 +++++++++++++++++ .../native_objc_test/nullable_config.yaml | 12 + .../test/native_objc_test/nullable_test.dart | 71 + .../test/native_objc_test/nullable_test.m | 21 + .../native_objc_test/property_bindings.dart | 11 +- pkgs/ffigen/test/native_objc_test/setup.dart | 1 + .../native_objc_test/string_bindings.dart | 208 +-- pkgs/ffigen/test/regen.dart | 5 + pkgs/ffigen/tool/libclang_config.yaml | 2 + 16 files changed, 1557 insertions(+), 139 deletions(-) create mode 100644 pkgs/ffigen/test/native_objc_test/nullable_bindings.dart create mode 100644 pkgs/ffigen/test/native_objc_test/nullable_config.yaml create mode 100644 pkgs/ffigen/test/native_objc_test/nullable_test.dart create mode 100644 pkgs/ffigen/test/native_objc_test/nullable_test.m diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 65536ffa28..c7cdbea2cf 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -69,8 +69,10 @@ class ObjCInterface extends BindingType { if (isStatic) { stringParams.add('${w.className} _lib'); } - stringParams.addAll( - params.map((p) => '${_getConvertedType(p.type, w, name)} ${p.name}')); + stringParams.addAll(params.map((p) => + (_getConvertedType(p.type, w, name) + + (p.isNullable ? "? " : " ") + + p.name))); return '(' + stringParams.join(", ") + ')'; } @@ -170,7 +172,7 @@ class ObjCInterface extends BindingType { s.write(isStatic ? '_lib.${_classObject.name}' : '_id'); s.write(', _lib.${m.selObject!.name}'); for (final p in m.params) { - s.write(', ${_doArgConversion(p.type, p.name)}'); + s.write(', ${_doArgConversion(p)}'); } s.write(');\n'); if (convertReturn) { @@ -304,11 +306,17 @@ class ObjCInterface extends BindingType { return type.getDartType(w); } - String _doArgConversion(Type type, String value) { - if (type is ObjCInterface || _isObject(type) || _isInstanceType(type)) { - return '$value._id'; + String _doArgConversion(ObjCMethodParam arg) { + if (arg.type is ObjCInterface || + _isObject(arg.type) || + _isInstanceType(arg.type)) { + if (arg.isNullable) { + return '${arg.name}?._id ?? ffi.nullptr'; + } else { + return '${arg.name}._id'; + } } - return value; + return arg.name; } String _doReturnConversion( @@ -395,5 +403,6 @@ class ObjCMethod { class ObjCMethodParam { final Type type; final String name; - ObjCMethodParam(this.type, this.name); + final bool isNullable; + ObjCMethodParam(this.type, this.name, {this.isNullable = false}); } diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 0075ca912c..9191f674c9 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -829,6 +829,21 @@ class Clang { late final _clang_Type_getNamedType = _clang_Type_getNamedTypePtr.asFunction(); + /// Retrieve the nullability kind of a pointer type. + int clang_Type_getNullability( + CXType T, + ) { + return _clang_Type_getNullability( + T, + ); + } + + late final _clang_Type_getNullabilityPtr = + _lookup>( + 'clang_Type_getNullability'); + late final _clang_Type_getNullability = + _clang_Type_getNullabilityPtr.asFunction(); + /// Return the alignment of a type in bytes as per C++[expr.alignof] /// standard. /// @@ -2448,6 +2463,23 @@ class CXType extends ffi.Struct { external ffi.Array> data; } +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; +} + /// Describes how the traversal of the children of a particular /// cursor should proceed after visiting a particular child cursor. /// diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index 6d90c3d9e8..c9451cfa35 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -211,9 +211,25 @@ void _parseMethodReturnType(clang_types.CXCursor cursor) { } void _parseMethodParam(clang_types.CXCursor cursor) { + /* + TODO(#334): Change this to use: + + clang.clang_Type_getNullability(cursor.type()) == + clang_types.CXTypeNullabilityKind.CXTypeNullability_Nullable; + + NOTE: This will only work with the + + clang_types + .CXTranslationUnit_Flags.CXTranslationUnit_IncludeAttributedTypes + + option set. + */ + final isNullable = + cursor.type().kind == clang_types.CXTypeKind.CXType_ObjCObjectPointer; final name = cursor.spelling(); final type = cursor.type().toCodeGenType(); _logger.fine( ' >> Parameter: $type $name ${cursor.completeStringRepr()}'); - _methodStack.top.method.params.add(ObjCMethodParam(type, name)); + _methodStack.top.method.params + .add(ObjCMethodParam(type, name, isNullable: isNullable)); } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart index e647802020..cedcffe09f 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart @@ -521,9 +521,9 @@ class NSObject extends _ObjCWrapper { _lib._sel_instancesRespondToSelector_1, aSelector); } - static bool conformsToProtocol(NativeLibrary _lib, NSObject protocol) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol._id); + static bool conformsToProtocol(NativeLibrary _lib, NSObject? protocol) { + return _lib._objc_msgSend_4(_lib._class_NSObject1, + _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); } IMP methodForSelector(ffi.Pointer aSelector) { @@ -546,8 +546,9 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - void forwardInvocation(NSObject anInvocation) { - _lib._objc_msgSend_8(_id, _lib._sel_forwardInvocation_1, anInvocation._id); + void forwardInvocation(NSObject? anInvocation) { + _lib._objc_msgSend_8( + _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); } NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart index 551e558f65..efb1b93af9 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart @@ -562,9 +562,9 @@ class Foo extends NSObject { return Foo._(_ret, _lib); } - int anInstanceMethod_withOtherArg(NSObject someArg, NSObject otherArg) { + int anInstanceMethod_withOtherArg(NSObject? someArg, NSObject? otherArg) { return _lib._objc_msgSend_18(_id, _lib._sel_anInstanceMethod_withOtherArg_1, - someArg._id, otherArg._id); + someArg?._id ?? ffi.nullptr, otherArg?._id ?? ffi.nullptr); } static Foo new1(NativeLibrary _lib) { @@ -655,9 +655,9 @@ class NSObject extends _ObjCWrapper { _lib._sel_instancesRespondToSelector_1, aSelector); } - static bool conformsToProtocol(NativeLibrary _lib, NSObject protocol) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol._id); + static bool conformsToProtocol(NativeLibrary _lib, NSObject? protocol) { + return _lib._objc_msgSend_4(_lib._class_NSObject1, + _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); } IMP methodForSelector(ffi.Pointer aSelector) { @@ -680,8 +680,9 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - void forwardInvocation(NSObject anInvocation) { - _lib._objc_msgSend_8(_id, _lib._sel_forwardInvocation_1, anInvocation._id); + void forwardInvocation(NSObject? anInvocation) { + _lib._objc_msgSend_8( + _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); } NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { diff --git a/pkgs/ffigen/test/native_objc_test/method_bindings.dart b/pkgs/ffigen/test/native_objc_test/method_bindings.dart index 2ebbe59a61..fc3bd606df 100644 --- a/pkgs/ffigen/test/native_objc_test/method_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/method_bindings.dart @@ -836,9 +836,9 @@ class NSObject extends _ObjCWrapper { } static bool conformsToProtocol( - MethodTestObjCLibrary _lib, NSObject protocol) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol._id); + MethodTestObjCLibrary _lib, NSObject? protocol) { + return _lib._objc_msgSend_4(_lib._class_NSObject1, + _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); } IMP methodForSelector(ffi.Pointer aSelector) { @@ -861,8 +861,9 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - void forwardInvocation(NSObject anInvocation) { - _lib._objc_msgSend_8(_id, _lib._sel_forwardInvocation_1, anInvocation._id); + void forwardInvocation(NSObject? anInvocation) { + _lib._objc_msgSend_8( + _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); } NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart index 5b9e98f092..b6edcc81f4 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart @@ -1170,9 +1170,9 @@ class Foo extends NSObject { return Foo._(_ret, _lib); } - int multiply_withOtherFoo(bool useIntVals, NSObject other) { - return _lib._objc_msgSend_20( - _id, _lib._sel_multiply_withOtherFoo_1, useIntVals, other._id); + int multiply_withOtherFoo(bool useIntVals, NSObject? other) { + return _lib._objc_msgSend_20(_id, _lib._sel_multiply_withOtherFoo_1, + useIntVals, other?._id ?? ffi.nullptr); } void setDoubleVal(double x) { @@ -1268,9 +1268,9 @@ class NSObject extends _ObjCWrapper { _lib._sel_instancesRespondToSelector_1, aSelector); } - static bool conformsToProtocol(NativeObjCLibrary _lib, NSObject protocol) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol._id); + static bool conformsToProtocol(NativeObjCLibrary _lib, NSObject? protocol) { + return _lib._objc_msgSend_4(_lib._class_NSObject1, + _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); } IMP methodForSelector(ffi.Pointer aSelector) { @@ -1293,8 +1293,9 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - void forwardInvocation(NSObject anInvocation) { - _lib._objc_msgSend_8(_id, _lib._sel_forwardInvocation_1, anInvocation._id); + void forwardInvocation(NSObject? anInvocation) { + _lib._objc_msgSend_8( + _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); } NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { @@ -1410,9 +1411,9 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString initWithCoder(NSObject coder) { - final _ret = - _lib._objc_msgSend_13(_id, _lib._sel_initWithCoder_1, coder._id); + NSString initWithCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } diff --git a/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart b/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart new file mode 100644 index 0000000000..2350bb5d39 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart @@ -0,0 +1,1230 @@ +// ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; + +/// Tests calling Objective-C methods +class NullableTestObjCLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + NullableTestObjCLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NullableTestObjCLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + late final ffi.Pointer _NSFoundationVersionNumber = + _lookup('NSFoundationVersionNumber'); + + double get NSFoundationVersionNumber => _NSFoundationVersionNumber.value; + + set NSFoundationVersionNumber(double value) => + _NSFoundationVersionNumber.value = value; + + late final ffi.Pointer _NSNotFound = + _lookup('NSNotFound'); + + int get NSNotFound => _NSNotFound.value; + + set NSNotFound(int value) => _NSNotFound.value = value; + + late final ffi.Pointer _kCFCoreFoundationVersionNumber = + _lookup('kCFCoreFoundationVersionNumber'); + + double get kCFCoreFoundationVersionNumber => + _kCFCoreFoundationVersionNumber.value; + + set kCFCoreFoundationVersionNumber(double value) => + _kCFCoreFoundationVersionNumber.value = value; + + late final ffi.Pointer _kCFNotFound = + _lookup('kCFNotFound'); + + int get kCFNotFound => _kCFNotFound.value; + + set kCFNotFound(int value) => _kCFNotFound.value = value; + + late final ffi.Pointer _kCFNull = _lookup('kCFNull'); + + CFNullRef get kCFNull => _kCFNull.value; + + set kCFNull(CFNullRef value) => _kCFNull.value = value; + + late final ffi.Pointer _kCFAllocatorDefault = + _lookup('kCFAllocatorDefault'); + + CFAllocatorRef get kCFAllocatorDefault => _kCFAllocatorDefault.value; + + set kCFAllocatorDefault(CFAllocatorRef value) => + _kCFAllocatorDefault.value = value; + + late final ffi.Pointer _kCFAllocatorSystemDefault = + _lookup('kCFAllocatorSystemDefault'); + + CFAllocatorRef get kCFAllocatorSystemDefault => + _kCFAllocatorSystemDefault.value; + + set kCFAllocatorSystemDefault(CFAllocatorRef value) => + _kCFAllocatorSystemDefault.value = value; + + late final ffi.Pointer _kCFAllocatorMalloc = + _lookup('kCFAllocatorMalloc'); + + CFAllocatorRef get kCFAllocatorMalloc => _kCFAllocatorMalloc.value; + + set kCFAllocatorMalloc(CFAllocatorRef value) => + _kCFAllocatorMalloc.value = value; + + late final ffi.Pointer _kCFAllocatorMallocZone = + _lookup('kCFAllocatorMallocZone'); + + CFAllocatorRef get kCFAllocatorMallocZone => _kCFAllocatorMallocZone.value; + + set kCFAllocatorMallocZone(CFAllocatorRef value) => + _kCFAllocatorMallocZone.value = value; + + late final ffi.Pointer _kCFAllocatorNull = + _lookup('kCFAllocatorNull'); + + CFAllocatorRef get kCFAllocatorNull => _kCFAllocatorNull.value; + + set kCFAllocatorNull(CFAllocatorRef value) => _kCFAllocatorNull.value = value; + + late final ffi.Pointer _kCFAllocatorUseContext = + _lookup('kCFAllocatorUseContext'); + + CFAllocatorRef get kCFAllocatorUseContext => _kCFAllocatorUseContext.value; + + set kCFAllocatorUseContext(CFAllocatorRef value) => + _kCFAllocatorUseContext.value = value; + + ffi.Pointer _registerName1(String name) { + final cstr = name.toNativeUtf8(); + final sel = _sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; + } + + ffi.Pointer _sel_registerName( + ffi.Pointer str, + ) { + return __sel_registerName( + str, + ); + } + + late final __sel_registerNamePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sel_registerName'); + late final __sel_registerName = __sel_registerNamePtr + .asFunction Function(ffi.Pointer)>(); + + ffi.Pointer _getClass1(String name) { + final cstr = name.toNativeUtf8(); + final clazz = _objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; + } + + ffi.Pointer _objc_getClass( + ffi.Pointer str, + ) { + return __objc_getClass( + str, + ); + } + + late final __objc_getClassPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('objc_getClass'); + late final __objc_getClass = __objc_getClassPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); + + late final ffi.Pointer _class_NullableInterface1 = + _getClass1("NullableInterface"); + late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); + late final ffi.Pointer _sel_load1 = _registerName1("load"); + void _objc_msgSend_0( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_0( + obj, + sel, + ); + } + + late final __objc_msgSend_0Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_initialize1 = + _registerName1("initialize"); + late final ffi.Pointer _sel_init1 = _registerName1("init"); + instancetype _objc_msgSend_1( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1( + obj, + sel, + ); + } + + late final __objc_msgSend_1Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_new1 = _registerName1("new"); + late final ffi.Pointer _sel_allocWithZone_1 = + _registerName1("allocWithZone:"); + instancetype _objc_msgSend_2( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_2( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_2Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>(); + + late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); + late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); + late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); + late final ffi.Pointer _sel_copy1 = _registerName1("copy"); + late final ffi.Pointer _sel_mutableCopy1 = + _registerName1("mutableCopy"); + late final ffi.Pointer _sel_copyWithZone_1 = + _registerName1("copyWithZone:"); + late final ffi.Pointer _sel_mutableCopyWithZone_1 = + _registerName1("mutableCopyWithZone:"); + late final ffi.Pointer _sel_instancesRespondToSelector_1 = + _registerName1("instancesRespondToSelector:"); + bool _objc_msgSend_3( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_3( + obj, + sel, + aSelector, + ) != + 0; + } + + late final __objc_msgSend_3Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_conformsToProtocol_1 = + _registerName1("conformsToProtocol:"); + bool _objc_msgSend_4( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer protocol, + ) { + return __objc_msgSend_4( + obj, + sel, + protocol, + ) != + 0; + } + + late final __objc_msgSend_4Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_methodForSelector_1 = + _registerName1("methodForSelector:"); + IMP _objc_msgSend_5( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_5( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_5Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_instanceMethodForSelector_1 = + _registerName1("instanceMethodForSelector:"); + late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = + _registerName1("doesNotRecognizeSelector:"); + void _objc_msgSend_6( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_6( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_6Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_forwardingTargetForSelector_1 = + _registerName1("forwardingTargetForSelector:"); + ffi.Pointer _objc_msgSend_7( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_7( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_7Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_forwardInvocation_1 = + _registerName1("forwardInvocation:"); + void _objc_msgSend_8( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anInvocation, + ) { + return __objc_msgSend_8( + obj, + sel, + anInvocation, + ); + } + + late final __objc_msgSend_8Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _class_NSMethodSignature1 = + _getClass1("NSMethodSignature"); + late final ffi.Pointer _sel_methodSignatureForSelector_1 = + _registerName1("methodSignatureForSelector:"); + ffi.Pointer _objc_msgSend_9( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_9( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_9Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = + _registerName1("instanceMethodSignatureForSelector:"); + late final ffi.Pointer _sel_allowsWeakReference1 = + _registerName1("allowsWeakReference"); + bool _objc_msgSend_10( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_10( + obj, + sel, + ) != + 0; + } + + late final __objc_msgSend_10Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_retainWeakReference1 = + _registerName1("retainWeakReference"); + late final ffi.Pointer _sel_isSubclassOfClass_1 = + _registerName1("isSubclassOfClass:"); + late final ffi.Pointer _sel_resolveClassMethod_1 = + _registerName1("resolveClassMethod:"); + late final ffi.Pointer _sel_resolveInstanceMethod_1 = + _registerName1("resolveInstanceMethod:"); + late final ffi.Pointer _sel_hash1 = _registerName1("hash"); + int _objc_msgSend_11( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_11( + obj, + sel, + ); + } + + late final __objc_msgSend_11Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_superclass1 = + _registerName1("superclass"); + late final ffi.Pointer _sel_class1 = _registerName1("class"); + late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); + late final ffi.Pointer _sel_stringWithCString_encoding_1 = + _registerName1("stringWithCString:encoding:"); + ffi.Pointer _objc_msgSend_12( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cString, + int enc, + ) { + return __objc_msgSend_12( + obj, + sel, + cString, + enc, + ); + } + + late final __objc_msgSend_12Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + pkg_ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_UTF8String1 = + _registerName1("UTF8String"); + ffi.Pointer _objc_msgSend_13( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_13( + obj, + sel, + ); + } + + late final __objc_msgSend_13Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_description1 = + _registerName1("description"); + ffi.Pointer _objc_msgSend_14( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_14( + obj, + sel, + ); + } + + late final __objc_msgSend_14Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_debugDescription1 = + _registerName1("debugDescription"); + late final ffi.Pointer _sel_isNullWithNullableNSObjectArg_1 = + _registerName1("isNullWithNullableNSObjectArg:"); + late final ffi.Pointer _sel_isNullWithNotNullableNSObjectPtrArg_1 = + _registerName1("isNullWithNotNullableNSObjectPtrArg:"); +} + +abstract class NSComparisonResult { + static const int NSOrderedAscending = -1; + static const int NSOrderedSame = 0; + static const int NSOrderedDescending = 1; +} + +abstract class NSEnumerationOptions { + static const int NSEnumerationConcurrent = 1; + static const int NSEnumerationReverse = 2; +} + +abstract class NSSortOptions { + static const int NSSortConcurrent = 1; + static const int NSSortStable = 16; +} + +abstract class NSQualityOfService { + static const int NSQualityOfServiceUserInteractive = 33; + static const int NSQualityOfServiceUserInitiated = 25; + static const int NSQualityOfServiceUtility = 17; + static const int NSQualityOfServiceBackground = 9; + static const int NSQualityOfServiceDefault = -1; +} + +typedef NSInteger = pkg_ffi.Long; + +class __CFString extends ffi.Opaque {} + +abstract class CFComparisonResult { + static const int kCFCompareLessThan = -1; + static const int kCFCompareEqualTo = 0; + static const int kCFCompareGreaterThan = 1; +} + +typedef CFIndex = pkg_ffi.Long; + +class CFRange extends ffi.Struct { + @CFIndex() + external int location; + + @CFIndex() + external int length; +} + +class __CFNull extends ffi.Opaque {} + +typedef CFNullRef = ffi.Pointer<__CFNull>; + +class __CFAllocator extends ffi.Opaque {} + +typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; + +class CFAllocatorContext extends ffi.Struct { + @CFIndex() + external int version; + + external ffi.Pointer info; + + external CFAllocatorRetainCallBack retain; + + external CFAllocatorReleaseCallBack release; + + external CFAllocatorCopyDescriptionCallBack copyDescription; + + external CFAllocatorAllocateCallBack allocate; + + external CFAllocatorReallocateCallBack reallocate; + + external CFAllocatorDeallocateCallBack deallocate; + + external CFAllocatorPreferredSizeCallBack preferredSize; +} + +typedef CFAllocatorRetainCallBack = ffi.Pointer< + ffi.NativeFunction Function(ffi.Pointer)>>; +typedef CFAllocatorReleaseCallBack + = ffi.Pointer)>>; +typedef CFAllocatorCopyDescriptionCallBack = ffi + .Pointer)>>; +typedef CFStringRef = ffi.Pointer<__CFString>; +typedef CFAllocatorAllocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + CFIndex, CFOptionFlags, ffi.Pointer)>>; +typedef CFOptionFlags = pkg_ffi.UnsignedLong; +typedef CFAllocatorReallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, CFIndex, + CFOptionFlags, ffi.Pointer)>>; +typedef CFAllocatorDeallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; +typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< + ffi.NativeFunction< + CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; + +class _ObjCWrapper { + final ffi.Pointer _id; + final NullableTestObjCLibrary _lib; + _ObjCWrapper._(this._id, this._lib); +} + +class NullableInterface extends NSObject { + NullableInterface._(ffi.Pointer id, NullableTestObjCLibrary lib) + : super._(id, lib); + + static NullableInterface castFrom(T other) { + return NullableInterface._(other._id, other._lib); + } + + static bool isNullWithNullableNSObjectArg( + NullableTestObjCLibrary _lib, NSObject? x) { + return _lib._objc_msgSend_4(_lib._class_NullableInterface1, + _lib._sel_isNullWithNullableNSObjectArg_1, x?._id ?? ffi.nullptr); + } + + static bool isNullWithNotNullableNSObjectPtrArg( + NullableTestObjCLibrary _lib, NSObject? x) { + return _lib._objc_msgSend_4(_lib._class_NullableInterface1, + _lib._sel_isNullWithNotNullableNSObjectPtrArg_1, x?._id ?? ffi.nullptr); + } + + static NullableInterface new1(NullableTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NullableInterface1, _lib._sel_new1); + return NullableInterface._(_ret, _lib); + } + + static NullableInterface alloc(NullableTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NullableInterface1, _lib._sel_alloc1); + return NullableInterface._(_ret, _lib); + } +} + +class ObjCSel extends ffi.Opaque {} + +class ObjCObject extends ffi.Opaque {} + +class NSObject extends _ObjCWrapper { + NSObject._(ffi.Pointer id, NullableTestObjCLibrary lib) + : super._(id, lib); + + static NSObject castFrom(T other) { + return NSObject._(other._id, other._lib); + } + + static void load(NullableTestObjCLibrary _lib) { + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); + } + + static void initialize(NullableTestObjCLibrary _lib) { + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); + } + + NSObject init() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); + return NSObject._(_ret, _lib); + } + + static NSObject new1(NullableTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); + return NSObject._(_ret, _lib); + } + + static NSObject allocWithZone( + NullableTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static NSObject alloc(NullableTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); + return NSObject._(_ret, _lib); + } + + void dealloc() { + _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); + } + + void finalize() { + _lib._objc_msgSend_0(_id, _lib._sel_finalize1); + } + + NSObject copy() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); + return NSObject._(_ret, _lib); + } + + NSObject mutableCopy() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); + return NSObject._(_ret, _lib); + } + + static NSObject copyWithZone( + NullableTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static NSObject mutableCopyWithZone( + NullableTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static bool instancesRespondToSelector( + NullableTestObjCLibrary _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_3(_lib._class_NSObject1, + _lib._sel_instancesRespondToSelector_1, aSelector); + } + + static bool conformsToProtocol( + NullableTestObjCLibrary _lib, NSObject? protocol) { + return _lib._objc_msgSend_4(_lib._class_NSObject1, + _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); + } + + IMP methodForSelector(ffi.Pointer aSelector) { + return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); + } + + static IMP instanceMethodForSelector( + NullableTestObjCLibrary _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_5(_lib._class_NSObject1, + _lib._sel_instanceMethodForSelector_1, aSelector); + } + + void doesNotRecognizeSelector(ffi.Pointer aSelector) { + _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); + } + + NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_7( + _id, _lib._sel_forwardingTargetForSelector_1, aSelector); + return NSObject._(_ret, _lib); + } + + void forwardInvocation(NSObject? anInvocation) { + _lib._objc_msgSend_8( + _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); + } + + NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_9( + _id, _lib._sel_methodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static NSMethodSignature instanceMethodSignatureForSelector( + NullableTestObjCLibrary _lib, ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, + _lib._sel_instanceMethodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + bool allowsWeakReference() { + return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); + } + + bool retainWeakReference() { + return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); + } + + static bool isSubclassOfClass(NullableTestObjCLibrary _lib, NSObject aClass) { + return _lib._objc_msgSend_4( + _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); + } + + static bool resolveClassMethod( + NullableTestObjCLibrary _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); + } + + static bool resolveInstanceMethod( + NullableTestObjCLibrary _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); + } + + static int hash(NullableTestObjCLibrary _lib) { + return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); + } + + static NSObject superclass(NullableTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); + return NSObject._(_ret, _lib); + } + + static NSObject class1(NullableTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); + return NSObject._(_ret, _lib); + } + + static NSString description(NullableTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_14(_lib._class_NSObject1, _lib._sel_description1); + return NSString._(_ret, _lib); + } + + static NSString debugDescription(NullableTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_14( + _lib._class_NSObject1, _lib._sel_debugDescription1); + return NSString._(_ret, _lib); + } +} + +typedef instancetype = ffi.Pointer; + +class _NSZone extends ffi.Opaque {} + +typedef IMP = ffi.Pointer>; + +class NSMethodSignature extends _ObjCWrapper { + NSMethodSignature._(ffi.Pointer id, NullableTestObjCLibrary lib) + : super._(id, lib); + + static NSMethodSignature castFrom(T other) { + return NSMethodSignature._(other._id, other._lib); + } +} + +typedef NSUInteger = pkg_ffi.UnsignedLong; + +class NSString extends _ObjCWrapper { + NSString._(ffi.Pointer id, NullableTestObjCLibrary lib) + : super._(id, lib); + + static NSString castFrom(T other) { + return NSString._(other._id, other._lib); + } + + factory NSString(NullableTestObjCLibrary _lib, String str) { + final cstr = str.toNativeUtf8(); + final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + pkg_ffi.calloc.free(cstr); + return nsstr; + } + + @override + String toString() => UTF8String().cast().toDartString(); + + static NSString stringWithCString_encoding(NullableTestObjCLibrary _lib, + ffi.Pointer cString, int enc) { + final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); + return NSString._(_ret, _lib); + } + + ffi.Pointer UTF8String() { + return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); + } +} + +extension StringToNSString on String { + NSString toNSString(NullableTestObjCLibrary lib) => NSString(lib, this); +} + +const int NSScannedOption = 1; + +const int NSCollectorDisabledOption = 2; + +const int NS_BLOCKS_AVAILABLE = 1; + +const int __COREFOUNDATION_CFAVAILABILITY__ = 1; + +const int __CF_ENUM_FIXED_IS_AVAILABLE = 1; + +const double NSFoundationVersionNumber10_0 = 397.4; + +const double NSFoundationVersionNumber10_1 = 425.0; + +const double NSFoundationVersionNumber10_1_1 = 425.0; + +const double NSFoundationVersionNumber10_1_2 = 425.0; + +const double NSFoundationVersionNumber10_1_3 = 425.0; + +const double NSFoundationVersionNumber10_1_4 = 425.0; + +const double NSFoundationVersionNumber10_2 = 462.0; + +const double NSFoundationVersionNumber10_2_1 = 462.0; + +const double NSFoundationVersionNumber10_2_2 = 462.0; + +const double NSFoundationVersionNumber10_2_3 = 462.0; + +const double NSFoundationVersionNumber10_2_4 = 462.0; + +const double NSFoundationVersionNumber10_2_5 = 462.0; + +const double NSFoundationVersionNumber10_2_6 = 462.0; + +const double NSFoundationVersionNumber10_2_7 = 462.7; + +const double NSFoundationVersionNumber10_2_8 = 462.7; + +const double NSFoundationVersionNumber10_3 = 500.0; + +const double NSFoundationVersionNumber10_3_1 = 500.0; + +const double NSFoundationVersionNumber10_3_2 = 500.3; + +const double NSFoundationVersionNumber10_3_3 = 500.54; + +const double NSFoundationVersionNumber10_3_4 = 500.56; + +const double NSFoundationVersionNumber10_3_5 = 500.56; + +const double NSFoundationVersionNumber10_3_6 = 500.56; + +const double NSFoundationVersionNumber10_3_7 = 500.56; + +const double NSFoundationVersionNumber10_3_8 = 500.56; + +const double NSFoundationVersionNumber10_3_9 = 500.58; + +const double NSFoundationVersionNumber10_4 = 567.0; + +const double NSFoundationVersionNumber10_4_1 = 567.0; + +const double NSFoundationVersionNumber10_4_2 = 567.12; + +const double NSFoundationVersionNumber10_4_3 = 567.21; + +const double NSFoundationVersionNumber10_4_4_Intel = 567.23; + +const double NSFoundationVersionNumber10_4_4_PowerPC = 567.21; + +const double NSFoundationVersionNumber10_4_5 = 567.25; + +const double NSFoundationVersionNumber10_4_6 = 567.26; + +const double NSFoundationVersionNumber10_4_7 = 567.27; + +const double NSFoundationVersionNumber10_4_8 = 567.28; + +const double NSFoundationVersionNumber10_4_9 = 567.29; + +const double NSFoundationVersionNumber10_4_10 = 567.29; + +const double NSFoundationVersionNumber10_4_11 = 567.36; + +const double NSFoundationVersionNumber10_5 = 677.0; + +const double NSFoundationVersionNumber10_5_1 = 677.1; + +const double NSFoundationVersionNumber10_5_2 = 677.15; + +const double NSFoundationVersionNumber10_5_3 = 677.19; + +const double NSFoundationVersionNumber10_5_4 = 677.19; + +const double NSFoundationVersionNumber10_5_5 = 677.21; + +const double NSFoundationVersionNumber10_5_6 = 677.22; + +const double NSFoundationVersionNumber10_5_7 = 677.24; + +const double NSFoundationVersionNumber10_5_8 = 677.26; + +const double NSFoundationVersionNumber10_6 = 751.0; + +const double NSFoundationVersionNumber10_6_1 = 751.0; + +const double NSFoundationVersionNumber10_6_2 = 751.14; + +const double NSFoundationVersionNumber10_6_3 = 751.21; + +const double NSFoundationVersionNumber10_6_4 = 751.29; + +const double NSFoundationVersionNumber10_6_5 = 751.42; + +const double NSFoundationVersionNumber10_6_6 = 751.53; + +const double NSFoundationVersionNumber10_6_7 = 751.53; + +const double NSFoundationVersionNumber10_6_8 = 751.62; + +const double NSFoundationVersionNumber10_7 = 833.1; + +const double NSFoundationVersionNumber10_7_1 = 833.1; + +const double NSFoundationVersionNumber10_7_2 = 833.2; + +const double NSFoundationVersionNumber10_7_3 = 833.24; + +const double NSFoundationVersionNumber10_7_4 = 833.25; + +const double NSFoundationVersionNumber10_8 = 945.0; + +const double NSFoundationVersionNumber10_8_1 = 945.0; + +const double NSFoundationVersionNumber10_8_2 = 945.11; + +const double NSFoundationVersionNumber10_8_3 = 945.16; + +const double NSFoundationVersionNumber10_8_4 = 945.18; + +const int NSFoundationVersionNumber10_9 = 1056; + +const int NSFoundationVersionNumber10_9_1 = 1056; + +const double NSFoundationVersionNumber10_9_2 = 1056.13; + +const double NSFoundationVersionNumber10_10 = 1151.16; + +const double NSFoundationVersionNumber10_10_1 = 1151.16; + +const double NSFoundationVersionNumber10_10_2 = 1152.14; + +const double NSFoundationVersionNumber10_10_3 = 1153.2; + +const double NSFoundationVersionNumber10_10_4 = 1153.2; + +const int NSFoundationVersionNumber10_10_5 = 1154; + +const int NSFoundationVersionNumber10_10_Max = 1199; + +const int NSFoundationVersionNumber10_11 = 1252; + +const double NSFoundationVersionNumber10_11_1 = 1255.1; + +const double NSFoundationVersionNumber10_11_2 = 1256.1; + +const double NSFoundationVersionNumber10_11_3 = 1256.1; + +const int NSFoundationVersionNumber10_11_4 = 1258; + +const int NSFoundationVersionNumber10_11_Max = 1299; + +const int __COREFOUNDATION_CFBASE__ = 1; + +const int TRUE = 1; + +const int FALSE = 0; + +const double kCFCoreFoundationVersionNumber10_0 = 196.4; + +const double kCFCoreFoundationVersionNumber10_0_3 = 196.5; + +const double kCFCoreFoundationVersionNumber10_1 = 226.0; + +const double kCFCoreFoundationVersionNumber10_1_1 = 226.0; + +const double kCFCoreFoundationVersionNumber10_1_2 = 227.2; + +const double kCFCoreFoundationVersionNumber10_1_3 = 227.2; + +const double kCFCoreFoundationVersionNumber10_1_4 = 227.3; + +const double kCFCoreFoundationVersionNumber10_2 = 263.0; + +const double kCFCoreFoundationVersionNumber10_2_1 = 263.1; + +const double kCFCoreFoundationVersionNumber10_2_2 = 263.1; + +const double kCFCoreFoundationVersionNumber10_2_3 = 263.3; + +const double kCFCoreFoundationVersionNumber10_2_4 = 263.3; + +const double kCFCoreFoundationVersionNumber10_2_5 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_6 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_7 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_8 = 263.5; + +const double kCFCoreFoundationVersionNumber10_3 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_1 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_2 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_3 = 299.3; + +const double kCFCoreFoundationVersionNumber10_3_4 = 299.31; + +const double kCFCoreFoundationVersionNumber10_3_5 = 299.31; + +const double kCFCoreFoundationVersionNumber10_3_6 = 299.32; + +const double kCFCoreFoundationVersionNumber10_3_7 = 299.33; + +const double kCFCoreFoundationVersionNumber10_3_8 = 299.33; + +const double kCFCoreFoundationVersionNumber10_3_9 = 299.35; + +const double kCFCoreFoundationVersionNumber10_4 = 368.0; + +const double kCFCoreFoundationVersionNumber10_4_1 = 368.1; + +const double kCFCoreFoundationVersionNumber10_4_2 = 368.11; + +const double kCFCoreFoundationVersionNumber10_4_3 = 368.18; + +const double kCFCoreFoundationVersionNumber10_4_4_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_4_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_5_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_5_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_6_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_6_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_7 = 368.27; + +const double kCFCoreFoundationVersionNumber10_4_8 = 368.27; + +const double kCFCoreFoundationVersionNumber10_4_9 = 368.28; + +const double kCFCoreFoundationVersionNumber10_4_10 = 368.28; + +const double kCFCoreFoundationVersionNumber10_4_11 = 368.31; + +const double kCFCoreFoundationVersionNumber10_5 = 476.0; + +const double kCFCoreFoundationVersionNumber10_5_1 = 476.0; + +const double kCFCoreFoundationVersionNumber10_5_2 = 476.1; + +const double kCFCoreFoundationVersionNumber10_5_3 = 476.13; + +const double kCFCoreFoundationVersionNumber10_5_4 = 476.14; + +const double kCFCoreFoundationVersionNumber10_5_5 = 476.15; + +const double kCFCoreFoundationVersionNumber10_5_6 = 476.17; + +const double kCFCoreFoundationVersionNumber10_5_7 = 476.18; + +const double kCFCoreFoundationVersionNumber10_5_8 = 476.19; + +const double kCFCoreFoundationVersionNumber10_6 = 550.0; + +const double kCFCoreFoundationVersionNumber10_6_1 = 550.0; + +const double kCFCoreFoundationVersionNumber10_6_2 = 550.13; + +const double kCFCoreFoundationVersionNumber10_6_3 = 550.19; + +const double kCFCoreFoundationVersionNumber10_6_4 = 550.29; + +const double kCFCoreFoundationVersionNumber10_6_5 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_6 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_7 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_8 = 550.43; + +const double kCFCoreFoundationVersionNumber10_7 = 635.0; + +const double kCFCoreFoundationVersionNumber10_7_1 = 635.0; + +const double kCFCoreFoundationVersionNumber10_7_2 = 635.15; + +const double kCFCoreFoundationVersionNumber10_7_3 = 635.19; + +const double kCFCoreFoundationVersionNumber10_7_4 = 635.21; + +const double kCFCoreFoundationVersionNumber10_7_5 = 635.21; + +const double kCFCoreFoundationVersionNumber10_8 = 744.0; + +const double kCFCoreFoundationVersionNumber10_8_1 = 744.0; + +const double kCFCoreFoundationVersionNumber10_8_2 = 744.12; + +const double kCFCoreFoundationVersionNumber10_8_3 = 744.18; + +const double kCFCoreFoundationVersionNumber10_8_4 = 744.19; + +const double kCFCoreFoundationVersionNumber10_9 = 855.11; + +const double kCFCoreFoundationVersionNumber10_9_1 = 855.11; + +const double kCFCoreFoundationVersionNumber10_9_2 = 855.14; + +const double kCFCoreFoundationVersionNumber10_10 = 1151.16; + +const double kCFCoreFoundationVersionNumber10_10_1 = 1151.16; + +const int kCFCoreFoundationVersionNumber10_10_2 = 1152; + +const double kCFCoreFoundationVersionNumber10_10_3 = 1153.18; + +const double kCFCoreFoundationVersionNumber10_10_4 = 1153.18; + +const double kCFCoreFoundationVersionNumber10_10_5 = 1153.18; + +const int kCFCoreFoundationVersionNumber10_10_Max = 1199; + +const int kCFCoreFoundationVersionNumber10_11 = 1253; + +const double kCFCoreFoundationVersionNumber10_11_1 = 1255.1; + +const double kCFCoreFoundationVersionNumber10_11_2 = 1256.14; + +const double kCFCoreFoundationVersionNumber10_11_3 = 1256.14; + +const double kCFCoreFoundationVersionNumber10_11_4 = 1258.1; + +const int kCFCoreFoundationVersionNumber10_11_Max = 1299; + +const int ISA_PTRAUTH_DISCRIMINATOR = 27361; diff --git a/pkgs/ffigen/test/native_objc_test/nullable_config.yaml b/pkgs/ffigen/test/native_objc_test/nullable_config.yaml new file mode 100644 index 0000000000..1d59062875 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/nullable_config.yaml @@ -0,0 +1,12 @@ +name: NullableTestObjCLibrary +description: 'Tests calling Objective-C methods' +language: objc +output: 'test/native_objc_test/nullable_bindings.dart' +functions: + exclude: + - '.*' +headers: + entry-points: + - 'test/native_objc_test/nullable_test.m' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/nullable_test.dart b/pkgs/ffigen/test/native_objc_test/nullable_test.dart new file mode 100644 index 0000000000..fe15f8d416 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/nullable_test.dart @@ -0,0 +1,71 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:ffigen/ffigen.dart'; +import 'package:path/path.dart' as path; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart'; +import '../test_utils.dart'; +import 'nullable_bindings.dart'; + +void main() { + late NullableTestObjCLibrary lib; + late NSObject obj; + group('method calls', () { + setUpAll(() { + logWarnings(); + final dylib = File('test/native_objc_test/nullable_test.dylib'); + verifySetupFile(dylib); + lib = NullableTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); + obj = NSObject.new1(lib); + }); + + test('generate_bindings', () { + final config = Config.fromYaml(loadYaml( + File(path.join('test', 'native_objc_test', 'nullable_config.yaml')) + .readAsStringSync()) as YamlMap); + final library = parse(config); + final file = File( + path.join('test', 'debug_generated', 'nullable_test.dart'), + ); + library.generateFile(file); + + try { + final actual = file.readAsStringSync(); + final expected = File(path.join(config.output)).readAsStringSync(); + expect(actual, expected); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + print('Failed test: Debug generated file: ${file.absolute.path}'); + rethrow; + } + }); + + group('Nullable arguments', () { + test('Not null', () { + expect( + NullableInterface.isNullWithNullableNSObjectArg(lib, obj), false); + }); + test('Null', () { + expect( + NullableInterface.isNullWithNullableNSObjectArg(lib, null), true); + }); + }); + + group('Not-nullable arguments', () { + test('Not null', () { + expect(NullableInterface.isNullWithNotNullableNSObjectPtrArg(lib, obj), + false); + }); + }); + }); +} diff --git a/pkgs/ffigen/test/native_objc_test/nullable_test.m b/pkgs/ffigen/test/native_objc_test/nullable_test.m new file mode 100644 index 0000000000..4733493f0a --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/nullable_test.m @@ -0,0 +1,21 @@ +#import + +@interface NullableInterface : NSObject { +} + ++(BOOL) isNullWithNullableNSObjectArg:(nullable NSObject *)x; ++(BOOL) isNullWithNotNullableNSObjectPtrArg:(NSObject *)x; + +@end + +@implementation NullableInterface + ++(BOOL) isNullWithNullableNSObjectArg:(nullable NSObject *)x { + return x == NULL; +} + ++(BOOL) isNullWithNotNullableNSObjectPtrArg:(NSObject *)x { + return x == NULL; +} + +@end diff --git a/pkgs/ffigen/test/native_objc_test/property_bindings.dart b/pkgs/ffigen/test/native_objc_test/property_bindings.dart index f8367742d4..353d0c13d9 100644 --- a/pkgs/ffigen/test/native_objc_test/property_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/property_bindings.dart @@ -795,9 +795,9 @@ class NSObject extends _ObjCWrapper { } static bool conformsToProtocol( - PropertyTestObjCLibrary _lib, NSObject protocol) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol._id); + PropertyTestObjCLibrary _lib, NSObject? protocol) { + return _lib._objc_msgSend_4(_lib._class_NSObject1, + _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); } IMP methodForSelector(ffi.Pointer aSelector) { @@ -820,8 +820,9 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - void forwardInvocation(NSObject anInvocation) { - _lib._objc_msgSend_8(_id, _lib._sel_forwardInvocation_1, anInvocation._id); + void forwardInvocation(NSObject? anInvocation) { + _lib._objc_msgSend_8( + _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); } NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { diff --git a/pkgs/ffigen/test/native_objc_test/setup.dart b/pkgs/ffigen/test/native_objc_test/setup.dart index 86368a124e..37e5eacc5b 100644 --- a/pkgs/ffigen/test/native_objc_test/setup.dart +++ b/pkgs/ffigen/test/native_objc_test/setup.dart @@ -34,6 +34,7 @@ Future main(List arguments) async { print('Building Dynamic Library for Objective C Native Tests...'); await _buildLib('native_objc_test.m', 'native_objc_test.dylib'); await _buildLib('method_test.m', 'method_test.dylib'); + await _buildLib('nullable_test.m', 'nullable_test.dylib'); await _buildLib('property_test.m', 'property_test.dylib'); await _buildLib('string_test.m', 'string_test.dylib'); } diff --git a/pkgs/ffigen/test/native_objc_test/string_bindings.dart b/pkgs/ffigen/test/native_objc_test/string_bindings.dart index a4220e5814..e1f64f2ba2 100644 --- a/pkgs/ffigen/test/native_objc_test/string_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/string_bindings.dart @@ -2653,9 +2653,9 @@ class NSValue extends NSObject { return NSValue._(_ret, _lib); } - NSValue initWithCoder(NSObject coder) { - final _ret = - _lib._objc_msgSend_13(_id, _lib._sel_initWithCoder_1, coder._id); + NSValue initWithCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); return NSValue._(_ret, _lib); } @@ -2751,9 +2751,9 @@ class NSObject extends _ObjCWrapper { } static bool conformsToProtocol( - StringTestObjCLibrary _lib, NSObject protocol) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol._id); + StringTestObjCLibrary _lib, NSObject? protocol) { + return _lib._objc_msgSend_4(_lib._class_NSObject1, + _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); } IMP methodForSelector(ffi.Pointer aSelector) { @@ -2776,8 +2776,9 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - void forwardInvocation(NSObject anInvocation) { - _lib._objc_msgSend_8(_id, _lib._sel_forwardInvocation_1, anInvocation._id); + void forwardInvocation(NSObject? anInvocation) { + _lib._objc_msgSend_8( + _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); } NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { @@ -2895,9 +2896,9 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString initWithCoder(NSObject coder) { - final _ret = - _lib._objc_msgSend_13(_id, _lib._sel_initWithCoder_1, coder._id); + NSString initWithCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } @@ -2938,9 +2939,9 @@ class NSNumber extends NSValue { } @override - NSNumber initWithCoder(NSObject coder) { - final _ret = - _lib._objc_msgSend_13(_id, _lib._sel_initWithCoder_1, coder._id); + NSNumber initWithCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); return NSNumber._(_ret, _lib); } @@ -3091,12 +3092,14 @@ class NSNumber extends NSValue { return NSObject._(_ret, _lib); } - int compare(NSObject otherNumber) { - return _lib._objc_msgSend_43(_id, _lib._sel_compare_1, otherNumber._id); + int compare(NSObject? otherNumber) { + return _lib._objc_msgSend_43( + _id, _lib._sel_compare_1, otherNumber?._id ?? ffi.nullptr); } - bool isEqualToNumber(NSObject number) { - return _lib._objc_msgSend_4(_id, _lib._sel_isEqualToNumber_1, number._id); + bool isEqualToNumber(NSObject? number) { + return _lib._objc_msgSend_4( + _id, _lib._sel_isEqualToNumber_1, number?._id ?? ffi.nullptr); } NSString descriptionWithLocale(NSObject locale) { @@ -3264,9 +3267,9 @@ class NSIndexSet extends NSObject { return NSIndexSet._(_ret, _lib); } - NSIndexSet initWithIndexSet(NSObject indexSet) { - final _ret = - _lib._objc_msgSend_13(_id, _lib._sel_initWithIndexSet_1, indexSet._id); + NSIndexSet initWithIndexSet(NSObject? indexSet) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithIndexSet_1, indexSet?._id ?? ffi.nullptr); return NSIndexSet._(_ret, _lib); } @@ -3275,9 +3278,9 @@ class NSIndexSet extends NSObject { return NSIndexSet._(_ret, _lib); } - bool isEqualToIndexSet(NSObject indexSet) { + bool isEqualToIndexSet(NSObject? indexSet) { return _lib._objc_msgSend_4( - _id, _lib._sel_isEqualToIndexSet_1, indexSet._id); + _id, _lib._sel_isEqualToIndexSet_1, indexSet?._id ?? ffi.nullptr); } int get count { @@ -3333,8 +3336,9 @@ class NSIndexSet extends NSObject { _id, _lib._sel_containsIndexesInRange_1, range); } - bool containsIndexes(NSObject indexSet) { - return _lib._objc_msgSend_4(_id, _lib._sel_containsIndexes_1, indexSet._id); + bool containsIndexes(NSObject? indexSet) { + return _lib._objc_msgSend_4( + _id, _lib._sel_containsIndexes_1, indexSet?._id ?? ffi.nullptr); } bool intersectsIndexesInRange(NSRange range) { @@ -3447,12 +3451,14 @@ class NSMutableIndexSet extends NSIndexSet { return NSMutableIndexSet._(other._id, other._lib); } - void addIndexes(NSObject indexSet) { - _lib._objc_msgSend_8(_id, _lib._sel_addIndexes_1, indexSet._id); + void addIndexes(NSObject? indexSet) { + _lib._objc_msgSend_8( + _id, _lib._sel_addIndexes_1, indexSet?._id ?? ffi.nullptr); } - void removeIndexes(NSObject indexSet) { - _lib._objc_msgSend_8(_id, _lib._sel_removeIndexes_1, indexSet._id); + void removeIndexes(NSObject? indexSet) { + _lib._objc_msgSend_8( + _id, _lib._sel_removeIndexes_1, indexSet?._id ?? ffi.nullptr); } void removeAllIndexes() { @@ -3531,43 +3537,43 @@ class NSOrderedCollectionDifference extends NSObject { return NSOrderedCollectionDifference._(other._id, other._lib); } - NSOrderedCollectionDifference initWithChanges(NSObject changes) { - final _ret = - _lib._objc_msgSend_13(_id, _lib._sel_initWithChanges_1, changes._id); + NSOrderedCollectionDifference initWithChanges(NSObject? changes) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithChanges_1, changes?._id ?? ffi.nullptr); return NSOrderedCollectionDifference._(_ret, _lib); } NSOrderedCollectionDifference initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges( - NSObject inserts, - NSObject insertedObjects, - NSObject removes, - NSObject removedObjects, - NSObject changes) { + NSObject? inserts, + NSObject? insertedObjects, + NSObject? removes, + NSObject? removedObjects, + NSObject? changes) { final _ret = _lib._objc_msgSend_66( _id, _lib._sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges_1, - inserts._id, - insertedObjects._id, - removes._id, - removedObjects._id, - changes._id); + inserts?._id ?? ffi.nullptr, + insertedObjects?._id ?? ffi.nullptr, + removes?._id ?? ffi.nullptr, + removedObjects?._id ?? ffi.nullptr, + changes?._id ?? ffi.nullptr); return NSOrderedCollectionDifference._(_ret, _lib); } NSOrderedCollectionDifference initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects( - NSObject inserts, - NSObject insertedObjects, - NSObject removes, - NSObject removedObjects) { + NSObject? inserts, + NSObject? insertedObjects, + NSObject? removes, + NSObject? removedObjects) { final _ret = _lib._objc_msgSend_67( _id, _lib._sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_1, - inserts._id, - insertedObjects._id, - removes._id, - removedObjects._id); + inserts?._id ?? ffi.nullptr, + insertedObjects?._id ?? ffi.nullptr, + removes?._id ?? ffi.nullptr, + removedObjects?._id ?? ffi.nullptr); return NSOrderedCollectionDifference._(_ret, _lib); } @@ -3633,9 +3639,9 @@ class NSArray extends NSObject { return NSArray._(_ret, _lib); } - NSArray initWithCoder(NSObject coder) { - final _ret = - _lib._objc_msgSend_13(_id, _lib._sel_initWithCoder_1, coder._id); + NSArray initWithCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); return NSArray._(_ret, _lib); } @@ -3699,9 +3705,9 @@ class NSMutableArray extends NSArray { } @override - NSMutableArray initWithCoder(NSObject coder) { - final _ret = - _lib._objc_msgSend_13(_id, _lib._sel_initWithCoder_1, coder._id); + NSMutableArray initWithCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); return NSMutableArray._(_ret, _lib); } @@ -3744,25 +3750,25 @@ class NSItemProvider extends NSObject { } void registerDataRepresentationForTypeIdentifier_visibility_loadHandler( - NSObject typeIdentifier, int visibility, NSObject loadHandler) { + NSObject? typeIdentifier, int visibility, NSObject loadHandler) { _lib._objc_msgSend_71( _id, _lib._sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1, - typeIdentifier._id, + typeIdentifier?._id ?? ffi.nullptr, visibility, loadHandler._id); } void registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler( - NSObject typeIdentifier, + NSObject? typeIdentifier, int fileOptions, int visibility, NSObject loadHandler) { _lib._objc_msgSend_72( _id, _lib._sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1, - typeIdentifier._id, + typeIdentifier?._id ?? ffi.nullptr, fileOptions, visibility, loadHandler._id); @@ -3774,46 +3780,48 @@ class NSItemProvider extends NSObject { return NSObject._(_ret, _lib); } - bool hasItemConformingToTypeIdentifier(NSObject typeIdentifier) { + bool hasItemConformingToTypeIdentifier(NSObject? typeIdentifier) { return _lib._objc_msgSend_4( - _id, _lib._sel_hasItemConformingToTypeIdentifier_1, typeIdentifier._id); + _id, + _lib._sel_hasItemConformingToTypeIdentifier_1, + typeIdentifier?._id ?? ffi.nullptr); } bool hasRepresentationConformingToTypeIdentifier_fileOptions( - NSObject typeIdentifier, int fileOptions) { + NSObject? typeIdentifier, int fileOptions) { return _lib._objc_msgSend_73( _id, _lib._sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1, - typeIdentifier._id, + typeIdentifier?._id ?? ffi.nullptr, fileOptions); } NSProgress loadDataRepresentationForTypeIdentifier_completionHandler( - NSObject typeIdentifier, NSObject completionHandler) { + NSObject? typeIdentifier, NSObject completionHandler) { final _ret = _lib._objc_msgSend_74( _id, _lib._sel_loadDataRepresentationForTypeIdentifier_completionHandler_1, - typeIdentifier._id, + typeIdentifier?._id ?? ffi.nullptr, completionHandler._id); return NSProgress._(_ret, _lib); } NSProgress loadFileRepresentationForTypeIdentifier_completionHandler( - NSObject typeIdentifier, NSObject completionHandler) { + NSObject? typeIdentifier, NSObject completionHandler) { final _ret = _lib._objc_msgSend_74( _id, _lib._sel_loadFileRepresentationForTypeIdentifier_completionHandler_1, - typeIdentifier._id, + typeIdentifier?._id ?? ffi.nullptr, completionHandler._id); return NSProgress._(_ret, _lib); } NSProgress loadInPlaceFileRepresentationForTypeIdentifier_completionHandler( - NSObject typeIdentifier, NSObject completionHandler) { + NSObject? typeIdentifier, NSObject completionHandler) { final _ret = _lib._objc_msgSend_74( _id, _lib._sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1, - typeIdentifier._id, + typeIdentifier?._id ?? ffi.nullptr, completionHandler._id); return NSProgress._(_ret, _lib); } @@ -3827,73 +3835,76 @@ class NSItemProvider extends NSObject { _lib._objc_msgSend_8(_id, _lib._sel_setSuggestedName_1, value._id); } - NSItemProvider initWithObject(NSObject object) { - final _ret = - _lib._objc_msgSend_13(_id, _lib._sel_initWithObject_1, object._id); + NSItemProvider initWithObject(NSObject? object) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithObject_1, object?._id ?? ffi.nullptr); return NSItemProvider._(_ret, _lib); } - void registerObject_visibility(NSObject object, int visibility) { - _lib._objc_msgSend_75( - _id, _lib._sel_registerObject_visibility_1, object._id, visibility); + void registerObject_visibility(NSObject? object, int visibility) { + _lib._objc_msgSend_75(_id, _lib._sel_registerObject_visibility_1, + object?._id ?? ffi.nullptr, visibility); } void registerObjectOfClass_visibility_loadHandler( - NSObject aClass, int visibility, NSObject loadHandler) { + NSObject? aClass, int visibility, NSObject loadHandler) { _lib._objc_msgSend_71( _id, _lib._sel_registerObjectOfClass_visibility_loadHandler_1, - aClass._id, + aClass?._id ?? ffi.nullptr, visibility, loadHandler._id); } - bool canLoadObjectOfClass(NSObject aClass) { + bool canLoadObjectOfClass(NSObject? aClass) { return _lib._objc_msgSend_4( - _id, _lib._sel_canLoadObjectOfClass_1, aClass._id); + _id, _lib._sel_canLoadObjectOfClass_1, aClass?._id ?? ffi.nullptr); } NSProgress loadObjectOfClass_completionHandler( - NSObject aClass, NSObject completionHandler) { + NSObject? aClass, NSObject completionHandler) { final _ret = _lib._objc_msgSend_74( _id, _lib._sel_loadObjectOfClass_completionHandler_1, - aClass._id, + aClass?._id ?? ffi.nullptr, completionHandler._id); return NSProgress._(_ret, _lib); } NSItemProvider initWithItem_typeIdentifier( - NSObject item, NSObject typeIdentifier) { - final _ret = _lib._objc_msgSend_76(_id, - _lib._sel_initWithItem_typeIdentifier_1, item._id, typeIdentifier._id); + NSObject? item, NSObject? typeIdentifier) { + final _ret = _lib._objc_msgSend_76( + _id, + _lib._sel_initWithItem_typeIdentifier_1, + item?._id ?? ffi.nullptr, + typeIdentifier?._id ?? ffi.nullptr); return NSItemProvider._(_ret, _lib); } - NSItemProvider initWithContentsOfURL(NSObject fileURL) { + NSItemProvider initWithContentsOfURL(NSObject? fileURL) { final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithContentsOfURL_1, fileURL._id); + _id, _lib._sel_initWithContentsOfURL_1, fileURL?._id ?? ffi.nullptr); return NSItemProvider._(_ret, _lib); } void registerItemForTypeIdentifier_loadHandler( - NSObject typeIdentifier, NSItemProviderLoadHandler loadHandler) { + NSObject? typeIdentifier, NSItemProviderLoadHandler loadHandler) { _lib._objc_msgSend_77( _id, _lib._sel_registerItemForTypeIdentifier_loadHandler_1, - typeIdentifier._id, + typeIdentifier?._id ?? ffi.nullptr, loadHandler); } void loadItemForTypeIdentifier_options_completionHandler( - NSObject typeIdentifier, - NSObject options, + NSObject? typeIdentifier, + NSObject? options, NSItemProviderCompletionHandler completionHandler) { _lib._objc_msgSend_78( _id, _lib._sel_loadItemForTypeIdentifier_options_completionHandler_1, - typeIdentifier._id, - options._id, + typeIdentifier?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr, completionHandler); } @@ -3970,9 +3981,9 @@ class NSMutableString extends NSString { return NSMutableString._(other._id, other._lib); } - void replaceCharactersInRange_withString(NSRange range, NSObject aString) { + void replaceCharactersInRange_withString(NSRange range, NSObject? aString) { _lib._objc_msgSend_79(_id, _lib._sel_replaceCharactersInRange_withString_1, - range, aString._id); + range, aString?._id ?? ffi.nullptr); } static NSString stringWithCString_encoding( @@ -4062,9 +4073,12 @@ class StringUtil extends NSObject { } static NSString strConcat_with( - StringTestObjCLibrary _lib, NSObject a, NSObject b) { + StringTestObjCLibrary _lib, NSObject? a, NSObject? b) { final _ret = _lib._objc_msgSend_80( - _lib._class_StringUtil1, _lib._sel_strConcat_with_1, a._id, b._id); + _lib._class_StringUtil1, + _lib._sel_strConcat_with_1, + a?._id ?? ffi.nullptr, + b?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } diff --git a/pkgs/ffigen/test/regen.dart b/pkgs/ffigen/test/regen.dart index 7d78b6dbc1..675d414309 100644 --- a/pkgs/ffigen/test/regen.dart +++ b/pkgs/ffigen/test/regen.dart @@ -79,6 +79,11 @@ Future main(List args) async { File('test/native_objc_test/method_bindings.dart'), ); + await _regenConfig( + File('test/native_objc_test/nullable_config.yaml'), + File('test/native_objc_test/nullable_bindings.dart'), + ); + await _regenConfig( File('test/native_objc_test/property_config.yaml'), File('test/native_objc_test/property_bindings.dart'), diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index 2c398ed4e0..ccc6b46f60 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -40,6 +40,7 @@ enums: - CXTranslationUnit_Flags - CXEvalResultKind - CXObjCPropertyAttrKind + - CXTypeNullabilityKind structs: include: @@ -114,3 +115,4 @@ functions: - clang_Cursor_getObjCPropertyAttributes - clang_Cursor_getObjCPropertyGetterName - clang_Cursor_getObjCPropertySetterName + - clang_Type_getNullability From afe4f0d91e96312ae3858ddc5a135e9380de903d Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Fri, 29 Apr 2022 09:53:47 -0700 Subject: [PATCH 127/276] [ffigen] Don't automatically include system headers (#342) * Don't automatically include system headers * Add more filtering to header parser tests --- pkgs/ffigen/lib/src/header_parser/parser.dart | 5 ----- pkgs/ffigen/lib/src/strings.dart | 5 +---- .../header_parser_tests/objc_basic_types.h | 2 ++ .../objc_basic_types_test.dart | 18 ++++++++++++++++ .../test/header_parser_tests/objc_config.h | 2 ++ .../header_parser_tests/objc_config_test.dart | 21 +++++++++++++++++++ .../test/header_parser_tests/objc_interface.h | 2 ++ .../objc_interface_test.dart | 21 +++++++++++++++++++ 8 files changed, 67 insertions(+), 9 deletions(-) diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index 33c707286b..b400d847e7 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -67,11 +67,6 @@ List parseToBindings() { /// If the config targets Objective C, add a compiler opt for it. if (config.language == Language.objc) { compilerOpts.addAll(strings.clangLangObjC); - compilerOpts.add('-I' + strings.clangDefaultObjCSystemHeaderPath); - for (final sysHdr in strings.clangDefaultObjCSystemHeaders) { - compilerOpts.add(strings.clangInclude); - compilerOpts.add(sysHdr); - } } _logger.fine('CompilerOpts used: $compilerOpts'); diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 8e138f8487..f3bfb79545 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -39,15 +39,12 @@ const langObjC = 'objc'; const clangLangObjC = ['-x', 'objective-c']; const clangObjCBoolDefine = '__OBJC_BOOL_IS_BOOL'; const clangInclude = '-include'; -const clangDefaultObjCSystemHeaderPath = - '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include'; -const clangDefaultObjCSystemHeaders = ['objc/NSObject.h']; const objcBOOL = 'BOOL'; // Internal objective C directories that are automatically pulled in by clang, // and should be excluded from output (unless explicitly used). const objCInternalDirectories = [ - clangDefaultObjCSystemHeaderPath, + '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include', '/Applications/Xcode.app/Contents/Developer', '/usr/local/opt/llvm/lib', ]; diff --git a/pkgs/ffigen/test/header_parser_tests/objc_basic_types.h b/pkgs/ffigen/test/header_parser_tests/objc_basic_types.h index f2e5125263..34b45503cb 100644 --- a/pkgs/ffigen/test/header_parser_tests/objc_basic_types.h +++ b/pkgs/ffigen/test/header_parser_tests/objc_basic_types.h @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +#import + struct Foo { BOOL someBool; id anId; diff --git a/pkgs/ffigen/test/header_parser_tests/objc_basic_types_test.dart b/pkgs/ffigen/test/header_parser_tests/objc_basic_types_test.dart index 252683e825..ce5e76cd05 100644 --- a/pkgs/ffigen/test/header_parser_tests/objc_basic_types_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/objc_basic_types_test.dart @@ -32,6 +32,24 @@ ${strings.headers}: ${strings.structs}: ${strings.include}: - 'Foo' +${strings.functions}: + ${strings.exclude}: + - '.*' +${strings.unions}: + ${strings.exclude}: + - '.*' +${strings.enums}: + ${strings.exclude}: + - '.*' +${strings.unnamedEnums}: + ${strings.exclude}: + - '.*' +${strings.macros}: + ${strings.exclude}: + - '.*' +${strings.globals}: + ${strings.exclude}: + - '.*' ''') as yaml.YamlMap), ); }); diff --git a/pkgs/ffigen/test/header_parser_tests/objc_config.h b/pkgs/ffigen/test/header_parser_tests/objc_config.h index 6d3685e0b7..1dc3007409 100644 --- a/pkgs/ffigen/test/header_parser_tests/objc_config.h +++ b/pkgs/ffigen/test/header_parser_tests/objc_config.h @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +#import + @interface Foo : NSObject {} @end diff --git a/pkgs/ffigen/test/header_parser_tests/objc_config_test.dart b/pkgs/ffigen/test/header_parser_tests/objc_config_test.dart index 03d608ae04..94a7001ee4 100644 --- a/pkgs/ffigen/test/header_parser_tests/objc_config_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/objc_config_test.dart @@ -36,6 +36,27 @@ ${strings.objcInterfaces}: - 'Excluded' ${strings.rename}: '_(.*)': '\$1' +${strings.functions}: + ${strings.exclude}: + - '.*' +${strings.structs}: + ${strings.exclude}: + - '.*' +${strings.unions}: + ${strings.exclude}: + - '.*' +${strings.enums}: + ${strings.exclude}: + - '.*' +${strings.unnamedEnums}: + ${strings.exclude}: + - '.*' +${strings.macros}: + ${strings.exclude}: + - '.*' +${strings.globals}: + ${strings.exclude}: + - '.*' ''') as yaml.YamlMap), ); }); diff --git a/pkgs/ffigen/test/header_parser_tests/objc_interface.h b/pkgs/ffigen/test/header_parser_tests/objc_interface.h index cf9f5b2b40..d1b60077d3 100644 --- a/pkgs/ffigen/test/header_parser_tests/objc_interface.h +++ b/pkgs/ffigen/test/header_parser_tests/objc_interface.h @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +#import + // This is the Foo interface. @interface Foo : NSObject { // This is an instance variable. They are private, so are ignored. diff --git a/pkgs/ffigen/test/header_parser_tests/objc_interface_test.dart b/pkgs/ffigen/test/header_parser_tests/objc_interface_test.dart index 5d77f874eb..5a533852cb 100644 --- a/pkgs/ffigen/test/header_parser_tests/objc_interface_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/objc_interface_test.dart @@ -32,6 +32,27 @@ ${strings.headers}: ${strings.objcInterfaces}: ${strings.include}: - 'Foo' +${strings.functions}: + ${strings.exclude}: + - '.*' +${strings.structs}: + ${strings.exclude}: + - '.*' +${strings.unions}: + ${strings.exclude}: + - '.*' +${strings.enums}: + ${strings.exclude}: + - '.*' +${strings.unnamedEnums}: + ${strings.exclude}: + - '.*' +${strings.macros}: + ${strings.exclude}: + - '.*' +${strings.globals}: + ${strings.exclude}: + - '.*' ''') as yaml.YamlMap), ); }); From 3ce29269c4f7e5517170087a774dcb65b2eb2024 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Fri, 29 Apr 2022 11:51:21 -0700 Subject: [PATCH 128/276] [ffigen] Add the ability to cast from a pointer to an interface. (#346) --- .../src/code_generator/objc_interface.dart | 5 + .../_expected_objc_config_bindings.dart | 19 + .../_expected_objc_interface_bindings.dart | 19 + .../test/native_objc_test/cast_bindings.dart | 1276 +++++++++++++++++ .../test/native_objc_test/cast_config.yaml | 12 + .../test/native_objc_test/cast_test.dart | 68 + pkgs/ffigen/test/native_objc_test/cast_test.m | 25 + .../native_objc_test/method_bindings.dart | 20 + .../native_objc_test_bindings.dart | 20 + .../native_objc_test/nullable_bindings.dart | 20 + .../native_objc_test/property_bindings.dart | 20 + pkgs/ffigen/test/native_objc_test/setup.dart | 1 + .../native_objc_test/string_bindings.dart | 90 ++ pkgs/ffigen/test/regen.dart | 5 + 14 files changed, 1600 insertions(+) create mode 100644 pkgs/ffigen/test/native_objc_test/cast_bindings.dart create mode 100644 pkgs/ffigen/test/native_objc_test/cast_config.yaml create mode 100644 pkgs/ffigen/test/native_objc_test/cast_test.dart create mode 100644 pkgs/ffigen/test/native_objc_test/cast_test.m diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index c7cdbea2cf..6b9c4c61c6 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -98,6 +98,11 @@ class ObjCInterface extends BindingType { s.write(' return $name._(other._id, other._lib);\n'); s.write(' }\n\n'); + s.write( + ' static $name castFromPointer($natLib lib, ffi.Pointer other) {\n'); + s.write(' return $name._(other, lib);\n'); + s.write(' }\n\n'); + if (isNSString) { builtInFunctions.generateNSStringUtils(w, s); } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart index cedcffe09f..3a2029dcee 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart @@ -433,6 +433,10 @@ class Foo extends NSObject { return Foo._(other._id, other._lib); } + static Foo castFromPointer(NativeLibrary lib, ffi.Pointer other) { + return Foo._(other, lib); + } + static Foo new1(NativeLibrary _lib) { final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_new1); return Foo._(_ret, _lib); @@ -455,6 +459,11 @@ class NSObject extends _ObjCWrapper { return NSObject._(other._id, other._lib); } + static NSObject castFromPointer( + NativeLibrary lib, ffi.Pointer other) { + return NSObject._(other, lib); + } + static void load(NativeLibrary _lib) { _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); } @@ -629,6 +638,11 @@ class NSMethodSignature extends _ObjCWrapper { static NSMethodSignature castFrom(T other) { return NSMethodSignature._(other._id, other._lib); } + + static NSMethodSignature castFromPointer( + NativeLibrary lib, ffi.Pointer other) { + return NSMethodSignature._(other, lib); + } } typedef NSUInteger = pkg_ffi.UnsignedLong; @@ -640,6 +654,11 @@ class NSString extends _ObjCWrapper { return NSString._(other._id, other._lib); } + static NSString castFromPointer( + NativeLibrary lib, ffi.Pointer other) { + return NSString._(other, lib); + } + factory NSString(NativeLibrary _lib, String str) { final cstr = str.toNativeUtf8(); final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart index efb1b93af9..45201d7255 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart @@ -529,6 +529,10 @@ class Foo extends NSObject { return Foo._(other._id, other._lib); } + static Foo castFromPointer(NativeLibrary lib, ffi.Pointer other) { + return Foo._(other, lib); + } + int get someProperty { return _lib._objc_msgSend_15(_id, _lib._sel_someProperty1); } @@ -589,6 +593,11 @@ class NSObject extends _ObjCWrapper { return NSObject._(other._id, other._lib); } + static NSObject castFromPointer( + NativeLibrary lib, ffi.Pointer other) { + return NSObject._(other, lib); + } + static void load(NativeLibrary _lib) { _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); } @@ -763,6 +772,11 @@ class NSMethodSignature extends _ObjCWrapper { static NSMethodSignature castFrom(T other) { return NSMethodSignature._(other._id, other._lib); } + + static NSMethodSignature castFromPointer( + NativeLibrary lib, ffi.Pointer other) { + return NSMethodSignature._(other, lib); + } } typedef NSUInteger = pkg_ffi.UnsignedLong; @@ -774,6 +788,11 @@ class NSString extends _ObjCWrapper { return NSString._(other._id, other._lib); } + static NSString castFromPointer( + NativeLibrary lib, ffi.Pointer other) { + return NSString._(other, lib); + } + factory NSString(NativeLibrary _lib, String str) { final cstr = str.toNativeUtf8(); final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); diff --git a/pkgs/ffigen/test/native_objc_test/cast_bindings.dart b/pkgs/ffigen/test/native_objc_test/cast_bindings.dart new file mode 100644 index 0000000000..fcac886494 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/cast_bindings.dart @@ -0,0 +1,1276 @@ +// ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; + +/// Tests casting objects +class CastTestObjCLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + CastTestObjCLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + CastTestObjCLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + late final ffi.Pointer _NSFoundationVersionNumber = + _lookup('NSFoundationVersionNumber'); + + double get NSFoundationVersionNumber => _NSFoundationVersionNumber.value; + + set NSFoundationVersionNumber(double value) => + _NSFoundationVersionNumber.value = value; + + late final ffi.Pointer _NSNotFound = + _lookup('NSNotFound'); + + int get NSNotFound => _NSNotFound.value; + + set NSNotFound(int value) => _NSNotFound.value = value; + + late final ffi.Pointer _kCFCoreFoundationVersionNumber = + _lookup('kCFCoreFoundationVersionNumber'); + + double get kCFCoreFoundationVersionNumber => + _kCFCoreFoundationVersionNumber.value; + + set kCFCoreFoundationVersionNumber(double value) => + _kCFCoreFoundationVersionNumber.value = value; + + late final ffi.Pointer _kCFNotFound = + _lookup('kCFNotFound'); + + int get kCFNotFound => _kCFNotFound.value; + + set kCFNotFound(int value) => _kCFNotFound.value = value; + + late final ffi.Pointer _kCFNull = _lookup('kCFNull'); + + CFNullRef get kCFNull => _kCFNull.value; + + set kCFNull(CFNullRef value) => _kCFNull.value = value; + + late final ffi.Pointer _kCFAllocatorDefault = + _lookup('kCFAllocatorDefault'); + + CFAllocatorRef get kCFAllocatorDefault => _kCFAllocatorDefault.value; + + set kCFAllocatorDefault(CFAllocatorRef value) => + _kCFAllocatorDefault.value = value; + + late final ffi.Pointer _kCFAllocatorSystemDefault = + _lookup('kCFAllocatorSystemDefault'); + + CFAllocatorRef get kCFAllocatorSystemDefault => + _kCFAllocatorSystemDefault.value; + + set kCFAllocatorSystemDefault(CFAllocatorRef value) => + _kCFAllocatorSystemDefault.value = value; + + late final ffi.Pointer _kCFAllocatorMalloc = + _lookup('kCFAllocatorMalloc'); + + CFAllocatorRef get kCFAllocatorMalloc => _kCFAllocatorMalloc.value; + + set kCFAllocatorMalloc(CFAllocatorRef value) => + _kCFAllocatorMalloc.value = value; + + late final ffi.Pointer _kCFAllocatorMallocZone = + _lookup('kCFAllocatorMallocZone'); + + CFAllocatorRef get kCFAllocatorMallocZone => _kCFAllocatorMallocZone.value; + + set kCFAllocatorMallocZone(CFAllocatorRef value) => + _kCFAllocatorMallocZone.value = value; + + late final ffi.Pointer _kCFAllocatorNull = + _lookup('kCFAllocatorNull'); + + CFAllocatorRef get kCFAllocatorNull => _kCFAllocatorNull.value; + + set kCFAllocatorNull(CFAllocatorRef value) => _kCFAllocatorNull.value = value; + + late final ffi.Pointer _kCFAllocatorUseContext = + _lookup('kCFAllocatorUseContext'); + + CFAllocatorRef get kCFAllocatorUseContext => _kCFAllocatorUseContext.value; + + set kCFAllocatorUseContext(CFAllocatorRef value) => + _kCFAllocatorUseContext.value = value; + + ffi.Pointer _registerName1(String name) { + final cstr = name.toNativeUtf8(); + final sel = _sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; + } + + ffi.Pointer _sel_registerName( + ffi.Pointer str, + ) { + return __sel_registerName( + str, + ); + } + + late final __sel_registerNamePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sel_registerName'); + late final __sel_registerName = __sel_registerNamePtr + .asFunction Function(ffi.Pointer)>(); + + ffi.Pointer _getClass1(String name) { + final cstr = name.toNativeUtf8(); + final clazz = _objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; + } + + ffi.Pointer _objc_getClass( + ffi.Pointer str, + ) { + return __objc_getClass( + str, + ); + } + + late final __objc_getClassPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('objc_getClass'); + late final __objc_getClass = __objc_getClassPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); + + late final ffi.Pointer _class_Castaway1 = _getClass1("Castaway"); + late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); + late final ffi.Pointer _sel_load1 = _registerName1("load"); + void _objc_msgSend_0( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_0( + obj, + sel, + ); + } + + late final __objc_msgSend_0Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_initialize1 = + _registerName1("initialize"); + late final ffi.Pointer _sel_init1 = _registerName1("init"); + instancetype _objc_msgSend_1( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1( + obj, + sel, + ); + } + + late final __objc_msgSend_1Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_new1 = _registerName1("new"); + late final ffi.Pointer _sel_allocWithZone_1 = + _registerName1("allocWithZone:"); + instancetype _objc_msgSend_2( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_2( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_2Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>(); + + late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); + late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); + late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); + late final ffi.Pointer _sel_copy1 = _registerName1("copy"); + late final ffi.Pointer _sel_mutableCopy1 = + _registerName1("mutableCopy"); + late final ffi.Pointer _sel_copyWithZone_1 = + _registerName1("copyWithZone:"); + late final ffi.Pointer _sel_mutableCopyWithZone_1 = + _registerName1("mutableCopyWithZone:"); + late final ffi.Pointer _sel_instancesRespondToSelector_1 = + _registerName1("instancesRespondToSelector:"); + bool _objc_msgSend_3( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_3( + obj, + sel, + aSelector, + ) != + 0; + } + + late final __objc_msgSend_3Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_conformsToProtocol_1 = + _registerName1("conformsToProtocol:"); + bool _objc_msgSend_4( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer protocol, + ) { + return __objc_msgSend_4( + obj, + sel, + protocol, + ) != + 0; + } + + late final __objc_msgSend_4Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_methodForSelector_1 = + _registerName1("methodForSelector:"); + IMP _objc_msgSend_5( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_5( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_5Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_instanceMethodForSelector_1 = + _registerName1("instanceMethodForSelector:"); + late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = + _registerName1("doesNotRecognizeSelector:"); + void _objc_msgSend_6( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_6( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_6Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_forwardingTargetForSelector_1 = + _registerName1("forwardingTargetForSelector:"); + ffi.Pointer _objc_msgSend_7( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_7( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_7Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_forwardInvocation_1 = + _registerName1("forwardInvocation:"); + void _objc_msgSend_8( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anInvocation, + ) { + return __objc_msgSend_8( + obj, + sel, + anInvocation, + ); + } + + late final __objc_msgSend_8Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _class_NSMethodSignature1 = + _getClass1("NSMethodSignature"); + late final ffi.Pointer _sel_methodSignatureForSelector_1 = + _registerName1("methodSignatureForSelector:"); + ffi.Pointer _objc_msgSend_9( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_9( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_9Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = + _registerName1("instanceMethodSignatureForSelector:"); + late final ffi.Pointer _sel_allowsWeakReference1 = + _registerName1("allowsWeakReference"); + bool _objc_msgSend_10( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_10( + obj, + sel, + ) != + 0; + } + + late final __objc_msgSend_10Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_retainWeakReference1 = + _registerName1("retainWeakReference"); + late final ffi.Pointer _sel_isSubclassOfClass_1 = + _registerName1("isSubclassOfClass:"); + late final ffi.Pointer _sel_resolveClassMethod_1 = + _registerName1("resolveClassMethod:"); + late final ffi.Pointer _sel_resolveInstanceMethod_1 = + _registerName1("resolveInstanceMethod:"); + late final ffi.Pointer _sel_hash1 = _registerName1("hash"); + int _objc_msgSend_11( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_11( + obj, + sel, + ); + } + + late final __objc_msgSend_11Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_superclass1 = + _registerName1("superclass"); + late final ffi.Pointer _sel_class1 = _registerName1("class"); + late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); + late final ffi.Pointer _sel_stringWithCString_encoding_1 = + _registerName1("stringWithCString:encoding:"); + ffi.Pointer _objc_msgSend_12( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cString, + int enc, + ) { + return __objc_msgSend_12( + obj, + sel, + cString, + enc, + ); + } + + late final __objc_msgSend_12Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + pkg_ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_UTF8String1 = + _registerName1("UTF8String"); + ffi.Pointer _objc_msgSend_13( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_13( + obj, + sel, + ); + } + + late final __objc_msgSend_13Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_description1 = + _registerName1("description"); + ffi.Pointer _objc_msgSend_14( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_14( + obj, + sel, + ); + } + + late final __objc_msgSend_14Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_debugDescription1 = + _registerName1("debugDescription"); + late final ffi.Pointer _sel_meAsNSObject1 = + _registerName1("meAsNSObject"); + ffi.Pointer _objc_msgSend_15( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_15( + obj, + sel, + ); + } + + late final __objc_msgSend_15Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_meAsInt1 = _registerName1("meAsInt"); + int _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_16( + obj, + sel, + ); + } + + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + ffi.Int64 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); +} + +abstract class NSComparisonResult { + static const int NSOrderedAscending = -1; + static const int NSOrderedSame = 0; + static const int NSOrderedDescending = 1; +} + +abstract class NSEnumerationOptions { + static const int NSEnumerationConcurrent = 1; + static const int NSEnumerationReverse = 2; +} + +abstract class NSSortOptions { + static const int NSSortConcurrent = 1; + static const int NSSortStable = 16; +} + +abstract class NSQualityOfService { + static const int NSQualityOfServiceUserInteractive = 33; + static const int NSQualityOfServiceUserInitiated = 25; + static const int NSQualityOfServiceUtility = 17; + static const int NSQualityOfServiceBackground = 9; + static const int NSQualityOfServiceDefault = -1; +} + +typedef NSInteger = pkg_ffi.Long; + +class __CFString extends ffi.Opaque {} + +abstract class CFComparisonResult { + static const int kCFCompareLessThan = -1; + static const int kCFCompareEqualTo = 0; + static const int kCFCompareGreaterThan = 1; +} + +typedef CFIndex = pkg_ffi.Long; + +class CFRange extends ffi.Struct { + @CFIndex() + external int location; + + @CFIndex() + external int length; +} + +class __CFNull extends ffi.Opaque {} + +typedef CFNullRef = ffi.Pointer<__CFNull>; + +class __CFAllocator extends ffi.Opaque {} + +typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; + +class CFAllocatorContext extends ffi.Struct { + @CFIndex() + external int version; + + external ffi.Pointer info; + + external CFAllocatorRetainCallBack retain; + + external CFAllocatorReleaseCallBack release; + + external CFAllocatorCopyDescriptionCallBack copyDescription; + + external CFAllocatorAllocateCallBack allocate; + + external CFAllocatorReallocateCallBack reallocate; + + external CFAllocatorDeallocateCallBack deallocate; + + external CFAllocatorPreferredSizeCallBack preferredSize; +} + +typedef CFAllocatorRetainCallBack = ffi.Pointer< + ffi.NativeFunction Function(ffi.Pointer)>>; +typedef CFAllocatorReleaseCallBack + = ffi.Pointer)>>; +typedef CFAllocatorCopyDescriptionCallBack = ffi + .Pointer)>>; +typedef CFStringRef = ffi.Pointer<__CFString>; +typedef CFAllocatorAllocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + CFIndex, CFOptionFlags, ffi.Pointer)>>; +typedef CFOptionFlags = pkg_ffi.UnsignedLong; +typedef CFAllocatorReallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, CFIndex, + CFOptionFlags, ffi.Pointer)>>; +typedef CFAllocatorDeallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; +typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< + ffi.NativeFunction< + CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; + +class _ObjCWrapper { + final ffi.Pointer _id; + final CastTestObjCLibrary _lib; + _ObjCWrapper._(this._id, this._lib); +} + +class Castaway extends NSObject { + Castaway._(ffi.Pointer id, CastTestObjCLibrary lib) + : super._(id, lib); + + static Castaway castFrom(T other) { + return Castaway._(other._id, other._lib); + } + + static Castaway castFromPointer( + CastTestObjCLibrary lib, ffi.Pointer other) { + return Castaway._(other, lib); + } + + NSObject meAsNSObject() { + final _ret = _lib._objc_msgSend_15(_id, _lib._sel_meAsNSObject1); + return NSObject._(_ret, _lib); + } + + int meAsInt() { + return _lib._objc_msgSend_16(_id, _lib._sel_meAsInt1); + } + + static Castaway new1(CastTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_Castaway1, _lib._sel_new1); + return Castaway._(_ret, _lib); + } + + static Castaway alloc(CastTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_Castaway1, _lib._sel_alloc1); + return Castaway._(_ret, _lib); + } +} + +class ObjCSel extends ffi.Opaque {} + +class ObjCObject extends ffi.Opaque {} + +class NSObject extends _ObjCWrapper { + NSObject._(ffi.Pointer id, CastTestObjCLibrary lib) + : super._(id, lib); + + static NSObject castFrom(T other) { + return NSObject._(other._id, other._lib); + } + + static NSObject castFromPointer( + CastTestObjCLibrary lib, ffi.Pointer other) { + return NSObject._(other, lib); + } + + static void load(CastTestObjCLibrary _lib) { + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); + } + + static void initialize(CastTestObjCLibrary _lib) { + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); + } + + NSObject init() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); + return NSObject._(_ret, _lib); + } + + static NSObject new1(CastTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); + return NSObject._(_ret, _lib); + } + + static NSObject allocWithZone( + CastTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static NSObject alloc(CastTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); + return NSObject._(_ret, _lib); + } + + void dealloc() { + _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); + } + + void finalize() { + _lib._objc_msgSend_0(_id, _lib._sel_finalize1); + } + + NSObject copy() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); + return NSObject._(_ret, _lib); + } + + NSObject mutableCopy() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); + return NSObject._(_ret, _lib); + } + + static NSObject copyWithZone( + CastTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static NSObject mutableCopyWithZone( + CastTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static bool instancesRespondToSelector( + CastTestObjCLibrary _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_3(_lib._class_NSObject1, + _lib._sel_instancesRespondToSelector_1, aSelector); + } + + static bool conformsToProtocol(CastTestObjCLibrary _lib, NSObject? protocol) { + return _lib._objc_msgSend_4(_lib._class_NSObject1, + _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); + } + + IMP methodForSelector(ffi.Pointer aSelector) { + return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); + } + + static IMP instanceMethodForSelector( + CastTestObjCLibrary _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_5(_lib._class_NSObject1, + _lib._sel_instanceMethodForSelector_1, aSelector); + } + + void doesNotRecognizeSelector(ffi.Pointer aSelector) { + _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); + } + + NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_7( + _id, _lib._sel_forwardingTargetForSelector_1, aSelector); + return NSObject._(_ret, _lib); + } + + void forwardInvocation(NSObject? anInvocation) { + _lib._objc_msgSend_8( + _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); + } + + NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_9( + _id, _lib._sel_methodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static NSMethodSignature instanceMethodSignatureForSelector( + CastTestObjCLibrary _lib, ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, + _lib._sel_instanceMethodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + bool allowsWeakReference() { + return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); + } + + bool retainWeakReference() { + return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); + } + + static bool isSubclassOfClass(CastTestObjCLibrary _lib, NSObject aClass) { + return _lib._objc_msgSend_4( + _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); + } + + static bool resolveClassMethod( + CastTestObjCLibrary _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); + } + + static bool resolveInstanceMethod( + CastTestObjCLibrary _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); + } + + static int hash(CastTestObjCLibrary _lib) { + return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); + } + + static NSObject superclass(CastTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); + return NSObject._(_ret, _lib); + } + + static NSObject class1(CastTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); + return NSObject._(_ret, _lib); + } + + static NSString description(CastTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_14(_lib._class_NSObject1, _lib._sel_description1); + return NSString._(_ret, _lib); + } + + static NSString debugDescription(CastTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_14( + _lib._class_NSObject1, _lib._sel_debugDescription1); + return NSString._(_ret, _lib); + } +} + +typedef instancetype = ffi.Pointer; + +class _NSZone extends ffi.Opaque {} + +typedef IMP = ffi.Pointer>; + +class NSMethodSignature extends _ObjCWrapper { + NSMethodSignature._(ffi.Pointer id, CastTestObjCLibrary lib) + : super._(id, lib); + + static NSMethodSignature castFrom(T other) { + return NSMethodSignature._(other._id, other._lib); + } + + static NSMethodSignature castFromPointer( + CastTestObjCLibrary lib, ffi.Pointer other) { + return NSMethodSignature._(other, lib); + } +} + +typedef NSUInteger = pkg_ffi.UnsignedLong; + +class NSString extends _ObjCWrapper { + NSString._(ffi.Pointer id, CastTestObjCLibrary lib) + : super._(id, lib); + + static NSString castFrom(T other) { + return NSString._(other._id, other._lib); + } + + static NSString castFromPointer( + CastTestObjCLibrary lib, ffi.Pointer other) { + return NSString._(other, lib); + } + + factory NSString(CastTestObjCLibrary _lib, String str) { + final cstr = str.toNativeUtf8(); + final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + pkg_ffi.calloc.free(cstr); + return nsstr; + } + + @override + String toString() => UTF8String().cast().toDartString(); + + static NSString stringWithCString_encoding( + CastTestObjCLibrary _lib, ffi.Pointer cString, int enc) { + final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); + return NSString._(_ret, _lib); + } + + ffi.Pointer UTF8String() { + return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); + } +} + +extension StringToNSString on String { + NSString toNSString(CastTestObjCLibrary lib) => NSString(lib, this); +} + +const int NSScannedOption = 1; + +const int NSCollectorDisabledOption = 2; + +const int NS_BLOCKS_AVAILABLE = 1; + +const int __COREFOUNDATION_CFAVAILABILITY__ = 1; + +const int __CF_ENUM_FIXED_IS_AVAILABLE = 1; + +const double NSFoundationVersionNumber10_0 = 397.4; + +const double NSFoundationVersionNumber10_1 = 425.0; + +const double NSFoundationVersionNumber10_1_1 = 425.0; + +const double NSFoundationVersionNumber10_1_2 = 425.0; + +const double NSFoundationVersionNumber10_1_3 = 425.0; + +const double NSFoundationVersionNumber10_1_4 = 425.0; + +const double NSFoundationVersionNumber10_2 = 462.0; + +const double NSFoundationVersionNumber10_2_1 = 462.0; + +const double NSFoundationVersionNumber10_2_2 = 462.0; + +const double NSFoundationVersionNumber10_2_3 = 462.0; + +const double NSFoundationVersionNumber10_2_4 = 462.0; + +const double NSFoundationVersionNumber10_2_5 = 462.0; + +const double NSFoundationVersionNumber10_2_6 = 462.0; + +const double NSFoundationVersionNumber10_2_7 = 462.7; + +const double NSFoundationVersionNumber10_2_8 = 462.7; + +const double NSFoundationVersionNumber10_3 = 500.0; + +const double NSFoundationVersionNumber10_3_1 = 500.0; + +const double NSFoundationVersionNumber10_3_2 = 500.3; + +const double NSFoundationVersionNumber10_3_3 = 500.54; + +const double NSFoundationVersionNumber10_3_4 = 500.56; + +const double NSFoundationVersionNumber10_3_5 = 500.56; + +const double NSFoundationVersionNumber10_3_6 = 500.56; + +const double NSFoundationVersionNumber10_3_7 = 500.56; + +const double NSFoundationVersionNumber10_3_8 = 500.56; + +const double NSFoundationVersionNumber10_3_9 = 500.58; + +const double NSFoundationVersionNumber10_4 = 567.0; + +const double NSFoundationVersionNumber10_4_1 = 567.0; + +const double NSFoundationVersionNumber10_4_2 = 567.12; + +const double NSFoundationVersionNumber10_4_3 = 567.21; + +const double NSFoundationVersionNumber10_4_4_Intel = 567.23; + +const double NSFoundationVersionNumber10_4_4_PowerPC = 567.21; + +const double NSFoundationVersionNumber10_4_5 = 567.25; + +const double NSFoundationVersionNumber10_4_6 = 567.26; + +const double NSFoundationVersionNumber10_4_7 = 567.27; + +const double NSFoundationVersionNumber10_4_8 = 567.28; + +const double NSFoundationVersionNumber10_4_9 = 567.29; + +const double NSFoundationVersionNumber10_4_10 = 567.29; + +const double NSFoundationVersionNumber10_4_11 = 567.36; + +const double NSFoundationVersionNumber10_5 = 677.0; + +const double NSFoundationVersionNumber10_5_1 = 677.1; + +const double NSFoundationVersionNumber10_5_2 = 677.15; + +const double NSFoundationVersionNumber10_5_3 = 677.19; + +const double NSFoundationVersionNumber10_5_4 = 677.19; + +const double NSFoundationVersionNumber10_5_5 = 677.21; + +const double NSFoundationVersionNumber10_5_6 = 677.22; + +const double NSFoundationVersionNumber10_5_7 = 677.24; + +const double NSFoundationVersionNumber10_5_8 = 677.26; + +const double NSFoundationVersionNumber10_6 = 751.0; + +const double NSFoundationVersionNumber10_6_1 = 751.0; + +const double NSFoundationVersionNumber10_6_2 = 751.14; + +const double NSFoundationVersionNumber10_6_3 = 751.21; + +const double NSFoundationVersionNumber10_6_4 = 751.29; + +const double NSFoundationVersionNumber10_6_5 = 751.42; + +const double NSFoundationVersionNumber10_6_6 = 751.53; + +const double NSFoundationVersionNumber10_6_7 = 751.53; + +const double NSFoundationVersionNumber10_6_8 = 751.62; + +const double NSFoundationVersionNumber10_7 = 833.1; + +const double NSFoundationVersionNumber10_7_1 = 833.1; + +const double NSFoundationVersionNumber10_7_2 = 833.2; + +const double NSFoundationVersionNumber10_7_3 = 833.24; + +const double NSFoundationVersionNumber10_7_4 = 833.25; + +const double NSFoundationVersionNumber10_8 = 945.0; + +const double NSFoundationVersionNumber10_8_1 = 945.0; + +const double NSFoundationVersionNumber10_8_2 = 945.11; + +const double NSFoundationVersionNumber10_8_3 = 945.16; + +const double NSFoundationVersionNumber10_8_4 = 945.18; + +const int NSFoundationVersionNumber10_9 = 1056; + +const int NSFoundationVersionNumber10_9_1 = 1056; + +const double NSFoundationVersionNumber10_9_2 = 1056.13; + +const double NSFoundationVersionNumber10_10 = 1151.16; + +const double NSFoundationVersionNumber10_10_1 = 1151.16; + +const double NSFoundationVersionNumber10_10_2 = 1152.14; + +const double NSFoundationVersionNumber10_10_3 = 1153.2; + +const double NSFoundationVersionNumber10_10_4 = 1153.2; + +const int NSFoundationVersionNumber10_10_5 = 1154; + +const int NSFoundationVersionNumber10_10_Max = 1199; + +const int NSFoundationVersionNumber10_11 = 1252; + +const double NSFoundationVersionNumber10_11_1 = 1255.1; + +const double NSFoundationVersionNumber10_11_2 = 1256.1; + +const double NSFoundationVersionNumber10_11_3 = 1256.1; + +const int NSFoundationVersionNumber10_11_4 = 1258; + +const int NSFoundationVersionNumber10_11_Max = 1299; + +const int __COREFOUNDATION_CFBASE__ = 1; + +const int TRUE = 1; + +const int FALSE = 0; + +const double kCFCoreFoundationVersionNumber10_0 = 196.4; + +const double kCFCoreFoundationVersionNumber10_0_3 = 196.5; + +const double kCFCoreFoundationVersionNumber10_1 = 226.0; + +const double kCFCoreFoundationVersionNumber10_1_1 = 226.0; + +const double kCFCoreFoundationVersionNumber10_1_2 = 227.2; + +const double kCFCoreFoundationVersionNumber10_1_3 = 227.2; + +const double kCFCoreFoundationVersionNumber10_1_4 = 227.3; + +const double kCFCoreFoundationVersionNumber10_2 = 263.0; + +const double kCFCoreFoundationVersionNumber10_2_1 = 263.1; + +const double kCFCoreFoundationVersionNumber10_2_2 = 263.1; + +const double kCFCoreFoundationVersionNumber10_2_3 = 263.3; + +const double kCFCoreFoundationVersionNumber10_2_4 = 263.3; + +const double kCFCoreFoundationVersionNumber10_2_5 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_6 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_7 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_8 = 263.5; + +const double kCFCoreFoundationVersionNumber10_3 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_1 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_2 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_3 = 299.3; + +const double kCFCoreFoundationVersionNumber10_3_4 = 299.31; + +const double kCFCoreFoundationVersionNumber10_3_5 = 299.31; + +const double kCFCoreFoundationVersionNumber10_3_6 = 299.32; + +const double kCFCoreFoundationVersionNumber10_3_7 = 299.33; + +const double kCFCoreFoundationVersionNumber10_3_8 = 299.33; + +const double kCFCoreFoundationVersionNumber10_3_9 = 299.35; + +const double kCFCoreFoundationVersionNumber10_4 = 368.0; + +const double kCFCoreFoundationVersionNumber10_4_1 = 368.1; + +const double kCFCoreFoundationVersionNumber10_4_2 = 368.11; + +const double kCFCoreFoundationVersionNumber10_4_3 = 368.18; + +const double kCFCoreFoundationVersionNumber10_4_4_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_4_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_5_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_5_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_6_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_6_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_7 = 368.27; + +const double kCFCoreFoundationVersionNumber10_4_8 = 368.27; + +const double kCFCoreFoundationVersionNumber10_4_9 = 368.28; + +const double kCFCoreFoundationVersionNumber10_4_10 = 368.28; + +const double kCFCoreFoundationVersionNumber10_4_11 = 368.31; + +const double kCFCoreFoundationVersionNumber10_5 = 476.0; + +const double kCFCoreFoundationVersionNumber10_5_1 = 476.0; + +const double kCFCoreFoundationVersionNumber10_5_2 = 476.1; + +const double kCFCoreFoundationVersionNumber10_5_3 = 476.13; + +const double kCFCoreFoundationVersionNumber10_5_4 = 476.14; + +const double kCFCoreFoundationVersionNumber10_5_5 = 476.15; + +const double kCFCoreFoundationVersionNumber10_5_6 = 476.17; + +const double kCFCoreFoundationVersionNumber10_5_7 = 476.18; + +const double kCFCoreFoundationVersionNumber10_5_8 = 476.19; + +const double kCFCoreFoundationVersionNumber10_6 = 550.0; + +const double kCFCoreFoundationVersionNumber10_6_1 = 550.0; + +const double kCFCoreFoundationVersionNumber10_6_2 = 550.13; + +const double kCFCoreFoundationVersionNumber10_6_3 = 550.19; + +const double kCFCoreFoundationVersionNumber10_6_4 = 550.29; + +const double kCFCoreFoundationVersionNumber10_6_5 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_6 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_7 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_8 = 550.43; + +const double kCFCoreFoundationVersionNumber10_7 = 635.0; + +const double kCFCoreFoundationVersionNumber10_7_1 = 635.0; + +const double kCFCoreFoundationVersionNumber10_7_2 = 635.15; + +const double kCFCoreFoundationVersionNumber10_7_3 = 635.19; + +const double kCFCoreFoundationVersionNumber10_7_4 = 635.21; + +const double kCFCoreFoundationVersionNumber10_7_5 = 635.21; + +const double kCFCoreFoundationVersionNumber10_8 = 744.0; + +const double kCFCoreFoundationVersionNumber10_8_1 = 744.0; + +const double kCFCoreFoundationVersionNumber10_8_2 = 744.12; + +const double kCFCoreFoundationVersionNumber10_8_3 = 744.18; + +const double kCFCoreFoundationVersionNumber10_8_4 = 744.19; + +const double kCFCoreFoundationVersionNumber10_9 = 855.11; + +const double kCFCoreFoundationVersionNumber10_9_1 = 855.11; + +const double kCFCoreFoundationVersionNumber10_9_2 = 855.14; + +const double kCFCoreFoundationVersionNumber10_10 = 1151.16; + +const double kCFCoreFoundationVersionNumber10_10_1 = 1151.16; + +const int kCFCoreFoundationVersionNumber10_10_2 = 1152; + +const double kCFCoreFoundationVersionNumber10_10_3 = 1153.18; + +const double kCFCoreFoundationVersionNumber10_10_4 = 1153.18; + +const double kCFCoreFoundationVersionNumber10_10_5 = 1153.18; + +const int kCFCoreFoundationVersionNumber10_10_Max = 1199; + +const int kCFCoreFoundationVersionNumber10_11 = 1253; + +const double kCFCoreFoundationVersionNumber10_11_1 = 1255.1; + +const double kCFCoreFoundationVersionNumber10_11_2 = 1256.14; + +const double kCFCoreFoundationVersionNumber10_11_3 = 1256.14; + +const double kCFCoreFoundationVersionNumber10_11_4 = 1258.1; + +const int kCFCoreFoundationVersionNumber10_11_Max = 1299; + +const int ISA_PTRAUTH_DISCRIMINATOR = 27361; diff --git a/pkgs/ffigen/test/native_objc_test/cast_config.yaml b/pkgs/ffigen/test/native_objc_test/cast_config.yaml new file mode 100644 index 0000000000..c080359058 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/cast_config.yaml @@ -0,0 +1,12 @@ +name: CastTestObjCLibrary +description: 'Tests casting objects' +language: objc +output: 'test/native_objc_test/cast_bindings.dart' +functions: + exclude: + - '.*' +headers: + entry-points: + - 'test/native_objc_test/cast_test.m' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/cast_test.dart b/pkgs/ffigen/test/native_objc_test/cast_test.dart new file mode 100644 index 0000000000..20f2e18daa --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/cast_test.dart @@ -0,0 +1,68 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:ffigen/ffigen.dart'; +import 'package:path/path.dart' as path; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart'; +import '../test_utils.dart'; +import 'cast_bindings.dart'; + +void main() { + late Castaway testInstance; + late CastTestObjCLibrary lib; + + group('cast', () { + setUpAll(() { + logWarnings(); + final dylib = File('test/native_objc_test/cast_test.dylib'); + verifySetupFile(dylib); + lib = CastTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); + testInstance = Castaway.new1(lib); + }); + + test('generate_bindings', () { + final config = Config.fromYaml(loadYaml( + File(path.join('test', 'native_objc_test', 'cast_config.yaml')) + .readAsStringSync()) as YamlMap); + final library = parse(config); + final file = File( + path.join('test', 'debug_generated', 'cast_test.dart'), + ); + library.generateFile(file); + + try { + final actual = file.readAsStringSync(); + final expected = File(path.join(config.output)).readAsStringSync(); + expect(actual, expected); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + print('Failed test: Debug generated file: ${file.absolute.path}'); + rethrow; + } + }); + + test('castFrom', () { + final meAsInt = testInstance.meAsInt(); + expect(Castaway.castFrom(testInstance.meAsNSObject()).meAsInt(), meAsInt); + }); + + test('castFromPointer', () { + final meAsInt = testInstance.meAsInt(); + expect( + Castaway.castFromPointer( + lib, Pointer.fromAddress(meAsInt)) + .meAsInt(), + meAsInt); + }); + }); +} diff --git a/pkgs/ffigen/test/native_objc_test/cast_test.m b/pkgs/ffigen/test/native_objc_test/cast_test.m new file mode 100644 index 0000000000..363b3adc43 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/cast_test.m @@ -0,0 +1,25 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#import + +@interface Castaway : NSObject { +} + +- (NSObject *) meAsNSObject; +- (int64_t) meAsInt; + +@end + +@implementation Castaway + +- (NSObject *) meAsNSObject { + return self; +} + +- (int64_t) meAsInt { + return (int64_t) self; +} + +@end diff --git a/pkgs/ffigen/test/native_objc_test/method_bindings.dart b/pkgs/ffigen/test/native_objc_test/method_bindings.dart index fc3bd606df..27920b06bc 100644 --- a/pkgs/ffigen/test/native_objc_test/method_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/method_bindings.dart @@ -707,6 +707,11 @@ class MethodInterface extends NSObject { return MethodInterface._(other._id, other._lib); } + static MethodInterface castFromPointer( + MethodTestObjCLibrary lib, ffi.Pointer other) { + return MethodInterface._(other, lib); + } + int add() { return _lib._objc_msgSend_15(_id, _lib._sel_add1); } @@ -767,6 +772,11 @@ class NSObject extends _ObjCWrapper { return NSObject._(other._id, other._lib); } + static NSObject castFromPointer( + MethodTestObjCLibrary lib, ffi.Pointer other) { + return NSObject._(other, lib); + } + static void load(MethodTestObjCLibrary _lib) { _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); } @@ -945,6 +955,11 @@ class NSMethodSignature extends _ObjCWrapper { static NSMethodSignature castFrom(T other) { return NSMethodSignature._(other._id, other._lib); } + + static NSMethodSignature castFromPointer( + MethodTestObjCLibrary lib, ffi.Pointer other) { + return NSMethodSignature._(other, lib); + } } typedef NSUInteger = pkg_ffi.UnsignedLong; @@ -957,6 +972,11 @@ class NSString extends _ObjCWrapper { return NSString._(other._id, other._lib); } + static NSString castFromPointer( + MethodTestObjCLibrary lib, ffi.Pointer other) { + return NSString._(other, lib); + } + factory NSString(MethodTestObjCLibrary _lib, String str) { final cstr = str.toNativeUtf8(); final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart index b6edcc81f4..cf75b1cd34 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart @@ -1156,6 +1156,11 @@ class Foo extends NSObject { return Foo._(other._id, other._lib); } + static Foo castFromPointer( + NativeObjCLibrary lib, ffi.Pointer other) { + return Foo._(other, lib); + } + int get intVal { return _lib._objc_msgSend_17(_id, _lib._sel_intVal1); } @@ -1200,6 +1205,11 @@ class NSObject extends _ObjCWrapper { return NSObject._(other._id, other._lib); } + static NSObject castFromPointer( + NativeObjCLibrary lib, ffi.Pointer other) { + return NSObject._(other, lib); + } + static void load(NativeObjCLibrary _lib) { _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); } @@ -1377,6 +1387,11 @@ class NSMethodSignature extends _ObjCWrapper { static NSMethodSignature castFrom(T other) { return NSMethodSignature._(other._id, other._lib); } + + static NSMethodSignature castFromPointer( + NativeObjCLibrary lib, ffi.Pointer other) { + return NSMethodSignature._(other, lib); + } } class NSString extends NSObject { @@ -1387,6 +1402,11 @@ class NSString extends NSObject { return NSString._(other._id, other._lib); } + static NSString castFromPointer( + NativeObjCLibrary lib, ffi.Pointer other) { + return NSString._(other, lib); + } + factory NSString(NativeObjCLibrary _lib, String str) { final cstr = str.toNativeUtf8(); final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); diff --git a/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart b/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart index 2350bb5d39..6f6b1b898e 100644 --- a/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart @@ -622,6 +622,11 @@ class NullableInterface extends NSObject { return NullableInterface._(other._id, other._lib); } + static NullableInterface castFromPointer( + NullableTestObjCLibrary lib, ffi.Pointer other) { + return NullableInterface._(other, lib); + } + static bool isNullWithNullableNSObjectArg( NullableTestObjCLibrary _lib, NSObject? x) { return _lib._objc_msgSend_4(_lib._class_NullableInterface1, @@ -659,6 +664,11 @@ class NSObject extends _ObjCWrapper { return NSObject._(other._id, other._lib); } + static NSObject castFromPointer( + NullableTestObjCLibrary lib, ffi.Pointer other) { + return NSObject._(other, lib); + } + static void load(NullableTestObjCLibrary _lib) { _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); } @@ -837,6 +847,11 @@ class NSMethodSignature extends _ObjCWrapper { static NSMethodSignature castFrom(T other) { return NSMethodSignature._(other._id, other._lib); } + + static NSMethodSignature castFromPointer( + NullableTestObjCLibrary lib, ffi.Pointer other) { + return NSMethodSignature._(other, lib); + } } typedef NSUInteger = pkg_ffi.UnsignedLong; @@ -849,6 +864,11 @@ class NSString extends _ObjCWrapper { return NSString._(other._id, other._lib); } + static NSString castFromPointer( + NullableTestObjCLibrary lib, ffi.Pointer other) { + return NSString._(other, lib); + } + factory NSString(NullableTestObjCLibrary _lib, String str) { final cstr = str.toNativeUtf8(); final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); diff --git a/pkgs/ffigen/test/native_objc_test/property_bindings.dart b/pkgs/ffigen/test/native_objc_test/property_bindings.dart index 353d0c13d9..0b7ecc3cf2 100644 --- a/pkgs/ffigen/test/native_objc_test/property_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/property_bindings.dart @@ -673,6 +673,11 @@ class PropertyInterface extends NSObject { return PropertyInterface._(other._id, other._lib); } + static PropertyInterface castFromPointer( + PropertyTestObjCLibrary lib, ffi.Pointer other) { + return PropertyInterface._(other, lib); + } + int get readOnlyProperty { return _lib._objc_msgSend_15(_id, _lib._sel_readOnlyProperty1); } @@ -726,6 +731,11 @@ class NSObject extends _ObjCWrapper { return NSObject._(other._id, other._lib); } + static NSObject castFromPointer( + PropertyTestObjCLibrary lib, ffi.Pointer other) { + return NSObject._(other, lib); + } + static void load(PropertyTestObjCLibrary _lib) { _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); } @@ -904,6 +914,11 @@ class NSMethodSignature extends _ObjCWrapper { static NSMethodSignature castFrom(T other) { return NSMethodSignature._(other._id, other._lib); } + + static NSMethodSignature castFromPointer( + PropertyTestObjCLibrary lib, ffi.Pointer other) { + return NSMethodSignature._(other, lib); + } } typedef NSUInteger = pkg_ffi.UnsignedLong; @@ -916,6 +931,11 @@ class NSString extends _ObjCWrapper { return NSString._(other._id, other._lib); } + static NSString castFromPointer( + PropertyTestObjCLibrary lib, ffi.Pointer other) { + return NSString._(other, lib); + } + factory NSString(PropertyTestObjCLibrary _lib, String str) { final cstr = str.toNativeUtf8(); final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); diff --git a/pkgs/ffigen/test/native_objc_test/setup.dart b/pkgs/ffigen/test/native_objc_test/setup.dart index 37e5eacc5b..63cf56b3bc 100644 --- a/pkgs/ffigen/test/native_objc_test/setup.dart +++ b/pkgs/ffigen/test/native_objc_test/setup.dart @@ -33,6 +33,7 @@ Future main(List arguments) async { } print('Building Dynamic Library for Objective C Native Tests...'); await _buildLib('native_objc_test.m', 'native_objc_test.dylib'); + await _buildLib('cast_test.m', 'cast_test.dylib'); await _buildLib('method_test.m', 'method_test.dylib'); await _buildLib('nullable_test.m', 'nullable_test.dylib'); await _buildLib('property_test.m', 'property_test.dylib'); diff --git a/pkgs/ffigen/test/native_objc_test/string_bindings.dart b/pkgs/ffigen/test/native_objc_test/string_bindings.dart index e1f64f2ba2..d9ea394889 100644 --- a/pkgs/ffigen/test/native_objc_test/string_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/string_bindings.dart @@ -2638,6 +2638,11 @@ class NSValue extends NSObject { return NSValue._(other._id, other._lib); } + static NSValue castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return NSValue._(other, lib); + } + void getValue_size(ffi.Pointer value, int size) { _lib._objc_msgSend_17(_id, _lib._sel_getValue_size_1, value, size); } @@ -2682,6 +2687,11 @@ class NSObject extends _ObjCWrapper { return NSObject._(other._id, other._lib); } + static NSObject castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return NSObject._(other, lib); + } + static void load(StringTestObjCLibrary _lib) { _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); } @@ -2860,6 +2870,11 @@ class NSMethodSignature extends _ObjCWrapper { static NSMethodSignature castFrom(T other) { return NSMethodSignature._(other._id, other._lib); } + + static NSMethodSignature castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return NSMethodSignature._(other, lib); + } } typedef NSUInteger = pkg_ffi.UnsignedLong; @@ -2872,6 +2887,11 @@ class NSString extends NSObject { return NSString._(other._id, other._lib); } + static NSString castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return NSString._(other, lib); + } + factory NSString(StringTestObjCLibrary _lib, String str) { final cstr = str.toNativeUtf8(); final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); @@ -2938,6 +2958,11 @@ class NSNumber extends NSValue { return NSNumber._(other._id, other._lib); } + static NSNumber castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return NSNumber._(other, lib); + } + @override NSNumber initWithCoder(NSObject? coder) { final _ret = _lib._objc_msgSend_13( @@ -3147,6 +3172,11 @@ class NSEnumerator extends NSObject { return NSEnumerator._(other._id, other._lib); } + static NSEnumerator castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return NSEnumerator._(other, lib); + } + NSObject nextObject() { final _ret = _lib._objc_msgSend_1(_id, _lib._sel_nextObject1); return NSObject._(_ret, _lib); @@ -3179,6 +3209,11 @@ class NSOrderedCollectionChange extends NSObject { return NSOrderedCollectionChange._(other._id, other._lib); } + static NSOrderedCollectionChange castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return NSOrderedCollectionChange._(other, lib); + } + NSObject get object { final _ret = _lib._objc_msgSend_1(_id, _lib._sel_object1); return NSObject._(_ret, _lib); @@ -3242,6 +3277,11 @@ class NSIndexSet extends NSObject { return NSIndexSet._(other._id, other._lib); } + static NSIndexSet castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return NSIndexSet._(other, lib); + } + static NSIndexSet indexSet(StringTestObjCLibrary _lib) { final _ret = _lib._objc_msgSend_1(_lib._class_NSIndexSet1, _lib._sel_indexSet1); @@ -3451,6 +3491,11 @@ class NSMutableIndexSet extends NSIndexSet { return NSMutableIndexSet._(other._id, other._lib); } + static NSMutableIndexSet castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return NSMutableIndexSet._(other, lib); + } + void addIndexes(NSObject? indexSet) { _lib._objc_msgSend_8( _id, _lib._sel_addIndexes_1, indexSet?._id ?? ffi.nullptr); @@ -3537,6 +3582,11 @@ class NSOrderedCollectionDifference extends NSObject { return NSOrderedCollectionDifference._(other._id, other._lib); } + static NSOrderedCollectionDifference castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return NSOrderedCollectionDifference._(other, lib); + } + NSOrderedCollectionDifference initWithChanges(NSObject? changes) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithChanges_1, changes?._id ?? ffi.nullptr); @@ -3617,6 +3667,11 @@ class NSArray extends NSObject { return NSArray._(other._id, other._lib); } + static NSArray castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return NSArray._(other, lib); + } + int get count { return _lib._objc_msgSend_11(_id, _lib._sel_count1); } @@ -3670,6 +3725,11 @@ class NSMutableArray extends NSArray { return NSMutableArray._(other._id, other._lib); } + static NSMutableArray castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return NSMutableArray._(other, lib); + } + void addObject(NSObject anObject) { _lib._objc_msgSend_8(_id, _lib._sel_addObject_1, anObject._id); } @@ -3743,6 +3803,11 @@ class NSItemProvider extends NSObject { return NSItemProvider._(other._id, other._lib); } + static NSItemProvider castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return NSItemProvider._(other, lib); + } + @override NSItemProvider init() { final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); @@ -3928,6 +3993,11 @@ class NSProgress extends _ObjCWrapper { static NSProgress castFrom(T other) { return NSProgress._(other._id, other._lib); } + + static NSProgress castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return NSProgress._(other, lib); + } } typedef NSItemProviderLoadHandler = ffi.Pointer; @@ -3981,6 +4051,11 @@ class NSMutableString extends NSString { return NSMutableString._(other._id, other._lib); } + static NSMutableString castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return NSMutableString._(other, lib); + } + void replaceCharactersInRange_withString(NSRange range, NSObject? aString) { _lib._objc_msgSend_79(_id, _lib._sel_replaceCharactersInRange_withString_1, range, aString?._id ?? ffi.nullptr); @@ -4016,6 +4091,11 @@ class NSSimpleCString extends NSString { return NSSimpleCString._(other._id, other._lib); } + static NSSimpleCString castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return NSSimpleCString._(other, lib); + } + static NSString stringWithCString_encoding( StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { final _ret = _lib._objc_msgSend_14(_lib._class_NSSimpleCString1, @@ -4044,6 +4124,11 @@ class NSConstantString extends NSSimpleCString { return NSConstantString._(other._id, other._lib); } + static NSConstantString castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return NSConstantString._(other, lib); + } + static NSString stringWithCString_encoding( StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { final _ret = _lib._objc_msgSend_14(_lib._class_NSConstantString1, @@ -4072,6 +4157,11 @@ class StringUtil extends NSObject { return StringUtil._(other._id, other._lib); } + static StringUtil castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return StringUtil._(other, lib); + } + static NSString strConcat_with( StringTestObjCLibrary _lib, NSObject? a, NSObject? b) { final _ret = _lib._objc_msgSend_80( diff --git a/pkgs/ffigen/test/regen.dart b/pkgs/ffigen/test/regen.dart index 675d414309..01fb806bc4 100644 --- a/pkgs/ffigen/test/regen.dart +++ b/pkgs/ffigen/test/regen.dart @@ -74,6 +74,11 @@ Future main(List args) async { File('test/native_objc_test/native_objc_test_bindings.dart'), ); + await _regenConfig( + File('test/native_objc_test/cast_config.yaml'), + File('test/native_objc_test/cast_bindings.dart'), + ); + await _regenConfig( File('test/native_objc_test/method_config.yaml'), File('test/native_objc_test/method_bindings.dart'), From 7aa6d5897accf760678c3563d4e88a53f116d3a0 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Fri, 29 Apr 2022 14:39:05 -0700 Subject: [PATCH 129/276] [ffigen] Make properties that set/get objective-c instances nullable (#348) --- .../objc_built_in_functions.dart | 21 ++++++-- .../src/code_generator/objc_interface.dart | 47 +++++++++++++---- .../sub_parsers/objcinterfacedecl_parser.dart | 9 +++- .../_expected_objc_config_bindings.dart | 9 ++++ .../_expected_objc_interface_bindings.dart | 9 ++++ .../test/native_objc_test/cast_bindings.dart | 9 ++++ .../test/native_objc_test/cast_test.dart | 27 +++++++--- .../native_objc_test/method_bindings.dart | 9 ++++ .../native_objc_test_bindings.dart | 9 ++++ .../native_objc_test/nullable_bindings.dart | 51 +++++++++++++++++++ .../test/native_objc_test/nullable_test.dart | 22 ++++++++ .../test/native_objc_test/nullable_test.m | 11 ++++ .../native_objc_test/property_bindings.dart | 9 ++++ .../native_objc_test/string_bindings.dart | 34 ++++++++----- 14 files changed, 239 insertions(+), 37 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index 95bce8ba12..1ab0798e93 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -83,11 +83,22 @@ class ObjCBuiltInFunctions { utilsExist = true; final objType = PointerType(objCObjectType).getCType(w); - s.write('\nclass _ObjCWrapper {\n'); - s.write(' final $objType _id;\n'); - s.write(' final ${w.className} _lib;\n'); - s.write(' _ObjCWrapper._(this._id, this._lib);\n'); - s.write('}\n'); + s.write(''' +class _ObjCWrapper { + final $objType _id; + final ${w.className} _lib; + + _ObjCWrapper._(this._id, this._lib); + + @override + bool operator ==(Object other) { + return other is _ObjCWrapper && _id == other._id; + } + + @override + int get hashCode => _id.hashCode; +} +'''); } void addDependencies(Set dependencies) { diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 6b9c4c61c6..ab4da9eda5 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -121,7 +121,8 @@ class ObjCInterface extends BindingType { s.write(' '); if (isStatic) { s.write('static '); - s.write(_getConvertedType(returnType, w, name)); + s.write( + _getConvertedReturnType(returnType, w, name, m.isNullableReturn)); switch (m.kind) { case ObjCMethodKind.method: @@ -147,18 +148,20 @@ class ObjCInterface extends BindingType { switch (m.kind) { case ObjCMethodKind.method: // returnType methodName(...) - s.write(_getConvertedType(returnType, w, name)); + s.write(_getConvertedReturnType( + returnType, w, name, m.isNullableReturn)); s.write(' $methodName'); s.write(paramsToString(m.params, isStatic: false)); break; case ObjCMethodKind.propertyGetter: // returnType get methodName - s.write(_getConvertedType(returnType, w, name)); + s.write(_getConvertedReturnType( + returnType, w, name, m.isNullableReturn)); s.write(' get $methodName'); break; case ObjCMethodKind.propertySetter: // set methodName(...) - s.write('set $methodName'); + s.write(' set $methodName'); s.write(paramsToString(m.params, isStatic: false)); break; } @@ -181,7 +184,8 @@ class ObjCInterface extends BindingType { } s.write(');\n'); if (convertReturn) { - final result = _doReturnConversion(returnType, '_ret', name, '_lib'); + final result = _doReturnConversion( + returnType, '_ret', name, '_lib', m.isNullableReturn); s.write(' return $result;'); } @@ -311,6 +315,15 @@ class ObjCInterface extends BindingType { return type.getDartType(w); } + String _getConvertedReturnType( + Type type, Writer w, String enclosingClass, bool isNullableReturn) { + final result = _getConvertedType(type, w, enclosingClass); + if (isNullableReturn) { + return result + "?"; + } + return result; + } + String _doArgConversion(ObjCMethodParam arg) { if (arg.type is ObjCInterface || _isObject(arg.type) || @@ -324,12 +337,22 @@ class ObjCInterface extends BindingType { return arg.name; } - String _doReturnConversion( - Type type, String value, String enclosingClass, String library) { - if (type is ObjCInterface) return '${type.name}._($value, $library)'; - if (_isObject(type)) return 'NSObject._($value, $library)'; - if (_isInstanceType(type)) return '$enclosingClass._($value, $library)'; - return value; + String _doReturnConversion(Type type, String value, String enclosingClass, + String library, bool isNullable) { + String prefix = ""; + if (isNullable) { + prefix += "$value.address == 0 ? null : "; + } + if (type is ObjCInterface) { + return prefix + '${type.name}._($value, $library)'; + } + if (_isObject(type)) { + return prefix + 'NSObject._($value, $library)'; + } + if (_isInstanceType(type)) { + return prefix + '$enclosingClass._($value, $library)'; + } + return prefix + value; } } @@ -351,6 +374,7 @@ class ObjCMethod { final String originalName; final ObjCProperty? property; Type? returnType; + final bool isNullableReturn; final List params; final ObjCMethodKind kind; final bool isClass; @@ -364,6 +388,7 @@ class ObjCMethod { required this.kind, required this.isClass, this.returnType, + this.isNullableReturn = false, List? params_, }) : params = params_ ?? []; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index c9451cfa35..658a038225 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -119,6 +119,9 @@ void _parseProperty(clang_types.CXCursor cursor) { final isReadOnly = propertyAttributes & clang_types.CXObjCPropertyAttrKind.CXObjCPropertyAttr_readonly > 0; + // TODO(#334): Use the nullable attribute to decide this. + final isNullable = + cursor.type().kind == clang_types.CXTypeKind.CXType_ObjCObjectPointer; final property = ObjCProperty(fieldName); @@ -133,8 +136,9 @@ void _parseProperty(clang_types.CXCursor cursor) { dartDoc: dartDoc, kind: ObjCMethodKind.propertyGetter, isClass: isClass, + returnType: fieldType, + isNullableReturn: isNullable, ); - getter.returnType = fieldType; itf.addMethod(getter); if (!isReadOnly) { @@ -148,7 +152,8 @@ void _parseProperty(clang_types.CXCursor cursor) { kind: ObjCMethodKind.propertySetter, isClass: isClass); setter.returnType = NativeType(SupportedNativeType.Void); - setter.params.add(ObjCMethodParam(fieldType, 'value')); + setter.params + .add(ObjCMethodParam(fieldType, 'value', isNullable: isNullable)); itf.addMethod(setter); } } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart index 3a2029dcee..a3ab4bfd54 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart @@ -423,7 +423,16 @@ class NativeLibrary { class _ObjCWrapper { final ffi.Pointer _id; final NativeLibrary _lib; + _ObjCWrapper._(this._id, this._lib); + + @override + bool operator ==(Object other) { + return other is _ObjCWrapper && _id == other._id; + } + + @override + int get hashCode => _id.hashCode; } class Foo extends NSObject { diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart index 45201d7255..9502b9fa27 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart @@ -519,7 +519,16 @@ class NativeLibrary { class _ObjCWrapper { final ffi.Pointer _id; final NativeLibrary _lib; + _ObjCWrapper._(this._id, this._lib); + + @override + bool operator ==(Object other) { + return other is _ObjCWrapper && _id == other._id; + } + + @override + int get hashCode => _id.hashCode; } class Foo extends NSObject { diff --git a/pkgs/ffigen/test/native_objc_test/cast_bindings.dart b/pkgs/ffigen/test/native_objc_test/cast_bindings.dart index fcac886494..d167a6c11d 100644 --- a/pkgs/ffigen/test/native_objc_test/cast_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/cast_bindings.dart @@ -643,7 +643,16 @@ typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< class _ObjCWrapper { final ffi.Pointer _id; final CastTestObjCLibrary _lib; + _ObjCWrapper._(this._id, this._lib); + + @override + bool operator ==(Object other) { + return other is _ObjCWrapper && _id == other._id; + } + + @override + int get hashCode => _id.hashCode; } class Castaway extends NSObject { diff --git a/pkgs/ffigen/test/native_objc_test/cast_test.dart b/pkgs/ffigen/test/native_objc_test/cast_test.dart index 20f2e18daa..d4a93f3a0e 100644 --- a/pkgs/ffigen/test/native_objc_test/cast_test.dart +++ b/pkgs/ffigen/test/native_objc_test/cast_test.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. // Objective C support is only available on mac. + @TestOn('mac-os') import 'dart:ffi'; @@ -52,17 +53,29 @@ void main() { }); test('castFrom', () { - final meAsInt = testInstance.meAsInt(); - expect(Castaway.castFrom(testInstance.meAsNSObject()).meAsInt(), meAsInt); + final fromCast = Castaway.castFrom(testInstance.meAsNSObject()); + expect(fromCast, testInstance); }); test('castFromPointer', () { final meAsInt = testInstance.meAsInt(); - expect( - Castaway.castFromPointer( - lib, Pointer.fromAddress(meAsInt)) - .meAsInt(), - meAsInt); + final fromCast = Castaway.castFromPointer( + lib, Pointer.fromAddress(meAsInt)); + expect(fromCast, testInstance); + }); + + test('equality equals', () { + final meAsInt = testInstance.meAsInt(); + final fromCast = Castaway.castFromPointer( + lib, Pointer.fromAddress(meAsInt)); + expect(fromCast, testInstance); + }); + + test('equality not equals', () { + final meAsInt = testInstance.meAsInt(); + final fromCast = Castaway.castFromPointer( + lib, Pointer.fromAddress(meAsInt)); + expect(fromCast, isNot(equals(NSObject.new1(lib)))); }); }); } diff --git a/pkgs/ffigen/test/native_objc_test/method_bindings.dart b/pkgs/ffigen/test/native_objc_test/method_bindings.dart index 27920b06bc..c695b6075b 100644 --- a/pkgs/ffigen/test/native_objc_test/method_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/method_bindings.dart @@ -696,7 +696,16 @@ typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< class _ObjCWrapper { final ffi.Pointer _id; final MethodTestObjCLibrary _lib; + _ObjCWrapper._(this._id, this._lib); + + @override + bool operator ==(Object other) { + return other is _ObjCWrapper && _id == other._id; + } + + @override + int get hashCode => _id.hashCode; } class MethodInterface extends NSObject { diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart index cf75b1cd34..53b85166ba 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart @@ -1146,7 +1146,16 @@ typedef NSExceptionName = ffi.Pointer; class _ObjCWrapper { final ffi.Pointer _id; final NativeObjCLibrary _lib; + _ObjCWrapper._(this._id, this._lib); + + @override + bool operator ==(Object other) { + return other is _ObjCWrapper && _id == other._id; + } + + @override + int get hashCode => _id.hashCode; } class Foo extends NSObject { diff --git a/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart b/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart index 6f6b1b898e..90533ce9e9 100644 --- a/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart @@ -510,6 +510,32 @@ class NullableTestObjCLibrary { _registerName1("isNullWithNullableNSObjectArg:"); late final ffi.Pointer _sel_isNullWithNotNullableNSObjectPtrArg_1 = _registerName1("isNullWithNotNullableNSObjectPtrArg:"); + late final ffi.Pointer _sel_returnNil_1 = + _registerName1("returnNil:"); + ffi.Pointer _objc_msgSend_15( + ffi.Pointer obj, + ffi.Pointer sel, + bool r, + ) { + return __objc_msgSend_15( + obj, + sel, + r ? 1 : 0, + ); + } + + late final __objc_msgSend_15Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_nullableObjectProperty1 = + _registerName1("nullableObjectProperty"); + late final ffi.Pointer _sel_setNullableObjectProperty_1 = + _registerName1("setNullableObjectProperty:"); } abstract class NSComparisonResult { @@ -611,7 +637,16 @@ typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< class _ObjCWrapper { final ffi.Pointer _id; final NullableTestObjCLibrary _lib; + _ObjCWrapper._(this._id, this._lib); + + @override + bool operator ==(Object other) { + return other is _ObjCWrapper && _id == other._id; + } + + @override + int get hashCode => _id.hashCode; } class NullableInterface extends NSObject { @@ -639,6 +674,22 @@ class NullableInterface extends NSObject { _lib._sel_isNullWithNotNullableNSObjectPtrArg_1, x?._id ?? ffi.nullptr); } + static NSObject returnNil(NullableTestObjCLibrary _lib, bool r) { + final _ret = _lib._objc_msgSend_15( + _lib._class_NullableInterface1, _lib._sel_returnNil_1, r); + return NSObject._(_ret, _lib); + } + + NSObject? get nullableObjectProperty { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_nullableObjectProperty1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } + + set nullableObjectProperty(NSObject? value) { + _lib._objc_msgSend_8( + _id, _lib._sel_setNullableObjectProperty_1, value?._id ?? ffi.nullptr); + } + static NullableInterface new1(NullableTestObjCLibrary _lib) { final _ret = _lib._objc_msgSend_1(_lib._class_NullableInterface1, _lib._sel_new1); diff --git a/pkgs/ffigen/test/native_objc_test/nullable_test.dart b/pkgs/ffigen/test/native_objc_test/nullable_test.dart index fe15f8d416..c93d56e930 100644 --- a/pkgs/ffigen/test/native_objc_test/nullable_test.dart +++ b/pkgs/ffigen/test/native_objc_test/nullable_test.dart @@ -17,6 +17,7 @@ import 'nullable_bindings.dart'; void main() { late NullableTestObjCLibrary lib; + late NullableInterface nullableInterface; late NSObject obj; group('method calls', () { setUpAll(() { @@ -24,6 +25,7 @@ void main() { final dylib = File('test/native_objc_test/nullable_test.dylib'); verifySetupFile(dylib); lib = NullableTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); + nullableInterface = NullableInterface.new1(lib); obj = NSObject.new1(lib); }); @@ -50,6 +52,26 @@ void main() { } }); + group('Nullable property', () { + test('Not null', () { + nullableInterface.nullableObjectProperty = obj; + expect(nullableInterface.nullableObjectProperty, obj); + }); + test('Null', () { + nullableInterface.nullableObjectProperty = null; + expect(nullableInterface.nullableObjectProperty, null); + }); + }); + + group('Nullable return', () { + test('Not null', () { + expect(NullableInterface.returnNil(lib, false), isA()); + }); + test('Null', () { + expect(NullableInterface.returnNil(lib, true), null); + }); + }, skip: "TODO(#334): enable this test"); + group('Nullable arguments', () { test('Not null', () { expect( diff --git a/pkgs/ffigen/test/native_objc_test/nullable_test.m b/pkgs/ffigen/test/native_objc_test/nullable_test.m index 4733493f0a..abf1b02b85 100644 --- a/pkgs/ffigen/test/native_objc_test/nullable_test.m +++ b/pkgs/ffigen/test/native_objc_test/nullable_test.m @@ -5,6 +5,9 @@ @interface NullableInterface : NSObject { +(BOOL) isNullWithNullableNSObjectArg:(nullable NSObject *)x; +(BOOL) isNullWithNotNullableNSObjectPtrArg:(NSObject *)x; ++(nullable NSObject *) returnNil:(BOOL)r; + +@property (nullable, retain) NSObject *nullableObjectProperty; @end @@ -18,4 +21,12 @@ +(BOOL) isNullWithNotNullableNSObjectPtrArg:(NSObject *)x { return x == NULL; } ++(nullable NSObject *) returnNil:(BOOL)r { + if (r) { + return nil; + } else { + return [NSObject new]; + } +} + @end diff --git a/pkgs/ffigen/test/native_objc_test/property_bindings.dart b/pkgs/ffigen/test/native_objc_test/property_bindings.dart index 0b7ecc3cf2..90ec1bec33 100644 --- a/pkgs/ffigen/test/native_objc_test/property_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/property_bindings.dart @@ -662,7 +662,16 @@ typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< class _ObjCWrapper { final ffi.Pointer _id; final PropertyTestObjCLibrary _lib; + _ObjCWrapper._(this._id, this._lib); + + @override + bool operator ==(Object other) { + return other is _ObjCWrapper && _id == other._id; + } + + @override + int get hashCode => _id.hashCode; } class PropertyInterface extends NSObject { diff --git a/pkgs/ffigen/test/native_objc_test/string_bindings.dart b/pkgs/ffigen/test/native_objc_test/string_bindings.dart index d9ea394889..bfadf87680 100644 --- a/pkgs/ffigen/test/native_objc_test/string_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/string_bindings.dart @@ -2627,7 +2627,16 @@ typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< class _ObjCWrapper { final ffi.Pointer _id; final StringTestObjCLibrary _lib; + _ObjCWrapper._(this._id, this._lib); + + @override + bool operator ==(Object other) { + return other is _ObjCWrapper && _id == other._id; + } + + @override + int get hashCode => _id.hashCode; } class NSValue extends NSObject { @@ -3112,9 +3121,9 @@ class NSNumber extends NSValue { return _lib._objc_msgSend_11(_id, _lib._sel_unsignedIntegerValue1); } - NSObject get stringValue { + NSObject? get stringValue { final _ret = _lib._objc_msgSend_1(_id, _lib._sel_stringValue1); - return NSObject._(_ret, _lib); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); } int compare(NSObject? otherNumber) { @@ -3627,14 +3636,14 @@ class NSOrderedCollectionDifference extends NSObject { return NSOrderedCollectionDifference._(_ret, _lib); } - NSObject get insertions { + NSObject? get insertions { final _ret = _lib._objc_msgSend_1(_id, _lib._sel_insertions1); - return NSObject._(_ret, _lib); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); } - NSObject get removals { + NSObject? get removals { final _ret = _lib._objc_msgSend_1(_id, _lib._sel_removals1); - return NSObject._(_ret, _lib); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); } bool get hasChanges { @@ -3839,10 +3848,10 @@ class NSItemProvider extends NSObject { loadHandler._id); } - NSObject get registeredTypeIdentifiers { + NSObject? get registeredTypeIdentifiers { final _ret = _lib._objc_msgSend_1(_id, _lib._sel_registeredTypeIdentifiers1); - return NSObject._(_ret, _lib); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); } bool hasItemConformingToTypeIdentifier(NSObject? typeIdentifier) { @@ -3891,13 +3900,14 @@ class NSItemProvider extends NSObject { return NSProgress._(_ret, _lib); } - NSObject get suggestedName { + NSObject? get suggestedName { final _ret = _lib._objc_msgSend_1(_id, _lib._sel_suggestedName1); - return NSObject._(_ret, _lib); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); } - set suggestedName(NSObject value) { - _lib._objc_msgSend_8(_id, _lib._sel_setSuggestedName_1, value._id); + set suggestedName(NSObject? value) { + _lib._objc_msgSend_8( + _id, _lib._sel_setSuggestedName_1, value?._id ?? ffi.nullptr); } NSItemProvider initWithObject(NSObject? object) { From 47d147ee5a54e77bc773e3033e2c64f59c6b93e2 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Mon, 2 May 2022 12:05:55 -0700 Subject: [PATCH 130/276] [ffigen] Fix coverage configuration (#337) * Fix coverage configuration * Remove test_coverage.dart and only run coverage on mac --- .../ffigen/.github/workflows/test-package.yml | 7 -- pkgs/ffigen/.gitignore | 2 + pkgs/ffigen/test/test_coverage.dart | 70 ------------------- pkgs/ffigen/tool/coverage.sh | 10 +-- 4 files changed, 5 insertions(+), 84 deletions(-) delete mode 100644 pkgs/ffigen/test/test_coverage.dart diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 90e290eecf..8d404a8a13 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -52,13 +52,6 @@ jobs: run: dart test/setup.dart - name: Run VM tests run: dart test --platform vm - - name: Collect coverage - run: ./tool/coverage.sh - - name: Upload coverage - uses: coverallsapp/github-action@v1.1.2 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: lcov.info mac-test: needs: analyze diff --git a/pkgs/ffigen/.gitignore b/pkgs/ffigen/.gitignore index 96f7b0198e..71c0ba13d5 100644 --- a/pkgs/ffigen/.gitignore +++ b/pkgs/ffigen/.gitignore @@ -37,3 +37,5 @@ experiments/ # Files generated by tests for debugging purposes. test/debug_generated/* !test/debug_generated/readme.md +lcov.info +coverage.json diff --git a/pkgs/ffigen/test/test_coverage.dart b/pkgs/ffigen/test/test_coverage.dart deleted file mode 100644 index 88623baeef..0000000000 --- a/pkgs/ffigen/test/test_coverage.dart +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'code_generator_tests/code_generator_test.dart' as code_generator_test; -import 'collision_tests/decl_decl_collision_test.dart' - as collision_tests_decl_decl_collision_test; -import 'collision_tests/reserved_keyword_collision_test.dart' - as collision_tests_reserved_keyword_collision_test; -import 'config_tests/compiler_opts_test.dart' - as config_tests_compiler_opts_test; -import 'example_tests/cjson_example_test.dart' - as example_tests_cjson_example_test; -import 'example_tests/libclang_example_test.dart' - as example_tests_libclang_example_test; -import 'example_tests/simple_example_test.dart' - as example_tests_simple_example_test; -import 'header_parser_tests/comment_markup_test.dart' - as header_parser_tests_comment_markup_test; -import 'header_parser_tests/dart_handle_test.dart' - as header_parser_tests_dart_handle_test; -import 'header_parser_tests/forward_decl_test.dart' - as header_parser_tests_forward_decl_test; -import 'header_parser_tests/function_n_struct_test.dart' - as header_parser_tests_function_n_struct_test; -import 'header_parser_tests/functions_test.dart' - as header_parser_tests_functions_test; -import 'header_parser_tests/globals_test.dart' - as header_parser_tests_globals_test; -import 'header_parser_tests/macros_test.dart' - as header_parser_tests_macros_test; -import 'header_parser_tests/native_func_typedef_test.dart' - as header_parser_tests_native_func_typedef_test; -import 'header_parser_tests/nested_parsing_test.dart' - as header_parser_tests_nested_parsing_test; -import 'header_parser_tests/opaque_dependencies_test.dart' - as header_parser_tests_opaque_dependencies_test; -import 'header_parser_tests/typedef_test.dart' - as header_parser_tests_typedef_test; -import 'header_parser_tests/unnamed_enums_test.dart' - as header_parser_tests_unnamed_enums_test; -import 'large_integration_tests/large_test.dart' - as large_integration_tests_large_test; -import 'native_test/native_test.dart' as native_test_native_test; -import 'rename_tests/rename_test.dart' as rename_tests_rename_test; - -void main() { - large_integration_tests_large_test.main(); - example_tests_cjson_example_test.main(); - example_tests_simple_example_test.main(); - example_tests_libclang_example_test.main(); - collision_tests_decl_decl_collision_test.main(); - collision_tests_reserved_keyword_collision_test.main(); - config_tests_compiler_opts_test.main(); - header_parser_tests_comment_markup_test.main(); - header_parser_tests_dart_handle_test.main(); - header_parser_tests_forward_decl_test.main(); - header_parser_tests_functions_test.main(); - header_parser_tests_globals_test.main(); - header_parser_tests_macros_test.main(); - header_parser_tests_function_n_struct_test.main(); - header_parser_tests_native_func_typedef_test.main(); - header_parser_tests_nested_parsing_test.main(); - header_parser_tests_opaque_dependencies_test.main(); - header_parser_tests_typedef_test.main(); - header_parser_tests_unnamed_enums_test.main(); - native_test_native_test.main(); - rename_tests_rename_test.main(); - code_generator_test.main(); -} diff --git a/pkgs/ffigen/tool/coverage.sh b/pkgs/ffigen/tool/coverage.sh index 7cecbfefbb..02c8e2f47c 100755 --- a/pkgs/ffigen/tool/coverage.sh +++ b/pkgs/ffigen/tool/coverage.sh @@ -8,12 +8,8 @@ set -e # Gather coverage. -dart pub global activate remove_from_coverage dart pub global activate coverage # Generate coverage report. -dart --pause-isolates-on-exit --disable-service-auth-codes --enable-vm-service=3000 test/test_coverage.dart & -dart pub global run coverage:collect_coverage --wait-paused --uri=http://127.0.0.1:3000/ -o coverage.json --resume-isolates -dart pub global run coverage:format_coverage --lcov -i coverage.json -o lcov.info - -# Remove extra files from coverage report. -dart pub global run remove_from_coverage -f lcov.info -r ".pub-cache" +dart run --pause-isolates-on-exit --disable-service-auth-codes --enable-vm-service=3000 test & +dart pub global run coverage:collect_coverage --wait-paused --uri=http://127.0.0.1:3000/ -o coverage.json --resume-isolates --scope-output=ffigen +dart pub global run coverage:format_coverage --packages=.dart_tool/package_config.json --lcov -i coverage.json -o lcov.info From c1bafec4bcb7b2d1d28a32a013f096b03b56763d Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Mon, 2 May 2022 15:39:57 -0700 Subject: [PATCH 131/276] [ffigen] Categories (#349) * WIP categories * Categories mostly done * Fix some errors * Fix analysis errors * Fix tests --- .../objc_built_in_functions.dart | 2 +- .../src/code_generator/objc_interface.dart | 5 +- .../sub_parsers/objcinterfacedecl_parser.dart | 55 + .../translation_unit_parser.dart | 8 +- pkgs/ffigen/lib/src/header_parser/utils.dart | 21 + .../_expected_objc_basic_types_bindings.dart | 779 +- .../_expected_objc_config_bindings.dart | 166 +- .../_expected_objc_interface_bindings.dart | 272 +- .../test/native_objc_test/cast_bindings.dart | 202 +- .../native_objc_test/category_bindings.dart | 1377 +++ .../native_objc_test/category_config.yaml | 12 + .../test/native_objc_test/category_test.dart | 59 + .../test/native_objc_test/category_test.m | 21 + .../native_objc_test/method_bindings.dart | 272 +- .../native_objc_test_bindings.dart | 8535 +++++++++++++++-- .../native_objc_test/nullable_bindings.dart | 238 +- .../native_objc_test/property_bindings.dart | 244 +- pkgs/ffigen/test/native_objc_test/setup.dart | 1 + .../native_objc_test/string_bindings.dart | 7554 ++++++++++++--- pkgs/ffigen/test/regen.dart | 5 + 20 files changed, 16893 insertions(+), 2935 deletions(-) create mode 100644 pkgs/ffigen/test/native_objc_test/category_bindings.dart create mode 100644 pkgs/ffigen/test/native_objc_test/category_config.yaml create mode 100644 pkgs/ffigen/test/native_objc_test/category_test.dart create mode 100644 pkgs/ffigen/test/native_objc_test/category_test.m diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index 1ab0798e93..3f0a647e9b 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -124,7 +124,7 @@ class _ObjCWrapper { // Generate a toString method that wraps UTF8String. s.write(' @override\n'); - s.write(' String toString() => UTF8String().cast<' + s.write(' String toString() => (UTF8String).cast<' '${w.ffiPkgLibraryPrefix}.Utf8>().toDartString();\n\n'); } diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index ab4da9eda5..bddaec9f26 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -25,9 +25,12 @@ const _excludedNSObjectClassMethods = { 'isSubclassOfClass:', 'load', 'mutableCopyWithZone:', + 'poseAsClass:', 'resolveClassMethod:', 'resolveInstanceMethod:', + 'setVersion:', 'superclass', + 'version', }; class ObjCInterface extends BindingType { @@ -282,7 +285,7 @@ class ObjCInterface extends BindingType { )); addMethodIfMissing(ObjCMethod( originalName: 'UTF8String', - kind: ObjCMethodKind.method, + kind: ObjCMethodKind.propertyGetter, isClass: false, returnType: PointerType(charType), params_: [], diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index 658a038225..f30abe5696 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -238,3 +238,58 @@ void _parseMethodParam(clang_types.CXCursor cursor) { _methodStack.top.method.params .add(ObjCMethodParam(type, name, isNullable: isNullable)); } + +BindingType? parseObjCCategoryDeclaration(clang_types.CXCursor cursor) { + // Categories add methods to an existing interface, so first we run a visitor + // to find the interface, then we fully parse that interface, then we run the + // _parseInterfaceVisitor over the category to add its methods etc. Reusing + // the interface visitor relies on the fact that the structure of the category + // AST looks exactly the same as the interface AST, and that the category's + // interface is a different kind of node to the interface's super type (so is + // ignored by _parseInterfaceVisitor). + final name = cursor.spelling(); + _logger.fine('++++ Adding ObjC category: ' + 'Name: $name, ${cursor.completeStringRepr()}'); + + _findCategoryInterfaceVisitorResult = null; + clang.clang_visitChildren( + cursor, + Pointer.fromFunction( + _findCategoryInterfaceVisitor, exceptional_visitor_return), + nullptr); + final itfCursor = _findCategoryInterfaceVisitorResult; + if (itfCursor == null) { + _logger.severe('Category $name has no interface.'); + return null; + } + + // TODO(#347): Currently any interface with a category bypasses the filters. + final itf = itfCursor.type().toCodeGenType(); + if (itf is! ObjCInterface) { + _logger.severe( + 'Interface of category $name is $itf, which is not a valid interface.'); + return null; + } + + _interfaceStack.push(_ParsedObjCInterface(itf)); + clang.clang_visitChildren( + cursor, + Pointer.fromFunction(_parseInterfaceVisitor, exceptional_visitor_return), + nullptr); + _interfaceStack.pop(); + + _logger.fine('++++ Finished ObjC category: ' + 'Name: $name, ${cursor.completeStringRepr()}'); + + return itf; +} + +clang_types.CXCursor? _findCategoryInterfaceVisitorResult; +int _findCategoryInterfaceVisitor(clang_types.CXCursor cursor, + clang_types.CXCursor parent, Pointer clientData) { + if (cursor.kind == clang_types.CXCursorKind.CXCursor_ObjCClassRef) { + _findCategoryInterfaceVisitorResult = cursor; + return clang_types.CXChildVisitResult.CXChildVisit_Break; + } + return clang_types.CXChildVisitResult.CXChildVisit_Continue; +} diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart index f64397955d..7831ae8aa4 100644 --- a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -6,6 +6,7 @@ import 'dart:ffi'; import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/header_parser/sub_parsers/macro_parser.dart'; +import 'package:ffigen/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart'; import 'package:ffigen/src/header_parser/sub_parsers/var_parser.dart'; import 'package:logging/logging.dart'; @@ -47,17 +48,18 @@ int _rootCursorVisitor(clang_types.CXCursor cursor, clang_types.CXCursor parent, case clang_types.CXCursorKind.CXCursor_StructDecl: case clang_types.CXCursorKind.CXCursor_UnionDecl: case clang_types.CXCursorKind.CXCursor_EnumDecl: + case clang_types.CXCursorKind.CXCursor_ObjCInterfaceDecl: addToBindings(_getCodeGenTypeFromCursor(cursor)); break; + case clang_types.CXCursorKind.CXCursor_ObjCCategoryDecl: + addToBindings(parseObjCCategoryDeclaration(cursor)); + break; case clang_types.CXCursorKind.CXCursor_MacroDefinition: saveMacroDefinition(cursor); break; case clang_types.CXCursorKind.CXCursor_VarDecl: addToBindings(parseVarDeclaration(cursor)); break; - case clang_types.CXCursorKind.CXCursor_ObjCInterfaceDecl: - addToBindings(_getCodeGenTypeFromCursor(cursor)); - break; default: _logger.finer('rootCursorVisitor: CursorKind not implemented'); } diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index b110134592..068b78644b 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -118,6 +118,27 @@ extension CXCursorExt on clang_types.CXCursor { calloc.free(offset); return s; } + + /// Recursively print the AST, for debugging. + void printAst([int maxDepth = 3]) { + _printAstVisitorMaxDepth = maxDepth; + _printAstVisitor(this, this, Pointer.fromAddress(0)); + } +} + +int _printAstVisitorMaxDepth = 0; +int _printAstVisitor(clang_types.CXCursor cursor, clang_types.CXCursor parent, + Pointer clientData) { + final depth = clientData.address; + if (depth > _printAstVisitorMaxDepth) { + return clang_types.CXChildVisitResult.CXChildVisit_Break; + } + print((' ' * depth) + cursor.completeStringRepr()); + clang.clang_visitChildren( + cursor, + Pointer.fromFunction(_printAstVisitor, exceptional_visitor_return), + Pointer.fromAddress(depth + 1)); + return clang_types.CXChildVisitResult.CXChildVisit_Continue; } const commentPrefix = '/// '; diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart index 7622bb9ad6..5fa6fc71b5 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart @@ -4,6 +4,781 @@ import 'dart:ffi' as ffi; import 'package:ffi/ffi.dart' as pkg_ffi; +/// ObjC Basic Types Test +class NativeLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + NativeLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NativeLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + ffi.Pointer _registerName1(String name) { + final cstr = name.toNativeUtf8(); + final sel = _sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; + } + + ffi.Pointer _sel_registerName( + ffi.Pointer str, + ) { + return __sel_registerName( + str, + ); + } + + late final __sel_registerNamePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sel_registerName'); + late final __sel_registerName = __sel_registerNamePtr + .asFunction Function(ffi.Pointer)>(); + + ffi.Pointer _getClass1(String name) { + final cstr = name.toNativeUtf8(); + final clazz = _objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; + } + + ffi.Pointer _objc_getClass( + ffi.Pointer str, + ) { + return __objc_getClass( + str, + ); + } + + late final __objc_getClassPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('objc_getClass'); + late final __objc_getClass = __objc_getClassPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); + + late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); + late final ffi.Pointer _sel_load1 = _registerName1("load"); + void _objc_msgSend_0( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_0( + obj, + sel, + ); + } + + late final __objc_msgSend_0Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_initialize1 = + _registerName1("initialize"); + late final ffi.Pointer _sel_init1 = _registerName1("init"); + instancetype _objc_msgSend_1( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1( + obj, + sel, + ); + } + + late final __objc_msgSend_1Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_new1 = _registerName1("new"); + late final ffi.Pointer _sel_allocWithZone_1 = + _registerName1("allocWithZone:"); + instancetype _objc_msgSend_2( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_2( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_2Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>(); + + late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); + late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); + late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); + late final ffi.Pointer _sel_copy1 = _registerName1("copy"); + late final ffi.Pointer _sel_mutableCopy1 = + _registerName1("mutableCopy"); + late final ffi.Pointer _sel_copyWithZone_1 = + _registerName1("copyWithZone:"); + late final ffi.Pointer _sel_mutableCopyWithZone_1 = + _registerName1("mutableCopyWithZone:"); + late final ffi.Pointer _sel_instancesRespondToSelector_1 = + _registerName1("instancesRespondToSelector:"); + bool _objc_msgSend_3( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_3( + obj, + sel, + aSelector, + ) != + 0; + } + + late final __objc_msgSend_3Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_conformsToProtocol_1 = + _registerName1("conformsToProtocol:"); + bool _objc_msgSend_4( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer protocol, + ) { + return __objc_msgSend_4( + obj, + sel, + protocol, + ) != + 0; + } + + late final __objc_msgSend_4Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_methodForSelector_1 = + _registerName1("methodForSelector:"); + IMP _objc_msgSend_5( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_5( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_5Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_instanceMethodForSelector_1 = + _registerName1("instanceMethodForSelector:"); + late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = + _registerName1("doesNotRecognizeSelector:"); + void _objc_msgSend_6( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_6( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_6Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_forwardingTargetForSelector_1 = + _registerName1("forwardingTargetForSelector:"); + ffi.Pointer _objc_msgSend_7( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_7( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_7Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_forwardInvocation_1 = + _registerName1("forwardInvocation:"); + void _objc_msgSend_8( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anInvocation, + ) { + return __objc_msgSend_8( + obj, + sel, + anInvocation, + ); + } + + late final __objc_msgSend_8Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _class_NSMethodSignature1 = + _getClass1("NSMethodSignature"); + late final ffi.Pointer _sel_methodSignatureForSelector_1 = + _registerName1("methodSignatureForSelector:"); + ffi.Pointer _objc_msgSend_9( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_9( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_9Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = + _registerName1("instanceMethodSignatureForSelector:"); + late final ffi.Pointer _sel_allowsWeakReference1 = + _registerName1("allowsWeakReference"); + bool _objc_msgSend_10( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_10( + obj, + sel, + ) != + 0; + } + + late final __objc_msgSend_10Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_retainWeakReference1 = + _registerName1("retainWeakReference"); + late final ffi.Pointer _sel_isSubclassOfClass_1 = + _registerName1("isSubclassOfClass:"); + late final ffi.Pointer _sel_resolveClassMethod_1 = + _registerName1("resolveClassMethod:"); + late final ffi.Pointer _sel_resolveInstanceMethod_1 = + _registerName1("resolveInstanceMethod:"); + late final ffi.Pointer _sel_hash1 = _registerName1("hash"); + int _objc_msgSend_11( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_11( + obj, + sel, + ); + } + + late final __objc_msgSend_11Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_superclass1 = + _registerName1("superclass"); + late final ffi.Pointer _sel_class1 = _registerName1("class"); + late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); + late final ffi.Pointer _sel_stringWithCString_encoding_1 = + _registerName1("stringWithCString:encoding:"); + ffi.Pointer _objc_msgSend_12( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cString, + int enc, + ) { + return __objc_msgSend_12( + obj, + sel, + cString, + enc, + ); + } + + late final __objc_msgSend_12Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + pkg_ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_UTF8String1 = + _registerName1("UTF8String"); + ffi.Pointer _objc_msgSend_13( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_13( + obj, + sel, + ); + } + + late final __objc_msgSend_13Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_description1 = + _registerName1("description"); + ffi.Pointer _objc_msgSend_14( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_14( + obj, + sel, + ); + } + + late final __objc_msgSend_14Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_debugDescription1 = + _registerName1("debugDescription"); + late final ffi.Pointer _sel_version1 = _registerName1("version"); + int _objc_msgSend_15( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_15( + obj, + sel, + ); + } + + late final __objc_msgSend_15Ptr = _lookup< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_setVersion_1 = + _registerName1("setVersion:"); + void _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + int aVersion, + ) { + return __objc_msgSend_16( + obj, + sel, + aVersion, + ); + } + + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_classForCoder1 = + _registerName1("classForCoder"); + late final ffi.Pointer _sel_replacementObjectForCoder_1 = + _registerName1("replacementObjectForCoder:"); + ffi.Pointer _objc_msgSend_17( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_17( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_17Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = + _registerName1("awakeAfterUsingCoder:"); + late final ffi.Pointer _sel_poseAsClass_1 = + _registerName1("poseAsClass:"); + late final ffi.Pointer _sel_autoContentAccessingProxy1 = + _registerName1("autoContentAccessingProxy"); +} + +class _ObjCWrapper { + final ffi.Pointer _id; + final NativeLibrary _lib; + + _ObjCWrapper._(this._id, this._lib); + + @override + bool operator ==(Object other) { + return other is _ObjCWrapper && _id == other._id; + } + + @override + int get hashCode => _id.hashCode; +} + +class NSObject extends _ObjCWrapper { + NSObject._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); + + static NSObject castFrom(T other) { + return NSObject._(other._id, other._lib); + } + + static NSObject castFromPointer( + NativeLibrary lib, ffi.Pointer other) { + return NSObject._(other, lib); + } + + static void load(NativeLibrary _lib) { + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); + } + + static void initialize(NativeLibrary _lib) { + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); + } + + NSObject init() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); + return NSObject._(_ret, _lib); + } + + static NSObject new1(NativeLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); + return NSObject._(_ret, _lib); + } + + static NSObject allocWithZone(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static NSObject alloc(NativeLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); + return NSObject._(_ret, _lib); + } + + void dealloc() { + _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); + } + + void finalize() { + _lib._objc_msgSend_0(_id, _lib._sel_finalize1); + } + + NSObject copy() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); + return NSObject._(_ret, _lib); + } + + NSObject mutableCopy() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); + return NSObject._(_ret, _lib); + } + + static NSObject copyWithZone(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static NSObject mutableCopyWithZone( + NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static bool instancesRespondToSelector( + NativeLibrary _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_3(_lib._class_NSObject1, + _lib._sel_instancesRespondToSelector_1, aSelector); + } + + static bool conformsToProtocol(NativeLibrary _lib, NSObject? protocol) { + return _lib._objc_msgSend_4(_lib._class_NSObject1, + _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); + } + + IMP methodForSelector(ffi.Pointer aSelector) { + return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); + } + + static IMP instanceMethodForSelector( + NativeLibrary _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_5(_lib._class_NSObject1, + _lib._sel_instanceMethodForSelector_1, aSelector); + } + + void doesNotRecognizeSelector(ffi.Pointer aSelector) { + _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); + } + + NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_7( + _id, _lib._sel_forwardingTargetForSelector_1, aSelector); + return NSObject._(_ret, _lib); + } + + void forwardInvocation(NSObject? anInvocation) { + _lib._objc_msgSend_8( + _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); + } + + NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_9( + _id, _lib._sel_methodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static NSMethodSignature instanceMethodSignatureForSelector( + NativeLibrary _lib, ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, + _lib._sel_instanceMethodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + bool allowsWeakReference() { + return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); + } + + bool retainWeakReference() { + return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); + } + + static bool isSubclassOfClass(NativeLibrary _lib, NSObject aClass) { + return _lib._objc_msgSend_4( + _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); + } + + static bool resolveClassMethod(NativeLibrary _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); + } + + static bool resolveInstanceMethod( + NativeLibrary _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); + } + + static int hash(NativeLibrary _lib) { + return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); + } + + static NSObject superclass(NativeLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); + return NSObject._(_ret, _lib); + } + + static NSObject class1(NativeLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); + return NSObject._(_ret, _lib); + } + + static NSString description(NativeLibrary _lib) { + final _ret = + _lib._objc_msgSend_14(_lib._class_NSObject1, _lib._sel_description1); + return NSString._(_ret, _lib); + } + + static NSString debugDescription(NativeLibrary _lib) { + final _ret = _lib._objc_msgSend_14( + _lib._class_NSObject1, _lib._sel_debugDescription1); + return NSString._(_ret, _lib); + } + + static int version(NativeLibrary _lib) { + return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); + } + + static void setVersion(NativeLibrary _lib, int aVersion) { + _lib._objc_msgSend_16( + _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); + } + + NSObject get classForCoder { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); + return NSObject._(_ret, _lib); + } + + NSObject replacementObjectForCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + NSObject awakeAfterUsingCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + static void poseAsClass(NativeLibrary _lib, NSObject aClass) { + _lib._objc_msgSend_8( + _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); + } + + NSObject get autoContentAccessingProxy { + final _ret = + _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); + return NSObject._(_ret, _lib); + } +} + +class ObjCSel extends ffi.Opaque {} + +class ObjCObject extends ffi.Opaque {} + +typedef instancetype = ffi.Pointer; + +class _NSZone extends ffi.Opaque {} + +typedef IMP = ffi.Pointer>; + +class NSMethodSignature extends _ObjCWrapper { + NSMethodSignature._(ffi.Pointer id, NativeLibrary lib) + : super._(id, lib); + + static NSMethodSignature castFrom(T other) { + return NSMethodSignature._(other._id, other._lib); + } + + static NSMethodSignature castFromPointer( + NativeLibrary lib, ffi.Pointer other) { + return NSMethodSignature._(other, lib); + } +} + +typedef NSUInteger = pkg_ffi.UnsignedLong; + +class NSString extends _ObjCWrapper { + NSString._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); + + static NSString castFrom(T other) { + return NSString._(other._id, other._lib); + } + + static NSString castFromPointer( + NativeLibrary lib, ffi.Pointer other) { + return NSString._(other, lib); + } + + factory NSString(NativeLibrary _lib, String str) { + final cstr = str.toNativeUtf8(); + final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + pkg_ffi.calloc.free(cstr); + return nsstr; + } + + @override + String toString() => (UTF8String).cast().toDartString(); + + static NSString stringWithCString_encoding( + NativeLibrary _lib, ffi.Pointer cString, int enc) { + final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); + return NSString._(_ret, _lib); + } + + ffi.Pointer get UTF8String { + return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); + } +} + +extension StringToNSString on String { + NSString toNSString(NativeLibrary lib) => NSString(lib, this); +} + +typedef NSInteger = pkg_ffi.Long; + class Foo extends ffi.Struct { @ffi.Uint8() external int someBool; @@ -18,7 +793,3 @@ class Foo extends ffi.Struct { external ffi.Pointer blockThatReturnsAnInt; } - -class ObjCObject extends ffi.Opaque {} - -class ObjCSel extends ffi.Opaque {} diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart index a3ab4bfd54..735c0f7cbd 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart @@ -64,7 +64,6 @@ class NativeLibrary { late final __objc_getClass = __objc_getClassPtr.asFunction< ffi.Pointer Function(ffi.Pointer)>(); - late final ffi.Pointer _class_Foo1 = _getClass1("Foo"); late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); late final ffi.Pointer _sel_load1 = _registerName1("load"); void _objc_msgSend_0( @@ -418,6 +417,76 @@ class NativeLibrary { late final ffi.Pointer _sel_debugDescription1 = _registerName1("debugDescription"); + late final ffi.Pointer _sel_version1 = _registerName1("version"); + int _objc_msgSend_15( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_15( + obj, + sel, + ); + } + + late final __objc_msgSend_15Ptr = _lookup< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_setVersion_1 = + _registerName1("setVersion:"); + void _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + int aVersion, + ) { + return __objc_msgSend_16( + obj, + sel, + aVersion, + ); + } + + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_classForCoder1 = + _registerName1("classForCoder"); + late final ffi.Pointer _sel_replacementObjectForCoder_1 = + _registerName1("replacementObjectForCoder:"); + ffi.Pointer _objc_msgSend_17( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_17( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_17Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = + _registerName1("awakeAfterUsingCoder:"); + late final ffi.Pointer _sel_poseAsClass_1 = + _registerName1("poseAsClass:"); + late final ffi.Pointer _sel_autoContentAccessingProxy1 = + _registerName1("autoContentAccessingProxy"); + late final ffi.Pointer _class_Foo1 = _getClass1("Foo"); } class _ObjCWrapper { @@ -435,32 +504,6 @@ class _ObjCWrapper { int get hashCode => _id.hashCode; } -class Foo extends NSObject { - Foo._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); - - static Foo castFrom(T other) { - return Foo._(other._id, other._lib); - } - - static Foo castFromPointer(NativeLibrary lib, ffi.Pointer other) { - return Foo._(other, lib); - } - - static Foo new1(NativeLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_new1); - return Foo._(_ret, _lib); - } - - static Foo alloc(NativeLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_alloc1); - return Foo._(_ret, _lib); - } -} - -class ObjCSel extends ffi.Opaque {} - -class ObjCObject extends ffi.Opaque {} - class NSObject extends _ObjCWrapper { NSObject._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); @@ -632,8 +675,49 @@ class NSObject extends _ObjCWrapper { _lib._class_NSObject1, _lib._sel_debugDescription1); return NSString._(_ret, _lib); } + + static int version(NativeLibrary _lib) { + return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); + } + + static void setVersion(NativeLibrary _lib, int aVersion) { + _lib._objc_msgSend_16( + _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); + } + + NSObject get classForCoder { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); + return NSObject._(_ret, _lib); + } + + NSObject replacementObjectForCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + NSObject awakeAfterUsingCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + static void poseAsClass(NativeLibrary _lib, NSObject aClass) { + _lib._objc_msgSend_8( + _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); + } + + NSObject get autoContentAccessingProxy { + final _ret = + _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); + return NSObject._(_ret, _lib); + } } +class ObjCSel extends ffi.Opaque {} + +class ObjCObject extends ffi.Opaque {} + typedef instancetype = ffi.Pointer; class _NSZone extends ffi.Opaque {} @@ -676,7 +760,7 @@ class NSString extends _ObjCWrapper { } @override - String toString() => UTF8String().cast().toDartString(); + String toString() => (UTF8String).cast().toDartString(); static NSString stringWithCString_encoding( NativeLibrary _lib, ffi.Pointer cString, int enc) { @@ -685,7 +769,7 @@ class NSString extends _ObjCWrapper { return NSString._(_ret, _lib); } - ffi.Pointer UTF8String() { + ffi.Pointer get UTF8String { return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); } } @@ -693,3 +777,27 @@ class NSString extends _ObjCWrapper { extension StringToNSString on String { NSString toNSString(NativeLibrary lib) => NSString(lib, this); } + +typedef NSInteger = pkg_ffi.Long; + +class Foo extends NSObject { + Foo._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); + + static Foo castFrom(T other) { + return Foo._(other._id, other._lib); + } + + static Foo castFromPointer(NativeLibrary lib, ffi.Pointer other) { + return Foo._(other, lib); + } + + static Foo new1(NativeLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_new1); + return Foo._(_ret, _lib); + } + + static Foo alloc(NativeLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_alloc1); + return Foo._(_ret, _lib); + } +} diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart index 9502b9fa27..3a91e7bf0a 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart @@ -64,7 +64,6 @@ class NativeLibrary { late final __objc_getClass = __objc_getClassPtr.asFunction< ffi.Pointer Function(ffi.Pointer)>(); - late final ffi.Pointer _class_Foo1 = _getClass1("Foo"); late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); late final ffi.Pointer _sel_load1 = _registerName1("load"); void _objc_msgSend_0( @@ -418,8 +417,7 @@ class NativeLibrary { late final ffi.Pointer _sel_debugDescription1 = _registerName1("debugDescription"); - late final ffi.Pointer _sel_someProperty1 = - _registerName1("someProperty"); + late final ffi.Pointer _sel_version1 = _registerName1("version"); int _objc_msgSend_15( ffi.Pointer obj, ffi.Pointer sel, @@ -432,30 +430,101 @@ class NativeLibrary { late final __objc_msgSend_15Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + NSInteger Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_setVersion_1 = + _registerName1("setVersion:"); + void _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + int aVersion, + ) { + return __objc_msgSend_16( + obj, + sel, + aVersion, + ); + } + + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_classForCoder1 = + _registerName1("classForCoder"); + late final ffi.Pointer _sel_replacementObjectForCoder_1 = + _registerName1("replacementObjectForCoder:"); + ffi.Pointer _objc_msgSend_17( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_17( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_17Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = + _registerName1("awakeAfterUsingCoder:"); + late final ffi.Pointer _sel_poseAsClass_1 = + _registerName1("poseAsClass:"); + late final ffi.Pointer _sel_autoContentAccessingProxy1 = + _registerName1("autoContentAccessingProxy"); + late final ffi.Pointer _class_Foo1 = _getClass1("Foo"); + late final ffi.Pointer _sel_someProperty1 = + _registerName1("someProperty"); + int _objc_msgSend_18( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_18( + obj, + sel, + ); + } + + late final __objc_msgSend_18Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_setSomeProperty_1 = _registerName1("setSomeProperty:"); - void _objc_msgSend_16( + void _objc_msgSend_19( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_16( + return __objc_msgSend_19( obj, sel, value, ); } - late final __objc_msgSend_16Ptr = _lookup< + late final __objc_msgSend_19Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_readOnlyProperty1 = @@ -468,35 +537,35 @@ class NativeLibrary { _registerName1("setClassReadWriteProperty:"); late final ffi.Pointer _sel_aClassMethod_1 = _registerName1("aClassMethod:"); - ffi.Pointer _objc_msgSend_17( + ffi.Pointer _objc_msgSend_20( ffi.Pointer obj, ffi.Pointer sel, double someArg, ) { - return __objc_msgSend_17( + return __objc_msgSend_20( obj, sel, someArg, ); } - late final __objc_msgSend_17Ptr = _lookup< + late final __objc_msgSend_20Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, double)>(); late final ffi.Pointer _sel_anInstanceMethod_withOtherArg_1 = _registerName1("anInstanceMethod:withOtherArg:"); - int _objc_msgSend_18( + int _objc_msgSend_21( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer someArg, ffi.Pointer otherArg, ) { - return __objc_msgSend_18( + return __objc_msgSend_21( obj, sel, someArg, @@ -504,14 +573,14 @@ class NativeLibrary { ); } - late final __objc_msgSend_18Ptr = _lookup< + late final __objc_msgSend_21Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< + late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); } @@ -531,70 +600,6 @@ class _ObjCWrapper { int get hashCode => _id.hashCode; } -class Foo extends NSObject { - Foo._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); - - static Foo castFrom(T other) { - return Foo._(other._id, other._lib); - } - - static Foo castFromPointer(NativeLibrary lib, ffi.Pointer other) { - return Foo._(other, lib); - } - - int get someProperty { - return _lib._objc_msgSend_15(_id, _lib._sel_someProperty1); - } - - set someProperty(int value) { - _lib._objc_msgSend_16(_id, _lib._sel_setSomeProperty_1, value); - } - - int get readOnlyProperty { - return _lib._objc_msgSend_15(_id, _lib._sel_readOnlyProperty1); - } - - static int getClassReadOnlyProperty(NativeLibrary _lib) { - return _lib._objc_msgSend_15( - _lib._class_Foo1, _lib._sel_classReadOnlyProperty1); - } - - static int getClassReadWriteProperty(NativeLibrary _lib) { - return _lib._objc_msgSend_15( - _lib._class_Foo1, _lib._sel_classReadWriteProperty1); - } - - static void setClassReadWriteProperty(NativeLibrary _lib, int value) { - _lib._objc_msgSend_16( - _lib._class_Foo1, _lib._sel_setClassReadWriteProperty_1, value); - } - - static Foo aClassMethod(NativeLibrary _lib, double someArg) { - final _ret = _lib._objc_msgSend_17( - _lib._class_Foo1, _lib._sel_aClassMethod_1, someArg); - return Foo._(_ret, _lib); - } - - int anInstanceMethod_withOtherArg(NSObject? someArg, NSObject? otherArg) { - return _lib._objc_msgSend_18(_id, _lib._sel_anInstanceMethod_withOtherArg_1, - someArg?._id ?? ffi.nullptr, otherArg?._id ?? ffi.nullptr); - } - - static Foo new1(NativeLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_new1); - return Foo._(_ret, _lib); - } - - static Foo alloc(NativeLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_alloc1); - return Foo._(_ret, _lib); - } -} - -class ObjCSel extends ffi.Opaque {} - -class ObjCObject extends ffi.Opaque {} - class NSObject extends _ObjCWrapper { NSObject._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); @@ -766,8 +771,49 @@ class NSObject extends _ObjCWrapper { _lib._class_NSObject1, _lib._sel_debugDescription1); return NSString._(_ret, _lib); } + + static int version(NativeLibrary _lib) { + return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); + } + + static void setVersion(NativeLibrary _lib, int aVersion) { + _lib._objc_msgSend_16( + _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); + } + + NSObject get classForCoder { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); + return NSObject._(_ret, _lib); + } + + NSObject replacementObjectForCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + NSObject awakeAfterUsingCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + static void poseAsClass(NativeLibrary _lib, NSObject aClass) { + _lib._objc_msgSend_8( + _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); + } + + NSObject get autoContentAccessingProxy { + final _ret = + _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); + return NSObject._(_ret, _lib); + } } +class ObjCSel extends ffi.Opaque {} + +class ObjCObject extends ffi.Opaque {} + typedef instancetype = ffi.Pointer; class _NSZone extends ffi.Opaque {} @@ -810,7 +856,7 @@ class NSString extends _ObjCWrapper { } @override - String toString() => UTF8String().cast().toDartString(); + String toString() => (UTF8String).cast().toDartString(); static NSString stringWithCString_encoding( NativeLibrary _lib, ffi.Pointer cString, int enc) { @@ -819,7 +865,7 @@ class NSString extends _ObjCWrapper { return NSString._(_ret, _lib); } - ffi.Pointer UTF8String() { + ffi.Pointer get UTF8String { return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); } } @@ -827,3 +873,65 @@ class NSString extends _ObjCWrapper { extension StringToNSString on String { NSString toNSString(NativeLibrary lib) => NSString(lib, this); } + +typedef NSInteger = pkg_ffi.Long; + +class Foo extends NSObject { + Foo._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); + + static Foo castFrom(T other) { + return Foo._(other._id, other._lib); + } + + static Foo castFromPointer(NativeLibrary lib, ffi.Pointer other) { + return Foo._(other, lib); + } + + int get someProperty { + return _lib._objc_msgSend_18(_id, _lib._sel_someProperty1); + } + + set someProperty(int value) { + _lib._objc_msgSend_19(_id, _lib._sel_setSomeProperty_1, value); + } + + int get readOnlyProperty { + return _lib._objc_msgSend_18(_id, _lib._sel_readOnlyProperty1); + } + + static int getClassReadOnlyProperty(NativeLibrary _lib) { + return _lib._objc_msgSend_18( + _lib._class_Foo1, _lib._sel_classReadOnlyProperty1); + } + + static int getClassReadWriteProperty(NativeLibrary _lib) { + return _lib._objc_msgSend_18( + _lib._class_Foo1, _lib._sel_classReadWriteProperty1); + } + + static void setClassReadWriteProperty(NativeLibrary _lib, int value) { + _lib._objc_msgSend_19( + _lib._class_Foo1, _lib._sel_setClassReadWriteProperty_1, value); + } + + static Foo aClassMethod(NativeLibrary _lib, double someArg) { + final _ret = _lib._objc_msgSend_20( + _lib._class_Foo1, _lib._sel_aClassMethod_1, someArg); + return Foo._(_ret, _lib); + } + + int anInstanceMethod_withOtherArg(NSObject? someArg, NSObject? otherArg) { + return _lib._objc_msgSend_21(_id, _lib._sel_anInstanceMethod_withOtherArg_1, + someArg?._id ?? ffi.nullptr, otherArg?._id ?? ffi.nullptr); + } + + static Foo new1(NativeLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_new1); + return Foo._(_ret, _lib); + } + + static Foo alloc(NativeLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_alloc1); + return Foo._(_ret, _lib); + } +} diff --git a/pkgs/ffigen/test/native_objc_test/cast_bindings.dart b/pkgs/ffigen/test/native_objc_test/cast_bindings.dart index d167a6c11d..bbee960754 100644 --- a/pkgs/ffigen/test/native_objc_test/cast_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/cast_bindings.dart @@ -151,7 +151,6 @@ class CastTestObjCLibrary { late final __objc_getClass = __objc_getClassPtr.asFunction< ffi.Pointer Function(ffi.Pointer)>(); - late final ffi.Pointer _class_Castaway1 = _getClass1("Castaway"); late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); late final ffi.Pointer _sel_load1 = _registerName1("load"); void _objc_msgSend_0( @@ -505,9 +504,8 @@ class CastTestObjCLibrary { late final ffi.Pointer _sel_debugDescription1 = _registerName1("debugDescription"); - late final ffi.Pointer _sel_meAsNSObject1 = - _registerName1("meAsNSObject"); - ffi.Pointer _objc_msgSend_15( + late final ffi.Pointer _sel_version1 = _registerName1("version"); + int _objc_msgSend_15( ffi.Pointer obj, ffi.Pointer sel, ) { @@ -519,28 +517,99 @@ class CastTestObjCLibrary { late final __objc_msgSend_15Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + NSInteger Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_setVersion_1 = + _registerName1("setVersion:"); + void _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + int aVersion, + ) { + return __objc_msgSend_16( + obj, + sel, + aVersion, + ); + } + + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_classForCoder1 = + _registerName1("classForCoder"); + late final ffi.Pointer _sel_replacementObjectForCoder_1 = + _registerName1("replacementObjectForCoder:"); + ffi.Pointer _objc_msgSend_17( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_17( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_17Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = + _registerName1("awakeAfterUsingCoder:"); + late final ffi.Pointer _sel_poseAsClass_1 = + _registerName1("poseAsClass:"); + late final ffi.Pointer _sel_autoContentAccessingProxy1 = + _registerName1("autoContentAccessingProxy"); + late final ffi.Pointer _class_Castaway1 = _getClass1("Castaway"); + late final ffi.Pointer _sel_meAsNSObject1 = + _registerName1("meAsNSObject"); + ffi.Pointer _objc_msgSend_18( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_18( + obj, + sel, + ); + } + + late final __objc_msgSend_18Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_meAsInt1 = _registerName1("meAsInt"); - int _objc_msgSend_16( + int _objc_msgSend_19( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_16( + return __objc_msgSend_19( obj, sel, ); } - late final __objc_msgSend_16Ptr = _lookup< + late final __objc_msgSend_19Ptr = _lookup< ffi.NativeFunction< ffi.Int64 Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); } @@ -655,43 +724,6 @@ class _ObjCWrapper { int get hashCode => _id.hashCode; } -class Castaway extends NSObject { - Castaway._(ffi.Pointer id, CastTestObjCLibrary lib) - : super._(id, lib); - - static Castaway castFrom(T other) { - return Castaway._(other._id, other._lib); - } - - static Castaway castFromPointer( - CastTestObjCLibrary lib, ffi.Pointer other) { - return Castaway._(other, lib); - } - - NSObject meAsNSObject() { - final _ret = _lib._objc_msgSend_15(_id, _lib._sel_meAsNSObject1); - return NSObject._(_ret, _lib); - } - - int meAsInt() { - return _lib._objc_msgSend_16(_id, _lib._sel_meAsInt1); - } - - static Castaway new1(CastTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_Castaway1, _lib._sel_new1); - return Castaway._(_ret, _lib); - } - - static Castaway alloc(CastTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_Castaway1, _lib._sel_alloc1); - return Castaway._(_ret, _lib); - } -} - -class ObjCSel extends ffi.Opaque {} - -class ObjCObject extends ffi.Opaque {} - class NSObject extends _ObjCWrapper { NSObject._(ffi.Pointer id, CastTestObjCLibrary lib) : super._(id, lib); @@ -867,8 +899,49 @@ class NSObject extends _ObjCWrapper { _lib._class_NSObject1, _lib._sel_debugDescription1); return NSString._(_ret, _lib); } + + static int version(CastTestObjCLibrary _lib) { + return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); + } + + static void setVersion(CastTestObjCLibrary _lib, int aVersion) { + _lib._objc_msgSend_16( + _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); + } + + NSObject get classForCoder { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); + return NSObject._(_ret, _lib); + } + + NSObject replacementObjectForCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + NSObject awakeAfterUsingCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + static void poseAsClass(CastTestObjCLibrary _lib, NSObject aClass) { + _lib._objc_msgSend_8( + _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); + } + + NSObject get autoContentAccessingProxy { + final _ret = + _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); + return NSObject._(_ret, _lib); + } } +class ObjCSel extends ffi.Opaque {} + +class ObjCObject extends ffi.Opaque {} + typedef instancetype = ffi.Pointer; class _NSZone extends ffi.Opaque {} @@ -912,7 +985,7 @@ class NSString extends _ObjCWrapper { } @override - String toString() => UTF8String().cast().toDartString(); + String toString() => (UTF8String).cast().toDartString(); static NSString stringWithCString_encoding( CastTestObjCLibrary _lib, ffi.Pointer cString, int enc) { @@ -921,7 +994,7 @@ class NSString extends _ObjCWrapper { return NSString._(_ret, _lib); } - ffi.Pointer UTF8String() { + ffi.Pointer get UTF8String { return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); } } @@ -930,6 +1003,39 @@ extension StringToNSString on String { NSString toNSString(CastTestObjCLibrary lib) => NSString(lib, this); } +class Castaway extends NSObject { + Castaway._(ffi.Pointer id, CastTestObjCLibrary lib) + : super._(id, lib); + + static Castaway castFrom(T other) { + return Castaway._(other._id, other._lib); + } + + static Castaway castFromPointer( + CastTestObjCLibrary lib, ffi.Pointer other) { + return Castaway._(other, lib); + } + + NSObject meAsNSObject() { + final _ret = _lib._objc_msgSend_18(_id, _lib._sel_meAsNSObject1); + return NSObject._(_ret, _lib); + } + + int meAsInt() { + return _lib._objc_msgSend_19(_id, _lib._sel_meAsInt1); + } + + static Castaway new1(CastTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_Castaway1, _lib._sel_new1); + return Castaway._(_ret, _lib); + } + + static Castaway alloc(CastTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_Castaway1, _lib._sel_alloc1); + return Castaway._(_ret, _lib); + } +} + const int NSScannedOption = 1; const int NSCollectorDisabledOption = 2; diff --git a/pkgs/ffigen/test/native_objc_test/category_bindings.dart b/pkgs/ffigen/test/native_objc_test/category_bindings.dart new file mode 100644 index 0000000000..c878d11ce9 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/category_bindings.dart @@ -0,0 +1,1377 @@ +// ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; + +/// Tests handling Objective-C categories +class CategoryTestObjCLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + CategoryTestObjCLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + CategoryTestObjCLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + late final ffi.Pointer _NSFoundationVersionNumber = + _lookup('NSFoundationVersionNumber'); + + double get NSFoundationVersionNumber => _NSFoundationVersionNumber.value; + + set NSFoundationVersionNumber(double value) => + _NSFoundationVersionNumber.value = value; + + late final ffi.Pointer _NSNotFound = + _lookup('NSNotFound'); + + int get NSNotFound => _NSNotFound.value; + + set NSNotFound(int value) => _NSNotFound.value = value; + + late final ffi.Pointer _kCFCoreFoundationVersionNumber = + _lookup('kCFCoreFoundationVersionNumber'); + + double get kCFCoreFoundationVersionNumber => + _kCFCoreFoundationVersionNumber.value; + + set kCFCoreFoundationVersionNumber(double value) => + _kCFCoreFoundationVersionNumber.value = value; + + late final ffi.Pointer _kCFNotFound = + _lookup('kCFNotFound'); + + int get kCFNotFound => _kCFNotFound.value; + + set kCFNotFound(int value) => _kCFNotFound.value = value; + + late final ffi.Pointer _kCFNull = _lookup('kCFNull'); + + CFNullRef get kCFNull => _kCFNull.value; + + set kCFNull(CFNullRef value) => _kCFNull.value = value; + + late final ffi.Pointer _kCFAllocatorDefault = + _lookup('kCFAllocatorDefault'); + + CFAllocatorRef get kCFAllocatorDefault => _kCFAllocatorDefault.value; + + set kCFAllocatorDefault(CFAllocatorRef value) => + _kCFAllocatorDefault.value = value; + + late final ffi.Pointer _kCFAllocatorSystemDefault = + _lookup('kCFAllocatorSystemDefault'); + + CFAllocatorRef get kCFAllocatorSystemDefault => + _kCFAllocatorSystemDefault.value; + + set kCFAllocatorSystemDefault(CFAllocatorRef value) => + _kCFAllocatorSystemDefault.value = value; + + late final ffi.Pointer _kCFAllocatorMalloc = + _lookup('kCFAllocatorMalloc'); + + CFAllocatorRef get kCFAllocatorMalloc => _kCFAllocatorMalloc.value; + + set kCFAllocatorMalloc(CFAllocatorRef value) => + _kCFAllocatorMalloc.value = value; + + late final ffi.Pointer _kCFAllocatorMallocZone = + _lookup('kCFAllocatorMallocZone'); + + CFAllocatorRef get kCFAllocatorMallocZone => _kCFAllocatorMallocZone.value; + + set kCFAllocatorMallocZone(CFAllocatorRef value) => + _kCFAllocatorMallocZone.value = value; + + late final ffi.Pointer _kCFAllocatorNull = + _lookup('kCFAllocatorNull'); + + CFAllocatorRef get kCFAllocatorNull => _kCFAllocatorNull.value; + + set kCFAllocatorNull(CFAllocatorRef value) => _kCFAllocatorNull.value = value; + + late final ffi.Pointer _kCFAllocatorUseContext = + _lookup('kCFAllocatorUseContext'); + + CFAllocatorRef get kCFAllocatorUseContext => _kCFAllocatorUseContext.value; + + set kCFAllocatorUseContext(CFAllocatorRef value) => + _kCFAllocatorUseContext.value = value; + + ffi.Pointer _registerName1(String name) { + final cstr = name.toNativeUtf8(); + final sel = _sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; + } + + ffi.Pointer _sel_registerName( + ffi.Pointer str, + ) { + return __sel_registerName( + str, + ); + } + + late final __sel_registerNamePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sel_registerName'); + late final __sel_registerName = __sel_registerNamePtr + .asFunction Function(ffi.Pointer)>(); + + ffi.Pointer _getClass1(String name) { + final cstr = name.toNativeUtf8(); + final clazz = _objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; + } + + ffi.Pointer _objc_getClass( + ffi.Pointer str, + ) { + return __objc_getClass( + str, + ); + } + + late final __objc_getClassPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('objc_getClass'); + late final __objc_getClass = __objc_getClassPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); + + late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); + late final ffi.Pointer _sel_load1 = _registerName1("load"); + void _objc_msgSend_0( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_0( + obj, + sel, + ); + } + + late final __objc_msgSend_0Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_initialize1 = + _registerName1("initialize"); + late final ffi.Pointer _sel_init1 = _registerName1("init"); + instancetype _objc_msgSend_1( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1( + obj, + sel, + ); + } + + late final __objc_msgSend_1Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_new1 = _registerName1("new"); + late final ffi.Pointer _sel_allocWithZone_1 = + _registerName1("allocWithZone:"); + instancetype _objc_msgSend_2( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_2( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_2Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>(); + + late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); + late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); + late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); + late final ffi.Pointer _sel_copy1 = _registerName1("copy"); + late final ffi.Pointer _sel_mutableCopy1 = + _registerName1("mutableCopy"); + late final ffi.Pointer _sel_copyWithZone_1 = + _registerName1("copyWithZone:"); + late final ffi.Pointer _sel_mutableCopyWithZone_1 = + _registerName1("mutableCopyWithZone:"); + late final ffi.Pointer _sel_instancesRespondToSelector_1 = + _registerName1("instancesRespondToSelector:"); + bool _objc_msgSend_3( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_3( + obj, + sel, + aSelector, + ) != + 0; + } + + late final __objc_msgSend_3Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_conformsToProtocol_1 = + _registerName1("conformsToProtocol:"); + bool _objc_msgSend_4( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer protocol, + ) { + return __objc_msgSend_4( + obj, + sel, + protocol, + ) != + 0; + } + + late final __objc_msgSend_4Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_methodForSelector_1 = + _registerName1("methodForSelector:"); + IMP _objc_msgSend_5( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_5( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_5Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_instanceMethodForSelector_1 = + _registerName1("instanceMethodForSelector:"); + late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = + _registerName1("doesNotRecognizeSelector:"); + void _objc_msgSend_6( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_6( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_6Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_forwardingTargetForSelector_1 = + _registerName1("forwardingTargetForSelector:"); + ffi.Pointer _objc_msgSend_7( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_7( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_7Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_forwardInvocation_1 = + _registerName1("forwardInvocation:"); + void _objc_msgSend_8( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anInvocation, + ) { + return __objc_msgSend_8( + obj, + sel, + anInvocation, + ); + } + + late final __objc_msgSend_8Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _class_NSMethodSignature1 = + _getClass1("NSMethodSignature"); + late final ffi.Pointer _sel_methodSignatureForSelector_1 = + _registerName1("methodSignatureForSelector:"); + ffi.Pointer _objc_msgSend_9( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_9( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_9Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = + _registerName1("instanceMethodSignatureForSelector:"); + late final ffi.Pointer _sel_allowsWeakReference1 = + _registerName1("allowsWeakReference"); + bool _objc_msgSend_10( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_10( + obj, + sel, + ) != + 0; + } + + late final __objc_msgSend_10Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_retainWeakReference1 = + _registerName1("retainWeakReference"); + late final ffi.Pointer _sel_isSubclassOfClass_1 = + _registerName1("isSubclassOfClass:"); + late final ffi.Pointer _sel_resolveClassMethod_1 = + _registerName1("resolveClassMethod:"); + late final ffi.Pointer _sel_resolveInstanceMethod_1 = + _registerName1("resolveInstanceMethod:"); + late final ffi.Pointer _sel_hash1 = _registerName1("hash"); + int _objc_msgSend_11( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_11( + obj, + sel, + ); + } + + late final __objc_msgSend_11Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_superclass1 = + _registerName1("superclass"); + late final ffi.Pointer _sel_class1 = _registerName1("class"); + late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); + late final ffi.Pointer _sel_stringWithCString_encoding_1 = + _registerName1("stringWithCString:encoding:"); + ffi.Pointer _objc_msgSend_12( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cString, + int enc, + ) { + return __objc_msgSend_12( + obj, + sel, + cString, + enc, + ); + } + + late final __objc_msgSend_12Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + pkg_ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_UTF8String1 = + _registerName1("UTF8String"); + ffi.Pointer _objc_msgSend_13( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_13( + obj, + sel, + ); + } + + late final __objc_msgSend_13Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_description1 = + _registerName1("description"); + ffi.Pointer _objc_msgSend_14( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_14( + obj, + sel, + ); + } + + late final __objc_msgSend_14Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_debugDescription1 = + _registerName1("debugDescription"); + late final ffi.Pointer _sel_version1 = _registerName1("version"); + int _objc_msgSend_15( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_15( + obj, + sel, + ); + } + + late final __objc_msgSend_15Ptr = _lookup< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_setVersion_1 = + _registerName1("setVersion:"); + void _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + int aVersion, + ) { + return __objc_msgSend_16( + obj, + sel, + aVersion, + ); + } + + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_classForCoder1 = + _registerName1("classForCoder"); + late final ffi.Pointer _sel_replacementObjectForCoder_1 = + _registerName1("replacementObjectForCoder:"); + ffi.Pointer _objc_msgSend_17( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_17( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_17Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = + _registerName1("awakeAfterUsingCoder:"); + late final ffi.Pointer _sel_poseAsClass_1 = + _registerName1("poseAsClass:"); + late final ffi.Pointer _sel_autoContentAccessingProxy1 = + _registerName1("autoContentAccessingProxy"); + late final ffi.Pointer _class_Thing1 = _getClass1("Thing"); + late final ffi.Pointer _sel_add_Y_1 = _registerName1("add:Y:"); + int _objc_msgSend_18( + ffi.Pointer obj, + ffi.Pointer sel, + int x, + int y, + ) { + return __objc_msgSend_18( + obj, + sel, + x, + y, + ); + } + + late final __objc_msgSend_18Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, int)>(); + + late final ffi.Pointer _sel_sub_Y_1 = _registerName1("sub:Y:"); +} + +abstract class NSComparisonResult { + static const int NSOrderedAscending = -1; + static const int NSOrderedSame = 0; + static const int NSOrderedDescending = 1; +} + +abstract class NSEnumerationOptions { + static const int NSEnumerationConcurrent = 1; + static const int NSEnumerationReverse = 2; +} + +abstract class NSSortOptions { + static const int NSSortConcurrent = 1; + static const int NSSortStable = 16; +} + +abstract class NSQualityOfService { + static const int NSQualityOfServiceUserInteractive = 33; + static const int NSQualityOfServiceUserInitiated = 25; + static const int NSQualityOfServiceUtility = 17; + static const int NSQualityOfServiceBackground = 9; + static const int NSQualityOfServiceDefault = -1; +} + +typedef NSInteger = pkg_ffi.Long; + +class __CFString extends ffi.Opaque {} + +abstract class CFComparisonResult { + static const int kCFCompareLessThan = -1; + static const int kCFCompareEqualTo = 0; + static const int kCFCompareGreaterThan = 1; +} + +typedef CFIndex = pkg_ffi.Long; + +class CFRange extends ffi.Struct { + @CFIndex() + external int location; + + @CFIndex() + external int length; +} + +class __CFNull extends ffi.Opaque {} + +typedef CFNullRef = ffi.Pointer<__CFNull>; + +class __CFAllocator extends ffi.Opaque {} + +typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; + +class CFAllocatorContext extends ffi.Struct { + @CFIndex() + external int version; + + external ffi.Pointer info; + + external CFAllocatorRetainCallBack retain; + + external CFAllocatorReleaseCallBack release; + + external CFAllocatorCopyDescriptionCallBack copyDescription; + + external CFAllocatorAllocateCallBack allocate; + + external CFAllocatorReallocateCallBack reallocate; + + external CFAllocatorDeallocateCallBack deallocate; + + external CFAllocatorPreferredSizeCallBack preferredSize; +} + +typedef CFAllocatorRetainCallBack = ffi.Pointer< + ffi.NativeFunction Function(ffi.Pointer)>>; +typedef CFAllocatorReleaseCallBack + = ffi.Pointer)>>; +typedef CFAllocatorCopyDescriptionCallBack = ffi + .Pointer)>>; +typedef CFStringRef = ffi.Pointer<__CFString>; +typedef CFAllocatorAllocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + CFIndex, CFOptionFlags, ffi.Pointer)>>; +typedef CFOptionFlags = pkg_ffi.UnsignedLong; +typedef CFAllocatorReallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, CFIndex, + CFOptionFlags, ffi.Pointer)>>; +typedef CFAllocatorDeallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; +typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< + ffi.NativeFunction< + CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; + +class _ObjCWrapper { + final ffi.Pointer _id; + final CategoryTestObjCLibrary _lib; + + _ObjCWrapper._(this._id, this._lib); + + @override + bool operator ==(Object other) { + return other is _ObjCWrapper && _id == other._id; + } + + @override + int get hashCode => _id.hashCode; +} + +class NSObject extends _ObjCWrapper { + NSObject._(ffi.Pointer id, CategoryTestObjCLibrary lib) + : super._(id, lib); + + static NSObject castFrom(T other) { + return NSObject._(other._id, other._lib); + } + + static NSObject castFromPointer( + CategoryTestObjCLibrary lib, ffi.Pointer other) { + return NSObject._(other, lib); + } + + static void load(CategoryTestObjCLibrary _lib) { + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); + } + + static void initialize(CategoryTestObjCLibrary _lib) { + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); + } + + NSObject init() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); + return NSObject._(_ret, _lib); + } + + static NSObject new1(CategoryTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); + return NSObject._(_ret, _lib); + } + + static NSObject allocWithZone( + CategoryTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static NSObject alloc(CategoryTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); + return NSObject._(_ret, _lib); + } + + void dealloc() { + _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); + } + + void finalize() { + _lib._objc_msgSend_0(_id, _lib._sel_finalize1); + } + + NSObject copy() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); + return NSObject._(_ret, _lib); + } + + NSObject mutableCopy() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); + return NSObject._(_ret, _lib); + } + + static NSObject copyWithZone( + CategoryTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static NSObject mutableCopyWithZone( + CategoryTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static bool instancesRespondToSelector( + CategoryTestObjCLibrary _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_3(_lib._class_NSObject1, + _lib._sel_instancesRespondToSelector_1, aSelector); + } + + static bool conformsToProtocol( + CategoryTestObjCLibrary _lib, NSObject? protocol) { + return _lib._objc_msgSend_4(_lib._class_NSObject1, + _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); + } + + IMP methodForSelector(ffi.Pointer aSelector) { + return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); + } + + static IMP instanceMethodForSelector( + CategoryTestObjCLibrary _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_5(_lib._class_NSObject1, + _lib._sel_instanceMethodForSelector_1, aSelector); + } + + void doesNotRecognizeSelector(ffi.Pointer aSelector) { + _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); + } + + NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_7( + _id, _lib._sel_forwardingTargetForSelector_1, aSelector); + return NSObject._(_ret, _lib); + } + + void forwardInvocation(NSObject? anInvocation) { + _lib._objc_msgSend_8( + _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); + } + + NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_9( + _id, _lib._sel_methodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static NSMethodSignature instanceMethodSignatureForSelector( + CategoryTestObjCLibrary _lib, ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, + _lib._sel_instanceMethodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + bool allowsWeakReference() { + return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); + } + + bool retainWeakReference() { + return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); + } + + static bool isSubclassOfClass(CategoryTestObjCLibrary _lib, NSObject aClass) { + return _lib._objc_msgSend_4( + _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); + } + + static bool resolveClassMethod( + CategoryTestObjCLibrary _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); + } + + static bool resolveInstanceMethod( + CategoryTestObjCLibrary _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); + } + + static int hash(CategoryTestObjCLibrary _lib) { + return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); + } + + static NSObject superclass(CategoryTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); + return NSObject._(_ret, _lib); + } + + static NSObject class1(CategoryTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); + return NSObject._(_ret, _lib); + } + + static NSString description(CategoryTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_14(_lib._class_NSObject1, _lib._sel_description1); + return NSString._(_ret, _lib); + } + + static NSString debugDescription(CategoryTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_14( + _lib._class_NSObject1, _lib._sel_debugDescription1); + return NSString._(_ret, _lib); + } + + static int version(CategoryTestObjCLibrary _lib) { + return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); + } + + static void setVersion(CategoryTestObjCLibrary _lib, int aVersion) { + _lib._objc_msgSend_16( + _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); + } + + NSObject get classForCoder { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); + return NSObject._(_ret, _lib); + } + + NSObject replacementObjectForCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + NSObject awakeAfterUsingCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + static void poseAsClass(CategoryTestObjCLibrary _lib, NSObject aClass) { + _lib._objc_msgSend_8( + _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); + } + + NSObject get autoContentAccessingProxy { + final _ret = + _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); + return NSObject._(_ret, _lib); + } +} + +class ObjCSel extends ffi.Opaque {} + +class ObjCObject extends ffi.Opaque {} + +typedef instancetype = ffi.Pointer; + +class _NSZone extends ffi.Opaque {} + +typedef IMP = ffi.Pointer>; + +class NSMethodSignature extends _ObjCWrapper { + NSMethodSignature._(ffi.Pointer id, CategoryTestObjCLibrary lib) + : super._(id, lib); + + static NSMethodSignature castFrom(T other) { + return NSMethodSignature._(other._id, other._lib); + } + + static NSMethodSignature castFromPointer( + CategoryTestObjCLibrary lib, ffi.Pointer other) { + return NSMethodSignature._(other, lib); + } +} + +typedef NSUInteger = pkg_ffi.UnsignedLong; + +class NSString extends _ObjCWrapper { + NSString._(ffi.Pointer id, CategoryTestObjCLibrary lib) + : super._(id, lib); + + static NSString castFrom(T other) { + return NSString._(other._id, other._lib); + } + + static NSString castFromPointer( + CategoryTestObjCLibrary lib, ffi.Pointer other) { + return NSString._(other, lib); + } + + factory NSString(CategoryTestObjCLibrary _lib, String str) { + final cstr = str.toNativeUtf8(); + final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + pkg_ffi.calloc.free(cstr); + return nsstr; + } + + @override + String toString() => (UTF8String).cast().toDartString(); + + static NSString stringWithCString_encoding(CategoryTestObjCLibrary _lib, + ffi.Pointer cString, int enc) { + final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); + return NSString._(_ret, _lib); + } + + ffi.Pointer get UTF8String { + return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); + } +} + +extension StringToNSString on String { + NSString toNSString(CategoryTestObjCLibrary lib) => NSString(lib, this); +} + +class Thing extends NSObject { + Thing._(ffi.Pointer id, CategoryTestObjCLibrary lib) + : super._(id, lib); + + static Thing castFrom(T other) { + return Thing._(other._id, other._lib); + } + + static Thing castFromPointer( + CategoryTestObjCLibrary lib, ffi.Pointer other) { + return Thing._(other, lib); + } + + int add_Y(int x, int y) { + return _lib._objc_msgSend_18(_id, _lib._sel_add_Y_1, x, y); + } + + int sub_Y(int x, int y) { + return _lib._objc_msgSend_18(_id, _lib._sel_sub_Y_1, x, y); + } + + static Thing new1(CategoryTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_Thing1, _lib._sel_new1); + return Thing._(_ret, _lib); + } + + static Thing alloc(CategoryTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_Thing1, _lib._sel_alloc1); + return Thing._(_ret, _lib); + } +} + +const int NSScannedOption = 1; + +const int NSCollectorDisabledOption = 2; + +const int NS_BLOCKS_AVAILABLE = 1; + +const int __COREFOUNDATION_CFAVAILABILITY__ = 1; + +const int __CF_ENUM_FIXED_IS_AVAILABLE = 1; + +const double NSFoundationVersionNumber10_0 = 397.4; + +const double NSFoundationVersionNumber10_1 = 425.0; + +const double NSFoundationVersionNumber10_1_1 = 425.0; + +const double NSFoundationVersionNumber10_1_2 = 425.0; + +const double NSFoundationVersionNumber10_1_3 = 425.0; + +const double NSFoundationVersionNumber10_1_4 = 425.0; + +const double NSFoundationVersionNumber10_2 = 462.0; + +const double NSFoundationVersionNumber10_2_1 = 462.0; + +const double NSFoundationVersionNumber10_2_2 = 462.0; + +const double NSFoundationVersionNumber10_2_3 = 462.0; + +const double NSFoundationVersionNumber10_2_4 = 462.0; + +const double NSFoundationVersionNumber10_2_5 = 462.0; + +const double NSFoundationVersionNumber10_2_6 = 462.0; + +const double NSFoundationVersionNumber10_2_7 = 462.7; + +const double NSFoundationVersionNumber10_2_8 = 462.7; + +const double NSFoundationVersionNumber10_3 = 500.0; + +const double NSFoundationVersionNumber10_3_1 = 500.0; + +const double NSFoundationVersionNumber10_3_2 = 500.3; + +const double NSFoundationVersionNumber10_3_3 = 500.54; + +const double NSFoundationVersionNumber10_3_4 = 500.56; + +const double NSFoundationVersionNumber10_3_5 = 500.56; + +const double NSFoundationVersionNumber10_3_6 = 500.56; + +const double NSFoundationVersionNumber10_3_7 = 500.56; + +const double NSFoundationVersionNumber10_3_8 = 500.56; + +const double NSFoundationVersionNumber10_3_9 = 500.58; + +const double NSFoundationVersionNumber10_4 = 567.0; + +const double NSFoundationVersionNumber10_4_1 = 567.0; + +const double NSFoundationVersionNumber10_4_2 = 567.12; + +const double NSFoundationVersionNumber10_4_3 = 567.21; + +const double NSFoundationVersionNumber10_4_4_Intel = 567.23; + +const double NSFoundationVersionNumber10_4_4_PowerPC = 567.21; + +const double NSFoundationVersionNumber10_4_5 = 567.25; + +const double NSFoundationVersionNumber10_4_6 = 567.26; + +const double NSFoundationVersionNumber10_4_7 = 567.27; + +const double NSFoundationVersionNumber10_4_8 = 567.28; + +const double NSFoundationVersionNumber10_4_9 = 567.29; + +const double NSFoundationVersionNumber10_4_10 = 567.29; + +const double NSFoundationVersionNumber10_4_11 = 567.36; + +const double NSFoundationVersionNumber10_5 = 677.0; + +const double NSFoundationVersionNumber10_5_1 = 677.1; + +const double NSFoundationVersionNumber10_5_2 = 677.15; + +const double NSFoundationVersionNumber10_5_3 = 677.19; + +const double NSFoundationVersionNumber10_5_4 = 677.19; + +const double NSFoundationVersionNumber10_5_5 = 677.21; + +const double NSFoundationVersionNumber10_5_6 = 677.22; + +const double NSFoundationVersionNumber10_5_7 = 677.24; + +const double NSFoundationVersionNumber10_5_8 = 677.26; + +const double NSFoundationVersionNumber10_6 = 751.0; + +const double NSFoundationVersionNumber10_6_1 = 751.0; + +const double NSFoundationVersionNumber10_6_2 = 751.14; + +const double NSFoundationVersionNumber10_6_3 = 751.21; + +const double NSFoundationVersionNumber10_6_4 = 751.29; + +const double NSFoundationVersionNumber10_6_5 = 751.42; + +const double NSFoundationVersionNumber10_6_6 = 751.53; + +const double NSFoundationVersionNumber10_6_7 = 751.53; + +const double NSFoundationVersionNumber10_6_8 = 751.62; + +const double NSFoundationVersionNumber10_7 = 833.1; + +const double NSFoundationVersionNumber10_7_1 = 833.1; + +const double NSFoundationVersionNumber10_7_2 = 833.2; + +const double NSFoundationVersionNumber10_7_3 = 833.24; + +const double NSFoundationVersionNumber10_7_4 = 833.25; + +const double NSFoundationVersionNumber10_8 = 945.0; + +const double NSFoundationVersionNumber10_8_1 = 945.0; + +const double NSFoundationVersionNumber10_8_2 = 945.11; + +const double NSFoundationVersionNumber10_8_3 = 945.16; + +const double NSFoundationVersionNumber10_8_4 = 945.18; + +const int NSFoundationVersionNumber10_9 = 1056; + +const int NSFoundationVersionNumber10_9_1 = 1056; + +const double NSFoundationVersionNumber10_9_2 = 1056.13; + +const double NSFoundationVersionNumber10_10 = 1151.16; + +const double NSFoundationVersionNumber10_10_1 = 1151.16; + +const double NSFoundationVersionNumber10_10_2 = 1152.14; + +const double NSFoundationVersionNumber10_10_3 = 1153.2; + +const double NSFoundationVersionNumber10_10_4 = 1153.2; + +const int NSFoundationVersionNumber10_10_5 = 1154; + +const int NSFoundationVersionNumber10_10_Max = 1199; + +const int NSFoundationVersionNumber10_11 = 1252; + +const double NSFoundationVersionNumber10_11_1 = 1255.1; + +const double NSFoundationVersionNumber10_11_2 = 1256.1; + +const double NSFoundationVersionNumber10_11_3 = 1256.1; + +const int NSFoundationVersionNumber10_11_4 = 1258; + +const int NSFoundationVersionNumber10_11_Max = 1299; + +const int __COREFOUNDATION_CFBASE__ = 1; + +const int TRUE = 1; + +const int FALSE = 0; + +const double kCFCoreFoundationVersionNumber10_0 = 196.4; + +const double kCFCoreFoundationVersionNumber10_0_3 = 196.5; + +const double kCFCoreFoundationVersionNumber10_1 = 226.0; + +const double kCFCoreFoundationVersionNumber10_1_1 = 226.0; + +const double kCFCoreFoundationVersionNumber10_1_2 = 227.2; + +const double kCFCoreFoundationVersionNumber10_1_3 = 227.2; + +const double kCFCoreFoundationVersionNumber10_1_4 = 227.3; + +const double kCFCoreFoundationVersionNumber10_2 = 263.0; + +const double kCFCoreFoundationVersionNumber10_2_1 = 263.1; + +const double kCFCoreFoundationVersionNumber10_2_2 = 263.1; + +const double kCFCoreFoundationVersionNumber10_2_3 = 263.3; + +const double kCFCoreFoundationVersionNumber10_2_4 = 263.3; + +const double kCFCoreFoundationVersionNumber10_2_5 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_6 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_7 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_8 = 263.5; + +const double kCFCoreFoundationVersionNumber10_3 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_1 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_2 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_3 = 299.3; + +const double kCFCoreFoundationVersionNumber10_3_4 = 299.31; + +const double kCFCoreFoundationVersionNumber10_3_5 = 299.31; + +const double kCFCoreFoundationVersionNumber10_3_6 = 299.32; + +const double kCFCoreFoundationVersionNumber10_3_7 = 299.33; + +const double kCFCoreFoundationVersionNumber10_3_8 = 299.33; + +const double kCFCoreFoundationVersionNumber10_3_9 = 299.35; + +const double kCFCoreFoundationVersionNumber10_4 = 368.0; + +const double kCFCoreFoundationVersionNumber10_4_1 = 368.1; + +const double kCFCoreFoundationVersionNumber10_4_2 = 368.11; + +const double kCFCoreFoundationVersionNumber10_4_3 = 368.18; + +const double kCFCoreFoundationVersionNumber10_4_4_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_4_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_5_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_5_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_6_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_6_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_7 = 368.27; + +const double kCFCoreFoundationVersionNumber10_4_8 = 368.27; + +const double kCFCoreFoundationVersionNumber10_4_9 = 368.28; + +const double kCFCoreFoundationVersionNumber10_4_10 = 368.28; + +const double kCFCoreFoundationVersionNumber10_4_11 = 368.31; + +const double kCFCoreFoundationVersionNumber10_5 = 476.0; + +const double kCFCoreFoundationVersionNumber10_5_1 = 476.0; + +const double kCFCoreFoundationVersionNumber10_5_2 = 476.1; + +const double kCFCoreFoundationVersionNumber10_5_3 = 476.13; + +const double kCFCoreFoundationVersionNumber10_5_4 = 476.14; + +const double kCFCoreFoundationVersionNumber10_5_5 = 476.15; + +const double kCFCoreFoundationVersionNumber10_5_6 = 476.17; + +const double kCFCoreFoundationVersionNumber10_5_7 = 476.18; + +const double kCFCoreFoundationVersionNumber10_5_8 = 476.19; + +const double kCFCoreFoundationVersionNumber10_6 = 550.0; + +const double kCFCoreFoundationVersionNumber10_6_1 = 550.0; + +const double kCFCoreFoundationVersionNumber10_6_2 = 550.13; + +const double kCFCoreFoundationVersionNumber10_6_3 = 550.19; + +const double kCFCoreFoundationVersionNumber10_6_4 = 550.29; + +const double kCFCoreFoundationVersionNumber10_6_5 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_6 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_7 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_8 = 550.43; + +const double kCFCoreFoundationVersionNumber10_7 = 635.0; + +const double kCFCoreFoundationVersionNumber10_7_1 = 635.0; + +const double kCFCoreFoundationVersionNumber10_7_2 = 635.15; + +const double kCFCoreFoundationVersionNumber10_7_3 = 635.19; + +const double kCFCoreFoundationVersionNumber10_7_4 = 635.21; + +const double kCFCoreFoundationVersionNumber10_7_5 = 635.21; + +const double kCFCoreFoundationVersionNumber10_8 = 744.0; + +const double kCFCoreFoundationVersionNumber10_8_1 = 744.0; + +const double kCFCoreFoundationVersionNumber10_8_2 = 744.12; + +const double kCFCoreFoundationVersionNumber10_8_3 = 744.18; + +const double kCFCoreFoundationVersionNumber10_8_4 = 744.19; + +const double kCFCoreFoundationVersionNumber10_9 = 855.11; + +const double kCFCoreFoundationVersionNumber10_9_1 = 855.11; + +const double kCFCoreFoundationVersionNumber10_9_2 = 855.14; + +const double kCFCoreFoundationVersionNumber10_10 = 1151.16; + +const double kCFCoreFoundationVersionNumber10_10_1 = 1151.16; + +const int kCFCoreFoundationVersionNumber10_10_2 = 1152; + +const double kCFCoreFoundationVersionNumber10_10_3 = 1153.18; + +const double kCFCoreFoundationVersionNumber10_10_4 = 1153.18; + +const double kCFCoreFoundationVersionNumber10_10_5 = 1153.18; + +const int kCFCoreFoundationVersionNumber10_10_Max = 1199; + +const int kCFCoreFoundationVersionNumber10_11 = 1253; + +const double kCFCoreFoundationVersionNumber10_11_1 = 1255.1; + +const double kCFCoreFoundationVersionNumber10_11_2 = 1256.14; + +const double kCFCoreFoundationVersionNumber10_11_3 = 1256.14; + +const double kCFCoreFoundationVersionNumber10_11_4 = 1258.1; + +const int kCFCoreFoundationVersionNumber10_11_Max = 1299; + +const int ISA_PTRAUTH_DISCRIMINATOR = 27361; diff --git a/pkgs/ffigen/test/native_objc_test/category_config.yaml b/pkgs/ffigen/test/native_objc_test/category_config.yaml new file mode 100644 index 0000000000..24c6c2eaea --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/category_config.yaml @@ -0,0 +1,12 @@ +name: CategoryTestObjCLibrary +description: 'Tests handling Objective-C categories' +language: objc +output: 'test/native_objc_test/category_bindings.dart' +functions: + exclude: + - '.*' +headers: + entry-points: + - 'test/native_objc_test/category_test.m' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/category_test.dart b/pkgs/ffigen/test/native_objc_test/category_test.dart new file mode 100644 index 0000000000..fdfad4a59e --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/category_test.dart @@ -0,0 +1,59 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:ffigen/ffigen.dart'; +import 'package:path/path.dart' as path; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart'; +import '../test_utils.dart'; +import 'category_bindings.dart'; + +void main() { + late Thing testInstance; + late CategoryTestObjCLibrary lib; + + group('categories', () { + setUpAll(() { + logWarnings(); + final dylib = File('test/native_objc_test/category_test.dylib'); + verifySetupFile(dylib); + lib = CategoryTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); + testInstance = Thing.new1(lib); + }); + + test('generate_bindings', () { + final config = Config.fromYaml(loadYaml( + File(path.join('test', 'native_objc_test', 'category_config.yaml')) + .readAsStringSync()) as YamlMap); + final library = parse(config); + final file = File( + path.join('test', 'debug_generated', 'category_test.dart'), + ); + library.generateFile(file); + + try { + final actual = file.readAsStringSync(); + final expected = File(path.join(config.output)).readAsStringSync(); + expect(actual, expected); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + print('Failed test: Debug generated file: ${file.absolute.path}'); + rethrow; + } + }); + + test('Category method', () { + expect(testInstance.add_Y(1000, 234), 1234); + expect(testInstance.sub_Y(1234, 1000), 234); + }); + }); +} diff --git a/pkgs/ffigen/test/native_objc_test/category_test.m b/pkgs/ffigen/test/native_objc_test/category_test.m new file mode 100644 index 0000000000..bfbf4aebaf --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/category_test.m @@ -0,0 +1,21 @@ +#import + +@interface Thing : NSObject {} +-(int32_t)add:(int32_t)x Y:(int32_t) y; +@end + +@implementation Thing +-(int32_t)add:(int32_t)x Y:(int32_t) y { + return x + y; +} +@end + +@interface Thing (Sub) +-(int32_t)sub:(int32_t)x Y:(int32_t) y; +@end + +@implementation Thing (Sub) +-(int32_t)sub:(int32_t)x Y:(int32_t) y { + return x - y; +} +@end diff --git a/pkgs/ffigen/test/native_objc_test/method_bindings.dart b/pkgs/ffigen/test/native_objc_test/method_bindings.dart index c695b6075b..f20ce96360 100644 --- a/pkgs/ffigen/test/native_objc_test/method_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/method_bindings.dart @@ -151,8 +151,6 @@ class MethodTestObjCLibrary { late final __objc_getClass = __objc_getClassPtr.asFunction< ffi.Pointer Function(ffi.Pointer)>(); - late final ffi.Pointer _class_MethodInterface1 = - _getClass1("MethodInterface"); late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); late final ffi.Pointer _sel_load1 = _registerName1("load"); void _objc_msgSend_0( @@ -506,7 +504,7 @@ class MethodTestObjCLibrary { late final ffi.Pointer _sel_debugDescription1 = _registerName1("debugDescription"); - late final ffi.Pointer _sel_add1 = _registerName1("add"); + late final ffi.Pointer _sel_version1 = _registerName1("version"); int _objc_msgSend_15( ffi.Pointer obj, ffi.Pointer sel, @@ -519,39 +517,110 @@ class MethodTestObjCLibrary { late final __objc_msgSend_15Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + NSInteger Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_setVersion_1 = + _registerName1("setVersion:"); + void _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + int aVersion, + ) { + return __objc_msgSend_16( + obj, + sel, + aVersion, + ); + } + + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_classForCoder1 = + _registerName1("classForCoder"); + late final ffi.Pointer _sel_replacementObjectForCoder_1 = + _registerName1("replacementObjectForCoder:"); + ffi.Pointer _objc_msgSend_17( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_17( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_17Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = + _registerName1("awakeAfterUsingCoder:"); + late final ffi.Pointer _sel_poseAsClass_1 = + _registerName1("poseAsClass:"); + late final ffi.Pointer _sel_autoContentAccessingProxy1 = + _registerName1("autoContentAccessingProxy"); + late final ffi.Pointer _class_MethodInterface1 = + _getClass1("MethodInterface"); + late final ffi.Pointer _sel_add1 = _registerName1("add"); + int _objc_msgSend_18( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_18( + obj, + sel, + ); + } + + late final __objc_msgSend_18Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_add_1 = _registerName1("add:"); - int _objc_msgSend_16( + int _objc_msgSend_19( ffi.Pointer obj, ffi.Pointer sel, int x, ) { - return __objc_msgSend_16( + return __objc_msgSend_19( obj, sel, x, ); } - late final __objc_msgSend_16Ptr = _lookup< + late final __objc_msgSend_19Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_add_Y_1 = _registerName1("add:Y:"); - int _objc_msgSend_17( + int _objc_msgSend_20( ffi.Pointer obj, ffi.Pointer sel, int x, int y, ) { - return __objc_msgSend_17( + return __objc_msgSend_20( obj, sel, x, @@ -559,22 +628,22 @@ class MethodTestObjCLibrary { ); } - late final __objc_msgSend_17Ptr = _lookup< + late final __objc_msgSend_20Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, int)>(); late final ffi.Pointer _sel_add_Y_Z_1 = _registerName1("add:Y:Z:"); - int _objc_msgSend_18( + int _objc_msgSend_21( ffi.Pointer obj, ffi.Pointer sel, int x, int y, int z, ) { - return __objc_msgSend_18( + return __objc_msgSend_21( obj, sel, x, @@ -583,11 +652,11 @@ class MethodTestObjCLibrary { ); } - late final __objc_msgSend_18Ptr = _lookup< + late final __objc_msgSend_21Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Int32, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< + late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< int Function( ffi.Pointer, ffi.Pointer, int, int, int)>(); @@ -708,71 +777,6 @@ class _ObjCWrapper { int get hashCode => _id.hashCode; } -class MethodInterface extends NSObject { - MethodInterface._(ffi.Pointer id, MethodTestObjCLibrary lib) - : super._(id, lib); - - static MethodInterface castFrom(T other) { - return MethodInterface._(other._id, other._lib); - } - - static MethodInterface castFromPointer( - MethodTestObjCLibrary lib, ffi.Pointer other) { - return MethodInterface._(other, lib); - } - - int add() { - return _lib._objc_msgSend_15(_id, _lib._sel_add1); - } - - int add1(int x) { - return _lib._objc_msgSend_16(_id, _lib._sel_add_1, x); - } - - int add_Y(int x, int y) { - return _lib._objc_msgSend_17(_id, _lib._sel_add_Y_1, x, y); - } - - int add_Y_Z(int x, int y, int z) { - return _lib._objc_msgSend_18(_id, _lib._sel_add_Y_Z_1, x, y, z); - } - - static int sub(MethodTestObjCLibrary _lib) { - return _lib._objc_msgSend_15(_lib._class_MethodInterface1, _lib._sel_sub1); - } - - static int sub1(MethodTestObjCLibrary _lib, int x) { - return _lib._objc_msgSend_16( - _lib._class_MethodInterface1, _lib._sel_sub_1, x); - } - - static int sub_Y(MethodTestObjCLibrary _lib, int x, int y) { - return _lib._objc_msgSend_17( - _lib._class_MethodInterface1, _lib._sel_sub_Y_1, x, y); - } - - static int sub_Y_Z(MethodTestObjCLibrary _lib, int x, int y, int z) { - return _lib._objc_msgSend_18( - _lib._class_MethodInterface1, _lib._sel_sub_Y_Z_1, x, y, z); - } - - static MethodInterface new1(MethodTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_MethodInterface1, _lib._sel_new1); - return MethodInterface._(_ret, _lib); - } - - static MethodInterface alloc(MethodTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_MethodInterface1, _lib._sel_alloc1); - return MethodInterface._(_ret, _lib); - } -} - -class ObjCSel extends ffi.Opaque {} - -class ObjCObject extends ffi.Opaque {} - class NSObject extends _ObjCWrapper { NSObject._(ffi.Pointer id, MethodTestObjCLibrary lib) : super._(id, lib); @@ -949,8 +953,49 @@ class NSObject extends _ObjCWrapper { _lib._class_NSObject1, _lib._sel_debugDescription1); return NSString._(_ret, _lib); } + + static int version(MethodTestObjCLibrary _lib) { + return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); + } + + static void setVersion(MethodTestObjCLibrary _lib, int aVersion) { + _lib._objc_msgSend_16( + _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); + } + + NSObject get classForCoder { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); + return NSObject._(_ret, _lib); + } + + NSObject replacementObjectForCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + NSObject awakeAfterUsingCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + static void poseAsClass(MethodTestObjCLibrary _lib, NSObject aClass) { + _lib._objc_msgSend_8( + _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); + } + + NSObject get autoContentAccessingProxy { + final _ret = + _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); + return NSObject._(_ret, _lib); + } } +class ObjCSel extends ffi.Opaque {} + +class ObjCObject extends ffi.Opaque {} + typedef instancetype = ffi.Pointer; class _NSZone extends ffi.Opaque {} @@ -994,7 +1039,7 @@ class NSString extends _ObjCWrapper { } @override - String toString() => UTF8String().cast().toDartString(); + String toString() => (UTF8String).cast().toDartString(); static NSString stringWithCString_encoding( MethodTestObjCLibrary _lib, ffi.Pointer cString, int enc) { @@ -1003,7 +1048,7 @@ class NSString extends _ObjCWrapper { return NSString._(_ret, _lib); } - ffi.Pointer UTF8String() { + ffi.Pointer get UTF8String { return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); } } @@ -1012,6 +1057,67 @@ extension StringToNSString on String { NSString toNSString(MethodTestObjCLibrary lib) => NSString(lib, this); } +class MethodInterface extends NSObject { + MethodInterface._(ffi.Pointer id, MethodTestObjCLibrary lib) + : super._(id, lib); + + static MethodInterface castFrom(T other) { + return MethodInterface._(other._id, other._lib); + } + + static MethodInterface castFromPointer( + MethodTestObjCLibrary lib, ffi.Pointer other) { + return MethodInterface._(other, lib); + } + + int add() { + return _lib._objc_msgSend_18(_id, _lib._sel_add1); + } + + int add1(int x) { + return _lib._objc_msgSend_19(_id, _lib._sel_add_1, x); + } + + int add_Y(int x, int y) { + return _lib._objc_msgSend_20(_id, _lib._sel_add_Y_1, x, y); + } + + int add_Y_Z(int x, int y, int z) { + return _lib._objc_msgSend_21(_id, _lib._sel_add_Y_Z_1, x, y, z); + } + + static int sub(MethodTestObjCLibrary _lib) { + return _lib._objc_msgSend_18(_lib._class_MethodInterface1, _lib._sel_sub1); + } + + static int sub1(MethodTestObjCLibrary _lib, int x) { + return _lib._objc_msgSend_19( + _lib._class_MethodInterface1, _lib._sel_sub_1, x); + } + + static int sub_Y(MethodTestObjCLibrary _lib, int x, int y) { + return _lib._objc_msgSend_20( + _lib._class_MethodInterface1, _lib._sel_sub_Y_1, x, y); + } + + static int sub_Y_Z(MethodTestObjCLibrary _lib, int x, int y, int z) { + return _lib._objc_msgSend_21( + _lib._class_MethodInterface1, _lib._sel_sub_Y_Z_1, x, y, z); + } + + static MethodInterface new1(MethodTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_MethodInterface1, _lib._sel_new1); + return MethodInterface._(_ret, _lib); + } + + static MethodInterface alloc(MethodTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_MethodInterface1, _lib._sel_alloc1); + return MethodInterface._(_ret, _lib); + } +} + const int NSScannedOption = 1; const int NSCollectorDisabledOption = 2; diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart index 53b85166ba..73e0ae3291 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart @@ -107,988 +107,7307 @@ class NativeObjCLibrary { set kCFAllocatorUseContext(CFAllocatorRef value) => _kCFAllocatorUseContext.value = value; + ffi.Pointer _registerName1(String name) { + final cstr = name.toNativeUtf8(); + final sel = _sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; + } + + ffi.Pointer _sel_registerName( + ffi.Pointer str, + ) { + return __sel_registerName( + str, + ); + } + + late final __sel_registerNamePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sel_registerName'); + late final __sel_registerName = __sel_registerNamePtr + .asFunction Function(ffi.Pointer)>(); + + ffi.Pointer _getClass1(String name) { + final cstr = name.toNativeUtf8(); + final clazz = _objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; + } + + ffi.Pointer _objc_getClass( + ffi.Pointer str, + ) { + return __objc_getClass( + str, + ); + } + + late final __objc_getClassPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('objc_getClass'); + late final __objc_getClass = __objc_getClassPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); + + late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); + late final ffi.Pointer _sel_load1 = _registerName1("load"); + void _objc_msgSend_0( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_0( + obj, + sel, + ); + } + + late final __objc_msgSend_0Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_initialize1 = + _registerName1("initialize"); + late final ffi.Pointer _sel_init1 = _registerName1("init"); + instancetype _objc_msgSend_1( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1( + obj, + sel, + ); + } + + late final __objc_msgSend_1Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_new1 = _registerName1("new"); + late final ffi.Pointer _sel_allocWithZone_1 = + _registerName1("allocWithZone:"); + instancetype _objc_msgSend_2( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_2( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_2Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>(); + + late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); + late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); + late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); + late final ffi.Pointer _sel_copy1 = _registerName1("copy"); + late final ffi.Pointer _sel_mutableCopy1 = + _registerName1("mutableCopy"); + late final ffi.Pointer _sel_copyWithZone_1 = + _registerName1("copyWithZone:"); + late final ffi.Pointer _sel_mutableCopyWithZone_1 = + _registerName1("mutableCopyWithZone:"); + late final ffi.Pointer _sel_instancesRespondToSelector_1 = + _registerName1("instancesRespondToSelector:"); + bool _objc_msgSend_3( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_3( + obj, + sel, + aSelector, + ) != + 0; + } + + late final __objc_msgSend_3Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_conformsToProtocol_1 = + _registerName1("conformsToProtocol:"); + bool _objc_msgSend_4( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer protocol, + ) { + return __objc_msgSend_4( + obj, + sel, + protocol, + ) != + 0; + } + + late final __objc_msgSend_4Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_methodForSelector_1 = + _registerName1("methodForSelector:"); + IMP _objc_msgSend_5( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_5( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_5Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_instanceMethodForSelector_1 = + _registerName1("instanceMethodForSelector:"); + late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = + _registerName1("doesNotRecognizeSelector:"); + void _objc_msgSend_6( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_6( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_6Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_forwardingTargetForSelector_1 = + _registerName1("forwardingTargetForSelector:"); + ffi.Pointer _objc_msgSend_7( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_7( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_7Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_forwardInvocation_1 = + _registerName1("forwardInvocation:"); + void _objc_msgSend_8( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anInvocation, + ) { + return __objc_msgSend_8( + obj, + sel, + anInvocation, + ); + } + + late final __objc_msgSend_8Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _class_NSMethodSignature1 = + _getClass1("NSMethodSignature"); + late final ffi.Pointer _sel_methodSignatureForSelector_1 = + _registerName1("methodSignatureForSelector:"); + ffi.Pointer _objc_msgSend_9( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_9( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_9Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = + _registerName1("instanceMethodSignatureForSelector:"); + late final ffi.Pointer _sel_allowsWeakReference1 = + _registerName1("allowsWeakReference"); + bool _objc_msgSend_10( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_10( + obj, + sel, + ) != + 0; + } + + late final __objc_msgSend_10Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_retainWeakReference1 = + _registerName1("retainWeakReference"); + late final ffi.Pointer _sel_isSubclassOfClass_1 = + _registerName1("isSubclassOfClass:"); + late final ffi.Pointer _sel_resolveClassMethod_1 = + _registerName1("resolveClassMethod:"); + late final ffi.Pointer _sel_resolveInstanceMethod_1 = + _registerName1("resolveInstanceMethod:"); + late final ffi.Pointer _sel_hash1 = _registerName1("hash"); + int _objc_msgSend_11( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_11( + obj, + sel, + ); + } + + late final __objc_msgSend_11Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_superclass1 = + _registerName1("superclass"); + late final ffi.Pointer _sel_class1 = _registerName1("class"); + late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); + late final ffi.Pointer _sel_length1 = _registerName1("length"); + late final ffi.Pointer _sel_characterAtIndex_1 = + _registerName1("characterAtIndex:"); + int _objc_msgSend_12( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_12( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_12Ptr = _lookup< + ffi.NativeFunction< + unichar Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithCoder_1 = + _registerName1("initWithCoder:"); + instancetype _objc_msgSend_13( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_13( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_13Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_substringFromIndex_1 = + _registerName1("substringFromIndex:"); + ffi.Pointer _objc_msgSend_14( + ffi.Pointer obj, + ffi.Pointer sel, + int from, + ) { + return __objc_msgSend_14( + obj, + sel, + from, + ); + } + + late final __objc_msgSend_14Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_substringToIndex_1 = + _registerName1("substringToIndex:"); + late final ffi.Pointer _sel_substringWithRange_1 = + _registerName1("substringWithRange:"); + ffi.Pointer _objc_msgSend_15( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_15( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_15Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final ffi.Pointer _sel_getCharacters_range_1 = + _registerName1("getCharacters:range:"); + void _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + NSRange range, + ) { + return __objc_msgSend_16( + obj, + sel, + buffer, + range, + ); + } + + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>(); + + late final ffi.Pointer _sel_compare_1 = _registerName1("compare:"); + int _objc_msgSend_17( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + ) { + return __objc_msgSend_17( + obj, + sel, + string, + ); + } + + late final __objc_msgSend_17Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_compare_options_1 = + _registerName1("compare:options:"); + int _objc_msgSend_18( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int mask, + ) { + return __objc_msgSend_18( + obj, + sel, + string, + mask, + ); + } + + late final __objc_msgSend_18Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_compare_options_range_1 = + _registerName1("compare:options:range:"); + int _objc_msgSend_19( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int mask, + NSRange rangeOfReceiverToCompare, + ) { + return __objc_msgSend_19( + obj, + sel, + string, + mask, + rangeOfReceiverToCompare, + ); + } + + late final __objc_msgSend_19Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange)>(); + + late final ffi.Pointer _sel_compare_options_range_locale_1 = + _registerName1("compare:options:range:locale:"); + int _objc_msgSend_20( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int mask, + NSRange rangeOfReceiverToCompare, + ffi.Pointer locale, + ) { + return __objc_msgSend_20( + obj, + sel, + string, + mask, + rangeOfReceiverToCompare, + locale, + ); + } + + late final __objc_msgSend_20Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange, ffi.Pointer)>(); + + late final ffi.Pointer _sel_caseInsensitiveCompare_1 = + _registerName1("caseInsensitiveCompare:"); + late final ffi.Pointer _sel_localizedCompare_1 = + _registerName1("localizedCompare:"); + late final ffi.Pointer _sel_localizedCaseInsensitiveCompare_1 = + _registerName1("localizedCaseInsensitiveCompare:"); + late final ffi.Pointer _sel_localizedStandardCompare_1 = + _registerName1("localizedStandardCompare:"); + late final ffi.Pointer _sel_isEqualToString_1 = + _registerName1("isEqualToString:"); + late final ffi.Pointer _sel_hasPrefix_1 = + _registerName1("hasPrefix:"); + late final ffi.Pointer _sel_hasSuffix_1 = + _registerName1("hasSuffix:"); + late final ffi.Pointer _sel_commonPrefixWithString_options_1 = + _registerName1("commonPrefixWithString:options:"); + ffi.Pointer _objc_msgSend_21( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer str, + int mask, + ) { + return __objc_msgSend_21( + obj, + sel, + str, + mask, + ); + } + + late final __objc_msgSend_21Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_containsString_1 = + _registerName1("containsString:"); + late final ffi.Pointer + _sel_localizedCaseInsensitiveContainsString_1 = + _registerName1("localizedCaseInsensitiveContainsString:"); + late final ffi.Pointer _sel_localizedStandardContainsString_1 = + _registerName1("localizedStandardContainsString:"); + late final ffi.Pointer _sel_localizedStandardRangeOfString_1 = + _registerName1("localizedStandardRangeOfString:"); + NSRange _objc_msgSend_22( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer str, + ) { + return __objc_msgSend_22( + obj, + sel, + str, + ); + } + + late final __objc_msgSend_22Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_rangeOfString_1 = + _registerName1("rangeOfString:"); + late final ffi.Pointer _sel_rangeOfString_options_1 = + _registerName1("rangeOfString:options:"); + NSRange _objc_msgSend_23( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchString, + int mask, + ) { + return __objc_msgSend_23( + obj, + sel, + searchString, + mask, + ); + } + + late final __objc_msgSend_23Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_rangeOfString_options_range_1 = + _registerName1("rangeOfString:options:range:"); + NSRange _objc_msgSend_24( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchString, + int mask, + NSRange rangeOfReceiverToSearch, + ) { + return __objc_msgSend_24( + obj, + sel, + searchString, + mask, + rangeOfReceiverToSearch, + ); + } + + late final __objc_msgSend_24Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange)>(); + + late final ffi.Pointer _sel_rangeOfString_options_range_locale_1 = + _registerName1("rangeOfString:options:range:locale:"); + NSRange _objc_msgSend_25( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchString, + int mask, + NSRange rangeOfReceiverToSearch, + ffi.Pointer locale, + ) { + return __objc_msgSend_25( + obj, + sel, + searchString, + mask, + rangeOfReceiverToSearch, + locale, + ); + } + + late final __objc_msgSend_25Ptr = _lookup< + ffi.NativeFunction< + NSRange Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange, ffi.Pointer)>(); + + late final ffi.Pointer _sel_rangeOfCharacterFromSet_1 = + _registerName1("rangeOfCharacterFromSet:"); + late final ffi.Pointer _sel_rangeOfCharacterFromSet_options_1 = + _registerName1("rangeOfCharacterFromSet:options:"); + late final ffi.Pointer _sel_rangeOfCharacterFromSet_options_range_1 = + _registerName1("rangeOfCharacterFromSet:options:range:"); + late final ffi.Pointer + _sel_rangeOfComposedCharacterSequenceAtIndex_1 = + _registerName1("rangeOfComposedCharacterSequenceAtIndex:"); + NSRange _objc_msgSend_26( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_26( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_26Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer + _sel_rangeOfComposedCharacterSequencesForRange_1 = + _registerName1("rangeOfComposedCharacterSequencesForRange:"); + NSRange _objc_msgSend_27( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_27( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_27Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< + NSRange Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final ffi.Pointer _sel_stringByAppendingString_1 = + _registerName1("stringByAppendingString:"); + ffi.Pointer _objc_msgSend_28( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aString, + ) { + return __objc_msgSend_28( + obj, + sel, + aString, + ); + } + + late final __objc_msgSend_28Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_28 = __objc_msgSend_28Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_stringByAppendingFormat_1 = + _registerName1("stringByAppendingFormat:"); + late final ffi.Pointer _sel_doubleValue1 = + _registerName1("doubleValue"); + double _objc_msgSend_29( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_29( + obj, + sel, + ); + } + + late final __objc_msgSend_29Ptr = _lookup< + ffi.NativeFunction< + ffi.Double Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_29 = __objc_msgSend_29Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_floatValue1 = + _registerName1("floatValue"); + double _objc_msgSend_30( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_30( + obj, + sel, + ); + } + + late final __objc_msgSend_30Ptr = _lookup< + ffi.NativeFunction< + ffi.Float Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_30 = __objc_msgSend_30Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_intValue1 = _registerName1("intValue"); + int _objc_msgSend_31( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_31( + obj, + sel, + ); + } + + late final __objc_msgSend_31Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_31 = __objc_msgSend_31Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_integerValue1 = + _registerName1("integerValue"); + int _objc_msgSend_32( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_32( + obj, + sel, + ); + } + + late final __objc_msgSend_32Ptr = _lookup< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_32 = __objc_msgSend_32Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_longLongValue1 = + _registerName1("longLongValue"); + int _objc_msgSend_33( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_33( + obj, + sel, + ); + } + + late final __objc_msgSend_33Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.LongLong Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_33 = __objc_msgSend_33Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_boolValue1 = _registerName1("boolValue"); + late final ffi.Pointer _sel_uppercaseString1 = + _registerName1("uppercaseString"); + late final ffi.Pointer _sel_lowercaseString1 = + _registerName1("lowercaseString"); + late final ffi.Pointer _sel_capitalizedString1 = + _registerName1("capitalizedString"); + late final ffi.Pointer _sel_localizedUppercaseString1 = + _registerName1("localizedUppercaseString"); + late final ffi.Pointer _sel_localizedLowercaseString1 = + _registerName1("localizedLowercaseString"); + late final ffi.Pointer _sel_localizedCapitalizedString1 = + _registerName1("localizedCapitalizedString"); + late final ffi.Pointer _sel_uppercaseStringWithLocale_1 = + _registerName1("uppercaseStringWithLocale:"); + late final ffi.Pointer _sel_lowercaseStringWithLocale_1 = + _registerName1("lowercaseStringWithLocale:"); + late final ffi.Pointer _sel_capitalizedStringWithLocale_1 = + _registerName1("capitalizedStringWithLocale:"); + late final ffi.Pointer _sel_getLineStart_end_contentsEnd_forRange_1 = + _registerName1("getLineStart:end:contentsEnd:forRange:"); + void _objc_msgSend_34( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer startPtr, + ffi.Pointer lineEndPtr, + ffi.Pointer contentsEndPtr, + NSRange range, + ) { + return __objc_msgSend_34( + obj, + sel, + startPtr, + lineEndPtr, + contentsEndPtr, + range, + ); + } + + late final __objc_msgSend_34Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_34 = __objc_msgSend_34Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSRange)>(); + + late final ffi.Pointer _sel_lineRangeForRange_1 = + _registerName1("lineRangeForRange:"); + late final ffi.Pointer + _sel_getParagraphStart_end_contentsEnd_forRange_1 = + _registerName1("getParagraphStart:end:contentsEnd:forRange:"); + late final ffi.Pointer _sel_paragraphRangeForRange_1 = + _registerName1("paragraphRangeForRange:"); + late final ffi.Pointer + _sel_enumerateSubstringsInRange_options_usingBlock_1 = + _registerName1("enumerateSubstringsInRange:options:usingBlock:"); + void _objc_msgSend_35( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer block, + ) { + return __objc_msgSend_35( + obj, + sel, + range, + opts, + block, + ); + } + + late final __objc_msgSend_35Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_35 = __objc_msgSend_35Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_enumerateLinesUsingBlock_1 = + _registerName1("enumerateLinesUsingBlock:"); + late final ffi.Pointer _sel_UTF8String1 = + _registerName1("UTF8String"); + ffi.Pointer _objc_msgSend_36( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_36( + obj, + sel, + ); + } + + late final __objc_msgSend_36Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_36 = __objc_msgSend_36Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_fastestEncoding1 = + _registerName1("fastestEncoding"); + late final ffi.Pointer _sel_smallestEncoding1 = + _registerName1("smallestEncoding"); + late final ffi.Pointer _class_NSData1 = _getClass1("NSData"); + late final ffi.Pointer + _sel_dataUsingEncoding_allowLossyConversion_1 = + _registerName1("dataUsingEncoding:allowLossyConversion:"); + ffi.Pointer _objc_msgSend_37( + ffi.Pointer obj, + ffi.Pointer sel, + int encoding, + bool lossy, + ) { + return __objc_msgSend_37( + obj, + sel, + encoding, + lossy ? 1 : 0, + ); + } + + late final __objc_msgSend_37Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSStringEncoding, + ffi.Uint8)>>('objc_msgSend'); + late final __objc_msgSend_37 = __objc_msgSend_37Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int, int)>(); + + late final ffi.Pointer _sel_dataUsingEncoding_1 = + _registerName1("dataUsingEncoding:"); + ffi.Pointer _objc_msgSend_38( + ffi.Pointer obj, + ffi.Pointer sel, + int encoding, + ) { + return __objc_msgSend_38( + obj, + sel, + encoding, + ); + } + + late final __objc_msgSend_38Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); + late final __objc_msgSend_38 = __objc_msgSend_38Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_canBeConvertedToEncoding_1 = + _registerName1("canBeConvertedToEncoding:"); + bool _objc_msgSend_39( + ffi.Pointer obj, + ffi.Pointer sel, + int encoding, + ) { + return __objc_msgSend_39( + obj, + sel, + encoding, + ) != + 0; + } + + late final __objc_msgSend_39Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + NSStringEncoding)>>('objc_msgSend'); + late final __objc_msgSend_39 = __objc_msgSend_39Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_cStringUsingEncoding_1 = + _registerName1("cStringUsingEncoding:"); + void _objc_msgSend_40( + ffi.Pointer obj, + ffi.Pointer sel, + int encoding, + ) { + return __objc_msgSend_40( + obj, + sel, + encoding, + ); + } + + late final __objc_msgSend_40Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSStringEncoding)>>('objc_msgSend'); + late final __objc_msgSend_40 = __objc_msgSend_40Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_getCString_maxLength_encoding_1 = + _registerName1("getCString:maxLength:encoding:"); + bool _objc_msgSend_41( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + int maxBufferCount, + int encoding, + ) { + return __objc_msgSend_41( + obj, + sel, + buffer, + maxBufferCount, + encoding, + ) != + 0; + } + + late final __objc_msgSend_41Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSStringEncoding)>>('objc_msgSend'); + late final __objc_msgSend_41 = __objc_msgSend_41Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int)>(); + + late final ffi.Pointer + _sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_1 = + _registerName1( + "getBytes:maxLength:usedLength:encoding:options:range:remainingRange:"); + bool _objc_msgSend_42( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + int maxBufferCount, + ffi.Pointer usedBufferCount, + int encoding, + int options, + NSRange range, + NSRangePointer leftover, + ) { + return __objc_msgSend_42( + obj, + sel, + buffer, + maxBufferCount, + usedBufferCount, + encoding, + options, + range, + leftover, + ) != + 0; + } + + late final __objc_msgSend_42Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer, + NSStringEncoding, + ffi.Int32, + NSRange, + NSRangePointer)>>('objc_msgSend'); + late final __objc_msgSend_42 = __objc_msgSend_42Ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + int, + int, + NSRange, + NSRangePointer)>(); + + late final ffi.Pointer _sel_maximumLengthOfBytesUsingEncoding_1 = + _registerName1("maximumLengthOfBytesUsingEncoding:"); + int _objc_msgSend_43( + ffi.Pointer obj, + ffi.Pointer sel, + int enc, + ) { + return __objc_msgSend_43( + obj, + sel, + enc, + ); + } + + late final __objc_msgSend_43Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + NSStringEncoding)>>('objc_msgSend'); + late final __objc_msgSend_43 = __objc_msgSend_43Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_lengthOfBytesUsingEncoding_1 = + _registerName1("lengthOfBytesUsingEncoding:"); + late final ffi.Pointer _sel_availableStringEncodings1 = + _registerName1("availableStringEncodings"); + ffi.Pointer _objc_msgSend_44( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_44( + obj, + sel, + ); + } + + late final __objc_msgSend_44Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_44 = __objc_msgSend_44Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_localizedNameOfStringEncoding_1 = + _registerName1("localizedNameOfStringEncoding:"); + late final ffi.Pointer _sel_defaultCStringEncoding1 = + _registerName1("defaultCStringEncoding"); + late final ffi.Pointer _sel_decomposedStringWithCanonicalMapping1 = + _registerName1("decomposedStringWithCanonicalMapping"); + late final ffi.Pointer _sel_precomposedStringWithCanonicalMapping1 = + _registerName1("precomposedStringWithCanonicalMapping"); + late final ffi.Pointer + _sel_decomposedStringWithCompatibilityMapping1 = + _registerName1("decomposedStringWithCompatibilityMapping"); + late final ffi.Pointer + _sel_precomposedStringWithCompatibilityMapping1 = + _registerName1("precomposedStringWithCompatibilityMapping"); + late final ffi.Pointer _sel_stringByTrimmingCharactersInSet_1 = + _registerName1("stringByTrimmingCharactersInSet:"); + late final ffi.Pointer + _sel_stringByPaddingToLength_withString_startingAtIndex_1 = + _registerName1("stringByPaddingToLength:withString:startingAtIndex:"); + ffi.Pointer _objc_msgSend_45( + ffi.Pointer obj, + ffi.Pointer sel, + int newLength, + ffi.Pointer padString, + int padIndex, + ) { + return __objc_msgSend_45( + obj, + sel, + newLength, + padString, + padIndex, + ); + } + + late final __objc_msgSend_45Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_45 = __objc_msgSend_45Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_stringByFoldingWithOptions_locale_1 = + _registerName1("stringByFoldingWithOptions:locale:"); + ffi.Pointer _objc_msgSend_46( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ffi.Pointer locale, + ) { + return __objc_msgSend_46( + obj, + sel, + options, + locale, + ); + } + + late final __objc_msgSend_46Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_46 = __objc_msgSend_46Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final ffi.Pointer + _sel_stringByReplacingOccurrencesOfString_withString_options_range_1 = + _registerName1( + "stringByReplacingOccurrencesOfString:withString:options:range:"); + ffi.Pointer _objc_msgSend_47( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer target, + ffi.Pointer replacement, + int options, + NSRange searchRange, + ) { + return __objc_msgSend_47( + obj, + sel, + target, + replacement, + options, + searchRange, + ); + } + + late final __objc_msgSend_47Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_47 = __objc_msgSend_47Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + NSRange)>(); + + late final ffi.Pointer + _sel_stringByReplacingOccurrencesOfString_withString_1 = + _registerName1("stringByReplacingOccurrencesOfString:withString:"); + ffi.Pointer _objc_msgSend_48( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer target, + ffi.Pointer replacement, + ) { + return __objc_msgSend_48( + obj, + sel, + target, + replacement, + ); + } + + late final __objc_msgSend_48Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_48 = __objc_msgSend_48Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer + _sel_stringByReplacingCharactersInRange_withString_1 = + _registerName1("stringByReplacingCharactersInRange:withString:"); + ffi.Pointer _objc_msgSend_49( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer replacement, + ) { + return __objc_msgSend_49( + obj, + sel, + range, + replacement, + ); + } + + late final __objc_msgSend_49Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_49 = __objc_msgSend_49Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, ffi.Pointer)>(); + + late final ffi.Pointer _sel_stringByApplyingTransform_reverse_1 = + _registerName1("stringByApplyingTransform:reverse:"); + ffi.Pointer _objc_msgSend_50( + ffi.Pointer obj, + ffi.Pointer sel, + NSStringTransform transform, + bool reverse, + ) { + return __objc_msgSend_50( + obj, + sel, + transform, + reverse ? 1 : 0, + ); + } + + late final __objc_msgSend_50Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSStringTransform, + ffi.Uint8)>>('objc_msgSend'); + late final __objc_msgSend_50 = __objc_msgSend_50Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSStringTransform, int)>(); + + late final ffi.Pointer _sel_writeToURL_atomically_encoding_error_1 = + _registerName1("writeToURL:atomically:encoding:error:"); + bool _objc_msgSend_51( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + bool useAuxiliaryFile, + int enc, + ffi.Pointer> error, + ) { + return __objc_msgSend_51( + obj, + sel, + url, + useAuxiliaryFile ? 1 : 0, + enc, + error, + ) != + 0; + } + + late final __objc_msgSend_51Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Uint8, + NSStringEncoding, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_51 = __objc_msgSend_51Ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer>)>(); + + late final ffi.Pointer _sel_writeToFile_atomically_encoding_error_1 = + _registerName1("writeToFile:atomically:encoding:error:"); + late final ffi.Pointer _sel_description1 = + _registerName1("description"); + late final ffi.Pointer + _sel_initWithCharactersNoCopy_length_freeWhenDone_1 = + _registerName1("initWithCharactersNoCopy:length:freeWhenDone:"); + instancetype _objc_msgSend_52( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer characters, + int length, + bool freeBuffer, + ) { + return __objc_msgSend_52( + obj, + sel, + characters, + length, + freeBuffer ? 1 : 0, + ); + } + + late final __objc_msgSend_52Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger, ffi.Uint8)>>('objc_msgSend'); + late final __objc_msgSend_52 = __objc_msgSend_52Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int)>(); + + late final ffi.Pointer + _sel_initWithCharactersNoCopy_length_deallocator_1 = + _registerName1("initWithCharactersNoCopy:length:deallocator:"); + instancetype _objc_msgSend_53( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer chars, + int len, + ffi.Pointer deallocator, + ) { + return __objc_msgSend_53( + obj, + sel, + chars, + len, + deallocator, + ); + } + + late final __objc_msgSend_53Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_53 = __objc_msgSend_53Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final ffi.Pointer _sel_initWithCharacters_length_1 = + _registerName1("initWithCharacters:length:"); + instancetype _objc_msgSend_54( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer characters, + int length, + ) { + return __objc_msgSend_54( + obj, + sel, + characters, + length, + ); + } + + late final __objc_msgSend_54Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithUTF8String_1 = + _registerName1("initWithUTF8String:"); + instancetype _objc_msgSend_55( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer nullTerminatedCString, + ) { + return __objc_msgSend_55( + obj, + sel, + nullTerminatedCString, + ); + } + + late final __objc_msgSend_55Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_55 = __objc_msgSend_55Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_initWithString_1 = + _registerName1("initWithString:"); + late final ffi.Pointer _sel_initWithFormat_1 = + _registerName1("initWithFormat:"); + late final ffi.Pointer _sel_initWithFormat_arguments_1 = + _registerName1("initWithFormat:arguments:"); + instancetype _objc_msgSend_56( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ffi.Pointer<__va_list_tag> argList, + ) { + return __objc_msgSend_56( + obj, + sel, + format, + argList, + ); + } + + late final __objc_msgSend_56Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); + late final __objc_msgSend_56 = __objc_msgSend_56Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<__va_list_tag>)>(); + + late final ffi.Pointer _sel_initWithFormat_locale_1 = + _registerName1("initWithFormat:locale:"); + instancetype _objc_msgSend_57( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ffi.Pointer locale, + ) { + return __objc_msgSend_57( + obj, + sel, + format, + locale, + ); + } + + late final __objc_msgSend_57Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_57 = __objc_msgSend_57Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_initWithFormat_locale_arguments_1 = + _registerName1("initWithFormat:locale:arguments:"); + instancetype _objc_msgSend_58( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ffi.Pointer locale, + ffi.Pointer<__va_list_tag> argList, + ) { + return __objc_msgSend_58( + obj, + sel, + format, + locale, + argList, + ); + } + + late final __objc_msgSend_58Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); + late final __objc_msgSend_58 = __objc_msgSend_58Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>(); + + late final ffi.Pointer _sel_initWithData_encoding_1 = + _registerName1("initWithData:encoding:"); + instancetype _objc_msgSend_59( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + int encoding, + ) { + return __objc_msgSend_59( + obj, + sel, + data, + encoding, + ); + } + + late final __objc_msgSend_59Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); + late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithBytes_length_encoding_1 = + _registerName1("initWithBytes:length:encoding:"); + instancetype _objc_msgSend_60( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int len, + int encoding, + ) { + return __objc_msgSend_60( + obj, + sel, + bytes, + len, + encoding, + ); + } + + late final __objc_msgSend_60Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSStringEncoding)>>('objc_msgSend'); + late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int)>(); + + late final ffi.Pointer + _sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1 = + _registerName1("initWithBytesNoCopy:length:encoding:freeWhenDone:"); + instancetype _objc_msgSend_61( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int len, + int encoding, + bool freeBuffer, + ) { + return __objc_msgSend_61( + obj, + sel, + bytes, + len, + encoding, + freeBuffer ? 1 : 0, + ); + } + + late final __objc_msgSend_61Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSStringEncoding, + ffi.Uint8)>>('objc_msgSend'); + late final __objc_msgSend_61 = __objc_msgSend_61Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, int)>(); + + late final ffi.Pointer + _sel_initWithBytesNoCopy_length_encoding_deallocator_1 = + _registerName1("initWithBytesNoCopy:length:encoding:deallocator:"); + instancetype _objc_msgSend_62( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int len, + int encoding, + ffi.Pointer deallocator, + ) { + return __objc_msgSend_62( + obj, + sel, + bytes, + len, + encoding, + deallocator, + ); + } + + late final __objc_msgSend_62Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSStringEncoding, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer)>(); + + late final ffi.Pointer _sel_string1 = _registerName1("string"); + late final ffi.Pointer _sel_stringWithString_1 = + _registerName1("stringWithString:"); + late final ffi.Pointer _sel_stringWithCharacters_length_1 = + _registerName1("stringWithCharacters:length:"); + late final ffi.Pointer _sel_stringWithUTF8String_1 = + _registerName1("stringWithUTF8String:"); + late final ffi.Pointer _sel_stringWithFormat_1 = + _registerName1("stringWithFormat:"); + late final ffi.Pointer _sel_localizedStringWithFormat_1 = + _registerName1("localizedStringWithFormat:"); + late final ffi.Pointer _sel_initWithCString_encoding_1 = + _registerName1("initWithCString:encoding:"); + instancetype _objc_msgSend_63( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer nullTerminatedCString, + int encoding, + ) { + return __objc_msgSend_63( + obj, + sel, + nullTerminatedCString, + encoding, + ); + } + + late final __objc_msgSend_63Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); + late final __objc_msgSend_63 = __objc_msgSend_63Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_stringWithCString_encoding_1 = + _registerName1("stringWithCString:encoding:"); + late final ffi.Pointer _sel_initWithContentsOfURL_encoding_error_1 = + _registerName1("initWithContentsOfURL:encoding:error:"); + instancetype _objc_msgSend_64( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int enc, + ffi.Pointer> error, + ) { + return __objc_msgSend_64( + obj, + sel, + url, + enc, + error, + ); + } + + late final __objc_msgSend_64Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSStringEncoding, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_64 = __objc_msgSend_64Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final ffi.Pointer _sel_initWithContentsOfFile_encoding_error_1 = + _registerName1("initWithContentsOfFile:encoding:error:"); + late final ffi.Pointer + _sel_stringWithContentsOfURL_encoding_error_1 = + _registerName1("stringWithContentsOfURL:encoding:error:"); + late final ffi.Pointer + _sel_stringWithContentsOfFile_encoding_error_1 = + _registerName1("stringWithContentsOfFile:encoding:error:"); + late final ffi.Pointer + _sel_initWithContentsOfURL_usedEncoding_error_1 = + _registerName1("initWithContentsOfURL:usedEncoding:error:"); + instancetype _objc_msgSend_65( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer enc, + ffi.Pointer> error, + ) { + return __objc_msgSend_65( + obj, + sel, + url, + enc, + error, + ); + } + + late final __objc_msgSend_65Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_65 = __objc_msgSend_65Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final ffi.Pointer + _sel_initWithContentsOfFile_usedEncoding_error_1 = + _registerName1("initWithContentsOfFile:usedEncoding:error:"); + late final ffi.Pointer + _sel_stringWithContentsOfURL_usedEncoding_error_1 = + _registerName1("stringWithContentsOfURL:usedEncoding:error:"); + late final ffi.Pointer + _sel_stringWithContentsOfFile_usedEncoding_error_1 = + _registerName1("stringWithContentsOfFile:usedEncoding:error:"); + late final ffi.Pointer + _sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1 = + _registerName1( + "stringEncodingForData:encodingOptions:convertedString:usedLossyConversion:"); + int _objc_msgSend_66( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ffi.Pointer opts, + ffi.Pointer> string, + ffi.Pointer usedLossyConversion, + ) { + return __objc_msgSend_66( + obj, + sel, + data, + opts, + string, + usedLossyConversion, + ); + } + + late final __objc_msgSend_66Ptr = _lookup< + ffi.NativeFunction< + NSStringEncoding Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_66 = __objc_msgSend_66Ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_propertyList1 = + _registerName1("propertyList"); + late final ffi.Pointer _class_NSDictionary1 = + _getClass1("NSDictionary"); + late final ffi.Pointer _sel_propertyListFromStringsFileFormat1 = + _registerName1("propertyListFromStringsFileFormat"); + ffi.Pointer _objc_msgSend_67( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_67( + obj, + sel, + ); + } + + late final __objc_msgSend_67Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_67 = __objc_msgSend_67Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_cString1 = _registerName1("cString"); + late final ffi.Pointer _sel_lossyCString1 = + _registerName1("lossyCString"); + late final ffi.Pointer _sel_cStringLength1 = + _registerName1("cStringLength"); + late final ffi.Pointer _sel_getCString_1 = + _registerName1("getCString:"); + void _objc_msgSend_68( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + ) { + return __objc_msgSend_68( + obj, + sel, + bytes, + ); + } + + late final __objc_msgSend_68Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_68 = __objc_msgSend_68Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_getCString_maxLength_1 = + _registerName1("getCString:maxLength:"); + void _objc_msgSend_69( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int maxLength, + ) { + return __objc_msgSend_69( + obj, + sel, + bytes, + maxLength, + ); + } + + late final __objc_msgSend_69Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_69 = __objc_msgSend_69Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final ffi.Pointer + _sel_getCString_maxLength_range_remainingRange_1 = + _registerName1("getCString:maxLength:range:remainingRange:"); + void _objc_msgSend_70( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int maxLength, + NSRange aRange, + NSRangePointer leftoverRange, + ) { + return __objc_msgSend_70( + obj, + sel, + bytes, + maxLength, + aRange, + leftoverRange, + ); + } + + late final __objc_msgSend_70Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSRange, + NSRangePointer)>>('objc_msgSend'); + late final __objc_msgSend_70 = __objc_msgSend_70Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange, NSRangePointer)>(); + + late final ffi.Pointer _sel_writeToFile_atomically_1 = + _registerName1("writeToFile:atomically:"); + bool _objc_msgSend_71( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool useAuxiliaryFile, + ) { + return __objc_msgSend_71( + obj, + sel, + path, + useAuxiliaryFile ? 1 : 0, + ) != + 0; + } + + late final __objc_msgSend_71Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); + late final __objc_msgSend_71 = __objc_msgSend_71Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_writeToURL_atomically_1 = + _registerName1("writeToURL:atomically:"); + late final ffi.Pointer _sel_initWithContentsOfFile_1 = + _registerName1("initWithContentsOfFile:"); + late final ffi.Pointer _sel_initWithContentsOfURL_1 = + _registerName1("initWithContentsOfURL:"); + late final ffi.Pointer _sel_stringWithContentsOfFile_1 = + _registerName1("stringWithContentsOfFile:"); + late final ffi.Pointer _sel_stringWithContentsOfURL_1 = + _registerName1("stringWithContentsOfURL:"); + late final ffi.Pointer + _sel_initWithCStringNoCopy_length_freeWhenDone_1 = + _registerName1("initWithCStringNoCopy:length:freeWhenDone:"); + ffi.Pointer _objc_msgSend_72( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int length, + bool freeBuffer, + ) { + return __objc_msgSend_72( + obj, + sel, + bytes, + length, + freeBuffer ? 1 : 0, + ); + } + + late final __objc_msgSend_72Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Uint8)>>('objc_msgSend'); + late final __objc_msgSend_72 = __objc_msgSend_72Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, int)>(); + + late final ffi.Pointer _sel_initWithCString_length_1 = + _registerName1("initWithCString:length:"); + late final ffi.Pointer _sel_initWithCString_1 = + _registerName1("initWithCString:"); + late final ffi.Pointer _sel_stringWithCString_length_1 = + _registerName1("stringWithCString:length:"); + late final ffi.Pointer _sel_stringWithCString_1 = + _registerName1("stringWithCString:"); + late final ffi.Pointer _sel_getCharacters_1 = + _registerName1("getCharacters:"); + void _objc_msgSend_73( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + ) { + return __objc_msgSend_73( + obj, + sel, + buffer, + ); + } + + late final __objc_msgSend_73Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_73 = __objc_msgSend_73Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_74( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_74( + obj, + sel, + ); + } + + late final __objc_msgSend_74Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_74 = __objc_msgSend_74Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_debugDescription1 = + _registerName1("debugDescription"); + late final ffi.Pointer _sel_version1 = _registerName1("version"); + late final ffi.Pointer _sel_setVersion_1 = + _registerName1("setVersion:"); + void _objc_msgSend_75( + ffi.Pointer obj, + ffi.Pointer sel, + int aVersion, + ) { + return __objc_msgSend_75( + obj, + sel, + aVersion, + ); + } + + late final __objc_msgSend_75Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_75 = __objc_msgSend_75Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_classForCoder1 = + _registerName1("classForCoder"); + late final ffi.Pointer _sel_replacementObjectForCoder_1 = + _registerName1("replacementObjectForCoder:"); + late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = + _registerName1("awakeAfterUsingCoder:"); + late final ffi.Pointer _sel_poseAsClass_1 = + _registerName1("poseAsClass:"); + late final ffi.Pointer _sel_autoContentAccessingProxy1 = + _registerName1("autoContentAccessingProxy"); + late final ffi.Pointer _class_NSValue1 = _getClass1("NSValue"); + late final ffi.Pointer _sel_getValue_size_1 = + _registerName1("getValue:size:"); + void _objc_msgSend_76( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + int size, + ) { + return __objc_msgSend_76( + obj, + sel, + value, + size, + ); + } + + late final __objc_msgSend_76Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_76 = __objc_msgSend_76Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_objCType1 = _registerName1("objCType"); + late final ffi.Pointer _sel_initWithBytes_objCType_1 = + _registerName1("initWithBytes:objCType:"); + instancetype _objc_msgSend_77( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ffi.Pointer type, + ) { + return __objc_msgSend_77( + obj, + sel, + value, + type, + ); + } + + late final __objc_msgSend_77Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_77 = __objc_msgSend_77Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_valueWithBytes_objCType_1 = + _registerName1("valueWithBytes:objCType:"); + ffi.Pointer _objc_msgSend_78( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ffi.Pointer type, + ) { + return __objc_msgSend_78( + obj, + sel, + value, + type, + ); + } + + late final __objc_msgSend_78Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_78 = __objc_msgSend_78Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_value_withObjCType_1 = + _registerName1("value:withObjCType:"); + late final ffi.Pointer _sel_valueWithNonretainedObject_1 = + _registerName1("valueWithNonretainedObject:"); + ffi.Pointer _objc_msgSend_79( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ) { + return __objc_msgSend_79( + obj, + sel, + anObject, + ); + } + + late final __objc_msgSend_79Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_79 = __objc_msgSend_79Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_nonretainedObjectValue1 = + _registerName1("nonretainedObjectValue"); + late final ffi.Pointer _sel_valueWithPointer_1 = + _registerName1("valueWithPointer:"); + ffi.Pointer _objc_msgSend_80( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer pointer, + ) { + return __objc_msgSend_80( + obj, + sel, + pointer, + ); + } + + late final __objc_msgSend_80Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_pointerValue1 = + _registerName1("pointerValue"); + ffi.Pointer _objc_msgSend_81( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_81( + obj, + sel, + ); + } + + late final __objc_msgSend_81Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_81 = __objc_msgSend_81Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_isEqualToValue_1 = + _registerName1("isEqualToValue:"); + late final ffi.Pointer _sel_getValue_1 = _registerName1("getValue:"); + void _objc_msgSend_82( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_82( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_82Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_82 = __objc_msgSend_82Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_valueWithRange_1 = + _registerName1("valueWithRange:"); + ffi.Pointer _objc_msgSend_83( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_83( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_83Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_83 = __objc_msgSend_83Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final ffi.Pointer _sel_rangeValue1 = + _registerName1("rangeValue"); + NSRange _objc_msgSend_84( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_84( + obj, + sel, + ); + } + + late final __objc_msgSend_84Ptr = _lookup< + ffi.NativeFunction< + NSRange Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_84 = __objc_msgSend_84Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _class_NSNumber1 = _getClass1("NSNumber"); + late final ffi.Pointer _sel_initWithChar_1 = + _registerName1("initWithChar:"); + ffi.Pointer _objc_msgSend_85( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_85( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_85Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Char)>>('objc_msgSend'); + late final __objc_msgSend_85 = __objc_msgSend_85Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithUnsignedChar_1 = + _registerName1("initWithUnsignedChar:"); + ffi.Pointer _objc_msgSend_86( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_86( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_86Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedChar)>>('objc_msgSend'); + late final __objc_msgSend_86 = __objc_msgSend_86Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithShort_1 = + _registerName1("initWithShort:"); + ffi.Pointer _objc_msgSend_87( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_87( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_87Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Short)>>('objc_msgSend'); + late final __objc_msgSend_87 = __objc_msgSend_87Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithUnsignedShort_1 = + _registerName1("initWithUnsignedShort:"); + ffi.Pointer _objc_msgSend_88( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_88( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_88Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedShort)>>('objc_msgSend'); + late final __objc_msgSend_88 = __objc_msgSend_88Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithInt_1 = + _registerName1("initWithInt:"); + ffi.Pointer _objc_msgSend_89( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_89( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_89Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Int)>>('objc_msgSend'); + late final __objc_msgSend_89 = __objc_msgSend_89Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithUnsignedInt_1 = + _registerName1("initWithUnsignedInt:"); + ffi.Pointer _objc_msgSend_90( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_90( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_90Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_90 = __objc_msgSend_90Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithLong_1 = + _registerName1("initWithLong:"); + ffi.Pointer _objc_msgSend_91( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_91( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_91Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Long)>>('objc_msgSend'); + late final __objc_msgSend_91 = __objc_msgSend_91Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithUnsignedLong_1 = + _registerName1("initWithUnsignedLong:"); + ffi.Pointer _objc_msgSend_92( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_92( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_92Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_92 = __objc_msgSend_92Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithLongLong_1 = + _registerName1("initWithLongLong:"); + ffi.Pointer _objc_msgSend_93( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_93( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_93Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.LongLong)>>('objc_msgSend'); + late final __objc_msgSend_93 = __objc_msgSend_93Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithUnsignedLongLong_1 = + _registerName1("initWithUnsignedLongLong:"); + ffi.Pointer _objc_msgSend_94( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_94( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_94Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedLongLong)>>('objc_msgSend'); + late final __objc_msgSend_94 = __objc_msgSend_94Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithFloat_1 = + _registerName1("initWithFloat:"); + ffi.Pointer _objc_msgSend_95( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_95( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_95Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Float)>>('objc_msgSend'); + late final __objc_msgSend_95 = __objc_msgSend_95Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); + + late final ffi.Pointer _sel_initWithDouble_1 = + _registerName1("initWithDouble:"); + ffi.Pointer _objc_msgSend_96( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_96( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_96Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_96 = __objc_msgSend_96Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); + + late final ffi.Pointer _sel_initWithBool_1 = + _registerName1("initWithBool:"); + ffi.Pointer _objc_msgSend_97( + ffi.Pointer obj, + ffi.Pointer sel, + bool value, + ) { + return __objc_msgSend_97( + obj, + sel, + value ? 1 : 0, + ); + } + + late final __objc_msgSend_97Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); + late final __objc_msgSend_97 = __objc_msgSend_97Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithInteger_1 = + _registerName1("initWithInteger:"); + late final ffi.Pointer _sel_initWithUnsignedInteger_1 = + _registerName1("initWithUnsignedInteger:"); + late final ffi.Pointer _sel_charValue1 = _registerName1("charValue"); + int _objc_msgSend_98( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_98( + obj, + sel, + ); + } + + late final __objc_msgSend_98Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.Char Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_98 = __objc_msgSend_98Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_unsignedCharValue1 = + _registerName1("unsignedCharValue"); + int _objc_msgSend_99( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_99( + obj, + sel, + ); + } + + late final __objc_msgSend_99Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedChar Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_99 = __objc_msgSend_99Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_shortValue1 = + _registerName1("shortValue"); + int _objc_msgSend_100( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_100( + obj, + sel, + ); + } + + late final __objc_msgSend_100Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.Short Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_100 = __objc_msgSend_100Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_unsignedShortValue1 = + _registerName1("unsignedShortValue"); + int _objc_msgSend_101( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_101( + obj, + sel, + ); + } + + late final __objc_msgSend_101Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedShort Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_101 = __objc_msgSend_101Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_unsignedIntValue1 = + _registerName1("unsignedIntValue"); + int _objc_msgSend_102( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_102( + obj, + sel, + ); + } + + late final __objc_msgSend_102Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedInt Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_102 = __objc_msgSend_102Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_longValue1 = _registerName1("longValue"); + late final ffi.Pointer _sel_unsignedLongValue1 = + _registerName1("unsignedLongValue"); + late final ffi.Pointer _sel_unsignedLongLongValue1 = + _registerName1("unsignedLongLongValue"); + int _objc_msgSend_103( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_103( + obj, + sel, + ); + } + + late final __objc_msgSend_103Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedLongLong Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_103 = __objc_msgSend_103Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_unsignedIntegerValue1 = + _registerName1("unsignedIntegerValue"); + late final ffi.Pointer _sel_stringValue1 = + _registerName1("stringValue"); + late final ffi.Pointer _sel_isEqualToNumber_1 = + _registerName1("isEqualToNumber:"); + late final ffi.Pointer _sel_descriptionWithLocale_1 = + _registerName1("descriptionWithLocale:"); + late final ffi.Pointer _sel_numberWithChar_1 = + _registerName1("numberWithChar:"); + late final ffi.Pointer _sel_numberWithUnsignedChar_1 = + _registerName1("numberWithUnsignedChar:"); + late final ffi.Pointer _sel_numberWithShort_1 = + _registerName1("numberWithShort:"); + late final ffi.Pointer _sel_numberWithUnsignedShort_1 = + _registerName1("numberWithUnsignedShort:"); + late final ffi.Pointer _sel_numberWithInt_1 = + _registerName1("numberWithInt:"); + late final ffi.Pointer _sel_numberWithUnsignedInt_1 = + _registerName1("numberWithUnsignedInt:"); + late final ffi.Pointer _sel_numberWithLong_1 = + _registerName1("numberWithLong:"); + late final ffi.Pointer _sel_numberWithUnsignedLong_1 = + _registerName1("numberWithUnsignedLong:"); + late final ffi.Pointer _sel_numberWithLongLong_1 = + _registerName1("numberWithLongLong:"); + late final ffi.Pointer _sel_numberWithUnsignedLongLong_1 = + _registerName1("numberWithUnsignedLongLong:"); + late final ffi.Pointer _sel_numberWithFloat_1 = + _registerName1("numberWithFloat:"); + late final ffi.Pointer _sel_numberWithDouble_1 = + _registerName1("numberWithDouble:"); + late final ffi.Pointer _sel_numberWithBool_1 = + _registerName1("numberWithBool:"); + late final ffi.Pointer _sel_numberWithInteger_1 = + _registerName1("numberWithInteger:"); + late final ffi.Pointer _sel_numberWithUnsignedInteger_1 = + _registerName1("numberWithUnsignedInteger:"); + late final ffi.Pointer _class_NSEnumerator1 = + _getClass1("NSEnumerator"); + late final ffi.Pointer _sel_nextObject1 = + _registerName1("nextObject"); + late final ffi.Pointer _sel_allObjects1 = + _registerName1("allObjects"); + late final ffi.Pointer _class_NSArray1 = _getClass1("NSArray"); + late final ffi.Pointer _sel_count1 = _registerName1("count"); + late final ffi.Pointer _sel_objectAtIndex_1 = + _registerName1("objectAtIndex:"); + ffi.Pointer _objc_msgSend_104( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_104( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_104Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_104 = __objc_msgSend_104Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithObjects_count_1 = + _registerName1("initWithObjects:count:"); + instancetype _objc_msgSend_105( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + int cnt, + ) { + return __objc_msgSend_105( + obj, + sel, + objects, + cnt, + ); + } + + late final __objc_msgSend_105Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_105 = __objc_msgSend_105Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, int)>(); + + late final ffi.Pointer _sel_componentsJoinedByString_1 = + _registerName1("componentsJoinedByString:"); + late final ffi.Pointer _sel_containsObject_1 = + _registerName1("containsObject:"); + late final ffi.Pointer _sel_descriptionWithLocale_indent_1 = + _registerName1("descriptionWithLocale:indent:"); + ffi.Pointer _objc_msgSend_106( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer locale, + int level, + ) { + return __objc_msgSend_106( + obj, + sel, + locale, + level, + ); + } + + late final __objc_msgSend_106Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_106 = __objc_msgSend_106Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_firstObjectCommonWithArray_1 = + _registerName1("firstObjectCommonWithArray:"); + late final ffi.Pointer _sel_getObjects_range_1 = + _registerName1("getObjects:range:"); + void _objc_msgSend_107( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + NSRange range, + ) { + return __objc_msgSend_107( + obj, + sel, + objects, + range, + ); + } + + late final __objc_msgSend_107Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_107 = __objc_msgSend_107Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, NSRange)>(); + + late final ffi.Pointer _sel_indexOfObject_1 = + _registerName1("indexOfObject:"); + int _objc_msgSend_108( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ) { + return __objc_msgSend_108( + obj, + sel, + anObject, + ); + } + + late final __objc_msgSend_108Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_108 = __objc_msgSend_108Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_indexOfObject_inRange_1 = + _registerName1("indexOfObject:inRange:"); + int _objc_msgSend_109( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + NSRange range, + ) { + return __objc_msgSend_109( + obj, + sel, + anObject, + range, + ); + } + + late final __objc_msgSend_109Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_109 = __objc_msgSend_109Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>(); + + late final ffi.Pointer _sel_indexOfObjectIdenticalTo_1 = + _registerName1("indexOfObjectIdenticalTo:"); + late final ffi.Pointer _sel_indexOfObjectIdenticalTo_inRange_1 = + _registerName1("indexOfObjectIdenticalTo:inRange:"); + late final ffi.Pointer _sel_isEqualToArray_1 = + _registerName1("isEqualToArray:"); + late final ffi.Pointer _sel_firstObject1 = + _registerName1("firstObject"); + late final ffi.Pointer _sel_lastObject1 = + _registerName1("lastObject"); + late final ffi.Pointer _sel_sortedArrayHint1 = + _registerName1("sortedArrayHint"); + late final ffi.Pointer _sel_writeToURL_error_1 = + _registerName1("writeToURL:error:"); + bool _objc_msgSend_110( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer> error, + ) { + return __objc_msgSend_110( + obj, + sel, + url, + error, + ) != + 0; + } + + late final __objc_msgSend_110Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_110 = __objc_msgSend_110Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final ffi.Pointer _sel_makeObjectsPerformSelector_1 = + _registerName1("makeObjectsPerformSelector:"); + late final ffi.Pointer _sel_makeObjectsPerformSelector_withObject_1 = + _registerName1("makeObjectsPerformSelector:withObject:"); + void _objc_msgSend_111( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer argument, + ) { + return __objc_msgSend_111( + obj, + sel, + aSelector, + argument, + ); + } + + late final __objc_msgSend_111Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_111 = __objc_msgSend_111Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_objectAtIndexedSubscript_1 = + _registerName1("objectAtIndexedSubscript:"); + late final ffi.Pointer _sel_enumerateObjectsUsingBlock_1 = + _registerName1("enumerateObjectsUsingBlock:"); + late final ffi.Pointer + _sel_enumerateObjectsWithOptions_usingBlock_1 = + _registerName1("enumerateObjectsWithOptions:usingBlock:"); + void _objc_msgSend_112( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer block, + ) { + return __objc_msgSend_112( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_112Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_112 = __objc_msgSend_112Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final ffi.Pointer + _sel_enumerateObjectsAtIndexes_options_usingBlock_1 = + _registerName1("enumerateObjectsAtIndexes:options:usingBlock:"); + void _objc_msgSend_113( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer s, + int opts, + ffi.Pointer block, + ) { + return __objc_msgSend_113( + obj, + sel, + s, + opts, + block, + ); + } + + late final __objc_msgSend_113Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_113 = __objc_msgSend_113Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final ffi.Pointer _sel_indexOfObjectPassingTest_1 = + _registerName1("indexOfObjectPassingTest:"); + late final ffi.Pointer _sel_indexOfObjectWithOptions_passingTest_1 = + _registerName1("indexOfObjectWithOptions:passingTest:"); + int _objc_msgSend_114( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer predicate, + ) { + return __objc_msgSend_114( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_114Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_114 = __objc_msgSend_114Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final ffi.Pointer + _sel_indexOfObjectAtIndexes_options_passingTest_1 = + _registerName1("indexOfObjectAtIndexes:options:passingTest:"); + int _objc_msgSend_115( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer s, + int opts, + ffi.Pointer predicate, + ) { + return __objc_msgSend_115( + obj, + sel, + s, + opts, + predicate, + ); + } + + late final __objc_msgSend_115Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_115 = __objc_msgSend_115Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final ffi.Pointer _class_NSIndexSet1 = + _getClass1("NSIndexSet"); + late final ffi.Pointer _sel_indexSet1 = _registerName1("indexSet"); + late final ffi.Pointer _sel_indexSetWithIndex_1 = + _registerName1("indexSetWithIndex:"); + late final ffi.Pointer _sel_indexSetWithIndexesInRange_1 = + _registerName1("indexSetWithIndexesInRange:"); + instancetype _objc_msgSend_116( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_116( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_116Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_116 = __objc_msgSend_116Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final ffi.Pointer _sel_initWithIndexesInRange_1 = + _registerName1("initWithIndexesInRange:"); + late final ffi.Pointer _sel_initWithIndexSet_1 = + _registerName1("initWithIndexSet:"); + late final ffi.Pointer _sel_initWithIndex_1 = + _registerName1("initWithIndex:"); + late final ffi.Pointer _sel_isEqualToIndexSet_1 = + _registerName1("isEqualToIndexSet:"); + late final ffi.Pointer _sel_firstIndex1 = + _registerName1("firstIndex"); + late final ffi.Pointer _sel_lastIndex1 = _registerName1("lastIndex"); + late final ffi.Pointer _sel_indexGreaterThanIndex_1 = + _registerName1("indexGreaterThanIndex:"); + late final ffi.Pointer _sel_indexLessThanIndex_1 = + _registerName1("indexLessThanIndex:"); + late final ffi.Pointer _sel_indexGreaterThanOrEqualToIndex_1 = + _registerName1("indexGreaterThanOrEqualToIndex:"); + late final ffi.Pointer _sel_indexLessThanOrEqualToIndex_1 = + _registerName1("indexLessThanOrEqualToIndex:"); + late final ffi.Pointer _sel_getIndexes_maxCount_inIndexRange_1 = + _registerName1("getIndexes:maxCount:inIndexRange:"); + int _objc_msgSend_117( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexBuffer, + int bufferSize, + NSRangePointer range, + ) { + return __objc_msgSend_117( + obj, + sel, + indexBuffer, + bufferSize, + range, + ); + } + + late final __objc_msgSend_117Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSRangePointer)>>('objc_msgSend'); + late final __objc_msgSend_117 = __objc_msgSend_117Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRangePointer)>(); + + late final ffi.Pointer _sel_countOfIndexesInRange_1 = + _registerName1("countOfIndexesInRange:"); + int _objc_msgSend_118( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_118( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_118Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_118 = __objc_msgSend_118Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final ffi.Pointer _sel_containsIndex_1 = + _registerName1("containsIndex:"); + late final ffi.Pointer _sel_containsIndexesInRange_1 = + _registerName1("containsIndexesInRange:"); + bool _objc_msgSend_119( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_119( + obj, + sel, + range, + ) != + 0; + } + + late final __objc_msgSend_119Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_119 = __objc_msgSend_119Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final ffi.Pointer _sel_containsIndexes_1 = + _registerName1("containsIndexes:"); + late final ffi.Pointer _sel_intersectsIndexesInRange_1 = + _registerName1("intersectsIndexesInRange:"); + late final ffi.Pointer _sel_enumerateIndexesUsingBlock_1 = + _registerName1("enumerateIndexesUsingBlock:"); + late final ffi.Pointer + _sel_enumerateIndexesWithOptions_usingBlock_1 = + _registerName1("enumerateIndexesWithOptions:usingBlock:"); + late final ffi.Pointer + _sel_enumerateIndexesInRange_options_usingBlock_1 = + _registerName1("enumerateIndexesInRange:options:usingBlock:"); + void _objc_msgSend_120( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer block, + ) { + return __objc_msgSend_120( + obj, + sel, + range, + opts, + block, + ); + } + + late final __objc_msgSend_120Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_120 = __objc_msgSend_120Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_indexPassingTest_1 = + _registerName1("indexPassingTest:"); + late final ffi.Pointer _sel_indexWithOptions_passingTest_1 = + _registerName1("indexWithOptions:passingTest:"); + late final ffi.Pointer _sel_indexInRange_options_passingTest_1 = + _registerName1("indexInRange:options:passingTest:"); + int _objc_msgSend_121( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer predicate, + ) { + return __objc_msgSend_121( + obj, + sel, + range, + opts, + predicate, + ); + } + + late final __objc_msgSend_121Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_121 = __objc_msgSend_121Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_indexesPassingTest_1 = + _registerName1("indexesPassingTest:"); + ffi.Pointer _objc_msgSend_122( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicate, + ) { + return __objc_msgSend_122( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_122Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_122 = __objc_msgSend_122Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_indexesWithOptions_passingTest_1 = + _registerName1("indexesWithOptions:passingTest:"); + ffi.Pointer _objc_msgSend_123( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer predicate, + ) { + return __objc_msgSend_123( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_123Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_123 = __objc_msgSend_123Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final ffi.Pointer _sel_indexesInRange_options_passingTest_1 = + _registerName1("indexesInRange:options:passingTest:"); + ffi.Pointer _objc_msgSend_124( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer predicate, + ) { + return __objc_msgSend_124( + obj, + sel, + range, + opts, + predicate, + ); + } + + late final __objc_msgSend_124Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_124 = __objc_msgSend_124Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, int, ffi.Pointer)>(); + + late final ffi.Pointer _sel_enumerateRangesUsingBlock_1 = + _registerName1("enumerateRangesUsingBlock:"); + late final ffi.Pointer _sel_enumerateRangesWithOptions_usingBlock_1 = + _registerName1("enumerateRangesWithOptions:usingBlock:"); + late final ffi.Pointer + _sel_enumerateRangesInRange_options_usingBlock_1 = + _registerName1("enumerateRangesInRange:options:usingBlock:"); + late final ffi.Pointer _sel_indexesOfObjectsPassingTest_1 = + _registerName1("indexesOfObjectsPassingTest:"); + late final ffi.Pointer + _sel_indexesOfObjectsWithOptions_passingTest_1 = + _registerName1("indexesOfObjectsWithOptions:passingTest:"); + late final ffi.Pointer + _sel_indexesOfObjectsAtIndexes_options_passingTest_1 = + _registerName1("indexesOfObjectsAtIndexes:options:passingTest:"); + ffi.Pointer _objc_msgSend_125( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer s, + int opts, + ffi.Pointer predicate, + ) { + return __objc_msgSend_125( + obj, + sel, + s, + opts, + predicate, + ); + } + + late final __objc_msgSend_125Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_125 = __objc_msgSend_125Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final ffi.Pointer + _sel_indexOfObject_inSortedRange_options_usingComparator_1 = + _registerName1("indexOfObject:inSortedRange:options:usingComparator:"); + int _objc_msgSend_126( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer obj1, + NSRange r, + int opts, + NSComparator cmp, + ) { + return __objc_msgSend_126( + obj, + sel, + obj1, + r, + opts, + cmp, + ); + } + + late final __objc_msgSend_126Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Int32, + NSComparator)>>('objc_msgSend'); + late final __objc_msgSend_126 = __objc_msgSend_126Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange, int, NSComparator)>(); + + late final ffi.Pointer _sel_array1 = _registerName1("array"); + late final ffi.Pointer _sel_arrayWithObject_1 = + _registerName1("arrayWithObject:"); + late final ffi.Pointer _sel_arrayWithObjects_count_1 = + _registerName1("arrayWithObjects:count:"); + late final ffi.Pointer _sel_arrayWithObjects_1 = + _registerName1("arrayWithObjects:"); + late final ffi.Pointer _sel_arrayWithArray_1 = + _registerName1("arrayWithArray:"); + late final ffi.Pointer _sel_initWithObjects_1 = + _registerName1("initWithObjects:"); + late final ffi.Pointer _sel_initWithArray_1 = + _registerName1("initWithArray:"); + late final ffi.Pointer _sel_initWithArray_copyItems_1 = + _registerName1("initWithArray:copyItems:"); + instancetype _objc_msgSend_127( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer array, + bool flag, + ) { + return __objc_msgSend_127( + obj, + sel, + array, + flag ? 1 : 0, + ); + } + + late final __objc_msgSend_127Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); + late final __objc_msgSend_127 = __objc_msgSend_127Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_getObjects_1 = + _registerName1("getObjects:"); + void _objc_msgSend_128( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + ) { + return __objc_msgSend_128( + obj, + sel, + objects, + ); + } + + late final __objc_msgSend_128Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_128 = __objc_msgSend_128Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>(); + + late final ffi.Pointer _class_NSMutableArray1 = + _getClass1("NSMutableArray"); + late final ffi.Pointer _sel_addObject_1 = + _registerName1("addObject:"); + late final ffi.Pointer _sel_insertObject_atIndex_1 = + _registerName1("insertObject:atIndex:"); + void _objc_msgSend_129( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + int index, + ) { + return __objc_msgSend_129( + obj, + sel, + anObject, + index, + ); + } + + late final __objc_msgSend_129Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_129 = __objc_msgSend_129Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_removeLastObject1 = + _registerName1("removeLastObject"); + late final ffi.Pointer _sel_removeObjectAtIndex_1 = + _registerName1("removeObjectAtIndex:"); + late final ffi.Pointer _sel_replaceObjectAtIndex_withObject_1 = + _registerName1("replaceObjectAtIndex:withObject:"); + void _objc_msgSend_130( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer anObject, + ) { + return __objc_msgSend_130( + obj, + sel, + index, + anObject, + ); + } + + late final __objc_msgSend_130Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_130 = __objc_msgSend_130Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_initWithCapacity_1 = + _registerName1("initWithCapacity:"); + late final ffi.Pointer _sel_addObjectsFromArray_1 = + _registerName1("addObjectsFromArray:"); + late final ffi.Pointer + _sel_exchangeObjectAtIndex_withObjectAtIndex_1 = + _registerName1("exchangeObjectAtIndex:withObjectAtIndex:"); + void _objc_msgSend_131( + ffi.Pointer obj, + ffi.Pointer sel, + int idx1, + int idx2, + ) { + return __objc_msgSend_131( + obj, + sel, + idx1, + idx2, + ); + } + + late final __objc_msgSend_131Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_131 = __objc_msgSend_131Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, int)>(); + + late final ffi.Pointer _sel_removeAllObjects1 = + _registerName1("removeAllObjects"); + late final ffi.Pointer _sel_removeObject_inRange_1 = + _registerName1("removeObject:inRange:"); + void _objc_msgSend_132( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + NSRange range, + ) { + return __objc_msgSend_132( + obj, + sel, + anObject, + range, + ); + } + + late final __objc_msgSend_132Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_132 = __objc_msgSend_132Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>(); + + late final ffi.Pointer _sel_removeObject_1 = + _registerName1("removeObject:"); + late final ffi.Pointer _sel_removeObjectIdenticalTo_inRange_1 = + _registerName1("removeObjectIdenticalTo:inRange:"); + late final ffi.Pointer _sel_removeObjectIdenticalTo_1 = + _registerName1("removeObjectIdenticalTo:"); + late final ffi.Pointer _sel_removeObjectsFromIndices_numIndices_1 = + _registerName1("removeObjectsFromIndices:numIndices:"); + void _objc_msgSend_133( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indices, + int cnt, + ) { + return __objc_msgSend_133( + obj, + sel, + indices, + cnt, + ); + } + + late final __objc_msgSend_133Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_133 = __objc_msgSend_133Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_removeObjectsInArray_1 = + _registerName1("removeObjectsInArray:"); + late final ffi.Pointer _sel_removeObjectsInRange_1 = + _registerName1("removeObjectsInRange:"); + void _objc_msgSend_134( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_134( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_134Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_134 = __objc_msgSend_134Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final ffi.Pointer + _sel_replaceObjectsInRange_withObjectsFromArray_range_1 = + _registerName1("replaceObjectsInRange:withObjectsFromArray:range:"); + void _objc_msgSend_135( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer otherArray, + NSRange otherRange, + ) { + return __objc_msgSend_135( + obj, + sel, + range, + otherArray, + otherRange, + ); + } + + late final __objc_msgSend_135Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_135 = __objc_msgSend_135Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, + ffi.Pointer, NSRange)>(); + + late final ffi.Pointer + _sel_replaceObjectsInRange_withObjectsFromArray_1 = + _registerName1("replaceObjectsInRange:withObjectsFromArray:"); + void _objc_msgSend_136( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer otherArray, + ) { + return __objc_msgSend_136( + obj, + sel, + range, + otherArray, + ); + } + + late final __objc_msgSend_136Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_136 = __objc_msgSend_136Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_setArray_1 = _registerName1("setArray:"); + late final ffi.Pointer _sel_sortUsingFunction_context_1 = + _registerName1("sortUsingFunction:context:"); + void _objc_msgSend_137( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + compare, + ffi.Pointer context, + ) { + return __objc_msgSend_137( + obj, + sel, + compare, + context, + ); + } + + late final __objc_msgSend_137Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_137 = __objc_msgSend_137Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_sortUsingSelector_1 = + _registerName1("sortUsingSelector:"); + late final ffi.Pointer _sel_insertObjects_atIndexes_1 = + _registerName1("insertObjects:atIndexes:"); + void _objc_msgSend_138( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer objects, + ffi.Pointer indexes, + ) { + return __objc_msgSend_138( + obj, + sel, + objects, + indexes, + ); + } + + late final __objc_msgSend_138Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_138 = __objc_msgSend_138Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_removeObjectsAtIndexes_1 = + _registerName1("removeObjectsAtIndexes:"); + late final ffi.Pointer _sel_replaceObjectsAtIndexes_withObjects_1 = + _registerName1("replaceObjectsAtIndexes:withObjects:"); + late final ffi.Pointer _sel_setObject_atIndexedSubscript_1 = + _registerName1("setObject:atIndexedSubscript:"); + late final ffi.Pointer _sel_sortUsingComparator_1 = + _registerName1("sortUsingComparator:"); + late final ffi.Pointer _sel_sortWithOptions_usingComparator_1 = + _registerName1("sortWithOptions:usingComparator:"); + void _objc_msgSend_139( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + NSComparator cmptr, + ) { + return __objc_msgSend_139( + obj, + sel, + opts, + cmptr, + ); + } + + late final __objc_msgSend_139Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, NSComparator)>>('objc_msgSend'); + late final __objc_msgSend_139 = __objc_msgSend_139Ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, int, NSComparator)>(); + + late final ffi.Pointer _sel_arrayWithCapacity_1 = + _registerName1("arrayWithCapacity:"); + late final ffi.Pointer _sel_applyDifference_1 = + _registerName1("applyDifference:"); late final ffi.Pointer> _NSItemProviderPreferredImageSizeKey = _lookup>('NSItemProviderPreferredImageSizeKey'); - ffi.Pointer get NSItemProviderPreferredImageSizeKey => - _NSItemProviderPreferredImageSizeKey.value; + ffi.Pointer get NSItemProviderPreferredImageSizeKey => + _NSItemProviderPreferredImageSizeKey.value; + + set NSItemProviderPreferredImageSizeKey(ffi.Pointer value) => + _NSItemProviderPreferredImageSizeKey.value = value; + + late final ffi.Pointer _class_NSItemProvider1 = + _getClass1("NSItemProvider"); + late final ffi.Pointer + _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1 = + _registerName1( + "registerDataRepresentationForTypeIdentifier:visibility:loadHandler:"); + void _objc_msgSend_140( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + int visibility, + ffi.Pointer loadHandler, + ) { + return __objc_msgSend_140( + obj, + sel, + typeIdentifier, + visibility, + loadHandler, + ); + } + + late final __objc_msgSend_140Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_140 = __objc_msgSend_140Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final ffi.Pointer + _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1 = + _registerName1( + "registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:"); + void _objc_msgSend_141( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + int fileOptions, + int visibility, + ffi.Pointer loadHandler, + ) { + return __objc_msgSend_141( + obj, + sel, + typeIdentifier, + fileOptions, + visibility, + loadHandler, + ); + } + + late final __objc_msgSend_141Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_141 = __objc_msgSend_141Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer)>(); + + late final ffi.Pointer _sel_registeredTypeIdentifiers1 = + _registerName1("registeredTypeIdentifiers"); + late final ffi.Pointer _sel_hasItemConformingToTypeIdentifier_1 = + _registerName1("hasItemConformingToTypeIdentifier:"); + late final ffi.Pointer + _sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1 = + _registerName1( + "hasRepresentationConformingToTypeIdentifier:fileOptions:"); + bool _objc_msgSend_142( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + int fileOptions, + ) { + return __objc_msgSend_142( + obj, + sel, + typeIdentifier, + fileOptions, + ) != + 0; + } + + late final __objc_msgSend_142Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_142 = __objc_msgSend_142Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final ffi.Pointer _class_NSProgress1 = + _getClass1("NSProgress"); + late final ffi.Pointer + _sel_loadDataRepresentationForTypeIdentifier_completionHandler_1 = + _registerName1( + "loadDataRepresentationForTypeIdentifier:completionHandler:"); + ffi.Pointer _objc_msgSend_143( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer completionHandler, + ) { + return __objc_msgSend_143( + obj, + sel, + typeIdentifier, + completionHandler, + ); + } + + late final __objc_msgSend_143Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_143 = __objc_msgSend_143Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer + _sel_loadFileRepresentationForTypeIdentifier_completionHandler_1 = + _registerName1( + "loadFileRepresentationForTypeIdentifier:completionHandler:"); + late final ffi.Pointer + _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1 = + _registerName1( + "loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:"); + late final ffi.Pointer _sel_suggestedName1 = + _registerName1("suggestedName"); + late final ffi.Pointer _sel_setSuggestedName_1 = + _registerName1("setSuggestedName:"); + late final ffi.Pointer _sel_initWithObject_1 = + _registerName1("initWithObject:"); + late final ffi.Pointer _sel_registerObject_visibility_1 = + _registerName1("registerObject:visibility:"); + void _objc_msgSend_144( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer object, + int visibility, + ) { + return __objc_msgSend_144( + obj, + sel, + object, + visibility, + ); + } + + late final __objc_msgSend_144Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_144 = __objc_msgSend_144Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final ffi.Pointer + _sel_registerObjectOfClass_visibility_loadHandler_1 = + _registerName1("registerObjectOfClass:visibility:loadHandler:"); + late final ffi.Pointer _sel_canLoadObjectOfClass_1 = + _registerName1("canLoadObjectOfClass:"); + late final ffi.Pointer _sel_loadObjectOfClass_completionHandler_1 = + _registerName1("loadObjectOfClass:completionHandler:"); + late final ffi.Pointer _sel_initWithItem_typeIdentifier_1 = + _registerName1("initWithItem:typeIdentifier:"); + late final ffi.Pointer + _sel_registerItemForTypeIdentifier_loadHandler_1 = + _registerName1("registerItemForTypeIdentifier:loadHandler:"); + late final ffi.Pointer + _sel_loadItemForTypeIdentifier_options_completionHandler_1 = + _registerName1("loadItemForTypeIdentifier:options:completionHandler:"); + void _objc_msgSend_145( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer options, + NSItemProviderCompletionHandler completionHandler, + ) { + return __objc_msgSend_145( + obj, + sel, + typeIdentifier, + options, + completionHandler, + ); + } + + late final __objc_msgSend_145Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler)>>('objc_msgSend'); + late final __objc_msgSend_145 = __objc_msgSend_145Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler)>(); + + late final ffi.Pointer _sel_previewImageHandler1 = + _registerName1("previewImageHandler"); + late final ffi.Pointer _sel_setPreviewImageHandler_1 = + _registerName1("setPreviewImageHandler:"); + late final ffi.Pointer + _sel_loadPreviewImageWithOptions_completionHandler_1 = + _registerName1("loadPreviewImageWithOptions:completionHandler:"); + late final ffi.Pointer> + _NSExtensionJavaScriptPreprocessingResultsKey = + _lookup>( + 'NSExtensionJavaScriptPreprocessingResultsKey'); + + ffi.Pointer get NSExtensionJavaScriptPreprocessingResultsKey => + _NSExtensionJavaScriptPreprocessingResultsKey.value; + + set NSExtensionJavaScriptPreprocessingResultsKey( + ffi.Pointer value) => + _NSExtensionJavaScriptPreprocessingResultsKey.value = value; + + late final ffi.Pointer> + _NSExtensionJavaScriptFinalizeArgumentKey = + _lookup>( + 'NSExtensionJavaScriptFinalizeArgumentKey'); + + ffi.Pointer get NSExtensionJavaScriptFinalizeArgumentKey => + _NSExtensionJavaScriptFinalizeArgumentKey.value; + + set NSExtensionJavaScriptFinalizeArgumentKey(ffi.Pointer value) => + _NSExtensionJavaScriptFinalizeArgumentKey.value = value; + + late final ffi.Pointer> _NSItemProviderErrorDomain = + _lookup>('NSItemProviderErrorDomain'); + + ffi.Pointer get NSItemProviderErrorDomain => + _NSItemProviderErrorDomain.value; + + set NSItemProviderErrorDomain(ffi.Pointer value) => + _NSItemProviderErrorDomain.value = value; + + late final ffi.Pointer _NSStringTransformLatinToKatakana = + _lookup('NSStringTransformLatinToKatakana'); + + NSStringTransform get NSStringTransformLatinToKatakana => + _NSStringTransformLatinToKatakana.value; + + set NSStringTransformLatinToKatakana(NSStringTransform value) => + _NSStringTransformLatinToKatakana.value = value; + + late final ffi.Pointer _NSStringTransformLatinToHiragana = + _lookup('NSStringTransformLatinToHiragana'); + + NSStringTransform get NSStringTransformLatinToHiragana => + _NSStringTransformLatinToHiragana.value; + + set NSStringTransformLatinToHiragana(NSStringTransform value) => + _NSStringTransformLatinToHiragana.value = value; + + late final ffi.Pointer _NSStringTransformLatinToHangul = + _lookup('NSStringTransformLatinToHangul'); + + NSStringTransform get NSStringTransformLatinToHangul => + _NSStringTransformLatinToHangul.value; + + set NSStringTransformLatinToHangul(NSStringTransform value) => + _NSStringTransformLatinToHangul.value = value; + + late final ffi.Pointer _NSStringTransformLatinToArabic = + _lookup('NSStringTransformLatinToArabic'); + + NSStringTransform get NSStringTransformLatinToArabic => + _NSStringTransformLatinToArabic.value; + + set NSStringTransformLatinToArabic(NSStringTransform value) => + _NSStringTransformLatinToArabic.value = value; + + late final ffi.Pointer _NSStringTransformLatinToHebrew = + _lookup('NSStringTransformLatinToHebrew'); + + NSStringTransform get NSStringTransformLatinToHebrew => + _NSStringTransformLatinToHebrew.value; + + set NSStringTransformLatinToHebrew(NSStringTransform value) => + _NSStringTransformLatinToHebrew.value = value; + + late final ffi.Pointer _NSStringTransformLatinToThai = + _lookup('NSStringTransformLatinToThai'); + + NSStringTransform get NSStringTransformLatinToThai => + _NSStringTransformLatinToThai.value; + + set NSStringTransformLatinToThai(NSStringTransform value) => + _NSStringTransformLatinToThai.value = value; + + late final ffi.Pointer _NSStringTransformLatinToCyrillic = + _lookup('NSStringTransformLatinToCyrillic'); + + NSStringTransform get NSStringTransformLatinToCyrillic => + _NSStringTransformLatinToCyrillic.value; + + set NSStringTransformLatinToCyrillic(NSStringTransform value) => + _NSStringTransformLatinToCyrillic.value = value; + + late final ffi.Pointer _NSStringTransformLatinToGreek = + _lookup('NSStringTransformLatinToGreek'); + + NSStringTransform get NSStringTransformLatinToGreek => + _NSStringTransformLatinToGreek.value; + + set NSStringTransformLatinToGreek(NSStringTransform value) => + _NSStringTransformLatinToGreek.value = value; + + late final ffi.Pointer _NSStringTransformToLatin = + _lookup('NSStringTransformToLatin'); + + NSStringTransform get NSStringTransformToLatin => + _NSStringTransformToLatin.value; + + set NSStringTransformToLatin(NSStringTransform value) => + _NSStringTransformToLatin.value = value; + + late final ffi.Pointer _NSStringTransformMandarinToLatin = + _lookup('NSStringTransformMandarinToLatin'); + + NSStringTransform get NSStringTransformMandarinToLatin => + _NSStringTransformMandarinToLatin.value; + + set NSStringTransformMandarinToLatin(NSStringTransform value) => + _NSStringTransformMandarinToLatin.value = value; + + late final ffi.Pointer + _NSStringTransformHiraganaToKatakana = + _lookup('NSStringTransformHiraganaToKatakana'); + + NSStringTransform get NSStringTransformHiraganaToKatakana => + _NSStringTransformHiraganaToKatakana.value; + + set NSStringTransformHiraganaToKatakana(NSStringTransform value) => + _NSStringTransformHiraganaToKatakana.value = value; + + late final ffi.Pointer + _NSStringTransformFullwidthToHalfwidth = + _lookup('NSStringTransformFullwidthToHalfwidth'); + + NSStringTransform get NSStringTransformFullwidthToHalfwidth => + _NSStringTransformFullwidthToHalfwidth.value; + + set NSStringTransformFullwidthToHalfwidth(NSStringTransform value) => + _NSStringTransformFullwidthToHalfwidth.value = value; + + late final ffi.Pointer _NSStringTransformToXMLHex = + _lookup('NSStringTransformToXMLHex'); + + NSStringTransform get NSStringTransformToXMLHex => + _NSStringTransformToXMLHex.value; + + set NSStringTransformToXMLHex(NSStringTransform value) => + _NSStringTransformToXMLHex.value = value; + + late final ffi.Pointer _NSStringTransformToUnicodeName = + _lookup('NSStringTransformToUnicodeName'); + + NSStringTransform get NSStringTransformToUnicodeName => + _NSStringTransformToUnicodeName.value; + + set NSStringTransformToUnicodeName(NSStringTransform value) => + _NSStringTransformToUnicodeName.value = value; + + late final ffi.Pointer + _NSStringTransformStripCombiningMarks = + _lookup('NSStringTransformStripCombiningMarks'); + + NSStringTransform get NSStringTransformStripCombiningMarks => + _NSStringTransformStripCombiningMarks.value; + + set NSStringTransformStripCombiningMarks(NSStringTransform value) => + _NSStringTransformStripCombiningMarks.value = value; + + late final ffi.Pointer _NSStringTransformStripDiacritics = + _lookup('NSStringTransformStripDiacritics'); + + NSStringTransform get NSStringTransformStripDiacritics => + _NSStringTransformStripDiacritics.value; + + set NSStringTransformStripDiacritics(NSStringTransform value) => + _NSStringTransformStripDiacritics.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionSuggestedEncodingsKey = + _lookup( + 'NSStringEncodingDetectionSuggestedEncodingsKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionSuggestedEncodingsKey => + _NSStringEncodingDetectionSuggestedEncodingsKey.value; + + set NSStringEncodingDetectionSuggestedEncodingsKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionSuggestedEncodingsKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionDisallowedEncodingsKey = + _lookup( + 'NSStringEncodingDetectionDisallowedEncodingsKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionDisallowedEncodingsKey => + _NSStringEncodingDetectionDisallowedEncodingsKey.value; + + set NSStringEncodingDetectionDisallowedEncodingsKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionDisallowedEncodingsKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey = + _lookup( + 'NSStringEncodingDetectionUseOnlySuggestedEncodingsKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionUseOnlySuggestedEncodingsKey => + _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value; + + set NSStringEncodingDetectionUseOnlySuggestedEncodingsKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionAllowLossyKey = + _lookup( + 'NSStringEncodingDetectionAllowLossyKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionAllowLossyKey => + _NSStringEncodingDetectionAllowLossyKey.value; + + set NSStringEncodingDetectionAllowLossyKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionAllowLossyKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionFromWindowsKey = + _lookup( + 'NSStringEncodingDetectionFromWindowsKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionFromWindowsKey => + _NSStringEncodingDetectionFromWindowsKey.value; + + set NSStringEncodingDetectionFromWindowsKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionFromWindowsKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionLossySubstitutionKey = + _lookup( + 'NSStringEncodingDetectionLossySubstitutionKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionLossySubstitutionKey => + _NSStringEncodingDetectionLossySubstitutionKey.value; + + set NSStringEncodingDetectionLossySubstitutionKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionLossySubstitutionKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionLikelyLanguageKey = + _lookup( + 'NSStringEncodingDetectionLikelyLanguageKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionLikelyLanguageKey => + _NSStringEncodingDetectionLikelyLanguageKey.value; + + set NSStringEncodingDetectionLikelyLanguageKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionLikelyLanguageKey.value = value; + + late final ffi.Pointer _class_NSMutableString1 = + _getClass1("NSMutableString"); + late final ffi.Pointer _sel_replaceCharactersInRange_withString_1 = + _registerName1("replaceCharactersInRange:withString:"); + late final ffi.Pointer _sel_insertString_atIndex_1 = + _registerName1("insertString:atIndex:"); + late final ffi.Pointer _sel_deleteCharactersInRange_1 = + _registerName1("deleteCharactersInRange:"); + late final ffi.Pointer _sel_appendString_1 = + _registerName1("appendString:"); + late final ffi.Pointer _sel_appendFormat_1 = + _registerName1("appendFormat:"); + late final ffi.Pointer _sel_setString_1 = + _registerName1("setString:"); + late final ffi.Pointer + _sel_replaceOccurrencesOfString_withString_options_range_1 = + _registerName1("replaceOccurrencesOfString:withString:options:range:"); + int _objc_msgSend_146( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer target, + ffi.Pointer replacement, + int options, + NSRange searchRange, + ) { + return __objc_msgSend_146( + obj, + sel, + target, + replacement, + options, + searchRange, + ); + } + + late final __objc_msgSend_146Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_146 = __objc_msgSend_146Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, NSRange)>(); + + late final ffi.Pointer + _sel_applyTransform_reverse_range_updatedRange_1 = + _registerName1("applyTransform:reverse:range:updatedRange:"); + bool _objc_msgSend_147( + ffi.Pointer obj, + ffi.Pointer sel, + NSStringTransform transform, + bool reverse, + NSRange range, + NSRangePointer resultingRange, + ) { + return __objc_msgSend_147( + obj, + sel, + transform, + reverse ? 1 : 0, + range, + resultingRange, + ) != + 0; + } + + late final __objc_msgSend_147Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function( + ffi.Pointer, + ffi.Pointer, + NSStringTransform, + ffi.Uint8, + NSRange, + NSRangePointer)>>('objc_msgSend'); + late final __objc_msgSend_147 = __objc_msgSend_147Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + NSStringTransform, int, NSRange, NSRangePointer)>(); + + ffi.Pointer _objc_msgSend_148( + ffi.Pointer obj, + ffi.Pointer sel, + int capacity, + ) { + return __objc_msgSend_148( + obj, + sel, + capacity, + ); + } + + late final __objc_msgSend_148Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_148 = __objc_msgSend_148Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_stringWithCapacity_1 = + _registerName1("stringWithCapacity:"); + late final ffi.Pointer _NSCharacterConversionException = + _lookup('NSCharacterConversionException'); + + NSExceptionName get NSCharacterConversionException => + _NSCharacterConversionException.value; + + set NSCharacterConversionException(NSExceptionName value) => + _NSCharacterConversionException.value = value; + + late final ffi.Pointer _NSParseErrorException = + _lookup('NSParseErrorException'); + + NSExceptionName get NSParseErrorException => _NSParseErrorException.value; + + set NSParseErrorException(NSExceptionName value) => + _NSParseErrorException.value = value; + + late final ffi.Pointer _class_Foo1 = _getClass1("Foo"); + late final ffi.Pointer _sel_intVal1 = _registerName1("intVal"); + int _objc_msgSend_149( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_149( + obj, + sel, + ); + } + + late final __objc_msgSend_149Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_149 = __objc_msgSend_149Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_setIntVal_1 = + _registerName1("setIntVal:"); + void _objc_msgSend_150( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_150( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_150Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_150 = __objc_msgSend_150Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_makeFoo_1 = _registerName1("makeFoo:"); + ffi.Pointer _objc_msgSend_151( + ffi.Pointer obj, + ffi.Pointer sel, + double x, + ) { + return __objc_msgSend_151( + obj, + sel, + x, + ); + } + + late final __objc_msgSend_151Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_151 = __objc_msgSend_151Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); + + late final ffi.Pointer _sel_multiply_withOtherFoo_1 = + _registerName1("multiply:withOtherFoo:"); + int _objc_msgSend_152( + ffi.Pointer obj, + ffi.Pointer sel, + bool useIntVals, + ffi.Pointer other, + ) { + return __objc_msgSend_152( + obj, + sel, + useIntVals ? 1 : 0, + other, + ); + } + + late final __objc_msgSend_152Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_152 = __objc_msgSend_152Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_setDoubleVal_1 = + _registerName1("setDoubleVal:"); + void _objc_msgSend_153( + ffi.Pointer obj, + ffi.Pointer sel, + double x, + ) { + return __objc_msgSend_153( + obj, + sel, + x, + ); + } + + late final __objc_msgSend_153Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_153 = __objc_msgSend_153Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double)>(); +} + +abstract class NSComparisonResult { + static const int NSOrderedAscending = -1; + static const int NSOrderedSame = 0; + static const int NSOrderedDescending = 1; +} + +abstract class NSEnumerationOptions { + static const int NSEnumerationConcurrent = 1; + static const int NSEnumerationReverse = 2; +} + +abstract class NSSortOptions { + static const int NSSortConcurrent = 1; + static const int NSSortStable = 16; +} + +abstract class NSQualityOfService { + static const int NSQualityOfServiceUserInteractive = 33; + static const int NSQualityOfServiceUserInitiated = 25; + static const int NSQualityOfServiceUtility = 17; + static const int NSQualityOfServiceBackground = 9; + static const int NSQualityOfServiceDefault = -1; +} + +typedef NSInteger = pkg_ffi.Long; + +class __CFString extends ffi.Opaque {} + +abstract class CFComparisonResult { + static const int kCFCompareLessThan = -1; + static const int kCFCompareEqualTo = 0; + static const int kCFCompareGreaterThan = 1; +} + +typedef CFIndex = pkg_ffi.Long; + +class CFRange extends ffi.Struct { + @CFIndex() + external int location; + + @CFIndex() + external int length; +} + +class __CFNull extends ffi.Opaque {} + +typedef CFNullRef = ffi.Pointer<__CFNull>; + +class __CFAllocator extends ffi.Opaque {} + +typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; + +class CFAllocatorContext extends ffi.Struct { + @CFIndex() + external int version; + + external ffi.Pointer info; + + external CFAllocatorRetainCallBack retain; + + external CFAllocatorReleaseCallBack release; + + external CFAllocatorCopyDescriptionCallBack copyDescription; + + external CFAllocatorAllocateCallBack allocate; + + external CFAllocatorReallocateCallBack reallocate; + + external CFAllocatorDeallocateCallBack deallocate; + + external CFAllocatorPreferredSizeCallBack preferredSize; +} + +typedef CFAllocatorRetainCallBack = ffi.Pointer< + ffi.NativeFunction Function(ffi.Pointer)>>; +typedef CFAllocatorReleaseCallBack + = ffi.Pointer)>>; +typedef CFAllocatorCopyDescriptionCallBack = ffi + .Pointer)>>; +typedef CFStringRef = ffi.Pointer<__CFString>; +typedef CFAllocatorAllocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + CFIndex, CFOptionFlags, ffi.Pointer)>>; +typedef CFOptionFlags = pkg_ffi.UnsignedLong; +typedef CFAllocatorReallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, CFIndex, + CFOptionFlags, ffi.Pointer)>>; +typedef CFAllocatorDeallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; +typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< + ffi.NativeFunction< + CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; + +class _ObjCWrapper { + final ffi.Pointer _id; + final NativeObjCLibrary _lib; + + _ObjCWrapper._(this._id, this._lib); + + @override + bool operator ==(Object other) { + return other is _ObjCWrapper && _id == other._id; + } + + @override + int get hashCode => _id.hashCode; +} + +class NSObject extends _ObjCWrapper { + NSObject._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static NSObject castFrom(T other) { + return NSObject._(other._id, other._lib); + } + + static NSObject castFromPointer( + NativeObjCLibrary lib, ffi.Pointer other) { + return NSObject._(other, lib); + } + + static void load(NativeObjCLibrary _lib) { + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); + } + + static void initialize(NativeObjCLibrary _lib) { + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); + } + + NSObject init() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); + return NSObject._(_ret, _lib); + } + + static NSObject new1(NativeObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); + return NSObject._(_ret, _lib); + } + + static NSObject allocWithZone( + NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static NSObject alloc(NativeObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); + return NSObject._(_ret, _lib); + } + + void dealloc() { + _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); + } + + void finalize() { + _lib._objc_msgSend_0(_id, _lib._sel_finalize1); + } + + NSObject copy() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); + return NSObject._(_ret, _lib); + } + + NSObject mutableCopy() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); + return NSObject._(_ret, _lib); + } + + static NSObject copyWithZone( + NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static NSObject mutableCopyWithZone( + NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static bool instancesRespondToSelector( + NativeObjCLibrary _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_3(_lib._class_NSObject1, + _lib._sel_instancesRespondToSelector_1, aSelector); + } + + static bool conformsToProtocol(NativeObjCLibrary _lib, NSObject? protocol) { + return _lib._objc_msgSend_4(_lib._class_NSObject1, + _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); + } + + IMP methodForSelector(ffi.Pointer aSelector) { + return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); + } + + static IMP instanceMethodForSelector( + NativeObjCLibrary _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_5(_lib._class_NSObject1, + _lib._sel_instanceMethodForSelector_1, aSelector); + } + + void doesNotRecognizeSelector(ffi.Pointer aSelector) { + _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); + } + + NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_7( + _id, _lib._sel_forwardingTargetForSelector_1, aSelector); + return NSObject._(_ret, _lib); + } + + void forwardInvocation(NSObject? anInvocation) { + _lib._objc_msgSend_8( + _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); + } + + NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_9( + _id, _lib._sel_methodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static NSMethodSignature instanceMethodSignatureForSelector( + NativeObjCLibrary _lib, ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, + _lib._sel_instanceMethodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + bool allowsWeakReference() { + return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); + } + + bool retainWeakReference() { + return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); + } + + static bool isSubclassOfClass(NativeObjCLibrary _lib, NSObject aClass) { + return _lib._objc_msgSend_4( + _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); + } + + static bool resolveClassMethod( + NativeObjCLibrary _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); + } + + static bool resolveInstanceMethod( + NativeObjCLibrary _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); + } + + static int hash(NativeObjCLibrary _lib) { + return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); + } + + static NSObject superclass(NativeObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); + return NSObject._(_ret, _lib); + } + + static NSObject class1(NativeObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); + return NSObject._(_ret, _lib); + } + + static NSString description(NativeObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_74(_lib._class_NSObject1, _lib._sel_description1); + return NSString._(_ret, _lib); + } + + static NSString debugDescription(NativeObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_74( + _lib._class_NSObject1, _lib._sel_debugDescription1); + return NSString._(_ret, _lib); + } + + static int version(NativeObjCLibrary _lib) { + return _lib._objc_msgSend_32(_lib._class_NSObject1, _lib._sel_version1); + } + + static void setVersion(NativeObjCLibrary _lib, int aVersion) { + _lib._objc_msgSend_75( + _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); + } + + NSObject get classForCoder { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); + return NSObject._(_ret, _lib); + } + + NSObject replacementObjectForCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + NSObject awakeAfterUsingCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + static void poseAsClass(NativeObjCLibrary _lib, NSObject aClass) { + _lib._objc_msgSend_8( + _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); + } + + NSObject get autoContentAccessingProxy { + final _ret = + _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); + return NSObject._(_ret, _lib); + } +} + +class ObjCSel extends ffi.Opaque {} + +class ObjCObject extends ffi.Opaque {} + +typedef instancetype = ffi.Pointer; + +class _NSZone extends ffi.Opaque {} + +typedef IMP = ffi.Pointer>; + +class NSMethodSignature extends _ObjCWrapper { + NSMethodSignature._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static NSMethodSignature castFrom(T other) { + return NSMethodSignature._(other._id, other._lib); + } + + static NSMethodSignature castFromPointer( + NativeObjCLibrary lib, ffi.Pointer other) { + return NSMethodSignature._(other, lib); + } +} + +typedef NSUInteger = pkg_ffi.UnsignedLong; + +class NSString extends NSObject { + NSString._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static NSString castFrom(T other) { + return NSString._(other._id, other._lib); + } + + static NSString castFromPointer( + NativeObjCLibrary lib, ffi.Pointer other) { + return NSString._(other, lib); + } + + factory NSString(NativeObjCLibrary _lib, String str) { + final cstr = str.toNativeUtf8(); + final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + pkg_ffi.calloc.free(cstr); + return nsstr; + } + + @override + String toString() => (UTF8String).cast().toDartString(); + + int get length { + return _lib._objc_msgSend_11(_id, _lib._sel_length1); + } + + int characterAtIndex(int index) { + return _lib._objc_msgSend_12(_id, _lib._sel_characterAtIndex_1, index); + } + + @override + NSString init() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); + return NSString._(_ret, _lib); + } + + NSString initWithCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } + + NSString substringFromIndex(int from) { + final _ret = + _lib._objc_msgSend_14(_id, _lib._sel_substringFromIndex_1, from); + return NSString._(_ret, _lib); + } + + NSString substringToIndex(int to) { + final _ret = _lib._objc_msgSend_14(_id, _lib._sel_substringToIndex_1, to); + return NSString._(_ret, _lib); + } + + NSString substringWithRange(NSRange range) { + final _ret = + _lib._objc_msgSend_15(_id, _lib._sel_substringWithRange_1, range); + return NSString._(_ret, _lib); + } + + void getCharacters_range(ffi.Pointer buffer, NSRange range) { + _lib._objc_msgSend_16(_id, _lib._sel_getCharacters_range_1, buffer, range); + } + + int compare(NSObject? string) { + return _lib._objc_msgSend_17( + _id, _lib._sel_compare_1, string?._id ?? ffi.nullptr); + } + + int compare_options(NSObject? string, int mask) { + return _lib._objc_msgSend_18( + _id, _lib._sel_compare_options_1, string?._id ?? ffi.nullptr, mask); + } + + int compare_options_range( + NSObject? string, int mask, NSRange rangeOfReceiverToCompare) { + return _lib._objc_msgSend_19(_id, _lib._sel_compare_options_range_1, + string?._id ?? ffi.nullptr, mask, rangeOfReceiverToCompare); + } + + int compare_options_range_locale(NSObject? string, int mask, + NSRange rangeOfReceiverToCompare, NSObject locale) { + return _lib._objc_msgSend_20(_id, _lib._sel_compare_options_range_locale_1, + string?._id ?? ffi.nullptr, mask, rangeOfReceiverToCompare, locale._id); + } + + int caseInsensitiveCompare(NSObject? string) { + return _lib._objc_msgSend_17( + _id, _lib._sel_caseInsensitiveCompare_1, string?._id ?? ffi.nullptr); + } + + int localizedCompare(NSObject? string) { + return _lib._objc_msgSend_17( + _id, _lib._sel_localizedCompare_1, string?._id ?? ffi.nullptr); + } + + int localizedCaseInsensitiveCompare(NSObject? string) { + return _lib._objc_msgSend_17( + _id, + _lib._sel_localizedCaseInsensitiveCompare_1, + string?._id ?? ffi.nullptr); + } + + int localizedStandardCompare(NSObject? string) { + return _lib._objc_msgSend_17( + _id, _lib._sel_localizedStandardCompare_1, string?._id ?? ffi.nullptr); + } + + bool isEqualToString(NSObject? aString) { + return _lib._objc_msgSend_4( + _id, _lib._sel_isEqualToString_1, aString?._id ?? ffi.nullptr); + } + + bool hasPrefix(NSObject? str) { + return _lib._objc_msgSend_4( + _id, _lib._sel_hasPrefix_1, str?._id ?? ffi.nullptr); + } + + bool hasSuffix(NSObject? str) { + return _lib._objc_msgSend_4( + _id, _lib._sel_hasSuffix_1, str?._id ?? ffi.nullptr); + } + + NSString commonPrefixWithString_options(NSObject? str, int mask) { + final _ret = _lib._objc_msgSend_21( + _id, + _lib._sel_commonPrefixWithString_options_1, + str?._id ?? ffi.nullptr, + mask); + return NSString._(_ret, _lib); + } + + bool containsString(NSObject? str) { + return _lib._objc_msgSend_4( + _id, _lib._sel_containsString_1, str?._id ?? ffi.nullptr); + } + + bool localizedCaseInsensitiveContainsString(NSObject? str) { + return _lib._objc_msgSend_4( + _id, + _lib._sel_localizedCaseInsensitiveContainsString_1, + str?._id ?? ffi.nullptr); + } + + bool localizedStandardContainsString(NSObject? str) { + return _lib._objc_msgSend_4(_id, + _lib._sel_localizedStandardContainsString_1, str?._id ?? ffi.nullptr); + } + + NSRange localizedStandardRangeOfString(NSObject? str) { + return _lib._objc_msgSend_22(_id, + _lib._sel_localizedStandardRangeOfString_1, str?._id ?? ffi.nullptr); + } + + NSRange rangeOfString(NSObject? searchString) { + return _lib._objc_msgSend_22( + _id, _lib._sel_rangeOfString_1, searchString?._id ?? ffi.nullptr); + } + + NSRange rangeOfString_options(NSObject? searchString, int mask) { + return _lib._objc_msgSend_23(_id, _lib._sel_rangeOfString_options_1, + searchString?._id ?? ffi.nullptr, mask); + } + + NSRange rangeOfString_options_range( + NSObject? searchString, int mask, NSRange rangeOfReceiverToSearch) { + return _lib._objc_msgSend_24(_id, _lib._sel_rangeOfString_options_range_1, + searchString?._id ?? ffi.nullptr, mask, rangeOfReceiverToSearch); + } + + NSRange rangeOfString_options_range_locale(NSObject? searchString, int mask, + NSRange rangeOfReceiverToSearch, NSObject? locale) { + return _lib._objc_msgSend_25( + _id, + _lib._sel_rangeOfString_options_range_locale_1, + searchString?._id ?? ffi.nullptr, + mask, + rangeOfReceiverToSearch, + locale?._id ?? ffi.nullptr); + } + + NSRange rangeOfCharacterFromSet(NSObject? searchSet) { + return _lib._objc_msgSend_22(_id, _lib._sel_rangeOfCharacterFromSet_1, + searchSet?._id ?? ffi.nullptr); + } + + NSRange rangeOfCharacterFromSet_options(NSObject? searchSet, int mask) { + return _lib._objc_msgSend_23( + _id, + _lib._sel_rangeOfCharacterFromSet_options_1, + searchSet?._id ?? ffi.nullptr, + mask); + } + + NSRange rangeOfCharacterFromSet_options_range( + NSObject? searchSet, int mask, NSRange rangeOfReceiverToSearch) { + return _lib._objc_msgSend_24( + _id, + _lib._sel_rangeOfCharacterFromSet_options_range_1, + searchSet?._id ?? ffi.nullptr, + mask, + rangeOfReceiverToSearch); + } + + NSRange rangeOfComposedCharacterSequenceAtIndex(int index) { + return _lib._objc_msgSend_26( + _id, _lib._sel_rangeOfComposedCharacterSequenceAtIndex_1, index); + } + + NSRange rangeOfComposedCharacterSequencesForRange(NSRange range) { + return _lib._objc_msgSend_27( + _id, _lib._sel_rangeOfComposedCharacterSequencesForRange_1, range); + } + + NSString stringByAppendingString(NSObject? aString) { + final _ret = _lib._objc_msgSend_28( + _id, _lib._sel_stringByAppendingString_1, aString?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } + + NSString stringByAppendingFormat(NSObject? format) { + final _ret = _lib._objc_msgSend_28( + _id, _lib._sel_stringByAppendingFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } + + double get doubleValue { + return _lib._objc_msgSend_29(_id, _lib._sel_doubleValue1); + } + + double get floatValue { + return _lib._objc_msgSend_30(_id, _lib._sel_floatValue1); + } + + int get intValue { + return _lib._objc_msgSend_31(_id, _lib._sel_intValue1); + } + + int get integerValue { + return _lib._objc_msgSend_32(_id, _lib._sel_integerValue1); + } + + int get longLongValue { + return _lib._objc_msgSend_33(_id, _lib._sel_longLongValue1); + } + + bool get boolValue { + return _lib._objc_msgSend_10(_id, _lib._sel_boolValue1); + } + + NSObject? get uppercaseString { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_uppercaseString1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } + + NSObject? get lowercaseString { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_lowercaseString1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } + + NSObject? get capitalizedString { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_capitalizedString1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } + + NSObject? get localizedUppercaseString { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_localizedUppercaseString1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } + + NSObject? get localizedLowercaseString { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_localizedLowercaseString1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } + + NSObject? get localizedCapitalizedString { + final _ret = + _lib._objc_msgSend_1(_id, _lib._sel_localizedCapitalizedString1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } + + NSString uppercaseStringWithLocale(NSObject? locale) { + final _ret = _lib._objc_msgSend_28( + _id, _lib._sel_uppercaseStringWithLocale_1, locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } + + NSString lowercaseStringWithLocale(NSObject? locale) { + final _ret = _lib._objc_msgSend_28( + _id, _lib._sel_lowercaseStringWithLocale_1, locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } + + NSString capitalizedStringWithLocale(NSObject? locale) { + final _ret = _lib._objc_msgSend_28(_id, + _lib._sel_capitalizedStringWithLocale_1, locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } + + void getLineStart_end_contentsEnd_forRange( + ffi.Pointer startPtr, + ffi.Pointer lineEndPtr, + ffi.Pointer contentsEndPtr, + NSRange range) { + _lib._objc_msgSend_34( + _id, + _lib._sel_getLineStart_end_contentsEnd_forRange_1, + startPtr, + lineEndPtr, + contentsEndPtr, + range); + } + + NSRange lineRangeForRange(NSRange range) { + return _lib._objc_msgSend_27(_id, _lib._sel_lineRangeForRange_1, range); + } + + void getParagraphStart_end_contentsEnd_forRange( + ffi.Pointer startPtr, + ffi.Pointer parEndPtr, + ffi.Pointer contentsEndPtr, + NSRange range) { + _lib._objc_msgSend_34( + _id, + _lib._sel_getParagraphStart_end_contentsEnd_forRange_1, + startPtr, + parEndPtr, + contentsEndPtr, + range); + } + + NSRange paragraphRangeForRange(NSRange range) { + return _lib._objc_msgSend_27( + _id, _lib._sel_paragraphRangeForRange_1, range); + } + + void enumerateSubstringsInRange_options_usingBlock( + NSRange range, int opts, NSObject block) { + _lib._objc_msgSend_35( + _id, + _lib._sel_enumerateSubstringsInRange_options_usingBlock_1, + range, + opts, + block._id); + } + + void enumerateLinesUsingBlock(NSObject block) { + _lib._objc_msgSend_8(_id, _lib._sel_enumerateLinesUsingBlock_1, block._id); + } + + ffi.Pointer get UTF8String { + return _lib._objc_msgSend_36(_id, _lib._sel_UTF8String1); + } + + int get fastestEncoding { + return _lib._objc_msgSend_11(_id, _lib._sel_fastestEncoding1); + } + + int get smallestEncoding { + return _lib._objc_msgSend_11(_id, _lib._sel_smallestEncoding1); + } + + NSData dataUsingEncoding_allowLossyConversion(int encoding, bool lossy) { + final _ret = _lib._objc_msgSend_37(_id, + _lib._sel_dataUsingEncoding_allowLossyConversion_1, encoding, lossy); + return NSData._(_ret, _lib); + } + + NSData dataUsingEncoding(int encoding) { + final _ret = + _lib._objc_msgSend_38(_id, _lib._sel_dataUsingEncoding_1, encoding); + return NSData._(_ret, _lib); + } + + bool canBeConvertedToEncoding(int encoding) { + return _lib._objc_msgSend_39( + _id, _lib._sel_canBeConvertedToEncoding_1, encoding); + } + + void cStringUsingEncoding(int encoding) { + _lib._objc_msgSend_40(_id, _lib._sel_cStringUsingEncoding_1, encoding); + } + + bool getCString_maxLength_encoding( + ffi.Pointer buffer, int maxBufferCount, int encoding) { + return _lib._objc_msgSend_41(_id, _lib._sel_getCString_maxLength_encoding_1, + buffer, maxBufferCount, encoding); + } + + bool getBytes_maxLength_usedLength_encoding_options_range_remainingRange( + ffi.Pointer buffer, + int maxBufferCount, + ffi.Pointer usedBufferCount, + int encoding, + int options, + NSRange range, + NSRangePointer leftover) { + return _lib._objc_msgSend_42( + _id, + _lib._sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_1, + buffer, + maxBufferCount, + usedBufferCount, + encoding, + options, + range, + leftover); + } + + int maximumLengthOfBytesUsingEncoding(int enc) { + return _lib._objc_msgSend_43( + _id, _lib._sel_maximumLengthOfBytesUsingEncoding_1, enc); + } + + int lengthOfBytesUsingEncoding(int enc) { + return _lib._objc_msgSend_43( + _id, _lib._sel_lengthOfBytesUsingEncoding_1, enc); + } + + static ffi.Pointer getAvailableStringEncodings( + NativeObjCLibrary _lib) { + return _lib._objc_msgSend_44( + _lib._class_NSString1, _lib._sel_availableStringEncodings1); + } + + static NSString localizedNameOfStringEncoding( + NativeObjCLibrary _lib, int encoding) { + final _ret = _lib._objc_msgSend_14(_lib._class_NSString1, + _lib._sel_localizedNameOfStringEncoding_1, encoding); + return NSString._(_ret, _lib); + } + + static int getDefaultCStringEncoding(NativeObjCLibrary _lib) { + return _lib._objc_msgSend_11( + _lib._class_NSString1, _lib._sel_defaultCStringEncoding1); + } + + NSObject? get decomposedStringWithCanonicalMapping { + final _ret = _lib._objc_msgSend_1( + _id, _lib._sel_decomposedStringWithCanonicalMapping1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } + + NSObject? get precomposedStringWithCanonicalMapping { + final _ret = _lib._objc_msgSend_1( + _id, _lib._sel_precomposedStringWithCanonicalMapping1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } + + NSObject? get decomposedStringWithCompatibilityMapping { + final _ret = _lib._objc_msgSend_1( + _id, _lib._sel_decomposedStringWithCompatibilityMapping1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } + + NSObject? get precomposedStringWithCompatibilityMapping { + final _ret = _lib._objc_msgSend_1( + _id, _lib._sel_precomposedStringWithCompatibilityMapping1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } + + NSString stringByTrimmingCharactersInSet(NSObject? set) { + final _ret = _lib._objc_msgSend_28(_id, + _lib._sel_stringByTrimmingCharactersInSet_1, set?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } + + NSString stringByPaddingToLength_withString_startingAtIndex( + int newLength, NSObject? padString, int padIndex) { + final _ret = _lib._objc_msgSend_45( + _id, + _lib._sel_stringByPaddingToLength_withString_startingAtIndex_1, + newLength, + padString?._id ?? ffi.nullptr, + padIndex); + return NSString._(_ret, _lib); + } + + NSString stringByFoldingWithOptions_locale(int options, NSObject? locale) { + final _ret = _lib._objc_msgSend_46( + _id, + _lib._sel_stringByFoldingWithOptions_locale_1, + options, + locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } + + NSString stringByReplacingOccurrencesOfString_withString_options_range( + NSObject? target, + NSObject? replacement, + int options, + NSRange searchRange) { + final _ret = _lib._objc_msgSend_47( + _id, + _lib._sel_stringByReplacingOccurrencesOfString_withString_options_range_1, + target?._id ?? ffi.nullptr, + replacement?._id ?? ffi.nullptr, + options, + searchRange); + return NSString._(_ret, _lib); + } + + NSString stringByReplacingOccurrencesOfString_withString( + NSObject? target, NSObject? replacement) { + final _ret = _lib._objc_msgSend_48( + _id, + _lib._sel_stringByReplacingOccurrencesOfString_withString_1, + target?._id ?? ffi.nullptr, + replacement?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } + + NSString stringByReplacingCharactersInRange_withString( + NSRange range, NSObject? replacement) { + final _ret = _lib._objc_msgSend_49( + _id, + _lib._sel_stringByReplacingCharactersInRange_withString_1, + range, + replacement?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } + + NSString stringByApplyingTransform_reverse( + NSStringTransform transform, bool reverse) { + final _ret = _lib._objc_msgSend_50( + _id, _lib._sel_stringByApplyingTransform_reverse_1, transform, reverse); + return NSString._(_ret, _lib); + } + + bool writeToURL_atomically_encoding_error( + NSObject? url, + bool useAuxiliaryFile, + int enc, + ffi.Pointer> error) { + return _lib._objc_msgSend_51( + _id, + _lib._sel_writeToURL_atomically_encoding_error_1, + url?._id ?? ffi.nullptr, + useAuxiliaryFile, + enc, + error); + } + + bool writeToFile_atomically_encoding_error( + NSObject? path, + bool useAuxiliaryFile, + int enc, + ffi.Pointer> error) { + return _lib._objc_msgSend_51( + _id, + _lib._sel_writeToFile_atomically_encoding_error_1, + path?._id ?? ffi.nullptr, + useAuxiliaryFile, + enc, + error); + } + + NSObject? get description { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_description1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } + + int get hash { + return _lib._objc_msgSend_11(_id, _lib._sel_hash1); + } + + NSString initWithCharactersNoCopy_length_freeWhenDone( + ffi.Pointer characters, int length, bool freeBuffer) { + final _ret = _lib._objc_msgSend_52( + _id, + _lib._sel_initWithCharactersNoCopy_length_freeWhenDone_1, + characters, + length, + freeBuffer); + return NSString._(_ret, _lib); + } + + NSString initWithCharactersNoCopy_length_deallocator( + ffi.Pointer chars, int len, NSObject deallocator) { + final _ret = _lib._objc_msgSend_53( + _id, + _lib._sel_initWithCharactersNoCopy_length_deallocator_1, + chars, + len, + deallocator._id); + return NSString._(_ret, _lib); + } + + NSString initWithCharacters_length( + ffi.Pointer characters, int length) { + final _ret = _lib._objc_msgSend_54( + _id, _lib._sel_initWithCharacters_length_1, characters, length); + return NSString._(_ret, _lib); + } + + NSString initWithUTF8String(ffi.Pointer nullTerminatedCString) { + final _ret = _lib._objc_msgSend_55( + _id, _lib._sel_initWithUTF8String_1, nullTerminatedCString); + return NSString._(_ret, _lib); + } + + NSString initWithString(NSObject? aString) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithString_1, aString?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } + + NSString initWithFormat(NSObject? format) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } + + NSString initWithFormat_arguments( + NSObject? format, ffi.Pointer<__va_list_tag> argList) { + final _ret = _lib._objc_msgSend_56( + _id, + _lib._sel_initWithFormat_arguments_1, + format?._id ?? ffi.nullptr, + argList); + return NSString._(_ret, _lib); + } + + NSString initWithFormat_locale(NSObject? format, NSObject locale) { + final _ret = _lib._objc_msgSend_57(_id, _lib._sel_initWithFormat_locale_1, + format?._id ?? ffi.nullptr, locale._id); + return NSString._(_ret, _lib); + } + + NSString initWithFormat_locale_arguments( + NSObject? format, NSObject locale, ffi.Pointer<__va_list_tag> argList) { + final _ret = _lib._objc_msgSend_58( + _id, + _lib._sel_initWithFormat_locale_arguments_1, + format?._id ?? ffi.nullptr, + locale._id, + argList); + return NSString._(_ret, _lib); + } + + NSString initWithData_encoding(NSObject? data, int encoding) { + final _ret = _lib._objc_msgSend_59(_id, _lib._sel_initWithData_encoding_1, + data?._id ?? ffi.nullptr, encoding); + return NSString._(_ret, _lib); + } + + NSString initWithBytes_length_encoding( + ffi.Pointer bytes, int len, int encoding) { + final _ret = _lib._objc_msgSend_60( + _id, _lib._sel_initWithBytes_length_encoding_1, bytes, len, encoding); + return NSString._(_ret, _lib); + } + + NSString initWithBytesNoCopy_length_encoding_freeWhenDone( + ffi.Pointer bytes, int len, int encoding, bool freeBuffer) { + final _ret = _lib._objc_msgSend_61( + _id, + _lib._sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1, + bytes, + len, + encoding, + freeBuffer); + return NSString._(_ret, _lib); + } + + NSString initWithBytesNoCopy_length_encoding_deallocator( + ffi.Pointer bytes, + int len, + int encoding, + NSObject deallocator) { + final _ret = _lib._objc_msgSend_62( + _id, + _lib._sel_initWithBytesNoCopy_length_encoding_deallocator_1, + bytes, + len, + encoding, + deallocator._id); + return NSString._(_ret, _lib); + } + + static NSString string(NativeObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSString1, _lib._sel_string1); + return NSString._(_ret, _lib); + } + + static NSString stringWithString(NativeObjCLibrary _lib, NSObject? string) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, + _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } + + static NSString stringWithCharacters_length( + NativeObjCLibrary _lib, ffi.Pointer characters, int length) { + final _ret = _lib._objc_msgSend_54(_lib._class_NSString1, + _lib._sel_stringWithCharacters_length_1, characters, length); + return NSString._(_ret, _lib); + } + + static NSString stringWithUTF8String( + NativeObjCLibrary _lib, ffi.Pointer nullTerminatedCString) { + final _ret = _lib._objc_msgSend_55(_lib._class_NSString1, + _lib._sel_stringWithUTF8String_1, nullTerminatedCString); + return NSString._(_ret, _lib); + } + + static NSString stringWithFormat(NativeObjCLibrary _lib, NSObject? format) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, + _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } + + static NSString localizedStringWithFormat( + NativeObjCLibrary _lib, NSObject? format) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, + _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } + + NSString initWithCString_encoding( + ffi.Pointer nullTerminatedCString, int encoding) { + final _ret = _lib._objc_msgSend_63(_id, + _lib._sel_initWithCString_encoding_1, nullTerminatedCString, encoding); + return NSString._(_ret, _lib); + } + + static NSString stringWithCString_encoding( + NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { + final _ret = _lib._objc_msgSend_63(_lib._class_NSString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); + return NSString._(_ret, _lib); + } + + NSString initWithContentsOfURL_encoding_error( + NSObject? url, int enc, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_initWithContentsOfURL_encoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib); + } + + NSString initWithContentsOfFile_encoding_error( + NSObject? path, int enc, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_initWithContentsOfFile_encoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib); + } + + static NSString stringWithContentsOfURL_encoding_error(NativeObjCLibrary _lib, + NSObject? url, int enc, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_64( + _lib._class_NSString1, + _lib._sel_stringWithContentsOfURL_encoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib); + } + + static NSString stringWithContentsOfFile_encoding_error( + NativeObjCLibrary _lib, + NSObject? path, + int enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_64( + _lib._class_NSString1, + _lib._sel_stringWithContentsOfFile_encoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib); + } + + NSString initWithContentsOfURL_usedEncoding_error( + NSObject? url, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_65( + _id, + _lib._sel_initWithContentsOfURL_usedEncoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib); + } + + NSString initWithContentsOfFile_usedEncoding_error( + NSObject? path, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_65( + _id, + _lib._sel_initWithContentsOfFile_usedEncoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib); + } + + static NSString stringWithContentsOfURL_usedEncoding_error( + NativeObjCLibrary _lib, + NSObject? url, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_65( + _lib._class_NSString1, + _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib); + } + + static NSString stringWithContentsOfFile_usedEncoding_error( + NativeObjCLibrary _lib, + NSObject? path, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_65( + _lib._class_NSString1, + _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib); + } + + static int + stringEncodingForData_encodingOptions_convertedString_usedLossyConversion( + NativeObjCLibrary _lib, + NSObject? data, + NSObject? opts, + ffi.Pointer> string, + ffi.Pointer usedLossyConversion) { + return _lib._objc_msgSend_66( + _lib._class_NSString1, + _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, + data?._id ?? ffi.nullptr, + opts?._id ?? ffi.nullptr, + string, + usedLossyConversion); + } + + NSObject propertyList() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_propertyList1); + return NSObject._(_ret, _lib); + } + + NSDictionary propertyListFromStringsFileFormat() { + final _ret = _lib._objc_msgSend_67( + _id, _lib._sel_propertyListFromStringsFileFormat1); + return NSDictionary._(_ret, _lib); + } + + void cString() { + _lib._objc_msgSend_0(_id, _lib._sel_cString1); + } + + void lossyCString() { + _lib._objc_msgSend_0(_id, _lib._sel_lossyCString1); + } + + int cStringLength() { + return _lib._objc_msgSend_11(_id, _lib._sel_cStringLength1); + } + + void getCString(ffi.Pointer bytes) { + _lib._objc_msgSend_68(_id, _lib._sel_getCString_1, bytes); + } + + void getCString_maxLength(ffi.Pointer bytes, int maxLength) { + _lib._objc_msgSend_69( + _id, _lib._sel_getCString_maxLength_1, bytes, maxLength); + } + + void getCString_maxLength_range_remainingRange( + ffi.Pointer bytes, + int maxLength, + NSRange aRange, + NSRangePointer leftoverRange) { + _lib._objc_msgSend_70( + _id, + _lib._sel_getCString_maxLength_range_remainingRange_1, + bytes, + maxLength, + aRange, + leftoverRange); + } + + bool writeToFile_atomically(NSObject? path, bool useAuxiliaryFile) { + return _lib._objc_msgSend_71(_id, _lib._sel_writeToFile_atomically_1, + path?._id ?? ffi.nullptr, useAuxiliaryFile); + } + + bool writeToURL_atomically(NSObject? url, bool atomically) { + return _lib._objc_msgSend_71(_id, _lib._sel_writeToURL_atomically_1, + url?._id ?? ffi.nullptr, atomically); + } + + NSObject initWithContentsOfFile(NSObject? path) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } - set NSItemProviderPreferredImageSizeKey(ffi.Pointer value) => - _NSItemProviderPreferredImageSizeKey.value = value; + NSObject initWithContentsOfURL(NSObject? url) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } - late final ffi.Pointer> - _NSExtensionJavaScriptPreprocessingResultsKey = - _lookup>( - 'NSExtensionJavaScriptPreprocessingResultsKey'); + static NSObject stringWithContentsOfFile( + NativeObjCLibrary _lib, NSObject? path) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, + _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } - ffi.Pointer get NSExtensionJavaScriptPreprocessingResultsKey => - _NSExtensionJavaScriptPreprocessingResultsKey.value; + static NSObject stringWithContentsOfURL( + NativeObjCLibrary _lib, NSObject? url) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, + _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } - set NSExtensionJavaScriptPreprocessingResultsKey( - ffi.Pointer value) => - _NSExtensionJavaScriptPreprocessingResultsKey.value = value; + NSObject initWithCStringNoCopy_length_freeWhenDone( + ffi.Pointer bytes, int length, bool freeBuffer) { + final _ret = _lib._objc_msgSend_72( + _id, + _lib._sel_initWithCStringNoCopy_length_freeWhenDone_1, + bytes, + length, + freeBuffer); + return NSObject._(_ret, _lib); + } - late final ffi.Pointer> - _NSExtensionJavaScriptFinalizeArgumentKey = - _lookup>( - 'NSExtensionJavaScriptFinalizeArgumentKey'); + NSObject initWithCString_length(ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_63( + _id, _lib._sel_initWithCString_length_1, bytes, length); + return NSObject._(_ret, _lib); + } - ffi.Pointer get NSExtensionJavaScriptFinalizeArgumentKey => - _NSExtensionJavaScriptFinalizeArgumentKey.value; + NSObject initWithCString(ffi.Pointer bytes) { + final _ret = _lib._objc_msgSend_55(_id, _lib._sel_initWithCString_1, bytes); + return NSObject._(_ret, _lib); + } - set NSExtensionJavaScriptFinalizeArgumentKey(ffi.Pointer value) => - _NSExtensionJavaScriptFinalizeArgumentKey.value = value; + static NSObject stringWithCString_length( + NativeObjCLibrary _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_63(_lib._class_NSString1, + _lib._sel_stringWithCString_length_1, bytes, length); + return NSObject._(_ret, _lib); + } - late final ffi.Pointer> _NSItemProviderErrorDomain = - _lookup>('NSItemProviderErrorDomain'); + static NSObject stringWithCString( + NativeObjCLibrary _lib, ffi.Pointer bytes) { + final _ret = _lib._objc_msgSend_55( + _lib._class_NSString1, _lib._sel_stringWithCString_1, bytes); + return NSObject._(_ret, _lib); + } - ffi.Pointer get NSItemProviderErrorDomain => - _NSItemProviderErrorDomain.value; + void getCharacters(ffi.Pointer buffer) { + _lib._objc_msgSend_73(_id, _lib._sel_getCharacters_1, buffer); + } - set NSItemProviderErrorDomain(ffi.Pointer value) => - _NSItemProviderErrorDomain.value = value; + static NSString new1(NativeObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSString1, _lib._sel_new1); + return NSString._(_ret, _lib); + } - late final ffi.Pointer _NSStringTransformLatinToKatakana = - _lookup('NSStringTransformLatinToKatakana'); + static NSString alloc(NativeObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSString1, _lib._sel_alloc1); + return NSString._(_ret, _lib); + } +} - NSStringTransform get NSStringTransformLatinToKatakana => - _NSStringTransformLatinToKatakana.value; +extension StringToNSString on String { + NSString toNSString(NativeObjCLibrary lib) => NSString(lib, this); +} - set NSStringTransformLatinToKatakana(NSStringTransform value) => - _NSStringTransformLatinToKatakana.value = value; +typedef unichar = pkg_ffi.UnsignedShort; +typedef NSRange = _NSRange; + +class _NSRange extends ffi.Struct { + @NSUInteger() + external int location; + + @NSUInteger() + external int length; +} + +abstract class NSStringCompareOptions { + static const int NSCaseInsensitiveSearch = 1; + static const int NSLiteralSearch = 2; + static const int NSBackwardsSearch = 4; + static const int NSAnchoredSearch = 8; + static const int NSNumericSearch = 64; + static const int NSDiacriticInsensitiveSearch = 128; + static const int NSWidthInsensitiveSearch = 256; + static const int NSForcedOrderingSearch = 512; + static const int NSRegularExpressionSearch = 1024; +} + +abstract class NSStringEnumerationOptions { + static const int NSStringEnumerationByLines = 0; + static const int NSStringEnumerationByParagraphs = 1; + static const int NSStringEnumerationByComposedCharacterSequences = 2; + static const int NSStringEnumerationByWords = 3; + static const int NSStringEnumerationBySentences = 4; + static const int NSStringEnumerationByCaretPositions = 5; + static const int NSStringEnumerationByDeletionClusters = 6; + static const int NSStringEnumerationReverse = 256; + static const int NSStringEnumerationSubstringNotRequired = 512; + static const int NSStringEnumerationLocalized = 1024; +} + +typedef NSStringEncoding = NSUInteger; + +class NSData extends _ObjCWrapper { + NSData._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static NSData castFrom(T other) { + return NSData._(other._id, other._lib); + } + + static NSData castFromPointer( + NativeObjCLibrary lib, ffi.Pointer other) { + return NSData._(other, lib); + } +} + +abstract class NSStringEncodingConversionOptions { + static const int NSStringEncodingConversionAllowLossy = 1; + static const int NSStringEncodingConversionExternalRepresentation = 2; +} + +typedef NSRangePointer = ffi.Pointer; +typedef NSStringTransform = ffi.Pointer; + +class __va_list_tag extends ffi.Struct { + @pkg_ffi.UnsignedInt() + external int gp_offset; + + @pkg_ffi.UnsignedInt() + external int fp_offset; + + external ffi.Pointer overflow_arg_area; + + external ffi.Pointer reg_save_area; +} + +class NSDictionary extends _ObjCWrapper { + NSDictionary._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static NSDictionary castFrom(T other) { + return NSDictionary._(other._id, other._lib); + } + + static NSDictionary castFromPointer( + NativeObjCLibrary lib, ffi.Pointer other) { + return NSDictionary._(other, lib); + } +} + +class NSValue extends NSObject { + NSValue._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static NSValue castFrom(T other) { + return NSValue._(other._id, other._lib); + } + + static NSValue castFromPointer( + NativeObjCLibrary lib, ffi.Pointer other) { + return NSValue._(other, lib); + } + + void getValue_size(ffi.Pointer value, int size) { + _lib._objc_msgSend_76(_id, _lib._sel_getValue_size_1, value, size); + } + + ffi.Pointer get objCType { + return _lib._objc_msgSend_36(_id, _lib._sel_objCType1); + } + + NSValue initWithBytes_objCType( + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_77( + _id, _lib._sel_initWithBytes_objCType_1, value, type); + return NSValue._(_ret, _lib); + } + + NSValue initWithCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSValue._(_ret, _lib); + } + + static NSValue valueWithBytes_objCType(NativeObjCLibrary _lib, + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_78( + _lib._class_NSValue1, _lib._sel_valueWithBytes_objCType_1, value, type); + return NSValue._(_ret, _lib); + } + + static NSValue value_withObjCType(NativeObjCLibrary _lib, + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_78( + _lib._class_NSValue1, _lib._sel_value_withObjCType_1, value, type); + return NSValue._(_ret, _lib); + } + + static NSValue valueWithNonretainedObject( + NativeObjCLibrary _lib, NSObject anObject) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSValue1, + _lib._sel_valueWithNonretainedObject_1, anObject._id); + return NSValue._(_ret, _lib); + } + + NSObject get nonretainedObjectValue { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_nonretainedObjectValue1); + return NSObject._(_ret, _lib); + } + + static NSValue valueWithPointer( + NativeObjCLibrary _lib, ffi.Pointer pointer) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSValue1, _lib._sel_valueWithPointer_1, pointer); + return NSValue._(_ret, _lib); + } + + ffi.Pointer get pointerValue { + return _lib._objc_msgSend_81(_id, _lib._sel_pointerValue1); + } + + bool isEqualToValue(NSObject? value) { + return _lib._objc_msgSend_4( + _id, _lib._sel_isEqualToValue_1, value?._id ?? ffi.nullptr); + } + + void getValue(ffi.Pointer value) { + _lib._objc_msgSend_82(_id, _lib._sel_getValue_1, value); + } + + static NSValue valueWithRange(NativeObjCLibrary _lib, NSRange range) { + final _ret = _lib._objc_msgSend_83( + _lib._class_NSValue1, _lib._sel_valueWithRange_1, range); + return NSValue._(_ret, _lib); + } + + NSRange get rangeValue { + return _lib._objc_msgSend_84(_id, _lib._sel_rangeValue1); + } + + static NSValue new1(NativeObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSValue1, _lib._sel_new1); + return NSValue._(_ret, _lib); + } + + static NSValue alloc(NativeObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSValue1, _lib._sel_alloc1); + return NSValue._(_ret, _lib); + } +} + +class NSNumber extends NSValue { + NSNumber._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static NSNumber castFrom(T other) { + return NSNumber._(other._id, other._lib); + } + + static NSNumber castFromPointer( + NativeObjCLibrary lib, ffi.Pointer other) { + return NSNumber._(other, lib); + } + + @override + NSNumber initWithCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSNumber._(_ret, _lib); + } + + NSNumber initWithChar(int value) { + final _ret = _lib._objc_msgSend_85(_id, _lib._sel_initWithChar_1, value); + return NSNumber._(_ret, _lib); + } + + NSNumber initWithUnsignedChar(int value) { + final _ret = + _lib._objc_msgSend_86(_id, _lib._sel_initWithUnsignedChar_1, value); + return NSNumber._(_ret, _lib); + } + + NSNumber initWithShort(int value) { + final _ret = _lib._objc_msgSend_87(_id, _lib._sel_initWithShort_1, value); + return NSNumber._(_ret, _lib); + } + + NSNumber initWithUnsignedShort(int value) { + final _ret = + _lib._objc_msgSend_88(_id, _lib._sel_initWithUnsignedShort_1, value); + return NSNumber._(_ret, _lib); + } + + NSNumber initWithInt(int value) { + final _ret = _lib._objc_msgSend_89(_id, _lib._sel_initWithInt_1, value); + return NSNumber._(_ret, _lib); + } + + NSNumber initWithUnsignedInt(int value) { + final _ret = + _lib._objc_msgSend_90(_id, _lib._sel_initWithUnsignedInt_1, value); + return NSNumber._(_ret, _lib); + } + + NSNumber initWithLong(int value) { + final _ret = _lib._objc_msgSend_91(_id, _lib._sel_initWithLong_1, value); + return NSNumber._(_ret, _lib); + } + + NSNumber initWithUnsignedLong(int value) { + final _ret = + _lib._objc_msgSend_92(_id, _lib._sel_initWithUnsignedLong_1, value); + return NSNumber._(_ret, _lib); + } + + NSNumber initWithLongLong(int value) { + final _ret = + _lib._objc_msgSend_93(_id, _lib._sel_initWithLongLong_1, value); + return NSNumber._(_ret, _lib); + } + + NSNumber initWithUnsignedLongLong(int value) { + final _ret = + _lib._objc_msgSend_94(_id, _lib._sel_initWithUnsignedLongLong_1, value); + return NSNumber._(_ret, _lib); + } + + NSNumber initWithFloat(double value) { + final _ret = _lib._objc_msgSend_95(_id, _lib._sel_initWithFloat_1, value); + return NSNumber._(_ret, _lib); + } + + NSNumber initWithDouble(double value) { + final _ret = _lib._objc_msgSend_96(_id, _lib._sel_initWithDouble_1, value); + return NSNumber._(_ret, _lib); + } + + NSNumber initWithBool(bool value) { + final _ret = _lib._objc_msgSend_97(_id, _lib._sel_initWithBool_1, value); + return NSNumber._(_ret, _lib); + } + + NSNumber initWithInteger(int value) { + final _ret = _lib._objc_msgSend_91(_id, _lib._sel_initWithInteger_1, value); + return NSNumber._(_ret, _lib); + } + + NSNumber initWithUnsignedInteger(int value) { + final _ret = + _lib._objc_msgSend_92(_id, _lib._sel_initWithUnsignedInteger_1, value); + return NSNumber._(_ret, _lib); + } + + int get charValue { + return _lib._objc_msgSend_98(_id, _lib._sel_charValue1); + } + + int get unsignedCharValue { + return _lib._objc_msgSend_99(_id, _lib._sel_unsignedCharValue1); + } + + int get shortValue { + return _lib._objc_msgSend_100(_id, _lib._sel_shortValue1); + } + + int get unsignedShortValue { + return _lib._objc_msgSend_101(_id, _lib._sel_unsignedShortValue1); + } + + int get intValue { + return _lib._objc_msgSend_31(_id, _lib._sel_intValue1); + } + + int get unsignedIntValue { + return _lib._objc_msgSend_102(_id, _lib._sel_unsignedIntValue1); + } + + int get longValue { + return _lib._objc_msgSend_32(_id, _lib._sel_longValue1); + } + + int get unsignedLongValue { + return _lib._objc_msgSend_11(_id, _lib._sel_unsignedLongValue1); + } + + int get longLongValue { + return _lib._objc_msgSend_33(_id, _lib._sel_longLongValue1); + } + + int get unsignedLongLongValue { + return _lib._objc_msgSend_103(_id, _lib._sel_unsignedLongLongValue1); + } + + double get floatValue { + return _lib._objc_msgSend_30(_id, _lib._sel_floatValue1); + } + + double get doubleValue { + return _lib._objc_msgSend_29(_id, _lib._sel_doubleValue1); + } + + bool get boolValue { + return _lib._objc_msgSend_10(_id, _lib._sel_boolValue1); + } + + int get integerValue { + return _lib._objc_msgSend_32(_id, _lib._sel_integerValue1); + } + + int get unsignedIntegerValue { + return _lib._objc_msgSend_11(_id, _lib._sel_unsignedIntegerValue1); + } + + NSObject? get stringValue { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_stringValue1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } + + int compare(NSObject? otherNumber) { + return _lib._objc_msgSend_17( + _id, _lib._sel_compare_1, otherNumber?._id ?? ffi.nullptr); + } - late final ffi.Pointer _NSStringTransformLatinToHiragana = - _lookup('NSStringTransformLatinToHiragana'); + bool isEqualToNumber(NSObject? number) { + return _lib._objc_msgSend_4( + _id, _lib._sel_isEqualToNumber_1, number?._id ?? ffi.nullptr); + } - NSStringTransform get NSStringTransformLatinToHiragana => - _NSStringTransformLatinToHiragana.value; + NSString descriptionWithLocale(NSObject locale) { + final _ret = _lib._objc_msgSend_28( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib); + } - set NSStringTransformLatinToHiragana(NSStringTransform value) => - _NSStringTransformLatinToHiragana.value = value; + static NSNumber numberWithChar(NativeObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_85( + _lib._class_NSNumber1, _lib._sel_numberWithChar_1, value); + return NSNumber._(_ret, _lib); + } - late final ffi.Pointer _NSStringTransformLatinToHangul = - _lookup('NSStringTransformLatinToHangul'); + static NSNumber numberWithUnsignedChar(NativeObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_86( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedChar_1, value); + return NSNumber._(_ret, _lib); + } - NSStringTransform get NSStringTransformLatinToHangul => - _NSStringTransformLatinToHangul.value; + static NSNumber numberWithShort(NativeObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_87( + _lib._class_NSNumber1, _lib._sel_numberWithShort_1, value); + return NSNumber._(_ret, _lib); + } - set NSStringTransformLatinToHangul(NSStringTransform value) => - _NSStringTransformLatinToHangul.value = value; + static NSNumber numberWithUnsignedShort(NativeObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_88( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedShort_1, value); + return NSNumber._(_ret, _lib); + } - late final ffi.Pointer _NSStringTransformLatinToArabic = - _lookup('NSStringTransformLatinToArabic'); + static NSNumber numberWithInt(NativeObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_89( + _lib._class_NSNumber1, _lib._sel_numberWithInt_1, value); + return NSNumber._(_ret, _lib); + } - NSStringTransform get NSStringTransformLatinToArabic => - _NSStringTransformLatinToArabic.value; + static NSNumber numberWithUnsignedInt(NativeObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_90( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInt_1, value); + return NSNumber._(_ret, _lib); + } - set NSStringTransformLatinToArabic(NSStringTransform value) => - _NSStringTransformLatinToArabic.value = value; + static NSNumber numberWithLong(NativeObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_91( + _lib._class_NSNumber1, _lib._sel_numberWithLong_1, value); + return NSNumber._(_ret, _lib); + } - late final ffi.Pointer _NSStringTransformLatinToHebrew = - _lookup('NSStringTransformLatinToHebrew'); + static NSNumber numberWithUnsignedLong(NativeObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_92( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLong_1, value); + return NSNumber._(_ret, _lib); + } - NSStringTransform get NSStringTransformLatinToHebrew => - _NSStringTransformLatinToHebrew.value; + static NSNumber numberWithLongLong(NativeObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_93( + _lib._class_NSNumber1, _lib._sel_numberWithLongLong_1, value); + return NSNumber._(_ret, _lib); + } - set NSStringTransformLatinToHebrew(NSStringTransform value) => - _NSStringTransformLatinToHebrew.value = value; + static NSNumber numberWithUnsignedLongLong( + NativeObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_94( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLongLong_1, value); + return NSNumber._(_ret, _lib); + } - late final ffi.Pointer _NSStringTransformLatinToThai = - _lookup('NSStringTransformLatinToThai'); + static NSNumber numberWithFloat(NativeObjCLibrary _lib, double value) { + final _ret = _lib._objc_msgSend_95( + _lib._class_NSNumber1, _lib._sel_numberWithFloat_1, value); + return NSNumber._(_ret, _lib); + } - NSStringTransform get NSStringTransformLatinToThai => - _NSStringTransformLatinToThai.value; + static NSNumber numberWithDouble(NativeObjCLibrary _lib, double value) { + final _ret = _lib._objc_msgSend_96( + _lib._class_NSNumber1, _lib._sel_numberWithDouble_1, value); + return NSNumber._(_ret, _lib); + } - set NSStringTransformLatinToThai(NSStringTransform value) => - _NSStringTransformLatinToThai.value = value; + static NSNumber numberWithBool(NativeObjCLibrary _lib, bool value) { + final _ret = _lib._objc_msgSend_97( + _lib._class_NSNumber1, _lib._sel_numberWithBool_1, value); + return NSNumber._(_ret, _lib); + } - late final ffi.Pointer _NSStringTransformLatinToCyrillic = - _lookup('NSStringTransformLatinToCyrillic'); + static NSNumber numberWithInteger(NativeObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_91( + _lib._class_NSNumber1, _lib._sel_numberWithInteger_1, value); + return NSNumber._(_ret, _lib); + } - NSStringTransform get NSStringTransformLatinToCyrillic => - _NSStringTransformLatinToCyrillic.value; + static NSNumber numberWithUnsignedInteger(NativeObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_92( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInteger_1, value); + return NSNumber._(_ret, _lib); + } - set NSStringTransformLatinToCyrillic(NSStringTransform value) => - _NSStringTransformLatinToCyrillic.value = value; + static NSValue valueWithBytes_objCType(NativeObjCLibrary _lib, + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_78(_lib._class_NSNumber1, + _lib._sel_valueWithBytes_objCType_1, value, type); + return NSValue._(_ret, _lib); + } - late final ffi.Pointer _NSStringTransformLatinToGreek = - _lookup('NSStringTransformLatinToGreek'); + static NSValue value_withObjCType(NativeObjCLibrary _lib, + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_78( + _lib._class_NSNumber1, _lib._sel_value_withObjCType_1, value, type); + return NSValue._(_ret, _lib); + } - NSStringTransform get NSStringTransformLatinToGreek => - _NSStringTransformLatinToGreek.value; + static NSValue valueWithNonretainedObject( + NativeObjCLibrary _lib, NSObject anObject) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSNumber1, + _lib._sel_valueWithNonretainedObject_1, anObject._id); + return NSValue._(_ret, _lib); + } - set NSStringTransformLatinToGreek(NSStringTransform value) => - _NSStringTransformLatinToGreek.value = value; + static NSValue valueWithPointer( + NativeObjCLibrary _lib, ffi.Pointer pointer) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSNumber1, _lib._sel_valueWithPointer_1, pointer); + return NSValue._(_ret, _lib); + } - late final ffi.Pointer _NSStringTransformToLatin = - _lookup('NSStringTransformToLatin'); + static NSValue valueWithRange(NativeObjCLibrary _lib, NSRange range) { + final _ret = _lib._objc_msgSend_83( + _lib._class_NSNumber1, _lib._sel_valueWithRange_1, range); + return NSValue._(_ret, _lib); + } - NSStringTransform get NSStringTransformToLatin => - _NSStringTransformToLatin.value; + static NSNumber new1(NativeObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSNumber1, _lib._sel_new1); + return NSNumber._(_ret, _lib); + } - set NSStringTransformToLatin(NSStringTransform value) => - _NSStringTransformToLatin.value = value; + static NSNumber alloc(NativeObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSNumber1, _lib._sel_alloc1); + return NSNumber._(_ret, _lib); + } +} - late final ffi.Pointer _NSStringTransformMandarinToLatin = - _lookup('NSStringTransformMandarinToLatin'); +class NSFastEnumerationState extends ffi.Struct { + @pkg_ffi.UnsignedLong() + external int state; - NSStringTransform get NSStringTransformMandarinToLatin => - _NSStringTransformMandarinToLatin.value; + external ffi.Pointer> itemsPtr; - set NSStringTransformMandarinToLatin(NSStringTransform value) => - _NSStringTransformMandarinToLatin.value = value; + external ffi.Pointer mutationsPtr; - late final ffi.Pointer - _NSStringTransformHiraganaToKatakana = - _lookup('NSStringTransformHiraganaToKatakana'); + @ffi.Array.multi([5]) + external ffi.Array extra; +} - NSStringTransform get NSStringTransformHiraganaToKatakana => - _NSStringTransformHiraganaToKatakana.value; +class NSEnumerator extends NSObject { + NSEnumerator._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); - set NSStringTransformHiraganaToKatakana(NSStringTransform value) => - _NSStringTransformHiraganaToKatakana.value = value; + static NSEnumerator castFrom(T other) { + return NSEnumerator._(other._id, other._lib); + } - late final ffi.Pointer - _NSStringTransformFullwidthToHalfwidth = - _lookup('NSStringTransformFullwidthToHalfwidth'); + static NSEnumerator castFromPointer( + NativeObjCLibrary lib, ffi.Pointer other) { + return NSEnumerator._(other, lib); + } - NSStringTransform get NSStringTransformFullwidthToHalfwidth => - _NSStringTransformFullwidthToHalfwidth.value; + NSObject nextObject() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_nextObject1); + return NSObject._(_ret, _lib); + } - set NSStringTransformFullwidthToHalfwidth(NSStringTransform value) => - _NSStringTransformFullwidthToHalfwidth.value = value; + NSObject? get allObjects { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_allObjects1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } - late final ffi.Pointer _NSStringTransformToXMLHex = - _lookup('NSStringTransformToXMLHex'); + static NSEnumerator new1(NativeObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSEnumerator1, _lib._sel_new1); + return NSEnumerator._(_ret, _lib); + } - NSStringTransform get NSStringTransformToXMLHex => - _NSStringTransformToXMLHex.value; + static NSEnumerator alloc(NativeObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSEnumerator1, _lib._sel_alloc1); + return NSEnumerator._(_ret, _lib); + } +} - set NSStringTransformToXMLHex(NSStringTransform value) => - _NSStringTransformToXMLHex.value = value; +abstract class NSCollectionChangeType { + static const int NSCollectionChangeInsert = 0; + static const int NSCollectionChangeRemove = 1; +} - late final ffi.Pointer _NSStringTransformToUnicodeName = - _lookup('NSStringTransformToUnicodeName'); +abstract class NSOrderedCollectionDifferenceCalculationOptions { + static const int NSOrderedCollectionDifferenceCalculationOmitInsertedObjects = + 1; + static const int NSOrderedCollectionDifferenceCalculationOmitRemovedObjects = + 2; + static const int NSOrderedCollectionDifferenceCalculationInferMoves = 4; +} - NSStringTransform get NSStringTransformToUnicodeName => - _NSStringTransformToUnicodeName.value; +class NSArray extends NSObject { + NSArray._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); - set NSStringTransformToUnicodeName(NSStringTransform value) => - _NSStringTransformToUnicodeName.value = value; + static NSArray castFrom(T other) { + return NSArray._(other._id, other._lib); + } - late final ffi.Pointer - _NSStringTransformStripCombiningMarks = - _lookup('NSStringTransformStripCombiningMarks'); + static NSArray castFromPointer( + NativeObjCLibrary lib, ffi.Pointer other) { + return NSArray._(other, lib); + } - NSStringTransform get NSStringTransformStripCombiningMarks => - _NSStringTransformStripCombiningMarks.value; + int get count { + return _lib._objc_msgSend_11(_id, _lib._sel_count1); + } - set NSStringTransformStripCombiningMarks(NSStringTransform value) => - _NSStringTransformStripCombiningMarks.value = value; + NSObject objectAtIndex(int index) { + final _ret = _lib._objc_msgSend_104(_id, _lib._sel_objectAtIndex_1, index); + return NSObject._(_ret, _lib); + } - late final ffi.Pointer _NSStringTransformStripDiacritics = - _lookup('NSStringTransformStripDiacritics'); + @override + NSArray init() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); + return NSArray._(_ret, _lib); + } - NSStringTransform get NSStringTransformStripDiacritics => - _NSStringTransformStripDiacritics.value; + NSArray initWithObjects_count( + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_105( + _id, _lib._sel_initWithObjects_count_1, objects, cnt); + return NSArray._(_ret, _lib); + } - set NSStringTransformStripDiacritics(NSStringTransform value) => - _NSStringTransformStripDiacritics.value = value; + NSArray initWithCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib); + } - late final ffi.Pointer - _NSStringEncodingDetectionSuggestedEncodingsKey = - _lookup( - 'NSStringEncodingDetectionSuggestedEncodingsKey'); + NSString componentsJoinedByString(NSObject? separator) { + final _ret = _lib._objc_msgSend_28(_id, + _lib._sel_componentsJoinedByString_1, separator?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionSuggestedEncodingsKey => - _NSStringEncodingDetectionSuggestedEncodingsKey.value; + bool containsObject(NSObject anObject) { + return _lib._objc_msgSend_4(_id, _lib._sel_containsObject_1, anObject._id); + } - set NSStringEncodingDetectionSuggestedEncodingsKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionSuggestedEncodingsKey.value = value; + NSObject? get description { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_description1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } - late final ffi.Pointer - _NSStringEncodingDetectionDisallowedEncodingsKey = - _lookup( - 'NSStringEncodingDetectionDisallowedEncodingsKey'); + NSString descriptionWithLocale(NSObject locale) { + final _ret = _lib._objc_msgSend_28( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib); + } - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionDisallowedEncodingsKey => - _NSStringEncodingDetectionDisallowedEncodingsKey.value; + NSString descriptionWithLocale_indent(NSObject locale, int level) { + final _ret = _lib._objc_msgSend_106( + _id, _lib._sel_descriptionWithLocale_indent_1, locale._id, level); + return NSString._(_ret, _lib); + } - set NSStringEncodingDetectionDisallowedEncodingsKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionDisallowedEncodingsKey.value = value; + NSObject firstObjectCommonWithArray(NSObject? otherArray) { + final _ret = _lib._objc_msgSend_13(_id, + _lib._sel_firstObjectCommonWithArray_1, otherArray?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } - late final ffi.Pointer - _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey = - _lookup( - 'NSStringEncodingDetectionUseOnlySuggestedEncodingsKey'); + void getObjects_range( + ffi.Pointer> objects, NSRange range) { + _lib._objc_msgSend_107(_id, _lib._sel_getObjects_range_1, objects, range); + } - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionUseOnlySuggestedEncodingsKey => - _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value; + int indexOfObject(NSObject anObject) { + return _lib._objc_msgSend_108(_id, _lib._sel_indexOfObject_1, anObject._id); + } - set NSStringEncodingDetectionUseOnlySuggestedEncodingsKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value = value; + int indexOfObject_inRange(NSObject anObject, NSRange range) { + return _lib._objc_msgSend_109( + _id, _lib._sel_indexOfObject_inRange_1, anObject._id, range); + } - late final ffi.Pointer - _NSStringEncodingDetectionAllowLossyKey = - _lookup( - 'NSStringEncodingDetectionAllowLossyKey'); + int indexOfObjectIdenticalTo(NSObject anObject) { + return _lib._objc_msgSend_108( + _id, _lib._sel_indexOfObjectIdenticalTo_1, anObject._id); + } - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionAllowLossyKey => - _NSStringEncodingDetectionAllowLossyKey.value; + int indexOfObjectIdenticalTo_inRange(NSObject anObject, NSRange range) { + return _lib._objc_msgSend_109( + _id, _lib._sel_indexOfObjectIdenticalTo_inRange_1, anObject._id, range); + } - set NSStringEncodingDetectionAllowLossyKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionAllowLossyKey.value = value; + bool isEqualToArray(NSObject? otherArray) { + return _lib._objc_msgSend_4( + _id, _lib._sel_isEqualToArray_1, otherArray?._id ?? ffi.nullptr); + } - late final ffi.Pointer - _NSStringEncodingDetectionFromWindowsKey = - _lookup( - 'NSStringEncodingDetectionFromWindowsKey'); + NSObject get firstObject { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_firstObject1); + return NSObject._(_ret, _lib); + } - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionFromWindowsKey => - _NSStringEncodingDetectionFromWindowsKey.value; + NSObject get lastObject { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_lastObject1); + return NSObject._(_ret, _lib); + } - set NSStringEncodingDetectionFromWindowsKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionFromWindowsKey.value = value; + NSObject? get sortedArrayHint { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_sortedArrayHint1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } - late final ffi.Pointer - _NSStringEncodingDetectionLossySubstitutionKey = - _lookup( - 'NSStringEncodingDetectionLossySubstitutionKey'); + bool writeToURL_error( + NSObject? url, ffi.Pointer> error) { + return _lib._objc_msgSend_110( + _id, _lib._sel_writeToURL_error_1, url?._id ?? ffi.nullptr, error); + } - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionLossySubstitutionKey => - _NSStringEncodingDetectionLossySubstitutionKey.value; + void makeObjectsPerformSelector(ffi.Pointer aSelector) { + _lib._objc_msgSend_6( + _id, _lib._sel_makeObjectsPerformSelector_1, aSelector); + } - set NSStringEncodingDetectionLossySubstitutionKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionLossySubstitutionKey.value = value; + void makeObjectsPerformSelector_withObject( + ffi.Pointer aSelector, NSObject argument) { + _lib._objc_msgSend_111( + _id, + _lib._sel_makeObjectsPerformSelector_withObject_1, + aSelector, + argument._id); + } - late final ffi.Pointer - _NSStringEncodingDetectionLikelyLanguageKey = - _lookup( - 'NSStringEncodingDetectionLikelyLanguageKey'); + NSObject objectAtIndexedSubscript(int idx) { + final _ret = + _lib._objc_msgSend_104(_id, _lib._sel_objectAtIndexedSubscript_1, idx); + return NSObject._(_ret, _lib); + } - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionLikelyLanguageKey => - _NSStringEncodingDetectionLikelyLanguageKey.value; + void enumerateObjectsUsingBlock(NSObject block) { + _lib._objc_msgSend_8( + _id, _lib._sel_enumerateObjectsUsingBlock_1, block._id); + } - set NSStringEncodingDetectionLikelyLanguageKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionLikelyLanguageKey.value = value; + void enumerateObjectsWithOptions_usingBlock(int opts, NSObject block) { + _lib._objc_msgSend_112(_id, + _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._id); + } - late final ffi.Pointer _NSCharacterConversionException = - _lookup('NSCharacterConversionException'); + void enumerateObjectsAtIndexes_options_usingBlock( + NSObject? s, int opts, NSObject block) { + _lib._objc_msgSend_113( + _id, + _lib._sel_enumerateObjectsAtIndexes_options_usingBlock_1, + s?._id ?? ffi.nullptr, + opts, + block._id); + } - NSExceptionName get NSCharacterConversionException => - _NSCharacterConversionException.value; + int indexOfObjectPassingTest(NSObject predicate) { + return _lib._objc_msgSend_108( + _id, _lib._sel_indexOfObjectPassingTest_1, predicate._id); + } - set NSCharacterConversionException(NSExceptionName value) => - _NSCharacterConversionException.value = value; + int indexOfObjectWithOptions_passingTest(int opts, NSObject predicate) { + return _lib._objc_msgSend_114(_id, + _lib._sel_indexOfObjectWithOptions_passingTest_1, opts, predicate._id); + } - late final ffi.Pointer _NSParseErrorException = - _lookup('NSParseErrorException'); + int indexOfObjectAtIndexes_options_passingTest( + NSObject? s, int opts, NSObject predicate) { + return _lib._objc_msgSend_115( + _id, + _lib._sel_indexOfObjectAtIndexes_options_passingTest_1, + s?._id ?? ffi.nullptr, + opts, + predicate._id); + } - NSExceptionName get NSParseErrorException => _NSParseErrorException.value; + NSIndexSet indexesOfObjectsPassingTest(NSObject predicate) { + final _ret = _lib._objc_msgSend_122( + _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._id); + return NSIndexSet._(_ret, _lib); + } - set NSParseErrorException(NSExceptionName value) => - _NSParseErrorException.value = value; + NSIndexSet indexesOfObjectsWithOptions_passingTest( + int opts, NSObject predicate) { + final _ret = _lib._objc_msgSend_123( + _id, + _lib._sel_indexesOfObjectsWithOptions_passingTest_1, + opts, + predicate._id); + return NSIndexSet._(_ret, _lib); + } - ffi.Pointer _registerName1(String name) { - final cstr = name.toNativeUtf8(); - final sel = _sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; + NSIndexSet indexesOfObjectsAtIndexes_options_passingTest( + NSObject? s, int opts, NSObject predicate) { + final _ret = _lib._objc_msgSend_125( + _id, + _lib._sel_indexesOfObjectsAtIndexes_options_passingTest_1, + s?._id ?? ffi.nullptr, + opts, + predicate._id); + return NSIndexSet._(_ret, _lib); } - ffi.Pointer _sel_registerName( - ffi.Pointer str, - ) { - return __sel_registerName( - str, - ); + int indexOfObject_inSortedRange_options_usingComparator( + NSObject obj, NSRange r, int opts, NSComparator cmp) { + return _lib._objc_msgSend_126( + _id, + _lib._sel_indexOfObject_inSortedRange_options_usingComparator_1, + obj._id, + r, + opts, + cmp); } - late final __sel_registerNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sel_registerName'); - late final __sel_registerName = __sel_registerNamePtr - .asFunction Function(ffi.Pointer)>(); + static NSArray array(NativeObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSArray1, _lib._sel_array1); + return NSArray._(_ret, _lib); + } - ffi.Pointer _getClass1(String name) { - final cstr = name.toNativeUtf8(); - final clazz = _objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return clazz; + static NSArray arrayWithObject(NativeObjCLibrary _lib, NSObject anObject) { + final _ret = _lib._objc_msgSend_13( + _lib._class_NSArray1, _lib._sel_arrayWithObject_1, anObject._id); + return NSArray._(_ret, _lib); } - ffi.Pointer _objc_getClass( - ffi.Pointer str, - ) { - return __objc_getClass( - str, - ); + static NSArray arrayWithObjects_count(NativeObjCLibrary _lib, + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_105( + _lib._class_NSArray1, _lib._sel_arrayWithObjects_count_1, objects, cnt); + return NSArray._(_ret, _lib); } - late final __objc_getClassPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('objc_getClass'); - late final __objc_getClass = __objc_getClassPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + static NSArray arrayWithObjects(NativeObjCLibrary _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_13( + _lib._class_NSArray1, _lib._sel_arrayWithObjects_1, firstObj._id); + return NSArray._(_ret, _lib); + } - late final ffi.Pointer _class_Foo1 = _getClass1("Foo"); - late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); - late final ffi.Pointer _sel_load1 = _registerName1("load"); - void _objc_msgSend_0( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_0( - obj, - sel, - ); + static NSArray arrayWithArray(NativeObjCLibrary _lib, NSObject? array) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSArray1, + _lib._sel_arrayWithArray_1, array?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib); } - late final __objc_msgSend_0Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); + NSArray initWithObjects(NSObject firstObj) { + final _ret = + _lib._objc_msgSend_13(_id, _lib._sel_initWithObjects_1, firstObj._id); + return NSArray._(_ret, _lib); + } - late final ffi.Pointer _sel_initialize1 = - _registerName1("initialize"); - late final ffi.Pointer _sel_init1 = _registerName1("init"); - instancetype _objc_msgSend_1( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1( - obj, - sel, - ); + NSArray initWithArray(NSObject? array) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithArray_1, array?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib); } - late final __objc_msgSend_1Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer)>(); + NSArray initWithArray_copyItems(NSObject? array, bool flag) { + final _ret = _lib._objc_msgSend_127(_id, + _lib._sel_initWithArray_copyItems_1, array?._id ?? ffi.nullptr, flag); + return NSArray._(_ret, _lib); + } - late final ffi.Pointer _sel_new1 = _registerName1("new"); - late final ffi.Pointer _sel_allocWithZone_1 = - _registerName1("allocWithZone:"); - instancetype _objc_msgSend_2( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_2( - obj, - sel, - zone, - ); + void getObjects(ffi.Pointer> objects) { + _lib._objc_msgSend_128(_id, _lib._sel_getObjects_1, objects); } - late final __objc_msgSend_2Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>(); + bool writeToFile_atomically(NSObject? path, bool useAuxiliaryFile) { + return _lib._objc_msgSend_71(_id, _lib._sel_writeToFile_atomically_1, + path?._id ?? ffi.nullptr, useAuxiliaryFile); + } - late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); - late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); - late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); - late final ffi.Pointer _sel_copy1 = _registerName1("copy"); - late final ffi.Pointer _sel_mutableCopy1 = - _registerName1("mutableCopy"); - late final ffi.Pointer _sel_copyWithZone_1 = - _registerName1("copyWithZone:"); - late final ffi.Pointer _sel_mutableCopyWithZone_1 = - _registerName1("mutableCopyWithZone:"); - late final ffi.Pointer _sel_instancesRespondToSelector_1 = - _registerName1("instancesRespondToSelector:"); - bool _objc_msgSend_3( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_3( - obj, - sel, - aSelector, - ) != - 0; + bool writeToURL_atomically(NSObject? url, bool atomically) { + return _lib._objc_msgSend_71(_id, _lib._sel_writeToURL_atomically_1, + url?._id ?? ffi.nullptr, atomically); } - late final __objc_msgSend_3Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + static NSArray new1(NativeObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSArray1, _lib._sel_new1); + return NSArray._(_ret, _lib); + } - late final ffi.Pointer _sel_conformsToProtocol_1 = - _registerName1("conformsToProtocol:"); - bool _objc_msgSend_4( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer protocol, - ) { - return __objc_msgSend_4( - obj, - sel, - protocol, - ) != - 0; + static NSArray alloc(NativeObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSArray1, _lib._sel_alloc1); + return NSArray._(_ret, _lib); } +} - late final __objc_msgSend_4Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); +class NSIndexSet extends NSObject { + NSIndexSet._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); - late final ffi.Pointer _sel_methodForSelector_1 = - _registerName1("methodForSelector:"); - IMP _objc_msgSend_5( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_5( - obj, - sel, - aSelector, - ); + static NSIndexSet castFrom(T other) { + return NSIndexSet._(other._id, other._lib); } - late final __objc_msgSend_5Ptr = _lookup< - ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + static NSIndexSet castFromPointer( + NativeObjCLibrary lib, ffi.Pointer other) { + return NSIndexSet._(other, lib); + } - late final ffi.Pointer _sel_instanceMethodForSelector_1 = - _registerName1("instanceMethodForSelector:"); - late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = - _registerName1("doesNotRecognizeSelector:"); - void _objc_msgSend_6( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_6( - obj, - sel, - aSelector, - ); + static NSIndexSet indexSet(NativeObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSIndexSet1, _lib._sel_indexSet1); + return NSIndexSet._(_ret, _lib); } - late final __objc_msgSend_6Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + static NSIndexSet indexSetWithIndex(NativeObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_104( + _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndex_1, value); + return NSIndexSet._(_ret, _lib); + } - late final ffi.Pointer _sel_forwardingTargetForSelector_1 = - _registerName1("forwardingTargetForSelector:"); - ffi.Pointer _objc_msgSend_7( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_7( - obj, - sel, - aSelector, - ); + static NSIndexSet indexSetWithIndexesInRange( + NativeObjCLibrary _lib, NSRange range) { + final _ret = _lib._objc_msgSend_116( + _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndexesInRange_1, range); + return NSIndexSet._(_ret, _lib); } - late final __objc_msgSend_7Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + NSIndexSet initWithIndexesInRange(NSRange range) { + final _ret = + _lib._objc_msgSend_116(_id, _lib._sel_initWithIndexesInRange_1, range); + return NSIndexSet._(_ret, _lib); + } - late final ffi.Pointer _sel_forwardInvocation_1 = - _registerName1("forwardInvocation:"); - void _objc_msgSend_8( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anInvocation, - ) { - return __objc_msgSend_8( - obj, - sel, - anInvocation, - ); + NSIndexSet initWithIndexSet(NSObject? indexSet) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithIndexSet_1, indexSet?._id ?? ffi.nullptr); + return NSIndexSet._(_ret, _lib); } - late final __objc_msgSend_8Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + NSIndexSet initWithIndex(int value) { + final _ret = _lib._objc_msgSend_104(_id, _lib._sel_initWithIndex_1, value); + return NSIndexSet._(_ret, _lib); + } - late final ffi.Pointer _class_NSMethodSignature1 = - _getClass1("NSMethodSignature"); - late final ffi.Pointer _sel_methodSignatureForSelector_1 = - _registerName1("methodSignatureForSelector:"); - ffi.Pointer _objc_msgSend_9( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_9( - obj, - sel, - aSelector, - ); + bool isEqualToIndexSet(NSObject? indexSet) { + return _lib._objc_msgSend_4( + _id, _lib._sel_isEqualToIndexSet_1, indexSet?._id ?? ffi.nullptr); } - late final __objc_msgSend_9Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + int get count { + return _lib._objc_msgSend_11(_id, _lib._sel_count1); + } - late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = - _registerName1("instanceMethodSignatureForSelector:"); - late final ffi.Pointer _sel_allowsWeakReference1 = - _registerName1("allowsWeakReference"); - bool _objc_msgSend_10( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_10( - obj, - sel, - ) != - 0; + int get firstIndex { + return _lib._objc_msgSend_11(_id, _lib._sel_firstIndex1); } - late final __objc_msgSend_10Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int get lastIndex { + return _lib._objc_msgSend_11(_id, _lib._sel_lastIndex1); + } - late final ffi.Pointer _sel_retainWeakReference1 = - _registerName1("retainWeakReference"); - late final ffi.Pointer _sel_isSubclassOfClass_1 = - _registerName1("isSubclassOfClass:"); - late final ffi.Pointer _sel_resolveClassMethod_1 = - _registerName1("resolveClassMethod:"); - late final ffi.Pointer _sel_resolveInstanceMethod_1 = - _registerName1("resolveInstanceMethod:"); - late final ffi.Pointer _sel_hash1 = _registerName1("hash"); - int _objc_msgSend_11( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_11( - obj, - sel, - ); + int indexGreaterThanIndex(int value) { + return _lib._objc_msgSend_43(_id, _lib._sel_indexGreaterThanIndex_1, value); } - late final __objc_msgSend_11Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int indexLessThanIndex(int value) { + return _lib._objc_msgSend_43(_id, _lib._sel_indexLessThanIndex_1, value); + } - late final ffi.Pointer _sel_superclass1 = - _registerName1("superclass"); - late final ffi.Pointer _sel_class1 = _registerName1("class"); - late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); - late final ffi.Pointer _sel_length1 = _registerName1("length"); - late final ffi.Pointer _sel_characterAtIndex_1 = - _registerName1("characterAtIndex:"); - int _objc_msgSend_12( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ) { - return __objc_msgSend_12( - obj, - sel, - index, - ); + int indexGreaterThanOrEqualToIndex(int value) { + return _lib._objc_msgSend_43( + _id, _lib._sel_indexGreaterThanOrEqualToIndex_1, value); } - late final __objc_msgSend_12Ptr = _lookup< - ffi.NativeFunction< - unichar Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + int indexLessThanOrEqualToIndex(int value) { + return _lib._objc_msgSend_43( + _id, _lib._sel_indexLessThanOrEqualToIndex_1, value); + } - late final ffi.Pointer _sel_initWithCoder_1 = - _registerName1("initWithCoder:"); - instancetype _objc_msgSend_13( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_13( - obj, - sel, - coder, - ); + int getIndexes_maxCount_inIndexRange(ffi.Pointer indexBuffer, + int bufferSize, NSRangePointer range) { + return _lib._objc_msgSend_117( + _id, + _lib._sel_getIndexes_maxCount_inIndexRange_1, + indexBuffer, + bufferSize, + range); } - late final __objc_msgSend_13Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int countOfIndexesInRange(NSRange range) { + return _lib._objc_msgSend_118( + _id, _lib._sel_countOfIndexesInRange_1, range); + } - late final ffi.Pointer _sel_stringWithCString_encoding_1 = - _registerName1("stringWithCString:encoding:"); - ffi.Pointer _objc_msgSend_14( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cString, - int enc, - ) { - return __objc_msgSend_14( - obj, - sel, - cString, - enc, - ); + bool containsIndex(int value) { + return _lib._objc_msgSend_39(_id, _lib._sel_containsIndex_1, value); } - late final __objc_msgSend_14Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); + bool containsIndexesInRange(NSRange range) { + return _lib._objc_msgSend_119( + _id, _lib._sel_containsIndexesInRange_1, range); + } - late final ffi.Pointer _sel_UTF8String1 = - _registerName1("UTF8String"); - ffi.Pointer _objc_msgSend_15( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_15( - obj, - sel, - ); + bool containsIndexes(NSObject? indexSet) { + return _lib._objc_msgSend_4( + _id, _lib._sel_containsIndexes_1, indexSet?._id ?? ffi.nullptr); } - late final __objc_msgSend_15Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + bool intersectsIndexesInRange(NSRange range) { + return _lib._objc_msgSend_119( + _id, _lib._sel_intersectsIndexesInRange_1, range); + } - late final ffi.Pointer _sel_description1 = - _registerName1("description"); - ffi.Pointer _objc_msgSend_16( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_16( - obj, - sel, - ); + void enumerateIndexesUsingBlock(NSObject block) { + _lib._objc_msgSend_8( + _id, _lib._sel_enumerateIndexesUsingBlock_1, block._id); } - late final __objc_msgSend_16Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + void enumerateIndexesWithOptions_usingBlock(int opts, NSObject block) { + _lib._objc_msgSend_112(_id, + _lib._sel_enumerateIndexesWithOptions_usingBlock_1, opts, block._id); + } - late final ffi.Pointer _sel_debugDescription1 = - _registerName1("debugDescription"); - late final ffi.Pointer _sel_intVal1 = _registerName1("intVal"); - int _objc_msgSend_17( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_17( - obj, - sel, - ); + void enumerateIndexesInRange_options_usingBlock( + NSRange range, int opts, NSObject block) { + _lib._objc_msgSend_120( + _id, + _lib._sel_enumerateIndexesInRange_options_usingBlock_1, + range, + opts, + block._id); } - late final __objc_msgSend_17Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int indexPassingTest(NSObject predicate) { + return _lib._objc_msgSend_108( + _id, _lib._sel_indexPassingTest_1, predicate._id); + } - late final ffi.Pointer _sel_setIntVal_1 = - _registerName1("setIntVal:"); - void _objc_msgSend_18( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_18( - obj, - sel, - value, - ); + int indexWithOptions_passingTest(int opts, NSObject predicate) { + return _lib._objc_msgSend_114( + _id, _lib._sel_indexWithOptions_passingTest_1, opts, predicate._id); } - late final __objc_msgSend_18Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + int indexInRange_options_passingTest( + NSRange range, int opts, NSObject predicate) { + return _lib._objc_msgSend_121( + _id, + _lib._sel_indexInRange_options_passingTest_1, + range, + opts, + predicate._id); + } - late final ffi.Pointer _sel_makeFoo_1 = _registerName1("makeFoo:"); - ffi.Pointer _objc_msgSend_19( - ffi.Pointer obj, - ffi.Pointer sel, - double x, - ) { - return __objc_msgSend_19( - obj, - sel, - x, - ); + NSIndexSet indexesPassingTest(NSObject predicate) { + final _ret = _lib._objc_msgSend_122( + _id, _lib._sel_indexesPassingTest_1, predicate._id); + return NSIndexSet._(_ret, _lib); } - late final __objc_msgSend_19Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); + NSIndexSet indexesWithOptions_passingTest(int opts, NSObject predicate) { + final _ret = _lib._objc_msgSend_123( + _id, _lib._sel_indexesWithOptions_passingTest_1, opts, predicate._id); + return NSIndexSet._(_ret, _lib); + } - late final ffi.Pointer _sel_multiply_withOtherFoo_1 = - _registerName1("multiply:withOtherFoo:"); - int _objc_msgSend_20( - ffi.Pointer obj, - ffi.Pointer sel, - bool useIntVals, - ffi.Pointer other, - ) { - return __objc_msgSend_20( - obj, - sel, - useIntVals ? 1 : 0, - other, - ); + NSIndexSet indexesInRange_options_passingTest( + NSRange range, int opts, NSObject predicate) { + final _ret = _lib._objc_msgSend_124( + _id, + _lib._sel_indexesInRange_options_passingTest_1, + range, + opts, + predicate._id); + return NSIndexSet._(_ret, _lib); } - late final __objc_msgSend_20Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Uint8, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); + void enumerateRangesUsingBlock(NSObject block) { + _lib._objc_msgSend_8(_id, _lib._sel_enumerateRangesUsingBlock_1, block._id); + } + + void enumerateRangesWithOptions_usingBlock(int opts, NSObject block) { + _lib._objc_msgSend_112(_id, + _lib._sel_enumerateRangesWithOptions_usingBlock_1, opts, block._id); + } + + void enumerateRangesInRange_options_usingBlock( + NSRange range, int opts, NSObject block) { + _lib._objc_msgSend_120( + _id, + _lib._sel_enumerateRangesInRange_options_usingBlock_1, + range, + opts, + block._id); + } - late final ffi.Pointer _sel_setDoubleVal_1 = - _registerName1("setDoubleVal:"); - void _objc_msgSend_21( - ffi.Pointer obj, - ffi.Pointer sel, - double x, - ) { - return __objc_msgSend_21( - obj, - sel, - x, - ); + static NSIndexSet new1(NativeObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSIndexSet1, _lib._sel_new1); + return NSIndexSet._(_ret, _lib); } - late final __objc_msgSend_21Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, double)>(); + static NSIndexSet alloc(NativeObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSIndexSet1, _lib._sel_alloc1); + return NSIndexSet._(_ret, _lib); + } } -abstract class NSComparisonResult { - static const int NSOrderedAscending = -1; - static const int NSOrderedSame = 0; - static const int NSOrderedDescending = 1; +abstract class NSBinarySearchingOptions { + static const int NSBinarySearchingFirstEqual = 256; + static const int NSBinarySearchingLastEqual = 512; + static const int NSBinarySearchingInsertionIndex = 1024; } -abstract class NSEnumerationOptions { - static const int NSEnumerationConcurrent = 1; - static const int NSEnumerationReverse = 2; -} +typedef NSComparator = ffi.Pointer; -abstract class NSSortOptions { - static const int NSSortConcurrent = 1; - static const int NSSortStable = 16; -} +class NSMutableArray extends NSArray { + NSMutableArray._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); -abstract class NSQualityOfService { - static const int NSQualityOfServiceUserInteractive = 33; - static const int NSQualityOfServiceUserInitiated = 25; - static const int NSQualityOfServiceUtility = 17; - static const int NSQualityOfServiceBackground = 9; - static const int NSQualityOfServiceDefault = -1; -} + static NSMutableArray castFrom(T other) { + return NSMutableArray._(other._id, other._lib); + } -typedef NSInteger = pkg_ffi.Long; + static NSMutableArray castFromPointer( + NativeObjCLibrary lib, ffi.Pointer other) { + return NSMutableArray._(other, lib); + } -class __CFString extends ffi.Opaque {} + void addObject(NSObject anObject) { + _lib._objc_msgSend_8(_id, _lib._sel_addObject_1, anObject._id); + } -abstract class CFComparisonResult { - static const int kCFCompareLessThan = -1; - static const int kCFCompareEqualTo = 0; - static const int kCFCompareGreaterThan = 1; -} + void insertObject_atIndex(NSObject anObject, int index) { + _lib._objc_msgSend_129( + _id, _lib._sel_insertObject_atIndex_1, anObject._id, index); + } -typedef CFIndex = pkg_ffi.Long; + void removeLastObject() { + _lib._objc_msgSend_0(_id, _lib._sel_removeLastObject1); + } -class CFRange extends ffi.Struct { - @CFIndex() - external int location; + void removeObjectAtIndex(int index) { + _lib._objc_msgSend_40(_id, _lib._sel_removeObjectAtIndex_1, index); + } - @CFIndex() - external int length; -} + void replaceObjectAtIndex_withObject(int index, NSObject anObject) { + _lib._objc_msgSend_130( + _id, _lib._sel_replaceObjectAtIndex_withObject_1, index, anObject._id); + } -class __CFNull extends ffi.Opaque {} + @override + NSMutableArray init() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); + return NSMutableArray._(_ret, _lib); + } -typedef CFNullRef = ffi.Pointer<__CFNull>; + NSMutableArray initWithCapacity(int numItems) { + final _ret = + _lib._objc_msgSend_104(_id, _lib._sel_initWithCapacity_1, numItems); + return NSMutableArray._(_ret, _lib); + } -class __CFAllocator extends ffi.Opaque {} + @override + NSMutableArray initWithCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib); + } -typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; + void addObjectsFromArray(NSObject? otherArray) { + _lib._objc_msgSend_8( + _id, _lib._sel_addObjectsFromArray_1, otherArray?._id ?? ffi.nullptr); + } -class CFAllocatorContext extends ffi.Struct { - @CFIndex() - external int version; + void exchangeObjectAtIndex_withObjectAtIndex(int idx1, int idx2) { + _lib._objc_msgSend_131( + _id, _lib._sel_exchangeObjectAtIndex_withObjectAtIndex_1, idx1, idx2); + } - external ffi.Pointer info; + void removeAllObjects() { + _lib._objc_msgSend_0(_id, _lib._sel_removeAllObjects1); + } - external CFAllocatorRetainCallBack retain; + void removeObject_inRange(NSObject anObject, NSRange range) { + _lib._objc_msgSend_132( + _id, _lib._sel_removeObject_inRange_1, anObject._id, range); + } - external CFAllocatorReleaseCallBack release; + void removeObject(NSObject anObject) { + _lib._objc_msgSend_8(_id, _lib._sel_removeObject_1, anObject._id); + } - external CFAllocatorCopyDescriptionCallBack copyDescription; + void removeObjectIdenticalTo_inRange(NSObject anObject, NSRange range) { + _lib._objc_msgSend_132( + _id, _lib._sel_removeObjectIdenticalTo_inRange_1, anObject._id, range); + } - external CFAllocatorAllocateCallBack allocate; + void removeObjectIdenticalTo(NSObject anObject) { + _lib._objc_msgSend_8( + _id, _lib._sel_removeObjectIdenticalTo_1, anObject._id); + } - external CFAllocatorReallocateCallBack reallocate; + void removeObjectsFromIndices_numIndices( + ffi.Pointer indices, int cnt) { + _lib._objc_msgSend_133( + _id, _lib._sel_removeObjectsFromIndices_numIndices_1, indices, cnt); + } - external CFAllocatorDeallocateCallBack deallocate; + void removeObjectsInArray(NSObject? otherArray) { + _lib._objc_msgSend_8( + _id, _lib._sel_removeObjectsInArray_1, otherArray?._id ?? ffi.nullptr); + } - external CFAllocatorPreferredSizeCallBack preferredSize; -} + void removeObjectsInRange(NSRange range) { + _lib._objc_msgSend_134(_id, _lib._sel_removeObjectsInRange_1, range); + } -typedef CFAllocatorRetainCallBack = ffi.Pointer< - ffi.NativeFunction Function(ffi.Pointer)>>; -typedef CFAllocatorReleaseCallBack - = ffi.Pointer)>>; -typedef CFAllocatorCopyDescriptionCallBack = ffi - .Pointer)>>; -typedef CFStringRef = ffi.Pointer<__CFString>; -typedef CFAllocatorAllocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - CFIndex, CFOptionFlags, ffi.Pointer)>>; -typedef CFOptionFlags = pkg_ffi.UnsignedLong; -typedef CFAllocatorReallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, CFIndex, - CFOptionFlags, ffi.Pointer)>>; -typedef CFAllocatorDeallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; -typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< - ffi.NativeFunction< - CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; + void replaceObjectsInRange_withObjectsFromArray_range( + NSRange range, NSObject? otherArray, NSRange otherRange) { + _lib._objc_msgSend_135( + _id, + _lib._sel_replaceObjectsInRange_withObjectsFromArray_range_1, + range, + otherArray?._id ?? ffi.nullptr, + otherRange); + } -class _NSRange extends ffi.Struct { - @NSUInteger() - external int location; + void replaceObjectsInRange_withObjectsFromArray( + NSRange range, NSObject? otherArray) { + _lib._objc_msgSend_136( + _id, + _lib._sel_replaceObjectsInRange_withObjectsFromArray_1, + range, + otherArray?._id ?? ffi.nullptr); + } - @NSUInteger() - external int length; -} + void setArray(NSObject? otherArray) { + _lib._objc_msgSend_8( + _id, _lib._sel_setArray_1, otherArray?._id ?? ffi.nullptr); + } -typedef NSUInteger = pkg_ffi.UnsignedLong; + void sortUsingFunction_context( + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + compare, + ffi.Pointer context) { + _lib._objc_msgSend_137( + _id, _lib._sel_sortUsingFunction_context_1, compare, context); + } -class NSFastEnumerationState extends ffi.Struct { - @pkg_ffi.UnsignedLong() - external int state; + void sortUsingSelector(ffi.Pointer comparator) { + _lib._objc_msgSend_6(_id, _lib._sel_sortUsingSelector_1, comparator); + } - external ffi.Pointer> itemsPtr; + void insertObjects_atIndexes(NSObject? objects, NSObject? indexes) { + _lib._objc_msgSend_138(_id, _lib._sel_insertObjects_atIndexes_1, + objects?._id ?? ffi.nullptr, indexes?._id ?? ffi.nullptr); + } - external ffi.Pointer mutationsPtr; + void removeObjectsAtIndexes(NSObject? indexes) { + _lib._objc_msgSend_8( + _id, _lib._sel_removeObjectsAtIndexes_1, indexes?._id ?? ffi.nullptr); + } - @ffi.Array.multi([5]) - external ffi.Array extra; -} + void replaceObjectsAtIndexes_withObjects( + NSObject? indexes, NSObject? objects) { + _lib._objc_msgSend_138(_id, _lib._sel_replaceObjectsAtIndexes_withObjects_1, + indexes?._id ?? ffi.nullptr, objects?._id ?? ffi.nullptr); + } -class ObjCObject extends ffi.Opaque {} + void setObject_atIndexedSubscript(NSObject obj, int idx) { + _lib._objc_msgSend_129( + _id, _lib._sel_setObject_atIndexedSubscript_1, obj._id, idx); + } -abstract class NSCollectionChangeType { - static const int NSCollectionChangeInsert = 0; - static const int NSCollectionChangeRemove = 1; -} + void sortUsingComparator(NSComparator cmptr) { + _lib._objc_msgSend_8(_id, _lib._sel_sortUsingComparator_1, cmptr); + } -abstract class NSOrderedCollectionDifferenceCalculationOptions { - static const int NSOrderedCollectionDifferenceCalculationOmitInsertedObjects = - 1; - static const int NSOrderedCollectionDifferenceCalculationOmitRemovedObjects = - 2; - static const int NSOrderedCollectionDifferenceCalculationInferMoves = 4; -} + void sortWithOptions_usingComparator(int opts, NSComparator cmptr) { + _lib._objc_msgSend_139( + _id, _lib._sel_sortWithOptions_usingComparator_1, opts, cmptr); + } -abstract class NSBinarySearchingOptions { - static const int NSBinarySearchingFirstEqual = 256; - static const int NSBinarySearchingLastEqual = 512; - static const int NSBinarySearchingInsertionIndex = 1024; + static NSMutableArray arrayWithCapacity( + NativeObjCLibrary _lib, int numItems) { + final _ret = _lib._objc_msgSend_104( + _lib._class_NSMutableArray1, _lib._sel_arrayWithCapacity_1, numItems); + return NSMutableArray._(_ret, _lib); + } + + void applyDifference(NSObject? difference) { + _lib._objc_msgSend_8( + _id, _lib._sel_applyDifference_1, difference?._id ?? ffi.nullptr); + } + + static NSMutableArray array(NativeObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSMutableArray1, _lib._sel_array1); + return NSMutableArray._(_ret, _lib); + } + + static NSMutableArray arrayWithObject( + NativeObjCLibrary _lib, NSObject anObject) { + final _ret = _lib._objc_msgSend_13( + _lib._class_NSMutableArray1, _lib._sel_arrayWithObject_1, anObject._id); + return NSMutableArray._(_ret, _lib); + } + + static NSMutableArray arrayWithObjects_count(NativeObjCLibrary _lib, + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_105(_lib._class_NSMutableArray1, + _lib._sel_arrayWithObjects_count_1, objects, cnt); + return NSMutableArray._(_ret, _lib); + } + + static NSMutableArray arrayWithObjects( + NativeObjCLibrary _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableArray1, + _lib._sel_arrayWithObjects_1, firstObj._id); + return NSMutableArray._(_ret, _lib); + } + + static NSMutableArray arrayWithArray( + NativeObjCLibrary _lib, NSObject? array) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableArray1, + _lib._sel_arrayWithArray_1, array?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib); + } + + static NSMutableArray new1(NativeObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSMutableArray1, _lib._sel_new1); + return NSMutableArray._(_ret, _lib); + } + + static NSMutableArray alloc(NativeObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSMutableArray1, _lib._sel_alloc1); + return NSMutableArray._(_ret, _lib); + } } abstract class NSItemProviderRepresentationVisibility { @@ -1102,378 +7421,544 @@ abstract class NSItemProviderFileOptions { static const int NSItemProviderFileOptionOpenInPlace = 1; } -abstract class NSItemProviderErrorCode { - static const int NSItemProviderUnknownError = -1; - static const int NSItemProviderItemUnavailableError = -1000; - static const int NSItemProviderUnexpectedValueClassError = -1100; - static const int NSItemProviderUnavailableCoercionError = -1200; -} +class NSItemProvider extends NSObject { + NSItemProvider._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); -abstract class NSStringCompareOptions { - static const int NSCaseInsensitiveSearch = 1; - static const int NSLiteralSearch = 2; - static const int NSBackwardsSearch = 4; - static const int NSAnchoredSearch = 8; - static const int NSNumericSearch = 64; - static const int NSDiacriticInsensitiveSearch = 128; - static const int NSWidthInsensitiveSearch = 256; - static const int NSForcedOrderingSearch = 512; - static const int NSRegularExpressionSearch = 1024; -} + static NSItemProvider castFrom(T other) { + return NSItemProvider._(other._id, other._lib); + } -abstract class NSStringEncodingConversionOptions { - static const int NSStringEncodingConversionAllowLossy = 1; - static const int NSStringEncodingConversionExternalRepresentation = 2; -} + static NSItemProvider castFromPointer( + NativeObjCLibrary lib, ffi.Pointer other) { + return NSItemProvider._(other, lib); + } -abstract class NSStringEnumerationOptions { - static const int NSStringEnumerationByLines = 0; - static const int NSStringEnumerationByParagraphs = 1; - static const int NSStringEnumerationByComposedCharacterSequences = 2; - static const int NSStringEnumerationByWords = 3; - static const int NSStringEnumerationBySentences = 4; - static const int NSStringEnumerationByCaretPositions = 5; - static const int NSStringEnumerationByDeletionClusters = 6; - static const int NSStringEnumerationReverse = 256; - static const int NSStringEnumerationSubstringNotRequired = 512; - static const int NSStringEnumerationLocalized = 1024; -} + @override + NSItemProvider init() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); + return NSItemProvider._(_ret, _lib); + } -typedef NSStringTransform = ffi.Pointer; -typedef NSStringEncodingDetectionOptionsKey = ffi.Pointer; -typedef NSExceptionName = ffi.Pointer; + void registerDataRepresentationForTypeIdentifier_visibility_loadHandler( + NSObject? typeIdentifier, int visibility, NSObject loadHandler) { + _lib._objc_msgSend_140( + _id, + _lib._sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + visibility, + loadHandler._id); + } + + void + registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler( + NSObject? typeIdentifier, + int fileOptions, + int visibility, + NSObject loadHandler) { + _lib._objc_msgSend_141( + _id, + _lib._sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + fileOptions, + visibility, + loadHandler._id); + } + + NSObject? get registeredTypeIdentifiers { + final _ret = + _lib._objc_msgSend_1(_id, _lib._sel_registeredTypeIdentifiers1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } + + bool hasItemConformingToTypeIdentifier(NSObject? typeIdentifier) { + return _lib._objc_msgSend_4( + _id, + _lib._sel_hasItemConformingToTypeIdentifier_1, + typeIdentifier?._id ?? ffi.nullptr); + } + + bool hasRepresentationConformingToTypeIdentifier_fileOptions( + NSObject? typeIdentifier, int fileOptions) { + return _lib._objc_msgSend_142( + _id, + _lib._sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1, + typeIdentifier?._id ?? ffi.nullptr, + fileOptions); + } + + NSProgress loadDataRepresentationForTypeIdentifier_completionHandler( + NSObject? typeIdentifier, NSObject completionHandler) { + final _ret = _lib._objc_msgSend_143( + _id, + _lib._sel_loadDataRepresentationForTypeIdentifier_completionHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + completionHandler._id); + return NSProgress._(_ret, _lib); + } + + NSProgress loadFileRepresentationForTypeIdentifier_completionHandler( + NSObject? typeIdentifier, NSObject completionHandler) { + final _ret = _lib._objc_msgSend_143( + _id, + _lib._sel_loadFileRepresentationForTypeIdentifier_completionHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + completionHandler._id); + return NSProgress._(_ret, _lib); + } + + NSProgress loadInPlaceFileRepresentationForTypeIdentifier_completionHandler( + NSObject? typeIdentifier, NSObject completionHandler) { + final _ret = _lib._objc_msgSend_143( + _id, + _lib._sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + completionHandler._id); + return NSProgress._(_ret, _lib); + } + + NSObject? get suggestedName { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_suggestedName1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } + + set suggestedName(NSObject? value) { + _lib._objc_msgSend_8( + _id, _lib._sel_setSuggestedName_1, value?._id ?? ffi.nullptr); + } -class _ObjCWrapper { - final ffi.Pointer _id; - final NativeObjCLibrary _lib; + NSItemProvider initWithObject(NSObject? object) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithObject_1, object?._id ?? ffi.nullptr); + return NSItemProvider._(_ret, _lib); + } - _ObjCWrapper._(this._id, this._lib); + void registerObject_visibility(NSObject? object, int visibility) { + _lib._objc_msgSend_144(_id, _lib._sel_registerObject_visibility_1, + object?._id ?? ffi.nullptr, visibility); + } - @override - bool operator ==(Object other) { - return other is _ObjCWrapper && _id == other._id; + void registerObjectOfClass_visibility_loadHandler( + NSObject? aClass, int visibility, NSObject loadHandler) { + _lib._objc_msgSend_140( + _id, + _lib._sel_registerObjectOfClass_visibility_loadHandler_1, + aClass?._id ?? ffi.nullptr, + visibility, + loadHandler._id); } - @override - int get hashCode => _id.hashCode; -} + bool canLoadObjectOfClass(NSObject? aClass) { + return _lib._objc_msgSend_4( + _id, _lib._sel_canLoadObjectOfClass_1, aClass?._id ?? ffi.nullptr); + } -class Foo extends NSObject { - Foo._(ffi.Pointer id, NativeObjCLibrary lib) : super._(id, lib); + NSProgress loadObjectOfClass_completionHandler( + NSObject? aClass, NSObject completionHandler) { + final _ret = _lib._objc_msgSend_143( + _id, + _lib._sel_loadObjectOfClass_completionHandler_1, + aClass?._id ?? ffi.nullptr, + completionHandler._id); + return NSProgress._(_ret, _lib); + } - static Foo castFrom(T other) { - return Foo._(other._id, other._lib); + NSItemProvider initWithItem_typeIdentifier( + NSObject? item, NSObject? typeIdentifier) { + final _ret = _lib._objc_msgSend_57( + _id, + _lib._sel_initWithItem_typeIdentifier_1, + item?._id ?? ffi.nullptr, + typeIdentifier?._id ?? ffi.nullptr); + return NSItemProvider._(_ret, _lib); } - static Foo castFromPointer( - NativeObjCLibrary lib, ffi.Pointer other) { - return Foo._(other, lib); + NSItemProvider initWithContentsOfURL(NSObject? fileURL) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithContentsOfURL_1, fileURL?._id ?? ffi.nullptr); + return NSItemProvider._(_ret, _lib); } - int get intVal { - return _lib._objc_msgSend_17(_id, _lib._sel_intVal1); + void registerItemForTypeIdentifier_loadHandler( + NSObject? typeIdentifier, NSItemProviderLoadHandler loadHandler) { + _lib._objc_msgSend_138( + _id, + _lib._sel_registerItemForTypeIdentifier_loadHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + loadHandler); } - set intVal(int value) { - _lib._objc_msgSend_18(_id, _lib._sel_setIntVal_1, value); + void loadItemForTypeIdentifier_options_completionHandler( + NSObject? typeIdentifier, + NSObject? options, + NSItemProviderCompletionHandler completionHandler) { + _lib._objc_msgSend_145( + _id, + _lib._sel_loadItemForTypeIdentifier_options_completionHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr, + completionHandler); } - static Foo makeFoo(NativeObjCLibrary _lib, double x) { - final _ret = - _lib._objc_msgSend_19(_lib._class_Foo1, _lib._sel_makeFoo_1, x); - return Foo._(_ret, _lib); + NSItemProviderLoadHandler get previewImageHandler { + return _lib._objc_msgSend_1(_id, _lib._sel_previewImageHandler1); } - int multiply_withOtherFoo(bool useIntVals, NSObject? other) { - return _lib._objc_msgSend_20(_id, _lib._sel_multiply_withOtherFoo_1, - useIntVals, other?._id ?? ffi.nullptr); + set previewImageHandler(NSItemProviderLoadHandler value) { + _lib._objc_msgSend_8(_id, _lib._sel_setPreviewImageHandler_1, value); } - void setDoubleVal(double x) { - _lib._objc_msgSend_21(_id, _lib._sel_setDoubleVal_1, x); + void loadPreviewImageWithOptions_completionHandler( + NSObject? options, NSItemProviderCompletionHandler completionHandler) { + _lib._objc_msgSend_138( + _id, + _lib._sel_loadPreviewImageWithOptions_completionHandler_1, + options?._id ?? ffi.nullptr, + completionHandler); } - static Foo new1(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_new1); - return Foo._(_ret, _lib); + static NSItemProvider new1(NativeObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSItemProvider1, _lib._sel_new1); + return NSItemProvider._(_ret, _lib); } - static Foo alloc(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_alloc1); - return Foo._(_ret, _lib); + static NSItemProvider alloc(NativeObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSItemProvider1, _lib._sel_alloc1); + return NSItemProvider._(_ret, _lib); } } -class ObjCSel extends ffi.Opaque {} - -class NSObject extends _ObjCWrapper { - NSObject._(ffi.Pointer id, NativeObjCLibrary lib) +class NSProgress extends _ObjCWrapper { + NSProgress._(ffi.Pointer id, NativeObjCLibrary lib) : super._(id, lib); - static NSObject castFrom(T other) { - return NSObject._(other._id, other._lib); + static NSProgress castFrom(T other) { + return NSProgress._(other._id, other._lib); } - static NSObject castFromPointer( + static NSProgress castFromPointer( NativeObjCLibrary lib, ffi.Pointer other) { - return NSObject._(other, lib); + return NSProgress._(other, lib); } +} - static void load(NativeObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); +typedef NSItemProviderLoadHandler = ffi.Pointer; +typedef NSItemProviderCompletionHandler = ffi.Pointer; + +abstract class NSItemProviderErrorCode { + static const int NSItemProviderUnknownError = -1; + static const int NSItemProviderItemUnavailableError = -1000; + static const int NSItemProviderUnexpectedValueClassError = -1100; + static const int NSItemProviderUnavailableCoercionError = -1200; +} + +typedef NSStringEncodingDetectionOptionsKey = ffi.Pointer; + +class NSMutableString extends NSString { + NSMutableString._(ffi.Pointer id, NativeObjCLibrary lib) + : super._(id, lib); + + static NSMutableString castFrom(T other) { + return NSMutableString._(other._id, other._lib); } - static void initialize(NativeObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); + static NSMutableString castFromPointer( + NativeObjCLibrary lib, ffi.Pointer other) { + return NSMutableString._(other, lib); } - NSObject init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSObject._(_ret, _lib); + void replaceCharactersInRange_withString(NSRange range, NSObject? aString) { + _lib._objc_msgSend_136(_id, _lib._sel_replaceCharactersInRange_withString_1, + range, aString?._id ?? ffi.nullptr); } - static NSObject new1(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); - return NSObject._(_ret, _lib); + void insertString_atIndex(NSObject? aString, int loc) { + _lib._objc_msgSend_129(_id, _lib._sel_insertString_atIndex_1, + aString?._id ?? ffi.nullptr, loc); } - static NSObject allocWithZone( - NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); - return NSObject._(_ret, _lib); + void deleteCharactersInRange(NSRange range) { + _lib._objc_msgSend_134(_id, _lib._sel_deleteCharactersInRange_1, range); } - static NSObject alloc(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); - return NSObject._(_ret, _lib); + void appendString(NSObject? aString) { + _lib._objc_msgSend_8( + _id, _lib._sel_appendString_1, aString?._id ?? ffi.nullptr); } - void dealloc() { - _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); + void appendFormat(NSObject? format) { + _lib._objc_msgSend_8( + _id, _lib._sel_appendFormat_1, format?._id ?? ffi.nullptr); } - void finalize() { - _lib._objc_msgSend_0(_id, _lib._sel_finalize1); + void setString(NSObject? aString) { + _lib._objc_msgSend_8( + _id, _lib._sel_setString_1, aString?._id ?? ffi.nullptr); } - NSObject copy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); - return NSObject._(_ret, _lib); + int replaceOccurrencesOfString_withString_options_range(NSObject? target, + NSObject? replacement, int options, NSRange searchRange) { + return _lib._objc_msgSend_146( + _id, + _lib._sel_replaceOccurrencesOfString_withString_options_range_1, + target?._id ?? ffi.nullptr, + replacement?._id ?? ffi.nullptr, + options, + searchRange); } - NSObject mutableCopy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); - return NSObject._(_ret, _lib); + bool applyTransform_reverse_range_updatedRange(NSStringTransform transform, + bool reverse, NSRange range, NSRangePointer resultingRange) { + return _lib._objc_msgSend_147( + _id, + _lib._sel_applyTransform_reverse_range_updatedRange_1, + transform, + reverse, + range, + resultingRange); } - static NSObject copyWithZone( - NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); - return NSObject._(_ret, _lib); + NSMutableString initWithCapacity(int capacity) { + final _ret = + _lib._objc_msgSend_148(_id, _lib._sel_initWithCapacity_1, capacity); + return NSMutableString._(_ret, _lib); } - static NSObject mutableCopyWithZone( - NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); - return NSObject._(_ret, _lib); + static NSMutableString stringWithCapacity( + NativeObjCLibrary _lib, int capacity) { + final _ret = _lib._objc_msgSend_148( + _lib._class_NSMutableString1, _lib._sel_stringWithCapacity_1, capacity); + return NSMutableString._(_ret, _lib); } - static bool instancesRespondToSelector( - NativeObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_3(_lib._class_NSObject1, - _lib._sel_instancesRespondToSelector_1, aSelector); + static NSString localizedNameOfStringEncoding( + NativeObjCLibrary _lib, int encoding) { + final _ret = _lib._objc_msgSend_14(_lib._class_NSMutableString1, + _lib._sel_localizedNameOfStringEncoding_1, encoding); + return NSString._(_ret, _lib); } - static bool conformsToProtocol(NativeObjCLibrary _lib, NSObject? protocol) { - return _lib._objc_msgSend_4(_lib._class_NSObject1, - _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); + static NSMutableString string(NativeObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSMutableString1, _lib._sel_string1); + return NSMutableString._(_ret, _lib); } - IMP methodForSelector(ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); + static NSMutableString stringWithString( + NativeObjCLibrary _lib, NSObject? string) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, + _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); + return NSMutableString._(_ret, _lib); } - static IMP instanceMethodForSelector( - NativeObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_lib._class_NSObject1, - _lib._sel_instanceMethodForSelector_1, aSelector); + static NSMutableString stringWithCharacters_length( + NativeObjCLibrary _lib, ffi.Pointer characters, int length) { + final _ret = _lib._objc_msgSend_54(_lib._class_NSMutableString1, + _lib._sel_stringWithCharacters_length_1, characters, length); + return NSMutableString._(_ret, _lib); } - void doesNotRecognizeSelector(ffi.Pointer aSelector) { - _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); + static NSMutableString stringWithUTF8String( + NativeObjCLibrary _lib, ffi.Pointer nullTerminatedCString) { + final _ret = _lib._objc_msgSend_55(_lib._class_NSMutableString1, + _lib._sel_stringWithUTF8String_1, nullTerminatedCString); + return NSMutableString._(_ret, _lib); } - NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_7( - _id, _lib._sel_forwardingTargetForSelector_1, aSelector); - return NSObject._(_ret, _lib); + static NSMutableString stringWithFormat( + NativeObjCLibrary _lib, NSObject? format) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, + _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); + return NSMutableString._(_ret, _lib); } - void forwardInvocation(NSObject? anInvocation) { - _lib._objc_msgSend_8( - _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); + static NSMutableString localizedStringWithFormat( + NativeObjCLibrary _lib, NSObject? format) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, + _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); + return NSMutableString._(_ret, _lib); } - NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9( - _id, _lib._sel_methodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); + static NSMutableString stringWithCString_encoding( + NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { + final _ret = _lib._objc_msgSend_63(_lib._class_NSMutableString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); + return NSMutableString._(_ret, _lib); } - static NSMethodSignature instanceMethodSignatureForSelector( - NativeObjCLibrary _lib, ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, - _lib._sel_instanceMethodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); + static NSMutableString stringWithContentsOfURL_encoding_error( + NativeObjCLibrary _lib, + NSObject? url, + int enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_64( + _lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfURL_encoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib); } - bool allowsWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); + static NSMutableString stringWithContentsOfFile_encoding_error( + NativeObjCLibrary _lib, + NSObject? path, + int enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_64( + _lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfFile_encoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib); } - bool retainWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); + static NSMutableString stringWithContentsOfURL_usedEncoding_error( + NativeObjCLibrary _lib, + NSObject? url, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_65( + _lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib); } - static bool isSubclassOfClass(NativeObjCLibrary _lib, NSObject aClass) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); + static NSMutableString stringWithContentsOfFile_usedEncoding_error( + NativeObjCLibrary _lib, + NSObject? path, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_65( + _lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib); } - static bool resolveClassMethod( - NativeObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); + static void availableStringEncodings(NativeObjCLibrary _lib) { + _lib._objc_msgSend_0( + _lib._class_NSMutableString1, _lib._sel_availableStringEncodings1); } - static bool resolveInstanceMethod( - NativeObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); + static void defaultCStringEncoding(NativeObjCLibrary _lib) { + _lib._objc_msgSend_0( + _lib._class_NSMutableString1, _lib._sel_defaultCStringEncoding1); } - static int hash(NativeObjCLibrary _lib) { - return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); + static int + stringEncodingForData_encodingOptions_convertedString_usedLossyConversion( + NativeObjCLibrary _lib, + NSObject? data, + NSObject? opts, + ffi.Pointer> string, + ffi.Pointer usedLossyConversion) { + return _lib._objc_msgSend_66( + _lib._class_NSMutableString1, + _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, + data?._id ?? ffi.nullptr, + opts?._id ?? ffi.nullptr, + string, + usedLossyConversion); } - static NSObject superclass(NativeObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); + static NSObject stringWithContentsOfFile( + NativeObjCLibrary _lib, NSObject? path) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static NSObject class1(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); + static NSObject stringWithContentsOfURL( + NativeObjCLibrary _lib, NSObject? url) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static NSString description(NativeObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_16(_lib._class_NSObject1, _lib._sel_description1); - return NSString._(_ret, _lib); + static NSObject stringWithCString_length( + NativeObjCLibrary _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_63(_lib._class_NSMutableString1, + _lib._sel_stringWithCString_length_1, bytes, length); + return NSObject._(_ret, _lib); } - static NSString debugDescription(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_16( - _lib._class_NSObject1, _lib._sel_debugDescription1); - return NSString._(_ret, _lib); + static NSObject stringWithCString( + NativeObjCLibrary _lib, ffi.Pointer bytes) { + final _ret = _lib._objc_msgSend_55( + _lib._class_NSMutableString1, _lib._sel_stringWithCString_1, bytes); + return NSObject._(_ret, _lib); } -} - -typedef instancetype = ffi.Pointer; - -class _NSZone extends ffi.Opaque {} - -typedef IMP = ffi.Pointer>; -class NSMethodSignature extends _ObjCWrapper { - NSMethodSignature._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); - - static NSMethodSignature castFrom(T other) { - return NSMethodSignature._(other._id, other._lib); + static NSMutableString new1(NativeObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSMutableString1, _lib._sel_new1); + return NSMutableString._(_ret, _lib); } - static NSMethodSignature castFromPointer( - NativeObjCLibrary lib, ffi.Pointer other) { - return NSMethodSignature._(other, lib); + static NSMutableString alloc(NativeObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSMutableString1, _lib._sel_alloc1); + return NSMutableString._(_ret, _lib); } } -class NSString extends NSObject { - NSString._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); - - static NSString castFrom(T other) { - return NSString._(other._id, other._lib); - } +typedef NSExceptionName = ffi.Pointer; - static NSString castFromPointer( - NativeObjCLibrary lib, ffi.Pointer other) { - return NSString._(other, lib); - } +class Foo extends NSObject { + Foo._(ffi.Pointer id, NativeObjCLibrary lib) : super._(id, lib); - factory NSString(NativeObjCLibrary _lib, String str) { - final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); - pkg_ffi.calloc.free(cstr); - return nsstr; + static Foo castFrom(T other) { + return Foo._(other._id, other._lib); } - @override - String toString() => UTF8String().cast().toDartString(); - - int get length { - return _lib._objc_msgSend_11(_id, _lib._sel_length1); + static Foo castFromPointer( + NativeObjCLibrary lib, ffi.Pointer other) { + return Foo._(other, lib); } - int characterAtIndex(int index) { - return _lib._objc_msgSend_12(_id, _lib._sel_characterAtIndex_1, index); + int get intVal { + return _lib._objc_msgSend_149(_id, _lib._sel_intVal1); } - @override - NSString init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSString._(_ret, _lib); + set intVal(int value) { + _lib._objc_msgSend_150(_id, _lib._sel_setIntVal_1, value); } - NSString initWithCoder(NSObject? coder) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); + static Foo makeFoo(NativeObjCLibrary _lib, double x) { + final _ret = + _lib._objc_msgSend_151(_lib._class_Foo1, _lib._sel_makeFoo_1, x); + return Foo._(_ret, _lib); } - static NSString stringWithCString_encoding( - NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_14(_lib._class_NSString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return NSString._(_ret, _lib); + int multiply_withOtherFoo(bool useIntVals, NSObject? other) { + return _lib._objc_msgSend_152(_id, _lib._sel_multiply_withOtherFoo_1, + useIntVals, other?._id ?? ffi.nullptr); } - ffi.Pointer UTF8String() { - return _lib._objc_msgSend_15(_id, _lib._sel_UTF8String1); + void setDoubleVal(double x) { + _lib._objc_msgSend_153(_id, _lib._sel_setDoubleVal_1, x); } - static NSString new1(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSString1, _lib._sel_new1); - return NSString._(_ret, _lib); + static Foo new1(NativeObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_new1); + return Foo._(_ret, _lib); } - static NSString alloc(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSString1, _lib._sel_alloc1); - return NSString._(_ret, _lib); + static Foo alloc(NativeObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_alloc1); + return Foo._(_ret, _lib); } } -extension StringToNSString on String { - NSString toNSString(NativeObjCLibrary lib) => NSString(lib, this); -} - -typedef unichar = pkg_ffi.UnsignedShort; - const int NSScannedOption = 1; const int NSCollectorDisabledOption = 2; diff --git a/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart b/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart index 90533ce9e9..4310cb8bbf 100644 --- a/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart @@ -151,8 +151,6 @@ class NullableTestObjCLibrary { late final __objc_getClass = __objc_getClassPtr.asFunction< ffi.Pointer Function(ffi.Pointer)>(); - late final ffi.Pointer _class_NullableInterface1 = - _getClass1("NullableInterface"); late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); late final ffi.Pointer _sel_load1 = _registerName1("load"); void _objc_msgSend_0( @@ -506,29 +504,100 @@ class NullableTestObjCLibrary { late final ffi.Pointer _sel_debugDescription1 = _registerName1("debugDescription"); + late final ffi.Pointer _sel_version1 = _registerName1("version"); + int _objc_msgSend_15( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_15( + obj, + sel, + ); + } + + late final __objc_msgSend_15Ptr = _lookup< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_setVersion_1 = + _registerName1("setVersion:"); + void _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + int aVersion, + ) { + return __objc_msgSend_16( + obj, + sel, + aVersion, + ); + } + + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_classForCoder1 = + _registerName1("classForCoder"); + late final ffi.Pointer _sel_replacementObjectForCoder_1 = + _registerName1("replacementObjectForCoder:"); + ffi.Pointer _objc_msgSend_17( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_17( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_17Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = + _registerName1("awakeAfterUsingCoder:"); + late final ffi.Pointer _sel_poseAsClass_1 = + _registerName1("poseAsClass:"); + late final ffi.Pointer _sel_autoContentAccessingProxy1 = + _registerName1("autoContentAccessingProxy"); + late final ffi.Pointer _class_NullableInterface1 = + _getClass1("NullableInterface"); late final ffi.Pointer _sel_isNullWithNullableNSObjectArg_1 = _registerName1("isNullWithNullableNSObjectArg:"); late final ffi.Pointer _sel_isNullWithNotNullableNSObjectPtrArg_1 = _registerName1("isNullWithNotNullableNSObjectPtrArg:"); late final ffi.Pointer _sel_returnNil_1 = _registerName1("returnNil:"); - ffi.Pointer _objc_msgSend_15( + ffi.Pointer _objc_msgSend_18( ffi.Pointer obj, ffi.Pointer sel, bool r, ) { - return __objc_msgSend_15( + return __objc_msgSend_18( obj, sel, r ? 1 : 0, ); } - late final __objc_msgSend_15Ptr = _lookup< + late final __objc_msgSend_18Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); @@ -649,64 +718,6 @@ class _ObjCWrapper { int get hashCode => _id.hashCode; } -class NullableInterface extends NSObject { - NullableInterface._(ffi.Pointer id, NullableTestObjCLibrary lib) - : super._(id, lib); - - static NullableInterface castFrom(T other) { - return NullableInterface._(other._id, other._lib); - } - - static NullableInterface castFromPointer( - NullableTestObjCLibrary lib, ffi.Pointer other) { - return NullableInterface._(other, lib); - } - - static bool isNullWithNullableNSObjectArg( - NullableTestObjCLibrary _lib, NSObject? x) { - return _lib._objc_msgSend_4(_lib._class_NullableInterface1, - _lib._sel_isNullWithNullableNSObjectArg_1, x?._id ?? ffi.nullptr); - } - - static bool isNullWithNotNullableNSObjectPtrArg( - NullableTestObjCLibrary _lib, NSObject? x) { - return _lib._objc_msgSend_4(_lib._class_NullableInterface1, - _lib._sel_isNullWithNotNullableNSObjectPtrArg_1, x?._id ?? ffi.nullptr); - } - - static NSObject returnNil(NullableTestObjCLibrary _lib, bool r) { - final _ret = _lib._objc_msgSend_15( - _lib._class_NullableInterface1, _lib._sel_returnNil_1, r); - return NSObject._(_ret, _lib); - } - - NSObject? get nullableObjectProperty { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_nullableObjectProperty1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - set nullableObjectProperty(NSObject? value) { - _lib._objc_msgSend_8( - _id, _lib._sel_setNullableObjectProperty_1, value?._id ?? ffi.nullptr); - } - - static NullableInterface new1(NullableTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NullableInterface1, _lib._sel_new1); - return NullableInterface._(_ret, _lib); - } - - static NullableInterface alloc(NullableTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NullableInterface1, _lib._sel_alloc1); - return NullableInterface._(_ret, _lib); - } -} - -class ObjCSel extends ffi.Opaque {} - -class ObjCObject extends ffi.Opaque {} - class NSObject extends _ObjCWrapper { NSObject._(ffi.Pointer id, NullableTestObjCLibrary lib) : super._(id, lib); @@ -883,8 +894,49 @@ class NSObject extends _ObjCWrapper { _lib._class_NSObject1, _lib._sel_debugDescription1); return NSString._(_ret, _lib); } + + static int version(NullableTestObjCLibrary _lib) { + return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); + } + + static void setVersion(NullableTestObjCLibrary _lib, int aVersion) { + _lib._objc_msgSend_16( + _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); + } + + NSObject get classForCoder { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); + return NSObject._(_ret, _lib); + } + + NSObject replacementObjectForCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + NSObject awakeAfterUsingCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + static void poseAsClass(NullableTestObjCLibrary _lib, NSObject aClass) { + _lib._objc_msgSend_8( + _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); + } + + NSObject get autoContentAccessingProxy { + final _ret = + _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); + return NSObject._(_ret, _lib); + } } +class ObjCSel extends ffi.Opaque {} + +class ObjCObject extends ffi.Opaque {} + typedef instancetype = ffi.Pointer; class _NSZone extends ffi.Opaque {} @@ -928,7 +980,7 @@ class NSString extends _ObjCWrapper { } @override - String toString() => UTF8String().cast().toDartString(); + String toString() => (UTF8String).cast().toDartString(); static NSString stringWithCString_encoding(NullableTestObjCLibrary _lib, ffi.Pointer cString, int enc) { @@ -937,7 +989,7 @@ class NSString extends _ObjCWrapper { return NSString._(_ret, _lib); } - ffi.Pointer UTF8String() { + ffi.Pointer get UTF8String { return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); } } @@ -946,6 +998,60 @@ extension StringToNSString on String { NSString toNSString(NullableTestObjCLibrary lib) => NSString(lib, this); } +class NullableInterface extends NSObject { + NullableInterface._(ffi.Pointer id, NullableTestObjCLibrary lib) + : super._(id, lib); + + static NullableInterface castFrom(T other) { + return NullableInterface._(other._id, other._lib); + } + + static NullableInterface castFromPointer( + NullableTestObjCLibrary lib, ffi.Pointer other) { + return NullableInterface._(other, lib); + } + + static bool isNullWithNullableNSObjectArg( + NullableTestObjCLibrary _lib, NSObject? x) { + return _lib._objc_msgSend_4(_lib._class_NullableInterface1, + _lib._sel_isNullWithNullableNSObjectArg_1, x?._id ?? ffi.nullptr); + } + + static bool isNullWithNotNullableNSObjectPtrArg( + NullableTestObjCLibrary _lib, NSObject? x) { + return _lib._objc_msgSend_4(_lib._class_NullableInterface1, + _lib._sel_isNullWithNotNullableNSObjectPtrArg_1, x?._id ?? ffi.nullptr); + } + + static NSObject returnNil(NullableTestObjCLibrary _lib, bool r) { + final _ret = _lib._objc_msgSend_18( + _lib._class_NullableInterface1, _lib._sel_returnNil_1, r); + return NSObject._(_ret, _lib); + } + + NSObject? get nullableObjectProperty { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_nullableObjectProperty1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } + + set nullableObjectProperty(NSObject? value) { + _lib._objc_msgSend_8( + _id, _lib._sel_setNullableObjectProperty_1, value?._id ?? ffi.nullptr); + } + + static NullableInterface new1(NullableTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NullableInterface1, _lib._sel_new1); + return NullableInterface._(_ret, _lib); + } + + static NullableInterface alloc(NullableTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NullableInterface1, _lib._sel_alloc1); + return NullableInterface._(_ret, _lib); + } +} + const int NSScannedOption = 1; const int NSCollectorDisabledOption = 2; diff --git a/pkgs/ffigen/test/native_objc_test/property_bindings.dart b/pkgs/ffigen/test/native_objc_test/property_bindings.dart index 90ec1bec33..05cd9efc2f 100644 --- a/pkgs/ffigen/test/native_objc_test/property_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/property_bindings.dart @@ -151,8 +151,6 @@ class PropertyTestObjCLibrary { late final __objc_getClass = __objc_getClassPtr.asFunction< ffi.Pointer Function(ffi.Pointer)>(); - late final ffi.Pointer _class_PropertyInterface1 = - _getClass1("PropertyInterface"); late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); late final ffi.Pointer _sel_load1 = _registerName1("load"); void _objc_msgSend_0( @@ -506,8 +504,7 @@ class PropertyTestObjCLibrary { late final ffi.Pointer _sel_debugDescription1 = _registerName1("debugDescription"); - late final ffi.Pointer _sel_readOnlyProperty1 = - _registerName1("readOnlyProperty"); + late final ffi.Pointer _sel_version1 = _registerName1("version"); int _objc_msgSend_15( ffi.Pointer obj, ffi.Pointer sel, @@ -520,32 +517,104 @@ class PropertyTestObjCLibrary { late final __objc_msgSend_15Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( + NSInteger Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_setVersion_1 = + _registerName1("setVersion:"); + void _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + int aVersion, + ) { + return __objc_msgSend_16( + obj, + sel, + aVersion, + ); + } + + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_classForCoder1 = + _registerName1("classForCoder"); + late final ffi.Pointer _sel_replacementObjectForCoder_1 = + _registerName1("replacementObjectForCoder:"); + ffi.Pointer _objc_msgSend_17( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_17( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_17Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = + _registerName1("awakeAfterUsingCoder:"); + late final ffi.Pointer _sel_poseAsClass_1 = + _registerName1("poseAsClass:"); + late final ffi.Pointer _sel_autoContentAccessingProxy1 = + _registerName1("autoContentAccessingProxy"); + late final ffi.Pointer _class_PropertyInterface1 = + _getClass1("PropertyInterface"); + late final ffi.Pointer _sel_readOnlyProperty1 = + _registerName1("readOnlyProperty"); + int _objc_msgSend_18( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_18( + obj, + sel, + ); + } + + late final __objc_msgSend_18Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_readWriteProperty1 = _registerName1("readWriteProperty"); late final ffi.Pointer _sel_setReadWriteProperty_1 = _registerName1("setReadWriteProperty:"); - void _objc_msgSend_16( + void _objc_msgSend_19( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_16( + return __objc_msgSend_19( obj, sel, value, ); } - late final __objc_msgSend_16Ptr = _lookup< + late final __objc_msgSend_19Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_classReadOnlyProperty1 = @@ -674,64 +743,6 @@ class _ObjCWrapper { int get hashCode => _id.hashCode; } -class PropertyInterface extends NSObject { - PropertyInterface._(ffi.Pointer id, PropertyTestObjCLibrary lib) - : super._(id, lib); - - static PropertyInterface castFrom(T other) { - return PropertyInterface._(other._id, other._lib); - } - - static PropertyInterface castFromPointer( - PropertyTestObjCLibrary lib, ffi.Pointer other) { - return PropertyInterface._(other, lib); - } - - int get readOnlyProperty { - return _lib._objc_msgSend_15(_id, _lib._sel_readOnlyProperty1); - } - - int get readWriteProperty { - return _lib._objc_msgSend_15(_id, _lib._sel_readWriteProperty1); - } - - set readWriteProperty(int value) { - _lib._objc_msgSend_16(_id, _lib._sel_setReadWriteProperty_1, value); - } - - static int getClassReadOnlyProperty(PropertyTestObjCLibrary _lib) { - return _lib._objc_msgSend_15( - _lib._class_PropertyInterface1, _lib._sel_classReadOnlyProperty1); - } - - static int getClassReadWriteProperty(PropertyTestObjCLibrary _lib) { - return _lib._objc_msgSend_15( - _lib._class_PropertyInterface1, _lib._sel_classReadWriteProperty1); - } - - static void setClassReadWriteProperty( - PropertyTestObjCLibrary _lib, int value) { - _lib._objc_msgSend_16(_lib._class_PropertyInterface1, - _lib._sel_setClassReadWriteProperty_1, value); - } - - static PropertyInterface new1(PropertyTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_PropertyInterface1, _lib._sel_new1); - return PropertyInterface._(_ret, _lib); - } - - static PropertyInterface alloc(PropertyTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_PropertyInterface1, _lib._sel_alloc1); - return PropertyInterface._(_ret, _lib); - } -} - -class ObjCSel extends ffi.Opaque {} - -class ObjCObject extends ffi.Opaque {} - class NSObject extends _ObjCWrapper { NSObject._(ffi.Pointer id, PropertyTestObjCLibrary lib) : super._(id, lib); @@ -908,8 +919,49 @@ class NSObject extends _ObjCWrapper { _lib._class_NSObject1, _lib._sel_debugDescription1); return NSString._(_ret, _lib); } + + static int version(PropertyTestObjCLibrary _lib) { + return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); + } + + static void setVersion(PropertyTestObjCLibrary _lib, int aVersion) { + _lib._objc_msgSend_16( + _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); + } + + NSObject get classForCoder { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); + return NSObject._(_ret, _lib); + } + + NSObject replacementObjectForCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + NSObject awakeAfterUsingCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + static void poseAsClass(PropertyTestObjCLibrary _lib, NSObject aClass) { + _lib._objc_msgSend_8( + _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); + } + + NSObject get autoContentAccessingProxy { + final _ret = + _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); + return NSObject._(_ret, _lib); + } } +class ObjCSel extends ffi.Opaque {} + +class ObjCObject extends ffi.Opaque {} + typedef instancetype = ffi.Pointer; class _NSZone extends ffi.Opaque {} @@ -953,7 +1005,7 @@ class NSString extends _ObjCWrapper { } @override - String toString() => UTF8String().cast().toDartString(); + String toString() => (UTF8String).cast().toDartString(); static NSString stringWithCString_encoding(PropertyTestObjCLibrary _lib, ffi.Pointer cString, int enc) { @@ -962,7 +1014,7 @@ class NSString extends _ObjCWrapper { return NSString._(_ret, _lib); } - ffi.Pointer UTF8String() { + ffi.Pointer get UTF8String { return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); } } @@ -971,6 +1023,60 @@ extension StringToNSString on String { NSString toNSString(PropertyTestObjCLibrary lib) => NSString(lib, this); } +class PropertyInterface extends NSObject { + PropertyInterface._(ffi.Pointer id, PropertyTestObjCLibrary lib) + : super._(id, lib); + + static PropertyInterface castFrom(T other) { + return PropertyInterface._(other._id, other._lib); + } + + static PropertyInterface castFromPointer( + PropertyTestObjCLibrary lib, ffi.Pointer other) { + return PropertyInterface._(other, lib); + } + + int get readOnlyProperty { + return _lib._objc_msgSend_18(_id, _lib._sel_readOnlyProperty1); + } + + int get readWriteProperty { + return _lib._objc_msgSend_18(_id, _lib._sel_readWriteProperty1); + } + + set readWriteProperty(int value) { + _lib._objc_msgSend_19(_id, _lib._sel_setReadWriteProperty_1, value); + } + + static int getClassReadOnlyProperty(PropertyTestObjCLibrary _lib) { + return _lib._objc_msgSend_18( + _lib._class_PropertyInterface1, _lib._sel_classReadOnlyProperty1); + } + + static int getClassReadWriteProperty(PropertyTestObjCLibrary _lib) { + return _lib._objc_msgSend_18( + _lib._class_PropertyInterface1, _lib._sel_classReadWriteProperty1); + } + + static void setClassReadWriteProperty( + PropertyTestObjCLibrary _lib, int value) { + _lib._objc_msgSend_19(_lib._class_PropertyInterface1, + _lib._sel_setClassReadWriteProperty_1, value); + } + + static PropertyInterface new1(PropertyTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_PropertyInterface1, _lib._sel_new1); + return PropertyInterface._(_ret, _lib); + } + + static PropertyInterface alloc(PropertyTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_PropertyInterface1, _lib._sel_alloc1); + return PropertyInterface._(_ret, _lib); + } +} + const int NSScannedOption = 1; const int NSCollectorDisabledOption = 2; diff --git a/pkgs/ffigen/test/native_objc_test/setup.dart b/pkgs/ffigen/test/native_objc_test/setup.dart index 63cf56b3bc..60ec7a6404 100644 --- a/pkgs/ffigen/test/native_objc_test/setup.dart +++ b/pkgs/ffigen/test/native_objc_test/setup.dart @@ -34,6 +34,7 @@ Future main(List arguments) async { print('Building Dynamic Library for Objective C Native Tests...'); await _buildLib('native_objc_test.m', 'native_objc_test.dylib'); await _buildLib('cast_test.m', 'cast_test.dylib'); + await _buildLib('category_test.m', 'category_test.dylib'); await _buildLib('method_test.m', 'method_test.dylib'); await _buildLib('nullable_test.m', 'nullable_test.dylib'); await _buildLib('property_test.m', 'property_test.dylib'); diff --git a/pkgs/ffigen/test/native_objc_test/string_bindings.dart b/pkgs/ffigen/test/native_objc_test/string_bindings.dart index bfadf87680..ae27fc91dd 100644 --- a/pkgs/ffigen/test/native_objc_test/string_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/string_bindings.dart @@ -151,7 +151,6 @@ class StringTestObjCLibrary { late final __objc_getClass = __objc_getClassPtr.asFunction< ffi.Pointer Function(ffi.Pointer)>(); - late final ffi.Pointer _class_NSValue1 = _getClass1("NSValue"); late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); late final ffi.Pointer _sel_load1 = _registerName1("load"); void _objc_msgSend_0( @@ -480,419 +479,468 @@ class StringTestObjCLibrary { instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - late final ffi.Pointer _sel_stringWithCString_encoding_1 = - _registerName1("stringWithCString:encoding:"); + late final ffi.Pointer _sel_substringFromIndex_1 = + _registerName1("substringFromIndex:"); ffi.Pointer _objc_msgSend_14( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer cString, - int enc, + int from, ) { return __objc_msgSend_14( obj, sel, - cString, - enc, + from, ); } late final __objc_msgSend_14Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - pkg_ffi.UnsignedInt)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); - late final ffi.Pointer _sel_UTF8String1 = - _registerName1("UTF8String"); - ffi.Pointer _objc_msgSend_15( + late final ffi.Pointer _sel_substringToIndex_1 = + _registerName1("substringToIndex:"); + late final ffi.Pointer _sel_substringWithRange_1 = + _registerName1("substringWithRange:"); + ffi.Pointer _objc_msgSend_15( ffi.Pointer obj, ffi.Pointer sel, + NSRange range, ) { return __objc_msgSend_15( obj, sel, + range, ); } late final __objc_msgSend_15Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); - late final ffi.Pointer _sel_description1 = - _registerName1("description"); - ffi.Pointer _objc_msgSend_16( + late final ffi.Pointer _sel_getCharacters_range_1 = + _registerName1("getCharacters:range:"); + void _objc_msgSend_16( ffi.Pointer obj, ffi.Pointer sel, + ffi.Pointer buffer, + NSRange range, ) { return __objc_msgSend_16( obj, sel, + buffer, + range, ); } late final __objc_msgSend_16Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>(); - late final ffi.Pointer _sel_debugDescription1 = - _registerName1("debugDescription"); - late final ffi.Pointer _sel_getValue_size_1 = - _registerName1("getValue:size:"); - void _objc_msgSend_17( + late final ffi.Pointer _sel_compare_1 = _registerName1("compare:"); + int _objc_msgSend_17( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer value, - int size, + ffi.Pointer string, ) { return __objc_msgSend_17( obj, sel, - value, - size, + string, ); } late final __objc_msgSend_17Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - late final ffi.Pointer _sel_objCType1 = _registerName1("objCType"); - late final ffi.Pointer _sel_initWithBytes_objCType_1 = - _registerName1("initWithBytes:objCType:"); - instancetype _objc_msgSend_18( + late final ffi.Pointer _sel_compare_options_1 = + _registerName1("compare:options:"); + int _objc_msgSend_18( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer value, - ffi.Pointer type, + ffi.Pointer string, + int mask, ) { return __objc_msgSend_18( obj, sel, - value, - type, + string, + mask, ); } late final __objc_msgSend_18Ptr = _lookup< ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); - late final ffi.Pointer _class_NSNumber1 = _getClass1("NSNumber"); - late final ffi.Pointer _sel_initWithChar_1 = - _registerName1("initWithChar:"); - ffi.Pointer _objc_msgSend_19( + late final ffi.Pointer _sel_compare_options_range_1 = + _registerName1("compare:options:range:"); + int _objc_msgSend_19( ffi.Pointer obj, ffi.Pointer sel, - int value, + ffi.Pointer string, + int mask, + NSRange rangeOfReceiverToCompare, ) { return __objc_msgSend_19( obj, sel, - value, + string, + mask, + rangeOfReceiverToCompare, ); } late final __objc_msgSend_19Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Char)>>('objc_msgSend'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange)>(); - late final ffi.Pointer _sel_initWithUnsignedChar_1 = - _registerName1("initWithUnsignedChar:"); - ffi.Pointer _objc_msgSend_20( + late final ffi.Pointer _sel_compare_options_range_locale_1 = + _registerName1("compare:options:range:locale:"); + int _objc_msgSend_20( ffi.Pointer obj, ffi.Pointer sel, - int value, + ffi.Pointer string, + int mask, + NSRange rangeOfReceiverToCompare, + ffi.Pointer locale, ) { return __objc_msgSend_20( obj, sel, - value, + string, + mask, + rangeOfReceiverToCompare, + locale, ); } late final __objc_msgSend_20Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedChar)>>('objc_msgSend'); + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithShort_1 = - _registerName1("initWithShort:"); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange, ffi.Pointer)>(); + + late final ffi.Pointer _sel_caseInsensitiveCompare_1 = + _registerName1("caseInsensitiveCompare:"); + late final ffi.Pointer _sel_localizedCompare_1 = + _registerName1("localizedCompare:"); + late final ffi.Pointer _sel_localizedCaseInsensitiveCompare_1 = + _registerName1("localizedCaseInsensitiveCompare:"); + late final ffi.Pointer _sel_localizedStandardCompare_1 = + _registerName1("localizedStandardCompare:"); + late final ffi.Pointer _sel_isEqualToString_1 = + _registerName1("isEqualToString:"); + late final ffi.Pointer _sel_hasPrefix_1 = + _registerName1("hasPrefix:"); + late final ffi.Pointer _sel_hasSuffix_1 = + _registerName1("hasSuffix:"); + late final ffi.Pointer _sel_commonPrefixWithString_options_1 = + _registerName1("commonPrefixWithString:options:"); ffi.Pointer _objc_msgSend_21( ffi.Pointer obj, ffi.Pointer sel, - int value, + ffi.Pointer str, + int mask, ) { return __objc_msgSend_21( obj, sel, - value, + str, + mask, ); } late final __objc_msgSend_21Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Short)>>('objc_msgSend'); + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); - late final ffi.Pointer _sel_initWithUnsignedShort_1 = - _registerName1("initWithUnsignedShort:"); - ffi.Pointer _objc_msgSend_22( + late final ffi.Pointer _sel_containsString_1 = + _registerName1("containsString:"); + late final ffi.Pointer + _sel_localizedCaseInsensitiveContainsString_1 = + _registerName1("localizedCaseInsensitiveContainsString:"); + late final ffi.Pointer _sel_localizedStandardContainsString_1 = + _registerName1("localizedStandardContainsString:"); + late final ffi.Pointer _sel_localizedStandardRangeOfString_1 = + _registerName1("localizedStandardRangeOfString:"); + NSRange _objc_msgSend_22( ffi.Pointer obj, ffi.Pointer sel, - int value, + ffi.Pointer str, ) { return __objc_msgSend_22( obj, sel, - value, + str, ); } late final __objc_msgSend_22Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedShort)>>('objc_msgSend'); + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - late final ffi.Pointer _sel_initWithInt_1 = - _registerName1("initWithInt:"); - ffi.Pointer _objc_msgSend_23( + late final ffi.Pointer _sel_rangeOfString_1 = + _registerName1("rangeOfString:"); + late final ffi.Pointer _sel_rangeOfString_options_1 = + _registerName1("rangeOfString:options:"); + NSRange _objc_msgSend_23( ffi.Pointer obj, ffi.Pointer sel, - int value, + ffi.Pointer searchString, + int mask, ) { return __objc_msgSend_23( obj, sel, - value, + searchString, + mask, ); } late final __objc_msgSend_23Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Int)>>('objc_msgSend'); + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); - late final ffi.Pointer _sel_initWithUnsignedInt_1 = - _registerName1("initWithUnsignedInt:"); - ffi.Pointer _objc_msgSend_24( + late final ffi.Pointer _sel_rangeOfString_options_range_1 = + _registerName1("rangeOfString:options:range:"); + NSRange _objc_msgSend_24( ffi.Pointer obj, ffi.Pointer sel, - int value, + ffi.Pointer searchString, + int mask, + NSRange rangeOfReceiverToSearch, ) { return __objc_msgSend_24( obj, sel, - value, + searchString, + mask, + rangeOfReceiverToSearch, ); } late final __objc_msgSend_24Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedInt)>>('objc_msgSend'); + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange)>(); - late final ffi.Pointer _sel_initWithLong_1 = - _registerName1("initWithLong:"); - ffi.Pointer _objc_msgSend_25( + late final ffi.Pointer _sel_rangeOfString_options_range_locale_1 = + _registerName1("rangeOfString:options:range:locale:"); + NSRange _objc_msgSend_25( ffi.Pointer obj, ffi.Pointer sel, - int value, + ffi.Pointer searchString, + int mask, + NSRange rangeOfReceiverToSearch, + ffi.Pointer locale, ) { return __objc_msgSend_25( obj, sel, - value, + searchString, + mask, + rangeOfReceiverToSearch, + locale, ); } late final __objc_msgSend_25Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Long)>>('objc_msgSend'); + NSRange Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithUnsignedLong_1 = - _registerName1("initWithUnsignedLong:"); - ffi.Pointer _objc_msgSend_26( + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange, ffi.Pointer)>(); + + late final ffi.Pointer _sel_rangeOfCharacterFromSet_1 = + _registerName1("rangeOfCharacterFromSet:"); + late final ffi.Pointer _sel_rangeOfCharacterFromSet_options_1 = + _registerName1("rangeOfCharacterFromSet:options:"); + late final ffi.Pointer _sel_rangeOfCharacterFromSet_options_range_1 = + _registerName1("rangeOfCharacterFromSet:options:range:"); + late final ffi.Pointer + _sel_rangeOfComposedCharacterSequenceAtIndex_1 = + _registerName1("rangeOfComposedCharacterSequenceAtIndex:"); + NSRange _objc_msgSend_26( ffi.Pointer obj, ffi.Pointer sel, - int value, + int index, ) { return __objc_msgSend_26( obj, sel, - value, + index, ); } late final __objc_msgSend_26Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedLong)>>('objc_msgSend'); + NSRange Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + NSRange Function(ffi.Pointer, ffi.Pointer, int)>(); - late final ffi.Pointer _sel_initWithLongLong_1 = - _registerName1("initWithLongLong:"); - ffi.Pointer _objc_msgSend_27( + late final ffi.Pointer + _sel_rangeOfComposedCharacterSequencesForRange_1 = + _registerName1("rangeOfComposedCharacterSequencesForRange:"); + NSRange _objc_msgSend_27( ffi.Pointer obj, ffi.Pointer sel, - int value, + NSRange range, ) { return __objc_msgSend_27( obj, sel, - value, + range, ); } late final __objc_msgSend_27Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.LongLong)>>('objc_msgSend'); + NSRange Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + NSRange Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); - late final ffi.Pointer _sel_initWithUnsignedLongLong_1 = - _registerName1("initWithUnsignedLongLong:"); + late final ffi.Pointer _sel_stringByAppendingString_1 = + _registerName1("stringByAppendingString:"); ffi.Pointer _objc_msgSend_28( ffi.Pointer obj, ffi.Pointer sel, - int value, + ffi.Pointer aString, ) { return __objc_msgSend_28( obj, sel, - value, + aString, ); } late final __objc_msgSend_28Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedLongLong)>>('objc_msgSend'); + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_28 = __objc_msgSend_28Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); - late final ffi.Pointer _sel_initWithFloat_1 = - _registerName1("initWithFloat:"); - ffi.Pointer _objc_msgSend_29( + late final ffi.Pointer _sel_stringByAppendingFormat_1 = + _registerName1("stringByAppendingFormat:"); + late final ffi.Pointer _sel_doubleValue1 = + _registerName1("doubleValue"); + double _objc_msgSend_29( ffi.Pointer obj, ffi.Pointer sel, - double value, ) { return __objc_msgSend_29( obj, sel, - value, ); } late final __objc_msgSend_29Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Float)>>('objc_msgSend'); + ffi.Double Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_29 = __objc_msgSend_29Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); + double Function(ffi.Pointer, ffi.Pointer)>(); - late final ffi.Pointer _sel_initWithDouble_1 = - _registerName1("initWithDouble:"); - ffi.Pointer _objc_msgSend_30( + late final ffi.Pointer _sel_floatValue1 = + _registerName1("floatValue"); + double _objc_msgSend_30( ffi.Pointer obj, ffi.Pointer sel, - double value, ) { return __objc_msgSend_30( obj, sel, - value, ); } late final __objc_msgSend_30Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Double)>>('objc_msgSend'); + ffi.Float Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_30 = __objc_msgSend_30Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); + double Function(ffi.Pointer, ffi.Pointer)>(); - late final ffi.Pointer _sel_initWithBool_1 = - _registerName1("initWithBool:"); - ffi.Pointer _objc_msgSend_31( + late final ffi.Pointer _sel_intValue1 = _registerName1("intValue"); + int _objc_msgSend_31( ffi.Pointer obj, ffi.Pointer sel, - bool value, ) { return __objc_msgSend_31( obj, sel, - value ? 1 : 0, ); } late final __objc_msgSend_31Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); + pkg_ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_31 = __objc_msgSend_31Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); - late final ffi.Pointer _sel_initWithInteger_1 = - _registerName1("initWithInteger:"); - late final ffi.Pointer _sel_initWithUnsignedInteger_1 = - _registerName1("initWithUnsignedInteger:"); - late final ffi.Pointer _sel_charValue1 = _registerName1("charValue"); + late final ffi.Pointer _sel_integerValue1 = + _registerName1("integerValue"); int _objc_msgSend_32( ffi.Pointer obj, ffi.Pointer sel, @@ -905,13 +953,13 @@ class StringTestObjCLibrary { late final __objc_msgSend_32Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Char Function( + NSInteger Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_32 = __objc_msgSend_32Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - late final ffi.Pointer _sel_unsignedCharValue1 = - _registerName1("unsignedCharValue"); + late final ffi.Pointer _sel_longLongValue1 = + _registerName1("longLongValue"); int _objc_msgSend_33( ffi.Pointer obj, ffi.Pointer sel, @@ -924,51 +972,107 @@ class StringTestObjCLibrary { late final __objc_msgSend_33Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedChar Function( + pkg_ffi.LongLong Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_33 = __objc_msgSend_33Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); - late final ffi.Pointer _sel_shortValue1 = - _registerName1("shortValue"); - int _objc_msgSend_34( + late final ffi.Pointer _sel_boolValue1 = _registerName1("boolValue"); + late final ffi.Pointer _sel_uppercaseString1 = + _registerName1("uppercaseString"); + late final ffi.Pointer _sel_lowercaseString1 = + _registerName1("lowercaseString"); + late final ffi.Pointer _sel_capitalizedString1 = + _registerName1("capitalizedString"); + late final ffi.Pointer _sel_localizedUppercaseString1 = + _registerName1("localizedUppercaseString"); + late final ffi.Pointer _sel_localizedLowercaseString1 = + _registerName1("localizedLowercaseString"); + late final ffi.Pointer _sel_localizedCapitalizedString1 = + _registerName1("localizedCapitalizedString"); + late final ffi.Pointer _sel_uppercaseStringWithLocale_1 = + _registerName1("uppercaseStringWithLocale:"); + late final ffi.Pointer _sel_lowercaseStringWithLocale_1 = + _registerName1("lowercaseStringWithLocale:"); + late final ffi.Pointer _sel_capitalizedStringWithLocale_1 = + _registerName1("capitalizedStringWithLocale:"); + late final ffi.Pointer _sel_getLineStart_end_contentsEnd_forRange_1 = + _registerName1("getLineStart:end:contentsEnd:forRange:"); + void _objc_msgSend_34( ffi.Pointer obj, ffi.Pointer sel, + ffi.Pointer startPtr, + ffi.Pointer lineEndPtr, + ffi.Pointer contentsEndPtr, + NSRange range, ) { return __objc_msgSend_34( obj, sel, + startPtr, + lineEndPtr, + contentsEndPtr, + range, ); } late final __objc_msgSend_34Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Short Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSRange)>>('objc_msgSend'); late final __objc_msgSend_34 = __objc_msgSend_34Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSRange)>(); - late final ffi.Pointer _sel_unsignedShortValue1 = - _registerName1("unsignedShortValue"); - int _objc_msgSend_35( + late final ffi.Pointer _sel_lineRangeForRange_1 = + _registerName1("lineRangeForRange:"); + late final ffi.Pointer + _sel_getParagraphStart_end_contentsEnd_forRange_1 = + _registerName1("getParagraphStart:end:contentsEnd:forRange:"); + late final ffi.Pointer _sel_paragraphRangeForRange_1 = + _registerName1("paragraphRangeForRange:"); + late final ffi.Pointer + _sel_enumerateSubstringsInRange_options_usingBlock_1 = + _registerName1("enumerateSubstringsInRange:options:usingBlock:"); + void _objc_msgSend_35( ffi.Pointer obj, ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer block, ) { return __objc_msgSend_35( obj, sel, + range, + opts, + block, ); } late final __objc_msgSend_35Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedShort Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_35 = __objc_msgSend_35Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer)>(); - late final ffi.Pointer _sel_intValue1 = _registerName1("intValue"); - int _objc_msgSend_36( + late final ffi.Pointer _sel_enumerateLinesUsingBlock_1 = + _registerName1("enumerateLinesUsingBlock:"); + late final ffi.Pointer _sel_UTF8String1 = + _registerName1("UTF8String"); + ffi.Pointer _objc_msgSend_36( ffi.Pointer obj, ffi.Pointer sel, ) { @@ -980,1984 +1084,5333 @@ class StringTestObjCLibrary { late final __objc_msgSend_36Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_36 = __objc_msgSend_36Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - late final ffi.Pointer _sel_unsignedIntValue1 = - _registerName1("unsignedIntValue"); - int _objc_msgSend_37( + late final ffi.Pointer _sel_fastestEncoding1 = + _registerName1("fastestEncoding"); + late final ffi.Pointer _sel_smallestEncoding1 = + _registerName1("smallestEncoding"); + late final ffi.Pointer _class_NSData1 = _getClass1("NSData"); + late final ffi.Pointer + _sel_dataUsingEncoding_allowLossyConversion_1 = + _registerName1("dataUsingEncoding:allowLossyConversion:"); + ffi.Pointer _objc_msgSend_37( ffi.Pointer obj, ffi.Pointer sel, + int encoding, + bool lossy, ) { return __objc_msgSend_37( obj, sel, + encoding, + lossy ? 1 : 0, ); } late final __objc_msgSend_37Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedInt Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSStringEncoding, + ffi.Uint8)>>('objc_msgSend'); late final __objc_msgSend_37 = __objc_msgSend_37Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int, int)>(); - late final ffi.Pointer _sel_longValue1 = _registerName1("longValue"); - int _objc_msgSend_38( + late final ffi.Pointer _sel_dataUsingEncoding_1 = + _registerName1("dataUsingEncoding:"); + ffi.Pointer _objc_msgSend_38( ffi.Pointer obj, ffi.Pointer sel, + int encoding, ) { return __objc_msgSend_38( obj, sel, + encoding, ); } late final __objc_msgSend_38Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Long Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); late final __objc_msgSend_38 = __objc_msgSend_38Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); - late final ffi.Pointer _sel_unsignedLongValue1 = - _registerName1("unsignedLongValue"); - late final ffi.Pointer _sel_longLongValue1 = - _registerName1("longLongValue"); - int _objc_msgSend_39( + late final ffi.Pointer _sel_canBeConvertedToEncoding_1 = + _registerName1("canBeConvertedToEncoding:"); + bool _objc_msgSend_39( ffi.Pointer obj, ffi.Pointer sel, + int encoding, ) { return __objc_msgSend_39( - obj, - sel, - ); + obj, + sel, + encoding, + ) != + 0; } late final __objc_msgSend_39Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.LongLong Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + NSStringEncoding)>>('objc_msgSend'); late final __objc_msgSend_39 = __objc_msgSend_39Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); - late final ffi.Pointer _sel_unsignedLongLongValue1 = - _registerName1("unsignedLongLongValue"); - int _objc_msgSend_40( + late final ffi.Pointer _sel_cStringUsingEncoding_1 = + _registerName1("cStringUsingEncoding:"); + void _objc_msgSend_40( ffi.Pointer obj, ffi.Pointer sel, + int encoding, ) { return __objc_msgSend_40( obj, sel, + encoding, ); } late final __objc_msgSend_40Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedLongLong Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSStringEncoding)>>('objc_msgSend'); late final __objc_msgSend_40 = __objc_msgSend_40Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer, int)>(); - late final ffi.Pointer _sel_floatValue1 = - _registerName1("floatValue"); - double _objc_msgSend_41( + late final ffi.Pointer _sel_getCString_maxLength_encoding_1 = + _registerName1("getCString:maxLength:encoding:"); + bool _objc_msgSend_41( ffi.Pointer obj, ffi.Pointer sel, + ffi.Pointer buffer, + int maxBufferCount, + int encoding, ) { return __objc_msgSend_41( - obj, - sel, - ); + obj, + sel, + buffer, + maxBufferCount, + encoding, + ) != + 0; } late final __objc_msgSend_41Ptr = _lookup< ffi.NativeFunction< - ffi.Float Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Uint8 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSStringEncoding)>>('objc_msgSend'); late final __objc_msgSend_41 = __objc_msgSend_41Ptr.asFunction< - double Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int)>(); - late final ffi.Pointer _sel_doubleValue1 = - _registerName1("doubleValue"); - double _objc_msgSend_42( + late final ffi.Pointer + _sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_1 = + _registerName1( + "getBytes:maxLength:usedLength:encoding:options:range:remainingRange:"); + bool _objc_msgSend_42( ffi.Pointer obj, ffi.Pointer sel, + ffi.Pointer buffer, + int maxBufferCount, + ffi.Pointer usedBufferCount, + int encoding, + int options, + NSRange range, + NSRangePointer leftover, ) { return __objc_msgSend_42( - obj, - sel, - ); + obj, + sel, + buffer, + maxBufferCount, + usedBufferCount, + encoding, + options, + range, + leftover, + ) != + 0; } late final __objc_msgSend_42Ptr = _lookup< ffi.NativeFunction< - ffi.Double Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Uint8 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer, + NSStringEncoding, + ffi.Int32, + NSRange, + NSRangePointer)>>('objc_msgSend'); late final __objc_msgSend_42 = __objc_msgSend_42Ptr.asFunction< - double Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_boolValue1 = _registerName1("boolValue"); - late final ffi.Pointer _sel_integerValue1 = - _registerName1("integerValue"); - late final ffi.Pointer _sel_unsignedIntegerValue1 = - _registerName1("unsignedIntegerValue"); - late final ffi.Pointer _sel_stringValue1 = - _registerName1("stringValue"); - late final ffi.Pointer _sel_compare_1 = _registerName1("compare:"); + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + int, + int, + NSRange, + NSRangePointer)>(); + + late final ffi.Pointer _sel_maximumLengthOfBytesUsingEncoding_1 = + _registerName1("maximumLengthOfBytesUsingEncoding:"); int _objc_msgSend_43( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer otherNumber, + int enc, ) { return __objc_msgSend_43( obj, sel, - otherNumber, + enc, ); } late final __objc_msgSend_43Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + NSUInteger Function(ffi.Pointer, ffi.Pointer, + NSStringEncoding)>>('objc_msgSend'); late final __objc_msgSend_43 = __objc_msgSend_43Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); - late final ffi.Pointer _sel_isEqualToNumber_1 = - _registerName1("isEqualToNumber:"); - late final ffi.Pointer _sel_descriptionWithLocale_1 = - _registerName1("descriptionWithLocale:"); - ffi.Pointer _objc_msgSend_44( + late final ffi.Pointer _sel_lengthOfBytesUsingEncoding_1 = + _registerName1("lengthOfBytesUsingEncoding:"); + late final ffi.Pointer _sel_availableStringEncodings1 = + _registerName1("availableStringEncodings"); + ffi.Pointer _objc_msgSend_44( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer locale, ) { return __objc_msgSend_44( obj, sel, - locale, ); } late final __objc_msgSend_44Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_44 = __objc_msgSend_44Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - late final ffi.Pointer _class_NSEnumerator1 = - _getClass1("NSEnumerator"); - late final ffi.Pointer _sel_nextObject1 = - _registerName1("nextObject"); - late final ffi.Pointer _class_NSOrderedCollectionChange1 = - _getClass1("NSOrderedCollectionChange"); - late final ffi.Pointer _sel_object1 = _registerName1("object"); - late final ffi.Pointer _sel_changeType1 = - _registerName1("changeType"); - int _objc_msgSend_45( + late final ffi.Pointer _sel_localizedNameOfStringEncoding_1 = + _registerName1("localizedNameOfStringEncoding:"); + late final ffi.Pointer _sel_defaultCStringEncoding1 = + _registerName1("defaultCStringEncoding"); + late final ffi.Pointer _sel_decomposedStringWithCanonicalMapping1 = + _registerName1("decomposedStringWithCanonicalMapping"); + late final ffi.Pointer _sel_precomposedStringWithCanonicalMapping1 = + _registerName1("precomposedStringWithCanonicalMapping"); + late final ffi.Pointer + _sel_decomposedStringWithCompatibilityMapping1 = + _registerName1("decomposedStringWithCompatibilityMapping"); + late final ffi.Pointer + _sel_precomposedStringWithCompatibilityMapping1 = + _registerName1("precomposedStringWithCompatibilityMapping"); + late final ffi.Pointer _sel_stringByTrimmingCharactersInSet_1 = + _registerName1("stringByTrimmingCharactersInSet:"); + late final ffi.Pointer + _sel_stringByPaddingToLength_withString_startingAtIndex_1 = + _registerName1("stringByPaddingToLength:withString:startingAtIndex:"); + ffi.Pointer _objc_msgSend_45( ffi.Pointer obj, ffi.Pointer sel, + int newLength, + ffi.Pointer padString, + int padIndex, ) { return __objc_msgSend_45( obj, sel, + newLength, + padString, + padIndex, ); } late final __objc_msgSend_45Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer, + NSUInteger)>>('objc_msgSend'); late final __objc_msgSend_45 = __objc_msgSend_45Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer, int)>(); - late final ffi.Pointer _sel_index1 = _registerName1("index"); - late final ffi.Pointer _sel_associatedIndex1 = - _registerName1("associatedIndex"); - late final ffi.Pointer _sel_initWithObject_type_index_1 = - _registerName1("initWithObject:type:index:"); - instancetype _objc_msgSend_46( + late final ffi.Pointer _sel_stringByFoldingWithOptions_locale_1 = + _registerName1("stringByFoldingWithOptions:locale:"); + ffi.Pointer _objc_msgSend_46( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer anObject, - int type, - int index, + int options, + ffi.Pointer locale, ) { return __objc_msgSend_46( obj, sel, - anObject, - type, - index, + options, + locale, ); } late final __objc_msgSend_46Ptr = _lookup< ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32, NSUInteger)>>('objc_msgSend'); + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_46 = __objc_msgSend_46Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); late final ffi.Pointer - _sel_initWithObject_type_index_associatedIndex_1 = - _registerName1("initWithObject:type:index:associatedIndex:"); - instancetype _objc_msgSend_47( + _sel_stringByReplacingOccurrencesOfString_withString_options_range_1 = + _registerName1( + "stringByReplacingOccurrencesOfString:withString:options:range:"); + ffi.Pointer _objc_msgSend_47( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer anObject, - int type, - int index, - int associatedIndex, + ffi.Pointer target, + ffi.Pointer replacement, + int options, + NSRange searchRange, ) { return __objc_msgSend_47( obj, sel, - anObject, - type, - index, - associatedIndex, + target, + replacement, + options, + searchRange, ); } late final __objc_msgSend_47Ptr = _lookup< ffi.NativeFunction< - instancetype Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, - NSUInteger, - NSUInteger)>>('objc_msgSend'); + NSRange)>>('objc_msgSend'); late final __objc_msgSend_47 = __objc_msgSend_47Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, int)>(); + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + NSRange)>(); - late final ffi.Pointer _class_NSIndexSet1 = - _getClass1("NSIndexSet"); - late final ffi.Pointer _sel_indexSet1 = _registerName1("indexSet"); - late final ffi.Pointer _sel_indexSetWithIndex_1 = - _registerName1("indexSetWithIndex:"); - instancetype _objc_msgSend_48( + late final ffi.Pointer + _sel_stringByReplacingOccurrencesOfString_withString_1 = + _registerName1("stringByReplacingOccurrencesOfString:withString:"); + ffi.Pointer _objc_msgSend_48( ffi.Pointer obj, ffi.Pointer sel, - int value, + ffi.Pointer target, + ffi.Pointer replacement, ) { return __objc_msgSend_48( obj, sel, - value, + target, + replacement, ); } late final __objc_msgSend_48Ptr = _lookup< ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_48 = __objc_msgSend_48Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); - late final ffi.Pointer _sel_indexSetWithIndexesInRange_1 = - _registerName1("indexSetWithIndexesInRange:"); - instancetype _objc_msgSend_49( + late final ffi.Pointer + _sel_stringByReplacingCharactersInRange_withString_1 = + _registerName1("stringByReplacingCharactersInRange:withString:"); + ffi.Pointer _objc_msgSend_49( ffi.Pointer obj, ffi.Pointer sel, NSRange range, + ffi.Pointer replacement, ) { return __objc_msgSend_49( obj, sel, range, + replacement, ); } late final __objc_msgSend_49Ptr = _lookup< ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_49 = __objc_msgSend_49Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, NSRange)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, ffi.Pointer)>(); - late final ffi.Pointer _sel_initWithIndexesInRange_1 = - _registerName1("initWithIndexesInRange:"); - late final ffi.Pointer _sel_initWithIndexSet_1 = - _registerName1("initWithIndexSet:"); - late final ffi.Pointer _sel_initWithIndex_1 = - _registerName1("initWithIndex:"); - late final ffi.Pointer _sel_isEqualToIndexSet_1 = - _registerName1("isEqualToIndexSet:"); - late final ffi.Pointer _sel_count1 = _registerName1("count"); - late final ffi.Pointer _sel_firstIndex1 = - _registerName1("firstIndex"); - late final ffi.Pointer _sel_lastIndex1 = _registerName1("lastIndex"); - late final ffi.Pointer _sel_indexGreaterThanIndex_1 = - _registerName1("indexGreaterThanIndex:"); - int _objc_msgSend_50( + late final ffi.Pointer _sel_stringByApplyingTransform_reverse_1 = + _registerName1("stringByApplyingTransform:reverse:"); + ffi.Pointer _objc_msgSend_50( ffi.Pointer obj, ffi.Pointer sel, - int value, + NSStringTransform transform, + bool reverse, ) { return __objc_msgSend_50( obj, sel, - value, + transform, + reverse ? 1 : 0, ); } late final __objc_msgSend_50Ptr = _lookup< ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSStringTransform, + ffi.Uint8)>>('objc_msgSend'); late final __objc_msgSend_50 = __objc_msgSend_50Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSStringTransform, int)>(); - late final ffi.Pointer _sel_indexLessThanIndex_1 = - _registerName1("indexLessThanIndex:"); - late final ffi.Pointer _sel_indexGreaterThanOrEqualToIndex_1 = - _registerName1("indexGreaterThanOrEqualToIndex:"); - late final ffi.Pointer _sel_indexLessThanOrEqualToIndex_1 = - _registerName1("indexLessThanOrEqualToIndex:"); - late final ffi.Pointer _sel_getIndexes_maxCount_inIndexRange_1 = - _registerName1("getIndexes:maxCount:inIndexRange:"); - int _objc_msgSend_51( + late final ffi.Pointer _sel_writeToURL_atomically_encoding_error_1 = + _registerName1("writeToURL:atomically:encoding:error:"); + bool _objc_msgSend_51( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer indexBuffer, - int bufferSize, - NSRangePointer range, + ffi.Pointer url, + bool useAuxiliaryFile, + int enc, + ffi.Pointer> error, ) { return __objc_msgSend_51( - obj, - sel, - indexBuffer, - bufferSize, - range, - ); + obj, + sel, + url, + useAuxiliaryFile ? 1 : 0, + enc, + error, + ) != + 0; } late final __objc_msgSend_51Ptr = _lookup< ffi.NativeFunction< - NSUInteger Function( + ffi.Uint8 Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSRangePointer)>>('objc_msgSend'); + ffi.Pointer, + ffi.Uint8, + NSStringEncoding, + ffi.Pointer>)>>('objc_msgSend'); late final __objc_msgSend_51 = __objc_msgSend_51Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, NSRangePointer)>(); + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer>)>(); - late final ffi.Pointer _sel_countOfIndexesInRange_1 = - _registerName1("countOfIndexesInRange:"); - int _objc_msgSend_52( + late final ffi.Pointer _sel_writeToFile_atomically_encoding_error_1 = + _registerName1("writeToFile:atomically:encoding:error:"); + late final ffi.Pointer _sel_description1 = + _registerName1("description"); + late final ffi.Pointer + _sel_initWithCharactersNoCopy_length_freeWhenDone_1 = + _registerName1("initWithCharactersNoCopy:length:freeWhenDone:"); + instancetype _objc_msgSend_52( ffi.Pointer obj, ffi.Pointer sel, - NSRange range, + ffi.Pointer characters, + int length, + bool freeBuffer, ) { return __objc_msgSend_52( obj, sel, - range, + characters, + length, + freeBuffer ? 1 : 0, ); } late final __objc_msgSend_52Ptr = _lookup< ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger, ffi.Uint8)>>('objc_msgSend'); late final __objc_msgSend_52 = __objc_msgSend_52Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int)>(); - late final ffi.Pointer _sel_containsIndex_1 = - _registerName1("containsIndex:"); - bool _objc_msgSend_53( + late final ffi.Pointer + _sel_initWithCharactersNoCopy_length_deallocator_1 = + _registerName1("initWithCharactersNoCopy:length:deallocator:"); + instancetype _objc_msgSend_53( ffi.Pointer obj, ffi.Pointer sel, - int value, + ffi.Pointer chars, + int len, + ffi.Pointer deallocator, ) { return __objc_msgSend_53( - obj, - sel, - value, - ) != - 0; + obj, + sel, + chars, + len, + deallocator, + ); } late final __objc_msgSend_53Ptr = _lookup< ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_53 = __objc_msgSend_53Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); - late final ffi.Pointer _sel_containsIndexesInRange_1 = - _registerName1("containsIndexesInRange:"); - bool _objc_msgSend_54( + late final ffi.Pointer _sel_initWithCharacters_length_1 = + _registerName1("initWithCharacters:length:"); + instancetype _objc_msgSend_54( ffi.Pointer obj, ffi.Pointer sel, - NSRange range, + ffi.Pointer characters, + int length, ) { return __objc_msgSend_54( - obj, - sel, - range, - ) != - 0; + obj, + sel, + characters, + length, + ); } late final __objc_msgSend_54Ptr = _lookup< ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); - late final ffi.Pointer _sel_containsIndexes_1 = - _registerName1("containsIndexes:"); - late final ffi.Pointer _sel_intersectsIndexesInRange_1 = - _registerName1("intersectsIndexesInRange:"); - late final ffi.Pointer _sel_enumerateIndexesUsingBlock_1 = - _registerName1("enumerateIndexesUsingBlock:"); - late final ffi.Pointer - _sel_enumerateIndexesWithOptions_usingBlock_1 = - _registerName1("enumerateIndexesWithOptions:usingBlock:"); - void _objc_msgSend_55( + late final ffi.Pointer _sel_initWithUTF8String_1 = + _registerName1("initWithUTF8String:"); + instancetype _objc_msgSend_55( ffi.Pointer obj, ffi.Pointer sel, - int opts, - ffi.Pointer block, + ffi.Pointer nullTerminatedCString, ) { return __objc_msgSend_55( obj, sel, - opts, - block, + nullTerminatedCString, ); } late final __objc_msgSend_55Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_55 = __objc_msgSend_55Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - late final ffi.Pointer - _sel_enumerateIndexesInRange_options_usingBlock_1 = - _registerName1("enumerateIndexesInRange:options:usingBlock:"); - void _objc_msgSend_56( + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_initWithString_1 = + _registerName1("initWithString:"); + late final ffi.Pointer _sel_initWithFormat_1 = + _registerName1("initWithFormat:"); + late final ffi.Pointer _sel_initWithFormat_arguments_1 = + _registerName1("initWithFormat:arguments:"); + instancetype _objc_msgSend_56( ffi.Pointer obj, ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer block, + ffi.Pointer format, + ffi.Pointer<__va_list_tag> argList, ) { return __objc_msgSend_56( obj, sel, - range, - opts, - block, + format, + argList, ); } late final __objc_msgSend_56Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); late final __objc_msgSend_56 = __objc_msgSend_56Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer)>(); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<__va_list_tag>)>(); - late final ffi.Pointer _sel_indexPassingTest_1 = - _registerName1("indexPassingTest:"); - int _objc_msgSend_57( + late final ffi.Pointer _sel_initWithFormat_locale_1 = + _registerName1("initWithFormat:locale:"); + instancetype _objc_msgSend_57( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer predicate, + ffi.Pointer format, + ffi.Pointer locale, ) { return __objc_msgSend_57( obj, sel, - predicate, + format, + locale, ); } late final __objc_msgSend_57Ptr = _lookup< ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_57 = __objc_msgSend_57Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); - late final ffi.Pointer _sel_indexWithOptions_passingTest_1 = - _registerName1("indexWithOptions:passingTest:"); - int _objc_msgSend_58( + late final ffi.Pointer _sel_initWithFormat_locale_arguments_1 = + _registerName1("initWithFormat:locale:arguments:"); + instancetype _objc_msgSend_58( ffi.Pointer obj, ffi.Pointer sel, - int opts, - ffi.Pointer predicate, + ffi.Pointer format, + ffi.Pointer locale, + ffi.Pointer<__va_list_tag> argList, ) { return __objc_msgSend_58( obj, sel, - opts, - predicate, + format, + locale, + argList, ); } late final __objc_msgSend_58Ptr = _lookup< ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); late final __objc_msgSend_58 = __objc_msgSend_58Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>(); - late final ffi.Pointer _sel_indexInRange_options_passingTest_1 = - _registerName1("indexInRange:options:passingTest:"); - int _objc_msgSend_59( + late final ffi.Pointer _sel_initWithData_encoding_1 = + _registerName1("initWithData:encoding:"); + instancetype _objc_msgSend_59( ffi.Pointer obj, ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer predicate, + ffi.Pointer data, + int encoding, ) { return __objc_msgSend_59( obj, sel, - range, - opts, - predicate, + data, + encoding, ); } late final __objc_msgSend_59Ptr = _lookup< ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer)>(); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); - late final ffi.Pointer _sel_indexesPassingTest_1 = - _registerName1("indexesPassingTest:"); - ffi.Pointer _objc_msgSend_60( + late final ffi.Pointer _sel_initWithBytes_length_encoding_1 = + _registerName1("initWithBytes:length:encoding:"); + instancetype _objc_msgSend_60( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer predicate, + ffi.Pointer bytes, + int len, + int encoding, ) { return __objc_msgSend_60( obj, sel, - predicate, + bytes, + len, + encoding, ); } late final __objc_msgSend_60Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSStringEncoding)>>('objc_msgSend'); late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int)>(); - late final ffi.Pointer _sel_indexesWithOptions_passingTest_1 = - _registerName1("indexesWithOptions:passingTest:"); - ffi.Pointer _objc_msgSend_61( + late final ffi.Pointer + _sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1 = + _registerName1("initWithBytesNoCopy:length:encoding:freeWhenDone:"); + instancetype _objc_msgSend_61( ffi.Pointer obj, ffi.Pointer sel, - int opts, - ffi.Pointer predicate, + ffi.Pointer bytes, + int len, + int encoding, + bool freeBuffer, ) { return __objc_msgSend_61( obj, sel, - opts, - predicate, + bytes, + len, + encoding, + freeBuffer ? 1 : 0, ); } late final __objc_msgSend_61Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + instancetype Function( ffi.Pointer, ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer, + NSUInteger, + NSStringEncoding, + ffi.Uint8)>>('objc_msgSend'); late final __objc_msgSend_61 = __objc_msgSend_61Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, int)>(); - late final ffi.Pointer _sel_indexesInRange_options_passingTest_1 = - _registerName1("indexesInRange:options:passingTest:"); - ffi.Pointer _objc_msgSend_62( + late final ffi.Pointer + _sel_initWithBytesNoCopy_length_encoding_deallocator_1 = + _registerName1("initWithBytesNoCopy:length:encoding:deallocator:"); + instancetype _objc_msgSend_62( ffi.Pointer obj, ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer predicate, + ffi.Pointer bytes, + int len, + int encoding, + ffi.Pointer deallocator, ) { return __objc_msgSend_62( obj, sel, - range, - opts, - predicate, + bytes, + len, + encoding, + deallocator, ); } late final __objc_msgSend_62Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + instancetype Function( ffi.Pointer, ffi.Pointer, - NSRange, - ffi.Int32, + ffi.Pointer, + NSUInteger, + NSStringEncoding, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSRange, int, ffi.Pointer)>(); - - late final ffi.Pointer _sel_enumerateRangesUsingBlock_1 = - _registerName1("enumerateRangesUsingBlock:"); - late final ffi.Pointer _sel_enumerateRangesWithOptions_usingBlock_1 = - _registerName1("enumerateRangesWithOptions:usingBlock:"); - late final ffi.Pointer - _sel_enumerateRangesInRange_options_usingBlock_1 = - _registerName1("enumerateRangesInRange:options:usingBlock:"); - late final ffi.Pointer _class_NSMutableIndexSet1 = - _getClass1("NSMutableIndexSet"); - late final ffi.Pointer _sel_addIndexes_1 = - _registerName1("addIndexes:"); - late final ffi.Pointer _sel_removeIndexes_1 = - _registerName1("removeIndexes:"); - late final ffi.Pointer _sel_removeAllIndexes1 = - _registerName1("removeAllIndexes"); - late final ffi.Pointer _sel_addIndex_1 = _registerName1("addIndex:"); - void _objc_msgSend_63( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_63( - obj, - sel, - value, - ); - } + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer)>(); + + late final ffi.Pointer _sel_string1 = _registerName1("string"); + late final ffi.Pointer _sel_stringWithString_1 = + _registerName1("stringWithString:"); + late final ffi.Pointer _sel_stringWithCharacters_length_1 = + _registerName1("stringWithCharacters:length:"); + late final ffi.Pointer _sel_stringWithUTF8String_1 = + _registerName1("stringWithUTF8String:"); + late final ffi.Pointer _sel_stringWithFormat_1 = + _registerName1("stringWithFormat:"); + late final ffi.Pointer _sel_localizedStringWithFormat_1 = + _registerName1("localizedStringWithFormat:"); + late final ffi.Pointer _sel_initWithCString_encoding_1 = + _registerName1("initWithCString:encoding:"); + instancetype _objc_msgSend_63( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer nullTerminatedCString, + int encoding, + ) { + return __objc_msgSend_63( + obj, + sel, + nullTerminatedCString, + encoding, + ); + } late final __objc_msgSend_63Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); late final __objc_msgSend_63 = __objc_msgSend_63Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); - late final ffi.Pointer _sel_removeIndex_1 = - _registerName1("removeIndex:"); - late final ffi.Pointer _sel_addIndexesInRange_1 = - _registerName1("addIndexesInRange:"); - void _objc_msgSend_64( + late final ffi.Pointer _sel_stringWithCString_encoding_1 = + _registerName1("stringWithCString:encoding:"); + late final ffi.Pointer _sel_initWithContentsOfURL_encoding_error_1 = + _registerName1("initWithContentsOfURL:encoding:error:"); + instancetype _objc_msgSend_64( ffi.Pointer obj, ffi.Pointer sel, - NSRange range, + ffi.Pointer url, + int enc, + ffi.Pointer> error, ) { return __objc_msgSend_64( obj, sel, - range, + url, + enc, + error, ); } late final __objc_msgSend_64Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSStringEncoding, + ffi.Pointer>)>>('objc_msgSend'); late final __objc_msgSend_64 = __objc_msgSend_64Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); - late final ffi.Pointer _sel_removeIndexesInRange_1 = - _registerName1("removeIndexesInRange:"); - late final ffi.Pointer _sel_shiftIndexesStartingAtIndex_by_1 = - _registerName1("shiftIndexesStartingAtIndex:by:"); - void _objc_msgSend_65( + late final ffi.Pointer _sel_initWithContentsOfFile_encoding_error_1 = + _registerName1("initWithContentsOfFile:encoding:error:"); + late final ffi.Pointer + _sel_stringWithContentsOfURL_encoding_error_1 = + _registerName1("stringWithContentsOfURL:encoding:error:"); + late final ffi.Pointer + _sel_stringWithContentsOfFile_encoding_error_1 = + _registerName1("stringWithContentsOfFile:encoding:error:"); + late final ffi.Pointer + _sel_initWithContentsOfURL_usedEncoding_error_1 = + _registerName1("initWithContentsOfURL:usedEncoding:error:"); + instancetype _objc_msgSend_65( ffi.Pointer obj, ffi.Pointer sel, - int index, - int delta, + ffi.Pointer url, + ffi.Pointer enc, + ffi.Pointer> error, ) { return __objc_msgSend_65( obj, sel, - index, - delta, + url, + enc, + error, ); } late final __objc_msgSend_65Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSUInteger, NSInteger)>>('objc_msgSend'); + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); late final __objc_msgSend_65 = __objc_msgSend_65Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, int)>(); + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); - late final ffi.Pointer _class_NSOrderedCollectionDifference1 = - _getClass1("NSOrderedCollectionDifference"); - late final ffi.Pointer _sel_initWithChanges_1 = - _registerName1("initWithChanges:"); late final ffi.Pointer - _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges_1 = + _sel_initWithContentsOfFile_usedEncoding_error_1 = + _registerName1("initWithContentsOfFile:usedEncoding:error:"); + late final ffi.Pointer + _sel_stringWithContentsOfURL_usedEncoding_error_1 = + _registerName1("stringWithContentsOfURL:usedEncoding:error:"); + late final ffi.Pointer + _sel_stringWithContentsOfFile_usedEncoding_error_1 = + _registerName1("stringWithContentsOfFile:usedEncoding:error:"); + late final ffi.Pointer + _sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1 = _registerName1( - "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:additionalChanges:"); - instancetype _objc_msgSend_66( + "stringEncodingForData:encodingOptions:convertedString:usedLossyConversion:"); + int _objc_msgSend_66( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer inserts, - ffi.Pointer insertedObjects, - ffi.Pointer removes, - ffi.Pointer removedObjects, - ffi.Pointer changes, + ffi.Pointer data, + ffi.Pointer opts, + ffi.Pointer> string, + ffi.Pointer usedLossyConversion, ) { return __objc_msgSend_66( obj, sel, - inserts, - insertedObjects, - removes, - removedObjects, - changes, + data, + opts, + string, + usedLossyConversion, ); } late final __objc_msgSend_66Ptr = _lookup< ffi.NativeFunction< - instancetype Function( + NSStringEncoding Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer>, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_66 = __objc_msgSend_66Ptr.asFunction< - instancetype Function( + int Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer - _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_1 = - _registerName1( - "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:"); - instancetype _objc_msgSend_67( + ffi.Pointer>, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_propertyList1 = + _registerName1("propertyList"); + late final ffi.Pointer _class_NSDictionary1 = + _getClass1("NSDictionary"); + late final ffi.Pointer _sel_propertyListFromStringsFileFormat1 = + _registerName1("propertyListFromStringsFileFormat"); + ffi.Pointer _objc_msgSend_67( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer inserts, - ffi.Pointer insertedObjects, - ffi.Pointer removes, - ffi.Pointer removedObjects, ) { return __objc_msgSend_67( obj, sel, - inserts, - insertedObjects, - removes, - removedObjects, ); } late final __objc_msgSend_67Ptr = _lookup< ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_67 = __objc_msgSend_67Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - late final ffi.Pointer _sel_insertions1 = - _registerName1("insertions"); - late final ffi.Pointer _sel_removals1 = _registerName1("removals"); - late final ffi.Pointer _sel_hasChanges1 = - _registerName1("hasChanges"); - late final ffi.Pointer _sel_inverseDifference1 = - _registerName1("inverseDifference"); - late final ffi.Pointer _class_NSArray1 = _getClass1("NSArray"); - late final ffi.Pointer _sel_objectAtIndex_1 = - _registerName1("objectAtIndex:"); - late final ffi.Pointer _sel_initWithObjects_count_1 = - _registerName1("initWithObjects:count:"); - instancetype _objc_msgSend_68( + late final ffi.Pointer _sel_cString1 = _registerName1("cString"); + late final ffi.Pointer _sel_lossyCString1 = + _registerName1("lossyCString"); + late final ffi.Pointer _sel_cStringLength1 = + _registerName1("cStringLength"); + late final ffi.Pointer _sel_getCString_1 = + _registerName1("getCString:"); + void _objc_msgSend_68( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer> objects, - int cnt, + ffi.Pointer bytes, ) { return __objc_msgSend_68( obj, sel, - objects, - cnt, + bytes, ); } late final __objc_msgSend_68Ptr = _lookup< ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - NSUInteger)>>('objc_msgSend'); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_68 = __objc_msgSend_68Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>, int)>(); + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - late final ffi.Pointer _class_NSMutableArray1 = - _getClass1("NSMutableArray"); - late final ffi.Pointer _sel_addObject_1 = - _registerName1("addObject:"); - late final ffi.Pointer _sel_insertObject_atIndex_1 = - _registerName1("insertObject:atIndex:"); + late final ffi.Pointer _sel_getCString_maxLength_1 = + _registerName1("getCString:maxLength:"); void _objc_msgSend_69( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer anObject, - int index, + ffi.Pointer bytes, + int maxLength, ) { return __objc_msgSend_69( obj, sel, - anObject, - index, + bytes, + maxLength, ); } late final __objc_msgSend_69Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); + ffi.Pointer, NSUInteger)>>('objc_msgSend'); late final __objc_msgSend_69 = __objc_msgSend_69Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + ffi.Pointer, int)>(); - late final ffi.Pointer _sel_removeLastObject1 = - _registerName1("removeLastObject"); - late final ffi.Pointer _sel_removeObjectAtIndex_1 = - _registerName1("removeObjectAtIndex:"); - late final ffi.Pointer _sel_replaceObjectAtIndex_withObject_1 = - _registerName1("replaceObjectAtIndex:withObject:"); + late final ffi.Pointer + _sel_getCString_maxLength_range_remainingRange_1 = + _registerName1("getCString:maxLength:range:remainingRange:"); void _objc_msgSend_70( ffi.Pointer obj, ffi.Pointer sel, - int index, - ffi.Pointer anObject, + ffi.Pointer bytes, + int maxLength, + NSRange aRange, + NSRangePointer leftoverRange, ) { return __objc_msgSend_70( obj, sel, - index, - anObject, + bytes, + maxLength, + aRange, + leftoverRange, ); } late final __objc_msgSend_70Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSUInteger, ffi.Pointer)>>('objc_msgSend'); + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSRange, + NSRangePointer)>>('objc_msgSend'); late final __objc_msgSend_70 = __objc_msgSend_70Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange, NSRangePointer)>(); - late final ffi.Pointer _sel_initWithCapacity_1 = - _registerName1("initWithCapacity:"); - late final ffi.Pointer _class_NSItemProvider1 = - _getClass1("NSItemProvider"); - late final ffi.Pointer - _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1 = - _registerName1( - "registerDataRepresentationForTypeIdentifier:visibility:loadHandler:"); - void _objc_msgSend_71( + late final ffi.Pointer _sel_writeToFile_atomically_1 = + _registerName1("writeToFile:atomically:"); + bool _objc_msgSend_71( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer typeIdentifier, - int visibility, - ffi.Pointer loadHandler, + ffi.Pointer path, + bool useAuxiliaryFile, ) { return __objc_msgSend_71( - obj, - sel, - typeIdentifier, - visibility, - loadHandler, - ); + obj, + sel, + path, + useAuxiliaryFile ? 1 : 0, + ) != + 0; } late final __objc_msgSend_71Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); late final __objc_msgSend_71 = __objc_msgSend_71Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + late final ffi.Pointer _sel_writeToURL_atomically_1 = + _registerName1("writeToURL:atomically:"); + late final ffi.Pointer _sel_initWithContentsOfFile_1 = + _registerName1("initWithContentsOfFile:"); + late final ffi.Pointer _sel_initWithContentsOfURL_1 = + _registerName1("initWithContentsOfURL:"); + late final ffi.Pointer _sel_stringWithContentsOfFile_1 = + _registerName1("stringWithContentsOfFile:"); + late final ffi.Pointer _sel_stringWithContentsOfURL_1 = + _registerName1("stringWithContentsOfURL:"); late final ffi.Pointer - _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1 = - _registerName1( - "registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:"); - void _objc_msgSend_72( + _sel_initWithCStringNoCopy_length_freeWhenDone_1 = + _registerName1("initWithCStringNoCopy:length:freeWhenDone:"); + ffi.Pointer _objc_msgSend_72( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer typeIdentifier, - int fileOptions, - int visibility, - ffi.Pointer loadHandler, + ffi.Pointer bytes, + int length, + bool freeBuffer, ) { return __objc_msgSend_72( obj, sel, - typeIdentifier, - fileOptions, - visibility, - loadHandler, + bytes, + length, + freeBuffer ? 1 : 0, ); } late final __objc_msgSend_72Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer, + NSUInteger, + ffi.Uint8)>>('objc_msgSend'); late final __objc_msgSend_72 = __objc_msgSend_72Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, ffi.Pointer)>(); - - late final ffi.Pointer _sel_registeredTypeIdentifiers1 = - _registerName1("registeredTypeIdentifiers"); - late final ffi.Pointer _sel_hasItemConformingToTypeIdentifier_1 = - _registerName1("hasItemConformingToTypeIdentifier:"); - late final ffi.Pointer - _sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1 = - _registerName1( - "hasRepresentationConformingToTypeIdentifier:fileOptions:"); - bool _objc_msgSend_73( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - int fileOptions, - ) { - return __objc_msgSend_73( - obj, - sel, - typeIdentifier, - fileOptions, - ) != - 0; - } + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, int)>(); + + late final ffi.Pointer _sel_initWithCString_length_1 = + _registerName1("initWithCString:length:"); + late final ffi.Pointer _sel_initWithCString_1 = + _registerName1("initWithCString:"); + late final ffi.Pointer _sel_stringWithCString_length_1 = + _registerName1("stringWithCString:length:"); + late final ffi.Pointer _sel_stringWithCString_1 = + _registerName1("stringWithCString:"); + late final ffi.Pointer _sel_getCharacters_1 = + _registerName1("getCharacters:"); + void _objc_msgSend_73( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + ) { + return __objc_msgSend_73( + obj, + sel, + buffer, + ); + } late final __objc_msgSend_73Ptr = _lookup< ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_73 = __objc_msgSend_73Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - late final ffi.Pointer _class_NSProgress1 = - _getClass1("NSProgress"); - late final ffi.Pointer - _sel_loadDataRepresentationForTypeIdentifier_completionHandler_1 = - _registerName1( - "loadDataRepresentationForTypeIdentifier:completionHandler:"); ffi.Pointer _objc_msgSend_74( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer completionHandler, ) { return __objc_msgSend_74( obj, sel, - typeIdentifier, - completionHandler, ); } late final __objc_msgSend_74Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_74 = __objc_msgSend_74Ptr.asFunction< ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); - late final ffi.Pointer - _sel_loadFileRepresentationForTypeIdentifier_completionHandler_1 = - _registerName1( - "loadFileRepresentationForTypeIdentifier:completionHandler:"); - late final ffi.Pointer - _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1 = - _registerName1( - "loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:"); - late final ffi.Pointer _sel_suggestedName1 = - _registerName1("suggestedName"); - late final ffi.Pointer _sel_setSuggestedName_1 = - _registerName1("setSuggestedName:"); - late final ffi.Pointer _sel_initWithObject_1 = - _registerName1("initWithObject:"); - late final ffi.Pointer _sel_registerObject_visibility_1 = - _registerName1("registerObject:visibility:"); + late final ffi.Pointer _sel_debugDescription1 = + _registerName1("debugDescription"); + late final ffi.Pointer _sel_version1 = _registerName1("version"); + late final ffi.Pointer _sel_setVersion_1 = + _registerName1("setVersion:"); void _objc_msgSend_75( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer object, - int visibility, + int aVersion, ) { return __objc_msgSend_75( obj, sel, - object, - visibility, + aVersion, ); } late final __objc_msgSend_75Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + NSInteger)>>('objc_msgSend'); late final __objc_msgSend_75 = __objc_msgSend_75Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + void Function(ffi.Pointer, ffi.Pointer, int)>(); - late final ffi.Pointer - _sel_registerObjectOfClass_visibility_loadHandler_1 = - _registerName1("registerObjectOfClass:visibility:loadHandler:"); - late final ffi.Pointer _sel_canLoadObjectOfClass_1 = - _registerName1("canLoadObjectOfClass:"); - late final ffi.Pointer _sel_loadObjectOfClass_completionHandler_1 = - _registerName1("loadObjectOfClass:completionHandler:"); - late final ffi.Pointer _sel_initWithItem_typeIdentifier_1 = - _registerName1("initWithItem:typeIdentifier:"); - instancetype _objc_msgSend_76( + late final ffi.Pointer _sel_classForCoder1 = + _registerName1("classForCoder"); + late final ffi.Pointer _sel_replacementObjectForCoder_1 = + _registerName1("replacementObjectForCoder:"); + late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = + _registerName1("awakeAfterUsingCoder:"); + late final ffi.Pointer _sel_poseAsClass_1 = + _registerName1("poseAsClass:"); + late final ffi.Pointer _sel_autoContentAccessingProxy1 = + _registerName1("autoContentAccessingProxy"); + late final ffi.Pointer _class_NSValue1 = _getClass1("NSValue"); + late final ffi.Pointer _sel_getValue_size_1 = + _registerName1("getValue:size:"); + void _objc_msgSend_76( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer item, - ffi.Pointer typeIdentifier, + ffi.Pointer value, + int size, ) { return __objc_msgSend_76( obj, sel, - item, - typeIdentifier, + value, + size, ); } late final __objc_msgSend_76Ptr = _lookup< ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); late final __objc_msgSend_76 = __objc_msgSend_76Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); - late final ffi.Pointer _sel_initWithContentsOfURL_1 = - _registerName1("initWithContentsOfURL:"); - late final ffi.Pointer - _sel_registerItemForTypeIdentifier_loadHandler_1 = - _registerName1("registerItemForTypeIdentifier:loadHandler:"); - void _objc_msgSend_77( + late final ffi.Pointer _sel_objCType1 = _registerName1("objCType"); + late final ffi.Pointer _sel_initWithBytes_objCType_1 = + _registerName1("initWithBytes:objCType:"); + instancetype _objc_msgSend_77( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer typeIdentifier, - NSItemProviderLoadHandler loadHandler, + ffi.Pointer value, + ffi.Pointer type, ) { return __objc_msgSend_77( obj, sel, - typeIdentifier, - loadHandler, + value, + type, ); } late final __objc_msgSend_77Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function( + instancetype Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - NSItemProviderLoadHandler)>>('objc_msgSend'); + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_77 = __objc_msgSend_77Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSItemProviderLoadHandler)>(); + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); - late final ffi.Pointer - _sel_loadItemForTypeIdentifier_options_completionHandler_1 = - _registerName1("loadItemForTypeIdentifier:options:completionHandler:"); - void _objc_msgSend_78( + late final ffi.Pointer _sel_valueWithBytes_objCType_1 = + _registerName1("valueWithBytes:objCType:"); + ffi.Pointer _objc_msgSend_78( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer options, - NSItemProviderCompletionHandler completionHandler, + ffi.Pointer value, + ffi.Pointer type, ) { return __objc_msgSend_78( obj, sel, - typeIdentifier, - options, - completionHandler, + value, + type, ); } late final __objc_msgSend_78Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSItemProviderCompletionHandler)>>('objc_msgSend'); + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_78 = __objc_msgSend_78Ptr.asFunction< - void Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSItemProviderCompletionHandler)>(); + ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_value_withObjCType_1 = + _registerName1("value:withObjCType:"); + late final ffi.Pointer _sel_valueWithNonretainedObject_1 = + _registerName1("valueWithNonretainedObject:"); + ffi.Pointer _objc_msgSend_79( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ) { + return __objc_msgSend_79( + obj, + sel, + anObject, + ); + } - late final ffi.Pointer> - _NSItemProviderPreferredImageSizeKey = - _lookup>('NSItemProviderPreferredImageSizeKey'); + late final __objc_msgSend_79Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_79 = __objc_msgSend_79Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer get NSItemProviderPreferredImageSizeKey => - _NSItemProviderPreferredImageSizeKey.value; + late final ffi.Pointer _sel_nonretainedObjectValue1 = + _registerName1("nonretainedObjectValue"); + late final ffi.Pointer _sel_valueWithPointer_1 = + _registerName1("valueWithPointer:"); + ffi.Pointer _objc_msgSend_80( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer pointer, + ) { + return __objc_msgSend_80( + obj, + sel, + pointer, + ); + } - set NSItemProviderPreferredImageSizeKey(ffi.Pointer value) => - _NSItemProviderPreferredImageSizeKey.value = value; + late final __objc_msgSend_80Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); - late final ffi.Pointer> - _NSExtensionJavaScriptPreprocessingResultsKey = - _lookup>( - 'NSExtensionJavaScriptPreprocessingResultsKey'); + late final ffi.Pointer _sel_pointerValue1 = + _registerName1("pointerValue"); + ffi.Pointer _objc_msgSend_81( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_81( + obj, + sel, + ); + } - ffi.Pointer get NSExtensionJavaScriptPreprocessingResultsKey => - _NSExtensionJavaScriptPreprocessingResultsKey.value; + late final __objc_msgSend_81Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_81 = __objc_msgSend_81Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - set NSExtensionJavaScriptPreprocessingResultsKey( - ffi.Pointer value) => - _NSExtensionJavaScriptPreprocessingResultsKey.value = value; + late final ffi.Pointer _sel_isEqualToValue_1 = + _registerName1("isEqualToValue:"); + late final ffi.Pointer _sel_getValue_1 = _registerName1("getValue:"); + void _objc_msgSend_82( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_82( + obj, + sel, + value, + ); + } - late final ffi.Pointer> - _NSExtensionJavaScriptFinalizeArgumentKey = - _lookup>( - 'NSExtensionJavaScriptFinalizeArgumentKey'); + late final __objc_msgSend_82Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_82 = __objc_msgSend_82Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - ffi.Pointer get NSExtensionJavaScriptFinalizeArgumentKey => - _NSExtensionJavaScriptFinalizeArgumentKey.value; + late final ffi.Pointer _sel_valueWithRange_1 = + _registerName1("valueWithRange:"); + ffi.Pointer _objc_msgSend_83( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_83( + obj, + sel, + range, + ); + } - set NSExtensionJavaScriptFinalizeArgumentKey(ffi.Pointer value) => - _NSExtensionJavaScriptFinalizeArgumentKey.value = value; + late final __objc_msgSend_83Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_83 = __objc_msgSend_83Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); - late final ffi.Pointer> _NSItemProviderErrorDomain = - _lookup>('NSItemProviderErrorDomain'); + late final ffi.Pointer _sel_rangeValue1 = + _registerName1("rangeValue"); + NSRange _objc_msgSend_84( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_84( + obj, + sel, + ); + } - ffi.Pointer get NSItemProviderErrorDomain => - _NSItemProviderErrorDomain.value; + late final __objc_msgSend_84Ptr = _lookup< + ffi.NativeFunction< + NSRange Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_84 = __objc_msgSend_84Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer)>(); - set NSItemProviderErrorDomain(ffi.Pointer value) => - _NSItemProviderErrorDomain.value = value; + late final ffi.Pointer _class_NSNumber1 = _getClass1("NSNumber"); + late final ffi.Pointer _sel_initWithChar_1 = + _registerName1("initWithChar:"); + ffi.Pointer _objc_msgSend_85( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_85( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_85Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Char)>>('objc_msgSend'); + late final __objc_msgSend_85 = __objc_msgSend_85Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithUnsignedChar_1 = + _registerName1("initWithUnsignedChar:"); + ffi.Pointer _objc_msgSend_86( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_86( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_86Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedChar)>>('objc_msgSend'); + late final __objc_msgSend_86 = __objc_msgSend_86Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithShort_1 = + _registerName1("initWithShort:"); + ffi.Pointer _objc_msgSend_87( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_87( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_87Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Short)>>('objc_msgSend'); + late final __objc_msgSend_87 = __objc_msgSend_87Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithUnsignedShort_1 = + _registerName1("initWithUnsignedShort:"); + ffi.Pointer _objc_msgSend_88( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_88( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_88Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedShort)>>('objc_msgSend'); + late final __objc_msgSend_88 = __objc_msgSend_88Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithInt_1 = + _registerName1("initWithInt:"); + ffi.Pointer _objc_msgSend_89( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_89( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_89Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Int)>>('objc_msgSend'); + late final __objc_msgSend_89 = __objc_msgSend_89Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithUnsignedInt_1 = + _registerName1("initWithUnsignedInt:"); + ffi.Pointer _objc_msgSend_90( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_90( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_90Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_90 = __objc_msgSend_90Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithLong_1 = + _registerName1("initWithLong:"); + ffi.Pointer _objc_msgSend_91( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_91( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_91Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.Long)>>('objc_msgSend'); + late final __objc_msgSend_91 = __objc_msgSend_91Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithUnsignedLong_1 = + _registerName1("initWithUnsignedLong:"); + ffi.Pointer _objc_msgSend_92( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_92( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_92Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_92 = __objc_msgSend_92Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithLongLong_1 = + _registerName1("initWithLongLong:"); + ffi.Pointer _objc_msgSend_93( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_93( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_93Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.LongLong)>>('objc_msgSend'); + late final __objc_msgSend_93 = __objc_msgSend_93Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithUnsignedLongLong_1 = + _registerName1("initWithUnsignedLongLong:"); + ffi.Pointer _objc_msgSend_94( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_94( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_94Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, pkg_ffi.UnsignedLongLong)>>('objc_msgSend'); + late final __objc_msgSend_94 = __objc_msgSend_94Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithFloat_1 = + _registerName1("initWithFloat:"); + ffi.Pointer _objc_msgSend_95( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_95( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_95Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Float)>>('objc_msgSend'); + late final __objc_msgSend_95 = __objc_msgSend_95Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); + + late final ffi.Pointer _sel_initWithDouble_1 = + _registerName1("initWithDouble:"); + ffi.Pointer _objc_msgSend_96( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_96( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_96Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_96 = __objc_msgSend_96Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); + + late final ffi.Pointer _sel_initWithBool_1 = + _registerName1("initWithBool:"); + ffi.Pointer _objc_msgSend_97( + ffi.Pointer obj, + ffi.Pointer sel, + bool value, + ) { + return __objc_msgSend_97( + obj, + sel, + value ? 1 : 0, + ); + } + + late final __objc_msgSend_97Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); + late final __objc_msgSend_97 = __objc_msgSend_97Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_initWithInteger_1 = + _registerName1("initWithInteger:"); + late final ffi.Pointer _sel_initWithUnsignedInteger_1 = + _registerName1("initWithUnsignedInteger:"); + late final ffi.Pointer _sel_charValue1 = _registerName1("charValue"); + int _objc_msgSend_98( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_98( + obj, + sel, + ); + } + + late final __objc_msgSend_98Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.Char Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_98 = __objc_msgSend_98Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_unsignedCharValue1 = + _registerName1("unsignedCharValue"); + int _objc_msgSend_99( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_99( + obj, + sel, + ); + } + + late final __objc_msgSend_99Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedChar Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_99 = __objc_msgSend_99Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_shortValue1 = + _registerName1("shortValue"); + int _objc_msgSend_100( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_100( + obj, + sel, + ); + } + + late final __objc_msgSend_100Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.Short Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_100 = __objc_msgSend_100Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_unsignedShortValue1 = + _registerName1("unsignedShortValue"); + int _objc_msgSend_101( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_101( + obj, + sel, + ); + } + + late final __objc_msgSend_101Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedShort Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_101 = __objc_msgSend_101Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_unsignedIntValue1 = + _registerName1("unsignedIntValue"); + int _objc_msgSend_102( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_102( + obj, + sel, + ); + } + + late final __objc_msgSend_102Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedInt Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_102 = __objc_msgSend_102Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_longValue1 = _registerName1("longValue"); + late final ffi.Pointer _sel_unsignedLongValue1 = + _registerName1("unsignedLongValue"); + late final ffi.Pointer _sel_unsignedLongLongValue1 = + _registerName1("unsignedLongLongValue"); + int _objc_msgSend_103( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_103( + obj, + sel, + ); + } + + late final __objc_msgSend_103Ptr = _lookup< + ffi.NativeFunction< + pkg_ffi.UnsignedLongLong Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_103 = __objc_msgSend_103Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_unsignedIntegerValue1 = + _registerName1("unsignedIntegerValue"); + late final ffi.Pointer _sel_stringValue1 = + _registerName1("stringValue"); + late final ffi.Pointer _sel_isEqualToNumber_1 = + _registerName1("isEqualToNumber:"); + late final ffi.Pointer _sel_descriptionWithLocale_1 = + _registerName1("descriptionWithLocale:"); + late final ffi.Pointer _sel_numberWithChar_1 = + _registerName1("numberWithChar:"); + late final ffi.Pointer _sel_numberWithUnsignedChar_1 = + _registerName1("numberWithUnsignedChar:"); + late final ffi.Pointer _sel_numberWithShort_1 = + _registerName1("numberWithShort:"); + late final ffi.Pointer _sel_numberWithUnsignedShort_1 = + _registerName1("numberWithUnsignedShort:"); + late final ffi.Pointer _sel_numberWithInt_1 = + _registerName1("numberWithInt:"); + late final ffi.Pointer _sel_numberWithUnsignedInt_1 = + _registerName1("numberWithUnsignedInt:"); + late final ffi.Pointer _sel_numberWithLong_1 = + _registerName1("numberWithLong:"); + late final ffi.Pointer _sel_numberWithUnsignedLong_1 = + _registerName1("numberWithUnsignedLong:"); + late final ffi.Pointer _sel_numberWithLongLong_1 = + _registerName1("numberWithLongLong:"); + late final ffi.Pointer _sel_numberWithUnsignedLongLong_1 = + _registerName1("numberWithUnsignedLongLong:"); + late final ffi.Pointer _sel_numberWithFloat_1 = + _registerName1("numberWithFloat:"); + late final ffi.Pointer _sel_numberWithDouble_1 = + _registerName1("numberWithDouble:"); + late final ffi.Pointer _sel_numberWithBool_1 = + _registerName1("numberWithBool:"); + late final ffi.Pointer _sel_numberWithInteger_1 = + _registerName1("numberWithInteger:"); + late final ffi.Pointer _sel_numberWithUnsignedInteger_1 = + _registerName1("numberWithUnsignedInteger:"); + late final ffi.Pointer _class_NSEnumerator1 = + _getClass1("NSEnumerator"); + late final ffi.Pointer _sel_nextObject1 = + _registerName1("nextObject"); + late final ffi.Pointer _sel_allObjects1 = + _registerName1("allObjects"); + late final ffi.Pointer _class_NSOrderedCollectionChange1 = + _getClass1("NSOrderedCollectionChange"); + late final ffi.Pointer _sel_object1 = _registerName1("object"); + late final ffi.Pointer _sel_changeType1 = + _registerName1("changeType"); + int _objc_msgSend_104( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_104( + obj, + sel, + ); + } + + late final __objc_msgSend_104Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_104 = __objc_msgSend_104Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_index1 = _registerName1("index"); + late final ffi.Pointer _sel_associatedIndex1 = + _registerName1("associatedIndex"); + late final ffi.Pointer _sel_initWithObject_type_index_1 = + _registerName1("initWithObject:type:index:"); + instancetype _objc_msgSend_105( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + int type, + int index, + ) { + return __objc_msgSend_105( + obj, + sel, + anObject, + type, + index, + ); + } + + late final __objc_msgSend_105Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_105 = __objc_msgSend_105Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int)>(); + + late final ffi.Pointer + _sel_initWithObject_type_index_associatedIndex_1 = + _registerName1("initWithObject:type:index:associatedIndex:"); + instancetype _objc_msgSend_106( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + int type, + int index, + int associatedIndex, + ) { + return __objc_msgSend_106( + obj, + sel, + anObject, + type, + index, + associatedIndex, + ); + } + + late final __objc_msgSend_106Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSUInteger, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_106 = __objc_msgSend_106Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, int)>(); + + late final ffi.Pointer _class_NSIndexSet1 = + _getClass1("NSIndexSet"); + late final ffi.Pointer _sel_indexSet1 = _registerName1("indexSet"); + late final ffi.Pointer _sel_indexSetWithIndex_1 = + _registerName1("indexSetWithIndex:"); + instancetype _objc_msgSend_107( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_107( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_107Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_107 = __objc_msgSend_107Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_indexSetWithIndexesInRange_1 = + _registerName1("indexSetWithIndexesInRange:"); + instancetype _objc_msgSend_108( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_108( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_108Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_108 = __objc_msgSend_108Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final ffi.Pointer _sel_initWithIndexesInRange_1 = + _registerName1("initWithIndexesInRange:"); + late final ffi.Pointer _sel_initWithIndexSet_1 = + _registerName1("initWithIndexSet:"); + late final ffi.Pointer _sel_initWithIndex_1 = + _registerName1("initWithIndex:"); + late final ffi.Pointer _sel_isEqualToIndexSet_1 = + _registerName1("isEqualToIndexSet:"); + late final ffi.Pointer _sel_count1 = _registerName1("count"); + late final ffi.Pointer _sel_firstIndex1 = + _registerName1("firstIndex"); + late final ffi.Pointer _sel_lastIndex1 = _registerName1("lastIndex"); + late final ffi.Pointer _sel_indexGreaterThanIndex_1 = + _registerName1("indexGreaterThanIndex:"); + late final ffi.Pointer _sel_indexLessThanIndex_1 = + _registerName1("indexLessThanIndex:"); + late final ffi.Pointer _sel_indexGreaterThanOrEqualToIndex_1 = + _registerName1("indexGreaterThanOrEqualToIndex:"); + late final ffi.Pointer _sel_indexLessThanOrEqualToIndex_1 = + _registerName1("indexLessThanOrEqualToIndex:"); + late final ffi.Pointer _sel_getIndexes_maxCount_inIndexRange_1 = + _registerName1("getIndexes:maxCount:inIndexRange:"); + int _objc_msgSend_109( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexBuffer, + int bufferSize, + NSRangePointer range, + ) { + return __objc_msgSend_109( + obj, + sel, + indexBuffer, + bufferSize, + range, + ); + } + + late final __objc_msgSend_109Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSRangePointer)>>('objc_msgSend'); + late final __objc_msgSend_109 = __objc_msgSend_109Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRangePointer)>(); + + late final ffi.Pointer _sel_countOfIndexesInRange_1 = + _registerName1("countOfIndexesInRange:"); + int _objc_msgSend_110( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_110( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_110Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_110 = __objc_msgSend_110Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final ffi.Pointer _sel_containsIndex_1 = + _registerName1("containsIndex:"); + late final ffi.Pointer _sel_containsIndexesInRange_1 = + _registerName1("containsIndexesInRange:"); + bool _objc_msgSend_111( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_111( + obj, + sel, + range, + ) != + 0; + } + + late final __objc_msgSend_111Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_111 = __objc_msgSend_111Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final ffi.Pointer _sel_containsIndexes_1 = + _registerName1("containsIndexes:"); + late final ffi.Pointer _sel_intersectsIndexesInRange_1 = + _registerName1("intersectsIndexesInRange:"); + late final ffi.Pointer _sel_enumerateIndexesUsingBlock_1 = + _registerName1("enumerateIndexesUsingBlock:"); + late final ffi.Pointer + _sel_enumerateIndexesWithOptions_usingBlock_1 = + _registerName1("enumerateIndexesWithOptions:usingBlock:"); + void _objc_msgSend_112( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer block, + ) { + return __objc_msgSend_112( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_112Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_112 = __objc_msgSend_112Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final ffi.Pointer + _sel_enumerateIndexesInRange_options_usingBlock_1 = + _registerName1("enumerateIndexesInRange:options:usingBlock:"); + void _objc_msgSend_113( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer block, + ) { + return __objc_msgSend_113( + obj, + sel, + range, + opts, + block, + ); + } + + late final __objc_msgSend_113Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_113 = __objc_msgSend_113Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_indexPassingTest_1 = + _registerName1("indexPassingTest:"); + int _objc_msgSend_114( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicate, + ) { + return __objc_msgSend_114( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_114Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_114 = __objc_msgSend_114Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_indexWithOptions_passingTest_1 = + _registerName1("indexWithOptions:passingTest:"); + int _objc_msgSend_115( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer predicate, + ) { + return __objc_msgSend_115( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_115Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_115 = __objc_msgSend_115Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_indexInRange_options_passingTest_1 = + _registerName1("indexInRange:options:passingTest:"); + int _objc_msgSend_116( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer predicate, + ) { + return __objc_msgSend_116( + obj, + sel, + range, + opts, + predicate, + ); + } + + late final __objc_msgSend_116Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_116 = __objc_msgSend_116Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_indexesPassingTest_1 = + _registerName1("indexesPassingTest:"); + ffi.Pointer _objc_msgSend_117( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicate, + ) { + return __objc_msgSend_117( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_117Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_117 = __objc_msgSend_117Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_indexesWithOptions_passingTest_1 = + _registerName1("indexesWithOptions:passingTest:"); + ffi.Pointer _objc_msgSend_118( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer predicate, + ) { + return __objc_msgSend_118( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_118Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_118 = __objc_msgSend_118Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final ffi.Pointer _sel_indexesInRange_options_passingTest_1 = + _registerName1("indexesInRange:options:passingTest:"); + ffi.Pointer _objc_msgSend_119( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer predicate, + ) { + return __objc_msgSend_119( + obj, + sel, + range, + opts, + predicate, + ); + } + + late final __objc_msgSend_119Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_119 = __objc_msgSend_119Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, int, ffi.Pointer)>(); + + late final ffi.Pointer _sel_enumerateRangesUsingBlock_1 = + _registerName1("enumerateRangesUsingBlock:"); + late final ffi.Pointer _sel_enumerateRangesWithOptions_usingBlock_1 = + _registerName1("enumerateRangesWithOptions:usingBlock:"); + late final ffi.Pointer + _sel_enumerateRangesInRange_options_usingBlock_1 = + _registerName1("enumerateRangesInRange:options:usingBlock:"); + late final ffi.Pointer _class_NSMutableIndexSet1 = + _getClass1("NSMutableIndexSet"); + late final ffi.Pointer _sel_addIndexes_1 = + _registerName1("addIndexes:"); + late final ffi.Pointer _sel_removeIndexes_1 = + _registerName1("removeIndexes:"); + late final ffi.Pointer _sel_removeAllIndexes1 = + _registerName1("removeAllIndexes"); + late final ffi.Pointer _sel_addIndex_1 = _registerName1("addIndex:"); + late final ffi.Pointer _sel_removeIndex_1 = + _registerName1("removeIndex:"); + late final ffi.Pointer _sel_addIndexesInRange_1 = + _registerName1("addIndexesInRange:"); + void _objc_msgSend_120( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_120( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_120Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_120 = __objc_msgSend_120Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final ffi.Pointer _sel_removeIndexesInRange_1 = + _registerName1("removeIndexesInRange:"); + late final ffi.Pointer _sel_shiftIndexesStartingAtIndex_by_1 = + _registerName1("shiftIndexesStartingAtIndex:by:"); + void _objc_msgSend_121( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + int delta, + ) { + return __objc_msgSend_121( + obj, + sel, + index, + delta, + ); + } + + late final __objc_msgSend_121Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger, NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_121 = __objc_msgSend_121Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, int)>(); + + late final ffi.Pointer _class_NSOrderedCollectionDifference1 = + _getClass1("NSOrderedCollectionDifference"); + late final ffi.Pointer _sel_initWithChanges_1 = + _registerName1("initWithChanges:"); + late final ffi.Pointer + _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges_1 = + _registerName1( + "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:additionalChanges:"); + instancetype _objc_msgSend_122( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer inserts, + ffi.Pointer insertedObjects, + ffi.Pointer removes, + ffi.Pointer removedObjects, + ffi.Pointer changes, + ) { + return __objc_msgSend_122( + obj, + sel, + inserts, + insertedObjects, + removes, + removedObjects, + changes, + ); + } + + late final __objc_msgSend_122Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_122 = __objc_msgSend_122Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer + _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_1 = + _registerName1( + "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:"); + instancetype _objc_msgSend_123( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer inserts, + ffi.Pointer insertedObjects, + ffi.Pointer removes, + ffi.Pointer removedObjects, + ) { + return __objc_msgSend_123( + obj, + sel, + inserts, + insertedObjects, + removes, + removedObjects, + ); + } + + late final __objc_msgSend_123Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_123 = __objc_msgSend_123Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_insertions1 = + _registerName1("insertions"); + late final ffi.Pointer _sel_removals1 = _registerName1("removals"); + late final ffi.Pointer _sel_hasChanges1 = + _registerName1("hasChanges"); + late final ffi.Pointer _sel_inverseDifference1 = + _registerName1("inverseDifference"); + late final ffi.Pointer _class_NSArray1 = _getClass1("NSArray"); + late final ffi.Pointer _sel_objectAtIndex_1 = + _registerName1("objectAtIndex:"); + late final ffi.Pointer _sel_initWithObjects_count_1 = + _registerName1("initWithObjects:count:"); + instancetype _objc_msgSend_124( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + int cnt, + ) { + return __objc_msgSend_124( + obj, + sel, + objects, + cnt, + ); + } + + late final __objc_msgSend_124Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_124 = __objc_msgSend_124Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, int)>(); + + late final ffi.Pointer _sel_componentsJoinedByString_1 = + _registerName1("componentsJoinedByString:"); + late final ffi.Pointer _sel_containsObject_1 = + _registerName1("containsObject:"); + late final ffi.Pointer _sel_descriptionWithLocale_indent_1 = + _registerName1("descriptionWithLocale:indent:"); + ffi.Pointer _objc_msgSend_125( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer locale, + int level, + ) { + return __objc_msgSend_125( + obj, + sel, + locale, + level, + ); + } + + late final __objc_msgSend_125Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_125 = __objc_msgSend_125Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_firstObjectCommonWithArray_1 = + _registerName1("firstObjectCommonWithArray:"); + late final ffi.Pointer _sel_getObjects_range_1 = + _registerName1("getObjects:range:"); + void _objc_msgSend_126( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + NSRange range, + ) { + return __objc_msgSend_126( + obj, + sel, + objects, + range, + ); + } + + late final __objc_msgSend_126Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_126 = __objc_msgSend_126Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, NSRange)>(); + + late final ffi.Pointer _sel_indexOfObject_1 = + _registerName1("indexOfObject:"); + late final ffi.Pointer _sel_indexOfObject_inRange_1 = + _registerName1("indexOfObject:inRange:"); + int _objc_msgSend_127( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + NSRange range, + ) { + return __objc_msgSend_127( + obj, + sel, + anObject, + range, + ); + } + + late final __objc_msgSend_127Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_127 = __objc_msgSend_127Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>(); + + late final ffi.Pointer _sel_indexOfObjectIdenticalTo_1 = + _registerName1("indexOfObjectIdenticalTo:"); + late final ffi.Pointer _sel_indexOfObjectIdenticalTo_inRange_1 = + _registerName1("indexOfObjectIdenticalTo:inRange:"); + late final ffi.Pointer _sel_isEqualToArray_1 = + _registerName1("isEqualToArray:"); + late final ffi.Pointer _sel_firstObject1 = + _registerName1("firstObject"); + late final ffi.Pointer _sel_lastObject1 = + _registerName1("lastObject"); + late final ffi.Pointer _sel_sortedArrayHint1 = + _registerName1("sortedArrayHint"); + late final ffi.Pointer _sel_writeToURL_error_1 = + _registerName1("writeToURL:error:"); + bool _objc_msgSend_128( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer> error, + ) { + return __objc_msgSend_128( + obj, + sel, + url, + error, + ) != + 0; + } + + late final __objc_msgSend_128Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_128 = __objc_msgSend_128Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final ffi.Pointer _sel_makeObjectsPerformSelector_1 = + _registerName1("makeObjectsPerformSelector:"); + late final ffi.Pointer _sel_makeObjectsPerformSelector_withObject_1 = + _registerName1("makeObjectsPerformSelector:withObject:"); + void _objc_msgSend_129( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer argument, + ) { + return __objc_msgSend_129( + obj, + sel, + aSelector, + argument, + ); + } + + late final __objc_msgSend_129Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_129 = __objc_msgSend_129Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_objectAtIndexedSubscript_1 = + _registerName1("objectAtIndexedSubscript:"); + late final ffi.Pointer _sel_enumerateObjectsUsingBlock_1 = + _registerName1("enumerateObjectsUsingBlock:"); + late final ffi.Pointer + _sel_enumerateObjectsWithOptions_usingBlock_1 = + _registerName1("enumerateObjectsWithOptions:usingBlock:"); + late final ffi.Pointer + _sel_enumerateObjectsAtIndexes_options_usingBlock_1 = + _registerName1("enumerateObjectsAtIndexes:options:usingBlock:"); + void _objc_msgSend_130( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer s, + int opts, + ffi.Pointer block, + ) { + return __objc_msgSend_130( + obj, + sel, + s, + opts, + block, + ); + } + + late final __objc_msgSend_130Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_130 = __objc_msgSend_130Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final ffi.Pointer _sel_indexOfObjectPassingTest_1 = + _registerName1("indexOfObjectPassingTest:"); + late final ffi.Pointer _sel_indexOfObjectWithOptions_passingTest_1 = + _registerName1("indexOfObjectWithOptions:passingTest:"); + late final ffi.Pointer + _sel_indexOfObjectAtIndexes_options_passingTest_1 = + _registerName1("indexOfObjectAtIndexes:options:passingTest:"); + int _objc_msgSend_131( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer s, + int opts, + ffi.Pointer predicate, + ) { + return __objc_msgSend_131( + obj, + sel, + s, + opts, + predicate, + ); + } + + late final __objc_msgSend_131Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_131 = __objc_msgSend_131Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final ffi.Pointer _sel_indexesOfObjectsPassingTest_1 = + _registerName1("indexesOfObjectsPassingTest:"); + late final ffi.Pointer + _sel_indexesOfObjectsWithOptions_passingTest_1 = + _registerName1("indexesOfObjectsWithOptions:passingTest:"); + late final ffi.Pointer + _sel_indexesOfObjectsAtIndexes_options_passingTest_1 = + _registerName1("indexesOfObjectsAtIndexes:options:passingTest:"); + ffi.Pointer _objc_msgSend_132( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer s, + int opts, + ffi.Pointer predicate, + ) { + return __objc_msgSend_132( + obj, + sel, + s, + opts, + predicate, + ); + } + + late final __objc_msgSend_132Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_132 = __objc_msgSend_132Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final ffi.Pointer + _sel_indexOfObject_inSortedRange_options_usingComparator_1 = + _registerName1("indexOfObject:inSortedRange:options:usingComparator:"); + int _objc_msgSend_133( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer obj1, + NSRange r, + int opts, + NSComparator cmp, + ) { + return __objc_msgSend_133( + obj, + sel, + obj1, + r, + opts, + cmp, + ); + } + + late final __objc_msgSend_133Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Int32, + NSComparator)>>('objc_msgSend'); + late final __objc_msgSend_133 = __objc_msgSend_133Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange, int, NSComparator)>(); + + late final ffi.Pointer _sel_array1 = _registerName1("array"); + late final ffi.Pointer _sel_arrayWithObject_1 = + _registerName1("arrayWithObject:"); + late final ffi.Pointer _sel_arrayWithObjects_count_1 = + _registerName1("arrayWithObjects:count:"); + late final ffi.Pointer _sel_arrayWithObjects_1 = + _registerName1("arrayWithObjects:"); + late final ffi.Pointer _sel_arrayWithArray_1 = + _registerName1("arrayWithArray:"); + late final ffi.Pointer _sel_initWithObjects_1 = + _registerName1("initWithObjects:"); + late final ffi.Pointer _sel_initWithArray_1 = + _registerName1("initWithArray:"); + late final ffi.Pointer _sel_initWithArray_copyItems_1 = + _registerName1("initWithArray:copyItems:"); + instancetype _objc_msgSend_134( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer array, + bool flag, + ) { + return __objc_msgSend_134( + obj, + sel, + array, + flag ? 1 : 0, + ); + } + + late final __objc_msgSend_134Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); + late final __objc_msgSend_134 = __objc_msgSend_134Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_getObjects_1 = + _registerName1("getObjects:"); + void _objc_msgSend_135( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + ) { + return __objc_msgSend_135( + obj, + sel, + objects, + ); + } + + late final __objc_msgSend_135Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_135 = __objc_msgSend_135Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>(); + + late final ffi.Pointer _class_NSMutableArray1 = + _getClass1("NSMutableArray"); + late final ffi.Pointer _sel_addObject_1 = + _registerName1("addObject:"); + late final ffi.Pointer _sel_insertObject_atIndex_1 = + _registerName1("insertObject:atIndex:"); + void _objc_msgSend_136( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + int index, + ) { + return __objc_msgSend_136( + obj, + sel, + anObject, + index, + ); + } + + late final __objc_msgSend_136Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_136 = __objc_msgSend_136Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_removeLastObject1 = + _registerName1("removeLastObject"); + late final ffi.Pointer _sel_removeObjectAtIndex_1 = + _registerName1("removeObjectAtIndex:"); + late final ffi.Pointer _sel_replaceObjectAtIndex_withObject_1 = + _registerName1("replaceObjectAtIndex:withObject:"); + void _objc_msgSend_137( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer anObject, + ) { + return __objc_msgSend_137( + obj, + sel, + index, + anObject, + ); + } + + late final __objc_msgSend_137Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_137 = __objc_msgSend_137Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_initWithCapacity_1 = + _registerName1("initWithCapacity:"); + late final ffi.Pointer _sel_addObjectsFromArray_1 = + _registerName1("addObjectsFromArray:"); + late final ffi.Pointer + _sel_exchangeObjectAtIndex_withObjectAtIndex_1 = + _registerName1("exchangeObjectAtIndex:withObjectAtIndex:"); + void _objc_msgSend_138( + ffi.Pointer obj, + ffi.Pointer sel, + int idx1, + int idx2, + ) { + return __objc_msgSend_138( + obj, + sel, + idx1, + idx2, + ); + } + + late final __objc_msgSend_138Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_138 = __objc_msgSend_138Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, int)>(); + + late final ffi.Pointer _sel_removeAllObjects1 = + _registerName1("removeAllObjects"); + late final ffi.Pointer _sel_removeObject_inRange_1 = + _registerName1("removeObject:inRange:"); + void _objc_msgSend_139( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + NSRange range, + ) { + return __objc_msgSend_139( + obj, + sel, + anObject, + range, + ); + } + + late final __objc_msgSend_139Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_139 = __objc_msgSend_139Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>(); + + late final ffi.Pointer _sel_removeObject_1 = + _registerName1("removeObject:"); + late final ffi.Pointer _sel_removeObjectIdenticalTo_inRange_1 = + _registerName1("removeObjectIdenticalTo:inRange:"); + late final ffi.Pointer _sel_removeObjectIdenticalTo_1 = + _registerName1("removeObjectIdenticalTo:"); + late final ffi.Pointer _sel_removeObjectsFromIndices_numIndices_1 = + _registerName1("removeObjectsFromIndices:numIndices:"); + void _objc_msgSend_140( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indices, + int cnt, + ) { + return __objc_msgSend_140( + obj, + sel, + indices, + cnt, + ); + } + + late final __objc_msgSend_140Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_140 = __objc_msgSend_140Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_removeObjectsInArray_1 = + _registerName1("removeObjectsInArray:"); + late final ffi.Pointer _sel_removeObjectsInRange_1 = + _registerName1("removeObjectsInRange:"); + late final ffi.Pointer + _sel_replaceObjectsInRange_withObjectsFromArray_range_1 = + _registerName1("replaceObjectsInRange:withObjectsFromArray:range:"); + void _objc_msgSend_141( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer otherArray, + NSRange otherRange, + ) { + return __objc_msgSend_141( + obj, + sel, + range, + otherArray, + otherRange, + ); + } + + late final __objc_msgSend_141Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_141 = __objc_msgSend_141Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, + ffi.Pointer, NSRange)>(); + + late final ffi.Pointer + _sel_replaceObjectsInRange_withObjectsFromArray_1 = + _registerName1("replaceObjectsInRange:withObjectsFromArray:"); + void _objc_msgSend_142( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer otherArray, + ) { + return __objc_msgSend_142( + obj, + sel, + range, + otherArray, + ); + } + + late final __objc_msgSend_142Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_142 = __objc_msgSend_142Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_setArray_1 = _registerName1("setArray:"); + late final ffi.Pointer _sel_sortUsingFunction_context_1 = + _registerName1("sortUsingFunction:context:"); + void _objc_msgSend_143( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + compare, + ffi.Pointer context, + ) { + return __objc_msgSend_143( + obj, + sel, + compare, + context, + ); + } + + late final __objc_msgSend_143Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_143 = __objc_msgSend_143Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_sortUsingSelector_1 = + _registerName1("sortUsingSelector:"); + late final ffi.Pointer _sel_insertObjects_atIndexes_1 = + _registerName1("insertObjects:atIndexes:"); + void _objc_msgSend_144( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer objects, + ffi.Pointer indexes, + ) { + return __objc_msgSend_144( + obj, + sel, + objects, + indexes, + ); + } + + late final __objc_msgSend_144Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_144 = __objc_msgSend_144Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_removeObjectsAtIndexes_1 = + _registerName1("removeObjectsAtIndexes:"); + late final ffi.Pointer _sel_replaceObjectsAtIndexes_withObjects_1 = + _registerName1("replaceObjectsAtIndexes:withObjects:"); + late final ffi.Pointer _sel_setObject_atIndexedSubscript_1 = + _registerName1("setObject:atIndexedSubscript:"); + late final ffi.Pointer _sel_sortUsingComparator_1 = + _registerName1("sortUsingComparator:"); + late final ffi.Pointer _sel_sortWithOptions_usingComparator_1 = + _registerName1("sortWithOptions:usingComparator:"); + void _objc_msgSend_145( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + NSComparator cmptr, + ) { + return __objc_msgSend_145( + obj, + sel, + opts, + cmptr, + ); + } + + late final __objc_msgSend_145Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, NSComparator)>>('objc_msgSend'); + late final __objc_msgSend_145 = __objc_msgSend_145Ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, int, NSComparator)>(); + + late final ffi.Pointer _sel_arrayWithCapacity_1 = + _registerName1("arrayWithCapacity:"); + late final ffi.Pointer _sel_applyDifference_1 = + _registerName1("applyDifference:"); + late final ffi.Pointer _class_NSItemProvider1 = + _getClass1("NSItemProvider"); + late final ffi.Pointer + _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1 = + _registerName1( + "registerDataRepresentationForTypeIdentifier:visibility:loadHandler:"); + void _objc_msgSend_146( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + int visibility, + ffi.Pointer loadHandler, + ) { + return __objc_msgSend_146( + obj, + sel, + typeIdentifier, + visibility, + loadHandler, + ); + } + + late final __objc_msgSend_146Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_146 = __objc_msgSend_146Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final ffi.Pointer + _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1 = + _registerName1( + "registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:"); + void _objc_msgSend_147( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + int fileOptions, + int visibility, + ffi.Pointer loadHandler, + ) { + return __objc_msgSend_147( + obj, + sel, + typeIdentifier, + fileOptions, + visibility, + loadHandler, + ); + } + + late final __objc_msgSend_147Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_147 = __objc_msgSend_147Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer)>(); + + late final ffi.Pointer _sel_registeredTypeIdentifiers1 = + _registerName1("registeredTypeIdentifiers"); + late final ffi.Pointer _sel_hasItemConformingToTypeIdentifier_1 = + _registerName1("hasItemConformingToTypeIdentifier:"); + late final ffi.Pointer + _sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1 = + _registerName1( + "hasRepresentationConformingToTypeIdentifier:fileOptions:"); + bool _objc_msgSend_148( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + int fileOptions, + ) { + return __objc_msgSend_148( + obj, + sel, + typeIdentifier, + fileOptions, + ) != + 0; + } + + late final __objc_msgSend_148Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_148 = __objc_msgSend_148Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final ffi.Pointer _class_NSProgress1 = + _getClass1("NSProgress"); + late final ffi.Pointer + _sel_loadDataRepresentationForTypeIdentifier_completionHandler_1 = + _registerName1( + "loadDataRepresentationForTypeIdentifier:completionHandler:"); + ffi.Pointer _objc_msgSend_149( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer completionHandler, + ) { + return __objc_msgSend_149( + obj, + sel, + typeIdentifier, + completionHandler, + ); + } + + late final __objc_msgSend_149Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_149 = __objc_msgSend_149Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer + _sel_loadFileRepresentationForTypeIdentifier_completionHandler_1 = + _registerName1( + "loadFileRepresentationForTypeIdentifier:completionHandler:"); + late final ffi.Pointer + _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1 = + _registerName1( + "loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:"); + late final ffi.Pointer _sel_suggestedName1 = + _registerName1("suggestedName"); + late final ffi.Pointer _sel_setSuggestedName_1 = + _registerName1("setSuggestedName:"); + late final ffi.Pointer _sel_initWithObject_1 = + _registerName1("initWithObject:"); + late final ffi.Pointer _sel_registerObject_visibility_1 = + _registerName1("registerObject:visibility:"); + void _objc_msgSend_150( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer object, + int visibility, + ) { + return __objc_msgSend_150( + obj, + sel, + object, + visibility, + ); + } + + late final __objc_msgSend_150Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_150 = __objc_msgSend_150Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final ffi.Pointer + _sel_registerObjectOfClass_visibility_loadHandler_1 = + _registerName1("registerObjectOfClass:visibility:loadHandler:"); + late final ffi.Pointer _sel_canLoadObjectOfClass_1 = + _registerName1("canLoadObjectOfClass:"); + late final ffi.Pointer _sel_loadObjectOfClass_completionHandler_1 = + _registerName1("loadObjectOfClass:completionHandler:"); + late final ffi.Pointer _sel_initWithItem_typeIdentifier_1 = + _registerName1("initWithItem:typeIdentifier:"); + late final ffi.Pointer + _sel_registerItemForTypeIdentifier_loadHandler_1 = + _registerName1("registerItemForTypeIdentifier:loadHandler:"); + late final ffi.Pointer + _sel_loadItemForTypeIdentifier_options_completionHandler_1 = + _registerName1("loadItemForTypeIdentifier:options:completionHandler:"); + void _objc_msgSend_151( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer options, + NSItemProviderCompletionHandler completionHandler, + ) { + return __objc_msgSend_151( + obj, + sel, + typeIdentifier, + options, + completionHandler, + ); + } + + late final __objc_msgSend_151Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler)>>('objc_msgSend'); + late final __objc_msgSend_151 = __objc_msgSend_151Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler)>(); + + late final ffi.Pointer _sel_previewImageHandler1 = + _registerName1("previewImageHandler"); + late final ffi.Pointer _sel_setPreviewImageHandler_1 = + _registerName1("setPreviewImageHandler:"); + late final ffi.Pointer + _sel_loadPreviewImageWithOptions_completionHandler_1 = + _registerName1("loadPreviewImageWithOptions:completionHandler:"); + late final ffi.Pointer> + _NSItemProviderPreferredImageSizeKey = + _lookup>('NSItemProviderPreferredImageSizeKey'); + + ffi.Pointer get NSItemProviderPreferredImageSizeKey => + _NSItemProviderPreferredImageSizeKey.value; + + set NSItemProviderPreferredImageSizeKey(ffi.Pointer value) => + _NSItemProviderPreferredImageSizeKey.value = value; + + late final ffi.Pointer> + _NSExtensionJavaScriptPreprocessingResultsKey = + _lookup>( + 'NSExtensionJavaScriptPreprocessingResultsKey'); + + ffi.Pointer get NSExtensionJavaScriptPreprocessingResultsKey => + _NSExtensionJavaScriptPreprocessingResultsKey.value; + + set NSExtensionJavaScriptPreprocessingResultsKey( + ffi.Pointer value) => + _NSExtensionJavaScriptPreprocessingResultsKey.value = value; + + late final ffi.Pointer> + _NSExtensionJavaScriptFinalizeArgumentKey = + _lookup>( + 'NSExtensionJavaScriptFinalizeArgumentKey'); + + ffi.Pointer get NSExtensionJavaScriptFinalizeArgumentKey => + _NSExtensionJavaScriptFinalizeArgumentKey.value; + + set NSExtensionJavaScriptFinalizeArgumentKey(ffi.Pointer value) => + _NSExtensionJavaScriptFinalizeArgumentKey.value = value; + + late final ffi.Pointer> _NSItemProviderErrorDomain = + _lookup>('NSItemProviderErrorDomain'); + + ffi.Pointer get NSItemProviderErrorDomain => + _NSItemProviderErrorDomain.value; + + set NSItemProviderErrorDomain(ffi.Pointer value) => + _NSItemProviderErrorDomain.value = value; + + late final ffi.Pointer _NSStringTransformLatinToKatakana = + _lookup('NSStringTransformLatinToKatakana'); + + NSStringTransform get NSStringTransformLatinToKatakana => + _NSStringTransformLatinToKatakana.value; + + set NSStringTransformLatinToKatakana(NSStringTransform value) => + _NSStringTransformLatinToKatakana.value = value; + + late final ffi.Pointer _NSStringTransformLatinToHiragana = + _lookup('NSStringTransformLatinToHiragana'); + + NSStringTransform get NSStringTransformLatinToHiragana => + _NSStringTransformLatinToHiragana.value; + + set NSStringTransformLatinToHiragana(NSStringTransform value) => + _NSStringTransformLatinToHiragana.value = value; + + late final ffi.Pointer _NSStringTransformLatinToHangul = + _lookup('NSStringTransformLatinToHangul'); + + NSStringTransform get NSStringTransformLatinToHangul => + _NSStringTransformLatinToHangul.value; + + set NSStringTransformLatinToHangul(NSStringTransform value) => + _NSStringTransformLatinToHangul.value = value; + + late final ffi.Pointer _NSStringTransformLatinToArabic = + _lookup('NSStringTransformLatinToArabic'); + + NSStringTransform get NSStringTransformLatinToArabic => + _NSStringTransformLatinToArabic.value; + + set NSStringTransformLatinToArabic(NSStringTransform value) => + _NSStringTransformLatinToArabic.value = value; + + late final ffi.Pointer _NSStringTransformLatinToHebrew = + _lookup('NSStringTransformLatinToHebrew'); + + NSStringTransform get NSStringTransformLatinToHebrew => + _NSStringTransformLatinToHebrew.value; + + set NSStringTransformLatinToHebrew(NSStringTransform value) => + _NSStringTransformLatinToHebrew.value = value; + + late final ffi.Pointer _NSStringTransformLatinToThai = + _lookup('NSStringTransformLatinToThai'); + + NSStringTransform get NSStringTransformLatinToThai => + _NSStringTransformLatinToThai.value; + + set NSStringTransformLatinToThai(NSStringTransform value) => + _NSStringTransformLatinToThai.value = value; + + late final ffi.Pointer _NSStringTransformLatinToCyrillic = + _lookup('NSStringTransformLatinToCyrillic'); + + NSStringTransform get NSStringTransformLatinToCyrillic => + _NSStringTransformLatinToCyrillic.value; + + set NSStringTransformLatinToCyrillic(NSStringTransform value) => + _NSStringTransformLatinToCyrillic.value = value; + + late final ffi.Pointer _NSStringTransformLatinToGreek = + _lookup('NSStringTransformLatinToGreek'); + + NSStringTransform get NSStringTransformLatinToGreek => + _NSStringTransformLatinToGreek.value; + + set NSStringTransformLatinToGreek(NSStringTransform value) => + _NSStringTransformLatinToGreek.value = value; + + late final ffi.Pointer _NSStringTransformToLatin = + _lookup('NSStringTransformToLatin'); + + NSStringTransform get NSStringTransformToLatin => + _NSStringTransformToLatin.value; + + set NSStringTransformToLatin(NSStringTransform value) => + _NSStringTransformToLatin.value = value; + + late final ffi.Pointer _NSStringTransformMandarinToLatin = + _lookup('NSStringTransformMandarinToLatin'); + + NSStringTransform get NSStringTransformMandarinToLatin => + _NSStringTransformMandarinToLatin.value; + + set NSStringTransformMandarinToLatin(NSStringTransform value) => + _NSStringTransformMandarinToLatin.value = value; + + late final ffi.Pointer + _NSStringTransformHiraganaToKatakana = + _lookup('NSStringTransformHiraganaToKatakana'); + + NSStringTransform get NSStringTransformHiraganaToKatakana => + _NSStringTransformHiraganaToKatakana.value; + + set NSStringTransformHiraganaToKatakana(NSStringTransform value) => + _NSStringTransformHiraganaToKatakana.value = value; + + late final ffi.Pointer + _NSStringTransformFullwidthToHalfwidth = + _lookup('NSStringTransformFullwidthToHalfwidth'); + + NSStringTransform get NSStringTransformFullwidthToHalfwidth => + _NSStringTransformFullwidthToHalfwidth.value; + + set NSStringTransformFullwidthToHalfwidth(NSStringTransform value) => + _NSStringTransformFullwidthToHalfwidth.value = value; + + late final ffi.Pointer _NSStringTransformToXMLHex = + _lookup('NSStringTransformToXMLHex'); + + NSStringTransform get NSStringTransformToXMLHex => + _NSStringTransformToXMLHex.value; + + set NSStringTransformToXMLHex(NSStringTransform value) => + _NSStringTransformToXMLHex.value = value; + + late final ffi.Pointer _NSStringTransformToUnicodeName = + _lookup('NSStringTransformToUnicodeName'); + + NSStringTransform get NSStringTransformToUnicodeName => + _NSStringTransformToUnicodeName.value; + + set NSStringTransformToUnicodeName(NSStringTransform value) => + _NSStringTransformToUnicodeName.value = value; + + late final ffi.Pointer + _NSStringTransformStripCombiningMarks = + _lookup('NSStringTransformStripCombiningMarks'); + + NSStringTransform get NSStringTransformStripCombiningMarks => + _NSStringTransformStripCombiningMarks.value; + + set NSStringTransformStripCombiningMarks(NSStringTransform value) => + _NSStringTransformStripCombiningMarks.value = value; + + late final ffi.Pointer _NSStringTransformStripDiacritics = + _lookup('NSStringTransformStripDiacritics'); + + NSStringTransform get NSStringTransformStripDiacritics => + _NSStringTransformStripDiacritics.value; + + set NSStringTransformStripDiacritics(NSStringTransform value) => + _NSStringTransformStripDiacritics.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionSuggestedEncodingsKey = + _lookup( + 'NSStringEncodingDetectionSuggestedEncodingsKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionSuggestedEncodingsKey => + _NSStringEncodingDetectionSuggestedEncodingsKey.value; + + set NSStringEncodingDetectionSuggestedEncodingsKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionSuggestedEncodingsKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionDisallowedEncodingsKey = + _lookup( + 'NSStringEncodingDetectionDisallowedEncodingsKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionDisallowedEncodingsKey => + _NSStringEncodingDetectionDisallowedEncodingsKey.value; + + set NSStringEncodingDetectionDisallowedEncodingsKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionDisallowedEncodingsKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey = + _lookup( + 'NSStringEncodingDetectionUseOnlySuggestedEncodingsKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionUseOnlySuggestedEncodingsKey => + _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value; + + set NSStringEncodingDetectionUseOnlySuggestedEncodingsKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionAllowLossyKey = + _lookup( + 'NSStringEncodingDetectionAllowLossyKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionAllowLossyKey => + _NSStringEncodingDetectionAllowLossyKey.value; + + set NSStringEncodingDetectionAllowLossyKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionAllowLossyKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionFromWindowsKey = + _lookup( + 'NSStringEncodingDetectionFromWindowsKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionFromWindowsKey => + _NSStringEncodingDetectionFromWindowsKey.value; + + set NSStringEncodingDetectionFromWindowsKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionFromWindowsKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionLossySubstitutionKey = + _lookup( + 'NSStringEncodingDetectionLossySubstitutionKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionLossySubstitutionKey => + _NSStringEncodingDetectionLossySubstitutionKey.value; + + set NSStringEncodingDetectionLossySubstitutionKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionLossySubstitutionKey.value = value; + + late final ffi.Pointer + _NSStringEncodingDetectionLikelyLanguageKey = + _lookup( + 'NSStringEncodingDetectionLikelyLanguageKey'); + + NSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionLikelyLanguageKey => + _NSStringEncodingDetectionLikelyLanguageKey.value; + + set NSStringEncodingDetectionLikelyLanguageKey( + NSStringEncodingDetectionOptionsKey value) => + _NSStringEncodingDetectionLikelyLanguageKey.value = value; + + late final ffi.Pointer _class_NSMutableString1 = + _getClass1("NSMutableString"); + late final ffi.Pointer _sel_replaceCharactersInRange_withString_1 = + _registerName1("replaceCharactersInRange:withString:"); + late final ffi.Pointer _sel_insertString_atIndex_1 = + _registerName1("insertString:atIndex:"); + late final ffi.Pointer _sel_deleteCharactersInRange_1 = + _registerName1("deleteCharactersInRange:"); + late final ffi.Pointer _sel_appendString_1 = + _registerName1("appendString:"); + late final ffi.Pointer _sel_appendFormat_1 = + _registerName1("appendFormat:"); + late final ffi.Pointer _sel_setString_1 = + _registerName1("setString:"); + late final ffi.Pointer + _sel_replaceOccurrencesOfString_withString_options_range_1 = + _registerName1("replaceOccurrencesOfString:withString:options:range:"); + int _objc_msgSend_152( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer target, + ffi.Pointer replacement, + int options, + NSRange searchRange, + ) { + return __objc_msgSend_152( + obj, + sel, + target, + replacement, + options, + searchRange, + ); + } + + late final __objc_msgSend_152Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_152 = __objc_msgSend_152Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, NSRange)>(); + + late final ffi.Pointer + _sel_applyTransform_reverse_range_updatedRange_1 = + _registerName1("applyTransform:reverse:range:updatedRange:"); + bool _objc_msgSend_153( + ffi.Pointer obj, + ffi.Pointer sel, + NSStringTransform transform, + bool reverse, + NSRange range, + NSRangePointer resultingRange, + ) { + return __objc_msgSend_153( + obj, + sel, + transform, + reverse ? 1 : 0, + range, + resultingRange, + ) != + 0; + } + + late final __objc_msgSend_153Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function( + ffi.Pointer, + ffi.Pointer, + NSStringTransform, + ffi.Uint8, + NSRange, + NSRangePointer)>>('objc_msgSend'); + late final __objc_msgSend_153 = __objc_msgSend_153Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + NSStringTransform, int, NSRange, NSRangePointer)>(); + + ffi.Pointer _objc_msgSend_154( + ffi.Pointer obj, + ffi.Pointer sel, + int capacity, + ) { + return __objc_msgSend_154( + obj, + sel, + capacity, + ); + } + + late final __objc_msgSend_154Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_154 = __objc_msgSend_154Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_stringWithCapacity_1 = + _registerName1("stringWithCapacity:"); + late final ffi.Pointer _NSCharacterConversionException = + _lookup('NSCharacterConversionException'); + + NSExceptionName get NSCharacterConversionException => + _NSCharacterConversionException.value; + + set NSCharacterConversionException(NSExceptionName value) => + _NSCharacterConversionException.value = value; + + late final ffi.Pointer _NSParseErrorException = + _lookup('NSParseErrorException'); + + NSExceptionName get NSParseErrorException => _NSParseErrorException.value; + + set NSParseErrorException(NSExceptionName value) => + _NSParseErrorException.value = value; + + late final ffi.Pointer _class_NSSimpleCString1 = + _getClass1("NSSimpleCString"); + late final ffi.Pointer _class_NSConstantString1 = + _getClass1("NSConstantString"); + late final ffi.Pointer _class_StringUtil1 = + _getClass1("StringUtil"); + late final ffi.Pointer _sel_strConcat_with_1 = + _registerName1("strConcat:with:"); +} + +abstract class NSComparisonResult { + static const int NSOrderedAscending = -1; + static const int NSOrderedSame = 0; + static const int NSOrderedDescending = 1; +} + +abstract class NSEnumerationOptions { + static const int NSEnumerationConcurrent = 1; + static const int NSEnumerationReverse = 2; +} + +abstract class NSSortOptions { + static const int NSSortConcurrent = 1; + static const int NSSortStable = 16; +} + +abstract class NSQualityOfService { + static const int NSQualityOfServiceUserInteractive = 33; + static const int NSQualityOfServiceUserInitiated = 25; + static const int NSQualityOfServiceUtility = 17; + static const int NSQualityOfServiceBackground = 9; + static const int NSQualityOfServiceDefault = -1; +} + +typedef NSInteger = pkg_ffi.Long; + +class __CFString extends ffi.Opaque {} + +abstract class CFComparisonResult { + static const int kCFCompareLessThan = -1; + static const int kCFCompareEqualTo = 0; + static const int kCFCompareGreaterThan = 1; +} + +typedef CFIndex = pkg_ffi.Long; + +class CFRange extends ffi.Struct { + @CFIndex() + external int location; + + @CFIndex() + external int length; +} + +class __CFNull extends ffi.Opaque {} + +typedef CFNullRef = ffi.Pointer<__CFNull>; + +class __CFAllocator extends ffi.Opaque {} + +typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; + +class CFAllocatorContext extends ffi.Struct { + @CFIndex() + external int version; + + external ffi.Pointer info; + + external CFAllocatorRetainCallBack retain; + + external CFAllocatorReleaseCallBack release; + + external CFAllocatorCopyDescriptionCallBack copyDescription; + + external CFAllocatorAllocateCallBack allocate; + + external CFAllocatorReallocateCallBack reallocate; + + external CFAllocatorDeallocateCallBack deallocate; + + external CFAllocatorPreferredSizeCallBack preferredSize; +} + +typedef CFAllocatorRetainCallBack = ffi.Pointer< + ffi.NativeFunction Function(ffi.Pointer)>>; +typedef CFAllocatorReleaseCallBack + = ffi.Pointer)>>; +typedef CFAllocatorCopyDescriptionCallBack = ffi + .Pointer)>>; +typedef CFStringRef = ffi.Pointer<__CFString>; +typedef CFAllocatorAllocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + CFIndex, CFOptionFlags, ffi.Pointer)>>; +typedef CFOptionFlags = pkg_ffi.UnsignedLong; +typedef CFAllocatorReallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, CFIndex, + CFOptionFlags, ffi.Pointer)>>; +typedef CFAllocatorDeallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; +typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< + ffi.NativeFunction< + CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; + +class _ObjCWrapper { + final ffi.Pointer _id; + final StringTestObjCLibrary _lib; + + _ObjCWrapper._(this._id, this._lib); + + @override + bool operator ==(Object other) { + return other is _ObjCWrapper && _id == other._id; + } + + @override + int get hashCode => _id.hashCode; +} + +class NSObject extends _ObjCWrapper { + NSObject._(ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); + + static NSObject castFrom(T other) { + return NSObject._(other._id, other._lib); + } + + static NSObject castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return NSObject._(other, lib); + } + + static void load(StringTestObjCLibrary _lib) { + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); + } + + static void initialize(StringTestObjCLibrary _lib) { + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); + } + + NSObject init() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); + return NSObject._(_ret, _lib); + } + + static NSObject new1(StringTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); + return NSObject._(_ret, _lib); + } + + static NSObject allocWithZone( + StringTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static NSObject alloc(StringTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); + return NSObject._(_ret, _lib); + } + + void dealloc() { + _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); + } + + void finalize() { + _lib._objc_msgSend_0(_id, _lib._sel_finalize1); + } + + NSObject copy() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); + return NSObject._(_ret, _lib); + } + + NSObject mutableCopy() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); + return NSObject._(_ret, _lib); + } + + static NSObject copyWithZone( + StringTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static NSObject mutableCopyWithZone( + StringTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static bool instancesRespondToSelector( + StringTestObjCLibrary _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_3(_lib._class_NSObject1, + _lib._sel_instancesRespondToSelector_1, aSelector); + } + + static bool conformsToProtocol( + StringTestObjCLibrary _lib, NSObject? protocol) { + return _lib._objc_msgSend_4(_lib._class_NSObject1, + _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); + } + + IMP methodForSelector(ffi.Pointer aSelector) { + return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); + } + + static IMP instanceMethodForSelector( + StringTestObjCLibrary _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_5(_lib._class_NSObject1, + _lib._sel_instanceMethodForSelector_1, aSelector); + } + + void doesNotRecognizeSelector(ffi.Pointer aSelector) { + _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); + } + + NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_7( + _id, _lib._sel_forwardingTargetForSelector_1, aSelector); + return NSObject._(_ret, _lib); + } + + void forwardInvocation(NSObject? anInvocation) { + _lib._objc_msgSend_8( + _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); + } + + NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_9( + _id, _lib._sel_methodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static NSMethodSignature instanceMethodSignatureForSelector( + StringTestObjCLibrary _lib, ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, + _lib._sel_instanceMethodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib); + } - late final ffi.Pointer _NSStringTransformLatinToKatakana = - _lookup('NSStringTransformLatinToKatakana'); + bool allowsWeakReference() { + return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); + } - NSStringTransform get NSStringTransformLatinToKatakana => - _NSStringTransformLatinToKatakana.value; + bool retainWeakReference() { + return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); + } - set NSStringTransformLatinToKatakana(NSStringTransform value) => - _NSStringTransformLatinToKatakana.value = value; + static bool isSubclassOfClass(StringTestObjCLibrary _lib, NSObject aClass) { + return _lib._objc_msgSend_4( + _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); + } - late final ffi.Pointer _NSStringTransformLatinToHiragana = - _lookup('NSStringTransformLatinToHiragana'); + static bool resolveClassMethod( + StringTestObjCLibrary _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); + } - NSStringTransform get NSStringTransformLatinToHiragana => - _NSStringTransformLatinToHiragana.value; + static bool resolveInstanceMethod( + StringTestObjCLibrary _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); + } - set NSStringTransformLatinToHiragana(NSStringTransform value) => - _NSStringTransformLatinToHiragana.value = value; + static int hash(StringTestObjCLibrary _lib) { + return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); + } - late final ffi.Pointer _NSStringTransformLatinToHangul = - _lookup('NSStringTransformLatinToHangul'); + static NSObject superclass(StringTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); + return NSObject._(_ret, _lib); + } - NSStringTransform get NSStringTransformLatinToHangul => - _NSStringTransformLatinToHangul.value; + static NSObject class1(StringTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); + return NSObject._(_ret, _lib); + } - set NSStringTransformLatinToHangul(NSStringTransform value) => - _NSStringTransformLatinToHangul.value = value; + static NSString description(StringTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_74(_lib._class_NSObject1, _lib._sel_description1); + return NSString._(_ret, _lib); + } - late final ffi.Pointer _NSStringTransformLatinToArabic = - _lookup('NSStringTransformLatinToArabic'); + static NSString debugDescription(StringTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_74( + _lib._class_NSObject1, _lib._sel_debugDescription1); + return NSString._(_ret, _lib); + } - NSStringTransform get NSStringTransformLatinToArabic => - _NSStringTransformLatinToArabic.value; + static int version(StringTestObjCLibrary _lib) { + return _lib._objc_msgSend_32(_lib._class_NSObject1, _lib._sel_version1); + } - set NSStringTransformLatinToArabic(NSStringTransform value) => - _NSStringTransformLatinToArabic.value = value; + static void setVersion(StringTestObjCLibrary _lib, int aVersion) { + _lib._objc_msgSend_75( + _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); + } - late final ffi.Pointer _NSStringTransformLatinToHebrew = - _lookup('NSStringTransformLatinToHebrew'); + NSObject get classForCoder { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); + return NSObject._(_ret, _lib); + } - NSStringTransform get NSStringTransformLatinToHebrew => - _NSStringTransformLatinToHebrew.value; + NSObject replacementObjectForCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } - set NSStringTransformLatinToHebrew(NSStringTransform value) => - _NSStringTransformLatinToHebrew.value = value; + NSObject awakeAfterUsingCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } - late final ffi.Pointer _NSStringTransformLatinToThai = - _lookup('NSStringTransformLatinToThai'); + static void poseAsClass(StringTestObjCLibrary _lib, NSObject aClass) { + _lib._objc_msgSend_8( + _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); + } - NSStringTransform get NSStringTransformLatinToThai => - _NSStringTransformLatinToThai.value; + NSObject get autoContentAccessingProxy { + final _ret = + _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); + return NSObject._(_ret, _lib); + } +} - set NSStringTransformLatinToThai(NSStringTransform value) => - _NSStringTransformLatinToThai.value = value; +class ObjCSel extends ffi.Opaque {} - late final ffi.Pointer _NSStringTransformLatinToCyrillic = - _lookup('NSStringTransformLatinToCyrillic'); +class ObjCObject extends ffi.Opaque {} - NSStringTransform get NSStringTransformLatinToCyrillic => - _NSStringTransformLatinToCyrillic.value; +typedef instancetype = ffi.Pointer; - set NSStringTransformLatinToCyrillic(NSStringTransform value) => - _NSStringTransformLatinToCyrillic.value = value; +class _NSZone extends ffi.Opaque {} - late final ffi.Pointer _NSStringTransformLatinToGreek = - _lookup('NSStringTransformLatinToGreek'); +typedef IMP = ffi.Pointer>; - NSStringTransform get NSStringTransformLatinToGreek => - _NSStringTransformLatinToGreek.value; +class NSMethodSignature extends _ObjCWrapper { + NSMethodSignature._(ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); - set NSStringTransformLatinToGreek(NSStringTransform value) => - _NSStringTransformLatinToGreek.value = value; + static NSMethodSignature castFrom(T other) { + return NSMethodSignature._(other._id, other._lib); + } - late final ffi.Pointer _NSStringTransformToLatin = - _lookup('NSStringTransformToLatin'); + static NSMethodSignature castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return NSMethodSignature._(other, lib); + } +} - NSStringTransform get NSStringTransformToLatin => - _NSStringTransformToLatin.value; +typedef NSUInteger = pkg_ffi.UnsignedLong; - set NSStringTransformToLatin(NSStringTransform value) => - _NSStringTransformToLatin.value = value; +class NSString extends NSObject { + NSString._(ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); - late final ffi.Pointer _NSStringTransformMandarinToLatin = - _lookup('NSStringTransformMandarinToLatin'); + static NSString castFrom(T other) { + return NSString._(other._id, other._lib); + } - NSStringTransform get NSStringTransformMandarinToLatin => - _NSStringTransformMandarinToLatin.value; + static NSString castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return NSString._(other, lib); + } - set NSStringTransformMandarinToLatin(NSStringTransform value) => - _NSStringTransformMandarinToLatin.value = value; + factory NSString(StringTestObjCLibrary _lib, String str) { + final cstr = str.toNativeUtf8(); + final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + pkg_ffi.calloc.free(cstr); + return nsstr; + } - late final ffi.Pointer - _NSStringTransformHiraganaToKatakana = - _lookup('NSStringTransformHiraganaToKatakana'); + @override + String toString() => (UTF8String).cast().toDartString(); - NSStringTransform get NSStringTransformHiraganaToKatakana => - _NSStringTransformHiraganaToKatakana.value; + int get length { + return _lib._objc_msgSend_11(_id, _lib._sel_length1); + } - set NSStringTransformHiraganaToKatakana(NSStringTransform value) => - _NSStringTransformHiraganaToKatakana.value = value; + int characterAtIndex(int index) { + return _lib._objc_msgSend_12(_id, _lib._sel_characterAtIndex_1, index); + } - late final ffi.Pointer - _NSStringTransformFullwidthToHalfwidth = - _lookup('NSStringTransformFullwidthToHalfwidth'); + @override + NSString init() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); + return NSString._(_ret, _lib); + } - NSStringTransform get NSStringTransformFullwidthToHalfwidth => - _NSStringTransformFullwidthToHalfwidth.value; + NSString initWithCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } - set NSStringTransformFullwidthToHalfwidth(NSStringTransform value) => - _NSStringTransformFullwidthToHalfwidth.value = value; + NSString substringFromIndex(int from) { + final _ret = + _lib._objc_msgSend_14(_id, _lib._sel_substringFromIndex_1, from); + return NSString._(_ret, _lib); + } - late final ffi.Pointer _NSStringTransformToXMLHex = - _lookup('NSStringTransformToXMLHex'); + NSString substringToIndex(int to) { + final _ret = _lib._objc_msgSend_14(_id, _lib._sel_substringToIndex_1, to); + return NSString._(_ret, _lib); + } - NSStringTransform get NSStringTransformToXMLHex => - _NSStringTransformToXMLHex.value; + NSString substringWithRange(NSRange range) { + final _ret = + _lib._objc_msgSend_15(_id, _lib._sel_substringWithRange_1, range); + return NSString._(_ret, _lib); + } - set NSStringTransformToXMLHex(NSStringTransform value) => - _NSStringTransformToXMLHex.value = value; + void getCharacters_range(ffi.Pointer buffer, NSRange range) { + _lib._objc_msgSend_16(_id, _lib._sel_getCharacters_range_1, buffer, range); + } - late final ffi.Pointer _NSStringTransformToUnicodeName = - _lookup('NSStringTransformToUnicodeName'); + int compare(NSObject? string) { + return _lib._objc_msgSend_17( + _id, _lib._sel_compare_1, string?._id ?? ffi.nullptr); + } - NSStringTransform get NSStringTransformToUnicodeName => - _NSStringTransformToUnicodeName.value; + int compare_options(NSObject? string, int mask) { + return _lib._objc_msgSend_18( + _id, _lib._sel_compare_options_1, string?._id ?? ffi.nullptr, mask); + } - set NSStringTransformToUnicodeName(NSStringTransform value) => - _NSStringTransformToUnicodeName.value = value; + int compare_options_range( + NSObject? string, int mask, NSRange rangeOfReceiverToCompare) { + return _lib._objc_msgSend_19(_id, _lib._sel_compare_options_range_1, + string?._id ?? ffi.nullptr, mask, rangeOfReceiverToCompare); + } - late final ffi.Pointer - _NSStringTransformStripCombiningMarks = - _lookup('NSStringTransformStripCombiningMarks'); + int compare_options_range_locale(NSObject? string, int mask, + NSRange rangeOfReceiverToCompare, NSObject locale) { + return _lib._objc_msgSend_20(_id, _lib._sel_compare_options_range_locale_1, + string?._id ?? ffi.nullptr, mask, rangeOfReceiverToCompare, locale._id); + } - NSStringTransform get NSStringTransformStripCombiningMarks => - _NSStringTransformStripCombiningMarks.value; + int caseInsensitiveCompare(NSObject? string) { + return _lib._objc_msgSend_17( + _id, _lib._sel_caseInsensitiveCompare_1, string?._id ?? ffi.nullptr); + } - set NSStringTransformStripCombiningMarks(NSStringTransform value) => - _NSStringTransformStripCombiningMarks.value = value; + int localizedCompare(NSObject? string) { + return _lib._objc_msgSend_17( + _id, _lib._sel_localizedCompare_1, string?._id ?? ffi.nullptr); + } + + int localizedCaseInsensitiveCompare(NSObject? string) { + return _lib._objc_msgSend_17( + _id, + _lib._sel_localizedCaseInsensitiveCompare_1, + string?._id ?? ffi.nullptr); + } + + int localizedStandardCompare(NSObject? string) { + return _lib._objc_msgSend_17( + _id, _lib._sel_localizedStandardCompare_1, string?._id ?? ffi.nullptr); + } + + bool isEqualToString(NSObject? aString) { + return _lib._objc_msgSend_4( + _id, _lib._sel_isEqualToString_1, aString?._id ?? ffi.nullptr); + } + + bool hasPrefix(NSObject? str) { + return _lib._objc_msgSend_4( + _id, _lib._sel_hasPrefix_1, str?._id ?? ffi.nullptr); + } + + bool hasSuffix(NSObject? str) { + return _lib._objc_msgSend_4( + _id, _lib._sel_hasSuffix_1, str?._id ?? ffi.nullptr); + } + + NSString commonPrefixWithString_options(NSObject? str, int mask) { + final _ret = _lib._objc_msgSend_21( + _id, + _lib._sel_commonPrefixWithString_options_1, + str?._id ?? ffi.nullptr, + mask); + return NSString._(_ret, _lib); + } + + bool containsString(NSObject? str) { + return _lib._objc_msgSend_4( + _id, _lib._sel_containsString_1, str?._id ?? ffi.nullptr); + } + + bool localizedCaseInsensitiveContainsString(NSObject? str) { + return _lib._objc_msgSend_4( + _id, + _lib._sel_localizedCaseInsensitiveContainsString_1, + str?._id ?? ffi.nullptr); + } + + bool localizedStandardContainsString(NSObject? str) { + return _lib._objc_msgSend_4(_id, + _lib._sel_localizedStandardContainsString_1, str?._id ?? ffi.nullptr); + } + + NSRange localizedStandardRangeOfString(NSObject? str) { + return _lib._objc_msgSend_22(_id, + _lib._sel_localizedStandardRangeOfString_1, str?._id ?? ffi.nullptr); + } + + NSRange rangeOfString(NSObject? searchString) { + return _lib._objc_msgSend_22( + _id, _lib._sel_rangeOfString_1, searchString?._id ?? ffi.nullptr); + } + + NSRange rangeOfString_options(NSObject? searchString, int mask) { + return _lib._objc_msgSend_23(_id, _lib._sel_rangeOfString_options_1, + searchString?._id ?? ffi.nullptr, mask); + } + + NSRange rangeOfString_options_range( + NSObject? searchString, int mask, NSRange rangeOfReceiverToSearch) { + return _lib._objc_msgSend_24(_id, _lib._sel_rangeOfString_options_range_1, + searchString?._id ?? ffi.nullptr, mask, rangeOfReceiverToSearch); + } + + NSRange rangeOfString_options_range_locale(NSObject? searchString, int mask, + NSRange rangeOfReceiverToSearch, NSObject? locale) { + return _lib._objc_msgSend_25( + _id, + _lib._sel_rangeOfString_options_range_locale_1, + searchString?._id ?? ffi.nullptr, + mask, + rangeOfReceiverToSearch, + locale?._id ?? ffi.nullptr); + } - late final ffi.Pointer _NSStringTransformStripDiacritics = - _lookup('NSStringTransformStripDiacritics'); + NSRange rangeOfCharacterFromSet(NSObject? searchSet) { + return _lib._objc_msgSend_22(_id, _lib._sel_rangeOfCharacterFromSet_1, + searchSet?._id ?? ffi.nullptr); + } - NSStringTransform get NSStringTransformStripDiacritics => - _NSStringTransformStripDiacritics.value; + NSRange rangeOfCharacterFromSet_options(NSObject? searchSet, int mask) { + return _lib._objc_msgSend_23( + _id, + _lib._sel_rangeOfCharacterFromSet_options_1, + searchSet?._id ?? ffi.nullptr, + mask); + } - set NSStringTransformStripDiacritics(NSStringTransform value) => - _NSStringTransformStripDiacritics.value = value; + NSRange rangeOfCharacterFromSet_options_range( + NSObject? searchSet, int mask, NSRange rangeOfReceiverToSearch) { + return _lib._objc_msgSend_24( + _id, + _lib._sel_rangeOfCharacterFromSet_options_range_1, + searchSet?._id ?? ffi.nullptr, + mask, + rangeOfReceiverToSearch); + } - late final ffi.Pointer - _NSStringEncodingDetectionSuggestedEncodingsKey = - _lookup( - 'NSStringEncodingDetectionSuggestedEncodingsKey'); + NSRange rangeOfComposedCharacterSequenceAtIndex(int index) { + return _lib._objc_msgSend_26( + _id, _lib._sel_rangeOfComposedCharacterSequenceAtIndex_1, index); + } - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionSuggestedEncodingsKey => - _NSStringEncodingDetectionSuggestedEncodingsKey.value; + NSRange rangeOfComposedCharacterSequencesForRange(NSRange range) { + return _lib._objc_msgSend_27( + _id, _lib._sel_rangeOfComposedCharacterSequencesForRange_1, range); + } - set NSStringEncodingDetectionSuggestedEncodingsKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionSuggestedEncodingsKey.value = value; + NSString stringByAppendingString(NSObject? aString) { + final _ret = _lib._objc_msgSend_28( + _id, _lib._sel_stringByAppendingString_1, aString?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } - late final ffi.Pointer - _NSStringEncodingDetectionDisallowedEncodingsKey = - _lookup( - 'NSStringEncodingDetectionDisallowedEncodingsKey'); + NSString stringByAppendingFormat(NSObject? format) { + final _ret = _lib._objc_msgSend_28( + _id, _lib._sel_stringByAppendingFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionDisallowedEncodingsKey => - _NSStringEncodingDetectionDisallowedEncodingsKey.value; + double get doubleValue { + return _lib._objc_msgSend_29(_id, _lib._sel_doubleValue1); + } - set NSStringEncodingDetectionDisallowedEncodingsKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionDisallowedEncodingsKey.value = value; + double get floatValue { + return _lib._objc_msgSend_30(_id, _lib._sel_floatValue1); + } - late final ffi.Pointer - _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey = - _lookup( - 'NSStringEncodingDetectionUseOnlySuggestedEncodingsKey'); + int get intValue { + return _lib._objc_msgSend_31(_id, _lib._sel_intValue1); + } - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionUseOnlySuggestedEncodingsKey => - _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value; + int get integerValue { + return _lib._objc_msgSend_32(_id, _lib._sel_integerValue1); + } - set NSStringEncodingDetectionUseOnlySuggestedEncodingsKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value = value; + int get longLongValue { + return _lib._objc_msgSend_33(_id, _lib._sel_longLongValue1); + } - late final ffi.Pointer - _NSStringEncodingDetectionAllowLossyKey = - _lookup( - 'NSStringEncodingDetectionAllowLossyKey'); + bool get boolValue { + return _lib._objc_msgSend_10(_id, _lib._sel_boolValue1); + } - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionAllowLossyKey => - _NSStringEncodingDetectionAllowLossyKey.value; + NSObject? get uppercaseString { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_uppercaseString1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } - set NSStringEncodingDetectionAllowLossyKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionAllowLossyKey.value = value; + NSObject? get lowercaseString { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_lowercaseString1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } - late final ffi.Pointer - _NSStringEncodingDetectionFromWindowsKey = - _lookup( - 'NSStringEncodingDetectionFromWindowsKey'); + NSObject? get capitalizedString { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_capitalizedString1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionFromWindowsKey => - _NSStringEncodingDetectionFromWindowsKey.value; + NSObject? get localizedUppercaseString { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_localizedUppercaseString1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } - set NSStringEncodingDetectionFromWindowsKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionFromWindowsKey.value = value; + NSObject? get localizedLowercaseString { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_localizedLowercaseString1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } - late final ffi.Pointer - _NSStringEncodingDetectionLossySubstitutionKey = - _lookup( - 'NSStringEncodingDetectionLossySubstitutionKey'); + NSObject? get localizedCapitalizedString { + final _ret = + _lib._objc_msgSend_1(_id, _lib._sel_localizedCapitalizedString1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionLossySubstitutionKey => - _NSStringEncodingDetectionLossySubstitutionKey.value; + NSString uppercaseStringWithLocale(NSObject? locale) { + final _ret = _lib._objc_msgSend_28( + _id, _lib._sel_uppercaseStringWithLocale_1, locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } - set NSStringEncodingDetectionLossySubstitutionKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionLossySubstitutionKey.value = value; + NSString lowercaseStringWithLocale(NSObject? locale) { + final _ret = _lib._objc_msgSend_28( + _id, _lib._sel_lowercaseStringWithLocale_1, locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } - late final ffi.Pointer - _NSStringEncodingDetectionLikelyLanguageKey = - _lookup( - 'NSStringEncodingDetectionLikelyLanguageKey'); + NSString capitalizedStringWithLocale(NSObject? locale) { + final _ret = _lib._objc_msgSend_28(_id, + _lib._sel_capitalizedStringWithLocale_1, locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionLikelyLanguageKey => - _NSStringEncodingDetectionLikelyLanguageKey.value; + void getLineStart_end_contentsEnd_forRange( + ffi.Pointer startPtr, + ffi.Pointer lineEndPtr, + ffi.Pointer contentsEndPtr, + NSRange range) { + _lib._objc_msgSend_34( + _id, + _lib._sel_getLineStart_end_contentsEnd_forRange_1, + startPtr, + lineEndPtr, + contentsEndPtr, + range); + } - set NSStringEncodingDetectionLikelyLanguageKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionLikelyLanguageKey.value = value; + NSRange lineRangeForRange(NSRange range) { + return _lib._objc_msgSend_27(_id, _lib._sel_lineRangeForRange_1, range); + } - late final ffi.Pointer _class_NSMutableString1 = - _getClass1("NSMutableString"); - late final ffi.Pointer _sel_replaceCharactersInRange_withString_1 = - _registerName1("replaceCharactersInRange:withString:"); - void _objc_msgSend_79( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ffi.Pointer aString, - ) { - return __objc_msgSend_79( - obj, - sel, - range, - aString, - ); + void getParagraphStart_end_contentsEnd_forRange( + ffi.Pointer startPtr, + ffi.Pointer parEndPtr, + ffi.Pointer contentsEndPtr, + NSRange range) { + _lib._objc_msgSend_34( + _id, + _lib._sel_getParagraphStart_end_contentsEnd_forRange_1, + startPtr, + parEndPtr, + contentsEndPtr, + range); } - late final __objc_msgSend_79Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_79 = __objc_msgSend_79Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, - ffi.Pointer)>(); + NSRange paragraphRangeForRange(NSRange range) { + return _lib._objc_msgSend_27( + _id, _lib._sel_paragraphRangeForRange_1, range); + } - late final ffi.Pointer _NSCharacterConversionException = - _lookup('NSCharacterConversionException'); + void enumerateSubstringsInRange_options_usingBlock( + NSRange range, int opts, NSObject block) { + _lib._objc_msgSend_35( + _id, + _lib._sel_enumerateSubstringsInRange_options_usingBlock_1, + range, + opts, + block._id); + } - NSExceptionName get NSCharacterConversionException => - _NSCharacterConversionException.value; + void enumerateLinesUsingBlock(NSObject block) { + _lib._objc_msgSend_8(_id, _lib._sel_enumerateLinesUsingBlock_1, block._id); + } - set NSCharacterConversionException(NSExceptionName value) => - _NSCharacterConversionException.value = value; + ffi.Pointer get UTF8String { + return _lib._objc_msgSend_36(_id, _lib._sel_UTF8String1); + } - late final ffi.Pointer _NSParseErrorException = - _lookup('NSParseErrorException'); + int get fastestEncoding { + return _lib._objc_msgSend_11(_id, _lib._sel_fastestEncoding1); + } - NSExceptionName get NSParseErrorException => _NSParseErrorException.value; + int get smallestEncoding { + return _lib._objc_msgSend_11(_id, _lib._sel_smallestEncoding1); + } - set NSParseErrorException(NSExceptionName value) => - _NSParseErrorException.value = value; + NSData dataUsingEncoding_allowLossyConversion(int encoding, bool lossy) { + final _ret = _lib._objc_msgSend_37(_id, + _lib._sel_dataUsingEncoding_allowLossyConversion_1, encoding, lossy); + return NSData._(_ret, _lib); + } - late final ffi.Pointer _class_NSSimpleCString1 = - _getClass1("NSSimpleCString"); - late final ffi.Pointer _class_NSConstantString1 = - _getClass1("NSConstantString"); - late final ffi.Pointer _class_StringUtil1 = - _getClass1("StringUtil"); - late final ffi.Pointer _sel_strConcat_with_1 = - _registerName1("strConcat:with:"); - ffi.Pointer _objc_msgSend_80( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer a, - ffi.Pointer b, - ) { - return __objc_msgSend_80( - obj, - sel, - a, - b, - ); + NSData dataUsingEncoding(int encoding) { + final _ret = + _lib._objc_msgSend_38(_id, _lib._sel_dataUsingEncoding_1, encoding); + return NSData._(_ret, _lib); } - late final __objc_msgSend_80Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -} + bool canBeConvertedToEncoding(int encoding) { + return _lib._objc_msgSend_39( + _id, _lib._sel_canBeConvertedToEncoding_1, encoding); + } -abstract class NSComparisonResult { - static const int NSOrderedAscending = -1; - static const int NSOrderedSame = 0; - static const int NSOrderedDescending = 1; -} + void cStringUsingEncoding(int encoding) { + _lib._objc_msgSend_40(_id, _lib._sel_cStringUsingEncoding_1, encoding); + } -abstract class NSEnumerationOptions { - static const int NSEnumerationConcurrent = 1; - static const int NSEnumerationReverse = 2; -} + bool getCString_maxLength_encoding( + ffi.Pointer buffer, int maxBufferCount, int encoding) { + return _lib._objc_msgSend_41(_id, _lib._sel_getCString_maxLength_encoding_1, + buffer, maxBufferCount, encoding); + } -abstract class NSSortOptions { - static const int NSSortConcurrent = 1; - static const int NSSortStable = 16; -} + bool getBytes_maxLength_usedLength_encoding_options_range_remainingRange( + ffi.Pointer buffer, + int maxBufferCount, + ffi.Pointer usedBufferCount, + int encoding, + int options, + NSRange range, + NSRangePointer leftover) { + return _lib._objc_msgSend_42( + _id, + _lib._sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_1, + buffer, + maxBufferCount, + usedBufferCount, + encoding, + options, + range, + leftover); + } -abstract class NSQualityOfService { - static const int NSQualityOfServiceUserInteractive = 33; - static const int NSQualityOfServiceUserInitiated = 25; - static const int NSQualityOfServiceUtility = 17; - static const int NSQualityOfServiceBackground = 9; - static const int NSQualityOfServiceDefault = -1; -} + int maximumLengthOfBytesUsingEncoding(int enc) { + return _lib._objc_msgSend_43( + _id, _lib._sel_maximumLengthOfBytesUsingEncoding_1, enc); + } -typedef NSInteger = pkg_ffi.Long; + int lengthOfBytesUsingEncoding(int enc) { + return _lib._objc_msgSend_43( + _id, _lib._sel_lengthOfBytesUsingEncoding_1, enc); + } -class __CFString extends ffi.Opaque {} + static ffi.Pointer getAvailableStringEncodings( + StringTestObjCLibrary _lib) { + return _lib._objc_msgSend_44( + _lib._class_NSString1, _lib._sel_availableStringEncodings1); + } -abstract class CFComparisonResult { - static const int kCFCompareLessThan = -1; - static const int kCFCompareEqualTo = 0; - static const int kCFCompareGreaterThan = 1; -} + static NSString localizedNameOfStringEncoding( + StringTestObjCLibrary _lib, int encoding) { + final _ret = _lib._objc_msgSend_14(_lib._class_NSString1, + _lib._sel_localizedNameOfStringEncoding_1, encoding); + return NSString._(_ret, _lib); + } -typedef CFIndex = pkg_ffi.Long; + static int getDefaultCStringEncoding(StringTestObjCLibrary _lib) { + return _lib._objc_msgSend_11( + _lib._class_NSString1, _lib._sel_defaultCStringEncoding1); + } -class CFRange extends ffi.Struct { - @CFIndex() - external int location; + NSObject? get decomposedStringWithCanonicalMapping { + final _ret = _lib._objc_msgSend_1( + _id, _lib._sel_decomposedStringWithCanonicalMapping1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } - @CFIndex() - external int length; -} + NSObject? get precomposedStringWithCanonicalMapping { + final _ret = _lib._objc_msgSend_1( + _id, _lib._sel_precomposedStringWithCanonicalMapping1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } -class __CFNull extends ffi.Opaque {} + NSObject? get decomposedStringWithCompatibilityMapping { + final _ret = _lib._objc_msgSend_1( + _id, _lib._sel_decomposedStringWithCompatibilityMapping1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } -typedef CFNullRef = ffi.Pointer<__CFNull>; + NSObject? get precomposedStringWithCompatibilityMapping { + final _ret = _lib._objc_msgSend_1( + _id, _lib._sel_precomposedStringWithCompatibilityMapping1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } -class __CFAllocator extends ffi.Opaque {} + NSString stringByTrimmingCharactersInSet(NSObject? set) { + final _ret = _lib._objc_msgSend_28(_id, + _lib._sel_stringByTrimmingCharactersInSet_1, set?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } -typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; + NSString stringByPaddingToLength_withString_startingAtIndex( + int newLength, NSObject? padString, int padIndex) { + final _ret = _lib._objc_msgSend_45( + _id, + _lib._sel_stringByPaddingToLength_withString_startingAtIndex_1, + newLength, + padString?._id ?? ffi.nullptr, + padIndex); + return NSString._(_ret, _lib); + } -class CFAllocatorContext extends ffi.Struct { - @CFIndex() - external int version; + NSString stringByFoldingWithOptions_locale(int options, NSObject? locale) { + final _ret = _lib._objc_msgSend_46( + _id, + _lib._sel_stringByFoldingWithOptions_locale_1, + options, + locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } - external ffi.Pointer info; + NSString stringByReplacingOccurrencesOfString_withString_options_range( + NSObject? target, + NSObject? replacement, + int options, + NSRange searchRange) { + final _ret = _lib._objc_msgSend_47( + _id, + _lib._sel_stringByReplacingOccurrencesOfString_withString_options_range_1, + target?._id ?? ffi.nullptr, + replacement?._id ?? ffi.nullptr, + options, + searchRange); + return NSString._(_ret, _lib); + } - external CFAllocatorRetainCallBack retain; + NSString stringByReplacingOccurrencesOfString_withString( + NSObject? target, NSObject? replacement) { + final _ret = _lib._objc_msgSend_48( + _id, + _lib._sel_stringByReplacingOccurrencesOfString_withString_1, + target?._id ?? ffi.nullptr, + replacement?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } - external CFAllocatorReleaseCallBack release; + NSString stringByReplacingCharactersInRange_withString( + NSRange range, NSObject? replacement) { + final _ret = _lib._objc_msgSend_49( + _id, + _lib._sel_stringByReplacingCharactersInRange_withString_1, + range, + replacement?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } - external CFAllocatorCopyDescriptionCallBack copyDescription; + NSString stringByApplyingTransform_reverse( + NSStringTransform transform, bool reverse) { + final _ret = _lib._objc_msgSend_50( + _id, _lib._sel_stringByApplyingTransform_reverse_1, transform, reverse); + return NSString._(_ret, _lib); + } - external CFAllocatorAllocateCallBack allocate; + bool writeToURL_atomically_encoding_error( + NSObject? url, + bool useAuxiliaryFile, + int enc, + ffi.Pointer> error) { + return _lib._objc_msgSend_51( + _id, + _lib._sel_writeToURL_atomically_encoding_error_1, + url?._id ?? ffi.nullptr, + useAuxiliaryFile, + enc, + error); + } + + bool writeToFile_atomically_encoding_error( + NSObject? path, + bool useAuxiliaryFile, + int enc, + ffi.Pointer> error) { + return _lib._objc_msgSend_51( + _id, + _lib._sel_writeToFile_atomically_encoding_error_1, + path?._id ?? ffi.nullptr, + useAuxiliaryFile, + enc, + error); + } - external CFAllocatorReallocateCallBack reallocate; + NSObject? get description { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_description1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } - external CFAllocatorDeallocateCallBack deallocate; + int get hash { + return _lib._objc_msgSend_11(_id, _lib._sel_hash1); + } - external CFAllocatorPreferredSizeCallBack preferredSize; -} + NSString initWithCharactersNoCopy_length_freeWhenDone( + ffi.Pointer characters, int length, bool freeBuffer) { + final _ret = _lib._objc_msgSend_52( + _id, + _lib._sel_initWithCharactersNoCopy_length_freeWhenDone_1, + characters, + length, + freeBuffer); + return NSString._(_ret, _lib); + } -typedef CFAllocatorRetainCallBack = ffi.Pointer< - ffi.NativeFunction Function(ffi.Pointer)>>; -typedef CFAllocatorReleaseCallBack - = ffi.Pointer)>>; -typedef CFAllocatorCopyDescriptionCallBack = ffi - .Pointer)>>; -typedef CFStringRef = ffi.Pointer<__CFString>; -typedef CFAllocatorAllocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - CFIndex, CFOptionFlags, ffi.Pointer)>>; -typedef CFOptionFlags = pkg_ffi.UnsignedLong; -typedef CFAllocatorReallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, CFIndex, - CFOptionFlags, ffi.Pointer)>>; -typedef CFAllocatorDeallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; -typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< - ffi.NativeFunction< - CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; + NSString initWithCharactersNoCopy_length_deallocator( + ffi.Pointer chars, int len, NSObject deallocator) { + final _ret = _lib._objc_msgSend_53( + _id, + _lib._sel_initWithCharactersNoCopy_length_deallocator_1, + chars, + len, + deallocator._id); + return NSString._(_ret, _lib); + } -class _ObjCWrapper { - final ffi.Pointer _id; - final StringTestObjCLibrary _lib; + NSString initWithCharacters_length( + ffi.Pointer characters, int length) { + final _ret = _lib._objc_msgSend_54( + _id, _lib._sel_initWithCharacters_length_1, characters, length); + return NSString._(_ret, _lib); + } - _ObjCWrapper._(this._id, this._lib); + NSString initWithUTF8String(ffi.Pointer nullTerminatedCString) { + final _ret = _lib._objc_msgSend_55( + _id, _lib._sel_initWithUTF8String_1, nullTerminatedCString); + return NSString._(_ret, _lib); + } - @override - bool operator ==(Object other) { - return other is _ObjCWrapper && _id == other._id; + NSString initWithString(NSObject? aString) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithString_1, aString?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); } - @override - int get hashCode => _id.hashCode; -} + NSString initWithFormat(NSObject? format) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } -class NSValue extends NSObject { - NSValue._(ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); + NSString initWithFormat_arguments( + NSObject? format, ffi.Pointer<__va_list_tag> argList) { + final _ret = _lib._objc_msgSend_56( + _id, + _lib._sel_initWithFormat_arguments_1, + format?._id ?? ffi.nullptr, + argList); + return NSString._(_ret, _lib); + } - static NSValue castFrom(T other) { - return NSValue._(other._id, other._lib); + NSString initWithFormat_locale(NSObject? format, NSObject locale) { + final _ret = _lib._objc_msgSend_57(_id, _lib._sel_initWithFormat_locale_1, + format?._id ?? ffi.nullptr, locale._id); + return NSString._(_ret, _lib); } - static NSValue castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return NSValue._(other, lib); + NSString initWithFormat_locale_arguments( + NSObject? format, NSObject locale, ffi.Pointer<__va_list_tag> argList) { + final _ret = _lib._objc_msgSend_58( + _id, + _lib._sel_initWithFormat_locale_arguments_1, + format?._id ?? ffi.nullptr, + locale._id, + argList); + return NSString._(_ret, _lib); } - void getValue_size(ffi.Pointer value, int size) { - _lib._objc_msgSend_17(_id, _lib._sel_getValue_size_1, value, size); + NSString initWithData_encoding(NSObject? data, int encoding) { + final _ret = _lib._objc_msgSend_59(_id, _lib._sel_initWithData_encoding_1, + data?._id ?? ffi.nullptr, encoding); + return NSString._(_ret, _lib); } - ffi.Pointer get objCType { - return _lib._objc_msgSend_15(_id, _lib._sel_objCType1); + NSString initWithBytes_length_encoding( + ffi.Pointer bytes, int len, int encoding) { + final _ret = _lib._objc_msgSend_60( + _id, _lib._sel_initWithBytes_length_encoding_1, bytes, len, encoding); + return NSString._(_ret, _lib); } - NSValue initWithBytes_objCType( - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_18( - _id, _lib._sel_initWithBytes_objCType_1, value, type); - return NSValue._(_ret, _lib); + NSString initWithBytesNoCopy_length_encoding_freeWhenDone( + ffi.Pointer bytes, int len, int encoding, bool freeBuffer) { + final _ret = _lib._objc_msgSend_61( + _id, + _lib._sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1, + bytes, + len, + encoding, + freeBuffer); + return NSString._(_ret, _lib); } - NSValue initWithCoder(NSObject? coder) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); - return NSValue._(_ret, _lib); + NSString initWithBytesNoCopy_length_encoding_deallocator( + ffi.Pointer bytes, + int len, + int encoding, + NSObject deallocator) { + final _ret = _lib._objc_msgSend_62( + _id, + _lib._sel_initWithBytesNoCopy_length_encoding_deallocator_1, + bytes, + len, + encoding, + deallocator._id); + return NSString._(_ret, _lib); } - static NSValue new1(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSValue1, _lib._sel_new1); - return NSValue._(_ret, _lib); + static NSString string(StringTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSString1, _lib._sel_string1); + return NSString._(_ret, _lib); } - static NSValue alloc(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSValue1, _lib._sel_alloc1); - return NSValue._(_ret, _lib); + static NSString stringWithString( + StringTestObjCLibrary _lib, NSObject? string) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, + _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); } -} -class ObjCSel extends ffi.Opaque {} + static NSString stringWithCharacters_length( + StringTestObjCLibrary _lib, ffi.Pointer characters, int length) { + final _ret = _lib._objc_msgSend_54(_lib._class_NSString1, + _lib._sel_stringWithCharacters_length_1, characters, length); + return NSString._(_ret, _lib); + } -class ObjCObject extends ffi.Opaque {} + static NSString stringWithUTF8String(StringTestObjCLibrary _lib, + ffi.Pointer nullTerminatedCString) { + final _ret = _lib._objc_msgSend_55(_lib._class_NSString1, + _lib._sel_stringWithUTF8String_1, nullTerminatedCString); + return NSString._(_ret, _lib); + } -class NSObject extends _ObjCWrapper { - NSObject._(ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); + static NSString stringWithFormat( + StringTestObjCLibrary _lib, NSObject? format) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, + _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } - static NSObject castFrom(T other) { - return NSObject._(other._id, other._lib); + static NSString localizedStringWithFormat( + StringTestObjCLibrary _lib, NSObject? format) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, + _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); } - static NSObject castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return NSObject._(other, lib); + NSString initWithCString_encoding( + ffi.Pointer nullTerminatedCString, int encoding) { + final _ret = _lib._objc_msgSend_63(_id, + _lib._sel_initWithCString_encoding_1, nullTerminatedCString, encoding); + return NSString._(_ret, _lib); } - static void load(StringTestObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); + static NSString stringWithCString_encoding( + StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { + final _ret = _lib._objc_msgSend_63(_lib._class_NSString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); + return NSString._(_ret, _lib); } - static void initialize(StringTestObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); + NSString initWithContentsOfURL_encoding_error( + NSObject? url, int enc, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_initWithContentsOfURL_encoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib); } - NSObject init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSObject._(_ret, _lib); + NSString initWithContentsOfFile_encoding_error( + NSObject? path, int enc, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_initWithContentsOfFile_encoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib); } - static NSObject new1(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); - return NSObject._(_ret, _lib); + static NSString stringWithContentsOfURL_encoding_error( + StringTestObjCLibrary _lib, + NSObject? url, + int enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_64( + _lib._class_NSString1, + _lib._sel_stringWithContentsOfURL_encoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib); } - static NSObject allocWithZone( - StringTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); - return NSObject._(_ret, _lib); + static NSString stringWithContentsOfFile_encoding_error( + StringTestObjCLibrary _lib, + NSObject? path, + int enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_64( + _lib._class_NSString1, + _lib._sel_stringWithContentsOfFile_encoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib); } - static NSObject alloc(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); - return NSObject._(_ret, _lib); + NSString initWithContentsOfURL_usedEncoding_error( + NSObject? url, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_65( + _id, + _lib._sel_initWithContentsOfURL_usedEncoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib); } - void dealloc() { - _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); + NSString initWithContentsOfFile_usedEncoding_error( + NSObject? path, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_65( + _id, + _lib._sel_initWithContentsOfFile_usedEncoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib); } - void finalize() { - _lib._objc_msgSend_0(_id, _lib._sel_finalize1); + static NSString stringWithContentsOfURL_usedEncoding_error( + StringTestObjCLibrary _lib, + NSObject? url, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_65( + _lib._class_NSString1, + _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib); } - NSObject copy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); - return NSObject._(_ret, _lib); + static NSString stringWithContentsOfFile_usedEncoding_error( + StringTestObjCLibrary _lib, + NSObject? path, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_65( + _lib._class_NSString1, + _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib); } - NSObject mutableCopy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); + static int + stringEncodingForData_encodingOptions_convertedString_usedLossyConversion( + StringTestObjCLibrary _lib, + NSObject? data, + NSObject? opts, + ffi.Pointer> string, + ffi.Pointer usedLossyConversion) { + return _lib._objc_msgSend_66( + _lib._class_NSString1, + _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, + data?._id ?? ffi.nullptr, + opts?._id ?? ffi.nullptr, + string, + usedLossyConversion); + } + + NSObject propertyList() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_propertyList1); return NSObject._(_ret, _lib); } - static NSObject copyWithZone( - StringTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); - return NSObject._(_ret, _lib); + NSDictionary propertyListFromStringsFileFormat() { + final _ret = _lib._objc_msgSend_67( + _id, _lib._sel_propertyListFromStringsFileFormat1); + return NSDictionary._(_ret, _lib); } - static NSObject mutableCopyWithZone( - StringTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); - return NSObject._(_ret, _lib); + void cString() { + _lib._objc_msgSend_0(_id, _lib._sel_cString1); } - static bool instancesRespondToSelector( - StringTestObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_3(_lib._class_NSObject1, - _lib._sel_instancesRespondToSelector_1, aSelector); + void lossyCString() { + _lib._objc_msgSend_0(_id, _lib._sel_lossyCString1); } - static bool conformsToProtocol( - StringTestObjCLibrary _lib, NSObject? protocol) { - return _lib._objc_msgSend_4(_lib._class_NSObject1, - _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); + int cStringLength() { + return _lib._objc_msgSend_11(_id, _lib._sel_cStringLength1); } - IMP methodForSelector(ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); + void getCString(ffi.Pointer bytes) { + _lib._objc_msgSend_68(_id, _lib._sel_getCString_1, bytes); } - static IMP instanceMethodForSelector( - StringTestObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_lib._class_NSObject1, - _lib._sel_instanceMethodForSelector_1, aSelector); + void getCString_maxLength(ffi.Pointer bytes, int maxLength) { + _lib._objc_msgSend_69( + _id, _lib._sel_getCString_maxLength_1, bytes, maxLength); } - void doesNotRecognizeSelector(ffi.Pointer aSelector) { - _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); + void getCString_maxLength_range_remainingRange( + ffi.Pointer bytes, + int maxLength, + NSRange aRange, + NSRangePointer leftoverRange) { + _lib._objc_msgSend_70( + _id, + _lib._sel_getCString_maxLength_range_remainingRange_1, + bytes, + maxLength, + aRange, + leftoverRange); } - NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_7( - _id, _lib._sel_forwardingTargetForSelector_1, aSelector); - return NSObject._(_ret, _lib); + bool writeToFile_atomically(NSObject? path, bool useAuxiliaryFile) { + return _lib._objc_msgSend_71(_id, _lib._sel_writeToFile_atomically_1, + path?._id ?? ffi.nullptr, useAuxiliaryFile); } - void forwardInvocation(NSObject? anInvocation) { - _lib._objc_msgSend_8( - _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); + bool writeToURL_atomically(NSObject? url, bool atomically) { + return _lib._objc_msgSend_71(_id, _lib._sel_writeToURL_atomically_1, + url?._id ?? ffi.nullptr, atomically); } - NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9( - _id, _lib._sel_methodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); + NSObject initWithContentsOfFile(NSObject? path) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); } - static NSMethodSignature instanceMethodSignatureForSelector( - StringTestObjCLibrary _lib, ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, - _lib._sel_instanceMethodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); + NSObject initWithContentsOfURL(NSObject? url) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); } - bool allowsWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); + static NSObject stringWithContentsOfFile( + StringTestObjCLibrary _lib, NSObject? path) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, + _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); } - bool retainWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); + static NSObject stringWithContentsOfURL( + StringTestObjCLibrary _lib, NSObject? url) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, + _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); } - static bool isSubclassOfClass(StringTestObjCLibrary _lib, NSObject aClass) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); + NSObject initWithCStringNoCopy_length_freeWhenDone( + ffi.Pointer bytes, int length, bool freeBuffer) { + final _ret = _lib._objc_msgSend_72( + _id, + _lib._sel_initWithCStringNoCopy_length_freeWhenDone_1, + bytes, + length, + freeBuffer); + return NSObject._(_ret, _lib); } - static bool resolveClassMethod( - StringTestObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); + NSObject initWithCString_length(ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_63( + _id, _lib._sel_initWithCString_length_1, bytes, length); + return NSObject._(_ret, _lib); } - static bool resolveInstanceMethod( - StringTestObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); + NSObject initWithCString(ffi.Pointer bytes) { + final _ret = _lib._objc_msgSend_55(_id, _lib._sel_initWithCString_1, bytes); + return NSObject._(_ret, _lib); } - static int hash(StringTestObjCLibrary _lib) { - return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); + static NSObject stringWithCString_length( + StringTestObjCLibrary _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_63(_lib._class_NSString1, + _lib._sel_stringWithCString_length_1, bytes, length); + return NSObject._(_ret, _lib); } - static NSObject superclass(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); + static NSObject stringWithCString( + StringTestObjCLibrary _lib, ffi.Pointer bytes) { + final _ret = _lib._objc_msgSend_55( + _lib._class_NSString1, _lib._sel_stringWithCString_1, bytes); return NSObject._(_ret, _lib); } - static NSObject class1(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); - return NSObject._(_ret, _lib); + void getCharacters(ffi.Pointer buffer) { + _lib._objc_msgSend_73(_id, _lib._sel_getCharacters_1, buffer); } - static NSString description(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_16(_lib._class_NSObject1, _lib._sel_description1); + static NSString new1(StringTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSString1, _lib._sel_new1); return NSString._(_ret, _lib); } - static NSString debugDescription(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_16( - _lib._class_NSObject1, _lib._sel_debugDescription1); + static NSString alloc(StringTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSString1, _lib._sel_alloc1); return NSString._(_ret, _lib); } } -typedef instancetype = ffi.Pointer; +extension StringToNSString on String { + NSString toNSString(StringTestObjCLibrary lib) => NSString(lib, this); +} -class _NSZone extends ffi.Opaque {} +typedef unichar = pkg_ffi.UnsignedShort; +typedef NSRange = _NSRange; -typedef IMP = ffi.Pointer>; +class _NSRange extends ffi.Struct { + @NSUInteger() + external int location; -class NSMethodSignature extends _ObjCWrapper { - NSMethodSignature._(ffi.Pointer id, StringTestObjCLibrary lib) + @NSUInteger() + external int length; +} + +abstract class NSStringCompareOptions { + static const int NSCaseInsensitiveSearch = 1; + static const int NSLiteralSearch = 2; + static const int NSBackwardsSearch = 4; + static const int NSAnchoredSearch = 8; + static const int NSNumericSearch = 64; + static const int NSDiacriticInsensitiveSearch = 128; + static const int NSWidthInsensitiveSearch = 256; + static const int NSForcedOrderingSearch = 512; + static const int NSRegularExpressionSearch = 1024; +} + +abstract class NSStringEnumerationOptions { + static const int NSStringEnumerationByLines = 0; + static const int NSStringEnumerationByParagraphs = 1; + static const int NSStringEnumerationByComposedCharacterSequences = 2; + static const int NSStringEnumerationByWords = 3; + static const int NSStringEnumerationBySentences = 4; + static const int NSStringEnumerationByCaretPositions = 5; + static const int NSStringEnumerationByDeletionClusters = 6; + static const int NSStringEnumerationReverse = 256; + static const int NSStringEnumerationSubstringNotRequired = 512; + static const int NSStringEnumerationLocalized = 1024; +} + +typedef NSStringEncoding = NSUInteger; + +class NSData extends _ObjCWrapper { + NSData._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); - static NSMethodSignature castFrom(T other) { - return NSMethodSignature._(other._id, other._lib); + static NSData castFrom(T other) { + return NSData._(other._id, other._lib); } - static NSMethodSignature castFromPointer( + static NSData castFromPointer( StringTestObjCLibrary lib, ffi.Pointer other) { - return NSMethodSignature._(other, lib); + return NSData._(other, lib); } } -typedef NSUInteger = pkg_ffi.UnsignedLong; +abstract class NSStringEncodingConversionOptions { + static const int NSStringEncodingConversionAllowLossy = 1; + static const int NSStringEncodingConversionExternalRepresentation = 2; +} -class NSString extends NSObject { - NSString._(ffi.Pointer id, StringTestObjCLibrary lib) +typedef NSRangePointer = ffi.Pointer; +typedef NSStringTransform = ffi.Pointer; + +class __va_list_tag extends ffi.Struct { + @pkg_ffi.UnsignedInt() + external int gp_offset; + + @pkg_ffi.UnsignedInt() + external int fp_offset; + + external ffi.Pointer overflow_arg_area; + + external ffi.Pointer reg_save_area; +} + +class NSDictionary extends _ObjCWrapper { + NSDictionary._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); - static NSString castFrom(T other) { - return NSString._(other._id, other._lib); + static NSDictionary castFrom(T other) { + return NSDictionary._(other._id, other._lib); } - static NSString castFromPointer( + static NSDictionary castFromPointer( StringTestObjCLibrary lib, ffi.Pointer other) { - return NSString._(other, lib); + return NSDictionary._(other, lib); } +} - factory NSString(StringTestObjCLibrary _lib, String str) { - final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); - pkg_ffi.calloc.free(cstr); - return nsstr; +class NSValue extends NSObject { + NSValue._(ffi.Pointer id, StringTestObjCLibrary lib) + : super._(id, lib); + + static NSValue castFrom(T other) { + return NSValue._(other._id, other._lib); } - @override - String toString() => UTF8String().cast().toDartString(); + static NSValue castFromPointer( + StringTestObjCLibrary lib, ffi.Pointer other) { + return NSValue._(other, lib); + } - int get length { - return _lib._objc_msgSend_11(_id, _lib._sel_length1); + void getValue_size(ffi.Pointer value, int size) { + _lib._objc_msgSend_76(_id, _lib._sel_getValue_size_1, value, size); } - int characterAtIndex(int index) { - return _lib._objc_msgSend_12(_id, _lib._sel_characterAtIndex_1, index); + ffi.Pointer get objCType { + return _lib._objc_msgSend_36(_id, _lib._sel_objCType1); } - @override - NSString init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSString._(_ret, _lib); + NSValue initWithBytes_objCType( + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_77( + _id, _lib._sel_initWithBytes_objCType_1, value, type); + return NSValue._(_ret, _lib); } - NSString initWithCoder(NSObject? coder) { + NSValue initWithCoder(NSObject? coder) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); + return NSValue._(_ret, _lib); } - static NSString stringWithCString_encoding( - StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_14(_lib._class_NSString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return NSString._(_ret, _lib); + static NSValue valueWithBytes_objCType(StringTestObjCLibrary _lib, + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_78( + _lib._class_NSValue1, _lib._sel_valueWithBytes_objCType_1, value, type); + return NSValue._(_ret, _lib); } - ffi.Pointer UTF8String() { - return _lib._objc_msgSend_15(_id, _lib._sel_UTF8String1); + static NSValue value_withObjCType(StringTestObjCLibrary _lib, + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_78( + _lib._class_NSValue1, _lib._sel_value_withObjCType_1, value, type); + return NSValue._(_ret, _lib); } - static NSString new1(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSString1, _lib._sel_new1); - return NSString._(_ret, _lib); + static NSValue valueWithNonretainedObject( + StringTestObjCLibrary _lib, NSObject anObject) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSValue1, + _lib._sel_valueWithNonretainedObject_1, anObject._id); + return NSValue._(_ret, _lib); } - static NSString alloc(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSString1, _lib._sel_alloc1); - return NSString._(_ret, _lib); + NSObject get nonretainedObjectValue { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_nonretainedObjectValue1); + return NSObject._(_ret, _lib); } -} -extension StringToNSString on String { - NSString toNSString(StringTestObjCLibrary lib) => NSString(lib, this); -} + static NSValue valueWithPointer( + StringTestObjCLibrary _lib, ffi.Pointer pointer) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSValue1, _lib._sel_valueWithPointer_1, pointer); + return NSValue._(_ret, _lib); + } -typedef unichar = pkg_ffi.UnsignedShort; + ffi.Pointer get pointerValue { + return _lib._objc_msgSend_81(_id, _lib._sel_pointerValue1); + } + + bool isEqualToValue(NSObject? value) { + return _lib._objc_msgSend_4( + _id, _lib._sel_isEqualToValue_1, value?._id ?? ffi.nullptr); + } + + void getValue(ffi.Pointer value) { + _lib._objc_msgSend_82(_id, _lib._sel_getValue_1, value); + } + + static NSValue valueWithRange(StringTestObjCLibrary _lib, NSRange range) { + final _ret = _lib._objc_msgSend_83( + _lib._class_NSValue1, _lib._sel_valueWithRange_1, range); + return NSValue._(_ret, _lib); + } + + NSRange get rangeValue { + return _lib._objc_msgSend_84(_id, _lib._sel_rangeValue1); + } + + static NSValue new1(StringTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSValue1, _lib._sel_new1); + return NSValue._(_ret, _lib); + } + + static NSValue alloc(StringTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSValue1, _lib._sel_alloc1); + return NSValue._(_ret, _lib); + } +} class NSNumber extends NSValue { NSNumber._(ffi.Pointer id, StringTestObjCLibrary lib) @@ -2980,113 +6433,113 @@ class NSNumber extends NSValue { } NSNumber initWithChar(int value) { - final _ret = _lib._objc_msgSend_19(_id, _lib._sel_initWithChar_1, value); + final _ret = _lib._objc_msgSend_85(_id, _lib._sel_initWithChar_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithUnsignedChar(int value) { final _ret = - _lib._objc_msgSend_20(_id, _lib._sel_initWithUnsignedChar_1, value); + _lib._objc_msgSend_86(_id, _lib._sel_initWithUnsignedChar_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithShort(int value) { - final _ret = _lib._objc_msgSend_21(_id, _lib._sel_initWithShort_1, value); + final _ret = _lib._objc_msgSend_87(_id, _lib._sel_initWithShort_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithUnsignedShort(int value) { final _ret = - _lib._objc_msgSend_22(_id, _lib._sel_initWithUnsignedShort_1, value); + _lib._objc_msgSend_88(_id, _lib._sel_initWithUnsignedShort_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithInt(int value) { - final _ret = _lib._objc_msgSend_23(_id, _lib._sel_initWithInt_1, value); + final _ret = _lib._objc_msgSend_89(_id, _lib._sel_initWithInt_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithUnsignedInt(int value) { final _ret = - _lib._objc_msgSend_24(_id, _lib._sel_initWithUnsignedInt_1, value); + _lib._objc_msgSend_90(_id, _lib._sel_initWithUnsignedInt_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithLong(int value) { - final _ret = _lib._objc_msgSend_25(_id, _lib._sel_initWithLong_1, value); + final _ret = _lib._objc_msgSend_91(_id, _lib._sel_initWithLong_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithUnsignedLong(int value) { final _ret = - _lib._objc_msgSend_26(_id, _lib._sel_initWithUnsignedLong_1, value); + _lib._objc_msgSend_92(_id, _lib._sel_initWithUnsignedLong_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithLongLong(int value) { final _ret = - _lib._objc_msgSend_27(_id, _lib._sel_initWithLongLong_1, value); + _lib._objc_msgSend_93(_id, _lib._sel_initWithLongLong_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithUnsignedLongLong(int value) { final _ret = - _lib._objc_msgSend_28(_id, _lib._sel_initWithUnsignedLongLong_1, value); + _lib._objc_msgSend_94(_id, _lib._sel_initWithUnsignedLongLong_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithFloat(double value) { - final _ret = _lib._objc_msgSend_29(_id, _lib._sel_initWithFloat_1, value); + final _ret = _lib._objc_msgSend_95(_id, _lib._sel_initWithFloat_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithDouble(double value) { - final _ret = _lib._objc_msgSend_30(_id, _lib._sel_initWithDouble_1, value); + final _ret = _lib._objc_msgSend_96(_id, _lib._sel_initWithDouble_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithBool(bool value) { - final _ret = _lib._objc_msgSend_31(_id, _lib._sel_initWithBool_1, value); + final _ret = _lib._objc_msgSend_97(_id, _lib._sel_initWithBool_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithInteger(int value) { - final _ret = _lib._objc_msgSend_25(_id, _lib._sel_initWithInteger_1, value); + final _ret = _lib._objc_msgSend_91(_id, _lib._sel_initWithInteger_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithUnsignedInteger(int value) { final _ret = - _lib._objc_msgSend_26(_id, _lib._sel_initWithUnsignedInteger_1, value); + _lib._objc_msgSend_92(_id, _lib._sel_initWithUnsignedInteger_1, value); return NSNumber._(_ret, _lib); } int get charValue { - return _lib._objc_msgSend_32(_id, _lib._sel_charValue1); + return _lib._objc_msgSend_98(_id, _lib._sel_charValue1); } int get unsignedCharValue { - return _lib._objc_msgSend_33(_id, _lib._sel_unsignedCharValue1); + return _lib._objc_msgSend_99(_id, _lib._sel_unsignedCharValue1); } int get shortValue { - return _lib._objc_msgSend_34(_id, _lib._sel_shortValue1); + return _lib._objc_msgSend_100(_id, _lib._sel_shortValue1); } int get unsignedShortValue { - return _lib._objc_msgSend_35(_id, _lib._sel_unsignedShortValue1); + return _lib._objc_msgSend_101(_id, _lib._sel_unsignedShortValue1); } int get intValue { - return _lib._objc_msgSend_36(_id, _lib._sel_intValue1); + return _lib._objc_msgSend_31(_id, _lib._sel_intValue1); } int get unsignedIntValue { - return _lib._objc_msgSend_37(_id, _lib._sel_unsignedIntValue1); + return _lib._objc_msgSend_102(_id, _lib._sel_unsignedIntValue1); } int get longValue { - return _lib._objc_msgSend_38(_id, _lib._sel_longValue1); + return _lib._objc_msgSend_32(_id, _lib._sel_longValue1); } int get unsignedLongValue { @@ -3094,19 +6547,19 @@ class NSNumber extends NSValue { } int get longLongValue { - return _lib._objc_msgSend_39(_id, _lib._sel_longLongValue1); + return _lib._objc_msgSend_33(_id, _lib._sel_longLongValue1); } int get unsignedLongLongValue { - return _lib._objc_msgSend_40(_id, _lib._sel_unsignedLongLongValue1); + return _lib._objc_msgSend_103(_id, _lib._sel_unsignedLongLongValue1); } double get floatValue { - return _lib._objc_msgSend_41(_id, _lib._sel_floatValue1); + return _lib._objc_msgSend_30(_id, _lib._sel_floatValue1); } double get doubleValue { - return _lib._objc_msgSend_42(_id, _lib._sel_doubleValue1); + return _lib._objc_msgSend_29(_id, _lib._sel_doubleValue1); } bool get boolValue { @@ -3114,32 +6567,161 @@ class NSNumber extends NSValue { } int get integerValue { - return _lib._objc_msgSend_38(_id, _lib._sel_integerValue1); + return _lib._objc_msgSend_32(_id, _lib._sel_integerValue1); } int get unsignedIntegerValue { return _lib._objc_msgSend_11(_id, _lib._sel_unsignedIntegerValue1); } - NSObject? get stringValue { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_stringValue1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); + NSObject? get stringValue { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_stringValue1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } + + int compare(NSObject? otherNumber) { + return _lib._objc_msgSend_17( + _id, _lib._sel_compare_1, otherNumber?._id ?? ffi.nullptr); + } + + bool isEqualToNumber(NSObject? number) { + return _lib._objc_msgSend_4( + _id, _lib._sel_isEqualToNumber_1, number?._id ?? ffi.nullptr); + } + + NSString descriptionWithLocale(NSObject locale) { + final _ret = _lib._objc_msgSend_28( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib); + } + + static NSNumber numberWithChar(StringTestObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_85( + _lib._class_NSNumber1, _lib._sel_numberWithChar_1, value); + return NSNumber._(_ret, _lib); + } + + static NSNumber numberWithUnsignedChar( + StringTestObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_86( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedChar_1, value); + return NSNumber._(_ret, _lib); + } + + static NSNumber numberWithShort(StringTestObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_87( + _lib._class_NSNumber1, _lib._sel_numberWithShort_1, value); + return NSNumber._(_ret, _lib); + } + + static NSNumber numberWithUnsignedShort( + StringTestObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_88( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedShort_1, value); + return NSNumber._(_ret, _lib); + } + + static NSNumber numberWithInt(StringTestObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_89( + _lib._class_NSNumber1, _lib._sel_numberWithInt_1, value); + return NSNumber._(_ret, _lib); + } + + static NSNumber numberWithUnsignedInt(StringTestObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_90( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInt_1, value); + return NSNumber._(_ret, _lib); + } + + static NSNumber numberWithLong(StringTestObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_91( + _lib._class_NSNumber1, _lib._sel_numberWithLong_1, value); + return NSNumber._(_ret, _lib); + } + + static NSNumber numberWithUnsignedLong( + StringTestObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_92( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLong_1, value); + return NSNumber._(_ret, _lib); + } + + static NSNumber numberWithLongLong(StringTestObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_93( + _lib._class_NSNumber1, _lib._sel_numberWithLongLong_1, value); + return NSNumber._(_ret, _lib); + } + + static NSNumber numberWithUnsignedLongLong( + StringTestObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_94( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLongLong_1, value); + return NSNumber._(_ret, _lib); + } + + static NSNumber numberWithFloat(StringTestObjCLibrary _lib, double value) { + final _ret = _lib._objc_msgSend_95( + _lib._class_NSNumber1, _lib._sel_numberWithFloat_1, value); + return NSNumber._(_ret, _lib); + } + + static NSNumber numberWithDouble(StringTestObjCLibrary _lib, double value) { + final _ret = _lib._objc_msgSend_96( + _lib._class_NSNumber1, _lib._sel_numberWithDouble_1, value); + return NSNumber._(_ret, _lib); + } + + static NSNumber numberWithBool(StringTestObjCLibrary _lib, bool value) { + final _ret = _lib._objc_msgSend_97( + _lib._class_NSNumber1, _lib._sel_numberWithBool_1, value); + return NSNumber._(_ret, _lib); + } + + static NSNumber numberWithInteger(StringTestObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_91( + _lib._class_NSNumber1, _lib._sel_numberWithInteger_1, value); + return NSNumber._(_ret, _lib); + } + + static NSNumber numberWithUnsignedInteger( + StringTestObjCLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_92( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInteger_1, value); + return NSNumber._(_ret, _lib); + } + + static NSValue valueWithBytes_objCType(StringTestObjCLibrary _lib, + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_78(_lib._class_NSNumber1, + _lib._sel_valueWithBytes_objCType_1, value, type); + return NSValue._(_ret, _lib); + } + + static NSValue value_withObjCType(StringTestObjCLibrary _lib, + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_78( + _lib._class_NSNumber1, _lib._sel_value_withObjCType_1, value, type); + return NSValue._(_ret, _lib); } - int compare(NSObject? otherNumber) { - return _lib._objc_msgSend_43( - _id, _lib._sel_compare_1, otherNumber?._id ?? ffi.nullptr); + static NSValue valueWithNonretainedObject( + StringTestObjCLibrary _lib, NSObject anObject) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSNumber1, + _lib._sel_valueWithNonretainedObject_1, anObject._id); + return NSValue._(_ret, _lib); } - bool isEqualToNumber(NSObject? number) { - return _lib._objc_msgSend_4( - _id, _lib._sel_isEqualToNumber_1, number?._id ?? ffi.nullptr); + static NSValue valueWithPointer( + StringTestObjCLibrary _lib, ffi.Pointer pointer) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSNumber1, _lib._sel_valueWithPointer_1, pointer); + return NSValue._(_ret, _lib); } - NSString descriptionWithLocale(NSObject locale) { - final _ret = _lib._objc_msgSend_44( - _id, _lib._sel_descriptionWithLocale_1, locale._id); - return NSString._(_ret, _lib); + static NSValue valueWithRange(StringTestObjCLibrary _lib, NSRange range) { + final _ret = _lib._objc_msgSend_83( + _lib._class_NSNumber1, _lib._sel_valueWithRange_1, range); + return NSValue._(_ret, _lib); } static NSNumber new1(StringTestObjCLibrary _lib) { @@ -3153,14 +6735,6 @@ class NSNumber extends NSValue { } } -class _NSRange extends ffi.Struct { - @NSUInteger() - external int location; - - @NSUInteger() - external int length; -} - class NSFastEnumerationState extends ffi.Struct { @pkg_ffi.UnsignedLong() external int state; @@ -3191,6 +6765,11 @@ class NSEnumerator extends NSObject { return NSObject._(_ret, _lib); } + NSObject? get allObjects { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_allObjects1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } + static NSEnumerator new1(StringTestObjCLibrary _lib) { final _ret = _lib._objc_msgSend_1(_lib._class_NSEnumerator1, _lib._sel_new1); @@ -3229,7 +6808,7 @@ class NSOrderedCollectionChange extends NSObject { } int get changeType { - return _lib._objc_msgSend_45(_id, _lib._sel_changeType1); + return _lib._objc_msgSend_104(_id, _lib._sel_changeType1); } int get index { @@ -3248,14 +6827,14 @@ class NSOrderedCollectionChange extends NSObject { NSOrderedCollectionChange initWithObject_type_index( NSObject anObject, int type, int index) { - final _ret = _lib._objc_msgSend_46( + final _ret = _lib._objc_msgSend_105( _id, _lib._sel_initWithObject_type_index_1, anObject._id, type, index); return NSOrderedCollectionChange._(_ret, _lib); } NSOrderedCollectionChange initWithObject_type_index_associatedIndex( NSObject anObject, int type, int index, int associatedIndex) { - final _ret = _lib._objc_msgSend_47( + final _ret = _lib._objc_msgSend_106( _id, _lib._sel_initWithObject_type_index_associatedIndex_1, anObject._id, @@ -3298,21 +6877,21 @@ class NSIndexSet extends NSObject { } static NSIndexSet indexSetWithIndex(StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_48( + final _ret = _lib._objc_msgSend_107( _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndex_1, value); return NSIndexSet._(_ret, _lib); } static NSIndexSet indexSetWithIndexesInRange( StringTestObjCLibrary _lib, NSRange range) { - final _ret = _lib._objc_msgSend_49( + final _ret = _lib._objc_msgSend_108( _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndexesInRange_1, range); return NSIndexSet._(_ret, _lib); } NSIndexSet initWithIndexesInRange(NSRange range) { final _ret = - _lib._objc_msgSend_49(_id, _lib._sel_initWithIndexesInRange_1, range); + _lib._objc_msgSend_108(_id, _lib._sel_initWithIndexesInRange_1, range); return NSIndexSet._(_ret, _lib); } @@ -3323,7 +6902,7 @@ class NSIndexSet extends NSObject { } NSIndexSet initWithIndex(int value) { - final _ret = _lib._objc_msgSend_48(_id, _lib._sel_initWithIndex_1, value); + final _ret = _lib._objc_msgSend_107(_id, _lib._sel_initWithIndex_1, value); return NSIndexSet._(_ret, _lib); } @@ -3345,26 +6924,26 @@ class NSIndexSet extends NSObject { } int indexGreaterThanIndex(int value) { - return _lib._objc_msgSend_50(_id, _lib._sel_indexGreaterThanIndex_1, value); + return _lib._objc_msgSend_43(_id, _lib._sel_indexGreaterThanIndex_1, value); } int indexLessThanIndex(int value) { - return _lib._objc_msgSend_50(_id, _lib._sel_indexLessThanIndex_1, value); + return _lib._objc_msgSend_43(_id, _lib._sel_indexLessThanIndex_1, value); } int indexGreaterThanOrEqualToIndex(int value) { - return _lib._objc_msgSend_50( + return _lib._objc_msgSend_43( _id, _lib._sel_indexGreaterThanOrEqualToIndex_1, value); } int indexLessThanOrEqualToIndex(int value) { - return _lib._objc_msgSend_50( + return _lib._objc_msgSend_43( _id, _lib._sel_indexLessThanOrEqualToIndex_1, value); } int getIndexes_maxCount_inIndexRange(ffi.Pointer indexBuffer, int bufferSize, NSRangePointer range) { - return _lib._objc_msgSend_51( + return _lib._objc_msgSend_109( _id, _lib._sel_getIndexes_maxCount_inIndexRange_1, indexBuffer, @@ -3373,15 +6952,16 @@ class NSIndexSet extends NSObject { } int countOfIndexesInRange(NSRange range) { - return _lib._objc_msgSend_52(_id, _lib._sel_countOfIndexesInRange_1, range); + return _lib._objc_msgSend_110( + _id, _lib._sel_countOfIndexesInRange_1, range); } bool containsIndex(int value) { - return _lib._objc_msgSend_53(_id, _lib._sel_containsIndex_1, value); + return _lib._objc_msgSend_39(_id, _lib._sel_containsIndex_1, value); } bool containsIndexesInRange(NSRange range) { - return _lib._objc_msgSend_54( + return _lib._objc_msgSend_111( _id, _lib._sel_containsIndexesInRange_1, range); } @@ -3391,7 +6971,7 @@ class NSIndexSet extends NSObject { } bool intersectsIndexesInRange(NSRange range) { - return _lib._objc_msgSend_54( + return _lib._objc_msgSend_111( _id, _lib._sel_intersectsIndexesInRange_1, range); } @@ -3401,13 +6981,13 @@ class NSIndexSet extends NSObject { } void enumerateIndexesWithOptions_usingBlock(int opts, NSObject block) { - _lib._objc_msgSend_55(_id, + _lib._objc_msgSend_112(_id, _lib._sel_enumerateIndexesWithOptions_usingBlock_1, opts, block._id); } void enumerateIndexesInRange_options_usingBlock( NSRange range, int opts, NSObject block) { - _lib._objc_msgSend_56( + _lib._objc_msgSend_113( _id, _lib._sel_enumerateIndexesInRange_options_usingBlock_1, range, @@ -3416,18 +6996,18 @@ class NSIndexSet extends NSObject { } int indexPassingTest(NSObject predicate) { - return _lib._objc_msgSend_57( + return _lib._objc_msgSend_114( _id, _lib._sel_indexPassingTest_1, predicate._id); } int indexWithOptions_passingTest(int opts, NSObject predicate) { - return _lib._objc_msgSend_58( + return _lib._objc_msgSend_115( _id, _lib._sel_indexWithOptions_passingTest_1, opts, predicate._id); } int indexInRange_options_passingTest( NSRange range, int opts, NSObject predicate) { - return _lib._objc_msgSend_59( + return _lib._objc_msgSend_116( _id, _lib._sel_indexInRange_options_passingTest_1, range, @@ -3436,20 +7016,20 @@ class NSIndexSet extends NSObject { } NSIndexSet indexesPassingTest(NSObject predicate) { - final _ret = _lib._objc_msgSend_60( + final _ret = _lib._objc_msgSend_117( _id, _lib._sel_indexesPassingTest_1, predicate._id); return NSIndexSet._(_ret, _lib); } NSIndexSet indexesWithOptions_passingTest(int opts, NSObject predicate) { - final _ret = _lib._objc_msgSend_61( + final _ret = _lib._objc_msgSend_118( _id, _lib._sel_indexesWithOptions_passingTest_1, opts, predicate._id); return NSIndexSet._(_ret, _lib); } NSIndexSet indexesInRange_options_passingTest( NSRange range, int opts, NSObject predicate) { - final _ret = _lib._objc_msgSend_62( + final _ret = _lib._objc_msgSend_119( _id, _lib._sel_indexesInRange_options_passingTest_1, range, @@ -3463,13 +7043,13 @@ class NSIndexSet extends NSObject { } void enumerateRangesWithOptions_usingBlock(int opts, NSObject block) { - _lib._objc_msgSend_55(_id, + _lib._objc_msgSend_112(_id, _lib._sel_enumerateRangesWithOptions_usingBlock_1, opts, block._id); } void enumerateRangesInRange_options_usingBlock( NSRange range, int opts, NSObject block) { - _lib._objc_msgSend_56( + _lib._objc_msgSend_113( _id, _lib._sel_enumerateRangesInRange_options_usingBlock_1, range, @@ -3489,9 +7069,6 @@ class NSIndexSet extends NSObject { } } -typedef NSRange = _NSRange; -typedef NSRangePointer = ffi.Pointer; - class NSMutableIndexSet extends NSIndexSet { NSMutableIndexSet._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); @@ -3520,23 +7097,23 @@ class NSMutableIndexSet extends NSIndexSet { } void addIndex(int value) { - _lib._objc_msgSend_63(_id, _lib._sel_addIndex_1, value); + _lib._objc_msgSend_40(_id, _lib._sel_addIndex_1, value); } void removeIndex(int value) { - _lib._objc_msgSend_63(_id, _lib._sel_removeIndex_1, value); + _lib._objc_msgSend_40(_id, _lib._sel_removeIndex_1, value); } void addIndexesInRange(NSRange range) { - _lib._objc_msgSend_64(_id, _lib._sel_addIndexesInRange_1, range); + _lib._objc_msgSend_120(_id, _lib._sel_addIndexesInRange_1, range); } void removeIndexesInRange(NSRange range) { - _lib._objc_msgSend_64(_id, _lib._sel_removeIndexesInRange_1, range); + _lib._objc_msgSend_120(_id, _lib._sel_removeIndexesInRange_1, range); } void shiftIndexesStartingAtIndex_by(int index, int delta) { - _lib._objc_msgSend_65( + _lib._objc_msgSend_121( _id, _lib._sel_shiftIndexesStartingAtIndex_by_1, index, delta); } @@ -3548,14 +7125,14 @@ class NSMutableIndexSet extends NSIndexSet { static NSMutableIndexSet indexSetWithIndex( StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_48( + final _ret = _lib._objc_msgSend_107( _lib._class_NSMutableIndexSet1, _lib._sel_indexSetWithIndex_1, value); return NSMutableIndexSet._(_ret, _lib); } static NSMutableIndexSet indexSetWithIndexesInRange( StringTestObjCLibrary _lib, NSRange range) { - final _ret = _lib._objc_msgSend_49(_lib._class_NSMutableIndexSet1, + final _ret = _lib._objc_msgSend_108(_lib._class_NSMutableIndexSet1, _lib._sel_indexSetWithIndexesInRange_1, range); return NSMutableIndexSet._(_ret, _lib); } @@ -3609,7 +7186,7 @@ class NSOrderedCollectionDifference extends NSObject { NSObject? removes, NSObject? removedObjects, NSObject? changes) { - final _ret = _lib._objc_msgSend_66( + final _ret = _lib._objc_msgSend_122( _id, _lib._sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges_1, inserts?._id ?? ffi.nullptr, @@ -3626,7 +7203,7 @@ class NSOrderedCollectionDifference extends NSObject { NSObject? insertedObjects, NSObject? removes, NSObject? removedObjects) { - final _ret = _lib._objc_msgSend_67( + final _ret = _lib._objc_msgSend_123( _id, _lib._sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_1, inserts?._id ?? ffi.nullptr, @@ -3686,7 +7263,7 @@ class NSArray extends NSObject { } NSObject objectAtIndex(int index) { - final _ret = _lib._objc_msgSend_48(_id, _lib._sel_objectAtIndex_1, index); + final _ret = _lib._objc_msgSend_107(_id, _lib._sel_objectAtIndex_1, index); return NSObject._(_ret, _lib); } @@ -3698,7 +7275,7 @@ class NSArray extends NSObject { NSArray initWithObjects_count( ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_68( + final _ret = _lib._objc_msgSend_124( _id, _lib._sel_initWithObjects_count_1, objects, cnt); return NSArray._(_ret, _lib); } @@ -3709,6 +7286,251 @@ class NSArray extends NSObject { return NSArray._(_ret, _lib); } + NSString componentsJoinedByString(NSObject? separator) { + final _ret = _lib._objc_msgSend_28(_id, + _lib._sel_componentsJoinedByString_1, separator?._id ?? ffi.nullptr); + return NSString._(_ret, _lib); + } + + bool containsObject(NSObject anObject) { + return _lib._objc_msgSend_4(_id, _lib._sel_containsObject_1, anObject._id); + } + + NSObject? get description { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_description1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } + + NSString descriptionWithLocale(NSObject locale) { + final _ret = _lib._objc_msgSend_28( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib); + } + + NSString descriptionWithLocale_indent(NSObject locale, int level) { + final _ret = _lib._objc_msgSend_125( + _id, _lib._sel_descriptionWithLocale_indent_1, locale._id, level); + return NSString._(_ret, _lib); + } + + NSObject firstObjectCommonWithArray(NSObject? otherArray) { + final _ret = _lib._objc_msgSend_13(_id, + _lib._sel_firstObjectCommonWithArray_1, otherArray?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + void getObjects_range( + ffi.Pointer> objects, NSRange range) { + _lib._objc_msgSend_126(_id, _lib._sel_getObjects_range_1, objects, range); + } + + int indexOfObject(NSObject anObject) { + return _lib._objc_msgSend_114(_id, _lib._sel_indexOfObject_1, anObject._id); + } + + int indexOfObject_inRange(NSObject anObject, NSRange range) { + return _lib._objc_msgSend_127( + _id, _lib._sel_indexOfObject_inRange_1, anObject._id, range); + } + + int indexOfObjectIdenticalTo(NSObject anObject) { + return _lib._objc_msgSend_114( + _id, _lib._sel_indexOfObjectIdenticalTo_1, anObject._id); + } + + int indexOfObjectIdenticalTo_inRange(NSObject anObject, NSRange range) { + return _lib._objc_msgSend_127( + _id, _lib._sel_indexOfObjectIdenticalTo_inRange_1, anObject._id, range); + } + + bool isEqualToArray(NSObject? otherArray) { + return _lib._objc_msgSend_4( + _id, _lib._sel_isEqualToArray_1, otherArray?._id ?? ffi.nullptr); + } + + NSObject get firstObject { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_firstObject1); + return NSObject._(_ret, _lib); + } + + NSObject get lastObject { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_lastObject1); + return NSObject._(_ret, _lib); + } + + NSObject? get sortedArrayHint { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_sortedArrayHint1); + return _ret.address == 0 ? null : NSObject._(_ret, _lib); + } + + bool writeToURL_error( + NSObject? url, ffi.Pointer> error) { + return _lib._objc_msgSend_128( + _id, _lib._sel_writeToURL_error_1, url?._id ?? ffi.nullptr, error); + } + + void makeObjectsPerformSelector(ffi.Pointer aSelector) { + _lib._objc_msgSend_6( + _id, _lib._sel_makeObjectsPerformSelector_1, aSelector); + } + + void makeObjectsPerformSelector_withObject( + ffi.Pointer aSelector, NSObject argument) { + _lib._objc_msgSend_129( + _id, + _lib._sel_makeObjectsPerformSelector_withObject_1, + aSelector, + argument._id); + } + + NSObject objectAtIndexedSubscript(int idx) { + final _ret = + _lib._objc_msgSend_107(_id, _lib._sel_objectAtIndexedSubscript_1, idx); + return NSObject._(_ret, _lib); + } + + void enumerateObjectsUsingBlock(NSObject block) { + _lib._objc_msgSend_8( + _id, _lib._sel_enumerateObjectsUsingBlock_1, block._id); + } + + void enumerateObjectsWithOptions_usingBlock(int opts, NSObject block) { + _lib._objc_msgSend_112(_id, + _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._id); + } + + void enumerateObjectsAtIndexes_options_usingBlock( + NSObject? s, int opts, NSObject block) { + _lib._objc_msgSend_130( + _id, + _lib._sel_enumerateObjectsAtIndexes_options_usingBlock_1, + s?._id ?? ffi.nullptr, + opts, + block._id); + } + + int indexOfObjectPassingTest(NSObject predicate) { + return _lib._objc_msgSend_114( + _id, _lib._sel_indexOfObjectPassingTest_1, predicate._id); + } + + int indexOfObjectWithOptions_passingTest(int opts, NSObject predicate) { + return _lib._objc_msgSend_115(_id, + _lib._sel_indexOfObjectWithOptions_passingTest_1, opts, predicate._id); + } + + int indexOfObjectAtIndexes_options_passingTest( + NSObject? s, int opts, NSObject predicate) { + return _lib._objc_msgSend_131( + _id, + _lib._sel_indexOfObjectAtIndexes_options_passingTest_1, + s?._id ?? ffi.nullptr, + opts, + predicate._id); + } + + NSIndexSet indexesOfObjectsPassingTest(NSObject predicate) { + final _ret = _lib._objc_msgSend_117( + _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._id); + return NSIndexSet._(_ret, _lib); + } + + NSIndexSet indexesOfObjectsWithOptions_passingTest( + int opts, NSObject predicate) { + final _ret = _lib._objc_msgSend_118( + _id, + _lib._sel_indexesOfObjectsWithOptions_passingTest_1, + opts, + predicate._id); + return NSIndexSet._(_ret, _lib); + } + + NSIndexSet indexesOfObjectsAtIndexes_options_passingTest( + NSObject? s, int opts, NSObject predicate) { + final _ret = _lib._objc_msgSend_132( + _id, + _lib._sel_indexesOfObjectsAtIndexes_options_passingTest_1, + s?._id ?? ffi.nullptr, + opts, + predicate._id); + return NSIndexSet._(_ret, _lib); + } + + int indexOfObject_inSortedRange_options_usingComparator( + NSObject obj, NSRange r, int opts, NSComparator cmp) { + return _lib._objc_msgSend_133( + _id, + _lib._sel_indexOfObject_inSortedRange_options_usingComparator_1, + obj._id, + r, + opts, + cmp); + } + + static NSArray array(StringTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSArray1, _lib._sel_array1); + return NSArray._(_ret, _lib); + } + + static NSArray arrayWithObject( + StringTestObjCLibrary _lib, NSObject anObject) { + final _ret = _lib._objc_msgSend_13( + _lib._class_NSArray1, _lib._sel_arrayWithObject_1, anObject._id); + return NSArray._(_ret, _lib); + } + + static NSArray arrayWithObjects_count(StringTestObjCLibrary _lib, + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_124( + _lib._class_NSArray1, _lib._sel_arrayWithObjects_count_1, objects, cnt); + return NSArray._(_ret, _lib); + } + + static NSArray arrayWithObjects( + StringTestObjCLibrary _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_13( + _lib._class_NSArray1, _lib._sel_arrayWithObjects_1, firstObj._id); + return NSArray._(_ret, _lib); + } + + static NSArray arrayWithArray(StringTestObjCLibrary _lib, NSObject? array) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSArray1, + _lib._sel_arrayWithArray_1, array?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib); + } + + NSArray initWithObjects(NSObject firstObj) { + final _ret = + _lib._objc_msgSend_13(_id, _lib._sel_initWithObjects_1, firstObj._id); + return NSArray._(_ret, _lib); + } + + NSArray initWithArray(NSObject? array) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithArray_1, array?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib); + } + + NSArray initWithArray_copyItems(NSObject? array, bool flag) { + final _ret = _lib._objc_msgSend_134(_id, + _lib._sel_initWithArray_copyItems_1, array?._id ?? ffi.nullptr, flag); + return NSArray._(_ret, _lib); + } + + void getObjects(ffi.Pointer> objects) { + _lib._objc_msgSend_135(_id, _lib._sel_getObjects_1, objects); + } + + bool writeToFile_atomically(NSObject? path, bool useAuxiliaryFile) { + return _lib._objc_msgSend_71(_id, _lib._sel_writeToFile_atomically_1, + path?._id ?? ffi.nullptr, useAuxiliaryFile); + } + + bool writeToURL_atomically(NSObject? url, bool atomically) { + return _lib._objc_msgSend_71(_id, _lib._sel_writeToURL_atomically_1, + url?._id ?? ffi.nullptr, atomically); + } + static NSArray new1(StringTestObjCLibrary _lib) { final _ret = _lib._objc_msgSend_1(_lib._class_NSArray1, _lib._sel_new1); return NSArray._(_ret, _lib); @@ -3726,6 +7548,8 @@ abstract class NSBinarySearchingOptions { static const int NSBinarySearchingInsertionIndex = 1024; } +typedef NSComparator = ffi.Pointer; + class NSMutableArray extends NSArray { NSMutableArray._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); @@ -3744,7 +7568,7 @@ class NSMutableArray extends NSArray { } void insertObject_atIndex(NSObject anObject, int index) { - _lib._objc_msgSend_69( + _lib._objc_msgSend_136( _id, _lib._sel_insertObject_atIndex_1, anObject._id, index); } @@ -3753,30 +7577,193 @@ class NSMutableArray extends NSArray { } void removeObjectAtIndex(int index) { - _lib._objc_msgSend_63(_id, _lib._sel_removeObjectAtIndex_1, index); + _lib._objc_msgSend_40(_id, _lib._sel_removeObjectAtIndex_1, index); } void replaceObjectAtIndex_withObject(int index, NSObject anObject) { - _lib._objc_msgSend_70( + _lib._objc_msgSend_137( _id, _lib._sel_replaceObjectAtIndex_withObject_1, index, anObject._id); } - @override - NSMutableArray init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); + @override + NSMutableArray init() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); + return NSMutableArray._(_ret, _lib); + } + + NSMutableArray initWithCapacity(int numItems) { + final _ret = + _lib._objc_msgSend_107(_id, _lib._sel_initWithCapacity_1, numItems); + return NSMutableArray._(_ret, _lib); + } + + @override + NSMutableArray initWithCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_13( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib); + } + + void addObjectsFromArray(NSObject? otherArray) { + _lib._objc_msgSend_8( + _id, _lib._sel_addObjectsFromArray_1, otherArray?._id ?? ffi.nullptr); + } + + void exchangeObjectAtIndex_withObjectAtIndex(int idx1, int idx2) { + _lib._objc_msgSend_138( + _id, _lib._sel_exchangeObjectAtIndex_withObjectAtIndex_1, idx1, idx2); + } + + void removeAllObjects() { + _lib._objc_msgSend_0(_id, _lib._sel_removeAllObjects1); + } + + void removeObject_inRange(NSObject anObject, NSRange range) { + _lib._objc_msgSend_139( + _id, _lib._sel_removeObject_inRange_1, anObject._id, range); + } + + void removeObject(NSObject anObject) { + _lib._objc_msgSend_8(_id, _lib._sel_removeObject_1, anObject._id); + } + + void removeObjectIdenticalTo_inRange(NSObject anObject, NSRange range) { + _lib._objc_msgSend_139( + _id, _lib._sel_removeObjectIdenticalTo_inRange_1, anObject._id, range); + } + + void removeObjectIdenticalTo(NSObject anObject) { + _lib._objc_msgSend_8( + _id, _lib._sel_removeObjectIdenticalTo_1, anObject._id); + } + + void removeObjectsFromIndices_numIndices( + ffi.Pointer indices, int cnt) { + _lib._objc_msgSend_140( + _id, _lib._sel_removeObjectsFromIndices_numIndices_1, indices, cnt); + } + + void removeObjectsInArray(NSObject? otherArray) { + _lib._objc_msgSend_8( + _id, _lib._sel_removeObjectsInArray_1, otherArray?._id ?? ffi.nullptr); + } + + void removeObjectsInRange(NSRange range) { + _lib._objc_msgSend_120(_id, _lib._sel_removeObjectsInRange_1, range); + } + + void replaceObjectsInRange_withObjectsFromArray_range( + NSRange range, NSObject? otherArray, NSRange otherRange) { + _lib._objc_msgSend_141( + _id, + _lib._sel_replaceObjectsInRange_withObjectsFromArray_range_1, + range, + otherArray?._id ?? ffi.nullptr, + otherRange); + } + + void replaceObjectsInRange_withObjectsFromArray( + NSRange range, NSObject? otherArray) { + _lib._objc_msgSend_142( + _id, + _lib._sel_replaceObjectsInRange_withObjectsFromArray_1, + range, + otherArray?._id ?? ffi.nullptr); + } + + void setArray(NSObject? otherArray) { + _lib._objc_msgSend_8( + _id, _lib._sel_setArray_1, otherArray?._id ?? ffi.nullptr); + } + + void sortUsingFunction_context( + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + compare, + ffi.Pointer context) { + _lib._objc_msgSend_143( + _id, _lib._sel_sortUsingFunction_context_1, compare, context); + } + + void sortUsingSelector(ffi.Pointer comparator) { + _lib._objc_msgSend_6(_id, _lib._sel_sortUsingSelector_1, comparator); + } + + void insertObjects_atIndexes(NSObject? objects, NSObject? indexes) { + _lib._objc_msgSend_144(_id, _lib._sel_insertObjects_atIndexes_1, + objects?._id ?? ffi.nullptr, indexes?._id ?? ffi.nullptr); + } + + void removeObjectsAtIndexes(NSObject? indexes) { + _lib._objc_msgSend_8( + _id, _lib._sel_removeObjectsAtIndexes_1, indexes?._id ?? ffi.nullptr); + } + + void replaceObjectsAtIndexes_withObjects( + NSObject? indexes, NSObject? objects) { + _lib._objc_msgSend_144(_id, _lib._sel_replaceObjectsAtIndexes_withObjects_1, + indexes?._id ?? ffi.nullptr, objects?._id ?? ffi.nullptr); + } + + void setObject_atIndexedSubscript(NSObject obj, int idx) { + _lib._objc_msgSend_136( + _id, _lib._sel_setObject_atIndexedSubscript_1, obj._id, idx); + } + + void sortUsingComparator(NSComparator cmptr) { + _lib._objc_msgSend_8(_id, _lib._sel_sortUsingComparator_1, cmptr); + } + + void sortWithOptions_usingComparator(int opts, NSComparator cmptr) { + _lib._objc_msgSend_145( + _id, _lib._sel_sortWithOptions_usingComparator_1, opts, cmptr); + } + + static NSMutableArray arrayWithCapacity( + StringTestObjCLibrary _lib, int numItems) { + final _ret = _lib._objc_msgSend_107( + _lib._class_NSMutableArray1, _lib._sel_arrayWithCapacity_1, numItems); + return NSMutableArray._(_ret, _lib); + } + + void applyDifference(NSObject? difference) { + _lib._objc_msgSend_8( + _id, _lib._sel_applyDifference_1, difference?._id ?? ffi.nullptr); + } + + static NSMutableArray array(StringTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSMutableArray1, _lib._sel_array1); + return NSMutableArray._(_ret, _lib); + } + + static NSMutableArray arrayWithObject( + StringTestObjCLibrary _lib, NSObject anObject) { + final _ret = _lib._objc_msgSend_13( + _lib._class_NSMutableArray1, _lib._sel_arrayWithObject_1, anObject._id); + return NSMutableArray._(_ret, _lib); + } + + static NSMutableArray arrayWithObjects_count(StringTestObjCLibrary _lib, + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_124(_lib._class_NSMutableArray1, + _lib._sel_arrayWithObjects_count_1, objects, cnt); return NSMutableArray._(_ret, _lib); } - NSMutableArray initWithCapacity(int numItems) { - final _ret = - _lib._objc_msgSend_48(_id, _lib._sel_initWithCapacity_1, numItems); + static NSMutableArray arrayWithObjects( + StringTestObjCLibrary _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableArray1, + _lib._sel_arrayWithObjects_1, firstObj._id); return NSMutableArray._(_ret, _lib); } - @override - NSMutableArray initWithCoder(NSObject? coder) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + static NSMutableArray arrayWithArray( + StringTestObjCLibrary _lib, NSObject? array) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableArray1, + _lib._sel_arrayWithArray_1, array?._id ?? ffi.nullptr); return NSMutableArray._(_ret, _lib); } @@ -3825,7 +7812,7 @@ class NSItemProvider extends NSObject { void registerDataRepresentationForTypeIdentifier_visibility_loadHandler( NSObject? typeIdentifier, int visibility, NSObject loadHandler) { - _lib._objc_msgSend_71( + _lib._objc_msgSend_146( _id, _lib._sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1, typeIdentifier?._id ?? ffi.nullptr, @@ -3839,7 +7826,7 @@ class NSItemProvider extends NSObject { int fileOptions, int visibility, NSObject loadHandler) { - _lib._objc_msgSend_72( + _lib._objc_msgSend_147( _id, _lib._sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1, typeIdentifier?._id ?? ffi.nullptr, @@ -3863,7 +7850,7 @@ class NSItemProvider extends NSObject { bool hasRepresentationConformingToTypeIdentifier_fileOptions( NSObject? typeIdentifier, int fileOptions) { - return _lib._objc_msgSend_73( + return _lib._objc_msgSend_148( _id, _lib._sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1, typeIdentifier?._id ?? ffi.nullptr, @@ -3872,7 +7859,7 @@ class NSItemProvider extends NSObject { NSProgress loadDataRepresentationForTypeIdentifier_completionHandler( NSObject? typeIdentifier, NSObject completionHandler) { - final _ret = _lib._objc_msgSend_74( + final _ret = _lib._objc_msgSend_149( _id, _lib._sel_loadDataRepresentationForTypeIdentifier_completionHandler_1, typeIdentifier?._id ?? ffi.nullptr, @@ -3882,7 +7869,7 @@ class NSItemProvider extends NSObject { NSProgress loadFileRepresentationForTypeIdentifier_completionHandler( NSObject? typeIdentifier, NSObject completionHandler) { - final _ret = _lib._objc_msgSend_74( + final _ret = _lib._objc_msgSend_149( _id, _lib._sel_loadFileRepresentationForTypeIdentifier_completionHandler_1, typeIdentifier?._id ?? ffi.nullptr, @@ -3892,7 +7879,7 @@ class NSItemProvider extends NSObject { NSProgress loadInPlaceFileRepresentationForTypeIdentifier_completionHandler( NSObject? typeIdentifier, NSObject completionHandler) { - final _ret = _lib._objc_msgSend_74( + final _ret = _lib._objc_msgSend_149( _id, _lib._sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1, typeIdentifier?._id ?? ffi.nullptr, @@ -3917,13 +7904,13 @@ class NSItemProvider extends NSObject { } void registerObject_visibility(NSObject? object, int visibility) { - _lib._objc_msgSend_75(_id, _lib._sel_registerObject_visibility_1, + _lib._objc_msgSend_150(_id, _lib._sel_registerObject_visibility_1, object?._id ?? ffi.nullptr, visibility); } void registerObjectOfClass_visibility_loadHandler( NSObject? aClass, int visibility, NSObject loadHandler) { - _lib._objc_msgSend_71( + _lib._objc_msgSend_146( _id, _lib._sel_registerObjectOfClass_visibility_loadHandler_1, aClass?._id ?? ffi.nullptr, @@ -3938,7 +7925,7 @@ class NSItemProvider extends NSObject { NSProgress loadObjectOfClass_completionHandler( NSObject? aClass, NSObject completionHandler) { - final _ret = _lib._objc_msgSend_74( + final _ret = _lib._objc_msgSend_149( _id, _lib._sel_loadObjectOfClass_completionHandler_1, aClass?._id ?? ffi.nullptr, @@ -3948,7 +7935,7 @@ class NSItemProvider extends NSObject { NSItemProvider initWithItem_typeIdentifier( NSObject? item, NSObject? typeIdentifier) { - final _ret = _lib._objc_msgSend_76( + final _ret = _lib._objc_msgSend_57( _id, _lib._sel_initWithItem_typeIdentifier_1, item?._id ?? ffi.nullptr, @@ -3964,7 +7951,7 @@ class NSItemProvider extends NSObject { void registerItemForTypeIdentifier_loadHandler( NSObject? typeIdentifier, NSItemProviderLoadHandler loadHandler) { - _lib._objc_msgSend_77( + _lib._objc_msgSend_144( _id, _lib._sel_registerItemForTypeIdentifier_loadHandler_1, typeIdentifier?._id ?? ffi.nullptr, @@ -3975,7 +7962,7 @@ class NSItemProvider extends NSObject { NSObject? typeIdentifier, NSObject? options, NSItemProviderCompletionHandler completionHandler) { - _lib._objc_msgSend_78( + _lib._objc_msgSend_151( _id, _lib._sel_loadItemForTypeIdentifier_options_completionHandler_1, typeIdentifier?._id ?? ffi.nullptr, @@ -3983,6 +7970,23 @@ class NSItemProvider extends NSObject { completionHandler); } + NSItemProviderLoadHandler get previewImageHandler { + return _lib._objc_msgSend_1(_id, _lib._sel_previewImageHandler1); + } + + set previewImageHandler(NSItemProviderLoadHandler value) { + _lib._objc_msgSend_8(_id, _lib._sel_setPreviewImageHandler_1, value); + } + + void loadPreviewImageWithOptions_completionHandler( + NSObject? options, NSItemProviderCompletionHandler completionHandler) { + _lib._objc_msgSend_144( + _id, + _lib._sel_loadPreviewImageWithOptions_completionHandler_1, + options?._id ?? ffi.nullptr, + completionHandler); + } + static NSItemProvider new1(StringTestObjCLibrary _lib) { final _ret = _lib._objc_msgSend_1(_lib._class_NSItemProvider1, _lib._sel_new1); @@ -4020,37 +8024,6 @@ abstract class NSItemProviderErrorCode { static const int NSItemProviderUnavailableCoercionError = -1200; } -abstract class NSStringCompareOptions { - static const int NSCaseInsensitiveSearch = 1; - static const int NSLiteralSearch = 2; - static const int NSBackwardsSearch = 4; - static const int NSAnchoredSearch = 8; - static const int NSNumericSearch = 64; - static const int NSDiacriticInsensitiveSearch = 128; - static const int NSWidthInsensitiveSearch = 256; - static const int NSForcedOrderingSearch = 512; - static const int NSRegularExpressionSearch = 1024; -} - -abstract class NSStringEncodingConversionOptions { - static const int NSStringEncodingConversionAllowLossy = 1; - static const int NSStringEncodingConversionExternalRepresentation = 2; -} - -abstract class NSStringEnumerationOptions { - static const int NSStringEnumerationByLines = 0; - static const int NSStringEnumerationByParagraphs = 1; - static const int NSStringEnumerationByComposedCharacterSequences = 2; - static const int NSStringEnumerationByWords = 3; - static const int NSStringEnumerationBySentences = 4; - static const int NSStringEnumerationByCaretPositions = 5; - static const int NSStringEnumerationByDeletionClusters = 6; - static const int NSStringEnumerationReverse = 256; - static const int NSStringEnumerationSubstringNotRequired = 512; - static const int NSStringEnumerationLocalized = 1024; -} - -typedef NSStringTransform = ffi.Pointer; typedef NSStringEncodingDetectionOptionsKey = ffi.Pointer; class NSMutableString extends NSString { @@ -4067,17 +8040,234 @@ class NSMutableString extends NSString { } void replaceCharactersInRange_withString(NSRange range, NSObject? aString) { - _lib._objc_msgSend_79(_id, _lib._sel_replaceCharactersInRange_withString_1, + _lib._objc_msgSend_142(_id, _lib._sel_replaceCharactersInRange_withString_1, range, aString?._id ?? ffi.nullptr); } - static NSString stringWithCString_encoding( - StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { + void insertString_atIndex(NSObject? aString, int loc) { + _lib._objc_msgSend_136(_id, _lib._sel_insertString_atIndex_1, + aString?._id ?? ffi.nullptr, loc); + } + + void deleteCharactersInRange(NSRange range) { + _lib._objc_msgSend_120(_id, _lib._sel_deleteCharactersInRange_1, range); + } + + void appendString(NSObject? aString) { + _lib._objc_msgSend_8( + _id, _lib._sel_appendString_1, aString?._id ?? ffi.nullptr); + } + + void appendFormat(NSObject? format) { + _lib._objc_msgSend_8( + _id, _lib._sel_appendFormat_1, format?._id ?? ffi.nullptr); + } + + void setString(NSObject? aString) { + _lib._objc_msgSend_8( + _id, _lib._sel_setString_1, aString?._id ?? ffi.nullptr); + } + + int replaceOccurrencesOfString_withString_options_range(NSObject? target, + NSObject? replacement, int options, NSRange searchRange) { + return _lib._objc_msgSend_152( + _id, + _lib._sel_replaceOccurrencesOfString_withString_options_range_1, + target?._id ?? ffi.nullptr, + replacement?._id ?? ffi.nullptr, + options, + searchRange); + } + + bool applyTransform_reverse_range_updatedRange(NSStringTransform transform, + bool reverse, NSRange range, NSRangePointer resultingRange) { + return _lib._objc_msgSend_153( + _id, + _lib._sel_applyTransform_reverse_range_updatedRange_1, + transform, + reverse, + range, + resultingRange); + } + + NSMutableString initWithCapacity(int capacity) { + final _ret = + _lib._objc_msgSend_154(_id, _lib._sel_initWithCapacity_1, capacity); + return NSMutableString._(_ret, _lib); + } + + static NSMutableString stringWithCapacity( + StringTestObjCLibrary _lib, int capacity) { + final _ret = _lib._objc_msgSend_154( + _lib._class_NSMutableString1, _lib._sel_stringWithCapacity_1, capacity); + return NSMutableString._(_ret, _lib); + } + + static NSString localizedNameOfStringEncoding( + StringTestObjCLibrary _lib, int encoding) { final _ret = _lib._objc_msgSend_14(_lib._class_NSMutableString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); + _lib._sel_localizedNameOfStringEncoding_1, encoding); return NSString._(_ret, _lib); } + static NSMutableString string(StringTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSMutableString1, _lib._sel_string1); + return NSMutableString._(_ret, _lib); + } + + static NSMutableString stringWithString( + StringTestObjCLibrary _lib, NSObject? string) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, + _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); + return NSMutableString._(_ret, _lib); + } + + static NSMutableString stringWithCharacters_length( + StringTestObjCLibrary _lib, ffi.Pointer characters, int length) { + final _ret = _lib._objc_msgSend_54(_lib._class_NSMutableString1, + _lib._sel_stringWithCharacters_length_1, characters, length); + return NSMutableString._(_ret, _lib); + } + + static NSMutableString stringWithUTF8String(StringTestObjCLibrary _lib, + ffi.Pointer nullTerminatedCString) { + final _ret = _lib._objc_msgSend_55(_lib._class_NSMutableString1, + _lib._sel_stringWithUTF8String_1, nullTerminatedCString); + return NSMutableString._(_ret, _lib); + } + + static NSMutableString stringWithFormat( + StringTestObjCLibrary _lib, NSObject? format) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, + _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); + return NSMutableString._(_ret, _lib); + } + + static NSMutableString localizedStringWithFormat( + StringTestObjCLibrary _lib, NSObject? format) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, + _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); + return NSMutableString._(_ret, _lib); + } + + static NSMutableString stringWithCString_encoding( + StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { + final _ret = _lib._objc_msgSend_63(_lib._class_NSMutableString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); + return NSMutableString._(_ret, _lib); + } + + static NSMutableString stringWithContentsOfURL_encoding_error( + StringTestObjCLibrary _lib, + NSObject? url, + int enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_64( + _lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfURL_encoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib); + } + + static NSMutableString stringWithContentsOfFile_encoding_error( + StringTestObjCLibrary _lib, + NSObject? path, + int enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_64( + _lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfFile_encoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib); + } + + static NSMutableString stringWithContentsOfURL_usedEncoding_error( + StringTestObjCLibrary _lib, + NSObject? url, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_65( + _lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib); + } + + static NSMutableString stringWithContentsOfFile_usedEncoding_error( + StringTestObjCLibrary _lib, + NSObject? path, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_65( + _lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib); + } + + static void availableStringEncodings(StringTestObjCLibrary _lib) { + _lib._objc_msgSend_0( + _lib._class_NSMutableString1, _lib._sel_availableStringEncodings1); + } + + static void defaultCStringEncoding(StringTestObjCLibrary _lib) { + _lib._objc_msgSend_0( + _lib._class_NSMutableString1, _lib._sel_defaultCStringEncoding1); + } + + static int + stringEncodingForData_encodingOptions_convertedString_usedLossyConversion( + StringTestObjCLibrary _lib, + NSObject? data, + NSObject? opts, + ffi.Pointer> string, + ffi.Pointer usedLossyConversion) { + return _lib._objc_msgSend_66( + _lib._class_NSMutableString1, + _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, + data?._id ?? ffi.nullptr, + opts?._id ?? ffi.nullptr, + string, + usedLossyConversion); + } + + static NSObject stringWithContentsOfFile( + StringTestObjCLibrary _lib, NSObject? path) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + static NSObject stringWithContentsOfURL( + StringTestObjCLibrary _lib, NSObject? url) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + static NSObject stringWithCString_length( + StringTestObjCLibrary _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_63(_lib._class_NSMutableString1, + _lib._sel_stringWithCString_length_1, bytes, length); + return NSObject._(_ret, _lib); + } + + static NSObject stringWithCString( + StringTestObjCLibrary _lib, ffi.Pointer bytes) { + final _ret = _lib._objc_msgSend_55( + _lib._class_NSMutableString1, _lib._sel_stringWithCString_1, bytes); + return NSObject._(_ret, _lib); + } + static NSMutableString new1(StringTestObjCLibrary _lib) { final _ret = _lib._objc_msgSend_1(_lib._class_NSMutableString1, _lib._sel_new1); @@ -4106,13 +8296,171 @@ class NSSimpleCString extends NSString { return NSSimpleCString._(other, lib); } - static NSString stringWithCString_encoding( - StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { + static NSString localizedNameOfStringEncoding( + StringTestObjCLibrary _lib, int encoding) { final _ret = _lib._objc_msgSend_14(_lib._class_NSSimpleCString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); + _lib._sel_localizedNameOfStringEncoding_1, encoding); return NSString._(_ret, _lib); } + static NSSimpleCString string(StringTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSSimpleCString1, _lib._sel_string1); + return NSSimpleCString._(_ret, _lib); + } + + static NSSimpleCString stringWithString( + StringTestObjCLibrary _lib, NSObject? string) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSSimpleCString1, + _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); + return NSSimpleCString._(_ret, _lib); + } + + static NSSimpleCString stringWithCharacters_length( + StringTestObjCLibrary _lib, ffi.Pointer characters, int length) { + final _ret = _lib._objc_msgSend_54(_lib._class_NSSimpleCString1, + _lib._sel_stringWithCharacters_length_1, characters, length); + return NSSimpleCString._(_ret, _lib); + } + + static NSSimpleCString stringWithUTF8String(StringTestObjCLibrary _lib, + ffi.Pointer nullTerminatedCString) { + final _ret = _lib._objc_msgSend_55(_lib._class_NSSimpleCString1, + _lib._sel_stringWithUTF8String_1, nullTerminatedCString); + return NSSimpleCString._(_ret, _lib); + } + + static NSSimpleCString stringWithFormat( + StringTestObjCLibrary _lib, NSObject? format) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSSimpleCString1, + _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); + return NSSimpleCString._(_ret, _lib); + } + + static NSSimpleCString localizedStringWithFormat( + StringTestObjCLibrary _lib, NSObject? format) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSSimpleCString1, + _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); + return NSSimpleCString._(_ret, _lib); + } + + static NSSimpleCString stringWithCString_encoding( + StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { + final _ret = _lib._objc_msgSend_63(_lib._class_NSSimpleCString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); + return NSSimpleCString._(_ret, _lib); + } + + static NSSimpleCString stringWithContentsOfURL_encoding_error( + StringTestObjCLibrary _lib, + NSObject? url, + int enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_64( + _lib._class_NSSimpleCString1, + _lib._sel_stringWithContentsOfURL_encoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSSimpleCString._(_ret, _lib); + } + + static NSSimpleCString stringWithContentsOfFile_encoding_error( + StringTestObjCLibrary _lib, + NSObject? path, + int enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_64( + _lib._class_NSSimpleCString1, + _lib._sel_stringWithContentsOfFile_encoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSSimpleCString._(_ret, _lib); + } + + static NSSimpleCString stringWithContentsOfURL_usedEncoding_error( + StringTestObjCLibrary _lib, + NSObject? url, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_65( + _lib._class_NSSimpleCString1, + _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSSimpleCString._(_ret, _lib); + } + + static NSSimpleCString stringWithContentsOfFile_usedEncoding_error( + StringTestObjCLibrary _lib, + NSObject? path, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_65( + _lib._class_NSSimpleCString1, + _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSSimpleCString._(_ret, _lib); + } + + static void availableStringEncodings(StringTestObjCLibrary _lib) { + _lib._objc_msgSend_0( + _lib._class_NSSimpleCString1, _lib._sel_availableStringEncodings1); + } + + static void defaultCStringEncoding(StringTestObjCLibrary _lib) { + _lib._objc_msgSend_0( + _lib._class_NSSimpleCString1, _lib._sel_defaultCStringEncoding1); + } + + static int + stringEncodingForData_encodingOptions_convertedString_usedLossyConversion( + StringTestObjCLibrary _lib, + NSObject? data, + NSObject? opts, + ffi.Pointer> string, + ffi.Pointer usedLossyConversion) { + return _lib._objc_msgSend_66( + _lib._class_NSSimpleCString1, + _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, + data?._id ?? ffi.nullptr, + opts?._id ?? ffi.nullptr, + string, + usedLossyConversion); + } + + static NSObject stringWithContentsOfFile( + StringTestObjCLibrary _lib, NSObject? path) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSSimpleCString1, + _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + static NSObject stringWithContentsOfURL( + StringTestObjCLibrary _lib, NSObject? url) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSSimpleCString1, + _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + static NSObject stringWithCString_length( + StringTestObjCLibrary _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_63(_lib._class_NSSimpleCString1, + _lib._sel_stringWithCString_length_1, bytes, length); + return NSObject._(_ret, _lib); + } + + static NSObject stringWithCString( + StringTestObjCLibrary _lib, ffi.Pointer bytes) { + final _ret = _lib._objc_msgSend_55( + _lib._class_NSSimpleCString1, _lib._sel_stringWithCString_1, bytes); + return NSObject._(_ret, _lib); + } + static NSSimpleCString new1(StringTestObjCLibrary _lib) { final _ret = _lib._objc_msgSend_1(_lib._class_NSSimpleCString1, _lib._sel_new1); @@ -4139,13 +8487,171 @@ class NSConstantString extends NSSimpleCString { return NSConstantString._(other, lib); } - static NSString stringWithCString_encoding( - StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { + static NSString localizedNameOfStringEncoding( + StringTestObjCLibrary _lib, int encoding) { final _ret = _lib._objc_msgSend_14(_lib._class_NSConstantString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); + _lib._sel_localizedNameOfStringEncoding_1, encoding); return NSString._(_ret, _lib); } + static NSConstantString string(StringTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSConstantString1, _lib._sel_string1); + return NSConstantString._(_ret, _lib); + } + + static NSConstantString stringWithString( + StringTestObjCLibrary _lib, NSObject? string) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSConstantString1, + _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); + return NSConstantString._(_ret, _lib); + } + + static NSConstantString stringWithCharacters_length( + StringTestObjCLibrary _lib, ffi.Pointer characters, int length) { + final _ret = _lib._objc_msgSend_54(_lib._class_NSConstantString1, + _lib._sel_stringWithCharacters_length_1, characters, length); + return NSConstantString._(_ret, _lib); + } + + static NSConstantString stringWithUTF8String(StringTestObjCLibrary _lib, + ffi.Pointer nullTerminatedCString) { + final _ret = _lib._objc_msgSend_55(_lib._class_NSConstantString1, + _lib._sel_stringWithUTF8String_1, nullTerminatedCString); + return NSConstantString._(_ret, _lib); + } + + static NSConstantString stringWithFormat( + StringTestObjCLibrary _lib, NSObject? format) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSConstantString1, + _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); + return NSConstantString._(_ret, _lib); + } + + static NSConstantString localizedStringWithFormat( + StringTestObjCLibrary _lib, NSObject? format) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSConstantString1, + _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); + return NSConstantString._(_ret, _lib); + } + + static NSConstantString stringWithCString_encoding( + StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { + final _ret = _lib._objc_msgSend_63(_lib._class_NSConstantString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); + return NSConstantString._(_ret, _lib); + } + + static NSConstantString stringWithContentsOfURL_encoding_error( + StringTestObjCLibrary _lib, + NSObject? url, + int enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_64( + _lib._class_NSConstantString1, + _lib._sel_stringWithContentsOfURL_encoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSConstantString._(_ret, _lib); + } + + static NSConstantString stringWithContentsOfFile_encoding_error( + StringTestObjCLibrary _lib, + NSObject? path, + int enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_64( + _lib._class_NSConstantString1, + _lib._sel_stringWithContentsOfFile_encoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSConstantString._(_ret, _lib); + } + + static NSConstantString stringWithContentsOfURL_usedEncoding_error( + StringTestObjCLibrary _lib, + NSObject? url, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_65( + _lib._class_NSConstantString1, + _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSConstantString._(_ret, _lib); + } + + static NSConstantString stringWithContentsOfFile_usedEncoding_error( + StringTestObjCLibrary _lib, + NSObject? path, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_65( + _lib._class_NSConstantString1, + _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSConstantString._(_ret, _lib); + } + + static void availableStringEncodings(StringTestObjCLibrary _lib) { + _lib._objc_msgSend_0( + _lib._class_NSConstantString1, _lib._sel_availableStringEncodings1); + } + + static void defaultCStringEncoding(StringTestObjCLibrary _lib) { + _lib._objc_msgSend_0( + _lib._class_NSConstantString1, _lib._sel_defaultCStringEncoding1); + } + + static int + stringEncodingForData_encodingOptions_convertedString_usedLossyConversion( + StringTestObjCLibrary _lib, + NSObject? data, + NSObject? opts, + ffi.Pointer> string, + ffi.Pointer usedLossyConversion) { + return _lib._objc_msgSend_66( + _lib._class_NSConstantString1, + _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, + data?._id ?? ffi.nullptr, + opts?._id ?? ffi.nullptr, + string, + usedLossyConversion); + } + + static NSObject stringWithContentsOfFile( + StringTestObjCLibrary _lib, NSObject? path) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSConstantString1, + _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + static NSObject stringWithContentsOfURL( + StringTestObjCLibrary _lib, NSObject? url) { + final _ret = _lib._objc_msgSend_13(_lib._class_NSConstantString1, + _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + static NSObject stringWithCString_length( + StringTestObjCLibrary _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_63(_lib._class_NSConstantString1, + _lib._sel_stringWithCString_length_1, bytes, length); + return NSObject._(_ret, _lib); + } + + static NSObject stringWithCString( + StringTestObjCLibrary _lib, ffi.Pointer bytes) { + final _ret = _lib._objc_msgSend_55( + _lib._class_NSConstantString1, _lib._sel_stringWithCString_1, bytes); + return NSObject._(_ret, _lib); + } + static NSConstantString new1(StringTestObjCLibrary _lib) { final _ret = _lib._objc_msgSend_1(_lib._class_NSConstantString1, _lib._sel_new1); @@ -4174,7 +8680,7 @@ class StringUtil extends NSObject { static NSString strConcat_with( StringTestObjCLibrary _lib, NSObject? a, NSObject? b) { - final _ret = _lib._objc_msgSend_80( + final _ret = _lib._objc_msgSend_48( _lib._class_StringUtil1, _lib._sel_strConcat_with_1, a?._id ?? ffi.nullptr, diff --git a/pkgs/ffigen/test/regen.dart b/pkgs/ffigen/test/regen.dart index 01fb806bc4..d0a6a4f6be 100644 --- a/pkgs/ffigen/test/regen.dart +++ b/pkgs/ffigen/test/regen.dart @@ -79,6 +79,11 @@ Future main(List args) async { File('test/native_objc_test/cast_bindings.dart'), ); + await _regenConfig( + File('test/native_objc_test/category_config.yaml'), + File('test/native_objc_test/category_bindings.dart'), + ); + await _regenConfig( File('test/native_objc_test/method_config.yaml'), File('test/native_objc_test/method_bindings.dart'), From 287abc4aba4d52ed98d7fc204ad933571accc8c1 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Tue, 3 May 2022 10:01:57 -0700 Subject: [PATCH 132/276] [ffigen] Block support (#333) * WIP: Blocks * Move ObjCBuiltInFunctions to its own file and its singleton to data.dart * Block parsing * Add a test * More WIP on blocks * WIP test * Test is working (with a few hacks) * Add pointer getter * Default values for exceptional return * Fix tests * Fix analysis errors * Update test expectations * Merge cruft * Merge --- pkgs/ffigen/lib/src/code_generator.dart | 1 + .../src/code_generator/binding_string.dart | 1 + .../lib/src/code_generator/compound.dart | 2 + .../lib/src/code_generator/enum_class.dart | 3 + .../lib/src/code_generator/imports.dart | 38 +- .../lib/src/code_generator/native_type.dart | 34 +- .../lib/src/code_generator/objc_block.dart | 109 + .../objc_built_in_functions.dart | 67 +- .../src/code_generator/objc_interface.dart | 17 +- .../ffigen/lib/src/code_generator/struct.dart | 2 + pkgs/ffigen/lib/src/code_generator/type.dart | 10 + .../lib/src/code_generator/typealias.dart | 4 + .../sub_parsers/objc_block_parser.dart | 40 + .../type_extractor/extractor.dart | 15 +- pkgs/ffigen/lib/src/header_parser/utils.dart | 3 + .../_expected_objc_basic_types_bindings.dart | 70 +- .../test/native_objc_test/block_bindings.dart | 1519 ++++++++++ .../test/native_objc_test/block_config.yaml | 12 + .../test/native_objc_test/block_test.dart | 73 + .../ffigen/test/native_objc_test/block_test.m | 42 + .../native_objc_test_bindings.dart | 2589 +++++++++++----- pkgs/ffigen/test/native_objc_test/setup.dart | 1 + .../native_objc_test/string_bindings.dart | 2659 +++++++++++------ pkgs/ffigen/test/regen.dart | 5 + 24 files changed, 5637 insertions(+), 1679 deletions(-) create mode 100644 pkgs/ffigen/lib/src/code_generator/objc_block.dart create mode 100644 pkgs/ffigen/lib/src/header_parser/sub_parsers/objc_block_parser.dart create mode 100644 pkgs/ffigen/test/native_objc_test/block_bindings.dart create mode 100644 pkgs/ffigen/test/native_objc_test/block_config.yaml create mode 100644 pkgs/ffigen/test/native_objc_test/block_test.dart create mode 100644 pkgs/ffigen/test/native_objc_test/block_test.m diff --git a/pkgs/ffigen/lib/src/code_generator.dart b/pkgs/ffigen/lib/src/code_generator.dart index f599c7b8fd..82b2ed6b32 100644 --- a/pkgs/ffigen/lib/src/code_generator.dart +++ b/pkgs/ffigen/lib/src/code_generator.dart @@ -16,6 +16,7 @@ export 'code_generator/handle.dart'; export 'code_generator/imports.dart'; export 'code_generator/library.dart'; export 'code_generator/native_type.dart'; +export 'code_generator/objc_block.dart'; export 'code_generator/objc_built_in_functions.dart'; export 'code_generator/objc_interface.dart'; export 'code_generator/pointer.dart'; diff --git a/pkgs/ffigen/lib/src/code_generator/binding_string.dart b/pkgs/ffigen/lib/src/code_generator/binding_string.dart index 84c4da8bdc..decfd6fc90 100644 --- a/pkgs/ffigen/lib/src/code_generator/binding_string.dart +++ b/pkgs/ffigen/lib/src/code_generator/binding_string.dart @@ -24,4 +24,5 @@ enum BindingStringType { enumClass, typeDef, objcInterface, + objcBlock, } diff --git a/pkgs/ffigen/lib/src/code_generator/compound.dart b/pkgs/ffigen/lib/src/code_generator/compound.dart index 2656e04c10..ec994cdfea 100644 --- a/pkgs/ffigen/lib/src/code_generator/compound.dart +++ b/pkgs/ffigen/lib/src/code_generator/compound.dart @@ -43,12 +43,14 @@ abstract class Compound extends BindingType { this.pack, String? dartDoc, List? members, + bool isInternal = false, }) : members = members ?? [], super( usr: usr, originalName: originalName, name: name, dartDoc: dartDoc, + isInternal: isInternal, ); factory Compound.fromType({ diff --git a/pkgs/ffigen/lib/src/code_generator/enum_class.dart b/pkgs/ffigen/lib/src/code_generator/enum_class.dart index 07b9eede31..4e8ec3aac2 100644 --- a/pkgs/ffigen/lib/src/code_generator/enum_class.dart +++ b/pkgs/ffigen/lib/src/code_generator/enum_class.dart @@ -85,6 +85,9 @@ class EnumClass extends BindingType { @override String getDartType(Writer w) => nativeType.getDartType(w); + + @override + String? getDefaultValue(Writer w, String nativeLib) => '0'; } /// Represents a single value in an enum. diff --git a/pkgs/ffigen/lib/src/code_generator/imports.dart b/pkgs/ffigen/lib/src/code_generator/imports.dart index 1a516112b7..44e6f04331 100644 --- a/pkgs/ffigen/lib/src/code_generator/imports.dart +++ b/pkgs/ffigen/lib/src/code_generator/imports.dart @@ -28,8 +28,10 @@ class ImportedType extends Type { final LibraryImport libraryImport; final String cType; final String dartType; + final String? defaultValue; - ImportedType(this.libraryImport, this.cType, this.dartType); + ImportedType(this.libraryImport, this.cType, this.dartType, + [this.defaultValue]); @override String getCType(Writer w) => '${libraryImport.prefix}.$cType'; @@ -39,6 +41,9 @@ class ImportedType extends Type { @override String toString() => '${libraryImport.name}.$cType'; + + @override + String? getDefaultValue(Writer w, String nativeLib) => defaultValue; } final ffiImport = LibraryImport('ffi', 'dart:ffi'); @@ -46,24 +51,25 @@ final ffiPkgImport = LibraryImport('pkg_ffi', 'package:ffi/ffi.dart'); final voidType = ImportedType(ffiImport, 'Void', 'void'); -final unsignedCharType = ImportedType(ffiPkgImport, 'UnsignedChar', 'int'); -final signedCharType = ImportedType(ffiPkgImport, 'SignedChar', 'int'); -final charType = ImportedType(ffiPkgImport, 'Char', 'int'); -final unsignedShortType = ImportedType(ffiPkgImport, 'UnsignedShort', 'int'); -final shortType = ImportedType(ffiPkgImport, 'Short', 'int'); -final unsignedIntType = ImportedType(ffiPkgImport, 'UnsignedInt', 'int'); -final intType = ImportedType(ffiPkgImport, 'Int', 'int'); -final unsignedLongType = ImportedType(ffiPkgImport, 'UnsignedLong', 'int'); -final longType = ImportedType(ffiPkgImport, 'Long', 'int'); +final unsignedCharType = ImportedType(ffiPkgImport, 'UnsignedChar', 'int', '0'); +final signedCharType = ImportedType(ffiPkgImport, 'SignedChar', 'int', '0'); +final charType = ImportedType(ffiPkgImport, 'Char', 'int', '0'); +final unsignedShortType = + ImportedType(ffiPkgImport, 'UnsignedShort', 'int', '0'); +final shortType = ImportedType(ffiPkgImport, 'Short', 'int', '0'); +final unsignedIntType = ImportedType(ffiPkgImport, 'UnsignedInt', 'int', '0'); +final intType = ImportedType(ffiPkgImport, 'Int', 'int', '0'); +final unsignedLongType = ImportedType(ffiPkgImport, 'UnsignedLong', 'int', '0'); +final longType = ImportedType(ffiPkgImport, 'Long', 'int', '0'); final unsignedLongLongType = - ImportedType(ffiPkgImport, 'UnsignedLongLong', 'int'); -final longLongType = ImportedType(ffiPkgImport, 'LongLong', 'int'); + ImportedType(ffiPkgImport, 'UnsignedLongLong', 'int', '0'); +final longLongType = ImportedType(ffiPkgImport, 'LongLong', 'int', '0'); -final floatType = ImportedType(ffiImport, 'Float', 'double'); -final doubleType = ImportedType(ffiImport, 'Double', 'double'); +final floatType = ImportedType(ffiImport, 'Float', 'double', '0'); +final doubleType = ImportedType(ffiImport, 'Double', 'double', '0'); -final sizeType = ImportedType(ffiPkgImport, 'Size', 'int'); -final wCharType = ImportedType(ffiPkgImport, 'WChar', 'int'); +final sizeType = ImportedType(ffiPkgImport, 'Size', 'int', '0'); +final wCharType = ImportedType(ffiPkgImport, 'WChar', 'int', '0'); final objCObjectType = Struct(name: 'ObjCObject'); final objCSelType = Struct(name: 'ObjCSel'); diff --git a/pkgs/ffigen/lib/src/code_generator/native_type.dart b/pkgs/ffigen/lib/src/code_generator/native_type.dart index ea65169395..e05d170f22 100644 --- a/pkgs/ffigen/lib/src/code_generator/native_type.dart +++ b/pkgs/ffigen/lib/src/code_generator/native_type.dart @@ -25,25 +25,26 @@ enum SupportedNativeType { /// Represents a primitive native type, such as float. class NativeType extends Type { static const _primitives = { - SupportedNativeType.Void: NativeType._('Void', 'void'), - SupportedNativeType.Char: NativeType._('Uint8', 'int'), - SupportedNativeType.Int8: NativeType._('Int8', 'int'), - SupportedNativeType.Int16: NativeType._('Int16', 'int'), - SupportedNativeType.Int32: NativeType._('Int32', 'int'), - SupportedNativeType.Int64: NativeType._('Int64', 'int'), - SupportedNativeType.Uint8: NativeType._('Uint8', 'int'), - SupportedNativeType.Uint16: NativeType._('Uint16', 'int'), - SupportedNativeType.Uint32: NativeType._('Uint32', 'int'), - SupportedNativeType.Uint64: NativeType._('Uint64', 'int'), - SupportedNativeType.Float: NativeType._('Float', 'double'), - SupportedNativeType.Double: NativeType._('Double', 'double'), - SupportedNativeType.IntPtr: NativeType._('IntPtr', 'int'), + SupportedNativeType.Void: NativeType._('Void', 'void', null), + SupportedNativeType.Char: NativeType._('Uint8', 'int', '0'), + SupportedNativeType.Int8: NativeType._('Int8', 'int', '0'), + SupportedNativeType.Int16: NativeType._('Int16', 'int', '0'), + SupportedNativeType.Int32: NativeType._('Int32', 'int', '0'), + SupportedNativeType.Int64: NativeType._('Int64', 'int', '0'), + SupportedNativeType.Uint8: NativeType._('Uint8', 'int', '0'), + SupportedNativeType.Uint16: NativeType._('Uint16', 'int', '0'), + SupportedNativeType.Uint32: NativeType._('Uint32', 'int', '0'), + SupportedNativeType.Uint64: NativeType._('Uint64', 'int', '0'), + SupportedNativeType.Float: NativeType._('Float', 'double', '0'), + SupportedNativeType.Double: NativeType._('Double', 'double', '0'), + SupportedNativeType.IntPtr: NativeType._('IntPtr', 'int', '0'), }; final String _cType; final String _dartType; + final String? _defaultValue; - const NativeType._(this._cType, this._dartType); + const NativeType._(this._cType, this._dartType, this._defaultValue); factory NativeType(SupportedNativeType type) => _primitives[type]!; @@ -58,11 +59,14 @@ class NativeType extends Type { @override String cacheKey() => _cType; + + @override + String? getDefaultValue(Writer w, String nativeLib) => _defaultValue; } class BooleanType extends NativeType { // Booleans are treated as uint8. - const BooleanType._() : super._('Uint8', 'int'); + const BooleanType._() : super._('Uint8', 'int', '0'); static const _boolean = BooleanType._(); factory BooleanType() => _boolean; diff --git a/pkgs/ffigen/lib/src/code_generator/objc_block.dart b/pkgs/ffigen/lib/src/code_generator/objc_block.dart new file mode 100644 index 0000000000..04f4c0b5f4 --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/objc_block.dart @@ -0,0 +1,109 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; + +import 'binding_string.dart'; +import 'writer.dart'; + +class ObjCBlock extends BindingType { + final Type returnType; + final List argTypes; + final ObjCBuiltInFunctions builtInFunctions; + + ObjCBlock({ + required String usr, + required String name, + required this.returnType, + required this.argTypes, + required this.builtInFunctions, + }) : super( + usr: usr, + originalName: name, + name: name, + ); + + @override + BindingString toBindingString(Writer w) { + final s = StringBuffer(); + + final params = []; + for (int i = 0; i < argTypes.length; ++i) { + params.add(Parameter(name: 'arg$i', type: argTypes[i])); + } + + final isVoid = returnType == NativeType(SupportedNativeType.Void); + final blockPtr = PointerType(builtInFunctions.blockStruct); + final funcType = FunctionType(returnType: returnType, parameters: params); + final natFnType = NativeFunc(funcType); + final natFnPtr = PointerType(natFnType).getCType(w); + final funcPtrTrampoline = + w.topLevelUniqueNamer.makeUnique('_${name}_fnPtrTrampoline'); + final trampFuncType = FunctionType( + returnType: returnType, + parameters: [Parameter(type: blockPtr, name: 'block'), ...params]); + + // Write the function pointer based trampoline function. + s.write(returnType.getDartType(w)); + s.write(' $funcPtrTrampoline(${blockPtr.getCType(w)} block'); + for (int i = 0; i < params.length; ++i) { + s.write(', ${params[i].type.getDartType(w)} ${params[i].name}'); + } + s.write(') {\n'); + s.write(' ${isVoid ? '' : 'return '}block.ref.target.cast<' + '${natFnType.getDartType(w)}>().asFunction<' + '${funcType.getDartType(w)}>()('); + for (int i = 0; i < params.length; ++i) { + s.write('${i == 0 ? '' : ', '}${params[i].name}'); + } + s.write(');\n'); + s.write('}\n'); + + // Write the wrapper class. + s.write('class $name {\n'); + s.write(' final ${blockPtr.getCType(w)} _impl;\n'); + s.write(' final ${w.className} _lib;\n'); + s.write(' $name._(this._impl, this._lib);\n'); + + // Constructor from a function pointer. + final defaultValue = returnType.getDefaultValue(w, '_lib'); + final exceptionalReturn = defaultValue == null ? '' : ', $defaultValue'; + s.write('\n'); + s.write(' $name.fromFunctionPointer(this._lib, $natFnPtr ptr)'); + s.write(' : _impl = _lib.${builtInFunctions.newBlock.name}(' + '${w.ffiLibraryPrefix}.Pointer.fromFunction<' + '${trampFuncType.getCType(w)}>($funcPtrTrampoline' + '$exceptionalReturn).cast(), ptr.cast());\n'); + + // Get the pointer to the underlying block. + s.write(' ${blockPtr.getCType(w)} get pointer => _impl;\n'); + + s.write('}\n'); + return BindingString( + type: BindingStringType.objcBlock, string: s.toString()); + } + + @override + void addDependencies(Set dependencies) { + if (dependencies.contains(this)) return; + dependencies.add(this); + + returnType.addDependencies(dependencies); + for (final t in argTypes) { + t.addDependencies(dependencies); + } + + builtInFunctions.newBlockDesc.addDependencies(dependencies); + builtInFunctions.blockDescSingleton.addDependencies(dependencies); + builtInFunctions.blockStruct.addDependencies(dependencies); + builtInFunctions.newBlock.addDependencies(dependencies); + } + + @override + String getCType(Writer w) => + PointerType(builtInFunctions.blockStruct).getCType(w); + + @override + String toString() => '($returnType (^)(${argTypes.join(', ')}))'; +} diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index 3f0a647e9b..7babb2b6d1 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -77,6 +77,66 @@ class ObjCBuiltInFunctions { () => '${registerName.name}("$methodName")'); } + // See https://clang.llvm.org/docs/Block-ABI-Apple.html + late final blockStruct = Struct( + name: '_ObjCBlock', + isInternal: true, + members: [ + Member(name: 'isa', type: PointerType(voidType)), + Member(name: 'flags', type: intType), + Member(name: 'reserved', type: intType), + Member(name: 'invoke', type: PointerType(voidType)), + Member(name: 'descriptor', type: PointerType(blockDescStruct)), + Member(name: 'target', type: PointerType(voidType)), + ], + ); + late final blockDescStruct = Struct( + name: '_ObjCBlockDesc', + isInternal: true, + members: [ + Member(name: 'reserved', type: unsignedLongType), + Member(name: 'size', type: unsignedLongType), + Member(name: 'copy_helper', type: PointerType(voidType)), + Member(name: 'dispose_helper', type: PointerType(voidType)), + Member(name: 'signature', type: PointerType(charType)), + ], + ); + late final newBlockDesc = + ObjCInternalFunction('_newBlockDesc', null, (Writer w, String name) { + final s = StringBuffer(); + final blockType = blockStruct.getCType(w); + final descType = blockDescStruct.getCType(w); + final descPtr = PointerType(blockDescStruct).getCType(w); + s.write('\n$descPtr $name() {\n'); + s.write(' final d = ${w.ffiPkgLibraryPrefix}.calloc.allocate<$descType>(' + '${w.ffiLibraryPrefix}.sizeOf<$descType>());\n'); + s.write(' d.ref.size = ${w.ffiLibraryPrefix}.sizeOf<$blockType>();\n'); + s.write(' return d;\n'); + s.write('}\n'); + return s.toString(); + }); + late final blockDescSingleton = ObjCInternalGlobal( + PointerType(blockDescStruct), + '_objc_block_desc', + () => '${newBlockDesc.name}()', + ); + late final newBlock = + ObjCInternalFunction('_newBlock', null, (Writer w, String name) { + final s = StringBuffer(); + final blockType = blockStruct.getCType(w); + final blockPtr = PointerType(blockStruct).getCType(w); + final voidPtr = PointerType(voidType).getCType(w); + s.write('\n$blockPtr $name($voidPtr invoke, $voidPtr target) {\n'); + s.write(' final b = ${w.ffiPkgLibraryPrefix}.calloc.allocate<$blockType>(' + '${w.ffiLibraryPrefix}.sizeOf<$blockType>());\n'); + s.write(' b.ref.invoke = invoke;\n'); + s.write(' b.ref.target = target;\n'); + s.write(' b.ref.descriptor = ${blockDescSingleton.name};\n'); + s.write(' return b;\n'); + s.write('}\n'); + return s.toString(); + }); + bool utilsExist = false; void ensureUtilsExist(Writer w, StringBuffer s) { if (utilsExist) return; @@ -137,9 +197,10 @@ class _ObjCWrapper { } } -/// Functions only used internally by ObjC bindings, such as getClass. +/// Functions only used internally by ObjC bindings, which may or may not wrap a +/// native function, such as getClass. class ObjCInternalFunction extends LookUpBinding { - final Func _wrappedFunction; + final Func? _wrappedFunction; final String Function(Writer, String) _toBindingString; ObjCInternalFunction( @@ -157,7 +218,7 @@ class ObjCInternalFunction extends LookUpBinding { void addDependencies(Set dependencies) { if (dependencies.contains(this)) return; dependencies.add(this); - _wrappedFunction.addDependencies(dependencies); + _wrappedFunction?.addDependencies(dependencies); } } diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index bddaec9f26..70fa7f2e63 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -308,11 +308,15 @@ class ObjCInterface extends BindingType { // passed to native as Pointer, but the user sees the Dart wrapper // class. These methods need to be kept in sync. bool _needsConverting(Type type) => - type is ObjCInterface || _isObject(type) || _isInstanceType(type); + type is ObjCInterface || + type is ObjCBlock || + _isObject(type) || + _isInstanceType(type); String _getConvertedType(Type type, Writer w, String enclosingClass) { if (type is BooleanType) return 'bool'; if (type is ObjCInterface) return type.name; + if (type is ObjCBlock) return type.name; if (_isObject(type)) return 'NSObject'; if (_isInstanceType(type)) return enclosingClass; return type.getDartType(w); @@ -330,11 +334,13 @@ class ObjCInterface extends BindingType { String _doArgConversion(ObjCMethodParam arg) { if (arg.type is ObjCInterface || _isObject(arg.type) || - _isInstanceType(arg.type)) { + _isInstanceType(arg.type) || + arg.type is ObjCBlock) { + final field = arg.type is ObjCBlock ? '_impl' : '_id'; if (arg.isNullable) { - return '${arg.name}?._id ?? ffi.nullptr'; + return '${arg.name}?.$field ?? ffi.nullptr'; } else { - return '${arg.name}._id'; + return '${arg.name}.$field'; } } return arg.name; @@ -349,6 +355,9 @@ class ObjCInterface extends BindingType { if (type is ObjCInterface) { return prefix + '${type.name}._($value, $library)'; } + if (type is ObjCBlock) { + return prefix + '${type.name}._($value, $library)'; + } if (_isObject(type)) { return prefix + 'NSObject._($value, $library)'; } diff --git a/pkgs/ffigen/lib/src/code_generator/struct.dart b/pkgs/ffigen/lib/src/code_generator/struct.dart index f430d0f81f..c65e04b992 100644 --- a/pkgs/ffigen/lib/src/code_generator/struct.dart +++ b/pkgs/ffigen/lib/src/code_generator/struct.dart @@ -37,6 +37,7 @@ class Struct extends Compound { int? pack, String? dartDoc, List? members, + bool isInternal = false, }) : super( usr: usr, originalName: originalName, @@ -46,5 +47,6 @@ class Struct extends Compound { members: members, pack: pack, compoundType: CompoundType.struct, + isInternal: isInternal, ); } diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index 0ad138ffef..8468eca3a1 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -54,6 +54,11 @@ abstract class Type { /// specific key. Types that are already deduped don't need to override this. /// toString() is not a valid cache key as there may be name collisions. String cacheKey() => hashCode.toRadixString(36); + + /// Returns a string of code that creates a default value for this type. For + /// example, for int types this returns the string '0'. A null return means + /// that default values aren't supported for this type, eg void. + String? getDefaultValue(Writer w, String nativeLib) => null; } /// Function to check if the dart and C type string are same. @@ -70,11 +75,13 @@ abstract class BindingType extends NoLookUpBinding implements Type { String? originalName, required String name, String? dartDoc, + bool isInternal = false, }) : super( usr: usr, originalName: originalName, name: name, dartDoc: dartDoc, + isInternal: isInternal, ); @override @@ -97,6 +104,9 @@ abstract class BindingType extends NoLookUpBinding implements Type { @override String cacheKey() => hashCode.toRadixString(36); + + @override + String? getDefaultValue(Writer w, String nativeLib) => null; } /// Represents an unimplemented type. Used as a marker, so that declarations diff --git a/pkgs/ffigen/lib/src/code_generator/typealias.dart b/pkgs/ffigen/lib/src/code_generator/typealias.dart index 9211ae8454..f42e863601 100644 --- a/pkgs/ffigen/lib/src/code_generator/typealias.dart +++ b/pkgs/ffigen/lib/src/code_generator/typealias.dart @@ -79,4 +79,8 @@ class Typealias extends BindingType { @override String cacheKey() => type.cacheKey(); + + @override + String? getDefaultValue(Writer w, String nativeLib) => + type.getDefaultValue(w, nativeLib); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objc_block_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objc_block_parser.dart new file mode 100644 index 0000000000..83f82234a9 --- /dev/null +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objc_block_parser.dart @@ -0,0 +1,40 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser/data.dart'; +import 'package:logging/logging.dart'; + +import '../clang_bindings/clang_bindings.dart' as clang_types; +import '../utils.dart'; + +final _logger = Logger('ffigen.header_parser.objc_block_parser'); + +ObjCBlock parseObjCBlock(clang_types.CXType cxtype) { + final blk = clang.clang_getPointeeType(cxtype); + final returnType = clang.clang_getResultType(blk).toCodeGenType(); + final argTypes = []; + final int numArgs = clang.clang_getNumArgTypes(blk); + for (int i = 0; i < numArgs; ++i) { + argTypes.add(clang.clang_getArgType(blk, i).toCodeGenType()); + } + + // Create a fake USR code for the block. This code is used to dedupe blocks + // with the same signature. + var usr = 'objcBlock: ' + returnType.cacheKey(); + for (final type in argTypes) { + usr += ' ' + type.cacheKey(); + } + + _logger.fine('++++ Adding ObjC block: ' + '${cxtype.completeStringRepr()}, syntheticUsr: $usr'); + + return ObjCBlock( + usr: usr.toString(), + name: 'ObjCBlock', + returnType: returnType, + argTypes: argTypes, + builtInFunctions: objCBuiltInFunctions, + ); +} diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index de2a599bf6..1a69715c40 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -13,6 +13,7 @@ import '../clang_bindings/clang_bindings.dart' as clang_types; import '../data.dart'; import '../sub_parsers/compounddecl_parser.dart'; import '../sub_parsers/enumdecl_parser.dart'; +import '../sub_parsers/objc_block_parser.dart'; import '../sub_parsers/objcinterfacedecl_parser.dart'; import '../type_extractor/cxtypekindmap.dart'; import '../utils.dart'; @@ -44,13 +45,14 @@ Type getCodeGenType( if (config.language == Language.objc) { switch (cxtype.kind) { case clang_types.CXTypeKind.CXType_ObjCObjectPointer: - case clang_types.CXTypeKind.CXType_BlockPointer: case clang_types.CXTypeKind.CXType_ObjCId: case clang_types.CXTypeKind.CXType_ObjCTypeParam: case clang_types.CXTypeKind.CXType_ObjCClass: return PointerType(objCObjectType); case clang_types.CXTypeKind.CXType_ObjCSel: return PointerType(objCSelType); + case clang_types.CXTypeKind.CXType_BlockPointer: + return _getOrCreateBlockType(cxtype); } } @@ -129,6 +131,17 @@ Type getCodeGenType( } } +Type _getOrCreateBlockType(clang_types.CXType cxtype) { + final block = parseObjCBlock(cxtype); + final key = block.usr; + final oldBlock = bindingsIndex.getSeenObjCBlock(key); + if (oldBlock != null) { + return oldBlock; + } + bindingsIndex.addObjCBlockToSeen(key, block); + return block; +} + class _CreateTypeFromCursorResult { final Type? type; diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index 068b78644b..e8c60cfdd1 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -355,6 +355,7 @@ class BindingsIndex { final Map _unnamedEnumConstants = {}; final Map _macros = {}; final Map _globals = {}; + final Map _objcBlocks = {}; /// Contains usr for typedefs which cannot be generated. final Set _unsupportedTypealiases = {}; @@ -388,4 +389,6 @@ class BindingsIndex { void addHeaderToSeen(String source, bool includeStatus) => _headerCache[source] = includeStatus; bool? getSeenHeaderStatus(String source) => _headerCache[source]; + void addObjCBlockToSeen(String key, ObjCBlock t) => _objcBlocks[key] = t; + ObjCBlock? getSeenObjCBlock(String key) => _objcBlocks[key]; } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart index 5fa6fc71b5..b677511666 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart @@ -486,6 +486,22 @@ class NativeLibrary { _registerName1("poseAsClass:"); late final ffi.Pointer _sel_autoContentAccessingProxy1 = _registerName1("autoContentAccessingProxy"); + ffi.Pointer<_ObjCBlockDesc> _newBlockDesc1() { + final d = + pkg_ffi.calloc.allocate<_ObjCBlockDesc>(ffi.sizeOf<_ObjCBlockDesc>()); + d.ref.size = ffi.sizeOf<_ObjCBlock>(); + return d; + } + + late final ffi.Pointer<_ObjCBlockDesc> _objc_block_desc1 = _newBlockDesc1(); + ffi.Pointer<_ObjCBlock> _newBlock1( + ffi.Pointer invoke, ffi.Pointer target) { + final b = pkg_ffi.calloc.allocate<_ObjCBlock>(ffi.sizeOf<_ObjCBlock>()); + b.ref.invoke = invoke; + b.ref.target = target; + b.ref.descriptor = _objc_block_desc1; + return b; + } } class _ObjCWrapper { @@ -791,5 +807,57 @@ class Foo extends ffi.Struct { external ffi.Pointer clazz; - external ffi.Pointer blockThatReturnsAnInt; + external ffi.Pointer<_ObjCBlock> blockThatReturnsAnInt; +} + +int _ObjCBlock_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block) { + return block.ref.target + .cast>() + .asFunction()(); +} + +class ObjCBlock { + final ffi.Pointer<_ObjCBlock> _impl; + final NativeLibrary _lib; + ObjCBlock._(this._impl, this._lib); + + ObjCBlock.fromFunctionPointer( + this._lib, ffi.Pointer> ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Int32 Function(ffi.Pointer<_ObjCBlock> block)>( + _ObjCBlock_fnPtrTrampoline, 0) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class _ObjCBlockDesc extends ffi.Struct { + @pkg_ffi.UnsignedLong() + external int reserved; + + @pkg_ffi.UnsignedLong() + external int size; + + external ffi.Pointer copy_helper; + + external ffi.Pointer dispose_helper; + + external ffi.Pointer signature; +} + +class _ObjCBlock extends ffi.Struct { + external ffi.Pointer isa; + + @pkg_ffi.Int() + external int flags; + + @pkg_ffi.Int() + external int reserved; + + external ffi.Pointer invoke; + + external ffi.Pointer<_ObjCBlockDesc> descriptor; + + external ffi.Pointer target; } diff --git a/pkgs/ffigen/test/native_objc_test/block_bindings.dart b/pkgs/ffigen/test/native_objc_test/block_bindings.dart new file mode 100644 index 0000000000..8ae5e4bfe9 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/block_bindings.dart @@ -0,0 +1,1519 @@ +// ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; + +/// Tests calling Objective-C blocks +class BlockTestObjCLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + BlockTestObjCLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + BlockTestObjCLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + late final ffi.Pointer _NSFoundationVersionNumber = + _lookup('NSFoundationVersionNumber'); + + double get NSFoundationVersionNumber => _NSFoundationVersionNumber.value; + + set NSFoundationVersionNumber(double value) => + _NSFoundationVersionNumber.value = value; + + late final ffi.Pointer _NSNotFound = + _lookup('NSNotFound'); + + int get NSNotFound => _NSNotFound.value; + + set NSNotFound(int value) => _NSNotFound.value = value; + + late final ffi.Pointer _kCFCoreFoundationVersionNumber = + _lookup('kCFCoreFoundationVersionNumber'); + + double get kCFCoreFoundationVersionNumber => + _kCFCoreFoundationVersionNumber.value; + + set kCFCoreFoundationVersionNumber(double value) => + _kCFCoreFoundationVersionNumber.value = value; + + late final ffi.Pointer _kCFNotFound = + _lookup('kCFNotFound'); + + int get kCFNotFound => _kCFNotFound.value; + + set kCFNotFound(int value) => _kCFNotFound.value = value; + + late final ffi.Pointer _kCFNull = _lookup('kCFNull'); + + CFNullRef get kCFNull => _kCFNull.value; + + set kCFNull(CFNullRef value) => _kCFNull.value = value; + + late final ffi.Pointer _kCFAllocatorDefault = + _lookup('kCFAllocatorDefault'); + + CFAllocatorRef get kCFAllocatorDefault => _kCFAllocatorDefault.value; + + set kCFAllocatorDefault(CFAllocatorRef value) => + _kCFAllocatorDefault.value = value; + + late final ffi.Pointer _kCFAllocatorSystemDefault = + _lookup('kCFAllocatorSystemDefault'); + + CFAllocatorRef get kCFAllocatorSystemDefault => + _kCFAllocatorSystemDefault.value; + + set kCFAllocatorSystemDefault(CFAllocatorRef value) => + _kCFAllocatorSystemDefault.value = value; + + late final ffi.Pointer _kCFAllocatorMalloc = + _lookup('kCFAllocatorMalloc'); + + CFAllocatorRef get kCFAllocatorMalloc => _kCFAllocatorMalloc.value; + + set kCFAllocatorMalloc(CFAllocatorRef value) => + _kCFAllocatorMalloc.value = value; + + late final ffi.Pointer _kCFAllocatorMallocZone = + _lookup('kCFAllocatorMallocZone'); + + CFAllocatorRef get kCFAllocatorMallocZone => _kCFAllocatorMallocZone.value; + + set kCFAllocatorMallocZone(CFAllocatorRef value) => + _kCFAllocatorMallocZone.value = value; + + late final ffi.Pointer _kCFAllocatorNull = + _lookup('kCFAllocatorNull'); + + CFAllocatorRef get kCFAllocatorNull => _kCFAllocatorNull.value; + + set kCFAllocatorNull(CFAllocatorRef value) => _kCFAllocatorNull.value = value; + + late final ffi.Pointer _kCFAllocatorUseContext = + _lookup('kCFAllocatorUseContext'); + + CFAllocatorRef get kCFAllocatorUseContext => _kCFAllocatorUseContext.value; + + set kCFAllocatorUseContext(CFAllocatorRef value) => + _kCFAllocatorUseContext.value = value; + + ffi.Pointer _registerName1(String name) { + final cstr = name.toNativeUtf8(); + final sel = _sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; + } + + ffi.Pointer _sel_registerName( + ffi.Pointer str, + ) { + return __sel_registerName( + str, + ); + } + + late final __sel_registerNamePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sel_registerName'); + late final __sel_registerName = __sel_registerNamePtr + .asFunction Function(ffi.Pointer)>(); + + ffi.Pointer _getClass1(String name) { + final cstr = name.toNativeUtf8(); + final clazz = _objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; + } + + ffi.Pointer _objc_getClass( + ffi.Pointer str, + ) { + return __objc_getClass( + str, + ); + } + + late final __objc_getClassPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('objc_getClass'); + late final __objc_getClass = __objc_getClassPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); + + late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); + late final ffi.Pointer _sel_load1 = _registerName1("load"); + void _objc_msgSend_0( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_0( + obj, + sel, + ); + } + + late final __objc_msgSend_0Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_initialize1 = + _registerName1("initialize"); + late final ffi.Pointer _sel_init1 = _registerName1("init"); + instancetype _objc_msgSend_1( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1( + obj, + sel, + ); + } + + late final __objc_msgSend_1Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_new1 = _registerName1("new"); + late final ffi.Pointer _sel_allocWithZone_1 = + _registerName1("allocWithZone:"); + instancetype _objc_msgSend_2( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_2( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_2Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>(); + + late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); + late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); + late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); + late final ffi.Pointer _sel_copy1 = _registerName1("copy"); + late final ffi.Pointer _sel_mutableCopy1 = + _registerName1("mutableCopy"); + late final ffi.Pointer _sel_copyWithZone_1 = + _registerName1("copyWithZone:"); + late final ffi.Pointer _sel_mutableCopyWithZone_1 = + _registerName1("mutableCopyWithZone:"); + late final ffi.Pointer _sel_instancesRespondToSelector_1 = + _registerName1("instancesRespondToSelector:"); + bool _objc_msgSend_3( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_3( + obj, + sel, + aSelector, + ) != + 0; + } + + late final __objc_msgSend_3Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_conformsToProtocol_1 = + _registerName1("conformsToProtocol:"); + bool _objc_msgSend_4( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer protocol, + ) { + return __objc_msgSend_4( + obj, + sel, + protocol, + ) != + 0; + } + + late final __objc_msgSend_4Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_methodForSelector_1 = + _registerName1("methodForSelector:"); + IMP _objc_msgSend_5( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_5( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_5Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_instanceMethodForSelector_1 = + _registerName1("instanceMethodForSelector:"); + late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = + _registerName1("doesNotRecognizeSelector:"); + void _objc_msgSend_6( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_6( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_6Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_forwardingTargetForSelector_1 = + _registerName1("forwardingTargetForSelector:"); + ffi.Pointer _objc_msgSend_7( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_7( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_7Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_forwardInvocation_1 = + _registerName1("forwardInvocation:"); + void _objc_msgSend_8( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anInvocation, + ) { + return __objc_msgSend_8( + obj, + sel, + anInvocation, + ); + } + + late final __objc_msgSend_8Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _class_NSMethodSignature1 = + _getClass1("NSMethodSignature"); + late final ffi.Pointer _sel_methodSignatureForSelector_1 = + _registerName1("methodSignatureForSelector:"); + ffi.Pointer _objc_msgSend_9( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_9( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_9Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = + _registerName1("instanceMethodSignatureForSelector:"); + late final ffi.Pointer _sel_allowsWeakReference1 = + _registerName1("allowsWeakReference"); + bool _objc_msgSend_10( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_10( + obj, + sel, + ) != + 0; + } + + late final __objc_msgSend_10Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_retainWeakReference1 = + _registerName1("retainWeakReference"); + late final ffi.Pointer _sel_isSubclassOfClass_1 = + _registerName1("isSubclassOfClass:"); + late final ffi.Pointer _sel_resolveClassMethod_1 = + _registerName1("resolveClassMethod:"); + late final ffi.Pointer _sel_resolveInstanceMethod_1 = + _registerName1("resolveInstanceMethod:"); + late final ffi.Pointer _sel_hash1 = _registerName1("hash"); + int _objc_msgSend_11( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_11( + obj, + sel, + ); + } + + late final __objc_msgSend_11Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_superclass1 = + _registerName1("superclass"); + late final ffi.Pointer _sel_class1 = _registerName1("class"); + late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); + late final ffi.Pointer _sel_stringWithCString_encoding_1 = + _registerName1("stringWithCString:encoding:"); + ffi.Pointer _objc_msgSend_12( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cString, + int enc, + ) { + return __objc_msgSend_12( + obj, + sel, + cString, + enc, + ); + } + + late final __objc_msgSend_12Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + pkg_ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_UTF8String1 = + _registerName1("UTF8String"); + ffi.Pointer _objc_msgSend_13( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_13( + obj, + sel, + ); + } + + late final __objc_msgSend_13Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_description1 = + _registerName1("description"); + ffi.Pointer _objc_msgSend_14( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_14( + obj, + sel, + ); + } + + late final __objc_msgSend_14Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_debugDescription1 = + _registerName1("debugDescription"); + late final ffi.Pointer _sel_version1 = _registerName1("version"); + int _objc_msgSend_15( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_15( + obj, + sel, + ); + } + + late final __objc_msgSend_15Ptr = _lookup< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_setVersion_1 = + _registerName1("setVersion:"); + void _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + int aVersion, + ) { + return __objc_msgSend_16( + obj, + sel, + aVersion, + ); + } + + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_classForCoder1 = + _registerName1("classForCoder"); + late final ffi.Pointer _sel_replacementObjectForCoder_1 = + _registerName1("replacementObjectForCoder:"); + ffi.Pointer _objc_msgSend_17( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_17( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_17Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = + _registerName1("awakeAfterUsingCoder:"); + late final ffi.Pointer _sel_poseAsClass_1 = + _registerName1("poseAsClass:"); + late final ffi.Pointer _sel_autoContentAccessingProxy1 = + _registerName1("autoContentAccessingProxy"); + late final ffi.Pointer _class_BlockTester1 = + _getClass1("BlockTester"); + ffi.Pointer<_ObjCBlockDesc> _newBlockDesc1() { + final d = + pkg_ffi.calloc.allocate<_ObjCBlockDesc>(ffi.sizeOf<_ObjCBlockDesc>()); + d.ref.size = ffi.sizeOf<_ObjCBlock>(); + return d; + } + + late final ffi.Pointer<_ObjCBlockDesc> _objc_block_desc1 = _newBlockDesc1(); + ffi.Pointer<_ObjCBlock> _newBlock1( + ffi.Pointer invoke, ffi.Pointer target) { + final b = pkg_ffi.calloc.allocate<_ObjCBlock>(ffi.sizeOf<_ObjCBlock>()); + b.ref.invoke = invoke; + b.ref.target = target; + b.ref.descriptor = _objc_block_desc1; + return b; + } + + late final ffi.Pointer _sel_makeFromBlock_1 = + _registerName1("makeFromBlock:"); + ffi.Pointer _objc_msgSend_18( + ffi.Pointer obj, + ffi.Pointer sel, + IntBlock block, + ) { + return __objc_msgSend_18( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_18Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, IntBlock)>>('objc_msgSend'); + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, IntBlock)>(); + + late final ffi.Pointer _sel_makeFromMultiplier_1 = + _registerName1("makeFromMultiplier:"); + ffi.Pointer _objc_msgSend_19( + ffi.Pointer obj, + ffi.Pointer sel, + int mult, + ) { + return __objc_msgSend_19( + obj, + sel, + mult, + ); + } + + late final __objc_msgSend_19Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_call_1 = _registerName1("call:"); + int _objc_msgSend_20( + ffi.Pointer obj, + ffi.Pointer sel, + int x, + ) { + return __objc_msgSend_20( + obj, + sel, + x, + ); + } + + late final __objc_msgSend_20Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_getBlock1 = _registerName1("getBlock"); + IntBlock _objc_msgSend_21( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_21( + obj, + sel, + ); + } + + late final __objc_msgSend_21Ptr = _lookup< + ffi.NativeFunction< + IntBlock Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< + IntBlock Function(ffi.Pointer, ffi.Pointer)>(); +} + +abstract class NSComparisonResult { + static const int NSOrderedAscending = -1; + static const int NSOrderedSame = 0; + static const int NSOrderedDescending = 1; +} + +abstract class NSEnumerationOptions { + static const int NSEnumerationConcurrent = 1; + static const int NSEnumerationReverse = 2; +} + +abstract class NSSortOptions { + static const int NSSortConcurrent = 1; + static const int NSSortStable = 16; +} + +abstract class NSQualityOfService { + static const int NSQualityOfServiceUserInteractive = 33; + static const int NSQualityOfServiceUserInitiated = 25; + static const int NSQualityOfServiceUtility = 17; + static const int NSQualityOfServiceBackground = 9; + static const int NSQualityOfServiceDefault = -1; +} + +typedef NSInteger = pkg_ffi.Long; + +class __CFString extends ffi.Opaque {} + +abstract class CFComparisonResult { + static const int kCFCompareLessThan = -1; + static const int kCFCompareEqualTo = 0; + static const int kCFCompareGreaterThan = 1; +} + +typedef CFIndex = pkg_ffi.Long; + +class CFRange extends ffi.Struct { + @CFIndex() + external int location; + + @CFIndex() + external int length; +} + +class __CFNull extends ffi.Opaque {} + +typedef CFNullRef = ffi.Pointer<__CFNull>; + +class __CFAllocator extends ffi.Opaque {} + +typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; + +class CFAllocatorContext extends ffi.Struct { + @CFIndex() + external int version; + + external ffi.Pointer info; + + external CFAllocatorRetainCallBack retain; + + external CFAllocatorReleaseCallBack release; + + external CFAllocatorCopyDescriptionCallBack copyDescription; + + external CFAllocatorAllocateCallBack allocate; + + external CFAllocatorReallocateCallBack reallocate; + + external CFAllocatorDeallocateCallBack deallocate; + + external CFAllocatorPreferredSizeCallBack preferredSize; +} + +typedef CFAllocatorRetainCallBack = ffi.Pointer< + ffi.NativeFunction Function(ffi.Pointer)>>; +typedef CFAllocatorReleaseCallBack + = ffi.Pointer)>>; +typedef CFAllocatorCopyDescriptionCallBack = ffi + .Pointer)>>; +typedef CFStringRef = ffi.Pointer<__CFString>; +typedef CFAllocatorAllocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + CFIndex, CFOptionFlags, ffi.Pointer)>>; +typedef CFOptionFlags = pkg_ffi.UnsignedLong; +typedef CFAllocatorReallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, CFIndex, + CFOptionFlags, ffi.Pointer)>>; +typedef CFAllocatorDeallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; +typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< + ffi.NativeFunction< + CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; + +class _ObjCWrapper { + final ffi.Pointer _id; + final BlockTestObjCLibrary _lib; + + _ObjCWrapper._(this._id, this._lib); + + @override + bool operator ==(Object other) { + return other is _ObjCWrapper && _id == other._id; + } + + @override + int get hashCode => _id.hashCode; +} + +class NSObject extends _ObjCWrapper { + NSObject._(ffi.Pointer id, BlockTestObjCLibrary lib) + : super._(id, lib); + + static NSObject castFrom(T other) { + return NSObject._(other._id, other._lib); + } + + static NSObject castFromPointer( + BlockTestObjCLibrary lib, ffi.Pointer other) { + return NSObject._(other, lib); + } + + static void load(BlockTestObjCLibrary _lib) { + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); + } + + static void initialize(BlockTestObjCLibrary _lib) { + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); + } + + NSObject init() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); + return NSObject._(_ret, _lib); + } + + static NSObject new1(BlockTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); + return NSObject._(_ret, _lib); + } + + static NSObject allocWithZone( + BlockTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static NSObject alloc(BlockTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); + return NSObject._(_ret, _lib); + } + + void dealloc() { + _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); + } + + void finalize() { + _lib._objc_msgSend_0(_id, _lib._sel_finalize1); + } + + NSObject copy() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); + return NSObject._(_ret, _lib); + } + + NSObject mutableCopy() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); + return NSObject._(_ret, _lib); + } + + static NSObject copyWithZone( + BlockTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static NSObject mutableCopyWithZone( + BlockTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static bool instancesRespondToSelector( + BlockTestObjCLibrary _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_3(_lib._class_NSObject1, + _lib._sel_instancesRespondToSelector_1, aSelector); + } + + static bool conformsToProtocol( + BlockTestObjCLibrary _lib, NSObject? protocol) { + return _lib._objc_msgSend_4(_lib._class_NSObject1, + _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); + } + + IMP methodForSelector(ffi.Pointer aSelector) { + return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); + } + + static IMP instanceMethodForSelector( + BlockTestObjCLibrary _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_5(_lib._class_NSObject1, + _lib._sel_instanceMethodForSelector_1, aSelector); + } + + void doesNotRecognizeSelector(ffi.Pointer aSelector) { + _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); + } + + NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_7( + _id, _lib._sel_forwardingTargetForSelector_1, aSelector); + return NSObject._(_ret, _lib); + } + + void forwardInvocation(NSObject? anInvocation) { + _lib._objc_msgSend_8( + _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); + } + + NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_9( + _id, _lib._sel_methodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static NSMethodSignature instanceMethodSignatureForSelector( + BlockTestObjCLibrary _lib, ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, + _lib._sel_instanceMethodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + bool allowsWeakReference() { + return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); + } + + bool retainWeakReference() { + return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); + } + + static bool isSubclassOfClass(BlockTestObjCLibrary _lib, NSObject aClass) { + return _lib._objc_msgSend_4( + _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); + } + + static bool resolveClassMethod( + BlockTestObjCLibrary _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); + } + + static bool resolveInstanceMethod( + BlockTestObjCLibrary _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); + } + + static int hash(BlockTestObjCLibrary _lib) { + return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); + } + + static NSObject superclass(BlockTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); + return NSObject._(_ret, _lib); + } + + static NSObject class1(BlockTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); + return NSObject._(_ret, _lib); + } + + static NSString description(BlockTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_14(_lib._class_NSObject1, _lib._sel_description1); + return NSString._(_ret, _lib); + } + + static NSString debugDescription(BlockTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_14( + _lib._class_NSObject1, _lib._sel_debugDescription1); + return NSString._(_ret, _lib); + } + + static int version(BlockTestObjCLibrary _lib) { + return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); + } + + static void setVersion(BlockTestObjCLibrary _lib, int aVersion) { + _lib._objc_msgSend_16( + _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); + } + + NSObject get classForCoder { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); + return NSObject._(_ret, _lib); + } + + NSObject replacementObjectForCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + NSObject awakeAfterUsingCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + static void poseAsClass(BlockTestObjCLibrary _lib, NSObject aClass) { + _lib._objc_msgSend_8( + _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); + } + + NSObject get autoContentAccessingProxy { + final _ret = + _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); + return NSObject._(_ret, _lib); + } +} + +class ObjCSel extends ffi.Opaque {} + +class ObjCObject extends ffi.Opaque {} + +typedef instancetype = ffi.Pointer; + +class _NSZone extends ffi.Opaque {} + +typedef IMP = ffi.Pointer>; + +class NSMethodSignature extends _ObjCWrapper { + NSMethodSignature._(ffi.Pointer id, BlockTestObjCLibrary lib) + : super._(id, lib); + + static NSMethodSignature castFrom(T other) { + return NSMethodSignature._(other._id, other._lib); + } + + static NSMethodSignature castFromPointer( + BlockTestObjCLibrary lib, ffi.Pointer other) { + return NSMethodSignature._(other, lib); + } +} + +typedef NSUInteger = pkg_ffi.UnsignedLong; + +class NSString extends _ObjCWrapper { + NSString._(ffi.Pointer id, BlockTestObjCLibrary lib) + : super._(id, lib); + + static NSString castFrom(T other) { + return NSString._(other._id, other._lib); + } + + static NSString castFromPointer( + BlockTestObjCLibrary lib, ffi.Pointer other) { + return NSString._(other, lib); + } + + factory NSString(BlockTestObjCLibrary _lib, String str) { + final cstr = str.toNativeUtf8(); + final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + pkg_ffi.calloc.free(cstr); + return nsstr; + } + + @override + String toString() => (UTF8String).cast().toDartString(); + + static NSString stringWithCString_encoding( + BlockTestObjCLibrary _lib, ffi.Pointer cString, int enc) { + final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); + return NSString._(_ret, _lib); + } + + ffi.Pointer get UTF8String { + return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); + } +} + +extension StringToNSString on String { + NSString toNSString(BlockTestObjCLibrary lib) => NSString(lib, this); +} + +class BlockTester extends NSObject { + BlockTester._(ffi.Pointer id, BlockTestObjCLibrary lib) + : super._(id, lib); + + static BlockTester castFrom(T other) { + return BlockTester._(other._id, other._lib); + } + + static BlockTester castFromPointer( + BlockTestObjCLibrary lib, ffi.Pointer other) { + return BlockTester._(other, lib); + } + + static BlockTester makeFromBlock(BlockTestObjCLibrary _lib, IntBlock block) { + final _ret = _lib._objc_msgSend_18( + _lib._class_BlockTester1, _lib._sel_makeFromBlock_1, block); + return BlockTester._(_ret, _lib); + } + + static BlockTester makeFromMultiplier(BlockTestObjCLibrary _lib, int mult) { + final _ret = _lib._objc_msgSend_19( + _lib._class_BlockTester1, _lib._sel_makeFromMultiplier_1, mult); + return BlockTester._(_ret, _lib); + } + + int call(int x) { + return _lib._objc_msgSend_20(_id, _lib._sel_call_1, x); + } + + IntBlock getBlock() { + return _lib._objc_msgSend_21(_id, _lib._sel_getBlock1); + } + + static BlockTester new1(BlockTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_BlockTester1, _lib._sel_new1); + return BlockTester._(_ret, _lib); + } + + static BlockTester alloc(BlockTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_BlockTester1, _lib._sel_alloc1); + return BlockTester._(_ret, _lib); + } +} + +typedef IntBlock = ffi.Pointer<_ObjCBlock>; +int _ObjCBlock_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, int arg0) { + return block.ref.target + .cast>() + .asFunction()(arg0); +} + +class ObjCBlock { + final ffi.Pointer<_ObjCBlock> _impl; + final BlockTestObjCLibrary _lib; + ObjCBlock._(this._impl, this._lib); + + ObjCBlock.fromFunctionPointer(this._lib, + ffi.Pointer> ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Int32 Function(ffi.Pointer<_ObjCBlock> block, + ffi.Int32 arg0)>(_ObjCBlock_fnPtrTrampoline, 0) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class _ObjCBlockDesc extends ffi.Struct { + @pkg_ffi.UnsignedLong() + external int reserved; + + @pkg_ffi.UnsignedLong() + external int size; + + external ffi.Pointer copy_helper; + + external ffi.Pointer dispose_helper; + + external ffi.Pointer signature; +} + +class _ObjCBlock extends ffi.Struct { + external ffi.Pointer isa; + + @pkg_ffi.Int() + external int flags; + + @pkg_ffi.Int() + external int reserved; + + external ffi.Pointer invoke; + + external ffi.Pointer<_ObjCBlockDesc> descriptor; + + external ffi.Pointer target; +} + +const int NSScannedOption = 1; + +const int NSCollectorDisabledOption = 2; + +const int NS_BLOCKS_AVAILABLE = 1; + +const int __COREFOUNDATION_CFAVAILABILITY__ = 1; + +const int __CF_ENUM_FIXED_IS_AVAILABLE = 1; + +const double NSFoundationVersionNumber10_0 = 397.4; + +const double NSFoundationVersionNumber10_1 = 425.0; + +const double NSFoundationVersionNumber10_1_1 = 425.0; + +const double NSFoundationVersionNumber10_1_2 = 425.0; + +const double NSFoundationVersionNumber10_1_3 = 425.0; + +const double NSFoundationVersionNumber10_1_4 = 425.0; + +const double NSFoundationVersionNumber10_2 = 462.0; + +const double NSFoundationVersionNumber10_2_1 = 462.0; + +const double NSFoundationVersionNumber10_2_2 = 462.0; + +const double NSFoundationVersionNumber10_2_3 = 462.0; + +const double NSFoundationVersionNumber10_2_4 = 462.0; + +const double NSFoundationVersionNumber10_2_5 = 462.0; + +const double NSFoundationVersionNumber10_2_6 = 462.0; + +const double NSFoundationVersionNumber10_2_7 = 462.7; + +const double NSFoundationVersionNumber10_2_8 = 462.7; + +const double NSFoundationVersionNumber10_3 = 500.0; + +const double NSFoundationVersionNumber10_3_1 = 500.0; + +const double NSFoundationVersionNumber10_3_2 = 500.3; + +const double NSFoundationVersionNumber10_3_3 = 500.54; + +const double NSFoundationVersionNumber10_3_4 = 500.56; + +const double NSFoundationVersionNumber10_3_5 = 500.56; + +const double NSFoundationVersionNumber10_3_6 = 500.56; + +const double NSFoundationVersionNumber10_3_7 = 500.56; + +const double NSFoundationVersionNumber10_3_8 = 500.56; + +const double NSFoundationVersionNumber10_3_9 = 500.58; + +const double NSFoundationVersionNumber10_4 = 567.0; + +const double NSFoundationVersionNumber10_4_1 = 567.0; + +const double NSFoundationVersionNumber10_4_2 = 567.12; + +const double NSFoundationVersionNumber10_4_3 = 567.21; + +const double NSFoundationVersionNumber10_4_4_Intel = 567.23; + +const double NSFoundationVersionNumber10_4_4_PowerPC = 567.21; + +const double NSFoundationVersionNumber10_4_5 = 567.25; + +const double NSFoundationVersionNumber10_4_6 = 567.26; + +const double NSFoundationVersionNumber10_4_7 = 567.27; + +const double NSFoundationVersionNumber10_4_8 = 567.28; + +const double NSFoundationVersionNumber10_4_9 = 567.29; + +const double NSFoundationVersionNumber10_4_10 = 567.29; + +const double NSFoundationVersionNumber10_4_11 = 567.36; + +const double NSFoundationVersionNumber10_5 = 677.0; + +const double NSFoundationVersionNumber10_5_1 = 677.1; + +const double NSFoundationVersionNumber10_5_2 = 677.15; + +const double NSFoundationVersionNumber10_5_3 = 677.19; + +const double NSFoundationVersionNumber10_5_4 = 677.19; + +const double NSFoundationVersionNumber10_5_5 = 677.21; + +const double NSFoundationVersionNumber10_5_6 = 677.22; + +const double NSFoundationVersionNumber10_5_7 = 677.24; + +const double NSFoundationVersionNumber10_5_8 = 677.26; + +const double NSFoundationVersionNumber10_6 = 751.0; + +const double NSFoundationVersionNumber10_6_1 = 751.0; + +const double NSFoundationVersionNumber10_6_2 = 751.14; + +const double NSFoundationVersionNumber10_6_3 = 751.21; + +const double NSFoundationVersionNumber10_6_4 = 751.29; + +const double NSFoundationVersionNumber10_6_5 = 751.42; + +const double NSFoundationVersionNumber10_6_6 = 751.53; + +const double NSFoundationVersionNumber10_6_7 = 751.53; + +const double NSFoundationVersionNumber10_6_8 = 751.62; + +const double NSFoundationVersionNumber10_7 = 833.1; + +const double NSFoundationVersionNumber10_7_1 = 833.1; + +const double NSFoundationVersionNumber10_7_2 = 833.2; + +const double NSFoundationVersionNumber10_7_3 = 833.24; + +const double NSFoundationVersionNumber10_7_4 = 833.25; + +const double NSFoundationVersionNumber10_8 = 945.0; + +const double NSFoundationVersionNumber10_8_1 = 945.0; + +const double NSFoundationVersionNumber10_8_2 = 945.11; + +const double NSFoundationVersionNumber10_8_3 = 945.16; + +const double NSFoundationVersionNumber10_8_4 = 945.18; + +const int NSFoundationVersionNumber10_9 = 1056; + +const int NSFoundationVersionNumber10_9_1 = 1056; + +const double NSFoundationVersionNumber10_9_2 = 1056.13; + +const double NSFoundationVersionNumber10_10 = 1151.16; + +const double NSFoundationVersionNumber10_10_1 = 1151.16; + +const double NSFoundationVersionNumber10_10_2 = 1152.14; + +const double NSFoundationVersionNumber10_10_3 = 1153.2; + +const double NSFoundationVersionNumber10_10_4 = 1153.2; + +const int NSFoundationVersionNumber10_10_5 = 1154; + +const int NSFoundationVersionNumber10_10_Max = 1199; + +const int NSFoundationVersionNumber10_11 = 1252; + +const double NSFoundationVersionNumber10_11_1 = 1255.1; + +const double NSFoundationVersionNumber10_11_2 = 1256.1; + +const double NSFoundationVersionNumber10_11_3 = 1256.1; + +const int NSFoundationVersionNumber10_11_4 = 1258; + +const int NSFoundationVersionNumber10_11_Max = 1299; + +const int __COREFOUNDATION_CFBASE__ = 1; + +const int TRUE = 1; + +const int FALSE = 0; + +const double kCFCoreFoundationVersionNumber10_0 = 196.4; + +const double kCFCoreFoundationVersionNumber10_0_3 = 196.5; + +const double kCFCoreFoundationVersionNumber10_1 = 226.0; + +const double kCFCoreFoundationVersionNumber10_1_1 = 226.0; + +const double kCFCoreFoundationVersionNumber10_1_2 = 227.2; + +const double kCFCoreFoundationVersionNumber10_1_3 = 227.2; + +const double kCFCoreFoundationVersionNumber10_1_4 = 227.3; + +const double kCFCoreFoundationVersionNumber10_2 = 263.0; + +const double kCFCoreFoundationVersionNumber10_2_1 = 263.1; + +const double kCFCoreFoundationVersionNumber10_2_2 = 263.1; + +const double kCFCoreFoundationVersionNumber10_2_3 = 263.3; + +const double kCFCoreFoundationVersionNumber10_2_4 = 263.3; + +const double kCFCoreFoundationVersionNumber10_2_5 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_6 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_7 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_8 = 263.5; + +const double kCFCoreFoundationVersionNumber10_3 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_1 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_2 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_3 = 299.3; + +const double kCFCoreFoundationVersionNumber10_3_4 = 299.31; + +const double kCFCoreFoundationVersionNumber10_3_5 = 299.31; + +const double kCFCoreFoundationVersionNumber10_3_6 = 299.32; + +const double kCFCoreFoundationVersionNumber10_3_7 = 299.33; + +const double kCFCoreFoundationVersionNumber10_3_8 = 299.33; + +const double kCFCoreFoundationVersionNumber10_3_9 = 299.35; + +const double kCFCoreFoundationVersionNumber10_4 = 368.0; + +const double kCFCoreFoundationVersionNumber10_4_1 = 368.1; + +const double kCFCoreFoundationVersionNumber10_4_2 = 368.11; + +const double kCFCoreFoundationVersionNumber10_4_3 = 368.18; + +const double kCFCoreFoundationVersionNumber10_4_4_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_4_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_5_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_5_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_6_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_6_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_7 = 368.27; + +const double kCFCoreFoundationVersionNumber10_4_8 = 368.27; + +const double kCFCoreFoundationVersionNumber10_4_9 = 368.28; + +const double kCFCoreFoundationVersionNumber10_4_10 = 368.28; + +const double kCFCoreFoundationVersionNumber10_4_11 = 368.31; + +const double kCFCoreFoundationVersionNumber10_5 = 476.0; + +const double kCFCoreFoundationVersionNumber10_5_1 = 476.0; + +const double kCFCoreFoundationVersionNumber10_5_2 = 476.1; + +const double kCFCoreFoundationVersionNumber10_5_3 = 476.13; + +const double kCFCoreFoundationVersionNumber10_5_4 = 476.14; + +const double kCFCoreFoundationVersionNumber10_5_5 = 476.15; + +const double kCFCoreFoundationVersionNumber10_5_6 = 476.17; + +const double kCFCoreFoundationVersionNumber10_5_7 = 476.18; + +const double kCFCoreFoundationVersionNumber10_5_8 = 476.19; + +const double kCFCoreFoundationVersionNumber10_6 = 550.0; + +const double kCFCoreFoundationVersionNumber10_6_1 = 550.0; + +const double kCFCoreFoundationVersionNumber10_6_2 = 550.13; + +const double kCFCoreFoundationVersionNumber10_6_3 = 550.19; + +const double kCFCoreFoundationVersionNumber10_6_4 = 550.29; + +const double kCFCoreFoundationVersionNumber10_6_5 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_6 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_7 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_8 = 550.43; + +const double kCFCoreFoundationVersionNumber10_7 = 635.0; + +const double kCFCoreFoundationVersionNumber10_7_1 = 635.0; + +const double kCFCoreFoundationVersionNumber10_7_2 = 635.15; + +const double kCFCoreFoundationVersionNumber10_7_3 = 635.19; + +const double kCFCoreFoundationVersionNumber10_7_4 = 635.21; + +const double kCFCoreFoundationVersionNumber10_7_5 = 635.21; + +const double kCFCoreFoundationVersionNumber10_8 = 744.0; + +const double kCFCoreFoundationVersionNumber10_8_1 = 744.0; + +const double kCFCoreFoundationVersionNumber10_8_2 = 744.12; + +const double kCFCoreFoundationVersionNumber10_8_3 = 744.18; + +const double kCFCoreFoundationVersionNumber10_8_4 = 744.19; + +const double kCFCoreFoundationVersionNumber10_9 = 855.11; + +const double kCFCoreFoundationVersionNumber10_9_1 = 855.11; + +const double kCFCoreFoundationVersionNumber10_9_2 = 855.14; + +const double kCFCoreFoundationVersionNumber10_10 = 1151.16; + +const double kCFCoreFoundationVersionNumber10_10_1 = 1151.16; + +const int kCFCoreFoundationVersionNumber10_10_2 = 1152; + +const double kCFCoreFoundationVersionNumber10_10_3 = 1153.18; + +const double kCFCoreFoundationVersionNumber10_10_4 = 1153.18; + +const double kCFCoreFoundationVersionNumber10_10_5 = 1153.18; + +const int kCFCoreFoundationVersionNumber10_10_Max = 1199; + +const int kCFCoreFoundationVersionNumber10_11 = 1253; + +const double kCFCoreFoundationVersionNumber10_11_1 = 1255.1; + +const double kCFCoreFoundationVersionNumber10_11_2 = 1256.14; + +const double kCFCoreFoundationVersionNumber10_11_3 = 1256.14; + +const double kCFCoreFoundationVersionNumber10_11_4 = 1258.1; + +const int kCFCoreFoundationVersionNumber10_11_Max = 1299; + +const int ISA_PTRAUTH_DISCRIMINATOR = 27361; diff --git a/pkgs/ffigen/test/native_objc_test/block_config.yaml b/pkgs/ffigen/test/native_objc_test/block_config.yaml new file mode 100644 index 0000000000..38316c2be9 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/block_config.yaml @@ -0,0 +1,12 @@ +name: BlockTestObjCLibrary +description: 'Tests calling Objective-C blocks' +language: objc +output: 'test/native_objc_test/block_bindings.dart' +functions: + exclude: + - '.*' +headers: + entry-points: + - 'test/native_objc_test/block_test.m' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/block_test.dart b/pkgs/ffigen/test/native_objc_test/block_test.dart new file mode 100644 index 0000000000..767404eae4 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/block_test.dart @@ -0,0 +1,73 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:ffigen/ffigen.dart'; +import 'package:path/path.dart' as path; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart'; +import '../test_utils.dart'; +import 'block_bindings.dart'; + +void main() { + late BlockTestObjCLibrary lib; + + group('Blocks', () { + setUpAll(() { + logWarnings(); + final dylib = File('test/native_objc_test/block_test.dylib'); + verifySetupFile(dylib); + lib = BlockTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); + }); + + test('generate_bindings', () { + final config = Config.fromYaml(loadYaml( + File(path.join('test', 'native_objc_test', 'block_config.yaml')) + .readAsStringSync()) as YamlMap); + final library = parse(config); + final file = File( + path.join('test', 'debug_generated', 'block_test.dart'), + ); + library.generateFile(file); + + try { + final actual = file.readAsStringSync(); + final expected = File(path.join(config.output)).readAsStringSync(); + expect(actual, expected); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + print('Failed test: Debug generated file: ${file.absolute.path}'); + rethrow; + } + }); + + test('BlockTester is working', () { + // This doesn't test any Block functionality, just that the BlockTester + // itself is working correctly. + final blockTester = BlockTester.makeFromMultiplier(lib, 10); + expect(blockTester.call(123), 1230); + final intBlock = blockTester.getBlock(); + final blockTester2 = BlockTester.makeFromBlock(lib, intBlock); + expect(blockTester2.call(456), 4560); + }); + + test('Block from function pointer', () { + final block = ObjCBlock.fromFunctionPointer( + lib, Pointer.fromFunction(_add100, 999)); + final blockTester = BlockTester.makeFromBlock(lib, block.pointer); + expect(blockTester.call(123), 223); + }); + }); +} + +int _add100(int x) { + return x + 100; +} diff --git a/pkgs/ffigen/test/native_objc_test/block_test.m b/pkgs/ffigen/test/native_objc_test/block_test.m new file mode 100644 index 0000000000..43d6a2c2b9 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/block_test.m @@ -0,0 +1,42 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#import + +typedef int32_t (^IntBlock)(int32_t); + +// Wrapper around a block, so that our Dart code can test creating and invoking +// blocks in Objective C code. +@interface BlockTester : NSObject { + IntBlock myBlock; +} ++ (BlockTester*)makeFromBlock:(IntBlock)block; ++ (BlockTester*)makeFromMultiplier:(int32_t)mult; +- (int32_t)call:(int32_t)x; +- (IntBlock)getBlock; +@end + +@implementation BlockTester ++ (BlockTester*)makeFromBlock:(IntBlock)block { + BlockTester* bt = [BlockTester new]; + bt->myBlock = block; + return bt; +} + ++ (BlockTester*)makeFromMultiplier:(int32_t)mult { + BlockTester* bt = [BlockTester new]; + bt->myBlock = [^int32_t(int32_t x) { + return x * mult; + } copy]; + return bt; +} + +- (int32_t)call:(int32_t)x { + return self->myBlock(x); +} + +- (IntBlock)getBlock { + return self->myBlock; +} +@end diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart index 73e0ae3291..29d1652a20 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart @@ -1041,6 +1041,23 @@ class NativeObjCLibrary { _registerName1("getParagraphStart:end:contentsEnd:forRange:"); late final ffi.Pointer _sel_paragraphRangeForRange_1 = _registerName1("paragraphRangeForRange:"); + ffi.Pointer<_ObjCBlockDesc> _newBlockDesc1() { + final d = + pkg_ffi.calloc.allocate<_ObjCBlockDesc>(ffi.sizeOf<_ObjCBlockDesc>()); + d.ref.size = ffi.sizeOf<_ObjCBlock>(); + return d; + } + + late final ffi.Pointer<_ObjCBlockDesc> _objc_block_desc1 = _newBlockDesc1(); + ffi.Pointer<_ObjCBlock> _newBlock1( + ffi.Pointer invoke, ffi.Pointer target) { + final b = pkg_ffi.calloc.allocate<_ObjCBlock>(ffi.sizeOf<_ObjCBlock>()); + b.ref.invoke = invoke; + b.ref.target = target; + b.ref.descriptor = _objc_block_desc1; + return b; + } + late final ffi.Pointer _sel_enumerateSubstringsInRange_options_usingBlock_1 = _registerName1("enumerateSubstringsInRange:options:usingBlock:"); @@ -1049,7 +1066,7 @@ class NativeObjCLibrary { ffi.Pointer sel, NSRange range, int opts, - ffi.Pointer block, + ffi.Pointer<_ObjCBlock> block, ) { return __objc_msgSend_35( obj, @@ -1063,30 +1080,50 @@ class NativeObjCLibrary { late final __objc_msgSend_35Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); late final __objc_msgSend_35 = __objc_msgSend_35Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer)>(); + ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_enumerateLinesUsingBlock_1 = _registerName1("enumerateLinesUsingBlock:"); - late final ffi.Pointer _sel_UTF8String1 = - _registerName1("UTF8String"); - ffi.Pointer _objc_msgSend_36( + void _objc_msgSend_36( ffi.Pointer obj, ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, ) { return __objc_msgSend_36( obj, sel, + block, ); } late final __objc_msgSend_36Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_36 = __objc_msgSend_36Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final ffi.Pointer _sel_UTF8String1 = + _registerName1("UTF8String"); + ffi.Pointer _objc_msgSend_37( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_37( + obj, + sel, + ); + } + + late final __objc_msgSend_37Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_36 = __objc_msgSend_36Ptr.asFunction< + late final __objc_msgSend_37 = __objc_msgSend_37Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); @@ -1098,13 +1135,13 @@ class NativeObjCLibrary { late final ffi.Pointer _sel_dataUsingEncoding_allowLossyConversion_1 = _registerName1("dataUsingEncoding:allowLossyConversion:"); - ffi.Pointer _objc_msgSend_37( + ffi.Pointer _objc_msgSend_38( ffi.Pointer obj, ffi.Pointer sel, int encoding, bool lossy, ) { - return __objc_msgSend_37( + return __objc_msgSend_38( obj, sel, encoding, @@ -1112,47 +1149,47 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_37Ptr = _lookup< + late final __objc_msgSend_38Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, NSStringEncoding, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_37 = __objc_msgSend_37Ptr.asFunction< + late final __objc_msgSend_38 = __objc_msgSend_38Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int, int)>(); late final ffi.Pointer _sel_dataUsingEncoding_1 = _registerName1("dataUsingEncoding:"); - ffi.Pointer _objc_msgSend_38( + ffi.Pointer _objc_msgSend_39( ffi.Pointer obj, ffi.Pointer sel, int encoding, ) { - return __objc_msgSend_38( + return __objc_msgSend_39( obj, sel, encoding, ); } - late final __objc_msgSend_38Ptr = _lookup< + late final __objc_msgSend_39Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_38 = __objc_msgSend_38Ptr.asFunction< + late final __objc_msgSend_39 = __objc_msgSend_39Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_canBeConvertedToEncoding_1 = _registerName1("canBeConvertedToEncoding:"); - bool _objc_msgSend_39( + bool _objc_msgSend_40( ffi.Pointer obj, ffi.Pointer sel, int encoding, ) { - return __objc_msgSend_39( + return __objc_msgSend_40( obj, sel, encoding, @@ -1160,44 +1197,44 @@ class NativeObjCLibrary { 0; } - late final __objc_msgSend_39Ptr = _lookup< + late final __objc_msgSend_40Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_39 = __objc_msgSend_39Ptr.asFunction< + late final __objc_msgSend_40 = __objc_msgSend_40Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_cStringUsingEncoding_1 = _registerName1("cStringUsingEncoding:"); - void _objc_msgSend_40( + void _objc_msgSend_41( ffi.Pointer obj, ffi.Pointer sel, int encoding, ) { - return __objc_msgSend_40( + return __objc_msgSend_41( obj, sel, encoding, ); } - late final __objc_msgSend_40Ptr = _lookup< + late final __objc_msgSend_41Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_40 = __objc_msgSend_40Ptr.asFunction< + late final __objc_msgSend_41 = __objc_msgSend_41Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_getCString_maxLength_encoding_1 = _registerName1("getCString:maxLength:encoding:"); - bool _objc_msgSend_41( + bool _objc_msgSend_42( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer buffer, int maxBufferCount, int encoding, ) { - return __objc_msgSend_41( + return __objc_msgSend_42( obj, sel, buffer, @@ -1207,7 +1244,7 @@ class NativeObjCLibrary { 0; } - late final __objc_msgSend_41Ptr = _lookup< + late final __objc_msgSend_42Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function( ffi.Pointer, @@ -1215,7 +1252,7 @@ class NativeObjCLibrary { ffi.Pointer, NSUInteger, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_41 = __objc_msgSend_41Ptr.asFunction< + late final __objc_msgSend_42 = __objc_msgSend_42Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, int)>(); @@ -1223,7 +1260,7 @@ class NativeObjCLibrary { _sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_1 = _registerName1( "getBytes:maxLength:usedLength:encoding:options:range:remainingRange:"); - bool _objc_msgSend_42( + bool _objc_msgSend_43( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer buffer, @@ -1234,7 +1271,7 @@ class NativeObjCLibrary { NSRange range, NSRangePointer leftover, ) { - return __objc_msgSend_42( + return __objc_msgSend_43( obj, sel, buffer, @@ -1248,7 +1285,7 @@ class NativeObjCLibrary { 0; } - late final __objc_msgSend_42Ptr = _lookup< + late final __objc_msgSend_43Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function( ffi.Pointer, @@ -1260,7 +1297,7 @@ class NativeObjCLibrary { ffi.Int32, NSRange, NSRangePointer)>>('objc_msgSend'); - late final __objc_msgSend_42 = __objc_msgSend_42Ptr.asFunction< + late final __objc_msgSend_43 = __objc_msgSend_43Ptr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -1274,44 +1311,44 @@ class NativeObjCLibrary { late final ffi.Pointer _sel_maximumLengthOfBytesUsingEncoding_1 = _registerName1("maximumLengthOfBytesUsingEncoding:"); - int _objc_msgSend_43( + int _objc_msgSend_44( ffi.Pointer obj, ffi.Pointer sel, int enc, ) { - return __objc_msgSend_43( + return __objc_msgSend_44( obj, sel, enc, ); } - late final __objc_msgSend_43Ptr = _lookup< + late final __objc_msgSend_44Ptr = _lookup< ffi.NativeFunction< NSUInteger Function(ffi.Pointer, ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_43 = __objc_msgSend_43Ptr.asFunction< + late final __objc_msgSend_44 = __objc_msgSend_44Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_lengthOfBytesUsingEncoding_1 = _registerName1("lengthOfBytesUsingEncoding:"); late final ffi.Pointer _sel_availableStringEncodings1 = _registerName1("availableStringEncodings"); - ffi.Pointer _objc_msgSend_44( + ffi.Pointer _objc_msgSend_45( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_44( + return __objc_msgSend_45( obj, sel, ); } - late final __objc_msgSend_44Ptr = _lookup< + late final __objc_msgSend_45Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_44 = __objc_msgSend_44Ptr.asFunction< + late final __objc_msgSend_45 = __objc_msgSend_45Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); @@ -1334,14 +1371,14 @@ class NativeObjCLibrary { late final ffi.Pointer _sel_stringByPaddingToLength_withString_startingAtIndex_1 = _registerName1("stringByPaddingToLength:withString:startingAtIndex:"); - ffi.Pointer _objc_msgSend_45( + ffi.Pointer _objc_msgSend_46( ffi.Pointer obj, ffi.Pointer sel, int newLength, ffi.Pointer padString, int padIndex, ) { - return __objc_msgSend_45( + return __objc_msgSend_46( obj, sel, newLength, @@ -1350,7 +1387,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_45Ptr = _lookup< + late final __objc_msgSend_46Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, @@ -1358,19 +1395,19 @@ class NativeObjCLibrary { NSUInteger, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_45 = __objc_msgSend_45Ptr.asFunction< + late final __objc_msgSend_46 = __objc_msgSend_46Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer, int)>(); late final ffi.Pointer _sel_stringByFoldingWithOptions_locale_1 = _registerName1("stringByFoldingWithOptions:locale:"); - ffi.Pointer _objc_msgSend_46( + ffi.Pointer _objc_msgSend_47( ffi.Pointer obj, ffi.Pointer sel, int options, ffi.Pointer locale, ) { - return __objc_msgSend_46( + return __objc_msgSend_47( obj, sel, options, @@ -1378,14 +1415,14 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_46Ptr = _lookup< + late final __objc_msgSend_47Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_46 = __objc_msgSend_46Ptr.asFunction< + late final __objc_msgSend_47 = __objc_msgSend_47Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); @@ -1393,7 +1430,7 @@ class NativeObjCLibrary { _sel_stringByReplacingOccurrencesOfString_withString_options_range_1 = _registerName1( "stringByReplacingOccurrencesOfString:withString:options:range:"); - ffi.Pointer _objc_msgSend_47( + ffi.Pointer _objc_msgSend_48( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer target, @@ -1401,7 +1438,7 @@ class NativeObjCLibrary { int options, NSRange searchRange, ) { - return __objc_msgSend_47( + return __objc_msgSend_48( obj, sel, target, @@ -1411,7 +1448,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_47Ptr = _lookup< + late final __objc_msgSend_48Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, @@ -1420,7 +1457,7 @@ class NativeObjCLibrary { ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_47 = __objc_msgSend_47Ptr.asFunction< + late final __objc_msgSend_48 = __objc_msgSend_48Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, @@ -1432,13 +1469,13 @@ class NativeObjCLibrary { late final ffi.Pointer _sel_stringByReplacingOccurrencesOfString_withString_1 = _registerName1("stringByReplacingOccurrencesOfString:withString:"); - ffi.Pointer _objc_msgSend_48( + ffi.Pointer _objc_msgSend_49( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer target, ffi.Pointer replacement, ) { - return __objc_msgSend_48( + return __objc_msgSend_49( obj, sel, target, @@ -1446,14 +1483,14 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_48Ptr = _lookup< + late final __objc_msgSend_49Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_48 = __objc_msgSend_48Ptr.asFunction< + late final __objc_msgSend_49 = __objc_msgSend_49Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, @@ -1463,13 +1500,13 @@ class NativeObjCLibrary { late final ffi.Pointer _sel_stringByReplacingCharactersInRange_withString_1 = _registerName1("stringByReplacingCharactersInRange:withString:"); - ffi.Pointer _objc_msgSend_49( + ffi.Pointer _objc_msgSend_50( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ffi.Pointer replacement, ) { - return __objc_msgSend_49( + return __objc_msgSend_50( obj, sel, range, @@ -1477,26 +1514,26 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_49Ptr = _lookup< + late final __objc_msgSend_50Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, NSRange, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_49 = __objc_msgSend_49Ptr.asFunction< + late final __objc_msgSend_50 = __objc_msgSend_50Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, NSRange, ffi.Pointer)>(); late final ffi.Pointer _sel_stringByApplyingTransform_reverse_1 = _registerName1("stringByApplyingTransform:reverse:"); - ffi.Pointer _objc_msgSend_50( + ffi.Pointer _objc_msgSend_51( ffi.Pointer obj, ffi.Pointer sel, NSStringTransform transform, bool reverse, ) { - return __objc_msgSend_50( + return __objc_msgSend_51( obj, sel, transform, @@ -1504,20 +1541,20 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_50Ptr = _lookup< + late final __objc_msgSend_51Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, NSStringTransform, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_50 = __objc_msgSend_50Ptr.asFunction< + late final __objc_msgSend_51 = __objc_msgSend_51Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, NSStringTransform, int)>(); late final ffi.Pointer _sel_writeToURL_atomically_encoding_error_1 = _registerName1("writeToURL:atomically:encoding:error:"); - bool _objc_msgSend_51( + bool _objc_msgSend_52( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer url, @@ -1525,7 +1562,7 @@ class NativeObjCLibrary { int enc, ffi.Pointer> error, ) { - return __objc_msgSend_51( + return __objc_msgSend_52( obj, sel, url, @@ -1536,7 +1573,7 @@ class NativeObjCLibrary { 0; } - late final __objc_msgSend_51Ptr = _lookup< + late final __objc_msgSend_52Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function( ffi.Pointer, @@ -1545,7 +1582,7 @@ class NativeObjCLibrary { ffi.Uint8, NSStringEncoding, ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_51 = __objc_msgSend_51Ptr.asFunction< + late final __objc_msgSend_52 = __objc_msgSend_52Ptr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -1561,14 +1598,14 @@ class NativeObjCLibrary { late final ffi.Pointer _sel_initWithCharactersNoCopy_length_freeWhenDone_1 = _registerName1("initWithCharactersNoCopy:length:freeWhenDone:"); - instancetype _objc_msgSend_52( + instancetype _objc_msgSend_53( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer characters, int length, bool freeBuffer, ) { - return __objc_msgSend_52( + return __objc_msgSend_53( obj, sel, characters, @@ -1577,25 +1614,25 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_52Ptr = _lookup< + late final __objc_msgSend_53Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSUInteger, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_52 = __objc_msgSend_52Ptr.asFunction< + late final __objc_msgSend_53 = __objc_msgSend_53Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, int)>(); late final ffi.Pointer _sel_initWithCharactersNoCopy_length_deallocator_1 = _registerName1("initWithCharactersNoCopy:length:deallocator:"); - instancetype _objc_msgSend_53( + instancetype _objc_msgSend_54( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer chars, int len, - ffi.Pointer deallocator, + ffi.Pointer<_ObjCBlock> deallocator, ) { - return __objc_msgSend_53( + return __objc_msgSend_54( obj, sel, chars, @@ -1604,27 +1641,27 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_53Ptr = _lookup< + late final __objc_msgSend_54Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, NSUInteger, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_53 = __objc_msgSend_53Ptr.asFunction< + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_initWithCharacters_length_1 = _registerName1("initWithCharacters:length:"); - instancetype _objc_msgSend_54( + instancetype _objc_msgSend_55( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer characters, int length, ) { - return __objc_msgSend_54( + return __objc_msgSend_55( obj, sel, characters, @@ -1632,33 +1669,33 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_54Ptr = _lookup< + late final __objc_msgSend_55Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< + late final __objc_msgSend_55 = __objc_msgSend_55Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithUTF8String_1 = _registerName1("initWithUTF8String:"); - instancetype _objc_msgSend_55( + instancetype _objc_msgSend_56( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer nullTerminatedCString, ) { - return __objc_msgSend_55( + return __objc_msgSend_56( obj, sel, nullTerminatedCString, ); } - late final __objc_msgSend_55Ptr = _lookup< + late final __objc_msgSend_56Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_55 = __objc_msgSend_55Ptr.asFunction< + late final __objc_msgSend_56 = __objc_msgSend_56Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -1668,13 +1705,13 @@ class NativeObjCLibrary { _registerName1("initWithFormat:"); late final ffi.Pointer _sel_initWithFormat_arguments_1 = _registerName1("initWithFormat:arguments:"); - instancetype _objc_msgSend_56( + instancetype _objc_msgSend_57( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer format, ffi.Pointer<__va_list_tag> argList, ) { - return __objc_msgSend_56( + return __objc_msgSend_57( obj, sel, format, @@ -1682,26 +1719,26 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_56Ptr = _lookup< + late final __objc_msgSend_57Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); - late final __objc_msgSend_56 = __objc_msgSend_56Ptr.asFunction< + late final __objc_msgSend_57 = __objc_msgSend_57Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer<__va_list_tag>)>(); late final ffi.Pointer _sel_initWithFormat_locale_1 = _registerName1("initWithFormat:locale:"); - instancetype _objc_msgSend_57( + instancetype _objc_msgSend_58( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer format, ffi.Pointer locale, ) { - return __objc_msgSend_57( + return __objc_msgSend_58( obj, sel, format, @@ -1709,27 +1746,27 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_57Ptr = _lookup< + late final __objc_msgSend_58Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_57 = __objc_msgSend_57Ptr.asFunction< + late final __objc_msgSend_58 = __objc_msgSend_58Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_initWithFormat_locale_arguments_1 = _registerName1("initWithFormat:locale:arguments:"); - instancetype _objc_msgSend_58( + instancetype _objc_msgSend_59( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer format, ffi.Pointer locale, ffi.Pointer<__va_list_tag> argList, ) { - return __objc_msgSend_58( + return __objc_msgSend_59( obj, sel, format, @@ -1738,7 +1775,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_58Ptr = _lookup< + late final __objc_msgSend_59Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, @@ -1746,7 +1783,7 @@ class NativeObjCLibrary { ffi.Pointer, ffi.Pointer, ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); - late final __objc_msgSend_58 = __objc_msgSend_58Ptr.asFunction< + late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< instancetype Function( ffi.Pointer, ffi.Pointer, @@ -1756,13 +1793,13 @@ class NativeObjCLibrary { late final ffi.Pointer _sel_initWithData_encoding_1 = _registerName1("initWithData:encoding:"); - instancetype _objc_msgSend_59( + instancetype _objc_msgSend_60( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer data, int encoding, ) { - return __objc_msgSend_59( + return __objc_msgSend_60( obj, sel, data, @@ -1770,24 +1807,24 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_59Ptr = _lookup< + late final __objc_msgSend_60Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< + late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithBytes_length_encoding_1 = _registerName1("initWithBytes:length:encoding:"); - instancetype _objc_msgSend_60( + instancetype _objc_msgSend_61( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer bytes, int len, int encoding, ) { - return __objc_msgSend_60( + return __objc_msgSend_61( obj, sel, bytes, @@ -1796,7 +1833,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_60Ptr = _lookup< + late final __objc_msgSend_61Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, @@ -1804,14 +1841,14 @@ class NativeObjCLibrary { ffi.Pointer, NSUInteger, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< + late final __objc_msgSend_61 = __objc_msgSend_61Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, int)>(); late final ffi.Pointer _sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1 = _registerName1("initWithBytesNoCopy:length:encoding:freeWhenDone:"); - instancetype _objc_msgSend_61( + instancetype _objc_msgSend_62( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer bytes, @@ -1819,7 +1856,7 @@ class NativeObjCLibrary { int encoding, bool freeBuffer, ) { - return __objc_msgSend_61( + return __objc_msgSend_62( obj, sel, bytes, @@ -1829,7 +1866,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_61Ptr = _lookup< + late final __objc_msgSend_62Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, @@ -1838,22 +1875,22 @@ class NativeObjCLibrary { NSUInteger, NSStringEncoding, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_61 = __objc_msgSend_61Ptr.asFunction< + late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, int, int)>(); late final ffi.Pointer _sel_initWithBytesNoCopy_length_encoding_deallocator_1 = _registerName1("initWithBytesNoCopy:length:encoding:deallocator:"); - instancetype _objc_msgSend_62( + instancetype _objc_msgSend_63( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer bytes, int len, int encoding, - ffi.Pointer deallocator, + ffi.Pointer<_ObjCBlock> deallocator, ) { - return __objc_msgSend_62( + return __objc_msgSend_63( obj, sel, bytes, @@ -1863,7 +1900,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_62Ptr = _lookup< + late final __objc_msgSend_63Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, @@ -1871,10 +1908,10 @@ class NativeObjCLibrary { ffi.Pointer, NSUInteger, NSStringEncoding, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_63 = __objc_msgSend_63Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, ffi.Pointer)>(); + ffi.Pointer, int, int, ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_string1 = _registerName1("string"); late final ffi.Pointer _sel_stringWithString_1 = @@ -1889,13 +1926,13 @@ class NativeObjCLibrary { _registerName1("localizedStringWithFormat:"); late final ffi.Pointer _sel_initWithCString_encoding_1 = _registerName1("initWithCString:encoding:"); - instancetype _objc_msgSend_63( + instancetype _objc_msgSend_64( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer nullTerminatedCString, int encoding, ) { - return __objc_msgSend_63( + return __objc_msgSend_64( obj, sel, nullTerminatedCString, @@ -1903,11 +1940,11 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_63Ptr = _lookup< + late final __objc_msgSend_64Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_63 = __objc_msgSend_63Ptr.asFunction< + late final __objc_msgSend_64 = __objc_msgSend_64Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); @@ -1915,14 +1952,14 @@ class NativeObjCLibrary { _registerName1("stringWithCString:encoding:"); late final ffi.Pointer _sel_initWithContentsOfURL_encoding_error_1 = _registerName1("initWithContentsOfURL:encoding:error:"); - instancetype _objc_msgSend_64( + instancetype _objc_msgSend_65( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer url, int enc, ffi.Pointer> error, ) { - return __objc_msgSend_64( + return __objc_msgSend_65( obj, sel, url, @@ -1931,7 +1968,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_64Ptr = _lookup< + late final __objc_msgSend_65Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, @@ -1939,7 +1976,7 @@ class NativeObjCLibrary { ffi.Pointer, NSStringEncoding, ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_64 = __objc_msgSend_64Ptr.asFunction< + late final __objc_msgSend_65 = __objc_msgSend_65Ptr.asFunction< instancetype Function( ffi.Pointer, ffi.Pointer, @@ -1958,14 +1995,14 @@ class NativeObjCLibrary { late final ffi.Pointer _sel_initWithContentsOfURL_usedEncoding_error_1 = _registerName1("initWithContentsOfURL:usedEncoding:error:"); - instancetype _objc_msgSend_65( + instancetype _objc_msgSend_66( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer url, ffi.Pointer enc, ffi.Pointer> error, ) { - return __objc_msgSend_65( + return __objc_msgSend_66( obj, sel, url, @@ -1974,7 +2011,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_65Ptr = _lookup< + late final __objc_msgSend_66Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, @@ -1982,7 +2019,7 @@ class NativeObjCLibrary { ffi.Pointer, ffi.Pointer, ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_65 = __objc_msgSend_65Ptr.asFunction< + late final __objc_msgSend_66 = __objc_msgSend_66Ptr.asFunction< instancetype Function( ffi.Pointer, ffi.Pointer, @@ -2003,7 +2040,7 @@ class NativeObjCLibrary { _sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1 = _registerName1( "stringEncodingForData:encodingOptions:convertedString:usedLossyConversion:"); - int _objc_msgSend_66( + int _objc_msgSend_67( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer data, @@ -2011,7 +2048,7 @@ class NativeObjCLibrary { ffi.Pointer> string, ffi.Pointer usedLossyConversion, ) { - return __objc_msgSend_66( + return __objc_msgSend_67( obj, sel, data, @@ -2021,7 +2058,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_66Ptr = _lookup< + late final __objc_msgSend_67Ptr = _lookup< ffi.NativeFunction< NSStringEncoding Function( ffi.Pointer, @@ -2030,7 +2067,7 @@ class NativeObjCLibrary { ffi.Pointer, ffi.Pointer>, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_66 = __objc_msgSend_66Ptr.asFunction< + late final __objc_msgSend_67 = __objc_msgSend_67Ptr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -2045,21 +2082,21 @@ class NativeObjCLibrary { _getClass1("NSDictionary"); late final ffi.Pointer _sel_propertyListFromStringsFileFormat1 = _registerName1("propertyListFromStringsFileFormat"); - ffi.Pointer _objc_msgSend_67( + ffi.Pointer _objc_msgSend_68( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_67( + return __objc_msgSend_68( obj, sel, ); } - late final __objc_msgSend_67Ptr = _lookup< + late final __objc_msgSend_68Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_67 = __objc_msgSend_67Ptr.asFunction< + late final __objc_msgSend_68 = __objc_msgSend_68Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); @@ -2070,35 +2107,35 @@ class NativeObjCLibrary { _registerName1("cStringLength"); late final ffi.Pointer _sel_getCString_1 = _registerName1("getCString:"); - void _objc_msgSend_68( + void _objc_msgSend_69( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer bytes, ) { - return __objc_msgSend_68( + return __objc_msgSend_69( obj, sel, bytes, ); } - late final __objc_msgSend_68Ptr = _lookup< + late final __objc_msgSend_69Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_68 = __objc_msgSend_68Ptr.asFunction< + late final __objc_msgSend_69 = __objc_msgSend_69Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_getCString_maxLength_1 = _registerName1("getCString:maxLength:"); - void _objc_msgSend_69( + void _objc_msgSend_70( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer bytes, int maxLength, ) { - return __objc_msgSend_69( + return __objc_msgSend_70( obj, sel, bytes, @@ -2106,18 +2143,18 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_69Ptr = _lookup< + late final __objc_msgSend_70Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_69 = __objc_msgSend_69Ptr.asFunction< + late final __objc_msgSend_70 = __objc_msgSend_70Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_getCString_maxLength_range_remainingRange_1 = _registerName1("getCString:maxLength:range:remainingRange:"); - void _objc_msgSend_70( + void _objc_msgSend_71( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer bytes, @@ -2125,7 +2162,7 @@ class NativeObjCLibrary { NSRange aRange, NSRangePointer leftoverRange, ) { - return __objc_msgSend_70( + return __objc_msgSend_71( obj, sel, bytes, @@ -2135,7 +2172,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_70Ptr = _lookup< + late final __objc_msgSend_71Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -2144,19 +2181,19 @@ class NativeObjCLibrary { NSUInteger, NSRange, NSRangePointer)>>('objc_msgSend'); - late final __objc_msgSend_70 = __objc_msgSend_70Ptr.asFunction< + late final __objc_msgSend_71 = __objc_msgSend_71Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, NSRange, NSRangePointer)>(); late final ffi.Pointer _sel_writeToFile_atomically_1 = _registerName1("writeToFile:atomically:"); - bool _objc_msgSend_71( + bool _objc_msgSend_72( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer path, bool useAuxiliaryFile, ) { - return __objc_msgSend_71( + return __objc_msgSend_72( obj, sel, path, @@ -2165,11 +2202,11 @@ class NativeObjCLibrary { 0; } - late final __objc_msgSend_71Ptr = _lookup< + late final __objc_msgSend_72Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_71 = __objc_msgSend_71Ptr.asFunction< + late final __objc_msgSend_72 = __objc_msgSend_72Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); @@ -2186,14 +2223,14 @@ class NativeObjCLibrary { late final ffi.Pointer _sel_initWithCStringNoCopy_length_freeWhenDone_1 = _registerName1("initWithCStringNoCopy:length:freeWhenDone:"); - ffi.Pointer _objc_msgSend_72( + ffi.Pointer _objc_msgSend_73( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer bytes, int length, bool freeBuffer, ) { - return __objc_msgSend_72( + return __objc_msgSend_73( obj, sel, bytes, @@ -2202,7 +2239,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_72Ptr = _lookup< + late final __objc_msgSend_73Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, @@ -2210,7 +2247,7 @@ class NativeObjCLibrary { ffi.Pointer, NSUInteger, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_72 = __objc_msgSend_72Ptr.asFunction< + late final __objc_msgSend_73 = __objc_msgSend_73Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, int)>(); @@ -2224,41 +2261,41 @@ class NativeObjCLibrary { _registerName1("stringWithCString:"); late final ffi.Pointer _sel_getCharacters_1 = _registerName1("getCharacters:"); - void _objc_msgSend_73( + void _objc_msgSend_74( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer buffer, ) { - return __objc_msgSend_73( + return __objc_msgSend_74( obj, sel, buffer, ); } - late final __objc_msgSend_73Ptr = _lookup< + late final __objc_msgSend_74Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_73 = __objc_msgSend_73Ptr.asFunction< + late final __objc_msgSend_74 = __objc_msgSend_74Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_74( + ffi.Pointer _objc_msgSend_75( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_74( + return __objc_msgSend_75( obj, sel, ); } - late final __objc_msgSend_74Ptr = _lookup< + late final __objc_msgSend_75Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_74 = __objc_msgSend_74Ptr.asFunction< + late final __objc_msgSend_75 = __objc_msgSend_75Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); @@ -2267,23 +2304,23 @@ class NativeObjCLibrary { late final ffi.Pointer _sel_version1 = _registerName1("version"); late final ffi.Pointer _sel_setVersion_1 = _registerName1("setVersion:"); - void _objc_msgSend_75( + void _objc_msgSend_76( ffi.Pointer obj, ffi.Pointer sel, int aVersion, ) { - return __objc_msgSend_75( + return __objc_msgSend_76( obj, sel, aVersion, ); } - late final __objc_msgSend_75Ptr = _lookup< + late final __objc_msgSend_76Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_75 = __objc_msgSend_75Ptr.asFunction< + late final __objc_msgSend_76 = __objc_msgSend_76Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_classForCoder1 = @@ -2299,13 +2336,13 @@ class NativeObjCLibrary { late final ffi.Pointer _class_NSValue1 = _getClass1("NSValue"); late final ffi.Pointer _sel_getValue_size_1 = _registerName1("getValue:size:"); - void _objc_msgSend_76( + void _objc_msgSend_77( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer value, int size, ) { - return __objc_msgSend_76( + return __objc_msgSend_77( obj, sel, value, @@ -2313,24 +2350,24 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_76Ptr = _lookup< + late final __objc_msgSend_77Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_76 = __objc_msgSend_76Ptr.asFunction< + late final __objc_msgSend_77 = __objc_msgSend_77Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_objCType1 = _registerName1("objCType"); late final ffi.Pointer _sel_initWithBytes_objCType_1 = _registerName1("initWithBytes:objCType:"); - instancetype _objc_msgSend_77( + instancetype _objc_msgSend_78( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer value, ffi.Pointer type, ) { - return __objc_msgSend_77( + return __objc_msgSend_78( obj, sel, value, @@ -2338,26 +2375,26 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_77Ptr = _lookup< + late final __objc_msgSend_78Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_77 = __objc_msgSend_77Ptr.asFunction< + late final __objc_msgSend_78 = __objc_msgSend_78Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_valueWithBytes_objCType_1 = _registerName1("valueWithBytes:objCType:"); - ffi.Pointer _objc_msgSend_78( + ffi.Pointer _objc_msgSend_79( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer value, ffi.Pointer type, ) { - return __objc_msgSend_78( + return __objc_msgSend_79( obj, sel, value, @@ -2365,14 +2402,14 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_78Ptr = _lookup< + late final __objc_msgSend_79Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_78 = __objc_msgSend_78Ptr.asFunction< + late final __objc_msgSend_79 = __objc_msgSend_79Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, @@ -2383,23 +2420,23 @@ class NativeObjCLibrary { _registerName1("value:withObjCType:"); late final ffi.Pointer _sel_valueWithNonretainedObject_1 = _registerName1("valueWithNonretainedObject:"); - ffi.Pointer _objc_msgSend_79( + ffi.Pointer _objc_msgSend_80( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer anObject, ) { - return __objc_msgSend_79( + return __objc_msgSend_80( obj, sel, anObject, ); } - late final __objc_msgSend_79Ptr = _lookup< + late final __objc_msgSend_80Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_79 = __objc_msgSend_79Ptr.asFunction< + late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -2407,394 +2444,394 @@ class NativeObjCLibrary { _registerName1("nonretainedObjectValue"); late final ffi.Pointer _sel_valueWithPointer_1 = _registerName1("valueWithPointer:"); - ffi.Pointer _objc_msgSend_80( + ffi.Pointer _objc_msgSend_81( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer pointer, ) { - return __objc_msgSend_80( + return __objc_msgSend_81( obj, sel, pointer, ); } - late final __objc_msgSend_80Ptr = _lookup< + late final __objc_msgSend_81Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< + late final __objc_msgSend_81 = __objc_msgSend_81Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_pointerValue1 = _registerName1("pointerValue"); - ffi.Pointer _objc_msgSend_81( + ffi.Pointer _objc_msgSend_82( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_81( + return __objc_msgSend_82( obj, sel, ); } - late final __objc_msgSend_81Ptr = _lookup< + late final __objc_msgSend_82Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_81 = __objc_msgSend_81Ptr.asFunction< + late final __objc_msgSend_82 = __objc_msgSend_82Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_isEqualToValue_1 = _registerName1("isEqualToValue:"); late final ffi.Pointer _sel_getValue_1 = _registerName1("getValue:"); - void _objc_msgSend_82( + void _objc_msgSend_83( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer value, ) { - return __objc_msgSend_82( + return __objc_msgSend_83( obj, sel, value, ); } - late final __objc_msgSend_82Ptr = _lookup< + late final __objc_msgSend_83Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_82 = __objc_msgSend_82Ptr.asFunction< + late final __objc_msgSend_83 = __objc_msgSend_83Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_valueWithRange_1 = _registerName1("valueWithRange:"); - ffi.Pointer _objc_msgSend_83( + ffi.Pointer _objc_msgSend_84( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ) { - return __objc_msgSend_83( + return __objc_msgSend_84( obj, sel, range, ); } - late final __objc_msgSend_83Ptr = _lookup< + late final __objc_msgSend_84Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_83 = __objc_msgSend_83Ptr.asFunction< + late final __objc_msgSend_84 = __objc_msgSend_84Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, NSRange)>(); late final ffi.Pointer _sel_rangeValue1 = _registerName1("rangeValue"); - NSRange _objc_msgSend_84( + NSRange _objc_msgSend_85( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_84( + return __objc_msgSend_85( obj, sel, ); } - late final __objc_msgSend_84Ptr = _lookup< + late final __objc_msgSend_85Ptr = _lookup< ffi.NativeFunction< NSRange Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_84 = __objc_msgSend_84Ptr.asFunction< + late final __objc_msgSend_85 = __objc_msgSend_85Ptr.asFunction< NSRange Function(ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _class_NSNumber1 = _getClass1("NSNumber"); late final ffi.Pointer _sel_initWithChar_1 = _registerName1("initWithChar:"); - ffi.Pointer _objc_msgSend_85( + ffi.Pointer _objc_msgSend_86( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_85( + return __objc_msgSend_86( obj, sel, value, ); } - late final __objc_msgSend_85Ptr = _lookup< + late final __objc_msgSend_86Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, pkg_ffi.Char)>>('objc_msgSend'); - late final __objc_msgSend_85 = __objc_msgSend_85Ptr.asFunction< + late final __objc_msgSend_86 = __objc_msgSend_86Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithUnsignedChar_1 = _registerName1("initWithUnsignedChar:"); - ffi.Pointer _objc_msgSend_86( + ffi.Pointer _objc_msgSend_87( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_86( + return __objc_msgSend_87( obj, sel, value, ); } - late final __objc_msgSend_86Ptr = _lookup< + late final __objc_msgSend_87Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, pkg_ffi.UnsignedChar)>>('objc_msgSend'); - late final __objc_msgSend_86 = __objc_msgSend_86Ptr.asFunction< + late final __objc_msgSend_87 = __objc_msgSend_87Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithShort_1 = _registerName1("initWithShort:"); - ffi.Pointer _objc_msgSend_87( + ffi.Pointer _objc_msgSend_88( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_87( + return __objc_msgSend_88( obj, sel, value, ); } - late final __objc_msgSend_87Ptr = _lookup< + late final __objc_msgSend_88Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, pkg_ffi.Short)>>('objc_msgSend'); - late final __objc_msgSend_87 = __objc_msgSend_87Ptr.asFunction< + late final __objc_msgSend_88 = __objc_msgSend_88Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithUnsignedShort_1 = _registerName1("initWithUnsignedShort:"); - ffi.Pointer _objc_msgSend_88( + ffi.Pointer _objc_msgSend_89( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_88( + return __objc_msgSend_89( obj, sel, value, ); } - late final __objc_msgSend_88Ptr = _lookup< + late final __objc_msgSend_89Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, pkg_ffi.UnsignedShort)>>('objc_msgSend'); - late final __objc_msgSend_88 = __objc_msgSend_88Ptr.asFunction< + late final __objc_msgSend_89 = __objc_msgSend_89Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithInt_1 = _registerName1("initWithInt:"); - ffi.Pointer _objc_msgSend_89( + ffi.Pointer _objc_msgSend_90( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_89( + return __objc_msgSend_90( obj, sel, value, ); } - late final __objc_msgSend_89Ptr = _lookup< + late final __objc_msgSend_90Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, pkg_ffi.Int)>>('objc_msgSend'); - late final __objc_msgSend_89 = __objc_msgSend_89Ptr.asFunction< + late final __objc_msgSend_90 = __objc_msgSend_90Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithUnsignedInt_1 = _registerName1("initWithUnsignedInt:"); - ffi.Pointer _objc_msgSend_90( + ffi.Pointer _objc_msgSend_91( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_90( + return __objc_msgSend_91( obj, sel, value, ); } - late final __objc_msgSend_90Ptr = _lookup< + late final __objc_msgSend_91Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_90 = __objc_msgSend_90Ptr.asFunction< + late final __objc_msgSend_91 = __objc_msgSend_91Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithLong_1 = _registerName1("initWithLong:"); - ffi.Pointer _objc_msgSend_91( + ffi.Pointer _objc_msgSend_92( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_91( + return __objc_msgSend_92( obj, sel, value, ); } - late final __objc_msgSend_91Ptr = _lookup< + late final __objc_msgSend_92Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, pkg_ffi.Long)>>('objc_msgSend'); - late final __objc_msgSend_91 = __objc_msgSend_91Ptr.asFunction< + late final __objc_msgSend_92 = __objc_msgSend_92Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithUnsignedLong_1 = _registerName1("initWithUnsignedLong:"); - ffi.Pointer _objc_msgSend_92( + ffi.Pointer _objc_msgSend_93( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_92( + return __objc_msgSend_93( obj, sel, value, ); } - late final __objc_msgSend_92Ptr = _lookup< + late final __objc_msgSend_93Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, pkg_ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_92 = __objc_msgSend_92Ptr.asFunction< + late final __objc_msgSend_93 = __objc_msgSend_93Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithLongLong_1 = _registerName1("initWithLongLong:"); - ffi.Pointer _objc_msgSend_93( + ffi.Pointer _objc_msgSend_94( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_93( + return __objc_msgSend_94( obj, sel, value, ); } - late final __objc_msgSend_93Ptr = _lookup< + late final __objc_msgSend_94Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, pkg_ffi.LongLong)>>('objc_msgSend'); - late final __objc_msgSend_93 = __objc_msgSend_93Ptr.asFunction< + late final __objc_msgSend_94 = __objc_msgSend_94Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithUnsignedLongLong_1 = _registerName1("initWithUnsignedLongLong:"); - ffi.Pointer _objc_msgSend_94( + ffi.Pointer _objc_msgSend_95( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_94( + return __objc_msgSend_95( obj, sel, value, ); } - late final __objc_msgSend_94Ptr = _lookup< + late final __objc_msgSend_95Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, pkg_ffi.UnsignedLongLong)>>('objc_msgSend'); - late final __objc_msgSend_94 = __objc_msgSend_94Ptr.asFunction< + late final __objc_msgSend_95 = __objc_msgSend_95Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithFloat_1 = _registerName1("initWithFloat:"); - ffi.Pointer _objc_msgSend_95( + ffi.Pointer _objc_msgSend_96( ffi.Pointer obj, ffi.Pointer sel, double value, ) { - return __objc_msgSend_95( + return __objc_msgSend_96( obj, sel, value, ); } - late final __objc_msgSend_95Ptr = _lookup< + late final __objc_msgSend_96Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Float)>>('objc_msgSend'); - late final __objc_msgSend_95 = __objc_msgSend_95Ptr.asFunction< + late final __objc_msgSend_96 = __objc_msgSend_96Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, double)>(); late final ffi.Pointer _sel_initWithDouble_1 = _registerName1("initWithDouble:"); - ffi.Pointer _objc_msgSend_96( + ffi.Pointer _objc_msgSend_97( ffi.Pointer obj, ffi.Pointer sel, double value, ) { - return __objc_msgSend_96( + return __objc_msgSend_97( obj, sel, value, ); } - late final __objc_msgSend_96Ptr = _lookup< + late final __objc_msgSend_97Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_96 = __objc_msgSend_96Ptr.asFunction< + late final __objc_msgSend_97 = __objc_msgSend_97Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, double)>(); late final ffi.Pointer _sel_initWithBool_1 = _registerName1("initWithBool:"); - ffi.Pointer _objc_msgSend_97( + ffi.Pointer _objc_msgSend_98( ffi.Pointer obj, ffi.Pointer sel, bool value, ) { - return __objc_msgSend_97( + return __objc_msgSend_98( obj, sel, value ? 1 : 0, ); } - late final __objc_msgSend_97Ptr = _lookup< + late final __objc_msgSend_98Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_97 = __objc_msgSend_97Ptr.asFunction< + late final __objc_msgSend_98 = __objc_msgSend_98Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); @@ -2803,97 +2840,97 @@ class NativeObjCLibrary { late final ffi.Pointer _sel_initWithUnsignedInteger_1 = _registerName1("initWithUnsignedInteger:"); late final ffi.Pointer _sel_charValue1 = _registerName1("charValue"); - int _objc_msgSend_98( + int _objc_msgSend_99( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_98( + return __objc_msgSend_99( obj, sel, ); } - late final __objc_msgSend_98Ptr = _lookup< + late final __objc_msgSend_99Ptr = _lookup< ffi.NativeFunction< pkg_ffi.Char Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_98 = __objc_msgSend_98Ptr.asFunction< + late final __objc_msgSend_99 = __objc_msgSend_99Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_unsignedCharValue1 = _registerName1("unsignedCharValue"); - int _objc_msgSend_99( + int _objc_msgSend_100( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_99( + return __objc_msgSend_100( obj, sel, ); } - late final __objc_msgSend_99Ptr = _lookup< + late final __objc_msgSend_100Ptr = _lookup< ffi.NativeFunction< pkg_ffi.UnsignedChar Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_99 = __objc_msgSend_99Ptr.asFunction< + late final __objc_msgSend_100 = __objc_msgSend_100Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_shortValue1 = _registerName1("shortValue"); - int _objc_msgSend_100( + int _objc_msgSend_101( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_100( + return __objc_msgSend_101( obj, sel, ); } - late final __objc_msgSend_100Ptr = _lookup< + late final __objc_msgSend_101Ptr = _lookup< ffi.NativeFunction< pkg_ffi.Short Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_100 = __objc_msgSend_100Ptr.asFunction< + late final __objc_msgSend_101 = __objc_msgSend_101Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_unsignedShortValue1 = _registerName1("unsignedShortValue"); - int _objc_msgSend_101( + int _objc_msgSend_102( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_101( + return __objc_msgSend_102( obj, sel, ); } - late final __objc_msgSend_101Ptr = _lookup< + late final __objc_msgSend_102Ptr = _lookup< ffi.NativeFunction< pkg_ffi.UnsignedShort Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_101 = __objc_msgSend_101Ptr.asFunction< + late final __objc_msgSend_102 = __objc_msgSend_102Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_unsignedIntValue1 = _registerName1("unsignedIntValue"); - int _objc_msgSend_102( + int _objc_msgSend_103( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_102( + return __objc_msgSend_103( obj, sel, ); } - late final __objc_msgSend_102Ptr = _lookup< + late final __objc_msgSend_103Ptr = _lookup< ffi.NativeFunction< pkg_ffi.UnsignedInt Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_102 = __objc_msgSend_102Ptr.asFunction< + late final __objc_msgSend_103 = __objc_msgSend_103Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_longValue1 = _registerName1("longValue"); @@ -2901,21 +2938,21 @@ class NativeObjCLibrary { _registerName1("unsignedLongValue"); late final ffi.Pointer _sel_unsignedLongLongValue1 = _registerName1("unsignedLongLongValue"); - int _objc_msgSend_103( + int _objc_msgSend_104( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_103( + return __objc_msgSend_104( obj, sel, ); } - late final __objc_msgSend_103Ptr = _lookup< + late final __objc_msgSend_104Ptr = _lookup< ffi.NativeFunction< pkg_ffi.UnsignedLongLong Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_103 = __objc_msgSend_103Ptr.asFunction< + late final __objc_msgSend_104 = __objc_msgSend_104Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_unsignedIntegerValue1 = @@ -2966,35 +3003,35 @@ class NativeObjCLibrary { late final ffi.Pointer _sel_count1 = _registerName1("count"); late final ffi.Pointer _sel_objectAtIndex_1 = _registerName1("objectAtIndex:"); - ffi.Pointer _objc_msgSend_104( + ffi.Pointer _objc_msgSend_105( ffi.Pointer obj, ffi.Pointer sel, int index, ) { - return __objc_msgSend_104( + return __objc_msgSend_105( obj, sel, index, ); } - late final __objc_msgSend_104Ptr = _lookup< + late final __objc_msgSend_105Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_104 = __objc_msgSend_104Ptr.asFunction< + late final __objc_msgSend_105 = __objc_msgSend_105Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithObjects_count_1 = _registerName1("initWithObjects:count:"); - instancetype _objc_msgSend_105( + instancetype _objc_msgSend_106( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer> objects, int cnt, ) { - return __objc_msgSend_105( + return __objc_msgSend_106( obj, sel, objects, @@ -3002,14 +3039,14 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_105Ptr = _lookup< + late final __objc_msgSend_106Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, ffi.Pointer, ffi.Pointer>, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_105 = __objc_msgSend_105Ptr.asFunction< + late final __objc_msgSend_106 = __objc_msgSend_106Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer>, int)>(); @@ -3019,13 +3056,13 @@ class NativeObjCLibrary { _registerName1("containsObject:"); late final ffi.Pointer _sel_descriptionWithLocale_indent_1 = _registerName1("descriptionWithLocale:indent:"); - ffi.Pointer _objc_msgSend_106( + ffi.Pointer _objc_msgSend_107( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer locale, int level, ) { - return __objc_msgSend_106( + return __objc_msgSend_107( obj, sel, locale, @@ -3033,14 +3070,14 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_106Ptr = _lookup< + late final __objc_msgSend_107Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_106 = __objc_msgSend_106Ptr.asFunction< + late final __objc_msgSend_107 = __objc_msgSend_107Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); @@ -3048,13 +3085,13 @@ class NativeObjCLibrary { _registerName1("firstObjectCommonWithArray:"); late final ffi.Pointer _sel_getObjects_range_1 = _registerName1("getObjects:range:"); - void _objc_msgSend_107( + void _objc_msgSend_108( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer> objects, NSRange range, ) { - return __objc_msgSend_107( + return __objc_msgSend_108( obj, sel, objects, @@ -3062,45 +3099,45 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_107Ptr = _lookup< + late final __objc_msgSend_108Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer>, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_107 = __objc_msgSend_107Ptr.asFunction< + late final __objc_msgSend_108 = __objc_msgSend_108Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer>, NSRange)>(); late final ffi.Pointer _sel_indexOfObject_1 = _registerName1("indexOfObject:"); - int _objc_msgSend_108( + int _objc_msgSend_109( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer anObject, ) { - return __objc_msgSend_108( + return __objc_msgSend_109( obj, sel, anObject, ); } - late final __objc_msgSend_108Ptr = _lookup< + late final __objc_msgSend_109Ptr = _lookup< ffi.NativeFunction< NSUInteger Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_108 = __objc_msgSend_108Ptr.asFunction< + late final __objc_msgSend_109 = __objc_msgSend_109Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_indexOfObject_inRange_1 = _registerName1("indexOfObject:inRange:"); - int _objc_msgSend_109( + int _objc_msgSend_110( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer anObject, NSRange range, ) { - return __objc_msgSend_109( + return __objc_msgSend_110( obj, sel, anObject, @@ -3108,11 +3145,11 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_109Ptr = _lookup< + late final __objc_msgSend_110Ptr = _lookup< ffi.NativeFunction< NSUInteger Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_109 = __objc_msgSend_109Ptr.asFunction< + late final __objc_msgSend_110 = __objc_msgSend_110Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSRange)>(); @@ -3130,13 +3167,13 @@ class NativeObjCLibrary { _registerName1("sortedArrayHint"); late final ffi.Pointer _sel_writeToURL_error_1 = _registerName1("writeToURL:error:"); - bool _objc_msgSend_110( + bool _objc_msgSend_111( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer url, ffi.Pointer> error, ) { - return __objc_msgSend_110( + return __objc_msgSend_111( obj, sel, url, @@ -3145,14 +3182,14 @@ class NativeObjCLibrary { 0; } - late final __objc_msgSend_110Ptr = _lookup< + late final __objc_msgSend_111Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_110 = __objc_msgSend_110Ptr.asFunction< + late final __objc_msgSend_111 = __objc_msgSend_111Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer>)>(); @@ -3160,13 +3197,13 @@ class NativeObjCLibrary { _registerName1("makeObjectsPerformSelector:"); late final ffi.Pointer _sel_makeObjectsPerformSelector_withObject_1 = _registerName1("makeObjectsPerformSelector:withObject:"); - void _objc_msgSend_111( + void _objc_msgSend_112( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ffi.Pointer argument, ) { - return __objc_msgSend_111( + return __objc_msgSend_112( obj, sel, aSelector, @@ -3174,11 +3211,11 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_111Ptr = _lookup< + late final __objc_msgSend_112Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_111 = __objc_msgSend_111Ptr.asFunction< + late final __objc_msgSend_112 = __objc_msgSend_112Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -3186,16 +3223,36 @@ class NativeObjCLibrary { _registerName1("objectAtIndexedSubscript:"); late final ffi.Pointer _sel_enumerateObjectsUsingBlock_1 = _registerName1("enumerateObjectsUsingBlock:"); + void _objc_msgSend_113( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_113( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_113Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_113 = __objc_msgSend_113Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_enumerateObjectsWithOptions_usingBlock_1 = _registerName1("enumerateObjectsWithOptions:usingBlock:"); - void _objc_msgSend_112( + void _objc_msgSend_114( ffi.Pointer obj, ffi.Pointer sel, int opts, - ffi.Pointer block, + ffi.Pointer<_ObjCBlock> block, ) { - return __objc_msgSend_112( + return __objc_msgSend_114( obj, sel, opts, @@ -3203,25 +3260,25 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_112Ptr = _lookup< + late final __objc_msgSend_114Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_112 = __objc_msgSend_112Ptr.asFunction< + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_114 = __objc_msgSend_114Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); + ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_enumerateObjectsAtIndexes_options_usingBlock_1 = _registerName1("enumerateObjectsAtIndexes:options:usingBlock:"); - void _objc_msgSend_113( + void _objc_msgSend_115( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer s, int opts, - ffi.Pointer block, + ffi.Pointer<_ObjCBlock> block, ) { - return __objc_msgSend_113( + return __objc_msgSend_115( obj, sel, s, @@ -3230,29 +3287,49 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_113Ptr = _lookup< + late final __objc_msgSend_115Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_113 = __objc_msgSend_113Ptr.asFunction< + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_115 = __objc_msgSend_115Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_indexOfObjectPassingTest_1 = _registerName1("indexOfObjectPassingTest:"); + int _objc_msgSend_116( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_116( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_116Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_116 = __objc_msgSend_116Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_indexOfObjectWithOptions_passingTest_1 = _registerName1("indexOfObjectWithOptions:passingTest:"); - int _objc_msgSend_114( + int _objc_msgSend_117( ffi.Pointer obj, ffi.Pointer sel, int opts, - ffi.Pointer predicate, + ffi.Pointer<_ObjCBlock> predicate, ) { - return __objc_msgSend_114( + return __objc_msgSend_117( obj, sel, opts, @@ -3260,25 +3337,25 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_114Ptr = _lookup< + late final __objc_msgSend_117Ptr = _lookup< ffi.NativeFunction< NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_114 = __objc_msgSend_114Ptr.asFunction< + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_117 = __objc_msgSend_117Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); + ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_indexOfObjectAtIndexes_options_passingTest_1 = _registerName1("indexOfObjectAtIndexes:options:passingTest:"); - int _objc_msgSend_115( + int _objc_msgSend_118( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer s, int opts, - ffi.Pointer predicate, + ffi.Pointer<_ObjCBlock> predicate, ) { - return __objc_msgSend_115( + return __objc_msgSend_118( obj, sel, s, @@ -3287,17 +3364,17 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_115Ptr = _lookup< + late final __objc_msgSend_118Ptr = _lookup< ffi.NativeFunction< NSUInteger Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_115 = __objc_msgSend_115Ptr.asFunction< + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_118 = __objc_msgSend_118Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _class_NSIndexSet1 = _getClass1("NSIndexSet"); @@ -3306,23 +3383,23 @@ class NativeObjCLibrary { _registerName1("indexSetWithIndex:"); late final ffi.Pointer _sel_indexSetWithIndexesInRange_1 = _registerName1("indexSetWithIndexesInRange:"); - instancetype _objc_msgSend_116( + instancetype _objc_msgSend_119( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ) { - return __objc_msgSend_116( + return __objc_msgSend_119( obj, sel, range, ); } - late final __objc_msgSend_116Ptr = _lookup< + late final __objc_msgSend_119Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_116 = __objc_msgSend_116Ptr.asFunction< + late final __objc_msgSend_119 = __objc_msgSend_119Ptr.asFunction< instancetype Function( ffi.Pointer, ffi.Pointer, NSRange)>(); @@ -3347,14 +3424,14 @@ class NativeObjCLibrary { _registerName1("indexLessThanOrEqualToIndex:"); late final ffi.Pointer _sel_getIndexes_maxCount_inIndexRange_1 = _registerName1("getIndexes:maxCount:inIndexRange:"); - int _objc_msgSend_117( + int _objc_msgSend_120( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer indexBuffer, int bufferSize, NSRangePointer range, ) { - return __objc_msgSend_117( + return __objc_msgSend_120( obj, sel, indexBuffer, @@ -3363,7 +3440,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_117Ptr = _lookup< + late final __objc_msgSend_120Ptr = _lookup< ffi.NativeFunction< NSUInteger Function( ffi.Pointer, @@ -3371,41 +3448,41 @@ class NativeObjCLibrary { ffi.Pointer, NSUInteger, NSRangePointer)>>('objc_msgSend'); - late final __objc_msgSend_117 = __objc_msgSend_117Ptr.asFunction< + late final __objc_msgSend_120 = __objc_msgSend_120Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, NSRangePointer)>(); late final ffi.Pointer _sel_countOfIndexesInRange_1 = _registerName1("countOfIndexesInRange:"); - int _objc_msgSend_118( + int _objc_msgSend_121( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ) { - return __objc_msgSend_118( + return __objc_msgSend_121( obj, sel, range, ); } - late final __objc_msgSend_118Ptr = _lookup< + late final __objc_msgSend_121Ptr = _lookup< ffi.NativeFunction< NSUInteger Function(ffi.Pointer, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_118 = __objc_msgSend_118Ptr.asFunction< + late final __objc_msgSend_121 = __objc_msgSend_121Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); late final ffi.Pointer _sel_containsIndex_1 = _registerName1("containsIndex:"); late final ffi.Pointer _sel_containsIndexesInRange_1 = _registerName1("containsIndexesInRange:"); - bool _objc_msgSend_119( + bool _objc_msgSend_122( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ) { - return __objc_msgSend_119( + return __objc_msgSend_122( obj, sel, range, @@ -3413,11 +3490,11 @@ class NativeObjCLibrary { 0; } - late final __objc_msgSend_119Ptr = _lookup< + late final __objc_msgSend_122Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_119 = __objc_msgSend_119Ptr.asFunction< + late final __objc_msgSend_122 = __objc_msgSend_122Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); late final ffi.Pointer _sel_containsIndexes_1 = @@ -3426,20 +3503,62 @@ class NativeObjCLibrary { _registerName1("intersectsIndexesInRange:"); late final ffi.Pointer _sel_enumerateIndexesUsingBlock_1 = _registerName1("enumerateIndexesUsingBlock:"); + void _objc_msgSend_123( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_123( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_123Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_123 = __objc_msgSend_123Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_enumerateIndexesWithOptions_usingBlock_1 = _registerName1("enumerateIndexesWithOptions:usingBlock:"); + void _objc_msgSend_124( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_124( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_124Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_124 = __objc_msgSend_124Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_enumerateIndexesInRange_options_usingBlock_1 = _registerName1("enumerateIndexesInRange:options:usingBlock:"); - void _objc_msgSend_120( + void _objc_msgSend_125( ffi.Pointer obj, ffi.Pointer sel, NSRange range, int opts, - ffi.Pointer block, + ffi.Pointer<_ObjCBlock> block, ) { - return __objc_msgSend_120( + return __objc_msgSend_125( obj, sel, range, @@ -3448,28 +3567,70 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_120Ptr = _lookup< + late final __objc_msgSend_125Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_120 = __objc_msgSend_120Ptr.asFunction< + NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_125 = __objc_msgSend_125Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer)>(); + ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_indexPassingTest_1 = _registerName1("indexPassingTest:"); + int _objc_msgSend_126( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_126( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_126Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_126 = __objc_msgSend_126Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_indexWithOptions_passingTest_1 = _registerName1("indexWithOptions:passingTest:"); + int _objc_msgSend_127( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_127( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_127Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_127 = __objc_msgSend_127Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_indexInRange_options_passingTest_1 = _registerName1("indexInRange:options:passingTest:"); - int _objc_msgSend_121( + int _objc_msgSend_128( ffi.Pointer obj, ffi.Pointer sel, NSRange range, int opts, - ffi.Pointer predicate, + ffi.Pointer<_ObjCBlock> predicate, ) { - return __objc_msgSend_121( + return __objc_msgSend_128( obj, sel, range, @@ -3478,45 +3639,45 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_121Ptr = _lookup< + late final __objc_msgSend_128Ptr = _lookup< ffi.NativeFunction< NSUInteger Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_121 = __objc_msgSend_121Ptr.asFunction< + NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_128 = __objc_msgSend_128Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer)>(); + ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_indexesPassingTest_1 = _registerName1("indexesPassingTest:"); - ffi.Pointer _objc_msgSend_122( + ffi.Pointer _objc_msgSend_129( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer predicate, + ffi.Pointer<_ObjCBlock> predicate, ) { - return __objc_msgSend_122( + return __objc_msgSend_129( obj, sel, predicate, ); } - late final __objc_msgSend_122Ptr = _lookup< + late final __objc_msgSend_129Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_122 = __objc_msgSend_122Ptr.asFunction< + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_129 = __objc_msgSend_129Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_indexesWithOptions_passingTest_1 = _registerName1("indexesWithOptions:passingTest:"); - ffi.Pointer _objc_msgSend_123( + ffi.Pointer _objc_msgSend_130( ffi.Pointer obj, ffi.Pointer sel, int opts, - ffi.Pointer predicate, + ffi.Pointer<_ObjCBlock> predicate, ) { - return __objc_msgSend_123( + return __objc_msgSend_130( obj, sel, opts, @@ -3524,27 +3685,27 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_123Ptr = _lookup< + late final __objc_msgSend_130Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_123 = __objc_msgSend_123Ptr.asFunction< + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_130 = __objc_msgSend_130Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_indexesInRange_options_passingTest_1 = _registerName1("indexesInRange:options:passingTest:"); - ffi.Pointer _objc_msgSend_124( + ffi.Pointer _objc_msgSend_131( ffi.Pointer obj, ffi.Pointer sel, NSRange range, int opts, - ffi.Pointer predicate, + ffi.Pointer<_ObjCBlock> predicate, ) { - return __objc_msgSend_124( + return __objc_msgSend_131( obj, sel, range, @@ -3553,41 +3714,152 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_124Ptr = _lookup< + late final __objc_msgSend_131Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, NSRange, ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_124 = __objc_msgSend_124Ptr.asFunction< + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_131 = __objc_msgSend_131Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSRange, int, ffi.Pointer)>(); + ffi.Pointer, NSRange, int, ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_enumerateRangesUsingBlock_1 = _registerName1("enumerateRangesUsingBlock:"); + void _objc_msgSend_132( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_132( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_132Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_132 = __objc_msgSend_132Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_enumerateRangesWithOptions_usingBlock_1 = _registerName1("enumerateRangesWithOptions:usingBlock:"); + void _objc_msgSend_133( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_133( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_133Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_133 = __objc_msgSend_133Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_enumerateRangesInRange_options_usingBlock_1 = _registerName1("enumerateRangesInRange:options:usingBlock:"); + void _objc_msgSend_134( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_134( + obj, + sel, + range, + opts, + block, + ); + } + + late final __objc_msgSend_134Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_134 = __objc_msgSend_134Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_indexesOfObjectsPassingTest_1 = _registerName1("indexesOfObjectsPassingTest:"); + ffi.Pointer _objc_msgSend_135( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_135( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_135Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_135 = __objc_msgSend_135Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_indexesOfObjectsWithOptions_passingTest_1 = _registerName1("indexesOfObjectsWithOptions:passingTest:"); + ffi.Pointer _objc_msgSend_136( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_136( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_136Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_136 = __objc_msgSend_136Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_indexesOfObjectsAtIndexes_options_passingTest_1 = _registerName1("indexesOfObjectsAtIndexes:options:passingTest:"); - ffi.Pointer _objc_msgSend_125( + ffi.Pointer _objc_msgSend_137( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer s, int opts, - ffi.Pointer predicate, + ffi.Pointer<_ObjCBlock> predicate, ) { - return __objc_msgSend_125( + return __objc_msgSend_137( obj, sel, s, @@ -3596,26 +3868,26 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_125Ptr = _lookup< + late final __objc_msgSend_137Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_125 = __objc_msgSend_125Ptr.asFunction< + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_137 = __objc_msgSend_137Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); + ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_indexOfObject_inSortedRange_options_usingComparator_1 = _registerName1("indexOfObject:inSortedRange:options:usingComparator:"); - int _objc_msgSend_126( + int _objc_msgSend_138( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer obj1, @@ -3623,7 +3895,7 @@ class NativeObjCLibrary { int opts, NSComparator cmp, ) { - return __objc_msgSend_126( + return __objc_msgSend_138( obj, sel, obj1, @@ -3633,7 +3905,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_126Ptr = _lookup< + late final __objc_msgSend_138Ptr = _lookup< ffi.NativeFunction< NSUInteger Function( ffi.Pointer, @@ -3642,7 +3914,7 @@ class NativeObjCLibrary { NSRange, ffi.Int32, NSComparator)>>('objc_msgSend'); - late final __objc_msgSend_126 = __objc_msgSend_126Ptr.asFunction< + late final __objc_msgSend_138 = __objc_msgSend_138Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSRange, int, NSComparator)>(); @@ -3661,13 +3933,13 @@ class NativeObjCLibrary { _registerName1("initWithArray:"); late final ffi.Pointer _sel_initWithArray_copyItems_1 = _registerName1("initWithArray:copyItems:"); - instancetype _objc_msgSend_127( + instancetype _objc_msgSend_139( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer array, bool flag, ) { - return __objc_msgSend_127( + return __objc_msgSend_139( obj, sel, array, @@ -3675,33 +3947,33 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_127Ptr = _lookup< + late final __objc_msgSend_139Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_127 = __objc_msgSend_127Ptr.asFunction< + late final __objc_msgSend_139 = __objc_msgSend_139Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_getObjects_1 = _registerName1("getObjects:"); - void _objc_msgSend_128( + void _objc_msgSend_140( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer> objects, ) { - return __objc_msgSend_128( + return __objc_msgSend_140( obj, sel, objects, ); } - late final __objc_msgSend_128Ptr = _lookup< + late final __objc_msgSend_140Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_128 = __objc_msgSend_128Ptr.asFunction< + late final __objc_msgSend_140 = __objc_msgSend_140Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer>)>(); @@ -3711,13 +3983,13 @@ class NativeObjCLibrary { _registerName1("addObject:"); late final ffi.Pointer _sel_insertObject_atIndex_1 = _registerName1("insertObject:atIndex:"); - void _objc_msgSend_129( + void _objc_msgSend_141( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer anObject, int index, ) { - return __objc_msgSend_129( + return __objc_msgSend_141( obj, sel, anObject, @@ -3725,11 +3997,11 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_129Ptr = _lookup< + late final __objc_msgSend_141Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_129 = __objc_msgSend_129Ptr.asFunction< + late final __objc_msgSend_141 = __objc_msgSend_141Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); @@ -3739,13 +4011,13 @@ class NativeObjCLibrary { _registerName1("removeObjectAtIndex:"); late final ffi.Pointer _sel_replaceObjectAtIndex_withObject_1 = _registerName1("replaceObjectAtIndex:withObject:"); - void _objc_msgSend_130( + void _objc_msgSend_142( ffi.Pointer obj, ffi.Pointer sel, int index, ffi.Pointer anObject, ) { - return __objc_msgSend_130( + return __objc_msgSend_142( obj, sel, index, @@ -3753,11 +4025,11 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_130Ptr = _lookup< + late final __objc_msgSend_142Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSUInteger, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_130 = __objc_msgSend_130Ptr.asFunction< + late final __objc_msgSend_142 = __objc_msgSend_142Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); @@ -3768,13 +4040,13 @@ class NativeObjCLibrary { late final ffi.Pointer _sel_exchangeObjectAtIndex_withObjectAtIndex_1 = _registerName1("exchangeObjectAtIndex:withObjectAtIndex:"); - void _objc_msgSend_131( + void _objc_msgSend_143( ffi.Pointer obj, ffi.Pointer sel, int idx1, int idx2, ) { - return __objc_msgSend_131( + return __objc_msgSend_143( obj, sel, idx1, @@ -3782,24 +4054,24 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_131Ptr = _lookup< + late final __objc_msgSend_143Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSUInteger, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_131 = __objc_msgSend_131Ptr.asFunction< + late final __objc_msgSend_143 = __objc_msgSend_143Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int, int)>(); late final ffi.Pointer _sel_removeAllObjects1 = _registerName1("removeAllObjects"); late final ffi.Pointer _sel_removeObject_inRange_1 = _registerName1("removeObject:inRange:"); - void _objc_msgSend_132( + void _objc_msgSend_144( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer anObject, NSRange range, ) { - return __objc_msgSend_132( + return __objc_msgSend_144( obj, sel, anObject, @@ -3807,11 +4079,11 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_132Ptr = _lookup< + late final __objc_msgSend_144Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_132 = __objc_msgSend_132Ptr.asFunction< + late final __objc_msgSend_144 = __objc_msgSend_144Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSRange)>(); @@ -3823,13 +4095,13 @@ class NativeObjCLibrary { _registerName1("removeObjectIdenticalTo:"); late final ffi.Pointer _sel_removeObjectsFromIndices_numIndices_1 = _registerName1("removeObjectsFromIndices:numIndices:"); - void _objc_msgSend_133( + void _objc_msgSend_145( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer indices, int cnt, ) { - return __objc_msgSend_133( + return __objc_msgSend_145( obj, sel, indices, @@ -3837,11 +4109,11 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_133Ptr = _lookup< + late final __objc_msgSend_145Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_133 = __objc_msgSend_133Ptr.asFunction< + late final __objc_msgSend_145 = __objc_msgSend_145Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); @@ -3849,36 +4121,36 @@ class NativeObjCLibrary { _registerName1("removeObjectsInArray:"); late final ffi.Pointer _sel_removeObjectsInRange_1 = _registerName1("removeObjectsInRange:"); - void _objc_msgSend_134( + void _objc_msgSend_146( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ) { - return __objc_msgSend_134( + return __objc_msgSend_146( obj, sel, range, ); } - late final __objc_msgSend_134Ptr = _lookup< + late final __objc_msgSend_146Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_134 = __objc_msgSend_134Ptr.asFunction< + late final __objc_msgSend_146 = __objc_msgSend_146Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, NSRange)>(); late final ffi.Pointer _sel_replaceObjectsInRange_withObjectsFromArray_range_1 = _registerName1("replaceObjectsInRange:withObjectsFromArray:range:"); - void _objc_msgSend_135( + void _objc_msgSend_147( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ffi.Pointer otherArray, NSRange otherRange, ) { - return __objc_msgSend_135( + return __objc_msgSend_147( obj, sel, range, @@ -3887,24 +4159,24 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_135Ptr = _lookup< + late final __objc_msgSend_147Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSRange, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_135 = __objc_msgSend_135Ptr.asFunction< + late final __objc_msgSend_147 = __objc_msgSend_147Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, NSRange, ffi.Pointer, NSRange)>(); late final ffi.Pointer _sel_replaceObjectsInRange_withObjectsFromArray_1 = _registerName1("replaceObjectsInRange:withObjectsFromArray:"); - void _objc_msgSend_136( + void _objc_msgSend_148( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ffi.Pointer otherArray, ) { - return __objc_msgSend_136( + return __objc_msgSend_148( obj, sel, range, @@ -3912,18 +4184,18 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_136Ptr = _lookup< + late final __objc_msgSend_148Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSRange, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_136 = __objc_msgSend_136Ptr.asFunction< + late final __objc_msgSend_148 = __objc_msgSend_148Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, NSRange, ffi.Pointer)>(); late final ffi.Pointer _sel_setArray_1 = _registerName1("setArray:"); late final ffi.Pointer _sel_sortUsingFunction_context_1 = _registerName1("sortUsingFunction:context:"); - void _objc_msgSend_137( + void _objc_msgSend_149( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer< @@ -3933,7 +4205,7 @@ class NativeObjCLibrary { compare, ffi.Pointer context, ) { - return __objc_msgSend_137( + return __objc_msgSend_149( obj, sel, compare, @@ -3941,7 +4213,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_137Ptr = _lookup< + late final __objc_msgSend_149Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -3951,7 +4223,7 @@ class NativeObjCLibrary { NSInteger Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_137 = __objc_msgSend_137Ptr.asFunction< + late final __objc_msgSend_149 = __objc_msgSend_149Ptr.asFunction< void Function( ffi.Pointer, ffi.Pointer, @@ -3965,13 +4237,13 @@ class NativeObjCLibrary { _registerName1("sortUsingSelector:"); late final ffi.Pointer _sel_insertObjects_atIndexes_1 = _registerName1("insertObjects:atIndexes:"); - void _objc_msgSend_138( + void _objc_msgSend_150( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer objects, ffi.Pointer indexes, ) { - return __objc_msgSend_138( + return __objc_msgSend_150( obj, sel, objects, @@ -3979,14 +4251,14 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_138Ptr = _lookup< + late final __objc_msgSend_150Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_138 = __objc_msgSend_138Ptr.asFunction< + late final __objc_msgSend_150 = __objc_msgSend_150Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -3998,15 +4270,35 @@ class NativeObjCLibrary { _registerName1("setObject:atIndexedSubscript:"); late final ffi.Pointer _sel_sortUsingComparator_1 = _registerName1("sortUsingComparator:"); + void _objc_msgSend_151( + ffi.Pointer obj, + ffi.Pointer sel, + NSComparator cmptr, + ) { + return __objc_msgSend_151( + obj, + sel, + cmptr, + ); + } + + late final __objc_msgSend_151Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSComparator)>>('objc_msgSend'); + late final __objc_msgSend_151 = __objc_msgSend_151Ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, NSComparator)>(); + late final ffi.Pointer _sel_sortWithOptions_usingComparator_1 = _registerName1("sortWithOptions:usingComparator:"); - void _objc_msgSend_139( + void _objc_msgSend_152( ffi.Pointer obj, ffi.Pointer sel, int opts, NSComparator cmptr, ) { - return __objc_msgSend_139( + return __objc_msgSend_152( obj, sel, opts, @@ -4014,11 +4306,11 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_139Ptr = _lookup< + late final __objc_msgSend_152Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Int32, NSComparator)>>('objc_msgSend'); - late final __objc_msgSend_139 = __objc_msgSend_139Ptr.asFunction< + late final __objc_msgSend_152 = __objc_msgSend_152Ptr.asFunction< void Function( ffi.Pointer, ffi.Pointer, int, NSComparator)>(); @@ -4042,14 +4334,14 @@ class NativeObjCLibrary { _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1 = _registerName1( "registerDataRepresentationForTypeIdentifier:visibility:loadHandler:"); - void _objc_msgSend_140( + void _objc_msgSend_153( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, int visibility, - ffi.Pointer loadHandler, + ffi.Pointer<_ObjCBlock> loadHandler, ) { - return __objc_msgSend_140( + return __objc_msgSend_153( obj, sel, typeIdentifier, @@ -4058,31 +4350,31 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_140Ptr = _lookup< + late final __objc_msgSend_153Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_140 = __objc_msgSend_140Ptr.asFunction< + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_153 = __objc_msgSend_153Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1 = _registerName1( "registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:"); - void _objc_msgSend_141( + void _objc_msgSend_154( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, int fileOptions, int visibility, - ffi.Pointer loadHandler, + ffi.Pointer<_ObjCBlock> loadHandler, ) { - return __objc_msgSend_141( + return __objc_msgSend_154( obj, sel, typeIdentifier, @@ -4092,7 +4384,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_141Ptr = _lookup< + late final __objc_msgSend_154Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -4100,10 +4392,10 @@ class NativeObjCLibrary { ffi.Pointer, ffi.Int32, ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_141 = __objc_msgSend_141Ptr.asFunction< + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_154 = __objc_msgSend_154Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, ffi.Pointer)>(); + ffi.Pointer, int, int, ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_registeredTypeIdentifiers1 = _registerName1("registeredTypeIdentifiers"); @@ -4113,13 +4405,13 @@ class NativeObjCLibrary { _sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1 = _registerName1( "hasRepresentationConformingToTypeIdentifier:fileOptions:"); - bool _objc_msgSend_142( + bool _objc_msgSend_155( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, int fileOptions, ) { - return __objc_msgSend_142( + return __objc_msgSend_155( obj, sel, typeIdentifier, @@ -4128,11 +4420,11 @@ class NativeObjCLibrary { 0; } - late final __objc_msgSend_142Ptr = _lookup< + late final __objc_msgSend_155Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_142 = __objc_msgSend_142Ptr.asFunction< + late final __objc_msgSend_155 = __objc_msgSend_155Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); @@ -4142,13 +4434,13 @@ class NativeObjCLibrary { _sel_loadDataRepresentationForTypeIdentifier_completionHandler_1 = _registerName1( "loadDataRepresentationForTypeIdentifier:completionHandler:"); - ffi.Pointer _objc_msgSend_143( + ffi.Pointer _objc_msgSend_156( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, - ffi.Pointer completionHandler, + ffi.Pointer<_ObjCBlock> completionHandler, ) { - return __objc_msgSend_143( + return __objc_msgSend_156( obj, sel, typeIdentifier, @@ -4156,19 +4448,19 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_143Ptr = _lookup< + late final __objc_msgSend_156Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_143 = __objc_msgSend_143Ptr.asFunction< + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_156 = __objc_msgSend_156Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_loadFileRepresentationForTypeIdentifier_completionHandler_1 = @@ -4178,6 +4470,34 @@ class NativeObjCLibrary { _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1 = _registerName1( "loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:"); + ffi.Pointer _objc_msgSend_157( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_157( + obj, + sel, + typeIdentifier, + completionHandler, + ); + } + + late final __objc_msgSend_157Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_157 = __objc_msgSend_157Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_suggestedName1 = _registerName1("suggestedName"); late final ffi.Pointer _sel_setSuggestedName_1 = @@ -4186,13 +4506,13 @@ class NativeObjCLibrary { _registerName1("initWithObject:"); late final ffi.Pointer _sel_registerObject_visibility_1 = _registerName1("registerObject:visibility:"); - void _objc_msgSend_144( + void _objc_msgSend_158( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer object, int visibility, ) { - return __objc_msgSend_144( + return __objc_msgSend_158( obj, sel, object, @@ -4200,11 +4520,11 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_144Ptr = _lookup< + late final __objc_msgSend_158Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_144 = __objc_msgSend_144Ptr.asFunction< + late final __objc_msgSend_158 = __objc_msgSend_158Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); @@ -4220,17 +4540,42 @@ class NativeObjCLibrary { late final ffi.Pointer _sel_registerItemForTypeIdentifier_loadHandler_1 = _registerName1("registerItemForTypeIdentifier:loadHandler:"); + void _objc_msgSend_159( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + NSItemProviderLoadHandler loadHandler, + ) { + return __objc_msgSend_159( + obj, + sel, + typeIdentifier, + loadHandler, + ); + } + + late final __objc_msgSend_159Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderLoadHandler)>>('objc_msgSend'); + late final __objc_msgSend_159 = __objc_msgSend_159Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSItemProviderLoadHandler)>(); + late final ffi.Pointer _sel_loadItemForTypeIdentifier_options_completionHandler_1 = _registerName1("loadItemForTypeIdentifier:options:completionHandler:"); - void _objc_msgSend_145( + void _objc_msgSend_160( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, ffi.Pointer options, NSItemProviderCompletionHandler completionHandler, ) { - return __objc_msgSend_145( + return __objc_msgSend_160( obj, sel, typeIdentifier, @@ -4239,7 +4584,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_145Ptr = _lookup< + late final __objc_msgSend_160Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -4247,7 +4592,7 @@ class NativeObjCLibrary { ffi.Pointer, ffi.Pointer, NSItemProviderCompletionHandler)>>('objc_msgSend'); - late final __objc_msgSend_145 = __objc_msgSend_145Ptr.asFunction< + late final __objc_msgSend_160 = __objc_msgSend_160Ptr.asFunction< void Function( ffi.Pointer, ffi.Pointer, @@ -4257,11 +4602,74 @@ class NativeObjCLibrary { late final ffi.Pointer _sel_previewImageHandler1 = _registerName1("previewImageHandler"); + NSItemProviderLoadHandler _objc_msgSend_161( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_161( + obj, + sel, + ); + } + + late final __objc_msgSend_161Ptr = _lookup< + ffi.NativeFunction< + NSItemProviderLoadHandler Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_161 = __objc_msgSend_161Ptr.asFunction< + NSItemProviderLoadHandler Function( + ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_setPreviewImageHandler_1 = _registerName1("setPreviewImageHandler:"); + void _objc_msgSend_162( + ffi.Pointer obj, + ffi.Pointer sel, + NSItemProviderLoadHandler value, + ) { + return __objc_msgSend_162( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_162Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSItemProviderLoadHandler)>>('objc_msgSend'); + late final __objc_msgSend_162 = __objc_msgSend_162Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + NSItemProviderLoadHandler)>(); + late final ffi.Pointer _sel_loadPreviewImageWithOptions_completionHandler_1 = _registerName1("loadPreviewImageWithOptions:completionHandler:"); + void _objc_msgSend_163( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer options, + NSItemProviderCompletionHandler completionHandler, + ) { + return __objc_msgSend_163( + obj, + sel, + options, + completionHandler, + ); + } + + late final __objc_msgSend_163Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler)>>('objc_msgSend'); + late final __objc_msgSend_163 = __objc_msgSend_163Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSItemProviderCompletionHandler)>(); + late final ffi.Pointer> _NSExtensionJavaScriptPreprocessingResultsKey = _lookup>( @@ -4549,7 +4957,7 @@ class NativeObjCLibrary { late final ffi.Pointer _sel_replaceOccurrencesOfString_withString_options_range_1 = _registerName1("replaceOccurrencesOfString:withString:options:range:"); - int _objc_msgSend_146( + int _objc_msgSend_164( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer target, @@ -4557,7 +4965,7 @@ class NativeObjCLibrary { int options, NSRange searchRange, ) { - return __objc_msgSend_146( + return __objc_msgSend_164( obj, sel, target, @@ -4567,7 +4975,7 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_146Ptr = _lookup< + late final __objc_msgSend_164Ptr = _lookup< ffi.NativeFunction< NSUInteger Function( ffi.Pointer, @@ -4576,14 +4984,14 @@ class NativeObjCLibrary { ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_146 = __objc_msgSend_146Ptr.asFunction< + late final __objc_msgSend_164 = __objc_msgSend_164Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, int, NSRange)>(); late final ffi.Pointer _sel_applyTransform_reverse_range_updatedRange_1 = _registerName1("applyTransform:reverse:range:updatedRange:"); - bool _objc_msgSend_147( + bool _objc_msgSend_165( ffi.Pointer obj, ffi.Pointer sel, NSStringTransform transform, @@ -4591,7 +4999,7 @@ class NativeObjCLibrary { NSRange range, NSRangePointer resultingRange, ) { - return __objc_msgSend_147( + return __objc_msgSend_165( obj, sel, transform, @@ -4602,7 +5010,7 @@ class NativeObjCLibrary { 0; } - late final __objc_msgSend_147Ptr = _lookup< + late final __objc_msgSend_165Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function( ffi.Pointer, @@ -4611,27 +5019,27 @@ class NativeObjCLibrary { ffi.Uint8, NSRange, NSRangePointer)>>('objc_msgSend'); - late final __objc_msgSend_147 = __objc_msgSend_147Ptr.asFunction< + late final __objc_msgSend_165 = __objc_msgSend_165Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, NSStringTransform, int, NSRange, NSRangePointer)>(); - ffi.Pointer _objc_msgSend_148( + ffi.Pointer _objc_msgSend_166( ffi.Pointer obj, ffi.Pointer sel, int capacity, ) { - return __objc_msgSend_148( + return __objc_msgSend_166( obj, sel, capacity, ); } - late final __objc_msgSend_148Ptr = _lookup< + late final __objc_msgSend_166Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_148 = __objc_msgSend_148Ptr.asFunction< + late final __objc_msgSend_166 = __objc_msgSend_166Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); @@ -4656,74 +5064,74 @@ class NativeObjCLibrary { late final ffi.Pointer _class_Foo1 = _getClass1("Foo"); late final ffi.Pointer _sel_intVal1 = _registerName1("intVal"); - int _objc_msgSend_149( + int _objc_msgSend_167( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_149( + return __objc_msgSend_167( obj, sel, ); } - late final __objc_msgSend_149Ptr = _lookup< + late final __objc_msgSend_167Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_149 = __objc_msgSend_149Ptr.asFunction< + late final __objc_msgSend_167 = __objc_msgSend_167Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_setIntVal_1 = _registerName1("setIntVal:"); - void _objc_msgSend_150( + void _objc_msgSend_168( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_150( + return __objc_msgSend_168( obj, sel, value, ); } - late final __objc_msgSend_150Ptr = _lookup< + late final __objc_msgSend_168Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_150 = __objc_msgSend_150Ptr.asFunction< + late final __objc_msgSend_168 = __objc_msgSend_168Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_makeFoo_1 = _registerName1("makeFoo:"); - ffi.Pointer _objc_msgSend_151( + ffi.Pointer _objc_msgSend_169( ffi.Pointer obj, ffi.Pointer sel, double x, ) { - return __objc_msgSend_151( + return __objc_msgSend_169( obj, sel, x, ); } - late final __objc_msgSend_151Ptr = _lookup< + late final __objc_msgSend_169Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_151 = __objc_msgSend_151Ptr.asFunction< + late final __objc_msgSend_169 = __objc_msgSend_169Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, double)>(); late final ffi.Pointer _sel_multiply_withOtherFoo_1 = _registerName1("multiply:withOtherFoo:"); - int _objc_msgSend_152( + int _objc_msgSend_170( ffi.Pointer obj, ffi.Pointer sel, bool useIntVals, ffi.Pointer other, ) { - return __objc_msgSend_152( + return __objc_msgSend_170( obj, sel, useIntVals ? 1 : 0, @@ -4731,33 +5139,33 @@ class NativeObjCLibrary { ); } - late final __objc_msgSend_152Ptr = _lookup< + late final __objc_msgSend_170Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Uint8, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_152 = __objc_msgSend_152Ptr.asFunction< + late final __objc_msgSend_170 = __objc_msgSend_170Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); late final ffi.Pointer _sel_setDoubleVal_1 = _registerName1("setDoubleVal:"); - void _objc_msgSend_153( + void _objc_msgSend_171( ffi.Pointer obj, ffi.Pointer sel, double x, ) { - return __objc_msgSend_153( + return __objc_msgSend_171( obj, sel, x, ); } - late final __objc_msgSend_153Ptr = _lookup< + late final __objc_msgSend_171Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_153 = __objc_msgSend_153Ptr.asFunction< + late final __objc_msgSend_171 = __objc_msgSend_171Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, double)>(); } @@ -5038,12 +5446,12 @@ class NSObject extends _ObjCWrapper { static NSString description(NativeObjCLibrary _lib) { final _ret = - _lib._objc_msgSend_74(_lib._class_NSObject1, _lib._sel_description1); + _lib._objc_msgSend_75(_lib._class_NSObject1, _lib._sel_description1); return NSString._(_ret, _lib); } static NSString debugDescription(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_74( + final _ret = _lib._objc_msgSend_75( _lib._class_NSObject1, _lib._sel_debugDescription1); return NSString._(_ret, _lib); } @@ -5053,7 +5461,7 @@ class NSObject extends _ObjCWrapper { } static void setVersion(NativeObjCLibrary _lib, int aVersion) { - _lib._objc_msgSend_75( + _lib._objc_msgSend_76( _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); } @@ -5449,21 +5857,22 @@ class NSString extends NSObject { } void enumerateSubstringsInRange_options_usingBlock( - NSRange range, int opts, NSObject block) { + NSRange range, int opts, ObjCBlock block) { _lib._objc_msgSend_35( _id, _lib._sel_enumerateSubstringsInRange_options_usingBlock_1, range, opts, - block._id); + block._impl); } - void enumerateLinesUsingBlock(NSObject block) { - _lib._objc_msgSend_8(_id, _lib._sel_enumerateLinesUsingBlock_1, block._id); + void enumerateLinesUsingBlock(ObjCBlock1 block) { + _lib._objc_msgSend_36( + _id, _lib._sel_enumerateLinesUsingBlock_1, block._impl); } ffi.Pointer get UTF8String { - return _lib._objc_msgSend_36(_id, _lib._sel_UTF8String1); + return _lib._objc_msgSend_37(_id, _lib._sel_UTF8String1); } int get fastestEncoding { @@ -5475,29 +5884,29 @@ class NSString extends NSObject { } NSData dataUsingEncoding_allowLossyConversion(int encoding, bool lossy) { - final _ret = _lib._objc_msgSend_37(_id, + final _ret = _lib._objc_msgSend_38(_id, _lib._sel_dataUsingEncoding_allowLossyConversion_1, encoding, lossy); return NSData._(_ret, _lib); } NSData dataUsingEncoding(int encoding) { final _ret = - _lib._objc_msgSend_38(_id, _lib._sel_dataUsingEncoding_1, encoding); + _lib._objc_msgSend_39(_id, _lib._sel_dataUsingEncoding_1, encoding); return NSData._(_ret, _lib); } bool canBeConvertedToEncoding(int encoding) { - return _lib._objc_msgSend_39( + return _lib._objc_msgSend_40( _id, _lib._sel_canBeConvertedToEncoding_1, encoding); } void cStringUsingEncoding(int encoding) { - _lib._objc_msgSend_40(_id, _lib._sel_cStringUsingEncoding_1, encoding); + _lib._objc_msgSend_41(_id, _lib._sel_cStringUsingEncoding_1, encoding); } bool getCString_maxLength_encoding( ffi.Pointer buffer, int maxBufferCount, int encoding) { - return _lib._objc_msgSend_41(_id, _lib._sel_getCString_maxLength_encoding_1, + return _lib._objc_msgSend_42(_id, _lib._sel_getCString_maxLength_encoding_1, buffer, maxBufferCount, encoding); } @@ -5509,7 +5918,7 @@ class NSString extends NSObject { int options, NSRange range, NSRangePointer leftover) { - return _lib._objc_msgSend_42( + return _lib._objc_msgSend_43( _id, _lib._sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_1, buffer, @@ -5522,18 +5931,18 @@ class NSString extends NSObject { } int maximumLengthOfBytesUsingEncoding(int enc) { - return _lib._objc_msgSend_43( + return _lib._objc_msgSend_44( _id, _lib._sel_maximumLengthOfBytesUsingEncoding_1, enc); } int lengthOfBytesUsingEncoding(int enc) { - return _lib._objc_msgSend_43( + return _lib._objc_msgSend_44( _id, _lib._sel_lengthOfBytesUsingEncoding_1, enc); } static ffi.Pointer getAvailableStringEncodings( NativeObjCLibrary _lib) { - return _lib._objc_msgSend_44( + return _lib._objc_msgSend_45( _lib._class_NSString1, _lib._sel_availableStringEncodings1); } @@ -5581,7 +5990,7 @@ class NSString extends NSObject { NSString stringByPaddingToLength_withString_startingAtIndex( int newLength, NSObject? padString, int padIndex) { - final _ret = _lib._objc_msgSend_45( + final _ret = _lib._objc_msgSend_46( _id, _lib._sel_stringByPaddingToLength_withString_startingAtIndex_1, newLength, @@ -5591,7 +6000,7 @@ class NSString extends NSObject { } NSString stringByFoldingWithOptions_locale(int options, NSObject? locale) { - final _ret = _lib._objc_msgSend_46( + final _ret = _lib._objc_msgSend_47( _id, _lib._sel_stringByFoldingWithOptions_locale_1, options, @@ -5604,7 +6013,7 @@ class NSString extends NSObject { NSObject? replacement, int options, NSRange searchRange) { - final _ret = _lib._objc_msgSend_47( + final _ret = _lib._objc_msgSend_48( _id, _lib._sel_stringByReplacingOccurrencesOfString_withString_options_range_1, target?._id ?? ffi.nullptr, @@ -5616,7 +6025,7 @@ class NSString extends NSObject { NSString stringByReplacingOccurrencesOfString_withString( NSObject? target, NSObject? replacement) { - final _ret = _lib._objc_msgSend_48( + final _ret = _lib._objc_msgSend_49( _id, _lib._sel_stringByReplacingOccurrencesOfString_withString_1, target?._id ?? ffi.nullptr, @@ -5626,7 +6035,7 @@ class NSString extends NSObject { NSString stringByReplacingCharactersInRange_withString( NSRange range, NSObject? replacement) { - final _ret = _lib._objc_msgSend_49( + final _ret = _lib._objc_msgSend_50( _id, _lib._sel_stringByReplacingCharactersInRange_withString_1, range, @@ -5636,7 +6045,7 @@ class NSString extends NSObject { NSString stringByApplyingTransform_reverse( NSStringTransform transform, bool reverse) { - final _ret = _lib._objc_msgSend_50( + final _ret = _lib._objc_msgSend_51( _id, _lib._sel_stringByApplyingTransform_reverse_1, transform, reverse); return NSString._(_ret, _lib); } @@ -5646,7 +6055,7 @@ class NSString extends NSObject { bool useAuxiliaryFile, int enc, ffi.Pointer> error) { - return _lib._objc_msgSend_51( + return _lib._objc_msgSend_52( _id, _lib._sel_writeToURL_atomically_encoding_error_1, url?._id ?? ffi.nullptr, @@ -5660,7 +6069,7 @@ class NSString extends NSObject { bool useAuxiliaryFile, int enc, ffi.Pointer> error) { - return _lib._objc_msgSend_51( + return _lib._objc_msgSend_52( _id, _lib._sel_writeToFile_atomically_encoding_error_1, path?._id ?? ffi.nullptr, @@ -5680,7 +6089,7 @@ class NSString extends NSObject { NSString initWithCharactersNoCopy_length_freeWhenDone( ffi.Pointer characters, int length, bool freeBuffer) { - final _ret = _lib._objc_msgSend_52( + final _ret = _lib._objc_msgSend_53( _id, _lib._sel_initWithCharactersNoCopy_length_freeWhenDone_1, characters, @@ -5690,25 +6099,25 @@ class NSString extends NSObject { } NSString initWithCharactersNoCopy_length_deallocator( - ffi.Pointer chars, int len, NSObject deallocator) { - final _ret = _lib._objc_msgSend_53( + ffi.Pointer chars, int len, ObjCBlock2 deallocator) { + final _ret = _lib._objc_msgSend_54( _id, _lib._sel_initWithCharactersNoCopy_length_deallocator_1, chars, len, - deallocator._id); + deallocator._impl); return NSString._(_ret, _lib); } NSString initWithCharacters_length( ffi.Pointer characters, int length) { - final _ret = _lib._objc_msgSend_54( + final _ret = _lib._objc_msgSend_55( _id, _lib._sel_initWithCharacters_length_1, characters, length); return NSString._(_ret, _lib); } NSString initWithUTF8String(ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_55( + final _ret = _lib._objc_msgSend_56( _id, _lib._sel_initWithUTF8String_1, nullTerminatedCString); return NSString._(_ret, _lib); } @@ -5727,7 +6136,7 @@ class NSString extends NSObject { NSString initWithFormat_arguments( NSObject? format, ffi.Pointer<__va_list_tag> argList) { - final _ret = _lib._objc_msgSend_56( + final _ret = _lib._objc_msgSend_57( _id, _lib._sel_initWithFormat_arguments_1, format?._id ?? ffi.nullptr, @@ -5736,14 +6145,14 @@ class NSString extends NSObject { } NSString initWithFormat_locale(NSObject? format, NSObject locale) { - final _ret = _lib._objc_msgSend_57(_id, _lib._sel_initWithFormat_locale_1, + final _ret = _lib._objc_msgSend_58(_id, _lib._sel_initWithFormat_locale_1, format?._id ?? ffi.nullptr, locale._id); return NSString._(_ret, _lib); } NSString initWithFormat_locale_arguments( NSObject? format, NSObject locale, ffi.Pointer<__va_list_tag> argList) { - final _ret = _lib._objc_msgSend_58( + final _ret = _lib._objc_msgSend_59( _id, _lib._sel_initWithFormat_locale_arguments_1, format?._id ?? ffi.nullptr, @@ -5753,21 +6162,21 @@ class NSString extends NSObject { } NSString initWithData_encoding(NSObject? data, int encoding) { - final _ret = _lib._objc_msgSend_59(_id, _lib._sel_initWithData_encoding_1, + final _ret = _lib._objc_msgSend_60(_id, _lib._sel_initWithData_encoding_1, data?._id ?? ffi.nullptr, encoding); return NSString._(_ret, _lib); } NSString initWithBytes_length_encoding( ffi.Pointer bytes, int len, int encoding) { - final _ret = _lib._objc_msgSend_60( + final _ret = _lib._objc_msgSend_61( _id, _lib._sel_initWithBytes_length_encoding_1, bytes, len, encoding); return NSString._(_ret, _lib); } NSString initWithBytesNoCopy_length_encoding_freeWhenDone( ffi.Pointer bytes, int len, int encoding, bool freeBuffer) { - final _ret = _lib._objc_msgSend_61( + final _ret = _lib._objc_msgSend_62( _id, _lib._sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1, bytes, @@ -5781,14 +6190,14 @@ class NSString extends NSObject { ffi.Pointer bytes, int len, int encoding, - NSObject deallocator) { - final _ret = _lib._objc_msgSend_62( + ObjCBlock3 deallocator) { + final _ret = _lib._objc_msgSend_63( _id, _lib._sel_initWithBytesNoCopy_length_encoding_deallocator_1, bytes, len, encoding, - deallocator._id); + deallocator._impl); return NSString._(_ret, _lib); } @@ -5805,14 +6214,14 @@ class NSString extends NSObject { static NSString stringWithCharacters_length( NativeObjCLibrary _lib, ffi.Pointer characters, int length) { - final _ret = _lib._objc_msgSend_54(_lib._class_NSString1, + final _ret = _lib._objc_msgSend_55(_lib._class_NSString1, _lib._sel_stringWithCharacters_length_1, characters, length); return NSString._(_ret, _lib); } static NSString stringWithUTF8String( NativeObjCLibrary _lib, ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_55(_lib._class_NSString1, + final _ret = _lib._objc_msgSend_56(_lib._class_NSString1, _lib._sel_stringWithUTF8String_1, nullTerminatedCString); return NSString._(_ret, _lib); } @@ -5832,21 +6241,21 @@ class NSString extends NSObject { NSString initWithCString_encoding( ffi.Pointer nullTerminatedCString, int encoding) { - final _ret = _lib._objc_msgSend_63(_id, + final _ret = _lib._objc_msgSend_64(_id, _lib._sel_initWithCString_encoding_1, nullTerminatedCString, encoding); return NSString._(_ret, _lib); } static NSString stringWithCString_encoding( NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_63(_lib._class_NSString1, + final _ret = _lib._objc_msgSend_64(_lib._class_NSString1, _lib._sel_stringWithCString_encoding_1, cString, enc); return NSString._(_ret, _lib); } NSString initWithContentsOfURL_encoding_error( NSObject? url, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_64( + final _ret = _lib._objc_msgSend_65( _id, _lib._sel_initWithContentsOfURL_encoding_error_1, url?._id ?? ffi.nullptr, @@ -5857,7 +6266,7 @@ class NSString extends NSObject { NSString initWithContentsOfFile_encoding_error( NSObject? path, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_64( + final _ret = _lib._objc_msgSend_65( _id, _lib._sel_initWithContentsOfFile_encoding_error_1, path?._id ?? ffi.nullptr, @@ -5868,7 +6277,7 @@ class NSString extends NSObject { static NSString stringWithContentsOfURL_encoding_error(NativeObjCLibrary _lib, NSObject? url, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_64( + final _ret = _lib._objc_msgSend_65( _lib._class_NSString1, _lib._sel_stringWithContentsOfURL_encoding_error_1, url?._id ?? ffi.nullptr, @@ -5882,7 +6291,7 @@ class NSString extends NSObject { NSObject? path, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_64( + final _ret = _lib._objc_msgSend_65( _lib._class_NSString1, _lib._sel_stringWithContentsOfFile_encoding_error_1, path?._id ?? ffi.nullptr, @@ -5895,7 +6304,7 @@ class NSString extends NSObject { NSObject? url, ffi.Pointer enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( + final _ret = _lib._objc_msgSend_66( _id, _lib._sel_initWithContentsOfURL_usedEncoding_error_1, url?._id ?? ffi.nullptr, @@ -5908,7 +6317,7 @@ class NSString extends NSObject { NSObject? path, ffi.Pointer enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( + final _ret = _lib._objc_msgSend_66( _id, _lib._sel_initWithContentsOfFile_usedEncoding_error_1, path?._id ?? ffi.nullptr, @@ -5922,7 +6331,7 @@ class NSString extends NSObject { NSObject? url, ffi.Pointer enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( + final _ret = _lib._objc_msgSend_66( _lib._class_NSString1, _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, url?._id ?? ffi.nullptr, @@ -5936,7 +6345,7 @@ class NSString extends NSObject { NSObject? path, ffi.Pointer enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( + final _ret = _lib._objc_msgSend_66( _lib._class_NSString1, _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, path?._id ?? ffi.nullptr, @@ -5952,7 +6361,7 @@ class NSString extends NSObject { NSObject? opts, ffi.Pointer> string, ffi.Pointer usedLossyConversion) { - return _lib._objc_msgSend_66( + return _lib._objc_msgSend_67( _lib._class_NSString1, _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, data?._id ?? ffi.nullptr, @@ -5967,7 +6376,7 @@ class NSString extends NSObject { } NSDictionary propertyListFromStringsFileFormat() { - final _ret = _lib._objc_msgSend_67( + final _ret = _lib._objc_msgSend_68( _id, _lib._sel_propertyListFromStringsFileFormat1); return NSDictionary._(_ret, _lib); } @@ -5985,11 +6394,11 @@ class NSString extends NSObject { } void getCString(ffi.Pointer bytes) { - _lib._objc_msgSend_68(_id, _lib._sel_getCString_1, bytes); + _lib._objc_msgSend_69(_id, _lib._sel_getCString_1, bytes); } void getCString_maxLength(ffi.Pointer bytes, int maxLength) { - _lib._objc_msgSend_69( + _lib._objc_msgSend_70( _id, _lib._sel_getCString_maxLength_1, bytes, maxLength); } @@ -5998,7 +6407,7 @@ class NSString extends NSObject { int maxLength, NSRange aRange, NSRangePointer leftoverRange) { - _lib._objc_msgSend_70( + _lib._objc_msgSend_71( _id, _lib._sel_getCString_maxLength_range_remainingRange_1, bytes, @@ -6008,12 +6417,12 @@ class NSString extends NSObject { } bool writeToFile_atomically(NSObject? path, bool useAuxiliaryFile) { - return _lib._objc_msgSend_71(_id, _lib._sel_writeToFile_atomically_1, + return _lib._objc_msgSend_72(_id, _lib._sel_writeToFile_atomically_1, path?._id ?? ffi.nullptr, useAuxiliaryFile); } bool writeToURL_atomically(NSObject? url, bool atomically) { - return _lib._objc_msgSend_71(_id, _lib._sel_writeToURL_atomically_1, + return _lib._objc_msgSend_72(_id, _lib._sel_writeToURL_atomically_1, url?._id ?? ffi.nullptr, atomically); } @@ -6045,7 +6454,7 @@ class NSString extends NSObject { NSObject initWithCStringNoCopy_length_freeWhenDone( ffi.Pointer bytes, int length, bool freeBuffer) { - final _ret = _lib._objc_msgSend_72( + final _ret = _lib._objc_msgSend_73( _id, _lib._sel_initWithCStringNoCopy_length_freeWhenDone_1, bytes, @@ -6055,32 +6464,32 @@ class NSString extends NSObject { } NSObject initWithCString_length(ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_63( + final _ret = _lib._objc_msgSend_64( _id, _lib._sel_initWithCString_length_1, bytes, length); return NSObject._(_ret, _lib); } NSObject initWithCString(ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_initWithCString_1, bytes); + final _ret = _lib._objc_msgSend_56(_id, _lib._sel_initWithCString_1, bytes); return NSObject._(_ret, _lib); } static NSObject stringWithCString_length( NativeObjCLibrary _lib, ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_63(_lib._class_NSString1, + final _ret = _lib._objc_msgSend_64(_lib._class_NSString1, _lib._sel_stringWithCString_length_1, bytes, length); return NSObject._(_ret, _lib); } static NSObject stringWithCString( NativeObjCLibrary _lib, ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_55( + final _ret = _lib._objc_msgSend_56( _lib._class_NSString1, _lib._sel_stringWithCString_1, bytes); return NSObject._(_ret, _lib); } void getCharacters(ffi.Pointer buffer) { - _lib._objc_msgSend_73(_id, _lib._sel_getCharacters_1, buffer); + _lib._objc_msgSend_74(_id, _lib._sel_getCharacters_1, buffer); } static NSString new1(NativeObjCLibrary _lib) { @@ -6134,6 +6543,118 @@ abstract class NSStringEnumerationOptions { static const int NSStringEnumerationLocalized = 1024; } +void _ObjCBlock_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSRange arg1, + NSRange arg2, ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3)>()(arg0, arg1, arg2, arg3); +} + +class ObjCBlock { + final ffi.Pointer<_ObjCBlock> _impl; + final NativeObjCLibrary _lib; + ObjCBlock._(this._impl, this._lib); + + ObjCBlock.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSRange arg1, + NSRange arg2, ffi.Pointer arg3)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3)>( + _ObjCBlock_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class _ObjCBlockDesc extends ffi.Struct { + @pkg_ffi.UnsignedLong() + external int reserved; + + @pkg_ffi.UnsignedLong() + external int size; + + external ffi.Pointer copy_helper; + + external ffi.Pointer dispose_helper; + + external ffi.Pointer signature; +} + +class _ObjCBlock extends ffi.Struct { + external ffi.Pointer isa; + + @pkg_ffi.Int() + external int flags; + + @pkg_ffi.Int() + external int reserved; + + external ffi.Pointer invoke; + + external ffi.Pointer<_ObjCBlockDesc> descriptor; + + external ffi.Pointer target; +} + +void _ObjCBlock1_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +class ObjCBlock1 { + final ffi.Pointer<_ObjCBlock> _impl; + final NativeObjCLibrary _lib; + ObjCBlock1._(this._impl, this._lib); + + ObjCBlock1.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : _impl = + _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock1_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + typedef NSStringEncoding = NSUInteger; class NSData extends _ObjCWrapper { @@ -6157,6 +6678,38 @@ abstract class NSStringEncodingConversionOptions { typedef NSRangePointer = ffi.Pointer; typedef NSStringTransform = ffi.Pointer; +void _ObjCBlock2_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSUInteger arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, int arg1)>()(arg0, arg1); +} + +class ObjCBlock2 { + final ffi.Pointer<_ObjCBlock> _impl; + final NativeObjCLibrary _lib; + ObjCBlock2._(this._impl, this._lib); + + ObjCBlock2.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, NSUInteger arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1)>(_ObjCBlock2_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} class __va_list_tag extends ffi.Struct { @pkg_ffi.UnsignedInt() @@ -6170,6 +6723,39 @@ class __va_list_tag extends ffi.Struct { external ffi.Pointer reg_save_area; } +void _ObjCBlock3_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSUInteger arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, int arg1)>()(arg0, arg1); +} + +class ObjCBlock3 { + final ffi.Pointer<_ObjCBlock> _impl; + final NativeObjCLibrary _lib; + ObjCBlock3._(this._impl, this._lib); + + ObjCBlock3.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, NSUInteger arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1)>(_ObjCBlock3_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + class NSDictionary extends _ObjCWrapper { NSDictionary._(ffi.Pointer id, NativeObjCLibrary lib) : super._(id, lib); @@ -6198,16 +6784,16 @@ class NSValue extends NSObject { } void getValue_size(ffi.Pointer value, int size) { - _lib._objc_msgSend_76(_id, _lib._sel_getValue_size_1, value, size); + _lib._objc_msgSend_77(_id, _lib._sel_getValue_size_1, value, size); } ffi.Pointer get objCType { - return _lib._objc_msgSend_36(_id, _lib._sel_objCType1); + return _lib._objc_msgSend_37(_id, _lib._sel_objCType1); } NSValue initWithBytes_objCType( ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_77( + final _ret = _lib._objc_msgSend_78( _id, _lib._sel_initWithBytes_objCType_1, value, type); return NSValue._(_ret, _lib); } @@ -6220,21 +6806,21 @@ class NSValue extends NSObject { static NSValue valueWithBytes_objCType(NativeObjCLibrary _lib, ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_78( + final _ret = _lib._objc_msgSend_79( _lib._class_NSValue1, _lib._sel_valueWithBytes_objCType_1, value, type); return NSValue._(_ret, _lib); } static NSValue value_withObjCType(NativeObjCLibrary _lib, ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_78( + final _ret = _lib._objc_msgSend_79( _lib._class_NSValue1, _lib._sel_value_withObjCType_1, value, type); return NSValue._(_ret, _lib); } static NSValue valueWithNonretainedObject( NativeObjCLibrary _lib, NSObject anObject) { - final _ret = _lib._objc_msgSend_79(_lib._class_NSValue1, + final _ret = _lib._objc_msgSend_80(_lib._class_NSValue1, _lib._sel_valueWithNonretainedObject_1, anObject._id); return NSValue._(_ret, _lib); } @@ -6246,13 +6832,13 @@ class NSValue extends NSObject { static NSValue valueWithPointer( NativeObjCLibrary _lib, ffi.Pointer pointer) { - final _ret = _lib._objc_msgSend_80( + final _ret = _lib._objc_msgSend_81( _lib._class_NSValue1, _lib._sel_valueWithPointer_1, pointer); return NSValue._(_ret, _lib); } ffi.Pointer get pointerValue { - return _lib._objc_msgSend_81(_id, _lib._sel_pointerValue1); + return _lib._objc_msgSend_82(_id, _lib._sel_pointerValue1); } bool isEqualToValue(NSObject? value) { @@ -6261,17 +6847,17 @@ class NSValue extends NSObject { } void getValue(ffi.Pointer value) { - _lib._objc_msgSend_82(_id, _lib._sel_getValue_1, value); + _lib._objc_msgSend_83(_id, _lib._sel_getValue_1, value); } static NSValue valueWithRange(NativeObjCLibrary _lib, NSRange range) { - final _ret = _lib._objc_msgSend_83( + final _ret = _lib._objc_msgSend_84( _lib._class_NSValue1, _lib._sel_valueWithRange_1, range); return NSValue._(_ret, _lib); } NSRange get rangeValue { - return _lib._objc_msgSend_84(_id, _lib._sel_rangeValue1); + return _lib._objc_msgSend_85(_id, _lib._sel_rangeValue1); } static NSValue new1(NativeObjCLibrary _lib) { @@ -6306,101 +6892,101 @@ class NSNumber extends NSValue { } NSNumber initWithChar(int value) { - final _ret = _lib._objc_msgSend_85(_id, _lib._sel_initWithChar_1, value); + final _ret = _lib._objc_msgSend_86(_id, _lib._sel_initWithChar_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithUnsignedChar(int value) { final _ret = - _lib._objc_msgSend_86(_id, _lib._sel_initWithUnsignedChar_1, value); + _lib._objc_msgSend_87(_id, _lib._sel_initWithUnsignedChar_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithShort(int value) { - final _ret = _lib._objc_msgSend_87(_id, _lib._sel_initWithShort_1, value); + final _ret = _lib._objc_msgSend_88(_id, _lib._sel_initWithShort_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithUnsignedShort(int value) { final _ret = - _lib._objc_msgSend_88(_id, _lib._sel_initWithUnsignedShort_1, value); + _lib._objc_msgSend_89(_id, _lib._sel_initWithUnsignedShort_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithInt(int value) { - final _ret = _lib._objc_msgSend_89(_id, _lib._sel_initWithInt_1, value); + final _ret = _lib._objc_msgSend_90(_id, _lib._sel_initWithInt_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithUnsignedInt(int value) { final _ret = - _lib._objc_msgSend_90(_id, _lib._sel_initWithUnsignedInt_1, value); + _lib._objc_msgSend_91(_id, _lib._sel_initWithUnsignedInt_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithLong(int value) { - final _ret = _lib._objc_msgSend_91(_id, _lib._sel_initWithLong_1, value); + final _ret = _lib._objc_msgSend_92(_id, _lib._sel_initWithLong_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithUnsignedLong(int value) { final _ret = - _lib._objc_msgSend_92(_id, _lib._sel_initWithUnsignedLong_1, value); + _lib._objc_msgSend_93(_id, _lib._sel_initWithUnsignedLong_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithLongLong(int value) { final _ret = - _lib._objc_msgSend_93(_id, _lib._sel_initWithLongLong_1, value); + _lib._objc_msgSend_94(_id, _lib._sel_initWithLongLong_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithUnsignedLongLong(int value) { final _ret = - _lib._objc_msgSend_94(_id, _lib._sel_initWithUnsignedLongLong_1, value); + _lib._objc_msgSend_95(_id, _lib._sel_initWithUnsignedLongLong_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithFloat(double value) { - final _ret = _lib._objc_msgSend_95(_id, _lib._sel_initWithFloat_1, value); + final _ret = _lib._objc_msgSend_96(_id, _lib._sel_initWithFloat_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithDouble(double value) { - final _ret = _lib._objc_msgSend_96(_id, _lib._sel_initWithDouble_1, value); + final _ret = _lib._objc_msgSend_97(_id, _lib._sel_initWithDouble_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithBool(bool value) { - final _ret = _lib._objc_msgSend_97(_id, _lib._sel_initWithBool_1, value); + final _ret = _lib._objc_msgSend_98(_id, _lib._sel_initWithBool_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithInteger(int value) { - final _ret = _lib._objc_msgSend_91(_id, _lib._sel_initWithInteger_1, value); + final _ret = _lib._objc_msgSend_92(_id, _lib._sel_initWithInteger_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithUnsignedInteger(int value) { final _ret = - _lib._objc_msgSend_92(_id, _lib._sel_initWithUnsignedInteger_1, value); + _lib._objc_msgSend_93(_id, _lib._sel_initWithUnsignedInteger_1, value); return NSNumber._(_ret, _lib); } int get charValue { - return _lib._objc_msgSend_98(_id, _lib._sel_charValue1); + return _lib._objc_msgSend_99(_id, _lib._sel_charValue1); } int get unsignedCharValue { - return _lib._objc_msgSend_99(_id, _lib._sel_unsignedCharValue1); + return _lib._objc_msgSend_100(_id, _lib._sel_unsignedCharValue1); } int get shortValue { - return _lib._objc_msgSend_100(_id, _lib._sel_shortValue1); + return _lib._objc_msgSend_101(_id, _lib._sel_shortValue1); } int get unsignedShortValue { - return _lib._objc_msgSend_101(_id, _lib._sel_unsignedShortValue1); + return _lib._objc_msgSend_102(_id, _lib._sel_unsignedShortValue1); } int get intValue { @@ -6408,7 +6994,7 @@ class NSNumber extends NSValue { } int get unsignedIntValue { - return _lib._objc_msgSend_102(_id, _lib._sel_unsignedIntValue1); + return _lib._objc_msgSend_103(_id, _lib._sel_unsignedIntValue1); } int get longValue { @@ -6424,7 +7010,7 @@ class NSNumber extends NSValue { } int get unsignedLongLongValue { - return _lib._objc_msgSend_103(_id, _lib._sel_unsignedLongLongValue1); + return _lib._objc_msgSend_104(_id, _lib._sel_unsignedLongLongValue1); } double get floatValue { @@ -6469,126 +7055,126 @@ class NSNumber extends NSValue { } static NSNumber numberWithChar(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_85( + final _ret = _lib._objc_msgSend_86( _lib._class_NSNumber1, _lib._sel_numberWithChar_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithUnsignedChar(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_86( + final _ret = _lib._objc_msgSend_87( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedChar_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithShort(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_87( + final _ret = _lib._objc_msgSend_88( _lib._class_NSNumber1, _lib._sel_numberWithShort_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithUnsignedShort(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_88( + final _ret = _lib._objc_msgSend_89( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedShort_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithInt(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_89( + final _ret = _lib._objc_msgSend_90( _lib._class_NSNumber1, _lib._sel_numberWithInt_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithUnsignedInt(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_90( + final _ret = _lib._objc_msgSend_91( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInt_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithLong(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_91( + final _ret = _lib._objc_msgSend_92( _lib._class_NSNumber1, _lib._sel_numberWithLong_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithUnsignedLong(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_92( + final _ret = _lib._objc_msgSend_93( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLong_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithLongLong(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_93( + final _ret = _lib._objc_msgSend_94( _lib._class_NSNumber1, _lib._sel_numberWithLongLong_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithUnsignedLongLong( NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_94( + final _ret = _lib._objc_msgSend_95( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLongLong_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithFloat(NativeObjCLibrary _lib, double value) { - final _ret = _lib._objc_msgSend_95( + final _ret = _lib._objc_msgSend_96( _lib._class_NSNumber1, _lib._sel_numberWithFloat_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithDouble(NativeObjCLibrary _lib, double value) { - final _ret = _lib._objc_msgSend_96( + final _ret = _lib._objc_msgSend_97( _lib._class_NSNumber1, _lib._sel_numberWithDouble_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithBool(NativeObjCLibrary _lib, bool value) { - final _ret = _lib._objc_msgSend_97( + final _ret = _lib._objc_msgSend_98( _lib._class_NSNumber1, _lib._sel_numberWithBool_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithInteger(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_91( + final _ret = _lib._objc_msgSend_92( _lib._class_NSNumber1, _lib._sel_numberWithInteger_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithUnsignedInteger(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_92( + final _ret = _lib._objc_msgSend_93( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInteger_1, value); return NSNumber._(_ret, _lib); } static NSValue valueWithBytes_objCType(NativeObjCLibrary _lib, ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_78(_lib._class_NSNumber1, + final _ret = _lib._objc_msgSend_79(_lib._class_NSNumber1, _lib._sel_valueWithBytes_objCType_1, value, type); return NSValue._(_ret, _lib); } static NSValue value_withObjCType(NativeObjCLibrary _lib, ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_78( + final _ret = _lib._objc_msgSend_79( _lib._class_NSNumber1, _lib._sel_value_withObjCType_1, value, type); return NSValue._(_ret, _lib); } static NSValue valueWithNonretainedObject( NativeObjCLibrary _lib, NSObject anObject) { - final _ret = _lib._objc_msgSend_79(_lib._class_NSNumber1, + final _ret = _lib._objc_msgSend_80(_lib._class_NSNumber1, _lib._sel_valueWithNonretainedObject_1, anObject._id); return NSValue._(_ret, _lib); } static NSValue valueWithPointer( NativeObjCLibrary _lib, ffi.Pointer pointer) { - final _ret = _lib._objc_msgSend_80( + final _ret = _lib._objc_msgSend_81( _lib._class_NSNumber1, _lib._sel_valueWithPointer_1, pointer); return NSValue._(_ret, _lib); } static NSValue valueWithRange(NativeObjCLibrary _lib, NSRange range) { - final _ret = _lib._objc_msgSend_83( + final _ret = _lib._objc_msgSend_84( _lib._class_NSNumber1, _lib._sel_valueWithRange_1, range); return NSValue._(_ret, _lib); } @@ -6683,7 +7269,7 @@ class NSArray extends NSObject { } NSObject objectAtIndex(int index) { - final _ret = _lib._objc_msgSend_104(_id, _lib._sel_objectAtIndex_1, index); + final _ret = _lib._objc_msgSend_105(_id, _lib._sel_objectAtIndex_1, index); return NSObject._(_ret, _lib); } @@ -6695,7 +7281,7 @@ class NSArray extends NSObject { NSArray initWithObjects_count( ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_105( + final _ret = _lib._objc_msgSend_106( _id, _lib._sel_initWithObjects_count_1, objects, cnt); return NSArray._(_ret, _lib); } @@ -6728,7 +7314,7 @@ class NSArray extends NSObject { } NSString descriptionWithLocale_indent(NSObject locale, int level) { - final _ret = _lib._objc_msgSend_106( + final _ret = _lib._objc_msgSend_107( _id, _lib._sel_descriptionWithLocale_indent_1, locale._id, level); return NSString._(_ret, _lib); } @@ -6741,25 +7327,25 @@ class NSArray extends NSObject { void getObjects_range( ffi.Pointer> objects, NSRange range) { - _lib._objc_msgSend_107(_id, _lib._sel_getObjects_range_1, objects, range); + _lib._objc_msgSend_108(_id, _lib._sel_getObjects_range_1, objects, range); } int indexOfObject(NSObject anObject) { - return _lib._objc_msgSend_108(_id, _lib._sel_indexOfObject_1, anObject._id); + return _lib._objc_msgSend_109(_id, _lib._sel_indexOfObject_1, anObject._id); } int indexOfObject_inRange(NSObject anObject, NSRange range) { - return _lib._objc_msgSend_109( + return _lib._objc_msgSend_110( _id, _lib._sel_indexOfObject_inRange_1, anObject._id, range); } int indexOfObjectIdenticalTo(NSObject anObject) { - return _lib._objc_msgSend_108( + return _lib._objc_msgSend_109( _id, _lib._sel_indexOfObjectIdenticalTo_1, anObject._id); } int indexOfObjectIdenticalTo_inRange(NSObject anObject, NSRange range) { - return _lib._objc_msgSend_109( + return _lib._objc_msgSend_110( _id, _lib._sel_indexOfObjectIdenticalTo_inRange_1, anObject._id, range); } @@ -6785,7 +7371,7 @@ class NSArray extends NSObject { bool writeToURL_error( NSObject? url, ffi.Pointer> error) { - return _lib._objc_msgSend_110( + return _lib._objc_msgSend_111( _id, _lib._sel_writeToURL_error_1, url?._id ?? ffi.nullptr, error); } @@ -6796,7 +7382,7 @@ class NSArray extends NSObject { void makeObjectsPerformSelector_withObject( ffi.Pointer aSelector, NSObject argument) { - _lib._objc_msgSend_111( + _lib._objc_msgSend_112( _id, _lib._sel_makeObjectsPerformSelector_withObject_1, aSelector, @@ -6805,80 +7391,83 @@ class NSArray extends NSObject { NSObject objectAtIndexedSubscript(int idx) { final _ret = - _lib._objc_msgSend_104(_id, _lib._sel_objectAtIndexedSubscript_1, idx); + _lib._objc_msgSend_105(_id, _lib._sel_objectAtIndexedSubscript_1, idx); return NSObject._(_ret, _lib); } - void enumerateObjectsUsingBlock(NSObject block) { - _lib._objc_msgSend_8( - _id, _lib._sel_enumerateObjectsUsingBlock_1, block._id); + void enumerateObjectsUsingBlock(ObjCBlock4 block) { + _lib._objc_msgSend_113( + _id, _lib._sel_enumerateObjectsUsingBlock_1, block._impl); } - void enumerateObjectsWithOptions_usingBlock(int opts, NSObject block) { - _lib._objc_msgSend_112(_id, - _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._id); + void enumerateObjectsWithOptions_usingBlock(int opts, ObjCBlock4 block) { + _lib._objc_msgSend_114(_id, + _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._impl); } void enumerateObjectsAtIndexes_options_usingBlock( - NSObject? s, int opts, NSObject block) { - _lib._objc_msgSend_113( + NSObject? s, int opts, ObjCBlock4 block) { + _lib._objc_msgSend_115( _id, _lib._sel_enumerateObjectsAtIndexes_options_usingBlock_1, s?._id ?? ffi.nullptr, opts, - block._id); + block._impl); } - int indexOfObjectPassingTest(NSObject predicate) { - return _lib._objc_msgSend_108( - _id, _lib._sel_indexOfObjectPassingTest_1, predicate._id); + int indexOfObjectPassingTest(ObjCBlock5 predicate) { + return _lib._objc_msgSend_116( + _id, _lib._sel_indexOfObjectPassingTest_1, predicate._impl); } - int indexOfObjectWithOptions_passingTest(int opts, NSObject predicate) { - return _lib._objc_msgSend_114(_id, - _lib._sel_indexOfObjectWithOptions_passingTest_1, opts, predicate._id); + int indexOfObjectWithOptions_passingTest(int opts, ObjCBlock5 predicate) { + return _lib._objc_msgSend_117( + _id, + _lib._sel_indexOfObjectWithOptions_passingTest_1, + opts, + predicate._impl); } int indexOfObjectAtIndexes_options_passingTest( - NSObject? s, int opts, NSObject predicate) { - return _lib._objc_msgSend_115( + NSObject? s, int opts, ObjCBlock5 predicate) { + return _lib._objc_msgSend_118( _id, _lib._sel_indexOfObjectAtIndexes_options_passingTest_1, s?._id ?? ffi.nullptr, opts, - predicate._id); + predicate._impl); } - NSIndexSet indexesOfObjectsPassingTest(NSObject predicate) { - final _ret = _lib._objc_msgSend_122( - _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._id); + NSIndexSet indexesOfObjectsPassingTest(ObjCBlock5 predicate) { + final _ret = _lib._objc_msgSend_135( + _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._impl); return NSIndexSet._(_ret, _lib); } NSIndexSet indexesOfObjectsWithOptions_passingTest( - int opts, NSObject predicate) { - final _ret = _lib._objc_msgSend_123( + int opts, ObjCBlock5 predicate) { + final _ret = _lib._objc_msgSend_136( _id, _lib._sel_indexesOfObjectsWithOptions_passingTest_1, opts, - predicate._id); + predicate._impl); return NSIndexSet._(_ret, _lib); } NSIndexSet indexesOfObjectsAtIndexes_options_passingTest( - NSObject? s, int opts, NSObject predicate) { - final _ret = _lib._objc_msgSend_125( + NSObject? s, int opts, ObjCBlock5 predicate) { + final _ret = _lib._objc_msgSend_137( _id, _lib._sel_indexesOfObjectsAtIndexes_options_passingTest_1, s?._id ?? ffi.nullptr, opts, - predicate._id); + predicate._impl); return NSIndexSet._(_ret, _lib); } int indexOfObject_inSortedRange_options_usingComparator( NSObject obj, NSRange r, int opts, NSComparator cmp) { - return _lib._objc_msgSend_126( + return _lib._objc_msgSend_138( _id, _lib._sel_indexOfObject_inSortedRange_options_usingComparator_1, obj._id, @@ -6900,7 +7489,7 @@ class NSArray extends NSObject { static NSArray arrayWithObjects_count(NativeObjCLibrary _lib, ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_105( + final _ret = _lib._objc_msgSend_106( _lib._class_NSArray1, _lib._sel_arrayWithObjects_count_1, objects, cnt); return NSArray._(_ret, _lib); } @@ -6930,22 +7519,22 @@ class NSArray extends NSObject { } NSArray initWithArray_copyItems(NSObject? array, bool flag) { - final _ret = _lib._objc_msgSend_127(_id, + final _ret = _lib._objc_msgSend_139(_id, _lib._sel_initWithArray_copyItems_1, array?._id ?? ffi.nullptr, flag); return NSArray._(_ret, _lib); } void getObjects(ffi.Pointer> objects) { - _lib._objc_msgSend_128(_id, _lib._sel_getObjects_1, objects); + _lib._objc_msgSend_140(_id, _lib._sel_getObjects_1, objects); } bool writeToFile_atomically(NSObject? path, bool useAuxiliaryFile) { - return _lib._objc_msgSend_71(_id, _lib._sel_writeToFile_atomically_1, + return _lib._objc_msgSend_72(_id, _lib._sel_writeToFile_atomically_1, path?._id ?? ffi.nullptr, useAuxiliaryFile); } bool writeToURL_atomically(NSObject? url, bool atomically) { - return _lib._objc_msgSend_71(_id, _lib._sel_writeToURL_atomically_1, + return _lib._objc_msgSend_72(_id, _lib._sel_writeToURL_atomically_1, url?._id ?? ffi.nullptr, atomically); } @@ -6960,6 +7549,80 @@ class NSArray extends NSObject { } } +void _ObjCBlock4_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSUInteger arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +class ObjCBlock4 { + final ffi.Pointer<_ObjCBlock> _impl; + final NativeObjCLibrary _lib; + ObjCBlock4._(this._impl, this._lib); + + ObjCBlock4.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + NSUInteger arg1, ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>( + _ObjCBlock4_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +int _ObjCBlock5_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer arg0, NSUInteger arg1, + ffi.Pointer arg2)>>() + .asFunction< + int Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +class ObjCBlock5 { + final ffi.Pointer<_ObjCBlock> _impl; + final NativeObjCLibrary _lib; + ObjCBlock5._(this._impl, this._lib); + + ObjCBlock5.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer arg0, + NSUInteger arg1, ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Uint8 Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>( + _ObjCBlock5_fnPtrTrampoline, 0) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + class NSIndexSet extends NSObject { NSIndexSet._(ffi.Pointer id, NativeObjCLibrary lib) : super._(id, lib); @@ -6980,21 +7643,21 @@ class NSIndexSet extends NSObject { } static NSIndexSet indexSetWithIndex(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_104( + final _ret = _lib._objc_msgSend_105( _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndex_1, value); return NSIndexSet._(_ret, _lib); } static NSIndexSet indexSetWithIndexesInRange( NativeObjCLibrary _lib, NSRange range) { - final _ret = _lib._objc_msgSend_116( + final _ret = _lib._objc_msgSend_119( _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndexesInRange_1, range); return NSIndexSet._(_ret, _lib); } NSIndexSet initWithIndexesInRange(NSRange range) { final _ret = - _lib._objc_msgSend_116(_id, _lib._sel_initWithIndexesInRange_1, range); + _lib._objc_msgSend_119(_id, _lib._sel_initWithIndexesInRange_1, range); return NSIndexSet._(_ret, _lib); } @@ -7005,7 +7668,7 @@ class NSIndexSet extends NSObject { } NSIndexSet initWithIndex(int value) { - final _ret = _lib._objc_msgSend_104(_id, _lib._sel_initWithIndex_1, value); + final _ret = _lib._objc_msgSend_105(_id, _lib._sel_initWithIndex_1, value); return NSIndexSet._(_ret, _lib); } @@ -7027,26 +7690,26 @@ class NSIndexSet extends NSObject { } int indexGreaterThanIndex(int value) { - return _lib._objc_msgSend_43(_id, _lib._sel_indexGreaterThanIndex_1, value); + return _lib._objc_msgSend_44(_id, _lib._sel_indexGreaterThanIndex_1, value); } int indexLessThanIndex(int value) { - return _lib._objc_msgSend_43(_id, _lib._sel_indexLessThanIndex_1, value); + return _lib._objc_msgSend_44(_id, _lib._sel_indexLessThanIndex_1, value); } int indexGreaterThanOrEqualToIndex(int value) { - return _lib._objc_msgSend_43( + return _lib._objc_msgSend_44( _id, _lib._sel_indexGreaterThanOrEqualToIndex_1, value); } int indexLessThanOrEqualToIndex(int value) { - return _lib._objc_msgSend_43( + return _lib._objc_msgSend_44( _id, _lib._sel_indexLessThanOrEqualToIndex_1, value); } int getIndexes_maxCount_inIndexRange(ffi.Pointer indexBuffer, int bufferSize, NSRangePointer range) { - return _lib._objc_msgSend_117( + return _lib._objc_msgSend_120( _id, _lib._sel_getIndexes_maxCount_inIndexRange_1, indexBuffer, @@ -7055,16 +7718,16 @@ class NSIndexSet extends NSObject { } int countOfIndexesInRange(NSRange range) { - return _lib._objc_msgSend_118( + return _lib._objc_msgSend_121( _id, _lib._sel_countOfIndexesInRange_1, range); } bool containsIndex(int value) { - return _lib._objc_msgSend_39(_id, _lib._sel_containsIndex_1, value); + return _lib._objc_msgSend_40(_id, _lib._sel_containsIndex_1, value); } bool containsIndexesInRange(NSRange range) { - return _lib._objc_msgSend_119( + return _lib._objc_msgSend_122( _id, _lib._sel_containsIndexesInRange_1, range); } @@ -7074,90 +7737,91 @@ class NSIndexSet extends NSObject { } bool intersectsIndexesInRange(NSRange range) { - return _lib._objc_msgSend_119( + return _lib._objc_msgSend_122( _id, _lib._sel_intersectsIndexesInRange_1, range); } - void enumerateIndexesUsingBlock(NSObject block) { - _lib._objc_msgSend_8( - _id, _lib._sel_enumerateIndexesUsingBlock_1, block._id); + void enumerateIndexesUsingBlock(ObjCBlock6 block) { + _lib._objc_msgSend_123( + _id, _lib._sel_enumerateIndexesUsingBlock_1, block._impl); } - void enumerateIndexesWithOptions_usingBlock(int opts, NSObject block) { - _lib._objc_msgSend_112(_id, - _lib._sel_enumerateIndexesWithOptions_usingBlock_1, opts, block._id); + void enumerateIndexesWithOptions_usingBlock(int opts, ObjCBlock6 block) { + _lib._objc_msgSend_124(_id, + _lib._sel_enumerateIndexesWithOptions_usingBlock_1, opts, block._impl); } void enumerateIndexesInRange_options_usingBlock( - NSRange range, int opts, NSObject block) { - _lib._objc_msgSend_120( + NSRange range, int opts, ObjCBlock6 block) { + _lib._objc_msgSend_125( _id, _lib._sel_enumerateIndexesInRange_options_usingBlock_1, range, opts, - block._id); + block._impl); } - int indexPassingTest(NSObject predicate) { - return _lib._objc_msgSend_108( - _id, _lib._sel_indexPassingTest_1, predicate._id); + int indexPassingTest(ObjCBlock7 predicate) { + return _lib._objc_msgSend_126( + _id, _lib._sel_indexPassingTest_1, predicate._impl); } - int indexWithOptions_passingTest(int opts, NSObject predicate) { - return _lib._objc_msgSend_114( - _id, _lib._sel_indexWithOptions_passingTest_1, opts, predicate._id); + int indexWithOptions_passingTest(int opts, ObjCBlock7 predicate) { + return _lib._objc_msgSend_127( + _id, _lib._sel_indexWithOptions_passingTest_1, opts, predicate._impl); } int indexInRange_options_passingTest( - NSRange range, int opts, NSObject predicate) { - return _lib._objc_msgSend_121( + NSRange range, int opts, ObjCBlock7 predicate) { + return _lib._objc_msgSend_128( _id, _lib._sel_indexInRange_options_passingTest_1, range, opts, - predicate._id); + predicate._impl); } - NSIndexSet indexesPassingTest(NSObject predicate) { - final _ret = _lib._objc_msgSend_122( - _id, _lib._sel_indexesPassingTest_1, predicate._id); + NSIndexSet indexesPassingTest(ObjCBlock7 predicate) { + final _ret = _lib._objc_msgSend_129( + _id, _lib._sel_indexesPassingTest_1, predicate._impl); return NSIndexSet._(_ret, _lib); } - NSIndexSet indexesWithOptions_passingTest(int opts, NSObject predicate) { - final _ret = _lib._objc_msgSend_123( - _id, _lib._sel_indexesWithOptions_passingTest_1, opts, predicate._id); + NSIndexSet indexesWithOptions_passingTest(int opts, ObjCBlock7 predicate) { + final _ret = _lib._objc_msgSend_130( + _id, _lib._sel_indexesWithOptions_passingTest_1, opts, predicate._impl); return NSIndexSet._(_ret, _lib); } NSIndexSet indexesInRange_options_passingTest( - NSRange range, int opts, NSObject predicate) { - final _ret = _lib._objc_msgSend_124( + NSRange range, int opts, ObjCBlock7 predicate) { + final _ret = _lib._objc_msgSend_131( _id, _lib._sel_indexesInRange_options_passingTest_1, range, opts, - predicate._id); + predicate._impl); return NSIndexSet._(_ret, _lib); } - void enumerateRangesUsingBlock(NSObject block) { - _lib._objc_msgSend_8(_id, _lib._sel_enumerateRangesUsingBlock_1, block._id); + void enumerateRangesUsingBlock(ObjCBlock8 block) { + _lib._objc_msgSend_132( + _id, _lib._sel_enumerateRangesUsingBlock_1, block._impl); } - void enumerateRangesWithOptions_usingBlock(int opts, NSObject block) { - _lib._objc_msgSend_112(_id, - _lib._sel_enumerateRangesWithOptions_usingBlock_1, opts, block._id); + void enumerateRangesWithOptions_usingBlock(int opts, ObjCBlock8 block) { + _lib._objc_msgSend_133(_id, + _lib._sel_enumerateRangesWithOptions_usingBlock_1, opts, block._impl); } void enumerateRangesInRange_options_usingBlock( - NSRange range, int opts, NSObject block) { - _lib._objc_msgSend_120( + NSRange range, int opts, ObjCBlock8 block) { + _lib._objc_msgSend_134( _id, _lib._sel_enumerateRangesInRange_options_usingBlock_1, range, opts, - block._id); + block._impl); } static NSIndexSet new1(NativeObjCLibrary _lib) { @@ -7172,13 +7836,146 @@ class NSIndexSet extends NSObject { } } +void _ObjCBlock6_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + NSUInteger arg0, ffi.Pointer arg1)>>() + .asFunction arg1)>()( + arg0, arg1); +} + +class ObjCBlock6 { + final ffi.Pointer<_ObjCBlock> _impl; + final NativeObjCLibrary _lib; + ObjCBlock6._(this._impl, this._lib); + + ObjCBlock6.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + NSUInteger arg0, ffi.Pointer arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + NSUInteger arg0, ffi.Pointer arg1)>( + _ObjCBlock6_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +int _ObjCBlock7_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Uint8 Function( + NSUInteger arg0, ffi.Pointer arg1)>>() + .asFunction arg1)>()( + arg0, arg1); +} + +class ObjCBlock7 { + final ffi.Pointer<_ObjCBlock> _impl; + final NativeObjCLibrary _lib; + ObjCBlock7._(this._impl, this._lib); + + ObjCBlock7.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Uint8 Function( + NSUInteger arg0, ffi.Pointer arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Uint8 Function(ffi.Pointer<_ObjCBlock> block, + NSUInteger arg0, ffi.Pointer arg1)>( + _ObjCBlock7_fnPtrTrampoline, 0) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +void _ObjCBlock8_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, NSRange arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(NSRange arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function( + NSRange arg0, ffi.Pointer arg1)>()(arg0, arg1); +} + +class ObjCBlock8 { + final ffi.Pointer<_ObjCBlock> _impl; + final NativeObjCLibrary _lib; + ObjCBlock8._(this._impl, this._lib); + + ObjCBlock8.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(NSRange arg0, ffi.Pointer arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + NSRange arg0, ffi.Pointer arg1)>( + _ObjCBlock8_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + abstract class NSBinarySearchingOptions { static const int NSBinarySearchingFirstEqual = 256; static const int NSBinarySearchingLastEqual = 512; static const int NSBinarySearchingInsertionIndex = 1024; } -typedef NSComparator = ffi.Pointer; +typedef NSComparator = ffi.Pointer<_ObjCBlock>; +int _ObjCBlock9_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + int Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +class ObjCBlock9 { + final ffi.Pointer<_ObjCBlock> _impl; + final NativeObjCLibrary _lib; + ObjCBlock9._(this._impl, this._lib); + + ObjCBlock9.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Int32 Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock9_fnPtrTrampoline, 0) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} class NSMutableArray extends NSArray { NSMutableArray._(ffi.Pointer id, NativeObjCLibrary lib) @@ -7198,7 +7995,7 @@ class NSMutableArray extends NSArray { } void insertObject_atIndex(NSObject anObject, int index) { - _lib._objc_msgSend_129( + _lib._objc_msgSend_141( _id, _lib._sel_insertObject_atIndex_1, anObject._id, index); } @@ -7207,11 +8004,11 @@ class NSMutableArray extends NSArray { } void removeObjectAtIndex(int index) { - _lib._objc_msgSend_40(_id, _lib._sel_removeObjectAtIndex_1, index); + _lib._objc_msgSend_41(_id, _lib._sel_removeObjectAtIndex_1, index); } void replaceObjectAtIndex_withObject(int index, NSObject anObject) { - _lib._objc_msgSend_130( + _lib._objc_msgSend_142( _id, _lib._sel_replaceObjectAtIndex_withObject_1, index, anObject._id); } @@ -7223,7 +8020,7 @@ class NSMutableArray extends NSArray { NSMutableArray initWithCapacity(int numItems) { final _ret = - _lib._objc_msgSend_104(_id, _lib._sel_initWithCapacity_1, numItems); + _lib._objc_msgSend_105(_id, _lib._sel_initWithCapacity_1, numItems); return NSMutableArray._(_ret, _lib); } @@ -7240,7 +8037,7 @@ class NSMutableArray extends NSArray { } void exchangeObjectAtIndex_withObjectAtIndex(int idx1, int idx2) { - _lib._objc_msgSend_131( + _lib._objc_msgSend_143( _id, _lib._sel_exchangeObjectAtIndex_withObjectAtIndex_1, idx1, idx2); } @@ -7249,7 +8046,7 @@ class NSMutableArray extends NSArray { } void removeObject_inRange(NSObject anObject, NSRange range) { - _lib._objc_msgSend_132( + _lib._objc_msgSend_144( _id, _lib._sel_removeObject_inRange_1, anObject._id, range); } @@ -7258,7 +8055,7 @@ class NSMutableArray extends NSArray { } void removeObjectIdenticalTo_inRange(NSObject anObject, NSRange range) { - _lib._objc_msgSend_132( + _lib._objc_msgSend_144( _id, _lib._sel_removeObjectIdenticalTo_inRange_1, anObject._id, range); } @@ -7269,7 +8066,7 @@ class NSMutableArray extends NSArray { void removeObjectsFromIndices_numIndices( ffi.Pointer indices, int cnt) { - _lib._objc_msgSend_133( + _lib._objc_msgSend_145( _id, _lib._sel_removeObjectsFromIndices_numIndices_1, indices, cnt); } @@ -7279,12 +8076,12 @@ class NSMutableArray extends NSArray { } void removeObjectsInRange(NSRange range) { - _lib._objc_msgSend_134(_id, _lib._sel_removeObjectsInRange_1, range); + _lib._objc_msgSend_146(_id, _lib._sel_removeObjectsInRange_1, range); } void replaceObjectsInRange_withObjectsFromArray_range( NSRange range, NSObject? otherArray, NSRange otherRange) { - _lib._objc_msgSend_135( + _lib._objc_msgSend_147( _id, _lib._sel_replaceObjectsInRange_withObjectsFromArray_range_1, range, @@ -7294,7 +8091,7 @@ class NSMutableArray extends NSArray { void replaceObjectsInRange_withObjectsFromArray( NSRange range, NSObject? otherArray) { - _lib._objc_msgSend_136( + _lib._objc_msgSend_148( _id, _lib._sel_replaceObjectsInRange_withObjectsFromArray_1, range, @@ -7313,7 +8110,7 @@ class NSMutableArray extends NSArray { ffi.Pointer, ffi.Pointer)>> compare, ffi.Pointer context) { - _lib._objc_msgSend_137( + _lib._objc_msgSend_149( _id, _lib._sel_sortUsingFunction_context_1, compare, context); } @@ -7322,7 +8119,7 @@ class NSMutableArray extends NSArray { } void insertObjects_atIndexes(NSObject? objects, NSObject? indexes) { - _lib._objc_msgSend_138(_id, _lib._sel_insertObjects_atIndexes_1, + _lib._objc_msgSend_150(_id, _lib._sel_insertObjects_atIndexes_1, objects?._id ?? ffi.nullptr, indexes?._id ?? ffi.nullptr); } @@ -7333,27 +8130,27 @@ class NSMutableArray extends NSArray { void replaceObjectsAtIndexes_withObjects( NSObject? indexes, NSObject? objects) { - _lib._objc_msgSend_138(_id, _lib._sel_replaceObjectsAtIndexes_withObjects_1, + _lib._objc_msgSend_150(_id, _lib._sel_replaceObjectsAtIndexes_withObjects_1, indexes?._id ?? ffi.nullptr, objects?._id ?? ffi.nullptr); } void setObject_atIndexedSubscript(NSObject obj, int idx) { - _lib._objc_msgSend_129( + _lib._objc_msgSend_141( _id, _lib._sel_setObject_atIndexedSubscript_1, obj._id, idx); } void sortUsingComparator(NSComparator cmptr) { - _lib._objc_msgSend_8(_id, _lib._sel_sortUsingComparator_1, cmptr); + _lib._objc_msgSend_151(_id, _lib._sel_sortUsingComparator_1, cmptr); } void sortWithOptions_usingComparator(int opts, NSComparator cmptr) { - _lib._objc_msgSend_139( + _lib._objc_msgSend_152( _id, _lib._sel_sortWithOptions_usingComparator_1, opts, cmptr); } static NSMutableArray arrayWithCapacity( NativeObjCLibrary _lib, int numItems) { - final _ret = _lib._objc_msgSend_104( + final _ret = _lib._objc_msgSend_105( _lib._class_NSMutableArray1, _lib._sel_arrayWithCapacity_1, numItems); return NSMutableArray._(_ret, _lib); } @@ -7378,7 +8175,7 @@ class NSMutableArray extends NSArray { static NSMutableArray arrayWithObjects_count(NativeObjCLibrary _lib, ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_105(_lib._class_NSMutableArray1, + final _ret = _lib._objc_msgSend_106(_lib._class_NSMutableArray1, _lib._sel_arrayWithObjects_count_1, objects, cnt); return NSMutableArray._(_ret, _lib); } @@ -7441,13 +8238,13 @@ class NSItemProvider extends NSObject { } void registerDataRepresentationForTypeIdentifier_visibility_loadHandler( - NSObject? typeIdentifier, int visibility, NSObject loadHandler) { - _lib._objc_msgSend_140( + NSObject? typeIdentifier, int visibility, ObjCBlock10 loadHandler) { + _lib._objc_msgSend_153( _id, _lib._sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1, typeIdentifier?._id ?? ffi.nullptr, visibility, - loadHandler._id); + loadHandler._impl); } void @@ -7455,14 +8252,14 @@ class NSItemProvider extends NSObject { NSObject? typeIdentifier, int fileOptions, int visibility, - NSObject loadHandler) { - _lib._objc_msgSend_141( + ObjCBlock12 loadHandler) { + _lib._objc_msgSend_154( _id, _lib._sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1, typeIdentifier?._id ?? ffi.nullptr, fileOptions, visibility, - loadHandler._id); + loadHandler._impl); } NSObject? get registeredTypeIdentifiers { @@ -7480,7 +8277,7 @@ class NSItemProvider extends NSObject { bool hasRepresentationConformingToTypeIdentifier_fileOptions( NSObject? typeIdentifier, int fileOptions) { - return _lib._objc_msgSend_142( + return _lib._objc_msgSend_155( _id, _lib._sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1, typeIdentifier?._id ?? ffi.nullptr, @@ -7488,32 +8285,32 @@ class NSItemProvider extends NSObject { } NSProgress loadDataRepresentationForTypeIdentifier_completionHandler( - NSObject? typeIdentifier, NSObject completionHandler) { - final _ret = _lib._objc_msgSend_143( + NSObject? typeIdentifier, ObjCBlock11 completionHandler) { + final _ret = _lib._objc_msgSend_156( _id, _lib._sel_loadDataRepresentationForTypeIdentifier_completionHandler_1, typeIdentifier?._id ?? ffi.nullptr, - completionHandler._id); + completionHandler._impl); return NSProgress._(_ret, _lib); } NSProgress loadFileRepresentationForTypeIdentifier_completionHandler( - NSObject? typeIdentifier, NSObject completionHandler) { - final _ret = _lib._objc_msgSend_143( + NSObject? typeIdentifier, ObjCBlock11 completionHandler) { + final _ret = _lib._objc_msgSend_156( _id, _lib._sel_loadFileRepresentationForTypeIdentifier_completionHandler_1, typeIdentifier?._id ?? ffi.nullptr, - completionHandler._id); + completionHandler._impl); return NSProgress._(_ret, _lib); } NSProgress loadInPlaceFileRepresentationForTypeIdentifier_completionHandler( - NSObject? typeIdentifier, NSObject completionHandler) { - final _ret = _lib._objc_msgSend_143( + NSObject? typeIdentifier, ObjCBlock13 completionHandler) { + final _ret = _lib._objc_msgSend_157( _id, _lib._sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1, typeIdentifier?._id ?? ffi.nullptr, - completionHandler._id); + completionHandler._impl); return NSProgress._(_ret, _lib); } @@ -7534,18 +8331,18 @@ class NSItemProvider extends NSObject { } void registerObject_visibility(NSObject? object, int visibility) { - _lib._objc_msgSend_144(_id, _lib._sel_registerObject_visibility_1, + _lib._objc_msgSend_158(_id, _lib._sel_registerObject_visibility_1, object?._id ?? ffi.nullptr, visibility); } void registerObjectOfClass_visibility_loadHandler( - NSObject? aClass, int visibility, NSObject loadHandler) { - _lib._objc_msgSend_140( + NSObject? aClass, int visibility, ObjCBlock10 loadHandler) { + _lib._objc_msgSend_153( _id, _lib._sel_registerObjectOfClass_visibility_loadHandler_1, aClass?._id ?? ffi.nullptr, visibility, - loadHandler._id); + loadHandler._impl); } bool canLoadObjectOfClass(NSObject? aClass) { @@ -7554,18 +8351,18 @@ class NSItemProvider extends NSObject { } NSProgress loadObjectOfClass_completionHandler( - NSObject? aClass, NSObject completionHandler) { - final _ret = _lib._objc_msgSend_143( + NSObject? aClass, ObjCBlock11 completionHandler) { + final _ret = _lib._objc_msgSend_156( _id, _lib._sel_loadObjectOfClass_completionHandler_1, aClass?._id ?? ffi.nullptr, - completionHandler._id); + completionHandler._impl); return NSProgress._(_ret, _lib); } NSItemProvider initWithItem_typeIdentifier( NSObject? item, NSObject? typeIdentifier) { - final _ret = _lib._objc_msgSend_57( + final _ret = _lib._objc_msgSend_58( _id, _lib._sel_initWithItem_typeIdentifier_1, item?._id ?? ffi.nullptr, @@ -7581,7 +8378,7 @@ class NSItemProvider extends NSObject { void registerItemForTypeIdentifier_loadHandler( NSObject? typeIdentifier, NSItemProviderLoadHandler loadHandler) { - _lib._objc_msgSend_138( + _lib._objc_msgSend_159( _id, _lib._sel_registerItemForTypeIdentifier_loadHandler_1, typeIdentifier?._id ?? ffi.nullptr, @@ -7592,7 +8389,7 @@ class NSItemProvider extends NSObject { NSObject? typeIdentifier, NSObject? options, NSItemProviderCompletionHandler completionHandler) { - _lib._objc_msgSend_145( + _lib._objc_msgSend_160( _id, _lib._sel_loadItemForTypeIdentifier_options_completionHandler_1, typeIdentifier?._id ?? ffi.nullptr, @@ -7601,16 +8398,16 @@ class NSItemProvider extends NSObject { } NSItemProviderLoadHandler get previewImageHandler { - return _lib._objc_msgSend_1(_id, _lib._sel_previewImageHandler1); + return _lib._objc_msgSend_161(_id, _lib._sel_previewImageHandler1); } set previewImageHandler(NSItemProviderLoadHandler value) { - _lib._objc_msgSend_8(_id, _lib._sel_setPreviewImageHandler_1, value); + _lib._objc_msgSend_162(_id, _lib._sel_setPreviewImageHandler_1, value); } void loadPreviewImageWithOptions_completionHandler( NSObject? options, NSItemProviderCompletionHandler completionHandler) { - _lib._objc_msgSend_138( + _lib._objc_msgSend_163( _id, _lib._sel_loadPreviewImageWithOptions_completionHandler_1, options?._id ?? ffi.nullptr, @@ -7630,6 +8427,148 @@ class NSItemProvider extends NSObject { } } +ffi.Pointer _ObjCBlock10_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>()(arg0); +} + +class ObjCBlock10 { + final ffi.Pointer<_ObjCBlock> _impl; + final NativeObjCLibrary _lib; + ObjCBlock10._(this._impl, this._lib); + + ObjCBlock10.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock10_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +void _ObjCBlock11_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +class ObjCBlock11 { + final ffi.Pointer<_ObjCBlock> _impl; + final NativeObjCLibrary _lib; + ObjCBlock11._(this._impl, this._lib); + + ObjCBlock11.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : _impl = + _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock11_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +ffi.Pointer _ObjCBlock12_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>()(arg0); +} + +class ObjCBlock12 { + final ffi.Pointer<_ObjCBlock> _impl; + final NativeObjCLibrary _lib; + ObjCBlock12._(this._impl, this._lib); + + ObjCBlock12.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock12_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +void _ObjCBlock13_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Uint8 arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +class ObjCBlock13 { + final ffi.Pointer<_ObjCBlock> _impl; + final NativeObjCLibrary _lib; + ObjCBlock13._(this._impl, this._lib); + + ObjCBlock13.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Uint8 arg1, ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Uint8 arg1, + ffi.Pointer arg2)>( + _ObjCBlock13_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + class NSProgress extends _ObjCWrapper { NSProgress._(ffi.Pointer id, NativeObjCLibrary lib) : super._(id, lib); @@ -7644,8 +8583,54 @@ class NSProgress extends _ObjCWrapper { } } -typedef NSItemProviderLoadHandler = ffi.Pointer; -typedef NSItemProviderCompletionHandler = ffi.Pointer; +typedef NSItemProviderLoadHandler = ffi.Pointer<_ObjCBlock>; +void _ObjCBlock14_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +class ObjCBlock14 { + final ffi.Pointer<_ObjCBlock> _impl; + final NativeObjCLibrary _lib; + ObjCBlock14._(this._impl, this._lib); + + ObjCBlock14.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock14_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +typedef NSItemProviderCompletionHandler = ffi.Pointer<_ObjCBlock>; abstract class NSItemProviderErrorCode { static const int NSItemProviderUnknownError = -1; @@ -7670,17 +8655,17 @@ class NSMutableString extends NSString { } void replaceCharactersInRange_withString(NSRange range, NSObject? aString) { - _lib._objc_msgSend_136(_id, _lib._sel_replaceCharactersInRange_withString_1, + _lib._objc_msgSend_148(_id, _lib._sel_replaceCharactersInRange_withString_1, range, aString?._id ?? ffi.nullptr); } void insertString_atIndex(NSObject? aString, int loc) { - _lib._objc_msgSend_129(_id, _lib._sel_insertString_atIndex_1, + _lib._objc_msgSend_141(_id, _lib._sel_insertString_atIndex_1, aString?._id ?? ffi.nullptr, loc); } void deleteCharactersInRange(NSRange range) { - _lib._objc_msgSend_134(_id, _lib._sel_deleteCharactersInRange_1, range); + _lib._objc_msgSend_146(_id, _lib._sel_deleteCharactersInRange_1, range); } void appendString(NSObject? aString) { @@ -7700,7 +8685,7 @@ class NSMutableString extends NSString { int replaceOccurrencesOfString_withString_options_range(NSObject? target, NSObject? replacement, int options, NSRange searchRange) { - return _lib._objc_msgSend_146( + return _lib._objc_msgSend_164( _id, _lib._sel_replaceOccurrencesOfString_withString_options_range_1, target?._id ?? ffi.nullptr, @@ -7711,7 +8696,7 @@ class NSMutableString extends NSString { bool applyTransform_reverse_range_updatedRange(NSStringTransform transform, bool reverse, NSRange range, NSRangePointer resultingRange) { - return _lib._objc_msgSend_147( + return _lib._objc_msgSend_165( _id, _lib._sel_applyTransform_reverse_range_updatedRange_1, transform, @@ -7722,13 +8707,13 @@ class NSMutableString extends NSString { NSMutableString initWithCapacity(int capacity) { final _ret = - _lib._objc_msgSend_148(_id, _lib._sel_initWithCapacity_1, capacity); + _lib._objc_msgSend_166(_id, _lib._sel_initWithCapacity_1, capacity); return NSMutableString._(_ret, _lib); } static NSMutableString stringWithCapacity( NativeObjCLibrary _lib, int capacity) { - final _ret = _lib._objc_msgSend_148( + final _ret = _lib._objc_msgSend_166( _lib._class_NSMutableString1, _lib._sel_stringWithCapacity_1, capacity); return NSMutableString._(_ret, _lib); } @@ -7755,14 +8740,14 @@ class NSMutableString extends NSString { static NSMutableString stringWithCharacters_length( NativeObjCLibrary _lib, ffi.Pointer characters, int length) { - final _ret = _lib._objc_msgSend_54(_lib._class_NSMutableString1, + final _ret = _lib._objc_msgSend_55(_lib._class_NSMutableString1, _lib._sel_stringWithCharacters_length_1, characters, length); return NSMutableString._(_ret, _lib); } static NSMutableString stringWithUTF8String( NativeObjCLibrary _lib, ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_55(_lib._class_NSMutableString1, + final _ret = _lib._objc_msgSend_56(_lib._class_NSMutableString1, _lib._sel_stringWithUTF8String_1, nullTerminatedCString); return NSMutableString._(_ret, _lib); } @@ -7783,7 +8768,7 @@ class NSMutableString extends NSString { static NSMutableString stringWithCString_encoding( NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_63(_lib._class_NSMutableString1, + final _ret = _lib._objc_msgSend_64(_lib._class_NSMutableString1, _lib._sel_stringWithCString_encoding_1, cString, enc); return NSMutableString._(_ret, _lib); } @@ -7793,7 +8778,7 @@ class NSMutableString extends NSString { NSObject? url, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_64( + final _ret = _lib._objc_msgSend_65( _lib._class_NSMutableString1, _lib._sel_stringWithContentsOfURL_encoding_error_1, url?._id ?? ffi.nullptr, @@ -7807,7 +8792,7 @@ class NSMutableString extends NSString { NSObject? path, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_64( + final _ret = _lib._objc_msgSend_65( _lib._class_NSMutableString1, _lib._sel_stringWithContentsOfFile_encoding_error_1, path?._id ?? ffi.nullptr, @@ -7821,7 +8806,7 @@ class NSMutableString extends NSString { NSObject? url, ffi.Pointer enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( + final _ret = _lib._objc_msgSend_66( _lib._class_NSMutableString1, _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, url?._id ?? ffi.nullptr, @@ -7835,7 +8820,7 @@ class NSMutableString extends NSString { NSObject? path, ffi.Pointer enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( + final _ret = _lib._objc_msgSend_66( _lib._class_NSMutableString1, _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, path?._id ?? ffi.nullptr, @@ -7861,7 +8846,7 @@ class NSMutableString extends NSString { NSObject? opts, ffi.Pointer> string, ffi.Pointer usedLossyConversion) { - return _lib._objc_msgSend_66( + return _lib._objc_msgSend_67( _lib._class_NSMutableString1, _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, data?._id ?? ffi.nullptr, @@ -7886,14 +8871,14 @@ class NSMutableString extends NSString { static NSObject stringWithCString_length( NativeObjCLibrary _lib, ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_63(_lib._class_NSMutableString1, + final _ret = _lib._objc_msgSend_64(_lib._class_NSMutableString1, _lib._sel_stringWithCString_length_1, bytes, length); return NSObject._(_ret, _lib); } static NSObject stringWithCString( NativeObjCLibrary _lib, ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_55( + final _ret = _lib._objc_msgSend_56( _lib._class_NSMutableString1, _lib._sel_stringWithCString_1, bytes); return NSObject._(_ret, _lib); } @@ -7926,26 +8911,26 @@ class Foo extends NSObject { } int get intVal { - return _lib._objc_msgSend_149(_id, _lib._sel_intVal1); + return _lib._objc_msgSend_167(_id, _lib._sel_intVal1); } set intVal(int value) { - _lib._objc_msgSend_150(_id, _lib._sel_setIntVal_1, value); + _lib._objc_msgSend_168(_id, _lib._sel_setIntVal_1, value); } static Foo makeFoo(NativeObjCLibrary _lib, double x) { final _ret = - _lib._objc_msgSend_151(_lib._class_Foo1, _lib._sel_makeFoo_1, x); + _lib._objc_msgSend_169(_lib._class_Foo1, _lib._sel_makeFoo_1, x); return Foo._(_ret, _lib); } int multiply_withOtherFoo(bool useIntVals, NSObject? other) { - return _lib._objc_msgSend_152(_id, _lib._sel_multiply_withOtherFoo_1, + return _lib._objc_msgSend_170(_id, _lib._sel_multiply_withOtherFoo_1, useIntVals, other?._id ?? ffi.nullptr); } void setDoubleVal(double x) { - _lib._objc_msgSend_153(_id, _lib._sel_setDoubleVal_1, x); + _lib._objc_msgSend_171(_id, _lib._sel_setDoubleVal_1, x); } static Foo new1(NativeObjCLibrary _lib) { diff --git a/pkgs/ffigen/test/native_objc_test/setup.dart b/pkgs/ffigen/test/native_objc_test/setup.dart index 60ec7a6404..2681389aa3 100644 --- a/pkgs/ffigen/test/native_objc_test/setup.dart +++ b/pkgs/ffigen/test/native_objc_test/setup.dart @@ -39,4 +39,5 @@ Future main(List arguments) async { await _buildLib('nullable_test.m', 'nullable_test.dylib'); await _buildLib('property_test.m', 'property_test.dylib'); await _buildLib('string_test.m', 'string_test.dylib'); + await _buildLib('block_test.m', 'block_test.dylib'); } diff --git a/pkgs/ffigen/test/native_objc_test/string_bindings.dart b/pkgs/ffigen/test/native_objc_test/string_bindings.dart index ae27fc91dd..4614d8e2fc 100644 --- a/pkgs/ffigen/test/native_objc_test/string_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/string_bindings.dart @@ -1041,6 +1041,23 @@ class StringTestObjCLibrary { _registerName1("getParagraphStart:end:contentsEnd:forRange:"); late final ffi.Pointer _sel_paragraphRangeForRange_1 = _registerName1("paragraphRangeForRange:"); + ffi.Pointer<_ObjCBlockDesc> _newBlockDesc1() { + final d = + pkg_ffi.calloc.allocate<_ObjCBlockDesc>(ffi.sizeOf<_ObjCBlockDesc>()); + d.ref.size = ffi.sizeOf<_ObjCBlock>(); + return d; + } + + late final ffi.Pointer<_ObjCBlockDesc> _objc_block_desc1 = _newBlockDesc1(); + ffi.Pointer<_ObjCBlock> _newBlock1( + ffi.Pointer invoke, ffi.Pointer target) { + final b = pkg_ffi.calloc.allocate<_ObjCBlock>(ffi.sizeOf<_ObjCBlock>()); + b.ref.invoke = invoke; + b.ref.target = target; + b.ref.descriptor = _objc_block_desc1; + return b; + } + late final ffi.Pointer _sel_enumerateSubstringsInRange_options_usingBlock_1 = _registerName1("enumerateSubstringsInRange:options:usingBlock:"); @@ -1049,7 +1066,7 @@ class StringTestObjCLibrary { ffi.Pointer sel, NSRange range, int opts, - ffi.Pointer block, + ffi.Pointer<_ObjCBlock> block, ) { return __objc_msgSend_35( obj, @@ -1063,30 +1080,50 @@ class StringTestObjCLibrary { late final __objc_msgSend_35Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); late final __objc_msgSend_35 = __objc_msgSend_35Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer)>(); + ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_enumerateLinesUsingBlock_1 = _registerName1("enumerateLinesUsingBlock:"); - late final ffi.Pointer _sel_UTF8String1 = - _registerName1("UTF8String"); - ffi.Pointer _objc_msgSend_36( + void _objc_msgSend_36( ffi.Pointer obj, ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, ) { return __objc_msgSend_36( obj, sel, + block, ); } late final __objc_msgSend_36Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_36 = __objc_msgSend_36Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final ffi.Pointer _sel_UTF8String1 = + _registerName1("UTF8String"); + ffi.Pointer _objc_msgSend_37( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_37( + obj, + sel, + ); + } + + late final __objc_msgSend_37Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_36 = __objc_msgSend_36Ptr.asFunction< + late final __objc_msgSend_37 = __objc_msgSend_37Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); @@ -1098,13 +1135,13 @@ class StringTestObjCLibrary { late final ffi.Pointer _sel_dataUsingEncoding_allowLossyConversion_1 = _registerName1("dataUsingEncoding:allowLossyConversion:"); - ffi.Pointer _objc_msgSend_37( + ffi.Pointer _objc_msgSend_38( ffi.Pointer obj, ffi.Pointer sel, int encoding, bool lossy, ) { - return __objc_msgSend_37( + return __objc_msgSend_38( obj, sel, encoding, @@ -1112,47 +1149,47 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_37Ptr = _lookup< + late final __objc_msgSend_38Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, NSStringEncoding, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_37 = __objc_msgSend_37Ptr.asFunction< + late final __objc_msgSend_38 = __objc_msgSend_38Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int, int)>(); late final ffi.Pointer _sel_dataUsingEncoding_1 = _registerName1("dataUsingEncoding:"); - ffi.Pointer _objc_msgSend_38( + ffi.Pointer _objc_msgSend_39( ffi.Pointer obj, ffi.Pointer sel, int encoding, ) { - return __objc_msgSend_38( + return __objc_msgSend_39( obj, sel, encoding, ); } - late final __objc_msgSend_38Ptr = _lookup< + late final __objc_msgSend_39Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_38 = __objc_msgSend_38Ptr.asFunction< + late final __objc_msgSend_39 = __objc_msgSend_39Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_canBeConvertedToEncoding_1 = _registerName1("canBeConvertedToEncoding:"); - bool _objc_msgSend_39( + bool _objc_msgSend_40( ffi.Pointer obj, ffi.Pointer sel, int encoding, ) { - return __objc_msgSend_39( + return __objc_msgSend_40( obj, sel, encoding, @@ -1160,44 +1197,44 @@ class StringTestObjCLibrary { 0; } - late final __objc_msgSend_39Ptr = _lookup< + late final __objc_msgSend_40Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_39 = __objc_msgSend_39Ptr.asFunction< + late final __objc_msgSend_40 = __objc_msgSend_40Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_cStringUsingEncoding_1 = _registerName1("cStringUsingEncoding:"); - void _objc_msgSend_40( + void _objc_msgSend_41( ffi.Pointer obj, ffi.Pointer sel, int encoding, ) { - return __objc_msgSend_40( + return __objc_msgSend_41( obj, sel, encoding, ); } - late final __objc_msgSend_40Ptr = _lookup< + late final __objc_msgSend_41Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_40 = __objc_msgSend_40Ptr.asFunction< + late final __objc_msgSend_41 = __objc_msgSend_41Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_getCString_maxLength_encoding_1 = _registerName1("getCString:maxLength:encoding:"); - bool _objc_msgSend_41( + bool _objc_msgSend_42( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer buffer, int maxBufferCount, int encoding, ) { - return __objc_msgSend_41( + return __objc_msgSend_42( obj, sel, buffer, @@ -1207,7 +1244,7 @@ class StringTestObjCLibrary { 0; } - late final __objc_msgSend_41Ptr = _lookup< + late final __objc_msgSend_42Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function( ffi.Pointer, @@ -1215,7 +1252,7 @@ class StringTestObjCLibrary { ffi.Pointer, NSUInteger, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_41 = __objc_msgSend_41Ptr.asFunction< + late final __objc_msgSend_42 = __objc_msgSend_42Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, int)>(); @@ -1223,7 +1260,7 @@ class StringTestObjCLibrary { _sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_1 = _registerName1( "getBytes:maxLength:usedLength:encoding:options:range:remainingRange:"); - bool _objc_msgSend_42( + bool _objc_msgSend_43( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer buffer, @@ -1234,7 +1271,7 @@ class StringTestObjCLibrary { NSRange range, NSRangePointer leftover, ) { - return __objc_msgSend_42( + return __objc_msgSend_43( obj, sel, buffer, @@ -1248,7 +1285,7 @@ class StringTestObjCLibrary { 0; } - late final __objc_msgSend_42Ptr = _lookup< + late final __objc_msgSend_43Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function( ffi.Pointer, @@ -1260,7 +1297,7 @@ class StringTestObjCLibrary { ffi.Int32, NSRange, NSRangePointer)>>('objc_msgSend'); - late final __objc_msgSend_42 = __objc_msgSend_42Ptr.asFunction< + late final __objc_msgSend_43 = __objc_msgSend_43Ptr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -1274,44 +1311,44 @@ class StringTestObjCLibrary { late final ffi.Pointer _sel_maximumLengthOfBytesUsingEncoding_1 = _registerName1("maximumLengthOfBytesUsingEncoding:"); - int _objc_msgSend_43( + int _objc_msgSend_44( ffi.Pointer obj, ffi.Pointer sel, int enc, ) { - return __objc_msgSend_43( + return __objc_msgSend_44( obj, sel, enc, ); } - late final __objc_msgSend_43Ptr = _lookup< + late final __objc_msgSend_44Ptr = _lookup< ffi.NativeFunction< NSUInteger Function(ffi.Pointer, ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_43 = __objc_msgSend_43Ptr.asFunction< + late final __objc_msgSend_44 = __objc_msgSend_44Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_lengthOfBytesUsingEncoding_1 = _registerName1("lengthOfBytesUsingEncoding:"); late final ffi.Pointer _sel_availableStringEncodings1 = _registerName1("availableStringEncodings"); - ffi.Pointer _objc_msgSend_44( + ffi.Pointer _objc_msgSend_45( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_44( + return __objc_msgSend_45( obj, sel, ); } - late final __objc_msgSend_44Ptr = _lookup< + late final __objc_msgSend_45Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_44 = __objc_msgSend_44Ptr.asFunction< + late final __objc_msgSend_45 = __objc_msgSend_45Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); @@ -1334,14 +1371,14 @@ class StringTestObjCLibrary { late final ffi.Pointer _sel_stringByPaddingToLength_withString_startingAtIndex_1 = _registerName1("stringByPaddingToLength:withString:startingAtIndex:"); - ffi.Pointer _objc_msgSend_45( + ffi.Pointer _objc_msgSend_46( ffi.Pointer obj, ffi.Pointer sel, int newLength, ffi.Pointer padString, int padIndex, ) { - return __objc_msgSend_45( + return __objc_msgSend_46( obj, sel, newLength, @@ -1350,7 +1387,7 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_45Ptr = _lookup< + late final __objc_msgSend_46Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, @@ -1358,19 +1395,19 @@ class StringTestObjCLibrary { NSUInteger, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_45 = __objc_msgSend_45Ptr.asFunction< + late final __objc_msgSend_46 = __objc_msgSend_46Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer, int)>(); late final ffi.Pointer _sel_stringByFoldingWithOptions_locale_1 = _registerName1("stringByFoldingWithOptions:locale:"); - ffi.Pointer _objc_msgSend_46( + ffi.Pointer _objc_msgSend_47( ffi.Pointer obj, ffi.Pointer sel, int options, ffi.Pointer locale, ) { - return __objc_msgSend_46( + return __objc_msgSend_47( obj, sel, options, @@ -1378,14 +1415,14 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_46Ptr = _lookup< + late final __objc_msgSend_47Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_46 = __objc_msgSend_46Ptr.asFunction< + late final __objc_msgSend_47 = __objc_msgSend_47Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); @@ -1393,7 +1430,7 @@ class StringTestObjCLibrary { _sel_stringByReplacingOccurrencesOfString_withString_options_range_1 = _registerName1( "stringByReplacingOccurrencesOfString:withString:options:range:"); - ffi.Pointer _objc_msgSend_47( + ffi.Pointer _objc_msgSend_48( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer target, @@ -1401,7 +1438,7 @@ class StringTestObjCLibrary { int options, NSRange searchRange, ) { - return __objc_msgSend_47( + return __objc_msgSend_48( obj, sel, target, @@ -1411,7 +1448,7 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_47Ptr = _lookup< + late final __objc_msgSend_48Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, @@ -1420,7 +1457,7 @@ class StringTestObjCLibrary { ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_47 = __objc_msgSend_47Ptr.asFunction< + late final __objc_msgSend_48 = __objc_msgSend_48Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, @@ -1432,13 +1469,13 @@ class StringTestObjCLibrary { late final ffi.Pointer _sel_stringByReplacingOccurrencesOfString_withString_1 = _registerName1("stringByReplacingOccurrencesOfString:withString:"); - ffi.Pointer _objc_msgSend_48( + ffi.Pointer _objc_msgSend_49( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer target, ffi.Pointer replacement, ) { - return __objc_msgSend_48( + return __objc_msgSend_49( obj, sel, target, @@ -1446,14 +1483,14 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_48Ptr = _lookup< + late final __objc_msgSend_49Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_48 = __objc_msgSend_48Ptr.asFunction< + late final __objc_msgSend_49 = __objc_msgSend_49Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, @@ -1463,13 +1500,13 @@ class StringTestObjCLibrary { late final ffi.Pointer _sel_stringByReplacingCharactersInRange_withString_1 = _registerName1("stringByReplacingCharactersInRange:withString:"); - ffi.Pointer _objc_msgSend_49( + ffi.Pointer _objc_msgSend_50( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ffi.Pointer replacement, ) { - return __objc_msgSend_49( + return __objc_msgSend_50( obj, sel, range, @@ -1477,26 +1514,26 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_49Ptr = _lookup< + late final __objc_msgSend_50Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, NSRange, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_49 = __objc_msgSend_49Ptr.asFunction< + late final __objc_msgSend_50 = __objc_msgSend_50Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, NSRange, ffi.Pointer)>(); late final ffi.Pointer _sel_stringByApplyingTransform_reverse_1 = _registerName1("stringByApplyingTransform:reverse:"); - ffi.Pointer _objc_msgSend_50( + ffi.Pointer _objc_msgSend_51( ffi.Pointer obj, ffi.Pointer sel, NSStringTransform transform, bool reverse, ) { - return __objc_msgSend_50( + return __objc_msgSend_51( obj, sel, transform, @@ -1504,20 +1541,20 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_50Ptr = _lookup< + late final __objc_msgSend_51Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, NSStringTransform, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_50 = __objc_msgSend_50Ptr.asFunction< + late final __objc_msgSend_51 = __objc_msgSend_51Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, NSStringTransform, int)>(); late final ffi.Pointer _sel_writeToURL_atomically_encoding_error_1 = _registerName1("writeToURL:atomically:encoding:error:"); - bool _objc_msgSend_51( + bool _objc_msgSend_52( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer url, @@ -1525,7 +1562,7 @@ class StringTestObjCLibrary { int enc, ffi.Pointer> error, ) { - return __objc_msgSend_51( + return __objc_msgSend_52( obj, sel, url, @@ -1536,7 +1573,7 @@ class StringTestObjCLibrary { 0; } - late final __objc_msgSend_51Ptr = _lookup< + late final __objc_msgSend_52Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function( ffi.Pointer, @@ -1545,7 +1582,7 @@ class StringTestObjCLibrary { ffi.Uint8, NSStringEncoding, ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_51 = __objc_msgSend_51Ptr.asFunction< + late final __objc_msgSend_52 = __objc_msgSend_52Ptr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -1561,14 +1598,14 @@ class StringTestObjCLibrary { late final ffi.Pointer _sel_initWithCharactersNoCopy_length_freeWhenDone_1 = _registerName1("initWithCharactersNoCopy:length:freeWhenDone:"); - instancetype _objc_msgSend_52( + instancetype _objc_msgSend_53( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer characters, int length, bool freeBuffer, ) { - return __objc_msgSend_52( + return __objc_msgSend_53( obj, sel, characters, @@ -1577,25 +1614,25 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_52Ptr = _lookup< + late final __objc_msgSend_53Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSUInteger, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_52 = __objc_msgSend_52Ptr.asFunction< + late final __objc_msgSend_53 = __objc_msgSend_53Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, int)>(); late final ffi.Pointer _sel_initWithCharactersNoCopy_length_deallocator_1 = _registerName1("initWithCharactersNoCopy:length:deallocator:"); - instancetype _objc_msgSend_53( + instancetype _objc_msgSend_54( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer chars, int len, - ffi.Pointer deallocator, + ffi.Pointer<_ObjCBlock> deallocator, ) { - return __objc_msgSend_53( + return __objc_msgSend_54( obj, sel, chars, @@ -1604,27 +1641,27 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_53Ptr = _lookup< + late final __objc_msgSend_54Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, NSUInteger, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_53 = __objc_msgSend_53Ptr.asFunction< + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_initWithCharacters_length_1 = _registerName1("initWithCharacters:length:"); - instancetype _objc_msgSend_54( + instancetype _objc_msgSend_55( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer characters, int length, ) { - return __objc_msgSend_54( + return __objc_msgSend_55( obj, sel, characters, @@ -1632,33 +1669,33 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_54Ptr = _lookup< + late final __objc_msgSend_55Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< + late final __objc_msgSend_55 = __objc_msgSend_55Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithUTF8String_1 = _registerName1("initWithUTF8String:"); - instancetype _objc_msgSend_55( + instancetype _objc_msgSend_56( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer nullTerminatedCString, ) { - return __objc_msgSend_55( + return __objc_msgSend_56( obj, sel, nullTerminatedCString, ); } - late final __objc_msgSend_55Ptr = _lookup< + late final __objc_msgSend_56Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_55 = __objc_msgSend_55Ptr.asFunction< + late final __objc_msgSend_56 = __objc_msgSend_56Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -1668,13 +1705,13 @@ class StringTestObjCLibrary { _registerName1("initWithFormat:"); late final ffi.Pointer _sel_initWithFormat_arguments_1 = _registerName1("initWithFormat:arguments:"); - instancetype _objc_msgSend_56( + instancetype _objc_msgSend_57( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer format, ffi.Pointer<__va_list_tag> argList, ) { - return __objc_msgSend_56( + return __objc_msgSend_57( obj, sel, format, @@ -1682,26 +1719,26 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_56Ptr = _lookup< + late final __objc_msgSend_57Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); - late final __objc_msgSend_56 = __objc_msgSend_56Ptr.asFunction< + late final __objc_msgSend_57 = __objc_msgSend_57Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer<__va_list_tag>)>(); late final ffi.Pointer _sel_initWithFormat_locale_1 = _registerName1("initWithFormat:locale:"); - instancetype _objc_msgSend_57( + instancetype _objc_msgSend_58( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer format, ffi.Pointer locale, ) { - return __objc_msgSend_57( + return __objc_msgSend_58( obj, sel, format, @@ -1709,27 +1746,27 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_57Ptr = _lookup< + late final __objc_msgSend_58Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_57 = __objc_msgSend_57Ptr.asFunction< + late final __objc_msgSend_58 = __objc_msgSend_58Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_initWithFormat_locale_arguments_1 = _registerName1("initWithFormat:locale:arguments:"); - instancetype _objc_msgSend_58( + instancetype _objc_msgSend_59( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer format, ffi.Pointer locale, ffi.Pointer<__va_list_tag> argList, ) { - return __objc_msgSend_58( + return __objc_msgSend_59( obj, sel, format, @@ -1738,7 +1775,7 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_58Ptr = _lookup< + late final __objc_msgSend_59Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, @@ -1746,7 +1783,7 @@ class StringTestObjCLibrary { ffi.Pointer, ffi.Pointer, ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); - late final __objc_msgSend_58 = __objc_msgSend_58Ptr.asFunction< + late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< instancetype Function( ffi.Pointer, ffi.Pointer, @@ -1756,13 +1793,13 @@ class StringTestObjCLibrary { late final ffi.Pointer _sel_initWithData_encoding_1 = _registerName1("initWithData:encoding:"); - instancetype _objc_msgSend_59( + instancetype _objc_msgSend_60( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer data, int encoding, ) { - return __objc_msgSend_59( + return __objc_msgSend_60( obj, sel, data, @@ -1770,24 +1807,24 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_59Ptr = _lookup< + late final __objc_msgSend_60Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< + late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithBytes_length_encoding_1 = _registerName1("initWithBytes:length:encoding:"); - instancetype _objc_msgSend_60( + instancetype _objc_msgSend_61( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer bytes, int len, int encoding, ) { - return __objc_msgSend_60( + return __objc_msgSend_61( obj, sel, bytes, @@ -1796,7 +1833,7 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_60Ptr = _lookup< + late final __objc_msgSend_61Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, @@ -1804,14 +1841,14 @@ class StringTestObjCLibrary { ffi.Pointer, NSUInteger, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< + late final __objc_msgSend_61 = __objc_msgSend_61Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, int)>(); late final ffi.Pointer _sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1 = _registerName1("initWithBytesNoCopy:length:encoding:freeWhenDone:"); - instancetype _objc_msgSend_61( + instancetype _objc_msgSend_62( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer bytes, @@ -1819,7 +1856,7 @@ class StringTestObjCLibrary { int encoding, bool freeBuffer, ) { - return __objc_msgSend_61( + return __objc_msgSend_62( obj, sel, bytes, @@ -1829,7 +1866,7 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_61Ptr = _lookup< + late final __objc_msgSend_62Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, @@ -1838,22 +1875,22 @@ class StringTestObjCLibrary { NSUInteger, NSStringEncoding, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_61 = __objc_msgSend_61Ptr.asFunction< + late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, int, int)>(); late final ffi.Pointer _sel_initWithBytesNoCopy_length_encoding_deallocator_1 = _registerName1("initWithBytesNoCopy:length:encoding:deallocator:"); - instancetype _objc_msgSend_62( + instancetype _objc_msgSend_63( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer bytes, int len, int encoding, - ffi.Pointer deallocator, + ffi.Pointer<_ObjCBlock> deallocator, ) { - return __objc_msgSend_62( + return __objc_msgSend_63( obj, sel, bytes, @@ -1863,7 +1900,7 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_62Ptr = _lookup< + late final __objc_msgSend_63Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, @@ -1871,10 +1908,10 @@ class StringTestObjCLibrary { ffi.Pointer, NSUInteger, NSStringEncoding, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_63 = __objc_msgSend_63Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, ffi.Pointer)>(); + ffi.Pointer, int, int, ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_string1 = _registerName1("string"); late final ffi.Pointer _sel_stringWithString_1 = @@ -1889,13 +1926,13 @@ class StringTestObjCLibrary { _registerName1("localizedStringWithFormat:"); late final ffi.Pointer _sel_initWithCString_encoding_1 = _registerName1("initWithCString:encoding:"); - instancetype _objc_msgSend_63( + instancetype _objc_msgSend_64( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer nullTerminatedCString, int encoding, ) { - return __objc_msgSend_63( + return __objc_msgSend_64( obj, sel, nullTerminatedCString, @@ -1903,11 +1940,11 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_63Ptr = _lookup< + late final __objc_msgSend_64Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_63 = __objc_msgSend_63Ptr.asFunction< + late final __objc_msgSend_64 = __objc_msgSend_64Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); @@ -1915,14 +1952,14 @@ class StringTestObjCLibrary { _registerName1("stringWithCString:encoding:"); late final ffi.Pointer _sel_initWithContentsOfURL_encoding_error_1 = _registerName1("initWithContentsOfURL:encoding:error:"); - instancetype _objc_msgSend_64( + instancetype _objc_msgSend_65( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer url, int enc, ffi.Pointer> error, ) { - return __objc_msgSend_64( + return __objc_msgSend_65( obj, sel, url, @@ -1931,7 +1968,7 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_64Ptr = _lookup< + late final __objc_msgSend_65Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, @@ -1939,7 +1976,7 @@ class StringTestObjCLibrary { ffi.Pointer, NSStringEncoding, ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_64 = __objc_msgSend_64Ptr.asFunction< + late final __objc_msgSend_65 = __objc_msgSend_65Ptr.asFunction< instancetype Function( ffi.Pointer, ffi.Pointer, @@ -1958,14 +1995,14 @@ class StringTestObjCLibrary { late final ffi.Pointer _sel_initWithContentsOfURL_usedEncoding_error_1 = _registerName1("initWithContentsOfURL:usedEncoding:error:"); - instancetype _objc_msgSend_65( + instancetype _objc_msgSend_66( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer url, ffi.Pointer enc, ffi.Pointer> error, ) { - return __objc_msgSend_65( + return __objc_msgSend_66( obj, sel, url, @@ -1974,7 +2011,7 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_65Ptr = _lookup< + late final __objc_msgSend_66Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, @@ -1982,7 +2019,7 @@ class StringTestObjCLibrary { ffi.Pointer, ffi.Pointer, ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_65 = __objc_msgSend_65Ptr.asFunction< + late final __objc_msgSend_66 = __objc_msgSend_66Ptr.asFunction< instancetype Function( ffi.Pointer, ffi.Pointer, @@ -2003,7 +2040,7 @@ class StringTestObjCLibrary { _sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1 = _registerName1( "stringEncodingForData:encodingOptions:convertedString:usedLossyConversion:"); - int _objc_msgSend_66( + int _objc_msgSend_67( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer data, @@ -2011,7 +2048,7 @@ class StringTestObjCLibrary { ffi.Pointer> string, ffi.Pointer usedLossyConversion, ) { - return __objc_msgSend_66( + return __objc_msgSend_67( obj, sel, data, @@ -2021,7 +2058,7 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_66Ptr = _lookup< + late final __objc_msgSend_67Ptr = _lookup< ffi.NativeFunction< NSStringEncoding Function( ffi.Pointer, @@ -2030,7 +2067,7 @@ class StringTestObjCLibrary { ffi.Pointer, ffi.Pointer>, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_66 = __objc_msgSend_66Ptr.asFunction< + late final __objc_msgSend_67 = __objc_msgSend_67Ptr.asFunction< int Function( ffi.Pointer, ffi.Pointer, @@ -2045,21 +2082,21 @@ class StringTestObjCLibrary { _getClass1("NSDictionary"); late final ffi.Pointer _sel_propertyListFromStringsFileFormat1 = _registerName1("propertyListFromStringsFileFormat"); - ffi.Pointer _objc_msgSend_67( + ffi.Pointer _objc_msgSend_68( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_67( + return __objc_msgSend_68( obj, sel, ); } - late final __objc_msgSend_67Ptr = _lookup< + late final __objc_msgSend_68Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_67 = __objc_msgSend_67Ptr.asFunction< + late final __objc_msgSend_68 = __objc_msgSend_68Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); @@ -2070,35 +2107,35 @@ class StringTestObjCLibrary { _registerName1("cStringLength"); late final ffi.Pointer _sel_getCString_1 = _registerName1("getCString:"); - void _objc_msgSend_68( + void _objc_msgSend_69( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer bytes, ) { - return __objc_msgSend_68( + return __objc_msgSend_69( obj, sel, bytes, ); } - late final __objc_msgSend_68Ptr = _lookup< + late final __objc_msgSend_69Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_68 = __objc_msgSend_68Ptr.asFunction< + late final __objc_msgSend_69 = __objc_msgSend_69Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_getCString_maxLength_1 = _registerName1("getCString:maxLength:"); - void _objc_msgSend_69( + void _objc_msgSend_70( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer bytes, int maxLength, ) { - return __objc_msgSend_69( + return __objc_msgSend_70( obj, sel, bytes, @@ -2106,18 +2143,18 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_69Ptr = _lookup< + late final __objc_msgSend_70Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_69 = __objc_msgSend_69Ptr.asFunction< + late final __objc_msgSend_70 = __objc_msgSend_70Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_getCString_maxLength_range_remainingRange_1 = _registerName1("getCString:maxLength:range:remainingRange:"); - void _objc_msgSend_70( + void _objc_msgSend_71( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer bytes, @@ -2125,7 +2162,7 @@ class StringTestObjCLibrary { NSRange aRange, NSRangePointer leftoverRange, ) { - return __objc_msgSend_70( + return __objc_msgSend_71( obj, sel, bytes, @@ -2135,7 +2172,7 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_70Ptr = _lookup< + late final __objc_msgSend_71Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -2144,19 +2181,19 @@ class StringTestObjCLibrary { NSUInteger, NSRange, NSRangePointer)>>('objc_msgSend'); - late final __objc_msgSend_70 = __objc_msgSend_70Ptr.asFunction< + late final __objc_msgSend_71 = __objc_msgSend_71Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, NSRange, NSRangePointer)>(); late final ffi.Pointer _sel_writeToFile_atomically_1 = _registerName1("writeToFile:atomically:"); - bool _objc_msgSend_71( + bool _objc_msgSend_72( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer path, bool useAuxiliaryFile, ) { - return __objc_msgSend_71( + return __objc_msgSend_72( obj, sel, path, @@ -2165,11 +2202,11 @@ class StringTestObjCLibrary { 0; } - late final __objc_msgSend_71Ptr = _lookup< + late final __objc_msgSend_72Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_71 = __objc_msgSend_71Ptr.asFunction< + late final __objc_msgSend_72 = __objc_msgSend_72Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); @@ -2186,14 +2223,14 @@ class StringTestObjCLibrary { late final ffi.Pointer _sel_initWithCStringNoCopy_length_freeWhenDone_1 = _registerName1("initWithCStringNoCopy:length:freeWhenDone:"); - ffi.Pointer _objc_msgSend_72( + ffi.Pointer _objc_msgSend_73( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer bytes, int length, bool freeBuffer, ) { - return __objc_msgSend_72( + return __objc_msgSend_73( obj, sel, bytes, @@ -2202,7 +2239,7 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_72Ptr = _lookup< + late final __objc_msgSend_73Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, @@ -2210,7 +2247,7 @@ class StringTestObjCLibrary { ffi.Pointer, NSUInteger, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_72 = __objc_msgSend_72Ptr.asFunction< + late final __objc_msgSend_73 = __objc_msgSend_73Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, int)>(); @@ -2224,41 +2261,41 @@ class StringTestObjCLibrary { _registerName1("stringWithCString:"); late final ffi.Pointer _sel_getCharacters_1 = _registerName1("getCharacters:"); - void _objc_msgSend_73( + void _objc_msgSend_74( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer buffer, ) { - return __objc_msgSend_73( + return __objc_msgSend_74( obj, sel, buffer, ); } - late final __objc_msgSend_73Ptr = _lookup< + late final __objc_msgSend_74Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_73 = __objc_msgSend_73Ptr.asFunction< + late final __objc_msgSend_74 = __objc_msgSend_74Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _objc_msgSend_74( + ffi.Pointer _objc_msgSend_75( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_74( + return __objc_msgSend_75( obj, sel, ); } - late final __objc_msgSend_74Ptr = _lookup< + late final __objc_msgSend_75Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_74 = __objc_msgSend_74Ptr.asFunction< + late final __objc_msgSend_75 = __objc_msgSend_75Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); @@ -2267,23 +2304,23 @@ class StringTestObjCLibrary { late final ffi.Pointer _sel_version1 = _registerName1("version"); late final ffi.Pointer _sel_setVersion_1 = _registerName1("setVersion:"); - void _objc_msgSend_75( + void _objc_msgSend_76( ffi.Pointer obj, ffi.Pointer sel, int aVersion, ) { - return __objc_msgSend_75( + return __objc_msgSend_76( obj, sel, aVersion, ); } - late final __objc_msgSend_75Ptr = _lookup< + late final __objc_msgSend_76Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_75 = __objc_msgSend_75Ptr.asFunction< + late final __objc_msgSend_76 = __objc_msgSend_76Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_classForCoder1 = @@ -2299,13 +2336,13 @@ class StringTestObjCLibrary { late final ffi.Pointer _class_NSValue1 = _getClass1("NSValue"); late final ffi.Pointer _sel_getValue_size_1 = _registerName1("getValue:size:"); - void _objc_msgSend_76( + void _objc_msgSend_77( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer value, int size, ) { - return __objc_msgSend_76( + return __objc_msgSend_77( obj, sel, value, @@ -2313,24 +2350,24 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_76Ptr = _lookup< + late final __objc_msgSend_77Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_76 = __objc_msgSend_76Ptr.asFunction< + late final __objc_msgSend_77 = __objc_msgSend_77Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_objCType1 = _registerName1("objCType"); late final ffi.Pointer _sel_initWithBytes_objCType_1 = _registerName1("initWithBytes:objCType:"); - instancetype _objc_msgSend_77( + instancetype _objc_msgSend_78( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer value, ffi.Pointer type, ) { - return __objc_msgSend_77( + return __objc_msgSend_78( obj, sel, value, @@ -2338,26 +2375,26 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_77Ptr = _lookup< + late final __objc_msgSend_78Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_77 = __objc_msgSend_77Ptr.asFunction< + late final __objc_msgSend_78 = __objc_msgSend_78Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_valueWithBytes_objCType_1 = _registerName1("valueWithBytes:objCType:"); - ffi.Pointer _objc_msgSend_78( + ffi.Pointer _objc_msgSend_79( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer value, ffi.Pointer type, ) { - return __objc_msgSend_78( + return __objc_msgSend_79( obj, sel, value, @@ -2365,14 +2402,14 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_78Ptr = _lookup< + late final __objc_msgSend_79Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_78 = __objc_msgSend_78Ptr.asFunction< + late final __objc_msgSend_79 = __objc_msgSend_79Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, @@ -2383,23 +2420,23 @@ class StringTestObjCLibrary { _registerName1("value:withObjCType:"); late final ffi.Pointer _sel_valueWithNonretainedObject_1 = _registerName1("valueWithNonretainedObject:"); - ffi.Pointer _objc_msgSend_79( + ffi.Pointer _objc_msgSend_80( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer anObject, ) { - return __objc_msgSend_79( + return __objc_msgSend_80( obj, sel, anObject, ); } - late final __objc_msgSend_79Ptr = _lookup< + late final __objc_msgSend_80Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_79 = __objc_msgSend_79Ptr.asFunction< + late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -2407,394 +2444,394 @@ class StringTestObjCLibrary { _registerName1("nonretainedObjectValue"); late final ffi.Pointer _sel_valueWithPointer_1 = _registerName1("valueWithPointer:"); - ffi.Pointer _objc_msgSend_80( + ffi.Pointer _objc_msgSend_81( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer pointer, ) { - return __objc_msgSend_80( + return __objc_msgSend_81( obj, sel, pointer, ); } - late final __objc_msgSend_80Ptr = _lookup< + late final __objc_msgSend_81Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< + late final __objc_msgSend_81 = __objc_msgSend_81Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_pointerValue1 = _registerName1("pointerValue"); - ffi.Pointer _objc_msgSend_81( + ffi.Pointer _objc_msgSend_82( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_81( + return __objc_msgSend_82( obj, sel, ); } - late final __objc_msgSend_81Ptr = _lookup< + late final __objc_msgSend_82Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_81 = __objc_msgSend_81Ptr.asFunction< + late final __objc_msgSend_82 = __objc_msgSend_82Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_isEqualToValue_1 = _registerName1("isEqualToValue:"); late final ffi.Pointer _sel_getValue_1 = _registerName1("getValue:"); - void _objc_msgSend_82( + void _objc_msgSend_83( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer value, ) { - return __objc_msgSend_82( + return __objc_msgSend_83( obj, sel, value, ); } - late final __objc_msgSend_82Ptr = _lookup< + late final __objc_msgSend_83Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_82 = __objc_msgSend_82Ptr.asFunction< + late final __objc_msgSend_83 = __objc_msgSend_83Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_valueWithRange_1 = _registerName1("valueWithRange:"); - ffi.Pointer _objc_msgSend_83( + ffi.Pointer _objc_msgSend_84( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ) { - return __objc_msgSend_83( + return __objc_msgSend_84( obj, sel, range, ); } - late final __objc_msgSend_83Ptr = _lookup< + late final __objc_msgSend_84Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_83 = __objc_msgSend_83Ptr.asFunction< + late final __objc_msgSend_84 = __objc_msgSend_84Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, NSRange)>(); late final ffi.Pointer _sel_rangeValue1 = _registerName1("rangeValue"); - NSRange _objc_msgSend_84( + NSRange _objc_msgSend_85( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_84( + return __objc_msgSend_85( obj, sel, ); } - late final __objc_msgSend_84Ptr = _lookup< + late final __objc_msgSend_85Ptr = _lookup< ffi.NativeFunction< NSRange Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_84 = __objc_msgSend_84Ptr.asFunction< + late final __objc_msgSend_85 = __objc_msgSend_85Ptr.asFunction< NSRange Function(ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _class_NSNumber1 = _getClass1("NSNumber"); late final ffi.Pointer _sel_initWithChar_1 = _registerName1("initWithChar:"); - ffi.Pointer _objc_msgSend_85( + ffi.Pointer _objc_msgSend_86( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_85( + return __objc_msgSend_86( obj, sel, value, ); } - late final __objc_msgSend_85Ptr = _lookup< + late final __objc_msgSend_86Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, pkg_ffi.Char)>>('objc_msgSend'); - late final __objc_msgSend_85 = __objc_msgSend_85Ptr.asFunction< + late final __objc_msgSend_86 = __objc_msgSend_86Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithUnsignedChar_1 = _registerName1("initWithUnsignedChar:"); - ffi.Pointer _objc_msgSend_86( + ffi.Pointer _objc_msgSend_87( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_86( + return __objc_msgSend_87( obj, sel, value, ); } - late final __objc_msgSend_86Ptr = _lookup< + late final __objc_msgSend_87Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, pkg_ffi.UnsignedChar)>>('objc_msgSend'); - late final __objc_msgSend_86 = __objc_msgSend_86Ptr.asFunction< + late final __objc_msgSend_87 = __objc_msgSend_87Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithShort_1 = _registerName1("initWithShort:"); - ffi.Pointer _objc_msgSend_87( + ffi.Pointer _objc_msgSend_88( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_87( + return __objc_msgSend_88( obj, sel, value, ); } - late final __objc_msgSend_87Ptr = _lookup< + late final __objc_msgSend_88Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, pkg_ffi.Short)>>('objc_msgSend'); - late final __objc_msgSend_87 = __objc_msgSend_87Ptr.asFunction< + late final __objc_msgSend_88 = __objc_msgSend_88Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithUnsignedShort_1 = _registerName1("initWithUnsignedShort:"); - ffi.Pointer _objc_msgSend_88( + ffi.Pointer _objc_msgSend_89( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_88( + return __objc_msgSend_89( obj, sel, value, ); } - late final __objc_msgSend_88Ptr = _lookup< + late final __objc_msgSend_89Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, pkg_ffi.UnsignedShort)>>('objc_msgSend'); - late final __objc_msgSend_88 = __objc_msgSend_88Ptr.asFunction< + late final __objc_msgSend_89 = __objc_msgSend_89Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithInt_1 = _registerName1("initWithInt:"); - ffi.Pointer _objc_msgSend_89( + ffi.Pointer _objc_msgSend_90( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_89( + return __objc_msgSend_90( obj, sel, value, ); } - late final __objc_msgSend_89Ptr = _lookup< + late final __objc_msgSend_90Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, pkg_ffi.Int)>>('objc_msgSend'); - late final __objc_msgSend_89 = __objc_msgSend_89Ptr.asFunction< + late final __objc_msgSend_90 = __objc_msgSend_90Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithUnsignedInt_1 = _registerName1("initWithUnsignedInt:"); - ffi.Pointer _objc_msgSend_90( + ffi.Pointer _objc_msgSend_91( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_90( + return __objc_msgSend_91( obj, sel, value, ); } - late final __objc_msgSend_90Ptr = _lookup< + late final __objc_msgSend_91Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_90 = __objc_msgSend_90Ptr.asFunction< + late final __objc_msgSend_91 = __objc_msgSend_91Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithLong_1 = _registerName1("initWithLong:"); - ffi.Pointer _objc_msgSend_91( + ffi.Pointer _objc_msgSend_92( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_91( + return __objc_msgSend_92( obj, sel, value, ); } - late final __objc_msgSend_91Ptr = _lookup< + late final __objc_msgSend_92Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, pkg_ffi.Long)>>('objc_msgSend'); - late final __objc_msgSend_91 = __objc_msgSend_91Ptr.asFunction< + late final __objc_msgSend_92 = __objc_msgSend_92Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithUnsignedLong_1 = _registerName1("initWithUnsignedLong:"); - ffi.Pointer _objc_msgSend_92( + ffi.Pointer _objc_msgSend_93( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_92( + return __objc_msgSend_93( obj, sel, value, ); } - late final __objc_msgSend_92Ptr = _lookup< + late final __objc_msgSend_93Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, pkg_ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_92 = __objc_msgSend_92Ptr.asFunction< + late final __objc_msgSend_93 = __objc_msgSend_93Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithLongLong_1 = _registerName1("initWithLongLong:"); - ffi.Pointer _objc_msgSend_93( + ffi.Pointer _objc_msgSend_94( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_93( + return __objc_msgSend_94( obj, sel, value, ); } - late final __objc_msgSend_93Ptr = _lookup< + late final __objc_msgSend_94Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, pkg_ffi.LongLong)>>('objc_msgSend'); - late final __objc_msgSend_93 = __objc_msgSend_93Ptr.asFunction< + late final __objc_msgSend_94 = __objc_msgSend_94Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithUnsignedLongLong_1 = _registerName1("initWithUnsignedLongLong:"); - ffi.Pointer _objc_msgSend_94( + ffi.Pointer _objc_msgSend_95( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_94( + return __objc_msgSend_95( obj, sel, value, ); } - late final __objc_msgSend_94Ptr = _lookup< + late final __objc_msgSend_95Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, pkg_ffi.UnsignedLongLong)>>('objc_msgSend'); - late final __objc_msgSend_94 = __objc_msgSend_94Ptr.asFunction< + late final __objc_msgSend_95 = __objc_msgSend_95Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_initWithFloat_1 = _registerName1("initWithFloat:"); - ffi.Pointer _objc_msgSend_95( + ffi.Pointer _objc_msgSend_96( ffi.Pointer obj, ffi.Pointer sel, double value, ) { - return __objc_msgSend_95( + return __objc_msgSend_96( obj, sel, value, ); } - late final __objc_msgSend_95Ptr = _lookup< + late final __objc_msgSend_96Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Float)>>('objc_msgSend'); - late final __objc_msgSend_95 = __objc_msgSend_95Ptr.asFunction< + late final __objc_msgSend_96 = __objc_msgSend_96Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, double)>(); late final ffi.Pointer _sel_initWithDouble_1 = _registerName1("initWithDouble:"); - ffi.Pointer _objc_msgSend_96( + ffi.Pointer _objc_msgSend_97( ffi.Pointer obj, ffi.Pointer sel, double value, ) { - return __objc_msgSend_96( + return __objc_msgSend_97( obj, sel, value, ); } - late final __objc_msgSend_96Ptr = _lookup< + late final __objc_msgSend_97Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_96 = __objc_msgSend_96Ptr.asFunction< + late final __objc_msgSend_97 = __objc_msgSend_97Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, double)>(); late final ffi.Pointer _sel_initWithBool_1 = _registerName1("initWithBool:"); - ffi.Pointer _objc_msgSend_97( + ffi.Pointer _objc_msgSend_98( ffi.Pointer obj, ffi.Pointer sel, bool value, ) { - return __objc_msgSend_97( + return __objc_msgSend_98( obj, sel, value ? 1 : 0, ); } - late final __objc_msgSend_97Ptr = _lookup< + late final __objc_msgSend_98Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_97 = __objc_msgSend_97Ptr.asFunction< + late final __objc_msgSend_98 = __objc_msgSend_98Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); @@ -2803,97 +2840,97 @@ class StringTestObjCLibrary { late final ffi.Pointer _sel_initWithUnsignedInteger_1 = _registerName1("initWithUnsignedInteger:"); late final ffi.Pointer _sel_charValue1 = _registerName1("charValue"); - int _objc_msgSend_98( + int _objc_msgSend_99( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_98( + return __objc_msgSend_99( obj, sel, ); } - late final __objc_msgSend_98Ptr = _lookup< + late final __objc_msgSend_99Ptr = _lookup< ffi.NativeFunction< pkg_ffi.Char Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_98 = __objc_msgSend_98Ptr.asFunction< + late final __objc_msgSend_99 = __objc_msgSend_99Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_unsignedCharValue1 = _registerName1("unsignedCharValue"); - int _objc_msgSend_99( + int _objc_msgSend_100( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_99( + return __objc_msgSend_100( obj, sel, ); } - late final __objc_msgSend_99Ptr = _lookup< + late final __objc_msgSend_100Ptr = _lookup< ffi.NativeFunction< pkg_ffi.UnsignedChar Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_99 = __objc_msgSend_99Ptr.asFunction< + late final __objc_msgSend_100 = __objc_msgSend_100Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_shortValue1 = _registerName1("shortValue"); - int _objc_msgSend_100( + int _objc_msgSend_101( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_100( + return __objc_msgSend_101( obj, sel, ); } - late final __objc_msgSend_100Ptr = _lookup< + late final __objc_msgSend_101Ptr = _lookup< ffi.NativeFunction< pkg_ffi.Short Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_100 = __objc_msgSend_100Ptr.asFunction< + late final __objc_msgSend_101 = __objc_msgSend_101Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_unsignedShortValue1 = _registerName1("unsignedShortValue"); - int _objc_msgSend_101( + int _objc_msgSend_102( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_101( + return __objc_msgSend_102( obj, sel, ); } - late final __objc_msgSend_101Ptr = _lookup< + late final __objc_msgSend_102Ptr = _lookup< ffi.NativeFunction< pkg_ffi.UnsignedShort Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_101 = __objc_msgSend_101Ptr.asFunction< + late final __objc_msgSend_102 = __objc_msgSend_102Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_unsignedIntValue1 = _registerName1("unsignedIntValue"); - int _objc_msgSend_102( + int _objc_msgSend_103( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_102( + return __objc_msgSend_103( obj, sel, ); } - late final __objc_msgSend_102Ptr = _lookup< + late final __objc_msgSend_103Ptr = _lookup< ffi.NativeFunction< pkg_ffi.UnsignedInt Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_102 = __objc_msgSend_102Ptr.asFunction< + late final __objc_msgSend_103 = __objc_msgSend_103Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_longValue1 = _registerName1("longValue"); @@ -2901,21 +2938,21 @@ class StringTestObjCLibrary { _registerName1("unsignedLongValue"); late final ffi.Pointer _sel_unsignedLongLongValue1 = _registerName1("unsignedLongLongValue"); - int _objc_msgSend_103( + int _objc_msgSend_104( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_103( + return __objc_msgSend_104( obj, sel, ); } - late final __objc_msgSend_103Ptr = _lookup< + late final __objc_msgSend_104Ptr = _lookup< ffi.NativeFunction< pkg_ffi.UnsignedLongLong Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_103 = __objc_msgSend_103Ptr.asFunction< + late final __objc_msgSend_104 = __objc_msgSend_104Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_unsignedIntegerValue1 = @@ -2967,21 +3004,21 @@ class StringTestObjCLibrary { late final ffi.Pointer _sel_object1 = _registerName1("object"); late final ffi.Pointer _sel_changeType1 = _registerName1("changeType"); - int _objc_msgSend_104( + int _objc_msgSend_105( ffi.Pointer obj, ffi.Pointer sel, ) { - return __objc_msgSend_104( + return __objc_msgSend_105( obj, sel, ); } - late final __objc_msgSend_104Ptr = _lookup< + late final __objc_msgSend_105Ptr = _lookup< ffi.NativeFunction< ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_104 = __objc_msgSend_104Ptr.asFunction< + late final __objc_msgSend_105 = __objc_msgSend_105Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); late final ffi.Pointer _sel_index1 = _registerName1("index"); @@ -2989,14 +3026,14 @@ class StringTestObjCLibrary { _registerName1("associatedIndex"); late final ffi.Pointer _sel_initWithObject_type_index_1 = _registerName1("initWithObject:type:index:"); - instancetype _objc_msgSend_105( + instancetype _objc_msgSend_106( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer anObject, int type, int index, ) { - return __objc_msgSend_105( + return __objc_msgSend_106( obj, sel, anObject, @@ -3005,18 +3042,18 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_105Ptr = _lookup< + late final __objc_msgSend_106Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Int32, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_105 = __objc_msgSend_105Ptr.asFunction< + late final __objc_msgSend_106 = __objc_msgSend_106Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, int)>(); late final ffi.Pointer _sel_initWithObject_type_index_associatedIndex_1 = _registerName1("initWithObject:type:index:associatedIndex:"); - instancetype _objc_msgSend_106( + instancetype _objc_msgSend_107( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer anObject, @@ -3024,7 +3061,7 @@ class StringTestObjCLibrary { int index, int associatedIndex, ) { - return __objc_msgSend_106( + return __objc_msgSend_107( obj, sel, anObject, @@ -3034,7 +3071,7 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_106Ptr = _lookup< + late final __objc_msgSend_107Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, @@ -3043,7 +3080,7 @@ class StringTestObjCLibrary { ffi.Int32, NSUInteger, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_106 = __objc_msgSend_106Ptr.asFunction< + late final __objc_msgSend_107 = __objc_msgSend_107Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, int, int)>(); @@ -3052,45 +3089,45 @@ class StringTestObjCLibrary { late final ffi.Pointer _sel_indexSet1 = _registerName1("indexSet"); late final ffi.Pointer _sel_indexSetWithIndex_1 = _registerName1("indexSetWithIndex:"); - instancetype _objc_msgSend_107( + instancetype _objc_msgSend_108( ffi.Pointer obj, ffi.Pointer sel, int value, ) { - return __objc_msgSend_107( + return __objc_msgSend_108( obj, sel, value, ); } - late final __objc_msgSend_107Ptr = _lookup< + late final __objc_msgSend_108Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_107 = __objc_msgSend_107Ptr.asFunction< + late final __objc_msgSend_108 = __objc_msgSend_108Ptr.asFunction< instancetype Function( ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_indexSetWithIndexesInRange_1 = _registerName1("indexSetWithIndexesInRange:"); - instancetype _objc_msgSend_108( + instancetype _objc_msgSend_109( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ) { - return __objc_msgSend_108( + return __objc_msgSend_109( obj, sel, range, ); } - late final __objc_msgSend_108Ptr = _lookup< + late final __objc_msgSend_109Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_108 = __objc_msgSend_108Ptr.asFunction< + late final __objc_msgSend_109 = __objc_msgSend_109Ptr.asFunction< instancetype Function( ffi.Pointer, ffi.Pointer, NSRange)>(); @@ -3116,14 +3153,14 @@ class StringTestObjCLibrary { _registerName1("indexLessThanOrEqualToIndex:"); late final ffi.Pointer _sel_getIndexes_maxCount_inIndexRange_1 = _registerName1("getIndexes:maxCount:inIndexRange:"); - int _objc_msgSend_109( + int _objc_msgSend_110( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer indexBuffer, int bufferSize, NSRangePointer range, ) { - return __objc_msgSend_109( + return __objc_msgSend_110( obj, sel, indexBuffer, @@ -3132,7 +3169,7 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_109Ptr = _lookup< + late final __objc_msgSend_110Ptr = _lookup< ffi.NativeFunction< NSUInteger Function( ffi.Pointer, @@ -3140,41 +3177,41 @@ class StringTestObjCLibrary { ffi.Pointer, NSUInteger, NSRangePointer)>>('objc_msgSend'); - late final __objc_msgSend_109 = __objc_msgSend_109Ptr.asFunction< + late final __objc_msgSend_110 = __objc_msgSend_110Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, NSRangePointer)>(); late final ffi.Pointer _sel_countOfIndexesInRange_1 = _registerName1("countOfIndexesInRange:"); - int _objc_msgSend_110( + int _objc_msgSend_111( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ) { - return __objc_msgSend_110( + return __objc_msgSend_111( obj, sel, range, ); } - late final __objc_msgSend_110Ptr = _lookup< + late final __objc_msgSend_111Ptr = _lookup< ffi.NativeFunction< NSUInteger Function(ffi.Pointer, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_110 = __objc_msgSend_110Ptr.asFunction< + late final __objc_msgSend_111 = __objc_msgSend_111Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); late final ffi.Pointer _sel_containsIndex_1 = _registerName1("containsIndex:"); late final ffi.Pointer _sel_containsIndexesInRange_1 = _registerName1("containsIndexesInRange:"); - bool _objc_msgSend_111( + bool _objc_msgSend_112( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ) { - return __objc_msgSend_111( + return __objc_msgSend_112( obj, sel, range, @@ -3182,11 +3219,11 @@ class StringTestObjCLibrary { 0; } - late final __objc_msgSend_111Ptr = _lookup< + late final __objc_msgSend_112Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_111 = __objc_msgSend_111Ptr.asFunction< + late final __objc_msgSend_112 = __objc_msgSend_112Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); late final ffi.Pointer _sel_containsIndexes_1 = @@ -3195,16 +3232,36 @@ class StringTestObjCLibrary { _registerName1("intersectsIndexesInRange:"); late final ffi.Pointer _sel_enumerateIndexesUsingBlock_1 = _registerName1("enumerateIndexesUsingBlock:"); + void _objc_msgSend_113( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_113( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_113Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_113 = __objc_msgSend_113Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_enumerateIndexesWithOptions_usingBlock_1 = _registerName1("enumerateIndexesWithOptions:usingBlock:"); - void _objc_msgSend_112( + void _objc_msgSend_114( ffi.Pointer obj, ffi.Pointer sel, int opts, - ffi.Pointer block, + ffi.Pointer<_ObjCBlock> block, ) { - return __objc_msgSend_112( + return __objc_msgSend_114( obj, sel, opts, @@ -3212,25 +3269,25 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_112Ptr = _lookup< + late final __objc_msgSend_114Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_112 = __objc_msgSend_112Ptr.asFunction< + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_114 = __objc_msgSend_114Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); + ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_enumerateIndexesInRange_options_usingBlock_1 = _registerName1("enumerateIndexesInRange:options:usingBlock:"); - void _objc_msgSend_113( + void _objc_msgSend_115( ffi.Pointer obj, ffi.Pointer sel, NSRange range, int opts, - ffi.Pointer block, + ffi.Pointer<_ObjCBlock> block, ) { - return __objc_msgSend_113( + return __objc_msgSend_115( obj, sel, range, @@ -3239,45 +3296,45 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_113Ptr = _lookup< + late final __objc_msgSend_115Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_113 = __objc_msgSend_113Ptr.asFunction< + NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_115 = __objc_msgSend_115Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer)>(); + ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_indexPassingTest_1 = _registerName1("indexPassingTest:"); - int _objc_msgSend_114( + int _objc_msgSend_116( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer predicate, + ffi.Pointer<_ObjCBlock> predicate, ) { - return __objc_msgSend_114( + return __objc_msgSend_116( obj, sel, predicate, ); } - late final __objc_msgSend_114Ptr = _lookup< + late final __objc_msgSend_116Ptr = _lookup< ffi.NativeFunction< NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_114 = __objc_msgSend_114Ptr.asFunction< + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_116 = __objc_msgSend_116Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_indexWithOptions_passingTest_1 = _registerName1("indexWithOptions:passingTest:"); - int _objc_msgSend_115( + int _objc_msgSend_117( ffi.Pointer obj, ffi.Pointer sel, int opts, - ffi.Pointer predicate, + ffi.Pointer<_ObjCBlock> predicate, ) { - return __objc_msgSend_115( + return __objc_msgSend_117( obj, sel, opts, @@ -3285,24 +3342,24 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_115Ptr = _lookup< + late final __objc_msgSend_117Ptr = _lookup< ffi.NativeFunction< NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_115 = __objc_msgSend_115Ptr.asFunction< + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_117 = __objc_msgSend_117Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); + ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_indexInRange_options_passingTest_1 = _registerName1("indexInRange:options:passingTest:"); - int _objc_msgSend_116( + int _objc_msgSend_118( ffi.Pointer obj, ffi.Pointer sel, NSRange range, int opts, - ffi.Pointer predicate, + ffi.Pointer<_ObjCBlock> predicate, ) { - return __objc_msgSend_116( + return __objc_msgSend_118( obj, sel, range, @@ -3311,45 +3368,45 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_116Ptr = _lookup< + late final __objc_msgSend_118Ptr = _lookup< ffi.NativeFunction< NSUInteger Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_116 = __objc_msgSend_116Ptr.asFunction< + NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_118 = __objc_msgSend_118Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer)>(); + ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_indexesPassingTest_1 = _registerName1("indexesPassingTest:"); - ffi.Pointer _objc_msgSend_117( + ffi.Pointer _objc_msgSend_119( ffi.Pointer obj, ffi.Pointer sel, - ffi.Pointer predicate, + ffi.Pointer<_ObjCBlock> predicate, ) { - return __objc_msgSend_117( + return __objc_msgSend_119( obj, sel, predicate, ); } - late final __objc_msgSend_117Ptr = _lookup< + late final __objc_msgSend_119Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_117 = __objc_msgSend_117Ptr.asFunction< + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_119 = __objc_msgSend_119Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_indexesWithOptions_passingTest_1 = _registerName1("indexesWithOptions:passingTest:"); - ffi.Pointer _objc_msgSend_118( + ffi.Pointer _objc_msgSend_120( ffi.Pointer obj, ffi.Pointer sel, int opts, - ffi.Pointer predicate, + ffi.Pointer<_ObjCBlock> predicate, ) { - return __objc_msgSend_118( + return __objc_msgSend_120( obj, sel, opts, @@ -3357,27 +3414,27 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_118Ptr = _lookup< + late final __objc_msgSend_120Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_118 = __objc_msgSend_118Ptr.asFunction< + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_120 = __objc_msgSend_120Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_indexesInRange_options_passingTest_1 = _registerName1("indexesInRange:options:passingTest:"); - ffi.Pointer _objc_msgSend_119( + ffi.Pointer _objc_msgSend_121( ffi.Pointer obj, ffi.Pointer sel, NSRange range, int opts, - ffi.Pointer predicate, + ffi.Pointer<_ObjCBlock> predicate, ) { - return __objc_msgSend_119( + return __objc_msgSend_121( obj, sel, range, @@ -3386,25 +3443,91 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_119Ptr = _lookup< + late final __objc_msgSend_121Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, NSRange, ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_119 = __objc_msgSend_119Ptr.asFunction< + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_121 = __objc_msgSend_121Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSRange, int, ffi.Pointer)>(); + ffi.Pointer, NSRange, int, ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_enumerateRangesUsingBlock_1 = _registerName1("enumerateRangesUsingBlock:"); + void _objc_msgSend_122( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_122( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_122Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_122 = __objc_msgSend_122Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_enumerateRangesWithOptions_usingBlock_1 = _registerName1("enumerateRangesWithOptions:usingBlock:"); + void _objc_msgSend_123( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_123( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_123Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_123 = __objc_msgSend_123Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_enumerateRangesInRange_options_usingBlock_1 = _registerName1("enumerateRangesInRange:options:usingBlock:"); + void _objc_msgSend_124( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_124( + obj, + sel, + range, + opts, + block, + ); + } + + late final __objc_msgSend_124Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_124 = __objc_msgSend_124Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _class_NSMutableIndexSet1 = _getClass1("NSMutableIndexSet"); late final ffi.Pointer _sel_addIndexes_1 = @@ -3418,36 +3541,36 @@ class StringTestObjCLibrary { _registerName1("removeIndex:"); late final ffi.Pointer _sel_addIndexesInRange_1 = _registerName1("addIndexesInRange:"); - void _objc_msgSend_120( + void _objc_msgSend_125( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ) { - return __objc_msgSend_120( + return __objc_msgSend_125( obj, sel, range, ); } - late final __objc_msgSend_120Ptr = _lookup< + late final __objc_msgSend_125Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_120 = __objc_msgSend_120Ptr.asFunction< + late final __objc_msgSend_125 = __objc_msgSend_125Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, NSRange)>(); late final ffi.Pointer _sel_removeIndexesInRange_1 = _registerName1("removeIndexesInRange:"); late final ffi.Pointer _sel_shiftIndexesStartingAtIndex_by_1 = _registerName1("shiftIndexesStartingAtIndex:by:"); - void _objc_msgSend_121( + void _objc_msgSend_126( ffi.Pointer obj, ffi.Pointer sel, int index, int delta, ) { - return __objc_msgSend_121( + return __objc_msgSend_126( obj, sel, index, @@ -3455,11 +3578,11 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_121Ptr = _lookup< + late final __objc_msgSend_126Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSUInteger, NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_121 = __objc_msgSend_121Ptr.asFunction< + late final __objc_msgSend_126 = __objc_msgSend_126Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int, int)>(); late final ffi.Pointer _class_NSOrderedCollectionDifference1 = @@ -3470,7 +3593,7 @@ class StringTestObjCLibrary { _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges_1 = _registerName1( "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:additionalChanges:"); - instancetype _objc_msgSend_122( + instancetype _objc_msgSend_127( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer inserts, @@ -3479,7 +3602,7 @@ class StringTestObjCLibrary { ffi.Pointer removedObjects, ffi.Pointer changes, ) { - return __objc_msgSend_122( + return __objc_msgSend_127( obj, sel, inserts, @@ -3490,7 +3613,7 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_122Ptr = _lookup< + late final __objc_msgSend_127Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, @@ -3500,7 +3623,7 @@ class StringTestObjCLibrary { ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_122 = __objc_msgSend_122Ptr.asFunction< + late final __objc_msgSend_127 = __objc_msgSend_127Ptr.asFunction< instancetype Function( ffi.Pointer, ffi.Pointer, @@ -3514,7 +3637,7 @@ class StringTestObjCLibrary { _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_1 = _registerName1( "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:"); - instancetype _objc_msgSend_123( + instancetype _objc_msgSend_128( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer inserts, @@ -3522,7 +3645,7 @@ class StringTestObjCLibrary { ffi.Pointer removes, ffi.Pointer removedObjects, ) { - return __objc_msgSend_123( + return __objc_msgSend_128( obj, sel, inserts, @@ -3532,7 +3655,7 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_123Ptr = _lookup< + late final __objc_msgSend_128Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, @@ -3541,7 +3664,7 @@ class StringTestObjCLibrary { ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_123 = __objc_msgSend_123Ptr.asFunction< + late final __objc_msgSend_128 = __objc_msgSend_128Ptr.asFunction< instancetype Function( ffi.Pointer, ffi.Pointer, @@ -3562,13 +3685,13 @@ class StringTestObjCLibrary { _registerName1("objectAtIndex:"); late final ffi.Pointer _sel_initWithObjects_count_1 = _registerName1("initWithObjects:count:"); - instancetype _objc_msgSend_124( + instancetype _objc_msgSend_129( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer> objects, int cnt, ) { - return __objc_msgSend_124( + return __objc_msgSend_129( obj, sel, objects, @@ -3576,14 +3699,14 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_124Ptr = _lookup< + late final __objc_msgSend_129Ptr = _lookup< ffi.NativeFunction< instancetype Function( ffi.Pointer, ffi.Pointer, ffi.Pointer>, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_124 = __objc_msgSend_124Ptr.asFunction< + late final __objc_msgSend_129 = __objc_msgSend_129Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer>, int)>(); @@ -3593,13 +3716,13 @@ class StringTestObjCLibrary { _registerName1("containsObject:"); late final ffi.Pointer _sel_descriptionWithLocale_indent_1 = _registerName1("descriptionWithLocale:indent:"); - ffi.Pointer _objc_msgSend_125( + ffi.Pointer _objc_msgSend_130( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer locale, int level, ) { - return __objc_msgSend_125( + return __objc_msgSend_130( obj, sel, locale, @@ -3607,14 +3730,14 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_125Ptr = _lookup< + late final __objc_msgSend_130Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_125 = __objc_msgSend_125Ptr.asFunction< + late final __objc_msgSend_130 = __objc_msgSend_130Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); @@ -3622,13 +3745,13 @@ class StringTestObjCLibrary { _registerName1("firstObjectCommonWithArray:"); late final ffi.Pointer _sel_getObjects_range_1 = _registerName1("getObjects:range:"); - void _objc_msgSend_126( + void _objc_msgSend_131( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer> objects, NSRange range, ) { - return __objc_msgSend_126( + return __objc_msgSend_131( obj, sel, objects, @@ -3636,25 +3759,45 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_126Ptr = _lookup< + late final __objc_msgSend_131Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer>, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_126 = __objc_msgSend_126Ptr.asFunction< + late final __objc_msgSend_131 = __objc_msgSend_131Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer>, NSRange)>(); late final ffi.Pointer _sel_indexOfObject_1 = _registerName1("indexOfObject:"); + int _objc_msgSend_132( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ) { + return __objc_msgSend_132( + obj, + sel, + anObject, + ); + } + + late final __objc_msgSend_132Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_132 = __objc_msgSend_132Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + late final ffi.Pointer _sel_indexOfObject_inRange_1 = _registerName1("indexOfObject:inRange:"); - int _objc_msgSend_127( + int _objc_msgSend_133( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer anObject, NSRange range, ) { - return __objc_msgSend_127( + return __objc_msgSend_133( obj, sel, anObject, @@ -3662,11 +3805,11 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_127Ptr = _lookup< + late final __objc_msgSend_133Ptr = _lookup< ffi.NativeFunction< NSUInteger Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_127 = __objc_msgSend_127Ptr.asFunction< + late final __objc_msgSend_133 = __objc_msgSend_133Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSRange)>(); @@ -3684,13 +3827,13 @@ class StringTestObjCLibrary { _registerName1("sortedArrayHint"); late final ffi.Pointer _sel_writeToURL_error_1 = _registerName1("writeToURL:error:"); - bool _objc_msgSend_128( + bool _objc_msgSend_134( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer url, ffi.Pointer> error, ) { - return __objc_msgSend_128( + return __objc_msgSend_134( obj, sel, url, @@ -3699,14 +3842,14 @@ class StringTestObjCLibrary { 0; } - late final __objc_msgSend_128Ptr = _lookup< + late final __objc_msgSend_134Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_128 = __objc_msgSend_128Ptr.asFunction< + late final __objc_msgSend_134 = __objc_msgSend_134Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer>)>(); @@ -3714,13 +3857,13 @@ class StringTestObjCLibrary { _registerName1("makeObjectsPerformSelector:"); late final ffi.Pointer _sel_makeObjectsPerformSelector_withObject_1 = _registerName1("makeObjectsPerformSelector:withObject:"); - void _objc_msgSend_129( + void _objc_msgSend_135( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer aSelector, ffi.Pointer argument, ) { - return __objc_msgSend_129( + return __objc_msgSend_135( obj, sel, aSelector, @@ -3728,11 +3871,11 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_129Ptr = _lookup< + late final __objc_msgSend_135Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_129 = __objc_msgSend_129Ptr.asFunction< + late final __objc_msgSend_135 = __objc_msgSend_135Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -3740,20 +3883,62 @@ class StringTestObjCLibrary { _registerName1("objectAtIndexedSubscript:"); late final ffi.Pointer _sel_enumerateObjectsUsingBlock_1 = _registerName1("enumerateObjectsUsingBlock:"); + void _objc_msgSend_136( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_136( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_136Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_136 = __objc_msgSend_136Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_enumerateObjectsWithOptions_usingBlock_1 = _registerName1("enumerateObjectsWithOptions:usingBlock:"); + void _objc_msgSend_137( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_137( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_137Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_137 = __objc_msgSend_137Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_enumerateObjectsAtIndexes_options_usingBlock_1 = _registerName1("enumerateObjectsAtIndexes:options:usingBlock:"); - void _objc_msgSend_130( + void _objc_msgSend_138( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer s, int opts, - ffi.Pointer block, + ffi.Pointer<_ObjCBlock> block, ) { - return __objc_msgSend_130( + return __objc_msgSend_138( obj, sel, s, @@ -3762,33 +3947,75 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_130Ptr = _lookup< + late final __objc_msgSend_138Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_130 = __objc_msgSend_130Ptr.asFunction< + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_138 = __objc_msgSend_138Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_indexOfObjectPassingTest_1 = _registerName1("indexOfObjectPassingTest:"); + int _objc_msgSend_139( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_139( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_139Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_139 = __objc_msgSend_139Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_indexOfObjectWithOptions_passingTest_1 = _registerName1("indexOfObjectWithOptions:passingTest:"); + int _objc_msgSend_140( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_140( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_140Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_140 = __objc_msgSend_140Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_indexOfObjectAtIndexes_options_passingTest_1 = _registerName1("indexOfObjectAtIndexes:options:passingTest:"); - int _objc_msgSend_131( + int _objc_msgSend_141( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer s, int opts, - ffi.Pointer predicate, + ffi.Pointer<_ObjCBlock> predicate, ) { - return __objc_msgSend_131( + return __objc_msgSend_141( obj, sel, s, @@ -3797,34 +4024,79 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_131Ptr = _lookup< + late final __objc_msgSend_141Ptr = _lookup< ffi.NativeFunction< NSUInteger Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_131 = __objc_msgSend_131Ptr.asFunction< + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_141 = __objc_msgSend_141Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_indexesOfObjectsPassingTest_1 = _registerName1("indexesOfObjectsPassingTest:"); + ffi.Pointer _objc_msgSend_142( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_142( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_142Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_142 = __objc_msgSend_142Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_indexesOfObjectsWithOptions_passingTest_1 = _registerName1("indexesOfObjectsWithOptions:passingTest:"); + ffi.Pointer _objc_msgSend_143( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_143( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_143Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_143 = __objc_msgSend_143Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_indexesOfObjectsAtIndexes_options_passingTest_1 = _registerName1("indexesOfObjectsAtIndexes:options:passingTest:"); - ffi.Pointer _objc_msgSend_132( + ffi.Pointer _objc_msgSend_144( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer s, int opts, - ffi.Pointer predicate, + ffi.Pointer<_ObjCBlock> predicate, ) { - return __objc_msgSend_132( + return __objc_msgSend_144( obj, sel, s, @@ -3833,26 +4105,26 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_132Ptr = _lookup< + late final __objc_msgSend_144Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_132 = __objc_msgSend_132Ptr.asFunction< + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_144 = __objc_msgSend_144Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); + ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_indexOfObject_inSortedRange_options_usingComparator_1 = _registerName1("indexOfObject:inSortedRange:options:usingComparator:"); - int _objc_msgSend_133( + int _objc_msgSend_145( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer obj1, @@ -3860,7 +4132,7 @@ class StringTestObjCLibrary { int opts, NSComparator cmp, ) { - return __objc_msgSend_133( + return __objc_msgSend_145( obj, sel, obj1, @@ -3870,7 +4142,7 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_133Ptr = _lookup< + late final __objc_msgSend_145Ptr = _lookup< ffi.NativeFunction< NSUInteger Function( ffi.Pointer, @@ -3879,7 +4151,7 @@ class StringTestObjCLibrary { NSRange, ffi.Int32, NSComparator)>>('objc_msgSend'); - late final __objc_msgSend_133 = __objc_msgSend_133Ptr.asFunction< + late final __objc_msgSend_145 = __objc_msgSend_145Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSRange, int, NSComparator)>(); @@ -3898,13 +4170,13 @@ class StringTestObjCLibrary { _registerName1("initWithArray:"); late final ffi.Pointer _sel_initWithArray_copyItems_1 = _registerName1("initWithArray:copyItems:"); - instancetype _objc_msgSend_134( + instancetype _objc_msgSend_146( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer array, bool flag, ) { - return __objc_msgSend_134( + return __objc_msgSend_146( obj, sel, array, @@ -3912,33 +4184,33 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_134Ptr = _lookup< + late final __objc_msgSend_146Ptr = _lookup< ffi.NativeFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_134 = __objc_msgSend_134Ptr.asFunction< + late final __objc_msgSend_146 = __objc_msgSend_146Ptr.asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); late final ffi.Pointer _sel_getObjects_1 = _registerName1("getObjects:"); - void _objc_msgSend_135( + void _objc_msgSend_147( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer> objects, ) { - return __objc_msgSend_135( + return __objc_msgSend_147( obj, sel, objects, ); } - late final __objc_msgSend_135Ptr = _lookup< + late final __objc_msgSend_147Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_135 = __objc_msgSend_135Ptr.asFunction< + late final __objc_msgSend_147 = __objc_msgSend_147Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer>)>(); @@ -3948,13 +4220,13 @@ class StringTestObjCLibrary { _registerName1("addObject:"); late final ffi.Pointer _sel_insertObject_atIndex_1 = _registerName1("insertObject:atIndex:"); - void _objc_msgSend_136( + void _objc_msgSend_148( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer anObject, int index, ) { - return __objc_msgSend_136( + return __objc_msgSend_148( obj, sel, anObject, @@ -3962,11 +4234,11 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_136Ptr = _lookup< + late final __objc_msgSend_148Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_136 = __objc_msgSend_136Ptr.asFunction< + late final __objc_msgSend_148 = __objc_msgSend_148Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); @@ -3976,13 +4248,13 @@ class StringTestObjCLibrary { _registerName1("removeObjectAtIndex:"); late final ffi.Pointer _sel_replaceObjectAtIndex_withObject_1 = _registerName1("replaceObjectAtIndex:withObject:"); - void _objc_msgSend_137( + void _objc_msgSend_149( ffi.Pointer obj, ffi.Pointer sel, int index, ffi.Pointer anObject, ) { - return __objc_msgSend_137( + return __objc_msgSend_149( obj, sel, index, @@ -3990,11 +4262,11 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_137Ptr = _lookup< + late final __objc_msgSend_149Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSUInteger, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_137 = __objc_msgSend_137Ptr.asFunction< + late final __objc_msgSend_149 = __objc_msgSend_149Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); @@ -4005,13 +4277,13 @@ class StringTestObjCLibrary { late final ffi.Pointer _sel_exchangeObjectAtIndex_withObjectAtIndex_1 = _registerName1("exchangeObjectAtIndex:withObjectAtIndex:"); - void _objc_msgSend_138( + void _objc_msgSend_150( ffi.Pointer obj, ffi.Pointer sel, int idx1, int idx2, ) { - return __objc_msgSend_138( + return __objc_msgSend_150( obj, sel, idx1, @@ -4019,24 +4291,24 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_138Ptr = _lookup< + late final __objc_msgSend_150Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSUInteger, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_138 = __objc_msgSend_138Ptr.asFunction< + late final __objc_msgSend_150 = __objc_msgSend_150Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, int, int)>(); late final ffi.Pointer _sel_removeAllObjects1 = _registerName1("removeAllObjects"); late final ffi.Pointer _sel_removeObject_inRange_1 = _registerName1("removeObject:inRange:"); - void _objc_msgSend_139( + void _objc_msgSend_151( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer anObject, NSRange range, ) { - return __objc_msgSend_139( + return __objc_msgSend_151( obj, sel, anObject, @@ -4044,11 +4316,11 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_139Ptr = _lookup< + late final __objc_msgSend_151Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_139 = __objc_msgSend_139Ptr.asFunction< + late final __objc_msgSend_151 = __objc_msgSend_151Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSRange)>(); @@ -4060,13 +4332,13 @@ class StringTestObjCLibrary { _registerName1("removeObjectIdenticalTo:"); late final ffi.Pointer _sel_removeObjectsFromIndices_numIndices_1 = _registerName1("removeObjectsFromIndices:numIndices:"); - void _objc_msgSend_140( + void _objc_msgSend_152( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer indices, int cnt, ) { - return __objc_msgSend_140( + return __objc_msgSend_152( obj, sel, indices, @@ -4074,11 +4346,11 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_140Ptr = _lookup< + late final __objc_msgSend_152Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_140 = __objc_msgSend_140Ptr.asFunction< + late final __objc_msgSend_152 = __objc_msgSend_152Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); @@ -4089,14 +4361,14 @@ class StringTestObjCLibrary { late final ffi.Pointer _sel_replaceObjectsInRange_withObjectsFromArray_range_1 = _registerName1("replaceObjectsInRange:withObjectsFromArray:range:"); - void _objc_msgSend_141( + void _objc_msgSend_153( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ffi.Pointer otherArray, NSRange otherRange, ) { - return __objc_msgSend_141( + return __objc_msgSend_153( obj, sel, range, @@ -4105,24 +4377,24 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_141Ptr = _lookup< + late final __objc_msgSend_153Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSRange, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_141 = __objc_msgSend_141Ptr.asFunction< + late final __objc_msgSend_153 = __objc_msgSend_153Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, NSRange, ffi.Pointer, NSRange)>(); late final ffi.Pointer _sel_replaceObjectsInRange_withObjectsFromArray_1 = _registerName1("replaceObjectsInRange:withObjectsFromArray:"); - void _objc_msgSend_142( + void _objc_msgSend_154( ffi.Pointer obj, ffi.Pointer sel, NSRange range, ffi.Pointer otherArray, ) { - return __objc_msgSend_142( + return __objc_msgSend_154( obj, sel, range, @@ -4130,18 +4402,18 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_142Ptr = _lookup< + late final __objc_msgSend_154Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, NSRange, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_142 = __objc_msgSend_142Ptr.asFunction< + late final __objc_msgSend_154 = __objc_msgSend_154Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, NSRange, ffi.Pointer)>(); late final ffi.Pointer _sel_setArray_1 = _registerName1("setArray:"); late final ffi.Pointer _sel_sortUsingFunction_context_1 = _registerName1("sortUsingFunction:context:"); - void _objc_msgSend_143( + void _objc_msgSend_155( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer< @@ -4151,7 +4423,7 @@ class StringTestObjCLibrary { compare, ffi.Pointer context, ) { - return __objc_msgSend_143( + return __objc_msgSend_155( obj, sel, compare, @@ -4159,7 +4431,7 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_143Ptr = _lookup< + late final __objc_msgSend_155Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -4169,7 +4441,7 @@ class StringTestObjCLibrary { NSInteger Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_143 = __objc_msgSend_143Ptr.asFunction< + late final __objc_msgSend_155 = __objc_msgSend_155Ptr.asFunction< void Function( ffi.Pointer, ffi.Pointer, @@ -4183,13 +4455,13 @@ class StringTestObjCLibrary { _registerName1("sortUsingSelector:"); late final ffi.Pointer _sel_insertObjects_atIndexes_1 = _registerName1("insertObjects:atIndexes:"); - void _objc_msgSend_144( + void _objc_msgSend_156( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer objects, ffi.Pointer indexes, ) { - return __objc_msgSend_144( + return __objc_msgSend_156( obj, sel, objects, @@ -4197,14 +4469,14 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_144Ptr = _lookup< + late final __objc_msgSend_156Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_144 = __objc_msgSend_144Ptr.asFunction< + late final __objc_msgSend_156 = __objc_msgSend_156Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -4216,15 +4488,35 @@ class StringTestObjCLibrary { _registerName1("setObject:atIndexedSubscript:"); late final ffi.Pointer _sel_sortUsingComparator_1 = _registerName1("sortUsingComparator:"); + void _objc_msgSend_157( + ffi.Pointer obj, + ffi.Pointer sel, + NSComparator cmptr, + ) { + return __objc_msgSend_157( + obj, + sel, + cmptr, + ); + } + + late final __objc_msgSend_157Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSComparator)>>('objc_msgSend'); + late final __objc_msgSend_157 = __objc_msgSend_157Ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, NSComparator)>(); + late final ffi.Pointer _sel_sortWithOptions_usingComparator_1 = _registerName1("sortWithOptions:usingComparator:"); - void _objc_msgSend_145( + void _objc_msgSend_158( ffi.Pointer obj, ffi.Pointer sel, int opts, NSComparator cmptr, ) { - return __objc_msgSend_145( + return __objc_msgSend_158( obj, sel, opts, @@ -4232,11 +4524,11 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_145Ptr = _lookup< + late final __objc_msgSend_158Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Int32, NSComparator)>>('objc_msgSend'); - late final __objc_msgSend_145 = __objc_msgSend_145Ptr.asFunction< + late final __objc_msgSend_158 = __objc_msgSend_158Ptr.asFunction< void Function( ffi.Pointer, ffi.Pointer, int, NSComparator)>(); @@ -4250,14 +4542,14 @@ class StringTestObjCLibrary { _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1 = _registerName1( "registerDataRepresentationForTypeIdentifier:visibility:loadHandler:"); - void _objc_msgSend_146( + void _objc_msgSend_159( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, int visibility, - ffi.Pointer loadHandler, + ffi.Pointer<_ObjCBlock> loadHandler, ) { - return __objc_msgSend_146( + return __objc_msgSend_159( obj, sel, typeIdentifier, @@ -4266,31 +4558,31 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_146Ptr = _lookup< + late final __objc_msgSend_159Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_146 = __objc_msgSend_146Ptr.asFunction< + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_159 = __objc_msgSend_159Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1 = _registerName1( "registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:"); - void _objc_msgSend_147( + void _objc_msgSend_160( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, int fileOptions, int visibility, - ffi.Pointer loadHandler, + ffi.Pointer<_ObjCBlock> loadHandler, ) { - return __objc_msgSend_147( + return __objc_msgSend_160( obj, sel, typeIdentifier, @@ -4300,7 +4592,7 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_147Ptr = _lookup< + late final __objc_msgSend_160Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -4308,10 +4600,10 @@ class StringTestObjCLibrary { ffi.Pointer, ffi.Int32, ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_147 = __objc_msgSend_147Ptr.asFunction< + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_160 = __objc_msgSend_160Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, ffi.Pointer)>(); + ffi.Pointer, int, int, ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_registeredTypeIdentifiers1 = _registerName1("registeredTypeIdentifiers"); @@ -4321,13 +4613,13 @@ class StringTestObjCLibrary { _sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1 = _registerName1( "hasRepresentationConformingToTypeIdentifier:fileOptions:"); - bool _objc_msgSend_148( + bool _objc_msgSend_161( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, int fileOptions, ) { - return __objc_msgSend_148( + return __objc_msgSend_161( obj, sel, typeIdentifier, @@ -4336,11 +4628,11 @@ class StringTestObjCLibrary { 0; } - late final __objc_msgSend_148Ptr = _lookup< + late final __objc_msgSend_161Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_148 = __objc_msgSend_148Ptr.asFunction< + late final __objc_msgSend_161 = __objc_msgSend_161Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); @@ -4350,13 +4642,13 @@ class StringTestObjCLibrary { _sel_loadDataRepresentationForTypeIdentifier_completionHandler_1 = _registerName1( "loadDataRepresentationForTypeIdentifier:completionHandler:"); - ffi.Pointer _objc_msgSend_149( + ffi.Pointer _objc_msgSend_162( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, - ffi.Pointer completionHandler, + ffi.Pointer<_ObjCBlock> completionHandler, ) { - return __objc_msgSend_149( + return __objc_msgSend_162( obj, sel, typeIdentifier, @@ -4364,19 +4656,19 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_149Ptr = _lookup< + late final __objc_msgSend_162Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_149 = __objc_msgSend_149Ptr.asFunction< + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_162 = __objc_msgSend_162Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer<_ObjCBlock>)>(); late final ffi.Pointer _sel_loadFileRepresentationForTypeIdentifier_completionHandler_1 = @@ -4386,6 +4678,34 @@ class StringTestObjCLibrary { _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1 = _registerName1( "loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:"); + ffi.Pointer _objc_msgSend_163( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_163( + obj, + sel, + typeIdentifier, + completionHandler, + ); + } + + late final __objc_msgSend_163Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_163 = __objc_msgSend_163Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + late final ffi.Pointer _sel_suggestedName1 = _registerName1("suggestedName"); late final ffi.Pointer _sel_setSuggestedName_1 = @@ -4394,13 +4714,13 @@ class StringTestObjCLibrary { _registerName1("initWithObject:"); late final ffi.Pointer _sel_registerObject_visibility_1 = _registerName1("registerObject:visibility:"); - void _objc_msgSend_150( + void _objc_msgSend_164( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer object, int visibility, ) { - return __objc_msgSend_150( + return __objc_msgSend_164( obj, sel, object, @@ -4408,11 +4728,11 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_150Ptr = _lookup< + late final __objc_msgSend_164Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_150 = __objc_msgSend_150Ptr.asFunction< + late final __objc_msgSend_164 = __objc_msgSend_164Ptr.asFunction< void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); @@ -4428,17 +4748,42 @@ class StringTestObjCLibrary { late final ffi.Pointer _sel_registerItemForTypeIdentifier_loadHandler_1 = _registerName1("registerItemForTypeIdentifier:loadHandler:"); + void _objc_msgSend_165( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + NSItemProviderLoadHandler loadHandler, + ) { + return __objc_msgSend_165( + obj, + sel, + typeIdentifier, + loadHandler, + ); + } + + late final __objc_msgSend_165Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderLoadHandler)>>('objc_msgSend'); + late final __objc_msgSend_165 = __objc_msgSend_165Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSItemProviderLoadHandler)>(); + late final ffi.Pointer _sel_loadItemForTypeIdentifier_options_completionHandler_1 = _registerName1("loadItemForTypeIdentifier:options:completionHandler:"); - void _objc_msgSend_151( + void _objc_msgSend_166( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer typeIdentifier, ffi.Pointer options, NSItemProviderCompletionHandler completionHandler, ) { - return __objc_msgSend_151( + return __objc_msgSend_166( obj, sel, typeIdentifier, @@ -4447,7 +4792,7 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_151Ptr = _lookup< + late final __objc_msgSend_166Ptr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, @@ -4455,7 +4800,7 @@ class StringTestObjCLibrary { ffi.Pointer, ffi.Pointer, NSItemProviderCompletionHandler)>>('objc_msgSend'); - late final __objc_msgSend_151 = __objc_msgSend_151Ptr.asFunction< + late final __objc_msgSend_166 = __objc_msgSend_166Ptr.asFunction< void Function( ffi.Pointer, ffi.Pointer, @@ -4465,11 +4810,74 @@ class StringTestObjCLibrary { late final ffi.Pointer _sel_previewImageHandler1 = _registerName1("previewImageHandler"); + NSItemProviderLoadHandler _objc_msgSend_167( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_167( + obj, + sel, + ); + } + + late final __objc_msgSend_167Ptr = _lookup< + ffi.NativeFunction< + NSItemProviderLoadHandler Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_167 = __objc_msgSend_167Ptr.asFunction< + NSItemProviderLoadHandler Function( + ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _sel_setPreviewImageHandler_1 = _registerName1("setPreviewImageHandler:"); + void _objc_msgSend_168( + ffi.Pointer obj, + ffi.Pointer sel, + NSItemProviderLoadHandler value, + ) { + return __objc_msgSend_168( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_168Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSItemProviderLoadHandler)>>('objc_msgSend'); + late final __objc_msgSend_168 = __objc_msgSend_168Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + NSItemProviderLoadHandler)>(); + late final ffi.Pointer _sel_loadPreviewImageWithOptions_completionHandler_1 = _registerName1("loadPreviewImageWithOptions:completionHandler:"); + void _objc_msgSend_169( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer options, + NSItemProviderCompletionHandler completionHandler, + ) { + return __objc_msgSend_169( + obj, + sel, + options, + completionHandler, + ); + } + + late final __objc_msgSend_169Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler)>>('objc_msgSend'); + late final __objc_msgSend_169 = __objc_msgSend_169Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSItemProviderCompletionHandler)>(); + late final ffi.Pointer> _NSItemProviderPreferredImageSizeKey = _lookup>('NSItemProviderPreferredImageSizeKey'); @@ -4767,7 +5175,7 @@ class StringTestObjCLibrary { late final ffi.Pointer _sel_replaceOccurrencesOfString_withString_options_range_1 = _registerName1("replaceOccurrencesOfString:withString:options:range:"); - int _objc_msgSend_152( + int _objc_msgSend_170( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer target, @@ -4775,7 +5183,7 @@ class StringTestObjCLibrary { int options, NSRange searchRange, ) { - return __objc_msgSend_152( + return __objc_msgSend_170( obj, sel, target, @@ -4785,7 +5193,7 @@ class StringTestObjCLibrary { ); } - late final __objc_msgSend_152Ptr = _lookup< + late final __objc_msgSend_170Ptr = _lookup< ffi.NativeFunction< NSUInteger Function( ffi.Pointer, @@ -4794,14 +5202,14 @@ class StringTestObjCLibrary { ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_152 = __objc_msgSend_152Ptr.asFunction< + late final __objc_msgSend_170 = __objc_msgSend_170Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, int, NSRange)>(); late final ffi.Pointer _sel_applyTransform_reverse_range_updatedRange_1 = _registerName1("applyTransform:reverse:range:updatedRange:"); - bool _objc_msgSend_153( + bool _objc_msgSend_171( ffi.Pointer obj, ffi.Pointer sel, NSStringTransform transform, @@ -4809,7 +5217,7 @@ class StringTestObjCLibrary { NSRange range, NSRangePointer resultingRange, ) { - return __objc_msgSend_153( + return __objc_msgSend_171( obj, sel, transform, @@ -4820,7 +5228,7 @@ class StringTestObjCLibrary { 0; } - late final __objc_msgSend_153Ptr = _lookup< + late final __objc_msgSend_171Ptr = _lookup< ffi.NativeFunction< ffi.Uint8 Function( ffi.Pointer, @@ -4829,27 +5237,27 @@ class StringTestObjCLibrary { ffi.Uint8, NSRange, NSRangePointer)>>('objc_msgSend'); - late final __objc_msgSend_153 = __objc_msgSend_153Ptr.asFunction< + late final __objc_msgSend_171 = __objc_msgSend_171Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, NSStringTransform, int, NSRange, NSRangePointer)>(); - ffi.Pointer _objc_msgSend_154( + ffi.Pointer _objc_msgSend_172( ffi.Pointer obj, ffi.Pointer sel, int capacity, ) { - return __objc_msgSend_154( + return __objc_msgSend_172( obj, sel, capacity, ); } - late final __objc_msgSend_154Ptr = _lookup< + late final __objc_msgSend_172Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_154 = __objc_msgSend_154Ptr.asFunction< + late final __objc_msgSend_172 = __objc_msgSend_172Ptr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int)>(); @@ -5160,12 +5568,12 @@ class NSObject extends _ObjCWrapper { static NSString description(StringTestObjCLibrary _lib) { final _ret = - _lib._objc_msgSend_74(_lib._class_NSObject1, _lib._sel_description1); + _lib._objc_msgSend_75(_lib._class_NSObject1, _lib._sel_description1); return NSString._(_ret, _lib); } static NSString debugDescription(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_74( + final _ret = _lib._objc_msgSend_75( _lib._class_NSObject1, _lib._sel_debugDescription1); return NSString._(_ret, _lib); } @@ -5175,7 +5583,7 @@ class NSObject extends _ObjCWrapper { } static void setVersion(StringTestObjCLibrary _lib, int aVersion) { - _lib._objc_msgSend_75( + _lib._objc_msgSend_76( _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); } @@ -5571,21 +5979,22 @@ class NSString extends NSObject { } void enumerateSubstringsInRange_options_usingBlock( - NSRange range, int opts, NSObject block) { + NSRange range, int opts, ObjCBlock block) { _lib._objc_msgSend_35( _id, _lib._sel_enumerateSubstringsInRange_options_usingBlock_1, range, opts, - block._id); + block._impl); } - void enumerateLinesUsingBlock(NSObject block) { - _lib._objc_msgSend_8(_id, _lib._sel_enumerateLinesUsingBlock_1, block._id); + void enumerateLinesUsingBlock(ObjCBlock1 block) { + _lib._objc_msgSend_36( + _id, _lib._sel_enumerateLinesUsingBlock_1, block._impl); } ffi.Pointer get UTF8String { - return _lib._objc_msgSend_36(_id, _lib._sel_UTF8String1); + return _lib._objc_msgSend_37(_id, _lib._sel_UTF8String1); } int get fastestEncoding { @@ -5597,29 +6006,29 @@ class NSString extends NSObject { } NSData dataUsingEncoding_allowLossyConversion(int encoding, bool lossy) { - final _ret = _lib._objc_msgSend_37(_id, + final _ret = _lib._objc_msgSend_38(_id, _lib._sel_dataUsingEncoding_allowLossyConversion_1, encoding, lossy); return NSData._(_ret, _lib); } NSData dataUsingEncoding(int encoding) { final _ret = - _lib._objc_msgSend_38(_id, _lib._sel_dataUsingEncoding_1, encoding); + _lib._objc_msgSend_39(_id, _lib._sel_dataUsingEncoding_1, encoding); return NSData._(_ret, _lib); } bool canBeConvertedToEncoding(int encoding) { - return _lib._objc_msgSend_39( + return _lib._objc_msgSend_40( _id, _lib._sel_canBeConvertedToEncoding_1, encoding); } void cStringUsingEncoding(int encoding) { - _lib._objc_msgSend_40(_id, _lib._sel_cStringUsingEncoding_1, encoding); + _lib._objc_msgSend_41(_id, _lib._sel_cStringUsingEncoding_1, encoding); } bool getCString_maxLength_encoding( ffi.Pointer buffer, int maxBufferCount, int encoding) { - return _lib._objc_msgSend_41(_id, _lib._sel_getCString_maxLength_encoding_1, + return _lib._objc_msgSend_42(_id, _lib._sel_getCString_maxLength_encoding_1, buffer, maxBufferCount, encoding); } @@ -5631,7 +6040,7 @@ class NSString extends NSObject { int options, NSRange range, NSRangePointer leftover) { - return _lib._objc_msgSend_42( + return _lib._objc_msgSend_43( _id, _lib._sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_1, buffer, @@ -5644,18 +6053,18 @@ class NSString extends NSObject { } int maximumLengthOfBytesUsingEncoding(int enc) { - return _lib._objc_msgSend_43( + return _lib._objc_msgSend_44( _id, _lib._sel_maximumLengthOfBytesUsingEncoding_1, enc); } int lengthOfBytesUsingEncoding(int enc) { - return _lib._objc_msgSend_43( + return _lib._objc_msgSend_44( _id, _lib._sel_lengthOfBytesUsingEncoding_1, enc); } static ffi.Pointer getAvailableStringEncodings( StringTestObjCLibrary _lib) { - return _lib._objc_msgSend_44( + return _lib._objc_msgSend_45( _lib._class_NSString1, _lib._sel_availableStringEncodings1); } @@ -5703,7 +6112,7 @@ class NSString extends NSObject { NSString stringByPaddingToLength_withString_startingAtIndex( int newLength, NSObject? padString, int padIndex) { - final _ret = _lib._objc_msgSend_45( + final _ret = _lib._objc_msgSend_46( _id, _lib._sel_stringByPaddingToLength_withString_startingAtIndex_1, newLength, @@ -5713,7 +6122,7 @@ class NSString extends NSObject { } NSString stringByFoldingWithOptions_locale(int options, NSObject? locale) { - final _ret = _lib._objc_msgSend_46( + final _ret = _lib._objc_msgSend_47( _id, _lib._sel_stringByFoldingWithOptions_locale_1, options, @@ -5726,7 +6135,7 @@ class NSString extends NSObject { NSObject? replacement, int options, NSRange searchRange) { - final _ret = _lib._objc_msgSend_47( + final _ret = _lib._objc_msgSend_48( _id, _lib._sel_stringByReplacingOccurrencesOfString_withString_options_range_1, target?._id ?? ffi.nullptr, @@ -5738,7 +6147,7 @@ class NSString extends NSObject { NSString stringByReplacingOccurrencesOfString_withString( NSObject? target, NSObject? replacement) { - final _ret = _lib._objc_msgSend_48( + final _ret = _lib._objc_msgSend_49( _id, _lib._sel_stringByReplacingOccurrencesOfString_withString_1, target?._id ?? ffi.nullptr, @@ -5748,7 +6157,7 @@ class NSString extends NSObject { NSString stringByReplacingCharactersInRange_withString( NSRange range, NSObject? replacement) { - final _ret = _lib._objc_msgSend_49( + final _ret = _lib._objc_msgSend_50( _id, _lib._sel_stringByReplacingCharactersInRange_withString_1, range, @@ -5758,7 +6167,7 @@ class NSString extends NSObject { NSString stringByApplyingTransform_reverse( NSStringTransform transform, bool reverse) { - final _ret = _lib._objc_msgSend_50( + final _ret = _lib._objc_msgSend_51( _id, _lib._sel_stringByApplyingTransform_reverse_1, transform, reverse); return NSString._(_ret, _lib); } @@ -5768,7 +6177,7 @@ class NSString extends NSObject { bool useAuxiliaryFile, int enc, ffi.Pointer> error) { - return _lib._objc_msgSend_51( + return _lib._objc_msgSend_52( _id, _lib._sel_writeToURL_atomically_encoding_error_1, url?._id ?? ffi.nullptr, @@ -5782,7 +6191,7 @@ class NSString extends NSObject { bool useAuxiliaryFile, int enc, ffi.Pointer> error) { - return _lib._objc_msgSend_51( + return _lib._objc_msgSend_52( _id, _lib._sel_writeToFile_atomically_encoding_error_1, path?._id ?? ffi.nullptr, @@ -5802,7 +6211,7 @@ class NSString extends NSObject { NSString initWithCharactersNoCopy_length_freeWhenDone( ffi.Pointer characters, int length, bool freeBuffer) { - final _ret = _lib._objc_msgSend_52( + final _ret = _lib._objc_msgSend_53( _id, _lib._sel_initWithCharactersNoCopy_length_freeWhenDone_1, characters, @@ -5812,25 +6221,25 @@ class NSString extends NSObject { } NSString initWithCharactersNoCopy_length_deallocator( - ffi.Pointer chars, int len, NSObject deallocator) { - final _ret = _lib._objc_msgSend_53( + ffi.Pointer chars, int len, ObjCBlock2 deallocator) { + final _ret = _lib._objc_msgSend_54( _id, _lib._sel_initWithCharactersNoCopy_length_deallocator_1, chars, len, - deallocator._id); + deallocator._impl); return NSString._(_ret, _lib); } NSString initWithCharacters_length( ffi.Pointer characters, int length) { - final _ret = _lib._objc_msgSend_54( + final _ret = _lib._objc_msgSend_55( _id, _lib._sel_initWithCharacters_length_1, characters, length); return NSString._(_ret, _lib); } NSString initWithUTF8String(ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_55( + final _ret = _lib._objc_msgSend_56( _id, _lib._sel_initWithUTF8String_1, nullTerminatedCString); return NSString._(_ret, _lib); } @@ -5849,7 +6258,7 @@ class NSString extends NSObject { NSString initWithFormat_arguments( NSObject? format, ffi.Pointer<__va_list_tag> argList) { - final _ret = _lib._objc_msgSend_56( + final _ret = _lib._objc_msgSend_57( _id, _lib._sel_initWithFormat_arguments_1, format?._id ?? ffi.nullptr, @@ -5858,14 +6267,14 @@ class NSString extends NSObject { } NSString initWithFormat_locale(NSObject? format, NSObject locale) { - final _ret = _lib._objc_msgSend_57(_id, _lib._sel_initWithFormat_locale_1, + final _ret = _lib._objc_msgSend_58(_id, _lib._sel_initWithFormat_locale_1, format?._id ?? ffi.nullptr, locale._id); return NSString._(_ret, _lib); } NSString initWithFormat_locale_arguments( NSObject? format, NSObject locale, ffi.Pointer<__va_list_tag> argList) { - final _ret = _lib._objc_msgSend_58( + final _ret = _lib._objc_msgSend_59( _id, _lib._sel_initWithFormat_locale_arguments_1, format?._id ?? ffi.nullptr, @@ -5875,21 +6284,21 @@ class NSString extends NSObject { } NSString initWithData_encoding(NSObject? data, int encoding) { - final _ret = _lib._objc_msgSend_59(_id, _lib._sel_initWithData_encoding_1, + final _ret = _lib._objc_msgSend_60(_id, _lib._sel_initWithData_encoding_1, data?._id ?? ffi.nullptr, encoding); return NSString._(_ret, _lib); } NSString initWithBytes_length_encoding( ffi.Pointer bytes, int len, int encoding) { - final _ret = _lib._objc_msgSend_60( + final _ret = _lib._objc_msgSend_61( _id, _lib._sel_initWithBytes_length_encoding_1, bytes, len, encoding); return NSString._(_ret, _lib); } NSString initWithBytesNoCopy_length_encoding_freeWhenDone( ffi.Pointer bytes, int len, int encoding, bool freeBuffer) { - final _ret = _lib._objc_msgSend_61( + final _ret = _lib._objc_msgSend_62( _id, _lib._sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1, bytes, @@ -5903,14 +6312,14 @@ class NSString extends NSObject { ffi.Pointer bytes, int len, int encoding, - NSObject deallocator) { - final _ret = _lib._objc_msgSend_62( + ObjCBlock3 deallocator) { + final _ret = _lib._objc_msgSend_63( _id, _lib._sel_initWithBytesNoCopy_length_encoding_deallocator_1, bytes, len, encoding, - deallocator._id); + deallocator._impl); return NSString._(_ret, _lib); } @@ -5928,14 +6337,14 @@ class NSString extends NSObject { static NSString stringWithCharacters_length( StringTestObjCLibrary _lib, ffi.Pointer characters, int length) { - final _ret = _lib._objc_msgSend_54(_lib._class_NSString1, + final _ret = _lib._objc_msgSend_55(_lib._class_NSString1, _lib._sel_stringWithCharacters_length_1, characters, length); return NSString._(_ret, _lib); } static NSString stringWithUTF8String(StringTestObjCLibrary _lib, ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_55(_lib._class_NSString1, + final _ret = _lib._objc_msgSend_56(_lib._class_NSString1, _lib._sel_stringWithUTF8String_1, nullTerminatedCString); return NSString._(_ret, _lib); } @@ -5956,21 +6365,21 @@ class NSString extends NSObject { NSString initWithCString_encoding( ffi.Pointer nullTerminatedCString, int encoding) { - final _ret = _lib._objc_msgSend_63(_id, + final _ret = _lib._objc_msgSend_64(_id, _lib._sel_initWithCString_encoding_1, nullTerminatedCString, encoding); return NSString._(_ret, _lib); } static NSString stringWithCString_encoding( StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_63(_lib._class_NSString1, + final _ret = _lib._objc_msgSend_64(_lib._class_NSString1, _lib._sel_stringWithCString_encoding_1, cString, enc); return NSString._(_ret, _lib); } NSString initWithContentsOfURL_encoding_error( NSObject? url, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_64( + final _ret = _lib._objc_msgSend_65( _id, _lib._sel_initWithContentsOfURL_encoding_error_1, url?._id ?? ffi.nullptr, @@ -5981,7 +6390,7 @@ class NSString extends NSObject { NSString initWithContentsOfFile_encoding_error( NSObject? path, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_64( + final _ret = _lib._objc_msgSend_65( _id, _lib._sel_initWithContentsOfFile_encoding_error_1, path?._id ?? ffi.nullptr, @@ -5995,7 +6404,7 @@ class NSString extends NSObject { NSObject? url, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_64( + final _ret = _lib._objc_msgSend_65( _lib._class_NSString1, _lib._sel_stringWithContentsOfURL_encoding_error_1, url?._id ?? ffi.nullptr, @@ -6009,7 +6418,7 @@ class NSString extends NSObject { NSObject? path, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_64( + final _ret = _lib._objc_msgSend_65( _lib._class_NSString1, _lib._sel_stringWithContentsOfFile_encoding_error_1, path?._id ?? ffi.nullptr, @@ -6022,7 +6431,7 @@ class NSString extends NSObject { NSObject? url, ffi.Pointer enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( + final _ret = _lib._objc_msgSend_66( _id, _lib._sel_initWithContentsOfURL_usedEncoding_error_1, url?._id ?? ffi.nullptr, @@ -6035,7 +6444,7 @@ class NSString extends NSObject { NSObject? path, ffi.Pointer enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( + final _ret = _lib._objc_msgSend_66( _id, _lib._sel_initWithContentsOfFile_usedEncoding_error_1, path?._id ?? ffi.nullptr, @@ -6049,7 +6458,7 @@ class NSString extends NSObject { NSObject? url, ffi.Pointer enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( + final _ret = _lib._objc_msgSend_66( _lib._class_NSString1, _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, url?._id ?? ffi.nullptr, @@ -6063,7 +6472,7 @@ class NSString extends NSObject { NSObject? path, ffi.Pointer enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( + final _ret = _lib._objc_msgSend_66( _lib._class_NSString1, _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, path?._id ?? ffi.nullptr, @@ -6079,7 +6488,7 @@ class NSString extends NSObject { NSObject? opts, ffi.Pointer> string, ffi.Pointer usedLossyConversion) { - return _lib._objc_msgSend_66( + return _lib._objc_msgSend_67( _lib._class_NSString1, _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, data?._id ?? ffi.nullptr, @@ -6094,7 +6503,7 @@ class NSString extends NSObject { } NSDictionary propertyListFromStringsFileFormat() { - final _ret = _lib._objc_msgSend_67( + final _ret = _lib._objc_msgSend_68( _id, _lib._sel_propertyListFromStringsFileFormat1); return NSDictionary._(_ret, _lib); } @@ -6112,11 +6521,11 @@ class NSString extends NSObject { } void getCString(ffi.Pointer bytes) { - _lib._objc_msgSend_68(_id, _lib._sel_getCString_1, bytes); + _lib._objc_msgSend_69(_id, _lib._sel_getCString_1, bytes); } void getCString_maxLength(ffi.Pointer bytes, int maxLength) { - _lib._objc_msgSend_69( + _lib._objc_msgSend_70( _id, _lib._sel_getCString_maxLength_1, bytes, maxLength); } @@ -6125,7 +6534,7 @@ class NSString extends NSObject { int maxLength, NSRange aRange, NSRangePointer leftoverRange) { - _lib._objc_msgSend_70( + _lib._objc_msgSend_71( _id, _lib._sel_getCString_maxLength_range_remainingRange_1, bytes, @@ -6135,12 +6544,12 @@ class NSString extends NSObject { } bool writeToFile_atomically(NSObject? path, bool useAuxiliaryFile) { - return _lib._objc_msgSend_71(_id, _lib._sel_writeToFile_atomically_1, + return _lib._objc_msgSend_72(_id, _lib._sel_writeToFile_atomically_1, path?._id ?? ffi.nullptr, useAuxiliaryFile); } bool writeToURL_atomically(NSObject? url, bool atomically) { - return _lib._objc_msgSend_71(_id, _lib._sel_writeToURL_atomically_1, + return _lib._objc_msgSend_72(_id, _lib._sel_writeToURL_atomically_1, url?._id ?? ffi.nullptr, atomically); } @@ -6172,7 +6581,7 @@ class NSString extends NSObject { NSObject initWithCStringNoCopy_length_freeWhenDone( ffi.Pointer bytes, int length, bool freeBuffer) { - final _ret = _lib._objc_msgSend_72( + final _ret = _lib._objc_msgSend_73( _id, _lib._sel_initWithCStringNoCopy_length_freeWhenDone_1, bytes, @@ -6182,32 +6591,32 @@ class NSString extends NSObject { } NSObject initWithCString_length(ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_63( + final _ret = _lib._objc_msgSend_64( _id, _lib._sel_initWithCString_length_1, bytes, length); return NSObject._(_ret, _lib); } NSObject initWithCString(ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_initWithCString_1, bytes); + final _ret = _lib._objc_msgSend_56(_id, _lib._sel_initWithCString_1, bytes); return NSObject._(_ret, _lib); } static NSObject stringWithCString_length( StringTestObjCLibrary _lib, ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_63(_lib._class_NSString1, + final _ret = _lib._objc_msgSend_64(_lib._class_NSString1, _lib._sel_stringWithCString_length_1, bytes, length); return NSObject._(_ret, _lib); } static NSObject stringWithCString( StringTestObjCLibrary _lib, ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_55( + final _ret = _lib._objc_msgSend_56( _lib._class_NSString1, _lib._sel_stringWithCString_1, bytes); return NSObject._(_ret, _lib); } void getCharacters(ffi.Pointer buffer) { - _lib._objc_msgSend_73(_id, _lib._sel_getCharacters_1, buffer); + _lib._objc_msgSend_74(_id, _lib._sel_getCharacters_1, buffer); } static NSString new1(StringTestObjCLibrary _lib) { @@ -6261,6 +6670,118 @@ abstract class NSStringEnumerationOptions { static const int NSStringEnumerationLocalized = 1024; } +void _ObjCBlock_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSRange arg1, + NSRange arg2, ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3)>()(arg0, arg1, arg2, arg3); +} + +class ObjCBlock { + final ffi.Pointer<_ObjCBlock> _impl; + final StringTestObjCLibrary _lib; + ObjCBlock._(this._impl, this._lib); + + ObjCBlock.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSRange arg1, + NSRange arg2, ffi.Pointer arg3)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3)>( + _ObjCBlock_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class _ObjCBlockDesc extends ffi.Struct { + @pkg_ffi.UnsignedLong() + external int reserved; + + @pkg_ffi.UnsignedLong() + external int size; + + external ffi.Pointer copy_helper; + + external ffi.Pointer dispose_helper; + + external ffi.Pointer signature; +} + +class _ObjCBlock extends ffi.Struct { + external ffi.Pointer isa; + + @pkg_ffi.Int() + external int flags; + + @pkg_ffi.Int() + external int reserved; + + external ffi.Pointer invoke; + + external ffi.Pointer<_ObjCBlockDesc> descriptor; + + external ffi.Pointer target; +} + +void _ObjCBlock1_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +class ObjCBlock1 { + final ffi.Pointer<_ObjCBlock> _impl; + final StringTestObjCLibrary _lib; + ObjCBlock1._(this._impl, this._lib); + + ObjCBlock1.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : _impl = + _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock1_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + typedef NSStringEncoding = NSUInteger; class NSData extends _ObjCWrapper { @@ -6284,6 +6805,38 @@ abstract class NSStringEncodingConversionOptions { typedef NSRangePointer = ffi.Pointer; typedef NSStringTransform = ffi.Pointer; +void _ObjCBlock2_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSUInteger arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, int arg1)>()(arg0, arg1); +} + +class ObjCBlock2 { + final ffi.Pointer<_ObjCBlock> _impl; + final StringTestObjCLibrary _lib; + ObjCBlock2._(this._impl, this._lib); + + ObjCBlock2.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, NSUInteger arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1)>(_ObjCBlock2_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} class __va_list_tag extends ffi.Struct { @pkg_ffi.UnsignedInt() @@ -6297,6 +6850,39 @@ class __va_list_tag extends ffi.Struct { external ffi.Pointer reg_save_area; } +void _ObjCBlock3_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSUInteger arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, int arg1)>()(arg0, arg1); +} + +class ObjCBlock3 { + final ffi.Pointer<_ObjCBlock> _impl; + final StringTestObjCLibrary _lib; + ObjCBlock3._(this._impl, this._lib); + + ObjCBlock3.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, NSUInteger arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1)>(_ObjCBlock3_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + class NSDictionary extends _ObjCWrapper { NSDictionary._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); @@ -6325,16 +6911,16 @@ class NSValue extends NSObject { } void getValue_size(ffi.Pointer value, int size) { - _lib._objc_msgSend_76(_id, _lib._sel_getValue_size_1, value, size); + _lib._objc_msgSend_77(_id, _lib._sel_getValue_size_1, value, size); } ffi.Pointer get objCType { - return _lib._objc_msgSend_36(_id, _lib._sel_objCType1); + return _lib._objc_msgSend_37(_id, _lib._sel_objCType1); } NSValue initWithBytes_objCType( ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_77( + final _ret = _lib._objc_msgSend_78( _id, _lib._sel_initWithBytes_objCType_1, value, type); return NSValue._(_ret, _lib); } @@ -6347,21 +6933,21 @@ class NSValue extends NSObject { static NSValue valueWithBytes_objCType(StringTestObjCLibrary _lib, ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_78( + final _ret = _lib._objc_msgSend_79( _lib._class_NSValue1, _lib._sel_valueWithBytes_objCType_1, value, type); return NSValue._(_ret, _lib); } static NSValue value_withObjCType(StringTestObjCLibrary _lib, ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_78( + final _ret = _lib._objc_msgSend_79( _lib._class_NSValue1, _lib._sel_value_withObjCType_1, value, type); return NSValue._(_ret, _lib); } static NSValue valueWithNonretainedObject( StringTestObjCLibrary _lib, NSObject anObject) { - final _ret = _lib._objc_msgSend_79(_lib._class_NSValue1, + final _ret = _lib._objc_msgSend_80(_lib._class_NSValue1, _lib._sel_valueWithNonretainedObject_1, anObject._id); return NSValue._(_ret, _lib); } @@ -6373,13 +6959,13 @@ class NSValue extends NSObject { static NSValue valueWithPointer( StringTestObjCLibrary _lib, ffi.Pointer pointer) { - final _ret = _lib._objc_msgSend_80( + final _ret = _lib._objc_msgSend_81( _lib._class_NSValue1, _lib._sel_valueWithPointer_1, pointer); return NSValue._(_ret, _lib); } ffi.Pointer get pointerValue { - return _lib._objc_msgSend_81(_id, _lib._sel_pointerValue1); + return _lib._objc_msgSend_82(_id, _lib._sel_pointerValue1); } bool isEqualToValue(NSObject? value) { @@ -6388,17 +6974,17 @@ class NSValue extends NSObject { } void getValue(ffi.Pointer value) { - _lib._objc_msgSend_82(_id, _lib._sel_getValue_1, value); + _lib._objc_msgSend_83(_id, _lib._sel_getValue_1, value); } static NSValue valueWithRange(StringTestObjCLibrary _lib, NSRange range) { - final _ret = _lib._objc_msgSend_83( + final _ret = _lib._objc_msgSend_84( _lib._class_NSValue1, _lib._sel_valueWithRange_1, range); return NSValue._(_ret, _lib); } NSRange get rangeValue { - return _lib._objc_msgSend_84(_id, _lib._sel_rangeValue1); + return _lib._objc_msgSend_85(_id, _lib._sel_rangeValue1); } static NSValue new1(StringTestObjCLibrary _lib) { @@ -6433,101 +7019,101 @@ class NSNumber extends NSValue { } NSNumber initWithChar(int value) { - final _ret = _lib._objc_msgSend_85(_id, _lib._sel_initWithChar_1, value); + final _ret = _lib._objc_msgSend_86(_id, _lib._sel_initWithChar_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithUnsignedChar(int value) { final _ret = - _lib._objc_msgSend_86(_id, _lib._sel_initWithUnsignedChar_1, value); + _lib._objc_msgSend_87(_id, _lib._sel_initWithUnsignedChar_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithShort(int value) { - final _ret = _lib._objc_msgSend_87(_id, _lib._sel_initWithShort_1, value); + final _ret = _lib._objc_msgSend_88(_id, _lib._sel_initWithShort_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithUnsignedShort(int value) { final _ret = - _lib._objc_msgSend_88(_id, _lib._sel_initWithUnsignedShort_1, value); + _lib._objc_msgSend_89(_id, _lib._sel_initWithUnsignedShort_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithInt(int value) { - final _ret = _lib._objc_msgSend_89(_id, _lib._sel_initWithInt_1, value); + final _ret = _lib._objc_msgSend_90(_id, _lib._sel_initWithInt_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithUnsignedInt(int value) { final _ret = - _lib._objc_msgSend_90(_id, _lib._sel_initWithUnsignedInt_1, value); + _lib._objc_msgSend_91(_id, _lib._sel_initWithUnsignedInt_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithLong(int value) { - final _ret = _lib._objc_msgSend_91(_id, _lib._sel_initWithLong_1, value); + final _ret = _lib._objc_msgSend_92(_id, _lib._sel_initWithLong_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithUnsignedLong(int value) { final _ret = - _lib._objc_msgSend_92(_id, _lib._sel_initWithUnsignedLong_1, value); + _lib._objc_msgSend_93(_id, _lib._sel_initWithUnsignedLong_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithLongLong(int value) { final _ret = - _lib._objc_msgSend_93(_id, _lib._sel_initWithLongLong_1, value); + _lib._objc_msgSend_94(_id, _lib._sel_initWithLongLong_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithUnsignedLongLong(int value) { final _ret = - _lib._objc_msgSend_94(_id, _lib._sel_initWithUnsignedLongLong_1, value); + _lib._objc_msgSend_95(_id, _lib._sel_initWithUnsignedLongLong_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithFloat(double value) { - final _ret = _lib._objc_msgSend_95(_id, _lib._sel_initWithFloat_1, value); + final _ret = _lib._objc_msgSend_96(_id, _lib._sel_initWithFloat_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithDouble(double value) { - final _ret = _lib._objc_msgSend_96(_id, _lib._sel_initWithDouble_1, value); + final _ret = _lib._objc_msgSend_97(_id, _lib._sel_initWithDouble_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithBool(bool value) { - final _ret = _lib._objc_msgSend_97(_id, _lib._sel_initWithBool_1, value); + final _ret = _lib._objc_msgSend_98(_id, _lib._sel_initWithBool_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithInteger(int value) { - final _ret = _lib._objc_msgSend_91(_id, _lib._sel_initWithInteger_1, value); + final _ret = _lib._objc_msgSend_92(_id, _lib._sel_initWithInteger_1, value); return NSNumber._(_ret, _lib); } NSNumber initWithUnsignedInteger(int value) { final _ret = - _lib._objc_msgSend_92(_id, _lib._sel_initWithUnsignedInteger_1, value); + _lib._objc_msgSend_93(_id, _lib._sel_initWithUnsignedInteger_1, value); return NSNumber._(_ret, _lib); } int get charValue { - return _lib._objc_msgSend_98(_id, _lib._sel_charValue1); + return _lib._objc_msgSend_99(_id, _lib._sel_charValue1); } int get unsignedCharValue { - return _lib._objc_msgSend_99(_id, _lib._sel_unsignedCharValue1); + return _lib._objc_msgSend_100(_id, _lib._sel_unsignedCharValue1); } int get shortValue { - return _lib._objc_msgSend_100(_id, _lib._sel_shortValue1); + return _lib._objc_msgSend_101(_id, _lib._sel_shortValue1); } int get unsignedShortValue { - return _lib._objc_msgSend_101(_id, _lib._sel_unsignedShortValue1); + return _lib._objc_msgSend_102(_id, _lib._sel_unsignedShortValue1); } int get intValue { @@ -6535,7 +7121,7 @@ class NSNumber extends NSValue { } int get unsignedIntValue { - return _lib._objc_msgSend_102(_id, _lib._sel_unsignedIntValue1); + return _lib._objc_msgSend_103(_id, _lib._sel_unsignedIntValue1); } int get longValue { @@ -6551,7 +7137,7 @@ class NSNumber extends NSValue { } int get unsignedLongLongValue { - return _lib._objc_msgSend_103(_id, _lib._sel_unsignedLongLongValue1); + return _lib._objc_msgSend_104(_id, _lib._sel_unsignedLongLongValue1); } double get floatValue { @@ -6596,130 +7182,130 @@ class NSNumber extends NSValue { } static NSNumber numberWithChar(StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_85( + final _ret = _lib._objc_msgSend_86( _lib._class_NSNumber1, _lib._sel_numberWithChar_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithUnsignedChar( StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_86( + final _ret = _lib._objc_msgSend_87( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedChar_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithShort(StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_87( + final _ret = _lib._objc_msgSend_88( _lib._class_NSNumber1, _lib._sel_numberWithShort_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithUnsignedShort( StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_88( + final _ret = _lib._objc_msgSend_89( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedShort_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithInt(StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_89( + final _ret = _lib._objc_msgSend_90( _lib._class_NSNumber1, _lib._sel_numberWithInt_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithUnsignedInt(StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_90( + final _ret = _lib._objc_msgSend_91( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInt_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithLong(StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_91( + final _ret = _lib._objc_msgSend_92( _lib._class_NSNumber1, _lib._sel_numberWithLong_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithUnsignedLong( StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_92( + final _ret = _lib._objc_msgSend_93( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLong_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithLongLong(StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_93( + final _ret = _lib._objc_msgSend_94( _lib._class_NSNumber1, _lib._sel_numberWithLongLong_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithUnsignedLongLong( StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_94( + final _ret = _lib._objc_msgSend_95( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLongLong_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithFloat(StringTestObjCLibrary _lib, double value) { - final _ret = _lib._objc_msgSend_95( + final _ret = _lib._objc_msgSend_96( _lib._class_NSNumber1, _lib._sel_numberWithFloat_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithDouble(StringTestObjCLibrary _lib, double value) { - final _ret = _lib._objc_msgSend_96( + final _ret = _lib._objc_msgSend_97( _lib._class_NSNumber1, _lib._sel_numberWithDouble_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithBool(StringTestObjCLibrary _lib, bool value) { - final _ret = _lib._objc_msgSend_97( + final _ret = _lib._objc_msgSend_98( _lib._class_NSNumber1, _lib._sel_numberWithBool_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithInteger(StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_91( + final _ret = _lib._objc_msgSend_92( _lib._class_NSNumber1, _lib._sel_numberWithInteger_1, value); return NSNumber._(_ret, _lib); } static NSNumber numberWithUnsignedInteger( StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_92( + final _ret = _lib._objc_msgSend_93( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInteger_1, value); return NSNumber._(_ret, _lib); } static NSValue valueWithBytes_objCType(StringTestObjCLibrary _lib, ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_78(_lib._class_NSNumber1, + final _ret = _lib._objc_msgSend_79(_lib._class_NSNumber1, _lib._sel_valueWithBytes_objCType_1, value, type); return NSValue._(_ret, _lib); } static NSValue value_withObjCType(StringTestObjCLibrary _lib, ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_78( + final _ret = _lib._objc_msgSend_79( _lib._class_NSNumber1, _lib._sel_value_withObjCType_1, value, type); return NSValue._(_ret, _lib); } static NSValue valueWithNonretainedObject( StringTestObjCLibrary _lib, NSObject anObject) { - final _ret = _lib._objc_msgSend_79(_lib._class_NSNumber1, + final _ret = _lib._objc_msgSend_80(_lib._class_NSNumber1, _lib._sel_valueWithNonretainedObject_1, anObject._id); return NSValue._(_ret, _lib); } static NSValue valueWithPointer( StringTestObjCLibrary _lib, ffi.Pointer pointer) { - final _ret = _lib._objc_msgSend_80( + final _ret = _lib._objc_msgSend_81( _lib._class_NSNumber1, _lib._sel_valueWithPointer_1, pointer); return NSValue._(_ret, _lib); } static NSValue valueWithRange(StringTestObjCLibrary _lib, NSRange range) { - final _ret = _lib._objc_msgSend_83( + final _ret = _lib._objc_msgSend_84( _lib._class_NSNumber1, _lib._sel_valueWithRange_1, range); return NSValue._(_ret, _lib); } @@ -6808,7 +7394,7 @@ class NSOrderedCollectionChange extends NSObject { } int get changeType { - return _lib._objc_msgSend_104(_id, _lib._sel_changeType1); + return _lib._objc_msgSend_105(_id, _lib._sel_changeType1); } int get index { @@ -6827,14 +7413,14 @@ class NSOrderedCollectionChange extends NSObject { NSOrderedCollectionChange initWithObject_type_index( NSObject anObject, int type, int index) { - final _ret = _lib._objc_msgSend_105( + final _ret = _lib._objc_msgSend_106( _id, _lib._sel_initWithObject_type_index_1, anObject._id, type, index); return NSOrderedCollectionChange._(_ret, _lib); } NSOrderedCollectionChange initWithObject_type_index_associatedIndex( NSObject anObject, int type, int index, int associatedIndex) { - final _ret = _lib._objc_msgSend_106( + final _ret = _lib._objc_msgSend_107( _id, _lib._sel_initWithObject_type_index_associatedIndex_1, anObject._id, @@ -6877,21 +7463,21 @@ class NSIndexSet extends NSObject { } static NSIndexSet indexSetWithIndex(StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_107( + final _ret = _lib._objc_msgSend_108( _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndex_1, value); return NSIndexSet._(_ret, _lib); } static NSIndexSet indexSetWithIndexesInRange( StringTestObjCLibrary _lib, NSRange range) { - final _ret = _lib._objc_msgSend_108( + final _ret = _lib._objc_msgSend_109( _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndexesInRange_1, range); return NSIndexSet._(_ret, _lib); } NSIndexSet initWithIndexesInRange(NSRange range) { final _ret = - _lib._objc_msgSend_108(_id, _lib._sel_initWithIndexesInRange_1, range); + _lib._objc_msgSend_109(_id, _lib._sel_initWithIndexesInRange_1, range); return NSIndexSet._(_ret, _lib); } @@ -6902,7 +7488,7 @@ class NSIndexSet extends NSObject { } NSIndexSet initWithIndex(int value) { - final _ret = _lib._objc_msgSend_107(_id, _lib._sel_initWithIndex_1, value); + final _ret = _lib._objc_msgSend_108(_id, _lib._sel_initWithIndex_1, value); return NSIndexSet._(_ret, _lib); } @@ -6924,26 +7510,26 @@ class NSIndexSet extends NSObject { } int indexGreaterThanIndex(int value) { - return _lib._objc_msgSend_43(_id, _lib._sel_indexGreaterThanIndex_1, value); + return _lib._objc_msgSend_44(_id, _lib._sel_indexGreaterThanIndex_1, value); } int indexLessThanIndex(int value) { - return _lib._objc_msgSend_43(_id, _lib._sel_indexLessThanIndex_1, value); + return _lib._objc_msgSend_44(_id, _lib._sel_indexLessThanIndex_1, value); } int indexGreaterThanOrEqualToIndex(int value) { - return _lib._objc_msgSend_43( + return _lib._objc_msgSend_44( _id, _lib._sel_indexGreaterThanOrEqualToIndex_1, value); } int indexLessThanOrEqualToIndex(int value) { - return _lib._objc_msgSend_43( + return _lib._objc_msgSend_44( _id, _lib._sel_indexLessThanOrEqualToIndex_1, value); } int getIndexes_maxCount_inIndexRange(ffi.Pointer indexBuffer, int bufferSize, NSRangePointer range) { - return _lib._objc_msgSend_109( + return _lib._objc_msgSend_110( _id, _lib._sel_getIndexes_maxCount_inIndexRange_1, indexBuffer, @@ -6952,16 +7538,16 @@ class NSIndexSet extends NSObject { } int countOfIndexesInRange(NSRange range) { - return _lib._objc_msgSend_110( + return _lib._objc_msgSend_111( _id, _lib._sel_countOfIndexesInRange_1, range); } bool containsIndex(int value) { - return _lib._objc_msgSend_39(_id, _lib._sel_containsIndex_1, value); + return _lib._objc_msgSend_40(_id, _lib._sel_containsIndex_1, value); } bool containsIndexesInRange(NSRange range) { - return _lib._objc_msgSend_111( + return _lib._objc_msgSend_112( _id, _lib._sel_containsIndexesInRange_1, range); } @@ -6971,90 +7557,91 @@ class NSIndexSet extends NSObject { } bool intersectsIndexesInRange(NSRange range) { - return _lib._objc_msgSend_111( + return _lib._objc_msgSend_112( _id, _lib._sel_intersectsIndexesInRange_1, range); } - void enumerateIndexesUsingBlock(NSObject block) { - _lib._objc_msgSend_8( - _id, _lib._sel_enumerateIndexesUsingBlock_1, block._id); + void enumerateIndexesUsingBlock(ObjCBlock4 block) { + _lib._objc_msgSend_113( + _id, _lib._sel_enumerateIndexesUsingBlock_1, block._impl); } - void enumerateIndexesWithOptions_usingBlock(int opts, NSObject block) { - _lib._objc_msgSend_112(_id, - _lib._sel_enumerateIndexesWithOptions_usingBlock_1, opts, block._id); + void enumerateIndexesWithOptions_usingBlock(int opts, ObjCBlock4 block) { + _lib._objc_msgSend_114(_id, + _lib._sel_enumerateIndexesWithOptions_usingBlock_1, opts, block._impl); } void enumerateIndexesInRange_options_usingBlock( - NSRange range, int opts, NSObject block) { - _lib._objc_msgSend_113( + NSRange range, int opts, ObjCBlock4 block) { + _lib._objc_msgSend_115( _id, _lib._sel_enumerateIndexesInRange_options_usingBlock_1, range, opts, - block._id); + block._impl); } - int indexPassingTest(NSObject predicate) { - return _lib._objc_msgSend_114( - _id, _lib._sel_indexPassingTest_1, predicate._id); + int indexPassingTest(ObjCBlock5 predicate) { + return _lib._objc_msgSend_116( + _id, _lib._sel_indexPassingTest_1, predicate._impl); } - int indexWithOptions_passingTest(int opts, NSObject predicate) { - return _lib._objc_msgSend_115( - _id, _lib._sel_indexWithOptions_passingTest_1, opts, predicate._id); + int indexWithOptions_passingTest(int opts, ObjCBlock5 predicate) { + return _lib._objc_msgSend_117( + _id, _lib._sel_indexWithOptions_passingTest_1, opts, predicate._impl); } int indexInRange_options_passingTest( - NSRange range, int opts, NSObject predicate) { - return _lib._objc_msgSend_116( + NSRange range, int opts, ObjCBlock5 predicate) { + return _lib._objc_msgSend_118( _id, _lib._sel_indexInRange_options_passingTest_1, range, opts, - predicate._id); + predicate._impl); } - NSIndexSet indexesPassingTest(NSObject predicate) { - final _ret = _lib._objc_msgSend_117( - _id, _lib._sel_indexesPassingTest_1, predicate._id); + NSIndexSet indexesPassingTest(ObjCBlock5 predicate) { + final _ret = _lib._objc_msgSend_119( + _id, _lib._sel_indexesPassingTest_1, predicate._impl); return NSIndexSet._(_ret, _lib); } - NSIndexSet indexesWithOptions_passingTest(int opts, NSObject predicate) { - final _ret = _lib._objc_msgSend_118( - _id, _lib._sel_indexesWithOptions_passingTest_1, opts, predicate._id); + NSIndexSet indexesWithOptions_passingTest(int opts, ObjCBlock5 predicate) { + final _ret = _lib._objc_msgSend_120( + _id, _lib._sel_indexesWithOptions_passingTest_1, opts, predicate._impl); return NSIndexSet._(_ret, _lib); } NSIndexSet indexesInRange_options_passingTest( - NSRange range, int opts, NSObject predicate) { - final _ret = _lib._objc_msgSend_119( + NSRange range, int opts, ObjCBlock5 predicate) { + final _ret = _lib._objc_msgSend_121( _id, _lib._sel_indexesInRange_options_passingTest_1, range, opts, - predicate._id); + predicate._impl); return NSIndexSet._(_ret, _lib); } - void enumerateRangesUsingBlock(NSObject block) { - _lib._objc_msgSend_8(_id, _lib._sel_enumerateRangesUsingBlock_1, block._id); + void enumerateRangesUsingBlock(ObjCBlock6 block) { + _lib._objc_msgSend_122( + _id, _lib._sel_enumerateRangesUsingBlock_1, block._impl); } - void enumerateRangesWithOptions_usingBlock(int opts, NSObject block) { - _lib._objc_msgSend_112(_id, - _lib._sel_enumerateRangesWithOptions_usingBlock_1, opts, block._id); + void enumerateRangesWithOptions_usingBlock(int opts, ObjCBlock6 block) { + _lib._objc_msgSend_123(_id, + _lib._sel_enumerateRangesWithOptions_usingBlock_1, opts, block._impl); } void enumerateRangesInRange_options_usingBlock( - NSRange range, int opts, NSObject block) { - _lib._objc_msgSend_113( + NSRange range, int opts, ObjCBlock6 block) { + _lib._objc_msgSend_124( _id, _lib._sel_enumerateRangesInRange_options_usingBlock_1, range, opts, - block._id); + block._impl); } static NSIndexSet new1(StringTestObjCLibrary _lib) { @@ -7069,6 +7656,104 @@ class NSIndexSet extends NSObject { } } +void _ObjCBlock4_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + NSUInteger arg0, ffi.Pointer arg1)>>() + .asFunction arg1)>()( + arg0, arg1); +} + +class ObjCBlock4 { + final ffi.Pointer<_ObjCBlock> _impl; + final StringTestObjCLibrary _lib; + ObjCBlock4._(this._impl, this._lib); + + ObjCBlock4.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + NSUInteger arg0, ffi.Pointer arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + NSUInteger arg0, ffi.Pointer arg1)>( + _ObjCBlock4_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +int _ObjCBlock5_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Uint8 Function( + NSUInteger arg0, ffi.Pointer arg1)>>() + .asFunction arg1)>()( + arg0, arg1); +} + +class ObjCBlock5 { + final ffi.Pointer<_ObjCBlock> _impl; + final StringTestObjCLibrary _lib; + ObjCBlock5._(this._impl, this._lib); + + ObjCBlock5.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Uint8 Function( + NSUInteger arg0, ffi.Pointer arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Uint8 Function(ffi.Pointer<_ObjCBlock> block, + NSUInteger arg0, ffi.Pointer arg1)>( + _ObjCBlock5_fnPtrTrampoline, 0) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +void _ObjCBlock6_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, NSRange arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(NSRange arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function( + NSRange arg0, ffi.Pointer arg1)>()(arg0, arg1); +} + +class ObjCBlock6 { + final ffi.Pointer<_ObjCBlock> _impl; + final StringTestObjCLibrary _lib; + ObjCBlock6._(this._impl, this._lib); + + ObjCBlock6.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(NSRange arg0, ffi.Pointer arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + NSRange arg0, ffi.Pointer arg1)>( + _ObjCBlock6_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + class NSMutableIndexSet extends NSIndexSet { NSMutableIndexSet._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); @@ -7097,23 +7782,23 @@ class NSMutableIndexSet extends NSIndexSet { } void addIndex(int value) { - _lib._objc_msgSend_40(_id, _lib._sel_addIndex_1, value); + _lib._objc_msgSend_41(_id, _lib._sel_addIndex_1, value); } void removeIndex(int value) { - _lib._objc_msgSend_40(_id, _lib._sel_removeIndex_1, value); + _lib._objc_msgSend_41(_id, _lib._sel_removeIndex_1, value); } void addIndexesInRange(NSRange range) { - _lib._objc_msgSend_120(_id, _lib._sel_addIndexesInRange_1, range); + _lib._objc_msgSend_125(_id, _lib._sel_addIndexesInRange_1, range); } void removeIndexesInRange(NSRange range) { - _lib._objc_msgSend_120(_id, _lib._sel_removeIndexesInRange_1, range); + _lib._objc_msgSend_125(_id, _lib._sel_removeIndexesInRange_1, range); } void shiftIndexesStartingAtIndex_by(int index, int delta) { - _lib._objc_msgSend_121( + _lib._objc_msgSend_126( _id, _lib._sel_shiftIndexesStartingAtIndex_by_1, index, delta); } @@ -7125,14 +7810,14 @@ class NSMutableIndexSet extends NSIndexSet { static NSMutableIndexSet indexSetWithIndex( StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_107( + final _ret = _lib._objc_msgSend_108( _lib._class_NSMutableIndexSet1, _lib._sel_indexSetWithIndex_1, value); return NSMutableIndexSet._(_ret, _lib); } static NSMutableIndexSet indexSetWithIndexesInRange( StringTestObjCLibrary _lib, NSRange range) { - final _ret = _lib._objc_msgSend_108(_lib._class_NSMutableIndexSet1, + final _ret = _lib._objc_msgSend_109(_lib._class_NSMutableIndexSet1, _lib._sel_indexSetWithIndexesInRange_1, range); return NSMutableIndexSet._(_ret, _lib); } @@ -7186,7 +7871,7 @@ class NSOrderedCollectionDifference extends NSObject { NSObject? removes, NSObject? removedObjects, NSObject? changes) { - final _ret = _lib._objc_msgSend_122( + final _ret = _lib._objc_msgSend_127( _id, _lib._sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges_1, inserts?._id ?? ffi.nullptr, @@ -7203,7 +7888,7 @@ class NSOrderedCollectionDifference extends NSObject { NSObject? insertedObjects, NSObject? removes, NSObject? removedObjects) { - final _ret = _lib._objc_msgSend_123( + final _ret = _lib._objc_msgSend_128( _id, _lib._sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_1, inserts?._id ?? ffi.nullptr, @@ -7263,7 +7948,7 @@ class NSArray extends NSObject { } NSObject objectAtIndex(int index) { - final _ret = _lib._objc_msgSend_107(_id, _lib._sel_objectAtIndex_1, index); + final _ret = _lib._objc_msgSend_108(_id, _lib._sel_objectAtIndex_1, index); return NSObject._(_ret, _lib); } @@ -7275,7 +7960,7 @@ class NSArray extends NSObject { NSArray initWithObjects_count( ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_124( + final _ret = _lib._objc_msgSend_129( _id, _lib._sel_initWithObjects_count_1, objects, cnt); return NSArray._(_ret, _lib); } @@ -7308,7 +7993,7 @@ class NSArray extends NSObject { } NSString descriptionWithLocale_indent(NSObject locale, int level) { - final _ret = _lib._objc_msgSend_125( + final _ret = _lib._objc_msgSend_130( _id, _lib._sel_descriptionWithLocale_indent_1, locale._id, level); return NSString._(_ret, _lib); } @@ -7321,25 +8006,25 @@ class NSArray extends NSObject { void getObjects_range( ffi.Pointer> objects, NSRange range) { - _lib._objc_msgSend_126(_id, _lib._sel_getObjects_range_1, objects, range); + _lib._objc_msgSend_131(_id, _lib._sel_getObjects_range_1, objects, range); } int indexOfObject(NSObject anObject) { - return _lib._objc_msgSend_114(_id, _lib._sel_indexOfObject_1, anObject._id); + return _lib._objc_msgSend_132(_id, _lib._sel_indexOfObject_1, anObject._id); } int indexOfObject_inRange(NSObject anObject, NSRange range) { - return _lib._objc_msgSend_127( + return _lib._objc_msgSend_133( _id, _lib._sel_indexOfObject_inRange_1, anObject._id, range); } int indexOfObjectIdenticalTo(NSObject anObject) { - return _lib._objc_msgSend_114( + return _lib._objc_msgSend_132( _id, _lib._sel_indexOfObjectIdenticalTo_1, anObject._id); } int indexOfObjectIdenticalTo_inRange(NSObject anObject, NSRange range) { - return _lib._objc_msgSend_127( + return _lib._objc_msgSend_133( _id, _lib._sel_indexOfObjectIdenticalTo_inRange_1, anObject._id, range); } @@ -7365,7 +8050,7 @@ class NSArray extends NSObject { bool writeToURL_error( NSObject? url, ffi.Pointer> error) { - return _lib._objc_msgSend_128( + return _lib._objc_msgSend_134( _id, _lib._sel_writeToURL_error_1, url?._id ?? ffi.nullptr, error); } @@ -7376,7 +8061,7 @@ class NSArray extends NSObject { void makeObjectsPerformSelector_withObject( ffi.Pointer aSelector, NSObject argument) { - _lib._objc_msgSend_129( + _lib._objc_msgSend_135( _id, _lib._sel_makeObjectsPerformSelector_withObject_1, aSelector, @@ -7385,80 +8070,83 @@ class NSArray extends NSObject { NSObject objectAtIndexedSubscript(int idx) { final _ret = - _lib._objc_msgSend_107(_id, _lib._sel_objectAtIndexedSubscript_1, idx); + _lib._objc_msgSend_108(_id, _lib._sel_objectAtIndexedSubscript_1, idx); return NSObject._(_ret, _lib); } - void enumerateObjectsUsingBlock(NSObject block) { - _lib._objc_msgSend_8( - _id, _lib._sel_enumerateObjectsUsingBlock_1, block._id); + void enumerateObjectsUsingBlock(ObjCBlock7 block) { + _lib._objc_msgSend_136( + _id, _lib._sel_enumerateObjectsUsingBlock_1, block._impl); } - void enumerateObjectsWithOptions_usingBlock(int opts, NSObject block) { - _lib._objc_msgSend_112(_id, - _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._id); + void enumerateObjectsWithOptions_usingBlock(int opts, ObjCBlock7 block) { + _lib._objc_msgSend_137(_id, + _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._impl); } void enumerateObjectsAtIndexes_options_usingBlock( - NSObject? s, int opts, NSObject block) { - _lib._objc_msgSend_130( + NSObject? s, int opts, ObjCBlock7 block) { + _lib._objc_msgSend_138( _id, _lib._sel_enumerateObjectsAtIndexes_options_usingBlock_1, s?._id ?? ffi.nullptr, opts, - block._id); + block._impl); } - int indexOfObjectPassingTest(NSObject predicate) { - return _lib._objc_msgSend_114( - _id, _lib._sel_indexOfObjectPassingTest_1, predicate._id); + int indexOfObjectPassingTest(ObjCBlock8 predicate) { + return _lib._objc_msgSend_139( + _id, _lib._sel_indexOfObjectPassingTest_1, predicate._impl); } - int indexOfObjectWithOptions_passingTest(int opts, NSObject predicate) { - return _lib._objc_msgSend_115(_id, - _lib._sel_indexOfObjectWithOptions_passingTest_1, opts, predicate._id); + int indexOfObjectWithOptions_passingTest(int opts, ObjCBlock8 predicate) { + return _lib._objc_msgSend_140( + _id, + _lib._sel_indexOfObjectWithOptions_passingTest_1, + opts, + predicate._impl); } int indexOfObjectAtIndexes_options_passingTest( - NSObject? s, int opts, NSObject predicate) { - return _lib._objc_msgSend_131( + NSObject? s, int opts, ObjCBlock8 predicate) { + return _lib._objc_msgSend_141( _id, _lib._sel_indexOfObjectAtIndexes_options_passingTest_1, s?._id ?? ffi.nullptr, opts, - predicate._id); + predicate._impl); } - NSIndexSet indexesOfObjectsPassingTest(NSObject predicate) { - final _ret = _lib._objc_msgSend_117( - _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._id); + NSIndexSet indexesOfObjectsPassingTest(ObjCBlock8 predicate) { + final _ret = _lib._objc_msgSend_142( + _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._impl); return NSIndexSet._(_ret, _lib); } NSIndexSet indexesOfObjectsWithOptions_passingTest( - int opts, NSObject predicate) { - final _ret = _lib._objc_msgSend_118( + int opts, ObjCBlock8 predicate) { + final _ret = _lib._objc_msgSend_143( _id, _lib._sel_indexesOfObjectsWithOptions_passingTest_1, opts, - predicate._id); + predicate._impl); return NSIndexSet._(_ret, _lib); } NSIndexSet indexesOfObjectsAtIndexes_options_passingTest( - NSObject? s, int opts, NSObject predicate) { - final _ret = _lib._objc_msgSend_132( + NSObject? s, int opts, ObjCBlock8 predicate) { + final _ret = _lib._objc_msgSend_144( _id, _lib._sel_indexesOfObjectsAtIndexes_options_passingTest_1, s?._id ?? ffi.nullptr, opts, - predicate._id); + predicate._impl); return NSIndexSet._(_ret, _lib); } int indexOfObject_inSortedRange_options_usingComparator( NSObject obj, NSRange r, int opts, NSComparator cmp) { - return _lib._objc_msgSend_133( + return _lib._objc_msgSend_145( _id, _lib._sel_indexOfObject_inSortedRange_options_usingComparator_1, obj._id, @@ -7481,7 +8169,7 @@ class NSArray extends NSObject { static NSArray arrayWithObjects_count(StringTestObjCLibrary _lib, ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_124( + final _ret = _lib._objc_msgSend_129( _lib._class_NSArray1, _lib._sel_arrayWithObjects_count_1, objects, cnt); return NSArray._(_ret, _lib); } @@ -7512,22 +8200,22 @@ class NSArray extends NSObject { } NSArray initWithArray_copyItems(NSObject? array, bool flag) { - final _ret = _lib._objc_msgSend_134(_id, + final _ret = _lib._objc_msgSend_146(_id, _lib._sel_initWithArray_copyItems_1, array?._id ?? ffi.nullptr, flag); return NSArray._(_ret, _lib); } void getObjects(ffi.Pointer> objects) { - _lib._objc_msgSend_135(_id, _lib._sel_getObjects_1, objects); + _lib._objc_msgSend_147(_id, _lib._sel_getObjects_1, objects); } bool writeToFile_atomically(NSObject? path, bool useAuxiliaryFile) { - return _lib._objc_msgSend_71(_id, _lib._sel_writeToFile_atomically_1, + return _lib._objc_msgSend_72(_id, _lib._sel_writeToFile_atomically_1, path?._id ?? ffi.nullptr, useAuxiliaryFile); } bool writeToURL_atomically(NSObject? url, bool atomically) { - return _lib._objc_msgSend_71(_id, _lib._sel_writeToURL_atomically_1, + return _lib._objc_msgSend_72(_id, _lib._sel_writeToURL_atomically_1, url?._id ?? ffi.nullptr, atomically); } @@ -7542,13 +8230,122 @@ class NSArray extends NSObject { } } +void _ObjCBlock7_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSUInteger arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +class ObjCBlock7 { + final ffi.Pointer<_ObjCBlock> _impl; + final StringTestObjCLibrary _lib; + ObjCBlock7._(this._impl, this._lib); + + ObjCBlock7.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + NSUInteger arg1, ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>( + _ObjCBlock7_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +int _ObjCBlock8_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer arg0, NSUInteger arg1, + ffi.Pointer arg2)>>() + .asFunction< + int Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +class ObjCBlock8 { + final ffi.Pointer<_ObjCBlock> _impl; + final StringTestObjCLibrary _lib; + ObjCBlock8._(this._impl, this._lib); + + ObjCBlock8.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer arg0, + NSUInteger arg1, ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Uint8 Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>( + _ObjCBlock8_fnPtrTrampoline, 0) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + abstract class NSBinarySearchingOptions { static const int NSBinarySearchingFirstEqual = 256; static const int NSBinarySearchingLastEqual = 512; static const int NSBinarySearchingInsertionIndex = 1024; } -typedef NSComparator = ffi.Pointer; +typedef NSComparator = ffi.Pointer<_ObjCBlock>; +int _ObjCBlock9_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + int Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +class ObjCBlock9 { + final ffi.Pointer<_ObjCBlock> _impl; + final StringTestObjCLibrary _lib; + ObjCBlock9._(this._impl, this._lib); + + ObjCBlock9.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Int32 Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock9_fnPtrTrampoline, 0) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} class NSMutableArray extends NSArray { NSMutableArray._(ffi.Pointer id, StringTestObjCLibrary lib) @@ -7568,7 +8365,7 @@ class NSMutableArray extends NSArray { } void insertObject_atIndex(NSObject anObject, int index) { - _lib._objc_msgSend_136( + _lib._objc_msgSend_148( _id, _lib._sel_insertObject_atIndex_1, anObject._id, index); } @@ -7577,11 +8374,11 @@ class NSMutableArray extends NSArray { } void removeObjectAtIndex(int index) { - _lib._objc_msgSend_40(_id, _lib._sel_removeObjectAtIndex_1, index); + _lib._objc_msgSend_41(_id, _lib._sel_removeObjectAtIndex_1, index); } void replaceObjectAtIndex_withObject(int index, NSObject anObject) { - _lib._objc_msgSend_137( + _lib._objc_msgSend_149( _id, _lib._sel_replaceObjectAtIndex_withObject_1, index, anObject._id); } @@ -7593,7 +8390,7 @@ class NSMutableArray extends NSArray { NSMutableArray initWithCapacity(int numItems) { final _ret = - _lib._objc_msgSend_107(_id, _lib._sel_initWithCapacity_1, numItems); + _lib._objc_msgSend_108(_id, _lib._sel_initWithCapacity_1, numItems); return NSMutableArray._(_ret, _lib); } @@ -7610,7 +8407,7 @@ class NSMutableArray extends NSArray { } void exchangeObjectAtIndex_withObjectAtIndex(int idx1, int idx2) { - _lib._objc_msgSend_138( + _lib._objc_msgSend_150( _id, _lib._sel_exchangeObjectAtIndex_withObjectAtIndex_1, idx1, idx2); } @@ -7619,7 +8416,7 @@ class NSMutableArray extends NSArray { } void removeObject_inRange(NSObject anObject, NSRange range) { - _lib._objc_msgSend_139( + _lib._objc_msgSend_151( _id, _lib._sel_removeObject_inRange_1, anObject._id, range); } @@ -7628,7 +8425,7 @@ class NSMutableArray extends NSArray { } void removeObjectIdenticalTo_inRange(NSObject anObject, NSRange range) { - _lib._objc_msgSend_139( + _lib._objc_msgSend_151( _id, _lib._sel_removeObjectIdenticalTo_inRange_1, anObject._id, range); } @@ -7639,7 +8436,7 @@ class NSMutableArray extends NSArray { void removeObjectsFromIndices_numIndices( ffi.Pointer indices, int cnt) { - _lib._objc_msgSend_140( + _lib._objc_msgSend_152( _id, _lib._sel_removeObjectsFromIndices_numIndices_1, indices, cnt); } @@ -7649,12 +8446,12 @@ class NSMutableArray extends NSArray { } void removeObjectsInRange(NSRange range) { - _lib._objc_msgSend_120(_id, _lib._sel_removeObjectsInRange_1, range); + _lib._objc_msgSend_125(_id, _lib._sel_removeObjectsInRange_1, range); } void replaceObjectsInRange_withObjectsFromArray_range( NSRange range, NSObject? otherArray, NSRange otherRange) { - _lib._objc_msgSend_141( + _lib._objc_msgSend_153( _id, _lib._sel_replaceObjectsInRange_withObjectsFromArray_range_1, range, @@ -7664,7 +8461,7 @@ class NSMutableArray extends NSArray { void replaceObjectsInRange_withObjectsFromArray( NSRange range, NSObject? otherArray) { - _lib._objc_msgSend_142( + _lib._objc_msgSend_154( _id, _lib._sel_replaceObjectsInRange_withObjectsFromArray_1, range, @@ -7683,7 +8480,7 @@ class NSMutableArray extends NSArray { ffi.Pointer, ffi.Pointer)>> compare, ffi.Pointer context) { - _lib._objc_msgSend_143( + _lib._objc_msgSend_155( _id, _lib._sel_sortUsingFunction_context_1, compare, context); } @@ -7692,7 +8489,7 @@ class NSMutableArray extends NSArray { } void insertObjects_atIndexes(NSObject? objects, NSObject? indexes) { - _lib._objc_msgSend_144(_id, _lib._sel_insertObjects_atIndexes_1, + _lib._objc_msgSend_156(_id, _lib._sel_insertObjects_atIndexes_1, objects?._id ?? ffi.nullptr, indexes?._id ?? ffi.nullptr); } @@ -7703,27 +8500,27 @@ class NSMutableArray extends NSArray { void replaceObjectsAtIndexes_withObjects( NSObject? indexes, NSObject? objects) { - _lib._objc_msgSend_144(_id, _lib._sel_replaceObjectsAtIndexes_withObjects_1, + _lib._objc_msgSend_156(_id, _lib._sel_replaceObjectsAtIndexes_withObjects_1, indexes?._id ?? ffi.nullptr, objects?._id ?? ffi.nullptr); } void setObject_atIndexedSubscript(NSObject obj, int idx) { - _lib._objc_msgSend_136( + _lib._objc_msgSend_148( _id, _lib._sel_setObject_atIndexedSubscript_1, obj._id, idx); } void sortUsingComparator(NSComparator cmptr) { - _lib._objc_msgSend_8(_id, _lib._sel_sortUsingComparator_1, cmptr); + _lib._objc_msgSend_157(_id, _lib._sel_sortUsingComparator_1, cmptr); } void sortWithOptions_usingComparator(int opts, NSComparator cmptr) { - _lib._objc_msgSend_145( + _lib._objc_msgSend_158( _id, _lib._sel_sortWithOptions_usingComparator_1, opts, cmptr); } static NSMutableArray arrayWithCapacity( StringTestObjCLibrary _lib, int numItems) { - final _ret = _lib._objc_msgSend_107( + final _ret = _lib._objc_msgSend_108( _lib._class_NSMutableArray1, _lib._sel_arrayWithCapacity_1, numItems); return NSMutableArray._(_ret, _lib); } @@ -7748,7 +8545,7 @@ class NSMutableArray extends NSArray { static NSMutableArray arrayWithObjects_count(StringTestObjCLibrary _lib, ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_124(_lib._class_NSMutableArray1, + final _ret = _lib._objc_msgSend_129(_lib._class_NSMutableArray1, _lib._sel_arrayWithObjects_count_1, objects, cnt); return NSMutableArray._(_ret, _lib); } @@ -7811,13 +8608,13 @@ class NSItemProvider extends NSObject { } void registerDataRepresentationForTypeIdentifier_visibility_loadHandler( - NSObject? typeIdentifier, int visibility, NSObject loadHandler) { - _lib._objc_msgSend_146( + NSObject? typeIdentifier, int visibility, ObjCBlock10 loadHandler) { + _lib._objc_msgSend_159( _id, _lib._sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1, typeIdentifier?._id ?? ffi.nullptr, visibility, - loadHandler._id); + loadHandler._impl); } void @@ -7825,14 +8622,14 @@ class NSItemProvider extends NSObject { NSObject? typeIdentifier, int fileOptions, int visibility, - NSObject loadHandler) { - _lib._objc_msgSend_147( + ObjCBlock12 loadHandler) { + _lib._objc_msgSend_160( _id, _lib._sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1, typeIdentifier?._id ?? ffi.nullptr, fileOptions, visibility, - loadHandler._id); + loadHandler._impl); } NSObject? get registeredTypeIdentifiers { @@ -7850,7 +8647,7 @@ class NSItemProvider extends NSObject { bool hasRepresentationConformingToTypeIdentifier_fileOptions( NSObject? typeIdentifier, int fileOptions) { - return _lib._objc_msgSend_148( + return _lib._objc_msgSend_161( _id, _lib._sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1, typeIdentifier?._id ?? ffi.nullptr, @@ -7858,32 +8655,32 @@ class NSItemProvider extends NSObject { } NSProgress loadDataRepresentationForTypeIdentifier_completionHandler( - NSObject? typeIdentifier, NSObject completionHandler) { - final _ret = _lib._objc_msgSend_149( + NSObject? typeIdentifier, ObjCBlock11 completionHandler) { + final _ret = _lib._objc_msgSend_162( _id, _lib._sel_loadDataRepresentationForTypeIdentifier_completionHandler_1, typeIdentifier?._id ?? ffi.nullptr, - completionHandler._id); + completionHandler._impl); return NSProgress._(_ret, _lib); } NSProgress loadFileRepresentationForTypeIdentifier_completionHandler( - NSObject? typeIdentifier, NSObject completionHandler) { - final _ret = _lib._objc_msgSend_149( + NSObject? typeIdentifier, ObjCBlock11 completionHandler) { + final _ret = _lib._objc_msgSend_162( _id, _lib._sel_loadFileRepresentationForTypeIdentifier_completionHandler_1, typeIdentifier?._id ?? ffi.nullptr, - completionHandler._id); + completionHandler._impl); return NSProgress._(_ret, _lib); } NSProgress loadInPlaceFileRepresentationForTypeIdentifier_completionHandler( - NSObject? typeIdentifier, NSObject completionHandler) { - final _ret = _lib._objc_msgSend_149( + NSObject? typeIdentifier, ObjCBlock13 completionHandler) { + final _ret = _lib._objc_msgSend_163( _id, _lib._sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1, typeIdentifier?._id ?? ffi.nullptr, - completionHandler._id); + completionHandler._impl); return NSProgress._(_ret, _lib); } @@ -7904,18 +8701,18 @@ class NSItemProvider extends NSObject { } void registerObject_visibility(NSObject? object, int visibility) { - _lib._objc_msgSend_150(_id, _lib._sel_registerObject_visibility_1, + _lib._objc_msgSend_164(_id, _lib._sel_registerObject_visibility_1, object?._id ?? ffi.nullptr, visibility); } void registerObjectOfClass_visibility_loadHandler( - NSObject? aClass, int visibility, NSObject loadHandler) { - _lib._objc_msgSend_146( + NSObject? aClass, int visibility, ObjCBlock10 loadHandler) { + _lib._objc_msgSend_159( _id, _lib._sel_registerObjectOfClass_visibility_loadHandler_1, aClass?._id ?? ffi.nullptr, visibility, - loadHandler._id); + loadHandler._impl); } bool canLoadObjectOfClass(NSObject? aClass) { @@ -7924,18 +8721,18 @@ class NSItemProvider extends NSObject { } NSProgress loadObjectOfClass_completionHandler( - NSObject? aClass, NSObject completionHandler) { - final _ret = _lib._objc_msgSend_149( + NSObject? aClass, ObjCBlock11 completionHandler) { + final _ret = _lib._objc_msgSend_162( _id, _lib._sel_loadObjectOfClass_completionHandler_1, aClass?._id ?? ffi.nullptr, - completionHandler._id); + completionHandler._impl); return NSProgress._(_ret, _lib); } NSItemProvider initWithItem_typeIdentifier( NSObject? item, NSObject? typeIdentifier) { - final _ret = _lib._objc_msgSend_57( + final _ret = _lib._objc_msgSend_58( _id, _lib._sel_initWithItem_typeIdentifier_1, item?._id ?? ffi.nullptr, @@ -7951,7 +8748,7 @@ class NSItemProvider extends NSObject { void registerItemForTypeIdentifier_loadHandler( NSObject? typeIdentifier, NSItemProviderLoadHandler loadHandler) { - _lib._objc_msgSend_144( + _lib._objc_msgSend_165( _id, _lib._sel_registerItemForTypeIdentifier_loadHandler_1, typeIdentifier?._id ?? ffi.nullptr, @@ -7962,7 +8759,7 @@ class NSItemProvider extends NSObject { NSObject? typeIdentifier, NSObject? options, NSItemProviderCompletionHandler completionHandler) { - _lib._objc_msgSend_151( + _lib._objc_msgSend_166( _id, _lib._sel_loadItemForTypeIdentifier_options_completionHandler_1, typeIdentifier?._id ?? ffi.nullptr, @@ -7971,16 +8768,16 @@ class NSItemProvider extends NSObject { } NSItemProviderLoadHandler get previewImageHandler { - return _lib._objc_msgSend_1(_id, _lib._sel_previewImageHandler1); + return _lib._objc_msgSend_167(_id, _lib._sel_previewImageHandler1); } set previewImageHandler(NSItemProviderLoadHandler value) { - _lib._objc_msgSend_8(_id, _lib._sel_setPreviewImageHandler_1, value); + _lib._objc_msgSend_168(_id, _lib._sel_setPreviewImageHandler_1, value); } void loadPreviewImageWithOptions_completionHandler( NSObject? options, NSItemProviderCompletionHandler completionHandler) { - _lib._objc_msgSend_144( + _lib._objc_msgSend_169( _id, _lib._sel_loadPreviewImageWithOptions_completionHandler_1, options?._id ?? ffi.nullptr, @@ -8000,6 +8797,148 @@ class NSItemProvider extends NSObject { } } +ffi.Pointer _ObjCBlock10_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>()(arg0); +} + +class ObjCBlock10 { + final ffi.Pointer<_ObjCBlock> _impl; + final StringTestObjCLibrary _lib; + ObjCBlock10._(this._impl, this._lib); + + ObjCBlock10.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock10_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +void _ObjCBlock11_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +class ObjCBlock11 { + final ffi.Pointer<_ObjCBlock> _impl; + final StringTestObjCLibrary _lib; + ObjCBlock11._(this._impl, this._lib); + + ObjCBlock11.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : _impl = + _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock11_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +ffi.Pointer _ObjCBlock12_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>()(arg0); +} + +class ObjCBlock12 { + final ffi.Pointer<_ObjCBlock> _impl; + final StringTestObjCLibrary _lib; + ObjCBlock12._(this._impl, this._lib); + + ObjCBlock12.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock12_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +void _ObjCBlock13_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Uint8 arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +class ObjCBlock13 { + final ffi.Pointer<_ObjCBlock> _impl; + final StringTestObjCLibrary _lib; + ObjCBlock13._(this._impl, this._lib); + + ObjCBlock13.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Uint8 arg1, ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Uint8 arg1, + ffi.Pointer arg2)>( + _ObjCBlock13_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + class NSProgress extends _ObjCWrapper { NSProgress._(ffi.Pointer id, StringTestObjCLibrary lib) : super._(id, lib); @@ -8014,8 +8953,54 @@ class NSProgress extends _ObjCWrapper { } } -typedef NSItemProviderLoadHandler = ffi.Pointer; -typedef NSItemProviderCompletionHandler = ffi.Pointer; +typedef NSItemProviderLoadHandler = ffi.Pointer<_ObjCBlock>; +void _ObjCBlock14_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +class ObjCBlock14 { + final ffi.Pointer<_ObjCBlock> _impl; + final StringTestObjCLibrary _lib; + ObjCBlock14._(this._impl, this._lib); + + ObjCBlock14.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock14_fnPtrTrampoline) + .cast(), + ptr.cast()); + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +typedef NSItemProviderCompletionHandler = ffi.Pointer<_ObjCBlock>; abstract class NSItemProviderErrorCode { static const int NSItemProviderUnknownError = -1; @@ -8040,17 +9025,17 @@ class NSMutableString extends NSString { } void replaceCharactersInRange_withString(NSRange range, NSObject? aString) { - _lib._objc_msgSend_142(_id, _lib._sel_replaceCharactersInRange_withString_1, + _lib._objc_msgSend_154(_id, _lib._sel_replaceCharactersInRange_withString_1, range, aString?._id ?? ffi.nullptr); } void insertString_atIndex(NSObject? aString, int loc) { - _lib._objc_msgSend_136(_id, _lib._sel_insertString_atIndex_1, + _lib._objc_msgSend_148(_id, _lib._sel_insertString_atIndex_1, aString?._id ?? ffi.nullptr, loc); } void deleteCharactersInRange(NSRange range) { - _lib._objc_msgSend_120(_id, _lib._sel_deleteCharactersInRange_1, range); + _lib._objc_msgSend_125(_id, _lib._sel_deleteCharactersInRange_1, range); } void appendString(NSObject? aString) { @@ -8070,7 +9055,7 @@ class NSMutableString extends NSString { int replaceOccurrencesOfString_withString_options_range(NSObject? target, NSObject? replacement, int options, NSRange searchRange) { - return _lib._objc_msgSend_152( + return _lib._objc_msgSend_170( _id, _lib._sel_replaceOccurrencesOfString_withString_options_range_1, target?._id ?? ffi.nullptr, @@ -8081,7 +9066,7 @@ class NSMutableString extends NSString { bool applyTransform_reverse_range_updatedRange(NSStringTransform transform, bool reverse, NSRange range, NSRangePointer resultingRange) { - return _lib._objc_msgSend_153( + return _lib._objc_msgSend_171( _id, _lib._sel_applyTransform_reverse_range_updatedRange_1, transform, @@ -8092,13 +9077,13 @@ class NSMutableString extends NSString { NSMutableString initWithCapacity(int capacity) { final _ret = - _lib._objc_msgSend_154(_id, _lib._sel_initWithCapacity_1, capacity); + _lib._objc_msgSend_172(_id, _lib._sel_initWithCapacity_1, capacity); return NSMutableString._(_ret, _lib); } static NSMutableString stringWithCapacity( StringTestObjCLibrary _lib, int capacity) { - final _ret = _lib._objc_msgSend_154( + final _ret = _lib._objc_msgSend_172( _lib._class_NSMutableString1, _lib._sel_stringWithCapacity_1, capacity); return NSMutableString._(_ret, _lib); } @@ -8125,14 +9110,14 @@ class NSMutableString extends NSString { static NSMutableString stringWithCharacters_length( StringTestObjCLibrary _lib, ffi.Pointer characters, int length) { - final _ret = _lib._objc_msgSend_54(_lib._class_NSMutableString1, + final _ret = _lib._objc_msgSend_55(_lib._class_NSMutableString1, _lib._sel_stringWithCharacters_length_1, characters, length); return NSMutableString._(_ret, _lib); } static NSMutableString stringWithUTF8String(StringTestObjCLibrary _lib, ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_55(_lib._class_NSMutableString1, + final _ret = _lib._objc_msgSend_56(_lib._class_NSMutableString1, _lib._sel_stringWithUTF8String_1, nullTerminatedCString); return NSMutableString._(_ret, _lib); } @@ -8153,7 +9138,7 @@ class NSMutableString extends NSString { static NSMutableString stringWithCString_encoding( StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_63(_lib._class_NSMutableString1, + final _ret = _lib._objc_msgSend_64(_lib._class_NSMutableString1, _lib._sel_stringWithCString_encoding_1, cString, enc); return NSMutableString._(_ret, _lib); } @@ -8163,7 +9148,7 @@ class NSMutableString extends NSString { NSObject? url, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_64( + final _ret = _lib._objc_msgSend_65( _lib._class_NSMutableString1, _lib._sel_stringWithContentsOfURL_encoding_error_1, url?._id ?? ffi.nullptr, @@ -8177,7 +9162,7 @@ class NSMutableString extends NSString { NSObject? path, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_64( + final _ret = _lib._objc_msgSend_65( _lib._class_NSMutableString1, _lib._sel_stringWithContentsOfFile_encoding_error_1, path?._id ?? ffi.nullptr, @@ -8191,7 +9176,7 @@ class NSMutableString extends NSString { NSObject? url, ffi.Pointer enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( + final _ret = _lib._objc_msgSend_66( _lib._class_NSMutableString1, _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, url?._id ?? ffi.nullptr, @@ -8205,7 +9190,7 @@ class NSMutableString extends NSString { NSObject? path, ffi.Pointer enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( + final _ret = _lib._objc_msgSend_66( _lib._class_NSMutableString1, _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, path?._id ?? ffi.nullptr, @@ -8231,7 +9216,7 @@ class NSMutableString extends NSString { NSObject? opts, ffi.Pointer> string, ffi.Pointer usedLossyConversion) { - return _lib._objc_msgSend_66( + return _lib._objc_msgSend_67( _lib._class_NSMutableString1, _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, data?._id ?? ffi.nullptr, @@ -8256,14 +9241,14 @@ class NSMutableString extends NSString { static NSObject stringWithCString_length( StringTestObjCLibrary _lib, ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_63(_lib._class_NSMutableString1, + final _ret = _lib._objc_msgSend_64(_lib._class_NSMutableString1, _lib._sel_stringWithCString_length_1, bytes, length); return NSObject._(_ret, _lib); } static NSObject stringWithCString( StringTestObjCLibrary _lib, ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_55( + final _ret = _lib._objc_msgSend_56( _lib._class_NSMutableString1, _lib._sel_stringWithCString_1, bytes); return NSObject._(_ret, _lib); } @@ -8318,14 +9303,14 @@ class NSSimpleCString extends NSString { static NSSimpleCString stringWithCharacters_length( StringTestObjCLibrary _lib, ffi.Pointer characters, int length) { - final _ret = _lib._objc_msgSend_54(_lib._class_NSSimpleCString1, + final _ret = _lib._objc_msgSend_55(_lib._class_NSSimpleCString1, _lib._sel_stringWithCharacters_length_1, characters, length); return NSSimpleCString._(_ret, _lib); } static NSSimpleCString stringWithUTF8String(StringTestObjCLibrary _lib, ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_55(_lib._class_NSSimpleCString1, + final _ret = _lib._objc_msgSend_56(_lib._class_NSSimpleCString1, _lib._sel_stringWithUTF8String_1, nullTerminatedCString); return NSSimpleCString._(_ret, _lib); } @@ -8346,7 +9331,7 @@ class NSSimpleCString extends NSString { static NSSimpleCString stringWithCString_encoding( StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_63(_lib._class_NSSimpleCString1, + final _ret = _lib._objc_msgSend_64(_lib._class_NSSimpleCString1, _lib._sel_stringWithCString_encoding_1, cString, enc); return NSSimpleCString._(_ret, _lib); } @@ -8356,7 +9341,7 @@ class NSSimpleCString extends NSString { NSObject? url, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_64( + final _ret = _lib._objc_msgSend_65( _lib._class_NSSimpleCString1, _lib._sel_stringWithContentsOfURL_encoding_error_1, url?._id ?? ffi.nullptr, @@ -8370,7 +9355,7 @@ class NSSimpleCString extends NSString { NSObject? path, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_64( + final _ret = _lib._objc_msgSend_65( _lib._class_NSSimpleCString1, _lib._sel_stringWithContentsOfFile_encoding_error_1, path?._id ?? ffi.nullptr, @@ -8384,7 +9369,7 @@ class NSSimpleCString extends NSString { NSObject? url, ffi.Pointer enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( + final _ret = _lib._objc_msgSend_66( _lib._class_NSSimpleCString1, _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, url?._id ?? ffi.nullptr, @@ -8398,7 +9383,7 @@ class NSSimpleCString extends NSString { NSObject? path, ffi.Pointer enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( + final _ret = _lib._objc_msgSend_66( _lib._class_NSSimpleCString1, _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, path?._id ?? ffi.nullptr, @@ -8424,7 +9409,7 @@ class NSSimpleCString extends NSString { NSObject? opts, ffi.Pointer> string, ffi.Pointer usedLossyConversion) { - return _lib._objc_msgSend_66( + return _lib._objc_msgSend_67( _lib._class_NSSimpleCString1, _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, data?._id ?? ffi.nullptr, @@ -8449,14 +9434,14 @@ class NSSimpleCString extends NSString { static NSObject stringWithCString_length( StringTestObjCLibrary _lib, ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_63(_lib._class_NSSimpleCString1, + final _ret = _lib._objc_msgSend_64(_lib._class_NSSimpleCString1, _lib._sel_stringWithCString_length_1, bytes, length); return NSObject._(_ret, _lib); } static NSObject stringWithCString( StringTestObjCLibrary _lib, ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_55( + final _ret = _lib._objc_msgSend_56( _lib._class_NSSimpleCString1, _lib._sel_stringWithCString_1, bytes); return NSObject._(_ret, _lib); } @@ -8509,14 +9494,14 @@ class NSConstantString extends NSSimpleCString { static NSConstantString stringWithCharacters_length( StringTestObjCLibrary _lib, ffi.Pointer characters, int length) { - final _ret = _lib._objc_msgSend_54(_lib._class_NSConstantString1, + final _ret = _lib._objc_msgSend_55(_lib._class_NSConstantString1, _lib._sel_stringWithCharacters_length_1, characters, length); return NSConstantString._(_ret, _lib); } static NSConstantString stringWithUTF8String(StringTestObjCLibrary _lib, ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_55(_lib._class_NSConstantString1, + final _ret = _lib._objc_msgSend_56(_lib._class_NSConstantString1, _lib._sel_stringWithUTF8String_1, nullTerminatedCString); return NSConstantString._(_ret, _lib); } @@ -8537,7 +9522,7 @@ class NSConstantString extends NSSimpleCString { static NSConstantString stringWithCString_encoding( StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_63(_lib._class_NSConstantString1, + final _ret = _lib._objc_msgSend_64(_lib._class_NSConstantString1, _lib._sel_stringWithCString_encoding_1, cString, enc); return NSConstantString._(_ret, _lib); } @@ -8547,7 +9532,7 @@ class NSConstantString extends NSSimpleCString { NSObject? url, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_64( + final _ret = _lib._objc_msgSend_65( _lib._class_NSConstantString1, _lib._sel_stringWithContentsOfURL_encoding_error_1, url?._id ?? ffi.nullptr, @@ -8561,7 +9546,7 @@ class NSConstantString extends NSSimpleCString { NSObject? path, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_64( + final _ret = _lib._objc_msgSend_65( _lib._class_NSConstantString1, _lib._sel_stringWithContentsOfFile_encoding_error_1, path?._id ?? ffi.nullptr, @@ -8575,7 +9560,7 @@ class NSConstantString extends NSSimpleCString { NSObject? url, ffi.Pointer enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( + final _ret = _lib._objc_msgSend_66( _lib._class_NSConstantString1, _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, url?._id ?? ffi.nullptr, @@ -8589,7 +9574,7 @@ class NSConstantString extends NSSimpleCString { NSObject? path, ffi.Pointer enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( + final _ret = _lib._objc_msgSend_66( _lib._class_NSConstantString1, _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, path?._id ?? ffi.nullptr, @@ -8615,7 +9600,7 @@ class NSConstantString extends NSSimpleCString { NSObject? opts, ffi.Pointer> string, ffi.Pointer usedLossyConversion) { - return _lib._objc_msgSend_66( + return _lib._objc_msgSend_67( _lib._class_NSConstantString1, _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, data?._id ?? ffi.nullptr, @@ -8640,14 +9625,14 @@ class NSConstantString extends NSSimpleCString { static NSObject stringWithCString_length( StringTestObjCLibrary _lib, ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_63(_lib._class_NSConstantString1, + final _ret = _lib._objc_msgSend_64(_lib._class_NSConstantString1, _lib._sel_stringWithCString_length_1, bytes, length); return NSObject._(_ret, _lib); } static NSObject stringWithCString( StringTestObjCLibrary _lib, ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_55( + final _ret = _lib._objc_msgSend_56( _lib._class_NSConstantString1, _lib._sel_stringWithCString_1, bytes); return NSObject._(_ret, _lib); } @@ -8680,7 +9665,7 @@ class StringUtil extends NSObject { static NSString strConcat_with( StringTestObjCLibrary _lib, NSObject? a, NSObject? b) { - final _ret = _lib._objc_msgSend_48( + final _ret = _lib._objc_msgSend_49( _lib._class_StringUtil1, _lib._sel_strConcat_with_1, a?._id ?? ffi.nullptr, diff --git a/pkgs/ffigen/test/regen.dart b/pkgs/ffigen/test/regen.dart index d0a6a4f6be..d77d3ca3e9 100644 --- a/pkgs/ffigen/test/regen.dart +++ b/pkgs/ffigen/test/regen.dart @@ -104,6 +104,11 @@ Future main(List args) async { File('test/native_objc_test/string_bindings.dart'), ); + await _regenConfig( + File('test/native_objc_test/block_config.yaml'), + File('test/native_objc_test/block_bindings.dart'), + ); + await _regenConfig(File('test/native_test/config.yaml'), File('test/native_test/native_test_bindings.dart')); From f22e74608772f27ac6de906f8f433df8024d692c Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 4 May 2022 09:49:34 -0700 Subject: [PATCH 133/276] [ffigen] Fix a bug where duplicate methods were added to some classes. (#354) * Fix #353 * Fix analysis errors * Fix spurious method mismatch errors --- .../src/code_generator/objc_interface.dart | 85 ++++++++++--------- .../native_objc_test/category_config.yaml | 2 + .../native_objc_test_bindings.dart | 21 ++--- .../native_objc_test/string_bindings.dart | 63 +++++++------- 4 files changed, 89 insertions(+), 82 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 70fa7f2e63..5c53bda3ea 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; +import 'package:logging/logging.dart'; import 'binding_string.dart'; import 'utils.dart'; @@ -33,18 +34,13 @@ const _excludedNSObjectClassMethods = { 'version', }; +final _logger = Logger('ffigen.code_generator.objc_interface'); + class ObjCInterface extends BindingType { ObjCInterface? superType; - final methods = []; + final methods = {}; bool filled = false; - // Objective C supports overriding class methods, but Dart doesn't support - // overriding static methods. So in our generated Dart code, child classes - // must explicitly implement all the class methods of their super type. To - // help with this, we store the class methods in this map, as well as in the - // methods list. - final classMethods = {}; - final ObjCBuiltInFunctions builtInFunctions; late final ObjCInternalGlobal _classObject; @@ -111,7 +107,7 @@ class ObjCInterface extends BindingType { } // Methods. - for (final m in methods) { + for (final m in methods.values) { final methodName = m._getDartMethodName(uniqueNamer); final isStatic = m.isClass; final returnType = m.returnType!; @@ -145,7 +141,7 @@ class ObjCInterface extends BindingType { } s.write(paramsToString(m.params, isStatic: true)); } else { - if (superType?.hasMethod(m) ?? false) { + if (superType?.methods[m.originalName]?.sameAs(m) ?? false) { s.write('@override\n '); } switch (m.kind) { @@ -221,59 +217,55 @@ class ObjCInterface extends BindingType { _addNSStringMethods(); } - _filterPropertyMethods(); - if (superType != null) { superType!.addDependencies(dependencies); _copyClassMethodsFromSuperType(); } - for (final m in methods) { + for (final m in methods.values) { m.addDependencies(dependencies, builtInFunctions); } } - void _filterPropertyMethods() { - // Properties setters and getters are duplicated in the AST. One copy is - // marked it with ObjCMethodKind.propertyGetter/Setter. The other copy is - // missing important information, and is a plain old instanceMethod. So we - // need to discard the second copy. - final properties = Set.from( - methods.where((m) => m.isProperty).map((m) => m.originalName)); - methods.removeWhere( - (m) => !m.isProperty && properties.contains(m.originalName)); - } - void _copyClassMethodsFromSuperType() { // Copy class methods from the super type, because Dart classes don't // inherit static methods. - for (final m in superType!.classMethods.values) { - if (!_excludedNSObjectClassMethods.contains(m.originalName)) { + for (final m in superType!.methods.values) { + if (m.isClass && + !_excludedNSObjectClassMethods.contains(m.originalName)) { addMethod(m); } } } void addMethod(ObjCMethod method) { - methods.add(method); - if (method.kind == ObjCMethodKind.method && method.isClass) { - classMethods[method.originalName] ??= method; - } - } - - bool hasMethod(ObjCMethod method) { - return methods.any( - (m) => m.originalName == method.originalName && m.kind == method.kind); - } - - void addMethodIfMissing(ObjCMethod method) { - if (!hasMethod(method)) { - addMethod(method); + final oldMethod = methods[method.originalName]; + if (oldMethod != null) { + // Typically we ignore duplicate methods. However, property setters and + // getters are duplicated in the AST. One copy is marked with + // ObjCMethodKind.propertyGetter/Setter. The other copy is missing + // important information, and is a plain old instanceMethod. So if the + // existing method is an instanceMethod, and the new one is a property, + // override it. + if (method.isProperty && !oldMethod.isProperty) { + // Fallthrough. + } else if (!method.isProperty && oldMethod.isProperty) { + // Don't override, but also skip the same method check below. + return; + } else { + // Check duplicate is the same method. + if (!method.sameAs(oldMethod)) { + _logger.severe('Duplicate methods with different signatures: ' + '$originalName.${method.originalName}'); + } + return; + } } + methods[method.originalName] = method; } void _addNSStringMethods() { - addMethodIfMissing(ObjCMethod( + addMethod(ObjCMethod( originalName: 'stringWithCString:encoding:', kind: ObjCMethodKind.method, isClass: true, @@ -283,7 +275,7 @@ class ObjCInterface extends BindingType { ObjCMethodParam(unsignedIntType, 'enc'), ], )); - addMethodIfMissing(ObjCMethod( + addMethod(ObjCMethod( originalName: 'UTF8String', kind: ObjCMethodKind.propertyGetter, isClass: false, @@ -440,6 +432,15 @@ class ObjCMethod { originalName.replaceAll(RegExp(r":$"), "").replaceAll(":", "_"); return uniqueNamer.makeUnique(name); } + + bool sameAs(ObjCMethod other) { + if (originalName != other.originalName) return false; + if (isNullableReturn != other.isNullableReturn) return false; + if (kind != other.kind) return false; + if (isClass != other.isClass) return false; + // msgSend is deduped by signature, so this check covers the signature. + return msgSend == other.msgSend; + } } class ObjCMethodParam { diff --git a/pkgs/ffigen/test/native_objc_test/category_config.yaml b/pkgs/ffigen/test/native_objc_test/category_config.yaml index 24c6c2eaea..92afb061e2 100644 --- a/pkgs/ffigen/test/native_objc_test/category_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/category_config.yaml @@ -8,5 +8,7 @@ functions: headers: entry-points: - 'test/native_objc_test/category_test.m' + # Include it twice, as a regression test for #353 + - 'test/native_objc_test/category_test.m' preamble: | // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart index 29d1652a20..6e0328abe0 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart @@ -8718,6 +8718,12 @@ class NSMutableString extends NSString { return NSMutableString._(_ret, _lib); } + static ffi.Pointer getAvailableStringEncodings( + NativeObjCLibrary _lib) { + return _lib._objc_msgSend_45( + _lib._class_NSMutableString1, _lib._sel_availableStringEncodings1); + } + static NSString localizedNameOfStringEncoding( NativeObjCLibrary _lib, int encoding) { final _ret = _lib._objc_msgSend_14(_lib._class_NSMutableString1, @@ -8725,6 +8731,11 @@ class NSMutableString extends NSString { return NSString._(_ret, _lib); } + static int getDefaultCStringEncoding(NativeObjCLibrary _lib) { + return _lib._objc_msgSend_11( + _lib._class_NSMutableString1, _lib._sel_defaultCStringEncoding1); + } + static NSMutableString string(NativeObjCLibrary _lib) { final _ret = _lib._objc_msgSend_1(_lib._class_NSMutableString1, _lib._sel_string1); @@ -8829,16 +8840,6 @@ class NSMutableString extends NSString { return NSMutableString._(_ret, _lib); } - static void availableStringEncodings(NativeObjCLibrary _lib) { - _lib._objc_msgSend_0( - _lib._class_NSMutableString1, _lib._sel_availableStringEncodings1); - } - - static void defaultCStringEncoding(NativeObjCLibrary _lib) { - _lib._objc_msgSend_0( - _lib._class_NSMutableString1, _lib._sel_defaultCStringEncoding1); - } - static int stringEncodingForData_encodingOptions_convertedString_usedLossyConversion( NativeObjCLibrary _lib, diff --git a/pkgs/ffigen/test/native_objc_test/string_bindings.dart b/pkgs/ffigen/test/native_objc_test/string_bindings.dart index 4614d8e2fc..e742ce0901 100644 --- a/pkgs/ffigen/test/native_objc_test/string_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/string_bindings.dart @@ -9088,6 +9088,12 @@ class NSMutableString extends NSString { return NSMutableString._(_ret, _lib); } + static ffi.Pointer getAvailableStringEncodings( + StringTestObjCLibrary _lib) { + return _lib._objc_msgSend_45( + _lib._class_NSMutableString1, _lib._sel_availableStringEncodings1); + } + static NSString localizedNameOfStringEncoding( StringTestObjCLibrary _lib, int encoding) { final _ret = _lib._objc_msgSend_14(_lib._class_NSMutableString1, @@ -9095,6 +9101,11 @@ class NSMutableString extends NSString { return NSString._(_ret, _lib); } + static int getDefaultCStringEncoding(StringTestObjCLibrary _lib) { + return _lib._objc_msgSend_11( + _lib._class_NSMutableString1, _lib._sel_defaultCStringEncoding1); + } + static NSMutableString string(StringTestObjCLibrary _lib) { final _ret = _lib._objc_msgSend_1(_lib._class_NSMutableString1, _lib._sel_string1); @@ -9199,16 +9210,6 @@ class NSMutableString extends NSString { return NSMutableString._(_ret, _lib); } - static void availableStringEncodings(StringTestObjCLibrary _lib) { - _lib._objc_msgSend_0( - _lib._class_NSMutableString1, _lib._sel_availableStringEncodings1); - } - - static void defaultCStringEncoding(StringTestObjCLibrary _lib) { - _lib._objc_msgSend_0( - _lib._class_NSMutableString1, _lib._sel_defaultCStringEncoding1); - } - static int stringEncodingForData_encodingOptions_convertedString_usedLossyConversion( StringTestObjCLibrary _lib, @@ -9281,6 +9282,12 @@ class NSSimpleCString extends NSString { return NSSimpleCString._(other, lib); } + static ffi.Pointer getAvailableStringEncodings( + StringTestObjCLibrary _lib) { + return _lib._objc_msgSend_45( + _lib._class_NSSimpleCString1, _lib._sel_availableStringEncodings1); + } + static NSString localizedNameOfStringEncoding( StringTestObjCLibrary _lib, int encoding) { final _ret = _lib._objc_msgSend_14(_lib._class_NSSimpleCString1, @@ -9288,6 +9295,11 @@ class NSSimpleCString extends NSString { return NSString._(_ret, _lib); } + static int getDefaultCStringEncoding(StringTestObjCLibrary _lib) { + return _lib._objc_msgSend_11( + _lib._class_NSSimpleCString1, _lib._sel_defaultCStringEncoding1); + } + static NSSimpleCString string(StringTestObjCLibrary _lib) { final _ret = _lib._objc_msgSend_1(_lib._class_NSSimpleCString1, _lib._sel_string1); @@ -9392,16 +9404,6 @@ class NSSimpleCString extends NSString { return NSSimpleCString._(_ret, _lib); } - static void availableStringEncodings(StringTestObjCLibrary _lib) { - _lib._objc_msgSend_0( - _lib._class_NSSimpleCString1, _lib._sel_availableStringEncodings1); - } - - static void defaultCStringEncoding(StringTestObjCLibrary _lib) { - _lib._objc_msgSend_0( - _lib._class_NSSimpleCString1, _lib._sel_defaultCStringEncoding1); - } - static int stringEncodingForData_encodingOptions_convertedString_usedLossyConversion( StringTestObjCLibrary _lib, @@ -9472,6 +9474,12 @@ class NSConstantString extends NSSimpleCString { return NSConstantString._(other, lib); } + static ffi.Pointer getAvailableStringEncodings( + StringTestObjCLibrary _lib) { + return _lib._objc_msgSend_45( + _lib._class_NSConstantString1, _lib._sel_availableStringEncodings1); + } + static NSString localizedNameOfStringEncoding( StringTestObjCLibrary _lib, int encoding) { final _ret = _lib._objc_msgSend_14(_lib._class_NSConstantString1, @@ -9479,6 +9487,11 @@ class NSConstantString extends NSSimpleCString { return NSString._(_ret, _lib); } + static int getDefaultCStringEncoding(StringTestObjCLibrary _lib) { + return _lib._objc_msgSend_11( + _lib._class_NSConstantString1, _lib._sel_defaultCStringEncoding1); + } + static NSConstantString string(StringTestObjCLibrary _lib) { final _ret = _lib._objc_msgSend_1(_lib._class_NSConstantString1, _lib._sel_string1); @@ -9583,16 +9596,6 @@ class NSConstantString extends NSSimpleCString { return NSConstantString._(_ret, _lib); } - static void availableStringEncodings(StringTestObjCLibrary _lib) { - _lib._objc_msgSend_0( - _lib._class_NSConstantString1, _lib._sel_availableStringEncodings1); - } - - static void defaultCStringEncoding(StringTestObjCLibrary _lib) { - _lib._objc_msgSend_0( - _lib._class_NSConstantString1, _lib._sel_defaultCStringEncoding1); - } - static int stringEncodingForData_encodingOptions_convertedString_usedLossyConversion( StringTestObjCLibrary _lib, From 60883c961d0f7c64f6275721432bc8ebad679486 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 11 May 2022 12:45:00 -0700 Subject: [PATCH 134/276] [ffigen] Fix ObjC @class declarations (#352) * WIP: NSData bug repro * Fix forward declaration bug * Remove unused clang_isDeclaration function * Format --- .../sub_parsers/objcinterfacedecl_parser.dart | 27 + .../forward_decl_bindings.dart | 1464 +++++++++++++++++ .../native_objc_test/forward_decl_config.yaml | 13 + .../native_objc_test/forward_decl_test.dart | 57 + .../test/native_objc_test/forward_decl_test.h | 11 + .../test/native_objc_test/forward_decl_test.m | 15 + pkgs/ffigen/test/native_objc_test/setup.dart | 1 + pkgs/ffigen/test/regen.dart | 5 + 8 files changed, 1593 insertions(+) create mode 100644 pkgs/ffigen/test/native_objc_test/forward_decl_bindings.dart create mode 100644 pkgs/ffigen/test/native_objc_test/forward_decl_config.yaml create mode 100644 pkgs/ffigen/test/native_objc_test/forward_decl_test.dart create mode 100644 pkgs/ffigen/test/native_objc_test/forward_decl_test.h create mode 100644 pkgs/ffigen/test/native_objc_test/forward_decl_test.m diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index f30abe5696..03d73252a7 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -58,6 +58,12 @@ Type? parseObjCInterfaceDeclaration( void fillObjCInterfaceMethodsIfNeeded( ObjCInterface itf, clang_types.CXCursor cursor) { + if (_isClassDeclaration(cursor)) { + // @class declarations are ObjC's way of forward declaring classes. In that + // case there's nothing to fill yet. + return; + } + if (itf.filled) return; itf.filled = true; // Break cycles. @@ -75,6 +81,27 @@ void fillObjCInterfaceMethodsIfNeeded( 'Name: ${itf.originalName}, ${cursor.completeStringRepr()}'); } +bool _isClassDeclarationResult = false; +bool _isClassDeclaration(clang_types.CXCursor cursor) { + // It's a class declaration if it has no children other than ObjCClassRef. + _isClassDeclarationResult = true; + clang.clang_visitChildren( + cursor, + Pointer.fromFunction( + _isClassDeclarationVisitor, exceptional_visitor_return), + nullptr); + return _isClassDeclarationResult; +} + +int _isClassDeclarationVisitor(clang_types.CXCursor cursor, + clang_types.CXCursor parent, Pointer clientData) { + if (cursor.kind == clang_types.CXCursorKind.CXCursor_ObjCClassRef) { + return clang_types.CXChildVisitResult.CXChildVisit_Continue; + } + _isClassDeclarationResult = false; + return clang_types.CXChildVisitResult.CXChildVisit_Break; +} + int _parseInterfaceVisitor(clang_types.CXCursor cursor, clang_types.CXCursor parent, Pointer clientData) { switch (cursor.kind) { diff --git a/pkgs/ffigen/test/native_objc_test/forward_decl_bindings.dart b/pkgs/ffigen/test/native_objc_test/forward_decl_bindings.dart new file mode 100644 index 0000000000..f998344d28 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/forward_decl_bindings.dart @@ -0,0 +1,1464 @@ +// ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; + +/// Test that forward declared ObjC classes are correctly filled +class ForwardDeclTestObjCLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + ForwardDeclTestObjCLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + ForwardDeclTestObjCLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + late final ffi.Pointer _NSFoundationVersionNumber = + _lookup('NSFoundationVersionNumber'); + + double get NSFoundationVersionNumber => _NSFoundationVersionNumber.value; + + set NSFoundationVersionNumber(double value) => + _NSFoundationVersionNumber.value = value; + + late final ffi.Pointer _NSNotFound = + _lookup('NSNotFound'); + + int get NSNotFound => _NSNotFound.value; + + set NSNotFound(int value) => _NSNotFound.value = value; + + late final ffi.Pointer _kCFCoreFoundationVersionNumber = + _lookup('kCFCoreFoundationVersionNumber'); + + double get kCFCoreFoundationVersionNumber => + _kCFCoreFoundationVersionNumber.value; + + set kCFCoreFoundationVersionNumber(double value) => + _kCFCoreFoundationVersionNumber.value = value; + + late final ffi.Pointer _kCFNotFound = + _lookup('kCFNotFound'); + + int get kCFNotFound => _kCFNotFound.value; + + set kCFNotFound(int value) => _kCFNotFound.value = value; + + late final ffi.Pointer _kCFNull = _lookup('kCFNull'); + + CFNullRef get kCFNull => _kCFNull.value; + + set kCFNull(CFNullRef value) => _kCFNull.value = value; + + late final ffi.Pointer _kCFAllocatorDefault = + _lookup('kCFAllocatorDefault'); + + CFAllocatorRef get kCFAllocatorDefault => _kCFAllocatorDefault.value; + + set kCFAllocatorDefault(CFAllocatorRef value) => + _kCFAllocatorDefault.value = value; + + late final ffi.Pointer _kCFAllocatorSystemDefault = + _lookup('kCFAllocatorSystemDefault'); + + CFAllocatorRef get kCFAllocatorSystemDefault => + _kCFAllocatorSystemDefault.value; + + set kCFAllocatorSystemDefault(CFAllocatorRef value) => + _kCFAllocatorSystemDefault.value = value; + + late final ffi.Pointer _kCFAllocatorMalloc = + _lookup('kCFAllocatorMalloc'); + + CFAllocatorRef get kCFAllocatorMalloc => _kCFAllocatorMalloc.value; + + set kCFAllocatorMalloc(CFAllocatorRef value) => + _kCFAllocatorMalloc.value = value; + + late final ffi.Pointer _kCFAllocatorMallocZone = + _lookup('kCFAllocatorMallocZone'); + + CFAllocatorRef get kCFAllocatorMallocZone => _kCFAllocatorMallocZone.value; + + set kCFAllocatorMallocZone(CFAllocatorRef value) => + _kCFAllocatorMallocZone.value = value; + + late final ffi.Pointer _kCFAllocatorNull = + _lookup('kCFAllocatorNull'); + + CFAllocatorRef get kCFAllocatorNull => _kCFAllocatorNull.value; + + set kCFAllocatorNull(CFAllocatorRef value) => _kCFAllocatorNull.value = value; + + late final ffi.Pointer _kCFAllocatorUseContext = + _lookup('kCFAllocatorUseContext'); + + CFAllocatorRef get kCFAllocatorUseContext => _kCFAllocatorUseContext.value; + + set kCFAllocatorUseContext(CFAllocatorRef value) => + _kCFAllocatorUseContext.value = value; + + ffi.Pointer _registerName1(String name) { + final cstr = name.toNativeUtf8(); + final sel = _sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; + } + + ffi.Pointer _sel_registerName( + ffi.Pointer str, + ) { + return __sel_registerName( + str, + ); + } + + late final __sel_registerNamePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sel_registerName'); + late final __sel_registerName = __sel_registerNamePtr + .asFunction Function(ffi.Pointer)>(); + + ffi.Pointer _getClass1(String name) { + final cstr = name.toNativeUtf8(); + final clazz = _objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; + } + + ffi.Pointer _objc_getClass( + ffi.Pointer str, + ) { + return __objc_getClass( + str, + ); + } + + late final __objc_getClassPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('objc_getClass'); + late final __objc_getClass = __objc_getClassPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); + + late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); + late final ffi.Pointer _sel_load1 = _registerName1("load"); + void _objc_msgSend_0( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_0( + obj, + sel, + ); + } + + late final __objc_msgSend_0Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_initialize1 = + _registerName1("initialize"); + late final ffi.Pointer _sel_init1 = _registerName1("init"); + instancetype _objc_msgSend_1( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1( + obj, + sel, + ); + } + + late final __objc_msgSend_1Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_new1 = _registerName1("new"); + late final ffi.Pointer _sel_allocWithZone_1 = + _registerName1("allocWithZone:"); + instancetype _objc_msgSend_2( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_2( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_2Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>(); + + late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); + late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); + late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); + late final ffi.Pointer _sel_copy1 = _registerName1("copy"); + late final ffi.Pointer _sel_mutableCopy1 = + _registerName1("mutableCopy"); + late final ffi.Pointer _sel_copyWithZone_1 = + _registerName1("copyWithZone:"); + late final ffi.Pointer _sel_mutableCopyWithZone_1 = + _registerName1("mutableCopyWithZone:"); + late final ffi.Pointer _sel_instancesRespondToSelector_1 = + _registerName1("instancesRespondToSelector:"); + bool _objc_msgSend_3( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_3( + obj, + sel, + aSelector, + ) != + 0; + } + + late final __objc_msgSend_3Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_conformsToProtocol_1 = + _registerName1("conformsToProtocol:"); + bool _objc_msgSend_4( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer protocol, + ) { + return __objc_msgSend_4( + obj, + sel, + protocol, + ) != + 0; + } + + late final __objc_msgSend_4Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_methodForSelector_1 = + _registerName1("methodForSelector:"); + IMP _objc_msgSend_5( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_5( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_5Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_instanceMethodForSelector_1 = + _registerName1("instanceMethodForSelector:"); + late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = + _registerName1("doesNotRecognizeSelector:"); + void _objc_msgSend_6( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_6( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_6Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _sel_forwardingTargetForSelector_1 = + _registerName1("forwardingTargetForSelector:"); + ffi.Pointer _objc_msgSend_7( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_7( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_7Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_forwardInvocation_1 = + _registerName1("forwardInvocation:"); + void _objc_msgSend_8( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anInvocation, + ) { + return __objc_msgSend_8( + obj, + sel, + anInvocation, + ); + } + + late final __objc_msgSend_8Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final ffi.Pointer _class_NSMethodSignature1 = + _getClass1("NSMethodSignature"); + late final ffi.Pointer _sel_methodSignatureForSelector_1 = + _registerName1("methodSignatureForSelector:"); + ffi.Pointer _objc_msgSend_9( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_9( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_9Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = + _registerName1("instanceMethodSignatureForSelector:"); + late final ffi.Pointer _sel_allowsWeakReference1 = + _registerName1("allowsWeakReference"); + bool _objc_msgSend_10( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_10( + obj, + sel, + ) != + 0; + } + + late final __objc_msgSend_10Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_retainWeakReference1 = + _registerName1("retainWeakReference"); + late final ffi.Pointer _sel_isSubclassOfClass_1 = + _registerName1("isSubclassOfClass:"); + late final ffi.Pointer _sel_resolveClassMethod_1 = + _registerName1("resolveClassMethod:"); + late final ffi.Pointer _sel_resolveInstanceMethod_1 = + _registerName1("resolveInstanceMethod:"); + late final ffi.Pointer _sel_hash1 = _registerName1("hash"); + int _objc_msgSend_11( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_11( + obj, + sel, + ); + } + + late final __objc_msgSend_11Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_superclass1 = + _registerName1("superclass"); + late final ffi.Pointer _sel_class1 = _registerName1("class"); + late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); + late final ffi.Pointer _sel_stringWithCString_encoding_1 = + _registerName1("stringWithCString:encoding:"); + ffi.Pointer _objc_msgSend_12( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cString, + int enc, + ) { + return __objc_msgSend_12( + obj, + sel, + cString, + enc, + ); + } + + late final __objc_msgSend_12Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + pkg_ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_UTF8String1 = + _registerName1("UTF8String"); + ffi.Pointer _objc_msgSend_13( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_13( + obj, + sel, + ); + } + + late final __objc_msgSend_13Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_description1 = + _registerName1("description"); + ffi.Pointer _objc_msgSend_14( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_14( + obj, + sel, + ); + } + + late final __objc_msgSend_14Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_debugDescription1 = + _registerName1("debugDescription"); + late final ffi.Pointer _sel_version1 = _registerName1("version"); + int _objc_msgSend_15( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_15( + obj, + sel, + ); + } + + late final __objc_msgSend_15Ptr = _lookup< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_setVersion_1 = + _registerName1("setVersion:"); + void _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + int aVersion, + ) { + return __objc_msgSend_16( + obj, + sel, + aVersion, + ); + } + + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final ffi.Pointer _sel_classForCoder1 = + _registerName1("classForCoder"); + late final ffi.Pointer _sel_replacementObjectForCoder_1 = + _registerName1("replacementObjectForCoder:"); + ffi.Pointer _objc_msgSend_17( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_17( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_17Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = + _registerName1("awakeAfterUsingCoder:"); + late final ffi.Pointer _sel_poseAsClass_1 = + _registerName1("poseAsClass:"); + late final ffi.Pointer _sel_autoContentAccessingProxy1 = + _registerName1("autoContentAccessingProxy"); + late final ffi.Pointer _class_OtherClass1 = + _getClass1("OtherClass"); + late final ffi.Pointer _class_ForwardDeclaredClass1 = + _getClass1("ForwardDeclaredClass"); + late final ffi.Pointer _sel_get1231 = _registerName1("get123"); + int _objc_msgSend_18( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_18( + obj, + sel, + ); + } + + late final __objc_msgSend_18Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final ffi.Pointer _sel_getTheThing1 = + _registerName1("getTheThing"); + ffi.Pointer _objc_msgSend_19( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_19( + obj, + sel, + ); + } + + late final __objc_msgSend_19Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +} + +abstract class NSComparisonResult { + static const int NSOrderedAscending = -1; + static const int NSOrderedSame = 0; + static const int NSOrderedDescending = 1; +} + +abstract class NSEnumerationOptions { + static const int NSEnumerationConcurrent = 1; + static const int NSEnumerationReverse = 2; +} + +abstract class NSSortOptions { + static const int NSSortConcurrent = 1; + static const int NSSortStable = 16; +} + +abstract class NSQualityOfService { + static const int NSQualityOfServiceUserInteractive = 33; + static const int NSQualityOfServiceUserInitiated = 25; + static const int NSQualityOfServiceUtility = 17; + static const int NSQualityOfServiceBackground = 9; + static const int NSQualityOfServiceDefault = -1; +} + +typedef NSInteger = pkg_ffi.Long; + +class __CFString extends ffi.Opaque {} + +abstract class CFComparisonResult { + static const int kCFCompareLessThan = -1; + static const int kCFCompareEqualTo = 0; + static const int kCFCompareGreaterThan = 1; +} + +typedef CFIndex = pkg_ffi.Long; + +class CFRange extends ffi.Struct { + @CFIndex() + external int location; + + @CFIndex() + external int length; +} + +class __CFNull extends ffi.Opaque {} + +typedef CFNullRef = ffi.Pointer<__CFNull>; + +class __CFAllocator extends ffi.Opaque {} + +typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; + +class CFAllocatorContext extends ffi.Struct { + @CFIndex() + external int version; + + external ffi.Pointer info; + + external CFAllocatorRetainCallBack retain; + + external CFAllocatorReleaseCallBack release; + + external CFAllocatorCopyDescriptionCallBack copyDescription; + + external CFAllocatorAllocateCallBack allocate; + + external CFAllocatorReallocateCallBack reallocate; + + external CFAllocatorDeallocateCallBack deallocate; + + external CFAllocatorPreferredSizeCallBack preferredSize; +} + +typedef CFAllocatorRetainCallBack = ffi.Pointer< + ffi.NativeFunction Function(ffi.Pointer)>>; +typedef CFAllocatorReleaseCallBack + = ffi.Pointer)>>; +typedef CFAllocatorCopyDescriptionCallBack = ffi + .Pointer)>>; +typedef CFStringRef = ffi.Pointer<__CFString>; +typedef CFAllocatorAllocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + CFIndex, CFOptionFlags, ffi.Pointer)>>; +typedef CFOptionFlags = pkg_ffi.UnsignedLong; +typedef CFAllocatorReallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, CFIndex, + CFOptionFlags, ffi.Pointer)>>; +typedef CFAllocatorDeallocateCallBack = ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; +typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< + ffi.NativeFunction< + CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; + +class _ObjCWrapper { + final ffi.Pointer _id; + final ForwardDeclTestObjCLibrary _lib; + + _ObjCWrapper._(this._id, this._lib); + + @override + bool operator ==(Object other) { + return other is _ObjCWrapper && _id == other._id; + } + + @override + int get hashCode => _id.hashCode; +} + +class NSObject extends _ObjCWrapper { + NSObject._(ffi.Pointer id, ForwardDeclTestObjCLibrary lib) + : super._(id, lib); + + static NSObject castFrom(T other) { + return NSObject._(other._id, other._lib); + } + + static NSObject castFromPointer( + ForwardDeclTestObjCLibrary lib, ffi.Pointer other) { + return NSObject._(other, lib); + } + + static void load(ForwardDeclTestObjCLibrary _lib) { + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); + } + + static void initialize(ForwardDeclTestObjCLibrary _lib) { + _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); + } + + NSObject init() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); + return NSObject._(_ret, _lib); + } + + static NSObject new1(ForwardDeclTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); + return NSObject._(_ret, _lib); + } + + static NSObject allocWithZone( + ForwardDeclTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static NSObject alloc(ForwardDeclTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); + return NSObject._(_ret, _lib); + } + + void dealloc() { + _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); + } + + void finalize() { + _lib._objc_msgSend_0(_id, _lib._sel_finalize1); + } + + NSObject copy() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); + return NSObject._(_ret, _lib); + } + + NSObject mutableCopy() { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); + return NSObject._(_ret, _lib); + } + + static NSObject copyWithZone( + ForwardDeclTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static NSObject mutableCopyWithZone( + ForwardDeclTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); + return NSObject._(_ret, _lib); + } + + static bool instancesRespondToSelector( + ForwardDeclTestObjCLibrary _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_3(_lib._class_NSObject1, + _lib._sel_instancesRespondToSelector_1, aSelector); + } + + static bool conformsToProtocol( + ForwardDeclTestObjCLibrary _lib, NSObject? protocol) { + return _lib._objc_msgSend_4(_lib._class_NSObject1, + _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); + } + + IMP methodForSelector(ffi.Pointer aSelector) { + return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); + } + + static IMP instanceMethodForSelector( + ForwardDeclTestObjCLibrary _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_5(_lib._class_NSObject1, + _lib._sel_instanceMethodForSelector_1, aSelector); + } + + void doesNotRecognizeSelector(ffi.Pointer aSelector) { + _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); + } + + NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_7( + _id, _lib._sel_forwardingTargetForSelector_1, aSelector); + return NSObject._(_ret, _lib); + } + + void forwardInvocation(NSObject? anInvocation) { + _lib._objc_msgSend_8( + _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); + } + + NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_9( + _id, _lib._sel_methodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + static NSMethodSignature instanceMethodSignatureForSelector( + ForwardDeclTestObjCLibrary _lib, ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, + _lib._sel_instanceMethodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib); + } + + bool allowsWeakReference() { + return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); + } + + bool retainWeakReference() { + return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); + } + + static bool isSubclassOfClass( + ForwardDeclTestObjCLibrary _lib, NSObject aClass) { + return _lib._objc_msgSend_4( + _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); + } + + static bool resolveClassMethod( + ForwardDeclTestObjCLibrary _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); + } + + static bool resolveInstanceMethod( + ForwardDeclTestObjCLibrary _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); + } + + static int hash(ForwardDeclTestObjCLibrary _lib) { + return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); + } + + static NSObject superclass(ForwardDeclTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); + return NSObject._(_ret, _lib); + } + + static NSObject class1(ForwardDeclTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); + return NSObject._(_ret, _lib); + } + + static NSString description(ForwardDeclTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_14(_lib._class_NSObject1, _lib._sel_description1); + return NSString._(_ret, _lib); + } + + static NSString debugDescription(ForwardDeclTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_14( + _lib._class_NSObject1, _lib._sel_debugDescription1); + return NSString._(_ret, _lib); + } + + static int version(ForwardDeclTestObjCLibrary _lib) { + return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); + } + + static void setVersion(ForwardDeclTestObjCLibrary _lib, int aVersion) { + _lib._objc_msgSend_16( + _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); + } + + NSObject get classForCoder { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); + return NSObject._(_ret, _lib); + } + + NSObject replacementObjectForCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + NSObject awakeAfterUsingCoder(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + static void poseAsClass(ForwardDeclTestObjCLibrary _lib, NSObject aClass) { + _lib._objc_msgSend_8( + _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); + } + + NSObject get autoContentAccessingProxy { + final _ret = + _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); + return NSObject._(_ret, _lib); + } + + static int version1(ForwardDeclTestObjCLibrary _lib) { + return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); + } + + static void setVersion1(ForwardDeclTestObjCLibrary _lib, int aVersion) { + _lib._objc_msgSend_16( + _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); + } + + NSObject get classForCoder1 { + final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); + return NSObject._(_ret, _lib); + } + + NSObject replacementObjectForCoder1(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + NSObject awakeAfterUsingCoder1(NSObject? coder) { + final _ret = _lib._objc_msgSend_17( + _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib); + } + + static void poseAsClass1(ForwardDeclTestObjCLibrary _lib, NSObject aClass) { + _lib._objc_msgSend_8( + _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); + } + + NSObject get autoContentAccessingProxy1 { + final _ret = + _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); + return NSObject._(_ret, _lib); + } +} + +class ObjCSel extends ffi.Opaque {} + +class ObjCObject extends ffi.Opaque {} + +typedef instancetype = ffi.Pointer; + +class _NSZone extends ffi.Opaque {} + +typedef IMP = ffi.Pointer>; + +class NSMethodSignature extends _ObjCWrapper { + NSMethodSignature._( + ffi.Pointer id, ForwardDeclTestObjCLibrary lib) + : super._(id, lib); + + static NSMethodSignature castFrom(T other) { + return NSMethodSignature._(other._id, other._lib); + } + + static NSMethodSignature castFromPointer( + ForwardDeclTestObjCLibrary lib, ffi.Pointer other) { + return NSMethodSignature._(other, lib); + } +} + +typedef NSUInteger = pkg_ffi.UnsignedLong; + +class NSString extends _ObjCWrapper { + NSString._(ffi.Pointer id, ForwardDeclTestObjCLibrary lib) + : super._(id, lib); + + static NSString castFrom(T other) { + return NSString._(other._id, other._lib); + } + + static NSString castFromPointer( + ForwardDeclTestObjCLibrary lib, ffi.Pointer other) { + return NSString._(other, lib); + } + + factory NSString(ForwardDeclTestObjCLibrary _lib, String str) { + final cstr = str.toNativeUtf8(); + final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + pkg_ffi.calloc.free(cstr); + return nsstr; + } + + @override + String toString() => (UTF8String).cast().toDartString(); + + static NSString stringWithCString_encoding(ForwardDeclTestObjCLibrary _lib, + ffi.Pointer cString, int enc) { + final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); + return NSString._(_ret, _lib); + } + + ffi.Pointer get UTF8String { + return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); + } +} + +extension StringToNSString on String { + NSString toNSString(ForwardDeclTestObjCLibrary lib) => NSString(lib, this); +} + +class OtherClass extends NSObject { + OtherClass._(ffi.Pointer id, ForwardDeclTestObjCLibrary lib) + : super._(id, lib); + + static OtherClass castFrom(T other) { + return OtherClass._(other._id, other._lib); + } + + static OtherClass castFromPointer( + ForwardDeclTestObjCLibrary lib, ffi.Pointer other) { + return OtherClass._(other, lib); + } + + static ForwardDeclaredClass getTheThing(ForwardDeclTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_19(_lib._class_OtherClass1, _lib._sel_getTheThing1); + return ForwardDeclaredClass._(_ret, _lib); + } + + static OtherClass new1(ForwardDeclTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1(_lib._class_OtherClass1, _lib._sel_new1); + return OtherClass._(_ret, _lib); + } + + static OtherClass alloc(ForwardDeclTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_OtherClass1, _lib._sel_alloc1); + return OtherClass._(_ret, _lib); + } +} + +class ForwardDeclaredClass extends NSObject { + ForwardDeclaredClass._( + ffi.Pointer id, ForwardDeclTestObjCLibrary lib) + : super._(id, lib); + + static ForwardDeclaredClass castFrom(T other) { + return ForwardDeclaredClass._(other._id, other._lib); + } + + static ForwardDeclaredClass castFromPointer( + ForwardDeclTestObjCLibrary lib, ffi.Pointer other) { + return ForwardDeclaredClass._(other, lib); + } + + static int get123(ForwardDeclTestObjCLibrary _lib) { + return _lib._objc_msgSend_18( + _lib._class_ForwardDeclaredClass1, _lib._sel_get1231); + } + + static ForwardDeclaredClass new1(ForwardDeclTestObjCLibrary _lib) { + final _ret = + _lib._objc_msgSend_1(_lib._class_ForwardDeclaredClass1, _lib._sel_new1); + return ForwardDeclaredClass._(_ret, _lib); + } + + static ForwardDeclaredClass alloc(ForwardDeclTestObjCLibrary _lib) { + final _ret = _lib._objc_msgSend_1( + _lib._class_ForwardDeclaredClass1, _lib._sel_alloc1); + return ForwardDeclaredClass._(_ret, _lib); + } +} + +const int NSScannedOption = 1; + +const int NSCollectorDisabledOption = 2; + +const int NS_BLOCKS_AVAILABLE = 1; + +const int __COREFOUNDATION_CFAVAILABILITY__ = 1; + +const int __CF_ENUM_FIXED_IS_AVAILABLE = 1; + +const double NSFoundationVersionNumber10_0 = 397.4; + +const double NSFoundationVersionNumber10_1 = 425.0; + +const double NSFoundationVersionNumber10_1_1 = 425.0; + +const double NSFoundationVersionNumber10_1_2 = 425.0; + +const double NSFoundationVersionNumber10_1_3 = 425.0; + +const double NSFoundationVersionNumber10_1_4 = 425.0; + +const double NSFoundationVersionNumber10_2 = 462.0; + +const double NSFoundationVersionNumber10_2_1 = 462.0; + +const double NSFoundationVersionNumber10_2_2 = 462.0; + +const double NSFoundationVersionNumber10_2_3 = 462.0; + +const double NSFoundationVersionNumber10_2_4 = 462.0; + +const double NSFoundationVersionNumber10_2_5 = 462.0; + +const double NSFoundationVersionNumber10_2_6 = 462.0; + +const double NSFoundationVersionNumber10_2_7 = 462.7; + +const double NSFoundationVersionNumber10_2_8 = 462.7; + +const double NSFoundationVersionNumber10_3 = 500.0; + +const double NSFoundationVersionNumber10_3_1 = 500.0; + +const double NSFoundationVersionNumber10_3_2 = 500.3; + +const double NSFoundationVersionNumber10_3_3 = 500.54; + +const double NSFoundationVersionNumber10_3_4 = 500.56; + +const double NSFoundationVersionNumber10_3_5 = 500.56; + +const double NSFoundationVersionNumber10_3_6 = 500.56; + +const double NSFoundationVersionNumber10_3_7 = 500.56; + +const double NSFoundationVersionNumber10_3_8 = 500.56; + +const double NSFoundationVersionNumber10_3_9 = 500.58; + +const double NSFoundationVersionNumber10_4 = 567.0; + +const double NSFoundationVersionNumber10_4_1 = 567.0; + +const double NSFoundationVersionNumber10_4_2 = 567.12; + +const double NSFoundationVersionNumber10_4_3 = 567.21; + +const double NSFoundationVersionNumber10_4_4_Intel = 567.23; + +const double NSFoundationVersionNumber10_4_4_PowerPC = 567.21; + +const double NSFoundationVersionNumber10_4_5 = 567.25; + +const double NSFoundationVersionNumber10_4_6 = 567.26; + +const double NSFoundationVersionNumber10_4_7 = 567.27; + +const double NSFoundationVersionNumber10_4_8 = 567.28; + +const double NSFoundationVersionNumber10_4_9 = 567.29; + +const double NSFoundationVersionNumber10_4_10 = 567.29; + +const double NSFoundationVersionNumber10_4_11 = 567.36; + +const double NSFoundationVersionNumber10_5 = 677.0; + +const double NSFoundationVersionNumber10_5_1 = 677.1; + +const double NSFoundationVersionNumber10_5_2 = 677.15; + +const double NSFoundationVersionNumber10_5_3 = 677.19; + +const double NSFoundationVersionNumber10_5_4 = 677.19; + +const double NSFoundationVersionNumber10_5_5 = 677.21; + +const double NSFoundationVersionNumber10_5_6 = 677.22; + +const double NSFoundationVersionNumber10_5_7 = 677.24; + +const double NSFoundationVersionNumber10_5_8 = 677.26; + +const double NSFoundationVersionNumber10_6 = 751.0; + +const double NSFoundationVersionNumber10_6_1 = 751.0; + +const double NSFoundationVersionNumber10_6_2 = 751.14; + +const double NSFoundationVersionNumber10_6_3 = 751.21; + +const double NSFoundationVersionNumber10_6_4 = 751.29; + +const double NSFoundationVersionNumber10_6_5 = 751.42; + +const double NSFoundationVersionNumber10_6_6 = 751.53; + +const double NSFoundationVersionNumber10_6_7 = 751.53; + +const double NSFoundationVersionNumber10_6_8 = 751.62; + +const double NSFoundationVersionNumber10_7 = 833.1; + +const double NSFoundationVersionNumber10_7_1 = 833.1; + +const double NSFoundationVersionNumber10_7_2 = 833.2; + +const double NSFoundationVersionNumber10_7_3 = 833.24; + +const double NSFoundationVersionNumber10_7_4 = 833.25; + +const double NSFoundationVersionNumber10_8 = 945.0; + +const double NSFoundationVersionNumber10_8_1 = 945.0; + +const double NSFoundationVersionNumber10_8_2 = 945.11; + +const double NSFoundationVersionNumber10_8_3 = 945.16; + +const double NSFoundationVersionNumber10_8_4 = 945.18; + +const int NSFoundationVersionNumber10_9 = 1056; + +const int NSFoundationVersionNumber10_9_1 = 1056; + +const double NSFoundationVersionNumber10_9_2 = 1056.13; + +const double NSFoundationVersionNumber10_10 = 1151.16; + +const double NSFoundationVersionNumber10_10_1 = 1151.16; + +const double NSFoundationVersionNumber10_10_2 = 1152.14; + +const double NSFoundationVersionNumber10_10_3 = 1153.2; + +const double NSFoundationVersionNumber10_10_4 = 1153.2; + +const int NSFoundationVersionNumber10_10_5 = 1154; + +const int NSFoundationVersionNumber10_10_Max = 1199; + +const int NSFoundationVersionNumber10_11 = 1252; + +const double NSFoundationVersionNumber10_11_1 = 1255.1; + +const double NSFoundationVersionNumber10_11_2 = 1256.1; + +const double NSFoundationVersionNumber10_11_3 = 1256.1; + +const int NSFoundationVersionNumber10_11_4 = 1258; + +const int NSFoundationVersionNumber10_11_Max = 1299; + +const int __COREFOUNDATION_CFBASE__ = 1; + +const int TRUE = 1; + +const int FALSE = 0; + +const double kCFCoreFoundationVersionNumber10_0 = 196.4; + +const double kCFCoreFoundationVersionNumber10_0_3 = 196.5; + +const double kCFCoreFoundationVersionNumber10_1 = 226.0; + +const double kCFCoreFoundationVersionNumber10_1_1 = 226.0; + +const double kCFCoreFoundationVersionNumber10_1_2 = 227.2; + +const double kCFCoreFoundationVersionNumber10_1_3 = 227.2; + +const double kCFCoreFoundationVersionNumber10_1_4 = 227.3; + +const double kCFCoreFoundationVersionNumber10_2 = 263.0; + +const double kCFCoreFoundationVersionNumber10_2_1 = 263.1; + +const double kCFCoreFoundationVersionNumber10_2_2 = 263.1; + +const double kCFCoreFoundationVersionNumber10_2_3 = 263.3; + +const double kCFCoreFoundationVersionNumber10_2_4 = 263.3; + +const double kCFCoreFoundationVersionNumber10_2_5 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_6 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_7 = 263.5; + +const double kCFCoreFoundationVersionNumber10_2_8 = 263.5; + +const double kCFCoreFoundationVersionNumber10_3 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_1 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_2 = 299.0; + +const double kCFCoreFoundationVersionNumber10_3_3 = 299.3; + +const double kCFCoreFoundationVersionNumber10_3_4 = 299.31; + +const double kCFCoreFoundationVersionNumber10_3_5 = 299.31; + +const double kCFCoreFoundationVersionNumber10_3_6 = 299.32; + +const double kCFCoreFoundationVersionNumber10_3_7 = 299.33; + +const double kCFCoreFoundationVersionNumber10_3_8 = 299.33; + +const double kCFCoreFoundationVersionNumber10_3_9 = 299.35; + +const double kCFCoreFoundationVersionNumber10_4 = 368.0; + +const double kCFCoreFoundationVersionNumber10_4_1 = 368.1; + +const double kCFCoreFoundationVersionNumber10_4_2 = 368.11; + +const double kCFCoreFoundationVersionNumber10_4_3 = 368.18; + +const double kCFCoreFoundationVersionNumber10_4_4_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_4_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_5_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_5_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_6_Intel = 368.26; + +const double kCFCoreFoundationVersionNumber10_4_6_PowerPC = 368.25; + +const double kCFCoreFoundationVersionNumber10_4_7 = 368.27; + +const double kCFCoreFoundationVersionNumber10_4_8 = 368.27; + +const double kCFCoreFoundationVersionNumber10_4_9 = 368.28; + +const double kCFCoreFoundationVersionNumber10_4_10 = 368.28; + +const double kCFCoreFoundationVersionNumber10_4_11 = 368.31; + +const double kCFCoreFoundationVersionNumber10_5 = 476.0; + +const double kCFCoreFoundationVersionNumber10_5_1 = 476.0; + +const double kCFCoreFoundationVersionNumber10_5_2 = 476.1; + +const double kCFCoreFoundationVersionNumber10_5_3 = 476.13; + +const double kCFCoreFoundationVersionNumber10_5_4 = 476.14; + +const double kCFCoreFoundationVersionNumber10_5_5 = 476.15; + +const double kCFCoreFoundationVersionNumber10_5_6 = 476.17; + +const double kCFCoreFoundationVersionNumber10_5_7 = 476.18; + +const double kCFCoreFoundationVersionNumber10_5_8 = 476.19; + +const double kCFCoreFoundationVersionNumber10_6 = 550.0; + +const double kCFCoreFoundationVersionNumber10_6_1 = 550.0; + +const double kCFCoreFoundationVersionNumber10_6_2 = 550.13; + +const double kCFCoreFoundationVersionNumber10_6_3 = 550.19; + +const double kCFCoreFoundationVersionNumber10_6_4 = 550.29; + +const double kCFCoreFoundationVersionNumber10_6_5 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_6 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_7 = 550.42; + +const double kCFCoreFoundationVersionNumber10_6_8 = 550.43; + +const double kCFCoreFoundationVersionNumber10_7 = 635.0; + +const double kCFCoreFoundationVersionNumber10_7_1 = 635.0; + +const double kCFCoreFoundationVersionNumber10_7_2 = 635.15; + +const double kCFCoreFoundationVersionNumber10_7_3 = 635.19; + +const double kCFCoreFoundationVersionNumber10_7_4 = 635.21; + +const double kCFCoreFoundationVersionNumber10_7_5 = 635.21; + +const double kCFCoreFoundationVersionNumber10_8 = 744.0; + +const double kCFCoreFoundationVersionNumber10_8_1 = 744.0; + +const double kCFCoreFoundationVersionNumber10_8_2 = 744.12; + +const double kCFCoreFoundationVersionNumber10_8_3 = 744.18; + +const double kCFCoreFoundationVersionNumber10_8_4 = 744.19; + +const double kCFCoreFoundationVersionNumber10_9 = 855.11; + +const double kCFCoreFoundationVersionNumber10_9_1 = 855.11; + +const double kCFCoreFoundationVersionNumber10_9_2 = 855.14; + +const double kCFCoreFoundationVersionNumber10_10 = 1151.16; + +const double kCFCoreFoundationVersionNumber10_10_1 = 1151.16; + +const int kCFCoreFoundationVersionNumber10_10_2 = 1152; + +const double kCFCoreFoundationVersionNumber10_10_3 = 1153.18; + +const double kCFCoreFoundationVersionNumber10_10_4 = 1153.18; + +const double kCFCoreFoundationVersionNumber10_10_5 = 1153.18; + +const int kCFCoreFoundationVersionNumber10_10_Max = 1199; + +const int kCFCoreFoundationVersionNumber10_11 = 1253; + +const double kCFCoreFoundationVersionNumber10_11_1 = 1255.1; + +const double kCFCoreFoundationVersionNumber10_11_2 = 1256.14; + +const double kCFCoreFoundationVersionNumber10_11_3 = 1256.14; + +const double kCFCoreFoundationVersionNumber10_11_4 = 1258.1; + +const int kCFCoreFoundationVersionNumber10_11_Max = 1299; + +const int ISA_PTRAUTH_DISCRIMINATOR = 27361; diff --git a/pkgs/ffigen/test/native_objc_test/forward_decl_config.yaml b/pkgs/ffigen/test/native_objc_test/forward_decl_config.yaml new file mode 100644 index 0000000000..73b0aee095 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/forward_decl_config.yaml @@ -0,0 +1,13 @@ +name: ForwardDeclTestObjCLibrary +description: 'Test that forward declared ObjC classes are correctly filled' +language: objc +output: 'test/native_objc_test/forward_decl_bindings.dart' +functions: + exclude: + - '.*' +headers: + entry-points: + - 'test/native_objc_test/forward_decl_test.h' + - 'test/native_objc_test/forward_decl_test.m' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/forward_decl_test.dart b/pkgs/ffigen/test/native_objc_test/forward_decl_test.dart new file mode 100644 index 0000000000..41b71810d5 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/forward_decl_test.dart @@ -0,0 +1,57 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:ffigen/ffigen.dart'; +import 'package:path/path.dart' as path; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart'; +import '../test_utils.dart'; +import 'forward_decl_bindings.dart'; + +void main() { + late ForwardDeclTestObjCLibrary lib; + + group('forward decl', () { + setUpAll(() { + logWarnings(); + final dylib = File('test/native_objc_test/forward_decl_test.dylib'); + verifySetupFile(dylib); + lib = + ForwardDeclTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); + }); + + test('generate_bindings', () { + final config = Config.fromYaml(loadYaml(File( + path.join('test', 'native_objc_test', 'forward_decl_config.yaml')) + .readAsStringSync()) as YamlMap); + final library = parse(config); + final file = File( + path.join('test', 'debug_generated', 'forward_decl_test.dart'), + ); + library.generateFile(file); + + try { + final actual = file.readAsStringSync(); + final expected = File(path.join(config.output)).readAsStringSync(); + expect(actual, expected); + if (file.existsSync()) { + file.delete(); + } + } catch (e) { + print('Failed test: Debug generated file: ${file.absolute.path}'); + rethrow; + } + }); + + test('Forward declared class', () { + expect(ForwardDeclaredClass.get123(lib), 123); + }); + }); +} diff --git a/pkgs/ffigen/test/native_objc_test/forward_decl_test.h b/pkgs/ffigen/test/native_objc_test/forward_decl_test.h new file mode 100644 index 0000000000..4336b3548d --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/forward_decl_test.h @@ -0,0 +1,11 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#import + +@class ForwardDeclaredClass; + +@interface OtherClass : NSObject ++ (ForwardDeclaredClass*) getTheThing; +@end diff --git a/pkgs/ffigen/test/native_objc_test/forward_decl_test.m b/pkgs/ffigen/test/native_objc_test/forward_decl_test.m new file mode 100644 index 0000000000..69c8f6630f --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/forward_decl_test.m @@ -0,0 +1,15 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#import + +@interface ForwardDeclaredClass : NSObject ++ (int32_t)get123; +@end + +@implementation ForwardDeclaredClass ++ (int32_t)get123 { + return 123; +} +@end diff --git a/pkgs/ffigen/test/native_objc_test/setup.dart b/pkgs/ffigen/test/native_objc_test/setup.dart index 2681389aa3..7485c91c1f 100644 --- a/pkgs/ffigen/test/native_objc_test/setup.dart +++ b/pkgs/ffigen/test/native_objc_test/setup.dart @@ -38,6 +38,7 @@ Future main(List arguments) async { await _buildLib('method_test.m', 'method_test.dylib'); await _buildLib('nullable_test.m', 'nullable_test.dylib'); await _buildLib('property_test.m', 'property_test.dylib'); + await _buildLib('forward_decl_test.m', 'forward_decl_test.dylib'); await _buildLib('string_test.m', 'string_test.dylib'); await _buildLib('block_test.m', 'block_test.dylib'); } diff --git a/pkgs/ffigen/test/regen.dart b/pkgs/ffigen/test/regen.dart index d77d3ca3e9..ff2909eb1a 100644 --- a/pkgs/ffigen/test/regen.dart +++ b/pkgs/ffigen/test/regen.dart @@ -99,6 +99,11 @@ Future main(List args) async { File('test/native_objc_test/property_bindings.dart'), ); + await _regenConfig( + File('test/native_objc_test/forward_decl_config.yaml'), + File('test/native_objc_test/forward_decl_bindings.dart'), + ); + await _regenConfig( File('test/native_objc_test/string_config.yaml'), File('test/native_objc_test/string_bindings.dart'), From 9148781b43d855cdc2757c2de84a1592cced6113 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 11 May 2022 13:03:18 -0700 Subject: [PATCH 135/276] [ffigen] Don't remove trailing underscores from method names (#357) * Don't remove trailing underscores from method names * Merge --- .../objc_built_in_functions.dart | 2 +- .../src/code_generator/objc_interface.dart | 6 +- .../_expected_objc_basic_types_bindings.dart | 45 +- .../_expected_objc_config_bindings.dart | 45 +- .../_expected_objc_interface_bindings.dart | 49 +- .../test/native_objc_test/block_bindings.dart | 49 +- .../test/native_objc_test/block_test.dart | 12 +- .../test/native_objc_test/cast_bindings.dart | 44 +- .../native_objc_test/category_bindings.dart | 48 +- .../test/native_objc_test/category_test.dart | 4 +- .../forward_decl_bindings.dart | 80 +- .../native_objc_test/method_bindings.dart | 55 +- .../test/native_objc_test/method_test.dart | 12 +- .../native_objc_test/native_objc_test.dart | 18 +- .../native_objc_test_bindings.dart | 643 ++++++++-------- .../native_objc_test/nullable_bindings.dart | 50 +- .../test/native_objc_test/nullable_test.dart | 10 +- .../native_objc_test/property_bindings.dart | 44 +- .../native_objc_test/string_bindings.dart | 726 +++++++++--------- .../test/native_objc_test/string_test.dart | 2 +- 20 files changed, 968 insertions(+), 976 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index 7babb2b6d1..ebb48aa1f4 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -176,7 +176,7 @@ class _ObjCWrapper { // Generate a constructor that wraps stringWithCString. s.write(' factory NSString(${w.className} _lib, String str) {\n'); s.write(' final cstr = str.toNativeUtf8();\n'); - s.write(' final nsstr = stringWithCString_encoding(' + s.write(' final nsstr = stringWithCString_encoding_(' '_lib, cstr.cast(), 4 /* UTF8 */);\n'); s.write(' ${w.ffiPkgLibraryPrefix}.calloc.free(cstr);\n'); s.write(' return nsstr;\n'); diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 5c53bda3ea..0879e94542 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -427,10 +427,8 @@ class ObjCMethod { // foo // foo: // foo:someArgName: - // If there is a trailing ':', omit it. Replace all other ':' with '_'. - final name = - originalName.replaceAll(RegExp(r":$"), "").replaceAll(":", "_"); - return uniqueNamer.makeUnique(name); + // So replace all ':' with '_'. + return uniqueNamer.makeUnique(originalName.replaceAll(":", "_")); } bool sameAs(ObjCMethod other) { diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart index b677511666..09b8c87b18 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart @@ -549,7 +549,8 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject allocWithZone(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { + static NSObject allocWithZone_( + NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); return NSObject._(_ret, _lib); @@ -578,62 +579,63 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject copyWithZone(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { + static NSObject copyWithZone_(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); return NSObject._(_ret, _lib); } - static NSObject mutableCopyWithZone( + static NSObject mutableCopyWithZone_( NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); return NSObject._(_ret, _lib); } - static bool instancesRespondToSelector( + static bool instancesRespondToSelector_( NativeLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_3(_lib._class_NSObject1, _lib._sel_instancesRespondToSelector_1, aSelector); } - static bool conformsToProtocol(NativeLibrary _lib, NSObject? protocol) { + static bool conformsToProtocol_(NativeLibrary _lib, NSObject? protocol) { return _lib._objc_msgSend_4(_lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); } - IMP methodForSelector(ffi.Pointer aSelector) { + IMP methodForSelector_(ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); } - static IMP instanceMethodForSelector( + static IMP instanceMethodForSelector_( NativeLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_lib._class_NSObject1, _lib._sel_instanceMethodForSelector_1, aSelector); } - void doesNotRecognizeSelector(ffi.Pointer aSelector) { + void doesNotRecognizeSelector_(ffi.Pointer aSelector) { _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); } - NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_7( _id, _lib._sel_forwardingTargetForSelector_1, aSelector); return NSObject._(_ret, _lib); } - void forwardInvocation(NSObject? anInvocation) { + void forwardInvocation_(NSObject? anInvocation) { _lib._objc_msgSend_8( _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); } - NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + NSMethodSignature methodSignatureForSelector_( + ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9( _id, _lib._sel_methodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static NSMethodSignature instanceMethodSignatureForSelector( + static NSMethodSignature instanceMethodSignatureForSelector_( NativeLibrary _lib, ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, _lib._sel_instanceMethodSignatureForSelector_1, aSelector); @@ -648,17 +650,18 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); } - static bool isSubclassOfClass(NativeLibrary _lib, NSObject aClass) { + static bool isSubclassOfClass_(NativeLibrary _lib, NSObject aClass) { return _lib._objc_msgSend_4( _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); } - static bool resolveClassMethod(NativeLibrary _lib, ffi.Pointer sel) { + static bool resolveClassMethod_( + NativeLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); } - static bool resolveInstanceMethod( + static bool resolveInstanceMethod_( NativeLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); @@ -695,7 +698,7 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); } - static void setVersion(NativeLibrary _lib, int aVersion) { + static void setVersion_(NativeLibrary _lib, int aVersion) { _lib._objc_msgSend_16( _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); } @@ -705,19 +708,19 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - NSObject replacementObjectForCoder(NSObject? coder) { + NSObject replacementObjectForCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_17( _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - NSObject awakeAfterUsingCoder(NSObject? coder) { + NSObject awakeAfterUsingCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_17( _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static void poseAsClass(NativeLibrary _lib, NSObject aClass) { + static void poseAsClass_(NativeLibrary _lib, NSObject aClass) { _lib._objc_msgSend_8( _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); } @@ -769,7 +772,7 @@ class NSString extends _ObjCWrapper { factory NSString(NativeLibrary _lib, String str) { final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); pkg_ffi.calloc.free(cstr); return nsstr; } @@ -777,7 +780,7 @@ class NSString extends _ObjCWrapper { @override String toString() => (UTF8String).cast().toDartString(); - static NSString stringWithCString_encoding( + static NSString stringWithCString_encoding_( NativeLibrary _lib, ffi.Pointer cString, int enc) { final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, _lib._sel_stringWithCString_encoding_1, cString, enc); diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart index 735c0f7cbd..1a57d65aa9 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart @@ -534,7 +534,8 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject allocWithZone(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { + static NSObject allocWithZone_( + NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); return NSObject._(_ret, _lib); @@ -563,62 +564,63 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject copyWithZone(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { + static NSObject copyWithZone_(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); return NSObject._(_ret, _lib); } - static NSObject mutableCopyWithZone( + static NSObject mutableCopyWithZone_( NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); return NSObject._(_ret, _lib); } - static bool instancesRespondToSelector( + static bool instancesRespondToSelector_( NativeLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_3(_lib._class_NSObject1, _lib._sel_instancesRespondToSelector_1, aSelector); } - static bool conformsToProtocol(NativeLibrary _lib, NSObject? protocol) { + static bool conformsToProtocol_(NativeLibrary _lib, NSObject? protocol) { return _lib._objc_msgSend_4(_lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); } - IMP methodForSelector(ffi.Pointer aSelector) { + IMP methodForSelector_(ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); } - static IMP instanceMethodForSelector( + static IMP instanceMethodForSelector_( NativeLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_lib._class_NSObject1, _lib._sel_instanceMethodForSelector_1, aSelector); } - void doesNotRecognizeSelector(ffi.Pointer aSelector) { + void doesNotRecognizeSelector_(ffi.Pointer aSelector) { _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); } - NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_7( _id, _lib._sel_forwardingTargetForSelector_1, aSelector); return NSObject._(_ret, _lib); } - void forwardInvocation(NSObject? anInvocation) { + void forwardInvocation_(NSObject? anInvocation) { _lib._objc_msgSend_8( _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); } - NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + NSMethodSignature methodSignatureForSelector_( + ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9( _id, _lib._sel_methodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static NSMethodSignature instanceMethodSignatureForSelector( + static NSMethodSignature instanceMethodSignatureForSelector_( NativeLibrary _lib, ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, _lib._sel_instanceMethodSignatureForSelector_1, aSelector); @@ -633,17 +635,18 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); } - static bool isSubclassOfClass(NativeLibrary _lib, NSObject aClass) { + static bool isSubclassOfClass_(NativeLibrary _lib, NSObject aClass) { return _lib._objc_msgSend_4( _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); } - static bool resolveClassMethod(NativeLibrary _lib, ffi.Pointer sel) { + static bool resolveClassMethod_( + NativeLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); } - static bool resolveInstanceMethod( + static bool resolveInstanceMethod_( NativeLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); @@ -680,7 +683,7 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); } - static void setVersion(NativeLibrary _lib, int aVersion) { + static void setVersion_(NativeLibrary _lib, int aVersion) { _lib._objc_msgSend_16( _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); } @@ -690,19 +693,19 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - NSObject replacementObjectForCoder(NSObject? coder) { + NSObject replacementObjectForCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_17( _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - NSObject awakeAfterUsingCoder(NSObject? coder) { + NSObject awakeAfterUsingCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_17( _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static void poseAsClass(NativeLibrary _lib, NSObject aClass) { + static void poseAsClass_(NativeLibrary _lib, NSObject aClass) { _lib._objc_msgSend_8( _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); } @@ -754,7 +757,7 @@ class NSString extends _ObjCWrapper { factory NSString(NativeLibrary _lib, String str) { final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); pkg_ffi.calloc.free(cstr); return nsstr; } @@ -762,7 +765,7 @@ class NSString extends _ObjCWrapper { @override String toString() => (UTF8String).cast().toDartString(); - static NSString stringWithCString_encoding( + static NSString stringWithCString_encoding_( NativeLibrary _lib, ffi.Pointer cString, int enc) { final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, _lib._sel_stringWithCString_encoding_1, cString, enc); diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart index 3a91e7bf0a..892dc3b450 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart @@ -630,7 +630,8 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject allocWithZone(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { + static NSObject allocWithZone_( + NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); return NSObject._(_ret, _lib); @@ -659,62 +660,63 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject copyWithZone(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { + static NSObject copyWithZone_(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); return NSObject._(_ret, _lib); } - static NSObject mutableCopyWithZone( + static NSObject mutableCopyWithZone_( NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); return NSObject._(_ret, _lib); } - static bool instancesRespondToSelector( + static bool instancesRespondToSelector_( NativeLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_3(_lib._class_NSObject1, _lib._sel_instancesRespondToSelector_1, aSelector); } - static bool conformsToProtocol(NativeLibrary _lib, NSObject? protocol) { + static bool conformsToProtocol_(NativeLibrary _lib, NSObject? protocol) { return _lib._objc_msgSend_4(_lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); } - IMP methodForSelector(ffi.Pointer aSelector) { + IMP methodForSelector_(ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); } - static IMP instanceMethodForSelector( + static IMP instanceMethodForSelector_( NativeLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_lib._class_NSObject1, _lib._sel_instanceMethodForSelector_1, aSelector); } - void doesNotRecognizeSelector(ffi.Pointer aSelector) { + void doesNotRecognizeSelector_(ffi.Pointer aSelector) { _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); } - NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_7( _id, _lib._sel_forwardingTargetForSelector_1, aSelector); return NSObject._(_ret, _lib); } - void forwardInvocation(NSObject? anInvocation) { + void forwardInvocation_(NSObject? anInvocation) { _lib._objc_msgSend_8( _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); } - NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + NSMethodSignature methodSignatureForSelector_( + ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9( _id, _lib._sel_methodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static NSMethodSignature instanceMethodSignatureForSelector( + static NSMethodSignature instanceMethodSignatureForSelector_( NativeLibrary _lib, ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, _lib._sel_instanceMethodSignatureForSelector_1, aSelector); @@ -729,17 +731,18 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); } - static bool isSubclassOfClass(NativeLibrary _lib, NSObject aClass) { + static bool isSubclassOfClass_(NativeLibrary _lib, NSObject aClass) { return _lib._objc_msgSend_4( _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); } - static bool resolveClassMethod(NativeLibrary _lib, ffi.Pointer sel) { + static bool resolveClassMethod_( + NativeLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); } - static bool resolveInstanceMethod( + static bool resolveInstanceMethod_( NativeLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); @@ -776,7 +779,7 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); } - static void setVersion(NativeLibrary _lib, int aVersion) { + static void setVersion_(NativeLibrary _lib, int aVersion) { _lib._objc_msgSend_16( _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); } @@ -786,19 +789,19 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - NSObject replacementObjectForCoder(NSObject? coder) { + NSObject replacementObjectForCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_17( _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - NSObject awakeAfterUsingCoder(NSObject? coder) { + NSObject awakeAfterUsingCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_17( _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static void poseAsClass(NativeLibrary _lib, NSObject aClass) { + static void poseAsClass_(NativeLibrary _lib, NSObject aClass) { _lib._objc_msgSend_8( _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); } @@ -850,7 +853,7 @@ class NSString extends _ObjCWrapper { factory NSString(NativeLibrary _lib, String str) { final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); pkg_ffi.calloc.free(cstr); return nsstr; } @@ -858,7 +861,7 @@ class NSString extends _ObjCWrapper { @override String toString() => (UTF8String).cast().toDartString(); - static NSString stringWithCString_encoding( + static NSString stringWithCString_encoding_( NativeLibrary _lib, ffi.Pointer cString, int enc) { final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, _lib._sel_stringWithCString_encoding_1, cString, enc); @@ -914,13 +917,13 @@ class Foo extends NSObject { _lib._class_Foo1, _lib._sel_setClassReadWriteProperty_1, value); } - static Foo aClassMethod(NativeLibrary _lib, double someArg) { + static Foo aClassMethod_(NativeLibrary _lib, double someArg) { final _ret = _lib._objc_msgSend_20( _lib._class_Foo1, _lib._sel_aClassMethod_1, someArg); return Foo._(_ret, _lib); } - int anInstanceMethod_withOtherArg(NSObject? someArg, NSObject? otherArg) { + int anInstanceMethod_withOtherArg_(NSObject? someArg, NSObject? otherArg) { return _lib._objc_msgSend_21(_id, _lib._sel_anInstanceMethod_withOtherArg_1, someArg?._id ?? ffi.nullptr, otherArg?._id ?? ffi.nullptr); } diff --git a/pkgs/ffigen/test/native_objc_test/block_bindings.dart b/pkgs/ffigen/test/native_objc_test/block_bindings.dart index 8ae5e4bfe9..b19e4a964b 100644 --- a/pkgs/ffigen/test/native_objc_test/block_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/block_bindings.dart @@ -817,7 +817,7 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject allocWithZone( + static NSObject allocWithZone_( BlockTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); @@ -847,64 +847,65 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject copyWithZone( + static NSObject copyWithZone_( BlockTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); return NSObject._(_ret, _lib); } - static NSObject mutableCopyWithZone( + static NSObject mutableCopyWithZone_( BlockTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); return NSObject._(_ret, _lib); } - static bool instancesRespondToSelector( + static bool instancesRespondToSelector_( BlockTestObjCLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_3(_lib._class_NSObject1, _lib._sel_instancesRespondToSelector_1, aSelector); } - static bool conformsToProtocol( + static bool conformsToProtocol_( BlockTestObjCLibrary _lib, NSObject? protocol) { return _lib._objc_msgSend_4(_lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); } - IMP methodForSelector(ffi.Pointer aSelector) { + IMP methodForSelector_(ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); } - static IMP instanceMethodForSelector( + static IMP instanceMethodForSelector_( BlockTestObjCLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_lib._class_NSObject1, _lib._sel_instanceMethodForSelector_1, aSelector); } - void doesNotRecognizeSelector(ffi.Pointer aSelector) { + void doesNotRecognizeSelector_(ffi.Pointer aSelector) { _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); } - NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_7( _id, _lib._sel_forwardingTargetForSelector_1, aSelector); return NSObject._(_ret, _lib); } - void forwardInvocation(NSObject? anInvocation) { + void forwardInvocation_(NSObject? anInvocation) { _lib._objc_msgSend_8( _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); } - NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + NSMethodSignature methodSignatureForSelector_( + ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9( _id, _lib._sel_methodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static NSMethodSignature instanceMethodSignatureForSelector( + static NSMethodSignature instanceMethodSignatureForSelector_( BlockTestObjCLibrary _lib, ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, _lib._sel_instanceMethodSignatureForSelector_1, aSelector); @@ -919,18 +920,18 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); } - static bool isSubclassOfClass(BlockTestObjCLibrary _lib, NSObject aClass) { + static bool isSubclassOfClass_(BlockTestObjCLibrary _lib, NSObject aClass) { return _lib._objc_msgSend_4( _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); } - static bool resolveClassMethod( + static bool resolveClassMethod_( BlockTestObjCLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); } - static bool resolveInstanceMethod( + static bool resolveInstanceMethod_( BlockTestObjCLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); @@ -967,7 +968,7 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); } - static void setVersion(BlockTestObjCLibrary _lib, int aVersion) { + static void setVersion_(BlockTestObjCLibrary _lib, int aVersion) { _lib._objc_msgSend_16( _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); } @@ -977,19 +978,19 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - NSObject replacementObjectForCoder(NSObject? coder) { + NSObject replacementObjectForCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_17( _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - NSObject awakeAfterUsingCoder(NSObject? coder) { + NSObject awakeAfterUsingCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_17( _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static void poseAsClass(BlockTestObjCLibrary _lib, NSObject aClass) { + static void poseAsClass_(BlockTestObjCLibrary _lib, NSObject aClass) { _lib._objc_msgSend_8( _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); } @@ -1042,7 +1043,7 @@ class NSString extends _ObjCWrapper { factory NSString(BlockTestObjCLibrary _lib, String str) { final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); pkg_ffi.calloc.free(cstr); return nsstr; } @@ -1050,7 +1051,7 @@ class NSString extends _ObjCWrapper { @override String toString() => (UTF8String).cast().toDartString(); - static NSString stringWithCString_encoding( + static NSString stringWithCString_encoding_( BlockTestObjCLibrary _lib, ffi.Pointer cString, int enc) { final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, _lib._sel_stringWithCString_encoding_1, cString, enc); @@ -1079,19 +1080,19 @@ class BlockTester extends NSObject { return BlockTester._(other, lib); } - static BlockTester makeFromBlock(BlockTestObjCLibrary _lib, IntBlock block) { + static BlockTester makeFromBlock_(BlockTestObjCLibrary _lib, IntBlock block) { final _ret = _lib._objc_msgSend_18( _lib._class_BlockTester1, _lib._sel_makeFromBlock_1, block); return BlockTester._(_ret, _lib); } - static BlockTester makeFromMultiplier(BlockTestObjCLibrary _lib, int mult) { + static BlockTester makeFromMultiplier_(BlockTestObjCLibrary _lib, int mult) { final _ret = _lib._objc_msgSend_19( _lib._class_BlockTester1, _lib._sel_makeFromMultiplier_1, mult); return BlockTester._(_ret, _lib); } - int call(int x) { + int call_(int x) { return _lib._objc_msgSend_20(_id, _lib._sel_call_1, x); } diff --git a/pkgs/ffigen/test/native_objc_test/block_test.dart b/pkgs/ffigen/test/native_objc_test/block_test.dart index 767404eae4..7d19a9d2e3 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.dart +++ b/pkgs/ffigen/test/native_objc_test/block_test.dart @@ -52,18 +52,18 @@ void main() { test('BlockTester is working', () { // This doesn't test any Block functionality, just that the BlockTester // itself is working correctly. - final blockTester = BlockTester.makeFromMultiplier(lib, 10); - expect(blockTester.call(123), 1230); + final blockTester = BlockTester.makeFromMultiplier_(lib, 10); + expect(blockTester.call_(123), 1230); final intBlock = blockTester.getBlock(); - final blockTester2 = BlockTester.makeFromBlock(lib, intBlock); - expect(blockTester2.call(456), 4560); + final blockTester2 = BlockTester.makeFromBlock_(lib, intBlock); + expect(blockTester2.call_(456), 4560); }); test('Block from function pointer', () { final block = ObjCBlock.fromFunctionPointer( lib, Pointer.fromFunction(_add100, 999)); - final blockTester = BlockTester.makeFromBlock(lib, block.pointer); - expect(blockTester.call(123), 223); + final blockTester = BlockTester.makeFromBlock_(lib, block.pointer); + expect(blockTester.call_(123), 223); }); }); } diff --git a/pkgs/ffigen/test/native_objc_test/cast_bindings.dart b/pkgs/ffigen/test/native_objc_test/cast_bindings.dart index bbee960754..ab3dd4c127 100644 --- a/pkgs/ffigen/test/native_objc_test/cast_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/cast_bindings.dart @@ -755,7 +755,7 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject allocWithZone( + static NSObject allocWithZone_( CastTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); @@ -785,63 +785,65 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject copyWithZone( + static NSObject copyWithZone_( CastTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); return NSObject._(_ret, _lib); } - static NSObject mutableCopyWithZone( + static NSObject mutableCopyWithZone_( CastTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); return NSObject._(_ret, _lib); } - static bool instancesRespondToSelector( + static bool instancesRespondToSelector_( CastTestObjCLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_3(_lib._class_NSObject1, _lib._sel_instancesRespondToSelector_1, aSelector); } - static bool conformsToProtocol(CastTestObjCLibrary _lib, NSObject? protocol) { + static bool conformsToProtocol_( + CastTestObjCLibrary _lib, NSObject? protocol) { return _lib._objc_msgSend_4(_lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); } - IMP methodForSelector(ffi.Pointer aSelector) { + IMP methodForSelector_(ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); } - static IMP instanceMethodForSelector( + static IMP instanceMethodForSelector_( CastTestObjCLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_lib._class_NSObject1, _lib._sel_instanceMethodForSelector_1, aSelector); } - void doesNotRecognizeSelector(ffi.Pointer aSelector) { + void doesNotRecognizeSelector_(ffi.Pointer aSelector) { _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); } - NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_7( _id, _lib._sel_forwardingTargetForSelector_1, aSelector); return NSObject._(_ret, _lib); } - void forwardInvocation(NSObject? anInvocation) { + void forwardInvocation_(NSObject? anInvocation) { _lib._objc_msgSend_8( _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); } - NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + NSMethodSignature methodSignatureForSelector_( + ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9( _id, _lib._sel_methodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static NSMethodSignature instanceMethodSignatureForSelector( + static NSMethodSignature instanceMethodSignatureForSelector_( CastTestObjCLibrary _lib, ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, _lib._sel_instanceMethodSignatureForSelector_1, aSelector); @@ -856,18 +858,18 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); } - static bool isSubclassOfClass(CastTestObjCLibrary _lib, NSObject aClass) { + static bool isSubclassOfClass_(CastTestObjCLibrary _lib, NSObject aClass) { return _lib._objc_msgSend_4( _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); } - static bool resolveClassMethod( + static bool resolveClassMethod_( CastTestObjCLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); } - static bool resolveInstanceMethod( + static bool resolveInstanceMethod_( CastTestObjCLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); @@ -904,7 +906,7 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); } - static void setVersion(CastTestObjCLibrary _lib, int aVersion) { + static void setVersion_(CastTestObjCLibrary _lib, int aVersion) { _lib._objc_msgSend_16( _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); } @@ -914,19 +916,19 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - NSObject replacementObjectForCoder(NSObject? coder) { + NSObject replacementObjectForCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_17( _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - NSObject awakeAfterUsingCoder(NSObject? coder) { + NSObject awakeAfterUsingCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_17( _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static void poseAsClass(CastTestObjCLibrary _lib, NSObject aClass) { + static void poseAsClass_(CastTestObjCLibrary _lib, NSObject aClass) { _lib._objc_msgSend_8( _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); } @@ -979,7 +981,7 @@ class NSString extends _ObjCWrapper { factory NSString(CastTestObjCLibrary _lib, String str) { final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); pkg_ffi.calloc.free(cstr); return nsstr; } @@ -987,7 +989,7 @@ class NSString extends _ObjCWrapper { @override String toString() => (UTF8String).cast().toDartString(); - static NSString stringWithCString_encoding( + static NSString stringWithCString_encoding_( CastTestObjCLibrary _lib, ffi.Pointer cString, int enc) { final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, _lib._sel_stringWithCString_encoding_1, cString, enc); diff --git a/pkgs/ffigen/test/native_objc_test/category_bindings.dart b/pkgs/ffigen/test/native_objc_test/category_bindings.dart index c878d11ce9..1dbc709012 100644 --- a/pkgs/ffigen/test/native_objc_test/category_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/category_bindings.dart @@ -741,7 +741,7 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject allocWithZone( + static NSObject allocWithZone_( CategoryTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); @@ -771,64 +771,65 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject copyWithZone( + static NSObject copyWithZone_( CategoryTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); return NSObject._(_ret, _lib); } - static NSObject mutableCopyWithZone( + static NSObject mutableCopyWithZone_( CategoryTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); return NSObject._(_ret, _lib); } - static bool instancesRespondToSelector( + static bool instancesRespondToSelector_( CategoryTestObjCLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_3(_lib._class_NSObject1, _lib._sel_instancesRespondToSelector_1, aSelector); } - static bool conformsToProtocol( + static bool conformsToProtocol_( CategoryTestObjCLibrary _lib, NSObject? protocol) { return _lib._objc_msgSend_4(_lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); } - IMP methodForSelector(ffi.Pointer aSelector) { + IMP methodForSelector_(ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); } - static IMP instanceMethodForSelector( + static IMP instanceMethodForSelector_( CategoryTestObjCLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_lib._class_NSObject1, _lib._sel_instanceMethodForSelector_1, aSelector); } - void doesNotRecognizeSelector(ffi.Pointer aSelector) { + void doesNotRecognizeSelector_(ffi.Pointer aSelector) { _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); } - NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_7( _id, _lib._sel_forwardingTargetForSelector_1, aSelector); return NSObject._(_ret, _lib); } - void forwardInvocation(NSObject? anInvocation) { + void forwardInvocation_(NSObject? anInvocation) { _lib._objc_msgSend_8( _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); } - NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + NSMethodSignature methodSignatureForSelector_( + ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9( _id, _lib._sel_methodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static NSMethodSignature instanceMethodSignatureForSelector( + static NSMethodSignature instanceMethodSignatureForSelector_( CategoryTestObjCLibrary _lib, ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, _lib._sel_instanceMethodSignatureForSelector_1, aSelector); @@ -843,18 +844,19 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); } - static bool isSubclassOfClass(CategoryTestObjCLibrary _lib, NSObject aClass) { + static bool isSubclassOfClass_( + CategoryTestObjCLibrary _lib, NSObject aClass) { return _lib._objc_msgSend_4( _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); } - static bool resolveClassMethod( + static bool resolveClassMethod_( CategoryTestObjCLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); } - static bool resolveInstanceMethod( + static bool resolveInstanceMethod_( CategoryTestObjCLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); @@ -891,7 +893,7 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); } - static void setVersion(CategoryTestObjCLibrary _lib, int aVersion) { + static void setVersion_(CategoryTestObjCLibrary _lib, int aVersion) { _lib._objc_msgSend_16( _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); } @@ -901,19 +903,19 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - NSObject replacementObjectForCoder(NSObject? coder) { + NSObject replacementObjectForCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_17( _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - NSObject awakeAfterUsingCoder(NSObject? coder) { + NSObject awakeAfterUsingCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_17( _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static void poseAsClass(CategoryTestObjCLibrary _lib, NSObject aClass) { + static void poseAsClass_(CategoryTestObjCLibrary _lib, NSObject aClass) { _lib._objc_msgSend_8( _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); } @@ -966,7 +968,7 @@ class NSString extends _ObjCWrapper { factory NSString(CategoryTestObjCLibrary _lib, String str) { final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); pkg_ffi.calloc.free(cstr); return nsstr; } @@ -974,7 +976,7 @@ class NSString extends _ObjCWrapper { @override String toString() => (UTF8String).cast().toDartString(); - static NSString stringWithCString_encoding(CategoryTestObjCLibrary _lib, + static NSString stringWithCString_encoding_(CategoryTestObjCLibrary _lib, ffi.Pointer cString, int enc) { final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, _lib._sel_stringWithCString_encoding_1, cString, enc); @@ -1003,11 +1005,11 @@ class Thing extends NSObject { return Thing._(other, lib); } - int add_Y(int x, int y) { + int add_Y_(int x, int y) { return _lib._objc_msgSend_18(_id, _lib._sel_add_Y_1, x, y); } - int sub_Y(int x, int y) { + int sub_Y_(int x, int y) { return _lib._objc_msgSend_18(_id, _lib._sel_sub_Y_1, x, y); } diff --git a/pkgs/ffigen/test/native_objc_test/category_test.dart b/pkgs/ffigen/test/native_objc_test/category_test.dart index fdfad4a59e..9ad949d638 100644 --- a/pkgs/ffigen/test/native_objc_test/category_test.dart +++ b/pkgs/ffigen/test/native_objc_test/category_test.dart @@ -52,8 +52,8 @@ void main() { }); test('Category method', () { - expect(testInstance.add_Y(1000, 234), 1234); - expect(testInstance.sub_Y(1234, 1000), 234); + expect(testInstance.add_Y_(1000, 234), 1234); + expect(testInstance.sub_Y_(1234, 1000), 234); }); }); } diff --git a/pkgs/ffigen/test/native_objc_test/forward_decl_bindings.dart b/pkgs/ffigen/test/native_objc_test/forward_decl_bindings.dart index f998344d28..c9edf543be 100644 --- a/pkgs/ffigen/test/native_objc_test/forward_decl_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/forward_decl_bindings.dart @@ -758,7 +758,7 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject allocWithZone( + static NSObject allocWithZone_( ForwardDeclTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); @@ -788,64 +788,65 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject copyWithZone( + static NSObject copyWithZone_( ForwardDeclTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); return NSObject._(_ret, _lib); } - static NSObject mutableCopyWithZone( + static NSObject mutableCopyWithZone_( ForwardDeclTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); return NSObject._(_ret, _lib); } - static bool instancesRespondToSelector( + static bool instancesRespondToSelector_( ForwardDeclTestObjCLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_3(_lib._class_NSObject1, _lib._sel_instancesRespondToSelector_1, aSelector); } - static bool conformsToProtocol( + static bool conformsToProtocol_( ForwardDeclTestObjCLibrary _lib, NSObject? protocol) { return _lib._objc_msgSend_4(_lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); } - IMP methodForSelector(ffi.Pointer aSelector) { + IMP methodForSelector_(ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); } - static IMP instanceMethodForSelector( + static IMP instanceMethodForSelector_( ForwardDeclTestObjCLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_lib._class_NSObject1, _lib._sel_instanceMethodForSelector_1, aSelector); } - void doesNotRecognizeSelector(ffi.Pointer aSelector) { + void doesNotRecognizeSelector_(ffi.Pointer aSelector) { _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); } - NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_7( _id, _lib._sel_forwardingTargetForSelector_1, aSelector); return NSObject._(_ret, _lib); } - void forwardInvocation(NSObject? anInvocation) { + void forwardInvocation_(NSObject? anInvocation) { _lib._objc_msgSend_8( _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); } - NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + NSMethodSignature methodSignatureForSelector_( + ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9( _id, _lib._sel_methodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static NSMethodSignature instanceMethodSignatureForSelector( + static NSMethodSignature instanceMethodSignatureForSelector_( ForwardDeclTestObjCLibrary _lib, ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, _lib._sel_instanceMethodSignatureForSelector_1, aSelector); @@ -860,19 +861,19 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); } - static bool isSubclassOfClass( + static bool isSubclassOfClass_( ForwardDeclTestObjCLibrary _lib, NSObject aClass) { return _lib._objc_msgSend_4( _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); } - static bool resolveClassMethod( + static bool resolveClassMethod_( ForwardDeclTestObjCLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); } - static bool resolveInstanceMethod( + static bool resolveInstanceMethod_( ForwardDeclTestObjCLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); @@ -909,7 +910,7 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); } - static void setVersion(ForwardDeclTestObjCLibrary _lib, int aVersion) { + static void setVersion_(ForwardDeclTestObjCLibrary _lib, int aVersion) { _lib._objc_msgSend_16( _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); } @@ -919,19 +920,19 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - NSObject replacementObjectForCoder(NSObject? coder) { + NSObject replacementObjectForCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_17( _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - NSObject awakeAfterUsingCoder(NSObject? coder) { + NSObject awakeAfterUsingCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_17( _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static void poseAsClass(ForwardDeclTestObjCLibrary _lib, NSObject aClass) { + static void poseAsClass_(ForwardDeclTestObjCLibrary _lib, NSObject aClass) { _lib._objc_msgSend_8( _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); } @@ -941,43 +942,6 @@ class NSObject extends _ObjCWrapper { _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); return NSObject._(_ret, _lib); } - - static int version1(ForwardDeclTestObjCLibrary _lib) { - return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); - } - - static void setVersion1(ForwardDeclTestObjCLibrary _lib, int aVersion) { - _lib._objc_msgSend_16( - _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); - } - - NSObject get classForCoder1 { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); - return NSObject._(_ret, _lib); - } - - NSObject replacementObjectForCoder1(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - NSObject awakeAfterUsingCoder1(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static void poseAsClass1(ForwardDeclTestObjCLibrary _lib, NSObject aClass) { - _lib._objc_msgSend_8( - _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); - } - - NSObject get autoContentAccessingProxy1 { - final _ret = - _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); - return NSObject._(_ret, _lib); - } } class ObjCSel extends ffi.Opaque {} @@ -1022,7 +986,7 @@ class NSString extends _ObjCWrapper { factory NSString(ForwardDeclTestObjCLibrary _lib, String str) { final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); pkg_ffi.calloc.free(cstr); return nsstr; } @@ -1030,7 +994,7 @@ class NSString extends _ObjCWrapper { @override String toString() => (UTF8String).cast().toDartString(); - static NSString stringWithCString_encoding(ForwardDeclTestObjCLibrary _lib, + static NSString stringWithCString_encoding_(ForwardDeclTestObjCLibrary _lib, ffi.Pointer cString, int enc) { final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, _lib._sel_stringWithCString_encoding_1, cString, enc); diff --git a/pkgs/ffigen/test/native_objc_test/method_bindings.dart b/pkgs/ffigen/test/native_objc_test/method_bindings.dart index f20ce96360..2a8ac1fd5b 100644 --- a/pkgs/ffigen/test/native_objc_test/method_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/method_bindings.dart @@ -808,7 +808,7 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject allocWithZone( + static NSObject allocWithZone_( MethodTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); @@ -838,64 +838,65 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject copyWithZone( + static NSObject copyWithZone_( MethodTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); return NSObject._(_ret, _lib); } - static NSObject mutableCopyWithZone( + static NSObject mutableCopyWithZone_( MethodTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); return NSObject._(_ret, _lib); } - static bool instancesRespondToSelector( + static bool instancesRespondToSelector_( MethodTestObjCLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_3(_lib._class_NSObject1, _lib._sel_instancesRespondToSelector_1, aSelector); } - static bool conformsToProtocol( + static bool conformsToProtocol_( MethodTestObjCLibrary _lib, NSObject? protocol) { return _lib._objc_msgSend_4(_lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); } - IMP methodForSelector(ffi.Pointer aSelector) { + IMP methodForSelector_(ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); } - static IMP instanceMethodForSelector( + static IMP instanceMethodForSelector_( MethodTestObjCLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_lib._class_NSObject1, _lib._sel_instanceMethodForSelector_1, aSelector); } - void doesNotRecognizeSelector(ffi.Pointer aSelector) { + void doesNotRecognizeSelector_(ffi.Pointer aSelector) { _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); } - NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_7( _id, _lib._sel_forwardingTargetForSelector_1, aSelector); return NSObject._(_ret, _lib); } - void forwardInvocation(NSObject? anInvocation) { + void forwardInvocation_(NSObject? anInvocation) { _lib._objc_msgSend_8( _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); } - NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + NSMethodSignature methodSignatureForSelector_( + ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9( _id, _lib._sel_methodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static NSMethodSignature instanceMethodSignatureForSelector( + static NSMethodSignature instanceMethodSignatureForSelector_( MethodTestObjCLibrary _lib, ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, _lib._sel_instanceMethodSignatureForSelector_1, aSelector); @@ -910,18 +911,18 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); } - static bool isSubclassOfClass(MethodTestObjCLibrary _lib, NSObject aClass) { + static bool isSubclassOfClass_(MethodTestObjCLibrary _lib, NSObject aClass) { return _lib._objc_msgSend_4( _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); } - static bool resolveClassMethod( + static bool resolveClassMethod_( MethodTestObjCLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); } - static bool resolveInstanceMethod( + static bool resolveInstanceMethod_( MethodTestObjCLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); @@ -958,7 +959,7 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); } - static void setVersion(MethodTestObjCLibrary _lib, int aVersion) { + static void setVersion_(MethodTestObjCLibrary _lib, int aVersion) { _lib._objc_msgSend_16( _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); } @@ -968,19 +969,19 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - NSObject replacementObjectForCoder(NSObject? coder) { + NSObject replacementObjectForCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_17( _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - NSObject awakeAfterUsingCoder(NSObject? coder) { + NSObject awakeAfterUsingCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_17( _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static void poseAsClass(MethodTestObjCLibrary _lib, NSObject aClass) { + static void poseAsClass_(MethodTestObjCLibrary _lib, NSObject aClass) { _lib._objc_msgSend_8( _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); } @@ -1033,7 +1034,7 @@ class NSString extends _ObjCWrapper { factory NSString(MethodTestObjCLibrary _lib, String str) { final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); pkg_ffi.calloc.free(cstr); return nsstr; } @@ -1041,7 +1042,7 @@ class NSString extends _ObjCWrapper { @override String toString() => (UTF8String).cast().toDartString(); - static NSString stringWithCString_encoding( + static NSString stringWithCString_encoding_( MethodTestObjCLibrary _lib, ffi.Pointer cString, int enc) { final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, _lib._sel_stringWithCString_encoding_1, cString, enc); @@ -1074,15 +1075,15 @@ class MethodInterface extends NSObject { return _lib._objc_msgSend_18(_id, _lib._sel_add1); } - int add1(int x) { + int add_(int x) { return _lib._objc_msgSend_19(_id, _lib._sel_add_1, x); } - int add_Y(int x, int y) { + int add_Y_(int x, int y) { return _lib._objc_msgSend_20(_id, _lib._sel_add_Y_1, x, y); } - int add_Y_Z(int x, int y, int z) { + int add_Y_Z_(int x, int y, int z) { return _lib._objc_msgSend_21(_id, _lib._sel_add_Y_Z_1, x, y, z); } @@ -1090,17 +1091,17 @@ class MethodInterface extends NSObject { return _lib._objc_msgSend_18(_lib._class_MethodInterface1, _lib._sel_sub1); } - static int sub1(MethodTestObjCLibrary _lib, int x) { + static int sub_(MethodTestObjCLibrary _lib, int x) { return _lib._objc_msgSend_19( _lib._class_MethodInterface1, _lib._sel_sub_1, x); } - static int sub_Y(MethodTestObjCLibrary _lib, int x, int y) { + static int sub_Y_(MethodTestObjCLibrary _lib, int x, int y) { return _lib._objc_msgSend_20( _lib._class_MethodInterface1, _lib._sel_sub_Y_1, x, y); } - static int sub_Y_Z(MethodTestObjCLibrary _lib, int x, int y, int z) { + static int sub_Y_Z_(MethodTestObjCLibrary _lib, int x, int y, int z) { return _lib._objc_msgSend_21( _lib._class_MethodInterface1, _lib._sel_sub_Y_Z_1, x, y, z); } diff --git a/pkgs/ffigen/test/native_objc_test/method_test.dart b/pkgs/ffigen/test/native_objc_test/method_test.dart index d6c29902d1..40c3a3475f 100644 --- a/pkgs/ffigen/test/native_objc_test/method_test.dart +++ b/pkgs/ffigen/test/native_objc_test/method_test.dart @@ -57,15 +57,15 @@ void main() { }); test('One argument', () { - expect(testInstance.add1(23), 23); + expect(testInstance.add_(23), 23); }); test('Two arguments', () { - expect(testInstance.add_Y(23, 17), 40); + expect(testInstance.add_Y_(23, 17), 40); }); test('Three arguments', () { - expect(testInstance.add_Y_Z(23, 17, 60), 100); + expect(testInstance.add_Y_Z_(23, 17, 60), 100); }); }); @@ -75,15 +75,15 @@ void main() { }); test('One argument', () { - expect(MethodInterface.sub1(lib, 7), -7); + expect(MethodInterface.sub_(lib, 7), -7); }); test('Two arguments', () { - expect(MethodInterface.sub_Y(lib, 7, 3), -10); + expect(MethodInterface.sub_Y_(lib, 7, 3), -10); }); test('Three arguments', () { - expect(MethodInterface.sub_Y_Z(lib, 10, 7, 3), -20); + expect(MethodInterface.sub_Y_Z_(lib, 10, 7, 3), -20); }); }); }); diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart index b1b9eed92b..cb2603f2bb 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart @@ -49,22 +49,22 @@ void main() { }); test('Interface basics, with Foo', () { - final foo1 = Foo.makeFoo(lib, 3.14159); - final foo2 = Foo.makeFoo(lib, 2.71828); + final foo1 = Foo.makeFoo_(lib, 3.14159); + final foo2 = Foo.makeFoo_(lib, 2.71828); expect(foo1.intVal, 3); expect(foo2.intVal, 2); - expect(foo1.multiply_withOtherFoo(false, foo2), 8); - expect(foo1.multiply_withOtherFoo(true, foo2), 6); + expect(foo1.multiply_withOtherFoo_(false, foo2), 8); + expect(foo1.multiply_withOtherFoo_(true, foo2), 6); foo1.intVal = 100; - expect(foo1.multiply_withOtherFoo(false, foo2), 8); - expect(foo1.multiply_withOtherFoo(true, foo2), 200); + expect(foo1.multiply_withOtherFoo_(false, foo2), 8); + expect(foo1.multiply_withOtherFoo_(true, foo2), 200); - foo2.setDoubleVal(1.61803); - expect(foo1.multiply_withOtherFoo(false, foo2), 5); - expect(foo1.multiply_withOtherFoo(true, foo2), 200); + foo2.setDoubleVal_(1.61803); + expect(foo1.multiply_withOtherFoo_(false, foo2), 5); + expect(foo1.multiply_withOtherFoo_(true, foo2), 200); }); }); } diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart index 6e0328abe0..82c254a3bf 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart @@ -5311,7 +5311,7 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject allocWithZone( + static NSObject allocWithZone_( NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); @@ -5341,63 +5341,64 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject copyWithZone( + static NSObject copyWithZone_( NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); return NSObject._(_ret, _lib); } - static NSObject mutableCopyWithZone( + static NSObject mutableCopyWithZone_( NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); return NSObject._(_ret, _lib); } - static bool instancesRespondToSelector( + static bool instancesRespondToSelector_( NativeObjCLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_3(_lib._class_NSObject1, _lib._sel_instancesRespondToSelector_1, aSelector); } - static bool conformsToProtocol(NativeObjCLibrary _lib, NSObject? protocol) { + static bool conformsToProtocol_(NativeObjCLibrary _lib, NSObject? protocol) { return _lib._objc_msgSend_4(_lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); } - IMP methodForSelector(ffi.Pointer aSelector) { + IMP methodForSelector_(ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); } - static IMP instanceMethodForSelector( + static IMP instanceMethodForSelector_( NativeObjCLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_lib._class_NSObject1, _lib._sel_instanceMethodForSelector_1, aSelector); } - void doesNotRecognizeSelector(ffi.Pointer aSelector) { + void doesNotRecognizeSelector_(ffi.Pointer aSelector) { _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); } - NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_7( _id, _lib._sel_forwardingTargetForSelector_1, aSelector); return NSObject._(_ret, _lib); } - void forwardInvocation(NSObject? anInvocation) { + void forwardInvocation_(NSObject? anInvocation) { _lib._objc_msgSend_8( _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); } - NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + NSMethodSignature methodSignatureForSelector_( + ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9( _id, _lib._sel_methodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static NSMethodSignature instanceMethodSignatureForSelector( + static NSMethodSignature instanceMethodSignatureForSelector_( NativeObjCLibrary _lib, ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, _lib._sel_instanceMethodSignatureForSelector_1, aSelector); @@ -5412,18 +5413,18 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); } - static bool isSubclassOfClass(NativeObjCLibrary _lib, NSObject aClass) { + static bool isSubclassOfClass_(NativeObjCLibrary _lib, NSObject aClass) { return _lib._objc_msgSend_4( _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); } - static bool resolveClassMethod( + static bool resolveClassMethod_( NativeObjCLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); } - static bool resolveInstanceMethod( + static bool resolveInstanceMethod_( NativeObjCLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); @@ -5460,7 +5461,7 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_32(_lib._class_NSObject1, _lib._sel_version1); } - static void setVersion(NativeObjCLibrary _lib, int aVersion) { + static void setVersion_(NativeObjCLibrary _lib, int aVersion) { _lib._objc_msgSend_76( _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); } @@ -5470,19 +5471,19 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - NSObject replacementObjectForCoder(NSObject? coder) { + NSObject replacementObjectForCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - NSObject awakeAfterUsingCoder(NSObject? coder) { + NSObject awakeAfterUsingCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static void poseAsClass(NativeObjCLibrary _lib, NSObject aClass) { + static void poseAsClass_(NativeObjCLibrary _lib, NSObject aClass) { _lib._objc_msgSend_8( _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); } @@ -5535,7 +5536,7 @@ class NSString extends NSObject { factory NSString(NativeObjCLibrary _lib, String str) { final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); pkg_ffi.calloc.free(cstr); return nsstr; } @@ -5547,7 +5548,7 @@ class NSString extends NSObject { return _lib._objc_msgSend_11(_id, _lib._sel_length1); } - int characterAtIndex(int index) { + int characterAtIndex_(int index) { return _lib._objc_msgSend_12(_id, _lib._sel_characterAtIndex_1, index); } @@ -5557,93 +5558,93 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString initWithCoder(NSObject? coder) { + NSString initWithCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - NSString substringFromIndex(int from) { + NSString substringFromIndex_(int from) { final _ret = _lib._objc_msgSend_14(_id, _lib._sel_substringFromIndex_1, from); return NSString._(_ret, _lib); } - NSString substringToIndex(int to) { + NSString substringToIndex_(int to) { final _ret = _lib._objc_msgSend_14(_id, _lib._sel_substringToIndex_1, to); return NSString._(_ret, _lib); } - NSString substringWithRange(NSRange range) { + NSString substringWithRange_(NSRange range) { final _ret = _lib._objc_msgSend_15(_id, _lib._sel_substringWithRange_1, range); return NSString._(_ret, _lib); } - void getCharacters_range(ffi.Pointer buffer, NSRange range) { + void getCharacters_range_(ffi.Pointer buffer, NSRange range) { _lib._objc_msgSend_16(_id, _lib._sel_getCharacters_range_1, buffer, range); } - int compare(NSObject? string) { + int compare_(NSObject? string) { return _lib._objc_msgSend_17( _id, _lib._sel_compare_1, string?._id ?? ffi.nullptr); } - int compare_options(NSObject? string, int mask) { + int compare_options_(NSObject? string, int mask) { return _lib._objc_msgSend_18( _id, _lib._sel_compare_options_1, string?._id ?? ffi.nullptr, mask); } - int compare_options_range( + int compare_options_range_( NSObject? string, int mask, NSRange rangeOfReceiverToCompare) { return _lib._objc_msgSend_19(_id, _lib._sel_compare_options_range_1, string?._id ?? ffi.nullptr, mask, rangeOfReceiverToCompare); } - int compare_options_range_locale(NSObject? string, int mask, + int compare_options_range_locale_(NSObject? string, int mask, NSRange rangeOfReceiverToCompare, NSObject locale) { return _lib._objc_msgSend_20(_id, _lib._sel_compare_options_range_locale_1, string?._id ?? ffi.nullptr, mask, rangeOfReceiverToCompare, locale._id); } - int caseInsensitiveCompare(NSObject? string) { + int caseInsensitiveCompare_(NSObject? string) { return _lib._objc_msgSend_17( _id, _lib._sel_caseInsensitiveCompare_1, string?._id ?? ffi.nullptr); } - int localizedCompare(NSObject? string) { + int localizedCompare_(NSObject? string) { return _lib._objc_msgSend_17( _id, _lib._sel_localizedCompare_1, string?._id ?? ffi.nullptr); } - int localizedCaseInsensitiveCompare(NSObject? string) { + int localizedCaseInsensitiveCompare_(NSObject? string) { return _lib._objc_msgSend_17( _id, _lib._sel_localizedCaseInsensitiveCompare_1, string?._id ?? ffi.nullptr); } - int localizedStandardCompare(NSObject? string) { + int localizedStandardCompare_(NSObject? string) { return _lib._objc_msgSend_17( _id, _lib._sel_localizedStandardCompare_1, string?._id ?? ffi.nullptr); } - bool isEqualToString(NSObject? aString) { + bool isEqualToString_(NSObject? aString) { return _lib._objc_msgSend_4( _id, _lib._sel_isEqualToString_1, aString?._id ?? ffi.nullptr); } - bool hasPrefix(NSObject? str) { + bool hasPrefix_(NSObject? str) { return _lib._objc_msgSend_4( _id, _lib._sel_hasPrefix_1, str?._id ?? ffi.nullptr); } - bool hasSuffix(NSObject? str) { + bool hasSuffix_(NSObject? str) { return _lib._objc_msgSend_4( _id, _lib._sel_hasSuffix_1, str?._id ?? ffi.nullptr); } - NSString commonPrefixWithString_options(NSObject? str, int mask) { + NSString commonPrefixWithString_options_(NSObject? str, int mask) { final _ret = _lib._objc_msgSend_21( _id, _lib._sel_commonPrefixWithString_options_1, @@ -5652,45 +5653,45 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - bool containsString(NSObject? str) { + bool containsString_(NSObject? str) { return _lib._objc_msgSend_4( _id, _lib._sel_containsString_1, str?._id ?? ffi.nullptr); } - bool localizedCaseInsensitiveContainsString(NSObject? str) { + bool localizedCaseInsensitiveContainsString_(NSObject? str) { return _lib._objc_msgSend_4( _id, _lib._sel_localizedCaseInsensitiveContainsString_1, str?._id ?? ffi.nullptr); } - bool localizedStandardContainsString(NSObject? str) { + bool localizedStandardContainsString_(NSObject? str) { return _lib._objc_msgSend_4(_id, _lib._sel_localizedStandardContainsString_1, str?._id ?? ffi.nullptr); } - NSRange localizedStandardRangeOfString(NSObject? str) { + NSRange localizedStandardRangeOfString_(NSObject? str) { return _lib._objc_msgSend_22(_id, _lib._sel_localizedStandardRangeOfString_1, str?._id ?? ffi.nullptr); } - NSRange rangeOfString(NSObject? searchString) { + NSRange rangeOfString_(NSObject? searchString) { return _lib._objc_msgSend_22( _id, _lib._sel_rangeOfString_1, searchString?._id ?? ffi.nullptr); } - NSRange rangeOfString_options(NSObject? searchString, int mask) { + NSRange rangeOfString_options_(NSObject? searchString, int mask) { return _lib._objc_msgSend_23(_id, _lib._sel_rangeOfString_options_1, searchString?._id ?? ffi.nullptr, mask); } - NSRange rangeOfString_options_range( + NSRange rangeOfString_options_range_( NSObject? searchString, int mask, NSRange rangeOfReceiverToSearch) { return _lib._objc_msgSend_24(_id, _lib._sel_rangeOfString_options_range_1, searchString?._id ?? ffi.nullptr, mask, rangeOfReceiverToSearch); } - NSRange rangeOfString_options_range_locale(NSObject? searchString, int mask, + NSRange rangeOfString_options_range_locale_(NSObject? searchString, int mask, NSRange rangeOfReceiverToSearch, NSObject? locale) { return _lib._objc_msgSend_25( _id, @@ -5701,12 +5702,12 @@ class NSString extends NSObject { locale?._id ?? ffi.nullptr); } - NSRange rangeOfCharacterFromSet(NSObject? searchSet) { + NSRange rangeOfCharacterFromSet_(NSObject? searchSet) { return _lib._objc_msgSend_22(_id, _lib._sel_rangeOfCharacterFromSet_1, searchSet?._id ?? ffi.nullptr); } - NSRange rangeOfCharacterFromSet_options(NSObject? searchSet, int mask) { + NSRange rangeOfCharacterFromSet_options_(NSObject? searchSet, int mask) { return _lib._objc_msgSend_23( _id, _lib._sel_rangeOfCharacterFromSet_options_1, @@ -5714,7 +5715,7 @@ class NSString extends NSObject { mask); } - NSRange rangeOfCharacterFromSet_options_range( + NSRange rangeOfCharacterFromSet_options_range_( NSObject? searchSet, int mask, NSRange rangeOfReceiverToSearch) { return _lib._objc_msgSend_24( _id, @@ -5724,23 +5725,23 @@ class NSString extends NSObject { rangeOfReceiverToSearch); } - NSRange rangeOfComposedCharacterSequenceAtIndex(int index) { + NSRange rangeOfComposedCharacterSequenceAtIndex_(int index) { return _lib._objc_msgSend_26( _id, _lib._sel_rangeOfComposedCharacterSequenceAtIndex_1, index); } - NSRange rangeOfComposedCharacterSequencesForRange(NSRange range) { + NSRange rangeOfComposedCharacterSequencesForRange_(NSRange range) { return _lib._objc_msgSend_27( _id, _lib._sel_rangeOfComposedCharacterSequencesForRange_1, range); } - NSString stringByAppendingString(NSObject? aString) { + NSString stringByAppendingString_(NSObject? aString) { final _ret = _lib._objc_msgSend_28( _id, _lib._sel_stringByAppendingString_1, aString?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - NSString stringByAppendingFormat(NSObject? format) { + NSString stringByAppendingFormat_(NSObject? format) { final _ret = _lib._objc_msgSend_28( _id, _lib._sel_stringByAppendingFormat_1, format?._id ?? ffi.nullptr); return NSString._(_ret, _lib); @@ -5801,25 +5802,25 @@ class NSString extends NSObject { return _ret.address == 0 ? null : NSObject._(_ret, _lib); } - NSString uppercaseStringWithLocale(NSObject? locale) { + NSString uppercaseStringWithLocale_(NSObject? locale) { final _ret = _lib._objc_msgSend_28( _id, _lib._sel_uppercaseStringWithLocale_1, locale?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - NSString lowercaseStringWithLocale(NSObject? locale) { + NSString lowercaseStringWithLocale_(NSObject? locale) { final _ret = _lib._objc_msgSend_28( _id, _lib._sel_lowercaseStringWithLocale_1, locale?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - NSString capitalizedStringWithLocale(NSObject? locale) { + NSString capitalizedStringWithLocale_(NSObject? locale) { final _ret = _lib._objc_msgSend_28(_id, _lib._sel_capitalizedStringWithLocale_1, locale?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - void getLineStart_end_contentsEnd_forRange( + void getLineStart_end_contentsEnd_forRange_( ffi.Pointer startPtr, ffi.Pointer lineEndPtr, ffi.Pointer contentsEndPtr, @@ -5833,11 +5834,11 @@ class NSString extends NSObject { range); } - NSRange lineRangeForRange(NSRange range) { + NSRange lineRangeForRange_(NSRange range) { return _lib._objc_msgSend_27(_id, _lib._sel_lineRangeForRange_1, range); } - void getParagraphStart_end_contentsEnd_forRange( + void getParagraphStart_end_contentsEnd_forRange_( ffi.Pointer startPtr, ffi.Pointer parEndPtr, ffi.Pointer contentsEndPtr, @@ -5851,12 +5852,12 @@ class NSString extends NSObject { range); } - NSRange paragraphRangeForRange(NSRange range) { + NSRange paragraphRangeForRange_(NSRange range) { return _lib._objc_msgSend_27( _id, _lib._sel_paragraphRangeForRange_1, range); } - void enumerateSubstringsInRange_options_usingBlock( + void enumerateSubstringsInRange_options_usingBlock_( NSRange range, int opts, ObjCBlock block) { _lib._objc_msgSend_35( _id, @@ -5866,7 +5867,7 @@ class NSString extends NSObject { block._impl); } - void enumerateLinesUsingBlock(ObjCBlock1 block) { + void enumerateLinesUsingBlock_(ObjCBlock1 block) { _lib._objc_msgSend_36( _id, _lib._sel_enumerateLinesUsingBlock_1, block._impl); } @@ -5883,34 +5884,34 @@ class NSString extends NSObject { return _lib._objc_msgSend_11(_id, _lib._sel_smallestEncoding1); } - NSData dataUsingEncoding_allowLossyConversion(int encoding, bool lossy) { + NSData dataUsingEncoding_allowLossyConversion_(int encoding, bool lossy) { final _ret = _lib._objc_msgSend_38(_id, _lib._sel_dataUsingEncoding_allowLossyConversion_1, encoding, lossy); return NSData._(_ret, _lib); } - NSData dataUsingEncoding(int encoding) { + NSData dataUsingEncoding_(int encoding) { final _ret = _lib._objc_msgSend_39(_id, _lib._sel_dataUsingEncoding_1, encoding); return NSData._(_ret, _lib); } - bool canBeConvertedToEncoding(int encoding) { + bool canBeConvertedToEncoding_(int encoding) { return _lib._objc_msgSend_40( _id, _lib._sel_canBeConvertedToEncoding_1, encoding); } - void cStringUsingEncoding(int encoding) { + void cStringUsingEncoding_(int encoding) { _lib._objc_msgSend_41(_id, _lib._sel_cStringUsingEncoding_1, encoding); } - bool getCString_maxLength_encoding( + bool getCString_maxLength_encoding_( ffi.Pointer buffer, int maxBufferCount, int encoding) { return _lib._objc_msgSend_42(_id, _lib._sel_getCString_maxLength_encoding_1, buffer, maxBufferCount, encoding); } - bool getBytes_maxLength_usedLength_encoding_options_range_remainingRange( + bool getBytes_maxLength_usedLength_encoding_options_range_remainingRange_( ffi.Pointer buffer, int maxBufferCount, ffi.Pointer usedBufferCount, @@ -5930,12 +5931,12 @@ class NSString extends NSObject { leftover); } - int maximumLengthOfBytesUsingEncoding(int enc) { + int maximumLengthOfBytesUsingEncoding_(int enc) { return _lib._objc_msgSend_44( _id, _lib._sel_maximumLengthOfBytesUsingEncoding_1, enc); } - int lengthOfBytesUsingEncoding(int enc) { + int lengthOfBytesUsingEncoding_(int enc) { return _lib._objc_msgSend_44( _id, _lib._sel_lengthOfBytesUsingEncoding_1, enc); } @@ -5946,7 +5947,7 @@ class NSString extends NSObject { _lib._class_NSString1, _lib._sel_availableStringEncodings1); } - static NSString localizedNameOfStringEncoding( + static NSString localizedNameOfStringEncoding_( NativeObjCLibrary _lib, int encoding) { final _ret = _lib._objc_msgSend_14(_lib._class_NSString1, _lib._sel_localizedNameOfStringEncoding_1, encoding); @@ -5982,13 +5983,13 @@ class NSString extends NSObject { return _ret.address == 0 ? null : NSObject._(_ret, _lib); } - NSString stringByTrimmingCharactersInSet(NSObject? set) { + NSString stringByTrimmingCharactersInSet_(NSObject? set) { final _ret = _lib._objc_msgSend_28(_id, _lib._sel_stringByTrimmingCharactersInSet_1, set?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - NSString stringByPaddingToLength_withString_startingAtIndex( + NSString stringByPaddingToLength_withString_startingAtIndex_( int newLength, NSObject? padString, int padIndex) { final _ret = _lib._objc_msgSend_46( _id, @@ -5999,7 +6000,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString stringByFoldingWithOptions_locale(int options, NSObject? locale) { + NSString stringByFoldingWithOptions_locale_(int options, NSObject? locale) { final _ret = _lib._objc_msgSend_47( _id, _lib._sel_stringByFoldingWithOptions_locale_1, @@ -6008,7 +6009,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString stringByReplacingOccurrencesOfString_withString_options_range( + NSString stringByReplacingOccurrencesOfString_withString_options_range_( NSObject? target, NSObject? replacement, int options, @@ -6023,7 +6024,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString stringByReplacingOccurrencesOfString_withString( + NSString stringByReplacingOccurrencesOfString_withString_( NSObject? target, NSObject? replacement) { final _ret = _lib._objc_msgSend_49( _id, @@ -6033,7 +6034,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString stringByReplacingCharactersInRange_withString( + NSString stringByReplacingCharactersInRange_withString_( NSRange range, NSObject? replacement) { final _ret = _lib._objc_msgSend_50( _id, @@ -6043,14 +6044,14 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString stringByApplyingTransform_reverse( + NSString stringByApplyingTransform_reverse_( NSStringTransform transform, bool reverse) { final _ret = _lib._objc_msgSend_51( _id, _lib._sel_stringByApplyingTransform_reverse_1, transform, reverse); return NSString._(_ret, _lib); } - bool writeToURL_atomically_encoding_error( + bool writeToURL_atomically_encoding_error_( NSObject? url, bool useAuxiliaryFile, int enc, @@ -6064,7 +6065,7 @@ class NSString extends NSObject { error); } - bool writeToFile_atomically_encoding_error( + bool writeToFile_atomically_encoding_error_( NSObject? path, bool useAuxiliaryFile, int enc, @@ -6087,7 +6088,7 @@ class NSString extends NSObject { return _lib._objc_msgSend_11(_id, _lib._sel_hash1); } - NSString initWithCharactersNoCopy_length_freeWhenDone( + NSString initWithCharactersNoCopy_length_freeWhenDone_( ffi.Pointer characters, int length, bool freeBuffer) { final _ret = _lib._objc_msgSend_53( _id, @@ -6098,7 +6099,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString initWithCharactersNoCopy_length_deallocator( + NSString initWithCharactersNoCopy_length_deallocator_( ffi.Pointer chars, int len, ObjCBlock2 deallocator) { final _ret = _lib._objc_msgSend_54( _id, @@ -6109,32 +6110,33 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString initWithCharacters_length( + NSString initWithCharacters_length_( ffi.Pointer characters, int length) { final _ret = _lib._objc_msgSend_55( _id, _lib._sel_initWithCharacters_length_1, characters, length); return NSString._(_ret, _lib); } - NSString initWithUTF8String(ffi.Pointer nullTerminatedCString) { + NSString initWithUTF8String_( + ffi.Pointer nullTerminatedCString) { final _ret = _lib._objc_msgSend_56( _id, _lib._sel_initWithUTF8String_1, nullTerminatedCString); return NSString._(_ret, _lib); } - NSString initWithString(NSObject? aString) { + NSString initWithString_(NSObject? aString) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithString_1, aString?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - NSString initWithFormat(NSObject? format) { + NSString initWithFormat_(NSObject? format) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithFormat_1, format?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - NSString initWithFormat_arguments( + NSString initWithFormat_arguments_( NSObject? format, ffi.Pointer<__va_list_tag> argList) { final _ret = _lib._objc_msgSend_57( _id, @@ -6144,13 +6146,13 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString initWithFormat_locale(NSObject? format, NSObject locale) { + NSString initWithFormat_locale_(NSObject? format, NSObject locale) { final _ret = _lib._objc_msgSend_58(_id, _lib._sel_initWithFormat_locale_1, format?._id ?? ffi.nullptr, locale._id); return NSString._(_ret, _lib); } - NSString initWithFormat_locale_arguments( + NSString initWithFormat_locale_arguments_( NSObject? format, NSObject locale, ffi.Pointer<__va_list_tag> argList) { final _ret = _lib._objc_msgSend_59( _id, @@ -6161,20 +6163,20 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString initWithData_encoding(NSObject? data, int encoding) { + NSString initWithData_encoding_(NSObject? data, int encoding) { final _ret = _lib._objc_msgSend_60(_id, _lib._sel_initWithData_encoding_1, data?._id ?? ffi.nullptr, encoding); return NSString._(_ret, _lib); } - NSString initWithBytes_length_encoding( + NSString initWithBytes_length_encoding_( ffi.Pointer bytes, int len, int encoding) { final _ret = _lib._objc_msgSend_61( _id, _lib._sel_initWithBytes_length_encoding_1, bytes, len, encoding); return NSString._(_ret, _lib); } - NSString initWithBytesNoCopy_length_encoding_freeWhenDone( + NSString initWithBytesNoCopy_length_encoding_freeWhenDone_( ffi.Pointer bytes, int len, int encoding, bool freeBuffer) { final _ret = _lib._objc_msgSend_62( _id, @@ -6186,7 +6188,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString initWithBytesNoCopy_length_encoding_deallocator( + NSString initWithBytesNoCopy_length_encoding_deallocator_( ffi.Pointer bytes, int len, int encoding, @@ -6206,54 +6208,54 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - static NSString stringWithString(NativeObjCLibrary _lib, NSObject? string) { + static NSString stringWithString_(NativeObjCLibrary _lib, NSObject? string) { final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - static NSString stringWithCharacters_length( + static NSString stringWithCharacters_length_( NativeObjCLibrary _lib, ffi.Pointer characters, int length) { final _ret = _lib._objc_msgSend_55(_lib._class_NSString1, _lib._sel_stringWithCharacters_length_1, characters, length); return NSString._(_ret, _lib); } - static NSString stringWithUTF8String( + static NSString stringWithUTF8String_( NativeObjCLibrary _lib, ffi.Pointer nullTerminatedCString) { final _ret = _lib._objc_msgSend_56(_lib._class_NSString1, _lib._sel_stringWithUTF8String_1, nullTerminatedCString); return NSString._(_ret, _lib); } - static NSString stringWithFormat(NativeObjCLibrary _lib, NSObject? format) { + static NSString stringWithFormat_(NativeObjCLibrary _lib, NSObject? format) { final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - static NSString localizedStringWithFormat( + static NSString localizedStringWithFormat_( NativeObjCLibrary _lib, NSObject? format) { final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - NSString initWithCString_encoding( + NSString initWithCString_encoding_( ffi.Pointer nullTerminatedCString, int encoding) { final _ret = _lib._objc_msgSend_64(_id, _lib._sel_initWithCString_encoding_1, nullTerminatedCString, encoding); return NSString._(_ret, _lib); } - static NSString stringWithCString_encoding( + static NSString stringWithCString_encoding_( NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { final _ret = _lib._objc_msgSend_64(_lib._class_NSString1, _lib._sel_stringWithCString_encoding_1, cString, enc); return NSString._(_ret, _lib); } - NSString initWithContentsOfURL_encoding_error( + NSString initWithContentsOfURL_encoding_error_( NSObject? url, int enc, ffi.Pointer> error) { final _ret = _lib._objc_msgSend_65( _id, @@ -6264,7 +6266,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString initWithContentsOfFile_encoding_error( + NSString initWithContentsOfFile_encoding_error_( NSObject? path, int enc, ffi.Pointer> error) { final _ret = _lib._objc_msgSend_65( _id, @@ -6275,8 +6277,11 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - static NSString stringWithContentsOfURL_encoding_error(NativeObjCLibrary _lib, - NSObject? url, int enc, ffi.Pointer> error) { + static NSString stringWithContentsOfURL_encoding_error_( + NativeObjCLibrary _lib, + NSObject? url, + int enc, + ffi.Pointer> error) { final _ret = _lib._objc_msgSend_65( _lib._class_NSString1, _lib._sel_stringWithContentsOfURL_encoding_error_1, @@ -6286,7 +6291,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - static NSString stringWithContentsOfFile_encoding_error( + static NSString stringWithContentsOfFile_encoding_error_( NativeObjCLibrary _lib, NSObject? path, int enc, @@ -6300,7 +6305,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString initWithContentsOfURL_usedEncoding_error( + NSString initWithContentsOfURL_usedEncoding_error_( NSObject? url, ffi.Pointer enc, ffi.Pointer> error) { @@ -6313,7 +6318,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString initWithContentsOfFile_usedEncoding_error( + NSString initWithContentsOfFile_usedEncoding_error_( NSObject? path, ffi.Pointer enc, ffi.Pointer> error) { @@ -6326,7 +6331,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - static NSString stringWithContentsOfURL_usedEncoding_error( + static NSString stringWithContentsOfURL_usedEncoding_error_( NativeObjCLibrary _lib, NSObject? url, ffi.Pointer enc, @@ -6340,7 +6345,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - static NSString stringWithContentsOfFile_usedEncoding_error( + static NSString stringWithContentsOfFile_usedEncoding_error_( NativeObjCLibrary _lib, NSObject? path, ffi.Pointer enc, @@ -6355,7 +6360,7 @@ class NSString extends NSObject { } static int - stringEncodingForData_encodingOptions_convertedString_usedLossyConversion( + stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( NativeObjCLibrary _lib, NSObject? data, NSObject? opts, @@ -6393,16 +6398,16 @@ class NSString extends NSObject { return _lib._objc_msgSend_11(_id, _lib._sel_cStringLength1); } - void getCString(ffi.Pointer bytes) { + void getCString_(ffi.Pointer bytes) { _lib._objc_msgSend_69(_id, _lib._sel_getCString_1, bytes); } - void getCString_maxLength(ffi.Pointer bytes, int maxLength) { + void getCString_maxLength_(ffi.Pointer bytes, int maxLength) { _lib._objc_msgSend_70( _id, _lib._sel_getCString_maxLength_1, bytes, maxLength); } - void getCString_maxLength_range_remainingRange( + void getCString_maxLength_range_remainingRange_( ffi.Pointer bytes, int maxLength, NSRange aRange, @@ -6416,43 +6421,43 @@ class NSString extends NSObject { leftoverRange); } - bool writeToFile_atomically(NSObject? path, bool useAuxiliaryFile) { + bool writeToFile_atomically_(NSObject? path, bool useAuxiliaryFile) { return _lib._objc_msgSend_72(_id, _lib._sel_writeToFile_atomically_1, path?._id ?? ffi.nullptr, useAuxiliaryFile); } - bool writeToURL_atomically(NSObject? url, bool atomically) { + bool writeToURL_atomically_(NSObject? url, bool atomically) { return _lib._objc_msgSend_72(_id, _lib._sel_writeToURL_atomically_1, url?._id ?? ffi.nullptr, atomically); } - NSObject initWithContentsOfFile(NSObject? path) { + NSObject initWithContentsOfFile_(NSObject? path) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - NSObject initWithContentsOfURL(NSObject? url) { + NSObject initWithContentsOfURL_(NSObject? url) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static NSObject stringWithContentsOfFile( + static NSObject stringWithContentsOfFile_( NativeObjCLibrary _lib, NSObject? path) { final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static NSObject stringWithContentsOfURL( + static NSObject stringWithContentsOfURL_( NativeObjCLibrary _lib, NSObject? url) { final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - NSObject initWithCStringNoCopy_length_freeWhenDone( + NSObject initWithCStringNoCopy_length_freeWhenDone_( ffi.Pointer bytes, int length, bool freeBuffer) { final _ret = _lib._objc_msgSend_73( _id, @@ -6463,32 +6468,33 @@ class NSString extends NSObject { return NSObject._(_ret, _lib); } - NSObject initWithCString_length(ffi.Pointer bytes, int length) { + NSObject initWithCString_length_( + ffi.Pointer bytes, int length) { final _ret = _lib._objc_msgSend_64( _id, _lib._sel_initWithCString_length_1, bytes, length); return NSObject._(_ret, _lib); } - NSObject initWithCString(ffi.Pointer bytes) { + NSObject initWithCString_(ffi.Pointer bytes) { final _ret = _lib._objc_msgSend_56(_id, _lib._sel_initWithCString_1, bytes); return NSObject._(_ret, _lib); } - static NSObject stringWithCString_length( + static NSObject stringWithCString_length_( NativeObjCLibrary _lib, ffi.Pointer bytes, int length) { final _ret = _lib._objc_msgSend_64(_lib._class_NSString1, _lib._sel_stringWithCString_length_1, bytes, length); return NSObject._(_ret, _lib); } - static NSObject stringWithCString( + static NSObject stringWithCString_( NativeObjCLibrary _lib, ffi.Pointer bytes) { final _ret = _lib._objc_msgSend_56( _lib._class_NSString1, _lib._sel_stringWithCString_1, bytes); return NSObject._(_ret, _lib); } - void getCharacters(ffi.Pointer buffer) { + void getCharacters_(ffi.Pointer buffer) { _lib._objc_msgSend_74(_id, _lib._sel_getCharacters_1, buffer); } @@ -6783,7 +6789,7 @@ class NSValue extends NSObject { return NSValue._(other, lib); } - void getValue_size(ffi.Pointer value, int size) { + void getValue_size_(ffi.Pointer value, int size) { _lib._objc_msgSend_77(_id, _lib._sel_getValue_size_1, value, size); } @@ -6791,34 +6797,34 @@ class NSValue extends NSObject { return _lib._objc_msgSend_37(_id, _lib._sel_objCType1); } - NSValue initWithBytes_objCType( + NSValue initWithBytes_objCType_( ffi.Pointer value, ffi.Pointer type) { final _ret = _lib._objc_msgSend_78( _id, _lib._sel_initWithBytes_objCType_1, value, type); return NSValue._(_ret, _lib); } - NSValue initWithCoder(NSObject? coder) { + NSValue initWithCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); return NSValue._(_ret, _lib); } - static NSValue valueWithBytes_objCType(NativeObjCLibrary _lib, + static NSValue valueWithBytes_objCType_(NativeObjCLibrary _lib, ffi.Pointer value, ffi.Pointer type) { final _ret = _lib._objc_msgSend_79( _lib._class_NSValue1, _lib._sel_valueWithBytes_objCType_1, value, type); return NSValue._(_ret, _lib); } - static NSValue value_withObjCType(NativeObjCLibrary _lib, + static NSValue value_withObjCType_(NativeObjCLibrary _lib, ffi.Pointer value, ffi.Pointer type) { final _ret = _lib._objc_msgSend_79( _lib._class_NSValue1, _lib._sel_value_withObjCType_1, value, type); return NSValue._(_ret, _lib); } - static NSValue valueWithNonretainedObject( + static NSValue valueWithNonretainedObject_( NativeObjCLibrary _lib, NSObject anObject) { final _ret = _lib._objc_msgSend_80(_lib._class_NSValue1, _lib._sel_valueWithNonretainedObject_1, anObject._id); @@ -6830,7 +6836,7 @@ class NSValue extends NSObject { return NSObject._(_ret, _lib); } - static NSValue valueWithPointer( + static NSValue valueWithPointer_( NativeObjCLibrary _lib, ffi.Pointer pointer) { final _ret = _lib._objc_msgSend_81( _lib._class_NSValue1, _lib._sel_valueWithPointer_1, pointer); @@ -6841,16 +6847,16 @@ class NSValue extends NSObject { return _lib._objc_msgSend_82(_id, _lib._sel_pointerValue1); } - bool isEqualToValue(NSObject? value) { + bool isEqualToValue_(NSObject? value) { return _lib._objc_msgSend_4( _id, _lib._sel_isEqualToValue_1, value?._id ?? ffi.nullptr); } - void getValue(ffi.Pointer value) { + void getValue_(ffi.Pointer value) { _lib._objc_msgSend_83(_id, _lib._sel_getValue_1, value); } - static NSValue valueWithRange(NativeObjCLibrary _lib, NSRange range) { + static NSValue valueWithRange_(NativeObjCLibrary _lib, NSRange range) { final _ret = _lib._objc_msgSend_84( _lib._class_NSValue1, _lib._sel_valueWithRange_1, range); return NSValue._(_ret, _lib); @@ -6885,89 +6891,89 @@ class NSNumber extends NSValue { } @override - NSNumber initWithCoder(NSObject? coder) { + NSNumber initWithCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); return NSNumber._(_ret, _lib); } - NSNumber initWithChar(int value) { + NSNumber initWithChar_(int value) { final _ret = _lib._objc_msgSend_86(_id, _lib._sel_initWithChar_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithUnsignedChar(int value) { + NSNumber initWithUnsignedChar_(int value) { final _ret = _lib._objc_msgSend_87(_id, _lib._sel_initWithUnsignedChar_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithShort(int value) { + NSNumber initWithShort_(int value) { final _ret = _lib._objc_msgSend_88(_id, _lib._sel_initWithShort_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithUnsignedShort(int value) { + NSNumber initWithUnsignedShort_(int value) { final _ret = _lib._objc_msgSend_89(_id, _lib._sel_initWithUnsignedShort_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithInt(int value) { + NSNumber initWithInt_(int value) { final _ret = _lib._objc_msgSend_90(_id, _lib._sel_initWithInt_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithUnsignedInt(int value) { + NSNumber initWithUnsignedInt_(int value) { final _ret = _lib._objc_msgSend_91(_id, _lib._sel_initWithUnsignedInt_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithLong(int value) { + NSNumber initWithLong_(int value) { final _ret = _lib._objc_msgSend_92(_id, _lib._sel_initWithLong_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithUnsignedLong(int value) { + NSNumber initWithUnsignedLong_(int value) { final _ret = _lib._objc_msgSend_93(_id, _lib._sel_initWithUnsignedLong_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithLongLong(int value) { + NSNumber initWithLongLong_(int value) { final _ret = _lib._objc_msgSend_94(_id, _lib._sel_initWithLongLong_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithUnsignedLongLong(int value) { + NSNumber initWithUnsignedLongLong_(int value) { final _ret = _lib._objc_msgSend_95(_id, _lib._sel_initWithUnsignedLongLong_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithFloat(double value) { + NSNumber initWithFloat_(double value) { final _ret = _lib._objc_msgSend_96(_id, _lib._sel_initWithFloat_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithDouble(double value) { + NSNumber initWithDouble_(double value) { final _ret = _lib._objc_msgSend_97(_id, _lib._sel_initWithDouble_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithBool(bool value) { + NSNumber initWithBool_(bool value) { final _ret = _lib._objc_msgSend_98(_id, _lib._sel_initWithBool_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithInteger(int value) { + NSNumber initWithInteger_(int value) { final _ret = _lib._objc_msgSend_92(_id, _lib._sel_initWithInteger_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithUnsignedInteger(int value) { + NSNumber initWithUnsignedInteger_(int value) { final _ret = _lib._objc_msgSend_93(_id, _lib._sel_initWithUnsignedInteger_1, value); return NSNumber._(_ret, _lib); @@ -7038,142 +7044,143 @@ class NSNumber extends NSValue { return _ret.address == 0 ? null : NSObject._(_ret, _lib); } - int compare(NSObject? otherNumber) { + int compare_(NSObject? otherNumber) { return _lib._objc_msgSend_17( _id, _lib._sel_compare_1, otherNumber?._id ?? ffi.nullptr); } - bool isEqualToNumber(NSObject? number) { + bool isEqualToNumber_(NSObject? number) { return _lib._objc_msgSend_4( _id, _lib._sel_isEqualToNumber_1, number?._id ?? ffi.nullptr); } - NSString descriptionWithLocale(NSObject locale) { + NSString descriptionWithLocale_(NSObject locale) { final _ret = _lib._objc_msgSend_28( _id, _lib._sel_descriptionWithLocale_1, locale._id); return NSString._(_ret, _lib); } - static NSNumber numberWithChar(NativeObjCLibrary _lib, int value) { + static NSNumber numberWithChar_(NativeObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_86( _lib._class_NSNumber1, _lib._sel_numberWithChar_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithUnsignedChar(NativeObjCLibrary _lib, int value) { + static NSNumber numberWithUnsignedChar_(NativeObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_87( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedChar_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithShort(NativeObjCLibrary _lib, int value) { + static NSNumber numberWithShort_(NativeObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_88( _lib._class_NSNumber1, _lib._sel_numberWithShort_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithUnsignedShort(NativeObjCLibrary _lib, int value) { + static NSNumber numberWithUnsignedShort_(NativeObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_89( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedShort_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithInt(NativeObjCLibrary _lib, int value) { + static NSNumber numberWithInt_(NativeObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_90( _lib._class_NSNumber1, _lib._sel_numberWithInt_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithUnsignedInt(NativeObjCLibrary _lib, int value) { + static NSNumber numberWithUnsignedInt_(NativeObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_91( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInt_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithLong(NativeObjCLibrary _lib, int value) { + static NSNumber numberWithLong_(NativeObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_92( _lib._class_NSNumber1, _lib._sel_numberWithLong_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithUnsignedLong(NativeObjCLibrary _lib, int value) { + static NSNumber numberWithUnsignedLong_(NativeObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_93( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLong_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithLongLong(NativeObjCLibrary _lib, int value) { + static NSNumber numberWithLongLong_(NativeObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_94( _lib._class_NSNumber1, _lib._sel_numberWithLongLong_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithUnsignedLongLong( + static NSNumber numberWithUnsignedLongLong_( NativeObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_95( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLongLong_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithFloat(NativeObjCLibrary _lib, double value) { + static NSNumber numberWithFloat_(NativeObjCLibrary _lib, double value) { final _ret = _lib._objc_msgSend_96( _lib._class_NSNumber1, _lib._sel_numberWithFloat_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithDouble(NativeObjCLibrary _lib, double value) { + static NSNumber numberWithDouble_(NativeObjCLibrary _lib, double value) { final _ret = _lib._objc_msgSend_97( _lib._class_NSNumber1, _lib._sel_numberWithDouble_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithBool(NativeObjCLibrary _lib, bool value) { + static NSNumber numberWithBool_(NativeObjCLibrary _lib, bool value) { final _ret = _lib._objc_msgSend_98( _lib._class_NSNumber1, _lib._sel_numberWithBool_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithInteger(NativeObjCLibrary _lib, int value) { + static NSNumber numberWithInteger_(NativeObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_92( _lib._class_NSNumber1, _lib._sel_numberWithInteger_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithUnsignedInteger(NativeObjCLibrary _lib, int value) { + static NSNumber numberWithUnsignedInteger_( + NativeObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_93( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInteger_1, value); return NSNumber._(_ret, _lib); } - static NSValue valueWithBytes_objCType(NativeObjCLibrary _lib, + static NSValue valueWithBytes_objCType_(NativeObjCLibrary _lib, ffi.Pointer value, ffi.Pointer type) { final _ret = _lib._objc_msgSend_79(_lib._class_NSNumber1, _lib._sel_valueWithBytes_objCType_1, value, type); return NSValue._(_ret, _lib); } - static NSValue value_withObjCType(NativeObjCLibrary _lib, + static NSValue value_withObjCType_(NativeObjCLibrary _lib, ffi.Pointer value, ffi.Pointer type) { final _ret = _lib._objc_msgSend_79( _lib._class_NSNumber1, _lib._sel_value_withObjCType_1, value, type); return NSValue._(_ret, _lib); } - static NSValue valueWithNonretainedObject( + static NSValue valueWithNonretainedObject_( NativeObjCLibrary _lib, NSObject anObject) { final _ret = _lib._objc_msgSend_80(_lib._class_NSNumber1, _lib._sel_valueWithNonretainedObject_1, anObject._id); return NSValue._(_ret, _lib); } - static NSValue valueWithPointer( + static NSValue valueWithPointer_( NativeObjCLibrary _lib, ffi.Pointer pointer) { final _ret = _lib._objc_msgSend_81( _lib._class_NSNumber1, _lib._sel_valueWithPointer_1, pointer); return NSValue._(_ret, _lib); } - static NSValue valueWithRange(NativeObjCLibrary _lib, NSRange range) { + static NSValue valueWithRange_(NativeObjCLibrary _lib, NSRange range) { final _ret = _lib._objc_msgSend_84( _lib._class_NSNumber1, _lib._sel_valueWithRange_1, range); return NSValue._(_ret, _lib); @@ -7268,7 +7275,7 @@ class NSArray extends NSObject { return _lib._objc_msgSend_11(_id, _lib._sel_count1); } - NSObject objectAtIndex(int index) { + NSObject objectAtIndex_(int index) { final _ret = _lib._objc_msgSend_105(_id, _lib._sel_objectAtIndex_1, index); return NSObject._(_ret, _lib); } @@ -7279,26 +7286,26 @@ class NSArray extends NSObject { return NSArray._(_ret, _lib); } - NSArray initWithObjects_count( + NSArray initWithObjects_count_( ffi.Pointer> objects, int cnt) { final _ret = _lib._objc_msgSend_106( _id, _lib._sel_initWithObjects_count_1, objects, cnt); return NSArray._(_ret, _lib); } - NSArray initWithCoder(NSObject? coder) { + NSArray initWithCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); return NSArray._(_ret, _lib); } - NSString componentsJoinedByString(NSObject? separator) { + NSString componentsJoinedByString_(NSObject? separator) { final _ret = _lib._objc_msgSend_28(_id, _lib._sel_componentsJoinedByString_1, separator?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - bool containsObject(NSObject anObject) { + bool containsObject_(NSObject anObject) { return _lib._objc_msgSend_4(_id, _lib._sel_containsObject_1, anObject._id); } @@ -7307,49 +7314,49 @@ class NSArray extends NSObject { return _ret.address == 0 ? null : NSObject._(_ret, _lib); } - NSString descriptionWithLocale(NSObject locale) { + NSString descriptionWithLocale_(NSObject locale) { final _ret = _lib._objc_msgSend_28( _id, _lib._sel_descriptionWithLocale_1, locale._id); return NSString._(_ret, _lib); } - NSString descriptionWithLocale_indent(NSObject locale, int level) { + NSString descriptionWithLocale_indent_(NSObject locale, int level) { final _ret = _lib._objc_msgSend_107( _id, _lib._sel_descriptionWithLocale_indent_1, locale._id, level); return NSString._(_ret, _lib); } - NSObject firstObjectCommonWithArray(NSObject? otherArray) { + NSObject firstObjectCommonWithArray_(NSObject? otherArray) { final _ret = _lib._objc_msgSend_13(_id, _lib._sel_firstObjectCommonWithArray_1, otherArray?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - void getObjects_range( + void getObjects_range_( ffi.Pointer> objects, NSRange range) { _lib._objc_msgSend_108(_id, _lib._sel_getObjects_range_1, objects, range); } - int indexOfObject(NSObject anObject) { + int indexOfObject_(NSObject anObject) { return _lib._objc_msgSend_109(_id, _lib._sel_indexOfObject_1, anObject._id); } - int indexOfObject_inRange(NSObject anObject, NSRange range) { + int indexOfObject_inRange_(NSObject anObject, NSRange range) { return _lib._objc_msgSend_110( _id, _lib._sel_indexOfObject_inRange_1, anObject._id, range); } - int indexOfObjectIdenticalTo(NSObject anObject) { + int indexOfObjectIdenticalTo_(NSObject anObject) { return _lib._objc_msgSend_109( _id, _lib._sel_indexOfObjectIdenticalTo_1, anObject._id); } - int indexOfObjectIdenticalTo_inRange(NSObject anObject, NSRange range) { + int indexOfObjectIdenticalTo_inRange_(NSObject anObject, NSRange range) { return _lib._objc_msgSend_110( _id, _lib._sel_indexOfObjectIdenticalTo_inRange_1, anObject._id, range); } - bool isEqualToArray(NSObject? otherArray) { + bool isEqualToArray_(NSObject? otherArray) { return _lib._objc_msgSend_4( _id, _lib._sel_isEqualToArray_1, otherArray?._id ?? ffi.nullptr); } @@ -7369,18 +7376,18 @@ class NSArray extends NSObject { return _ret.address == 0 ? null : NSObject._(_ret, _lib); } - bool writeToURL_error( + bool writeToURL_error_( NSObject? url, ffi.Pointer> error) { return _lib._objc_msgSend_111( _id, _lib._sel_writeToURL_error_1, url?._id ?? ffi.nullptr, error); } - void makeObjectsPerformSelector(ffi.Pointer aSelector) { + void makeObjectsPerformSelector_(ffi.Pointer aSelector) { _lib._objc_msgSend_6( _id, _lib._sel_makeObjectsPerformSelector_1, aSelector); } - void makeObjectsPerformSelector_withObject( + void makeObjectsPerformSelector_withObject_( ffi.Pointer aSelector, NSObject argument) { _lib._objc_msgSend_112( _id, @@ -7389,23 +7396,23 @@ class NSArray extends NSObject { argument._id); } - NSObject objectAtIndexedSubscript(int idx) { + NSObject objectAtIndexedSubscript_(int idx) { final _ret = _lib._objc_msgSend_105(_id, _lib._sel_objectAtIndexedSubscript_1, idx); return NSObject._(_ret, _lib); } - void enumerateObjectsUsingBlock(ObjCBlock4 block) { + void enumerateObjectsUsingBlock_(ObjCBlock4 block) { _lib._objc_msgSend_113( _id, _lib._sel_enumerateObjectsUsingBlock_1, block._impl); } - void enumerateObjectsWithOptions_usingBlock(int opts, ObjCBlock4 block) { + void enumerateObjectsWithOptions_usingBlock_(int opts, ObjCBlock4 block) { _lib._objc_msgSend_114(_id, _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._impl); } - void enumerateObjectsAtIndexes_options_usingBlock( + void enumerateObjectsAtIndexes_options_usingBlock_( NSObject? s, int opts, ObjCBlock4 block) { _lib._objc_msgSend_115( _id, @@ -7415,12 +7422,12 @@ class NSArray extends NSObject { block._impl); } - int indexOfObjectPassingTest(ObjCBlock5 predicate) { + int indexOfObjectPassingTest_(ObjCBlock5 predicate) { return _lib._objc_msgSend_116( _id, _lib._sel_indexOfObjectPassingTest_1, predicate._impl); } - int indexOfObjectWithOptions_passingTest(int opts, ObjCBlock5 predicate) { + int indexOfObjectWithOptions_passingTest_(int opts, ObjCBlock5 predicate) { return _lib._objc_msgSend_117( _id, _lib._sel_indexOfObjectWithOptions_passingTest_1, @@ -7428,7 +7435,7 @@ class NSArray extends NSObject { predicate._impl); } - int indexOfObjectAtIndexes_options_passingTest( + int indexOfObjectAtIndexes_options_passingTest_( NSObject? s, int opts, ObjCBlock5 predicate) { return _lib._objc_msgSend_118( _id, @@ -7438,13 +7445,13 @@ class NSArray extends NSObject { predicate._impl); } - NSIndexSet indexesOfObjectsPassingTest(ObjCBlock5 predicate) { + NSIndexSet indexesOfObjectsPassingTest_(ObjCBlock5 predicate) { final _ret = _lib._objc_msgSend_135( _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._impl); return NSIndexSet._(_ret, _lib); } - NSIndexSet indexesOfObjectsWithOptions_passingTest( + NSIndexSet indexesOfObjectsWithOptions_passingTest_( int opts, ObjCBlock5 predicate) { final _ret = _lib._objc_msgSend_136( _id, @@ -7454,7 +7461,7 @@ class NSArray extends NSObject { return NSIndexSet._(_ret, _lib); } - NSIndexSet indexesOfObjectsAtIndexes_options_passingTest( + NSIndexSet indexesOfObjectsAtIndexes_options_passingTest_( NSObject? s, int opts, ObjCBlock5 predicate) { final _ret = _lib._objc_msgSend_137( _id, @@ -7465,7 +7472,7 @@ class NSArray extends NSObject { return NSIndexSet._(_ret, _lib); } - int indexOfObject_inSortedRange_options_usingComparator( + int indexOfObject_inSortedRange_options_usingComparator_( NSObject obj, NSRange r, int opts, NSComparator cmp) { return _lib._objc_msgSend_138( _id, @@ -7481,59 +7488,59 @@ class NSArray extends NSObject { return NSArray._(_ret, _lib); } - static NSArray arrayWithObject(NativeObjCLibrary _lib, NSObject anObject) { + static NSArray arrayWithObject_(NativeObjCLibrary _lib, NSObject anObject) { final _ret = _lib._objc_msgSend_13( _lib._class_NSArray1, _lib._sel_arrayWithObject_1, anObject._id); return NSArray._(_ret, _lib); } - static NSArray arrayWithObjects_count(NativeObjCLibrary _lib, + static NSArray arrayWithObjects_count_(NativeObjCLibrary _lib, ffi.Pointer> objects, int cnt) { final _ret = _lib._objc_msgSend_106( _lib._class_NSArray1, _lib._sel_arrayWithObjects_count_1, objects, cnt); return NSArray._(_ret, _lib); } - static NSArray arrayWithObjects(NativeObjCLibrary _lib, NSObject firstObj) { + static NSArray arrayWithObjects_(NativeObjCLibrary _lib, NSObject firstObj) { final _ret = _lib._objc_msgSend_13( _lib._class_NSArray1, _lib._sel_arrayWithObjects_1, firstObj._id); return NSArray._(_ret, _lib); } - static NSArray arrayWithArray(NativeObjCLibrary _lib, NSObject? array) { + static NSArray arrayWithArray_(NativeObjCLibrary _lib, NSObject? array) { final _ret = _lib._objc_msgSend_13(_lib._class_NSArray1, _lib._sel_arrayWithArray_1, array?._id ?? ffi.nullptr); return NSArray._(_ret, _lib); } - NSArray initWithObjects(NSObject firstObj) { + NSArray initWithObjects_(NSObject firstObj) { final _ret = _lib._objc_msgSend_13(_id, _lib._sel_initWithObjects_1, firstObj._id); return NSArray._(_ret, _lib); } - NSArray initWithArray(NSObject? array) { + NSArray initWithArray_(NSObject? array) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithArray_1, array?._id ?? ffi.nullptr); return NSArray._(_ret, _lib); } - NSArray initWithArray_copyItems(NSObject? array, bool flag) { + NSArray initWithArray_copyItems_(NSObject? array, bool flag) { final _ret = _lib._objc_msgSend_139(_id, _lib._sel_initWithArray_copyItems_1, array?._id ?? ffi.nullptr, flag); return NSArray._(_ret, _lib); } - void getObjects(ffi.Pointer> objects) { + void getObjects_(ffi.Pointer> objects) { _lib._objc_msgSend_140(_id, _lib._sel_getObjects_1, objects); } - bool writeToFile_atomically(NSObject? path, bool useAuxiliaryFile) { + bool writeToFile_atomically_(NSObject? path, bool useAuxiliaryFile) { return _lib._objc_msgSend_72(_id, _lib._sel_writeToFile_atomically_1, path?._id ?? ffi.nullptr, useAuxiliaryFile); } - bool writeToURL_atomically(NSObject? url, bool atomically) { + bool writeToURL_atomically_(NSObject? url, bool atomically) { return _lib._objc_msgSend_72(_id, _lib._sel_writeToURL_atomically_1, url?._id ?? ffi.nullptr, atomically); } @@ -7642,37 +7649,37 @@ class NSIndexSet extends NSObject { return NSIndexSet._(_ret, _lib); } - static NSIndexSet indexSetWithIndex(NativeObjCLibrary _lib, int value) { + static NSIndexSet indexSetWithIndex_(NativeObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_105( _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndex_1, value); return NSIndexSet._(_ret, _lib); } - static NSIndexSet indexSetWithIndexesInRange( + static NSIndexSet indexSetWithIndexesInRange_( NativeObjCLibrary _lib, NSRange range) { final _ret = _lib._objc_msgSend_119( _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndexesInRange_1, range); return NSIndexSet._(_ret, _lib); } - NSIndexSet initWithIndexesInRange(NSRange range) { + NSIndexSet initWithIndexesInRange_(NSRange range) { final _ret = _lib._objc_msgSend_119(_id, _lib._sel_initWithIndexesInRange_1, range); return NSIndexSet._(_ret, _lib); } - NSIndexSet initWithIndexSet(NSObject? indexSet) { + NSIndexSet initWithIndexSet_(NSObject? indexSet) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithIndexSet_1, indexSet?._id ?? ffi.nullptr); return NSIndexSet._(_ret, _lib); } - NSIndexSet initWithIndex(int value) { + NSIndexSet initWithIndex_(int value) { final _ret = _lib._objc_msgSend_105(_id, _lib._sel_initWithIndex_1, value); return NSIndexSet._(_ret, _lib); } - bool isEqualToIndexSet(NSObject? indexSet) { + bool isEqualToIndexSet_(NSObject? indexSet) { return _lib._objc_msgSend_4( _id, _lib._sel_isEqualToIndexSet_1, indexSet?._id ?? ffi.nullptr); } @@ -7689,25 +7696,25 @@ class NSIndexSet extends NSObject { return _lib._objc_msgSend_11(_id, _lib._sel_lastIndex1); } - int indexGreaterThanIndex(int value) { + int indexGreaterThanIndex_(int value) { return _lib._objc_msgSend_44(_id, _lib._sel_indexGreaterThanIndex_1, value); } - int indexLessThanIndex(int value) { + int indexLessThanIndex_(int value) { return _lib._objc_msgSend_44(_id, _lib._sel_indexLessThanIndex_1, value); } - int indexGreaterThanOrEqualToIndex(int value) { + int indexGreaterThanOrEqualToIndex_(int value) { return _lib._objc_msgSend_44( _id, _lib._sel_indexGreaterThanOrEqualToIndex_1, value); } - int indexLessThanOrEqualToIndex(int value) { + int indexLessThanOrEqualToIndex_(int value) { return _lib._objc_msgSend_44( _id, _lib._sel_indexLessThanOrEqualToIndex_1, value); } - int getIndexes_maxCount_inIndexRange(ffi.Pointer indexBuffer, + int getIndexes_maxCount_inIndexRange_(ffi.Pointer indexBuffer, int bufferSize, NSRangePointer range) { return _lib._objc_msgSend_120( _id, @@ -7717,41 +7724,41 @@ class NSIndexSet extends NSObject { range); } - int countOfIndexesInRange(NSRange range) { + int countOfIndexesInRange_(NSRange range) { return _lib._objc_msgSend_121( _id, _lib._sel_countOfIndexesInRange_1, range); } - bool containsIndex(int value) { + bool containsIndex_(int value) { return _lib._objc_msgSend_40(_id, _lib._sel_containsIndex_1, value); } - bool containsIndexesInRange(NSRange range) { + bool containsIndexesInRange_(NSRange range) { return _lib._objc_msgSend_122( _id, _lib._sel_containsIndexesInRange_1, range); } - bool containsIndexes(NSObject? indexSet) { + bool containsIndexes_(NSObject? indexSet) { return _lib._objc_msgSend_4( _id, _lib._sel_containsIndexes_1, indexSet?._id ?? ffi.nullptr); } - bool intersectsIndexesInRange(NSRange range) { + bool intersectsIndexesInRange_(NSRange range) { return _lib._objc_msgSend_122( _id, _lib._sel_intersectsIndexesInRange_1, range); } - void enumerateIndexesUsingBlock(ObjCBlock6 block) { + void enumerateIndexesUsingBlock_(ObjCBlock6 block) { _lib._objc_msgSend_123( _id, _lib._sel_enumerateIndexesUsingBlock_1, block._impl); } - void enumerateIndexesWithOptions_usingBlock(int opts, ObjCBlock6 block) { + void enumerateIndexesWithOptions_usingBlock_(int opts, ObjCBlock6 block) { _lib._objc_msgSend_124(_id, _lib._sel_enumerateIndexesWithOptions_usingBlock_1, opts, block._impl); } - void enumerateIndexesInRange_options_usingBlock( + void enumerateIndexesInRange_options_usingBlock_( NSRange range, int opts, ObjCBlock6 block) { _lib._objc_msgSend_125( _id, @@ -7761,17 +7768,17 @@ class NSIndexSet extends NSObject { block._impl); } - int indexPassingTest(ObjCBlock7 predicate) { + int indexPassingTest_(ObjCBlock7 predicate) { return _lib._objc_msgSend_126( _id, _lib._sel_indexPassingTest_1, predicate._impl); } - int indexWithOptions_passingTest(int opts, ObjCBlock7 predicate) { + int indexWithOptions_passingTest_(int opts, ObjCBlock7 predicate) { return _lib._objc_msgSend_127( _id, _lib._sel_indexWithOptions_passingTest_1, opts, predicate._impl); } - int indexInRange_options_passingTest( + int indexInRange_options_passingTest_( NSRange range, int opts, ObjCBlock7 predicate) { return _lib._objc_msgSend_128( _id, @@ -7781,19 +7788,19 @@ class NSIndexSet extends NSObject { predicate._impl); } - NSIndexSet indexesPassingTest(ObjCBlock7 predicate) { + NSIndexSet indexesPassingTest_(ObjCBlock7 predicate) { final _ret = _lib._objc_msgSend_129( _id, _lib._sel_indexesPassingTest_1, predicate._impl); return NSIndexSet._(_ret, _lib); } - NSIndexSet indexesWithOptions_passingTest(int opts, ObjCBlock7 predicate) { + NSIndexSet indexesWithOptions_passingTest_(int opts, ObjCBlock7 predicate) { final _ret = _lib._objc_msgSend_130( _id, _lib._sel_indexesWithOptions_passingTest_1, opts, predicate._impl); return NSIndexSet._(_ret, _lib); } - NSIndexSet indexesInRange_options_passingTest( + NSIndexSet indexesInRange_options_passingTest_( NSRange range, int opts, ObjCBlock7 predicate) { final _ret = _lib._objc_msgSend_131( _id, @@ -7804,17 +7811,17 @@ class NSIndexSet extends NSObject { return NSIndexSet._(_ret, _lib); } - void enumerateRangesUsingBlock(ObjCBlock8 block) { + void enumerateRangesUsingBlock_(ObjCBlock8 block) { _lib._objc_msgSend_132( _id, _lib._sel_enumerateRangesUsingBlock_1, block._impl); } - void enumerateRangesWithOptions_usingBlock(int opts, ObjCBlock8 block) { + void enumerateRangesWithOptions_usingBlock_(int opts, ObjCBlock8 block) { _lib._objc_msgSend_133(_id, _lib._sel_enumerateRangesWithOptions_usingBlock_1, opts, block._impl); } - void enumerateRangesInRange_options_usingBlock( + void enumerateRangesInRange_options_usingBlock_( NSRange range, int opts, ObjCBlock8 block) { _lib._objc_msgSend_134( _id, @@ -7990,11 +7997,11 @@ class NSMutableArray extends NSArray { return NSMutableArray._(other, lib); } - void addObject(NSObject anObject) { + void addObject_(NSObject anObject) { _lib._objc_msgSend_8(_id, _lib._sel_addObject_1, anObject._id); } - void insertObject_atIndex(NSObject anObject, int index) { + void insertObject_atIndex_(NSObject anObject, int index) { _lib._objc_msgSend_141( _id, _lib._sel_insertObject_atIndex_1, anObject._id, index); } @@ -8003,11 +8010,11 @@ class NSMutableArray extends NSArray { _lib._objc_msgSend_0(_id, _lib._sel_removeLastObject1); } - void removeObjectAtIndex(int index) { + void removeObjectAtIndex_(int index) { _lib._objc_msgSend_41(_id, _lib._sel_removeObjectAtIndex_1, index); } - void replaceObjectAtIndex_withObject(int index, NSObject anObject) { + void replaceObjectAtIndex_withObject_(int index, NSObject anObject) { _lib._objc_msgSend_142( _id, _lib._sel_replaceObjectAtIndex_withObject_1, index, anObject._id); } @@ -8018,25 +8025,25 @@ class NSMutableArray extends NSArray { return NSMutableArray._(_ret, _lib); } - NSMutableArray initWithCapacity(int numItems) { + NSMutableArray initWithCapacity_(int numItems) { final _ret = _lib._objc_msgSend_105(_id, _lib._sel_initWithCapacity_1, numItems); return NSMutableArray._(_ret, _lib); } @override - NSMutableArray initWithCoder(NSObject? coder) { + NSMutableArray initWithCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); return NSMutableArray._(_ret, _lib); } - void addObjectsFromArray(NSObject? otherArray) { + void addObjectsFromArray_(NSObject? otherArray) { _lib._objc_msgSend_8( _id, _lib._sel_addObjectsFromArray_1, otherArray?._id ?? ffi.nullptr); } - void exchangeObjectAtIndex_withObjectAtIndex(int idx1, int idx2) { + void exchangeObjectAtIndex_withObjectAtIndex_(int idx1, int idx2) { _lib._objc_msgSend_143( _id, _lib._sel_exchangeObjectAtIndex_withObjectAtIndex_1, idx1, idx2); } @@ -8045,41 +8052,41 @@ class NSMutableArray extends NSArray { _lib._objc_msgSend_0(_id, _lib._sel_removeAllObjects1); } - void removeObject_inRange(NSObject anObject, NSRange range) { + void removeObject_inRange_(NSObject anObject, NSRange range) { _lib._objc_msgSend_144( _id, _lib._sel_removeObject_inRange_1, anObject._id, range); } - void removeObject(NSObject anObject) { + void removeObject_(NSObject anObject) { _lib._objc_msgSend_8(_id, _lib._sel_removeObject_1, anObject._id); } - void removeObjectIdenticalTo_inRange(NSObject anObject, NSRange range) { + void removeObjectIdenticalTo_inRange_(NSObject anObject, NSRange range) { _lib._objc_msgSend_144( _id, _lib._sel_removeObjectIdenticalTo_inRange_1, anObject._id, range); } - void removeObjectIdenticalTo(NSObject anObject) { + void removeObjectIdenticalTo_(NSObject anObject) { _lib._objc_msgSend_8( _id, _lib._sel_removeObjectIdenticalTo_1, anObject._id); } - void removeObjectsFromIndices_numIndices( + void removeObjectsFromIndices_numIndices_( ffi.Pointer indices, int cnt) { _lib._objc_msgSend_145( _id, _lib._sel_removeObjectsFromIndices_numIndices_1, indices, cnt); } - void removeObjectsInArray(NSObject? otherArray) { + void removeObjectsInArray_(NSObject? otherArray) { _lib._objc_msgSend_8( _id, _lib._sel_removeObjectsInArray_1, otherArray?._id ?? ffi.nullptr); } - void removeObjectsInRange(NSRange range) { + void removeObjectsInRange_(NSRange range) { _lib._objc_msgSend_146(_id, _lib._sel_removeObjectsInRange_1, range); } - void replaceObjectsInRange_withObjectsFromArray_range( + void replaceObjectsInRange_withObjectsFromArray_range_( NSRange range, NSObject? otherArray, NSRange otherRange) { _lib._objc_msgSend_147( _id, @@ -8089,7 +8096,7 @@ class NSMutableArray extends NSArray { otherRange); } - void replaceObjectsInRange_withObjectsFromArray( + void replaceObjectsInRange_withObjectsFromArray_( NSRange range, NSObject? otherArray) { _lib._objc_msgSend_148( _id, @@ -8098,12 +8105,12 @@ class NSMutableArray extends NSArray { otherArray?._id ?? ffi.nullptr); } - void setArray(NSObject? otherArray) { + void setArray_(NSObject? otherArray) { _lib._objc_msgSend_8( _id, _lib._sel_setArray_1, otherArray?._id ?? ffi.nullptr); } - void sortUsingFunction_context( + void sortUsingFunction_context_( ffi.Pointer< ffi.NativeFunction< NSInteger Function(ffi.Pointer, @@ -8114,48 +8121,48 @@ class NSMutableArray extends NSArray { _id, _lib._sel_sortUsingFunction_context_1, compare, context); } - void sortUsingSelector(ffi.Pointer comparator) { + void sortUsingSelector_(ffi.Pointer comparator) { _lib._objc_msgSend_6(_id, _lib._sel_sortUsingSelector_1, comparator); } - void insertObjects_atIndexes(NSObject? objects, NSObject? indexes) { + void insertObjects_atIndexes_(NSObject? objects, NSObject? indexes) { _lib._objc_msgSend_150(_id, _lib._sel_insertObjects_atIndexes_1, objects?._id ?? ffi.nullptr, indexes?._id ?? ffi.nullptr); } - void removeObjectsAtIndexes(NSObject? indexes) { + void removeObjectsAtIndexes_(NSObject? indexes) { _lib._objc_msgSend_8( _id, _lib._sel_removeObjectsAtIndexes_1, indexes?._id ?? ffi.nullptr); } - void replaceObjectsAtIndexes_withObjects( + void replaceObjectsAtIndexes_withObjects_( NSObject? indexes, NSObject? objects) { _lib._objc_msgSend_150(_id, _lib._sel_replaceObjectsAtIndexes_withObjects_1, indexes?._id ?? ffi.nullptr, objects?._id ?? ffi.nullptr); } - void setObject_atIndexedSubscript(NSObject obj, int idx) { + void setObject_atIndexedSubscript_(NSObject obj, int idx) { _lib._objc_msgSend_141( _id, _lib._sel_setObject_atIndexedSubscript_1, obj._id, idx); } - void sortUsingComparator(NSComparator cmptr) { + void sortUsingComparator_(NSComparator cmptr) { _lib._objc_msgSend_151(_id, _lib._sel_sortUsingComparator_1, cmptr); } - void sortWithOptions_usingComparator(int opts, NSComparator cmptr) { + void sortWithOptions_usingComparator_(int opts, NSComparator cmptr) { _lib._objc_msgSend_152( _id, _lib._sel_sortWithOptions_usingComparator_1, opts, cmptr); } - static NSMutableArray arrayWithCapacity( + static NSMutableArray arrayWithCapacity_( NativeObjCLibrary _lib, int numItems) { final _ret = _lib._objc_msgSend_105( _lib._class_NSMutableArray1, _lib._sel_arrayWithCapacity_1, numItems); return NSMutableArray._(_ret, _lib); } - void applyDifference(NSObject? difference) { + void applyDifference_(NSObject? difference) { _lib._objc_msgSend_8( _id, _lib._sel_applyDifference_1, difference?._id ?? ffi.nullptr); } @@ -8166,28 +8173,28 @@ class NSMutableArray extends NSArray { return NSMutableArray._(_ret, _lib); } - static NSMutableArray arrayWithObject( + static NSMutableArray arrayWithObject_( NativeObjCLibrary _lib, NSObject anObject) { final _ret = _lib._objc_msgSend_13( _lib._class_NSMutableArray1, _lib._sel_arrayWithObject_1, anObject._id); return NSMutableArray._(_ret, _lib); } - static NSMutableArray arrayWithObjects_count(NativeObjCLibrary _lib, + static NSMutableArray arrayWithObjects_count_(NativeObjCLibrary _lib, ffi.Pointer> objects, int cnt) { final _ret = _lib._objc_msgSend_106(_lib._class_NSMutableArray1, _lib._sel_arrayWithObjects_count_1, objects, cnt); return NSMutableArray._(_ret, _lib); } - static NSMutableArray arrayWithObjects( + static NSMutableArray arrayWithObjects_( NativeObjCLibrary _lib, NSObject firstObj) { final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableArray1, _lib._sel_arrayWithObjects_1, firstObj._id); return NSMutableArray._(_ret, _lib); } - static NSMutableArray arrayWithArray( + static NSMutableArray arrayWithArray_( NativeObjCLibrary _lib, NSObject? array) { final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableArray1, _lib._sel_arrayWithArray_1, array?._id ?? ffi.nullptr); @@ -8237,7 +8244,7 @@ class NSItemProvider extends NSObject { return NSItemProvider._(_ret, _lib); } - void registerDataRepresentationForTypeIdentifier_visibility_loadHandler( + void registerDataRepresentationForTypeIdentifier_visibility_loadHandler_( NSObject? typeIdentifier, int visibility, ObjCBlock10 loadHandler) { _lib._objc_msgSend_153( _id, @@ -8248,7 +8255,7 @@ class NSItemProvider extends NSObject { } void - registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler( + registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_( NSObject? typeIdentifier, int fileOptions, int visibility, @@ -8268,14 +8275,14 @@ class NSItemProvider extends NSObject { return _ret.address == 0 ? null : NSObject._(_ret, _lib); } - bool hasItemConformingToTypeIdentifier(NSObject? typeIdentifier) { + bool hasItemConformingToTypeIdentifier_(NSObject? typeIdentifier) { return _lib._objc_msgSend_4( _id, _lib._sel_hasItemConformingToTypeIdentifier_1, typeIdentifier?._id ?? ffi.nullptr); } - bool hasRepresentationConformingToTypeIdentifier_fileOptions( + bool hasRepresentationConformingToTypeIdentifier_fileOptions_( NSObject? typeIdentifier, int fileOptions) { return _lib._objc_msgSend_155( _id, @@ -8284,7 +8291,7 @@ class NSItemProvider extends NSObject { fileOptions); } - NSProgress loadDataRepresentationForTypeIdentifier_completionHandler( + NSProgress loadDataRepresentationForTypeIdentifier_completionHandler_( NSObject? typeIdentifier, ObjCBlock11 completionHandler) { final _ret = _lib._objc_msgSend_156( _id, @@ -8294,7 +8301,7 @@ class NSItemProvider extends NSObject { return NSProgress._(_ret, _lib); } - NSProgress loadFileRepresentationForTypeIdentifier_completionHandler( + NSProgress loadFileRepresentationForTypeIdentifier_completionHandler_( NSObject? typeIdentifier, ObjCBlock11 completionHandler) { final _ret = _lib._objc_msgSend_156( _id, @@ -8304,7 +8311,7 @@ class NSItemProvider extends NSObject { return NSProgress._(_ret, _lib); } - NSProgress loadInPlaceFileRepresentationForTypeIdentifier_completionHandler( + NSProgress loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_( NSObject? typeIdentifier, ObjCBlock13 completionHandler) { final _ret = _lib._objc_msgSend_157( _id, @@ -8324,18 +8331,18 @@ class NSItemProvider extends NSObject { _id, _lib._sel_setSuggestedName_1, value?._id ?? ffi.nullptr); } - NSItemProvider initWithObject(NSObject? object) { + NSItemProvider initWithObject_(NSObject? object) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithObject_1, object?._id ?? ffi.nullptr); return NSItemProvider._(_ret, _lib); } - void registerObject_visibility(NSObject? object, int visibility) { + void registerObject_visibility_(NSObject? object, int visibility) { _lib._objc_msgSend_158(_id, _lib._sel_registerObject_visibility_1, object?._id ?? ffi.nullptr, visibility); } - void registerObjectOfClass_visibility_loadHandler( + void registerObjectOfClass_visibility_loadHandler_( NSObject? aClass, int visibility, ObjCBlock10 loadHandler) { _lib._objc_msgSend_153( _id, @@ -8345,12 +8352,12 @@ class NSItemProvider extends NSObject { loadHandler._impl); } - bool canLoadObjectOfClass(NSObject? aClass) { + bool canLoadObjectOfClass_(NSObject? aClass) { return _lib._objc_msgSend_4( _id, _lib._sel_canLoadObjectOfClass_1, aClass?._id ?? ffi.nullptr); } - NSProgress loadObjectOfClass_completionHandler( + NSProgress loadObjectOfClass_completionHandler_( NSObject? aClass, ObjCBlock11 completionHandler) { final _ret = _lib._objc_msgSend_156( _id, @@ -8360,7 +8367,7 @@ class NSItemProvider extends NSObject { return NSProgress._(_ret, _lib); } - NSItemProvider initWithItem_typeIdentifier( + NSItemProvider initWithItem_typeIdentifier_( NSObject? item, NSObject? typeIdentifier) { final _ret = _lib._objc_msgSend_58( _id, @@ -8370,13 +8377,13 @@ class NSItemProvider extends NSObject { return NSItemProvider._(_ret, _lib); } - NSItemProvider initWithContentsOfURL(NSObject? fileURL) { + NSItemProvider initWithContentsOfURL_(NSObject? fileURL) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithContentsOfURL_1, fileURL?._id ?? ffi.nullptr); return NSItemProvider._(_ret, _lib); } - void registerItemForTypeIdentifier_loadHandler( + void registerItemForTypeIdentifier_loadHandler_( NSObject? typeIdentifier, NSItemProviderLoadHandler loadHandler) { _lib._objc_msgSend_159( _id, @@ -8385,7 +8392,7 @@ class NSItemProvider extends NSObject { loadHandler); } - void loadItemForTypeIdentifier_options_completionHandler( + void loadItemForTypeIdentifier_options_completionHandler_( NSObject? typeIdentifier, NSObject? options, NSItemProviderCompletionHandler completionHandler) { @@ -8405,7 +8412,7 @@ class NSItemProvider extends NSObject { _lib._objc_msgSend_162(_id, _lib._sel_setPreviewImageHandler_1, value); } - void loadPreviewImageWithOptions_completionHandler( + void loadPreviewImageWithOptions_completionHandler_( NSObject? options, NSItemProviderCompletionHandler completionHandler) { _lib._objc_msgSend_163( _id, @@ -8654,36 +8661,36 @@ class NSMutableString extends NSString { return NSMutableString._(other, lib); } - void replaceCharactersInRange_withString(NSRange range, NSObject? aString) { + void replaceCharactersInRange_withString_(NSRange range, NSObject? aString) { _lib._objc_msgSend_148(_id, _lib._sel_replaceCharactersInRange_withString_1, range, aString?._id ?? ffi.nullptr); } - void insertString_atIndex(NSObject? aString, int loc) { + void insertString_atIndex_(NSObject? aString, int loc) { _lib._objc_msgSend_141(_id, _lib._sel_insertString_atIndex_1, aString?._id ?? ffi.nullptr, loc); } - void deleteCharactersInRange(NSRange range) { + void deleteCharactersInRange_(NSRange range) { _lib._objc_msgSend_146(_id, _lib._sel_deleteCharactersInRange_1, range); } - void appendString(NSObject? aString) { + void appendString_(NSObject? aString) { _lib._objc_msgSend_8( _id, _lib._sel_appendString_1, aString?._id ?? ffi.nullptr); } - void appendFormat(NSObject? format) { + void appendFormat_(NSObject? format) { _lib._objc_msgSend_8( _id, _lib._sel_appendFormat_1, format?._id ?? ffi.nullptr); } - void setString(NSObject? aString) { + void setString_(NSObject? aString) { _lib._objc_msgSend_8( _id, _lib._sel_setString_1, aString?._id ?? ffi.nullptr); } - int replaceOccurrencesOfString_withString_options_range(NSObject? target, + int replaceOccurrencesOfString_withString_options_range_(NSObject? target, NSObject? replacement, int options, NSRange searchRange) { return _lib._objc_msgSend_164( _id, @@ -8694,7 +8701,7 @@ class NSMutableString extends NSString { searchRange); } - bool applyTransform_reverse_range_updatedRange(NSStringTransform transform, + bool applyTransform_reverse_range_updatedRange_(NSStringTransform transform, bool reverse, NSRange range, NSRangePointer resultingRange) { return _lib._objc_msgSend_165( _id, @@ -8705,13 +8712,13 @@ class NSMutableString extends NSString { resultingRange); } - NSMutableString initWithCapacity(int capacity) { + NSMutableString initWithCapacity_(int capacity) { final _ret = _lib._objc_msgSend_166(_id, _lib._sel_initWithCapacity_1, capacity); return NSMutableString._(_ret, _lib); } - static NSMutableString stringWithCapacity( + static NSMutableString stringWithCapacity_( NativeObjCLibrary _lib, int capacity) { final _ret = _lib._objc_msgSend_166( _lib._class_NSMutableString1, _lib._sel_stringWithCapacity_1, capacity); @@ -8724,7 +8731,7 @@ class NSMutableString extends NSString { _lib._class_NSMutableString1, _lib._sel_availableStringEncodings1); } - static NSString localizedNameOfStringEncoding( + static NSString localizedNameOfStringEncoding_( NativeObjCLibrary _lib, int encoding) { final _ret = _lib._objc_msgSend_14(_lib._class_NSMutableString1, _lib._sel_localizedNameOfStringEncoding_1, encoding); @@ -8742,49 +8749,49 @@ class NSMutableString extends NSString { return NSMutableString._(_ret, _lib); } - static NSMutableString stringWithString( + static NSMutableString stringWithString_( NativeObjCLibrary _lib, NSObject? string) { final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); return NSMutableString._(_ret, _lib); } - static NSMutableString stringWithCharacters_length( + static NSMutableString stringWithCharacters_length_( NativeObjCLibrary _lib, ffi.Pointer characters, int length) { final _ret = _lib._objc_msgSend_55(_lib._class_NSMutableString1, _lib._sel_stringWithCharacters_length_1, characters, length); return NSMutableString._(_ret, _lib); } - static NSMutableString stringWithUTF8String( + static NSMutableString stringWithUTF8String_( NativeObjCLibrary _lib, ffi.Pointer nullTerminatedCString) { final _ret = _lib._objc_msgSend_56(_lib._class_NSMutableString1, _lib._sel_stringWithUTF8String_1, nullTerminatedCString); return NSMutableString._(_ret, _lib); } - static NSMutableString stringWithFormat( + static NSMutableString stringWithFormat_( NativeObjCLibrary _lib, NSObject? format) { final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); return NSMutableString._(_ret, _lib); } - static NSMutableString localizedStringWithFormat( + static NSMutableString localizedStringWithFormat_( NativeObjCLibrary _lib, NSObject? format) { final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); return NSMutableString._(_ret, _lib); } - static NSMutableString stringWithCString_encoding( + static NSMutableString stringWithCString_encoding_( NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { final _ret = _lib._objc_msgSend_64(_lib._class_NSMutableString1, _lib._sel_stringWithCString_encoding_1, cString, enc); return NSMutableString._(_ret, _lib); } - static NSMutableString stringWithContentsOfURL_encoding_error( + static NSMutableString stringWithContentsOfURL_encoding_error_( NativeObjCLibrary _lib, NSObject? url, int enc, @@ -8798,7 +8805,7 @@ class NSMutableString extends NSString { return NSMutableString._(_ret, _lib); } - static NSMutableString stringWithContentsOfFile_encoding_error( + static NSMutableString stringWithContentsOfFile_encoding_error_( NativeObjCLibrary _lib, NSObject? path, int enc, @@ -8812,7 +8819,7 @@ class NSMutableString extends NSString { return NSMutableString._(_ret, _lib); } - static NSMutableString stringWithContentsOfURL_usedEncoding_error( + static NSMutableString stringWithContentsOfURL_usedEncoding_error_( NativeObjCLibrary _lib, NSObject? url, ffi.Pointer enc, @@ -8826,7 +8833,7 @@ class NSMutableString extends NSString { return NSMutableString._(_ret, _lib); } - static NSMutableString stringWithContentsOfFile_usedEncoding_error( + static NSMutableString stringWithContentsOfFile_usedEncoding_error_( NativeObjCLibrary _lib, NSObject? path, ffi.Pointer enc, @@ -8841,7 +8848,7 @@ class NSMutableString extends NSString { } static int - stringEncodingForData_encodingOptions_convertedString_usedLossyConversion( + stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( NativeObjCLibrary _lib, NSObject? data, NSObject? opts, @@ -8856,28 +8863,28 @@ class NSMutableString extends NSString { usedLossyConversion); } - static NSObject stringWithContentsOfFile( + static NSObject stringWithContentsOfFile_( NativeObjCLibrary _lib, NSObject? path) { final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static NSObject stringWithContentsOfURL( + static NSObject stringWithContentsOfURL_( NativeObjCLibrary _lib, NSObject? url) { final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static NSObject stringWithCString_length( + static NSObject stringWithCString_length_( NativeObjCLibrary _lib, ffi.Pointer bytes, int length) { final _ret = _lib._objc_msgSend_64(_lib._class_NSMutableString1, _lib._sel_stringWithCString_length_1, bytes, length); return NSObject._(_ret, _lib); } - static NSObject stringWithCString( + static NSObject stringWithCString_( NativeObjCLibrary _lib, ffi.Pointer bytes) { final _ret = _lib._objc_msgSend_56( _lib._class_NSMutableString1, _lib._sel_stringWithCString_1, bytes); @@ -8919,18 +8926,18 @@ class Foo extends NSObject { _lib._objc_msgSend_168(_id, _lib._sel_setIntVal_1, value); } - static Foo makeFoo(NativeObjCLibrary _lib, double x) { + static Foo makeFoo_(NativeObjCLibrary _lib, double x) { final _ret = _lib._objc_msgSend_169(_lib._class_Foo1, _lib._sel_makeFoo_1, x); return Foo._(_ret, _lib); } - int multiply_withOtherFoo(bool useIntVals, NSObject? other) { + int multiply_withOtherFoo_(bool useIntVals, NSObject? other) { return _lib._objc_msgSend_170(_id, _lib._sel_multiply_withOtherFoo_1, useIntVals, other?._id ?? ffi.nullptr); } - void setDoubleVal(double x) { + void setDoubleVal_(double x) { _lib._objc_msgSend_171(_id, _lib._sel_setDoubleVal_1, x); } diff --git a/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart b/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart index 4310cb8bbf..8f10022e07 100644 --- a/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart @@ -749,7 +749,7 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject allocWithZone( + static NSObject allocWithZone_( NullableTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); @@ -779,64 +779,65 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject copyWithZone( + static NSObject copyWithZone_( NullableTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); return NSObject._(_ret, _lib); } - static NSObject mutableCopyWithZone( + static NSObject mutableCopyWithZone_( NullableTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); return NSObject._(_ret, _lib); } - static bool instancesRespondToSelector( + static bool instancesRespondToSelector_( NullableTestObjCLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_3(_lib._class_NSObject1, _lib._sel_instancesRespondToSelector_1, aSelector); } - static bool conformsToProtocol( + static bool conformsToProtocol_( NullableTestObjCLibrary _lib, NSObject? protocol) { return _lib._objc_msgSend_4(_lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); } - IMP methodForSelector(ffi.Pointer aSelector) { + IMP methodForSelector_(ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); } - static IMP instanceMethodForSelector( + static IMP instanceMethodForSelector_( NullableTestObjCLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_lib._class_NSObject1, _lib._sel_instanceMethodForSelector_1, aSelector); } - void doesNotRecognizeSelector(ffi.Pointer aSelector) { + void doesNotRecognizeSelector_(ffi.Pointer aSelector) { _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); } - NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_7( _id, _lib._sel_forwardingTargetForSelector_1, aSelector); return NSObject._(_ret, _lib); } - void forwardInvocation(NSObject? anInvocation) { + void forwardInvocation_(NSObject? anInvocation) { _lib._objc_msgSend_8( _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); } - NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + NSMethodSignature methodSignatureForSelector_( + ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9( _id, _lib._sel_methodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static NSMethodSignature instanceMethodSignatureForSelector( + static NSMethodSignature instanceMethodSignatureForSelector_( NullableTestObjCLibrary _lib, ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, _lib._sel_instanceMethodSignatureForSelector_1, aSelector); @@ -851,18 +852,19 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); } - static bool isSubclassOfClass(NullableTestObjCLibrary _lib, NSObject aClass) { + static bool isSubclassOfClass_( + NullableTestObjCLibrary _lib, NSObject aClass) { return _lib._objc_msgSend_4( _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); } - static bool resolveClassMethod( + static bool resolveClassMethod_( NullableTestObjCLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); } - static bool resolveInstanceMethod( + static bool resolveInstanceMethod_( NullableTestObjCLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); @@ -899,7 +901,7 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); } - static void setVersion(NullableTestObjCLibrary _lib, int aVersion) { + static void setVersion_(NullableTestObjCLibrary _lib, int aVersion) { _lib._objc_msgSend_16( _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); } @@ -909,19 +911,19 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - NSObject replacementObjectForCoder(NSObject? coder) { + NSObject replacementObjectForCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_17( _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - NSObject awakeAfterUsingCoder(NSObject? coder) { + NSObject awakeAfterUsingCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_17( _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static void poseAsClass(NullableTestObjCLibrary _lib, NSObject aClass) { + static void poseAsClass_(NullableTestObjCLibrary _lib, NSObject aClass) { _lib._objc_msgSend_8( _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); } @@ -974,7 +976,7 @@ class NSString extends _ObjCWrapper { factory NSString(NullableTestObjCLibrary _lib, String str) { final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); pkg_ffi.calloc.free(cstr); return nsstr; } @@ -982,7 +984,7 @@ class NSString extends _ObjCWrapper { @override String toString() => (UTF8String).cast().toDartString(); - static NSString stringWithCString_encoding(NullableTestObjCLibrary _lib, + static NSString stringWithCString_encoding_(NullableTestObjCLibrary _lib, ffi.Pointer cString, int enc) { final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, _lib._sel_stringWithCString_encoding_1, cString, enc); @@ -1011,19 +1013,19 @@ class NullableInterface extends NSObject { return NullableInterface._(other, lib); } - static bool isNullWithNullableNSObjectArg( + static bool isNullWithNullableNSObjectArg_( NullableTestObjCLibrary _lib, NSObject? x) { return _lib._objc_msgSend_4(_lib._class_NullableInterface1, _lib._sel_isNullWithNullableNSObjectArg_1, x?._id ?? ffi.nullptr); } - static bool isNullWithNotNullableNSObjectPtrArg( + static bool isNullWithNotNullableNSObjectPtrArg_( NullableTestObjCLibrary _lib, NSObject? x) { return _lib._objc_msgSend_4(_lib._class_NullableInterface1, _lib._sel_isNullWithNotNullableNSObjectPtrArg_1, x?._id ?? ffi.nullptr); } - static NSObject returnNil(NullableTestObjCLibrary _lib, bool r) { + static NSObject returnNil_(NullableTestObjCLibrary _lib, bool r) { final _ret = _lib._objc_msgSend_18( _lib._class_NullableInterface1, _lib._sel_returnNil_1, r); return NSObject._(_ret, _lib); diff --git a/pkgs/ffigen/test/native_objc_test/nullable_test.dart b/pkgs/ffigen/test/native_objc_test/nullable_test.dart index c93d56e930..8067ea1a74 100644 --- a/pkgs/ffigen/test/native_objc_test/nullable_test.dart +++ b/pkgs/ffigen/test/native_objc_test/nullable_test.dart @@ -65,27 +65,27 @@ void main() { group('Nullable return', () { test('Not null', () { - expect(NullableInterface.returnNil(lib, false), isA()); + expect(NullableInterface.returnNil_(lib, false), isA()); }); test('Null', () { - expect(NullableInterface.returnNil(lib, true), null); + expect(NullableInterface.returnNil_(lib, true), null); }); }, skip: "TODO(#334): enable this test"); group('Nullable arguments', () { test('Not null', () { expect( - NullableInterface.isNullWithNullableNSObjectArg(lib, obj), false); + NullableInterface.isNullWithNullableNSObjectArg_(lib, obj), false); }); test('Null', () { expect( - NullableInterface.isNullWithNullableNSObjectArg(lib, null), true); + NullableInterface.isNullWithNullableNSObjectArg_(lib, null), true); }); }); group('Not-nullable arguments', () { test('Not null', () { - expect(NullableInterface.isNullWithNotNullableNSObjectPtrArg(lib, obj), + expect(NullableInterface.isNullWithNotNullableNSObjectPtrArg_(lib, obj), false); }); }); diff --git a/pkgs/ffigen/test/native_objc_test/property_bindings.dart b/pkgs/ffigen/test/native_objc_test/property_bindings.dart index 05cd9efc2f..83f516fe4a 100644 --- a/pkgs/ffigen/test/native_objc_test/property_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/property_bindings.dart @@ -774,7 +774,7 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject allocWithZone( + static NSObject allocWithZone_( PropertyTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); @@ -804,64 +804,65 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject copyWithZone( + static NSObject copyWithZone_( PropertyTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); return NSObject._(_ret, _lib); } - static NSObject mutableCopyWithZone( + static NSObject mutableCopyWithZone_( PropertyTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); return NSObject._(_ret, _lib); } - static bool instancesRespondToSelector( + static bool instancesRespondToSelector_( PropertyTestObjCLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_3(_lib._class_NSObject1, _lib._sel_instancesRespondToSelector_1, aSelector); } - static bool conformsToProtocol( + static bool conformsToProtocol_( PropertyTestObjCLibrary _lib, NSObject? protocol) { return _lib._objc_msgSend_4(_lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); } - IMP methodForSelector(ffi.Pointer aSelector) { + IMP methodForSelector_(ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); } - static IMP instanceMethodForSelector( + static IMP instanceMethodForSelector_( PropertyTestObjCLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_lib._class_NSObject1, _lib._sel_instanceMethodForSelector_1, aSelector); } - void doesNotRecognizeSelector(ffi.Pointer aSelector) { + void doesNotRecognizeSelector_(ffi.Pointer aSelector) { _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); } - NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_7( _id, _lib._sel_forwardingTargetForSelector_1, aSelector); return NSObject._(_ret, _lib); } - void forwardInvocation(NSObject? anInvocation) { + void forwardInvocation_(NSObject? anInvocation) { _lib._objc_msgSend_8( _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); } - NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + NSMethodSignature methodSignatureForSelector_( + ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9( _id, _lib._sel_methodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static NSMethodSignature instanceMethodSignatureForSelector( + static NSMethodSignature instanceMethodSignatureForSelector_( PropertyTestObjCLibrary _lib, ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, _lib._sel_instanceMethodSignatureForSelector_1, aSelector); @@ -876,18 +877,19 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); } - static bool isSubclassOfClass(PropertyTestObjCLibrary _lib, NSObject aClass) { + static bool isSubclassOfClass_( + PropertyTestObjCLibrary _lib, NSObject aClass) { return _lib._objc_msgSend_4( _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); } - static bool resolveClassMethod( + static bool resolveClassMethod_( PropertyTestObjCLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); } - static bool resolveInstanceMethod( + static bool resolveInstanceMethod_( PropertyTestObjCLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); @@ -924,7 +926,7 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); } - static void setVersion(PropertyTestObjCLibrary _lib, int aVersion) { + static void setVersion_(PropertyTestObjCLibrary _lib, int aVersion) { _lib._objc_msgSend_16( _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); } @@ -934,19 +936,19 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - NSObject replacementObjectForCoder(NSObject? coder) { + NSObject replacementObjectForCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_17( _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - NSObject awakeAfterUsingCoder(NSObject? coder) { + NSObject awakeAfterUsingCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_17( _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static void poseAsClass(PropertyTestObjCLibrary _lib, NSObject aClass) { + static void poseAsClass_(PropertyTestObjCLibrary _lib, NSObject aClass) { _lib._objc_msgSend_8( _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); } @@ -999,7 +1001,7 @@ class NSString extends _ObjCWrapper { factory NSString(PropertyTestObjCLibrary _lib, String str) { final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); pkg_ffi.calloc.free(cstr); return nsstr; } @@ -1007,7 +1009,7 @@ class NSString extends _ObjCWrapper { @override String toString() => (UTF8String).cast().toDartString(); - static NSString stringWithCString_encoding(PropertyTestObjCLibrary _lib, + static NSString stringWithCString_encoding_(PropertyTestObjCLibrary _lib, ffi.Pointer cString, int enc) { final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, _lib._sel_stringWithCString_encoding_1, cString, enc); diff --git a/pkgs/ffigen/test/native_objc_test/string_bindings.dart b/pkgs/ffigen/test/native_objc_test/string_bindings.dart index e742ce0901..cfd1911198 100644 --- a/pkgs/ffigen/test/native_objc_test/string_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/string_bindings.dart @@ -5432,7 +5432,7 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject allocWithZone( + static NSObject allocWithZone_( StringTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); @@ -5462,64 +5462,65 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - static NSObject copyWithZone( + static NSObject copyWithZone_( StringTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); return NSObject._(_ret, _lib); } - static NSObject mutableCopyWithZone( + static NSObject mutableCopyWithZone_( StringTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { final _ret = _lib._objc_msgSend_2( _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); return NSObject._(_ret, _lib); } - static bool instancesRespondToSelector( + static bool instancesRespondToSelector_( StringTestObjCLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_3(_lib._class_NSObject1, _lib._sel_instancesRespondToSelector_1, aSelector); } - static bool conformsToProtocol( + static bool conformsToProtocol_( StringTestObjCLibrary _lib, NSObject? protocol) { return _lib._objc_msgSend_4(_lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); } - IMP methodForSelector(ffi.Pointer aSelector) { + IMP methodForSelector_(ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); } - static IMP instanceMethodForSelector( + static IMP instanceMethodForSelector_( StringTestObjCLibrary _lib, ffi.Pointer aSelector) { return _lib._objc_msgSend_5(_lib._class_NSObject1, _lib._sel_instanceMethodForSelector_1, aSelector); } - void doesNotRecognizeSelector(ffi.Pointer aSelector) { + void doesNotRecognizeSelector_(ffi.Pointer aSelector) { _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); } - NSObject forwardingTargetForSelector(ffi.Pointer aSelector) { + NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_7( _id, _lib._sel_forwardingTargetForSelector_1, aSelector); return NSObject._(_ret, _lib); } - void forwardInvocation(NSObject? anInvocation) { + void forwardInvocation_(NSObject? anInvocation) { _lib._objc_msgSend_8( _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); } - NSMethodSignature methodSignatureForSelector(ffi.Pointer aSelector) { + NSMethodSignature methodSignatureForSelector_( + ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9( _id, _lib._sel_methodSignatureForSelector_1, aSelector); return NSMethodSignature._(_ret, _lib); } - static NSMethodSignature instanceMethodSignatureForSelector( + static NSMethodSignature instanceMethodSignatureForSelector_( StringTestObjCLibrary _lib, ffi.Pointer aSelector) { final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, _lib._sel_instanceMethodSignatureForSelector_1, aSelector); @@ -5534,18 +5535,18 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); } - static bool isSubclassOfClass(StringTestObjCLibrary _lib, NSObject aClass) { + static bool isSubclassOfClass_(StringTestObjCLibrary _lib, NSObject aClass) { return _lib._objc_msgSend_4( _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); } - static bool resolveClassMethod( + static bool resolveClassMethod_( StringTestObjCLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); } - static bool resolveInstanceMethod( + static bool resolveInstanceMethod_( StringTestObjCLibrary _lib, ffi.Pointer sel) { return _lib._objc_msgSend_3( _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); @@ -5582,7 +5583,7 @@ class NSObject extends _ObjCWrapper { return _lib._objc_msgSend_32(_lib._class_NSObject1, _lib._sel_version1); } - static void setVersion(StringTestObjCLibrary _lib, int aVersion) { + static void setVersion_(StringTestObjCLibrary _lib, int aVersion) { _lib._objc_msgSend_76( _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); } @@ -5592,19 +5593,19 @@ class NSObject extends _ObjCWrapper { return NSObject._(_ret, _lib); } - NSObject replacementObjectForCoder(NSObject? coder) { + NSObject replacementObjectForCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - NSObject awakeAfterUsingCoder(NSObject? coder) { + NSObject awakeAfterUsingCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static void poseAsClass(StringTestObjCLibrary _lib, NSObject aClass) { + static void poseAsClass_(StringTestObjCLibrary _lib, NSObject aClass) { _lib._objc_msgSend_8( _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); } @@ -5657,7 +5658,7 @@ class NSString extends NSObject { factory NSString(StringTestObjCLibrary _lib, String str) { final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding(_lib, cstr.cast(), 4 /* UTF8 */); + final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); pkg_ffi.calloc.free(cstr); return nsstr; } @@ -5669,7 +5670,7 @@ class NSString extends NSObject { return _lib._objc_msgSend_11(_id, _lib._sel_length1); } - int characterAtIndex(int index) { + int characterAtIndex_(int index) { return _lib._objc_msgSend_12(_id, _lib._sel_characterAtIndex_1, index); } @@ -5679,93 +5680,93 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString initWithCoder(NSObject? coder) { + NSString initWithCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - NSString substringFromIndex(int from) { + NSString substringFromIndex_(int from) { final _ret = _lib._objc_msgSend_14(_id, _lib._sel_substringFromIndex_1, from); return NSString._(_ret, _lib); } - NSString substringToIndex(int to) { + NSString substringToIndex_(int to) { final _ret = _lib._objc_msgSend_14(_id, _lib._sel_substringToIndex_1, to); return NSString._(_ret, _lib); } - NSString substringWithRange(NSRange range) { + NSString substringWithRange_(NSRange range) { final _ret = _lib._objc_msgSend_15(_id, _lib._sel_substringWithRange_1, range); return NSString._(_ret, _lib); } - void getCharacters_range(ffi.Pointer buffer, NSRange range) { + void getCharacters_range_(ffi.Pointer buffer, NSRange range) { _lib._objc_msgSend_16(_id, _lib._sel_getCharacters_range_1, buffer, range); } - int compare(NSObject? string) { + int compare_(NSObject? string) { return _lib._objc_msgSend_17( _id, _lib._sel_compare_1, string?._id ?? ffi.nullptr); } - int compare_options(NSObject? string, int mask) { + int compare_options_(NSObject? string, int mask) { return _lib._objc_msgSend_18( _id, _lib._sel_compare_options_1, string?._id ?? ffi.nullptr, mask); } - int compare_options_range( + int compare_options_range_( NSObject? string, int mask, NSRange rangeOfReceiverToCompare) { return _lib._objc_msgSend_19(_id, _lib._sel_compare_options_range_1, string?._id ?? ffi.nullptr, mask, rangeOfReceiverToCompare); } - int compare_options_range_locale(NSObject? string, int mask, + int compare_options_range_locale_(NSObject? string, int mask, NSRange rangeOfReceiverToCompare, NSObject locale) { return _lib._objc_msgSend_20(_id, _lib._sel_compare_options_range_locale_1, string?._id ?? ffi.nullptr, mask, rangeOfReceiverToCompare, locale._id); } - int caseInsensitiveCompare(NSObject? string) { + int caseInsensitiveCompare_(NSObject? string) { return _lib._objc_msgSend_17( _id, _lib._sel_caseInsensitiveCompare_1, string?._id ?? ffi.nullptr); } - int localizedCompare(NSObject? string) { + int localizedCompare_(NSObject? string) { return _lib._objc_msgSend_17( _id, _lib._sel_localizedCompare_1, string?._id ?? ffi.nullptr); } - int localizedCaseInsensitiveCompare(NSObject? string) { + int localizedCaseInsensitiveCompare_(NSObject? string) { return _lib._objc_msgSend_17( _id, _lib._sel_localizedCaseInsensitiveCompare_1, string?._id ?? ffi.nullptr); } - int localizedStandardCompare(NSObject? string) { + int localizedStandardCompare_(NSObject? string) { return _lib._objc_msgSend_17( _id, _lib._sel_localizedStandardCompare_1, string?._id ?? ffi.nullptr); } - bool isEqualToString(NSObject? aString) { + bool isEqualToString_(NSObject? aString) { return _lib._objc_msgSend_4( _id, _lib._sel_isEqualToString_1, aString?._id ?? ffi.nullptr); } - bool hasPrefix(NSObject? str) { + bool hasPrefix_(NSObject? str) { return _lib._objc_msgSend_4( _id, _lib._sel_hasPrefix_1, str?._id ?? ffi.nullptr); } - bool hasSuffix(NSObject? str) { + bool hasSuffix_(NSObject? str) { return _lib._objc_msgSend_4( _id, _lib._sel_hasSuffix_1, str?._id ?? ffi.nullptr); } - NSString commonPrefixWithString_options(NSObject? str, int mask) { + NSString commonPrefixWithString_options_(NSObject? str, int mask) { final _ret = _lib._objc_msgSend_21( _id, _lib._sel_commonPrefixWithString_options_1, @@ -5774,45 +5775,45 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - bool containsString(NSObject? str) { + bool containsString_(NSObject? str) { return _lib._objc_msgSend_4( _id, _lib._sel_containsString_1, str?._id ?? ffi.nullptr); } - bool localizedCaseInsensitiveContainsString(NSObject? str) { + bool localizedCaseInsensitiveContainsString_(NSObject? str) { return _lib._objc_msgSend_4( _id, _lib._sel_localizedCaseInsensitiveContainsString_1, str?._id ?? ffi.nullptr); } - bool localizedStandardContainsString(NSObject? str) { + bool localizedStandardContainsString_(NSObject? str) { return _lib._objc_msgSend_4(_id, _lib._sel_localizedStandardContainsString_1, str?._id ?? ffi.nullptr); } - NSRange localizedStandardRangeOfString(NSObject? str) { + NSRange localizedStandardRangeOfString_(NSObject? str) { return _lib._objc_msgSend_22(_id, _lib._sel_localizedStandardRangeOfString_1, str?._id ?? ffi.nullptr); } - NSRange rangeOfString(NSObject? searchString) { + NSRange rangeOfString_(NSObject? searchString) { return _lib._objc_msgSend_22( _id, _lib._sel_rangeOfString_1, searchString?._id ?? ffi.nullptr); } - NSRange rangeOfString_options(NSObject? searchString, int mask) { + NSRange rangeOfString_options_(NSObject? searchString, int mask) { return _lib._objc_msgSend_23(_id, _lib._sel_rangeOfString_options_1, searchString?._id ?? ffi.nullptr, mask); } - NSRange rangeOfString_options_range( + NSRange rangeOfString_options_range_( NSObject? searchString, int mask, NSRange rangeOfReceiverToSearch) { return _lib._objc_msgSend_24(_id, _lib._sel_rangeOfString_options_range_1, searchString?._id ?? ffi.nullptr, mask, rangeOfReceiverToSearch); } - NSRange rangeOfString_options_range_locale(NSObject? searchString, int mask, + NSRange rangeOfString_options_range_locale_(NSObject? searchString, int mask, NSRange rangeOfReceiverToSearch, NSObject? locale) { return _lib._objc_msgSend_25( _id, @@ -5823,12 +5824,12 @@ class NSString extends NSObject { locale?._id ?? ffi.nullptr); } - NSRange rangeOfCharacterFromSet(NSObject? searchSet) { + NSRange rangeOfCharacterFromSet_(NSObject? searchSet) { return _lib._objc_msgSend_22(_id, _lib._sel_rangeOfCharacterFromSet_1, searchSet?._id ?? ffi.nullptr); } - NSRange rangeOfCharacterFromSet_options(NSObject? searchSet, int mask) { + NSRange rangeOfCharacterFromSet_options_(NSObject? searchSet, int mask) { return _lib._objc_msgSend_23( _id, _lib._sel_rangeOfCharacterFromSet_options_1, @@ -5836,7 +5837,7 @@ class NSString extends NSObject { mask); } - NSRange rangeOfCharacterFromSet_options_range( + NSRange rangeOfCharacterFromSet_options_range_( NSObject? searchSet, int mask, NSRange rangeOfReceiverToSearch) { return _lib._objc_msgSend_24( _id, @@ -5846,23 +5847,23 @@ class NSString extends NSObject { rangeOfReceiverToSearch); } - NSRange rangeOfComposedCharacterSequenceAtIndex(int index) { + NSRange rangeOfComposedCharacterSequenceAtIndex_(int index) { return _lib._objc_msgSend_26( _id, _lib._sel_rangeOfComposedCharacterSequenceAtIndex_1, index); } - NSRange rangeOfComposedCharacterSequencesForRange(NSRange range) { + NSRange rangeOfComposedCharacterSequencesForRange_(NSRange range) { return _lib._objc_msgSend_27( _id, _lib._sel_rangeOfComposedCharacterSequencesForRange_1, range); } - NSString stringByAppendingString(NSObject? aString) { + NSString stringByAppendingString_(NSObject? aString) { final _ret = _lib._objc_msgSend_28( _id, _lib._sel_stringByAppendingString_1, aString?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - NSString stringByAppendingFormat(NSObject? format) { + NSString stringByAppendingFormat_(NSObject? format) { final _ret = _lib._objc_msgSend_28( _id, _lib._sel_stringByAppendingFormat_1, format?._id ?? ffi.nullptr); return NSString._(_ret, _lib); @@ -5923,25 +5924,25 @@ class NSString extends NSObject { return _ret.address == 0 ? null : NSObject._(_ret, _lib); } - NSString uppercaseStringWithLocale(NSObject? locale) { + NSString uppercaseStringWithLocale_(NSObject? locale) { final _ret = _lib._objc_msgSend_28( _id, _lib._sel_uppercaseStringWithLocale_1, locale?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - NSString lowercaseStringWithLocale(NSObject? locale) { + NSString lowercaseStringWithLocale_(NSObject? locale) { final _ret = _lib._objc_msgSend_28( _id, _lib._sel_lowercaseStringWithLocale_1, locale?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - NSString capitalizedStringWithLocale(NSObject? locale) { + NSString capitalizedStringWithLocale_(NSObject? locale) { final _ret = _lib._objc_msgSend_28(_id, _lib._sel_capitalizedStringWithLocale_1, locale?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - void getLineStart_end_contentsEnd_forRange( + void getLineStart_end_contentsEnd_forRange_( ffi.Pointer startPtr, ffi.Pointer lineEndPtr, ffi.Pointer contentsEndPtr, @@ -5955,11 +5956,11 @@ class NSString extends NSObject { range); } - NSRange lineRangeForRange(NSRange range) { + NSRange lineRangeForRange_(NSRange range) { return _lib._objc_msgSend_27(_id, _lib._sel_lineRangeForRange_1, range); } - void getParagraphStart_end_contentsEnd_forRange( + void getParagraphStart_end_contentsEnd_forRange_( ffi.Pointer startPtr, ffi.Pointer parEndPtr, ffi.Pointer contentsEndPtr, @@ -5973,12 +5974,12 @@ class NSString extends NSObject { range); } - NSRange paragraphRangeForRange(NSRange range) { + NSRange paragraphRangeForRange_(NSRange range) { return _lib._objc_msgSend_27( _id, _lib._sel_paragraphRangeForRange_1, range); } - void enumerateSubstringsInRange_options_usingBlock( + void enumerateSubstringsInRange_options_usingBlock_( NSRange range, int opts, ObjCBlock block) { _lib._objc_msgSend_35( _id, @@ -5988,7 +5989,7 @@ class NSString extends NSObject { block._impl); } - void enumerateLinesUsingBlock(ObjCBlock1 block) { + void enumerateLinesUsingBlock_(ObjCBlock1 block) { _lib._objc_msgSend_36( _id, _lib._sel_enumerateLinesUsingBlock_1, block._impl); } @@ -6005,34 +6006,34 @@ class NSString extends NSObject { return _lib._objc_msgSend_11(_id, _lib._sel_smallestEncoding1); } - NSData dataUsingEncoding_allowLossyConversion(int encoding, bool lossy) { + NSData dataUsingEncoding_allowLossyConversion_(int encoding, bool lossy) { final _ret = _lib._objc_msgSend_38(_id, _lib._sel_dataUsingEncoding_allowLossyConversion_1, encoding, lossy); return NSData._(_ret, _lib); } - NSData dataUsingEncoding(int encoding) { + NSData dataUsingEncoding_(int encoding) { final _ret = _lib._objc_msgSend_39(_id, _lib._sel_dataUsingEncoding_1, encoding); return NSData._(_ret, _lib); } - bool canBeConvertedToEncoding(int encoding) { + bool canBeConvertedToEncoding_(int encoding) { return _lib._objc_msgSend_40( _id, _lib._sel_canBeConvertedToEncoding_1, encoding); } - void cStringUsingEncoding(int encoding) { + void cStringUsingEncoding_(int encoding) { _lib._objc_msgSend_41(_id, _lib._sel_cStringUsingEncoding_1, encoding); } - bool getCString_maxLength_encoding( + bool getCString_maxLength_encoding_( ffi.Pointer buffer, int maxBufferCount, int encoding) { return _lib._objc_msgSend_42(_id, _lib._sel_getCString_maxLength_encoding_1, buffer, maxBufferCount, encoding); } - bool getBytes_maxLength_usedLength_encoding_options_range_remainingRange( + bool getBytes_maxLength_usedLength_encoding_options_range_remainingRange_( ffi.Pointer buffer, int maxBufferCount, ffi.Pointer usedBufferCount, @@ -6052,12 +6053,12 @@ class NSString extends NSObject { leftover); } - int maximumLengthOfBytesUsingEncoding(int enc) { + int maximumLengthOfBytesUsingEncoding_(int enc) { return _lib._objc_msgSend_44( _id, _lib._sel_maximumLengthOfBytesUsingEncoding_1, enc); } - int lengthOfBytesUsingEncoding(int enc) { + int lengthOfBytesUsingEncoding_(int enc) { return _lib._objc_msgSend_44( _id, _lib._sel_lengthOfBytesUsingEncoding_1, enc); } @@ -6068,7 +6069,7 @@ class NSString extends NSObject { _lib._class_NSString1, _lib._sel_availableStringEncodings1); } - static NSString localizedNameOfStringEncoding( + static NSString localizedNameOfStringEncoding_( StringTestObjCLibrary _lib, int encoding) { final _ret = _lib._objc_msgSend_14(_lib._class_NSString1, _lib._sel_localizedNameOfStringEncoding_1, encoding); @@ -6104,13 +6105,13 @@ class NSString extends NSObject { return _ret.address == 0 ? null : NSObject._(_ret, _lib); } - NSString stringByTrimmingCharactersInSet(NSObject? set) { + NSString stringByTrimmingCharactersInSet_(NSObject? set) { final _ret = _lib._objc_msgSend_28(_id, _lib._sel_stringByTrimmingCharactersInSet_1, set?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - NSString stringByPaddingToLength_withString_startingAtIndex( + NSString stringByPaddingToLength_withString_startingAtIndex_( int newLength, NSObject? padString, int padIndex) { final _ret = _lib._objc_msgSend_46( _id, @@ -6121,7 +6122,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString stringByFoldingWithOptions_locale(int options, NSObject? locale) { + NSString stringByFoldingWithOptions_locale_(int options, NSObject? locale) { final _ret = _lib._objc_msgSend_47( _id, _lib._sel_stringByFoldingWithOptions_locale_1, @@ -6130,7 +6131,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString stringByReplacingOccurrencesOfString_withString_options_range( + NSString stringByReplacingOccurrencesOfString_withString_options_range_( NSObject? target, NSObject? replacement, int options, @@ -6145,7 +6146,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString stringByReplacingOccurrencesOfString_withString( + NSString stringByReplacingOccurrencesOfString_withString_( NSObject? target, NSObject? replacement) { final _ret = _lib._objc_msgSend_49( _id, @@ -6155,7 +6156,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString stringByReplacingCharactersInRange_withString( + NSString stringByReplacingCharactersInRange_withString_( NSRange range, NSObject? replacement) { final _ret = _lib._objc_msgSend_50( _id, @@ -6165,14 +6166,14 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString stringByApplyingTransform_reverse( + NSString stringByApplyingTransform_reverse_( NSStringTransform transform, bool reverse) { final _ret = _lib._objc_msgSend_51( _id, _lib._sel_stringByApplyingTransform_reverse_1, transform, reverse); return NSString._(_ret, _lib); } - bool writeToURL_atomically_encoding_error( + bool writeToURL_atomically_encoding_error_( NSObject? url, bool useAuxiliaryFile, int enc, @@ -6186,7 +6187,7 @@ class NSString extends NSObject { error); } - bool writeToFile_atomically_encoding_error( + bool writeToFile_atomically_encoding_error_( NSObject? path, bool useAuxiliaryFile, int enc, @@ -6209,7 +6210,7 @@ class NSString extends NSObject { return _lib._objc_msgSend_11(_id, _lib._sel_hash1); } - NSString initWithCharactersNoCopy_length_freeWhenDone( + NSString initWithCharactersNoCopy_length_freeWhenDone_( ffi.Pointer characters, int length, bool freeBuffer) { final _ret = _lib._objc_msgSend_53( _id, @@ -6220,7 +6221,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString initWithCharactersNoCopy_length_deallocator( + NSString initWithCharactersNoCopy_length_deallocator_( ffi.Pointer chars, int len, ObjCBlock2 deallocator) { final _ret = _lib._objc_msgSend_54( _id, @@ -6231,32 +6232,33 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString initWithCharacters_length( + NSString initWithCharacters_length_( ffi.Pointer characters, int length) { final _ret = _lib._objc_msgSend_55( _id, _lib._sel_initWithCharacters_length_1, characters, length); return NSString._(_ret, _lib); } - NSString initWithUTF8String(ffi.Pointer nullTerminatedCString) { + NSString initWithUTF8String_( + ffi.Pointer nullTerminatedCString) { final _ret = _lib._objc_msgSend_56( _id, _lib._sel_initWithUTF8String_1, nullTerminatedCString); return NSString._(_ret, _lib); } - NSString initWithString(NSObject? aString) { + NSString initWithString_(NSObject? aString) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithString_1, aString?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - NSString initWithFormat(NSObject? format) { + NSString initWithFormat_(NSObject? format) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithFormat_1, format?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - NSString initWithFormat_arguments( + NSString initWithFormat_arguments_( NSObject? format, ffi.Pointer<__va_list_tag> argList) { final _ret = _lib._objc_msgSend_57( _id, @@ -6266,13 +6268,13 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString initWithFormat_locale(NSObject? format, NSObject locale) { + NSString initWithFormat_locale_(NSObject? format, NSObject locale) { final _ret = _lib._objc_msgSend_58(_id, _lib._sel_initWithFormat_locale_1, format?._id ?? ffi.nullptr, locale._id); return NSString._(_ret, _lib); } - NSString initWithFormat_locale_arguments( + NSString initWithFormat_locale_arguments_( NSObject? format, NSObject locale, ffi.Pointer<__va_list_tag> argList) { final _ret = _lib._objc_msgSend_59( _id, @@ -6283,20 +6285,20 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString initWithData_encoding(NSObject? data, int encoding) { + NSString initWithData_encoding_(NSObject? data, int encoding) { final _ret = _lib._objc_msgSend_60(_id, _lib._sel_initWithData_encoding_1, data?._id ?? ffi.nullptr, encoding); return NSString._(_ret, _lib); } - NSString initWithBytes_length_encoding( + NSString initWithBytes_length_encoding_( ffi.Pointer bytes, int len, int encoding) { final _ret = _lib._objc_msgSend_61( _id, _lib._sel_initWithBytes_length_encoding_1, bytes, len, encoding); return NSString._(_ret, _lib); } - NSString initWithBytesNoCopy_length_encoding_freeWhenDone( + NSString initWithBytesNoCopy_length_encoding_freeWhenDone_( ffi.Pointer bytes, int len, int encoding, bool freeBuffer) { final _ret = _lib._objc_msgSend_62( _id, @@ -6308,7 +6310,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString initWithBytesNoCopy_length_encoding_deallocator( + NSString initWithBytesNoCopy_length_encoding_deallocator_( ffi.Pointer bytes, int len, int encoding, @@ -6328,56 +6330,56 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - static NSString stringWithString( + static NSString stringWithString_( StringTestObjCLibrary _lib, NSObject? string) { final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - static NSString stringWithCharacters_length( + static NSString stringWithCharacters_length_( StringTestObjCLibrary _lib, ffi.Pointer characters, int length) { final _ret = _lib._objc_msgSend_55(_lib._class_NSString1, _lib._sel_stringWithCharacters_length_1, characters, length); return NSString._(_ret, _lib); } - static NSString stringWithUTF8String(StringTestObjCLibrary _lib, + static NSString stringWithUTF8String_(StringTestObjCLibrary _lib, ffi.Pointer nullTerminatedCString) { final _ret = _lib._objc_msgSend_56(_lib._class_NSString1, _lib._sel_stringWithUTF8String_1, nullTerminatedCString); return NSString._(_ret, _lib); } - static NSString stringWithFormat( + static NSString stringWithFormat_( StringTestObjCLibrary _lib, NSObject? format) { final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - static NSString localizedStringWithFormat( + static NSString localizedStringWithFormat_( StringTestObjCLibrary _lib, NSObject? format) { final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - NSString initWithCString_encoding( + NSString initWithCString_encoding_( ffi.Pointer nullTerminatedCString, int encoding) { final _ret = _lib._objc_msgSend_64(_id, _lib._sel_initWithCString_encoding_1, nullTerminatedCString, encoding); return NSString._(_ret, _lib); } - static NSString stringWithCString_encoding( + static NSString stringWithCString_encoding_( StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { final _ret = _lib._objc_msgSend_64(_lib._class_NSString1, _lib._sel_stringWithCString_encoding_1, cString, enc); return NSString._(_ret, _lib); } - NSString initWithContentsOfURL_encoding_error( + NSString initWithContentsOfURL_encoding_error_( NSObject? url, int enc, ffi.Pointer> error) { final _ret = _lib._objc_msgSend_65( _id, @@ -6388,7 +6390,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString initWithContentsOfFile_encoding_error( + NSString initWithContentsOfFile_encoding_error_( NSObject? path, int enc, ffi.Pointer> error) { final _ret = _lib._objc_msgSend_65( _id, @@ -6399,7 +6401,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - static NSString stringWithContentsOfURL_encoding_error( + static NSString stringWithContentsOfURL_encoding_error_( StringTestObjCLibrary _lib, NSObject? url, int enc, @@ -6413,7 +6415,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - static NSString stringWithContentsOfFile_encoding_error( + static NSString stringWithContentsOfFile_encoding_error_( StringTestObjCLibrary _lib, NSObject? path, int enc, @@ -6427,7 +6429,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString initWithContentsOfURL_usedEncoding_error( + NSString initWithContentsOfURL_usedEncoding_error_( NSObject? url, ffi.Pointer enc, ffi.Pointer> error) { @@ -6440,7 +6442,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - NSString initWithContentsOfFile_usedEncoding_error( + NSString initWithContentsOfFile_usedEncoding_error_( NSObject? path, ffi.Pointer enc, ffi.Pointer> error) { @@ -6453,7 +6455,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - static NSString stringWithContentsOfURL_usedEncoding_error( + static NSString stringWithContentsOfURL_usedEncoding_error_( StringTestObjCLibrary _lib, NSObject? url, ffi.Pointer enc, @@ -6467,7 +6469,7 @@ class NSString extends NSObject { return NSString._(_ret, _lib); } - static NSString stringWithContentsOfFile_usedEncoding_error( + static NSString stringWithContentsOfFile_usedEncoding_error_( StringTestObjCLibrary _lib, NSObject? path, ffi.Pointer enc, @@ -6482,7 +6484,7 @@ class NSString extends NSObject { } static int - stringEncodingForData_encodingOptions_convertedString_usedLossyConversion( + stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( StringTestObjCLibrary _lib, NSObject? data, NSObject? opts, @@ -6520,16 +6522,16 @@ class NSString extends NSObject { return _lib._objc_msgSend_11(_id, _lib._sel_cStringLength1); } - void getCString(ffi.Pointer bytes) { + void getCString_(ffi.Pointer bytes) { _lib._objc_msgSend_69(_id, _lib._sel_getCString_1, bytes); } - void getCString_maxLength(ffi.Pointer bytes, int maxLength) { + void getCString_maxLength_(ffi.Pointer bytes, int maxLength) { _lib._objc_msgSend_70( _id, _lib._sel_getCString_maxLength_1, bytes, maxLength); } - void getCString_maxLength_range_remainingRange( + void getCString_maxLength_range_remainingRange_( ffi.Pointer bytes, int maxLength, NSRange aRange, @@ -6543,43 +6545,43 @@ class NSString extends NSObject { leftoverRange); } - bool writeToFile_atomically(NSObject? path, bool useAuxiliaryFile) { + bool writeToFile_atomically_(NSObject? path, bool useAuxiliaryFile) { return _lib._objc_msgSend_72(_id, _lib._sel_writeToFile_atomically_1, path?._id ?? ffi.nullptr, useAuxiliaryFile); } - bool writeToURL_atomically(NSObject? url, bool atomically) { + bool writeToURL_atomically_(NSObject? url, bool atomically) { return _lib._objc_msgSend_72(_id, _lib._sel_writeToURL_atomically_1, url?._id ?? ffi.nullptr, atomically); } - NSObject initWithContentsOfFile(NSObject? path) { + NSObject initWithContentsOfFile_(NSObject? path) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - NSObject initWithContentsOfURL(NSObject? url) { + NSObject initWithContentsOfURL_(NSObject? url) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static NSObject stringWithContentsOfFile( + static NSObject stringWithContentsOfFile_( StringTestObjCLibrary _lib, NSObject? path) { final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static NSObject stringWithContentsOfURL( + static NSObject stringWithContentsOfURL_( StringTestObjCLibrary _lib, NSObject? url) { final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - NSObject initWithCStringNoCopy_length_freeWhenDone( + NSObject initWithCStringNoCopy_length_freeWhenDone_( ffi.Pointer bytes, int length, bool freeBuffer) { final _ret = _lib._objc_msgSend_73( _id, @@ -6590,32 +6592,33 @@ class NSString extends NSObject { return NSObject._(_ret, _lib); } - NSObject initWithCString_length(ffi.Pointer bytes, int length) { + NSObject initWithCString_length_( + ffi.Pointer bytes, int length) { final _ret = _lib._objc_msgSend_64( _id, _lib._sel_initWithCString_length_1, bytes, length); return NSObject._(_ret, _lib); } - NSObject initWithCString(ffi.Pointer bytes) { + NSObject initWithCString_(ffi.Pointer bytes) { final _ret = _lib._objc_msgSend_56(_id, _lib._sel_initWithCString_1, bytes); return NSObject._(_ret, _lib); } - static NSObject stringWithCString_length( + static NSObject stringWithCString_length_( StringTestObjCLibrary _lib, ffi.Pointer bytes, int length) { final _ret = _lib._objc_msgSend_64(_lib._class_NSString1, _lib._sel_stringWithCString_length_1, bytes, length); return NSObject._(_ret, _lib); } - static NSObject stringWithCString( + static NSObject stringWithCString_( StringTestObjCLibrary _lib, ffi.Pointer bytes) { final _ret = _lib._objc_msgSend_56( _lib._class_NSString1, _lib._sel_stringWithCString_1, bytes); return NSObject._(_ret, _lib); } - void getCharacters(ffi.Pointer buffer) { + void getCharacters_(ffi.Pointer buffer) { _lib._objc_msgSend_74(_id, _lib._sel_getCharacters_1, buffer); } @@ -6910,7 +6913,7 @@ class NSValue extends NSObject { return NSValue._(other, lib); } - void getValue_size(ffi.Pointer value, int size) { + void getValue_size_(ffi.Pointer value, int size) { _lib._objc_msgSend_77(_id, _lib._sel_getValue_size_1, value, size); } @@ -6918,34 +6921,34 @@ class NSValue extends NSObject { return _lib._objc_msgSend_37(_id, _lib._sel_objCType1); } - NSValue initWithBytes_objCType( + NSValue initWithBytes_objCType_( ffi.Pointer value, ffi.Pointer type) { final _ret = _lib._objc_msgSend_78( _id, _lib._sel_initWithBytes_objCType_1, value, type); return NSValue._(_ret, _lib); } - NSValue initWithCoder(NSObject? coder) { + NSValue initWithCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); return NSValue._(_ret, _lib); } - static NSValue valueWithBytes_objCType(StringTestObjCLibrary _lib, + static NSValue valueWithBytes_objCType_(StringTestObjCLibrary _lib, ffi.Pointer value, ffi.Pointer type) { final _ret = _lib._objc_msgSend_79( _lib._class_NSValue1, _lib._sel_valueWithBytes_objCType_1, value, type); return NSValue._(_ret, _lib); } - static NSValue value_withObjCType(StringTestObjCLibrary _lib, + static NSValue value_withObjCType_(StringTestObjCLibrary _lib, ffi.Pointer value, ffi.Pointer type) { final _ret = _lib._objc_msgSend_79( _lib._class_NSValue1, _lib._sel_value_withObjCType_1, value, type); return NSValue._(_ret, _lib); } - static NSValue valueWithNonretainedObject( + static NSValue valueWithNonretainedObject_( StringTestObjCLibrary _lib, NSObject anObject) { final _ret = _lib._objc_msgSend_80(_lib._class_NSValue1, _lib._sel_valueWithNonretainedObject_1, anObject._id); @@ -6957,7 +6960,7 @@ class NSValue extends NSObject { return NSObject._(_ret, _lib); } - static NSValue valueWithPointer( + static NSValue valueWithPointer_( StringTestObjCLibrary _lib, ffi.Pointer pointer) { final _ret = _lib._objc_msgSend_81( _lib._class_NSValue1, _lib._sel_valueWithPointer_1, pointer); @@ -6968,16 +6971,16 @@ class NSValue extends NSObject { return _lib._objc_msgSend_82(_id, _lib._sel_pointerValue1); } - bool isEqualToValue(NSObject? value) { + bool isEqualToValue_(NSObject? value) { return _lib._objc_msgSend_4( _id, _lib._sel_isEqualToValue_1, value?._id ?? ffi.nullptr); } - void getValue(ffi.Pointer value) { + void getValue_(ffi.Pointer value) { _lib._objc_msgSend_83(_id, _lib._sel_getValue_1, value); } - static NSValue valueWithRange(StringTestObjCLibrary _lib, NSRange range) { + static NSValue valueWithRange_(StringTestObjCLibrary _lib, NSRange range) { final _ret = _lib._objc_msgSend_84( _lib._class_NSValue1, _lib._sel_valueWithRange_1, range); return NSValue._(_ret, _lib); @@ -7012,89 +7015,89 @@ class NSNumber extends NSValue { } @override - NSNumber initWithCoder(NSObject? coder) { + NSNumber initWithCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); return NSNumber._(_ret, _lib); } - NSNumber initWithChar(int value) { + NSNumber initWithChar_(int value) { final _ret = _lib._objc_msgSend_86(_id, _lib._sel_initWithChar_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithUnsignedChar(int value) { + NSNumber initWithUnsignedChar_(int value) { final _ret = _lib._objc_msgSend_87(_id, _lib._sel_initWithUnsignedChar_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithShort(int value) { + NSNumber initWithShort_(int value) { final _ret = _lib._objc_msgSend_88(_id, _lib._sel_initWithShort_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithUnsignedShort(int value) { + NSNumber initWithUnsignedShort_(int value) { final _ret = _lib._objc_msgSend_89(_id, _lib._sel_initWithUnsignedShort_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithInt(int value) { + NSNumber initWithInt_(int value) { final _ret = _lib._objc_msgSend_90(_id, _lib._sel_initWithInt_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithUnsignedInt(int value) { + NSNumber initWithUnsignedInt_(int value) { final _ret = _lib._objc_msgSend_91(_id, _lib._sel_initWithUnsignedInt_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithLong(int value) { + NSNumber initWithLong_(int value) { final _ret = _lib._objc_msgSend_92(_id, _lib._sel_initWithLong_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithUnsignedLong(int value) { + NSNumber initWithUnsignedLong_(int value) { final _ret = _lib._objc_msgSend_93(_id, _lib._sel_initWithUnsignedLong_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithLongLong(int value) { + NSNumber initWithLongLong_(int value) { final _ret = _lib._objc_msgSend_94(_id, _lib._sel_initWithLongLong_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithUnsignedLongLong(int value) { + NSNumber initWithUnsignedLongLong_(int value) { final _ret = _lib._objc_msgSend_95(_id, _lib._sel_initWithUnsignedLongLong_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithFloat(double value) { + NSNumber initWithFloat_(double value) { final _ret = _lib._objc_msgSend_96(_id, _lib._sel_initWithFloat_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithDouble(double value) { + NSNumber initWithDouble_(double value) { final _ret = _lib._objc_msgSend_97(_id, _lib._sel_initWithDouble_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithBool(bool value) { + NSNumber initWithBool_(bool value) { final _ret = _lib._objc_msgSend_98(_id, _lib._sel_initWithBool_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithInteger(int value) { + NSNumber initWithInteger_(int value) { final _ret = _lib._objc_msgSend_92(_id, _lib._sel_initWithInteger_1, value); return NSNumber._(_ret, _lib); } - NSNumber initWithUnsignedInteger(int value) { + NSNumber initWithUnsignedInteger_(int value) { final _ret = _lib._objc_msgSend_93(_id, _lib._sel_initWithUnsignedInteger_1, value); return NSNumber._(_ret, _lib); @@ -7165,146 +7168,147 @@ class NSNumber extends NSValue { return _ret.address == 0 ? null : NSObject._(_ret, _lib); } - int compare(NSObject? otherNumber) { + int compare_(NSObject? otherNumber) { return _lib._objc_msgSend_17( _id, _lib._sel_compare_1, otherNumber?._id ?? ffi.nullptr); } - bool isEqualToNumber(NSObject? number) { + bool isEqualToNumber_(NSObject? number) { return _lib._objc_msgSend_4( _id, _lib._sel_isEqualToNumber_1, number?._id ?? ffi.nullptr); } - NSString descriptionWithLocale(NSObject locale) { + NSString descriptionWithLocale_(NSObject locale) { final _ret = _lib._objc_msgSend_28( _id, _lib._sel_descriptionWithLocale_1, locale._id); return NSString._(_ret, _lib); } - static NSNumber numberWithChar(StringTestObjCLibrary _lib, int value) { + static NSNumber numberWithChar_(StringTestObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_86( _lib._class_NSNumber1, _lib._sel_numberWithChar_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithUnsignedChar( + static NSNumber numberWithUnsignedChar_( StringTestObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_87( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedChar_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithShort(StringTestObjCLibrary _lib, int value) { + static NSNumber numberWithShort_(StringTestObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_88( _lib._class_NSNumber1, _lib._sel_numberWithShort_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithUnsignedShort( + static NSNumber numberWithUnsignedShort_( StringTestObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_89( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedShort_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithInt(StringTestObjCLibrary _lib, int value) { + static NSNumber numberWithInt_(StringTestObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_90( _lib._class_NSNumber1, _lib._sel_numberWithInt_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithUnsignedInt(StringTestObjCLibrary _lib, int value) { + static NSNumber numberWithUnsignedInt_( + StringTestObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_91( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInt_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithLong(StringTestObjCLibrary _lib, int value) { + static NSNumber numberWithLong_(StringTestObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_92( _lib._class_NSNumber1, _lib._sel_numberWithLong_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithUnsignedLong( + static NSNumber numberWithUnsignedLong_( StringTestObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_93( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLong_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithLongLong(StringTestObjCLibrary _lib, int value) { + static NSNumber numberWithLongLong_(StringTestObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_94( _lib._class_NSNumber1, _lib._sel_numberWithLongLong_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithUnsignedLongLong( + static NSNumber numberWithUnsignedLongLong_( StringTestObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_95( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLongLong_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithFloat(StringTestObjCLibrary _lib, double value) { + static NSNumber numberWithFloat_(StringTestObjCLibrary _lib, double value) { final _ret = _lib._objc_msgSend_96( _lib._class_NSNumber1, _lib._sel_numberWithFloat_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithDouble(StringTestObjCLibrary _lib, double value) { + static NSNumber numberWithDouble_(StringTestObjCLibrary _lib, double value) { final _ret = _lib._objc_msgSend_97( _lib._class_NSNumber1, _lib._sel_numberWithDouble_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithBool(StringTestObjCLibrary _lib, bool value) { + static NSNumber numberWithBool_(StringTestObjCLibrary _lib, bool value) { final _ret = _lib._objc_msgSend_98( _lib._class_NSNumber1, _lib._sel_numberWithBool_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithInteger(StringTestObjCLibrary _lib, int value) { + static NSNumber numberWithInteger_(StringTestObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_92( _lib._class_NSNumber1, _lib._sel_numberWithInteger_1, value); return NSNumber._(_ret, _lib); } - static NSNumber numberWithUnsignedInteger( + static NSNumber numberWithUnsignedInteger_( StringTestObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_93( _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInteger_1, value); return NSNumber._(_ret, _lib); } - static NSValue valueWithBytes_objCType(StringTestObjCLibrary _lib, + static NSValue valueWithBytes_objCType_(StringTestObjCLibrary _lib, ffi.Pointer value, ffi.Pointer type) { final _ret = _lib._objc_msgSend_79(_lib._class_NSNumber1, _lib._sel_valueWithBytes_objCType_1, value, type); return NSValue._(_ret, _lib); } - static NSValue value_withObjCType(StringTestObjCLibrary _lib, + static NSValue value_withObjCType_(StringTestObjCLibrary _lib, ffi.Pointer value, ffi.Pointer type) { final _ret = _lib._objc_msgSend_79( _lib._class_NSNumber1, _lib._sel_value_withObjCType_1, value, type); return NSValue._(_ret, _lib); } - static NSValue valueWithNonretainedObject( + static NSValue valueWithNonretainedObject_( StringTestObjCLibrary _lib, NSObject anObject) { final _ret = _lib._objc_msgSend_80(_lib._class_NSNumber1, _lib._sel_valueWithNonretainedObject_1, anObject._id); return NSValue._(_ret, _lib); } - static NSValue valueWithPointer( + static NSValue valueWithPointer_( StringTestObjCLibrary _lib, ffi.Pointer pointer) { final _ret = _lib._objc_msgSend_81( _lib._class_NSNumber1, _lib._sel_valueWithPointer_1, pointer); return NSValue._(_ret, _lib); } - static NSValue valueWithRange(StringTestObjCLibrary _lib, NSRange range) { + static NSValue valueWithRange_(StringTestObjCLibrary _lib, NSRange range) { final _ret = _lib._objc_msgSend_84( _lib._class_NSNumber1, _lib._sel_valueWithRange_1, range); return NSValue._(_ret, _lib); @@ -7411,14 +7415,14 @@ class NSOrderedCollectionChange extends NSObject { return NSObject._(_ret, _lib); } - NSOrderedCollectionChange initWithObject_type_index( + NSOrderedCollectionChange initWithObject_type_index_( NSObject anObject, int type, int index) { final _ret = _lib._objc_msgSend_106( _id, _lib._sel_initWithObject_type_index_1, anObject._id, type, index); return NSOrderedCollectionChange._(_ret, _lib); } - NSOrderedCollectionChange initWithObject_type_index_associatedIndex( + NSOrderedCollectionChange initWithObject_type_index_associatedIndex_( NSObject anObject, int type, int index, int associatedIndex) { final _ret = _lib._objc_msgSend_107( _id, @@ -7462,37 +7466,37 @@ class NSIndexSet extends NSObject { return NSIndexSet._(_ret, _lib); } - static NSIndexSet indexSetWithIndex(StringTestObjCLibrary _lib, int value) { + static NSIndexSet indexSetWithIndex_(StringTestObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_108( _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndex_1, value); return NSIndexSet._(_ret, _lib); } - static NSIndexSet indexSetWithIndexesInRange( + static NSIndexSet indexSetWithIndexesInRange_( StringTestObjCLibrary _lib, NSRange range) { final _ret = _lib._objc_msgSend_109( _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndexesInRange_1, range); return NSIndexSet._(_ret, _lib); } - NSIndexSet initWithIndexesInRange(NSRange range) { + NSIndexSet initWithIndexesInRange_(NSRange range) { final _ret = _lib._objc_msgSend_109(_id, _lib._sel_initWithIndexesInRange_1, range); return NSIndexSet._(_ret, _lib); } - NSIndexSet initWithIndexSet(NSObject? indexSet) { + NSIndexSet initWithIndexSet_(NSObject? indexSet) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithIndexSet_1, indexSet?._id ?? ffi.nullptr); return NSIndexSet._(_ret, _lib); } - NSIndexSet initWithIndex(int value) { + NSIndexSet initWithIndex_(int value) { final _ret = _lib._objc_msgSend_108(_id, _lib._sel_initWithIndex_1, value); return NSIndexSet._(_ret, _lib); } - bool isEqualToIndexSet(NSObject? indexSet) { + bool isEqualToIndexSet_(NSObject? indexSet) { return _lib._objc_msgSend_4( _id, _lib._sel_isEqualToIndexSet_1, indexSet?._id ?? ffi.nullptr); } @@ -7509,25 +7513,25 @@ class NSIndexSet extends NSObject { return _lib._objc_msgSend_11(_id, _lib._sel_lastIndex1); } - int indexGreaterThanIndex(int value) { + int indexGreaterThanIndex_(int value) { return _lib._objc_msgSend_44(_id, _lib._sel_indexGreaterThanIndex_1, value); } - int indexLessThanIndex(int value) { + int indexLessThanIndex_(int value) { return _lib._objc_msgSend_44(_id, _lib._sel_indexLessThanIndex_1, value); } - int indexGreaterThanOrEqualToIndex(int value) { + int indexGreaterThanOrEqualToIndex_(int value) { return _lib._objc_msgSend_44( _id, _lib._sel_indexGreaterThanOrEqualToIndex_1, value); } - int indexLessThanOrEqualToIndex(int value) { + int indexLessThanOrEqualToIndex_(int value) { return _lib._objc_msgSend_44( _id, _lib._sel_indexLessThanOrEqualToIndex_1, value); } - int getIndexes_maxCount_inIndexRange(ffi.Pointer indexBuffer, + int getIndexes_maxCount_inIndexRange_(ffi.Pointer indexBuffer, int bufferSize, NSRangePointer range) { return _lib._objc_msgSend_110( _id, @@ -7537,41 +7541,41 @@ class NSIndexSet extends NSObject { range); } - int countOfIndexesInRange(NSRange range) { + int countOfIndexesInRange_(NSRange range) { return _lib._objc_msgSend_111( _id, _lib._sel_countOfIndexesInRange_1, range); } - bool containsIndex(int value) { + bool containsIndex_(int value) { return _lib._objc_msgSend_40(_id, _lib._sel_containsIndex_1, value); } - bool containsIndexesInRange(NSRange range) { + bool containsIndexesInRange_(NSRange range) { return _lib._objc_msgSend_112( _id, _lib._sel_containsIndexesInRange_1, range); } - bool containsIndexes(NSObject? indexSet) { + bool containsIndexes_(NSObject? indexSet) { return _lib._objc_msgSend_4( _id, _lib._sel_containsIndexes_1, indexSet?._id ?? ffi.nullptr); } - bool intersectsIndexesInRange(NSRange range) { + bool intersectsIndexesInRange_(NSRange range) { return _lib._objc_msgSend_112( _id, _lib._sel_intersectsIndexesInRange_1, range); } - void enumerateIndexesUsingBlock(ObjCBlock4 block) { + void enumerateIndexesUsingBlock_(ObjCBlock4 block) { _lib._objc_msgSend_113( _id, _lib._sel_enumerateIndexesUsingBlock_1, block._impl); } - void enumerateIndexesWithOptions_usingBlock(int opts, ObjCBlock4 block) { + void enumerateIndexesWithOptions_usingBlock_(int opts, ObjCBlock4 block) { _lib._objc_msgSend_114(_id, _lib._sel_enumerateIndexesWithOptions_usingBlock_1, opts, block._impl); } - void enumerateIndexesInRange_options_usingBlock( + void enumerateIndexesInRange_options_usingBlock_( NSRange range, int opts, ObjCBlock4 block) { _lib._objc_msgSend_115( _id, @@ -7581,17 +7585,17 @@ class NSIndexSet extends NSObject { block._impl); } - int indexPassingTest(ObjCBlock5 predicate) { + int indexPassingTest_(ObjCBlock5 predicate) { return _lib._objc_msgSend_116( _id, _lib._sel_indexPassingTest_1, predicate._impl); } - int indexWithOptions_passingTest(int opts, ObjCBlock5 predicate) { + int indexWithOptions_passingTest_(int opts, ObjCBlock5 predicate) { return _lib._objc_msgSend_117( _id, _lib._sel_indexWithOptions_passingTest_1, opts, predicate._impl); } - int indexInRange_options_passingTest( + int indexInRange_options_passingTest_( NSRange range, int opts, ObjCBlock5 predicate) { return _lib._objc_msgSend_118( _id, @@ -7601,19 +7605,19 @@ class NSIndexSet extends NSObject { predicate._impl); } - NSIndexSet indexesPassingTest(ObjCBlock5 predicate) { + NSIndexSet indexesPassingTest_(ObjCBlock5 predicate) { final _ret = _lib._objc_msgSend_119( _id, _lib._sel_indexesPassingTest_1, predicate._impl); return NSIndexSet._(_ret, _lib); } - NSIndexSet indexesWithOptions_passingTest(int opts, ObjCBlock5 predicate) { + NSIndexSet indexesWithOptions_passingTest_(int opts, ObjCBlock5 predicate) { final _ret = _lib._objc_msgSend_120( _id, _lib._sel_indexesWithOptions_passingTest_1, opts, predicate._impl); return NSIndexSet._(_ret, _lib); } - NSIndexSet indexesInRange_options_passingTest( + NSIndexSet indexesInRange_options_passingTest_( NSRange range, int opts, ObjCBlock5 predicate) { final _ret = _lib._objc_msgSend_121( _id, @@ -7624,17 +7628,17 @@ class NSIndexSet extends NSObject { return NSIndexSet._(_ret, _lib); } - void enumerateRangesUsingBlock(ObjCBlock6 block) { + void enumerateRangesUsingBlock_(ObjCBlock6 block) { _lib._objc_msgSend_122( _id, _lib._sel_enumerateRangesUsingBlock_1, block._impl); } - void enumerateRangesWithOptions_usingBlock(int opts, ObjCBlock6 block) { + void enumerateRangesWithOptions_usingBlock_(int opts, ObjCBlock6 block) { _lib._objc_msgSend_123(_id, _lib._sel_enumerateRangesWithOptions_usingBlock_1, opts, block._impl); } - void enumerateRangesInRange_options_usingBlock( + void enumerateRangesInRange_options_usingBlock_( NSRange range, int opts, ObjCBlock6 block) { _lib._objc_msgSend_124( _id, @@ -7767,12 +7771,12 @@ class NSMutableIndexSet extends NSIndexSet { return NSMutableIndexSet._(other, lib); } - void addIndexes(NSObject? indexSet) { + void addIndexes_(NSObject? indexSet) { _lib._objc_msgSend_8( _id, _lib._sel_addIndexes_1, indexSet?._id ?? ffi.nullptr); } - void removeIndexes(NSObject? indexSet) { + void removeIndexes_(NSObject? indexSet) { _lib._objc_msgSend_8( _id, _lib._sel_removeIndexes_1, indexSet?._id ?? ffi.nullptr); } @@ -7781,23 +7785,23 @@ class NSMutableIndexSet extends NSIndexSet { _lib._objc_msgSend_0(_id, _lib._sel_removeAllIndexes1); } - void addIndex(int value) { + void addIndex_(int value) { _lib._objc_msgSend_41(_id, _lib._sel_addIndex_1, value); } - void removeIndex(int value) { + void removeIndex_(int value) { _lib._objc_msgSend_41(_id, _lib._sel_removeIndex_1, value); } - void addIndexesInRange(NSRange range) { + void addIndexesInRange_(NSRange range) { _lib._objc_msgSend_125(_id, _lib._sel_addIndexesInRange_1, range); } - void removeIndexesInRange(NSRange range) { + void removeIndexesInRange_(NSRange range) { _lib._objc_msgSend_125(_id, _lib._sel_removeIndexesInRange_1, range); } - void shiftIndexesStartingAtIndex_by(int index, int delta) { + void shiftIndexesStartingAtIndex_by_(int index, int delta) { _lib._objc_msgSend_126( _id, _lib._sel_shiftIndexesStartingAtIndex_by_1, index, delta); } @@ -7808,14 +7812,14 @@ class NSMutableIndexSet extends NSIndexSet { return NSMutableIndexSet._(_ret, _lib); } - static NSMutableIndexSet indexSetWithIndex( + static NSMutableIndexSet indexSetWithIndex_( StringTestObjCLibrary _lib, int value) { final _ret = _lib._objc_msgSend_108( _lib._class_NSMutableIndexSet1, _lib._sel_indexSetWithIndex_1, value); return NSMutableIndexSet._(_ret, _lib); } - static NSMutableIndexSet indexSetWithIndexesInRange( + static NSMutableIndexSet indexSetWithIndexesInRange_( StringTestObjCLibrary _lib, NSRange range) { final _ret = _lib._objc_msgSend_109(_lib._class_NSMutableIndexSet1, _lib._sel_indexSetWithIndexesInRange_1, range); @@ -7858,14 +7862,14 @@ class NSOrderedCollectionDifference extends NSObject { return NSOrderedCollectionDifference._(other, lib); } - NSOrderedCollectionDifference initWithChanges(NSObject? changes) { + NSOrderedCollectionDifference initWithChanges_(NSObject? changes) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithChanges_1, changes?._id ?? ffi.nullptr); return NSOrderedCollectionDifference._(_ret, _lib); } NSOrderedCollectionDifference - initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges( + initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges_( NSObject? inserts, NSObject? insertedObjects, NSObject? removes, @@ -7883,7 +7887,7 @@ class NSOrderedCollectionDifference extends NSObject { } NSOrderedCollectionDifference - initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects( + initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_( NSObject? inserts, NSObject? insertedObjects, NSObject? removes, @@ -7947,7 +7951,7 @@ class NSArray extends NSObject { return _lib._objc_msgSend_11(_id, _lib._sel_count1); } - NSObject objectAtIndex(int index) { + NSObject objectAtIndex_(int index) { final _ret = _lib._objc_msgSend_108(_id, _lib._sel_objectAtIndex_1, index); return NSObject._(_ret, _lib); } @@ -7958,26 +7962,26 @@ class NSArray extends NSObject { return NSArray._(_ret, _lib); } - NSArray initWithObjects_count( + NSArray initWithObjects_count_( ffi.Pointer> objects, int cnt) { final _ret = _lib._objc_msgSend_129( _id, _lib._sel_initWithObjects_count_1, objects, cnt); return NSArray._(_ret, _lib); } - NSArray initWithCoder(NSObject? coder) { + NSArray initWithCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); return NSArray._(_ret, _lib); } - NSString componentsJoinedByString(NSObject? separator) { + NSString componentsJoinedByString_(NSObject? separator) { final _ret = _lib._objc_msgSend_28(_id, _lib._sel_componentsJoinedByString_1, separator?._id ?? ffi.nullptr); return NSString._(_ret, _lib); } - bool containsObject(NSObject anObject) { + bool containsObject_(NSObject anObject) { return _lib._objc_msgSend_4(_id, _lib._sel_containsObject_1, anObject._id); } @@ -7986,49 +7990,49 @@ class NSArray extends NSObject { return _ret.address == 0 ? null : NSObject._(_ret, _lib); } - NSString descriptionWithLocale(NSObject locale) { + NSString descriptionWithLocale_(NSObject locale) { final _ret = _lib._objc_msgSend_28( _id, _lib._sel_descriptionWithLocale_1, locale._id); return NSString._(_ret, _lib); } - NSString descriptionWithLocale_indent(NSObject locale, int level) { + NSString descriptionWithLocale_indent_(NSObject locale, int level) { final _ret = _lib._objc_msgSend_130( _id, _lib._sel_descriptionWithLocale_indent_1, locale._id, level); return NSString._(_ret, _lib); } - NSObject firstObjectCommonWithArray(NSObject? otherArray) { + NSObject firstObjectCommonWithArray_(NSObject? otherArray) { final _ret = _lib._objc_msgSend_13(_id, _lib._sel_firstObjectCommonWithArray_1, otherArray?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - void getObjects_range( + void getObjects_range_( ffi.Pointer> objects, NSRange range) { _lib._objc_msgSend_131(_id, _lib._sel_getObjects_range_1, objects, range); } - int indexOfObject(NSObject anObject) { + int indexOfObject_(NSObject anObject) { return _lib._objc_msgSend_132(_id, _lib._sel_indexOfObject_1, anObject._id); } - int indexOfObject_inRange(NSObject anObject, NSRange range) { + int indexOfObject_inRange_(NSObject anObject, NSRange range) { return _lib._objc_msgSend_133( _id, _lib._sel_indexOfObject_inRange_1, anObject._id, range); } - int indexOfObjectIdenticalTo(NSObject anObject) { + int indexOfObjectIdenticalTo_(NSObject anObject) { return _lib._objc_msgSend_132( _id, _lib._sel_indexOfObjectIdenticalTo_1, anObject._id); } - int indexOfObjectIdenticalTo_inRange(NSObject anObject, NSRange range) { + int indexOfObjectIdenticalTo_inRange_(NSObject anObject, NSRange range) { return _lib._objc_msgSend_133( _id, _lib._sel_indexOfObjectIdenticalTo_inRange_1, anObject._id, range); } - bool isEqualToArray(NSObject? otherArray) { + bool isEqualToArray_(NSObject? otherArray) { return _lib._objc_msgSend_4( _id, _lib._sel_isEqualToArray_1, otherArray?._id ?? ffi.nullptr); } @@ -8048,18 +8052,18 @@ class NSArray extends NSObject { return _ret.address == 0 ? null : NSObject._(_ret, _lib); } - bool writeToURL_error( + bool writeToURL_error_( NSObject? url, ffi.Pointer> error) { return _lib._objc_msgSend_134( _id, _lib._sel_writeToURL_error_1, url?._id ?? ffi.nullptr, error); } - void makeObjectsPerformSelector(ffi.Pointer aSelector) { + void makeObjectsPerformSelector_(ffi.Pointer aSelector) { _lib._objc_msgSend_6( _id, _lib._sel_makeObjectsPerformSelector_1, aSelector); } - void makeObjectsPerformSelector_withObject( + void makeObjectsPerformSelector_withObject_( ffi.Pointer aSelector, NSObject argument) { _lib._objc_msgSend_135( _id, @@ -8068,23 +8072,23 @@ class NSArray extends NSObject { argument._id); } - NSObject objectAtIndexedSubscript(int idx) { + NSObject objectAtIndexedSubscript_(int idx) { final _ret = _lib._objc_msgSend_108(_id, _lib._sel_objectAtIndexedSubscript_1, idx); return NSObject._(_ret, _lib); } - void enumerateObjectsUsingBlock(ObjCBlock7 block) { + void enumerateObjectsUsingBlock_(ObjCBlock7 block) { _lib._objc_msgSend_136( _id, _lib._sel_enumerateObjectsUsingBlock_1, block._impl); } - void enumerateObjectsWithOptions_usingBlock(int opts, ObjCBlock7 block) { + void enumerateObjectsWithOptions_usingBlock_(int opts, ObjCBlock7 block) { _lib._objc_msgSend_137(_id, _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._impl); } - void enumerateObjectsAtIndexes_options_usingBlock( + void enumerateObjectsAtIndexes_options_usingBlock_( NSObject? s, int opts, ObjCBlock7 block) { _lib._objc_msgSend_138( _id, @@ -8094,12 +8098,12 @@ class NSArray extends NSObject { block._impl); } - int indexOfObjectPassingTest(ObjCBlock8 predicate) { + int indexOfObjectPassingTest_(ObjCBlock8 predicate) { return _lib._objc_msgSend_139( _id, _lib._sel_indexOfObjectPassingTest_1, predicate._impl); } - int indexOfObjectWithOptions_passingTest(int opts, ObjCBlock8 predicate) { + int indexOfObjectWithOptions_passingTest_(int opts, ObjCBlock8 predicate) { return _lib._objc_msgSend_140( _id, _lib._sel_indexOfObjectWithOptions_passingTest_1, @@ -8107,7 +8111,7 @@ class NSArray extends NSObject { predicate._impl); } - int indexOfObjectAtIndexes_options_passingTest( + int indexOfObjectAtIndexes_options_passingTest_( NSObject? s, int opts, ObjCBlock8 predicate) { return _lib._objc_msgSend_141( _id, @@ -8117,13 +8121,13 @@ class NSArray extends NSObject { predicate._impl); } - NSIndexSet indexesOfObjectsPassingTest(ObjCBlock8 predicate) { + NSIndexSet indexesOfObjectsPassingTest_(ObjCBlock8 predicate) { final _ret = _lib._objc_msgSend_142( _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._impl); return NSIndexSet._(_ret, _lib); } - NSIndexSet indexesOfObjectsWithOptions_passingTest( + NSIndexSet indexesOfObjectsWithOptions_passingTest_( int opts, ObjCBlock8 predicate) { final _ret = _lib._objc_msgSend_143( _id, @@ -8133,7 +8137,7 @@ class NSArray extends NSObject { return NSIndexSet._(_ret, _lib); } - NSIndexSet indexesOfObjectsAtIndexes_options_passingTest( + NSIndexSet indexesOfObjectsAtIndexes_options_passingTest_( NSObject? s, int opts, ObjCBlock8 predicate) { final _ret = _lib._objc_msgSend_144( _id, @@ -8144,7 +8148,7 @@ class NSArray extends NSObject { return NSIndexSet._(_ret, _lib); } - int indexOfObject_inSortedRange_options_usingComparator( + int indexOfObject_inSortedRange_options_usingComparator_( NSObject obj, NSRange r, int opts, NSComparator cmp) { return _lib._objc_msgSend_145( _id, @@ -8160,61 +8164,61 @@ class NSArray extends NSObject { return NSArray._(_ret, _lib); } - static NSArray arrayWithObject( + static NSArray arrayWithObject_( StringTestObjCLibrary _lib, NSObject anObject) { final _ret = _lib._objc_msgSend_13( _lib._class_NSArray1, _lib._sel_arrayWithObject_1, anObject._id); return NSArray._(_ret, _lib); } - static NSArray arrayWithObjects_count(StringTestObjCLibrary _lib, + static NSArray arrayWithObjects_count_(StringTestObjCLibrary _lib, ffi.Pointer> objects, int cnt) { final _ret = _lib._objc_msgSend_129( _lib._class_NSArray1, _lib._sel_arrayWithObjects_count_1, objects, cnt); return NSArray._(_ret, _lib); } - static NSArray arrayWithObjects( + static NSArray arrayWithObjects_( StringTestObjCLibrary _lib, NSObject firstObj) { final _ret = _lib._objc_msgSend_13( _lib._class_NSArray1, _lib._sel_arrayWithObjects_1, firstObj._id); return NSArray._(_ret, _lib); } - static NSArray arrayWithArray(StringTestObjCLibrary _lib, NSObject? array) { + static NSArray arrayWithArray_(StringTestObjCLibrary _lib, NSObject? array) { final _ret = _lib._objc_msgSend_13(_lib._class_NSArray1, _lib._sel_arrayWithArray_1, array?._id ?? ffi.nullptr); return NSArray._(_ret, _lib); } - NSArray initWithObjects(NSObject firstObj) { + NSArray initWithObjects_(NSObject firstObj) { final _ret = _lib._objc_msgSend_13(_id, _lib._sel_initWithObjects_1, firstObj._id); return NSArray._(_ret, _lib); } - NSArray initWithArray(NSObject? array) { + NSArray initWithArray_(NSObject? array) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithArray_1, array?._id ?? ffi.nullptr); return NSArray._(_ret, _lib); } - NSArray initWithArray_copyItems(NSObject? array, bool flag) { + NSArray initWithArray_copyItems_(NSObject? array, bool flag) { final _ret = _lib._objc_msgSend_146(_id, _lib._sel_initWithArray_copyItems_1, array?._id ?? ffi.nullptr, flag); return NSArray._(_ret, _lib); } - void getObjects(ffi.Pointer> objects) { + void getObjects_(ffi.Pointer> objects) { _lib._objc_msgSend_147(_id, _lib._sel_getObjects_1, objects); } - bool writeToFile_atomically(NSObject? path, bool useAuxiliaryFile) { + bool writeToFile_atomically_(NSObject? path, bool useAuxiliaryFile) { return _lib._objc_msgSend_72(_id, _lib._sel_writeToFile_atomically_1, path?._id ?? ffi.nullptr, useAuxiliaryFile); } - bool writeToURL_atomically(NSObject? url, bool atomically) { + bool writeToURL_atomically_(NSObject? url, bool atomically) { return _lib._objc_msgSend_72(_id, _lib._sel_writeToURL_atomically_1, url?._id ?? ffi.nullptr, atomically); } @@ -8360,11 +8364,11 @@ class NSMutableArray extends NSArray { return NSMutableArray._(other, lib); } - void addObject(NSObject anObject) { + void addObject_(NSObject anObject) { _lib._objc_msgSend_8(_id, _lib._sel_addObject_1, anObject._id); } - void insertObject_atIndex(NSObject anObject, int index) { + void insertObject_atIndex_(NSObject anObject, int index) { _lib._objc_msgSend_148( _id, _lib._sel_insertObject_atIndex_1, anObject._id, index); } @@ -8373,11 +8377,11 @@ class NSMutableArray extends NSArray { _lib._objc_msgSend_0(_id, _lib._sel_removeLastObject1); } - void removeObjectAtIndex(int index) { + void removeObjectAtIndex_(int index) { _lib._objc_msgSend_41(_id, _lib._sel_removeObjectAtIndex_1, index); } - void replaceObjectAtIndex_withObject(int index, NSObject anObject) { + void replaceObjectAtIndex_withObject_(int index, NSObject anObject) { _lib._objc_msgSend_149( _id, _lib._sel_replaceObjectAtIndex_withObject_1, index, anObject._id); } @@ -8388,25 +8392,25 @@ class NSMutableArray extends NSArray { return NSMutableArray._(_ret, _lib); } - NSMutableArray initWithCapacity(int numItems) { + NSMutableArray initWithCapacity_(int numItems) { final _ret = _lib._objc_msgSend_108(_id, _lib._sel_initWithCapacity_1, numItems); return NSMutableArray._(_ret, _lib); } @override - NSMutableArray initWithCoder(NSObject? coder) { + NSMutableArray initWithCoder_(NSObject? coder) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); return NSMutableArray._(_ret, _lib); } - void addObjectsFromArray(NSObject? otherArray) { + void addObjectsFromArray_(NSObject? otherArray) { _lib._objc_msgSend_8( _id, _lib._sel_addObjectsFromArray_1, otherArray?._id ?? ffi.nullptr); } - void exchangeObjectAtIndex_withObjectAtIndex(int idx1, int idx2) { + void exchangeObjectAtIndex_withObjectAtIndex_(int idx1, int idx2) { _lib._objc_msgSend_150( _id, _lib._sel_exchangeObjectAtIndex_withObjectAtIndex_1, idx1, idx2); } @@ -8415,41 +8419,41 @@ class NSMutableArray extends NSArray { _lib._objc_msgSend_0(_id, _lib._sel_removeAllObjects1); } - void removeObject_inRange(NSObject anObject, NSRange range) { + void removeObject_inRange_(NSObject anObject, NSRange range) { _lib._objc_msgSend_151( _id, _lib._sel_removeObject_inRange_1, anObject._id, range); } - void removeObject(NSObject anObject) { + void removeObject_(NSObject anObject) { _lib._objc_msgSend_8(_id, _lib._sel_removeObject_1, anObject._id); } - void removeObjectIdenticalTo_inRange(NSObject anObject, NSRange range) { + void removeObjectIdenticalTo_inRange_(NSObject anObject, NSRange range) { _lib._objc_msgSend_151( _id, _lib._sel_removeObjectIdenticalTo_inRange_1, anObject._id, range); } - void removeObjectIdenticalTo(NSObject anObject) { + void removeObjectIdenticalTo_(NSObject anObject) { _lib._objc_msgSend_8( _id, _lib._sel_removeObjectIdenticalTo_1, anObject._id); } - void removeObjectsFromIndices_numIndices( + void removeObjectsFromIndices_numIndices_( ffi.Pointer indices, int cnt) { _lib._objc_msgSend_152( _id, _lib._sel_removeObjectsFromIndices_numIndices_1, indices, cnt); } - void removeObjectsInArray(NSObject? otherArray) { + void removeObjectsInArray_(NSObject? otherArray) { _lib._objc_msgSend_8( _id, _lib._sel_removeObjectsInArray_1, otherArray?._id ?? ffi.nullptr); } - void removeObjectsInRange(NSRange range) { + void removeObjectsInRange_(NSRange range) { _lib._objc_msgSend_125(_id, _lib._sel_removeObjectsInRange_1, range); } - void replaceObjectsInRange_withObjectsFromArray_range( + void replaceObjectsInRange_withObjectsFromArray_range_( NSRange range, NSObject? otherArray, NSRange otherRange) { _lib._objc_msgSend_153( _id, @@ -8459,7 +8463,7 @@ class NSMutableArray extends NSArray { otherRange); } - void replaceObjectsInRange_withObjectsFromArray( + void replaceObjectsInRange_withObjectsFromArray_( NSRange range, NSObject? otherArray) { _lib._objc_msgSend_154( _id, @@ -8468,12 +8472,12 @@ class NSMutableArray extends NSArray { otherArray?._id ?? ffi.nullptr); } - void setArray(NSObject? otherArray) { + void setArray_(NSObject? otherArray) { _lib._objc_msgSend_8( _id, _lib._sel_setArray_1, otherArray?._id ?? ffi.nullptr); } - void sortUsingFunction_context( + void sortUsingFunction_context_( ffi.Pointer< ffi.NativeFunction< NSInteger Function(ffi.Pointer, @@ -8484,48 +8488,48 @@ class NSMutableArray extends NSArray { _id, _lib._sel_sortUsingFunction_context_1, compare, context); } - void sortUsingSelector(ffi.Pointer comparator) { + void sortUsingSelector_(ffi.Pointer comparator) { _lib._objc_msgSend_6(_id, _lib._sel_sortUsingSelector_1, comparator); } - void insertObjects_atIndexes(NSObject? objects, NSObject? indexes) { + void insertObjects_atIndexes_(NSObject? objects, NSObject? indexes) { _lib._objc_msgSend_156(_id, _lib._sel_insertObjects_atIndexes_1, objects?._id ?? ffi.nullptr, indexes?._id ?? ffi.nullptr); } - void removeObjectsAtIndexes(NSObject? indexes) { + void removeObjectsAtIndexes_(NSObject? indexes) { _lib._objc_msgSend_8( _id, _lib._sel_removeObjectsAtIndexes_1, indexes?._id ?? ffi.nullptr); } - void replaceObjectsAtIndexes_withObjects( + void replaceObjectsAtIndexes_withObjects_( NSObject? indexes, NSObject? objects) { _lib._objc_msgSend_156(_id, _lib._sel_replaceObjectsAtIndexes_withObjects_1, indexes?._id ?? ffi.nullptr, objects?._id ?? ffi.nullptr); } - void setObject_atIndexedSubscript(NSObject obj, int idx) { + void setObject_atIndexedSubscript_(NSObject obj, int idx) { _lib._objc_msgSend_148( _id, _lib._sel_setObject_atIndexedSubscript_1, obj._id, idx); } - void sortUsingComparator(NSComparator cmptr) { + void sortUsingComparator_(NSComparator cmptr) { _lib._objc_msgSend_157(_id, _lib._sel_sortUsingComparator_1, cmptr); } - void sortWithOptions_usingComparator(int opts, NSComparator cmptr) { + void sortWithOptions_usingComparator_(int opts, NSComparator cmptr) { _lib._objc_msgSend_158( _id, _lib._sel_sortWithOptions_usingComparator_1, opts, cmptr); } - static NSMutableArray arrayWithCapacity( + static NSMutableArray arrayWithCapacity_( StringTestObjCLibrary _lib, int numItems) { final _ret = _lib._objc_msgSend_108( _lib._class_NSMutableArray1, _lib._sel_arrayWithCapacity_1, numItems); return NSMutableArray._(_ret, _lib); } - void applyDifference(NSObject? difference) { + void applyDifference_(NSObject? difference) { _lib._objc_msgSend_8( _id, _lib._sel_applyDifference_1, difference?._id ?? ffi.nullptr); } @@ -8536,28 +8540,28 @@ class NSMutableArray extends NSArray { return NSMutableArray._(_ret, _lib); } - static NSMutableArray arrayWithObject( + static NSMutableArray arrayWithObject_( StringTestObjCLibrary _lib, NSObject anObject) { final _ret = _lib._objc_msgSend_13( _lib._class_NSMutableArray1, _lib._sel_arrayWithObject_1, anObject._id); return NSMutableArray._(_ret, _lib); } - static NSMutableArray arrayWithObjects_count(StringTestObjCLibrary _lib, + static NSMutableArray arrayWithObjects_count_(StringTestObjCLibrary _lib, ffi.Pointer> objects, int cnt) { final _ret = _lib._objc_msgSend_129(_lib._class_NSMutableArray1, _lib._sel_arrayWithObjects_count_1, objects, cnt); return NSMutableArray._(_ret, _lib); } - static NSMutableArray arrayWithObjects( + static NSMutableArray arrayWithObjects_( StringTestObjCLibrary _lib, NSObject firstObj) { final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableArray1, _lib._sel_arrayWithObjects_1, firstObj._id); return NSMutableArray._(_ret, _lib); } - static NSMutableArray arrayWithArray( + static NSMutableArray arrayWithArray_( StringTestObjCLibrary _lib, NSObject? array) { final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableArray1, _lib._sel_arrayWithArray_1, array?._id ?? ffi.nullptr); @@ -8607,7 +8611,7 @@ class NSItemProvider extends NSObject { return NSItemProvider._(_ret, _lib); } - void registerDataRepresentationForTypeIdentifier_visibility_loadHandler( + void registerDataRepresentationForTypeIdentifier_visibility_loadHandler_( NSObject? typeIdentifier, int visibility, ObjCBlock10 loadHandler) { _lib._objc_msgSend_159( _id, @@ -8618,7 +8622,7 @@ class NSItemProvider extends NSObject { } void - registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler( + registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_( NSObject? typeIdentifier, int fileOptions, int visibility, @@ -8638,14 +8642,14 @@ class NSItemProvider extends NSObject { return _ret.address == 0 ? null : NSObject._(_ret, _lib); } - bool hasItemConformingToTypeIdentifier(NSObject? typeIdentifier) { + bool hasItemConformingToTypeIdentifier_(NSObject? typeIdentifier) { return _lib._objc_msgSend_4( _id, _lib._sel_hasItemConformingToTypeIdentifier_1, typeIdentifier?._id ?? ffi.nullptr); } - bool hasRepresentationConformingToTypeIdentifier_fileOptions( + bool hasRepresentationConformingToTypeIdentifier_fileOptions_( NSObject? typeIdentifier, int fileOptions) { return _lib._objc_msgSend_161( _id, @@ -8654,7 +8658,7 @@ class NSItemProvider extends NSObject { fileOptions); } - NSProgress loadDataRepresentationForTypeIdentifier_completionHandler( + NSProgress loadDataRepresentationForTypeIdentifier_completionHandler_( NSObject? typeIdentifier, ObjCBlock11 completionHandler) { final _ret = _lib._objc_msgSend_162( _id, @@ -8664,7 +8668,7 @@ class NSItemProvider extends NSObject { return NSProgress._(_ret, _lib); } - NSProgress loadFileRepresentationForTypeIdentifier_completionHandler( + NSProgress loadFileRepresentationForTypeIdentifier_completionHandler_( NSObject? typeIdentifier, ObjCBlock11 completionHandler) { final _ret = _lib._objc_msgSend_162( _id, @@ -8674,7 +8678,7 @@ class NSItemProvider extends NSObject { return NSProgress._(_ret, _lib); } - NSProgress loadInPlaceFileRepresentationForTypeIdentifier_completionHandler( + NSProgress loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_( NSObject? typeIdentifier, ObjCBlock13 completionHandler) { final _ret = _lib._objc_msgSend_163( _id, @@ -8694,18 +8698,18 @@ class NSItemProvider extends NSObject { _id, _lib._sel_setSuggestedName_1, value?._id ?? ffi.nullptr); } - NSItemProvider initWithObject(NSObject? object) { + NSItemProvider initWithObject_(NSObject? object) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithObject_1, object?._id ?? ffi.nullptr); return NSItemProvider._(_ret, _lib); } - void registerObject_visibility(NSObject? object, int visibility) { + void registerObject_visibility_(NSObject? object, int visibility) { _lib._objc_msgSend_164(_id, _lib._sel_registerObject_visibility_1, object?._id ?? ffi.nullptr, visibility); } - void registerObjectOfClass_visibility_loadHandler( + void registerObjectOfClass_visibility_loadHandler_( NSObject? aClass, int visibility, ObjCBlock10 loadHandler) { _lib._objc_msgSend_159( _id, @@ -8715,12 +8719,12 @@ class NSItemProvider extends NSObject { loadHandler._impl); } - bool canLoadObjectOfClass(NSObject? aClass) { + bool canLoadObjectOfClass_(NSObject? aClass) { return _lib._objc_msgSend_4( _id, _lib._sel_canLoadObjectOfClass_1, aClass?._id ?? ffi.nullptr); } - NSProgress loadObjectOfClass_completionHandler( + NSProgress loadObjectOfClass_completionHandler_( NSObject? aClass, ObjCBlock11 completionHandler) { final _ret = _lib._objc_msgSend_162( _id, @@ -8730,7 +8734,7 @@ class NSItemProvider extends NSObject { return NSProgress._(_ret, _lib); } - NSItemProvider initWithItem_typeIdentifier( + NSItemProvider initWithItem_typeIdentifier_( NSObject? item, NSObject? typeIdentifier) { final _ret = _lib._objc_msgSend_58( _id, @@ -8740,13 +8744,13 @@ class NSItemProvider extends NSObject { return NSItemProvider._(_ret, _lib); } - NSItemProvider initWithContentsOfURL(NSObject? fileURL) { + NSItemProvider initWithContentsOfURL_(NSObject? fileURL) { final _ret = _lib._objc_msgSend_13( _id, _lib._sel_initWithContentsOfURL_1, fileURL?._id ?? ffi.nullptr); return NSItemProvider._(_ret, _lib); } - void registerItemForTypeIdentifier_loadHandler( + void registerItemForTypeIdentifier_loadHandler_( NSObject? typeIdentifier, NSItemProviderLoadHandler loadHandler) { _lib._objc_msgSend_165( _id, @@ -8755,7 +8759,7 @@ class NSItemProvider extends NSObject { loadHandler); } - void loadItemForTypeIdentifier_options_completionHandler( + void loadItemForTypeIdentifier_options_completionHandler_( NSObject? typeIdentifier, NSObject? options, NSItemProviderCompletionHandler completionHandler) { @@ -8775,7 +8779,7 @@ class NSItemProvider extends NSObject { _lib._objc_msgSend_168(_id, _lib._sel_setPreviewImageHandler_1, value); } - void loadPreviewImageWithOptions_completionHandler( + void loadPreviewImageWithOptions_completionHandler_( NSObject? options, NSItemProviderCompletionHandler completionHandler) { _lib._objc_msgSend_169( _id, @@ -9024,36 +9028,36 @@ class NSMutableString extends NSString { return NSMutableString._(other, lib); } - void replaceCharactersInRange_withString(NSRange range, NSObject? aString) { + void replaceCharactersInRange_withString_(NSRange range, NSObject? aString) { _lib._objc_msgSend_154(_id, _lib._sel_replaceCharactersInRange_withString_1, range, aString?._id ?? ffi.nullptr); } - void insertString_atIndex(NSObject? aString, int loc) { + void insertString_atIndex_(NSObject? aString, int loc) { _lib._objc_msgSend_148(_id, _lib._sel_insertString_atIndex_1, aString?._id ?? ffi.nullptr, loc); } - void deleteCharactersInRange(NSRange range) { + void deleteCharactersInRange_(NSRange range) { _lib._objc_msgSend_125(_id, _lib._sel_deleteCharactersInRange_1, range); } - void appendString(NSObject? aString) { + void appendString_(NSObject? aString) { _lib._objc_msgSend_8( _id, _lib._sel_appendString_1, aString?._id ?? ffi.nullptr); } - void appendFormat(NSObject? format) { + void appendFormat_(NSObject? format) { _lib._objc_msgSend_8( _id, _lib._sel_appendFormat_1, format?._id ?? ffi.nullptr); } - void setString(NSObject? aString) { + void setString_(NSObject? aString) { _lib._objc_msgSend_8( _id, _lib._sel_setString_1, aString?._id ?? ffi.nullptr); } - int replaceOccurrencesOfString_withString_options_range(NSObject? target, + int replaceOccurrencesOfString_withString_options_range_(NSObject? target, NSObject? replacement, int options, NSRange searchRange) { return _lib._objc_msgSend_170( _id, @@ -9064,7 +9068,7 @@ class NSMutableString extends NSString { searchRange); } - bool applyTransform_reverse_range_updatedRange(NSStringTransform transform, + bool applyTransform_reverse_range_updatedRange_(NSStringTransform transform, bool reverse, NSRange range, NSRangePointer resultingRange) { return _lib._objc_msgSend_171( _id, @@ -9075,13 +9079,13 @@ class NSMutableString extends NSString { resultingRange); } - NSMutableString initWithCapacity(int capacity) { + NSMutableString initWithCapacity_(int capacity) { final _ret = _lib._objc_msgSend_172(_id, _lib._sel_initWithCapacity_1, capacity); return NSMutableString._(_ret, _lib); } - static NSMutableString stringWithCapacity( + static NSMutableString stringWithCapacity_( StringTestObjCLibrary _lib, int capacity) { final _ret = _lib._objc_msgSend_172( _lib._class_NSMutableString1, _lib._sel_stringWithCapacity_1, capacity); @@ -9094,7 +9098,7 @@ class NSMutableString extends NSString { _lib._class_NSMutableString1, _lib._sel_availableStringEncodings1); } - static NSString localizedNameOfStringEncoding( + static NSString localizedNameOfStringEncoding_( StringTestObjCLibrary _lib, int encoding) { final _ret = _lib._objc_msgSend_14(_lib._class_NSMutableString1, _lib._sel_localizedNameOfStringEncoding_1, encoding); @@ -9112,49 +9116,49 @@ class NSMutableString extends NSString { return NSMutableString._(_ret, _lib); } - static NSMutableString stringWithString( + static NSMutableString stringWithString_( StringTestObjCLibrary _lib, NSObject? string) { final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); return NSMutableString._(_ret, _lib); } - static NSMutableString stringWithCharacters_length( + static NSMutableString stringWithCharacters_length_( StringTestObjCLibrary _lib, ffi.Pointer characters, int length) { final _ret = _lib._objc_msgSend_55(_lib._class_NSMutableString1, _lib._sel_stringWithCharacters_length_1, characters, length); return NSMutableString._(_ret, _lib); } - static NSMutableString stringWithUTF8String(StringTestObjCLibrary _lib, + static NSMutableString stringWithUTF8String_(StringTestObjCLibrary _lib, ffi.Pointer nullTerminatedCString) { final _ret = _lib._objc_msgSend_56(_lib._class_NSMutableString1, _lib._sel_stringWithUTF8String_1, nullTerminatedCString); return NSMutableString._(_ret, _lib); } - static NSMutableString stringWithFormat( + static NSMutableString stringWithFormat_( StringTestObjCLibrary _lib, NSObject? format) { final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); return NSMutableString._(_ret, _lib); } - static NSMutableString localizedStringWithFormat( + static NSMutableString localizedStringWithFormat_( StringTestObjCLibrary _lib, NSObject? format) { final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); return NSMutableString._(_ret, _lib); } - static NSMutableString stringWithCString_encoding( + static NSMutableString stringWithCString_encoding_( StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { final _ret = _lib._objc_msgSend_64(_lib._class_NSMutableString1, _lib._sel_stringWithCString_encoding_1, cString, enc); return NSMutableString._(_ret, _lib); } - static NSMutableString stringWithContentsOfURL_encoding_error( + static NSMutableString stringWithContentsOfURL_encoding_error_( StringTestObjCLibrary _lib, NSObject? url, int enc, @@ -9168,7 +9172,7 @@ class NSMutableString extends NSString { return NSMutableString._(_ret, _lib); } - static NSMutableString stringWithContentsOfFile_encoding_error( + static NSMutableString stringWithContentsOfFile_encoding_error_( StringTestObjCLibrary _lib, NSObject? path, int enc, @@ -9182,7 +9186,7 @@ class NSMutableString extends NSString { return NSMutableString._(_ret, _lib); } - static NSMutableString stringWithContentsOfURL_usedEncoding_error( + static NSMutableString stringWithContentsOfURL_usedEncoding_error_( StringTestObjCLibrary _lib, NSObject? url, ffi.Pointer enc, @@ -9196,7 +9200,7 @@ class NSMutableString extends NSString { return NSMutableString._(_ret, _lib); } - static NSMutableString stringWithContentsOfFile_usedEncoding_error( + static NSMutableString stringWithContentsOfFile_usedEncoding_error_( StringTestObjCLibrary _lib, NSObject? path, ffi.Pointer enc, @@ -9211,7 +9215,7 @@ class NSMutableString extends NSString { } static int - stringEncodingForData_encodingOptions_convertedString_usedLossyConversion( + stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( StringTestObjCLibrary _lib, NSObject? data, NSObject? opts, @@ -9226,28 +9230,28 @@ class NSMutableString extends NSString { usedLossyConversion); } - static NSObject stringWithContentsOfFile( + static NSObject stringWithContentsOfFile_( StringTestObjCLibrary _lib, NSObject? path) { final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static NSObject stringWithContentsOfURL( + static NSObject stringWithContentsOfURL_( StringTestObjCLibrary _lib, NSObject? url) { final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static NSObject stringWithCString_length( + static NSObject stringWithCString_length_( StringTestObjCLibrary _lib, ffi.Pointer bytes, int length) { final _ret = _lib._objc_msgSend_64(_lib._class_NSMutableString1, _lib._sel_stringWithCString_length_1, bytes, length); return NSObject._(_ret, _lib); } - static NSObject stringWithCString( + static NSObject stringWithCString_( StringTestObjCLibrary _lib, ffi.Pointer bytes) { final _ret = _lib._objc_msgSend_56( _lib._class_NSMutableString1, _lib._sel_stringWithCString_1, bytes); @@ -9288,7 +9292,7 @@ class NSSimpleCString extends NSString { _lib._class_NSSimpleCString1, _lib._sel_availableStringEncodings1); } - static NSString localizedNameOfStringEncoding( + static NSString localizedNameOfStringEncoding_( StringTestObjCLibrary _lib, int encoding) { final _ret = _lib._objc_msgSend_14(_lib._class_NSSimpleCString1, _lib._sel_localizedNameOfStringEncoding_1, encoding); @@ -9306,49 +9310,49 @@ class NSSimpleCString extends NSString { return NSSimpleCString._(_ret, _lib); } - static NSSimpleCString stringWithString( + static NSSimpleCString stringWithString_( StringTestObjCLibrary _lib, NSObject? string) { final _ret = _lib._objc_msgSend_13(_lib._class_NSSimpleCString1, _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); return NSSimpleCString._(_ret, _lib); } - static NSSimpleCString stringWithCharacters_length( + static NSSimpleCString stringWithCharacters_length_( StringTestObjCLibrary _lib, ffi.Pointer characters, int length) { final _ret = _lib._objc_msgSend_55(_lib._class_NSSimpleCString1, _lib._sel_stringWithCharacters_length_1, characters, length); return NSSimpleCString._(_ret, _lib); } - static NSSimpleCString stringWithUTF8String(StringTestObjCLibrary _lib, + static NSSimpleCString stringWithUTF8String_(StringTestObjCLibrary _lib, ffi.Pointer nullTerminatedCString) { final _ret = _lib._objc_msgSend_56(_lib._class_NSSimpleCString1, _lib._sel_stringWithUTF8String_1, nullTerminatedCString); return NSSimpleCString._(_ret, _lib); } - static NSSimpleCString stringWithFormat( + static NSSimpleCString stringWithFormat_( StringTestObjCLibrary _lib, NSObject? format) { final _ret = _lib._objc_msgSend_13(_lib._class_NSSimpleCString1, _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); return NSSimpleCString._(_ret, _lib); } - static NSSimpleCString localizedStringWithFormat( + static NSSimpleCString localizedStringWithFormat_( StringTestObjCLibrary _lib, NSObject? format) { final _ret = _lib._objc_msgSend_13(_lib._class_NSSimpleCString1, _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); return NSSimpleCString._(_ret, _lib); } - static NSSimpleCString stringWithCString_encoding( + static NSSimpleCString stringWithCString_encoding_( StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { final _ret = _lib._objc_msgSend_64(_lib._class_NSSimpleCString1, _lib._sel_stringWithCString_encoding_1, cString, enc); return NSSimpleCString._(_ret, _lib); } - static NSSimpleCString stringWithContentsOfURL_encoding_error( + static NSSimpleCString stringWithContentsOfURL_encoding_error_( StringTestObjCLibrary _lib, NSObject? url, int enc, @@ -9362,7 +9366,7 @@ class NSSimpleCString extends NSString { return NSSimpleCString._(_ret, _lib); } - static NSSimpleCString stringWithContentsOfFile_encoding_error( + static NSSimpleCString stringWithContentsOfFile_encoding_error_( StringTestObjCLibrary _lib, NSObject? path, int enc, @@ -9376,7 +9380,7 @@ class NSSimpleCString extends NSString { return NSSimpleCString._(_ret, _lib); } - static NSSimpleCString stringWithContentsOfURL_usedEncoding_error( + static NSSimpleCString stringWithContentsOfURL_usedEncoding_error_( StringTestObjCLibrary _lib, NSObject? url, ffi.Pointer enc, @@ -9390,7 +9394,7 @@ class NSSimpleCString extends NSString { return NSSimpleCString._(_ret, _lib); } - static NSSimpleCString stringWithContentsOfFile_usedEncoding_error( + static NSSimpleCString stringWithContentsOfFile_usedEncoding_error_( StringTestObjCLibrary _lib, NSObject? path, ffi.Pointer enc, @@ -9405,7 +9409,7 @@ class NSSimpleCString extends NSString { } static int - stringEncodingForData_encodingOptions_convertedString_usedLossyConversion( + stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( StringTestObjCLibrary _lib, NSObject? data, NSObject? opts, @@ -9420,28 +9424,28 @@ class NSSimpleCString extends NSString { usedLossyConversion); } - static NSObject stringWithContentsOfFile( + static NSObject stringWithContentsOfFile_( StringTestObjCLibrary _lib, NSObject? path) { final _ret = _lib._objc_msgSend_13(_lib._class_NSSimpleCString1, _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static NSObject stringWithContentsOfURL( + static NSObject stringWithContentsOfURL_( StringTestObjCLibrary _lib, NSObject? url) { final _ret = _lib._objc_msgSend_13(_lib._class_NSSimpleCString1, _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static NSObject stringWithCString_length( + static NSObject stringWithCString_length_( StringTestObjCLibrary _lib, ffi.Pointer bytes, int length) { final _ret = _lib._objc_msgSend_64(_lib._class_NSSimpleCString1, _lib._sel_stringWithCString_length_1, bytes, length); return NSObject._(_ret, _lib); } - static NSObject stringWithCString( + static NSObject stringWithCString_( StringTestObjCLibrary _lib, ffi.Pointer bytes) { final _ret = _lib._objc_msgSend_56( _lib._class_NSSimpleCString1, _lib._sel_stringWithCString_1, bytes); @@ -9480,7 +9484,7 @@ class NSConstantString extends NSSimpleCString { _lib._class_NSConstantString1, _lib._sel_availableStringEncodings1); } - static NSString localizedNameOfStringEncoding( + static NSString localizedNameOfStringEncoding_( StringTestObjCLibrary _lib, int encoding) { final _ret = _lib._objc_msgSend_14(_lib._class_NSConstantString1, _lib._sel_localizedNameOfStringEncoding_1, encoding); @@ -9498,49 +9502,49 @@ class NSConstantString extends NSSimpleCString { return NSConstantString._(_ret, _lib); } - static NSConstantString stringWithString( + static NSConstantString stringWithString_( StringTestObjCLibrary _lib, NSObject? string) { final _ret = _lib._objc_msgSend_13(_lib._class_NSConstantString1, _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); return NSConstantString._(_ret, _lib); } - static NSConstantString stringWithCharacters_length( + static NSConstantString stringWithCharacters_length_( StringTestObjCLibrary _lib, ffi.Pointer characters, int length) { final _ret = _lib._objc_msgSend_55(_lib._class_NSConstantString1, _lib._sel_stringWithCharacters_length_1, characters, length); return NSConstantString._(_ret, _lib); } - static NSConstantString stringWithUTF8String(StringTestObjCLibrary _lib, + static NSConstantString stringWithUTF8String_(StringTestObjCLibrary _lib, ffi.Pointer nullTerminatedCString) { final _ret = _lib._objc_msgSend_56(_lib._class_NSConstantString1, _lib._sel_stringWithUTF8String_1, nullTerminatedCString); return NSConstantString._(_ret, _lib); } - static NSConstantString stringWithFormat( + static NSConstantString stringWithFormat_( StringTestObjCLibrary _lib, NSObject? format) { final _ret = _lib._objc_msgSend_13(_lib._class_NSConstantString1, _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); return NSConstantString._(_ret, _lib); } - static NSConstantString localizedStringWithFormat( + static NSConstantString localizedStringWithFormat_( StringTestObjCLibrary _lib, NSObject? format) { final _ret = _lib._objc_msgSend_13(_lib._class_NSConstantString1, _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); return NSConstantString._(_ret, _lib); } - static NSConstantString stringWithCString_encoding( + static NSConstantString stringWithCString_encoding_( StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { final _ret = _lib._objc_msgSend_64(_lib._class_NSConstantString1, _lib._sel_stringWithCString_encoding_1, cString, enc); return NSConstantString._(_ret, _lib); } - static NSConstantString stringWithContentsOfURL_encoding_error( + static NSConstantString stringWithContentsOfURL_encoding_error_( StringTestObjCLibrary _lib, NSObject? url, int enc, @@ -9554,7 +9558,7 @@ class NSConstantString extends NSSimpleCString { return NSConstantString._(_ret, _lib); } - static NSConstantString stringWithContentsOfFile_encoding_error( + static NSConstantString stringWithContentsOfFile_encoding_error_( StringTestObjCLibrary _lib, NSObject? path, int enc, @@ -9568,7 +9572,7 @@ class NSConstantString extends NSSimpleCString { return NSConstantString._(_ret, _lib); } - static NSConstantString stringWithContentsOfURL_usedEncoding_error( + static NSConstantString stringWithContentsOfURL_usedEncoding_error_( StringTestObjCLibrary _lib, NSObject? url, ffi.Pointer enc, @@ -9582,7 +9586,7 @@ class NSConstantString extends NSSimpleCString { return NSConstantString._(_ret, _lib); } - static NSConstantString stringWithContentsOfFile_usedEncoding_error( + static NSConstantString stringWithContentsOfFile_usedEncoding_error_( StringTestObjCLibrary _lib, NSObject? path, ffi.Pointer enc, @@ -9597,7 +9601,7 @@ class NSConstantString extends NSSimpleCString { } static int - stringEncodingForData_encodingOptions_convertedString_usedLossyConversion( + stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( StringTestObjCLibrary _lib, NSObject? data, NSObject? opts, @@ -9612,28 +9616,28 @@ class NSConstantString extends NSSimpleCString { usedLossyConversion); } - static NSObject stringWithContentsOfFile( + static NSObject stringWithContentsOfFile_( StringTestObjCLibrary _lib, NSObject? path) { final _ret = _lib._objc_msgSend_13(_lib._class_NSConstantString1, _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static NSObject stringWithContentsOfURL( + static NSObject stringWithContentsOfURL_( StringTestObjCLibrary _lib, NSObject? url) { final _ret = _lib._objc_msgSend_13(_lib._class_NSConstantString1, _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); return NSObject._(_ret, _lib); } - static NSObject stringWithCString_length( + static NSObject stringWithCString_length_( StringTestObjCLibrary _lib, ffi.Pointer bytes, int length) { final _ret = _lib._objc_msgSend_64(_lib._class_NSConstantString1, _lib._sel_stringWithCString_length_1, bytes, length); return NSObject._(_ret, _lib); } - static NSObject stringWithCString( + static NSObject stringWithCString_( StringTestObjCLibrary _lib, ffi.Pointer bytes) { final _ret = _lib._objc_msgSend_56( _lib._class_NSConstantString1, _lib._sel_stringWithCString_1, bytes); @@ -9666,7 +9670,7 @@ class StringUtil extends NSObject { return StringUtil._(other, lib); } - static NSString strConcat_with( + static NSString strConcat_with_( StringTestObjCLibrary _lib, NSObject? a, NSObject? b) { final _ret = _lib._objc_msgSend_49( _lib._class_StringUtil1, diff --git a/pkgs/ffigen/test/native_objc_test/string_test.dart b/pkgs/ffigen/test/native_objc_test/string_test.dart index 27c6359040..117088b62d 100644 --- a/pkgs/ffigen/test/native_objc_test/string_test.dart +++ b/pkgs/ffigen/test/native_objc_test/string_test.dart @@ -40,7 +40,7 @@ void main() { final str1 = 'Hello'.toNSString(lib); final str2 = 'World!'.toNSString(lib); - final str3 = StringUtil.strConcat_with(lib, str1, str2); + final str3 = StringUtil.strConcat_with_(lib, str1, str2); expect(str3.length, 11); expect(str3.toString(), "HelloWorld!"); }); From 32162936a996b6b37232aa12490cb0ce19fbc39f Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 11 May 2022 13:22:31 -0700 Subject: [PATCH 136/276] [ffigen] Add a registry for ObjC built in interfaces (#358) * ObjC interface registry * Don't remove trailing underscores from method names * Move isInSystemHeader to cursor utils * Fix analysis * Merge --- .../code_generator/objc_built_in_functions.dart | 5 +++++ .../lib/src/code_generator/objc_interface.dart | 8 +++++++- .../clang_bindings/clang_bindings.dart | 16 ++++++++++++++++ .../sub_parsers/objcinterfacedecl_parser.dart | 1 + pkgs/ffigen/lib/src/header_parser/utils.dart | 15 ++++++++------- 5 files changed, 37 insertions(+), 8 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index ebb48aa1f4..23cbb7af9c 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -172,6 +172,11 @@ class _ObjCWrapper { } } + final _interfaceRegistry = {}; + void registerInterface(ObjCInterface interface) { + _interfaceRegistry[interface.originalName] = interface; + } + void generateNSStringUtils(Writer w, StringBuffer s) { // Generate a constructor that wraps stringWithCString. s.write(' factory NSString(${w.className} _lib, String str) {\n'); diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 0879e94542..e92b4e398d 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -42,6 +42,7 @@ class ObjCInterface extends BindingType { bool filled = false; final ObjCBuiltInFunctions builtInFunctions; + final bool isBuiltIn; late final ObjCInternalGlobal _classObject; ObjCInterface({ @@ -50,6 +51,7 @@ class ObjCInterface extends BindingType { required String name, String? dartDoc, required this.builtInFunctions, + required this.isBuiltIn, }) : super( usr: usr, originalName: originalName, @@ -57,7 +59,7 @@ class ObjCInterface extends BindingType { dartDoc: dartDoc, ); - bool get isNSString => name == "NSString"; + bool get isNSString => isBuiltIn && originalName == "NSString"; @override BindingString toBindingString(Writer w) { @@ -207,6 +209,10 @@ class ObjCInterface extends BindingType { dependencies.add(this); builtInFunctions.addDependencies(dependencies); + if (isBuiltIn) { + builtInFunctions.registerInterface(this); + } + _classObject = ObjCInternalGlobal( PointerType(objCObjectType), '_class_$originalName', diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 9191f674c9..9077b89eac 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -143,6 +143,22 @@ class Clang { late final _clang_getFileName = _clang_getFileNamePtr.asFunction(); + /// Returns non-zero if the given source location is in a system header. + int clang_Location_isInSystemHeader( + CXSourceLocation location, + ) { + return _clang_Location_isInSystemHeader( + location, + ); + } + + late final _clang_Location_isInSystemHeaderPtr = + _lookup>( + 'clang_Location_isInSystemHeader'); + late final _clang_Location_isInSystemHeader = + _clang_Location_isInSystemHeaderPtr + .asFunction(); + /// Determine whether two ranges are equivalent. /// /// \returns non-zero if the ranges are the same, zero if they differ. diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index 03d73252a7..be660df595 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -53,6 +53,7 @@ Type? parseObjCInterfaceDeclaration( name: config.objcInterfaces.renameUsingConfig(name), dartDoc: getCursorDocComment(cursor), builtInFunctions: objCBuiltInFunctions, + isBuiltIn: cursor.isInSystemHeader(), ); } diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index e8c60cfdd1..7352642cf7 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -101,24 +101,25 @@ extension CXCursorExt on clang_types.CXCursor { return clang.clang_getResultType(type()); } + /// Returns the file name of the file that the cursor is inside. String sourceFileName() { final cxsource = clang.clang_getCursorLocation(this); final cxfilePtr = calloc>(); - final line = calloc(); - final column = calloc(); - final offset = calloc(); // Puts the values in these pointers. - clang.clang_getFileLocation(cxsource, cxfilePtr, line, column, offset); + clang.clang_getFileLocation(cxsource, cxfilePtr, nullptr, nullptr, nullptr); final s = clang.clang_getFileName(cxfilePtr.value).toStringAndDispose(); calloc.free(cxfilePtr); - calloc.free(line); - calloc.free(column); - calloc.free(offset); return s; } + /// Returns whether the file that the cursor is inside is a system header. + bool isInSystemHeader() { + final location = clang.clang_getCursorLocation(this); + return clang.clang_Location_isInSystemHeader(location) != 0; + } + /// Recursively print the AST, for debugging. void printAst([int maxDepth = 3]) { _printAstVisitorMaxDepth = maxDepth; From 3e584af336df34ef400b214454574cee458db389 Mon Sep 17 00:00:00 2001 From: Abitofevrything <54505189+abitofevrything@users.noreply.github.com> Date: Thu, 12 May 2022 08:12:39 +0200 Subject: [PATCH 137/276] [ffigen] Update names of compound members to reflect what is generated (#361) --- pkgs/ffigen/lib/src/code_generator/compound.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/compound.dart b/pkgs/ffigen/lib/src/code_generator/compound.dart index ec994cdfea..70a1cd62db 100644 --- a/pkgs/ffigen/lib/src/code_generator/compound.dart +++ b/pkgs/ffigen/lib/src/code_generator/compound.dart @@ -133,12 +133,12 @@ abstract class Compound extends BindingType { s.write('${w.ffiLibraryPrefix}.${isOpaque ? 'Opaque' : dartClassName}{\n'); const depth = ' '; for (final m in members) { - final memberName = localUniqueNamer.makeUnique(m.name); + m.name = localUniqueNamer.makeUnique(m.name); if (m.type is ConstantArray) { s.write('$depth@${w.ffiLibraryPrefix}.Array.multi('); s.write('${_getArrayDimensionLengths(m.type)})\n'); s.write('${depth}external ${_getInlineArrayTypeString(m.type, w)} '); - s.write('$memberName;\n\n'); + s.write('${m.name};\n\n'); } else { if (m.dartDoc != null) { s.write(depth + '/// '); @@ -148,7 +148,7 @@ abstract class Compound extends BindingType { if (!sameDartAndCType(m.type, w)) { s.write('$depth@${m.type.getCType(w)}()\n'); } - s.write('${depth}external ${m.type.getDartType(w)} $memberName;\n\n'); + s.write('${depth}external ${m.type.getDartType(w)} ${m.name};\n\n'); } } s.write('}\n\n'); @@ -178,10 +178,10 @@ abstract class Compound extends BindingType { class Member { final String? dartDoc; final String originalName; - final String name; + String name; final Type type; - const Member({ + Member({ String? originalName, required this.name, required this.type, From cd1fec4fa5ec0696aff6924af23c6f436995841a Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 11 May 2022 23:15:49 -0700 Subject: [PATCH 138/276] [ffigen] Remove ObjC tests that check golden generated code (#363) --- .../ffigen/.github/workflows/test-package.yml | 10 +- .../_expected_objc_basic_types_bindings.dart | 866 -- .../_expected_objc_config_bindings.dart | 806 -- .../_expected_objc_interface_bindings.dart | 940 -- .../header_parser_tests/objc_basic_types.h | 14 - .../objc_basic_types_test.dart | 69 - .../header_parser_tests/objc_config_test.dart | 76 - .../test/header_parser_tests/objc_interface.h | 31 - .../objc_interface_test.dart | 72 - pkgs/ffigen/test/native_objc_test/.gitignore | 1 + .../test/native_objc_test/block_bindings.dart | 1520 --- .../test/native_objc_test/block_test.dart | 26 - .../test/native_objc_test/cast_bindings.dart | 1393 --- .../test/native_objc_test/cast_test.dart | 26 - .../native_objc_test/category_bindings.dart | 1379 --- .../test/native_objc_test/category_test.dart | 26 - .../forward_decl_bindings.dart | 1428 --- .../native_objc_test/forward_decl_test.dart | 26 - .../native_objc_test/method_bindings.dart | 1474 --- .../test/native_objc_test/method_test.dart | 26 - .../{config.yaml => native_objc_config.yaml} | 0 .../native_objc_test/native_objc_test.dart | 40 +- .../test/native_objc_test/native_objc_test.m | 5 + .../native_objc_test_bindings.dart | 9359 -------------- .../native_objc_test/nullable_bindings.dart | 1409 --- .../test/native_objc_test/nullable_test.dart | 26 - .../native_objc_test/property_bindings.dart | 1434 --- .../test/native_objc_test/property_test.dart | 26 - .../test/native_objc_test/rename_config.yaml | 23 + .../test/native_objc_test/rename_test.dart | 31 + .../rename_test.m} | 8 +- pkgs/ffigen/test/native_objc_test/setup.dart | 32 + .../native_objc_test/string_bindings.dart | 10099 ---------------- pkgs/ffigen/test/regen.dart | 45 - 34 files changed, 118 insertions(+), 32628 deletions(-) delete mode 100644 pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart delete mode 100644 pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart delete mode 100644 pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart delete mode 100644 pkgs/ffigen/test/header_parser_tests/objc_basic_types.h delete mode 100644 pkgs/ffigen/test/header_parser_tests/objc_basic_types_test.dart delete mode 100644 pkgs/ffigen/test/header_parser_tests/objc_config_test.dart delete mode 100644 pkgs/ffigen/test/header_parser_tests/objc_interface.h delete mode 100644 pkgs/ffigen/test/header_parser_tests/objc_interface_test.dart create mode 100644 pkgs/ffigen/test/native_objc_test/.gitignore delete mode 100644 pkgs/ffigen/test/native_objc_test/block_bindings.dart delete mode 100644 pkgs/ffigen/test/native_objc_test/cast_bindings.dart delete mode 100644 pkgs/ffigen/test/native_objc_test/category_bindings.dart delete mode 100644 pkgs/ffigen/test/native_objc_test/forward_decl_bindings.dart delete mode 100644 pkgs/ffigen/test/native_objc_test/method_bindings.dart rename pkgs/ffigen/test/native_objc_test/{config.yaml => native_objc_config.yaml} (100%) delete mode 100644 pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart delete mode 100644 pkgs/ffigen/test/native_objc_test/nullable_bindings.dart delete mode 100644 pkgs/ffigen/test/native_objc_test/property_bindings.dart create mode 100644 pkgs/ffigen/test/native_objc_test/rename_config.yaml create mode 100644 pkgs/ffigen/test/native_objc_test/rename_test.dart rename pkgs/ffigen/test/{header_parser_tests/objc_config.h => native_objc_test/rename_test.m} (71%) delete mode 100644 pkgs/ffigen/test/native_objc_test/string_bindings.dart diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 8d404a8a13..ad20456abc 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -13,9 +13,9 @@ env: PUB_ENVIRONMENT: bot.github jobs: - # Check code formatting and static analysis on a single OS (linux). + # Check code formatting and static analysis on a single OS (macos). analyze: - runs-on: ubuntu-latest + runs-on: macos-latest strategy: fail-fast: false matrix: @@ -31,6 +31,8 @@ jobs: - name: Check formatting run: dart format --output=none --set-exit-if-changed . if: always() && steps.install.outcome == 'success' + - name: Build test dylib and bindings + run: dart test/setup.dart - name: Analyze code run: dart analyze --fatal-infos if: always() && steps.install.outcome == 'success' @@ -48,7 +50,7 @@ jobs: run: dart pub get - name: Install libclang-10-dev run: sudo apt-get install libclang-10-dev - - name: Build test dylib + - name: Build test dylib and bindings run: dart test/setup.dart - name: Run VM tests run: dart test --platform vm @@ -63,7 +65,7 @@ jobs: sdk: stable - name: Install dependencies run: dart pub get - - name: Build test dylib + - name: Build test dylib and bindings run: dart test/setup.dart - name: Run VM tests run: dart test --platform vm diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart deleted file mode 100644 index 09b8c87b18..0000000000 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_basic_types_bindings.dart +++ /dev/null @@ -1,866 +0,0 @@ -// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; - -/// ObjC Basic Types Test -class NativeLibrary { - /// Holds the symbol lookup function. - final ffi.Pointer Function(String symbolName) - _lookup; - - /// The symbols are looked up in [dynamicLibrary]. - NativeLibrary(ffi.DynamicLibrary dynamicLibrary) - : _lookup = dynamicLibrary.lookup; - - /// The symbols are looked up with [lookup]. - NativeLibrary.fromLookup( - ffi.Pointer Function(String symbolName) - lookup) - : _lookup = lookup; - - ffi.Pointer _registerName1(String name) { - final cstr = name.toNativeUtf8(); - final sel = _sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; - } - - ffi.Pointer _sel_registerName( - ffi.Pointer str, - ) { - return __sel_registerName( - str, - ); - } - - late final __sel_registerNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sel_registerName'); - late final __sel_registerName = __sel_registerNamePtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _getClass1(String name) { - final cstr = name.toNativeUtf8(); - final clazz = _objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return clazz; - } - - ffi.Pointer _objc_getClass( - ffi.Pointer str, - ) { - return __objc_getClass( - str, - ); - } - - late final __objc_getClassPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('objc_getClass'); - late final __objc_getClass = __objc_getClassPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); - late final ffi.Pointer _sel_load1 = _registerName1("load"); - void _objc_msgSend_0( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_0( - obj, - sel, - ); - } - - late final __objc_msgSend_0Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_initialize1 = - _registerName1("initialize"); - late final ffi.Pointer _sel_init1 = _registerName1("init"); - instancetype _objc_msgSend_1( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1( - obj, - sel, - ); - } - - late final __objc_msgSend_1Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_new1 = _registerName1("new"); - late final ffi.Pointer _sel_allocWithZone_1 = - _registerName1("allocWithZone:"); - instancetype _objc_msgSend_2( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_2( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_2Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>(); - - late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); - late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); - late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); - late final ffi.Pointer _sel_copy1 = _registerName1("copy"); - late final ffi.Pointer _sel_mutableCopy1 = - _registerName1("mutableCopy"); - late final ffi.Pointer _sel_copyWithZone_1 = - _registerName1("copyWithZone:"); - late final ffi.Pointer _sel_mutableCopyWithZone_1 = - _registerName1("mutableCopyWithZone:"); - late final ffi.Pointer _sel_instancesRespondToSelector_1 = - _registerName1("instancesRespondToSelector:"); - bool _objc_msgSend_3( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_3( - obj, - sel, - aSelector, - ) != - 0; - } - - late final __objc_msgSend_3Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_conformsToProtocol_1 = - _registerName1("conformsToProtocol:"); - bool _objc_msgSend_4( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer protocol, - ) { - return __objc_msgSend_4( - obj, - sel, - protocol, - ) != - 0; - } - - late final __objc_msgSend_4Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_methodForSelector_1 = - _registerName1("methodForSelector:"); - IMP _objc_msgSend_5( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_5( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_5Ptr = _lookup< - ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodForSelector_1 = - _registerName1("instanceMethodForSelector:"); - late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = - _registerName1("doesNotRecognizeSelector:"); - void _objc_msgSend_6( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_6( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_6Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardingTargetForSelector_1 = - _registerName1("forwardingTargetForSelector:"); - ffi.Pointer _objc_msgSend_7( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_7( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_7Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardInvocation_1 = - _registerName1("forwardInvocation:"); - void _objc_msgSend_8( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anInvocation, - ) { - return __objc_msgSend_8( - obj, - sel, - anInvocation, - ); - } - - late final __objc_msgSend_8Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _class_NSMethodSignature1 = - _getClass1("NSMethodSignature"); - late final ffi.Pointer _sel_methodSignatureForSelector_1 = - _registerName1("methodSignatureForSelector:"); - ffi.Pointer _objc_msgSend_9( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_9( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_9Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = - _registerName1("instanceMethodSignatureForSelector:"); - late final ffi.Pointer _sel_allowsWeakReference1 = - _registerName1("allowsWeakReference"); - bool _objc_msgSend_10( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_10( - obj, - sel, - ) != - 0; - } - - late final __objc_msgSend_10Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_retainWeakReference1 = - _registerName1("retainWeakReference"); - late final ffi.Pointer _sel_isSubclassOfClass_1 = - _registerName1("isSubclassOfClass:"); - late final ffi.Pointer _sel_resolveClassMethod_1 = - _registerName1("resolveClassMethod:"); - late final ffi.Pointer _sel_resolveInstanceMethod_1 = - _registerName1("resolveInstanceMethod:"); - late final ffi.Pointer _sel_hash1 = _registerName1("hash"); - int _objc_msgSend_11( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_11( - obj, - sel, - ); - } - - late final __objc_msgSend_11Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_superclass1 = - _registerName1("superclass"); - late final ffi.Pointer _sel_class1 = _registerName1("class"); - late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); - late final ffi.Pointer _sel_stringWithCString_encoding_1 = - _registerName1("stringWithCString:encoding:"); - ffi.Pointer _objc_msgSend_12( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cString, - int enc, - ) { - return __objc_msgSend_12( - obj, - sel, - cString, - enc, - ); - } - - late final __objc_msgSend_12Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_UTF8String1 = - _registerName1("UTF8String"); - ffi.Pointer _objc_msgSend_13( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_13( - obj, - sel, - ); - } - - late final __objc_msgSend_13Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_description1 = - _registerName1("description"); - ffi.Pointer _objc_msgSend_14( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_14( - obj, - sel, - ); - } - - late final __objc_msgSend_14Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_debugDescription1 = - _registerName1("debugDescription"); - late final ffi.Pointer _sel_version1 = _registerName1("version"); - int _objc_msgSend_15( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_15( - obj, - sel, - ); - } - - late final __objc_msgSend_15Ptr = _lookup< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_setVersion_1 = - _registerName1("setVersion:"); - void _objc_msgSend_16( - ffi.Pointer obj, - ffi.Pointer sel, - int aVersion, - ) { - return __objc_msgSend_16( - obj, - sel, - aVersion, - ); - } - - late final __objc_msgSend_16Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_classForCoder1 = - _registerName1("classForCoder"); - late final ffi.Pointer _sel_replacementObjectForCoder_1 = - _registerName1("replacementObjectForCoder:"); - ffi.Pointer _objc_msgSend_17( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_17( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_17Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = - _registerName1("awakeAfterUsingCoder:"); - late final ffi.Pointer _sel_poseAsClass_1 = - _registerName1("poseAsClass:"); - late final ffi.Pointer _sel_autoContentAccessingProxy1 = - _registerName1("autoContentAccessingProxy"); - ffi.Pointer<_ObjCBlockDesc> _newBlockDesc1() { - final d = - pkg_ffi.calloc.allocate<_ObjCBlockDesc>(ffi.sizeOf<_ObjCBlockDesc>()); - d.ref.size = ffi.sizeOf<_ObjCBlock>(); - return d; - } - - late final ffi.Pointer<_ObjCBlockDesc> _objc_block_desc1 = _newBlockDesc1(); - ffi.Pointer<_ObjCBlock> _newBlock1( - ffi.Pointer invoke, ffi.Pointer target) { - final b = pkg_ffi.calloc.allocate<_ObjCBlock>(ffi.sizeOf<_ObjCBlock>()); - b.ref.invoke = invoke; - b.ref.target = target; - b.ref.descriptor = _objc_block_desc1; - return b; - } -} - -class _ObjCWrapper { - final ffi.Pointer _id; - final NativeLibrary _lib; - - _ObjCWrapper._(this._id, this._lib); - - @override - bool operator ==(Object other) { - return other is _ObjCWrapper && _id == other._id; - } - - @override - int get hashCode => _id.hashCode; -} - -class NSObject extends _ObjCWrapper { - NSObject._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); - - static NSObject castFrom(T other) { - return NSObject._(other._id, other._lib); - } - - static NSObject castFromPointer( - NativeLibrary lib, ffi.Pointer other) { - return NSObject._(other, lib); - } - - static void load(NativeLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); - } - - static void initialize(NativeLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); - } - - NSObject init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSObject._(_ret, _lib); - } - - static NSObject new1(NativeLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); - return NSObject._(_ret, _lib); - } - - static NSObject allocWithZone_( - NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject alloc(NativeLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); - return NSObject._(_ret, _lib); - } - - void dealloc() { - _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); - } - - void finalize() { - _lib._objc_msgSend_0(_id, _lib._sel_finalize1); - } - - NSObject copy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); - return NSObject._(_ret, _lib); - } - - NSObject mutableCopy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); - return NSObject._(_ret, _lib); - } - - static NSObject copyWithZone_(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject mutableCopyWithZone_( - NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static bool instancesRespondToSelector_( - NativeLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_3(_lib._class_NSObject1, - _lib._sel_instancesRespondToSelector_1, aSelector); - } - - static bool conformsToProtocol_(NativeLibrary _lib, NSObject? protocol) { - return _lib._objc_msgSend_4(_lib._class_NSObject1, - _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); - } - - IMP methodForSelector_(ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); - } - - static IMP instanceMethodForSelector_( - NativeLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_lib._class_NSObject1, - _lib._sel_instanceMethodForSelector_1, aSelector); - } - - void doesNotRecognizeSelector_(ffi.Pointer aSelector) { - _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); - } - - NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_7( - _id, _lib._sel_forwardingTargetForSelector_1, aSelector); - return NSObject._(_ret, _lib); - } - - void forwardInvocation_(NSObject? anInvocation) { - _lib._objc_msgSend_8( - _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); - } - - NSMethodSignature methodSignatureForSelector_( - ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9( - _id, _lib._sel_methodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - static NSMethodSignature instanceMethodSignatureForSelector_( - NativeLibrary _lib, ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, - _lib._sel_instanceMethodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - bool allowsWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); - } - - bool retainWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); - } - - static bool isSubclassOfClass_(NativeLibrary _lib, NSObject aClass) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); - } - - static bool resolveClassMethod_( - NativeLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); - } - - static bool resolveInstanceMethod_( - NativeLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); - } - - static int hash(NativeLibrary _lib) { - return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); - } - - static NSObject superclass(NativeLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); - return NSObject._(_ret, _lib); - } - - static NSObject class1(NativeLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); - return NSObject._(_ret, _lib); - } - - static NSString description(NativeLibrary _lib) { - final _ret = - _lib._objc_msgSend_14(_lib._class_NSObject1, _lib._sel_description1); - return NSString._(_ret, _lib); - } - - static NSString debugDescription(NativeLibrary _lib) { - final _ret = _lib._objc_msgSend_14( - _lib._class_NSObject1, _lib._sel_debugDescription1); - return NSString._(_ret, _lib); - } - - static int version(NativeLibrary _lib) { - return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); - } - - static void setVersion_(NativeLibrary _lib, int aVersion) { - _lib._objc_msgSend_16( - _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); - } - - NSObject get classForCoder { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); - return NSObject._(_ret, _lib); - } - - NSObject replacementObjectForCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - NSObject awakeAfterUsingCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static void poseAsClass_(NativeLibrary _lib, NSObject aClass) { - _lib._objc_msgSend_8( - _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); - } - - NSObject get autoContentAccessingProxy { - final _ret = - _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); - return NSObject._(_ret, _lib); - } -} - -class ObjCSel extends ffi.Opaque {} - -class ObjCObject extends ffi.Opaque {} - -typedef instancetype = ffi.Pointer; - -class _NSZone extends ffi.Opaque {} - -typedef IMP = ffi.Pointer>; - -class NSMethodSignature extends _ObjCWrapper { - NSMethodSignature._(ffi.Pointer id, NativeLibrary lib) - : super._(id, lib); - - static NSMethodSignature castFrom(T other) { - return NSMethodSignature._(other._id, other._lib); - } - - static NSMethodSignature castFromPointer( - NativeLibrary lib, ffi.Pointer other) { - return NSMethodSignature._(other, lib); - } -} - -typedef NSUInteger = pkg_ffi.UnsignedLong; - -class NSString extends _ObjCWrapper { - NSString._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); - - static NSString castFrom(T other) { - return NSString._(other._id, other._lib); - } - - static NSString castFromPointer( - NativeLibrary lib, ffi.Pointer other) { - return NSString._(other, lib); - } - - factory NSString(NativeLibrary _lib, String str) { - final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); - pkg_ffi.calloc.free(cstr); - return nsstr; - } - - @override - String toString() => (UTF8String).cast().toDartString(); - - static NSString stringWithCString_encoding_( - NativeLibrary _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return NSString._(_ret, _lib); - } - - ffi.Pointer get UTF8String { - return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); - } -} - -extension StringToNSString on String { - NSString toNSString(NativeLibrary lib) => NSString(lib, this); -} - -typedef NSInteger = pkg_ffi.Long; - -class Foo extends ffi.Struct { - @ffi.Uint8() - external int someBool; - - external ffi.Pointer anId; - - external ffi.Pointer selector; - - external ffi.Pointer object; - - external ffi.Pointer clazz; - - external ffi.Pointer<_ObjCBlock> blockThatReturnsAnInt; -} - -int _ObjCBlock_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block) { - return block.ref.target - .cast>() - .asFunction()(); -} - -class ObjCBlock { - final ffi.Pointer<_ObjCBlock> _impl; - final NativeLibrary _lib; - ObjCBlock._(this._impl, this._lib); - - ObjCBlock.fromFunctionPointer( - this._lib, ffi.Pointer> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Int32 Function(ffi.Pointer<_ObjCBlock> block)>( - _ObjCBlock_fnPtrTrampoline, 0) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -class _ObjCBlockDesc extends ffi.Struct { - @pkg_ffi.UnsignedLong() - external int reserved; - - @pkg_ffi.UnsignedLong() - external int size; - - external ffi.Pointer copy_helper; - - external ffi.Pointer dispose_helper; - - external ffi.Pointer signature; -} - -class _ObjCBlock extends ffi.Struct { - external ffi.Pointer isa; - - @pkg_ffi.Int() - external int flags; - - @pkg_ffi.Int() - external int reserved; - - external ffi.Pointer invoke; - - external ffi.Pointer<_ObjCBlockDesc> descriptor; - - external ffi.Pointer target; -} diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart deleted file mode 100644 index 1a57d65aa9..0000000000 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_config_bindings.dart +++ /dev/null @@ -1,806 +0,0 @@ -// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; - -/// ObjC Config Test -class NativeLibrary { - /// Holds the symbol lookup function. - final ffi.Pointer Function(String symbolName) - _lookup; - - /// The symbols are looked up in [dynamicLibrary]. - NativeLibrary(ffi.DynamicLibrary dynamicLibrary) - : _lookup = dynamicLibrary.lookup; - - /// The symbols are looked up with [lookup]. - NativeLibrary.fromLookup( - ffi.Pointer Function(String symbolName) - lookup) - : _lookup = lookup; - - ffi.Pointer _registerName1(String name) { - final cstr = name.toNativeUtf8(); - final sel = _sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; - } - - ffi.Pointer _sel_registerName( - ffi.Pointer str, - ) { - return __sel_registerName( - str, - ); - } - - late final __sel_registerNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sel_registerName'); - late final __sel_registerName = __sel_registerNamePtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _getClass1(String name) { - final cstr = name.toNativeUtf8(); - final clazz = _objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return clazz; - } - - ffi.Pointer _objc_getClass( - ffi.Pointer str, - ) { - return __objc_getClass( - str, - ); - } - - late final __objc_getClassPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('objc_getClass'); - late final __objc_getClass = __objc_getClassPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); - late final ffi.Pointer _sel_load1 = _registerName1("load"); - void _objc_msgSend_0( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_0( - obj, - sel, - ); - } - - late final __objc_msgSend_0Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_initialize1 = - _registerName1("initialize"); - late final ffi.Pointer _sel_init1 = _registerName1("init"); - instancetype _objc_msgSend_1( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1( - obj, - sel, - ); - } - - late final __objc_msgSend_1Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_new1 = _registerName1("new"); - late final ffi.Pointer _sel_allocWithZone_1 = - _registerName1("allocWithZone:"); - instancetype _objc_msgSend_2( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_2( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_2Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>(); - - late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); - late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); - late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); - late final ffi.Pointer _sel_copy1 = _registerName1("copy"); - late final ffi.Pointer _sel_mutableCopy1 = - _registerName1("mutableCopy"); - late final ffi.Pointer _sel_copyWithZone_1 = - _registerName1("copyWithZone:"); - late final ffi.Pointer _sel_mutableCopyWithZone_1 = - _registerName1("mutableCopyWithZone:"); - late final ffi.Pointer _sel_instancesRespondToSelector_1 = - _registerName1("instancesRespondToSelector:"); - bool _objc_msgSend_3( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_3( - obj, - sel, - aSelector, - ) != - 0; - } - - late final __objc_msgSend_3Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_conformsToProtocol_1 = - _registerName1("conformsToProtocol:"); - bool _objc_msgSend_4( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer protocol, - ) { - return __objc_msgSend_4( - obj, - sel, - protocol, - ) != - 0; - } - - late final __objc_msgSend_4Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_methodForSelector_1 = - _registerName1("methodForSelector:"); - IMP _objc_msgSend_5( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_5( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_5Ptr = _lookup< - ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodForSelector_1 = - _registerName1("instanceMethodForSelector:"); - late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = - _registerName1("doesNotRecognizeSelector:"); - void _objc_msgSend_6( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_6( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_6Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardingTargetForSelector_1 = - _registerName1("forwardingTargetForSelector:"); - ffi.Pointer _objc_msgSend_7( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_7( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_7Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardInvocation_1 = - _registerName1("forwardInvocation:"); - void _objc_msgSend_8( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anInvocation, - ) { - return __objc_msgSend_8( - obj, - sel, - anInvocation, - ); - } - - late final __objc_msgSend_8Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _class_NSMethodSignature1 = - _getClass1("NSMethodSignature"); - late final ffi.Pointer _sel_methodSignatureForSelector_1 = - _registerName1("methodSignatureForSelector:"); - ffi.Pointer _objc_msgSend_9( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_9( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_9Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = - _registerName1("instanceMethodSignatureForSelector:"); - late final ffi.Pointer _sel_allowsWeakReference1 = - _registerName1("allowsWeakReference"); - bool _objc_msgSend_10( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_10( - obj, - sel, - ) != - 0; - } - - late final __objc_msgSend_10Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_retainWeakReference1 = - _registerName1("retainWeakReference"); - late final ffi.Pointer _sel_isSubclassOfClass_1 = - _registerName1("isSubclassOfClass:"); - late final ffi.Pointer _sel_resolveClassMethod_1 = - _registerName1("resolveClassMethod:"); - late final ffi.Pointer _sel_resolveInstanceMethod_1 = - _registerName1("resolveInstanceMethod:"); - late final ffi.Pointer _sel_hash1 = _registerName1("hash"); - int _objc_msgSend_11( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_11( - obj, - sel, - ); - } - - late final __objc_msgSend_11Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_superclass1 = - _registerName1("superclass"); - late final ffi.Pointer _sel_class1 = _registerName1("class"); - late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); - late final ffi.Pointer _sel_stringWithCString_encoding_1 = - _registerName1("stringWithCString:encoding:"); - ffi.Pointer _objc_msgSend_12( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cString, - int enc, - ) { - return __objc_msgSend_12( - obj, - sel, - cString, - enc, - ); - } - - late final __objc_msgSend_12Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_UTF8String1 = - _registerName1("UTF8String"); - ffi.Pointer _objc_msgSend_13( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_13( - obj, - sel, - ); - } - - late final __objc_msgSend_13Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_description1 = - _registerName1("description"); - ffi.Pointer _objc_msgSend_14( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_14( - obj, - sel, - ); - } - - late final __objc_msgSend_14Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_debugDescription1 = - _registerName1("debugDescription"); - late final ffi.Pointer _sel_version1 = _registerName1("version"); - int _objc_msgSend_15( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_15( - obj, - sel, - ); - } - - late final __objc_msgSend_15Ptr = _lookup< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_setVersion_1 = - _registerName1("setVersion:"); - void _objc_msgSend_16( - ffi.Pointer obj, - ffi.Pointer sel, - int aVersion, - ) { - return __objc_msgSend_16( - obj, - sel, - aVersion, - ); - } - - late final __objc_msgSend_16Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_classForCoder1 = - _registerName1("classForCoder"); - late final ffi.Pointer _sel_replacementObjectForCoder_1 = - _registerName1("replacementObjectForCoder:"); - ffi.Pointer _objc_msgSend_17( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_17( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_17Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = - _registerName1("awakeAfterUsingCoder:"); - late final ffi.Pointer _sel_poseAsClass_1 = - _registerName1("poseAsClass:"); - late final ffi.Pointer _sel_autoContentAccessingProxy1 = - _registerName1("autoContentAccessingProxy"); - late final ffi.Pointer _class_Foo1 = _getClass1("Foo"); -} - -class _ObjCWrapper { - final ffi.Pointer _id; - final NativeLibrary _lib; - - _ObjCWrapper._(this._id, this._lib); - - @override - bool operator ==(Object other) { - return other is _ObjCWrapper && _id == other._id; - } - - @override - int get hashCode => _id.hashCode; -} - -class NSObject extends _ObjCWrapper { - NSObject._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); - - static NSObject castFrom(T other) { - return NSObject._(other._id, other._lib); - } - - static NSObject castFromPointer( - NativeLibrary lib, ffi.Pointer other) { - return NSObject._(other, lib); - } - - static void load(NativeLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); - } - - static void initialize(NativeLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); - } - - NSObject init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSObject._(_ret, _lib); - } - - static NSObject new1(NativeLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); - return NSObject._(_ret, _lib); - } - - static NSObject allocWithZone_( - NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject alloc(NativeLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); - return NSObject._(_ret, _lib); - } - - void dealloc() { - _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); - } - - void finalize() { - _lib._objc_msgSend_0(_id, _lib._sel_finalize1); - } - - NSObject copy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); - return NSObject._(_ret, _lib); - } - - NSObject mutableCopy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); - return NSObject._(_ret, _lib); - } - - static NSObject copyWithZone_(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject mutableCopyWithZone_( - NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static bool instancesRespondToSelector_( - NativeLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_3(_lib._class_NSObject1, - _lib._sel_instancesRespondToSelector_1, aSelector); - } - - static bool conformsToProtocol_(NativeLibrary _lib, NSObject? protocol) { - return _lib._objc_msgSend_4(_lib._class_NSObject1, - _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); - } - - IMP methodForSelector_(ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); - } - - static IMP instanceMethodForSelector_( - NativeLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_lib._class_NSObject1, - _lib._sel_instanceMethodForSelector_1, aSelector); - } - - void doesNotRecognizeSelector_(ffi.Pointer aSelector) { - _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); - } - - NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_7( - _id, _lib._sel_forwardingTargetForSelector_1, aSelector); - return NSObject._(_ret, _lib); - } - - void forwardInvocation_(NSObject? anInvocation) { - _lib._objc_msgSend_8( - _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); - } - - NSMethodSignature methodSignatureForSelector_( - ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9( - _id, _lib._sel_methodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - static NSMethodSignature instanceMethodSignatureForSelector_( - NativeLibrary _lib, ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, - _lib._sel_instanceMethodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - bool allowsWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); - } - - bool retainWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); - } - - static bool isSubclassOfClass_(NativeLibrary _lib, NSObject aClass) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); - } - - static bool resolveClassMethod_( - NativeLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); - } - - static bool resolveInstanceMethod_( - NativeLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); - } - - static int hash(NativeLibrary _lib) { - return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); - } - - static NSObject superclass(NativeLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); - return NSObject._(_ret, _lib); - } - - static NSObject class1(NativeLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); - return NSObject._(_ret, _lib); - } - - static NSString description(NativeLibrary _lib) { - final _ret = - _lib._objc_msgSend_14(_lib._class_NSObject1, _lib._sel_description1); - return NSString._(_ret, _lib); - } - - static NSString debugDescription(NativeLibrary _lib) { - final _ret = _lib._objc_msgSend_14( - _lib._class_NSObject1, _lib._sel_debugDescription1); - return NSString._(_ret, _lib); - } - - static int version(NativeLibrary _lib) { - return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); - } - - static void setVersion_(NativeLibrary _lib, int aVersion) { - _lib._objc_msgSend_16( - _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); - } - - NSObject get classForCoder { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); - return NSObject._(_ret, _lib); - } - - NSObject replacementObjectForCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - NSObject awakeAfterUsingCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static void poseAsClass_(NativeLibrary _lib, NSObject aClass) { - _lib._objc_msgSend_8( - _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); - } - - NSObject get autoContentAccessingProxy { - final _ret = - _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); - return NSObject._(_ret, _lib); - } -} - -class ObjCSel extends ffi.Opaque {} - -class ObjCObject extends ffi.Opaque {} - -typedef instancetype = ffi.Pointer; - -class _NSZone extends ffi.Opaque {} - -typedef IMP = ffi.Pointer>; - -class NSMethodSignature extends _ObjCWrapper { - NSMethodSignature._(ffi.Pointer id, NativeLibrary lib) - : super._(id, lib); - - static NSMethodSignature castFrom(T other) { - return NSMethodSignature._(other._id, other._lib); - } - - static NSMethodSignature castFromPointer( - NativeLibrary lib, ffi.Pointer other) { - return NSMethodSignature._(other, lib); - } -} - -typedef NSUInteger = pkg_ffi.UnsignedLong; - -class NSString extends _ObjCWrapper { - NSString._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); - - static NSString castFrom(T other) { - return NSString._(other._id, other._lib); - } - - static NSString castFromPointer( - NativeLibrary lib, ffi.Pointer other) { - return NSString._(other, lib); - } - - factory NSString(NativeLibrary _lib, String str) { - final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); - pkg_ffi.calloc.free(cstr); - return nsstr; - } - - @override - String toString() => (UTF8String).cast().toDartString(); - - static NSString stringWithCString_encoding_( - NativeLibrary _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return NSString._(_ret, _lib); - } - - ffi.Pointer get UTF8String { - return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); - } -} - -extension StringToNSString on String { - NSString toNSString(NativeLibrary lib) => NSString(lib, this); -} - -typedef NSInteger = pkg_ffi.Long; - -class Foo extends NSObject { - Foo._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); - - static Foo castFrom(T other) { - return Foo._(other._id, other._lib); - } - - static Foo castFromPointer(NativeLibrary lib, ffi.Pointer other) { - return Foo._(other, lib); - } - - static Foo new1(NativeLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_new1); - return Foo._(_ret, _lib); - } - - static Foo alloc(NativeLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_alloc1); - return Foo._(_ret, _lib); - } -} diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart deleted file mode 100644 index 892dc3b450..0000000000 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_objc_interface_bindings.dart +++ /dev/null @@ -1,940 +0,0 @@ -// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; - -/// ObjC Interface Test -class NativeLibrary { - /// Holds the symbol lookup function. - final ffi.Pointer Function(String symbolName) - _lookup; - - /// The symbols are looked up in [dynamicLibrary]. - NativeLibrary(ffi.DynamicLibrary dynamicLibrary) - : _lookup = dynamicLibrary.lookup; - - /// The symbols are looked up with [lookup]. - NativeLibrary.fromLookup( - ffi.Pointer Function(String symbolName) - lookup) - : _lookup = lookup; - - ffi.Pointer _registerName1(String name) { - final cstr = name.toNativeUtf8(); - final sel = _sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; - } - - ffi.Pointer _sel_registerName( - ffi.Pointer str, - ) { - return __sel_registerName( - str, - ); - } - - late final __sel_registerNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sel_registerName'); - late final __sel_registerName = __sel_registerNamePtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _getClass1(String name) { - final cstr = name.toNativeUtf8(); - final clazz = _objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return clazz; - } - - ffi.Pointer _objc_getClass( - ffi.Pointer str, - ) { - return __objc_getClass( - str, - ); - } - - late final __objc_getClassPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('objc_getClass'); - late final __objc_getClass = __objc_getClassPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); - late final ffi.Pointer _sel_load1 = _registerName1("load"); - void _objc_msgSend_0( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_0( - obj, - sel, - ); - } - - late final __objc_msgSend_0Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_initialize1 = - _registerName1("initialize"); - late final ffi.Pointer _sel_init1 = _registerName1("init"); - instancetype _objc_msgSend_1( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1( - obj, - sel, - ); - } - - late final __objc_msgSend_1Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_new1 = _registerName1("new"); - late final ffi.Pointer _sel_allocWithZone_1 = - _registerName1("allocWithZone:"); - instancetype _objc_msgSend_2( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_2( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_2Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>(); - - late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); - late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); - late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); - late final ffi.Pointer _sel_copy1 = _registerName1("copy"); - late final ffi.Pointer _sel_mutableCopy1 = - _registerName1("mutableCopy"); - late final ffi.Pointer _sel_copyWithZone_1 = - _registerName1("copyWithZone:"); - late final ffi.Pointer _sel_mutableCopyWithZone_1 = - _registerName1("mutableCopyWithZone:"); - late final ffi.Pointer _sel_instancesRespondToSelector_1 = - _registerName1("instancesRespondToSelector:"); - bool _objc_msgSend_3( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_3( - obj, - sel, - aSelector, - ) != - 0; - } - - late final __objc_msgSend_3Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_conformsToProtocol_1 = - _registerName1("conformsToProtocol:"); - bool _objc_msgSend_4( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer protocol, - ) { - return __objc_msgSend_4( - obj, - sel, - protocol, - ) != - 0; - } - - late final __objc_msgSend_4Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_methodForSelector_1 = - _registerName1("methodForSelector:"); - IMP _objc_msgSend_5( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_5( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_5Ptr = _lookup< - ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodForSelector_1 = - _registerName1("instanceMethodForSelector:"); - late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = - _registerName1("doesNotRecognizeSelector:"); - void _objc_msgSend_6( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_6( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_6Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardingTargetForSelector_1 = - _registerName1("forwardingTargetForSelector:"); - ffi.Pointer _objc_msgSend_7( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_7( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_7Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardInvocation_1 = - _registerName1("forwardInvocation:"); - void _objc_msgSend_8( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anInvocation, - ) { - return __objc_msgSend_8( - obj, - sel, - anInvocation, - ); - } - - late final __objc_msgSend_8Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _class_NSMethodSignature1 = - _getClass1("NSMethodSignature"); - late final ffi.Pointer _sel_methodSignatureForSelector_1 = - _registerName1("methodSignatureForSelector:"); - ffi.Pointer _objc_msgSend_9( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_9( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_9Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = - _registerName1("instanceMethodSignatureForSelector:"); - late final ffi.Pointer _sel_allowsWeakReference1 = - _registerName1("allowsWeakReference"); - bool _objc_msgSend_10( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_10( - obj, - sel, - ) != - 0; - } - - late final __objc_msgSend_10Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_retainWeakReference1 = - _registerName1("retainWeakReference"); - late final ffi.Pointer _sel_isSubclassOfClass_1 = - _registerName1("isSubclassOfClass:"); - late final ffi.Pointer _sel_resolveClassMethod_1 = - _registerName1("resolveClassMethod:"); - late final ffi.Pointer _sel_resolveInstanceMethod_1 = - _registerName1("resolveInstanceMethod:"); - late final ffi.Pointer _sel_hash1 = _registerName1("hash"); - int _objc_msgSend_11( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_11( - obj, - sel, - ); - } - - late final __objc_msgSend_11Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_superclass1 = - _registerName1("superclass"); - late final ffi.Pointer _sel_class1 = _registerName1("class"); - late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); - late final ffi.Pointer _sel_stringWithCString_encoding_1 = - _registerName1("stringWithCString:encoding:"); - ffi.Pointer _objc_msgSend_12( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cString, - int enc, - ) { - return __objc_msgSend_12( - obj, - sel, - cString, - enc, - ); - } - - late final __objc_msgSend_12Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_UTF8String1 = - _registerName1("UTF8String"); - ffi.Pointer _objc_msgSend_13( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_13( - obj, - sel, - ); - } - - late final __objc_msgSend_13Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_description1 = - _registerName1("description"); - ffi.Pointer _objc_msgSend_14( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_14( - obj, - sel, - ); - } - - late final __objc_msgSend_14Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_debugDescription1 = - _registerName1("debugDescription"); - late final ffi.Pointer _sel_version1 = _registerName1("version"); - int _objc_msgSend_15( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_15( - obj, - sel, - ); - } - - late final __objc_msgSend_15Ptr = _lookup< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_setVersion_1 = - _registerName1("setVersion:"); - void _objc_msgSend_16( - ffi.Pointer obj, - ffi.Pointer sel, - int aVersion, - ) { - return __objc_msgSend_16( - obj, - sel, - aVersion, - ); - } - - late final __objc_msgSend_16Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_classForCoder1 = - _registerName1("classForCoder"); - late final ffi.Pointer _sel_replacementObjectForCoder_1 = - _registerName1("replacementObjectForCoder:"); - ffi.Pointer _objc_msgSend_17( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_17( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_17Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = - _registerName1("awakeAfterUsingCoder:"); - late final ffi.Pointer _sel_poseAsClass_1 = - _registerName1("poseAsClass:"); - late final ffi.Pointer _sel_autoContentAccessingProxy1 = - _registerName1("autoContentAccessingProxy"); - late final ffi.Pointer _class_Foo1 = _getClass1("Foo"); - late final ffi.Pointer _sel_someProperty1 = - _registerName1("someProperty"); - int _objc_msgSend_18( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_18( - obj, - sel, - ); - } - - late final __objc_msgSend_18Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_setSomeProperty_1 = - _registerName1("setSomeProperty:"); - void _objc_msgSend_19( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_19( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_19Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_readOnlyProperty1 = - _registerName1("readOnlyProperty"); - late final ffi.Pointer _sel_classReadOnlyProperty1 = - _registerName1("classReadOnlyProperty"); - late final ffi.Pointer _sel_classReadWriteProperty1 = - _registerName1("classReadWriteProperty"); - late final ffi.Pointer _sel_setClassReadWriteProperty_1 = - _registerName1("setClassReadWriteProperty:"); - late final ffi.Pointer _sel_aClassMethod_1 = - _registerName1("aClassMethod:"); - ffi.Pointer _objc_msgSend_20( - ffi.Pointer obj, - ffi.Pointer sel, - double someArg, - ) { - return __objc_msgSend_20( - obj, - sel, - someArg, - ); - } - - late final __objc_msgSend_20Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); - - late final ffi.Pointer _sel_anInstanceMethod_withOtherArg_1 = - _registerName1("anInstanceMethod:withOtherArg:"); - int _objc_msgSend_21( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer someArg, - ffi.Pointer otherArg, - ) { - return __objc_msgSend_21( - obj, - sel, - someArg, - otherArg, - ); - } - - late final __objc_msgSend_21Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -} - -class _ObjCWrapper { - final ffi.Pointer _id; - final NativeLibrary _lib; - - _ObjCWrapper._(this._id, this._lib); - - @override - bool operator ==(Object other) { - return other is _ObjCWrapper && _id == other._id; - } - - @override - int get hashCode => _id.hashCode; -} - -class NSObject extends _ObjCWrapper { - NSObject._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); - - static NSObject castFrom(T other) { - return NSObject._(other._id, other._lib); - } - - static NSObject castFromPointer( - NativeLibrary lib, ffi.Pointer other) { - return NSObject._(other, lib); - } - - static void load(NativeLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); - } - - static void initialize(NativeLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); - } - - NSObject init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSObject._(_ret, _lib); - } - - static NSObject new1(NativeLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); - return NSObject._(_ret, _lib); - } - - static NSObject allocWithZone_( - NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject alloc(NativeLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); - return NSObject._(_ret, _lib); - } - - void dealloc() { - _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); - } - - void finalize() { - _lib._objc_msgSend_0(_id, _lib._sel_finalize1); - } - - NSObject copy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); - return NSObject._(_ret, _lib); - } - - NSObject mutableCopy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); - return NSObject._(_ret, _lib); - } - - static NSObject copyWithZone_(NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject mutableCopyWithZone_( - NativeLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static bool instancesRespondToSelector_( - NativeLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_3(_lib._class_NSObject1, - _lib._sel_instancesRespondToSelector_1, aSelector); - } - - static bool conformsToProtocol_(NativeLibrary _lib, NSObject? protocol) { - return _lib._objc_msgSend_4(_lib._class_NSObject1, - _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); - } - - IMP methodForSelector_(ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); - } - - static IMP instanceMethodForSelector_( - NativeLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_lib._class_NSObject1, - _lib._sel_instanceMethodForSelector_1, aSelector); - } - - void doesNotRecognizeSelector_(ffi.Pointer aSelector) { - _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); - } - - NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_7( - _id, _lib._sel_forwardingTargetForSelector_1, aSelector); - return NSObject._(_ret, _lib); - } - - void forwardInvocation_(NSObject? anInvocation) { - _lib._objc_msgSend_8( - _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); - } - - NSMethodSignature methodSignatureForSelector_( - ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9( - _id, _lib._sel_methodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - static NSMethodSignature instanceMethodSignatureForSelector_( - NativeLibrary _lib, ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, - _lib._sel_instanceMethodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - bool allowsWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); - } - - bool retainWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); - } - - static bool isSubclassOfClass_(NativeLibrary _lib, NSObject aClass) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); - } - - static bool resolveClassMethod_( - NativeLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); - } - - static bool resolveInstanceMethod_( - NativeLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); - } - - static int hash(NativeLibrary _lib) { - return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); - } - - static NSObject superclass(NativeLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); - return NSObject._(_ret, _lib); - } - - static NSObject class1(NativeLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); - return NSObject._(_ret, _lib); - } - - static NSString description(NativeLibrary _lib) { - final _ret = - _lib._objc_msgSend_14(_lib._class_NSObject1, _lib._sel_description1); - return NSString._(_ret, _lib); - } - - static NSString debugDescription(NativeLibrary _lib) { - final _ret = _lib._objc_msgSend_14( - _lib._class_NSObject1, _lib._sel_debugDescription1); - return NSString._(_ret, _lib); - } - - static int version(NativeLibrary _lib) { - return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); - } - - static void setVersion_(NativeLibrary _lib, int aVersion) { - _lib._objc_msgSend_16( - _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); - } - - NSObject get classForCoder { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); - return NSObject._(_ret, _lib); - } - - NSObject replacementObjectForCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - NSObject awakeAfterUsingCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static void poseAsClass_(NativeLibrary _lib, NSObject aClass) { - _lib._objc_msgSend_8( - _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); - } - - NSObject get autoContentAccessingProxy { - final _ret = - _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); - return NSObject._(_ret, _lib); - } -} - -class ObjCSel extends ffi.Opaque {} - -class ObjCObject extends ffi.Opaque {} - -typedef instancetype = ffi.Pointer; - -class _NSZone extends ffi.Opaque {} - -typedef IMP = ffi.Pointer>; - -class NSMethodSignature extends _ObjCWrapper { - NSMethodSignature._(ffi.Pointer id, NativeLibrary lib) - : super._(id, lib); - - static NSMethodSignature castFrom(T other) { - return NSMethodSignature._(other._id, other._lib); - } - - static NSMethodSignature castFromPointer( - NativeLibrary lib, ffi.Pointer other) { - return NSMethodSignature._(other, lib); - } -} - -typedef NSUInteger = pkg_ffi.UnsignedLong; - -class NSString extends _ObjCWrapper { - NSString._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); - - static NSString castFrom(T other) { - return NSString._(other._id, other._lib); - } - - static NSString castFromPointer( - NativeLibrary lib, ffi.Pointer other) { - return NSString._(other, lib); - } - - factory NSString(NativeLibrary _lib, String str) { - final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); - pkg_ffi.calloc.free(cstr); - return nsstr; - } - - @override - String toString() => (UTF8String).cast().toDartString(); - - static NSString stringWithCString_encoding_( - NativeLibrary _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return NSString._(_ret, _lib); - } - - ffi.Pointer get UTF8String { - return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); - } -} - -extension StringToNSString on String { - NSString toNSString(NativeLibrary lib) => NSString(lib, this); -} - -typedef NSInteger = pkg_ffi.Long; - -class Foo extends NSObject { - Foo._(ffi.Pointer id, NativeLibrary lib) : super._(id, lib); - - static Foo castFrom(T other) { - return Foo._(other._id, other._lib); - } - - static Foo castFromPointer(NativeLibrary lib, ffi.Pointer other) { - return Foo._(other, lib); - } - - int get someProperty { - return _lib._objc_msgSend_18(_id, _lib._sel_someProperty1); - } - - set someProperty(int value) { - _lib._objc_msgSend_19(_id, _lib._sel_setSomeProperty_1, value); - } - - int get readOnlyProperty { - return _lib._objc_msgSend_18(_id, _lib._sel_readOnlyProperty1); - } - - static int getClassReadOnlyProperty(NativeLibrary _lib) { - return _lib._objc_msgSend_18( - _lib._class_Foo1, _lib._sel_classReadOnlyProperty1); - } - - static int getClassReadWriteProperty(NativeLibrary _lib) { - return _lib._objc_msgSend_18( - _lib._class_Foo1, _lib._sel_classReadWriteProperty1); - } - - static void setClassReadWriteProperty(NativeLibrary _lib, int value) { - _lib._objc_msgSend_19( - _lib._class_Foo1, _lib._sel_setClassReadWriteProperty_1, value); - } - - static Foo aClassMethod_(NativeLibrary _lib, double someArg) { - final _ret = _lib._objc_msgSend_20( - _lib._class_Foo1, _lib._sel_aClassMethod_1, someArg); - return Foo._(_ret, _lib); - } - - int anInstanceMethod_withOtherArg_(NSObject? someArg, NSObject? otherArg) { - return _lib._objc_msgSend_21(_id, _lib._sel_anInstanceMethod_withOtherArg_1, - someArg?._id ?? ffi.nullptr, otherArg?._id ?? ffi.nullptr); - } - - static Foo new1(NativeLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_new1); - return Foo._(_ret, _lib); - } - - static Foo alloc(NativeLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_alloc1); - return Foo._(_ret, _lib); - } -} diff --git a/pkgs/ffigen/test/header_parser_tests/objc_basic_types.h b/pkgs/ffigen/test/header_parser_tests/objc_basic_types.h deleted file mode 100644 index 34b45503cb..0000000000 --- a/pkgs/ffigen/test/header_parser_tests/objc_basic_types.h +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -#import - -struct Foo { - BOOL someBool; - id anId; - SEL selector; - NSObject* object; - Class clazz; - int32_t (^blockThatReturnsAnInt)(void); -}; diff --git a/pkgs/ffigen/test/header_parser_tests/objc_basic_types_test.dart b/pkgs/ffigen/test/header_parser_tests/objc_basic_types_test.dart deleted file mode 100644 index ce5e76cd05..0000000000 --- a/pkgs/ffigen/test/header_parser_tests/objc_basic_types_test.dart +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -// Objective C support is only available on mac. -@TestOn('mac-os') - -import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider.dart'; -import 'package:ffigen/src/header_parser.dart' as parser; -import 'package:ffigen/src/strings.dart' as strings; -import 'package:logging/logging.dart'; -import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; - -import '../test_utils.dart'; - -late Library actual; -void main() { - group('objc_basic_types_test', () { - setUpAll(() { - logWarnings(Level.SEVERE); - actual = parser.parse( - Config.fromYaml(yaml.loadYaml(''' -${strings.name}: 'NativeLibrary' -${strings.description}: 'ObjC Basic Types Test' -${strings.output}: 'unused' -${strings.language}: '${strings.langObjC}' -${strings.headers}: - ${strings.entryPoints}: - - 'test/header_parser_tests/objc_basic_types.h' -${strings.structs}: - ${strings.include}: - - 'Foo' -${strings.functions}: - ${strings.exclude}: - - '.*' -${strings.unions}: - ${strings.exclude}: - - '.*' -${strings.enums}: - ${strings.exclude}: - - '.*' -${strings.unnamedEnums}: - ${strings.exclude}: - - '.*' -${strings.macros}: - ${strings.exclude}: - - '.*' -${strings.globals}: - ${strings.exclude}: - - '.*' - ''') as yaml.YamlMap), - ); - }); - test('Expected bindings', () { - matchLibraryWithExpected(actual, [ - 'test', - 'debug_generated', - 'header_parser_objc_basic_types_test_output.dart' - ], [ - 'test', - 'header_parser_tests', - 'expected_bindings', - '_expected_objc_basic_types_bindings.dart' - ]); - }); - }); -} diff --git a/pkgs/ffigen/test/header_parser_tests/objc_config_test.dart b/pkgs/ffigen/test/header_parser_tests/objc_config_test.dart deleted file mode 100644 index 94a7001ee4..0000000000 --- a/pkgs/ffigen/test/header_parser_tests/objc_config_test.dart +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -// Objective C support is only available on mac. -@TestOn('mac-os') - -import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider.dart'; -import 'package:ffigen/src/header_parser.dart' as parser; -import 'package:ffigen/src/strings.dart' as strings; -import 'package:logging/logging.dart'; -import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; - -import '../test_utils.dart'; - -late Library actual; -void main() { - group('objc_config_test', () { - setUpAll(() { - logWarnings(Level.SEVERE); - actual = parser.parse( - Config.fromYaml(yaml.loadYaml(''' -${strings.name}: 'NativeLibrary' -${strings.description}: 'ObjC Config Test' -${strings.output}: 'unused' -${strings.language}: '${strings.langObjC}' -${strings.headers}: - ${strings.entryPoints}: - - 'test/header_parser_tests/objc_config.h' -${strings.objcInterfaces}: - ${strings.include}: - - 'Foo' - ${strings.exclude}: - - 'Excluded' - ${strings.rename}: - '_(.*)': '\$1' -${strings.functions}: - ${strings.exclude}: - - '.*' -${strings.structs}: - ${strings.exclude}: - - '.*' -${strings.unions}: - ${strings.exclude}: - - '.*' -${strings.enums}: - ${strings.exclude}: - - '.*' -${strings.unnamedEnums}: - ${strings.exclude}: - - '.*' -${strings.macros}: - ${strings.exclude}: - - '.*' -${strings.globals}: - ${strings.exclude}: - - '.*' -''') as yaml.YamlMap), - ); - }); - test('Expected bindings', () { - matchLibraryWithExpected(actual, [ - 'test', - 'debug_generated', - 'header_parser_objc_config_test_output.dart' - ], [ - 'test', - 'header_parser_tests', - 'expected_bindings', - '_expected_objc_config_bindings.dart' - ]); - }); - }); -} diff --git a/pkgs/ffigen/test/header_parser_tests/objc_interface.h b/pkgs/ffigen/test/header_parser_tests/objc_interface.h deleted file mode 100644 index d1b60077d3..0000000000 --- a/pkgs/ffigen/test/header_parser_tests/objc_interface.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -#import - -// This is the Foo interface. -@interface Foo : NSObject { - // This is an instance variable. They are private, so are ignored. - double instVar; -} - -// This is a property. We generate getters and setters for them. -@property int32_t someProperty; - -// This should only generate a getter. -@property (readonly) int32_t readOnlyProperty; - -// This should only generate a getter static function. -@property (class, readonly) int32_t classReadOnlyProperty; - -// This should generate getter and setter static functions. -@property (class) int32_t classReadWriteProperty; - -// This is a class method, so becomes a static function. -+ (Foo*)aClassMethod:(double)someArg; - -// This is an instance method, so becomes a regular method. -- (int32_t)anInstanceMethod:(NSString*)someArg withOtherArg:(Foo*)otherArg; - -@end diff --git a/pkgs/ffigen/test/header_parser_tests/objc_interface_test.dart b/pkgs/ffigen/test/header_parser_tests/objc_interface_test.dart deleted file mode 100644 index 5a533852cb..0000000000 --- a/pkgs/ffigen/test/header_parser_tests/objc_interface_test.dart +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -// Objective C support is only available on mac. -@TestOn('mac-os') - -import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider.dart'; -import 'package:ffigen/src/header_parser.dart' as parser; -import 'package:ffigen/src/strings.dart' as strings; -import 'package:logging/logging.dart'; -import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; - -import '../test_utils.dart'; - -late Library actual; -void main() { - group('objc_interface_test', () { - setUpAll(() { - logWarnings(Level.SEVERE); - actual = parser.parse( - Config.fromYaml(yaml.loadYaml(''' -${strings.name}: 'NativeLibrary' -${strings.description}: 'ObjC Interface Test' -${strings.output}: 'unused' -${strings.language}: '${strings.langObjC}' -${strings.headers}: - ${strings.entryPoints}: - - 'test/header_parser_tests/objc_interface.h' -${strings.objcInterfaces}: - ${strings.include}: - - 'Foo' -${strings.functions}: - ${strings.exclude}: - - '.*' -${strings.structs}: - ${strings.exclude}: - - '.*' -${strings.unions}: - ${strings.exclude}: - - '.*' -${strings.enums}: - ${strings.exclude}: - - '.*' -${strings.unnamedEnums}: - ${strings.exclude}: - - '.*' -${strings.macros}: - ${strings.exclude}: - - '.*' -${strings.globals}: - ${strings.exclude}: - - '.*' -''') as yaml.YamlMap), - ); - }); - test('Expected bindings', () { - matchLibraryWithExpected(actual, [ - 'test', - 'debug_generated', - 'header_parser_objc_interface_test_output.dart' - ], [ - 'test', - 'header_parser_tests', - 'expected_bindings', - '_expected_objc_interface_bindings.dart' - ]); - }); - }); -} diff --git a/pkgs/ffigen/test/native_objc_test/.gitignore b/pkgs/ffigen/test/native_objc_test/.gitignore new file mode 100644 index 0000000000..62dd4b54c3 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/.gitignore @@ -0,0 +1 @@ +*_bindings.dart diff --git a/pkgs/ffigen/test/native_objc_test/block_bindings.dart b/pkgs/ffigen/test/native_objc_test/block_bindings.dart deleted file mode 100644 index b19e4a964b..0000000000 --- a/pkgs/ffigen/test/native_objc_test/block_bindings.dart +++ /dev/null @@ -1,1520 +0,0 @@ -// ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field - -// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; - -/// Tests calling Objective-C blocks -class BlockTestObjCLibrary { - /// Holds the symbol lookup function. - final ffi.Pointer Function(String symbolName) - _lookup; - - /// The symbols are looked up in [dynamicLibrary]. - BlockTestObjCLibrary(ffi.DynamicLibrary dynamicLibrary) - : _lookup = dynamicLibrary.lookup; - - /// The symbols are looked up with [lookup]. - BlockTestObjCLibrary.fromLookup( - ffi.Pointer Function(String symbolName) - lookup) - : _lookup = lookup; - - late final ffi.Pointer _NSFoundationVersionNumber = - _lookup('NSFoundationVersionNumber'); - - double get NSFoundationVersionNumber => _NSFoundationVersionNumber.value; - - set NSFoundationVersionNumber(double value) => - _NSFoundationVersionNumber.value = value; - - late final ffi.Pointer _NSNotFound = - _lookup('NSNotFound'); - - int get NSNotFound => _NSNotFound.value; - - set NSNotFound(int value) => _NSNotFound.value = value; - - late final ffi.Pointer _kCFCoreFoundationVersionNumber = - _lookup('kCFCoreFoundationVersionNumber'); - - double get kCFCoreFoundationVersionNumber => - _kCFCoreFoundationVersionNumber.value; - - set kCFCoreFoundationVersionNumber(double value) => - _kCFCoreFoundationVersionNumber.value = value; - - late final ffi.Pointer _kCFNotFound = - _lookup('kCFNotFound'); - - int get kCFNotFound => _kCFNotFound.value; - - set kCFNotFound(int value) => _kCFNotFound.value = value; - - late final ffi.Pointer _kCFNull = _lookup('kCFNull'); - - CFNullRef get kCFNull => _kCFNull.value; - - set kCFNull(CFNullRef value) => _kCFNull.value = value; - - late final ffi.Pointer _kCFAllocatorDefault = - _lookup('kCFAllocatorDefault'); - - CFAllocatorRef get kCFAllocatorDefault => _kCFAllocatorDefault.value; - - set kCFAllocatorDefault(CFAllocatorRef value) => - _kCFAllocatorDefault.value = value; - - late final ffi.Pointer _kCFAllocatorSystemDefault = - _lookup('kCFAllocatorSystemDefault'); - - CFAllocatorRef get kCFAllocatorSystemDefault => - _kCFAllocatorSystemDefault.value; - - set kCFAllocatorSystemDefault(CFAllocatorRef value) => - _kCFAllocatorSystemDefault.value = value; - - late final ffi.Pointer _kCFAllocatorMalloc = - _lookup('kCFAllocatorMalloc'); - - CFAllocatorRef get kCFAllocatorMalloc => _kCFAllocatorMalloc.value; - - set kCFAllocatorMalloc(CFAllocatorRef value) => - _kCFAllocatorMalloc.value = value; - - late final ffi.Pointer _kCFAllocatorMallocZone = - _lookup('kCFAllocatorMallocZone'); - - CFAllocatorRef get kCFAllocatorMallocZone => _kCFAllocatorMallocZone.value; - - set kCFAllocatorMallocZone(CFAllocatorRef value) => - _kCFAllocatorMallocZone.value = value; - - late final ffi.Pointer _kCFAllocatorNull = - _lookup('kCFAllocatorNull'); - - CFAllocatorRef get kCFAllocatorNull => _kCFAllocatorNull.value; - - set kCFAllocatorNull(CFAllocatorRef value) => _kCFAllocatorNull.value = value; - - late final ffi.Pointer _kCFAllocatorUseContext = - _lookup('kCFAllocatorUseContext'); - - CFAllocatorRef get kCFAllocatorUseContext => _kCFAllocatorUseContext.value; - - set kCFAllocatorUseContext(CFAllocatorRef value) => - _kCFAllocatorUseContext.value = value; - - ffi.Pointer _registerName1(String name) { - final cstr = name.toNativeUtf8(); - final sel = _sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; - } - - ffi.Pointer _sel_registerName( - ffi.Pointer str, - ) { - return __sel_registerName( - str, - ); - } - - late final __sel_registerNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sel_registerName'); - late final __sel_registerName = __sel_registerNamePtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _getClass1(String name) { - final cstr = name.toNativeUtf8(); - final clazz = _objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return clazz; - } - - ffi.Pointer _objc_getClass( - ffi.Pointer str, - ) { - return __objc_getClass( - str, - ); - } - - late final __objc_getClassPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('objc_getClass'); - late final __objc_getClass = __objc_getClassPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); - late final ffi.Pointer _sel_load1 = _registerName1("load"); - void _objc_msgSend_0( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_0( - obj, - sel, - ); - } - - late final __objc_msgSend_0Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_initialize1 = - _registerName1("initialize"); - late final ffi.Pointer _sel_init1 = _registerName1("init"); - instancetype _objc_msgSend_1( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1( - obj, - sel, - ); - } - - late final __objc_msgSend_1Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_new1 = _registerName1("new"); - late final ffi.Pointer _sel_allocWithZone_1 = - _registerName1("allocWithZone:"); - instancetype _objc_msgSend_2( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_2( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_2Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>(); - - late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); - late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); - late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); - late final ffi.Pointer _sel_copy1 = _registerName1("copy"); - late final ffi.Pointer _sel_mutableCopy1 = - _registerName1("mutableCopy"); - late final ffi.Pointer _sel_copyWithZone_1 = - _registerName1("copyWithZone:"); - late final ffi.Pointer _sel_mutableCopyWithZone_1 = - _registerName1("mutableCopyWithZone:"); - late final ffi.Pointer _sel_instancesRespondToSelector_1 = - _registerName1("instancesRespondToSelector:"); - bool _objc_msgSend_3( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_3( - obj, - sel, - aSelector, - ) != - 0; - } - - late final __objc_msgSend_3Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_conformsToProtocol_1 = - _registerName1("conformsToProtocol:"); - bool _objc_msgSend_4( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer protocol, - ) { - return __objc_msgSend_4( - obj, - sel, - protocol, - ) != - 0; - } - - late final __objc_msgSend_4Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_methodForSelector_1 = - _registerName1("methodForSelector:"); - IMP _objc_msgSend_5( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_5( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_5Ptr = _lookup< - ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodForSelector_1 = - _registerName1("instanceMethodForSelector:"); - late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = - _registerName1("doesNotRecognizeSelector:"); - void _objc_msgSend_6( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_6( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_6Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardingTargetForSelector_1 = - _registerName1("forwardingTargetForSelector:"); - ffi.Pointer _objc_msgSend_7( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_7( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_7Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardInvocation_1 = - _registerName1("forwardInvocation:"); - void _objc_msgSend_8( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anInvocation, - ) { - return __objc_msgSend_8( - obj, - sel, - anInvocation, - ); - } - - late final __objc_msgSend_8Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _class_NSMethodSignature1 = - _getClass1("NSMethodSignature"); - late final ffi.Pointer _sel_methodSignatureForSelector_1 = - _registerName1("methodSignatureForSelector:"); - ffi.Pointer _objc_msgSend_9( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_9( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_9Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = - _registerName1("instanceMethodSignatureForSelector:"); - late final ffi.Pointer _sel_allowsWeakReference1 = - _registerName1("allowsWeakReference"); - bool _objc_msgSend_10( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_10( - obj, - sel, - ) != - 0; - } - - late final __objc_msgSend_10Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_retainWeakReference1 = - _registerName1("retainWeakReference"); - late final ffi.Pointer _sel_isSubclassOfClass_1 = - _registerName1("isSubclassOfClass:"); - late final ffi.Pointer _sel_resolveClassMethod_1 = - _registerName1("resolveClassMethod:"); - late final ffi.Pointer _sel_resolveInstanceMethod_1 = - _registerName1("resolveInstanceMethod:"); - late final ffi.Pointer _sel_hash1 = _registerName1("hash"); - int _objc_msgSend_11( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_11( - obj, - sel, - ); - } - - late final __objc_msgSend_11Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_superclass1 = - _registerName1("superclass"); - late final ffi.Pointer _sel_class1 = _registerName1("class"); - late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); - late final ffi.Pointer _sel_stringWithCString_encoding_1 = - _registerName1("stringWithCString:encoding:"); - ffi.Pointer _objc_msgSend_12( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cString, - int enc, - ) { - return __objc_msgSend_12( - obj, - sel, - cString, - enc, - ); - } - - late final __objc_msgSend_12Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_UTF8String1 = - _registerName1("UTF8String"); - ffi.Pointer _objc_msgSend_13( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_13( - obj, - sel, - ); - } - - late final __objc_msgSend_13Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_description1 = - _registerName1("description"); - ffi.Pointer _objc_msgSend_14( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_14( - obj, - sel, - ); - } - - late final __objc_msgSend_14Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_debugDescription1 = - _registerName1("debugDescription"); - late final ffi.Pointer _sel_version1 = _registerName1("version"); - int _objc_msgSend_15( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_15( - obj, - sel, - ); - } - - late final __objc_msgSend_15Ptr = _lookup< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_setVersion_1 = - _registerName1("setVersion:"); - void _objc_msgSend_16( - ffi.Pointer obj, - ffi.Pointer sel, - int aVersion, - ) { - return __objc_msgSend_16( - obj, - sel, - aVersion, - ); - } - - late final __objc_msgSend_16Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_classForCoder1 = - _registerName1("classForCoder"); - late final ffi.Pointer _sel_replacementObjectForCoder_1 = - _registerName1("replacementObjectForCoder:"); - ffi.Pointer _objc_msgSend_17( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_17( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_17Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = - _registerName1("awakeAfterUsingCoder:"); - late final ffi.Pointer _sel_poseAsClass_1 = - _registerName1("poseAsClass:"); - late final ffi.Pointer _sel_autoContentAccessingProxy1 = - _registerName1("autoContentAccessingProxy"); - late final ffi.Pointer _class_BlockTester1 = - _getClass1("BlockTester"); - ffi.Pointer<_ObjCBlockDesc> _newBlockDesc1() { - final d = - pkg_ffi.calloc.allocate<_ObjCBlockDesc>(ffi.sizeOf<_ObjCBlockDesc>()); - d.ref.size = ffi.sizeOf<_ObjCBlock>(); - return d; - } - - late final ffi.Pointer<_ObjCBlockDesc> _objc_block_desc1 = _newBlockDesc1(); - ffi.Pointer<_ObjCBlock> _newBlock1( - ffi.Pointer invoke, ffi.Pointer target) { - final b = pkg_ffi.calloc.allocate<_ObjCBlock>(ffi.sizeOf<_ObjCBlock>()); - b.ref.invoke = invoke; - b.ref.target = target; - b.ref.descriptor = _objc_block_desc1; - return b; - } - - late final ffi.Pointer _sel_makeFromBlock_1 = - _registerName1("makeFromBlock:"); - ffi.Pointer _objc_msgSend_18( - ffi.Pointer obj, - ffi.Pointer sel, - IntBlock block, - ) { - return __objc_msgSend_18( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_18Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, IntBlock)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, IntBlock)>(); - - late final ffi.Pointer _sel_makeFromMultiplier_1 = - _registerName1("makeFromMultiplier:"); - ffi.Pointer _objc_msgSend_19( - ffi.Pointer obj, - ffi.Pointer sel, - int mult, - ) { - return __objc_msgSend_19( - obj, - sel, - mult, - ); - } - - late final __objc_msgSend_19Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_call_1 = _registerName1("call:"); - int _objc_msgSend_20( - ffi.Pointer obj, - ffi.Pointer sel, - int x, - ) { - return __objc_msgSend_20( - obj, - sel, - x, - ); - } - - late final __objc_msgSend_20Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_getBlock1 = _registerName1("getBlock"); - IntBlock _objc_msgSend_21( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_21( - obj, - sel, - ); - } - - late final __objc_msgSend_21Ptr = _lookup< - ffi.NativeFunction< - IntBlock Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< - IntBlock Function(ffi.Pointer, ffi.Pointer)>(); -} - -abstract class NSComparisonResult { - static const int NSOrderedAscending = -1; - static const int NSOrderedSame = 0; - static const int NSOrderedDescending = 1; -} - -abstract class NSEnumerationOptions { - static const int NSEnumerationConcurrent = 1; - static const int NSEnumerationReverse = 2; -} - -abstract class NSSortOptions { - static const int NSSortConcurrent = 1; - static const int NSSortStable = 16; -} - -abstract class NSQualityOfService { - static const int NSQualityOfServiceUserInteractive = 33; - static const int NSQualityOfServiceUserInitiated = 25; - static const int NSQualityOfServiceUtility = 17; - static const int NSQualityOfServiceBackground = 9; - static const int NSQualityOfServiceDefault = -1; -} - -typedef NSInteger = pkg_ffi.Long; - -class __CFString extends ffi.Opaque {} - -abstract class CFComparisonResult { - static const int kCFCompareLessThan = -1; - static const int kCFCompareEqualTo = 0; - static const int kCFCompareGreaterThan = 1; -} - -typedef CFIndex = pkg_ffi.Long; - -class CFRange extends ffi.Struct { - @CFIndex() - external int location; - - @CFIndex() - external int length; -} - -class __CFNull extends ffi.Opaque {} - -typedef CFNullRef = ffi.Pointer<__CFNull>; - -class __CFAllocator extends ffi.Opaque {} - -typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; - -class CFAllocatorContext extends ffi.Struct { - @CFIndex() - external int version; - - external ffi.Pointer info; - - external CFAllocatorRetainCallBack retain; - - external CFAllocatorReleaseCallBack release; - - external CFAllocatorCopyDescriptionCallBack copyDescription; - - external CFAllocatorAllocateCallBack allocate; - - external CFAllocatorReallocateCallBack reallocate; - - external CFAllocatorDeallocateCallBack deallocate; - - external CFAllocatorPreferredSizeCallBack preferredSize; -} - -typedef CFAllocatorRetainCallBack = ffi.Pointer< - ffi.NativeFunction Function(ffi.Pointer)>>; -typedef CFAllocatorReleaseCallBack - = ffi.Pointer)>>; -typedef CFAllocatorCopyDescriptionCallBack = ffi - .Pointer)>>; -typedef CFStringRef = ffi.Pointer<__CFString>; -typedef CFAllocatorAllocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - CFIndex, CFOptionFlags, ffi.Pointer)>>; -typedef CFOptionFlags = pkg_ffi.UnsignedLong; -typedef CFAllocatorReallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, CFIndex, - CFOptionFlags, ffi.Pointer)>>; -typedef CFAllocatorDeallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; -typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< - ffi.NativeFunction< - CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; - -class _ObjCWrapper { - final ffi.Pointer _id; - final BlockTestObjCLibrary _lib; - - _ObjCWrapper._(this._id, this._lib); - - @override - bool operator ==(Object other) { - return other is _ObjCWrapper && _id == other._id; - } - - @override - int get hashCode => _id.hashCode; -} - -class NSObject extends _ObjCWrapper { - NSObject._(ffi.Pointer id, BlockTestObjCLibrary lib) - : super._(id, lib); - - static NSObject castFrom(T other) { - return NSObject._(other._id, other._lib); - } - - static NSObject castFromPointer( - BlockTestObjCLibrary lib, ffi.Pointer other) { - return NSObject._(other, lib); - } - - static void load(BlockTestObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); - } - - static void initialize(BlockTestObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); - } - - NSObject init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSObject._(_ret, _lib); - } - - static NSObject new1(BlockTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); - return NSObject._(_ret, _lib); - } - - static NSObject allocWithZone_( - BlockTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject alloc(BlockTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); - return NSObject._(_ret, _lib); - } - - void dealloc() { - _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); - } - - void finalize() { - _lib._objc_msgSend_0(_id, _lib._sel_finalize1); - } - - NSObject copy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); - return NSObject._(_ret, _lib); - } - - NSObject mutableCopy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); - return NSObject._(_ret, _lib); - } - - static NSObject copyWithZone_( - BlockTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject mutableCopyWithZone_( - BlockTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static bool instancesRespondToSelector_( - BlockTestObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_3(_lib._class_NSObject1, - _lib._sel_instancesRespondToSelector_1, aSelector); - } - - static bool conformsToProtocol_( - BlockTestObjCLibrary _lib, NSObject? protocol) { - return _lib._objc_msgSend_4(_lib._class_NSObject1, - _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); - } - - IMP methodForSelector_(ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); - } - - static IMP instanceMethodForSelector_( - BlockTestObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_lib._class_NSObject1, - _lib._sel_instanceMethodForSelector_1, aSelector); - } - - void doesNotRecognizeSelector_(ffi.Pointer aSelector) { - _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); - } - - NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_7( - _id, _lib._sel_forwardingTargetForSelector_1, aSelector); - return NSObject._(_ret, _lib); - } - - void forwardInvocation_(NSObject? anInvocation) { - _lib._objc_msgSend_8( - _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); - } - - NSMethodSignature methodSignatureForSelector_( - ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9( - _id, _lib._sel_methodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - static NSMethodSignature instanceMethodSignatureForSelector_( - BlockTestObjCLibrary _lib, ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, - _lib._sel_instanceMethodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - bool allowsWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); - } - - bool retainWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); - } - - static bool isSubclassOfClass_(BlockTestObjCLibrary _lib, NSObject aClass) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); - } - - static bool resolveClassMethod_( - BlockTestObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); - } - - static bool resolveInstanceMethod_( - BlockTestObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); - } - - static int hash(BlockTestObjCLibrary _lib) { - return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); - } - - static NSObject superclass(BlockTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); - return NSObject._(_ret, _lib); - } - - static NSObject class1(BlockTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); - return NSObject._(_ret, _lib); - } - - static NSString description(BlockTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_14(_lib._class_NSObject1, _lib._sel_description1); - return NSString._(_ret, _lib); - } - - static NSString debugDescription(BlockTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_14( - _lib._class_NSObject1, _lib._sel_debugDescription1); - return NSString._(_ret, _lib); - } - - static int version(BlockTestObjCLibrary _lib) { - return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); - } - - static void setVersion_(BlockTestObjCLibrary _lib, int aVersion) { - _lib._objc_msgSend_16( - _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); - } - - NSObject get classForCoder { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); - return NSObject._(_ret, _lib); - } - - NSObject replacementObjectForCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - NSObject awakeAfterUsingCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static void poseAsClass_(BlockTestObjCLibrary _lib, NSObject aClass) { - _lib._objc_msgSend_8( - _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); - } - - NSObject get autoContentAccessingProxy { - final _ret = - _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); - return NSObject._(_ret, _lib); - } -} - -class ObjCSel extends ffi.Opaque {} - -class ObjCObject extends ffi.Opaque {} - -typedef instancetype = ffi.Pointer; - -class _NSZone extends ffi.Opaque {} - -typedef IMP = ffi.Pointer>; - -class NSMethodSignature extends _ObjCWrapper { - NSMethodSignature._(ffi.Pointer id, BlockTestObjCLibrary lib) - : super._(id, lib); - - static NSMethodSignature castFrom(T other) { - return NSMethodSignature._(other._id, other._lib); - } - - static NSMethodSignature castFromPointer( - BlockTestObjCLibrary lib, ffi.Pointer other) { - return NSMethodSignature._(other, lib); - } -} - -typedef NSUInteger = pkg_ffi.UnsignedLong; - -class NSString extends _ObjCWrapper { - NSString._(ffi.Pointer id, BlockTestObjCLibrary lib) - : super._(id, lib); - - static NSString castFrom(T other) { - return NSString._(other._id, other._lib); - } - - static NSString castFromPointer( - BlockTestObjCLibrary lib, ffi.Pointer other) { - return NSString._(other, lib); - } - - factory NSString(BlockTestObjCLibrary _lib, String str) { - final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); - pkg_ffi.calloc.free(cstr); - return nsstr; - } - - @override - String toString() => (UTF8String).cast().toDartString(); - - static NSString stringWithCString_encoding_( - BlockTestObjCLibrary _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return NSString._(_ret, _lib); - } - - ffi.Pointer get UTF8String { - return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); - } -} - -extension StringToNSString on String { - NSString toNSString(BlockTestObjCLibrary lib) => NSString(lib, this); -} - -class BlockTester extends NSObject { - BlockTester._(ffi.Pointer id, BlockTestObjCLibrary lib) - : super._(id, lib); - - static BlockTester castFrom(T other) { - return BlockTester._(other._id, other._lib); - } - - static BlockTester castFromPointer( - BlockTestObjCLibrary lib, ffi.Pointer other) { - return BlockTester._(other, lib); - } - - static BlockTester makeFromBlock_(BlockTestObjCLibrary _lib, IntBlock block) { - final _ret = _lib._objc_msgSend_18( - _lib._class_BlockTester1, _lib._sel_makeFromBlock_1, block); - return BlockTester._(_ret, _lib); - } - - static BlockTester makeFromMultiplier_(BlockTestObjCLibrary _lib, int mult) { - final _ret = _lib._objc_msgSend_19( - _lib._class_BlockTester1, _lib._sel_makeFromMultiplier_1, mult); - return BlockTester._(_ret, _lib); - } - - int call_(int x) { - return _lib._objc_msgSend_20(_id, _lib._sel_call_1, x); - } - - IntBlock getBlock() { - return _lib._objc_msgSend_21(_id, _lib._sel_getBlock1); - } - - static BlockTester new1(BlockTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_BlockTester1, _lib._sel_new1); - return BlockTester._(_ret, _lib); - } - - static BlockTester alloc(BlockTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_BlockTester1, _lib._sel_alloc1); - return BlockTester._(_ret, _lib); - } -} - -typedef IntBlock = ffi.Pointer<_ObjCBlock>; -int _ObjCBlock_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, int arg0) { - return block.ref.target - .cast>() - .asFunction()(arg0); -} - -class ObjCBlock { - final ffi.Pointer<_ObjCBlock> _impl; - final BlockTestObjCLibrary _lib; - ObjCBlock._(this._impl, this._lib); - - ObjCBlock.fromFunctionPointer(this._lib, - ffi.Pointer> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Int32 Function(ffi.Pointer<_ObjCBlock> block, - ffi.Int32 arg0)>(_ObjCBlock_fnPtrTrampoline, 0) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -class _ObjCBlockDesc extends ffi.Struct { - @pkg_ffi.UnsignedLong() - external int reserved; - - @pkg_ffi.UnsignedLong() - external int size; - - external ffi.Pointer copy_helper; - - external ffi.Pointer dispose_helper; - - external ffi.Pointer signature; -} - -class _ObjCBlock extends ffi.Struct { - external ffi.Pointer isa; - - @pkg_ffi.Int() - external int flags; - - @pkg_ffi.Int() - external int reserved; - - external ffi.Pointer invoke; - - external ffi.Pointer<_ObjCBlockDesc> descriptor; - - external ffi.Pointer target; -} - -const int NSScannedOption = 1; - -const int NSCollectorDisabledOption = 2; - -const int NS_BLOCKS_AVAILABLE = 1; - -const int __COREFOUNDATION_CFAVAILABILITY__ = 1; - -const int __CF_ENUM_FIXED_IS_AVAILABLE = 1; - -const double NSFoundationVersionNumber10_0 = 397.4; - -const double NSFoundationVersionNumber10_1 = 425.0; - -const double NSFoundationVersionNumber10_1_1 = 425.0; - -const double NSFoundationVersionNumber10_1_2 = 425.0; - -const double NSFoundationVersionNumber10_1_3 = 425.0; - -const double NSFoundationVersionNumber10_1_4 = 425.0; - -const double NSFoundationVersionNumber10_2 = 462.0; - -const double NSFoundationVersionNumber10_2_1 = 462.0; - -const double NSFoundationVersionNumber10_2_2 = 462.0; - -const double NSFoundationVersionNumber10_2_3 = 462.0; - -const double NSFoundationVersionNumber10_2_4 = 462.0; - -const double NSFoundationVersionNumber10_2_5 = 462.0; - -const double NSFoundationVersionNumber10_2_6 = 462.0; - -const double NSFoundationVersionNumber10_2_7 = 462.7; - -const double NSFoundationVersionNumber10_2_8 = 462.7; - -const double NSFoundationVersionNumber10_3 = 500.0; - -const double NSFoundationVersionNumber10_3_1 = 500.0; - -const double NSFoundationVersionNumber10_3_2 = 500.3; - -const double NSFoundationVersionNumber10_3_3 = 500.54; - -const double NSFoundationVersionNumber10_3_4 = 500.56; - -const double NSFoundationVersionNumber10_3_5 = 500.56; - -const double NSFoundationVersionNumber10_3_6 = 500.56; - -const double NSFoundationVersionNumber10_3_7 = 500.56; - -const double NSFoundationVersionNumber10_3_8 = 500.56; - -const double NSFoundationVersionNumber10_3_9 = 500.58; - -const double NSFoundationVersionNumber10_4 = 567.0; - -const double NSFoundationVersionNumber10_4_1 = 567.0; - -const double NSFoundationVersionNumber10_4_2 = 567.12; - -const double NSFoundationVersionNumber10_4_3 = 567.21; - -const double NSFoundationVersionNumber10_4_4_Intel = 567.23; - -const double NSFoundationVersionNumber10_4_4_PowerPC = 567.21; - -const double NSFoundationVersionNumber10_4_5 = 567.25; - -const double NSFoundationVersionNumber10_4_6 = 567.26; - -const double NSFoundationVersionNumber10_4_7 = 567.27; - -const double NSFoundationVersionNumber10_4_8 = 567.28; - -const double NSFoundationVersionNumber10_4_9 = 567.29; - -const double NSFoundationVersionNumber10_4_10 = 567.29; - -const double NSFoundationVersionNumber10_4_11 = 567.36; - -const double NSFoundationVersionNumber10_5 = 677.0; - -const double NSFoundationVersionNumber10_5_1 = 677.1; - -const double NSFoundationVersionNumber10_5_2 = 677.15; - -const double NSFoundationVersionNumber10_5_3 = 677.19; - -const double NSFoundationVersionNumber10_5_4 = 677.19; - -const double NSFoundationVersionNumber10_5_5 = 677.21; - -const double NSFoundationVersionNumber10_5_6 = 677.22; - -const double NSFoundationVersionNumber10_5_7 = 677.24; - -const double NSFoundationVersionNumber10_5_8 = 677.26; - -const double NSFoundationVersionNumber10_6 = 751.0; - -const double NSFoundationVersionNumber10_6_1 = 751.0; - -const double NSFoundationVersionNumber10_6_2 = 751.14; - -const double NSFoundationVersionNumber10_6_3 = 751.21; - -const double NSFoundationVersionNumber10_6_4 = 751.29; - -const double NSFoundationVersionNumber10_6_5 = 751.42; - -const double NSFoundationVersionNumber10_6_6 = 751.53; - -const double NSFoundationVersionNumber10_6_7 = 751.53; - -const double NSFoundationVersionNumber10_6_8 = 751.62; - -const double NSFoundationVersionNumber10_7 = 833.1; - -const double NSFoundationVersionNumber10_7_1 = 833.1; - -const double NSFoundationVersionNumber10_7_2 = 833.2; - -const double NSFoundationVersionNumber10_7_3 = 833.24; - -const double NSFoundationVersionNumber10_7_4 = 833.25; - -const double NSFoundationVersionNumber10_8 = 945.0; - -const double NSFoundationVersionNumber10_8_1 = 945.0; - -const double NSFoundationVersionNumber10_8_2 = 945.11; - -const double NSFoundationVersionNumber10_8_3 = 945.16; - -const double NSFoundationVersionNumber10_8_4 = 945.18; - -const int NSFoundationVersionNumber10_9 = 1056; - -const int NSFoundationVersionNumber10_9_1 = 1056; - -const double NSFoundationVersionNumber10_9_2 = 1056.13; - -const double NSFoundationVersionNumber10_10 = 1151.16; - -const double NSFoundationVersionNumber10_10_1 = 1151.16; - -const double NSFoundationVersionNumber10_10_2 = 1152.14; - -const double NSFoundationVersionNumber10_10_3 = 1153.2; - -const double NSFoundationVersionNumber10_10_4 = 1153.2; - -const int NSFoundationVersionNumber10_10_5 = 1154; - -const int NSFoundationVersionNumber10_10_Max = 1199; - -const int NSFoundationVersionNumber10_11 = 1252; - -const double NSFoundationVersionNumber10_11_1 = 1255.1; - -const double NSFoundationVersionNumber10_11_2 = 1256.1; - -const double NSFoundationVersionNumber10_11_3 = 1256.1; - -const int NSFoundationVersionNumber10_11_4 = 1258; - -const int NSFoundationVersionNumber10_11_Max = 1299; - -const int __COREFOUNDATION_CFBASE__ = 1; - -const int TRUE = 1; - -const int FALSE = 0; - -const double kCFCoreFoundationVersionNumber10_0 = 196.4; - -const double kCFCoreFoundationVersionNumber10_0_3 = 196.5; - -const double kCFCoreFoundationVersionNumber10_1 = 226.0; - -const double kCFCoreFoundationVersionNumber10_1_1 = 226.0; - -const double kCFCoreFoundationVersionNumber10_1_2 = 227.2; - -const double kCFCoreFoundationVersionNumber10_1_3 = 227.2; - -const double kCFCoreFoundationVersionNumber10_1_4 = 227.3; - -const double kCFCoreFoundationVersionNumber10_2 = 263.0; - -const double kCFCoreFoundationVersionNumber10_2_1 = 263.1; - -const double kCFCoreFoundationVersionNumber10_2_2 = 263.1; - -const double kCFCoreFoundationVersionNumber10_2_3 = 263.3; - -const double kCFCoreFoundationVersionNumber10_2_4 = 263.3; - -const double kCFCoreFoundationVersionNumber10_2_5 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_6 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_7 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_8 = 263.5; - -const double kCFCoreFoundationVersionNumber10_3 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_1 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_2 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_3 = 299.3; - -const double kCFCoreFoundationVersionNumber10_3_4 = 299.31; - -const double kCFCoreFoundationVersionNumber10_3_5 = 299.31; - -const double kCFCoreFoundationVersionNumber10_3_6 = 299.32; - -const double kCFCoreFoundationVersionNumber10_3_7 = 299.33; - -const double kCFCoreFoundationVersionNumber10_3_8 = 299.33; - -const double kCFCoreFoundationVersionNumber10_3_9 = 299.35; - -const double kCFCoreFoundationVersionNumber10_4 = 368.0; - -const double kCFCoreFoundationVersionNumber10_4_1 = 368.1; - -const double kCFCoreFoundationVersionNumber10_4_2 = 368.11; - -const double kCFCoreFoundationVersionNumber10_4_3 = 368.18; - -const double kCFCoreFoundationVersionNumber10_4_4_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_4_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_5_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_5_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_6_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_6_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_7 = 368.27; - -const double kCFCoreFoundationVersionNumber10_4_8 = 368.27; - -const double kCFCoreFoundationVersionNumber10_4_9 = 368.28; - -const double kCFCoreFoundationVersionNumber10_4_10 = 368.28; - -const double kCFCoreFoundationVersionNumber10_4_11 = 368.31; - -const double kCFCoreFoundationVersionNumber10_5 = 476.0; - -const double kCFCoreFoundationVersionNumber10_5_1 = 476.0; - -const double kCFCoreFoundationVersionNumber10_5_2 = 476.1; - -const double kCFCoreFoundationVersionNumber10_5_3 = 476.13; - -const double kCFCoreFoundationVersionNumber10_5_4 = 476.14; - -const double kCFCoreFoundationVersionNumber10_5_5 = 476.15; - -const double kCFCoreFoundationVersionNumber10_5_6 = 476.17; - -const double kCFCoreFoundationVersionNumber10_5_7 = 476.18; - -const double kCFCoreFoundationVersionNumber10_5_8 = 476.19; - -const double kCFCoreFoundationVersionNumber10_6 = 550.0; - -const double kCFCoreFoundationVersionNumber10_6_1 = 550.0; - -const double kCFCoreFoundationVersionNumber10_6_2 = 550.13; - -const double kCFCoreFoundationVersionNumber10_6_3 = 550.19; - -const double kCFCoreFoundationVersionNumber10_6_4 = 550.29; - -const double kCFCoreFoundationVersionNumber10_6_5 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_6 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_7 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_8 = 550.43; - -const double kCFCoreFoundationVersionNumber10_7 = 635.0; - -const double kCFCoreFoundationVersionNumber10_7_1 = 635.0; - -const double kCFCoreFoundationVersionNumber10_7_2 = 635.15; - -const double kCFCoreFoundationVersionNumber10_7_3 = 635.19; - -const double kCFCoreFoundationVersionNumber10_7_4 = 635.21; - -const double kCFCoreFoundationVersionNumber10_7_5 = 635.21; - -const double kCFCoreFoundationVersionNumber10_8 = 744.0; - -const double kCFCoreFoundationVersionNumber10_8_1 = 744.0; - -const double kCFCoreFoundationVersionNumber10_8_2 = 744.12; - -const double kCFCoreFoundationVersionNumber10_8_3 = 744.18; - -const double kCFCoreFoundationVersionNumber10_8_4 = 744.19; - -const double kCFCoreFoundationVersionNumber10_9 = 855.11; - -const double kCFCoreFoundationVersionNumber10_9_1 = 855.11; - -const double kCFCoreFoundationVersionNumber10_9_2 = 855.14; - -const double kCFCoreFoundationVersionNumber10_10 = 1151.16; - -const double kCFCoreFoundationVersionNumber10_10_1 = 1151.16; - -const int kCFCoreFoundationVersionNumber10_10_2 = 1152; - -const double kCFCoreFoundationVersionNumber10_10_3 = 1153.18; - -const double kCFCoreFoundationVersionNumber10_10_4 = 1153.18; - -const double kCFCoreFoundationVersionNumber10_10_5 = 1153.18; - -const int kCFCoreFoundationVersionNumber10_10_Max = 1199; - -const int kCFCoreFoundationVersionNumber10_11 = 1253; - -const double kCFCoreFoundationVersionNumber10_11_1 = 1255.1; - -const double kCFCoreFoundationVersionNumber10_11_2 = 1256.14; - -const double kCFCoreFoundationVersionNumber10_11_3 = 1256.14; - -const double kCFCoreFoundationVersionNumber10_11_4 = 1258.1; - -const int kCFCoreFoundationVersionNumber10_11_Max = 1299; - -const int ISA_PTRAUTH_DISCRIMINATOR = 27361; diff --git a/pkgs/ffigen/test/native_objc_test/block_test.dart b/pkgs/ffigen/test/native_objc_test/block_test.dart index 7d19a9d2e3..f0f3ac952b 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.dart +++ b/pkgs/ffigen/test/native_objc_test/block_test.dart @@ -8,10 +8,7 @@ import 'dart:ffi'; import 'dart:io'; -import 'package:ffigen/ffigen.dart'; -import 'package:path/path.dart' as path; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart'; import '../test_utils.dart'; import 'block_bindings.dart'; @@ -26,29 +23,6 @@ void main() { lib = BlockTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); }); - test('generate_bindings', () { - final config = Config.fromYaml(loadYaml( - File(path.join('test', 'native_objc_test', 'block_config.yaml')) - .readAsStringSync()) as YamlMap); - final library = parse(config); - final file = File( - path.join('test', 'debug_generated', 'block_test.dart'), - ); - library.generateFile(file); - - try { - final actual = file.readAsStringSync(); - final expected = File(path.join(config.output)).readAsStringSync(); - expect(actual, expected); - if (file.existsSync()) { - file.delete(); - } - } catch (e) { - print('Failed test: Debug generated file: ${file.absolute.path}'); - rethrow; - } - }); - test('BlockTester is working', () { // This doesn't test any Block functionality, just that the BlockTester // itself is working correctly. diff --git a/pkgs/ffigen/test/native_objc_test/cast_bindings.dart b/pkgs/ffigen/test/native_objc_test/cast_bindings.dart deleted file mode 100644 index ab3dd4c127..0000000000 --- a/pkgs/ffigen/test/native_objc_test/cast_bindings.dart +++ /dev/null @@ -1,1393 +0,0 @@ -// ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field - -// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; - -/// Tests casting objects -class CastTestObjCLibrary { - /// Holds the symbol lookup function. - final ffi.Pointer Function(String symbolName) - _lookup; - - /// The symbols are looked up in [dynamicLibrary]. - CastTestObjCLibrary(ffi.DynamicLibrary dynamicLibrary) - : _lookup = dynamicLibrary.lookup; - - /// The symbols are looked up with [lookup]. - CastTestObjCLibrary.fromLookup( - ffi.Pointer Function(String symbolName) - lookup) - : _lookup = lookup; - - late final ffi.Pointer _NSFoundationVersionNumber = - _lookup('NSFoundationVersionNumber'); - - double get NSFoundationVersionNumber => _NSFoundationVersionNumber.value; - - set NSFoundationVersionNumber(double value) => - _NSFoundationVersionNumber.value = value; - - late final ffi.Pointer _NSNotFound = - _lookup('NSNotFound'); - - int get NSNotFound => _NSNotFound.value; - - set NSNotFound(int value) => _NSNotFound.value = value; - - late final ffi.Pointer _kCFCoreFoundationVersionNumber = - _lookup('kCFCoreFoundationVersionNumber'); - - double get kCFCoreFoundationVersionNumber => - _kCFCoreFoundationVersionNumber.value; - - set kCFCoreFoundationVersionNumber(double value) => - _kCFCoreFoundationVersionNumber.value = value; - - late final ffi.Pointer _kCFNotFound = - _lookup('kCFNotFound'); - - int get kCFNotFound => _kCFNotFound.value; - - set kCFNotFound(int value) => _kCFNotFound.value = value; - - late final ffi.Pointer _kCFNull = _lookup('kCFNull'); - - CFNullRef get kCFNull => _kCFNull.value; - - set kCFNull(CFNullRef value) => _kCFNull.value = value; - - late final ffi.Pointer _kCFAllocatorDefault = - _lookup('kCFAllocatorDefault'); - - CFAllocatorRef get kCFAllocatorDefault => _kCFAllocatorDefault.value; - - set kCFAllocatorDefault(CFAllocatorRef value) => - _kCFAllocatorDefault.value = value; - - late final ffi.Pointer _kCFAllocatorSystemDefault = - _lookup('kCFAllocatorSystemDefault'); - - CFAllocatorRef get kCFAllocatorSystemDefault => - _kCFAllocatorSystemDefault.value; - - set kCFAllocatorSystemDefault(CFAllocatorRef value) => - _kCFAllocatorSystemDefault.value = value; - - late final ffi.Pointer _kCFAllocatorMalloc = - _lookup('kCFAllocatorMalloc'); - - CFAllocatorRef get kCFAllocatorMalloc => _kCFAllocatorMalloc.value; - - set kCFAllocatorMalloc(CFAllocatorRef value) => - _kCFAllocatorMalloc.value = value; - - late final ffi.Pointer _kCFAllocatorMallocZone = - _lookup('kCFAllocatorMallocZone'); - - CFAllocatorRef get kCFAllocatorMallocZone => _kCFAllocatorMallocZone.value; - - set kCFAllocatorMallocZone(CFAllocatorRef value) => - _kCFAllocatorMallocZone.value = value; - - late final ffi.Pointer _kCFAllocatorNull = - _lookup('kCFAllocatorNull'); - - CFAllocatorRef get kCFAllocatorNull => _kCFAllocatorNull.value; - - set kCFAllocatorNull(CFAllocatorRef value) => _kCFAllocatorNull.value = value; - - late final ffi.Pointer _kCFAllocatorUseContext = - _lookup('kCFAllocatorUseContext'); - - CFAllocatorRef get kCFAllocatorUseContext => _kCFAllocatorUseContext.value; - - set kCFAllocatorUseContext(CFAllocatorRef value) => - _kCFAllocatorUseContext.value = value; - - ffi.Pointer _registerName1(String name) { - final cstr = name.toNativeUtf8(); - final sel = _sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; - } - - ffi.Pointer _sel_registerName( - ffi.Pointer str, - ) { - return __sel_registerName( - str, - ); - } - - late final __sel_registerNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sel_registerName'); - late final __sel_registerName = __sel_registerNamePtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _getClass1(String name) { - final cstr = name.toNativeUtf8(); - final clazz = _objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return clazz; - } - - ffi.Pointer _objc_getClass( - ffi.Pointer str, - ) { - return __objc_getClass( - str, - ); - } - - late final __objc_getClassPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('objc_getClass'); - late final __objc_getClass = __objc_getClassPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); - late final ffi.Pointer _sel_load1 = _registerName1("load"); - void _objc_msgSend_0( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_0( - obj, - sel, - ); - } - - late final __objc_msgSend_0Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_initialize1 = - _registerName1("initialize"); - late final ffi.Pointer _sel_init1 = _registerName1("init"); - instancetype _objc_msgSend_1( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1( - obj, - sel, - ); - } - - late final __objc_msgSend_1Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_new1 = _registerName1("new"); - late final ffi.Pointer _sel_allocWithZone_1 = - _registerName1("allocWithZone:"); - instancetype _objc_msgSend_2( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_2( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_2Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>(); - - late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); - late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); - late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); - late final ffi.Pointer _sel_copy1 = _registerName1("copy"); - late final ffi.Pointer _sel_mutableCopy1 = - _registerName1("mutableCopy"); - late final ffi.Pointer _sel_copyWithZone_1 = - _registerName1("copyWithZone:"); - late final ffi.Pointer _sel_mutableCopyWithZone_1 = - _registerName1("mutableCopyWithZone:"); - late final ffi.Pointer _sel_instancesRespondToSelector_1 = - _registerName1("instancesRespondToSelector:"); - bool _objc_msgSend_3( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_3( - obj, - sel, - aSelector, - ) != - 0; - } - - late final __objc_msgSend_3Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_conformsToProtocol_1 = - _registerName1("conformsToProtocol:"); - bool _objc_msgSend_4( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer protocol, - ) { - return __objc_msgSend_4( - obj, - sel, - protocol, - ) != - 0; - } - - late final __objc_msgSend_4Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_methodForSelector_1 = - _registerName1("methodForSelector:"); - IMP _objc_msgSend_5( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_5( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_5Ptr = _lookup< - ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodForSelector_1 = - _registerName1("instanceMethodForSelector:"); - late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = - _registerName1("doesNotRecognizeSelector:"); - void _objc_msgSend_6( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_6( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_6Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardingTargetForSelector_1 = - _registerName1("forwardingTargetForSelector:"); - ffi.Pointer _objc_msgSend_7( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_7( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_7Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardInvocation_1 = - _registerName1("forwardInvocation:"); - void _objc_msgSend_8( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anInvocation, - ) { - return __objc_msgSend_8( - obj, - sel, - anInvocation, - ); - } - - late final __objc_msgSend_8Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _class_NSMethodSignature1 = - _getClass1("NSMethodSignature"); - late final ffi.Pointer _sel_methodSignatureForSelector_1 = - _registerName1("methodSignatureForSelector:"); - ffi.Pointer _objc_msgSend_9( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_9( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_9Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = - _registerName1("instanceMethodSignatureForSelector:"); - late final ffi.Pointer _sel_allowsWeakReference1 = - _registerName1("allowsWeakReference"); - bool _objc_msgSend_10( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_10( - obj, - sel, - ) != - 0; - } - - late final __objc_msgSend_10Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_retainWeakReference1 = - _registerName1("retainWeakReference"); - late final ffi.Pointer _sel_isSubclassOfClass_1 = - _registerName1("isSubclassOfClass:"); - late final ffi.Pointer _sel_resolveClassMethod_1 = - _registerName1("resolveClassMethod:"); - late final ffi.Pointer _sel_resolveInstanceMethod_1 = - _registerName1("resolveInstanceMethod:"); - late final ffi.Pointer _sel_hash1 = _registerName1("hash"); - int _objc_msgSend_11( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_11( - obj, - sel, - ); - } - - late final __objc_msgSend_11Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_superclass1 = - _registerName1("superclass"); - late final ffi.Pointer _sel_class1 = _registerName1("class"); - late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); - late final ffi.Pointer _sel_stringWithCString_encoding_1 = - _registerName1("stringWithCString:encoding:"); - ffi.Pointer _objc_msgSend_12( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cString, - int enc, - ) { - return __objc_msgSend_12( - obj, - sel, - cString, - enc, - ); - } - - late final __objc_msgSend_12Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_UTF8String1 = - _registerName1("UTF8String"); - ffi.Pointer _objc_msgSend_13( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_13( - obj, - sel, - ); - } - - late final __objc_msgSend_13Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_description1 = - _registerName1("description"); - ffi.Pointer _objc_msgSend_14( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_14( - obj, - sel, - ); - } - - late final __objc_msgSend_14Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_debugDescription1 = - _registerName1("debugDescription"); - late final ffi.Pointer _sel_version1 = _registerName1("version"); - int _objc_msgSend_15( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_15( - obj, - sel, - ); - } - - late final __objc_msgSend_15Ptr = _lookup< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_setVersion_1 = - _registerName1("setVersion:"); - void _objc_msgSend_16( - ffi.Pointer obj, - ffi.Pointer sel, - int aVersion, - ) { - return __objc_msgSend_16( - obj, - sel, - aVersion, - ); - } - - late final __objc_msgSend_16Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_classForCoder1 = - _registerName1("classForCoder"); - late final ffi.Pointer _sel_replacementObjectForCoder_1 = - _registerName1("replacementObjectForCoder:"); - ffi.Pointer _objc_msgSend_17( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_17( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_17Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = - _registerName1("awakeAfterUsingCoder:"); - late final ffi.Pointer _sel_poseAsClass_1 = - _registerName1("poseAsClass:"); - late final ffi.Pointer _sel_autoContentAccessingProxy1 = - _registerName1("autoContentAccessingProxy"); - late final ffi.Pointer _class_Castaway1 = _getClass1("Castaway"); - late final ffi.Pointer _sel_meAsNSObject1 = - _registerName1("meAsNSObject"); - ffi.Pointer _objc_msgSend_18( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_18( - obj, - sel, - ); - } - - late final __objc_msgSend_18Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_meAsInt1 = _registerName1("meAsInt"); - int _objc_msgSend_19( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_19( - obj, - sel, - ); - } - - late final __objc_msgSend_19Ptr = _lookup< - ffi.NativeFunction< - ffi.Int64 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); -} - -abstract class NSComparisonResult { - static const int NSOrderedAscending = -1; - static const int NSOrderedSame = 0; - static const int NSOrderedDescending = 1; -} - -abstract class NSEnumerationOptions { - static const int NSEnumerationConcurrent = 1; - static const int NSEnumerationReverse = 2; -} - -abstract class NSSortOptions { - static const int NSSortConcurrent = 1; - static const int NSSortStable = 16; -} - -abstract class NSQualityOfService { - static const int NSQualityOfServiceUserInteractive = 33; - static const int NSQualityOfServiceUserInitiated = 25; - static const int NSQualityOfServiceUtility = 17; - static const int NSQualityOfServiceBackground = 9; - static const int NSQualityOfServiceDefault = -1; -} - -typedef NSInteger = pkg_ffi.Long; - -class __CFString extends ffi.Opaque {} - -abstract class CFComparisonResult { - static const int kCFCompareLessThan = -1; - static const int kCFCompareEqualTo = 0; - static const int kCFCompareGreaterThan = 1; -} - -typedef CFIndex = pkg_ffi.Long; - -class CFRange extends ffi.Struct { - @CFIndex() - external int location; - - @CFIndex() - external int length; -} - -class __CFNull extends ffi.Opaque {} - -typedef CFNullRef = ffi.Pointer<__CFNull>; - -class __CFAllocator extends ffi.Opaque {} - -typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; - -class CFAllocatorContext extends ffi.Struct { - @CFIndex() - external int version; - - external ffi.Pointer info; - - external CFAllocatorRetainCallBack retain; - - external CFAllocatorReleaseCallBack release; - - external CFAllocatorCopyDescriptionCallBack copyDescription; - - external CFAllocatorAllocateCallBack allocate; - - external CFAllocatorReallocateCallBack reallocate; - - external CFAllocatorDeallocateCallBack deallocate; - - external CFAllocatorPreferredSizeCallBack preferredSize; -} - -typedef CFAllocatorRetainCallBack = ffi.Pointer< - ffi.NativeFunction Function(ffi.Pointer)>>; -typedef CFAllocatorReleaseCallBack - = ffi.Pointer)>>; -typedef CFAllocatorCopyDescriptionCallBack = ffi - .Pointer)>>; -typedef CFStringRef = ffi.Pointer<__CFString>; -typedef CFAllocatorAllocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - CFIndex, CFOptionFlags, ffi.Pointer)>>; -typedef CFOptionFlags = pkg_ffi.UnsignedLong; -typedef CFAllocatorReallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, CFIndex, - CFOptionFlags, ffi.Pointer)>>; -typedef CFAllocatorDeallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; -typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< - ffi.NativeFunction< - CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; - -class _ObjCWrapper { - final ffi.Pointer _id; - final CastTestObjCLibrary _lib; - - _ObjCWrapper._(this._id, this._lib); - - @override - bool operator ==(Object other) { - return other is _ObjCWrapper && _id == other._id; - } - - @override - int get hashCode => _id.hashCode; -} - -class NSObject extends _ObjCWrapper { - NSObject._(ffi.Pointer id, CastTestObjCLibrary lib) - : super._(id, lib); - - static NSObject castFrom(T other) { - return NSObject._(other._id, other._lib); - } - - static NSObject castFromPointer( - CastTestObjCLibrary lib, ffi.Pointer other) { - return NSObject._(other, lib); - } - - static void load(CastTestObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); - } - - static void initialize(CastTestObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); - } - - NSObject init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSObject._(_ret, _lib); - } - - static NSObject new1(CastTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); - return NSObject._(_ret, _lib); - } - - static NSObject allocWithZone_( - CastTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject alloc(CastTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); - return NSObject._(_ret, _lib); - } - - void dealloc() { - _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); - } - - void finalize() { - _lib._objc_msgSend_0(_id, _lib._sel_finalize1); - } - - NSObject copy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); - return NSObject._(_ret, _lib); - } - - NSObject mutableCopy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); - return NSObject._(_ret, _lib); - } - - static NSObject copyWithZone_( - CastTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject mutableCopyWithZone_( - CastTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static bool instancesRespondToSelector_( - CastTestObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_3(_lib._class_NSObject1, - _lib._sel_instancesRespondToSelector_1, aSelector); - } - - static bool conformsToProtocol_( - CastTestObjCLibrary _lib, NSObject? protocol) { - return _lib._objc_msgSend_4(_lib._class_NSObject1, - _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); - } - - IMP methodForSelector_(ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); - } - - static IMP instanceMethodForSelector_( - CastTestObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_lib._class_NSObject1, - _lib._sel_instanceMethodForSelector_1, aSelector); - } - - void doesNotRecognizeSelector_(ffi.Pointer aSelector) { - _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); - } - - NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_7( - _id, _lib._sel_forwardingTargetForSelector_1, aSelector); - return NSObject._(_ret, _lib); - } - - void forwardInvocation_(NSObject? anInvocation) { - _lib._objc_msgSend_8( - _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); - } - - NSMethodSignature methodSignatureForSelector_( - ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9( - _id, _lib._sel_methodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - static NSMethodSignature instanceMethodSignatureForSelector_( - CastTestObjCLibrary _lib, ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, - _lib._sel_instanceMethodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - bool allowsWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); - } - - bool retainWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); - } - - static bool isSubclassOfClass_(CastTestObjCLibrary _lib, NSObject aClass) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); - } - - static bool resolveClassMethod_( - CastTestObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); - } - - static bool resolveInstanceMethod_( - CastTestObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); - } - - static int hash(CastTestObjCLibrary _lib) { - return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); - } - - static NSObject superclass(CastTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); - return NSObject._(_ret, _lib); - } - - static NSObject class1(CastTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); - return NSObject._(_ret, _lib); - } - - static NSString description(CastTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_14(_lib._class_NSObject1, _lib._sel_description1); - return NSString._(_ret, _lib); - } - - static NSString debugDescription(CastTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_14( - _lib._class_NSObject1, _lib._sel_debugDescription1); - return NSString._(_ret, _lib); - } - - static int version(CastTestObjCLibrary _lib) { - return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); - } - - static void setVersion_(CastTestObjCLibrary _lib, int aVersion) { - _lib._objc_msgSend_16( - _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); - } - - NSObject get classForCoder { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); - return NSObject._(_ret, _lib); - } - - NSObject replacementObjectForCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - NSObject awakeAfterUsingCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static void poseAsClass_(CastTestObjCLibrary _lib, NSObject aClass) { - _lib._objc_msgSend_8( - _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); - } - - NSObject get autoContentAccessingProxy { - final _ret = - _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); - return NSObject._(_ret, _lib); - } -} - -class ObjCSel extends ffi.Opaque {} - -class ObjCObject extends ffi.Opaque {} - -typedef instancetype = ffi.Pointer; - -class _NSZone extends ffi.Opaque {} - -typedef IMP = ffi.Pointer>; - -class NSMethodSignature extends _ObjCWrapper { - NSMethodSignature._(ffi.Pointer id, CastTestObjCLibrary lib) - : super._(id, lib); - - static NSMethodSignature castFrom(T other) { - return NSMethodSignature._(other._id, other._lib); - } - - static NSMethodSignature castFromPointer( - CastTestObjCLibrary lib, ffi.Pointer other) { - return NSMethodSignature._(other, lib); - } -} - -typedef NSUInteger = pkg_ffi.UnsignedLong; - -class NSString extends _ObjCWrapper { - NSString._(ffi.Pointer id, CastTestObjCLibrary lib) - : super._(id, lib); - - static NSString castFrom(T other) { - return NSString._(other._id, other._lib); - } - - static NSString castFromPointer( - CastTestObjCLibrary lib, ffi.Pointer other) { - return NSString._(other, lib); - } - - factory NSString(CastTestObjCLibrary _lib, String str) { - final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); - pkg_ffi.calloc.free(cstr); - return nsstr; - } - - @override - String toString() => (UTF8String).cast().toDartString(); - - static NSString stringWithCString_encoding_( - CastTestObjCLibrary _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return NSString._(_ret, _lib); - } - - ffi.Pointer get UTF8String { - return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); - } -} - -extension StringToNSString on String { - NSString toNSString(CastTestObjCLibrary lib) => NSString(lib, this); -} - -class Castaway extends NSObject { - Castaway._(ffi.Pointer id, CastTestObjCLibrary lib) - : super._(id, lib); - - static Castaway castFrom(T other) { - return Castaway._(other._id, other._lib); - } - - static Castaway castFromPointer( - CastTestObjCLibrary lib, ffi.Pointer other) { - return Castaway._(other, lib); - } - - NSObject meAsNSObject() { - final _ret = _lib._objc_msgSend_18(_id, _lib._sel_meAsNSObject1); - return NSObject._(_ret, _lib); - } - - int meAsInt() { - return _lib._objc_msgSend_19(_id, _lib._sel_meAsInt1); - } - - static Castaway new1(CastTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_Castaway1, _lib._sel_new1); - return Castaway._(_ret, _lib); - } - - static Castaway alloc(CastTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_Castaway1, _lib._sel_alloc1); - return Castaway._(_ret, _lib); - } -} - -const int NSScannedOption = 1; - -const int NSCollectorDisabledOption = 2; - -const int NS_BLOCKS_AVAILABLE = 1; - -const int __COREFOUNDATION_CFAVAILABILITY__ = 1; - -const int __CF_ENUM_FIXED_IS_AVAILABLE = 1; - -const double NSFoundationVersionNumber10_0 = 397.4; - -const double NSFoundationVersionNumber10_1 = 425.0; - -const double NSFoundationVersionNumber10_1_1 = 425.0; - -const double NSFoundationVersionNumber10_1_2 = 425.0; - -const double NSFoundationVersionNumber10_1_3 = 425.0; - -const double NSFoundationVersionNumber10_1_4 = 425.0; - -const double NSFoundationVersionNumber10_2 = 462.0; - -const double NSFoundationVersionNumber10_2_1 = 462.0; - -const double NSFoundationVersionNumber10_2_2 = 462.0; - -const double NSFoundationVersionNumber10_2_3 = 462.0; - -const double NSFoundationVersionNumber10_2_4 = 462.0; - -const double NSFoundationVersionNumber10_2_5 = 462.0; - -const double NSFoundationVersionNumber10_2_6 = 462.0; - -const double NSFoundationVersionNumber10_2_7 = 462.7; - -const double NSFoundationVersionNumber10_2_8 = 462.7; - -const double NSFoundationVersionNumber10_3 = 500.0; - -const double NSFoundationVersionNumber10_3_1 = 500.0; - -const double NSFoundationVersionNumber10_3_2 = 500.3; - -const double NSFoundationVersionNumber10_3_3 = 500.54; - -const double NSFoundationVersionNumber10_3_4 = 500.56; - -const double NSFoundationVersionNumber10_3_5 = 500.56; - -const double NSFoundationVersionNumber10_3_6 = 500.56; - -const double NSFoundationVersionNumber10_3_7 = 500.56; - -const double NSFoundationVersionNumber10_3_8 = 500.56; - -const double NSFoundationVersionNumber10_3_9 = 500.58; - -const double NSFoundationVersionNumber10_4 = 567.0; - -const double NSFoundationVersionNumber10_4_1 = 567.0; - -const double NSFoundationVersionNumber10_4_2 = 567.12; - -const double NSFoundationVersionNumber10_4_3 = 567.21; - -const double NSFoundationVersionNumber10_4_4_Intel = 567.23; - -const double NSFoundationVersionNumber10_4_4_PowerPC = 567.21; - -const double NSFoundationVersionNumber10_4_5 = 567.25; - -const double NSFoundationVersionNumber10_4_6 = 567.26; - -const double NSFoundationVersionNumber10_4_7 = 567.27; - -const double NSFoundationVersionNumber10_4_8 = 567.28; - -const double NSFoundationVersionNumber10_4_9 = 567.29; - -const double NSFoundationVersionNumber10_4_10 = 567.29; - -const double NSFoundationVersionNumber10_4_11 = 567.36; - -const double NSFoundationVersionNumber10_5 = 677.0; - -const double NSFoundationVersionNumber10_5_1 = 677.1; - -const double NSFoundationVersionNumber10_5_2 = 677.15; - -const double NSFoundationVersionNumber10_5_3 = 677.19; - -const double NSFoundationVersionNumber10_5_4 = 677.19; - -const double NSFoundationVersionNumber10_5_5 = 677.21; - -const double NSFoundationVersionNumber10_5_6 = 677.22; - -const double NSFoundationVersionNumber10_5_7 = 677.24; - -const double NSFoundationVersionNumber10_5_8 = 677.26; - -const double NSFoundationVersionNumber10_6 = 751.0; - -const double NSFoundationVersionNumber10_6_1 = 751.0; - -const double NSFoundationVersionNumber10_6_2 = 751.14; - -const double NSFoundationVersionNumber10_6_3 = 751.21; - -const double NSFoundationVersionNumber10_6_4 = 751.29; - -const double NSFoundationVersionNumber10_6_5 = 751.42; - -const double NSFoundationVersionNumber10_6_6 = 751.53; - -const double NSFoundationVersionNumber10_6_7 = 751.53; - -const double NSFoundationVersionNumber10_6_8 = 751.62; - -const double NSFoundationVersionNumber10_7 = 833.1; - -const double NSFoundationVersionNumber10_7_1 = 833.1; - -const double NSFoundationVersionNumber10_7_2 = 833.2; - -const double NSFoundationVersionNumber10_7_3 = 833.24; - -const double NSFoundationVersionNumber10_7_4 = 833.25; - -const double NSFoundationVersionNumber10_8 = 945.0; - -const double NSFoundationVersionNumber10_8_1 = 945.0; - -const double NSFoundationVersionNumber10_8_2 = 945.11; - -const double NSFoundationVersionNumber10_8_3 = 945.16; - -const double NSFoundationVersionNumber10_8_4 = 945.18; - -const int NSFoundationVersionNumber10_9 = 1056; - -const int NSFoundationVersionNumber10_9_1 = 1056; - -const double NSFoundationVersionNumber10_9_2 = 1056.13; - -const double NSFoundationVersionNumber10_10 = 1151.16; - -const double NSFoundationVersionNumber10_10_1 = 1151.16; - -const double NSFoundationVersionNumber10_10_2 = 1152.14; - -const double NSFoundationVersionNumber10_10_3 = 1153.2; - -const double NSFoundationVersionNumber10_10_4 = 1153.2; - -const int NSFoundationVersionNumber10_10_5 = 1154; - -const int NSFoundationVersionNumber10_10_Max = 1199; - -const int NSFoundationVersionNumber10_11 = 1252; - -const double NSFoundationVersionNumber10_11_1 = 1255.1; - -const double NSFoundationVersionNumber10_11_2 = 1256.1; - -const double NSFoundationVersionNumber10_11_3 = 1256.1; - -const int NSFoundationVersionNumber10_11_4 = 1258; - -const int NSFoundationVersionNumber10_11_Max = 1299; - -const int __COREFOUNDATION_CFBASE__ = 1; - -const int TRUE = 1; - -const int FALSE = 0; - -const double kCFCoreFoundationVersionNumber10_0 = 196.4; - -const double kCFCoreFoundationVersionNumber10_0_3 = 196.5; - -const double kCFCoreFoundationVersionNumber10_1 = 226.0; - -const double kCFCoreFoundationVersionNumber10_1_1 = 226.0; - -const double kCFCoreFoundationVersionNumber10_1_2 = 227.2; - -const double kCFCoreFoundationVersionNumber10_1_3 = 227.2; - -const double kCFCoreFoundationVersionNumber10_1_4 = 227.3; - -const double kCFCoreFoundationVersionNumber10_2 = 263.0; - -const double kCFCoreFoundationVersionNumber10_2_1 = 263.1; - -const double kCFCoreFoundationVersionNumber10_2_2 = 263.1; - -const double kCFCoreFoundationVersionNumber10_2_3 = 263.3; - -const double kCFCoreFoundationVersionNumber10_2_4 = 263.3; - -const double kCFCoreFoundationVersionNumber10_2_5 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_6 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_7 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_8 = 263.5; - -const double kCFCoreFoundationVersionNumber10_3 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_1 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_2 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_3 = 299.3; - -const double kCFCoreFoundationVersionNumber10_3_4 = 299.31; - -const double kCFCoreFoundationVersionNumber10_3_5 = 299.31; - -const double kCFCoreFoundationVersionNumber10_3_6 = 299.32; - -const double kCFCoreFoundationVersionNumber10_3_7 = 299.33; - -const double kCFCoreFoundationVersionNumber10_3_8 = 299.33; - -const double kCFCoreFoundationVersionNumber10_3_9 = 299.35; - -const double kCFCoreFoundationVersionNumber10_4 = 368.0; - -const double kCFCoreFoundationVersionNumber10_4_1 = 368.1; - -const double kCFCoreFoundationVersionNumber10_4_2 = 368.11; - -const double kCFCoreFoundationVersionNumber10_4_3 = 368.18; - -const double kCFCoreFoundationVersionNumber10_4_4_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_4_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_5_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_5_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_6_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_6_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_7 = 368.27; - -const double kCFCoreFoundationVersionNumber10_4_8 = 368.27; - -const double kCFCoreFoundationVersionNumber10_4_9 = 368.28; - -const double kCFCoreFoundationVersionNumber10_4_10 = 368.28; - -const double kCFCoreFoundationVersionNumber10_4_11 = 368.31; - -const double kCFCoreFoundationVersionNumber10_5 = 476.0; - -const double kCFCoreFoundationVersionNumber10_5_1 = 476.0; - -const double kCFCoreFoundationVersionNumber10_5_2 = 476.1; - -const double kCFCoreFoundationVersionNumber10_5_3 = 476.13; - -const double kCFCoreFoundationVersionNumber10_5_4 = 476.14; - -const double kCFCoreFoundationVersionNumber10_5_5 = 476.15; - -const double kCFCoreFoundationVersionNumber10_5_6 = 476.17; - -const double kCFCoreFoundationVersionNumber10_5_7 = 476.18; - -const double kCFCoreFoundationVersionNumber10_5_8 = 476.19; - -const double kCFCoreFoundationVersionNumber10_6 = 550.0; - -const double kCFCoreFoundationVersionNumber10_6_1 = 550.0; - -const double kCFCoreFoundationVersionNumber10_6_2 = 550.13; - -const double kCFCoreFoundationVersionNumber10_6_3 = 550.19; - -const double kCFCoreFoundationVersionNumber10_6_4 = 550.29; - -const double kCFCoreFoundationVersionNumber10_6_5 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_6 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_7 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_8 = 550.43; - -const double kCFCoreFoundationVersionNumber10_7 = 635.0; - -const double kCFCoreFoundationVersionNumber10_7_1 = 635.0; - -const double kCFCoreFoundationVersionNumber10_7_2 = 635.15; - -const double kCFCoreFoundationVersionNumber10_7_3 = 635.19; - -const double kCFCoreFoundationVersionNumber10_7_4 = 635.21; - -const double kCFCoreFoundationVersionNumber10_7_5 = 635.21; - -const double kCFCoreFoundationVersionNumber10_8 = 744.0; - -const double kCFCoreFoundationVersionNumber10_8_1 = 744.0; - -const double kCFCoreFoundationVersionNumber10_8_2 = 744.12; - -const double kCFCoreFoundationVersionNumber10_8_3 = 744.18; - -const double kCFCoreFoundationVersionNumber10_8_4 = 744.19; - -const double kCFCoreFoundationVersionNumber10_9 = 855.11; - -const double kCFCoreFoundationVersionNumber10_9_1 = 855.11; - -const double kCFCoreFoundationVersionNumber10_9_2 = 855.14; - -const double kCFCoreFoundationVersionNumber10_10 = 1151.16; - -const double kCFCoreFoundationVersionNumber10_10_1 = 1151.16; - -const int kCFCoreFoundationVersionNumber10_10_2 = 1152; - -const double kCFCoreFoundationVersionNumber10_10_3 = 1153.18; - -const double kCFCoreFoundationVersionNumber10_10_4 = 1153.18; - -const double kCFCoreFoundationVersionNumber10_10_5 = 1153.18; - -const int kCFCoreFoundationVersionNumber10_10_Max = 1199; - -const int kCFCoreFoundationVersionNumber10_11 = 1253; - -const double kCFCoreFoundationVersionNumber10_11_1 = 1255.1; - -const double kCFCoreFoundationVersionNumber10_11_2 = 1256.14; - -const double kCFCoreFoundationVersionNumber10_11_3 = 1256.14; - -const double kCFCoreFoundationVersionNumber10_11_4 = 1258.1; - -const int kCFCoreFoundationVersionNumber10_11_Max = 1299; - -const int ISA_PTRAUTH_DISCRIMINATOR = 27361; diff --git a/pkgs/ffigen/test/native_objc_test/cast_test.dart b/pkgs/ffigen/test/native_objc_test/cast_test.dart index d4a93f3a0e..2b17174297 100644 --- a/pkgs/ffigen/test/native_objc_test/cast_test.dart +++ b/pkgs/ffigen/test/native_objc_test/cast_test.dart @@ -9,10 +9,7 @@ import 'dart:ffi'; import 'dart:io'; -import 'package:ffigen/ffigen.dart'; -import 'package:path/path.dart' as path; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart'; import '../test_utils.dart'; import 'cast_bindings.dart'; @@ -29,29 +26,6 @@ void main() { testInstance = Castaway.new1(lib); }); - test('generate_bindings', () { - final config = Config.fromYaml(loadYaml( - File(path.join('test', 'native_objc_test', 'cast_config.yaml')) - .readAsStringSync()) as YamlMap); - final library = parse(config); - final file = File( - path.join('test', 'debug_generated', 'cast_test.dart'), - ); - library.generateFile(file); - - try { - final actual = file.readAsStringSync(); - final expected = File(path.join(config.output)).readAsStringSync(); - expect(actual, expected); - if (file.existsSync()) { - file.delete(); - } - } catch (e) { - print('Failed test: Debug generated file: ${file.absolute.path}'); - rethrow; - } - }); - test('castFrom', () { final fromCast = Castaway.castFrom(testInstance.meAsNSObject()); expect(fromCast, testInstance); diff --git a/pkgs/ffigen/test/native_objc_test/category_bindings.dart b/pkgs/ffigen/test/native_objc_test/category_bindings.dart deleted file mode 100644 index 1dbc709012..0000000000 --- a/pkgs/ffigen/test/native_objc_test/category_bindings.dart +++ /dev/null @@ -1,1379 +0,0 @@ -// ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field - -// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; - -/// Tests handling Objective-C categories -class CategoryTestObjCLibrary { - /// Holds the symbol lookup function. - final ffi.Pointer Function(String symbolName) - _lookup; - - /// The symbols are looked up in [dynamicLibrary]. - CategoryTestObjCLibrary(ffi.DynamicLibrary dynamicLibrary) - : _lookup = dynamicLibrary.lookup; - - /// The symbols are looked up with [lookup]. - CategoryTestObjCLibrary.fromLookup( - ffi.Pointer Function(String symbolName) - lookup) - : _lookup = lookup; - - late final ffi.Pointer _NSFoundationVersionNumber = - _lookup('NSFoundationVersionNumber'); - - double get NSFoundationVersionNumber => _NSFoundationVersionNumber.value; - - set NSFoundationVersionNumber(double value) => - _NSFoundationVersionNumber.value = value; - - late final ffi.Pointer _NSNotFound = - _lookup('NSNotFound'); - - int get NSNotFound => _NSNotFound.value; - - set NSNotFound(int value) => _NSNotFound.value = value; - - late final ffi.Pointer _kCFCoreFoundationVersionNumber = - _lookup('kCFCoreFoundationVersionNumber'); - - double get kCFCoreFoundationVersionNumber => - _kCFCoreFoundationVersionNumber.value; - - set kCFCoreFoundationVersionNumber(double value) => - _kCFCoreFoundationVersionNumber.value = value; - - late final ffi.Pointer _kCFNotFound = - _lookup('kCFNotFound'); - - int get kCFNotFound => _kCFNotFound.value; - - set kCFNotFound(int value) => _kCFNotFound.value = value; - - late final ffi.Pointer _kCFNull = _lookup('kCFNull'); - - CFNullRef get kCFNull => _kCFNull.value; - - set kCFNull(CFNullRef value) => _kCFNull.value = value; - - late final ffi.Pointer _kCFAllocatorDefault = - _lookup('kCFAllocatorDefault'); - - CFAllocatorRef get kCFAllocatorDefault => _kCFAllocatorDefault.value; - - set kCFAllocatorDefault(CFAllocatorRef value) => - _kCFAllocatorDefault.value = value; - - late final ffi.Pointer _kCFAllocatorSystemDefault = - _lookup('kCFAllocatorSystemDefault'); - - CFAllocatorRef get kCFAllocatorSystemDefault => - _kCFAllocatorSystemDefault.value; - - set kCFAllocatorSystemDefault(CFAllocatorRef value) => - _kCFAllocatorSystemDefault.value = value; - - late final ffi.Pointer _kCFAllocatorMalloc = - _lookup('kCFAllocatorMalloc'); - - CFAllocatorRef get kCFAllocatorMalloc => _kCFAllocatorMalloc.value; - - set kCFAllocatorMalloc(CFAllocatorRef value) => - _kCFAllocatorMalloc.value = value; - - late final ffi.Pointer _kCFAllocatorMallocZone = - _lookup('kCFAllocatorMallocZone'); - - CFAllocatorRef get kCFAllocatorMallocZone => _kCFAllocatorMallocZone.value; - - set kCFAllocatorMallocZone(CFAllocatorRef value) => - _kCFAllocatorMallocZone.value = value; - - late final ffi.Pointer _kCFAllocatorNull = - _lookup('kCFAllocatorNull'); - - CFAllocatorRef get kCFAllocatorNull => _kCFAllocatorNull.value; - - set kCFAllocatorNull(CFAllocatorRef value) => _kCFAllocatorNull.value = value; - - late final ffi.Pointer _kCFAllocatorUseContext = - _lookup('kCFAllocatorUseContext'); - - CFAllocatorRef get kCFAllocatorUseContext => _kCFAllocatorUseContext.value; - - set kCFAllocatorUseContext(CFAllocatorRef value) => - _kCFAllocatorUseContext.value = value; - - ffi.Pointer _registerName1(String name) { - final cstr = name.toNativeUtf8(); - final sel = _sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; - } - - ffi.Pointer _sel_registerName( - ffi.Pointer str, - ) { - return __sel_registerName( - str, - ); - } - - late final __sel_registerNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sel_registerName'); - late final __sel_registerName = __sel_registerNamePtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _getClass1(String name) { - final cstr = name.toNativeUtf8(); - final clazz = _objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return clazz; - } - - ffi.Pointer _objc_getClass( - ffi.Pointer str, - ) { - return __objc_getClass( - str, - ); - } - - late final __objc_getClassPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('objc_getClass'); - late final __objc_getClass = __objc_getClassPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); - late final ffi.Pointer _sel_load1 = _registerName1("load"); - void _objc_msgSend_0( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_0( - obj, - sel, - ); - } - - late final __objc_msgSend_0Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_initialize1 = - _registerName1("initialize"); - late final ffi.Pointer _sel_init1 = _registerName1("init"); - instancetype _objc_msgSend_1( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1( - obj, - sel, - ); - } - - late final __objc_msgSend_1Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_new1 = _registerName1("new"); - late final ffi.Pointer _sel_allocWithZone_1 = - _registerName1("allocWithZone:"); - instancetype _objc_msgSend_2( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_2( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_2Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>(); - - late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); - late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); - late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); - late final ffi.Pointer _sel_copy1 = _registerName1("copy"); - late final ffi.Pointer _sel_mutableCopy1 = - _registerName1("mutableCopy"); - late final ffi.Pointer _sel_copyWithZone_1 = - _registerName1("copyWithZone:"); - late final ffi.Pointer _sel_mutableCopyWithZone_1 = - _registerName1("mutableCopyWithZone:"); - late final ffi.Pointer _sel_instancesRespondToSelector_1 = - _registerName1("instancesRespondToSelector:"); - bool _objc_msgSend_3( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_3( - obj, - sel, - aSelector, - ) != - 0; - } - - late final __objc_msgSend_3Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_conformsToProtocol_1 = - _registerName1("conformsToProtocol:"); - bool _objc_msgSend_4( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer protocol, - ) { - return __objc_msgSend_4( - obj, - sel, - protocol, - ) != - 0; - } - - late final __objc_msgSend_4Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_methodForSelector_1 = - _registerName1("methodForSelector:"); - IMP _objc_msgSend_5( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_5( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_5Ptr = _lookup< - ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodForSelector_1 = - _registerName1("instanceMethodForSelector:"); - late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = - _registerName1("doesNotRecognizeSelector:"); - void _objc_msgSend_6( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_6( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_6Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardingTargetForSelector_1 = - _registerName1("forwardingTargetForSelector:"); - ffi.Pointer _objc_msgSend_7( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_7( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_7Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardInvocation_1 = - _registerName1("forwardInvocation:"); - void _objc_msgSend_8( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anInvocation, - ) { - return __objc_msgSend_8( - obj, - sel, - anInvocation, - ); - } - - late final __objc_msgSend_8Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _class_NSMethodSignature1 = - _getClass1("NSMethodSignature"); - late final ffi.Pointer _sel_methodSignatureForSelector_1 = - _registerName1("methodSignatureForSelector:"); - ffi.Pointer _objc_msgSend_9( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_9( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_9Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = - _registerName1("instanceMethodSignatureForSelector:"); - late final ffi.Pointer _sel_allowsWeakReference1 = - _registerName1("allowsWeakReference"); - bool _objc_msgSend_10( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_10( - obj, - sel, - ) != - 0; - } - - late final __objc_msgSend_10Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_retainWeakReference1 = - _registerName1("retainWeakReference"); - late final ffi.Pointer _sel_isSubclassOfClass_1 = - _registerName1("isSubclassOfClass:"); - late final ffi.Pointer _sel_resolveClassMethod_1 = - _registerName1("resolveClassMethod:"); - late final ffi.Pointer _sel_resolveInstanceMethod_1 = - _registerName1("resolveInstanceMethod:"); - late final ffi.Pointer _sel_hash1 = _registerName1("hash"); - int _objc_msgSend_11( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_11( - obj, - sel, - ); - } - - late final __objc_msgSend_11Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_superclass1 = - _registerName1("superclass"); - late final ffi.Pointer _sel_class1 = _registerName1("class"); - late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); - late final ffi.Pointer _sel_stringWithCString_encoding_1 = - _registerName1("stringWithCString:encoding:"); - ffi.Pointer _objc_msgSend_12( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cString, - int enc, - ) { - return __objc_msgSend_12( - obj, - sel, - cString, - enc, - ); - } - - late final __objc_msgSend_12Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_UTF8String1 = - _registerName1("UTF8String"); - ffi.Pointer _objc_msgSend_13( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_13( - obj, - sel, - ); - } - - late final __objc_msgSend_13Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_description1 = - _registerName1("description"); - ffi.Pointer _objc_msgSend_14( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_14( - obj, - sel, - ); - } - - late final __objc_msgSend_14Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_debugDescription1 = - _registerName1("debugDescription"); - late final ffi.Pointer _sel_version1 = _registerName1("version"); - int _objc_msgSend_15( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_15( - obj, - sel, - ); - } - - late final __objc_msgSend_15Ptr = _lookup< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_setVersion_1 = - _registerName1("setVersion:"); - void _objc_msgSend_16( - ffi.Pointer obj, - ffi.Pointer sel, - int aVersion, - ) { - return __objc_msgSend_16( - obj, - sel, - aVersion, - ); - } - - late final __objc_msgSend_16Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_classForCoder1 = - _registerName1("classForCoder"); - late final ffi.Pointer _sel_replacementObjectForCoder_1 = - _registerName1("replacementObjectForCoder:"); - ffi.Pointer _objc_msgSend_17( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_17( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_17Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = - _registerName1("awakeAfterUsingCoder:"); - late final ffi.Pointer _sel_poseAsClass_1 = - _registerName1("poseAsClass:"); - late final ffi.Pointer _sel_autoContentAccessingProxy1 = - _registerName1("autoContentAccessingProxy"); - late final ffi.Pointer _class_Thing1 = _getClass1("Thing"); - late final ffi.Pointer _sel_add_Y_1 = _registerName1("add:Y:"); - int _objc_msgSend_18( - ffi.Pointer obj, - ffi.Pointer sel, - int x, - int y, - ) { - return __objc_msgSend_18( - obj, - sel, - x, - y, - ); - } - - late final __objc_msgSend_18Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, int)>(); - - late final ffi.Pointer _sel_sub_Y_1 = _registerName1("sub:Y:"); -} - -abstract class NSComparisonResult { - static const int NSOrderedAscending = -1; - static const int NSOrderedSame = 0; - static const int NSOrderedDescending = 1; -} - -abstract class NSEnumerationOptions { - static const int NSEnumerationConcurrent = 1; - static const int NSEnumerationReverse = 2; -} - -abstract class NSSortOptions { - static const int NSSortConcurrent = 1; - static const int NSSortStable = 16; -} - -abstract class NSQualityOfService { - static const int NSQualityOfServiceUserInteractive = 33; - static const int NSQualityOfServiceUserInitiated = 25; - static const int NSQualityOfServiceUtility = 17; - static const int NSQualityOfServiceBackground = 9; - static const int NSQualityOfServiceDefault = -1; -} - -typedef NSInteger = pkg_ffi.Long; - -class __CFString extends ffi.Opaque {} - -abstract class CFComparisonResult { - static const int kCFCompareLessThan = -1; - static const int kCFCompareEqualTo = 0; - static const int kCFCompareGreaterThan = 1; -} - -typedef CFIndex = pkg_ffi.Long; - -class CFRange extends ffi.Struct { - @CFIndex() - external int location; - - @CFIndex() - external int length; -} - -class __CFNull extends ffi.Opaque {} - -typedef CFNullRef = ffi.Pointer<__CFNull>; - -class __CFAllocator extends ffi.Opaque {} - -typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; - -class CFAllocatorContext extends ffi.Struct { - @CFIndex() - external int version; - - external ffi.Pointer info; - - external CFAllocatorRetainCallBack retain; - - external CFAllocatorReleaseCallBack release; - - external CFAllocatorCopyDescriptionCallBack copyDescription; - - external CFAllocatorAllocateCallBack allocate; - - external CFAllocatorReallocateCallBack reallocate; - - external CFAllocatorDeallocateCallBack deallocate; - - external CFAllocatorPreferredSizeCallBack preferredSize; -} - -typedef CFAllocatorRetainCallBack = ffi.Pointer< - ffi.NativeFunction Function(ffi.Pointer)>>; -typedef CFAllocatorReleaseCallBack - = ffi.Pointer)>>; -typedef CFAllocatorCopyDescriptionCallBack = ffi - .Pointer)>>; -typedef CFStringRef = ffi.Pointer<__CFString>; -typedef CFAllocatorAllocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - CFIndex, CFOptionFlags, ffi.Pointer)>>; -typedef CFOptionFlags = pkg_ffi.UnsignedLong; -typedef CFAllocatorReallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, CFIndex, - CFOptionFlags, ffi.Pointer)>>; -typedef CFAllocatorDeallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; -typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< - ffi.NativeFunction< - CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; - -class _ObjCWrapper { - final ffi.Pointer _id; - final CategoryTestObjCLibrary _lib; - - _ObjCWrapper._(this._id, this._lib); - - @override - bool operator ==(Object other) { - return other is _ObjCWrapper && _id == other._id; - } - - @override - int get hashCode => _id.hashCode; -} - -class NSObject extends _ObjCWrapper { - NSObject._(ffi.Pointer id, CategoryTestObjCLibrary lib) - : super._(id, lib); - - static NSObject castFrom(T other) { - return NSObject._(other._id, other._lib); - } - - static NSObject castFromPointer( - CategoryTestObjCLibrary lib, ffi.Pointer other) { - return NSObject._(other, lib); - } - - static void load(CategoryTestObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); - } - - static void initialize(CategoryTestObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); - } - - NSObject init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSObject._(_ret, _lib); - } - - static NSObject new1(CategoryTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); - return NSObject._(_ret, _lib); - } - - static NSObject allocWithZone_( - CategoryTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject alloc(CategoryTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); - return NSObject._(_ret, _lib); - } - - void dealloc() { - _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); - } - - void finalize() { - _lib._objc_msgSend_0(_id, _lib._sel_finalize1); - } - - NSObject copy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); - return NSObject._(_ret, _lib); - } - - NSObject mutableCopy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); - return NSObject._(_ret, _lib); - } - - static NSObject copyWithZone_( - CategoryTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject mutableCopyWithZone_( - CategoryTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static bool instancesRespondToSelector_( - CategoryTestObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_3(_lib._class_NSObject1, - _lib._sel_instancesRespondToSelector_1, aSelector); - } - - static bool conformsToProtocol_( - CategoryTestObjCLibrary _lib, NSObject? protocol) { - return _lib._objc_msgSend_4(_lib._class_NSObject1, - _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); - } - - IMP methodForSelector_(ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); - } - - static IMP instanceMethodForSelector_( - CategoryTestObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_lib._class_NSObject1, - _lib._sel_instanceMethodForSelector_1, aSelector); - } - - void doesNotRecognizeSelector_(ffi.Pointer aSelector) { - _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); - } - - NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_7( - _id, _lib._sel_forwardingTargetForSelector_1, aSelector); - return NSObject._(_ret, _lib); - } - - void forwardInvocation_(NSObject? anInvocation) { - _lib._objc_msgSend_8( - _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); - } - - NSMethodSignature methodSignatureForSelector_( - ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9( - _id, _lib._sel_methodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - static NSMethodSignature instanceMethodSignatureForSelector_( - CategoryTestObjCLibrary _lib, ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, - _lib._sel_instanceMethodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - bool allowsWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); - } - - bool retainWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); - } - - static bool isSubclassOfClass_( - CategoryTestObjCLibrary _lib, NSObject aClass) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); - } - - static bool resolveClassMethod_( - CategoryTestObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); - } - - static bool resolveInstanceMethod_( - CategoryTestObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); - } - - static int hash(CategoryTestObjCLibrary _lib) { - return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); - } - - static NSObject superclass(CategoryTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); - return NSObject._(_ret, _lib); - } - - static NSObject class1(CategoryTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); - return NSObject._(_ret, _lib); - } - - static NSString description(CategoryTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_14(_lib._class_NSObject1, _lib._sel_description1); - return NSString._(_ret, _lib); - } - - static NSString debugDescription(CategoryTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_14( - _lib._class_NSObject1, _lib._sel_debugDescription1); - return NSString._(_ret, _lib); - } - - static int version(CategoryTestObjCLibrary _lib) { - return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); - } - - static void setVersion_(CategoryTestObjCLibrary _lib, int aVersion) { - _lib._objc_msgSend_16( - _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); - } - - NSObject get classForCoder { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); - return NSObject._(_ret, _lib); - } - - NSObject replacementObjectForCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - NSObject awakeAfterUsingCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static void poseAsClass_(CategoryTestObjCLibrary _lib, NSObject aClass) { - _lib._objc_msgSend_8( - _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); - } - - NSObject get autoContentAccessingProxy { - final _ret = - _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); - return NSObject._(_ret, _lib); - } -} - -class ObjCSel extends ffi.Opaque {} - -class ObjCObject extends ffi.Opaque {} - -typedef instancetype = ffi.Pointer; - -class _NSZone extends ffi.Opaque {} - -typedef IMP = ffi.Pointer>; - -class NSMethodSignature extends _ObjCWrapper { - NSMethodSignature._(ffi.Pointer id, CategoryTestObjCLibrary lib) - : super._(id, lib); - - static NSMethodSignature castFrom(T other) { - return NSMethodSignature._(other._id, other._lib); - } - - static NSMethodSignature castFromPointer( - CategoryTestObjCLibrary lib, ffi.Pointer other) { - return NSMethodSignature._(other, lib); - } -} - -typedef NSUInteger = pkg_ffi.UnsignedLong; - -class NSString extends _ObjCWrapper { - NSString._(ffi.Pointer id, CategoryTestObjCLibrary lib) - : super._(id, lib); - - static NSString castFrom(T other) { - return NSString._(other._id, other._lib); - } - - static NSString castFromPointer( - CategoryTestObjCLibrary lib, ffi.Pointer other) { - return NSString._(other, lib); - } - - factory NSString(CategoryTestObjCLibrary _lib, String str) { - final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); - pkg_ffi.calloc.free(cstr); - return nsstr; - } - - @override - String toString() => (UTF8String).cast().toDartString(); - - static NSString stringWithCString_encoding_(CategoryTestObjCLibrary _lib, - ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return NSString._(_ret, _lib); - } - - ffi.Pointer get UTF8String { - return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); - } -} - -extension StringToNSString on String { - NSString toNSString(CategoryTestObjCLibrary lib) => NSString(lib, this); -} - -class Thing extends NSObject { - Thing._(ffi.Pointer id, CategoryTestObjCLibrary lib) - : super._(id, lib); - - static Thing castFrom(T other) { - return Thing._(other._id, other._lib); - } - - static Thing castFromPointer( - CategoryTestObjCLibrary lib, ffi.Pointer other) { - return Thing._(other, lib); - } - - int add_Y_(int x, int y) { - return _lib._objc_msgSend_18(_id, _lib._sel_add_Y_1, x, y); - } - - int sub_Y_(int x, int y) { - return _lib._objc_msgSend_18(_id, _lib._sel_sub_Y_1, x, y); - } - - static Thing new1(CategoryTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_Thing1, _lib._sel_new1); - return Thing._(_ret, _lib); - } - - static Thing alloc(CategoryTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_Thing1, _lib._sel_alloc1); - return Thing._(_ret, _lib); - } -} - -const int NSScannedOption = 1; - -const int NSCollectorDisabledOption = 2; - -const int NS_BLOCKS_AVAILABLE = 1; - -const int __COREFOUNDATION_CFAVAILABILITY__ = 1; - -const int __CF_ENUM_FIXED_IS_AVAILABLE = 1; - -const double NSFoundationVersionNumber10_0 = 397.4; - -const double NSFoundationVersionNumber10_1 = 425.0; - -const double NSFoundationVersionNumber10_1_1 = 425.0; - -const double NSFoundationVersionNumber10_1_2 = 425.0; - -const double NSFoundationVersionNumber10_1_3 = 425.0; - -const double NSFoundationVersionNumber10_1_4 = 425.0; - -const double NSFoundationVersionNumber10_2 = 462.0; - -const double NSFoundationVersionNumber10_2_1 = 462.0; - -const double NSFoundationVersionNumber10_2_2 = 462.0; - -const double NSFoundationVersionNumber10_2_3 = 462.0; - -const double NSFoundationVersionNumber10_2_4 = 462.0; - -const double NSFoundationVersionNumber10_2_5 = 462.0; - -const double NSFoundationVersionNumber10_2_6 = 462.0; - -const double NSFoundationVersionNumber10_2_7 = 462.7; - -const double NSFoundationVersionNumber10_2_8 = 462.7; - -const double NSFoundationVersionNumber10_3 = 500.0; - -const double NSFoundationVersionNumber10_3_1 = 500.0; - -const double NSFoundationVersionNumber10_3_2 = 500.3; - -const double NSFoundationVersionNumber10_3_3 = 500.54; - -const double NSFoundationVersionNumber10_3_4 = 500.56; - -const double NSFoundationVersionNumber10_3_5 = 500.56; - -const double NSFoundationVersionNumber10_3_6 = 500.56; - -const double NSFoundationVersionNumber10_3_7 = 500.56; - -const double NSFoundationVersionNumber10_3_8 = 500.56; - -const double NSFoundationVersionNumber10_3_9 = 500.58; - -const double NSFoundationVersionNumber10_4 = 567.0; - -const double NSFoundationVersionNumber10_4_1 = 567.0; - -const double NSFoundationVersionNumber10_4_2 = 567.12; - -const double NSFoundationVersionNumber10_4_3 = 567.21; - -const double NSFoundationVersionNumber10_4_4_Intel = 567.23; - -const double NSFoundationVersionNumber10_4_4_PowerPC = 567.21; - -const double NSFoundationVersionNumber10_4_5 = 567.25; - -const double NSFoundationVersionNumber10_4_6 = 567.26; - -const double NSFoundationVersionNumber10_4_7 = 567.27; - -const double NSFoundationVersionNumber10_4_8 = 567.28; - -const double NSFoundationVersionNumber10_4_9 = 567.29; - -const double NSFoundationVersionNumber10_4_10 = 567.29; - -const double NSFoundationVersionNumber10_4_11 = 567.36; - -const double NSFoundationVersionNumber10_5 = 677.0; - -const double NSFoundationVersionNumber10_5_1 = 677.1; - -const double NSFoundationVersionNumber10_5_2 = 677.15; - -const double NSFoundationVersionNumber10_5_3 = 677.19; - -const double NSFoundationVersionNumber10_5_4 = 677.19; - -const double NSFoundationVersionNumber10_5_5 = 677.21; - -const double NSFoundationVersionNumber10_5_6 = 677.22; - -const double NSFoundationVersionNumber10_5_7 = 677.24; - -const double NSFoundationVersionNumber10_5_8 = 677.26; - -const double NSFoundationVersionNumber10_6 = 751.0; - -const double NSFoundationVersionNumber10_6_1 = 751.0; - -const double NSFoundationVersionNumber10_6_2 = 751.14; - -const double NSFoundationVersionNumber10_6_3 = 751.21; - -const double NSFoundationVersionNumber10_6_4 = 751.29; - -const double NSFoundationVersionNumber10_6_5 = 751.42; - -const double NSFoundationVersionNumber10_6_6 = 751.53; - -const double NSFoundationVersionNumber10_6_7 = 751.53; - -const double NSFoundationVersionNumber10_6_8 = 751.62; - -const double NSFoundationVersionNumber10_7 = 833.1; - -const double NSFoundationVersionNumber10_7_1 = 833.1; - -const double NSFoundationVersionNumber10_7_2 = 833.2; - -const double NSFoundationVersionNumber10_7_3 = 833.24; - -const double NSFoundationVersionNumber10_7_4 = 833.25; - -const double NSFoundationVersionNumber10_8 = 945.0; - -const double NSFoundationVersionNumber10_8_1 = 945.0; - -const double NSFoundationVersionNumber10_8_2 = 945.11; - -const double NSFoundationVersionNumber10_8_3 = 945.16; - -const double NSFoundationVersionNumber10_8_4 = 945.18; - -const int NSFoundationVersionNumber10_9 = 1056; - -const int NSFoundationVersionNumber10_9_1 = 1056; - -const double NSFoundationVersionNumber10_9_2 = 1056.13; - -const double NSFoundationVersionNumber10_10 = 1151.16; - -const double NSFoundationVersionNumber10_10_1 = 1151.16; - -const double NSFoundationVersionNumber10_10_2 = 1152.14; - -const double NSFoundationVersionNumber10_10_3 = 1153.2; - -const double NSFoundationVersionNumber10_10_4 = 1153.2; - -const int NSFoundationVersionNumber10_10_5 = 1154; - -const int NSFoundationVersionNumber10_10_Max = 1199; - -const int NSFoundationVersionNumber10_11 = 1252; - -const double NSFoundationVersionNumber10_11_1 = 1255.1; - -const double NSFoundationVersionNumber10_11_2 = 1256.1; - -const double NSFoundationVersionNumber10_11_3 = 1256.1; - -const int NSFoundationVersionNumber10_11_4 = 1258; - -const int NSFoundationVersionNumber10_11_Max = 1299; - -const int __COREFOUNDATION_CFBASE__ = 1; - -const int TRUE = 1; - -const int FALSE = 0; - -const double kCFCoreFoundationVersionNumber10_0 = 196.4; - -const double kCFCoreFoundationVersionNumber10_0_3 = 196.5; - -const double kCFCoreFoundationVersionNumber10_1 = 226.0; - -const double kCFCoreFoundationVersionNumber10_1_1 = 226.0; - -const double kCFCoreFoundationVersionNumber10_1_2 = 227.2; - -const double kCFCoreFoundationVersionNumber10_1_3 = 227.2; - -const double kCFCoreFoundationVersionNumber10_1_4 = 227.3; - -const double kCFCoreFoundationVersionNumber10_2 = 263.0; - -const double kCFCoreFoundationVersionNumber10_2_1 = 263.1; - -const double kCFCoreFoundationVersionNumber10_2_2 = 263.1; - -const double kCFCoreFoundationVersionNumber10_2_3 = 263.3; - -const double kCFCoreFoundationVersionNumber10_2_4 = 263.3; - -const double kCFCoreFoundationVersionNumber10_2_5 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_6 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_7 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_8 = 263.5; - -const double kCFCoreFoundationVersionNumber10_3 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_1 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_2 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_3 = 299.3; - -const double kCFCoreFoundationVersionNumber10_3_4 = 299.31; - -const double kCFCoreFoundationVersionNumber10_3_5 = 299.31; - -const double kCFCoreFoundationVersionNumber10_3_6 = 299.32; - -const double kCFCoreFoundationVersionNumber10_3_7 = 299.33; - -const double kCFCoreFoundationVersionNumber10_3_8 = 299.33; - -const double kCFCoreFoundationVersionNumber10_3_9 = 299.35; - -const double kCFCoreFoundationVersionNumber10_4 = 368.0; - -const double kCFCoreFoundationVersionNumber10_4_1 = 368.1; - -const double kCFCoreFoundationVersionNumber10_4_2 = 368.11; - -const double kCFCoreFoundationVersionNumber10_4_3 = 368.18; - -const double kCFCoreFoundationVersionNumber10_4_4_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_4_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_5_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_5_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_6_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_6_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_7 = 368.27; - -const double kCFCoreFoundationVersionNumber10_4_8 = 368.27; - -const double kCFCoreFoundationVersionNumber10_4_9 = 368.28; - -const double kCFCoreFoundationVersionNumber10_4_10 = 368.28; - -const double kCFCoreFoundationVersionNumber10_4_11 = 368.31; - -const double kCFCoreFoundationVersionNumber10_5 = 476.0; - -const double kCFCoreFoundationVersionNumber10_5_1 = 476.0; - -const double kCFCoreFoundationVersionNumber10_5_2 = 476.1; - -const double kCFCoreFoundationVersionNumber10_5_3 = 476.13; - -const double kCFCoreFoundationVersionNumber10_5_4 = 476.14; - -const double kCFCoreFoundationVersionNumber10_5_5 = 476.15; - -const double kCFCoreFoundationVersionNumber10_5_6 = 476.17; - -const double kCFCoreFoundationVersionNumber10_5_7 = 476.18; - -const double kCFCoreFoundationVersionNumber10_5_8 = 476.19; - -const double kCFCoreFoundationVersionNumber10_6 = 550.0; - -const double kCFCoreFoundationVersionNumber10_6_1 = 550.0; - -const double kCFCoreFoundationVersionNumber10_6_2 = 550.13; - -const double kCFCoreFoundationVersionNumber10_6_3 = 550.19; - -const double kCFCoreFoundationVersionNumber10_6_4 = 550.29; - -const double kCFCoreFoundationVersionNumber10_6_5 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_6 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_7 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_8 = 550.43; - -const double kCFCoreFoundationVersionNumber10_7 = 635.0; - -const double kCFCoreFoundationVersionNumber10_7_1 = 635.0; - -const double kCFCoreFoundationVersionNumber10_7_2 = 635.15; - -const double kCFCoreFoundationVersionNumber10_7_3 = 635.19; - -const double kCFCoreFoundationVersionNumber10_7_4 = 635.21; - -const double kCFCoreFoundationVersionNumber10_7_5 = 635.21; - -const double kCFCoreFoundationVersionNumber10_8 = 744.0; - -const double kCFCoreFoundationVersionNumber10_8_1 = 744.0; - -const double kCFCoreFoundationVersionNumber10_8_2 = 744.12; - -const double kCFCoreFoundationVersionNumber10_8_3 = 744.18; - -const double kCFCoreFoundationVersionNumber10_8_4 = 744.19; - -const double kCFCoreFoundationVersionNumber10_9 = 855.11; - -const double kCFCoreFoundationVersionNumber10_9_1 = 855.11; - -const double kCFCoreFoundationVersionNumber10_9_2 = 855.14; - -const double kCFCoreFoundationVersionNumber10_10 = 1151.16; - -const double kCFCoreFoundationVersionNumber10_10_1 = 1151.16; - -const int kCFCoreFoundationVersionNumber10_10_2 = 1152; - -const double kCFCoreFoundationVersionNumber10_10_3 = 1153.18; - -const double kCFCoreFoundationVersionNumber10_10_4 = 1153.18; - -const double kCFCoreFoundationVersionNumber10_10_5 = 1153.18; - -const int kCFCoreFoundationVersionNumber10_10_Max = 1199; - -const int kCFCoreFoundationVersionNumber10_11 = 1253; - -const double kCFCoreFoundationVersionNumber10_11_1 = 1255.1; - -const double kCFCoreFoundationVersionNumber10_11_2 = 1256.14; - -const double kCFCoreFoundationVersionNumber10_11_3 = 1256.14; - -const double kCFCoreFoundationVersionNumber10_11_4 = 1258.1; - -const int kCFCoreFoundationVersionNumber10_11_Max = 1299; - -const int ISA_PTRAUTH_DISCRIMINATOR = 27361; diff --git a/pkgs/ffigen/test/native_objc_test/category_test.dart b/pkgs/ffigen/test/native_objc_test/category_test.dart index 9ad949d638..8d52f6fcc0 100644 --- a/pkgs/ffigen/test/native_objc_test/category_test.dart +++ b/pkgs/ffigen/test/native_objc_test/category_test.dart @@ -8,10 +8,7 @@ import 'dart:ffi'; import 'dart:io'; -import 'package:ffigen/ffigen.dart'; -import 'package:path/path.dart' as path; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart'; import '../test_utils.dart'; import 'category_bindings.dart'; @@ -28,29 +25,6 @@ void main() { testInstance = Thing.new1(lib); }); - test('generate_bindings', () { - final config = Config.fromYaml(loadYaml( - File(path.join('test', 'native_objc_test', 'category_config.yaml')) - .readAsStringSync()) as YamlMap); - final library = parse(config); - final file = File( - path.join('test', 'debug_generated', 'category_test.dart'), - ); - library.generateFile(file); - - try { - final actual = file.readAsStringSync(); - final expected = File(path.join(config.output)).readAsStringSync(); - expect(actual, expected); - if (file.existsSync()) { - file.delete(); - } - } catch (e) { - print('Failed test: Debug generated file: ${file.absolute.path}'); - rethrow; - } - }); - test('Category method', () { expect(testInstance.add_Y_(1000, 234), 1234); expect(testInstance.sub_Y_(1234, 1000), 234); diff --git a/pkgs/ffigen/test/native_objc_test/forward_decl_bindings.dart b/pkgs/ffigen/test/native_objc_test/forward_decl_bindings.dart deleted file mode 100644 index c9edf543be..0000000000 --- a/pkgs/ffigen/test/native_objc_test/forward_decl_bindings.dart +++ /dev/null @@ -1,1428 +0,0 @@ -// ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field - -// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; - -/// Test that forward declared ObjC classes are correctly filled -class ForwardDeclTestObjCLibrary { - /// Holds the symbol lookup function. - final ffi.Pointer Function(String symbolName) - _lookup; - - /// The symbols are looked up in [dynamicLibrary]. - ForwardDeclTestObjCLibrary(ffi.DynamicLibrary dynamicLibrary) - : _lookup = dynamicLibrary.lookup; - - /// The symbols are looked up with [lookup]. - ForwardDeclTestObjCLibrary.fromLookup( - ffi.Pointer Function(String symbolName) - lookup) - : _lookup = lookup; - - late final ffi.Pointer _NSFoundationVersionNumber = - _lookup('NSFoundationVersionNumber'); - - double get NSFoundationVersionNumber => _NSFoundationVersionNumber.value; - - set NSFoundationVersionNumber(double value) => - _NSFoundationVersionNumber.value = value; - - late final ffi.Pointer _NSNotFound = - _lookup('NSNotFound'); - - int get NSNotFound => _NSNotFound.value; - - set NSNotFound(int value) => _NSNotFound.value = value; - - late final ffi.Pointer _kCFCoreFoundationVersionNumber = - _lookup('kCFCoreFoundationVersionNumber'); - - double get kCFCoreFoundationVersionNumber => - _kCFCoreFoundationVersionNumber.value; - - set kCFCoreFoundationVersionNumber(double value) => - _kCFCoreFoundationVersionNumber.value = value; - - late final ffi.Pointer _kCFNotFound = - _lookup('kCFNotFound'); - - int get kCFNotFound => _kCFNotFound.value; - - set kCFNotFound(int value) => _kCFNotFound.value = value; - - late final ffi.Pointer _kCFNull = _lookup('kCFNull'); - - CFNullRef get kCFNull => _kCFNull.value; - - set kCFNull(CFNullRef value) => _kCFNull.value = value; - - late final ffi.Pointer _kCFAllocatorDefault = - _lookup('kCFAllocatorDefault'); - - CFAllocatorRef get kCFAllocatorDefault => _kCFAllocatorDefault.value; - - set kCFAllocatorDefault(CFAllocatorRef value) => - _kCFAllocatorDefault.value = value; - - late final ffi.Pointer _kCFAllocatorSystemDefault = - _lookup('kCFAllocatorSystemDefault'); - - CFAllocatorRef get kCFAllocatorSystemDefault => - _kCFAllocatorSystemDefault.value; - - set kCFAllocatorSystemDefault(CFAllocatorRef value) => - _kCFAllocatorSystemDefault.value = value; - - late final ffi.Pointer _kCFAllocatorMalloc = - _lookup('kCFAllocatorMalloc'); - - CFAllocatorRef get kCFAllocatorMalloc => _kCFAllocatorMalloc.value; - - set kCFAllocatorMalloc(CFAllocatorRef value) => - _kCFAllocatorMalloc.value = value; - - late final ffi.Pointer _kCFAllocatorMallocZone = - _lookup('kCFAllocatorMallocZone'); - - CFAllocatorRef get kCFAllocatorMallocZone => _kCFAllocatorMallocZone.value; - - set kCFAllocatorMallocZone(CFAllocatorRef value) => - _kCFAllocatorMallocZone.value = value; - - late final ffi.Pointer _kCFAllocatorNull = - _lookup('kCFAllocatorNull'); - - CFAllocatorRef get kCFAllocatorNull => _kCFAllocatorNull.value; - - set kCFAllocatorNull(CFAllocatorRef value) => _kCFAllocatorNull.value = value; - - late final ffi.Pointer _kCFAllocatorUseContext = - _lookup('kCFAllocatorUseContext'); - - CFAllocatorRef get kCFAllocatorUseContext => _kCFAllocatorUseContext.value; - - set kCFAllocatorUseContext(CFAllocatorRef value) => - _kCFAllocatorUseContext.value = value; - - ffi.Pointer _registerName1(String name) { - final cstr = name.toNativeUtf8(); - final sel = _sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; - } - - ffi.Pointer _sel_registerName( - ffi.Pointer str, - ) { - return __sel_registerName( - str, - ); - } - - late final __sel_registerNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sel_registerName'); - late final __sel_registerName = __sel_registerNamePtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _getClass1(String name) { - final cstr = name.toNativeUtf8(); - final clazz = _objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return clazz; - } - - ffi.Pointer _objc_getClass( - ffi.Pointer str, - ) { - return __objc_getClass( - str, - ); - } - - late final __objc_getClassPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('objc_getClass'); - late final __objc_getClass = __objc_getClassPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); - late final ffi.Pointer _sel_load1 = _registerName1("load"); - void _objc_msgSend_0( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_0( - obj, - sel, - ); - } - - late final __objc_msgSend_0Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_initialize1 = - _registerName1("initialize"); - late final ffi.Pointer _sel_init1 = _registerName1("init"); - instancetype _objc_msgSend_1( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1( - obj, - sel, - ); - } - - late final __objc_msgSend_1Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_new1 = _registerName1("new"); - late final ffi.Pointer _sel_allocWithZone_1 = - _registerName1("allocWithZone:"); - instancetype _objc_msgSend_2( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_2( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_2Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>(); - - late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); - late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); - late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); - late final ffi.Pointer _sel_copy1 = _registerName1("copy"); - late final ffi.Pointer _sel_mutableCopy1 = - _registerName1("mutableCopy"); - late final ffi.Pointer _sel_copyWithZone_1 = - _registerName1("copyWithZone:"); - late final ffi.Pointer _sel_mutableCopyWithZone_1 = - _registerName1("mutableCopyWithZone:"); - late final ffi.Pointer _sel_instancesRespondToSelector_1 = - _registerName1("instancesRespondToSelector:"); - bool _objc_msgSend_3( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_3( - obj, - sel, - aSelector, - ) != - 0; - } - - late final __objc_msgSend_3Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_conformsToProtocol_1 = - _registerName1("conformsToProtocol:"); - bool _objc_msgSend_4( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer protocol, - ) { - return __objc_msgSend_4( - obj, - sel, - protocol, - ) != - 0; - } - - late final __objc_msgSend_4Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_methodForSelector_1 = - _registerName1("methodForSelector:"); - IMP _objc_msgSend_5( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_5( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_5Ptr = _lookup< - ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodForSelector_1 = - _registerName1("instanceMethodForSelector:"); - late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = - _registerName1("doesNotRecognizeSelector:"); - void _objc_msgSend_6( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_6( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_6Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardingTargetForSelector_1 = - _registerName1("forwardingTargetForSelector:"); - ffi.Pointer _objc_msgSend_7( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_7( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_7Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardInvocation_1 = - _registerName1("forwardInvocation:"); - void _objc_msgSend_8( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anInvocation, - ) { - return __objc_msgSend_8( - obj, - sel, - anInvocation, - ); - } - - late final __objc_msgSend_8Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _class_NSMethodSignature1 = - _getClass1("NSMethodSignature"); - late final ffi.Pointer _sel_methodSignatureForSelector_1 = - _registerName1("methodSignatureForSelector:"); - ffi.Pointer _objc_msgSend_9( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_9( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_9Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = - _registerName1("instanceMethodSignatureForSelector:"); - late final ffi.Pointer _sel_allowsWeakReference1 = - _registerName1("allowsWeakReference"); - bool _objc_msgSend_10( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_10( - obj, - sel, - ) != - 0; - } - - late final __objc_msgSend_10Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_retainWeakReference1 = - _registerName1("retainWeakReference"); - late final ffi.Pointer _sel_isSubclassOfClass_1 = - _registerName1("isSubclassOfClass:"); - late final ffi.Pointer _sel_resolveClassMethod_1 = - _registerName1("resolveClassMethod:"); - late final ffi.Pointer _sel_resolveInstanceMethod_1 = - _registerName1("resolveInstanceMethod:"); - late final ffi.Pointer _sel_hash1 = _registerName1("hash"); - int _objc_msgSend_11( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_11( - obj, - sel, - ); - } - - late final __objc_msgSend_11Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_superclass1 = - _registerName1("superclass"); - late final ffi.Pointer _sel_class1 = _registerName1("class"); - late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); - late final ffi.Pointer _sel_stringWithCString_encoding_1 = - _registerName1("stringWithCString:encoding:"); - ffi.Pointer _objc_msgSend_12( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cString, - int enc, - ) { - return __objc_msgSend_12( - obj, - sel, - cString, - enc, - ); - } - - late final __objc_msgSend_12Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_UTF8String1 = - _registerName1("UTF8String"); - ffi.Pointer _objc_msgSend_13( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_13( - obj, - sel, - ); - } - - late final __objc_msgSend_13Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_description1 = - _registerName1("description"); - ffi.Pointer _objc_msgSend_14( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_14( - obj, - sel, - ); - } - - late final __objc_msgSend_14Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_debugDescription1 = - _registerName1("debugDescription"); - late final ffi.Pointer _sel_version1 = _registerName1("version"); - int _objc_msgSend_15( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_15( - obj, - sel, - ); - } - - late final __objc_msgSend_15Ptr = _lookup< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_setVersion_1 = - _registerName1("setVersion:"); - void _objc_msgSend_16( - ffi.Pointer obj, - ffi.Pointer sel, - int aVersion, - ) { - return __objc_msgSend_16( - obj, - sel, - aVersion, - ); - } - - late final __objc_msgSend_16Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_classForCoder1 = - _registerName1("classForCoder"); - late final ffi.Pointer _sel_replacementObjectForCoder_1 = - _registerName1("replacementObjectForCoder:"); - ffi.Pointer _objc_msgSend_17( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_17( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_17Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = - _registerName1("awakeAfterUsingCoder:"); - late final ffi.Pointer _sel_poseAsClass_1 = - _registerName1("poseAsClass:"); - late final ffi.Pointer _sel_autoContentAccessingProxy1 = - _registerName1("autoContentAccessingProxy"); - late final ffi.Pointer _class_OtherClass1 = - _getClass1("OtherClass"); - late final ffi.Pointer _class_ForwardDeclaredClass1 = - _getClass1("ForwardDeclaredClass"); - late final ffi.Pointer _sel_get1231 = _registerName1("get123"); - int _objc_msgSend_18( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_18( - obj, - sel, - ); - } - - late final __objc_msgSend_18Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_getTheThing1 = - _registerName1("getTheThing"); - ffi.Pointer _objc_msgSend_19( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_19( - obj, - sel, - ); - } - - late final __objc_msgSend_19Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); -} - -abstract class NSComparisonResult { - static const int NSOrderedAscending = -1; - static const int NSOrderedSame = 0; - static const int NSOrderedDescending = 1; -} - -abstract class NSEnumerationOptions { - static const int NSEnumerationConcurrent = 1; - static const int NSEnumerationReverse = 2; -} - -abstract class NSSortOptions { - static const int NSSortConcurrent = 1; - static const int NSSortStable = 16; -} - -abstract class NSQualityOfService { - static const int NSQualityOfServiceUserInteractive = 33; - static const int NSQualityOfServiceUserInitiated = 25; - static const int NSQualityOfServiceUtility = 17; - static const int NSQualityOfServiceBackground = 9; - static const int NSQualityOfServiceDefault = -1; -} - -typedef NSInteger = pkg_ffi.Long; - -class __CFString extends ffi.Opaque {} - -abstract class CFComparisonResult { - static const int kCFCompareLessThan = -1; - static const int kCFCompareEqualTo = 0; - static const int kCFCompareGreaterThan = 1; -} - -typedef CFIndex = pkg_ffi.Long; - -class CFRange extends ffi.Struct { - @CFIndex() - external int location; - - @CFIndex() - external int length; -} - -class __CFNull extends ffi.Opaque {} - -typedef CFNullRef = ffi.Pointer<__CFNull>; - -class __CFAllocator extends ffi.Opaque {} - -typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; - -class CFAllocatorContext extends ffi.Struct { - @CFIndex() - external int version; - - external ffi.Pointer info; - - external CFAllocatorRetainCallBack retain; - - external CFAllocatorReleaseCallBack release; - - external CFAllocatorCopyDescriptionCallBack copyDescription; - - external CFAllocatorAllocateCallBack allocate; - - external CFAllocatorReallocateCallBack reallocate; - - external CFAllocatorDeallocateCallBack deallocate; - - external CFAllocatorPreferredSizeCallBack preferredSize; -} - -typedef CFAllocatorRetainCallBack = ffi.Pointer< - ffi.NativeFunction Function(ffi.Pointer)>>; -typedef CFAllocatorReleaseCallBack - = ffi.Pointer)>>; -typedef CFAllocatorCopyDescriptionCallBack = ffi - .Pointer)>>; -typedef CFStringRef = ffi.Pointer<__CFString>; -typedef CFAllocatorAllocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - CFIndex, CFOptionFlags, ffi.Pointer)>>; -typedef CFOptionFlags = pkg_ffi.UnsignedLong; -typedef CFAllocatorReallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, CFIndex, - CFOptionFlags, ffi.Pointer)>>; -typedef CFAllocatorDeallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; -typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< - ffi.NativeFunction< - CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; - -class _ObjCWrapper { - final ffi.Pointer _id; - final ForwardDeclTestObjCLibrary _lib; - - _ObjCWrapper._(this._id, this._lib); - - @override - bool operator ==(Object other) { - return other is _ObjCWrapper && _id == other._id; - } - - @override - int get hashCode => _id.hashCode; -} - -class NSObject extends _ObjCWrapper { - NSObject._(ffi.Pointer id, ForwardDeclTestObjCLibrary lib) - : super._(id, lib); - - static NSObject castFrom(T other) { - return NSObject._(other._id, other._lib); - } - - static NSObject castFromPointer( - ForwardDeclTestObjCLibrary lib, ffi.Pointer other) { - return NSObject._(other, lib); - } - - static void load(ForwardDeclTestObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); - } - - static void initialize(ForwardDeclTestObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); - } - - NSObject init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSObject._(_ret, _lib); - } - - static NSObject new1(ForwardDeclTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); - return NSObject._(_ret, _lib); - } - - static NSObject allocWithZone_( - ForwardDeclTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject alloc(ForwardDeclTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); - return NSObject._(_ret, _lib); - } - - void dealloc() { - _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); - } - - void finalize() { - _lib._objc_msgSend_0(_id, _lib._sel_finalize1); - } - - NSObject copy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); - return NSObject._(_ret, _lib); - } - - NSObject mutableCopy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); - return NSObject._(_ret, _lib); - } - - static NSObject copyWithZone_( - ForwardDeclTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject mutableCopyWithZone_( - ForwardDeclTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static bool instancesRespondToSelector_( - ForwardDeclTestObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_3(_lib._class_NSObject1, - _lib._sel_instancesRespondToSelector_1, aSelector); - } - - static bool conformsToProtocol_( - ForwardDeclTestObjCLibrary _lib, NSObject? protocol) { - return _lib._objc_msgSend_4(_lib._class_NSObject1, - _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); - } - - IMP methodForSelector_(ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); - } - - static IMP instanceMethodForSelector_( - ForwardDeclTestObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_lib._class_NSObject1, - _lib._sel_instanceMethodForSelector_1, aSelector); - } - - void doesNotRecognizeSelector_(ffi.Pointer aSelector) { - _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); - } - - NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_7( - _id, _lib._sel_forwardingTargetForSelector_1, aSelector); - return NSObject._(_ret, _lib); - } - - void forwardInvocation_(NSObject? anInvocation) { - _lib._objc_msgSend_8( - _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); - } - - NSMethodSignature methodSignatureForSelector_( - ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9( - _id, _lib._sel_methodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - static NSMethodSignature instanceMethodSignatureForSelector_( - ForwardDeclTestObjCLibrary _lib, ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, - _lib._sel_instanceMethodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - bool allowsWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); - } - - bool retainWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); - } - - static bool isSubclassOfClass_( - ForwardDeclTestObjCLibrary _lib, NSObject aClass) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); - } - - static bool resolveClassMethod_( - ForwardDeclTestObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); - } - - static bool resolveInstanceMethod_( - ForwardDeclTestObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); - } - - static int hash(ForwardDeclTestObjCLibrary _lib) { - return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); - } - - static NSObject superclass(ForwardDeclTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); - return NSObject._(_ret, _lib); - } - - static NSObject class1(ForwardDeclTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); - return NSObject._(_ret, _lib); - } - - static NSString description(ForwardDeclTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_14(_lib._class_NSObject1, _lib._sel_description1); - return NSString._(_ret, _lib); - } - - static NSString debugDescription(ForwardDeclTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_14( - _lib._class_NSObject1, _lib._sel_debugDescription1); - return NSString._(_ret, _lib); - } - - static int version(ForwardDeclTestObjCLibrary _lib) { - return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); - } - - static void setVersion_(ForwardDeclTestObjCLibrary _lib, int aVersion) { - _lib._objc_msgSend_16( - _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); - } - - NSObject get classForCoder { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); - return NSObject._(_ret, _lib); - } - - NSObject replacementObjectForCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - NSObject awakeAfterUsingCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static void poseAsClass_(ForwardDeclTestObjCLibrary _lib, NSObject aClass) { - _lib._objc_msgSend_8( - _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); - } - - NSObject get autoContentAccessingProxy { - final _ret = - _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); - return NSObject._(_ret, _lib); - } -} - -class ObjCSel extends ffi.Opaque {} - -class ObjCObject extends ffi.Opaque {} - -typedef instancetype = ffi.Pointer; - -class _NSZone extends ffi.Opaque {} - -typedef IMP = ffi.Pointer>; - -class NSMethodSignature extends _ObjCWrapper { - NSMethodSignature._( - ffi.Pointer id, ForwardDeclTestObjCLibrary lib) - : super._(id, lib); - - static NSMethodSignature castFrom(T other) { - return NSMethodSignature._(other._id, other._lib); - } - - static NSMethodSignature castFromPointer( - ForwardDeclTestObjCLibrary lib, ffi.Pointer other) { - return NSMethodSignature._(other, lib); - } -} - -typedef NSUInteger = pkg_ffi.UnsignedLong; - -class NSString extends _ObjCWrapper { - NSString._(ffi.Pointer id, ForwardDeclTestObjCLibrary lib) - : super._(id, lib); - - static NSString castFrom(T other) { - return NSString._(other._id, other._lib); - } - - static NSString castFromPointer( - ForwardDeclTestObjCLibrary lib, ffi.Pointer other) { - return NSString._(other, lib); - } - - factory NSString(ForwardDeclTestObjCLibrary _lib, String str) { - final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); - pkg_ffi.calloc.free(cstr); - return nsstr; - } - - @override - String toString() => (UTF8String).cast().toDartString(); - - static NSString stringWithCString_encoding_(ForwardDeclTestObjCLibrary _lib, - ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return NSString._(_ret, _lib); - } - - ffi.Pointer get UTF8String { - return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); - } -} - -extension StringToNSString on String { - NSString toNSString(ForwardDeclTestObjCLibrary lib) => NSString(lib, this); -} - -class OtherClass extends NSObject { - OtherClass._(ffi.Pointer id, ForwardDeclTestObjCLibrary lib) - : super._(id, lib); - - static OtherClass castFrom(T other) { - return OtherClass._(other._id, other._lib); - } - - static OtherClass castFromPointer( - ForwardDeclTestObjCLibrary lib, ffi.Pointer other) { - return OtherClass._(other, lib); - } - - static ForwardDeclaredClass getTheThing(ForwardDeclTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_19(_lib._class_OtherClass1, _lib._sel_getTheThing1); - return ForwardDeclaredClass._(_ret, _lib); - } - - static OtherClass new1(ForwardDeclTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_OtherClass1, _lib._sel_new1); - return OtherClass._(_ret, _lib); - } - - static OtherClass alloc(ForwardDeclTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_OtherClass1, _lib._sel_alloc1); - return OtherClass._(_ret, _lib); - } -} - -class ForwardDeclaredClass extends NSObject { - ForwardDeclaredClass._( - ffi.Pointer id, ForwardDeclTestObjCLibrary lib) - : super._(id, lib); - - static ForwardDeclaredClass castFrom(T other) { - return ForwardDeclaredClass._(other._id, other._lib); - } - - static ForwardDeclaredClass castFromPointer( - ForwardDeclTestObjCLibrary lib, ffi.Pointer other) { - return ForwardDeclaredClass._(other, lib); - } - - static int get123(ForwardDeclTestObjCLibrary _lib) { - return _lib._objc_msgSend_18( - _lib._class_ForwardDeclaredClass1, _lib._sel_get1231); - } - - static ForwardDeclaredClass new1(ForwardDeclTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_ForwardDeclaredClass1, _lib._sel_new1); - return ForwardDeclaredClass._(_ret, _lib); - } - - static ForwardDeclaredClass alloc(ForwardDeclTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1( - _lib._class_ForwardDeclaredClass1, _lib._sel_alloc1); - return ForwardDeclaredClass._(_ret, _lib); - } -} - -const int NSScannedOption = 1; - -const int NSCollectorDisabledOption = 2; - -const int NS_BLOCKS_AVAILABLE = 1; - -const int __COREFOUNDATION_CFAVAILABILITY__ = 1; - -const int __CF_ENUM_FIXED_IS_AVAILABLE = 1; - -const double NSFoundationVersionNumber10_0 = 397.4; - -const double NSFoundationVersionNumber10_1 = 425.0; - -const double NSFoundationVersionNumber10_1_1 = 425.0; - -const double NSFoundationVersionNumber10_1_2 = 425.0; - -const double NSFoundationVersionNumber10_1_3 = 425.0; - -const double NSFoundationVersionNumber10_1_4 = 425.0; - -const double NSFoundationVersionNumber10_2 = 462.0; - -const double NSFoundationVersionNumber10_2_1 = 462.0; - -const double NSFoundationVersionNumber10_2_2 = 462.0; - -const double NSFoundationVersionNumber10_2_3 = 462.0; - -const double NSFoundationVersionNumber10_2_4 = 462.0; - -const double NSFoundationVersionNumber10_2_5 = 462.0; - -const double NSFoundationVersionNumber10_2_6 = 462.0; - -const double NSFoundationVersionNumber10_2_7 = 462.7; - -const double NSFoundationVersionNumber10_2_8 = 462.7; - -const double NSFoundationVersionNumber10_3 = 500.0; - -const double NSFoundationVersionNumber10_3_1 = 500.0; - -const double NSFoundationVersionNumber10_3_2 = 500.3; - -const double NSFoundationVersionNumber10_3_3 = 500.54; - -const double NSFoundationVersionNumber10_3_4 = 500.56; - -const double NSFoundationVersionNumber10_3_5 = 500.56; - -const double NSFoundationVersionNumber10_3_6 = 500.56; - -const double NSFoundationVersionNumber10_3_7 = 500.56; - -const double NSFoundationVersionNumber10_3_8 = 500.56; - -const double NSFoundationVersionNumber10_3_9 = 500.58; - -const double NSFoundationVersionNumber10_4 = 567.0; - -const double NSFoundationVersionNumber10_4_1 = 567.0; - -const double NSFoundationVersionNumber10_4_2 = 567.12; - -const double NSFoundationVersionNumber10_4_3 = 567.21; - -const double NSFoundationVersionNumber10_4_4_Intel = 567.23; - -const double NSFoundationVersionNumber10_4_4_PowerPC = 567.21; - -const double NSFoundationVersionNumber10_4_5 = 567.25; - -const double NSFoundationVersionNumber10_4_6 = 567.26; - -const double NSFoundationVersionNumber10_4_7 = 567.27; - -const double NSFoundationVersionNumber10_4_8 = 567.28; - -const double NSFoundationVersionNumber10_4_9 = 567.29; - -const double NSFoundationVersionNumber10_4_10 = 567.29; - -const double NSFoundationVersionNumber10_4_11 = 567.36; - -const double NSFoundationVersionNumber10_5 = 677.0; - -const double NSFoundationVersionNumber10_5_1 = 677.1; - -const double NSFoundationVersionNumber10_5_2 = 677.15; - -const double NSFoundationVersionNumber10_5_3 = 677.19; - -const double NSFoundationVersionNumber10_5_4 = 677.19; - -const double NSFoundationVersionNumber10_5_5 = 677.21; - -const double NSFoundationVersionNumber10_5_6 = 677.22; - -const double NSFoundationVersionNumber10_5_7 = 677.24; - -const double NSFoundationVersionNumber10_5_8 = 677.26; - -const double NSFoundationVersionNumber10_6 = 751.0; - -const double NSFoundationVersionNumber10_6_1 = 751.0; - -const double NSFoundationVersionNumber10_6_2 = 751.14; - -const double NSFoundationVersionNumber10_6_3 = 751.21; - -const double NSFoundationVersionNumber10_6_4 = 751.29; - -const double NSFoundationVersionNumber10_6_5 = 751.42; - -const double NSFoundationVersionNumber10_6_6 = 751.53; - -const double NSFoundationVersionNumber10_6_7 = 751.53; - -const double NSFoundationVersionNumber10_6_8 = 751.62; - -const double NSFoundationVersionNumber10_7 = 833.1; - -const double NSFoundationVersionNumber10_7_1 = 833.1; - -const double NSFoundationVersionNumber10_7_2 = 833.2; - -const double NSFoundationVersionNumber10_7_3 = 833.24; - -const double NSFoundationVersionNumber10_7_4 = 833.25; - -const double NSFoundationVersionNumber10_8 = 945.0; - -const double NSFoundationVersionNumber10_8_1 = 945.0; - -const double NSFoundationVersionNumber10_8_2 = 945.11; - -const double NSFoundationVersionNumber10_8_3 = 945.16; - -const double NSFoundationVersionNumber10_8_4 = 945.18; - -const int NSFoundationVersionNumber10_9 = 1056; - -const int NSFoundationVersionNumber10_9_1 = 1056; - -const double NSFoundationVersionNumber10_9_2 = 1056.13; - -const double NSFoundationVersionNumber10_10 = 1151.16; - -const double NSFoundationVersionNumber10_10_1 = 1151.16; - -const double NSFoundationVersionNumber10_10_2 = 1152.14; - -const double NSFoundationVersionNumber10_10_3 = 1153.2; - -const double NSFoundationVersionNumber10_10_4 = 1153.2; - -const int NSFoundationVersionNumber10_10_5 = 1154; - -const int NSFoundationVersionNumber10_10_Max = 1199; - -const int NSFoundationVersionNumber10_11 = 1252; - -const double NSFoundationVersionNumber10_11_1 = 1255.1; - -const double NSFoundationVersionNumber10_11_2 = 1256.1; - -const double NSFoundationVersionNumber10_11_3 = 1256.1; - -const int NSFoundationVersionNumber10_11_4 = 1258; - -const int NSFoundationVersionNumber10_11_Max = 1299; - -const int __COREFOUNDATION_CFBASE__ = 1; - -const int TRUE = 1; - -const int FALSE = 0; - -const double kCFCoreFoundationVersionNumber10_0 = 196.4; - -const double kCFCoreFoundationVersionNumber10_0_3 = 196.5; - -const double kCFCoreFoundationVersionNumber10_1 = 226.0; - -const double kCFCoreFoundationVersionNumber10_1_1 = 226.0; - -const double kCFCoreFoundationVersionNumber10_1_2 = 227.2; - -const double kCFCoreFoundationVersionNumber10_1_3 = 227.2; - -const double kCFCoreFoundationVersionNumber10_1_4 = 227.3; - -const double kCFCoreFoundationVersionNumber10_2 = 263.0; - -const double kCFCoreFoundationVersionNumber10_2_1 = 263.1; - -const double kCFCoreFoundationVersionNumber10_2_2 = 263.1; - -const double kCFCoreFoundationVersionNumber10_2_3 = 263.3; - -const double kCFCoreFoundationVersionNumber10_2_4 = 263.3; - -const double kCFCoreFoundationVersionNumber10_2_5 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_6 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_7 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_8 = 263.5; - -const double kCFCoreFoundationVersionNumber10_3 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_1 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_2 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_3 = 299.3; - -const double kCFCoreFoundationVersionNumber10_3_4 = 299.31; - -const double kCFCoreFoundationVersionNumber10_3_5 = 299.31; - -const double kCFCoreFoundationVersionNumber10_3_6 = 299.32; - -const double kCFCoreFoundationVersionNumber10_3_7 = 299.33; - -const double kCFCoreFoundationVersionNumber10_3_8 = 299.33; - -const double kCFCoreFoundationVersionNumber10_3_9 = 299.35; - -const double kCFCoreFoundationVersionNumber10_4 = 368.0; - -const double kCFCoreFoundationVersionNumber10_4_1 = 368.1; - -const double kCFCoreFoundationVersionNumber10_4_2 = 368.11; - -const double kCFCoreFoundationVersionNumber10_4_3 = 368.18; - -const double kCFCoreFoundationVersionNumber10_4_4_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_4_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_5_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_5_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_6_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_6_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_7 = 368.27; - -const double kCFCoreFoundationVersionNumber10_4_8 = 368.27; - -const double kCFCoreFoundationVersionNumber10_4_9 = 368.28; - -const double kCFCoreFoundationVersionNumber10_4_10 = 368.28; - -const double kCFCoreFoundationVersionNumber10_4_11 = 368.31; - -const double kCFCoreFoundationVersionNumber10_5 = 476.0; - -const double kCFCoreFoundationVersionNumber10_5_1 = 476.0; - -const double kCFCoreFoundationVersionNumber10_5_2 = 476.1; - -const double kCFCoreFoundationVersionNumber10_5_3 = 476.13; - -const double kCFCoreFoundationVersionNumber10_5_4 = 476.14; - -const double kCFCoreFoundationVersionNumber10_5_5 = 476.15; - -const double kCFCoreFoundationVersionNumber10_5_6 = 476.17; - -const double kCFCoreFoundationVersionNumber10_5_7 = 476.18; - -const double kCFCoreFoundationVersionNumber10_5_8 = 476.19; - -const double kCFCoreFoundationVersionNumber10_6 = 550.0; - -const double kCFCoreFoundationVersionNumber10_6_1 = 550.0; - -const double kCFCoreFoundationVersionNumber10_6_2 = 550.13; - -const double kCFCoreFoundationVersionNumber10_6_3 = 550.19; - -const double kCFCoreFoundationVersionNumber10_6_4 = 550.29; - -const double kCFCoreFoundationVersionNumber10_6_5 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_6 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_7 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_8 = 550.43; - -const double kCFCoreFoundationVersionNumber10_7 = 635.0; - -const double kCFCoreFoundationVersionNumber10_7_1 = 635.0; - -const double kCFCoreFoundationVersionNumber10_7_2 = 635.15; - -const double kCFCoreFoundationVersionNumber10_7_3 = 635.19; - -const double kCFCoreFoundationVersionNumber10_7_4 = 635.21; - -const double kCFCoreFoundationVersionNumber10_7_5 = 635.21; - -const double kCFCoreFoundationVersionNumber10_8 = 744.0; - -const double kCFCoreFoundationVersionNumber10_8_1 = 744.0; - -const double kCFCoreFoundationVersionNumber10_8_2 = 744.12; - -const double kCFCoreFoundationVersionNumber10_8_3 = 744.18; - -const double kCFCoreFoundationVersionNumber10_8_4 = 744.19; - -const double kCFCoreFoundationVersionNumber10_9 = 855.11; - -const double kCFCoreFoundationVersionNumber10_9_1 = 855.11; - -const double kCFCoreFoundationVersionNumber10_9_2 = 855.14; - -const double kCFCoreFoundationVersionNumber10_10 = 1151.16; - -const double kCFCoreFoundationVersionNumber10_10_1 = 1151.16; - -const int kCFCoreFoundationVersionNumber10_10_2 = 1152; - -const double kCFCoreFoundationVersionNumber10_10_3 = 1153.18; - -const double kCFCoreFoundationVersionNumber10_10_4 = 1153.18; - -const double kCFCoreFoundationVersionNumber10_10_5 = 1153.18; - -const int kCFCoreFoundationVersionNumber10_10_Max = 1199; - -const int kCFCoreFoundationVersionNumber10_11 = 1253; - -const double kCFCoreFoundationVersionNumber10_11_1 = 1255.1; - -const double kCFCoreFoundationVersionNumber10_11_2 = 1256.14; - -const double kCFCoreFoundationVersionNumber10_11_3 = 1256.14; - -const double kCFCoreFoundationVersionNumber10_11_4 = 1258.1; - -const int kCFCoreFoundationVersionNumber10_11_Max = 1299; - -const int ISA_PTRAUTH_DISCRIMINATOR = 27361; diff --git a/pkgs/ffigen/test/native_objc_test/forward_decl_test.dart b/pkgs/ffigen/test/native_objc_test/forward_decl_test.dart index 41b71810d5..197171e88d 100644 --- a/pkgs/ffigen/test/native_objc_test/forward_decl_test.dart +++ b/pkgs/ffigen/test/native_objc_test/forward_decl_test.dart @@ -8,10 +8,7 @@ import 'dart:ffi'; import 'dart:io'; -import 'package:ffigen/ffigen.dart'; -import 'package:path/path.dart' as path; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart'; import '../test_utils.dart'; import 'forward_decl_bindings.dart'; @@ -27,29 +24,6 @@ void main() { ForwardDeclTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); }); - test('generate_bindings', () { - final config = Config.fromYaml(loadYaml(File( - path.join('test', 'native_objc_test', 'forward_decl_config.yaml')) - .readAsStringSync()) as YamlMap); - final library = parse(config); - final file = File( - path.join('test', 'debug_generated', 'forward_decl_test.dart'), - ); - library.generateFile(file); - - try { - final actual = file.readAsStringSync(); - final expected = File(path.join(config.output)).readAsStringSync(); - expect(actual, expected); - if (file.existsSync()) { - file.delete(); - } - } catch (e) { - print('Failed test: Debug generated file: ${file.absolute.path}'); - rethrow; - } - }); - test('Forward declared class', () { expect(ForwardDeclaredClass.get123(lib), 123); }); diff --git a/pkgs/ffigen/test/native_objc_test/method_bindings.dart b/pkgs/ffigen/test/native_objc_test/method_bindings.dart deleted file mode 100644 index 2a8ac1fd5b..0000000000 --- a/pkgs/ffigen/test/native_objc_test/method_bindings.dart +++ /dev/null @@ -1,1474 +0,0 @@ -// ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field - -// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; - -/// Tests calling Objective-C methods -class MethodTestObjCLibrary { - /// Holds the symbol lookup function. - final ffi.Pointer Function(String symbolName) - _lookup; - - /// The symbols are looked up in [dynamicLibrary]. - MethodTestObjCLibrary(ffi.DynamicLibrary dynamicLibrary) - : _lookup = dynamicLibrary.lookup; - - /// The symbols are looked up with [lookup]. - MethodTestObjCLibrary.fromLookup( - ffi.Pointer Function(String symbolName) - lookup) - : _lookup = lookup; - - late final ffi.Pointer _NSFoundationVersionNumber = - _lookup('NSFoundationVersionNumber'); - - double get NSFoundationVersionNumber => _NSFoundationVersionNumber.value; - - set NSFoundationVersionNumber(double value) => - _NSFoundationVersionNumber.value = value; - - late final ffi.Pointer _NSNotFound = - _lookup('NSNotFound'); - - int get NSNotFound => _NSNotFound.value; - - set NSNotFound(int value) => _NSNotFound.value = value; - - late final ffi.Pointer _kCFCoreFoundationVersionNumber = - _lookup('kCFCoreFoundationVersionNumber'); - - double get kCFCoreFoundationVersionNumber => - _kCFCoreFoundationVersionNumber.value; - - set kCFCoreFoundationVersionNumber(double value) => - _kCFCoreFoundationVersionNumber.value = value; - - late final ffi.Pointer _kCFNotFound = - _lookup('kCFNotFound'); - - int get kCFNotFound => _kCFNotFound.value; - - set kCFNotFound(int value) => _kCFNotFound.value = value; - - late final ffi.Pointer _kCFNull = _lookup('kCFNull'); - - CFNullRef get kCFNull => _kCFNull.value; - - set kCFNull(CFNullRef value) => _kCFNull.value = value; - - late final ffi.Pointer _kCFAllocatorDefault = - _lookup('kCFAllocatorDefault'); - - CFAllocatorRef get kCFAllocatorDefault => _kCFAllocatorDefault.value; - - set kCFAllocatorDefault(CFAllocatorRef value) => - _kCFAllocatorDefault.value = value; - - late final ffi.Pointer _kCFAllocatorSystemDefault = - _lookup('kCFAllocatorSystemDefault'); - - CFAllocatorRef get kCFAllocatorSystemDefault => - _kCFAllocatorSystemDefault.value; - - set kCFAllocatorSystemDefault(CFAllocatorRef value) => - _kCFAllocatorSystemDefault.value = value; - - late final ffi.Pointer _kCFAllocatorMalloc = - _lookup('kCFAllocatorMalloc'); - - CFAllocatorRef get kCFAllocatorMalloc => _kCFAllocatorMalloc.value; - - set kCFAllocatorMalloc(CFAllocatorRef value) => - _kCFAllocatorMalloc.value = value; - - late final ffi.Pointer _kCFAllocatorMallocZone = - _lookup('kCFAllocatorMallocZone'); - - CFAllocatorRef get kCFAllocatorMallocZone => _kCFAllocatorMallocZone.value; - - set kCFAllocatorMallocZone(CFAllocatorRef value) => - _kCFAllocatorMallocZone.value = value; - - late final ffi.Pointer _kCFAllocatorNull = - _lookup('kCFAllocatorNull'); - - CFAllocatorRef get kCFAllocatorNull => _kCFAllocatorNull.value; - - set kCFAllocatorNull(CFAllocatorRef value) => _kCFAllocatorNull.value = value; - - late final ffi.Pointer _kCFAllocatorUseContext = - _lookup('kCFAllocatorUseContext'); - - CFAllocatorRef get kCFAllocatorUseContext => _kCFAllocatorUseContext.value; - - set kCFAllocatorUseContext(CFAllocatorRef value) => - _kCFAllocatorUseContext.value = value; - - ffi.Pointer _registerName1(String name) { - final cstr = name.toNativeUtf8(); - final sel = _sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; - } - - ffi.Pointer _sel_registerName( - ffi.Pointer str, - ) { - return __sel_registerName( - str, - ); - } - - late final __sel_registerNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sel_registerName'); - late final __sel_registerName = __sel_registerNamePtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _getClass1(String name) { - final cstr = name.toNativeUtf8(); - final clazz = _objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return clazz; - } - - ffi.Pointer _objc_getClass( - ffi.Pointer str, - ) { - return __objc_getClass( - str, - ); - } - - late final __objc_getClassPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('objc_getClass'); - late final __objc_getClass = __objc_getClassPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); - late final ffi.Pointer _sel_load1 = _registerName1("load"); - void _objc_msgSend_0( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_0( - obj, - sel, - ); - } - - late final __objc_msgSend_0Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_initialize1 = - _registerName1("initialize"); - late final ffi.Pointer _sel_init1 = _registerName1("init"); - instancetype _objc_msgSend_1( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1( - obj, - sel, - ); - } - - late final __objc_msgSend_1Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_new1 = _registerName1("new"); - late final ffi.Pointer _sel_allocWithZone_1 = - _registerName1("allocWithZone:"); - instancetype _objc_msgSend_2( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_2( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_2Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>(); - - late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); - late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); - late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); - late final ffi.Pointer _sel_copy1 = _registerName1("copy"); - late final ffi.Pointer _sel_mutableCopy1 = - _registerName1("mutableCopy"); - late final ffi.Pointer _sel_copyWithZone_1 = - _registerName1("copyWithZone:"); - late final ffi.Pointer _sel_mutableCopyWithZone_1 = - _registerName1("mutableCopyWithZone:"); - late final ffi.Pointer _sel_instancesRespondToSelector_1 = - _registerName1("instancesRespondToSelector:"); - bool _objc_msgSend_3( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_3( - obj, - sel, - aSelector, - ) != - 0; - } - - late final __objc_msgSend_3Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_conformsToProtocol_1 = - _registerName1("conformsToProtocol:"); - bool _objc_msgSend_4( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer protocol, - ) { - return __objc_msgSend_4( - obj, - sel, - protocol, - ) != - 0; - } - - late final __objc_msgSend_4Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_methodForSelector_1 = - _registerName1("methodForSelector:"); - IMP _objc_msgSend_5( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_5( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_5Ptr = _lookup< - ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodForSelector_1 = - _registerName1("instanceMethodForSelector:"); - late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = - _registerName1("doesNotRecognizeSelector:"); - void _objc_msgSend_6( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_6( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_6Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardingTargetForSelector_1 = - _registerName1("forwardingTargetForSelector:"); - ffi.Pointer _objc_msgSend_7( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_7( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_7Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardInvocation_1 = - _registerName1("forwardInvocation:"); - void _objc_msgSend_8( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anInvocation, - ) { - return __objc_msgSend_8( - obj, - sel, - anInvocation, - ); - } - - late final __objc_msgSend_8Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _class_NSMethodSignature1 = - _getClass1("NSMethodSignature"); - late final ffi.Pointer _sel_methodSignatureForSelector_1 = - _registerName1("methodSignatureForSelector:"); - ffi.Pointer _objc_msgSend_9( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_9( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_9Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = - _registerName1("instanceMethodSignatureForSelector:"); - late final ffi.Pointer _sel_allowsWeakReference1 = - _registerName1("allowsWeakReference"); - bool _objc_msgSend_10( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_10( - obj, - sel, - ) != - 0; - } - - late final __objc_msgSend_10Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_retainWeakReference1 = - _registerName1("retainWeakReference"); - late final ffi.Pointer _sel_isSubclassOfClass_1 = - _registerName1("isSubclassOfClass:"); - late final ffi.Pointer _sel_resolveClassMethod_1 = - _registerName1("resolveClassMethod:"); - late final ffi.Pointer _sel_resolveInstanceMethod_1 = - _registerName1("resolveInstanceMethod:"); - late final ffi.Pointer _sel_hash1 = _registerName1("hash"); - int _objc_msgSend_11( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_11( - obj, - sel, - ); - } - - late final __objc_msgSend_11Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_superclass1 = - _registerName1("superclass"); - late final ffi.Pointer _sel_class1 = _registerName1("class"); - late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); - late final ffi.Pointer _sel_stringWithCString_encoding_1 = - _registerName1("stringWithCString:encoding:"); - ffi.Pointer _objc_msgSend_12( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cString, - int enc, - ) { - return __objc_msgSend_12( - obj, - sel, - cString, - enc, - ); - } - - late final __objc_msgSend_12Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_UTF8String1 = - _registerName1("UTF8String"); - ffi.Pointer _objc_msgSend_13( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_13( - obj, - sel, - ); - } - - late final __objc_msgSend_13Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_description1 = - _registerName1("description"); - ffi.Pointer _objc_msgSend_14( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_14( - obj, - sel, - ); - } - - late final __objc_msgSend_14Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_debugDescription1 = - _registerName1("debugDescription"); - late final ffi.Pointer _sel_version1 = _registerName1("version"); - int _objc_msgSend_15( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_15( - obj, - sel, - ); - } - - late final __objc_msgSend_15Ptr = _lookup< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_setVersion_1 = - _registerName1("setVersion:"); - void _objc_msgSend_16( - ffi.Pointer obj, - ffi.Pointer sel, - int aVersion, - ) { - return __objc_msgSend_16( - obj, - sel, - aVersion, - ); - } - - late final __objc_msgSend_16Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_classForCoder1 = - _registerName1("classForCoder"); - late final ffi.Pointer _sel_replacementObjectForCoder_1 = - _registerName1("replacementObjectForCoder:"); - ffi.Pointer _objc_msgSend_17( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_17( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_17Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = - _registerName1("awakeAfterUsingCoder:"); - late final ffi.Pointer _sel_poseAsClass_1 = - _registerName1("poseAsClass:"); - late final ffi.Pointer _sel_autoContentAccessingProxy1 = - _registerName1("autoContentAccessingProxy"); - late final ffi.Pointer _class_MethodInterface1 = - _getClass1("MethodInterface"); - late final ffi.Pointer _sel_add1 = _registerName1("add"); - int _objc_msgSend_18( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_18( - obj, - sel, - ); - } - - late final __objc_msgSend_18Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_add_1 = _registerName1("add:"); - int _objc_msgSend_19( - ffi.Pointer obj, - ffi.Pointer sel, - int x, - ) { - return __objc_msgSend_19( - obj, - sel, - x, - ); - } - - late final __objc_msgSend_19Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_add_Y_1 = _registerName1("add:Y:"); - int _objc_msgSend_20( - ffi.Pointer obj, - ffi.Pointer sel, - int x, - int y, - ) { - return __objc_msgSend_20( - obj, - sel, - x, - y, - ); - } - - late final __objc_msgSend_20Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, int)>(); - - late final ffi.Pointer _sel_add_Y_Z_1 = _registerName1("add:Y:Z:"); - int _objc_msgSend_21( - ffi.Pointer obj, - ffi.Pointer sel, - int x, - int y, - int z, - ) { - return __objc_msgSend_21( - obj, - sel, - x, - y, - z, - ); - } - - late final __objc_msgSend_21Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Int32, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer, int, int, int)>(); - - late final ffi.Pointer _sel_sub1 = _registerName1("sub"); - late final ffi.Pointer _sel_sub_1 = _registerName1("sub:"); - late final ffi.Pointer _sel_sub_Y_1 = _registerName1("sub:Y:"); - late final ffi.Pointer _sel_sub_Y_Z_1 = _registerName1("sub:Y:Z:"); -} - -abstract class NSComparisonResult { - static const int NSOrderedAscending = -1; - static const int NSOrderedSame = 0; - static const int NSOrderedDescending = 1; -} - -abstract class NSEnumerationOptions { - static const int NSEnumerationConcurrent = 1; - static const int NSEnumerationReverse = 2; -} - -abstract class NSSortOptions { - static const int NSSortConcurrent = 1; - static const int NSSortStable = 16; -} - -abstract class NSQualityOfService { - static const int NSQualityOfServiceUserInteractive = 33; - static const int NSQualityOfServiceUserInitiated = 25; - static const int NSQualityOfServiceUtility = 17; - static const int NSQualityOfServiceBackground = 9; - static const int NSQualityOfServiceDefault = -1; -} - -typedef NSInteger = pkg_ffi.Long; - -class __CFString extends ffi.Opaque {} - -abstract class CFComparisonResult { - static const int kCFCompareLessThan = -1; - static const int kCFCompareEqualTo = 0; - static const int kCFCompareGreaterThan = 1; -} - -typedef CFIndex = pkg_ffi.Long; - -class CFRange extends ffi.Struct { - @CFIndex() - external int location; - - @CFIndex() - external int length; -} - -class __CFNull extends ffi.Opaque {} - -typedef CFNullRef = ffi.Pointer<__CFNull>; - -class __CFAllocator extends ffi.Opaque {} - -typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; - -class CFAllocatorContext extends ffi.Struct { - @CFIndex() - external int version; - - external ffi.Pointer info; - - external CFAllocatorRetainCallBack retain; - - external CFAllocatorReleaseCallBack release; - - external CFAllocatorCopyDescriptionCallBack copyDescription; - - external CFAllocatorAllocateCallBack allocate; - - external CFAllocatorReallocateCallBack reallocate; - - external CFAllocatorDeallocateCallBack deallocate; - - external CFAllocatorPreferredSizeCallBack preferredSize; -} - -typedef CFAllocatorRetainCallBack = ffi.Pointer< - ffi.NativeFunction Function(ffi.Pointer)>>; -typedef CFAllocatorReleaseCallBack - = ffi.Pointer)>>; -typedef CFAllocatorCopyDescriptionCallBack = ffi - .Pointer)>>; -typedef CFStringRef = ffi.Pointer<__CFString>; -typedef CFAllocatorAllocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - CFIndex, CFOptionFlags, ffi.Pointer)>>; -typedef CFOptionFlags = pkg_ffi.UnsignedLong; -typedef CFAllocatorReallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, CFIndex, - CFOptionFlags, ffi.Pointer)>>; -typedef CFAllocatorDeallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; -typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< - ffi.NativeFunction< - CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; - -class _ObjCWrapper { - final ffi.Pointer _id; - final MethodTestObjCLibrary _lib; - - _ObjCWrapper._(this._id, this._lib); - - @override - bool operator ==(Object other) { - return other is _ObjCWrapper && _id == other._id; - } - - @override - int get hashCode => _id.hashCode; -} - -class NSObject extends _ObjCWrapper { - NSObject._(ffi.Pointer id, MethodTestObjCLibrary lib) - : super._(id, lib); - - static NSObject castFrom(T other) { - return NSObject._(other._id, other._lib); - } - - static NSObject castFromPointer( - MethodTestObjCLibrary lib, ffi.Pointer other) { - return NSObject._(other, lib); - } - - static void load(MethodTestObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); - } - - static void initialize(MethodTestObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); - } - - NSObject init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSObject._(_ret, _lib); - } - - static NSObject new1(MethodTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); - return NSObject._(_ret, _lib); - } - - static NSObject allocWithZone_( - MethodTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject alloc(MethodTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); - return NSObject._(_ret, _lib); - } - - void dealloc() { - _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); - } - - void finalize() { - _lib._objc_msgSend_0(_id, _lib._sel_finalize1); - } - - NSObject copy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); - return NSObject._(_ret, _lib); - } - - NSObject mutableCopy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); - return NSObject._(_ret, _lib); - } - - static NSObject copyWithZone_( - MethodTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject mutableCopyWithZone_( - MethodTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static bool instancesRespondToSelector_( - MethodTestObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_3(_lib._class_NSObject1, - _lib._sel_instancesRespondToSelector_1, aSelector); - } - - static bool conformsToProtocol_( - MethodTestObjCLibrary _lib, NSObject? protocol) { - return _lib._objc_msgSend_4(_lib._class_NSObject1, - _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); - } - - IMP methodForSelector_(ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); - } - - static IMP instanceMethodForSelector_( - MethodTestObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_lib._class_NSObject1, - _lib._sel_instanceMethodForSelector_1, aSelector); - } - - void doesNotRecognizeSelector_(ffi.Pointer aSelector) { - _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); - } - - NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_7( - _id, _lib._sel_forwardingTargetForSelector_1, aSelector); - return NSObject._(_ret, _lib); - } - - void forwardInvocation_(NSObject? anInvocation) { - _lib._objc_msgSend_8( - _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); - } - - NSMethodSignature methodSignatureForSelector_( - ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9( - _id, _lib._sel_methodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - static NSMethodSignature instanceMethodSignatureForSelector_( - MethodTestObjCLibrary _lib, ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, - _lib._sel_instanceMethodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - bool allowsWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); - } - - bool retainWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); - } - - static bool isSubclassOfClass_(MethodTestObjCLibrary _lib, NSObject aClass) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); - } - - static bool resolveClassMethod_( - MethodTestObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); - } - - static bool resolveInstanceMethod_( - MethodTestObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); - } - - static int hash(MethodTestObjCLibrary _lib) { - return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); - } - - static NSObject superclass(MethodTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); - return NSObject._(_ret, _lib); - } - - static NSObject class1(MethodTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); - return NSObject._(_ret, _lib); - } - - static NSString description(MethodTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_14(_lib._class_NSObject1, _lib._sel_description1); - return NSString._(_ret, _lib); - } - - static NSString debugDescription(MethodTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_14( - _lib._class_NSObject1, _lib._sel_debugDescription1); - return NSString._(_ret, _lib); - } - - static int version(MethodTestObjCLibrary _lib) { - return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); - } - - static void setVersion_(MethodTestObjCLibrary _lib, int aVersion) { - _lib._objc_msgSend_16( - _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); - } - - NSObject get classForCoder { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); - return NSObject._(_ret, _lib); - } - - NSObject replacementObjectForCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - NSObject awakeAfterUsingCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static void poseAsClass_(MethodTestObjCLibrary _lib, NSObject aClass) { - _lib._objc_msgSend_8( - _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); - } - - NSObject get autoContentAccessingProxy { - final _ret = - _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); - return NSObject._(_ret, _lib); - } -} - -class ObjCSel extends ffi.Opaque {} - -class ObjCObject extends ffi.Opaque {} - -typedef instancetype = ffi.Pointer; - -class _NSZone extends ffi.Opaque {} - -typedef IMP = ffi.Pointer>; - -class NSMethodSignature extends _ObjCWrapper { - NSMethodSignature._(ffi.Pointer id, MethodTestObjCLibrary lib) - : super._(id, lib); - - static NSMethodSignature castFrom(T other) { - return NSMethodSignature._(other._id, other._lib); - } - - static NSMethodSignature castFromPointer( - MethodTestObjCLibrary lib, ffi.Pointer other) { - return NSMethodSignature._(other, lib); - } -} - -typedef NSUInteger = pkg_ffi.UnsignedLong; - -class NSString extends _ObjCWrapper { - NSString._(ffi.Pointer id, MethodTestObjCLibrary lib) - : super._(id, lib); - - static NSString castFrom(T other) { - return NSString._(other._id, other._lib); - } - - static NSString castFromPointer( - MethodTestObjCLibrary lib, ffi.Pointer other) { - return NSString._(other, lib); - } - - factory NSString(MethodTestObjCLibrary _lib, String str) { - final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); - pkg_ffi.calloc.free(cstr); - return nsstr; - } - - @override - String toString() => (UTF8String).cast().toDartString(); - - static NSString stringWithCString_encoding_( - MethodTestObjCLibrary _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return NSString._(_ret, _lib); - } - - ffi.Pointer get UTF8String { - return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); - } -} - -extension StringToNSString on String { - NSString toNSString(MethodTestObjCLibrary lib) => NSString(lib, this); -} - -class MethodInterface extends NSObject { - MethodInterface._(ffi.Pointer id, MethodTestObjCLibrary lib) - : super._(id, lib); - - static MethodInterface castFrom(T other) { - return MethodInterface._(other._id, other._lib); - } - - static MethodInterface castFromPointer( - MethodTestObjCLibrary lib, ffi.Pointer other) { - return MethodInterface._(other, lib); - } - - int add() { - return _lib._objc_msgSend_18(_id, _lib._sel_add1); - } - - int add_(int x) { - return _lib._objc_msgSend_19(_id, _lib._sel_add_1, x); - } - - int add_Y_(int x, int y) { - return _lib._objc_msgSend_20(_id, _lib._sel_add_Y_1, x, y); - } - - int add_Y_Z_(int x, int y, int z) { - return _lib._objc_msgSend_21(_id, _lib._sel_add_Y_Z_1, x, y, z); - } - - static int sub(MethodTestObjCLibrary _lib) { - return _lib._objc_msgSend_18(_lib._class_MethodInterface1, _lib._sel_sub1); - } - - static int sub_(MethodTestObjCLibrary _lib, int x) { - return _lib._objc_msgSend_19( - _lib._class_MethodInterface1, _lib._sel_sub_1, x); - } - - static int sub_Y_(MethodTestObjCLibrary _lib, int x, int y) { - return _lib._objc_msgSend_20( - _lib._class_MethodInterface1, _lib._sel_sub_Y_1, x, y); - } - - static int sub_Y_Z_(MethodTestObjCLibrary _lib, int x, int y, int z) { - return _lib._objc_msgSend_21( - _lib._class_MethodInterface1, _lib._sel_sub_Y_Z_1, x, y, z); - } - - static MethodInterface new1(MethodTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_MethodInterface1, _lib._sel_new1); - return MethodInterface._(_ret, _lib); - } - - static MethodInterface alloc(MethodTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_MethodInterface1, _lib._sel_alloc1); - return MethodInterface._(_ret, _lib); - } -} - -const int NSScannedOption = 1; - -const int NSCollectorDisabledOption = 2; - -const int NS_BLOCKS_AVAILABLE = 1; - -const int __COREFOUNDATION_CFAVAILABILITY__ = 1; - -const int __CF_ENUM_FIXED_IS_AVAILABLE = 1; - -const double NSFoundationVersionNumber10_0 = 397.4; - -const double NSFoundationVersionNumber10_1 = 425.0; - -const double NSFoundationVersionNumber10_1_1 = 425.0; - -const double NSFoundationVersionNumber10_1_2 = 425.0; - -const double NSFoundationVersionNumber10_1_3 = 425.0; - -const double NSFoundationVersionNumber10_1_4 = 425.0; - -const double NSFoundationVersionNumber10_2 = 462.0; - -const double NSFoundationVersionNumber10_2_1 = 462.0; - -const double NSFoundationVersionNumber10_2_2 = 462.0; - -const double NSFoundationVersionNumber10_2_3 = 462.0; - -const double NSFoundationVersionNumber10_2_4 = 462.0; - -const double NSFoundationVersionNumber10_2_5 = 462.0; - -const double NSFoundationVersionNumber10_2_6 = 462.0; - -const double NSFoundationVersionNumber10_2_7 = 462.7; - -const double NSFoundationVersionNumber10_2_8 = 462.7; - -const double NSFoundationVersionNumber10_3 = 500.0; - -const double NSFoundationVersionNumber10_3_1 = 500.0; - -const double NSFoundationVersionNumber10_3_2 = 500.3; - -const double NSFoundationVersionNumber10_3_3 = 500.54; - -const double NSFoundationVersionNumber10_3_4 = 500.56; - -const double NSFoundationVersionNumber10_3_5 = 500.56; - -const double NSFoundationVersionNumber10_3_6 = 500.56; - -const double NSFoundationVersionNumber10_3_7 = 500.56; - -const double NSFoundationVersionNumber10_3_8 = 500.56; - -const double NSFoundationVersionNumber10_3_9 = 500.58; - -const double NSFoundationVersionNumber10_4 = 567.0; - -const double NSFoundationVersionNumber10_4_1 = 567.0; - -const double NSFoundationVersionNumber10_4_2 = 567.12; - -const double NSFoundationVersionNumber10_4_3 = 567.21; - -const double NSFoundationVersionNumber10_4_4_Intel = 567.23; - -const double NSFoundationVersionNumber10_4_4_PowerPC = 567.21; - -const double NSFoundationVersionNumber10_4_5 = 567.25; - -const double NSFoundationVersionNumber10_4_6 = 567.26; - -const double NSFoundationVersionNumber10_4_7 = 567.27; - -const double NSFoundationVersionNumber10_4_8 = 567.28; - -const double NSFoundationVersionNumber10_4_9 = 567.29; - -const double NSFoundationVersionNumber10_4_10 = 567.29; - -const double NSFoundationVersionNumber10_4_11 = 567.36; - -const double NSFoundationVersionNumber10_5 = 677.0; - -const double NSFoundationVersionNumber10_5_1 = 677.1; - -const double NSFoundationVersionNumber10_5_2 = 677.15; - -const double NSFoundationVersionNumber10_5_3 = 677.19; - -const double NSFoundationVersionNumber10_5_4 = 677.19; - -const double NSFoundationVersionNumber10_5_5 = 677.21; - -const double NSFoundationVersionNumber10_5_6 = 677.22; - -const double NSFoundationVersionNumber10_5_7 = 677.24; - -const double NSFoundationVersionNumber10_5_8 = 677.26; - -const double NSFoundationVersionNumber10_6 = 751.0; - -const double NSFoundationVersionNumber10_6_1 = 751.0; - -const double NSFoundationVersionNumber10_6_2 = 751.14; - -const double NSFoundationVersionNumber10_6_3 = 751.21; - -const double NSFoundationVersionNumber10_6_4 = 751.29; - -const double NSFoundationVersionNumber10_6_5 = 751.42; - -const double NSFoundationVersionNumber10_6_6 = 751.53; - -const double NSFoundationVersionNumber10_6_7 = 751.53; - -const double NSFoundationVersionNumber10_6_8 = 751.62; - -const double NSFoundationVersionNumber10_7 = 833.1; - -const double NSFoundationVersionNumber10_7_1 = 833.1; - -const double NSFoundationVersionNumber10_7_2 = 833.2; - -const double NSFoundationVersionNumber10_7_3 = 833.24; - -const double NSFoundationVersionNumber10_7_4 = 833.25; - -const double NSFoundationVersionNumber10_8 = 945.0; - -const double NSFoundationVersionNumber10_8_1 = 945.0; - -const double NSFoundationVersionNumber10_8_2 = 945.11; - -const double NSFoundationVersionNumber10_8_3 = 945.16; - -const double NSFoundationVersionNumber10_8_4 = 945.18; - -const int NSFoundationVersionNumber10_9 = 1056; - -const int NSFoundationVersionNumber10_9_1 = 1056; - -const double NSFoundationVersionNumber10_9_2 = 1056.13; - -const double NSFoundationVersionNumber10_10 = 1151.16; - -const double NSFoundationVersionNumber10_10_1 = 1151.16; - -const double NSFoundationVersionNumber10_10_2 = 1152.14; - -const double NSFoundationVersionNumber10_10_3 = 1153.2; - -const double NSFoundationVersionNumber10_10_4 = 1153.2; - -const int NSFoundationVersionNumber10_10_5 = 1154; - -const int NSFoundationVersionNumber10_10_Max = 1199; - -const int NSFoundationVersionNumber10_11 = 1252; - -const double NSFoundationVersionNumber10_11_1 = 1255.1; - -const double NSFoundationVersionNumber10_11_2 = 1256.1; - -const double NSFoundationVersionNumber10_11_3 = 1256.1; - -const int NSFoundationVersionNumber10_11_4 = 1258; - -const int NSFoundationVersionNumber10_11_Max = 1299; - -const int __COREFOUNDATION_CFBASE__ = 1; - -const int TRUE = 1; - -const int FALSE = 0; - -const double kCFCoreFoundationVersionNumber10_0 = 196.4; - -const double kCFCoreFoundationVersionNumber10_0_3 = 196.5; - -const double kCFCoreFoundationVersionNumber10_1 = 226.0; - -const double kCFCoreFoundationVersionNumber10_1_1 = 226.0; - -const double kCFCoreFoundationVersionNumber10_1_2 = 227.2; - -const double kCFCoreFoundationVersionNumber10_1_3 = 227.2; - -const double kCFCoreFoundationVersionNumber10_1_4 = 227.3; - -const double kCFCoreFoundationVersionNumber10_2 = 263.0; - -const double kCFCoreFoundationVersionNumber10_2_1 = 263.1; - -const double kCFCoreFoundationVersionNumber10_2_2 = 263.1; - -const double kCFCoreFoundationVersionNumber10_2_3 = 263.3; - -const double kCFCoreFoundationVersionNumber10_2_4 = 263.3; - -const double kCFCoreFoundationVersionNumber10_2_5 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_6 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_7 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_8 = 263.5; - -const double kCFCoreFoundationVersionNumber10_3 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_1 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_2 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_3 = 299.3; - -const double kCFCoreFoundationVersionNumber10_3_4 = 299.31; - -const double kCFCoreFoundationVersionNumber10_3_5 = 299.31; - -const double kCFCoreFoundationVersionNumber10_3_6 = 299.32; - -const double kCFCoreFoundationVersionNumber10_3_7 = 299.33; - -const double kCFCoreFoundationVersionNumber10_3_8 = 299.33; - -const double kCFCoreFoundationVersionNumber10_3_9 = 299.35; - -const double kCFCoreFoundationVersionNumber10_4 = 368.0; - -const double kCFCoreFoundationVersionNumber10_4_1 = 368.1; - -const double kCFCoreFoundationVersionNumber10_4_2 = 368.11; - -const double kCFCoreFoundationVersionNumber10_4_3 = 368.18; - -const double kCFCoreFoundationVersionNumber10_4_4_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_4_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_5_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_5_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_6_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_6_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_7 = 368.27; - -const double kCFCoreFoundationVersionNumber10_4_8 = 368.27; - -const double kCFCoreFoundationVersionNumber10_4_9 = 368.28; - -const double kCFCoreFoundationVersionNumber10_4_10 = 368.28; - -const double kCFCoreFoundationVersionNumber10_4_11 = 368.31; - -const double kCFCoreFoundationVersionNumber10_5 = 476.0; - -const double kCFCoreFoundationVersionNumber10_5_1 = 476.0; - -const double kCFCoreFoundationVersionNumber10_5_2 = 476.1; - -const double kCFCoreFoundationVersionNumber10_5_3 = 476.13; - -const double kCFCoreFoundationVersionNumber10_5_4 = 476.14; - -const double kCFCoreFoundationVersionNumber10_5_5 = 476.15; - -const double kCFCoreFoundationVersionNumber10_5_6 = 476.17; - -const double kCFCoreFoundationVersionNumber10_5_7 = 476.18; - -const double kCFCoreFoundationVersionNumber10_5_8 = 476.19; - -const double kCFCoreFoundationVersionNumber10_6 = 550.0; - -const double kCFCoreFoundationVersionNumber10_6_1 = 550.0; - -const double kCFCoreFoundationVersionNumber10_6_2 = 550.13; - -const double kCFCoreFoundationVersionNumber10_6_3 = 550.19; - -const double kCFCoreFoundationVersionNumber10_6_4 = 550.29; - -const double kCFCoreFoundationVersionNumber10_6_5 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_6 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_7 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_8 = 550.43; - -const double kCFCoreFoundationVersionNumber10_7 = 635.0; - -const double kCFCoreFoundationVersionNumber10_7_1 = 635.0; - -const double kCFCoreFoundationVersionNumber10_7_2 = 635.15; - -const double kCFCoreFoundationVersionNumber10_7_3 = 635.19; - -const double kCFCoreFoundationVersionNumber10_7_4 = 635.21; - -const double kCFCoreFoundationVersionNumber10_7_5 = 635.21; - -const double kCFCoreFoundationVersionNumber10_8 = 744.0; - -const double kCFCoreFoundationVersionNumber10_8_1 = 744.0; - -const double kCFCoreFoundationVersionNumber10_8_2 = 744.12; - -const double kCFCoreFoundationVersionNumber10_8_3 = 744.18; - -const double kCFCoreFoundationVersionNumber10_8_4 = 744.19; - -const double kCFCoreFoundationVersionNumber10_9 = 855.11; - -const double kCFCoreFoundationVersionNumber10_9_1 = 855.11; - -const double kCFCoreFoundationVersionNumber10_9_2 = 855.14; - -const double kCFCoreFoundationVersionNumber10_10 = 1151.16; - -const double kCFCoreFoundationVersionNumber10_10_1 = 1151.16; - -const int kCFCoreFoundationVersionNumber10_10_2 = 1152; - -const double kCFCoreFoundationVersionNumber10_10_3 = 1153.18; - -const double kCFCoreFoundationVersionNumber10_10_4 = 1153.18; - -const double kCFCoreFoundationVersionNumber10_10_5 = 1153.18; - -const int kCFCoreFoundationVersionNumber10_10_Max = 1199; - -const int kCFCoreFoundationVersionNumber10_11 = 1253; - -const double kCFCoreFoundationVersionNumber10_11_1 = 1255.1; - -const double kCFCoreFoundationVersionNumber10_11_2 = 1256.14; - -const double kCFCoreFoundationVersionNumber10_11_3 = 1256.14; - -const double kCFCoreFoundationVersionNumber10_11_4 = 1258.1; - -const int kCFCoreFoundationVersionNumber10_11_Max = 1299; - -const int ISA_PTRAUTH_DISCRIMINATOR = 27361; diff --git a/pkgs/ffigen/test/native_objc_test/method_test.dart b/pkgs/ffigen/test/native_objc_test/method_test.dart index 40c3a3475f..e08d36b053 100644 --- a/pkgs/ffigen/test/native_objc_test/method_test.dart +++ b/pkgs/ffigen/test/native_objc_test/method_test.dart @@ -8,10 +8,7 @@ import 'dart:ffi'; import 'dart:io'; -import 'package:ffigen/ffigen.dart'; -import 'package:path/path.dart' as path; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart'; import '../test_utils.dart'; import 'method_bindings.dart'; @@ -28,29 +25,6 @@ void main() { testInstance = MethodInterface.new1(lib); }); - test('generate_bindings', () { - final config = Config.fromYaml(loadYaml( - File(path.join('test', 'native_objc_test', 'method_config.yaml')) - .readAsStringSync()) as YamlMap); - final library = parse(config); - final file = File( - path.join('test', 'debug_generated', 'method_test.dart'), - ); - library.generateFile(file); - - try { - final actual = file.readAsStringSync(); - final expected = File(path.join(config.output)).readAsStringSync(); - expect(actual, expected); - if (file.existsSync()) { - file.delete(); - } - } catch (e) { - print('Failed test: Debug generated file: ${file.absolute.path}'); - rethrow; - } - }); - group('Instance methods', () { test('No arguments', () { expect(testInstance.add(), 5); diff --git a/pkgs/ffigen/test/native_objc_test/config.yaml b/pkgs/ffigen/test/native_objc_test/native_objc_config.yaml similarity index 100% rename from pkgs/ffigen/test/native_objc_test/config.yaml rename to pkgs/ffigen/test/native_objc_test/native_objc_config.yaml diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart index cb2603f2bb..52b8b7836b 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart @@ -8,10 +8,7 @@ import 'dart:ffi'; import 'dart:io'; -import 'package:ffigen/ffigen.dart'; -import 'package:path/path.dart' as path; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart'; import '../test_utils.dart'; import 'native_objc_test_bindings.dart'; @@ -25,27 +22,24 @@ void main() { lib = NativeObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); }); - test('generate_bindings', () { - final config = Config.fromYaml(loadYaml( - File(path.join('test', 'native_objc_test', 'config.yaml')) - .readAsStringSync()) as YamlMap); - final library = parse(config); - final file = File( - path.join('test', 'debug_generated', 'native_objc_test_bindings.dart'), - ); - library.generateFile(file); + test('Basic types', () { + final foo = Foo.new1(lib); + final obj = NSObject.new1(lib); - try { - final actual = file.readAsStringSync(); - final expected = File(path.join(config.output)).readAsStringSync(); - expect(actual, expected); - if (file.existsSync()) { - file.delete(); - } - } catch (e) { - print('Failed test: Debug generated file: ${file.absolute.path}'); - rethrow; - } + foo.intVal = 123; + expect(foo.intVal, 123); + + foo.boolVal = true; + expect(foo.boolVal, true); + + foo.idVal = obj; + expect(foo.idVal, obj); + + foo.selVal = Pointer.fromAddress(456); + expect(foo.selVal.address, 456); + + foo.classVal = obj; + expect(foo.classVal, obj); }); test('Interface basics, with Foo', () { diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test.m b/pkgs/ffigen/test/native_objc_test/native_objc_test.m index 912803be31..e510df88a0 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test.m +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test.m @@ -10,6 +10,11 @@ @interface Foo : NSObject { } @property int32_t intVal; +@property BOOL boolVal; +@property id idVal; +@property SEL selVal; +@property NSObject* objVal; +@property Class classVal; + (Foo*)makeFoo:(double)x; diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart deleted file mode 100644 index 82c254a3bf..0000000000 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart +++ /dev/null @@ -1,9359 +0,0 @@ -// ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field - -// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; - -/// Native Objective C test -class NativeObjCLibrary { - /// Holds the symbol lookup function. - final ffi.Pointer Function(String symbolName) - _lookup; - - /// The symbols are looked up in [dynamicLibrary]. - NativeObjCLibrary(ffi.DynamicLibrary dynamicLibrary) - : _lookup = dynamicLibrary.lookup; - - /// The symbols are looked up with [lookup]. - NativeObjCLibrary.fromLookup( - ffi.Pointer Function(String symbolName) - lookup) - : _lookup = lookup; - - late final ffi.Pointer _NSFoundationVersionNumber = - _lookup('NSFoundationVersionNumber'); - - double get NSFoundationVersionNumber => _NSFoundationVersionNumber.value; - - set NSFoundationVersionNumber(double value) => - _NSFoundationVersionNumber.value = value; - - late final ffi.Pointer _NSNotFound = - _lookup('NSNotFound'); - - int get NSNotFound => _NSNotFound.value; - - set NSNotFound(int value) => _NSNotFound.value = value; - - late final ffi.Pointer _kCFCoreFoundationVersionNumber = - _lookup('kCFCoreFoundationVersionNumber'); - - double get kCFCoreFoundationVersionNumber => - _kCFCoreFoundationVersionNumber.value; - - set kCFCoreFoundationVersionNumber(double value) => - _kCFCoreFoundationVersionNumber.value = value; - - late final ffi.Pointer _kCFNotFound = - _lookup('kCFNotFound'); - - int get kCFNotFound => _kCFNotFound.value; - - set kCFNotFound(int value) => _kCFNotFound.value = value; - - late final ffi.Pointer _kCFNull = _lookup('kCFNull'); - - CFNullRef get kCFNull => _kCFNull.value; - - set kCFNull(CFNullRef value) => _kCFNull.value = value; - - late final ffi.Pointer _kCFAllocatorDefault = - _lookup('kCFAllocatorDefault'); - - CFAllocatorRef get kCFAllocatorDefault => _kCFAllocatorDefault.value; - - set kCFAllocatorDefault(CFAllocatorRef value) => - _kCFAllocatorDefault.value = value; - - late final ffi.Pointer _kCFAllocatorSystemDefault = - _lookup('kCFAllocatorSystemDefault'); - - CFAllocatorRef get kCFAllocatorSystemDefault => - _kCFAllocatorSystemDefault.value; - - set kCFAllocatorSystemDefault(CFAllocatorRef value) => - _kCFAllocatorSystemDefault.value = value; - - late final ffi.Pointer _kCFAllocatorMalloc = - _lookup('kCFAllocatorMalloc'); - - CFAllocatorRef get kCFAllocatorMalloc => _kCFAllocatorMalloc.value; - - set kCFAllocatorMalloc(CFAllocatorRef value) => - _kCFAllocatorMalloc.value = value; - - late final ffi.Pointer _kCFAllocatorMallocZone = - _lookup('kCFAllocatorMallocZone'); - - CFAllocatorRef get kCFAllocatorMallocZone => _kCFAllocatorMallocZone.value; - - set kCFAllocatorMallocZone(CFAllocatorRef value) => - _kCFAllocatorMallocZone.value = value; - - late final ffi.Pointer _kCFAllocatorNull = - _lookup('kCFAllocatorNull'); - - CFAllocatorRef get kCFAllocatorNull => _kCFAllocatorNull.value; - - set kCFAllocatorNull(CFAllocatorRef value) => _kCFAllocatorNull.value = value; - - late final ffi.Pointer _kCFAllocatorUseContext = - _lookup('kCFAllocatorUseContext'); - - CFAllocatorRef get kCFAllocatorUseContext => _kCFAllocatorUseContext.value; - - set kCFAllocatorUseContext(CFAllocatorRef value) => - _kCFAllocatorUseContext.value = value; - - ffi.Pointer _registerName1(String name) { - final cstr = name.toNativeUtf8(); - final sel = _sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; - } - - ffi.Pointer _sel_registerName( - ffi.Pointer str, - ) { - return __sel_registerName( - str, - ); - } - - late final __sel_registerNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sel_registerName'); - late final __sel_registerName = __sel_registerNamePtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _getClass1(String name) { - final cstr = name.toNativeUtf8(); - final clazz = _objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return clazz; - } - - ffi.Pointer _objc_getClass( - ffi.Pointer str, - ) { - return __objc_getClass( - str, - ); - } - - late final __objc_getClassPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('objc_getClass'); - late final __objc_getClass = __objc_getClassPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); - late final ffi.Pointer _sel_load1 = _registerName1("load"); - void _objc_msgSend_0( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_0( - obj, - sel, - ); - } - - late final __objc_msgSend_0Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_initialize1 = - _registerName1("initialize"); - late final ffi.Pointer _sel_init1 = _registerName1("init"); - instancetype _objc_msgSend_1( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1( - obj, - sel, - ); - } - - late final __objc_msgSend_1Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_new1 = _registerName1("new"); - late final ffi.Pointer _sel_allocWithZone_1 = - _registerName1("allocWithZone:"); - instancetype _objc_msgSend_2( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_2( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_2Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>(); - - late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); - late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); - late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); - late final ffi.Pointer _sel_copy1 = _registerName1("copy"); - late final ffi.Pointer _sel_mutableCopy1 = - _registerName1("mutableCopy"); - late final ffi.Pointer _sel_copyWithZone_1 = - _registerName1("copyWithZone:"); - late final ffi.Pointer _sel_mutableCopyWithZone_1 = - _registerName1("mutableCopyWithZone:"); - late final ffi.Pointer _sel_instancesRespondToSelector_1 = - _registerName1("instancesRespondToSelector:"); - bool _objc_msgSend_3( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_3( - obj, - sel, - aSelector, - ) != - 0; - } - - late final __objc_msgSend_3Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_conformsToProtocol_1 = - _registerName1("conformsToProtocol:"); - bool _objc_msgSend_4( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer protocol, - ) { - return __objc_msgSend_4( - obj, - sel, - protocol, - ) != - 0; - } - - late final __objc_msgSend_4Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_methodForSelector_1 = - _registerName1("methodForSelector:"); - IMP _objc_msgSend_5( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_5( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_5Ptr = _lookup< - ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodForSelector_1 = - _registerName1("instanceMethodForSelector:"); - late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = - _registerName1("doesNotRecognizeSelector:"); - void _objc_msgSend_6( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_6( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_6Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardingTargetForSelector_1 = - _registerName1("forwardingTargetForSelector:"); - ffi.Pointer _objc_msgSend_7( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_7( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_7Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardInvocation_1 = - _registerName1("forwardInvocation:"); - void _objc_msgSend_8( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anInvocation, - ) { - return __objc_msgSend_8( - obj, - sel, - anInvocation, - ); - } - - late final __objc_msgSend_8Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _class_NSMethodSignature1 = - _getClass1("NSMethodSignature"); - late final ffi.Pointer _sel_methodSignatureForSelector_1 = - _registerName1("methodSignatureForSelector:"); - ffi.Pointer _objc_msgSend_9( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_9( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_9Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = - _registerName1("instanceMethodSignatureForSelector:"); - late final ffi.Pointer _sel_allowsWeakReference1 = - _registerName1("allowsWeakReference"); - bool _objc_msgSend_10( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_10( - obj, - sel, - ) != - 0; - } - - late final __objc_msgSend_10Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_retainWeakReference1 = - _registerName1("retainWeakReference"); - late final ffi.Pointer _sel_isSubclassOfClass_1 = - _registerName1("isSubclassOfClass:"); - late final ffi.Pointer _sel_resolveClassMethod_1 = - _registerName1("resolveClassMethod:"); - late final ffi.Pointer _sel_resolveInstanceMethod_1 = - _registerName1("resolveInstanceMethod:"); - late final ffi.Pointer _sel_hash1 = _registerName1("hash"); - int _objc_msgSend_11( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_11( - obj, - sel, - ); - } - - late final __objc_msgSend_11Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_superclass1 = - _registerName1("superclass"); - late final ffi.Pointer _sel_class1 = _registerName1("class"); - late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); - late final ffi.Pointer _sel_length1 = _registerName1("length"); - late final ffi.Pointer _sel_characterAtIndex_1 = - _registerName1("characterAtIndex:"); - int _objc_msgSend_12( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ) { - return __objc_msgSend_12( - obj, - sel, - index, - ); - } - - late final __objc_msgSend_12Ptr = _lookup< - ffi.NativeFunction< - unichar Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithCoder_1 = - _registerName1("initWithCoder:"); - instancetype _objc_msgSend_13( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_13( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_13Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_substringFromIndex_1 = - _registerName1("substringFromIndex:"); - ffi.Pointer _objc_msgSend_14( - ffi.Pointer obj, - ffi.Pointer sel, - int from, - ) { - return __objc_msgSend_14( - obj, - sel, - from, - ); - } - - late final __objc_msgSend_14Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_substringToIndex_1 = - _registerName1("substringToIndex:"); - late final ffi.Pointer _sel_substringWithRange_1 = - _registerName1("substringWithRange:"); - ffi.Pointer _objc_msgSend_15( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_15( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_15Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, NSRange)>(); - - late final ffi.Pointer _sel_getCharacters_range_1 = - _registerName1("getCharacters:range:"); - void _objc_msgSend_16( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - NSRange range, - ) { - return __objc_msgSend_16( - obj, - sel, - buffer, - range, - ); - } - - late final __objc_msgSend_16Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRange)>(); - - late final ffi.Pointer _sel_compare_1 = _registerName1("compare:"); - int _objc_msgSend_17( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - ) { - return __objc_msgSend_17( - obj, - sel, - string, - ); - } - - late final __objc_msgSend_17Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_compare_options_1 = - _registerName1("compare:options:"); - int _objc_msgSend_18( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - int mask, - ) { - return __objc_msgSend_18( - obj, - sel, - string, - mask, - ); - } - - late final __objc_msgSend_18Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_compare_options_range_1 = - _registerName1("compare:options:range:"); - int _objc_msgSend_19( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - int mask, - NSRange rangeOfReceiverToCompare, - ) { - return __objc_msgSend_19( - obj, - sel, - string, - mask, - rangeOfReceiverToCompare, - ); - } - - late final __objc_msgSend_19Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, NSRange)>(); - - late final ffi.Pointer _sel_compare_options_range_locale_1 = - _registerName1("compare:options:range:locale:"); - int _objc_msgSend_20( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - int mask, - NSRange rangeOfReceiverToCompare, - ffi.Pointer locale, - ) { - return __objc_msgSend_20( - obj, - sel, - string, - mask, - rangeOfReceiverToCompare, - locale, - ); - } - - late final __objc_msgSend_20Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - NSRange, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, NSRange, ffi.Pointer)>(); - - late final ffi.Pointer _sel_caseInsensitiveCompare_1 = - _registerName1("caseInsensitiveCompare:"); - late final ffi.Pointer _sel_localizedCompare_1 = - _registerName1("localizedCompare:"); - late final ffi.Pointer _sel_localizedCaseInsensitiveCompare_1 = - _registerName1("localizedCaseInsensitiveCompare:"); - late final ffi.Pointer _sel_localizedStandardCompare_1 = - _registerName1("localizedStandardCompare:"); - late final ffi.Pointer _sel_isEqualToString_1 = - _registerName1("isEqualToString:"); - late final ffi.Pointer _sel_hasPrefix_1 = - _registerName1("hasPrefix:"); - late final ffi.Pointer _sel_hasSuffix_1 = - _registerName1("hasSuffix:"); - late final ffi.Pointer _sel_commonPrefixWithString_options_1 = - _registerName1("commonPrefixWithString:options:"); - ffi.Pointer _objc_msgSend_21( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer str, - int mask, - ) { - return __objc_msgSend_21( - obj, - sel, - str, - mask, - ); - } - - late final __objc_msgSend_21Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_containsString_1 = - _registerName1("containsString:"); - late final ffi.Pointer - _sel_localizedCaseInsensitiveContainsString_1 = - _registerName1("localizedCaseInsensitiveContainsString:"); - late final ffi.Pointer _sel_localizedStandardContainsString_1 = - _registerName1("localizedStandardContainsString:"); - late final ffi.Pointer _sel_localizedStandardRangeOfString_1 = - _registerName1("localizedStandardRangeOfString:"); - NSRange _objc_msgSend_22( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer str, - ) { - return __objc_msgSend_22( - obj, - sel, - str, - ); - } - - late final __objc_msgSend_22Ptr = _lookup< - ffi.NativeFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_rangeOfString_1 = - _registerName1("rangeOfString:"); - late final ffi.Pointer _sel_rangeOfString_options_1 = - _registerName1("rangeOfString:options:"); - NSRange _objc_msgSend_23( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchString, - int mask, - ) { - return __objc_msgSend_23( - obj, - sel, - searchString, - mask, - ); - } - - late final __objc_msgSend_23Ptr = _lookup< - ffi.NativeFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_rangeOfString_options_range_1 = - _registerName1("rangeOfString:options:range:"); - NSRange _objc_msgSend_24( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchString, - int mask, - NSRange rangeOfReceiverToSearch, - ) { - return __objc_msgSend_24( - obj, - sel, - searchString, - mask, - rangeOfReceiverToSearch, - ); - } - - late final __objc_msgSend_24Ptr = _lookup< - ffi.NativeFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, NSRange)>(); - - late final ffi.Pointer _sel_rangeOfString_options_range_locale_1 = - _registerName1("rangeOfString:options:range:locale:"); - NSRange _objc_msgSend_25( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchString, - int mask, - NSRange rangeOfReceiverToSearch, - ffi.Pointer locale, - ) { - return __objc_msgSend_25( - obj, - sel, - searchString, - mask, - rangeOfReceiverToSearch, - locale, - ); - } - - late final __objc_msgSend_25Ptr = _lookup< - ffi.NativeFunction< - NSRange Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - NSRange, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, NSRange, ffi.Pointer)>(); - - late final ffi.Pointer _sel_rangeOfCharacterFromSet_1 = - _registerName1("rangeOfCharacterFromSet:"); - late final ffi.Pointer _sel_rangeOfCharacterFromSet_options_1 = - _registerName1("rangeOfCharacterFromSet:options:"); - late final ffi.Pointer _sel_rangeOfCharacterFromSet_options_range_1 = - _registerName1("rangeOfCharacterFromSet:options:range:"); - late final ffi.Pointer - _sel_rangeOfComposedCharacterSequenceAtIndex_1 = - _registerName1("rangeOfComposedCharacterSequenceAtIndex:"); - NSRange _objc_msgSend_26( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ) { - return __objc_msgSend_26( - obj, - sel, - index, - ); - } - - late final __objc_msgSend_26Ptr = _lookup< - ffi.NativeFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer - _sel_rangeOfComposedCharacterSequencesForRange_1 = - _registerName1("rangeOfComposedCharacterSequencesForRange:"); - NSRange _objc_msgSend_27( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_27( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_27Ptr = _lookup< - ffi.NativeFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< - NSRange Function( - ffi.Pointer, ffi.Pointer, NSRange)>(); - - late final ffi.Pointer _sel_stringByAppendingString_1 = - _registerName1("stringByAppendingString:"); - ffi.Pointer _objc_msgSend_28( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aString, - ) { - return __objc_msgSend_28( - obj, - sel, - aString, - ); - } - - late final __objc_msgSend_28Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_28 = __objc_msgSend_28Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_stringByAppendingFormat_1 = - _registerName1("stringByAppendingFormat:"); - late final ffi.Pointer _sel_doubleValue1 = - _registerName1("doubleValue"); - double _objc_msgSend_29( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_29( - obj, - sel, - ); - } - - late final __objc_msgSend_29Ptr = _lookup< - ffi.NativeFunction< - ffi.Double Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_29 = __objc_msgSend_29Ptr.asFunction< - double Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_floatValue1 = - _registerName1("floatValue"); - double _objc_msgSend_30( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_30( - obj, - sel, - ); - } - - late final __objc_msgSend_30Ptr = _lookup< - ffi.NativeFunction< - ffi.Float Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_30 = __objc_msgSend_30Ptr.asFunction< - double Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_intValue1 = _registerName1("intValue"); - int _objc_msgSend_31( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_31( - obj, - sel, - ); - } - - late final __objc_msgSend_31Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_31 = __objc_msgSend_31Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_integerValue1 = - _registerName1("integerValue"); - int _objc_msgSend_32( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_32( - obj, - sel, - ); - } - - late final __objc_msgSend_32Ptr = _lookup< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_32 = __objc_msgSend_32Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_longLongValue1 = - _registerName1("longLongValue"); - int _objc_msgSend_33( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_33( - obj, - sel, - ); - } - - late final __objc_msgSend_33Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.LongLong Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_33 = __objc_msgSend_33Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_boolValue1 = _registerName1("boolValue"); - late final ffi.Pointer _sel_uppercaseString1 = - _registerName1("uppercaseString"); - late final ffi.Pointer _sel_lowercaseString1 = - _registerName1("lowercaseString"); - late final ffi.Pointer _sel_capitalizedString1 = - _registerName1("capitalizedString"); - late final ffi.Pointer _sel_localizedUppercaseString1 = - _registerName1("localizedUppercaseString"); - late final ffi.Pointer _sel_localizedLowercaseString1 = - _registerName1("localizedLowercaseString"); - late final ffi.Pointer _sel_localizedCapitalizedString1 = - _registerName1("localizedCapitalizedString"); - late final ffi.Pointer _sel_uppercaseStringWithLocale_1 = - _registerName1("uppercaseStringWithLocale:"); - late final ffi.Pointer _sel_lowercaseStringWithLocale_1 = - _registerName1("lowercaseStringWithLocale:"); - late final ffi.Pointer _sel_capitalizedStringWithLocale_1 = - _registerName1("capitalizedStringWithLocale:"); - late final ffi.Pointer _sel_getLineStart_end_contentsEnd_forRange_1 = - _registerName1("getLineStart:end:contentsEnd:forRange:"); - void _objc_msgSend_34( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer startPtr, - ffi.Pointer lineEndPtr, - ffi.Pointer contentsEndPtr, - NSRange range, - ) { - return __objc_msgSend_34( - obj, - sel, - startPtr, - lineEndPtr, - contentsEndPtr, - range, - ); - } - - late final __objc_msgSend_34Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_34 = __objc_msgSend_34Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSRange)>(); - - late final ffi.Pointer _sel_lineRangeForRange_1 = - _registerName1("lineRangeForRange:"); - late final ffi.Pointer - _sel_getParagraphStart_end_contentsEnd_forRange_1 = - _registerName1("getParagraphStart:end:contentsEnd:forRange:"); - late final ffi.Pointer _sel_paragraphRangeForRange_1 = - _registerName1("paragraphRangeForRange:"); - ffi.Pointer<_ObjCBlockDesc> _newBlockDesc1() { - final d = - pkg_ffi.calloc.allocate<_ObjCBlockDesc>(ffi.sizeOf<_ObjCBlockDesc>()); - d.ref.size = ffi.sizeOf<_ObjCBlock>(); - return d; - } - - late final ffi.Pointer<_ObjCBlockDesc> _objc_block_desc1 = _newBlockDesc1(); - ffi.Pointer<_ObjCBlock> _newBlock1( - ffi.Pointer invoke, ffi.Pointer target) { - final b = pkg_ffi.calloc.allocate<_ObjCBlock>(ffi.sizeOf<_ObjCBlock>()); - b.ref.invoke = invoke; - b.ref.target = target; - b.ref.descriptor = _objc_block_desc1; - return b; - } - - late final ffi.Pointer - _sel_enumerateSubstringsInRange_options_usingBlock_1 = - _registerName1("enumerateSubstringsInRange:options:usingBlock:"); - void _objc_msgSend_35( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_35( - obj, - sel, - range, - opts, - block, - ); - } - - late final __objc_msgSend_35Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_35 = __objc_msgSend_35Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_enumerateLinesUsingBlock_1 = - _registerName1("enumerateLinesUsingBlock:"); - void _objc_msgSend_36( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_36( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_36Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_36 = __objc_msgSend_36Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_UTF8String1 = - _registerName1("UTF8String"); - ffi.Pointer _objc_msgSend_37( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_37( - obj, - sel, - ); - } - - late final __objc_msgSend_37Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_37 = __objc_msgSend_37Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_fastestEncoding1 = - _registerName1("fastestEncoding"); - late final ffi.Pointer _sel_smallestEncoding1 = - _registerName1("smallestEncoding"); - late final ffi.Pointer _class_NSData1 = _getClass1("NSData"); - late final ffi.Pointer - _sel_dataUsingEncoding_allowLossyConversion_1 = - _registerName1("dataUsingEncoding:allowLossyConversion:"); - ffi.Pointer _objc_msgSend_38( - ffi.Pointer obj, - ffi.Pointer sel, - int encoding, - bool lossy, - ) { - return __objc_msgSend_38( - obj, - sel, - encoding, - lossy ? 1 : 0, - ); - } - - late final __objc_msgSend_38Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSStringEncoding, - ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_38 = __objc_msgSend_38Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int, int)>(); - - late final ffi.Pointer _sel_dataUsingEncoding_1 = - _registerName1("dataUsingEncoding:"); - ffi.Pointer _objc_msgSend_39( - ffi.Pointer obj, - ffi.Pointer sel, - int encoding, - ) { - return __objc_msgSend_39( - obj, - sel, - encoding, - ); - } - - late final __objc_msgSend_39Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_39 = __objc_msgSend_39Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_canBeConvertedToEncoding_1 = - _registerName1("canBeConvertedToEncoding:"); - bool _objc_msgSend_40( - ffi.Pointer obj, - ffi.Pointer sel, - int encoding, - ) { - return __objc_msgSend_40( - obj, - sel, - encoding, - ) != - 0; - } - - late final __objc_msgSend_40Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_40 = __objc_msgSend_40Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_cStringUsingEncoding_1 = - _registerName1("cStringUsingEncoding:"); - void _objc_msgSend_41( - ffi.Pointer obj, - ffi.Pointer sel, - int encoding, - ) { - return __objc_msgSend_41( - obj, - sel, - encoding, - ); - } - - late final __objc_msgSend_41Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_41 = __objc_msgSend_41Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_getCString_maxLength_encoding_1 = - _registerName1("getCString:maxLength:encoding:"); - bool _objc_msgSend_42( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - int maxBufferCount, - int encoding, - ) { - return __objc_msgSend_42( - obj, - sel, - buffer, - maxBufferCount, - encoding, - ) != - 0; - } - - late final __objc_msgSend_42Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_42 = __objc_msgSend_42Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int)>(); - - late final ffi.Pointer - _sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_1 = - _registerName1( - "getBytes:maxLength:usedLength:encoding:options:range:remainingRange:"); - bool _objc_msgSend_43( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - int maxBufferCount, - ffi.Pointer usedBufferCount, - int encoding, - int options, - NSRange range, - NSRangePointer leftover, - ) { - return __objc_msgSend_43( - obj, - sel, - buffer, - maxBufferCount, - usedBufferCount, - encoding, - options, - range, - leftover, - ) != - 0; - } - - late final __objc_msgSend_43Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer, - NSStringEncoding, - ffi.Int32, - NSRange, - NSRangePointer)>>('objc_msgSend'); - late final __objc_msgSend_43 = __objc_msgSend_43Ptr.asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - int, - int, - NSRange, - NSRangePointer)>(); - - late final ffi.Pointer _sel_maximumLengthOfBytesUsingEncoding_1 = - _registerName1("maximumLengthOfBytesUsingEncoding:"); - int _objc_msgSend_44( - ffi.Pointer obj, - ffi.Pointer sel, - int enc, - ) { - return __objc_msgSend_44( - obj, - sel, - enc, - ); - } - - late final __objc_msgSend_44Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_44 = __objc_msgSend_44Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_lengthOfBytesUsingEncoding_1 = - _registerName1("lengthOfBytesUsingEncoding:"); - late final ffi.Pointer _sel_availableStringEncodings1 = - _registerName1("availableStringEncodings"); - ffi.Pointer _objc_msgSend_45( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_45( - obj, - sel, - ); - } - - late final __objc_msgSend_45Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_45 = __objc_msgSend_45Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_localizedNameOfStringEncoding_1 = - _registerName1("localizedNameOfStringEncoding:"); - late final ffi.Pointer _sel_defaultCStringEncoding1 = - _registerName1("defaultCStringEncoding"); - late final ffi.Pointer _sel_decomposedStringWithCanonicalMapping1 = - _registerName1("decomposedStringWithCanonicalMapping"); - late final ffi.Pointer _sel_precomposedStringWithCanonicalMapping1 = - _registerName1("precomposedStringWithCanonicalMapping"); - late final ffi.Pointer - _sel_decomposedStringWithCompatibilityMapping1 = - _registerName1("decomposedStringWithCompatibilityMapping"); - late final ffi.Pointer - _sel_precomposedStringWithCompatibilityMapping1 = - _registerName1("precomposedStringWithCompatibilityMapping"); - late final ffi.Pointer _sel_stringByTrimmingCharactersInSet_1 = - _registerName1("stringByTrimmingCharactersInSet:"); - late final ffi.Pointer - _sel_stringByPaddingToLength_withString_startingAtIndex_1 = - _registerName1("stringByPaddingToLength:withString:startingAtIndex:"); - ffi.Pointer _objc_msgSend_46( - ffi.Pointer obj, - ffi.Pointer sel, - int newLength, - ffi.Pointer padString, - int padIndex, - ) { - return __objc_msgSend_46( - obj, - sel, - newLength, - padString, - padIndex, - ); - } - - late final __objc_msgSend_46Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_46 = __objc_msgSend_46Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_stringByFoldingWithOptions_locale_1 = - _registerName1("stringByFoldingWithOptions:locale:"); - ffi.Pointer _objc_msgSend_47( - ffi.Pointer obj, - ffi.Pointer sel, - int options, - ffi.Pointer locale, - ) { - return __objc_msgSend_47( - obj, - sel, - options, - locale, - ); - } - - late final __objc_msgSend_47Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_47 = __objc_msgSend_47Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); - - late final ffi.Pointer - _sel_stringByReplacingOccurrencesOfString_withString_options_range_1 = - _registerName1( - "stringByReplacingOccurrencesOfString:withString:options:range:"); - ffi.Pointer _objc_msgSend_48( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer target, - ffi.Pointer replacement, - int options, - NSRange searchRange, - ) { - return __objc_msgSend_48( - obj, - sel, - target, - replacement, - options, - searchRange, - ); - } - - late final __objc_msgSend_48Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_48 = __objc_msgSend_48Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - NSRange)>(); - - late final ffi.Pointer - _sel_stringByReplacingOccurrencesOfString_withString_1 = - _registerName1("stringByReplacingOccurrencesOfString:withString:"); - ffi.Pointer _objc_msgSend_49( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer target, - ffi.Pointer replacement, - ) { - return __objc_msgSend_49( - obj, - sel, - target, - replacement, - ); - } - - late final __objc_msgSend_49Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_49 = __objc_msgSend_49Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer - _sel_stringByReplacingCharactersInRange_withString_1 = - _registerName1("stringByReplacingCharactersInRange:withString:"); - ffi.Pointer _objc_msgSend_50( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ffi.Pointer replacement, - ) { - return __objc_msgSend_50( - obj, - sel, - range, - replacement, - ); - } - - late final __objc_msgSend_50Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSRange, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_50 = __objc_msgSend_50Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSRange, ffi.Pointer)>(); - - late final ffi.Pointer _sel_stringByApplyingTransform_reverse_1 = - _registerName1("stringByApplyingTransform:reverse:"); - ffi.Pointer _objc_msgSend_51( - ffi.Pointer obj, - ffi.Pointer sel, - NSStringTransform transform, - bool reverse, - ) { - return __objc_msgSend_51( - obj, - sel, - transform, - reverse ? 1 : 0, - ); - } - - late final __objc_msgSend_51Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSStringTransform, - ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_51 = __objc_msgSend_51Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSStringTransform, int)>(); - - late final ffi.Pointer _sel_writeToURL_atomically_encoding_error_1 = - _registerName1("writeToURL:atomically:encoding:error:"); - bool _objc_msgSend_52( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - bool useAuxiliaryFile, - int enc, - ffi.Pointer> error, - ) { - return __objc_msgSend_52( - obj, - sel, - url, - useAuxiliaryFile ? 1 : 0, - enc, - error, - ) != - 0; - } - - late final __objc_msgSend_52Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Uint8, - NSStringEncoding, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_52 = __objc_msgSend_52Ptr.asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - ffi.Pointer>)>(); - - late final ffi.Pointer _sel_writeToFile_atomically_encoding_error_1 = - _registerName1("writeToFile:atomically:encoding:error:"); - late final ffi.Pointer _sel_description1 = - _registerName1("description"); - late final ffi.Pointer - _sel_initWithCharactersNoCopy_length_freeWhenDone_1 = - _registerName1("initWithCharactersNoCopy:length:freeWhenDone:"); - instancetype _objc_msgSend_53( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer characters, - int length, - bool freeBuffer, - ) { - return __objc_msgSend_53( - obj, - sel, - characters, - length, - freeBuffer ? 1 : 0, - ); - } - - late final __objc_msgSend_53Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_53 = __objc_msgSend_53Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int)>(); - - late final ffi.Pointer - _sel_initWithCharactersNoCopy_length_deallocator_1 = - _registerName1("initWithCharactersNoCopy:length:deallocator:"); - instancetype _objc_msgSend_54( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer chars, - int len, - ffi.Pointer<_ObjCBlock> deallocator, - ) { - return __objc_msgSend_54( - obj, - sel, - chars, - len, - deallocator, - ); - } - - late final __objc_msgSend_54Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_initWithCharacters_length_1 = - _registerName1("initWithCharacters:length:"); - instancetype _objc_msgSend_55( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer characters, - int length, - ) { - return __objc_msgSend_55( - obj, - sel, - characters, - length, - ); - } - - late final __objc_msgSend_55Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_55 = __objc_msgSend_55Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithUTF8String_1 = - _registerName1("initWithUTF8String:"); - instancetype _objc_msgSend_56( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer nullTerminatedCString, - ) { - return __objc_msgSend_56( - obj, - sel, - nullTerminatedCString, - ); - } - - late final __objc_msgSend_56Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_56 = __objc_msgSend_56Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_initWithString_1 = - _registerName1("initWithString:"); - late final ffi.Pointer _sel_initWithFormat_1 = - _registerName1("initWithFormat:"); - late final ffi.Pointer _sel_initWithFormat_arguments_1 = - _registerName1("initWithFormat:arguments:"); - instancetype _objc_msgSend_57( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer<__va_list_tag> argList, - ) { - return __objc_msgSend_57( - obj, - sel, - format, - argList, - ); - } - - late final __objc_msgSend_57Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); - late final __objc_msgSend_57 = __objc_msgSend_57Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer<__va_list_tag>)>(); - - late final ffi.Pointer _sel_initWithFormat_locale_1 = - _registerName1("initWithFormat:locale:"); - instancetype _objc_msgSend_58( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer locale, - ) { - return __objc_msgSend_58( - obj, - sel, - format, - locale, - ); - } - - late final __objc_msgSend_58Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_58 = __objc_msgSend_58Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_initWithFormat_locale_arguments_1 = - _registerName1("initWithFormat:locale:arguments:"); - instancetype _objc_msgSend_59( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer locale, - ffi.Pointer<__va_list_tag> argList, - ) { - return __objc_msgSend_59( - obj, - sel, - format, - locale, - argList, - ); - } - - late final __objc_msgSend_59Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); - late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<__va_list_tag>)>(); - - late final ffi.Pointer _sel_initWithData_encoding_1 = - _registerName1("initWithData:encoding:"); - instancetype _objc_msgSend_60( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - int encoding, - ) { - return __objc_msgSend_60( - obj, - sel, - data, - encoding, - ); - } - - late final __objc_msgSend_60Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithBytes_length_encoding_1 = - _registerName1("initWithBytes:length:encoding:"); - instancetype _objc_msgSend_61( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int len, - int encoding, - ) { - return __objc_msgSend_61( - obj, - sel, - bytes, - len, - encoding, - ); - } - - late final __objc_msgSend_61Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_61 = __objc_msgSend_61Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int)>(); - - late final ffi.Pointer - _sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1 = - _registerName1("initWithBytesNoCopy:length:encoding:freeWhenDone:"); - instancetype _objc_msgSend_62( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int len, - int encoding, - bool freeBuffer, - ) { - return __objc_msgSend_62( - obj, - sel, - bytes, - len, - encoding, - freeBuffer ? 1 : 0, - ); - } - - late final __objc_msgSend_62Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSStringEncoding, - ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, int)>(); - - late final ffi.Pointer - _sel_initWithBytesNoCopy_length_encoding_deallocator_1 = - _registerName1("initWithBytesNoCopy:length:encoding:deallocator:"); - instancetype _objc_msgSend_63( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int len, - int encoding, - ffi.Pointer<_ObjCBlock> deallocator, - ) { - return __objc_msgSend_63( - obj, - sel, - bytes, - len, - encoding, - deallocator, - ); - } - - late final __objc_msgSend_63Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSStringEncoding, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_63 = __objc_msgSend_63Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_string1 = _registerName1("string"); - late final ffi.Pointer _sel_stringWithString_1 = - _registerName1("stringWithString:"); - late final ffi.Pointer _sel_stringWithCharacters_length_1 = - _registerName1("stringWithCharacters:length:"); - late final ffi.Pointer _sel_stringWithUTF8String_1 = - _registerName1("stringWithUTF8String:"); - late final ffi.Pointer _sel_stringWithFormat_1 = - _registerName1("stringWithFormat:"); - late final ffi.Pointer _sel_localizedStringWithFormat_1 = - _registerName1("localizedStringWithFormat:"); - late final ffi.Pointer _sel_initWithCString_encoding_1 = - _registerName1("initWithCString:encoding:"); - instancetype _objc_msgSend_64( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer nullTerminatedCString, - int encoding, - ) { - return __objc_msgSend_64( - obj, - sel, - nullTerminatedCString, - encoding, - ); - } - - late final __objc_msgSend_64Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_64 = __objc_msgSend_64Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_stringWithCString_encoding_1 = - _registerName1("stringWithCString:encoding:"); - late final ffi.Pointer _sel_initWithContentsOfURL_encoding_error_1 = - _registerName1("initWithContentsOfURL:encoding:error:"); - instancetype _objc_msgSend_65( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - int enc, - ffi.Pointer> error, - ) { - return __objc_msgSend_65( - obj, - sel, - url, - enc, - error, - ); - } - - late final __objc_msgSend_65Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSStringEncoding, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_65 = __objc_msgSend_65Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); - - late final ffi.Pointer _sel_initWithContentsOfFile_encoding_error_1 = - _registerName1("initWithContentsOfFile:encoding:error:"); - late final ffi.Pointer - _sel_stringWithContentsOfURL_encoding_error_1 = - _registerName1("stringWithContentsOfURL:encoding:error:"); - late final ffi.Pointer - _sel_stringWithContentsOfFile_encoding_error_1 = - _registerName1("stringWithContentsOfFile:encoding:error:"); - late final ffi.Pointer - _sel_initWithContentsOfURL_usedEncoding_error_1 = - _registerName1("initWithContentsOfURL:usedEncoding:error:"); - instancetype _objc_msgSend_66( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer enc, - ffi.Pointer> error, - ) { - return __objc_msgSend_66( - obj, - sel, - url, - enc, - error, - ); - } - - late final __objc_msgSend_66Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_66 = __objc_msgSend_66Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final ffi.Pointer - _sel_initWithContentsOfFile_usedEncoding_error_1 = - _registerName1("initWithContentsOfFile:usedEncoding:error:"); - late final ffi.Pointer - _sel_stringWithContentsOfURL_usedEncoding_error_1 = - _registerName1("stringWithContentsOfURL:usedEncoding:error:"); - late final ffi.Pointer - _sel_stringWithContentsOfFile_usedEncoding_error_1 = - _registerName1("stringWithContentsOfFile:usedEncoding:error:"); - late final ffi.Pointer - _sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1 = - _registerName1( - "stringEncodingForData:encodingOptions:convertedString:usedLossyConversion:"); - int _objc_msgSend_67( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - ffi.Pointer opts, - ffi.Pointer> string, - ffi.Pointer usedLossyConversion, - ) { - return __objc_msgSend_67( - obj, - sel, - data, - opts, - string, - usedLossyConversion, - ); - } - - late final __objc_msgSend_67Ptr = _lookup< - ffi.NativeFunction< - NSStringEncoding Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_67 = __objc_msgSend_67Ptr.asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_propertyList1 = - _registerName1("propertyList"); - late final ffi.Pointer _class_NSDictionary1 = - _getClass1("NSDictionary"); - late final ffi.Pointer _sel_propertyListFromStringsFileFormat1 = - _registerName1("propertyListFromStringsFileFormat"); - ffi.Pointer _objc_msgSend_68( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_68( - obj, - sel, - ); - } - - late final __objc_msgSend_68Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_68 = __objc_msgSend_68Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_cString1 = _registerName1("cString"); - late final ffi.Pointer _sel_lossyCString1 = - _registerName1("lossyCString"); - late final ffi.Pointer _sel_cStringLength1 = - _registerName1("cStringLength"); - late final ffi.Pointer _sel_getCString_1 = - _registerName1("getCString:"); - void _objc_msgSend_69( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - ) { - return __objc_msgSend_69( - obj, - sel, - bytes, - ); - } - - late final __objc_msgSend_69Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_69 = __objc_msgSend_69Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_getCString_maxLength_1 = - _registerName1("getCString:maxLength:"); - void _objc_msgSend_70( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int maxLength, - ) { - return __objc_msgSend_70( - obj, - sel, - bytes, - maxLength, - ); - } - - late final __objc_msgSend_70Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_70 = __objc_msgSend_70Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer - _sel_getCString_maxLength_range_remainingRange_1 = - _registerName1("getCString:maxLength:range:remainingRange:"); - void _objc_msgSend_71( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int maxLength, - NSRange aRange, - NSRangePointer leftoverRange, - ) { - return __objc_msgSend_71( - obj, - sel, - bytes, - maxLength, - aRange, - leftoverRange, - ); - } - - late final __objc_msgSend_71Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSRange, - NSRangePointer)>>('objc_msgSend'); - late final __objc_msgSend_71 = __objc_msgSend_71Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, NSRange, NSRangePointer)>(); - - late final ffi.Pointer _sel_writeToFile_atomically_1 = - _registerName1("writeToFile:atomically:"); - bool _objc_msgSend_72( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool useAuxiliaryFile, - ) { - return __objc_msgSend_72( - obj, - sel, - path, - useAuxiliaryFile ? 1 : 0, - ) != - 0; - } - - late final __objc_msgSend_72Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_72 = __objc_msgSend_72Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_writeToURL_atomically_1 = - _registerName1("writeToURL:atomically:"); - late final ffi.Pointer _sel_initWithContentsOfFile_1 = - _registerName1("initWithContentsOfFile:"); - late final ffi.Pointer _sel_initWithContentsOfURL_1 = - _registerName1("initWithContentsOfURL:"); - late final ffi.Pointer _sel_stringWithContentsOfFile_1 = - _registerName1("stringWithContentsOfFile:"); - late final ffi.Pointer _sel_stringWithContentsOfURL_1 = - _registerName1("stringWithContentsOfURL:"); - late final ffi.Pointer - _sel_initWithCStringNoCopy_length_freeWhenDone_1 = - _registerName1("initWithCStringNoCopy:length:freeWhenDone:"); - ffi.Pointer _objc_msgSend_73( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int length, - bool freeBuffer, - ) { - return __objc_msgSend_73( - obj, - sel, - bytes, - length, - freeBuffer ? 1 : 0, - ); - } - - late final __objc_msgSend_73Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_73 = __objc_msgSend_73Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, int)>(); - - late final ffi.Pointer _sel_initWithCString_length_1 = - _registerName1("initWithCString:length:"); - late final ffi.Pointer _sel_initWithCString_1 = - _registerName1("initWithCString:"); - late final ffi.Pointer _sel_stringWithCString_length_1 = - _registerName1("stringWithCString:length:"); - late final ffi.Pointer _sel_stringWithCString_1 = - _registerName1("stringWithCString:"); - late final ffi.Pointer _sel_getCharacters_1 = - _registerName1("getCharacters:"); - void _objc_msgSend_74( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - ) { - return __objc_msgSend_74( - obj, - sel, - buffer, - ); - } - - late final __objc_msgSend_74Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_74 = __objc_msgSend_74Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_75( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_75( - obj, - sel, - ); - } - - late final __objc_msgSend_75Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_75 = __objc_msgSend_75Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_debugDescription1 = - _registerName1("debugDescription"); - late final ffi.Pointer _sel_version1 = _registerName1("version"); - late final ffi.Pointer _sel_setVersion_1 = - _registerName1("setVersion:"); - void _objc_msgSend_76( - ffi.Pointer obj, - ffi.Pointer sel, - int aVersion, - ) { - return __objc_msgSend_76( - obj, - sel, - aVersion, - ); - } - - late final __objc_msgSend_76Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_76 = __objc_msgSend_76Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_classForCoder1 = - _registerName1("classForCoder"); - late final ffi.Pointer _sel_replacementObjectForCoder_1 = - _registerName1("replacementObjectForCoder:"); - late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = - _registerName1("awakeAfterUsingCoder:"); - late final ffi.Pointer _sel_poseAsClass_1 = - _registerName1("poseAsClass:"); - late final ffi.Pointer _sel_autoContentAccessingProxy1 = - _registerName1("autoContentAccessingProxy"); - late final ffi.Pointer _class_NSValue1 = _getClass1("NSValue"); - late final ffi.Pointer _sel_getValue_size_1 = - _registerName1("getValue:size:"); - void _objc_msgSend_77( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - int size, - ) { - return __objc_msgSend_77( - obj, - sel, - value, - size, - ); - } - - late final __objc_msgSend_77Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_77 = __objc_msgSend_77Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_objCType1 = _registerName1("objCType"); - late final ffi.Pointer _sel_initWithBytes_objCType_1 = - _registerName1("initWithBytes:objCType:"); - instancetype _objc_msgSend_78( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ffi.Pointer type, - ) { - return __objc_msgSend_78( - obj, - sel, - value, - type, - ); - } - - late final __objc_msgSend_78Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_78 = __objc_msgSend_78Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_valueWithBytes_objCType_1 = - _registerName1("valueWithBytes:objCType:"); - ffi.Pointer _objc_msgSend_79( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ffi.Pointer type, - ) { - return __objc_msgSend_79( - obj, - sel, - value, - type, - ); - } - - late final __objc_msgSend_79Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_79 = __objc_msgSend_79Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_value_withObjCType_1 = - _registerName1("value:withObjCType:"); - late final ffi.Pointer _sel_valueWithNonretainedObject_1 = - _registerName1("valueWithNonretainedObject:"); - ffi.Pointer _objc_msgSend_80( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - ) { - return __objc_msgSend_80( - obj, - sel, - anObject, - ); - } - - late final __objc_msgSend_80Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_nonretainedObjectValue1 = - _registerName1("nonretainedObjectValue"); - late final ffi.Pointer _sel_valueWithPointer_1 = - _registerName1("valueWithPointer:"); - ffi.Pointer _objc_msgSend_81( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer pointer, - ) { - return __objc_msgSend_81( - obj, - sel, - pointer, - ); - } - - late final __objc_msgSend_81Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_81 = __objc_msgSend_81Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_pointerValue1 = - _registerName1("pointerValue"); - ffi.Pointer _objc_msgSend_82( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_82( - obj, - sel, - ); - } - - late final __objc_msgSend_82Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_82 = __objc_msgSend_82Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_isEqualToValue_1 = - _registerName1("isEqualToValue:"); - late final ffi.Pointer _sel_getValue_1 = _registerName1("getValue:"); - void _objc_msgSend_83( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_83( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_83Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_83 = __objc_msgSend_83Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_valueWithRange_1 = - _registerName1("valueWithRange:"); - ffi.Pointer _objc_msgSend_84( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_84( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_84Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_84 = __objc_msgSend_84Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, NSRange)>(); - - late final ffi.Pointer _sel_rangeValue1 = - _registerName1("rangeValue"); - NSRange _objc_msgSend_85( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_85( - obj, - sel, - ); - } - - late final __objc_msgSend_85Ptr = _lookup< - ffi.NativeFunction< - NSRange Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_85 = __objc_msgSend_85Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _class_NSNumber1 = _getClass1("NSNumber"); - late final ffi.Pointer _sel_initWithChar_1 = - _registerName1("initWithChar:"); - ffi.Pointer _objc_msgSend_86( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_86( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_86Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Char)>>('objc_msgSend'); - late final __objc_msgSend_86 = __objc_msgSend_86Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithUnsignedChar_1 = - _registerName1("initWithUnsignedChar:"); - ffi.Pointer _objc_msgSend_87( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_87( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_87Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedChar)>>('objc_msgSend'); - late final __objc_msgSend_87 = __objc_msgSend_87Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithShort_1 = - _registerName1("initWithShort:"); - ffi.Pointer _objc_msgSend_88( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_88( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_88Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Short)>>('objc_msgSend'); - late final __objc_msgSend_88 = __objc_msgSend_88Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithUnsignedShort_1 = - _registerName1("initWithUnsignedShort:"); - ffi.Pointer _objc_msgSend_89( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_89( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_89Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedShort)>>('objc_msgSend'); - late final __objc_msgSend_89 = __objc_msgSend_89Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithInt_1 = - _registerName1("initWithInt:"); - ffi.Pointer _objc_msgSend_90( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_90( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_90Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Int)>>('objc_msgSend'); - late final __objc_msgSend_90 = __objc_msgSend_90Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithUnsignedInt_1 = - _registerName1("initWithUnsignedInt:"); - ffi.Pointer _objc_msgSend_91( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_91( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_91Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_91 = __objc_msgSend_91Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithLong_1 = - _registerName1("initWithLong:"); - ffi.Pointer _objc_msgSend_92( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_92( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_92Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Long)>>('objc_msgSend'); - late final __objc_msgSend_92 = __objc_msgSend_92Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithUnsignedLong_1 = - _registerName1("initWithUnsignedLong:"); - ffi.Pointer _objc_msgSend_93( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_93( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_93Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_93 = __objc_msgSend_93Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithLongLong_1 = - _registerName1("initWithLongLong:"); - ffi.Pointer _objc_msgSend_94( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_94( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_94Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.LongLong)>>('objc_msgSend'); - late final __objc_msgSend_94 = __objc_msgSend_94Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithUnsignedLongLong_1 = - _registerName1("initWithUnsignedLongLong:"); - ffi.Pointer _objc_msgSend_95( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_95( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_95Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedLongLong)>>('objc_msgSend'); - late final __objc_msgSend_95 = __objc_msgSend_95Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithFloat_1 = - _registerName1("initWithFloat:"); - ffi.Pointer _objc_msgSend_96( - ffi.Pointer obj, - ffi.Pointer sel, - double value, - ) { - return __objc_msgSend_96( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_96Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Float)>>('objc_msgSend'); - late final __objc_msgSend_96 = __objc_msgSend_96Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); - - late final ffi.Pointer _sel_initWithDouble_1 = - _registerName1("initWithDouble:"); - ffi.Pointer _objc_msgSend_97( - ffi.Pointer obj, - ffi.Pointer sel, - double value, - ) { - return __objc_msgSend_97( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_97Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_97 = __objc_msgSend_97Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); - - late final ffi.Pointer _sel_initWithBool_1 = - _registerName1("initWithBool:"); - ffi.Pointer _objc_msgSend_98( - ffi.Pointer obj, - ffi.Pointer sel, - bool value, - ) { - return __objc_msgSend_98( - obj, - sel, - value ? 1 : 0, - ); - } - - late final __objc_msgSend_98Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_98 = __objc_msgSend_98Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithInteger_1 = - _registerName1("initWithInteger:"); - late final ffi.Pointer _sel_initWithUnsignedInteger_1 = - _registerName1("initWithUnsignedInteger:"); - late final ffi.Pointer _sel_charValue1 = _registerName1("charValue"); - int _objc_msgSend_99( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_99( - obj, - sel, - ); - } - - late final __objc_msgSend_99Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.Char Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_99 = __objc_msgSend_99Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_unsignedCharValue1 = - _registerName1("unsignedCharValue"); - int _objc_msgSend_100( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_100( - obj, - sel, - ); - } - - late final __objc_msgSend_100Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.UnsignedChar Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_100 = __objc_msgSend_100Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_shortValue1 = - _registerName1("shortValue"); - int _objc_msgSend_101( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_101( - obj, - sel, - ); - } - - late final __objc_msgSend_101Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.Short Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_101 = __objc_msgSend_101Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_unsignedShortValue1 = - _registerName1("unsignedShortValue"); - int _objc_msgSend_102( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_102( - obj, - sel, - ); - } - - late final __objc_msgSend_102Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.UnsignedShort Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_102 = __objc_msgSend_102Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_unsignedIntValue1 = - _registerName1("unsignedIntValue"); - int _objc_msgSend_103( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_103( - obj, - sel, - ); - } - - late final __objc_msgSend_103Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.UnsignedInt Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_103 = __objc_msgSend_103Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_longValue1 = _registerName1("longValue"); - late final ffi.Pointer _sel_unsignedLongValue1 = - _registerName1("unsignedLongValue"); - late final ffi.Pointer _sel_unsignedLongLongValue1 = - _registerName1("unsignedLongLongValue"); - int _objc_msgSend_104( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_104( - obj, - sel, - ); - } - - late final __objc_msgSend_104Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.UnsignedLongLong Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_104 = __objc_msgSend_104Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_unsignedIntegerValue1 = - _registerName1("unsignedIntegerValue"); - late final ffi.Pointer _sel_stringValue1 = - _registerName1("stringValue"); - late final ffi.Pointer _sel_isEqualToNumber_1 = - _registerName1("isEqualToNumber:"); - late final ffi.Pointer _sel_descriptionWithLocale_1 = - _registerName1("descriptionWithLocale:"); - late final ffi.Pointer _sel_numberWithChar_1 = - _registerName1("numberWithChar:"); - late final ffi.Pointer _sel_numberWithUnsignedChar_1 = - _registerName1("numberWithUnsignedChar:"); - late final ffi.Pointer _sel_numberWithShort_1 = - _registerName1("numberWithShort:"); - late final ffi.Pointer _sel_numberWithUnsignedShort_1 = - _registerName1("numberWithUnsignedShort:"); - late final ffi.Pointer _sel_numberWithInt_1 = - _registerName1("numberWithInt:"); - late final ffi.Pointer _sel_numberWithUnsignedInt_1 = - _registerName1("numberWithUnsignedInt:"); - late final ffi.Pointer _sel_numberWithLong_1 = - _registerName1("numberWithLong:"); - late final ffi.Pointer _sel_numberWithUnsignedLong_1 = - _registerName1("numberWithUnsignedLong:"); - late final ffi.Pointer _sel_numberWithLongLong_1 = - _registerName1("numberWithLongLong:"); - late final ffi.Pointer _sel_numberWithUnsignedLongLong_1 = - _registerName1("numberWithUnsignedLongLong:"); - late final ffi.Pointer _sel_numberWithFloat_1 = - _registerName1("numberWithFloat:"); - late final ffi.Pointer _sel_numberWithDouble_1 = - _registerName1("numberWithDouble:"); - late final ffi.Pointer _sel_numberWithBool_1 = - _registerName1("numberWithBool:"); - late final ffi.Pointer _sel_numberWithInteger_1 = - _registerName1("numberWithInteger:"); - late final ffi.Pointer _sel_numberWithUnsignedInteger_1 = - _registerName1("numberWithUnsignedInteger:"); - late final ffi.Pointer _class_NSEnumerator1 = - _getClass1("NSEnumerator"); - late final ffi.Pointer _sel_nextObject1 = - _registerName1("nextObject"); - late final ffi.Pointer _sel_allObjects1 = - _registerName1("allObjects"); - late final ffi.Pointer _class_NSArray1 = _getClass1("NSArray"); - late final ffi.Pointer _sel_count1 = _registerName1("count"); - late final ffi.Pointer _sel_objectAtIndex_1 = - _registerName1("objectAtIndex:"); - ffi.Pointer _objc_msgSend_105( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ) { - return __objc_msgSend_105( - obj, - sel, - index, - ); - } - - late final __objc_msgSend_105Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_105 = __objc_msgSend_105Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithObjects_count_1 = - _registerName1("initWithObjects:count:"); - instancetype _objc_msgSend_106( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> objects, - int cnt, - ) { - return __objc_msgSend_106( - obj, - sel, - objects, - cnt, - ); - } - - late final __objc_msgSend_106Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_106 = __objc_msgSend_106Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>, int)>(); - - late final ffi.Pointer _sel_componentsJoinedByString_1 = - _registerName1("componentsJoinedByString:"); - late final ffi.Pointer _sel_containsObject_1 = - _registerName1("containsObject:"); - late final ffi.Pointer _sel_descriptionWithLocale_indent_1 = - _registerName1("descriptionWithLocale:indent:"); - ffi.Pointer _objc_msgSend_107( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer locale, - int level, - ) { - return __objc_msgSend_107( - obj, - sel, - locale, - level, - ); - } - - late final __objc_msgSend_107Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_107 = __objc_msgSend_107Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_firstObjectCommonWithArray_1 = - _registerName1("firstObjectCommonWithArray:"); - late final ffi.Pointer _sel_getObjects_range_1 = - _registerName1("getObjects:range:"); - void _objc_msgSend_108( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> objects, - NSRange range, - ) { - return __objc_msgSend_108( - obj, - sel, - objects, - range, - ); - } - - late final __objc_msgSend_108Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_108 = __objc_msgSend_108Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>, NSRange)>(); - - late final ffi.Pointer _sel_indexOfObject_1 = - _registerName1("indexOfObject:"); - int _objc_msgSend_109( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - ) { - return __objc_msgSend_109( - obj, - sel, - anObject, - ); - } - - late final __objc_msgSend_109Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_109 = __objc_msgSend_109Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_indexOfObject_inRange_1 = - _registerName1("indexOfObject:inRange:"); - int _objc_msgSend_110( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - NSRange range, - ) { - return __objc_msgSend_110( - obj, - sel, - anObject, - range, - ); - } - - late final __objc_msgSend_110Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_110 = __objc_msgSend_110Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRange)>(); - - late final ffi.Pointer _sel_indexOfObjectIdenticalTo_1 = - _registerName1("indexOfObjectIdenticalTo:"); - late final ffi.Pointer _sel_indexOfObjectIdenticalTo_inRange_1 = - _registerName1("indexOfObjectIdenticalTo:inRange:"); - late final ffi.Pointer _sel_isEqualToArray_1 = - _registerName1("isEqualToArray:"); - late final ffi.Pointer _sel_firstObject1 = - _registerName1("firstObject"); - late final ffi.Pointer _sel_lastObject1 = - _registerName1("lastObject"); - late final ffi.Pointer _sel_sortedArrayHint1 = - _registerName1("sortedArrayHint"); - late final ffi.Pointer _sel_writeToURL_error_1 = - _registerName1("writeToURL:error:"); - bool _objc_msgSend_111( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer> error, - ) { - return __objc_msgSend_111( - obj, - sel, - url, - error, - ) != - 0; - } - - late final __objc_msgSend_111Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_111 = __objc_msgSend_111Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer>)>(); - - late final ffi.Pointer _sel_makeObjectsPerformSelector_1 = - _registerName1("makeObjectsPerformSelector:"); - late final ffi.Pointer _sel_makeObjectsPerformSelector_withObject_1 = - _registerName1("makeObjectsPerformSelector:withObject:"); - void _objc_msgSend_112( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ffi.Pointer argument, - ) { - return __objc_msgSend_112( - obj, - sel, - aSelector, - argument, - ); - } - - late final __objc_msgSend_112Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_112 = __objc_msgSend_112Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_objectAtIndexedSubscript_1 = - _registerName1("objectAtIndexedSubscript:"); - late final ffi.Pointer _sel_enumerateObjectsUsingBlock_1 = - _registerName1("enumerateObjectsUsingBlock:"); - void _objc_msgSend_113( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_113( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_113Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_113 = __objc_msgSend_113Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_enumerateObjectsWithOptions_usingBlock_1 = - _registerName1("enumerateObjectsWithOptions:usingBlock:"); - void _objc_msgSend_114( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_114( - obj, - sel, - opts, - block, - ); - } - - late final __objc_msgSend_114Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_114 = __objc_msgSend_114Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_enumerateObjectsAtIndexes_options_usingBlock_1 = - _registerName1("enumerateObjectsAtIndexes:options:usingBlock:"); - void _objc_msgSend_115( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer s, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_115( - obj, - sel, - s, - opts, - block, - ); - } - - late final __objc_msgSend_115Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_115 = __objc_msgSend_115Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_indexOfObjectPassingTest_1 = - _registerName1("indexOfObjectPassingTest:"); - int _objc_msgSend_116( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_116( - obj, - sel, - predicate, - ); - } - - late final __objc_msgSend_116Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_116 = __objc_msgSend_116Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_indexOfObjectWithOptions_passingTest_1 = - _registerName1("indexOfObjectWithOptions:passingTest:"); - int _objc_msgSend_117( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_117( - obj, - sel, - opts, - predicate, - ); - } - - late final __objc_msgSend_117Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_117 = __objc_msgSend_117Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_indexOfObjectAtIndexes_options_passingTest_1 = - _registerName1("indexOfObjectAtIndexes:options:passingTest:"); - int _objc_msgSend_118( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer s, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_118( - obj, - sel, - s, - opts, - predicate, - ); - } - - late final __objc_msgSend_118Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_118 = __objc_msgSend_118Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _class_NSIndexSet1 = - _getClass1("NSIndexSet"); - late final ffi.Pointer _sel_indexSet1 = _registerName1("indexSet"); - late final ffi.Pointer _sel_indexSetWithIndex_1 = - _registerName1("indexSetWithIndex:"); - late final ffi.Pointer _sel_indexSetWithIndexesInRange_1 = - _registerName1("indexSetWithIndexesInRange:"); - instancetype _objc_msgSend_119( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_119( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_119Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_119 = __objc_msgSend_119Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, NSRange)>(); - - late final ffi.Pointer _sel_initWithIndexesInRange_1 = - _registerName1("initWithIndexesInRange:"); - late final ffi.Pointer _sel_initWithIndexSet_1 = - _registerName1("initWithIndexSet:"); - late final ffi.Pointer _sel_initWithIndex_1 = - _registerName1("initWithIndex:"); - late final ffi.Pointer _sel_isEqualToIndexSet_1 = - _registerName1("isEqualToIndexSet:"); - late final ffi.Pointer _sel_firstIndex1 = - _registerName1("firstIndex"); - late final ffi.Pointer _sel_lastIndex1 = _registerName1("lastIndex"); - late final ffi.Pointer _sel_indexGreaterThanIndex_1 = - _registerName1("indexGreaterThanIndex:"); - late final ffi.Pointer _sel_indexLessThanIndex_1 = - _registerName1("indexLessThanIndex:"); - late final ffi.Pointer _sel_indexGreaterThanOrEqualToIndex_1 = - _registerName1("indexGreaterThanOrEqualToIndex:"); - late final ffi.Pointer _sel_indexLessThanOrEqualToIndex_1 = - _registerName1("indexLessThanOrEqualToIndex:"); - late final ffi.Pointer _sel_getIndexes_maxCount_inIndexRange_1 = - _registerName1("getIndexes:maxCount:inIndexRange:"); - int _objc_msgSend_120( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexBuffer, - int bufferSize, - NSRangePointer range, - ) { - return __objc_msgSend_120( - obj, - sel, - indexBuffer, - bufferSize, - range, - ); - } - - late final __objc_msgSend_120Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSRangePointer)>>('objc_msgSend'); - late final __objc_msgSend_120 = __objc_msgSend_120Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, NSRangePointer)>(); - - late final ffi.Pointer _sel_countOfIndexesInRange_1 = - _registerName1("countOfIndexesInRange:"); - int _objc_msgSend_121( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_121( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_121Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_121 = __objc_msgSend_121Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); - - late final ffi.Pointer _sel_containsIndex_1 = - _registerName1("containsIndex:"); - late final ffi.Pointer _sel_containsIndexesInRange_1 = - _registerName1("containsIndexesInRange:"); - bool _objc_msgSend_122( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_122( - obj, - sel, - range, - ) != - 0; - } - - late final __objc_msgSend_122Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_122 = __objc_msgSend_122Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); - - late final ffi.Pointer _sel_containsIndexes_1 = - _registerName1("containsIndexes:"); - late final ffi.Pointer _sel_intersectsIndexesInRange_1 = - _registerName1("intersectsIndexesInRange:"); - late final ffi.Pointer _sel_enumerateIndexesUsingBlock_1 = - _registerName1("enumerateIndexesUsingBlock:"); - void _objc_msgSend_123( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_123( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_123Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_123 = __objc_msgSend_123Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_enumerateIndexesWithOptions_usingBlock_1 = - _registerName1("enumerateIndexesWithOptions:usingBlock:"); - void _objc_msgSend_124( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_124( - obj, - sel, - opts, - block, - ); - } - - late final __objc_msgSend_124Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_124 = __objc_msgSend_124Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_enumerateIndexesInRange_options_usingBlock_1 = - _registerName1("enumerateIndexesInRange:options:usingBlock:"); - void _objc_msgSend_125( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_125( - obj, - sel, - range, - opts, - block, - ); - } - - late final __objc_msgSend_125Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_125 = __objc_msgSend_125Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_indexPassingTest_1 = - _registerName1("indexPassingTest:"); - int _objc_msgSend_126( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_126( - obj, - sel, - predicate, - ); - } - - late final __objc_msgSend_126Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_126 = __objc_msgSend_126Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_indexWithOptions_passingTest_1 = - _registerName1("indexWithOptions:passingTest:"); - int _objc_msgSend_127( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_127( - obj, - sel, - opts, - predicate, - ); - } - - late final __objc_msgSend_127Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_127 = __objc_msgSend_127Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_indexInRange_options_passingTest_1 = - _registerName1("indexInRange:options:passingTest:"); - int _objc_msgSend_128( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_128( - obj, - sel, - range, - opts, - predicate, - ); - } - - late final __objc_msgSend_128Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_128 = __objc_msgSend_128Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_indexesPassingTest_1 = - _registerName1("indexesPassingTest:"); - ffi.Pointer _objc_msgSend_129( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_129( - obj, - sel, - predicate, - ); - } - - late final __objc_msgSend_129Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_129 = __objc_msgSend_129Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_indexesWithOptions_passingTest_1 = - _registerName1("indexesWithOptions:passingTest:"); - ffi.Pointer _objc_msgSend_130( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_130( - obj, - sel, - opts, - predicate, - ); - } - - late final __objc_msgSend_130Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_130 = __objc_msgSend_130Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_indexesInRange_options_passingTest_1 = - _registerName1("indexesInRange:options:passingTest:"); - ffi.Pointer _objc_msgSend_131( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_131( - obj, - sel, - range, - opts, - predicate, - ); - } - - late final __objc_msgSend_131Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSRange, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_131 = __objc_msgSend_131Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSRange, int, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_enumerateRangesUsingBlock_1 = - _registerName1("enumerateRangesUsingBlock:"); - void _objc_msgSend_132( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_132( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_132Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_132 = __objc_msgSend_132Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_enumerateRangesWithOptions_usingBlock_1 = - _registerName1("enumerateRangesWithOptions:usingBlock:"); - void _objc_msgSend_133( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_133( - obj, - sel, - opts, - block, - ); - } - - late final __objc_msgSend_133Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_133 = __objc_msgSend_133Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_enumerateRangesInRange_options_usingBlock_1 = - _registerName1("enumerateRangesInRange:options:usingBlock:"); - void _objc_msgSend_134( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_134( - obj, - sel, - range, - opts, - block, - ); - } - - late final __objc_msgSend_134Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_134 = __objc_msgSend_134Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_indexesOfObjectsPassingTest_1 = - _registerName1("indexesOfObjectsPassingTest:"); - ffi.Pointer _objc_msgSend_135( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_135( - obj, - sel, - predicate, - ); - } - - late final __objc_msgSend_135Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_135 = __objc_msgSend_135Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_indexesOfObjectsWithOptions_passingTest_1 = - _registerName1("indexesOfObjectsWithOptions:passingTest:"); - ffi.Pointer _objc_msgSend_136( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_136( - obj, - sel, - opts, - predicate, - ); - } - - late final __objc_msgSend_136Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_136 = __objc_msgSend_136Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_indexesOfObjectsAtIndexes_options_passingTest_1 = - _registerName1("indexesOfObjectsAtIndexes:options:passingTest:"); - ffi.Pointer _objc_msgSend_137( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer s, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_137( - obj, - sel, - s, - opts, - predicate, - ); - } - - late final __objc_msgSend_137Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_137 = __objc_msgSend_137Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_indexOfObject_inSortedRange_options_usingComparator_1 = - _registerName1("indexOfObject:inSortedRange:options:usingComparator:"); - int _objc_msgSend_138( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer obj1, - NSRange r, - int opts, - NSComparator cmp, - ) { - return __objc_msgSend_138( - obj, - sel, - obj1, - r, - opts, - cmp, - ); - } - - late final __objc_msgSend_138Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSRange, - ffi.Int32, - NSComparator)>>('objc_msgSend'); - late final __objc_msgSend_138 = __objc_msgSend_138Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRange, int, NSComparator)>(); - - late final ffi.Pointer _sel_array1 = _registerName1("array"); - late final ffi.Pointer _sel_arrayWithObject_1 = - _registerName1("arrayWithObject:"); - late final ffi.Pointer _sel_arrayWithObjects_count_1 = - _registerName1("arrayWithObjects:count:"); - late final ffi.Pointer _sel_arrayWithObjects_1 = - _registerName1("arrayWithObjects:"); - late final ffi.Pointer _sel_arrayWithArray_1 = - _registerName1("arrayWithArray:"); - late final ffi.Pointer _sel_initWithObjects_1 = - _registerName1("initWithObjects:"); - late final ffi.Pointer _sel_initWithArray_1 = - _registerName1("initWithArray:"); - late final ffi.Pointer _sel_initWithArray_copyItems_1 = - _registerName1("initWithArray:copyItems:"); - instancetype _objc_msgSend_139( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer array, - bool flag, - ) { - return __objc_msgSend_139( - obj, - sel, - array, - flag ? 1 : 0, - ); - } - - late final __objc_msgSend_139Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_139 = __objc_msgSend_139Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_getObjects_1 = - _registerName1("getObjects:"); - void _objc_msgSend_140( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> objects, - ) { - return __objc_msgSend_140( - obj, - sel, - objects, - ); - } - - late final __objc_msgSend_140Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_140 = __objc_msgSend_140Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>(); - - late final ffi.Pointer _class_NSMutableArray1 = - _getClass1("NSMutableArray"); - late final ffi.Pointer _sel_addObject_1 = - _registerName1("addObject:"); - late final ffi.Pointer _sel_insertObject_atIndex_1 = - _registerName1("insertObject:atIndex:"); - void _objc_msgSend_141( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - int index, - ) { - return __objc_msgSend_141( - obj, - sel, - anObject, - index, - ); - } - - late final __objc_msgSend_141Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_141 = __objc_msgSend_141Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_removeLastObject1 = - _registerName1("removeLastObject"); - late final ffi.Pointer _sel_removeObjectAtIndex_1 = - _registerName1("removeObjectAtIndex:"); - late final ffi.Pointer _sel_replaceObjectAtIndex_withObject_1 = - _registerName1("replaceObjectAtIndex:withObject:"); - void _objc_msgSend_142( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ffi.Pointer anObject, - ) { - return __objc_msgSend_142( - obj, - sel, - index, - anObject, - ); - } - - late final __objc_msgSend_142Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSUInteger, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_142 = __objc_msgSend_142Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_initWithCapacity_1 = - _registerName1("initWithCapacity:"); - late final ffi.Pointer _sel_addObjectsFromArray_1 = - _registerName1("addObjectsFromArray:"); - late final ffi.Pointer - _sel_exchangeObjectAtIndex_withObjectAtIndex_1 = - _registerName1("exchangeObjectAtIndex:withObjectAtIndex:"); - void _objc_msgSend_143( - ffi.Pointer obj, - ffi.Pointer sel, - int idx1, - int idx2, - ) { - return __objc_msgSend_143( - obj, - sel, - idx1, - idx2, - ); - } - - late final __objc_msgSend_143Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSUInteger, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_143 = __objc_msgSend_143Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, int)>(); - - late final ffi.Pointer _sel_removeAllObjects1 = - _registerName1("removeAllObjects"); - late final ffi.Pointer _sel_removeObject_inRange_1 = - _registerName1("removeObject:inRange:"); - void _objc_msgSend_144( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - NSRange range, - ) { - return __objc_msgSend_144( - obj, - sel, - anObject, - range, - ); - } - - late final __objc_msgSend_144Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_144 = __objc_msgSend_144Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRange)>(); - - late final ffi.Pointer _sel_removeObject_1 = - _registerName1("removeObject:"); - late final ffi.Pointer _sel_removeObjectIdenticalTo_inRange_1 = - _registerName1("removeObjectIdenticalTo:inRange:"); - late final ffi.Pointer _sel_removeObjectIdenticalTo_1 = - _registerName1("removeObjectIdenticalTo:"); - late final ffi.Pointer _sel_removeObjectsFromIndices_numIndices_1 = - _registerName1("removeObjectsFromIndices:numIndices:"); - void _objc_msgSend_145( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indices, - int cnt, - ) { - return __objc_msgSend_145( - obj, - sel, - indices, - cnt, - ); - } - - late final __objc_msgSend_145Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_145 = __objc_msgSend_145Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_removeObjectsInArray_1 = - _registerName1("removeObjectsInArray:"); - late final ffi.Pointer _sel_removeObjectsInRange_1 = - _registerName1("removeObjectsInRange:"); - void _objc_msgSend_146( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_146( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_146Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_146 = __objc_msgSend_146Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange)>(); - - late final ffi.Pointer - _sel_replaceObjectsInRange_withObjectsFromArray_range_1 = - _registerName1("replaceObjectsInRange:withObjectsFromArray:range:"); - void _objc_msgSend_147( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ffi.Pointer otherArray, - NSRange otherRange, - ) { - return __objc_msgSend_147( - obj, - sel, - range, - otherArray, - otherRange, - ); - } - - late final __objc_msgSend_147Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_147 = __objc_msgSend_147Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, - ffi.Pointer, NSRange)>(); - - late final ffi.Pointer - _sel_replaceObjectsInRange_withObjectsFromArray_1 = - _registerName1("replaceObjectsInRange:withObjectsFromArray:"); - void _objc_msgSend_148( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ffi.Pointer otherArray, - ) { - return __objc_msgSend_148( - obj, - sel, - range, - otherArray, - ); - } - - late final __objc_msgSend_148Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_148 = __objc_msgSend_148Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_setArray_1 = _registerName1("setArray:"); - late final ffi.Pointer _sel_sortUsingFunction_context_1 = - _registerName1("sortUsingFunction:context:"); - void _objc_msgSend_149( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>> - compare, - ffi.Pointer context, - ) { - return __objc_msgSend_149( - obj, - sel, - compare, - context, - ); - } - - late final __objc_msgSend_149Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_149 = __objc_msgSend_149Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_sortUsingSelector_1 = - _registerName1("sortUsingSelector:"); - late final ffi.Pointer _sel_insertObjects_atIndexes_1 = - _registerName1("insertObjects:atIndexes:"); - void _objc_msgSend_150( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer objects, - ffi.Pointer indexes, - ) { - return __objc_msgSend_150( - obj, - sel, - objects, - indexes, - ); - } - - late final __objc_msgSend_150Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_150 = __objc_msgSend_150Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_removeObjectsAtIndexes_1 = - _registerName1("removeObjectsAtIndexes:"); - late final ffi.Pointer _sel_replaceObjectsAtIndexes_withObjects_1 = - _registerName1("replaceObjectsAtIndexes:withObjects:"); - late final ffi.Pointer _sel_setObject_atIndexedSubscript_1 = - _registerName1("setObject:atIndexedSubscript:"); - late final ffi.Pointer _sel_sortUsingComparator_1 = - _registerName1("sortUsingComparator:"); - void _objc_msgSend_151( - ffi.Pointer obj, - ffi.Pointer sel, - NSComparator cmptr, - ) { - return __objc_msgSend_151( - obj, - sel, - cmptr, - ); - } - - late final __objc_msgSend_151Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSComparator)>>('objc_msgSend'); - late final __objc_msgSend_151 = __objc_msgSend_151Ptr.asFunction< - void Function( - ffi.Pointer, ffi.Pointer, NSComparator)>(); - - late final ffi.Pointer _sel_sortWithOptions_usingComparator_1 = - _registerName1("sortWithOptions:usingComparator:"); - void _objc_msgSend_152( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - NSComparator cmptr, - ) { - return __objc_msgSend_152( - obj, - sel, - opts, - cmptr, - ); - } - - late final __objc_msgSend_152Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, NSComparator)>>('objc_msgSend'); - late final __objc_msgSend_152 = __objc_msgSend_152Ptr.asFunction< - void Function( - ffi.Pointer, ffi.Pointer, int, NSComparator)>(); - - late final ffi.Pointer _sel_arrayWithCapacity_1 = - _registerName1("arrayWithCapacity:"); - late final ffi.Pointer _sel_applyDifference_1 = - _registerName1("applyDifference:"); - late final ffi.Pointer> - _NSItemProviderPreferredImageSizeKey = - _lookup>('NSItemProviderPreferredImageSizeKey'); - - ffi.Pointer get NSItemProviderPreferredImageSizeKey => - _NSItemProviderPreferredImageSizeKey.value; - - set NSItemProviderPreferredImageSizeKey(ffi.Pointer value) => - _NSItemProviderPreferredImageSizeKey.value = value; - - late final ffi.Pointer _class_NSItemProvider1 = - _getClass1("NSItemProvider"); - late final ffi.Pointer - _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1 = - _registerName1( - "registerDataRepresentationForTypeIdentifier:visibility:loadHandler:"); - void _objc_msgSend_153( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - int visibility, - ffi.Pointer<_ObjCBlock> loadHandler, - ) { - return __objc_msgSend_153( - obj, - sel, - typeIdentifier, - visibility, - loadHandler, - ); - } - - late final __objc_msgSend_153Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_153 = __objc_msgSend_153Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1 = - _registerName1( - "registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:"); - void _objc_msgSend_154( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - int fileOptions, - int visibility, - ffi.Pointer<_ObjCBlock> loadHandler, - ) { - return __objc_msgSend_154( - obj, - sel, - typeIdentifier, - fileOptions, - visibility, - loadHandler, - ); - } - - late final __objc_msgSend_154Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_154 = __objc_msgSend_154Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_registeredTypeIdentifiers1 = - _registerName1("registeredTypeIdentifiers"); - late final ffi.Pointer _sel_hasItemConformingToTypeIdentifier_1 = - _registerName1("hasItemConformingToTypeIdentifier:"); - late final ffi.Pointer - _sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1 = - _registerName1( - "hasRepresentationConformingToTypeIdentifier:fileOptions:"); - bool _objc_msgSend_155( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - int fileOptions, - ) { - return __objc_msgSend_155( - obj, - sel, - typeIdentifier, - fileOptions, - ) != - 0; - } - - late final __objc_msgSend_155Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_155 = __objc_msgSend_155Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _class_NSProgress1 = - _getClass1("NSProgress"); - late final ffi.Pointer - _sel_loadDataRepresentationForTypeIdentifier_completionHandler_1 = - _registerName1( - "loadDataRepresentationForTypeIdentifier:completionHandler:"); - ffi.Pointer _objc_msgSend_156( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_156( - obj, - sel, - typeIdentifier, - completionHandler, - ); - } - - late final __objc_msgSend_156Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_156 = __objc_msgSend_156Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_loadFileRepresentationForTypeIdentifier_completionHandler_1 = - _registerName1( - "loadFileRepresentationForTypeIdentifier:completionHandler:"); - late final ffi.Pointer - _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1 = - _registerName1( - "loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:"); - ffi.Pointer _objc_msgSend_157( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_157( - obj, - sel, - typeIdentifier, - completionHandler, - ); - } - - late final __objc_msgSend_157Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_157 = __objc_msgSend_157Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_suggestedName1 = - _registerName1("suggestedName"); - late final ffi.Pointer _sel_setSuggestedName_1 = - _registerName1("setSuggestedName:"); - late final ffi.Pointer _sel_initWithObject_1 = - _registerName1("initWithObject:"); - late final ffi.Pointer _sel_registerObject_visibility_1 = - _registerName1("registerObject:visibility:"); - void _objc_msgSend_158( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer object, - int visibility, - ) { - return __objc_msgSend_158( - obj, - sel, - object, - visibility, - ); - } - - late final __objc_msgSend_158Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_158 = __objc_msgSend_158Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer - _sel_registerObjectOfClass_visibility_loadHandler_1 = - _registerName1("registerObjectOfClass:visibility:loadHandler:"); - late final ffi.Pointer _sel_canLoadObjectOfClass_1 = - _registerName1("canLoadObjectOfClass:"); - late final ffi.Pointer _sel_loadObjectOfClass_completionHandler_1 = - _registerName1("loadObjectOfClass:completionHandler:"); - late final ffi.Pointer _sel_initWithItem_typeIdentifier_1 = - _registerName1("initWithItem:typeIdentifier:"); - late final ffi.Pointer - _sel_registerItemForTypeIdentifier_loadHandler_1 = - _registerName1("registerItemForTypeIdentifier:loadHandler:"); - void _objc_msgSend_159( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - NSItemProviderLoadHandler loadHandler, - ) { - return __objc_msgSend_159( - obj, - sel, - typeIdentifier, - loadHandler, - ); - } - - late final __objc_msgSend_159Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSItemProviderLoadHandler)>>('objc_msgSend'); - late final __objc_msgSend_159 = __objc_msgSend_159Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSItemProviderLoadHandler)>(); - - late final ffi.Pointer - _sel_loadItemForTypeIdentifier_options_completionHandler_1 = - _registerName1("loadItemForTypeIdentifier:options:completionHandler:"); - void _objc_msgSend_160( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer options, - NSItemProviderCompletionHandler completionHandler, - ) { - return __objc_msgSend_160( - obj, - sel, - typeIdentifier, - options, - completionHandler, - ); - } - - late final __objc_msgSend_160Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSItemProviderCompletionHandler)>>('objc_msgSend'); - late final __objc_msgSend_160 = __objc_msgSend_160Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSItemProviderCompletionHandler)>(); - - late final ffi.Pointer _sel_previewImageHandler1 = - _registerName1("previewImageHandler"); - NSItemProviderLoadHandler _objc_msgSend_161( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_161( - obj, - sel, - ); - } - - late final __objc_msgSend_161Ptr = _lookup< - ffi.NativeFunction< - NSItemProviderLoadHandler Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_161 = __objc_msgSend_161Ptr.asFunction< - NSItemProviderLoadHandler Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_setPreviewImageHandler_1 = - _registerName1("setPreviewImageHandler:"); - void _objc_msgSend_162( - ffi.Pointer obj, - ffi.Pointer sel, - NSItemProviderLoadHandler value, - ) { - return __objc_msgSend_162( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_162Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSItemProviderLoadHandler)>>('objc_msgSend'); - late final __objc_msgSend_162 = __objc_msgSend_162Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - NSItemProviderLoadHandler)>(); - - late final ffi.Pointer - _sel_loadPreviewImageWithOptions_completionHandler_1 = - _registerName1("loadPreviewImageWithOptions:completionHandler:"); - void _objc_msgSend_163( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer options, - NSItemProviderCompletionHandler completionHandler, - ) { - return __objc_msgSend_163( - obj, - sel, - options, - completionHandler, - ); - } - - late final __objc_msgSend_163Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSItemProviderCompletionHandler)>>('objc_msgSend'); - late final __objc_msgSend_163 = __objc_msgSend_163Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSItemProviderCompletionHandler)>(); - - late final ffi.Pointer> - _NSExtensionJavaScriptPreprocessingResultsKey = - _lookup>( - 'NSExtensionJavaScriptPreprocessingResultsKey'); - - ffi.Pointer get NSExtensionJavaScriptPreprocessingResultsKey => - _NSExtensionJavaScriptPreprocessingResultsKey.value; - - set NSExtensionJavaScriptPreprocessingResultsKey( - ffi.Pointer value) => - _NSExtensionJavaScriptPreprocessingResultsKey.value = value; - - late final ffi.Pointer> - _NSExtensionJavaScriptFinalizeArgumentKey = - _lookup>( - 'NSExtensionJavaScriptFinalizeArgumentKey'); - - ffi.Pointer get NSExtensionJavaScriptFinalizeArgumentKey => - _NSExtensionJavaScriptFinalizeArgumentKey.value; - - set NSExtensionJavaScriptFinalizeArgumentKey(ffi.Pointer value) => - _NSExtensionJavaScriptFinalizeArgumentKey.value = value; - - late final ffi.Pointer> _NSItemProviderErrorDomain = - _lookup>('NSItemProviderErrorDomain'); - - ffi.Pointer get NSItemProviderErrorDomain => - _NSItemProviderErrorDomain.value; - - set NSItemProviderErrorDomain(ffi.Pointer value) => - _NSItemProviderErrorDomain.value = value; - - late final ffi.Pointer _NSStringTransformLatinToKatakana = - _lookup('NSStringTransformLatinToKatakana'); - - NSStringTransform get NSStringTransformLatinToKatakana => - _NSStringTransformLatinToKatakana.value; - - set NSStringTransformLatinToKatakana(NSStringTransform value) => - _NSStringTransformLatinToKatakana.value = value; - - late final ffi.Pointer _NSStringTransformLatinToHiragana = - _lookup('NSStringTransformLatinToHiragana'); - - NSStringTransform get NSStringTransformLatinToHiragana => - _NSStringTransformLatinToHiragana.value; - - set NSStringTransformLatinToHiragana(NSStringTransform value) => - _NSStringTransformLatinToHiragana.value = value; - - late final ffi.Pointer _NSStringTransformLatinToHangul = - _lookup('NSStringTransformLatinToHangul'); - - NSStringTransform get NSStringTransformLatinToHangul => - _NSStringTransformLatinToHangul.value; - - set NSStringTransformLatinToHangul(NSStringTransform value) => - _NSStringTransformLatinToHangul.value = value; - - late final ffi.Pointer _NSStringTransformLatinToArabic = - _lookup('NSStringTransformLatinToArabic'); - - NSStringTransform get NSStringTransformLatinToArabic => - _NSStringTransformLatinToArabic.value; - - set NSStringTransformLatinToArabic(NSStringTransform value) => - _NSStringTransformLatinToArabic.value = value; - - late final ffi.Pointer _NSStringTransformLatinToHebrew = - _lookup('NSStringTransformLatinToHebrew'); - - NSStringTransform get NSStringTransformLatinToHebrew => - _NSStringTransformLatinToHebrew.value; - - set NSStringTransformLatinToHebrew(NSStringTransform value) => - _NSStringTransformLatinToHebrew.value = value; - - late final ffi.Pointer _NSStringTransformLatinToThai = - _lookup('NSStringTransformLatinToThai'); - - NSStringTransform get NSStringTransformLatinToThai => - _NSStringTransformLatinToThai.value; - - set NSStringTransformLatinToThai(NSStringTransform value) => - _NSStringTransformLatinToThai.value = value; - - late final ffi.Pointer _NSStringTransformLatinToCyrillic = - _lookup('NSStringTransformLatinToCyrillic'); - - NSStringTransform get NSStringTransformLatinToCyrillic => - _NSStringTransformLatinToCyrillic.value; - - set NSStringTransformLatinToCyrillic(NSStringTransform value) => - _NSStringTransformLatinToCyrillic.value = value; - - late final ffi.Pointer _NSStringTransformLatinToGreek = - _lookup('NSStringTransformLatinToGreek'); - - NSStringTransform get NSStringTransformLatinToGreek => - _NSStringTransformLatinToGreek.value; - - set NSStringTransformLatinToGreek(NSStringTransform value) => - _NSStringTransformLatinToGreek.value = value; - - late final ffi.Pointer _NSStringTransformToLatin = - _lookup('NSStringTransformToLatin'); - - NSStringTransform get NSStringTransformToLatin => - _NSStringTransformToLatin.value; - - set NSStringTransformToLatin(NSStringTransform value) => - _NSStringTransformToLatin.value = value; - - late final ffi.Pointer _NSStringTransformMandarinToLatin = - _lookup('NSStringTransformMandarinToLatin'); - - NSStringTransform get NSStringTransformMandarinToLatin => - _NSStringTransformMandarinToLatin.value; - - set NSStringTransformMandarinToLatin(NSStringTransform value) => - _NSStringTransformMandarinToLatin.value = value; - - late final ffi.Pointer - _NSStringTransformHiraganaToKatakana = - _lookup('NSStringTransformHiraganaToKatakana'); - - NSStringTransform get NSStringTransformHiraganaToKatakana => - _NSStringTransformHiraganaToKatakana.value; - - set NSStringTransformHiraganaToKatakana(NSStringTransform value) => - _NSStringTransformHiraganaToKatakana.value = value; - - late final ffi.Pointer - _NSStringTransformFullwidthToHalfwidth = - _lookup('NSStringTransformFullwidthToHalfwidth'); - - NSStringTransform get NSStringTransformFullwidthToHalfwidth => - _NSStringTransformFullwidthToHalfwidth.value; - - set NSStringTransformFullwidthToHalfwidth(NSStringTransform value) => - _NSStringTransformFullwidthToHalfwidth.value = value; - - late final ffi.Pointer _NSStringTransformToXMLHex = - _lookup('NSStringTransformToXMLHex'); - - NSStringTransform get NSStringTransformToXMLHex => - _NSStringTransformToXMLHex.value; - - set NSStringTransformToXMLHex(NSStringTransform value) => - _NSStringTransformToXMLHex.value = value; - - late final ffi.Pointer _NSStringTransformToUnicodeName = - _lookup('NSStringTransformToUnicodeName'); - - NSStringTransform get NSStringTransformToUnicodeName => - _NSStringTransformToUnicodeName.value; - - set NSStringTransformToUnicodeName(NSStringTransform value) => - _NSStringTransformToUnicodeName.value = value; - - late final ffi.Pointer - _NSStringTransformStripCombiningMarks = - _lookup('NSStringTransformStripCombiningMarks'); - - NSStringTransform get NSStringTransformStripCombiningMarks => - _NSStringTransformStripCombiningMarks.value; - - set NSStringTransformStripCombiningMarks(NSStringTransform value) => - _NSStringTransformStripCombiningMarks.value = value; - - late final ffi.Pointer _NSStringTransformStripDiacritics = - _lookup('NSStringTransformStripDiacritics'); - - NSStringTransform get NSStringTransformStripDiacritics => - _NSStringTransformStripDiacritics.value; - - set NSStringTransformStripDiacritics(NSStringTransform value) => - _NSStringTransformStripDiacritics.value = value; - - late final ffi.Pointer - _NSStringEncodingDetectionSuggestedEncodingsKey = - _lookup( - 'NSStringEncodingDetectionSuggestedEncodingsKey'); - - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionSuggestedEncodingsKey => - _NSStringEncodingDetectionSuggestedEncodingsKey.value; - - set NSStringEncodingDetectionSuggestedEncodingsKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionSuggestedEncodingsKey.value = value; - - late final ffi.Pointer - _NSStringEncodingDetectionDisallowedEncodingsKey = - _lookup( - 'NSStringEncodingDetectionDisallowedEncodingsKey'); - - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionDisallowedEncodingsKey => - _NSStringEncodingDetectionDisallowedEncodingsKey.value; - - set NSStringEncodingDetectionDisallowedEncodingsKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionDisallowedEncodingsKey.value = value; - - late final ffi.Pointer - _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey = - _lookup( - 'NSStringEncodingDetectionUseOnlySuggestedEncodingsKey'); - - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionUseOnlySuggestedEncodingsKey => - _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value; - - set NSStringEncodingDetectionUseOnlySuggestedEncodingsKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value = value; - - late final ffi.Pointer - _NSStringEncodingDetectionAllowLossyKey = - _lookup( - 'NSStringEncodingDetectionAllowLossyKey'); - - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionAllowLossyKey => - _NSStringEncodingDetectionAllowLossyKey.value; - - set NSStringEncodingDetectionAllowLossyKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionAllowLossyKey.value = value; - - late final ffi.Pointer - _NSStringEncodingDetectionFromWindowsKey = - _lookup( - 'NSStringEncodingDetectionFromWindowsKey'); - - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionFromWindowsKey => - _NSStringEncodingDetectionFromWindowsKey.value; - - set NSStringEncodingDetectionFromWindowsKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionFromWindowsKey.value = value; - - late final ffi.Pointer - _NSStringEncodingDetectionLossySubstitutionKey = - _lookup( - 'NSStringEncodingDetectionLossySubstitutionKey'); - - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionLossySubstitutionKey => - _NSStringEncodingDetectionLossySubstitutionKey.value; - - set NSStringEncodingDetectionLossySubstitutionKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionLossySubstitutionKey.value = value; - - late final ffi.Pointer - _NSStringEncodingDetectionLikelyLanguageKey = - _lookup( - 'NSStringEncodingDetectionLikelyLanguageKey'); - - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionLikelyLanguageKey => - _NSStringEncodingDetectionLikelyLanguageKey.value; - - set NSStringEncodingDetectionLikelyLanguageKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionLikelyLanguageKey.value = value; - - late final ffi.Pointer _class_NSMutableString1 = - _getClass1("NSMutableString"); - late final ffi.Pointer _sel_replaceCharactersInRange_withString_1 = - _registerName1("replaceCharactersInRange:withString:"); - late final ffi.Pointer _sel_insertString_atIndex_1 = - _registerName1("insertString:atIndex:"); - late final ffi.Pointer _sel_deleteCharactersInRange_1 = - _registerName1("deleteCharactersInRange:"); - late final ffi.Pointer _sel_appendString_1 = - _registerName1("appendString:"); - late final ffi.Pointer _sel_appendFormat_1 = - _registerName1("appendFormat:"); - late final ffi.Pointer _sel_setString_1 = - _registerName1("setString:"); - late final ffi.Pointer - _sel_replaceOccurrencesOfString_withString_options_range_1 = - _registerName1("replaceOccurrencesOfString:withString:options:range:"); - int _objc_msgSend_164( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer target, - ffi.Pointer replacement, - int options, - NSRange searchRange, - ) { - return __objc_msgSend_164( - obj, - sel, - target, - replacement, - options, - searchRange, - ); - } - - late final __objc_msgSend_164Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_164 = __objc_msgSend_164Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, NSRange)>(); - - late final ffi.Pointer - _sel_applyTransform_reverse_range_updatedRange_1 = - _registerName1("applyTransform:reverse:range:updatedRange:"); - bool _objc_msgSend_165( - ffi.Pointer obj, - ffi.Pointer sel, - NSStringTransform transform, - bool reverse, - NSRange range, - NSRangePointer resultingRange, - ) { - return __objc_msgSend_165( - obj, - sel, - transform, - reverse ? 1 : 0, - range, - resultingRange, - ) != - 0; - } - - late final __objc_msgSend_165Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, - ffi.Pointer, - NSStringTransform, - ffi.Uint8, - NSRange, - NSRangePointer)>>('objc_msgSend'); - late final __objc_msgSend_165 = __objc_msgSend_165Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - NSStringTransform, int, NSRange, NSRangePointer)>(); - - ffi.Pointer _objc_msgSend_166( - ffi.Pointer obj, - ffi.Pointer sel, - int capacity, - ) { - return __objc_msgSend_166( - obj, - sel, - capacity, - ); - } - - late final __objc_msgSend_166Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_166 = __objc_msgSend_166Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_stringWithCapacity_1 = - _registerName1("stringWithCapacity:"); - late final ffi.Pointer _NSCharacterConversionException = - _lookup('NSCharacterConversionException'); - - NSExceptionName get NSCharacterConversionException => - _NSCharacterConversionException.value; - - set NSCharacterConversionException(NSExceptionName value) => - _NSCharacterConversionException.value = value; - - late final ffi.Pointer _NSParseErrorException = - _lookup('NSParseErrorException'); - - NSExceptionName get NSParseErrorException => _NSParseErrorException.value; - - set NSParseErrorException(NSExceptionName value) => - _NSParseErrorException.value = value; - - late final ffi.Pointer _class_Foo1 = _getClass1("Foo"); - late final ffi.Pointer _sel_intVal1 = _registerName1("intVal"); - int _objc_msgSend_167( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_167( - obj, - sel, - ); - } - - late final __objc_msgSend_167Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_167 = __objc_msgSend_167Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_setIntVal_1 = - _registerName1("setIntVal:"); - void _objc_msgSend_168( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_168( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_168Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_168 = __objc_msgSend_168Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_makeFoo_1 = _registerName1("makeFoo:"); - ffi.Pointer _objc_msgSend_169( - ffi.Pointer obj, - ffi.Pointer sel, - double x, - ) { - return __objc_msgSend_169( - obj, - sel, - x, - ); - } - - late final __objc_msgSend_169Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_169 = __objc_msgSend_169Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); - - late final ffi.Pointer _sel_multiply_withOtherFoo_1 = - _registerName1("multiply:withOtherFoo:"); - int _objc_msgSend_170( - ffi.Pointer obj, - ffi.Pointer sel, - bool useIntVals, - ffi.Pointer other, - ) { - return __objc_msgSend_170( - obj, - sel, - useIntVals ? 1 : 0, - other, - ); - } - - late final __objc_msgSend_170Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Uint8, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_170 = __objc_msgSend_170Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_setDoubleVal_1 = - _registerName1("setDoubleVal:"); - void _objc_msgSend_171( - ffi.Pointer obj, - ffi.Pointer sel, - double x, - ) { - return __objc_msgSend_171( - obj, - sel, - x, - ); - } - - late final __objc_msgSend_171Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_171 = __objc_msgSend_171Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, double)>(); -} - -abstract class NSComparisonResult { - static const int NSOrderedAscending = -1; - static const int NSOrderedSame = 0; - static const int NSOrderedDescending = 1; -} - -abstract class NSEnumerationOptions { - static const int NSEnumerationConcurrent = 1; - static const int NSEnumerationReverse = 2; -} - -abstract class NSSortOptions { - static const int NSSortConcurrent = 1; - static const int NSSortStable = 16; -} - -abstract class NSQualityOfService { - static const int NSQualityOfServiceUserInteractive = 33; - static const int NSQualityOfServiceUserInitiated = 25; - static const int NSQualityOfServiceUtility = 17; - static const int NSQualityOfServiceBackground = 9; - static const int NSQualityOfServiceDefault = -1; -} - -typedef NSInteger = pkg_ffi.Long; - -class __CFString extends ffi.Opaque {} - -abstract class CFComparisonResult { - static const int kCFCompareLessThan = -1; - static const int kCFCompareEqualTo = 0; - static const int kCFCompareGreaterThan = 1; -} - -typedef CFIndex = pkg_ffi.Long; - -class CFRange extends ffi.Struct { - @CFIndex() - external int location; - - @CFIndex() - external int length; -} - -class __CFNull extends ffi.Opaque {} - -typedef CFNullRef = ffi.Pointer<__CFNull>; - -class __CFAllocator extends ffi.Opaque {} - -typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; - -class CFAllocatorContext extends ffi.Struct { - @CFIndex() - external int version; - - external ffi.Pointer info; - - external CFAllocatorRetainCallBack retain; - - external CFAllocatorReleaseCallBack release; - - external CFAllocatorCopyDescriptionCallBack copyDescription; - - external CFAllocatorAllocateCallBack allocate; - - external CFAllocatorReallocateCallBack reallocate; - - external CFAllocatorDeallocateCallBack deallocate; - - external CFAllocatorPreferredSizeCallBack preferredSize; -} - -typedef CFAllocatorRetainCallBack = ffi.Pointer< - ffi.NativeFunction Function(ffi.Pointer)>>; -typedef CFAllocatorReleaseCallBack - = ffi.Pointer)>>; -typedef CFAllocatorCopyDescriptionCallBack = ffi - .Pointer)>>; -typedef CFStringRef = ffi.Pointer<__CFString>; -typedef CFAllocatorAllocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - CFIndex, CFOptionFlags, ffi.Pointer)>>; -typedef CFOptionFlags = pkg_ffi.UnsignedLong; -typedef CFAllocatorReallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, CFIndex, - CFOptionFlags, ffi.Pointer)>>; -typedef CFAllocatorDeallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; -typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< - ffi.NativeFunction< - CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; - -class _ObjCWrapper { - final ffi.Pointer _id; - final NativeObjCLibrary _lib; - - _ObjCWrapper._(this._id, this._lib); - - @override - bool operator ==(Object other) { - return other is _ObjCWrapper && _id == other._id; - } - - @override - int get hashCode => _id.hashCode; -} - -class NSObject extends _ObjCWrapper { - NSObject._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); - - static NSObject castFrom(T other) { - return NSObject._(other._id, other._lib); - } - - static NSObject castFromPointer( - NativeObjCLibrary lib, ffi.Pointer other) { - return NSObject._(other, lib); - } - - static void load(NativeObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); - } - - static void initialize(NativeObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); - } - - NSObject init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSObject._(_ret, _lib); - } - - static NSObject new1(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); - return NSObject._(_ret, _lib); - } - - static NSObject allocWithZone_( - NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject alloc(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); - return NSObject._(_ret, _lib); - } - - void dealloc() { - _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); - } - - void finalize() { - _lib._objc_msgSend_0(_id, _lib._sel_finalize1); - } - - NSObject copy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); - return NSObject._(_ret, _lib); - } - - NSObject mutableCopy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); - return NSObject._(_ret, _lib); - } - - static NSObject copyWithZone_( - NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject mutableCopyWithZone_( - NativeObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static bool instancesRespondToSelector_( - NativeObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_3(_lib._class_NSObject1, - _lib._sel_instancesRespondToSelector_1, aSelector); - } - - static bool conformsToProtocol_(NativeObjCLibrary _lib, NSObject? protocol) { - return _lib._objc_msgSend_4(_lib._class_NSObject1, - _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); - } - - IMP methodForSelector_(ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); - } - - static IMP instanceMethodForSelector_( - NativeObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_lib._class_NSObject1, - _lib._sel_instanceMethodForSelector_1, aSelector); - } - - void doesNotRecognizeSelector_(ffi.Pointer aSelector) { - _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); - } - - NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_7( - _id, _lib._sel_forwardingTargetForSelector_1, aSelector); - return NSObject._(_ret, _lib); - } - - void forwardInvocation_(NSObject? anInvocation) { - _lib._objc_msgSend_8( - _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); - } - - NSMethodSignature methodSignatureForSelector_( - ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9( - _id, _lib._sel_methodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - static NSMethodSignature instanceMethodSignatureForSelector_( - NativeObjCLibrary _lib, ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, - _lib._sel_instanceMethodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - bool allowsWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); - } - - bool retainWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); - } - - static bool isSubclassOfClass_(NativeObjCLibrary _lib, NSObject aClass) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); - } - - static bool resolveClassMethod_( - NativeObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); - } - - static bool resolveInstanceMethod_( - NativeObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); - } - - static int hash(NativeObjCLibrary _lib) { - return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); - } - - static NSObject superclass(NativeObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); - return NSObject._(_ret, _lib); - } - - static NSObject class1(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); - return NSObject._(_ret, _lib); - } - - static NSString description(NativeObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_75(_lib._class_NSObject1, _lib._sel_description1); - return NSString._(_ret, _lib); - } - - static NSString debugDescription(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_75( - _lib._class_NSObject1, _lib._sel_debugDescription1); - return NSString._(_ret, _lib); - } - - static int version(NativeObjCLibrary _lib) { - return _lib._objc_msgSend_32(_lib._class_NSObject1, _lib._sel_version1); - } - - static void setVersion_(NativeObjCLibrary _lib, int aVersion) { - _lib._objc_msgSend_76( - _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); - } - - NSObject get classForCoder { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); - return NSObject._(_ret, _lib); - } - - NSObject replacementObjectForCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - NSObject awakeAfterUsingCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static void poseAsClass_(NativeObjCLibrary _lib, NSObject aClass) { - _lib._objc_msgSend_8( - _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); - } - - NSObject get autoContentAccessingProxy { - final _ret = - _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); - return NSObject._(_ret, _lib); - } -} - -class ObjCSel extends ffi.Opaque {} - -class ObjCObject extends ffi.Opaque {} - -typedef instancetype = ffi.Pointer; - -class _NSZone extends ffi.Opaque {} - -typedef IMP = ffi.Pointer>; - -class NSMethodSignature extends _ObjCWrapper { - NSMethodSignature._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); - - static NSMethodSignature castFrom(T other) { - return NSMethodSignature._(other._id, other._lib); - } - - static NSMethodSignature castFromPointer( - NativeObjCLibrary lib, ffi.Pointer other) { - return NSMethodSignature._(other, lib); - } -} - -typedef NSUInteger = pkg_ffi.UnsignedLong; - -class NSString extends NSObject { - NSString._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); - - static NSString castFrom(T other) { - return NSString._(other._id, other._lib); - } - - static NSString castFromPointer( - NativeObjCLibrary lib, ffi.Pointer other) { - return NSString._(other, lib); - } - - factory NSString(NativeObjCLibrary _lib, String str) { - final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); - pkg_ffi.calloc.free(cstr); - return nsstr; - } - - @override - String toString() => (UTF8String).cast().toDartString(); - - int get length { - return _lib._objc_msgSend_11(_id, _lib._sel_length1); - } - - int characterAtIndex_(int index) { - return _lib._objc_msgSend_12(_id, _lib._sel_characterAtIndex_1, index); - } - - @override - NSString init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSString._(_ret, _lib); - } - - NSString initWithCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString substringFromIndex_(int from) { - final _ret = - _lib._objc_msgSend_14(_id, _lib._sel_substringFromIndex_1, from); - return NSString._(_ret, _lib); - } - - NSString substringToIndex_(int to) { - final _ret = _lib._objc_msgSend_14(_id, _lib._sel_substringToIndex_1, to); - return NSString._(_ret, _lib); - } - - NSString substringWithRange_(NSRange range) { - final _ret = - _lib._objc_msgSend_15(_id, _lib._sel_substringWithRange_1, range); - return NSString._(_ret, _lib); - } - - void getCharacters_range_(ffi.Pointer buffer, NSRange range) { - _lib._objc_msgSend_16(_id, _lib._sel_getCharacters_range_1, buffer, range); - } - - int compare_(NSObject? string) { - return _lib._objc_msgSend_17( - _id, _lib._sel_compare_1, string?._id ?? ffi.nullptr); - } - - int compare_options_(NSObject? string, int mask) { - return _lib._objc_msgSend_18( - _id, _lib._sel_compare_options_1, string?._id ?? ffi.nullptr, mask); - } - - int compare_options_range_( - NSObject? string, int mask, NSRange rangeOfReceiverToCompare) { - return _lib._objc_msgSend_19(_id, _lib._sel_compare_options_range_1, - string?._id ?? ffi.nullptr, mask, rangeOfReceiverToCompare); - } - - int compare_options_range_locale_(NSObject? string, int mask, - NSRange rangeOfReceiverToCompare, NSObject locale) { - return _lib._objc_msgSend_20(_id, _lib._sel_compare_options_range_locale_1, - string?._id ?? ffi.nullptr, mask, rangeOfReceiverToCompare, locale._id); - } - - int caseInsensitiveCompare_(NSObject? string) { - return _lib._objc_msgSend_17( - _id, _lib._sel_caseInsensitiveCompare_1, string?._id ?? ffi.nullptr); - } - - int localizedCompare_(NSObject? string) { - return _lib._objc_msgSend_17( - _id, _lib._sel_localizedCompare_1, string?._id ?? ffi.nullptr); - } - - int localizedCaseInsensitiveCompare_(NSObject? string) { - return _lib._objc_msgSend_17( - _id, - _lib._sel_localizedCaseInsensitiveCompare_1, - string?._id ?? ffi.nullptr); - } - - int localizedStandardCompare_(NSObject? string) { - return _lib._objc_msgSend_17( - _id, _lib._sel_localizedStandardCompare_1, string?._id ?? ffi.nullptr); - } - - bool isEqualToString_(NSObject? aString) { - return _lib._objc_msgSend_4( - _id, _lib._sel_isEqualToString_1, aString?._id ?? ffi.nullptr); - } - - bool hasPrefix_(NSObject? str) { - return _lib._objc_msgSend_4( - _id, _lib._sel_hasPrefix_1, str?._id ?? ffi.nullptr); - } - - bool hasSuffix_(NSObject? str) { - return _lib._objc_msgSend_4( - _id, _lib._sel_hasSuffix_1, str?._id ?? ffi.nullptr); - } - - NSString commonPrefixWithString_options_(NSObject? str, int mask) { - final _ret = _lib._objc_msgSend_21( - _id, - _lib._sel_commonPrefixWithString_options_1, - str?._id ?? ffi.nullptr, - mask); - return NSString._(_ret, _lib); - } - - bool containsString_(NSObject? str) { - return _lib._objc_msgSend_4( - _id, _lib._sel_containsString_1, str?._id ?? ffi.nullptr); - } - - bool localizedCaseInsensitiveContainsString_(NSObject? str) { - return _lib._objc_msgSend_4( - _id, - _lib._sel_localizedCaseInsensitiveContainsString_1, - str?._id ?? ffi.nullptr); - } - - bool localizedStandardContainsString_(NSObject? str) { - return _lib._objc_msgSend_4(_id, - _lib._sel_localizedStandardContainsString_1, str?._id ?? ffi.nullptr); - } - - NSRange localizedStandardRangeOfString_(NSObject? str) { - return _lib._objc_msgSend_22(_id, - _lib._sel_localizedStandardRangeOfString_1, str?._id ?? ffi.nullptr); - } - - NSRange rangeOfString_(NSObject? searchString) { - return _lib._objc_msgSend_22( - _id, _lib._sel_rangeOfString_1, searchString?._id ?? ffi.nullptr); - } - - NSRange rangeOfString_options_(NSObject? searchString, int mask) { - return _lib._objc_msgSend_23(_id, _lib._sel_rangeOfString_options_1, - searchString?._id ?? ffi.nullptr, mask); - } - - NSRange rangeOfString_options_range_( - NSObject? searchString, int mask, NSRange rangeOfReceiverToSearch) { - return _lib._objc_msgSend_24(_id, _lib._sel_rangeOfString_options_range_1, - searchString?._id ?? ffi.nullptr, mask, rangeOfReceiverToSearch); - } - - NSRange rangeOfString_options_range_locale_(NSObject? searchString, int mask, - NSRange rangeOfReceiverToSearch, NSObject? locale) { - return _lib._objc_msgSend_25( - _id, - _lib._sel_rangeOfString_options_range_locale_1, - searchString?._id ?? ffi.nullptr, - mask, - rangeOfReceiverToSearch, - locale?._id ?? ffi.nullptr); - } - - NSRange rangeOfCharacterFromSet_(NSObject? searchSet) { - return _lib._objc_msgSend_22(_id, _lib._sel_rangeOfCharacterFromSet_1, - searchSet?._id ?? ffi.nullptr); - } - - NSRange rangeOfCharacterFromSet_options_(NSObject? searchSet, int mask) { - return _lib._objc_msgSend_23( - _id, - _lib._sel_rangeOfCharacterFromSet_options_1, - searchSet?._id ?? ffi.nullptr, - mask); - } - - NSRange rangeOfCharacterFromSet_options_range_( - NSObject? searchSet, int mask, NSRange rangeOfReceiverToSearch) { - return _lib._objc_msgSend_24( - _id, - _lib._sel_rangeOfCharacterFromSet_options_range_1, - searchSet?._id ?? ffi.nullptr, - mask, - rangeOfReceiverToSearch); - } - - NSRange rangeOfComposedCharacterSequenceAtIndex_(int index) { - return _lib._objc_msgSend_26( - _id, _lib._sel_rangeOfComposedCharacterSequenceAtIndex_1, index); - } - - NSRange rangeOfComposedCharacterSequencesForRange_(NSRange range) { - return _lib._objc_msgSend_27( - _id, _lib._sel_rangeOfComposedCharacterSequencesForRange_1, range); - } - - NSString stringByAppendingString_(NSObject? aString) { - final _ret = _lib._objc_msgSend_28( - _id, _lib._sel_stringByAppendingString_1, aString?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString stringByAppendingFormat_(NSObject? format) { - final _ret = _lib._objc_msgSend_28( - _id, _lib._sel_stringByAppendingFormat_1, format?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - double get doubleValue { - return _lib._objc_msgSend_29(_id, _lib._sel_doubleValue1); - } - - double get floatValue { - return _lib._objc_msgSend_30(_id, _lib._sel_floatValue1); - } - - int get intValue { - return _lib._objc_msgSend_31(_id, _lib._sel_intValue1); - } - - int get integerValue { - return _lib._objc_msgSend_32(_id, _lib._sel_integerValue1); - } - - int get longLongValue { - return _lib._objc_msgSend_33(_id, _lib._sel_longLongValue1); - } - - bool get boolValue { - return _lib._objc_msgSend_10(_id, _lib._sel_boolValue1); - } - - NSObject? get uppercaseString { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_uppercaseString1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSObject? get lowercaseString { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_lowercaseString1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSObject? get capitalizedString { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_capitalizedString1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSObject? get localizedUppercaseString { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_localizedUppercaseString1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSObject? get localizedLowercaseString { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_localizedLowercaseString1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSObject? get localizedCapitalizedString { - final _ret = - _lib._objc_msgSend_1(_id, _lib._sel_localizedCapitalizedString1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSString uppercaseStringWithLocale_(NSObject? locale) { - final _ret = _lib._objc_msgSend_28( - _id, _lib._sel_uppercaseStringWithLocale_1, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString lowercaseStringWithLocale_(NSObject? locale) { - final _ret = _lib._objc_msgSend_28( - _id, _lib._sel_lowercaseStringWithLocale_1, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString capitalizedStringWithLocale_(NSObject? locale) { - final _ret = _lib._objc_msgSend_28(_id, - _lib._sel_capitalizedStringWithLocale_1, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - void getLineStart_end_contentsEnd_forRange_( - ffi.Pointer startPtr, - ffi.Pointer lineEndPtr, - ffi.Pointer contentsEndPtr, - NSRange range) { - _lib._objc_msgSend_34( - _id, - _lib._sel_getLineStart_end_contentsEnd_forRange_1, - startPtr, - lineEndPtr, - contentsEndPtr, - range); - } - - NSRange lineRangeForRange_(NSRange range) { - return _lib._objc_msgSend_27(_id, _lib._sel_lineRangeForRange_1, range); - } - - void getParagraphStart_end_contentsEnd_forRange_( - ffi.Pointer startPtr, - ffi.Pointer parEndPtr, - ffi.Pointer contentsEndPtr, - NSRange range) { - _lib._objc_msgSend_34( - _id, - _lib._sel_getParagraphStart_end_contentsEnd_forRange_1, - startPtr, - parEndPtr, - contentsEndPtr, - range); - } - - NSRange paragraphRangeForRange_(NSRange range) { - return _lib._objc_msgSend_27( - _id, _lib._sel_paragraphRangeForRange_1, range); - } - - void enumerateSubstringsInRange_options_usingBlock_( - NSRange range, int opts, ObjCBlock block) { - _lib._objc_msgSend_35( - _id, - _lib._sel_enumerateSubstringsInRange_options_usingBlock_1, - range, - opts, - block._impl); - } - - void enumerateLinesUsingBlock_(ObjCBlock1 block) { - _lib._objc_msgSend_36( - _id, _lib._sel_enumerateLinesUsingBlock_1, block._impl); - } - - ffi.Pointer get UTF8String { - return _lib._objc_msgSend_37(_id, _lib._sel_UTF8String1); - } - - int get fastestEncoding { - return _lib._objc_msgSend_11(_id, _lib._sel_fastestEncoding1); - } - - int get smallestEncoding { - return _lib._objc_msgSend_11(_id, _lib._sel_smallestEncoding1); - } - - NSData dataUsingEncoding_allowLossyConversion_(int encoding, bool lossy) { - final _ret = _lib._objc_msgSend_38(_id, - _lib._sel_dataUsingEncoding_allowLossyConversion_1, encoding, lossy); - return NSData._(_ret, _lib); - } - - NSData dataUsingEncoding_(int encoding) { - final _ret = - _lib._objc_msgSend_39(_id, _lib._sel_dataUsingEncoding_1, encoding); - return NSData._(_ret, _lib); - } - - bool canBeConvertedToEncoding_(int encoding) { - return _lib._objc_msgSend_40( - _id, _lib._sel_canBeConvertedToEncoding_1, encoding); - } - - void cStringUsingEncoding_(int encoding) { - _lib._objc_msgSend_41(_id, _lib._sel_cStringUsingEncoding_1, encoding); - } - - bool getCString_maxLength_encoding_( - ffi.Pointer buffer, int maxBufferCount, int encoding) { - return _lib._objc_msgSend_42(_id, _lib._sel_getCString_maxLength_encoding_1, - buffer, maxBufferCount, encoding); - } - - bool getBytes_maxLength_usedLength_encoding_options_range_remainingRange_( - ffi.Pointer buffer, - int maxBufferCount, - ffi.Pointer usedBufferCount, - int encoding, - int options, - NSRange range, - NSRangePointer leftover) { - return _lib._objc_msgSend_43( - _id, - _lib._sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_1, - buffer, - maxBufferCount, - usedBufferCount, - encoding, - options, - range, - leftover); - } - - int maximumLengthOfBytesUsingEncoding_(int enc) { - return _lib._objc_msgSend_44( - _id, _lib._sel_maximumLengthOfBytesUsingEncoding_1, enc); - } - - int lengthOfBytesUsingEncoding_(int enc) { - return _lib._objc_msgSend_44( - _id, _lib._sel_lengthOfBytesUsingEncoding_1, enc); - } - - static ffi.Pointer getAvailableStringEncodings( - NativeObjCLibrary _lib) { - return _lib._objc_msgSend_45( - _lib._class_NSString1, _lib._sel_availableStringEncodings1); - } - - static NSString localizedNameOfStringEncoding_( - NativeObjCLibrary _lib, int encoding) { - final _ret = _lib._objc_msgSend_14(_lib._class_NSString1, - _lib._sel_localizedNameOfStringEncoding_1, encoding); - return NSString._(_ret, _lib); - } - - static int getDefaultCStringEncoding(NativeObjCLibrary _lib) { - return _lib._objc_msgSend_11( - _lib._class_NSString1, _lib._sel_defaultCStringEncoding1); - } - - NSObject? get decomposedStringWithCanonicalMapping { - final _ret = _lib._objc_msgSend_1( - _id, _lib._sel_decomposedStringWithCanonicalMapping1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSObject? get precomposedStringWithCanonicalMapping { - final _ret = _lib._objc_msgSend_1( - _id, _lib._sel_precomposedStringWithCanonicalMapping1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSObject? get decomposedStringWithCompatibilityMapping { - final _ret = _lib._objc_msgSend_1( - _id, _lib._sel_decomposedStringWithCompatibilityMapping1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSObject? get precomposedStringWithCompatibilityMapping { - final _ret = _lib._objc_msgSend_1( - _id, _lib._sel_precomposedStringWithCompatibilityMapping1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSString stringByTrimmingCharactersInSet_(NSObject? set) { - final _ret = _lib._objc_msgSend_28(_id, - _lib._sel_stringByTrimmingCharactersInSet_1, set?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString stringByPaddingToLength_withString_startingAtIndex_( - int newLength, NSObject? padString, int padIndex) { - final _ret = _lib._objc_msgSend_46( - _id, - _lib._sel_stringByPaddingToLength_withString_startingAtIndex_1, - newLength, - padString?._id ?? ffi.nullptr, - padIndex); - return NSString._(_ret, _lib); - } - - NSString stringByFoldingWithOptions_locale_(int options, NSObject? locale) { - final _ret = _lib._objc_msgSend_47( - _id, - _lib._sel_stringByFoldingWithOptions_locale_1, - options, - locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString stringByReplacingOccurrencesOfString_withString_options_range_( - NSObject? target, - NSObject? replacement, - int options, - NSRange searchRange) { - final _ret = _lib._objc_msgSend_48( - _id, - _lib._sel_stringByReplacingOccurrencesOfString_withString_options_range_1, - target?._id ?? ffi.nullptr, - replacement?._id ?? ffi.nullptr, - options, - searchRange); - return NSString._(_ret, _lib); - } - - NSString stringByReplacingOccurrencesOfString_withString_( - NSObject? target, NSObject? replacement) { - final _ret = _lib._objc_msgSend_49( - _id, - _lib._sel_stringByReplacingOccurrencesOfString_withString_1, - target?._id ?? ffi.nullptr, - replacement?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString stringByReplacingCharactersInRange_withString_( - NSRange range, NSObject? replacement) { - final _ret = _lib._objc_msgSend_50( - _id, - _lib._sel_stringByReplacingCharactersInRange_withString_1, - range, - replacement?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString stringByApplyingTransform_reverse_( - NSStringTransform transform, bool reverse) { - final _ret = _lib._objc_msgSend_51( - _id, _lib._sel_stringByApplyingTransform_reverse_1, transform, reverse); - return NSString._(_ret, _lib); - } - - bool writeToURL_atomically_encoding_error_( - NSObject? url, - bool useAuxiliaryFile, - int enc, - ffi.Pointer> error) { - return _lib._objc_msgSend_52( - _id, - _lib._sel_writeToURL_atomically_encoding_error_1, - url?._id ?? ffi.nullptr, - useAuxiliaryFile, - enc, - error); - } - - bool writeToFile_atomically_encoding_error_( - NSObject? path, - bool useAuxiliaryFile, - int enc, - ffi.Pointer> error) { - return _lib._objc_msgSend_52( - _id, - _lib._sel_writeToFile_atomically_encoding_error_1, - path?._id ?? ffi.nullptr, - useAuxiliaryFile, - enc, - error); - } - - NSObject? get description { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_description1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - int get hash { - return _lib._objc_msgSend_11(_id, _lib._sel_hash1); - } - - NSString initWithCharactersNoCopy_length_freeWhenDone_( - ffi.Pointer characters, int length, bool freeBuffer) { - final _ret = _lib._objc_msgSend_53( - _id, - _lib._sel_initWithCharactersNoCopy_length_freeWhenDone_1, - characters, - length, - freeBuffer); - return NSString._(_ret, _lib); - } - - NSString initWithCharactersNoCopy_length_deallocator_( - ffi.Pointer chars, int len, ObjCBlock2 deallocator) { - final _ret = _lib._objc_msgSend_54( - _id, - _lib._sel_initWithCharactersNoCopy_length_deallocator_1, - chars, - len, - deallocator._impl); - return NSString._(_ret, _lib); - } - - NSString initWithCharacters_length_( - ffi.Pointer characters, int length) { - final _ret = _lib._objc_msgSend_55( - _id, _lib._sel_initWithCharacters_length_1, characters, length); - return NSString._(_ret, _lib); - } - - NSString initWithUTF8String_( - ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_56( - _id, _lib._sel_initWithUTF8String_1, nullTerminatedCString); - return NSString._(_ret, _lib); - } - - NSString initWithString_(NSObject? aString) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithString_1, aString?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString initWithFormat_(NSObject? format) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithFormat_1, format?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString initWithFormat_arguments_( - NSObject? format, ffi.Pointer<__va_list_tag> argList) { - final _ret = _lib._objc_msgSend_57( - _id, - _lib._sel_initWithFormat_arguments_1, - format?._id ?? ffi.nullptr, - argList); - return NSString._(_ret, _lib); - } - - NSString initWithFormat_locale_(NSObject? format, NSObject locale) { - final _ret = _lib._objc_msgSend_58(_id, _lib._sel_initWithFormat_locale_1, - format?._id ?? ffi.nullptr, locale._id); - return NSString._(_ret, _lib); - } - - NSString initWithFormat_locale_arguments_( - NSObject? format, NSObject locale, ffi.Pointer<__va_list_tag> argList) { - final _ret = _lib._objc_msgSend_59( - _id, - _lib._sel_initWithFormat_locale_arguments_1, - format?._id ?? ffi.nullptr, - locale._id, - argList); - return NSString._(_ret, _lib); - } - - NSString initWithData_encoding_(NSObject? data, int encoding) { - final _ret = _lib._objc_msgSend_60(_id, _lib._sel_initWithData_encoding_1, - data?._id ?? ffi.nullptr, encoding); - return NSString._(_ret, _lib); - } - - NSString initWithBytes_length_encoding_( - ffi.Pointer bytes, int len, int encoding) { - final _ret = _lib._objc_msgSend_61( - _id, _lib._sel_initWithBytes_length_encoding_1, bytes, len, encoding); - return NSString._(_ret, _lib); - } - - NSString initWithBytesNoCopy_length_encoding_freeWhenDone_( - ffi.Pointer bytes, int len, int encoding, bool freeBuffer) { - final _ret = _lib._objc_msgSend_62( - _id, - _lib._sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1, - bytes, - len, - encoding, - freeBuffer); - return NSString._(_ret, _lib); - } - - NSString initWithBytesNoCopy_length_encoding_deallocator_( - ffi.Pointer bytes, - int len, - int encoding, - ObjCBlock3 deallocator) { - final _ret = _lib._objc_msgSend_63( - _id, - _lib._sel_initWithBytesNoCopy_length_encoding_deallocator_1, - bytes, - len, - encoding, - deallocator._impl); - return NSString._(_ret, _lib); - } - - static NSString string(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSString1, _lib._sel_string1); - return NSString._(_ret, _lib); - } - - static NSString stringWithString_(NativeObjCLibrary _lib, NSObject? string) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, - _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - static NSString stringWithCharacters_length_( - NativeObjCLibrary _lib, ffi.Pointer characters, int length) { - final _ret = _lib._objc_msgSend_55(_lib._class_NSString1, - _lib._sel_stringWithCharacters_length_1, characters, length); - return NSString._(_ret, _lib); - } - - static NSString stringWithUTF8String_( - NativeObjCLibrary _lib, ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_56(_lib._class_NSString1, - _lib._sel_stringWithUTF8String_1, nullTerminatedCString); - return NSString._(_ret, _lib); - } - - static NSString stringWithFormat_(NativeObjCLibrary _lib, NSObject? format) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, - _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - static NSString localizedStringWithFormat_( - NativeObjCLibrary _lib, NSObject? format) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, - _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString initWithCString_encoding_( - ffi.Pointer nullTerminatedCString, int encoding) { - final _ret = _lib._objc_msgSend_64(_id, - _lib._sel_initWithCString_encoding_1, nullTerminatedCString, encoding); - return NSString._(_ret, _lib); - } - - static NSString stringWithCString_encoding_( - NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_64(_lib._class_NSString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return NSString._(_ret, _lib); - } - - NSString initWithContentsOfURL_encoding_error_( - NSObject? url, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( - _id, - _lib._sel_initWithContentsOfURL_encoding_error_1, - url?._id ?? ffi.nullptr, - enc, - error); - return NSString._(_ret, _lib); - } - - NSString initWithContentsOfFile_encoding_error_( - NSObject? path, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( - _id, - _lib._sel_initWithContentsOfFile_encoding_error_1, - path?._id ?? ffi.nullptr, - enc, - error); - return NSString._(_ret, _lib); - } - - static NSString stringWithContentsOfURL_encoding_error_( - NativeObjCLibrary _lib, - NSObject? url, - int enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( - _lib._class_NSString1, - _lib._sel_stringWithContentsOfURL_encoding_error_1, - url?._id ?? ffi.nullptr, - enc, - error); - return NSString._(_ret, _lib); - } - - static NSString stringWithContentsOfFile_encoding_error_( - NativeObjCLibrary _lib, - NSObject? path, - int enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( - _lib._class_NSString1, - _lib._sel_stringWithContentsOfFile_encoding_error_1, - path?._id ?? ffi.nullptr, - enc, - error); - return NSString._(_ret, _lib); - } - - NSString initWithContentsOfURL_usedEncoding_error_( - NSObject? url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_66( - _id, - _lib._sel_initWithContentsOfURL_usedEncoding_error_1, - url?._id ?? ffi.nullptr, - enc, - error); - return NSString._(_ret, _lib); - } - - NSString initWithContentsOfFile_usedEncoding_error_( - NSObject? path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_66( - _id, - _lib._sel_initWithContentsOfFile_usedEncoding_error_1, - path?._id ?? ffi.nullptr, - enc, - error); - return NSString._(_ret, _lib); - } - - static NSString stringWithContentsOfURL_usedEncoding_error_( - NativeObjCLibrary _lib, - NSObject? url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_66( - _lib._class_NSString1, - _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, - url?._id ?? ffi.nullptr, - enc, - error); - return NSString._(_ret, _lib); - } - - static NSString stringWithContentsOfFile_usedEncoding_error_( - NativeObjCLibrary _lib, - NSObject? path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_66( - _lib._class_NSString1, - _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, - path?._id ?? ffi.nullptr, - enc, - error); - return NSString._(_ret, _lib); - } - - static int - stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( - NativeObjCLibrary _lib, - NSObject? data, - NSObject? opts, - ffi.Pointer> string, - ffi.Pointer usedLossyConversion) { - return _lib._objc_msgSend_67( - _lib._class_NSString1, - _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, - data?._id ?? ffi.nullptr, - opts?._id ?? ffi.nullptr, - string, - usedLossyConversion); - } - - NSObject propertyList() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_propertyList1); - return NSObject._(_ret, _lib); - } - - NSDictionary propertyListFromStringsFileFormat() { - final _ret = _lib._objc_msgSend_68( - _id, _lib._sel_propertyListFromStringsFileFormat1); - return NSDictionary._(_ret, _lib); - } - - void cString() { - _lib._objc_msgSend_0(_id, _lib._sel_cString1); - } - - void lossyCString() { - _lib._objc_msgSend_0(_id, _lib._sel_lossyCString1); - } - - int cStringLength() { - return _lib._objc_msgSend_11(_id, _lib._sel_cStringLength1); - } - - void getCString_(ffi.Pointer bytes) { - _lib._objc_msgSend_69(_id, _lib._sel_getCString_1, bytes); - } - - void getCString_maxLength_(ffi.Pointer bytes, int maxLength) { - _lib._objc_msgSend_70( - _id, _lib._sel_getCString_maxLength_1, bytes, maxLength); - } - - void getCString_maxLength_range_remainingRange_( - ffi.Pointer bytes, - int maxLength, - NSRange aRange, - NSRangePointer leftoverRange) { - _lib._objc_msgSend_71( - _id, - _lib._sel_getCString_maxLength_range_remainingRange_1, - bytes, - maxLength, - aRange, - leftoverRange); - } - - bool writeToFile_atomically_(NSObject? path, bool useAuxiliaryFile) { - return _lib._objc_msgSend_72(_id, _lib._sel_writeToFile_atomically_1, - path?._id ?? ffi.nullptr, useAuxiliaryFile); - } - - bool writeToURL_atomically_(NSObject? url, bool atomically) { - return _lib._objc_msgSend_72(_id, _lib._sel_writeToURL_atomically_1, - url?._id ?? ffi.nullptr, atomically); - } - - NSObject initWithContentsOfFile_(NSObject? path) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - NSObject initWithContentsOfURL_(NSObject? url) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static NSObject stringWithContentsOfFile_( - NativeObjCLibrary _lib, NSObject? path) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, - _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static NSObject stringWithContentsOfURL_( - NativeObjCLibrary _lib, NSObject? url) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, - _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - NSObject initWithCStringNoCopy_length_freeWhenDone_( - ffi.Pointer bytes, int length, bool freeBuffer) { - final _ret = _lib._objc_msgSend_73( - _id, - _lib._sel_initWithCStringNoCopy_length_freeWhenDone_1, - bytes, - length, - freeBuffer); - return NSObject._(_ret, _lib); - } - - NSObject initWithCString_length_( - ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_64( - _id, _lib._sel_initWithCString_length_1, bytes, length); - return NSObject._(_ret, _lib); - } - - NSObject initWithCString_(ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_56(_id, _lib._sel_initWithCString_1, bytes); - return NSObject._(_ret, _lib); - } - - static NSObject stringWithCString_length_( - NativeObjCLibrary _lib, ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_64(_lib._class_NSString1, - _lib._sel_stringWithCString_length_1, bytes, length); - return NSObject._(_ret, _lib); - } - - static NSObject stringWithCString_( - NativeObjCLibrary _lib, ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_56( - _lib._class_NSString1, _lib._sel_stringWithCString_1, bytes); - return NSObject._(_ret, _lib); - } - - void getCharacters_(ffi.Pointer buffer) { - _lib._objc_msgSend_74(_id, _lib._sel_getCharacters_1, buffer); - } - - static NSString new1(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSString1, _lib._sel_new1); - return NSString._(_ret, _lib); - } - - static NSString alloc(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSString1, _lib._sel_alloc1); - return NSString._(_ret, _lib); - } -} - -extension StringToNSString on String { - NSString toNSString(NativeObjCLibrary lib) => NSString(lib, this); -} - -typedef unichar = pkg_ffi.UnsignedShort; -typedef NSRange = _NSRange; - -class _NSRange extends ffi.Struct { - @NSUInteger() - external int location; - - @NSUInteger() - external int length; -} - -abstract class NSStringCompareOptions { - static const int NSCaseInsensitiveSearch = 1; - static const int NSLiteralSearch = 2; - static const int NSBackwardsSearch = 4; - static const int NSAnchoredSearch = 8; - static const int NSNumericSearch = 64; - static const int NSDiacriticInsensitiveSearch = 128; - static const int NSWidthInsensitiveSearch = 256; - static const int NSForcedOrderingSearch = 512; - static const int NSRegularExpressionSearch = 1024; -} - -abstract class NSStringEnumerationOptions { - static const int NSStringEnumerationByLines = 0; - static const int NSStringEnumerationByParagraphs = 1; - static const int NSStringEnumerationByComposedCharacterSequences = 2; - static const int NSStringEnumerationByWords = 3; - static const int NSStringEnumerationBySentences = 4; - static const int NSStringEnumerationByCaretPositions = 5; - static const int NSStringEnumerationByDeletionClusters = 6; - static const int NSStringEnumerationReverse = 256; - static const int NSStringEnumerationSubstringNotRequired = 512; - static const int NSStringEnumerationLocalized = 1024; -} - -void _ObjCBlock_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSRange arg1, - NSRange arg2, - ffi.Pointer arg3) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, NSRange arg1, - NSRange arg2, ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer arg0, - NSRange arg1, - NSRange arg2, - ffi.Pointer arg3)>()(arg0, arg1, arg2, arg3); -} - -class ObjCBlock { - final ffi.Pointer<_ObjCBlock> _impl; - final NativeObjCLibrary _lib; - ObjCBlock._(this._impl, this._lib); - - ObjCBlock.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, NSRange arg1, - NSRange arg2, ffi.Pointer arg3)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSRange arg1, - NSRange arg2, - ffi.Pointer arg3)>( - _ObjCBlock_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -class _ObjCBlockDesc extends ffi.Struct { - @pkg_ffi.UnsignedLong() - external int reserved; - - @pkg_ffi.UnsignedLong() - external int size; - - external ffi.Pointer copy_helper; - - external ffi.Pointer dispose_helper; - - external ffi.Pointer signature; -} - -class _ObjCBlock extends ffi.Struct { - external ffi.Pointer isa; - - @pkg_ffi.Int() - external int flags; - - @pkg_ffi.Int() - external int reserved; - - external ffi.Pointer invoke; - - external ffi.Pointer<_ObjCBlockDesc> descriptor; - - external ffi.Pointer target; -} - -void _ObjCBlock1_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, ffi.Pointer arg1) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>()(arg0, arg1); -} - -class ObjCBlock1 { - final ffi.Pointer<_ObjCBlock> _impl; - final NativeObjCLibrary _lib; - ObjCBlock1._(this._impl, this._lib); - - ObjCBlock1.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : _impl = - _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock1_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -typedef NSStringEncoding = NSUInteger; - -class NSData extends _ObjCWrapper { - NSData._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); - - static NSData castFrom(T other) { - return NSData._(other._id, other._lib); - } - - static NSData castFromPointer( - NativeObjCLibrary lib, ffi.Pointer other) { - return NSData._(other, lib); - } -} - -abstract class NSStringEncodingConversionOptions { - static const int NSStringEncodingConversionAllowLossy = 1; - static const int NSStringEncodingConversionExternalRepresentation = 2; -} - -typedef NSRangePointer = ffi.Pointer; -typedef NSStringTransform = ffi.Pointer; -void _ObjCBlock2_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, NSUInteger arg1)>>() - .asFunction< - void Function(ffi.Pointer arg0, int arg1)>()(arg0, arg1); -} - -class ObjCBlock2 { - final ffi.Pointer<_ObjCBlock> _impl; - final NativeObjCLibrary _lib; - ObjCBlock2._(this._impl, this._lib); - - ObjCBlock2.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, NSUInteger arg1)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSUInteger arg1)>(_ObjCBlock2_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -class __va_list_tag extends ffi.Struct { - @pkg_ffi.UnsignedInt() - external int gp_offset; - - @pkg_ffi.UnsignedInt() - external int fp_offset; - - external ffi.Pointer overflow_arg_area; - - external ffi.Pointer reg_save_area; -} - -void _ObjCBlock3_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, NSUInteger arg1)>>() - .asFunction< - void Function(ffi.Pointer arg0, int arg1)>()(arg0, arg1); -} - -class ObjCBlock3 { - final ffi.Pointer<_ObjCBlock> _impl; - final NativeObjCLibrary _lib; - ObjCBlock3._(this._impl, this._lib); - - ObjCBlock3.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, NSUInteger arg1)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSUInteger arg1)>(_ObjCBlock3_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -class NSDictionary extends _ObjCWrapper { - NSDictionary._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); - - static NSDictionary castFrom(T other) { - return NSDictionary._(other._id, other._lib); - } - - static NSDictionary castFromPointer( - NativeObjCLibrary lib, ffi.Pointer other) { - return NSDictionary._(other, lib); - } -} - -class NSValue extends NSObject { - NSValue._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); - - static NSValue castFrom(T other) { - return NSValue._(other._id, other._lib); - } - - static NSValue castFromPointer( - NativeObjCLibrary lib, ffi.Pointer other) { - return NSValue._(other, lib); - } - - void getValue_size_(ffi.Pointer value, int size) { - _lib._objc_msgSend_77(_id, _lib._sel_getValue_size_1, value, size); - } - - ffi.Pointer get objCType { - return _lib._objc_msgSend_37(_id, _lib._sel_objCType1); - } - - NSValue initWithBytes_objCType_( - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_78( - _id, _lib._sel_initWithBytes_objCType_1, value, type); - return NSValue._(_ret, _lib); - } - - NSValue initWithCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); - return NSValue._(_ret, _lib); - } - - static NSValue valueWithBytes_objCType_(NativeObjCLibrary _lib, - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_79( - _lib._class_NSValue1, _lib._sel_valueWithBytes_objCType_1, value, type); - return NSValue._(_ret, _lib); - } - - static NSValue value_withObjCType_(NativeObjCLibrary _lib, - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_79( - _lib._class_NSValue1, _lib._sel_value_withObjCType_1, value, type); - return NSValue._(_ret, _lib); - } - - static NSValue valueWithNonretainedObject_( - NativeObjCLibrary _lib, NSObject anObject) { - final _ret = _lib._objc_msgSend_80(_lib._class_NSValue1, - _lib._sel_valueWithNonretainedObject_1, anObject._id); - return NSValue._(_ret, _lib); - } - - NSObject get nonretainedObjectValue { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_nonretainedObjectValue1); - return NSObject._(_ret, _lib); - } - - static NSValue valueWithPointer_( - NativeObjCLibrary _lib, ffi.Pointer pointer) { - final _ret = _lib._objc_msgSend_81( - _lib._class_NSValue1, _lib._sel_valueWithPointer_1, pointer); - return NSValue._(_ret, _lib); - } - - ffi.Pointer get pointerValue { - return _lib._objc_msgSend_82(_id, _lib._sel_pointerValue1); - } - - bool isEqualToValue_(NSObject? value) { - return _lib._objc_msgSend_4( - _id, _lib._sel_isEqualToValue_1, value?._id ?? ffi.nullptr); - } - - void getValue_(ffi.Pointer value) { - _lib._objc_msgSend_83(_id, _lib._sel_getValue_1, value); - } - - static NSValue valueWithRange_(NativeObjCLibrary _lib, NSRange range) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSValue1, _lib._sel_valueWithRange_1, range); - return NSValue._(_ret, _lib); - } - - NSRange get rangeValue { - return _lib._objc_msgSend_85(_id, _lib._sel_rangeValue1); - } - - static NSValue new1(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSValue1, _lib._sel_new1); - return NSValue._(_ret, _lib); - } - - static NSValue alloc(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSValue1, _lib._sel_alloc1); - return NSValue._(_ret, _lib); - } -} - -class NSNumber extends NSValue { - NSNumber._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); - - static NSNumber castFrom(T other) { - return NSNumber._(other._id, other._lib); - } - - static NSNumber castFromPointer( - NativeObjCLibrary lib, ffi.Pointer other) { - return NSNumber._(other, lib); - } - - @override - NSNumber initWithCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithChar_(int value) { - final _ret = _lib._objc_msgSend_86(_id, _lib._sel_initWithChar_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithUnsignedChar_(int value) { - final _ret = - _lib._objc_msgSend_87(_id, _lib._sel_initWithUnsignedChar_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithShort_(int value) { - final _ret = _lib._objc_msgSend_88(_id, _lib._sel_initWithShort_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithUnsignedShort_(int value) { - final _ret = - _lib._objc_msgSend_89(_id, _lib._sel_initWithUnsignedShort_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithInt_(int value) { - final _ret = _lib._objc_msgSend_90(_id, _lib._sel_initWithInt_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithUnsignedInt_(int value) { - final _ret = - _lib._objc_msgSend_91(_id, _lib._sel_initWithUnsignedInt_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithLong_(int value) { - final _ret = _lib._objc_msgSend_92(_id, _lib._sel_initWithLong_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithUnsignedLong_(int value) { - final _ret = - _lib._objc_msgSend_93(_id, _lib._sel_initWithUnsignedLong_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithLongLong_(int value) { - final _ret = - _lib._objc_msgSend_94(_id, _lib._sel_initWithLongLong_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithUnsignedLongLong_(int value) { - final _ret = - _lib._objc_msgSend_95(_id, _lib._sel_initWithUnsignedLongLong_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithFloat_(double value) { - final _ret = _lib._objc_msgSend_96(_id, _lib._sel_initWithFloat_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithDouble_(double value) { - final _ret = _lib._objc_msgSend_97(_id, _lib._sel_initWithDouble_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithBool_(bool value) { - final _ret = _lib._objc_msgSend_98(_id, _lib._sel_initWithBool_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithInteger_(int value) { - final _ret = _lib._objc_msgSend_92(_id, _lib._sel_initWithInteger_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithUnsignedInteger_(int value) { - final _ret = - _lib._objc_msgSend_93(_id, _lib._sel_initWithUnsignedInteger_1, value); - return NSNumber._(_ret, _lib); - } - - int get charValue { - return _lib._objc_msgSend_99(_id, _lib._sel_charValue1); - } - - int get unsignedCharValue { - return _lib._objc_msgSend_100(_id, _lib._sel_unsignedCharValue1); - } - - int get shortValue { - return _lib._objc_msgSend_101(_id, _lib._sel_shortValue1); - } - - int get unsignedShortValue { - return _lib._objc_msgSend_102(_id, _lib._sel_unsignedShortValue1); - } - - int get intValue { - return _lib._objc_msgSend_31(_id, _lib._sel_intValue1); - } - - int get unsignedIntValue { - return _lib._objc_msgSend_103(_id, _lib._sel_unsignedIntValue1); - } - - int get longValue { - return _lib._objc_msgSend_32(_id, _lib._sel_longValue1); - } - - int get unsignedLongValue { - return _lib._objc_msgSend_11(_id, _lib._sel_unsignedLongValue1); - } - - int get longLongValue { - return _lib._objc_msgSend_33(_id, _lib._sel_longLongValue1); - } - - int get unsignedLongLongValue { - return _lib._objc_msgSend_104(_id, _lib._sel_unsignedLongLongValue1); - } - - double get floatValue { - return _lib._objc_msgSend_30(_id, _lib._sel_floatValue1); - } - - double get doubleValue { - return _lib._objc_msgSend_29(_id, _lib._sel_doubleValue1); - } - - bool get boolValue { - return _lib._objc_msgSend_10(_id, _lib._sel_boolValue1); - } - - int get integerValue { - return _lib._objc_msgSend_32(_id, _lib._sel_integerValue1); - } - - int get unsignedIntegerValue { - return _lib._objc_msgSend_11(_id, _lib._sel_unsignedIntegerValue1); - } - - NSObject? get stringValue { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_stringValue1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - int compare_(NSObject? otherNumber) { - return _lib._objc_msgSend_17( - _id, _lib._sel_compare_1, otherNumber?._id ?? ffi.nullptr); - } - - bool isEqualToNumber_(NSObject? number) { - return _lib._objc_msgSend_4( - _id, _lib._sel_isEqualToNumber_1, number?._id ?? ffi.nullptr); - } - - NSString descriptionWithLocale_(NSObject locale) { - final _ret = _lib._objc_msgSend_28( - _id, _lib._sel_descriptionWithLocale_1, locale._id); - return NSString._(_ret, _lib); - } - - static NSNumber numberWithChar_(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_86( - _lib._class_NSNumber1, _lib._sel_numberWithChar_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithUnsignedChar_(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_87( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedChar_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithShort_(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_88( - _lib._class_NSNumber1, _lib._sel_numberWithShort_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithUnsignedShort_(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_89( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedShort_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithInt_(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_90( - _lib._class_NSNumber1, _lib._sel_numberWithInt_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithUnsignedInt_(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_91( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInt_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithLong_(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_92( - _lib._class_NSNumber1, _lib._sel_numberWithLong_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithUnsignedLong_(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_93( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLong_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithLongLong_(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_94( - _lib._class_NSNumber1, _lib._sel_numberWithLongLong_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithUnsignedLongLong_( - NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_95( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLongLong_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithFloat_(NativeObjCLibrary _lib, double value) { - final _ret = _lib._objc_msgSend_96( - _lib._class_NSNumber1, _lib._sel_numberWithFloat_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithDouble_(NativeObjCLibrary _lib, double value) { - final _ret = _lib._objc_msgSend_97( - _lib._class_NSNumber1, _lib._sel_numberWithDouble_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithBool_(NativeObjCLibrary _lib, bool value) { - final _ret = _lib._objc_msgSend_98( - _lib._class_NSNumber1, _lib._sel_numberWithBool_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithInteger_(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_92( - _lib._class_NSNumber1, _lib._sel_numberWithInteger_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithUnsignedInteger_( - NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_93( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInteger_1, value); - return NSNumber._(_ret, _lib); - } - - static NSValue valueWithBytes_objCType_(NativeObjCLibrary _lib, - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_79(_lib._class_NSNumber1, - _lib._sel_valueWithBytes_objCType_1, value, type); - return NSValue._(_ret, _lib); - } - - static NSValue value_withObjCType_(NativeObjCLibrary _lib, - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_79( - _lib._class_NSNumber1, _lib._sel_value_withObjCType_1, value, type); - return NSValue._(_ret, _lib); - } - - static NSValue valueWithNonretainedObject_( - NativeObjCLibrary _lib, NSObject anObject) { - final _ret = _lib._objc_msgSend_80(_lib._class_NSNumber1, - _lib._sel_valueWithNonretainedObject_1, anObject._id); - return NSValue._(_ret, _lib); - } - - static NSValue valueWithPointer_( - NativeObjCLibrary _lib, ffi.Pointer pointer) { - final _ret = _lib._objc_msgSend_81( - _lib._class_NSNumber1, _lib._sel_valueWithPointer_1, pointer); - return NSValue._(_ret, _lib); - } - - static NSValue valueWithRange_(NativeObjCLibrary _lib, NSRange range) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSNumber1, _lib._sel_valueWithRange_1, range); - return NSValue._(_ret, _lib); - } - - static NSNumber new1(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSNumber1, _lib._sel_new1); - return NSNumber._(_ret, _lib); - } - - static NSNumber alloc(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSNumber1, _lib._sel_alloc1); - return NSNumber._(_ret, _lib); - } -} - -class NSFastEnumerationState extends ffi.Struct { - @pkg_ffi.UnsignedLong() - external int state; - - external ffi.Pointer> itemsPtr; - - external ffi.Pointer mutationsPtr; - - @ffi.Array.multi([5]) - external ffi.Array extra; -} - -class NSEnumerator extends NSObject { - NSEnumerator._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); - - static NSEnumerator castFrom(T other) { - return NSEnumerator._(other._id, other._lib); - } - - static NSEnumerator castFromPointer( - NativeObjCLibrary lib, ffi.Pointer other) { - return NSEnumerator._(other, lib); - } - - NSObject nextObject() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_nextObject1); - return NSObject._(_ret, _lib); - } - - NSObject? get allObjects { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_allObjects1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - static NSEnumerator new1(NativeObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSEnumerator1, _lib._sel_new1); - return NSEnumerator._(_ret, _lib); - } - - static NSEnumerator alloc(NativeObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSEnumerator1, _lib._sel_alloc1); - return NSEnumerator._(_ret, _lib); - } -} - -abstract class NSCollectionChangeType { - static const int NSCollectionChangeInsert = 0; - static const int NSCollectionChangeRemove = 1; -} - -abstract class NSOrderedCollectionDifferenceCalculationOptions { - static const int NSOrderedCollectionDifferenceCalculationOmitInsertedObjects = - 1; - static const int NSOrderedCollectionDifferenceCalculationOmitRemovedObjects = - 2; - static const int NSOrderedCollectionDifferenceCalculationInferMoves = 4; -} - -class NSArray extends NSObject { - NSArray._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); - - static NSArray castFrom(T other) { - return NSArray._(other._id, other._lib); - } - - static NSArray castFromPointer( - NativeObjCLibrary lib, ffi.Pointer other) { - return NSArray._(other, lib); - } - - int get count { - return _lib._objc_msgSend_11(_id, _lib._sel_count1); - } - - NSObject objectAtIndex_(int index) { - final _ret = _lib._objc_msgSend_105(_id, _lib._sel_objectAtIndex_1, index); - return NSObject._(_ret, _lib); - } - - @override - NSArray init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSArray._(_ret, _lib); - } - - NSArray initWithObjects_count_( - ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_106( - _id, _lib._sel_initWithObjects_count_1, objects, cnt); - return NSArray._(_ret, _lib); - } - - NSArray initWithCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); - return NSArray._(_ret, _lib); - } - - NSString componentsJoinedByString_(NSObject? separator) { - final _ret = _lib._objc_msgSend_28(_id, - _lib._sel_componentsJoinedByString_1, separator?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - bool containsObject_(NSObject anObject) { - return _lib._objc_msgSend_4(_id, _lib._sel_containsObject_1, anObject._id); - } - - NSObject? get description { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_description1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSString descriptionWithLocale_(NSObject locale) { - final _ret = _lib._objc_msgSend_28( - _id, _lib._sel_descriptionWithLocale_1, locale._id); - return NSString._(_ret, _lib); - } - - NSString descriptionWithLocale_indent_(NSObject locale, int level) { - final _ret = _lib._objc_msgSend_107( - _id, _lib._sel_descriptionWithLocale_indent_1, locale._id, level); - return NSString._(_ret, _lib); - } - - NSObject firstObjectCommonWithArray_(NSObject? otherArray) { - final _ret = _lib._objc_msgSend_13(_id, - _lib._sel_firstObjectCommonWithArray_1, otherArray?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - void getObjects_range_( - ffi.Pointer> objects, NSRange range) { - _lib._objc_msgSend_108(_id, _lib._sel_getObjects_range_1, objects, range); - } - - int indexOfObject_(NSObject anObject) { - return _lib._objc_msgSend_109(_id, _lib._sel_indexOfObject_1, anObject._id); - } - - int indexOfObject_inRange_(NSObject anObject, NSRange range) { - return _lib._objc_msgSend_110( - _id, _lib._sel_indexOfObject_inRange_1, anObject._id, range); - } - - int indexOfObjectIdenticalTo_(NSObject anObject) { - return _lib._objc_msgSend_109( - _id, _lib._sel_indexOfObjectIdenticalTo_1, anObject._id); - } - - int indexOfObjectIdenticalTo_inRange_(NSObject anObject, NSRange range) { - return _lib._objc_msgSend_110( - _id, _lib._sel_indexOfObjectIdenticalTo_inRange_1, anObject._id, range); - } - - bool isEqualToArray_(NSObject? otherArray) { - return _lib._objc_msgSend_4( - _id, _lib._sel_isEqualToArray_1, otherArray?._id ?? ffi.nullptr); - } - - NSObject get firstObject { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_firstObject1); - return NSObject._(_ret, _lib); - } - - NSObject get lastObject { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_lastObject1); - return NSObject._(_ret, _lib); - } - - NSObject? get sortedArrayHint { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_sortedArrayHint1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - bool writeToURL_error_( - NSObject? url, ffi.Pointer> error) { - return _lib._objc_msgSend_111( - _id, _lib._sel_writeToURL_error_1, url?._id ?? ffi.nullptr, error); - } - - void makeObjectsPerformSelector_(ffi.Pointer aSelector) { - _lib._objc_msgSend_6( - _id, _lib._sel_makeObjectsPerformSelector_1, aSelector); - } - - void makeObjectsPerformSelector_withObject_( - ffi.Pointer aSelector, NSObject argument) { - _lib._objc_msgSend_112( - _id, - _lib._sel_makeObjectsPerformSelector_withObject_1, - aSelector, - argument._id); - } - - NSObject objectAtIndexedSubscript_(int idx) { - final _ret = - _lib._objc_msgSend_105(_id, _lib._sel_objectAtIndexedSubscript_1, idx); - return NSObject._(_ret, _lib); - } - - void enumerateObjectsUsingBlock_(ObjCBlock4 block) { - _lib._objc_msgSend_113( - _id, _lib._sel_enumerateObjectsUsingBlock_1, block._impl); - } - - void enumerateObjectsWithOptions_usingBlock_(int opts, ObjCBlock4 block) { - _lib._objc_msgSend_114(_id, - _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._impl); - } - - void enumerateObjectsAtIndexes_options_usingBlock_( - NSObject? s, int opts, ObjCBlock4 block) { - _lib._objc_msgSend_115( - _id, - _lib._sel_enumerateObjectsAtIndexes_options_usingBlock_1, - s?._id ?? ffi.nullptr, - opts, - block._impl); - } - - int indexOfObjectPassingTest_(ObjCBlock5 predicate) { - return _lib._objc_msgSend_116( - _id, _lib._sel_indexOfObjectPassingTest_1, predicate._impl); - } - - int indexOfObjectWithOptions_passingTest_(int opts, ObjCBlock5 predicate) { - return _lib._objc_msgSend_117( - _id, - _lib._sel_indexOfObjectWithOptions_passingTest_1, - opts, - predicate._impl); - } - - int indexOfObjectAtIndexes_options_passingTest_( - NSObject? s, int opts, ObjCBlock5 predicate) { - return _lib._objc_msgSend_118( - _id, - _lib._sel_indexOfObjectAtIndexes_options_passingTest_1, - s?._id ?? ffi.nullptr, - opts, - predicate._impl); - } - - NSIndexSet indexesOfObjectsPassingTest_(ObjCBlock5 predicate) { - final _ret = _lib._objc_msgSend_135( - _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._impl); - return NSIndexSet._(_ret, _lib); - } - - NSIndexSet indexesOfObjectsWithOptions_passingTest_( - int opts, ObjCBlock5 predicate) { - final _ret = _lib._objc_msgSend_136( - _id, - _lib._sel_indexesOfObjectsWithOptions_passingTest_1, - opts, - predicate._impl); - return NSIndexSet._(_ret, _lib); - } - - NSIndexSet indexesOfObjectsAtIndexes_options_passingTest_( - NSObject? s, int opts, ObjCBlock5 predicate) { - final _ret = _lib._objc_msgSend_137( - _id, - _lib._sel_indexesOfObjectsAtIndexes_options_passingTest_1, - s?._id ?? ffi.nullptr, - opts, - predicate._impl); - return NSIndexSet._(_ret, _lib); - } - - int indexOfObject_inSortedRange_options_usingComparator_( - NSObject obj, NSRange r, int opts, NSComparator cmp) { - return _lib._objc_msgSend_138( - _id, - _lib._sel_indexOfObject_inSortedRange_options_usingComparator_1, - obj._id, - r, - opts, - cmp); - } - - static NSArray array(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSArray1, _lib._sel_array1); - return NSArray._(_ret, _lib); - } - - static NSArray arrayWithObject_(NativeObjCLibrary _lib, NSObject anObject) { - final _ret = _lib._objc_msgSend_13( - _lib._class_NSArray1, _lib._sel_arrayWithObject_1, anObject._id); - return NSArray._(_ret, _lib); - } - - static NSArray arrayWithObjects_count_(NativeObjCLibrary _lib, - ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_106( - _lib._class_NSArray1, _lib._sel_arrayWithObjects_count_1, objects, cnt); - return NSArray._(_ret, _lib); - } - - static NSArray arrayWithObjects_(NativeObjCLibrary _lib, NSObject firstObj) { - final _ret = _lib._objc_msgSend_13( - _lib._class_NSArray1, _lib._sel_arrayWithObjects_1, firstObj._id); - return NSArray._(_ret, _lib); - } - - static NSArray arrayWithArray_(NativeObjCLibrary _lib, NSObject? array) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSArray1, - _lib._sel_arrayWithArray_1, array?._id ?? ffi.nullptr); - return NSArray._(_ret, _lib); - } - - NSArray initWithObjects_(NSObject firstObj) { - final _ret = - _lib._objc_msgSend_13(_id, _lib._sel_initWithObjects_1, firstObj._id); - return NSArray._(_ret, _lib); - } - - NSArray initWithArray_(NSObject? array) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithArray_1, array?._id ?? ffi.nullptr); - return NSArray._(_ret, _lib); - } - - NSArray initWithArray_copyItems_(NSObject? array, bool flag) { - final _ret = _lib._objc_msgSend_139(_id, - _lib._sel_initWithArray_copyItems_1, array?._id ?? ffi.nullptr, flag); - return NSArray._(_ret, _lib); - } - - void getObjects_(ffi.Pointer> objects) { - _lib._objc_msgSend_140(_id, _lib._sel_getObjects_1, objects); - } - - bool writeToFile_atomically_(NSObject? path, bool useAuxiliaryFile) { - return _lib._objc_msgSend_72(_id, _lib._sel_writeToFile_atomically_1, - path?._id ?? ffi.nullptr, useAuxiliaryFile); - } - - bool writeToURL_atomically_(NSObject? url, bool atomically) { - return _lib._objc_msgSend_72(_id, _lib._sel_writeToURL_atomically_1, - url?._id ?? ffi.nullptr, atomically); - } - - static NSArray new1(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSArray1, _lib._sel_new1); - return NSArray._(_ret, _lib); - } - - static NSArray alloc(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSArray1, _lib._sel_alloc1); - return NSArray._(_ret, _lib); - } -} - -void _ObjCBlock4_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, NSUInteger arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer arg0, int arg1, - ffi.Pointer arg2)>()(arg0, arg1, arg2); -} - -class ObjCBlock4 { - final ffi.Pointer<_ObjCBlock> _impl; - final NativeObjCLibrary _lib; - ObjCBlock4._(this._impl, this._lib); - - ObjCBlock4.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - NSUInteger arg1, ffi.Pointer arg2)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSUInteger arg1, - ffi.Pointer arg2)>( - _ObjCBlock4_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -int _ObjCBlock5_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer arg0, NSUInteger arg1, - ffi.Pointer arg2)>>() - .asFunction< - int Function(ffi.Pointer arg0, int arg1, - ffi.Pointer arg2)>()(arg0, arg1, arg2); -} - -class ObjCBlock5 { - final ffi.Pointer<_ObjCBlock> _impl; - final NativeObjCLibrary _lib; - ObjCBlock5._(this._impl, this._lib); - - ObjCBlock5.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer arg0, - NSUInteger arg1, ffi.Pointer arg2)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Uint8 Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSUInteger arg1, - ffi.Pointer arg2)>( - _ObjCBlock5_fnPtrTrampoline, 0) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -class NSIndexSet extends NSObject { - NSIndexSet._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); - - static NSIndexSet castFrom(T other) { - return NSIndexSet._(other._id, other._lib); - } - - static NSIndexSet castFromPointer( - NativeObjCLibrary lib, ffi.Pointer other) { - return NSIndexSet._(other, lib); - } - - static NSIndexSet indexSet(NativeObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSIndexSet1, _lib._sel_indexSet1); - return NSIndexSet._(_ret, _lib); - } - - static NSIndexSet indexSetWithIndex_(NativeObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_105( - _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndex_1, value); - return NSIndexSet._(_ret, _lib); - } - - static NSIndexSet indexSetWithIndexesInRange_( - NativeObjCLibrary _lib, NSRange range) { - final _ret = _lib._objc_msgSend_119( - _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndexesInRange_1, range); - return NSIndexSet._(_ret, _lib); - } - - NSIndexSet initWithIndexesInRange_(NSRange range) { - final _ret = - _lib._objc_msgSend_119(_id, _lib._sel_initWithIndexesInRange_1, range); - return NSIndexSet._(_ret, _lib); - } - - NSIndexSet initWithIndexSet_(NSObject? indexSet) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithIndexSet_1, indexSet?._id ?? ffi.nullptr); - return NSIndexSet._(_ret, _lib); - } - - NSIndexSet initWithIndex_(int value) { - final _ret = _lib._objc_msgSend_105(_id, _lib._sel_initWithIndex_1, value); - return NSIndexSet._(_ret, _lib); - } - - bool isEqualToIndexSet_(NSObject? indexSet) { - return _lib._objc_msgSend_4( - _id, _lib._sel_isEqualToIndexSet_1, indexSet?._id ?? ffi.nullptr); - } - - int get count { - return _lib._objc_msgSend_11(_id, _lib._sel_count1); - } - - int get firstIndex { - return _lib._objc_msgSend_11(_id, _lib._sel_firstIndex1); - } - - int get lastIndex { - return _lib._objc_msgSend_11(_id, _lib._sel_lastIndex1); - } - - int indexGreaterThanIndex_(int value) { - return _lib._objc_msgSend_44(_id, _lib._sel_indexGreaterThanIndex_1, value); - } - - int indexLessThanIndex_(int value) { - return _lib._objc_msgSend_44(_id, _lib._sel_indexLessThanIndex_1, value); - } - - int indexGreaterThanOrEqualToIndex_(int value) { - return _lib._objc_msgSend_44( - _id, _lib._sel_indexGreaterThanOrEqualToIndex_1, value); - } - - int indexLessThanOrEqualToIndex_(int value) { - return _lib._objc_msgSend_44( - _id, _lib._sel_indexLessThanOrEqualToIndex_1, value); - } - - int getIndexes_maxCount_inIndexRange_(ffi.Pointer indexBuffer, - int bufferSize, NSRangePointer range) { - return _lib._objc_msgSend_120( - _id, - _lib._sel_getIndexes_maxCount_inIndexRange_1, - indexBuffer, - bufferSize, - range); - } - - int countOfIndexesInRange_(NSRange range) { - return _lib._objc_msgSend_121( - _id, _lib._sel_countOfIndexesInRange_1, range); - } - - bool containsIndex_(int value) { - return _lib._objc_msgSend_40(_id, _lib._sel_containsIndex_1, value); - } - - bool containsIndexesInRange_(NSRange range) { - return _lib._objc_msgSend_122( - _id, _lib._sel_containsIndexesInRange_1, range); - } - - bool containsIndexes_(NSObject? indexSet) { - return _lib._objc_msgSend_4( - _id, _lib._sel_containsIndexes_1, indexSet?._id ?? ffi.nullptr); - } - - bool intersectsIndexesInRange_(NSRange range) { - return _lib._objc_msgSend_122( - _id, _lib._sel_intersectsIndexesInRange_1, range); - } - - void enumerateIndexesUsingBlock_(ObjCBlock6 block) { - _lib._objc_msgSend_123( - _id, _lib._sel_enumerateIndexesUsingBlock_1, block._impl); - } - - void enumerateIndexesWithOptions_usingBlock_(int opts, ObjCBlock6 block) { - _lib._objc_msgSend_124(_id, - _lib._sel_enumerateIndexesWithOptions_usingBlock_1, opts, block._impl); - } - - void enumerateIndexesInRange_options_usingBlock_( - NSRange range, int opts, ObjCBlock6 block) { - _lib._objc_msgSend_125( - _id, - _lib._sel_enumerateIndexesInRange_options_usingBlock_1, - range, - opts, - block._impl); - } - - int indexPassingTest_(ObjCBlock7 predicate) { - return _lib._objc_msgSend_126( - _id, _lib._sel_indexPassingTest_1, predicate._impl); - } - - int indexWithOptions_passingTest_(int opts, ObjCBlock7 predicate) { - return _lib._objc_msgSend_127( - _id, _lib._sel_indexWithOptions_passingTest_1, opts, predicate._impl); - } - - int indexInRange_options_passingTest_( - NSRange range, int opts, ObjCBlock7 predicate) { - return _lib._objc_msgSend_128( - _id, - _lib._sel_indexInRange_options_passingTest_1, - range, - opts, - predicate._impl); - } - - NSIndexSet indexesPassingTest_(ObjCBlock7 predicate) { - final _ret = _lib._objc_msgSend_129( - _id, _lib._sel_indexesPassingTest_1, predicate._impl); - return NSIndexSet._(_ret, _lib); - } - - NSIndexSet indexesWithOptions_passingTest_(int opts, ObjCBlock7 predicate) { - final _ret = _lib._objc_msgSend_130( - _id, _lib._sel_indexesWithOptions_passingTest_1, opts, predicate._impl); - return NSIndexSet._(_ret, _lib); - } - - NSIndexSet indexesInRange_options_passingTest_( - NSRange range, int opts, ObjCBlock7 predicate) { - final _ret = _lib._objc_msgSend_131( - _id, - _lib._sel_indexesInRange_options_passingTest_1, - range, - opts, - predicate._impl); - return NSIndexSet._(_ret, _lib); - } - - void enumerateRangesUsingBlock_(ObjCBlock8 block) { - _lib._objc_msgSend_132( - _id, _lib._sel_enumerateRangesUsingBlock_1, block._impl); - } - - void enumerateRangesWithOptions_usingBlock_(int opts, ObjCBlock8 block) { - _lib._objc_msgSend_133(_id, - _lib._sel_enumerateRangesWithOptions_usingBlock_1, opts, block._impl); - } - - void enumerateRangesInRange_options_usingBlock_( - NSRange range, int opts, ObjCBlock8 block) { - _lib._objc_msgSend_134( - _id, - _lib._sel_enumerateRangesInRange_options_usingBlock_1, - range, - opts, - block._impl); - } - - static NSIndexSet new1(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSIndexSet1, _lib._sel_new1); - return NSIndexSet._(_ret, _lib); - } - - static NSIndexSet alloc(NativeObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSIndexSet1, _lib._sel_alloc1); - return NSIndexSet._(_ret, _lib); - } -} - -void _ObjCBlock6_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - NSUInteger arg0, ffi.Pointer arg1)>>() - .asFunction arg1)>()( - arg0, arg1); -} - -class ObjCBlock6 { - final ffi.Pointer<_ObjCBlock> _impl; - final NativeObjCLibrary _lib; - ObjCBlock6._(this._impl, this._lib); - - ObjCBlock6.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - NSUInteger arg0, ffi.Pointer arg1)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - NSUInteger arg0, ffi.Pointer arg1)>( - _ObjCBlock6_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -int _ObjCBlock7_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Uint8 Function( - NSUInteger arg0, ffi.Pointer arg1)>>() - .asFunction arg1)>()( - arg0, arg1); -} - -class ObjCBlock7 { - final ffi.Pointer<_ObjCBlock> _impl; - final NativeObjCLibrary _lib; - ObjCBlock7._(this._impl, this._lib); - - ObjCBlock7.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Uint8 Function( - NSUInteger arg0, ffi.Pointer arg1)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Uint8 Function(ffi.Pointer<_ObjCBlock> block, - NSUInteger arg0, ffi.Pointer arg1)>( - _ObjCBlock7_fnPtrTrampoline, 0) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -void _ObjCBlock8_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, NSRange arg0, ffi.Pointer arg1) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(NSRange arg0, ffi.Pointer arg1)>>() - .asFunction< - void Function( - NSRange arg0, ffi.Pointer arg1)>()(arg0, arg1); -} - -class ObjCBlock8 { - final ffi.Pointer<_ObjCBlock> _impl; - final NativeObjCLibrary _lib; - ObjCBlock8._(this._impl, this._lib); - - ObjCBlock8.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(NSRange arg0, ffi.Pointer arg1)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - NSRange arg0, ffi.Pointer arg1)>( - _ObjCBlock8_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -abstract class NSBinarySearchingOptions { - static const int NSBinarySearchingFirstEqual = 256; - static const int NSBinarySearchingLastEqual = 512; - static const int NSBinarySearchingInsertionIndex = 1024; -} - -typedef NSComparator = ffi.Pointer<_ObjCBlock>; -int _ObjCBlock9_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, ffi.Pointer arg1) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - int Function(ffi.Pointer arg0, - ffi.Pointer arg1)>()(arg0, arg1); -} - -class ObjCBlock9 { - final ffi.Pointer<_ObjCBlock> _impl; - final NativeObjCLibrary _lib; - ObjCBlock9._(this._impl, this._lib); - - ObjCBlock9.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Int32 Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock9_fnPtrTrampoline, 0) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -class NSMutableArray extends NSArray { - NSMutableArray._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); - - static NSMutableArray castFrom(T other) { - return NSMutableArray._(other._id, other._lib); - } - - static NSMutableArray castFromPointer( - NativeObjCLibrary lib, ffi.Pointer other) { - return NSMutableArray._(other, lib); - } - - void addObject_(NSObject anObject) { - _lib._objc_msgSend_8(_id, _lib._sel_addObject_1, anObject._id); - } - - void insertObject_atIndex_(NSObject anObject, int index) { - _lib._objc_msgSend_141( - _id, _lib._sel_insertObject_atIndex_1, anObject._id, index); - } - - void removeLastObject() { - _lib._objc_msgSend_0(_id, _lib._sel_removeLastObject1); - } - - void removeObjectAtIndex_(int index) { - _lib._objc_msgSend_41(_id, _lib._sel_removeObjectAtIndex_1, index); - } - - void replaceObjectAtIndex_withObject_(int index, NSObject anObject) { - _lib._objc_msgSend_142( - _id, _lib._sel_replaceObjectAtIndex_withObject_1, index, anObject._id); - } - - @override - NSMutableArray init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSMutableArray._(_ret, _lib); - } - - NSMutableArray initWithCapacity_(int numItems) { - final _ret = - _lib._objc_msgSend_105(_id, _lib._sel_initWithCapacity_1, numItems); - return NSMutableArray._(_ret, _lib); - } - - @override - NSMutableArray initWithCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); - return NSMutableArray._(_ret, _lib); - } - - void addObjectsFromArray_(NSObject? otherArray) { - _lib._objc_msgSend_8( - _id, _lib._sel_addObjectsFromArray_1, otherArray?._id ?? ffi.nullptr); - } - - void exchangeObjectAtIndex_withObjectAtIndex_(int idx1, int idx2) { - _lib._objc_msgSend_143( - _id, _lib._sel_exchangeObjectAtIndex_withObjectAtIndex_1, idx1, idx2); - } - - void removeAllObjects() { - _lib._objc_msgSend_0(_id, _lib._sel_removeAllObjects1); - } - - void removeObject_inRange_(NSObject anObject, NSRange range) { - _lib._objc_msgSend_144( - _id, _lib._sel_removeObject_inRange_1, anObject._id, range); - } - - void removeObject_(NSObject anObject) { - _lib._objc_msgSend_8(_id, _lib._sel_removeObject_1, anObject._id); - } - - void removeObjectIdenticalTo_inRange_(NSObject anObject, NSRange range) { - _lib._objc_msgSend_144( - _id, _lib._sel_removeObjectIdenticalTo_inRange_1, anObject._id, range); - } - - void removeObjectIdenticalTo_(NSObject anObject) { - _lib._objc_msgSend_8( - _id, _lib._sel_removeObjectIdenticalTo_1, anObject._id); - } - - void removeObjectsFromIndices_numIndices_( - ffi.Pointer indices, int cnt) { - _lib._objc_msgSend_145( - _id, _lib._sel_removeObjectsFromIndices_numIndices_1, indices, cnt); - } - - void removeObjectsInArray_(NSObject? otherArray) { - _lib._objc_msgSend_8( - _id, _lib._sel_removeObjectsInArray_1, otherArray?._id ?? ffi.nullptr); - } - - void removeObjectsInRange_(NSRange range) { - _lib._objc_msgSend_146(_id, _lib._sel_removeObjectsInRange_1, range); - } - - void replaceObjectsInRange_withObjectsFromArray_range_( - NSRange range, NSObject? otherArray, NSRange otherRange) { - _lib._objc_msgSend_147( - _id, - _lib._sel_replaceObjectsInRange_withObjectsFromArray_range_1, - range, - otherArray?._id ?? ffi.nullptr, - otherRange); - } - - void replaceObjectsInRange_withObjectsFromArray_( - NSRange range, NSObject? otherArray) { - _lib._objc_msgSend_148( - _id, - _lib._sel_replaceObjectsInRange_withObjectsFromArray_1, - range, - otherArray?._id ?? ffi.nullptr); - } - - void setArray_(NSObject? otherArray) { - _lib._objc_msgSend_8( - _id, _lib._sel_setArray_1, otherArray?._id ?? ffi.nullptr); - } - - void sortUsingFunction_context_( - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>> - compare, - ffi.Pointer context) { - _lib._objc_msgSend_149( - _id, _lib._sel_sortUsingFunction_context_1, compare, context); - } - - void sortUsingSelector_(ffi.Pointer comparator) { - _lib._objc_msgSend_6(_id, _lib._sel_sortUsingSelector_1, comparator); - } - - void insertObjects_atIndexes_(NSObject? objects, NSObject? indexes) { - _lib._objc_msgSend_150(_id, _lib._sel_insertObjects_atIndexes_1, - objects?._id ?? ffi.nullptr, indexes?._id ?? ffi.nullptr); - } - - void removeObjectsAtIndexes_(NSObject? indexes) { - _lib._objc_msgSend_8( - _id, _lib._sel_removeObjectsAtIndexes_1, indexes?._id ?? ffi.nullptr); - } - - void replaceObjectsAtIndexes_withObjects_( - NSObject? indexes, NSObject? objects) { - _lib._objc_msgSend_150(_id, _lib._sel_replaceObjectsAtIndexes_withObjects_1, - indexes?._id ?? ffi.nullptr, objects?._id ?? ffi.nullptr); - } - - void setObject_atIndexedSubscript_(NSObject obj, int idx) { - _lib._objc_msgSend_141( - _id, _lib._sel_setObject_atIndexedSubscript_1, obj._id, idx); - } - - void sortUsingComparator_(NSComparator cmptr) { - _lib._objc_msgSend_151(_id, _lib._sel_sortUsingComparator_1, cmptr); - } - - void sortWithOptions_usingComparator_(int opts, NSComparator cmptr) { - _lib._objc_msgSend_152( - _id, _lib._sel_sortWithOptions_usingComparator_1, opts, cmptr); - } - - static NSMutableArray arrayWithCapacity_( - NativeObjCLibrary _lib, int numItems) { - final _ret = _lib._objc_msgSend_105( - _lib._class_NSMutableArray1, _lib._sel_arrayWithCapacity_1, numItems); - return NSMutableArray._(_ret, _lib); - } - - void applyDifference_(NSObject? difference) { - _lib._objc_msgSend_8( - _id, _lib._sel_applyDifference_1, difference?._id ?? ffi.nullptr); - } - - static NSMutableArray array(NativeObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSMutableArray1, _lib._sel_array1); - return NSMutableArray._(_ret, _lib); - } - - static NSMutableArray arrayWithObject_( - NativeObjCLibrary _lib, NSObject anObject) { - final _ret = _lib._objc_msgSend_13( - _lib._class_NSMutableArray1, _lib._sel_arrayWithObject_1, anObject._id); - return NSMutableArray._(_ret, _lib); - } - - static NSMutableArray arrayWithObjects_count_(NativeObjCLibrary _lib, - ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_106(_lib._class_NSMutableArray1, - _lib._sel_arrayWithObjects_count_1, objects, cnt); - return NSMutableArray._(_ret, _lib); - } - - static NSMutableArray arrayWithObjects_( - NativeObjCLibrary _lib, NSObject firstObj) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableArray1, - _lib._sel_arrayWithObjects_1, firstObj._id); - return NSMutableArray._(_ret, _lib); - } - - static NSMutableArray arrayWithArray_( - NativeObjCLibrary _lib, NSObject? array) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableArray1, - _lib._sel_arrayWithArray_1, array?._id ?? ffi.nullptr); - return NSMutableArray._(_ret, _lib); - } - - static NSMutableArray new1(NativeObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSMutableArray1, _lib._sel_new1); - return NSMutableArray._(_ret, _lib); - } - - static NSMutableArray alloc(NativeObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSMutableArray1, _lib._sel_alloc1); - return NSMutableArray._(_ret, _lib); - } -} - -abstract class NSItemProviderRepresentationVisibility { - static const int NSItemProviderRepresentationVisibilityAll = 0; - static const int NSItemProviderRepresentationVisibilityTeam = 1; - static const int NSItemProviderRepresentationVisibilityGroup = 2; - static const int NSItemProviderRepresentationVisibilityOwnProcess = 3; -} - -abstract class NSItemProviderFileOptions { - static const int NSItemProviderFileOptionOpenInPlace = 1; -} - -class NSItemProvider extends NSObject { - NSItemProvider._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); - - static NSItemProvider castFrom(T other) { - return NSItemProvider._(other._id, other._lib); - } - - static NSItemProvider castFromPointer( - NativeObjCLibrary lib, ffi.Pointer other) { - return NSItemProvider._(other, lib); - } - - @override - NSItemProvider init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSItemProvider._(_ret, _lib); - } - - void registerDataRepresentationForTypeIdentifier_visibility_loadHandler_( - NSObject? typeIdentifier, int visibility, ObjCBlock10 loadHandler) { - _lib._objc_msgSend_153( - _id, - _lib._sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1, - typeIdentifier?._id ?? ffi.nullptr, - visibility, - loadHandler._impl); - } - - void - registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_( - NSObject? typeIdentifier, - int fileOptions, - int visibility, - ObjCBlock12 loadHandler) { - _lib._objc_msgSend_154( - _id, - _lib._sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1, - typeIdentifier?._id ?? ffi.nullptr, - fileOptions, - visibility, - loadHandler._impl); - } - - NSObject? get registeredTypeIdentifiers { - final _ret = - _lib._objc_msgSend_1(_id, _lib._sel_registeredTypeIdentifiers1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - bool hasItemConformingToTypeIdentifier_(NSObject? typeIdentifier) { - return _lib._objc_msgSend_4( - _id, - _lib._sel_hasItemConformingToTypeIdentifier_1, - typeIdentifier?._id ?? ffi.nullptr); - } - - bool hasRepresentationConformingToTypeIdentifier_fileOptions_( - NSObject? typeIdentifier, int fileOptions) { - return _lib._objc_msgSend_155( - _id, - _lib._sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1, - typeIdentifier?._id ?? ffi.nullptr, - fileOptions); - } - - NSProgress loadDataRepresentationForTypeIdentifier_completionHandler_( - NSObject? typeIdentifier, ObjCBlock11 completionHandler) { - final _ret = _lib._objc_msgSend_156( - _id, - _lib._sel_loadDataRepresentationForTypeIdentifier_completionHandler_1, - typeIdentifier?._id ?? ffi.nullptr, - completionHandler._impl); - return NSProgress._(_ret, _lib); - } - - NSProgress loadFileRepresentationForTypeIdentifier_completionHandler_( - NSObject? typeIdentifier, ObjCBlock11 completionHandler) { - final _ret = _lib._objc_msgSend_156( - _id, - _lib._sel_loadFileRepresentationForTypeIdentifier_completionHandler_1, - typeIdentifier?._id ?? ffi.nullptr, - completionHandler._impl); - return NSProgress._(_ret, _lib); - } - - NSProgress loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_( - NSObject? typeIdentifier, ObjCBlock13 completionHandler) { - final _ret = _lib._objc_msgSend_157( - _id, - _lib._sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1, - typeIdentifier?._id ?? ffi.nullptr, - completionHandler._impl); - return NSProgress._(_ret, _lib); - } - - NSObject? get suggestedName { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_suggestedName1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - set suggestedName(NSObject? value) { - _lib._objc_msgSend_8( - _id, _lib._sel_setSuggestedName_1, value?._id ?? ffi.nullptr); - } - - NSItemProvider initWithObject_(NSObject? object) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithObject_1, object?._id ?? ffi.nullptr); - return NSItemProvider._(_ret, _lib); - } - - void registerObject_visibility_(NSObject? object, int visibility) { - _lib._objc_msgSend_158(_id, _lib._sel_registerObject_visibility_1, - object?._id ?? ffi.nullptr, visibility); - } - - void registerObjectOfClass_visibility_loadHandler_( - NSObject? aClass, int visibility, ObjCBlock10 loadHandler) { - _lib._objc_msgSend_153( - _id, - _lib._sel_registerObjectOfClass_visibility_loadHandler_1, - aClass?._id ?? ffi.nullptr, - visibility, - loadHandler._impl); - } - - bool canLoadObjectOfClass_(NSObject? aClass) { - return _lib._objc_msgSend_4( - _id, _lib._sel_canLoadObjectOfClass_1, aClass?._id ?? ffi.nullptr); - } - - NSProgress loadObjectOfClass_completionHandler_( - NSObject? aClass, ObjCBlock11 completionHandler) { - final _ret = _lib._objc_msgSend_156( - _id, - _lib._sel_loadObjectOfClass_completionHandler_1, - aClass?._id ?? ffi.nullptr, - completionHandler._impl); - return NSProgress._(_ret, _lib); - } - - NSItemProvider initWithItem_typeIdentifier_( - NSObject? item, NSObject? typeIdentifier) { - final _ret = _lib._objc_msgSend_58( - _id, - _lib._sel_initWithItem_typeIdentifier_1, - item?._id ?? ffi.nullptr, - typeIdentifier?._id ?? ffi.nullptr); - return NSItemProvider._(_ret, _lib); - } - - NSItemProvider initWithContentsOfURL_(NSObject? fileURL) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithContentsOfURL_1, fileURL?._id ?? ffi.nullptr); - return NSItemProvider._(_ret, _lib); - } - - void registerItemForTypeIdentifier_loadHandler_( - NSObject? typeIdentifier, NSItemProviderLoadHandler loadHandler) { - _lib._objc_msgSend_159( - _id, - _lib._sel_registerItemForTypeIdentifier_loadHandler_1, - typeIdentifier?._id ?? ffi.nullptr, - loadHandler); - } - - void loadItemForTypeIdentifier_options_completionHandler_( - NSObject? typeIdentifier, - NSObject? options, - NSItemProviderCompletionHandler completionHandler) { - _lib._objc_msgSend_160( - _id, - _lib._sel_loadItemForTypeIdentifier_options_completionHandler_1, - typeIdentifier?._id ?? ffi.nullptr, - options?._id ?? ffi.nullptr, - completionHandler); - } - - NSItemProviderLoadHandler get previewImageHandler { - return _lib._objc_msgSend_161(_id, _lib._sel_previewImageHandler1); - } - - set previewImageHandler(NSItemProviderLoadHandler value) { - _lib._objc_msgSend_162(_id, _lib._sel_setPreviewImageHandler_1, value); - } - - void loadPreviewImageWithOptions_completionHandler_( - NSObject? options, NSItemProviderCompletionHandler completionHandler) { - _lib._objc_msgSend_163( - _id, - _lib._sel_loadPreviewImageWithOptions_completionHandler_1, - options?._id ?? ffi.nullptr, - completionHandler); - } - - static NSItemProvider new1(NativeObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSItemProvider1, _lib._sel_new1); - return NSItemProvider._(_ret, _lib); - } - - static NSItemProvider alloc(NativeObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSItemProvider1, _lib._sel_alloc1); - return NSItemProvider._(_ret, _lib); - } -} - -ffi.Pointer _ObjCBlock10_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> arg0)>()(arg0); -} - -class ObjCBlock10 { - final ffi.Pointer<_ObjCBlock> _impl; - final NativeObjCLibrary _lib; - ObjCBlock10._(this._impl, this._lib); - - ObjCBlock10.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> arg0)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0)>( - _ObjCBlock10_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -void _ObjCBlock11_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, ffi.Pointer arg1) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>()(arg0, arg1); -} - -class ObjCBlock11 { - final ffi.Pointer<_ObjCBlock> _impl; - final NativeObjCLibrary _lib; - ObjCBlock11._(this._impl, this._lib); - - ObjCBlock11.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : _impl = - _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock11_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -ffi.Pointer _ObjCBlock12_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> arg0)>()(arg0); -} - -class ObjCBlock12 { - final ffi.Pointer<_ObjCBlock> _impl; - final NativeObjCLibrary _lib; - ObjCBlock12._(this._impl, this._lib); - - ObjCBlock12.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> arg0)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0)>( - _ObjCBlock12_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -void _ObjCBlock13_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, ffi.Uint8 arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer arg0, int arg1, - ffi.Pointer arg2)>()(arg0, arg1, arg2); -} - -class ObjCBlock13 { - final ffi.Pointer<_ObjCBlock> _impl; - final NativeObjCLibrary _lib; - ObjCBlock13._(this._impl, this._lib); - - ObjCBlock13.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Uint8 arg1, ffi.Pointer arg2)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Uint8 arg1, - ffi.Pointer arg2)>( - _ObjCBlock13_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -class NSProgress extends _ObjCWrapper { - NSProgress._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); - - static NSProgress castFrom(T other) { - return NSProgress._(other._id, other._lib); - } - - static NSProgress castFromPointer( - NativeObjCLibrary lib, ffi.Pointer other) { - return NSProgress._(other, lib); - } -} - -typedef NSItemProviderLoadHandler = ffi.Pointer<_ObjCBlock>; -void _ObjCBlock14_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>()(arg0, arg1, arg2); -} - -class ObjCBlock14 { - final ffi.Pointer<_ObjCBlock> _impl; - final NativeObjCLibrary _lib; - ObjCBlock14._(this._impl, this._lib); - - ObjCBlock14.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>( - _ObjCBlock14_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -typedef NSItemProviderCompletionHandler = ffi.Pointer<_ObjCBlock>; - -abstract class NSItemProviderErrorCode { - static const int NSItemProviderUnknownError = -1; - static const int NSItemProviderItemUnavailableError = -1000; - static const int NSItemProviderUnexpectedValueClassError = -1100; - static const int NSItemProviderUnavailableCoercionError = -1200; -} - -typedef NSStringEncodingDetectionOptionsKey = ffi.Pointer; - -class NSMutableString extends NSString { - NSMutableString._(ffi.Pointer id, NativeObjCLibrary lib) - : super._(id, lib); - - static NSMutableString castFrom(T other) { - return NSMutableString._(other._id, other._lib); - } - - static NSMutableString castFromPointer( - NativeObjCLibrary lib, ffi.Pointer other) { - return NSMutableString._(other, lib); - } - - void replaceCharactersInRange_withString_(NSRange range, NSObject? aString) { - _lib._objc_msgSend_148(_id, _lib._sel_replaceCharactersInRange_withString_1, - range, aString?._id ?? ffi.nullptr); - } - - void insertString_atIndex_(NSObject? aString, int loc) { - _lib._objc_msgSend_141(_id, _lib._sel_insertString_atIndex_1, - aString?._id ?? ffi.nullptr, loc); - } - - void deleteCharactersInRange_(NSRange range) { - _lib._objc_msgSend_146(_id, _lib._sel_deleteCharactersInRange_1, range); - } - - void appendString_(NSObject? aString) { - _lib._objc_msgSend_8( - _id, _lib._sel_appendString_1, aString?._id ?? ffi.nullptr); - } - - void appendFormat_(NSObject? format) { - _lib._objc_msgSend_8( - _id, _lib._sel_appendFormat_1, format?._id ?? ffi.nullptr); - } - - void setString_(NSObject? aString) { - _lib._objc_msgSend_8( - _id, _lib._sel_setString_1, aString?._id ?? ffi.nullptr); - } - - int replaceOccurrencesOfString_withString_options_range_(NSObject? target, - NSObject? replacement, int options, NSRange searchRange) { - return _lib._objc_msgSend_164( - _id, - _lib._sel_replaceOccurrencesOfString_withString_options_range_1, - target?._id ?? ffi.nullptr, - replacement?._id ?? ffi.nullptr, - options, - searchRange); - } - - bool applyTransform_reverse_range_updatedRange_(NSStringTransform transform, - bool reverse, NSRange range, NSRangePointer resultingRange) { - return _lib._objc_msgSend_165( - _id, - _lib._sel_applyTransform_reverse_range_updatedRange_1, - transform, - reverse, - range, - resultingRange); - } - - NSMutableString initWithCapacity_(int capacity) { - final _ret = - _lib._objc_msgSend_166(_id, _lib._sel_initWithCapacity_1, capacity); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString stringWithCapacity_( - NativeObjCLibrary _lib, int capacity) { - final _ret = _lib._objc_msgSend_166( - _lib._class_NSMutableString1, _lib._sel_stringWithCapacity_1, capacity); - return NSMutableString._(_ret, _lib); - } - - static ffi.Pointer getAvailableStringEncodings( - NativeObjCLibrary _lib) { - return _lib._objc_msgSend_45( - _lib._class_NSMutableString1, _lib._sel_availableStringEncodings1); - } - - static NSString localizedNameOfStringEncoding_( - NativeObjCLibrary _lib, int encoding) { - final _ret = _lib._objc_msgSend_14(_lib._class_NSMutableString1, - _lib._sel_localizedNameOfStringEncoding_1, encoding); - return NSString._(_ret, _lib); - } - - static int getDefaultCStringEncoding(NativeObjCLibrary _lib) { - return _lib._objc_msgSend_11( - _lib._class_NSMutableString1, _lib._sel_defaultCStringEncoding1); - } - - static NSMutableString string(NativeObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSMutableString1, _lib._sel_string1); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString stringWithString_( - NativeObjCLibrary _lib, NSObject? string) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, - _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString stringWithCharacters_length_( - NativeObjCLibrary _lib, ffi.Pointer characters, int length) { - final _ret = _lib._objc_msgSend_55(_lib._class_NSMutableString1, - _lib._sel_stringWithCharacters_length_1, characters, length); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString stringWithUTF8String_( - NativeObjCLibrary _lib, ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_56(_lib._class_NSMutableString1, - _lib._sel_stringWithUTF8String_1, nullTerminatedCString); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString stringWithFormat_( - NativeObjCLibrary _lib, NSObject? format) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, - _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString localizedStringWithFormat_( - NativeObjCLibrary _lib, NSObject? format) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, - _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString stringWithCString_encoding_( - NativeObjCLibrary _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_64(_lib._class_NSMutableString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString stringWithContentsOfURL_encoding_error_( - NativeObjCLibrary _lib, - NSObject? url, - int enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( - _lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfURL_encoding_error_1, - url?._id ?? ffi.nullptr, - enc, - error); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString stringWithContentsOfFile_encoding_error_( - NativeObjCLibrary _lib, - NSObject? path, - int enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( - _lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfFile_encoding_error_1, - path?._id ?? ffi.nullptr, - enc, - error); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString stringWithContentsOfURL_usedEncoding_error_( - NativeObjCLibrary _lib, - NSObject? url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_66( - _lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, - url?._id ?? ffi.nullptr, - enc, - error); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString stringWithContentsOfFile_usedEncoding_error_( - NativeObjCLibrary _lib, - NSObject? path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_66( - _lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, - path?._id ?? ffi.nullptr, - enc, - error); - return NSMutableString._(_ret, _lib); - } - - static int - stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( - NativeObjCLibrary _lib, - NSObject? data, - NSObject? opts, - ffi.Pointer> string, - ffi.Pointer usedLossyConversion) { - return _lib._objc_msgSend_67( - _lib._class_NSMutableString1, - _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, - data?._id ?? ffi.nullptr, - opts?._id ?? ffi.nullptr, - string, - usedLossyConversion); - } - - static NSObject stringWithContentsOfFile_( - NativeObjCLibrary _lib, NSObject? path) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static NSObject stringWithContentsOfURL_( - NativeObjCLibrary _lib, NSObject? url) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static NSObject stringWithCString_length_( - NativeObjCLibrary _lib, ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_64(_lib._class_NSMutableString1, - _lib._sel_stringWithCString_length_1, bytes, length); - return NSObject._(_ret, _lib); - } - - static NSObject stringWithCString_( - NativeObjCLibrary _lib, ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_56( - _lib._class_NSMutableString1, _lib._sel_stringWithCString_1, bytes); - return NSObject._(_ret, _lib); - } - - static NSMutableString new1(NativeObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSMutableString1, _lib._sel_new1); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString alloc(NativeObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSMutableString1, _lib._sel_alloc1); - return NSMutableString._(_ret, _lib); - } -} - -typedef NSExceptionName = ffi.Pointer; - -class Foo extends NSObject { - Foo._(ffi.Pointer id, NativeObjCLibrary lib) : super._(id, lib); - - static Foo castFrom(T other) { - return Foo._(other._id, other._lib); - } - - static Foo castFromPointer( - NativeObjCLibrary lib, ffi.Pointer other) { - return Foo._(other, lib); - } - - int get intVal { - return _lib._objc_msgSend_167(_id, _lib._sel_intVal1); - } - - set intVal(int value) { - _lib._objc_msgSend_168(_id, _lib._sel_setIntVal_1, value); - } - - static Foo makeFoo_(NativeObjCLibrary _lib, double x) { - final _ret = - _lib._objc_msgSend_169(_lib._class_Foo1, _lib._sel_makeFoo_1, x); - return Foo._(_ret, _lib); - } - - int multiply_withOtherFoo_(bool useIntVals, NSObject? other) { - return _lib._objc_msgSend_170(_id, _lib._sel_multiply_withOtherFoo_1, - useIntVals, other?._id ?? ffi.nullptr); - } - - void setDoubleVal_(double x) { - _lib._objc_msgSend_171(_id, _lib._sel_setDoubleVal_1, x); - } - - static Foo new1(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_new1); - return Foo._(_ret, _lib); - } - - static Foo alloc(NativeObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_Foo1, _lib._sel_alloc1); - return Foo._(_ret, _lib); - } -} - -const int NSScannedOption = 1; - -const int NSCollectorDisabledOption = 2; - -const int NSASCIIStringEncoding = 1; - -const int NSNEXTSTEPStringEncoding = 2; - -const int NSJapaneseEUCStringEncoding = 3; - -const int NSUTF8StringEncoding = 4; - -const int NSISOLatin1StringEncoding = 5; - -const int NSSymbolStringEncoding = 6; - -const int NSNonLossyASCIIStringEncoding = 7; - -const int NSShiftJISStringEncoding = 8; - -const int NSISOLatin2StringEncoding = 9; - -const int NSUnicodeStringEncoding = 10; - -const int NSWindowsCP1251StringEncoding = 11; - -const int NSWindowsCP1252StringEncoding = 12; - -const int NSWindowsCP1253StringEncoding = 13; - -const int NSWindowsCP1254StringEncoding = 14; - -const int NSWindowsCP1250StringEncoding = 15; - -const int NSISO2022JPStringEncoding = 21; - -const int NSMacOSRomanStringEncoding = 30; - -const int NSUTF16StringEncoding = 10; - -const int NSUTF16BigEndianStringEncoding = 2415919360; - -const int NSUTF16LittleEndianStringEncoding = 2483028224; - -const int NSUTF32StringEncoding = 2348810496; - -const int NSUTF32BigEndianStringEncoding = 2550137088; - -const int NSUTF32LittleEndianStringEncoding = 2617245952; - -const int NSProprietaryStringEncoding = 65536; - -const int NS_BLOCKS_AVAILABLE = 1; - -const int __COREFOUNDATION_CFAVAILABILITY__ = 1; - -const int __CF_ENUM_FIXED_IS_AVAILABLE = 1; - -const double NSFoundationVersionNumber10_0 = 397.4; - -const double NSFoundationVersionNumber10_1 = 425.0; - -const double NSFoundationVersionNumber10_1_1 = 425.0; - -const double NSFoundationVersionNumber10_1_2 = 425.0; - -const double NSFoundationVersionNumber10_1_3 = 425.0; - -const double NSFoundationVersionNumber10_1_4 = 425.0; - -const double NSFoundationVersionNumber10_2 = 462.0; - -const double NSFoundationVersionNumber10_2_1 = 462.0; - -const double NSFoundationVersionNumber10_2_2 = 462.0; - -const double NSFoundationVersionNumber10_2_3 = 462.0; - -const double NSFoundationVersionNumber10_2_4 = 462.0; - -const double NSFoundationVersionNumber10_2_5 = 462.0; - -const double NSFoundationVersionNumber10_2_6 = 462.0; - -const double NSFoundationVersionNumber10_2_7 = 462.7; - -const double NSFoundationVersionNumber10_2_8 = 462.7; - -const double NSFoundationVersionNumber10_3 = 500.0; - -const double NSFoundationVersionNumber10_3_1 = 500.0; - -const double NSFoundationVersionNumber10_3_2 = 500.3; - -const double NSFoundationVersionNumber10_3_3 = 500.54; - -const double NSFoundationVersionNumber10_3_4 = 500.56; - -const double NSFoundationVersionNumber10_3_5 = 500.56; - -const double NSFoundationVersionNumber10_3_6 = 500.56; - -const double NSFoundationVersionNumber10_3_7 = 500.56; - -const double NSFoundationVersionNumber10_3_8 = 500.56; - -const double NSFoundationVersionNumber10_3_9 = 500.58; - -const double NSFoundationVersionNumber10_4 = 567.0; - -const double NSFoundationVersionNumber10_4_1 = 567.0; - -const double NSFoundationVersionNumber10_4_2 = 567.12; - -const double NSFoundationVersionNumber10_4_3 = 567.21; - -const double NSFoundationVersionNumber10_4_4_Intel = 567.23; - -const double NSFoundationVersionNumber10_4_4_PowerPC = 567.21; - -const double NSFoundationVersionNumber10_4_5 = 567.25; - -const double NSFoundationVersionNumber10_4_6 = 567.26; - -const double NSFoundationVersionNumber10_4_7 = 567.27; - -const double NSFoundationVersionNumber10_4_8 = 567.28; - -const double NSFoundationVersionNumber10_4_9 = 567.29; - -const double NSFoundationVersionNumber10_4_10 = 567.29; - -const double NSFoundationVersionNumber10_4_11 = 567.36; - -const double NSFoundationVersionNumber10_5 = 677.0; - -const double NSFoundationVersionNumber10_5_1 = 677.1; - -const double NSFoundationVersionNumber10_5_2 = 677.15; - -const double NSFoundationVersionNumber10_5_3 = 677.19; - -const double NSFoundationVersionNumber10_5_4 = 677.19; - -const double NSFoundationVersionNumber10_5_5 = 677.21; - -const double NSFoundationVersionNumber10_5_6 = 677.22; - -const double NSFoundationVersionNumber10_5_7 = 677.24; - -const double NSFoundationVersionNumber10_5_8 = 677.26; - -const double NSFoundationVersionNumber10_6 = 751.0; - -const double NSFoundationVersionNumber10_6_1 = 751.0; - -const double NSFoundationVersionNumber10_6_2 = 751.14; - -const double NSFoundationVersionNumber10_6_3 = 751.21; - -const double NSFoundationVersionNumber10_6_4 = 751.29; - -const double NSFoundationVersionNumber10_6_5 = 751.42; - -const double NSFoundationVersionNumber10_6_6 = 751.53; - -const double NSFoundationVersionNumber10_6_7 = 751.53; - -const double NSFoundationVersionNumber10_6_8 = 751.62; - -const double NSFoundationVersionNumber10_7 = 833.1; - -const double NSFoundationVersionNumber10_7_1 = 833.1; - -const double NSFoundationVersionNumber10_7_2 = 833.2; - -const double NSFoundationVersionNumber10_7_3 = 833.24; - -const double NSFoundationVersionNumber10_7_4 = 833.25; - -const double NSFoundationVersionNumber10_8 = 945.0; - -const double NSFoundationVersionNumber10_8_1 = 945.0; - -const double NSFoundationVersionNumber10_8_2 = 945.11; - -const double NSFoundationVersionNumber10_8_3 = 945.16; - -const double NSFoundationVersionNumber10_8_4 = 945.18; - -const int NSFoundationVersionNumber10_9 = 1056; - -const int NSFoundationVersionNumber10_9_1 = 1056; - -const double NSFoundationVersionNumber10_9_2 = 1056.13; - -const double NSFoundationVersionNumber10_10 = 1151.16; - -const double NSFoundationVersionNumber10_10_1 = 1151.16; - -const double NSFoundationVersionNumber10_10_2 = 1152.14; - -const double NSFoundationVersionNumber10_10_3 = 1153.2; - -const double NSFoundationVersionNumber10_10_4 = 1153.2; - -const int NSFoundationVersionNumber10_10_5 = 1154; - -const int NSFoundationVersionNumber10_10_Max = 1199; - -const int NSFoundationVersionNumber10_11 = 1252; - -const double NSFoundationVersionNumber10_11_1 = 1255.1; - -const double NSFoundationVersionNumber10_11_2 = 1256.1; - -const double NSFoundationVersionNumber10_11_3 = 1256.1; - -const int NSFoundationVersionNumber10_11_4 = 1258; - -const int NSFoundationVersionNumber10_11_Max = 1299; - -const int __COREFOUNDATION_CFBASE__ = 1; - -const int TRUE = 1; - -const int FALSE = 0; - -const double kCFCoreFoundationVersionNumber10_0 = 196.4; - -const double kCFCoreFoundationVersionNumber10_0_3 = 196.5; - -const double kCFCoreFoundationVersionNumber10_1 = 226.0; - -const double kCFCoreFoundationVersionNumber10_1_1 = 226.0; - -const double kCFCoreFoundationVersionNumber10_1_2 = 227.2; - -const double kCFCoreFoundationVersionNumber10_1_3 = 227.2; - -const double kCFCoreFoundationVersionNumber10_1_4 = 227.3; - -const double kCFCoreFoundationVersionNumber10_2 = 263.0; - -const double kCFCoreFoundationVersionNumber10_2_1 = 263.1; - -const double kCFCoreFoundationVersionNumber10_2_2 = 263.1; - -const double kCFCoreFoundationVersionNumber10_2_3 = 263.3; - -const double kCFCoreFoundationVersionNumber10_2_4 = 263.3; - -const double kCFCoreFoundationVersionNumber10_2_5 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_6 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_7 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_8 = 263.5; - -const double kCFCoreFoundationVersionNumber10_3 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_1 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_2 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_3 = 299.3; - -const double kCFCoreFoundationVersionNumber10_3_4 = 299.31; - -const double kCFCoreFoundationVersionNumber10_3_5 = 299.31; - -const double kCFCoreFoundationVersionNumber10_3_6 = 299.32; - -const double kCFCoreFoundationVersionNumber10_3_7 = 299.33; - -const double kCFCoreFoundationVersionNumber10_3_8 = 299.33; - -const double kCFCoreFoundationVersionNumber10_3_9 = 299.35; - -const double kCFCoreFoundationVersionNumber10_4 = 368.0; - -const double kCFCoreFoundationVersionNumber10_4_1 = 368.1; - -const double kCFCoreFoundationVersionNumber10_4_2 = 368.11; - -const double kCFCoreFoundationVersionNumber10_4_3 = 368.18; - -const double kCFCoreFoundationVersionNumber10_4_4_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_4_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_5_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_5_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_6_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_6_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_7 = 368.27; - -const double kCFCoreFoundationVersionNumber10_4_8 = 368.27; - -const double kCFCoreFoundationVersionNumber10_4_9 = 368.28; - -const double kCFCoreFoundationVersionNumber10_4_10 = 368.28; - -const double kCFCoreFoundationVersionNumber10_4_11 = 368.31; - -const double kCFCoreFoundationVersionNumber10_5 = 476.0; - -const double kCFCoreFoundationVersionNumber10_5_1 = 476.0; - -const double kCFCoreFoundationVersionNumber10_5_2 = 476.1; - -const double kCFCoreFoundationVersionNumber10_5_3 = 476.13; - -const double kCFCoreFoundationVersionNumber10_5_4 = 476.14; - -const double kCFCoreFoundationVersionNumber10_5_5 = 476.15; - -const double kCFCoreFoundationVersionNumber10_5_6 = 476.17; - -const double kCFCoreFoundationVersionNumber10_5_7 = 476.18; - -const double kCFCoreFoundationVersionNumber10_5_8 = 476.19; - -const double kCFCoreFoundationVersionNumber10_6 = 550.0; - -const double kCFCoreFoundationVersionNumber10_6_1 = 550.0; - -const double kCFCoreFoundationVersionNumber10_6_2 = 550.13; - -const double kCFCoreFoundationVersionNumber10_6_3 = 550.19; - -const double kCFCoreFoundationVersionNumber10_6_4 = 550.29; - -const double kCFCoreFoundationVersionNumber10_6_5 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_6 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_7 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_8 = 550.43; - -const double kCFCoreFoundationVersionNumber10_7 = 635.0; - -const double kCFCoreFoundationVersionNumber10_7_1 = 635.0; - -const double kCFCoreFoundationVersionNumber10_7_2 = 635.15; - -const double kCFCoreFoundationVersionNumber10_7_3 = 635.19; - -const double kCFCoreFoundationVersionNumber10_7_4 = 635.21; - -const double kCFCoreFoundationVersionNumber10_7_5 = 635.21; - -const double kCFCoreFoundationVersionNumber10_8 = 744.0; - -const double kCFCoreFoundationVersionNumber10_8_1 = 744.0; - -const double kCFCoreFoundationVersionNumber10_8_2 = 744.12; - -const double kCFCoreFoundationVersionNumber10_8_3 = 744.18; - -const double kCFCoreFoundationVersionNumber10_8_4 = 744.19; - -const double kCFCoreFoundationVersionNumber10_9 = 855.11; - -const double kCFCoreFoundationVersionNumber10_9_1 = 855.11; - -const double kCFCoreFoundationVersionNumber10_9_2 = 855.14; - -const double kCFCoreFoundationVersionNumber10_10 = 1151.16; - -const double kCFCoreFoundationVersionNumber10_10_1 = 1151.16; - -const int kCFCoreFoundationVersionNumber10_10_2 = 1152; - -const double kCFCoreFoundationVersionNumber10_10_3 = 1153.18; - -const double kCFCoreFoundationVersionNumber10_10_4 = 1153.18; - -const double kCFCoreFoundationVersionNumber10_10_5 = 1153.18; - -const int kCFCoreFoundationVersionNumber10_10_Max = 1199; - -const int kCFCoreFoundationVersionNumber10_11 = 1253; - -const double kCFCoreFoundationVersionNumber10_11_1 = 1255.1; - -const double kCFCoreFoundationVersionNumber10_11_2 = 1256.14; - -const double kCFCoreFoundationVersionNumber10_11_3 = 1256.14; - -const double kCFCoreFoundationVersionNumber10_11_4 = 1258.1; - -const int kCFCoreFoundationVersionNumber10_11_Max = 1299; - -const int ISA_PTRAUTH_DISCRIMINATOR = 27361; - -const int NSMaximumStringLength = 2147483646; - -const int NS_UNICHAR_IS_EIGHT_BIT = 0; diff --git a/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart b/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart deleted file mode 100644 index 8f10022e07..0000000000 --- a/pkgs/ffigen/test/native_objc_test/nullable_bindings.dart +++ /dev/null @@ -1,1409 +0,0 @@ -// ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field - -// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; - -/// Tests calling Objective-C methods -class NullableTestObjCLibrary { - /// Holds the symbol lookup function. - final ffi.Pointer Function(String symbolName) - _lookup; - - /// The symbols are looked up in [dynamicLibrary]. - NullableTestObjCLibrary(ffi.DynamicLibrary dynamicLibrary) - : _lookup = dynamicLibrary.lookup; - - /// The symbols are looked up with [lookup]. - NullableTestObjCLibrary.fromLookup( - ffi.Pointer Function(String symbolName) - lookup) - : _lookup = lookup; - - late final ffi.Pointer _NSFoundationVersionNumber = - _lookup('NSFoundationVersionNumber'); - - double get NSFoundationVersionNumber => _NSFoundationVersionNumber.value; - - set NSFoundationVersionNumber(double value) => - _NSFoundationVersionNumber.value = value; - - late final ffi.Pointer _NSNotFound = - _lookup('NSNotFound'); - - int get NSNotFound => _NSNotFound.value; - - set NSNotFound(int value) => _NSNotFound.value = value; - - late final ffi.Pointer _kCFCoreFoundationVersionNumber = - _lookup('kCFCoreFoundationVersionNumber'); - - double get kCFCoreFoundationVersionNumber => - _kCFCoreFoundationVersionNumber.value; - - set kCFCoreFoundationVersionNumber(double value) => - _kCFCoreFoundationVersionNumber.value = value; - - late final ffi.Pointer _kCFNotFound = - _lookup('kCFNotFound'); - - int get kCFNotFound => _kCFNotFound.value; - - set kCFNotFound(int value) => _kCFNotFound.value = value; - - late final ffi.Pointer _kCFNull = _lookup('kCFNull'); - - CFNullRef get kCFNull => _kCFNull.value; - - set kCFNull(CFNullRef value) => _kCFNull.value = value; - - late final ffi.Pointer _kCFAllocatorDefault = - _lookup('kCFAllocatorDefault'); - - CFAllocatorRef get kCFAllocatorDefault => _kCFAllocatorDefault.value; - - set kCFAllocatorDefault(CFAllocatorRef value) => - _kCFAllocatorDefault.value = value; - - late final ffi.Pointer _kCFAllocatorSystemDefault = - _lookup('kCFAllocatorSystemDefault'); - - CFAllocatorRef get kCFAllocatorSystemDefault => - _kCFAllocatorSystemDefault.value; - - set kCFAllocatorSystemDefault(CFAllocatorRef value) => - _kCFAllocatorSystemDefault.value = value; - - late final ffi.Pointer _kCFAllocatorMalloc = - _lookup('kCFAllocatorMalloc'); - - CFAllocatorRef get kCFAllocatorMalloc => _kCFAllocatorMalloc.value; - - set kCFAllocatorMalloc(CFAllocatorRef value) => - _kCFAllocatorMalloc.value = value; - - late final ffi.Pointer _kCFAllocatorMallocZone = - _lookup('kCFAllocatorMallocZone'); - - CFAllocatorRef get kCFAllocatorMallocZone => _kCFAllocatorMallocZone.value; - - set kCFAllocatorMallocZone(CFAllocatorRef value) => - _kCFAllocatorMallocZone.value = value; - - late final ffi.Pointer _kCFAllocatorNull = - _lookup('kCFAllocatorNull'); - - CFAllocatorRef get kCFAllocatorNull => _kCFAllocatorNull.value; - - set kCFAllocatorNull(CFAllocatorRef value) => _kCFAllocatorNull.value = value; - - late final ffi.Pointer _kCFAllocatorUseContext = - _lookup('kCFAllocatorUseContext'); - - CFAllocatorRef get kCFAllocatorUseContext => _kCFAllocatorUseContext.value; - - set kCFAllocatorUseContext(CFAllocatorRef value) => - _kCFAllocatorUseContext.value = value; - - ffi.Pointer _registerName1(String name) { - final cstr = name.toNativeUtf8(); - final sel = _sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; - } - - ffi.Pointer _sel_registerName( - ffi.Pointer str, - ) { - return __sel_registerName( - str, - ); - } - - late final __sel_registerNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sel_registerName'); - late final __sel_registerName = __sel_registerNamePtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _getClass1(String name) { - final cstr = name.toNativeUtf8(); - final clazz = _objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return clazz; - } - - ffi.Pointer _objc_getClass( - ffi.Pointer str, - ) { - return __objc_getClass( - str, - ); - } - - late final __objc_getClassPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('objc_getClass'); - late final __objc_getClass = __objc_getClassPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); - late final ffi.Pointer _sel_load1 = _registerName1("load"); - void _objc_msgSend_0( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_0( - obj, - sel, - ); - } - - late final __objc_msgSend_0Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_initialize1 = - _registerName1("initialize"); - late final ffi.Pointer _sel_init1 = _registerName1("init"); - instancetype _objc_msgSend_1( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1( - obj, - sel, - ); - } - - late final __objc_msgSend_1Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_new1 = _registerName1("new"); - late final ffi.Pointer _sel_allocWithZone_1 = - _registerName1("allocWithZone:"); - instancetype _objc_msgSend_2( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_2( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_2Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>(); - - late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); - late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); - late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); - late final ffi.Pointer _sel_copy1 = _registerName1("copy"); - late final ffi.Pointer _sel_mutableCopy1 = - _registerName1("mutableCopy"); - late final ffi.Pointer _sel_copyWithZone_1 = - _registerName1("copyWithZone:"); - late final ffi.Pointer _sel_mutableCopyWithZone_1 = - _registerName1("mutableCopyWithZone:"); - late final ffi.Pointer _sel_instancesRespondToSelector_1 = - _registerName1("instancesRespondToSelector:"); - bool _objc_msgSend_3( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_3( - obj, - sel, - aSelector, - ) != - 0; - } - - late final __objc_msgSend_3Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_conformsToProtocol_1 = - _registerName1("conformsToProtocol:"); - bool _objc_msgSend_4( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer protocol, - ) { - return __objc_msgSend_4( - obj, - sel, - protocol, - ) != - 0; - } - - late final __objc_msgSend_4Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_methodForSelector_1 = - _registerName1("methodForSelector:"); - IMP _objc_msgSend_5( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_5( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_5Ptr = _lookup< - ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodForSelector_1 = - _registerName1("instanceMethodForSelector:"); - late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = - _registerName1("doesNotRecognizeSelector:"); - void _objc_msgSend_6( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_6( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_6Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardingTargetForSelector_1 = - _registerName1("forwardingTargetForSelector:"); - ffi.Pointer _objc_msgSend_7( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_7( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_7Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardInvocation_1 = - _registerName1("forwardInvocation:"); - void _objc_msgSend_8( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anInvocation, - ) { - return __objc_msgSend_8( - obj, - sel, - anInvocation, - ); - } - - late final __objc_msgSend_8Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _class_NSMethodSignature1 = - _getClass1("NSMethodSignature"); - late final ffi.Pointer _sel_methodSignatureForSelector_1 = - _registerName1("methodSignatureForSelector:"); - ffi.Pointer _objc_msgSend_9( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_9( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_9Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = - _registerName1("instanceMethodSignatureForSelector:"); - late final ffi.Pointer _sel_allowsWeakReference1 = - _registerName1("allowsWeakReference"); - bool _objc_msgSend_10( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_10( - obj, - sel, - ) != - 0; - } - - late final __objc_msgSend_10Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_retainWeakReference1 = - _registerName1("retainWeakReference"); - late final ffi.Pointer _sel_isSubclassOfClass_1 = - _registerName1("isSubclassOfClass:"); - late final ffi.Pointer _sel_resolveClassMethod_1 = - _registerName1("resolveClassMethod:"); - late final ffi.Pointer _sel_resolveInstanceMethod_1 = - _registerName1("resolveInstanceMethod:"); - late final ffi.Pointer _sel_hash1 = _registerName1("hash"); - int _objc_msgSend_11( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_11( - obj, - sel, - ); - } - - late final __objc_msgSend_11Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_superclass1 = - _registerName1("superclass"); - late final ffi.Pointer _sel_class1 = _registerName1("class"); - late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); - late final ffi.Pointer _sel_stringWithCString_encoding_1 = - _registerName1("stringWithCString:encoding:"); - ffi.Pointer _objc_msgSend_12( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cString, - int enc, - ) { - return __objc_msgSend_12( - obj, - sel, - cString, - enc, - ); - } - - late final __objc_msgSend_12Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_UTF8String1 = - _registerName1("UTF8String"); - ffi.Pointer _objc_msgSend_13( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_13( - obj, - sel, - ); - } - - late final __objc_msgSend_13Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_description1 = - _registerName1("description"); - ffi.Pointer _objc_msgSend_14( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_14( - obj, - sel, - ); - } - - late final __objc_msgSend_14Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_debugDescription1 = - _registerName1("debugDescription"); - late final ffi.Pointer _sel_version1 = _registerName1("version"); - int _objc_msgSend_15( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_15( - obj, - sel, - ); - } - - late final __objc_msgSend_15Ptr = _lookup< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_setVersion_1 = - _registerName1("setVersion:"); - void _objc_msgSend_16( - ffi.Pointer obj, - ffi.Pointer sel, - int aVersion, - ) { - return __objc_msgSend_16( - obj, - sel, - aVersion, - ); - } - - late final __objc_msgSend_16Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_classForCoder1 = - _registerName1("classForCoder"); - late final ffi.Pointer _sel_replacementObjectForCoder_1 = - _registerName1("replacementObjectForCoder:"); - ffi.Pointer _objc_msgSend_17( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_17( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_17Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = - _registerName1("awakeAfterUsingCoder:"); - late final ffi.Pointer _sel_poseAsClass_1 = - _registerName1("poseAsClass:"); - late final ffi.Pointer _sel_autoContentAccessingProxy1 = - _registerName1("autoContentAccessingProxy"); - late final ffi.Pointer _class_NullableInterface1 = - _getClass1("NullableInterface"); - late final ffi.Pointer _sel_isNullWithNullableNSObjectArg_1 = - _registerName1("isNullWithNullableNSObjectArg:"); - late final ffi.Pointer _sel_isNullWithNotNullableNSObjectPtrArg_1 = - _registerName1("isNullWithNotNullableNSObjectPtrArg:"); - late final ffi.Pointer _sel_returnNil_1 = - _registerName1("returnNil:"); - ffi.Pointer _objc_msgSend_18( - ffi.Pointer obj, - ffi.Pointer sel, - bool r, - ) { - return __objc_msgSend_18( - obj, - sel, - r ? 1 : 0, - ); - } - - late final __objc_msgSend_18Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_nullableObjectProperty1 = - _registerName1("nullableObjectProperty"); - late final ffi.Pointer _sel_setNullableObjectProperty_1 = - _registerName1("setNullableObjectProperty:"); -} - -abstract class NSComparisonResult { - static const int NSOrderedAscending = -1; - static const int NSOrderedSame = 0; - static const int NSOrderedDescending = 1; -} - -abstract class NSEnumerationOptions { - static const int NSEnumerationConcurrent = 1; - static const int NSEnumerationReverse = 2; -} - -abstract class NSSortOptions { - static const int NSSortConcurrent = 1; - static const int NSSortStable = 16; -} - -abstract class NSQualityOfService { - static const int NSQualityOfServiceUserInteractive = 33; - static const int NSQualityOfServiceUserInitiated = 25; - static const int NSQualityOfServiceUtility = 17; - static const int NSQualityOfServiceBackground = 9; - static const int NSQualityOfServiceDefault = -1; -} - -typedef NSInteger = pkg_ffi.Long; - -class __CFString extends ffi.Opaque {} - -abstract class CFComparisonResult { - static const int kCFCompareLessThan = -1; - static const int kCFCompareEqualTo = 0; - static const int kCFCompareGreaterThan = 1; -} - -typedef CFIndex = pkg_ffi.Long; - -class CFRange extends ffi.Struct { - @CFIndex() - external int location; - - @CFIndex() - external int length; -} - -class __CFNull extends ffi.Opaque {} - -typedef CFNullRef = ffi.Pointer<__CFNull>; - -class __CFAllocator extends ffi.Opaque {} - -typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; - -class CFAllocatorContext extends ffi.Struct { - @CFIndex() - external int version; - - external ffi.Pointer info; - - external CFAllocatorRetainCallBack retain; - - external CFAllocatorReleaseCallBack release; - - external CFAllocatorCopyDescriptionCallBack copyDescription; - - external CFAllocatorAllocateCallBack allocate; - - external CFAllocatorReallocateCallBack reallocate; - - external CFAllocatorDeallocateCallBack deallocate; - - external CFAllocatorPreferredSizeCallBack preferredSize; -} - -typedef CFAllocatorRetainCallBack = ffi.Pointer< - ffi.NativeFunction Function(ffi.Pointer)>>; -typedef CFAllocatorReleaseCallBack - = ffi.Pointer)>>; -typedef CFAllocatorCopyDescriptionCallBack = ffi - .Pointer)>>; -typedef CFStringRef = ffi.Pointer<__CFString>; -typedef CFAllocatorAllocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - CFIndex, CFOptionFlags, ffi.Pointer)>>; -typedef CFOptionFlags = pkg_ffi.UnsignedLong; -typedef CFAllocatorReallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, CFIndex, - CFOptionFlags, ffi.Pointer)>>; -typedef CFAllocatorDeallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; -typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< - ffi.NativeFunction< - CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; - -class _ObjCWrapper { - final ffi.Pointer _id; - final NullableTestObjCLibrary _lib; - - _ObjCWrapper._(this._id, this._lib); - - @override - bool operator ==(Object other) { - return other is _ObjCWrapper && _id == other._id; - } - - @override - int get hashCode => _id.hashCode; -} - -class NSObject extends _ObjCWrapper { - NSObject._(ffi.Pointer id, NullableTestObjCLibrary lib) - : super._(id, lib); - - static NSObject castFrom(T other) { - return NSObject._(other._id, other._lib); - } - - static NSObject castFromPointer( - NullableTestObjCLibrary lib, ffi.Pointer other) { - return NSObject._(other, lib); - } - - static void load(NullableTestObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); - } - - static void initialize(NullableTestObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); - } - - NSObject init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSObject._(_ret, _lib); - } - - static NSObject new1(NullableTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); - return NSObject._(_ret, _lib); - } - - static NSObject allocWithZone_( - NullableTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject alloc(NullableTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); - return NSObject._(_ret, _lib); - } - - void dealloc() { - _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); - } - - void finalize() { - _lib._objc_msgSend_0(_id, _lib._sel_finalize1); - } - - NSObject copy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); - return NSObject._(_ret, _lib); - } - - NSObject mutableCopy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); - return NSObject._(_ret, _lib); - } - - static NSObject copyWithZone_( - NullableTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject mutableCopyWithZone_( - NullableTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static bool instancesRespondToSelector_( - NullableTestObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_3(_lib._class_NSObject1, - _lib._sel_instancesRespondToSelector_1, aSelector); - } - - static bool conformsToProtocol_( - NullableTestObjCLibrary _lib, NSObject? protocol) { - return _lib._objc_msgSend_4(_lib._class_NSObject1, - _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); - } - - IMP methodForSelector_(ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); - } - - static IMP instanceMethodForSelector_( - NullableTestObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_lib._class_NSObject1, - _lib._sel_instanceMethodForSelector_1, aSelector); - } - - void doesNotRecognizeSelector_(ffi.Pointer aSelector) { - _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); - } - - NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_7( - _id, _lib._sel_forwardingTargetForSelector_1, aSelector); - return NSObject._(_ret, _lib); - } - - void forwardInvocation_(NSObject? anInvocation) { - _lib._objc_msgSend_8( - _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); - } - - NSMethodSignature methodSignatureForSelector_( - ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9( - _id, _lib._sel_methodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - static NSMethodSignature instanceMethodSignatureForSelector_( - NullableTestObjCLibrary _lib, ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, - _lib._sel_instanceMethodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - bool allowsWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); - } - - bool retainWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); - } - - static bool isSubclassOfClass_( - NullableTestObjCLibrary _lib, NSObject aClass) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); - } - - static bool resolveClassMethod_( - NullableTestObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); - } - - static bool resolveInstanceMethod_( - NullableTestObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); - } - - static int hash(NullableTestObjCLibrary _lib) { - return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); - } - - static NSObject superclass(NullableTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); - return NSObject._(_ret, _lib); - } - - static NSObject class1(NullableTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); - return NSObject._(_ret, _lib); - } - - static NSString description(NullableTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_14(_lib._class_NSObject1, _lib._sel_description1); - return NSString._(_ret, _lib); - } - - static NSString debugDescription(NullableTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_14( - _lib._class_NSObject1, _lib._sel_debugDescription1); - return NSString._(_ret, _lib); - } - - static int version(NullableTestObjCLibrary _lib) { - return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); - } - - static void setVersion_(NullableTestObjCLibrary _lib, int aVersion) { - _lib._objc_msgSend_16( - _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); - } - - NSObject get classForCoder { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); - return NSObject._(_ret, _lib); - } - - NSObject replacementObjectForCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - NSObject awakeAfterUsingCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static void poseAsClass_(NullableTestObjCLibrary _lib, NSObject aClass) { - _lib._objc_msgSend_8( - _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); - } - - NSObject get autoContentAccessingProxy { - final _ret = - _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); - return NSObject._(_ret, _lib); - } -} - -class ObjCSel extends ffi.Opaque {} - -class ObjCObject extends ffi.Opaque {} - -typedef instancetype = ffi.Pointer; - -class _NSZone extends ffi.Opaque {} - -typedef IMP = ffi.Pointer>; - -class NSMethodSignature extends _ObjCWrapper { - NSMethodSignature._(ffi.Pointer id, NullableTestObjCLibrary lib) - : super._(id, lib); - - static NSMethodSignature castFrom(T other) { - return NSMethodSignature._(other._id, other._lib); - } - - static NSMethodSignature castFromPointer( - NullableTestObjCLibrary lib, ffi.Pointer other) { - return NSMethodSignature._(other, lib); - } -} - -typedef NSUInteger = pkg_ffi.UnsignedLong; - -class NSString extends _ObjCWrapper { - NSString._(ffi.Pointer id, NullableTestObjCLibrary lib) - : super._(id, lib); - - static NSString castFrom(T other) { - return NSString._(other._id, other._lib); - } - - static NSString castFromPointer( - NullableTestObjCLibrary lib, ffi.Pointer other) { - return NSString._(other, lib); - } - - factory NSString(NullableTestObjCLibrary _lib, String str) { - final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); - pkg_ffi.calloc.free(cstr); - return nsstr; - } - - @override - String toString() => (UTF8String).cast().toDartString(); - - static NSString stringWithCString_encoding_(NullableTestObjCLibrary _lib, - ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return NSString._(_ret, _lib); - } - - ffi.Pointer get UTF8String { - return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); - } -} - -extension StringToNSString on String { - NSString toNSString(NullableTestObjCLibrary lib) => NSString(lib, this); -} - -class NullableInterface extends NSObject { - NullableInterface._(ffi.Pointer id, NullableTestObjCLibrary lib) - : super._(id, lib); - - static NullableInterface castFrom(T other) { - return NullableInterface._(other._id, other._lib); - } - - static NullableInterface castFromPointer( - NullableTestObjCLibrary lib, ffi.Pointer other) { - return NullableInterface._(other, lib); - } - - static bool isNullWithNullableNSObjectArg_( - NullableTestObjCLibrary _lib, NSObject? x) { - return _lib._objc_msgSend_4(_lib._class_NullableInterface1, - _lib._sel_isNullWithNullableNSObjectArg_1, x?._id ?? ffi.nullptr); - } - - static bool isNullWithNotNullableNSObjectPtrArg_( - NullableTestObjCLibrary _lib, NSObject? x) { - return _lib._objc_msgSend_4(_lib._class_NullableInterface1, - _lib._sel_isNullWithNotNullableNSObjectPtrArg_1, x?._id ?? ffi.nullptr); - } - - static NSObject returnNil_(NullableTestObjCLibrary _lib, bool r) { - final _ret = _lib._objc_msgSend_18( - _lib._class_NullableInterface1, _lib._sel_returnNil_1, r); - return NSObject._(_ret, _lib); - } - - NSObject? get nullableObjectProperty { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_nullableObjectProperty1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - set nullableObjectProperty(NSObject? value) { - _lib._objc_msgSend_8( - _id, _lib._sel_setNullableObjectProperty_1, value?._id ?? ffi.nullptr); - } - - static NullableInterface new1(NullableTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NullableInterface1, _lib._sel_new1); - return NullableInterface._(_ret, _lib); - } - - static NullableInterface alloc(NullableTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NullableInterface1, _lib._sel_alloc1); - return NullableInterface._(_ret, _lib); - } -} - -const int NSScannedOption = 1; - -const int NSCollectorDisabledOption = 2; - -const int NS_BLOCKS_AVAILABLE = 1; - -const int __COREFOUNDATION_CFAVAILABILITY__ = 1; - -const int __CF_ENUM_FIXED_IS_AVAILABLE = 1; - -const double NSFoundationVersionNumber10_0 = 397.4; - -const double NSFoundationVersionNumber10_1 = 425.0; - -const double NSFoundationVersionNumber10_1_1 = 425.0; - -const double NSFoundationVersionNumber10_1_2 = 425.0; - -const double NSFoundationVersionNumber10_1_3 = 425.0; - -const double NSFoundationVersionNumber10_1_4 = 425.0; - -const double NSFoundationVersionNumber10_2 = 462.0; - -const double NSFoundationVersionNumber10_2_1 = 462.0; - -const double NSFoundationVersionNumber10_2_2 = 462.0; - -const double NSFoundationVersionNumber10_2_3 = 462.0; - -const double NSFoundationVersionNumber10_2_4 = 462.0; - -const double NSFoundationVersionNumber10_2_5 = 462.0; - -const double NSFoundationVersionNumber10_2_6 = 462.0; - -const double NSFoundationVersionNumber10_2_7 = 462.7; - -const double NSFoundationVersionNumber10_2_8 = 462.7; - -const double NSFoundationVersionNumber10_3 = 500.0; - -const double NSFoundationVersionNumber10_3_1 = 500.0; - -const double NSFoundationVersionNumber10_3_2 = 500.3; - -const double NSFoundationVersionNumber10_3_3 = 500.54; - -const double NSFoundationVersionNumber10_3_4 = 500.56; - -const double NSFoundationVersionNumber10_3_5 = 500.56; - -const double NSFoundationVersionNumber10_3_6 = 500.56; - -const double NSFoundationVersionNumber10_3_7 = 500.56; - -const double NSFoundationVersionNumber10_3_8 = 500.56; - -const double NSFoundationVersionNumber10_3_9 = 500.58; - -const double NSFoundationVersionNumber10_4 = 567.0; - -const double NSFoundationVersionNumber10_4_1 = 567.0; - -const double NSFoundationVersionNumber10_4_2 = 567.12; - -const double NSFoundationVersionNumber10_4_3 = 567.21; - -const double NSFoundationVersionNumber10_4_4_Intel = 567.23; - -const double NSFoundationVersionNumber10_4_4_PowerPC = 567.21; - -const double NSFoundationVersionNumber10_4_5 = 567.25; - -const double NSFoundationVersionNumber10_4_6 = 567.26; - -const double NSFoundationVersionNumber10_4_7 = 567.27; - -const double NSFoundationVersionNumber10_4_8 = 567.28; - -const double NSFoundationVersionNumber10_4_9 = 567.29; - -const double NSFoundationVersionNumber10_4_10 = 567.29; - -const double NSFoundationVersionNumber10_4_11 = 567.36; - -const double NSFoundationVersionNumber10_5 = 677.0; - -const double NSFoundationVersionNumber10_5_1 = 677.1; - -const double NSFoundationVersionNumber10_5_2 = 677.15; - -const double NSFoundationVersionNumber10_5_3 = 677.19; - -const double NSFoundationVersionNumber10_5_4 = 677.19; - -const double NSFoundationVersionNumber10_5_5 = 677.21; - -const double NSFoundationVersionNumber10_5_6 = 677.22; - -const double NSFoundationVersionNumber10_5_7 = 677.24; - -const double NSFoundationVersionNumber10_5_8 = 677.26; - -const double NSFoundationVersionNumber10_6 = 751.0; - -const double NSFoundationVersionNumber10_6_1 = 751.0; - -const double NSFoundationVersionNumber10_6_2 = 751.14; - -const double NSFoundationVersionNumber10_6_3 = 751.21; - -const double NSFoundationVersionNumber10_6_4 = 751.29; - -const double NSFoundationVersionNumber10_6_5 = 751.42; - -const double NSFoundationVersionNumber10_6_6 = 751.53; - -const double NSFoundationVersionNumber10_6_7 = 751.53; - -const double NSFoundationVersionNumber10_6_8 = 751.62; - -const double NSFoundationVersionNumber10_7 = 833.1; - -const double NSFoundationVersionNumber10_7_1 = 833.1; - -const double NSFoundationVersionNumber10_7_2 = 833.2; - -const double NSFoundationVersionNumber10_7_3 = 833.24; - -const double NSFoundationVersionNumber10_7_4 = 833.25; - -const double NSFoundationVersionNumber10_8 = 945.0; - -const double NSFoundationVersionNumber10_8_1 = 945.0; - -const double NSFoundationVersionNumber10_8_2 = 945.11; - -const double NSFoundationVersionNumber10_8_3 = 945.16; - -const double NSFoundationVersionNumber10_8_4 = 945.18; - -const int NSFoundationVersionNumber10_9 = 1056; - -const int NSFoundationVersionNumber10_9_1 = 1056; - -const double NSFoundationVersionNumber10_9_2 = 1056.13; - -const double NSFoundationVersionNumber10_10 = 1151.16; - -const double NSFoundationVersionNumber10_10_1 = 1151.16; - -const double NSFoundationVersionNumber10_10_2 = 1152.14; - -const double NSFoundationVersionNumber10_10_3 = 1153.2; - -const double NSFoundationVersionNumber10_10_4 = 1153.2; - -const int NSFoundationVersionNumber10_10_5 = 1154; - -const int NSFoundationVersionNumber10_10_Max = 1199; - -const int NSFoundationVersionNumber10_11 = 1252; - -const double NSFoundationVersionNumber10_11_1 = 1255.1; - -const double NSFoundationVersionNumber10_11_2 = 1256.1; - -const double NSFoundationVersionNumber10_11_3 = 1256.1; - -const int NSFoundationVersionNumber10_11_4 = 1258; - -const int NSFoundationVersionNumber10_11_Max = 1299; - -const int __COREFOUNDATION_CFBASE__ = 1; - -const int TRUE = 1; - -const int FALSE = 0; - -const double kCFCoreFoundationVersionNumber10_0 = 196.4; - -const double kCFCoreFoundationVersionNumber10_0_3 = 196.5; - -const double kCFCoreFoundationVersionNumber10_1 = 226.0; - -const double kCFCoreFoundationVersionNumber10_1_1 = 226.0; - -const double kCFCoreFoundationVersionNumber10_1_2 = 227.2; - -const double kCFCoreFoundationVersionNumber10_1_3 = 227.2; - -const double kCFCoreFoundationVersionNumber10_1_4 = 227.3; - -const double kCFCoreFoundationVersionNumber10_2 = 263.0; - -const double kCFCoreFoundationVersionNumber10_2_1 = 263.1; - -const double kCFCoreFoundationVersionNumber10_2_2 = 263.1; - -const double kCFCoreFoundationVersionNumber10_2_3 = 263.3; - -const double kCFCoreFoundationVersionNumber10_2_4 = 263.3; - -const double kCFCoreFoundationVersionNumber10_2_5 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_6 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_7 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_8 = 263.5; - -const double kCFCoreFoundationVersionNumber10_3 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_1 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_2 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_3 = 299.3; - -const double kCFCoreFoundationVersionNumber10_3_4 = 299.31; - -const double kCFCoreFoundationVersionNumber10_3_5 = 299.31; - -const double kCFCoreFoundationVersionNumber10_3_6 = 299.32; - -const double kCFCoreFoundationVersionNumber10_3_7 = 299.33; - -const double kCFCoreFoundationVersionNumber10_3_8 = 299.33; - -const double kCFCoreFoundationVersionNumber10_3_9 = 299.35; - -const double kCFCoreFoundationVersionNumber10_4 = 368.0; - -const double kCFCoreFoundationVersionNumber10_4_1 = 368.1; - -const double kCFCoreFoundationVersionNumber10_4_2 = 368.11; - -const double kCFCoreFoundationVersionNumber10_4_3 = 368.18; - -const double kCFCoreFoundationVersionNumber10_4_4_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_4_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_5_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_5_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_6_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_6_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_7 = 368.27; - -const double kCFCoreFoundationVersionNumber10_4_8 = 368.27; - -const double kCFCoreFoundationVersionNumber10_4_9 = 368.28; - -const double kCFCoreFoundationVersionNumber10_4_10 = 368.28; - -const double kCFCoreFoundationVersionNumber10_4_11 = 368.31; - -const double kCFCoreFoundationVersionNumber10_5 = 476.0; - -const double kCFCoreFoundationVersionNumber10_5_1 = 476.0; - -const double kCFCoreFoundationVersionNumber10_5_2 = 476.1; - -const double kCFCoreFoundationVersionNumber10_5_3 = 476.13; - -const double kCFCoreFoundationVersionNumber10_5_4 = 476.14; - -const double kCFCoreFoundationVersionNumber10_5_5 = 476.15; - -const double kCFCoreFoundationVersionNumber10_5_6 = 476.17; - -const double kCFCoreFoundationVersionNumber10_5_7 = 476.18; - -const double kCFCoreFoundationVersionNumber10_5_8 = 476.19; - -const double kCFCoreFoundationVersionNumber10_6 = 550.0; - -const double kCFCoreFoundationVersionNumber10_6_1 = 550.0; - -const double kCFCoreFoundationVersionNumber10_6_2 = 550.13; - -const double kCFCoreFoundationVersionNumber10_6_3 = 550.19; - -const double kCFCoreFoundationVersionNumber10_6_4 = 550.29; - -const double kCFCoreFoundationVersionNumber10_6_5 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_6 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_7 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_8 = 550.43; - -const double kCFCoreFoundationVersionNumber10_7 = 635.0; - -const double kCFCoreFoundationVersionNumber10_7_1 = 635.0; - -const double kCFCoreFoundationVersionNumber10_7_2 = 635.15; - -const double kCFCoreFoundationVersionNumber10_7_3 = 635.19; - -const double kCFCoreFoundationVersionNumber10_7_4 = 635.21; - -const double kCFCoreFoundationVersionNumber10_7_5 = 635.21; - -const double kCFCoreFoundationVersionNumber10_8 = 744.0; - -const double kCFCoreFoundationVersionNumber10_8_1 = 744.0; - -const double kCFCoreFoundationVersionNumber10_8_2 = 744.12; - -const double kCFCoreFoundationVersionNumber10_8_3 = 744.18; - -const double kCFCoreFoundationVersionNumber10_8_4 = 744.19; - -const double kCFCoreFoundationVersionNumber10_9 = 855.11; - -const double kCFCoreFoundationVersionNumber10_9_1 = 855.11; - -const double kCFCoreFoundationVersionNumber10_9_2 = 855.14; - -const double kCFCoreFoundationVersionNumber10_10 = 1151.16; - -const double kCFCoreFoundationVersionNumber10_10_1 = 1151.16; - -const int kCFCoreFoundationVersionNumber10_10_2 = 1152; - -const double kCFCoreFoundationVersionNumber10_10_3 = 1153.18; - -const double kCFCoreFoundationVersionNumber10_10_4 = 1153.18; - -const double kCFCoreFoundationVersionNumber10_10_5 = 1153.18; - -const int kCFCoreFoundationVersionNumber10_10_Max = 1199; - -const int kCFCoreFoundationVersionNumber10_11 = 1253; - -const double kCFCoreFoundationVersionNumber10_11_1 = 1255.1; - -const double kCFCoreFoundationVersionNumber10_11_2 = 1256.14; - -const double kCFCoreFoundationVersionNumber10_11_3 = 1256.14; - -const double kCFCoreFoundationVersionNumber10_11_4 = 1258.1; - -const int kCFCoreFoundationVersionNumber10_11_Max = 1299; - -const int ISA_PTRAUTH_DISCRIMINATOR = 27361; diff --git a/pkgs/ffigen/test/native_objc_test/nullable_test.dart b/pkgs/ffigen/test/native_objc_test/nullable_test.dart index 8067ea1a74..de6cc77db3 100644 --- a/pkgs/ffigen/test/native_objc_test/nullable_test.dart +++ b/pkgs/ffigen/test/native_objc_test/nullable_test.dart @@ -8,10 +8,7 @@ import 'dart:ffi'; import 'dart:io'; -import 'package:ffigen/ffigen.dart'; -import 'package:path/path.dart' as path; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart'; import '../test_utils.dart'; import 'nullable_bindings.dart'; @@ -29,29 +26,6 @@ void main() { obj = NSObject.new1(lib); }); - test('generate_bindings', () { - final config = Config.fromYaml(loadYaml( - File(path.join('test', 'native_objc_test', 'nullable_config.yaml')) - .readAsStringSync()) as YamlMap); - final library = parse(config); - final file = File( - path.join('test', 'debug_generated', 'nullable_test.dart'), - ); - library.generateFile(file); - - try { - final actual = file.readAsStringSync(); - final expected = File(path.join(config.output)).readAsStringSync(); - expect(actual, expected); - if (file.existsSync()) { - file.delete(); - } - } catch (e) { - print('Failed test: Debug generated file: ${file.absolute.path}'); - rethrow; - } - }); - group('Nullable property', () { test('Not null', () { nullableInterface.nullableObjectProperty = obj; diff --git a/pkgs/ffigen/test/native_objc_test/property_bindings.dart b/pkgs/ffigen/test/native_objc_test/property_bindings.dart deleted file mode 100644 index 83f516fe4a..0000000000 --- a/pkgs/ffigen/test/native_objc_test/property_bindings.dart +++ /dev/null @@ -1,1434 +0,0 @@ -// ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field - -// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; - -/// Tests calling Objective-C properties i.e. getters and setters -class PropertyTestObjCLibrary { - /// Holds the symbol lookup function. - final ffi.Pointer Function(String symbolName) - _lookup; - - /// The symbols are looked up in [dynamicLibrary]. - PropertyTestObjCLibrary(ffi.DynamicLibrary dynamicLibrary) - : _lookup = dynamicLibrary.lookup; - - /// The symbols are looked up with [lookup]. - PropertyTestObjCLibrary.fromLookup( - ffi.Pointer Function(String symbolName) - lookup) - : _lookup = lookup; - - late final ffi.Pointer _NSFoundationVersionNumber = - _lookup('NSFoundationVersionNumber'); - - double get NSFoundationVersionNumber => _NSFoundationVersionNumber.value; - - set NSFoundationVersionNumber(double value) => - _NSFoundationVersionNumber.value = value; - - late final ffi.Pointer _NSNotFound = - _lookup('NSNotFound'); - - int get NSNotFound => _NSNotFound.value; - - set NSNotFound(int value) => _NSNotFound.value = value; - - late final ffi.Pointer _kCFCoreFoundationVersionNumber = - _lookup('kCFCoreFoundationVersionNumber'); - - double get kCFCoreFoundationVersionNumber => - _kCFCoreFoundationVersionNumber.value; - - set kCFCoreFoundationVersionNumber(double value) => - _kCFCoreFoundationVersionNumber.value = value; - - late final ffi.Pointer _kCFNotFound = - _lookup('kCFNotFound'); - - int get kCFNotFound => _kCFNotFound.value; - - set kCFNotFound(int value) => _kCFNotFound.value = value; - - late final ffi.Pointer _kCFNull = _lookup('kCFNull'); - - CFNullRef get kCFNull => _kCFNull.value; - - set kCFNull(CFNullRef value) => _kCFNull.value = value; - - late final ffi.Pointer _kCFAllocatorDefault = - _lookup('kCFAllocatorDefault'); - - CFAllocatorRef get kCFAllocatorDefault => _kCFAllocatorDefault.value; - - set kCFAllocatorDefault(CFAllocatorRef value) => - _kCFAllocatorDefault.value = value; - - late final ffi.Pointer _kCFAllocatorSystemDefault = - _lookup('kCFAllocatorSystemDefault'); - - CFAllocatorRef get kCFAllocatorSystemDefault => - _kCFAllocatorSystemDefault.value; - - set kCFAllocatorSystemDefault(CFAllocatorRef value) => - _kCFAllocatorSystemDefault.value = value; - - late final ffi.Pointer _kCFAllocatorMalloc = - _lookup('kCFAllocatorMalloc'); - - CFAllocatorRef get kCFAllocatorMalloc => _kCFAllocatorMalloc.value; - - set kCFAllocatorMalloc(CFAllocatorRef value) => - _kCFAllocatorMalloc.value = value; - - late final ffi.Pointer _kCFAllocatorMallocZone = - _lookup('kCFAllocatorMallocZone'); - - CFAllocatorRef get kCFAllocatorMallocZone => _kCFAllocatorMallocZone.value; - - set kCFAllocatorMallocZone(CFAllocatorRef value) => - _kCFAllocatorMallocZone.value = value; - - late final ffi.Pointer _kCFAllocatorNull = - _lookup('kCFAllocatorNull'); - - CFAllocatorRef get kCFAllocatorNull => _kCFAllocatorNull.value; - - set kCFAllocatorNull(CFAllocatorRef value) => _kCFAllocatorNull.value = value; - - late final ffi.Pointer _kCFAllocatorUseContext = - _lookup('kCFAllocatorUseContext'); - - CFAllocatorRef get kCFAllocatorUseContext => _kCFAllocatorUseContext.value; - - set kCFAllocatorUseContext(CFAllocatorRef value) => - _kCFAllocatorUseContext.value = value; - - ffi.Pointer _registerName1(String name) { - final cstr = name.toNativeUtf8(); - final sel = _sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; - } - - ffi.Pointer _sel_registerName( - ffi.Pointer str, - ) { - return __sel_registerName( - str, - ); - } - - late final __sel_registerNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sel_registerName'); - late final __sel_registerName = __sel_registerNamePtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _getClass1(String name) { - final cstr = name.toNativeUtf8(); - final clazz = _objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return clazz; - } - - ffi.Pointer _objc_getClass( - ffi.Pointer str, - ) { - return __objc_getClass( - str, - ); - } - - late final __objc_getClassPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('objc_getClass'); - late final __objc_getClass = __objc_getClassPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); - late final ffi.Pointer _sel_load1 = _registerName1("load"); - void _objc_msgSend_0( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_0( - obj, - sel, - ); - } - - late final __objc_msgSend_0Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_initialize1 = - _registerName1("initialize"); - late final ffi.Pointer _sel_init1 = _registerName1("init"); - instancetype _objc_msgSend_1( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1( - obj, - sel, - ); - } - - late final __objc_msgSend_1Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_new1 = _registerName1("new"); - late final ffi.Pointer _sel_allocWithZone_1 = - _registerName1("allocWithZone:"); - instancetype _objc_msgSend_2( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_2( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_2Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>(); - - late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); - late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); - late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); - late final ffi.Pointer _sel_copy1 = _registerName1("copy"); - late final ffi.Pointer _sel_mutableCopy1 = - _registerName1("mutableCopy"); - late final ffi.Pointer _sel_copyWithZone_1 = - _registerName1("copyWithZone:"); - late final ffi.Pointer _sel_mutableCopyWithZone_1 = - _registerName1("mutableCopyWithZone:"); - late final ffi.Pointer _sel_instancesRespondToSelector_1 = - _registerName1("instancesRespondToSelector:"); - bool _objc_msgSend_3( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_3( - obj, - sel, - aSelector, - ) != - 0; - } - - late final __objc_msgSend_3Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_conformsToProtocol_1 = - _registerName1("conformsToProtocol:"); - bool _objc_msgSend_4( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer protocol, - ) { - return __objc_msgSend_4( - obj, - sel, - protocol, - ) != - 0; - } - - late final __objc_msgSend_4Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_methodForSelector_1 = - _registerName1("methodForSelector:"); - IMP _objc_msgSend_5( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_5( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_5Ptr = _lookup< - ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodForSelector_1 = - _registerName1("instanceMethodForSelector:"); - late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = - _registerName1("doesNotRecognizeSelector:"); - void _objc_msgSend_6( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_6( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_6Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardingTargetForSelector_1 = - _registerName1("forwardingTargetForSelector:"); - ffi.Pointer _objc_msgSend_7( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_7( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_7Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardInvocation_1 = - _registerName1("forwardInvocation:"); - void _objc_msgSend_8( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anInvocation, - ) { - return __objc_msgSend_8( - obj, - sel, - anInvocation, - ); - } - - late final __objc_msgSend_8Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _class_NSMethodSignature1 = - _getClass1("NSMethodSignature"); - late final ffi.Pointer _sel_methodSignatureForSelector_1 = - _registerName1("methodSignatureForSelector:"); - ffi.Pointer _objc_msgSend_9( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_9( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_9Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = - _registerName1("instanceMethodSignatureForSelector:"); - late final ffi.Pointer _sel_allowsWeakReference1 = - _registerName1("allowsWeakReference"); - bool _objc_msgSend_10( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_10( - obj, - sel, - ) != - 0; - } - - late final __objc_msgSend_10Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_retainWeakReference1 = - _registerName1("retainWeakReference"); - late final ffi.Pointer _sel_isSubclassOfClass_1 = - _registerName1("isSubclassOfClass:"); - late final ffi.Pointer _sel_resolveClassMethod_1 = - _registerName1("resolveClassMethod:"); - late final ffi.Pointer _sel_resolveInstanceMethod_1 = - _registerName1("resolveInstanceMethod:"); - late final ffi.Pointer _sel_hash1 = _registerName1("hash"); - int _objc_msgSend_11( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_11( - obj, - sel, - ); - } - - late final __objc_msgSend_11Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_superclass1 = - _registerName1("superclass"); - late final ffi.Pointer _sel_class1 = _registerName1("class"); - late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); - late final ffi.Pointer _sel_stringWithCString_encoding_1 = - _registerName1("stringWithCString:encoding:"); - ffi.Pointer _objc_msgSend_12( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cString, - int enc, - ) { - return __objc_msgSend_12( - obj, - sel, - cString, - enc, - ); - } - - late final __objc_msgSend_12Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_UTF8String1 = - _registerName1("UTF8String"); - ffi.Pointer _objc_msgSend_13( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_13( - obj, - sel, - ); - } - - late final __objc_msgSend_13Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_description1 = - _registerName1("description"); - ffi.Pointer _objc_msgSend_14( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_14( - obj, - sel, - ); - } - - late final __objc_msgSend_14Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_debugDescription1 = - _registerName1("debugDescription"); - late final ffi.Pointer _sel_version1 = _registerName1("version"); - int _objc_msgSend_15( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_15( - obj, - sel, - ); - } - - late final __objc_msgSend_15Ptr = _lookup< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_setVersion_1 = - _registerName1("setVersion:"); - void _objc_msgSend_16( - ffi.Pointer obj, - ffi.Pointer sel, - int aVersion, - ) { - return __objc_msgSend_16( - obj, - sel, - aVersion, - ); - } - - late final __objc_msgSend_16Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_classForCoder1 = - _registerName1("classForCoder"); - late final ffi.Pointer _sel_replacementObjectForCoder_1 = - _registerName1("replacementObjectForCoder:"); - ffi.Pointer _objc_msgSend_17( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_17( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_17Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = - _registerName1("awakeAfterUsingCoder:"); - late final ffi.Pointer _sel_poseAsClass_1 = - _registerName1("poseAsClass:"); - late final ffi.Pointer _sel_autoContentAccessingProxy1 = - _registerName1("autoContentAccessingProxy"); - late final ffi.Pointer _class_PropertyInterface1 = - _getClass1("PropertyInterface"); - late final ffi.Pointer _sel_readOnlyProperty1 = - _registerName1("readOnlyProperty"); - int _objc_msgSend_18( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_18( - obj, - sel, - ); - } - - late final __objc_msgSend_18Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_readWriteProperty1 = - _registerName1("readWriteProperty"); - late final ffi.Pointer _sel_setReadWriteProperty_1 = - _registerName1("setReadWriteProperty:"); - void _objc_msgSend_19( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_19( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_19Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_classReadOnlyProperty1 = - _registerName1("classReadOnlyProperty"); - late final ffi.Pointer _sel_classReadWriteProperty1 = - _registerName1("classReadWriteProperty"); - late final ffi.Pointer _sel_setClassReadWriteProperty_1 = - _registerName1("setClassReadWriteProperty:"); - late final ffi.Pointer __classReadWriteProperty = - _lookup('_classReadWriteProperty'); - - int get _classReadWriteProperty => __classReadWriteProperty.value; - - set _classReadWriteProperty(int value) => - __classReadWriteProperty.value = value; -} - -abstract class NSComparisonResult { - static const int NSOrderedAscending = -1; - static const int NSOrderedSame = 0; - static const int NSOrderedDescending = 1; -} - -abstract class NSEnumerationOptions { - static const int NSEnumerationConcurrent = 1; - static const int NSEnumerationReverse = 2; -} - -abstract class NSSortOptions { - static const int NSSortConcurrent = 1; - static const int NSSortStable = 16; -} - -abstract class NSQualityOfService { - static const int NSQualityOfServiceUserInteractive = 33; - static const int NSQualityOfServiceUserInitiated = 25; - static const int NSQualityOfServiceUtility = 17; - static const int NSQualityOfServiceBackground = 9; - static const int NSQualityOfServiceDefault = -1; -} - -typedef NSInteger = pkg_ffi.Long; - -class __CFString extends ffi.Opaque {} - -abstract class CFComparisonResult { - static const int kCFCompareLessThan = -1; - static const int kCFCompareEqualTo = 0; - static const int kCFCompareGreaterThan = 1; -} - -typedef CFIndex = pkg_ffi.Long; - -class CFRange extends ffi.Struct { - @CFIndex() - external int location; - - @CFIndex() - external int length; -} - -class __CFNull extends ffi.Opaque {} - -typedef CFNullRef = ffi.Pointer<__CFNull>; - -class __CFAllocator extends ffi.Opaque {} - -typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; - -class CFAllocatorContext extends ffi.Struct { - @CFIndex() - external int version; - - external ffi.Pointer info; - - external CFAllocatorRetainCallBack retain; - - external CFAllocatorReleaseCallBack release; - - external CFAllocatorCopyDescriptionCallBack copyDescription; - - external CFAllocatorAllocateCallBack allocate; - - external CFAllocatorReallocateCallBack reallocate; - - external CFAllocatorDeallocateCallBack deallocate; - - external CFAllocatorPreferredSizeCallBack preferredSize; -} - -typedef CFAllocatorRetainCallBack = ffi.Pointer< - ffi.NativeFunction Function(ffi.Pointer)>>; -typedef CFAllocatorReleaseCallBack - = ffi.Pointer)>>; -typedef CFAllocatorCopyDescriptionCallBack = ffi - .Pointer)>>; -typedef CFStringRef = ffi.Pointer<__CFString>; -typedef CFAllocatorAllocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - CFIndex, CFOptionFlags, ffi.Pointer)>>; -typedef CFOptionFlags = pkg_ffi.UnsignedLong; -typedef CFAllocatorReallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, CFIndex, - CFOptionFlags, ffi.Pointer)>>; -typedef CFAllocatorDeallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; -typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< - ffi.NativeFunction< - CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; - -class _ObjCWrapper { - final ffi.Pointer _id; - final PropertyTestObjCLibrary _lib; - - _ObjCWrapper._(this._id, this._lib); - - @override - bool operator ==(Object other) { - return other is _ObjCWrapper && _id == other._id; - } - - @override - int get hashCode => _id.hashCode; -} - -class NSObject extends _ObjCWrapper { - NSObject._(ffi.Pointer id, PropertyTestObjCLibrary lib) - : super._(id, lib); - - static NSObject castFrom(T other) { - return NSObject._(other._id, other._lib); - } - - static NSObject castFromPointer( - PropertyTestObjCLibrary lib, ffi.Pointer other) { - return NSObject._(other, lib); - } - - static void load(PropertyTestObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); - } - - static void initialize(PropertyTestObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); - } - - NSObject init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSObject._(_ret, _lib); - } - - static NSObject new1(PropertyTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); - return NSObject._(_ret, _lib); - } - - static NSObject allocWithZone_( - PropertyTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject alloc(PropertyTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); - return NSObject._(_ret, _lib); - } - - void dealloc() { - _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); - } - - void finalize() { - _lib._objc_msgSend_0(_id, _lib._sel_finalize1); - } - - NSObject copy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); - return NSObject._(_ret, _lib); - } - - NSObject mutableCopy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); - return NSObject._(_ret, _lib); - } - - static NSObject copyWithZone_( - PropertyTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject mutableCopyWithZone_( - PropertyTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static bool instancesRespondToSelector_( - PropertyTestObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_3(_lib._class_NSObject1, - _lib._sel_instancesRespondToSelector_1, aSelector); - } - - static bool conformsToProtocol_( - PropertyTestObjCLibrary _lib, NSObject? protocol) { - return _lib._objc_msgSend_4(_lib._class_NSObject1, - _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); - } - - IMP methodForSelector_(ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); - } - - static IMP instanceMethodForSelector_( - PropertyTestObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_lib._class_NSObject1, - _lib._sel_instanceMethodForSelector_1, aSelector); - } - - void doesNotRecognizeSelector_(ffi.Pointer aSelector) { - _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); - } - - NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_7( - _id, _lib._sel_forwardingTargetForSelector_1, aSelector); - return NSObject._(_ret, _lib); - } - - void forwardInvocation_(NSObject? anInvocation) { - _lib._objc_msgSend_8( - _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); - } - - NSMethodSignature methodSignatureForSelector_( - ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9( - _id, _lib._sel_methodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - static NSMethodSignature instanceMethodSignatureForSelector_( - PropertyTestObjCLibrary _lib, ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, - _lib._sel_instanceMethodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - bool allowsWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); - } - - bool retainWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); - } - - static bool isSubclassOfClass_( - PropertyTestObjCLibrary _lib, NSObject aClass) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); - } - - static bool resolveClassMethod_( - PropertyTestObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); - } - - static bool resolveInstanceMethod_( - PropertyTestObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); - } - - static int hash(PropertyTestObjCLibrary _lib) { - return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); - } - - static NSObject superclass(PropertyTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); - return NSObject._(_ret, _lib); - } - - static NSObject class1(PropertyTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); - return NSObject._(_ret, _lib); - } - - static NSString description(PropertyTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_14(_lib._class_NSObject1, _lib._sel_description1); - return NSString._(_ret, _lib); - } - - static NSString debugDescription(PropertyTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_14( - _lib._class_NSObject1, _lib._sel_debugDescription1); - return NSString._(_ret, _lib); - } - - static int version(PropertyTestObjCLibrary _lib) { - return _lib._objc_msgSend_15(_lib._class_NSObject1, _lib._sel_version1); - } - - static void setVersion_(PropertyTestObjCLibrary _lib, int aVersion) { - _lib._objc_msgSend_16( - _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); - } - - NSObject get classForCoder { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); - return NSObject._(_ret, _lib); - } - - NSObject replacementObjectForCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - NSObject awakeAfterUsingCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_17( - _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static void poseAsClass_(PropertyTestObjCLibrary _lib, NSObject aClass) { - _lib._objc_msgSend_8( - _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); - } - - NSObject get autoContentAccessingProxy { - final _ret = - _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); - return NSObject._(_ret, _lib); - } -} - -class ObjCSel extends ffi.Opaque {} - -class ObjCObject extends ffi.Opaque {} - -typedef instancetype = ffi.Pointer; - -class _NSZone extends ffi.Opaque {} - -typedef IMP = ffi.Pointer>; - -class NSMethodSignature extends _ObjCWrapper { - NSMethodSignature._(ffi.Pointer id, PropertyTestObjCLibrary lib) - : super._(id, lib); - - static NSMethodSignature castFrom(T other) { - return NSMethodSignature._(other._id, other._lib); - } - - static NSMethodSignature castFromPointer( - PropertyTestObjCLibrary lib, ffi.Pointer other) { - return NSMethodSignature._(other, lib); - } -} - -typedef NSUInteger = pkg_ffi.UnsignedLong; - -class NSString extends _ObjCWrapper { - NSString._(ffi.Pointer id, PropertyTestObjCLibrary lib) - : super._(id, lib); - - static NSString castFrom(T other) { - return NSString._(other._id, other._lib); - } - - static NSString castFromPointer( - PropertyTestObjCLibrary lib, ffi.Pointer other) { - return NSString._(other, lib); - } - - factory NSString(PropertyTestObjCLibrary _lib, String str) { - final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); - pkg_ffi.calloc.free(cstr); - return nsstr; - } - - @override - String toString() => (UTF8String).cast().toDartString(); - - static NSString stringWithCString_encoding_(PropertyTestObjCLibrary _lib, - ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_12(_lib._class_NSString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return NSString._(_ret, _lib); - } - - ffi.Pointer get UTF8String { - return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); - } -} - -extension StringToNSString on String { - NSString toNSString(PropertyTestObjCLibrary lib) => NSString(lib, this); -} - -class PropertyInterface extends NSObject { - PropertyInterface._(ffi.Pointer id, PropertyTestObjCLibrary lib) - : super._(id, lib); - - static PropertyInterface castFrom(T other) { - return PropertyInterface._(other._id, other._lib); - } - - static PropertyInterface castFromPointer( - PropertyTestObjCLibrary lib, ffi.Pointer other) { - return PropertyInterface._(other, lib); - } - - int get readOnlyProperty { - return _lib._objc_msgSend_18(_id, _lib._sel_readOnlyProperty1); - } - - int get readWriteProperty { - return _lib._objc_msgSend_18(_id, _lib._sel_readWriteProperty1); - } - - set readWriteProperty(int value) { - _lib._objc_msgSend_19(_id, _lib._sel_setReadWriteProperty_1, value); - } - - static int getClassReadOnlyProperty(PropertyTestObjCLibrary _lib) { - return _lib._objc_msgSend_18( - _lib._class_PropertyInterface1, _lib._sel_classReadOnlyProperty1); - } - - static int getClassReadWriteProperty(PropertyTestObjCLibrary _lib) { - return _lib._objc_msgSend_18( - _lib._class_PropertyInterface1, _lib._sel_classReadWriteProperty1); - } - - static void setClassReadWriteProperty( - PropertyTestObjCLibrary _lib, int value) { - _lib._objc_msgSend_19(_lib._class_PropertyInterface1, - _lib._sel_setClassReadWriteProperty_1, value); - } - - static PropertyInterface new1(PropertyTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_PropertyInterface1, _lib._sel_new1); - return PropertyInterface._(_ret, _lib); - } - - static PropertyInterface alloc(PropertyTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_PropertyInterface1, _lib._sel_alloc1); - return PropertyInterface._(_ret, _lib); - } -} - -const int NSScannedOption = 1; - -const int NSCollectorDisabledOption = 2; - -const int NS_BLOCKS_AVAILABLE = 1; - -const int __COREFOUNDATION_CFAVAILABILITY__ = 1; - -const int __CF_ENUM_FIXED_IS_AVAILABLE = 1; - -const double NSFoundationVersionNumber10_0 = 397.4; - -const double NSFoundationVersionNumber10_1 = 425.0; - -const double NSFoundationVersionNumber10_1_1 = 425.0; - -const double NSFoundationVersionNumber10_1_2 = 425.0; - -const double NSFoundationVersionNumber10_1_3 = 425.0; - -const double NSFoundationVersionNumber10_1_4 = 425.0; - -const double NSFoundationVersionNumber10_2 = 462.0; - -const double NSFoundationVersionNumber10_2_1 = 462.0; - -const double NSFoundationVersionNumber10_2_2 = 462.0; - -const double NSFoundationVersionNumber10_2_3 = 462.0; - -const double NSFoundationVersionNumber10_2_4 = 462.0; - -const double NSFoundationVersionNumber10_2_5 = 462.0; - -const double NSFoundationVersionNumber10_2_6 = 462.0; - -const double NSFoundationVersionNumber10_2_7 = 462.7; - -const double NSFoundationVersionNumber10_2_8 = 462.7; - -const double NSFoundationVersionNumber10_3 = 500.0; - -const double NSFoundationVersionNumber10_3_1 = 500.0; - -const double NSFoundationVersionNumber10_3_2 = 500.3; - -const double NSFoundationVersionNumber10_3_3 = 500.54; - -const double NSFoundationVersionNumber10_3_4 = 500.56; - -const double NSFoundationVersionNumber10_3_5 = 500.56; - -const double NSFoundationVersionNumber10_3_6 = 500.56; - -const double NSFoundationVersionNumber10_3_7 = 500.56; - -const double NSFoundationVersionNumber10_3_8 = 500.56; - -const double NSFoundationVersionNumber10_3_9 = 500.58; - -const double NSFoundationVersionNumber10_4 = 567.0; - -const double NSFoundationVersionNumber10_4_1 = 567.0; - -const double NSFoundationVersionNumber10_4_2 = 567.12; - -const double NSFoundationVersionNumber10_4_3 = 567.21; - -const double NSFoundationVersionNumber10_4_4_Intel = 567.23; - -const double NSFoundationVersionNumber10_4_4_PowerPC = 567.21; - -const double NSFoundationVersionNumber10_4_5 = 567.25; - -const double NSFoundationVersionNumber10_4_6 = 567.26; - -const double NSFoundationVersionNumber10_4_7 = 567.27; - -const double NSFoundationVersionNumber10_4_8 = 567.28; - -const double NSFoundationVersionNumber10_4_9 = 567.29; - -const double NSFoundationVersionNumber10_4_10 = 567.29; - -const double NSFoundationVersionNumber10_4_11 = 567.36; - -const double NSFoundationVersionNumber10_5 = 677.0; - -const double NSFoundationVersionNumber10_5_1 = 677.1; - -const double NSFoundationVersionNumber10_5_2 = 677.15; - -const double NSFoundationVersionNumber10_5_3 = 677.19; - -const double NSFoundationVersionNumber10_5_4 = 677.19; - -const double NSFoundationVersionNumber10_5_5 = 677.21; - -const double NSFoundationVersionNumber10_5_6 = 677.22; - -const double NSFoundationVersionNumber10_5_7 = 677.24; - -const double NSFoundationVersionNumber10_5_8 = 677.26; - -const double NSFoundationVersionNumber10_6 = 751.0; - -const double NSFoundationVersionNumber10_6_1 = 751.0; - -const double NSFoundationVersionNumber10_6_2 = 751.14; - -const double NSFoundationVersionNumber10_6_3 = 751.21; - -const double NSFoundationVersionNumber10_6_4 = 751.29; - -const double NSFoundationVersionNumber10_6_5 = 751.42; - -const double NSFoundationVersionNumber10_6_6 = 751.53; - -const double NSFoundationVersionNumber10_6_7 = 751.53; - -const double NSFoundationVersionNumber10_6_8 = 751.62; - -const double NSFoundationVersionNumber10_7 = 833.1; - -const double NSFoundationVersionNumber10_7_1 = 833.1; - -const double NSFoundationVersionNumber10_7_2 = 833.2; - -const double NSFoundationVersionNumber10_7_3 = 833.24; - -const double NSFoundationVersionNumber10_7_4 = 833.25; - -const double NSFoundationVersionNumber10_8 = 945.0; - -const double NSFoundationVersionNumber10_8_1 = 945.0; - -const double NSFoundationVersionNumber10_8_2 = 945.11; - -const double NSFoundationVersionNumber10_8_3 = 945.16; - -const double NSFoundationVersionNumber10_8_4 = 945.18; - -const int NSFoundationVersionNumber10_9 = 1056; - -const int NSFoundationVersionNumber10_9_1 = 1056; - -const double NSFoundationVersionNumber10_9_2 = 1056.13; - -const double NSFoundationVersionNumber10_10 = 1151.16; - -const double NSFoundationVersionNumber10_10_1 = 1151.16; - -const double NSFoundationVersionNumber10_10_2 = 1152.14; - -const double NSFoundationVersionNumber10_10_3 = 1153.2; - -const double NSFoundationVersionNumber10_10_4 = 1153.2; - -const int NSFoundationVersionNumber10_10_5 = 1154; - -const int NSFoundationVersionNumber10_10_Max = 1199; - -const int NSFoundationVersionNumber10_11 = 1252; - -const double NSFoundationVersionNumber10_11_1 = 1255.1; - -const double NSFoundationVersionNumber10_11_2 = 1256.1; - -const double NSFoundationVersionNumber10_11_3 = 1256.1; - -const int NSFoundationVersionNumber10_11_4 = 1258; - -const int NSFoundationVersionNumber10_11_Max = 1299; - -const int __COREFOUNDATION_CFBASE__ = 1; - -const int TRUE = 1; - -const int FALSE = 0; - -const double kCFCoreFoundationVersionNumber10_0 = 196.4; - -const double kCFCoreFoundationVersionNumber10_0_3 = 196.5; - -const double kCFCoreFoundationVersionNumber10_1 = 226.0; - -const double kCFCoreFoundationVersionNumber10_1_1 = 226.0; - -const double kCFCoreFoundationVersionNumber10_1_2 = 227.2; - -const double kCFCoreFoundationVersionNumber10_1_3 = 227.2; - -const double kCFCoreFoundationVersionNumber10_1_4 = 227.3; - -const double kCFCoreFoundationVersionNumber10_2 = 263.0; - -const double kCFCoreFoundationVersionNumber10_2_1 = 263.1; - -const double kCFCoreFoundationVersionNumber10_2_2 = 263.1; - -const double kCFCoreFoundationVersionNumber10_2_3 = 263.3; - -const double kCFCoreFoundationVersionNumber10_2_4 = 263.3; - -const double kCFCoreFoundationVersionNumber10_2_5 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_6 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_7 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_8 = 263.5; - -const double kCFCoreFoundationVersionNumber10_3 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_1 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_2 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_3 = 299.3; - -const double kCFCoreFoundationVersionNumber10_3_4 = 299.31; - -const double kCFCoreFoundationVersionNumber10_3_5 = 299.31; - -const double kCFCoreFoundationVersionNumber10_3_6 = 299.32; - -const double kCFCoreFoundationVersionNumber10_3_7 = 299.33; - -const double kCFCoreFoundationVersionNumber10_3_8 = 299.33; - -const double kCFCoreFoundationVersionNumber10_3_9 = 299.35; - -const double kCFCoreFoundationVersionNumber10_4 = 368.0; - -const double kCFCoreFoundationVersionNumber10_4_1 = 368.1; - -const double kCFCoreFoundationVersionNumber10_4_2 = 368.11; - -const double kCFCoreFoundationVersionNumber10_4_3 = 368.18; - -const double kCFCoreFoundationVersionNumber10_4_4_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_4_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_5_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_5_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_6_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_6_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_7 = 368.27; - -const double kCFCoreFoundationVersionNumber10_4_8 = 368.27; - -const double kCFCoreFoundationVersionNumber10_4_9 = 368.28; - -const double kCFCoreFoundationVersionNumber10_4_10 = 368.28; - -const double kCFCoreFoundationVersionNumber10_4_11 = 368.31; - -const double kCFCoreFoundationVersionNumber10_5 = 476.0; - -const double kCFCoreFoundationVersionNumber10_5_1 = 476.0; - -const double kCFCoreFoundationVersionNumber10_5_2 = 476.1; - -const double kCFCoreFoundationVersionNumber10_5_3 = 476.13; - -const double kCFCoreFoundationVersionNumber10_5_4 = 476.14; - -const double kCFCoreFoundationVersionNumber10_5_5 = 476.15; - -const double kCFCoreFoundationVersionNumber10_5_6 = 476.17; - -const double kCFCoreFoundationVersionNumber10_5_7 = 476.18; - -const double kCFCoreFoundationVersionNumber10_5_8 = 476.19; - -const double kCFCoreFoundationVersionNumber10_6 = 550.0; - -const double kCFCoreFoundationVersionNumber10_6_1 = 550.0; - -const double kCFCoreFoundationVersionNumber10_6_2 = 550.13; - -const double kCFCoreFoundationVersionNumber10_6_3 = 550.19; - -const double kCFCoreFoundationVersionNumber10_6_4 = 550.29; - -const double kCFCoreFoundationVersionNumber10_6_5 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_6 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_7 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_8 = 550.43; - -const double kCFCoreFoundationVersionNumber10_7 = 635.0; - -const double kCFCoreFoundationVersionNumber10_7_1 = 635.0; - -const double kCFCoreFoundationVersionNumber10_7_2 = 635.15; - -const double kCFCoreFoundationVersionNumber10_7_3 = 635.19; - -const double kCFCoreFoundationVersionNumber10_7_4 = 635.21; - -const double kCFCoreFoundationVersionNumber10_7_5 = 635.21; - -const double kCFCoreFoundationVersionNumber10_8 = 744.0; - -const double kCFCoreFoundationVersionNumber10_8_1 = 744.0; - -const double kCFCoreFoundationVersionNumber10_8_2 = 744.12; - -const double kCFCoreFoundationVersionNumber10_8_3 = 744.18; - -const double kCFCoreFoundationVersionNumber10_8_4 = 744.19; - -const double kCFCoreFoundationVersionNumber10_9 = 855.11; - -const double kCFCoreFoundationVersionNumber10_9_1 = 855.11; - -const double kCFCoreFoundationVersionNumber10_9_2 = 855.14; - -const double kCFCoreFoundationVersionNumber10_10 = 1151.16; - -const double kCFCoreFoundationVersionNumber10_10_1 = 1151.16; - -const int kCFCoreFoundationVersionNumber10_10_2 = 1152; - -const double kCFCoreFoundationVersionNumber10_10_3 = 1153.18; - -const double kCFCoreFoundationVersionNumber10_10_4 = 1153.18; - -const double kCFCoreFoundationVersionNumber10_10_5 = 1153.18; - -const int kCFCoreFoundationVersionNumber10_10_Max = 1199; - -const int kCFCoreFoundationVersionNumber10_11 = 1253; - -const double kCFCoreFoundationVersionNumber10_11_1 = 1255.1; - -const double kCFCoreFoundationVersionNumber10_11_2 = 1256.14; - -const double kCFCoreFoundationVersionNumber10_11_3 = 1256.14; - -const double kCFCoreFoundationVersionNumber10_11_4 = 1258.1; - -const int kCFCoreFoundationVersionNumber10_11_Max = 1299; - -const int ISA_PTRAUTH_DISCRIMINATOR = 27361; diff --git a/pkgs/ffigen/test/native_objc_test/property_test.dart b/pkgs/ffigen/test/native_objc_test/property_test.dart index ada0cdf201..1983256239 100644 --- a/pkgs/ffigen/test/native_objc_test/property_test.dart +++ b/pkgs/ffigen/test/native_objc_test/property_test.dart @@ -8,10 +8,7 @@ import 'dart:ffi'; import 'dart:io'; -import 'package:ffigen/ffigen.dart'; -import 'package:path/path.dart' as path; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart'; import '../test_utils.dart'; import 'property_bindings.dart'; @@ -28,29 +25,6 @@ void main() { testInstance = PropertyInterface.new1(lib); }); - test('generate_bindings', () { - final config = Config.fromYaml(loadYaml( - File(path.join('test', 'native_objc_test', 'property_config.yaml')) - .readAsStringSync()) as YamlMap); - final library = parse(config); - final file = File( - path.join('test', 'debug_generated', 'property_test.dart'), - ); - library.generateFile(file); - - try { - final actual = file.readAsStringSync(); - final expected = File(path.join(config.output)).readAsStringSync(); - expect(actual, expected); - if (file.existsSync()) { - file.delete(); - } - } catch (e) { - print('Failed test: Debug generated file: ${file.absolute.path}'); - rethrow; - } - }); - group('instance properties', () { test('read-only property', () { expect(testInstance.readOnlyProperty, 7); diff --git a/pkgs/ffigen/test/native_objc_test/rename_config.yaml b/pkgs/ffigen/test/native_objc_test/rename_config.yaml new file mode 100644 index 0000000000..1de0786e44 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/rename_config.yaml @@ -0,0 +1,23 @@ +# Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +# =================== GENERATING TEST BINDINGS ================== +# dart run ffigen --config test/rename_test/config.yaml +# =============================================================== + +name: RenameLibrary +description: 'Rename test' +language: objc +output: 'test/native_objc_test/rename_test_bindings.dart' +objc-interfaces: + rename: + '_(.*)': '$1' +functions: + exclude: + - '.*' +headers: + entry-points: + - 'test/native_objc_test/rename_test.m' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/rename_test.dart b/pkgs/ffigen/test/native_objc_test/rename_test.dart new file mode 100644 index 0000000000..b4f74035d9 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/rename_test.dart @@ -0,0 +1,31 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:test/test.dart'; +import '../test_utils.dart'; +import 'rename_test_bindings.dart'; + +void main() { + late RenameLibrary lib; + group('rename_test', () { + setUpAll(() { + logWarnings(); + final dylib = File('test/native_objc_test/rename_test.dylib'); + verifySetupFile(dylib); + lib = RenameLibrary(DynamicLibrary.open(dylib.absolute.path)); + }); + + test('Renamed class', () { + final renamed = Renamed.new1(lib); + renamed.property = 123; + expect(renamed.property, 123); + }); + }); +} diff --git a/pkgs/ffigen/test/header_parser_tests/objc_config.h b/pkgs/ffigen/test/native_objc_test/rename_test.m similarity index 71% rename from pkgs/ffigen/test/header_parser_tests/objc_config.h rename to pkgs/ffigen/test/native_objc_test/rename_test.m index 1dc3007409..6187bd84eb 100644 --- a/pkgs/ffigen/test/header_parser_tests/objc_config.h +++ b/pkgs/ffigen/test/native_objc_test/rename_test.m @@ -4,11 +4,9 @@ #import -@interface Foo : NSObject {} +@interface _Renamed : NSObject +@property int32_t property; @end -@interface Excluded : NSObject {} -@end - -@interface _Renamed : NSObject {} +@implementation _Renamed @end diff --git a/pkgs/ffigen/test/native_objc_test/setup.dart b/pkgs/ffigen/test/native_objc_test/setup.dart index 7485c91c1f..c27604d5c0 100644 --- a/pkgs/ffigen/test/native_objc_test/setup.dart +++ b/pkgs/ffigen/test/native_objc_test/setup.dart @@ -27,10 +27,29 @@ Future _buildLib(String input, String output) async { print('Generated file: $output'); } +Future _generateBindings(String config) async { + final args = [ + 'run', + 'ffigen', + '--config', + 'test/native_objc_test/$config', + ]; + final process = + await Process.start(Platform.executable, args, workingDirectory: '../..'); + unawaited(stdout.addStream(process.stdout)); + unawaited(stderr.addStream(process.stderr)); + final result = await process.exitCode; + if (result != 0) { + throw ProcessException('dart', args, 'Generating bindings', result); + } + print('Generated bindings for: $config'); +} + Future main(List arguments) async { if (!Platform.isMacOS) { throw OSError('Objective C tests are only supported on MacOS'); } + print('Building Dynamic Library for Objective C Native Tests...'); await _buildLib('native_objc_test.m', 'native_objc_test.dylib'); await _buildLib('cast_test.m', 'cast_test.dylib'); @@ -41,4 +60,17 @@ Future main(List arguments) async { await _buildLib('forward_decl_test.m', 'forward_decl_test.dylib'); await _buildLib('string_test.m', 'string_test.dylib'); await _buildLib('block_test.m', 'block_test.dylib'); + await _buildLib('rename_test.m', 'rename_test.dylib'); + + print('Generating Bindings for Objective C Native Tests...'); + await _generateBindings('native_objc_config.yaml'); + await _generateBindings('cast_config.yaml'); + await _generateBindings('category_config.yaml'); + await _generateBindings('method_config.yaml'); + await _generateBindings('nullable_config.yaml'); + await _generateBindings('property_config.yaml'); + await _generateBindings('forward_decl_config.yaml'); + await _generateBindings('string_config.yaml'); + await _generateBindings('block_config.yaml'); + await _generateBindings('rename_config.yaml'); } diff --git a/pkgs/ffigen/test/native_objc_test/string_bindings.dart b/pkgs/ffigen/test/native_objc_test/string_bindings.dart deleted file mode 100644 index cfd1911198..0000000000 --- a/pkgs/ffigen/test/native_objc_test/string_bindings.dart +++ /dev/null @@ -1,10099 +0,0 @@ -// ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field - -// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; - -/// Tests calling Objective-C string methods -class StringTestObjCLibrary { - /// Holds the symbol lookup function. - final ffi.Pointer Function(String symbolName) - _lookup; - - /// The symbols are looked up in [dynamicLibrary]. - StringTestObjCLibrary(ffi.DynamicLibrary dynamicLibrary) - : _lookup = dynamicLibrary.lookup; - - /// The symbols are looked up with [lookup]. - StringTestObjCLibrary.fromLookup( - ffi.Pointer Function(String symbolName) - lookup) - : _lookup = lookup; - - late final ffi.Pointer _NSFoundationVersionNumber = - _lookup('NSFoundationVersionNumber'); - - double get NSFoundationVersionNumber => _NSFoundationVersionNumber.value; - - set NSFoundationVersionNumber(double value) => - _NSFoundationVersionNumber.value = value; - - late final ffi.Pointer _NSNotFound = - _lookup('NSNotFound'); - - int get NSNotFound => _NSNotFound.value; - - set NSNotFound(int value) => _NSNotFound.value = value; - - late final ffi.Pointer _kCFCoreFoundationVersionNumber = - _lookup('kCFCoreFoundationVersionNumber'); - - double get kCFCoreFoundationVersionNumber => - _kCFCoreFoundationVersionNumber.value; - - set kCFCoreFoundationVersionNumber(double value) => - _kCFCoreFoundationVersionNumber.value = value; - - late final ffi.Pointer _kCFNotFound = - _lookup('kCFNotFound'); - - int get kCFNotFound => _kCFNotFound.value; - - set kCFNotFound(int value) => _kCFNotFound.value = value; - - late final ffi.Pointer _kCFNull = _lookup('kCFNull'); - - CFNullRef get kCFNull => _kCFNull.value; - - set kCFNull(CFNullRef value) => _kCFNull.value = value; - - late final ffi.Pointer _kCFAllocatorDefault = - _lookup('kCFAllocatorDefault'); - - CFAllocatorRef get kCFAllocatorDefault => _kCFAllocatorDefault.value; - - set kCFAllocatorDefault(CFAllocatorRef value) => - _kCFAllocatorDefault.value = value; - - late final ffi.Pointer _kCFAllocatorSystemDefault = - _lookup('kCFAllocatorSystemDefault'); - - CFAllocatorRef get kCFAllocatorSystemDefault => - _kCFAllocatorSystemDefault.value; - - set kCFAllocatorSystemDefault(CFAllocatorRef value) => - _kCFAllocatorSystemDefault.value = value; - - late final ffi.Pointer _kCFAllocatorMalloc = - _lookup('kCFAllocatorMalloc'); - - CFAllocatorRef get kCFAllocatorMalloc => _kCFAllocatorMalloc.value; - - set kCFAllocatorMalloc(CFAllocatorRef value) => - _kCFAllocatorMalloc.value = value; - - late final ffi.Pointer _kCFAllocatorMallocZone = - _lookup('kCFAllocatorMallocZone'); - - CFAllocatorRef get kCFAllocatorMallocZone => _kCFAllocatorMallocZone.value; - - set kCFAllocatorMallocZone(CFAllocatorRef value) => - _kCFAllocatorMallocZone.value = value; - - late final ffi.Pointer _kCFAllocatorNull = - _lookup('kCFAllocatorNull'); - - CFAllocatorRef get kCFAllocatorNull => _kCFAllocatorNull.value; - - set kCFAllocatorNull(CFAllocatorRef value) => _kCFAllocatorNull.value = value; - - late final ffi.Pointer _kCFAllocatorUseContext = - _lookup('kCFAllocatorUseContext'); - - CFAllocatorRef get kCFAllocatorUseContext => _kCFAllocatorUseContext.value; - - set kCFAllocatorUseContext(CFAllocatorRef value) => - _kCFAllocatorUseContext.value = value; - - ffi.Pointer _registerName1(String name) { - final cstr = name.toNativeUtf8(); - final sel = _sel_registerName(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return sel; - } - - ffi.Pointer _sel_registerName( - ffi.Pointer str, - ) { - return __sel_registerName( - str, - ); - } - - late final __sel_registerNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sel_registerName'); - late final __sel_registerName = __sel_registerNamePtr - .asFunction Function(ffi.Pointer)>(); - - ffi.Pointer _getClass1(String name) { - final cstr = name.toNativeUtf8(); - final clazz = _objc_getClass(cstr.cast()); - pkg_ffi.calloc.free(cstr); - return clazz; - } - - ffi.Pointer _objc_getClass( - ffi.Pointer str, - ) { - return __objc_getClass( - str, - ); - } - - late final __objc_getClassPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('objc_getClass'); - late final __objc_getClass = __objc_getClassPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - late final ffi.Pointer _class_NSObject1 = _getClass1("NSObject"); - late final ffi.Pointer _sel_load1 = _registerName1("load"); - void _objc_msgSend_0( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_0( - obj, - sel, - ); - } - - late final __objc_msgSend_0Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_initialize1 = - _registerName1("initialize"); - late final ffi.Pointer _sel_init1 = _registerName1("init"); - instancetype _objc_msgSend_1( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_1( - obj, - sel, - ); - } - - late final __objc_msgSend_1Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_new1 = _registerName1("new"); - late final ffi.Pointer _sel_allocWithZone_1 = - _registerName1("allocWithZone:"); - instancetype _objc_msgSend_2( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_NSZone> zone, - ) { - return __objc_msgSend_2( - obj, - sel, - zone, - ); - } - - late final __objc_msgSend_2Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>>('objc_msgSend'); - late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_NSZone>)>(); - - late final ffi.Pointer _sel_alloc1 = _registerName1("alloc"); - late final ffi.Pointer _sel_dealloc1 = _registerName1("dealloc"); - late final ffi.Pointer _sel_finalize1 = _registerName1("finalize"); - late final ffi.Pointer _sel_copy1 = _registerName1("copy"); - late final ffi.Pointer _sel_mutableCopy1 = - _registerName1("mutableCopy"); - late final ffi.Pointer _sel_copyWithZone_1 = - _registerName1("copyWithZone:"); - late final ffi.Pointer _sel_mutableCopyWithZone_1 = - _registerName1("mutableCopyWithZone:"); - late final ffi.Pointer _sel_instancesRespondToSelector_1 = - _registerName1("instancesRespondToSelector:"); - bool _objc_msgSend_3( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_3( - obj, - sel, - aSelector, - ) != - 0; - } - - late final __objc_msgSend_3Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_conformsToProtocol_1 = - _registerName1("conformsToProtocol:"); - bool _objc_msgSend_4( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer protocol, - ) { - return __objc_msgSend_4( - obj, - sel, - protocol, - ) != - 0; - } - - late final __objc_msgSend_4Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_methodForSelector_1 = - _registerName1("methodForSelector:"); - IMP _objc_msgSend_5( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_5( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_5Ptr = _lookup< - ffi.NativeFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< - IMP Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodForSelector_1 = - _registerName1("instanceMethodForSelector:"); - late final ffi.Pointer _sel_doesNotRecognizeSelector_1 = - _registerName1("doesNotRecognizeSelector:"); - void _objc_msgSend_6( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_6( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_6Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardingTargetForSelector_1 = - _registerName1("forwardingTargetForSelector:"); - ffi.Pointer _objc_msgSend_7( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_7( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_7Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_forwardInvocation_1 = - _registerName1("forwardInvocation:"); - void _objc_msgSend_8( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anInvocation, - ) { - return __objc_msgSend_8( - obj, - sel, - anInvocation, - ); - } - - late final __objc_msgSend_8Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _class_NSMethodSignature1 = - _getClass1("NSMethodSignature"); - late final ffi.Pointer _sel_methodSignatureForSelector_1 = - _registerName1("methodSignatureForSelector:"); - ffi.Pointer _objc_msgSend_9( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ) { - return __objc_msgSend_9( - obj, - sel, - aSelector, - ); - } - - late final __objc_msgSend_9Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_instanceMethodSignatureForSelector_1 = - _registerName1("instanceMethodSignatureForSelector:"); - late final ffi.Pointer _sel_allowsWeakReference1 = - _registerName1("allowsWeakReference"); - bool _objc_msgSend_10( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_10( - obj, - sel, - ) != - 0; - } - - late final __objc_msgSend_10Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_retainWeakReference1 = - _registerName1("retainWeakReference"); - late final ffi.Pointer _sel_isSubclassOfClass_1 = - _registerName1("isSubclassOfClass:"); - late final ffi.Pointer _sel_resolveClassMethod_1 = - _registerName1("resolveClassMethod:"); - late final ffi.Pointer _sel_resolveInstanceMethod_1 = - _registerName1("resolveInstanceMethod:"); - late final ffi.Pointer _sel_hash1 = _registerName1("hash"); - int _objc_msgSend_11( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_11( - obj, - sel, - ); - } - - late final __objc_msgSend_11Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_superclass1 = - _registerName1("superclass"); - late final ffi.Pointer _sel_class1 = _registerName1("class"); - late final ffi.Pointer _class_NSString1 = _getClass1("NSString"); - late final ffi.Pointer _sel_length1 = _registerName1("length"); - late final ffi.Pointer _sel_characterAtIndex_1 = - _registerName1("characterAtIndex:"); - int _objc_msgSend_12( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ) { - return __objc_msgSend_12( - obj, - sel, - index, - ); - } - - late final __objc_msgSend_12Ptr = _lookup< - ffi.NativeFunction< - unichar Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithCoder_1 = - _registerName1("initWithCoder:"); - instancetype _objc_msgSend_13( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_13( - obj, - sel, - coder, - ); - } - - late final __objc_msgSend_13Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_substringFromIndex_1 = - _registerName1("substringFromIndex:"); - ffi.Pointer _objc_msgSend_14( - ffi.Pointer obj, - ffi.Pointer sel, - int from, - ) { - return __objc_msgSend_14( - obj, - sel, - from, - ); - } - - late final __objc_msgSend_14Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_substringToIndex_1 = - _registerName1("substringToIndex:"); - late final ffi.Pointer _sel_substringWithRange_1 = - _registerName1("substringWithRange:"); - ffi.Pointer _objc_msgSend_15( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_15( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_15Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, NSRange)>(); - - late final ffi.Pointer _sel_getCharacters_range_1 = - _registerName1("getCharacters:range:"); - void _objc_msgSend_16( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - NSRange range, - ) { - return __objc_msgSend_16( - obj, - sel, - buffer, - range, - ); - } - - late final __objc_msgSend_16Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRange)>(); - - late final ffi.Pointer _sel_compare_1 = _registerName1("compare:"); - int _objc_msgSend_17( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - ) { - return __objc_msgSend_17( - obj, - sel, - string, - ); - } - - late final __objc_msgSend_17Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_compare_options_1 = - _registerName1("compare:options:"); - int _objc_msgSend_18( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - int mask, - ) { - return __objc_msgSend_18( - obj, - sel, - string, - mask, - ); - } - - late final __objc_msgSend_18Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_compare_options_range_1 = - _registerName1("compare:options:range:"); - int _objc_msgSend_19( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - int mask, - NSRange rangeOfReceiverToCompare, - ) { - return __objc_msgSend_19( - obj, - sel, - string, - mask, - rangeOfReceiverToCompare, - ); - } - - late final __objc_msgSend_19Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, NSRange)>(); - - late final ffi.Pointer _sel_compare_options_range_locale_1 = - _registerName1("compare:options:range:locale:"); - int _objc_msgSend_20( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - int mask, - NSRange rangeOfReceiverToCompare, - ffi.Pointer locale, - ) { - return __objc_msgSend_20( - obj, - sel, - string, - mask, - rangeOfReceiverToCompare, - locale, - ); - } - - late final __objc_msgSend_20Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - NSRange, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, NSRange, ffi.Pointer)>(); - - late final ffi.Pointer _sel_caseInsensitiveCompare_1 = - _registerName1("caseInsensitiveCompare:"); - late final ffi.Pointer _sel_localizedCompare_1 = - _registerName1("localizedCompare:"); - late final ffi.Pointer _sel_localizedCaseInsensitiveCompare_1 = - _registerName1("localizedCaseInsensitiveCompare:"); - late final ffi.Pointer _sel_localizedStandardCompare_1 = - _registerName1("localizedStandardCompare:"); - late final ffi.Pointer _sel_isEqualToString_1 = - _registerName1("isEqualToString:"); - late final ffi.Pointer _sel_hasPrefix_1 = - _registerName1("hasPrefix:"); - late final ffi.Pointer _sel_hasSuffix_1 = - _registerName1("hasSuffix:"); - late final ffi.Pointer _sel_commonPrefixWithString_options_1 = - _registerName1("commonPrefixWithString:options:"); - ffi.Pointer _objc_msgSend_21( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer str, - int mask, - ) { - return __objc_msgSend_21( - obj, - sel, - str, - mask, - ); - } - - late final __objc_msgSend_21Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_containsString_1 = - _registerName1("containsString:"); - late final ffi.Pointer - _sel_localizedCaseInsensitiveContainsString_1 = - _registerName1("localizedCaseInsensitiveContainsString:"); - late final ffi.Pointer _sel_localizedStandardContainsString_1 = - _registerName1("localizedStandardContainsString:"); - late final ffi.Pointer _sel_localizedStandardRangeOfString_1 = - _registerName1("localizedStandardRangeOfString:"); - NSRange _objc_msgSend_22( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer str, - ) { - return __objc_msgSend_22( - obj, - sel, - str, - ); - } - - late final __objc_msgSend_22Ptr = _lookup< - ffi.NativeFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_rangeOfString_1 = - _registerName1("rangeOfString:"); - late final ffi.Pointer _sel_rangeOfString_options_1 = - _registerName1("rangeOfString:options:"); - NSRange _objc_msgSend_23( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchString, - int mask, - ) { - return __objc_msgSend_23( - obj, - sel, - searchString, - mask, - ); - } - - late final __objc_msgSend_23Ptr = _lookup< - ffi.NativeFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_rangeOfString_options_range_1 = - _registerName1("rangeOfString:options:range:"); - NSRange _objc_msgSend_24( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchString, - int mask, - NSRange rangeOfReceiverToSearch, - ) { - return __objc_msgSend_24( - obj, - sel, - searchString, - mask, - rangeOfReceiverToSearch, - ); - } - - late final __objc_msgSend_24Ptr = _lookup< - ffi.NativeFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, NSRange)>(); - - late final ffi.Pointer _sel_rangeOfString_options_range_locale_1 = - _registerName1("rangeOfString:options:range:locale:"); - NSRange _objc_msgSend_25( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchString, - int mask, - NSRange rangeOfReceiverToSearch, - ffi.Pointer locale, - ) { - return __objc_msgSend_25( - obj, - sel, - searchString, - mask, - rangeOfReceiverToSearch, - locale, - ); - } - - late final __objc_msgSend_25Ptr = _lookup< - ffi.NativeFunction< - NSRange Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - NSRange, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, NSRange, ffi.Pointer)>(); - - late final ffi.Pointer _sel_rangeOfCharacterFromSet_1 = - _registerName1("rangeOfCharacterFromSet:"); - late final ffi.Pointer _sel_rangeOfCharacterFromSet_options_1 = - _registerName1("rangeOfCharacterFromSet:options:"); - late final ffi.Pointer _sel_rangeOfCharacterFromSet_options_range_1 = - _registerName1("rangeOfCharacterFromSet:options:range:"); - late final ffi.Pointer - _sel_rangeOfComposedCharacterSequenceAtIndex_1 = - _registerName1("rangeOfComposedCharacterSequenceAtIndex:"); - NSRange _objc_msgSend_26( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ) { - return __objc_msgSend_26( - obj, - sel, - index, - ); - } - - late final __objc_msgSend_26Ptr = _lookup< - ffi.NativeFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer - _sel_rangeOfComposedCharacterSequencesForRange_1 = - _registerName1("rangeOfComposedCharacterSequencesForRange:"); - NSRange _objc_msgSend_27( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_27( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_27Ptr = _lookup< - ffi.NativeFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< - NSRange Function( - ffi.Pointer, ffi.Pointer, NSRange)>(); - - late final ffi.Pointer _sel_stringByAppendingString_1 = - _registerName1("stringByAppendingString:"); - ffi.Pointer _objc_msgSend_28( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aString, - ) { - return __objc_msgSend_28( - obj, - sel, - aString, - ); - } - - late final __objc_msgSend_28Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_28 = __objc_msgSend_28Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_stringByAppendingFormat_1 = - _registerName1("stringByAppendingFormat:"); - late final ffi.Pointer _sel_doubleValue1 = - _registerName1("doubleValue"); - double _objc_msgSend_29( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_29( - obj, - sel, - ); - } - - late final __objc_msgSend_29Ptr = _lookup< - ffi.NativeFunction< - ffi.Double Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_29 = __objc_msgSend_29Ptr.asFunction< - double Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_floatValue1 = - _registerName1("floatValue"); - double _objc_msgSend_30( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_30( - obj, - sel, - ); - } - - late final __objc_msgSend_30Ptr = _lookup< - ffi.NativeFunction< - ffi.Float Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_30 = __objc_msgSend_30Ptr.asFunction< - double Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_intValue1 = _registerName1("intValue"); - int _objc_msgSend_31( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_31( - obj, - sel, - ); - } - - late final __objc_msgSend_31Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_31 = __objc_msgSend_31Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_integerValue1 = - _registerName1("integerValue"); - int _objc_msgSend_32( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_32( - obj, - sel, - ); - } - - late final __objc_msgSend_32Ptr = _lookup< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_32 = __objc_msgSend_32Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_longLongValue1 = - _registerName1("longLongValue"); - int _objc_msgSend_33( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_33( - obj, - sel, - ); - } - - late final __objc_msgSend_33Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.LongLong Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_33 = __objc_msgSend_33Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_boolValue1 = _registerName1("boolValue"); - late final ffi.Pointer _sel_uppercaseString1 = - _registerName1("uppercaseString"); - late final ffi.Pointer _sel_lowercaseString1 = - _registerName1("lowercaseString"); - late final ffi.Pointer _sel_capitalizedString1 = - _registerName1("capitalizedString"); - late final ffi.Pointer _sel_localizedUppercaseString1 = - _registerName1("localizedUppercaseString"); - late final ffi.Pointer _sel_localizedLowercaseString1 = - _registerName1("localizedLowercaseString"); - late final ffi.Pointer _sel_localizedCapitalizedString1 = - _registerName1("localizedCapitalizedString"); - late final ffi.Pointer _sel_uppercaseStringWithLocale_1 = - _registerName1("uppercaseStringWithLocale:"); - late final ffi.Pointer _sel_lowercaseStringWithLocale_1 = - _registerName1("lowercaseStringWithLocale:"); - late final ffi.Pointer _sel_capitalizedStringWithLocale_1 = - _registerName1("capitalizedStringWithLocale:"); - late final ffi.Pointer _sel_getLineStart_end_contentsEnd_forRange_1 = - _registerName1("getLineStart:end:contentsEnd:forRange:"); - void _objc_msgSend_34( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer startPtr, - ffi.Pointer lineEndPtr, - ffi.Pointer contentsEndPtr, - NSRange range, - ) { - return __objc_msgSend_34( - obj, - sel, - startPtr, - lineEndPtr, - contentsEndPtr, - range, - ); - } - - late final __objc_msgSend_34Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_34 = __objc_msgSend_34Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSRange)>(); - - late final ffi.Pointer _sel_lineRangeForRange_1 = - _registerName1("lineRangeForRange:"); - late final ffi.Pointer - _sel_getParagraphStart_end_contentsEnd_forRange_1 = - _registerName1("getParagraphStart:end:contentsEnd:forRange:"); - late final ffi.Pointer _sel_paragraphRangeForRange_1 = - _registerName1("paragraphRangeForRange:"); - ffi.Pointer<_ObjCBlockDesc> _newBlockDesc1() { - final d = - pkg_ffi.calloc.allocate<_ObjCBlockDesc>(ffi.sizeOf<_ObjCBlockDesc>()); - d.ref.size = ffi.sizeOf<_ObjCBlock>(); - return d; - } - - late final ffi.Pointer<_ObjCBlockDesc> _objc_block_desc1 = _newBlockDesc1(); - ffi.Pointer<_ObjCBlock> _newBlock1( - ffi.Pointer invoke, ffi.Pointer target) { - final b = pkg_ffi.calloc.allocate<_ObjCBlock>(ffi.sizeOf<_ObjCBlock>()); - b.ref.invoke = invoke; - b.ref.target = target; - b.ref.descriptor = _objc_block_desc1; - return b; - } - - late final ffi.Pointer - _sel_enumerateSubstringsInRange_options_usingBlock_1 = - _registerName1("enumerateSubstringsInRange:options:usingBlock:"); - void _objc_msgSend_35( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_35( - obj, - sel, - range, - opts, - block, - ); - } - - late final __objc_msgSend_35Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_35 = __objc_msgSend_35Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_enumerateLinesUsingBlock_1 = - _registerName1("enumerateLinesUsingBlock:"); - void _objc_msgSend_36( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_36( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_36Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_36 = __objc_msgSend_36Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_UTF8String1 = - _registerName1("UTF8String"); - ffi.Pointer _objc_msgSend_37( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_37( - obj, - sel, - ); - } - - late final __objc_msgSend_37Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_37 = __objc_msgSend_37Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_fastestEncoding1 = - _registerName1("fastestEncoding"); - late final ffi.Pointer _sel_smallestEncoding1 = - _registerName1("smallestEncoding"); - late final ffi.Pointer _class_NSData1 = _getClass1("NSData"); - late final ffi.Pointer - _sel_dataUsingEncoding_allowLossyConversion_1 = - _registerName1("dataUsingEncoding:allowLossyConversion:"); - ffi.Pointer _objc_msgSend_38( - ffi.Pointer obj, - ffi.Pointer sel, - int encoding, - bool lossy, - ) { - return __objc_msgSend_38( - obj, - sel, - encoding, - lossy ? 1 : 0, - ); - } - - late final __objc_msgSend_38Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSStringEncoding, - ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_38 = __objc_msgSend_38Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int, int)>(); - - late final ffi.Pointer _sel_dataUsingEncoding_1 = - _registerName1("dataUsingEncoding:"); - ffi.Pointer _objc_msgSend_39( - ffi.Pointer obj, - ffi.Pointer sel, - int encoding, - ) { - return __objc_msgSend_39( - obj, - sel, - encoding, - ); - } - - late final __objc_msgSend_39Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_39 = __objc_msgSend_39Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_canBeConvertedToEncoding_1 = - _registerName1("canBeConvertedToEncoding:"); - bool _objc_msgSend_40( - ffi.Pointer obj, - ffi.Pointer sel, - int encoding, - ) { - return __objc_msgSend_40( - obj, - sel, - encoding, - ) != - 0; - } - - late final __objc_msgSend_40Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_40 = __objc_msgSend_40Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_cStringUsingEncoding_1 = - _registerName1("cStringUsingEncoding:"); - void _objc_msgSend_41( - ffi.Pointer obj, - ffi.Pointer sel, - int encoding, - ) { - return __objc_msgSend_41( - obj, - sel, - encoding, - ); - } - - late final __objc_msgSend_41Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_41 = __objc_msgSend_41Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_getCString_maxLength_encoding_1 = - _registerName1("getCString:maxLength:encoding:"); - bool _objc_msgSend_42( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - int maxBufferCount, - int encoding, - ) { - return __objc_msgSend_42( - obj, - sel, - buffer, - maxBufferCount, - encoding, - ) != - 0; - } - - late final __objc_msgSend_42Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_42 = __objc_msgSend_42Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int)>(); - - late final ffi.Pointer - _sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_1 = - _registerName1( - "getBytes:maxLength:usedLength:encoding:options:range:remainingRange:"); - bool _objc_msgSend_43( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - int maxBufferCount, - ffi.Pointer usedBufferCount, - int encoding, - int options, - NSRange range, - NSRangePointer leftover, - ) { - return __objc_msgSend_43( - obj, - sel, - buffer, - maxBufferCount, - usedBufferCount, - encoding, - options, - range, - leftover, - ) != - 0; - } - - late final __objc_msgSend_43Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer, - NSStringEncoding, - ffi.Int32, - NSRange, - NSRangePointer)>>('objc_msgSend'); - late final __objc_msgSend_43 = __objc_msgSend_43Ptr.asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - int, - int, - NSRange, - NSRangePointer)>(); - - late final ffi.Pointer _sel_maximumLengthOfBytesUsingEncoding_1 = - _registerName1("maximumLengthOfBytesUsingEncoding:"); - int _objc_msgSend_44( - ffi.Pointer obj, - ffi.Pointer sel, - int enc, - ) { - return __objc_msgSend_44( - obj, - sel, - enc, - ); - } - - late final __objc_msgSend_44Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_44 = __objc_msgSend_44Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_lengthOfBytesUsingEncoding_1 = - _registerName1("lengthOfBytesUsingEncoding:"); - late final ffi.Pointer _sel_availableStringEncodings1 = - _registerName1("availableStringEncodings"); - ffi.Pointer _objc_msgSend_45( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_45( - obj, - sel, - ); - } - - late final __objc_msgSend_45Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_45 = __objc_msgSend_45Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_localizedNameOfStringEncoding_1 = - _registerName1("localizedNameOfStringEncoding:"); - late final ffi.Pointer _sel_defaultCStringEncoding1 = - _registerName1("defaultCStringEncoding"); - late final ffi.Pointer _sel_decomposedStringWithCanonicalMapping1 = - _registerName1("decomposedStringWithCanonicalMapping"); - late final ffi.Pointer _sel_precomposedStringWithCanonicalMapping1 = - _registerName1("precomposedStringWithCanonicalMapping"); - late final ffi.Pointer - _sel_decomposedStringWithCompatibilityMapping1 = - _registerName1("decomposedStringWithCompatibilityMapping"); - late final ffi.Pointer - _sel_precomposedStringWithCompatibilityMapping1 = - _registerName1("precomposedStringWithCompatibilityMapping"); - late final ffi.Pointer _sel_stringByTrimmingCharactersInSet_1 = - _registerName1("stringByTrimmingCharactersInSet:"); - late final ffi.Pointer - _sel_stringByPaddingToLength_withString_startingAtIndex_1 = - _registerName1("stringByPaddingToLength:withString:startingAtIndex:"); - ffi.Pointer _objc_msgSend_46( - ffi.Pointer obj, - ffi.Pointer sel, - int newLength, - ffi.Pointer padString, - int padIndex, - ) { - return __objc_msgSend_46( - obj, - sel, - newLength, - padString, - padIndex, - ); - } - - late final __objc_msgSend_46Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_46 = __objc_msgSend_46Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_stringByFoldingWithOptions_locale_1 = - _registerName1("stringByFoldingWithOptions:locale:"); - ffi.Pointer _objc_msgSend_47( - ffi.Pointer obj, - ffi.Pointer sel, - int options, - ffi.Pointer locale, - ) { - return __objc_msgSend_47( - obj, - sel, - options, - locale, - ); - } - - late final __objc_msgSend_47Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_47 = __objc_msgSend_47Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); - - late final ffi.Pointer - _sel_stringByReplacingOccurrencesOfString_withString_options_range_1 = - _registerName1( - "stringByReplacingOccurrencesOfString:withString:options:range:"); - ffi.Pointer _objc_msgSend_48( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer target, - ffi.Pointer replacement, - int options, - NSRange searchRange, - ) { - return __objc_msgSend_48( - obj, - sel, - target, - replacement, - options, - searchRange, - ); - } - - late final __objc_msgSend_48Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_48 = __objc_msgSend_48Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - NSRange)>(); - - late final ffi.Pointer - _sel_stringByReplacingOccurrencesOfString_withString_1 = - _registerName1("stringByReplacingOccurrencesOfString:withString:"); - ffi.Pointer _objc_msgSend_49( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer target, - ffi.Pointer replacement, - ) { - return __objc_msgSend_49( - obj, - sel, - target, - replacement, - ); - } - - late final __objc_msgSend_49Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_49 = __objc_msgSend_49Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer - _sel_stringByReplacingCharactersInRange_withString_1 = - _registerName1("stringByReplacingCharactersInRange:withString:"); - ffi.Pointer _objc_msgSend_50( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ffi.Pointer replacement, - ) { - return __objc_msgSend_50( - obj, - sel, - range, - replacement, - ); - } - - late final __objc_msgSend_50Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSRange, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_50 = __objc_msgSend_50Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSRange, ffi.Pointer)>(); - - late final ffi.Pointer _sel_stringByApplyingTransform_reverse_1 = - _registerName1("stringByApplyingTransform:reverse:"); - ffi.Pointer _objc_msgSend_51( - ffi.Pointer obj, - ffi.Pointer sel, - NSStringTransform transform, - bool reverse, - ) { - return __objc_msgSend_51( - obj, - sel, - transform, - reverse ? 1 : 0, - ); - } - - late final __objc_msgSend_51Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSStringTransform, - ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_51 = __objc_msgSend_51Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSStringTransform, int)>(); - - late final ffi.Pointer _sel_writeToURL_atomically_encoding_error_1 = - _registerName1("writeToURL:atomically:encoding:error:"); - bool _objc_msgSend_52( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - bool useAuxiliaryFile, - int enc, - ffi.Pointer> error, - ) { - return __objc_msgSend_52( - obj, - sel, - url, - useAuxiliaryFile ? 1 : 0, - enc, - error, - ) != - 0; - } - - late final __objc_msgSend_52Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Uint8, - NSStringEncoding, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_52 = __objc_msgSend_52Ptr.asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - ffi.Pointer>)>(); - - late final ffi.Pointer _sel_writeToFile_atomically_encoding_error_1 = - _registerName1("writeToFile:atomically:encoding:error:"); - late final ffi.Pointer _sel_description1 = - _registerName1("description"); - late final ffi.Pointer - _sel_initWithCharactersNoCopy_length_freeWhenDone_1 = - _registerName1("initWithCharactersNoCopy:length:freeWhenDone:"); - instancetype _objc_msgSend_53( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer characters, - int length, - bool freeBuffer, - ) { - return __objc_msgSend_53( - obj, - sel, - characters, - length, - freeBuffer ? 1 : 0, - ); - } - - late final __objc_msgSend_53Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_53 = __objc_msgSend_53Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int)>(); - - late final ffi.Pointer - _sel_initWithCharactersNoCopy_length_deallocator_1 = - _registerName1("initWithCharactersNoCopy:length:deallocator:"); - instancetype _objc_msgSend_54( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer chars, - int len, - ffi.Pointer<_ObjCBlock> deallocator, - ) { - return __objc_msgSend_54( - obj, - sel, - chars, - len, - deallocator, - ); - } - - late final __objc_msgSend_54Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_initWithCharacters_length_1 = - _registerName1("initWithCharacters:length:"); - instancetype _objc_msgSend_55( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer characters, - int length, - ) { - return __objc_msgSend_55( - obj, - sel, - characters, - length, - ); - } - - late final __objc_msgSend_55Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_55 = __objc_msgSend_55Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithUTF8String_1 = - _registerName1("initWithUTF8String:"); - instancetype _objc_msgSend_56( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer nullTerminatedCString, - ) { - return __objc_msgSend_56( - obj, - sel, - nullTerminatedCString, - ); - } - - late final __objc_msgSend_56Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_56 = __objc_msgSend_56Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_initWithString_1 = - _registerName1("initWithString:"); - late final ffi.Pointer _sel_initWithFormat_1 = - _registerName1("initWithFormat:"); - late final ffi.Pointer _sel_initWithFormat_arguments_1 = - _registerName1("initWithFormat:arguments:"); - instancetype _objc_msgSend_57( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer<__va_list_tag> argList, - ) { - return __objc_msgSend_57( - obj, - sel, - format, - argList, - ); - } - - late final __objc_msgSend_57Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); - late final __objc_msgSend_57 = __objc_msgSend_57Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer<__va_list_tag>)>(); - - late final ffi.Pointer _sel_initWithFormat_locale_1 = - _registerName1("initWithFormat:locale:"); - instancetype _objc_msgSend_58( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer locale, - ) { - return __objc_msgSend_58( - obj, - sel, - format, - locale, - ); - } - - late final __objc_msgSend_58Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_58 = __objc_msgSend_58Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_initWithFormat_locale_arguments_1 = - _registerName1("initWithFormat:locale:arguments:"); - instancetype _objc_msgSend_59( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer locale, - ffi.Pointer<__va_list_tag> argList, - ) { - return __objc_msgSend_59( - obj, - sel, - format, - locale, - argList, - ); - } - - late final __objc_msgSend_59Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); - late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<__va_list_tag>)>(); - - late final ffi.Pointer _sel_initWithData_encoding_1 = - _registerName1("initWithData:encoding:"); - instancetype _objc_msgSend_60( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - int encoding, - ) { - return __objc_msgSend_60( - obj, - sel, - data, - encoding, - ); - } - - late final __objc_msgSend_60Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithBytes_length_encoding_1 = - _registerName1("initWithBytes:length:encoding:"); - instancetype _objc_msgSend_61( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int len, - int encoding, - ) { - return __objc_msgSend_61( - obj, - sel, - bytes, - len, - encoding, - ); - } - - late final __objc_msgSend_61Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_61 = __objc_msgSend_61Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int)>(); - - late final ffi.Pointer - _sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1 = - _registerName1("initWithBytesNoCopy:length:encoding:freeWhenDone:"); - instancetype _objc_msgSend_62( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int len, - int encoding, - bool freeBuffer, - ) { - return __objc_msgSend_62( - obj, - sel, - bytes, - len, - encoding, - freeBuffer ? 1 : 0, - ); - } - - late final __objc_msgSend_62Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSStringEncoding, - ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, int)>(); - - late final ffi.Pointer - _sel_initWithBytesNoCopy_length_encoding_deallocator_1 = - _registerName1("initWithBytesNoCopy:length:encoding:deallocator:"); - instancetype _objc_msgSend_63( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int len, - int encoding, - ffi.Pointer<_ObjCBlock> deallocator, - ) { - return __objc_msgSend_63( - obj, - sel, - bytes, - len, - encoding, - deallocator, - ); - } - - late final __objc_msgSend_63Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSStringEncoding, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_63 = __objc_msgSend_63Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_string1 = _registerName1("string"); - late final ffi.Pointer _sel_stringWithString_1 = - _registerName1("stringWithString:"); - late final ffi.Pointer _sel_stringWithCharacters_length_1 = - _registerName1("stringWithCharacters:length:"); - late final ffi.Pointer _sel_stringWithUTF8String_1 = - _registerName1("stringWithUTF8String:"); - late final ffi.Pointer _sel_stringWithFormat_1 = - _registerName1("stringWithFormat:"); - late final ffi.Pointer _sel_localizedStringWithFormat_1 = - _registerName1("localizedStringWithFormat:"); - late final ffi.Pointer _sel_initWithCString_encoding_1 = - _registerName1("initWithCString:encoding:"); - instancetype _objc_msgSend_64( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer nullTerminatedCString, - int encoding, - ) { - return __objc_msgSend_64( - obj, - sel, - nullTerminatedCString, - encoding, - ); - } - - late final __objc_msgSend_64Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_64 = __objc_msgSend_64Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_stringWithCString_encoding_1 = - _registerName1("stringWithCString:encoding:"); - late final ffi.Pointer _sel_initWithContentsOfURL_encoding_error_1 = - _registerName1("initWithContentsOfURL:encoding:error:"); - instancetype _objc_msgSend_65( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - int enc, - ffi.Pointer> error, - ) { - return __objc_msgSend_65( - obj, - sel, - url, - enc, - error, - ); - } - - late final __objc_msgSend_65Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSStringEncoding, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_65 = __objc_msgSend_65Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); - - late final ffi.Pointer _sel_initWithContentsOfFile_encoding_error_1 = - _registerName1("initWithContentsOfFile:encoding:error:"); - late final ffi.Pointer - _sel_stringWithContentsOfURL_encoding_error_1 = - _registerName1("stringWithContentsOfURL:encoding:error:"); - late final ffi.Pointer - _sel_stringWithContentsOfFile_encoding_error_1 = - _registerName1("stringWithContentsOfFile:encoding:error:"); - late final ffi.Pointer - _sel_initWithContentsOfURL_usedEncoding_error_1 = - _registerName1("initWithContentsOfURL:usedEncoding:error:"); - instancetype _objc_msgSend_66( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer enc, - ffi.Pointer> error, - ) { - return __objc_msgSend_66( - obj, - sel, - url, - enc, - error, - ); - } - - late final __objc_msgSend_66Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_66 = __objc_msgSend_66Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final ffi.Pointer - _sel_initWithContentsOfFile_usedEncoding_error_1 = - _registerName1("initWithContentsOfFile:usedEncoding:error:"); - late final ffi.Pointer - _sel_stringWithContentsOfURL_usedEncoding_error_1 = - _registerName1("stringWithContentsOfURL:usedEncoding:error:"); - late final ffi.Pointer - _sel_stringWithContentsOfFile_usedEncoding_error_1 = - _registerName1("stringWithContentsOfFile:usedEncoding:error:"); - late final ffi.Pointer - _sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1 = - _registerName1( - "stringEncodingForData:encodingOptions:convertedString:usedLossyConversion:"); - int _objc_msgSend_67( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - ffi.Pointer opts, - ffi.Pointer> string, - ffi.Pointer usedLossyConversion, - ) { - return __objc_msgSend_67( - obj, - sel, - data, - opts, - string, - usedLossyConversion, - ); - } - - late final __objc_msgSend_67Ptr = _lookup< - ffi.NativeFunction< - NSStringEncoding Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_67 = __objc_msgSend_67Ptr.asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_propertyList1 = - _registerName1("propertyList"); - late final ffi.Pointer _class_NSDictionary1 = - _getClass1("NSDictionary"); - late final ffi.Pointer _sel_propertyListFromStringsFileFormat1 = - _registerName1("propertyListFromStringsFileFormat"); - ffi.Pointer _objc_msgSend_68( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_68( - obj, - sel, - ); - } - - late final __objc_msgSend_68Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_68 = __objc_msgSend_68Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_cString1 = _registerName1("cString"); - late final ffi.Pointer _sel_lossyCString1 = - _registerName1("lossyCString"); - late final ffi.Pointer _sel_cStringLength1 = - _registerName1("cStringLength"); - late final ffi.Pointer _sel_getCString_1 = - _registerName1("getCString:"); - void _objc_msgSend_69( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - ) { - return __objc_msgSend_69( - obj, - sel, - bytes, - ); - } - - late final __objc_msgSend_69Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_69 = __objc_msgSend_69Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_getCString_maxLength_1 = - _registerName1("getCString:maxLength:"); - void _objc_msgSend_70( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int maxLength, - ) { - return __objc_msgSend_70( - obj, - sel, - bytes, - maxLength, - ); - } - - late final __objc_msgSend_70Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_70 = __objc_msgSend_70Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer - _sel_getCString_maxLength_range_remainingRange_1 = - _registerName1("getCString:maxLength:range:remainingRange:"); - void _objc_msgSend_71( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int maxLength, - NSRange aRange, - NSRangePointer leftoverRange, - ) { - return __objc_msgSend_71( - obj, - sel, - bytes, - maxLength, - aRange, - leftoverRange, - ); - } - - late final __objc_msgSend_71Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSRange, - NSRangePointer)>>('objc_msgSend'); - late final __objc_msgSend_71 = __objc_msgSend_71Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, NSRange, NSRangePointer)>(); - - late final ffi.Pointer _sel_writeToFile_atomically_1 = - _registerName1("writeToFile:atomically:"); - bool _objc_msgSend_72( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool useAuxiliaryFile, - ) { - return __objc_msgSend_72( - obj, - sel, - path, - useAuxiliaryFile ? 1 : 0, - ) != - 0; - } - - late final __objc_msgSend_72Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_72 = __objc_msgSend_72Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_writeToURL_atomically_1 = - _registerName1("writeToURL:atomically:"); - late final ffi.Pointer _sel_initWithContentsOfFile_1 = - _registerName1("initWithContentsOfFile:"); - late final ffi.Pointer _sel_initWithContentsOfURL_1 = - _registerName1("initWithContentsOfURL:"); - late final ffi.Pointer _sel_stringWithContentsOfFile_1 = - _registerName1("stringWithContentsOfFile:"); - late final ffi.Pointer _sel_stringWithContentsOfURL_1 = - _registerName1("stringWithContentsOfURL:"); - late final ffi.Pointer - _sel_initWithCStringNoCopy_length_freeWhenDone_1 = - _registerName1("initWithCStringNoCopy:length:freeWhenDone:"); - ffi.Pointer _objc_msgSend_73( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int length, - bool freeBuffer, - ) { - return __objc_msgSend_73( - obj, - sel, - bytes, - length, - freeBuffer ? 1 : 0, - ); - } - - late final __objc_msgSend_73Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_73 = __objc_msgSend_73Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, int)>(); - - late final ffi.Pointer _sel_initWithCString_length_1 = - _registerName1("initWithCString:length:"); - late final ffi.Pointer _sel_initWithCString_1 = - _registerName1("initWithCString:"); - late final ffi.Pointer _sel_stringWithCString_length_1 = - _registerName1("stringWithCString:length:"); - late final ffi.Pointer _sel_stringWithCString_1 = - _registerName1("stringWithCString:"); - late final ffi.Pointer _sel_getCharacters_1 = - _registerName1("getCharacters:"); - void _objc_msgSend_74( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - ) { - return __objc_msgSend_74( - obj, - sel, - buffer, - ); - } - - late final __objc_msgSend_74Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_74 = __objc_msgSend_74Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_75( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_75( - obj, - sel, - ); - } - - late final __objc_msgSend_75Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_75 = __objc_msgSend_75Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_debugDescription1 = - _registerName1("debugDescription"); - late final ffi.Pointer _sel_version1 = _registerName1("version"); - late final ffi.Pointer _sel_setVersion_1 = - _registerName1("setVersion:"); - void _objc_msgSend_76( - ffi.Pointer obj, - ffi.Pointer sel, - int aVersion, - ) { - return __objc_msgSend_76( - obj, - sel, - aVersion, - ); - } - - late final __objc_msgSend_76Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_76 = __objc_msgSend_76Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_classForCoder1 = - _registerName1("classForCoder"); - late final ffi.Pointer _sel_replacementObjectForCoder_1 = - _registerName1("replacementObjectForCoder:"); - late final ffi.Pointer _sel_awakeAfterUsingCoder_1 = - _registerName1("awakeAfterUsingCoder:"); - late final ffi.Pointer _sel_poseAsClass_1 = - _registerName1("poseAsClass:"); - late final ffi.Pointer _sel_autoContentAccessingProxy1 = - _registerName1("autoContentAccessingProxy"); - late final ffi.Pointer _class_NSValue1 = _getClass1("NSValue"); - late final ffi.Pointer _sel_getValue_size_1 = - _registerName1("getValue:size:"); - void _objc_msgSend_77( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - int size, - ) { - return __objc_msgSend_77( - obj, - sel, - value, - size, - ); - } - - late final __objc_msgSend_77Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_77 = __objc_msgSend_77Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_objCType1 = _registerName1("objCType"); - late final ffi.Pointer _sel_initWithBytes_objCType_1 = - _registerName1("initWithBytes:objCType:"); - instancetype _objc_msgSend_78( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ffi.Pointer type, - ) { - return __objc_msgSend_78( - obj, - sel, - value, - type, - ); - } - - late final __objc_msgSend_78Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_78 = __objc_msgSend_78Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_valueWithBytes_objCType_1 = - _registerName1("valueWithBytes:objCType:"); - ffi.Pointer _objc_msgSend_79( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ffi.Pointer type, - ) { - return __objc_msgSend_79( - obj, - sel, - value, - type, - ); - } - - late final __objc_msgSend_79Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_79 = __objc_msgSend_79Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_value_withObjCType_1 = - _registerName1("value:withObjCType:"); - late final ffi.Pointer _sel_valueWithNonretainedObject_1 = - _registerName1("valueWithNonretainedObject:"); - ffi.Pointer _objc_msgSend_80( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - ) { - return __objc_msgSend_80( - obj, - sel, - anObject, - ); - } - - late final __objc_msgSend_80Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_nonretainedObjectValue1 = - _registerName1("nonretainedObjectValue"); - late final ffi.Pointer _sel_valueWithPointer_1 = - _registerName1("valueWithPointer:"); - ffi.Pointer _objc_msgSend_81( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer pointer, - ) { - return __objc_msgSend_81( - obj, - sel, - pointer, - ); - } - - late final __objc_msgSend_81Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_81 = __objc_msgSend_81Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_pointerValue1 = - _registerName1("pointerValue"); - ffi.Pointer _objc_msgSend_82( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_82( - obj, - sel, - ); - } - - late final __objc_msgSend_82Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_82 = __objc_msgSend_82Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_isEqualToValue_1 = - _registerName1("isEqualToValue:"); - late final ffi.Pointer _sel_getValue_1 = _registerName1("getValue:"); - void _objc_msgSend_83( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_83( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_83Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_83 = __objc_msgSend_83Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_valueWithRange_1 = - _registerName1("valueWithRange:"); - ffi.Pointer _objc_msgSend_84( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_84( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_84Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_84 = __objc_msgSend_84Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, NSRange)>(); - - late final ffi.Pointer _sel_rangeValue1 = - _registerName1("rangeValue"); - NSRange _objc_msgSend_85( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_85( - obj, - sel, - ); - } - - late final __objc_msgSend_85Ptr = _lookup< - ffi.NativeFunction< - NSRange Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_85 = __objc_msgSend_85Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _class_NSNumber1 = _getClass1("NSNumber"); - late final ffi.Pointer _sel_initWithChar_1 = - _registerName1("initWithChar:"); - ffi.Pointer _objc_msgSend_86( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_86( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_86Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Char)>>('objc_msgSend'); - late final __objc_msgSend_86 = __objc_msgSend_86Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithUnsignedChar_1 = - _registerName1("initWithUnsignedChar:"); - ffi.Pointer _objc_msgSend_87( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_87( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_87Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedChar)>>('objc_msgSend'); - late final __objc_msgSend_87 = __objc_msgSend_87Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithShort_1 = - _registerName1("initWithShort:"); - ffi.Pointer _objc_msgSend_88( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_88( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_88Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Short)>>('objc_msgSend'); - late final __objc_msgSend_88 = __objc_msgSend_88Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithUnsignedShort_1 = - _registerName1("initWithUnsignedShort:"); - ffi.Pointer _objc_msgSend_89( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_89( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_89Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedShort)>>('objc_msgSend'); - late final __objc_msgSend_89 = __objc_msgSend_89Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithInt_1 = - _registerName1("initWithInt:"); - ffi.Pointer _objc_msgSend_90( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_90( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_90Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Int)>>('objc_msgSend'); - late final __objc_msgSend_90 = __objc_msgSend_90Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithUnsignedInt_1 = - _registerName1("initWithUnsignedInt:"); - ffi.Pointer _objc_msgSend_91( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_91( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_91Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_91 = __objc_msgSend_91Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithLong_1 = - _registerName1("initWithLong:"); - ffi.Pointer _objc_msgSend_92( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_92( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_92Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Long)>>('objc_msgSend'); - late final __objc_msgSend_92 = __objc_msgSend_92Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithUnsignedLong_1 = - _registerName1("initWithUnsignedLong:"); - ffi.Pointer _objc_msgSend_93( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_93( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_93Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_93 = __objc_msgSend_93Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithLongLong_1 = - _registerName1("initWithLongLong:"); - ffi.Pointer _objc_msgSend_94( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_94( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_94Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.LongLong)>>('objc_msgSend'); - late final __objc_msgSend_94 = __objc_msgSend_94Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithUnsignedLongLong_1 = - _registerName1("initWithUnsignedLongLong:"); - ffi.Pointer _objc_msgSend_95( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_95( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_95Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.UnsignedLongLong)>>('objc_msgSend'); - late final __objc_msgSend_95 = __objc_msgSend_95Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithFloat_1 = - _registerName1("initWithFloat:"); - ffi.Pointer _objc_msgSend_96( - ffi.Pointer obj, - ffi.Pointer sel, - double value, - ) { - return __objc_msgSend_96( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_96Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Float)>>('objc_msgSend'); - late final __objc_msgSend_96 = __objc_msgSend_96Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); - - late final ffi.Pointer _sel_initWithDouble_1 = - _registerName1("initWithDouble:"); - ffi.Pointer _objc_msgSend_97( - ffi.Pointer obj, - ffi.Pointer sel, - double value, - ) { - return __objc_msgSend_97( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_97Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_97 = __objc_msgSend_97Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); - - late final ffi.Pointer _sel_initWithBool_1 = - _registerName1("initWithBool:"); - ffi.Pointer _objc_msgSend_98( - ffi.Pointer obj, - ffi.Pointer sel, - bool value, - ) { - return __objc_msgSend_98( - obj, - sel, - value ? 1 : 0, - ); - } - - late final __objc_msgSend_98Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_98 = __objc_msgSend_98Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_initWithInteger_1 = - _registerName1("initWithInteger:"); - late final ffi.Pointer _sel_initWithUnsignedInteger_1 = - _registerName1("initWithUnsignedInteger:"); - late final ffi.Pointer _sel_charValue1 = _registerName1("charValue"); - int _objc_msgSend_99( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_99( - obj, - sel, - ); - } - - late final __objc_msgSend_99Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.Char Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_99 = __objc_msgSend_99Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_unsignedCharValue1 = - _registerName1("unsignedCharValue"); - int _objc_msgSend_100( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_100( - obj, - sel, - ); - } - - late final __objc_msgSend_100Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.UnsignedChar Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_100 = __objc_msgSend_100Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_shortValue1 = - _registerName1("shortValue"); - int _objc_msgSend_101( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_101( - obj, - sel, - ); - } - - late final __objc_msgSend_101Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.Short Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_101 = __objc_msgSend_101Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_unsignedShortValue1 = - _registerName1("unsignedShortValue"); - int _objc_msgSend_102( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_102( - obj, - sel, - ); - } - - late final __objc_msgSend_102Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.UnsignedShort Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_102 = __objc_msgSend_102Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_unsignedIntValue1 = - _registerName1("unsignedIntValue"); - int _objc_msgSend_103( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_103( - obj, - sel, - ); - } - - late final __objc_msgSend_103Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.UnsignedInt Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_103 = __objc_msgSend_103Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_longValue1 = _registerName1("longValue"); - late final ffi.Pointer _sel_unsignedLongValue1 = - _registerName1("unsignedLongValue"); - late final ffi.Pointer _sel_unsignedLongLongValue1 = - _registerName1("unsignedLongLongValue"); - int _objc_msgSend_104( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_104( - obj, - sel, - ); - } - - late final __objc_msgSend_104Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.UnsignedLongLong Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_104 = __objc_msgSend_104Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_unsignedIntegerValue1 = - _registerName1("unsignedIntegerValue"); - late final ffi.Pointer _sel_stringValue1 = - _registerName1("stringValue"); - late final ffi.Pointer _sel_isEqualToNumber_1 = - _registerName1("isEqualToNumber:"); - late final ffi.Pointer _sel_descriptionWithLocale_1 = - _registerName1("descriptionWithLocale:"); - late final ffi.Pointer _sel_numberWithChar_1 = - _registerName1("numberWithChar:"); - late final ffi.Pointer _sel_numberWithUnsignedChar_1 = - _registerName1("numberWithUnsignedChar:"); - late final ffi.Pointer _sel_numberWithShort_1 = - _registerName1("numberWithShort:"); - late final ffi.Pointer _sel_numberWithUnsignedShort_1 = - _registerName1("numberWithUnsignedShort:"); - late final ffi.Pointer _sel_numberWithInt_1 = - _registerName1("numberWithInt:"); - late final ffi.Pointer _sel_numberWithUnsignedInt_1 = - _registerName1("numberWithUnsignedInt:"); - late final ffi.Pointer _sel_numberWithLong_1 = - _registerName1("numberWithLong:"); - late final ffi.Pointer _sel_numberWithUnsignedLong_1 = - _registerName1("numberWithUnsignedLong:"); - late final ffi.Pointer _sel_numberWithLongLong_1 = - _registerName1("numberWithLongLong:"); - late final ffi.Pointer _sel_numberWithUnsignedLongLong_1 = - _registerName1("numberWithUnsignedLongLong:"); - late final ffi.Pointer _sel_numberWithFloat_1 = - _registerName1("numberWithFloat:"); - late final ffi.Pointer _sel_numberWithDouble_1 = - _registerName1("numberWithDouble:"); - late final ffi.Pointer _sel_numberWithBool_1 = - _registerName1("numberWithBool:"); - late final ffi.Pointer _sel_numberWithInteger_1 = - _registerName1("numberWithInteger:"); - late final ffi.Pointer _sel_numberWithUnsignedInteger_1 = - _registerName1("numberWithUnsignedInteger:"); - late final ffi.Pointer _class_NSEnumerator1 = - _getClass1("NSEnumerator"); - late final ffi.Pointer _sel_nextObject1 = - _registerName1("nextObject"); - late final ffi.Pointer _sel_allObjects1 = - _registerName1("allObjects"); - late final ffi.Pointer _class_NSOrderedCollectionChange1 = - _getClass1("NSOrderedCollectionChange"); - late final ffi.Pointer _sel_object1 = _registerName1("object"); - late final ffi.Pointer _sel_changeType1 = - _registerName1("changeType"); - int _objc_msgSend_105( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_105( - obj, - sel, - ); - } - - late final __objc_msgSend_105Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_105 = __objc_msgSend_105Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_index1 = _registerName1("index"); - late final ffi.Pointer _sel_associatedIndex1 = - _registerName1("associatedIndex"); - late final ffi.Pointer _sel_initWithObject_type_index_1 = - _registerName1("initWithObject:type:index:"); - instancetype _objc_msgSend_106( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - int type, - int index, - ) { - return __objc_msgSend_106( - obj, - sel, - anObject, - type, - index, - ); - } - - late final __objc_msgSend_106Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_106 = __objc_msgSend_106Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int)>(); - - late final ffi.Pointer - _sel_initWithObject_type_index_associatedIndex_1 = - _registerName1("initWithObject:type:index:associatedIndex:"); - instancetype _objc_msgSend_107( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - int type, - int index, - int associatedIndex, - ) { - return __objc_msgSend_107( - obj, - sel, - anObject, - type, - index, - associatedIndex, - ); - } - - late final __objc_msgSend_107Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - NSUInteger, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_107 = __objc_msgSend_107Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, int)>(); - - late final ffi.Pointer _class_NSIndexSet1 = - _getClass1("NSIndexSet"); - late final ffi.Pointer _sel_indexSet1 = _registerName1("indexSet"); - late final ffi.Pointer _sel_indexSetWithIndex_1 = - _registerName1("indexSetWithIndex:"); - instancetype _objc_msgSend_108( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_108( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_108Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_108 = __objc_msgSend_108Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_indexSetWithIndexesInRange_1 = - _registerName1("indexSetWithIndexesInRange:"); - instancetype _objc_msgSend_109( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_109( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_109Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_109 = __objc_msgSend_109Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, NSRange)>(); - - late final ffi.Pointer _sel_initWithIndexesInRange_1 = - _registerName1("initWithIndexesInRange:"); - late final ffi.Pointer _sel_initWithIndexSet_1 = - _registerName1("initWithIndexSet:"); - late final ffi.Pointer _sel_initWithIndex_1 = - _registerName1("initWithIndex:"); - late final ffi.Pointer _sel_isEqualToIndexSet_1 = - _registerName1("isEqualToIndexSet:"); - late final ffi.Pointer _sel_count1 = _registerName1("count"); - late final ffi.Pointer _sel_firstIndex1 = - _registerName1("firstIndex"); - late final ffi.Pointer _sel_lastIndex1 = _registerName1("lastIndex"); - late final ffi.Pointer _sel_indexGreaterThanIndex_1 = - _registerName1("indexGreaterThanIndex:"); - late final ffi.Pointer _sel_indexLessThanIndex_1 = - _registerName1("indexLessThanIndex:"); - late final ffi.Pointer _sel_indexGreaterThanOrEqualToIndex_1 = - _registerName1("indexGreaterThanOrEqualToIndex:"); - late final ffi.Pointer _sel_indexLessThanOrEqualToIndex_1 = - _registerName1("indexLessThanOrEqualToIndex:"); - late final ffi.Pointer _sel_getIndexes_maxCount_inIndexRange_1 = - _registerName1("getIndexes:maxCount:inIndexRange:"); - int _objc_msgSend_110( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexBuffer, - int bufferSize, - NSRangePointer range, - ) { - return __objc_msgSend_110( - obj, - sel, - indexBuffer, - bufferSize, - range, - ); - } - - late final __objc_msgSend_110Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSRangePointer)>>('objc_msgSend'); - late final __objc_msgSend_110 = __objc_msgSend_110Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, NSRangePointer)>(); - - late final ffi.Pointer _sel_countOfIndexesInRange_1 = - _registerName1("countOfIndexesInRange:"); - int _objc_msgSend_111( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_111( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_111Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_111 = __objc_msgSend_111Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); - - late final ffi.Pointer _sel_containsIndex_1 = - _registerName1("containsIndex:"); - late final ffi.Pointer _sel_containsIndexesInRange_1 = - _registerName1("containsIndexesInRange:"); - bool _objc_msgSend_112( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_112( - obj, - sel, - range, - ) != - 0; - } - - late final __objc_msgSend_112Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_112 = __objc_msgSend_112Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); - - late final ffi.Pointer _sel_containsIndexes_1 = - _registerName1("containsIndexes:"); - late final ffi.Pointer _sel_intersectsIndexesInRange_1 = - _registerName1("intersectsIndexesInRange:"); - late final ffi.Pointer _sel_enumerateIndexesUsingBlock_1 = - _registerName1("enumerateIndexesUsingBlock:"); - void _objc_msgSend_113( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_113( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_113Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_113 = __objc_msgSend_113Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_enumerateIndexesWithOptions_usingBlock_1 = - _registerName1("enumerateIndexesWithOptions:usingBlock:"); - void _objc_msgSend_114( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_114( - obj, - sel, - opts, - block, - ); - } - - late final __objc_msgSend_114Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_114 = __objc_msgSend_114Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_enumerateIndexesInRange_options_usingBlock_1 = - _registerName1("enumerateIndexesInRange:options:usingBlock:"); - void _objc_msgSend_115( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_115( - obj, - sel, - range, - opts, - block, - ); - } - - late final __objc_msgSend_115Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_115 = __objc_msgSend_115Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_indexPassingTest_1 = - _registerName1("indexPassingTest:"); - int _objc_msgSend_116( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_116( - obj, - sel, - predicate, - ); - } - - late final __objc_msgSend_116Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_116 = __objc_msgSend_116Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_indexWithOptions_passingTest_1 = - _registerName1("indexWithOptions:passingTest:"); - int _objc_msgSend_117( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_117( - obj, - sel, - opts, - predicate, - ); - } - - late final __objc_msgSend_117Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_117 = __objc_msgSend_117Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_indexInRange_options_passingTest_1 = - _registerName1("indexInRange:options:passingTest:"); - int _objc_msgSend_118( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_118( - obj, - sel, - range, - opts, - predicate, - ); - } - - late final __objc_msgSend_118Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_118 = __objc_msgSend_118Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_indexesPassingTest_1 = - _registerName1("indexesPassingTest:"); - ffi.Pointer _objc_msgSend_119( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_119( - obj, - sel, - predicate, - ); - } - - late final __objc_msgSend_119Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_119 = __objc_msgSend_119Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_indexesWithOptions_passingTest_1 = - _registerName1("indexesWithOptions:passingTest:"); - ffi.Pointer _objc_msgSend_120( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_120( - obj, - sel, - opts, - predicate, - ); - } - - late final __objc_msgSend_120Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_120 = __objc_msgSend_120Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_indexesInRange_options_passingTest_1 = - _registerName1("indexesInRange:options:passingTest:"); - ffi.Pointer _objc_msgSend_121( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_121( - obj, - sel, - range, - opts, - predicate, - ); - } - - late final __objc_msgSend_121Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSRange, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_121 = __objc_msgSend_121Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSRange, int, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_enumerateRangesUsingBlock_1 = - _registerName1("enumerateRangesUsingBlock:"); - void _objc_msgSend_122( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_122( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_122Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_122 = __objc_msgSend_122Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_enumerateRangesWithOptions_usingBlock_1 = - _registerName1("enumerateRangesWithOptions:usingBlock:"); - void _objc_msgSend_123( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_123( - obj, - sel, - opts, - block, - ); - } - - late final __objc_msgSend_123Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_123 = __objc_msgSend_123Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_enumerateRangesInRange_options_usingBlock_1 = - _registerName1("enumerateRangesInRange:options:usingBlock:"); - void _objc_msgSend_124( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_124( - obj, - sel, - range, - opts, - block, - ); - } - - late final __objc_msgSend_124Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_124 = __objc_msgSend_124Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _class_NSMutableIndexSet1 = - _getClass1("NSMutableIndexSet"); - late final ffi.Pointer _sel_addIndexes_1 = - _registerName1("addIndexes:"); - late final ffi.Pointer _sel_removeIndexes_1 = - _registerName1("removeIndexes:"); - late final ffi.Pointer _sel_removeAllIndexes1 = - _registerName1("removeAllIndexes"); - late final ffi.Pointer _sel_addIndex_1 = _registerName1("addIndex:"); - late final ffi.Pointer _sel_removeIndex_1 = - _registerName1("removeIndex:"); - late final ffi.Pointer _sel_addIndexesInRange_1 = - _registerName1("addIndexesInRange:"); - void _objc_msgSend_125( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_125( - obj, - sel, - range, - ); - } - - late final __objc_msgSend_125Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_125 = __objc_msgSend_125Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange)>(); - - late final ffi.Pointer _sel_removeIndexesInRange_1 = - _registerName1("removeIndexesInRange:"); - late final ffi.Pointer _sel_shiftIndexesStartingAtIndex_by_1 = - _registerName1("shiftIndexesStartingAtIndex:by:"); - void _objc_msgSend_126( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - int delta, - ) { - return __objc_msgSend_126( - obj, - sel, - index, - delta, - ); - } - - late final __objc_msgSend_126Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSUInteger, NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_126 = __objc_msgSend_126Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, int)>(); - - late final ffi.Pointer _class_NSOrderedCollectionDifference1 = - _getClass1("NSOrderedCollectionDifference"); - late final ffi.Pointer _sel_initWithChanges_1 = - _registerName1("initWithChanges:"); - late final ffi.Pointer - _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges_1 = - _registerName1( - "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:additionalChanges:"); - instancetype _objc_msgSend_127( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer inserts, - ffi.Pointer insertedObjects, - ffi.Pointer removes, - ffi.Pointer removedObjects, - ffi.Pointer changes, - ) { - return __objc_msgSend_127( - obj, - sel, - inserts, - insertedObjects, - removes, - removedObjects, - changes, - ); - } - - late final __objc_msgSend_127Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_127 = __objc_msgSend_127Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer - _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_1 = - _registerName1( - "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:"); - instancetype _objc_msgSend_128( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer inserts, - ffi.Pointer insertedObjects, - ffi.Pointer removes, - ffi.Pointer removedObjects, - ) { - return __objc_msgSend_128( - obj, - sel, - inserts, - insertedObjects, - removes, - removedObjects, - ); - } - - late final __objc_msgSend_128Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_128 = __objc_msgSend_128Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_insertions1 = - _registerName1("insertions"); - late final ffi.Pointer _sel_removals1 = _registerName1("removals"); - late final ffi.Pointer _sel_hasChanges1 = - _registerName1("hasChanges"); - late final ffi.Pointer _sel_inverseDifference1 = - _registerName1("inverseDifference"); - late final ffi.Pointer _class_NSArray1 = _getClass1("NSArray"); - late final ffi.Pointer _sel_objectAtIndex_1 = - _registerName1("objectAtIndex:"); - late final ffi.Pointer _sel_initWithObjects_count_1 = - _registerName1("initWithObjects:count:"); - instancetype _objc_msgSend_129( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> objects, - int cnt, - ) { - return __objc_msgSend_129( - obj, - sel, - objects, - cnt, - ); - } - - late final __objc_msgSend_129Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_129 = __objc_msgSend_129Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>, int)>(); - - late final ffi.Pointer _sel_componentsJoinedByString_1 = - _registerName1("componentsJoinedByString:"); - late final ffi.Pointer _sel_containsObject_1 = - _registerName1("containsObject:"); - late final ffi.Pointer _sel_descriptionWithLocale_indent_1 = - _registerName1("descriptionWithLocale:indent:"); - ffi.Pointer _objc_msgSend_130( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer locale, - int level, - ) { - return __objc_msgSend_130( - obj, - sel, - locale, - level, - ); - } - - late final __objc_msgSend_130Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_130 = __objc_msgSend_130Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_firstObjectCommonWithArray_1 = - _registerName1("firstObjectCommonWithArray:"); - late final ffi.Pointer _sel_getObjects_range_1 = - _registerName1("getObjects:range:"); - void _objc_msgSend_131( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> objects, - NSRange range, - ) { - return __objc_msgSend_131( - obj, - sel, - objects, - range, - ); - } - - late final __objc_msgSend_131Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_131 = __objc_msgSend_131Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>, NSRange)>(); - - late final ffi.Pointer _sel_indexOfObject_1 = - _registerName1("indexOfObject:"); - int _objc_msgSend_132( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - ) { - return __objc_msgSend_132( - obj, - sel, - anObject, - ); - } - - late final __objc_msgSend_132Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_132 = __objc_msgSend_132Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_indexOfObject_inRange_1 = - _registerName1("indexOfObject:inRange:"); - int _objc_msgSend_133( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - NSRange range, - ) { - return __objc_msgSend_133( - obj, - sel, - anObject, - range, - ); - } - - late final __objc_msgSend_133Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_133 = __objc_msgSend_133Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRange)>(); - - late final ffi.Pointer _sel_indexOfObjectIdenticalTo_1 = - _registerName1("indexOfObjectIdenticalTo:"); - late final ffi.Pointer _sel_indexOfObjectIdenticalTo_inRange_1 = - _registerName1("indexOfObjectIdenticalTo:inRange:"); - late final ffi.Pointer _sel_isEqualToArray_1 = - _registerName1("isEqualToArray:"); - late final ffi.Pointer _sel_firstObject1 = - _registerName1("firstObject"); - late final ffi.Pointer _sel_lastObject1 = - _registerName1("lastObject"); - late final ffi.Pointer _sel_sortedArrayHint1 = - _registerName1("sortedArrayHint"); - late final ffi.Pointer _sel_writeToURL_error_1 = - _registerName1("writeToURL:error:"); - bool _objc_msgSend_134( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer> error, - ) { - return __objc_msgSend_134( - obj, - sel, - url, - error, - ) != - 0; - } - - late final __objc_msgSend_134Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_134 = __objc_msgSend_134Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer>)>(); - - late final ffi.Pointer _sel_makeObjectsPerformSelector_1 = - _registerName1("makeObjectsPerformSelector:"); - late final ffi.Pointer _sel_makeObjectsPerformSelector_withObject_1 = - _registerName1("makeObjectsPerformSelector:withObject:"); - void _objc_msgSend_135( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ffi.Pointer argument, - ) { - return __objc_msgSend_135( - obj, - sel, - aSelector, - argument, - ); - } - - late final __objc_msgSend_135Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_135 = __objc_msgSend_135Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_objectAtIndexedSubscript_1 = - _registerName1("objectAtIndexedSubscript:"); - late final ffi.Pointer _sel_enumerateObjectsUsingBlock_1 = - _registerName1("enumerateObjectsUsingBlock:"); - void _objc_msgSend_136( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_136( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_136Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_136 = __objc_msgSend_136Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_enumerateObjectsWithOptions_usingBlock_1 = - _registerName1("enumerateObjectsWithOptions:usingBlock:"); - void _objc_msgSend_137( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_137( - obj, - sel, - opts, - block, - ); - } - - late final __objc_msgSend_137Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_137 = __objc_msgSend_137Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_enumerateObjectsAtIndexes_options_usingBlock_1 = - _registerName1("enumerateObjectsAtIndexes:options:usingBlock:"); - void _objc_msgSend_138( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer s, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_138( - obj, - sel, - s, - opts, - block, - ); - } - - late final __objc_msgSend_138Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_138 = __objc_msgSend_138Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_indexOfObjectPassingTest_1 = - _registerName1("indexOfObjectPassingTest:"); - int _objc_msgSend_139( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_139( - obj, - sel, - predicate, - ); - } - - late final __objc_msgSend_139Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_139 = __objc_msgSend_139Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_indexOfObjectWithOptions_passingTest_1 = - _registerName1("indexOfObjectWithOptions:passingTest:"); - int _objc_msgSend_140( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_140( - obj, - sel, - opts, - predicate, - ); - } - - late final __objc_msgSend_140Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_140 = __objc_msgSend_140Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_indexOfObjectAtIndexes_options_passingTest_1 = - _registerName1("indexOfObjectAtIndexes:options:passingTest:"); - int _objc_msgSend_141( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer s, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_141( - obj, - sel, - s, - opts, - predicate, - ); - } - - late final __objc_msgSend_141Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_141 = __objc_msgSend_141Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_indexesOfObjectsPassingTest_1 = - _registerName1("indexesOfObjectsPassingTest:"); - ffi.Pointer _objc_msgSend_142( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_142( - obj, - sel, - predicate, - ); - } - - late final __objc_msgSend_142Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_142 = __objc_msgSend_142Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_indexesOfObjectsWithOptions_passingTest_1 = - _registerName1("indexesOfObjectsWithOptions:passingTest:"); - ffi.Pointer _objc_msgSend_143( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_143( - obj, - sel, - opts, - predicate, - ); - } - - late final __objc_msgSend_143Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_143 = __objc_msgSend_143Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_indexesOfObjectsAtIndexes_options_passingTest_1 = - _registerName1("indexesOfObjectsAtIndexes:options:passingTest:"); - ffi.Pointer _objc_msgSend_144( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer s, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_144( - obj, - sel, - s, - opts, - predicate, - ); - } - - late final __objc_msgSend_144Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_144 = __objc_msgSend_144Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_indexOfObject_inSortedRange_options_usingComparator_1 = - _registerName1("indexOfObject:inSortedRange:options:usingComparator:"); - int _objc_msgSend_145( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer obj1, - NSRange r, - int opts, - NSComparator cmp, - ) { - return __objc_msgSend_145( - obj, - sel, - obj1, - r, - opts, - cmp, - ); - } - - late final __objc_msgSend_145Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSRange, - ffi.Int32, - NSComparator)>>('objc_msgSend'); - late final __objc_msgSend_145 = __objc_msgSend_145Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRange, int, NSComparator)>(); - - late final ffi.Pointer _sel_array1 = _registerName1("array"); - late final ffi.Pointer _sel_arrayWithObject_1 = - _registerName1("arrayWithObject:"); - late final ffi.Pointer _sel_arrayWithObjects_count_1 = - _registerName1("arrayWithObjects:count:"); - late final ffi.Pointer _sel_arrayWithObjects_1 = - _registerName1("arrayWithObjects:"); - late final ffi.Pointer _sel_arrayWithArray_1 = - _registerName1("arrayWithArray:"); - late final ffi.Pointer _sel_initWithObjects_1 = - _registerName1("initWithObjects:"); - late final ffi.Pointer _sel_initWithArray_1 = - _registerName1("initWithArray:"); - late final ffi.Pointer _sel_initWithArray_copyItems_1 = - _registerName1("initWithArray:copyItems:"); - instancetype _objc_msgSend_146( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer array, - bool flag, - ) { - return __objc_msgSend_146( - obj, - sel, - array, - flag ? 1 : 0, - ); - } - - late final __objc_msgSend_146Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_146 = __objc_msgSend_146Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_getObjects_1 = - _registerName1("getObjects:"); - void _objc_msgSend_147( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> objects, - ) { - return __objc_msgSend_147( - obj, - sel, - objects, - ); - } - - late final __objc_msgSend_147Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_147 = __objc_msgSend_147Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>(); - - late final ffi.Pointer _class_NSMutableArray1 = - _getClass1("NSMutableArray"); - late final ffi.Pointer _sel_addObject_1 = - _registerName1("addObject:"); - late final ffi.Pointer _sel_insertObject_atIndex_1 = - _registerName1("insertObject:atIndex:"); - void _objc_msgSend_148( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - int index, - ) { - return __objc_msgSend_148( - obj, - sel, - anObject, - index, - ); - } - - late final __objc_msgSend_148Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_148 = __objc_msgSend_148Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_removeLastObject1 = - _registerName1("removeLastObject"); - late final ffi.Pointer _sel_removeObjectAtIndex_1 = - _registerName1("removeObjectAtIndex:"); - late final ffi.Pointer _sel_replaceObjectAtIndex_withObject_1 = - _registerName1("replaceObjectAtIndex:withObject:"); - void _objc_msgSend_149( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ffi.Pointer anObject, - ) { - return __objc_msgSend_149( - obj, - sel, - index, - anObject, - ); - } - - late final __objc_msgSend_149Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSUInteger, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_149 = __objc_msgSend_149Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_initWithCapacity_1 = - _registerName1("initWithCapacity:"); - late final ffi.Pointer _sel_addObjectsFromArray_1 = - _registerName1("addObjectsFromArray:"); - late final ffi.Pointer - _sel_exchangeObjectAtIndex_withObjectAtIndex_1 = - _registerName1("exchangeObjectAtIndex:withObjectAtIndex:"); - void _objc_msgSend_150( - ffi.Pointer obj, - ffi.Pointer sel, - int idx1, - int idx2, - ) { - return __objc_msgSend_150( - obj, - sel, - idx1, - idx2, - ); - } - - late final __objc_msgSend_150Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSUInteger, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_150 = __objc_msgSend_150Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, int)>(); - - late final ffi.Pointer _sel_removeAllObjects1 = - _registerName1("removeAllObjects"); - late final ffi.Pointer _sel_removeObject_inRange_1 = - _registerName1("removeObject:inRange:"); - void _objc_msgSend_151( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - NSRange range, - ) { - return __objc_msgSend_151( - obj, - sel, - anObject, - range, - ); - } - - late final __objc_msgSend_151Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_151 = __objc_msgSend_151Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRange)>(); - - late final ffi.Pointer _sel_removeObject_1 = - _registerName1("removeObject:"); - late final ffi.Pointer _sel_removeObjectIdenticalTo_inRange_1 = - _registerName1("removeObjectIdenticalTo:inRange:"); - late final ffi.Pointer _sel_removeObjectIdenticalTo_1 = - _registerName1("removeObjectIdenticalTo:"); - late final ffi.Pointer _sel_removeObjectsFromIndices_numIndices_1 = - _registerName1("removeObjectsFromIndices:numIndices:"); - void _objc_msgSend_152( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indices, - int cnt, - ) { - return __objc_msgSend_152( - obj, - sel, - indices, - cnt, - ); - } - - late final __objc_msgSend_152Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_152 = __objc_msgSend_152Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_removeObjectsInArray_1 = - _registerName1("removeObjectsInArray:"); - late final ffi.Pointer _sel_removeObjectsInRange_1 = - _registerName1("removeObjectsInRange:"); - late final ffi.Pointer - _sel_replaceObjectsInRange_withObjectsFromArray_range_1 = - _registerName1("replaceObjectsInRange:withObjectsFromArray:range:"); - void _objc_msgSend_153( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ffi.Pointer otherArray, - NSRange otherRange, - ) { - return __objc_msgSend_153( - obj, - sel, - range, - otherArray, - otherRange, - ); - } - - late final __objc_msgSend_153Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_153 = __objc_msgSend_153Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, - ffi.Pointer, NSRange)>(); - - late final ffi.Pointer - _sel_replaceObjectsInRange_withObjectsFromArray_1 = - _registerName1("replaceObjectsInRange:withObjectsFromArray:"); - void _objc_msgSend_154( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ffi.Pointer otherArray, - ) { - return __objc_msgSend_154( - obj, - sel, - range, - otherArray, - ); - } - - late final __objc_msgSend_154Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_154 = __objc_msgSend_154Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_setArray_1 = _registerName1("setArray:"); - late final ffi.Pointer _sel_sortUsingFunction_context_1 = - _registerName1("sortUsingFunction:context:"); - void _objc_msgSend_155( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>> - compare, - ffi.Pointer context, - ) { - return __objc_msgSend_155( - obj, - sel, - compare, - context, - ); - } - - late final __objc_msgSend_155Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_155 = __objc_msgSend_155Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>, - ffi.Pointer)>(); - - late final ffi.Pointer _sel_sortUsingSelector_1 = - _registerName1("sortUsingSelector:"); - late final ffi.Pointer _sel_insertObjects_atIndexes_1 = - _registerName1("insertObjects:atIndexes:"); - void _objc_msgSend_156( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer objects, - ffi.Pointer indexes, - ) { - return __objc_msgSend_156( - obj, - sel, - objects, - indexes, - ); - } - - late final __objc_msgSend_156Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_156 = __objc_msgSend_156Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_removeObjectsAtIndexes_1 = - _registerName1("removeObjectsAtIndexes:"); - late final ffi.Pointer _sel_replaceObjectsAtIndexes_withObjects_1 = - _registerName1("replaceObjectsAtIndexes:withObjects:"); - late final ffi.Pointer _sel_setObject_atIndexedSubscript_1 = - _registerName1("setObject:atIndexedSubscript:"); - late final ffi.Pointer _sel_sortUsingComparator_1 = - _registerName1("sortUsingComparator:"); - void _objc_msgSend_157( - ffi.Pointer obj, - ffi.Pointer sel, - NSComparator cmptr, - ) { - return __objc_msgSend_157( - obj, - sel, - cmptr, - ); - } - - late final __objc_msgSend_157Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSComparator)>>('objc_msgSend'); - late final __objc_msgSend_157 = __objc_msgSend_157Ptr.asFunction< - void Function( - ffi.Pointer, ffi.Pointer, NSComparator)>(); - - late final ffi.Pointer _sel_sortWithOptions_usingComparator_1 = - _registerName1("sortWithOptions:usingComparator:"); - void _objc_msgSend_158( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - NSComparator cmptr, - ) { - return __objc_msgSend_158( - obj, - sel, - opts, - cmptr, - ); - } - - late final __objc_msgSend_158Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, NSComparator)>>('objc_msgSend'); - late final __objc_msgSend_158 = __objc_msgSend_158Ptr.asFunction< - void Function( - ffi.Pointer, ffi.Pointer, int, NSComparator)>(); - - late final ffi.Pointer _sel_arrayWithCapacity_1 = - _registerName1("arrayWithCapacity:"); - late final ffi.Pointer _sel_applyDifference_1 = - _registerName1("applyDifference:"); - late final ffi.Pointer _class_NSItemProvider1 = - _getClass1("NSItemProvider"); - late final ffi.Pointer - _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1 = - _registerName1( - "registerDataRepresentationForTypeIdentifier:visibility:loadHandler:"); - void _objc_msgSend_159( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - int visibility, - ffi.Pointer<_ObjCBlock> loadHandler, - ) { - return __objc_msgSend_159( - obj, - sel, - typeIdentifier, - visibility, - loadHandler, - ); - } - - late final __objc_msgSend_159Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_159 = __objc_msgSend_159Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1 = - _registerName1( - "registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:"); - void _objc_msgSend_160( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - int fileOptions, - int visibility, - ffi.Pointer<_ObjCBlock> loadHandler, - ) { - return __objc_msgSend_160( - obj, - sel, - typeIdentifier, - fileOptions, - visibility, - loadHandler, - ); - } - - late final __objc_msgSend_160Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_160 = __objc_msgSend_160Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_registeredTypeIdentifiers1 = - _registerName1("registeredTypeIdentifiers"); - late final ffi.Pointer _sel_hasItemConformingToTypeIdentifier_1 = - _registerName1("hasItemConformingToTypeIdentifier:"); - late final ffi.Pointer - _sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1 = - _registerName1( - "hasRepresentationConformingToTypeIdentifier:fileOptions:"); - bool _objc_msgSend_161( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - int fileOptions, - ) { - return __objc_msgSend_161( - obj, - sel, - typeIdentifier, - fileOptions, - ) != - 0; - } - - late final __objc_msgSend_161Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_161 = __objc_msgSend_161Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _class_NSProgress1 = - _getClass1("NSProgress"); - late final ffi.Pointer - _sel_loadDataRepresentationForTypeIdentifier_completionHandler_1 = - _registerName1( - "loadDataRepresentationForTypeIdentifier:completionHandler:"); - ffi.Pointer _objc_msgSend_162( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_162( - obj, - sel, - typeIdentifier, - completionHandler, - ); - } - - late final __objc_msgSend_162Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_162 = __objc_msgSend_162Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _sel_loadFileRepresentationForTypeIdentifier_completionHandler_1 = - _registerName1( - "loadFileRepresentationForTypeIdentifier:completionHandler:"); - late final ffi.Pointer - _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1 = - _registerName1( - "loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:"); - ffi.Pointer _objc_msgSend_163( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_163( - obj, - sel, - typeIdentifier, - completionHandler, - ); - } - - late final __objc_msgSend_163Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_163 = __objc_msgSend_163Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _sel_suggestedName1 = - _registerName1("suggestedName"); - late final ffi.Pointer _sel_setSuggestedName_1 = - _registerName1("setSuggestedName:"); - late final ffi.Pointer _sel_initWithObject_1 = - _registerName1("initWithObject:"); - late final ffi.Pointer _sel_registerObject_visibility_1 = - _registerName1("registerObject:visibility:"); - void _objc_msgSend_164( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer object, - int visibility, - ) { - return __objc_msgSend_164( - obj, - sel, - object, - visibility, - ); - } - - late final __objc_msgSend_164Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_164 = __objc_msgSend_164Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer - _sel_registerObjectOfClass_visibility_loadHandler_1 = - _registerName1("registerObjectOfClass:visibility:loadHandler:"); - late final ffi.Pointer _sel_canLoadObjectOfClass_1 = - _registerName1("canLoadObjectOfClass:"); - late final ffi.Pointer _sel_loadObjectOfClass_completionHandler_1 = - _registerName1("loadObjectOfClass:completionHandler:"); - late final ffi.Pointer _sel_initWithItem_typeIdentifier_1 = - _registerName1("initWithItem:typeIdentifier:"); - late final ffi.Pointer - _sel_registerItemForTypeIdentifier_loadHandler_1 = - _registerName1("registerItemForTypeIdentifier:loadHandler:"); - void _objc_msgSend_165( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - NSItemProviderLoadHandler loadHandler, - ) { - return __objc_msgSend_165( - obj, - sel, - typeIdentifier, - loadHandler, - ); - } - - late final __objc_msgSend_165Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSItemProviderLoadHandler)>>('objc_msgSend'); - late final __objc_msgSend_165 = __objc_msgSend_165Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSItemProviderLoadHandler)>(); - - late final ffi.Pointer - _sel_loadItemForTypeIdentifier_options_completionHandler_1 = - _registerName1("loadItemForTypeIdentifier:options:completionHandler:"); - void _objc_msgSend_166( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer options, - NSItemProviderCompletionHandler completionHandler, - ) { - return __objc_msgSend_166( - obj, - sel, - typeIdentifier, - options, - completionHandler, - ); - } - - late final __objc_msgSend_166Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSItemProviderCompletionHandler)>>('objc_msgSend'); - late final __objc_msgSend_166 = __objc_msgSend_166Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSItemProviderCompletionHandler)>(); - - late final ffi.Pointer _sel_previewImageHandler1 = - _registerName1("previewImageHandler"); - NSItemProviderLoadHandler _objc_msgSend_167( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_167( - obj, - sel, - ); - } - - late final __objc_msgSend_167Ptr = _lookup< - ffi.NativeFunction< - NSItemProviderLoadHandler Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_167 = __objc_msgSend_167Ptr.asFunction< - NSItemProviderLoadHandler Function( - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _sel_setPreviewImageHandler_1 = - _registerName1("setPreviewImageHandler:"); - void _objc_msgSend_168( - ffi.Pointer obj, - ffi.Pointer sel, - NSItemProviderLoadHandler value, - ) { - return __objc_msgSend_168( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_168Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSItemProviderLoadHandler)>>('objc_msgSend'); - late final __objc_msgSend_168 = __objc_msgSend_168Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - NSItemProviderLoadHandler)>(); - - late final ffi.Pointer - _sel_loadPreviewImageWithOptions_completionHandler_1 = - _registerName1("loadPreviewImageWithOptions:completionHandler:"); - void _objc_msgSend_169( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer options, - NSItemProviderCompletionHandler completionHandler, - ) { - return __objc_msgSend_169( - obj, - sel, - options, - completionHandler, - ); - } - - late final __objc_msgSend_169Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSItemProviderCompletionHandler)>>('objc_msgSend'); - late final __objc_msgSend_169 = __objc_msgSend_169Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSItemProviderCompletionHandler)>(); - - late final ffi.Pointer> - _NSItemProviderPreferredImageSizeKey = - _lookup>('NSItemProviderPreferredImageSizeKey'); - - ffi.Pointer get NSItemProviderPreferredImageSizeKey => - _NSItemProviderPreferredImageSizeKey.value; - - set NSItemProviderPreferredImageSizeKey(ffi.Pointer value) => - _NSItemProviderPreferredImageSizeKey.value = value; - - late final ffi.Pointer> - _NSExtensionJavaScriptPreprocessingResultsKey = - _lookup>( - 'NSExtensionJavaScriptPreprocessingResultsKey'); - - ffi.Pointer get NSExtensionJavaScriptPreprocessingResultsKey => - _NSExtensionJavaScriptPreprocessingResultsKey.value; - - set NSExtensionJavaScriptPreprocessingResultsKey( - ffi.Pointer value) => - _NSExtensionJavaScriptPreprocessingResultsKey.value = value; - - late final ffi.Pointer> - _NSExtensionJavaScriptFinalizeArgumentKey = - _lookup>( - 'NSExtensionJavaScriptFinalizeArgumentKey'); - - ffi.Pointer get NSExtensionJavaScriptFinalizeArgumentKey => - _NSExtensionJavaScriptFinalizeArgumentKey.value; - - set NSExtensionJavaScriptFinalizeArgumentKey(ffi.Pointer value) => - _NSExtensionJavaScriptFinalizeArgumentKey.value = value; - - late final ffi.Pointer> _NSItemProviderErrorDomain = - _lookup>('NSItemProviderErrorDomain'); - - ffi.Pointer get NSItemProviderErrorDomain => - _NSItemProviderErrorDomain.value; - - set NSItemProviderErrorDomain(ffi.Pointer value) => - _NSItemProviderErrorDomain.value = value; - - late final ffi.Pointer _NSStringTransformLatinToKatakana = - _lookup('NSStringTransformLatinToKatakana'); - - NSStringTransform get NSStringTransformLatinToKatakana => - _NSStringTransformLatinToKatakana.value; - - set NSStringTransformLatinToKatakana(NSStringTransform value) => - _NSStringTransformLatinToKatakana.value = value; - - late final ffi.Pointer _NSStringTransformLatinToHiragana = - _lookup('NSStringTransformLatinToHiragana'); - - NSStringTransform get NSStringTransformLatinToHiragana => - _NSStringTransformLatinToHiragana.value; - - set NSStringTransformLatinToHiragana(NSStringTransform value) => - _NSStringTransformLatinToHiragana.value = value; - - late final ffi.Pointer _NSStringTransformLatinToHangul = - _lookup('NSStringTransformLatinToHangul'); - - NSStringTransform get NSStringTransformLatinToHangul => - _NSStringTransformLatinToHangul.value; - - set NSStringTransformLatinToHangul(NSStringTransform value) => - _NSStringTransformLatinToHangul.value = value; - - late final ffi.Pointer _NSStringTransformLatinToArabic = - _lookup('NSStringTransformLatinToArabic'); - - NSStringTransform get NSStringTransformLatinToArabic => - _NSStringTransformLatinToArabic.value; - - set NSStringTransformLatinToArabic(NSStringTransform value) => - _NSStringTransformLatinToArabic.value = value; - - late final ffi.Pointer _NSStringTransformLatinToHebrew = - _lookup('NSStringTransformLatinToHebrew'); - - NSStringTransform get NSStringTransformLatinToHebrew => - _NSStringTransformLatinToHebrew.value; - - set NSStringTransformLatinToHebrew(NSStringTransform value) => - _NSStringTransformLatinToHebrew.value = value; - - late final ffi.Pointer _NSStringTransformLatinToThai = - _lookup('NSStringTransformLatinToThai'); - - NSStringTransform get NSStringTransformLatinToThai => - _NSStringTransformLatinToThai.value; - - set NSStringTransformLatinToThai(NSStringTransform value) => - _NSStringTransformLatinToThai.value = value; - - late final ffi.Pointer _NSStringTransformLatinToCyrillic = - _lookup('NSStringTransformLatinToCyrillic'); - - NSStringTransform get NSStringTransformLatinToCyrillic => - _NSStringTransformLatinToCyrillic.value; - - set NSStringTransformLatinToCyrillic(NSStringTransform value) => - _NSStringTransformLatinToCyrillic.value = value; - - late final ffi.Pointer _NSStringTransformLatinToGreek = - _lookup('NSStringTransformLatinToGreek'); - - NSStringTransform get NSStringTransformLatinToGreek => - _NSStringTransformLatinToGreek.value; - - set NSStringTransformLatinToGreek(NSStringTransform value) => - _NSStringTransformLatinToGreek.value = value; - - late final ffi.Pointer _NSStringTransformToLatin = - _lookup('NSStringTransformToLatin'); - - NSStringTransform get NSStringTransformToLatin => - _NSStringTransformToLatin.value; - - set NSStringTransformToLatin(NSStringTransform value) => - _NSStringTransformToLatin.value = value; - - late final ffi.Pointer _NSStringTransformMandarinToLatin = - _lookup('NSStringTransformMandarinToLatin'); - - NSStringTransform get NSStringTransformMandarinToLatin => - _NSStringTransformMandarinToLatin.value; - - set NSStringTransformMandarinToLatin(NSStringTransform value) => - _NSStringTransformMandarinToLatin.value = value; - - late final ffi.Pointer - _NSStringTransformHiraganaToKatakana = - _lookup('NSStringTransformHiraganaToKatakana'); - - NSStringTransform get NSStringTransformHiraganaToKatakana => - _NSStringTransformHiraganaToKatakana.value; - - set NSStringTransformHiraganaToKatakana(NSStringTransform value) => - _NSStringTransformHiraganaToKatakana.value = value; - - late final ffi.Pointer - _NSStringTransformFullwidthToHalfwidth = - _lookup('NSStringTransformFullwidthToHalfwidth'); - - NSStringTransform get NSStringTransformFullwidthToHalfwidth => - _NSStringTransformFullwidthToHalfwidth.value; - - set NSStringTransformFullwidthToHalfwidth(NSStringTransform value) => - _NSStringTransformFullwidthToHalfwidth.value = value; - - late final ffi.Pointer _NSStringTransformToXMLHex = - _lookup('NSStringTransformToXMLHex'); - - NSStringTransform get NSStringTransformToXMLHex => - _NSStringTransformToXMLHex.value; - - set NSStringTransformToXMLHex(NSStringTransform value) => - _NSStringTransformToXMLHex.value = value; - - late final ffi.Pointer _NSStringTransformToUnicodeName = - _lookup('NSStringTransformToUnicodeName'); - - NSStringTransform get NSStringTransformToUnicodeName => - _NSStringTransformToUnicodeName.value; - - set NSStringTransformToUnicodeName(NSStringTransform value) => - _NSStringTransformToUnicodeName.value = value; - - late final ffi.Pointer - _NSStringTransformStripCombiningMarks = - _lookup('NSStringTransformStripCombiningMarks'); - - NSStringTransform get NSStringTransformStripCombiningMarks => - _NSStringTransformStripCombiningMarks.value; - - set NSStringTransformStripCombiningMarks(NSStringTransform value) => - _NSStringTransformStripCombiningMarks.value = value; - - late final ffi.Pointer _NSStringTransformStripDiacritics = - _lookup('NSStringTransformStripDiacritics'); - - NSStringTransform get NSStringTransformStripDiacritics => - _NSStringTransformStripDiacritics.value; - - set NSStringTransformStripDiacritics(NSStringTransform value) => - _NSStringTransformStripDiacritics.value = value; - - late final ffi.Pointer - _NSStringEncodingDetectionSuggestedEncodingsKey = - _lookup( - 'NSStringEncodingDetectionSuggestedEncodingsKey'); - - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionSuggestedEncodingsKey => - _NSStringEncodingDetectionSuggestedEncodingsKey.value; - - set NSStringEncodingDetectionSuggestedEncodingsKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionSuggestedEncodingsKey.value = value; - - late final ffi.Pointer - _NSStringEncodingDetectionDisallowedEncodingsKey = - _lookup( - 'NSStringEncodingDetectionDisallowedEncodingsKey'); - - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionDisallowedEncodingsKey => - _NSStringEncodingDetectionDisallowedEncodingsKey.value; - - set NSStringEncodingDetectionDisallowedEncodingsKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionDisallowedEncodingsKey.value = value; - - late final ffi.Pointer - _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey = - _lookup( - 'NSStringEncodingDetectionUseOnlySuggestedEncodingsKey'); - - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionUseOnlySuggestedEncodingsKey => - _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value; - - set NSStringEncodingDetectionUseOnlySuggestedEncodingsKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value = value; - - late final ffi.Pointer - _NSStringEncodingDetectionAllowLossyKey = - _lookup( - 'NSStringEncodingDetectionAllowLossyKey'); - - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionAllowLossyKey => - _NSStringEncodingDetectionAllowLossyKey.value; - - set NSStringEncodingDetectionAllowLossyKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionAllowLossyKey.value = value; - - late final ffi.Pointer - _NSStringEncodingDetectionFromWindowsKey = - _lookup( - 'NSStringEncodingDetectionFromWindowsKey'); - - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionFromWindowsKey => - _NSStringEncodingDetectionFromWindowsKey.value; - - set NSStringEncodingDetectionFromWindowsKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionFromWindowsKey.value = value; - - late final ffi.Pointer - _NSStringEncodingDetectionLossySubstitutionKey = - _lookup( - 'NSStringEncodingDetectionLossySubstitutionKey'); - - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionLossySubstitutionKey => - _NSStringEncodingDetectionLossySubstitutionKey.value; - - set NSStringEncodingDetectionLossySubstitutionKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionLossySubstitutionKey.value = value; - - late final ffi.Pointer - _NSStringEncodingDetectionLikelyLanguageKey = - _lookup( - 'NSStringEncodingDetectionLikelyLanguageKey'); - - NSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionLikelyLanguageKey => - _NSStringEncodingDetectionLikelyLanguageKey.value; - - set NSStringEncodingDetectionLikelyLanguageKey( - NSStringEncodingDetectionOptionsKey value) => - _NSStringEncodingDetectionLikelyLanguageKey.value = value; - - late final ffi.Pointer _class_NSMutableString1 = - _getClass1("NSMutableString"); - late final ffi.Pointer _sel_replaceCharactersInRange_withString_1 = - _registerName1("replaceCharactersInRange:withString:"); - late final ffi.Pointer _sel_insertString_atIndex_1 = - _registerName1("insertString:atIndex:"); - late final ffi.Pointer _sel_deleteCharactersInRange_1 = - _registerName1("deleteCharactersInRange:"); - late final ffi.Pointer _sel_appendString_1 = - _registerName1("appendString:"); - late final ffi.Pointer _sel_appendFormat_1 = - _registerName1("appendFormat:"); - late final ffi.Pointer _sel_setString_1 = - _registerName1("setString:"); - late final ffi.Pointer - _sel_replaceOccurrencesOfString_withString_options_range_1 = - _registerName1("replaceOccurrencesOfString:withString:options:range:"); - int _objc_msgSend_170( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer target, - ffi.Pointer replacement, - int options, - NSRange searchRange, - ) { - return __objc_msgSend_170( - obj, - sel, - target, - replacement, - options, - searchRange, - ); - } - - late final __objc_msgSend_170Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_170 = __objc_msgSend_170Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, NSRange)>(); - - late final ffi.Pointer - _sel_applyTransform_reverse_range_updatedRange_1 = - _registerName1("applyTransform:reverse:range:updatedRange:"); - bool _objc_msgSend_171( - ffi.Pointer obj, - ffi.Pointer sel, - NSStringTransform transform, - bool reverse, - NSRange range, - NSRangePointer resultingRange, - ) { - return __objc_msgSend_171( - obj, - sel, - transform, - reverse ? 1 : 0, - range, - resultingRange, - ) != - 0; - } - - late final __objc_msgSend_171Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function( - ffi.Pointer, - ffi.Pointer, - NSStringTransform, - ffi.Uint8, - NSRange, - NSRangePointer)>>('objc_msgSend'); - late final __objc_msgSend_171 = __objc_msgSend_171Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - NSStringTransform, int, NSRange, NSRangePointer)>(); - - ffi.Pointer _objc_msgSend_172( - ffi.Pointer obj, - ffi.Pointer sel, - int capacity, - ) { - return __objc_msgSend_172( - obj, - sel, - capacity, - ); - } - - late final __objc_msgSend_172Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_172 = __objc_msgSend_172Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _sel_stringWithCapacity_1 = - _registerName1("stringWithCapacity:"); - late final ffi.Pointer _NSCharacterConversionException = - _lookup('NSCharacterConversionException'); - - NSExceptionName get NSCharacterConversionException => - _NSCharacterConversionException.value; - - set NSCharacterConversionException(NSExceptionName value) => - _NSCharacterConversionException.value = value; - - late final ffi.Pointer _NSParseErrorException = - _lookup('NSParseErrorException'); - - NSExceptionName get NSParseErrorException => _NSParseErrorException.value; - - set NSParseErrorException(NSExceptionName value) => - _NSParseErrorException.value = value; - - late final ffi.Pointer _class_NSSimpleCString1 = - _getClass1("NSSimpleCString"); - late final ffi.Pointer _class_NSConstantString1 = - _getClass1("NSConstantString"); - late final ffi.Pointer _class_StringUtil1 = - _getClass1("StringUtil"); - late final ffi.Pointer _sel_strConcat_with_1 = - _registerName1("strConcat:with:"); -} - -abstract class NSComparisonResult { - static const int NSOrderedAscending = -1; - static const int NSOrderedSame = 0; - static const int NSOrderedDescending = 1; -} - -abstract class NSEnumerationOptions { - static const int NSEnumerationConcurrent = 1; - static const int NSEnumerationReverse = 2; -} - -abstract class NSSortOptions { - static const int NSSortConcurrent = 1; - static const int NSSortStable = 16; -} - -abstract class NSQualityOfService { - static const int NSQualityOfServiceUserInteractive = 33; - static const int NSQualityOfServiceUserInitiated = 25; - static const int NSQualityOfServiceUtility = 17; - static const int NSQualityOfServiceBackground = 9; - static const int NSQualityOfServiceDefault = -1; -} - -typedef NSInteger = pkg_ffi.Long; - -class __CFString extends ffi.Opaque {} - -abstract class CFComparisonResult { - static const int kCFCompareLessThan = -1; - static const int kCFCompareEqualTo = 0; - static const int kCFCompareGreaterThan = 1; -} - -typedef CFIndex = pkg_ffi.Long; - -class CFRange extends ffi.Struct { - @CFIndex() - external int location; - - @CFIndex() - external int length; -} - -class __CFNull extends ffi.Opaque {} - -typedef CFNullRef = ffi.Pointer<__CFNull>; - -class __CFAllocator extends ffi.Opaque {} - -typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; - -class CFAllocatorContext extends ffi.Struct { - @CFIndex() - external int version; - - external ffi.Pointer info; - - external CFAllocatorRetainCallBack retain; - - external CFAllocatorReleaseCallBack release; - - external CFAllocatorCopyDescriptionCallBack copyDescription; - - external CFAllocatorAllocateCallBack allocate; - - external CFAllocatorReallocateCallBack reallocate; - - external CFAllocatorDeallocateCallBack deallocate; - - external CFAllocatorPreferredSizeCallBack preferredSize; -} - -typedef CFAllocatorRetainCallBack = ffi.Pointer< - ffi.NativeFunction Function(ffi.Pointer)>>; -typedef CFAllocatorReleaseCallBack - = ffi.Pointer)>>; -typedef CFAllocatorCopyDescriptionCallBack = ffi - .Pointer)>>; -typedef CFStringRef = ffi.Pointer<__CFString>; -typedef CFAllocatorAllocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - CFIndex, CFOptionFlags, ffi.Pointer)>>; -typedef CFOptionFlags = pkg_ffi.UnsignedLong; -typedef CFAllocatorReallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, CFIndex, - CFOptionFlags, ffi.Pointer)>>; -typedef CFAllocatorDeallocateCallBack = ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer)>>; -typedef CFAllocatorPreferredSizeCallBack = ffi.Pointer< - ffi.NativeFunction< - CFIndex Function(CFIndex, CFOptionFlags, ffi.Pointer)>>; - -class _ObjCWrapper { - final ffi.Pointer _id; - final StringTestObjCLibrary _lib; - - _ObjCWrapper._(this._id, this._lib); - - @override - bool operator ==(Object other) { - return other is _ObjCWrapper && _id == other._id; - } - - @override - int get hashCode => _id.hashCode; -} - -class NSObject extends _ObjCWrapper { - NSObject._(ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); - - static NSObject castFrom(T other) { - return NSObject._(other._id, other._lib); - } - - static NSObject castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return NSObject._(other, lib); - } - - static void load(StringTestObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_load1); - } - - static void initialize(StringTestObjCLibrary _lib) { - _lib._objc_msgSend_0(_lib._class_NSObject1, _lib._sel_initialize1); - } - - NSObject init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSObject._(_ret, _lib); - } - - static NSObject new1(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_new1); - return NSObject._(_ret, _lib); - } - - static NSObject allocWithZone_( - StringTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject alloc(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_alloc1); - return NSObject._(_ret, _lib); - } - - void dealloc() { - _lib._objc_msgSend_0(_id, _lib._sel_dealloc1); - } - - void finalize() { - _lib._objc_msgSend_0(_id, _lib._sel_finalize1); - } - - NSObject copy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_copy1); - return NSObject._(_ret, _lib); - } - - NSObject mutableCopy() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_mutableCopy1); - return NSObject._(_ret, _lib); - } - - static NSObject copyWithZone_( - StringTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static NSObject mutableCopyWithZone_( - StringTestObjCLibrary _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); - return NSObject._(_ret, _lib); - } - - static bool instancesRespondToSelector_( - StringTestObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_3(_lib._class_NSObject1, - _lib._sel_instancesRespondToSelector_1, aSelector); - } - - static bool conformsToProtocol_( - StringTestObjCLibrary _lib, NSObject? protocol) { - return _lib._objc_msgSend_4(_lib._class_NSObject1, - _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); - } - - IMP methodForSelector_(ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_id, _lib._sel_methodForSelector_1, aSelector); - } - - static IMP instanceMethodForSelector_( - StringTestObjCLibrary _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_5(_lib._class_NSObject1, - _lib._sel_instanceMethodForSelector_1, aSelector); - } - - void doesNotRecognizeSelector_(ffi.Pointer aSelector) { - _lib._objc_msgSend_6(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); - } - - NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_7( - _id, _lib._sel_forwardingTargetForSelector_1, aSelector); - return NSObject._(_ret, _lib); - } - - void forwardInvocation_(NSObject? anInvocation) { - _lib._objc_msgSend_8( - _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); - } - - NSMethodSignature methodSignatureForSelector_( - ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9( - _id, _lib._sel_methodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - static NSMethodSignature instanceMethodSignatureForSelector_( - StringTestObjCLibrary _lib, ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_9(_lib._class_NSObject1, - _lib._sel_instanceMethodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib); - } - - bool allowsWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_allowsWeakReference1); - } - - bool retainWeakReference() { - return _lib._objc_msgSend_10(_id, _lib._sel_retainWeakReference1); - } - - static bool isSubclassOfClass_(StringTestObjCLibrary _lib, NSObject aClass) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); - } - - static bool resolveClassMethod_( - StringTestObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); - } - - static bool resolveInstanceMethod_( - StringTestObjCLibrary _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_3( - _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); - } - - static int hash(StringTestObjCLibrary _lib) { - return _lib._objc_msgSend_11(_lib._class_NSObject1, _lib._sel_hash1); - } - - static NSObject superclass(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_superclass1); - return NSObject._(_ret, _lib); - } - - static NSObject class1(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_class1); - return NSObject._(_ret, _lib); - } - - static NSString description(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_75(_lib._class_NSObject1, _lib._sel_description1); - return NSString._(_ret, _lib); - } - - static NSString debugDescription(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_75( - _lib._class_NSObject1, _lib._sel_debugDescription1); - return NSString._(_ret, _lib); - } - - static int version(StringTestObjCLibrary _lib) { - return _lib._objc_msgSend_32(_lib._class_NSObject1, _lib._sel_version1); - } - - static void setVersion_(StringTestObjCLibrary _lib, int aVersion) { - _lib._objc_msgSend_76( - _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); - } - - NSObject get classForCoder { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_classForCoder1); - return NSObject._(_ret, _lib); - } - - NSObject replacementObjectForCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - NSObject awakeAfterUsingCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static void poseAsClass_(StringTestObjCLibrary _lib, NSObject aClass) { - _lib._objc_msgSend_8( - _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); - } - - NSObject get autoContentAccessingProxy { - final _ret = - _lib._objc_msgSend_1(_id, _lib._sel_autoContentAccessingProxy1); - return NSObject._(_ret, _lib); - } -} - -class ObjCSel extends ffi.Opaque {} - -class ObjCObject extends ffi.Opaque {} - -typedef instancetype = ffi.Pointer; - -class _NSZone extends ffi.Opaque {} - -typedef IMP = ffi.Pointer>; - -class NSMethodSignature extends _ObjCWrapper { - NSMethodSignature._(ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); - - static NSMethodSignature castFrom(T other) { - return NSMethodSignature._(other._id, other._lib); - } - - static NSMethodSignature castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return NSMethodSignature._(other, lib); - } -} - -typedef NSUInteger = pkg_ffi.UnsignedLong; - -class NSString extends NSObject { - NSString._(ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); - - static NSString castFrom(T other) { - return NSString._(other._id, other._lib); - } - - static NSString castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return NSString._(other, lib); - } - - factory NSString(StringTestObjCLibrary _lib, String str) { - final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); - pkg_ffi.calloc.free(cstr); - return nsstr; - } - - @override - String toString() => (UTF8String).cast().toDartString(); - - int get length { - return _lib._objc_msgSend_11(_id, _lib._sel_length1); - } - - int characterAtIndex_(int index) { - return _lib._objc_msgSend_12(_id, _lib._sel_characterAtIndex_1, index); - } - - @override - NSString init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSString._(_ret, _lib); - } - - NSString initWithCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString substringFromIndex_(int from) { - final _ret = - _lib._objc_msgSend_14(_id, _lib._sel_substringFromIndex_1, from); - return NSString._(_ret, _lib); - } - - NSString substringToIndex_(int to) { - final _ret = _lib._objc_msgSend_14(_id, _lib._sel_substringToIndex_1, to); - return NSString._(_ret, _lib); - } - - NSString substringWithRange_(NSRange range) { - final _ret = - _lib._objc_msgSend_15(_id, _lib._sel_substringWithRange_1, range); - return NSString._(_ret, _lib); - } - - void getCharacters_range_(ffi.Pointer buffer, NSRange range) { - _lib._objc_msgSend_16(_id, _lib._sel_getCharacters_range_1, buffer, range); - } - - int compare_(NSObject? string) { - return _lib._objc_msgSend_17( - _id, _lib._sel_compare_1, string?._id ?? ffi.nullptr); - } - - int compare_options_(NSObject? string, int mask) { - return _lib._objc_msgSend_18( - _id, _lib._sel_compare_options_1, string?._id ?? ffi.nullptr, mask); - } - - int compare_options_range_( - NSObject? string, int mask, NSRange rangeOfReceiverToCompare) { - return _lib._objc_msgSend_19(_id, _lib._sel_compare_options_range_1, - string?._id ?? ffi.nullptr, mask, rangeOfReceiverToCompare); - } - - int compare_options_range_locale_(NSObject? string, int mask, - NSRange rangeOfReceiverToCompare, NSObject locale) { - return _lib._objc_msgSend_20(_id, _lib._sel_compare_options_range_locale_1, - string?._id ?? ffi.nullptr, mask, rangeOfReceiverToCompare, locale._id); - } - - int caseInsensitiveCompare_(NSObject? string) { - return _lib._objc_msgSend_17( - _id, _lib._sel_caseInsensitiveCompare_1, string?._id ?? ffi.nullptr); - } - - int localizedCompare_(NSObject? string) { - return _lib._objc_msgSend_17( - _id, _lib._sel_localizedCompare_1, string?._id ?? ffi.nullptr); - } - - int localizedCaseInsensitiveCompare_(NSObject? string) { - return _lib._objc_msgSend_17( - _id, - _lib._sel_localizedCaseInsensitiveCompare_1, - string?._id ?? ffi.nullptr); - } - - int localizedStandardCompare_(NSObject? string) { - return _lib._objc_msgSend_17( - _id, _lib._sel_localizedStandardCompare_1, string?._id ?? ffi.nullptr); - } - - bool isEqualToString_(NSObject? aString) { - return _lib._objc_msgSend_4( - _id, _lib._sel_isEqualToString_1, aString?._id ?? ffi.nullptr); - } - - bool hasPrefix_(NSObject? str) { - return _lib._objc_msgSend_4( - _id, _lib._sel_hasPrefix_1, str?._id ?? ffi.nullptr); - } - - bool hasSuffix_(NSObject? str) { - return _lib._objc_msgSend_4( - _id, _lib._sel_hasSuffix_1, str?._id ?? ffi.nullptr); - } - - NSString commonPrefixWithString_options_(NSObject? str, int mask) { - final _ret = _lib._objc_msgSend_21( - _id, - _lib._sel_commonPrefixWithString_options_1, - str?._id ?? ffi.nullptr, - mask); - return NSString._(_ret, _lib); - } - - bool containsString_(NSObject? str) { - return _lib._objc_msgSend_4( - _id, _lib._sel_containsString_1, str?._id ?? ffi.nullptr); - } - - bool localizedCaseInsensitiveContainsString_(NSObject? str) { - return _lib._objc_msgSend_4( - _id, - _lib._sel_localizedCaseInsensitiveContainsString_1, - str?._id ?? ffi.nullptr); - } - - bool localizedStandardContainsString_(NSObject? str) { - return _lib._objc_msgSend_4(_id, - _lib._sel_localizedStandardContainsString_1, str?._id ?? ffi.nullptr); - } - - NSRange localizedStandardRangeOfString_(NSObject? str) { - return _lib._objc_msgSend_22(_id, - _lib._sel_localizedStandardRangeOfString_1, str?._id ?? ffi.nullptr); - } - - NSRange rangeOfString_(NSObject? searchString) { - return _lib._objc_msgSend_22( - _id, _lib._sel_rangeOfString_1, searchString?._id ?? ffi.nullptr); - } - - NSRange rangeOfString_options_(NSObject? searchString, int mask) { - return _lib._objc_msgSend_23(_id, _lib._sel_rangeOfString_options_1, - searchString?._id ?? ffi.nullptr, mask); - } - - NSRange rangeOfString_options_range_( - NSObject? searchString, int mask, NSRange rangeOfReceiverToSearch) { - return _lib._objc_msgSend_24(_id, _lib._sel_rangeOfString_options_range_1, - searchString?._id ?? ffi.nullptr, mask, rangeOfReceiverToSearch); - } - - NSRange rangeOfString_options_range_locale_(NSObject? searchString, int mask, - NSRange rangeOfReceiverToSearch, NSObject? locale) { - return _lib._objc_msgSend_25( - _id, - _lib._sel_rangeOfString_options_range_locale_1, - searchString?._id ?? ffi.nullptr, - mask, - rangeOfReceiverToSearch, - locale?._id ?? ffi.nullptr); - } - - NSRange rangeOfCharacterFromSet_(NSObject? searchSet) { - return _lib._objc_msgSend_22(_id, _lib._sel_rangeOfCharacterFromSet_1, - searchSet?._id ?? ffi.nullptr); - } - - NSRange rangeOfCharacterFromSet_options_(NSObject? searchSet, int mask) { - return _lib._objc_msgSend_23( - _id, - _lib._sel_rangeOfCharacterFromSet_options_1, - searchSet?._id ?? ffi.nullptr, - mask); - } - - NSRange rangeOfCharacterFromSet_options_range_( - NSObject? searchSet, int mask, NSRange rangeOfReceiverToSearch) { - return _lib._objc_msgSend_24( - _id, - _lib._sel_rangeOfCharacterFromSet_options_range_1, - searchSet?._id ?? ffi.nullptr, - mask, - rangeOfReceiverToSearch); - } - - NSRange rangeOfComposedCharacterSequenceAtIndex_(int index) { - return _lib._objc_msgSend_26( - _id, _lib._sel_rangeOfComposedCharacterSequenceAtIndex_1, index); - } - - NSRange rangeOfComposedCharacterSequencesForRange_(NSRange range) { - return _lib._objc_msgSend_27( - _id, _lib._sel_rangeOfComposedCharacterSequencesForRange_1, range); - } - - NSString stringByAppendingString_(NSObject? aString) { - final _ret = _lib._objc_msgSend_28( - _id, _lib._sel_stringByAppendingString_1, aString?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString stringByAppendingFormat_(NSObject? format) { - final _ret = _lib._objc_msgSend_28( - _id, _lib._sel_stringByAppendingFormat_1, format?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - double get doubleValue { - return _lib._objc_msgSend_29(_id, _lib._sel_doubleValue1); - } - - double get floatValue { - return _lib._objc_msgSend_30(_id, _lib._sel_floatValue1); - } - - int get intValue { - return _lib._objc_msgSend_31(_id, _lib._sel_intValue1); - } - - int get integerValue { - return _lib._objc_msgSend_32(_id, _lib._sel_integerValue1); - } - - int get longLongValue { - return _lib._objc_msgSend_33(_id, _lib._sel_longLongValue1); - } - - bool get boolValue { - return _lib._objc_msgSend_10(_id, _lib._sel_boolValue1); - } - - NSObject? get uppercaseString { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_uppercaseString1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSObject? get lowercaseString { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_lowercaseString1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSObject? get capitalizedString { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_capitalizedString1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSObject? get localizedUppercaseString { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_localizedUppercaseString1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSObject? get localizedLowercaseString { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_localizedLowercaseString1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSObject? get localizedCapitalizedString { - final _ret = - _lib._objc_msgSend_1(_id, _lib._sel_localizedCapitalizedString1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSString uppercaseStringWithLocale_(NSObject? locale) { - final _ret = _lib._objc_msgSend_28( - _id, _lib._sel_uppercaseStringWithLocale_1, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString lowercaseStringWithLocale_(NSObject? locale) { - final _ret = _lib._objc_msgSend_28( - _id, _lib._sel_lowercaseStringWithLocale_1, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString capitalizedStringWithLocale_(NSObject? locale) { - final _ret = _lib._objc_msgSend_28(_id, - _lib._sel_capitalizedStringWithLocale_1, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - void getLineStart_end_contentsEnd_forRange_( - ffi.Pointer startPtr, - ffi.Pointer lineEndPtr, - ffi.Pointer contentsEndPtr, - NSRange range) { - _lib._objc_msgSend_34( - _id, - _lib._sel_getLineStart_end_contentsEnd_forRange_1, - startPtr, - lineEndPtr, - contentsEndPtr, - range); - } - - NSRange lineRangeForRange_(NSRange range) { - return _lib._objc_msgSend_27(_id, _lib._sel_lineRangeForRange_1, range); - } - - void getParagraphStart_end_contentsEnd_forRange_( - ffi.Pointer startPtr, - ffi.Pointer parEndPtr, - ffi.Pointer contentsEndPtr, - NSRange range) { - _lib._objc_msgSend_34( - _id, - _lib._sel_getParagraphStart_end_contentsEnd_forRange_1, - startPtr, - parEndPtr, - contentsEndPtr, - range); - } - - NSRange paragraphRangeForRange_(NSRange range) { - return _lib._objc_msgSend_27( - _id, _lib._sel_paragraphRangeForRange_1, range); - } - - void enumerateSubstringsInRange_options_usingBlock_( - NSRange range, int opts, ObjCBlock block) { - _lib._objc_msgSend_35( - _id, - _lib._sel_enumerateSubstringsInRange_options_usingBlock_1, - range, - opts, - block._impl); - } - - void enumerateLinesUsingBlock_(ObjCBlock1 block) { - _lib._objc_msgSend_36( - _id, _lib._sel_enumerateLinesUsingBlock_1, block._impl); - } - - ffi.Pointer get UTF8String { - return _lib._objc_msgSend_37(_id, _lib._sel_UTF8String1); - } - - int get fastestEncoding { - return _lib._objc_msgSend_11(_id, _lib._sel_fastestEncoding1); - } - - int get smallestEncoding { - return _lib._objc_msgSend_11(_id, _lib._sel_smallestEncoding1); - } - - NSData dataUsingEncoding_allowLossyConversion_(int encoding, bool lossy) { - final _ret = _lib._objc_msgSend_38(_id, - _lib._sel_dataUsingEncoding_allowLossyConversion_1, encoding, lossy); - return NSData._(_ret, _lib); - } - - NSData dataUsingEncoding_(int encoding) { - final _ret = - _lib._objc_msgSend_39(_id, _lib._sel_dataUsingEncoding_1, encoding); - return NSData._(_ret, _lib); - } - - bool canBeConvertedToEncoding_(int encoding) { - return _lib._objc_msgSend_40( - _id, _lib._sel_canBeConvertedToEncoding_1, encoding); - } - - void cStringUsingEncoding_(int encoding) { - _lib._objc_msgSend_41(_id, _lib._sel_cStringUsingEncoding_1, encoding); - } - - bool getCString_maxLength_encoding_( - ffi.Pointer buffer, int maxBufferCount, int encoding) { - return _lib._objc_msgSend_42(_id, _lib._sel_getCString_maxLength_encoding_1, - buffer, maxBufferCount, encoding); - } - - bool getBytes_maxLength_usedLength_encoding_options_range_remainingRange_( - ffi.Pointer buffer, - int maxBufferCount, - ffi.Pointer usedBufferCount, - int encoding, - int options, - NSRange range, - NSRangePointer leftover) { - return _lib._objc_msgSend_43( - _id, - _lib._sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_1, - buffer, - maxBufferCount, - usedBufferCount, - encoding, - options, - range, - leftover); - } - - int maximumLengthOfBytesUsingEncoding_(int enc) { - return _lib._objc_msgSend_44( - _id, _lib._sel_maximumLengthOfBytesUsingEncoding_1, enc); - } - - int lengthOfBytesUsingEncoding_(int enc) { - return _lib._objc_msgSend_44( - _id, _lib._sel_lengthOfBytesUsingEncoding_1, enc); - } - - static ffi.Pointer getAvailableStringEncodings( - StringTestObjCLibrary _lib) { - return _lib._objc_msgSend_45( - _lib._class_NSString1, _lib._sel_availableStringEncodings1); - } - - static NSString localizedNameOfStringEncoding_( - StringTestObjCLibrary _lib, int encoding) { - final _ret = _lib._objc_msgSend_14(_lib._class_NSString1, - _lib._sel_localizedNameOfStringEncoding_1, encoding); - return NSString._(_ret, _lib); - } - - static int getDefaultCStringEncoding(StringTestObjCLibrary _lib) { - return _lib._objc_msgSend_11( - _lib._class_NSString1, _lib._sel_defaultCStringEncoding1); - } - - NSObject? get decomposedStringWithCanonicalMapping { - final _ret = _lib._objc_msgSend_1( - _id, _lib._sel_decomposedStringWithCanonicalMapping1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSObject? get precomposedStringWithCanonicalMapping { - final _ret = _lib._objc_msgSend_1( - _id, _lib._sel_precomposedStringWithCanonicalMapping1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSObject? get decomposedStringWithCompatibilityMapping { - final _ret = _lib._objc_msgSend_1( - _id, _lib._sel_decomposedStringWithCompatibilityMapping1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSObject? get precomposedStringWithCompatibilityMapping { - final _ret = _lib._objc_msgSend_1( - _id, _lib._sel_precomposedStringWithCompatibilityMapping1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSString stringByTrimmingCharactersInSet_(NSObject? set) { - final _ret = _lib._objc_msgSend_28(_id, - _lib._sel_stringByTrimmingCharactersInSet_1, set?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString stringByPaddingToLength_withString_startingAtIndex_( - int newLength, NSObject? padString, int padIndex) { - final _ret = _lib._objc_msgSend_46( - _id, - _lib._sel_stringByPaddingToLength_withString_startingAtIndex_1, - newLength, - padString?._id ?? ffi.nullptr, - padIndex); - return NSString._(_ret, _lib); - } - - NSString stringByFoldingWithOptions_locale_(int options, NSObject? locale) { - final _ret = _lib._objc_msgSend_47( - _id, - _lib._sel_stringByFoldingWithOptions_locale_1, - options, - locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString stringByReplacingOccurrencesOfString_withString_options_range_( - NSObject? target, - NSObject? replacement, - int options, - NSRange searchRange) { - final _ret = _lib._objc_msgSend_48( - _id, - _lib._sel_stringByReplacingOccurrencesOfString_withString_options_range_1, - target?._id ?? ffi.nullptr, - replacement?._id ?? ffi.nullptr, - options, - searchRange); - return NSString._(_ret, _lib); - } - - NSString stringByReplacingOccurrencesOfString_withString_( - NSObject? target, NSObject? replacement) { - final _ret = _lib._objc_msgSend_49( - _id, - _lib._sel_stringByReplacingOccurrencesOfString_withString_1, - target?._id ?? ffi.nullptr, - replacement?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString stringByReplacingCharactersInRange_withString_( - NSRange range, NSObject? replacement) { - final _ret = _lib._objc_msgSend_50( - _id, - _lib._sel_stringByReplacingCharactersInRange_withString_1, - range, - replacement?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString stringByApplyingTransform_reverse_( - NSStringTransform transform, bool reverse) { - final _ret = _lib._objc_msgSend_51( - _id, _lib._sel_stringByApplyingTransform_reverse_1, transform, reverse); - return NSString._(_ret, _lib); - } - - bool writeToURL_atomically_encoding_error_( - NSObject? url, - bool useAuxiliaryFile, - int enc, - ffi.Pointer> error) { - return _lib._objc_msgSend_52( - _id, - _lib._sel_writeToURL_atomically_encoding_error_1, - url?._id ?? ffi.nullptr, - useAuxiliaryFile, - enc, - error); - } - - bool writeToFile_atomically_encoding_error_( - NSObject? path, - bool useAuxiliaryFile, - int enc, - ffi.Pointer> error) { - return _lib._objc_msgSend_52( - _id, - _lib._sel_writeToFile_atomically_encoding_error_1, - path?._id ?? ffi.nullptr, - useAuxiliaryFile, - enc, - error); - } - - NSObject? get description { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_description1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - int get hash { - return _lib._objc_msgSend_11(_id, _lib._sel_hash1); - } - - NSString initWithCharactersNoCopy_length_freeWhenDone_( - ffi.Pointer characters, int length, bool freeBuffer) { - final _ret = _lib._objc_msgSend_53( - _id, - _lib._sel_initWithCharactersNoCopy_length_freeWhenDone_1, - characters, - length, - freeBuffer); - return NSString._(_ret, _lib); - } - - NSString initWithCharactersNoCopy_length_deallocator_( - ffi.Pointer chars, int len, ObjCBlock2 deallocator) { - final _ret = _lib._objc_msgSend_54( - _id, - _lib._sel_initWithCharactersNoCopy_length_deallocator_1, - chars, - len, - deallocator._impl); - return NSString._(_ret, _lib); - } - - NSString initWithCharacters_length_( - ffi.Pointer characters, int length) { - final _ret = _lib._objc_msgSend_55( - _id, _lib._sel_initWithCharacters_length_1, characters, length); - return NSString._(_ret, _lib); - } - - NSString initWithUTF8String_( - ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_56( - _id, _lib._sel_initWithUTF8String_1, nullTerminatedCString); - return NSString._(_ret, _lib); - } - - NSString initWithString_(NSObject? aString) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithString_1, aString?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString initWithFormat_(NSObject? format) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithFormat_1, format?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString initWithFormat_arguments_( - NSObject? format, ffi.Pointer<__va_list_tag> argList) { - final _ret = _lib._objc_msgSend_57( - _id, - _lib._sel_initWithFormat_arguments_1, - format?._id ?? ffi.nullptr, - argList); - return NSString._(_ret, _lib); - } - - NSString initWithFormat_locale_(NSObject? format, NSObject locale) { - final _ret = _lib._objc_msgSend_58(_id, _lib._sel_initWithFormat_locale_1, - format?._id ?? ffi.nullptr, locale._id); - return NSString._(_ret, _lib); - } - - NSString initWithFormat_locale_arguments_( - NSObject? format, NSObject locale, ffi.Pointer<__va_list_tag> argList) { - final _ret = _lib._objc_msgSend_59( - _id, - _lib._sel_initWithFormat_locale_arguments_1, - format?._id ?? ffi.nullptr, - locale._id, - argList); - return NSString._(_ret, _lib); - } - - NSString initWithData_encoding_(NSObject? data, int encoding) { - final _ret = _lib._objc_msgSend_60(_id, _lib._sel_initWithData_encoding_1, - data?._id ?? ffi.nullptr, encoding); - return NSString._(_ret, _lib); - } - - NSString initWithBytes_length_encoding_( - ffi.Pointer bytes, int len, int encoding) { - final _ret = _lib._objc_msgSend_61( - _id, _lib._sel_initWithBytes_length_encoding_1, bytes, len, encoding); - return NSString._(_ret, _lib); - } - - NSString initWithBytesNoCopy_length_encoding_freeWhenDone_( - ffi.Pointer bytes, int len, int encoding, bool freeBuffer) { - final _ret = _lib._objc_msgSend_62( - _id, - _lib._sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1, - bytes, - len, - encoding, - freeBuffer); - return NSString._(_ret, _lib); - } - - NSString initWithBytesNoCopy_length_encoding_deallocator_( - ffi.Pointer bytes, - int len, - int encoding, - ObjCBlock3 deallocator) { - final _ret = _lib._objc_msgSend_63( - _id, - _lib._sel_initWithBytesNoCopy_length_encoding_deallocator_1, - bytes, - len, - encoding, - deallocator._impl); - return NSString._(_ret, _lib); - } - - static NSString string(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSString1, _lib._sel_string1); - return NSString._(_ret, _lib); - } - - static NSString stringWithString_( - StringTestObjCLibrary _lib, NSObject? string) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, - _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - static NSString stringWithCharacters_length_( - StringTestObjCLibrary _lib, ffi.Pointer characters, int length) { - final _ret = _lib._objc_msgSend_55(_lib._class_NSString1, - _lib._sel_stringWithCharacters_length_1, characters, length); - return NSString._(_ret, _lib); - } - - static NSString stringWithUTF8String_(StringTestObjCLibrary _lib, - ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_56(_lib._class_NSString1, - _lib._sel_stringWithUTF8String_1, nullTerminatedCString); - return NSString._(_ret, _lib); - } - - static NSString stringWithFormat_( - StringTestObjCLibrary _lib, NSObject? format) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, - _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - static NSString localizedStringWithFormat_( - StringTestObjCLibrary _lib, NSObject? format) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, - _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - NSString initWithCString_encoding_( - ffi.Pointer nullTerminatedCString, int encoding) { - final _ret = _lib._objc_msgSend_64(_id, - _lib._sel_initWithCString_encoding_1, nullTerminatedCString, encoding); - return NSString._(_ret, _lib); - } - - static NSString stringWithCString_encoding_( - StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_64(_lib._class_NSString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return NSString._(_ret, _lib); - } - - NSString initWithContentsOfURL_encoding_error_( - NSObject? url, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( - _id, - _lib._sel_initWithContentsOfURL_encoding_error_1, - url?._id ?? ffi.nullptr, - enc, - error); - return NSString._(_ret, _lib); - } - - NSString initWithContentsOfFile_encoding_error_( - NSObject? path, int enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( - _id, - _lib._sel_initWithContentsOfFile_encoding_error_1, - path?._id ?? ffi.nullptr, - enc, - error); - return NSString._(_ret, _lib); - } - - static NSString stringWithContentsOfURL_encoding_error_( - StringTestObjCLibrary _lib, - NSObject? url, - int enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( - _lib._class_NSString1, - _lib._sel_stringWithContentsOfURL_encoding_error_1, - url?._id ?? ffi.nullptr, - enc, - error); - return NSString._(_ret, _lib); - } - - static NSString stringWithContentsOfFile_encoding_error_( - StringTestObjCLibrary _lib, - NSObject? path, - int enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( - _lib._class_NSString1, - _lib._sel_stringWithContentsOfFile_encoding_error_1, - path?._id ?? ffi.nullptr, - enc, - error); - return NSString._(_ret, _lib); - } - - NSString initWithContentsOfURL_usedEncoding_error_( - NSObject? url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_66( - _id, - _lib._sel_initWithContentsOfURL_usedEncoding_error_1, - url?._id ?? ffi.nullptr, - enc, - error); - return NSString._(_ret, _lib); - } - - NSString initWithContentsOfFile_usedEncoding_error_( - NSObject? path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_66( - _id, - _lib._sel_initWithContentsOfFile_usedEncoding_error_1, - path?._id ?? ffi.nullptr, - enc, - error); - return NSString._(_ret, _lib); - } - - static NSString stringWithContentsOfURL_usedEncoding_error_( - StringTestObjCLibrary _lib, - NSObject? url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_66( - _lib._class_NSString1, - _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, - url?._id ?? ffi.nullptr, - enc, - error); - return NSString._(_ret, _lib); - } - - static NSString stringWithContentsOfFile_usedEncoding_error_( - StringTestObjCLibrary _lib, - NSObject? path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_66( - _lib._class_NSString1, - _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, - path?._id ?? ffi.nullptr, - enc, - error); - return NSString._(_ret, _lib); - } - - static int - stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( - StringTestObjCLibrary _lib, - NSObject? data, - NSObject? opts, - ffi.Pointer> string, - ffi.Pointer usedLossyConversion) { - return _lib._objc_msgSend_67( - _lib._class_NSString1, - _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, - data?._id ?? ffi.nullptr, - opts?._id ?? ffi.nullptr, - string, - usedLossyConversion); - } - - NSObject propertyList() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_propertyList1); - return NSObject._(_ret, _lib); - } - - NSDictionary propertyListFromStringsFileFormat() { - final _ret = _lib._objc_msgSend_68( - _id, _lib._sel_propertyListFromStringsFileFormat1); - return NSDictionary._(_ret, _lib); - } - - void cString() { - _lib._objc_msgSend_0(_id, _lib._sel_cString1); - } - - void lossyCString() { - _lib._objc_msgSend_0(_id, _lib._sel_lossyCString1); - } - - int cStringLength() { - return _lib._objc_msgSend_11(_id, _lib._sel_cStringLength1); - } - - void getCString_(ffi.Pointer bytes) { - _lib._objc_msgSend_69(_id, _lib._sel_getCString_1, bytes); - } - - void getCString_maxLength_(ffi.Pointer bytes, int maxLength) { - _lib._objc_msgSend_70( - _id, _lib._sel_getCString_maxLength_1, bytes, maxLength); - } - - void getCString_maxLength_range_remainingRange_( - ffi.Pointer bytes, - int maxLength, - NSRange aRange, - NSRangePointer leftoverRange) { - _lib._objc_msgSend_71( - _id, - _lib._sel_getCString_maxLength_range_remainingRange_1, - bytes, - maxLength, - aRange, - leftoverRange); - } - - bool writeToFile_atomically_(NSObject? path, bool useAuxiliaryFile) { - return _lib._objc_msgSend_72(_id, _lib._sel_writeToFile_atomically_1, - path?._id ?? ffi.nullptr, useAuxiliaryFile); - } - - bool writeToURL_atomically_(NSObject? url, bool atomically) { - return _lib._objc_msgSend_72(_id, _lib._sel_writeToURL_atomically_1, - url?._id ?? ffi.nullptr, atomically); - } - - NSObject initWithContentsOfFile_(NSObject? path) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - NSObject initWithContentsOfURL_(NSObject? url) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static NSObject stringWithContentsOfFile_( - StringTestObjCLibrary _lib, NSObject? path) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, - _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static NSObject stringWithContentsOfURL_( - StringTestObjCLibrary _lib, NSObject? url) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSString1, - _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - NSObject initWithCStringNoCopy_length_freeWhenDone_( - ffi.Pointer bytes, int length, bool freeBuffer) { - final _ret = _lib._objc_msgSend_73( - _id, - _lib._sel_initWithCStringNoCopy_length_freeWhenDone_1, - bytes, - length, - freeBuffer); - return NSObject._(_ret, _lib); - } - - NSObject initWithCString_length_( - ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_64( - _id, _lib._sel_initWithCString_length_1, bytes, length); - return NSObject._(_ret, _lib); - } - - NSObject initWithCString_(ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_56(_id, _lib._sel_initWithCString_1, bytes); - return NSObject._(_ret, _lib); - } - - static NSObject stringWithCString_length_( - StringTestObjCLibrary _lib, ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_64(_lib._class_NSString1, - _lib._sel_stringWithCString_length_1, bytes, length); - return NSObject._(_ret, _lib); - } - - static NSObject stringWithCString_( - StringTestObjCLibrary _lib, ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_56( - _lib._class_NSString1, _lib._sel_stringWithCString_1, bytes); - return NSObject._(_ret, _lib); - } - - void getCharacters_(ffi.Pointer buffer) { - _lib._objc_msgSend_74(_id, _lib._sel_getCharacters_1, buffer); - } - - static NSString new1(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSString1, _lib._sel_new1); - return NSString._(_ret, _lib); - } - - static NSString alloc(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSString1, _lib._sel_alloc1); - return NSString._(_ret, _lib); - } -} - -extension StringToNSString on String { - NSString toNSString(StringTestObjCLibrary lib) => NSString(lib, this); -} - -typedef unichar = pkg_ffi.UnsignedShort; -typedef NSRange = _NSRange; - -class _NSRange extends ffi.Struct { - @NSUInteger() - external int location; - - @NSUInteger() - external int length; -} - -abstract class NSStringCompareOptions { - static const int NSCaseInsensitiveSearch = 1; - static const int NSLiteralSearch = 2; - static const int NSBackwardsSearch = 4; - static const int NSAnchoredSearch = 8; - static const int NSNumericSearch = 64; - static const int NSDiacriticInsensitiveSearch = 128; - static const int NSWidthInsensitiveSearch = 256; - static const int NSForcedOrderingSearch = 512; - static const int NSRegularExpressionSearch = 1024; -} - -abstract class NSStringEnumerationOptions { - static const int NSStringEnumerationByLines = 0; - static const int NSStringEnumerationByParagraphs = 1; - static const int NSStringEnumerationByComposedCharacterSequences = 2; - static const int NSStringEnumerationByWords = 3; - static const int NSStringEnumerationBySentences = 4; - static const int NSStringEnumerationByCaretPositions = 5; - static const int NSStringEnumerationByDeletionClusters = 6; - static const int NSStringEnumerationReverse = 256; - static const int NSStringEnumerationSubstringNotRequired = 512; - static const int NSStringEnumerationLocalized = 1024; -} - -void _ObjCBlock_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSRange arg1, - NSRange arg2, - ffi.Pointer arg3) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, NSRange arg1, - NSRange arg2, ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer arg0, - NSRange arg1, - NSRange arg2, - ffi.Pointer arg3)>()(arg0, arg1, arg2, arg3); -} - -class ObjCBlock { - final ffi.Pointer<_ObjCBlock> _impl; - final StringTestObjCLibrary _lib; - ObjCBlock._(this._impl, this._lib); - - ObjCBlock.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, NSRange arg1, - NSRange arg2, ffi.Pointer arg3)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSRange arg1, - NSRange arg2, - ffi.Pointer arg3)>( - _ObjCBlock_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -class _ObjCBlockDesc extends ffi.Struct { - @pkg_ffi.UnsignedLong() - external int reserved; - - @pkg_ffi.UnsignedLong() - external int size; - - external ffi.Pointer copy_helper; - - external ffi.Pointer dispose_helper; - - external ffi.Pointer signature; -} - -class _ObjCBlock extends ffi.Struct { - external ffi.Pointer isa; - - @pkg_ffi.Int() - external int flags; - - @pkg_ffi.Int() - external int reserved; - - external ffi.Pointer invoke; - - external ffi.Pointer<_ObjCBlockDesc> descriptor; - - external ffi.Pointer target; -} - -void _ObjCBlock1_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, ffi.Pointer arg1) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>()(arg0, arg1); -} - -class ObjCBlock1 { - final ffi.Pointer<_ObjCBlock> _impl; - final StringTestObjCLibrary _lib; - ObjCBlock1._(this._impl, this._lib); - - ObjCBlock1.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : _impl = - _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock1_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -typedef NSStringEncoding = NSUInteger; - -class NSData extends _ObjCWrapper { - NSData._(ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); - - static NSData castFrom(T other) { - return NSData._(other._id, other._lib); - } - - static NSData castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return NSData._(other, lib); - } -} - -abstract class NSStringEncodingConversionOptions { - static const int NSStringEncodingConversionAllowLossy = 1; - static const int NSStringEncodingConversionExternalRepresentation = 2; -} - -typedef NSRangePointer = ffi.Pointer; -typedef NSStringTransform = ffi.Pointer; -void _ObjCBlock2_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, NSUInteger arg1)>>() - .asFunction< - void Function(ffi.Pointer arg0, int arg1)>()(arg0, arg1); -} - -class ObjCBlock2 { - final ffi.Pointer<_ObjCBlock> _impl; - final StringTestObjCLibrary _lib; - ObjCBlock2._(this._impl, this._lib); - - ObjCBlock2.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, NSUInteger arg1)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSUInteger arg1)>(_ObjCBlock2_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -class __va_list_tag extends ffi.Struct { - @pkg_ffi.UnsignedInt() - external int gp_offset; - - @pkg_ffi.UnsignedInt() - external int fp_offset; - - external ffi.Pointer overflow_arg_area; - - external ffi.Pointer reg_save_area; -} - -void _ObjCBlock3_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, NSUInteger arg1)>>() - .asFunction< - void Function(ffi.Pointer arg0, int arg1)>()(arg0, arg1); -} - -class ObjCBlock3 { - final ffi.Pointer<_ObjCBlock> _impl; - final StringTestObjCLibrary _lib; - ObjCBlock3._(this._impl, this._lib); - - ObjCBlock3.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, NSUInteger arg1)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSUInteger arg1)>(_ObjCBlock3_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -class NSDictionary extends _ObjCWrapper { - NSDictionary._(ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); - - static NSDictionary castFrom(T other) { - return NSDictionary._(other._id, other._lib); - } - - static NSDictionary castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return NSDictionary._(other, lib); - } -} - -class NSValue extends NSObject { - NSValue._(ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); - - static NSValue castFrom(T other) { - return NSValue._(other._id, other._lib); - } - - static NSValue castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return NSValue._(other, lib); - } - - void getValue_size_(ffi.Pointer value, int size) { - _lib._objc_msgSend_77(_id, _lib._sel_getValue_size_1, value, size); - } - - ffi.Pointer get objCType { - return _lib._objc_msgSend_37(_id, _lib._sel_objCType1); - } - - NSValue initWithBytes_objCType_( - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_78( - _id, _lib._sel_initWithBytes_objCType_1, value, type); - return NSValue._(_ret, _lib); - } - - NSValue initWithCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); - return NSValue._(_ret, _lib); - } - - static NSValue valueWithBytes_objCType_(StringTestObjCLibrary _lib, - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_79( - _lib._class_NSValue1, _lib._sel_valueWithBytes_objCType_1, value, type); - return NSValue._(_ret, _lib); - } - - static NSValue value_withObjCType_(StringTestObjCLibrary _lib, - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_79( - _lib._class_NSValue1, _lib._sel_value_withObjCType_1, value, type); - return NSValue._(_ret, _lib); - } - - static NSValue valueWithNonretainedObject_( - StringTestObjCLibrary _lib, NSObject anObject) { - final _ret = _lib._objc_msgSend_80(_lib._class_NSValue1, - _lib._sel_valueWithNonretainedObject_1, anObject._id); - return NSValue._(_ret, _lib); - } - - NSObject get nonretainedObjectValue { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_nonretainedObjectValue1); - return NSObject._(_ret, _lib); - } - - static NSValue valueWithPointer_( - StringTestObjCLibrary _lib, ffi.Pointer pointer) { - final _ret = _lib._objc_msgSend_81( - _lib._class_NSValue1, _lib._sel_valueWithPointer_1, pointer); - return NSValue._(_ret, _lib); - } - - ffi.Pointer get pointerValue { - return _lib._objc_msgSend_82(_id, _lib._sel_pointerValue1); - } - - bool isEqualToValue_(NSObject? value) { - return _lib._objc_msgSend_4( - _id, _lib._sel_isEqualToValue_1, value?._id ?? ffi.nullptr); - } - - void getValue_(ffi.Pointer value) { - _lib._objc_msgSend_83(_id, _lib._sel_getValue_1, value); - } - - static NSValue valueWithRange_(StringTestObjCLibrary _lib, NSRange range) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSValue1, _lib._sel_valueWithRange_1, range); - return NSValue._(_ret, _lib); - } - - NSRange get rangeValue { - return _lib._objc_msgSend_85(_id, _lib._sel_rangeValue1); - } - - static NSValue new1(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSValue1, _lib._sel_new1); - return NSValue._(_ret, _lib); - } - - static NSValue alloc(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSValue1, _lib._sel_alloc1); - return NSValue._(_ret, _lib); - } -} - -class NSNumber extends NSValue { - NSNumber._(ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); - - static NSNumber castFrom(T other) { - return NSNumber._(other._id, other._lib); - } - - static NSNumber castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return NSNumber._(other, lib); - } - - @override - NSNumber initWithCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithChar_(int value) { - final _ret = _lib._objc_msgSend_86(_id, _lib._sel_initWithChar_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithUnsignedChar_(int value) { - final _ret = - _lib._objc_msgSend_87(_id, _lib._sel_initWithUnsignedChar_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithShort_(int value) { - final _ret = _lib._objc_msgSend_88(_id, _lib._sel_initWithShort_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithUnsignedShort_(int value) { - final _ret = - _lib._objc_msgSend_89(_id, _lib._sel_initWithUnsignedShort_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithInt_(int value) { - final _ret = _lib._objc_msgSend_90(_id, _lib._sel_initWithInt_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithUnsignedInt_(int value) { - final _ret = - _lib._objc_msgSend_91(_id, _lib._sel_initWithUnsignedInt_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithLong_(int value) { - final _ret = _lib._objc_msgSend_92(_id, _lib._sel_initWithLong_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithUnsignedLong_(int value) { - final _ret = - _lib._objc_msgSend_93(_id, _lib._sel_initWithUnsignedLong_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithLongLong_(int value) { - final _ret = - _lib._objc_msgSend_94(_id, _lib._sel_initWithLongLong_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithUnsignedLongLong_(int value) { - final _ret = - _lib._objc_msgSend_95(_id, _lib._sel_initWithUnsignedLongLong_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithFloat_(double value) { - final _ret = _lib._objc_msgSend_96(_id, _lib._sel_initWithFloat_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithDouble_(double value) { - final _ret = _lib._objc_msgSend_97(_id, _lib._sel_initWithDouble_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithBool_(bool value) { - final _ret = _lib._objc_msgSend_98(_id, _lib._sel_initWithBool_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithInteger_(int value) { - final _ret = _lib._objc_msgSend_92(_id, _lib._sel_initWithInteger_1, value); - return NSNumber._(_ret, _lib); - } - - NSNumber initWithUnsignedInteger_(int value) { - final _ret = - _lib._objc_msgSend_93(_id, _lib._sel_initWithUnsignedInteger_1, value); - return NSNumber._(_ret, _lib); - } - - int get charValue { - return _lib._objc_msgSend_99(_id, _lib._sel_charValue1); - } - - int get unsignedCharValue { - return _lib._objc_msgSend_100(_id, _lib._sel_unsignedCharValue1); - } - - int get shortValue { - return _lib._objc_msgSend_101(_id, _lib._sel_shortValue1); - } - - int get unsignedShortValue { - return _lib._objc_msgSend_102(_id, _lib._sel_unsignedShortValue1); - } - - int get intValue { - return _lib._objc_msgSend_31(_id, _lib._sel_intValue1); - } - - int get unsignedIntValue { - return _lib._objc_msgSend_103(_id, _lib._sel_unsignedIntValue1); - } - - int get longValue { - return _lib._objc_msgSend_32(_id, _lib._sel_longValue1); - } - - int get unsignedLongValue { - return _lib._objc_msgSend_11(_id, _lib._sel_unsignedLongValue1); - } - - int get longLongValue { - return _lib._objc_msgSend_33(_id, _lib._sel_longLongValue1); - } - - int get unsignedLongLongValue { - return _lib._objc_msgSend_104(_id, _lib._sel_unsignedLongLongValue1); - } - - double get floatValue { - return _lib._objc_msgSend_30(_id, _lib._sel_floatValue1); - } - - double get doubleValue { - return _lib._objc_msgSend_29(_id, _lib._sel_doubleValue1); - } - - bool get boolValue { - return _lib._objc_msgSend_10(_id, _lib._sel_boolValue1); - } - - int get integerValue { - return _lib._objc_msgSend_32(_id, _lib._sel_integerValue1); - } - - int get unsignedIntegerValue { - return _lib._objc_msgSend_11(_id, _lib._sel_unsignedIntegerValue1); - } - - NSObject? get stringValue { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_stringValue1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - int compare_(NSObject? otherNumber) { - return _lib._objc_msgSend_17( - _id, _lib._sel_compare_1, otherNumber?._id ?? ffi.nullptr); - } - - bool isEqualToNumber_(NSObject? number) { - return _lib._objc_msgSend_4( - _id, _lib._sel_isEqualToNumber_1, number?._id ?? ffi.nullptr); - } - - NSString descriptionWithLocale_(NSObject locale) { - final _ret = _lib._objc_msgSend_28( - _id, _lib._sel_descriptionWithLocale_1, locale._id); - return NSString._(_ret, _lib); - } - - static NSNumber numberWithChar_(StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_86( - _lib._class_NSNumber1, _lib._sel_numberWithChar_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithUnsignedChar_( - StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_87( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedChar_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithShort_(StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_88( - _lib._class_NSNumber1, _lib._sel_numberWithShort_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithUnsignedShort_( - StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_89( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedShort_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithInt_(StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_90( - _lib._class_NSNumber1, _lib._sel_numberWithInt_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithUnsignedInt_( - StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_91( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInt_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithLong_(StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_92( - _lib._class_NSNumber1, _lib._sel_numberWithLong_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithUnsignedLong_( - StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_93( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLong_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithLongLong_(StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_94( - _lib._class_NSNumber1, _lib._sel_numberWithLongLong_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithUnsignedLongLong_( - StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_95( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLongLong_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithFloat_(StringTestObjCLibrary _lib, double value) { - final _ret = _lib._objc_msgSend_96( - _lib._class_NSNumber1, _lib._sel_numberWithFloat_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithDouble_(StringTestObjCLibrary _lib, double value) { - final _ret = _lib._objc_msgSend_97( - _lib._class_NSNumber1, _lib._sel_numberWithDouble_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithBool_(StringTestObjCLibrary _lib, bool value) { - final _ret = _lib._objc_msgSend_98( - _lib._class_NSNumber1, _lib._sel_numberWithBool_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithInteger_(StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_92( - _lib._class_NSNumber1, _lib._sel_numberWithInteger_1, value); - return NSNumber._(_ret, _lib); - } - - static NSNumber numberWithUnsignedInteger_( - StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_93( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInteger_1, value); - return NSNumber._(_ret, _lib); - } - - static NSValue valueWithBytes_objCType_(StringTestObjCLibrary _lib, - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_79(_lib._class_NSNumber1, - _lib._sel_valueWithBytes_objCType_1, value, type); - return NSValue._(_ret, _lib); - } - - static NSValue value_withObjCType_(StringTestObjCLibrary _lib, - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_79( - _lib._class_NSNumber1, _lib._sel_value_withObjCType_1, value, type); - return NSValue._(_ret, _lib); - } - - static NSValue valueWithNonretainedObject_( - StringTestObjCLibrary _lib, NSObject anObject) { - final _ret = _lib._objc_msgSend_80(_lib._class_NSNumber1, - _lib._sel_valueWithNonretainedObject_1, anObject._id); - return NSValue._(_ret, _lib); - } - - static NSValue valueWithPointer_( - StringTestObjCLibrary _lib, ffi.Pointer pointer) { - final _ret = _lib._objc_msgSend_81( - _lib._class_NSNumber1, _lib._sel_valueWithPointer_1, pointer); - return NSValue._(_ret, _lib); - } - - static NSValue valueWithRange_(StringTestObjCLibrary _lib, NSRange range) { - final _ret = _lib._objc_msgSend_84( - _lib._class_NSNumber1, _lib._sel_valueWithRange_1, range); - return NSValue._(_ret, _lib); - } - - static NSNumber new1(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSNumber1, _lib._sel_new1); - return NSNumber._(_ret, _lib); - } - - static NSNumber alloc(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSNumber1, _lib._sel_alloc1); - return NSNumber._(_ret, _lib); - } -} - -class NSFastEnumerationState extends ffi.Struct { - @pkg_ffi.UnsignedLong() - external int state; - - external ffi.Pointer> itemsPtr; - - external ffi.Pointer mutationsPtr; - - @ffi.Array.multi([5]) - external ffi.Array extra; -} - -class NSEnumerator extends NSObject { - NSEnumerator._(ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); - - static NSEnumerator castFrom(T other) { - return NSEnumerator._(other._id, other._lib); - } - - static NSEnumerator castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return NSEnumerator._(other, lib); - } - - NSObject nextObject() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_nextObject1); - return NSObject._(_ret, _lib); - } - - NSObject? get allObjects { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_allObjects1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - static NSEnumerator new1(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSEnumerator1, _lib._sel_new1); - return NSEnumerator._(_ret, _lib); - } - - static NSEnumerator alloc(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSEnumerator1, _lib._sel_alloc1); - return NSEnumerator._(_ret, _lib); - } -} - -abstract class NSCollectionChangeType { - static const int NSCollectionChangeInsert = 0; - static const int NSCollectionChangeRemove = 1; -} - -class NSOrderedCollectionChange extends NSObject { - NSOrderedCollectionChange._( - ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); - - static NSOrderedCollectionChange castFrom(T other) { - return NSOrderedCollectionChange._(other._id, other._lib); - } - - static NSOrderedCollectionChange castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return NSOrderedCollectionChange._(other, lib); - } - - NSObject get object { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_object1); - return NSObject._(_ret, _lib); - } - - int get changeType { - return _lib._objc_msgSend_105(_id, _lib._sel_changeType1); - } - - int get index { - return _lib._objc_msgSend_11(_id, _lib._sel_index1); - } - - int get associatedIndex { - return _lib._objc_msgSend_11(_id, _lib._sel_associatedIndex1); - } - - @override - NSObject init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSObject._(_ret, _lib); - } - - NSOrderedCollectionChange initWithObject_type_index_( - NSObject anObject, int type, int index) { - final _ret = _lib._objc_msgSend_106( - _id, _lib._sel_initWithObject_type_index_1, anObject._id, type, index); - return NSOrderedCollectionChange._(_ret, _lib); - } - - NSOrderedCollectionChange initWithObject_type_index_associatedIndex_( - NSObject anObject, int type, int index, int associatedIndex) { - final _ret = _lib._objc_msgSend_107( - _id, - _lib._sel_initWithObject_type_index_associatedIndex_1, - anObject._id, - type, - index, - associatedIndex); - return NSOrderedCollectionChange._(_ret, _lib); - } - - static NSOrderedCollectionChange new1(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1( - _lib._class_NSOrderedCollectionChange1, _lib._sel_new1); - return NSOrderedCollectionChange._(_ret, _lib); - } - - static NSOrderedCollectionChange alloc(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1( - _lib._class_NSOrderedCollectionChange1, _lib._sel_alloc1); - return NSOrderedCollectionChange._(_ret, _lib); - } -} - -class NSIndexSet extends NSObject { - NSIndexSet._(ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); - - static NSIndexSet castFrom(T other) { - return NSIndexSet._(other._id, other._lib); - } - - static NSIndexSet castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return NSIndexSet._(other, lib); - } - - static NSIndexSet indexSet(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSIndexSet1, _lib._sel_indexSet1); - return NSIndexSet._(_ret, _lib); - } - - static NSIndexSet indexSetWithIndex_(StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_108( - _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndex_1, value); - return NSIndexSet._(_ret, _lib); - } - - static NSIndexSet indexSetWithIndexesInRange_( - StringTestObjCLibrary _lib, NSRange range) { - final _ret = _lib._objc_msgSend_109( - _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndexesInRange_1, range); - return NSIndexSet._(_ret, _lib); - } - - NSIndexSet initWithIndexesInRange_(NSRange range) { - final _ret = - _lib._objc_msgSend_109(_id, _lib._sel_initWithIndexesInRange_1, range); - return NSIndexSet._(_ret, _lib); - } - - NSIndexSet initWithIndexSet_(NSObject? indexSet) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithIndexSet_1, indexSet?._id ?? ffi.nullptr); - return NSIndexSet._(_ret, _lib); - } - - NSIndexSet initWithIndex_(int value) { - final _ret = _lib._objc_msgSend_108(_id, _lib._sel_initWithIndex_1, value); - return NSIndexSet._(_ret, _lib); - } - - bool isEqualToIndexSet_(NSObject? indexSet) { - return _lib._objc_msgSend_4( - _id, _lib._sel_isEqualToIndexSet_1, indexSet?._id ?? ffi.nullptr); - } - - int get count { - return _lib._objc_msgSend_11(_id, _lib._sel_count1); - } - - int get firstIndex { - return _lib._objc_msgSend_11(_id, _lib._sel_firstIndex1); - } - - int get lastIndex { - return _lib._objc_msgSend_11(_id, _lib._sel_lastIndex1); - } - - int indexGreaterThanIndex_(int value) { - return _lib._objc_msgSend_44(_id, _lib._sel_indexGreaterThanIndex_1, value); - } - - int indexLessThanIndex_(int value) { - return _lib._objc_msgSend_44(_id, _lib._sel_indexLessThanIndex_1, value); - } - - int indexGreaterThanOrEqualToIndex_(int value) { - return _lib._objc_msgSend_44( - _id, _lib._sel_indexGreaterThanOrEqualToIndex_1, value); - } - - int indexLessThanOrEqualToIndex_(int value) { - return _lib._objc_msgSend_44( - _id, _lib._sel_indexLessThanOrEqualToIndex_1, value); - } - - int getIndexes_maxCount_inIndexRange_(ffi.Pointer indexBuffer, - int bufferSize, NSRangePointer range) { - return _lib._objc_msgSend_110( - _id, - _lib._sel_getIndexes_maxCount_inIndexRange_1, - indexBuffer, - bufferSize, - range); - } - - int countOfIndexesInRange_(NSRange range) { - return _lib._objc_msgSend_111( - _id, _lib._sel_countOfIndexesInRange_1, range); - } - - bool containsIndex_(int value) { - return _lib._objc_msgSend_40(_id, _lib._sel_containsIndex_1, value); - } - - bool containsIndexesInRange_(NSRange range) { - return _lib._objc_msgSend_112( - _id, _lib._sel_containsIndexesInRange_1, range); - } - - bool containsIndexes_(NSObject? indexSet) { - return _lib._objc_msgSend_4( - _id, _lib._sel_containsIndexes_1, indexSet?._id ?? ffi.nullptr); - } - - bool intersectsIndexesInRange_(NSRange range) { - return _lib._objc_msgSend_112( - _id, _lib._sel_intersectsIndexesInRange_1, range); - } - - void enumerateIndexesUsingBlock_(ObjCBlock4 block) { - _lib._objc_msgSend_113( - _id, _lib._sel_enumerateIndexesUsingBlock_1, block._impl); - } - - void enumerateIndexesWithOptions_usingBlock_(int opts, ObjCBlock4 block) { - _lib._objc_msgSend_114(_id, - _lib._sel_enumerateIndexesWithOptions_usingBlock_1, opts, block._impl); - } - - void enumerateIndexesInRange_options_usingBlock_( - NSRange range, int opts, ObjCBlock4 block) { - _lib._objc_msgSend_115( - _id, - _lib._sel_enumerateIndexesInRange_options_usingBlock_1, - range, - opts, - block._impl); - } - - int indexPassingTest_(ObjCBlock5 predicate) { - return _lib._objc_msgSend_116( - _id, _lib._sel_indexPassingTest_1, predicate._impl); - } - - int indexWithOptions_passingTest_(int opts, ObjCBlock5 predicate) { - return _lib._objc_msgSend_117( - _id, _lib._sel_indexWithOptions_passingTest_1, opts, predicate._impl); - } - - int indexInRange_options_passingTest_( - NSRange range, int opts, ObjCBlock5 predicate) { - return _lib._objc_msgSend_118( - _id, - _lib._sel_indexInRange_options_passingTest_1, - range, - opts, - predicate._impl); - } - - NSIndexSet indexesPassingTest_(ObjCBlock5 predicate) { - final _ret = _lib._objc_msgSend_119( - _id, _lib._sel_indexesPassingTest_1, predicate._impl); - return NSIndexSet._(_ret, _lib); - } - - NSIndexSet indexesWithOptions_passingTest_(int opts, ObjCBlock5 predicate) { - final _ret = _lib._objc_msgSend_120( - _id, _lib._sel_indexesWithOptions_passingTest_1, opts, predicate._impl); - return NSIndexSet._(_ret, _lib); - } - - NSIndexSet indexesInRange_options_passingTest_( - NSRange range, int opts, ObjCBlock5 predicate) { - final _ret = _lib._objc_msgSend_121( - _id, - _lib._sel_indexesInRange_options_passingTest_1, - range, - opts, - predicate._impl); - return NSIndexSet._(_ret, _lib); - } - - void enumerateRangesUsingBlock_(ObjCBlock6 block) { - _lib._objc_msgSend_122( - _id, _lib._sel_enumerateRangesUsingBlock_1, block._impl); - } - - void enumerateRangesWithOptions_usingBlock_(int opts, ObjCBlock6 block) { - _lib._objc_msgSend_123(_id, - _lib._sel_enumerateRangesWithOptions_usingBlock_1, opts, block._impl); - } - - void enumerateRangesInRange_options_usingBlock_( - NSRange range, int opts, ObjCBlock6 block) { - _lib._objc_msgSend_124( - _id, - _lib._sel_enumerateRangesInRange_options_usingBlock_1, - range, - opts, - block._impl); - } - - static NSIndexSet new1(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSIndexSet1, _lib._sel_new1); - return NSIndexSet._(_ret, _lib); - } - - static NSIndexSet alloc(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSIndexSet1, _lib._sel_alloc1); - return NSIndexSet._(_ret, _lib); - } -} - -void _ObjCBlock4_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - NSUInteger arg0, ffi.Pointer arg1)>>() - .asFunction arg1)>()( - arg0, arg1); -} - -class ObjCBlock4 { - final ffi.Pointer<_ObjCBlock> _impl; - final StringTestObjCLibrary _lib; - ObjCBlock4._(this._impl, this._lib); - - ObjCBlock4.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - NSUInteger arg0, ffi.Pointer arg1)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - NSUInteger arg0, ffi.Pointer arg1)>( - _ObjCBlock4_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -int _ObjCBlock5_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Uint8 Function( - NSUInteger arg0, ffi.Pointer arg1)>>() - .asFunction arg1)>()( - arg0, arg1); -} - -class ObjCBlock5 { - final ffi.Pointer<_ObjCBlock> _impl; - final StringTestObjCLibrary _lib; - ObjCBlock5._(this._impl, this._lib); - - ObjCBlock5.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Uint8 Function( - NSUInteger arg0, ffi.Pointer arg1)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Uint8 Function(ffi.Pointer<_ObjCBlock> block, - NSUInteger arg0, ffi.Pointer arg1)>( - _ObjCBlock5_fnPtrTrampoline, 0) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -void _ObjCBlock6_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, NSRange arg0, ffi.Pointer arg1) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(NSRange arg0, ffi.Pointer arg1)>>() - .asFunction< - void Function( - NSRange arg0, ffi.Pointer arg1)>()(arg0, arg1); -} - -class ObjCBlock6 { - final ffi.Pointer<_ObjCBlock> _impl; - final StringTestObjCLibrary _lib; - ObjCBlock6._(this._impl, this._lib); - - ObjCBlock6.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(NSRange arg0, ffi.Pointer arg1)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - NSRange arg0, ffi.Pointer arg1)>( - _ObjCBlock6_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -class NSMutableIndexSet extends NSIndexSet { - NSMutableIndexSet._(ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); - - static NSMutableIndexSet castFrom(T other) { - return NSMutableIndexSet._(other._id, other._lib); - } - - static NSMutableIndexSet castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return NSMutableIndexSet._(other, lib); - } - - void addIndexes_(NSObject? indexSet) { - _lib._objc_msgSend_8( - _id, _lib._sel_addIndexes_1, indexSet?._id ?? ffi.nullptr); - } - - void removeIndexes_(NSObject? indexSet) { - _lib._objc_msgSend_8( - _id, _lib._sel_removeIndexes_1, indexSet?._id ?? ffi.nullptr); - } - - void removeAllIndexes() { - _lib._objc_msgSend_0(_id, _lib._sel_removeAllIndexes1); - } - - void addIndex_(int value) { - _lib._objc_msgSend_41(_id, _lib._sel_addIndex_1, value); - } - - void removeIndex_(int value) { - _lib._objc_msgSend_41(_id, _lib._sel_removeIndex_1, value); - } - - void addIndexesInRange_(NSRange range) { - _lib._objc_msgSend_125(_id, _lib._sel_addIndexesInRange_1, range); - } - - void removeIndexesInRange_(NSRange range) { - _lib._objc_msgSend_125(_id, _lib._sel_removeIndexesInRange_1, range); - } - - void shiftIndexesStartingAtIndex_by_(int index, int delta) { - _lib._objc_msgSend_126( - _id, _lib._sel_shiftIndexesStartingAtIndex_by_1, index, delta); - } - - static NSMutableIndexSet indexSet(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1( - _lib._class_NSMutableIndexSet1, _lib._sel_indexSet1); - return NSMutableIndexSet._(_ret, _lib); - } - - static NSMutableIndexSet indexSetWithIndex_( - StringTestObjCLibrary _lib, int value) { - final _ret = _lib._objc_msgSend_108( - _lib._class_NSMutableIndexSet1, _lib._sel_indexSetWithIndex_1, value); - return NSMutableIndexSet._(_ret, _lib); - } - - static NSMutableIndexSet indexSetWithIndexesInRange_( - StringTestObjCLibrary _lib, NSRange range) { - final _ret = _lib._objc_msgSend_109(_lib._class_NSMutableIndexSet1, - _lib._sel_indexSetWithIndexesInRange_1, range); - return NSMutableIndexSet._(_ret, _lib); - } - - static NSMutableIndexSet new1(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSMutableIndexSet1, _lib._sel_new1); - return NSMutableIndexSet._(_ret, _lib); - } - - static NSMutableIndexSet alloc(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSMutableIndexSet1, _lib._sel_alloc1); - return NSMutableIndexSet._(_ret, _lib); - } -} - -abstract class NSOrderedCollectionDifferenceCalculationOptions { - static const int NSOrderedCollectionDifferenceCalculationOmitInsertedObjects = - 1; - static const int NSOrderedCollectionDifferenceCalculationOmitRemovedObjects = - 2; - static const int NSOrderedCollectionDifferenceCalculationInferMoves = 4; -} - -class NSOrderedCollectionDifference extends NSObject { - NSOrderedCollectionDifference._( - ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); - - static NSOrderedCollectionDifference castFrom( - T other) { - return NSOrderedCollectionDifference._(other._id, other._lib); - } - - static NSOrderedCollectionDifference castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return NSOrderedCollectionDifference._(other, lib); - } - - NSOrderedCollectionDifference initWithChanges_(NSObject? changes) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithChanges_1, changes?._id ?? ffi.nullptr); - return NSOrderedCollectionDifference._(_ret, _lib); - } - - NSOrderedCollectionDifference - initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges_( - NSObject? inserts, - NSObject? insertedObjects, - NSObject? removes, - NSObject? removedObjects, - NSObject? changes) { - final _ret = _lib._objc_msgSend_127( - _id, - _lib._sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges_1, - inserts?._id ?? ffi.nullptr, - insertedObjects?._id ?? ffi.nullptr, - removes?._id ?? ffi.nullptr, - removedObjects?._id ?? ffi.nullptr, - changes?._id ?? ffi.nullptr); - return NSOrderedCollectionDifference._(_ret, _lib); - } - - NSOrderedCollectionDifference - initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_( - NSObject? inserts, - NSObject? insertedObjects, - NSObject? removes, - NSObject? removedObjects) { - final _ret = _lib._objc_msgSend_128( - _id, - _lib._sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_1, - inserts?._id ?? ffi.nullptr, - insertedObjects?._id ?? ffi.nullptr, - removes?._id ?? ffi.nullptr, - removedObjects?._id ?? ffi.nullptr); - return NSOrderedCollectionDifference._(_ret, _lib); - } - - NSObject? get insertions { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_insertions1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSObject? get removals { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_removals1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - bool get hasChanges { - return _lib._objc_msgSend_10(_id, _lib._sel_hasChanges1); - } - - NSOrderedCollectionDifference inverseDifference() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_inverseDifference1); - return NSOrderedCollectionDifference._(_ret, _lib); - } - - static NSOrderedCollectionDifference new1(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1( - _lib._class_NSOrderedCollectionDifference1, _lib._sel_new1); - return NSOrderedCollectionDifference._(_ret, _lib); - } - - static NSOrderedCollectionDifference alloc(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1( - _lib._class_NSOrderedCollectionDifference1, _lib._sel_alloc1); - return NSOrderedCollectionDifference._(_ret, _lib); - } -} - -class NSArray extends NSObject { - NSArray._(ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); - - static NSArray castFrom(T other) { - return NSArray._(other._id, other._lib); - } - - static NSArray castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return NSArray._(other, lib); - } - - int get count { - return _lib._objc_msgSend_11(_id, _lib._sel_count1); - } - - NSObject objectAtIndex_(int index) { - final _ret = _lib._objc_msgSend_108(_id, _lib._sel_objectAtIndex_1, index); - return NSObject._(_ret, _lib); - } - - @override - NSArray init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSArray._(_ret, _lib); - } - - NSArray initWithObjects_count_( - ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_129( - _id, _lib._sel_initWithObjects_count_1, objects, cnt); - return NSArray._(_ret, _lib); - } - - NSArray initWithCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); - return NSArray._(_ret, _lib); - } - - NSString componentsJoinedByString_(NSObject? separator) { - final _ret = _lib._objc_msgSend_28(_id, - _lib._sel_componentsJoinedByString_1, separator?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - bool containsObject_(NSObject anObject) { - return _lib._objc_msgSend_4(_id, _lib._sel_containsObject_1, anObject._id); - } - - NSObject? get description { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_description1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - NSString descriptionWithLocale_(NSObject locale) { - final _ret = _lib._objc_msgSend_28( - _id, _lib._sel_descriptionWithLocale_1, locale._id); - return NSString._(_ret, _lib); - } - - NSString descriptionWithLocale_indent_(NSObject locale, int level) { - final _ret = _lib._objc_msgSend_130( - _id, _lib._sel_descriptionWithLocale_indent_1, locale._id, level); - return NSString._(_ret, _lib); - } - - NSObject firstObjectCommonWithArray_(NSObject? otherArray) { - final _ret = _lib._objc_msgSend_13(_id, - _lib._sel_firstObjectCommonWithArray_1, otherArray?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - void getObjects_range_( - ffi.Pointer> objects, NSRange range) { - _lib._objc_msgSend_131(_id, _lib._sel_getObjects_range_1, objects, range); - } - - int indexOfObject_(NSObject anObject) { - return _lib._objc_msgSend_132(_id, _lib._sel_indexOfObject_1, anObject._id); - } - - int indexOfObject_inRange_(NSObject anObject, NSRange range) { - return _lib._objc_msgSend_133( - _id, _lib._sel_indexOfObject_inRange_1, anObject._id, range); - } - - int indexOfObjectIdenticalTo_(NSObject anObject) { - return _lib._objc_msgSend_132( - _id, _lib._sel_indexOfObjectIdenticalTo_1, anObject._id); - } - - int indexOfObjectIdenticalTo_inRange_(NSObject anObject, NSRange range) { - return _lib._objc_msgSend_133( - _id, _lib._sel_indexOfObjectIdenticalTo_inRange_1, anObject._id, range); - } - - bool isEqualToArray_(NSObject? otherArray) { - return _lib._objc_msgSend_4( - _id, _lib._sel_isEqualToArray_1, otherArray?._id ?? ffi.nullptr); - } - - NSObject get firstObject { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_firstObject1); - return NSObject._(_ret, _lib); - } - - NSObject get lastObject { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_lastObject1); - return NSObject._(_ret, _lib); - } - - NSObject? get sortedArrayHint { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_sortedArrayHint1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - bool writeToURL_error_( - NSObject? url, ffi.Pointer> error) { - return _lib._objc_msgSend_134( - _id, _lib._sel_writeToURL_error_1, url?._id ?? ffi.nullptr, error); - } - - void makeObjectsPerformSelector_(ffi.Pointer aSelector) { - _lib._objc_msgSend_6( - _id, _lib._sel_makeObjectsPerformSelector_1, aSelector); - } - - void makeObjectsPerformSelector_withObject_( - ffi.Pointer aSelector, NSObject argument) { - _lib._objc_msgSend_135( - _id, - _lib._sel_makeObjectsPerformSelector_withObject_1, - aSelector, - argument._id); - } - - NSObject objectAtIndexedSubscript_(int idx) { - final _ret = - _lib._objc_msgSend_108(_id, _lib._sel_objectAtIndexedSubscript_1, idx); - return NSObject._(_ret, _lib); - } - - void enumerateObjectsUsingBlock_(ObjCBlock7 block) { - _lib._objc_msgSend_136( - _id, _lib._sel_enumerateObjectsUsingBlock_1, block._impl); - } - - void enumerateObjectsWithOptions_usingBlock_(int opts, ObjCBlock7 block) { - _lib._objc_msgSend_137(_id, - _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._impl); - } - - void enumerateObjectsAtIndexes_options_usingBlock_( - NSObject? s, int opts, ObjCBlock7 block) { - _lib._objc_msgSend_138( - _id, - _lib._sel_enumerateObjectsAtIndexes_options_usingBlock_1, - s?._id ?? ffi.nullptr, - opts, - block._impl); - } - - int indexOfObjectPassingTest_(ObjCBlock8 predicate) { - return _lib._objc_msgSend_139( - _id, _lib._sel_indexOfObjectPassingTest_1, predicate._impl); - } - - int indexOfObjectWithOptions_passingTest_(int opts, ObjCBlock8 predicate) { - return _lib._objc_msgSend_140( - _id, - _lib._sel_indexOfObjectWithOptions_passingTest_1, - opts, - predicate._impl); - } - - int indexOfObjectAtIndexes_options_passingTest_( - NSObject? s, int opts, ObjCBlock8 predicate) { - return _lib._objc_msgSend_141( - _id, - _lib._sel_indexOfObjectAtIndexes_options_passingTest_1, - s?._id ?? ffi.nullptr, - opts, - predicate._impl); - } - - NSIndexSet indexesOfObjectsPassingTest_(ObjCBlock8 predicate) { - final _ret = _lib._objc_msgSend_142( - _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._impl); - return NSIndexSet._(_ret, _lib); - } - - NSIndexSet indexesOfObjectsWithOptions_passingTest_( - int opts, ObjCBlock8 predicate) { - final _ret = _lib._objc_msgSend_143( - _id, - _lib._sel_indexesOfObjectsWithOptions_passingTest_1, - opts, - predicate._impl); - return NSIndexSet._(_ret, _lib); - } - - NSIndexSet indexesOfObjectsAtIndexes_options_passingTest_( - NSObject? s, int opts, ObjCBlock8 predicate) { - final _ret = _lib._objc_msgSend_144( - _id, - _lib._sel_indexesOfObjectsAtIndexes_options_passingTest_1, - s?._id ?? ffi.nullptr, - opts, - predicate._impl); - return NSIndexSet._(_ret, _lib); - } - - int indexOfObject_inSortedRange_options_usingComparator_( - NSObject obj, NSRange r, int opts, NSComparator cmp) { - return _lib._objc_msgSend_145( - _id, - _lib._sel_indexOfObject_inSortedRange_options_usingComparator_1, - obj._id, - r, - opts, - cmp); - } - - static NSArray array(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSArray1, _lib._sel_array1); - return NSArray._(_ret, _lib); - } - - static NSArray arrayWithObject_( - StringTestObjCLibrary _lib, NSObject anObject) { - final _ret = _lib._objc_msgSend_13( - _lib._class_NSArray1, _lib._sel_arrayWithObject_1, anObject._id); - return NSArray._(_ret, _lib); - } - - static NSArray arrayWithObjects_count_(StringTestObjCLibrary _lib, - ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_129( - _lib._class_NSArray1, _lib._sel_arrayWithObjects_count_1, objects, cnt); - return NSArray._(_ret, _lib); - } - - static NSArray arrayWithObjects_( - StringTestObjCLibrary _lib, NSObject firstObj) { - final _ret = _lib._objc_msgSend_13( - _lib._class_NSArray1, _lib._sel_arrayWithObjects_1, firstObj._id); - return NSArray._(_ret, _lib); - } - - static NSArray arrayWithArray_(StringTestObjCLibrary _lib, NSObject? array) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSArray1, - _lib._sel_arrayWithArray_1, array?._id ?? ffi.nullptr); - return NSArray._(_ret, _lib); - } - - NSArray initWithObjects_(NSObject firstObj) { - final _ret = - _lib._objc_msgSend_13(_id, _lib._sel_initWithObjects_1, firstObj._id); - return NSArray._(_ret, _lib); - } - - NSArray initWithArray_(NSObject? array) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithArray_1, array?._id ?? ffi.nullptr); - return NSArray._(_ret, _lib); - } - - NSArray initWithArray_copyItems_(NSObject? array, bool flag) { - final _ret = _lib._objc_msgSend_146(_id, - _lib._sel_initWithArray_copyItems_1, array?._id ?? ffi.nullptr, flag); - return NSArray._(_ret, _lib); - } - - void getObjects_(ffi.Pointer> objects) { - _lib._objc_msgSend_147(_id, _lib._sel_getObjects_1, objects); - } - - bool writeToFile_atomically_(NSObject? path, bool useAuxiliaryFile) { - return _lib._objc_msgSend_72(_id, _lib._sel_writeToFile_atomically_1, - path?._id ?? ffi.nullptr, useAuxiliaryFile); - } - - bool writeToURL_atomically_(NSObject? url, bool atomically) { - return _lib._objc_msgSend_72(_id, _lib._sel_writeToURL_atomically_1, - url?._id ?? ffi.nullptr, atomically); - } - - static NSArray new1(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSArray1, _lib._sel_new1); - return NSArray._(_ret, _lib); - } - - static NSArray alloc(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_NSArray1, _lib._sel_alloc1); - return NSArray._(_ret, _lib); - } -} - -void _ObjCBlock7_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, NSUInteger arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer arg0, int arg1, - ffi.Pointer arg2)>()(arg0, arg1, arg2); -} - -class ObjCBlock7 { - final ffi.Pointer<_ObjCBlock> _impl; - final StringTestObjCLibrary _lib; - ObjCBlock7._(this._impl, this._lib); - - ObjCBlock7.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - NSUInteger arg1, ffi.Pointer arg2)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSUInteger arg1, - ffi.Pointer arg2)>( - _ObjCBlock7_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -int _ObjCBlock8_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer arg0, NSUInteger arg1, - ffi.Pointer arg2)>>() - .asFunction< - int Function(ffi.Pointer arg0, int arg1, - ffi.Pointer arg2)>()(arg0, arg1, arg2); -} - -class ObjCBlock8 { - final ffi.Pointer<_ObjCBlock> _impl; - final StringTestObjCLibrary _lib; - ObjCBlock8._(this._impl, this._lib); - - ObjCBlock8.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Pointer arg0, - NSUInteger arg1, ffi.Pointer arg2)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Uint8 Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSUInteger arg1, - ffi.Pointer arg2)>( - _ObjCBlock8_fnPtrTrampoline, 0) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -abstract class NSBinarySearchingOptions { - static const int NSBinarySearchingFirstEqual = 256; - static const int NSBinarySearchingLastEqual = 512; - static const int NSBinarySearchingInsertionIndex = 1024; -} - -typedef NSComparator = ffi.Pointer<_ObjCBlock>; -int _ObjCBlock9_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, ffi.Pointer arg1) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - int Function(ffi.Pointer arg0, - ffi.Pointer arg1)>()(arg0, arg1); -} - -class ObjCBlock9 { - final ffi.Pointer<_ObjCBlock> _impl; - final StringTestObjCLibrary _lib; - ObjCBlock9._(this._impl, this._lib); - - ObjCBlock9.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Int32 Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock9_fnPtrTrampoline, 0) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -class NSMutableArray extends NSArray { - NSMutableArray._(ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); - - static NSMutableArray castFrom(T other) { - return NSMutableArray._(other._id, other._lib); - } - - static NSMutableArray castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return NSMutableArray._(other, lib); - } - - void addObject_(NSObject anObject) { - _lib._objc_msgSend_8(_id, _lib._sel_addObject_1, anObject._id); - } - - void insertObject_atIndex_(NSObject anObject, int index) { - _lib._objc_msgSend_148( - _id, _lib._sel_insertObject_atIndex_1, anObject._id, index); - } - - void removeLastObject() { - _lib._objc_msgSend_0(_id, _lib._sel_removeLastObject1); - } - - void removeObjectAtIndex_(int index) { - _lib._objc_msgSend_41(_id, _lib._sel_removeObjectAtIndex_1, index); - } - - void replaceObjectAtIndex_withObject_(int index, NSObject anObject) { - _lib._objc_msgSend_149( - _id, _lib._sel_replaceObjectAtIndex_withObject_1, index, anObject._id); - } - - @override - NSMutableArray init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSMutableArray._(_ret, _lib); - } - - NSMutableArray initWithCapacity_(int numItems) { - final _ret = - _lib._objc_msgSend_108(_id, _lib._sel_initWithCapacity_1, numItems); - return NSMutableArray._(_ret, _lib); - } - - @override - NSMutableArray initWithCoder_(NSObject? coder) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); - return NSMutableArray._(_ret, _lib); - } - - void addObjectsFromArray_(NSObject? otherArray) { - _lib._objc_msgSend_8( - _id, _lib._sel_addObjectsFromArray_1, otherArray?._id ?? ffi.nullptr); - } - - void exchangeObjectAtIndex_withObjectAtIndex_(int idx1, int idx2) { - _lib._objc_msgSend_150( - _id, _lib._sel_exchangeObjectAtIndex_withObjectAtIndex_1, idx1, idx2); - } - - void removeAllObjects() { - _lib._objc_msgSend_0(_id, _lib._sel_removeAllObjects1); - } - - void removeObject_inRange_(NSObject anObject, NSRange range) { - _lib._objc_msgSend_151( - _id, _lib._sel_removeObject_inRange_1, anObject._id, range); - } - - void removeObject_(NSObject anObject) { - _lib._objc_msgSend_8(_id, _lib._sel_removeObject_1, anObject._id); - } - - void removeObjectIdenticalTo_inRange_(NSObject anObject, NSRange range) { - _lib._objc_msgSend_151( - _id, _lib._sel_removeObjectIdenticalTo_inRange_1, anObject._id, range); - } - - void removeObjectIdenticalTo_(NSObject anObject) { - _lib._objc_msgSend_8( - _id, _lib._sel_removeObjectIdenticalTo_1, anObject._id); - } - - void removeObjectsFromIndices_numIndices_( - ffi.Pointer indices, int cnt) { - _lib._objc_msgSend_152( - _id, _lib._sel_removeObjectsFromIndices_numIndices_1, indices, cnt); - } - - void removeObjectsInArray_(NSObject? otherArray) { - _lib._objc_msgSend_8( - _id, _lib._sel_removeObjectsInArray_1, otherArray?._id ?? ffi.nullptr); - } - - void removeObjectsInRange_(NSRange range) { - _lib._objc_msgSend_125(_id, _lib._sel_removeObjectsInRange_1, range); - } - - void replaceObjectsInRange_withObjectsFromArray_range_( - NSRange range, NSObject? otherArray, NSRange otherRange) { - _lib._objc_msgSend_153( - _id, - _lib._sel_replaceObjectsInRange_withObjectsFromArray_range_1, - range, - otherArray?._id ?? ffi.nullptr, - otherRange); - } - - void replaceObjectsInRange_withObjectsFromArray_( - NSRange range, NSObject? otherArray) { - _lib._objc_msgSend_154( - _id, - _lib._sel_replaceObjectsInRange_withObjectsFromArray_1, - range, - otherArray?._id ?? ffi.nullptr); - } - - void setArray_(NSObject? otherArray) { - _lib._objc_msgSend_8( - _id, _lib._sel_setArray_1, otherArray?._id ?? ffi.nullptr); - } - - void sortUsingFunction_context_( - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>> - compare, - ffi.Pointer context) { - _lib._objc_msgSend_155( - _id, _lib._sel_sortUsingFunction_context_1, compare, context); - } - - void sortUsingSelector_(ffi.Pointer comparator) { - _lib._objc_msgSend_6(_id, _lib._sel_sortUsingSelector_1, comparator); - } - - void insertObjects_atIndexes_(NSObject? objects, NSObject? indexes) { - _lib._objc_msgSend_156(_id, _lib._sel_insertObjects_atIndexes_1, - objects?._id ?? ffi.nullptr, indexes?._id ?? ffi.nullptr); - } - - void removeObjectsAtIndexes_(NSObject? indexes) { - _lib._objc_msgSend_8( - _id, _lib._sel_removeObjectsAtIndexes_1, indexes?._id ?? ffi.nullptr); - } - - void replaceObjectsAtIndexes_withObjects_( - NSObject? indexes, NSObject? objects) { - _lib._objc_msgSend_156(_id, _lib._sel_replaceObjectsAtIndexes_withObjects_1, - indexes?._id ?? ffi.nullptr, objects?._id ?? ffi.nullptr); - } - - void setObject_atIndexedSubscript_(NSObject obj, int idx) { - _lib._objc_msgSend_148( - _id, _lib._sel_setObject_atIndexedSubscript_1, obj._id, idx); - } - - void sortUsingComparator_(NSComparator cmptr) { - _lib._objc_msgSend_157(_id, _lib._sel_sortUsingComparator_1, cmptr); - } - - void sortWithOptions_usingComparator_(int opts, NSComparator cmptr) { - _lib._objc_msgSend_158( - _id, _lib._sel_sortWithOptions_usingComparator_1, opts, cmptr); - } - - static NSMutableArray arrayWithCapacity_( - StringTestObjCLibrary _lib, int numItems) { - final _ret = _lib._objc_msgSend_108( - _lib._class_NSMutableArray1, _lib._sel_arrayWithCapacity_1, numItems); - return NSMutableArray._(_ret, _lib); - } - - void applyDifference_(NSObject? difference) { - _lib._objc_msgSend_8( - _id, _lib._sel_applyDifference_1, difference?._id ?? ffi.nullptr); - } - - static NSMutableArray array(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSMutableArray1, _lib._sel_array1); - return NSMutableArray._(_ret, _lib); - } - - static NSMutableArray arrayWithObject_( - StringTestObjCLibrary _lib, NSObject anObject) { - final _ret = _lib._objc_msgSend_13( - _lib._class_NSMutableArray1, _lib._sel_arrayWithObject_1, anObject._id); - return NSMutableArray._(_ret, _lib); - } - - static NSMutableArray arrayWithObjects_count_(StringTestObjCLibrary _lib, - ffi.Pointer> objects, int cnt) { - final _ret = _lib._objc_msgSend_129(_lib._class_NSMutableArray1, - _lib._sel_arrayWithObjects_count_1, objects, cnt); - return NSMutableArray._(_ret, _lib); - } - - static NSMutableArray arrayWithObjects_( - StringTestObjCLibrary _lib, NSObject firstObj) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableArray1, - _lib._sel_arrayWithObjects_1, firstObj._id); - return NSMutableArray._(_ret, _lib); - } - - static NSMutableArray arrayWithArray_( - StringTestObjCLibrary _lib, NSObject? array) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableArray1, - _lib._sel_arrayWithArray_1, array?._id ?? ffi.nullptr); - return NSMutableArray._(_ret, _lib); - } - - static NSMutableArray new1(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSMutableArray1, _lib._sel_new1); - return NSMutableArray._(_ret, _lib); - } - - static NSMutableArray alloc(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSMutableArray1, _lib._sel_alloc1); - return NSMutableArray._(_ret, _lib); - } -} - -abstract class NSItemProviderRepresentationVisibility { - static const int NSItemProviderRepresentationVisibilityAll = 0; - static const int NSItemProviderRepresentationVisibilityTeam = 1; - static const int NSItemProviderRepresentationVisibilityGroup = 2; - static const int NSItemProviderRepresentationVisibilityOwnProcess = 3; -} - -abstract class NSItemProviderFileOptions { - static const int NSItemProviderFileOptionOpenInPlace = 1; -} - -class NSItemProvider extends NSObject { - NSItemProvider._(ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); - - static NSItemProvider castFrom(T other) { - return NSItemProvider._(other._id, other._lib); - } - - static NSItemProvider castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return NSItemProvider._(other, lib); - } - - @override - NSItemProvider init() { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_init1); - return NSItemProvider._(_ret, _lib); - } - - void registerDataRepresentationForTypeIdentifier_visibility_loadHandler_( - NSObject? typeIdentifier, int visibility, ObjCBlock10 loadHandler) { - _lib._objc_msgSend_159( - _id, - _lib._sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1, - typeIdentifier?._id ?? ffi.nullptr, - visibility, - loadHandler._impl); - } - - void - registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_( - NSObject? typeIdentifier, - int fileOptions, - int visibility, - ObjCBlock12 loadHandler) { - _lib._objc_msgSend_160( - _id, - _lib._sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1, - typeIdentifier?._id ?? ffi.nullptr, - fileOptions, - visibility, - loadHandler._impl); - } - - NSObject? get registeredTypeIdentifiers { - final _ret = - _lib._objc_msgSend_1(_id, _lib._sel_registeredTypeIdentifiers1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - bool hasItemConformingToTypeIdentifier_(NSObject? typeIdentifier) { - return _lib._objc_msgSend_4( - _id, - _lib._sel_hasItemConformingToTypeIdentifier_1, - typeIdentifier?._id ?? ffi.nullptr); - } - - bool hasRepresentationConformingToTypeIdentifier_fileOptions_( - NSObject? typeIdentifier, int fileOptions) { - return _lib._objc_msgSend_161( - _id, - _lib._sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1, - typeIdentifier?._id ?? ffi.nullptr, - fileOptions); - } - - NSProgress loadDataRepresentationForTypeIdentifier_completionHandler_( - NSObject? typeIdentifier, ObjCBlock11 completionHandler) { - final _ret = _lib._objc_msgSend_162( - _id, - _lib._sel_loadDataRepresentationForTypeIdentifier_completionHandler_1, - typeIdentifier?._id ?? ffi.nullptr, - completionHandler._impl); - return NSProgress._(_ret, _lib); - } - - NSProgress loadFileRepresentationForTypeIdentifier_completionHandler_( - NSObject? typeIdentifier, ObjCBlock11 completionHandler) { - final _ret = _lib._objc_msgSend_162( - _id, - _lib._sel_loadFileRepresentationForTypeIdentifier_completionHandler_1, - typeIdentifier?._id ?? ffi.nullptr, - completionHandler._impl); - return NSProgress._(_ret, _lib); - } - - NSProgress loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_( - NSObject? typeIdentifier, ObjCBlock13 completionHandler) { - final _ret = _lib._objc_msgSend_163( - _id, - _lib._sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1, - typeIdentifier?._id ?? ffi.nullptr, - completionHandler._impl); - return NSProgress._(_ret, _lib); - } - - NSObject? get suggestedName { - final _ret = _lib._objc_msgSend_1(_id, _lib._sel_suggestedName1); - return _ret.address == 0 ? null : NSObject._(_ret, _lib); - } - - set suggestedName(NSObject? value) { - _lib._objc_msgSend_8( - _id, _lib._sel_setSuggestedName_1, value?._id ?? ffi.nullptr); - } - - NSItemProvider initWithObject_(NSObject? object) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithObject_1, object?._id ?? ffi.nullptr); - return NSItemProvider._(_ret, _lib); - } - - void registerObject_visibility_(NSObject? object, int visibility) { - _lib._objc_msgSend_164(_id, _lib._sel_registerObject_visibility_1, - object?._id ?? ffi.nullptr, visibility); - } - - void registerObjectOfClass_visibility_loadHandler_( - NSObject? aClass, int visibility, ObjCBlock10 loadHandler) { - _lib._objc_msgSend_159( - _id, - _lib._sel_registerObjectOfClass_visibility_loadHandler_1, - aClass?._id ?? ffi.nullptr, - visibility, - loadHandler._impl); - } - - bool canLoadObjectOfClass_(NSObject? aClass) { - return _lib._objc_msgSend_4( - _id, _lib._sel_canLoadObjectOfClass_1, aClass?._id ?? ffi.nullptr); - } - - NSProgress loadObjectOfClass_completionHandler_( - NSObject? aClass, ObjCBlock11 completionHandler) { - final _ret = _lib._objc_msgSend_162( - _id, - _lib._sel_loadObjectOfClass_completionHandler_1, - aClass?._id ?? ffi.nullptr, - completionHandler._impl); - return NSProgress._(_ret, _lib); - } - - NSItemProvider initWithItem_typeIdentifier_( - NSObject? item, NSObject? typeIdentifier) { - final _ret = _lib._objc_msgSend_58( - _id, - _lib._sel_initWithItem_typeIdentifier_1, - item?._id ?? ffi.nullptr, - typeIdentifier?._id ?? ffi.nullptr); - return NSItemProvider._(_ret, _lib); - } - - NSItemProvider initWithContentsOfURL_(NSObject? fileURL) { - final _ret = _lib._objc_msgSend_13( - _id, _lib._sel_initWithContentsOfURL_1, fileURL?._id ?? ffi.nullptr); - return NSItemProvider._(_ret, _lib); - } - - void registerItemForTypeIdentifier_loadHandler_( - NSObject? typeIdentifier, NSItemProviderLoadHandler loadHandler) { - _lib._objc_msgSend_165( - _id, - _lib._sel_registerItemForTypeIdentifier_loadHandler_1, - typeIdentifier?._id ?? ffi.nullptr, - loadHandler); - } - - void loadItemForTypeIdentifier_options_completionHandler_( - NSObject? typeIdentifier, - NSObject? options, - NSItemProviderCompletionHandler completionHandler) { - _lib._objc_msgSend_166( - _id, - _lib._sel_loadItemForTypeIdentifier_options_completionHandler_1, - typeIdentifier?._id ?? ffi.nullptr, - options?._id ?? ffi.nullptr, - completionHandler); - } - - NSItemProviderLoadHandler get previewImageHandler { - return _lib._objc_msgSend_167(_id, _lib._sel_previewImageHandler1); - } - - set previewImageHandler(NSItemProviderLoadHandler value) { - _lib._objc_msgSend_168(_id, _lib._sel_setPreviewImageHandler_1, value); - } - - void loadPreviewImageWithOptions_completionHandler_( - NSObject? options, NSItemProviderCompletionHandler completionHandler) { - _lib._objc_msgSend_169( - _id, - _lib._sel_loadPreviewImageWithOptions_completionHandler_1, - options?._id ?? ffi.nullptr, - completionHandler); - } - - static NSItemProvider new1(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSItemProvider1, _lib._sel_new1); - return NSItemProvider._(_ret, _lib); - } - - static NSItemProvider alloc(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSItemProvider1, _lib._sel_alloc1); - return NSItemProvider._(_ret, _lib); - } -} - -ffi.Pointer _ObjCBlock10_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> arg0)>()(arg0); -} - -class ObjCBlock10 { - final ffi.Pointer<_ObjCBlock> _impl; - final StringTestObjCLibrary _lib; - ObjCBlock10._(this._impl, this._lib); - - ObjCBlock10.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> arg0)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0)>( - _ObjCBlock10_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -void _ObjCBlock11_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, ffi.Pointer arg1) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>()(arg0, arg1); -} - -class ObjCBlock11 { - final ffi.Pointer<_ObjCBlock> _impl; - final StringTestObjCLibrary _lib; - ObjCBlock11._(this._impl, this._lib); - - ObjCBlock11.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : _impl = - _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock11_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -ffi.Pointer _ObjCBlock12_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> arg0)>()(arg0); -} - -class ObjCBlock12 { - final ffi.Pointer<_ObjCBlock> _impl; - final StringTestObjCLibrary _lib; - ObjCBlock12._(this._impl, this._lib); - - ObjCBlock12.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> arg0)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0)>( - _ObjCBlock12_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -void _ObjCBlock13_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, ffi.Uint8 arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer arg0, int arg1, - ffi.Pointer arg2)>()(arg0, arg1, arg2); -} - -class ObjCBlock13 { - final ffi.Pointer<_ObjCBlock> _impl; - final StringTestObjCLibrary _lib; - ObjCBlock13._(this._impl, this._lib); - - ObjCBlock13.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Uint8 arg1, ffi.Pointer arg2)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Uint8 arg1, - ffi.Pointer arg2)>( - _ObjCBlock13_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -class NSProgress extends _ObjCWrapper { - NSProgress._(ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); - - static NSProgress castFrom(T other) { - return NSProgress._(other._id, other._lib); - } - - static NSProgress castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return NSProgress._(other, lib); - } -} - -typedef NSItemProviderLoadHandler = ffi.Pointer<_ObjCBlock>; -void _ObjCBlock14_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) { - return block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>()(arg0, arg1, arg2); -} - -class ObjCBlock14 { - final ffi.Pointer<_ObjCBlock> _impl; - final StringTestObjCLibrary _lib; - ObjCBlock14._(this._impl, this._lib); - - ObjCBlock14.fromFunctionPointer( - this._lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>> - ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>( - _ObjCBlock14_fnPtrTrampoline) - .cast(), - ptr.cast()); - ffi.Pointer<_ObjCBlock> get pointer => _impl; -} - -typedef NSItemProviderCompletionHandler = ffi.Pointer<_ObjCBlock>; - -abstract class NSItemProviderErrorCode { - static const int NSItemProviderUnknownError = -1; - static const int NSItemProviderItemUnavailableError = -1000; - static const int NSItemProviderUnexpectedValueClassError = -1100; - static const int NSItemProviderUnavailableCoercionError = -1200; -} - -typedef NSStringEncodingDetectionOptionsKey = ffi.Pointer; - -class NSMutableString extends NSString { - NSMutableString._(ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); - - static NSMutableString castFrom(T other) { - return NSMutableString._(other._id, other._lib); - } - - static NSMutableString castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return NSMutableString._(other, lib); - } - - void replaceCharactersInRange_withString_(NSRange range, NSObject? aString) { - _lib._objc_msgSend_154(_id, _lib._sel_replaceCharactersInRange_withString_1, - range, aString?._id ?? ffi.nullptr); - } - - void insertString_atIndex_(NSObject? aString, int loc) { - _lib._objc_msgSend_148(_id, _lib._sel_insertString_atIndex_1, - aString?._id ?? ffi.nullptr, loc); - } - - void deleteCharactersInRange_(NSRange range) { - _lib._objc_msgSend_125(_id, _lib._sel_deleteCharactersInRange_1, range); - } - - void appendString_(NSObject? aString) { - _lib._objc_msgSend_8( - _id, _lib._sel_appendString_1, aString?._id ?? ffi.nullptr); - } - - void appendFormat_(NSObject? format) { - _lib._objc_msgSend_8( - _id, _lib._sel_appendFormat_1, format?._id ?? ffi.nullptr); - } - - void setString_(NSObject? aString) { - _lib._objc_msgSend_8( - _id, _lib._sel_setString_1, aString?._id ?? ffi.nullptr); - } - - int replaceOccurrencesOfString_withString_options_range_(NSObject? target, - NSObject? replacement, int options, NSRange searchRange) { - return _lib._objc_msgSend_170( - _id, - _lib._sel_replaceOccurrencesOfString_withString_options_range_1, - target?._id ?? ffi.nullptr, - replacement?._id ?? ffi.nullptr, - options, - searchRange); - } - - bool applyTransform_reverse_range_updatedRange_(NSStringTransform transform, - bool reverse, NSRange range, NSRangePointer resultingRange) { - return _lib._objc_msgSend_171( - _id, - _lib._sel_applyTransform_reverse_range_updatedRange_1, - transform, - reverse, - range, - resultingRange); - } - - NSMutableString initWithCapacity_(int capacity) { - final _ret = - _lib._objc_msgSend_172(_id, _lib._sel_initWithCapacity_1, capacity); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString stringWithCapacity_( - StringTestObjCLibrary _lib, int capacity) { - final _ret = _lib._objc_msgSend_172( - _lib._class_NSMutableString1, _lib._sel_stringWithCapacity_1, capacity); - return NSMutableString._(_ret, _lib); - } - - static ffi.Pointer getAvailableStringEncodings( - StringTestObjCLibrary _lib) { - return _lib._objc_msgSend_45( - _lib._class_NSMutableString1, _lib._sel_availableStringEncodings1); - } - - static NSString localizedNameOfStringEncoding_( - StringTestObjCLibrary _lib, int encoding) { - final _ret = _lib._objc_msgSend_14(_lib._class_NSMutableString1, - _lib._sel_localizedNameOfStringEncoding_1, encoding); - return NSString._(_ret, _lib); - } - - static int getDefaultCStringEncoding(StringTestObjCLibrary _lib) { - return _lib._objc_msgSend_11( - _lib._class_NSMutableString1, _lib._sel_defaultCStringEncoding1); - } - - static NSMutableString string(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSMutableString1, _lib._sel_string1); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString stringWithString_( - StringTestObjCLibrary _lib, NSObject? string) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, - _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString stringWithCharacters_length_( - StringTestObjCLibrary _lib, ffi.Pointer characters, int length) { - final _ret = _lib._objc_msgSend_55(_lib._class_NSMutableString1, - _lib._sel_stringWithCharacters_length_1, characters, length); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString stringWithUTF8String_(StringTestObjCLibrary _lib, - ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_56(_lib._class_NSMutableString1, - _lib._sel_stringWithUTF8String_1, nullTerminatedCString); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString stringWithFormat_( - StringTestObjCLibrary _lib, NSObject? format) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, - _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString localizedStringWithFormat_( - StringTestObjCLibrary _lib, NSObject? format) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, - _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString stringWithCString_encoding_( - StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_64(_lib._class_NSMutableString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString stringWithContentsOfURL_encoding_error_( - StringTestObjCLibrary _lib, - NSObject? url, - int enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( - _lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfURL_encoding_error_1, - url?._id ?? ffi.nullptr, - enc, - error); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString stringWithContentsOfFile_encoding_error_( - StringTestObjCLibrary _lib, - NSObject? path, - int enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( - _lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfFile_encoding_error_1, - path?._id ?? ffi.nullptr, - enc, - error); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString stringWithContentsOfURL_usedEncoding_error_( - StringTestObjCLibrary _lib, - NSObject? url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_66( - _lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, - url?._id ?? ffi.nullptr, - enc, - error); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString stringWithContentsOfFile_usedEncoding_error_( - StringTestObjCLibrary _lib, - NSObject? path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_66( - _lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, - path?._id ?? ffi.nullptr, - enc, - error); - return NSMutableString._(_ret, _lib); - } - - static int - stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( - StringTestObjCLibrary _lib, - NSObject? data, - NSObject? opts, - ffi.Pointer> string, - ffi.Pointer usedLossyConversion) { - return _lib._objc_msgSend_67( - _lib._class_NSMutableString1, - _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, - data?._id ?? ffi.nullptr, - opts?._id ?? ffi.nullptr, - string, - usedLossyConversion); - } - - static NSObject stringWithContentsOfFile_( - StringTestObjCLibrary _lib, NSObject? path) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static NSObject stringWithContentsOfURL_( - StringTestObjCLibrary _lib, NSObject? url) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static NSObject stringWithCString_length_( - StringTestObjCLibrary _lib, ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_64(_lib._class_NSMutableString1, - _lib._sel_stringWithCString_length_1, bytes, length); - return NSObject._(_ret, _lib); - } - - static NSObject stringWithCString_( - StringTestObjCLibrary _lib, ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_56( - _lib._class_NSMutableString1, _lib._sel_stringWithCString_1, bytes); - return NSObject._(_ret, _lib); - } - - static NSMutableString new1(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSMutableString1, _lib._sel_new1); - return NSMutableString._(_ret, _lib); - } - - static NSMutableString alloc(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSMutableString1, _lib._sel_alloc1); - return NSMutableString._(_ret, _lib); - } -} - -typedef NSExceptionName = ffi.Pointer; - -class NSSimpleCString extends NSString { - NSSimpleCString._(ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); - - static NSSimpleCString castFrom(T other) { - return NSSimpleCString._(other._id, other._lib); - } - - static NSSimpleCString castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return NSSimpleCString._(other, lib); - } - - static ffi.Pointer getAvailableStringEncodings( - StringTestObjCLibrary _lib) { - return _lib._objc_msgSend_45( - _lib._class_NSSimpleCString1, _lib._sel_availableStringEncodings1); - } - - static NSString localizedNameOfStringEncoding_( - StringTestObjCLibrary _lib, int encoding) { - final _ret = _lib._objc_msgSend_14(_lib._class_NSSimpleCString1, - _lib._sel_localizedNameOfStringEncoding_1, encoding); - return NSString._(_ret, _lib); - } - - static int getDefaultCStringEncoding(StringTestObjCLibrary _lib) { - return _lib._objc_msgSend_11( - _lib._class_NSSimpleCString1, _lib._sel_defaultCStringEncoding1); - } - - static NSSimpleCString string(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSSimpleCString1, _lib._sel_string1); - return NSSimpleCString._(_ret, _lib); - } - - static NSSimpleCString stringWithString_( - StringTestObjCLibrary _lib, NSObject? string) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSSimpleCString1, - _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); - return NSSimpleCString._(_ret, _lib); - } - - static NSSimpleCString stringWithCharacters_length_( - StringTestObjCLibrary _lib, ffi.Pointer characters, int length) { - final _ret = _lib._objc_msgSend_55(_lib._class_NSSimpleCString1, - _lib._sel_stringWithCharacters_length_1, characters, length); - return NSSimpleCString._(_ret, _lib); - } - - static NSSimpleCString stringWithUTF8String_(StringTestObjCLibrary _lib, - ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_56(_lib._class_NSSimpleCString1, - _lib._sel_stringWithUTF8String_1, nullTerminatedCString); - return NSSimpleCString._(_ret, _lib); - } - - static NSSimpleCString stringWithFormat_( - StringTestObjCLibrary _lib, NSObject? format) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSSimpleCString1, - _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); - return NSSimpleCString._(_ret, _lib); - } - - static NSSimpleCString localizedStringWithFormat_( - StringTestObjCLibrary _lib, NSObject? format) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSSimpleCString1, - _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); - return NSSimpleCString._(_ret, _lib); - } - - static NSSimpleCString stringWithCString_encoding_( - StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_64(_lib._class_NSSimpleCString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return NSSimpleCString._(_ret, _lib); - } - - static NSSimpleCString stringWithContentsOfURL_encoding_error_( - StringTestObjCLibrary _lib, - NSObject? url, - int enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( - _lib._class_NSSimpleCString1, - _lib._sel_stringWithContentsOfURL_encoding_error_1, - url?._id ?? ffi.nullptr, - enc, - error); - return NSSimpleCString._(_ret, _lib); - } - - static NSSimpleCString stringWithContentsOfFile_encoding_error_( - StringTestObjCLibrary _lib, - NSObject? path, - int enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( - _lib._class_NSSimpleCString1, - _lib._sel_stringWithContentsOfFile_encoding_error_1, - path?._id ?? ffi.nullptr, - enc, - error); - return NSSimpleCString._(_ret, _lib); - } - - static NSSimpleCString stringWithContentsOfURL_usedEncoding_error_( - StringTestObjCLibrary _lib, - NSObject? url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_66( - _lib._class_NSSimpleCString1, - _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, - url?._id ?? ffi.nullptr, - enc, - error); - return NSSimpleCString._(_ret, _lib); - } - - static NSSimpleCString stringWithContentsOfFile_usedEncoding_error_( - StringTestObjCLibrary _lib, - NSObject? path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_66( - _lib._class_NSSimpleCString1, - _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, - path?._id ?? ffi.nullptr, - enc, - error); - return NSSimpleCString._(_ret, _lib); - } - - static int - stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( - StringTestObjCLibrary _lib, - NSObject? data, - NSObject? opts, - ffi.Pointer> string, - ffi.Pointer usedLossyConversion) { - return _lib._objc_msgSend_67( - _lib._class_NSSimpleCString1, - _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, - data?._id ?? ffi.nullptr, - opts?._id ?? ffi.nullptr, - string, - usedLossyConversion); - } - - static NSObject stringWithContentsOfFile_( - StringTestObjCLibrary _lib, NSObject? path) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSSimpleCString1, - _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static NSObject stringWithContentsOfURL_( - StringTestObjCLibrary _lib, NSObject? url) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSSimpleCString1, - _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static NSObject stringWithCString_length_( - StringTestObjCLibrary _lib, ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_64(_lib._class_NSSimpleCString1, - _lib._sel_stringWithCString_length_1, bytes, length); - return NSObject._(_ret, _lib); - } - - static NSObject stringWithCString_( - StringTestObjCLibrary _lib, ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_56( - _lib._class_NSSimpleCString1, _lib._sel_stringWithCString_1, bytes); - return NSObject._(_ret, _lib); - } - - static NSSimpleCString new1(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSSimpleCString1, _lib._sel_new1); - return NSSimpleCString._(_ret, _lib); - } - - static NSSimpleCString alloc(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSSimpleCString1, _lib._sel_alloc1); - return NSSimpleCString._(_ret, _lib); - } -} - -class NSConstantString extends NSSimpleCString { - NSConstantString._(ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); - - static NSConstantString castFrom(T other) { - return NSConstantString._(other._id, other._lib); - } - - static NSConstantString castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return NSConstantString._(other, lib); - } - - static ffi.Pointer getAvailableStringEncodings( - StringTestObjCLibrary _lib) { - return _lib._objc_msgSend_45( - _lib._class_NSConstantString1, _lib._sel_availableStringEncodings1); - } - - static NSString localizedNameOfStringEncoding_( - StringTestObjCLibrary _lib, int encoding) { - final _ret = _lib._objc_msgSend_14(_lib._class_NSConstantString1, - _lib._sel_localizedNameOfStringEncoding_1, encoding); - return NSString._(_ret, _lib); - } - - static int getDefaultCStringEncoding(StringTestObjCLibrary _lib) { - return _lib._objc_msgSend_11( - _lib._class_NSConstantString1, _lib._sel_defaultCStringEncoding1); - } - - static NSConstantString string(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSConstantString1, _lib._sel_string1); - return NSConstantString._(_ret, _lib); - } - - static NSConstantString stringWithString_( - StringTestObjCLibrary _lib, NSObject? string) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSConstantString1, - _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); - return NSConstantString._(_ret, _lib); - } - - static NSConstantString stringWithCharacters_length_( - StringTestObjCLibrary _lib, ffi.Pointer characters, int length) { - final _ret = _lib._objc_msgSend_55(_lib._class_NSConstantString1, - _lib._sel_stringWithCharacters_length_1, characters, length); - return NSConstantString._(_ret, _lib); - } - - static NSConstantString stringWithUTF8String_(StringTestObjCLibrary _lib, - ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_56(_lib._class_NSConstantString1, - _lib._sel_stringWithUTF8String_1, nullTerminatedCString); - return NSConstantString._(_ret, _lib); - } - - static NSConstantString stringWithFormat_( - StringTestObjCLibrary _lib, NSObject? format) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSConstantString1, - _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); - return NSConstantString._(_ret, _lib); - } - - static NSConstantString localizedStringWithFormat_( - StringTestObjCLibrary _lib, NSObject? format) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSConstantString1, - _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); - return NSConstantString._(_ret, _lib); - } - - static NSConstantString stringWithCString_encoding_( - StringTestObjCLibrary _lib, ffi.Pointer cString, int enc) { - final _ret = _lib._objc_msgSend_64(_lib._class_NSConstantString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return NSConstantString._(_ret, _lib); - } - - static NSConstantString stringWithContentsOfURL_encoding_error_( - StringTestObjCLibrary _lib, - NSObject? url, - int enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( - _lib._class_NSConstantString1, - _lib._sel_stringWithContentsOfURL_encoding_error_1, - url?._id ?? ffi.nullptr, - enc, - error); - return NSConstantString._(_ret, _lib); - } - - static NSConstantString stringWithContentsOfFile_encoding_error_( - StringTestObjCLibrary _lib, - NSObject? path, - int enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_65( - _lib._class_NSConstantString1, - _lib._sel_stringWithContentsOfFile_encoding_error_1, - path?._id ?? ffi.nullptr, - enc, - error); - return NSConstantString._(_ret, _lib); - } - - static NSConstantString stringWithContentsOfURL_usedEncoding_error_( - StringTestObjCLibrary _lib, - NSObject? url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_66( - _lib._class_NSConstantString1, - _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, - url?._id ?? ffi.nullptr, - enc, - error); - return NSConstantString._(_ret, _lib); - } - - static NSConstantString stringWithContentsOfFile_usedEncoding_error_( - StringTestObjCLibrary _lib, - NSObject? path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_66( - _lib._class_NSConstantString1, - _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, - path?._id ?? ffi.nullptr, - enc, - error); - return NSConstantString._(_ret, _lib); - } - - static int - stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( - StringTestObjCLibrary _lib, - NSObject? data, - NSObject? opts, - ffi.Pointer> string, - ffi.Pointer usedLossyConversion) { - return _lib._objc_msgSend_67( - _lib._class_NSConstantString1, - _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, - data?._id ?? ffi.nullptr, - opts?._id ?? ffi.nullptr, - string, - usedLossyConversion); - } - - static NSObject stringWithContentsOfFile_( - StringTestObjCLibrary _lib, NSObject? path) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSConstantString1, - _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static NSObject stringWithContentsOfURL_( - StringTestObjCLibrary _lib, NSObject? url) { - final _ret = _lib._objc_msgSend_13(_lib._class_NSConstantString1, - _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib); - } - - static NSObject stringWithCString_length_( - StringTestObjCLibrary _lib, ffi.Pointer bytes, int length) { - final _ret = _lib._objc_msgSend_64(_lib._class_NSConstantString1, - _lib._sel_stringWithCString_length_1, bytes, length); - return NSObject._(_ret, _lib); - } - - static NSObject stringWithCString_( - StringTestObjCLibrary _lib, ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_56( - _lib._class_NSConstantString1, _lib._sel_stringWithCString_1, bytes); - return NSObject._(_ret, _lib); - } - - static NSConstantString new1(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSConstantString1, _lib._sel_new1); - return NSConstantString._(_ret, _lib); - } - - static NSConstantString alloc(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_NSConstantString1, _lib._sel_alloc1); - return NSConstantString._(_ret, _lib); - } -} - -class StringUtil extends NSObject { - StringUtil._(ffi.Pointer id, StringTestObjCLibrary lib) - : super._(id, lib); - - static StringUtil castFrom(T other) { - return StringUtil._(other._id, other._lib); - } - - static StringUtil castFromPointer( - StringTestObjCLibrary lib, ffi.Pointer other) { - return StringUtil._(other, lib); - } - - static NSString strConcat_with_( - StringTestObjCLibrary _lib, NSObject? a, NSObject? b) { - final _ret = _lib._objc_msgSend_49( - _lib._class_StringUtil1, - _lib._sel_strConcat_with_1, - a?._id ?? ffi.nullptr, - b?._id ?? ffi.nullptr); - return NSString._(_ret, _lib); - } - - static StringUtil new1(StringTestObjCLibrary _lib) { - final _ret = _lib._objc_msgSend_1(_lib._class_StringUtil1, _lib._sel_new1); - return StringUtil._(_ret, _lib); - } - - static StringUtil alloc(StringTestObjCLibrary _lib) { - final _ret = - _lib._objc_msgSend_1(_lib._class_StringUtil1, _lib._sel_alloc1); - return StringUtil._(_ret, _lib); - } -} - -const int NSScannedOption = 1; - -const int NSCollectorDisabledOption = 2; - -const int NSASCIIStringEncoding = 1; - -const int NSNEXTSTEPStringEncoding = 2; - -const int NSJapaneseEUCStringEncoding = 3; - -const int NSUTF8StringEncoding = 4; - -const int NSISOLatin1StringEncoding = 5; - -const int NSSymbolStringEncoding = 6; - -const int NSNonLossyASCIIStringEncoding = 7; - -const int NSShiftJISStringEncoding = 8; - -const int NSISOLatin2StringEncoding = 9; - -const int NSUnicodeStringEncoding = 10; - -const int NSWindowsCP1251StringEncoding = 11; - -const int NSWindowsCP1252StringEncoding = 12; - -const int NSWindowsCP1253StringEncoding = 13; - -const int NSWindowsCP1254StringEncoding = 14; - -const int NSWindowsCP1250StringEncoding = 15; - -const int NSISO2022JPStringEncoding = 21; - -const int NSMacOSRomanStringEncoding = 30; - -const int NSUTF16StringEncoding = 10; - -const int NSUTF16BigEndianStringEncoding = 2415919360; - -const int NSUTF16LittleEndianStringEncoding = 2483028224; - -const int NSUTF32StringEncoding = 2348810496; - -const int NSUTF32BigEndianStringEncoding = 2550137088; - -const int NSUTF32LittleEndianStringEncoding = 2617245952; - -const int NSProprietaryStringEncoding = 65536; - -const int NS_BLOCKS_AVAILABLE = 1; - -const int __COREFOUNDATION_CFAVAILABILITY__ = 1; - -const int __CF_ENUM_FIXED_IS_AVAILABLE = 1; - -const double NSFoundationVersionNumber10_0 = 397.4; - -const double NSFoundationVersionNumber10_1 = 425.0; - -const double NSFoundationVersionNumber10_1_1 = 425.0; - -const double NSFoundationVersionNumber10_1_2 = 425.0; - -const double NSFoundationVersionNumber10_1_3 = 425.0; - -const double NSFoundationVersionNumber10_1_4 = 425.0; - -const double NSFoundationVersionNumber10_2 = 462.0; - -const double NSFoundationVersionNumber10_2_1 = 462.0; - -const double NSFoundationVersionNumber10_2_2 = 462.0; - -const double NSFoundationVersionNumber10_2_3 = 462.0; - -const double NSFoundationVersionNumber10_2_4 = 462.0; - -const double NSFoundationVersionNumber10_2_5 = 462.0; - -const double NSFoundationVersionNumber10_2_6 = 462.0; - -const double NSFoundationVersionNumber10_2_7 = 462.7; - -const double NSFoundationVersionNumber10_2_8 = 462.7; - -const double NSFoundationVersionNumber10_3 = 500.0; - -const double NSFoundationVersionNumber10_3_1 = 500.0; - -const double NSFoundationVersionNumber10_3_2 = 500.3; - -const double NSFoundationVersionNumber10_3_3 = 500.54; - -const double NSFoundationVersionNumber10_3_4 = 500.56; - -const double NSFoundationVersionNumber10_3_5 = 500.56; - -const double NSFoundationVersionNumber10_3_6 = 500.56; - -const double NSFoundationVersionNumber10_3_7 = 500.56; - -const double NSFoundationVersionNumber10_3_8 = 500.56; - -const double NSFoundationVersionNumber10_3_9 = 500.58; - -const double NSFoundationVersionNumber10_4 = 567.0; - -const double NSFoundationVersionNumber10_4_1 = 567.0; - -const double NSFoundationVersionNumber10_4_2 = 567.12; - -const double NSFoundationVersionNumber10_4_3 = 567.21; - -const double NSFoundationVersionNumber10_4_4_Intel = 567.23; - -const double NSFoundationVersionNumber10_4_4_PowerPC = 567.21; - -const double NSFoundationVersionNumber10_4_5 = 567.25; - -const double NSFoundationVersionNumber10_4_6 = 567.26; - -const double NSFoundationVersionNumber10_4_7 = 567.27; - -const double NSFoundationVersionNumber10_4_8 = 567.28; - -const double NSFoundationVersionNumber10_4_9 = 567.29; - -const double NSFoundationVersionNumber10_4_10 = 567.29; - -const double NSFoundationVersionNumber10_4_11 = 567.36; - -const double NSFoundationVersionNumber10_5 = 677.0; - -const double NSFoundationVersionNumber10_5_1 = 677.1; - -const double NSFoundationVersionNumber10_5_2 = 677.15; - -const double NSFoundationVersionNumber10_5_3 = 677.19; - -const double NSFoundationVersionNumber10_5_4 = 677.19; - -const double NSFoundationVersionNumber10_5_5 = 677.21; - -const double NSFoundationVersionNumber10_5_6 = 677.22; - -const double NSFoundationVersionNumber10_5_7 = 677.24; - -const double NSFoundationVersionNumber10_5_8 = 677.26; - -const double NSFoundationVersionNumber10_6 = 751.0; - -const double NSFoundationVersionNumber10_6_1 = 751.0; - -const double NSFoundationVersionNumber10_6_2 = 751.14; - -const double NSFoundationVersionNumber10_6_3 = 751.21; - -const double NSFoundationVersionNumber10_6_4 = 751.29; - -const double NSFoundationVersionNumber10_6_5 = 751.42; - -const double NSFoundationVersionNumber10_6_6 = 751.53; - -const double NSFoundationVersionNumber10_6_7 = 751.53; - -const double NSFoundationVersionNumber10_6_8 = 751.62; - -const double NSFoundationVersionNumber10_7 = 833.1; - -const double NSFoundationVersionNumber10_7_1 = 833.1; - -const double NSFoundationVersionNumber10_7_2 = 833.2; - -const double NSFoundationVersionNumber10_7_3 = 833.24; - -const double NSFoundationVersionNumber10_7_4 = 833.25; - -const double NSFoundationVersionNumber10_8 = 945.0; - -const double NSFoundationVersionNumber10_8_1 = 945.0; - -const double NSFoundationVersionNumber10_8_2 = 945.11; - -const double NSFoundationVersionNumber10_8_3 = 945.16; - -const double NSFoundationVersionNumber10_8_4 = 945.18; - -const int NSFoundationVersionNumber10_9 = 1056; - -const int NSFoundationVersionNumber10_9_1 = 1056; - -const double NSFoundationVersionNumber10_9_2 = 1056.13; - -const double NSFoundationVersionNumber10_10 = 1151.16; - -const double NSFoundationVersionNumber10_10_1 = 1151.16; - -const double NSFoundationVersionNumber10_10_2 = 1152.14; - -const double NSFoundationVersionNumber10_10_3 = 1153.2; - -const double NSFoundationVersionNumber10_10_4 = 1153.2; - -const int NSFoundationVersionNumber10_10_5 = 1154; - -const int NSFoundationVersionNumber10_10_Max = 1199; - -const int NSFoundationVersionNumber10_11 = 1252; - -const double NSFoundationVersionNumber10_11_1 = 1255.1; - -const double NSFoundationVersionNumber10_11_2 = 1256.1; - -const double NSFoundationVersionNumber10_11_3 = 1256.1; - -const int NSFoundationVersionNumber10_11_4 = 1258; - -const int NSFoundationVersionNumber10_11_Max = 1299; - -const int __COREFOUNDATION_CFBASE__ = 1; - -const int TRUE = 1; - -const int FALSE = 0; - -const double kCFCoreFoundationVersionNumber10_0 = 196.4; - -const double kCFCoreFoundationVersionNumber10_0_3 = 196.5; - -const double kCFCoreFoundationVersionNumber10_1 = 226.0; - -const double kCFCoreFoundationVersionNumber10_1_1 = 226.0; - -const double kCFCoreFoundationVersionNumber10_1_2 = 227.2; - -const double kCFCoreFoundationVersionNumber10_1_3 = 227.2; - -const double kCFCoreFoundationVersionNumber10_1_4 = 227.3; - -const double kCFCoreFoundationVersionNumber10_2 = 263.0; - -const double kCFCoreFoundationVersionNumber10_2_1 = 263.1; - -const double kCFCoreFoundationVersionNumber10_2_2 = 263.1; - -const double kCFCoreFoundationVersionNumber10_2_3 = 263.3; - -const double kCFCoreFoundationVersionNumber10_2_4 = 263.3; - -const double kCFCoreFoundationVersionNumber10_2_5 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_6 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_7 = 263.5; - -const double kCFCoreFoundationVersionNumber10_2_8 = 263.5; - -const double kCFCoreFoundationVersionNumber10_3 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_1 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_2 = 299.0; - -const double kCFCoreFoundationVersionNumber10_3_3 = 299.3; - -const double kCFCoreFoundationVersionNumber10_3_4 = 299.31; - -const double kCFCoreFoundationVersionNumber10_3_5 = 299.31; - -const double kCFCoreFoundationVersionNumber10_3_6 = 299.32; - -const double kCFCoreFoundationVersionNumber10_3_7 = 299.33; - -const double kCFCoreFoundationVersionNumber10_3_8 = 299.33; - -const double kCFCoreFoundationVersionNumber10_3_9 = 299.35; - -const double kCFCoreFoundationVersionNumber10_4 = 368.0; - -const double kCFCoreFoundationVersionNumber10_4_1 = 368.1; - -const double kCFCoreFoundationVersionNumber10_4_2 = 368.11; - -const double kCFCoreFoundationVersionNumber10_4_3 = 368.18; - -const double kCFCoreFoundationVersionNumber10_4_4_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_4_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_5_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_5_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_6_Intel = 368.26; - -const double kCFCoreFoundationVersionNumber10_4_6_PowerPC = 368.25; - -const double kCFCoreFoundationVersionNumber10_4_7 = 368.27; - -const double kCFCoreFoundationVersionNumber10_4_8 = 368.27; - -const double kCFCoreFoundationVersionNumber10_4_9 = 368.28; - -const double kCFCoreFoundationVersionNumber10_4_10 = 368.28; - -const double kCFCoreFoundationVersionNumber10_4_11 = 368.31; - -const double kCFCoreFoundationVersionNumber10_5 = 476.0; - -const double kCFCoreFoundationVersionNumber10_5_1 = 476.0; - -const double kCFCoreFoundationVersionNumber10_5_2 = 476.1; - -const double kCFCoreFoundationVersionNumber10_5_3 = 476.13; - -const double kCFCoreFoundationVersionNumber10_5_4 = 476.14; - -const double kCFCoreFoundationVersionNumber10_5_5 = 476.15; - -const double kCFCoreFoundationVersionNumber10_5_6 = 476.17; - -const double kCFCoreFoundationVersionNumber10_5_7 = 476.18; - -const double kCFCoreFoundationVersionNumber10_5_8 = 476.19; - -const double kCFCoreFoundationVersionNumber10_6 = 550.0; - -const double kCFCoreFoundationVersionNumber10_6_1 = 550.0; - -const double kCFCoreFoundationVersionNumber10_6_2 = 550.13; - -const double kCFCoreFoundationVersionNumber10_6_3 = 550.19; - -const double kCFCoreFoundationVersionNumber10_6_4 = 550.29; - -const double kCFCoreFoundationVersionNumber10_6_5 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_6 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_7 = 550.42; - -const double kCFCoreFoundationVersionNumber10_6_8 = 550.43; - -const double kCFCoreFoundationVersionNumber10_7 = 635.0; - -const double kCFCoreFoundationVersionNumber10_7_1 = 635.0; - -const double kCFCoreFoundationVersionNumber10_7_2 = 635.15; - -const double kCFCoreFoundationVersionNumber10_7_3 = 635.19; - -const double kCFCoreFoundationVersionNumber10_7_4 = 635.21; - -const double kCFCoreFoundationVersionNumber10_7_5 = 635.21; - -const double kCFCoreFoundationVersionNumber10_8 = 744.0; - -const double kCFCoreFoundationVersionNumber10_8_1 = 744.0; - -const double kCFCoreFoundationVersionNumber10_8_2 = 744.12; - -const double kCFCoreFoundationVersionNumber10_8_3 = 744.18; - -const double kCFCoreFoundationVersionNumber10_8_4 = 744.19; - -const double kCFCoreFoundationVersionNumber10_9 = 855.11; - -const double kCFCoreFoundationVersionNumber10_9_1 = 855.11; - -const double kCFCoreFoundationVersionNumber10_9_2 = 855.14; - -const double kCFCoreFoundationVersionNumber10_10 = 1151.16; - -const double kCFCoreFoundationVersionNumber10_10_1 = 1151.16; - -const int kCFCoreFoundationVersionNumber10_10_2 = 1152; - -const double kCFCoreFoundationVersionNumber10_10_3 = 1153.18; - -const double kCFCoreFoundationVersionNumber10_10_4 = 1153.18; - -const double kCFCoreFoundationVersionNumber10_10_5 = 1153.18; - -const int kCFCoreFoundationVersionNumber10_10_Max = 1199; - -const int kCFCoreFoundationVersionNumber10_11 = 1253; - -const double kCFCoreFoundationVersionNumber10_11_1 = 1255.1; - -const double kCFCoreFoundationVersionNumber10_11_2 = 1256.14; - -const double kCFCoreFoundationVersionNumber10_11_3 = 1256.14; - -const double kCFCoreFoundationVersionNumber10_11_4 = 1258.1; - -const int kCFCoreFoundationVersionNumber10_11_Max = 1299; - -const int ISA_PTRAUTH_DISCRIMINATOR = 27361; - -const int NSMaximumStringLength = 2147483646; - -const int NS_UNICHAR_IS_EIGHT_BIT = 0; diff --git a/pkgs/ffigen/test/regen.dart b/pkgs/ffigen/test/regen.dart index ff2909eb1a..5b0fc2cd16 100644 --- a/pkgs/ffigen/test/regen.dart +++ b/pkgs/ffigen/test/regen.dart @@ -69,51 +69,6 @@ Future main(List args) async { print('${record.level.name}: ${record.time}: ${record.message}'); }); - await _regenConfig( - File('test/native_objc_test/config.yaml'), - File('test/native_objc_test/native_objc_test_bindings.dart'), - ); - - await _regenConfig( - File('test/native_objc_test/cast_config.yaml'), - File('test/native_objc_test/cast_bindings.dart'), - ); - - await _regenConfig( - File('test/native_objc_test/category_config.yaml'), - File('test/native_objc_test/category_bindings.dart'), - ); - - await _regenConfig( - File('test/native_objc_test/method_config.yaml'), - File('test/native_objc_test/method_bindings.dart'), - ); - - await _regenConfig( - File('test/native_objc_test/nullable_config.yaml'), - File('test/native_objc_test/nullable_bindings.dart'), - ); - - await _regenConfig( - File('test/native_objc_test/property_config.yaml'), - File('test/native_objc_test/property_bindings.dart'), - ); - - await _regenConfig( - File('test/native_objc_test/forward_decl_config.yaml'), - File('test/native_objc_test/forward_decl_bindings.dart'), - ); - - await _regenConfig( - File('test/native_objc_test/string_config.yaml'), - File('test/native_objc_test/string_bindings.dart'), - ); - - await _regenConfig( - File('test/native_objc_test/block_config.yaml'), - File('test/native_objc_test/block_bindings.dart'), - ); - await _regenConfig(File('test/native_test/config.yaml'), File('test/native_test/native_test_bindings.dart')); From 7b376dbb24534de23a8e3bd02a61fbea85098436 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Thu, 12 May 2022 16:37:01 +0200 Subject: [PATCH 139/276] [ffigen] Use ABI-specific integers from `dart:ffi` (#365) --- .../ffigen/.github/workflows/test-package.yml | 4 +- pkgs/ffigen/CHANGELOG.md | 4 + .../c_json/cjson_generated_bindings.dart | 307 +- .../libclang-example/generated_bindings.dart | 868 +++--- .../example/libclang-example/pubspec.yaml | 9 - .../example/simple/generated_bindings.dart | 26 +- .../lib/src/code_generator/imports.dart | 32 +- .../lib/src/code_generator/library.dart | 10 +- .../ffigen/lib/src/code_generator/writer.dart | 79 +- .../clang_bindings/clang_bindings.dart | 132 +- pkgs/ffigen/pubspec.yaml | 6 +- .../_expected_boolean_dartbool_bindings.dart | 1 - ...expected_boolean_no_dartbool_bindings.dart | 1 - .../_expected_constant_bindings.dart | 2 - .../_expected_enumclass_bindings.dart | 3 - .../_expected_function_bindings.dart | 1 - .../_expected_function_n_struct_bindings.dart | 1 - .../_expected_global_bindings.dart | 1 - ...internal_conflict_resolution_bindings.dart | 1 - .../_expected_packed_structs_bindings.dart | 1 - .../_expected_sort_bindings_bindings.dart | 1 - .../_expected_struct_bindings.dart | 1 - .../_expected_typealias_bindings.dart | 1 - .../_expected_unions_bindings.dart | 13 +- ...ecl_symbol_address_collision_bindings.dart | 1 - ...ted_decl_type_name_collision_bindings.dart | 7 +- .../example_tests/libclang_example_test.dart | 9 - .../_expected_comment_markup_bindings.dart | 3 +- .../_expected_dart_handle_bindings.dart | 1 - .../_expected_forward_decl_bindings.dart | 5 +- .../_expected_functions_bindings.dart | 4 +- .../_expected_imported_types_bindings.dart | 27 +- ...expected_native_func_typedef_bindings.dart | 1 - ...expected_opaque_dependencies_bindings.dart | 5 +- .../_expected_packed_structs_bindings.dart | 17 +- .../_expected_typedef_bindings.dart | 16 +- .../_expected_unions_bindings.dart | 3 +- .../_expected_cjson_bindings.dart | 300 +- .../_expected_libclang_bindings.dart | 1042 ++++--- .../_expected_sqlite_bindings.dart | 2516 ++++++++--------- .../native_test/native_test_bindings.dart | 16 +- pkgs/ffigen/tool/libclang_config.yaml | 1 + 42 files changed, 2632 insertions(+), 2847 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index ad20456abc..1b6b494b79 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: [2.16.0-124.0.dev] # TODO(#262) + sdk: [stable] steps: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1.0 @@ -45,7 +45,7 @@ jobs: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1.0 with: - sdk: 2.16.0-124.0.dev # TODO(#262) + sdk: stable - name: Install dependencies run: dart pub get - name: Install libclang-10-dev diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 93663e8113..ccb4635fa4 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.0.0 + +- Stable release targeting Dart 2.17, supporting ABI-specific integer types. + # 5.0.0-dev.1 - Fixed invalid default dart types being generated for `size_t` and `wchar_t`. diff --git a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart index 3f5d92ed9f..57b66722e1 100644 --- a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart +++ b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart @@ -24,7 +24,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; /// Holds bindings to cJSON. class CJson { @@ -41,15 +40,15 @@ class CJson { lookup) : _lookup = lookup; - ffi.Pointer cJSON_Version() { + ffi.Pointer cJSON_Version() { return _cJSON_Version(); } late final _cJSON_VersionPtr = - _lookup Function()>>( + _lookup Function()>>( 'cJSON_Version'); late final _cJSON_Version = - _cJSON_VersionPtr.asFunction Function()>(); + _cJSON_VersionPtr.asFunction Function()>(); void cJSON_InitHooks( ffi.Pointer hooks, @@ -66,7 +65,7 @@ class CJson { _cJSON_InitHooksPtr.asFunction)>(); ffi.Pointer cJSON_Parse( - ffi.Pointer value, + ffi.Pointer value, ) { return _cJSON_Parse( value, @@ -75,14 +74,13 @@ class CJson { late final _cJSON_ParsePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('cJSON_Parse'); + ffi.Pointer Function(ffi.Pointer)>>('cJSON_Parse'); late final _cJSON_Parse = _cJSON_ParsePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_ParseWithOpts( - ffi.Pointer value, - ffi.Pointer> return_parse_end, + ffi.Pointer value, + ffi.Pointer> return_parse_end, int require_null_terminated, ) { return _cJSON_ParseWithOpts( @@ -95,14 +93,14 @@ class CJson { late final _cJSON_ParseWithOptsPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>, cJSON_bool)>>('cJSON_ParseWithOpts'); late final _cJSON_ParseWithOpts = _cJSON_ParseWithOptsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer>, int)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer>, int)>(); - ffi.Pointer cJSON_Print( + ffi.Pointer cJSON_Print( ffi.Pointer item, ) { return _cJSON_Print( @@ -112,12 +110,11 @@ class CJson { late final _cJSON_PrintPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('cJSON_Print'); + ffi.Pointer Function(ffi.Pointer)>>('cJSON_Print'); late final _cJSON_Print = _cJSON_PrintPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); - ffi.Pointer cJSON_PrintUnformatted( + ffi.Pointer cJSON_PrintUnformatted( ffi.Pointer item, ) { return _cJSON_PrintUnformatted( @@ -127,12 +124,12 @@ class CJson { late final _cJSON_PrintUnformattedPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('cJSON_PrintUnformatted'); late final _cJSON_PrintUnformatted = _cJSON_PrintUnformattedPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); - ffi.Pointer cJSON_PrintBuffered( + ffi.Pointer cJSON_PrintBuffered( ffi.Pointer item, int prebuffer, int fmt, @@ -146,14 +143,14 @@ class CJson { late final _cJSON_PrintBufferedPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, pkg_ffi.Int, - cJSON_bool)>>('cJSON_PrintBuffered'); + ffi.Pointer Function( + ffi.Pointer, ffi.Int, cJSON_bool)>>('cJSON_PrintBuffered'); late final _cJSON_PrintBuffered = _cJSON_PrintBufferedPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int)>(); + ffi.Pointer Function(ffi.Pointer, int, int)>(); int cJSON_PrintPreallocated( ffi.Pointer item, - ffi.Pointer buffer, + ffi.Pointer buffer, int length, int format, ) { @@ -167,10 +164,10 @@ class CJson { late final _cJSON_PrintPreallocatedPtr = _lookup< ffi.NativeFunction< - cJSON_bool Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, cJSON_bool)>>('cJSON_PrintPreallocated'); + cJSON_bool Function(ffi.Pointer, ffi.Pointer, + ffi.Int, cJSON_bool)>>('cJSON_PrintPreallocated'); late final _cJSON_PrintPreallocated = _cJSON_PrintPreallocatedPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int, int)>(); void cJSON_Delete( ffi.Pointer item, @@ -195,7 +192,7 @@ class CJson { } late final _cJSON_GetArraySizePtr = - _lookup)>>( + _lookup)>>( 'cJSON_GetArraySize'); late final _cJSON_GetArraySize = _cJSON_GetArraySizePtr.asFunction)>(); @@ -213,13 +210,13 @@ class CJson { late final _cJSON_GetArrayItemPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, pkg_ffi.Int)>>('cJSON_GetArrayItem'); + ffi.Pointer, ffi.Int)>>('cJSON_GetArrayItem'); late final _cJSON_GetArrayItem = _cJSON_GetArrayItemPtr .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_GetObjectItem( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_GetObjectItem( object, @@ -230,14 +227,13 @@ class CJson { late final _cJSON_GetObjectItemPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_GetObjectItem'); + ffi.Pointer)>>('cJSON_GetObjectItem'); late final _cJSON_GetObjectItem = _cJSON_GetObjectItemPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_GetObjectItemCaseSensitive( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_GetObjectItemCaseSensitive( object, @@ -248,15 +244,15 @@ class CJson { late final _cJSON_GetObjectItemCaseSensitivePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_GetObjectItemCaseSensitive'); + ffi.Pointer)>>('cJSON_GetObjectItemCaseSensitive'); late final _cJSON_GetObjectItemCaseSensitive = _cJSON_GetObjectItemCaseSensitivePtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); int cJSON_HasObjectItem( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_HasObjectItem( object, @@ -267,21 +263,21 @@ class CJson { late final _cJSON_HasObjectItemPtr = _lookup< ffi.NativeFunction< cJSON_bool Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_HasObjectItem'); - late final _cJSON_HasObjectItem = _cJSON_HasObjectItemPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer)>>('cJSON_HasObjectItem'); + late final _cJSON_HasObjectItem = _cJSON_HasObjectItemPtr + .asFunction, ffi.Pointer)>(); - ffi.Pointer cJSON_GetErrorPtr() { + ffi.Pointer cJSON_GetErrorPtr() { return _cJSON_GetErrorPtr(); } late final _cJSON_GetErrorPtrPtr = - _lookup Function()>>( + _lookup Function()>>( 'cJSON_GetErrorPtr'); late final _cJSON_GetErrorPtr = - _cJSON_GetErrorPtrPtr.asFunction Function()>(); + _cJSON_GetErrorPtrPtr.asFunction Function()>(); - ffi.Pointer cJSON_GetStringValue( + ffi.Pointer cJSON_GetStringValue( ffi.Pointer item, ) { return _cJSON_GetStringValue( @@ -291,10 +287,10 @@ class CJson { late final _cJSON_GetStringValuePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('cJSON_GetStringValue'); late final _cJSON_GetStringValue = _cJSON_GetStringValuePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); int cJSON_IsInvalid( ffi.Pointer item, @@ -495,7 +491,7 @@ class CJson { _cJSON_CreateNumberPtr.asFunction Function(double)>(); ffi.Pointer cJSON_CreateString( - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_CreateString( string, @@ -505,12 +501,12 @@ class CJson { late final _cJSON_CreateStringPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer)>>('cJSON_CreateString'); + ffi.Pointer)>>('cJSON_CreateString'); late final _cJSON_CreateString = _cJSON_CreateStringPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateRaw( - ffi.Pointer raw, + ffi.Pointer raw, ) { return _cJSON_CreateRaw( raw, @@ -520,9 +516,9 @@ class CJson { late final _cJSON_CreateRawPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer)>>('cJSON_CreateRaw'); + ffi.Pointer)>>('cJSON_CreateRaw'); late final _cJSON_CreateRaw = _cJSON_CreateRawPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateArray() { return _cJSON_CreateArray(); @@ -545,7 +541,7 @@ class CJson { _cJSON_CreateObjectPtr.asFunction Function()>(); ffi.Pointer cJSON_CreateStringReference( - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_CreateStringReference( string, @@ -555,9 +551,9 @@ class CJson { late final _cJSON_CreateStringReferencePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer)>>('cJSON_CreateStringReference'); + ffi.Pointer)>>('cJSON_CreateStringReference'); late final _cJSON_CreateStringReference = _cJSON_CreateStringReferencePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateObjectReference( ffi.Pointer child, @@ -588,7 +584,7 @@ class CJson { .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateIntArray( - ffi.Pointer numbers, + ffi.Pointer numbers, int count, ) { return _cJSON_CreateIntArray( @@ -600,9 +596,9 @@ class CJson { late final _cJSON_CreateIntArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, pkg_ffi.Int)>>('cJSON_CreateIntArray'); + ffi.Pointer, ffi.Int)>>('cJSON_CreateIntArray'); late final _cJSON_CreateIntArray = _cJSON_CreateIntArrayPtr - .asFunction Function(ffi.Pointer, int)>(); + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateFloatArray( ffi.Pointer numbers, @@ -617,7 +613,7 @@ class CJson { late final _cJSON_CreateFloatArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, pkg_ffi.Int)>>('cJSON_CreateFloatArray'); + ffi.Pointer, ffi.Int)>>('cJSON_CreateFloatArray'); late final _cJSON_CreateFloatArray = _cJSON_CreateFloatArrayPtr .asFunction Function(ffi.Pointer, int)>(); @@ -633,13 +629,13 @@ class CJson { late final _cJSON_CreateDoubleArrayPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - pkg_ffi.Int)>>('cJSON_CreateDoubleArray'); + ffi.Pointer Function( + ffi.Pointer, ffi.Int)>>('cJSON_CreateDoubleArray'); late final _cJSON_CreateDoubleArray = _cJSON_CreateDoubleArrayPtr .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateStringArray( - ffi.Pointer> strings, + ffi.Pointer> strings, int count, ) { return _cJSON_CreateStringArray( @@ -650,11 +646,10 @@ class CJson { late final _cJSON_CreateStringArrayPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer>, - pkg_ffi.Int)>>('cJSON_CreateStringArray'); + ffi.Pointer Function(ffi.Pointer>, + ffi.Int)>>('cJSON_CreateStringArray'); late final _cJSON_CreateStringArray = _cJSON_CreateStringArrayPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer>, int)>(); + ffi.Pointer Function(ffi.Pointer>, int)>(); void cJSON_AddItemToArray( ffi.Pointer array, @@ -675,7 +670,7 @@ class CJson { void cJSON_AddItemToObject( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ffi.Pointer item, ) { return _cJSON_AddItemToObject( @@ -687,15 +682,15 @@ class CJson { late final _cJSON_AddItemToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemToObject'); late final _cJSON_AddItemToObject = _cJSON_AddItemToObjectPtr.asFunction< void Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_AddItemToObjectCS( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ffi.Pointer item, ) { return _cJSON_AddItemToObjectCS( @@ -707,11 +702,11 @@ class CJson { late final _cJSON_AddItemToObjectCSPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemToObjectCS'); late final _cJSON_AddItemToObjectCS = _cJSON_AddItemToObjectCSPtr.asFunction< void Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_AddItemReferenceToArray( ffi.Pointer array, @@ -732,7 +727,7 @@ class CJson { void cJSON_AddItemReferenceToObject( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ffi.Pointer item, ) { return _cJSON_AddItemReferenceToObject( @@ -744,12 +739,12 @@ class CJson { late final _cJSON_AddItemReferenceToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemReferenceToObject'); late final _cJSON_AddItemReferenceToObject = _cJSON_AddItemReferenceToObjectPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_DetachItemViaPointer( ffi.Pointer parent, @@ -783,7 +778,7 @@ class CJson { late final _cJSON_DetachItemFromArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, pkg_ffi.Int)>>('cJSON_DetachItemFromArray'); + ffi.Pointer, ffi.Int)>>('cJSON_DetachItemFromArray'); late final _cJSON_DetachItemFromArray = _cJSON_DetachItemFromArrayPtr .asFunction Function(ffi.Pointer, int)>(); @@ -798,15 +793,14 @@ class CJson { } late final _cJSON_DeleteItemFromArrayPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, pkg_ffi.Int)>>('cJSON_DeleteItemFromArray'); + ffi.NativeFunction, ffi.Int)>>( + 'cJSON_DeleteItemFromArray'); late final _cJSON_DeleteItemFromArray = _cJSON_DeleteItemFromArrayPtr .asFunction, int)>(); ffi.Pointer cJSON_DetachItemFromObject( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_DetachItemFromObject( object, @@ -817,15 +811,15 @@ class CJson { late final _cJSON_DetachItemFromObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_DetachItemFromObject'); + ffi.Pointer)>>('cJSON_DetachItemFromObject'); late final _cJSON_DetachItemFromObject = _cJSON_DetachItemFromObjectPtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_DetachItemFromObjectCaseSensitive( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_DetachItemFromObjectCaseSensitive( object, @@ -836,16 +830,16 @@ class CJson { late final _cJSON_DetachItemFromObjectCaseSensitivePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>( + ffi.Pointer, ffi.Pointer)>>( 'cJSON_DetachItemFromObjectCaseSensitive'); late final _cJSON_DetachItemFromObjectCaseSensitive = _cJSON_DetachItemFromObjectCaseSensitivePtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); void cJSON_DeleteItemFromObject( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_DeleteItemFromObject( object, @@ -856,14 +850,13 @@ class CJson { late final _cJSON_DeleteItemFromObjectPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_DeleteItemFromObject'); - late final _cJSON_DeleteItemFromObject = - _cJSON_DeleteItemFromObjectPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer)>>('cJSON_DeleteItemFromObject'); + late final _cJSON_DeleteItemFromObject = _cJSON_DeleteItemFromObjectPtr + .asFunction, ffi.Pointer)>(); void cJSON_DeleteItemFromObjectCaseSensitive( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_DeleteItemFromObjectCaseSensitive( object, @@ -873,12 +866,11 @@ class CJson { late final _cJSON_DeleteItemFromObjectCaseSensitivePtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>( + ffi.Void Function(ffi.Pointer, ffi.Pointer)>>( 'cJSON_DeleteItemFromObjectCaseSensitive'); late final _cJSON_DeleteItemFromObjectCaseSensitive = _cJSON_DeleteItemFromObjectCaseSensitivePtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer)>(); void cJSON_InsertItemInArray( ffi.Pointer array, @@ -894,7 +886,7 @@ class CJson { late final _cJSON_InsertItemInArrayPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, pkg_ffi.Int, + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Pointer)>>('cJSON_InsertItemInArray'); late final _cJSON_InsertItemInArray = _cJSON_InsertItemInArrayPtr .asFunction, int, ffi.Pointer)>(); @@ -934,14 +926,14 @@ class CJson { late final _cJSON_ReplaceItemInArrayPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, pkg_ffi.Int, + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Pointer)>>('cJSON_ReplaceItemInArray'); late final _cJSON_ReplaceItemInArray = _cJSON_ReplaceItemInArrayPtr .asFunction, int, ffi.Pointer)>(); void cJSON_ReplaceItemInObject( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ffi.Pointer newitem, ) { return _cJSON_ReplaceItemInObject( @@ -953,16 +945,16 @@ class CJson { late final _cJSON_ReplaceItemInObjectPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_ReplaceItemInObject'); late final _cJSON_ReplaceItemInObject = _cJSON_ReplaceItemInObjectPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_ReplaceItemInObjectCaseSensitive( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ffi.Pointer newitem, ) { return _cJSON_ReplaceItemInObjectCaseSensitive( @@ -974,12 +966,12 @@ class CJson { late final _cJSON_ReplaceItemInObjectCaseSensitivePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_ReplaceItemInObjectCaseSensitive'); late final _cJSON_ReplaceItemInObjectCaseSensitive = _cJSON_ReplaceItemInObjectCaseSensitivePtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_Duplicate( ffi.Pointer item, @@ -1018,7 +1010,7 @@ class CJson { .asFunction, ffi.Pointer, int)>(); void cJSON_Minify( - ffi.Pointer json, + ffi.Pointer json, ) { return _cJSON_Minify( json, @@ -1026,14 +1018,14 @@ class CJson { } late final _cJSON_MinifyPtr = - _lookup)>>( + _lookup)>>( 'cJSON_Minify'); late final _cJSON_Minify = - _cJSON_MinifyPtr.asFunction)>(); + _cJSON_MinifyPtr.asFunction)>(); ffi.Pointer cJSON_AddNullToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, ) { return _cJSON_AddNullToObject( object, @@ -1044,14 +1036,13 @@ class CJson { late final _cJSON_AddNullToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_AddNullToObject'); + ffi.Pointer)>>('cJSON_AddNullToObject'); late final _cJSON_AddNullToObject = _cJSON_AddNullToObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddTrueToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, ) { return _cJSON_AddTrueToObject( object, @@ -1062,14 +1053,13 @@ class CJson { late final _cJSON_AddTrueToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_AddTrueToObject'); + ffi.Pointer)>>('cJSON_AddTrueToObject'); late final _cJSON_AddTrueToObject = _cJSON_AddTrueToObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddFalseToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, ) { return _cJSON_AddFalseToObject( object, @@ -1080,14 +1070,13 @@ class CJson { late final _cJSON_AddFalseToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_AddFalseToObject'); + ffi.Pointer)>>('cJSON_AddFalseToObject'); late final _cJSON_AddFalseToObject = _cJSON_AddFalseToObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddBoolToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, int boolean, ) { return _cJSON_AddBoolToObject( @@ -1099,15 +1088,15 @@ class CJson { late final _cJSON_AddBoolToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, cJSON_bool)>>('cJSON_AddBoolToObject'); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + cJSON_bool)>>('cJSON_AddBoolToObject'); late final _cJSON_AddBoolToObject = _cJSON_AddBoolToObjectPtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer, ffi.Pointer, int)>(); ffi.Pointer cJSON_AddNumberToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, double number, ) { return _cJSON_AddNumberToObject( @@ -1119,18 +1108,16 @@ class CJson { late final _cJSON_AddNumberToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Double)>>('cJSON_AddNumberToObject'); late final _cJSON_AddNumberToObject = _cJSON_AddNumberToObjectPtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); + ffi.Pointer, ffi.Pointer, double)>(); ffi.Pointer cJSON_AddStringToObject( ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer string, + ffi.Pointer name, + ffi.Pointer string, ) { return _cJSON_AddStringToObject( object, @@ -1141,18 +1128,16 @@ class CJson { late final _cJSON_AddStringToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('cJSON_AddStringToObject'); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddStringToObject'); late final _cJSON_AddStringToObject = _cJSON_AddStringToObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddRawToObject( ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer raw, + ffi.Pointer name, + ffi.Pointer raw, ) { return _cJSON_AddRawToObject( object, @@ -1163,17 +1148,15 @@ class CJson { late final _cJSON_AddRawToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('cJSON_AddRawToObject'); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddRawToObject'); late final _cJSON_AddRawToObject = _cJSON_AddRawToObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddObjectToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, ) { return _cJSON_AddObjectToObject( object, @@ -1184,14 +1167,13 @@ class CJson { late final _cJSON_AddObjectToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_AddObjectToObject'); + ffi.Pointer)>>('cJSON_AddObjectToObject'); late final _cJSON_AddObjectToObject = _cJSON_AddObjectToObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddArrayToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, ) { return _cJSON_AddArrayToObject( object, @@ -1202,10 +1184,9 @@ class CJson { late final _cJSON_AddArrayToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_AddArrayToObject'); + ffi.Pointer)>>('cJSON_AddArrayToObject'); late final _cJSON_AddArrayToObject = _cJSON_AddArrayToObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); double cJSON_SetNumberHelper( ffi.Pointer object, @@ -1233,7 +1214,7 @@ class CJson { } late final _cJSON_mallocPtr = - _lookup Function(pkg_ffi.Size)>>( + _lookup Function(ffi.Size)>>( 'cJSON_malloc'); late final _cJSON_malloc = _cJSON_mallocPtr.asFunction Function(int)>(); @@ -1260,23 +1241,23 @@ class cJSON extends ffi.Struct { external ffi.Pointer child; - @pkg_ffi.Int() + @ffi.Int() external int type; - external ffi.Pointer valuestring; + external ffi.Pointer valuestring; - @pkg_ffi.Int() + @ffi.Int() external int valueint; @ffi.Double() external double valuedouble; - external ffi.Pointer string; + external ffi.Pointer string; } class cJSON_Hooks extends ffi.Struct { - external ffi.Pointer< - ffi.NativeFunction Function(pkg_ffi.Size)>> + external ffi + .Pointer Function(ffi.Size)>> malloc_fn; external ffi @@ -1284,7 +1265,7 @@ class cJSON_Hooks extends ffi.Struct { free_fn; } -typedef cJSON_bool = pkg_ffi.Int; +typedef cJSON_bool = ffi.Int; const int CJSON_VERSION_MAJOR = 1; diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index 6f7323259b..c114c5e6b0 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -9,7 +9,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; import 'custom_import.dart' as custom_import; /// Holds bindings to LibClang. @@ -28,7 +27,7 @@ class LibClang { : _lookup = lookup; /// Retrieve the character data associated with the given string. - ffi.Pointer clang_getCString( + ffi.Pointer clang_getCString( CXString string, ) { return _clang_getCString( @@ -196,7 +195,7 @@ class LibClang { /// libclang invocations are not logged.. void clang_CXIndex_setInvocationEmissionPathOption( CXIndex arg0, - ffi.Pointer Path, + ffi.Pointer Path, ) { return _clang_CXIndex_setInvocationEmissionPathOption( arg0, @@ -292,7 +291,7 @@ class LibClang { /// or a NULL file handle if the file was not a part of this translation unit. CXFile clang_getFile( CXTranslationUnit tu, - ffi.Pointer file_name, + ffi.Pointer file_name, ) { return _clang_getFile( tu, @@ -314,10 +313,10 @@ class LibClang { /// /// \returns a pointer to the buffer in memory that holds the contents of /// \p file, or a NULL pointer when the file is not loaded. - ffi.Pointer clang_getFileContents( + ffi.Pointer clang_getFileContents( CXTranslationUnit tu, CXFile file, - ffi.Pointer size, + ffi.Pointer size, ) { return _clang_getFileContents( tu, @@ -557,9 +556,9 @@ class LibClang { void clang_getExpansionLocation( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_getExpansionLocation( location, @@ -617,8 +616,8 @@ class LibClang { void clang_getPresumedLocation( CXSourceLocation location, ffi.Pointer filename, - ffi.Pointer line, - ffi.Pointer column, + ffi.Pointer line, + ffi.Pointer column, ) { return _clang_getPresumedLocation( location, @@ -643,9 +642,9 @@ class LibClang { void clang_getInstantiationLocation( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_getInstantiationLocation( location, @@ -686,9 +685,9 @@ class LibClang { void clang_getSpellingLocation( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_getSpellingLocation( location, @@ -729,9 +728,9 @@ class LibClang { void clang_getFileLocation( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_getFileLocation( location, @@ -883,7 +882,7 @@ class LibClang { /// \returns A loaded CXDiagnosticSet if successful, and NULL otherwise. These /// diagnostics should be released using clang_disposeDiagnosticSet(). CXDiagnosticSet clang_loadDiagnostics( - ffi.Pointer file, + ffi.Pointer file, ffi.Pointer error, ffi.Pointer errorString, ) { @@ -1343,9 +1342,9 @@ class LibClang { /// guarantee their validity until the call to this function returns. CXTranslationUnit clang_createTranslationUnitFromSourceFile( CXIndex CIdx, - ffi.Pointer source_filename, + ffi.Pointer source_filename, int num_clang_command_line_args, - ffi.Pointer> clang_command_line_args, + ffi.Pointer> clang_command_line_args, int num_unsaved_files, ffi.Pointer unsaved_files, ) { @@ -1372,7 +1371,7 @@ class LibClang { /// error codes. CXTranslationUnit clang_createTranslationUnit( CXIndex CIdx, - ffi.Pointer ast_filename, + ffi.Pointer ast_filename, ) { return _clang_createTranslationUnit( CIdx, @@ -1394,7 +1393,7 @@ class LibClang { /// \returns Zero on success, otherwise returns an error code. int clang_createTranslationUnit2( CXIndex CIdx, - ffi.Pointer ast_filename, + ffi.Pointer ast_filename, ffi.Pointer out_TU, ) { return _clang_createTranslationUnit2( @@ -1437,8 +1436,8 @@ class LibClang { /// error codes. CXTranslationUnit clang_parseTranslationUnit( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -1505,8 +1504,8 @@ class LibClang { /// \returns Zero on success, otherwise returns an error code. int clang_parseTranslationUnit2( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -1536,8 +1535,8 @@ class LibClang { /// library paths are relative to the binary. int clang_parseTranslationUnit2FullArgv( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -1607,7 +1606,7 @@ class LibClang { /// saved successfully, while a non-zero value indicates that a problem occurred. int clang_saveTranslationUnit( CXTranslationUnit TU, - ffi.Pointer FileName, + ffi.Pointer FileName, int options, ) { return _clang_saveTranslationUnit( @@ -1738,7 +1737,7 @@ class LibClang { /// Returns the human-readable null-terminated C string that represents /// the name of the memory category. This string should never be freed. - ffi.Pointer clang_getTUResourceUsageName( + ffi.Pointer clang_getTUResourceUsageName( int kind, ) { return _clang_getTUResourceUsageName( @@ -2210,9 +2209,9 @@ class LibClang { /// \c min(N, availability_size) such structures. int clang_getCursorPlatformAvailability( CXCursor cursor, - ffi.Pointer always_deprecated, + ffi.Pointer always_deprecated, ffi.Pointer deprecated_message, - ffi.Pointer always_unavailable, + ffi.Pointer always_unavailable, ffi.Pointer unavailable_message, ffi.Pointer availability, int availability_size, @@ -2497,7 +2496,7 @@ class LibClang { void clang_getOverriddenCursors( CXCursor cursor, ffi.Pointer> overridden, - ffi.Pointer num_overridden, + ffi.Pointer num_overridden, ) { return _clang_getOverriddenCursors( cursor, @@ -3639,7 +3638,7 @@ class LibClang { /// CXTypeLayoutError_InvalidFieldName is returned. int clang_Type_getOffsetOf( CXType T, - ffi.Pointer S, + ffi.Pointer S, ) { return _clang_Type_getOffsetOf( T, @@ -3998,7 +3997,7 @@ class LibClang { /// Construct a USR for a specified Objective-C class. CXString clang_constructUSR_ObjCClass( - ffi.Pointer class_name, + ffi.Pointer class_name, ) { return _clang_constructUSR_ObjCClass( class_name, @@ -4013,8 +4012,8 @@ class LibClang { /// Construct a USR for a specified Objective-C category. CXString clang_constructUSR_ObjCCategory( - ffi.Pointer class_name, - ffi.Pointer category_name, + ffi.Pointer class_name, + ffi.Pointer category_name, ) { return _clang_constructUSR_ObjCCategory( class_name, @@ -4031,7 +4030,7 @@ class LibClang { /// Construct a USR for a specified Objective-C protocol. CXString clang_constructUSR_ObjCProtocol( - ffi.Pointer protocol_name, + ffi.Pointer protocol_name, ) { return _clang_constructUSR_ObjCProtocol( protocol_name, @@ -4048,7 +4047,7 @@ class LibClang { /// Construct a USR for a specified Objective-C instance variable and /// the USR for its containing class. CXString clang_constructUSR_ObjCIvar( - ffi.Pointer name, + ffi.Pointer name, CXString classUSR, ) { return _clang_constructUSR_ObjCIvar( @@ -4066,7 +4065,7 @@ class LibClang { /// Construct a USR for a specified Objective-C method and /// the USR for its containing class. CXString clang_constructUSR_ObjCMethod( - ffi.Pointer name, + ffi.Pointer name, int isInstanceMethod, CXString classUSR, ) { @@ -4086,7 +4085,7 @@ class LibClang { /// Construct a USR for a specified Objective-C property and the USR /// for its containing class. CXString clang_constructUSR_ObjCProperty( - ffi.Pointer property, + ffi.Pointer property, CXString classUSR, ) { return _clang_constructUSR_ObjCProperty( @@ -4560,7 +4559,7 @@ class LibClang { CXCursor C, ffi.Pointer language, ffi.Pointer definedIn, - ffi.Pointer isGenerated, + ffi.Pointer isGenerated, ) { return _clang_Cursor_isExternalSymbol( C, @@ -5246,7 +5245,7 @@ class LibClang { CXTranslationUnit TU, CXSourceRange Range, ffi.Pointer> Tokens, - ffi.Pointer NumTokens, + ffi.Pointer NumTokens, ) { return _clang_tokenize( TU, @@ -5350,12 +5349,12 @@ class LibClang { void clang_getDefinitionSpellingAndExtent( CXCursor arg0, - ffi.Pointer> startBuf, - ffi.Pointer> endBuf, - ffi.Pointer startLine, - ffi.Pointer startColumn, - ffi.Pointer endLine, - ffi.Pointer endColumn, + ffi.Pointer> startBuf, + ffi.Pointer> endBuf, + ffi.Pointer startLine, + ffi.Pointer startColumn, + ffi.Pointer endLine, + ffi.Pointer endColumn, ) { return _clang_getDefinitionSpellingAndExtent( arg0, @@ -5822,7 +5821,7 @@ class LibClang { /// completion fails, returns NULL. ffi.Pointer clang_codeCompleteAt( CXTranslationUnit TU, - ffi.Pointer complete_filename, + ffi.Pointer complete_filename, int complete_line, int complete_column, ffi.Pointer unsaved_files, @@ -5962,7 +5961,7 @@ class LibClang { /// container int clang_codeCompleteGetContainerKind( ffi.Pointer Results, - ffi.Pointer IsIncomplete, + ffi.Pointer IsIncomplete, ) { return _clang_codeCompleteGetContainerKind( Results, @@ -6195,7 +6194,7 @@ class LibClang { /// 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 clang_EvalResult_getAsStr( CXEvalResult E, ) { return _clang_EvalResult_getAsStr( @@ -6231,7 +6230,7 @@ class LibClang { /// \returns the requested remapping. This remapping must be freed /// via a call to \c clang_remap_dispose(). Can return NULL if an error occurred. CXRemapping clang_getRemappings( - ffi.Pointer path, + ffi.Pointer path, ) { return _clang_getRemappings( path, @@ -6253,7 +6252,7 @@ class LibClang { /// \returns the requested remapping. This remapping must be freed /// via a call to \c clang_remap_dispose(). Can return NULL if an error occurred. CXRemapping clang_getRemappingsFromFileList( - ffi.Pointer> filePaths, + ffi.Pointer> filePaths, int numFiles, ) { return _clang_getRemappingsFromFileList( @@ -6638,8 +6637,8 @@ class LibClang { ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -6677,8 +6676,8 @@ class LibClang { ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -6755,9 +6754,9 @@ class LibClang { CXIdxLoc loc, ffi.Pointer indexFile, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_indexLoc_getFileLocation( loc, @@ -7650,21 +7649,20 @@ class _SymbolAddresses { class CXString extends ffi.Struct { external ffi.Pointer data; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int private_flags; } class CXStringSet extends ffi.Struct { external ffi.Pointer Strings; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int Count; } -typedef NativeClang_getCString = ffi.Pointer Function( - CXString string); -typedef DartClang_getCString = ffi.Pointer Function( +typedef NativeClang_getCString = ffi.Pointer Function( CXString string); +typedef DartClang_getCString = ffi.Pointer Function(CXString string); typedef NativeClang_disposeString = ffi.Void Function(CXString string); typedef DartClang_disposeString = void Function(CXString string); typedef NativeClang_disposeStringSet = ffi.Void Function( @@ -7685,13 +7683,13 @@ 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; + external ffi.Pointer Filename; /// A buffer containing the unsaved contents of this file. - external ffi.Pointer Contents; + external ffi.Pointer Contents; /// The length of the unsaved contents of this buffer. - @custom_import.UnsignedLong() + @ffi.UnsignedLong() external int Length; } @@ -7699,19 +7697,19 @@ class CXUnsavedFile extends ffi.Struct { 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. - @pkg_ffi.Int() + @ffi.Int() 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'. - @pkg_ffi.Int() + @ffi.Int() 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'. - @pkg_ffi.Int() + @ffi.Int() external int Subminor; } @@ -7719,7 +7717,7 @@ class CXVersion extends ffi.Struct { /// typically be linked together into an executable or library. typedef CXIndex = ffi.Pointer; typedef NativeClang_createIndex = CXIndex Function( - pkg_ffi.Int excludeDeclarationsFromPCH, pkg_ffi.Int displayDiagnostics); + ffi.Int excludeDeclarationsFromPCH, ffi.Int displayDiagnostics); typedef DartClang_createIndex = CXIndex Function( int excludeDeclarationsFromPCH, int displayDiagnostics); typedef NativeClang_disposeIndex = ffi.Void Function(CXIndex index); @@ -7749,16 +7747,16 @@ abstract class CXGlobalOptFlags { } typedef NativeClang_CXIndex_setGlobalOptions = ffi.Void Function( - CXIndex arg0, pkg_ffi.UnsignedInt options); + CXIndex arg0, ffi.UnsignedInt options); typedef DartClang_CXIndex_setGlobalOptions = void Function( CXIndex arg0, int options); -typedef NativeClang_CXIndex_getGlobalOptions = pkg_ffi.UnsignedInt Function( +typedef NativeClang_CXIndex_getGlobalOptions = ffi.UnsignedInt Function( CXIndex arg0); typedef DartClang_CXIndex_getGlobalOptions = int Function(CXIndex arg0); typedef NativeClang_CXIndex_setInvocationEmissionPathOption = ffi.Void Function( - CXIndex arg0, ffi.Pointer Path); + CXIndex arg0, ffi.Pointer Path); typedef DartClang_CXIndex_setInvocationEmissionPathOption = void Function( - CXIndex arg0, ffi.Pointer Path); + CXIndex arg0, ffi.Pointer Path); /// A particular source file that is part of a translation unit. typedef CXFile = ffi.Pointer; @@ -7771,30 +7769,29 @@ typedef DartClang_getFileTime = int Function(CXFile SFile); /// across an indexing session. class CXFileUniqueID extends ffi.Struct { @ffi.Array.multi([3]) - external ffi.Array data; + external ffi.Array data; } -typedef NativeClang_getFileUniqueID = pkg_ffi.Int Function( +typedef NativeClang_getFileUniqueID = ffi.Int Function( CXFile file, ffi.Pointer outID); typedef DartClang_getFileUniqueID = int Function( CXFile file, ffi.Pointer outID); /// A single translation unit, which resides in an index. typedef CXTranslationUnit = ffi.Pointer; -typedef NativeClang_isFileMultipleIncludeGuarded = pkg_ffi.UnsignedInt Function( +typedef NativeClang_isFileMultipleIncludeGuarded = ffi.UnsignedInt Function( CXTranslationUnit tu, CXFile file); typedef DartClang_isFileMultipleIncludeGuarded = int Function( CXTranslationUnit tu, CXFile file); typedef NativeClang_getFile = CXFile Function( - CXTranslationUnit tu, ffi.Pointer file_name); + CXTranslationUnit tu, ffi.Pointer file_name); typedef DartClang_getFile = CXFile Function( - CXTranslationUnit tu, ffi.Pointer file_name); -typedef NativeClang_getFileContents = ffi.Pointer Function( - CXTranslationUnit tu, CXFile file, ffi.Pointer size); -typedef DartClang_getFileContents = ffi.Pointer Function( - CXTranslationUnit tu, CXFile file, ffi.Pointer size); -typedef NativeClang_File_isEqual = pkg_ffi.Int Function( - CXFile file1, CXFile file2); + CXTranslationUnit tu, ffi.Pointer file_name); +typedef NativeClang_getFileContents = ffi.Pointer Function( + CXTranslationUnit tu, CXFile file, ffi.Pointer size); +typedef DartClang_getFileContents = ffi.Pointer Function( + CXTranslationUnit tu, CXFile file, ffi.Pointer size); +typedef NativeClang_File_isEqual = ffi.Int Function(CXFile file1, CXFile file2); typedef DartClang_File_isEqual = int Function(CXFile file1, CXFile file2); typedef NativeClang_File_tryGetRealPathName = CXString Function(CXFile file); typedef DartClang_File_tryGetRealPathName = CXString Function(CXFile file); @@ -7808,7 +7805,7 @@ class CXSourceLocation extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int int_data; } @@ -7820,35 +7817,35 @@ class CXSourceRange extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int begin_int_data; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int end_int_data; } typedef NativeClang_getNullLocation = CXSourceLocation Function(); typedef DartClang_getNullLocation = CXSourceLocation Function(); -typedef NativeClang_equalLocations = pkg_ffi.UnsignedInt Function( +typedef NativeClang_equalLocations = ffi.UnsignedInt Function( CXSourceLocation loc1, CXSourceLocation loc2); typedef DartClang_equalLocations = int Function( CXSourceLocation loc1, CXSourceLocation loc2); typedef NativeClang_getLocation = CXSourceLocation Function( CXTranslationUnit tu, CXFile file, - pkg_ffi.UnsignedInt line, - pkg_ffi.UnsignedInt column); + ffi.UnsignedInt line, + ffi.UnsignedInt column); typedef DartClang_getLocation = CXSourceLocation Function( CXTranslationUnit tu, CXFile file, int line, int column); typedef NativeClang_getLocationForOffset = CXSourceLocation Function( - CXTranslationUnit tu, CXFile file, pkg_ffi.UnsignedInt offset); + CXTranslationUnit tu, CXFile file, ffi.UnsignedInt offset); typedef DartClang_getLocationForOffset = CXSourceLocation Function( CXTranslationUnit tu, CXFile file, int offset); -typedef NativeClang_Location_isInSystemHeader = pkg_ffi.Int Function( +typedef NativeClang_Location_isInSystemHeader = ffi.Int Function( CXSourceLocation location); typedef DartClang_Location_isInSystemHeader = int Function( CXSourceLocation location); -typedef NativeClang_Location_isFromMainFile = pkg_ffi.Int Function( +typedef NativeClang_Location_isFromMainFile = ffi.Int Function( CXSourceLocation location); typedef DartClang_Location_isFromMainFile = int Function( CXSourceLocation location); @@ -7858,70 +7855,70 @@ typedef NativeClang_getRange = CXSourceRange Function( CXSourceLocation begin, CXSourceLocation end); typedef DartClang_getRange = CXSourceRange Function( CXSourceLocation begin, CXSourceLocation end); -typedef NativeClang_equalRanges = pkg_ffi.UnsignedInt Function( +typedef NativeClang_equalRanges = ffi.UnsignedInt Function( CXSourceRange range1, CXSourceRange range2); typedef DartClang_equalRanges = int Function( CXSourceRange range1, CXSourceRange range2); -typedef NativeClang_Range_isNull = pkg_ffi.Int Function(CXSourceRange range); +typedef NativeClang_Range_isNull = ffi.Int Function(CXSourceRange range); typedef DartClang_Range_isNull = int Function(CXSourceRange range); typedef NativeClang_getExpansionLocation = ffi.Void Function( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset); + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef DartClang_getExpansionLocation = void Function( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset); + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef NativeClang_getPresumedLocation = ffi.Void Function( CXSourceLocation location, ffi.Pointer filename, - ffi.Pointer line, - ffi.Pointer column); + ffi.Pointer line, + ffi.Pointer column); typedef DartClang_getPresumedLocation = void Function( CXSourceLocation location, ffi.Pointer filename, - ffi.Pointer line, - ffi.Pointer column); + ffi.Pointer line, + ffi.Pointer column); typedef NativeClang_getInstantiationLocation = ffi.Void Function( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset); + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef DartClang_getInstantiationLocation = void Function( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset); + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef NativeClang_getSpellingLocation = ffi.Void Function( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset); + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef DartClang_getSpellingLocation = void Function( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset); + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef NativeClang_getFileLocation = ffi.Void Function( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset); + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef DartClang_getFileLocation = void Function( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset); + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef NativeClang_getRangeStart = CXSourceLocation Function( CXSourceRange range); typedef DartClang_getRangeStart = CXSourceLocation Function( @@ -7933,7 +7930,7 @@ typedef DartClang_getRangeEnd = CXSourceLocation Function(CXSourceRange range); /// Identifies an array of ranges. class CXSourceRangeList extends ffi.Struct { /// The number of ranges in the \c ranges array. - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int count; /// An array of \c CXSourceRanges. @@ -7955,7 +7952,7 @@ typedef DartClang_disposeSourceRangeList = void Function( /// A group of CXDiagnostics. typedef CXDiagnosticSet = ffi.Pointer; -typedef NativeClang_getNumDiagnosticsInSet = pkg_ffi.UnsignedInt Function( +typedef NativeClang_getNumDiagnosticsInSet = ffi.UnsignedInt Function( CXDiagnosticSet Diags); typedef DartClang_getNumDiagnosticsInSet = int Function(CXDiagnosticSet Diags); @@ -7963,7 +7960,7 @@ typedef DartClang_getNumDiagnosticsInSet = int Function(CXDiagnosticSet Diags); /// location, text, source ranges, and fix-it hints. typedef CXDiagnostic = ffi.Pointer; typedef NativeClang_getDiagnosticInSet = CXDiagnostic Function( - CXDiagnosticSet Diags, pkg_ffi.UnsignedInt Index); + CXDiagnosticSet Diags, ffi.UnsignedInt Index); typedef DartClang_getDiagnosticInSet = CXDiagnostic Function( CXDiagnosticSet Diags, int Index); @@ -7987,11 +7984,11 @@ abstract class CXLoadDiag_Error { } typedef NativeClang_loadDiagnostics = CXDiagnosticSet Function( - ffi.Pointer file, + ffi.Pointer file, ffi.Pointer error, ffi.Pointer errorString); typedef DartClang_loadDiagnostics = CXDiagnosticSet Function( - ffi.Pointer file, + ffi.Pointer file, ffi.Pointer error, ffi.Pointer errorString); typedef NativeClang_disposeDiagnosticSet = ffi.Void Function( @@ -8001,11 +7998,11 @@ typedef NativeClang_getChildDiagnostics = CXDiagnosticSet Function( CXDiagnostic D); typedef DartClang_getChildDiagnostics = CXDiagnosticSet Function( CXDiagnostic D); -typedef NativeClang_getNumDiagnostics = pkg_ffi.UnsignedInt Function( +typedef NativeClang_getNumDiagnostics = ffi.UnsignedInt Function( CXTranslationUnit Unit); typedef DartClang_getNumDiagnostics = int Function(CXTranslationUnit Unit); typedef NativeClang_getDiagnostic = CXDiagnostic Function( - CXTranslationUnit Unit, pkg_ffi.UnsignedInt Index); + CXTranslationUnit Unit, ffi.UnsignedInt Index); typedef DartClang_getDiagnostic = CXDiagnostic Function( CXTranslationUnit Unit, int Index); typedef NativeClang_getDiagnosticSetFromTU = CXDiagnosticSet Function( @@ -8016,10 +8013,10 @@ typedef NativeClang_disposeDiagnostic = ffi.Void Function( CXDiagnostic Diagnostic); typedef DartClang_disposeDiagnostic = void Function(CXDiagnostic Diagnostic); typedef NativeClang_formatDiagnostic = CXString Function( - CXDiagnostic Diagnostic, pkg_ffi.UnsignedInt Options); + CXDiagnostic Diagnostic, ffi.UnsignedInt Options); typedef DartClang_formatDiagnostic = CXString Function( CXDiagnostic Diagnostic, int Options); -typedef NativeClang_defaultDiagnosticDisplayOptions = pkg_ffi.UnsignedInt +typedef NativeClang_defaultDiagnosticDisplayOptions = ffi.UnsignedInt Function(); typedef DartClang_defaultDiagnosticDisplayOptions = int Function(); @@ -8060,30 +8057,30 @@ typedef NativeClang_getDiagnosticOption = CXString Function( CXDiagnostic Diag, ffi.Pointer Disable); typedef DartClang_getDiagnosticOption = CXString Function( CXDiagnostic Diag, ffi.Pointer Disable); -typedef NativeClang_getDiagnosticCategory = pkg_ffi.UnsignedInt Function( +typedef NativeClang_getDiagnosticCategory = ffi.UnsignedInt Function( CXDiagnostic arg0); typedef DartClang_getDiagnosticCategory = int Function(CXDiagnostic arg0); typedef NativeClang_getDiagnosticCategoryName = CXString Function( - pkg_ffi.UnsignedInt Category); + ffi.UnsignedInt Category); typedef DartClang_getDiagnosticCategoryName = CXString Function(int Category); typedef NativeClang_getDiagnosticCategoryText = CXString Function( CXDiagnostic arg0); typedef DartClang_getDiagnosticCategoryText = CXString Function( CXDiagnostic arg0); -typedef NativeClang_getDiagnosticNumRanges = pkg_ffi.UnsignedInt Function( +typedef NativeClang_getDiagnosticNumRanges = ffi.UnsignedInt Function( CXDiagnostic arg0); typedef DartClang_getDiagnosticNumRanges = int Function(CXDiagnostic arg0); typedef NativeClang_getDiagnosticRange = CXSourceRange Function( - CXDiagnostic Diagnostic, pkg_ffi.UnsignedInt Range); + CXDiagnostic Diagnostic, ffi.UnsignedInt Range); typedef DartClang_getDiagnosticRange = CXSourceRange Function( CXDiagnostic Diagnostic, int Range); -typedef NativeClang_getDiagnosticNumFixIts = pkg_ffi.UnsignedInt Function( +typedef NativeClang_getDiagnosticNumFixIts = ffi.UnsignedInt Function( CXDiagnostic Diagnostic); typedef DartClang_getDiagnosticNumFixIts = int Function( CXDiagnostic Diagnostic); typedef NativeClang_getDiagnosticFixIt = CXString Function( CXDiagnostic Diagnostic, - pkg_ffi.UnsignedInt FixIt, + ffi.UnsignedInt FixIt, ffi.Pointer ReplacementRange); typedef DartClang_getDiagnosticFixIt = CXString Function( CXDiagnostic Diagnostic, @@ -8096,23 +8093,23 @@ typedef DartClang_getTranslationUnitSpelling = CXString Function( typedef NativeClang_createTranslationUnitFromSourceFile = CXTranslationUnit Function( CXIndex CIdx, - ffi.Pointer source_filename, - pkg_ffi.Int num_clang_command_line_args, - ffi.Pointer> clang_command_line_args, - pkg_ffi.UnsignedInt num_unsaved_files, + ffi.Pointer source_filename, + ffi.Int num_clang_command_line_args, + ffi.Pointer> clang_command_line_args, + ffi.UnsignedInt num_unsaved_files, ffi.Pointer unsaved_files); typedef DartClang_createTranslationUnitFromSourceFile = CXTranslationUnit Function( CXIndex CIdx, - ffi.Pointer source_filename, + ffi.Pointer source_filename, int num_clang_command_line_args, - ffi.Pointer> clang_command_line_args, + ffi.Pointer> clang_command_line_args, int num_unsaved_files, ffi.Pointer unsaved_files); typedef NativeClang_createTranslationUnit = CXTranslationUnit Function( - CXIndex CIdx, ffi.Pointer ast_filename); + CXIndex CIdx, ffi.Pointer ast_filename); typedef DartClang_createTranslationUnit = CXTranslationUnit Function( - CXIndex CIdx, ffi.Pointer ast_filename); + CXIndex CIdx, ffi.Pointer ast_filename); /// Error codes returned by libclang routines. /// @@ -8139,46 +8136,42 @@ abstract class CXErrorCode { static const int CXError_ASTReadError = 4; } -typedef NativeClang_createTranslationUnit2 = ffi.Int32 Function( - CXIndex CIdx, - ffi.Pointer ast_filename, - ffi.Pointer out_TU); -typedef DartClang_createTranslationUnit2 = int Function( - CXIndex CIdx, - ffi.Pointer ast_filename, - ffi.Pointer out_TU); -typedef NativeClang_defaultEditingTranslationUnitOptions = pkg_ffi.UnsignedInt +typedef NativeClang_createTranslationUnit2 = ffi.Int32 Function(CXIndex CIdx, + ffi.Pointer ast_filename, ffi.Pointer out_TU); +typedef DartClang_createTranslationUnit2 = int Function(CXIndex CIdx, + ffi.Pointer ast_filename, ffi.Pointer out_TU); +typedef NativeClang_defaultEditingTranslationUnitOptions = ffi.UnsignedInt Function(); typedef DartClang_defaultEditingTranslationUnitOptions = int Function(); typedef NativeClang_parseTranslationUnit = CXTranslationUnit Function( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - pkg_ffi.Int num_command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + ffi.Int num_command_line_args, ffi.Pointer unsaved_files, - pkg_ffi.UnsignedInt num_unsaved_files, - pkg_ffi.UnsignedInt options); + ffi.UnsignedInt num_unsaved_files, + ffi.UnsignedInt options); typedef DartClang_parseTranslationUnit = CXTranslationUnit Function( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + 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 NativeClang_parseTranslationUnit2 = ffi.Int32 Function( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - pkg_ffi.Int num_command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + ffi.Int num_command_line_args, ffi.Pointer unsaved_files, - pkg_ffi.UnsignedInt num_unsaved_files, - pkg_ffi.UnsignedInt options, + ffi.UnsignedInt num_unsaved_files, + ffi.UnsignedInt options, ffi.Pointer out_TU); typedef DartClang_parseTranslationUnit2 = int Function( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -8186,46 +8179,44 @@ typedef DartClang_parseTranslationUnit2 = int Function( ffi.Pointer out_TU); typedef NativeClang_parseTranslationUnit2FullArgv = ffi.Int32 Function( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - pkg_ffi.Int num_command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + ffi.Int num_command_line_args, ffi.Pointer unsaved_files, - pkg_ffi.UnsignedInt num_unsaved_files, - pkg_ffi.UnsignedInt options, + ffi.UnsignedInt num_unsaved_files, + ffi.UnsignedInt options, ffi.Pointer out_TU); typedef DartClang_parseTranslationUnit2FullArgv = int Function( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + 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 NativeClang_defaultSaveOptions = pkg_ffi.UnsignedInt Function( +typedef NativeClang_defaultSaveOptions = ffi.UnsignedInt Function( CXTranslationUnit TU); typedef DartClang_defaultSaveOptions = int Function(CXTranslationUnit TU); -typedef NativeClang_saveTranslationUnit = pkg_ffi.Int Function( - CXTranslationUnit TU, - ffi.Pointer FileName, - pkg_ffi.UnsignedInt options); +typedef NativeClang_saveTranslationUnit = ffi.Int Function(CXTranslationUnit TU, + ffi.Pointer FileName, ffi.UnsignedInt options); typedef DartClang_saveTranslationUnit = int Function( - CXTranslationUnit TU, ffi.Pointer FileName, int options); -typedef NativeClang_suspendTranslationUnit = pkg_ffi.UnsignedInt Function( + CXTranslationUnit TU, ffi.Pointer FileName, int options); +typedef NativeClang_suspendTranslationUnit = ffi.UnsignedInt Function( CXTranslationUnit arg0); typedef DartClang_suspendTranslationUnit = int Function(CXTranslationUnit arg0); typedef NativeClang_disposeTranslationUnit = ffi.Void Function( CXTranslationUnit arg0); typedef DartClang_disposeTranslationUnit = void Function( CXTranslationUnit arg0); -typedef NativeClang_defaultReparseOptions = pkg_ffi.UnsignedInt Function( +typedef NativeClang_defaultReparseOptions = ffi.UnsignedInt Function( CXTranslationUnit TU); typedef DartClang_defaultReparseOptions = int Function(CXTranslationUnit TU); -typedef NativeClang_reparseTranslationUnit = pkg_ffi.Int Function( +typedef NativeClang_reparseTranslationUnit = ffi.Int Function( CXTranslationUnit TU, - pkg_ffi.UnsignedInt num_unsaved_files, + ffi.UnsignedInt num_unsaved_files, ffi.Pointer unsaved_files, - pkg_ffi.UnsignedInt options); + ffi.UnsignedInt options); typedef DartClang_reparseTranslationUnit = int Function( CXTranslationUnit TU, int num_unsaved_files, @@ -8254,16 +8245,16 @@ abstract class CXTUResourceUsageKind { static const int CXTUResourceUsage_Last = 14; } -typedef NativeClang_getTUResourceUsageName = ffi.Pointer Function( +typedef NativeClang_getTUResourceUsageName = ffi.Pointer Function( ffi.Int32 kind); -typedef DartClang_getTUResourceUsageName = ffi.Pointer Function( +typedef DartClang_getTUResourceUsageName = ffi.Pointer Function( int kind); class CXTUResourceUsageEntry extends ffi.Struct { @ffi.Int32() external int kind; - @custom_import.UnsignedLong() + @ffi.UnsignedLong() external int amount; } @@ -8271,7 +8262,7 @@ class CXTUResourceUsageEntry extends ffi.Struct { class CXTUResourceUsage extends ffi.Struct { external ffi.Pointer data; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int numEntries; external ffi.Pointer entries; @@ -8297,7 +8288,7 @@ typedef NativeClang_TargetInfo_dispose = ffi.Void Function(CXTargetInfo Info); typedef DartClang_TargetInfo_dispose = void Function(CXTargetInfo Info); typedef NativeClang_TargetInfo_getTriple = CXString Function(CXTargetInfo Info); typedef DartClang_TargetInfo_getTriple = CXString Function(CXTargetInfo Info); -typedef NativeClang_TargetInfo_getPointerWidth = pkg_ffi.Int Function( +typedef NativeClang_TargetInfo_getPointerWidth = ffi.Int Function( CXTargetInfo Info); typedef DartClang_TargetInfo_getPointerWidth = int Function(CXTargetInfo Info); @@ -8321,7 +8312,7 @@ class CXCursor extends ffi.Struct { @ffi.Int32() external int kind; - @pkg_ffi.Int() + @ffi.Int() external int xdata; @ffi.Array.multi([3]) @@ -9120,40 +9111,38 @@ typedef NativeClang_getTranslationUnitCursor = CXCursor Function( CXTranslationUnit arg0); typedef DartClang_getTranslationUnitCursor = CXCursor Function( CXTranslationUnit arg0); -typedef NativeClang_equalCursors = pkg_ffi.UnsignedInt Function( +typedef NativeClang_equalCursors = ffi.UnsignedInt Function( CXCursor arg0, CXCursor arg1); typedef DartClang_equalCursors = int Function(CXCursor arg0, CXCursor arg1); -typedef NativeClang_Cursor_isNull = pkg_ffi.Int Function(CXCursor cursor); +typedef NativeClang_Cursor_isNull = ffi.Int Function(CXCursor cursor); typedef DartClang_Cursor_isNull = int Function(CXCursor cursor); -typedef NativeClang_hashCursor = pkg_ffi.UnsignedInt Function(CXCursor arg0); +typedef NativeClang_hashCursor = ffi.UnsignedInt Function(CXCursor arg0); typedef DartClang_hashCursor = int Function(CXCursor arg0); typedef NativeClang_getCursorKind = ffi.Int32 Function(CXCursor arg0); typedef DartClang_getCursorKind = int Function(CXCursor arg0); -typedef NativeClang_isDeclaration = pkg_ffi.UnsignedInt Function( - ffi.Int32 arg0); +typedef NativeClang_isDeclaration = ffi.UnsignedInt Function(ffi.Int32 arg0); typedef DartClang_isDeclaration = int Function(int arg0); -typedef NativeClang_isInvalidDeclaration = pkg_ffi.UnsignedInt Function( +typedef NativeClang_isInvalidDeclaration = ffi.UnsignedInt Function( CXCursor arg0); typedef DartClang_isInvalidDeclaration = int Function(CXCursor arg0); -typedef NativeClang_isReference = pkg_ffi.UnsignedInt Function(ffi.Int32 arg0); +typedef NativeClang_isReference = ffi.UnsignedInt Function(ffi.Int32 arg0); typedef DartClang_isReference = int Function(int arg0); -typedef NativeClang_isExpression = pkg_ffi.UnsignedInt Function(ffi.Int32 arg0); +typedef NativeClang_isExpression = ffi.UnsignedInt Function(ffi.Int32 arg0); typedef DartClang_isExpression = int Function(int arg0); -typedef NativeClang_isStatement = pkg_ffi.UnsignedInt Function(ffi.Int32 arg0); +typedef NativeClang_isStatement = ffi.UnsignedInt Function(ffi.Int32 arg0); typedef DartClang_isStatement = int Function(int arg0); -typedef NativeClang_isAttribute = pkg_ffi.UnsignedInt Function(ffi.Int32 arg0); +typedef NativeClang_isAttribute = ffi.UnsignedInt Function(ffi.Int32 arg0); typedef DartClang_isAttribute = int Function(int arg0); -typedef NativeClang_Cursor_hasAttrs = pkg_ffi.UnsignedInt Function(CXCursor C); +typedef NativeClang_Cursor_hasAttrs = ffi.UnsignedInt Function(CXCursor C); typedef DartClang_Cursor_hasAttrs = int Function(CXCursor C); -typedef NativeClang_isInvalid = pkg_ffi.UnsignedInt Function(ffi.Int32 arg0); +typedef NativeClang_isInvalid = ffi.UnsignedInt Function(ffi.Int32 arg0); typedef DartClang_isInvalid = int Function(int arg0); -typedef NativeClang_isTranslationUnit = pkg_ffi.UnsignedInt Function( +typedef NativeClang_isTranslationUnit = ffi.UnsignedInt Function( ffi.Int32 arg0); typedef DartClang_isTranslationUnit = int Function(int arg0); -typedef NativeClang_isPreprocessing = pkg_ffi.UnsignedInt Function( - ffi.Int32 arg0); +typedef NativeClang_isPreprocessing = ffi.UnsignedInt Function(ffi.Int32 arg0); typedef DartClang_isPreprocessing = int Function(int arg0); -typedef NativeClang_isUnexposed = pkg_ffi.UnsignedInt Function(ffi.Int32 arg0); +typedef NativeClang_isUnexposed = ffi.UnsignedInt Function(ffi.Int32 arg0); typedef DartClang_isUnexposed = int Function(int arg0); /// Describe the linkage of the entity referred to by a cursor. @@ -9241,7 +9230,7 @@ class CXPlatformAvailability extends ffi.Struct { external CXVersion Obsoleted; /// Whether the entity is unconditionally unavailable on this platform. - @pkg_ffi.Int() + @ffi.Int() external int Unavailable; /// An optional message to provide to a user of this API, e.g., to @@ -9249,19 +9238,19 @@ class CXPlatformAvailability extends ffi.Struct { external CXString Message; } -typedef NativeClang_getCursorPlatformAvailability = pkg_ffi.Int Function( +typedef NativeClang_getCursorPlatformAvailability = ffi.Int Function( CXCursor cursor, - ffi.Pointer always_deprecated, + ffi.Pointer always_deprecated, ffi.Pointer deprecated_message, - ffi.Pointer always_unavailable, + ffi.Pointer always_unavailable, ffi.Pointer unavailable_message, ffi.Pointer availability, - pkg_ffi.Int availability_size); + ffi.Int availability_size); typedef DartClang_getCursorPlatformAvailability = int Function( CXCursor cursor, - ffi.Pointer always_deprecated, + ffi.Pointer always_deprecated, ffi.Pointer deprecated_message, - ffi.Pointer always_unavailable, + ffi.Pointer always_unavailable, ffi.Pointer unavailable_message, ffi.Pointer availability, int availability_size); @@ -9302,11 +9291,11 @@ typedef NativeClang_createCXCursorSet = CXCursorSet Function(); typedef DartClang_createCXCursorSet = CXCursorSet Function(); typedef NativeClang_disposeCXCursorSet = ffi.Void Function(CXCursorSet cset); typedef DartClang_disposeCXCursorSet = void Function(CXCursorSet cset); -typedef NativeClang_CXCursorSet_contains = pkg_ffi.UnsignedInt Function( +typedef NativeClang_CXCursorSet_contains = ffi.UnsignedInt Function( CXCursorSet cset, CXCursor cursor); typedef DartClang_CXCursorSet_contains = int Function( CXCursorSet cset, CXCursor cursor); -typedef NativeClang_CXCursorSet_insert = pkg_ffi.UnsignedInt Function( +typedef NativeClang_CXCursorSet_insert = ffi.UnsignedInt Function( CXCursorSet cset, CXCursor cursor); typedef DartClang_CXCursorSet_insert = int Function( CXCursorSet cset, CXCursor cursor); @@ -9318,11 +9307,11 @@ typedef DartClang_getCursorLexicalParent = CXCursor Function(CXCursor cursor); typedef NativeClang_getOverriddenCursors = ffi.Void Function( CXCursor cursor, ffi.Pointer> overridden, - ffi.Pointer num_overridden); + ffi.Pointer num_overridden); typedef DartClang_getOverriddenCursors = void Function( CXCursor cursor, ffi.Pointer> overridden, - ffi.Pointer num_overridden); + ffi.Pointer num_overridden); typedef NativeClang_disposeOverriddenCursors = ffi.Void Function( ffi.Pointer overridden); typedef DartClang_disposeOverriddenCursors = void Function( @@ -9486,20 +9475,20 @@ typedef NativeClang_getTypedefDeclUnderlyingType = CXType Function(CXCursor C); typedef DartClang_getTypedefDeclUnderlyingType = CXType Function(CXCursor C); typedef NativeClang_getEnumDeclIntegerType = CXType Function(CXCursor C); typedef DartClang_getEnumDeclIntegerType = CXType Function(CXCursor C); -typedef NativeClang_getEnumConstantDeclValue = pkg_ffi.LongLong Function( +typedef NativeClang_getEnumConstantDeclValue = ffi.LongLong Function( CXCursor C); typedef DartClang_getEnumConstantDeclValue = int Function(CXCursor C); -typedef NativeClang_getEnumConstantDeclUnsignedValue = pkg_ffi.UnsignedLongLong +typedef NativeClang_getEnumConstantDeclUnsignedValue = ffi.UnsignedLongLong Function(CXCursor C); typedef DartClang_getEnumConstantDeclUnsignedValue = int Function(CXCursor C); -typedef NativeClang_getFieldDeclBitWidth = pkg_ffi.Int Function(CXCursor C); +typedef NativeClang_getFieldDeclBitWidth = ffi.Int Function(CXCursor C); typedef DartClang_getFieldDeclBitWidth = int Function(CXCursor C); -typedef NativeClang_Cursor_getNumArguments = pkg_ffi.Int Function(CXCursor C); +typedef NativeClang_Cursor_getNumArguments = ffi.Int Function(CXCursor C); typedef DartClang_Cursor_getNumArguments = int Function(CXCursor C); typedef NativeClang_Cursor_getArgument = CXCursor Function( - CXCursor C, pkg_ffi.UnsignedInt i); + CXCursor C, ffi.UnsignedInt i); typedef DartClang_Cursor_getArgument = CXCursor Function(CXCursor C, int i); -typedef NativeClang_Cursor_getNumTemplateArguments = pkg_ffi.Int Function( +typedef NativeClang_Cursor_getNumTemplateArguments = ffi.Int Function( CXCursor C); typedef DartClang_Cursor_getNumTemplateArguments = int Function(CXCursor C); @@ -9521,45 +9510,43 @@ abstract class CXTemplateArgumentKind { } typedef NativeClang_Cursor_getTemplateArgumentKind = ffi.Int32 Function( - CXCursor C, pkg_ffi.UnsignedInt I); + CXCursor C, ffi.UnsignedInt I); typedef DartClang_Cursor_getTemplateArgumentKind = int Function( CXCursor C, int I); typedef NativeClang_Cursor_getTemplateArgumentType = CXType Function( - CXCursor C, pkg_ffi.UnsignedInt I); + CXCursor C, ffi.UnsignedInt I); typedef DartClang_Cursor_getTemplateArgumentType = CXType Function( CXCursor C, int I); -typedef NativeClang_Cursor_getTemplateArgumentValue = pkg_ffi.LongLong Function( - CXCursor C, pkg_ffi.UnsignedInt I); +typedef NativeClang_Cursor_getTemplateArgumentValue = ffi.LongLong Function( + CXCursor C, ffi.UnsignedInt I); typedef DartClang_Cursor_getTemplateArgumentValue = int Function( CXCursor C, int I); typedef NativeClang_Cursor_getTemplateArgumentUnsignedValue - = pkg_ffi.UnsignedLongLong Function(CXCursor C, pkg_ffi.UnsignedInt I); + = ffi.UnsignedLongLong Function(CXCursor C, ffi.UnsignedInt I); typedef DartClang_Cursor_getTemplateArgumentUnsignedValue = int Function( CXCursor C, int I); -typedef NativeClang_equalTypes = pkg_ffi.UnsignedInt Function( - CXType A, CXType B); +typedef NativeClang_equalTypes = ffi.UnsignedInt Function(CXType A, CXType B); typedef DartClang_equalTypes = int Function(CXType A, CXType B); typedef NativeClang_getCanonicalType = CXType Function(CXType T); typedef DartClang_getCanonicalType = CXType Function(CXType T); -typedef NativeClang_isConstQualifiedType = pkg_ffi.UnsignedInt Function( - CXType T); +typedef NativeClang_isConstQualifiedType = ffi.UnsignedInt Function(CXType T); typedef DartClang_isConstQualifiedType = int Function(CXType T); -typedef NativeClang_Cursor_isMacroFunctionLike = pkg_ffi.UnsignedInt Function( +typedef NativeClang_Cursor_isMacroFunctionLike = ffi.UnsignedInt Function( CXCursor C); typedef DartClang_Cursor_isMacroFunctionLike = int Function(CXCursor C); -typedef NativeClang_Cursor_isMacroBuiltin = pkg_ffi.UnsignedInt Function( +typedef NativeClang_Cursor_isMacroBuiltin = ffi.UnsignedInt Function( CXCursor C); typedef DartClang_Cursor_isMacroBuiltin = int Function(CXCursor C); -typedef NativeClang_Cursor_isFunctionInlined = pkg_ffi.UnsignedInt Function( +typedef NativeClang_Cursor_isFunctionInlined = ffi.UnsignedInt Function( CXCursor C); typedef DartClang_Cursor_isFunctionInlined = int Function(CXCursor C); -typedef NativeClang_isVolatileQualifiedType = pkg_ffi.UnsignedInt Function( +typedef NativeClang_isVolatileQualifiedType = ffi.UnsignedInt Function( CXType T); typedef DartClang_isVolatileQualifiedType = int Function(CXType T); -typedef NativeClang_isRestrictQualifiedType = pkg_ffi.UnsignedInt Function( +typedef NativeClang_isRestrictQualifiedType = ffi.UnsignedInt Function( CXType T); typedef DartClang_isRestrictQualifiedType = int Function(CXType T); -typedef NativeClang_getAddressSpace = pkg_ffi.UnsignedInt Function(CXType T); +typedef NativeClang_getAddressSpace = ffi.UnsignedInt Function(CXType T); typedef DartClang_getAddressSpace = int Function(CXType T); typedef NativeClang_getTypedefName = CXString Function(CXType CT); typedef DartClang_getTypedefName = CXString Function(CXType CT); @@ -9602,50 +9589,47 @@ typedef NativeClang_getFunctionTypeCallingConv = ffi.Int32 Function(CXType T); typedef DartClang_getFunctionTypeCallingConv = int Function(CXType T); typedef NativeClang_getResultType = CXType Function(CXType T); typedef DartClang_getResultType = CXType Function(CXType T); -typedef NativeClang_getExceptionSpecificationType = pkg_ffi.Int Function( - CXType T); +typedef NativeClang_getExceptionSpecificationType = ffi.Int Function(CXType T); typedef DartClang_getExceptionSpecificationType = int Function(CXType T); -typedef NativeClang_getNumArgTypes = pkg_ffi.Int Function(CXType T); +typedef NativeClang_getNumArgTypes = ffi.Int Function(CXType T); typedef DartClang_getNumArgTypes = int Function(CXType T); -typedef NativeClang_getArgType = CXType Function( - CXType T, pkg_ffi.UnsignedInt i); +typedef NativeClang_getArgType = CXType Function(CXType T, ffi.UnsignedInt i); typedef DartClang_getArgType = CXType Function(CXType T, int i); typedef NativeClang_Type_getObjCObjectBaseType = CXType Function(CXType T); typedef DartClang_Type_getObjCObjectBaseType = CXType Function(CXType T); -typedef NativeClang_Type_getNumObjCProtocolRefs = pkg_ffi.UnsignedInt Function( +typedef NativeClang_Type_getNumObjCProtocolRefs = ffi.UnsignedInt Function( CXType T); typedef DartClang_Type_getNumObjCProtocolRefs = int Function(CXType T); typedef NativeClang_Type_getObjCProtocolDecl = CXCursor Function( - CXType T, pkg_ffi.UnsignedInt i); + CXType T, ffi.UnsignedInt i); typedef DartClang_Type_getObjCProtocolDecl = CXCursor Function(CXType T, int i); -typedef NativeClang_Type_getNumObjCTypeArgs = pkg_ffi.UnsignedInt Function( +typedef NativeClang_Type_getNumObjCTypeArgs = ffi.UnsignedInt Function( CXType T); typedef DartClang_Type_getNumObjCTypeArgs = int Function(CXType T); typedef NativeClang_Type_getObjCTypeArg = CXType Function( - CXType T, pkg_ffi.UnsignedInt i); + CXType T, ffi.UnsignedInt i); typedef DartClang_Type_getObjCTypeArg = CXType Function(CXType T, int i); -typedef NativeClang_isFunctionTypeVariadic = pkg_ffi.UnsignedInt Function( - CXType T); +typedef NativeClang_isFunctionTypeVariadic = ffi.UnsignedInt Function(CXType T); typedef DartClang_isFunctionTypeVariadic = int Function(CXType T); typedef NativeClang_getCursorResultType = CXType Function(CXCursor C); typedef DartClang_getCursorResultType = CXType Function(CXCursor C); -typedef NativeClang_getCursorExceptionSpecificationType = pkg_ffi.Int Function( +typedef NativeClang_getCursorExceptionSpecificationType = ffi.Int Function( CXCursor C); typedef DartClang_getCursorExceptionSpecificationType = int Function( CXCursor C); -typedef NativeClang_isPODType = pkg_ffi.UnsignedInt Function(CXType T); +typedef NativeClang_isPODType = ffi.UnsignedInt Function(CXType T); typedef DartClang_isPODType = int Function(CXType T); typedef NativeClang_getElementType = CXType Function(CXType T); typedef DartClang_getElementType = CXType Function(CXType T); -typedef NativeClang_getNumElements = pkg_ffi.LongLong Function(CXType T); +typedef NativeClang_getNumElements = ffi.LongLong Function(CXType T); typedef DartClang_getNumElements = int Function(CXType T); typedef NativeClang_getArrayElementType = CXType Function(CXType T); typedef DartClang_getArrayElementType = CXType Function(CXType T); -typedef NativeClang_getArraySize = pkg_ffi.LongLong Function(CXType T); +typedef NativeClang_getArraySize = ffi.LongLong Function(CXType T); typedef DartClang_getArraySize = int Function(CXType T); typedef NativeClang_Type_getNamedType = CXType Function(CXType T); typedef DartClang_Type_getNamedType = CXType Function(CXType T); -typedef NativeClang_Type_isTransparentTagTypedef = pkg_ffi.UnsignedInt Function( +typedef NativeClang_Type_isTransparentTagTypedef = ffi.UnsignedInt Function( CXType T); typedef DartClang_Type_isTransparentTagTypedef = int Function(CXType T); @@ -9668,35 +9652,32 @@ abstract class CXTypeNullabilityKind { typedef NativeClang_Type_getNullability = ffi.Int32 Function(CXType T); typedef DartClang_Type_getNullability = int Function(CXType T); -typedef NativeClang_Type_getAlignOf = pkg_ffi.LongLong Function(CXType T); +typedef NativeClang_Type_getAlignOf = ffi.LongLong Function(CXType T); typedef DartClang_Type_getAlignOf = int Function(CXType T); typedef NativeClang_Type_getClassType = CXType Function(CXType T); typedef DartClang_Type_getClassType = CXType Function(CXType T); -typedef NativeClang_Type_getSizeOf = pkg_ffi.LongLong Function(CXType T); +typedef NativeClang_Type_getSizeOf = ffi.LongLong Function(CXType T); typedef DartClang_Type_getSizeOf = int Function(CXType T); -typedef NativeClang_Type_getOffsetOf = pkg_ffi.LongLong Function( - CXType T, ffi.Pointer S); +typedef NativeClang_Type_getOffsetOf = ffi.LongLong Function( + CXType T, ffi.Pointer S); typedef DartClang_Type_getOffsetOf = int Function( - CXType T, ffi.Pointer S); + CXType T, ffi.Pointer S); typedef NativeClang_Type_getModifiedType = CXType Function(CXType T); typedef DartClang_Type_getModifiedType = CXType Function(CXType T); -typedef NativeClang_Cursor_getOffsetOfField = pkg_ffi.LongLong Function( - CXCursor C); +typedef NativeClang_Cursor_getOffsetOfField = ffi.LongLong Function(CXCursor C); typedef DartClang_Cursor_getOffsetOfField = int Function(CXCursor C); -typedef NativeClang_Cursor_isAnonymous = pkg_ffi.UnsignedInt Function( - CXCursor C); +typedef NativeClang_Cursor_isAnonymous = ffi.UnsignedInt Function(CXCursor C); typedef DartClang_Cursor_isAnonymous = int Function(CXCursor C); -typedef NativeClang_Cursor_isAnonymousRecordDecl = pkg_ffi.UnsignedInt Function( +typedef NativeClang_Cursor_isAnonymousRecordDecl = ffi.UnsignedInt Function( CXCursor C); typedef DartClang_Cursor_isAnonymousRecordDecl = int Function(CXCursor C); -typedef NativeClang_Cursor_isInlineNamespace = pkg_ffi.UnsignedInt Function( +typedef NativeClang_Cursor_isInlineNamespace = ffi.UnsignedInt Function( CXCursor C); typedef DartClang_Cursor_isInlineNamespace = int Function(CXCursor C); -typedef NativeClang_Type_getNumTemplateArguments = pkg_ffi.Int Function( - CXType T); +typedef NativeClang_Type_getNumTemplateArguments = ffi.Int Function(CXType T); typedef DartClang_Type_getNumTemplateArguments = int Function(CXType T); typedef NativeClang_Type_getTemplateArgumentAsType = CXType Function( - CXType T, pkg_ffi.UnsignedInt i); + CXType T, ffi.UnsignedInt i); typedef DartClang_Type_getTemplateArgumentAsType = CXType Function( CXType T, int i); @@ -9713,10 +9694,9 @@ abstract class CXRefQualifierKind { typedef NativeClang_Type_getCXXRefQualifier = ffi.Int32 Function(CXType T); typedef DartClang_Type_getCXXRefQualifier = int Function(CXType T); -typedef NativeClang_Cursor_isBitField = pkg_ffi.UnsignedInt Function( - CXCursor C); +typedef NativeClang_Cursor_isBitField = ffi.UnsignedInt Function(CXCursor C); typedef DartClang_Cursor_isBitField = int Function(CXCursor C); -typedef NativeClang_isVirtualBase = pkg_ffi.UnsignedInt Function(CXCursor arg0); +typedef NativeClang_isVirtualBase = ffi.UnsignedInt Function(CXCursor arg0); typedef DartClang_isVirtualBase = int Function(CXCursor arg0); /// Represents the C++ access control level to a base class for a @@ -9746,11 +9726,11 @@ abstract class CX_StorageClass { typedef NativeClang_Cursor_getStorageClass = ffi.Int32 Function(CXCursor arg0); typedef DartClang_Cursor_getStorageClass = int Function(CXCursor arg0); -typedef NativeClang_getNumOverloadedDecls = pkg_ffi.UnsignedInt Function( +typedef NativeClang_getNumOverloadedDecls = ffi.UnsignedInt Function( CXCursor cursor); typedef DartClang_getNumOverloadedDecls = int Function(CXCursor cursor); typedef NativeClang_getOverloadedDecl = CXCursor Function( - CXCursor cursor, pkg_ffi.UnsignedInt index); + CXCursor cursor, ffi.UnsignedInt index); typedef DartClang_getOverloadedDecl = CXCursor Function( CXCursor cursor, int index); typedef NativeClang_getIBOutletCollectionType = CXType Function(CXCursor arg0); @@ -9790,44 +9770,42 @@ abstract class CXChildVisitResult { /// Opaque pointer representing client data that will be passed through /// to various callbacks and visitors. typedef CXClientData = ffi.Pointer; -typedef NativeClang_visitChildren = pkg_ffi.UnsignedInt Function( +typedef NativeClang_visitChildren = ffi.UnsignedInt Function( CXCursor parent, CXCursorVisitor visitor, CXClientData client_data); typedef DartClang_visitChildren = int Function( CXCursor parent, CXCursorVisitor visitor, CXClientData client_data); typedef NativeClang_getCursorUSR = CXString Function(CXCursor arg0); typedef DartClang_getCursorUSR = CXString Function(CXCursor arg0); typedef NativeClang_constructUSR_ObjCClass = CXString Function( - ffi.Pointer class_name); + ffi.Pointer class_name); typedef DartClang_constructUSR_ObjCClass = CXString Function( - ffi.Pointer class_name); + ffi.Pointer class_name); typedef NativeClang_constructUSR_ObjCCategory = CXString Function( - ffi.Pointer class_name, - ffi.Pointer category_name); + ffi.Pointer class_name, ffi.Pointer category_name); typedef DartClang_constructUSR_ObjCCategory = CXString Function( - ffi.Pointer class_name, - ffi.Pointer category_name); + ffi.Pointer class_name, ffi.Pointer category_name); typedef NativeClang_constructUSR_ObjCProtocol = CXString Function( - ffi.Pointer protocol_name); + ffi.Pointer protocol_name); typedef DartClang_constructUSR_ObjCProtocol = CXString Function( - ffi.Pointer protocol_name); + ffi.Pointer protocol_name); typedef NativeClang_constructUSR_ObjCIvar = CXString Function( - ffi.Pointer name, CXString classUSR); + ffi.Pointer name, CXString classUSR); typedef DartClang_constructUSR_ObjCIvar = CXString Function( - ffi.Pointer name, CXString classUSR); + ffi.Pointer name, CXString classUSR); typedef NativeClang_constructUSR_ObjCMethod = CXString Function( - ffi.Pointer name, - pkg_ffi.UnsignedInt isInstanceMethod, + ffi.Pointer name, + ffi.UnsignedInt isInstanceMethod, CXString classUSR); typedef DartClang_constructUSR_ObjCMethod = CXString Function( - ffi.Pointer name, int isInstanceMethod, CXString classUSR); + ffi.Pointer name, int isInstanceMethod, CXString classUSR); typedef NativeClang_constructUSR_ObjCProperty = CXString Function( - ffi.Pointer property, CXString classUSR); + ffi.Pointer property, CXString classUSR); typedef DartClang_constructUSR_ObjCProperty = CXString Function( - ffi.Pointer property, CXString classUSR); + ffi.Pointer property, CXString classUSR); typedef NativeClang_getCursorSpelling = CXString Function(CXCursor arg0); typedef DartClang_getCursorSpelling = CXString Function(CXCursor arg0); typedef NativeClang_Cursor_getSpellingNameRange = CXSourceRange Function( - CXCursor arg0, pkg_ffi.UnsignedInt pieceIndex, pkg_ffi.UnsignedInt options); + CXCursor arg0, ffi.UnsignedInt pieceIndex, ffi.UnsignedInt options); typedef DartClang_Cursor_getSpellingNameRange = CXSourceRange Function( CXCursor arg0, int pieceIndex, int options); @@ -9868,12 +9846,12 @@ abstract class CXPrintingPolicyProperty { static const int CXPrintingPolicy_LastProperty = 25; } -typedef NativeClang_PrintingPolicy_getProperty = pkg_ffi.UnsignedInt Function( +typedef NativeClang_PrintingPolicy_getProperty = ffi.UnsignedInt Function( CXPrintingPolicy Policy, ffi.Int32 Property); typedef DartClang_PrintingPolicy_getProperty = int Function( CXPrintingPolicy Policy, int Property); typedef NativeClang_PrintingPolicy_setProperty = ffi.Void Function( - CXPrintingPolicy Policy, ffi.Int32 Property, pkg_ffi.UnsignedInt Value); + CXPrintingPolicy Policy, ffi.Int32 Property, ffi.UnsignedInt Value); typedef DartClang_PrintingPolicy_setProperty = void Function( CXPrintingPolicy Policy, int Property, int Value); typedef NativeClang_getCursorPrintingPolicy = CXPrintingPolicy Function( @@ -9894,20 +9872,20 @@ typedef NativeClang_getCursorReferenced = CXCursor Function(CXCursor arg0); typedef DartClang_getCursorReferenced = CXCursor Function(CXCursor arg0); typedef NativeClang_getCursorDefinition = CXCursor Function(CXCursor arg0); typedef DartClang_getCursorDefinition = CXCursor Function(CXCursor arg0); -typedef NativeClang_isCursorDefinition = pkg_ffi.UnsignedInt Function( +typedef NativeClang_isCursorDefinition = ffi.UnsignedInt Function( CXCursor arg0); typedef DartClang_isCursorDefinition = int Function(CXCursor arg0); typedef NativeClang_getCanonicalCursor = CXCursor Function(CXCursor arg0); typedef DartClang_getCanonicalCursor = CXCursor Function(CXCursor arg0); -typedef NativeClang_Cursor_getObjCSelectorIndex = pkg_ffi.Int Function( +typedef NativeClang_Cursor_getObjCSelectorIndex = ffi.Int Function( CXCursor arg0); typedef DartClang_Cursor_getObjCSelectorIndex = int Function(CXCursor arg0); -typedef NativeClang_Cursor_isDynamicCall = pkg_ffi.Int Function(CXCursor C); +typedef NativeClang_Cursor_isDynamicCall = ffi.Int Function(CXCursor C); typedef DartClang_Cursor_isDynamicCall = int Function(CXCursor C); typedef NativeClang_Cursor_getReceiverType = CXType Function(CXCursor C); typedef DartClang_Cursor_getReceiverType = CXType Function(CXCursor C); -typedef NativeClang_Cursor_getObjCPropertyAttributes = pkg_ffi.UnsignedInt - Function(CXCursor C, pkg_ffi.UnsignedInt reserved); +typedef NativeClang_Cursor_getObjCPropertyAttributes = ffi.UnsignedInt Function( + CXCursor C, ffi.UnsignedInt reserved); typedef DartClang_Cursor_getObjCPropertyAttributes = int Function( CXCursor C, int reserved); typedef NativeClang_Cursor_getObjCPropertyGetterName = CXString Function( @@ -9918,25 +9896,24 @@ typedef NativeClang_Cursor_getObjCPropertySetterName = CXString Function( CXCursor C); typedef DartClang_Cursor_getObjCPropertySetterName = CXString Function( CXCursor C); -typedef NativeClang_Cursor_getObjCDeclQualifiers = pkg_ffi.UnsignedInt Function( +typedef NativeClang_Cursor_getObjCDeclQualifiers = ffi.UnsignedInt Function( CXCursor C); typedef DartClang_Cursor_getObjCDeclQualifiers = int Function(CXCursor C); -typedef NativeClang_Cursor_isObjCOptional = pkg_ffi.UnsignedInt Function( +typedef NativeClang_Cursor_isObjCOptional = ffi.UnsignedInt Function( CXCursor C); typedef DartClang_Cursor_isObjCOptional = int Function(CXCursor C); -typedef NativeClang_Cursor_isVariadic = pkg_ffi.UnsignedInt Function( - CXCursor C); +typedef NativeClang_Cursor_isVariadic = ffi.UnsignedInt Function(CXCursor C); typedef DartClang_Cursor_isVariadic = int Function(CXCursor C); -typedef NativeClang_Cursor_isExternalSymbol = pkg_ffi.UnsignedInt Function( +typedef NativeClang_Cursor_isExternalSymbol = ffi.UnsignedInt Function( CXCursor C, ffi.Pointer language, ffi.Pointer definedIn, - ffi.Pointer isGenerated); + ffi.Pointer isGenerated); typedef DartClang_Cursor_isExternalSymbol = int Function( CXCursor C, ffi.Pointer language, ffi.Pointer definedIn, - ffi.Pointer isGenerated); + ffi.Pointer isGenerated); typedef NativeClang_Cursor_getCommentRange = CXSourceRange Function(CXCursor C); typedef DartClang_Cursor_getCommentRange = CXSourceRange Function(CXCursor C); typedef NativeClang_Cursor_getRawCommentText = CXString Function(CXCursor C); @@ -9974,53 +9951,47 @@ typedef NativeClang_Module_getName = CXString Function(CXModule Module); typedef DartClang_Module_getName = CXString Function(CXModule Module); typedef NativeClang_Module_getFullName = CXString Function(CXModule Module); typedef DartClang_Module_getFullName = CXString Function(CXModule Module); -typedef NativeClang_Module_isSystem = pkg_ffi.Int Function(CXModule Module); +typedef NativeClang_Module_isSystem = ffi.Int Function(CXModule Module); typedef DartClang_Module_isSystem = int Function(CXModule Module); -typedef NativeClang_Module_getNumTopLevelHeaders = pkg_ffi.UnsignedInt Function( +typedef NativeClang_Module_getNumTopLevelHeaders = ffi.UnsignedInt Function( CXTranslationUnit arg0, CXModule Module); typedef DartClang_Module_getNumTopLevelHeaders = int Function( CXTranslationUnit arg0, CXModule Module); typedef NativeClang_Module_getTopLevelHeader = CXFile Function( - CXTranslationUnit arg0, CXModule Module, pkg_ffi.UnsignedInt Index); + CXTranslationUnit arg0, CXModule Module, ffi.UnsignedInt Index); typedef DartClang_Module_getTopLevelHeader = CXFile Function( CXTranslationUnit arg0, CXModule Module, int Index); -typedef NativeClang_CXXConstructor_isConvertingConstructor = pkg_ffi.UnsignedInt +typedef NativeClang_CXXConstructor_isConvertingConstructor = ffi.UnsignedInt Function(CXCursor C); typedef DartClang_CXXConstructor_isConvertingConstructor = int Function( CXCursor C); -typedef NativeClang_CXXConstructor_isCopyConstructor = pkg_ffi.UnsignedInt - Function(CXCursor C); +typedef NativeClang_CXXConstructor_isCopyConstructor = ffi.UnsignedInt Function( + CXCursor C); typedef DartClang_CXXConstructor_isCopyConstructor = int Function(CXCursor C); -typedef NativeClang_CXXConstructor_isDefaultConstructor = pkg_ffi.UnsignedInt +typedef NativeClang_CXXConstructor_isDefaultConstructor = ffi.UnsignedInt Function(CXCursor C); typedef DartClang_CXXConstructor_isDefaultConstructor = int Function( CXCursor C); -typedef NativeClang_CXXConstructor_isMoveConstructor = pkg_ffi.UnsignedInt - Function(CXCursor C); -typedef DartClang_CXXConstructor_isMoveConstructor = int Function(CXCursor C); -typedef NativeClang_CXXField_isMutable = pkg_ffi.UnsignedInt Function( +typedef NativeClang_CXXConstructor_isMoveConstructor = ffi.UnsignedInt Function( CXCursor C); +typedef DartClang_CXXConstructor_isMoveConstructor = int Function(CXCursor C); +typedef NativeClang_CXXField_isMutable = ffi.UnsignedInt Function(CXCursor C); typedef DartClang_CXXField_isMutable = int Function(CXCursor C); -typedef NativeClang_CXXMethod_isDefaulted = pkg_ffi.UnsignedInt Function( +typedef NativeClang_CXXMethod_isDefaulted = ffi.UnsignedInt Function( CXCursor C); typedef DartClang_CXXMethod_isDefaulted = int Function(CXCursor C); -typedef NativeClang_CXXMethod_isPureVirtual = pkg_ffi.UnsignedInt Function( +typedef NativeClang_CXXMethod_isPureVirtual = ffi.UnsignedInt Function( CXCursor C); typedef DartClang_CXXMethod_isPureVirtual = int Function(CXCursor C); -typedef NativeClang_CXXMethod_isStatic = pkg_ffi.UnsignedInt Function( - CXCursor C); +typedef NativeClang_CXXMethod_isStatic = ffi.UnsignedInt Function(CXCursor C); typedef DartClang_CXXMethod_isStatic = int Function(CXCursor C); -typedef NativeClang_CXXMethod_isVirtual = pkg_ffi.UnsignedInt Function( - CXCursor C); +typedef NativeClang_CXXMethod_isVirtual = ffi.UnsignedInt Function(CXCursor C); typedef DartClang_CXXMethod_isVirtual = int Function(CXCursor C); -typedef NativeClang_CXXRecord_isAbstract = pkg_ffi.UnsignedInt Function( - CXCursor C); +typedef NativeClang_CXXRecord_isAbstract = ffi.UnsignedInt Function(CXCursor C); typedef DartClang_CXXRecord_isAbstract = int Function(CXCursor C); -typedef NativeClang_EnumDecl_isScoped = pkg_ffi.UnsignedInt Function( - CXCursor C); +typedef NativeClang_EnumDecl_isScoped = ffi.UnsignedInt Function(CXCursor C); typedef DartClang_EnumDecl_isScoped = int Function(CXCursor C); -typedef NativeClang_CXXMethod_isConst = pkg_ffi.UnsignedInt Function( - CXCursor C); +typedef NativeClang_CXXMethod_isConst = ffi.UnsignedInt Function(CXCursor C); typedef DartClang_CXXMethod_isConst = int Function(CXCursor C); typedef NativeClang_getTemplateCursorKind = ffi.Int32 Function(CXCursor C); typedef DartClang_getTemplateCursorKind = int Function(CXCursor C); @@ -10028,14 +9999,14 @@ typedef NativeClang_getSpecializedCursorTemplate = CXCursor Function( CXCursor C); typedef DartClang_getSpecializedCursorTemplate = CXCursor Function(CXCursor C); typedef NativeClang_getCursorReferenceNameRange = CXSourceRange Function( - CXCursor C, pkg_ffi.UnsignedInt NameFlags, pkg_ffi.UnsignedInt PieceIndex); + CXCursor C, ffi.UnsignedInt NameFlags, ffi.UnsignedInt PieceIndex); typedef DartClang_getCursorReferenceNameRange = CXSourceRange Function( CXCursor C, int NameFlags, int PieceIndex); /// Describes a single preprocessing token. class CXToken extends ffi.Struct { @ffi.Array.multi([4]) - external ffi.Array int_data; + external ffi.Array int_data; external ffi.Pointer ptr_data; } @@ -10081,48 +10052,48 @@ typedef NativeClang_tokenize = ffi.Void Function( CXTranslationUnit TU, CXSourceRange Range, ffi.Pointer> Tokens, - ffi.Pointer NumTokens); + ffi.Pointer NumTokens); typedef DartClang_tokenize = void Function( CXTranslationUnit TU, CXSourceRange Range, ffi.Pointer> Tokens, - ffi.Pointer NumTokens); + ffi.Pointer NumTokens); typedef NativeClang_annotateTokens = ffi.Void Function( CXTranslationUnit TU, ffi.Pointer Tokens, - pkg_ffi.UnsignedInt NumTokens, + ffi.UnsignedInt NumTokens, ffi.Pointer Cursors); typedef DartClang_annotateTokens = void Function(CXTranslationUnit TU, ffi.Pointer Tokens, int NumTokens, ffi.Pointer Cursors); typedef NativeClang_disposeTokens = ffi.Void Function(CXTranslationUnit TU, - ffi.Pointer Tokens, pkg_ffi.UnsignedInt NumTokens); + ffi.Pointer Tokens, ffi.UnsignedInt NumTokens); typedef DartClang_disposeTokens = void Function( CXTranslationUnit TU, ffi.Pointer Tokens, int NumTokens); typedef NativeClang_getCursorKindSpelling = CXString Function(ffi.Int32 Kind); typedef DartClang_getCursorKindSpelling = CXString Function(int Kind); typedef NativeClang_getDefinitionSpellingAndExtent = ffi.Void Function( CXCursor arg0, - ffi.Pointer> startBuf, - ffi.Pointer> endBuf, - ffi.Pointer startLine, - ffi.Pointer startColumn, - ffi.Pointer endLine, - ffi.Pointer endColumn); + ffi.Pointer> startBuf, + ffi.Pointer> endBuf, + ffi.Pointer startLine, + ffi.Pointer startColumn, + ffi.Pointer endLine, + ffi.Pointer endColumn); typedef DartClang_getDefinitionSpellingAndExtent = void Function( CXCursor arg0, - ffi.Pointer> startBuf, - ffi.Pointer> endBuf, - ffi.Pointer startLine, - ffi.Pointer startColumn, - ffi.Pointer endLine, - ffi.Pointer endColumn); + ffi.Pointer> startBuf, + ffi.Pointer> endBuf, + ffi.Pointer startLine, + ffi.Pointer startColumn, + ffi.Pointer endLine, + ffi.Pointer endColumn); typedef NativeClang_enableStackTraces = ffi.Void Function(); typedef DartClang_enableStackTraces = void Function(); typedef NativeClang_executeOnThread = ffi.Void Function( ffi.Pointer)>> fn, ffi.Pointer user_data, - pkg_ffi.UnsignedInt stack_size); + ffi.UnsignedInt stack_size); typedef DartClang_executeOnThread = void Function( ffi.Pointer)>> fn, @@ -10308,23 +10279,23 @@ abstract class CXCompletionChunkKind { } typedef NativeClang_getCompletionChunkKind = ffi.Int32 Function( - CXCompletionString completion_string, pkg_ffi.UnsignedInt chunk_number); + CXCompletionString completion_string, ffi.UnsignedInt chunk_number); typedef DartClang_getCompletionChunkKind = int Function( CXCompletionString completion_string, int chunk_number); typedef NativeClang_getCompletionChunkText = CXString Function( - CXCompletionString completion_string, pkg_ffi.UnsignedInt chunk_number); + CXCompletionString completion_string, ffi.UnsignedInt chunk_number); typedef DartClang_getCompletionChunkText = CXString Function( CXCompletionString completion_string, int chunk_number); typedef NativeClang_getCompletionChunkCompletionString = CXCompletionString Function( - CXCompletionString completion_string, pkg_ffi.UnsignedInt chunk_number); + CXCompletionString completion_string, ffi.UnsignedInt chunk_number); typedef DartClang_getCompletionChunkCompletionString = CXCompletionString Function(CXCompletionString completion_string, int chunk_number); -typedef NativeClang_getNumCompletionChunks = pkg_ffi.UnsignedInt Function( +typedef NativeClang_getNumCompletionChunks = ffi.UnsignedInt Function( CXCompletionString completion_string); typedef DartClang_getNumCompletionChunks = int Function( CXCompletionString completion_string); -typedef NativeClang_getCompletionPriority = pkg_ffi.UnsignedInt Function( +typedef NativeClang_getCompletionPriority = ffi.UnsignedInt Function( CXCompletionString completion_string); typedef DartClang_getCompletionPriority = int Function( CXCompletionString completion_string); @@ -10332,13 +10303,12 @@ typedef NativeClang_getCompletionAvailability = ffi.Int32 Function( CXCompletionString completion_string); typedef DartClang_getCompletionAvailability = int Function( CXCompletionString completion_string); -typedef NativeClang_getCompletionNumAnnotations = pkg_ffi.UnsignedInt Function( +typedef NativeClang_getCompletionNumAnnotations = ffi.UnsignedInt Function( CXCompletionString completion_string); typedef DartClang_getCompletionNumAnnotations = int Function( CXCompletionString completion_string); typedef NativeClang_getCompletionAnnotation = CXString Function( - CXCompletionString completion_string, - pkg_ffi.UnsignedInt annotation_number); + CXCompletionString completion_string, ffi.UnsignedInt annotation_number); typedef DartClang_getCompletionAnnotation = CXString Function( CXCompletionString completion_string, int annotation_number); typedef NativeClang_getCompletionParent = CXString Function( @@ -10365,70 +10335,70 @@ class CXCodeCompleteResults extends ffi.Struct { /// The number of code-completion results stored in the /// \c Results array. - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int NumResults; } -typedef NativeClang_getCompletionNumFixIts = pkg_ffi.UnsignedInt Function( +typedef NativeClang_getCompletionNumFixIts = ffi.UnsignedInt Function( ffi.Pointer results, - pkg_ffi.UnsignedInt completion_index); + ffi.UnsignedInt completion_index); typedef DartClang_getCompletionNumFixIts = int Function( ffi.Pointer results, int completion_index); typedef NativeClang_getCompletionFixIt = CXString Function( ffi.Pointer results, - pkg_ffi.UnsignedInt completion_index, - pkg_ffi.UnsignedInt fixit_index, + ffi.UnsignedInt completion_index, + ffi.UnsignedInt fixit_index, ffi.Pointer replacement_range); typedef DartClang_getCompletionFixIt = CXString Function( ffi.Pointer results, int completion_index, int fixit_index, ffi.Pointer replacement_range); -typedef NativeClang_defaultCodeCompleteOptions = pkg_ffi.UnsignedInt Function(); +typedef NativeClang_defaultCodeCompleteOptions = ffi.UnsignedInt Function(); typedef DartClang_defaultCodeCompleteOptions = int Function(); typedef NativeClang_codeCompleteAt = ffi.Pointer Function( CXTranslationUnit TU, - ffi.Pointer complete_filename, - pkg_ffi.UnsignedInt complete_line, - pkg_ffi.UnsignedInt complete_column, + ffi.Pointer complete_filename, + ffi.UnsignedInt complete_line, + ffi.UnsignedInt complete_column, ffi.Pointer unsaved_files, - pkg_ffi.UnsignedInt num_unsaved_files, - pkg_ffi.UnsignedInt options); + ffi.UnsignedInt num_unsaved_files, + ffi.UnsignedInt options); typedef DartClang_codeCompleteAt = ffi.Pointer Function( CXTranslationUnit TU, - ffi.Pointer complete_filename, + ffi.Pointer complete_filename, int complete_line, int complete_column, ffi.Pointer unsaved_files, int num_unsaved_files, int options); typedef NativeClang_sortCodeCompletionResults = ffi.Void Function( - ffi.Pointer Results, pkg_ffi.UnsignedInt NumResults); + ffi.Pointer Results, ffi.UnsignedInt NumResults); typedef DartClang_sortCodeCompletionResults = void Function( ffi.Pointer Results, int NumResults); typedef NativeClang_disposeCodeCompleteResults = ffi.Void Function( ffi.Pointer Results); typedef DartClang_disposeCodeCompleteResults = void Function( ffi.Pointer Results); -typedef NativeClang_codeCompleteGetNumDiagnostics = pkg_ffi.UnsignedInt - Function(ffi.Pointer Results); +typedef NativeClang_codeCompleteGetNumDiagnostics = ffi.UnsignedInt Function( + ffi.Pointer Results); typedef DartClang_codeCompleteGetNumDiagnostics = int Function( ffi.Pointer Results); typedef NativeClang_codeCompleteGetDiagnostic = CXDiagnostic Function( - ffi.Pointer Results, pkg_ffi.UnsignedInt Index); + ffi.Pointer Results, ffi.UnsignedInt Index); typedef DartClang_codeCompleteGetDiagnostic = CXDiagnostic Function( ffi.Pointer Results, int Index); -typedef NativeClang_codeCompleteGetContexts = pkg_ffi.UnsignedLongLong Function( +typedef NativeClang_codeCompleteGetContexts = ffi.UnsignedLongLong Function( ffi.Pointer Results); typedef DartClang_codeCompleteGetContexts = int Function( ffi.Pointer Results); typedef NativeClang_codeCompleteGetContainerKind = ffi.Int32 Function( ffi.Pointer Results, - ffi.Pointer IsIncomplete); + ffi.Pointer IsIncomplete); typedef DartClang_codeCompleteGetContainerKind = int Function( ffi.Pointer Results, - ffi.Pointer IsIncomplete); + ffi.Pointer IsIncomplete); typedef NativeClang_codeCompleteGetContainerUSR = CXString Function( ffi.Pointer Results); typedef DartClang_codeCompleteGetContainerUSR = CXString Function( @@ -10440,7 +10410,7 @@ typedef DartClang_codeCompleteGetObjCSelector = CXString Function( typedef NativeClang_getClangVersion = CXString Function(); typedef DartClang_getClangVersion = CXString Function(); typedef NativeClang_toggleCrashRecovery = ffi.Void Function( - pkg_ffi.UnsignedInt isEnabled); + ffi.UnsignedInt isEnabled); typedef DartClang_toggleCrashRecovery = void Function(int isEnabled); /// Visitor invoked for each file in a translation unit @@ -10455,7 +10425,7 @@ typedef DartClang_toggleCrashRecovery = void Function(int isEnabled); typedef CXInclusionVisitor = ffi.Pointer< ffi.NativeFunction< ffi.Void Function(CXFile, ffi.Pointer, - pkg_ffi.UnsignedInt, CXClientData)>>; + ffi.UnsignedInt, CXClientData)>>; typedef NativeClang_getInclusions = ffi.Void Function( CXTranslationUnit tu, CXInclusionVisitor visitor, CXClientData client_data); typedef DartClang_getInclusions = void Function( @@ -10478,23 +10448,23 @@ abstract class CXEvalResultKind { typedef NativeClang_EvalResult_getKind = ffi.Int32 Function(CXEvalResult E); typedef DartClang_EvalResult_getKind = int Function(CXEvalResult E); -typedef NativeClang_EvalResult_getAsInt = pkg_ffi.Int Function(CXEvalResult E); +typedef NativeClang_EvalResult_getAsInt = ffi.Int Function(CXEvalResult E); typedef DartClang_EvalResult_getAsInt = int Function(CXEvalResult E); -typedef NativeClang_EvalResult_getAsLongLong = pkg_ffi.LongLong Function( +typedef NativeClang_EvalResult_getAsLongLong = ffi.LongLong Function( CXEvalResult E); typedef DartClang_EvalResult_getAsLongLong = int Function(CXEvalResult E); -typedef NativeClang_EvalResult_isUnsignedInt = pkg_ffi.UnsignedInt Function( +typedef NativeClang_EvalResult_isUnsignedInt = ffi.UnsignedInt Function( CXEvalResult E); typedef DartClang_EvalResult_isUnsignedInt = int Function(CXEvalResult E); -typedef NativeClang_EvalResult_getAsUnsigned = pkg_ffi.UnsignedLongLong - Function(CXEvalResult E); +typedef NativeClang_EvalResult_getAsUnsigned = ffi.UnsignedLongLong Function( + CXEvalResult E); typedef DartClang_EvalResult_getAsUnsigned = int Function(CXEvalResult E); typedef NativeClang_EvalResult_getAsDouble = ffi.Double Function( CXEvalResult E); typedef DartClang_EvalResult_getAsDouble = double Function(CXEvalResult E); -typedef NativeClang_EvalResult_getAsStr = ffi.Pointer Function( +typedef NativeClang_EvalResult_getAsStr = ffi.Pointer Function( CXEvalResult E); -typedef DartClang_EvalResult_getAsStr = ffi.Pointer Function( +typedef DartClang_EvalResult_getAsStr = ffi.Pointer Function( CXEvalResult E); typedef NativeClang_EvalResult_dispose = ffi.Void Function(CXEvalResult E); typedef DartClang_EvalResult_dispose = void Function(CXEvalResult E); @@ -10502,20 +10472,19 @@ typedef DartClang_EvalResult_dispose = void Function(CXEvalResult E); /// A remapping of original source files and their translated files. typedef CXRemapping = ffi.Pointer; typedef NativeClang_getRemappings = CXRemapping Function( - ffi.Pointer path); + ffi.Pointer path); typedef DartClang_getRemappings = CXRemapping Function( - ffi.Pointer path); + ffi.Pointer path); typedef NativeClang_getRemappingsFromFileList = CXRemapping Function( - ffi.Pointer> filePaths, - pkg_ffi.UnsignedInt numFiles); + ffi.Pointer> filePaths, ffi.UnsignedInt numFiles); typedef DartClang_getRemappingsFromFileList = CXRemapping Function( - ffi.Pointer> filePaths, int numFiles); -typedef NativeClang_remap_getNumFiles = pkg_ffi.UnsignedInt Function( + ffi.Pointer> filePaths, int numFiles); +typedef NativeClang_remap_getNumFiles = ffi.UnsignedInt Function( CXRemapping arg0); typedef DartClang_remap_getNumFiles = int Function(CXRemapping arg0); typedef NativeClang_remap_getFilenames = ffi.Void Function( CXRemapping arg0, - pkg_ffi.UnsignedInt index, + ffi.UnsignedInt index, ffi.Pointer original, ffi.Pointer transformed); typedef DartClang_remap_getFilenames = void Function( @@ -10569,7 +10538,7 @@ class CXIdxLoc extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int int_data; } @@ -10579,20 +10548,20 @@ class CXIdxIncludedFileInfo extends ffi.Struct { external CXIdxLoc hashLoc; /// Filename as written in the \#include/\#import directive. - external ffi.Pointer filename; + external ffi.Pointer filename; /// The actual file that the \#include/\#import directive resolved to. external CXFile file; - @pkg_ffi.Int() + @ffi.Int() external int isImport; - @pkg_ffi.Int() + @ffi.Int() external int isAngled; /// Non-zero if the directive was automatically turned into a module /// import. - @pkg_ffi.Int() + @ffi.Int() external int isModuleImport; } @@ -10609,7 +10578,7 @@ class CXIdxImportedASTFileInfo extends ffi.Struct { /// Non-zero if an inclusion directive was automatically turned into /// a module import. Applicable only for modules. - @pkg_ffi.Int() + @ffi.Int() external int isImplicit; } @@ -10639,15 +10608,15 @@ class CXIdxEntityInfo extends ffi.Struct { @ffi.Int32() external int lang; - external ffi.Pointer name; + external ffi.Pointer name; - external ffi.Pointer USR; + external ffi.Pointer USR; external CXCursor cursor; external ffi.Pointer> attributes; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int numAttributes; } @@ -10731,28 +10700,28 @@ class CXIdxDeclInfo extends ffi.Struct { /// cases like out-of-line C++ member functions. external ffi.Pointer lexicalContainer; - @pkg_ffi.Int() + @ffi.Int() external int isRedeclaration; - @pkg_ffi.Int() + @ffi.Int() external int isDefinition; - @pkg_ffi.Int() + @ffi.Int() 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. - @pkg_ffi.Int() + @ffi.Int() external int isImplicit; external ffi.Pointer> attributes; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int numAttributes; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int flags; } @@ -10788,7 +10757,7 @@ class CXIdxObjCProtocolRefInfo extends ffi.Struct { class CXIdxObjCProtocolRefListInfo extends ffi.Struct { external ffi.Pointer> protocols; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int numProtocols; } @@ -10825,7 +10794,7 @@ class CXIdxCXXClassDeclInfo extends ffi.Struct { external ffi.Pointer> bases; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int numBases; } @@ -10891,7 +10860,7 @@ abstract class CXSymbolRole { static const int CXSymbolRole_Implicit = 256; } -typedef NativeClang_index_isEntityObjCContainerKind = pkg_ffi.Int Function( +typedef NativeClang_index_isEntityObjCContainerKind = ffi.Int Function( ffi.Int32 arg0); typedef DartClang_index_isEntityObjCContainerKind = int Function(int arg0); typedef NativeClang_index_getObjCContainerDeclInfo @@ -10973,9 +10942,8 @@ 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< - ffi.NativeFunction< - pkg_ffi.Int Function(CXClientData, ffi.Pointer)>> - abortQuery; + ffi.NativeFunction< + ffi.Int Function(CXClientData, ffi.Pointer)>> abortQuery; /// Called at the end of indexing; passes the complete diagnostic set. external ffi.Pointer< @@ -11032,64 +11000,64 @@ typedef CXIdxClientFile = ffi.Pointer; /// The client's data object that is associated with an AST file (PCH /// or module). typedef CXIdxClientASTFile = ffi.Pointer; -typedef NativeClang_indexSourceFile = pkg_ffi.Int Function( +typedef NativeClang_indexSourceFile = ffi.Int Function( CXIndexAction arg0, CXClientData client_data, ffi.Pointer index_callbacks, - pkg_ffi.UnsignedInt index_callbacks_size, - pkg_ffi.UnsignedInt index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - pkg_ffi.Int num_command_line_args, + ffi.UnsignedInt index_callbacks_size, + ffi.UnsignedInt index_options, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + ffi.Int num_command_line_args, ffi.Pointer unsaved_files, - pkg_ffi.UnsignedInt num_unsaved_files, + ffi.UnsignedInt num_unsaved_files, ffi.Pointer out_TU, - pkg_ffi.UnsignedInt TU_options); + ffi.UnsignedInt TU_options); typedef DartClang_indexSourceFile = int Function( CXIndexAction arg0, CXClientData client_data, ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + 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); -typedef NativeClang_indexSourceFileFullArgv = pkg_ffi.Int Function( +typedef NativeClang_indexSourceFileFullArgv = ffi.Int Function( CXIndexAction arg0, CXClientData client_data, ffi.Pointer index_callbacks, - pkg_ffi.UnsignedInt index_callbacks_size, - pkg_ffi.UnsignedInt index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - pkg_ffi.Int num_command_line_args, + ffi.UnsignedInt index_callbacks_size, + ffi.UnsignedInt index_options, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + ffi.Int num_command_line_args, ffi.Pointer unsaved_files, - pkg_ffi.UnsignedInt num_unsaved_files, + ffi.UnsignedInt num_unsaved_files, ffi.Pointer out_TU, - pkg_ffi.UnsignedInt TU_options); + ffi.UnsignedInt TU_options); typedef DartClang_indexSourceFileFullArgv = int Function( CXIndexAction arg0, CXClientData client_data, ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + 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); -typedef NativeClang_indexTranslationUnit = pkg_ffi.Int Function( +typedef NativeClang_indexTranslationUnit = ffi.Int Function( CXIndexAction arg0, CXClientData client_data, ffi.Pointer index_callbacks, - pkg_ffi.UnsignedInt index_callbacks_size, - pkg_ffi.UnsignedInt index_options, + ffi.UnsignedInt index_callbacks_size, + ffi.UnsignedInt index_options, CXTranslationUnit arg5); typedef DartClang_indexTranslationUnit = int Function( CXIndexAction arg0, @@ -11102,16 +11070,16 @@ typedef NativeClang_indexLoc_getFileLocation = ffi.Void Function( CXIdxLoc loc, ffi.Pointer indexFile, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset); + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef DartClang_indexLoc_getFileLocation = void Function( CXIdxLoc loc, ffi.Pointer indexFile, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset); + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef NativeClang_indexLoc_getCXSourceLocation = CXSourceLocation Function( CXIdxLoc loc); typedef DartClang_indexLoc_getCXSourceLocation = CXSourceLocation Function( @@ -11128,7 +11096,7 @@ typedef DartClang_indexLoc_getCXSourceLocation = CXSourceLocation Function( /// to direct \c clang_Type_visitFields. typedef CXFieldVisitor = ffi .Pointer>; -typedef NativeClang_Type_visitFields = pkg_ffi.UnsignedInt Function( +typedef NativeClang_Type_visitFields = ffi.UnsignedInt Function( CXType T, CXFieldVisitor visitor, CXClientData client_data); typedef DartClang_Type_visitFields = int Function( CXType T, CXFieldVisitor visitor, CXClientData client_data); diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index 677e3c91f0..4a0829b607 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -59,19 +59,10 @@ ffigen: # These can be used to map any typedef to a specific native type. type-map: typedefs: - 'size_t': - lib: 'pkg_ffi' - c-type: 'Size' - dart-type: 'int' 'time_t': lib: 'ffi' c-type: 'Int64' dart-type: 'int' - native-types: - 'unsigned long': - lib: 'custom_import' - c-type: 'UnsignedLong' - dart-type: 'int' structs: 'CXCursorSetImpl': lib: 'custom_import' diff --git a/pkgs/ffigen/example/simple/generated_bindings.dart b/pkgs/ffigen/example/simple/generated_bindings.dart index 60c8a127e4..1612b64ec3 100644 --- a/pkgs/ffigen/example/simple/generated_bindings.dart +++ b/pkgs/ffigen/example/simple/generated_bindings.dart @@ -2,7 +2,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; /// Bindings to `headers/example.h`. class NativeLibrary { @@ -31,14 +30,13 @@ class NativeLibrary { ); } - late final _sumPtr = _lookup< - ffi.NativeFunction>( - 'sum'); + late final _sumPtr = + _lookup>('sum'); late final _sum = _sumPtr.asFunction(); /// Subtracts 2 integers. int subtract( - ffi.Pointer a, + ffi.Pointer a, int b, ) { return _subtract( @@ -48,14 +46,13 @@ class NativeLibrary { } late final _subtractPtr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, pkg_ffi.Int)>>('subtract'); + ffi.NativeFunction, ffi.Int)>>( + 'subtract'); late final _subtract = - _subtractPtr.asFunction, int)>(); + _subtractPtr.asFunction, int)>(); /// Multiplies 2 integers, returns pointer to an integer,. - ffi.Pointer multiply( + ffi.Pointer multiply( int a, int b, ) { @@ -66,11 +63,10 @@ class NativeLibrary { } late final _multiplyPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - pkg_ffi.Int, pkg_ffi.Int)>>('multiply'); + ffi.NativeFunction Function(ffi.Int, ffi.Int)>>( + 'multiply'); late final _multiply = - _multiplyPtr.asFunction Function(int, int)>(); + _multiplyPtr.asFunction Function(int, int)>(); /// Divides 2 integers, returns pointer to a float. ffi.Pointer divide( @@ -85,7 +81,7 @@ class NativeLibrary { late final _dividePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(pkg_ffi.Int, pkg_ffi.Int)>>('divide'); + ffi.Pointer Function(ffi.Int, ffi.Int)>>('divide'); late final _divide = _dividePtr.asFunction Function(int, int)>(); diff --git a/pkgs/ffigen/lib/src/code_generator/imports.dart b/pkgs/ffigen/lib/src/code_generator/imports.dart index 44e6f04331..41f71617f7 100644 --- a/pkgs/ffigen/lib/src/code_generator/imports.dart +++ b/pkgs/ffigen/lib/src/code_generator/imports.dart @@ -34,7 +34,10 @@ class ImportedType extends Type { [this.defaultValue]); @override - String getCType(Writer w) => '${libraryImport.prefix}.$cType'; + String getCType(Writer w) { + w.markImportUsed(libraryImport); + return '${libraryImport.prefix}.$cType'; + } @override String getDartType(Writer w) => cType == dartType ? getCType(w) : dartType; @@ -51,25 +54,24 @@ final ffiPkgImport = LibraryImport('pkg_ffi', 'package:ffi/ffi.dart'); final voidType = ImportedType(ffiImport, 'Void', 'void'); -final unsignedCharType = ImportedType(ffiPkgImport, 'UnsignedChar', 'int', '0'); -final signedCharType = ImportedType(ffiPkgImport, 'SignedChar', 'int', '0'); -final charType = ImportedType(ffiPkgImport, 'Char', 'int', '0'); -final unsignedShortType = - ImportedType(ffiPkgImport, 'UnsignedShort', 'int', '0'); -final shortType = ImportedType(ffiPkgImport, 'Short', 'int', '0'); -final unsignedIntType = ImportedType(ffiPkgImport, 'UnsignedInt', 'int', '0'); -final intType = ImportedType(ffiPkgImport, 'Int', 'int', '0'); -final unsignedLongType = ImportedType(ffiPkgImport, 'UnsignedLong', 'int', '0'); -final longType = ImportedType(ffiPkgImport, 'Long', 'int', '0'); +final unsignedCharType = ImportedType(ffiImport, 'UnsignedChar', 'int', '0'); +final signedCharType = ImportedType(ffiImport, 'SignedChar', 'int', '0'); +final charType = ImportedType(ffiImport, 'Char', 'int', '0'); +final unsignedShortType = ImportedType(ffiImport, 'UnsignedShort', 'int', '0'); +final shortType = ImportedType(ffiImport, 'Short', 'int', '0'); +final unsignedIntType = ImportedType(ffiImport, 'UnsignedInt', 'int', '0'); +final intType = ImportedType(ffiImport, 'Int', 'int', '0'); +final unsignedLongType = ImportedType(ffiImport, 'UnsignedLong', 'int', '0'); +final longType = ImportedType(ffiImport, 'Long', 'int', '0'); final unsignedLongLongType = - ImportedType(ffiPkgImport, 'UnsignedLongLong', 'int', '0'); -final longLongType = ImportedType(ffiPkgImport, 'LongLong', 'int', '0'); + ImportedType(ffiImport, 'UnsignedLongLong', 'int', '0'); +final longLongType = ImportedType(ffiImport, 'LongLong', 'int', '0'); final floatType = ImportedType(ffiImport, 'Float', 'double', '0'); final doubleType = ImportedType(ffiImport, 'Double', 'double', '0'); -final sizeType = ImportedType(ffiPkgImport, 'Size', 'int', '0'); -final wCharType = ImportedType(ffiPkgImport, 'WChar', 'int', '0'); +final sizeType = ImportedType(ffiImport, 'Size', 'int', '0'); +final wCharType = ImportedType(ffiImport, 'WChar', 'int', '0'); final objCObjectType = Struct(name: 'ObjCObject'); final objCSelType = Struct(name: 'ObjCSel'); diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index 87eb9de3c1..b88a565c63 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -6,7 +6,6 @@ import 'dart:io'; import 'package:cli_util/cli_util.dart'; import 'package:ffigen/src/config_provider/config_types.dart'; -import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:path/path.dart' as p; import 'binding.dart'; @@ -70,13 +69,6 @@ class Library { final noLookUpBindings = this.bindings.whereType().toList(); - // Add predefined imports. - final _libraryImports = {}; - _libraryImports.addAll(strings.predefinedLibraryImports.values); - if (libraryImports != null) { - _libraryImports.addAll(libraryImports); - } - _writer = Writer( lookUpBindings: lookUpBindings, noLookUpBindings: noLookUpBindings, @@ -84,7 +76,7 @@ class Library { classDocComment: description, header: header, dartBool: dartBool, - libraryImports: _libraryImports, + additionalImports: libraryImports, ); } diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index d3ff4958ef..1e398fc7a6 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -27,21 +27,31 @@ class Writer { String? _ffiLibraryPrefix; String get ffiLibraryPrefix { - _ffiLibraryPrefix ??= libraryImports - .firstWhere((element) => element.name == ffiImport.name) - .prefix; - return _ffiLibraryPrefix!; + if (_ffiLibraryPrefix != null) { + return _ffiLibraryPrefix!; + } + + final import = _usedImports.firstWhere( + (element) => element.name == ffiImport.name, + orElse: () => ffiImport); + _usedImports.add(import); + return _ffiLibraryPrefix = import.prefix; } String? _ffiPkgLibraryPrefix; String get ffiPkgLibraryPrefix { - _ffiPkgLibraryPrefix ??= libraryImports - .firstWhere((element) => element.name == ffiPkgImport.name) - .prefix; - return _ffiPkgLibraryPrefix!; + if (_ffiPkgLibraryPrefix != null) { + return _ffiPkgLibraryPrefix!; + } + + final import = _usedImports.firstWhere( + (element) => element.name == ffiPkgImport.name, + orElse: () => ffiPkgImport); + _usedImports.add(import); + return _ffiPkgLibraryPrefix = import.prefix; } - final Set libraryImports; + final Set _usedImports = {}; late String _lookupFuncIdentifier; String get lookupFuncIdentifier => _lookupFuncIdentifier; @@ -73,7 +83,7 @@ class Writer { required this.noLookUpBindings, required String className, required this.dartBool, - required this.libraryImports, + Set? additionalImports, this.classDocComment, this.header, }) { @@ -95,15 +105,17 @@ class Writer { ); /// Library imports prefix should be unique unique among all names. - for (final lib in libraryImports) { - lib.prefix = _resolveNameConflict( - name: lib.prefix, - makeUnique: allLevelsUniqueNamer, - markUsed: [ - _initialWrapperLevelUniqueNamer, - _initialTopLevelUniqueNamer - ], - ); + if (additionalImports != null) { + for (final lib in additionalImports) { + lib.prefix = _resolveNameConflict( + name: lib.prefix, + makeUnique: allLevelsUniqueNamer, + markUsed: [ + _initialWrapperLevelUniqueNamer, + _initialTopLevelUniqueNamer + ], + ); + } } /// [_lookupFuncIdentifier] should be unique in top level. @@ -167,29 +179,30 @@ class Writer { _wrapperLevelUniqueNamer = _initialWrapperLevelUniqueNamer.clone(); } + void markImportUsed(LibraryImport import) { + _usedImports.add(import); + } + /// Writes all bindings to a String. String generate() { final s = StringBuffer(); + // We write the source first to determine which imports are actually + // referenced. Headers and [s] are then combined into the final result. + final result = StringBuffer(); + // Reset unique namers to initial state. _resetUniqueNamersNamers(); // Write file header (if any). if (header != null) { - s.write(header); - s.write('\n'); + result.writeln(header); } // Write auto generated declaration. - s.write(makeDoc( + result.write(makeDoc( 'AUTO GENERATED FILE, DO NOT EDIT.\n\nGenerated by `package:ffigen`.')); - // Write neccesary imports. - for (final lib in libraryImports) { - s.write("import '${lib.importPath}' as ${lib.prefix};"); - s.write('\n'); - } - /// Write [lookUpBindings]. if (lookUpBindings.isNotEmpty) { // Write doc comment for wrapper class. @@ -232,7 +245,15 @@ class Writer { s.write(b.toBindingString(this).string); } - return s.toString(); + // Write neccesary imports. + for (final lib in _usedImports) { + result + ..write("import '${lib.importPath}' as ${lib.prefix};") + ..write('\n'); + } + result.write(s); + + return result.toString(); } } diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 9077b89eac..58108aaeeb 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -9,7 +9,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; /// Holds bindings to LibClang. class Clang { @@ -27,7 +26,7 @@ class Clang { : _lookup = lookup; /// Retrieve the character data associated with the given string. - ffi.Pointer clang_getCString( + ffi.Pointer clang_getCString( CXString string, ) { return _clang_getCString( @@ -36,10 +35,10 @@ class Clang { } late final _clang_getCStringPtr = - _lookup Function(CXString)>>( + _lookup Function(CXString)>>( 'clang_getCString'); late final _clang_getCString = _clang_getCStringPtr - .asFunction Function(CXString)>(); + .asFunction Function(CXString)>(); /// Free the given string. void clang_disposeString( @@ -105,7 +104,7 @@ class Clang { } late final _clang_createIndexPtr = - _lookup>( + _lookup>( 'clang_createIndex'); late final _clang_createIndex = _clang_createIndexPtr.asFunction(); @@ -153,7 +152,7 @@ class Clang { } late final _clang_Location_isInSystemHeaderPtr = - _lookup>( + _lookup>( 'clang_Location_isInSystemHeader'); late final _clang_Location_isInSystemHeader = _clang_Location_isInSystemHeaderPtr @@ -174,7 +173,7 @@ class Clang { late final _clang_equalRangesPtr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedInt Function( + ffi.UnsignedInt Function( CXSourceRange, CXSourceRange)>>('clang_equalRanges'); late final _clang_equalRanges = _clang_equalRangesPtr .asFunction(); @@ -203,9 +202,9 @@ class Clang { void clang_getFileLocation( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_getFileLocation( location, @@ -221,16 +220,16 @@ class Clang { ffi.Void Function( CXSourceLocation, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('clang_getFileLocation'); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_getFileLocation'); late final _clang_getFileLocation = _clang_getFileLocationPtr.asFunction< void Function( CXSourceLocation, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Determine the number of diagnostics produced for the given /// translation unit. @@ -242,9 +241,9 @@ class Clang { ); } - late final _clang_getNumDiagnosticsPtr = _lookup< - ffi.NativeFunction>( - 'clang_getNumDiagnostics'); + late final _clang_getNumDiagnosticsPtr = + _lookup>( + 'clang_getNumDiagnostics'); late final _clang_getNumDiagnostics = _clang_getNumDiagnosticsPtr.asFunction(); @@ -268,7 +267,7 @@ class Clang { late final _clang_getDiagnosticPtr = _lookup< ffi.NativeFunction< CXDiagnostic Function( - CXTranslationUnit, pkg_ffi.UnsignedInt)>>('clang_getDiagnostic'); + CXTranslationUnit, ffi.UnsignedInt)>>('clang_getDiagnostic'); late final _clang_getDiagnostic = _clang_getDiagnosticPtr .asFunction(); @@ -311,9 +310,8 @@ class Clang { } late final _clang_formatDiagnosticPtr = _lookup< - ffi.NativeFunction< - CXString Function( - CXDiagnostic, pkg_ffi.UnsignedInt)>>('clang_formatDiagnostic'); + ffi.NativeFunction>( + 'clang_formatDiagnostic'); late final _clang_formatDiagnostic = _clang_formatDiagnosticPtr .asFunction(); @@ -323,8 +321,8 @@ class Clang { /// error codes. CXTranslationUnit clang_parseTranslationUnit( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -345,18 +343,18 @@ class Clang { ffi.NativeFunction< CXTranslationUnit Function( CXIndex, - ffi.Pointer, - ffi.Pointer>, - pkg_ffi.Int, + ffi.Pointer, + ffi.Pointer>, + ffi.Int, ffi.Pointer, - pkg_ffi.UnsignedInt, - pkg_ffi.UnsignedInt)>>('clang_parseTranslationUnit'); + ffi.UnsignedInt, + ffi.UnsignedInt)>>('clang_parseTranslationUnit'); late final _clang_parseTranslationUnit = _clang_parseTranslationUnitPtr.asFunction< CXTranslationUnit Function( CXIndex, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>, int, ffi.Pointer, int, @@ -406,7 +404,7 @@ class Clang { } late final _clang_Cursor_isNullPtr = - _lookup>( + _lookup>( 'clang_Cursor_isNull'); late final _clang_Cursor_isNull = _clang_Cursor_isNullPtr.asFunction(); @@ -436,7 +434,7 @@ class Clang { } late final _clang_Cursor_hasAttrsPtr = - _lookup>( + _lookup>( 'clang_Cursor_hasAttrs'); late final _clang_Cursor_hasAttrs = _clang_Cursor_hasAttrsPtr.asFunction(); @@ -530,7 +528,7 @@ class Clang { } late final _clang_getEnumConstantDeclValuePtr = - _lookup>( + _lookup>( 'clang_getEnumConstantDeclValue'); late final _clang_getEnumConstantDeclValue = _clang_getEnumConstantDeclValuePtr.asFunction(); @@ -547,7 +545,7 @@ class Clang { } late final _clang_getFieldDeclBitWidthPtr = - _lookup>( + _lookup>( 'clang_getFieldDeclBitWidth'); late final _clang_getFieldDeclBitWidth = _clang_getFieldDeclBitWidthPtr.asFunction(); @@ -566,7 +564,7 @@ class Clang { } late final _clang_Cursor_getNumArgumentsPtr = - _lookup>( + _lookup>( 'clang_Cursor_getNumArguments'); late final _clang_Cursor_getNumArguments = _clang_Cursor_getNumArgumentsPtr.asFunction(); @@ -586,9 +584,9 @@ class Clang { ); } - late final _clang_Cursor_getArgumentPtr = _lookup< - ffi.NativeFunction>( - 'clang_Cursor_getArgument'); + late final _clang_Cursor_getArgumentPtr = + _lookup>( + 'clang_Cursor_getArgument'); late final _clang_Cursor_getArgument = _clang_Cursor_getArgumentPtr .asFunction(); @@ -623,7 +621,7 @@ class Clang { } late final _clang_Cursor_isMacroFunctionLikePtr = - _lookup>( + _lookup>( 'clang_Cursor_isMacroFunctionLike'); late final _clang_Cursor_isMacroFunctionLike = _clang_Cursor_isMacroFunctionLikePtr.asFunction(); @@ -639,7 +637,7 @@ class Clang { } late final _clang_Cursor_isMacroBuiltinPtr = - _lookup>( + _lookup>( 'clang_Cursor_isMacroBuiltin'); late final _clang_Cursor_isMacroBuiltin = _clang_Cursor_isMacroBuiltinPtr.asFunction(); @@ -655,7 +653,7 @@ class Clang { } late final _clang_Cursor_isFunctionInlinedPtr = - _lookup>( + _lookup>( 'clang_Cursor_isFunctionInlined'); late final _clang_Cursor_isFunctionInlined = _clang_Cursor_isFunctionInlinedPtr.asFunction(); @@ -750,7 +748,7 @@ class Clang { } late final _clang_getNumArgTypesPtr = - _lookup>( + _lookup>( 'clang_getNumArgTypes'); late final _clang_getNumArgTypes = _clang_getNumArgTypesPtr.asFunction(); @@ -770,7 +768,7 @@ class Clang { } late final _clang_getArgTypePtr = - _lookup>( + _lookup>( 'clang_getArgType'); late final _clang_getArgType = _clang_getArgTypePtr.asFunction(); @@ -806,7 +804,7 @@ class Clang { } late final _clang_getNumElementsPtr = - _lookup>( + _lookup>( 'clang_getNumElements'); late final _clang_getNumElements = _clang_getNumElementsPtr.asFunction(); @@ -879,7 +877,7 @@ class Clang { } late final _clang_Type_getAlignOfPtr = - _lookup>( + _lookup>( 'clang_Type_getAlignOf'); late final _clang_Type_getAlignOf = _clang_Type_getAlignOfPtr.asFunction(); @@ -895,7 +893,7 @@ class Clang { } late final _clang_Cursor_isAnonymousPtr = - _lookup>( + _lookup>( 'clang_Cursor_isAnonymous'); late final _clang_Cursor_isAnonymous = _clang_Cursor_isAnonymousPtr.asFunction(); @@ -911,7 +909,7 @@ class Clang { } late final _clang_Cursor_isAnonymousRecordDeclPtr = - _lookup>( + _lookup>( 'clang_Cursor_isAnonymousRecordDecl'); late final _clang_Cursor_isAnonymousRecordDecl = _clang_Cursor_isAnonymousRecordDeclPtr @@ -951,7 +949,7 @@ class Clang { late final _clang_visitChildrenPtr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedInt Function( + ffi.UnsignedInt Function( CXCursor, CXCursorVisitor, CXClientData)>>('clang_visitChildren'); late final _clang_visitChildren = _clang_visitChildrenPtr .asFunction(); @@ -1049,8 +1047,8 @@ class Clang { late final _clang_Cursor_getObjCPropertyAttributesPtr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedInt Function(CXCursor, - pkg_ffi.UnsignedInt)>>('clang_Cursor_getObjCPropertyAttributes'); + ffi.UnsignedInt Function(CXCursor, + ffi.UnsignedInt)>>('clang_Cursor_getObjCPropertyAttributes'); late final _clang_Cursor_getObjCPropertyAttributes = _clang_Cursor_getObjCPropertyAttributesPtr .asFunction(); @@ -1204,7 +1202,7 @@ class Clang { } late final _clang_EvalResult_getAsIntPtr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsInt'); late final _clang_EvalResult_getAsInt = _clang_EvalResult_getAsIntPtr.asFunction(); @@ -1221,7 +1219,7 @@ class Clang { } late final _clang_EvalResult_getAsLongLongPtr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsLongLong'); late final _clang_EvalResult_getAsLongLong = _clang_EvalResult_getAsLongLongPtr @@ -1247,7 +1245,7 @@ class Clang { /// 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 clang_EvalResult_getAsStr( CXEvalResult E, ) { return _clang_EvalResult_getAsStr( @@ -1255,11 +1253,11 @@ class Clang { ); } - late final _clang_EvalResult_getAsStrPtr = _lookup< - ffi.NativeFunction Function(CXEvalResult)>>( - 'clang_EvalResult_getAsStr'); + late final _clang_EvalResult_getAsStrPtr = + _lookup Function(CXEvalResult)>>( + 'clang_EvalResult_getAsStr'); late final _clang_EvalResult_getAsStr = _clang_EvalResult_getAsStrPtr - .asFunction Function(CXEvalResult)>(); + .asFunction Function(CXEvalResult)>(); /// Disposes the created Eval memory. void clang_EvalResult_dispose( @@ -1286,7 +1284,7 @@ class Clang { class CXString extends ffi.Struct { external ffi.Pointer data; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int private_flags; } @@ -1301,13 +1299,13 @@ 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; + external ffi.Pointer Filename; /// A buffer containing the unsaved contents of this file. - external ffi.Pointer Contents; + external ffi.Pointer Contents; /// The length of the unsaved contents of this buffer. - @pkg_ffi.UnsignedLong() + @ffi.UnsignedLong() external int Length; } @@ -1327,7 +1325,7 @@ class CXSourceLocation extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int int_data; } @@ -1339,10 +1337,10 @@ class CXSourceRange extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int begin_int_data; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int end_int_data; } @@ -2333,7 +2331,7 @@ class CXCursor extends ffi.Struct { @ffi.Int32() external int kind; - @pkg_ffi.Int() + @ffi.Int() external int xdata; @ffi.Array.multi([3]) diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index a9b443c903..09dd6fb624 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,15 +3,15 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 5.0.0-dev.1 +version: 5.0.0 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen environment: - sdk: '>=2.16.0-124.0.dev <3.0.0' + sdk: '>=2.17.0 <3.0.0' dependencies: - ffi: ^1.2.0-dev.0 + ffi: ^1.1.2 yaml: ^3.0.0 path: ^1.8.0 quiver: ^3.0.0 diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart index 6d81198c17..2e9412123d 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart @@ -2,7 +2,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; class Bindings { /// Holds the symbol lookup function. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart index 88d3ce3313..c44ddddb7d 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart @@ -2,7 +2,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; class Bindings { /// Holds the symbol lookup function. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart index 4696f26e9b..88d27fac2a 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart @@ -3,8 +3,6 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. -import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; const int test1 = 20; diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart index 910654f981..45a2b209cd 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart @@ -3,9 +3,6 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. -import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; - /// test line 1 /// test line 2 abstract class Constants { diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart index 0912744dd4..ada968c86e 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart @@ -2,7 +2,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; class Bindings { /// Holds the symbol lookup function. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart index 73a44cc01f..f539b01cab 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart @@ -2,7 +2,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; class Bindings { /// Holds the symbol lookup function. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart index 766baa1ff1..0a531fac85 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart @@ -2,7 +2,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; class Bindings { /// Holds the symbol lookup function. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart index 7b5eca4271..b6e1378385 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart @@ -4,7 +4,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; class init_dylib1 { /// Holds the symbol lookup function. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart index b0e76bde1c..4aea89af06 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart @@ -2,7 +2,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; class NoPacking extends ffi.Struct { @ffi.Uint8() diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart index 3bb980f6a4..cbae1f827e 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart @@ -2,7 +2,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; class Bindings { /// Holds the symbol lookup function. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart index 5c39d9294d..f84642b090 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart @@ -2,7 +2,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; /// Just a test struct /// heres another line diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart index 206a36ccd2..f49d183080 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart @@ -4,7 +4,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; class Bindings { /// Holds the symbol lookup function. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart index 3483cb89c0..cdd8632caf 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart @@ -2,25 +2,24 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; class Struct1 extends ffi.Struct { - @pkg_ffi.Char() + @ffi.Char() external int a; } class Union1 extends ffi.Union { - @pkg_ffi.Char() + @ffi.Char() external int a; } class EmptyUnion extends ffi.Opaque {} class Primitives extends ffi.Union { - @pkg_ffi.Char() + @ffi.Char() external int a; - @pkg_ffi.Int() + @ffi.Int() external int b; @ffi.Float() @@ -31,7 +30,7 @@ class Primitives extends ffi.Union { } class PrimitivesWithPointers extends ffi.Union { - @pkg_ffi.Char() + @ffi.Char() external int a; @ffi.Float() @@ -46,7 +45,7 @@ class PrimitivesWithPointers extends ffi.Union { class WithArray extends ffi.Union { @ffi.Array.multi([10]) - external ffi.Array a; + external ffi.Array a; @ffi.Array.multi([10]) external ffi.Array b; diff --git a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart index e107a2c232..b45cdcd88d 100644 --- a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart +++ b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart @@ -4,7 +4,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; class Bindings1 { /// Holds the symbol lookup function. diff --git a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_type_name_collision_bindings.dart b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_type_name_collision_bindings.dart index 7af357a1fd..4106ae2f3b 100644 --- a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_type_name_collision_bindings.dart +++ b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_type_name_collision_bindings.dart @@ -4,18 +4,17 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; class A extends ffi.Struct { - @pkg_ffi.Int() + @ffi.Int() external int a; } class B extends ffi.Struct { - @pkg_ffi.Int() + @ffi.Int() external int B1; - @pkg_ffi.Int() + @ffi.Int() external int A; } diff --git a/pkgs/ffigen/test/example_tests/libclang_example_test.dart b/pkgs/ffigen/test/example_tests/libclang_example_test.dart index e22bd86167..d0218c77ee 100644 --- a/pkgs/ffigen/test/example_tests/libclang_example_test.dart +++ b/pkgs/ffigen/test/example_tests/libclang_example_test.dart @@ -47,19 +47,10 @@ ${strings.libraryImports}: custom_import: 'custom_import.dart' ${strings.typeMap}: ${strings.typeMapTypedefs}: - 'size_t': - lib: 'pkg_ffi' - c-type: 'Size' - dart-type: 'int' 'time_t': lib: 'ffi' c-type: 'Int64' dart-type: 'int' - ${strings.typeMapNativeTypes}: - 'unsigned long': - lib: 'custom_import' - c-type: 'UnsignedLong' - dart-type: 'int' ${strings.typeMapStructs}: 'CXCursorSetImpl': lib: 'custom_import' diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart index b0f806a347..4b5a35a169 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart @@ -2,7 +2,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; /// Comment Markup Test class NativeLibrary { @@ -55,7 +54,7 @@ class NativeLibrary { class Com4 extends ffi.Struct { /// Muli-line test comment for struct field /// With multiple line and both // and ///. - @pkg_ffi.Int() + @ffi.Int() external int a; /// Single line field comment. diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart index e9ebee7340..d268b653fe 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart @@ -2,7 +2,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; /// Dart_Handle Test class NativeLibrary { diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart index c5c194bdbb..98f2ddf000 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart @@ -2,7 +2,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; /// Forward Declaration Test class NativeLibrary { @@ -37,10 +36,10 @@ class NativeLibrary { } class A extends ffi.Struct { - @pkg_ffi.Int() + @ffi.Int() external int a; - @pkg_ffi.Int() + @ffi.Int() external int b; } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart index ae8eb0adf7..acd30181ee 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart @@ -4,7 +4,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; /// Functions Test class NativeLibrary { @@ -115,8 +114,7 @@ class NativeLibrary { late final _diffCharsPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Char Function( - pkg_ffi.UnsignedChar, pkg_ffi.SignedChar)>>('diffChars'); + ffi.Char Function(ffi.UnsignedChar, ffi.SignedChar)>>('diffChars'); late final _diffChars = _diffCharsPtr.asFunction(); late final addresses = _SymbolAddresses(this); diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_imported_types_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_imported_types_bindings.dart index dc8ca23d87..80d1217d48 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_imported_types_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_imported_types_bindings.dart @@ -4,7 +4,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; /// Imported types test class NativeLibrary { @@ -61,21 +60,21 @@ class NativeLibrary { late final _default_imported_typesPtr = _lookup< ffi.NativeFunction< ffi.Void Function( - pkg_ffi.UnsignedChar, - pkg_ffi.SignedChar, - pkg_ffi.Char, - pkg_ffi.UnsignedShort, - pkg_ffi.Short, - pkg_ffi.UnsignedInt, - pkg_ffi.Int, - pkg_ffi.UnsignedLong, - pkg_ffi.Long, - pkg_ffi.UnsignedLongLong, - pkg_ffi.LongLong, + ffi.UnsignedChar, + ffi.SignedChar, + ffi.Char, + ffi.UnsignedShort, + ffi.Short, + ffi.UnsignedInt, + ffi.Int, + ffi.UnsignedLong, + ffi.Long, + ffi.UnsignedLongLong, + ffi.LongLong, ffi.Float, ffi.Double, - pkg_ffi.Size, - pkg_ffi.WChar)>>('default_imported_types'); + ffi.Size, + ffi.WChar)>>('default_imported_types'); late final _default_imported_types = _default_imported_typesPtr.asFunction< void Function(int, int, int, int, int, int, int, int, int, int, int, double, double, int, int)>(); diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart index a980d68abf..6be2cfb5b6 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart @@ -2,7 +2,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; /// Native Func Typedef Test. class NativeLibrary { diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart index 2f07ba03d0..1faa573338 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart @@ -2,7 +2,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; /// Opaque Dependencies Test class NativeLibrary { @@ -64,7 +63,7 @@ class E extends ffi.Struct { class C extends ffi.Opaque {} class D extends ffi.Struct { - @pkg_ffi.Int() + @ffi.Int() external int a; } @@ -81,6 +80,6 @@ class UE extends ffi.Union { class UC extends ffi.Opaque {} class UD extends ffi.Union { - @pkg_ffi.Int() + @ffi.Int() external int a; } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_packed_structs_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_packed_structs_bindings.dart index 2e4740f6b4..49d4df57b4 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_packed_structs_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_packed_structs_bindings.dart @@ -2,49 +2,48 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; class NormalStruct1 extends ffi.Struct { - @pkg_ffi.Char() + @ffi.Char() external int a; } /// Should not be packed. class StructWithAttr extends ffi.Struct { - external ffi.Pointer a; + external ffi.Pointer a; - external ffi.Pointer b; + external ffi.Pointer b; } /// Should be packed with 1. @ffi.Packed(1) class PackedAttr extends ffi.Struct { - @pkg_ffi.Int() + @ffi.Int() external int a; } /// Should be packed with 8. @ffi.Packed(8) class PackedAttrAlign8 extends ffi.Struct { - @pkg_ffi.Int() + @ffi.Int() external int a; } /// Should be packed with 2. @ffi.Packed(2) class Pack2WithPragma extends ffi.Struct { - @pkg_ffi.Int() + @ffi.Int() external int a; } /// Should be packed with 4. @ffi.Packed(4) class Pack4WithPragma extends ffi.Struct { - @pkg_ffi.LongLong() + @ffi.LongLong() external int a; } class NormalStruct2 extends ffi.Struct { - @pkg_ffi.Char() + @ffi.Char() external int a; } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart index 35b0daca53..3c8e4c35cc 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart @@ -4,7 +4,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; class Bindings { /// Holds the symbol lookup function. @@ -22,7 +21,7 @@ class Bindings { NamedFunctionProto func1( NamedFunctionProto named, - ffi.Pointer> unnamed, + ffi.Pointer> unnamed, ) { return _func1( named, @@ -31,15 +30,14 @@ class Bindings { } late final _func1Ptr = _lookup< - ffi.NativeFunction< - NamedFunctionProto Function( - NamedFunctionProto, - ffi.Pointer< - ffi.NativeFunction>)>>( - 'func1'); + ffi.NativeFunction< + NamedFunctionProto Function( + NamedFunctionProto, + ffi.Pointer< + ffi.NativeFunction>)>>('func1'); late final _func1 = _func1Ptr.asFunction< NamedFunctionProto Function(NamedFunctionProto, - ffi.Pointer>)>(); + ffi.Pointer>)>(); void func2( ffi.Pointer arg0, diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart index d17d65afaa..6a37746767 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart @@ -2,7 +2,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; /// Unions Test class NativeLibrary { @@ -50,7 +49,7 @@ class NativeLibrary { } class Union1 extends ffi.Union { - @pkg_ffi.Int() + @ffi.Int() external int a; } diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart index 794ef5c43d..ad8b2b5b4f 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart @@ -21,15 +21,15 @@ class CJson { lookup) : _lookup = lookup; - ffi.Pointer cJSON_Version() { + ffi.Pointer cJSON_Version() { return _cJSON_Version(); } late final _cJSON_VersionPtr = - _lookup Function()>>( + _lookup Function()>>( 'cJSON_Version'); late final _cJSON_Version = - _cJSON_VersionPtr.asFunction Function()>(); + _cJSON_VersionPtr.asFunction Function()>(); void cJSON_InitHooks( ffi.Pointer hooks, @@ -46,7 +46,7 @@ class CJson { _cJSON_InitHooksPtr.asFunction)>(); ffi.Pointer cJSON_Parse( - ffi.Pointer value, + ffi.Pointer value, ) { return _cJSON_Parse( value, @@ -55,14 +55,13 @@ class CJson { late final _cJSON_ParsePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('cJSON_Parse'); + ffi.Pointer Function(ffi.Pointer)>>('cJSON_Parse'); late final _cJSON_Parse = _cJSON_ParsePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_ParseWithOpts( - ffi.Pointer value, - ffi.Pointer> return_parse_end, + ffi.Pointer value, + ffi.Pointer> return_parse_end, int require_null_terminated, ) { return _cJSON_ParseWithOpts( @@ -75,14 +74,14 @@ class CJson { late final _cJSON_ParseWithOptsPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>, cJSON_bool)>>('cJSON_ParseWithOpts'); late final _cJSON_ParseWithOpts = _cJSON_ParseWithOptsPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer>, int)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer>, int)>(); - ffi.Pointer cJSON_Print( + ffi.Pointer cJSON_Print( ffi.Pointer item, ) { return _cJSON_Print( @@ -92,12 +91,11 @@ class CJson { late final _cJSON_PrintPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('cJSON_Print'); + ffi.Pointer Function(ffi.Pointer)>>('cJSON_Print'); late final _cJSON_Print = _cJSON_PrintPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); - ffi.Pointer cJSON_PrintUnformatted( + ffi.Pointer cJSON_PrintUnformatted( ffi.Pointer item, ) { return _cJSON_PrintUnformatted( @@ -107,12 +105,12 @@ class CJson { late final _cJSON_PrintUnformattedPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('cJSON_PrintUnformatted'); late final _cJSON_PrintUnformatted = _cJSON_PrintUnformattedPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); - ffi.Pointer cJSON_PrintBuffered( + ffi.Pointer cJSON_PrintBuffered( ffi.Pointer item, int prebuffer, int fmt, @@ -126,14 +124,14 @@ class CJson { late final _cJSON_PrintBufferedPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, pkg_ffi.Int, - cJSON_bool)>>('cJSON_PrintBuffered'); + ffi.Pointer Function( + ffi.Pointer, ffi.Int, cJSON_bool)>>('cJSON_PrintBuffered'); late final _cJSON_PrintBuffered = _cJSON_PrintBufferedPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int)>(); + ffi.Pointer Function(ffi.Pointer, int, int)>(); int cJSON_PrintPreallocated( ffi.Pointer item, - ffi.Pointer buffer, + ffi.Pointer buffer, int length, int format, ) { @@ -147,10 +145,10 @@ class CJson { late final _cJSON_PrintPreallocatedPtr = _lookup< ffi.NativeFunction< - cJSON_bool Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, cJSON_bool)>>('cJSON_PrintPreallocated'); + cJSON_bool Function(ffi.Pointer, ffi.Pointer, + ffi.Int, cJSON_bool)>>('cJSON_PrintPreallocated'); late final _cJSON_PrintPreallocated = _cJSON_PrintPreallocatedPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int, int)>(); void cJSON_Delete( ffi.Pointer item, @@ -175,7 +173,7 @@ class CJson { } late final _cJSON_GetArraySizePtr = - _lookup)>>( + _lookup)>>( 'cJSON_GetArraySize'); late final _cJSON_GetArraySize = _cJSON_GetArraySizePtr.asFunction)>(); @@ -193,13 +191,13 @@ class CJson { late final _cJSON_GetArrayItemPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, pkg_ffi.Int)>>('cJSON_GetArrayItem'); + ffi.Pointer, ffi.Int)>>('cJSON_GetArrayItem'); late final _cJSON_GetArrayItem = _cJSON_GetArrayItemPtr .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_GetObjectItem( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_GetObjectItem( object, @@ -210,14 +208,13 @@ class CJson { late final _cJSON_GetObjectItemPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_GetObjectItem'); + ffi.Pointer)>>('cJSON_GetObjectItem'); late final _cJSON_GetObjectItem = _cJSON_GetObjectItemPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_GetObjectItemCaseSensitive( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_GetObjectItemCaseSensitive( object, @@ -228,15 +225,15 @@ class CJson { late final _cJSON_GetObjectItemCaseSensitivePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_GetObjectItemCaseSensitive'); + ffi.Pointer)>>('cJSON_GetObjectItemCaseSensitive'); late final _cJSON_GetObjectItemCaseSensitive = _cJSON_GetObjectItemCaseSensitivePtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); int cJSON_HasObjectItem( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_HasObjectItem( object, @@ -247,21 +244,21 @@ class CJson { late final _cJSON_HasObjectItemPtr = _lookup< ffi.NativeFunction< cJSON_bool Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_HasObjectItem'); - late final _cJSON_HasObjectItem = _cJSON_HasObjectItemPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer)>>('cJSON_HasObjectItem'); + late final _cJSON_HasObjectItem = _cJSON_HasObjectItemPtr + .asFunction, ffi.Pointer)>(); - ffi.Pointer cJSON_GetErrorPtr() { + ffi.Pointer cJSON_GetErrorPtr() { return _cJSON_GetErrorPtr(); } late final _cJSON_GetErrorPtrPtr = - _lookup Function()>>( + _lookup Function()>>( 'cJSON_GetErrorPtr'); late final _cJSON_GetErrorPtr = - _cJSON_GetErrorPtrPtr.asFunction Function()>(); + _cJSON_GetErrorPtrPtr.asFunction Function()>(); - ffi.Pointer cJSON_GetStringValue( + ffi.Pointer cJSON_GetStringValue( ffi.Pointer item, ) { return _cJSON_GetStringValue( @@ -271,10 +268,10 @@ class CJson { late final _cJSON_GetStringValuePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('cJSON_GetStringValue'); late final _cJSON_GetStringValue = _cJSON_GetStringValuePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); int cJSON_IsInvalid( ffi.Pointer item, @@ -475,7 +472,7 @@ class CJson { _cJSON_CreateNumberPtr.asFunction Function(double)>(); ffi.Pointer cJSON_CreateString( - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_CreateString( string, @@ -485,12 +482,12 @@ class CJson { late final _cJSON_CreateStringPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer)>>('cJSON_CreateString'); + ffi.Pointer)>>('cJSON_CreateString'); late final _cJSON_CreateString = _cJSON_CreateStringPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateRaw( - ffi.Pointer raw, + ffi.Pointer raw, ) { return _cJSON_CreateRaw( raw, @@ -500,9 +497,9 @@ class CJson { late final _cJSON_CreateRawPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer)>>('cJSON_CreateRaw'); + ffi.Pointer)>>('cJSON_CreateRaw'); late final _cJSON_CreateRaw = _cJSON_CreateRawPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateArray() { return _cJSON_CreateArray(); @@ -525,7 +522,7 @@ class CJson { _cJSON_CreateObjectPtr.asFunction Function()>(); ffi.Pointer cJSON_CreateStringReference( - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_CreateStringReference( string, @@ -535,9 +532,9 @@ class CJson { late final _cJSON_CreateStringReferencePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer)>>('cJSON_CreateStringReference'); + ffi.Pointer)>>('cJSON_CreateStringReference'); late final _cJSON_CreateStringReference = _cJSON_CreateStringReferencePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateObjectReference( ffi.Pointer child, @@ -568,7 +565,7 @@ class CJson { .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateIntArray( - ffi.Pointer numbers, + ffi.Pointer numbers, int count, ) { return _cJSON_CreateIntArray( @@ -580,9 +577,9 @@ class CJson { late final _cJSON_CreateIntArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, pkg_ffi.Int)>>('cJSON_CreateIntArray'); + ffi.Pointer, ffi.Int)>>('cJSON_CreateIntArray'); late final _cJSON_CreateIntArray = _cJSON_CreateIntArrayPtr - .asFunction Function(ffi.Pointer, int)>(); + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateFloatArray( ffi.Pointer numbers, @@ -597,7 +594,7 @@ class CJson { late final _cJSON_CreateFloatArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, pkg_ffi.Int)>>('cJSON_CreateFloatArray'); + ffi.Pointer, ffi.Int)>>('cJSON_CreateFloatArray'); late final _cJSON_CreateFloatArray = _cJSON_CreateFloatArrayPtr .asFunction Function(ffi.Pointer, int)>(); @@ -613,13 +610,13 @@ class CJson { late final _cJSON_CreateDoubleArrayPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - pkg_ffi.Int)>>('cJSON_CreateDoubleArray'); + ffi.Pointer Function( + ffi.Pointer, ffi.Int)>>('cJSON_CreateDoubleArray'); late final _cJSON_CreateDoubleArray = _cJSON_CreateDoubleArrayPtr .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateStringArray( - ffi.Pointer> strings, + ffi.Pointer> strings, int count, ) { return _cJSON_CreateStringArray( @@ -630,11 +627,10 @@ class CJson { late final _cJSON_CreateStringArrayPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer>, - pkg_ffi.Int)>>('cJSON_CreateStringArray'); + ffi.Pointer Function(ffi.Pointer>, + ffi.Int)>>('cJSON_CreateStringArray'); late final _cJSON_CreateStringArray = _cJSON_CreateStringArrayPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer>, int)>(); + ffi.Pointer Function(ffi.Pointer>, int)>(); void cJSON_AddItemToArray( ffi.Pointer array, @@ -655,7 +651,7 @@ class CJson { void cJSON_AddItemToObject( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ffi.Pointer item, ) { return _cJSON_AddItemToObject( @@ -667,15 +663,15 @@ class CJson { late final _cJSON_AddItemToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemToObject'); late final _cJSON_AddItemToObject = _cJSON_AddItemToObjectPtr.asFunction< void Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_AddItemToObjectCS( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ffi.Pointer item, ) { return _cJSON_AddItemToObjectCS( @@ -687,11 +683,11 @@ class CJson { late final _cJSON_AddItemToObjectCSPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemToObjectCS'); late final _cJSON_AddItemToObjectCS = _cJSON_AddItemToObjectCSPtr.asFunction< void Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_AddItemReferenceToArray( ffi.Pointer array, @@ -712,7 +708,7 @@ class CJson { void cJSON_AddItemReferenceToObject( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ffi.Pointer item, ) { return _cJSON_AddItemReferenceToObject( @@ -724,12 +720,12 @@ class CJson { late final _cJSON_AddItemReferenceToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemReferenceToObject'); late final _cJSON_AddItemReferenceToObject = _cJSON_AddItemReferenceToObjectPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_DetachItemViaPointer( ffi.Pointer parent, @@ -763,7 +759,7 @@ class CJson { late final _cJSON_DetachItemFromArrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, pkg_ffi.Int)>>('cJSON_DetachItemFromArray'); + ffi.Pointer, ffi.Int)>>('cJSON_DetachItemFromArray'); late final _cJSON_DetachItemFromArray = _cJSON_DetachItemFromArrayPtr .asFunction Function(ffi.Pointer, int)>(); @@ -778,15 +774,14 @@ class CJson { } late final _cJSON_DeleteItemFromArrayPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, pkg_ffi.Int)>>('cJSON_DeleteItemFromArray'); + ffi.NativeFunction, ffi.Int)>>( + 'cJSON_DeleteItemFromArray'); late final _cJSON_DeleteItemFromArray = _cJSON_DeleteItemFromArrayPtr .asFunction, int)>(); ffi.Pointer cJSON_DetachItemFromObject( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_DetachItemFromObject( object, @@ -797,15 +792,15 @@ class CJson { late final _cJSON_DetachItemFromObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_DetachItemFromObject'); + ffi.Pointer)>>('cJSON_DetachItemFromObject'); late final _cJSON_DetachItemFromObject = _cJSON_DetachItemFromObjectPtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_DetachItemFromObjectCaseSensitive( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_DetachItemFromObjectCaseSensitive( object, @@ -816,16 +811,16 @@ class CJson { late final _cJSON_DetachItemFromObjectCaseSensitivePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>( + ffi.Pointer, ffi.Pointer)>>( 'cJSON_DetachItemFromObjectCaseSensitive'); late final _cJSON_DetachItemFromObjectCaseSensitive = _cJSON_DetachItemFromObjectCaseSensitivePtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); void cJSON_DeleteItemFromObject( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_DeleteItemFromObject( object, @@ -836,14 +831,13 @@ class CJson { late final _cJSON_DeleteItemFromObjectPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_DeleteItemFromObject'); - late final _cJSON_DeleteItemFromObject = - _cJSON_DeleteItemFromObjectPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer)>>('cJSON_DeleteItemFromObject'); + late final _cJSON_DeleteItemFromObject = _cJSON_DeleteItemFromObjectPtr + .asFunction, ffi.Pointer)>(); void cJSON_DeleteItemFromObjectCaseSensitive( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ) { return _cJSON_DeleteItemFromObjectCaseSensitive( object, @@ -853,12 +847,11 @@ class CJson { late final _cJSON_DeleteItemFromObjectCaseSensitivePtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>( + ffi.Void Function(ffi.Pointer, ffi.Pointer)>>( 'cJSON_DeleteItemFromObjectCaseSensitive'); late final _cJSON_DeleteItemFromObjectCaseSensitive = _cJSON_DeleteItemFromObjectCaseSensitivePtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer)>(); void cJSON_InsertItemInArray( ffi.Pointer array, @@ -874,7 +867,7 @@ class CJson { late final _cJSON_InsertItemInArrayPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, pkg_ffi.Int, + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Pointer)>>('cJSON_InsertItemInArray'); late final _cJSON_InsertItemInArray = _cJSON_InsertItemInArrayPtr .asFunction, int, ffi.Pointer)>(); @@ -914,14 +907,14 @@ class CJson { late final _cJSON_ReplaceItemInArrayPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, pkg_ffi.Int, + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Pointer)>>('cJSON_ReplaceItemInArray'); late final _cJSON_ReplaceItemInArray = _cJSON_ReplaceItemInArrayPtr .asFunction, int, ffi.Pointer)>(); void cJSON_ReplaceItemInObject( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ffi.Pointer newitem, ) { return _cJSON_ReplaceItemInObject( @@ -933,16 +926,16 @@ class CJson { late final _cJSON_ReplaceItemInObjectPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_ReplaceItemInObject'); late final _cJSON_ReplaceItemInObject = _cJSON_ReplaceItemInObjectPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_ReplaceItemInObjectCaseSensitive( ffi.Pointer object, - ffi.Pointer string, + ffi.Pointer string, ffi.Pointer newitem, ) { return _cJSON_ReplaceItemInObjectCaseSensitive( @@ -954,12 +947,12 @@ class CJson { late final _cJSON_ReplaceItemInObjectCaseSensitivePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('cJSON_ReplaceItemInObjectCaseSensitive'); late final _cJSON_ReplaceItemInObjectCaseSensitive = _cJSON_ReplaceItemInObjectCaseSensitivePtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_Duplicate( ffi.Pointer item, @@ -998,7 +991,7 @@ class CJson { .asFunction, ffi.Pointer, int)>(); void cJSON_Minify( - ffi.Pointer json, + ffi.Pointer json, ) { return _cJSON_Minify( json, @@ -1006,14 +999,14 @@ class CJson { } late final _cJSON_MinifyPtr = - _lookup)>>( + _lookup)>>( 'cJSON_Minify'); late final _cJSON_Minify = - _cJSON_MinifyPtr.asFunction)>(); + _cJSON_MinifyPtr.asFunction)>(); ffi.Pointer cJSON_AddNullToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, ) { return _cJSON_AddNullToObject( object, @@ -1024,14 +1017,13 @@ class CJson { late final _cJSON_AddNullToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_AddNullToObject'); + ffi.Pointer)>>('cJSON_AddNullToObject'); late final _cJSON_AddNullToObject = _cJSON_AddNullToObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddTrueToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, ) { return _cJSON_AddTrueToObject( object, @@ -1042,14 +1034,13 @@ class CJson { late final _cJSON_AddTrueToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_AddTrueToObject'); + ffi.Pointer)>>('cJSON_AddTrueToObject'); late final _cJSON_AddTrueToObject = _cJSON_AddTrueToObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddFalseToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, ) { return _cJSON_AddFalseToObject( object, @@ -1060,14 +1051,13 @@ class CJson { late final _cJSON_AddFalseToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_AddFalseToObject'); + ffi.Pointer)>>('cJSON_AddFalseToObject'); late final _cJSON_AddFalseToObject = _cJSON_AddFalseToObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddBoolToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, int boolean, ) { return _cJSON_AddBoolToObject( @@ -1079,15 +1069,15 @@ class CJson { late final _cJSON_AddBoolToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, cJSON_bool)>>('cJSON_AddBoolToObject'); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + cJSON_bool)>>('cJSON_AddBoolToObject'); late final _cJSON_AddBoolToObject = _cJSON_AddBoolToObjectPtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer, ffi.Pointer, int)>(); ffi.Pointer cJSON_AddNumberToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, double number, ) { return _cJSON_AddNumberToObject( @@ -1099,18 +1089,16 @@ class CJson { late final _cJSON_AddNumberToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, ffi.Double)>>('cJSON_AddNumberToObject'); late final _cJSON_AddNumberToObject = _cJSON_AddNumberToObjectPtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); + ffi.Pointer, ffi.Pointer, double)>(); ffi.Pointer cJSON_AddStringToObject( ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer string, + ffi.Pointer name, + ffi.Pointer string, ) { return _cJSON_AddStringToObject( object, @@ -1121,18 +1109,16 @@ class CJson { late final _cJSON_AddStringToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('cJSON_AddStringToObject'); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddStringToObject'); late final _cJSON_AddStringToObject = _cJSON_AddStringToObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddRawToObject( ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer raw, + ffi.Pointer name, + ffi.Pointer raw, ) { return _cJSON_AddRawToObject( object, @@ -1143,17 +1129,15 @@ class CJson { late final _cJSON_AddRawToObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('cJSON_AddRawToObject'); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddRawToObject'); late final _cJSON_AddRawToObject = _cJSON_AddRawToObjectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddObjectToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, ) { return _cJSON_AddObjectToObject( object, @@ -1164,14 +1148,13 @@ class CJson { late final _cJSON_AddObjectToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_AddObjectToObject'); + ffi.Pointer)>>('cJSON_AddObjectToObject'); late final _cJSON_AddObjectToObject = _cJSON_AddObjectToObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddArrayToObject( ffi.Pointer object, - ffi.Pointer name, + ffi.Pointer name, ) { return _cJSON_AddArrayToObject( object, @@ -1182,10 +1165,9 @@ class CJson { late final _cJSON_AddArrayToObjectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('cJSON_AddArrayToObject'); + ffi.Pointer)>>('cJSON_AddArrayToObject'); late final _cJSON_AddArrayToObject = _cJSON_AddArrayToObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); double cJSON_SetNumberHelper( ffi.Pointer object, @@ -1240,18 +1222,18 @@ class cJSON extends ffi.Struct { external ffi.Pointer child; - @pkg_ffi.Int() + @ffi.Int() external int type; - external ffi.Pointer valuestring; + external ffi.Pointer valuestring; - @pkg_ffi.Int() + @ffi.Int() external int valueint; @ffi.Double() external double valuedouble; - external ffi.Pointer string; + external ffi.Pointer string; } class cJSON_Hooks extends ffi.Struct { @@ -1264,7 +1246,7 @@ class cJSON_Hooks extends ffi.Struct { free_fn; } -typedef cJSON_bool = pkg_ffi.Int; +typedef cJSON_bool = ffi.Int; const int CJSON_VERSION_MAJOR = 1; diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index 2255e6fc07..53e3a65ef2 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -22,7 +22,7 @@ class LibClang { : _lookup = lookup; /// Retrieve the character data associated with the given string. - ffi.Pointer clang_getCString( + ffi.Pointer clang_getCString( CXString string, ) { return _clang_getCString( @@ -31,10 +31,10 @@ class LibClang { } late final _clang_getCStringPtr = - _lookup Function(CXString)>>( + _lookup Function(CXString)>>( 'clang_getCString'); late final _clang_getCString = _clang_getCStringPtr - .asFunction Function(CXString)>(); + .asFunction Function(CXString)>(); /// Free the given string. void clang_disposeString( @@ -73,7 +73,7 @@ class LibClang { } late final _clang_getBuildSessionTimestampPtr = - _lookup>( + _lookup>( 'clang_getBuildSessionTimestamp'); late final _clang_getBuildSessionTimestamp = _clang_getBuildSessionTimestampPtr.asFunction(); @@ -89,9 +89,8 @@ class LibClang { } late final _clang_VirtualFileOverlay_createPtr = _lookup< - ffi.NativeFunction< - CXVirtualFileOverlay Function( - pkg_ffi.UnsignedInt)>>('clang_VirtualFileOverlay_create'); + ffi.NativeFunction>( + 'clang_VirtualFileOverlay_create'); late final _clang_VirtualFileOverlay_create = _clang_VirtualFileOverlay_createPtr .asFunction(); @@ -100,8 +99,8 @@ class LibClang { /// path must be canonicalized (not contain "."/".."). int clang_VirtualFileOverlay_addFileMapping( CXVirtualFileOverlay arg0, - ffi.Pointer virtualPath, - ffi.Pointer realPath, + ffi.Pointer virtualPath, + ffi.Pointer realPath, ) { return _clang_VirtualFileOverlay_addFileMapping( arg0, @@ -112,13 +111,13 @@ class LibClang { late final _clang_VirtualFileOverlay_addFileMappingPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(CXVirtualFileOverlay, - ffi.Pointer, ffi.Pointer)>>( + ffi.Int32 Function(CXVirtualFileOverlay, ffi.Pointer, + ffi.Pointer)>>( 'clang_VirtualFileOverlay_addFileMapping'); late final _clang_VirtualFileOverlay_addFileMapping = _clang_VirtualFileOverlay_addFileMappingPtr.asFunction< - int Function(CXVirtualFileOverlay, ffi.Pointer, - ffi.Pointer)>(); + int Function(CXVirtualFileOverlay, ffi.Pointer, + ffi.Pointer)>(); /// Set the case sensitivity for the CXVirtualFileOverlay object. The /// CXVirtualFileOverlay object is case-sensitive by default, this option can @@ -136,7 +135,7 @@ class LibClang { late final _clang_VirtualFileOverlay_setCaseSensitivityPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(CXVirtualFileOverlay, - pkg_ffi.Int)>>('clang_VirtualFileOverlay_setCaseSensitivity'); + ffi.Int)>>('clang_VirtualFileOverlay_setCaseSensitivity'); late final _clang_VirtualFileOverlay_setCaseSensitivity = _clang_VirtualFileOverlay_setCaseSensitivityPtr .asFunction(); @@ -145,8 +144,8 @@ class LibClang { int clang_VirtualFileOverlay_writeToBuffer( CXVirtualFileOverlay arg0, int options, - ffi.Pointer> out_buffer_ptr, - ffi.Pointer out_buffer_size, + ffi.Pointer> out_buffer_ptr, + ffi.Pointer out_buffer_size, ) { return _clang_VirtualFileOverlay_writeToBuffer( arg0, @@ -160,17 +159,17 @@ class LibClang { ffi.NativeFunction< ffi.Int32 Function( CXVirtualFileOverlay, - pkg_ffi.UnsignedInt, - ffi.Pointer>, - ffi.Pointer)>>( + ffi.UnsignedInt, + ffi.Pointer>, + ffi.Pointer)>>( 'clang_VirtualFileOverlay_writeToBuffer'); late final _clang_VirtualFileOverlay_writeToBuffer = _clang_VirtualFileOverlay_writeToBufferPtr.asFunction< int Function( CXVirtualFileOverlay, int, - ffi.Pointer>, - ffi.Pointer)>(); + ffi.Pointer>, + ffi.Pointer)>(); /// free memory allocated by libclang, such as the buffer returned by /// CXVirtualFileOverlay() or clang_ModuleMapDescriptor_writeToBuffer(). @@ -215,9 +214,8 @@ class LibClang { } late final _clang_ModuleMapDescriptor_createPtr = _lookup< - ffi.NativeFunction< - CXModuleMapDescriptor Function( - pkg_ffi.UnsignedInt)>>('clang_ModuleMapDescriptor_create'); + ffi.NativeFunction>( + 'clang_ModuleMapDescriptor_create'); late final _clang_ModuleMapDescriptor_create = _clang_ModuleMapDescriptor_createPtr .asFunction(); @@ -225,7 +223,7 @@ class LibClang { /// Sets the framework module name that the module.map describes. int clang_ModuleMapDescriptor_setFrameworkModuleName( CXModuleMapDescriptor arg0, - ffi.Pointer name, + ffi.Pointer name, ) { return _clang_ModuleMapDescriptor_setFrameworkModuleName( arg0, @@ -236,16 +234,16 @@ class LibClang { late final _clang_ModuleMapDescriptor_setFrameworkModuleNamePtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( - CXModuleMapDescriptor, ffi.Pointer)>>( + CXModuleMapDescriptor, ffi.Pointer)>>( 'clang_ModuleMapDescriptor_setFrameworkModuleName'); late final _clang_ModuleMapDescriptor_setFrameworkModuleName = _clang_ModuleMapDescriptor_setFrameworkModuleNamePtr.asFunction< - int Function(CXModuleMapDescriptor, ffi.Pointer)>(); + int Function(CXModuleMapDescriptor, ffi.Pointer)>(); /// Sets the umbrealla header name that the module.map describes. int clang_ModuleMapDescriptor_setUmbrellaHeader( CXModuleMapDescriptor arg0, - ffi.Pointer name, + ffi.Pointer name, ) { return _clang_ModuleMapDescriptor_setUmbrellaHeader( arg0, @@ -256,18 +254,18 @@ class LibClang { late final _clang_ModuleMapDescriptor_setUmbrellaHeaderPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function( - CXModuleMapDescriptor, ffi.Pointer)>>( + CXModuleMapDescriptor, ffi.Pointer)>>( 'clang_ModuleMapDescriptor_setUmbrellaHeader'); late final _clang_ModuleMapDescriptor_setUmbrellaHeader = _clang_ModuleMapDescriptor_setUmbrellaHeaderPtr.asFunction< - int Function(CXModuleMapDescriptor, ffi.Pointer)>(); + int Function(CXModuleMapDescriptor, ffi.Pointer)>(); /// Write out the CXModuleMapDescriptor object to a char buffer. int clang_ModuleMapDescriptor_writeToBuffer( CXModuleMapDescriptor arg0, int options, - ffi.Pointer> out_buffer_ptr, - ffi.Pointer out_buffer_size, + ffi.Pointer> out_buffer_ptr, + ffi.Pointer out_buffer_size, ) { return _clang_ModuleMapDescriptor_writeToBuffer( arg0, @@ -281,17 +279,17 @@ class LibClang { ffi.NativeFunction< ffi.Int32 Function( CXModuleMapDescriptor, - pkg_ffi.UnsignedInt, - ffi.Pointer>, - ffi.Pointer)>>( + ffi.UnsignedInt, + ffi.Pointer>, + ffi.Pointer)>>( 'clang_ModuleMapDescriptor_writeToBuffer'); late final _clang_ModuleMapDescriptor_writeToBuffer = _clang_ModuleMapDescriptor_writeToBufferPtr.asFunction< int Function( CXModuleMapDescriptor, int, - ffi.Pointer>, - ffi.Pointer)>(); + ffi.Pointer>, + ffi.Pointer)>(); /// Dispose a CXModuleMapDescriptor object. void clang_ModuleMapDescriptor_dispose( @@ -321,7 +319,7 @@ class LibClang { } late final _clang_createIndexPtr = - _lookup>( + _lookup>( 'clang_createIndex'); late final _clang_createIndex = _clang_createIndexPtr.asFunction(); @@ -352,9 +350,9 @@ class LibClang { ); } - late final _clang_CXIndex_setGlobalOptionsPtr = _lookup< - ffi.NativeFunction>( - 'clang_CXIndex_setGlobalOptions'); + late final _clang_CXIndex_setGlobalOptionsPtr = + _lookup>( + 'clang_CXIndex_setGlobalOptions'); late final _clang_CXIndex_setGlobalOptions = _clang_CXIndex_setGlobalOptionsPtr .asFunction(); @@ -369,7 +367,7 @@ class LibClang { } late final _clang_CXIndex_getGlobalOptionsPtr = - _lookup>( + _lookup>( 'clang_CXIndex_getGlobalOptions'); late final _clang_CXIndex_getGlobalOptions = _clang_CXIndex_getGlobalOptionsPtr.asFunction(); @@ -377,7 +375,7 @@ class LibClang { /// Sets the invocation emission path option in a CXIndex. void clang_CXIndex_setInvocationEmissionPathOption( CXIndex arg0, - ffi.Pointer Path, + ffi.Pointer Path, ) { return _clang_CXIndex_setInvocationEmissionPathOption( arg0, @@ -387,11 +385,11 @@ class LibClang { late final _clang_CXIndex_setInvocationEmissionPathOptionPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CXIndex, ffi.Pointer)>>( + ffi.Void Function(CXIndex, ffi.Pointer)>>( 'clang_CXIndex_setInvocationEmissionPathOption'); late final _clang_CXIndex_setInvocationEmissionPathOption = _clang_CXIndex_setInvocationEmissionPathOptionPtr - .asFunction)>(); + .asFunction)>(); /// Retrieve the complete file and path name of the given file. CXString clang_getFileName( @@ -436,7 +434,7 @@ class LibClang { late final _clang_getFileUniqueIDPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( CXFile, ffi.Pointer)>>('clang_getFileUniqueID'); late final _clang_getFileUniqueID = _clang_getFileUniqueIDPtr .asFunction)>(); @@ -456,7 +454,7 @@ class LibClang { late final _clang_isFileMultipleIncludeGuardedPtr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedInt Function(CXTranslationUnit, + ffi.UnsignedInt Function(CXTranslationUnit, CXFile)>>('clang_isFileMultipleIncludeGuarded'); late final _clang_isFileMultipleIncludeGuarded = _clang_isFileMultipleIncludeGuardedPtr @@ -465,7 +463,7 @@ class LibClang { /// Retrieve a file handle within the given translation unit. CXFile clang_getFile( CXTranslationUnit tu, - ffi.Pointer file_name, + ffi.Pointer file_name, ) { return _clang_getFile( tu, @@ -476,12 +474,12 @@ class LibClang { late final _clang_getFilePtr = _lookup< ffi.NativeFunction< CXFile Function( - CXTranslationUnit, ffi.Pointer)>>('clang_getFile'); - late final _clang_getFile = _clang_getFilePtr.asFunction< - CXFile Function(CXTranslationUnit, ffi.Pointer)>(); + CXTranslationUnit, ffi.Pointer)>>('clang_getFile'); + late final _clang_getFile = _clang_getFilePtr + .asFunction)>(); /// Retrieve the buffer associated with the given file. - ffi.Pointer clang_getFileContents( + ffi.Pointer clang_getFileContents( CXTranslationUnit tu, CXFile file, ffi.Pointer size, @@ -495,10 +493,10 @@ class LibClang { late final _clang_getFileContentsPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(CXTranslationUnit, CXFile, + ffi.Pointer Function(CXTranslationUnit, CXFile, ffi.Pointer)>>('clang_getFileContents'); late final _clang_getFileContents = _clang_getFileContentsPtr.asFunction< - ffi.Pointer Function( + ffi.Pointer Function( CXTranslationUnit, CXFile, ffi.Pointer)>(); /// Returns non-zero if the file1 and file2 point to the same file, or they @@ -514,7 +512,7 @@ class LibClang { } late final _clang_File_isEqualPtr = - _lookup>( + _lookup>( 'clang_File_isEqual'); late final _clang_File_isEqual = _clang_File_isEqualPtr.asFunction(); @@ -559,7 +557,7 @@ class LibClang { late final _clang_equalLocationsPtr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedInt Function( + ffi.UnsignedInt Function( CXSourceLocation, CXSourceLocation)>>('clang_equalLocations'); late final _clang_equalLocations = _clang_equalLocationsPtr .asFunction(); @@ -582,8 +580,8 @@ class LibClang { late final _clang_getLocationPtr = _lookup< ffi.NativeFunction< - CXSourceLocation Function(CXTranslationUnit, CXFile, - pkg_ffi.UnsignedInt, pkg_ffi.UnsignedInt)>>('clang_getLocation'); + CXSourceLocation Function(CXTranslationUnit, CXFile, ffi.UnsignedInt, + ffi.UnsignedInt)>>('clang_getLocation'); late final _clang_getLocation = _clang_getLocationPtr.asFunction< CXSourceLocation Function(CXTranslationUnit, CXFile, int, int)>(); @@ -604,7 +602,7 @@ class LibClang { late final _clang_getLocationForOffsetPtr = _lookup< ffi.NativeFunction< CXSourceLocation Function(CXTranslationUnit, CXFile, - pkg_ffi.UnsignedInt)>>('clang_getLocationForOffset'); + ffi.UnsignedInt)>>('clang_getLocationForOffset'); late final _clang_getLocationForOffset = _clang_getLocationForOffsetPtr .asFunction(); @@ -618,7 +616,7 @@ class LibClang { } late final _clang_Location_isInSystemHeaderPtr = - _lookup>( + _lookup>( 'clang_Location_isInSystemHeader'); late final _clang_Location_isInSystemHeader = _clang_Location_isInSystemHeaderPtr @@ -635,7 +633,7 @@ class LibClang { } late final _clang_Location_isFromMainFilePtr = - _lookup>( + _lookup>( 'clang_Location_isFromMainFile'); late final _clang_Location_isFromMainFile = _clang_Location_isFromMainFilePtr .asFunction(); @@ -682,7 +680,7 @@ class LibClang { late final _clang_equalRangesPtr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedInt Function( + ffi.UnsignedInt Function( CXSourceRange, CXSourceRange)>>('clang_equalRanges'); late final _clang_equalRanges = _clang_equalRangesPtr .asFunction(); @@ -697,7 +695,7 @@ class LibClang { } late final _clang_Range_isNullPtr = - _lookup>( + _lookup>( 'clang_Range_isNull'); late final _clang_Range_isNull = _clang_Range_isNullPtr.asFunction(); @@ -707,9 +705,9 @@ class LibClang { void clang_getExpansionLocation( CXSourceLocation location, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_getExpansionLocation( location, @@ -725,25 +723,25 @@ class LibClang { ffi.Void Function( CXSourceLocation, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('clang_getExpansionLocation'); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_getExpansionLocation'); late final _clang_getExpansionLocation = _clang_getExpansionLocationPtr.asFunction< void Function( CXSourceLocation, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// 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, + ffi.Pointer line, + ffi.Pointer column, ) { return _clang_getPresumedLocation( location, @@ -758,24 +756,21 @@ class LibClang { ffi.Void Function( CXSourceLocation, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('clang_getPresumedLocation'); + ffi.Pointer, + ffi.Pointer)>>('clang_getPresumedLocation'); late final _clang_getPresumedLocation = _clang_getPresumedLocationPtr.asFunction< - void Function( - CXSourceLocation, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + void Function(CXSourceLocation, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// 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, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_getInstantiationLocation( location, @@ -787,31 +782,30 @@ class LibClang { } late final _clang_getInstantiationLocationPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CXSourceLocation, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>( - 'clang_getInstantiationLocation'); + ffi.NativeFunction< + ffi.Void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_getInstantiationLocation'); late final _clang_getInstantiationLocation = _clang_getInstantiationLocationPtr.asFunction< void Function( CXSourceLocation, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// 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, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_getSpellingLocation( location, @@ -827,26 +821,26 @@ class LibClang { ffi.Void Function( CXSourceLocation, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('clang_getSpellingLocation'); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_getSpellingLocation'); late final _clang_getSpellingLocation = _clang_getSpellingLocationPtr.asFunction< void Function( CXSourceLocation, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// 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, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_getFileLocation( location, @@ -862,16 +856,16 @@ class LibClang { ffi.Void Function( CXSourceLocation, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('clang_getFileLocation'); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_getFileLocation'); late final _clang_getFileLocation = _clang_getFileLocationPtr.asFunction< void Function( CXSourceLocation, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve a source location representing the first character within a /// source range. @@ -964,9 +958,9 @@ class LibClang { ); } - late final _clang_getNumDiagnosticsInSetPtr = _lookup< - ffi.NativeFunction>( - 'clang_getNumDiagnosticsInSet'); + late final _clang_getNumDiagnosticsInSetPtr = + _lookup>( + 'clang_getNumDiagnosticsInSet'); late final _clang_getNumDiagnosticsInSet = _clang_getNumDiagnosticsInSetPtr .asFunction(); @@ -983,14 +977,14 @@ class LibClang { late final _clang_getDiagnosticInSetPtr = _lookup< ffi.NativeFunction< - CXDiagnostic Function(CXDiagnosticSet, - pkg_ffi.UnsignedInt)>>('clang_getDiagnosticInSet'); + CXDiagnostic Function( + CXDiagnosticSet, ffi.UnsignedInt)>>('clang_getDiagnosticInSet'); late final _clang_getDiagnosticInSet = _clang_getDiagnosticInSetPtr .asFunction(); /// Deserialize a set of diagnostics from a Clang diagnostics bitcode file. CXDiagnosticSet clang_loadDiagnostics( - ffi.Pointer file, + ffi.Pointer file, ffi.Pointer error, ffi.Pointer errorString, ) { @@ -1004,12 +998,12 @@ class LibClang { late final _clang_loadDiagnosticsPtr = _lookup< ffi.NativeFunction< CXDiagnosticSet Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('clang_loadDiagnostics'); late final _clang_loadDiagnostics = _clang_loadDiagnosticsPtr.asFunction< - CXDiagnosticSet Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + CXDiagnosticSet Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Release a CXDiagnosticSet and all of its contained diagnostics. void clang_disposeDiagnosticSet( @@ -1051,9 +1045,9 @@ class LibClang { ); } - late final _clang_getNumDiagnosticsPtr = _lookup< - ffi.NativeFunction>( - 'clang_getNumDiagnostics'); + late final _clang_getNumDiagnosticsPtr = + _lookup>( + 'clang_getNumDiagnostics'); late final _clang_getNumDiagnostics = _clang_getNumDiagnosticsPtr.asFunction(); @@ -1071,7 +1065,7 @@ class LibClang { late final _clang_getDiagnosticPtr = _lookup< ffi.NativeFunction< CXDiagnostic Function( - CXTranslationUnit, pkg_ffi.UnsignedInt)>>('clang_getDiagnostic'); + CXTranslationUnit, ffi.UnsignedInt)>>('clang_getDiagnostic'); late final _clang_getDiagnostic = _clang_getDiagnosticPtr .asFunction(); @@ -1118,9 +1112,8 @@ class LibClang { } late final _clang_formatDiagnosticPtr = _lookup< - ffi.NativeFunction< - CXString Function( - CXDiagnostic, pkg_ffi.UnsignedInt)>>('clang_formatDiagnostic'); + ffi.NativeFunction>( + 'clang_formatDiagnostic'); late final _clang_formatDiagnostic = _clang_formatDiagnosticPtr .asFunction(); @@ -1131,7 +1124,7 @@ class LibClang { } late final _clang_defaultDiagnosticDisplayOptionsPtr = - _lookup>( + _lookup>( 'clang_defaultDiagnosticDisplayOptions'); late final _clang_defaultDiagnosticDisplayOptions = _clang_defaultDiagnosticDisplayOptionsPtr.asFunction(); @@ -1209,7 +1202,7 @@ class LibClang { } late final _clang_getDiagnosticCategoryPtr = - _lookup>( + _lookup>( 'clang_getDiagnosticCategory'); late final _clang_getDiagnosticCategory = _clang_getDiagnosticCategoryPtr.asFunction(); @@ -1225,7 +1218,7 @@ class LibClang { } late final _clang_getDiagnosticCategoryNamePtr = - _lookup>( + _lookup>( 'clang_getDiagnosticCategoryName'); late final _clang_getDiagnosticCategoryName = _clang_getDiagnosticCategoryNamePtr.asFunction(); @@ -1257,7 +1250,7 @@ class LibClang { } late final _clang_getDiagnosticNumRangesPtr = - _lookup>( + _lookup>( 'clang_getDiagnosticNumRanges'); late final _clang_getDiagnosticNumRanges = _clang_getDiagnosticNumRangesPtr.asFunction(); @@ -1276,7 +1269,7 @@ class LibClang { late final _clang_getDiagnosticRangePtr = _lookup< ffi.NativeFunction< CXSourceRange Function( - CXDiagnostic, pkg_ffi.UnsignedInt)>>('clang_getDiagnosticRange'); + CXDiagnostic, ffi.UnsignedInt)>>('clang_getDiagnosticRange'); late final _clang_getDiagnosticRange = _clang_getDiagnosticRangePtr .asFunction(); @@ -1290,7 +1283,7 @@ class LibClang { } late final _clang_getDiagnosticNumFixItsPtr = - _lookup>( + _lookup>( 'clang_getDiagnosticNumFixIts'); late final _clang_getDiagnosticNumFixIts = _clang_getDiagnosticNumFixItsPtr.asFunction(); @@ -1310,7 +1303,7 @@ class LibClang { late final _clang_getDiagnosticFixItPtr = _lookup< ffi.NativeFunction< - CXString Function(CXDiagnostic, pkg_ffi.UnsignedInt, + CXString Function(CXDiagnostic, ffi.UnsignedInt, ffi.Pointer)>>('clang_getDiagnosticFixIt'); late final _clang_getDiagnosticFixIt = _clang_getDiagnosticFixItPtr.asFunction< @@ -1336,9 +1329,9 @@ class LibClang { /// command line arguments one would pass to the compiler. CXTranslationUnit clang_createTranslationUnitFromSourceFile( CXIndex CIdx, - ffi.Pointer source_filename, + ffi.Pointer source_filename, int num_clang_command_line_args, - ffi.Pointer> clang_command_line_args, + ffi.Pointer> clang_command_line_args, int num_unsaved_files, ffi.Pointer unsaved_files, ) { @@ -1356,19 +1349,19 @@ class LibClang { ffi.NativeFunction< CXTranslationUnit Function( CXIndex, - ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer>, - pkg_ffi.UnsignedInt, + ffi.Pointer, + ffi.Int, + ffi.Pointer>, + ffi.UnsignedInt, ffi.Pointer)>>( 'clang_createTranslationUnitFromSourceFile'); late final _clang_createTranslationUnitFromSourceFile = _clang_createTranslationUnitFromSourceFilePtr.asFunction< CXTranslationUnit Function( CXIndex, - ffi.Pointer, + ffi.Pointer, int, - ffi.Pointer>, + ffi.Pointer>, int, ffi.Pointer)>(); @@ -1377,7 +1370,7 @@ class LibClang { /// CXTranslationUnit, without further detailed error codes. CXTranslationUnit clang_createTranslationUnit( CXIndex CIdx, - ffi.Pointer ast_filename, + ffi.Pointer ast_filename, ) { return _clang_createTranslationUnit( CIdx, @@ -1387,16 +1380,15 @@ class LibClang { late final _clang_createTranslationUnitPtr = _lookup< ffi.NativeFunction< - CXTranslationUnit Function(CXIndex, - ffi.Pointer)>>('clang_createTranslationUnit'); - late final _clang_createTranslationUnit = - _clang_createTranslationUnitPtr.asFunction< - CXTranslationUnit Function(CXIndex, ffi.Pointer)>(); + CXTranslationUnit Function( + CXIndex, ffi.Pointer)>>('clang_createTranslationUnit'); + late final _clang_createTranslationUnit = _clang_createTranslationUnitPtr + .asFunction)>(); /// Create a translation unit from an AST file ( -emit-ast). int clang_createTranslationUnit2( CXIndex CIdx, - ffi.Pointer ast_filename, + ffi.Pointer ast_filename, ffi.Pointer out_TU, ) { return _clang_createTranslationUnit2( @@ -1408,11 +1400,11 @@ class LibClang { late final _clang_createTranslationUnit2Ptr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(CXIndex, ffi.Pointer, + ffi.Int32 Function(CXIndex, ffi.Pointer, ffi.Pointer)>>('clang_createTranslationUnit2'); late final _clang_createTranslationUnit2 = _clang_createTranslationUnit2Ptr.asFunction< - int Function(CXIndex, ffi.Pointer, + int Function(CXIndex, ffi.Pointer, ffi.Pointer)>(); /// Returns the set of flags that is suitable for parsing a translation unit @@ -1422,7 +1414,7 @@ class LibClang { } late final _clang_defaultEditingTranslationUnitOptionsPtr = - _lookup>( + _lookup>( 'clang_defaultEditingTranslationUnitOptions'); late final _clang_defaultEditingTranslationUnitOptions = _clang_defaultEditingTranslationUnitOptionsPtr @@ -1433,8 +1425,8 @@ class LibClang { /// CXTranslationUnit, without further detailed error codes. CXTranslationUnit clang_parseTranslationUnit( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -1455,18 +1447,18 @@ class LibClang { ffi.NativeFunction< CXTranslationUnit Function( CXIndex, - ffi.Pointer, - ffi.Pointer>, - pkg_ffi.Int, + ffi.Pointer, + ffi.Pointer>, + ffi.Int, ffi.Pointer, - pkg_ffi.UnsignedInt, - pkg_ffi.UnsignedInt)>>('clang_parseTranslationUnit'); + ffi.UnsignedInt, + ffi.UnsignedInt)>>('clang_parseTranslationUnit'); late final _clang_parseTranslationUnit = _clang_parseTranslationUnitPtr.asFunction< CXTranslationUnit Function( CXIndex, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>, int, ffi.Pointer, int, @@ -1476,8 +1468,8 @@ class LibClang { /// file. int clang_parseTranslationUnit2( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -1500,19 +1492,19 @@ class LibClang { ffi.NativeFunction< ffi.Int32 Function( CXIndex, - ffi.Pointer, - ffi.Pointer>, - pkg_ffi.Int, + ffi.Pointer, + ffi.Pointer>, + ffi.Int, ffi.Pointer, - pkg_ffi.UnsignedInt, - pkg_ffi.UnsignedInt, + ffi.UnsignedInt, + ffi.UnsignedInt, ffi.Pointer)>>('clang_parseTranslationUnit2'); late final _clang_parseTranslationUnit2 = _clang_parseTranslationUnit2Ptr.asFunction< int Function( CXIndex, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>, int, ffi.Pointer, int, @@ -1524,8 +1516,8 @@ class LibClang { /// library paths are relative to the binary. int clang_parseTranslationUnit2FullArgv( CXIndex CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -1548,20 +1540,20 @@ class LibClang { ffi.NativeFunction< ffi.Int32 Function( CXIndex, - ffi.Pointer, - ffi.Pointer>, - pkg_ffi.Int, + ffi.Pointer, + ffi.Pointer>, + ffi.Int, ffi.Pointer, - pkg_ffi.UnsignedInt, - pkg_ffi.UnsignedInt, + ffi.UnsignedInt, + ffi.UnsignedInt, ffi.Pointer)>>( 'clang_parseTranslationUnit2FullArgv'); late final _clang_parseTranslationUnit2FullArgv = _clang_parseTranslationUnit2FullArgvPtr.asFunction< int Function( CXIndex, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>, int, ffi.Pointer, int, @@ -1577,9 +1569,9 @@ class LibClang { ); } - late final _clang_defaultSaveOptionsPtr = _lookup< - ffi.NativeFunction>( - 'clang_defaultSaveOptions'); + late final _clang_defaultSaveOptionsPtr = + _lookup>( + 'clang_defaultSaveOptions'); late final _clang_defaultSaveOptions = _clang_defaultSaveOptionsPtr .asFunction(); @@ -1587,7 +1579,7 @@ class LibClang { /// translation unit on disk. int clang_saveTranslationUnit( CXTranslationUnit TU, - ffi.Pointer FileName, + ffi.Pointer FileName, int options, ) { return _clang_saveTranslationUnit( @@ -1599,11 +1591,11 @@ class LibClang { late final _clang_saveTranslationUnitPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(CXTranslationUnit, ffi.Pointer, - pkg_ffi.UnsignedInt)>>('clang_saveTranslationUnit'); + ffi.Int Function(CXTranslationUnit, ffi.Pointer, + ffi.UnsignedInt)>>('clang_saveTranslationUnit'); late final _clang_saveTranslationUnit = _clang_saveTranslationUnitPtr.asFunction< - int Function(CXTranslationUnit, ffi.Pointer, int)>(); + int Function(CXTranslationUnit, ffi.Pointer, int)>(); /// Suspend a translation unit in order to free memory associated with it. int clang_suspendTranslationUnit( @@ -1614,9 +1606,9 @@ class LibClang { ); } - late final _clang_suspendTranslationUnitPtr = _lookup< - ffi.NativeFunction>( - 'clang_suspendTranslationUnit'); + late final _clang_suspendTranslationUnitPtr = + _lookup>( + 'clang_suspendTranslationUnit'); late final _clang_suspendTranslationUnit = _clang_suspendTranslationUnitPtr .asFunction(); @@ -1645,9 +1637,9 @@ class LibClang { ); } - late final _clang_defaultReparseOptionsPtr = _lookup< - ffi.NativeFunction>( - 'clang_defaultReparseOptions'); + late final _clang_defaultReparseOptionsPtr = + _lookup>( + 'clang_defaultReparseOptions'); late final _clang_defaultReparseOptions = _clang_defaultReparseOptionsPtr .asFunction(); @@ -1668,11 +1660,11 @@ class LibClang { late final _clang_reparseTranslationUnitPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( CXTranslationUnit, - pkg_ffi.UnsignedInt, + ffi.UnsignedInt, ffi.Pointer, - pkg_ffi.UnsignedInt)>>('clang_reparseTranslationUnit'); + ffi.UnsignedInt)>>('clang_reparseTranslationUnit'); late final _clang_reparseTranslationUnit = _clang_reparseTranslationUnitPtr.asFunction< int Function( @@ -1680,7 +1672,7 @@ class LibClang { /// Returns the human-readable null-terminated C string that represents the /// name of the memory category. This string should never be freed. - ffi.Pointer clang_getTUResourceUsageName( + ffi.Pointer clang_getTUResourceUsageName( int kind, ) { return _clang_getTUResourceUsageName( @@ -1688,11 +1680,11 @@ class LibClang { ); } - late final _clang_getTUResourceUsageNamePtr = _lookup< - ffi.NativeFunction Function(ffi.Int32)>>( - 'clang_getTUResourceUsageName'); + late final _clang_getTUResourceUsageNamePtr = + _lookup Function(ffi.Int32)>>( + 'clang_getTUResourceUsageName'); late final _clang_getTUResourceUsageName = _clang_getTUResourceUsageNamePtr - .asFunction Function(int)>(); + .asFunction Function(int)>(); /// Return the memory usage of a translation unit. This object should be /// released with clang_disposeCXTUResourceUsage(). @@ -1781,7 +1773,7 @@ class LibClang { } late final _clang_TargetInfo_getPointerWidthPtr = - _lookup>( + _lookup>( 'clang_TargetInfo_getPointerWidth'); late final _clang_TargetInfo_getPointerWidth = _clang_TargetInfo_getPointerWidthPtr @@ -1824,9 +1816,9 @@ class LibClang { ); } - late final _clang_equalCursorsPtr = _lookup< - ffi.NativeFunction>( - 'clang_equalCursors'); + late final _clang_equalCursorsPtr = + _lookup>( + 'clang_equalCursors'); late final _clang_equalCursors = _clang_equalCursorsPtr.asFunction(); @@ -1840,7 +1832,7 @@ class LibClang { } late final _clang_Cursor_isNullPtr = - _lookup>( + _lookup>( 'clang_Cursor_isNull'); late final _clang_Cursor_isNull = _clang_Cursor_isNullPtr.asFunction(); @@ -1855,7 +1847,7 @@ class LibClang { } late final _clang_hashCursorPtr = - _lookup>( + _lookup>( 'clang_hashCursor'); late final _clang_hashCursor = _clang_hashCursorPtr.asFunction(); @@ -1885,7 +1877,7 @@ class LibClang { } late final _clang_isDeclarationPtr = - _lookup>( + _lookup>( 'clang_isDeclaration'); late final _clang_isDeclaration = _clang_isDeclarationPtr.asFunction(); @@ -1900,7 +1892,7 @@ class LibClang { } late final _clang_isInvalidDeclarationPtr = - _lookup>( + _lookup>( 'clang_isInvalidDeclaration'); late final _clang_isInvalidDeclaration = _clang_isInvalidDeclarationPtr.asFunction(); @@ -1915,7 +1907,7 @@ class LibClang { } late final _clang_isReferencePtr = - _lookup>( + _lookup>( 'clang_isReference'); late final _clang_isReference = _clang_isReferencePtr.asFunction(); @@ -1930,7 +1922,7 @@ class LibClang { } late final _clang_isExpressionPtr = - _lookup>( + _lookup>( 'clang_isExpression'); late final _clang_isExpression = _clang_isExpressionPtr.asFunction(); @@ -1945,7 +1937,7 @@ class LibClang { } late final _clang_isStatementPtr = - _lookup>( + _lookup>( 'clang_isStatement'); late final _clang_isStatement = _clang_isStatementPtr.asFunction(); @@ -1960,7 +1952,7 @@ class LibClang { } late final _clang_isAttributePtr = - _lookup>( + _lookup>( 'clang_isAttribute'); late final _clang_isAttribute = _clang_isAttributePtr.asFunction(); @@ -1975,7 +1967,7 @@ class LibClang { } late final _clang_Cursor_hasAttrsPtr = - _lookup>( + _lookup>( 'clang_Cursor_hasAttrs'); late final _clang_Cursor_hasAttrs = _clang_Cursor_hasAttrsPtr.asFunction(); @@ -1990,7 +1982,7 @@ class LibClang { } late final _clang_isInvalidPtr = - _lookup>( + _lookup>( 'clang_isInvalid'); late final _clang_isInvalid = _clang_isInvalidPtr.asFunction(); @@ -2005,7 +1997,7 @@ class LibClang { } late final _clang_isTranslationUnitPtr = - _lookup>( + _lookup>( 'clang_isTranslationUnit'); late final _clang_isTranslationUnit = _clang_isTranslationUnitPtr.asFunction(); @@ -2021,7 +2013,7 @@ class LibClang { } late final _clang_isPreprocessingPtr = - _lookup>( + _lookup>( 'clang_isPreprocessing'); late final _clang_isPreprocessing = _clang_isPreprocessingPtr.asFunction(); @@ -2037,7 +2029,7 @@ class LibClang { } late final _clang_isUnexposedPtr = - _lookup>( + _lookup>( 'clang_isUnexposed'); late final _clang_isUnexposed = _clang_isUnexposedPtr.asFunction(); @@ -2092,9 +2084,9 @@ class LibClang { /// platforms for which availability information is known. int clang_getCursorPlatformAvailability( CXCursor cursor, - ffi.Pointer always_deprecated, + ffi.Pointer always_deprecated, ffi.Pointer deprecated_message, - ffi.Pointer always_unavailable, + ffi.Pointer always_unavailable, ffi.Pointer unavailable_message, ffi.Pointer availability, int availability_size, @@ -2112,21 +2104,21 @@ class LibClang { late final _clang_getCursorPlatformAvailabilityPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( CXCursor, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, - pkg_ffi.Int)>>('clang_getCursorPlatformAvailability'); + ffi.Int)>>('clang_getCursorPlatformAvailability'); late final _clang_getCursorPlatformAvailability = _clang_getCursorPlatformAvailabilityPtr.asFunction< int Function( CXCursor, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); @@ -2233,9 +2225,8 @@ class LibClang { } late final _clang_CXCursorSet_containsPtr = _lookup< - ffi.NativeFunction< - pkg_ffi.UnsignedInt Function( - CXCursorSet, CXCursor)>>('clang_CXCursorSet_contains'); + ffi.NativeFunction>( + 'clang_CXCursorSet_contains'); late final _clang_CXCursorSet_contains = _clang_CXCursorSet_containsPtr .asFunction(); @@ -2251,9 +2242,8 @@ class LibClang { } late final _clang_CXCursorSet_insertPtr = _lookup< - ffi.NativeFunction< - pkg_ffi.UnsignedInt Function( - CXCursorSet, CXCursor)>>('clang_CXCursorSet_insert'); + ffi.NativeFunction>( + 'clang_CXCursorSet_insert'); late final _clang_CXCursorSet_insert = _clang_CXCursorSet_insertPtr .asFunction(); @@ -2291,7 +2281,7 @@ class LibClang { void clang_getOverriddenCursors( CXCursor cursor, ffi.Pointer> overridden, - ffi.Pointer num_overridden, + ffi.Pointer num_overridden, ) { return _clang_getOverriddenCursors( cursor, @@ -2303,11 +2293,11 @@ class LibClang { late final _clang_getOverriddenCursorsPtr = _lookup< ffi.NativeFunction< ffi.Void Function(CXCursor, ffi.Pointer>, - ffi.Pointer)>>('clang_getOverriddenCursors'); + ffi.Pointer)>>('clang_getOverriddenCursors'); late final _clang_getOverriddenCursors = _clang_getOverriddenCursorsPtr.asFunction< void Function(CXCursor, ffi.Pointer>, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Free the set of overridden cursors returned by /// clang_getOverriddenCursors(). @@ -2466,7 +2456,7 @@ class LibClang { } late final _clang_getEnumConstantDeclValuePtr = - _lookup>( + _lookup>( 'clang_getEnumConstantDeclValue'); late final _clang_getEnumConstantDeclValue = _clang_getEnumConstantDeclValuePtr.asFunction(); @@ -2482,7 +2472,7 @@ class LibClang { } late final _clang_getEnumConstantDeclUnsignedValuePtr = - _lookup>( + _lookup>( 'clang_getEnumConstantDeclUnsignedValue'); late final _clang_getEnumConstantDeclUnsignedValue = _clang_getEnumConstantDeclUnsignedValuePtr @@ -2498,7 +2488,7 @@ class LibClang { } late final _clang_getFieldDeclBitWidthPtr = - _lookup>( + _lookup>( 'clang_getFieldDeclBitWidth'); late final _clang_getFieldDeclBitWidth = _clang_getFieldDeclBitWidthPtr.asFunction(); @@ -2514,7 +2504,7 @@ class LibClang { } late final _clang_Cursor_getNumArgumentsPtr = - _lookup>( + _lookup>( 'clang_Cursor_getNumArguments'); late final _clang_Cursor_getNumArguments = _clang_Cursor_getNumArgumentsPtr.asFunction(); @@ -2530,9 +2520,9 @@ class LibClang { ); } - late final _clang_Cursor_getArgumentPtr = _lookup< - ffi.NativeFunction>( - 'clang_Cursor_getArgument'); + late final _clang_Cursor_getArgumentPtr = + _lookup>( + 'clang_Cursor_getArgument'); late final _clang_Cursor_getArgument = _clang_Cursor_getArgumentPtr .asFunction(); @@ -2547,7 +2537,7 @@ class LibClang { } late final _clang_Cursor_getNumTemplateArgumentsPtr = - _lookup>( + _lookup>( 'clang_Cursor_getNumTemplateArguments'); late final _clang_Cursor_getNumTemplateArguments = _clang_Cursor_getNumTemplateArgumentsPtr @@ -2565,9 +2555,8 @@ class LibClang { } late final _clang_Cursor_getTemplateArgumentKindPtr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(CXCursor, - pkg_ffi.UnsignedInt)>>('clang_Cursor_getTemplateArgumentKind'); + ffi.NativeFunction>( + 'clang_Cursor_getTemplateArgumentKind'); late final _clang_Cursor_getTemplateArgumentKind = _clang_Cursor_getTemplateArgumentKindPtr .asFunction(); @@ -2584,9 +2573,9 @@ class LibClang { ); } - late final _clang_Cursor_getTemplateArgumentTypePtr = _lookup< - ffi.NativeFunction>( - 'clang_Cursor_getTemplateArgumentType'); + late final _clang_Cursor_getTemplateArgumentTypePtr = + _lookup>( + 'clang_Cursor_getTemplateArgumentType'); late final _clang_Cursor_getTemplateArgumentType = _clang_Cursor_getTemplateArgumentTypePtr .asFunction(); @@ -2604,9 +2593,8 @@ class LibClang { } late final _clang_Cursor_getTemplateArgumentValuePtr = _lookup< - ffi.NativeFunction< - pkg_ffi.LongLong Function(CXCursor, - pkg_ffi.UnsignedInt)>>('clang_Cursor_getTemplateArgumentValue'); + ffi.NativeFunction>( + 'clang_Cursor_getTemplateArgumentValue'); late final _clang_Cursor_getTemplateArgumentValue = _clang_Cursor_getTemplateArgumentValuePtr .asFunction(); @@ -2625,8 +2613,7 @@ class LibClang { late final _clang_Cursor_getTemplateArgumentUnsignedValuePtr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedLongLong Function( - CXCursor, pkg_ffi.UnsignedInt)>>( + ffi.UnsignedLongLong Function(CXCursor, ffi.UnsignedInt)>>( 'clang_Cursor_getTemplateArgumentUnsignedValue'); late final _clang_Cursor_getTemplateArgumentUnsignedValue = _clang_Cursor_getTemplateArgumentUnsignedValuePtr @@ -2644,7 +2631,7 @@ class LibClang { } late final _clang_equalTypesPtr = - _lookup>( + _lookup>( 'clang_equalTypes'); late final _clang_equalTypes = _clang_equalTypesPtr.asFunction(); @@ -2675,7 +2662,7 @@ class LibClang { } late final _clang_isConstQualifiedTypePtr = - _lookup>( + _lookup>( 'clang_isConstQualifiedType'); late final _clang_isConstQualifiedType = _clang_isConstQualifiedTypePtr.asFunction(); @@ -2690,7 +2677,7 @@ class LibClang { } late final _clang_Cursor_isMacroFunctionLikePtr = - _lookup>( + _lookup>( 'clang_Cursor_isMacroFunctionLike'); late final _clang_Cursor_isMacroFunctionLike = _clang_Cursor_isMacroFunctionLikePtr.asFunction(); @@ -2705,7 +2692,7 @@ class LibClang { } late final _clang_Cursor_isMacroBuiltinPtr = - _lookup>( + _lookup>( 'clang_Cursor_isMacroBuiltin'); late final _clang_Cursor_isMacroBuiltin = _clang_Cursor_isMacroBuiltinPtr.asFunction(); @@ -2721,7 +2708,7 @@ class LibClang { } late final _clang_Cursor_isFunctionInlinedPtr = - _lookup>( + _lookup>( 'clang_Cursor_isFunctionInlined'); late final _clang_Cursor_isFunctionInlined = _clang_Cursor_isFunctionInlinedPtr.asFunction(); @@ -2738,7 +2725,7 @@ class LibClang { } late final _clang_isVolatileQualifiedTypePtr = - _lookup>( + _lookup>( 'clang_isVolatileQualifiedType'); late final _clang_isVolatileQualifiedType = _clang_isVolatileQualifiedTypePtr.asFunction(); @@ -2755,7 +2742,7 @@ class LibClang { } late final _clang_isRestrictQualifiedTypePtr = - _lookup>( + _lookup>( 'clang_isRestrictQualifiedType'); late final _clang_isRestrictQualifiedType = _clang_isRestrictQualifiedTypePtr.asFunction(); @@ -2770,7 +2757,7 @@ class LibClang { } late final _clang_getAddressSpacePtr = - _lookup>( + _lookup>( 'clang_getAddressSpace'); late final _clang_getAddressSpace = _clang_getAddressSpacePtr.asFunction(); @@ -2906,7 +2893,7 @@ class LibClang { } late final _clang_getExceptionSpecificationTypePtr = - _lookup>( + _lookup>( 'clang_getExceptionSpecificationType'); late final _clang_getExceptionSpecificationType = _clang_getExceptionSpecificationTypePtr @@ -2923,7 +2910,7 @@ class LibClang { } late final _clang_getNumArgTypesPtr = - _lookup>( + _lookup>( 'clang_getNumArgTypes'); late final _clang_getNumArgTypes = _clang_getNumArgTypesPtr.asFunction(); @@ -2940,7 +2927,7 @@ class LibClang { } late final _clang_getArgTypePtr = - _lookup>( + _lookup>( 'clang_getArgType'); late final _clang_getArgType = _clang_getArgTypePtr.asFunction(); @@ -2972,7 +2959,7 @@ class LibClang { } late final _clang_Type_getNumObjCProtocolRefsPtr = - _lookup>( + _lookup>( 'clang_Type_getNumObjCProtocolRefs'); late final _clang_Type_getNumObjCProtocolRefs = _clang_Type_getNumObjCProtocolRefsPtr.asFunction(); @@ -2988,9 +2975,9 @@ class LibClang { ); } - late final _clang_Type_getObjCProtocolDeclPtr = _lookup< - ffi.NativeFunction>( - 'clang_Type_getObjCProtocolDecl'); + late final _clang_Type_getObjCProtocolDeclPtr = + _lookup>( + 'clang_Type_getObjCProtocolDecl'); late final _clang_Type_getObjCProtocolDecl = _clang_Type_getObjCProtocolDeclPtr .asFunction(); @@ -3005,7 +2992,7 @@ class LibClang { } late final _clang_Type_getNumObjCTypeArgsPtr = - _lookup>( + _lookup>( 'clang_Type_getNumObjCTypeArgs'); late final _clang_Type_getNumObjCTypeArgs = _clang_Type_getNumObjCTypeArgsPtr.asFunction(); @@ -3022,7 +3009,7 @@ class LibClang { } late final _clang_Type_getObjCTypeArgPtr = - _lookup>( + _lookup>( 'clang_Type_getObjCTypeArg'); late final _clang_Type_getObjCTypeArg = _clang_Type_getObjCTypeArgPtr.asFunction(); @@ -3037,7 +3024,7 @@ class LibClang { } late final _clang_isFunctionTypeVariadicPtr = - _lookup>( + _lookup>( 'clang_isFunctionTypeVariadic'); late final _clang_isFunctionTypeVariadic = _clang_isFunctionTypeVariadicPtr.asFunction(); @@ -3068,7 +3055,7 @@ class LibClang { } late final _clang_getCursorExceptionSpecificationTypePtr = - _lookup>( + _lookup>( 'clang_getCursorExceptionSpecificationType'); late final _clang_getCursorExceptionSpecificationType = _clang_getCursorExceptionSpecificationTypePtr @@ -3084,7 +3071,7 @@ class LibClang { } late final _clang_isPODTypePtr = - _lookup>( + _lookup>( 'clang_isPODType'); late final _clang_isPODType = _clang_isPODTypePtr.asFunction(); @@ -3114,7 +3101,7 @@ class LibClang { } late final _clang_getNumElementsPtr = - _lookup>( + _lookup>( 'clang_getNumElements'); late final _clang_getNumElements = _clang_getNumElementsPtr.asFunction(); @@ -3144,7 +3131,7 @@ class LibClang { } late final _clang_getArraySizePtr = - _lookup>( + _lookup>( 'clang_getArraySize'); late final _clang_getArraySize = _clang_getArraySizePtr.asFunction(); @@ -3174,7 +3161,7 @@ class LibClang { } late final _clang_Type_isTransparentTagTypedefPtr = - _lookup>( + _lookup>( 'clang_Type_isTransparentTagTypedef'); late final _clang_Type_isTransparentTagTypedef = _clang_Type_isTransparentTagTypedefPtr.asFunction(); @@ -3204,7 +3191,7 @@ class LibClang { } late final _clang_Type_getAlignOfPtr = - _lookup>( + _lookup>( 'clang_Type_getAlignOf'); late final _clang_Type_getAlignOf = _clang_Type_getAlignOfPtr.asFunction(); @@ -3234,7 +3221,7 @@ class LibClang { } late final _clang_Type_getSizeOfPtr = - _lookup>( + _lookup>( 'clang_Type_getSizeOf'); late final _clang_Type_getSizeOf = _clang_Type_getSizeOfPtr.asFunction(); @@ -3243,7 +3230,7 @@ class LibClang { /// would be returned by __offsetof__ as per C++11[18.2p4] int clang_Type_getOffsetOf( CXType T, - ffi.Pointer S, + ffi.Pointer S, ) { return _clang_Type_getOffsetOf( T, @@ -3253,10 +3240,10 @@ class LibClang { late final _clang_Type_getOffsetOfPtr = _lookup< ffi.NativeFunction< - pkg_ffi.LongLong Function( - CXType, ffi.Pointer)>>('clang_Type_getOffsetOf'); + ffi.LongLong Function( + CXType, ffi.Pointer)>>('clang_Type_getOffsetOf'); late final _clang_Type_getOffsetOf = _clang_Type_getOffsetOfPtr - .asFunction)>(); + .asFunction)>(); /// Return the type that was modified by this attributed type. CXType clang_Type_getModifiedType( @@ -3283,7 +3270,7 @@ class LibClang { } late final _clang_Cursor_getOffsetOfFieldPtr = - _lookup>( + _lookup>( 'clang_Cursor_getOffsetOfField'); late final _clang_Cursor_getOffsetOfField = _clang_Cursor_getOffsetOfFieldPtr.asFunction(); @@ -3299,7 +3286,7 @@ class LibClang { } late final _clang_Cursor_isAnonymousPtr = - _lookup>( + _lookup>( 'clang_Cursor_isAnonymous'); late final _clang_Cursor_isAnonymous = _clang_Cursor_isAnonymousPtr.asFunction(); @@ -3315,7 +3302,7 @@ class LibClang { } late final _clang_Cursor_isAnonymousRecordDeclPtr = - _lookup>( + _lookup>( 'clang_Cursor_isAnonymousRecordDecl'); late final _clang_Cursor_isAnonymousRecordDecl = _clang_Cursor_isAnonymousRecordDeclPtr @@ -3332,7 +3319,7 @@ class LibClang { } late final _clang_Cursor_isInlineNamespacePtr = - _lookup>( + _lookup>( 'clang_Cursor_isInlineNamespace'); late final _clang_Cursor_isInlineNamespace = _clang_Cursor_isInlineNamespacePtr.asFunction(); @@ -3348,7 +3335,7 @@ class LibClang { } late final _clang_Type_getNumTemplateArgumentsPtr = - _lookup>( + _lookup>( 'clang_Type_getNumTemplateArguments'); late final _clang_Type_getNumTemplateArguments = _clang_Type_getNumTemplateArgumentsPtr.asFunction(); @@ -3366,7 +3353,7 @@ class LibClang { } late final _clang_Type_getTemplateArgumentAsTypePtr = - _lookup>( + _lookup>( 'clang_Type_getTemplateArgumentAsType'); late final _clang_Type_getTemplateArgumentAsType = _clang_Type_getTemplateArgumentAsTypePtr @@ -3398,7 +3385,7 @@ class LibClang { } late final _clang_Cursor_isBitFieldPtr = - _lookup>( + _lookup>( 'clang_Cursor_isBitField'); late final _clang_Cursor_isBitField = _clang_Cursor_isBitFieldPtr.asFunction(); @@ -3414,7 +3401,7 @@ class LibClang { } late final _clang_isVirtualBasePtr = - _lookup>( + _lookup>( 'clang_isVirtualBase'); late final _clang_isVirtualBase = _clang_isVirtualBasePtr.asFunction(); @@ -3460,7 +3447,7 @@ class LibClang { } late final _clang_getNumOverloadedDeclsPtr = - _lookup>( + _lookup>( 'clang_getNumOverloadedDecls'); late final _clang_getNumOverloadedDecls = _clang_getNumOverloadedDeclsPtr.asFunction(); @@ -3477,9 +3464,9 @@ class LibClang { ); } - late final _clang_getOverloadedDeclPtr = _lookup< - ffi.NativeFunction>( - 'clang_getOverloadedDecl'); + late final _clang_getOverloadedDeclPtr = + _lookup>( + 'clang_getOverloadedDecl'); late final _clang_getOverloadedDecl = _clang_getOverloadedDeclPtr .asFunction(); @@ -3515,7 +3502,7 @@ class LibClang { late final _clang_visitChildrenPtr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedInt Function( + ffi.UnsignedInt Function( CXCursor, CXCursorVisitor, CXClientData)>>('clang_visitChildren'); late final _clang_visitChildren = _clang_visitChildrenPtr .asFunction(); @@ -3538,7 +3525,7 @@ class LibClang { /// Construct a USR for a specified Objective-C class. CXString clang_constructUSR_ObjCClass( - ffi.Pointer class_name, + ffi.Pointer class_name, ) { return _clang_constructUSR_ObjCClass( class_name, @@ -3546,15 +3533,15 @@ class LibClang { } late final _clang_constructUSR_ObjCClassPtr = - _lookup)>>( + _lookup)>>( 'clang_constructUSR_ObjCClass'); late final _clang_constructUSR_ObjCClass = _clang_constructUSR_ObjCClassPtr - .asFunction)>(); + .asFunction)>(); /// Construct a USR for a specified Objective-C category. CXString clang_constructUSR_ObjCCategory( - ffi.Pointer class_name, - ffi.Pointer category_name, + ffi.Pointer class_name, + ffi.Pointer category_name, ) { return _clang_constructUSR_ObjCCategory( class_name, @@ -3564,16 +3551,15 @@ class LibClang { late final _clang_constructUSR_ObjCCategoryPtr = _lookup< ffi.NativeFunction< - CXString Function(ffi.Pointer, - ffi.Pointer)>>('clang_constructUSR_ObjCCategory'); + CXString Function(ffi.Pointer, + ffi.Pointer)>>('clang_constructUSR_ObjCCategory'); late final _clang_constructUSR_ObjCCategory = _clang_constructUSR_ObjCCategoryPtr.asFunction< - CXString Function( - ffi.Pointer, ffi.Pointer)>(); + CXString Function(ffi.Pointer, ffi.Pointer)>(); /// Construct a USR for a specified Objective-C protocol. CXString clang_constructUSR_ObjCProtocol( - ffi.Pointer protocol_name, + ffi.Pointer protocol_name, ) { return _clang_constructUSR_ObjCProtocol( protocol_name, @@ -3581,16 +3567,16 @@ class LibClang { } late final _clang_constructUSR_ObjCProtocolPtr = - _lookup)>>( + _lookup)>>( 'clang_constructUSR_ObjCProtocol'); late final _clang_constructUSR_ObjCProtocol = _clang_constructUSR_ObjCProtocolPtr - .asFunction)>(); + .asFunction)>(); /// Construct a USR for a specified Objective-C instance variable and the USR /// for its containing class. CXString clang_constructUSR_ObjCIvar( - ffi.Pointer name, + ffi.Pointer name, CXString classUSR, ) { return _clang_constructUSR_ObjCIvar( @@ -3601,15 +3587,15 @@ class LibClang { late final _clang_constructUSR_ObjCIvarPtr = _lookup< ffi.NativeFunction< - CXString Function(ffi.Pointer, - CXString)>>('clang_constructUSR_ObjCIvar'); + CXString Function( + ffi.Pointer, CXString)>>('clang_constructUSR_ObjCIvar'); late final _clang_constructUSR_ObjCIvar = _clang_constructUSR_ObjCIvarPtr - .asFunction, CXString)>(); + .asFunction, CXString)>(); /// Construct a USR for a specified Objective-C method and the USR for its /// containing class. CXString clang_constructUSR_ObjCMethod( - ffi.Pointer name, + ffi.Pointer name, int isInstanceMethod, CXString classUSR, ) { @@ -3622,16 +3608,15 @@ class LibClang { late final _clang_constructUSR_ObjCMethodPtr = _lookup< ffi.NativeFunction< - CXString Function(ffi.Pointer, pkg_ffi.UnsignedInt, + CXString Function(ffi.Pointer, ffi.UnsignedInt, CXString)>>('clang_constructUSR_ObjCMethod'); - late final _clang_constructUSR_ObjCMethod = - _clang_constructUSR_ObjCMethodPtr.asFunction< - CXString Function(ffi.Pointer, int, CXString)>(); + late final _clang_constructUSR_ObjCMethod = _clang_constructUSR_ObjCMethodPtr + .asFunction, int, CXString)>(); /// Construct a USR for a specified Objective-C property and the USR for its /// containing class. CXString clang_constructUSR_ObjCProperty( - ffi.Pointer property, + ffi.Pointer property, CXString classUSR, ) { return _clang_constructUSR_ObjCProperty( @@ -3642,11 +3627,11 @@ class LibClang { late final _clang_constructUSR_ObjCPropertyPtr = _lookup< ffi.NativeFunction< - CXString Function(ffi.Pointer, + CXString Function(ffi.Pointer, CXString)>>('clang_constructUSR_ObjCProperty'); late final _clang_constructUSR_ObjCProperty = _clang_constructUSR_ObjCPropertyPtr - .asFunction, CXString)>(); + .asFunction, CXString)>(); /// Retrieve a name for the entity referenced by this cursor. CXString clang_getCursorSpelling( @@ -3681,8 +3666,8 @@ class LibClang { late final _clang_Cursor_getSpellingNameRangePtr = _lookup< ffi.NativeFunction< - CXSourceRange Function(CXCursor, pkg_ffi.UnsignedInt, - pkg_ffi.UnsignedInt)>>('clang_Cursor_getSpellingNameRange'); + CXSourceRange Function(CXCursor, ffi.UnsignedInt, + ffi.UnsignedInt)>>('clang_Cursor_getSpellingNameRange'); late final _clang_Cursor_getSpellingNameRange = _clang_Cursor_getSpellingNameRangePtr .asFunction(); @@ -3700,7 +3685,7 @@ class LibClang { late final _clang_PrintingPolicy_getPropertyPtr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedInt Function(CXPrintingPolicy, + ffi.UnsignedInt Function(CXPrintingPolicy, ffi.Int32)>>('clang_PrintingPolicy_getProperty'); late final _clang_PrintingPolicy_getProperty = _clang_PrintingPolicy_getPropertyPtr @@ -3722,7 +3707,7 @@ class LibClang { late final _clang_PrintingPolicy_setPropertyPtr = _lookup< ffi.NativeFunction< ffi.Void Function(CXPrintingPolicy, ffi.Int32, - pkg_ffi.UnsignedInt)>>('clang_PrintingPolicy_setProperty'); + ffi.UnsignedInt)>>('clang_PrintingPolicy_setProperty'); late final _clang_PrintingPolicy_setProperty = _clang_PrintingPolicy_setPropertyPtr .asFunction(); @@ -3832,7 +3817,7 @@ class LibClang { } late final _clang_isCursorDefinitionPtr = - _lookup>( + _lookup>( 'clang_isCursorDefinition'); late final _clang_isCursorDefinition = _clang_isCursorDefinitionPtr.asFunction(); @@ -3863,7 +3848,7 @@ class LibClang { } late final _clang_Cursor_getObjCSelectorIndexPtr = - _lookup>( + _lookup>( 'clang_Cursor_getObjCSelectorIndex'); late final _clang_Cursor_getObjCSelectorIndex = _clang_Cursor_getObjCSelectorIndexPtr @@ -3880,7 +3865,7 @@ class LibClang { } late final _clang_Cursor_isDynamicCallPtr = - _lookup>( + _lookup>( 'clang_Cursor_isDynamicCall'); late final _clang_Cursor_isDynamicCall = _clang_Cursor_isDynamicCallPtr.asFunction(); @@ -3916,8 +3901,8 @@ class LibClang { late final _clang_Cursor_getObjCPropertyAttributesPtr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedInt Function(CXCursor, - pkg_ffi.UnsignedInt)>>('clang_Cursor_getObjCPropertyAttributes'); + ffi.UnsignedInt Function(CXCursor, + ffi.UnsignedInt)>>('clang_Cursor_getObjCPropertyAttributes'); late final _clang_Cursor_getObjCPropertyAttributes = _clang_Cursor_getObjCPropertyAttributesPtr .asFunction(); @@ -3969,7 +3954,7 @@ class LibClang { } late final _clang_Cursor_getObjCDeclQualifiersPtr = - _lookup>( + _lookup>( 'clang_Cursor_getObjCDeclQualifiers'); late final _clang_Cursor_getObjCDeclQualifiers = _clang_Cursor_getObjCDeclQualifiersPtr @@ -3988,7 +3973,7 @@ class LibClang { } late final _clang_Cursor_isObjCOptionalPtr = - _lookup>( + _lookup>( 'clang_Cursor_isObjCOptional'); late final _clang_Cursor_isObjCOptional = _clang_Cursor_isObjCOptionalPtr.asFunction(); @@ -4003,7 +3988,7 @@ class LibClang { } late final _clang_Cursor_isVariadicPtr = - _lookup>( + _lookup>( 'clang_Cursor_isVariadic'); late final _clang_Cursor_isVariadic = _clang_Cursor_isVariadicPtr.asFunction(); @@ -4014,7 +3999,7 @@ class LibClang { CXCursor C, ffi.Pointer language, ffi.Pointer definedIn, - ffi.Pointer isGenerated, + ffi.Pointer isGenerated, ) { return _clang_Cursor_isExternalSymbol( C, @@ -4025,14 +4010,16 @@ class LibClang { } late final _clang_Cursor_isExternalSymbolPtr = _lookup< - ffi.NativeFunction< - pkg_ffi.UnsignedInt Function(CXCursor, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>( - 'clang_Cursor_isExternalSymbol'); + ffi.NativeFunction< + ffi.UnsignedInt Function( + CXCursor, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_Cursor_isExternalSymbol'); late final _clang_Cursor_isExternalSymbol = _clang_Cursor_isExternalSymbolPtr.asFunction< int Function(CXCursor, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Given a cursor that represents a declaration, return the associated /// comment's source range. The range may include multiple consecutive @@ -4237,7 +4224,7 @@ class LibClang { } late final _clang_Module_isSystemPtr = - _lookup>( + _lookup>( 'clang_Module_isSystem'); late final _clang_Module_isSystem = _clang_Module_isSystemPtr.asFunction(); @@ -4255,7 +4242,7 @@ class LibClang { late final _clang_Module_getNumTopLevelHeadersPtr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedInt Function(CXTranslationUnit, + ffi.UnsignedInt Function(CXTranslationUnit, CXModule)>>('clang_Module_getNumTopLevelHeaders'); late final _clang_Module_getNumTopLevelHeaders = _clang_Module_getNumTopLevelHeadersPtr @@ -4277,7 +4264,7 @@ class LibClang { late final _clang_Module_getTopLevelHeaderPtr = _lookup< ffi.NativeFunction< CXFile Function(CXTranslationUnit, CXModule, - pkg_ffi.UnsignedInt)>>('clang_Module_getTopLevelHeader'); + ffi.UnsignedInt)>>('clang_Module_getTopLevelHeader'); late final _clang_Module_getTopLevelHeader = _clang_Module_getTopLevelHeaderPtr .asFunction(); @@ -4292,7 +4279,7 @@ class LibClang { } late final _clang_CXXConstructor_isConvertingConstructorPtr = - _lookup>( + _lookup>( 'clang_CXXConstructor_isConvertingConstructor'); late final _clang_CXXConstructor_isConvertingConstructor = _clang_CXXConstructor_isConvertingConstructorPtr @@ -4308,7 +4295,7 @@ class LibClang { } late final _clang_CXXConstructor_isCopyConstructorPtr = - _lookup>( + _lookup>( 'clang_CXXConstructor_isCopyConstructor'); late final _clang_CXXConstructor_isCopyConstructor = _clang_CXXConstructor_isCopyConstructorPtr @@ -4324,7 +4311,7 @@ class LibClang { } late final _clang_CXXConstructor_isDefaultConstructorPtr = - _lookup>( + _lookup>( 'clang_CXXConstructor_isDefaultConstructor'); late final _clang_CXXConstructor_isDefaultConstructor = _clang_CXXConstructor_isDefaultConstructorPtr @@ -4340,7 +4327,7 @@ class LibClang { } late final _clang_CXXConstructor_isMoveConstructorPtr = - _lookup>( + _lookup>( 'clang_CXXConstructor_isMoveConstructor'); late final _clang_CXXConstructor_isMoveConstructor = _clang_CXXConstructor_isMoveConstructorPtr @@ -4356,7 +4343,7 @@ class LibClang { } late final _clang_CXXField_isMutablePtr = - _lookup>( + _lookup>( 'clang_CXXField_isMutable'); late final _clang_CXXField_isMutable = _clang_CXXField_isMutablePtr.asFunction(); @@ -4371,7 +4358,7 @@ class LibClang { } late final _clang_CXXMethod_isDefaultedPtr = - _lookup>( + _lookup>( 'clang_CXXMethod_isDefaulted'); late final _clang_CXXMethod_isDefaulted = _clang_CXXMethod_isDefaultedPtr.asFunction(); @@ -4387,7 +4374,7 @@ class LibClang { } late final _clang_CXXMethod_isPureVirtualPtr = - _lookup>( + _lookup>( 'clang_CXXMethod_isPureVirtual'); late final _clang_CXXMethod_isPureVirtual = _clang_CXXMethod_isPureVirtualPtr.asFunction(); @@ -4403,7 +4390,7 @@ class LibClang { } late final _clang_CXXMethod_isStaticPtr = - _lookup>( + _lookup>( 'clang_CXXMethod_isStatic'); late final _clang_CXXMethod_isStatic = _clang_CXXMethod_isStaticPtr.asFunction(); @@ -4420,7 +4407,7 @@ class LibClang { } late final _clang_CXXMethod_isVirtualPtr = - _lookup>( + _lookup>( 'clang_CXXMethod_isVirtual'); late final _clang_CXXMethod_isVirtual = _clang_CXXMethod_isVirtualPtr.asFunction(); @@ -4436,7 +4423,7 @@ class LibClang { } late final _clang_CXXRecord_isAbstractPtr = - _lookup>( + _lookup>( 'clang_CXXRecord_isAbstract'); late final _clang_CXXRecord_isAbstract = _clang_CXXRecord_isAbstractPtr.asFunction(); @@ -4451,7 +4438,7 @@ class LibClang { } late final _clang_EnumDecl_isScopedPtr = - _lookup>( + _lookup>( 'clang_EnumDecl_isScoped'); late final _clang_EnumDecl_isScoped = _clang_EnumDecl_isScopedPtr.asFunction(); @@ -4467,7 +4454,7 @@ class LibClang { } late final _clang_CXXMethod_isConstPtr = - _lookup>( + _lookup>( 'clang_CXXMethod_isConst'); late final _clang_CXXMethod_isConst = _clang_CXXMethod_isConstPtr.asFunction(); @@ -4522,8 +4509,8 @@ class LibClang { late final _clang_getCursorReferenceNameRangePtr = _lookup< ffi.NativeFunction< - CXSourceRange Function(CXCursor, pkg_ffi.UnsignedInt, - pkg_ffi.UnsignedInt)>>('clang_getCursorReferenceNameRange'); + CXSourceRange Function(CXCursor, ffi.UnsignedInt, + ffi.UnsignedInt)>>('clang_getCursorReferenceNameRange'); late final _clang_getCursorReferenceNameRange = _clang_getCursorReferenceNameRangePtr .asFunction(); @@ -4620,7 +4607,7 @@ class LibClang { CXTranslationUnit TU, CXSourceRange Range, ffi.Pointer> Tokens, - ffi.Pointer NumTokens, + ffi.Pointer NumTokens, ) { return _clang_tokenize( TU, @@ -4636,13 +4623,10 @@ class LibClang { CXTranslationUnit, CXSourceRange, ffi.Pointer>, - ffi.Pointer)>>('clang_tokenize'); + ffi.Pointer)>>('clang_tokenize'); late final _clang_tokenize = _clang_tokenizePtr.asFunction< - void Function( - CXTranslationUnit, - CXSourceRange, - ffi.Pointer>, - ffi.Pointer)>(); + void Function(CXTranslationUnit, CXSourceRange, + ffi.Pointer>, ffi.Pointer)>(); /// 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. @@ -4662,11 +4646,8 @@ class LibClang { late final _clang_annotateTokensPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - CXTranslationUnit, - ffi.Pointer, - pkg_ffi.UnsignedInt, - ffi.Pointer)>>('clang_annotateTokens'); + ffi.Void Function(CXTranslationUnit, ffi.Pointer, + ffi.UnsignedInt, ffi.Pointer)>>('clang_annotateTokens'); late final _clang_annotateTokens = _clang_annotateTokensPtr.asFunction< void Function(CXTranslationUnit, ffi.Pointer, int, ffi.Pointer)>(); @@ -4687,7 +4668,7 @@ class LibClang { late final _clang_disposeTokensPtr = _lookup< ffi.NativeFunction< ffi.Void Function(CXTranslationUnit, ffi.Pointer, - pkg_ffi.UnsignedInt)>>('clang_disposeTokens'); + ffi.UnsignedInt)>>('clang_disposeTokens'); late final _clang_disposeTokens = _clang_disposeTokensPtr.asFunction< void Function(CXTranslationUnit, ffi.Pointer, int)>(); @@ -4709,12 +4690,12 @@ class LibClang { void clang_getDefinitionSpellingAndExtent( CXCursor arg0, - ffi.Pointer> startBuf, - ffi.Pointer> endBuf, - ffi.Pointer startLine, - ffi.Pointer startColumn, - ffi.Pointer endLine, - ffi.Pointer endColumn, + ffi.Pointer> startBuf, + ffi.Pointer> endBuf, + ffi.Pointer startLine, + ffi.Pointer startColumn, + ffi.Pointer endLine, + ffi.Pointer endColumn, ) { return _clang_getDefinitionSpellingAndExtent( arg0, @@ -4731,23 +4712,23 @@ class LibClang { ffi.NativeFunction< ffi.Void Function( CXCursor, - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>( + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( 'clang_getDefinitionSpellingAndExtent'); late final _clang_getDefinitionSpellingAndExtent = _clang_getDefinitionSpellingAndExtentPtr.asFunction< void Function( CXCursor, - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); void clang_enableStackTraces() { return _clang_enableStackTraces(); @@ -4778,7 +4759,7 @@ class LibClang { ffi.Pointer< ffi.NativeFunction)>>, ffi.Pointer, - pkg_ffi.UnsignedInt)>>('clang_executeOnThread'); + ffi.UnsignedInt)>>('clang_executeOnThread'); late final _clang_executeOnThread = _clang_executeOnThreadPtr.asFunction< void Function( ffi.Pointer< @@ -4800,7 +4781,7 @@ class LibClang { late final _clang_getCompletionChunkKindPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(CXCompletionString, - pkg_ffi.UnsignedInt)>>('clang_getCompletionChunkKind'); + ffi.UnsignedInt)>>('clang_getCompletionChunkKind'); late final _clang_getCompletionChunkKind = _clang_getCompletionChunkKindPtr .asFunction(); @@ -4819,7 +4800,7 @@ class LibClang { late final _clang_getCompletionChunkTextPtr = _lookup< ffi.NativeFunction< CXString Function(CXCompletionString, - pkg_ffi.UnsignedInt)>>('clang_getCompletionChunkText'); + ffi.UnsignedInt)>>('clang_getCompletionChunkText'); late final _clang_getCompletionChunkText = _clang_getCompletionChunkTextPtr .asFunction(); @@ -4836,10 +4817,9 @@ class LibClang { } late final _clang_getCompletionChunkCompletionStringPtr = _lookup< - ffi.NativeFunction< - CXCompletionString Function( - CXCompletionString, pkg_ffi.UnsignedInt)>>( - 'clang_getCompletionChunkCompletionString'); + ffi.NativeFunction< + CXCompletionString Function(CXCompletionString, + ffi.UnsignedInt)>>('clang_getCompletionChunkCompletionString'); late final _clang_getCompletionChunkCompletionString = _clang_getCompletionChunkCompletionStringPtr .asFunction(); @@ -4853,9 +4833,9 @@ class LibClang { ); } - late final _clang_getNumCompletionChunksPtr = _lookup< - ffi.NativeFunction>( - 'clang_getNumCompletionChunks'); + late final _clang_getNumCompletionChunksPtr = + _lookup>( + 'clang_getNumCompletionChunks'); late final _clang_getNumCompletionChunks = _clang_getNumCompletionChunksPtr .asFunction(); @@ -4868,9 +4848,9 @@ class LibClang { ); } - late final _clang_getCompletionPriorityPtr = _lookup< - ffi.NativeFunction>( - 'clang_getCompletionPriority'); + late final _clang_getCompletionPriorityPtr = + _lookup>( + 'clang_getCompletionPriority'); late final _clang_getCompletionPriority = _clang_getCompletionPriorityPtr .asFunction(); @@ -4901,9 +4881,9 @@ class LibClang { ); } - late final _clang_getCompletionNumAnnotationsPtr = _lookup< - ffi.NativeFunction>( - 'clang_getCompletionNumAnnotations'); + late final _clang_getCompletionNumAnnotationsPtr = + _lookup>( + 'clang_getCompletionNumAnnotations'); late final _clang_getCompletionNumAnnotations = _clang_getCompletionNumAnnotationsPtr .asFunction(); @@ -4922,7 +4902,7 @@ class LibClang { late final _clang_getCompletionAnnotationPtr = _lookup< ffi.NativeFunction< CXString Function(CXCompletionString, - pkg_ffi.UnsignedInt)>>('clang_getCompletionAnnotation'); + ffi.UnsignedInt)>>('clang_getCompletionAnnotation'); late final _clang_getCompletionAnnotation = _clang_getCompletionAnnotationPtr .asFunction(); @@ -4992,8 +4972,8 @@ class LibClang { late final _clang_getCompletionNumFixItsPtr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedInt Function(ffi.Pointer, - pkg_ffi.UnsignedInt)>>('clang_getCompletionNumFixIts'); + ffi.UnsignedInt Function(ffi.Pointer, + ffi.UnsignedInt)>>('clang_getCompletionNumFixIts'); late final _clang_getCompletionNumFixIts = _clang_getCompletionNumFixItsPtr .asFunction, int)>(); @@ -5017,8 +4997,8 @@ class LibClang { ffi.NativeFunction< CXString Function( ffi.Pointer, - pkg_ffi.UnsignedInt, - pkg_ffi.UnsignedInt, + ffi.UnsignedInt, + ffi.UnsignedInt, ffi.Pointer)>>('clang_getCompletionFixIt'); late final _clang_getCompletionFixIt = _clang_getCompletionFixItPtr.asFunction< @@ -5032,7 +5012,7 @@ class LibClang { } late final _clang_defaultCodeCompleteOptionsPtr = - _lookup>( + _lookup>( 'clang_defaultCodeCompleteOptions'); late final _clang_defaultCodeCompleteOptions = _clang_defaultCodeCompleteOptionsPtr.asFunction(); @@ -5040,7 +5020,7 @@ class LibClang { /// Perform code completion at a given location in a translation unit. ffi.Pointer clang_codeCompleteAt( CXTranslationUnit TU, - ffi.Pointer complete_filename, + ffi.Pointer complete_filename, int complete_line, int complete_column, ffi.Pointer unsaved_files, @@ -5062,16 +5042,16 @@ class LibClang { ffi.NativeFunction< ffi.Pointer Function( CXTranslationUnit, - ffi.Pointer, - pkg_ffi.UnsignedInt, - pkg_ffi.UnsignedInt, + ffi.Pointer, + ffi.UnsignedInt, + ffi.UnsignedInt, ffi.Pointer, - pkg_ffi.UnsignedInt, - pkg_ffi.UnsignedInt)>>('clang_codeCompleteAt'); + ffi.UnsignedInt, + ffi.UnsignedInt)>>('clang_codeCompleteAt'); late final _clang_codeCompleteAt = _clang_codeCompleteAtPtr.asFunction< ffi.Pointer Function( CXTranslationUnit, - ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer, @@ -5092,7 +5072,7 @@ class LibClang { late final _clang_sortCodeCompletionResultsPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - pkg_ffi.UnsignedInt)>>('clang_sortCodeCompletionResults'); + ffi.UnsignedInt)>>('clang_sortCodeCompletionResults'); late final _clang_sortCodeCompletionResults = _clang_sortCodeCompletionResultsPtr .asFunction, int)>(); @@ -5126,8 +5106,7 @@ class LibClang { late final _clang_codeCompleteGetNumDiagnosticsPtr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedInt Function( - ffi.Pointer)>>( + ffi.UnsignedInt Function(ffi.Pointer)>>( 'clang_codeCompleteGetNumDiagnostics'); late final _clang_codeCompleteGetNumDiagnostics = _clang_codeCompleteGetNumDiagnosticsPtr @@ -5147,7 +5126,7 @@ class LibClang { late final _clang_codeCompleteGetDiagnosticPtr = _lookup< ffi.NativeFunction< CXDiagnostic Function(ffi.Pointer, - pkg_ffi.UnsignedInt)>>('clang_codeCompleteGetDiagnostic'); + ffi.UnsignedInt)>>('clang_codeCompleteGetDiagnostic'); late final _clang_codeCompleteGetDiagnostic = _clang_codeCompleteGetDiagnosticPtr.asFunction< CXDiagnostic Function(ffi.Pointer, int)>(); @@ -5164,7 +5143,7 @@ class LibClang { late final _clang_codeCompleteGetContextsPtr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedLongLong Function( + ffi.UnsignedLongLong Function( ffi.Pointer)>>( 'clang_codeCompleteGetContexts'); late final _clang_codeCompleteGetContexts = _clang_codeCompleteGetContextsPtr @@ -5176,7 +5155,7 @@ class LibClang { /// there is not a container, this function will return CXCursor_InvalidCode. int clang_codeCompleteGetContainerKind( ffi.Pointer Results, - ffi.Pointer IsIncomplete, + ffi.Pointer IsIncomplete, ) { return _clang_codeCompleteGetContainerKind( Results, @@ -5187,12 +5166,12 @@ class LibClang { late final _clang_codeCompleteGetContainerKindPtr = _lookup< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer, - ffi.Pointer)>>( + ffi.Pointer)>>( 'clang_codeCompleteGetContainerKind'); late final _clang_codeCompleteGetContainerKind = _clang_codeCompleteGetContainerKindPtr.asFunction< int Function(ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// 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 @@ -5254,7 +5233,7 @@ class LibClang { } late final _clang_toggleCrashRecoveryPtr = - _lookup>( + _lookup>( 'clang_toggleCrashRecovery'); late final _clang_toggleCrashRecovery = _clang_toggleCrashRecoveryPtr.asFunction(); @@ -5324,7 +5303,7 @@ class LibClang { } late final _clang_EvalResult_getAsIntPtr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsInt'); late final _clang_EvalResult_getAsInt = _clang_EvalResult_getAsIntPtr.asFunction(); @@ -5341,7 +5320,7 @@ class LibClang { } late final _clang_EvalResult_getAsLongLongPtr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsLongLong'); late final _clang_EvalResult_getAsLongLong = _clang_EvalResult_getAsLongLongPtr @@ -5358,7 +5337,7 @@ class LibClang { } late final _clang_EvalResult_isUnsignedIntPtr = - _lookup>( + _lookup>( 'clang_EvalResult_isUnsignedInt'); late final _clang_EvalResult_isUnsignedInt = _clang_EvalResult_isUnsignedIntPtr @@ -5374,9 +5353,9 @@ class LibClang { ); } - late final _clang_EvalResult_getAsUnsignedPtr = _lookup< - ffi.NativeFunction>( - 'clang_EvalResult_getAsUnsigned'); + late final _clang_EvalResult_getAsUnsignedPtr = + _lookup>( + 'clang_EvalResult_getAsUnsigned'); late final _clang_EvalResult_getAsUnsigned = _clang_EvalResult_getAsUnsignedPtr .asFunction(); @@ -5400,7 +5379,7 @@ class LibClang { /// 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 clang_EvalResult_getAsStr( CXEvalResult E, ) { return _clang_EvalResult_getAsStr( @@ -5408,11 +5387,11 @@ class LibClang { ); } - late final _clang_EvalResult_getAsStrPtr = _lookup< - ffi.NativeFunction Function(CXEvalResult)>>( - 'clang_EvalResult_getAsStr'); + late final _clang_EvalResult_getAsStrPtr = + _lookup Function(CXEvalResult)>>( + 'clang_EvalResult_getAsStr'); late final _clang_EvalResult_getAsStr = _clang_EvalResult_getAsStrPtr - .asFunction Function(CXEvalResult)>(); + .asFunction Function(CXEvalResult)>(); /// Disposes the created Eval memory. void clang_EvalResult_dispose( @@ -5431,22 +5410,22 @@ class LibClang { /// Retrieve a remapping. CXRemapping clang_getRemappings( - ffi.Pointer path, + ffi.Pointer path, ) { return _clang_getRemappings( path, ); } - late final _clang_getRemappingsPtr = _lookup< - ffi.NativeFunction)>>( - 'clang_getRemappings'); + late final _clang_getRemappingsPtr = + _lookup)>>( + 'clang_getRemappings'); late final _clang_getRemappings = _clang_getRemappingsPtr - .asFunction)>(); + .asFunction)>(); /// Retrieve a remapping. CXRemapping clang_getRemappingsFromFileList( - ffi.Pointer> filePaths, + ffi.Pointer> filePaths, int numFiles, ) { return _clang_getRemappingsFromFileList( @@ -5457,11 +5436,11 @@ class LibClang { late final _clang_getRemappingsFromFileListPtr = _lookup< ffi.NativeFunction< - CXRemapping Function(ffi.Pointer>, - pkg_ffi.UnsignedInt)>>('clang_getRemappingsFromFileList'); + CXRemapping Function(ffi.Pointer>, + ffi.UnsignedInt)>>('clang_getRemappingsFromFileList'); late final _clang_getRemappingsFromFileList = _clang_getRemappingsFromFileListPtr.asFunction< - CXRemapping Function(ffi.Pointer>, int)>(); + CXRemapping Function(ffi.Pointer>, int)>(); /// Determine the number of remappings. int clang_remap_getNumFiles( @@ -5473,7 +5452,7 @@ class LibClang { } late final _clang_remap_getNumFilesPtr = - _lookup>( + _lookup>( 'clang_remap_getNumFiles'); late final _clang_remap_getNumFiles = _clang_remap_getNumFilesPtr.asFunction(); @@ -5495,10 +5474,7 @@ class LibClang { late final _clang_remap_getFilenamesPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - CXRemapping, - pkg_ffi.UnsignedInt, - ffi.Pointer, + ffi.Void Function(CXRemapping, ffi.UnsignedInt, ffi.Pointer, ffi.Pointer)>>('clang_remap_getFilenames'); late final _clang_remap_getFilenames = _clang_remap_getFilenamesPtr.asFunction< @@ -5570,7 +5546,7 @@ class LibClang { } late final _clang_index_isEntityObjCContainerKindPtr = - _lookup>( + _lookup>( 'clang_index_isEntityObjCContainerKind'); late final _clang_index_isEntityObjCContainerKind = _clang_index_isEntityObjCContainerKindPtr.asFunction(); @@ -5813,8 +5789,8 @@ class LibClang { ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -5839,19 +5815,19 @@ class LibClang { late final _clang_indexSourceFilePtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( CXIndexAction, CXClientData, ffi.Pointer, - pkg_ffi.UnsignedInt, - pkg_ffi.UnsignedInt, - ffi.Pointer, - ffi.Pointer>, - pkg_ffi.Int, + ffi.UnsignedInt, + ffi.UnsignedInt, + ffi.Pointer, + ffi.Pointer>, + ffi.Int, ffi.Pointer, - pkg_ffi.UnsignedInt, + ffi.UnsignedInt, ffi.Pointer, - pkg_ffi.UnsignedInt)>>('clang_indexSourceFile'); + ffi.UnsignedInt)>>('clang_indexSourceFile'); late final _clang_indexSourceFile = _clang_indexSourceFilePtr.asFunction< int Function( CXIndexAction, @@ -5859,8 +5835,8 @@ class LibClang { ffi.Pointer, int, int, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>, int, ffi.Pointer, int, @@ -5876,8 +5852,8 @@ class LibClang { ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, @@ -5902,19 +5878,19 @@ class LibClang { late final _clang_indexSourceFileFullArgvPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( CXIndexAction, CXClientData, ffi.Pointer, - pkg_ffi.UnsignedInt, - pkg_ffi.UnsignedInt, - ffi.Pointer, - ffi.Pointer>, - pkg_ffi.Int, + ffi.UnsignedInt, + ffi.UnsignedInt, + ffi.Pointer, + ffi.Pointer>, + ffi.Int, ffi.Pointer, - pkg_ffi.UnsignedInt, + ffi.UnsignedInt, ffi.Pointer, - pkg_ffi.UnsignedInt)>>('clang_indexSourceFileFullArgv'); + ffi.UnsignedInt)>>('clang_indexSourceFileFullArgv'); late final _clang_indexSourceFileFullArgv = _clang_indexSourceFileFullArgvPtr.asFunction< int Function( @@ -5923,8 +5899,8 @@ class LibClang { ffi.Pointer, int, int, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>, int, ffi.Pointer, int, @@ -5953,12 +5929,12 @@ class LibClang { late final _clang_indexTranslationUnitPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( CXIndexAction, CXClientData, ffi.Pointer, - pkg_ffi.UnsignedInt, - pkg_ffi.UnsignedInt, + ffi.UnsignedInt, + ffi.UnsignedInt, CXTranslationUnit)>>('clang_indexTranslationUnit'); late final _clang_indexTranslationUnit = _clang_indexTranslationUnitPtr.asFunction< @@ -5971,9 +5947,9 @@ class LibClang { CXIdxLoc loc, ffi.Pointer indexFile, ffi.Pointer file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, ) { return _clang_indexLoc_getFileLocation( loc, @@ -5986,24 +5962,23 @@ class LibClang { } late final _clang_indexLoc_getFileLocationPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CXIdxLoc, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>( - 'clang_indexLoc_getFileLocation'); + ffi.NativeFunction< + ffi.Void Function( + CXIdxLoc, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_indexLoc_getFileLocation'); late final _clang_indexLoc_getFileLocation = _clang_indexLoc_getFileLocationPtr.asFunction< void Function( CXIdxLoc, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve the CXSourceLocation represented by the given CXIdxLoc. CXSourceLocation clang_indexLoc_getCXSourceLocation( @@ -6036,7 +6011,7 @@ class LibClang { late final _clang_Type_visitFieldsPtr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedInt Function( + ffi.UnsignedInt Function( CXType, CXFieldVisitor, CXClientData)>>('clang_Type_visitFields'); late final _clang_Type_visitFields = _clang_Type_visitFieldsPtr .asFunction(); @@ -6064,14 +6039,14 @@ abstract class CXErrorCode { class CXString extends ffi.Struct { external ffi.Pointer data; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int private_flags; } class CXStringSet extends ffi.Struct { external ffi.Pointer Strings; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int Count; } @@ -6093,13 +6068,13 @@ class CXTranslationUnitImpl extends ffi.Opaque {} /// 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; + external ffi.Pointer Filename; /// A buffer containing the unsaved contents of this file. - external ffi.Pointer Contents; + external ffi.Pointer Contents; /// The length of the unsaved contents of this buffer. - @pkg_ffi.UnsignedLong() + @ffi.UnsignedLong() external int Length; } @@ -6126,18 +6101,18 @@ abstract class CXAvailabilityKind { 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. - @pkg_ffi.Int() + @ffi.Int() 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'. - @pkg_ffi.Int() + @ffi.Int() 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'. - @pkg_ffi.Int() + @ffi.Int() external int Subminor; } @@ -6202,7 +6177,7 @@ typedef CXFile = ffi.Pointer; /// across an indexing session. class CXFileUniqueID extends ffi.Struct { @ffi.Array.multi([3]) - external ffi.Array data; + external ffi.Array data; } /// A single translation unit, which resides in an index. @@ -6213,7 +6188,7 @@ class CXSourceLocation extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int int_data; } @@ -6222,17 +6197,17 @@ class CXSourceRange extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int begin_int_data; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int end_int_data; } /// Identifies an array of ranges. class CXSourceRangeList extends ffi.Struct { /// The number of ranges in the ranges array. - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int count; /// An array of CXSourceRanges. @@ -6428,7 +6403,7 @@ class CXTUResourceUsageEntry extends ffi.Struct { @ffi.Int32() external int kind; - @pkg_ffi.UnsignedLong() + @ffi.UnsignedLong() external int amount; } @@ -6436,7 +6411,7 @@ class CXTUResourceUsageEntry extends ffi.Struct { class CXTUResourceUsage extends ffi.Struct { external ffi.Pointer data; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int numEntries; external ffi.Pointer entries; @@ -7103,7 +7078,7 @@ class CXCursor extends ffi.Struct { @ffi.Int32() external int kind; - @pkg_ffi.Int() + @ffi.Int() external int xdata; @ffi.Array.multi([3]) @@ -7165,7 +7140,7 @@ class CXPlatformAvailability extends ffi.Struct { external CXVersion Obsoleted; /// Whether the entity is unconditionally unavailable on this platform. - @pkg_ffi.Int() + @ffi.Int() external int Unavailable; /// An optional message to provide to a user of this API, e.g., to suggest @@ -7563,7 +7538,7 @@ abstract class CXTokenKind { /// Describes a single preprocessing token. class CXToken extends ffi.Struct { @ffi.Array.multi([4]) - external ffi.Array int_data; + external ffi.Array int_data; external ffi.Pointer ptr_data; } @@ -7661,7 +7636,7 @@ class CXCodeCompleteResults extends ffi.Struct { external ffi.Pointer Results; /// The number of code-completion results stored in the Results array. - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int NumResults; } @@ -7787,7 +7762,7 @@ abstract class CXCompletionContext { typedef CXInclusionVisitor = ffi.Pointer< ffi.NativeFunction< ffi.Void Function(CXFile, ffi.Pointer, - pkg_ffi.UnsignedInt, CXClientData)>>; + ffi.UnsignedInt, CXClientData)>>; abstract class CXEvalResultKind { static const int CXEval_Int = 1; @@ -7836,7 +7811,7 @@ class CXIdxLoc extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int int_data; } @@ -7846,19 +7821,19 @@ class CXIdxIncludedFileInfo extends ffi.Struct { external CXIdxLoc hashLoc; /// Filename as written in the #include/#import directive. - external ffi.Pointer filename; + external ffi.Pointer filename; /// The actual file that the #include/#import directive resolved to. external CXFile file; - @pkg_ffi.Int() + @ffi.Int() external int isImport; - @pkg_ffi.Int() + @ffi.Int() external int isAngled; /// Non-zero if the directive was automatically turned into a module import. - @pkg_ffi.Int() + @ffi.Int() external int isModuleImport; } @@ -7875,7 +7850,7 @@ class CXIdxImportedASTFileInfo extends ffi.Struct { /// Non-zero if an inclusion directive was automatically turned into a module /// import. Applicable only for modules. - @pkg_ffi.Int() + @ffi.Int() external int isImplicit; } @@ -7954,15 +7929,15 @@ class CXIdxEntityInfo extends ffi.Struct { @ffi.Int32() external int lang; - external ffi.Pointer name; + external ffi.Pointer name; - external ffi.Pointer USR; + external ffi.Pointer USR; external CXCursor cursor; external ffi.Pointer> attributes; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int numAttributes; } @@ -7997,28 +7972,28 @@ class CXIdxDeclInfo extends ffi.Struct { /// out-of-line C++ member functions. external ffi.Pointer lexicalContainer; - @pkg_ffi.Int() + @ffi.Int() external int isRedeclaration; - @pkg_ffi.Int() + @ffi.Int() external int isDefinition; - @pkg_ffi.Int() + @ffi.Int() 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. - @pkg_ffi.Int() + @ffi.Int() external int isImplicit; external ffi.Pointer> attributes; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int numAttributes; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int flags; } @@ -8054,7 +8029,7 @@ class CXIdxObjCProtocolRefInfo extends ffi.Struct { class CXIdxObjCProtocolRefListInfo extends ffi.Struct { external ffi.Pointer> protocols; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int numProtocols; } @@ -8091,7 +8066,7 @@ class CXIdxCXXClassDeclInfo extends ffi.Struct { external ffi.Pointer> bases; - @pkg_ffi.UnsignedInt() + @ffi.UnsignedInt() external int numBases; } @@ -8149,9 +8124,8 @@ 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< - ffi.NativeFunction< - pkg_ffi.Int Function(CXClientData, ffi.Pointer)>> - abortQuery; + ffi.NativeFunction< + ffi.Int Function(CXClientData, ffi.Pointer)>> abortQuery; /// Called at the end of indexing; passes the complete diagnostic set. external ffi.Pointer< diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index 6e13fec5c4..fb4724dda6 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -4,7 +4,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; /// Bindings to SQLite. class SQLite { @@ -51,59 +50,59 @@ class SQLite { /// of the hash might be different from [SQLITE_SOURCE_ID].)^ /// /// See also: [sqlite_version()] and [sqlite_source_id()]. - late final ffi.Pointer> _sqlite3_version = - _lookup>('sqlite3_version'); + late final ffi.Pointer> _sqlite3_version = + _lookup>('sqlite3_version'); - ffi.Pointer get sqlite3_version => _sqlite3_version.value; + ffi.Pointer get sqlite3_version => _sqlite3_version.value; - set sqlite3_version(ffi.Pointer value) => + set sqlite3_version(ffi.Pointer value) => _sqlite3_version.value = value; - ffi.Pointer sqlite3_libversion() { + ffi.Pointer sqlite3_libversion() { return _sqlite3_libversion(); } late final _sqlite3_libversionPtr = - _lookup Function()>>( + _lookup Function()>>( 'sqlite3_libversion'); late final _sqlite3_libversion = - _sqlite3_libversionPtr.asFunction Function()>(); + _sqlite3_libversionPtr.asFunction Function()>(); - ffi.Pointer sqlite3_sourceid() { + ffi.Pointer sqlite3_sourceid() { return _sqlite3_sourceid(); } late final _sqlite3_sourceidPtr = - _lookup Function()>>( + _lookup Function()>>( 'sqlite3_sourceid'); late final _sqlite3_sourceid = - _sqlite3_sourceidPtr.asFunction Function()>(); + _sqlite3_sourceidPtr.asFunction Function()>(); int sqlite3_libversion_number() { return _sqlite3_libversion_number(); } late final _sqlite3_libversion_numberPtr = - _lookup>( + _lookup>( 'sqlite3_libversion_number'); late final _sqlite3_libversion_number = _sqlite3_libversion_numberPtr.asFunction(); int sqlite3_compileoption_used( - ffi.Pointer zOptName, + ffi.Pointer zOptName, ) { return _sqlite3_compileoption_used( zOptName, ); } - late final _sqlite3_compileoption_usedPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_compileoption_used'); + late final _sqlite3_compileoption_usedPtr = + _lookup)>>( + 'sqlite3_compileoption_used'); late final _sqlite3_compileoption_used = _sqlite3_compileoption_usedPtr - .asFunction)>(); + .asFunction)>(); - ffi.Pointer sqlite3_compileoption_get( + ffi.Pointer sqlite3_compileoption_get( int N, ) { return _sqlite3_compileoption_get( @@ -111,11 +110,11 @@ class SQLite { ); } - late final _sqlite3_compileoption_getPtr = _lookup< - ffi.NativeFunction Function(pkg_ffi.Int)>>( - 'sqlite3_compileoption_get'); + late final _sqlite3_compileoption_getPtr = + _lookup Function(ffi.Int)>>( + 'sqlite3_compileoption_get'); late final _sqlite3_compileoption_get = _sqlite3_compileoption_getPtr - .asFunction Function(int)>(); + .asFunction Function(int)>(); /// CAPI3REF: Test To See If The Library Is Threadsafe /// @@ -156,7 +155,7 @@ class SQLite { } late final _sqlite3_threadsafePtr = - _lookup>('sqlite3_threadsafe'); + _lookup>('sqlite3_threadsafe'); late final _sqlite3_threadsafe = _sqlite3_threadsafePtr.asFunction(); @@ -205,7 +204,7 @@ class SQLite { } late final _sqlite3_closePtr = - _lookup)>>( + _lookup)>>( 'sqlite3_close'); late final _sqlite3_close = _sqlite3_closePtr.asFunction)>(); @@ -219,7 +218,7 @@ class SQLite { } late final _sqlite3_close_v2Ptr = - _lookup)>>( + _lookup)>>( 'sqlite3_close_v2'); late final _sqlite3_close_v2 = _sqlite3_close_v2Ptr.asFunction)>(); @@ -286,17 +285,17 @@ class SQLite { /// int sqlite3_exec( ffi.Pointer arg0, - ffi.Pointer sql, + ffi.Pointer sql, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer>, - ffi.Pointer>)>> + ffi.Int, + ffi.Pointer>, + ffi.Pointer>)>> callback, ffi.Pointer arg3, - ffi.Pointer> errmsg, + ffi.Pointer> errmsg, ) { return _sqlite3_exec( arg0, @@ -309,31 +308,31 @@ class SQLite { late final _sqlite3_execPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer>, - ffi.Pointer>)>>, + ffi.Int, + ffi.Pointer>, + ffi.Pointer>)>>, ffi.Pointer, - ffi.Pointer>)>>('sqlite3_exec'); + ffi.Pointer>)>>('sqlite3_exec'); late final _sqlite3_exec = _sqlite3_execPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer>, - ffi.Pointer>)>>, + ffi.Int, + ffi.Pointer>, + ffi.Pointer>)>>, ffi.Pointer, - ffi.Pointer>)>(); + ffi.Pointer>)>(); /// CAPI3REF: Initialize The SQLite Library /// @@ -413,7 +412,7 @@ class SQLite { } late final _sqlite3_initializePtr = - _lookup>('sqlite3_initialize'); + _lookup>('sqlite3_initialize'); late final _sqlite3_initialize = _sqlite3_initializePtr.asFunction(); @@ -422,7 +421,7 @@ class SQLite { } late final _sqlite3_shutdownPtr = - _lookup>('sqlite3_shutdown'); + _lookup>('sqlite3_shutdown'); late final _sqlite3_shutdown = _sqlite3_shutdownPtr.asFunction(); @@ -431,7 +430,7 @@ class SQLite { } late final _sqlite3_os_initPtr = - _lookup>('sqlite3_os_init'); + _lookup>('sqlite3_os_init'); late final _sqlite3_os_init = _sqlite3_os_initPtr.asFunction(); @@ -440,7 +439,7 @@ class SQLite { } late final _sqlite3_os_endPtr = - _lookup>('sqlite3_os_end'); + _lookup>('sqlite3_os_end'); late final _sqlite3_os_end = _sqlite3_os_endPtr.asFunction(); /// CAPI3REF: Configuring The SQLite Library @@ -481,8 +480,7 @@ class SQLite { } late final _sqlite3_configPtr = - _lookup>( - 'sqlite3_config'); + _lookup>('sqlite3_config'); late final _sqlite3_config = _sqlite3_configPtr.asFunction(); @@ -512,9 +510,8 @@ class SQLite { } late final _sqlite3_db_configPtr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, pkg_ffi.Int)>>('sqlite3_db_config'); + ffi.NativeFunction, ffi.Int)>>( + 'sqlite3_db_config'); late final _sqlite3_db_config = _sqlite3_db_configPtr .asFunction, int)>(); @@ -535,9 +532,8 @@ class SQLite { } late final _sqlite3_extended_result_codesPtr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_extended_result_codes'); + ffi.NativeFunction, ffi.Int)>>( + 'sqlite3_extended_result_codes'); late final _sqlite3_extended_result_codes = _sqlite3_extended_result_codesPtr .asFunction, int)>(); @@ -699,7 +695,7 @@ class SQLite { } late final _sqlite3_changesPtr = - _lookup)>>( + _lookup)>>( 'sqlite3_changes'); late final _sqlite3_changes = _sqlite3_changesPtr.asFunction)>(); @@ -746,7 +742,7 @@ class SQLite { } late final _sqlite3_total_changesPtr = - _lookup)>>( + _lookup)>>( 'sqlite3_total_changes'); late final _sqlite3_total_changes = _sqlite3_total_changesPtr .asFunction)>(); @@ -830,18 +826,18 @@ class SQLite { /// The input to [sqlite3_complete16()] must be a zero-terminated /// UTF-16 string in native byte order. int sqlite3_complete( - ffi.Pointer sql, + ffi.Pointer sql, ) { return _sqlite3_complete( sql, ); } - late final _sqlite3_completePtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_complete'); - late final _sqlite3_complete = _sqlite3_completePtr - .asFunction)>(); + late final _sqlite3_completePtr = + _lookup)>>( + 'sqlite3_complete'); + late final _sqlite3_complete = + _sqlite3_completePtr.asFunction)>(); int sqlite3_complete16( ffi.Pointer sql, @@ -852,7 +848,7 @@ class SQLite { } late final _sqlite3_complete16Ptr = - _lookup)>>( + _lookup)>>( 'sqlite3_complete16'); late final _sqlite3_complete16 = _sqlite3_complete16Ptr.asFunction)>(); @@ -918,7 +914,7 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int)>> + ffi.Int Function(ffi.Pointer, ffi.Int)>> arg1, ffi.Pointer arg2, ) { @@ -931,19 +927,18 @@ class SQLite { late final _sqlite3_busy_handlerPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, pkg_ffi.Int)>>, + ffi.Int Function(ffi.Pointer, ffi.Int)>>, ffi.Pointer)>>('sqlite3_busy_handler'); late final _sqlite3_busy_handler = _sqlite3_busy_handlerPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int)>>, + ffi.Int Function(ffi.Pointer, ffi.Int)>>, ffi.Pointer)>(); /// CAPI3REF: Set A Busy Timeout @@ -976,9 +971,8 @@ class SQLite { } late final _sqlite3_busy_timeoutPtr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, pkg_ffi.Int)>>('sqlite3_busy_timeout'); + ffi.NativeFunction, ffi.Int)>>( + 'sqlite3_busy_timeout'); late final _sqlite3_busy_timeout = _sqlite3_busy_timeoutPtr .asFunction, int)>(); @@ -1055,11 +1049,11 @@ class SQLite { /// [sqlite3_errmsg()]. int sqlite3_get_table( ffi.Pointer db, - ffi.Pointer zSql, - ffi.Pointer>> pazResult, - ffi.Pointer pnRow, - ffi.Pointer pnColumn, - ffi.Pointer> pzErrmsg, + ffi.Pointer zSql, + ffi.Pointer>> pazResult, + ffi.Pointer pnRow, + ffi.Pointer pnColumn, + ffi.Pointer> pzErrmsg, ) { return _sqlite3_get_table( db, @@ -1073,24 +1067,24 @@ class SQLite { late final _sqlite3_get_tablePtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer>>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('sqlite3_get_table'); + ffi.Pointer, + ffi.Pointer>>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('sqlite3_get_table'); late final _sqlite3_get_table = _sqlite3_get_tablePtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer>>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); + ffi.Pointer, + ffi.Pointer>>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); void sqlite3_free_table( - ffi.Pointer> result, + ffi.Pointer> result, ) { return _sqlite3_free_table( result, @@ -1100,9 +1094,9 @@ class SQLite { late final _sqlite3_free_tablePtr = _lookup< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer>)>>('sqlite3_free_table'); + ffi.Pointer>)>>('sqlite3_free_table'); late final _sqlite3_free_table = _sqlite3_free_tablePtr - .asFunction>)>(); + .asFunction>)>(); /// CAPI3REF: Formatted String Printing Functions /// @@ -1142,8 +1136,8 @@ class SQLite { /// ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf(). /// /// See also: [built-in printf()], [printf() SQL function] - ffi.Pointer sqlite3_mprintf( - ffi.Pointer arg0, + ffi.Pointer sqlite3_mprintf( + ffi.Pointer arg0, ) { return _sqlite3_mprintf( arg0, @@ -1152,15 +1146,15 @@ class SQLite { late final _sqlite3_mprintfPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sqlite3_mprintf'); - late final _sqlite3_mprintf = _sqlite3_mprintfPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_mprintf'); + late final _sqlite3_mprintf = _sqlite3_mprintfPtr + .asFunction Function(ffi.Pointer)>(); - ffi.Pointer sqlite3_snprintf( + ffi.Pointer sqlite3_snprintf( int arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ) { return _sqlite3_snprintf( arg0, @@ -1171,13 +1165,11 @@ class SQLite { late final _sqlite3_snprintfPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - pkg_ffi.Int, - ffi.Pointer, - ffi.Pointer)>>('sqlite3_snprintf'); + ffi.Pointer Function(ffi.Int, ffi.Pointer, + ffi.Pointer)>>('sqlite3_snprintf'); late final _sqlite3_snprintf = _sqlite3_snprintfPtr.asFunction< - ffi.Pointer Function( - int, ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + int, ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Memory Allocation Subsystem /// @@ -1261,7 +1253,7 @@ class SQLite { } late final _sqlite3_mallocPtr = - _lookup Function(pkg_ffi.Int)>>( + _lookup Function(ffi.Int)>>( 'sqlite3_malloc'); late final _sqlite3_malloc = _sqlite3_mallocPtr.asFunction Function(int)>(); @@ -1293,7 +1285,7 @@ class SQLite { late final _sqlite3_reallocPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, pkg_ffi.Int)>>('sqlite3_realloc'); + ffi.Pointer, ffi.Int)>>('sqlite3_realloc'); late final _sqlite3_realloc = _sqlite3_reallocPtr .asFunction Function(ffi.Pointer, int)>(); @@ -1382,7 +1374,7 @@ class SQLite { } late final _sqlite3_memory_highwaterPtr = - _lookup>( + _lookup>( 'sqlite3_memory_highwater'); late final _sqlite3_memory_highwater = _sqlite3_memory_highwaterPtr.asFunction(); @@ -1419,7 +1411,7 @@ class SQLite { late final _sqlite3_randomnessPtr = _lookup< ffi.NativeFunction< ffi.Void Function( - pkg_ffi.Int, ffi.Pointer)>>('sqlite3_randomness'); + ffi.Int, ffi.Pointer)>>('sqlite3_randomness'); late final _sqlite3_randomness = _sqlite3_randomnessPtr .asFunction)>(); @@ -1514,13 +1506,13 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>> + ffi.Int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>> xAuth, ffi.Pointer pUserData, ) { @@ -1533,30 +1525,30 @@ class SQLite { late final _sqlite3_set_authorizerPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>, + ffi.Int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>, ffi.Pointer)>>('sqlite3_set_authorizer'); late final _sqlite3_set_authorizer = _sqlite3_set_authorizerPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>, + ffi.Int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>, ffi.Pointer)>(); /// CAPI3REF: Tracing And Profiling Functions @@ -1594,7 +1586,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, ffi.Pointer)>> + ffi.Pointer, ffi.Pointer)>> xTrace, ffi.Pointer arg2, ) { @@ -1612,7 +1604,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer, ffi.Pointer)>>, ffi.Pointer)>>('sqlite3_trace'); late final _sqlite3_trace = _sqlite3_tracePtr.asFunction< ffi.Pointer Function( @@ -1620,15 +1612,15 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer, ffi.Pointer)>>, ffi.Pointer)>(); ffi.Pointer sqlite3_profile( ffi.Pointer arg0, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, sqlite3_uint64)>> + ffi.Void Function(ffi.Pointer, ffi.Pointer, + sqlite3_uint64)>> xProfile, ffi.Pointer arg2, ) { @@ -1646,7 +1638,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - ffi.Pointer, sqlite3_uint64)>>, + ffi.Pointer, sqlite3_uint64)>>, ffi.Pointer)>>('sqlite3_profile'); late final _sqlite3_profile = _sqlite3_profilePtr.asFunction< ffi.Pointer Function( @@ -1654,7 +1646,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - ffi.Pointer, sqlite3_uint64)>>, + ffi.Pointer, sqlite3_uint64)>>, ffi.Pointer)>(); /// CAPI3REF: SQL Trace Hook @@ -1689,7 +1681,7 @@ class SQLite { int uMask, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function(pkg_ffi.UnsignedInt, ffi.Pointer, + ffi.Int Function(ffi.UnsignedInt, ffi.Pointer, ffi.Pointer, ffi.Pointer)>> xCallback, ffi.Pointer pCtx, @@ -1704,16 +1696,13 @@ class SQLite { late final _sqlite3_trace_v2Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.UnsignedInt, + ffi.UnsignedInt, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( - pkg_ffi.UnsignedInt, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>, + ffi.Int Function(ffi.UnsignedInt, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, ffi.Pointer)>>('sqlite3_trace_v2'); late final _sqlite3_trace_v2 = _sqlite3_trace_v2Ptr.asFunction< int Function( @@ -1721,11 +1710,8 @@ class SQLite { int, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( - pkg_ffi.UnsignedInt, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>, + ffi.Int Function(ffi.UnsignedInt, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, ffi.Pointer)>(); /// CAPI3REF: Query Progress Callbacks @@ -1760,7 +1746,7 @@ class SQLite { void sqlite3_progress_handler( ffi.Pointer arg0, int arg1, - ffi.Pointer)>> + ffi.Pointer)>> arg2, ffi.Pointer arg3, ) { @@ -1776,10 +1762,9 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer< - ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer)>>, + ffi.NativeFunction)>>, ffi.Pointer)>>('sqlite3_progress_handler'); late final _sqlite3_progress_handler = _sqlite3_progress_handlerPtr.asFunction< @@ -1787,8 +1772,7 @@ class SQLite { ffi.Pointer, int, ffi.Pointer< - ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer)>>, + ffi.NativeFunction)>>, ffi.Pointer)>(); /// CAPI3REF: Opening A New Database Connection @@ -2043,7 +2027,7 @@ class SQLite { /// /// See also: [sqlite3_temp_directory] int sqlite3_open( - ffi.Pointer filename, + ffi.Pointer filename, ffi.Pointer> ppDb, ) { return _sqlite3_open( @@ -2054,11 +2038,10 @@ class SQLite { late final _sqlite3_openPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, + ffi.Int Function(ffi.Pointer, ffi.Pointer>)>>('sqlite3_open'); late final _sqlite3_open = _sqlite3_openPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer>)>(); + int Function(ffi.Pointer, ffi.Pointer>)>(); int sqlite3_open16( ffi.Pointer filename, @@ -2072,16 +2055,16 @@ class SQLite { late final _sqlite3_open16Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, + ffi.Int Function(ffi.Pointer, ffi.Pointer>)>>('sqlite3_open16'); late final _sqlite3_open16 = _sqlite3_open16Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer>)>(); int sqlite3_open_v2( - ffi.Pointer filename, + ffi.Pointer filename, ffi.Pointer> ppDb, int flags, - ffi.Pointer zVfs, + ffi.Pointer zVfs, ) { return _sqlite3_open_v2( filename, @@ -2093,14 +2076,14 @@ class SQLite { late final _sqlite3_open_v2Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, + ffi.Int Function( + ffi.Pointer, ffi.Pointer>, - pkg_ffi.Int, - ffi.Pointer)>>('sqlite3_open_v2'); + ffi.Int, + ffi.Pointer)>>('sqlite3_open_v2'); late final _sqlite3_open_v2 = _sqlite3_open_v2Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer>, - int, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer>, + int, ffi.Pointer)>(); /// CAPI3REF: Obtain Values For URI Parameters /// @@ -2166,9 +2149,9 @@ class SQLite { /// main database file. /// /// See the [URI filename] documentation for additional information. - ffi.Pointer sqlite3_uri_parameter( - ffi.Pointer zFilename, - ffi.Pointer zParam, + ffi.Pointer sqlite3_uri_parameter( + ffi.Pointer zFilename, + ffi.Pointer zParam, ) { return _sqlite3_uri_parameter( zFilename, @@ -2178,15 +2161,15 @@ class SQLite { late final _sqlite3_uri_parameterPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_uri_parameter'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_uri_parameter'); late final _sqlite3_uri_parameter = _sqlite3_uri_parameterPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); int sqlite3_uri_boolean( - ffi.Pointer zFile, - ffi.Pointer zParam, + ffi.Pointer zFile, + ffi.Pointer zParam, int bDefault, ) { return _sqlite3_uri_boolean( @@ -2198,15 +2181,14 @@ class SQLite { late final _sqlite3_uri_booleanPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Int)>>('sqlite3_uri_boolean'); + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int)>>('sqlite3_uri_boolean'); late final _sqlite3_uri_boolean = _sqlite3_uri_booleanPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); int sqlite3_uri_int64( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, int arg2, ) { return _sqlite3_uri_int64( @@ -2218,14 +2200,13 @@ class SQLite { late final _sqlite3_uri_int64Ptr = _lookup< ffi.NativeFunction< - sqlite3_int64 Function(ffi.Pointer, - ffi.Pointer, sqlite3_int64)>>('sqlite3_uri_int64'); + sqlite3_int64 Function(ffi.Pointer, ffi.Pointer, + sqlite3_int64)>>('sqlite3_uri_int64'); late final _sqlite3_uri_int64 = _sqlite3_uri_int64Ptr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); - ffi.Pointer sqlite3_uri_key( - ffi.Pointer zFilename, + ffi.Pointer sqlite3_uri_key( + ffi.Pointer zFilename, int N, ) { return _sqlite3_uri_key( @@ -2236,10 +2217,10 @@ class SQLite { late final _sqlite3_uri_keyPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, pkg_ffi.Int)>>('sqlite3_uri_key'); - late final _sqlite3_uri_key = _sqlite3_uri_keyPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Int)>>('sqlite3_uri_key'); + late final _sqlite3_uri_key = _sqlite3_uri_keyPtr + .asFunction Function(ffi.Pointer, int)>(); /// CAPI3REF: Translate filenames /// @@ -2266,8 +2247,8 @@ class SQLite { /// filename passed into the VFS from the SQLite core and F is not the /// return value from [sqlite3_db_filename()], then the result is /// undefined and is likely a memory access violation. - ffi.Pointer sqlite3_filename_database( - ffi.Pointer arg0, + ffi.Pointer sqlite3_filename_database( + ffi.Pointer arg0, ) { return _sqlite3_filename_database( arg0, @@ -2276,14 +2257,13 @@ class SQLite { late final _sqlite3_filename_databasePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sqlite3_filename_database'); - late final _sqlite3_filename_database = - _sqlite3_filename_databasePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_filename_database'); + late final _sqlite3_filename_database = _sqlite3_filename_databasePtr + .asFunction Function(ffi.Pointer)>(); - ffi.Pointer sqlite3_filename_journal( - ffi.Pointer arg0, + ffi.Pointer sqlite3_filename_journal( + ffi.Pointer arg0, ) { return _sqlite3_filename_journal( arg0, @@ -2292,14 +2272,13 @@ class SQLite { late final _sqlite3_filename_journalPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sqlite3_filename_journal'); - late final _sqlite3_filename_journal = - _sqlite3_filename_journalPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_filename_journal'); + late final _sqlite3_filename_journal = _sqlite3_filename_journalPtr + .asFunction Function(ffi.Pointer)>(); - ffi.Pointer sqlite3_filename_wal( - ffi.Pointer arg0, + ffi.Pointer sqlite3_filename_wal( + ffi.Pointer arg0, ) { return _sqlite3_filename_wal( arg0, @@ -2308,10 +2287,10 @@ class SQLite { late final _sqlite3_filename_walPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sqlite3_filename_wal'); - late final _sqlite3_filename_wal = _sqlite3_filename_walPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_filename_wal'); + late final _sqlite3_filename_wal = _sqlite3_filename_walPtr + .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Database File Corresponding To A Journal /// @@ -2329,7 +2308,7 @@ class SQLite { /// of this routine results in undefined and probably undesirable /// behavior. ffi.Pointer sqlite3_database_file_object( - ffi.Pointer arg0, + ffi.Pointer arg0, ) { return _sqlite3_database_file_object( arg0, @@ -2339,10 +2318,9 @@ class SQLite { late final _sqlite3_database_file_objectPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer)>>('sqlite3_database_file_object'); - late final _sqlite3_database_file_object = - _sqlite3_database_file_objectPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + ffi.Pointer)>>('sqlite3_database_file_object'); + late final _sqlite3_database_file_object = _sqlite3_database_file_objectPtr + .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Create and Destroy VFS Filenames /// @@ -2387,12 +2365,12 @@ class SQLite { /// that if the [sqlite3_vfs.xOpen()] method of a VFS has been called using Y, /// then the corresponding [sqlite3_module.xClose() method should also be /// invoked prior to calling sqlite3_free_filename(Y). - ffi.Pointer sqlite3_create_filename( - ffi.Pointer zDatabase, - ffi.Pointer zJournal, - ffi.Pointer zWal, + ffi.Pointer sqlite3_create_filename( + ffi.Pointer zDatabase, + ffi.Pointer zJournal, + ffi.Pointer zWal, int nParam, - ffi.Pointer> azParam, + ffi.Pointer> azParam, ) { return _sqlite3_create_filename( zDatabase, @@ -2404,24 +2382,23 @@ class SQLite { } late final _sqlite3_create_filenamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer>)>>( - 'sqlite3_create_filename'); + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int, + ffi.Pointer>)>>('sqlite3_create_filename'); late final _sqlite3_create_filename = _sqlite3_create_filenamePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, int, - ffi.Pointer>)>(); + ffi.Pointer>)>(); void sqlite3_free_filename( - ffi.Pointer arg0, + ffi.Pointer arg0, ) { return _sqlite3_free_filename( arg0, @@ -2429,10 +2406,10 @@ class SQLite { } late final _sqlite3_free_filenamePtr = - _lookup)>>( + _lookup)>>( 'sqlite3_free_filename'); late final _sqlite3_free_filename = _sqlite3_free_filenamePtr - .asFunction)>(); + .asFunction)>(); /// CAPI3REF: Error Codes And Messages /// METHOD: sqlite3 @@ -2493,7 +2470,7 @@ class SQLite { } late final _sqlite3_errcodePtr = - _lookup)>>( + _lookup)>>( 'sqlite3_errcode'); late final _sqlite3_errcode = _sqlite3_errcodePtr.asFunction)>(); @@ -2507,12 +2484,12 @@ class SQLite { } late final _sqlite3_extended_errcodePtr = - _lookup)>>( + _lookup)>>( 'sqlite3_extended_errcode'); late final _sqlite3_extended_errcode = _sqlite3_extended_errcodePtr .asFunction)>(); - ffi.Pointer sqlite3_errmsg( + ffi.Pointer sqlite3_errmsg( ffi.Pointer arg0, ) { return _sqlite3_errmsg( @@ -2522,10 +2499,10 @@ class SQLite { late final _sqlite3_errmsgPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('sqlite3_errmsg'); late final _sqlite3_errmsg = _sqlite3_errmsgPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_errmsg16( ffi.Pointer arg0, @@ -2542,7 +2519,7 @@ class SQLite { late final _sqlite3_errmsg16 = _sqlite3_errmsg16Ptr .asFunction Function(ffi.Pointer)>(); - ffi.Pointer sqlite3_errstr( + ffi.Pointer sqlite3_errstr( int arg0, ) { return _sqlite3_errstr( @@ -2550,11 +2527,11 @@ class SQLite { ); } - late final _sqlite3_errstrPtr = _lookup< - ffi.NativeFunction Function(pkg_ffi.Int)>>( - 'sqlite3_errstr'); + late final _sqlite3_errstrPtr = + _lookup Function(ffi.Int)>>( + 'sqlite3_errstr'); late final _sqlite3_errstr = - _sqlite3_errstrPtr.asFunction Function(int)>(); + _sqlite3_errstrPtr.asFunction Function(int)>(); /// CAPI3REF: Run-time Limits /// METHOD: sqlite3 @@ -2608,8 +2585,8 @@ class SQLite { late final _sqlite3_limitPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, - pkg_ffi.Int)>>('sqlite3_limit'); + ffi.Int Function( + ffi.Pointer, ffi.Int, ffi.Int)>>('sqlite3_limit'); late final _sqlite3_limit = _sqlite3_limitPtr .asFunction, int, int)>(); @@ -2713,10 +2690,10 @@ class SQLite { /// sqlite3_prepare_v3() with a zero prepFlags parameter. int sqlite3_prepare( ffi.Pointer db, - ffi.Pointer zSql, + ffi.Pointer zSql, int nByte, ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, + ffi.Pointer> pzTail, ) { return _sqlite3_prepare( db, @@ -2729,26 +2706,26 @@ class SQLite { late final _sqlite3_preparePtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - ffi.Pointer, - pkg_ffi.Int, + ffi.Pointer, + ffi.Int, ffi.Pointer>, - ffi.Pointer>)>>('sqlite3_prepare'); + ffi.Pointer>)>>('sqlite3_prepare'); late final _sqlite3_prepare = _sqlite3_preparePtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, ffi.Pointer>, - ffi.Pointer>)>(); + ffi.Pointer>)>(); int sqlite3_prepare_v2( ffi.Pointer db, - ffi.Pointer zSql, + ffi.Pointer zSql, int nByte, ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, + ffi.Pointer> pzTail, ) { return _sqlite3_prepare_v2( db, @@ -2761,27 +2738,27 @@ class SQLite { late final _sqlite3_prepare_v2Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - ffi.Pointer, - pkg_ffi.Int, + ffi.Pointer, + ffi.Int, ffi.Pointer>, - ffi.Pointer>)>>('sqlite3_prepare_v2'); + ffi.Pointer>)>>('sqlite3_prepare_v2'); late final _sqlite3_prepare_v2 = _sqlite3_prepare_v2Ptr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, ffi.Pointer>, - ffi.Pointer>)>(); + ffi.Pointer>)>(); int sqlite3_prepare_v3( ffi.Pointer db, - ffi.Pointer zSql, + ffi.Pointer zSql, int nByte, int prepFlags, ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, + ffi.Pointer> pzTail, ) { return _sqlite3_prepare_v3( db, @@ -2795,21 +2772,21 @@ class SQLite { late final _sqlite3_prepare_v3Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - ffi.Pointer, - pkg_ffi.Int, - pkg_ffi.UnsignedInt, + ffi.Pointer, + ffi.Int, + ffi.UnsignedInt, ffi.Pointer>, - ffi.Pointer>)>>('sqlite3_prepare_v3'); + ffi.Pointer>)>>('sqlite3_prepare_v3'); late final _sqlite3_prepare_v3 = _sqlite3_prepare_v3Ptr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer>, - ffi.Pointer>)>(); + ffi.Pointer>)>(); int sqlite3_prepare16( ffi.Pointer db, @@ -2829,10 +2806,10 @@ class SQLite { late final _sqlite3_prepare16Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer>, ffi.Pointer>)>>('sqlite3_prepare16'); late final _sqlite3_prepare16 = _sqlite3_prepare16Ptr.asFunction< @@ -2861,10 +2838,10 @@ class SQLite { late final _sqlite3_prepare16_v2Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer>, ffi.Pointer>)>>('sqlite3_prepare16_v2'); late final _sqlite3_prepare16_v2 = _sqlite3_prepare16_v2Ptr.asFunction< @@ -2895,11 +2872,11 @@ class SQLite { late final _sqlite3_prepare16_v3Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, - pkg_ffi.UnsignedInt, + ffi.Int, + ffi.UnsignedInt, ffi.Pointer>, ffi.Pointer>)>>('sqlite3_prepare16_v3'); late final _sqlite3_prepare16_v3 = _sqlite3_prepare16_v3Ptr.asFunction< @@ -2947,7 +2924,7 @@ class SQLite { /// ^The string returned by sqlite3_expanded_sql(P), on the other hand, /// is obtained from [sqlite3_malloc()] and must be free by the application /// by passing it to [sqlite3_free()]. - ffi.Pointer sqlite3_sql( + ffi.Pointer sqlite3_sql( ffi.Pointer pStmt, ) { return _sqlite3_sql( @@ -2957,12 +2934,12 @@ class SQLite { late final _sqlite3_sqlPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('sqlite3_sql'); - late final _sqlite3_sql = _sqlite3_sqlPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + late final _sqlite3_sql = _sqlite3_sqlPtr + .asFunction Function(ffi.Pointer)>(); - ffi.Pointer sqlite3_expanded_sql( + ffi.Pointer sqlite3_expanded_sql( ffi.Pointer pStmt, ) { return _sqlite3_expanded_sql( @@ -2972,12 +2949,12 @@ class SQLite { late final _sqlite3_expanded_sqlPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('sqlite3_expanded_sql'); - late final _sqlite3_expanded_sql = _sqlite3_expanded_sqlPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + late final _sqlite3_expanded_sql = _sqlite3_expanded_sqlPtr + .asFunction Function(ffi.Pointer)>(); - ffi.Pointer sqlite3_normalized_sql( + ffi.Pointer sqlite3_normalized_sql( ffi.Pointer pStmt, ) { return _sqlite3_normalized_sql( @@ -2987,10 +2964,10 @@ class SQLite { late final _sqlite3_normalized_sqlPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('sqlite3_normalized_sql'); - late final _sqlite3_normalized_sql = _sqlite3_normalized_sqlPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + late final _sqlite3_normalized_sql = _sqlite3_normalized_sqlPtr + .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Determine If An SQL Statement Writes The Database /// METHOD: sqlite3_stmt @@ -3032,9 +3009,9 @@ class SQLite { ); } - late final _sqlite3_stmt_readonlyPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_stmt_readonly'); + late final _sqlite3_stmt_readonlyPtr = + _lookup)>>( + 'sqlite3_stmt_readonly'); late final _sqlite3_stmt_readonly = _sqlite3_stmt_readonlyPtr .asFunction)>(); @@ -3054,9 +3031,9 @@ class SQLite { ); } - late final _sqlite3_stmt_isexplainPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_stmt_isexplain'); + late final _sqlite3_stmt_isexplainPtr = + _lookup)>>( + 'sqlite3_stmt_isexplain'); late final _sqlite3_stmt_isexplain = _sqlite3_stmt_isexplainPtr .asFunction)>(); @@ -3085,9 +3062,9 @@ class SQLite { ); } - late final _sqlite3_stmt_busyPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_stmt_busy'); + late final _sqlite3_stmt_busyPtr = + _lookup)>>( + 'sqlite3_stmt_busy'); late final _sqlite3_stmt_busy = _sqlite3_stmt_busyPtr .asFunction)>(); @@ -3244,11 +3221,11 @@ class SQLite { late final _sqlite3_bind_blobPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -3281,9 +3258,9 @@ class SQLite { late final _sqlite3_bind_blob64Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer, sqlite3_uint64, ffi.Pointer< @@ -3313,7 +3290,7 @@ class SQLite { late final _sqlite3_bind_doublePtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, + ffi.Int Function(ffi.Pointer, ffi.Int, ffi.Double)>>('sqlite3_bind_double'); late final _sqlite3_bind_double = _sqlite3_bind_doublePtr .asFunction, int, double)>(); @@ -3332,8 +3309,8 @@ class SQLite { late final _sqlite3_bind_intPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, - pkg_ffi.Int)>>('sqlite3_bind_int'); + ffi.Int Function(ffi.Pointer, ffi.Int, + ffi.Int)>>('sqlite3_bind_int'); late final _sqlite3_bind_int = _sqlite3_bind_intPtr .asFunction, int, int)>(); @@ -3351,7 +3328,7 @@ class SQLite { late final _sqlite3_bind_int64Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, + ffi.Int Function(ffi.Pointer, ffi.Int, sqlite3_int64)>>('sqlite3_bind_int64'); late final _sqlite3_bind_int64 = _sqlite3_bind_int64Ptr .asFunction, int, int)>(); @@ -3368,15 +3345,15 @@ class SQLite { late final _sqlite3_bind_nullPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, pkg_ffi.Int)>>('sqlite3_bind_null'); + ffi.Int Function( + ffi.Pointer, ffi.Int)>>('sqlite3_bind_null'); late final _sqlite3_bind_null = _sqlite3_bind_nullPtr .asFunction, int)>(); int sqlite3_bind_text( ffi.Pointer arg0, int arg1, - ffi.Pointer arg2, + ffi.Pointer arg2, int arg3, ffi.Pointer)>> arg4, @@ -3392,11 +3369,11 @@ class SQLite { late final _sqlite3_bind_textPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer, - pkg_ffi.Int, + ffi.Int, + ffi.Pointer, + ffi.Int, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -3405,7 +3382,7 @@ class SQLite { int Function( ffi.Pointer, int, - ffi.Pointer, + ffi.Pointer, int, ffi.Pointer< ffi.NativeFunction)>>)>(); @@ -3429,11 +3406,11 @@ class SQLite { late final _sqlite3_bind_text16Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -3450,7 +3427,7 @@ class SQLite { int sqlite3_bind_text64( ffi.Pointer arg0, int arg1, - ffi.Pointer arg2, + ffi.Pointer arg2, int arg3, ffi.Pointer)>> arg4, @@ -3468,19 +3445,19 @@ class SQLite { late final _sqlite3_bind_text64Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer, + ffi.Int, + ffi.Pointer, sqlite3_uint64, ffi.Pointer< ffi.NativeFunction)>>, - pkg_ffi.UnsignedChar)>>('sqlite3_bind_text64'); + ffi.UnsignedChar)>>('sqlite3_bind_text64'); late final _sqlite3_bind_text64 = _sqlite3_bind_text64Ptr.asFunction< int Function( ffi.Pointer, int, - ffi.Pointer, + ffi.Pointer, int, ffi.Pointer< ffi.NativeFunction)>>, @@ -3500,7 +3477,7 @@ class SQLite { late final _sqlite3_bind_valuePtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, + ffi.Int Function(ffi.Pointer, ffi.Int, ffi.Pointer)>>('sqlite3_bind_value'); late final _sqlite3_bind_value = _sqlite3_bind_valuePtr.asFunction< int Function( @@ -3510,7 +3487,7 @@ class SQLite { ffi.Pointer arg0, int arg1, ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg3, ffi.Pointer)>> arg4, ) { @@ -3525,11 +3502,11 @@ class SQLite { late final _sqlite3_bind_pointerPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -3539,7 +3516,7 @@ class SQLite { ffi.Pointer, int, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer< ffi.NativeFunction)>>)>(); @@ -3557,8 +3534,8 @@ class SQLite { late final _sqlite3_bind_zeroblobPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, - pkg_ffi.Int)>>('sqlite3_bind_zeroblob'); + ffi.Int Function(ffi.Pointer, ffi.Int, + ffi.Int)>>('sqlite3_bind_zeroblob'); late final _sqlite3_bind_zeroblob = _sqlite3_bind_zeroblobPtr .asFunction, int, int)>(); @@ -3576,7 +3553,7 @@ class SQLite { late final _sqlite3_bind_zeroblob64Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, + ffi.Int Function(ffi.Pointer, ffi.Int, sqlite3_uint64)>>('sqlite3_bind_zeroblob64'); late final _sqlite3_bind_zeroblob64 = _sqlite3_bind_zeroblob64Ptr .asFunction, int, int)>(); @@ -3606,9 +3583,9 @@ class SQLite { ); } - late final _sqlite3_bind_parameter_countPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_bind_parameter_count'); + late final _sqlite3_bind_parameter_countPtr = + _lookup)>>( + 'sqlite3_bind_parameter_count'); late final _sqlite3_bind_parameter_count = _sqlite3_bind_parameter_countPtr .asFunction)>(); @@ -3636,7 +3613,7 @@ class SQLite { /// See also: [sqlite3_bind_blob|sqlite3_bind()], /// [sqlite3_bind_parameter_count()], and /// [sqlite3_bind_parameter_index()]. - ffi.Pointer sqlite3_bind_parameter_name( + ffi.Pointer sqlite3_bind_parameter_name( ffi.Pointer arg0, int arg1, ) { @@ -3648,11 +3625,11 @@ class SQLite { late final _sqlite3_bind_parameter_namePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_bind_parameter_name'); + ffi.Pointer Function(ffi.Pointer, + ffi.Int)>>('sqlite3_bind_parameter_name'); late final _sqlite3_bind_parameter_name = _sqlite3_bind_parameter_namePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: Index Of A Parameter With A Given Name /// METHOD: sqlite3_stmt @@ -3670,7 +3647,7 @@ class SQLite { /// [sqlite3_bind_parameter_name()]. int sqlite3_bind_parameter_index( ffi.Pointer arg0, - ffi.Pointer zName, + ffi.Pointer zName, ) { return _sqlite3_bind_parameter_index( arg0, @@ -3680,11 +3657,11 @@ class SQLite { late final _sqlite3_bind_parameter_indexPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_bind_parameter_index'); + ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_bind_parameter_index'); late final _sqlite3_bind_parameter_index = _sqlite3_bind_parameter_indexPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Reset All Bindings On A Prepared Statement /// METHOD: sqlite3_stmt @@ -3700,9 +3677,9 @@ class SQLite { ); } - late final _sqlite3_clear_bindingsPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_clear_bindings'); + late final _sqlite3_clear_bindingsPtr = + _lookup)>>( + 'sqlite3_clear_bindings'); late final _sqlite3_clear_bindings = _sqlite3_clear_bindingsPtr .asFunction)>(); @@ -3726,9 +3703,9 @@ class SQLite { ); } - late final _sqlite3_column_countPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_column_count'); + late final _sqlite3_column_countPtr = + _lookup)>>( + 'sqlite3_column_count'); late final _sqlite3_column_count = _sqlite3_column_countPtr .asFunction)>(); @@ -3757,7 +3734,7 @@ class SQLite { /// that column, if there is an AS clause. If there is no AS clause /// then the name of the column is unspecified and may change from /// one release of SQLite to the next. - ffi.Pointer sqlite3_column_name( + ffi.Pointer sqlite3_column_name( ffi.Pointer arg0, int N, ) { @@ -3769,10 +3746,10 @@ class SQLite { late final _sqlite3_column_namePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, pkg_ffi.Int)>>('sqlite3_column_name'); + ffi.Pointer Function( + ffi.Pointer, ffi.Int)>>('sqlite3_column_name'); late final _sqlite3_column_name = _sqlite3_column_namePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_name16( ffi.Pointer arg0, @@ -3786,8 +3763,8 @@ class SQLite { late final _sqlite3_column_name16Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_column_name16'); + ffi.Pointer Function( + ffi.Pointer, ffi.Int)>>('sqlite3_column_name16'); late final _sqlite3_column_name16 = _sqlite3_column_name16Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -3831,7 +3808,7 @@ class SQLite { /// [sqlite3_column_database_name | column metadata interfaces] /// for the same [prepared statement] and result column /// at the same time then the results are undefined. - ffi.Pointer sqlite3_column_database_name( + ffi.Pointer sqlite3_column_database_name( ffi.Pointer arg0, int arg1, ) { @@ -3843,11 +3820,11 @@ class SQLite { late final _sqlite3_column_database_namePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_column_database_name'); + ffi.Pointer Function(ffi.Pointer, + ffi.Int)>>('sqlite3_column_database_name'); late final _sqlite3_column_database_name = _sqlite3_column_database_namePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_database_name16( ffi.Pointer arg0, @@ -3862,12 +3839,12 @@ class SQLite { late final _sqlite3_column_database_name16Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_column_database_name16'); + ffi.Int)>>('sqlite3_column_database_name16'); late final _sqlite3_column_database_name16 = _sqlite3_column_database_name16Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); - ffi.Pointer sqlite3_column_table_name( + ffi.Pointer sqlite3_column_table_name( ffi.Pointer arg0, int arg1, ) { @@ -3879,11 +3856,11 @@ class SQLite { late final _sqlite3_column_table_namePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_column_table_name'); + ffi.Pointer Function(ffi.Pointer, + ffi.Int)>>('sqlite3_column_table_name'); late final _sqlite3_column_table_name = _sqlite3_column_table_namePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_table_name16( ffi.Pointer arg0, @@ -3898,12 +3875,12 @@ class SQLite { late final _sqlite3_column_table_name16Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_column_table_name16'); + ffi.Int)>>('sqlite3_column_table_name16'); late final _sqlite3_column_table_name16 = _sqlite3_column_table_name16Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); - ffi.Pointer sqlite3_column_origin_name( + ffi.Pointer sqlite3_column_origin_name( ffi.Pointer arg0, int arg1, ) { @@ -3915,11 +3892,11 @@ class SQLite { late final _sqlite3_column_origin_namePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_column_origin_name'); + ffi.Pointer Function(ffi.Pointer, + ffi.Int)>>('sqlite3_column_origin_name'); late final _sqlite3_column_origin_name = _sqlite3_column_origin_namePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_origin_name16( ffi.Pointer arg0, @@ -3934,7 +3911,7 @@ class SQLite { late final _sqlite3_column_origin_name16Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_column_origin_name16'); + ffi.Int)>>('sqlite3_column_origin_name16'); late final _sqlite3_column_origin_name16 = _sqlite3_column_origin_name16Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -3967,7 +3944,7 @@ class SQLite { /// strongly typed, but the typing is dynamic not static. ^Type /// is associated with individual values, not with the containers /// used to hold those values. - ffi.Pointer sqlite3_column_decltype( + ffi.Pointer sqlite3_column_decltype( ffi.Pointer arg0, int arg1, ) { @@ -3979,10 +3956,10 @@ class SQLite { late final _sqlite3_column_decltypePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_column_decltype'); + ffi.Pointer Function( + ffi.Pointer, ffi.Int)>>('sqlite3_column_decltype'); late final _sqlite3_column_decltype = _sqlite3_column_decltypePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_decltype16( ffi.Pointer arg0, @@ -3997,7 +3974,7 @@ class SQLite { late final _sqlite3_column_decltype16Ptr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_column_decltype16'); + ffi.Int)>>('sqlite3_column_decltype16'); late final _sqlite3_column_decltype16 = _sqlite3_column_decltype16Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -4090,9 +4067,9 @@ class SQLite { ); } - late final _sqlite3_stepPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_step'); + late final _sqlite3_stepPtr = + _lookup)>>( + 'sqlite3_step'); late final _sqlite3_step = _sqlite3_stepPtr.asFunction)>(); @@ -4121,9 +4098,9 @@ class SQLite { ); } - late final _sqlite3_data_countPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_data_count'); + late final _sqlite3_data_countPtr = + _lookup)>>( + 'sqlite3_data_count'); late final _sqlite3_data_count = _sqlite3_data_countPtr .asFunction)>(); @@ -4347,7 +4324,7 @@ class SQLite { late final _sqlite3_column_blobPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, pkg_ffi.Int)>>('sqlite3_column_blob'); + ffi.Pointer, ffi.Int)>>('sqlite3_column_blob'); late final _sqlite3_column_blob = _sqlite3_column_blobPtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -4363,8 +4340,8 @@ class SQLite { late final _sqlite3_column_doublePtr = _lookup< ffi.NativeFunction< - ffi.Double Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_column_double'); + ffi.Double Function( + ffi.Pointer, ffi.Int)>>('sqlite3_column_double'); late final _sqlite3_column_double = _sqlite3_column_doublePtr .asFunction, int)>(); @@ -4380,8 +4357,8 @@ class SQLite { late final _sqlite3_column_intPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, pkg_ffi.Int)>>('sqlite3_column_int'); + ffi.Int Function( + ffi.Pointer, ffi.Int)>>('sqlite3_column_int'); late final _sqlite3_column_int = _sqlite3_column_intPtr .asFunction, int)>(); @@ -4398,11 +4375,11 @@ class SQLite { late final _sqlite3_column_int64Ptr = _lookup< ffi.NativeFunction< sqlite3_int64 Function( - ffi.Pointer, pkg_ffi.Int)>>('sqlite3_column_int64'); + ffi.Pointer, ffi.Int)>>('sqlite3_column_int64'); late final _sqlite3_column_int64 = _sqlite3_column_int64Ptr .asFunction, int)>(); - ffi.Pointer sqlite3_column_text( + ffi.Pointer sqlite3_column_text( ffi.Pointer arg0, int iCol, ) { @@ -4414,11 +4391,10 @@ class SQLite { late final _sqlite3_column_textPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, pkg_ffi.Int)>>('sqlite3_column_text'); + ffi.Pointer Function( + ffi.Pointer, ffi.Int)>>('sqlite3_column_text'); late final _sqlite3_column_text = _sqlite3_column_textPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_text16( ffi.Pointer arg0, @@ -4432,8 +4408,8 @@ class SQLite { late final _sqlite3_column_text16Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_column_text16'); + ffi.Pointer Function( + ffi.Pointer, ffi.Int)>>('sqlite3_column_text16'); late final _sqlite3_column_text16 = _sqlite3_column_text16Ptr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -4450,7 +4426,7 @@ class SQLite { late final _sqlite3_column_valuePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, pkg_ffi.Int)>>('sqlite3_column_value'); + ffi.Pointer, ffi.Int)>>('sqlite3_column_value'); late final _sqlite3_column_value = _sqlite3_column_valuePtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -4466,8 +4442,8 @@ class SQLite { late final _sqlite3_column_bytesPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, pkg_ffi.Int)>>('sqlite3_column_bytes'); + ffi.Int Function( + ffi.Pointer, ffi.Int)>>('sqlite3_column_bytes'); late final _sqlite3_column_bytes = _sqlite3_column_bytesPtr .asFunction, int)>(); @@ -4483,8 +4459,8 @@ class SQLite { late final _sqlite3_column_bytes16Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_column_bytes16'); + ffi.Int Function( + ffi.Pointer, ffi.Int)>>('sqlite3_column_bytes16'); late final _sqlite3_column_bytes16 = _sqlite3_column_bytes16Ptr .asFunction, int)>(); @@ -4500,8 +4476,8 @@ class SQLite { late final _sqlite3_column_typePtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, pkg_ffi.Int)>>('sqlite3_column_type'); + ffi.Int Function( + ffi.Pointer, ffi.Int)>>('sqlite3_column_type'); late final _sqlite3_column_type = _sqlite3_column_typePtr .asFunction, int)>(); @@ -4537,9 +4513,9 @@ class SQLite { ); } - late final _sqlite3_finalizePtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_finalize'); + late final _sqlite3_finalizePtr = + _lookup)>>( + 'sqlite3_finalize'); late final _sqlite3_finalize = _sqlite3_finalizePtr .asFunction)>(); @@ -4574,9 +4550,9 @@ class SQLite { ); } - late final _sqlite3_resetPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_reset'); + late final _sqlite3_resetPtr = + _lookup)>>( + 'sqlite3_reset'); late final _sqlite3_reset = _sqlite3_resetPtr.asFunction)>(); @@ -4705,18 +4681,18 @@ class SQLite { /// statement in which the function is running. int sqlite3_create_function( ffi.Pointer db, - ffi.Pointer zFunctionName, + ffi.Pointer zFunctionName, int nArg, int eTextRep, ffi.Pointer pApp, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, pkg_ffi.Int, + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Pointer>)>> xFunc, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, pkg_ffi.Int, + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Pointer>)>> xStep, ffi.Pointer< @@ -4735,44 +4711,46 @@ class SQLite { ); } - late final _sqlite3_create_functionPtr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - pkg_ffi.Int, - pkg_ffi.Int, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer>)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer>)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>)>>( - 'sqlite3_create_function'); + late final _sqlite3_create_functionPtr = + _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int, + ffi.Int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>( + 'sqlite3_create_function'); late final _sqlite3_create_function = _sqlite3_create_functionPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, pkg_ffi.Int, + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Pointer>)>>, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, pkg_ffi.Int, + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Pointer>)>>, ffi.Pointer< ffi.NativeFunction< @@ -4786,12 +4764,12 @@ class SQLite { ffi.Pointer pApp, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, pkg_ffi.Int, + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Pointer>)>> xFunc, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, pkg_ffi.Int, + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Pointer>)>> xStep, ffi.Pointer< @@ -4810,30 +4788,32 @@ class SQLite { ); } - late final _sqlite3_create_function16Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - pkg_ffi.Int, - pkg_ffi.Int, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer>)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer>)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>)>>( - 'sqlite3_create_function16'); + late final _sqlite3_create_function16Ptr = + _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int, + ffi.Int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>( + 'sqlite3_create_function16'); late final _sqlite3_create_function16 = _sqlite3_create_function16Ptr.asFunction< int Function( @@ -4844,15 +4824,11 @@ class SQLite { ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - pkg_ffi.Int, + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Pointer>)>>, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - pkg_ffi.Int, + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Pointer>)>>, ffi.Pointer< ffi.NativeFunction< @@ -4860,18 +4836,18 @@ class SQLite { int sqlite3_create_function_v2( ffi.Pointer db, - ffi.Pointer zFunctionName, + ffi.Pointer zFunctionName, int nArg, int eTextRep, ffi.Pointer pApp, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, pkg_ffi.Int, + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Pointer>)>> xFunc, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, pkg_ffi.Int, + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Pointer>)>> xStep, ffi.Pointer< @@ -4893,52 +4869,49 @@ class SQLite { ); } - late final _sqlite3_create_function_v2Ptr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - pkg_ffi.Int, - pkg_ffi.Int, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer>)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer>)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>)>>( - 'sqlite3_create_function_v2'); + late final _sqlite3_create_function_v2Ptr = + _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int, + ffi.Int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( + 'sqlite3_create_function_v2'); late final _sqlite3_create_function_v2 = _sqlite3_create_function_v2Ptr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - pkg_ffi.Int, + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Pointer>)>>, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - pkg_ffi.Int, + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Pointer>)>>, ffi.Pointer< ffi.NativeFunction< @@ -4949,13 +4922,13 @@ class SQLite { int sqlite3_create_window_function( ffi.Pointer db, - ffi.Pointer zFunctionName, + ffi.Pointer zFunctionName, int nArg, int eTextRep, ffi.Pointer pApp, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, pkg_ffi.Int, + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Pointer>)>> xStep, ffi.Pointer< @@ -4966,7 +4939,7 @@ class SQLite { xValue, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, pkg_ffi.Int, + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Pointer>)>> xInverse, ffi.Pointer)>> @@ -4986,49 +4959,48 @@ class SQLite { ); } - late final _sqlite3_create_window_functionPtr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - pkg_ffi.Int, - pkg_ffi.Int, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer>)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer>)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>)>>( - 'sqlite3_create_window_function'); + late final _sqlite3_create_window_functionPtr = + _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int, + ffi.Int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( + 'sqlite3_create_window_function'); late final _sqlite3_create_window_function = _sqlite3_create_window_functionPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - pkg_ffi.Int, + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Pointer>)>>, ffi.Pointer< ffi.NativeFunction< @@ -5038,9 +5010,7 @@ class SQLite { ffi.Void Function(ffi.Pointer)>>, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - pkg_ffi.Int, + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Pointer>)>>, ffi.Pointer< ffi.NativeFunction< @@ -5055,9 +5025,8 @@ class SQLite { } late final _sqlite3_aggregate_countPtr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer)>>('sqlite3_aggregate_count'); + ffi.NativeFunction)>>( + 'sqlite3_aggregate_count'); late final _sqlite3_aggregate_count = _sqlite3_aggregate_countPtr .asFunction)>(); @@ -5069,9 +5038,9 @@ class SQLite { ); } - late final _sqlite3_expiredPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_expired'); + late final _sqlite3_expiredPtr = + _lookup)>>( + 'sqlite3_expired'); late final _sqlite3_expired = _sqlite3_expiredPtr.asFunction)>(); @@ -5087,7 +5056,7 @@ class SQLite { late final _sqlite3_transfer_bindingsPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, + ffi.Int Function(ffi.Pointer, ffi.Pointer)>>('sqlite3_transfer_bindings'); late final _sqlite3_transfer_bindings = _sqlite3_transfer_bindingsPtr.asFunction< @@ -5098,8 +5067,7 @@ class SQLite { } late final _sqlite3_global_recoverPtr = - _lookup>( - 'sqlite3_global_recover'); + _lookup>('sqlite3_global_recover'); late final _sqlite3_global_recover = _sqlite3_global_recoverPtr.asFunction(); @@ -5117,7 +5085,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, sqlite3_int64, pkg_ffi.Int)>> + ffi.Pointer, sqlite3_int64, ffi.Int)>> arg0, ffi.Pointer arg1, int arg2, @@ -5131,11 +5099,11 @@ class SQLite { late final _sqlite3_memory_alarmPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, sqlite3_int64, pkg_ffi.Int)>>, + ffi.Pointer, sqlite3_int64, ffi.Int)>>, ffi.Pointer, sqlite3_int64)>>('sqlite3_memory_alarm'); late final _sqlite3_memory_alarm = _sqlite3_memory_alarmPtr.asFunction< @@ -5143,7 +5111,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, sqlite3_int64, pkg_ffi.Int)>>, + ffi.Pointer, sqlite3_int64, ffi.Int)>>, ffi.Pointer, int)>(); @@ -5310,9 +5278,9 @@ class SQLite { ); } - late final _sqlite3_value_intPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_value_int'); + late final _sqlite3_value_intPtr = + _lookup)>>( + 'sqlite3_value_int'); late final _sqlite3_value_int = _sqlite3_value_intPtr .asFunction)>(); @@ -5333,7 +5301,7 @@ class SQLite { ffi.Pointer sqlite3_value_pointer( ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, ) { return _sqlite3_value_pointer( arg0, @@ -5344,12 +5312,12 @@ class SQLite { late final _sqlite3_value_pointerPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_value_pointer'); + ffi.Pointer)>>('sqlite3_value_pointer'); late final _sqlite3_value_pointer = _sqlite3_value_pointerPtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer sqlite3_value_text( + ffi.Pointer sqlite3_value_text( ffi.Pointer arg0, ) { return _sqlite3_value_text( @@ -5359,10 +5327,10 @@ class SQLite { late final _sqlite3_value_textPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('sqlite3_value_text'); late final _sqlite3_value_text = _sqlite3_value_textPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer)>(); ffi.Pointer sqlite3_value_text16( ffi.Pointer arg0, @@ -5417,9 +5385,9 @@ class SQLite { ); } - late final _sqlite3_value_bytesPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_value_bytes'); + late final _sqlite3_value_bytesPtr = + _lookup)>>( + 'sqlite3_value_bytes'); late final _sqlite3_value_bytes = _sqlite3_value_bytesPtr .asFunction)>(); @@ -5431,9 +5399,9 @@ class SQLite { ); } - late final _sqlite3_value_bytes16Ptr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_value_bytes16'); + late final _sqlite3_value_bytes16Ptr = + _lookup)>>( + 'sqlite3_value_bytes16'); late final _sqlite3_value_bytes16 = _sqlite3_value_bytes16Ptr .asFunction)>(); @@ -5445,9 +5413,9 @@ class SQLite { ); } - late final _sqlite3_value_typePtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_value_type'); + late final _sqlite3_value_typePtr = + _lookup)>>( + 'sqlite3_value_type'); late final _sqlite3_value_type = _sqlite3_value_typePtr .asFunction)>(); @@ -5459,9 +5427,9 @@ class SQLite { ); } - late final _sqlite3_value_numeric_typePtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_value_numeric_type'); + late final _sqlite3_value_numeric_typePtr = + _lookup)>>( + 'sqlite3_value_numeric_type'); late final _sqlite3_value_numeric_type = _sqlite3_value_numeric_typePtr .asFunction)>(); @@ -5473,9 +5441,9 @@ class SQLite { ); } - late final _sqlite3_value_nochangePtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_value_nochange'); + late final _sqlite3_value_nochangePtr = + _lookup)>>( + 'sqlite3_value_nochange'); late final _sqlite3_value_nochange = _sqlite3_value_nochangePtr .asFunction)>(); @@ -5487,9 +5455,9 @@ class SQLite { ); } - late final _sqlite3_value_frombindPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_value_frombind'); + late final _sqlite3_value_frombindPtr = + _lookup)>>( + 'sqlite3_value_frombind'); late final _sqlite3_value_frombind = _sqlite3_value_frombindPtr .asFunction)>(); @@ -5511,7 +5479,7 @@ class SQLite { late final _sqlite3_value_subtypePtr = _lookup< ffi.NativeFunction< - pkg_ffi.UnsignedInt Function( + ffi.UnsignedInt Function( ffi.Pointer)>>('sqlite3_value_subtype'); late final _sqlite3_value_subtype = _sqlite3_value_subtypePtr .asFunction)>(); @@ -5611,7 +5579,7 @@ class SQLite { late final _sqlite3_aggregate_contextPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_aggregate_context'); + ffi.Int)>>('sqlite3_aggregate_context'); late final _sqlite3_aggregate_context = _sqlite3_aggregate_contextPtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -5733,8 +5701,8 @@ class SQLite { late final _sqlite3_get_auxdataPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_get_auxdata'); + ffi.Pointer Function( + ffi.Pointer, ffi.Int)>>('sqlite3_get_auxdata'); late final _sqlite3_get_auxdata = _sqlite3_get_auxdataPtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -5757,7 +5725,7 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< @@ -5935,7 +5903,7 @@ class SQLite { ffi.Void Function( ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -6000,7 +5968,7 @@ class SQLite { void sqlite3_result_error( ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, int arg2, ) { return _sqlite3_result_error( @@ -6012,11 +5980,11 @@ class SQLite { late final _sqlite3_result_errorPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Int)>>('sqlite3_result_error'); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int)>>('sqlite3_result_error'); late final _sqlite3_result_error = _sqlite3_result_errorPtr.asFunction< void Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer, ffi.Pointer, int)>(); void sqlite3_result_error16( ffi.Pointer arg0, @@ -6033,7 +6001,7 @@ class SQLite { late final _sqlite3_result_error16Ptr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_result_error16'); + ffi.Int)>>('sqlite3_result_error16'); late final _sqlite3_result_error16 = _sqlite3_result_error16Ptr.asFunction< void Function( ffi.Pointer, ffi.Pointer, int)>(); @@ -6079,7 +6047,7 @@ class SQLite { late final _sqlite3_result_error_codePtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_result_error_code'); + ffi.Int)>>('sqlite3_result_error_code'); late final _sqlite3_result_error_code = _sqlite3_result_error_codePtr .asFunction, int)>(); @@ -6095,8 +6063,8 @@ class SQLite { late final _sqlite3_result_intPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_result_int'); + ffi.Void Function( + ffi.Pointer, ffi.Int)>>('sqlite3_result_int'); late final _sqlite3_result_int = _sqlite3_result_intPtr .asFunction, int)>(); @@ -6133,7 +6101,7 @@ class SQLite { void sqlite3_result_text( ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, int arg2, ffi.Pointer)>> arg3, @@ -6150,8 +6118,8 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - pkg_ffi.Int, + ffi.Pointer, + ffi.Int, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -6159,14 +6127,14 @@ class SQLite { late final _sqlite3_result_text = _sqlite3_result_textPtr.asFunction< void Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, ffi.Pointer< ffi.NativeFunction)>>)>(); void sqlite3_result_text64( ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, int arg2, ffi.Pointer)>> arg3, @@ -6185,15 +6153,15 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, sqlite3_uint64, ffi.Pointer< ffi.NativeFunction)>>, - pkg_ffi.UnsignedChar)>>('sqlite3_result_text64'); + ffi.UnsignedChar)>>('sqlite3_result_text64'); late final _sqlite3_result_text64 = _sqlite3_result_text64Ptr.asFunction< void Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, ffi.Pointer< ffi.NativeFunction)>>, @@ -6219,7 +6187,7 @@ class SQLite { ffi.Void Function( ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -6252,7 +6220,7 @@ class SQLite { ffi.Void Function( ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer)>>)>>( @@ -6285,7 +6253,7 @@ class SQLite { ffi.Void Function( ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer)>>)>>( @@ -6319,7 +6287,7 @@ class SQLite { void sqlite3_result_pointer( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg2, ffi.Pointer)>> arg3, ) { @@ -6336,7 +6304,7 @@ class SQLite { ffi.Void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -6345,7 +6313,7 @@ class SQLite { void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer< ffi.NativeFunction)>>)>(); @@ -6362,7 +6330,7 @@ class SQLite { late final _sqlite3_result_zeroblobPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_result_zeroblob'); + ffi.Int)>>('sqlite3_result_zeroblob'); late final _sqlite3_result_zeroblob = _sqlite3_result_zeroblobPtr .asFunction, int)>(); @@ -6378,7 +6346,7 @@ class SQLite { late final _sqlite3_result_zeroblob64Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, + ffi.Int Function(ffi.Pointer, sqlite3_uint64)>>('sqlite3_result_zeroblob64'); late final _sqlite3_result_zeroblob64 = _sqlite3_result_zeroblob64Ptr .asFunction, int)>(); @@ -6406,7 +6374,7 @@ class SQLite { late final _sqlite3_result_subtypePtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - pkg_ffi.UnsignedInt)>>('sqlite3_result_subtype'); + ffi.UnsignedInt)>>('sqlite3_result_subtype'); late final _sqlite3_result_subtype = _sqlite3_result_subtypePtr .asFunction, int)>(); @@ -6491,13 +6459,13 @@ class SQLite { /// See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()]. int sqlite3_create_collation( ffi.Pointer arg0, - ffi.Pointer zName, + ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, - ffi.Pointer, pkg_ffi.Int, ffi.Pointer)>> + ffi.Int Function(ffi.Pointer, ffi.Int, + ffi.Pointer, ffi.Int, ffi.Pointer)>> xCompare, ) { return _sqlite3_create_collation( @@ -6511,45 +6479,45 @@ class SQLite { late final _sqlite3_create_collationPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - ffi.Pointer, - pkg_ffi.Int, + ffi.Pointer, + ffi.Int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer)>>)>>( 'sqlite3_create_collation'); late final _sqlite3_create_collation = _sqlite3_create_collationPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer)>>)>(); int sqlite3_create_collation_v2( ffi.Pointer arg0, - ffi.Pointer zName, + ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, - ffi.Pointer, pkg_ffi.Int, ffi.Pointer)>> + ffi.Int Function(ffi.Pointer, ffi.Int, + ffi.Pointer, ffi.Int, ffi.Pointer)>> xCompare, ffi.Pointer)>> xDestroy, @@ -6566,18 +6534,18 @@ class SQLite { late final _sqlite3_create_collation_v2Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - ffi.Pointer, - pkg_ffi.Int, + ffi.Pointer, + ffi.Int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer)>>, ffi.Pointer< ffi.NativeFunction< @@ -6587,16 +6555,16 @@ class SQLite { _sqlite3_create_collation_v2Ptr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer)>>, ffi.Pointer< ffi.NativeFunction< @@ -6609,8 +6577,8 @@ class SQLite { ffi.Pointer pArg, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, - ffi.Pointer, pkg_ffi.Int, ffi.Pointer)>> + ffi.Int Function(ffi.Pointer, ffi.Int, + ffi.Pointer, ffi.Int, ffi.Pointer)>> xCompare, ) { return _sqlite3_create_collation16( @@ -6624,18 +6592,18 @@ class SQLite { late final _sqlite3_create_collation16Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer)>>)>>( 'sqlite3_create_collation16'); late final _sqlite3_create_collation16 = @@ -6647,11 +6615,11 @@ class SQLite { ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer)>>)>(); /// CAPI3REF: Collation Needed Callbacks @@ -6685,7 +6653,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, ffi.Pointer)>> + ffi.Int, ffi.Pointer)>> arg2, ) { return _sqlite3_collation_needed( @@ -6697,7 +6665,7 @@ class SQLite { late final _sqlite3_collation_neededPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, ffi.Pointer, ffi.Pointer< @@ -6705,8 +6673,8 @@ class SQLite { ffi.Void Function( ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer)>>)>>( + ffi.Int, + ffi.Pointer)>>)>>( 'sqlite3_collation_needed'); late final _sqlite3_collation_needed = _sqlite3_collation_neededPtr.asFunction< @@ -6718,8 +6686,8 @@ class SQLite { ffi.Void Function( ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer)>>)>(); + ffi.Int, + ffi.Pointer)>>)>(); int sqlite3_collation_needed16( ffi.Pointer arg0, @@ -6727,7 +6695,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, ffi.Pointer)>> + ffi.Int, ffi.Pointer)>> arg2, ) { return _sqlite3_collation_needed16( @@ -6739,7 +6707,7 @@ class SQLite { late final _sqlite3_collation_needed16Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, ffi.Pointer, ffi.Pointer< @@ -6747,7 +6715,7 @@ class SQLite { ffi.Void Function( ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer)>>)>>( 'sqlite3_collation_needed16'); late final _sqlite3_collation_needed16 = @@ -6760,7 +6728,7 @@ class SQLite { ffi.Void Function( ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer)>>)>(); /// CAPI3REF: Suspend Execution For A Short Time @@ -6787,8 +6755,7 @@ class SQLite { } late final _sqlite3_sleepPtr = - _lookup>( - 'sqlite3_sleep'); + _lookup>('sqlite3_sleep'); late final _sqlite3_sleep = _sqlite3_sleepPtr.asFunction(); /// CAPI3REF: Name Of The Folder Holding Temporary Files @@ -6845,13 +6812,13 @@ class SQLite { ///   NULL, NULL); /// sqlite3_temp_directory = sqlite3_mprintf("%s", zPathBuf); /// - late final ffi.Pointer> _sqlite3_temp_directory = - _lookup>('sqlite3_temp_directory'); + late final ffi.Pointer> _sqlite3_temp_directory = + _lookup>('sqlite3_temp_directory'); - ffi.Pointer get sqlite3_temp_directory => + ffi.Pointer get sqlite3_temp_directory => _sqlite3_temp_directory.value; - set sqlite3_temp_directory(ffi.Pointer value) => + set sqlite3_temp_directory(ffi.Pointer value) => _sqlite3_temp_directory.value = value; /// CAPI3REF: Name Of The Folder Holding Database Files @@ -6887,13 +6854,13 @@ class SQLite { /// Hence, if this variable is modified directly, either it should be /// made NULL or made to point to memory obtained from [sqlite3_malloc] /// or else the use of the [data_store_directory pragma] should be avoided. - late final ffi.Pointer> _sqlite3_data_directory = - _lookup>('sqlite3_data_directory'); + late final ffi.Pointer> _sqlite3_data_directory = + _lookup>('sqlite3_data_directory'); - ffi.Pointer get sqlite3_data_directory => + ffi.Pointer get sqlite3_data_directory => _sqlite3_data_directory.value; - set sqlite3_data_directory(ffi.Pointer value) => + set sqlite3_data_directory(ffi.Pointer value) => _sqlite3_data_directory.value = value; /// CAPI3REF: Win32 Specific Interface @@ -6925,14 +6892,14 @@ class SQLite { late final _sqlite3_win32_set_directoryPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(pkg_ffi.UnsignedLong, + ffi.Int Function(ffi.UnsignedLong, ffi.Pointer)>>('sqlite3_win32_set_directory'); late final _sqlite3_win32_set_directory = _sqlite3_win32_set_directoryPtr .asFunction)>(); int sqlite3_win32_set_directory8( int type, - ffi.Pointer zValue, + ffi.Pointer zValue, ) { return _sqlite3_win32_set_directory8( type, @@ -6942,10 +6909,10 @@ class SQLite { late final _sqlite3_win32_set_directory8Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(pkg_ffi.UnsignedLong, - ffi.Pointer)>>('sqlite3_win32_set_directory8'); + ffi.Int Function(ffi.UnsignedLong, + ffi.Pointer)>>('sqlite3_win32_set_directory8'); late final _sqlite3_win32_set_directory8 = _sqlite3_win32_set_directory8Ptr - .asFunction)>(); + .asFunction)>(); int sqlite3_win32_set_directory16( int type, @@ -6959,7 +6926,7 @@ class SQLite { late final _sqlite3_win32_set_directory16Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(pkg_ffi.UnsignedLong, + ffi.Int Function(ffi.UnsignedLong, ffi.Pointer)>>('sqlite3_win32_set_directory16'); late final _sqlite3_win32_set_directory16 = _sqlite3_win32_set_directory16Ptr .asFunction)>(); @@ -6993,7 +6960,7 @@ class SQLite { } late final _sqlite3_get_autocommitPtr = - _lookup)>>( + _lookup)>>( 'sqlite3_get_autocommit'); late final _sqlite3_get_autocommit = _sqlite3_get_autocommitPtr .asFunction)>(); @@ -7050,9 +7017,9 @@ class SQLite { ///
  • [sqlite3_filename_journal()] ///
  • [sqlite3_filename_wal()] /// - ffi.Pointer sqlite3_db_filename( + ffi.Pointer sqlite3_db_filename( ffi.Pointer db, - ffi.Pointer zDbName, + ffi.Pointer zDbName, ) { return _sqlite3_db_filename( db, @@ -7062,11 +7029,11 @@ class SQLite { late final _sqlite3_db_filenamePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_db_filename'); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_db_filename'); late final _sqlite3_db_filename = _sqlite3_db_filenamePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Determine if a database is read-only /// METHOD: sqlite3 @@ -7076,7 +7043,7 @@ class SQLite { /// the name of a database on connection D. int sqlite3_db_readonly( ffi.Pointer db, - ffi.Pointer zDbName, + ffi.Pointer zDbName, ) { return _sqlite3_db_readonly( db, @@ -7086,10 +7053,10 @@ class SQLite { late final _sqlite3_db_readonlyPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_db_readonly'); - late final _sqlite3_db_readonly = _sqlite3_db_readonlyPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_db_readonly'); + late final _sqlite3_db_readonly = _sqlite3_db_readonlyPtr + .asFunction, ffi.Pointer)>(); /// CAPI3REF: Find the next prepared statement /// METHOD: sqlite3 @@ -7168,7 +7135,7 @@ class SQLite { /// See also the [sqlite3_update_hook()] interface. ffi.Pointer sqlite3_commit_hook( ffi.Pointer arg0, - ffi.Pointer)>> + ffi.Pointer)>> arg1, ffi.Pointer arg2, ) { @@ -7184,14 +7151,13 @@ class SQLite { ffi.Pointer Function( ffi.Pointer, ffi.Pointer< - ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer)>>, + ffi.NativeFunction)>>, ffi.Pointer)>>('sqlite3_commit_hook'); late final _sqlite3_commit_hook = _sqlite3_commit_hookPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer< - ffi.NativeFunction)>>, + ffi.NativeFunction)>>, ffi.Pointer)>(); ffi.Pointer sqlite3_rollback_hook( @@ -7274,9 +7240,9 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer, - ffi.Pointer, + ffi.Int, + ffi.Pointer, + ffi.Pointer, sqlite3_int64)>> arg1, ffi.Pointer arg2, @@ -7296,9 +7262,9 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer, - ffi.Pointer, + ffi.Int, + ffi.Pointer, + ffi.Pointer, sqlite3_int64)>>, ffi.Pointer)>>('sqlite3_update_hook'); late final _sqlite3_update_hook = _sqlite3_update_hookPtr.asFunction< @@ -7308,9 +7274,9 @@ class SQLite { ffi.NativeFunction< ffi.Void Function( ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer, - ffi.Pointer, + ffi.Int, + ffi.Pointer, + ffi.Pointer, sqlite3_int64)>>, ffi.Pointer)>(); @@ -7360,7 +7326,7 @@ class SQLite { } late final _sqlite3_enable_shared_cachePtr = - _lookup>( + _lookup>( 'sqlite3_enable_shared_cache'); late final _sqlite3_enable_shared_cache = _sqlite3_enable_shared_cachePtr.asFunction(); @@ -7386,7 +7352,7 @@ class SQLite { } late final _sqlite3_release_memoryPtr = - _lookup>( + _lookup>( 'sqlite3_release_memory'); late final _sqlite3_release_memory = _sqlite3_release_memoryPtr.asFunction(); @@ -7410,7 +7376,7 @@ class SQLite { } late final _sqlite3_db_release_memoryPtr = - _lookup)>>( + _lookup)>>( 'sqlite3_db_release_memory'); late final _sqlite3_db_release_memory = _sqlite3_db_release_memoryPtr .asFunction)>(); @@ -7521,7 +7487,7 @@ class SQLite { } late final _sqlite3_soft_heap_limitPtr = - _lookup>( + _lookup>( 'sqlite3_soft_heap_limit'); late final _sqlite3_soft_heap_limit = _sqlite3_soft_heap_limitPtr.asFunction(); @@ -7595,14 +7561,14 @@ class SQLite { /// any errors are encountered while loading the schema. int sqlite3_table_column_metadata( ffi.Pointer db, - ffi.Pointer zDbName, - ffi.Pointer zTableName, - ffi.Pointer zColumnName, - ffi.Pointer> pzDataType, - ffi.Pointer> pzCollSeq, - ffi.Pointer pNotNull, - ffi.Pointer pPrimaryKey, - ffi.Pointer pAutoinc, + ffi.Pointer zDbName, + ffi.Pointer zTableName, + ffi.Pointer zColumnName, + ffi.Pointer> pzDataType, + ffi.Pointer> pzCollSeq, + ffi.Pointer pNotNull, + ffi.Pointer pPrimaryKey, + ffi.Pointer pAutoinc, ) { return _sqlite3_table_column_metadata( db, @@ -7619,28 +7585,28 @@ class SQLite { late final _sqlite3_table_column_metadataPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('sqlite3_table_column_metadata'); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('sqlite3_table_column_metadata'); late final _sqlite3_table_column_metadata = _sqlite3_table_column_metadataPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// CAPI3REF: Load An Extension /// METHOD: sqlite3 @@ -7686,9 +7652,9 @@ class SQLite { /// See also the [load_extension() SQL function]. int sqlite3_load_extension( ffi.Pointer db, - ffi.Pointer zFile, - ffi.Pointer zProc, - ffi.Pointer> pzErrMsg, + ffi.Pointer zFile, + ffi.Pointer zProc, + ffi.Pointer> pzErrMsg, ) { return _sqlite3_load_extension( db, @@ -7699,16 +7665,15 @@ class SQLite { } late final _sqlite3_load_extensionPtr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>( - 'sqlite3_load_extension'); + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('sqlite3_load_extension'); late final _sqlite3_load_extension = _sqlite3_load_extensionPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer>)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); /// CAPI3REF: Enable Or Disable Extension Loading /// METHOD: sqlite3 @@ -7744,9 +7709,8 @@ class SQLite { } late final _sqlite3_enable_load_extensionPtr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_enable_load_extension'); + ffi.NativeFunction, ffi.Int)>>( + 'sqlite3_enable_load_extension'); late final _sqlite3_enable_load_extension = _sqlite3_enable_load_extensionPtr .asFunction, int)>(); @@ -7794,7 +7758,7 @@ class SQLite { late final _sqlite3_auto_extensionPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer>)>>( 'sqlite3_auto_extension'); late final _sqlite3_auto_extension = _sqlite3_auto_extensionPtr.asFunction< @@ -7818,7 +7782,7 @@ class SQLite { late final _sqlite3_cancel_auto_extensionPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer>)>>( 'sqlite3_cancel_auto_extension'); late final _sqlite3_cancel_auto_extension = @@ -7871,7 +7835,7 @@ class SQLite { /// See also: [sqlite3_drop_modules()] int sqlite3_create_module( ffi.Pointer db, - ffi.Pointer zName, + ffi.Pointer zName, ffi.Pointer p, ffi.Pointer pClientData, ) { @@ -7885,18 +7849,18 @@ class SQLite { late final _sqlite3_create_modulePtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('sqlite3_create_module'); late final _sqlite3_create_module = _sqlite3_create_modulePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, + int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); int sqlite3_create_module_v2( ffi.Pointer db, - ffi.Pointer zName, + ffi.Pointer zName, ffi.Pointer p, ffi.Pointer pClientData, ffi.Pointer)>> @@ -7913,9 +7877,9 @@ class SQLite { late final _sqlite3_create_module_v2Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer< @@ -7926,7 +7890,7 @@ class SQLite { _sqlite3_create_module_v2Ptr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer< @@ -7945,7 +7909,7 @@ class SQLite { /// See also: [sqlite3_create_module()] int sqlite3_drop_modules( ffi.Pointer db, - ffi.Pointer> azKeep, + ffi.Pointer> azKeep, ) { return _sqlite3_drop_modules( db, @@ -7955,11 +7919,10 @@ class SQLite { late final _sqlite3_drop_modulesPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, - ffi.Pointer>)>>('sqlite3_drop_modules'); + ffi.Int Function(ffi.Pointer, + ffi.Pointer>)>>('sqlite3_drop_modules'); late final _sqlite3_drop_modules = _sqlite3_drop_modulesPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer>)>(); + int Function(ffi.Pointer, ffi.Pointer>)>(); /// CAPI3REF: Declare The Schema Of A Virtual Table /// @@ -7969,7 +7932,7 @@ class SQLite { /// the virtual tables they implement. int sqlite3_declare_vtab( ffi.Pointer arg0, - ffi.Pointer zSQL, + ffi.Pointer zSQL, ) { return _sqlite3_declare_vtab( arg0, @@ -7979,10 +7942,10 @@ class SQLite { late final _sqlite3_declare_vtabPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_declare_vtab'); - late final _sqlite3_declare_vtab = _sqlite3_declare_vtabPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_declare_vtab'); + late final _sqlite3_declare_vtab = _sqlite3_declare_vtabPtr + .asFunction, ffi.Pointer)>(); /// CAPI3REF: Overload A Function For A Virtual Table /// METHOD: sqlite3 @@ -8001,7 +7964,7 @@ class SQLite { /// by a [virtual table]. int sqlite3_overload_function( ffi.Pointer arg0, - ffi.Pointer zFuncName, + ffi.Pointer zFuncName, int nArg, ) { return _sqlite3_overload_function( @@ -8013,11 +7976,11 @@ class SQLite { late final _sqlite3_overload_functionPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_overload_function'); + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int)>>('sqlite3_overload_function'); late final _sqlite3_overload_function = _sqlite3_overload_functionPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); /// CAPI3REF: Open A BLOB For Incremental I/O /// METHOD: sqlite3 @@ -8102,9 +8065,9 @@ class SQLite { /// [sqlite3_blob_bytes()], [sqlite3_blob_write()]. int sqlite3_blob_open( ffi.Pointer arg0, - ffi.Pointer zDb, - ffi.Pointer zTable, - ffi.Pointer zColumn, + ffi.Pointer zDb, + ffi.Pointer zTable, + ffi.Pointer zColumn, int iRow, int flags, ffi.Pointer> ppBlob, @@ -8122,20 +8085,20 @@ class SQLite { late final _sqlite3_blob_openPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, sqlite3_int64, - pkg_ffi.Int, + ffi.Int, ffi.Pointer>)>>('sqlite3_blob_open'); late final _sqlite3_blob_open = _sqlite3_blob_openPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer>)>(); @@ -8173,7 +8136,7 @@ class SQLite { late final _sqlite3_blob_reopenPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, + ffi.Int Function(ffi.Pointer, sqlite3_int64)>>('sqlite3_blob_reopen'); late final _sqlite3_blob_reopen = _sqlite3_blob_reopenPtr .asFunction, int)>(); @@ -8205,9 +8168,9 @@ class SQLite { ); } - late final _sqlite3_blob_closePtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_blob_close'); + late final _sqlite3_blob_closePtr = + _lookup)>>( + 'sqlite3_blob_close'); late final _sqlite3_blob_close = _sqlite3_blob_closePtr .asFunction)>(); @@ -8231,9 +8194,9 @@ class SQLite { ); } - late final _sqlite3_blob_bytesPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_blob_bytes'); + late final _sqlite3_blob_bytesPtr = + _lookup)>>( + 'sqlite3_blob_bytes'); late final _sqlite3_blob_bytes = _sqlite3_blob_bytesPtr .asFunction)>(); @@ -8278,8 +8241,8 @@ class SQLite { late final _sqlite3_blob_readPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, pkg_ffi.Int)>>('sqlite3_blob_read'); + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int, ffi.Int)>>('sqlite3_blob_read'); late final _sqlite3_blob_read = _sqlite3_blob_readPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, int, int)>(); @@ -8338,8 +8301,8 @@ class SQLite { late final _sqlite3_blob_writePtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, pkg_ffi.Int)>>('sqlite3_blob_write'); + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int, ffi.Int)>>('sqlite3_blob_write'); late final _sqlite3_blob_write = _sqlite3_blob_writePtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, int, int)>(); @@ -8372,7 +8335,7 @@ class SQLite { /// ^(If the default VFS is unregistered, another VFS is chosen as /// the default. The choice for the new VFS is arbitrary.)^ ffi.Pointer sqlite3_vfs_find( - ffi.Pointer zVfsName, + ffi.Pointer zVfsName, ) { return _sqlite3_vfs_find( zVfsName, @@ -8382,9 +8345,9 @@ class SQLite { late final _sqlite3_vfs_findPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer)>>('sqlite3_vfs_find'); - late final _sqlite3_vfs_find = _sqlite3_vfs_findPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + ffi.Pointer)>>('sqlite3_vfs_find'); + late final _sqlite3_vfs_find = _sqlite3_vfs_findPtr + .asFunction Function(ffi.Pointer)>(); int sqlite3_vfs_register( ffi.Pointer arg0, @@ -8398,8 +8361,8 @@ class SQLite { late final _sqlite3_vfs_registerPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, pkg_ffi.Int)>>('sqlite3_vfs_register'); + ffi.Int Function( + ffi.Pointer, ffi.Int)>>('sqlite3_vfs_register'); late final _sqlite3_vfs_register = _sqlite3_vfs_registerPtr .asFunction, int)>(); @@ -8411,9 +8374,9 @@ class SQLite { ); } - late final _sqlite3_vfs_unregisterPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_vfs_unregister'); + late final _sqlite3_vfs_unregisterPtr = + _lookup)>>( + 'sqlite3_vfs_unregister'); late final _sqlite3_vfs_unregister = _sqlite3_vfs_unregisterPtr .asFunction)>(); @@ -8537,9 +8500,9 @@ class SQLite { ); } - late final _sqlite3_mutex_allocPtr = _lookup< - ffi.NativeFunction Function(pkg_ffi.Int)>>( - 'sqlite3_mutex_alloc'); + late final _sqlite3_mutex_allocPtr = + _lookup Function(ffi.Int)>>( + 'sqlite3_mutex_alloc'); late final _sqlite3_mutex_alloc = _sqlite3_mutex_allocPtr .asFunction Function(int)>(); @@ -8579,9 +8542,9 @@ class SQLite { ); } - late final _sqlite3_mutex_tryPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_mutex_try'); + late final _sqlite3_mutex_tryPtr = + _lookup)>>( + 'sqlite3_mutex_try'); late final _sqlite3_mutex_try = _sqlite3_mutex_tryPtr .asFunction)>(); @@ -8607,9 +8570,9 @@ class SQLite { ); } - late final _sqlite3_mutex_heldPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_mutex_held'); + late final _sqlite3_mutex_heldPtr = + _lookup)>>( + 'sqlite3_mutex_held'); late final _sqlite3_mutex_held = _sqlite3_mutex_heldPtr .asFunction)>(); @@ -8621,9 +8584,9 @@ class SQLite { ); } - late final _sqlite3_mutex_notheldPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_mutex_notheld'); + late final _sqlite3_mutex_notheldPtr = + _lookup)>>( + 'sqlite3_mutex_notheld'); late final _sqlite3_mutex_notheld = _sqlite3_mutex_notheldPtr .asFunction)>(); @@ -8691,7 +8654,7 @@ class SQLite { /// See also: [file control opcodes] int sqlite3_file_control( ffi.Pointer arg0, - ffi.Pointer zDbName, + ffi.Pointer zDbName, int op, ffi.Pointer arg3, ) { @@ -8705,10 +8668,10 @@ class SQLite { late final _sqlite3_file_controlPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, ffi.Pointer)>>('sqlite3_file_control'); + ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Int, + ffi.Pointer)>>('sqlite3_file_control'); late final _sqlite3_file_control = _sqlite3_file_controlPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, + int Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); /// CAPI3REF: Testing Interface @@ -8735,7 +8698,7 @@ class SQLite { } late final _sqlite3_test_controlPtr = - _lookup>( + _lookup>( 'sqlite3_test_control'); late final _sqlite3_test_control = _sqlite3_test_controlPtr.asFunction(); @@ -8790,15 +8753,14 @@ class SQLite { } late final _sqlite3_keyword_countPtr = - _lookup>( - 'sqlite3_keyword_count'); + _lookup>('sqlite3_keyword_count'); late final _sqlite3_keyword_count = _sqlite3_keyword_countPtr.asFunction(); int sqlite3_keyword_name( int arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, + ffi.Pointer> arg1, + ffi.Pointer arg2, ) { return _sqlite3_keyword_name( arg0, @@ -8809,16 +8771,14 @@ class SQLite { late final _sqlite3_keyword_namePtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( - pkg_ffi.Int, - ffi.Pointer>, - ffi.Pointer)>>('sqlite3_keyword_name'); + ffi.Int Function(ffi.Int, ffi.Pointer>, + ffi.Pointer)>>('sqlite3_keyword_name'); late final _sqlite3_keyword_name = _sqlite3_keyword_namePtr.asFunction< - int Function(int, ffi.Pointer>, - ffi.Pointer)>(); + int Function( + int, ffi.Pointer>, ffi.Pointer)>(); int sqlite3_keyword_check( - ffi.Pointer arg0, + ffi.Pointer arg0, int arg1, ) { return _sqlite3_keyword_check( @@ -8828,11 +8788,10 @@ class SQLite { } late final _sqlite3_keyword_checkPtr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_keyword_check'); + ffi.NativeFunction, ffi.Int)>>( + 'sqlite3_keyword_check'); late final _sqlite3_keyword_check = _sqlite3_keyword_checkPtr - .asFunction, int)>(); + .asFunction, int)>(); /// CAPI3REF: Create A New Dynamic String Object /// CONSTRUCTOR: sqlite3_str @@ -8883,7 +8842,7 @@ class SQLite { /// errors were encountered during construction of the string. ^The /// [sqlite3_str_finish(X)] interface will also return a NULL pointer if the /// string in [sqlite3_str] object X is zero bytes long. - ffi.Pointer sqlite3_str_finish( + ffi.Pointer sqlite3_str_finish( ffi.Pointer arg0, ) { return _sqlite3_str_finish( @@ -8893,10 +8852,10 @@ class SQLite { late final _sqlite3_str_finishPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('sqlite3_str_finish'); - late final _sqlite3_str_finish = _sqlite3_str_finishPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + late final _sqlite3_str_finish = _sqlite3_str_finishPtr + .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Add Content To A Dynamic String /// METHOD: sqlite3_str @@ -8930,7 +8889,7 @@ class SQLite { /// subsequent call to [sqlite3_str_errcode(X)]. void sqlite3_str_appendf( ffi.Pointer arg0, - ffi.Pointer zFormat, + ffi.Pointer zFormat, ) { return _sqlite3_str_appendf( arg0, @@ -8941,13 +8900,13 @@ class SQLite { late final _sqlite3_str_appendfPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_str_appendf'); + ffi.Pointer)>>('sqlite3_str_appendf'); late final _sqlite3_str_appendf = _sqlite3_str_appendfPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer)>(); void sqlite3_str_append( ffi.Pointer arg0, - ffi.Pointer zIn, + ffi.Pointer zIn, int N, ) { return _sqlite3_str_append( @@ -8959,15 +8918,14 @@ class SQLite { late final _sqlite3_str_appendPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_str_append'); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int)>>('sqlite3_str_append'); late final _sqlite3_str_append = _sqlite3_str_appendPtr.asFunction< - void Function( - ffi.Pointer, ffi.Pointer, int)>(); + void Function(ffi.Pointer, ffi.Pointer, int)>(); void sqlite3_str_appendall( ffi.Pointer arg0, - ffi.Pointer zIn, + ffi.Pointer zIn, ) { return _sqlite3_str_appendall( arg0, @@ -8978,9 +8936,9 @@ class SQLite { late final _sqlite3_str_appendallPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_str_appendall'); + ffi.Pointer)>>('sqlite3_str_appendall'); late final _sqlite3_str_appendall = _sqlite3_str_appendallPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); + void Function(ffi.Pointer, ffi.Pointer)>(); void sqlite3_str_appendchar( ffi.Pointer arg0, @@ -8996,8 +8954,8 @@ class SQLite { late final _sqlite3_str_appendcharPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, pkg_ffi.Int, - pkg_ffi.Char)>>('sqlite3_str_appendchar'); + ffi.Void Function(ffi.Pointer, ffi.Int, + ffi.Char)>>('sqlite3_str_appendchar'); late final _sqlite3_str_appendchar = _sqlite3_str_appendcharPtr .asFunction, int, int)>(); @@ -9050,9 +9008,9 @@ class SQLite { ); } - late final _sqlite3_str_errcodePtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_str_errcode'); + late final _sqlite3_str_errcodePtr = + _lookup)>>( + 'sqlite3_str_errcode'); late final _sqlite3_str_errcode = _sqlite3_str_errcodePtr .asFunction)>(); @@ -9064,13 +9022,13 @@ class SQLite { ); } - late final _sqlite3_str_lengthPtr = _lookup< - ffi.NativeFunction)>>( - 'sqlite3_str_length'); + late final _sqlite3_str_lengthPtr = + _lookup)>>( + 'sqlite3_str_length'); late final _sqlite3_str_length = _sqlite3_str_lengthPtr .asFunction)>(); - ffi.Pointer sqlite3_str_value( + ffi.Pointer sqlite3_str_value( ffi.Pointer arg0, ) { return _sqlite3_str_value( @@ -9080,10 +9038,10 @@ class SQLite { late final _sqlite3_str_valuePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('sqlite3_str_value'); - late final _sqlite3_str_value = _sqlite3_str_valuePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + late final _sqlite3_str_value = _sqlite3_str_valuePtr + .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: SQLite Runtime Status /// @@ -9111,8 +9069,8 @@ class SQLite { /// See also: [sqlite3_db_status()] int sqlite3_status( int op, - ffi.Pointer pCurrent, - ffi.Pointer pHighwater, + ffi.Pointer pCurrent, + ffi.Pointer pHighwater, int resetFlag, ) { return _sqlite3_status( @@ -9125,11 +9083,10 @@ class SQLite { late final _sqlite3_statusPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(pkg_ffi.Int, ffi.Pointer, - ffi.Pointer, pkg_ffi.Int)>>('sqlite3_status'); + ffi.Int Function(ffi.Int, ffi.Pointer, ffi.Pointer, + ffi.Int)>>('sqlite3_status'); late final _sqlite3_status = _sqlite3_statusPtr.asFunction< - int Function( - int, ffi.Pointer, ffi.Pointer, int)>(); + int Function(int, ffi.Pointer, ffi.Pointer, int)>(); int sqlite3_status64( int op, @@ -9147,8 +9104,8 @@ class SQLite { late final _sqlite3_status64Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(pkg_ffi.Int, ffi.Pointer, - ffi.Pointer, pkg_ffi.Int)>>('sqlite3_status64'); + ffi.Int Function(ffi.Int, ffi.Pointer, + ffi.Pointer, ffi.Int)>>('sqlite3_status64'); late final _sqlite3_status64 = _sqlite3_status64Ptr.asFunction< int Function( int, ffi.Pointer, ffi.Pointer, int)>(); @@ -9177,8 +9134,8 @@ class SQLite { int sqlite3_db_status( ffi.Pointer arg0, int op, - ffi.Pointer pCur, - ffi.Pointer pHiwtr, + ffi.Pointer pCur, + ffi.Pointer pHiwtr, int resetFlg, ) { return _sqlite3_db_status( @@ -9192,15 +9149,11 @@ class SQLite { late final _sqlite3_db_statusPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer, - ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_db_status'); + ffi.Int Function(ffi.Pointer, ffi.Int, ffi.Pointer, + ffi.Pointer, ffi.Int)>>('sqlite3_db_status'); late final _sqlite3_db_status = _sqlite3_db_statusPtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer, - ffi.Pointer, int)>(); + int Function(ffi.Pointer, int, ffi.Pointer, + ffi.Pointer, int)>(); /// CAPI3REF: Prepared Statement Status /// METHOD: sqlite3_stmt @@ -9238,8 +9191,8 @@ class SQLite { late final _sqlite3_stmt_statusPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, - pkg_ffi.Int)>>('sqlite3_stmt_status'); + ffi.Int Function(ffi.Pointer, ffi.Int, + ffi.Int)>>('sqlite3_stmt_status'); late final _sqlite3_stmt_status = _sqlite3_stmt_statusPtr .asFunction, int, int)>(); @@ -9429,9 +9382,9 @@ class SQLite { /// possible that they return invalid values. ffi.Pointer sqlite3_backup_init( ffi.Pointer pDest, - ffi.Pointer zDestName, + ffi.Pointer zDestName, ffi.Pointer pSource, - ffi.Pointer zSourceName, + ffi.Pointer zSourceName, ) { return _sqlite3_backup_init( pDest, @@ -9445,15 +9398,15 @@ class SQLite { ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('sqlite3_backup_init'); + ffi.Pointer)>>('sqlite3_backup_init'); late final _sqlite3_backup_init = _sqlite3_backup_initPtr.asFunction< ffi.Pointer Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); int sqlite3_backup_step( ffi.Pointer p, @@ -9467,8 +9420,8 @@ class SQLite { late final _sqlite3_backup_stepPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_backup_step'); + ffi.Int Function( + ffi.Pointer, ffi.Int)>>('sqlite3_backup_step'); late final _sqlite3_backup_step = _sqlite3_backup_stepPtr .asFunction, int)>(); @@ -9481,9 +9434,8 @@ class SQLite { } late final _sqlite3_backup_finishPtr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer)>>('sqlite3_backup_finish'); + ffi.NativeFunction)>>( + 'sqlite3_backup_finish'); late final _sqlite3_backup_finish = _sqlite3_backup_finishPtr .asFunction)>(); @@ -9496,9 +9448,8 @@ class SQLite { } late final _sqlite3_backup_remainingPtr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer)>>('sqlite3_backup_remaining'); + ffi.NativeFunction)>>( + 'sqlite3_backup_remaining'); late final _sqlite3_backup_remaining = _sqlite3_backup_remainingPtr .asFunction)>(); @@ -9511,9 +9462,8 @@ class SQLite { } late final _sqlite3_backup_pagecountPtr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer)>>('sqlite3_backup_pagecount'); + ffi.NativeFunction)>>( + 'sqlite3_backup_pagecount'); late final _sqlite3_backup_pagecount = _sqlite3_backup_pagecountPtr .asFunction)>(); @@ -9634,8 +9584,7 @@ class SQLite { ffi.Pointer pBlocked, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer>, pkg_ffi.Int)>> + ffi.Void Function(ffi.Pointer>, ffi.Int)>> xNotify, ffi.Pointer pNotifyArg, ) { @@ -9648,12 +9597,12 @@ class SQLite { late final _sqlite3_unlock_notifyPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer>, pkg_ffi.Int)>>, + ffi.Pointer>, ffi.Int)>>, ffi.Pointer)>>('sqlite3_unlock_notify'); late final _sqlite3_unlock_notify = _sqlite3_unlock_notifyPtr.asFunction< int Function( @@ -9661,7 +9610,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer>, pkg_ffi.Int)>>, + ffi.Pointer>, ffi.Int)>>, ffi.Pointer)>(); /// CAPI3REF: String Comparison @@ -9671,8 +9620,8 @@ class SQLite { /// strings in a case-independent fashion, using the same definition of "case /// independence" that SQLite uses internally when comparing identifiers. int sqlite3_stricmp( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, ) { return _sqlite3_stricmp( arg0, @@ -9682,14 +9631,14 @@ class SQLite { late final _sqlite3_stricmpPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_stricmp'); - late final _sqlite3_stricmp = _sqlite3_stricmpPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_stricmp'); + late final _sqlite3_stricmp = _sqlite3_stricmpPtr + .asFunction, ffi.Pointer)>(); int sqlite3_strnicmp( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, int arg2, ) { return _sqlite3_strnicmp( @@ -9701,11 +9650,10 @@ class SQLite { late final _sqlite3_strnicmpPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Int)>>('sqlite3_strnicmp'); + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int)>>('sqlite3_strnicmp'); late final _sqlite3_strnicmp = _sqlite3_strnicmpPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); /// CAPI3REF: String Globbing /// @@ -9721,8 +9669,8 @@ class SQLite { /// /// See also: [sqlite3_strlike()]. int sqlite3_strglob( - ffi.Pointer zGlob, - ffi.Pointer zStr, + ffi.Pointer zGlob, + ffi.Pointer zStr, ) { return _sqlite3_strglob( zGlob, @@ -9732,10 +9680,10 @@ class SQLite { late final _sqlite3_strglobPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_strglob'); - late final _sqlite3_strglob = _sqlite3_strglobPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_strglob'); + late final _sqlite3_strglob = _sqlite3_strglobPtr + .asFunction, ffi.Pointer)>(); /// CAPI3REF: String LIKE Matching /// @@ -9757,8 +9705,8 @@ class SQLite { /// /// See also: [sqlite3_strglob()]. int sqlite3_strlike( - ffi.Pointer zGlob, - ffi.Pointer zStr, + ffi.Pointer zGlob, + ffi.Pointer zStr, int cEsc, ) { return _sqlite3_strlike( @@ -9770,13 +9718,10 @@ class SQLite { late final _sqlite3_strlikePtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - pkg_ffi.UnsignedInt)>>('sqlite3_strlike'); + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedInt)>>('sqlite3_strlike'); late final _sqlite3_strlike = _sqlite3_strlikePtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); /// CAPI3REF: Error Logging Interface /// @@ -9799,7 +9744,7 @@ class SQLite { /// buffer. void sqlite3_log( int iErrCode, - ffi.Pointer zFormat, + ffi.Pointer zFormat, ) { return _sqlite3_log( iErrCode, @@ -9809,10 +9754,9 @@ class SQLite { late final _sqlite3_logPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - pkg_ffi.Int, ffi.Pointer)>>('sqlite3_log'); - late final _sqlite3_log = _sqlite3_logPtr - .asFunction)>(); + ffi.Void Function(ffi.Int, ffi.Pointer)>>('sqlite3_log'); + late final _sqlite3_log = + _sqlite3_logPtr.asFunction)>(); /// CAPI3REF: Write-Ahead Log Commit Hook /// METHOD: sqlite3 @@ -9850,11 +9794,8 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - pkg_ffi.Int)>> + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int)>> arg1, ffi.Pointer arg2, ) { @@ -9871,22 +9812,19 @@ class SQLite { ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - pkg_ffi.Int)>>, + ffi.Pointer, + ffi.Int)>>, ffi.Pointer)>>('sqlite3_wal_hook'); late final _sqlite3_wal_hook = _sqlite3_wal_hookPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - pkg_ffi.Int)>>, + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int)>>, ffi.Pointer)>(); /// CAPI3REF: Configure an auto-checkpoint @@ -9927,9 +9865,8 @@ class SQLite { } late final _sqlite3_wal_autocheckpointPtr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_wal_autocheckpoint'); + ffi.NativeFunction, ffi.Int)>>( + 'sqlite3_wal_autocheckpoint'); late final _sqlite3_wal_autocheckpoint = _sqlite3_wal_autocheckpointPtr .asFunction, int)>(); @@ -9953,7 +9890,7 @@ class SQLite { /// complication) of [sqlite3_wal_checkpoint_v2()]. int sqlite3_wal_checkpoint( ffi.Pointer db, - ffi.Pointer zDb, + ffi.Pointer zDb, ) { return _sqlite3_wal_checkpoint( db, @@ -9963,10 +9900,10 @@ class SQLite { late final _sqlite3_wal_checkpointPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_wal_checkpoint'); - late final _sqlite3_wal_checkpoint = _sqlite3_wal_checkpointPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_wal_checkpoint'); + late final _sqlite3_wal_checkpoint = _sqlite3_wal_checkpointPtr + .asFunction, ffi.Pointer)>(); /// CAPI3REF: Checkpoint a database /// METHOD: sqlite3 @@ -10060,10 +9997,10 @@ class SQLite { /// from SQL. int sqlite3_wal_checkpoint_v2( ffi.Pointer db, - ffi.Pointer zDb, + ffi.Pointer zDb, int eMode, - ffi.Pointer pnLog, - ffi.Pointer pnCkpt, + ffi.Pointer pnLog, + ffi.Pointer pnCkpt, ) { return _sqlite3_wal_checkpoint_v2( db, @@ -10076,16 +10013,16 @@ class SQLite { late final _sqlite3_wal_checkpoint_v2Ptr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer, - ffi.Pointer)>>('sqlite3_wal_checkpoint_v2'); + ffi.Pointer, + ffi.Int, + ffi.Pointer, + ffi.Pointer)>>('sqlite3_wal_checkpoint_v2'); late final _sqlite3_wal_checkpoint_v2 = _sqlite3_wal_checkpoint_v2Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Virtual Table Interface Configuration /// @@ -10114,9 +10051,8 @@ class SQLite { } late final _sqlite3_vtab_configPtr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, pkg_ffi.Int)>>('sqlite3_vtab_config'); + ffi.NativeFunction, ffi.Int)>>( + 'sqlite3_vtab_config'); late final _sqlite3_vtab_config = _sqlite3_vtab_configPtr .asFunction, int)>(); @@ -10137,7 +10073,7 @@ class SQLite { } late final _sqlite3_vtab_on_conflictPtr = - _lookup)>>( + _lookup)>>( 'sqlite3_vtab_on_conflict'); late final _sqlite3_vtab_on_conflict = _sqlite3_vtab_on_conflictPtr .asFunction)>(); @@ -10166,9 +10102,8 @@ class SQLite { } late final _sqlite3_vtab_nochangePtr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer)>>('sqlite3_vtab_nochange'); + ffi.NativeFunction)>>( + 'sqlite3_vtab_nochange'); late final _sqlite3_vtab_nochange = _sqlite3_vtab_nochangePtr .asFunction)>(); @@ -10183,7 +10118,7 @@ class SQLite { /// structure passed to xBestIndex. This function returns a pointer to a buffer /// containing the name of the collation sequence for the corresponding /// constraint. - ffi.Pointer sqlite3_vtab_collation( + ffi.Pointer sqlite3_vtab_collation( ffi.Pointer arg0, int arg1, ) { @@ -10195,11 +10130,10 @@ class SQLite { late final _sqlite3_vtab_collationPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - pkg_ffi.Int)>>('sqlite3_vtab_collation'); + ffi.Pointer Function(ffi.Pointer, + ffi.Int)>>('sqlite3_vtab_collation'); late final _sqlite3_vtab_collation = _sqlite3_vtab_collationPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: Prepared Statement Scan Status /// METHOD: sqlite3_stmt @@ -10246,8 +10180,8 @@ class SQLite { late final _sqlite3_stmt_scanstatusPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, - pkg_ffi.Int, ffi.Pointer)>>('sqlite3_stmt_scanstatus'); + ffi.Int Function(ffi.Pointer, ffi.Int, ffi.Int, + ffi.Pointer)>>('sqlite3_stmt_scanstatus'); late final _sqlite3_stmt_scanstatus = _sqlite3_stmt_scanstatusPtr.asFunction< int Function( ffi.Pointer, int, int, ffi.Pointer)>(); @@ -10310,7 +10244,7 @@ class SQLite { } late final _sqlite3_db_cacheflushPtr = - _lookup)>>( + _lookup)>>( 'sqlite3_db_cacheflush'); late final _sqlite3_db_cacheflush = _sqlite3_db_cacheflushPtr .asFunction)>(); @@ -10332,7 +10266,7 @@ class SQLite { } late final _sqlite3_system_errnoPtr = - _lookup)>>( + _lookup)>>( 'sqlite3_system_errno'); late final _sqlite3_system_errno = _sqlite3_system_errnoPtr.asFunction)>(); @@ -10380,7 +10314,7 @@ class SQLite { /// [SQLITE_ENABLE_SNAPSHOT] compile-time option is used. int sqlite3_snapshot_get( ffi.Pointer db, - ffi.Pointer zSchema, + ffi.Pointer zSchema, ffi.Pointer> ppSnapshot, ) { return _sqlite3_snapshot_get( @@ -10392,13 +10326,11 @@ class SQLite { late final _sqlite3_snapshot_getPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, - ffi.Pointer, + ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer>)>>( 'sqlite3_snapshot_get'); late final _sqlite3_snapshot_get = _sqlite3_snapshot_getPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, + int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer>)>(); /// CAPI3REF: Start a read transaction on an historical snapshot @@ -10444,7 +10376,7 @@ class SQLite { /// [SQLITE_ENABLE_SNAPSHOT] compile-time option is used. int sqlite3_snapshot_open( ffi.Pointer db, - ffi.Pointer zSchema, + ffi.Pointer zSchema, ffi.Pointer pSnapshot, ) { return _sqlite3_snapshot_open( @@ -10456,10 +10388,10 @@ class SQLite { late final _sqlite3_snapshot_openPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('sqlite3_snapshot_open'); late final _sqlite3_snapshot_open = _sqlite3_snapshot_openPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, + int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Destroy a snapshot @@ -10520,7 +10452,7 @@ class SQLite { late final _sqlite3_snapshot_cmpPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, + ffi.Int Function(ffi.Pointer, ffi.Pointer)>>('sqlite3_snapshot_cmp'); late final _sqlite3_snapshot_cmp = _sqlite3_snapshot_cmpPtr.asFunction< int Function( @@ -10549,7 +10481,7 @@ class SQLite { /// [SQLITE_ENABLE_SNAPSHOT] option. int sqlite3_snapshot_recover( ffi.Pointer db, - ffi.Pointer zDb, + ffi.Pointer zDb, ) { return _sqlite3_snapshot_recover( db, @@ -10559,11 +10491,10 @@ class SQLite { late final _sqlite3_snapshot_recoverPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('sqlite3_snapshot_recover'); - late final _sqlite3_snapshot_recover = - _sqlite3_snapshot_recoverPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_snapshot_recover'); + late final _sqlite3_snapshot_recover = _sqlite3_snapshot_recoverPtr + .asFunction, ffi.Pointer)>(); /// CAPI3REF: Serialize a database /// @@ -10599,9 +10530,9 @@ class SQLite { /// /// This interface is only available if SQLite is compiled with the /// [SQLITE_ENABLE_DESERIALIZE] option. - ffi.Pointer sqlite3_serialize( + ffi.Pointer sqlite3_serialize( ffi.Pointer db, - ffi.Pointer zSchema, + ffi.Pointer zSchema, ffi.Pointer piSize, int mFlags, ) { @@ -10615,14 +10546,14 @@ class SQLite { late final _sqlite3_serializePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - pkg_ffi.UnsignedInt)>>('sqlite3_serialize'); + ffi.UnsignedInt)>>('sqlite3_serialize'); late final _sqlite3_serialize = _sqlite3_serializePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); /// CAPI3REF: Deserialize a database /// @@ -10653,8 +10584,8 @@ class SQLite { /// [SQLITE_ENABLE_DESERIALIZE] option. int sqlite3_deserialize( ffi.Pointer db, - ffi.Pointer zSchema, - ffi.Pointer pData, + ffi.Pointer zSchema, + ffi.Pointer pData, int szDb, int szBuf, int mFlags, @@ -10671,16 +10602,16 @@ class SQLite { late final _sqlite3_deserializePtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, sqlite3_int64, sqlite3_int64, - pkg_ffi.UnsignedInt)>>('sqlite3_deserialize'); + ffi.UnsignedInt)>>('sqlite3_deserialize'); late final _sqlite3_deserialize = _sqlite3_deserializePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, int)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, int)>(); /// Register a geometry callback named zGeom that can be used as part of an /// R-Tree geometry query as follows: @@ -10688,14 +10619,11 @@ class SQLite { /// SELECT ... FROM WHERE MATCH $zGeom(... params ...) int sqlite3_rtree_geometry_callback( ffi.Pointer db, - ffi.Pointer zGeom, + ffi.Pointer zGeom, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer, - ffi.Pointer)>> + ffi.Int Function(ffi.Pointer, ffi.Int, + ffi.Pointer, ffi.Pointer)>> xGeom, ffi.Pointer pContext, ) { @@ -10709,29 +10637,29 @@ class SQLite { late final _sqlite3_rtree_geometry_callbackPtr = _lookup< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer, - ffi.Pointer)>>, + ffi.Pointer)>>, ffi.Pointer)>>('sqlite3_rtree_geometry_callback'); late final _sqlite3_rtree_geometry_callback = _sqlite3_rtree_geometry_callbackPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer, - ffi.Pointer)>>, + ffi.Pointer)>>, ffi.Pointer)>(); /// Register a 2nd-generation geometry callback named zScore that can be @@ -10740,10 +10668,10 @@ class SQLite { /// SELECT ... FROM WHERE MATCH $zQueryFunc(... params ...) int sqlite3_rtree_query_callback( ffi.Pointer db, - ffi.Pointer zQueryFunc, + ffi.Pointer zQueryFunc, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer)>> + ffi.Int Function(ffi.Pointer)>> xQueryFunc, ffi.Pointer pContext, ffi.Pointer)>> @@ -10758,29 +10686,29 @@ class SQLite { ); } - late final _sqlite3_rtree_query_callbackPtr = _lookup< - ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer)>>, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>)>>( - 'sqlite3_rtree_query_callback'); + late final _sqlite3_rtree_query_callbackPtr = + _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer)>>, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( + 'sqlite3_rtree_query_callback'); late final _sqlite3_rtree_query_callback = _sqlite3_rtree_query_callbackPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer)>>, + ffi.Int Function(ffi.Pointer)>>, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< @@ -10802,72 +10730,64 @@ class sqlite3_api_routines extends ffi.Opaque {} class sqlite3_vfs extends ffi.Struct { /// Structure version number (currently 3) - @pkg_ffi.Int() + @ffi.Int() external int iVersion; /// Size of subclassed sqlite3_file - @pkg_ffi.Int() + @ffi.Int() external int szOsFile; /// Maximum file pathname length - @pkg_ffi.Int() + @ffi.Int() external int mxPathname; /// Next registered VFS external ffi.Pointer pNext; /// Name of this virtual file system - external ffi.Pointer zName; + external ffi.Pointer zName; /// Pointer to application-specific data external ffi.Pointer pAppData; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer)>> xOpen; + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int, ffi.Pointer)>> xOpen; external ffi.Pointer< - ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Int)>> xDelete; + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer, ffi.Int)>> + xDelete; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer)>> xAccess; + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int, ffi.Pointer)>> xAccess; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer)>> xFullPathname; + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int, ffi.Pointer)>> xFullPathname; external ffi.Pointer< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>> xDlOpen; + ffi.Pointer, ffi.Pointer)>> xDlOpen; external ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, pkg_ffi.Int, - ffi.Pointer)>> xDlError; + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Int, ffi.Pointer)>> + xDlError; external ffi.Pointer< ffi.NativeFunction< ffi.Pointer> Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer)>> xDlSym; + ffi.Pointer)>> xDlSym; external ffi.Pointer< ffi.NativeFunction< @@ -10875,29 +10795,31 @@ class sqlite3_vfs extends ffi.Struct { ffi.Pointer, ffi.Pointer)>> xDlClose; external ffi.Pointer< - ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, - ffi.Pointer)>> xRandomness; + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Int, ffi.Pointer)>> + xRandomness; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int)>> xSleep; + ffi.Int Function(ffi.Pointer, ffi.Int)>> xSleep; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, ffi.Pointer)>> xCurrentTime; external ffi.Pointer< - ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, - ffi.Pointer)>> xGetLastError; + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Int, ffi.Pointer)>> + xGetLastError; /// The methods above are in version 1 of the sqlite_vfs object /// definition. Those that follow are added in version 2 or later external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, ffi.Pointer)>> xCurrentTimeInt64; @@ -10905,31 +10827,31 @@ class sqlite3_vfs extends ffi.Struct { /// Those below are for version 3 and greater. external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, - ffi.Pointer, sqlite3_syscall_ptr)>> xSetSystemCall; + ffi.Int Function(ffi.Pointer, ffi.Pointer, + sqlite3_syscall_ptr)>> xSetSystemCall; external ffi.Pointer< - ffi.NativeFunction< - sqlite3_syscall_ptr Function( - ffi.Pointer, ffi.Pointer)>> - xGetSystemCall; + ffi.NativeFunction< + sqlite3_syscall_ptr Function( + ffi.Pointer, ffi.Pointer)>> xGetSystemCall; external ffi.Pointer< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>> + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>> xNextSystemCall; } typedef sqlite3_int64 = sqlite_int64; -typedef sqlite_int64 = pkg_ffi.LongLong; +typedef sqlite_int64 = ffi.LongLong; typedef sqlite3_syscall_ptr = ffi.Pointer>; class sqlite3_mem_methods extends ffi.Struct { /// Memory allocation function - external ffi.Pointer< - ffi.NativeFunction Function(pkg_ffi.Int)>> xMalloc; + external ffi + .Pointer Function(ffi.Int)>> + xMalloc; /// Free a prior allocation external ffi @@ -10938,21 +10860,22 @@ class sqlite3_mem_methods extends ffi.Struct { /// Resize an allocation external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, pkg_ffi.Int)>> xRealloc; + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Int)>> + xRealloc; /// Return the size of an allocation - external ffi.Pointer< - ffi.NativeFunction)>> xSize; + external ffi + .Pointer)>> + xSize; /// Round up request size to allocation size - external ffi.Pointer> - xRoundup; + external ffi.Pointer> xRoundup; /// Initialize the memory allocator - external ffi.Pointer< - ffi.NativeFunction)>> xInit; + external ffi + .Pointer)>> + xInit; /// Deinitialize the memory allocator external ffi @@ -10964,7 +10887,7 @@ class sqlite3_mem_methods extends ffi.Struct { } typedef sqlite3_uint64 = sqlite_uint64; -typedef sqlite_uint64 = pkg_ffi.UnsignedLongLong; +typedef sqlite_uint64 = ffi.UnsignedLongLong; class sqlite3_stmt extends ffi.Opaque {} @@ -10993,11 +10916,11 @@ class sqlite3_vtab extends ffi.Struct { external ffi.Pointer pModule; /// Number of open cursors - @pkg_ffi.Int() + @ffi.Int() external int nRef; /// Error message from sqlite3_mprintf() - external ffi.Pointer zErrMsg; + external ffi.Pointer zErrMsg; } /// CAPI3REF: Virtual Table Object @@ -11015,144 +10938,137 @@ class sqlite3_vtab extends ffi.Struct { /// of this structure must not change while it is registered with /// any database connection. class sqlite3_module extends ffi.Struct { - @pkg_ffi.Int() + @ffi.Int() external int iVersion; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer>, + ffi.Int, + ffi.Pointer>, ffi.Pointer>, - ffi.Pointer>)>> xCreate; + ffi.Pointer>)>> xCreate; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer>, + ffi.Int, + ffi.Pointer>, ffi.Pointer>, - ffi.Pointer>)>> xConnect; + ffi.Pointer>)>> xConnect; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, ffi.Pointer)>> xBestIndex; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction)>> xDisconnect; external ffi.Pointer< - ffi.NativeFunction)>> - xDestroy; + ffi.NativeFunction)>> xDestroy; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, + ffi.Int Function(ffi.Pointer, ffi.Pointer>)>> xOpen; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer)>> xClose; + ffi.Int Function(ffi.Pointer)>> xClose; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer, - pkg_ffi.Int, + ffi.Int, + ffi.Pointer, + ffi.Int, ffi.Pointer>)>> xFilter; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer)>> xNext; + ffi.Int Function(ffi.Pointer)>> xNext; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer)>> xEof; + ffi.Int Function(ffi.Pointer)>> xEof; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Int)>> xColumn; + ffi.Int Function(ffi.Pointer, + ffi.Pointer, ffi.Int)>> xColumn; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, + ffi.Int Function(ffi.Pointer, ffi.Pointer)>> xRowid; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer>, ffi.Pointer)>> xUpdate; external ffi.Pointer< - ffi.NativeFunction)>> - xBegin; + ffi.NativeFunction)>> xBegin; external ffi.Pointer< - ffi.NativeFunction)>> - xSync; + ffi.NativeFunction)>> xSync; external ffi.Pointer< - ffi.NativeFunction)>> - xCommit; + ffi.NativeFunction)>> xCommit; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction)>> xRollback; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer, + ffi.Int, + ffi.Pointer, ffi.Pointer< ffi.Pointer< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer>)>>>, ffi.Pointer>)>> xFindFunction; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, ffi.Pointer)>> xRename; + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>> xRename; /// The methods above are in version 1 of the sqlite_module object. Those /// below are for version 2 and greater. external ffi.Pointer< - ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int)>> - xSavepoint; + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Int)>> xSavepoint; external ffi.Pointer< - ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int)>> - xRelease; + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Int)>> xRelease; external ffi.Pointer< - ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int)>> - xRollbackTo; + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Int)>> xRollbackTo; /// The methods above are in versions 1 and 2 of the sqlite_module object. /// Those below are for version 3 and greater. - external ffi.Pointer< - ffi.NativeFunction)>> + external ffi + .Pointer)>> xShadowName; } @@ -11258,14 +11174,14 @@ class sqlite3_module extends ffi.Struct { /// 3009000. class sqlite3_index_info extends ffi.Struct { /// Number of entries in aConstraint - @pkg_ffi.Int() + @ffi.Int() external int nConstraint; /// Table of WHERE clause constraints external ffi.Pointer aConstraint; /// Number of terms in the ORDER BY clause - @pkg_ffi.Int() + @ffi.Int() external int nOrderBy; /// The ORDER BY clause @@ -11274,18 +11190,18 @@ class sqlite3_index_info extends ffi.Struct { external ffi.Pointer aConstraintUsage; /// Number used to identify the index - @pkg_ffi.Int() + @ffi.Int() external int idxNum; /// String, possibly obtained from sqlite3_malloc - external ffi.Pointer idxStr; + external ffi.Pointer idxStr; /// Free idxStr using sqlite3_free() if true - @pkg_ffi.Int() + @ffi.Int() external int needToFreeIdxStr; /// True if output is already ordered - @pkg_ffi.Int() + @ffi.Int() external int orderByConsumed; /// Estimated cost of using this index @@ -11297,7 +11213,7 @@ class sqlite3_index_info extends ffi.Struct { external int estimatedRows; /// Mask of SQLITE_INDEX_SCAN_* flags - @pkg_ffi.Int() + @ffi.Int() external int idxFlags; /// Input: Mask of columns used by statement @@ -11307,40 +11223,40 @@ class sqlite3_index_info extends ffi.Struct { class sqlite3_index_constraint extends ffi.Struct { /// Column constrained. -1 for ROWID - @pkg_ffi.Int() + @ffi.Int() external int iColumn; /// Constraint operator - @pkg_ffi.UnsignedChar() + @ffi.UnsignedChar() external int op; /// True if this constraint is usable - @pkg_ffi.UnsignedChar() + @ffi.UnsignedChar() external int usable; /// Used internally - xBestIndex should ignore - @pkg_ffi.Int() + @ffi.Int() external int iTermOffset; } class sqlite3_index_orderby extends ffi.Struct { /// Column number - @pkg_ffi.Int() + @ffi.Int() external int iColumn; /// True for DESC. False for ASC. - @pkg_ffi.UnsignedChar() + @ffi.UnsignedChar() external int desc; } /// Outputs class sqlite3_index_constraint_usage extends ffi.Struct { /// if >0, constraint is part of argv to xFilter - @pkg_ffi.Int() + @ffi.Int() external int argvIndex; /// Do not code a test for this constraint - @pkg_ffi.UnsignedChar() + @ffi.UnsignedChar() external int omit; } @@ -11367,12 +11283,12 @@ class sqlite3_vtab_cursor extends ffi.Struct { class sqlite3_blob extends ffi.Opaque {} class sqlite3_mutex_methods extends ffi.Struct { - external ffi.Pointer> xMutexInit; + external ffi.Pointer> xMutexInit; - external ffi.Pointer> xMutexEnd; + external ffi.Pointer> xMutexEnd; external ffi.Pointer< - ffi.NativeFunction Function(pkg_ffi.Int)>> + ffi.NativeFunction Function(ffi.Int)>> xMutexAlloc; external ffi.Pointer< @@ -11384,7 +11300,7 @@ class sqlite3_mutex_methods extends ffi.Struct { xMutexEnter; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction)>> xMutexTry; external ffi.Pointer< @@ -11392,11 +11308,11 @@ class sqlite3_mutex_methods extends ffi.Struct { xMutexLeave; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction)>> xMutexHeld; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction)>> xMutexNotheld; } @@ -11413,54 +11329,54 @@ class sqlite3_pcache_page extends ffi.Struct { } class sqlite3_pcache_methods2 extends ffi.Struct { - @pkg_ffi.Int() + @ffi.Int() external int iVersion; external ffi.Pointer pArg; - external ffi.Pointer< - ffi.NativeFunction)>> xInit; + external ffi + .Pointer)>> + xInit; external ffi .Pointer)>> xShutdown; external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - pkg_ffi.Int, pkg_ffi.Int, pkg_ffi.Int)>> xCreate; + ffi.NativeFunction< + ffi.Pointer Function(ffi.Int, ffi.Int, ffi.Int)>> + xCreate; external ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, pkg_ffi.Int)>> - xCachesize; + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int)>> xCachesize; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction)>> xPagecount; external ffi.Pointer< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - pkg_ffi.UnsignedInt, pkg_ffi.Int)>> xFetch; + ffi.Pointer Function( + ffi.Pointer, ffi.UnsignedInt, ffi.Int)>> xFetch; external ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - ffi.Pointer, pkg_ffi.Int)>> xUnpin; + ffi.Pointer, ffi.Int)>> xUnpin; external ffi.Pointer< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, - pkg_ffi.UnsignedInt, - pkg_ffi.UnsignedInt)>> xRekey; + ffi.UnsignedInt, + ffi.UnsignedInt)>> xRekey; external ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, pkg_ffi.UnsignedInt)>> xTruncate; + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.UnsignedInt)>> + xTruncate; external ffi.Pointer< ffi.NativeFunction)>> @@ -11474,46 +11390,46 @@ class sqlite3_pcache_methods2 extends ffi.Struct { class sqlite3_pcache_methods extends ffi.Struct { external ffi.Pointer pArg; - external ffi.Pointer< - ffi.NativeFunction)>> xInit; + external ffi + .Pointer)>> + xInit; external ffi .Pointer)>> xShutdown; external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(pkg_ffi.Int, pkg_ffi.Int)>> - xCreate; + ffi.NativeFunction< + ffi.Pointer Function(ffi.Int, ffi.Int)>> xCreate; external ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, pkg_ffi.Int)>> - xCachesize; + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int)>> xCachesize; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction)>> xPagecount; external ffi.Pointer< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - pkg_ffi.UnsignedInt, pkg_ffi.Int)>> xFetch; + ffi.Pointer Function( + ffi.Pointer, ffi.UnsignedInt, ffi.Int)>> xFetch; external ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.Int)>> xUnpin; + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer, ffi.Int)>> + xUnpin; external ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, - pkg_ffi.UnsignedInt, pkg_ffi.UnsignedInt)>> xRekey; + ffi.UnsignedInt, ffi.UnsignedInt)>> xRekey; external ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, pkg_ffi.UnsignedInt)>> xTruncate; + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.UnsignedInt)>> + xTruncate; external ffi.Pointer< ffi.NativeFunction)>> @@ -11542,7 +11458,7 @@ class sqlite3_backup extends ffi.Opaque {} /// the most recent version. class sqlite3_snapshot extends ffi.Struct { @ffi.Array.multi([48]) - external ffi.Array hidden; + external ffi.Array hidden; } /// A pointer to a structure of the following type is passed as the first @@ -11552,7 +11468,7 @@ class sqlite3_rtree_geometry extends ffi.Struct { external ffi.Pointer pContext; /// Size of array aParam[] - @pkg_ffi.Int() + @ffi.Int() external int nParam; /// Parameters passed to SQL geom function @@ -11581,7 +11497,7 @@ class sqlite3_rtree_query_info extends ffi.Struct { external ffi.Pointer pContext; /// Number of function parameters - @pkg_ffi.Int() + @ffi.Int() external int nParam; /// value of function parameters @@ -11599,18 +11515,18 @@ class sqlite3_rtree_query_info extends ffi.Struct { external ffi.Pointer aCoord; /// Number of pending entries in the queue - external ffi.Pointer anQueue; + external ffi.Pointer anQueue; /// Number of coordinates - @pkg_ffi.Int() + @ffi.Int() external int nCoord; /// Level of current node or entry - @pkg_ffi.Int() + @ffi.Int() external int iLevel; /// The largest iLevel value in the tree - @pkg_ffi.Int() + @ffi.Int() external int mxLevel; /// Rowid for current entry @@ -11622,11 +11538,11 @@ class sqlite3_rtree_query_info extends ffi.Struct { external double rParentScore; /// Visibility of parent node - @pkg_ffi.Int() + @ffi.Int() external int eParentWithin; /// OUT: Visibility - @pkg_ffi.Int() + @ffi.Int() external int eWithin; /// OUT: Write the score here @@ -11848,7 +11764,7 @@ class sqlite3_rtree_query_info extends ffi.Struct { /// See xPhraseFirstColumn above. class Fts5ExtensionApi extends ffi.Struct { /// Currently always set to 3 - @pkg_ffi.Int() + @ffi.Int() external int iVersion; external ffi.Pointer< @@ -11856,58 +11772,57 @@ class Fts5ExtensionApi extends ffi.Struct { ffi.Pointer Function(ffi.Pointer)>> xUserData; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction)>> xColumnCount; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, ffi.Pointer)>> xRowCount; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, + ffi.Int Function(ffi.Pointer, ffi.Int, ffi.Pointer)>> xColumnTotalSize; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - ffi.Pointer, - pkg_ffi.Int, + ffi.Pointer, + ffi.Int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer, - pkg_ffi.Int, - pkg_ffi.Int, - pkg_ffi.Int)>>)>> xTokenize; + ffi.Int, + ffi.Pointer, + ffi.Int, + ffi.Int, + ffi.Int)>>)>> xTokenize; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction)>> xPhraseCount; external ffi.Pointer< - ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int)>> - xPhraseSize; + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Int)>> xPhraseSize; external ffi.Pointer< - ffi.NativeFunction< - pkg_ffi.Int Function( - ffi.Pointer, ffi.Pointer)>> xInstCount; + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Pointer)>> + xInstCount; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>> xInst; + ffi.Int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>> xInst; external ffi.Pointer< ffi.NativeFunction)>> @@ -11915,33 +11830,34 @@ class Fts5ExtensionApi extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer>, - ffi.Pointer)>> xColumnText; + ffi.Int, + ffi.Pointer>, + ffi.Pointer)>> xColumnText; external ffi.Pointer< - ffi.NativeFunction< - pkg_ffi.Int Function(ffi.Pointer, pkg_ffi.Int, - ffi.Pointer)>> xColumnSize; + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Int, ffi.Pointer)>> + xColumnSize; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>>)>> xQueryPhrase; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, ffi.Pointer, ffi.Pointer< @@ -11951,47 +11867,47 @@ class Fts5ExtensionApi extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, pkg_ffi.Int)>> xGetAuxdata; + ffi.Pointer, ffi.Int)>> xGetAuxdata; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>> xPhraseFirst; + ffi.Pointer, + ffi.Pointer)>> xPhraseFirst; external ffi.Pointer< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>> xPhraseNext; + ffi.Pointer, + ffi.Pointer)>> xPhraseNext; external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer, - ffi.Pointer)>> xPhraseFirstColumn; + ffi.Pointer)>> xPhraseFirstColumn; external ffi.Pointer< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer)>> xPhraseNextColumn; + ffi.Pointer)>> xPhraseNextColumn; } class Fts5Context extends ffi.Opaque {} class Fts5PhraseIter extends ffi.Struct { - external ffi.Pointer a; + external ffi.Pointer a; - external ffi.Pointer b; + external ffi.Pointer b; } class Fts5Tokenizer extends ffi.Opaque {} @@ -11999,10 +11915,10 @@ class Fts5Tokenizer extends ffi.Opaque {} class fts5_tokenizer extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - ffi.Pointer>, - pkg_ffi.Int, + ffi.Pointer>, + ffi.Int, ffi.Pointer>)>> xCreate; external ffi.Pointer< @@ -12011,34 +11927,34 @@ class fts5_tokenizer extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer, - pkg_ffi.Int, + ffi.Int, + ffi.Pointer, + ffi.Int, ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - pkg_ffi.Int, - ffi.Pointer, - pkg_ffi.Int, - pkg_ffi.Int, - pkg_ffi.Int)>>)>> xTokenize; + ffi.Int, + ffi.Pointer, + ffi.Int, + ffi.Int, + ffi.Int)>>)>> xTokenize; } class fts5_api extends ffi.Struct { /// Currently always set to 2 - @pkg_ffi.Int() + @ffi.Int() external int iVersion; /// Create a new tokenizer external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer< @@ -12049,18 +11965,18 @@ class fts5_api extends ffi.Struct { /// Find an existing tokenizer external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer>, ffi.Pointer)>> xFindTokenizer; /// Create a new auxiliary function external ffi.Pointer< ffi.NativeFunction< - pkg_ffi.Int Function( + ffi.Int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, fts5_extension_function, ffi.Pointer< @@ -12075,7 +11991,7 @@ typedef fts5_extension_function = ffi.Pointer< ffi.Pointer, ffi.Pointer, ffi.Pointer, - pkg_ffi.Int, + ffi.Int, ffi.Pointer>)>>; const String SQLITE_VERSION = '3.32.3'; diff --git a/pkgs/ffigen/test/native_test/native_test_bindings.dart b/pkgs/ffigen/test/native_test/native_test_bindings.dart index 70e877574a..8ca13effc7 100644 --- a/pkgs/ffigen/test/native_test/native_test_bindings.dart +++ b/pkgs/ffigen/test/native_test/native_test_bindings.dart @@ -4,7 +4,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; /// Native tests. class NativeLibrary { @@ -210,10 +209,9 @@ class NativeLibrary { ); } - late final _Function1StructReturnByValuePtr = _lookup< - ffi.NativeFunction< - Struct3 Function(pkg_ffi.Int, pkg_ffi.Int, - pkg_ffi.Int)>>('Function1StructReturnByValue'); + late final _Function1StructReturnByValuePtr = + _lookup>( + 'Function1StructReturnByValue'); late final _Function1StructReturnByValue = _Function1StructReturnByValuePtr .asFunction(); @@ -226,7 +224,7 @@ class NativeLibrary { } late final _Function1StructPassByValuePtr = - _lookup>( + _lookup>( 'Function1StructPassByValue'); late final _Function1StructPassByValue = _Function1StructPassByValuePtr.asFunction(); @@ -241,12 +239,12 @@ class Struct1 extends ffi.Struct { } class Struct3 extends ffi.Struct { - @pkg_ffi.Int() + @ffi.Int() external int a; - @pkg_ffi.Int() + @ffi.Int() external int b; - @pkg_ffi.Int() + @ffi.Int() external int c; } diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index ccc6b46f60..ad0bfd048e 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -116,3 +116,4 @@ functions: - clang_Cursor_getObjCPropertyGetterName - clang_Cursor_getObjCPropertySetterName - clang_Type_getNullability + - clang_Location_isInSystemHeader From 2a05b4f1dc8b9b6d509f0157c0461d29031bfaa0 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 12 May 2022 18:26:35 +0200 Subject: [PATCH 140/276] [ffigen] Mention ObjectiveC support in changelog (#366) --- pkgs/ffigen/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index ccb4635fa4..6cae5fb440 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,6 +1,8 @@ ## 5.0.0 - Stable release targeting Dart 2.17, supporting ABI-specific integer types. +- _EXPERIMENTAL_ support for ObjectiveC on MacOS hosts. The API and output + might change at any point. Feel free to report bugs if encountered. # 5.0.0-dev.1 - Fixed invalid default dart types being generated for `size_t` and `wchar_t`. From 04332defa8f5109d539c82922afcb55ca4853f28 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 12 May 2022 19:21:29 +0200 Subject: [PATCH 141/276] [ffigen] Update pubspec of examples (#367) --- pkgs/ffigen/example/c_json/pubspec.yaml | 4 ++-- pkgs/ffigen/example/libclang-example/pubspec.yaml | 4 ++-- pkgs/ffigen/example/simple/pubspec.yaml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index 9493d21057..4a29269987 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -5,10 +5,10 @@ name: c_json_example environment: - sdk: '>=2.13.0 <3.0.0' + sdk: '>=2.17.0 <3.0.0' dependencies: - ffi: ^1.2.0-dev.0 + ffi: ^1.1.2 path: ^1.8.0 dev_dependencies: diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index 4a0829b607..692c26c331 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -5,10 +5,10 @@ name: libclang_example environment: - sdk: '>=2.16.0-124.0.dev <3.0.0' + sdk: '>=2.17.0 <3.0.0' dependencies: - ffi: ^1.2.0-dev.0 + ffi: ^1.1.2 dev_dependencies: ffigen: path: '../../' diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index b7b8823c0f..f55489d5f3 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -5,10 +5,10 @@ name: simple_example environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.17.0 <3.0.0' dependencies: - ffi: ^1.2.0-dev.0 + ffi: ^1.1.2 dev_dependencies: ffigen: path: '../../' From 383859ae45779b9c1bb91dc5e7a964b2a2d97c61 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 12 May 2022 19:33:35 +0200 Subject: [PATCH 142/276] [ffigen] Cleanup some code around ObjC goldens (#368) --- pkgs/ffigen/analysis_options.yaml | 2 + pkgs/ffigen/test/native_objc_test/setup.dart | 67 +++++++++++++------- 2 files changed, 47 insertions(+), 22 deletions(-) diff --git a/pkgs/ffigen/analysis_options.yaml b/pkgs/ffigen/analysis_options.yaml index 06af095b2b..5028f95608 100644 --- a/pkgs/ffigen/analysis_options.yaml +++ b/pkgs/ffigen/analysis_options.yaml @@ -7,6 +7,8 @@ include: package:lints/recommended.yaml analyzer: exclude: - 'test/**_expected*' + # Goldens cannot be generated outside MacOS causing analysis errors. + - test/native_objc_test/** language: strict-casts: true strict-inference: true diff --git a/pkgs/ffigen/test/native_objc_test/setup.dart b/pkgs/ffigen/test/native_objc_test/setup.dart index c27604d5c0..5b170cc1e4 100644 --- a/pkgs/ffigen/test/native_objc_test/setup.dart +++ b/pkgs/ffigen/test/native_objc_test/setup.dart @@ -45,32 +45,55 @@ Future _generateBindings(String config) async { print('Generated bindings for: $config'); } +const testNames = [ + 'block', + 'cast', + 'category', + 'forward_decl', + 'method', + 'native_objc', + 'nullable', + 'property', + 'rename', + 'string', +]; + +Future build() async { + print('Building Dynamic Library for Objective C Native Tests...'); + for (final name in testNames) { + await _buildLib('${name}_test.m', '${name}_test.dylib'); + } + + print('Generating Bindings for Objective C Native Tests...'); + for (final name in testNames) { + await _generateBindings('${name}_config.yaml'); + } +} + +Future clean() async { + print('Deleting generated and built files...'); + final filenames = [ + for (final name in testNames) ...[ + '${name}_bindings.dart', + '${name}_test_bindings.dart', + '${name}_test.dylib' + ], + ]; + Future.wait(filenames.map((fileName) async { + final file = File(fileName); + final exists = await file.exists(); + if (exists) await file.delete(); + })); +} + Future main(List arguments) async { if (!Platform.isMacOS) { throw OSError('Objective C tests are only supported on MacOS'); } - print('Building Dynamic Library for Objective C Native Tests...'); - await _buildLib('native_objc_test.m', 'native_objc_test.dylib'); - await _buildLib('cast_test.m', 'cast_test.dylib'); - await _buildLib('category_test.m', 'category_test.dylib'); - await _buildLib('method_test.m', 'method_test.dylib'); - await _buildLib('nullable_test.m', 'nullable_test.dylib'); - await _buildLib('property_test.m', 'property_test.dylib'); - await _buildLib('forward_decl_test.m', 'forward_decl_test.dylib'); - await _buildLib('string_test.m', 'string_test.dylib'); - await _buildLib('block_test.m', 'block_test.dylib'); - await _buildLib('rename_test.m', 'rename_test.dylib'); + if (arguments.isNotEmpty && arguments[0] == 'clean') { + return await clean(); + } - print('Generating Bindings for Objective C Native Tests...'); - await _generateBindings('native_objc_config.yaml'); - await _generateBindings('cast_config.yaml'); - await _generateBindings('category_config.yaml'); - await _generateBindings('method_config.yaml'); - await _generateBindings('nullable_config.yaml'); - await _generateBindings('property_config.yaml'); - await _generateBindings('forward_decl_config.yaml'); - await _generateBindings('string_config.yaml'); - await _generateBindings('block_config.yaml'); - await _generateBindings('rename_config.yaml'); + return await build(); } From 01d9ba63fd3651402f767f02ed3f47ab64288307 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Thu, 12 May 2022 14:12:50 -0700 Subject: [PATCH 143/276] [ffigen] Fix coverage for ObjC tests (#370) * Fix coverage for ObjC test * Finish comment --- .../test/native_objc_test/block_test.dart | 2 ++ .../test/native_objc_test/cast_test.dart | 2 ++ .../test/native_objc_test/category_test.dart | 2 ++ .../native_objc_test/forward_decl_test.dart | 2 ++ .../test/native_objc_test/method_test.dart | 2 ++ .../native_objc_test/native_objc_test.dart | 2 ++ .../test/native_objc_test/nullable_test.dart | 2 ++ .../test/native_objc_test/property_test.dart | 2 ++ .../test/native_objc_test/rename_test.dart | 2 ++ .../test/native_objc_test/string_test.dart | 2 ++ pkgs/ffigen/test/native_objc_test/util.dart | 27 +++++++++++++++++++ 11 files changed, 47 insertions(+) create mode 100644 pkgs/ffigen/test/native_objc_test/util.dart diff --git a/pkgs/ffigen/test/native_objc_test/block_test.dart b/pkgs/ffigen/test/native_objc_test/block_test.dart index f0f3ac952b..188da1d680 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.dart +++ b/pkgs/ffigen/test/native_objc_test/block_test.dart @@ -11,6 +11,7 @@ import 'dart:io'; import 'package:test/test.dart'; import '../test_utils.dart'; import 'block_bindings.dart'; +import 'util.dart'; void main() { late BlockTestObjCLibrary lib; @@ -21,6 +22,7 @@ void main() { final dylib = File('test/native_objc_test/block_test.dylib'); verifySetupFile(dylib); lib = BlockTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); + generateBindingsForCoverage('block'); }); test('BlockTester is working', () { diff --git a/pkgs/ffigen/test/native_objc_test/cast_test.dart b/pkgs/ffigen/test/native_objc_test/cast_test.dart index 2b17174297..86ec0634d5 100644 --- a/pkgs/ffigen/test/native_objc_test/cast_test.dart +++ b/pkgs/ffigen/test/native_objc_test/cast_test.dart @@ -12,6 +12,7 @@ import 'dart:io'; import 'package:test/test.dart'; import '../test_utils.dart'; import 'cast_bindings.dart'; +import 'util.dart'; void main() { late Castaway testInstance; @@ -24,6 +25,7 @@ void main() { verifySetupFile(dylib); lib = CastTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); testInstance = Castaway.new1(lib); + generateBindingsForCoverage('cast'); }); test('castFrom', () { diff --git a/pkgs/ffigen/test/native_objc_test/category_test.dart b/pkgs/ffigen/test/native_objc_test/category_test.dart index 8d52f6fcc0..2dda7cf021 100644 --- a/pkgs/ffigen/test/native_objc_test/category_test.dart +++ b/pkgs/ffigen/test/native_objc_test/category_test.dart @@ -11,6 +11,7 @@ import 'dart:io'; import 'package:test/test.dart'; import '../test_utils.dart'; import 'category_bindings.dart'; +import 'util.dart'; void main() { late Thing testInstance; @@ -23,6 +24,7 @@ void main() { verifySetupFile(dylib); lib = CategoryTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); testInstance = Thing.new1(lib); + generateBindingsForCoverage('category'); }); test('Category method', () { diff --git a/pkgs/ffigen/test/native_objc_test/forward_decl_test.dart b/pkgs/ffigen/test/native_objc_test/forward_decl_test.dart index 197171e88d..4a06516589 100644 --- a/pkgs/ffigen/test/native_objc_test/forward_decl_test.dart +++ b/pkgs/ffigen/test/native_objc_test/forward_decl_test.dart @@ -11,6 +11,7 @@ import 'dart:io'; import 'package:test/test.dart'; import '../test_utils.dart'; import 'forward_decl_bindings.dart'; +import 'util.dart'; void main() { late ForwardDeclTestObjCLibrary lib; @@ -22,6 +23,7 @@ void main() { verifySetupFile(dylib); lib = ForwardDeclTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); + generateBindingsForCoverage('forward_decl'); }); test('Forward declared class', () { diff --git a/pkgs/ffigen/test/native_objc_test/method_test.dart b/pkgs/ffigen/test/native_objc_test/method_test.dart index e08d36b053..6ab2679603 100644 --- a/pkgs/ffigen/test/native_objc_test/method_test.dart +++ b/pkgs/ffigen/test/native_objc_test/method_test.dart @@ -11,6 +11,7 @@ import 'dart:io'; import 'package:test/test.dart'; import '../test_utils.dart'; import 'method_bindings.dart'; +import 'util.dart'; void main() { late MethodInterface testInstance; @@ -23,6 +24,7 @@ void main() { verifySetupFile(dylib); lib = MethodTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); testInstance = MethodInterface.new1(lib); + generateBindingsForCoverage('method'); }); group('Instance methods', () { diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart index 52b8b7836b..28c006a367 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart @@ -11,6 +11,7 @@ import 'dart:io'; import 'package:test/test.dart'; import '../test_utils.dart'; import 'native_objc_test_bindings.dart'; +import 'util.dart'; void main() { late NativeObjCLibrary lib; @@ -20,6 +21,7 @@ void main() { final dylib = File('test/native_objc_test/native_objc_test.dylib'); verifySetupFile(dylib); lib = NativeObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); + generateBindingsForCoverage('native_objc'); }); test('Basic types', () { diff --git a/pkgs/ffigen/test/native_objc_test/nullable_test.dart b/pkgs/ffigen/test/native_objc_test/nullable_test.dart index de6cc77db3..f2fbf744a7 100644 --- a/pkgs/ffigen/test/native_objc_test/nullable_test.dart +++ b/pkgs/ffigen/test/native_objc_test/nullable_test.dart @@ -11,6 +11,7 @@ import 'dart:io'; import 'package:test/test.dart'; import '../test_utils.dart'; import 'nullable_bindings.dart'; +import 'util.dart'; void main() { late NullableTestObjCLibrary lib; @@ -24,6 +25,7 @@ void main() { lib = NullableTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); nullableInterface = NullableInterface.new1(lib); obj = NSObject.new1(lib); + generateBindingsForCoverage('nullable'); }); group('Nullable property', () { diff --git a/pkgs/ffigen/test/native_objc_test/property_test.dart b/pkgs/ffigen/test/native_objc_test/property_test.dart index 1983256239..f38b04cb0a 100644 --- a/pkgs/ffigen/test/native_objc_test/property_test.dart +++ b/pkgs/ffigen/test/native_objc_test/property_test.dart @@ -11,6 +11,7 @@ import 'dart:io'; import 'package:test/test.dart'; import '../test_utils.dart'; import 'property_bindings.dart'; +import 'util.dart'; void main() { late PropertyInterface testInstance; @@ -23,6 +24,7 @@ void main() { verifySetupFile(dylib); lib = PropertyTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); testInstance = PropertyInterface.new1(lib); + generateBindingsForCoverage('property'); }); group('instance properties', () { diff --git a/pkgs/ffigen/test/native_objc_test/rename_test.dart b/pkgs/ffigen/test/native_objc_test/rename_test.dart index b4f74035d9..aa8a23f78d 100644 --- a/pkgs/ffigen/test/native_objc_test/rename_test.dart +++ b/pkgs/ffigen/test/native_objc_test/rename_test.dart @@ -11,6 +11,7 @@ import 'dart:io'; import 'package:test/test.dart'; import '../test_utils.dart'; import 'rename_test_bindings.dart'; +import 'util.dart'; void main() { late RenameLibrary lib; @@ -20,6 +21,7 @@ void main() { final dylib = File('test/native_objc_test/rename_test.dylib'); verifySetupFile(dylib); lib = RenameLibrary(DynamicLibrary.open(dylib.absolute.path)); + generateBindingsForCoverage('rename'); }); test('Renamed class', () { diff --git a/pkgs/ffigen/test/native_objc_test/string_test.dart b/pkgs/ffigen/test/native_objc_test/string_test.dart index 117088b62d..458621ed2b 100644 --- a/pkgs/ffigen/test/native_objc_test/string_test.dart +++ b/pkgs/ffigen/test/native_objc_test/string_test.dart @@ -11,6 +11,7 @@ import 'dart:io'; import 'package:test/test.dart'; import '../test_utils.dart'; import 'string_bindings.dart'; +import 'util.dart'; void main() { late StringTestObjCLibrary lib; @@ -21,6 +22,7 @@ void main() { final dylib = File('test/native_objc_test/string_test.dylib'); verifySetupFile(dylib); lib = StringTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); + generateBindingsForCoverage('string'); }); // TODO(#329): Add 'Embedded\u0000Null'. diff --git a/pkgs/ffigen/test/native_objc_test/util.dart b/pkgs/ffigen/test/native_objc_test/util.dart new file mode 100644 index 0000000000..1eb0746985 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/util.dart @@ -0,0 +1,27 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:io'; + +import 'package:ffigen/ffigen.dart'; +import 'package:path/path.dart' as path; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart'; + +void generateBindingsForCoverage(String testName) { + // The ObjC test bindings are generated in setup.dart (see #362), which means + // that the ObjC related bits of ffigen are missed by test coverage. So this + // function just regenerates those bindings. It doesn't test anything except + // that the generation succeeded, by asserting the file exists. + final config = Config.fromYaml(loadYaml( + File(path.join('test', 'native_objc_test', '${testName}_config.yaml')) + .readAsStringSync()) as YamlMap); + final library = parse(config); + final file = File( + path.join('test', 'debug_generated', '${testName}_test.dart'), + ); + library.generateFile(file); + assert(file.existsSync()); + file.delete(); +} From 7258410ab36efb3e2076647c4084fdfb123af4b8 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Fri, 13 May 2022 18:33:06 +0200 Subject: [PATCH 144/276] [ffigen] Use `package:ffi` 1.2.1 (#371) --- pkgs/ffigen/example/c_json/pubspec.yaml | 2 +- pkgs/ffigen/example/libclang-example/pubspec.yaml | 2 +- pkgs/ffigen/example/simple/pubspec.yaml | 2 +- pkgs/ffigen/pubspec.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index 4a29269987..fc21ca9a0f 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=2.17.0 <3.0.0' dependencies: - ffi: ^1.1.2 + ffi: ^1.2.1 path: ^1.8.0 dev_dependencies: diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index 692c26c331..cd3a1c3d02 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=2.17.0 <3.0.0' dependencies: - ffi: ^1.1.2 + ffi: ^1.2.1 dev_dependencies: ffigen: path: '../../' diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index f55489d5f3..8c45afc1a7 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=2.17.0 <3.0.0' dependencies: - ffi: ^1.1.2 + ffi: ^1.2.1 dev_dependencies: ffigen: path: '../../' diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 09dd6fb624..c054c5018b 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -11,7 +11,7 @@ environment: sdk: '>=2.17.0 <3.0.0' dependencies: - ffi: ^1.1.2 + ffi: ^1.2.1 yaml: ^3.0.0 path: ^1.8.0 quiver: ^3.0.0 From 6ba5f5c1511c051354f7965fc2165574ad57f4f1 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Fri, 20 May 2022 15:41:07 -0700 Subject: [PATCH 145/276] [ffigen] Automatic ref counting for ObjC objects (#372) * Infra for automatic memory management * Add (failing) auto ref count test * Fix the test * Fix analysis, and remove init ownership * Rename arc_test * Add a manual release function * More tests * Format * Give each test its own counter * Brian's comments --- pkgs/ffigen/lib/src/code_generator/func.dart | 3 +- .../objc_built_in_functions.dart | 71 ++++++++-- .../src/code_generator/objc_interface.dart | 53 ++++---- .../automated_ref_count_config.yaml | 12 ++ .../automated_ref_count_test.dart | 123 ++++++++++++++++++ .../automated_ref_count_test.m | 34 +++++ .../test/native_objc_test/cast_test.dart | 16 +-- .../test/native_objc_test/category_test.dart | 6 +- .../test/native_objc_test/method_test.dart | 10 +- .../test/native_objc_test/nullable_test.dart | 17 +-- .../test/native_objc_test/property_test.dart | 8 +- pkgs/ffigen/test/native_objc_test/setup.dart | 1 + 12 files changed, 287 insertions(+), 67 deletions(-) create mode 100644 pkgs/ffigen/test/native_objc_test/automated_ref_count_config.yaml create mode 100644 pkgs/ffigen/test/native_objc_test/automated_ref_count_test.dart create mode 100644 pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index 2f64de19d7..e0eb0cb6cf 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -31,6 +31,7 @@ class Func extends LookUpBinding { final bool exposeSymbolAddress; final bool exposeFunctionTypedefs; final bool isLeaf; + late final String funcPointerName; /// Contains typealias for function type if [exposeFunctionTypedefs] is true. Typealias? _exposedCFunctionTypealias; @@ -86,7 +87,7 @@ class Func extends LookUpBinding { final s = StringBuffer(); final enclosingFuncName = name; final funcVarName = w.wrapperLevelUniqueNamer.makeUnique('_$name'); - final funcPointerName = w.wrapperLevelUniqueNamer.makeUnique('_${name}Ptr'); + funcPointerName = w.wrapperLevelUniqueNamer.makeUnique('_${name}Ptr'); if (dartDoc != null) { s.write(makeDartDoc(dartDoc!)); diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index 23cbb7af9c..2c2644ef87 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -49,6 +49,27 @@ class ObjCBuiltInFunctions { return s.toString(); }); + late final _retainFunc = Func( + name: '_objc_retain', + originalName: 'objc_retain', + returnType: PointerType(objCObjectType), + parameters: [Parameter(name: 'value', type: PointerType(objCObjectType))], + isInternal: true, + ); + late final _releaseFunc = Func( + name: '_objc_release', + originalName: 'objc_release', + returnType: voidType, + parameters: [Parameter(name: 'value', type: PointerType(objCObjectType))], + isInternal: true, + ); + late final _releaseFinalizer = ObjCInternalGlobal( + '_objc_releaseFinalizer', + (Writer w) => '${w.ffiLibraryPrefix}.NativeFinalizer(' + '${_releaseFunc.funcPointerName}.cast())', + _releaseFunc, + ); + // We need to load a separate instance of objc_msgSend for each signature. final _msgSendFuncs = {}; Func getMsgSendFunc(Type returnType, List params) { @@ -72,9 +93,10 @@ class ObjCBuiltInFunctions { final _selObjects = {}; ObjCInternalGlobal getSelObject(String methodName) { return _selObjects[methodName] ??= ObjCInternalGlobal( - PointerType(objCSelType), - '_sel_${methodName.replaceAll(":", "_")}', - () => '${registerName.name}("$methodName")'); + '_sel_${methodName.replaceAll(":", "_")}', + (Writer w) => '${registerName.name}("$methodName")', + registerName, + ); } // See https://clang.llvm.org/docs/Block-ABI-Apple.html @@ -116,9 +138,9 @@ class ObjCBuiltInFunctions { return s.toString(); }); late final blockDescSingleton = ObjCInternalGlobal( - PointerType(blockDescStruct), '_objc_block_desc', - () => '${newBlockDesc.name}()', + (Writer w) => '${newBlockDesc.name}()', + blockDescStruct, ); late final newBlock = ObjCInternalFunction('_newBlock', null, (Writer w, String name) { @@ -144,11 +166,33 @@ class ObjCBuiltInFunctions { final objType = PointerType(objCObjectType).getCType(w); s.write(''' -class _ObjCWrapper { +class _ObjCWrapper implements ${w.ffiLibraryPrefix}.Finalizable { final $objType _id; final ${w.className} _lib; + bool _pendingRelease; - _ObjCWrapper._(this._id, this._lib); + _ObjCWrapper._(this._id, this._lib, + {bool retain = false, bool release = false}) : _pendingRelease = release { + if (retain) { + _lib.${_retainFunc.name}(_id); + } + if (release) { + _lib.${_releaseFinalizer.name}.attach(this, _id.cast(), detach: this); + } + } + + /// Releases the reference to the underlying ObjC object held by this wrapper. + /// Throws a StateError if this wrapper doesn't currently hold a reference. + void release() { + if (_pendingRelease) { + _pendingRelease = false; + _lib.${_releaseFunc.name}(_id); + _lib.${_releaseFinalizer.name}.detach(this); + } else { + throw StateError( + 'Released an ObjC object that was unowned or already released.'); + } + } @override bool operator ==(Object other) { @@ -164,6 +208,9 @@ class _ObjCWrapper { void addDependencies(Set dependencies) { registerName.addDependencies(dependencies); getClass.addDependencies(dependencies); + _retainFunc.addDependencies(dependencies); + _releaseFunc.addDependencies(dependencies); + _releaseFinalizer.addDependencies(dependencies); for (final func in _msgSendFuncs.values) { func.addDependencies(dependencies); } @@ -229,17 +276,17 @@ class ObjCInternalFunction extends LookUpBinding { /// Globals only used internally by ObjC bindings, such as classes and SELs. class ObjCInternalGlobal extends LookUpBinding { - final Type type; - final String Function() makeValue; + final String Function(Writer) makeValue; + Binding? binding; - ObjCInternalGlobal(this.type, String name, this.makeValue) + ObjCInternalGlobal(String name, this.makeValue, [this.binding]) : super(originalName: name, name: name, isInternal: true); @override BindingString toBindingString(Writer w) { final s = StringBuffer(); name = w.wrapperLevelUniqueNamer.makeUnique(name); - s.write('late final ${type.getCType(w)} $name = ${makeValue()};'); + s.write('late final $name = ${makeValue(w)};'); return BindingString(type: BindingStringType.global, string: s.toString()); } @@ -247,6 +294,6 @@ class ObjCInternalGlobal extends LookUpBinding { void addDependencies(Set dependencies) { if (dependencies.contains(this)) return; dependencies.add(this); - type.addDependencies(dependencies); + binding?.addDependencies(dependencies); } } diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index e92b4e398d..d8216e9ff2 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -82,27 +82,28 @@ class ObjCInterface extends BindingType { s.write(makeDartDoc(dartDoc!)); } - final uniqueNamer = UniqueNamer({name}); + final uniqueNamer = UniqueNamer({name, '_id', '_lib'}); final natLib = w.className; builtInFunctions.ensureUtilsExist(w, s); final objType = PointerType(objCObjectType).getCType(w); // Class declaration. - s.write('class $name '); - uniqueNamer.markUsed('_id'); - s.write('extends ${superType?.name ?? '_ObjCWrapper'} {\n'); - s.write(' $name._($objType id, $natLib lib) : super._(id, lib);\n\n'); + s.write(''' +class $name extends ${superType?.name ?? '_ObjCWrapper'} { + $name._($objType id, $natLib lib, + {bool retain = false, bool release = false}) : + super._(id, lib, retain: retain, release: release); + + static $name castFrom(T other) { + return $name._(other._id, other._lib, retain: true, release: true); + } - // Cast method. - s.write(' static $name castFrom(T other) {\n'); - s.write(' return $name._(other._id, other._lib);\n'); - s.write(' }\n\n'); + static $name castFromPointer($natLib lib, ffi.Pointer other) { + return $name._(other, lib, retain: true, release: true); + } - s.write( - ' static $name castFromPointer($natLib lib, ffi.Pointer other) {\n'); - s.write(' return $name._(other, lib);\n'); - s.write(' }\n\n'); +'''); if (isNSString) { builtInFunctions.generateNSStringUtils(w, s); @@ -185,8 +186,8 @@ class ObjCInterface extends BindingType { } s.write(');\n'); if (convertReturn) { - final result = _doReturnConversion( - returnType, '_ret', name, '_lib', m.isNullableReturn); + final result = _doReturnConversion(returnType, '_ret', name, '_lib', + m.isNullableReturn, m.isOwnedReturn); s.write(' return $result;'); } @@ -214,9 +215,9 @@ class ObjCInterface extends BindingType { } _classObject = ObjCInternalGlobal( - PointerType(objCObjectType), '_class_$originalName', - () => '${builtInFunctions.getClass.name}("$originalName")') + (Writer w) => '${builtInFunctions.getClass.name}("$originalName")', + builtInFunctions.getClass) ..addDependencies(dependencies); if (isNSString) { @@ -345,22 +346,20 @@ class ObjCInterface extends BindingType { } String _doReturnConversion(Type type, String value, String enclosingClass, - String library, bool isNullable) { - String prefix = ""; - if (isNullable) { - prefix += "$value.address == 0 ? null : "; - } + String library, bool isNullable, bool isOwnedReturn) { + final prefix = isNullable ? '$value.address == 0 ? null : ' : ''; + final ownerFlags = 'retain: ${!isOwnedReturn}, release: true'; if (type is ObjCInterface) { - return prefix + '${type.name}._($value, $library)'; + return '$prefix${type.name}._($value, $library, $ownerFlags)'; } if (type is ObjCBlock) { - return prefix + '${type.name}._($value, $library)'; + return '$prefix${type.name}._($value, $library)'; } if (_isObject(type)) { - return prefix + 'NSObject._($value, $library)'; + return '${prefix}NSObject._($value, $library, $ownerFlags)'; } if (_isInstanceType(type)) { - return prefix + '$enclosingClass._($value, $library)'; + return '$prefix$enclosingClass._($value, $library, $ownerFlags)'; } return prefix + value; } @@ -445,6 +444,8 @@ class ObjCMethod { // msgSend is deduped by signature, so this check covers the signature. return msgSend == other.msgSend; } + + bool get isOwnedReturn => originalName == 'new' || originalName == 'alloc'; } class ObjCMethodParam { diff --git a/pkgs/ffigen/test/native_objc_test/automated_ref_count_config.yaml b/pkgs/ffigen/test/native_objc_test/automated_ref_count_config.yaml new file mode 100644 index 0000000000..b925491d82 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/automated_ref_count_config.yaml @@ -0,0 +1,12 @@ +name: AutomatedRefCountTestObjCLibrary +description: 'Tests automatic reference counting of Objective-C objects' +language: objc +output: 'test/native_objc_test/automated_ref_count_bindings.dart' +functions: + exclude: + - '.*' +headers: + entry-points: + - 'test/native_objc_test/automated_ref_count_test.m' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.dart b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.dart new file mode 100644 index 0000000000..59261feaf0 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.dart @@ -0,0 +1,123 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:test/test.dart'; +import 'package:ffi/ffi.dart'; +import '../test_utils.dart'; +import 'automated_ref_count_bindings.dart'; +import 'util.dart'; + +void main() { + late AutomatedRefCountTestObjCLibrary lib; + late void Function(Pointer, Pointer) executeInternalCommand; + + group('Automatic reference counting', () { + setUpAll(() { + logWarnings(); + final dylib = + File('test/native_objc_test/automated_ref_count_test.dylib'); + verifySetupFile(dylib); + lib = AutomatedRefCountTestObjCLibrary( + DynamicLibrary.open(dylib.absolute.path)); + + executeInternalCommand = DynamicLibrary.process().lookupFunction< + Void Function(Pointer, Pointer), + void Function( + Pointer, Pointer)>('Dart_ExecuteInternalCommand'); + + generateBindingsForCoverage('automated_ref_count'); + }); + + doGC() { + final gcNow = "gc-now".toNativeUtf8(); + executeInternalCommand(gcNow.cast(), nullptr); + calloc.free(gcNow); + } + + verifyRefCountsInner(Pointer counter) { + final obj1 = ArcTestObject.alloc(lib).initWithCounter_(counter); + expect(counter.value, 1); + final obj2 = ArcTestObject.alloc(lib).initWithCounter_(counter); + expect(counter.value, 2); + final obj3 = ArcTestObject.alloc(lib).initWithCounter_(counter); + expect(counter.value, 3); + } + + test('Verify ref counts', () { + // To get the GC to work correctly, the references to the objects all have + // to be in a separate function. + final counter = calloc(); + verifyRefCountsInner(counter); + doGC(); + expect(counter.value, 0); + calloc.free(counter); + }); + + test('Manual release', () { + final counter = calloc(); + final obj1 = ArcTestObject.alloc(lib).initWithCounter_(counter); + expect(counter.value, 1); + final obj2 = ArcTestObject.alloc(lib).initWithCounter_(counter); + expect(counter.value, 2); + final obj3 = ArcTestObject.alloc(lib).initWithCounter_(counter); + expect(counter.value, 3); + + // GC to clean up temporaries created between alloc and initWithCounter_. + doGC(); + expect(counter.value, 3); + + obj1.release(); + expect(counter.value, 2); + obj2.release(); + expect(counter.value, 1); + obj3.release(); + expect(counter.value, 0); + + expect(() => obj1.release(), throwsStateError); + calloc.free(counter); + }); + + ArcTestObject unownedReferenceInner2(Pointer counter) { + final obj1 = ArcTestObject.alloc(lib).initWithCounter_(counter); + expect(counter.value, 1); + final obj1b = obj1.unownedReference(); + expect(counter.value, 1); + + // Make a second object so that the counter check in unownedReferenceInner + // sees some sort of change. Otherwise this test could pass just by the GC + // not working correctly. + final obj2 = ArcTestObject.alloc(lib).initWithCounter_(counter); + expect(counter.value, 2); + + return obj1b; + } + + unownedReferenceInner(Pointer counter) { + final obj1b = unownedReferenceInner2(counter); + doGC(); // Collect obj1 and obj2. + // The underlying object obj1 and obj1b points to still exists, because + // obj1b took a reference to it. So we still have 1 object. + expect(counter.value, 1); + } + + test("Method that returns a reference we don't own", () { + // Most ObjC API methods return us a reference without incrementing the + // ref count (ie, returns us a reference we don't own). So the wrapper + // object has to take ownership by calling retain. This test verifies that + // is working correctly by holding a reference to an object returned by a + // method, after the original wrapper object is gone. + final counter = calloc(); + unownedReferenceInner(counter); + doGC(); + expect(counter.value, 0); + calloc.free(counter); + }); + }); +} diff --git a/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m new file mode 100644 index 0000000000..6c3186d00b --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m @@ -0,0 +1,34 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#import + +@interface ArcTestObject : NSObject { + int32_t* counter; +} + +- (instancetype)initWithCounter:(int32_t*) _counter; +- (void)dealloc; +- (ArcTestObject*)unownedReference; + +@end + +@implementation ArcTestObject + +- (instancetype)initWithCounter:(int32_t*) _counter { + counter = _counter; + ++*counter; + return [super init]; +} + +- (void)dealloc { + --*counter; + [super dealloc]; +} + +- (ArcTestObject*)unownedReference { + return self; +} + +@end diff --git a/pkgs/ffigen/test/native_objc_test/cast_test.dart b/pkgs/ffigen/test/native_objc_test/cast_test.dart index 86ec0634d5..55b787bbd0 100644 --- a/pkgs/ffigen/test/native_objc_test/cast_test.dart +++ b/pkgs/ffigen/test/native_objc_test/cast_test.dart @@ -15,7 +15,7 @@ import 'cast_bindings.dart'; import 'util.dart'; void main() { - late Castaway testInstance; + Castaway? testInstance; late CastTestObjCLibrary lib; group('cast', () { @@ -29,26 +29,26 @@ void main() { }); test('castFrom', () { - final fromCast = Castaway.castFrom(testInstance.meAsNSObject()); - expect(fromCast, testInstance); + final fromCast = Castaway.castFrom(testInstance!.meAsNSObject()); + expect(fromCast, testInstance!); }); test('castFromPointer', () { - final meAsInt = testInstance.meAsInt(); + final meAsInt = testInstance!.meAsInt(); final fromCast = Castaway.castFromPointer( lib, Pointer.fromAddress(meAsInt)); - expect(fromCast, testInstance); + expect(fromCast, testInstance!); }); test('equality equals', () { - final meAsInt = testInstance.meAsInt(); + final meAsInt = testInstance!.meAsInt(); final fromCast = Castaway.castFromPointer( lib, Pointer.fromAddress(meAsInt)); - expect(fromCast, testInstance); + expect(fromCast, testInstance!); }); test('equality not equals', () { - final meAsInt = testInstance.meAsInt(); + final meAsInt = testInstance!.meAsInt(); final fromCast = Castaway.castFromPointer( lib, Pointer.fromAddress(meAsInt)); expect(fromCast, isNot(equals(NSObject.new1(lib)))); diff --git a/pkgs/ffigen/test/native_objc_test/category_test.dart b/pkgs/ffigen/test/native_objc_test/category_test.dart index 2dda7cf021..8a8df0b4ec 100644 --- a/pkgs/ffigen/test/native_objc_test/category_test.dart +++ b/pkgs/ffigen/test/native_objc_test/category_test.dart @@ -14,7 +14,7 @@ import 'category_bindings.dart'; import 'util.dart'; void main() { - late Thing testInstance; + Thing? testInstance; late CategoryTestObjCLibrary lib; group('categories', () { @@ -28,8 +28,8 @@ void main() { }); test('Category method', () { - expect(testInstance.add_Y_(1000, 234), 1234); - expect(testInstance.sub_Y_(1234, 1000), 234); + expect(testInstance!.add_Y_(1000, 234), 1234); + expect(testInstance!.sub_Y_(1234, 1000), 234); }); }); } diff --git a/pkgs/ffigen/test/native_objc_test/method_test.dart b/pkgs/ffigen/test/native_objc_test/method_test.dart index 6ab2679603..ebb1fba976 100644 --- a/pkgs/ffigen/test/native_objc_test/method_test.dart +++ b/pkgs/ffigen/test/native_objc_test/method_test.dart @@ -14,7 +14,7 @@ import 'method_bindings.dart'; import 'util.dart'; void main() { - late MethodInterface testInstance; + MethodInterface? testInstance; late MethodTestObjCLibrary lib; group('method calls', () { @@ -29,19 +29,19 @@ void main() { group('Instance methods', () { test('No arguments', () { - expect(testInstance.add(), 5); + expect(testInstance!.add(), 5); }); test('One argument', () { - expect(testInstance.add_(23), 23); + expect(testInstance!.add_(23), 23); }); test('Two arguments', () { - expect(testInstance.add_Y_(23, 17), 40); + expect(testInstance!.add_Y_(23, 17), 40); }); test('Three arguments', () { - expect(testInstance.add_Y_Z_(23, 17, 60), 100); + expect(testInstance!.add_Y_Z_(23, 17, 60), 100); }); }); diff --git a/pkgs/ffigen/test/native_objc_test/nullable_test.dart b/pkgs/ffigen/test/native_objc_test/nullable_test.dart index f2fbf744a7..8814dc5eff 100644 --- a/pkgs/ffigen/test/native_objc_test/nullable_test.dart +++ b/pkgs/ffigen/test/native_objc_test/nullable_test.dart @@ -15,8 +15,8 @@ import 'util.dart'; void main() { late NullableTestObjCLibrary lib; - late NullableInterface nullableInterface; - late NSObject obj; + NullableInterface? nullableInterface; + NSObject? obj; group('method calls', () { setUpAll(() { logWarnings(); @@ -30,12 +30,12 @@ void main() { group('Nullable property', () { test('Not null', () { - nullableInterface.nullableObjectProperty = obj; - expect(nullableInterface.nullableObjectProperty, obj); + nullableInterface!.nullableObjectProperty = obj!; + expect(nullableInterface!.nullableObjectProperty, obj!); }); test('Null', () { - nullableInterface.nullableObjectProperty = null; - expect(nullableInterface.nullableObjectProperty, null); + nullableInterface!.nullableObjectProperty = null; + expect(nullableInterface!.nullableObjectProperty, null); }); }); @@ -51,7 +51,7 @@ void main() { group('Nullable arguments', () { test('Not null', () { expect( - NullableInterface.isNullWithNullableNSObjectArg_(lib, obj), false); + NullableInterface.isNullWithNullableNSObjectArg_(lib, obj!), false); }); test('Null', () { expect( @@ -61,7 +61,8 @@ void main() { group('Not-nullable arguments', () { test('Not null', () { - expect(NullableInterface.isNullWithNotNullableNSObjectPtrArg_(lib, obj), + expect( + NullableInterface.isNullWithNotNullableNSObjectPtrArg_(lib, obj!), false); }); }); diff --git a/pkgs/ffigen/test/native_objc_test/property_test.dart b/pkgs/ffigen/test/native_objc_test/property_test.dart index f38b04cb0a..72c11e039a 100644 --- a/pkgs/ffigen/test/native_objc_test/property_test.dart +++ b/pkgs/ffigen/test/native_objc_test/property_test.dart @@ -14,7 +14,7 @@ import 'property_bindings.dart'; import 'util.dart'; void main() { - late PropertyInterface testInstance; + PropertyInterface? testInstance; late PropertyTestObjCLibrary lib; group('properties', () { @@ -29,12 +29,12 @@ void main() { group('instance properties', () { test('read-only property', () { - expect(testInstance.readOnlyProperty, 7); + expect(testInstance!.readOnlyProperty, 7); }); test('read-write property', () { - testInstance.readWriteProperty = 23; - expect(testInstance.readWriteProperty, 23); + testInstance!.readWriteProperty = 23; + expect(testInstance!.readWriteProperty, 23); }); }); diff --git a/pkgs/ffigen/test/native_objc_test/setup.dart b/pkgs/ffigen/test/native_objc_test/setup.dart index 5b170cc1e4..3e9b5e0d0c 100644 --- a/pkgs/ffigen/test/native_objc_test/setup.dart +++ b/pkgs/ffigen/test/native_objc_test/setup.dart @@ -46,6 +46,7 @@ Future _generateBindings(String config) async { } const testNames = [ + 'automated_ref_count', 'block', 'cast', 'category', From b6033532bf71e8f5b9cd872959311fd2515086d3 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Mon, 23 May 2022 16:08:15 -0700 Subject: [PATCH 146/276] [ffigen] Initialize the Block isa field (#378) --- pkgs/ffigen/lib/src/code_generator/objc_block.dart | 1 + .../src/code_generator/objc_built_in_functions.dart | 6 ++++++ pkgs/ffigen/test/native_objc_test/block_test.dart | 2 ++ pkgs/ffigen/test/native_objc_test/block_test.m | 10 ++++++++-- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/objc_block.dart b/pkgs/ffigen/lib/src/code_generator/objc_block.dart index 04f4c0b5f4..63ce7fd7a5 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_block.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_block.dart @@ -97,6 +97,7 @@ class ObjCBlock extends BindingType { builtInFunctions.newBlockDesc.addDependencies(dependencies); builtInFunctions.blockDescSingleton.addDependencies(dependencies); builtInFunctions.blockStruct.addDependencies(dependencies); + builtInFunctions.concreteGlobalBlock.addDependencies(dependencies); builtInFunctions.newBlock.addDependencies(dependencies); } diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index 2c2644ef87..a92dbcbc95 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -142,6 +142,11 @@ class ObjCBuiltInFunctions { (Writer w) => '${newBlockDesc.name}()', blockDescStruct, ); + late final concreteGlobalBlock = ObjCInternalGlobal( + '_objc_concrete_global_block', + (Writer w) => '${w.lookupFuncIdentifier}<${voidType.getCType(w)}>(' + "'_NSConcreteGlobalBlock')", + ); late final newBlock = ObjCInternalFunction('_newBlock', null, (Writer w, String name) { final s = StringBuffer(); @@ -151,6 +156,7 @@ class ObjCBuiltInFunctions { s.write('\n$blockPtr $name($voidPtr invoke, $voidPtr target) {\n'); s.write(' final b = ${w.ffiPkgLibraryPrefix}.calloc.allocate<$blockType>(' '${w.ffiLibraryPrefix}.sizeOf<$blockType>());\n'); + s.write(' b.ref.isa = ${concreteGlobalBlock.name};\n'); s.write(' b.ref.invoke = invoke;\n'); s.write(' b.ref.target = target;\n'); s.write(' b.ref.descriptor = ${blockDescSingleton.name};\n'); diff --git a/pkgs/ffigen/test/native_objc_test/block_test.dart b/pkgs/ffigen/test/native_objc_test/block_test.dart index 188da1d680..32ac72d405 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.dart +++ b/pkgs/ffigen/test/native_objc_test/block_test.dart @@ -32,6 +32,7 @@ void main() { expect(blockTester.call_(123), 1230); final intBlock = blockTester.getBlock(); final blockTester2 = BlockTester.makeFromBlock_(lib, intBlock); + blockTester2.pokeBlock(); expect(blockTester2.call_(456), 4560); }); @@ -39,6 +40,7 @@ void main() { final block = ObjCBlock.fromFunctionPointer( lib, Pointer.fromFunction(_add100, 999)); final blockTester = BlockTester.makeFromBlock_(lib, block.pointer); + blockTester.pokeBlock(); expect(blockTester.call_(123), 223); }); }); diff --git a/pkgs/ffigen/test/native_objc_test/block_test.m b/pkgs/ffigen/test/native_objc_test/block_test.m index 43d6a2c2b9..7d170801fc 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.m +++ b/pkgs/ffigen/test/native_objc_test/block_test.m @@ -15,6 +15,7 @@ + (BlockTester*)makeFromBlock:(IntBlock)block; + (BlockTester*)makeFromMultiplier:(int32_t)mult; - (int32_t)call:(int32_t)x; - (IntBlock)getBlock; +- (void)pokeBlock; @end @implementation BlockTester @@ -33,10 +34,15 @@ + (BlockTester*)makeFromMultiplier:(int32_t)mult { } - (int32_t)call:(int32_t)x { - return self->myBlock(x); + return myBlock(x); } - (IntBlock)getBlock { - return self->myBlock; + return myBlock; +} + +- (void)pokeBlock { + // Used to repro https://github.com/dart-lang/ffigen/issues/376 + [[myBlock retain] release]; } @end From 50065811dedb0fb7ea320c33e9656c3c82386b1c Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 25 May 2022 09:04:08 -0700 Subject: [PATCH 147/276] [ffigen] Support constructing blocks from closures (#382) * Support constructing blocks from closures * Format --- .../lib/src/code_generator/objc_block.dart | 53 ++++++++++++++++--- .../test/native_objc_test/block_test.dart | 11 ++++ 2 files changed, 58 insertions(+), 6 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/objc_block.dart b/pkgs/ffigen/lib/src/code_generator/objc_block.dart index 63ce7fd7a5..7ae748647e 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_block.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_block.dart @@ -34,12 +34,21 @@ class ObjCBlock extends BindingType { } final isVoid = returnType == NativeType(SupportedNativeType.Void); + final voidPtr = PointerType(voidType).getCType(w); final blockPtr = PointerType(builtInFunctions.blockStruct); final funcType = FunctionType(returnType: returnType, parameters: params); final natFnType = NativeFunc(funcType); final natFnPtr = PointerType(natFnType).getCType(w); final funcPtrTrampoline = w.topLevelUniqueNamer.makeUnique('_${name}_fnPtrTrampoline'); + final closureTrampoline = + w.topLevelUniqueNamer.makeUnique('_${name}_closureTrampoline'); + final registerClosure = + w.topLevelUniqueNamer.makeUnique('_${name}_registerClosure'); + final closureRegistry = + w.topLevelUniqueNamer.makeUnique('_${name}_closureRegistry'); + final closureRegistryIndex = + w.topLevelUniqueNamer.makeUnique('_${name}_closureRegistryIndex'); final trampFuncType = FunctionType( returnType: returnType, parameters: [Parameter(type: blockPtr, name: 'block'), ...params]); @@ -60,6 +69,32 @@ class ObjCBlock extends BindingType { s.write(');\n'); s.write('}\n'); + // Write the closure registry function. + s.write(''' +final $closureRegistry = {}; +int $closureRegistryIndex = 0; +$voidPtr $registerClosure(Function fn) { + final id = ++$closureRegistryIndex; + $closureRegistry[id] = fn; + return $voidPtr.fromAddress(id); +} +'''); + + // Write the closure based trampoline function. + s.write(returnType.getDartType(w)); + s.write(' $closureTrampoline(${blockPtr.getCType(w)} block'); + for (int i = 0; i < params.length; ++i) { + s.write(', ${params[i].type.getDartType(w)} ${params[i].name}'); + } + s.write(') {\n'); + s.write(' ${isVoid ? '' : 'return '}$closureRegistry[' + 'block.ref.target.address]!('); + for (int i = 0; i < params.length; ++i) { + s.write('${i == 0 ? '' : ', '}${params[i].name}'); + } + s.write(');\n'); + s.write('}\n'); + // Write the wrapper class. s.write('class $name {\n'); s.write(' final ${blockPtr.getCType(w)} _impl;\n'); @@ -69,12 +104,18 @@ class ObjCBlock extends BindingType { // Constructor from a function pointer. final defaultValue = returnType.getDefaultValue(w, '_lib'); final exceptionalReturn = defaultValue == null ? '' : ', $defaultValue'; - s.write('\n'); - s.write(' $name.fromFunctionPointer(this._lib, $natFnPtr ptr)'); - s.write(' : _impl = _lib.${builtInFunctions.newBlock.name}(' - '${w.ffiLibraryPrefix}.Pointer.fromFunction<' - '${trampFuncType.getCType(w)}>($funcPtrTrampoline' - '$exceptionalReturn).cast(), ptr.cast());\n'); + s.write(''' + $name.fromFunctionPointer(this._lib, $natFnPtr ptr) + : _impl = _lib.${builtInFunctions.newBlock.name}( + ${w.ffiLibraryPrefix}.Pointer.fromFunction< + ${trampFuncType.getCType(w)}>($funcPtrTrampoline + $exceptionalReturn).cast(), ptr.cast()); + $name.fromFunction(this._lib, ${funcType.getDartType(w)} fn) + : _impl = _lib.${builtInFunctions.newBlock.name}( + ${w.ffiLibraryPrefix}.Pointer.fromFunction< + ${trampFuncType.getCType(w)}>($closureTrampoline + $exceptionalReturn).cast(), $registerClosure(fn)); +'''); // Get the pointer to the underlying block. s.write(' ${blockPtr.getCType(w)} get pointer => _impl;\n'); diff --git a/pkgs/ffigen/test/native_objc_test/block_test.dart b/pkgs/ffigen/test/native_objc_test/block_test.dart index 32ac72d405..4586cd88cb 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.dart +++ b/pkgs/ffigen/test/native_objc_test/block_test.dart @@ -43,6 +43,17 @@ void main() { blockTester.pokeBlock(); expect(blockTester.call_(123), 223); }); + + int Function(int) makeAdder(int addTo) { + return (int x) => addTo + x; + } + + test('Block from function', () { + final block = ObjCBlock.fromFunction(lib, makeAdder(4000)); + final blockTester = BlockTester.makeFromBlock_(lib, block.pointer); + blockTester.pokeBlock(); + expect(blockTester.call_(123), 4123); + }); }); } From 5c613df666b1586108e8e40096fae8f348da1a19 Mon Sep 17 00:00:00 2001 From: Aleksey Kulikov Date: Wed, 25 May 2022 19:47:06 +0300 Subject: [PATCH 148/276] [ffigen] docs(changelog): remove extra # (#377) Remove extra # to produce correct level 1 heading. --- pkgs/ffigen/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 6cae5fb440..e5aee18b2a 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,4 +1,4 @@ -## 5.0.0 +# 5.0.0 - Stable release targeting Dart 2.17, supporting ABI-specific integer types. - _EXPERIMENTAL_ support for ObjectiveC on MacOS hosts. The API and output From 3f345cbc078c968a153c92473ab9f5c6452ab888 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 25 May 2022 13:46:08 -0700 Subject: [PATCH 149/276] [ffigen] Handle NS_RETURNS_RETAINED and methods that start with new/alloc or contain copy (#380) * Handle NS_RETURNS_RETAINED and methods that start with init/alloc * Split up tests --- .../src/code_generator/objc_interface.dart | 8 ++- .../sub_parsers/objcinterfacedecl_parser.dart | 7 +++ .../automated_ref_count_test.dart | 63 ++++++++++++++----- .../automated_ref_count_test.m | 31 +++++++++ 4 files changed, 94 insertions(+), 15 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index d8216e9ff2..95143f2fec 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -387,6 +387,7 @@ class ObjCMethod { final List params; final ObjCMethodKind kind; final bool isClass; + bool returnsRetained = false; ObjCInternalGlobal? selObject; Func? msgSend; @@ -445,7 +446,12 @@ class ObjCMethod { return msgSend == other.msgSend; } - bool get isOwnedReturn => originalName == 'new' || originalName == 'alloc'; + static final _copyRegExp = RegExp('[cC]opy'); + bool get isOwnedReturn => + returnsRetained || + originalName.startsWith('new') || + originalName.startsWith('alloc') || + originalName.contains(_copyRegExp); } class ObjCMethodParam { diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index be660df595..bf9d038725 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -222,6 +222,9 @@ int _parseMethodVisitor(clang_types.CXCursor cursor, case clang_types.CXCursorKind.CXCursor_ParmDecl: _parseMethodParam(cursor); break; + case clang_types.CXCursorKind.CXCursor_NSReturnsRetained: + _markMethodReturnsRetained(cursor); + break; default: } return clang_types.CXChildVisitResult.CXChildVisit_Continue; @@ -267,6 +270,10 @@ void _parseMethodParam(clang_types.CXCursor cursor) { .add(ObjCMethodParam(type, name, isNullable: isNullable)); } +void _markMethodReturnsRetained(clang_types.CXCursor cursor) { + _methodStack.top.method.returnsRetained = true; +} + BindingType? parseObjCCategoryDeclaration(clang_types.CXCursor cursor) { // Categories add methods to an existing interface, so first we run a visitor // to find the interface, then we fully parse that interface, then we run the diff --git a/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.dart b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.dart index 59261feaf0..2c3ab47a48 100644 --- a/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.dart +++ b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.dart @@ -41,36 +41,69 @@ void main() { calloc.free(gcNow); } - verifyRefCountsInner(Pointer counter) { - final obj1 = ArcTestObject.alloc(lib).initWithCounter_(counter); + newMethodsInner(Pointer counter) { + final obj1 = ArcTestObject.new1(lib); + obj1.setCounter_(counter); expect(counter.value, 1); - final obj2 = ArcTestObject.alloc(lib).initWithCounter_(counter); + final obj2 = ArcTestObject.newWithCounter_(lib, counter); expect(counter.value, 2); - final obj3 = ArcTestObject.alloc(lib).initWithCounter_(counter); - expect(counter.value, 3); } - test('Verify ref counts', () { + test('new methods ref count correctly', () { // To get the GC to work correctly, the references to the objects all have // to be in a separate function. final counter = calloc(); - verifyRefCountsInner(counter); + counter.value = 0; + newMethodsInner(counter); doGC(); expect(counter.value, 0); calloc.free(counter); }); - test('Manual release', () { - final counter = calloc(); + allocMethodsInner(Pointer counter) { final obj1 = ArcTestObject.alloc(lib).initWithCounter_(counter); expect(counter.value, 1); - final obj2 = ArcTestObject.alloc(lib).initWithCounter_(counter); + final obj2 = ArcTestObject.castFrom(ArcTestObject.alloc(lib).init()); + obj2.setCounter_(counter); + expect(counter.value, 2); + final obj3 = ArcTestObject.allocTheThing(lib).initWithCounter_(counter); + expect(counter.value, 3); + } + + test('alloc and init methods ref count correctly', () { + final counter = calloc(); + counter.value = 0; + allocMethodsInner(counter); + doGC(); + expect(counter.value, 0); + calloc.free(counter); + }); + + copyMethodsInner(Pointer counter) { + final obj1 = ArcTestObject.newWithCounter_(lib, counter); + expect(counter.value, 1); + final obj2 = obj1.copyMe(); expect(counter.value, 2); - final obj3 = ArcTestObject.alloc(lib).initWithCounter_(counter); + final obj3 = obj1.makeACopy(); expect(counter.value, 3); + } - // GC to clean up temporaries created between alloc and initWithCounter_. + test('copy methods ref count correctly', () { + final counter = calloc(); + counter.value = 0; + copyMethodsInner(counter); doGC(); + expect(counter.value, 0); + calloc.free(counter); + }); + + test('Manual release', () { + final counter = calloc(); + final obj1 = ArcTestObject.newWithCounter_(lib, counter); + expect(counter.value, 1); + final obj2 = ArcTestObject.newWithCounter_(lib, counter); + expect(counter.value, 2); + final obj3 = ArcTestObject.newWithCounter_(lib, counter); expect(counter.value, 3); obj1.release(); @@ -85,7 +118,8 @@ void main() { }); ArcTestObject unownedReferenceInner2(Pointer counter) { - final obj1 = ArcTestObject.alloc(lib).initWithCounter_(counter); + final obj1 = ArcTestObject.new1(lib); + obj1.setCounter_(counter); expect(counter.value, 1); final obj1b = obj1.unownedReference(); expect(counter.value, 1); @@ -93,7 +127,8 @@ void main() { // Make a second object so that the counter check in unownedReferenceInner // sees some sort of change. Otherwise this test could pass just by the GC // not working correctly. - final obj2 = ArcTestObject.alloc(lib).initWithCounter_(counter); + final obj2 = ArcTestObject.new1(lib); + obj2.setCounter_(counter); expect(counter.value, 2); return obj1b; diff --git a/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m index 6c3186d00b..4fa6c10abc 100644 --- a/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m +++ b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m @@ -8,20 +8,39 @@ @interface ArcTestObject : NSObject { int32_t* counter; } ++ (instancetype)allocTheThing; ++ (instancetype)newWithCounter:(int32_t*) _counter; - (instancetype)initWithCounter:(int32_t*) _counter; +- (void)setCounter:(int32_t*) _counter; - (void)dealloc; - (ArcTestObject*)unownedReference; +- (ArcTestObject*)copyMe; +- (ArcTestObject*)makeACopy; +- (ArcTestObject*)returnsRetained NS_RETURNS_RETAINED; @end @implementation ArcTestObject ++ (instancetype)allocTheThing { + return [ArcTestObject alloc]; +} + ++ (instancetype)newWithCounter:(int32_t*) _counter { + return [[ArcTestObject alloc] initWithCounter: _counter]; +} + - (instancetype)initWithCounter:(int32_t*) _counter { counter = _counter; ++*counter; return [super init]; } +- (void)setCounter:(int32_t*) _counter { + counter = _counter; + ++*counter; +} + - (void)dealloc { --*counter; [super dealloc]; @@ -31,4 +50,16 @@ - (ArcTestObject*)unownedReference { return self; } +- (ArcTestObject*)copyMe { + return [[ArcTestObject alloc] initWithCounter: counter]; +} + +- (ArcTestObject*)makeACopy { + return [[ArcTestObject alloc] initWithCounter: counter]; +} + +- (ArcTestObject*)returnsRetained NS_RETURNS_RETAINED { + return [self retain]; +} + @end From 9f466919b31690d956c56eff26a8c08d8b2619fb Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 25 May 2022 13:54:19 -0700 Subject: [PATCH 150/276] [ffigen] Add a static isInstance method to ObjC classes (#383) * Add an isInstance method for checking the type of an object. * Tighten up the test * Simplify a bit --- .../src/code_generator/objc_interface.dart | 14 ++++++ .../native_objc_test/is_instance_config.yaml | 12 +++++ .../native_objc_test/is_instance_test.dart | 47 +++++++++++++++++++ .../test/native_objc_test/is_instance_test.m | 23 +++++++++ pkgs/ffigen/test/native_objc_test/setup.dart | 1 + 5 files changed, 97 insertions(+) create mode 100644 pkgs/ffigen/test/native_objc_test/is_instance_config.yaml create mode 100644 pkgs/ffigen/test/native_objc_test/is_instance_test.dart create mode 100644 pkgs/ffigen/test/native_objc_test/is_instance_test.m diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 95143f2fec..4c77067b03 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -44,6 +44,8 @@ class ObjCInterface extends BindingType { final ObjCBuiltInFunctions builtInFunctions; final bool isBuiltIn; late final ObjCInternalGlobal _classObject; + late final ObjCInternalGlobal _isKindOfClass; + late final Func _isKindOfClassMsgSend; ObjCInterface({ String? usr, @@ -95,14 +97,23 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { {bool retain = false, bool release = false}) : super._(id, lib, retain: retain, release: release); + /// Returns a [$name] that points to the same underlying object as [other]. static $name castFrom(T other) { return $name._(other._id, other._lib, retain: true, release: true); } + /// Returns a [$name] that wraps the given raw object pointer. static $name castFromPointer($natLib lib, ffi.Pointer other) { return $name._(other, lib, retain: true, release: true); } + /// Returns whether [obj] is an instance of [$name]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib.${_isKindOfClassMsgSend.name}( + obj._id, obj._lib.${_isKindOfClass.name}, + obj._lib.${_classObject.name}); + } + '''); if (isNSString) { @@ -219,6 +230,9 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { (Writer w) => '${builtInFunctions.getClass.name}("$originalName")', builtInFunctions.getClass) ..addDependencies(dependencies); + _isKindOfClass = builtInFunctions.getSelObject('isKindOfClass:'); + _isKindOfClassMsgSend = builtInFunctions.getMsgSendFunc( + BooleanType(), [ObjCMethodParam(PointerType(objCObjectType), 'clazz')]); if (isNSString) { _addNSStringMethods(); diff --git a/pkgs/ffigen/test/native_objc_test/is_instance_config.yaml b/pkgs/ffigen/test/native_objc_test/is_instance_config.yaml new file mode 100644 index 0000000000..90ca44b76e --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/is_instance_config.yaml @@ -0,0 +1,12 @@ +name: IsInstanceTestObjCLibrary +description: 'Tests isInstance' +language: objc +output: 'test/native_objc_test/is_instance_bindings.dart' +functions: + exclude: + - '.*' +headers: + entry-points: + - 'test/native_objc_test/is_instance_test.m' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/is_instance_test.dart b/pkgs/ffigen/test/native_objc_test/is_instance_test.dart new file mode 100644 index 0000000000..bbbfee9238 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/is_instance_test.dart @@ -0,0 +1,47 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. + +@TestOn('mac-os') + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:test/test.dart'; +import '../test_utils.dart'; +import 'is_instance_bindings.dart'; +import 'util.dart'; + +void main() { + late IsInstanceTestObjCLibrary lib; + + group('isInstance', () { + setUpAll(() { + logWarnings(); + final dylib = File('test/native_objc_test/is_instance_test.dylib'); + verifySetupFile(dylib); + lib = IsInstanceTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); + generateBindingsForCoverage('is_instance'); + }); + + test('Unrelated classes', () { + final base = NSObject.castFrom(BaseClass.new1(lib)); + final unrelated = NSObject.castFrom(UnrelatedClass.new1(lib)); + expect(BaseClass.isInstance(base), isTrue); + expect(BaseClass.isInstance(unrelated), isFalse); + expect(UnrelatedClass.isInstance(base), isFalse); + expect(UnrelatedClass.isInstance(unrelated), isTrue); + }); + + test('Base class vs child class', () { + final base = NSObject.castFrom(BaseClass.new1(lib)); + final child = NSObject.castFrom(ChildClass.new1(lib)); + expect(BaseClass.isInstance(base), isTrue); + expect(BaseClass.isInstance(child), isTrue); + expect(ChildClass.isInstance(base), isFalse); + expect(ChildClass.isInstance(child), isTrue); + }); + }); +} diff --git a/pkgs/ffigen/test/native_objc_test/is_instance_test.m b/pkgs/ffigen/test/native_objc_test/is_instance_test.m new file mode 100644 index 0000000000..96b2314944 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/is_instance_test.m @@ -0,0 +1,23 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#import + +@interface BaseClass : NSObject {} +@end + +@interface ChildClass : BaseClass {} +@end + +@interface UnrelatedClass : NSObject {} +@end + +@implementation BaseClass +@end + +@implementation ChildClass +@end + +@implementation UnrelatedClass +@end diff --git a/pkgs/ffigen/test/native_objc_test/setup.dart b/pkgs/ffigen/test/native_objc_test/setup.dart index 3e9b5e0d0c..22d99c9e32 100644 --- a/pkgs/ffigen/test/native_objc_test/setup.dart +++ b/pkgs/ffigen/test/native_objc_test/setup.dart @@ -51,6 +51,7 @@ const testNames = [ 'cast', 'category', 'forward_decl', + 'is_instance', 'method', 'native_objc', 'nullable', From 4e2b86def588676e4f65196133b998c3eb9115a3 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Fri, 27 May 2022 18:56:36 +0200 Subject: [PATCH 151/276] [ffigen] Add xcode tools llvm as default path (#389) --- pkgs/ffigen/CHANGELOG.md | 4 ++++ pkgs/ffigen/lib/src/strings.dart | 1 + pkgs/ffigen/pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index e5aee18b2a..c17a0a6a31 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 5.0.1 + +- Add a the xcode tools llvm as default path on MacOS. + # 5.0.0 - Stable release targeting Dart 2.17, supporting ABI-specific integer types. diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index f3bfb79545..7f0f0281ae 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -210,6 +210,7 @@ const windowsDylibLocations = { const macOsDylibLocations = { '/usr/local/opt/llvm/lib/', '/opt/homebrew/opt/llvm/lib/', + '/Library/Developer/CommandLineTools/usr/', }; // Writen doubles. diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index c054c5018b..d249b7b6b9 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 5.0.0 +version: 5.0.1 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen From 50e0ba86ebe87c6c1d03351ca857882ceb837c17 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Fri, 27 May 2022 10:28:10 -0700 Subject: [PATCH 152/276] [ffigen] Add the ability to control reference counting behavior in castFromPointer (#388) --- .../src/code_generator/objc_interface.dart | 5 +-- .../automated_ref_count_test.dart | 32 +++++++++++++++++ .../automated_ref_count_test.m | 35 +++++++++++++++++++ 3 files changed, 70 insertions(+), 2 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 4c77067b03..04eb6e5b33 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -103,8 +103,9 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { } /// Returns a [$name] that wraps the given raw object pointer. - static $name castFromPointer($natLib lib, ffi.Pointer other) { - return $name._(other, lib, retain: true, release: true); + static $name castFromPointer($natLib lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return $name._(other, lib, retain: retain, release: release); } /// Returns whether [obj] is an instance of [$name]. diff --git a/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.dart b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.dart index 2c3ab47a48..74c1270bc2 100644 --- a/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.dart +++ b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.dart @@ -97,6 +97,38 @@ void main() { calloc.free(counter); }); + castFromPointerInnerReleaseAndRetain(int address) { + final fromCast = RefCounted.castFromPointer( + lib, Pointer.fromAddress(address), + release: true, retain: true); + expect(fromCast.refCount, 2); + } + + test('castFromPointer - release and retain', () { + final obj1 = RefCounted.new1(lib); + expect(obj1.refCount, 1); + + castFromPointerInnerReleaseAndRetain(obj1.meAsInt()); + doGC(); + expect(obj1.refCount, 1); + }); + + castFromPointerInnerNoReleaseAndRetain(int address) { + final fromCast = RefCounted.castFromPointer( + lib, Pointer.fromAddress(address), + release: false, retain: false); + expect(fromCast.refCount, 1); + } + + test('castFromPointer - no release and retain', () { + final obj1 = RefCounted.new1(lib); + expect(obj1.refCount, 1); + + castFromPointerInnerNoReleaseAndRetain(obj1.meAsInt()); + doGC(); + expect(obj1.refCount, 1); + }); + test('Manual release', () { final counter = calloc(); final obj1 = ArcTestObject.newWithCounter_(lib, counter); diff --git a/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m index 4fa6c10abc..78e5a6b2cb 100644 --- a/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m +++ b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m @@ -20,6 +20,14 @@ - (ArcTestObject*)returnsRetained NS_RETURNS_RETAINED; @end +@interface RefCounted : NSObject + +@property(readonly) uint64_t refCount; + +- (int64_t) meAsInt; + +@end + @implementation ArcTestObject + (instancetype)allocTheThing { @@ -63,3 +71,30 @@ - (ArcTestObject*)returnsRetained NS_RETURNS_RETAINED { } @end + +@implementation RefCounted + +- (instancetype)init { + if (self = [super init]) { + self->_refCount = 1; + } + return self; +} + +- (instancetype)retain { + ++self->_refCount; + return self; +} + +- (oneway void)release { + --self->_refCount; + if (self->_refCount == 0) { + [self dealloc]; + } +} + +- (int64_t) meAsInt { + return (int64_t) self; +} + +@end \ No newline at end of file From b54e57d1beccca556d0f1dc561a0d481ebf032e7 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Fri, 27 May 2022 12:32:02 -0700 Subject: [PATCH 153/276] [ffigen] Test autorelease pools and more copying cases (#385) --- .../automated_ref_count_config.yaml | 5 +-- .../automated_ref_count_test.dart | 35 +++++++++++++++++++ .../automated_ref_count_test.m | 21 ++++++++++- 3 files changed, 58 insertions(+), 3 deletions(-) diff --git a/pkgs/ffigen/test/native_objc_test/automated_ref_count_config.yaml b/pkgs/ffigen/test/native_objc_test/automated_ref_count_config.yaml index b925491d82..bc4982efd3 100644 --- a/pkgs/ffigen/test/native_objc_test/automated_ref_count_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/automated_ref_count_config.yaml @@ -3,8 +3,9 @@ description: 'Tests automatic reference counting of Objective-C objects' language: objc output: 'test/native_objc_test/automated_ref_count_bindings.dart' functions: - exclude: - - '.*' + include: + - createAutoreleasePool + - destroyAutoreleasePool headers: entry-points: - 'test/native_objc_test/automated_ref_count_test.m' diff --git a/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.dart b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.dart index 74c1270bc2..74302f91fd 100644 --- a/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.dart +++ b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.dart @@ -86,6 +86,10 @@ void main() { expect(counter.value, 2); final obj3 = obj1.makeACopy(); expect(counter.value, 3); + final obj4 = obj1.copyWithZone_(nullptr); + expect(counter.value, 4); + final obj5 = obj1.copy(); + expect(counter.value, 5); } test('copy methods ref count correctly', () { @@ -97,6 +101,37 @@ void main() { calloc.free(counter); }); + autoreleaseMethodsInner(Pointer counter) { + final obj = ArcTestObject.makeAndAutorelease_(lib, counter); + expect(counter.value, 1); + } + + test('autorelease methods ref count correctly', () { + final counter = calloc(); + counter.value = 0; + + final pool1 = lib.createAutoreleasePool(); + autoreleaseMethodsInner(counter); + doGC(); + // The autorelease pool is still holding a reference to the object. + expect(counter.value, 1); + lib.destroyAutoreleasePool(pool1); + expect(counter.value, 0); + + final pool2 = lib.createAutoreleasePool(); + final obj = ArcTestObject.makeAndAutorelease_(lib, counter); + expect(counter.value, 1); + doGC(); + expect(counter.value, 1); + lib.destroyAutoreleasePool(pool2); + // The obj variable still holds a reference to the object. + expect(counter.value, 1); + obj.release(); + expect(counter.value, 0); + + calloc.free(counter); + }); + castFromPointerInnerReleaseAndRetain(int address) { final fromCast = RefCounted.castFromPointer( lib, Pointer.fromAddress(address), diff --git a/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m index 78e5a6b2cb..f4a4fc97c9 100644 --- a/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m +++ b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #import +#import @interface ArcTestObject : NSObject { int32_t* counter; @@ -11,11 +12,13 @@ @interface ArcTestObject : NSObject { + (instancetype)allocTheThing; + (instancetype)newWithCounter:(int32_t*) _counter; - (instancetype)initWithCounter:(int32_t*) _counter; ++ (ArcTestObject*)makeAndAutorelease:(int32_t*) _counter; - (void)setCounter:(int32_t*) _counter; - (void)dealloc; - (ArcTestObject*)unownedReference; - (ArcTestObject*)copyMe; - (ArcTestObject*)makeACopy; +- (id)copyWithZone:(NSZone*) zone; - (ArcTestObject*)returnsRetained NS_RETURNS_RETAINED; @end @@ -44,6 +47,10 @@ - (instancetype)initWithCounter:(int32_t*) _counter { return [super init]; } ++ (instancetype)makeAndAutorelease:(int32_t*) _counter { + return [[[ArcTestObject alloc] initWithCounter: _counter] autorelease]; +} + - (void)setCounter:(int32_t*) _counter { counter = _counter; ++*counter; @@ -66,12 +73,24 @@ - (ArcTestObject*)makeACopy { return [[ArcTestObject alloc] initWithCounter: counter]; } +- (id)copyWithZone:(NSZone*) zone { + return [[ArcTestObject alloc] initWithCounter: counter]; +} + - (ArcTestObject*)returnsRetained NS_RETURNS_RETAINED { return [self retain]; } @end +id createAutoreleasePool() { + return [NSAutoreleasePool new]; +} + +void destroyAutoreleasePool(id pool) { + [pool release]; +} + @implementation RefCounted - (instancetype)init { @@ -97,4 +116,4 @@ - (int64_t) meAsInt { return (int64_t) self; } -@end \ No newline at end of file +@end From edd60410c91a6dc8530d12d61aba5611b5fd35f9 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Fri, 27 May 2022 12:51:54 -0700 Subject: [PATCH 154/276] [ffigen] Test assign/retain/copy properties (#390) * Test autorelease pools and more copying cases * Test assign/retain/copy properties --- .../automated_ref_count_test.dart | 92 +++++++++++++++++++ .../automated_ref_count_test.m | 6 ++ 2 files changed, 98 insertions(+) diff --git a/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.dart b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.dart index 74302f91fd..63ed70656e 100644 --- a/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.dart +++ b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.dart @@ -132,6 +132,98 @@ void main() { calloc.free(counter); }); + assignPropertiesInnerInner(Pointer counter, ArcTestObject outerObj) { + final assignObj = ArcTestObject.newWithCounter_(lib, counter); + expect(counter.value, 2); + outerObj.assignedProperty = assignObj; + expect(counter.value, 2); + expect(assignObj, outerObj.assignedProperty); + // To test that outerObj isn't holding a reference to assignObj, we let + // assignObj go out of scope, but keep outerObj in scope. This is + // dangerous because outerObj now has a dangling reference, so don't + // access that reference. + } + + assignPropertiesInner(Pointer counter) { + final outerObj = ArcTestObject.newWithCounter_(lib, counter); + expect(counter.value, 1); + assignPropertiesInnerInner(counter, outerObj); + doGC(); + // assignObj has been cleaned up. + expect(counter.value, 1); + } + + test('assign properties ref count correctly', () { + final counter = calloc(); + counter.value = 0; + assignPropertiesInner(counter); + doGC(); + expect(counter.value, 0); + calloc.free(counter); + }); + + retainPropertiesInnerInner(Pointer counter, ArcTestObject outerObj) { + final retainObj = ArcTestObject.newWithCounter_(lib, counter); + expect(counter.value, 2); + outerObj.retainedProperty = retainObj; + expect(counter.value, 2); + expect(retainObj, outerObj.retainedProperty); + } + + retainPropertiesInner(Pointer counter) { + final outerObj = ArcTestObject.newWithCounter_(lib, counter); + expect(counter.value, 1); + retainPropertiesInnerInner(counter, outerObj); + doGC(); + // retainObj is still around, because outerObj retains a reference to it. + expect(counter.value, 2); + } + + test('retain properties ref count correctly', () { + final counter = calloc(); + counter.value = 0; + // The getters of retain properties retain+autorelease the value. So we + // need an autorelease pool. + final pool = lib.createAutoreleasePool(); + retainPropertiesInner(counter); + doGC(); + expect(counter.value, 1); + lib.destroyAutoreleasePool(pool); + expect(counter.value, 0); + calloc.free(counter); + }); + + copyPropertiesInner(Pointer counter) { + final outerObj = ArcTestObject.newWithCounter_(lib, counter); + expect(counter.value, 1); + + final copyObj = ArcTestObject.newWithCounter_(lib, counter); + expect(counter.value, 2); + outerObj.copiedProperty = copyObj; + // Copy properties make a copy of the object, so now we have 3 objects. + expect(counter.value, 3); + expect(copyObj, isNot(outerObj.copiedProperty)); + + final anotherCopy = outerObj.copiedProperty; + // The getter doesn't copy the object. + expect(counter.value, 3); + expect(anotherCopy, outerObj.copiedProperty); + } + + test('copy properties ref count correctly', () { + final counter = calloc(); + counter.value = 0; + // The getters of copy properties retain+autorelease the value. So we need + // an autorelease pool. + final pool = lib.createAutoreleasePool(); + copyPropertiesInner(counter); + doGC(); + expect(counter.value, 1); + lib.destroyAutoreleasePool(pool); + expect(counter.value, 0); + calloc.free(counter); + }); + castFromPointerInnerReleaseAndRetain(int address) { final fromCast = RefCounted.castFromPointer( lib, Pointer.fromAddress(address), diff --git a/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m index f4a4fc97c9..d249389614 100644 --- a/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m +++ b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m @@ -21,6 +21,10 @@ - (ArcTestObject*)makeACopy; - (id)copyWithZone:(NSZone*) zone; - (ArcTestObject*)returnsRetained NS_RETURNS_RETAINED; +@property (assign) ArcTestObject* assignedProperty; +@property (retain) ArcTestObject* retainedProperty; +@property (copy) ArcTestObject* copiedProperty; + @end @interface RefCounted : NSObject @@ -58,6 +62,8 @@ - (void)setCounter:(int32_t*) _counter { - (void)dealloc { --*counter; + [_retainedProperty release]; + [_copiedProperty release]; [super dealloc]; } From c3643b60c3be8d44d48e8f7eed042e0f680df9ef Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 30 May 2022 12:09:37 +0530 Subject: [PATCH 155/276] [ffigen] Removed config `dart-bool`. Booleans are now always generated with `bool` (#391) and `ffi.Bool` as it's Dart and C Type respectively. --- pkgs/ffigen/CHANGELOG.md | 4 ++ pkgs/ffigen/lib/src/code_generator/func.dart | 29 ++------------ .../lib/src/code_generator/library.dart | 2 - .../lib/src/code_generator/native_type.dart | 2 +- .../ffigen/lib/src/code_generator/writer.dart | 3 -- .../lib/src/config_provider/config.dart | 11 ----- pkgs/ffigen/lib/src/header_parser/parser.dart | 1 - pkgs/ffigen/lib/src/strings.dart | 1 - pkgs/ffigen/pubspec.yaml | 2 +- .../code_generator_test.dart | 24 ----------- .../_expected_boolean_dartbool_bindings.dart | 17 ++++---- ...expected_boolean_no_dartbool_bindings.dart | 40 ------------------- .../_expected_typedef_bindings.dart | 15 ++++--- .../native_test/native_test_bindings.dart | 11 +++-- 14 files changed, 30 insertions(+), 132 deletions(-) delete mode 100644 pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index c17a0a6a31..d8d6976aa7 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 6.0.0 +- Removed config `dart-bool`. Booleans are now always generated with `bool` +and `ffi.Bool` as it's Dart and C Type respectively. + # 5.0.1 - Add a the xcode tools llvm as default path on MacOS. diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index e0eb0cb6cf..c10b0c8dd5 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -98,39 +98,18 @@ class Func extends LookUpBinding { p.name = paramNamer.makeUnique(p.name); } // Write enclosing function. - if (w.dartBool && functionType.returnType.typealiasType is BooleanType) { - // Use bool return type in enclosing function. - s.write('bool $enclosingFuncName(\n'); - } else { - s.write( - '${functionType.returnType.getDartType(w)} $enclosingFuncName(\n'); - } + s.write('${functionType.returnType.getDartType(w)} $enclosingFuncName(\n'); for (final p in functionType.parameters) { - if (w.dartBool && p.type.typealiasType is BooleanType) { - // Use bool parameter type in enclosing function. - s.write(' bool ${p.name},\n'); - } else { - s.write(' ${p.type.getDartType(w)} ${p.name},\n'); - } + s.write(' ${p.type.getDartType(w)} ${p.name},\n'); } s.write(') {\n'); s.write('return $funcVarName'); s.write('(\n'); for (final p in functionType.parameters) { - if (w.dartBool && p.type.typealiasType is BooleanType) { - // Convert bool parameter to int before calling. - s.write(' ${p.name}?1:0,\n'); - } else { - s.write(' ${p.name},\n'); - } - } - if (w.dartBool && functionType.returnType.typealiasType is BooleanType) { - // Convert int return type to bool. - s.write(' )!=0;\n'); - } else { - s.write(' );\n'); + s.write(' ${p.name},\n'); } + s.write(' );\n'); s.write('}\n'); final cType = exposeFunctionTypedefs diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index b88a565c63..a651871f51 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -29,7 +29,6 @@ class Library { String? description, required List bindings, String? header, - bool dartBool = true, bool sort = false, StructPackingOverride? packingOverride, Set? libraryImports, @@ -75,7 +74,6 @@ class Library { className: name, classDocComment: description, header: header, - dartBool: dartBool, additionalImports: libraryImports, ); } diff --git a/pkgs/ffigen/lib/src/code_generator/native_type.dart b/pkgs/ffigen/lib/src/code_generator/native_type.dart index e05d170f22..4be4b16f3a 100644 --- a/pkgs/ffigen/lib/src/code_generator/native_type.dart +++ b/pkgs/ffigen/lib/src/code_generator/native_type.dart @@ -66,7 +66,7 @@ class NativeType extends Type { class BooleanType extends NativeType { // Booleans are treated as uint8. - const BooleanType._() : super._('Uint8', 'int', '0'); + const BooleanType._() : super._('Bool', 'bool', 'false'); static const _boolean = BooleanType._(); factory BooleanType() => _boolean; diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index 1e398fc7a6..77e9e834e5 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -60,8 +60,6 @@ class Writer { late String _symbolAddressVariableName; late String _symbolAddressLibraryVarName; - final bool dartBool; - /// Initial namers set after running constructor. Namers are reset to this /// initial state everytime [generate] is called. late UniqueNamer _initialTopLevelUniqueNamer, _initialWrapperLevelUniqueNamer; @@ -82,7 +80,6 @@ class Writer { required this.lookUpBindings, required this.noLookUpBindings, required String className, - required this.dartBool, Set? additionalImports, this.classDocComment, this.header, diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 0891c70e35..e9d1f97d9e 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -119,10 +119,6 @@ class Config { StructPackingOverride get structPackingOverride => _structPackingOverride; late StructPackingOverride _structPackingOverride; - /// If dart bool should be generated for C booleans. - bool get dartBool => _dartBool; - late bool _dartBool; - /// Name of the wrapper class. String get wrapperName => _wrapperName; late String _wrapperName; @@ -437,13 +433,6 @@ class Config { extractedResult: (dynamic result) => _structPackingOverride = result as StructPackingOverride, ), - [strings.dartBool]: Specification( - requirement: Requirement.no, - validator: booleanValidator, - extractor: booleanExtractor, - defaultValue: () => true, - extractedResult: (dynamic result) => _dartBool = result as bool, - ), [strings.name]: Specification( requirement: Requirement.prefer, validator: dartClassNameValidator, diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index b400d847e7..2adbb0bfbb 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -28,7 +28,6 @@ Library parse(Config c) { name: config.wrapperName, description: config.wrapperDocComment, header: config.preamble, - dartBool: config.dartBool, sort: config.sort, packingOverride: config.structPackingOverride, libraryImports: c.libraryImports.values.toSet(), diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 7f0f0281ae..8186221905 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -167,7 +167,6 @@ const supportedNativeType_mappings = { // Boolean flags. const sort = 'sort'; const useSupportedTypedefs = 'use-supported-typedefs'; -const dartBool = 'dart-bool'; const useDartHandle = 'use-dart-handle'; const comments = 'comments'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index d249b7b6b9..51050c2234 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 5.0.1 +version: 6.0.0 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen diff --git a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart index 5ef4980b02..046ee8fa19 100644 --- a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart @@ -333,7 +333,6 @@ void main() { test('boolean_dartBool', () { final library = Library( name: 'Bindings', - dartBool: true, bindings: [ Func( name: 'test1', @@ -353,29 +352,6 @@ void main() { ); _matchLib(library, 'boolean_dartbool'); }); - test('boolean_no_dartBool', () { - final library = Library( - name: 'Bindings', - dartBool: false, - bindings: [ - Func( - name: 'test1', - returnType: BooleanType(), - parameters: [ - Parameter(name: 'a', type: BooleanType()), - Parameter(name: 'b', type: PointerType(BooleanType())), - ], - ), - Struct( - name: 'Test2', - members: [ - Member(name: 'a', type: BooleanType()), - ], - ), - ], - ); - _matchLib(library, 'boolean_no_dartbool'); - }); test('sort bindings', () { final library = Library( name: 'Bindings', diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart index 2e9412123d..188f972165 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart @@ -19,23 +19,22 @@ class Bindings { bool test1( bool a, - ffi.Pointer b, + ffi.Pointer b, ) { return _test1( - a ? 1 : 0, - b, - ) != - 0; + a, + b, + ); } late final _test1Ptr = _lookup< ffi.NativeFunction< - ffi.Uint8 Function(ffi.Uint8, ffi.Pointer)>>('test1'); + ffi.Bool Function(ffi.Bool, ffi.Pointer)>>('test1'); late final _test1 = - _test1Ptr.asFunction)>(); + _test1Ptr.asFunction)>(); } class Test2 extends ffi.Struct { - @ffi.Uint8() - external int a; + @ffi.Bool() + external bool a; } diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart deleted file mode 100644 index c44ddddb7d..0000000000 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart +++ /dev/null @@ -1,40 +0,0 @@ -// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -import 'dart:ffi' as ffi; - -class Bindings { - /// Holds the symbol lookup function. - final ffi.Pointer Function(String symbolName) - _lookup; - - /// The symbols are looked up in [dynamicLibrary]. - Bindings(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; - - /// The symbols are looked up with [lookup]. - Bindings.fromLookup( - ffi.Pointer Function(String symbolName) - lookup) - : _lookup = lookup; - - int test1( - int a, - ffi.Pointer b, - ) { - return _test1( - a, - b, - ); - } - - late final _test1Ptr = _lookup< - ffi.NativeFunction< - ffi.Uint8 Function(ffi.Uint8, ffi.Pointer)>>('test1'); - late final _test1 = - _test1Ptr.asFunction)>(); -} - -class Test2 extends ffi.Struct { - @ffi.Uint8() - external int a; -} diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart index 3c8e4c35cc..546f1ce0cf 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart @@ -69,19 +69,18 @@ class Bindings { late final _func3 = _func3Ptr.asFunction(); bool func4( - ffi.Pointer a, + ffi.Pointer a, ) { return _func4( - a, - ) != - 0; + a, + ); } late final _func4Ptr = - _lookup)>>( + _lookup)>>( 'func4'); late final _func4 = - _func4Ptr.asFunction)>(); + _func4Ptr.asFunction)>(); } class Struct1 extends ffi.Struct { @@ -115,6 +114,6 @@ typedef NestingASpecifiedType = ffi.IntPtr; class Struct2 extends ffi.Opaque {} class WithBoolAlias extends ffi.Struct { - @ffi.Uint8() - external int b; + @ffi.Bool() + external bool b; } diff --git a/pkgs/ffigen/test/native_test/native_test_bindings.dart b/pkgs/ffigen/test/native_test/native_test_bindings.dart index 8ca13effc7..6fd5a6a460 100644 --- a/pkgs/ffigen/test/native_test/native_test_bindings.dart +++ b/pkgs/ffigen/test/native_test/native_test_bindings.dart @@ -25,15 +25,14 @@ class NativeLibrary { bool x, ) { return _Function1Bool( - x ? 1 : 0, - ) != - 0; + x, + ); } late final _Function1BoolPtr = - _lookup>( - 'Function1Bool'); - late final _Function1Bool = _Function1BoolPtr.asFunction(); + _lookup>('Function1Bool'); + late final _Function1Bool = + _Function1BoolPtr.asFunction(); int Function1Uint8( int x, From 4cf58c70dfb3ea4b8dc82e4da740057704e2b5f2 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Tue, 31 May 2022 18:00:44 +0200 Subject: [PATCH 156/276] [ffigen] bump package:ffi (#394) --- pkgs/ffigen/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 51050c2234..d1345f9485 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -11,7 +11,7 @@ environment: sdk: '>=2.17.0 <3.0.0' dependencies: - ffi: ^1.2.1 + ffi: ^2.0.0 yaml: ^3.0.0 path: ^1.8.0 quiver: ^3.0.0 From 9858cfc5e7e9427a9db5ebce37710d87e502dc13 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Tue, 7 Jun 2022 11:55:42 +0530 Subject: [PATCH 157/276] [ffigen] Update README.md (#396) --- pkgs/ffigen/README.md | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 0655482829..a1951e4d4e 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -397,18 +397,6 @@ sort: true ```yaml use-supported-typedefs: true -``` -
  • dart-boolShould generate dart `bool` instead of Uint8 for c99 bool in functions.
    - Default: true -
    - -```yaml -dart-bool: true ```
    -## Limitations -1. Multi OS support for types such as long. [Issue #7](https://github.com/dart-lang/ffigen/issues/7) - ## Trying out examples 1. `cd examples/`, Run `dart pub get`. 2. Run `dart run ffigen`. @@ -564,11 +549,6 @@ Note: exclude overrides include. Ffigen treats `char*` just as any other pointer,(`Pointer`). To convert these to/from `String`, you can use [package:ffi](https://pub.dev/packages/ffi). Use `ptr.cast().toDartString()` to convert `char*` to dart `string` and `"str".toNativeUtf8()` to convert `string` to `char*`. -### How does ffigen handle C99 bool data type? - -Although `dart:ffi` doesn't have a NativeType for `bool`, they can be implemented as `Uint8`. -Ffigen generates dart `bool` for function parameters and return type by default. -To disable this, and use `int` instead, set `dart-bool: false` in configurations. ### How are unnamed enums handled? From e1d384ddb91916c46acec7185284edd8a27dc098 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 9 Jun 2022 20:05:16 +0200 Subject: [PATCH 158/276] [ffigen] Fix `include-directives` on Windows (#397) --- pkgs/ffigen/CHANGELOG.md | 4 ++++ pkgs/ffigen/example/c_json/pubspec.yaml | 2 +- pkgs/ffigen/example/libclang-example/pubspec.yaml | 2 +- pkgs/ffigen/example/simple/pubspec.yaml | 2 +- pkgs/ffigen/lib/src/config_provider/spec_utils.dart | 3 ++- pkgs/ffigen/pubspec.yaml | 2 +- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index d8d6976aa7..83edcb08fc 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 6.0.1 + +- Replace path separators in `include-directives` before matching file names. + # 6.0.0 - Removed config `dart-bool`. Booleans are now always generated with `bool` and `ffi.Bool` as it's Dart and C Type respectively. diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index fc21ca9a0f..b44f706bf6 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=2.17.0 <3.0.0' dependencies: - ffi: ^1.2.1 + ffi: ^2.0.0 path: ^1.8.0 dev_dependencies: diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index cd3a1c3d02..e177eecd10 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=2.17.0 <3.0.0' dependencies: - ffi: ^1.2.1 + ffi: ^2.0.0 dev_dependencies: ffigen: path: '../../' diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index 8c45afc1a7..8a97930317 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=2.17.0 <3.0.0' dependencies: - ffi: ^1.2.1 + ffi: ^2.0.0 dev_dependencies: ffigen: path: '../../' diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 9d7263e6b5..aaa4c08ec2 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -307,7 +307,8 @@ Headers headersExtractor(dynamic yamlConfig) { if (key == strings.includeDirectives) { for (final h in (yamlConfig[key] as YamlList)) { final headerGlob = h as String; - includeGlobs.add(quiver.Glob(headerGlob)); + final fixedGlob = _replaceSeparators(headerGlob); + includeGlobs.add(quiver.Glob(fixedGlob)); } } } diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index d1345f9485..ffe24d0d06 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 6.0.0 +version: 6.0.1 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen From 6cad23830f31815a25e2b28116e2712ec2ed88c4 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Tue, 14 Jun 2022 17:47:08 +0200 Subject: [PATCH 159/276] [ffigen] Add Windows CI (#399) --- .../ffigen/.github/workflows/test-package.yml | 19 +++++++++++++++++-- pkgs/ffigen/test/native_test/native_test.dart | 6 ++++-- pkgs/ffigen/test/setup.dart | 10 ++++------ pkgs/ffigen/test/test_utils.dart | 6 ++++-- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 1b6b494b79..672f339040 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -37,7 +37,7 @@ jobs: run: dart analyze --fatal-infos if: always() && steps.install.outcome == 'success' - test: + test-linux: needs: analyze # This job requires clang-10 which is the default on 20.04 runs-on: ubuntu-20.04 @@ -55,7 +55,7 @@ jobs: - name: Run VM tests run: dart test --platform vm - mac-test: + test-mac: needs: analyze runs-on: macos-latest steps: @@ -76,3 +76,18 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: lcov.info + + test-windows: + needs: analyze + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: dart-lang/setup-dart@v1.0 + with: + sdk: stable + - name: Install dependencies + run: dart pub get + - name: Build test dylib and bindings + run: dart test/setup.dart + - name: Run VM tests + run: dart test --platform vm diff --git a/pkgs/ffigen/test/native_test/native_test.dart b/pkgs/ffigen/test/native_test/native_test.dart index d98b686176..4365214fbf 100644 --- a/pkgs/ffigen/test/native_test/native_test.dart +++ b/pkgs/ffigen/test/native_test/native_test.dart @@ -40,8 +40,10 @@ void main() { library.generateFile(file); try { - final actual = file.readAsStringSync(); - final expected = File(path.join(config.output)).readAsStringSync(); + final actual = file.readAsStringSync().replaceAll('\r', ''); + final expected = File(path.join(config.output)) + .readAsStringSync() + .replaceAll('\r', ''); expect(actual, expected); if (file.existsSync()) { file.delete(); diff --git a/pkgs/ffigen/test/setup.dart b/pkgs/ffigen/test/setup.dart index e660598d7f..3439901f27 100644 --- a/pkgs/ffigen/test/setup.dart +++ b/pkgs/ffigen/test/setup.dart @@ -8,16 +8,14 @@ import 'dart:async'; import 'dart:io'; -import 'package:path/path.dart' as path; - Future _run(String subdir, String script) async { - final dir = path.join(path.dirname(Platform.script.path), subdir); - print('\nRunning $script in $dir'); - final args = ['run', path.join(dir, script)]; + final dir = Platform.script.resolve('$subdir/'); + print('\nRunning $script in ${dir.toFilePath()}'); + final args = ['run', dir.resolve(script).toFilePath()]; final process = await Process.start( Platform.executable, args, - workingDirectory: dir, + workingDirectory: dir.toFilePath(), ); unawaited(stdout.addStream(process.stdout)); unawaited(stderr.addStream(process.stderr)); diff --git a/pkgs/ffigen/test/test_utils.dart b/pkgs/ffigen/test/test_utils.dart index 196da1e5ea..314f8aad1e 100644 --- a/pkgs/ffigen/test/test_utils.dart +++ b/pkgs/ffigen/test/test_utils.dart @@ -51,8 +51,10 @@ void matchLibraryWithExpected( library.generateFile(file); try { - final actual = file.readAsStringSync(); - final expected = File(path.joinAll(pathToExpected)).readAsStringSync(); + final actual = file.readAsStringSync().replaceAll('\r', ''); + final expected = File(path.joinAll(pathToExpected)) + .readAsStringSync() + .replaceAll('\r', ''); expect(actual, expected); if (file.existsSync()) { file.delete(); From 0179324dfb208c49b58bc702c73fd3df9a01a044 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Tue, 14 Jun 2022 17:48:01 +0200 Subject: [PATCH 160/276] [ffigen] More ways to find XCode's libclang on MacOS (#402) --- .../lib/src/config_provider/spec_utils.dart | 17 +++++++++++++++++ pkgs/ffigen/lib/src/strings.dart | 10 +++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index aaa4c08ec2..a7d6d09063 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -391,6 +391,23 @@ String findDylibAtDefaultLocations() { k = findLibclangDylib(l); if (k != null) return k; } + final findLibraryResult = + Process.runSync('xcodebuild', ['-find-library', 'libclang.dylib']); + if (findLibraryResult.exitCode == 0) { + final location = (findLibraryResult.stdout as String).split('\n').first; + if (File(location).existsSync()) { + return location; + } + } + final xcodePathResult = Process.runSync('xcode-select', ['-print-path']); + if (xcodePathResult.exitCode == 0) { + final xcodePath = (xcodePathResult.stdout as String).split('\n').first; + final location = + p.join(xcodePath, strings.xcodeDylibLocation, strings.dylibFileName); + if (File(location).existsSync()) { + return location; + } + } } else { throw Exception('Unsupported Platform.'); } diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 8186221905..f2603d3dbf 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -207,10 +207,18 @@ const windowsDylibLocations = { r'C:\Program Files\LLVM\bin\', }; const macOsDylibLocations = { + // Default Xcode commandline tools installation. + '/Library/Developer/CommandLineTools/usr/', + // Default path for LLVM installed with apt-get. '/usr/local/opt/llvm/lib/', + // Default path for LLVM installed with brew. '/opt/homebrew/opt/llvm/lib/', - '/Library/Developer/CommandLineTools/usr/', + // Default Xcode installation. + // Last because it does not include ObjectiveC headers by default. + // See https://github.com/dart-lang/ffigen/pull/402#issuecomment-1154348670. + '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/', }; +const xcodeDylibLocation = 'Toolchains/XcodeDefault.xctoolchain/usr/lib/'; // Writen doubles. const doubleInfinity = 'double.infinity'; From 153aad5cab417fd86691a8cd07f960419fa1411b Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Tue, 14 Jun 2022 18:10:36 +0200 Subject: [PATCH 161/276] [ffigen] Use `ldconfig` to find libclang (#403) --- pkgs/ffigen/CHANGELOG.md | 1 + .../ffigen/lib/src/config_provider/spec_utils.dart | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 83edcb08fc..dfaacab841 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,6 +1,7 @@ # 6.0.1 - Replace path separators in `include-directives` before matching file names. +- Add more ways to find `libclang`. # 6.0.0 - Removed config `dart-bool`. Booleans are now always generated with `bool` diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index a7d6d09063..015d92e4e7 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -381,6 +381,20 @@ String findDylibAtDefaultLocations() { k = findLibclangDylib(l); if (k != null) return k; } + Process.runSync('ldconfig', ['-p']); + final ldConfigResult = Process.runSync('ldconfig', ['-p']); + if (ldConfigResult.exitCode == 0) { + final lines = (ldConfigResult.stdout as String).split('\n'); + final paths = [ + for (final line in lines) + if (line.contains('libclang')) line.split(' => ')[1], + ]; + for (final location in paths) { + if (File(location).existsSync()) { + return location; + } + } + } } else if (Platform.isWindows) { for (final l in strings.windowsDylibLocations) { k = findLibclangDylib(l); From b15555b22268967c4a08fb46856afd51b10f7827 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Tue, 21 Jun 2022 18:32:02 +0200 Subject: [PATCH 162/276] [ffigen] Bump `package:ffi` (#405) --- pkgs/ffigen/CHANGELOG.md | 4 ++++ pkgs/ffigen/example/c_json/pubspec.yaml | 2 +- pkgs/ffigen/example/libclang-example/pubspec.yaml | 2 +- pkgs/ffigen/example/simple/pubspec.yaml | 2 +- pkgs/ffigen/pubspec.yaml | 4 ++-- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index dfaacab841..27f1fc68bd 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 6.0.2 + +- Bump `package:ffi` to 2.0.1. + # 6.0.1 - Replace path separators in `include-directives` before matching file names. diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index b44f706bf6..7ef1ce8375 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=2.17.0 <3.0.0' dependencies: - ffi: ^2.0.0 + ffi: ^2.0.1 path: ^1.8.0 dev_dependencies: diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index e177eecd10..f47795758e 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=2.17.0 <3.0.0' dependencies: - ffi: ^2.0.0 + ffi: ^2.0.1 dev_dependencies: ffigen: path: '../../' diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index 8a97930317..e1a3e14d51 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=2.17.0 <3.0.0' dependencies: - ffi: ^2.0.0 + ffi: ^2.0.1 dev_dependencies: ffigen: path: '../../' diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index ffe24d0d06..400fdd3db2 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 6.0.1 +version: 6.0.2 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen @@ -11,7 +11,7 @@ environment: sdk: '>=2.17.0 <3.0.0' dependencies: - ffi: ^2.0.0 + ffi: ^2.0.1 yaml: ^3.0.0 path: ^1.8.0 quiver: ^3.0.0 From 04dc916d4a2c8dd02be090d2d7fca09575a35956 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Fri, 24 Jun 2022 12:10:13 -0700 Subject: [PATCH 163/276] [ffigen] Add a call method to Blocks (#407) * Add a call method to Blocks, so that ObjC blocks can be called from Dart * fmt --- .../lib/src/code_generator/objc_block.dart | 17 +++++++++++++++++ .../test/native_objc_test/block_test.dart | 2 ++ 2 files changed, 19 insertions(+) diff --git a/pkgs/ffigen/lib/src/code_generator/objc_block.dart b/pkgs/ffigen/lib/src/code_generator/objc_block.dart index 7ae748647e..711e469375 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_block.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_block.dart @@ -52,6 +52,7 @@ class ObjCBlock extends BindingType { final trampFuncType = FunctionType( returnType: returnType, parameters: [Parameter(type: blockPtr, name: 'block'), ...params]); + final natTrampFnType = NativeFunc(trampFuncType); // Write the function pointer based trampoline function. s.write(returnType.getDartType(w)); @@ -117,6 +118,22 @@ $voidPtr $registerClosure(Function fn) { $exceptionalReturn).cast(), $registerClosure(fn)); '''); + // Call method. + s.write(' ${returnType.getDartType(w)} call('); + for (int i = 0; i < params.length; ++i) { + s.write('${i == 0 ? '' : ', '}${params[i].type.getDartType(w)}'); + s.write(' ${params[i].name}'); + } + s.write(''') { + ${isVoid ? '' : 'return '}_impl.ref.invoke.cast< + ${natTrampFnType.getCType(w)}>().asFunction< + ${trampFuncType.getDartType(w)}>()(_impl'''); + for (int i = 0; i < params.length; ++i) { + s.write(', ${params[i].name}'); + } + s.write('''); + }'''); + // Get the pointer to the underlying block. s.write(' ${blockPtr.getCType(w)} get pointer => _impl;\n'); diff --git a/pkgs/ffigen/test/native_objc_test/block_test.dart b/pkgs/ffigen/test/native_objc_test/block_test.dart index 4586cd88cb..87f882da4c 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.dart +++ b/pkgs/ffigen/test/native_objc_test/block_test.dart @@ -42,6 +42,7 @@ void main() { final blockTester = BlockTester.makeFromBlock_(lib, block.pointer); blockTester.pokeBlock(); expect(blockTester.call_(123), 223); + expect(block(123), 223); }); int Function(int) makeAdder(int addTo) { @@ -53,6 +54,7 @@ void main() { final blockTester = BlockTester.makeFromBlock_(lib, block.pointer); blockTester.pokeBlock(); expect(blockTester.call_(123), 4123); + expect(block(123), 4123); }); }); } From 151ed1213ae75f41887908881377f90075afd509 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Fri, 1 Jul 2022 02:08:18 -0700 Subject: [PATCH 164/276] [ffigen] Fixing mac bot by explicitly setting the objective C sysroot (#414) --- pkgs/ffigen/lib/src/header_parser/parser.dart | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index 2adbb0bfbb..837d158711 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:ffi'; +import 'dart:io'; import 'package:ffi/ffi.dart'; import 'package:ffigen/src/code_generator.dart'; @@ -65,7 +66,10 @@ List parseToBindings() { /// If the config targets Objective C, add a compiler opt for it. if (config.language == Language.objc) { - compilerOpts.addAll(strings.clangLangObjC); + compilerOpts.addAll([ + ...strings.clangLangObjC, + ..._findObjectiveCSysroot(), + ]); } _logger.fine('CompilerOpts used: $compilerOpts'); @@ -119,3 +123,15 @@ List parseToBindings() { clang.clang_disposeIndex(index); return bindings.toList(); } + +List _findObjectiveCSysroot() { + final result = Process.runSync('xcrun', ['--show-sdk-path']); + if (result.exitCode == 0) { + for (final line in (result.stdout as String).split('\n')) { + if (line.isNotEmpty) { + return ['-isysroot', line]; + } + } + } + return []; +} From ed819e35ffa6cbc2079b1df7c43f0c0f864f8155 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 6 Jul 2022 09:03:31 -0700 Subject: [PATCH 165/276] [ffigen] Skip methods that have incomplete types (#412) * Skip methods that have incomplete types Also change how method return types are parsed * Fix overly generic method return types * Fix tests --- .../src/code_generator/objc_interface.dart | 11 +++-- .../clang_bindings/clang_bindings.dart | 17 ++++++++ .../sub_parsers/objcinterfacedecl_parser.dart | 43 ++++++++----------- .../type_extractor/extractor.dart | 7 +++ .../native_objc_test/bad_method_config.yaml | 23 ++++++++++ .../native_objc_test/bad_method_test.dart | 34 +++++++++++++++ .../test/native_objc_test/bad_method_test.m | 29 +++++++++++++ pkgs/ffigen/test/native_objc_test/setup.dart | 1 + pkgs/ffigen/tool/libclang_config.yaml | 1 + 9 files changed, 136 insertions(+), 30 deletions(-) create mode 100644 pkgs/ffigen/test/native_objc_test/bad_method_config.yaml create mode 100644 pkgs/ffigen/test/native_objc_test/bad_method_test.dart create mode 100644 pkgs/ffigen/test/native_objc_test/bad_method_test.m diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 04eb6e5b33..b33e97b75d 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -125,7 +125,7 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { for (final m in methods.values) { final methodName = m._getDartMethodName(uniqueNamer); final isStatic = m.isClass; - final returnType = m.returnType!; + final returnType = m.returnType; // The method declaration. if (m.dartDoc != null) { @@ -397,7 +397,7 @@ class ObjCMethod { final String? dartDoc; final String originalName; final ObjCProperty? property; - Type? returnType; + final Type returnType; final bool isNullableReturn; final List params; final ObjCMethodKind kind; @@ -412,7 +412,7 @@ class ObjCMethod { this.dartDoc, required this.kind, required this.isClass, - this.returnType, + required this.returnType, this.isNullableReturn = false, List? params_, }) : params = params_ ?? []; @@ -423,14 +423,13 @@ class ObjCMethod { void addDependencies( Set dependencies, ObjCBuiltInFunctions builtInFunctions) { - returnType ??= NativeType(SupportedNativeType.Void); - returnType!.addDependencies(dependencies); + returnType.addDependencies(dependencies); for (final p in params) { p.type.addDependencies(dependencies); } selObject ??= builtInFunctions.getSelObject(originalName) ..addDependencies(dependencies); - msgSend ??= builtInFunctions.getMsgSendFunc(returnType!, params) + msgSend ??= builtInFunctions.getMsgSendFunc(returnType, params) ..addDependencies(dependencies); } diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 58108aaeeb..e8755f51d1 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -791,6 +791,23 @@ class Clang { _clang_Type_getObjCObjectBaseTypePtr .asFunction(); + /// 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_getCursorResultType( + C, + ); + } + + late final _clang_getCursorResultTypePtr = + _lookup>( + 'clang_getCursorResultType'); + late final _clang_getCursorResultType = + _clang_getCursorResultTypePtr.asFunction(); + /// 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, diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index bf9d038725..f2e4fc9042 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -178,8 +178,8 @@ void _parseProperty(clang_types.CXCursor cursor) { property: property, dartDoc: dartDoc, kind: ObjCMethodKind.propertySetter, - isClass: isClass); - setter.returnType = NativeType(SupportedNativeType.Void); + isClass: isClass, + returnType: NativeType(SupportedNativeType.Void)); setter.params .add(ObjCMethodParam(fieldType, 'value', isNullable: isNullable)); itf.addMethod(setter); @@ -190,11 +190,19 @@ void _parseMethod(clang_types.CXCursor cursor) { final methodName = cursor.spelling(); final isClassMethod = cursor.kind == clang_types.CXCursorKind.CXCursor_ObjCClassMethodDecl; + final returnType = clang.clang_getCursorResultType(cursor).toCodeGenType(); + if (returnType.isIncompleteCompound) { + _logger.warning('Method "$methodName" in instance ' + '"${_interfaceStack.top.interface.originalName}" has incomplete ' + 'return type: $returnType.'); + return; + } final method = ObjCMethod( originalName: methodName, dartDoc: getCursorDocComment(cursor), kind: ObjCMethodKind.method, isClass: isClassMethod, + returnType: returnType, ); final parsed = _ParsedObjCMethod(method); _logger.fine(' > ${isClassMethod ? 'Class' : 'Instance'} method: ' @@ -215,10 +223,6 @@ void _parseMethod(clang_types.CXCursor cursor) { int _parseMethodVisitor(clang_types.CXCursor cursor, clang_types.CXCursor parent, Pointer clientData) { switch (cursor.kind) { - case clang_types.CXCursorKind.CXCursor_TypeRef: - case clang_types.CXCursorKind.CXCursor_ObjCClassRef: - _parseMethodReturnType(cursor); - break; case clang_types.CXCursorKind.CXCursor_ParmDecl: _parseMethodParam(cursor); break; @@ -230,22 +234,6 @@ int _parseMethodVisitor(clang_types.CXCursor cursor, return clang_types.CXChildVisitResult.CXChildVisit_Continue; } -void _parseMethodReturnType(clang_types.CXCursor cursor) { - final parsed = _methodStack.top; - if (parsed.method.returnType != null) { - parsed.hasError = true; - _logger.fine( - ' >> Extra return type: ${cursor.completeStringRepr()}'); - _logger.warning('Method "${parsed.method.originalName}" in instance ' - '"${_interfaceStack.top.interface.originalName}" has multiple return ' - 'types.'); - } else { - parsed.method.returnType = cursor.type().toCodeGenType(); - _logger.fine(' >> Return type: ' - '${parsed.method.returnType} ${cursor.completeStringRepr()}'); - } -} - void _parseMethodParam(clang_types.CXCursor cursor) { /* TODO(#334): Change this to use: @@ -260,14 +248,21 @@ void _parseMethodParam(clang_types.CXCursor cursor) { option set. */ + final parsed = _methodStack.top; final isNullable = cursor.type().kind == clang_types.CXTypeKind.CXType_ObjCObjectPointer; final name = cursor.spelling(); final type = cursor.type().toCodeGenType(); + if (type.isIncompleteCompound) { + parsed.hasError = true; + _logger.warning('Method "${parsed.method.originalName}" in instance ' + '"${_interfaceStack.top.interface.originalName}" has incomplete ' + 'parameter type: $type.'); + return; + } _logger.fine( ' >> Parameter: $type $name ${cursor.completeStringRepr()}'); - _methodStack.top.method.params - .add(ObjCMethodParam(type, name, isNullable: isNullable)); + parsed.method.params.add(ObjCMethodParam(type, name, isNullable: isNullable)); } void _markMethodReturnsRetained(clang_types.CXCursor cursor) { diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 1a69715c40..31420cdc69 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -45,6 +45,13 @@ Type getCodeGenType( if (config.language == Language.objc) { switch (cxtype.kind) { case clang_types.CXTypeKind.CXType_ObjCObjectPointer: + final pt = clang.clang_getPointeeType(cxtype); + final s = getCodeGenType(pt, + ignoreFilter: ignoreFilter, pointerReference: true); + if (s is ObjCInterface) { + return s; + } + return PointerType(objCObjectType); case clang_types.CXTypeKind.CXType_ObjCId: case clang_types.CXTypeKind.CXType_ObjCTypeParam: case clang_types.CXTypeKind.CXType_ObjCClass: diff --git a/pkgs/ffigen/test/native_objc_test/bad_method_config.yaml b/pkgs/ffigen/test/native_objc_test/bad_method_config.yaml new file mode 100644 index 0000000000..d26ff79c56 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/bad_method_config.yaml @@ -0,0 +1,23 @@ +# Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +# =================== GENERATING TEST BINDINGS ================== +# dart run ffigen --config test/bad_method_test/config.yaml +# =============================================================== + +name: NativeObjCLibrary +description: 'Native Objective C test' +language: objc +output: 'test/native_objc_test/bad_method_test_bindings.dart' +objc-interfaces: + include: + - 'BadMethodTestObject' +functions: + exclude: + - '.*' +headers: + entry-points: + - 'test/native_objc_test/bad_method_test.m' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/bad_method_test.dart b/pkgs/ffigen/test/native_objc_test/bad_method_test.dart new file mode 100644 index 0000000000..625cc2b3ad --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/bad_method_test.dart @@ -0,0 +1,34 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:test/test.dart'; +import '../test_utils.dart'; +import 'bad_method_test_bindings.dart'; +import 'util.dart'; + +void main() { + late NativeObjCLibrary lib; + group('bad_method_test', () { + setUpAll(() { + logWarnings(); + final dylib = File('test/native_objc_test/bad_method_test.dylib'); + verifySetupFile(dylib); + lib = NativeObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); + generateBindingsForCoverage('bad_method'); + }); + + test("Test methods that weren't skipped", () { + final obj = BadMethodTestObject.new1(lib); + final structPtr = obj.incompletePointerReturn(); + expect(structPtr.address, 1234); + expect(obj.incompletePointerParam_(structPtr), 1234); + }); + }); +} diff --git a/pkgs/ffigen/test/native_objc_test/bad_method_test.m b/pkgs/ffigen/test/native_objc_test/bad_method_test.m new file mode 100644 index 0000000000..132daf8127 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/bad_method_test.m @@ -0,0 +1,29 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#import + +struct IncompleteStruct; + +@interface BadMethodTestObject : NSObject { +} + +- (struct IncompleteStruct)incompleteReturn; // Skipped. +- (struct IncompleteStruct*)incompletePointerReturn; // Not skipped. +- (int64_t)incompleteParam:(struct IncompleteStruct)x; // Skipped. +- (int64_t)incompletePointerParam:(struct IncompleteStruct*)x; // Not skipped. + +@end + +@implementation BadMethodTestObject + +- (struct IncompleteStruct*)incompletePointerReturn { + return (struct IncompleteStruct*)1234; +} + +- (int64_t)incompletePointerParam:(struct IncompleteStruct*)x { + return (int64_t)x; +} + +@end diff --git a/pkgs/ffigen/test/native_objc_test/setup.dart b/pkgs/ffigen/test/native_objc_test/setup.dart index 22d99c9e32..78c7427362 100644 --- a/pkgs/ffigen/test/native_objc_test/setup.dart +++ b/pkgs/ffigen/test/native_objc_test/setup.dart @@ -47,6 +47,7 @@ Future _generateBindings(String config) async { const testNames = [ 'automated_ref_count', + 'bad_method', 'block', 'cast', 'category', diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index ad0bfd048e..3087cf8c06 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -90,6 +90,7 @@ functions: - clang_Cursor_getArgument - clang_getNumArgTypes - clang_getArgType + - clang_getCursorResultType - clang_getEnumConstantDeclValue - clang_equalRanges - clang_Cursor_getCommentRange From 691eb2b69d9dd02d7d3797476fb4b735f3b0466e Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Thu, 7 Jul 2022 08:38:48 -0700 Subject: [PATCH 166/276] [ffigen] Check that property types aren't incomplete (#415) * Skip methods that have incomplete types Also change how method return types are parsed * Fix overly generic method return types * Fix tests * Bit field test * Fix the bug * Fix warning wording --- .../sub_parsers/objcinterfacedecl_parser.dart | 7 +++++++ .../native_objc_test/bad_method_test.dart | 9 ++++++++- .../test/native_objc_test/bad_method_test.m | 20 +++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index f2e4fc9042..3c8aab34cc 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -137,6 +137,13 @@ void _parseProperty(clang_types.CXCursor cursor) { final itf = _interfaceStack.top.interface; final fieldName = cursor.spelling(); final fieldType = cursor.type().toCodeGenType(); + + if (fieldType.isIncompleteCompound) { + _logger.warning('Property "$fieldName" in instance "${itf.originalName}" ' + 'has incomplete type: $fieldType.'); + return; + } + final dartDoc = getCursorDocComment(cursor); final propertyAttributes = diff --git a/pkgs/ffigen/test/native_objc_test/bad_method_test.dart b/pkgs/ffigen/test/native_objc_test/bad_method_test.dart index 625cc2b3ad..3b87c5bd38 100644 --- a/pkgs/ffigen/test/native_objc_test/bad_method_test.dart +++ b/pkgs/ffigen/test/native_objc_test/bad_method_test.dart @@ -24,11 +24,18 @@ void main() { generateBindingsForCoverage('bad_method'); }); - test("Test methods that weren't skipped", () { + test("Test incomplete struct methods that weren't skipped", () { final obj = BadMethodTestObject.new1(lib); final structPtr = obj.incompletePointerReturn(); expect(structPtr.address, 1234); expect(obj.incompletePointerParam_(structPtr), 1234); }); + + test("Test bit field methods that weren't skipped", () { + final obj = BadMethodTestObject.new1(lib); + final bitFieldPtr = obj.bitFieldPointerReturn(); + expect(bitFieldPtr.address, 5678); + expect(obj.bitFieldPointerParam_(bitFieldPtr), 5678); + }); }); } diff --git a/pkgs/ffigen/test/native_objc_test/bad_method_test.m b/pkgs/ffigen/test/native_objc_test/bad_method_test.m index 132daf8127..bef4ede87c 100644 --- a/pkgs/ffigen/test/native_objc_test/bad_method_test.m +++ b/pkgs/ffigen/test/native_objc_test/bad_method_test.m @@ -6,6 +6,11 @@ struct IncompleteStruct; +struct BitField { + int x:3; + int y:12; +}; + @interface BadMethodTestObject : NSObject { } @@ -14,6 +19,13 @@ - (struct IncompleteStruct*)incompletePointerReturn; // Not skipped. - (int64_t)incompleteParam:(struct IncompleteStruct)x; // Skipped. - (int64_t)incompletePointerParam:(struct IncompleteStruct*)x; // Not skipped. +- (struct BitField)bitFieldReturn; // Skipped. +- (struct BitField*)bitFieldPointerReturn; // Not skipped. +- (int64_t)bitFieldParam:(struct BitField)x; // Skipped. +- (int64_t)bitFieldPointerParam:(struct BitField*)x; // Not skipped. + +@property struct BitField bitFieldProperty; // Skipped. + @end @implementation BadMethodTestObject @@ -26,4 +38,12 @@ - (int64_t)incompletePointerParam:(struct IncompleteStruct*)x { return (int64_t)x; } +- (struct BitField*)bitFieldPointerReturn { + return (struct BitField*)5678; +} + +- (int64_t)bitFieldPointerParam:(struct BitField*)x { + return (int64_t)x; +} + @end From c71be7b5671e197d2d6e987c623691ee837acecb Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Fri, 8 Jul 2022 13:32:46 -0700 Subject: [PATCH 167/276] [ffigen] ObjC example (#416) * Add example * Skip methods that have incomplete types Also change how method return types are parsed * Update bindings * Fix overly generic method return types * Fix tests * Bit field test * Fix the bug * Fix warning wording * Update bindings * Remove the need for a dylib * Update README.md * Update examples readme * Nits * Add test * Fix analysis error * Fix more analysis errors * Fix test --- pkgs/ffigen/README.md | 2 +- pkgs/ffigen/example/README.md | 1 + pkgs/ffigen/example/objective_c/README.md | 36 + .../objective_c/avf_audio_bindings.dart | 67385 ++++++++++++++++ .../example/objective_c/play_audio.dart | 29 + pkgs/ffigen/example/objective_c/pubspec.yaml | 50 + pkgs/ffigen/example/objective_c/test.mp3 | Bin 0 -> 170147 bytes .../objective_c_example_test.dart | 48 + 8 files changed, 67550 insertions(+), 1 deletion(-) create mode 100644 pkgs/ffigen/example/objective_c/README.md create mode 100644 pkgs/ffigen/example/objective_c/avf_audio_bindings.dart create mode 100644 pkgs/ffigen/example/objective_c/play_audio.dart create mode 100644 pkgs/ffigen/example/objective_c/pubspec.yaml create mode 100644 pkgs/ffigen/example/objective_c/test.mp3 create mode 100644 pkgs/ffigen/test/example_tests/objective_c_example_test.dart diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index a1951e4d4e..929e12820a 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -186,7 +186,7 @@ compiler-opts-automatic: functions

    structs

    unions

    enums

    - unnamed-enums

    macros

    globals

    objcInterfaces + unnamed-enums

    macros

    globals

    objc-interfaces Filters for declarations.
    Default: all are included.

    Options -
    diff --git a/pkgs/ffigen/example/README.md b/pkgs/ffigen/example/README.md index 954249dda0..dd66dbb343 100644 --- a/pkgs/ffigen/example/README.md +++ b/pkgs/ffigen/example/README.md @@ -3,3 +3,4 @@ - [Simple](https://github.com/dart-lang/ffigen/tree/master/example/simple) - [cJSON](https://github.com/dart-lang/ffigen/tree/master/example/c_json) - [LibClang](https://github.com/dart-lang/ffigen/tree/master/example/libclang-example) +- [ObjectiveC](https://github.com/dart-lang/ffigen/tree/master/example/objective_c) diff --git a/pkgs/ffigen/example/objective_c/README.md b/pkgs/ffigen/example/objective_c/README.md new file mode 100644 index 0000000000..6add3e91e8 --- /dev/null +++ b/pkgs/ffigen/example/objective_c/README.md @@ -0,0 +1,36 @@ +# Objective C example + +This example shows how to use ffigen to generate bindings for an Objective C +library. It uses the AVFAudio framework to play audio files. + +``` +dart play_audio.dart test.mp3 +``` + +## Config notes + +The ffigen config for an Objective C library looks very similar to a C library. +The most important difference is that you must set `language: objc`. If you want +to filter which interfaces are included you can use the `objc-interfaces:` +option. This works similarly to the other filtering options. + +It is recommended that you filter out just about everything you're not +interested in binding (see the ffigen config in [pubspec.yaml](./pubspec.yaml)). +Virtually all Objective C libraries depend on Apple's internal libraries, which +are huge. Filtering can reduce the generated bindings from millions of lines to +tens of thousands. + +In this example, we're only interested in `AVAudioPlayer`, so we've filtered out +everything else. But ffigen will automatically pull in anything referenced by +any of the fields or methods of `AVAudioPlayer`, so we're still able to use +`NSURL` etc to load our audio file. + +## Generating bindings + +At the root of this example (`example/objective_c`), run: + +``` +dart run ffigen +``` + +This will generate [avf_audio_bindings.dart](./avf_audio_bindings.dart). diff --git a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart new file mode 100644 index 0000000000..37f1ca2f84 --- /dev/null +++ b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart @@ -0,0 +1,67385 @@ +// ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field, return_of_invalid_type, void_checks, annotate_overrides, no_leading_underscores_for_local_identifiers, library_private_types_in_public_api + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; + +/// Bindings for AVFAudio. +class AVFAudio { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + AVFAudio(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + AVFAudio.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + ffi.Pointer _registerName1(String name) { + final cstr = name.toNativeUtf8(); + final sel = _sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; + } + + ffi.Pointer _sel_registerName( + ffi.Pointer str, + ) { + return __sel_registerName( + str, + ); + } + + late final __sel_registerNamePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sel_registerName'); + late final __sel_registerName = __sel_registerNamePtr + .asFunction Function(ffi.Pointer)>(); + + ffi.Pointer _getClass1(String name) { + final cstr = name.toNativeUtf8(); + final clazz = _objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return clazz; + } + + ffi.Pointer _objc_getClass( + ffi.Pointer str, + ) { + return __objc_getClass( + str, + ); + } + + late final __objc_getClassPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('objc_getClass'); + late final __objc_getClass = __objc_getClassPtr + .asFunction Function(ffi.Pointer)>(); + + ffi.Pointer _objc_retain( + ffi.Pointer value, + ) { + return __objc_retain( + value, + ); + } + + late final __objc_retainPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('objc_retain'); + late final __objc_retain = __objc_retainPtr + .asFunction Function(ffi.Pointer)>(); + + void _objc_release( + ffi.Pointer value, + ) { + return __objc_release( + value, + ); + } + + late final __objc_releasePtr = + _lookup)>>( + 'objc_release'); + late final __objc_release = + __objc_releasePtr.asFunction)>(); + + late final _objc_releaseFinalizer1 = + ffi.NativeFinalizer(__objc_releasePtr.cast()); + late final _class_NSObject1 = _getClass1("NSObject"); + late final _sel_load1 = _registerName1("load"); + void _objc_msgSend_1( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1( + obj, + sel, + ); + } + + late final __objc_msgSend_1Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initialize1 = _registerName1("initialize"); + late final _sel_init1 = _registerName1("init"); + instancetype _objc_msgSend_2( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_2( + obj, + sel, + ); + } + + late final __objc_msgSend_2Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_new1 = _registerName1("new"); + late final _sel_allocWithZone_1 = _registerName1("allocWithZone:"); + instancetype _objc_msgSend_3( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_3( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_3Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>(); + + late final _sel_alloc1 = _registerName1("alloc"); + late final _sel_dealloc1 = _registerName1("dealloc"); + late final _sel_finalize1 = _registerName1("finalize"); + late final _sel_copy1 = _registerName1("copy"); + late final _sel_mutableCopy1 = _registerName1("mutableCopy"); + late final _sel_copyWithZone_1 = _registerName1("copyWithZone:"); + late final _sel_mutableCopyWithZone_1 = + _registerName1("mutableCopyWithZone:"); + late final _sel_instancesRespondToSelector_1 = + _registerName1("instancesRespondToSelector:"); + bool _objc_msgSend_4( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_4( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_4Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + bool _objc_msgSend_0( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer clazz, + ) { + return __objc_msgSend_0( + obj, + sel, + clazz, + ); + } + + late final __objc_msgSend_0Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_isKindOfClass_1 = _registerName1("isKindOfClass:"); + late final _class_Protocol1 = _getClass1("Protocol"); + late final _sel_conformsToProtocol_1 = _registerName1("conformsToProtocol:"); + bool _objc_msgSend_5( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer protocol, + ) { + return __objc_msgSend_5( + obj, + sel, + protocol, + ); + } + + late final __objc_msgSend_5Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_methodForSelector_1 = _registerName1("methodForSelector:"); + IMP _objc_msgSend_6( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_6( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_6Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_instanceMethodForSelector_1 = + _registerName1("instanceMethodForSelector:"); + late final _sel_doesNotRecognizeSelector_1 = + _registerName1("doesNotRecognizeSelector:"); + void _objc_msgSend_7( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_7( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_7Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_forwardingTargetForSelector_1 = + _registerName1("forwardingTargetForSelector:"); + ffi.Pointer _objc_msgSend_8( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_8( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_8Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSInvocation1 = _getClass1("NSInvocation"); + late final _class_NSMethodSignature1 = _getClass1("NSMethodSignature"); + late final _sel_signatureWithObjCTypes_1 = + _registerName1("signatureWithObjCTypes:"); + ffi.Pointer _objc_msgSend_9( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer types, + ) { + return __objc_msgSend_9( + obj, + sel, + types, + ); + } + + late final __objc_msgSend_9Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_numberOfArguments1 = _registerName1("numberOfArguments"); + int _objc_msgSend_10( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_10( + obj, + sel, + ); + } + + late final __objc_msgSend_10Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_getArgumentTypeAtIndex_1 = + _registerName1("getArgumentTypeAtIndex:"); + ffi.Pointer _objc_msgSend_11( + ffi.Pointer obj, + ffi.Pointer sel, + int idx, + ) { + return __objc_msgSend_11( + obj, + sel, + idx, + ); + } + + late final __objc_msgSend_11Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_frameLength1 = _registerName1("frameLength"); + late final _sel_isOneway1 = _registerName1("isOneway"); + bool _objc_msgSend_12( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_12( + obj, + sel, + ); + } + + late final __objc_msgSend_12Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_methodReturnType1 = _registerName1("methodReturnType"); + ffi.Pointer _objc_msgSend_13( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_13( + obj, + sel, + ); + } + + late final __objc_msgSend_13Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_methodReturnLength1 = _registerName1("methodReturnLength"); + late final _sel_cancelPreviousPerformRequestsWithTarget_selector_object_1 = + _registerName1( + "cancelPreviousPerformRequestsWithTarget:selector:object:"); + void _objc_msgSend_14( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aTarget, + ffi.Pointer aSelector, + ffi.Pointer anArgument, + ) { + return __objc_msgSend_14( + obj, + sel, + aTarget, + aSelector, + anArgument, + ); + } + + late final __objc_msgSend_14Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_cancelPreviousPerformRequestsWithTarget_1 = + _registerName1("cancelPreviousPerformRequestsWithTarget:"); + void _objc_msgSend_15( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aTarget, + ) { + return __objc_msgSend_15( + obj, + sel, + aTarget, + ); + } + + late final __objc_msgSend_15Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_accessInstanceVariablesDirectly1 = + _registerName1("accessInstanceVariablesDirectly"); + late final _sel_useStoredAccessor1 = _registerName1("useStoredAccessor"); + late final _class_NSSet1 = _getClass1("NSSet"); + late final _sel_count1 = _registerName1("count"); + late final _sel_member_1 = _registerName1("member:"); + ffi.Pointer _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer object, + ) { + return __objc_msgSend_16( + obj, + sel, + object, + ); + } + + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSEnumerator1 = _getClass1("NSEnumerator"); + late final _sel_nextObject1 = _registerName1("nextObject"); + late final _class_NSString1 = _getClass1("NSString"); + late final _sel_length1 = _registerName1("length"); + late final _sel_characterAtIndex_1 = _registerName1("characterAtIndex:"); + int _objc_msgSend_17( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_17( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_17Ptr = _lookup< + ffi.NativeFunction< + unichar Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _class_NSCoder1 = _getClass1("NSCoder"); + late final _sel_encodeValueOfObjCType_at_1 = + _registerName1("encodeValueOfObjCType:at:"); + void _objc_msgSend_18( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer type, + ffi.Pointer addr, + ) { + return __objc_msgSend_18( + obj, + sel, + type, + addr, + ); + } + + late final __objc_msgSend_18Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSData1 = _getClass1("NSData"); + late final _sel_bytes1 = _registerName1("bytes"); + ffi.Pointer _objc_msgSend_19( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_19( + obj, + sel, + ); + } + + late final __objc_msgSend_19Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_description1 = _registerName1("description"); + ffi.Pointer _objc_msgSend_20( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_20( + obj, + sel, + ); + } + + late final __objc_msgSend_20Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_getBytes_length_1 = _registerName1("getBytes:length:"); + void _objc_msgSend_21( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + int length, + ) { + return __objc_msgSend_21( + obj, + sel, + buffer, + length, + ); + } + + late final __objc_msgSend_21Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_getBytes_range_1 = _registerName1("getBytes:range:"); + void _objc_msgSend_22( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + NSRange range, + ) { + return __objc_msgSend_22( + obj, + sel, + buffer, + range, + ); + } + + late final __objc_msgSend_22Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>(); + + late final _sel_isEqualToData_1 = _registerName1("isEqualToData:"); + bool _objc_msgSend_23( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_23( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_23Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_subdataWithRange_1 = _registerName1("subdataWithRange:"); + ffi.Pointer _objc_msgSend_24( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_24( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_24Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_writeToFile_atomically_1 = + _registerName1("writeToFile:atomically:"); + bool _objc_msgSend_25( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool useAuxiliaryFile, + ) { + return __objc_msgSend_25( + obj, + sel, + path, + useAuxiliaryFile, + ); + } + + late final __objc_msgSend_25Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _class_NSURL1 = _getClass1("NSURL"); + late final _sel_initWithScheme_host_path_1 = + _registerName1("initWithScheme:host:path:"); + instancetype _objc_msgSend_26( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer scheme, + ffi.Pointer host, + ffi.Pointer path, + ) { + return __objc_msgSend_26( + obj, + sel, + scheme, + host, + path, + ); + } + + late final __objc_msgSend_26Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initFileURLWithPath_isDirectory_relativeToURL_1 = + _registerName1("initFileURLWithPath:isDirectory:relativeToURL:"); + instancetype _objc_msgSend_27( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool isDir, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_27( + obj, + sel, + path, + isDir, + baseURL, + ); + } + + late final __objc_msgSend_27Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool, ffi.Pointer)>(); + + late final _sel_initFileURLWithPath_relativeToURL_1 = + _registerName1("initFileURLWithPath:relativeToURL:"); + instancetype _objc_msgSend_28( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_28( + obj, + sel, + path, + baseURL, + ); + } + + late final __objc_msgSend_28Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_28 = __objc_msgSend_28Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initFileURLWithPath_isDirectory_1 = + _registerName1("initFileURLWithPath:isDirectory:"); + instancetype _objc_msgSend_29( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool isDir, + ) { + return __objc_msgSend_29( + obj, + sel, + path, + isDir, + ); + } + + late final __objc_msgSend_29Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_29 = __objc_msgSend_29Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_initFileURLWithPath_1 = + _registerName1("initFileURLWithPath:"); + instancetype _objc_msgSend_30( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ) { + return __objc_msgSend_30( + obj, + sel, + path, + ); + } + + late final __objc_msgSend_30Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_30 = __objc_msgSend_30Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_fileURLWithPath_isDirectory_relativeToURL_1 = + _registerName1("fileURLWithPath:isDirectory:relativeToURL:"); + ffi.Pointer _objc_msgSend_31( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool isDir, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_31( + obj, + sel, + path, + isDir, + baseURL, + ); + } + + late final __objc_msgSend_31Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_31 = __objc_msgSend_31Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer)>(); + + late final _sel_fileURLWithPath_relativeToURL_1 = + _registerName1("fileURLWithPath:relativeToURL:"); + ffi.Pointer _objc_msgSend_32( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_32( + obj, + sel, + path, + baseURL, + ); + } + + late final __objc_msgSend_32Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_32 = __objc_msgSend_32Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_fileURLWithPath_isDirectory_1 = + _registerName1("fileURLWithPath:isDirectory:"); + ffi.Pointer _objc_msgSend_33( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool isDir, + ) { + return __objc_msgSend_33( + obj, + sel, + path, + isDir, + ); + } + + late final __objc_msgSend_33Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_33 = __objc_msgSend_33Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_fileURLWithPath_1 = _registerName1("fileURLWithPath:"); + ffi.Pointer _objc_msgSend_34( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ) { + return __objc_msgSend_34( + obj, + sel, + path, + ); + } + + late final __objc_msgSend_34Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_34 = __objc_msgSend_34Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL_1 = + _registerName1( + "initFileURLWithFileSystemRepresentation:isDirectory:relativeToURL:"); + instancetype _objc_msgSend_35( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool isDir, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_35( + obj, + sel, + path, + isDir, + baseURL, + ); + } + + late final __objc_msgSend_35Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_35 = __objc_msgSend_35Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool, ffi.Pointer)>(); + + late final _sel_fileURLWithFileSystemRepresentation_isDirectory_relativeToURL_1 = + _registerName1( + "fileURLWithFileSystemRepresentation:isDirectory:relativeToURL:"); + ffi.Pointer _objc_msgSend_36( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool isDir, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_36( + obj, + sel, + path, + isDir, + baseURL, + ); + } + + late final __objc_msgSend_36Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_36 = __objc_msgSend_36Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer)>(); + + late final _sel_initWithString_1 = _registerName1("initWithString:"); + late final _sel_initWithString_relativeToURL_1 = + _registerName1("initWithString:relativeToURL:"); + late final _sel_URLWithString_1 = _registerName1("URLWithString:"); + late final _sel_URLWithString_relativeToURL_1 = + _registerName1("URLWithString:relativeToURL:"); + late final _sel_initWithDataRepresentation_relativeToURL_1 = + _registerName1("initWithDataRepresentation:relativeToURL:"); + instancetype _objc_msgSend_37( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_37( + obj, + sel, + data, + baseURL, + ); + } + + late final __objc_msgSend_37Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_37 = __objc_msgSend_37Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_URLWithDataRepresentation_relativeToURL_1 = + _registerName1("URLWithDataRepresentation:relativeToURL:"); + ffi.Pointer _objc_msgSend_38( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_38( + obj, + sel, + data, + baseURL, + ); + } + + late final __objc_msgSend_38Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_38 = __objc_msgSend_38Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initAbsoluteURLWithDataRepresentation_relativeToURL_1 = + _registerName1("initAbsoluteURLWithDataRepresentation:relativeToURL:"); + late final _sel_absoluteURLWithDataRepresentation_relativeToURL_1 = + _registerName1("absoluteURLWithDataRepresentation:relativeToURL:"); + late final _sel_dataRepresentation1 = _registerName1("dataRepresentation"); + ffi.Pointer _objc_msgSend_39( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_39( + obj, + sel, + ); + } + + late final __objc_msgSend_39Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_39 = __objc_msgSend_39Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_absoluteString1 = _registerName1("absoluteString"); + late final _sel_relativeString1 = _registerName1("relativeString"); + late final _sel_baseURL1 = _registerName1("baseURL"); + ffi.Pointer _objc_msgSend_40( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_40( + obj, + sel, + ); + } + + late final __objc_msgSend_40Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_40 = __objc_msgSend_40Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_absoluteURL1 = _registerName1("absoluteURL"); + late final _sel_scheme1 = _registerName1("scheme"); + late final _sel_resourceSpecifier1 = _registerName1("resourceSpecifier"); + late final _sel_host1 = _registerName1("host"); + late final _class_NSNumber1 = _getClass1("NSNumber"); + late final _class_NSValue1 = _getClass1("NSValue"); + late final _sel_getValue_size_1 = _registerName1("getValue:size:"); + late final _sel_objCType1 = _registerName1("objCType"); + late final _sel_initWithBytes_objCType_1 = + _registerName1("initWithBytes:objCType:"); + instancetype _objc_msgSend_41( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ffi.Pointer type, + ) { + return __objc_msgSend_41( + obj, + sel, + value, + type, + ); + } + + late final __objc_msgSend_41Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_41 = __objc_msgSend_41Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithCoder_1 = _registerName1("initWithCoder:"); + instancetype _objc_msgSend_42( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_42( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_42Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_42 = __objc_msgSend_42Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_valueWithBytes_objCType_1 = + _registerName1("valueWithBytes:objCType:"); + ffi.Pointer _objc_msgSend_43( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ffi.Pointer type, + ) { + return __objc_msgSend_43( + obj, + sel, + value, + type, + ); + } + + late final __objc_msgSend_43Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_43 = __objc_msgSend_43Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_value_withObjCType_1 = _registerName1("value:withObjCType:"); + late final _sel_valueWithNonretainedObject_1 = + _registerName1("valueWithNonretainedObject:"); + ffi.Pointer _objc_msgSend_44( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ) { + return __objc_msgSend_44( + obj, + sel, + anObject, + ); + } + + late final __objc_msgSend_44Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_44 = __objc_msgSend_44Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_nonretainedObjectValue1 = + _registerName1("nonretainedObjectValue"); + late final _sel_valueWithPointer_1 = _registerName1("valueWithPointer:"); + ffi.Pointer _objc_msgSend_45( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer pointer, + ) { + return __objc_msgSend_45( + obj, + sel, + pointer, + ); + } + + late final __objc_msgSend_45Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_45 = __objc_msgSend_45Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_pointerValue1 = _registerName1("pointerValue"); + late final _sel_isEqualToValue_1 = _registerName1("isEqualToValue:"); + bool _objc_msgSend_46( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_46( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_46Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_46 = __objc_msgSend_46Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_getValue_1 = _registerName1("getValue:"); + void _objc_msgSend_47( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_47( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_47Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_47 = __objc_msgSend_47Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_valueWithRange_1 = _registerName1("valueWithRange:"); + ffi.Pointer _objc_msgSend_48( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_48( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_48Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_48 = __objc_msgSend_48Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_rangeValue1 = _registerName1("rangeValue"); + NSRange _objc_msgSend_49( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_49( + obj, + sel, + ); + } + + late final __objc_msgSend_49Ptr = _lookup< + ffi.NativeFunction< + NSRange Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_49 = __objc_msgSend_49Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_valueWithPoint_1 = _registerName1("valueWithPoint:"); + ffi.Pointer _objc_msgSend_50( + ffi.Pointer obj, + ffi.Pointer sel, + NSPoint point, + ) { + return __objc_msgSend_50( + obj, + sel, + point, + ); + } + + late final __objc_msgSend_50Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSPoint)>>('objc_msgSend'); + late final __objc_msgSend_50 = __objc_msgSend_50Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSPoint)>(); + + late final _sel_valueWithSize_1 = _registerName1("valueWithSize:"); + ffi.Pointer _objc_msgSend_51( + ffi.Pointer obj, + ffi.Pointer sel, + NSSize size, + ) { + return __objc_msgSend_51( + obj, + sel, + size, + ); + } + + late final __objc_msgSend_51Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSSize)>>('objc_msgSend'); + late final __objc_msgSend_51 = __objc_msgSend_51Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSSize)>(); + + late final _sel_valueWithRect_1 = _registerName1("valueWithRect:"); + ffi.Pointer _objc_msgSend_52( + ffi.Pointer obj, + ffi.Pointer sel, + NSRect rect, + ) { + return __objc_msgSend_52( + obj, + sel, + rect, + ); + } + + late final __objc_msgSend_52Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRect)>>('objc_msgSend'); + late final __objc_msgSend_52 = __objc_msgSend_52Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRect)>(); + + late final _sel_valueWithEdgeInsets_1 = + _registerName1("valueWithEdgeInsets:"); + ffi.Pointer _objc_msgSend_53( + ffi.Pointer obj, + ffi.Pointer sel, + NSEdgeInsets insets, + ) { + return __objc_msgSend_53( + obj, + sel, + insets, + ); + } + + late final __objc_msgSend_53Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSEdgeInsets)>>('objc_msgSend'); + late final __objc_msgSend_53 = __objc_msgSend_53Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSEdgeInsets)>(); + + late final _sel_pointValue1 = _registerName1("pointValue"); + NSPoint _objc_msgSend_54( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_54( + obj, + sel, + ); + } + + late final __objc_msgSend_54Ptr = _lookup< + ffi.NativeFunction< + NSPoint Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< + NSPoint Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_sizeValue1 = _registerName1("sizeValue"); + NSSize _objc_msgSend_55( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_55( + obj, + sel, + ); + } + + late final __objc_msgSend_55Ptr = _lookup< + ffi.NativeFunction< + NSSize Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_55 = __objc_msgSend_55Ptr.asFunction< + NSSize Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_rectValue1 = _registerName1("rectValue"); + NSRect _objc_msgSend_56( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_56( + obj, + sel, + ); + } + + late final __objc_msgSend_56Ptr = _lookup< + ffi.NativeFunction< + NSRect Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_56 = __objc_msgSend_56Ptr.asFunction< + NSRect Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_edgeInsetsValue1 = _registerName1("edgeInsetsValue"); + NSEdgeInsets _objc_msgSend_57( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_57( + obj, + sel, + ); + } + + late final __objc_msgSend_57Ptr = _lookup< + ffi.NativeFunction< + NSEdgeInsets Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_57 = __objc_msgSend_57Ptr.asFunction< + NSEdgeInsets Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_keyPathsForValuesAffectingValueForKey_1 = + _registerName1("keyPathsForValuesAffectingValueForKey:"); + ffi.Pointer _objc_msgSend_58( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_58( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_58Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_58 = __objc_msgSend_58Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_automaticallyNotifiesObserversForKey_1 = + _registerName1("automaticallyNotifiesObserversForKey:"); + bool _objc_msgSend_59( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_59( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_59Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSArray1 = _getClass1("NSArray"); + late final _sel_objectAtIndex_1 = _registerName1("objectAtIndex:"); + ffi.Pointer _objc_msgSend_60( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_60( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_60Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithObjects_count_1 = + _registerName1("initWithObjects:count:"); + instancetype _objc_msgSend_61( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + int cnt, + ) { + return __objc_msgSend_61( + obj, + sel, + objects, + cnt, + ); + } + + late final __objc_msgSend_61Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_61 = __objc_msgSend_61Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, int)>(); + + late final _sel_arrayByAddingObject_1 = + _registerName1("arrayByAddingObject:"); + ffi.Pointer _objc_msgSend_62( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ) { + return __objc_msgSend_62( + obj, + sel, + anObject, + ); + } + + late final __objc_msgSend_62Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_arrayByAddingObjectsFromArray_1 = + _registerName1("arrayByAddingObjectsFromArray:"); + ffi.Pointer _objc_msgSend_63( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherArray, + ) { + return __objc_msgSend_63( + obj, + sel, + otherArray, + ); + } + + late final __objc_msgSend_63Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_63 = __objc_msgSend_63Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_componentsJoinedByString_1 = + _registerName1("componentsJoinedByString:"); + ffi.Pointer _objc_msgSend_64( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer separator, + ) { + return __objc_msgSend_64( + obj, + sel, + separator, + ); + } + + late final __objc_msgSend_64Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_64 = __objc_msgSend_64Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_containsObject_1 = _registerName1("containsObject:"); + late final _sel_descriptionWithLocale_1 = + _registerName1("descriptionWithLocale:"); + ffi.Pointer _objc_msgSend_65( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer locale, + ) { + return __objc_msgSend_65( + obj, + sel, + locale, + ); + } + + late final __objc_msgSend_65Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_65 = __objc_msgSend_65Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_descriptionWithLocale_indent_1 = + _registerName1("descriptionWithLocale:indent:"); + ffi.Pointer _objc_msgSend_66( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer locale, + int level, + ) { + return __objc_msgSend_66( + obj, + sel, + locale, + level, + ); + } + + late final __objc_msgSend_66Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_66 = __objc_msgSend_66Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_firstObjectCommonWithArray_1 = + _registerName1("firstObjectCommonWithArray:"); + ffi.Pointer _objc_msgSend_67( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherArray, + ) { + return __objc_msgSend_67( + obj, + sel, + otherArray, + ); + } + + late final __objc_msgSend_67Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_67 = __objc_msgSend_67Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_getObjects_range_1 = _registerName1("getObjects:range:"); + void _objc_msgSend_68( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + NSRange range, + ) { + return __objc_msgSend_68( + obj, + sel, + objects, + range, + ); + } + + late final __objc_msgSend_68Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_68 = __objc_msgSend_68Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, NSRange)>(); + + late final _sel_indexOfObject_1 = _registerName1("indexOfObject:"); + int _objc_msgSend_69( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ) { + return __objc_msgSend_69( + obj, + sel, + anObject, + ); + } + + late final __objc_msgSend_69Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_69 = __objc_msgSend_69Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_indexOfObject_inRange_1 = + _registerName1("indexOfObject:inRange:"); + int _objc_msgSend_70( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + NSRange range, + ) { + return __objc_msgSend_70( + obj, + sel, + anObject, + range, + ); + } + + late final __objc_msgSend_70Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_70 = __objc_msgSend_70Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>(); + + late final _sel_indexOfObjectIdenticalTo_1 = + _registerName1("indexOfObjectIdenticalTo:"); + late final _sel_indexOfObjectIdenticalTo_inRange_1 = + _registerName1("indexOfObjectIdenticalTo:inRange:"); + late final _sel_isEqualToArray_1 = _registerName1("isEqualToArray:"); + bool _objc_msgSend_71( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherArray, + ) { + return __objc_msgSend_71( + obj, + sel, + otherArray, + ); + } + + late final __objc_msgSend_71Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_71 = __objc_msgSend_71Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_firstObject1 = _registerName1("firstObject"); + late final _sel_lastObject1 = _registerName1("lastObject"); + late final _sel_objectEnumerator1 = _registerName1("objectEnumerator"); + ffi.Pointer _objc_msgSend_72( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_72( + obj, + sel, + ); + } + + late final __objc_msgSend_72Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_72 = __objc_msgSend_72Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_reverseObjectEnumerator1 = + _registerName1("reverseObjectEnumerator"); + late final _sel_sortedArrayHint1 = _registerName1("sortedArrayHint"); + late final _sel_sortedArrayUsingFunction_context_1 = + _registerName1("sortedArrayUsingFunction:context:"); + ffi.Pointer _objc_msgSend_73( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + comparator, + ffi.Pointer context, + ) { + return __objc_msgSend_73( + obj, + sel, + comparator, + context, + ); + } + + late final __objc_msgSend_73Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_73 = __objc_msgSend_73Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>(); + + late final _sel_sortedArrayUsingFunction_context_hint_1 = + _registerName1("sortedArrayUsingFunction:context:hint:"); + ffi.Pointer _objc_msgSend_74( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + comparator, + ffi.Pointer context, + ffi.Pointer hint, + ) { + return __objc_msgSend_74( + obj, + sel, + comparator, + context, + hint, + ); + } + + late final __objc_msgSend_74Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_74 = __objc_msgSend_74Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_sortedArrayUsingSelector_1 = + _registerName1("sortedArrayUsingSelector:"); + ffi.Pointer _objc_msgSend_75( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer comparator, + ) { + return __objc_msgSend_75( + obj, + sel, + comparator, + ); + } + + late final __objc_msgSend_75Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_75 = __objc_msgSend_75Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_subarrayWithRange_1 = _registerName1("subarrayWithRange:"); + ffi.Pointer _objc_msgSend_76( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_76( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_76Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_76 = __objc_msgSend_76Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _class_NSError1 = _getClass1("NSError"); + late final _sel_initWithDomain_code_userInfo_1 = + _registerName1("initWithDomain:code:userInfo:"); + instancetype _objc_msgSend_77( + ffi.Pointer obj, + ffi.Pointer sel, + NSErrorDomain domain, + int code, + ) { + return __objc_msgSend_77( + obj, + sel, + domain, + code, + ); + } + + late final __objc_msgSend_77Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + NSErrorDomain, NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_77 = __objc_msgSend_77Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, NSErrorDomain, int)>(); + + late final _sel_errorWithDomain_code_userInfo_1 = + _registerName1("errorWithDomain:code:userInfo:"); + late final _sel_domain1 = _registerName1("domain"); + late final _sel_code1 = _registerName1("code"); + int _objc_msgSend_78( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_78( + obj, + sel, + ); + } + + late final __objc_msgSend_78Ptr = _lookup< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_78 = __objc_msgSend_78Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setKeys_triggerChangeNotificationsForDependentKey_1 = + _registerName1("setKeys:triggerChangeNotificationsForDependentKey:"); + void _objc_msgSend_79( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keys, + ffi.Pointer dependentKey, + ) { + return __objc_msgSend_79( + obj, + sel, + keys, + dependentKey, + ); + } + + late final __objc_msgSend_79Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_79 = __objc_msgSend_79Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_classFallbacksForKeyedArchiver1 = + _registerName1("classFallbacksForKeyedArchiver"); + ffi.Pointer _objc_msgSend_80( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_80( + obj, + sel, + ); + } + + late final __objc_msgSend_80Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_classForKeyedUnarchiver1 = + _registerName1("classForKeyedUnarchiver"); + late final _sel_writeToURL_error_1 = _registerName1("writeToURL:error:"); + bool _objc_msgSend_81( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer> error, + ) { + return __objc_msgSend_81( + obj, + sel, + url, + error, + ); + } + + late final __objc_msgSend_81Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_81 = __objc_msgSend_81Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_makeObjectsPerformSelector_1 = + _registerName1("makeObjectsPerformSelector:"); + late final _sel_makeObjectsPerformSelector_withObject_1 = + _registerName1("makeObjectsPerformSelector:withObject:"); + void _objc_msgSend_82( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer argument, + ) { + return __objc_msgSend_82( + obj, + sel, + aSelector, + argument, + ); + } + + late final __objc_msgSend_82Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_82 = __objc_msgSend_82Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSIndexSet1 = _getClass1("NSIndexSet"); + late final _sel_indexSet1 = _registerName1("indexSet"); + late final _sel_indexSetWithIndex_1 = _registerName1("indexSetWithIndex:"); + late final _sel_indexSetWithIndexesInRange_1 = + _registerName1("indexSetWithIndexesInRange:"); + instancetype _objc_msgSend_83( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_83( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_83Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_83 = __objc_msgSend_83Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_initWithIndexesInRange_1 = + _registerName1("initWithIndexesInRange:"); + late final _sel_initWithIndexSet_1 = _registerName1("initWithIndexSet:"); + instancetype _objc_msgSend_84( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexSet, + ) { + return __objc_msgSend_84( + obj, + sel, + indexSet, + ); + } + + late final __objc_msgSend_84Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_84 = __objc_msgSend_84Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithIndex_1 = _registerName1("initWithIndex:"); + late final _sel_isEqualToIndexSet_1 = _registerName1("isEqualToIndexSet:"); + bool _objc_msgSend_85( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexSet, + ) { + return __objc_msgSend_85( + obj, + sel, + indexSet, + ); + } + + late final __objc_msgSend_85Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_85 = __objc_msgSend_85Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_firstIndex1 = _registerName1("firstIndex"); + late final _sel_lastIndex1 = _registerName1("lastIndex"); + late final _sel_indexGreaterThanIndex_1 = + _registerName1("indexGreaterThanIndex:"); + int _objc_msgSend_86( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_86( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_86Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_86 = __objc_msgSend_86Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_indexLessThanIndex_1 = _registerName1("indexLessThanIndex:"); + late final _sel_indexGreaterThanOrEqualToIndex_1 = + _registerName1("indexGreaterThanOrEqualToIndex:"); + late final _sel_indexLessThanOrEqualToIndex_1 = + _registerName1("indexLessThanOrEqualToIndex:"); + late final _sel_getIndexes_maxCount_inIndexRange_1 = + _registerName1("getIndexes:maxCount:inIndexRange:"); + int _objc_msgSend_87( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexBuffer, + int bufferSize, + NSRangePointer range, + ) { + return __objc_msgSend_87( + obj, + sel, + indexBuffer, + bufferSize, + range, + ); + } + + late final __objc_msgSend_87Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSRangePointer)>>('objc_msgSend'); + late final __objc_msgSend_87 = __objc_msgSend_87Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRangePointer)>(); + + late final _sel_countOfIndexesInRange_1 = + _registerName1("countOfIndexesInRange:"); + int _objc_msgSend_88( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_88( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_88Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_88 = __objc_msgSend_88Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_containsIndex_1 = _registerName1("containsIndex:"); + bool _objc_msgSend_89( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_89( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_89Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_89 = __objc_msgSend_89Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_containsIndexesInRange_1 = + _registerName1("containsIndexesInRange:"); + bool _objc_msgSend_90( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_90( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_90Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_90 = __objc_msgSend_90Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_containsIndexes_1 = _registerName1("containsIndexes:"); + late final _sel_intersectsIndexesInRange_1 = + _registerName1("intersectsIndexesInRange:"); + ffi.Pointer<_ObjCBlockDesc> _newBlockDesc1() { + final d = + pkg_ffi.calloc.allocate<_ObjCBlockDesc>(ffi.sizeOf<_ObjCBlockDesc>()); + d.ref.size = ffi.sizeOf<_ObjCBlock>(); + return d; + } + + late final _objc_block_desc1 = _newBlockDesc1(); + late final _objc_concrete_global_block1 = + _lookup('_NSConcreteGlobalBlock'); + ffi.Pointer<_ObjCBlock> _newBlock1( + ffi.Pointer invoke, ffi.Pointer target) { + final b = pkg_ffi.calloc.allocate<_ObjCBlock>(ffi.sizeOf<_ObjCBlock>()); + b.ref.isa = _objc_concrete_global_block1; + b.ref.invoke = invoke; + b.ref.target = target; + b.ref.descriptor = _objc_block_desc1; + return b; + } + + late final _sel_enumerateIndexesUsingBlock_1 = + _registerName1("enumerateIndexesUsingBlock:"); + void _objc_msgSend_91( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_91( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_91Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_91 = __objc_msgSend_91Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateIndexesWithOptions_usingBlock_1 = + _registerName1("enumerateIndexesWithOptions:usingBlock:"); + void _objc_msgSend_92( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_92( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_92Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_92 = __objc_msgSend_92Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateIndexesInRange_options_usingBlock_1 = + _registerName1("enumerateIndexesInRange:options:usingBlock:"); + void _objc_msgSend_93( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_93( + obj, + sel, + range, + opts, + block, + ); + } + + late final __objc_msgSend_93Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_93 = __objc_msgSend_93Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexPassingTest_1 = _registerName1("indexPassingTest:"); + int _objc_msgSend_94( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_94( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_94Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_94 = __objc_msgSend_94Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexWithOptions_passingTest_1 = + _registerName1("indexWithOptions:passingTest:"); + int _objc_msgSend_95( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_95( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_95Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_95 = __objc_msgSend_95Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexInRange_options_passingTest_1 = + _registerName1("indexInRange:options:passingTest:"); + int _objc_msgSend_96( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_96( + obj, + sel, + range, + opts, + predicate, + ); + } + + late final __objc_msgSend_96Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_96 = __objc_msgSend_96Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexesPassingTest_1 = _registerName1("indexesPassingTest:"); + ffi.Pointer _objc_msgSend_97( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_97( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_97Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_97 = __objc_msgSend_97Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexesWithOptions_passingTest_1 = + _registerName1("indexesWithOptions:passingTest:"); + ffi.Pointer _objc_msgSend_98( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_98( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_98Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_98 = __objc_msgSend_98Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexesInRange_options_passingTest_1 = + _registerName1("indexesInRange:options:passingTest:"); + ffi.Pointer _objc_msgSend_99( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_99( + obj, + sel, + range, + opts, + predicate, + ); + } + + late final __objc_msgSend_99Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_99 = __objc_msgSend_99Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateRangesUsingBlock_1 = + _registerName1("enumerateRangesUsingBlock:"); + void _objc_msgSend_100( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_100( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_100Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_100 = __objc_msgSend_100Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateRangesWithOptions_usingBlock_1 = + _registerName1("enumerateRangesWithOptions:usingBlock:"); + void _objc_msgSend_101( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_101( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_101Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_101 = __objc_msgSend_101Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateRangesInRange_options_usingBlock_1 = + _registerName1("enumerateRangesInRange:options:usingBlock:"); + void _objc_msgSend_102( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_102( + obj, + sel, + range, + opts, + block, + ); + } + + late final __objc_msgSend_102Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_102 = __objc_msgSend_102Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_objectsAtIndexes_1 = _registerName1("objectsAtIndexes:"); + ffi.Pointer _objc_msgSend_103( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexes, + ) { + return __objc_msgSend_103( + obj, + sel, + indexes, + ); + } + + late final __objc_msgSend_103Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_103 = __objc_msgSend_103Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_objectAtIndexedSubscript_1 = + _registerName1("objectAtIndexedSubscript:"); + late final _sel_enumerateObjectsUsingBlock_1 = + _registerName1("enumerateObjectsUsingBlock:"); + void _objc_msgSend_104( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_104( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_104Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_104 = __objc_msgSend_104Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateObjectsWithOptions_usingBlock_1 = + _registerName1("enumerateObjectsWithOptions:usingBlock:"); + void _objc_msgSend_105( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_105( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_105Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_105 = __objc_msgSend_105Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateObjectsAtIndexes_options_usingBlock_1 = + _registerName1("enumerateObjectsAtIndexes:options:usingBlock:"); + void _objc_msgSend_106( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer s, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_106( + obj, + sel, + s, + opts, + block, + ); + } + + late final __objc_msgSend_106Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_106 = __objc_msgSend_106Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexOfObjectPassingTest_1 = + _registerName1("indexOfObjectPassingTest:"); + int _objc_msgSend_107( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_107( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_107Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_107 = __objc_msgSend_107Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexOfObjectWithOptions_passingTest_1 = + _registerName1("indexOfObjectWithOptions:passingTest:"); + int _objc_msgSend_108( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_108( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_108Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_108 = __objc_msgSend_108Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexOfObjectAtIndexes_options_passingTest_1 = + _registerName1("indexOfObjectAtIndexes:options:passingTest:"); + int _objc_msgSend_109( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer s, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_109( + obj, + sel, + s, + opts, + predicate, + ); + } + + late final __objc_msgSend_109Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_109 = __objc_msgSend_109Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexesOfObjectsPassingTest_1 = + _registerName1("indexesOfObjectsPassingTest:"); + ffi.Pointer _objc_msgSend_110( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_110( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_110Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_110 = __objc_msgSend_110Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexesOfObjectsWithOptions_passingTest_1 = + _registerName1("indexesOfObjectsWithOptions:passingTest:"); + ffi.Pointer _objc_msgSend_111( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_111( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_111Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_111 = __objc_msgSend_111Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexesOfObjectsAtIndexes_options_passingTest_1 = + _registerName1("indexesOfObjectsAtIndexes:options:passingTest:"); + ffi.Pointer _objc_msgSend_112( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer s, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_112( + obj, + sel, + s, + opts, + predicate, + ); + } + + late final __objc_msgSend_112Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_112 = __objc_msgSend_112Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_sortedArrayUsingComparator_1 = + _registerName1("sortedArrayUsingComparator:"); + ffi.Pointer _objc_msgSend_113( + ffi.Pointer obj, + ffi.Pointer sel, + NSComparator cmptr, + ) { + return __objc_msgSend_113( + obj, + sel, + cmptr, + ); + } + + late final __objc_msgSend_113Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSComparator)>>('objc_msgSend'); + late final __objc_msgSend_113 = __objc_msgSend_113Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSComparator)>(); + + late final _sel_sortedArrayWithOptions_usingComparator_1 = + _registerName1("sortedArrayWithOptions:usingComparator:"); + ffi.Pointer _objc_msgSend_114( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + NSComparator cmptr, + ) { + return __objc_msgSend_114( + obj, + sel, + opts, + cmptr, + ); + } + + late final __objc_msgSend_114Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32, NSComparator)>>('objc_msgSend'); + late final __objc_msgSend_114 = __objc_msgSend_114Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int, NSComparator)>(); + + late final _sel_indexOfObject_inSortedRange_options_usingComparator_1 = + _registerName1("indexOfObject:inSortedRange:options:usingComparator:"); + int _objc_msgSend_115( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer obj1, + NSRange r, + int opts, + NSComparator cmp, + ) { + return __objc_msgSend_115( + obj, + sel, + obj1, + r, + opts, + cmp, + ); + } + + late final __objc_msgSend_115Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Int32, + NSComparator)>>('objc_msgSend'); + late final __objc_msgSend_115 = __objc_msgSend_115Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange, int, NSComparator)>(); + + late final _sel_array1 = _registerName1("array"); + late final _sel_arrayWithObject_1 = _registerName1("arrayWithObject:"); + late final _sel_arrayWithObjects_count_1 = + _registerName1("arrayWithObjects:count:"); + late final _sel_arrayWithObjects_1 = _registerName1("arrayWithObjects:"); + late final _sel_arrayWithArray_1 = _registerName1("arrayWithArray:"); + late final _sel_initWithObjects_1 = _registerName1("initWithObjects:"); + late final _sel_initWithArray_1 = _registerName1("initWithArray:"); + late final _sel_initWithArray_copyItems_1 = + _registerName1("initWithArray:copyItems:"); + instancetype _objc_msgSend_116( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer array, + bool flag, + ) { + return __objc_msgSend_116( + obj, + sel, + array, + flag, + ); + } + + late final __objc_msgSend_116Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_116 = __objc_msgSend_116Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_initWithContentsOfURL_error_1 = + _registerName1("initWithContentsOfURL:error:"); + ffi.Pointer _objc_msgSend_117( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer> error, + ) { + return __objc_msgSend_117( + obj, + sel, + url, + error, + ); + } + + late final __objc_msgSend_117Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_117 = __objc_msgSend_117Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_arrayWithContentsOfURL_error_1 = + _registerName1("arrayWithContentsOfURL:error:"); + late final _sel_getObjects_1 = _registerName1("getObjects:"); + void _objc_msgSend_118( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + ) { + return __objc_msgSend_118( + obj, + sel, + objects, + ); + } + + late final __objc_msgSend_118Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_118 = __objc_msgSend_118Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_arrayWithContentsOfFile_1 = + _registerName1("arrayWithContentsOfFile:"); + ffi.Pointer _objc_msgSend_119( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ) { + return __objc_msgSend_119( + obj, + sel, + path, + ); + } + + late final __objc_msgSend_119Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_119 = __objc_msgSend_119Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_arrayWithContentsOfURL_1 = + _registerName1("arrayWithContentsOfURL:"); + ffi.Pointer _objc_msgSend_120( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ) { + return __objc_msgSend_120( + obj, + sel, + url, + ); + } + + late final __objc_msgSend_120Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_120 = __objc_msgSend_120Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithContentsOfFile_1 = + _registerName1("initWithContentsOfFile:"); + late final _sel_initWithContentsOfURL_1 = + _registerName1("initWithContentsOfURL:"); + late final _sel_writeToURL_atomically_1 = + _registerName1("writeToURL:atomically:"); + bool _objc_msgSend_121( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + bool atomically, + ) { + return __objc_msgSend_121( + obj, + sel, + url, + atomically, + ); + } + + late final __objc_msgSend_121Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_121 = __objc_msgSend_121Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_pathsMatchingExtensions_1 = + _registerName1("pathsMatchingExtensions:"); + late final _sel_valueForKey_1 = _registerName1("valueForKey:"); + late final _sel_setValue_forKey_1 = _registerName1("setValue:forKey:"); + void _objc_msgSend_122( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ffi.Pointer key, + ) { + return __objc_msgSend_122( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_122Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_122 = __objc_msgSend_122Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_addObserver_toObjectsAtIndexes_forKeyPath_options_context_1 = + _registerName1( + "addObserver:toObjectsAtIndexes:forKeyPath:options:context:"); + void _objc_msgSend_123( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer observer, + ffi.Pointer indexes, + ffi.Pointer keyPath, + int options, + ffi.Pointer context, + ) { + return __objc_msgSend_123( + obj, + sel, + observer, + indexes, + keyPath, + options, + context, + ); + } + + late final __objc_msgSend_123Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_123 = __objc_msgSend_123Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final _sel_removeObserver_fromObjectsAtIndexes_forKeyPath_context_1 = + _registerName1("removeObserver:fromObjectsAtIndexes:forKeyPath:context:"); + void _objc_msgSend_124( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer observer, + ffi.Pointer indexes, + ffi.Pointer keyPath, + ffi.Pointer context, + ) { + return __objc_msgSend_124( + obj, + sel, + observer, + indexes, + keyPath, + context, + ); + } + + late final __objc_msgSend_124Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_124 = __objc_msgSend_124Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeObserver_fromObjectsAtIndexes_forKeyPath_1 = + _registerName1("removeObserver:fromObjectsAtIndexes:forKeyPath:"); + void _objc_msgSend_125( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer observer, + ffi.Pointer indexes, + ffi.Pointer keyPath, + ) { + return __objc_msgSend_125( + obj, + sel, + observer, + indexes, + keyPath, + ); + } + + late final __objc_msgSend_125Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_125 = __objc_msgSend_125Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_addObserver_forKeyPath_options_context_1 = + _registerName1("addObserver:forKeyPath:options:context:"); + void _objc_msgSend_126( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer observer, + ffi.Pointer keyPath, + int options, + ffi.Pointer context, + ) { + return __objc_msgSend_126( + obj, + sel, + observer, + keyPath, + options, + context, + ); + } + + late final __objc_msgSend_126Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_126 = __objc_msgSend_126Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final _sel_removeObserver_forKeyPath_context_1 = + _registerName1("removeObserver:forKeyPath:context:"); + void _objc_msgSend_127( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer observer, + ffi.Pointer keyPath, + ffi.Pointer context, + ) { + return __objc_msgSend_127( + obj, + sel, + observer, + keyPath, + context, + ); + } + + late final __objc_msgSend_127Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_127 = __objc_msgSend_127Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeObserver_forKeyPath_1 = + _registerName1("removeObserver:forKeyPath:"); + void _objc_msgSend_128( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer observer, + ffi.Pointer keyPath, + ) { + return __objc_msgSend_128( + obj, + sel, + observer, + keyPath, + ); + } + + late final __objc_msgSend_128Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_128 = __objc_msgSend_128Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_sortedArrayUsingDescriptors_1 = + _registerName1("sortedArrayUsingDescriptors:"); + late final _class_NSPredicate1 = _getClass1("NSPredicate"); + late final _sel_predicateWithFormat_argumentArray_1 = + _registerName1("predicateWithFormat:argumentArray:"); + ffi.Pointer _objc_msgSend_129( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicateFormat, + ffi.Pointer arguments, + ) { + return __objc_msgSend_129( + obj, + sel, + predicateFormat, + arguments, + ); + } + + late final __objc_msgSend_129Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_129 = __objc_msgSend_129Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_predicateWithFormat_1 = + _registerName1("predicateWithFormat:"); + ffi.Pointer _objc_msgSend_130( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicateFormat, + ) { + return __objc_msgSend_130( + obj, + sel, + predicateFormat, + ); + } + + late final __objc_msgSend_130Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_130 = __objc_msgSend_130Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_predicateWithFormat_arguments_1 = + _registerName1("predicateWithFormat:arguments:"); + ffi.Pointer _objc_msgSend_131( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicateFormat, + ffi.Pointer<__va_list_tag> argList, + ) { + return __objc_msgSend_131( + obj, + sel, + predicateFormat, + argList, + ); + } + + late final __objc_msgSend_131Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); + late final __objc_msgSend_131 = __objc_msgSend_131Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>(); + + late final _sel_predicateFromMetadataQueryString_1 = + _registerName1("predicateFromMetadataQueryString:"); + late final _sel_predicateWithValue_1 = _registerName1("predicateWithValue:"); + ffi.Pointer _objc_msgSend_132( + ffi.Pointer obj, + ffi.Pointer sel, + bool value, + ) { + return __objc_msgSend_132( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_132Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_132 = __objc_msgSend_132Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _class_NSDictionary1 = _getClass1("NSDictionary"); + late final _sel_objectForKey_1 = _registerName1("objectForKey:"); + late final _sel_keyEnumerator1 = _registerName1("keyEnumerator"); + late final _sel_initWithObjects_forKeys_count_1 = + _registerName1("initWithObjects:forKeys:count:"); + instancetype _objc_msgSend_133( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + ffi.Pointer> keys, + int cnt, + ) { + return __objc_msgSend_133( + obj, + sel, + objects, + keys, + cnt, + ); + } + + late final __objc_msgSend_133Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_133 = __objc_msgSend_133Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + int)>(); + + late final _sel_allKeys1 = _registerName1("allKeys"); + late final _sel_allKeysForObject_1 = _registerName1("allKeysForObject:"); + late final _sel_allValues1 = _registerName1("allValues"); + late final _sel_descriptionInStringsFileFormat1 = + _registerName1("descriptionInStringsFileFormat"); + late final _sel_isEqualToDictionary_1 = + _registerName1("isEqualToDictionary:"); + bool _objc_msgSend_134( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherDictionary, + ) { + return __objc_msgSend_134( + obj, + sel, + otherDictionary, + ); + } + + late final __objc_msgSend_134Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_134 = __objc_msgSend_134Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_objectsForKeys_notFoundMarker_1 = + _registerName1("objectsForKeys:notFoundMarker:"); + ffi.Pointer _objc_msgSend_135( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keys, + ffi.Pointer marker, + ) { + return __objc_msgSend_135( + obj, + sel, + keys, + marker, + ); + } + + late final __objc_msgSend_135Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_135 = __objc_msgSend_135Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_keysSortedByValueUsingSelector_1 = + _registerName1("keysSortedByValueUsingSelector:"); + late final _sel_getObjects_andKeys_count_1 = + _registerName1("getObjects:andKeys:count:"); + void _objc_msgSend_136( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + ffi.Pointer> keys, + int count, + ) { + return __objc_msgSend_136( + obj, + sel, + objects, + keys, + count, + ); + } + + late final __objc_msgSend_136Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_136 = __objc_msgSend_136Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + int)>(); + + late final _sel_objectForKeyedSubscript_1 = + _registerName1("objectForKeyedSubscript:"); + late final _sel_enumerateKeysAndObjectsUsingBlock_1 = + _registerName1("enumerateKeysAndObjectsUsingBlock:"); + void _objc_msgSend_137( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_137( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_137Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_137 = __objc_msgSend_137Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateKeysAndObjectsWithOptions_usingBlock_1 = + _registerName1("enumerateKeysAndObjectsWithOptions:usingBlock:"); + void _objc_msgSend_138( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_138( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_138Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_138 = __objc_msgSend_138Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_keysSortedByValueUsingComparator_1 = + _registerName1("keysSortedByValueUsingComparator:"); + late final _sel_keysSortedByValueWithOptions_usingComparator_1 = + _registerName1("keysSortedByValueWithOptions:usingComparator:"); + late final _sel_getObjects_andKeys_1 = _registerName1("getObjects:andKeys:"); + void _objc_msgSend_139( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + ffi.Pointer> keys, + ) { + return __objc_msgSend_139( + obj, + sel, + objects, + keys, + ); + } + + late final __objc_msgSend_139Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_139 = __objc_msgSend_139Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_dictionaryWithContentsOfFile_1 = + _registerName1("dictionaryWithContentsOfFile:"); + ffi.Pointer _objc_msgSend_140( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ) { + return __objc_msgSend_140( + obj, + sel, + path, + ); + } + + late final __objc_msgSend_140Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_140 = __objc_msgSend_140Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_dictionaryWithContentsOfURL_1 = + _registerName1("dictionaryWithContentsOfURL:"); + ffi.Pointer _objc_msgSend_141( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ) { + return __objc_msgSend_141( + obj, + sel, + url, + ); + } + + late final __objc_msgSend_141Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_141 = __objc_msgSend_141Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_dictionary1 = _registerName1("dictionary"); + late final _sel_dictionaryWithObject_forKey_1 = + _registerName1("dictionaryWithObject:forKey:"); + instancetype _objc_msgSend_142( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer object, + ffi.Pointer key, + ) { + return __objc_msgSend_142( + obj, + sel, + object, + key, + ); + } + + late final __objc_msgSend_142Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_142 = __objc_msgSend_142Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_dictionaryWithObjects_forKeys_count_1 = + _registerName1("dictionaryWithObjects:forKeys:count:"); + late final _sel_dictionaryWithObjectsAndKeys_1 = + _registerName1("dictionaryWithObjectsAndKeys:"); + late final _sel_dictionaryWithDictionary_1 = + _registerName1("dictionaryWithDictionary:"); + instancetype _objc_msgSend_143( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dict, + ) { + return __objc_msgSend_143( + obj, + sel, + dict, + ); + } + + late final __objc_msgSend_143Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_143 = __objc_msgSend_143Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_dictionaryWithObjects_forKeys_1 = + _registerName1("dictionaryWithObjects:forKeys:"); + instancetype _objc_msgSend_144( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer objects, + ffi.Pointer keys, + ) { + return __objc_msgSend_144( + obj, + sel, + objects, + keys, + ); + } + + late final __objc_msgSend_144Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_144 = __objc_msgSend_144Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithObjectsAndKeys_1 = + _registerName1("initWithObjectsAndKeys:"); + late final _sel_initWithDictionary_1 = _registerName1("initWithDictionary:"); + late final _sel_initWithDictionary_copyItems_1 = + _registerName1("initWithDictionary:copyItems:"); + instancetype _objc_msgSend_145( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherDictionary, + bool flag, + ) { + return __objc_msgSend_145( + obj, + sel, + otherDictionary, + flag, + ); + } + + late final __objc_msgSend_145Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_145 = __objc_msgSend_145Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_initWithObjects_forKeys_1 = + _registerName1("initWithObjects:forKeys:"); + ffi.Pointer _objc_msgSend_146( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer> error, + ) { + return __objc_msgSend_146( + obj, + sel, + url, + error, + ); + } + + late final __objc_msgSend_146Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_146 = __objc_msgSend_146Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_dictionaryWithContentsOfURL_error_1 = + _registerName1("dictionaryWithContentsOfURL:error:"); + late final _sel_sharedKeySetForKeys_1 = + _registerName1("sharedKeySetForKeys:"); + late final _sel_countByEnumeratingWithState_objects_count_1 = + _registerName1("countByEnumeratingWithState:objects:count:"); + int _objc_msgSend_147( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer state, + ffi.Pointer> buffer, + int len, + ) { + return __objc_msgSend_147( + obj, + sel, + state, + buffer, + len, + ); + } + + late final __objc_msgSend_147Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_147 = __objc_msgSend_147Ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + int)>(); + + late final _sel_fileSize1 = _registerName1("fileSize"); + int _objc_msgSend_148( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_148( + obj, + sel, + ); + } + + late final __objc_msgSend_148Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLongLong Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_148 = __objc_msgSend_148Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSDate1 = _getClass1("NSDate"); + late final _sel_timeIntervalSinceReferenceDate1 = + _registerName1("timeIntervalSinceReferenceDate"); + double _objc_msgSend_149( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_149( + obj, + sel, + ); + } + + late final __objc_msgSend_149Ptr = _lookup< + ffi.NativeFunction< + NSTimeInterval Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_149 = __objc_msgSend_149Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithTimeIntervalSinceReferenceDate_1 = + _registerName1("initWithTimeIntervalSinceReferenceDate:"); + instancetype _objc_msgSend_150( + ffi.Pointer obj, + ffi.Pointer sel, + double ti, + ) { + return __objc_msgSend_150( + obj, + sel, + ti, + ); + } + + late final __objc_msgSend_150Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + NSTimeInterval)>>('objc_msgSend'); + late final __objc_msgSend_150 = __objc_msgSend_150Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_timeIntervalSinceDate_1 = + _registerName1("timeIntervalSinceDate:"); + double _objc_msgSend_151( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anotherDate, + ) { + return __objc_msgSend_151( + obj, + sel, + anotherDate, + ); + } + + late final __objc_msgSend_151Ptr = _lookup< + ffi.NativeFunction< + NSTimeInterval Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_151 = __objc_msgSend_151Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_timeIntervalSinceNow1 = + _registerName1("timeIntervalSinceNow"); + late final _sel_timeIntervalSince19701 = + _registerName1("timeIntervalSince1970"); + late final _sel_addTimeInterval_1 = _registerName1("addTimeInterval:"); + late final _sel_dateByAddingTimeInterval_1 = + _registerName1("dateByAddingTimeInterval:"); + late final _sel_earlierDate_1 = _registerName1("earlierDate:"); + ffi.Pointer _objc_msgSend_152( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anotherDate, + ) { + return __objc_msgSend_152( + obj, + sel, + anotherDate, + ); + } + + late final __objc_msgSend_152Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_152 = __objc_msgSend_152Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_laterDate_1 = _registerName1("laterDate:"); + late final _sel_compare_1 = _registerName1("compare:"); + int _objc_msgSend_153( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_153( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_153Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_153 = __objc_msgSend_153Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_isEqualToDate_1 = _registerName1("isEqualToDate:"); + bool _objc_msgSend_154( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherDate, + ) { + return __objc_msgSend_154( + obj, + sel, + otherDate, + ); + } + + late final __objc_msgSend_154Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_154 = __objc_msgSend_154Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_date1 = _registerName1("date"); + late final _sel_dateWithTimeIntervalSinceNow_1 = + _registerName1("dateWithTimeIntervalSinceNow:"); + late final _sel_dateWithTimeIntervalSinceReferenceDate_1 = + _registerName1("dateWithTimeIntervalSinceReferenceDate:"); + late final _sel_dateWithTimeIntervalSince1970_1 = + _registerName1("dateWithTimeIntervalSince1970:"); + late final _sel_dateWithTimeInterval_sinceDate_1 = + _registerName1("dateWithTimeInterval:sinceDate:"); + instancetype _objc_msgSend_155( + ffi.Pointer obj, + ffi.Pointer sel, + double secsToBeAdded, + ffi.Pointer date, + ) { + return __objc_msgSend_155( + obj, + sel, + secsToBeAdded, + date, + ); + } + + late final __objc_msgSend_155Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + NSTimeInterval, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_155 = __objc_msgSend_155Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + double, ffi.Pointer)>(); + + late final _sel_distantFuture1 = _registerName1("distantFuture"); + ffi.Pointer _objc_msgSend_156( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_156( + obj, + sel, + ); + } + + late final __objc_msgSend_156Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_156 = __objc_msgSend_156Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_distantPast1 = _registerName1("distantPast"); + late final _sel_now1 = _registerName1("now"); + late final _sel_initWithTimeIntervalSinceNow_1 = + _registerName1("initWithTimeIntervalSinceNow:"); + late final _sel_initWithTimeIntervalSince1970_1 = + _registerName1("initWithTimeIntervalSince1970:"); + late final _sel_initWithTimeInterval_sinceDate_1 = + _registerName1("initWithTimeInterval:sinceDate:"); + late final _sel_dateWithNaturalLanguageString_locale_1 = + _registerName1("dateWithNaturalLanguageString:locale:"); + ffi.Pointer _objc_msgSend_157( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + ffi.Pointer locale, + ) { + return __objc_msgSend_157( + obj, + sel, + string, + locale, + ); + } + + late final __objc_msgSend_157Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_157 = __objc_msgSend_157Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_dateWithNaturalLanguageString_1 = + _registerName1("dateWithNaturalLanguageString:"); + late final _sel_dateWithString_1 = _registerName1("dateWithString:"); + late final _class_NSCalendarDate1 = _getClass1("NSCalendarDate"); + late final _sel_calendarDate1 = _registerName1("calendarDate"); + late final _sel_dateWithString_calendarFormat_locale_1 = + _registerName1("dateWithString:calendarFormat:locale:"); + ffi.Pointer _objc_msgSend_158( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer description, + ffi.Pointer format, + ffi.Pointer locale, + ) { + return __objc_msgSend_158( + obj, + sel, + description, + format, + locale, + ); + } + + late final __objc_msgSend_158Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_158 = __objc_msgSend_158Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_dateWithString_calendarFormat_1 = + _registerName1("dateWithString:calendarFormat:"); + ffi.Pointer _objc_msgSend_159( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer description, + ffi.Pointer format, + ) { + return __objc_msgSend_159( + obj, + sel, + description, + format, + ); + } + + late final __objc_msgSend_159Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_159 = __objc_msgSend_159Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSTimeZone1 = _getClass1("NSTimeZone"); + late final _sel_name1 = _registerName1("name"); + late final _sel_data1 = _registerName1("data"); + late final _sel_secondsFromGMTForDate_1 = + _registerName1("secondsFromGMTForDate:"); + int _objc_msgSend_160( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aDate, + ) { + return __objc_msgSend_160( + obj, + sel, + aDate, + ); + } + + late final __objc_msgSend_160Ptr = _lookup< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_160 = __objc_msgSend_160Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_abbreviationForDate_1 = + _registerName1("abbreviationForDate:"); + ffi.Pointer _objc_msgSend_161( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aDate, + ) { + return __objc_msgSend_161( + obj, + sel, + aDate, + ); + } + + late final __objc_msgSend_161Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_161 = __objc_msgSend_161Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isDaylightSavingTimeForDate_1 = + _registerName1("isDaylightSavingTimeForDate:"); + late final _sel_daylightSavingTimeOffsetForDate_1 = + _registerName1("daylightSavingTimeOffsetForDate:"); + late final _sel_nextDaylightSavingTimeTransitionAfterDate_1 = + _registerName1("nextDaylightSavingTimeTransitionAfterDate:"); + late final _sel_systemTimeZone1 = _registerName1("systemTimeZone"); + ffi.Pointer _objc_msgSend_162( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_162( + obj, + sel, + ); + } + + late final __objc_msgSend_162Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_162 = __objc_msgSend_162Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_resetSystemTimeZone1 = _registerName1("resetSystemTimeZone"); + late final _sel_defaultTimeZone1 = _registerName1("defaultTimeZone"); + late final _sel_setDefaultTimeZone_1 = _registerName1("setDefaultTimeZone:"); + void _objc_msgSend_163( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_163( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_163Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_163 = __objc_msgSend_163Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_localTimeZone1 = _registerName1("localTimeZone"); + late final _sel_knownTimeZoneNames1 = _registerName1("knownTimeZoneNames"); + late final _sel_abbreviationDictionary1 = + _registerName1("abbreviationDictionary"); + ffi.Pointer _objc_msgSend_164( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_164( + obj, + sel, + ); + } + + late final __objc_msgSend_164Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_164 = __objc_msgSend_164Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setAbbreviationDictionary_1 = + _registerName1("setAbbreviationDictionary:"); + void _objc_msgSend_165( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_165( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_165Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_165 = __objc_msgSend_165Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_timeZoneDataVersion1 = _registerName1("timeZoneDataVersion"); + late final _sel_secondsFromGMT1 = _registerName1("secondsFromGMT"); + late final _sel_abbreviation1 = _registerName1("abbreviation"); + late final _sel_isDaylightSavingTime1 = + _registerName1("isDaylightSavingTime"); + late final _sel_daylightSavingTimeOffset1 = + _registerName1("daylightSavingTimeOffset"); + late final _sel_nextDaylightSavingTimeTransition1 = + _registerName1("nextDaylightSavingTimeTransition"); + late final _sel_isEqualToTimeZone_1 = _registerName1("isEqualToTimeZone:"); + bool _objc_msgSend_166( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aTimeZone, + ) { + return __objc_msgSend_166( + obj, + sel, + aTimeZone, + ); + } + + late final __objc_msgSend_166Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_166 = __objc_msgSend_166Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSLocale1 = _getClass1("NSLocale"); + late final _sel_displayNameForKey_value_1 = + _registerName1("displayNameForKey:value:"); + ffi.Pointer _objc_msgSend_167( + ffi.Pointer obj, + ffi.Pointer sel, + NSLocaleKey key, + ffi.Pointer value, + ) { + return __objc_msgSend_167( + obj, + sel, + key, + value, + ); + } + + late final __objc_msgSend_167Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSLocaleKey, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_167 = __objc_msgSend_167Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSLocaleKey, ffi.Pointer)>(); + + late final _sel_initWithLocaleIdentifier_1 = + _registerName1("initWithLocaleIdentifier:"); + late final _sel_localeIdentifier1 = _registerName1("localeIdentifier"); + late final _sel_localizedStringForLocaleIdentifier_1 = + _registerName1("localizedStringForLocaleIdentifier:"); + late final _sel_languageCode1 = _registerName1("languageCode"); + late final _sel_localizedStringForLanguageCode_1 = + _registerName1("localizedStringForLanguageCode:"); + late final _sel_countryCode1 = _registerName1("countryCode"); + late final _sel_localizedStringForCountryCode_1 = + _registerName1("localizedStringForCountryCode:"); + late final _sel_scriptCode1 = _registerName1("scriptCode"); + late final _sel_localizedStringForScriptCode_1 = + _registerName1("localizedStringForScriptCode:"); + late final _sel_variantCode1 = _registerName1("variantCode"); + late final _sel_localizedStringForVariantCode_1 = + _registerName1("localizedStringForVariantCode:"); + late final _class_NSCharacterSet1 = _getClass1("NSCharacterSet"); + late final _sel_controlCharacterSet1 = _registerName1("controlCharacterSet"); + ffi.Pointer _objc_msgSend_168( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_168( + obj, + sel, + ); + } + + late final __objc_msgSend_168Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_168 = __objc_msgSend_168Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_whitespaceCharacterSet1 = + _registerName1("whitespaceCharacterSet"); + late final _sel_whitespaceAndNewlineCharacterSet1 = + _registerName1("whitespaceAndNewlineCharacterSet"); + late final _sel_decimalDigitCharacterSet1 = + _registerName1("decimalDigitCharacterSet"); + late final _sel_letterCharacterSet1 = _registerName1("letterCharacterSet"); + late final _sel_lowercaseLetterCharacterSet1 = + _registerName1("lowercaseLetterCharacterSet"); + late final _sel_uppercaseLetterCharacterSet1 = + _registerName1("uppercaseLetterCharacterSet"); + late final _sel_nonBaseCharacterSet1 = _registerName1("nonBaseCharacterSet"); + late final _sel_alphanumericCharacterSet1 = + _registerName1("alphanumericCharacterSet"); + late final _sel_decomposableCharacterSet1 = + _registerName1("decomposableCharacterSet"); + late final _sel_illegalCharacterSet1 = _registerName1("illegalCharacterSet"); + late final _sel_punctuationCharacterSet1 = + _registerName1("punctuationCharacterSet"); + late final _sel_capitalizedLetterCharacterSet1 = + _registerName1("capitalizedLetterCharacterSet"); + late final _sel_symbolCharacterSet1 = _registerName1("symbolCharacterSet"); + late final _sel_newlineCharacterSet1 = _registerName1("newlineCharacterSet"); + late final _sel_characterSetWithRange_1 = + _registerName1("characterSetWithRange:"); + ffi.Pointer _objc_msgSend_169( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange aRange, + ) { + return __objc_msgSend_169( + obj, + sel, + aRange, + ); + } + + late final __objc_msgSend_169Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_169 = __objc_msgSend_169Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_characterSetWithCharactersInString_1 = + _registerName1("characterSetWithCharactersInString:"); + ffi.Pointer _objc_msgSend_170( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aString, + ) { + return __objc_msgSend_170( + obj, + sel, + aString, + ); + } + + late final __objc_msgSend_170Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_170 = __objc_msgSend_170Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_characterSetWithBitmapRepresentation_1 = + _registerName1("characterSetWithBitmapRepresentation:"); + ffi.Pointer _objc_msgSend_171( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ) { + return __objc_msgSend_171( + obj, + sel, + data, + ); + } + + late final __objc_msgSend_171Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_171 = __objc_msgSend_171Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_characterSetWithContentsOfFile_1 = + _registerName1("characterSetWithContentsOfFile:"); + late final _sel_characterIsMember_1 = _registerName1("characterIsMember:"); + bool _objc_msgSend_172( + ffi.Pointer obj, + ffi.Pointer sel, + int aCharacter, + ) { + return __objc_msgSend_172( + obj, + sel, + aCharacter, + ); + } + + late final __objc_msgSend_172Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + unichar)>>('objc_msgSend'); + late final __objc_msgSend_172 = __objc_msgSend_172Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_bitmapRepresentation1 = + _registerName1("bitmapRepresentation"); + late final _sel_invertedSet1 = _registerName1("invertedSet"); + late final _sel_longCharacterIsMember_1 = + _registerName1("longCharacterIsMember:"); + bool _objc_msgSend_173( + ffi.Pointer obj, + ffi.Pointer sel, + int theLongChar, + ) { + return __objc_msgSend_173( + obj, + sel, + theLongChar, + ); + } + + late final __objc_msgSend_173Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + UTF32Char)>>('objc_msgSend'); + late final __objc_msgSend_173 = __objc_msgSend_173Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_isSupersetOfSet_1 = _registerName1("isSupersetOfSet:"); + bool _objc_msgSend_174( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer theOtherSet, + ) { + return __objc_msgSend_174( + obj, + sel, + theOtherSet, + ); + } + + late final __objc_msgSend_174Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_174 = __objc_msgSend_174Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_hasMemberInPlane_1 = _registerName1("hasMemberInPlane:"); + bool _objc_msgSend_175( + ffi.Pointer obj, + ffi.Pointer sel, + int thePlane, + ) { + return __objc_msgSend_175( + obj, + sel, + thePlane, + ); + } + + late final __objc_msgSend_175Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8)>>('objc_msgSend'); + late final __objc_msgSend_175 = __objc_msgSend_175Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_URLUserAllowedCharacterSet1 = + _registerName1("URLUserAllowedCharacterSet"); + late final _sel_URLPasswordAllowedCharacterSet1 = + _registerName1("URLPasswordAllowedCharacterSet"); + late final _sel_URLHostAllowedCharacterSet1 = + _registerName1("URLHostAllowedCharacterSet"); + late final _sel_URLPathAllowedCharacterSet1 = + _registerName1("URLPathAllowedCharacterSet"); + late final _sel_URLQueryAllowedCharacterSet1 = + _registerName1("URLQueryAllowedCharacterSet"); + late final _sel_URLFragmentAllowedCharacterSet1 = + _registerName1("URLFragmentAllowedCharacterSet"); + late final _sel_exemplarCharacterSet1 = + _registerName1("exemplarCharacterSet"); + late final _sel_calendarIdentifier1 = _registerName1("calendarIdentifier"); + late final _sel_localizedStringForCalendarIdentifier_1 = + _registerName1("localizedStringForCalendarIdentifier:"); + late final _sel_collationIdentifier1 = _registerName1("collationIdentifier"); + late final _sel_localizedStringForCollationIdentifier_1 = + _registerName1("localizedStringForCollationIdentifier:"); + late final _sel_usesMetricSystem1 = _registerName1("usesMetricSystem"); + late final _sel_decimalSeparator1 = _registerName1("decimalSeparator"); + late final _sel_groupingSeparator1 = _registerName1("groupingSeparator"); + late final _sel_currencySymbol1 = _registerName1("currencySymbol"); + late final _sel_currencyCode1 = _registerName1("currencyCode"); + late final _sel_localizedStringForCurrencyCode_1 = + _registerName1("localizedStringForCurrencyCode:"); + late final _sel_collatorIdentifier1 = _registerName1("collatorIdentifier"); + late final _sel_localizedStringForCollatorIdentifier_1 = + _registerName1("localizedStringForCollatorIdentifier:"); + late final _sel_quotationBeginDelimiter1 = + _registerName1("quotationBeginDelimiter"); + late final _sel_quotationEndDelimiter1 = + _registerName1("quotationEndDelimiter"); + late final _sel_alternateQuotationBeginDelimiter1 = + _registerName1("alternateQuotationBeginDelimiter"); + late final _sel_alternateQuotationEndDelimiter1 = + _registerName1("alternateQuotationEndDelimiter"); + late final _sel_autoupdatingCurrentLocale1 = + _registerName1("autoupdatingCurrentLocale"); + ffi.Pointer _objc_msgSend_176( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_176( + obj, + sel, + ); + } + + late final __objc_msgSend_176Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_176 = __objc_msgSend_176Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_currentLocale1 = _registerName1("currentLocale"); + late final _sel_systemLocale1 = _registerName1("systemLocale"); + late final _sel_localeWithLocaleIdentifier_1 = + _registerName1("localeWithLocaleIdentifier:"); + late final _sel_availableLocaleIdentifiers1 = + _registerName1("availableLocaleIdentifiers"); + late final _sel_ISOLanguageCodes1 = _registerName1("ISOLanguageCodes"); + late final _sel_ISOCountryCodes1 = _registerName1("ISOCountryCodes"); + late final _sel_ISOCurrencyCodes1 = _registerName1("ISOCurrencyCodes"); + late final _sel_commonISOCurrencyCodes1 = + _registerName1("commonISOCurrencyCodes"); + late final _sel_preferredLanguages1 = _registerName1("preferredLanguages"); + late final _sel_componentsFromLocaleIdentifier_1 = + _registerName1("componentsFromLocaleIdentifier:"); + late final _sel_localeIdentifierFromComponents_1 = + _registerName1("localeIdentifierFromComponents:"); + ffi.Pointer _objc_msgSend_177( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dict, + ) { + return __objc_msgSend_177( + obj, + sel, + dict, + ); + } + + late final __objc_msgSend_177Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_177 = __objc_msgSend_177Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_canonicalLocaleIdentifierFromString_1 = + _registerName1("canonicalLocaleIdentifierFromString:"); + late final _sel_canonicalLanguageIdentifierFromString_1 = + _registerName1("canonicalLanguageIdentifierFromString:"); + late final _sel_localeIdentifierFromWindowsLocaleCode_1 = + _registerName1("localeIdentifierFromWindowsLocaleCode:"); + ffi.Pointer _objc_msgSend_178( + ffi.Pointer obj, + ffi.Pointer sel, + int lcid, + ) { + return __objc_msgSend_178( + obj, + sel, + lcid, + ); + } + + late final __objc_msgSend_178Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Uint32)>>('objc_msgSend'); + late final __objc_msgSend_178 = __objc_msgSend_178Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_windowsLocaleCodeFromLocaleIdentifier_1 = + _registerName1("windowsLocaleCodeFromLocaleIdentifier:"); + int _objc_msgSend_179( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer localeIdentifier, + ) { + return __objc_msgSend_179( + obj, + sel, + localeIdentifier, + ); + } + + late final __objc_msgSend_179Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_179 = __objc_msgSend_179Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_characterDirectionForLanguage_1 = + _registerName1("characterDirectionForLanguage:"); + int _objc_msgSend_180( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer isoLangCode, + ) { + return __objc_msgSend_180( + obj, + sel, + isoLangCode, + ); + } + + late final __objc_msgSend_180Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_180 = __objc_msgSend_180Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_lineDirectionForLanguage_1 = + _registerName1("lineDirectionForLanguage:"); + late final _sel_localizedName_locale_1 = + _registerName1("localizedName:locale:"); + ffi.Pointer _objc_msgSend_181( + ffi.Pointer obj, + ffi.Pointer sel, + int style, + ffi.Pointer locale, + ) { + return __objc_msgSend_181( + obj, + sel, + style, + locale, + ); + } + + late final __objc_msgSend_181Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_181 = __objc_msgSend_181Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_timeZoneWithName_1 = _registerName1("timeZoneWithName:"); + late final _sel_timeZoneWithName_data_1 = + _registerName1("timeZoneWithName:data:"); + instancetype _objc_msgSend_182( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer tzName, + ffi.Pointer aData, + ) { + return __objc_msgSend_182( + obj, + sel, + tzName, + aData, + ); + } + + late final __objc_msgSend_182Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_182 = __objc_msgSend_182Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithName_1 = _registerName1("initWithName:"); + late final _sel_initWithName_data_1 = _registerName1("initWithName:data:"); + late final _sel_timeZoneForSecondsFromGMT_1 = + _registerName1("timeZoneForSecondsFromGMT:"); + instancetype _objc_msgSend_183( + ffi.Pointer obj, + ffi.Pointer sel, + int seconds, + ) { + return __objc_msgSend_183( + obj, + sel, + seconds, + ); + } + + late final __objc_msgSend_183Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_183 = __objc_msgSend_183Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_timeZoneWithAbbreviation_1 = + _registerName1("timeZoneWithAbbreviation:"); + late final _sel_dateWithYear_month_day_hour_minute_second_timeZone_1 = + _registerName1("dateWithYear:month:day:hour:minute:second:timeZone:"); + ffi.Pointer _objc_msgSend_184( + ffi.Pointer obj, + ffi.Pointer sel, + int year, + int month, + int day, + int hour, + int minute, + int second, + ffi.Pointer aTimeZone, + ) { + return __objc_msgSend_184( + obj, + sel, + year, + month, + day, + hour, + minute, + second, + aTimeZone, + ); + } + + late final __objc_msgSend_184Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + NSUInteger, + NSUInteger, + NSUInteger, + NSUInteger, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_184 = __objc_msgSend_184Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + int, + int, + int, + int, + ffi.Pointer)>(); + + late final _sel_dateByAddingYears_months_days_hours_minutes_seconds_1 = + _registerName1("dateByAddingYears:months:days:hours:minutes:seconds:"); + ffi.Pointer _objc_msgSend_185( + ffi.Pointer obj, + ffi.Pointer sel, + int year, + int month, + int day, + int hour, + int minute, + int second, + ) { + return __objc_msgSend_185( + obj, + sel, + year, + month, + day, + hour, + minute, + second, + ); + } + + late final __objc_msgSend_185Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + NSInteger, + NSInteger, + NSInteger, + NSInteger, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_185 = __objc_msgSend_185Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, int, int, int, int, int)>(); + + late final _sel_dayOfCommonEra1 = _registerName1("dayOfCommonEra"); + late final _sel_dayOfMonth1 = _registerName1("dayOfMonth"); + late final _sel_dayOfWeek1 = _registerName1("dayOfWeek"); + late final _sel_dayOfYear1 = _registerName1("dayOfYear"); + late final _sel_hourOfDay1 = _registerName1("hourOfDay"); + late final _sel_minuteOfHour1 = _registerName1("minuteOfHour"); + late final _sel_monthOfYear1 = _registerName1("monthOfYear"); + late final _sel_secondOfMinute1 = _registerName1("secondOfMinute"); + late final _sel_yearOfCommonEra1 = _registerName1("yearOfCommonEra"); + late final _sel_calendarFormat1 = _registerName1("calendarFormat"); + late final _sel_descriptionWithCalendarFormat_locale_1 = + _registerName1("descriptionWithCalendarFormat:locale:"); + late final _sel_descriptionWithCalendarFormat_1 = + _registerName1("descriptionWithCalendarFormat:"); + late final _sel_timeZone1 = _registerName1("timeZone"); + late final _sel_initWithString_calendarFormat_locale_1 = + _registerName1("initWithString:calendarFormat:locale:"); + late final _sel_initWithString_calendarFormat_1 = + _registerName1("initWithString:calendarFormat:"); + late final _sel_initWithYear_month_day_hour_minute_second_timeZone_1 = + _registerName1("initWithYear:month:day:hour:minute:second:timeZone:"); + late final _sel_setCalendarFormat_1 = _registerName1("setCalendarFormat:"); + void _objc_msgSend_186( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ) { + return __objc_msgSend_186( + obj, + sel, + format, + ); + } + + late final __objc_msgSend_186Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_186 = __objc_msgSend_186Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setTimeZone_1 = _registerName1("setTimeZone:"); + void _objc_msgSend_187( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aTimeZone, + ) { + return __objc_msgSend_187( + obj, + sel, + aTimeZone, + ); + } + + late final __objc_msgSend_187Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_187 = __objc_msgSend_187Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_years_months_days_hours_minutes_seconds_sinceDate_1 = + _registerName1("years:months:days:hours:minutes:seconds:sinceDate:"); + void _objc_msgSend_188( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer yp, + ffi.Pointer mop, + ffi.Pointer dp, + ffi.Pointer hp, + ffi.Pointer mip, + ffi.Pointer sp, + ffi.Pointer date, + ) { + return __objc_msgSend_188( + obj, + sel, + yp, + mop, + dp, + hp, + mip, + sp, + date, + ); + } + + late final __objc_msgSend_188Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_188 = __objc_msgSend_188Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_dateWithCalendarFormat_timeZone_1 = + _registerName1("dateWithCalendarFormat:timeZone:"); + ffi.Pointer _objc_msgSend_189( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ffi.Pointer aTimeZone, + ) { + return __objc_msgSend_189( + obj, + sel, + format, + aTimeZone, + ); + } + + late final __objc_msgSend_189Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_189 = __objc_msgSend_189Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_descriptionWithCalendarFormat_timeZone_locale_1 = + _registerName1("descriptionWithCalendarFormat:timeZone:locale:"); + ffi.Pointer _objc_msgSend_190( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ffi.Pointer aTimeZone, + ffi.Pointer locale, + ) { + return __objc_msgSend_190( + obj, + sel, + format, + aTimeZone, + locale, + ); + } + + late final __objc_msgSend_190Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_190 = __objc_msgSend_190Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_fileModificationDate1 = + _registerName1("fileModificationDate"); + late final _sel_fileType1 = _registerName1("fileType"); + late final _sel_filePosixPermissions1 = + _registerName1("filePosixPermissions"); + late final _sel_fileOwnerAccountName1 = + _registerName1("fileOwnerAccountName"); + late final _sel_fileGroupOwnerAccountName1 = + _registerName1("fileGroupOwnerAccountName"); + late final _sel_fileSystemNumber1 = _registerName1("fileSystemNumber"); + late final _sel_fileSystemFileNumber1 = + _registerName1("fileSystemFileNumber"); + late final _sel_fileExtensionHidden1 = _registerName1("fileExtensionHidden"); + late final _sel_fileHFSCreatorCode1 = _registerName1("fileHFSCreatorCode"); + int _objc_msgSend_191( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_191( + obj, + sel, + ); + } + + late final __objc_msgSend_191Ptr = _lookup< + ffi.NativeFunction< + OSType Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_191 = __objc_msgSend_191Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_fileHFSTypeCode1 = _registerName1("fileHFSTypeCode"); + late final _sel_fileIsImmutable1 = _registerName1("fileIsImmutable"); + late final _sel_fileIsAppendOnly1 = _registerName1("fileIsAppendOnly"); + late final _sel_fileCreationDate1 = _registerName1("fileCreationDate"); + late final _sel_fileOwnerAccountID1 = _registerName1("fileOwnerAccountID"); + ffi.Pointer _objc_msgSend_192( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_192( + obj, + sel, + ); + } + + late final __objc_msgSend_192Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_192 = __objc_msgSend_192Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_fileGroupOwnerAccountID1 = + _registerName1("fileGroupOwnerAccountID"); + late final _sel_predicateWithBlock_1 = _registerName1("predicateWithBlock:"); + ffi.Pointer _objc_msgSend_193( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_193( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_193Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_193 = __objc_msgSend_193Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_predicateFormat1 = _registerName1("predicateFormat"); + late final _sel_predicateWithSubstitutionVariables_1 = + _registerName1("predicateWithSubstitutionVariables:"); + late final _sel_evaluateWithObject_1 = _registerName1("evaluateWithObject:"); + late final _sel_evaluateWithObject_substitutionVariables_1 = + _registerName1("evaluateWithObject:substitutionVariables:"); + bool _objc_msgSend_194( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer object, + ffi.Pointer bindings, + ) { + return __objc_msgSend_194( + obj, + sel, + object, + bindings, + ); + } + + late final __objc_msgSend_194Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_194 = __objc_msgSend_194Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_allowEvaluation1 = _registerName1("allowEvaluation"); + late final _sel_filteredArrayUsingPredicate_1 = + _registerName1("filteredArrayUsingPredicate:"); + ffi.Pointer _objc_msgSend_195( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicate, + ) { + return __objc_msgSend_195( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_195Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_195 = __objc_msgSend_195Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithChar_1 = _registerName1("initWithChar:"); + ffi.Pointer _objc_msgSend_196( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_196( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_196Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Char)>>('objc_msgSend'); + late final __objc_msgSend_196 = __objc_msgSend_196Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithUnsignedChar_1 = + _registerName1("initWithUnsignedChar:"); + ffi.Pointer _objc_msgSend_197( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_197( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_197Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedChar)>>('objc_msgSend'); + late final __objc_msgSend_197 = __objc_msgSend_197Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithShort_1 = _registerName1("initWithShort:"); + ffi.Pointer _objc_msgSend_198( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_198( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_198Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Short)>>('objc_msgSend'); + late final __objc_msgSend_198 = __objc_msgSend_198Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithUnsignedShort_1 = + _registerName1("initWithUnsignedShort:"); + ffi.Pointer _objc_msgSend_199( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_199( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_199Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedShort)>>('objc_msgSend'); + late final __objc_msgSend_199 = __objc_msgSend_199Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithInt_1 = _registerName1("initWithInt:"); + ffi.Pointer _objc_msgSend_200( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_200( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_200Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int)>>('objc_msgSend'); + late final __objc_msgSend_200 = __objc_msgSend_200Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithUnsignedInt_1 = + _registerName1("initWithUnsignedInt:"); + ffi.Pointer _objc_msgSend_201( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_201( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_201Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_201 = __objc_msgSend_201Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithLong_1 = _registerName1("initWithLong:"); + ffi.Pointer _objc_msgSend_202( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_202( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_202Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Long)>>('objc_msgSend'); + late final __objc_msgSend_202 = __objc_msgSend_202Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithUnsignedLong_1 = + _registerName1("initWithUnsignedLong:"); + ffi.Pointer _objc_msgSend_203( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_203( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_203Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_203 = __objc_msgSend_203Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithLongLong_1 = _registerName1("initWithLongLong:"); + ffi.Pointer _objc_msgSend_204( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_204( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_204Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.LongLong)>>('objc_msgSend'); + late final __objc_msgSend_204 = __objc_msgSend_204Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithUnsignedLongLong_1 = + _registerName1("initWithUnsignedLongLong:"); + ffi.Pointer _objc_msgSend_205( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_205( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_205Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLongLong)>>('objc_msgSend'); + late final __objc_msgSend_205 = __objc_msgSend_205Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithFloat_1 = _registerName1("initWithFloat:"); + ffi.Pointer _objc_msgSend_206( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_206( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_206Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Float)>>('objc_msgSend'); + late final __objc_msgSend_206 = __objc_msgSend_206Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_initWithDouble_1 = _registerName1("initWithDouble:"); + ffi.Pointer _objc_msgSend_207( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_207( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_207Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_207 = __objc_msgSend_207Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_initWithBool_1 = _registerName1("initWithBool:"); + ffi.Pointer _objc_msgSend_208( + ffi.Pointer obj, + ffi.Pointer sel, + bool value, + ) { + return __objc_msgSend_208( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_208Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_208 = __objc_msgSend_208Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_initWithInteger_1 = _registerName1("initWithInteger:"); + late final _sel_initWithUnsignedInteger_1 = + _registerName1("initWithUnsignedInteger:"); + late final _sel_charValue1 = _registerName1("charValue"); + int _objc_msgSend_209( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_209( + obj, + sel, + ); + } + + late final __objc_msgSend_209Ptr = _lookup< + ffi.NativeFunction< + ffi.Char Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_209 = __objc_msgSend_209Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_unsignedCharValue1 = _registerName1("unsignedCharValue"); + int _objc_msgSend_210( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_210( + obj, + sel, + ); + } + + late final __objc_msgSend_210Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedChar Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_210 = __objc_msgSend_210Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_shortValue1 = _registerName1("shortValue"); + int _objc_msgSend_211( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_211( + obj, + sel, + ); + } + + late final __objc_msgSend_211Ptr = _lookup< + ffi.NativeFunction< + ffi.Short Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_211 = __objc_msgSend_211Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_unsignedShortValue1 = _registerName1("unsignedShortValue"); + int _objc_msgSend_212( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_212( + obj, + sel, + ); + } + + late final __objc_msgSend_212Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedShort Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_212 = __objc_msgSend_212Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_intValue1 = _registerName1("intValue"); + int _objc_msgSend_213( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_213( + obj, + sel, + ); + } + + late final __objc_msgSend_213Ptr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_213 = __objc_msgSend_213Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_unsignedIntValue1 = _registerName1("unsignedIntValue"); + late final _sel_longValue1 = _registerName1("longValue"); + late final _sel_unsignedLongValue1 = _registerName1("unsignedLongValue"); + late final _sel_longLongValue1 = _registerName1("longLongValue"); + int _objc_msgSend_214( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_214( + obj, + sel, + ); + } + + late final __objc_msgSend_214Ptr = _lookup< + ffi.NativeFunction< + ffi.LongLong Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_214 = __objc_msgSend_214Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_unsignedLongLongValue1 = + _registerName1("unsignedLongLongValue"); + late final _sel_floatValue1 = _registerName1("floatValue"); + double _objc_msgSend_215( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_215( + obj, + sel, + ); + } + + late final __objc_msgSend_215Ptr = _lookup< + ffi.NativeFunction< + ffi.Float Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_215 = __objc_msgSend_215Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_doubleValue1 = _registerName1("doubleValue"); + late final _sel_boolValue1 = _registerName1("boolValue"); + late final _sel_integerValue1 = _registerName1("integerValue"); + late final _sel_unsignedIntegerValue1 = + _registerName1("unsignedIntegerValue"); + late final _sel_stringValue1 = _registerName1("stringValue"); + int _objc_msgSend_216( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherNumber, + ) { + return __objc_msgSend_216( + obj, + sel, + otherNumber, + ); + } + + late final __objc_msgSend_216Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_216 = __objc_msgSend_216Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_isEqualToNumber_1 = _registerName1("isEqualToNumber:"); + bool _objc_msgSend_217( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer number, + ) { + return __objc_msgSend_217( + obj, + sel, + number, + ); + } + + late final __objc_msgSend_217Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_217 = __objc_msgSend_217Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_numberWithChar_1 = _registerName1("numberWithChar:"); + late final _sel_numberWithUnsignedChar_1 = + _registerName1("numberWithUnsignedChar:"); + late final _sel_numberWithShort_1 = _registerName1("numberWithShort:"); + late final _sel_numberWithUnsignedShort_1 = + _registerName1("numberWithUnsignedShort:"); + late final _sel_numberWithInt_1 = _registerName1("numberWithInt:"); + late final _sel_numberWithUnsignedInt_1 = + _registerName1("numberWithUnsignedInt:"); + late final _sel_numberWithLong_1 = _registerName1("numberWithLong:"); + late final _sel_numberWithUnsignedLong_1 = + _registerName1("numberWithUnsignedLong:"); + late final _sel_numberWithLongLong_1 = _registerName1("numberWithLongLong:"); + late final _sel_numberWithUnsignedLongLong_1 = + _registerName1("numberWithUnsignedLongLong:"); + late final _sel_numberWithFloat_1 = _registerName1("numberWithFloat:"); + late final _sel_numberWithDouble_1 = _registerName1("numberWithDouble:"); + late final _sel_numberWithBool_1 = _registerName1("numberWithBool:"); + late final _sel_numberWithInteger_1 = _registerName1("numberWithInteger:"); + late final _sel_numberWithUnsignedInteger_1 = + _registerName1("numberWithUnsignedInteger:"); + late final _sel_port1 = _registerName1("port"); + late final _sel_user1 = _registerName1("user"); + late final _sel_password1 = _registerName1("password"); + late final _sel_path1 = _registerName1("path"); + late final _sel_fragment1 = _registerName1("fragment"); + late final _sel_parameterString1 = _registerName1("parameterString"); + late final _sel_query1 = _registerName1("query"); + late final _sel_relativePath1 = _registerName1("relativePath"); + late final _sel_hasDirectoryPath1 = _registerName1("hasDirectoryPath"); + late final _sel_getFileSystemRepresentation_maxLength_1 = + _registerName1("getFileSystemRepresentation:maxLength:"); + bool _objc_msgSend_218( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + int maxBufferLength, + ) { + return __objc_msgSend_218( + obj, + sel, + buffer, + maxBufferLength, + ); + } + + late final __objc_msgSend_218Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_218 = __objc_msgSend_218Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_fileSystemRepresentation1 = + _registerName1("fileSystemRepresentation"); + late final _sel_isFileURL1 = _registerName1("isFileURL"); + late final _sel_standardizedURL1 = _registerName1("standardizedURL"); + late final _sel_checkResourceIsReachableAndReturnError_1 = + _registerName1("checkResourceIsReachableAndReturnError:"); + bool _objc_msgSend_219( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> error, + ) { + return __objc_msgSend_219( + obj, + sel, + error, + ); + } + + late final __objc_msgSend_219Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_219 = __objc_msgSend_219Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_isFileReferenceURL1 = _registerName1("isFileReferenceURL"); + late final _sel_fileReferenceURL1 = _registerName1("fileReferenceURL"); + late final _sel_filePathURL1 = _registerName1("filePathURL"); + late final _sel_getResourceValue_forKey_error_1 = + _registerName1("getResourceValue:forKey:error:"); + bool _objc_msgSend_220( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> value, + NSURLResourceKey key, + ffi.Pointer> error, + ) { + return __objc_msgSend_220( + obj, + sel, + value, + key, + error, + ); + } + + late final __objc_msgSend_220Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSURLResourceKey, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_220 = __objc_msgSend_220Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSURLResourceKey, + ffi.Pointer>)>(); + + late final _sel_getPromisedItemResourceValue_forKey_error_1 = + _registerName1("getPromisedItemResourceValue:forKey:error:"); + late final _sel_promisedItemResourceValuesForKeys_error_1 = + _registerName1("promisedItemResourceValuesForKeys:error:"); + ffi.Pointer _objc_msgSend_221( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keys, + ffi.Pointer> error, + ) { + return __objc_msgSend_221( + obj, + sel, + keys, + error, + ); + } + + late final __objc_msgSend_221Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_221 = __objc_msgSend_221Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_checkPromisedItemIsReachableAndReturnError_1 = + _registerName1("checkPromisedItemIsReachableAndReturnError:"); + late final _sel_fileURLWithPathComponents_1 = + _registerName1("fileURLWithPathComponents:"); + ffi.Pointer _objc_msgSend_222( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer components, + ) { + return __objc_msgSend_222( + obj, + sel, + components, + ); + } + + late final __objc_msgSend_222Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_222 = __objc_msgSend_222Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_pathComponents1 = _registerName1("pathComponents"); + late final _sel_lastPathComponent1 = _registerName1("lastPathComponent"); + late final _sel_pathExtension1 = _registerName1("pathExtension"); + late final _sel_URLByAppendingPathComponent_1 = + _registerName1("URLByAppendingPathComponent:"); + late final _sel_URLByAppendingPathComponent_isDirectory_1 = + _registerName1("URLByAppendingPathComponent:isDirectory:"); + late final _sel_URLByDeletingLastPathComponent1 = + _registerName1("URLByDeletingLastPathComponent"); + late final _sel_URLByAppendingPathExtension_1 = + _registerName1("URLByAppendingPathExtension:"); + late final _sel_URLByDeletingPathExtension1 = + _registerName1("URLByDeletingPathExtension"); + late final _sel_URLByStandardizingPath1 = + _registerName1("URLByStandardizingPath"); + late final _sel_URLByResolvingSymlinksInPath1 = + _registerName1("URLByResolvingSymlinksInPath"); + late final _sel_resourceDataUsingCache_1 = + _registerName1("resourceDataUsingCache:"); + ffi.Pointer _objc_msgSend_223( + ffi.Pointer obj, + ffi.Pointer sel, + bool shouldUseCache, + ) { + return __objc_msgSend_223( + obj, + sel, + shouldUseCache, + ); + } + + late final __objc_msgSend_223Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_223 = __objc_msgSend_223Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_loadResourceDataNotifyingClient_usingCache_1 = + _registerName1("loadResourceDataNotifyingClient:usingCache:"); + void _objc_msgSend_224( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer client, + bool shouldUseCache, + ) { + return __objc_msgSend_224( + obj, + sel, + client, + shouldUseCache, + ); + } + + late final __objc_msgSend_224Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_224 = __objc_msgSend_224Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_propertyForKey_1 = _registerName1("propertyForKey:"); + late final _sel_setResourceData_1 = _registerName1("setResourceData:"); + late final _sel_setProperty_forKey_1 = _registerName1("setProperty:forKey:"); + bool _objc_msgSend_225( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer property, + ffi.Pointer propertyKey, + ) { + return __objc_msgSend_225( + obj, + sel, + property, + propertyKey, + ); + } + + late final __objc_msgSend_225Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_225 = __objc_msgSend_225Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSURLHandle1 = _getClass1("NSURLHandle"); + late final _sel_registerURLHandleClass_1 = + _registerName1("registerURLHandleClass:"); + late final _sel_URLHandleClassForURL_1 = + _registerName1("URLHandleClassForURL:"); + ffi.Pointer _objc_msgSend_226( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anURL, + ) { + return __objc_msgSend_226( + obj, + sel, + anURL, + ); + } + + late final __objc_msgSend_226Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_226 = __objc_msgSend_226Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_status1 = _registerName1("status"); + int _objc_msgSend_227( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_227( + obj, + sel, + ); + } + + late final __objc_msgSend_227Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_227 = __objc_msgSend_227Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_failureReason1 = _registerName1("failureReason"); + late final _sel_addClient_1 = _registerName1("addClient:"); + late final _sel_removeClient_1 = _registerName1("removeClient:"); + late final _sel_loadInBackground1 = _registerName1("loadInBackground"); + late final _sel_cancelLoadInBackground1 = + _registerName1("cancelLoadInBackground"); + late final _sel_resourceData1 = _registerName1("resourceData"); + late final _sel_availableResourceData1 = + _registerName1("availableResourceData"); + late final _sel_expectedResourceDataSize1 = + _registerName1("expectedResourceDataSize"); + late final _sel_flushCachedData1 = _registerName1("flushCachedData"); + late final _sel_backgroundLoadDidFailWithReason_1 = + _registerName1("backgroundLoadDidFailWithReason:"); + late final _sel_didLoadBytes_loadComplete_1 = + _registerName1("didLoadBytes:loadComplete:"); + void _objc_msgSend_228( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer newBytes, + bool yorn, + ) { + return __objc_msgSend_228( + obj, + sel, + newBytes, + yorn, + ); + } + + late final __objc_msgSend_228Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_228 = __objc_msgSend_228Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_canInitWithURL_1 = _registerName1("canInitWithURL:"); + bool _objc_msgSend_229( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anURL, + ) { + return __objc_msgSend_229( + obj, + sel, + anURL, + ); + } + + late final __objc_msgSend_229Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_229 = __objc_msgSend_229Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_cachedHandleForURL_1 = _registerName1("cachedHandleForURL:"); + ffi.Pointer _objc_msgSend_230( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anURL, + ) { + return __objc_msgSend_230( + obj, + sel, + anURL, + ); + } + + late final __objc_msgSend_230Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_230 = __objc_msgSend_230Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithURL_cached_1 = _registerName1("initWithURL:cached:"); + ffi.Pointer _objc_msgSend_231( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anURL, + bool willCache, + ) { + return __objc_msgSend_231( + obj, + sel, + anURL, + willCache, + ); + } + + late final __objc_msgSend_231Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_231 = __objc_msgSend_231Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_propertyForKeyIfAvailable_1 = + _registerName1("propertyForKeyIfAvailable:"); + late final _sel_writeProperty_forKey_1 = + _registerName1("writeProperty:forKey:"); + late final _sel_writeData_1 = _registerName1("writeData:"); + late final _sel_loadInForeground1 = _registerName1("loadInForeground"); + late final _sel_beginLoadInBackground1 = + _registerName1("beginLoadInBackground"); + late final _sel_endLoadInBackground1 = _registerName1("endLoadInBackground"); + late final _sel_URLHandleUsingCache_1 = + _registerName1("URLHandleUsingCache:"); + ffi.Pointer _objc_msgSend_232( + ffi.Pointer obj, + ffi.Pointer sel, + bool shouldUseCache, + ) { + return __objc_msgSend_232( + obj, + sel, + shouldUseCache, + ); + } + + late final __objc_msgSend_232Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_232 = __objc_msgSend_232Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_writeToFile_options_error_1 = + _registerName1("writeToFile:options:error:"); + bool _objc_msgSend_233( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + int writeOptionsMask, + ffi.Pointer> errorPtr, + ) { + return __objc_msgSend_233( + obj, + sel, + path, + writeOptionsMask, + errorPtr, + ); + } + + late final __objc_msgSend_233Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_233 = __objc_msgSend_233Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_writeToURL_options_error_1 = + _registerName1("writeToURL:options:error:"); + bool _objc_msgSend_234( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int writeOptionsMask, + ffi.Pointer> errorPtr, + ) { + return __objc_msgSend_234( + obj, + sel, + url, + writeOptionsMask, + errorPtr, + ); + } + + late final __objc_msgSend_234Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_234 = __objc_msgSend_234Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_rangeOfData_options_range_1 = + _registerName1("rangeOfData:options:range:"); + NSRange _objc_msgSend_235( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dataToFind, + int mask, + NSRange searchRange, + ) { + return __objc_msgSend_235( + obj, + sel, + dataToFind, + mask, + searchRange, + ); + } + + late final __objc_msgSend_235Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_235 = __objc_msgSend_235Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange)>(); + + late final _sel_enumerateByteRangesUsingBlock_1 = + _registerName1("enumerateByteRangesUsingBlock:"); + void _objc_msgSend_236( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_236( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_236Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_236 = __objc_msgSend_236Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_dataWithBytes_length_1 = + _registerName1("dataWithBytes:length:"); + instancetype _objc_msgSend_237( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int length, + ) { + return __objc_msgSend_237( + obj, + sel, + bytes, + length, + ); + } + + late final __objc_msgSend_237Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_237 = __objc_msgSend_237Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_dataWithBytesNoCopy_length_1 = + _registerName1("dataWithBytesNoCopy:length:"); + late final _sel_dataWithBytesNoCopy_length_freeWhenDone_1 = + _registerName1("dataWithBytesNoCopy:length:freeWhenDone:"); + instancetype _objc_msgSend_238( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int length, + bool b, + ) { + return __objc_msgSend_238( + obj, + sel, + bytes, + length, + b, + ); + } + + late final __objc_msgSend_238Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_238 = __objc_msgSend_238Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, bool)>(); + + late final _sel_dataWithContentsOfFile_options_error_1 = + _registerName1("dataWithContentsOfFile:options:error:"); + instancetype _objc_msgSend_239( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + int readOptionsMask, + ffi.Pointer> errorPtr, + ) { + return __objc_msgSend_239( + obj, + sel, + path, + readOptionsMask, + errorPtr, + ); + } + + late final __objc_msgSend_239Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_239 = __objc_msgSend_239Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_dataWithContentsOfURL_options_error_1 = + _registerName1("dataWithContentsOfURL:options:error:"); + instancetype _objc_msgSend_240( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int readOptionsMask, + ffi.Pointer> errorPtr, + ) { + return __objc_msgSend_240( + obj, + sel, + url, + readOptionsMask, + errorPtr, + ); + } + + late final __objc_msgSend_240Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_240 = __objc_msgSend_240Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_dataWithContentsOfFile_1 = + _registerName1("dataWithContentsOfFile:"); + late final _sel_dataWithContentsOfURL_1 = + _registerName1("dataWithContentsOfURL:"); + late final _sel_initWithBytes_length_1 = + _registerName1("initWithBytes:length:"); + late final _sel_initWithBytesNoCopy_length_1 = + _registerName1("initWithBytesNoCopy:length:"); + late final _sel_initWithBytesNoCopy_length_freeWhenDone_1 = + _registerName1("initWithBytesNoCopy:length:freeWhenDone:"); + late final _sel_initWithBytesNoCopy_length_deallocator_1 = + _registerName1("initWithBytesNoCopy:length:deallocator:"); + instancetype _objc_msgSend_241( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int length, + ffi.Pointer<_ObjCBlock> deallocator, + ) { + return __objc_msgSend_241( + obj, + sel, + bytes, + length, + deallocator, + ); + } + + late final __objc_msgSend_241Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_241 = __objc_msgSend_241Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_initWithContentsOfFile_options_error_1 = + _registerName1("initWithContentsOfFile:options:error:"); + late final _sel_initWithContentsOfURL_options_error_1 = + _registerName1("initWithContentsOfURL:options:error:"); + late final _sel_initWithData_1 = _registerName1("initWithData:"); + instancetype _objc_msgSend_242( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ) { + return __objc_msgSend_242( + obj, + sel, + data, + ); + } + + late final __objc_msgSend_242Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_242 = __objc_msgSend_242Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_dataWithData_1 = _registerName1("dataWithData:"); + late final _sel_initWithBase64EncodedString_options_1 = + _registerName1("initWithBase64EncodedString:options:"); + instancetype _objc_msgSend_243( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer base64String, + int options, + ) { + return __objc_msgSend_243( + obj, + sel, + base64String, + options, + ); + } + + late final __objc_msgSend_243Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_243 = __objc_msgSend_243Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_base64EncodedStringWithOptions_1 = + _registerName1("base64EncodedStringWithOptions:"); + ffi.Pointer _objc_msgSend_244( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_244( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_244Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_244 = __objc_msgSend_244Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithBase64EncodedData_options_1 = + _registerName1("initWithBase64EncodedData:options:"); + instancetype _objc_msgSend_245( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer base64Data, + int options, + ) { + return __objc_msgSend_245( + obj, + sel, + base64Data, + options, + ); + } + + late final __objc_msgSend_245Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_245 = __objc_msgSend_245Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_base64EncodedDataWithOptions_1 = + _registerName1("base64EncodedDataWithOptions:"); + ffi.Pointer _objc_msgSend_246( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_246( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_246Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_246 = __objc_msgSend_246Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_decompressedDataUsingAlgorithm_error_1 = + _registerName1("decompressedDataUsingAlgorithm:error:"); + instancetype _objc_msgSend_247( + ffi.Pointer obj, + ffi.Pointer sel, + int algorithm, + ffi.Pointer> error, + ) { + return __objc_msgSend_247( + obj, + sel, + algorithm, + error, + ); + } + + late final __objc_msgSend_247Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_247 = __objc_msgSend_247Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer>)>(); + + late final _sel_compressedDataUsingAlgorithm_error_1 = + _registerName1("compressedDataUsingAlgorithm:error:"); + late final _sel_getBytes_1 = _registerName1("getBytes:"); + late final _sel_dataWithContentsOfMappedFile_1 = + _registerName1("dataWithContentsOfMappedFile:"); + late final _sel_initWithContentsOfMappedFile_1 = + _registerName1("initWithContentsOfMappedFile:"); + late final _sel_initWithBase64Encoding_1 = + _registerName1("initWithBase64Encoding:"); + late final _sel_base64Encoding1 = _registerName1("base64Encoding"); + late final _sel_encodeDataObject_1 = _registerName1("encodeDataObject:"); + void _objc_msgSend_248( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ) { + return __objc_msgSend_248( + obj, + sel, + data, + ); + } + + late final __objc_msgSend_248Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_248 = __objc_msgSend_248Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeDataObject1 = _registerName1("decodeDataObject"); + late final _sel_decodeValueOfObjCType_at_size_1 = + _registerName1("decodeValueOfObjCType:at:size:"); + void _objc_msgSend_249( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer type, + ffi.Pointer data, + int size, + ) { + return __objc_msgSend_249( + obj, + sel, + type, + data, + size, + ); + } + + late final __objc_msgSend_249Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_249 = __objc_msgSend_249Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_versionForClassName_1 = + _registerName1("versionForClassName:"); + int _objc_msgSend_250( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer className, + ) { + return __objc_msgSend_250( + obj, + sel, + className, + ); + } + + late final __objc_msgSend_250Ptr = _lookup< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_250 = __objc_msgSend_250Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_encodeObject_1 = _registerName1("encodeObject:"); + late final _sel_encodeRootObject_1 = _registerName1("encodeRootObject:"); + late final _sel_encodeBycopyObject_1 = _registerName1("encodeBycopyObject:"); + late final _sel_encodeByrefObject_1 = _registerName1("encodeByrefObject:"); + late final _sel_encodeConditionalObject_1 = + _registerName1("encodeConditionalObject:"); + late final _sel_encodeValuesOfObjCTypes_1 = + _registerName1("encodeValuesOfObjCTypes:"); + void _objc_msgSend_251( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer types, + ) { + return __objc_msgSend_251( + obj, + sel, + types, + ); + } + + late final __objc_msgSend_251Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_251 = __objc_msgSend_251Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_encodeArrayOfObjCType_count_at_1 = + _registerName1("encodeArrayOfObjCType:count:at:"); + void _objc_msgSend_252( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer type, + int count, + ffi.Pointer array, + ) { + return __objc_msgSend_252( + obj, + sel, + type, + count, + array, + ); + } + + late final __objc_msgSend_252Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_252 = __objc_msgSend_252Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_encodeBytes_length_1 = _registerName1("encodeBytes:length:"); + late final _sel_decodeObject1 = _registerName1("decodeObject"); + late final _sel_decodeTopLevelObjectAndReturnError_1 = + _registerName1("decodeTopLevelObjectAndReturnError:"); + ffi.Pointer _objc_msgSend_253( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> error, + ) { + return __objc_msgSend_253( + obj, + sel, + error, + ); + } + + late final __objc_msgSend_253Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_253 = __objc_msgSend_253Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_decodeValuesOfObjCTypes_1 = + _registerName1("decodeValuesOfObjCTypes:"); + late final _sel_decodeArrayOfObjCType_count_at_1 = + _registerName1("decodeArrayOfObjCType:count:at:"); + late final _sel_decodeBytesWithReturnedLength_1 = + _registerName1("decodeBytesWithReturnedLength:"); + ffi.Pointer _objc_msgSend_254( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer lengthp, + ) { + return __objc_msgSend_254( + obj, + sel, + lengthp, + ); + } + + late final __objc_msgSend_254Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_254 = __objc_msgSend_254Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_encodePropertyList_1 = _registerName1("encodePropertyList:"); + late final _sel_decodePropertyList1 = _registerName1("decodePropertyList"); + late final _sel_setObjectZone_1 = _registerName1("setObjectZone:"); + void _objc_msgSend_255( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer zone, + ) { + return __objc_msgSend_255( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_255Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_255 = __objc_msgSend_255Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_objectZone1 = _registerName1("objectZone"); + ffi.Pointer _objc_msgSend_256( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_256( + obj, + sel, + ); + } + + late final __objc_msgSend_256Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_256 = __objc_msgSend_256Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_systemVersion1 = _registerName1("systemVersion"); + late final _sel_allowsKeyedCoding1 = _registerName1("allowsKeyedCoding"); + late final _sel_encodeObject_forKey_1 = + _registerName1("encodeObject:forKey:"); + late final _sel_encodeConditionalObject_forKey_1 = + _registerName1("encodeConditionalObject:forKey:"); + late final _sel_encodeBool_forKey_1 = _registerName1("encodeBool:forKey:"); + void _objc_msgSend_257( + ffi.Pointer obj, + ffi.Pointer sel, + bool value, + ffi.Pointer key, + ) { + return __objc_msgSend_257( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_257Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Bool, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_257 = __objc_msgSend_257Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, bool, + ffi.Pointer)>(); + + late final _sel_encodeInt_forKey_1 = _registerName1("encodeInt:forKey:"); + void _objc_msgSend_258( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ffi.Pointer key, + ) { + return __objc_msgSend_258( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_258Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_258 = __objc_msgSend_258Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_encodeInt32_forKey_1 = _registerName1("encodeInt32:forKey:"); + void _objc_msgSend_259( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ffi.Pointer key, + ) { + return __objc_msgSend_259( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_259Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_259 = __objc_msgSend_259Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_encodeInt64_forKey_1 = _registerName1("encodeInt64:forKey:"); + void _objc_msgSend_260( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ffi.Pointer key, + ) { + return __objc_msgSend_260( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_260Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int64, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_260 = __objc_msgSend_260Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_encodeFloat_forKey_1 = _registerName1("encodeFloat:forKey:"); + void _objc_msgSend_261( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ffi.Pointer key, + ) { + return __objc_msgSend_261( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_261Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Float, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_261 = __objc_msgSend_261Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double, + ffi.Pointer)>(); + + late final _sel_encodeDouble_forKey_1 = + _registerName1("encodeDouble:forKey:"); + void _objc_msgSend_262( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ffi.Pointer key, + ) { + return __objc_msgSend_262( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_262Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Double, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_262 = __objc_msgSend_262Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double, + ffi.Pointer)>(); + + late final _sel_encodeBytes_length_forKey_1 = + _registerName1("encodeBytes:length:forKey:"); + void _objc_msgSend_263( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int length, + ffi.Pointer key, + ) { + return __objc_msgSend_263( + obj, + sel, + bytes, + length, + key, + ); + } + + late final __objc_msgSend_263Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_263 = __objc_msgSend_263Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_containsValueForKey_1 = + _registerName1("containsValueForKey:"); + late final _sel_decodeObjectForKey_1 = _registerName1("decodeObjectForKey:"); + late final _sel_decodeTopLevelObjectForKey_error_1 = + _registerName1("decodeTopLevelObjectForKey:error:"); + ffi.Pointer _objc_msgSend_264( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ffi.Pointer> error, + ) { + return __objc_msgSend_264( + obj, + sel, + key, + error, + ); + } + + late final __objc_msgSend_264Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_264 = __objc_msgSend_264Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_decodeBoolForKey_1 = _registerName1("decodeBoolForKey:"); + late final _sel_decodeIntForKey_1 = _registerName1("decodeIntForKey:"); + int _objc_msgSend_265( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_265( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_265Ptr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_265 = __objc_msgSend_265Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeInt32ForKey_1 = _registerName1("decodeInt32ForKey:"); + int _objc_msgSend_266( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_266( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_266Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_266 = __objc_msgSend_266Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeInt64ForKey_1 = _registerName1("decodeInt64ForKey:"); + int _objc_msgSend_267( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_267( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_267Ptr = _lookup< + ffi.NativeFunction< + ffi.Int64 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_267 = __objc_msgSend_267Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeFloatForKey_1 = _registerName1("decodeFloatForKey:"); + double _objc_msgSend_268( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_268( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_268Ptr = _lookup< + ffi.NativeFunction< + ffi.Float Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_268 = __objc_msgSend_268Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeDoubleForKey_1 = _registerName1("decodeDoubleForKey:"); + double _objc_msgSend_269( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_269( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_269Ptr = _lookup< + ffi.NativeFunction< + ffi.Double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_269 = __objc_msgSend_269Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeBytesForKey_returnedLength_1 = + _registerName1("decodeBytesForKey:returnedLength:"); + ffi.Pointer _objc_msgSend_270( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ffi.Pointer lengthp, + ) { + return __objc_msgSend_270( + obj, + sel, + key, + lengthp, + ); + } + + late final __objc_msgSend_270Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_270 = __objc_msgSend_270Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_encodeInteger_forKey_1 = + _registerName1("encodeInteger:forKey:"); + void _objc_msgSend_271( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ffi.Pointer key, + ) { + return __objc_msgSend_271( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_271Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSInteger, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_271 = __objc_msgSend_271Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_decodeIntegerForKey_1 = + _registerName1("decodeIntegerForKey:"); + late final _sel_requiresSecureCoding1 = + _registerName1("requiresSecureCoding"); + late final _sel_decodeObjectOfClass_forKey_1 = + _registerName1("decodeObjectOfClass:forKey:"); + ffi.Pointer _objc_msgSend_272( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ffi.Pointer key, + ) { + return __objc_msgSend_272( + obj, + sel, + aClass, + key, + ); + } + + late final __objc_msgSend_272Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_272 = __objc_msgSend_272Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeTopLevelObjectOfClass_forKey_error_1 = + _registerName1("decodeTopLevelObjectOfClass:forKey:error:"); + ffi.Pointer _objc_msgSend_273( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ffi.Pointer key, + ffi.Pointer> error, + ) { + return __objc_msgSend_273( + obj, + sel, + aClass, + key, + error, + ); + } + + late final __objc_msgSend_273Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_273 = __objc_msgSend_273Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_decodeArrayOfObjectsOfClass_forKey_1 = + _registerName1("decodeArrayOfObjectsOfClass:forKey:"); + ffi.Pointer _objc_msgSend_274( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cls, + ffi.Pointer key, + ) { + return __objc_msgSend_274( + obj, + sel, + cls, + key, + ); + } + + late final __objc_msgSend_274Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_274 = __objc_msgSend_274Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeDictionaryWithKeysOfClass_objectsOfClass_forKey_1 = + _registerName1("decodeDictionaryWithKeysOfClass:objectsOfClass:forKey:"); + ffi.Pointer _objc_msgSend_275( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keyCls, + ffi.Pointer objectCls, + ffi.Pointer key, + ) { + return __objc_msgSend_275( + obj, + sel, + keyCls, + objectCls, + key, + ); + } + + late final __objc_msgSend_275Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_275 = __objc_msgSend_275Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeObjectOfClasses_forKey_1 = + _registerName1("decodeObjectOfClasses:forKey:"); + ffi.Pointer _objc_msgSend_276( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer classes, + ffi.Pointer key, + ) { + return __objc_msgSend_276( + obj, + sel, + classes, + key, + ); + } + + late final __objc_msgSend_276Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_276 = __objc_msgSend_276Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeTopLevelObjectOfClasses_forKey_error_1 = + _registerName1("decodeTopLevelObjectOfClasses:forKey:error:"); + ffi.Pointer _objc_msgSend_277( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer classes, + ffi.Pointer key, + ffi.Pointer> error, + ) { + return __objc_msgSend_277( + obj, + sel, + classes, + key, + error, + ); + } + + late final __objc_msgSend_277Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_277 = __objc_msgSend_277Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_decodeArrayOfObjectsOfClasses_forKey_1 = + _registerName1("decodeArrayOfObjectsOfClasses:forKey:"); + ffi.Pointer _objc_msgSend_278( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer classes, + ffi.Pointer key, + ) { + return __objc_msgSend_278( + obj, + sel, + classes, + key, + ); + } + + late final __objc_msgSend_278Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_278 = __objc_msgSend_278Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeDictionaryWithKeysOfClasses_objectsOfClasses_forKey_1 = + _registerName1( + "decodeDictionaryWithKeysOfClasses:objectsOfClasses:forKey:"); + ffi.Pointer _objc_msgSend_279( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keyClasses, + ffi.Pointer objectClasses, + ffi.Pointer key, + ) { + return __objc_msgSend_279( + obj, + sel, + keyClasses, + objectClasses, + key, + ); + } + + late final __objc_msgSend_279Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_279 = __objc_msgSend_279Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodePropertyListForKey_1 = + _registerName1("decodePropertyListForKey:"); + late final _sel_allowedClasses1 = _registerName1("allowedClasses"); + ffi.Pointer _objc_msgSend_280( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_280( + obj, + sel, + ); + } + + late final __objc_msgSend_280Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_280 = __objc_msgSend_280Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_failWithError_1 = _registerName1("failWithError:"); + void _objc_msgSend_281( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer error, + ) { + return __objc_msgSend_281( + obj, + sel, + error, + ); + } + + late final __objc_msgSend_281Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_281 = __objc_msgSend_281Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodingFailurePolicy1 = + _registerName1("decodingFailurePolicy"); + int _objc_msgSend_282( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_282( + obj, + sel, + ); + } + + late final __objc_msgSend_282Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_282 = __objc_msgSend_282Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_error1 = _registerName1("error"); + ffi.Pointer _objc_msgSend_283( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_283( + obj, + sel, + ); + } + + late final __objc_msgSend_283Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_283 = __objc_msgSend_283Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_encodeNXObject_1 = _registerName1("encodeNXObject:"); + late final _sel_decodeNXObject1 = _registerName1("decodeNXObject"); + late final _sel_decodeValueOfObjCType_at_1 = + _registerName1("decodeValueOfObjCType:at:"); + late final _sel_encodePoint_1 = _registerName1("encodePoint:"); + void _objc_msgSend_284( + ffi.Pointer obj, + ffi.Pointer sel, + NSPoint point, + ) { + return __objc_msgSend_284( + obj, + sel, + point, + ); + } + + late final __objc_msgSend_284Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSPoint)>>('objc_msgSend'); + late final __objc_msgSend_284 = __objc_msgSend_284Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSPoint)>(); + + late final _sel_decodePoint1 = _registerName1("decodePoint"); + late final _sel_encodeSize_1 = _registerName1("encodeSize:"); + void _objc_msgSend_285( + ffi.Pointer obj, + ffi.Pointer sel, + NSSize size, + ) { + return __objc_msgSend_285( + obj, + sel, + size, + ); + } + + late final __objc_msgSend_285Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSSize)>>('objc_msgSend'); + late final __objc_msgSend_285 = __objc_msgSend_285Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSSize)>(); + + late final _sel_decodeSize1 = _registerName1("decodeSize"); + late final _sel_encodeRect_1 = _registerName1("encodeRect:"); + void _objc_msgSend_286( + ffi.Pointer obj, + ffi.Pointer sel, + NSRect rect, + ) { + return __objc_msgSend_286( + obj, + sel, + rect, + ); + } + + late final __objc_msgSend_286Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRect)>>('objc_msgSend'); + late final __objc_msgSend_286 = __objc_msgSend_286Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRect)>(); + + late final _sel_decodeRect1 = _registerName1("decodeRect"); + late final _sel_encodePoint_forKey_1 = _registerName1("encodePoint:forKey:"); + void _objc_msgSend_287( + ffi.Pointer obj, + ffi.Pointer sel, + NSPoint point, + ffi.Pointer key, + ) { + return __objc_msgSend_287( + obj, + sel, + point, + key, + ); + } + + late final __objc_msgSend_287Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSPoint, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_287 = __objc_msgSend_287Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSPoint, + ffi.Pointer)>(); + + late final _sel_encodeSize_forKey_1 = _registerName1("encodeSize:forKey:"); + void _objc_msgSend_288( + ffi.Pointer obj, + ffi.Pointer sel, + NSSize size, + ffi.Pointer key, + ) { + return __objc_msgSend_288( + obj, + sel, + size, + key, + ); + } + + late final __objc_msgSend_288Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSSize, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_288 = __objc_msgSend_288Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSSize, + ffi.Pointer)>(); + + late final _sel_encodeRect_forKey_1 = _registerName1("encodeRect:forKey:"); + void _objc_msgSend_289( + ffi.Pointer obj, + ffi.Pointer sel, + NSRect rect, + ffi.Pointer key, + ) { + return __objc_msgSend_289( + obj, + sel, + rect, + key, + ); + } + + late final __objc_msgSend_289Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRect, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_289 = __objc_msgSend_289Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRect, + ffi.Pointer)>(); + + late final _sel_decodePointForKey_1 = _registerName1("decodePointForKey:"); + NSPoint _objc_msgSend_290( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_290( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_290Ptr = _lookup< + ffi.NativeFunction< + NSPoint Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_290 = __objc_msgSend_290Ptr.asFunction< + NSPoint Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeSizeForKey_1 = _registerName1("decodeSizeForKey:"); + NSSize _objc_msgSend_291( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_291( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_291Ptr = _lookup< + ffi.NativeFunction< + NSSize Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_291 = __objc_msgSend_291Ptr.asFunction< + NSSize Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeRectForKey_1 = _registerName1("decodeRectForKey:"); + NSRect _objc_msgSend_292( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_292( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_292Ptr = _lookup< + ffi.NativeFunction< + NSRect Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_292 = __objc_msgSend_292Ptr.asFunction< + NSRect Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_substringFromIndex_1 = _registerName1("substringFromIndex:"); + ffi.Pointer _objc_msgSend_293( + ffi.Pointer obj, + ffi.Pointer sel, + int from, + ) { + return __objc_msgSend_293( + obj, + sel, + from, + ); + } + + late final __objc_msgSend_293Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_293 = __objc_msgSend_293Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_substringToIndex_1 = _registerName1("substringToIndex:"); + late final _sel_substringWithRange_1 = _registerName1("substringWithRange:"); + ffi.Pointer _objc_msgSend_294( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_294( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_294Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_294 = __objc_msgSend_294Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_getCharacters_range_1 = + _registerName1("getCharacters:range:"); + void _objc_msgSend_295( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + NSRange range, + ) { + return __objc_msgSend_295( + obj, + sel, + buffer, + range, + ); + } + + late final __objc_msgSend_295Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_295 = __objc_msgSend_295Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>(); + + int _objc_msgSend_296( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + ) { + return __objc_msgSend_296( + obj, + sel, + string, + ); + } + + late final __objc_msgSend_296Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_296 = __objc_msgSend_296Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_compare_options_1 = _registerName1("compare:options:"); + int _objc_msgSend_297( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int mask, + ) { + return __objc_msgSend_297( + obj, + sel, + string, + mask, + ); + } + + late final __objc_msgSend_297Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_297 = __objc_msgSend_297Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_compare_options_range_1 = + _registerName1("compare:options:range:"); + int _objc_msgSend_298( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int mask, + NSRange rangeOfReceiverToCompare, + ) { + return __objc_msgSend_298( + obj, + sel, + string, + mask, + rangeOfReceiverToCompare, + ); + } + + late final __objc_msgSend_298Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_298 = __objc_msgSend_298Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange)>(); + + late final _sel_compare_options_range_locale_1 = + _registerName1("compare:options:range:locale:"); + int _objc_msgSend_299( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int mask, + NSRange rangeOfReceiverToCompare, + ffi.Pointer locale, + ) { + return __objc_msgSend_299( + obj, + sel, + string, + mask, + rangeOfReceiverToCompare, + locale, + ); + } + + late final __objc_msgSend_299Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_299 = __objc_msgSend_299Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange, ffi.Pointer)>(); + + late final _sel_caseInsensitiveCompare_1 = + _registerName1("caseInsensitiveCompare:"); + late final _sel_localizedCompare_1 = _registerName1("localizedCompare:"); + late final _sel_localizedCaseInsensitiveCompare_1 = + _registerName1("localizedCaseInsensitiveCompare:"); + late final _sel_localizedStandardCompare_1 = + _registerName1("localizedStandardCompare:"); + late final _sel_isEqualToString_1 = _registerName1("isEqualToString:"); + late final _sel_hasPrefix_1 = _registerName1("hasPrefix:"); + late final _sel_hasSuffix_1 = _registerName1("hasSuffix:"); + late final _sel_commonPrefixWithString_options_1 = + _registerName1("commonPrefixWithString:options:"); + ffi.Pointer _objc_msgSend_300( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer str, + int mask, + ) { + return __objc_msgSend_300( + obj, + sel, + str, + mask, + ); + } + + late final __objc_msgSend_300Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_300 = __objc_msgSend_300Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_containsString_1 = _registerName1("containsString:"); + late final _sel_localizedCaseInsensitiveContainsString_1 = + _registerName1("localizedCaseInsensitiveContainsString:"); + late final _sel_localizedStandardContainsString_1 = + _registerName1("localizedStandardContainsString:"); + late final _sel_localizedStandardRangeOfString_1 = + _registerName1("localizedStandardRangeOfString:"); + NSRange _objc_msgSend_301( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer str, + ) { + return __objc_msgSend_301( + obj, + sel, + str, + ); + } + + late final __objc_msgSend_301Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_301 = __objc_msgSend_301Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_rangeOfString_1 = _registerName1("rangeOfString:"); + late final _sel_rangeOfString_options_1 = + _registerName1("rangeOfString:options:"); + NSRange _objc_msgSend_302( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchString, + int mask, + ) { + return __objc_msgSend_302( + obj, + sel, + searchString, + mask, + ); + } + + late final __objc_msgSend_302Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_302 = __objc_msgSend_302Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_rangeOfString_options_range_1 = + _registerName1("rangeOfString:options:range:"); + NSRange _objc_msgSend_303( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchString, + int mask, + NSRange rangeOfReceiverToSearch, + ) { + return __objc_msgSend_303( + obj, + sel, + searchString, + mask, + rangeOfReceiverToSearch, + ); + } + + late final __objc_msgSend_303Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_303 = __objc_msgSend_303Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange)>(); + + late final _sel_rangeOfString_options_range_locale_1 = + _registerName1("rangeOfString:options:range:locale:"); + NSRange _objc_msgSend_304( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchString, + int mask, + NSRange rangeOfReceiverToSearch, + ffi.Pointer locale, + ) { + return __objc_msgSend_304( + obj, + sel, + searchString, + mask, + rangeOfReceiverToSearch, + locale, + ); + } + + late final __objc_msgSend_304Ptr = _lookup< + ffi.NativeFunction< + NSRange Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_304 = __objc_msgSend_304Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange, ffi.Pointer)>(); + + late final _sel_rangeOfCharacterFromSet_1 = + _registerName1("rangeOfCharacterFromSet:"); + NSRange _objc_msgSend_305( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchSet, + ) { + return __objc_msgSend_305( + obj, + sel, + searchSet, + ); + } + + late final __objc_msgSend_305Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_305 = __objc_msgSend_305Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_rangeOfCharacterFromSet_options_1 = + _registerName1("rangeOfCharacterFromSet:options:"); + NSRange _objc_msgSend_306( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchSet, + int mask, + ) { + return __objc_msgSend_306( + obj, + sel, + searchSet, + mask, + ); + } + + late final __objc_msgSend_306Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_306 = __objc_msgSend_306Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_rangeOfCharacterFromSet_options_range_1 = + _registerName1("rangeOfCharacterFromSet:options:range:"); + NSRange _objc_msgSend_307( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchSet, + int mask, + NSRange rangeOfReceiverToSearch, + ) { + return __objc_msgSend_307( + obj, + sel, + searchSet, + mask, + rangeOfReceiverToSearch, + ); + } + + late final __objc_msgSend_307Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_307 = __objc_msgSend_307Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange)>(); + + late final _sel_rangeOfComposedCharacterSequenceAtIndex_1 = + _registerName1("rangeOfComposedCharacterSequenceAtIndex:"); + NSRange _objc_msgSend_308( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_308( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_308Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_308 = __objc_msgSend_308Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_rangeOfComposedCharacterSequencesForRange_1 = + _registerName1("rangeOfComposedCharacterSequencesForRange:"); + NSRange _objc_msgSend_309( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_309( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_309Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_309 = __objc_msgSend_309Ptr.asFunction< + NSRange Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_stringByAppendingString_1 = + _registerName1("stringByAppendingString:"); + late final _sel_stringByAppendingFormat_1 = + _registerName1("stringByAppendingFormat:"); + late final _sel_uppercaseString1 = _registerName1("uppercaseString"); + late final _sel_lowercaseString1 = _registerName1("lowercaseString"); + late final _sel_capitalizedString1 = _registerName1("capitalizedString"); + late final _sel_localizedUppercaseString1 = + _registerName1("localizedUppercaseString"); + late final _sel_localizedLowercaseString1 = + _registerName1("localizedLowercaseString"); + late final _sel_localizedCapitalizedString1 = + _registerName1("localizedCapitalizedString"); + late final _sel_uppercaseStringWithLocale_1 = + _registerName1("uppercaseStringWithLocale:"); + ffi.Pointer _objc_msgSend_310( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer locale, + ) { + return __objc_msgSend_310( + obj, + sel, + locale, + ); + } + + late final __objc_msgSend_310Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_310 = __objc_msgSend_310Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_lowercaseStringWithLocale_1 = + _registerName1("lowercaseStringWithLocale:"); + late final _sel_capitalizedStringWithLocale_1 = + _registerName1("capitalizedStringWithLocale:"); + late final _sel_getLineStart_end_contentsEnd_forRange_1 = + _registerName1("getLineStart:end:contentsEnd:forRange:"); + void _objc_msgSend_311( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer startPtr, + ffi.Pointer lineEndPtr, + ffi.Pointer contentsEndPtr, + NSRange range, + ) { + return __objc_msgSend_311( + obj, + sel, + startPtr, + lineEndPtr, + contentsEndPtr, + range, + ); + } + + late final __objc_msgSend_311Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_311 = __objc_msgSend_311Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSRange)>(); + + late final _sel_lineRangeForRange_1 = _registerName1("lineRangeForRange:"); + late final _sel_getParagraphStart_end_contentsEnd_forRange_1 = + _registerName1("getParagraphStart:end:contentsEnd:forRange:"); + late final _sel_paragraphRangeForRange_1 = + _registerName1("paragraphRangeForRange:"); + late final _sel_enumerateSubstringsInRange_options_usingBlock_1 = + _registerName1("enumerateSubstringsInRange:options:usingBlock:"); + void _objc_msgSend_312( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_312( + obj, + sel, + range, + opts, + block, + ); + } + + late final __objc_msgSend_312Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_312 = __objc_msgSend_312Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateLinesUsingBlock_1 = + _registerName1("enumerateLinesUsingBlock:"); + void _objc_msgSend_313( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_313( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_313Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_313 = __objc_msgSend_313Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_UTF8String1 = _registerName1("UTF8String"); + late final _sel_fastestEncoding1 = _registerName1("fastestEncoding"); + late final _sel_smallestEncoding1 = _registerName1("smallestEncoding"); + late final _sel_dataUsingEncoding_allowLossyConversion_1 = + _registerName1("dataUsingEncoding:allowLossyConversion:"); + ffi.Pointer _objc_msgSend_314( + ffi.Pointer obj, + ffi.Pointer sel, + int encoding, + bool lossy, + ) { + return __objc_msgSend_314( + obj, + sel, + encoding, + lossy, + ); + } + + late final __objc_msgSend_314Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSStringEncoding, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_314 = __objc_msgSend_314Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int, bool)>(); + + late final _sel_dataUsingEncoding_1 = _registerName1("dataUsingEncoding:"); + ffi.Pointer _objc_msgSend_315( + ffi.Pointer obj, + ffi.Pointer sel, + int encoding, + ) { + return __objc_msgSend_315( + obj, + sel, + encoding, + ); + } + + late final __objc_msgSend_315Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); + late final __objc_msgSend_315 = __objc_msgSend_315Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_canBeConvertedToEncoding_1 = + _registerName1("canBeConvertedToEncoding:"); + late final _sel_cStringUsingEncoding_1 = + _registerName1("cStringUsingEncoding:"); + late final _sel_getCString_maxLength_encoding_1 = + _registerName1("getCString:maxLength:encoding:"); + bool _objc_msgSend_316( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + int maxBufferCount, + int encoding, + ) { + return __objc_msgSend_316( + obj, + sel, + buffer, + maxBufferCount, + encoding, + ); + } + + late final __objc_msgSend_316Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSStringEncoding)>>('objc_msgSend'); + late final __objc_msgSend_316 = __objc_msgSend_316Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int)>(); + + late final _sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_1 = + _registerName1( + "getBytes:maxLength:usedLength:encoding:options:range:remainingRange:"); + bool _objc_msgSend_317( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + int maxBufferCount, + ffi.Pointer usedBufferCount, + int encoding, + int options, + NSRange range, + NSRangePointer leftover, + ) { + return __objc_msgSend_317( + obj, + sel, + buffer, + maxBufferCount, + usedBufferCount, + encoding, + options, + range, + leftover, + ); + } + + late final __objc_msgSend_317Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer, + NSStringEncoding, + ffi.Int32, + NSRange, + NSRangePointer)>>('objc_msgSend'); + late final __objc_msgSend_317 = __objc_msgSend_317Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + int, + int, + NSRange, + NSRangePointer)>(); + + late final _sel_maximumLengthOfBytesUsingEncoding_1 = + _registerName1("maximumLengthOfBytesUsingEncoding:"); + late final _sel_lengthOfBytesUsingEncoding_1 = + _registerName1("lengthOfBytesUsingEncoding:"); + late final _sel_availableStringEncodings1 = + _registerName1("availableStringEncodings"); + ffi.Pointer _objc_msgSend_318( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_318( + obj, + sel, + ); + } + + late final __objc_msgSend_318Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_318 = __objc_msgSend_318Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_localizedNameOfStringEncoding_1 = + _registerName1("localizedNameOfStringEncoding:"); + late final _sel_defaultCStringEncoding1 = + _registerName1("defaultCStringEncoding"); + late final _sel_decomposedStringWithCanonicalMapping1 = + _registerName1("decomposedStringWithCanonicalMapping"); + late final _sel_precomposedStringWithCanonicalMapping1 = + _registerName1("precomposedStringWithCanonicalMapping"); + late final _sel_decomposedStringWithCompatibilityMapping1 = + _registerName1("decomposedStringWithCompatibilityMapping"); + late final _sel_precomposedStringWithCompatibilityMapping1 = + _registerName1("precomposedStringWithCompatibilityMapping"); + late final _sel_componentsSeparatedByString_1 = + _registerName1("componentsSeparatedByString:"); + late final _sel_componentsSeparatedByCharactersInSet_1 = + _registerName1("componentsSeparatedByCharactersInSet:"); + ffi.Pointer _objc_msgSend_319( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer separator, + ) { + return __objc_msgSend_319( + obj, + sel, + separator, + ); + } + + late final __objc_msgSend_319Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_319 = __objc_msgSend_319Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_stringByTrimmingCharactersInSet_1 = + _registerName1("stringByTrimmingCharactersInSet:"); + ffi.Pointer _objc_msgSend_320( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer set1, + ) { + return __objc_msgSend_320( + obj, + sel, + set1, + ); + } + + late final __objc_msgSend_320Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_320 = __objc_msgSend_320Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_stringByPaddingToLength_withString_startingAtIndex_1 = + _registerName1("stringByPaddingToLength:withString:startingAtIndex:"); + ffi.Pointer _objc_msgSend_321( + ffi.Pointer obj, + ffi.Pointer sel, + int newLength, + ffi.Pointer padString, + int padIndex, + ) { + return __objc_msgSend_321( + obj, + sel, + newLength, + padString, + padIndex, + ); + } + + late final __objc_msgSend_321Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_321 = __objc_msgSend_321Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer, int)>(); + + late final _sel_stringByFoldingWithOptions_locale_1 = + _registerName1("stringByFoldingWithOptions:locale:"); + ffi.Pointer _objc_msgSend_322( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ffi.Pointer locale, + ) { + return __objc_msgSend_322( + obj, + sel, + options, + locale, + ); + } + + late final __objc_msgSend_322Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_322 = __objc_msgSend_322Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_stringByReplacingOccurrencesOfString_withString_options_range_1 = + _registerName1( + "stringByReplacingOccurrencesOfString:withString:options:range:"); + ffi.Pointer _objc_msgSend_323( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer target, + ffi.Pointer replacement, + int options, + NSRange searchRange, + ) { + return __objc_msgSend_323( + obj, + sel, + target, + replacement, + options, + searchRange, + ); + } + + late final __objc_msgSend_323Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_323 = __objc_msgSend_323Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + NSRange)>(); + + late final _sel_stringByReplacingOccurrencesOfString_withString_1 = + _registerName1("stringByReplacingOccurrencesOfString:withString:"); + ffi.Pointer _objc_msgSend_324( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer target, + ffi.Pointer replacement, + ) { + return __objc_msgSend_324( + obj, + sel, + target, + replacement, + ); + } + + late final __objc_msgSend_324Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_324 = __objc_msgSend_324Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_stringByReplacingCharactersInRange_withString_1 = + _registerName1("stringByReplacingCharactersInRange:withString:"); + ffi.Pointer _objc_msgSend_325( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer replacement, + ) { + return __objc_msgSend_325( + obj, + sel, + range, + replacement, + ); + } + + late final __objc_msgSend_325Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_325 = __objc_msgSend_325Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, ffi.Pointer)>(); + + late final _sel_stringByApplyingTransform_reverse_1 = + _registerName1("stringByApplyingTransform:reverse:"); + ffi.Pointer _objc_msgSend_326( + ffi.Pointer obj, + ffi.Pointer sel, + NSStringTransform transform, + bool reverse, + ) { + return __objc_msgSend_326( + obj, + sel, + transform, + reverse, + ); + } + + late final __objc_msgSend_326Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSStringTransform, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_326 = __objc_msgSend_326Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSStringTransform, bool)>(); + + late final _sel_writeToURL_atomically_encoding_error_1 = + _registerName1("writeToURL:atomically:encoding:error:"); + bool _objc_msgSend_327( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + bool useAuxiliaryFile, + int enc, + ffi.Pointer> error, + ) { + return __objc_msgSend_327( + obj, + sel, + url, + useAuxiliaryFile, + enc, + error, + ); + } + + late final __objc_msgSend_327Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + NSStringEncoding, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_327 = __objc_msgSend_327Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + int, + ffi.Pointer>)>(); + + late final _sel_writeToFile_atomically_encoding_error_1 = + _registerName1("writeToFile:atomically:encoding:error:"); + bool _objc_msgSend_328( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool useAuxiliaryFile, + int enc, + ffi.Pointer> error, + ) { + return __objc_msgSend_328( + obj, + sel, + path, + useAuxiliaryFile, + enc, + error, + ); + } + + late final __objc_msgSend_328Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + NSStringEncoding, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_328 = __objc_msgSend_328Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + int, + ffi.Pointer>)>(); + + late final _sel_hash1 = _registerName1("hash"); + late final _sel_initWithCharactersNoCopy_length_freeWhenDone_1 = + _registerName1("initWithCharactersNoCopy:length:freeWhenDone:"); + instancetype _objc_msgSend_329( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer characters, + int length, + bool freeBuffer, + ) { + return __objc_msgSend_329( + obj, + sel, + characters, + length, + freeBuffer, + ); + } + + late final __objc_msgSend_329Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_329 = __objc_msgSend_329Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, bool)>(); + + late final _sel_initWithCharactersNoCopy_length_deallocator_1 = + _registerName1("initWithCharactersNoCopy:length:deallocator:"); + instancetype _objc_msgSend_330( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer chars, + int len, + ffi.Pointer<_ObjCBlock> deallocator, + ) { + return __objc_msgSend_330( + obj, + sel, + chars, + len, + deallocator, + ); + } + + late final __objc_msgSend_330Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_330 = __objc_msgSend_330Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_initWithCharacters_length_1 = + _registerName1("initWithCharacters:length:"); + instancetype _objc_msgSend_331( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer characters, + int length, + ) { + return __objc_msgSend_331( + obj, + sel, + characters, + length, + ); + } + + late final __objc_msgSend_331Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_331 = __objc_msgSend_331Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_initWithUTF8String_1 = _registerName1("initWithUTF8String:"); + instancetype _objc_msgSend_332( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer nullTerminatedCString, + ) { + return __objc_msgSend_332( + obj, + sel, + nullTerminatedCString, + ); + } + + late final __objc_msgSend_332Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_332 = __objc_msgSend_332Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithFormat_1 = _registerName1("initWithFormat:"); + late final _sel_initWithFormat_arguments_1 = + _registerName1("initWithFormat:arguments:"); + instancetype _objc_msgSend_333( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ffi.Pointer<__va_list_tag> argList, + ) { + return __objc_msgSend_333( + obj, + sel, + format, + argList, + ); + } + + late final __objc_msgSend_333Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); + late final __objc_msgSend_333 = __objc_msgSend_333Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<__va_list_tag>)>(); + + late final _sel_initWithFormat_locale_1 = + _registerName1("initWithFormat:locale:"); + late final _sel_initWithFormat_locale_arguments_1 = + _registerName1("initWithFormat:locale:arguments:"); + instancetype _objc_msgSend_334( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ffi.Pointer locale, + ffi.Pointer<__va_list_tag> argList, + ) { + return __objc_msgSend_334( + obj, + sel, + format, + locale, + argList, + ); + } + + late final __objc_msgSend_334Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); + late final __objc_msgSend_334 = __objc_msgSend_334Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>(); + + late final _sel_initWithData_encoding_1 = + _registerName1("initWithData:encoding:"); + instancetype _objc_msgSend_335( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + int encoding, + ) { + return __objc_msgSend_335( + obj, + sel, + data, + encoding, + ); + } + + late final __objc_msgSend_335Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); + late final __objc_msgSend_335 = __objc_msgSend_335Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_initWithBytes_length_encoding_1 = + _registerName1("initWithBytes:length:encoding:"); + instancetype _objc_msgSend_336( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int len, + int encoding, + ) { + return __objc_msgSend_336( + obj, + sel, + bytes, + len, + encoding, + ); + } + + late final __objc_msgSend_336Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSStringEncoding)>>('objc_msgSend'); + late final __objc_msgSend_336 = __objc_msgSend_336Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int)>(); + + late final _sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1 = + _registerName1("initWithBytesNoCopy:length:encoding:freeWhenDone:"); + instancetype _objc_msgSend_337( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int len, + int encoding, + bool freeBuffer, + ) { + return __objc_msgSend_337( + obj, + sel, + bytes, + len, + encoding, + freeBuffer, + ); + } + + late final __objc_msgSend_337Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSStringEncoding, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_337 = __objc_msgSend_337Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, bool)>(); + + late final _sel_initWithBytesNoCopy_length_encoding_deallocator_1 = + _registerName1("initWithBytesNoCopy:length:encoding:deallocator:"); + instancetype _objc_msgSend_338( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int len, + int encoding, + ffi.Pointer<_ObjCBlock> deallocator, + ) { + return __objc_msgSend_338( + obj, + sel, + bytes, + len, + encoding, + deallocator, + ); + } + + late final __objc_msgSend_338Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSStringEncoding, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_338 = __objc_msgSend_338Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_string1 = _registerName1("string"); + late final _sel_stringWithString_1 = _registerName1("stringWithString:"); + late final _sel_stringWithCharacters_length_1 = + _registerName1("stringWithCharacters:length:"); + late final _sel_stringWithUTF8String_1 = + _registerName1("stringWithUTF8String:"); + late final _sel_stringWithFormat_1 = _registerName1("stringWithFormat:"); + late final _sel_localizedStringWithFormat_1 = + _registerName1("localizedStringWithFormat:"); + late final _sel_initWithCString_encoding_1 = + _registerName1("initWithCString:encoding:"); + instancetype _objc_msgSend_339( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer nullTerminatedCString, + int encoding, + ) { + return __objc_msgSend_339( + obj, + sel, + nullTerminatedCString, + encoding, + ); + } + + late final __objc_msgSend_339Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); + late final __objc_msgSend_339 = __objc_msgSend_339Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_stringWithCString_encoding_1 = + _registerName1("stringWithCString:encoding:"); + late final _sel_initWithContentsOfURL_encoding_error_1 = + _registerName1("initWithContentsOfURL:encoding:error:"); + instancetype _objc_msgSend_340( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int enc, + ffi.Pointer> error, + ) { + return __objc_msgSend_340( + obj, + sel, + url, + enc, + error, + ); + } + + late final __objc_msgSend_340Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSStringEncoding, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_340 = __objc_msgSend_340Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_initWithContentsOfFile_encoding_error_1 = + _registerName1("initWithContentsOfFile:encoding:error:"); + instancetype _objc_msgSend_341( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + int enc, + ffi.Pointer> error, + ) { + return __objc_msgSend_341( + obj, + sel, + path, + enc, + error, + ); + } + + late final __objc_msgSend_341Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSStringEncoding, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_341 = __objc_msgSend_341Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_stringWithContentsOfURL_encoding_error_1 = + _registerName1("stringWithContentsOfURL:encoding:error:"); + late final _sel_stringWithContentsOfFile_encoding_error_1 = + _registerName1("stringWithContentsOfFile:encoding:error:"); + late final _sel_initWithContentsOfURL_usedEncoding_error_1 = + _registerName1("initWithContentsOfURL:usedEncoding:error:"); + instancetype _objc_msgSend_342( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer enc, + ffi.Pointer> error, + ) { + return __objc_msgSend_342( + obj, + sel, + url, + enc, + error, + ); + } + + late final __objc_msgSend_342Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_342 = __objc_msgSend_342Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_initWithContentsOfFile_usedEncoding_error_1 = + _registerName1("initWithContentsOfFile:usedEncoding:error:"); + instancetype _objc_msgSend_343( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer enc, + ffi.Pointer> error, + ) { + return __objc_msgSend_343( + obj, + sel, + path, + enc, + error, + ); + } + + late final __objc_msgSend_343Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_343 = __objc_msgSend_343Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_stringWithContentsOfURL_usedEncoding_error_1 = + _registerName1("stringWithContentsOfURL:usedEncoding:error:"); + late final _sel_stringWithContentsOfFile_usedEncoding_error_1 = + _registerName1("stringWithContentsOfFile:usedEncoding:error:"); + late final _sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1 = + _registerName1( + "stringEncodingForData:encodingOptions:convertedString:usedLossyConversion:"); + int _objc_msgSend_344( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ffi.Pointer opts, + ffi.Pointer> string, + ffi.Pointer usedLossyConversion, + ) { + return __objc_msgSend_344( + obj, + sel, + data, + opts, + string, + usedLossyConversion, + ); + } + + late final __objc_msgSend_344Ptr = _lookup< + ffi.NativeFunction< + NSStringEncoding Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_344 = __objc_msgSend_344Ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer)>(); + + late final _sel_propertyList1 = _registerName1("propertyList"); + late final _sel_propertyListFromStringsFileFormat1 = + _registerName1("propertyListFromStringsFileFormat"); + late final _sel_cString1 = _registerName1("cString"); + late final _sel_lossyCString1 = _registerName1("lossyCString"); + late final _sel_cStringLength1 = _registerName1("cStringLength"); + late final _sel_getCString_1 = _registerName1("getCString:"); + late final _sel_getCString_maxLength_1 = + _registerName1("getCString:maxLength:"); + void _objc_msgSend_345( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int maxLength, + ) { + return __objc_msgSend_345( + obj, + sel, + bytes, + maxLength, + ); + } + + late final __objc_msgSend_345Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_345 = __objc_msgSend_345Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_getCString_maxLength_range_remainingRange_1 = + _registerName1("getCString:maxLength:range:remainingRange:"); + void _objc_msgSend_346( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int maxLength, + NSRange aRange, + NSRangePointer leftoverRange, + ) { + return __objc_msgSend_346( + obj, + sel, + bytes, + maxLength, + aRange, + leftoverRange, + ); + } + + late final __objc_msgSend_346Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSRange, + NSRangePointer)>>('objc_msgSend'); + late final __objc_msgSend_346 = __objc_msgSend_346Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange, NSRangePointer)>(); + + late final _sel_stringWithContentsOfFile_1 = + _registerName1("stringWithContentsOfFile:"); + late final _sel_stringWithContentsOfURL_1 = + _registerName1("stringWithContentsOfURL:"); + late final _sel_initWithCStringNoCopy_length_freeWhenDone_1 = + _registerName1("initWithCStringNoCopy:length:freeWhenDone:"); + ffi.Pointer _objc_msgSend_347( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int length, + bool freeBuffer, + ) { + return __objc_msgSend_347( + obj, + sel, + bytes, + length, + freeBuffer, + ); + } + + late final __objc_msgSend_347Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_347 = __objc_msgSend_347Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, bool)>(); + + late final _sel_initWithCString_length_1 = + _registerName1("initWithCString:length:"); + late final _sel_initWithCString_1 = _registerName1("initWithCString:"); + late final _sel_stringWithCString_length_1 = + _registerName1("stringWithCString:length:"); + late final _sel_stringWithCString_1 = _registerName1("stringWithCString:"); + late final _sel_getCharacters_1 = _registerName1("getCharacters:"); + void _objc_msgSend_348( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + ) { + return __objc_msgSend_348( + obj, + sel, + buffer, + ); + } + + late final __objc_msgSend_348Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_348 = __objc_msgSend_348Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_variantFittingPresentationWidth_1 = + _registerName1("variantFittingPresentationWidth:"); + ffi.Pointer _objc_msgSend_349( + ffi.Pointer obj, + ffi.Pointer sel, + int width, + ) { + return __objc_msgSend_349( + obj, + sel, + width, + ); + } + + late final __objc_msgSend_349Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_349 = __objc_msgSend_349Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_pathWithComponents_1 = _registerName1("pathWithComponents:"); + ffi.Pointer _objc_msgSend_350( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer components, + ) { + return __objc_msgSend_350( + obj, + sel, + components, + ); + } + + late final __objc_msgSend_350Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_350 = __objc_msgSend_350Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isAbsolutePath1 = _registerName1("isAbsolutePath"); + late final _sel_stringByDeletingLastPathComponent1 = + _registerName1("stringByDeletingLastPathComponent"); + late final _sel_stringByAppendingPathComponent_1 = + _registerName1("stringByAppendingPathComponent:"); + late final _sel_stringByDeletingPathExtension1 = + _registerName1("stringByDeletingPathExtension"); + late final _sel_stringByAppendingPathExtension_1 = + _registerName1("stringByAppendingPathExtension:"); + late final _sel_stringByAbbreviatingWithTildeInPath1 = + _registerName1("stringByAbbreviatingWithTildeInPath"); + late final _sel_stringByExpandingTildeInPath1 = + _registerName1("stringByExpandingTildeInPath"); + late final _sel_stringByStandardizingPath1 = + _registerName1("stringByStandardizingPath"); + late final _sel_stringByResolvingSymlinksInPath1 = + _registerName1("stringByResolvingSymlinksInPath"); + late final _sel_stringsByAppendingPaths_1 = + _registerName1("stringsByAppendingPaths:"); + late final _sel_completePathIntoString_caseSensitive_matchesIntoArray_filterTypes_1 = + _registerName1( + "completePathIntoString:caseSensitive:matchesIntoArray:filterTypes:"); + int _objc_msgSend_351( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> outputName, + bool flag, + ffi.Pointer> outputArray, + ffi.Pointer filterTypes, + ) { + return __objc_msgSend_351( + obj, + sel, + outputName, + flag, + outputArray, + filterTypes, + ); + } + + late final __objc_msgSend_351Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Bool, + ffi.Pointer>, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_351 = __objc_msgSend_351Ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + bool, + ffi.Pointer>, + ffi.Pointer)>(); + + late final _sel_stringByAddingPercentEncodingWithAllowedCharacters_1 = + _registerName1("stringByAddingPercentEncodingWithAllowedCharacters:"); + late final _sel_stringByRemovingPercentEncoding1 = + _registerName1("stringByRemovingPercentEncoding"); + late final _sel_stringByAddingPercentEscapesUsingEncoding_1 = + _registerName1("stringByAddingPercentEscapesUsingEncoding:"); + late final _sel_stringByReplacingPercentEscapesUsingEncoding_1 = + _registerName1("stringByReplacingPercentEscapesUsingEncoding:"); + late final _class_NSOrthography1 = _getClass1("NSOrthography"); + late final _sel_dominantScript1 = _registerName1("dominantScript"); + late final _sel_languageMap1 = _registerName1("languageMap"); + late final _sel_initWithDominantScript_languageMap_1 = + _registerName1("initWithDominantScript:languageMap:"); + instancetype _objc_msgSend_352( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer script, + ffi.Pointer map, + ) { + return __objc_msgSend_352( + obj, + sel, + script, + map, + ); + } + + late final __objc_msgSend_352Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_352 = __objc_msgSend_352Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_languagesForScript_1 = _registerName1("languagesForScript:"); + late final _sel_dominantLanguageForScript_1 = + _registerName1("dominantLanguageForScript:"); + late final _sel_dominantLanguage1 = _registerName1("dominantLanguage"); + late final _sel_allScripts1 = _registerName1("allScripts"); + late final _sel_allLanguages1 = _registerName1("allLanguages"); + late final _sel_defaultOrthographyForLanguage_1 = + _registerName1("defaultOrthographyForLanguage:"); + late final _sel_orthographyWithDominantScript_languageMap_1 = + _registerName1("orthographyWithDominantScript:languageMap:"); + late final _sel_linguisticTagsInRange_scheme_options_orthography_tokenRanges_1 = + _registerName1( + "linguisticTagsInRange:scheme:options:orthography:tokenRanges:"); + ffi.Pointer _objc_msgSend_353( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + NSLinguisticTagScheme scheme, + int options, + ffi.Pointer orthography, + ffi.Pointer> tokenRanges, + ) { + return __objc_msgSend_353( + obj, + sel, + range, + scheme, + options, + orthography, + tokenRanges, + ); + } + + late final __objc_msgSend_353Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + NSLinguisticTagScheme, + ffi.Int32, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_353 = __objc_msgSend_353Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + NSLinguisticTagScheme, + int, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_enumerateLinguisticTagsInRange_scheme_options_orthography_usingBlock_1 = + _registerName1( + "enumerateLinguisticTagsInRange:scheme:options:orthography:usingBlock:"); + void _objc_msgSend_354( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + NSLinguisticTagScheme scheme, + int options, + ffi.Pointer orthography, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_354( + obj, + sel, + range, + scheme, + options, + orthography, + block, + ); + } + + late final __objc_msgSend_354Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + NSLinguisticTagScheme, + ffi.Int32, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_354 = __objc_msgSend_354Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + NSLinguisticTagScheme, + int, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_allObjects1 = _registerName1("allObjects"); + late final _sel_anyObject1 = _registerName1("anyObject"); + late final _sel_intersectsSet_1 = _registerName1("intersectsSet:"); + bool _objc_msgSend_355( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherSet, + ) { + return __objc_msgSend_355( + obj, + sel, + otherSet, + ); + } + + late final __objc_msgSend_355Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_355 = __objc_msgSend_355Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_isEqualToSet_1 = _registerName1("isEqualToSet:"); + late final _sel_isSubsetOfSet_1 = _registerName1("isSubsetOfSet:"); + late final _sel_setByAddingObject_1 = _registerName1("setByAddingObject:"); + ffi.Pointer _objc_msgSend_356( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ) { + return __objc_msgSend_356( + obj, + sel, + anObject, + ); + } + + late final __objc_msgSend_356Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_356 = __objc_msgSend_356Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setByAddingObjectsFromSet_1 = + _registerName1("setByAddingObjectsFromSet:"); + ffi.Pointer _objc_msgSend_357( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_357( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_357Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_357 = __objc_msgSend_357Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setByAddingObjectsFromArray_1 = + _registerName1("setByAddingObjectsFromArray:"); + ffi.Pointer _objc_msgSend_358( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_358( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_358Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_358 = __objc_msgSend_358Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_359( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_359( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_359Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_359 = __objc_msgSend_359Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + void _objc_msgSend_360( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_360( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_360Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_360 = __objc_msgSend_360Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_objectsPassingTest_1 = _registerName1("objectsPassingTest:"); + ffi.Pointer _objc_msgSend_361( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_361( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_361Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_361 = __objc_msgSend_361Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_objectsWithOptions_passingTest_1 = + _registerName1("objectsWithOptions:passingTest:"); + ffi.Pointer _objc_msgSend_362( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_362( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_362Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_362 = __objc_msgSend_362Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_set1 = _registerName1("set"); + late final _sel_setWithObject_1 = _registerName1("setWithObject:"); + late final _sel_setWithObjects_count_1 = + _registerName1("setWithObjects:count:"); + late final _sel_setWithObjects_1 = _registerName1("setWithObjects:"); + late final _sel_setWithSet_1 = _registerName1("setWithSet:"); + instancetype _objc_msgSend_363( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer set1, + ) { + return __objc_msgSend_363( + obj, + sel, + set1, + ); + } + + late final __objc_msgSend_363Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_363 = __objc_msgSend_363Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setWithArray_1 = _registerName1("setWithArray:"); + late final _sel_initWithSet_1 = _registerName1("initWithSet:"); + late final _sel_initWithSet_copyItems_1 = + _registerName1("initWithSet:copyItems:"); + instancetype _objc_msgSend_364( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer set1, + bool flag, + ) { + return __objc_msgSend_364( + obj, + sel, + set1, + flag, + ); + } + + late final __objc_msgSend_364Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_364 = __objc_msgSend_364Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_filteredSetUsingPredicate_1 = + _registerName1("filteredSetUsingPredicate:"); + ffi.Pointer _objc_msgSend_365( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicate, + ) { + return __objc_msgSend_365( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_365Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_365 = __objc_msgSend_365Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_invocationWithMethodSignature_1 = + _registerName1("invocationWithMethodSignature:"); + ffi.Pointer _objc_msgSend_366( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sig, + ) { + return __objc_msgSend_366( + obj, + sel, + sig, + ); + } + + late final __objc_msgSend_366Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_366 = __objc_msgSend_366Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_methodSignature1 = _registerName1("methodSignature"); + ffi.Pointer _objc_msgSend_367( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_367( + obj, + sel, + ); + } + + late final __objc_msgSend_367Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_367 = __objc_msgSend_367Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_retainArguments1 = _registerName1("retainArguments"); + late final _sel_argumentsRetained1 = _registerName1("argumentsRetained"); + late final _sel_target1 = _registerName1("target"); + late final _sel_setTarget_1 = _registerName1("setTarget:"); + void _objc_msgSend_368( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_368( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_368Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_368 = __objc_msgSend_368Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_selector1 = _registerName1("selector"); + ffi.Pointer _objc_msgSend_369( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_369( + obj, + sel, + ); + } + + late final __objc_msgSend_369Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_369 = __objc_msgSend_369Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setSelector_1 = _registerName1("setSelector:"); + void _objc_msgSend_370( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_370( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_370Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_370 = __objc_msgSend_370Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_getReturnValue_1 = _registerName1("getReturnValue:"); + late final _sel_setReturnValue_1 = _registerName1("setReturnValue:"); + late final _sel_getArgument_atIndex_1 = + _registerName1("getArgument:atIndex:"); + void _objc_msgSend_371( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer argumentLocation, + int idx, + ) { + return __objc_msgSend_371( + obj, + sel, + argumentLocation, + idx, + ); + } + + late final __objc_msgSend_371Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_371 = __objc_msgSend_371Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_setArgument_atIndex_1 = + _registerName1("setArgument:atIndex:"); + late final _sel_invoke1 = _registerName1("invoke"); + late final _sel_invokeWithTarget_1 = _registerName1("invokeWithTarget:"); + late final _sel_forwardInvocation_1 = _registerName1("forwardInvocation:"); + void _objc_msgSend_372( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anInvocation, + ) { + return __objc_msgSend_372( + obj, + sel, + anInvocation, + ); + } + + late final __objc_msgSend_372Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_372 = __objc_msgSend_372Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_methodSignatureForSelector_1 = + _registerName1("methodSignatureForSelector:"); + ffi.Pointer _objc_msgSend_373( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_373( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_373Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_373 = __objc_msgSend_373Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_instanceMethodSignatureForSelector_1 = + _registerName1("instanceMethodSignatureForSelector:"); + late final _sel_allowsWeakReference1 = _registerName1("allowsWeakReference"); + late final _sel_retainWeakReference1 = _registerName1("retainWeakReference"); + late final _sel_isSubclassOfClass_1 = _registerName1("isSubclassOfClass:"); + late final _sel_resolveClassMethod_1 = _registerName1("resolveClassMethod:"); + late final _sel_resolveInstanceMethod_1 = + _registerName1("resolveInstanceMethod:"); + late final _sel_superclass1 = _registerName1("superclass"); + late final _sel_class1 = _registerName1("class"); + late final _sel_debugDescription1 = _registerName1("debugDescription"); + late final _sel_version1 = _registerName1("version"); + late final _sel_setVersion_1 = _registerName1("setVersion:"); + void _objc_msgSend_374( + ffi.Pointer obj, + ffi.Pointer sel, + int aVersion, + ) { + return __objc_msgSend_374( + obj, + sel, + aVersion, + ); + } + + late final __objc_msgSend_374Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_374 = __objc_msgSend_374Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_classForCoder1 = _registerName1("classForCoder"); + late final _sel_replacementObjectForCoder_1 = + _registerName1("replacementObjectForCoder:"); + late final _sel_awakeAfterUsingCoder_1 = + _registerName1("awakeAfterUsingCoder:"); + late final _sel_poseAsClass_1 = _registerName1("poseAsClass:"); + late final _sel_autoContentAccessingProxy1 = + _registerName1("autoContentAccessingProxy"); + late final _sel_attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_1 = + _registerName1( + "attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo:"); + void _objc_msgSend_375( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer error, + int recoveryOptionIndex, + ffi.Pointer delegate, + ffi.Pointer didRecoverSelector, + ffi.Pointer contextInfo, + ) { + return __objc_msgSend_375( + obj, + sel, + error, + recoveryOptionIndex, + delegate, + didRecoverSelector, + contextInfo, + ); + } + + late final __objc_msgSend_375Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_375 = __objc_msgSend_375Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_attemptRecoveryFromError_optionIndex_1 = + _registerName1("attemptRecoveryFromError:optionIndex:"); + bool _objc_msgSend_376( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer error, + int recoveryOptionIndex, + ) { + return __objc_msgSend_376( + obj, + sel, + error, + recoveryOptionIndex, + ); + } + + late final __objc_msgSend_376Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_376 = __objc_msgSend_376Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_performSelector_withObject_afterDelay_inModes_1 = + _registerName1("performSelector:withObject:afterDelay:inModes:"); + void _objc_msgSend_377( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer anArgument, + double delay, + ffi.Pointer modes, + ) { + return __objc_msgSend_377( + obj, + sel, + aSelector, + anArgument, + delay, + modes, + ); + } + + late final __objc_msgSend_377Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSTimeInterval, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_377 = __objc_msgSend_377Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + double, + ffi.Pointer)>(); + + late final _sel_performSelector_withObject_afterDelay_1 = + _registerName1("performSelector:withObject:afterDelay:"); + void _objc_msgSend_378( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer anArgument, + double delay, + ) { + return __objc_msgSend_378( + obj, + sel, + aSelector, + anArgument, + delay, + ); + } + + late final __objc_msgSend_378Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSTimeInterval)>>('objc_msgSend'); + late final __objc_msgSend_378 = __objc_msgSend_378Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_URL_resourceDataDidBecomeAvailable_1 = + _registerName1("URL:resourceDataDidBecomeAvailable:"); + void _objc_msgSend_379( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sender, + ffi.Pointer newBytes, + ) { + return __objc_msgSend_379( + obj, + sel, + sender, + newBytes, + ); + } + + late final __objc_msgSend_379Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_379 = __objc_msgSend_379Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_URLResourceDidFinishLoading_1 = + _registerName1("URLResourceDidFinishLoading:"); + void _objc_msgSend_380( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sender, + ) { + return __objc_msgSend_380( + obj, + sel, + sender, + ); + } + + late final __objc_msgSend_380Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_380 = __objc_msgSend_380Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLResourceDidCancelLoading_1 = + _registerName1("URLResourceDidCancelLoading:"); + late final _sel_URL_resourceDidFailLoadingWithReason_1 = + _registerName1("URL:resourceDidFailLoadingWithReason:"); + void _objc_msgSend_381( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sender, + ffi.Pointer reason, + ) { + return __objc_msgSend_381( + obj, + sel, + sender, + reason, + ); + } + + late final __objc_msgSend_381Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_381 = __objc_msgSend_381Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSFileManager1 = _getClass1("NSFileManager"); + late final _sel_defaultManager1 = _registerName1("defaultManager"); + ffi.Pointer _objc_msgSend_382( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_382( + obj, + sel, + ); + } + + late final __objc_msgSend_382Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_382 = __objc_msgSend_382Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_mountedVolumeURLsIncludingResourceValuesForKeys_options_1 = + _registerName1( + "mountedVolumeURLsIncludingResourceValuesForKeys:options:"); + ffi.Pointer _objc_msgSend_383( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer propertyKeys, + int options, + ) { + return __objc_msgSend_383( + obj, + sel, + propertyKeys, + options, + ); + } + + late final __objc_msgSend_383Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_383 = __objc_msgSend_383Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_unmountVolumeAtURL_options_completionHandler_1 = + _registerName1("unmountVolumeAtURL:options:completionHandler:"); + void _objc_msgSend_384( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int mask, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_384( + obj, + sel, + url, + mask, + completionHandler, + ); + } + + late final __objc_msgSend_384Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_384 = __objc_msgSend_384Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_1 = + _registerName1( + "contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error:"); + ffi.Pointer _objc_msgSend_385( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer keys, + int mask, + ffi.Pointer> error, + ) { + return __objc_msgSend_385( + obj, + sel, + url, + keys, + mask, + error, + ); + } + + late final __objc_msgSend_385Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_385 = __objc_msgSend_385Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_URLsForDirectory_inDomains_1 = + _registerName1("URLsForDirectory:inDomains:"); + ffi.Pointer _objc_msgSend_386( + ffi.Pointer obj, + ffi.Pointer sel, + int directory, + int domainMask, + ) { + return __objc_msgSend_386( + obj, + sel, + directory, + domainMask, + ); + } + + late final __objc_msgSend_386Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_386 = __objc_msgSend_386Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int, int)>(); + + late final _sel_URLForDirectory_inDomain_appropriateForURL_create_error_1 = + _registerName1( + "URLForDirectory:inDomain:appropriateForURL:create:error:"); + ffi.Pointer _objc_msgSend_387( + ffi.Pointer obj, + ffi.Pointer sel, + int directory, + int domain, + ffi.Pointer url, + bool shouldCreate, + ffi.Pointer> error, + ) { + return __objc_msgSend_387( + obj, + sel, + directory, + domain, + url, + shouldCreate, + error, + ); + } + + late final __objc_msgSend_387Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer, + ffi.Bool, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_387 = __objc_msgSend_387Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer, + bool, + ffi.Pointer>)>(); + + late final _sel_getRelationship_ofDirectoryAtURL_toItemAtURL_error_1 = + _registerName1("getRelationship:ofDirectoryAtURL:toItemAtURL:error:"); + bool _objc_msgSend_388( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer outRelationship, + ffi.Pointer directoryURL, + ffi.Pointer otherURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_388( + obj, + sel, + outRelationship, + directoryURL, + otherURL, + error, + ); + } + + late final __objc_msgSend_388Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_388 = __objc_msgSend_388Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_getRelationship_ofDirectory_inDomain_toItemAtURL_error_1 = + _registerName1("getRelationship:ofDirectory:inDomain:toItemAtURL:error:"); + bool _objc_msgSend_389( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer outRelationship, + int directory, + int domainMask, + ffi.Pointer url, + ffi.Pointer> error, + ) { + return __objc_msgSend_389( + obj, + sel, + outRelationship, + directory, + domainMask, + url, + error, + ); + } + + late final __objc_msgSend_389Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_389 = __objc_msgSend_389Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_createDirectoryAtURL_withIntermediateDirectories_attributes_error_1 = + _registerName1( + "createDirectoryAtURL:withIntermediateDirectories:attributes:error:"); + bool _objc_msgSend_390( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + bool createIntermediates, + ffi.Pointer attributes, + ffi.Pointer> error, + ) { + return __objc_msgSend_390( + obj, + sel, + url, + createIntermediates, + attributes, + error, + ); + } + + late final __objc_msgSend_390Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_390 = __objc_msgSend_390Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_createSymbolicLinkAtURL_withDestinationURL_error_1 = + _registerName1("createSymbolicLinkAtURL:withDestinationURL:error:"); + bool _objc_msgSend_391( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer destURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_391( + obj, + sel, + url, + destURL, + error, + ); + } + + late final __objc_msgSend_391Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_391 = __objc_msgSend_391Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_delegate1 = _registerName1("delegate"); + late final _sel_setDelegate_1 = _registerName1("setDelegate:"); + late final _sel_setAttributes_ofItemAtPath_error_1 = + _registerName1("setAttributes:ofItemAtPath:error:"); + bool _objc_msgSend_392( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attributes, + ffi.Pointer path, + ffi.Pointer> error, + ) { + return __objc_msgSend_392( + obj, + sel, + attributes, + path, + error, + ); + } + + late final __objc_msgSend_392Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_392 = __objc_msgSend_392Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_createDirectoryAtPath_withIntermediateDirectories_attributes_error_1 = + _registerName1( + "createDirectoryAtPath:withIntermediateDirectories:attributes:error:"); + bool _objc_msgSend_393( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool createIntermediates, + ffi.Pointer attributes, + ffi.Pointer> error, + ) { + return __objc_msgSend_393( + obj, + sel, + path, + createIntermediates, + attributes, + error, + ); + } + + late final __objc_msgSend_393Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_393 = __objc_msgSend_393Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_contentsOfDirectoryAtPath_error_1 = + _registerName1("contentsOfDirectoryAtPath:error:"); + ffi.Pointer _objc_msgSend_394( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer> error, + ) { + return __objc_msgSend_394( + obj, + sel, + path, + error, + ); + } + + late final __objc_msgSend_394Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_394 = __objc_msgSend_394Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_subpathsOfDirectoryAtPath_error_1 = + _registerName1("subpathsOfDirectoryAtPath:error:"); + late final _sel_attributesOfItemAtPath_error_1 = + _registerName1("attributesOfItemAtPath:error:"); + ffi.Pointer _objc_msgSend_395( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer> error, + ) { + return __objc_msgSend_395( + obj, + sel, + path, + error, + ); + } + + late final __objc_msgSend_395Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_395 = __objc_msgSend_395Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_attributesOfFileSystemForPath_error_1 = + _registerName1("attributesOfFileSystemForPath:error:"); + late final _sel_createSymbolicLinkAtPath_withDestinationPath_error_1 = + _registerName1("createSymbolicLinkAtPath:withDestinationPath:error:"); + bool _objc_msgSend_396( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer destPath, + ffi.Pointer> error, + ) { + return __objc_msgSend_396( + obj, + sel, + path, + destPath, + error, + ); + } + + late final __objc_msgSend_396Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_396 = __objc_msgSend_396Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_destinationOfSymbolicLinkAtPath_error_1 = + _registerName1("destinationOfSymbolicLinkAtPath:error:"); + ffi.Pointer _objc_msgSend_397( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer> error, + ) { + return __objc_msgSend_397( + obj, + sel, + path, + error, + ); + } + + late final __objc_msgSend_397Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_397 = __objc_msgSend_397Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_copyItemAtPath_toPath_error_1 = + _registerName1("copyItemAtPath:toPath:error:"); + late final _sel_moveItemAtPath_toPath_error_1 = + _registerName1("moveItemAtPath:toPath:error:"); + late final _sel_linkItemAtPath_toPath_error_1 = + _registerName1("linkItemAtPath:toPath:error:"); + late final _sel_removeItemAtPath_error_1 = + _registerName1("removeItemAtPath:error:"); + bool _objc_msgSend_398( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer> error, + ) { + return __objc_msgSend_398( + obj, + sel, + path, + error, + ); + } + + late final __objc_msgSend_398Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_398 = __objc_msgSend_398Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_copyItemAtURL_toURL_error_1 = + _registerName1("copyItemAtURL:toURL:error:"); + late final _sel_moveItemAtURL_toURL_error_1 = + _registerName1("moveItemAtURL:toURL:error:"); + late final _sel_linkItemAtURL_toURL_error_1 = + _registerName1("linkItemAtURL:toURL:error:"); + late final _sel_removeItemAtURL_error_1 = + _registerName1("removeItemAtURL:error:"); + late final _sel_trashItemAtURL_resultingItemURL_error_1 = + _registerName1("trashItemAtURL:resultingItemURL:error:"); + bool _objc_msgSend_399( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer> outResultingURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_399( + obj, + sel, + url, + outResultingURL, + error, + ); + } + + late final __objc_msgSend_399Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_399 = __objc_msgSend_399Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_fileAttributesAtPath_traverseLink_1 = + _registerName1("fileAttributesAtPath:traverseLink:"); + ffi.Pointer _objc_msgSend_400( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool yorn, + ) { + return __objc_msgSend_400( + obj, + sel, + path, + yorn, + ); + } + + late final __objc_msgSend_400Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_400 = __objc_msgSend_400Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_changeFileAttributes_atPath_1 = + _registerName1("changeFileAttributes:atPath:"); + bool _objc_msgSend_401( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attributes, + ffi.Pointer path, + ) { + return __objc_msgSend_401( + obj, + sel, + attributes, + path, + ); + } + + late final __objc_msgSend_401Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_401 = __objc_msgSend_401Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_directoryContentsAtPath_1 = + _registerName1("directoryContentsAtPath:"); + late final _sel_fileSystemAttributesAtPath_1 = + _registerName1("fileSystemAttributesAtPath:"); + late final _sel_pathContentOfSymbolicLinkAtPath_1 = + _registerName1("pathContentOfSymbolicLinkAtPath:"); + late final _sel_createSymbolicLinkAtPath_pathContent_1 = + _registerName1("createSymbolicLinkAtPath:pathContent:"); + bool _objc_msgSend_402( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer otherpath, + ) { + return __objc_msgSend_402( + obj, + sel, + path, + otherpath, + ); + } + + late final __objc_msgSend_402Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_402 = __objc_msgSend_402Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_createDirectoryAtPath_attributes_1 = + _registerName1("createDirectoryAtPath:attributes:"); + bool _objc_msgSend_403( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer attributes, + ) { + return __objc_msgSend_403( + obj, + sel, + path, + attributes, + ); + } + + late final __objc_msgSend_403Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_403 = __objc_msgSend_403Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_linkPath_toPath_handler_1 = + _registerName1("linkPath:toPath:handler:"); + bool _objc_msgSend_404( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer src, + ffi.Pointer dest, + ffi.Pointer handler, + ) { + return __objc_msgSend_404( + obj, + sel, + src, + dest, + handler, + ); + } + + late final __objc_msgSend_404Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_404 = __objc_msgSend_404Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_copyPath_toPath_handler_1 = + _registerName1("copyPath:toPath:handler:"); + late final _sel_movePath_toPath_handler_1 = + _registerName1("movePath:toPath:handler:"); + late final _sel_removeFileAtPath_handler_1 = + _registerName1("removeFileAtPath:handler:"); + bool _objc_msgSend_405( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer handler, + ) { + return __objc_msgSend_405( + obj, + sel, + path, + handler, + ); + } + + late final __objc_msgSend_405Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_405 = __objc_msgSend_405Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_currentDirectoryPath1 = + _registerName1("currentDirectoryPath"); + late final _sel_changeCurrentDirectoryPath_1 = + _registerName1("changeCurrentDirectoryPath:"); + late final _sel_fileExistsAtPath_1 = _registerName1("fileExistsAtPath:"); + late final _sel_fileExistsAtPath_isDirectory_1 = + _registerName1("fileExistsAtPath:isDirectory:"); + bool _objc_msgSend_406( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer isDirectory, + ) { + return __objc_msgSend_406( + obj, + sel, + path, + isDirectory, + ); + } + + late final __objc_msgSend_406Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_406 = __objc_msgSend_406Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isReadableFileAtPath_1 = + _registerName1("isReadableFileAtPath:"); + late final _sel_isWritableFileAtPath_1 = + _registerName1("isWritableFileAtPath:"); + late final _sel_isExecutableFileAtPath_1 = + _registerName1("isExecutableFileAtPath:"); + late final _sel_isDeletableFileAtPath_1 = + _registerName1("isDeletableFileAtPath:"); + late final _sel_contentsEqualAtPath_andPath_1 = + _registerName1("contentsEqualAtPath:andPath:"); + late final _sel_displayNameAtPath_1 = _registerName1("displayNameAtPath:"); + late final _sel_componentsToDisplayForPath_1 = + _registerName1("componentsToDisplayForPath:"); + late final _sel_homeDirectoryForCurrentUser1 = + _registerName1("homeDirectoryForCurrentUser"); + late final _sel_temporaryDirectory1 = _registerName1("temporaryDirectory"); + late final _sel_homeDirectoryForUser_1 = + _registerName1("homeDirectoryForUser:"); + late final _sel_fileManager_shouldProceedAfterError_1 = + _registerName1("fileManager:shouldProceedAfterError:"); + bool _objc_msgSend_407( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer fm, + ffi.Pointer errorInfo, + ) { + return __objc_msgSend_407( + obj, + sel, + fm, + errorInfo, + ); + } + + late final __objc_msgSend_407Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_407 = __objc_msgSend_407Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_fileManager_willProcessPath_1 = + _registerName1("fileManager:willProcessPath:"); + void _objc_msgSend_408( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer fm, + ffi.Pointer path, + ) { + return __objc_msgSend_408( + obj, + sel, + fm, + path, + ); + } + + late final __objc_msgSend_408Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_408 = __objc_msgSend_408Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_validateValue_forKey_error_1 = + _registerName1("validateValue:forKey:error:"); + late final _class_NSMutableArray1 = _getClass1("NSMutableArray"); + late final _sel_addObject_1 = _registerName1("addObject:"); + late final _sel_insertObject_atIndex_1 = + _registerName1("insertObject:atIndex:"); + void _objc_msgSend_409( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + int index, + ) { + return __objc_msgSend_409( + obj, + sel, + anObject, + index, + ); + } + + late final __objc_msgSend_409Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_409 = __objc_msgSend_409Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_removeLastObject1 = _registerName1("removeLastObject"); + late final _sel_removeObjectAtIndex_1 = + _registerName1("removeObjectAtIndex:"); + void _objc_msgSend_410( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_410( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_410Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_410 = __objc_msgSend_410Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_replaceObjectAtIndex_withObject_1 = + _registerName1("replaceObjectAtIndex:withObject:"); + void _objc_msgSend_411( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer anObject, + ) { + return __objc_msgSend_411( + obj, + sel, + index, + anObject, + ); + } + + late final __objc_msgSend_411Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_411 = __objc_msgSend_411Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_initWithCapacity_1 = _registerName1("initWithCapacity:"); + late final _sel_addObjectsFromArray_1 = + _registerName1("addObjectsFromArray:"); + void _objc_msgSend_412( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherArray, + ) { + return __objc_msgSend_412( + obj, + sel, + otherArray, + ); + } + + late final __objc_msgSend_412Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_412 = __objc_msgSend_412Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_exchangeObjectAtIndex_withObjectAtIndex_1 = + _registerName1("exchangeObjectAtIndex:withObjectAtIndex:"); + void _objc_msgSend_413( + ffi.Pointer obj, + ffi.Pointer sel, + int idx1, + int idx2, + ) { + return __objc_msgSend_413( + obj, + sel, + idx1, + idx2, + ); + } + + late final __objc_msgSend_413Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_413 = __objc_msgSend_413Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, int)>(); + + late final _sel_removeAllObjects1 = _registerName1("removeAllObjects"); + late final _sel_removeObject_inRange_1 = + _registerName1("removeObject:inRange:"); + void _objc_msgSend_414( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + NSRange range, + ) { + return __objc_msgSend_414( + obj, + sel, + anObject, + range, + ); + } + + late final __objc_msgSend_414Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_414 = __objc_msgSend_414Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>(); + + late final _sel_removeObject_1 = _registerName1("removeObject:"); + late final _sel_removeObjectIdenticalTo_inRange_1 = + _registerName1("removeObjectIdenticalTo:inRange:"); + late final _sel_removeObjectIdenticalTo_1 = + _registerName1("removeObjectIdenticalTo:"); + late final _sel_removeObjectsFromIndices_numIndices_1 = + _registerName1("removeObjectsFromIndices:numIndices:"); + void _objc_msgSend_415( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indices, + int cnt, + ) { + return __objc_msgSend_415( + obj, + sel, + indices, + cnt, + ); + } + + late final __objc_msgSend_415Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_415 = __objc_msgSend_415Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_removeObjectsInArray_1 = + _registerName1("removeObjectsInArray:"); + late final _sel_removeObjectsInRange_1 = + _registerName1("removeObjectsInRange:"); + void _objc_msgSend_416( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_416( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_416Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_416 = __objc_msgSend_416Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_replaceObjectsInRange_withObjectsFromArray_range_1 = + _registerName1("replaceObjectsInRange:withObjectsFromArray:range:"); + void _objc_msgSend_417( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer otherArray, + NSRange otherRange, + ) { + return __objc_msgSend_417( + obj, + sel, + range, + otherArray, + otherRange, + ); + } + + late final __objc_msgSend_417Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_417 = __objc_msgSend_417Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, + ffi.Pointer, NSRange)>(); + + late final _sel_replaceObjectsInRange_withObjectsFromArray_1 = + _registerName1("replaceObjectsInRange:withObjectsFromArray:"); + void _objc_msgSend_418( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer otherArray, + ) { + return __objc_msgSend_418( + obj, + sel, + range, + otherArray, + ); + } + + late final __objc_msgSend_418Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_418 = __objc_msgSend_418Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, + ffi.Pointer)>(); + + late final _sel_setArray_1 = _registerName1("setArray:"); + late final _sel_sortUsingFunction_context_1 = + _registerName1("sortUsingFunction:context:"); + void _objc_msgSend_419( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + compare, + ffi.Pointer context, + ) { + return __objc_msgSend_419( + obj, + sel, + compare, + context, + ); + } + + late final __objc_msgSend_419Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_419 = __objc_msgSend_419Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>(); + + late final _sel_sortUsingSelector_1 = _registerName1("sortUsingSelector:"); + late final _sel_insertObjects_atIndexes_1 = + _registerName1("insertObjects:atIndexes:"); + void _objc_msgSend_420( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer objects, + ffi.Pointer indexes, + ) { + return __objc_msgSend_420( + obj, + sel, + objects, + indexes, + ); + } + + late final __objc_msgSend_420Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_420 = __objc_msgSend_420Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_removeObjectsAtIndexes_1 = + _registerName1("removeObjectsAtIndexes:"); + void _objc_msgSend_421( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexes, + ) { + return __objc_msgSend_421( + obj, + sel, + indexes, + ); + } + + late final __objc_msgSend_421Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_421 = __objc_msgSend_421Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_replaceObjectsAtIndexes_withObjects_1 = + _registerName1("replaceObjectsAtIndexes:withObjects:"); + void _objc_msgSend_422( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexes, + ffi.Pointer objects, + ) { + return __objc_msgSend_422( + obj, + sel, + indexes, + objects, + ); + } + + late final __objc_msgSend_422Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_422 = __objc_msgSend_422Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setObject_atIndexedSubscript_1 = + _registerName1("setObject:atIndexedSubscript:"); + late final _sel_sortUsingComparator_1 = + _registerName1("sortUsingComparator:"); + void _objc_msgSend_423( + ffi.Pointer obj, + ffi.Pointer sel, + NSComparator cmptr, + ) { + return __objc_msgSend_423( + obj, + sel, + cmptr, + ); + } + + late final __objc_msgSend_423Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSComparator)>>('objc_msgSend'); + late final __objc_msgSend_423 = __objc_msgSend_423Ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, NSComparator)>(); + + late final _sel_sortWithOptions_usingComparator_1 = + _registerName1("sortWithOptions:usingComparator:"); + void _objc_msgSend_424( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + NSComparator cmptr, + ) { + return __objc_msgSend_424( + obj, + sel, + opts, + cmptr, + ); + } + + late final __objc_msgSend_424Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, NSComparator)>>('objc_msgSend'); + late final __objc_msgSend_424 = __objc_msgSend_424Ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, int, NSComparator)>(); + + late final _sel_arrayWithCapacity_1 = _registerName1("arrayWithCapacity:"); + ffi.Pointer _objc_msgSend_425( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ) { + return __objc_msgSend_425( + obj, + sel, + path, + ); + } + + late final __objc_msgSend_425Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_425 = __objc_msgSend_425Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_426( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ) { + return __objc_msgSend_426( + obj, + sel, + url, + ); + } + + late final __objc_msgSend_426Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_426 = __objc_msgSend_426Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_applyDifference_1 = _registerName1("applyDifference:"); + late final _sel_sortUsingDescriptors_1 = + _registerName1("sortUsingDescriptors:"); + late final _sel_filterUsingPredicate_1 = + _registerName1("filterUsingPredicate:"); + void _objc_msgSend_427( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicate, + ) { + return __objc_msgSend_427( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_427Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_427 = __objc_msgSend_427Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_mutableArrayValueForKey_1 = + _registerName1("mutableArrayValueForKey:"); + late final _class_NSMutableOrderedSet1 = _getClass1("NSMutableOrderedSet"); + late final _class_NSOrderedSet1 = _getClass1("NSOrderedSet"); + late final _sel_isEqualToOrderedSet_1 = + _registerName1("isEqualToOrderedSet:"); + bool _objc_msgSend_428( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_428( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_428Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_428 = __objc_msgSend_428Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_intersectsOrderedSet_1 = + _registerName1("intersectsOrderedSet:"); + late final _sel_isSubsetOfOrderedSet_1 = + _registerName1("isSubsetOfOrderedSet:"); + late final _sel_reversedOrderedSet1 = _registerName1("reversedOrderedSet"); + ffi.Pointer _objc_msgSend_429( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_429( + obj, + sel, + ); + } + + late final __objc_msgSend_429Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_429 = __objc_msgSend_429Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_orderedSet1 = _registerName1("orderedSet"); + late final _sel_orderedSetWithObject_1 = + _registerName1("orderedSetWithObject:"); + late final _sel_orderedSetWithObjects_count_1 = + _registerName1("orderedSetWithObjects:count:"); + late final _sel_orderedSetWithObjects_1 = + _registerName1("orderedSetWithObjects:"); + late final _sel_orderedSetWithOrderedSet_1 = + _registerName1("orderedSetWithOrderedSet:"); + instancetype _objc_msgSend_430( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer set1, + ) { + return __objc_msgSend_430( + obj, + sel, + set1, + ); + } + + late final __objc_msgSend_430Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_430 = __objc_msgSend_430Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_orderedSetWithOrderedSet_range_copyItems_1 = + _registerName1("orderedSetWithOrderedSet:range:copyItems:"); + instancetype _objc_msgSend_431( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer set1, + NSRange range, + bool flag, + ) { + return __objc_msgSend_431( + obj, + sel, + set1, + range, + flag, + ); + } + + late final __objc_msgSend_431Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_431 = __objc_msgSend_431Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange, bool)>(); + + late final _sel_orderedSetWithArray_1 = + _registerName1("orderedSetWithArray:"); + late final _sel_orderedSetWithArray_range_copyItems_1 = + _registerName1("orderedSetWithArray:range:copyItems:"); + instancetype _objc_msgSend_432( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer array, + NSRange range, + bool flag, + ) { + return __objc_msgSend_432( + obj, + sel, + array, + range, + flag, + ); + } + + late final __objc_msgSend_432Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_432 = __objc_msgSend_432Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange, bool)>(); + + late final _sel_orderedSetWithSet_1 = _registerName1("orderedSetWithSet:"); + late final _sel_orderedSetWithSet_copyItems_1 = + _registerName1("orderedSetWithSet:copyItems:"); + late final _sel_initWithObject_1 = _registerName1("initWithObject:"); + late final _sel_initWithOrderedSet_1 = _registerName1("initWithOrderedSet:"); + late final _sel_initWithOrderedSet_copyItems_1 = + _registerName1("initWithOrderedSet:copyItems:"); + instancetype _objc_msgSend_433( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer set1, + bool flag, + ) { + return __objc_msgSend_433( + obj, + sel, + set1, + flag, + ); + } + + late final __objc_msgSend_433Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_433 = __objc_msgSend_433Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_initWithOrderedSet_range_copyItems_1 = + _registerName1("initWithOrderedSet:range:copyItems:"); + late final _sel_initWithArray_range_copyItems_1 = + _registerName1("initWithArray:range:copyItems:"); + late final _sel_filteredOrderedSetUsingPredicate_1 = + _registerName1("filteredOrderedSetUsingPredicate:"); + ffi.Pointer _objc_msgSend_434( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer p, + ) { + return __objc_msgSend_434( + obj, + sel, + p, + ); + } + + late final __objc_msgSend_434Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_434 = __objc_msgSend_434Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_addObjects_count_1 = _registerName1("addObjects:count:"); + void _objc_msgSend_435( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + int count, + ) { + return __objc_msgSend_435( + obj, + sel, + objects, + count, + ); + } + + late final __objc_msgSend_435Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_435 = __objc_msgSend_435Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, int)>(); + + late final _sel_moveObjectsAtIndexes_toIndex_1 = + _registerName1("moveObjectsAtIndexes:toIndex:"); + void _objc_msgSend_436( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexes, + int idx, + ) { + return __objc_msgSend_436( + obj, + sel, + indexes, + idx, + ); + } + + late final __objc_msgSend_436Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_436 = __objc_msgSend_436Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_setObject_atIndex_1 = _registerName1("setObject:atIndex:"); + late final _sel_replaceObjectsInRange_withObjects_count_1 = + _registerName1("replaceObjectsInRange:withObjects:count:"); + void _objc_msgSend_437( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer> objects, + int count, + ) { + return __objc_msgSend_437( + obj, + sel, + range, + objects, + count, + ); + } + + late final __objc_msgSend_437Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer>, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_437 = __objc_msgSend_437Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, + ffi.Pointer>, int)>(); + + late final _sel_intersectOrderedSet_1 = + _registerName1("intersectOrderedSet:"); + void _objc_msgSend_438( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_438( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_438Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_438 = __objc_msgSend_438Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_minusOrderedSet_1 = _registerName1("minusOrderedSet:"); + late final _sel_unionOrderedSet_1 = _registerName1("unionOrderedSet:"); + late final _sel_intersectSet_1 = _registerName1("intersectSet:"); + void _objc_msgSend_439( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_439( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_439Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_439 = __objc_msgSend_439Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_minusSet_1 = _registerName1("minusSet:"); + late final _sel_unionSet_1 = _registerName1("unionSet:"); + late final _sel_sortRange_options_usingComparator_1 = + _registerName1("sortRange:options:usingComparator:"); + void _objc_msgSend_440( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + NSComparator cmptr, + ) { + return __objc_msgSend_440( + obj, + sel, + range, + opts, + cmptr, + ); + } + + late final __objc_msgSend_440Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, NSComparator)>>('objc_msgSend'); + late final __objc_msgSend_440 = __objc_msgSend_440Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, int, + NSComparator)>(); + + late final _sel_orderedSetWithCapacity_1 = + _registerName1("orderedSetWithCapacity:"); + late final _sel_mutableOrderedSetValueForKey_1 = + _registerName1("mutableOrderedSetValueForKey:"); + ffi.Pointer _objc_msgSend_441( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_441( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_441Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_441 = __objc_msgSend_441Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSMutableSet1 = _getClass1("NSMutableSet"); + late final _sel_setSet_1 = _registerName1("setSet:"); + late final _sel_setWithCapacity_1 = _registerName1("setWithCapacity:"); + late final _sel_mutableSetValueForKey_1 = + _registerName1("mutableSetValueForKey:"); + ffi.Pointer _objc_msgSend_442( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_442( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_442Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_442 = __objc_msgSend_442Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_valueForKeyPath_1 = _registerName1("valueForKeyPath:"); + late final _sel_setValue_forKeyPath_1 = + _registerName1("setValue:forKeyPath:"); + late final _sel_validateValue_forKeyPath_error_1 = + _registerName1("validateValue:forKeyPath:error:"); + late final _sel_mutableArrayValueForKeyPath_1 = + _registerName1("mutableArrayValueForKeyPath:"); + late final _sel_mutableOrderedSetValueForKeyPath_1 = + _registerName1("mutableOrderedSetValueForKeyPath:"); + late final _sel_mutableSetValueForKeyPath_1 = + _registerName1("mutableSetValueForKeyPath:"); + late final _sel_valueForUndefinedKey_1 = + _registerName1("valueForUndefinedKey:"); + late final _sel_setValue_forUndefinedKey_1 = + _registerName1("setValue:forUndefinedKey:"); + late final _sel_setNilValueForKey_1 = _registerName1("setNilValueForKey:"); + late final _sel_dictionaryWithValuesForKeys_1 = + _registerName1("dictionaryWithValuesForKeys:"); + ffi.Pointer _objc_msgSend_443( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keys, + ) { + return __objc_msgSend_443( + obj, + sel, + keys, + ); + } + + late final __objc_msgSend_443Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_443 = __objc_msgSend_443Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setValuesForKeysWithDictionary_1 = + _registerName1("setValuesForKeysWithDictionary:"); + void _objc_msgSend_444( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keyedValues, + ) { + return __objc_msgSend_444( + obj, + sel, + keyedValues, + ); + } + + late final __objc_msgSend_444Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_444 = __objc_msgSend_444Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_storedValueForKey_1 = _registerName1("storedValueForKey:"); + late final _sel_takeStoredValue_forKey_1 = + _registerName1("takeStoredValue:forKey:"); + late final _sel_takeValue_forKey_1 = _registerName1("takeValue:forKey:"); + late final _sel_takeValue_forKeyPath_1 = + _registerName1("takeValue:forKeyPath:"); + late final _sel_handleQueryWithUnboundKey_1 = + _registerName1("handleQueryWithUnboundKey:"); + late final _sel_handleTakeValue_forUnboundKey_1 = + _registerName1("handleTakeValue:forUnboundKey:"); + late final _sel_unableToSetNilForKey_1 = + _registerName1("unableToSetNilForKey:"); + late final _sel_valuesForKeys_1 = _registerName1("valuesForKeys:"); + late final _sel_takeValuesFromDictionary_1 = + _registerName1("takeValuesFromDictionary:"); + late final _sel_observeValueForKeyPath_ofObject_change_context_1 = + _registerName1("observeValueForKeyPath:ofObject:change:context:"); + void _objc_msgSend_445( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keyPath, + ffi.Pointer object, + ffi.Pointer change, + ffi.Pointer context, + ) { + return __objc_msgSend_445( + obj, + sel, + keyPath, + object, + change, + context, + ); + } + + late final __objc_msgSend_445Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_445 = __objc_msgSend_445Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_willChangeValueForKey_1 = + _registerName1("willChangeValueForKey:"); + late final _sel_didChangeValueForKey_1 = + _registerName1("didChangeValueForKey:"); + late final _sel_willChange_valuesAtIndexes_forKey_1 = + _registerName1("willChange:valuesAtIndexes:forKey:"); + void _objc_msgSend_446( + ffi.Pointer obj, + ffi.Pointer sel, + int changeKind, + ffi.Pointer indexes, + ffi.Pointer key, + ) { + return __objc_msgSend_446( + obj, + sel, + changeKind, + indexes, + key, + ); + } + + late final __objc_msgSend_446Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_446 = __objc_msgSend_446Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_didChange_valuesAtIndexes_forKey_1 = + _registerName1("didChange:valuesAtIndexes:forKey:"); + late final _sel_willChangeValueForKey_withSetMutation_usingObjects_1 = + _registerName1("willChangeValueForKey:withSetMutation:usingObjects:"); + void _objc_msgSend_447( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + int mutationKind, + ffi.Pointer objects, + ) { + return __objc_msgSend_447( + obj, + sel, + key, + mutationKind, + objects, + ); + } + + late final __objc_msgSend_447Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_447 = __objc_msgSend_447Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_didChangeValueForKey_withSetMutation_usingObjects_1 = + _registerName1("didChangeValueForKey:withSetMutation:usingObjects:"); + late final _sel_observationInfo1 = _registerName1("observationInfo"); + late final _sel_setObservationInfo_1 = _registerName1("setObservationInfo:"); + void _objc_msgSend_448( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_448( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_448Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_448 = __objc_msgSend_448Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_classForKeyedArchiver1 = + _registerName1("classForKeyedArchiver"); + late final _class_NSKeyedArchiver1 = _getClass1("NSKeyedArchiver"); + late final _sel_initRequiringSecureCoding_1 = + _registerName1("initRequiringSecureCoding:"); + instancetype _objc_msgSend_449( + ffi.Pointer obj, + ffi.Pointer sel, + bool requiresSecureCoding, + ) { + return __objc_msgSend_449( + obj, + sel, + requiresSecureCoding, + ); + } + + late final __objc_msgSend_449Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_449 = __objc_msgSend_449Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_archivedDataWithRootObject_requiringSecureCoding_error_1 = + _registerName1("archivedDataWithRootObject:requiringSecureCoding:error:"); + ffi.Pointer _objc_msgSend_450( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer object, + bool requiresSecureCoding, + ffi.Pointer> error, + ) { + return __objc_msgSend_450( + obj, + sel, + object, + requiresSecureCoding, + error, + ); + } + + late final __objc_msgSend_450Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_450 = __objc_msgSend_450Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer>)>(); + + late final _class_NSMutableData1 = _getClass1("NSMutableData"); + late final _sel_mutableBytes1 = _registerName1("mutableBytes"); + late final _sel_setLength_1 = _registerName1("setLength:"); + void _objc_msgSend_451( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_451( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_451Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_451 = __objc_msgSend_451Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_appendBytes_length_1 = _registerName1("appendBytes:length:"); + late final _sel_appendData_1 = _registerName1("appendData:"); + late final _sel_increaseLengthBy_1 = _registerName1("increaseLengthBy:"); + late final _sel_replaceBytesInRange_withBytes_1 = + _registerName1("replaceBytesInRange:withBytes:"); + void _objc_msgSend_452( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer bytes, + ) { + return __objc_msgSend_452( + obj, + sel, + range, + bytes, + ); + } + + late final __objc_msgSend_452Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_452 = __objc_msgSend_452Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, + ffi.Pointer)>(); + + late final _sel_resetBytesInRange_1 = _registerName1("resetBytesInRange:"); + late final _sel_setData_1 = _registerName1("setData:"); + late final _sel_replaceBytesInRange_withBytes_length_1 = + _registerName1("replaceBytesInRange:withBytes:length:"); + void _objc_msgSend_453( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer replacementBytes, + int replacementLength, + ) { + return __objc_msgSend_453( + obj, + sel, + range, + replacementBytes, + replacementLength, + ); + } + + late final __objc_msgSend_453Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_453 = __objc_msgSend_453Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, + ffi.Pointer, int)>(); + + late final _sel_dataWithCapacity_1 = _registerName1("dataWithCapacity:"); + late final _sel_dataWithLength_1 = _registerName1("dataWithLength:"); + late final _sel_initWithLength_1 = _registerName1("initWithLength:"); + late final _sel_decompressUsingAlgorithm_error_1 = + _registerName1("decompressUsingAlgorithm:error:"); + bool _objc_msgSend_454( + ffi.Pointer obj, + ffi.Pointer sel, + int algorithm, + ffi.Pointer> error, + ) { + return __objc_msgSend_454( + obj, + sel, + algorithm, + error, + ); + } + + late final __objc_msgSend_454Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_454 = __objc_msgSend_454Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer>)>(); + + late final _sel_compressUsingAlgorithm_error_1 = + _registerName1("compressUsingAlgorithm:error:"); + late final _sel_initForWritingWithMutableData_1 = + _registerName1("initForWritingWithMutableData:"); + instancetype _objc_msgSend_455( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ) { + return __objc_msgSend_455( + obj, + sel, + data, + ); + } + + late final __objc_msgSend_455Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_455 = __objc_msgSend_455Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_archivedDataWithRootObject_1 = + _registerName1("archivedDataWithRootObject:"); + ffi.Pointer _objc_msgSend_456( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer rootObject, + ) { + return __objc_msgSend_456( + obj, + sel, + rootObject, + ); + } + + late final __objc_msgSend_456Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_456 = __objc_msgSend_456Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_archiveRootObject_toFile_1 = + _registerName1("archiveRootObject:toFile:"); + late final _sel_outputFormat1 = _registerName1("outputFormat"); + int _objc_msgSend_457( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_457( + obj, + sel, + ); + } + + late final __objc_msgSend_457Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_457 = __objc_msgSend_457Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setOutputFormat_1 = _registerName1("setOutputFormat:"); + void _objc_msgSend_458( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_458( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_458Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_458 = __objc_msgSend_458Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_encodedData1 = _registerName1("encodedData"); + late final _sel_finishEncoding1 = _registerName1("finishEncoding"); + late final _sel_setClassName_forClass_1 = + _registerName1("setClassName:forClass:"); + void _objc_msgSend_459( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer codedName, + ffi.Pointer cls, + ) { + return __objc_msgSend_459( + obj, + sel, + codedName, + cls, + ); + } + + late final __objc_msgSend_459Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_459 = __objc_msgSend_459Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_classNameForClass_1 = _registerName1("classNameForClass:"); + late final _sel_setRequiresSecureCoding_1 = + _registerName1("setRequiresSecureCoding:"); + void _objc_msgSend_460( + ffi.Pointer obj, + ffi.Pointer sel, + bool value, + ) { + return __objc_msgSend_460( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_460Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_460 = __objc_msgSend_460Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_replacementObjectForKeyedArchiver_1 = + _registerName1("replacementObjectForKeyedArchiver:"); + ffi.Pointer _objc_msgSend_461( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer archiver, + ) { + return __objc_msgSend_461( + obj, + sel, + archiver, + ); + } + + late final __objc_msgSend_461Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_461 = __objc_msgSend_461Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_performSelectorOnMainThread_withObject_waitUntilDone_modes_1 = + _registerName1( + "performSelectorOnMainThread:withObject:waitUntilDone:modes:"); + void _objc_msgSend_462( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer arg, + bool wait, + ffi.Pointer array, + ) { + return __objc_msgSend_462( + obj, + sel, + aSelector, + arg, + wait, + array, + ); + } + + late final __objc_msgSend_462Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_462 = __objc_msgSend_462Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer)>(); + + late final _sel_performSelectorOnMainThread_withObject_waitUntilDone_1 = + _registerName1("performSelectorOnMainThread:withObject:waitUntilDone:"); + void _objc_msgSend_463( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer arg, + bool wait, + ) { + return __objc_msgSend_463( + obj, + sel, + aSelector, + arg, + wait, + ); + } + + late final __objc_msgSend_463Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_463 = __objc_msgSend_463Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _class_NSThread1 = _getClass1("NSThread"); + late final _sel_currentThread1 = _registerName1("currentThread"); + ffi.Pointer _objc_msgSend_464( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_464( + obj, + sel, + ); + } + + late final __objc_msgSend_464Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_464 = __objc_msgSend_464Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_detachNewThreadWithBlock_1 = + _registerName1("detachNewThreadWithBlock:"); + void _objc_msgSend_465( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_465( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_465Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_465 = __objc_msgSend_465Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_detachNewThreadSelector_toTarget_withObject_1 = + _registerName1("detachNewThreadSelector:toTarget:withObject:"); + void _objc_msgSend_466( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer selector, + ffi.Pointer target, + ffi.Pointer argument, + ) { + return __objc_msgSend_466( + obj, + sel, + selector, + target, + argument, + ); + } + + late final __objc_msgSend_466Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_466 = __objc_msgSend_466Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_isMultiThreaded1 = _registerName1("isMultiThreaded"); + late final _class_NSMutableDictionary1 = _getClass1("NSMutableDictionary"); + late final _sel_removeObjectForKey_1 = _registerName1("removeObjectForKey:"); + late final _sel_setObject_forKey_1 = _registerName1("setObject:forKey:"); + void _objc_msgSend_467( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ffi.Pointer aKey, + ) { + return __objc_msgSend_467( + obj, + sel, + anObject, + aKey, + ); + } + + late final __objc_msgSend_467Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_467 = __objc_msgSend_467Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_addEntriesFromDictionary_1 = + _registerName1("addEntriesFromDictionary:"); + late final _sel_removeObjectsForKeys_1 = + _registerName1("removeObjectsForKeys:"); + late final _sel_setDictionary_1 = _registerName1("setDictionary:"); + late final _sel_setObject_forKeyedSubscript_1 = + _registerName1("setObject:forKeyedSubscript:"); + late final _sel_dictionaryWithCapacity_1 = + _registerName1("dictionaryWithCapacity:"); + ffi.Pointer _objc_msgSend_468( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ) { + return __objc_msgSend_468( + obj, + sel, + path, + ); + } + + late final __objc_msgSend_468Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_468 = __objc_msgSend_468Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_469( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ) { + return __objc_msgSend_469( + obj, + sel, + url, + ); + } + + late final __objc_msgSend_469Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_469 = __objc_msgSend_469Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_dictionaryWithSharedKeySet_1 = + _registerName1("dictionaryWithSharedKeySet:"); + ffi.Pointer _objc_msgSend_470( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keyset, + ) { + return __objc_msgSend_470( + obj, + sel, + keyset, + ); + } + + late final __objc_msgSend_470Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_470 = __objc_msgSend_470Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_threadDictionary1 = _registerName1("threadDictionary"); + ffi.Pointer _objc_msgSend_471( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_471( + obj, + sel, + ); + } + + late final __objc_msgSend_471Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_471 = __objc_msgSend_471Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_sleepUntilDate_1 = _registerName1("sleepUntilDate:"); + void _objc_msgSend_472( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + ) { + return __objc_msgSend_472( + obj, + sel, + date, + ); + } + + late final __objc_msgSend_472Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_472 = __objc_msgSend_472Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_sleepForTimeInterval_1 = + _registerName1("sleepForTimeInterval:"); + void _objc_msgSend_473( + ffi.Pointer obj, + ffi.Pointer sel, + double ti, + ) { + return __objc_msgSend_473( + obj, + sel, + ti, + ); + } + + late final __objc_msgSend_473Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSTimeInterval)>>('objc_msgSend'); + late final __objc_msgSend_473 = __objc_msgSend_473Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_exit1 = _registerName1("exit"); + late final _sel_threadPriority1 = _registerName1("threadPriority"); + late final _sel_setThreadPriority_1 = _registerName1("setThreadPriority:"); + void _objc_msgSend_474( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_474( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_474Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_474 = __objc_msgSend_474Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_qualityOfService1 = _registerName1("qualityOfService"); + int _objc_msgSend_475( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_475( + obj, + sel, + ); + } + + late final __objc_msgSend_475Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_475 = __objc_msgSend_475Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setQualityOfService_1 = + _registerName1("setQualityOfService:"); + void _objc_msgSend_476( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_476( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_476Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_476 = __objc_msgSend_476Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_callStackReturnAddresses1 = + _registerName1("callStackReturnAddresses"); + late final _sel_callStackSymbols1 = _registerName1("callStackSymbols"); + late final _sel_setName_1 = _registerName1("setName:"); + void _objc_msgSend_477( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_477( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_477Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_477 = __objc_msgSend_477Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_stackSize1 = _registerName1("stackSize"); + late final _sel_setStackSize_1 = _registerName1("setStackSize:"); + late final _sel_isMainThread1 = _registerName1("isMainThread"); + late final _sel_mainThread1 = _registerName1("mainThread"); + late final _sel_initWithTarget_selector_object_1 = + _registerName1("initWithTarget:selector:object:"); + instancetype _objc_msgSend_478( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer target, + ffi.Pointer selector, + ffi.Pointer argument, + ) { + return __objc_msgSend_478( + obj, + sel, + target, + selector, + argument, + ); + } + + late final __objc_msgSend_478Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_478 = __objc_msgSend_478Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithBlock_1 = _registerName1("initWithBlock:"); + instancetype _objc_msgSend_479( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_479( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_479Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_479 = __objc_msgSend_479Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_isExecuting1 = _registerName1("isExecuting"); + late final _sel_isFinished1 = _registerName1("isFinished"); + late final _sel_isCancelled1 = _registerName1("isCancelled"); + late final _sel_cancel1 = _registerName1("cancel"); + late final _sel_start1 = _registerName1("start"); + late final _sel_main1 = _registerName1("main"); + late final _sel_performSelector_onThread_withObject_waitUntilDone_modes_1 = + _registerName1( + "performSelector:onThread:withObject:waitUntilDone:modes:"); + void _objc_msgSend_480( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer thr, + ffi.Pointer arg, + bool wait, + ffi.Pointer array, + ) { + return __objc_msgSend_480( + obj, + sel, + aSelector, + thr, + arg, + wait, + array, + ); + } + + late final __objc_msgSend_480Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_480 = __objc_msgSend_480Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer)>(); + + late final _sel_performSelector_onThread_withObject_waitUntilDone_1 = + _registerName1("performSelector:onThread:withObject:waitUntilDone:"); + void _objc_msgSend_481( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer thr, + ffi.Pointer arg, + bool wait, + ) { + return __objc_msgSend_481( + obj, + sel, + aSelector, + thr, + arg, + wait, + ); + } + + late final __objc_msgSend_481Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_481 = __objc_msgSend_481Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); + + late final _sel_performSelectorInBackground_withObject_1 = + _registerName1("performSelectorInBackground:withObject:"); + late final _sel_classForArchiver1 = _registerName1("classForArchiver"); + late final _class_NSArchiver1 = _getClass1("NSArchiver"); + late final _sel_archiverData1 = _registerName1("archiverData"); + ffi.Pointer _objc_msgSend_482( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_482( + obj, + sel, + ); + } + + late final __objc_msgSend_482Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_482 = __objc_msgSend_482Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_encodeClassName_intoClassName_1 = + _registerName1("encodeClassName:intoClassName:"); + void _objc_msgSend_483( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer trueName, + ffi.Pointer inArchiveName, + ) { + return __objc_msgSend_483( + obj, + sel, + trueName, + inArchiveName, + ); + } + + late final __objc_msgSend_483Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_483 = __objc_msgSend_483Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_classNameEncodedForTrueClassName_1 = + _registerName1("classNameEncodedForTrueClassName:"); + late final _sel_replaceObject_withObject_1 = + _registerName1("replaceObject:withObject:"); + late final _sel_replacementObjectForArchiver_1 = + _registerName1("replacementObjectForArchiver:"); + ffi.Pointer _objc_msgSend_484( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer archiver, + ) { + return __objc_msgSend_484( + obj, + sel, + archiver, + ); + } + + late final __objc_msgSend_484Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_484 = __objc_msgSend_484Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_classForPortCoder1 = _registerName1("classForPortCoder"); + late final _class_NSPortCoder1 = _getClass1("NSPortCoder"); + late final _sel_isBycopy1 = _registerName1("isBycopy"); + late final _sel_isByref1 = _registerName1("isByref"); + late final _class_NSPort1 = _getClass1("NSPort"); + ffi.Pointer _objc_msgSend_485( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_485( + obj, + sel, + ); + } + + late final __objc_msgSend_485Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_485 = __objc_msgSend_485Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_invalidate1 = _registerName1("invalidate"); + late final _sel_isValid1 = _registerName1("isValid"); + late final _class_NSRunLoop1 = _getClass1("NSRunLoop"); + late final _sel_currentRunLoop1 = _registerName1("currentRunLoop"); + ffi.Pointer _objc_msgSend_486( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_486( + obj, + sel, + ); + } + + late final __objc_msgSend_486Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_486 = __objc_msgSend_486Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_mainRunLoop1 = _registerName1("mainRunLoop"); + late final _sel_currentMode1 = _registerName1("currentMode"); + late final _sel_getCFRunLoop1 = _registerName1("getCFRunLoop"); + CFRunLoopRef _objc_msgSend_487( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_487( + obj, + sel, + ); + } + + late final __objc_msgSend_487Ptr = _lookup< + ffi.NativeFunction< + CFRunLoopRef Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_487 = __objc_msgSend_487Ptr.asFunction< + CFRunLoopRef Function(ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSTimer1 = _getClass1("NSTimer"); + late final _sel_timerWithTimeInterval_invocation_repeats_1 = + _registerName1("timerWithTimeInterval:invocation:repeats:"); + ffi.Pointer _objc_msgSend_488( + ffi.Pointer obj, + ffi.Pointer sel, + double ti, + ffi.Pointer invocation, + bool yesOrNo, + ) { + return __objc_msgSend_488( + obj, + sel, + ti, + invocation, + yesOrNo, + ); + } + + late final __objc_msgSend_488Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSTimeInterval, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_488 = __objc_msgSend_488Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, double, ffi.Pointer, bool)>(); + + late final _sel_scheduledTimerWithTimeInterval_invocation_repeats_1 = + _registerName1("scheduledTimerWithTimeInterval:invocation:repeats:"); + late final _sel_timerWithTimeInterval_target_selector_userInfo_repeats_1 = + _registerName1("timerWithTimeInterval:target:selector:userInfo:repeats:"); + ffi.Pointer _objc_msgSend_489( + ffi.Pointer obj, + ffi.Pointer sel, + double ti, + ffi.Pointer aTarget, + ffi.Pointer aSelector, + ffi.Pointer userInfo, + bool yesOrNo, + ) { + return __objc_msgSend_489( + obj, + sel, + ti, + aTarget, + aSelector, + userInfo, + yesOrNo, + ); + } + + late final __objc_msgSend_489Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSTimeInterval, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_489 = __objc_msgSend_489Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + double, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); + + late final _sel_scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_1 = + _registerName1( + "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"); + late final _sel_timerWithTimeInterval_repeats_block_1 = + _registerName1("timerWithTimeInterval:repeats:block:"); + ffi.Pointer _objc_msgSend_490( + ffi.Pointer obj, + ffi.Pointer sel, + double interval, + bool repeats, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_490( + obj, + sel, + interval, + repeats, + block, + ); + } + + late final __objc_msgSend_490Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSTimeInterval, + ffi.Bool, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_490 = __objc_msgSend_490Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, double, bool, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_scheduledTimerWithTimeInterval_repeats_block_1 = + _registerName1("scheduledTimerWithTimeInterval:repeats:block:"); + late final _sel_initWithFireDate_interval_repeats_block_1 = + _registerName1("initWithFireDate:interval:repeats:block:"); + instancetype _objc_msgSend_491( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + double interval, + bool repeats, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_491( + obj, + sel, + date, + interval, + repeats, + block, + ); + } + + late final __objc_msgSend_491Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSTimeInterval, + ffi.Bool, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_491 = __objc_msgSend_491Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, double, bool, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_initWithFireDate_interval_target_selector_userInfo_repeats_1 = + _registerName1( + "initWithFireDate:interval:target:selector:userInfo:repeats:"); + instancetype _objc_msgSend_492( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + double ti, + ffi.Pointer t, + ffi.Pointer s, + ffi.Pointer ui, + bool rep, + ) { + return __objc_msgSend_492( + obj, + sel, + date, + ti, + t, + s, + ui, + rep, + ); + } + + late final __objc_msgSend_492Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSTimeInterval, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_492 = __objc_msgSend_492Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + double, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); + + late final _sel_fire1 = _registerName1("fire"); + late final _sel_fireDate1 = _registerName1("fireDate"); + late final _sel_setFireDate_1 = _registerName1("setFireDate:"); + void _objc_msgSend_493( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_493( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_493Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_493 = __objc_msgSend_493Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_timeInterval1 = _registerName1("timeInterval"); + late final _sel_tolerance1 = _registerName1("tolerance"); + late final _sel_setTolerance_1 = _registerName1("setTolerance:"); + late final _sel_userInfo1 = _registerName1("userInfo"); + late final _sel_addTimer_forMode_1 = _registerName1("addTimer:forMode:"); + void _objc_msgSend_494( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer timer, + NSRunLoopMode mode, + ) { + return __objc_msgSend_494( + obj, + sel, + timer, + mode, + ); + } + + late final __objc_msgSend_494Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRunLoopMode)>>('objc_msgSend'); + late final __objc_msgSend_494 = __objc_msgSend_494Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRunLoopMode)>(); + + late final _sel_addPort_forMode_1 = _registerName1("addPort:forMode:"); + void _objc_msgSend_495( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aPort, + NSRunLoopMode mode, + ) { + return __objc_msgSend_495( + obj, + sel, + aPort, + mode, + ); + } + + late final __objc_msgSend_495Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRunLoopMode)>>('objc_msgSend'); + late final __objc_msgSend_495 = __objc_msgSend_495Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRunLoopMode)>(); + + late final _sel_removePort_forMode_1 = _registerName1("removePort:forMode:"); + late final _sel_limitDateForMode_1 = _registerName1("limitDateForMode:"); + ffi.Pointer _objc_msgSend_496( + ffi.Pointer obj, + ffi.Pointer sel, + NSRunLoopMode mode, + ) { + return __objc_msgSend_496( + obj, + sel, + mode, + ); + } + + late final __objc_msgSend_496Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRunLoopMode)>>('objc_msgSend'); + late final __objc_msgSend_496 = __objc_msgSend_496Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRunLoopMode)>(); + + late final _sel_acceptInputForMode_beforeDate_1 = + _registerName1("acceptInputForMode:beforeDate:"); + void _objc_msgSend_497( + ffi.Pointer obj, + ffi.Pointer sel, + NSRunLoopMode mode, + ffi.Pointer limitDate, + ) { + return __objc_msgSend_497( + obj, + sel, + mode, + limitDate, + ); + } + + late final __objc_msgSend_497Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRunLoopMode, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_497 = __objc_msgSend_497Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + NSRunLoopMode, ffi.Pointer)>(); + + late final _sel_run1 = _registerName1("run"); + late final _sel_runUntilDate_1 = _registerName1("runUntilDate:"); + late final _sel_runMode_beforeDate_1 = _registerName1("runMode:beforeDate:"); + bool _objc_msgSend_498( + ffi.Pointer obj, + ffi.Pointer sel, + NSRunLoopMode mode, + ffi.Pointer limitDate, + ) { + return __objc_msgSend_498( + obj, + sel, + mode, + limitDate, + ); + } + + late final __objc_msgSend_498Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + NSRunLoopMode, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_498 = __objc_msgSend_498Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + NSRunLoopMode, ffi.Pointer)>(); + + late final _sel_configureAsServer1 = _registerName1("configureAsServer"); + late final _sel_performInModes_block_1 = + _registerName1("performInModes:block:"); + void _objc_msgSend_499( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer modes, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_499( + obj, + sel, + modes, + block, + ); + } + + late final __objc_msgSend_499Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_499 = __objc_msgSend_499Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_performBlock_1 = _registerName1("performBlock:"); + late final _sel_performSelector_target_argument_order_modes_1 = + _registerName1("performSelector:target:argument:order:modes:"); + void _objc_msgSend_500( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer target, + ffi.Pointer arg, + int order, + ffi.Pointer modes, + ) { + return __objc_msgSend_500( + obj, + sel, + aSelector, + target, + arg, + order, + modes, + ); + } + + late final __objc_msgSend_500Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_500 = __objc_msgSend_500Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final _sel_cancelPerformSelector_target_argument_1 = + _registerName1("cancelPerformSelector:target:argument:"); + late final _sel_cancelPerformSelectorsWithTarget_1 = + _registerName1("cancelPerformSelectorsWithTarget:"); + late final _sel_scheduleInRunLoop_forMode_1 = + _registerName1("scheduleInRunLoop:forMode:"); + void _objc_msgSend_501( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer runLoop, + NSRunLoopMode mode, + ) { + return __objc_msgSend_501( + obj, + sel, + runLoop, + mode, + ); + } + + late final __objc_msgSend_501Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRunLoopMode)>>('objc_msgSend'); + late final __objc_msgSend_501 = __objc_msgSend_501Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRunLoopMode)>(); + + late final _sel_removeFromRunLoop_forMode_1 = + _registerName1("removeFromRunLoop:forMode:"); + late final _sel_reservedSpaceLength1 = _registerName1("reservedSpaceLength"); + late final _sel_sendBeforeDate_components_from_reserved_1 = + _registerName1("sendBeforeDate:components:from:reserved:"); + bool _objc_msgSend_502( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer limitDate, + ffi.Pointer components, + ffi.Pointer receivePort, + int headerSpaceReserved, + ) { + return __objc_msgSend_502( + obj, + sel, + limitDate, + components, + receivePort, + headerSpaceReserved, + ); + } + + late final __objc_msgSend_502Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_502 = __objc_msgSend_502Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_sendBeforeDate_msgid_components_from_reserved_1 = + _registerName1("sendBeforeDate:msgid:components:from:reserved:"); + bool _objc_msgSend_503( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer limitDate, + int msgID, + ffi.Pointer components, + ffi.Pointer receivePort, + int headerSpaceReserved, + ) { + return __objc_msgSend_503( + obj, + sel, + limitDate, + msgID, + components, + receivePort, + headerSpaceReserved, + ); + } + + late final __objc_msgSend_503Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer, + ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_503 = __objc_msgSend_503Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _class_NSConnection1 = _getClass1("NSConnection"); + late final _sel_statistics1 = _registerName1("statistics"); + late final _sel_allConnections1 = _registerName1("allConnections"); + late final _sel_defaultConnection1 = _registerName1("defaultConnection"); + ffi.Pointer _objc_msgSend_504( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_504( + obj, + sel, + ); + } + + late final __objc_msgSend_504Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_504 = __objc_msgSend_504Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_connectionWithRegisteredName_host_1 = + _registerName1("connectionWithRegisteredName:host:"); + late final _class_NSPortNameServer1 = _getClass1("NSPortNameServer"); + late final _sel_systemDefaultPortNameServer1 = + _registerName1("systemDefaultPortNameServer"); + ffi.Pointer _objc_msgSend_505( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_505( + obj, + sel, + ); + } + + late final __objc_msgSend_505Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_505 = __objc_msgSend_505Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_portForName_1 = _registerName1("portForName:"); + ffi.Pointer _objc_msgSend_506( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ) { + return __objc_msgSend_506( + obj, + sel, + name, + ); + } + + late final __objc_msgSend_506Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_506 = __objc_msgSend_506Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_portForName_host_1 = _registerName1("portForName:host:"); + ffi.Pointer _objc_msgSend_507( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer host, + ) { + return __objc_msgSend_507( + obj, + sel, + name, + host, + ); + } + + late final __objc_msgSend_507Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_507 = __objc_msgSend_507Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_registerPort_name_1 = _registerName1("registerPort:name:"); + bool _objc_msgSend_508( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer port, + ffi.Pointer name, + ) { + return __objc_msgSend_508( + obj, + sel, + port, + name, + ); + } + + late final __objc_msgSend_508Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_508 = __objc_msgSend_508Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_removePortForName_1 = _registerName1("removePortForName:"); + late final _sel_connectionWithRegisteredName_host_usingNameServer_1 = + _registerName1("connectionWithRegisteredName:host:usingNameServer:"); + instancetype _objc_msgSend_509( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer hostName, + ffi.Pointer server, + ) { + return __objc_msgSend_509( + obj, + sel, + name, + hostName, + server, + ); + } + + late final __objc_msgSend_509Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_509 = __objc_msgSend_509Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSDistantObject1 = _getClass1("NSDistantObject"); + late final _class_NSProxy1 = _getClass1("NSProxy"); + late final _sel_respondsToSelector_1 = _registerName1("respondsToSelector:"); + late final _sel_proxyWithTarget_connection_1 = + _registerName1("proxyWithTarget:connection:"); + ffi.Pointer _objc_msgSend_510( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer target, + ffi.Pointer connection, + ) { + return __objc_msgSend_510( + obj, + sel, + target, + connection, + ); + } + + late final __objc_msgSend_510Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_510 = __objc_msgSend_510Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithTarget_connection_1 = + _registerName1("initWithTarget:connection:"); + late final _sel_proxyWithLocal_connection_1 = + _registerName1("proxyWithLocal:connection:"); + late final _sel_initWithLocal_connection_1 = + _registerName1("initWithLocal:connection:"); + late final _sel_setProtocolForProxy_1 = + _registerName1("setProtocolForProxy:"); + void _objc_msgSend_511( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer proto, + ) { + return __objc_msgSend_511( + obj, + sel, + proto, + ); + } + + late final __objc_msgSend_511Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_511 = __objc_msgSend_511Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_connectionForProxy1 = _registerName1("connectionForProxy"); + late final _sel_rootProxyForConnectionWithRegisteredName_host_1 = + _registerName1("rootProxyForConnectionWithRegisteredName:host:"); + ffi.Pointer _objc_msgSend_512( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer hostName, + ) { + return __objc_msgSend_512( + obj, + sel, + name, + hostName, + ); + } + + late final __objc_msgSend_512Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_512 = __objc_msgSend_512Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_rootProxyForConnectionWithRegisteredName_host_usingNameServer_1 = + _registerName1( + "rootProxyForConnectionWithRegisteredName:host:usingNameServer:"); + ffi.Pointer _objc_msgSend_513( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer hostName, + ffi.Pointer server, + ) { + return __objc_msgSend_513( + obj, + sel, + name, + hostName, + server, + ); + } + + late final __objc_msgSend_513Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_513 = __objc_msgSend_513Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_serviceConnectionWithName_rootObject_usingNameServer_1 = + _registerName1("serviceConnectionWithName:rootObject:usingNameServer:"); + instancetype _objc_msgSend_514( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer root, + ffi.Pointer server, + ) { + return __objc_msgSend_514( + obj, + sel, + name, + root, + server, + ); + } + + late final __objc_msgSend_514Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_514 = __objc_msgSend_514Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_serviceConnectionWithName_rootObject_1 = + _registerName1("serviceConnectionWithName:rootObject:"); + late final _sel_requestTimeout1 = _registerName1("requestTimeout"); + late final _sel_setRequestTimeout_1 = _registerName1("setRequestTimeout:"); + late final _sel_replyTimeout1 = _registerName1("replyTimeout"); + late final _sel_setReplyTimeout_1 = _registerName1("setReplyTimeout:"); + late final _sel_rootObject1 = _registerName1("rootObject"); + late final _sel_setRootObject_1 = _registerName1("setRootObject:"); + late final _sel_independentConversationQueueing1 = + _registerName1("independentConversationQueueing"); + late final _sel_setIndependentConversationQueueing_1 = + _registerName1("setIndependentConversationQueueing:"); + late final _sel_rootProxy1 = _registerName1("rootProxy"); + ffi.Pointer _objc_msgSend_515( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_515( + obj, + sel, + ); + } + + late final __objc_msgSend_515Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_515 = __objc_msgSend_515Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_addRequestMode_1 = _registerName1("addRequestMode:"); + late final _sel_removeRequestMode_1 = _registerName1("removeRequestMode:"); + late final _sel_requestModes1 = _registerName1("requestModes"); + late final _sel_registerName_1 = _registerName1("registerName:"); + late final _sel_registerName_withNameServer_1 = + _registerName1("registerName:withNameServer:"); + bool _objc_msgSend_516( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer server, + ) { + return __objc_msgSend_516( + obj, + sel, + name, + server, + ); + } + + late final __objc_msgSend_516Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_516 = __objc_msgSend_516Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_connectionWithReceivePort_sendPort_1 = + _registerName1("connectionWithReceivePort:sendPort:"); + instancetype _objc_msgSend_517( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer receivePort, + ffi.Pointer sendPort, + ) { + return __objc_msgSend_517( + obj, + sel, + receivePort, + sendPort, + ); + } + + late final __objc_msgSend_517Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_517 = __objc_msgSend_517Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_currentConversation1 = _registerName1("currentConversation"); + late final _sel_initWithReceivePort_sendPort_1 = + _registerName1("initWithReceivePort:sendPort:"); + late final _sel_sendPort1 = _registerName1("sendPort"); + late final _sel_receivePort1 = _registerName1("receivePort"); + late final _sel_enableMultipleThreads1 = + _registerName1("enableMultipleThreads"); + late final _sel_multipleThreadsEnabled1 = + _registerName1("multipleThreadsEnabled"); + late final _sel_addRunLoop_1 = _registerName1("addRunLoop:"); + void _objc_msgSend_518( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer runloop, + ) { + return __objc_msgSend_518( + obj, + sel, + runloop, + ); + } + + late final __objc_msgSend_518Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_518 = __objc_msgSend_518Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeRunLoop_1 = _registerName1("removeRunLoop:"); + late final _sel_runInNewThread1 = _registerName1("runInNewThread"); + late final _sel_remoteObjects1 = _registerName1("remoteObjects"); + late final _sel_localObjects1 = _registerName1("localObjects"); + late final _sel_dispatchWithComponents_1 = + _registerName1("dispatchWithComponents:"); + late final _sel_addConnection_toRunLoop_forMode_1 = + _registerName1("addConnection:toRunLoop:forMode:"); + void _objc_msgSend_519( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer conn, + ffi.Pointer runLoop, + NSRunLoopMode mode, + ) { + return __objc_msgSend_519( + obj, + sel, + conn, + runLoop, + mode, + ); + } + + late final __objc_msgSend_519Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSRunLoopMode)>>('objc_msgSend'); + late final __objc_msgSend_519 = __objc_msgSend_519Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, NSRunLoopMode)>(); + + late final _sel_removeConnection_fromRunLoop_forMode_1 = + _registerName1("removeConnection:fromRunLoop:forMode:"); + late final _sel_encodePortObject_1 = _registerName1("encodePortObject:"); + void _objc_msgSend_520( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aport, + ) { + return __objc_msgSend_520( + obj, + sel, + aport, + ); + } + + late final __objc_msgSend_520Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_520 = __objc_msgSend_520Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodePortObject1 = _registerName1("decodePortObject"); + late final _sel_connection1 = _registerName1("connection"); + late final _sel_portCoderWithReceivePort_sendPort_components_1 = + _registerName1("portCoderWithReceivePort:sendPort:components:"); + ffi.Pointer _objc_msgSend_521( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer rcvPort, + ffi.Pointer sndPort, + ffi.Pointer comps, + ) { + return __objc_msgSend_521( + obj, + sel, + rcvPort, + sndPort, + comps, + ); + } + + late final __objc_msgSend_521Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_521 = __objc_msgSend_521Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithReceivePort_sendPort_components_1 = + _registerName1("initWithReceivePort:sendPort:components:"); + late final _sel_dispatch1 = _registerName1("dispatch"); + late final _sel_replacementObjectForPortCoder_1 = + _registerName1("replacementObjectForPortCoder:"); + ffi.Pointer _objc_msgSend_522( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_522( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_522Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_522 = __objc_msgSend_522Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSClassDescription1 = _getClass1("NSClassDescription"); + late final _sel_registerClassDescription_forClass_1 = + _registerName1("registerClassDescription:forClass:"); + void _objc_msgSend_523( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer description, + ffi.Pointer aClass, + ) { + return __objc_msgSend_523( + obj, + sel, + description, + aClass, + ); + } + + late final __objc_msgSend_523Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_523 = __objc_msgSend_523Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_invalidateClassDescriptionCache1 = + _registerName1("invalidateClassDescriptionCache"); + late final _sel_classDescriptionForClass_1 = + _registerName1("classDescriptionForClass:"); + ffi.Pointer _objc_msgSend_524( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ) { + return __objc_msgSend_524( + obj, + sel, + aClass, + ); + } + + late final __objc_msgSend_524Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_524 = __objc_msgSend_524Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_attributeKeys1 = _registerName1("attributeKeys"); + late final _sel_toOneRelationshipKeys1 = + _registerName1("toOneRelationshipKeys"); + late final _sel_toManyRelationshipKeys1 = + _registerName1("toManyRelationshipKeys"); + late final _sel_inverseForRelationshipKey_1 = + _registerName1("inverseForRelationshipKey:"); + late final _sel_classDescription1 = _registerName1("classDescription"); + ffi.Pointer _objc_msgSend_525( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_525( + obj, + sel, + ); + } + + late final __objc_msgSend_525Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_525 = __objc_msgSend_525Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSScriptObjectSpecifier1 = + _getClass1("NSScriptObjectSpecifier"); + late final _class_NSAppleEventDescriptor1 = + _getClass1("NSAppleEventDescriptor"); + late final _sel_nullDescriptor1 = _registerName1("nullDescriptor"); + ffi.Pointer _objc_msgSend_526( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_526( + obj, + sel, + ); + } + + late final __objc_msgSend_526Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_526 = __objc_msgSend_526Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_descriptorWithDescriptorType_bytes_length_1 = + _registerName1("descriptorWithDescriptorType:bytes:length:"); + ffi.Pointer _objc_msgSend_527( + ffi.Pointer obj, + ffi.Pointer sel, + int descriptorType, + ffi.Pointer bytes, + int byteCount, + ) { + return __objc_msgSend_527( + obj, + sel, + descriptorType, + bytes, + byteCount, + ); + } + + late final __objc_msgSend_527Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + DescType, + ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_527 = __objc_msgSend_527Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer, int)>(); + + late final _sel_descriptorWithDescriptorType_data_1 = + _registerName1("descriptorWithDescriptorType:data:"); + ffi.Pointer _objc_msgSend_528( + ffi.Pointer obj, + ffi.Pointer sel, + int descriptorType, + ffi.Pointer data, + ) { + return __objc_msgSend_528( + obj, + sel, + descriptorType, + data, + ); + } + + late final __objc_msgSend_528Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + DescType, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_528 = __objc_msgSend_528Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_descriptorWithBoolean_1 = + _registerName1("descriptorWithBoolean:"); + ffi.Pointer _objc_msgSend_529( + ffi.Pointer obj, + ffi.Pointer sel, + int boolean, + ) { + return __objc_msgSend_529( + obj, + sel, + boolean, + ); + } + + late final __objc_msgSend_529Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, Boolean)>>('objc_msgSend'); + late final __objc_msgSend_529 = __objc_msgSend_529Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_descriptorWithEnumCode_1 = + _registerName1("descriptorWithEnumCode:"); + ffi.Pointer _objc_msgSend_530( + ffi.Pointer obj, + ffi.Pointer sel, + int enumerator, + ) { + return __objc_msgSend_530( + obj, + sel, + enumerator, + ); + } + + late final __objc_msgSend_530Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, OSType)>>('objc_msgSend'); + late final __objc_msgSend_530 = __objc_msgSend_530Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_descriptorWithInt32_1 = + _registerName1("descriptorWithInt32:"); + ffi.Pointer _objc_msgSend_531( + ffi.Pointer obj, + ffi.Pointer sel, + int signedInt, + ) { + return __objc_msgSend_531( + obj, + sel, + signedInt, + ); + } + + late final __objc_msgSend_531Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, SInt32)>>('objc_msgSend'); + late final __objc_msgSend_531 = __objc_msgSend_531Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_descriptorWithDouble_1 = + _registerName1("descriptorWithDouble:"); + ffi.Pointer _objc_msgSend_532( + ffi.Pointer obj, + ffi.Pointer sel, + double doubleValue, + ) { + return __objc_msgSend_532( + obj, + sel, + doubleValue, + ); + } + + late final __objc_msgSend_532Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_532 = __objc_msgSend_532Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_descriptorWithTypeCode_1 = + _registerName1("descriptorWithTypeCode:"); + late final _sel_descriptorWithString_1 = + _registerName1("descriptorWithString:"); + ffi.Pointer _objc_msgSend_533( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + ) { + return __objc_msgSend_533( + obj, + sel, + string, + ); + } + + late final __objc_msgSend_533Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_533 = __objc_msgSend_533Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_descriptorWithDate_1 = _registerName1("descriptorWithDate:"); + ffi.Pointer _objc_msgSend_534( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + ) { + return __objc_msgSend_534( + obj, + sel, + date, + ); + } + + late final __objc_msgSend_534Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_534 = __objc_msgSend_534Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_descriptorWithFileURL_1 = + _registerName1("descriptorWithFileURL:"); + ffi.Pointer _objc_msgSend_535( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer fileURL, + ) { + return __objc_msgSend_535( + obj, + sel, + fileURL, + ); + } + + late final __objc_msgSend_535Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_535 = __objc_msgSend_535Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_appleEventWithEventClass_eventID_targetDescriptor_returnID_transactionID_1 = + _registerName1( + "appleEventWithEventClass:eventID:targetDescriptor:returnID:transactionID:"); + ffi.Pointer _objc_msgSend_536( + ffi.Pointer obj, + ffi.Pointer sel, + int eventClass, + int eventID, + ffi.Pointer targetDescriptor, + int returnID, + int transactionID, + ) { + return __objc_msgSend_536( + obj, + sel, + eventClass, + eventID, + targetDescriptor, + returnID, + transactionID, + ); + } + + late final __objc_msgSend_536Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + AEEventClass, + AEEventID, + ffi.Pointer, + AEReturnID, + AETransactionID)>>('objc_msgSend'); + late final __objc_msgSend_536 = __objc_msgSend_536Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer, int, int)>(); + + late final _sel_listDescriptor1 = _registerName1("listDescriptor"); + late final _sel_recordDescriptor1 = _registerName1("recordDescriptor"); + late final _sel_currentProcessDescriptor1 = + _registerName1("currentProcessDescriptor"); + late final _sel_descriptorWithProcessIdentifier_1 = + _registerName1("descriptorWithProcessIdentifier:"); + late final _sel_descriptorWithBundleIdentifier_1 = + _registerName1("descriptorWithBundleIdentifier:"); + late final _sel_descriptorWithApplicationURL_1 = + _registerName1("descriptorWithApplicationURL:"); + late final _sel_initWithAEDescNoCopy_1 = + _registerName1("initWithAEDescNoCopy:"); + instancetype _objc_msgSend_537( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aeDesc, + ) { + return __objc_msgSend_537( + obj, + sel, + aeDesc, + ); + } + + late final __objc_msgSend_537Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_537 = __objc_msgSend_537Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithDescriptorType_bytes_length_1 = + _registerName1("initWithDescriptorType:bytes:length:"); + instancetype _objc_msgSend_538( + ffi.Pointer obj, + ffi.Pointer sel, + int descriptorType, + ffi.Pointer bytes, + int byteCount, + ) { + return __objc_msgSend_538( + obj, + sel, + descriptorType, + bytes, + byteCount, + ); + } + + late final __objc_msgSend_538Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + DescType, ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_538 = __objc_msgSend_538Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer, int)>(); + + late final _sel_initWithDescriptorType_data_1 = + _registerName1("initWithDescriptorType:data:"); + instancetype _objc_msgSend_539( + ffi.Pointer obj, + ffi.Pointer sel, + int descriptorType, + ffi.Pointer data, + ) { + return __objc_msgSend_539( + obj, + sel, + descriptorType, + data, + ); + } + + late final __objc_msgSend_539Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + DescType, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_539 = __objc_msgSend_539Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_initWithEventClass_eventID_targetDescriptor_returnID_transactionID_1 = + _registerName1( + "initWithEventClass:eventID:targetDescriptor:returnID:transactionID:"); + instancetype _objc_msgSend_540( + ffi.Pointer obj, + ffi.Pointer sel, + int eventClass, + int eventID, + ffi.Pointer targetDescriptor, + int returnID, + int transactionID, + ) { + return __objc_msgSend_540( + obj, + sel, + eventClass, + eventID, + targetDescriptor, + returnID, + transactionID, + ); + } + + late final __objc_msgSend_540Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + AEEventClass, + AEEventID, + ffi.Pointer, + AEReturnID, + AETransactionID)>>('objc_msgSend'); + late final __objc_msgSend_540 = __objc_msgSend_540Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + int, ffi.Pointer, int, int)>(); + + late final _sel_initListDescriptor1 = _registerName1("initListDescriptor"); + late final _sel_initRecordDescriptor1 = + _registerName1("initRecordDescriptor"); + late final _sel_aeDesc1 = _registerName1("aeDesc"); + ffi.Pointer _objc_msgSend_541( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_541( + obj, + sel, + ); + } + + late final __objc_msgSend_541Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_541 = __objc_msgSend_541Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_descriptorType1 = _registerName1("descriptorType"); + late final _sel_booleanValue1 = _registerName1("booleanValue"); + late final _sel_enumCodeValue1 = _registerName1("enumCodeValue"); + late final _sel_int32Value1 = _registerName1("int32Value"); + late final _sel_typeCodeValue1 = _registerName1("typeCodeValue"); + late final _sel_dateValue1 = _registerName1("dateValue"); + late final _sel_fileURLValue1 = _registerName1("fileURLValue"); + late final _sel_eventClass1 = _registerName1("eventClass"); + late final _sel_eventID1 = _registerName1("eventID"); + late final _sel_returnID1 = _registerName1("returnID"); + late final _sel_transactionID1 = _registerName1("transactionID"); + late final _sel_setParamDescriptor_forKeyword_1 = + _registerName1("setParamDescriptor:forKeyword:"); + void _objc_msgSend_542( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer descriptor, + int keyword, + ) { + return __objc_msgSend_542( + obj, + sel, + descriptor, + keyword, + ); + } + + late final __objc_msgSend_542Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, AEKeyword)>>('objc_msgSend'); + late final __objc_msgSend_542 = __objc_msgSend_542Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_paramDescriptorForKeyword_1 = + _registerName1("paramDescriptorForKeyword:"); + late final _sel_removeParamDescriptorWithKeyword_1 = + _registerName1("removeParamDescriptorWithKeyword:"); + void _objc_msgSend_543( + ffi.Pointer obj, + ffi.Pointer sel, + int keyword, + ) { + return __objc_msgSend_543( + obj, + sel, + keyword, + ); + } + + late final __objc_msgSend_543Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + AEKeyword)>>('objc_msgSend'); + late final __objc_msgSend_543 = __objc_msgSend_543Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_setAttributeDescriptor_forKeyword_1 = + _registerName1("setAttributeDescriptor:forKeyword:"); + late final _sel_attributeDescriptorForKeyword_1 = + _registerName1("attributeDescriptorForKeyword:"); + late final _sel_sendEventWithOptions_timeout_error_1 = + _registerName1("sendEventWithOptions:timeout:error:"); + ffi.Pointer _objc_msgSend_544( + ffi.Pointer obj, + ffi.Pointer sel, + int sendOptions, + double timeoutInSeconds, + ffi.Pointer> error, + ) { + return __objc_msgSend_544( + obj, + sel, + sendOptions, + timeoutInSeconds, + error, + ); + } + + late final __objc_msgSend_544Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSTimeInterval, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_544 = __objc_msgSend_544Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + double, + ffi.Pointer>)>(); + + late final _sel_isRecordDescriptor1 = _registerName1("isRecordDescriptor"); + late final _sel_numberOfItems1 = _registerName1("numberOfItems"); + late final _sel_insertDescriptor_atIndex_1 = + _registerName1("insertDescriptor:atIndex:"); + void _objc_msgSend_545( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer descriptor, + int index, + ) { + return __objc_msgSend_545( + obj, + sel, + descriptor, + index, + ); + } + + late final __objc_msgSend_545Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_545 = __objc_msgSend_545Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_descriptorAtIndex_1 = _registerName1("descriptorAtIndex:"); + ffi.Pointer _objc_msgSend_546( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_546( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_546Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_546 = __objc_msgSend_546Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_removeDescriptorAtIndex_1 = + _registerName1("removeDescriptorAtIndex:"); + late final _sel_setDescriptor_forKeyword_1 = + _registerName1("setDescriptor:forKeyword:"); + late final _sel_descriptorForKeyword_1 = + _registerName1("descriptorForKeyword:"); + late final _sel_removeDescriptorWithKeyword_1 = + _registerName1("removeDescriptorWithKeyword:"); + late final _sel_keywordForDescriptorAtIndex_1 = + _registerName1("keywordForDescriptorAtIndex:"); + int _objc_msgSend_547( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_547( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_547Ptr = _lookup< + ffi.NativeFunction< + AEKeyword Function(ffi.Pointer, ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_547 = __objc_msgSend_547Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_coerceToDescriptorType_1 = + _registerName1("coerceToDescriptorType:"); + late final _sel_objectSpecifierWithDescriptor_1 = + _registerName1("objectSpecifierWithDescriptor:"); + ffi.Pointer _objc_msgSend_548( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer descriptor, + ) { + return __objc_msgSend_548( + obj, + sel, + descriptor, + ); + } + + late final __objc_msgSend_548Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_548 = __objc_msgSend_548Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithContainerSpecifier_key_1 = + _registerName1("initWithContainerSpecifier:key:"); + instancetype _objc_msgSend_549( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer container, + ffi.Pointer property, + ) { + return __objc_msgSend_549( + obj, + sel, + container, + property, + ); + } + + late final __objc_msgSend_549Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_549 = __objc_msgSend_549Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSScriptClassDescription1 = + _getClass1("NSScriptClassDescription"); + ffi.Pointer _objc_msgSend_550( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ) { + return __objc_msgSend_550( + obj, + sel, + aClass, + ); + } + + late final __objc_msgSend_550Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_550 = __objc_msgSend_550Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithSuiteName_className_dictionary_1 = + _registerName1("initWithSuiteName:className:dictionary:"); + instancetype _objc_msgSend_551( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer suiteName, + ffi.Pointer className, + ffi.Pointer classDeclaration, + ) { + return __objc_msgSend_551( + obj, + sel, + suiteName, + className, + classDeclaration, + ); + } + + late final __objc_msgSend_551Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_551 = __objc_msgSend_551Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_suiteName1 = _registerName1("suiteName"); + late final _sel_className1 = _registerName1("className"); + late final _sel_implementationClassName1 = + _registerName1("implementationClassName"); + late final _sel_superclassDescription1 = + _registerName1("superclassDescription"); + ffi.Pointer _objc_msgSend_552( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_552( + obj, + sel, + ); + } + + late final __objc_msgSend_552Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_552 = __objc_msgSend_552Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_appleEventCode1 = _registerName1("appleEventCode"); + late final _sel_matchesAppleEventCode_1 = + _registerName1("matchesAppleEventCode:"); + late final _class_NSScriptCommandDescription1 = + _getClass1("NSScriptCommandDescription"); + late final _sel_initWithSuiteName_commandName_dictionary_1 = + _registerName1("initWithSuiteName:commandName:dictionary:"); + late final _sel_commandName1 = _registerName1("commandName"); + late final _sel_appleEventClassCode1 = _registerName1("appleEventClassCode"); + late final _sel_commandClassName1 = _registerName1("commandClassName"); + late final _sel_returnType1 = _registerName1("returnType"); + late final _sel_appleEventCodeForReturnType1 = + _registerName1("appleEventCodeForReturnType"); + late final _sel_argumentNames1 = _registerName1("argumentNames"); + late final _sel_typeForArgumentWithName_1 = + _registerName1("typeForArgumentWithName:"); + late final _sel_appleEventCodeForArgumentWithName_1 = + _registerName1("appleEventCodeForArgumentWithName:"); + int _objc_msgSend_553( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer argumentName, + ) { + return __objc_msgSend_553( + obj, + sel, + argumentName, + ); + } + + late final __objc_msgSend_553Ptr = _lookup< + ffi.NativeFunction< + FourCharCode Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_553 = __objc_msgSend_553Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_isOptionalArgumentWithName_1 = + _registerName1("isOptionalArgumentWithName:"); + late final _class_NSScriptCommand1 = _getClass1("NSScriptCommand"); + late final _sel_initWithCommandDescription_1 = + _registerName1("initWithCommandDescription:"); + instancetype _objc_msgSend_554( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer commandDef, + ) { + return __objc_msgSend_554( + obj, + sel, + commandDef, + ); + } + + late final __objc_msgSend_554Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_554 = __objc_msgSend_554Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_commandDescription1 = _registerName1("commandDescription"); + ffi.Pointer _objc_msgSend_555( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_555( + obj, + sel, + ); + } + + late final __objc_msgSend_555Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_555 = __objc_msgSend_555Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_directParameter1 = _registerName1("directParameter"); + late final _sel_setDirectParameter_1 = _registerName1("setDirectParameter:"); + late final _sel_receiversSpecifier1 = _registerName1("receiversSpecifier"); + ffi.Pointer _objc_msgSend_556( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_556( + obj, + sel, + ); + } + + late final __objc_msgSend_556Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_556 = __objc_msgSend_556Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setReceiversSpecifier_1 = + _registerName1("setReceiversSpecifier:"); + void _objc_msgSend_557( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_557( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_557Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_557 = __objc_msgSend_557Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_evaluatedReceivers1 = _registerName1("evaluatedReceivers"); + late final _sel_arguments1 = _registerName1("arguments"); + late final _sel_setArguments_1 = _registerName1("setArguments:"); + late final _sel_evaluatedArguments1 = _registerName1("evaluatedArguments"); + late final _sel_isWellFormed1 = _registerName1("isWellFormed"); + late final _sel_performDefaultImplementation1 = + _registerName1("performDefaultImplementation"); + late final _sel_executeCommand1 = _registerName1("executeCommand"); + late final _sel_scriptErrorNumber1 = _registerName1("scriptErrorNumber"); + late final _sel_setScriptErrorNumber_1 = + _registerName1("setScriptErrorNumber:"); + void _objc_msgSend_558( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_558( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_558Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_558 = __objc_msgSend_558Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_scriptErrorOffendingObjectDescriptor1 = + _registerName1("scriptErrorOffendingObjectDescriptor"); + late final _sel_setScriptErrorOffendingObjectDescriptor_1 = + _registerName1("setScriptErrorOffendingObjectDescriptor:"); + void _objc_msgSend_559( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_559( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_559Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_559 = __objc_msgSend_559Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scriptErrorExpectedTypeDescriptor1 = + _registerName1("scriptErrorExpectedTypeDescriptor"); + late final _sel_setScriptErrorExpectedTypeDescriptor_1 = + _registerName1("setScriptErrorExpectedTypeDescriptor:"); + late final _sel_scriptErrorString1 = _registerName1("scriptErrorString"); + late final _sel_setScriptErrorString_1 = + _registerName1("setScriptErrorString:"); + late final _sel_currentCommand1 = _registerName1("currentCommand"); + ffi.Pointer _objc_msgSend_560( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_560( + obj, + sel, + ); + } + + late final __objc_msgSend_560Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_560 = __objc_msgSend_560Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_appleEvent1 = _registerName1("appleEvent"); + late final _sel_suspendExecution1 = _registerName1("suspendExecution"); + late final _sel_resumeExecutionWithResult_1 = + _registerName1("resumeExecutionWithResult:"); + late final _sel_createCommandInstance1 = + _registerName1("createCommandInstance"); + late final _sel_createCommandInstanceWithZone_1 = + _registerName1("createCommandInstanceWithZone:"); + ffi.Pointer _objc_msgSend_561( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer zone, + ) { + return __objc_msgSend_561( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_561Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_561 = __objc_msgSend_561Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_supportsCommand_1 = _registerName1("supportsCommand:"); + bool _objc_msgSend_562( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer commandDescription, + ) { + return __objc_msgSend_562( + obj, + sel, + commandDescription, + ); + } + + late final __objc_msgSend_562Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_562 = __objc_msgSend_562Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_selectorForCommand_1 = _registerName1("selectorForCommand:"); + ffi.Pointer _objc_msgSend_563( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer commandDescription, + ) { + return __objc_msgSend_563( + obj, + sel, + commandDescription, + ); + } + + late final __objc_msgSend_563Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_563 = __objc_msgSend_563Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_typeForKey_1 = _registerName1("typeForKey:"); + late final _sel_classDescriptionForKey_1 = + _registerName1("classDescriptionForKey:"); + ffi.Pointer _objc_msgSend_564( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_564( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_564Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_564 = __objc_msgSend_564Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_appleEventCodeForKey_1 = + _registerName1("appleEventCodeForKey:"); + late final _sel_keyWithAppleEventCode_1 = + _registerName1("keyWithAppleEventCode:"); + ffi.Pointer _objc_msgSend_565( + ffi.Pointer obj, + ffi.Pointer sel, + int appleEventCode, + ) { + return __objc_msgSend_565( + obj, + sel, + appleEventCode, + ); + } + + late final __objc_msgSend_565Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, FourCharCode)>>('objc_msgSend'); + late final __objc_msgSend_565 = __objc_msgSend_565Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_defaultSubcontainerAttributeKey1 = + _registerName1("defaultSubcontainerAttributeKey"); + late final _sel_isLocationRequiredToCreateForKey_1 = + _registerName1("isLocationRequiredToCreateForKey:"); + late final _sel_hasPropertyForKey_1 = _registerName1("hasPropertyForKey:"); + late final _sel_hasOrderedToManyRelationshipForKey_1 = + _registerName1("hasOrderedToManyRelationshipForKey:"); + late final _sel_hasReadablePropertyForKey_1 = + _registerName1("hasReadablePropertyForKey:"); + late final _sel_hasWritablePropertyForKey_1 = + _registerName1("hasWritablePropertyForKey:"); + late final _sel_isReadOnlyKey_1 = _registerName1("isReadOnlyKey:"); + late final _sel_initWithContainerClassDescription_containerSpecifier_key_1 = + _registerName1( + "initWithContainerClassDescription:containerSpecifier:key:"); + instancetype _objc_msgSend_566( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer classDesc, + ffi.Pointer container, + ffi.Pointer property, + ) { + return __objc_msgSend_566( + obj, + sel, + classDesc, + container, + property, + ); + } + + late final __objc_msgSend_566Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_566 = __objc_msgSend_566Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_childSpecifier1 = _registerName1("childSpecifier"); + late final _sel_setChildSpecifier_1 = _registerName1("setChildSpecifier:"); + late final _sel_containerSpecifier1 = _registerName1("containerSpecifier"); + late final _sel_setContainerSpecifier_1 = + _registerName1("setContainerSpecifier:"); + late final _sel_containerIsObjectBeingTested1 = + _registerName1("containerIsObjectBeingTested"); + late final _sel_setContainerIsObjectBeingTested_1 = + _registerName1("setContainerIsObjectBeingTested:"); + late final _sel_containerIsRangeContainerObject1 = + _registerName1("containerIsRangeContainerObject"); + late final _sel_setContainerIsRangeContainerObject_1 = + _registerName1("setContainerIsRangeContainerObject:"); + late final _sel_key1 = _registerName1("key"); + late final _sel_setKey_1 = _registerName1("setKey:"); + late final _sel_containerClassDescription1 = + _registerName1("containerClassDescription"); + late final _sel_setContainerClassDescription_1 = + _registerName1("setContainerClassDescription:"); + void _objc_msgSend_567( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_567( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_567Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_567 = __objc_msgSend_567Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_keyClassDescription1 = _registerName1("keyClassDescription"); + late final _sel_indicesOfObjectsByEvaluatingWithContainer_count_1 = + _registerName1("indicesOfObjectsByEvaluatingWithContainer:count:"); + ffi.Pointer _objc_msgSend_568( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer container, + ffi.Pointer count, + ) { + return __objc_msgSend_568( + obj, + sel, + container, + count, + ); + } + + late final __objc_msgSend_568Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_568 = __objc_msgSend_568Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_objectsByEvaluatingWithContainers_1 = + _registerName1("objectsByEvaluatingWithContainers:"); + late final _sel_objectsByEvaluatingSpecifier1 = + _registerName1("objectsByEvaluatingSpecifier"); + late final _sel_evaluationErrorNumber1 = + _registerName1("evaluationErrorNumber"); + late final _sel_setEvaluationErrorNumber_1 = + _registerName1("setEvaluationErrorNumber:"); + late final _sel_evaluationErrorSpecifier1 = + _registerName1("evaluationErrorSpecifier"); + late final _sel_descriptor1 = _registerName1("descriptor"); + late final _sel_scriptingValueForSpecifier_1 = + _registerName1("scriptingValueForSpecifier:"); + ffi.Pointer _objc_msgSend_569( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer objectSpecifier, + ) { + return __objc_msgSend_569( + obj, + sel, + objectSpecifier, + ); + } + + late final __objc_msgSend_569Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_569 = __objc_msgSend_569Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_scriptingProperties1 = _registerName1("scriptingProperties"); + late final _sel_setScriptingProperties_1 = + _registerName1("setScriptingProperties:"); + late final _sel_copyScriptingValue_forKey_withProperties_1 = + _registerName1("copyScriptingValue:forKey:withProperties:"); + ffi.Pointer _objc_msgSend_570( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ffi.Pointer key, + ffi.Pointer properties, + ) { + return __objc_msgSend_570( + obj, + sel, + value, + key, + properties, + ); + } + + late final __objc_msgSend_570Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_570 = __objc_msgSend_570Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_newScriptingObjectOfClass_forValueForKey_withContentsValue_properties_1 = + _registerName1( + "newScriptingObjectOfClass:forValueForKey:withContentsValue:properties:"); + ffi.Pointer _objc_msgSend_571( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer objectClass, + ffi.Pointer key, + ffi.Pointer contentsValue, + ffi.Pointer properties, + ) { + return __objc_msgSend_571( + obj, + sel, + objectClass, + key, + contentsValue, + properties, + ); + } + + late final __objc_msgSend_571Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_571 = __objc_msgSend_571Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_classCode1 = _registerName1("classCode"); + late final _sel_valueAtIndex_inPropertyWithKey_1 = + _registerName1("valueAtIndex:inPropertyWithKey:"); + ffi.Pointer _objc_msgSend_572( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer key, + ) { + return __objc_msgSend_572( + obj, + sel, + index, + key, + ); + } + + late final __objc_msgSend_572Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_572 = __objc_msgSend_572Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_valueWithName_inPropertyWithKey_1 = + _registerName1("valueWithName:inPropertyWithKey:"); + late final _sel_valueWithUniqueID_inPropertyWithKey_1 = + _registerName1("valueWithUniqueID:inPropertyWithKey:"); + late final _sel_insertValue_atIndex_inPropertyWithKey_1 = + _registerName1("insertValue:atIndex:inPropertyWithKey:"); + void _objc_msgSend_573( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + int index, + ffi.Pointer key, + ) { + return __objc_msgSend_573( + obj, + sel, + value, + index, + key, + ); + } + + late final __objc_msgSend_573Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_573 = __objc_msgSend_573Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_removeValueAtIndex_fromPropertyWithKey_1 = + _registerName1("removeValueAtIndex:fromPropertyWithKey:"); + void _objc_msgSend_574( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer key, + ) { + return __objc_msgSend_574( + obj, + sel, + index, + key, + ); + } + + late final __objc_msgSend_574Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_574 = __objc_msgSend_574Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_replaceValueAtIndex_inPropertyWithKey_withValue_1 = + _registerName1("replaceValueAtIndex:inPropertyWithKey:withValue:"); + void _objc_msgSend_575( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer key, + ffi.Pointer value, + ) { + return __objc_msgSend_575( + obj, + sel, + index, + key, + value, + ); + } + + late final __objc_msgSend_575Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_575 = __objc_msgSend_575Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_insertValue_inPropertyWithKey_1 = + _registerName1("insertValue:inPropertyWithKey:"); + late final _sel_coerceValue_forKey_1 = _registerName1("coerceValue:forKey:"); + late final _sel_objectSpecifier1 = _registerName1("objectSpecifier"); + late final _sel_indicesOfObjectsByEvaluatingObjectSpecifier_1 = + _registerName1("indicesOfObjectsByEvaluatingObjectSpecifier:"); + ffi.Pointer _objc_msgSend_576( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer specifier, + ) { + return __objc_msgSend_576( + obj, + sel, + specifier, + ); + } + + late final __objc_msgSend_576Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_576 = __objc_msgSend_576Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isEqualTo_1 = _registerName1("isEqualTo:"); + late final _sel_isLessThanOrEqualTo_1 = + _registerName1("isLessThanOrEqualTo:"); + late final _sel_isLessThan_1 = _registerName1("isLessThan:"); + late final _sel_isGreaterThanOrEqualTo_1 = + _registerName1("isGreaterThanOrEqualTo:"); + late final _sel_isGreaterThan_1 = _registerName1("isGreaterThan:"); + late final _sel_isNotEqualTo_1 = _registerName1("isNotEqualTo:"); + late final _sel_doesContain_1 = _registerName1("doesContain:"); + late final _sel_isLike_1 = _registerName1("isLike:"); + late final _sel_isCaseInsensitiveLike_1 = + _registerName1("isCaseInsensitiveLike:"); + late final _sel_scriptingIsEqualTo_1 = _registerName1("scriptingIsEqualTo:"); + late final _sel_scriptingIsLessThanOrEqualTo_1 = + _registerName1("scriptingIsLessThanOrEqualTo:"); + late final _sel_scriptingIsLessThan_1 = + _registerName1("scriptingIsLessThan:"); + late final _sel_scriptingIsGreaterThanOrEqualTo_1 = + _registerName1("scriptingIsGreaterThanOrEqualTo:"); + late final _sel_scriptingIsGreaterThan_1 = + _registerName1("scriptingIsGreaterThan:"); + late final _sel_scriptingBeginsWith_1 = + _registerName1("scriptingBeginsWith:"); + late final _sel_scriptingEndsWith_1 = _registerName1("scriptingEndsWith:"); + late final _sel_scriptingContains_1 = _registerName1("scriptingContains:"); + late final _class_NSItemProvider1 = _getClass1("NSItemProvider"); + late final _class_NSProgress1 = _getClass1("NSProgress"); + late final _sel_currentProgress1 = _registerName1("currentProgress"); + ffi.Pointer _objc_msgSend_577( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_577( + obj, + sel, + ); + } + + late final __objc_msgSend_577Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_577 = __objc_msgSend_577Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_progressWithTotalUnitCount_1 = + _registerName1("progressWithTotalUnitCount:"); + ffi.Pointer _objc_msgSend_578( + ffi.Pointer obj, + ffi.Pointer sel, + int unitCount, + ) { + return __objc_msgSend_578( + obj, + sel, + unitCount, + ); + } + + late final __objc_msgSend_578Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int64)>>('objc_msgSend'); + late final __objc_msgSend_578 = __objc_msgSend_578Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_discreteProgressWithTotalUnitCount_1 = + _registerName1("discreteProgressWithTotalUnitCount:"); + late final _sel_progressWithTotalUnitCount_parent_pendingUnitCount_1 = + _registerName1("progressWithTotalUnitCount:parent:pendingUnitCount:"); + ffi.Pointer _objc_msgSend_579( + ffi.Pointer obj, + ffi.Pointer sel, + int unitCount, + ffi.Pointer parent, + int portionOfParentTotalUnitCount, + ) { + return __objc_msgSend_579( + obj, + sel, + unitCount, + parent, + portionOfParentTotalUnitCount, + ); + } + + late final __objc_msgSend_579Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer, + ffi.Int64)>>('objc_msgSend'); + late final __objc_msgSend_579 = __objc_msgSend_579Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer, int)>(); + + late final _sel_initWithParent_userInfo_1 = + _registerName1("initWithParent:userInfo:"); + instancetype _objc_msgSend_580( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer parentProgressOrNil, + ) { + return __objc_msgSend_580( + obj, + sel, + parentProgressOrNil, + ); + } + + late final __objc_msgSend_580Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_580 = __objc_msgSend_580Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_becomeCurrentWithPendingUnitCount_1 = + _registerName1("becomeCurrentWithPendingUnitCount:"); + void _objc_msgSend_581( + ffi.Pointer obj, + ffi.Pointer sel, + int unitCount, + ) { + return __objc_msgSend_581( + obj, + sel, + unitCount, + ); + } + + late final __objc_msgSend_581Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int64)>>('objc_msgSend'); + late final __objc_msgSend_581 = __objc_msgSend_581Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_performAsCurrentWithPendingUnitCount_usingBlock_1 = + _registerName1("performAsCurrentWithPendingUnitCount:usingBlock:"); + void _objc_msgSend_582( + ffi.Pointer obj, + ffi.Pointer sel, + int unitCount, + ffi.Pointer<_ObjCBlock> work, + ) { + return __objc_msgSend_582( + obj, + sel, + unitCount, + work, + ); + } + + late final __objc_msgSend_582Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int64, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_582 = __objc_msgSend_582Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_resignCurrent1 = _registerName1("resignCurrent"); + late final _sel_addChild_withPendingUnitCount_1 = + _registerName1("addChild:withPendingUnitCount:"); + void _objc_msgSend_583( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer child, + int inUnitCount, + ) { + return __objc_msgSend_583( + obj, + sel, + child, + inUnitCount, + ); + } + + late final __objc_msgSend_583Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int64)>>('objc_msgSend'); + late final __objc_msgSend_583 = __objc_msgSend_583Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_totalUnitCount1 = _registerName1("totalUnitCount"); + int _objc_msgSend_584( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_584( + obj, + sel, + ); + } + + late final __objc_msgSend_584Ptr = _lookup< + ffi.NativeFunction< + ffi.Int64 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_584 = __objc_msgSend_584Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setTotalUnitCount_1 = _registerName1("setTotalUnitCount:"); + void _objc_msgSend_585( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_585( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_585Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int64)>>('objc_msgSend'); + late final __objc_msgSend_585 = __objc_msgSend_585Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_completedUnitCount1 = _registerName1("completedUnitCount"); + late final _sel_setCompletedUnitCount_1 = + _registerName1("setCompletedUnitCount:"); + late final _sel_localizedDescription1 = + _registerName1("localizedDescription"); + late final _sel_setLocalizedDescription_1 = + _registerName1("setLocalizedDescription:"); + late final _sel_localizedAdditionalDescription1 = + _registerName1("localizedAdditionalDescription"); + late final _sel_setLocalizedAdditionalDescription_1 = + _registerName1("setLocalizedAdditionalDescription:"); + late final _sel_isCancellable1 = _registerName1("isCancellable"); + late final _sel_setCancellable_1 = _registerName1("setCancellable:"); + late final _sel_isPausable1 = _registerName1("isPausable"); + late final _sel_setPausable_1 = _registerName1("setPausable:"); + late final _sel_isPaused1 = _registerName1("isPaused"); + late final _sel_cancellationHandler1 = _registerName1("cancellationHandler"); + ffi.Pointer<_ObjCBlock> _objc_msgSend_586( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_586( + obj, + sel, + ); + } + + late final __objc_msgSend_586Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_586 = __objc_msgSend_586Ptr.asFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setCancellationHandler_1 = + _registerName1("setCancellationHandler:"); + void _objc_msgSend_587( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> value, + ) { + return __objc_msgSend_587( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_587Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_587 = __objc_msgSend_587Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_pausingHandler1 = _registerName1("pausingHandler"); + late final _sel_setPausingHandler_1 = _registerName1("setPausingHandler:"); + late final _sel_resumingHandler1 = _registerName1("resumingHandler"); + late final _sel_setResumingHandler_1 = _registerName1("setResumingHandler:"); + late final _sel_setUserInfoObject_forKey_1 = + _registerName1("setUserInfoObject:forKey:"); + late final _sel_isIndeterminate1 = _registerName1("isIndeterminate"); + late final _sel_fractionCompleted1 = _registerName1("fractionCompleted"); + late final _sel_pause1 = _registerName1("pause"); + late final _sel_resume1 = _registerName1("resume"); + late final _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1 = + _registerName1( + "registerDataRepresentationForTypeIdentifier:visibility:loadHandler:"); + void _objc_msgSend_588( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + int visibility, + ffi.Pointer<_ObjCBlock> loadHandler, + ) { + return __objc_msgSend_588( + obj, + sel, + typeIdentifier, + visibility, + loadHandler, + ); + } + + late final __objc_msgSend_588Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_588 = __objc_msgSend_588Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1 = + _registerName1( + "registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:"); + void _objc_msgSend_589( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + int fileOptions, + int visibility, + ffi.Pointer<_ObjCBlock> loadHandler, + ) { + return __objc_msgSend_589( + obj, + sel, + typeIdentifier, + fileOptions, + visibility, + loadHandler, + ); + } + + late final __objc_msgSend_589Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_589 = __objc_msgSend_589Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_registeredTypeIdentifiers1 = + _registerName1("registeredTypeIdentifiers"); + late final _sel_registeredTypeIdentifiersWithFileOptions_1 = + _registerName1("registeredTypeIdentifiersWithFileOptions:"); + ffi.Pointer _objc_msgSend_590( + ffi.Pointer obj, + ffi.Pointer sel, + int fileOptions, + ) { + return __objc_msgSend_590( + obj, + sel, + fileOptions, + ); + } + + late final __objc_msgSend_590Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_590 = __objc_msgSend_590Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_hasItemConformingToTypeIdentifier_1 = + _registerName1("hasItemConformingToTypeIdentifier:"); + late final _sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1 = + _registerName1( + "hasRepresentationConformingToTypeIdentifier:fileOptions:"); + bool _objc_msgSend_591( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + int fileOptions, + ) { + return __objc_msgSend_591( + obj, + sel, + typeIdentifier, + fileOptions, + ); + } + + late final __objc_msgSend_591Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_591 = __objc_msgSend_591Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_loadDataRepresentationForTypeIdentifier_completionHandler_1 = + _registerName1( + "loadDataRepresentationForTypeIdentifier:completionHandler:"); + ffi.Pointer _objc_msgSend_592( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_592( + obj, + sel, + typeIdentifier, + completionHandler, + ); + } + + late final __objc_msgSend_592Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_592 = __objc_msgSend_592Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_loadFileRepresentationForTypeIdentifier_completionHandler_1 = + _registerName1( + "loadFileRepresentationForTypeIdentifier:completionHandler:"); + ffi.Pointer _objc_msgSend_593( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_593( + obj, + sel, + typeIdentifier, + completionHandler, + ); + } + + late final __objc_msgSend_593Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_593 = __objc_msgSend_593Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1 = + _registerName1( + "loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:"); + ffi.Pointer _objc_msgSend_594( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_594( + obj, + sel, + typeIdentifier, + completionHandler, + ); + } + + late final __objc_msgSend_594Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_594 = __objc_msgSend_594Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_suggestedName1 = _registerName1("suggestedName"); + late final _sel_setSuggestedName_1 = _registerName1("setSuggestedName:"); + late final _sel_registerObject_visibility_1 = + _registerName1("registerObject:visibility:"); + void _objc_msgSend_595( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer object, + int visibility, + ) { + return __objc_msgSend_595( + obj, + sel, + object, + visibility, + ); + } + + late final __objc_msgSend_595Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_595 = __objc_msgSend_595Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_registerObjectOfClass_visibility_loadHandler_1 = + _registerName1("registerObjectOfClass:visibility:loadHandler:"); + void _objc_msgSend_596( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + int visibility, + ffi.Pointer<_ObjCBlock> loadHandler, + ) { + return __objc_msgSend_596( + obj, + sel, + aClass, + visibility, + loadHandler, + ); + } + + late final __objc_msgSend_596Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_596 = __objc_msgSend_596Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_canLoadObjectOfClass_1 = + _registerName1("canLoadObjectOfClass:"); + late final _sel_loadObjectOfClass_completionHandler_1 = + _registerName1("loadObjectOfClass:completionHandler:"); + ffi.Pointer _objc_msgSend_597( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_597( + obj, + sel, + aClass, + completionHandler, + ); + } + + late final __objc_msgSend_597Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_597 = __objc_msgSend_597Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_initWithItem_typeIdentifier_1 = + _registerName1("initWithItem:typeIdentifier:"); + late final _sel_registerItemForTypeIdentifier_loadHandler_1 = + _registerName1("registerItemForTypeIdentifier:loadHandler:"); + void _objc_msgSend_598( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + NSItemProviderLoadHandler loadHandler, + ) { + return __objc_msgSend_598( + obj, + sel, + typeIdentifier, + loadHandler, + ); + } + + late final __objc_msgSend_598Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderLoadHandler)>>('objc_msgSend'); + late final __objc_msgSend_598 = __objc_msgSend_598Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSItemProviderLoadHandler)>(); + + late final _sel_loadItemForTypeIdentifier_options_completionHandler_1 = + _registerName1("loadItemForTypeIdentifier:options:completionHandler:"); + void _objc_msgSend_599( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer options, + NSItemProviderCompletionHandler completionHandler, + ) { + return __objc_msgSend_599( + obj, + sel, + typeIdentifier, + options, + completionHandler, + ); + } + + late final __objc_msgSend_599Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler)>>('objc_msgSend'); + late final __objc_msgSend_599 = __objc_msgSend_599Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler)>(); + + late final _sel_previewImageHandler1 = _registerName1("previewImageHandler"); + NSItemProviderLoadHandler _objc_msgSend_600( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_600( + obj, + sel, + ); + } + + late final __objc_msgSend_600Ptr = _lookup< + ffi.NativeFunction< + NSItemProviderLoadHandler Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_600 = __objc_msgSend_600Ptr.asFunction< + NSItemProviderLoadHandler Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setPreviewImageHandler_1 = + _registerName1("setPreviewImageHandler:"); + void _objc_msgSend_601( + ffi.Pointer obj, + ffi.Pointer sel, + NSItemProviderLoadHandler value, + ) { + return __objc_msgSend_601( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_601Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSItemProviderLoadHandler)>>('objc_msgSend'); + late final __objc_msgSend_601 = __objc_msgSend_601Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + NSItemProviderLoadHandler)>(); + + late final _sel_loadPreviewImageWithOptions_completionHandler_1 = + _registerName1("loadPreviewImageWithOptions:completionHandler:"); + void _objc_msgSend_602( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer options, + NSItemProviderCompletionHandler completionHandler, + ) { + return __objc_msgSend_602( + obj, + sel, + options, + completionHandler, + ); + } + + late final __objc_msgSend_602Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler)>>('objc_msgSend'); + late final __objc_msgSend_602 = __objc_msgSend_602Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSItemProviderCompletionHandler)>(); + + late final _class_NSMutableString1 = _getClass1("NSMutableString"); + late final _sel_replaceCharactersInRange_withString_1 = + _registerName1("replaceCharactersInRange:withString:"); + void _objc_msgSend_603( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer aString, + ) { + return __objc_msgSend_603( + obj, + sel, + range, + aString, + ); + } + + late final __objc_msgSend_603Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_603 = __objc_msgSend_603Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, + ffi.Pointer)>(); + + late final _sel_insertString_atIndex_1 = + _registerName1("insertString:atIndex:"); + void _objc_msgSend_604( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aString, + int loc, + ) { + return __objc_msgSend_604( + obj, + sel, + aString, + loc, + ); + } + + late final __objc_msgSend_604Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_604 = __objc_msgSend_604Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_deleteCharactersInRange_1 = + _registerName1("deleteCharactersInRange:"); + late final _sel_appendString_1 = _registerName1("appendString:"); + late final _sel_appendFormat_1 = _registerName1("appendFormat:"); + late final _sel_setString_1 = _registerName1("setString:"); + late final _sel_replaceOccurrencesOfString_withString_options_range_1 = + _registerName1("replaceOccurrencesOfString:withString:options:range:"); + int _objc_msgSend_605( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer target, + ffi.Pointer replacement, + int options, + NSRange searchRange, + ) { + return __objc_msgSend_605( + obj, + sel, + target, + replacement, + options, + searchRange, + ); + } + + late final __objc_msgSend_605Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_605 = __objc_msgSend_605Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, NSRange)>(); + + late final _sel_applyTransform_reverse_range_updatedRange_1 = + _registerName1("applyTransform:reverse:range:updatedRange:"); + bool _objc_msgSend_606( + ffi.Pointer obj, + ffi.Pointer sel, + NSStringTransform transform, + bool reverse, + NSRange range, + NSRangePointer resultingRange, + ) { + return __objc_msgSend_606( + obj, + sel, + transform, + reverse, + range, + resultingRange, + ); + } + + late final __objc_msgSend_606Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + NSStringTransform, + ffi.Bool, + NSRange, + NSRangePointer)>>('objc_msgSend'); + late final __objc_msgSend_606 = __objc_msgSend_606Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + NSStringTransform, bool, NSRange, NSRangePointer)>(); + + ffi.Pointer _objc_msgSend_607( + ffi.Pointer obj, + ffi.Pointer sel, + int capacity, + ) { + return __objc_msgSend_607( + obj, + sel, + capacity, + ); + } + + late final __objc_msgSend_607Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_607 = __objc_msgSend_607Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_stringWithCapacity_1 = _registerName1("stringWithCapacity:"); + late final _class_NSNotification1 = _getClass1("NSNotification"); + late final _sel_object1 = _registerName1("object"); + late final _sel_initWithName_object_userInfo_1 = + _registerName1("initWithName:object:userInfo:"); + instancetype _objc_msgSend_608( + ffi.Pointer obj, + ffi.Pointer sel, + NSNotificationName name, + ffi.Pointer object, + ffi.Pointer userInfo, + ) { + return __objc_msgSend_608( + obj, + sel, + name, + object, + userInfo, + ); + } + + late final __objc_msgSend_608Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + NSNotificationName, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_608 = __objc_msgSend_608Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + NSNotificationName, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_notificationWithName_object_1 = + _registerName1("notificationWithName:object:"); + late final _sel_notificationWithName_object_userInfo_1 = + _registerName1("notificationWithName:object:userInfo:"); + late final _class_NSBundle1 = _getClass1("NSBundle"); + late final _sel_mainBundle1 = _registerName1("mainBundle"); + ffi.Pointer _objc_msgSend_609( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_609( + obj, + sel, + ); + } + + late final __objc_msgSend_609Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_609 = __objc_msgSend_609Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_bundleWithPath_1 = _registerName1("bundleWithPath:"); + late final _sel_initWithPath_1 = _registerName1("initWithPath:"); + late final _sel_bundleWithURL_1 = _registerName1("bundleWithURL:"); + late final _sel_initWithURL_1 = _registerName1("initWithURL:"); + late final _sel_bundleForClass_1 = _registerName1("bundleForClass:"); + ffi.Pointer _objc_msgSend_610( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ) { + return __objc_msgSend_610( + obj, + sel, + aClass, + ); + } + + late final __objc_msgSend_610Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_610 = __objc_msgSend_610Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_bundleWithIdentifier_1 = + _registerName1("bundleWithIdentifier:"); + ffi.Pointer _objc_msgSend_611( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer identifier, + ) { + return __objc_msgSend_611( + obj, + sel, + identifier, + ); + } + + late final __objc_msgSend_611Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_611 = __objc_msgSend_611Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_allBundles1 = _registerName1("allBundles"); + late final _sel_allFrameworks1 = _registerName1("allFrameworks"); + late final _sel_isLoaded1 = _registerName1("isLoaded"); + late final _sel_unload1 = _registerName1("unload"); + late final _sel_preflightAndReturnError_1 = + _registerName1("preflightAndReturnError:"); + late final _sel_loadAndReturnError_1 = _registerName1("loadAndReturnError:"); + late final _sel_bundleURL1 = _registerName1("bundleURL"); + late final _sel_resourceURL1 = _registerName1("resourceURL"); + late final _sel_executableURL1 = _registerName1("executableURL"); + late final _sel_URLForAuxiliaryExecutable_1 = + _registerName1("URLForAuxiliaryExecutable:"); + late final _sel_privateFrameworksURL1 = + _registerName1("privateFrameworksURL"); + late final _sel_sharedFrameworksURL1 = _registerName1("sharedFrameworksURL"); + late final _sel_sharedSupportURL1 = _registerName1("sharedSupportURL"); + late final _sel_builtInPlugInsURL1 = _registerName1("builtInPlugInsURL"); + late final _sel_appStoreReceiptURL1 = _registerName1("appStoreReceiptURL"); + late final _sel_bundlePath1 = _registerName1("bundlePath"); + late final _sel_resourcePath1 = _registerName1("resourcePath"); + late final _sel_executablePath1 = _registerName1("executablePath"); + late final _sel_pathForAuxiliaryExecutable_1 = + _registerName1("pathForAuxiliaryExecutable:"); + late final _sel_privateFrameworksPath1 = + _registerName1("privateFrameworksPath"); + late final _sel_sharedFrameworksPath1 = + _registerName1("sharedFrameworksPath"); + late final _sel_sharedSupportPath1 = _registerName1("sharedSupportPath"); + late final _sel_builtInPlugInsPath1 = _registerName1("builtInPlugInsPath"); + late final _sel_URLForResource_withExtension_subdirectory_inBundleWithURL_1 = + _registerName1( + "URLForResource:withExtension:subdirectory:inBundleWithURL:"); + ffi.Pointer _objc_msgSend_612( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer ext, + ffi.Pointer subpath, + ffi.Pointer bundleURL, + ) { + return __objc_msgSend_612( + obj, + sel, + name, + ext, + subpath, + bundleURL, + ); + } + + late final __objc_msgSend_612Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_612 = __objc_msgSend_612Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLsForResourcesWithExtension_subdirectory_inBundleWithURL_1 = + _registerName1( + "URLsForResourcesWithExtension:subdirectory:inBundleWithURL:"); + ffi.Pointer _objc_msgSend_613( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer ext, + ffi.Pointer subpath, + ffi.Pointer bundleURL, + ) { + return __objc_msgSend_613( + obj, + sel, + ext, + subpath, + bundleURL, + ); + } + + late final __objc_msgSend_613Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_613 = __objc_msgSend_613Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLForResource_withExtension_1 = + _registerName1("URLForResource:withExtension:"); + ffi.Pointer _objc_msgSend_614( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer ext, + ) { + return __objc_msgSend_614( + obj, + sel, + name, + ext, + ); + } + + late final __objc_msgSend_614Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_614 = __objc_msgSend_614Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLForResource_withExtension_subdirectory_1 = + _registerName1("URLForResource:withExtension:subdirectory:"); + ffi.Pointer _objc_msgSend_615( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer ext, + ffi.Pointer subpath, + ) { + return __objc_msgSend_615( + obj, + sel, + name, + ext, + subpath, + ); + } + + late final __objc_msgSend_615Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_615 = __objc_msgSend_615Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLForResource_withExtension_subdirectory_localization_1 = + _registerName1("URLForResource:withExtension:subdirectory:localization:"); + ffi.Pointer _objc_msgSend_616( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer ext, + ffi.Pointer subpath, + ffi.Pointer localizationName, + ) { + return __objc_msgSend_616( + obj, + sel, + name, + ext, + subpath, + localizationName, + ); + } + + late final __objc_msgSend_616Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_616 = __objc_msgSend_616Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLsForResourcesWithExtension_subdirectory_1 = + _registerName1("URLsForResourcesWithExtension:subdirectory:"); + ffi.Pointer _objc_msgSend_617( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer ext, + ffi.Pointer subpath, + ) { + return __objc_msgSend_617( + obj, + sel, + ext, + subpath, + ); + } + + late final __objc_msgSend_617Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_617 = __objc_msgSend_617Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLsForResourcesWithExtension_subdirectory_localization_1 = + _registerName1( + "URLsForResourcesWithExtension:subdirectory:localization:"); + ffi.Pointer _objc_msgSend_618( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer ext, + ffi.Pointer subpath, + ffi.Pointer localizationName, + ) { + return __objc_msgSend_618( + obj, + sel, + ext, + subpath, + localizationName, + ); + } + + late final __objc_msgSend_618Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_618 = __objc_msgSend_618Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_pathForResource_ofType_inDirectory_1 = + _registerName1("pathForResource:ofType:inDirectory:"); + ffi.Pointer _objc_msgSend_619( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer ext, + ffi.Pointer bundlePath, + ) { + return __objc_msgSend_619( + obj, + sel, + name, + ext, + bundlePath, + ); + } + + late final __objc_msgSend_619Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_619 = __objc_msgSend_619Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_pathsForResourcesOfType_inDirectory_1 = + _registerName1("pathsForResourcesOfType:inDirectory:"); + late final _sel_pathForResource_ofType_1 = + _registerName1("pathForResource:ofType:"); + late final _sel_pathForResource_ofType_inDirectory_forLocalization_1 = + _registerName1("pathForResource:ofType:inDirectory:forLocalization:"); + ffi.Pointer _objc_msgSend_620( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer ext, + ffi.Pointer subpath, + ffi.Pointer localizationName, + ) { + return __objc_msgSend_620( + obj, + sel, + name, + ext, + subpath, + localizationName, + ); + } + + late final __objc_msgSend_620Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_620 = __objc_msgSend_620Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_pathsForResourcesOfType_inDirectory_forLocalization_1 = + _registerName1("pathsForResourcesOfType:inDirectory:forLocalization:"); + late final _sel_localizedStringForKey_value_table_1 = + _registerName1("localizedStringForKey:value:table:"); + late final _class_NSAttributedString1 = _getClass1("NSAttributedString"); + late final _sel_attributesAtIndex_effectiveRange_1 = + _registerName1("attributesAtIndex:effectiveRange:"); + ffi.Pointer _objc_msgSend_621( + ffi.Pointer obj, + ffi.Pointer sel, + int location, + NSRangePointer range, + ) { + return __objc_msgSend_621( + obj, + sel, + location, + range, + ); + } + + late final __objc_msgSend_621Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSRangePointer)>>('objc_msgSend'); + late final __objc_msgSend_621 = __objc_msgSend_621Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, NSRangePointer)>(); + + late final _sel_attribute_atIndex_effectiveRange_1 = + _registerName1("attribute:atIndex:effectiveRange:"); + ffi.Pointer _objc_msgSend_622( + ffi.Pointer obj, + ffi.Pointer sel, + NSAttributedStringKey attrName, + int location, + NSRangePointer range, + ) { + return __objc_msgSend_622( + obj, + sel, + attrName, + location, + range, + ); + } + + late final __objc_msgSend_622Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSAttributedStringKey, + NSUInteger, + NSRangePointer)>>('objc_msgSend'); + late final __objc_msgSend_622 = __objc_msgSend_622Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSAttributedStringKey, int, NSRangePointer)>(); + + late final _sel_attributedSubstringFromRange_1 = + _registerName1("attributedSubstringFromRange:"); + ffi.Pointer _objc_msgSend_623( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_623( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_623Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_623 = __objc_msgSend_623Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_attributesAtIndex_longestEffectiveRange_inRange_1 = + _registerName1("attributesAtIndex:longestEffectiveRange:inRange:"); + ffi.Pointer _objc_msgSend_624( + ffi.Pointer obj, + ffi.Pointer sel, + int location, + NSRangePointer range, + NSRange rangeLimit, + ) { + return __objc_msgSend_624( + obj, + sel, + location, + range, + rangeLimit, + ); + } + + late final __objc_msgSend_624Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSRangePointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_624 = __objc_msgSend_624Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, NSRangePointer, NSRange)>(); + + late final _sel_attribute_atIndex_longestEffectiveRange_inRange_1 = + _registerName1("attribute:atIndex:longestEffectiveRange:inRange:"); + ffi.Pointer _objc_msgSend_625( + ffi.Pointer obj, + ffi.Pointer sel, + NSAttributedStringKey attrName, + int location, + NSRangePointer range, + NSRange rangeLimit, + ) { + return __objc_msgSend_625( + obj, + sel, + attrName, + location, + range, + rangeLimit, + ); + } + + late final __objc_msgSend_625Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSAttributedStringKey, + NSUInteger, + NSRangePointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_625 = __objc_msgSend_625Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSAttributedStringKey, + int, + NSRangePointer, + NSRange)>(); + + late final _sel_isEqualToAttributedString_1 = + _registerName1("isEqualToAttributedString:"); + bool _objc_msgSend_626( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_626( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_626Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_626 = __objc_msgSend_626Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithString_attributes_1 = + _registerName1("initWithString:attributes:"); + late final _sel_initWithAttributedString_1 = + _registerName1("initWithAttributedString:"); + instancetype _objc_msgSend_627( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attrStr, + ) { + return __objc_msgSend_627( + obj, + sel, + attrStr, + ); + } + + late final __objc_msgSend_627Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_627 = __objc_msgSend_627Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_enumerateAttributesInRange_options_usingBlock_1 = + _registerName1("enumerateAttributesInRange:options:usingBlock:"); + void _objc_msgSend_628( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange enumerationRange, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_628( + obj, + sel, + enumerationRange, + opts, + block, + ); + } + + late final __objc_msgSend_628Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_628 = __objc_msgSend_628Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateAttribute_inRange_options_usingBlock_1 = + _registerName1("enumerateAttribute:inRange:options:usingBlock:"); + void _objc_msgSend_629( + ffi.Pointer obj, + ffi.Pointer sel, + NSAttributedStringKey attrName, + NSRange enumerationRange, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_629( + obj, + sel, + attrName, + enumerationRange, + opts, + block, + ); + } + + late final __objc_msgSend_629Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSAttributedStringKey, + NSRange, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_629 = __objc_msgSend_629Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + NSAttributedStringKey, NSRange, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _class_NSAttributedStringMarkdownParsingOptions1 = + _getClass1("NSAttributedStringMarkdownParsingOptions"); + late final _sel_allowsExtendedAttributes1 = + _registerName1("allowsExtendedAttributes"); + late final _sel_setAllowsExtendedAttributes_1 = + _registerName1("setAllowsExtendedAttributes:"); + late final _sel_interpretedSyntax1 = _registerName1("interpretedSyntax"); + int _objc_msgSend_630( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_630( + obj, + sel, + ); + } + + late final __objc_msgSend_630Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_630 = __objc_msgSend_630Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setInterpretedSyntax_1 = + _registerName1("setInterpretedSyntax:"); + void _objc_msgSend_631( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_631( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_631Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_631 = __objc_msgSend_631Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_failurePolicy1 = _registerName1("failurePolicy"); + int _objc_msgSend_632( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_632( + obj, + sel, + ); + } + + late final __objc_msgSend_632Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_632 = __objc_msgSend_632Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setFailurePolicy_1 = _registerName1("setFailurePolicy:"); + void _objc_msgSend_633( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_633( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_633Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_633 = __objc_msgSend_633Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_setLanguageCode_1 = _registerName1("setLanguageCode:"); + late final _sel_initWithContentsOfMarkdownFileAtURL_options_baseURL_error_1 = + _registerName1( + "initWithContentsOfMarkdownFileAtURL:options:baseURL:error:"); + instancetype _objc_msgSend_634( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer markdownFile, + ffi.Pointer options, + ffi.Pointer baseURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_634( + obj, + sel, + markdownFile, + options, + baseURL, + error, + ); + } + + late final __objc_msgSend_634Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_634 = __objc_msgSend_634Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_initWithMarkdown_options_baseURL_error_1 = + _registerName1("initWithMarkdown:options:baseURL:error:"); + instancetype _objc_msgSend_635( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer markdown, + ffi.Pointer options, + ffi.Pointer baseURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_635( + obj, + sel, + markdown, + options, + baseURL, + error, + ); + } + + late final __objc_msgSend_635Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_635 = __objc_msgSend_635Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_initWithMarkdownString_options_baseURL_error_1 = + _registerName1("initWithMarkdownString:options:baseURL:error:"); + instancetype _objc_msgSend_636( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer markdownString, + ffi.Pointer options, + ffi.Pointer baseURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_636( + obj, + sel, + markdownString, + options, + baseURL, + error, + ); + } + + late final __objc_msgSend_636Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_636 = __objc_msgSend_636Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_initWithFormat_options_locale_1 = + _registerName1("initWithFormat:options:locale:"); + instancetype _objc_msgSend_637( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + int options, + ffi.Pointer locale, + ) { + return __objc_msgSend_637( + obj, + sel, + format, + options, + locale, + ); + } + + late final __objc_msgSend_637Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_637 = __objc_msgSend_637Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_initWithFormat_options_locale_arguments_1 = + _registerName1("initWithFormat:options:locale:arguments:"); + instancetype _objc_msgSend_638( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + int options, + ffi.Pointer locale, + ffi.Pointer<__va_list_tag> arguments, + ) { + return __objc_msgSend_638( + obj, + sel, + format, + options, + locale, + arguments, + ); + } + + late final __objc_msgSend_638Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); + late final __objc_msgSend_638 = __objc_msgSend_638Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>(); + + late final _sel_localizedAttributedStringWithFormat_1 = + _registerName1("localizedAttributedStringWithFormat:"); + late final _sel_localizedAttributedStringWithFormat_options_1 = + _registerName1("localizedAttributedStringWithFormat:options:"); + instancetype _objc_msgSend_639( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + int options, + ) { + return __objc_msgSend_639( + obj, + sel, + format, + options, + ); + } + + late final __objc_msgSend_639Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_639 = __objc_msgSend_639Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_attributedStringByInflectingString1 = + _registerName1("attributedStringByInflectingString"); + ffi.Pointer _objc_msgSend_640( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_640( + obj, + sel, + ); + } + + late final __objc_msgSend_640Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_640 = __objc_msgSend_640Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_localizedAttributedStringForKey_value_table_1 = + _registerName1("localizedAttributedStringForKey:value:table:"); + ffi.Pointer _objc_msgSend_641( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ffi.Pointer value, + ffi.Pointer tableName, + ) { + return __objc_msgSend_641( + obj, + sel, + key, + value, + tableName, + ); + } + + late final __objc_msgSend_641Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_641 = __objc_msgSend_641Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_bundleIdentifier1 = _registerName1("bundleIdentifier"); + late final _sel_infoDictionary1 = _registerName1("infoDictionary"); + late final _sel_localizedInfoDictionary1 = + _registerName1("localizedInfoDictionary"); + late final _sel_objectForInfoDictionaryKey_1 = + _registerName1("objectForInfoDictionaryKey:"); + late final _sel_classNamed_1 = _registerName1("classNamed:"); + late final _sel_principalClass1 = _registerName1("principalClass"); + late final _sel_preferredLocalizations1 = + _registerName1("preferredLocalizations"); + late final _sel_localizations1 = _registerName1("localizations"); + late final _sel_developmentLocalization1 = + _registerName1("developmentLocalization"); + late final _sel_preferredLocalizationsFromArray_1 = + _registerName1("preferredLocalizationsFromArray:"); + late final _sel_preferredLocalizationsFromArray_forPreferences_1 = + _registerName1("preferredLocalizationsFromArray:forPreferences:"); + ffi.Pointer _objc_msgSend_642( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer localizationsArray, + ffi.Pointer preferencesArray, + ) { + return __objc_msgSend_642( + obj, + sel, + localizationsArray, + preferencesArray, + ); + } + + late final __objc_msgSend_642Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_642 = __objc_msgSend_642Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_executableArchitectures1 = + _registerName1("executableArchitectures"); + late final _sel_setPreservationPriority_forTags_1 = + _registerName1("setPreservationPriority:forTags:"); + void _objc_msgSend_643( + ffi.Pointer obj, + ffi.Pointer sel, + double priority, + ffi.Pointer tags, + ) { + return __objc_msgSend_643( + obj, + sel, + priority, + tags, + ); + } + + late final __objc_msgSend_643Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Double, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_643 = __objc_msgSend_643Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double, + ffi.Pointer)>(); + + late final _sel_preservationPriorityForTag_1 = + _registerName1("preservationPriorityForTag:"); + late final _class_NSMutableAttributedString1 = + _getClass1("NSMutableAttributedString"); + late final _sel_setAttributes_range_1 = + _registerName1("setAttributes:range:"); + void _objc_msgSend_644( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attrs, + NSRange range, + ) { + return __objc_msgSend_644( + obj, + sel, + attrs, + range, + ); + } + + late final __objc_msgSend_644Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_644 = __objc_msgSend_644Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>(); + + late final _sel_mutableString1 = _registerName1("mutableString"); + ffi.Pointer _objc_msgSend_645( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_645( + obj, + sel, + ); + } + + late final __objc_msgSend_645Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_645 = __objc_msgSend_645Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_addAttribute_value_range_1 = + _registerName1("addAttribute:value:range:"); + void _objc_msgSend_646( + ffi.Pointer obj, + ffi.Pointer sel, + NSAttributedStringKey name, + ffi.Pointer value, + NSRange range, + ) { + return __objc_msgSend_646( + obj, + sel, + name, + value, + range, + ); + } + + late final __objc_msgSend_646Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSAttributedStringKey, + ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_646 = __objc_msgSend_646Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + NSAttributedStringKey, ffi.Pointer, NSRange)>(); + + late final _sel_addAttributes_range_1 = + _registerName1("addAttributes:range:"); + late final _sel_removeAttribute_range_1 = + _registerName1("removeAttribute:range:"); + void _objc_msgSend_647( + ffi.Pointer obj, + ffi.Pointer sel, + NSAttributedStringKey name, + NSRange range, + ) { + return __objc_msgSend_647( + obj, + sel, + name, + range, + ); + } + + late final __objc_msgSend_647Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSAttributedStringKey, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_647 = __objc_msgSend_647Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + NSAttributedStringKey, NSRange)>(); + + late final _sel_replaceCharactersInRange_withAttributedString_1 = + _registerName1("replaceCharactersInRange:withAttributedString:"); + void _objc_msgSend_648( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer attrString, + ) { + return __objc_msgSend_648( + obj, + sel, + range, + attrString, + ); + } + + late final __objc_msgSend_648Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_648 = __objc_msgSend_648Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, + ffi.Pointer)>(); + + late final _sel_insertAttributedString_atIndex_1 = + _registerName1("insertAttributedString:atIndex:"); + void _objc_msgSend_649( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attrString, + int loc, + ) { + return __objc_msgSend_649( + obj, + sel, + attrString, + loc, + ); + } + + late final __objc_msgSend_649Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_649 = __objc_msgSend_649Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_appendAttributedString_1 = + _registerName1("appendAttributedString:"); + void _objc_msgSend_650( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attrString, + ) { + return __objc_msgSend_650( + obj, + sel, + attrString, + ); + } + + late final __objc_msgSend_650Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_650 = __objc_msgSend_650Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setAttributedString_1 = + _registerName1("setAttributedString:"); + late final _sel_beginEditing1 = _registerName1("beginEditing"); + late final _sel_endEditing1 = _registerName1("endEditing"); + late final _sel_appendLocalizedFormat_1 = + _registerName1("appendLocalizedFormat:"); + late final _class_NSDateFormatter1 = _getClass1("NSDateFormatter"); + late final _class_NSFormatter1 = _getClass1("NSFormatter"); + late final _sel_stringForObjectValue_1 = + _registerName1("stringForObjectValue:"); + late final _sel_attributedStringForObjectValue_withDefaultAttributes_1 = + _registerName1("attributedStringForObjectValue:withDefaultAttributes:"); + ffi.Pointer _objc_msgSend_651( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer obj1, + ffi.Pointer attrs, + ) { + return __objc_msgSend_651( + obj, + sel, + obj1, + attrs, + ); + } + + late final __objc_msgSend_651Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_651 = __objc_msgSend_651Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_editingStringForObjectValue_1 = + _registerName1("editingStringForObjectValue:"); + late final _sel_getObjectValue_forString_errorDescription_1 = + _registerName1("getObjectValue:forString:errorDescription:"); + bool _objc_msgSend_652( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> obj1, + ffi.Pointer string, + ffi.Pointer> error, + ) { + return __objc_msgSend_652( + obj, + sel, + obj1, + string, + error, + ); + } + + late final __objc_msgSend_652Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_652 = __objc_msgSend_652Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_isPartialStringValid_newEditingString_errorDescription_1 = + _registerName1("isPartialStringValid:newEditingString:errorDescription:"); + bool _objc_msgSend_653( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer partialString, + ffi.Pointer> newString, + ffi.Pointer> error, + ) { + return __objc_msgSend_653( + obj, + sel, + partialString, + newString, + error, + ); + } + + late final __objc_msgSend_653Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_653 = __objc_msgSend_653Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_isPartialStringValid_proposedSelectedRange_originalString_originalSelectedRange_errorDescription_1 = + _registerName1( + "isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:"); + bool _objc_msgSend_654( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> partialStringPtr, + NSRangePointer proposedSelRangePtr, + ffi.Pointer origString, + NSRange origSelRange, + ffi.Pointer> error, + ) { + return __objc_msgSend_654( + obj, + sel, + partialStringPtr, + proposedSelRangePtr, + origString, + origSelRange, + error, + ); + } + + late final __objc_msgSend_654Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSRangePointer, + ffi.Pointer, + NSRange, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_654 = __objc_msgSend_654Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSRangePointer, + ffi.Pointer, + NSRange, + ffi.Pointer>)>(); + + late final _sel_formattingContext1 = _registerName1("formattingContext"); + int _objc_msgSend_655( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_655( + obj, + sel, + ); + } + + late final __objc_msgSend_655Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_655 = __objc_msgSend_655Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setFormattingContext_1 = + _registerName1("setFormattingContext:"); + void _objc_msgSend_656( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_656( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_656Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_656 = __objc_msgSend_656Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_getObjectValue_forString_range_error_1 = + _registerName1("getObjectValue:forString:range:error:"); + bool _objc_msgSend_657( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> obj1, + ffi.Pointer string, + ffi.Pointer rangep, + ffi.Pointer> error, + ) { + return __objc_msgSend_657( + obj, + sel, + obj1, + string, + rangep, + error, + ); + } + + late final __objc_msgSend_657Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_657 = __objc_msgSend_657Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_stringFromDate_1 = _registerName1("stringFromDate:"); + late final _sel_dateFromString_1 = _registerName1("dateFromString:"); + late final _sel_localizedStringFromDate_dateStyle_timeStyle_1 = + _registerName1("localizedStringFromDate:dateStyle:timeStyle:"); + ffi.Pointer _objc_msgSend_658( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + int dstyle, + int tstyle, + ) { + return __objc_msgSend_658( + obj, + sel, + date, + dstyle, + tstyle, + ); + } + + late final __objc_msgSend_658Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_658 = __objc_msgSend_658Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, int)>(); + + late final _sel_dateFormatFromTemplate_options_locale_1 = + _registerName1("dateFormatFromTemplate:options:locale:"); + ffi.Pointer _objc_msgSend_659( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer tmplate, + int opts, + ffi.Pointer locale, + ) { + return __objc_msgSend_659( + obj, + sel, + tmplate, + opts, + locale, + ); + } + + late final __objc_msgSend_659Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_659 = __objc_msgSend_659Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final _sel_defaultFormatterBehavior1 = + _registerName1("defaultFormatterBehavior"); + int _objc_msgSend_660( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_660( + obj, + sel, + ); + } + + late final __objc_msgSend_660Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_660 = __objc_msgSend_660Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setDefaultFormatterBehavior_1 = + _registerName1("setDefaultFormatterBehavior:"); + void _objc_msgSend_661( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_661( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_661Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_661 = __objc_msgSend_661Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_setLocalizedDateFormatFromTemplate_1 = + _registerName1("setLocalizedDateFormatFromTemplate:"); + late final _sel_dateFormat1 = _registerName1("dateFormat"); + late final _sel_setDateFormat_1 = _registerName1("setDateFormat:"); + late final _sel_dateStyle1 = _registerName1("dateStyle"); + int _objc_msgSend_662( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_662( + obj, + sel, + ); + } + + late final __objc_msgSend_662Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_662 = __objc_msgSend_662Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setDateStyle_1 = _registerName1("setDateStyle:"); + void _objc_msgSend_663( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_663( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_663Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_663 = __objc_msgSend_663Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_timeStyle1 = _registerName1("timeStyle"); + late final _sel_setTimeStyle_1 = _registerName1("setTimeStyle:"); + late final _sel_locale1 = _registerName1("locale"); + late final _sel_setLocale_1 = _registerName1("setLocale:"); + void _objc_msgSend_664( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_664( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_664Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_664 = __objc_msgSend_664Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_generatesCalendarDates1 = + _registerName1("generatesCalendarDates"); + late final _sel_setGeneratesCalendarDates_1 = + _registerName1("setGeneratesCalendarDates:"); + late final _sel_formatterBehavior1 = _registerName1("formatterBehavior"); + late final _sel_setFormatterBehavior_1 = + _registerName1("setFormatterBehavior:"); + late final _class_NSCalendar1 = _getClass1("NSCalendar"); + late final _sel_currentCalendar1 = _registerName1("currentCalendar"); + ffi.Pointer _objc_msgSend_665( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_665( + obj, + sel, + ); + } + + late final __objc_msgSend_665Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_665 = __objc_msgSend_665Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_autoupdatingCurrentCalendar1 = + _registerName1("autoupdatingCurrentCalendar"); + late final _sel_calendarWithIdentifier_1 = + _registerName1("calendarWithIdentifier:"); + ffi.Pointer _objc_msgSend_666( + ffi.Pointer obj, + ffi.Pointer sel, + NSCalendarIdentifier calendarIdentifierConstant, + ) { + return __objc_msgSend_666( + obj, + sel, + calendarIdentifierConstant, + ); + } + + late final __objc_msgSend_666Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSCalendarIdentifier)>>('objc_msgSend'); + late final __objc_msgSend_666 = __objc_msgSend_666Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSCalendarIdentifier)>(); + + late final _sel_initWithCalendarIdentifier_1 = + _registerName1("initWithCalendarIdentifier:"); + late final _sel_firstWeekday1 = _registerName1("firstWeekday"); + late final _sel_setFirstWeekday_1 = _registerName1("setFirstWeekday:"); + late final _sel_minimumDaysInFirstWeek1 = + _registerName1("minimumDaysInFirstWeek"); + late final _sel_setMinimumDaysInFirstWeek_1 = + _registerName1("setMinimumDaysInFirstWeek:"); + late final _sel_eraSymbols1 = _registerName1("eraSymbols"); + late final _sel_longEraSymbols1 = _registerName1("longEraSymbols"); + late final _sel_monthSymbols1 = _registerName1("monthSymbols"); + late final _sel_shortMonthSymbols1 = _registerName1("shortMonthSymbols"); + late final _sel_veryShortMonthSymbols1 = + _registerName1("veryShortMonthSymbols"); + late final _sel_standaloneMonthSymbols1 = + _registerName1("standaloneMonthSymbols"); + late final _sel_shortStandaloneMonthSymbols1 = + _registerName1("shortStandaloneMonthSymbols"); + late final _sel_veryShortStandaloneMonthSymbols1 = + _registerName1("veryShortStandaloneMonthSymbols"); + late final _sel_weekdaySymbols1 = _registerName1("weekdaySymbols"); + late final _sel_shortWeekdaySymbols1 = _registerName1("shortWeekdaySymbols"); + late final _sel_veryShortWeekdaySymbols1 = + _registerName1("veryShortWeekdaySymbols"); + late final _sel_standaloneWeekdaySymbols1 = + _registerName1("standaloneWeekdaySymbols"); + late final _sel_shortStandaloneWeekdaySymbols1 = + _registerName1("shortStandaloneWeekdaySymbols"); + late final _sel_veryShortStandaloneWeekdaySymbols1 = + _registerName1("veryShortStandaloneWeekdaySymbols"); + late final _sel_quarterSymbols1 = _registerName1("quarterSymbols"); + late final _sel_shortQuarterSymbols1 = _registerName1("shortQuarterSymbols"); + late final _sel_standaloneQuarterSymbols1 = + _registerName1("standaloneQuarterSymbols"); + late final _sel_shortStandaloneQuarterSymbols1 = + _registerName1("shortStandaloneQuarterSymbols"); + late final _sel_AMSymbol1 = _registerName1("AMSymbol"); + late final _sel_PMSymbol1 = _registerName1("PMSymbol"); + late final _sel_minimumRangeOfUnit_1 = _registerName1("minimumRangeOfUnit:"); + NSRange _objc_msgSend_667( + ffi.Pointer obj, + ffi.Pointer sel, + int unit, + ) { + return __objc_msgSend_667( + obj, + sel, + unit, + ); + } + + late final __objc_msgSend_667Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_667 = __objc_msgSend_667Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_maximumRangeOfUnit_1 = _registerName1("maximumRangeOfUnit:"); + late final _sel_rangeOfUnit_inUnit_forDate_1 = + _registerName1("rangeOfUnit:inUnit:forDate:"); + NSRange _objc_msgSend_668( + ffi.Pointer obj, + ffi.Pointer sel, + int smaller, + int larger, + ffi.Pointer date, + ) { + return __objc_msgSend_668( + obj, + sel, + smaller, + larger, + date, + ); + } + + late final __objc_msgSend_668Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_668 = __objc_msgSend_668Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, int, int, + ffi.Pointer)>(); + + late final _sel_ordinalityOfUnit_inUnit_forDate_1 = + _registerName1("ordinalityOfUnit:inUnit:forDate:"); + int _objc_msgSend_669( + ffi.Pointer obj, + ffi.Pointer sel, + int smaller, + int larger, + ffi.Pointer date, + ) { + return __objc_msgSend_669( + obj, + sel, + smaller, + larger, + date, + ); + } + + late final __objc_msgSend_669Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_669 = __objc_msgSend_669Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, int, + ffi.Pointer)>(); + + late final _sel_rangeOfUnit_startDate_interval_forDate_1 = + _registerName1("rangeOfUnit:startDate:interval:forDate:"); + bool _objc_msgSend_670( + ffi.Pointer obj, + ffi.Pointer sel, + int unit, + ffi.Pointer> datep, + ffi.Pointer tip, + ffi.Pointer date, + ) { + return __objc_msgSend_670( + obj, + sel, + unit, + datep, + tip, + date, + ); + } + + late final __objc_msgSend_670Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_670 = __objc_msgSend_670Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSDateComponents1 = _getClass1("NSDateComponents"); + late final _sel_calendar1 = _registerName1("calendar"); + late final _sel_setCalendar_1 = _registerName1("setCalendar:"); + void _objc_msgSend_671( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_671( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_671Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_671 = __objc_msgSend_671Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_era1 = _registerName1("era"); + late final _sel_setEra_1 = _registerName1("setEra:"); + late final _sel_year1 = _registerName1("year"); + late final _sel_setYear_1 = _registerName1("setYear:"); + late final _sel_month1 = _registerName1("month"); + late final _sel_setMonth_1 = _registerName1("setMonth:"); + late final _sel_day1 = _registerName1("day"); + late final _sel_setDay_1 = _registerName1("setDay:"); + late final _sel_hour1 = _registerName1("hour"); + late final _sel_setHour_1 = _registerName1("setHour:"); + late final _sel_minute1 = _registerName1("minute"); + late final _sel_setMinute_1 = _registerName1("setMinute:"); + late final _sel_second1 = _registerName1("second"); + late final _sel_setSecond_1 = _registerName1("setSecond:"); + late final _sel_nanosecond1 = _registerName1("nanosecond"); + late final _sel_setNanosecond_1 = _registerName1("setNanosecond:"); + late final _sel_weekday1 = _registerName1("weekday"); + late final _sel_setWeekday_1 = _registerName1("setWeekday:"); + late final _sel_weekdayOrdinal1 = _registerName1("weekdayOrdinal"); + late final _sel_setWeekdayOrdinal_1 = _registerName1("setWeekdayOrdinal:"); + late final _sel_quarter1 = _registerName1("quarter"); + late final _sel_setQuarter_1 = _registerName1("setQuarter:"); + late final _sel_weekOfMonth1 = _registerName1("weekOfMonth"); + late final _sel_setWeekOfMonth_1 = _registerName1("setWeekOfMonth:"); + late final _sel_weekOfYear1 = _registerName1("weekOfYear"); + late final _sel_setWeekOfYear_1 = _registerName1("setWeekOfYear:"); + late final _sel_yearForWeekOfYear1 = _registerName1("yearForWeekOfYear"); + late final _sel_setYearForWeekOfYear_1 = + _registerName1("setYearForWeekOfYear:"); + late final _sel_isLeapMonth1 = _registerName1("isLeapMonth"); + late final _sel_setLeapMonth_1 = _registerName1("setLeapMonth:"); + late final _sel_week1 = _registerName1("week"); + late final _sel_setWeek_1 = _registerName1("setWeek:"); + late final _sel_setValue_forComponent_1 = + _registerName1("setValue:forComponent:"); + void _objc_msgSend_672( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + int unit, + ) { + return __objc_msgSend_672( + obj, + sel, + value, + unit, + ); + } + + late final __objc_msgSend_672Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSInteger, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_672 = __objc_msgSend_672Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, int)>(); + + late final _sel_valueForComponent_1 = _registerName1("valueForComponent:"); + int _objc_msgSend_673( + ffi.Pointer obj, + ffi.Pointer sel, + int unit, + ) { + return __objc_msgSend_673( + obj, + sel, + unit, + ); + } + + late final __objc_msgSend_673Ptr = _lookup< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_673 = __objc_msgSend_673Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_isValidDate1 = _registerName1("isValidDate"); + late final _sel_isValidDateInCalendar_1 = + _registerName1("isValidDateInCalendar:"); + bool _objc_msgSend_674( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer calendar, + ) { + return __objc_msgSend_674( + obj, + sel, + calendar, + ); + } + + late final __objc_msgSend_674Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_674 = __objc_msgSend_674Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_dateFromComponents_1 = _registerName1("dateFromComponents:"); + ffi.Pointer _objc_msgSend_675( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer comps, + ) { + return __objc_msgSend_675( + obj, + sel, + comps, + ); + } + + late final __objc_msgSend_675Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_675 = __objc_msgSend_675Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_components_fromDate_1 = + _registerName1("components:fromDate:"); + ffi.Pointer _objc_msgSend_676( + ffi.Pointer obj, + ffi.Pointer sel, + int unitFlags, + ffi.Pointer date, + ) { + return __objc_msgSend_676( + obj, + sel, + unitFlags, + date, + ); + } + + late final __objc_msgSend_676Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_676 = __objc_msgSend_676Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_dateByAddingComponents_toDate_options_1 = + _registerName1("dateByAddingComponents:toDate:options:"); + ffi.Pointer _objc_msgSend_677( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer comps, + ffi.Pointer date, + int opts, + ) { + return __objc_msgSend_677( + obj, + sel, + comps, + date, + opts, + ); + } + + late final __objc_msgSend_677Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_677 = __objc_msgSend_677Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_components_fromDate_toDate_options_1 = + _registerName1("components:fromDate:toDate:options:"); + ffi.Pointer _objc_msgSend_678( + ffi.Pointer obj, + ffi.Pointer sel, + int unitFlags, + ffi.Pointer startingDate, + ffi.Pointer resultDate, + int opts, + ) { + return __objc_msgSend_678( + obj, + sel, + unitFlags, + startingDate, + resultDate, + opts, + ); + } + + late final __objc_msgSend_678Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_678 = __objc_msgSend_678Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_getEra_year_month_day_fromDate_1 = + _registerName1("getEra:year:month:day:fromDate:"); + void _objc_msgSend_679( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer eraValuePointer, + ffi.Pointer yearValuePointer, + ffi.Pointer monthValuePointer, + ffi.Pointer dayValuePointer, + ffi.Pointer date, + ) { + return __objc_msgSend_679( + obj, + sel, + eraValuePointer, + yearValuePointer, + monthValuePointer, + dayValuePointer, + date, + ); + } + + late final __objc_msgSend_679Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_679 = __objc_msgSend_679Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_getEra_yearForWeekOfYear_weekOfYear_weekday_fromDate_1 = + _registerName1("getEra:yearForWeekOfYear:weekOfYear:weekday:fromDate:"); + late final _sel_getHour_minute_second_nanosecond_fromDate_1 = + _registerName1("getHour:minute:second:nanosecond:fromDate:"); + late final _sel_component_fromDate_1 = _registerName1("component:fromDate:"); + int _objc_msgSend_680( + ffi.Pointer obj, + ffi.Pointer sel, + int unit, + ffi.Pointer date, + ) { + return __objc_msgSend_680( + obj, + sel, + unit, + date, + ); + } + + late final __objc_msgSend_680Ptr = _lookup< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_680 = __objc_msgSend_680Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_dateWithEra_year_month_day_hour_minute_second_nanosecond_1 = + _registerName1( + "dateWithEra:year:month:day:hour:minute:second:nanosecond:"); + ffi.Pointer _objc_msgSend_681( + ffi.Pointer obj, + ffi.Pointer sel, + int eraValue, + int yearValue, + int monthValue, + int dayValue, + int hourValue, + int minuteValue, + int secondValue, + int nanosecondValue, + ) { + return __objc_msgSend_681( + obj, + sel, + eraValue, + yearValue, + monthValue, + dayValue, + hourValue, + minuteValue, + secondValue, + nanosecondValue, + ); + } + + late final __objc_msgSend_681Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + NSInteger, + NSInteger, + NSInteger, + NSInteger, + NSInteger, + NSInteger, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_681 = __objc_msgSend_681Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, int, int, int, int, int, int, int)>(); + + late final _sel_dateWithEra_yearForWeekOfYear_weekOfYear_weekday_hour_minute_second_nanosecond_1 = + _registerName1( + "dateWithEra:yearForWeekOfYear:weekOfYear:weekday:hour:minute:second:nanosecond:"); + late final _sel_startOfDayForDate_1 = _registerName1("startOfDayForDate:"); + late final _sel_componentsInTimeZone_fromDate_1 = + _registerName1("componentsInTimeZone:fromDate:"); + ffi.Pointer _objc_msgSend_682( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer timezone, + ffi.Pointer date, + ) { + return __objc_msgSend_682( + obj, + sel, + timezone, + date, + ); + } + + late final __objc_msgSend_682Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_682 = __objc_msgSend_682Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_compareDate_toDate_toUnitGranularity_1 = + _registerName1("compareDate:toDate:toUnitGranularity:"); + int _objc_msgSend_683( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date1, + ffi.Pointer date2, + int unit, + ) { + return __objc_msgSend_683( + obj, + sel, + date1, + date2, + unit, + ); + } + + late final __objc_msgSend_683Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_683 = __objc_msgSend_683Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_isDate_equalToDate_toUnitGranularity_1 = + _registerName1("isDate:equalToDate:toUnitGranularity:"); + bool _objc_msgSend_684( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date1, + ffi.Pointer date2, + int unit, + ) { + return __objc_msgSend_684( + obj, + sel, + date1, + date2, + unit, + ); + } + + late final __objc_msgSend_684Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_684 = __objc_msgSend_684Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_isDate_inSameDayAsDate_1 = + _registerName1("isDate:inSameDayAsDate:"); + bool _objc_msgSend_685( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date1, + ffi.Pointer date2, + ) { + return __objc_msgSend_685( + obj, + sel, + date1, + date2, + ); + } + + late final __objc_msgSend_685Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_685 = __objc_msgSend_685Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isDateInToday_1 = _registerName1("isDateInToday:"); + late final _sel_isDateInYesterday_1 = _registerName1("isDateInYesterday:"); + late final _sel_isDateInTomorrow_1 = _registerName1("isDateInTomorrow:"); + late final _sel_isDateInWeekend_1 = _registerName1("isDateInWeekend:"); + late final _sel_rangeOfWeekendStartDate_interval_containingDate_1 = + _registerName1("rangeOfWeekendStartDate:interval:containingDate:"); + bool _objc_msgSend_686( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> datep, + ffi.Pointer tip, + ffi.Pointer date, + ) { + return __objc_msgSend_686( + obj, + sel, + datep, + tip, + date, + ); + } + + late final __objc_msgSend_686Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_686 = __objc_msgSend_686Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_nextWeekendStartDate_interval_options_afterDate_1 = + _registerName1("nextWeekendStartDate:interval:options:afterDate:"); + bool _objc_msgSend_687( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> datep, + ffi.Pointer tip, + int options, + ffi.Pointer date, + ) { + return __objc_msgSend_687( + obj, + sel, + datep, + tip, + options, + date, + ); + } + + late final __objc_msgSend_687Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_687 = __objc_msgSend_687Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final _sel_components_fromDateComponents_toDateComponents_options_1 = + _registerName1("components:fromDateComponents:toDateComponents:options:"); + ffi.Pointer _objc_msgSend_688( + ffi.Pointer obj, + ffi.Pointer sel, + int unitFlags, + ffi.Pointer startingDateComp, + ffi.Pointer resultDateComp, + int options, + ) { + return __objc_msgSend_688( + obj, + sel, + unitFlags, + startingDateComp, + resultDateComp, + options, + ); + } + + late final __objc_msgSend_688Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_688 = __objc_msgSend_688Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_dateByAddingUnit_value_toDate_options_1 = + _registerName1("dateByAddingUnit:value:toDate:options:"); + ffi.Pointer _objc_msgSend_689( + ffi.Pointer obj, + ffi.Pointer sel, + int unit, + int value, + ffi.Pointer date, + int options, + ) { + return __objc_msgSend_689( + obj, + sel, + unit, + value, + date, + options, + ); + } + + late final __objc_msgSend_689Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSInteger, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_689 = __objc_msgSend_689Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer, int)>(); + + late final _sel_enumerateDatesStartingAfterDate_matchingComponents_options_usingBlock_1 = + _registerName1( + "enumerateDatesStartingAfterDate:matchingComponents:options:usingBlock:"); + void _objc_msgSend_690( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer start, + ffi.Pointer comps, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_690( + obj, + sel, + start, + comps, + opts, + block, + ); + } + + late final __objc_msgSend_690Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_690 = __objc_msgSend_690Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_nextDateAfterDate_matchingComponents_options_1 = + _registerName1("nextDateAfterDate:matchingComponents:options:"); + ffi.Pointer _objc_msgSend_691( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + ffi.Pointer comps, + int options, + ) { + return __objc_msgSend_691( + obj, + sel, + date, + comps, + options, + ); + } + + late final __objc_msgSend_691Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_691 = __objc_msgSend_691Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_nextDateAfterDate_matchingUnit_value_options_1 = + _registerName1("nextDateAfterDate:matchingUnit:value:options:"); + ffi.Pointer _objc_msgSend_692( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + int unit, + int value, + int options, + ) { + return __objc_msgSend_692( + obj, + sel, + date, + unit, + value, + options, + ); + } + + late final __objc_msgSend_692Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSInteger, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_692 = __objc_msgSend_692Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, int, int)>(); + + late final _sel_nextDateAfterDate_matchingHour_minute_second_options_1 = + _registerName1("nextDateAfterDate:matchingHour:minute:second:options:"); + ffi.Pointer _objc_msgSend_693( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + int hourValue, + int minuteValue, + int secondValue, + int options, + ) { + return __objc_msgSend_693( + obj, + sel, + date, + hourValue, + minuteValue, + secondValue, + options, + ); + } + + late final __objc_msgSend_693Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + NSInteger, + NSInteger, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_693 = __objc_msgSend_693Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, int, int, int)>(); + + late final _sel_dateBySettingUnit_value_ofDate_options_1 = + _registerName1("dateBySettingUnit:value:ofDate:options:"); + late final _sel_dateBySettingHour_minute_second_ofDate_options_1 = + _registerName1("dateBySettingHour:minute:second:ofDate:options:"); + ffi.Pointer _objc_msgSend_694( + ffi.Pointer obj, + ffi.Pointer sel, + int h, + int m, + int s, + ffi.Pointer date, + int opts, + ) { + return __objc_msgSend_694( + obj, + sel, + h, + m, + s, + date, + opts, + ); + } + + late final __objc_msgSend_694Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + NSInteger, + NSInteger, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_694 = __objc_msgSend_694Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, int, int, ffi.Pointer, int)>(); + + late final _sel_date_matchesComponents_1 = + _registerName1("date:matchesComponents:"); + bool _objc_msgSend_695( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + ffi.Pointer components, + ) { + return __objc_msgSend_695( + obj, + sel, + date, + components, + ); + } + + late final __objc_msgSend_695Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_695 = __objc_msgSend_695Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isLenient1 = _registerName1("isLenient"); + late final _sel_setLenient_1 = _registerName1("setLenient:"); + late final _sel_twoDigitStartDate1 = _registerName1("twoDigitStartDate"); + late final _sel_setTwoDigitStartDate_1 = + _registerName1("setTwoDigitStartDate:"); + late final _sel_defaultDate1 = _registerName1("defaultDate"); + late final _sel_setDefaultDate_1 = _registerName1("setDefaultDate:"); + late final _sel_setEraSymbols_1 = _registerName1("setEraSymbols:"); + void _objc_msgSend_696( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_696( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_696Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_696 = __objc_msgSend_696Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setMonthSymbols_1 = _registerName1("setMonthSymbols:"); + late final _sel_setShortMonthSymbols_1 = + _registerName1("setShortMonthSymbols:"); + late final _sel_setWeekdaySymbols_1 = _registerName1("setWeekdaySymbols:"); + late final _sel_setShortWeekdaySymbols_1 = + _registerName1("setShortWeekdaySymbols:"); + late final _sel_setAMSymbol_1 = _registerName1("setAMSymbol:"); + late final _sel_setPMSymbol_1 = _registerName1("setPMSymbol:"); + late final _sel_setLongEraSymbols_1 = _registerName1("setLongEraSymbols:"); + late final _sel_setVeryShortMonthSymbols_1 = + _registerName1("setVeryShortMonthSymbols:"); + late final _sel_setStandaloneMonthSymbols_1 = + _registerName1("setStandaloneMonthSymbols:"); + late final _sel_setShortStandaloneMonthSymbols_1 = + _registerName1("setShortStandaloneMonthSymbols:"); + late final _sel_setVeryShortStandaloneMonthSymbols_1 = + _registerName1("setVeryShortStandaloneMonthSymbols:"); + late final _sel_setVeryShortWeekdaySymbols_1 = + _registerName1("setVeryShortWeekdaySymbols:"); + late final _sel_setStandaloneWeekdaySymbols_1 = + _registerName1("setStandaloneWeekdaySymbols:"); + late final _sel_setShortStandaloneWeekdaySymbols_1 = + _registerName1("setShortStandaloneWeekdaySymbols:"); + late final _sel_setVeryShortStandaloneWeekdaySymbols_1 = + _registerName1("setVeryShortStandaloneWeekdaySymbols:"); + late final _sel_setQuarterSymbols_1 = _registerName1("setQuarterSymbols:"); + late final _sel_setShortQuarterSymbols_1 = + _registerName1("setShortQuarterSymbols:"); + late final _sel_setStandaloneQuarterSymbols_1 = + _registerName1("setStandaloneQuarterSymbols:"); + late final _sel_setShortStandaloneQuarterSymbols_1 = + _registerName1("setShortStandaloneQuarterSymbols:"); + late final _sel_gregorianStartDate1 = _registerName1("gregorianStartDate"); + late final _sel_setGregorianStartDate_1 = + _registerName1("setGregorianStartDate:"); + late final _sel_doesRelativeDateFormatting1 = + _registerName1("doesRelativeDateFormatting"); + late final _sel_setDoesRelativeDateFormatting_1 = + _registerName1("setDoesRelativeDateFormatting:"); + late final _sel_initWithDateFormat_allowNaturalLanguage_1 = + _registerName1("initWithDateFormat:allowNaturalLanguage:"); + late final _sel_allowsNaturalLanguage1 = + _registerName1("allowsNaturalLanguage"); + late final _class_NSNumberFormatter1 = _getClass1("NSNumberFormatter"); + late final _sel_stringFromNumber_1 = _registerName1("stringFromNumber:"); + ffi.Pointer _objc_msgSend_697( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer number, + ) { + return __objc_msgSend_697( + obj, + sel, + number, + ); + } + + late final __objc_msgSend_697Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_697 = __objc_msgSend_697Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_numberFromString_1 = _registerName1("numberFromString:"); + ffi.Pointer _objc_msgSend_698( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + ) { + return __objc_msgSend_698( + obj, + sel, + string, + ); + } + + late final __objc_msgSend_698Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_698 = __objc_msgSend_698Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_localizedStringFromNumber_numberStyle_1 = + _registerName1("localizedStringFromNumber:numberStyle:"); + ffi.Pointer _objc_msgSend_699( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer num, + int nstyle, + ) { + return __objc_msgSend_699( + obj, + sel, + num, + nstyle, + ); + } + + late final __objc_msgSend_699Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_699 = __objc_msgSend_699Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + int _objc_msgSend_700( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_700( + obj, + sel, + ); + } + + late final __objc_msgSend_700Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_700 = __objc_msgSend_700Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_701( + ffi.Pointer obj, + ffi.Pointer sel, + int behavior, + ) { + return __objc_msgSend_701( + obj, + sel, + behavior, + ); + } + + late final __objc_msgSend_701Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_701 = __objc_msgSend_701Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_numberStyle1 = _registerName1("numberStyle"); + int _objc_msgSend_702( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_702( + obj, + sel, + ); + } + + late final __objc_msgSend_702Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_702 = __objc_msgSend_702Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setNumberStyle_1 = _registerName1("setNumberStyle:"); + void _objc_msgSend_703( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_703( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_703Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_703 = __objc_msgSend_703Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_generatesDecimalNumbers1 = + _registerName1("generatesDecimalNumbers"); + late final _sel_setGeneratesDecimalNumbers_1 = + _registerName1("setGeneratesDecimalNumbers:"); + void _objc_msgSend_704( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_704( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_704Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_704 = __objc_msgSend_704Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_negativeFormat1 = _registerName1("negativeFormat"); + late final _sel_setNegativeFormat_1 = _registerName1("setNegativeFormat:"); + late final _sel_textAttributesForNegativeValues1 = + _registerName1("textAttributesForNegativeValues"); + late final _sel_setTextAttributesForNegativeValues_1 = + _registerName1("setTextAttributesForNegativeValues:"); + late final _sel_positiveFormat1 = _registerName1("positiveFormat"); + late final _sel_setPositiveFormat_1 = _registerName1("setPositiveFormat:"); + late final _sel_textAttributesForPositiveValues1 = + _registerName1("textAttributesForPositiveValues"); + late final _sel_setTextAttributesForPositiveValues_1 = + _registerName1("setTextAttributesForPositiveValues:"); + late final _sel_allowsFloats1 = _registerName1("allowsFloats"); + late final _sel_setAllowsFloats_1 = _registerName1("setAllowsFloats:"); + late final _sel_setDecimalSeparator_1 = + _registerName1("setDecimalSeparator:"); + late final _sel_alwaysShowsDecimalSeparator1 = + _registerName1("alwaysShowsDecimalSeparator"); + late final _sel_setAlwaysShowsDecimalSeparator_1 = + _registerName1("setAlwaysShowsDecimalSeparator:"); + late final _sel_currencyDecimalSeparator1 = + _registerName1("currencyDecimalSeparator"); + late final _sel_setCurrencyDecimalSeparator_1 = + _registerName1("setCurrencyDecimalSeparator:"); + late final _sel_usesGroupingSeparator1 = + _registerName1("usesGroupingSeparator"); + late final _sel_setUsesGroupingSeparator_1 = + _registerName1("setUsesGroupingSeparator:"); + late final _sel_setGroupingSeparator_1 = + _registerName1("setGroupingSeparator:"); + late final _sel_zeroSymbol1 = _registerName1("zeroSymbol"); + late final _sel_setZeroSymbol_1 = _registerName1("setZeroSymbol:"); + late final _sel_textAttributesForZero1 = + _registerName1("textAttributesForZero"); + late final _sel_setTextAttributesForZero_1 = + _registerName1("setTextAttributesForZero:"); + late final _sel_nilSymbol1 = _registerName1("nilSymbol"); + late final _sel_setNilSymbol_1 = _registerName1("setNilSymbol:"); + late final _sel_textAttributesForNil1 = + _registerName1("textAttributesForNil"); + late final _sel_setTextAttributesForNil_1 = + _registerName1("setTextAttributesForNil:"); + late final _sel_notANumberSymbol1 = _registerName1("notANumberSymbol"); + late final _sel_setNotANumberSymbol_1 = + _registerName1("setNotANumberSymbol:"); + late final _sel_textAttributesForNotANumber1 = + _registerName1("textAttributesForNotANumber"); + late final _sel_setTextAttributesForNotANumber_1 = + _registerName1("setTextAttributesForNotANumber:"); + late final _sel_positiveInfinitySymbol1 = + _registerName1("positiveInfinitySymbol"); + late final _sel_setPositiveInfinitySymbol_1 = + _registerName1("setPositiveInfinitySymbol:"); + late final _sel_textAttributesForPositiveInfinity1 = + _registerName1("textAttributesForPositiveInfinity"); + late final _sel_setTextAttributesForPositiveInfinity_1 = + _registerName1("setTextAttributesForPositiveInfinity:"); + late final _sel_negativeInfinitySymbol1 = + _registerName1("negativeInfinitySymbol"); + late final _sel_setNegativeInfinitySymbol_1 = + _registerName1("setNegativeInfinitySymbol:"); + late final _sel_textAttributesForNegativeInfinity1 = + _registerName1("textAttributesForNegativeInfinity"); + late final _sel_setTextAttributesForNegativeInfinity_1 = + _registerName1("setTextAttributesForNegativeInfinity:"); + late final _sel_positivePrefix1 = _registerName1("positivePrefix"); + late final _sel_setPositivePrefix_1 = _registerName1("setPositivePrefix:"); + late final _sel_positiveSuffix1 = _registerName1("positiveSuffix"); + late final _sel_setPositiveSuffix_1 = _registerName1("setPositiveSuffix:"); + late final _sel_negativePrefix1 = _registerName1("negativePrefix"); + late final _sel_setNegativePrefix_1 = _registerName1("setNegativePrefix:"); + late final _sel_negativeSuffix1 = _registerName1("negativeSuffix"); + late final _sel_setNegativeSuffix_1 = _registerName1("setNegativeSuffix:"); + late final _sel_setCurrencyCode_1 = _registerName1("setCurrencyCode:"); + late final _sel_setCurrencySymbol_1 = _registerName1("setCurrencySymbol:"); + late final _sel_internationalCurrencySymbol1 = + _registerName1("internationalCurrencySymbol"); + late final _sel_setInternationalCurrencySymbol_1 = + _registerName1("setInternationalCurrencySymbol:"); + late final _sel_percentSymbol1 = _registerName1("percentSymbol"); + late final _sel_setPercentSymbol_1 = _registerName1("setPercentSymbol:"); + late final _sel_perMillSymbol1 = _registerName1("perMillSymbol"); + late final _sel_setPerMillSymbol_1 = _registerName1("setPerMillSymbol:"); + late final _sel_minusSign1 = _registerName1("minusSign"); + late final _sel_setMinusSign_1 = _registerName1("setMinusSign:"); + late final _sel_plusSign1 = _registerName1("plusSign"); + late final _sel_setPlusSign_1 = _registerName1("setPlusSign:"); + late final _sel_exponentSymbol1 = _registerName1("exponentSymbol"); + late final _sel_setExponentSymbol_1 = _registerName1("setExponentSymbol:"); + late final _sel_groupingSize1 = _registerName1("groupingSize"); + late final _sel_setGroupingSize_1 = _registerName1("setGroupingSize:"); + late final _sel_secondaryGroupingSize1 = + _registerName1("secondaryGroupingSize"); + late final _sel_setSecondaryGroupingSize_1 = + _registerName1("setSecondaryGroupingSize:"); + late final _sel_multiplier1 = _registerName1("multiplier"); + late final _sel_setMultiplier_1 = _registerName1("setMultiplier:"); + void _objc_msgSend_705( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_705( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_705Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_705 = __objc_msgSend_705Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_formatWidth1 = _registerName1("formatWidth"); + late final _sel_setFormatWidth_1 = _registerName1("setFormatWidth:"); + late final _sel_paddingCharacter1 = _registerName1("paddingCharacter"); + late final _sel_setPaddingCharacter_1 = + _registerName1("setPaddingCharacter:"); + late final _sel_paddingPosition1 = _registerName1("paddingPosition"); + int _objc_msgSend_706( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_706( + obj, + sel, + ); + } + + late final __objc_msgSend_706Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_706 = __objc_msgSend_706Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setPaddingPosition_1 = _registerName1("setPaddingPosition:"); + void _objc_msgSend_707( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_707( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_707Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_707 = __objc_msgSend_707Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_roundingMode1 = _registerName1("roundingMode"); + int _objc_msgSend_708( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_708( + obj, + sel, + ); + } + + late final __objc_msgSend_708Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_708 = __objc_msgSend_708Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setRoundingMode_1 = _registerName1("setRoundingMode:"); + void _objc_msgSend_709( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_709( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_709Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_709 = __objc_msgSend_709Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_roundingIncrement1 = _registerName1("roundingIncrement"); + late final _sel_setRoundingIncrement_1 = + _registerName1("setRoundingIncrement:"); + late final _sel_minimumIntegerDigits1 = + _registerName1("minimumIntegerDigits"); + late final _sel_setMinimumIntegerDigits_1 = + _registerName1("setMinimumIntegerDigits:"); + late final _sel_maximumIntegerDigits1 = + _registerName1("maximumIntegerDigits"); + late final _sel_setMaximumIntegerDigits_1 = + _registerName1("setMaximumIntegerDigits:"); + late final _sel_minimumFractionDigits1 = + _registerName1("minimumFractionDigits"); + late final _sel_setMinimumFractionDigits_1 = + _registerName1("setMinimumFractionDigits:"); + late final _sel_maximumFractionDigits1 = + _registerName1("maximumFractionDigits"); + late final _sel_setMaximumFractionDigits_1 = + _registerName1("setMaximumFractionDigits:"); + late final _sel_minimum1 = _registerName1("minimum"); + late final _sel_setMinimum_1 = _registerName1("setMinimum:"); + late final _sel_maximum1 = _registerName1("maximum"); + late final _sel_setMaximum_1 = _registerName1("setMaximum:"); + late final _sel_currencyGroupingSeparator1 = + _registerName1("currencyGroupingSeparator"); + late final _sel_setCurrencyGroupingSeparator_1 = + _registerName1("setCurrencyGroupingSeparator:"); + late final _sel_usesSignificantDigits1 = + _registerName1("usesSignificantDigits"); + late final _sel_setUsesSignificantDigits_1 = + _registerName1("setUsesSignificantDigits:"); + late final _sel_minimumSignificantDigits1 = + _registerName1("minimumSignificantDigits"); + late final _sel_setMinimumSignificantDigits_1 = + _registerName1("setMinimumSignificantDigits:"); + late final _sel_maximumSignificantDigits1 = + _registerName1("maximumSignificantDigits"); + late final _sel_setMaximumSignificantDigits_1 = + _registerName1("setMaximumSignificantDigits:"); + late final _sel_isPartialStringValidationEnabled1 = + _registerName1("isPartialStringValidationEnabled"); + late final _sel_setPartialStringValidationEnabled_1 = + _registerName1("setPartialStringValidationEnabled:"); + late final _sel_hasThousandSeparators1 = + _registerName1("hasThousandSeparators"); + late final _sel_setHasThousandSeparators_1 = + _registerName1("setHasThousandSeparators:"); + late final _sel_thousandSeparator1 = _registerName1("thousandSeparator"); + late final _sel_setThousandSeparator_1 = + _registerName1("setThousandSeparator:"); + late final _sel_localizesFormat1 = _registerName1("localizesFormat"); + late final _sel_setLocalizesFormat_1 = _registerName1("setLocalizesFormat:"); + late final _sel_format1 = _registerName1("format"); + late final _sel_setFormat_1 = _registerName1("setFormat:"); + late final _sel_attributedStringForZero1 = + _registerName1("attributedStringForZero"); + late final _sel_setAttributedStringForZero_1 = + _registerName1("setAttributedStringForZero:"); + void _objc_msgSend_710( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_710( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_710Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_710 = __objc_msgSend_710Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_attributedStringForNil1 = + _registerName1("attributedStringForNil"); + late final _sel_setAttributedStringForNil_1 = + _registerName1("setAttributedStringForNil:"); + late final _sel_attributedStringForNotANumber1 = + _registerName1("attributedStringForNotANumber"); + late final _sel_setAttributedStringForNotANumber_1 = + _registerName1("setAttributedStringForNotANumber:"); + late final _class_NSDecimalNumberHandler1 = + _getClass1("NSDecimalNumberHandler"); + late final _sel_defaultDecimalNumberHandler1 = + _registerName1("defaultDecimalNumberHandler"); + ffi.Pointer _objc_msgSend_711( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_711( + obj, + sel, + ); + } + + late final __objc_msgSend_711Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_711 = __objc_msgSend_711Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_1 = + _registerName1( + "initWithRoundingMode:scale:raiseOnExactness:raiseOnOverflow:raiseOnUnderflow:raiseOnDivideByZero:"); + instancetype _objc_msgSend_712( + ffi.Pointer obj, + ffi.Pointer sel, + int roundingMode, + int scale, + bool exact, + bool overflow, + bool underflow, + bool divideByZero, + ) { + return __objc_msgSend_712( + obj, + sel, + roundingMode, + scale, + exact, + overflow, + underflow, + divideByZero, + ); + } + + late final __objc_msgSend_712Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Short, + ffi.Bool, + ffi.Bool, + ffi.Bool, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_712 = __objc_msgSend_712Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + int, bool, bool, bool, bool)>(); + + late final _sel_decimalNumberHandlerWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_1 = + _registerName1( + "decimalNumberHandlerWithRoundingMode:scale:raiseOnExactness:raiseOnOverflow:raiseOnUnderflow:raiseOnDivideByZero:"); + late final _sel_roundingBehavior1 = _registerName1("roundingBehavior"); + late final _sel_setRoundingBehavior_1 = + _registerName1("setRoundingBehavior:"); + void _objc_msgSend_713( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_713( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_713Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_713 = __objc_msgSend_713Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSScanner1 = _getClass1("NSScanner"); + late final _sel_scanLocation1 = _registerName1("scanLocation"); + late final _sel_setScanLocation_1 = _registerName1("setScanLocation:"); + late final _sel_charactersToBeSkipped1 = + _registerName1("charactersToBeSkipped"); + late final _sel_setCharactersToBeSkipped_1 = + _registerName1("setCharactersToBeSkipped:"); + void _objc_msgSend_714( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_714( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_714Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_714 = __objc_msgSend_714Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_caseSensitive1 = _registerName1("caseSensitive"); + late final _sel_setCaseSensitive_1 = _registerName1("setCaseSensitive:"); + late final _sel_scanInt_1 = _registerName1("scanInt:"); + bool _objc_msgSend_715( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ) { + return __objc_msgSend_715( + obj, + sel, + result, + ); + } + + late final __objc_msgSend_715Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_715 = __objc_msgSend_715Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scanInteger_1 = _registerName1("scanInteger:"); + bool _objc_msgSend_716( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ) { + return __objc_msgSend_716( + obj, + sel, + result, + ); + } + + late final __objc_msgSend_716Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_716 = __objc_msgSend_716Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scanLongLong_1 = _registerName1("scanLongLong:"); + bool _objc_msgSend_717( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ) { + return __objc_msgSend_717( + obj, + sel, + result, + ); + } + + late final __objc_msgSend_717Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_717 = __objc_msgSend_717Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scanUnsignedLongLong_1 = + _registerName1("scanUnsignedLongLong:"); + bool _objc_msgSend_718( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ) { + return __objc_msgSend_718( + obj, + sel, + result, + ); + } + + late final __objc_msgSend_718Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_718 = __objc_msgSend_718Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scanFloat_1 = _registerName1("scanFloat:"); + bool _objc_msgSend_719( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ) { + return __objc_msgSend_719( + obj, + sel, + result, + ); + } + + late final __objc_msgSend_719Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_719 = __objc_msgSend_719Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scanDouble_1 = _registerName1("scanDouble:"); + bool _objc_msgSend_720( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ) { + return __objc_msgSend_720( + obj, + sel, + result, + ); + } + + late final __objc_msgSend_720Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_720 = __objc_msgSend_720Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scanHexInt_1 = _registerName1("scanHexInt:"); + bool _objc_msgSend_721( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ) { + return __objc_msgSend_721( + obj, + sel, + result, + ); + } + + late final __objc_msgSend_721Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_721 = __objc_msgSend_721Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scanHexLongLong_1 = _registerName1("scanHexLongLong:"); + late final _sel_scanHexFloat_1 = _registerName1("scanHexFloat:"); + late final _sel_scanHexDouble_1 = _registerName1("scanHexDouble:"); + late final _sel_scanString_intoString_1 = + _registerName1("scanString:intoString:"); + bool _objc_msgSend_722( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + ffi.Pointer> result, + ) { + return __objc_msgSend_722( + obj, + sel, + string, + result, + ); + } + + late final __objc_msgSend_722Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_722 = __objc_msgSend_722Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_scanCharactersFromSet_intoString_1 = + _registerName1("scanCharactersFromSet:intoString:"); + bool _objc_msgSend_723( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer set1, + ffi.Pointer> result, + ) { + return __objc_msgSend_723( + obj, + sel, + set1, + result, + ); + } + + late final __objc_msgSend_723Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_723 = __objc_msgSend_723Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_scanUpToString_intoString_1 = + _registerName1("scanUpToString:intoString:"); + late final _sel_scanUpToCharactersFromSet_intoString_1 = + _registerName1("scanUpToCharactersFromSet:intoString:"); + late final _sel_isAtEnd1 = _registerName1("isAtEnd"); + late final _sel_scannerWithString_1 = _registerName1("scannerWithString:"); + late final _sel_localizedScannerWithString_1 = + _registerName1("localizedScannerWithString:"); + late final _sel_scanDecimal_1 = _registerName1("scanDecimal:"); + bool _objc_msgSend_724( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dcm, + ) { + return __objc_msgSend_724( + obj, + sel, + dcm, + ); + } + + late final __objc_msgSend_724Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_724 = __objc_msgSend_724Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSException1 = _getClass1("NSException"); + late final _sel_exceptionWithName_reason_userInfo_1 = + _registerName1("exceptionWithName:reason:userInfo:"); + ffi.Pointer _objc_msgSend_725( + ffi.Pointer obj, + ffi.Pointer sel, + NSExceptionName name, + ffi.Pointer reason, + ffi.Pointer userInfo, + ) { + return __objc_msgSend_725( + obj, + sel, + name, + reason, + userInfo, + ); + } + + late final __objc_msgSend_725Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSExceptionName, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_725 = __objc_msgSend_725Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSExceptionName, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithName_reason_userInfo_1 = + _registerName1("initWithName:reason:userInfo:"); + late final _sel_reason1 = _registerName1("reason"); + late final _sel_raise1 = _registerName1("raise"); + late final _sel_raise_format_1 = _registerName1("raise:format:"); + late final _sel_raise_format_arguments_1 = + _registerName1("raise:format:arguments:"); + void _objc_msgSend_726( + ffi.Pointer obj, + ffi.Pointer sel, + NSExceptionName name, + ffi.Pointer format, + ffi.Pointer<__va_list_tag> argList, + ) { + return __objc_msgSend_726( + obj, + sel, + name, + format, + argList, + ); + } + + late final __objc_msgSend_726Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSExceptionName, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); + late final __objc_msgSend_726 = __objc_msgSend_726Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + NSExceptionName, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>(); + + late final _class_NSFileHandle1 = _getClass1("NSFileHandle"); + late final _sel_availableData1 = _registerName1("availableData"); + late final _sel_initWithFileDescriptor_closeOnDealloc_1 = + _registerName1("initWithFileDescriptor:closeOnDealloc:"); + instancetype _objc_msgSend_727( + ffi.Pointer obj, + ffi.Pointer sel, + int fd, + bool closeopt, + ) { + return __objc_msgSend_727( + obj, + sel, + fd, + closeopt, + ); + } + + late final __objc_msgSend_727Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Int, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_727 = __objc_msgSend_727Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int, bool)>(); + + late final _sel_readDataToEndOfFileAndReturnError_1 = + _registerName1("readDataToEndOfFileAndReturnError:"); + ffi.Pointer _objc_msgSend_728( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> error, + ) { + return __objc_msgSend_728( + obj, + sel, + error, + ); + } + + late final __objc_msgSend_728Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_728 = __objc_msgSend_728Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_readDataUpToLength_error_1 = + _registerName1("readDataUpToLength:error:"); + ffi.Pointer _objc_msgSend_729( + ffi.Pointer obj, + ffi.Pointer sel, + int length, + ffi.Pointer> error, + ) { + return __objc_msgSend_729( + obj, + sel, + length, + error, + ); + } + + late final __objc_msgSend_729Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_729 = __objc_msgSend_729Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer>)>(); + + late final _sel_writeData_error_1 = _registerName1("writeData:error:"); + bool _objc_msgSend_730( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ffi.Pointer> error, + ) { + return __objc_msgSend_730( + obj, + sel, + data, + error, + ); + } + + late final __objc_msgSend_730Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_730 = __objc_msgSend_730Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_getOffset_error_1 = _registerName1("getOffset:error:"); + bool _objc_msgSend_731( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer offsetInFile, + ffi.Pointer> error, + ) { + return __objc_msgSend_731( + obj, + sel, + offsetInFile, + error, + ); + } + + late final __objc_msgSend_731Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_731 = __objc_msgSend_731Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_seekToEndReturningOffset_error_1 = + _registerName1("seekToEndReturningOffset:error:"); + late final _sel_seekToOffset_error_1 = _registerName1("seekToOffset:error:"); + bool _objc_msgSend_732( + ffi.Pointer obj, + ffi.Pointer sel, + int offset, + ffi.Pointer> error, + ) { + return __objc_msgSend_732( + obj, + sel, + offset, + error, + ); + } + + late final __objc_msgSend_732Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLongLong, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_732 = __objc_msgSend_732Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer>)>(); + + late final _sel_truncateAtOffset_error_1 = + _registerName1("truncateAtOffset:error:"); + late final _sel_synchronizeAndReturnError_1 = + _registerName1("synchronizeAndReturnError:"); + late final _sel_closeAndReturnError_1 = + _registerName1("closeAndReturnError:"); + late final _sel_fileHandleWithStandardInput1 = + _registerName1("fileHandleWithStandardInput"); + ffi.Pointer _objc_msgSend_733( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_733( + obj, + sel, + ); + } + + late final __objc_msgSend_733Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_733 = __objc_msgSend_733Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_fileHandleWithStandardOutput1 = + _registerName1("fileHandleWithStandardOutput"); + late final _sel_fileHandleWithStandardError1 = + _registerName1("fileHandleWithStandardError"); + late final _sel_fileHandleWithNullDevice1 = + _registerName1("fileHandleWithNullDevice"); + late final _sel_fileHandleForReadingAtPath_1 = + _registerName1("fileHandleForReadingAtPath:"); + late final _sel_fileHandleForWritingAtPath_1 = + _registerName1("fileHandleForWritingAtPath:"); + late final _sel_fileHandleForUpdatingAtPath_1 = + _registerName1("fileHandleForUpdatingAtPath:"); + late final _sel_fileHandleForReadingFromURL_error_1 = + _registerName1("fileHandleForReadingFromURL:error:"); + instancetype _objc_msgSend_734( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer> error, + ) { + return __objc_msgSend_734( + obj, + sel, + url, + error, + ); + } + + late final __objc_msgSend_734Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_734 = __objc_msgSend_734Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_fileHandleForWritingToURL_error_1 = + _registerName1("fileHandleForWritingToURL:error:"); + late final _sel_fileHandleForUpdatingURL_error_1 = + _registerName1("fileHandleForUpdatingURL:error:"); + late final _sel_readInBackgroundAndNotifyForModes_1 = + _registerName1("readInBackgroundAndNotifyForModes:"); + late final _sel_readInBackgroundAndNotify1 = + _registerName1("readInBackgroundAndNotify"); + late final _sel_readToEndOfFileInBackgroundAndNotifyForModes_1 = + _registerName1("readToEndOfFileInBackgroundAndNotifyForModes:"); + late final _sel_readToEndOfFileInBackgroundAndNotify1 = + _registerName1("readToEndOfFileInBackgroundAndNotify"); + late final _sel_acceptConnectionInBackgroundAndNotifyForModes_1 = + _registerName1("acceptConnectionInBackgroundAndNotifyForModes:"); + late final _sel_acceptConnectionInBackgroundAndNotify1 = + _registerName1("acceptConnectionInBackgroundAndNotify"); + late final _sel_waitForDataInBackgroundAndNotifyForModes_1 = + _registerName1("waitForDataInBackgroundAndNotifyForModes:"); + late final _sel_waitForDataInBackgroundAndNotify1 = + _registerName1("waitForDataInBackgroundAndNotify"); + late final _sel_readabilityHandler1 = _registerName1("readabilityHandler"); + ffi.Pointer<_ObjCBlock> _objc_msgSend_735( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_735( + obj, + sel, + ); + } + + late final __objc_msgSend_735Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_735 = __objc_msgSend_735Ptr.asFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setReadabilityHandler_1 = + _registerName1("setReadabilityHandler:"); + void _objc_msgSend_736( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> value, + ) { + return __objc_msgSend_736( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_736Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_736 = __objc_msgSend_736Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_writeabilityHandler1 = _registerName1("writeabilityHandler"); + late final _sel_setWriteabilityHandler_1 = + _registerName1("setWriteabilityHandler:"); + late final _sel_initWithFileDescriptor_1 = + _registerName1("initWithFileDescriptor:"); + instancetype _objc_msgSend_737( + ffi.Pointer obj, + ffi.Pointer sel, + int fd, + ) { + return __objc_msgSend_737( + obj, + sel, + fd, + ); + } + + late final __objc_msgSend_737Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Int)>>('objc_msgSend'); + late final __objc_msgSend_737 = __objc_msgSend_737Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_fileDescriptor1 = _registerName1("fileDescriptor"); + late final _sel_readDataToEndOfFile1 = _registerName1("readDataToEndOfFile"); + late final _sel_readDataOfLength_1 = _registerName1("readDataOfLength:"); + late final _sel_offsetInFile1 = _registerName1("offsetInFile"); + late final _sel_seekToEndOfFile1 = _registerName1("seekToEndOfFile"); + late final _sel_seekToFileOffset_1 = _registerName1("seekToFileOffset:"); + void _objc_msgSend_738( + ffi.Pointer obj, + ffi.Pointer sel, + int offset, + ) { + return __objc_msgSend_738( + obj, + sel, + offset, + ); + } + + late final __objc_msgSend_738Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedLongLong)>>('objc_msgSend'); + late final __objc_msgSend_738 = __objc_msgSend_738Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_truncateFileAtOffset_1 = + _registerName1("truncateFileAtOffset:"); + late final _sel_synchronizeFile1 = _registerName1("synchronizeFile"); + late final _sel_closeFile1 = _registerName1("closeFile"); + late final _class_NSHTTPCookieStorage1 = _getClass1("NSHTTPCookieStorage"); + late final _sel_sharedHTTPCookieStorage1 = + _registerName1("sharedHTTPCookieStorage"); + ffi.Pointer _objc_msgSend_739( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_739( + obj, + sel, + ); + } + + late final __objc_msgSend_739Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_739 = __objc_msgSend_739Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_sharedCookieStorageForGroupContainerIdentifier_1 = + _registerName1("sharedCookieStorageForGroupContainerIdentifier:"); + ffi.Pointer _objc_msgSend_740( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer identifier, + ) { + return __objc_msgSend_740( + obj, + sel, + identifier, + ); + } + + late final __objc_msgSend_740Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_740 = __objc_msgSend_740Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_cookies1 = _registerName1("cookies"); + late final _class_NSHTTPCookie1 = _getClass1("NSHTTPCookie"); + late final _sel_initWithProperties_1 = _registerName1("initWithProperties:"); + late final _sel_cookieWithProperties_1 = + _registerName1("cookieWithProperties:"); + ffi.Pointer _objc_msgSend_741( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer properties, + ) { + return __objc_msgSend_741( + obj, + sel, + properties, + ); + } + + late final __objc_msgSend_741Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_741 = __objc_msgSend_741Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_requestHeaderFieldsWithCookies_1 = + _registerName1("requestHeaderFieldsWithCookies:"); + late final _sel_cookiesWithResponseHeaderFields_forURL_1 = + _registerName1("cookiesWithResponseHeaderFields:forURL:"); + ffi.Pointer _objc_msgSend_742( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer headerFields, + ffi.Pointer URL, + ) { + return __objc_msgSend_742( + obj, + sel, + headerFields, + URL, + ); + } + + late final __objc_msgSend_742Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_742 = __objc_msgSend_742Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_properties1 = _registerName1("properties"); + late final _sel_value1 = _registerName1("value"); + late final _sel_expiresDate1 = _registerName1("expiresDate"); + late final _sel_isSessionOnly1 = _registerName1("isSessionOnly"); + late final _sel_isSecure1 = _registerName1("isSecure"); + late final _sel_isHTTPOnly1 = _registerName1("isHTTPOnly"); + late final _sel_comment1 = _registerName1("comment"); + late final _sel_commentURL1 = _registerName1("commentURL"); + late final _sel_portList1 = _registerName1("portList"); + late final _sel_sameSitePolicy1 = _registerName1("sameSitePolicy"); + late final _sel_setCookie_1 = _registerName1("setCookie:"); + void _objc_msgSend_743( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cookie, + ) { + return __objc_msgSend_743( + obj, + sel, + cookie, + ); + } + + late final __objc_msgSend_743Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_743 = __objc_msgSend_743Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_deleteCookie_1 = _registerName1("deleteCookie:"); + late final _sel_removeCookiesSinceDate_1 = + _registerName1("removeCookiesSinceDate:"); + late final _sel_cookiesForURL_1 = _registerName1("cookiesForURL:"); + late final _sel_setCookies_forURL_mainDocumentURL_1 = + _registerName1("setCookies:forURL:mainDocumentURL:"); + void _objc_msgSend_744( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cookies, + ffi.Pointer URL, + ffi.Pointer mainDocumentURL, + ) { + return __objc_msgSend_744( + obj, + sel, + cookies, + URL, + mainDocumentURL, + ); + } + + late final __objc_msgSend_744Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_744 = __objc_msgSend_744Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_cookieAcceptPolicy1 = _registerName1("cookieAcceptPolicy"); + int _objc_msgSend_745( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_745( + obj, + sel, + ); + } + + late final __objc_msgSend_745Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_745 = __objc_msgSend_745Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setCookieAcceptPolicy_1 = + _registerName1("setCookieAcceptPolicy:"); + void _objc_msgSend_746( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_746( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_746Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_746 = __objc_msgSend_746Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_sortedCookiesUsingDescriptors_1 = + _registerName1("sortedCookiesUsingDescriptors:"); + late final _class_NSURLSessionTask1 = _getClass1("NSURLSessionTask"); + late final _sel_taskIdentifier1 = _registerName1("taskIdentifier"); + late final _class_NSURLRequest1 = _getClass1("NSURLRequest"); + late final _sel_requestWithURL_1 = _registerName1("requestWithURL:"); + late final _sel_supportsSecureCoding1 = + _registerName1("supportsSecureCoding"); + late final _sel_requestWithURL_cachePolicy_timeoutInterval_1 = + _registerName1("requestWithURL:cachePolicy:timeoutInterval:"); + instancetype _objc_msgSend_747( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer URL, + int cachePolicy, + double timeoutInterval, + ) { + return __objc_msgSend_747( + obj, + sel, + URL, + cachePolicy, + timeoutInterval, + ); + } + + late final __objc_msgSend_747Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSTimeInterval)>>('objc_msgSend'); + late final __objc_msgSend_747 = __objc_msgSend_747Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, double)>(); + + late final _sel_initWithURL_cachePolicy_timeoutInterval_1 = + _registerName1("initWithURL:cachePolicy:timeoutInterval:"); + late final _sel_URL1 = _registerName1("URL"); + late final _sel_cachePolicy1 = _registerName1("cachePolicy"); + int _objc_msgSend_748( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_748( + obj, + sel, + ); + } + + late final __objc_msgSend_748Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_748 = __objc_msgSend_748Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_timeoutInterval1 = _registerName1("timeoutInterval"); + late final _sel_mainDocumentURL1 = _registerName1("mainDocumentURL"); + late final _sel_networkServiceType1 = _registerName1("networkServiceType"); + int _objc_msgSend_749( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_749( + obj, + sel, + ); + } + + late final __objc_msgSend_749Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_749 = __objc_msgSend_749Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_allowsCellularAccess1 = + _registerName1("allowsCellularAccess"); + late final _sel_allowsExpensiveNetworkAccess1 = + _registerName1("allowsExpensiveNetworkAccess"); + late final _sel_allowsConstrainedNetworkAccess1 = + _registerName1("allowsConstrainedNetworkAccess"); + late final _sel_assumesHTTP3Capable1 = _registerName1("assumesHTTP3Capable"); + late final _sel_attribution1 = _registerName1("attribution"); + int _objc_msgSend_750( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_750( + obj, + sel, + ); + } + + late final __objc_msgSend_750Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_750 = __objc_msgSend_750Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_HTTPMethod1 = _registerName1("HTTPMethod"); + late final _sel_allHTTPHeaderFields1 = _registerName1("allHTTPHeaderFields"); + late final _sel_valueForHTTPHeaderField_1 = + _registerName1("valueForHTTPHeaderField:"); + late final _sel_HTTPBody1 = _registerName1("HTTPBody"); + late final _class_NSInputStream1 = _getClass1("NSInputStream"); + late final _class_NSStream1 = _getClass1("NSStream"); + late final _sel_open1 = _registerName1("open"); + late final _sel_close1 = _registerName1("close"); + late final _sel_streamStatus1 = _registerName1("streamStatus"); + int _objc_msgSend_751( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_751( + obj, + sel, + ); + } + + late final __objc_msgSend_751Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_751 = __objc_msgSend_751Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_streamError1 = _registerName1("streamError"); + late final _class_NSOutputStream1 = _getClass1("NSOutputStream"); + late final _sel_write_maxLength_1 = _registerName1("write:maxLength:"); + int _objc_msgSend_752( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + int len, + ) { + return __objc_msgSend_752( + obj, + sel, + buffer, + len, + ); + } + + late final __objc_msgSend_752Ptr = _lookup< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_752 = __objc_msgSend_752Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_hasSpaceAvailable1 = _registerName1("hasSpaceAvailable"); + late final _sel_initToMemory1 = _registerName1("initToMemory"); + late final _sel_initToBuffer_capacity_1 = + _registerName1("initToBuffer:capacity:"); + instancetype _objc_msgSend_753( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + int capacity, + ) { + return __objc_msgSend_753( + obj, + sel, + buffer, + capacity, + ); + } + + late final __objc_msgSend_753Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_753 = __objc_msgSend_753Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_initWithURL_append_1 = _registerName1("initWithURL:append:"); + late final _sel_initToFileAtPath_append_1 = + _registerName1("initToFileAtPath:append:"); + late final _sel_outputStreamToMemory1 = + _registerName1("outputStreamToMemory"); + late final _sel_outputStreamToBuffer_capacity_1 = + _registerName1("outputStreamToBuffer:capacity:"); + late final _sel_outputStreamToFileAtPath_append_1 = + _registerName1("outputStreamToFileAtPath:append:"); + late final _sel_outputStreamWithURL_append_1 = + _registerName1("outputStreamWithURL:append:"); + late final _sel_getStreamsToHostWithName_port_inputStream_outputStream_1 = + _registerName1("getStreamsToHostWithName:port:inputStream:outputStream:"); + void _objc_msgSend_754( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer hostname, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream, + ) { + return __objc_msgSend_754( + obj, + sel, + hostname, + port, + inputStream, + outputStream, + ); + } + + late final __objc_msgSend_754Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_754 = __objc_msgSend_754Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _class_NSHost1 = _getClass1("NSHost"); + late final _sel_currentHost1 = _registerName1("currentHost"); + late final _sel_hostWithName_1 = _registerName1("hostWithName:"); + late final _sel_hostWithAddress_1 = _registerName1("hostWithAddress:"); + late final _sel_isEqualToHost_1 = _registerName1("isEqualToHost:"); + bool _objc_msgSend_755( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aHost, + ) { + return __objc_msgSend_755( + obj, + sel, + aHost, + ); + } + + late final __objc_msgSend_755Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_755 = __objc_msgSend_755Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_names1 = _registerName1("names"); + late final _sel_address1 = _registerName1("address"); + late final _sel_addresses1 = _registerName1("addresses"); + late final _sel_localizedName1 = _registerName1("localizedName"); + late final _sel_setHostCacheEnabled_1 = + _registerName1("setHostCacheEnabled:"); + void _objc_msgSend_756( + ffi.Pointer obj, + ffi.Pointer sel, + bool flag, + ) { + return __objc_msgSend_756( + obj, + sel, + flag, + ); + } + + late final __objc_msgSend_756Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_756 = __objc_msgSend_756Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_isHostCacheEnabled1 = _registerName1("isHostCacheEnabled"); + late final _sel_flushHostCache1 = _registerName1("flushHostCache"); + late final _sel_getStreamsToHost_port_inputStream_outputStream_1 = + _registerName1("getStreamsToHost:port:inputStream:outputStream:"); + void _objc_msgSend_757( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer host, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream, + ) { + return __objc_msgSend_757( + obj, + sel, + host, + port, + inputStream, + outputStream, + ); + } + + late final __objc_msgSend_757Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_757 = __objc_msgSend_757Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_getBoundStreamsWithBufferSize_inputStream_outputStream_1 = + _registerName1("getBoundStreamsWithBufferSize:inputStream:outputStream:"); + void _objc_msgSend_758( + ffi.Pointer obj, + ffi.Pointer sel, + int bufferSize, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream, + ) { + return __objc_msgSend_758( + obj, + sel, + bufferSize, + inputStream, + outputStream, + ); + } + + late final __objc_msgSend_758Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_758 = __objc_msgSend_758Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_read_maxLength_1 = _registerName1("read:maxLength:"); + late final _sel_getBuffer_length_1 = _registerName1("getBuffer:length:"); + bool _objc_msgSend_759( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> buffer, + ffi.Pointer len, + ) { + return __objc_msgSend_759( + obj, + sel, + buffer, + len, + ); + } + + late final __objc_msgSend_759Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_759 = __objc_msgSend_759Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, ffi.Pointer)>(); + + late final _sel_hasBytesAvailable1 = _registerName1("hasBytesAvailable"); + late final _sel_initWithFileAtPath_1 = _registerName1("initWithFileAtPath:"); + late final _sel_inputStreamWithData_1 = + _registerName1("inputStreamWithData:"); + late final _sel_inputStreamWithFileAtPath_1 = + _registerName1("inputStreamWithFileAtPath:"); + late final _sel_inputStreamWithURL_1 = _registerName1("inputStreamWithURL:"); + late final _sel_HTTPBodyStream1 = _registerName1("HTTPBodyStream"); + ffi.Pointer _objc_msgSend_760( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_760( + obj, + sel, + ); + } + + late final __objc_msgSend_760Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_760 = __objc_msgSend_760Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_HTTPShouldHandleCookies1 = + _registerName1("HTTPShouldHandleCookies"); + late final _sel_HTTPShouldUsePipelining1 = + _registerName1("HTTPShouldUsePipelining"); + late final _sel_originalRequest1 = _registerName1("originalRequest"); + ffi.Pointer _objc_msgSend_761( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_761( + obj, + sel, + ); + } + + late final __objc_msgSend_761Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_761 = __objc_msgSend_761Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_currentRequest1 = _registerName1("currentRequest"); + late final _class_NSURLResponse1 = _getClass1("NSURLResponse"); + late final _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_1 = + _registerName1( + "initWithURL:MIMEType:expectedContentLength:textEncodingName:"); + instancetype _objc_msgSend_762( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer URL, + ffi.Pointer MIMEType, + int length, + ffi.Pointer name, + ) { + return __objc_msgSend_762( + obj, + sel, + URL, + MIMEType, + length, + name, + ); + } + + late final __objc_msgSend_762Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_762 = __objc_msgSend_762Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final _sel_MIMEType1 = _registerName1("MIMEType"); + late final _sel_expectedContentLength1 = + _registerName1("expectedContentLength"); + late final _sel_textEncodingName1 = _registerName1("textEncodingName"); + late final _sel_suggestedFilename1 = _registerName1("suggestedFilename"); + late final _sel_response1 = _registerName1("response"); + ffi.Pointer _objc_msgSend_763( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_763( + obj, + sel, + ); + } + + late final __objc_msgSend_763Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_763 = __objc_msgSend_763Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_progress1 = _registerName1("progress"); + late final _sel_earliestBeginDate1 = _registerName1("earliestBeginDate"); + late final _sel_setEarliestBeginDate_1 = + _registerName1("setEarliestBeginDate:"); + late final _sel_countOfBytesClientExpectsToSend1 = + _registerName1("countOfBytesClientExpectsToSend"); + late final _sel_setCountOfBytesClientExpectsToSend_1 = + _registerName1("setCountOfBytesClientExpectsToSend:"); + late final _sel_countOfBytesClientExpectsToReceive1 = + _registerName1("countOfBytesClientExpectsToReceive"); + late final _sel_setCountOfBytesClientExpectsToReceive_1 = + _registerName1("setCountOfBytesClientExpectsToReceive:"); + late final _sel_countOfBytesSent1 = _registerName1("countOfBytesSent"); + late final _sel_countOfBytesReceived1 = + _registerName1("countOfBytesReceived"); + late final _sel_countOfBytesExpectedToSend1 = + _registerName1("countOfBytesExpectedToSend"); + late final _sel_countOfBytesExpectedToReceive1 = + _registerName1("countOfBytesExpectedToReceive"); + late final _sel_taskDescription1 = _registerName1("taskDescription"); + late final _sel_setTaskDescription_1 = _registerName1("setTaskDescription:"); + late final _sel_state1 = _registerName1("state"); + int _objc_msgSend_764( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_764( + obj, + sel, + ); + } + + late final __objc_msgSend_764Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_764 = __objc_msgSend_764Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_suspend1 = _registerName1("suspend"); + late final _sel_priority1 = _registerName1("priority"); + late final _sel_setPriority_1 = _registerName1("setPriority:"); + void _objc_msgSend_765( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_765( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_765Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Float)>>('objc_msgSend'); + late final __objc_msgSend_765 = __objc_msgSend_765Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_prefersIncrementalDelivery1 = + _registerName1("prefersIncrementalDelivery"); + late final _sel_setPrefersIncrementalDelivery_1 = + _registerName1("setPrefersIncrementalDelivery:"); + late final _sel_storeCookies_forTask_1 = + _registerName1("storeCookies:forTask:"); + void _objc_msgSend_766( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cookies, + ffi.Pointer task, + ) { + return __objc_msgSend_766( + obj, + sel, + cookies, + task, + ); + } + + late final __objc_msgSend_766Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_766 = __objc_msgSend_766Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_getCookiesForTask_completionHandler_1 = + _registerName1("getCookiesForTask:completionHandler:"); + void _objc_msgSend_767( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer task, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_767( + obj, + sel, + task, + completionHandler, + ); + } + + late final __objc_msgSend_767Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_767 = __objc_msgSend_767Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _class_NSIndexPath1 = _getClass1("NSIndexPath"); + late final _sel_indexPathWithIndex_1 = _registerName1("indexPathWithIndex:"); + late final _sel_indexPathWithIndexes_length_1 = + _registerName1("indexPathWithIndexes:length:"); + instancetype _objc_msgSend_768( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexes, + int length, + ) { + return __objc_msgSend_768( + obj, + sel, + indexes, + length, + ); + } + + late final __objc_msgSend_768Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_768 = __objc_msgSend_768Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_initWithIndexes_length_1 = + _registerName1("initWithIndexes:length:"); + late final _sel_indexPathByAddingIndex_1 = + _registerName1("indexPathByAddingIndex:"); + ffi.Pointer _objc_msgSend_769( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_769( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_769Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_769 = __objc_msgSend_769Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_indexPathByRemovingLastIndex1 = + _registerName1("indexPathByRemovingLastIndex"); + ffi.Pointer _objc_msgSend_770( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_770( + obj, + sel, + ); + } + + late final __objc_msgSend_770Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_770 = __objc_msgSend_770Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_indexAtPosition_1 = _registerName1("indexAtPosition:"); + late final _sel_getIndexes_range_1 = _registerName1("getIndexes:range:"); + void _objc_msgSend_771( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexes, + NSRange positionRange, + ) { + return __objc_msgSend_771( + obj, + sel, + indexes, + positionRange, + ); + } + + late final __objc_msgSend_771Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_771 = __objc_msgSend_771Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>(); + + int _objc_msgSend_772( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherObject, + ) { + return __objc_msgSend_772( + obj, + sel, + otherObject, + ); + } + + late final __objc_msgSend_772Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_772 = __objc_msgSend_772Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_getIndexes_1 = _registerName1("getIndexes:"); + void _objc_msgSend_773( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexes, + ) { + return __objc_msgSend_773( + obj, + sel, + indexes, + ); + } + + late final __objc_msgSend_773Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_773 = __objc_msgSend_773Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSInflectionRule1 = _getClass1("NSInflectionRule"); + late final _sel_automaticRule1 = _registerName1("automaticRule"); + ffi.Pointer _objc_msgSend_774( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_774( + obj, + sel, + ); + } + + late final __objc_msgSend_774Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_774 = __objc_msgSend_774Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_canInflectLanguage_1 = _registerName1("canInflectLanguage:"); + late final _sel_canInflectPreferredLocalization1 = + _registerName1("canInflectPreferredLocalization"); + late final _class_NSMorphology1 = _getClass1("NSMorphology"); + late final _sel_grammaticalGender1 = _registerName1("grammaticalGender"); + int _objc_msgSend_775( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_775( + obj, + sel, + ); + } + + late final __objc_msgSend_775Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_775 = __objc_msgSend_775Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setGrammaticalGender_1 = + _registerName1("setGrammaticalGender:"); + void _objc_msgSend_776( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_776( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_776Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_776 = __objc_msgSend_776Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_partOfSpeech1 = _registerName1("partOfSpeech"); + int _objc_msgSend_777( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_777( + obj, + sel, + ); + } + + late final __objc_msgSend_777Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_777 = __objc_msgSend_777Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setPartOfSpeech_1 = _registerName1("setPartOfSpeech:"); + void _objc_msgSend_778( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_778( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_778Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_778 = __objc_msgSend_778Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_number1 = _registerName1("number"); + int _objc_msgSend_779( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_779( + obj, + sel, + ); + } + + late final __objc_msgSend_779Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_779 = __objc_msgSend_779Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setNumber_1 = _registerName1("setNumber:"); + void _objc_msgSend_780( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_780( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_780Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_780 = __objc_msgSend_780Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _class_NSMorphologyCustomPronoun1 = + _getClass1("NSMorphologyCustomPronoun"); + late final _sel_isSupportedForLanguage_1 = + _registerName1("isSupportedForLanguage:"); + late final _sel_requiredKeysForLanguage_1 = + _registerName1("requiredKeysForLanguage:"); + late final _sel_subjectForm1 = _registerName1("subjectForm"); + late final _sel_setSubjectForm_1 = _registerName1("setSubjectForm:"); + late final _sel_objectForm1 = _registerName1("objectForm"); + late final _sel_setObjectForm_1 = _registerName1("setObjectForm:"); + late final _sel_possessiveForm1 = _registerName1("possessiveForm"); + late final _sel_setPossessiveForm_1 = _registerName1("setPossessiveForm:"); + late final _sel_possessiveAdjectiveForm1 = + _registerName1("possessiveAdjectiveForm"); + late final _sel_setPossessiveAdjectiveForm_1 = + _registerName1("setPossessiveAdjectiveForm:"); + late final _sel_reflexiveForm1 = _registerName1("reflexiveForm"); + late final _sel_setReflexiveForm_1 = _registerName1("setReflexiveForm:"); + late final _sel_customPronounForLanguage_1 = + _registerName1("customPronounForLanguage:"); + ffi.Pointer _objc_msgSend_781( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer language, + ) { + return __objc_msgSend_781( + obj, + sel, + language, + ); + } + + late final __objc_msgSend_781Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_781 = __objc_msgSend_781Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setCustomPronoun_forLanguage_error_1 = + _registerName1("setCustomPronoun:forLanguage:error:"); + bool _objc_msgSend_782( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer features, + ffi.Pointer language, + ffi.Pointer> error, + ) { + return __objc_msgSend_782( + obj, + sel, + features, + language, + error, + ); + } + + late final __objc_msgSend_782Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_782 = __objc_msgSend_782Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_isUnspecified1 = _registerName1("isUnspecified"); + late final _sel_userMorphology1 = _registerName1("userMorphology"); + ffi.Pointer _objc_msgSend_783( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_783( + obj, + sel, + ); + } + + late final __objc_msgSend_783Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_783 = __objc_msgSend_783Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSOperationQueue1 = _getClass1("NSOperationQueue"); + late final _class_NSOperation1 = _getClass1("NSOperation"); + late final _sel_isConcurrent1 = _registerName1("isConcurrent"); + late final _sel_isAsynchronous1 = _registerName1("isAsynchronous"); + late final _sel_isReady1 = _registerName1("isReady"); + late final _sel_addDependency_1 = _registerName1("addDependency:"); + void _objc_msgSend_784( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer op, + ) { + return __objc_msgSend_784( + obj, + sel, + op, + ); + } + + late final __objc_msgSend_784Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_784 = __objc_msgSend_784Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeDependency_1 = _registerName1("removeDependency:"); + late final _sel_dependencies1 = _registerName1("dependencies"); + late final _sel_queuePriority1 = _registerName1("queuePriority"); + int _objc_msgSend_785( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_785( + obj, + sel, + ); + } + + late final __objc_msgSend_785Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_785 = __objc_msgSend_785Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setQueuePriority_1 = _registerName1("setQueuePriority:"); + void _objc_msgSend_786( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_786( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_786Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_786 = __objc_msgSend_786Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_completionBlock1 = _registerName1("completionBlock"); + late final _sel_setCompletionBlock_1 = _registerName1("setCompletionBlock:"); + late final _sel_waitUntilFinished1 = _registerName1("waitUntilFinished"); + late final _sel_addOperation_1 = _registerName1("addOperation:"); + late final _sel_addOperations_waitUntilFinished_1 = + _registerName1("addOperations:waitUntilFinished:"); + void _objc_msgSend_787( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer ops, + bool wait, + ) { + return __objc_msgSend_787( + obj, + sel, + ops, + wait, + ); + } + + late final __objc_msgSend_787Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_787 = __objc_msgSend_787Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_addOperationWithBlock_1 = + _registerName1("addOperationWithBlock:"); + late final _sel_addBarrierBlock_1 = _registerName1("addBarrierBlock:"); + late final _sel_maxConcurrentOperationCount1 = + _registerName1("maxConcurrentOperationCount"); + late final _sel_setMaxConcurrentOperationCount_1 = + _registerName1("setMaxConcurrentOperationCount:"); + late final _sel_isSuspended1 = _registerName1("isSuspended"); + late final _sel_setSuspended_1 = _registerName1("setSuspended:"); + late final _sel_underlyingQueue1 = _registerName1("underlyingQueue"); + dispatch_queue_t _objc_msgSend_788( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_788( + obj, + sel, + ); + } + + late final __objc_msgSend_788Ptr = _lookup< + ffi.NativeFunction< + dispatch_queue_t Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_788 = __objc_msgSend_788Ptr.asFunction< + dispatch_queue_t Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setUnderlyingQueue_1 = _registerName1("setUnderlyingQueue:"); + void _objc_msgSend_789( + ffi.Pointer obj, + ffi.Pointer sel, + dispatch_queue_t value, + ) { + return __objc_msgSend_789( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_789Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + dispatch_queue_t)>>('objc_msgSend'); + late final __objc_msgSend_789 = __objc_msgSend_789Ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, dispatch_queue_t)>(); + + late final _sel_cancelAllOperations1 = _registerName1("cancelAllOperations"); + late final _sel_waitUntilAllOperationsAreFinished1 = + _registerName1("waitUntilAllOperationsAreFinished"); + late final _sel_currentQueue1 = _registerName1("currentQueue"); + ffi.Pointer _objc_msgSend_790( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_790( + obj, + sel, + ); + } + + late final __objc_msgSend_790Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_790 = __objc_msgSend_790Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_mainQueue1 = _registerName1("mainQueue"); + late final _sel_operations1 = _registerName1("operations"); + late final _sel_operationCount1 = _registerName1("operationCount"); + late final _class_NSPointerArray1 = _getClass1("NSPointerArray"); + late final _sel_initWithOptions_1 = _registerName1("initWithOptions:"); + instancetype _objc_msgSend_791( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_791( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_791Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_791 = __objc_msgSend_791Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _class_NSPointerFunctions1 = _getClass1("NSPointerFunctions"); + late final _sel_pointerFunctionsWithOptions_1 = + _registerName1("pointerFunctionsWithOptions:"); + ffi.Pointer _objc_msgSend_792( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_792( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_792Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_792 = __objc_msgSend_792Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_hashFunction1 = _registerName1("hashFunction"); + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + _objc_msgSend_793( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_793( + obj, + sel, + ); + } + + late final __objc_msgSend_793Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); + late final __objc_msgSend_793 = __objc_msgSend_793Ptr.asFunction< + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setHashFunction_1 = _registerName1("setHashFunction:"); + void _objc_msgSend_794( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + value, + ) { + return __objc_msgSend_794( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_794Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>)>>)>>( + 'objc_msgSend'); + late final __objc_msgSend_794 = __objc_msgSend_794Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>)>>)>(); + + late final _sel_isEqualFunction1 = _registerName1("isEqualFunction"); + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + _objc_msgSend_795( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_795( + obj, + sel, + ); + } + + late final __objc_msgSend_795Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); + late final __objc_msgSend_795 = __objc_msgSend_795Ptr.asFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setIsEqualFunction_1 = _registerName1("setIsEqualFunction:"); + void _objc_msgSend_796( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + value, + ) { + return __objc_msgSend_796( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_796Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>)>>)>>( + 'objc_msgSend'); + late final __objc_msgSend_796 = __objc_msgSend_796Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>)>>)>(); + + late final _sel_sizeFunction1 = _registerName1("sizeFunction"); + ffi.Pointer)>> + _objc_msgSend_797( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_797( + obj, + sel, + ); + } + + late final __objc_msgSend_797Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); + late final __objc_msgSend_797 = __objc_msgSend_797Ptr.asFunction< + ffi.Pointer< + ffi.NativeFunction)>> + Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setSizeFunction_1 = _registerName1("setSizeFunction:"); + void _objc_msgSend_798( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer)>> + value, + ) { + return __objc_msgSend_798( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_798Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>)>>('objc_msgSend'); + late final __objc_msgSend_798 = __objc_msgSend_798Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>(); + + late final _sel_descriptionFunction1 = _registerName1("descriptionFunction"); + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>> + _objc_msgSend_799( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_799( + obj, + sel, + ); + } + + late final __objc_msgSend_799Ptr = + _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); + late final __objc_msgSend_799 = __objc_msgSend_799Ptr.asFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>> + Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setDescriptionFunction_1 = + _registerName1("setDescriptionFunction:"); + void _objc_msgSend_800( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>> + value, + ) { + return __objc_msgSend_800( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_800Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>)>>('objc_msgSend'); + late final __objc_msgSend_800 = __objc_msgSend_800Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>>)>(); + + late final _sel_relinquishFunction1 = _registerName1("relinquishFunction"); + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + _objc_msgSend_801( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_801( + obj, + sel, + ); + } + + late final __objc_msgSend_801Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); + late final __objc_msgSend_801 = __objc_msgSend_801Ptr.asFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setRelinquishFunction_1 = + _registerName1("setRelinquishFunction:"); + void _objc_msgSend_802( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + value, + ) { + return __objc_msgSend_802( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_802Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>)>>)>>( + 'objc_msgSend'); + late final __objc_msgSend_802 = __objc_msgSend_802Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>)>>)>(); + + late final _sel_acquireFunction1 = _registerName1("acquireFunction"); + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>, + ffi.Bool)>> _objc_msgSend_803( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_803( + obj, + sel, + ); + } + + late final __objc_msgSend_803Ptr = + _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>, + ffi.Bool)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); + late final __objc_msgSend_803 = __objc_msgSend_803Ptr.asFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>, + ffi.Bool)>> + Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setAcquireFunction_1 = _registerName1("setAcquireFunction:"); + void _objc_msgSend_804( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>, + ffi.Bool)>> + value, + ) { + return __objc_msgSend_804( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_804Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>, + ffi.Bool)>>)>>('objc_msgSend'); + late final __objc_msgSend_804 = __objc_msgSend_804Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>, + ffi.Bool)>>)>(); + + late final _sel_usesStrongWriteBarrier1 = + _registerName1("usesStrongWriteBarrier"); + late final _sel_setUsesStrongWriteBarrier_1 = + _registerName1("setUsesStrongWriteBarrier:"); + late final _sel_usesWeakReadAndWriteBarriers1 = + _registerName1("usesWeakReadAndWriteBarriers"); + late final _sel_setUsesWeakReadAndWriteBarriers_1 = + _registerName1("setUsesWeakReadAndWriteBarriers:"); + late final _sel_initWithPointerFunctions_1 = + _registerName1("initWithPointerFunctions:"); + instancetype _objc_msgSend_805( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer functions, + ) { + return __objc_msgSend_805( + obj, + sel, + functions, + ); + } + + late final __objc_msgSend_805Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_805 = __objc_msgSend_805Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_pointerArrayWithOptions_1 = + _registerName1("pointerArrayWithOptions:"); + ffi.Pointer _objc_msgSend_806( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_806( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_806Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_806 = __objc_msgSend_806Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_pointerArrayWithPointerFunctions_1 = + _registerName1("pointerArrayWithPointerFunctions:"); + ffi.Pointer _objc_msgSend_807( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer functions, + ) { + return __objc_msgSend_807( + obj, + sel, + functions, + ); + } + + late final __objc_msgSend_807Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_807 = __objc_msgSend_807Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_pointerFunctions1 = _registerName1("pointerFunctions"); + ffi.Pointer _objc_msgSend_808( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_808( + obj, + sel, + ); + } + + late final __objc_msgSend_808Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_808 = __objc_msgSend_808Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_pointerAtIndex_1 = _registerName1("pointerAtIndex:"); + ffi.Pointer _objc_msgSend_809( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_809( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_809Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_809 = __objc_msgSend_809Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_addPointer_1 = _registerName1("addPointer:"); + late final _sel_removePointerAtIndex_1 = + _registerName1("removePointerAtIndex:"); + late final _sel_insertPointer_atIndex_1 = + _registerName1("insertPointer:atIndex:"); + late final _sel_replacePointerAtIndex_withPointer_1 = + _registerName1("replacePointerAtIndex:withPointer:"); + void _objc_msgSend_810( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer item, + ) { + return __objc_msgSend_810( + obj, + sel, + index, + item, + ); + } + + late final __objc_msgSend_810Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_810 = __objc_msgSend_810Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_compact1 = _registerName1("compact"); + late final _sel_setCount_1 = _registerName1("setCount:"); + late final _sel_pointerArrayWithStrongObjects1 = + _registerName1("pointerArrayWithStrongObjects"); + late final _sel_pointerArrayWithWeakObjects1 = + _registerName1("pointerArrayWithWeakObjects"); + late final _sel_strongObjectsPointerArray1 = + _registerName1("strongObjectsPointerArray"); + ffi.Pointer _objc_msgSend_811( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_811( + obj, + sel, + ); + } + + late final __objc_msgSend_811Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_811 = __objc_msgSend_811Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_weakObjectsPointerArray1 = + _registerName1("weakObjectsPointerArray"); + late final _class_NSProcessInfo1 = _getClass1("NSProcessInfo"); + late final _sel_processInfo1 = _registerName1("processInfo"); + ffi.Pointer _objc_msgSend_812( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_812( + obj, + sel, + ); + } + + late final __objc_msgSend_812Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_812 = __objc_msgSend_812Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_environment1 = _registerName1("environment"); + late final _sel_hostName1 = _registerName1("hostName"); + late final _sel_processName1 = _registerName1("processName"); + late final _sel_setProcessName_1 = _registerName1("setProcessName:"); + late final _sel_processIdentifier1 = _registerName1("processIdentifier"); + late final _sel_globallyUniqueString1 = + _registerName1("globallyUniqueString"); + late final _sel_operatingSystem1 = _registerName1("operatingSystem"); + late final _sel_operatingSystemName1 = _registerName1("operatingSystemName"); + late final _sel_operatingSystemVersionString1 = + _registerName1("operatingSystemVersionString"); + late final _sel_operatingSystemVersion1 = + _registerName1("operatingSystemVersion"); + NSOperatingSystemVersion _objc_msgSend_813( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_813( + obj, + sel, + ); + } + + late final __objc_msgSend_813Ptr = _lookup< + ffi.NativeFunction< + NSOperatingSystemVersion Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_813 = __objc_msgSend_813Ptr.asFunction< + NSOperatingSystemVersion Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_processorCount1 = _registerName1("processorCount"); + late final _sel_activeProcessorCount1 = + _registerName1("activeProcessorCount"); + late final _sel_physicalMemory1 = _registerName1("physicalMemory"); + late final _sel_isOperatingSystemAtLeastVersion_1 = + _registerName1("isOperatingSystemAtLeastVersion:"); + bool _objc_msgSend_814( + ffi.Pointer obj, + ffi.Pointer sel, + NSOperatingSystemVersion version, + ) { + return __objc_msgSend_814( + obj, + sel, + version, + ); + } + + late final __objc_msgSend_814Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + NSOperatingSystemVersion)>>('objc_msgSend'); + late final __objc_msgSend_814 = __objc_msgSend_814Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + NSOperatingSystemVersion)>(); + + late final _sel_systemUptime1 = _registerName1("systemUptime"); + late final _sel_disableSuddenTermination1 = + _registerName1("disableSuddenTermination"); + late final _sel_enableSuddenTermination1 = + _registerName1("enableSuddenTermination"); + late final _sel_disableAutomaticTermination_1 = + _registerName1("disableAutomaticTermination:"); + late final _sel_enableAutomaticTermination_1 = + _registerName1("enableAutomaticTermination:"); + late final _sel_automaticTerminationSupportEnabled1 = + _registerName1("automaticTerminationSupportEnabled"); + late final _sel_setAutomaticTerminationSupportEnabled_1 = + _registerName1("setAutomaticTerminationSupportEnabled:"); + late final _sel_beginActivityWithOptions_reason_1 = + _registerName1("beginActivityWithOptions:reason:"); + ffi.Pointer _objc_msgSend_815( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ffi.Pointer reason, + ) { + return __objc_msgSend_815( + obj, + sel, + options, + reason, + ); + } + + late final __objc_msgSend_815Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_815 = __objc_msgSend_815Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_endActivity_1 = _registerName1("endActivity:"); + late final _sel_performActivityWithOptions_reason_usingBlock_1 = + _registerName1("performActivityWithOptions:reason:usingBlock:"); + void _objc_msgSend_816( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ffi.Pointer reason, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_816( + obj, + sel, + options, + reason, + block, + ); + } + + late final __objc_msgSend_816Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_816 = __objc_msgSend_816Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_performExpiringActivityWithReason_usingBlock_1 = + _registerName1("performExpiringActivityWithReason:usingBlock:"); + void _objc_msgSend_817( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer reason, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_817( + obj, + sel, + reason, + block, + ); + } + + late final __objc_msgSend_817Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_817 = __objc_msgSend_817Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_userName1 = _registerName1("userName"); + late final _sel_fullUserName1 = _registerName1("fullUserName"); + late final _sel_thermalState1 = _registerName1("thermalState"); + int _objc_msgSend_818( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_818( + obj, + sel, + ); + } + + late final __objc_msgSend_818Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_818 = __objc_msgSend_818Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isLowPowerModeEnabled1 = + _registerName1("isLowPowerModeEnabled"); + late final _sel_isMacCatalystApp1 = _registerName1("isMacCatalystApp"); + late final _sel_isiOSAppOnMac1 = _registerName1("isiOSAppOnMac"); + late final _class_NSTextCheckingResult1 = _getClass1("NSTextCheckingResult"); + late final _sel_resultType1 = _registerName1("resultType"); + int _objc_msgSend_819( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_819( + obj, + sel, + ); + } + + late final __objc_msgSend_819Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_819 = __objc_msgSend_819Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_range1 = _registerName1("range"); + late final _sel_orthography1 = _registerName1("orthography"); + ffi.Pointer _objc_msgSend_820( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_820( + obj, + sel, + ); + } + + late final __objc_msgSend_820Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_820 = __objc_msgSend_820Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_grammarDetails1 = _registerName1("grammarDetails"); + late final _sel_duration1 = _registerName1("duration"); + late final _sel_components1 = _registerName1("components"); + late final _sel_replacementString1 = _registerName1("replacementString"); + late final _sel_alternativeStrings1 = _registerName1("alternativeStrings"); + late final _class_NSRegularExpression1 = _getClass1("NSRegularExpression"); + late final _sel_regularExpressionWithPattern_options_error_1 = + _registerName1("regularExpressionWithPattern:options:error:"); + ffi.Pointer _objc_msgSend_821( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer pattern, + int options, + ffi.Pointer> error, + ) { + return __objc_msgSend_821( + obj, + sel, + pattern, + options, + error, + ); + } + + late final __objc_msgSend_821Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_821 = __objc_msgSend_821Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_initWithPattern_options_error_1 = + _registerName1("initWithPattern:options:error:"); + instancetype _objc_msgSend_822( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer pattern, + int options, + ffi.Pointer> error, + ) { + return __objc_msgSend_822( + obj, + sel, + pattern, + options, + error, + ); + } + + late final __objc_msgSend_822Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_822 = __objc_msgSend_822Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_pattern1 = _registerName1("pattern"); + late final _sel_options1 = _registerName1("options"); + int _objc_msgSend_823( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_823( + obj, + sel, + ); + } + + late final __objc_msgSend_823Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_823 = __objc_msgSend_823Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_numberOfCaptureGroups1 = + _registerName1("numberOfCaptureGroups"); + late final _sel_escapedPatternForString_1 = + _registerName1("escapedPatternForString:"); + late final _sel_enumerateMatchesInString_options_range_usingBlock_1 = + _registerName1("enumerateMatchesInString:options:range:usingBlock:"); + void _objc_msgSend_824( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + NSRange range, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_824( + obj, + sel, + string, + options, + range, + block, + ); + } + + late final __objc_msgSend_824Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_824 = __objc_msgSend_824Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_matchesInString_options_range_1 = + _registerName1("matchesInString:options:range:"); + ffi.Pointer _objc_msgSend_825( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + NSRange range, + ) { + return __objc_msgSend_825( + obj, + sel, + string, + options, + range, + ); + } + + late final __objc_msgSend_825Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_825 = __objc_msgSend_825Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, NSRange)>(); + + late final _sel_numberOfMatchesInString_options_range_1 = + _registerName1("numberOfMatchesInString:options:range:"); + int _objc_msgSend_826( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + NSRange range, + ) { + return __objc_msgSend_826( + obj, + sel, + string, + options, + range, + ); + } + + late final __objc_msgSend_826Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_826 = __objc_msgSend_826Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange)>(); + + late final _sel_firstMatchInString_options_range_1 = + _registerName1("firstMatchInString:options:range:"); + ffi.Pointer _objc_msgSend_827( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + NSRange range, + ) { + return __objc_msgSend_827( + obj, + sel, + string, + options, + range, + ); + } + + late final __objc_msgSend_827Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_827 = __objc_msgSend_827Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, NSRange)>(); + + late final _sel_rangeOfFirstMatchInString_options_range_1 = + _registerName1("rangeOfFirstMatchInString:options:range:"); + NSRange _objc_msgSend_828( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + NSRange range, + ) { + return __objc_msgSend_828( + obj, + sel, + string, + options, + range, + ); + } + + late final __objc_msgSend_828Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_828 = __objc_msgSend_828Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange)>(); + + late final _sel_stringByReplacingMatchesInString_options_range_withTemplate_1 = + _registerName1( + "stringByReplacingMatchesInString:options:range:withTemplate:"); + ffi.Pointer _objc_msgSend_829( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + NSRange range, + ffi.Pointer templ, + ) { + return __objc_msgSend_829( + obj, + sel, + string, + options, + range, + templ, + ); + } + + late final __objc_msgSend_829Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_829 = __objc_msgSend_829Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + NSRange, + ffi.Pointer)>(); + + late final _sel_replaceMatchesInString_options_range_withTemplate_1 = + _registerName1("replaceMatchesInString:options:range:withTemplate:"); + int _objc_msgSend_830( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + NSRange range, + ffi.Pointer templ, + ) { + return __objc_msgSend_830( + obj, + sel, + string, + options, + range, + templ, + ); + } + + late final __objc_msgSend_830Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_830 = __objc_msgSend_830Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange, ffi.Pointer)>(); + + late final _sel_replacementStringForResult_inString_offset_template_1 = + _registerName1("replacementStringForResult:inString:offset:template:"); + ffi.Pointer _objc_msgSend_831( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ffi.Pointer string, + int offset, + ffi.Pointer templ, + ) { + return __objc_msgSend_831( + obj, + sel, + result, + string, + offset, + templ, + ); + } + + late final __objc_msgSend_831Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_831 = __objc_msgSend_831Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final _sel_escapedTemplateForString_1 = + _registerName1("escapedTemplateForString:"); + late final _sel_regularExpression1 = _registerName1("regularExpression"); + ffi.Pointer _objc_msgSend_832( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_832( + obj, + sel, + ); + } + + late final __objc_msgSend_832Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_832 = __objc_msgSend_832Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_phoneNumber1 = _registerName1("phoneNumber"); + late final _sel_numberOfRanges1 = _registerName1("numberOfRanges"); + late final _sel_rangeAtIndex_1 = _registerName1("rangeAtIndex:"); + late final _sel_rangeWithName_1 = _registerName1("rangeWithName:"); + late final _sel_resultByAdjustingRangesWithOffset_1 = + _registerName1("resultByAdjustingRangesWithOffset:"); + ffi.Pointer _objc_msgSend_833( + ffi.Pointer obj, + ffi.Pointer sel, + int offset, + ) { + return __objc_msgSend_833( + obj, + sel, + offset, + ); + } + + late final __objc_msgSend_833Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_833 = __objc_msgSend_833Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_addressComponents1 = _registerName1("addressComponents"); + late final _sel_orthographyCheckingResultWithRange_orthography_1 = + _registerName1("orthographyCheckingResultWithRange:orthography:"); + ffi.Pointer _objc_msgSend_834( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer orthography, + ) { + return __objc_msgSend_834( + obj, + sel, + range, + orthography, + ); + } + + late final __objc_msgSend_834Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_834 = __objc_msgSend_834Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, ffi.Pointer)>(); + + late final _sel_spellCheckingResultWithRange_1 = + _registerName1("spellCheckingResultWithRange:"); + ffi.Pointer _objc_msgSend_835( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_835( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_835Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_835 = __objc_msgSend_835Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_grammarCheckingResultWithRange_details_1 = + _registerName1("grammarCheckingResultWithRange:details:"); + ffi.Pointer _objc_msgSend_836( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer details, + ) { + return __objc_msgSend_836( + obj, + sel, + range, + details, + ); + } + + late final __objc_msgSend_836Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_836 = __objc_msgSend_836Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, ffi.Pointer)>(); + + late final _sel_dateCheckingResultWithRange_date_1 = + _registerName1("dateCheckingResultWithRange:date:"); + ffi.Pointer _objc_msgSend_837( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer date, + ) { + return __objc_msgSend_837( + obj, + sel, + range, + date, + ); + } + + late final __objc_msgSend_837Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_837 = __objc_msgSend_837Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, ffi.Pointer)>(); + + late final _sel_dateCheckingResultWithRange_date_timeZone_duration_1 = + _registerName1("dateCheckingResultWithRange:date:timeZone:duration:"); + ffi.Pointer _objc_msgSend_838( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer date, + ffi.Pointer timeZone, + double duration, + ) { + return __objc_msgSend_838( + obj, + sel, + range, + date, + timeZone, + duration, + ); + } + + late final __objc_msgSend_838Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer, + ffi.Pointer, + NSTimeInterval)>>('objc_msgSend'); + late final __objc_msgSend_838 = __objc_msgSend_838Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer, + ffi.Pointer, + double)>(); + + late final _sel_addressCheckingResultWithRange_components_1 = + _registerName1("addressCheckingResultWithRange:components:"); + ffi.Pointer _objc_msgSend_839( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer components, + ) { + return __objc_msgSend_839( + obj, + sel, + range, + components, + ); + } + + late final __objc_msgSend_839Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_839 = __objc_msgSend_839Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, ffi.Pointer)>(); + + late final _sel_linkCheckingResultWithRange_URL_1 = + _registerName1("linkCheckingResultWithRange:URL:"); + ffi.Pointer _objc_msgSend_840( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer url, + ) { + return __objc_msgSend_840( + obj, + sel, + range, + url, + ); + } + + late final __objc_msgSend_840Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_840 = __objc_msgSend_840Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, ffi.Pointer)>(); + + late final _sel_quoteCheckingResultWithRange_replacementString_1 = + _registerName1("quoteCheckingResultWithRange:replacementString:"); + ffi.Pointer _objc_msgSend_841( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer replacementString, + ) { + return __objc_msgSend_841( + obj, + sel, + range, + replacementString, + ); + } + + late final __objc_msgSend_841Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_841 = __objc_msgSend_841Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, ffi.Pointer)>(); + + late final _sel_dashCheckingResultWithRange_replacementString_1 = + _registerName1("dashCheckingResultWithRange:replacementString:"); + late final _sel_replacementCheckingResultWithRange_replacementString_1 = + _registerName1("replacementCheckingResultWithRange:replacementString:"); + late final _sel_correctionCheckingResultWithRange_replacementString_1 = + _registerName1("correctionCheckingResultWithRange:replacementString:"); + late final _sel_correctionCheckingResultWithRange_replacementString_alternativeStrings_1 = + _registerName1( + "correctionCheckingResultWithRange:replacementString:alternativeStrings:"); + ffi.Pointer _objc_msgSend_842( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer replacementString, + ffi.Pointer alternativeStrings, + ) { + return __objc_msgSend_842( + obj, + sel, + range, + replacementString, + alternativeStrings, + ); + } + + late final __objc_msgSend_842Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_842 = __objc_msgSend_842Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_regularExpressionCheckingResultWithRanges_count_regularExpression_1 = + _registerName1( + "regularExpressionCheckingResultWithRanges:count:regularExpression:"); + ffi.Pointer _objc_msgSend_843( + ffi.Pointer obj, + ffi.Pointer sel, + NSRangePointer ranges, + int count, + ffi.Pointer regularExpression, + ) { + return __objc_msgSend_843( + obj, + sel, + ranges, + count, + regularExpression, + ); + } + + late final __objc_msgSend_843Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRangePointer, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_843 = __objc_msgSend_843Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRangePointer, + int, + ffi.Pointer)>(); + + late final _sel_phoneNumberCheckingResultWithRange_phoneNumber_1 = + _registerName1("phoneNumberCheckingResultWithRange:phoneNumber:"); + late final _sel_transitInformationCheckingResultWithRange_components_1 = + _registerName1("transitInformationCheckingResultWithRange:components:"); + late final _class_NSURLCache1 = _getClass1("NSURLCache"); + late final _sel_sharedURLCache1 = _registerName1("sharedURLCache"); + ffi.Pointer _objc_msgSend_844( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_844( + obj, + sel, + ); + } + + late final __objc_msgSend_844Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_844 = __objc_msgSend_844Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setSharedURLCache_1 = _registerName1("setSharedURLCache:"); + void _objc_msgSend_845( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_845( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_845Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_845 = __objc_msgSend_845Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithMemoryCapacity_diskCapacity_diskPath_1 = + _registerName1("initWithMemoryCapacity:diskCapacity:diskPath:"); + instancetype _objc_msgSend_846( + ffi.Pointer obj, + ffi.Pointer sel, + int memoryCapacity, + int diskCapacity, + ffi.Pointer path, + ) { + return __objc_msgSend_846( + obj, + sel, + memoryCapacity, + diskCapacity, + path, + ); + } + + late final __objc_msgSend_846Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_846 = __objc_msgSend_846Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + int, ffi.Pointer)>(); + + late final _sel_initWithMemoryCapacity_diskCapacity_directoryURL_1 = + _registerName1("initWithMemoryCapacity:diskCapacity:directoryURL:"); + instancetype _objc_msgSend_847( + ffi.Pointer obj, + ffi.Pointer sel, + int memoryCapacity, + int diskCapacity, + ffi.Pointer directoryURL, + ) { + return __objc_msgSend_847( + obj, + sel, + memoryCapacity, + diskCapacity, + directoryURL, + ); + } + + late final __objc_msgSend_847Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_847 = __objc_msgSend_847Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + int, ffi.Pointer)>(); + + late final _class_NSCachedURLResponse1 = _getClass1("NSCachedURLResponse"); + late final _sel_initWithResponse_data_1 = + _registerName1("initWithResponse:data:"); + instancetype _objc_msgSend_848( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer response, + ffi.Pointer data, + ) { + return __objc_msgSend_848( + obj, + sel, + response, + data, + ); + } + + late final __objc_msgSend_848Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_848 = __objc_msgSend_848Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithResponse_data_userInfo_storagePolicy_1 = + _registerName1("initWithResponse:data:userInfo:storagePolicy:"); + instancetype _objc_msgSend_849( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer response, + ffi.Pointer data, + ffi.Pointer userInfo, + int storagePolicy, + ) { + return __objc_msgSend_849( + obj, + sel, + response, + data, + userInfo, + storagePolicy, + ); + } + + late final __objc_msgSend_849Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_849 = __objc_msgSend_849Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_storagePolicy1 = _registerName1("storagePolicy"); + int _objc_msgSend_850( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_850( + obj, + sel, + ); + } + + late final __objc_msgSend_850Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_850 = __objc_msgSend_850Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_cachedResponseForRequest_1 = + _registerName1("cachedResponseForRequest:"); + ffi.Pointer _objc_msgSend_851( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_851( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_851Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_851 = __objc_msgSend_851Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_storeCachedResponse_forRequest_1 = + _registerName1("storeCachedResponse:forRequest:"); + void _objc_msgSend_852( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cachedResponse, + ffi.Pointer request, + ) { + return __objc_msgSend_852( + obj, + sel, + cachedResponse, + request, + ); + } + + late final __objc_msgSend_852Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_852 = __objc_msgSend_852Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_removeCachedResponseForRequest_1 = + _registerName1("removeCachedResponseForRequest:"); + void _objc_msgSend_853( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_853( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_853Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_853 = __objc_msgSend_853Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeAllCachedResponses1 = + _registerName1("removeAllCachedResponses"); + late final _sel_removeCachedResponsesSinceDate_1 = + _registerName1("removeCachedResponsesSinceDate:"); + late final _sel_memoryCapacity1 = _registerName1("memoryCapacity"); + late final _sel_setMemoryCapacity_1 = _registerName1("setMemoryCapacity:"); + late final _sel_diskCapacity1 = _registerName1("diskCapacity"); + late final _sel_setDiskCapacity_1 = _registerName1("setDiskCapacity:"); + late final _sel_currentMemoryUsage1 = _registerName1("currentMemoryUsage"); + late final _sel_currentDiskUsage1 = _registerName1("currentDiskUsage"); + late final _class_NSURLSessionDataTask1 = _getClass1("NSURLSessionDataTask"); + late final _sel_storeCachedResponse_forDataTask_1 = + _registerName1("storeCachedResponse:forDataTask:"); + void _objc_msgSend_854( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cachedResponse, + ffi.Pointer dataTask, + ) { + return __objc_msgSend_854( + obj, + sel, + cachedResponse, + dataTask, + ); + } + + late final __objc_msgSend_854Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_854 = __objc_msgSend_854Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_getCachedResponseForDataTask_completionHandler_1 = + _registerName1("getCachedResponseForDataTask:completionHandler:"); + void _objc_msgSend_855( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dataTask, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_855( + obj, + sel, + dataTask, + completionHandler, + ); + } + + late final __objc_msgSend_855Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_855 = __objc_msgSend_855Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_removeCachedResponseForDataTask_1 = + _registerName1("removeCachedResponseForDataTask:"); + void _objc_msgSend_856( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dataTask, + ) { + return __objc_msgSend_856( + obj, + sel, + dataTask, + ); + } + + late final __objc_msgSend_856Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_856 = __objc_msgSend_856Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSURLConnection1 = _getClass1("NSURLConnection"); + late final _sel_initWithRequest_delegate_startImmediately_1 = + _registerName1("initWithRequest:delegate:startImmediately:"); + instancetype _objc_msgSend_857( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer delegate, + bool startImmediately, + ) { + return __objc_msgSend_857( + obj, + sel, + request, + delegate, + startImmediately, + ); + } + + late final __objc_msgSend_857Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_857 = __objc_msgSend_857Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_initWithRequest_delegate_1 = + _registerName1("initWithRequest:delegate:"); + instancetype _objc_msgSend_858( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer delegate, + ) { + return __objc_msgSend_858( + obj, + sel, + request, + delegate, + ); + } + + late final __objc_msgSend_858Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_858 = __objc_msgSend_858Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_connectionWithRequest_delegate_1 = + _registerName1("connectionWithRequest:delegate:"); + ffi.Pointer _objc_msgSend_859( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer delegate, + ) { + return __objc_msgSend_859( + obj, + sel, + request, + delegate, + ); + } + + late final __objc_msgSend_859Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_859 = __objc_msgSend_859Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_unscheduleFromRunLoop_forMode_1 = + _registerName1("unscheduleFromRunLoop:forMode:"); + late final _sel_setDelegateQueue_1 = _registerName1("setDelegateQueue:"); + void _objc_msgSend_860( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer queue, + ) { + return __objc_msgSend_860( + obj, + sel, + queue, + ); + } + + late final __objc_msgSend_860Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_860 = __objc_msgSend_860Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_canHandleRequest_1 = _registerName1("canHandleRequest:"); + bool _objc_msgSend_861( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_861( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_861Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_861 = __objc_msgSend_861Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_sendSynchronousRequest_returningResponse_error_1 = + _registerName1("sendSynchronousRequest:returningResponse:error:"); + ffi.Pointer _objc_msgSend_862( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer> response, + ffi.Pointer> error, + ) { + return __objc_msgSend_862( + obj, + sel, + request, + response, + error, + ); + } + + late final __objc_msgSend_862Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_862 = __objc_msgSend_862Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_sendAsynchronousRequest_queue_completionHandler_1 = + _registerName1("sendAsynchronousRequest:queue:completionHandler:"); + void _objc_msgSend_863( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer queue, + ffi.Pointer<_ObjCBlock> handler, + ) { + return __objc_msgSend_863( + obj, + sel, + request, + queue, + handler, + ); + } + + late final __objc_msgSend_863Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_863 = __objc_msgSend_863Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _class_NSURLCredential1 = _getClass1("NSURLCredential"); + late final _sel_persistence1 = _registerName1("persistence"); + int _objc_msgSend_864( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_864( + obj, + sel, + ); + } + + late final __objc_msgSend_864Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_864 = __objc_msgSend_864Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithUser_password_persistence_1 = + _registerName1("initWithUser:password:persistence:"); + instancetype _objc_msgSend_865( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer user, + ffi.Pointer password, + int persistence, + ) { + return __objc_msgSend_865( + obj, + sel, + user, + password, + persistence, + ); + } + + late final __objc_msgSend_865Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_865 = __objc_msgSend_865Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_credentialWithUser_password_persistence_1 = + _registerName1("credentialWithUser:password:persistence:"); + ffi.Pointer _objc_msgSend_866( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer user, + ffi.Pointer password, + int persistence, + ) { + return __objc_msgSend_866( + obj, + sel, + user, + password, + persistence, + ); + } + + late final __objc_msgSend_866Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_866 = __objc_msgSend_866Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_hasPassword1 = _registerName1("hasPassword"); + late final _sel_initWithIdentity_certificates_persistence_1 = + _registerName1("initWithIdentity:certificates:persistence:"); + instancetype _objc_msgSend_867( + ffi.Pointer obj, + ffi.Pointer sel, + SecIdentityRef identity, + ffi.Pointer certArray, + int persistence, + ) { + return __objc_msgSend_867( + obj, + sel, + identity, + certArray, + persistence, + ); + } + + late final __objc_msgSend_867Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + SecIdentityRef, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_867 = __objc_msgSend_867Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + SecIdentityRef, ffi.Pointer, int)>(); + + late final _sel_credentialWithIdentity_certificates_persistence_1 = + _registerName1("credentialWithIdentity:certificates:persistence:"); + ffi.Pointer _objc_msgSend_868( + ffi.Pointer obj, + ffi.Pointer sel, + SecIdentityRef identity, + ffi.Pointer certArray, + int persistence, + ) { + return __objc_msgSend_868( + obj, + sel, + identity, + certArray, + persistence, + ); + } + + late final __objc_msgSend_868Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + SecIdentityRef, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_868 = __objc_msgSend_868Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + SecIdentityRef, + ffi.Pointer, + int)>(); + + late final _sel_identity1 = _registerName1("identity"); + SecIdentityRef _objc_msgSend_869( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_869( + obj, + sel, + ); + } + + late final __objc_msgSend_869Ptr = _lookup< + ffi.NativeFunction< + SecIdentityRef Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_869 = __objc_msgSend_869Ptr.asFunction< + SecIdentityRef Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_certificates1 = _registerName1("certificates"); + late final _sel_initWithTrust_1 = _registerName1("initWithTrust:"); + instancetype _objc_msgSend_870( + ffi.Pointer obj, + ffi.Pointer sel, + SecTrustRef trust, + ) { + return __objc_msgSend_870( + obj, + sel, + trust, + ); + } + + late final __objc_msgSend_870Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + SecTrustRef)>>('objc_msgSend'); + late final __objc_msgSend_870 = __objc_msgSend_870Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, SecTrustRef)>(); + + late final _sel_credentialForTrust_1 = _registerName1("credentialForTrust:"); + ffi.Pointer _objc_msgSend_871( + ffi.Pointer obj, + ffi.Pointer sel, + SecTrustRef trust, + ) { + return __objc_msgSend_871( + obj, + sel, + trust, + ); + } + + late final __objc_msgSend_871Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, SecTrustRef)>>('objc_msgSend'); + late final __objc_msgSend_871 = __objc_msgSend_871Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, SecTrustRef)>(); + + late final _class_NSURLProtectionSpace1 = _getClass1("NSURLProtectionSpace"); + late final _sel_initWithHost_port_protocol_realm_authenticationMethod_1 = + _registerName1("initWithHost:port:protocol:realm:authenticationMethod:"); + instancetype _objc_msgSend_872( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer host, + int port, + ffi.Pointer protocol, + ffi.Pointer realm, + ffi.Pointer authenticationMethod, + ) { + return __objc_msgSend_872( + obj, + sel, + host, + port, + protocol, + realm, + authenticationMethod, + ); + } + + late final __objc_msgSend_872Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_872 = __objc_msgSend_872Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithProxyHost_port_type_realm_authenticationMethod_1 = + _registerName1("initWithProxyHost:port:type:realm:authenticationMethod:"); + late final _sel_realm1 = _registerName1("realm"); + late final _sel_receivesCredentialSecurely1 = + _registerName1("receivesCredentialSecurely"); + late final _sel_isProxy1 = _registerName1("isProxy"); + late final _sel_proxyType1 = _registerName1("proxyType"); + late final _sel_protocol1 = _registerName1("protocol"); + late final _sel_authenticationMethod1 = + _registerName1("authenticationMethod"); + late final _sel_distinguishedNames1 = _registerName1("distinguishedNames"); + late final _sel_serverTrust1 = _registerName1("serverTrust"); + SecTrustRef _objc_msgSend_873( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_873( + obj, + sel, + ); + } + + late final __objc_msgSend_873Ptr = _lookup< + ffi.NativeFunction< + SecTrustRef Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_873 = __objc_msgSend_873Ptr.asFunction< + SecTrustRef Function(ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSURLCredentialStorage1 = + _getClass1("NSURLCredentialStorage"); + late final _sel_sharedCredentialStorage1 = + _registerName1("sharedCredentialStorage"); + ffi.Pointer _objc_msgSend_874( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_874( + obj, + sel, + ); + } + + late final __objc_msgSend_874Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_874 = __objc_msgSend_874Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_credentialsForProtectionSpace_1 = + _registerName1("credentialsForProtectionSpace:"); + ffi.Pointer _objc_msgSend_875( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer space, + ) { + return __objc_msgSend_875( + obj, + sel, + space, + ); + } + + late final __objc_msgSend_875Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_875 = __objc_msgSend_875Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_allCredentials1 = _registerName1("allCredentials"); + late final _sel_setCredential_forProtectionSpace_1 = + _registerName1("setCredential:forProtectionSpace:"); + void _objc_msgSend_876( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer credential, + ffi.Pointer space, + ) { + return __objc_msgSend_876( + obj, + sel, + credential, + space, + ); + } + + late final __objc_msgSend_876Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_876 = __objc_msgSend_876Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_removeCredential_forProtectionSpace_1 = + _registerName1("removeCredential:forProtectionSpace:"); + late final _sel_removeCredential_forProtectionSpace_options_1 = + _registerName1("removeCredential:forProtectionSpace:options:"); + void _objc_msgSend_877( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer credential, + ffi.Pointer space, + ffi.Pointer options, + ) { + return __objc_msgSend_877( + obj, + sel, + credential, + space, + options, + ); + } + + late final __objc_msgSend_877Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_877 = __objc_msgSend_877Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_defaultCredentialForProtectionSpace_1 = + _registerName1("defaultCredentialForProtectionSpace:"); + ffi.Pointer _objc_msgSend_878( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer space, + ) { + return __objc_msgSend_878( + obj, + sel, + space, + ); + } + + late final __objc_msgSend_878Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_878 = __objc_msgSend_878Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setDefaultCredential_forProtectionSpace_1 = + _registerName1("setDefaultCredential:forProtectionSpace:"); + late final _sel_getCredentialsForProtectionSpace_task_completionHandler_1 = + _registerName1( + "getCredentialsForProtectionSpace:task:completionHandler:"); + void _objc_msgSend_879( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer protectionSpace, + ffi.Pointer task, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_879( + obj, + sel, + protectionSpace, + task, + completionHandler, + ); + } + + late final __objc_msgSend_879Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_879 = __objc_msgSend_879Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_setCredential_forProtectionSpace_task_1 = + _registerName1("setCredential:forProtectionSpace:task:"); + void _objc_msgSend_880( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer credential, + ffi.Pointer protectionSpace, + ffi.Pointer task, + ) { + return __objc_msgSend_880( + obj, + sel, + credential, + protectionSpace, + task, + ); + } + + late final __objc_msgSend_880Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_880 = __objc_msgSend_880Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeCredential_forProtectionSpace_options_task_1 = + _registerName1("removeCredential:forProtectionSpace:options:task:"); + void _objc_msgSend_881( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer credential, + ffi.Pointer protectionSpace, + ffi.Pointer options, + ffi.Pointer task, + ) { + return __objc_msgSend_881( + obj, + sel, + credential, + protectionSpace, + options, + task, + ); + } + + late final __objc_msgSend_881Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_881 = __objc_msgSend_881Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_getDefaultCredentialForProtectionSpace_task_completionHandler_1 = + _registerName1( + "getDefaultCredentialForProtectionSpace:task:completionHandler:"); + void _objc_msgSend_882( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer space, + ffi.Pointer task, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_882( + obj, + sel, + space, + task, + completionHandler, + ); + } + + late final __objc_msgSend_882Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_882 = __objc_msgSend_882Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_setDefaultCredential_forProtectionSpace_task_1 = + _registerName1("setDefaultCredential:forProtectionSpace:task:"); + late final _class_NSURLProtocol1 = _getClass1("NSURLProtocol"); + late final _sel_initWithRequest_cachedResponse_client_1 = + _registerName1("initWithRequest:cachedResponse:client:"); + instancetype _objc_msgSend_883( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer cachedResponse, + ffi.Pointer client, + ) { + return __objc_msgSend_883( + obj, + sel, + request, + cachedResponse, + client, + ); + } + + late final __objc_msgSend_883Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_883 = __objc_msgSend_883Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_client1 = _registerName1("client"); + late final _sel_request1 = _registerName1("request"); + late final _sel_cachedResponse1 = _registerName1("cachedResponse"); + ffi.Pointer _objc_msgSend_884( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_884( + obj, + sel, + ); + } + + late final __objc_msgSend_884Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_884 = __objc_msgSend_884Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_canInitWithRequest_1 = _registerName1("canInitWithRequest:"); + late final _sel_canonicalRequestForRequest_1 = + _registerName1("canonicalRequestForRequest:"); + ffi.Pointer _objc_msgSend_885( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_885( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_885Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_885 = __objc_msgSend_885Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_requestIsCacheEquivalent_toRequest_1 = + _registerName1("requestIsCacheEquivalent:toRequest:"); + bool _objc_msgSend_886( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer a, + ffi.Pointer b, + ) { + return __objc_msgSend_886( + obj, + sel, + a, + b, + ); + } + + late final __objc_msgSend_886Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_886 = __objc_msgSend_886Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_startLoading1 = _registerName1("startLoading"); + late final _sel_stopLoading1 = _registerName1("stopLoading"); + late final _sel_propertyForKey_inRequest_1 = + _registerName1("propertyForKey:inRequest:"); + ffi.Pointer _objc_msgSend_887( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ffi.Pointer request, + ) { + return __objc_msgSend_887( + obj, + sel, + key, + request, + ); + } + + late final __objc_msgSend_887Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_887 = __objc_msgSend_887Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSMutableURLRequest1 = _getClass1("NSMutableURLRequest"); + late final _sel_setURL_1 = _registerName1("setURL:"); + void _objc_msgSend_888( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_888( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_888Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_888 = __objc_msgSend_888Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setCachePolicy_1 = _registerName1("setCachePolicy:"); + void _objc_msgSend_889( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_889( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_889Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_889 = __objc_msgSend_889Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_setTimeoutInterval_1 = _registerName1("setTimeoutInterval:"); + late final _sel_setMainDocumentURL_1 = _registerName1("setMainDocumentURL:"); + late final _sel_setNetworkServiceType_1 = + _registerName1("setNetworkServiceType:"); + void _objc_msgSend_890( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_890( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_890Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_890 = __objc_msgSend_890Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_setAllowsCellularAccess_1 = + _registerName1("setAllowsCellularAccess:"); + late final _sel_setAllowsExpensiveNetworkAccess_1 = + _registerName1("setAllowsExpensiveNetworkAccess:"); + late final _sel_setAllowsConstrainedNetworkAccess_1 = + _registerName1("setAllowsConstrainedNetworkAccess:"); + late final _sel_setAssumesHTTP3Capable_1 = + _registerName1("setAssumesHTTP3Capable:"); + late final _sel_setAttribution_1 = _registerName1("setAttribution:"); + void _objc_msgSend_891( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_891( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_891Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_891 = __objc_msgSend_891Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_setHTTPMethod_1 = _registerName1("setHTTPMethod:"); + late final _sel_setAllHTTPHeaderFields_1 = + _registerName1("setAllHTTPHeaderFields:"); + late final _sel_setValue_forHTTPHeaderField_1 = + _registerName1("setValue:forHTTPHeaderField:"); + late final _sel_addValue_forHTTPHeaderField_1 = + _registerName1("addValue:forHTTPHeaderField:"); + late final _sel_setHTTPBody_1 = _registerName1("setHTTPBody:"); + void _objc_msgSend_892( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_892( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_892Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_892 = __objc_msgSend_892Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setHTTPBodyStream_1 = _registerName1("setHTTPBodyStream:"); + void _objc_msgSend_893( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_893( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_893Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_893 = __objc_msgSend_893Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setHTTPShouldHandleCookies_1 = + _registerName1("setHTTPShouldHandleCookies:"); + late final _sel_setHTTPShouldUsePipelining_1 = + _registerName1("setHTTPShouldUsePipelining:"); + late final _sel_setProperty_forKey_inRequest_1 = + _registerName1("setProperty:forKey:inRequest:"); + void _objc_msgSend_894( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ffi.Pointer key, + ffi.Pointer request, + ) { + return __objc_msgSend_894( + obj, + sel, + value, + key, + request, + ); + } + + late final __objc_msgSend_894Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_894 = __objc_msgSend_894Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removePropertyForKey_inRequest_1 = + _registerName1("removePropertyForKey:inRequest:"); + void _objc_msgSend_895( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ffi.Pointer request, + ) { + return __objc_msgSend_895( + obj, + sel, + key, + request, + ); + } + + late final __objc_msgSend_895Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_895 = __objc_msgSend_895Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_registerClass_1 = _registerName1("registerClass:"); + late final _sel_unregisterClass_1 = _registerName1("unregisterClass:"); + late final _sel_canInitWithTask_1 = _registerName1("canInitWithTask:"); + bool _objc_msgSend_896( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer task, + ) { + return __objc_msgSend_896( + obj, + sel, + task, + ); + } + + late final __objc_msgSend_896Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_896 = __objc_msgSend_896Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithTask_cachedResponse_client_1 = + _registerName1("initWithTask:cachedResponse:client:"); + instancetype _objc_msgSend_897( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer task, + ffi.Pointer cachedResponse, + ffi.Pointer client, + ) { + return __objc_msgSend_897( + obj, + sel, + task, + cachedResponse, + client, + ); + } + + late final __objc_msgSend_897Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_897 = __objc_msgSend_897Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_task1 = _registerName1("task"); + ffi.Pointer _objc_msgSend_898( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_898( + obj, + sel, + ); + } + + late final __objc_msgSend_898Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_898 = __objc_msgSend_898Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSXMLParser1 = _getClass1("NSXMLParser"); + late final _sel_initWithStream_1 = _registerName1("initWithStream:"); + instancetype _objc_msgSend_899( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer stream, + ) { + return __objc_msgSend_899( + obj, + sel, + stream, + ); + } + + late final __objc_msgSend_899Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_899 = __objc_msgSend_899Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_shouldProcessNamespaces1 = + _registerName1("shouldProcessNamespaces"); + late final _sel_setShouldProcessNamespaces_1 = + _registerName1("setShouldProcessNamespaces:"); + late final _sel_shouldReportNamespacePrefixes1 = + _registerName1("shouldReportNamespacePrefixes"); + late final _sel_setShouldReportNamespacePrefixes_1 = + _registerName1("setShouldReportNamespacePrefixes:"); + late final _sel_externalEntityResolvingPolicy1 = + _registerName1("externalEntityResolvingPolicy"); + int _objc_msgSend_900( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_900( + obj, + sel, + ); + } + + late final __objc_msgSend_900Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_900 = __objc_msgSend_900Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setExternalEntityResolvingPolicy_1 = + _registerName1("setExternalEntityResolvingPolicy:"); + void _objc_msgSend_901( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_901( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_901Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_901 = __objc_msgSend_901Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_allowedExternalEntityURLs1 = + _registerName1("allowedExternalEntityURLs"); + late final _sel_setAllowedExternalEntityURLs_1 = + _registerName1("setAllowedExternalEntityURLs:"); + void _objc_msgSend_902( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_902( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_902Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_902 = __objc_msgSend_902Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_parse1 = _registerName1("parse"); + late final _sel_abortParsing1 = _registerName1("abortParsing"); + late final _sel_parserError1 = _registerName1("parserError"); + late final _sel_shouldResolveExternalEntities1 = + _registerName1("shouldResolveExternalEntities"); + late final _sel_setShouldResolveExternalEntities_1 = + _registerName1("setShouldResolveExternalEntities:"); + late final _sel_publicID1 = _registerName1("publicID"); + late final _sel_systemID1 = _registerName1("systemID"); + late final _sel_lineNumber1 = _registerName1("lineNumber"); + late final _sel_columnNumber1 = _registerName1("columnNumber"); + late final _class_NSFileWrapper1 = _getClass1("NSFileWrapper"); + late final _sel_initWithURL_options_error_1 = + _registerName1("initWithURL:options:error:"); + instancetype _objc_msgSend_903( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int options, + ffi.Pointer> outError, + ) { + return __objc_msgSend_903( + obj, + sel, + url, + options, + outError, + ); + } + + late final __objc_msgSend_903Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_903 = __objc_msgSend_903Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_initDirectoryWithFileWrappers_1 = + _registerName1("initDirectoryWithFileWrappers:"); + late final _sel_initRegularFileWithContents_1 = + _registerName1("initRegularFileWithContents:"); + late final _sel_initSymbolicLinkWithDestinationURL_1 = + _registerName1("initSymbolicLinkWithDestinationURL:"); + late final _sel_initWithSerializedRepresentation_1 = + _registerName1("initWithSerializedRepresentation:"); + late final _sel_isDirectory1 = _registerName1("isDirectory"); + late final _sel_isRegularFile1 = _registerName1("isRegularFile"); + late final _sel_isSymbolicLink1 = _registerName1("isSymbolicLink"); + late final _sel_preferredFilename1 = _registerName1("preferredFilename"); + late final _sel_setPreferredFilename_1 = + _registerName1("setPreferredFilename:"); + late final _sel_filename1 = _registerName1("filename"); + late final _sel_setFilename_1 = _registerName1("setFilename:"); + late final _sel_fileAttributes1 = _registerName1("fileAttributes"); + late final _sel_setFileAttributes_1 = _registerName1("setFileAttributes:"); + late final _sel_matchesContentsOfURL_1 = + _registerName1("matchesContentsOfURL:"); + late final _sel_readFromURL_options_error_1 = + _registerName1("readFromURL:options:error:"); + bool _objc_msgSend_904( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int options, + ffi.Pointer> outError, + ) { + return __objc_msgSend_904( + obj, + sel, + url, + options, + outError, + ); + } + + late final __objc_msgSend_904Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_904 = __objc_msgSend_904Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_writeToURL_options_originalContentsURL_error_1 = + _registerName1("writeToURL:options:originalContentsURL:error:"); + bool _objc_msgSend_905( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int options, + ffi.Pointer originalContentsURL, + ffi.Pointer> outError, + ) { + return __objc_msgSend_905( + obj, + sel, + url, + options, + originalContentsURL, + outError, + ); + } + + late final __objc_msgSend_905Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_905 = __objc_msgSend_905Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_serializedRepresentation1 = + _registerName1("serializedRepresentation"); + late final _sel_addFileWrapper_1 = _registerName1("addFileWrapper:"); + ffi.Pointer _objc_msgSend_906( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer child, + ) { + return __objc_msgSend_906( + obj, + sel, + child, + ); + } + + late final __objc_msgSend_906Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_906 = __objc_msgSend_906Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_addRegularFileWithContents_preferredFilename_1 = + _registerName1("addRegularFileWithContents:preferredFilename:"); + ffi.Pointer _objc_msgSend_907( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ffi.Pointer fileName, + ) { + return __objc_msgSend_907( + obj, + sel, + data, + fileName, + ); + } + + late final __objc_msgSend_907Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_907 = __objc_msgSend_907Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeFileWrapper_1 = _registerName1("removeFileWrapper:"); + void _objc_msgSend_908( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer child, + ) { + return __objc_msgSend_908( + obj, + sel, + child, + ); + } + + late final __objc_msgSend_908Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_908 = __objc_msgSend_908Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_fileWrappers1 = _registerName1("fileWrappers"); + late final _sel_keyForFileWrapper_1 = _registerName1("keyForFileWrapper:"); + late final _sel_regularFileContents1 = _registerName1("regularFileContents"); + late final _sel_symbolicLinkDestinationURL1 = + _registerName1("symbolicLinkDestinationURL"); + late final _sel_initSymbolicLinkWithDestination_1 = + _registerName1("initSymbolicLinkWithDestination:"); + late final _sel_needsToBeUpdatedFromPath_1 = + _registerName1("needsToBeUpdatedFromPath:"); + late final _sel_updateFromPath_1 = _registerName1("updateFromPath:"); + late final _sel_writeToFile_atomically_updateFilenames_1 = + _registerName1("writeToFile:atomically:updateFilenames:"); + bool _objc_msgSend_909( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool atomicFlag, + bool updateFilenamesFlag, + ) { + return __objc_msgSend_909( + obj, + sel, + path, + atomicFlag, + updateFilenamesFlag, + ); + } + + late final __objc_msgSend_909Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_909 = __objc_msgSend_909Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool, bool)>(); + + late final _sel_addFileWithPath_1 = _registerName1("addFileWithPath:"); + late final _sel_addSymbolicLinkWithDestination_preferredFilename_1 = + _registerName1("addSymbolicLinkWithDestination:preferredFilename:"); + late final _sel_symbolicLinkDestination1 = + _registerName1("symbolicLinkDestination"); + late final _class_NSURLSession1 = _getClass1("NSURLSession"); + late final _sel_sharedSession1 = _registerName1("sharedSession"); + ffi.Pointer _objc_msgSend_910( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_910( + obj, + sel, + ); + } + + late final __objc_msgSend_910Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_910 = __objc_msgSend_910Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSURLSessionConfiguration1 = + _getClass1("NSURLSessionConfiguration"); + late final _sel_defaultSessionConfiguration1 = + _registerName1("defaultSessionConfiguration"); + ffi.Pointer _objc_msgSend_911( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_911( + obj, + sel, + ); + } + + late final __objc_msgSend_911Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_911 = __objc_msgSend_911Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_ephemeralSessionConfiguration1 = + _registerName1("ephemeralSessionConfiguration"); + late final _sel_backgroundSessionConfigurationWithIdentifier_1 = + _registerName1("backgroundSessionConfigurationWithIdentifier:"); + ffi.Pointer _objc_msgSend_912( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer identifier, + ) { + return __objc_msgSend_912( + obj, + sel, + identifier, + ); + } + + late final __objc_msgSend_912Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_912 = __objc_msgSend_912Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_identifier1 = _registerName1("identifier"); + late final _sel_requestCachePolicy1 = _registerName1("requestCachePolicy"); + late final _sel_setRequestCachePolicy_1 = + _registerName1("setRequestCachePolicy:"); + late final _sel_timeoutIntervalForRequest1 = + _registerName1("timeoutIntervalForRequest"); + late final _sel_setTimeoutIntervalForRequest_1 = + _registerName1("setTimeoutIntervalForRequest:"); + late final _sel_timeoutIntervalForResource1 = + _registerName1("timeoutIntervalForResource"); + late final _sel_setTimeoutIntervalForResource_1 = + _registerName1("setTimeoutIntervalForResource:"); + late final _sel_waitsForConnectivity1 = + _registerName1("waitsForConnectivity"); + late final _sel_setWaitsForConnectivity_1 = + _registerName1("setWaitsForConnectivity:"); + late final _sel_isDiscretionary1 = _registerName1("isDiscretionary"); + late final _sel_setDiscretionary_1 = _registerName1("setDiscretionary:"); + late final _sel_sharedContainerIdentifier1 = + _registerName1("sharedContainerIdentifier"); + late final _sel_setSharedContainerIdentifier_1 = + _registerName1("setSharedContainerIdentifier:"); + late final _sel_sessionSendsLaunchEvents1 = + _registerName1("sessionSendsLaunchEvents"); + late final _sel_setSessionSendsLaunchEvents_1 = + _registerName1("setSessionSendsLaunchEvents:"); + late final _sel_connectionProxyDictionary1 = + _registerName1("connectionProxyDictionary"); + late final _sel_setConnectionProxyDictionary_1 = + _registerName1("setConnectionProxyDictionary:"); + late final _sel_TLSMinimumSupportedProtocol1 = + _registerName1("TLSMinimumSupportedProtocol"); + int _objc_msgSend_913( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_913( + obj, + sel, + ); + } + + late final __objc_msgSend_913Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_913 = __objc_msgSend_913Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setTLSMinimumSupportedProtocol_1 = + _registerName1("setTLSMinimumSupportedProtocol:"); + void _objc_msgSend_914( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_914( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_914Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_914 = __objc_msgSend_914Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_TLSMaximumSupportedProtocol1 = + _registerName1("TLSMaximumSupportedProtocol"); + late final _sel_setTLSMaximumSupportedProtocol_1 = + _registerName1("setTLSMaximumSupportedProtocol:"); + late final _sel_TLSMinimumSupportedProtocolVersion1 = + _registerName1("TLSMinimumSupportedProtocolVersion"); + int _objc_msgSend_915( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_915( + obj, + sel, + ); + } + + late final __objc_msgSend_915Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_915 = __objc_msgSend_915Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setTLSMinimumSupportedProtocolVersion_1 = + _registerName1("setTLSMinimumSupportedProtocolVersion:"); + void _objc_msgSend_916( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_916( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_916Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_916 = __objc_msgSend_916Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_TLSMaximumSupportedProtocolVersion1 = + _registerName1("TLSMaximumSupportedProtocolVersion"); + late final _sel_setTLSMaximumSupportedProtocolVersion_1 = + _registerName1("setTLSMaximumSupportedProtocolVersion:"); + late final _sel_HTTPShouldSetCookies1 = + _registerName1("HTTPShouldSetCookies"); + late final _sel_setHTTPShouldSetCookies_1 = + _registerName1("setHTTPShouldSetCookies:"); + late final _sel_HTTPCookieAcceptPolicy1 = + _registerName1("HTTPCookieAcceptPolicy"); + late final _sel_setHTTPCookieAcceptPolicy_1 = + _registerName1("setHTTPCookieAcceptPolicy:"); + late final _sel_HTTPAdditionalHeaders1 = + _registerName1("HTTPAdditionalHeaders"); + late final _sel_setHTTPAdditionalHeaders_1 = + _registerName1("setHTTPAdditionalHeaders:"); + late final _sel_HTTPMaximumConnectionsPerHost1 = + _registerName1("HTTPMaximumConnectionsPerHost"); + late final _sel_setHTTPMaximumConnectionsPerHost_1 = + _registerName1("setHTTPMaximumConnectionsPerHost:"); + late final _sel_HTTPCookieStorage1 = _registerName1("HTTPCookieStorage"); + late final _sel_setHTTPCookieStorage_1 = + _registerName1("setHTTPCookieStorage:"); + void _objc_msgSend_917( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_917( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_917Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_917 = __objc_msgSend_917Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLCredentialStorage1 = + _registerName1("URLCredentialStorage"); + late final _sel_setURLCredentialStorage_1 = + _registerName1("setURLCredentialStorage:"); + void _objc_msgSend_918( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_918( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_918Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_918 = __objc_msgSend_918Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLCache1 = _registerName1("URLCache"); + late final _sel_setURLCache_1 = _registerName1("setURLCache:"); + late final _sel_shouldUseExtendedBackgroundIdleMode1 = + _registerName1("shouldUseExtendedBackgroundIdleMode"); + late final _sel_setShouldUseExtendedBackgroundIdleMode_1 = + _registerName1("setShouldUseExtendedBackgroundIdleMode:"); + late final _sel_protocolClasses1 = _registerName1("protocolClasses"); + late final _sel_setProtocolClasses_1 = _registerName1("setProtocolClasses:"); + late final _sel_multipathServiceType1 = + _registerName1("multipathServiceType"); + int _objc_msgSend_919( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_919( + obj, + sel, + ); + } + + late final __objc_msgSend_919Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_919 = __objc_msgSend_919Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setMultipathServiceType_1 = + _registerName1("setMultipathServiceType:"); + void _objc_msgSend_920( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_920( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_920Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_920 = __objc_msgSend_920Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_backgroundSessionConfiguration_1 = + _registerName1("backgroundSessionConfiguration:"); + late final _sel_sessionWithConfiguration_1 = + _registerName1("sessionWithConfiguration:"); + ffi.Pointer _objc_msgSend_921( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer configuration, + ) { + return __objc_msgSend_921( + obj, + sel, + configuration, + ); + } + + late final __objc_msgSend_921Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_921 = __objc_msgSend_921Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_sessionWithConfiguration_delegate_delegateQueue_1 = + _registerName1("sessionWithConfiguration:delegate:delegateQueue:"); + ffi.Pointer _objc_msgSend_922( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer configuration, + ffi.Pointer delegate, + ffi.Pointer queue, + ) { + return __objc_msgSend_922( + obj, + sel, + configuration, + delegate, + queue, + ); + } + + late final __objc_msgSend_922Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_922 = __objc_msgSend_922Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_delegateQueue1 = _registerName1("delegateQueue"); + late final _sel_configuration1 = _registerName1("configuration"); + late final _sel_sessionDescription1 = _registerName1("sessionDescription"); + late final _sel_setSessionDescription_1 = + _registerName1("setSessionDescription:"); + late final _sel_finishTasksAndInvalidate1 = + _registerName1("finishTasksAndInvalidate"); + late final _sel_invalidateAndCancel1 = _registerName1("invalidateAndCancel"); + late final _sel_resetWithCompletionHandler_1 = + _registerName1("resetWithCompletionHandler:"); + late final _sel_flushWithCompletionHandler_1 = + _registerName1("flushWithCompletionHandler:"); + late final _sel_getTasksWithCompletionHandler_1 = + _registerName1("getTasksWithCompletionHandler:"); + void _objc_msgSend_923( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_923( + obj, + sel, + completionHandler, + ); + } + + late final __objc_msgSend_923Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_923 = __objc_msgSend_923Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_getAllTasksWithCompletionHandler_1 = + _registerName1("getAllTasksWithCompletionHandler:"); + void _objc_msgSend_924( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_924( + obj, + sel, + completionHandler, + ); + } + + late final __objc_msgSend_924Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_924 = __objc_msgSend_924Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_dataTaskWithRequest_1 = + _registerName1("dataTaskWithRequest:"); + ffi.Pointer _objc_msgSend_925( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_925( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_925Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_925 = __objc_msgSend_925Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_dataTaskWithURL_1 = _registerName1("dataTaskWithURL:"); + ffi.Pointer _objc_msgSend_926( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ) { + return __objc_msgSend_926( + obj, + sel, + url, + ); + } + + late final __objc_msgSend_926Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_926 = __objc_msgSend_926Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSURLSessionUploadTask1 = + _getClass1("NSURLSessionUploadTask"); + late final _sel_uploadTaskWithRequest_fromFile_1 = + _registerName1("uploadTaskWithRequest:fromFile:"); + ffi.Pointer _objc_msgSend_927( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer fileURL, + ) { + return __objc_msgSend_927( + obj, + sel, + request, + fileURL, + ); + } + + late final __objc_msgSend_927Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_927 = __objc_msgSend_927Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_uploadTaskWithRequest_fromData_1 = + _registerName1("uploadTaskWithRequest:fromData:"); + ffi.Pointer _objc_msgSend_928( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer bodyData, + ) { + return __objc_msgSend_928( + obj, + sel, + request, + bodyData, + ); + } + + late final __objc_msgSend_928Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_928 = __objc_msgSend_928Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_uploadTaskWithStreamedRequest_1 = + _registerName1("uploadTaskWithStreamedRequest:"); + ffi.Pointer _objc_msgSend_929( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_929( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_929Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_929 = __objc_msgSend_929Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSURLSessionDownloadTask1 = + _getClass1("NSURLSessionDownloadTask"); + late final _sel_cancelByProducingResumeData_1 = + _registerName1("cancelByProducingResumeData:"); + void _objc_msgSend_930( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_930( + obj, + sel, + completionHandler, + ); + } + + late final __objc_msgSend_930Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_930 = __objc_msgSend_930Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_downloadTaskWithRequest_1 = + _registerName1("downloadTaskWithRequest:"); + ffi.Pointer _objc_msgSend_931( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_931( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_931Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_931 = __objc_msgSend_931Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_downloadTaskWithURL_1 = + _registerName1("downloadTaskWithURL:"); + ffi.Pointer _objc_msgSend_932( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ) { + return __objc_msgSend_932( + obj, + sel, + url, + ); + } + + late final __objc_msgSend_932Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_932 = __objc_msgSend_932Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_downloadTaskWithResumeData_1 = + _registerName1("downloadTaskWithResumeData:"); + ffi.Pointer _objc_msgSend_933( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer resumeData, + ) { + return __objc_msgSend_933( + obj, + sel, + resumeData, + ); + } + + late final __objc_msgSend_933Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_933 = __objc_msgSend_933Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSURLSessionStreamTask1 = + _getClass1("NSURLSessionStreamTask"); + late final _sel_readDataOfMinLength_maxLength_timeout_completionHandler_1 = + _registerName1( + "readDataOfMinLength:maxLength:timeout:completionHandler:"); + void _objc_msgSend_934( + ffi.Pointer obj, + ffi.Pointer sel, + int minBytes, + int maxBytes, + double timeout, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_934( + obj, + sel, + minBytes, + maxBytes, + timeout, + completionHandler, + ); + } + + late final __objc_msgSend_934Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSUInteger, + NSTimeInterval, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_934 = __objc_msgSend_934Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, int, + double, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_writeData_timeout_completionHandler_1 = + _registerName1("writeData:timeout:completionHandler:"); + void _objc_msgSend_935( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + double timeout, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_935( + obj, + sel, + data, + timeout, + completionHandler, + ); + } + + late final __objc_msgSend_935Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSTimeInterval, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_935 = __objc_msgSend_935Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, double, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_captureStreams1 = _registerName1("captureStreams"); + late final _sel_closeWrite1 = _registerName1("closeWrite"); + late final _sel_closeRead1 = _registerName1("closeRead"); + late final _sel_startSecureConnection1 = + _registerName1("startSecureConnection"); + late final _sel_stopSecureConnection1 = + _registerName1("stopSecureConnection"); + late final _sel_streamTaskWithHostName_port_1 = + _registerName1("streamTaskWithHostName:port:"); + ffi.Pointer _objc_msgSend_936( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer hostname, + int port, + ) { + return __objc_msgSend_936( + obj, + sel, + hostname, + port, + ); + } + + late final __objc_msgSend_936Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_936 = __objc_msgSend_936Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _class_NSNetService1 = _getClass1("NSNetService"); + late final _sel_initWithDomain_type_name_port_1 = + _registerName1("initWithDomain:type:name:port:"); + instancetype _objc_msgSend_937( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer domain, + ffi.Pointer type, + ffi.Pointer name, + int port, + ) { + return __objc_msgSend_937( + obj, + sel, + domain, + type, + name, + port, + ); + } + + late final __objc_msgSend_937Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int)>>('objc_msgSend'); + late final __objc_msgSend_937 = __objc_msgSend_937Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_initWithDomain_type_name_1 = + _registerName1("initWithDomain:type:name:"); + late final _sel_includesPeerToPeer1 = _registerName1("includesPeerToPeer"); + late final _sel_setIncludesPeerToPeer_1 = + _registerName1("setIncludesPeerToPeer:"); + late final _sel_type1 = _registerName1("type"); + late final _sel_publish1 = _registerName1("publish"); + late final _sel_publishWithOptions_1 = _registerName1("publishWithOptions:"); + void _objc_msgSend_938( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_938( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_938Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_938 = __objc_msgSend_938Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_resolve1 = _registerName1("resolve"); + late final _sel_stop1 = _registerName1("stop"); + late final _sel_dictionaryFromTXTRecordData_1 = + _registerName1("dictionaryFromTXTRecordData:"); + ffi.Pointer _objc_msgSend_939( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer txtData, + ) { + return __objc_msgSend_939( + obj, + sel, + txtData, + ); + } + + late final __objc_msgSend_939Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_939 = __objc_msgSend_939Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_dataFromTXTRecordDictionary_1 = + _registerName1("dataFromTXTRecordDictionary:"); + ffi.Pointer _objc_msgSend_940( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer txtDictionary, + ) { + return __objc_msgSend_940( + obj, + sel, + txtDictionary, + ); + } + + late final __objc_msgSend_940Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_940 = __objc_msgSend_940Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_resolveWithTimeout_1 = _registerName1("resolveWithTimeout:"); + late final _sel_getInputStream_outputStream_1 = + _registerName1("getInputStream:outputStream:"); + bool _objc_msgSend_941( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream, + ) { + return __objc_msgSend_941( + obj, + sel, + inputStream, + outputStream, + ); + } + + late final __objc_msgSend_941Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_941 = __objc_msgSend_941Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_setTXTRecordData_1 = _registerName1("setTXTRecordData:"); + late final _sel_TXTRecordData1 = _registerName1("TXTRecordData"); + late final _sel_startMonitoring1 = _registerName1("startMonitoring"); + late final _sel_stopMonitoring1 = _registerName1("stopMonitoring"); + late final _sel_streamTaskWithNetService_1 = + _registerName1("streamTaskWithNetService:"); + ffi.Pointer _objc_msgSend_942( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer service, + ) { + return __objc_msgSend_942( + obj, + sel, + service, + ); + } + + late final __objc_msgSend_942Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_942 = __objc_msgSend_942Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSURLSessionWebSocketTask1 = + _getClass1("NSURLSessionWebSocketTask"); + late final _class_NSURLSessionWebSocketMessage1 = + _getClass1("NSURLSessionWebSocketMessage"); + int _objc_msgSend_943( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_943( + obj, + sel, + ); + } + + late final __objc_msgSend_943Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_943 = __objc_msgSend_943Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_sendMessage_completionHandler_1 = + _registerName1("sendMessage:completionHandler:"); + void _objc_msgSend_944( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer message, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_944( + obj, + sel, + message, + completionHandler, + ); + } + + late final __objc_msgSend_944Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_944 = __objc_msgSend_944Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_receiveMessageWithCompletionHandler_1 = + _registerName1("receiveMessageWithCompletionHandler:"); + void _objc_msgSend_945( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_945( + obj, + sel, + completionHandler, + ); + } + + late final __objc_msgSend_945Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_945 = __objc_msgSend_945Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_sendPingWithPongReceiveHandler_1 = + _registerName1("sendPingWithPongReceiveHandler:"); + void _objc_msgSend_946( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> pongReceiveHandler, + ) { + return __objc_msgSend_946( + obj, + sel, + pongReceiveHandler, + ); + } + + late final __objc_msgSend_946Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_946 = __objc_msgSend_946Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_cancelWithCloseCode_reason_1 = + _registerName1("cancelWithCloseCode:reason:"); + void _objc_msgSend_947( + ffi.Pointer obj, + ffi.Pointer sel, + int closeCode, + ffi.Pointer reason, + ) { + return __objc_msgSend_947( + obj, + sel, + closeCode, + reason, + ); + } + + late final __objc_msgSend_947Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_947 = __objc_msgSend_947Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_maximumMessageSize1 = _registerName1("maximumMessageSize"); + late final _sel_setMaximumMessageSize_1 = + _registerName1("setMaximumMessageSize:"); + late final _sel_closeCode1 = _registerName1("closeCode"); + int _objc_msgSend_948( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_948( + obj, + sel, + ); + } + + late final __objc_msgSend_948Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_948 = __objc_msgSend_948Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_closeReason1 = _registerName1("closeReason"); + late final _sel_webSocketTaskWithURL_1 = + _registerName1("webSocketTaskWithURL:"); + ffi.Pointer _objc_msgSend_949( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ) { + return __objc_msgSend_949( + obj, + sel, + url, + ); + } + + late final __objc_msgSend_949Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_949 = __objc_msgSend_949Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_webSocketTaskWithURL_protocols_1 = + _registerName1("webSocketTaskWithURL:protocols:"); + ffi.Pointer _objc_msgSend_950( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer protocols, + ) { + return __objc_msgSend_950( + obj, + sel, + url, + protocols, + ); + } + + late final __objc_msgSend_950Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_950 = __objc_msgSend_950Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_webSocketTaskWithRequest_1 = + _registerName1("webSocketTaskWithRequest:"); + ffi.Pointer _objc_msgSend_951( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_951( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_951Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_951 = __objc_msgSend_951Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_dataTaskWithRequest_completionHandler_1 = + _registerName1("dataTaskWithRequest:completionHandler:"); + ffi.Pointer _objc_msgSend_952( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_952( + obj, + sel, + request, + completionHandler, + ); + } + + late final __objc_msgSend_952Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_952 = __objc_msgSend_952Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_dataTaskWithURL_completionHandler_1 = + _registerName1("dataTaskWithURL:completionHandler:"); + ffi.Pointer _objc_msgSend_953( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_953( + obj, + sel, + url, + completionHandler, + ); + } + + late final __objc_msgSend_953Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_953 = __objc_msgSend_953Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_uploadTaskWithRequest_fromFile_completionHandler_1 = + _registerName1("uploadTaskWithRequest:fromFile:completionHandler:"); + ffi.Pointer _objc_msgSend_954( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer fileURL, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_954( + obj, + sel, + request, + fileURL, + completionHandler, + ); + } + + late final __objc_msgSend_954Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_954 = __objc_msgSend_954Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_uploadTaskWithRequest_fromData_completionHandler_1 = + _registerName1("uploadTaskWithRequest:fromData:completionHandler:"); + ffi.Pointer _objc_msgSend_955( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer bodyData, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_955( + obj, + sel, + request, + bodyData, + completionHandler, + ); + } + + late final __objc_msgSend_955Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_955 = __objc_msgSend_955Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_downloadTaskWithRequest_completionHandler_1 = + _registerName1("downloadTaskWithRequest:completionHandler:"); + ffi.Pointer _objc_msgSend_956( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_956( + obj, + sel, + request, + completionHandler, + ); + } + + late final __objc_msgSend_956Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_956 = __objc_msgSend_956Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_downloadTaskWithURL_completionHandler_1 = + _registerName1("downloadTaskWithURL:completionHandler:"); + ffi.Pointer _objc_msgSend_957( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_957( + obj, + sel, + url, + completionHandler, + ); + } + + late final __objc_msgSend_957Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_957 = __objc_msgSend_957Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_downloadTaskWithResumeData_completionHandler_1 = + _registerName1("downloadTaskWithResumeData:completionHandler:"); + ffi.Pointer _objc_msgSend_958( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer resumeData, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_958( + obj, + sel, + resumeData, + completionHandler, + ); + } + + late final __objc_msgSend_958Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_958 = __objc_msgSend_958Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _class_NSProtocolChecker1 = _getClass1("NSProtocolChecker"); + ffi.Pointer _objc_msgSend_959( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_959( + obj, + sel, + ); + } + + late final __objc_msgSend_959Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_959 = __objc_msgSend_959Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_protocolCheckerWithTarget_protocol_1 = + _registerName1("protocolCheckerWithTarget:protocol:"); + instancetype _objc_msgSend_960( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ffi.Pointer aProtocol, + ) { + return __objc_msgSend_960( + obj, + sel, + anObject, + aProtocol, + ); + } + + late final __objc_msgSend_960Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_960 = __objc_msgSend_960Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithTarget_protocol_1 = + _registerName1("initWithTarget:protocol:"); + late final _class_NSTask1 = _getClass1("NSTask"); + late final _sel_setExecutableURL_1 = _registerName1("setExecutableURL:"); + late final _sel_setEnvironment_1 = _registerName1("setEnvironment:"); + late final _sel_currentDirectoryURL1 = _registerName1("currentDirectoryURL"); + late final _sel_setCurrentDirectoryURL_1 = + _registerName1("setCurrentDirectoryURL:"); + late final _sel_standardInput1 = _registerName1("standardInput"); + late final _sel_setStandardInput_1 = _registerName1("setStandardInput:"); + late final _sel_standardOutput1 = _registerName1("standardOutput"); + late final _sel_setStandardOutput_1 = _registerName1("setStandardOutput:"); + late final _sel_standardError1 = _registerName1("standardError"); + late final _sel_setStandardError_1 = _registerName1("setStandardError:"); + late final _sel_launchAndReturnError_1 = + _registerName1("launchAndReturnError:"); + late final _sel_interrupt1 = _registerName1("interrupt"); + late final _sel_terminate1 = _registerName1("terminate"); + late final _sel_isRunning1 = _registerName1("isRunning"); + late final _sel_terminationStatus1 = _registerName1("terminationStatus"); + late final _sel_terminationReason1 = _registerName1("terminationReason"); + int _objc_msgSend_961( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_961( + obj, + sel, + ); + } + + late final __objc_msgSend_961Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_961 = __objc_msgSend_961Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_terminationHandler1 = _registerName1("terminationHandler"); + ffi.Pointer<_ObjCBlock> _objc_msgSend_962( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_962( + obj, + sel, + ); + } + + late final __objc_msgSend_962Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_962 = __objc_msgSend_962Ptr.asFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setTerminationHandler_1 = + _registerName1("setTerminationHandler:"); + void _objc_msgSend_963( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> value, + ) { + return __objc_msgSend_963( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_963Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_963 = __objc_msgSend_963Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_launchedTaskWithExecutableURL_arguments_error_terminationHandler_1 = + _registerName1( + "launchedTaskWithExecutableURL:arguments:error:terminationHandler:"); + ffi.Pointer _objc_msgSend_964( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer arguments, + ffi.Pointer> error, + ffi.Pointer<_ObjCBlock> terminationHandler, + ) { + return __objc_msgSend_964( + obj, + sel, + url, + arguments, + error, + terminationHandler, + ); + } + + late final __objc_msgSend_964Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_964 = __objc_msgSend_964Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_waitUntilExit1 = _registerName1("waitUntilExit"); + late final _sel_launchPath1 = _registerName1("launchPath"); + late final _sel_setLaunchPath_1 = _registerName1("setLaunchPath:"); + late final _sel_setCurrentDirectoryPath_1 = + _registerName1("setCurrentDirectoryPath:"); + late final _sel_launch1 = _registerName1("launch"); + late final _sel_launchedTaskWithLaunchPath_arguments_1 = + _registerName1("launchedTaskWithLaunchPath:arguments:"); + ffi.Pointer _objc_msgSend_965( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer arguments, + ) { + return __objc_msgSend_965( + obj, + sel, + path, + arguments, + ); + } + + late final __objc_msgSend_965Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_965 = __objc_msgSend_965Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSXMLElement1 = _getClass1("NSXMLElement"); + late final _class_NSXMLNode1 = _getClass1("NSXMLNode"); + late final _sel_initWithKind_1 = _registerName1("initWithKind:"); + instancetype _objc_msgSend_966( + ffi.Pointer obj, + ffi.Pointer sel, + int kind, + ) { + return __objc_msgSend_966( + obj, + sel, + kind, + ); + } + + late final __objc_msgSend_966Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_966 = __objc_msgSend_966Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithKind_options_1 = + _registerName1("initWithKind:options:"); + instancetype _objc_msgSend_967( + ffi.Pointer obj, + ffi.Pointer sel, + int kind, + int options, + ) { + return __objc_msgSend_967( + obj, + sel, + kind, + options, + ); + } + + late final __objc_msgSend_967Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_967 = __objc_msgSend_967Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int, int)>(); + + late final _sel_document1 = _registerName1("document"); + late final _sel_documentWithRootElement_1 = + _registerName1("documentWithRootElement:"); + ffi.Pointer _objc_msgSend_968( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer element, + ) { + return __objc_msgSend_968( + obj, + sel, + element, + ); + } + + late final __objc_msgSend_968Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_968 = __objc_msgSend_968Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_elementWithName_1 = _registerName1("elementWithName:"); + late final _sel_elementWithName_URI_1 = + _registerName1("elementWithName:URI:"); + late final _sel_elementWithName_stringValue_1 = + _registerName1("elementWithName:stringValue:"); + late final _sel_elementWithName_children_attributes_1 = + _registerName1("elementWithName:children:attributes:"); + ffi.Pointer _objc_msgSend_969( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer children, + ffi.Pointer attributes, + ) { + return __objc_msgSend_969( + obj, + sel, + name, + children, + attributes, + ); + } + + late final __objc_msgSend_969Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_969 = __objc_msgSend_969Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_attributeWithName_stringValue_1 = + _registerName1("attributeWithName:stringValue:"); + late final _sel_attributeWithName_URI_stringValue_1 = + _registerName1("attributeWithName:URI:stringValue:"); + late final _sel_namespaceWithName_stringValue_1 = + _registerName1("namespaceWithName:stringValue:"); + late final _sel_processingInstructionWithName_stringValue_1 = + _registerName1("processingInstructionWithName:stringValue:"); + late final _sel_commentWithStringValue_1 = + _registerName1("commentWithStringValue:"); + late final _sel_textWithStringValue_1 = + _registerName1("textWithStringValue:"); + late final _sel_DTDNodeWithXMLString_1 = + _registerName1("DTDNodeWithXMLString:"); + late final _sel_kind1 = _registerName1("kind"); + int _objc_msgSend_970( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_970( + obj, + sel, + ); + } + + late final __objc_msgSend_970Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_970 = __objc_msgSend_970Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_objectValue1 = _registerName1("objectValue"); + late final _sel_setObjectValue_1 = _registerName1("setObjectValue:"); + late final _sel_setStringValue_1 = _registerName1("setStringValue:"); + late final _sel_setStringValue_resolvingEntities_1 = + _registerName1("setStringValue:resolvingEntities:"); + void _objc_msgSend_971( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + bool resolve, + ) { + return __objc_msgSend_971( + obj, + sel, + string, + resolve, + ); + } + + late final __objc_msgSend_971Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_971 = __objc_msgSend_971Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_index1 = _registerName1("index"); + late final _sel_level1 = _registerName1("level"); + late final _class_NSXMLDocument1 = _getClass1("NSXMLDocument"); + late final _sel_initWithXMLString_options_error_1 = + _registerName1("initWithXMLString:options:error:"); + instancetype _objc_msgSend_972( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int mask, + ffi.Pointer> error, + ) { + return __objc_msgSend_972( + obj, + sel, + string, + mask, + error, + ); + } + + late final __objc_msgSend_972Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_972 = __objc_msgSend_972Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + instancetype _objc_msgSend_973( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int mask, + ffi.Pointer> error, + ) { + return __objc_msgSend_973( + obj, + sel, + url, + mask, + error, + ); + } + + late final __objc_msgSend_973Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_973 = __objc_msgSend_973Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_initWithData_options_error_1 = + _registerName1("initWithData:options:error:"); + instancetype _objc_msgSend_974( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + int mask, + ffi.Pointer> error, + ) { + return __objc_msgSend_974( + obj, + sel, + data, + mask, + error, + ); + } + + late final __objc_msgSend_974Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_974 = __objc_msgSend_974Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_initWithRootElement_1 = + _registerName1("initWithRootElement:"); + late final _sel_replacementClassForClass_1 = + _registerName1("replacementClassForClass:"); + late final _sel_characterEncoding1 = _registerName1("characterEncoding"); + late final _sel_setCharacterEncoding_1 = + _registerName1("setCharacterEncoding:"); + late final _sel_isStandalone1 = _registerName1("isStandalone"); + late final _sel_setStandalone_1 = _registerName1("setStandalone:"); + late final _sel_documentContentKind1 = _registerName1("documentContentKind"); + int _objc_msgSend_975( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_975( + obj, + sel, + ); + } + + late final __objc_msgSend_975Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_975 = __objc_msgSend_975Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setDocumentContentKind_1 = + _registerName1("setDocumentContentKind:"); + void _objc_msgSend_976( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_976( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_976Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_976 = __objc_msgSend_976Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_setMIMEType_1 = _registerName1("setMIMEType:"); + late final _class_NSXMLDTD1 = _getClass1("NSXMLDTD"); + late final _sel_setPublicID_1 = _registerName1("setPublicID:"); + late final _sel_setSystemID_1 = _registerName1("setSystemID:"); + late final _sel_insertChild_atIndex_1 = + _registerName1("insertChild:atIndex:"); + void _objc_msgSend_977( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer child, + int index, + ) { + return __objc_msgSend_977( + obj, + sel, + child, + index, + ); + } + + late final __objc_msgSend_977Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_977 = __objc_msgSend_977Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_insertChildren_atIndex_1 = + _registerName1("insertChildren:atIndex:"); + void _objc_msgSend_978( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer children, + int index, + ) { + return __objc_msgSend_978( + obj, + sel, + children, + index, + ); + } + + late final __objc_msgSend_978Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_978 = __objc_msgSend_978Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_removeChildAtIndex_1 = _registerName1("removeChildAtIndex:"); + late final _sel_setChildren_1 = _registerName1("setChildren:"); + late final _sel_addChild_1 = _registerName1("addChild:"); + void _objc_msgSend_979( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer child, + ) { + return __objc_msgSend_979( + obj, + sel, + child, + ); + } + + late final __objc_msgSend_979Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_979 = __objc_msgSend_979Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_replaceChildAtIndex_withNode_1 = + _registerName1("replaceChildAtIndex:withNode:"); + void _objc_msgSend_980( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer node, + ) { + return __objc_msgSend_980( + obj, + sel, + index, + node, + ); + } + + late final __objc_msgSend_980Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_980 = __objc_msgSend_980Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _class_NSXMLDTDNode1 = _getClass1("NSXMLDTDNode"); + late final _sel_initWithXMLString_1 = _registerName1("initWithXMLString:"); + late final _sel_DTDKind1 = _registerName1("DTDKind"); + int _objc_msgSend_981( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_981( + obj, + sel, + ); + } + + late final __objc_msgSend_981Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_981 = __objc_msgSend_981Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setDTDKind_1 = _registerName1("setDTDKind:"); + void _objc_msgSend_982( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_982( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_982Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_982 = __objc_msgSend_982Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_isExternal1 = _registerName1("isExternal"); + late final _sel_notationName1 = _registerName1("notationName"); + late final _sel_setNotationName_1 = _registerName1("setNotationName:"); + late final _sel_localNameForName_1 = _registerName1("localNameForName:"); + late final _sel_prefixForName_1 = _registerName1("prefixForName:"); + late final _sel_predefinedNamespaceForPrefix_1 = + _registerName1("predefinedNamespaceForPrefix:"); + ffi.Pointer _objc_msgSend_983( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ) { + return __objc_msgSend_983( + obj, + sel, + name, + ); + } + + late final __objc_msgSend_983Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_983 = __objc_msgSend_983Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_entityDeclarationForName_1 = + _registerName1("entityDeclarationForName:"); + ffi.Pointer _objc_msgSend_984( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ) { + return __objc_msgSend_984( + obj, + sel, + name, + ); + } + + late final __objc_msgSend_984Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_984 = __objc_msgSend_984Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_notationDeclarationForName_1 = + _registerName1("notationDeclarationForName:"); + late final _sel_elementDeclarationForName_1 = + _registerName1("elementDeclarationForName:"); + late final _sel_attributeDeclarationForName_elementName_1 = + _registerName1("attributeDeclarationForName:elementName:"); + ffi.Pointer _objc_msgSend_985( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer elementName, + ) { + return __objc_msgSend_985( + obj, + sel, + name, + elementName, + ); + } + + late final __objc_msgSend_985Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_985 = __objc_msgSend_985Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_predefinedEntityDeclarationForName_1 = + _registerName1("predefinedEntityDeclarationForName:"); + late final _sel_DTD1 = _registerName1("DTD"); + ffi.Pointer _objc_msgSend_986( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_986( + obj, + sel, + ); + } + + late final __objc_msgSend_986Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_986 = __objc_msgSend_986Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setDTD_1 = _registerName1("setDTD:"); + void _objc_msgSend_987( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_987( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_987Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_987 = __objc_msgSend_987Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setRootElement_1 = _registerName1("setRootElement:"); + void _objc_msgSend_988( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer root, + ) { + return __objc_msgSend_988( + obj, + sel, + root, + ); + } + + late final __objc_msgSend_988Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_988 = __objc_msgSend_988Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_rootElement1 = _registerName1("rootElement"); + ffi.Pointer _objc_msgSend_989( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_989( + obj, + sel, + ); + } + + late final __objc_msgSend_989Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_989 = __objc_msgSend_989Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_XMLData1 = _registerName1("XMLData"); + late final _sel_XMLDataWithOptions_1 = _registerName1("XMLDataWithOptions:"); + ffi.Pointer _objc_msgSend_990( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_990( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_990Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_990 = __objc_msgSend_990Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_objectByApplyingXSLT_arguments_error_1 = + _registerName1("objectByApplyingXSLT:arguments:error:"); + ffi.Pointer _objc_msgSend_991( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer xslt, + ffi.Pointer arguments, + ffi.Pointer> error, + ) { + return __objc_msgSend_991( + obj, + sel, + xslt, + arguments, + error, + ); + } + + late final __objc_msgSend_991Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_991 = __objc_msgSend_991Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_objectByApplyingXSLTString_arguments_error_1 = + _registerName1("objectByApplyingXSLTString:arguments:error:"); + ffi.Pointer _objc_msgSend_992( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer xslt, + ffi.Pointer arguments, + ffi.Pointer> error, + ) { + return __objc_msgSend_992( + obj, + sel, + xslt, + arguments, + error, + ); + } + + late final __objc_msgSend_992Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_992 = __objc_msgSend_992Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_objectByApplyingXSLTAtURL_arguments_error_1 = + _registerName1("objectByApplyingXSLTAtURL:arguments:error:"); + ffi.Pointer _objc_msgSend_993( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer xsltURL, + ffi.Pointer argument, + ffi.Pointer> error, + ) { + return __objc_msgSend_993( + obj, + sel, + xsltURL, + argument, + error, + ); + } + + late final __objc_msgSend_993Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_993 = __objc_msgSend_993Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_validateAndReturnError_1 = + _registerName1("validateAndReturnError:"); + late final _sel_rootDocument1 = _registerName1("rootDocument"); + ffi.Pointer _objc_msgSend_994( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_994( + obj, + sel, + ); + } + + late final __objc_msgSend_994Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_994 = __objc_msgSend_994Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_parent1 = _registerName1("parent"); + ffi.Pointer _objc_msgSend_995( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_995( + obj, + sel, + ); + } + + late final __objc_msgSend_995Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_995 = __objc_msgSend_995Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_childCount1 = _registerName1("childCount"); + late final _sel_children1 = _registerName1("children"); + late final _sel_childAtIndex_1 = _registerName1("childAtIndex:"); + ffi.Pointer _objc_msgSend_996( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_996( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_996Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_996 = __objc_msgSend_996Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_previousSibling1 = _registerName1("previousSibling"); + late final _sel_nextSibling1 = _registerName1("nextSibling"); + late final _sel_previousNode1 = _registerName1("previousNode"); + late final _sel_nextNode1 = _registerName1("nextNode"); + late final _sel_detach1 = _registerName1("detach"); + late final _sel_XPath1 = _registerName1("XPath"); + late final _sel_localName1 = _registerName1("localName"); + late final _sel_prefix1 = _registerName1("prefix"); + late final _sel_URI1 = _registerName1("URI"); + late final _sel_setURI_1 = _registerName1("setURI:"); + late final _sel_XMLString1 = _registerName1("XMLString"); + late final _sel_XMLStringWithOptions_1 = + _registerName1("XMLStringWithOptions:"); + ffi.Pointer _objc_msgSend_997( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_997( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_997Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_997 = __objc_msgSend_997Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_canonicalXMLStringPreservingComments_1 = + _registerName1("canonicalXMLStringPreservingComments:"); + ffi.Pointer _objc_msgSend_998( + ffi.Pointer obj, + ffi.Pointer sel, + bool comments, + ) { + return __objc_msgSend_998( + obj, + sel, + comments, + ); + } + + late final __objc_msgSend_998Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_998 = __objc_msgSend_998Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_nodesForXPath_error_1 = + _registerName1("nodesForXPath:error:"); + late final _sel_objectsForXQuery_constants_error_1 = + _registerName1("objectsForXQuery:constants:error:"); + ffi.Pointer _objc_msgSend_999( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer xquery, + ffi.Pointer constants, + ffi.Pointer> error, + ) { + return __objc_msgSend_999( + obj, + sel, + xquery, + constants, + error, + ); + } + + late final __objc_msgSend_999Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_999 = __objc_msgSend_999Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_objectsForXQuery_error_1 = + _registerName1("objectsForXQuery:error:"); + late final _sel_initWithName_URI_1 = _registerName1("initWithName:URI:"); + late final _sel_initWithName_stringValue_1 = + _registerName1("initWithName:stringValue:"); + late final _sel_initWithXMLString_error_1 = + _registerName1("initWithXMLString:error:"); + late final _sel_elementsForName_1 = _registerName1("elementsForName:"); + late final _sel_elementsForLocalName_URI_1 = + _registerName1("elementsForLocalName:URI:"); + late final _sel_addAttribute_1 = _registerName1("addAttribute:"); + late final _sel_removeAttributeForName_1 = + _registerName1("removeAttributeForName:"); + late final _sel_attributes1 = _registerName1("attributes"); + late final _sel_setAttributes_1 = _registerName1("setAttributes:"); + late final _sel_setAttributesWithDictionary_1 = + _registerName1("setAttributesWithDictionary:"); + late final _sel_attributeForName_1 = _registerName1("attributeForName:"); + late final _sel_attributeForLocalName_URI_1 = + _registerName1("attributeForLocalName:URI:"); + ffi.Pointer _objc_msgSend_1000( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer localName, + ffi.Pointer URI, + ) { + return __objc_msgSend_1000( + obj, + sel, + localName, + URI, + ); + } + + late final __objc_msgSend_1000Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1000 = __objc_msgSend_1000Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_addNamespace_1 = _registerName1("addNamespace:"); + late final _sel_removeNamespaceForPrefix_1 = + _registerName1("removeNamespaceForPrefix:"); + late final _sel_namespaces1 = _registerName1("namespaces"); + late final _sel_setNamespaces_1 = _registerName1("setNamespaces:"); + late final _sel_namespaceForPrefix_1 = _registerName1("namespaceForPrefix:"); + late final _sel_resolveNamespaceForName_1 = + _registerName1("resolveNamespaceForName:"); + late final _sel_resolvePrefixForNamespaceURI_1 = + _registerName1("resolvePrefixForNamespaceURI:"); + late final _sel_normalizeAdjacentTextNodesPreservingCDATA_1 = + _registerName1("normalizeAdjacentTextNodesPreservingCDATA:"); + late final _sel_setAttributesAsDictionary_1 = + _registerName1("setAttributesAsDictionary:"); + late final _class_AVAudioSession1 = _getClass1("AVAudioSession"); + late final _sel_sharedInstance1 = _registerName1("sharedInstance"); + ffi.Pointer _objc_msgSend_1001( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1001( + obj, + sel, + ); + } + + late final __objc_msgSend_1001Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1001 = __objc_msgSend_1001Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_availableCategories1 = _registerName1("availableCategories"); + late final _sel_setCategory_error_1 = _registerName1("setCategory:error:"); + late final _sel_setCategory_withOptions_error_1 = + _registerName1("setCategory:withOptions:error:"); + bool _objc_msgSend_1002( + ffi.Pointer obj, + ffi.Pointer sel, + AVAudioSessionCategory category, + int options, + ffi.Pointer> outError, + ) { + return __objc_msgSend_1002( + obj, + sel, + category, + options, + outError, + ); + } + + late final __objc_msgSend_1002Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + AVAudioSessionCategory, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1002 = __objc_msgSend_1002Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + AVAudioSessionCategory, int, ffi.Pointer>)>(); + + late final _sel_setCategory_mode_options_error_1 = + _registerName1("setCategory:mode:options:error:"); + bool _objc_msgSend_1003( + ffi.Pointer obj, + ffi.Pointer sel, + AVAudioSessionCategory category, + AVAudioSessionMode mode, + int options, + ffi.Pointer> outError, + ) { + return __objc_msgSend_1003( + obj, + sel, + category, + mode, + options, + outError, + ); + } + + late final __objc_msgSend_1003Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + AVAudioSessionCategory, + AVAudioSessionMode, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1003 = __objc_msgSend_1003Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + AVAudioSessionCategory, + AVAudioSessionMode, + int, + ffi.Pointer>)>(); + + late final _sel_setCategory_mode_routeSharingPolicy_options_error_1 = + _registerName1("setCategory:mode:routeSharingPolicy:options:error:"); + bool _objc_msgSend_1004( + ffi.Pointer obj, + ffi.Pointer sel, + AVAudioSessionCategory category, + AVAudioSessionMode mode, + int policy, + int options, + ffi.Pointer> outError, + ) { + return __objc_msgSend_1004( + obj, + sel, + category, + mode, + policy, + options, + outError, + ); + } + + late final __objc_msgSend_1004Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + AVAudioSessionCategory, + AVAudioSessionMode, + ffi.Int32, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1004 = __objc_msgSend_1004Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + AVAudioSessionCategory, + AVAudioSessionMode, + int, + int, + ffi.Pointer>)>(); + + late final _sel_category1 = _registerName1("category"); + late final _sel_categoryOptions1 = _registerName1("categoryOptions"); + int _objc_msgSend_1005( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1005( + obj, + sel, + ); + } + + late final __objc_msgSend_1005Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1005 = __objc_msgSend_1005Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_routeSharingPolicy1 = _registerName1("routeSharingPolicy"); + int _objc_msgSend_1006( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1006( + obj, + sel, + ); + } + + late final __objc_msgSend_1006Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1006 = __objc_msgSend_1006Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_availableModes1 = _registerName1("availableModes"); + late final _sel_setMode_error_1 = _registerName1("setMode:error:"); + late final _sel_mode1 = _registerName1("mode"); + late final _sel_setAllowHapticsAndSystemSoundsDuringRecording_error_1 = + _registerName1("setAllowHapticsAndSystemSoundsDuringRecording:error:"); + bool _objc_msgSend_1007( + ffi.Pointer obj, + ffi.Pointer sel, + bool inValue, + ffi.Pointer> outError, + ) { + return __objc_msgSend_1007( + obj, + sel, + inValue, + outError, + ); + } + + late final __objc_msgSend_1007Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Bool, ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1007 = __objc_msgSend_1007Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, bool, + ffi.Pointer>)>(); + + late final _sel_allowHapticsAndSystemSoundsDuringRecording1 = + _registerName1("allowHapticsAndSystemSoundsDuringRecording"); + late final _sel_recordPermission1 = _registerName1("recordPermission"); + int _objc_msgSend_1008( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1008( + obj, + sel, + ); + } + + late final __objc_msgSend_1008Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1008 = __objc_msgSend_1008Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_requestRecordPermission_1 = + _registerName1("requestRecordPermission:"); + void _objc_msgSend_1009( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> response, + ) { + return __objc_msgSend_1009( + obj, + sel, + response, + ); + } + + late final __objc_msgSend_1009Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_1009 = __objc_msgSend_1009Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_overrideOutputAudioPort_error_1 = + _registerName1("overrideOutputAudioPort:error:"); + bool _objc_msgSend_1010( + ffi.Pointer obj, + ffi.Pointer sel, + int portOverride, + ffi.Pointer> outError, + ) { + return __objc_msgSend_1010( + obj, + sel, + portOverride, + outError, + ); + } + + late final __objc_msgSend_1010Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1010 = __objc_msgSend_1010Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer>)>(); + + late final _class_AVAudioSessionPortDescription1 = + _getClass1("AVAudioSessionPortDescription"); + late final _sel_portType1 = _registerName1("portType"); + late final _sel_portName1 = _registerName1("portName"); + late final _sel_UID1 = _registerName1("UID"); + late final _sel_hasHardwareVoiceCallProcessing1 = + _registerName1("hasHardwareVoiceCallProcessing"); + late final _sel_isSpatialAudioEnabled1 = + _registerName1("isSpatialAudioEnabled"); + late final _sel_channels1 = _registerName1("channels"); + late final _sel_dataSources1 = _registerName1("dataSources"); + late final _class_AVAudioSessionDataSourceDescription1 = + _getClass1("AVAudioSessionDataSourceDescription"); + late final _sel_dataSourceID1 = _registerName1("dataSourceID"); + late final _sel_dataSourceName1 = _registerName1("dataSourceName"); + late final _sel_location1 = _registerName1("location"); + late final _sel_orientation1 = _registerName1("orientation"); + late final _sel_supportedPolarPatterns1 = + _registerName1("supportedPolarPatterns"); + late final _sel_selectedPolarPattern1 = + _registerName1("selectedPolarPattern"); + late final _sel_preferredPolarPattern1 = + _registerName1("preferredPolarPattern"); + late final _sel_setPreferredPolarPattern_error_1 = + _registerName1("setPreferredPolarPattern:error:"); + late final _sel_selectedDataSource1 = _registerName1("selectedDataSource"); + ffi.Pointer _objc_msgSend_1011( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1011( + obj, + sel, + ); + } + + late final __objc_msgSend_1011Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1011 = __objc_msgSend_1011Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_preferredDataSource1 = _registerName1("preferredDataSource"); + late final _sel_setPreferredDataSource_error_1 = + _registerName1("setPreferredDataSource:error:"); + bool _objc_msgSend_1012( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dataSource, + ffi.Pointer> outError, + ) { + return __objc_msgSend_1012( + obj, + sel, + dataSource, + outError, + ); + } + + late final __objc_msgSend_1012Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1012 = __objc_msgSend_1012Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_setPreferredInput_error_1 = + _registerName1("setPreferredInput:error:"); + bool _objc_msgSend_1013( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer inPort, + ffi.Pointer> outError, + ) { + return __objc_msgSend_1013( + obj, + sel, + inPort, + outError, + ); + } + + late final __objc_msgSend_1013Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1013 = __objc_msgSend_1013Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_preferredInput1 = _registerName1("preferredInput"); + ffi.Pointer _objc_msgSend_1014( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1014( + obj, + sel, + ); + } + + late final __objc_msgSend_1014Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1014 = __objc_msgSend_1014Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setPrefersNoInterruptionsFromSystemAlerts_error_1 = + _registerName1("setPrefersNoInterruptionsFromSystemAlerts:error:"); + late final _sel_prefersNoInterruptionsFromSystemAlerts1 = + _registerName1("prefersNoInterruptionsFromSystemAlerts"); + late final _sel_setActive_error_1 = _registerName1("setActive:error:"); + late final _sel_setActive_withOptions_error_1 = + _registerName1("setActive:withOptions:error:"); + bool _objc_msgSend_1015( + ffi.Pointer obj, + ffi.Pointer sel, + bool active, + int options, + ffi.Pointer> outError, + ) { + return __objc_msgSend_1015( + obj, + sel, + active, + options, + outError, + ); + } + + late final __objc_msgSend_1015Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1015 = __objc_msgSend_1015Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, bool, int, + ffi.Pointer>)>(); + + late final _sel_activateWithOptions_completionHandler_1 = + _registerName1("activateWithOptions:completionHandler:"); + void _objc_msgSend_1016( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ffi.Pointer<_ObjCBlock> handler, + ) { + return __objc_msgSend_1016( + obj, + sel, + options, + handler, + ); + } + + late final __objc_msgSend_1016Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_1016 = __objc_msgSend_1016Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_setPreferredSampleRate_error_1 = + _registerName1("setPreferredSampleRate:error:"); + bool _objc_msgSend_1017( + ffi.Pointer obj, + ffi.Pointer sel, + double sampleRate, + ffi.Pointer> outError, + ) { + return __objc_msgSend_1017( + obj, + sel, + sampleRate, + outError, + ); + } + + late final __objc_msgSend_1017Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Double, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1017 = __objc_msgSend_1017Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, double, + ffi.Pointer>)>(); + + late final _sel_preferredSampleRate1 = _registerName1("preferredSampleRate"); + late final _sel_setPreferredIOBufferDuration_error_1 = + _registerName1("setPreferredIOBufferDuration:error:"); + late final _sel_preferredIOBufferDuration1 = + _registerName1("preferredIOBufferDuration"); + late final _sel_setPreferredInputNumberOfChannels_error_1 = + _registerName1("setPreferredInputNumberOfChannels:error:"); + bool _objc_msgSend_1018( + ffi.Pointer obj, + ffi.Pointer sel, + int count, + ffi.Pointer> outError, + ) { + return __objc_msgSend_1018( + obj, + sel, + count, + outError, + ); + } + + late final __objc_msgSend_1018Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1018 = __objc_msgSend_1018Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer>)>(); + + late final _sel_preferredInputNumberOfChannels1 = + _registerName1("preferredInputNumberOfChannels"); + late final _sel_setPreferredOutputNumberOfChannels_error_1 = + _registerName1("setPreferredOutputNumberOfChannels:error:"); + late final _sel_preferredOutputNumberOfChannels1 = + _registerName1("preferredOutputNumberOfChannels"); + late final _sel_setPreferredInputOrientation_error_1 = + _registerName1("setPreferredInputOrientation:error:"); + bool _objc_msgSend_1019( + ffi.Pointer obj, + ffi.Pointer sel, + int orientation, + ffi.Pointer> outError, + ) { + return __objc_msgSend_1019( + obj, + sel, + orientation, + outError, + ); + } + + late final __objc_msgSend_1019Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1019 = __objc_msgSend_1019Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer>)>(); + + late final _sel_preferredInputOrientation1 = + _registerName1("preferredInputOrientation"); + int _objc_msgSend_1020( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1020( + obj, + sel, + ); + } + + late final __objc_msgSend_1020Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1020 = __objc_msgSend_1020Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_inputOrientation1 = _registerName1("inputOrientation"); + late final _sel_maximumInputNumberOfChannels1 = + _registerName1("maximumInputNumberOfChannels"); + late final _sel_maximumOutputNumberOfChannels1 = + _registerName1("maximumOutputNumberOfChannels"); + late final _sel_setInputGain_error_1 = _registerName1("setInputGain:error:"); + bool _objc_msgSend_1021( + ffi.Pointer obj, + ffi.Pointer sel, + double gain, + ffi.Pointer> outError, + ) { + return __objc_msgSend_1021( + obj, + sel, + gain, + outError, + ); + } + + late final __objc_msgSend_1021Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Float, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1021 = __objc_msgSend_1021Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, double, + ffi.Pointer>)>(); + + late final _sel_inputGain1 = _registerName1("inputGain"); + late final _sel_isInputGainSettable1 = _registerName1("isInputGainSettable"); + late final _sel_isInputAvailable1 = _registerName1("isInputAvailable"); + late final _sel_inputDataSources1 = _registerName1("inputDataSources"); + late final _sel_inputDataSource1 = _registerName1("inputDataSource"); + late final _sel_setInputDataSource_error_1 = + _registerName1("setInputDataSource:error:"); + late final _sel_outputDataSources1 = _registerName1("outputDataSources"); + late final _sel_outputDataSource1 = _registerName1("outputDataSource"); + late final _sel_setOutputDataSource_error_1 = + _registerName1("setOutputDataSource:error:"); + late final _sel_sampleRate1 = _registerName1("sampleRate"); + late final _sel_inputNumberOfChannels1 = + _registerName1("inputNumberOfChannels"); + late final _sel_outputNumberOfChannels1 = + _registerName1("outputNumberOfChannels"); + late final _sel_inputLatency1 = _registerName1("inputLatency"); + late final _sel_outputLatency1 = _registerName1("outputLatency"); + late final _sel_IOBufferDuration1 = _registerName1("IOBufferDuration"); + late final _sel_isOtherAudioPlaying1 = _registerName1("isOtherAudioPlaying"); + late final _sel_secondaryAudioShouldBeSilencedHint1 = + _registerName1("secondaryAudioShouldBeSilencedHint"); + late final _sel_outputVolume1 = _registerName1("outputVolume"); + late final _sel_promptStyle1 = _registerName1("promptStyle"); + int _objc_msgSend_1022( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1022( + obj, + sel, + ); + } + + late final __objc_msgSend_1022Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1022 = __objc_msgSend_1022Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_availableInputs1 = _registerName1("availableInputs"); + late final _class_AVAudioSessionRouteDescription1 = + _getClass1("AVAudioSessionRouteDescription"); + late final _sel_inputs1 = _registerName1("inputs"); + late final _sel_outputs1 = _registerName1("outputs"); + late final _sel_currentRoute1 = _registerName1("currentRoute"); + ffi.Pointer _objc_msgSend_1023( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1023( + obj, + sel, + ); + } + + late final __objc_msgSend_1023Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1023 = __objc_msgSend_1023Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setAggregatedIOPreference_error_1 = + _registerName1("setAggregatedIOPreference:error:"); + bool _objc_msgSend_1024( + ffi.Pointer obj, + ffi.Pointer sel, + int inIOType, + ffi.Pointer> outError, + ) { + return __objc_msgSend_1024( + obj, + sel, + inIOType, + outError, + ); + } + + late final __objc_msgSend_1024Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1024 = __objc_msgSend_1024Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer>)>(); + + late final _sel_setSupportsMultichannelContent_error_1 = + _registerName1("setSupportsMultichannelContent:error:"); + late final _sel_supportsMultichannelContent1 = + _registerName1("supportsMultichannelContent"); + late final _sel_setActive_withFlags_error_1 = + _registerName1("setActive:withFlags:error:"); + bool _objc_msgSend_1025( + ffi.Pointer obj, + ffi.Pointer sel, + bool active, + int flags, + ffi.Pointer> outError, + ) { + return __objc_msgSend_1025( + obj, + sel, + active, + flags, + outError, + ); + } + + late final __objc_msgSend_1025Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + NSInteger, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1025 = __objc_msgSend_1025Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, bool, int, + ffi.Pointer>)>(); + + late final _sel_inputIsAvailable1 = _registerName1("inputIsAvailable"); + late final _sel_currentHardwareSampleRate1 = + _registerName1("currentHardwareSampleRate"); + late final _sel_currentHardwareInputNumberOfChannels1 = + _registerName1("currentHardwareInputNumberOfChannels"); + late final _sel_currentHardwareOutputNumberOfChannels1 = + _registerName1("currentHardwareOutputNumberOfChannels"); + late final _sel_setPreferredHardwareSampleRate_error_1 = + _registerName1("setPreferredHardwareSampleRate:error:"); + late final _sel_preferredHardwareSampleRate1 = + _registerName1("preferredHardwareSampleRate"); + late final _class_AVAudioPlayer1 = _getClass1("AVAudioPlayer"); + late final _sel_initWithData_error_1 = _registerName1("initWithData:error:"); + instancetype _objc_msgSend_1026( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ffi.Pointer> outError, + ) { + return __objc_msgSend_1026( + obj, + sel, + data, + outError, + ); + } + + late final __objc_msgSend_1026Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1026 = __objc_msgSend_1026Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_initWithContentsOfURL_fileTypeHint_error_1 = + _registerName1("initWithContentsOfURL:fileTypeHint:error:"); + instancetype _objc_msgSend_1027( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer utiString, + ffi.Pointer> outError, + ) { + return __objc_msgSend_1027( + obj, + sel, + url, + utiString, + outError, + ); + } + + late final __objc_msgSend_1027Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1027 = __objc_msgSend_1027Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_initWithData_fileTypeHint_error_1 = + _registerName1("initWithData:fileTypeHint:error:"); + instancetype _objc_msgSend_1028( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ffi.Pointer utiString, + ffi.Pointer> outError, + ) { + return __objc_msgSend_1028( + obj, + sel, + data, + utiString, + outError, + ); + } + + late final __objc_msgSend_1028Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1028 = __objc_msgSend_1028Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_prepareToPlay1 = _registerName1("prepareToPlay"); + late final _sel_play1 = _registerName1("play"); + late final _sel_playAtTime_1 = _registerName1("playAtTime:"); + bool _objc_msgSend_1029( + ffi.Pointer obj, + ffi.Pointer sel, + double time, + ) { + return __objc_msgSend_1029( + obj, + sel, + time, + ); + } + + late final __objc_msgSend_1029Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + NSTimeInterval)>>('objc_msgSend'); + late final __objc_msgSend_1029 = __objc_msgSend_1029Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_isPlaying1 = _registerName1("isPlaying"); + late final _sel_numberOfChannels1 = _registerName1("numberOfChannels"); + late final _sel_currentDevice1 = _registerName1("currentDevice"); + late final _sel_setCurrentDevice_1 = _registerName1("setCurrentDevice:"); + late final _sel_url1 = _registerName1("url"); + late final _sel_pan1 = _registerName1("pan"); + late final _sel_setPan_1 = _registerName1("setPan:"); + late final _sel_volume1 = _registerName1("volume"); + late final _sel_setVolume_1 = _registerName1("setVolume:"); + late final _sel_setVolume_fadeDuration_1 = + _registerName1("setVolume:fadeDuration:"); + void _objc_msgSend_1030( + ffi.Pointer obj, + ffi.Pointer sel, + double volume, + double duration, + ) { + return __objc_msgSend_1030( + obj, + sel, + volume, + duration, + ); + } + + late final __objc_msgSend_1030Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Float, NSTimeInterval)>>('objc_msgSend'); + late final __objc_msgSend_1030 = __objc_msgSend_1030Ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, double, double)>(); + + late final _sel_enableRate1 = _registerName1("enableRate"); + late final _sel_setEnableRate_1 = _registerName1("setEnableRate:"); + late final _sel_rate1 = _registerName1("rate"); + late final _sel_setRate_1 = _registerName1("setRate:"); + late final _sel_currentTime1 = _registerName1("currentTime"); + late final _sel_setCurrentTime_1 = _registerName1("setCurrentTime:"); + late final _sel_deviceCurrentTime1 = _registerName1("deviceCurrentTime"); + late final _sel_numberOfLoops1 = _registerName1("numberOfLoops"); + late final _sel_setNumberOfLoops_1 = _registerName1("setNumberOfLoops:"); + late final _sel_settings1 = _registerName1("settings"); + late final _class_AVAudioFormat1 = _getClass1("AVAudioFormat"); + late final _sel_initWithStreamDescription_1 = + _registerName1("initWithStreamDescription:"); + instancetype _objc_msgSend_1031( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer asbd, + ) { + return __objc_msgSend_1031( + obj, + sel, + asbd, + ); + } + + late final __objc_msgSend_1031Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1031 = __objc_msgSend_1031Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_AVAudioChannelLayout1 = _getClass1("AVAudioChannelLayout"); + late final _sel_initWithLayoutTag_1 = _registerName1("initWithLayoutTag:"); + instancetype _objc_msgSend_1032( + ffi.Pointer obj, + ffi.Pointer sel, + int layoutTag, + ) { + return __objc_msgSend_1032( + obj, + sel, + layoutTag, + ); + } + + late final __objc_msgSend_1032Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + AudioChannelLayoutTag)>>('objc_msgSend'); + late final __objc_msgSend_1032 = __objc_msgSend_1032Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithLayout_1 = _registerName1("initWithLayout:"); + instancetype _objc_msgSend_1033( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer layout, + ) { + return __objc_msgSend_1033( + obj, + sel, + layout, + ); + } + + late final __objc_msgSend_1033Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1033 = __objc_msgSend_1033Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_isEqual_1 = _registerName1("isEqual:"); + late final _sel_layoutWithLayoutTag_1 = + _registerName1("layoutWithLayoutTag:"); + late final _sel_layoutWithLayout_1 = _registerName1("layoutWithLayout:"); + late final _sel_layoutTag1 = _registerName1("layoutTag"); + late final _sel_layout1 = _registerName1("layout"); + ffi.Pointer _objc_msgSend_1034( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1034( + obj, + sel, + ); + } + + late final __objc_msgSend_1034Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1034 = __objc_msgSend_1034Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_channelCount1 = _registerName1("channelCount"); + int _objc_msgSend_1035( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1035( + obj, + sel, + ); + } + + late final __objc_msgSend_1035Ptr = _lookup< + ffi.NativeFunction< + AVAudioChannelCount Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1035 = __objc_msgSend_1035Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithStreamDescription_channelLayout_1 = + _registerName1("initWithStreamDescription:channelLayout:"); + instancetype _objc_msgSend_1036( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer asbd, + ffi.Pointer layout, + ) { + return __objc_msgSend_1036( + obj, + sel, + asbd, + layout, + ); + } + + late final __objc_msgSend_1036Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1036 = __objc_msgSend_1036Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initStandardFormatWithSampleRate_channels_1 = + _registerName1("initStandardFormatWithSampleRate:channels:"); + instancetype _objc_msgSend_1037( + ffi.Pointer obj, + ffi.Pointer sel, + double sampleRate, + int channels, + ) { + return __objc_msgSend_1037( + obj, + sel, + sampleRate, + channels, + ); + } + + late final __objc_msgSend_1037Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Double, AVAudioChannelCount)>>('objc_msgSend'); + late final __objc_msgSend_1037 = __objc_msgSend_1037Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, double, int)>(); + + late final _sel_initStandardFormatWithSampleRate_channelLayout_1 = + _registerName1("initStandardFormatWithSampleRate:channelLayout:"); + instancetype _objc_msgSend_1038( + ffi.Pointer obj, + ffi.Pointer sel, + double sampleRate, + ffi.Pointer layout, + ) { + return __objc_msgSend_1038( + obj, + sel, + sampleRate, + layout, + ); + } + + late final __objc_msgSend_1038Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Double, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1038 = __objc_msgSend_1038Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + double, ffi.Pointer)>(); + + late final _sel_initWithCommonFormat_sampleRate_channels_interleaved_1 = + _registerName1("initWithCommonFormat:sampleRate:channels:interleaved:"); + instancetype _objc_msgSend_1039( + ffi.Pointer obj, + ffi.Pointer sel, + int format, + double sampleRate, + int channels, + bool interleaved, + ) { + return __objc_msgSend_1039( + obj, + sel, + format, + sampleRate, + channels, + interleaved, + ); + } + + late final __objc_msgSend_1039Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Double, + AVAudioChannelCount, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_1039 = __objc_msgSend_1039Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + double, int, bool)>(); + + late final _sel_initWithCommonFormat_sampleRate_interleaved_channelLayout_1 = + _registerName1( + "initWithCommonFormat:sampleRate:interleaved:channelLayout:"); + instancetype _objc_msgSend_1040( + ffi.Pointer obj, + ffi.Pointer sel, + int format, + double sampleRate, + bool interleaved, + ffi.Pointer layout, + ) { + return __objc_msgSend_1040( + obj, + sel, + format, + sampleRate, + interleaved, + layout, + ); + } + + late final __objc_msgSend_1040Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Double, + ffi.Bool, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1040 = __objc_msgSend_1040Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + double, bool, ffi.Pointer)>(); + + late final _sel_initWithSettings_1 = _registerName1("initWithSettings:"); + late final _sel_initWithCMAudioFormatDescription_1 = + _registerName1("initWithCMAudioFormatDescription:"); + instancetype _objc_msgSend_1041( + ffi.Pointer obj, + ffi.Pointer sel, + CMAudioFormatDescriptionRef formatDescription, + ) { + return __objc_msgSend_1041( + obj, + sel, + formatDescription, + ); + } + + late final __objc_msgSend_1041Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + CMAudioFormatDescriptionRef)>>('objc_msgSend'); + late final __objc_msgSend_1041 = __objc_msgSend_1041Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + CMAudioFormatDescriptionRef)>(); + + late final _sel_isStandard1 = _registerName1("isStandard"); + late final _sel_commonFormat1 = _registerName1("commonFormat"); + int _objc_msgSend_1042( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1042( + obj, + sel, + ); + } + + late final __objc_msgSend_1042Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1042 = __objc_msgSend_1042Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isInterleaved1 = _registerName1("isInterleaved"); + late final _sel_streamDescription1 = _registerName1("streamDescription"); + ffi.Pointer _objc_msgSend_1043( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1043( + obj, + sel, + ); + } + + late final __objc_msgSend_1043Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1043 = __objc_msgSend_1043Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_channelLayout1 = _registerName1("channelLayout"); + ffi.Pointer _objc_msgSend_1044( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1044( + obj, + sel, + ); + } + + late final __objc_msgSend_1044Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1044 = __objc_msgSend_1044Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_magicCookie1 = _registerName1("magicCookie"); + late final _sel_setMagicCookie_1 = _registerName1("setMagicCookie:"); + late final _sel_formatDescription1 = _registerName1("formatDescription"); + CMAudioFormatDescriptionRef _objc_msgSend_1045( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1045( + obj, + sel, + ); + } + + late final __objc_msgSend_1045Ptr = _lookup< + ffi.NativeFunction< + CMAudioFormatDescriptionRef Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1045 = __objc_msgSend_1045Ptr.asFunction< + CMAudioFormatDescriptionRef Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_1046( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1046( + obj, + sel, + ); + } + + late final __objc_msgSend_1046Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1046 = __objc_msgSend_1046Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isMeteringEnabled1 = _registerName1("isMeteringEnabled"); + late final _sel_setMeteringEnabled_1 = _registerName1("setMeteringEnabled:"); + late final _sel_updateMeters1 = _registerName1("updateMeters"); + late final _sel_peakPowerForChannel_1 = + _registerName1("peakPowerForChannel:"); + double _objc_msgSend_1047( + ffi.Pointer obj, + ffi.Pointer sel, + int channelNumber, + ) { + return __objc_msgSend_1047( + obj, + sel, + channelNumber, + ); + } + + late final __objc_msgSend_1047Ptr = _lookup< + ffi.NativeFunction< + ffi.Float Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_1047 = __objc_msgSend_1047Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_averagePowerForChannel_1 = + _registerName1("averagePowerForChannel:"); + late final _sel_channelAssignments1 = _registerName1("channelAssignments"); + late final _sel_setChannelAssignments_1 = + _registerName1("setChannelAssignments:"); +} + +class _ObjCWrapper implements ffi.Finalizable { + final ffi.Pointer _id; + final AVFAudio _lib; + bool _pendingRelease; + + _ObjCWrapper._(this._id, this._lib, + {bool retain = false, bool release = false}) + : _pendingRelease = release { + if (retain) { + _lib._objc_retain(_id); + } + if (release) { + _lib._objc_releaseFinalizer1.attach(this, _id.cast(), detach: this); + } + } + + /// Releases the reference to the underlying ObjC object held by this wrapper. + /// Throws a StateError if this wrapper doesn't currently hold a reference. + void release() { + if (_pendingRelease) { + _pendingRelease = false; + _lib._objc_release(_id); + _lib._objc_releaseFinalizer1.detach(this); + } else { + throw StateError( + 'Released an ObjC object that was unowned or already released.'); + } + } + + @override + bool operator ==(Object other) { + return other is _ObjCWrapper && _id == other._id; + } + + @override + int get hashCode => _id.hashCode; +} + +class NSObject extends _ObjCWrapper { + NSObject._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSObject] that points to the same underlying object as [other]. + static NSObject castFrom(T other) { + return NSObject._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSObject] that wraps the given raw object pointer. + static NSObject castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSObject._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSObject]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSObject1); + } + + static void load(AVFAudio _lib) { + return _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_load1); + } + + static void initialize(AVFAudio _lib) { + return _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_initialize1); + } + + NSObject init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSObject1, _lib._sel_new1); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static NSObject allocWithZone_(AVFAudio _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static NSObject alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSObject1, _lib._sel_alloc1); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + void dealloc() { + return _lib._objc_msgSend_1(_id, _lib._sel_dealloc1); + } + + void finalize() { + return _lib._objc_msgSend_1(_id, _lib._sel_finalize1); + } + + NSObject copy() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_copy1); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + NSObject mutableCopy() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_mutableCopy1); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static NSObject copyWithZone_(AVFAudio _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static NSObject mutableCopyWithZone_( + AVFAudio _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static bool instancesRespondToSelector_( + AVFAudio _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_4(_lib._class_NSObject1, + _lib._sel_instancesRespondToSelector_1, aSelector); + } + + static bool conformsToProtocol_(AVFAudio _lib, Protocol? protocol) { + return _lib._objc_msgSend_5(_lib._class_NSObject1, + _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); + } + + IMP methodForSelector_(ffi.Pointer aSelector) { + return _lib._objc_msgSend_6(_id, _lib._sel_methodForSelector_1, aSelector); + } + + static IMP instanceMethodForSelector_( + AVFAudio _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_6(_lib._class_NSObject1, + _lib._sel_instanceMethodForSelector_1, aSelector); + } + + void doesNotRecognizeSelector_(ffi.Pointer aSelector) { + return _lib._objc_msgSend_7( + _id, _lib._sel_doesNotRecognizeSelector_1, aSelector); + } + + NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_8( + _id, _lib._sel_forwardingTargetForSelector_1, aSelector); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void forwardInvocation_(NSInvocation? anInvocation) { + return _lib._objc_msgSend_372( + _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); + } + + NSMethodSignature methodSignatureForSelector_( + ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_373( + _id, _lib._sel_methodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib, retain: true, release: true); + } + + static NSMethodSignature instanceMethodSignatureForSelector_( + AVFAudio _lib, ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_373(_lib._class_NSObject1, + _lib._sel_instanceMethodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib, retain: true, release: true); + } + + bool allowsWeakReference() { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsWeakReference1); + } + + bool retainWeakReference() { + return _lib._objc_msgSend_12(_id, _lib._sel_retainWeakReference1); + } + + static bool isSubclassOfClass_(AVFAudio _lib, NSObject aClass) { + return _lib._objc_msgSend_0( + _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); + } + + static bool resolveClassMethod_(AVFAudio _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_4( + _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); + } + + static bool resolveInstanceMethod_(AVFAudio _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_4( + _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); + } + + static int hash(AVFAudio _lib) { + return _lib._objc_msgSend_10(_lib._class_NSObject1, _lib._sel_hash1); + } + + static NSObject superclass(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSObject1, _lib._sel_superclass1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject class1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSObject1, _lib._sel_class1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSString description(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_20(_lib._class_NSObject1, _lib._sel_description1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString debugDescription(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_20( + _lib._class_NSObject1, _lib._sel_debugDescription1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static int version(AVFAudio _lib) { + return _lib._objc_msgSend_78(_lib._class_NSObject1, _lib._sel_version1); + } + + static void setVersion_(AVFAudio _lib, int aVersion) { + return _lib._objc_msgSend_374( + _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); + } + + NSObject get classForCoder { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_classForCoder1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject replacementObjectForCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject awakeAfterUsingCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static void poseAsClass_(AVFAudio _lib, NSObject aClass) { + return _lib._objc_msgSend_15( + _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); + } + + NSObject get autoContentAccessingProxy { + final _ret = + _lib._objc_msgSend_2(_id, _lib._sel_autoContentAccessingProxy1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void + attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_( + NSError? error, + int recoveryOptionIndex, + NSObject delegate, + ffi.Pointer didRecoverSelector, + ffi.Pointer contextInfo) { + return _lib._objc_msgSend_375( + _id, + _lib._sel_attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_1, + error?._id ?? ffi.nullptr, + recoveryOptionIndex, + delegate._id, + didRecoverSelector, + contextInfo); + } + + bool attemptRecoveryFromError_optionIndex_( + NSError? error, int recoveryOptionIndex) { + return _lib._objc_msgSend_376( + _id, + _lib._sel_attemptRecoveryFromError_optionIndex_1, + error?._id ?? ffi.nullptr, + recoveryOptionIndex); + } + + void performSelector_withObject_afterDelay_inModes_( + ffi.Pointer aSelector, + NSObject anArgument, + double delay, + NSArray? modes) { + return _lib._objc_msgSend_377( + _id, + _lib._sel_performSelector_withObject_afterDelay_inModes_1, + aSelector, + anArgument._id, + delay, + modes?._id ?? ffi.nullptr); + } + + void performSelector_withObject_afterDelay_( + ffi.Pointer aSelector, NSObject anArgument, double delay) { + return _lib._objc_msgSend_378( + _id, + _lib._sel_performSelector_withObject_afterDelay_1, + aSelector, + anArgument._id, + delay); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSObject1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSObject1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + void URL_resourceDataDidBecomeAvailable_(NSURL? sender, NSData? newBytes) { + return _lib._objc_msgSend_379( + _id, + _lib._sel_URL_resourceDataDidBecomeAvailable_1, + sender?._id ?? ffi.nullptr, + newBytes?._id ?? ffi.nullptr); + } + + void URLResourceDidFinishLoading_(NSURL? sender) { + return _lib._objc_msgSend_380(_id, _lib._sel_URLResourceDidFinishLoading_1, + sender?._id ?? ffi.nullptr); + } + + void URLResourceDidCancelLoading_(NSURL? sender) { + return _lib._objc_msgSend_380(_id, _lib._sel_URLResourceDidCancelLoading_1, + sender?._id ?? ffi.nullptr); + } + + void URL_resourceDidFailLoadingWithReason_(NSURL? sender, NSString? reason) { + return _lib._objc_msgSend_381( + _id, + _lib._sel_URL_resourceDidFailLoadingWithReason_1, + sender?._id ?? ffi.nullptr, + reason?._id ?? ffi.nullptr); + } + + bool fileManager_shouldProceedAfterError_( + NSFileManager? fm, NSDictionary? errorInfo) { + return _lib._objc_msgSend_407( + _id, + _lib._sel_fileManager_shouldProceedAfterError_1, + fm?._id ?? ffi.nullptr, + errorInfo?._id ?? ffi.nullptr); + } + + void fileManager_willProcessPath_(NSFileManager? fm, NSString? path) { + return _lib._objc_msgSend_408(_id, _lib._sel_fileManager_willProcessPath_1, + fm?._id ?? ffi.nullptr, path?._id ?? ffi.nullptr); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSObject1, _lib._sel_accessInstanceVariablesDirectly1); + } + + NSObject valueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_valueForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void setValue_forKey_(NSObject value, NSString? key) { + return _lib._objc_msgSend_122( + _id, _lib._sel_setValue_forKey_1, value._id, key?._id ?? ffi.nullptr); + } + + bool validateValue_forKey_error_(ffi.Pointer> ioValue, + NSString? inKey, ffi.Pointer> outError) { + return _lib._objc_msgSend_220(_id, _lib._sel_validateValue_forKey_error_1, + ioValue, inKey?._id ?? ffi.nullptr, outError); + } + + NSMutableArray mutableArrayValueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_425( + _id, _lib._sel_mutableArrayValueForKey_1, key?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + NSMutableOrderedSet mutableOrderedSetValueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_441( + _id, _lib._sel_mutableOrderedSetValueForKey_1, key?._id ?? ffi.nullptr); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSMutableSet mutableSetValueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_442( + _id, _lib._sel_mutableSetValueForKey_1, key?._id ?? ffi.nullptr); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + NSObject valueForKeyPath_(NSString? keyPath) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_valueForKeyPath_1, keyPath?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void setValue_forKeyPath_(NSObject value, NSString? keyPath) { + return _lib._objc_msgSend_122(_id, _lib._sel_setValue_forKeyPath_1, + value._id, keyPath?._id ?? ffi.nullptr); + } + + bool validateValue_forKeyPath_error_( + ffi.Pointer> ioValue, + NSString? inKeyPath, + ffi.Pointer> outError) { + return _lib._objc_msgSend_220( + _id, + _lib._sel_validateValue_forKeyPath_error_1, + ioValue, + inKeyPath?._id ?? ffi.nullptr, + outError); + } + + NSMutableArray mutableArrayValueForKeyPath_(NSString? keyPath) { + final _ret = _lib._objc_msgSend_425(_id, + _lib._sel_mutableArrayValueForKeyPath_1, keyPath?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + NSMutableOrderedSet mutableOrderedSetValueForKeyPath_(NSString? keyPath) { + final _ret = _lib._objc_msgSend_441( + _id, + _lib._sel_mutableOrderedSetValueForKeyPath_1, + keyPath?._id ?? ffi.nullptr); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSMutableSet mutableSetValueForKeyPath_(NSString? keyPath) { + final _ret = _lib._objc_msgSend_442(_id, + _lib._sel_mutableSetValueForKeyPath_1, keyPath?._id ?? ffi.nullptr); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + NSObject valueForUndefinedKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_valueForUndefinedKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void setValue_forUndefinedKey_(NSObject value, NSString? key) { + return _lib._objc_msgSend_122(_id, _lib._sel_setValue_forUndefinedKey_1, + value._id, key?._id ?? ffi.nullptr); + } + + void setNilValueForKey_(NSString? key) { + return _lib._objc_msgSend_186( + _id, _lib._sel_setNilValueForKey_1, key?._id ?? ffi.nullptr); + } + + NSDictionary dictionaryWithValuesForKeys_(NSArray? keys) { + final _ret = _lib._objc_msgSend_443( + _id, _lib._sel_dictionaryWithValuesForKeys_1, keys?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + void setValuesForKeysWithDictionary_(NSDictionary? keyedValues) { + return _lib._objc_msgSend_444( + _id, + _lib._sel_setValuesForKeysWithDictionary_1, + keyedValues?._id ?? ffi.nullptr); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSObject1, _lib._sel_useStoredAccessor1); + } + + NSObject storedValueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_storedValueForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void takeStoredValue_forKey_(NSObject value, NSString? key) { + return _lib._objc_msgSend_122(_id, _lib._sel_takeStoredValue_forKey_1, + value._id, key?._id ?? ffi.nullptr); + } + + void takeValue_forKey_(NSObject value, NSString? key) { + return _lib._objc_msgSend_122( + _id, _lib._sel_takeValue_forKey_1, value._id, key?._id ?? ffi.nullptr); + } + + void takeValue_forKeyPath_(NSObject value, NSString? keyPath) { + return _lib._objc_msgSend_122(_id, _lib._sel_takeValue_forKeyPath_1, + value._id, keyPath?._id ?? ffi.nullptr); + } + + NSObject handleQueryWithUnboundKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_handleQueryWithUnboundKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void handleTakeValue_forUnboundKey_(NSObject value, NSString? key) { + return _lib._objc_msgSend_122( + _id, + _lib._sel_handleTakeValue_forUnboundKey_1, + value._id, + key?._id ?? ffi.nullptr); + } + + void unableToSetNilForKey_(NSString? key) { + return _lib._objc_msgSend_186( + _id, _lib._sel_unableToSetNilForKey_1, key?._id ?? ffi.nullptr); + } + + NSDictionary valuesForKeys_(NSArray? keys) { + final _ret = _lib._objc_msgSend_443( + _id, _lib._sel_valuesForKeys_1, keys?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + void takeValuesFromDictionary_(NSDictionary? properties) { + return _lib._objc_msgSend_444(_id, _lib._sel_takeValuesFromDictionary_1, + properties?._id ?? ffi.nullptr); + } + + void observeValueForKeyPath_ofObject_change_context_(NSString? keyPath, + NSObject object, NSDictionary? change, ffi.Pointer context) { + return _lib._objc_msgSend_445( + _id, + _lib._sel_observeValueForKeyPath_ofObject_change_context_1, + keyPath?._id ?? ffi.nullptr, + object._id, + change?._id ?? ffi.nullptr, + context); + } + + void addObserver_forKeyPath_options_context_(NSObject? observer, + NSString? keyPath, int options, ffi.Pointer context) { + return _lib._objc_msgSend_126( + _id, + _lib._sel_addObserver_forKeyPath_options_context_1, + observer?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + options, + context); + } + + void removeObserver_forKeyPath_context_( + NSObject? observer, NSString? keyPath, ffi.Pointer context) { + return _lib._objc_msgSend_127( + _id, + _lib._sel_removeObserver_forKeyPath_context_1, + observer?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + context); + } + + void removeObserver_forKeyPath_(NSObject? observer, NSString? keyPath) { + return _lib._objc_msgSend_128(_id, _lib._sel_removeObserver_forKeyPath_1, + observer?._id ?? ffi.nullptr, keyPath?._id ?? ffi.nullptr); + } + + void willChangeValueForKey_(NSString? key) { + return _lib._objc_msgSend_186( + _id, _lib._sel_willChangeValueForKey_1, key?._id ?? ffi.nullptr); + } + + void didChangeValueForKey_(NSString? key) { + return _lib._objc_msgSend_186( + _id, _lib._sel_didChangeValueForKey_1, key?._id ?? ffi.nullptr); + } + + void willChange_valuesAtIndexes_forKey_( + int changeKind, NSIndexSet? indexes, NSString? key) { + return _lib._objc_msgSend_446( + _id, + _lib._sel_willChange_valuesAtIndexes_forKey_1, + changeKind, + indexes?._id ?? ffi.nullptr, + key?._id ?? ffi.nullptr); + } + + void didChange_valuesAtIndexes_forKey_( + int changeKind, NSIndexSet? indexes, NSString? key) { + return _lib._objc_msgSend_446( + _id, + _lib._sel_didChange_valuesAtIndexes_forKey_1, + changeKind, + indexes?._id ?? ffi.nullptr, + key?._id ?? ffi.nullptr); + } + + void willChangeValueForKey_withSetMutation_usingObjects_( + NSString? key, int mutationKind, NSSet? objects) { + return _lib._objc_msgSend_447( + _id, + _lib._sel_willChangeValueForKey_withSetMutation_usingObjects_1, + key?._id ?? ffi.nullptr, + mutationKind, + objects?._id ?? ffi.nullptr); + } + + void didChangeValueForKey_withSetMutation_usingObjects_( + NSString? key, int mutationKind, NSSet? objects) { + return _lib._objc_msgSend_447( + _id, + _lib._sel_didChangeValueForKey_withSetMutation_usingObjects_1, + key?._id ?? ffi.nullptr, + mutationKind, + objects?._id ?? ffi.nullptr); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSObject1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSObject1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + ffi.Pointer get observationInfo { + return _lib._objc_msgSend_19(_id, _lib._sel_observationInfo1); + } + + set observationInfo(ffi.Pointer value) { + _lib._objc_msgSend_448(_id, _lib._sel_setObservationInfo_1, value); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSObject1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + NSObject get classForKeyedArchiver { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_classForKeyedArchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject replacementObjectForKeyedArchiver_(NSKeyedArchiver? archiver) { + final _ret = _lib._objc_msgSend_461( + _id, + _lib._sel_replacementObjectForKeyedArchiver_1, + archiver?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSObject1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void performSelectorOnMainThread_withObject_waitUntilDone_modes_( + ffi.Pointer aSelector, NSObject arg, bool wait, NSArray? array) { + return _lib._objc_msgSend_462( + _id, + _lib._sel_performSelectorOnMainThread_withObject_waitUntilDone_modes_1, + aSelector, + arg._id, + wait, + array?._id ?? ffi.nullptr); + } + + void performSelectorOnMainThread_withObject_waitUntilDone_( + ffi.Pointer aSelector, NSObject arg, bool wait) { + return _lib._objc_msgSend_463( + _id, + _lib._sel_performSelectorOnMainThread_withObject_waitUntilDone_1, + aSelector, + arg._id, + wait); + } + + void performSelector_onThread_withObject_waitUntilDone_modes_( + ffi.Pointer aSelector, + NSThread? thr, + NSObject arg, + bool wait, + NSArray? array) { + return _lib._objc_msgSend_480( + _id, + _lib._sel_performSelector_onThread_withObject_waitUntilDone_modes_1, + aSelector, + thr?._id ?? ffi.nullptr, + arg._id, + wait, + array?._id ?? ffi.nullptr); + } + + void performSelector_onThread_withObject_waitUntilDone_( + ffi.Pointer aSelector, NSThread? thr, NSObject arg, bool wait) { + return _lib._objc_msgSend_481( + _id, + _lib._sel_performSelector_onThread_withObject_waitUntilDone_1, + aSelector, + thr?._id ?? ffi.nullptr, + arg._id, + wait); + } + + void performSelectorInBackground_withObject_( + ffi.Pointer aSelector, NSObject arg) { + return _lib._objc_msgSend_82(_id, + _lib._sel_performSelectorInBackground_withObject_1, aSelector, arg._id); + } + + NSObject get classForArchiver { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_classForArchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject replacementObjectForArchiver_(NSArchiver? archiver) { + final _ret = _lib._objc_msgSend_484(_id, + _lib._sel_replacementObjectForArchiver_1, archiver?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject get classForPortCoder { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_classForPortCoder1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject replacementObjectForPortCoder_(NSPortCoder? coder) { + final _ret = _lib._objc_msgSend_522(_id, + _lib._sel_replacementObjectForPortCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSClassDescription? get classDescription { + final _ret = _lib._objc_msgSend_525(_id, _lib._sel_classDescription1); + return _ret.address == 0 + ? null + : NSClassDescription._(_ret, _lib, retain: true, release: true); + } + + NSArray? get attributeKeys { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_attributeKeys1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get toOneRelationshipKeys { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_toOneRelationshipKeys1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get toManyRelationshipKeys { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_toManyRelationshipKeys1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString inverseForRelationshipKey_(NSString? relationshipKey) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_inverseForRelationshipKey_1, + relationshipKey?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSObject scriptingValueForSpecifier_( + NSScriptObjectSpecifier? objectSpecifier) { + final _ret = _lib._objc_msgSend_569( + _id, + _lib._sel_scriptingValueForSpecifier_1, + objectSpecifier?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get scriptingProperties { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_scriptingProperties1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set scriptingProperties(NSDictionary? value) { + _lib._objc_msgSend_165( + _id, _lib._sel_setScriptingProperties_1, value?._id ?? ffi.nullptr); + } + + NSObject copyScriptingValue_forKey_withProperties_( + NSObject value, NSString? key, NSDictionary? properties) { + final _ret = _lib._objc_msgSend_570( + _id, + _lib._sel_copyScriptingValue_forKey_withProperties_1, + value._id, + key?._id ?? ffi.nullptr, + properties?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + NSObject + newScriptingObjectOfClass_forValueForKey_withContentsValue_properties_( + NSObject objectClass, + NSString? key, + NSObject contentsValue, + NSDictionary? properties) { + final _ret = _lib._objc_msgSend_571( + _id, + _lib._sel_newScriptingObjectOfClass_forValueForKey_withContentsValue_properties_1, + objectClass._id, + key?._id ?? ffi.nullptr, + contentsValue._id, + properties?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + int get classCode { + return _lib._objc_msgSend_191(_id, _lib._sel_classCode1); + } + + NSString? get className { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_className1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSObject valueAtIndex_inPropertyWithKey_(int index, NSString? key) { + final _ret = _lib._objc_msgSend_572( + _id, + _lib._sel_valueAtIndex_inPropertyWithKey_1, + index, + key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject valueWithName_inPropertyWithKey_(NSString? name, NSString? key) { + final _ret = _lib._objc_msgSend_159( + _id, + _lib._sel_valueWithName_inPropertyWithKey_1, + name?._id ?? ffi.nullptr, + key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject valueWithUniqueID_inPropertyWithKey_( + NSObject uniqueID, NSString? key) { + final _ret = _lib._objc_msgSend_272( + _id, + _lib._sel_valueWithUniqueID_inPropertyWithKey_1, + uniqueID._id, + key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void insertValue_atIndex_inPropertyWithKey_( + NSObject value, int index, NSString? key) { + return _lib._objc_msgSend_573( + _id, + _lib._sel_insertValue_atIndex_inPropertyWithKey_1, + value._id, + index, + key?._id ?? ffi.nullptr); + } + + void removeValueAtIndex_fromPropertyWithKey_(int index, NSString? key) { + return _lib._objc_msgSend_574( + _id, + _lib._sel_removeValueAtIndex_fromPropertyWithKey_1, + index, + key?._id ?? ffi.nullptr); + } + + void replaceValueAtIndex_inPropertyWithKey_withValue_( + int index, NSString? key, NSObject value) { + return _lib._objc_msgSend_575( + _id, + _lib._sel_replaceValueAtIndex_inPropertyWithKey_withValue_1, + index, + key?._id ?? ffi.nullptr, + value._id); + } + + void insertValue_inPropertyWithKey_(NSObject value, NSString? key) { + return _lib._objc_msgSend_122( + _id, + _lib._sel_insertValue_inPropertyWithKey_1, + value._id, + key?._id ?? ffi.nullptr); + } + + NSObject coerceValue_forKey_(NSObject value, NSString? key) { + final _ret = _lib._objc_msgSend_272(_id, _lib._sel_coerceValue_forKey_1, + value._id, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSScriptObjectSpecifier? get objectSpecifier { + final _ret = _lib._objc_msgSend_556(_id, _lib._sel_objectSpecifier1); + return _ret.address == 0 + ? null + : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + NSArray indicesOfObjectsByEvaluatingObjectSpecifier_( + NSScriptObjectSpecifier? specifier) { + final _ret = _lib._objc_msgSend_576( + _id, + _lib._sel_indicesOfObjectsByEvaluatingObjectSpecifier_1, + specifier?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + bool isEqualTo_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_isEqualTo_1, object._id); + } + + bool isLessThanOrEqualTo_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_isLessThanOrEqualTo_1, object._id); + } + + bool isLessThan_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_isLessThan_1, object._id); + } + + bool isGreaterThanOrEqualTo_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_isGreaterThanOrEqualTo_1, object._id); + } + + bool isGreaterThan_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_isGreaterThan_1, object._id); + } + + bool isNotEqualTo_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_isNotEqualTo_1, object._id); + } + + bool doesContain_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_doesContain_1, object._id); + } + + bool isLike_(NSString? object) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isLike_1, object?._id ?? ffi.nullptr); + } + + bool isCaseInsensitiveLike_(NSString? object) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isCaseInsensitiveLike_1, object?._id ?? ffi.nullptr); + } + + bool scriptingIsEqualTo_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_scriptingIsEqualTo_1, object._id); + } + + bool scriptingIsLessThanOrEqualTo_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_scriptingIsLessThanOrEqualTo_1, object._id); + } + + bool scriptingIsLessThan_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_scriptingIsLessThan_1, object._id); + } + + bool scriptingIsGreaterThanOrEqualTo_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_scriptingIsGreaterThanOrEqualTo_1, object._id); + } + + bool scriptingIsGreaterThan_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_scriptingIsGreaterThan_1, object._id); + } + + bool scriptingBeginsWith_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_scriptingBeginsWith_1, object._id); + } + + bool scriptingEndsWith_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_scriptingEndsWith_1, object._id); + } + + bool scriptingContains_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_scriptingContains_1, object._id); + } +} + +class ObjCSel extends ffi.Opaque {} + +class ObjCObject extends ffi.Opaque {} + +typedef instancetype = ffi.Pointer; + +class _NSZone extends ffi.Opaque {} + +class Protocol extends _ObjCWrapper { + Protocol._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [Protocol] that points to the same underlying object as [other]. + static Protocol castFrom(T other) { + return Protocol._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [Protocol] that wraps the given raw object pointer. + static Protocol castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return Protocol._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [Protocol]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_Protocol1); + } +} + +typedef IMP = ffi.Pointer>; + +class NSInvocation extends NSObject { + NSInvocation._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSInvocation] that points to the same underlying object as [other]. + static NSInvocation castFrom(T other) { + return NSInvocation._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSInvocation] that wraps the given raw object pointer. + static NSInvocation castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSInvocation._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSInvocation]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSInvocation1); + } + + static NSInvocation invocationWithMethodSignature_( + AVFAudio _lib, NSMethodSignature? sig) { + final _ret = _lib._objc_msgSend_366(_lib._class_NSInvocation1, + _lib._sel_invocationWithMethodSignature_1, sig?._id ?? ffi.nullptr); + return NSInvocation._(_ret, _lib, retain: true, release: true); + } + + NSMethodSignature? get methodSignature { + final _ret = _lib._objc_msgSend_367(_id, _lib._sel_methodSignature1); + return _ret.address == 0 + ? null + : NSMethodSignature._(_ret, _lib, retain: true, release: true); + } + + void retainArguments() { + return _lib._objc_msgSend_1(_id, _lib._sel_retainArguments1); + } + + bool get argumentsRetained { + return _lib._objc_msgSend_12(_id, _lib._sel_argumentsRetained1); + } + + NSObject get target { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_target1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set target(NSObject value) { + _lib._objc_msgSend_368(_id, _lib._sel_setTarget_1, value._id); + } + + ffi.Pointer get selector { + return _lib._objc_msgSend_369(_id, _lib._sel_selector1); + } + + set selector(ffi.Pointer value) { + _lib._objc_msgSend_370(_id, _lib._sel_setSelector_1, value); + } + + void getReturnValue_(ffi.Pointer retLoc) { + return _lib._objc_msgSend_47(_id, _lib._sel_getReturnValue_1, retLoc); + } + + void setReturnValue_(ffi.Pointer retLoc) { + return _lib._objc_msgSend_47(_id, _lib._sel_setReturnValue_1, retLoc); + } + + void getArgument_atIndex_(ffi.Pointer argumentLocation, int idx) { + return _lib._objc_msgSend_371( + _id, _lib._sel_getArgument_atIndex_1, argumentLocation, idx); + } + + void setArgument_atIndex_(ffi.Pointer argumentLocation, int idx) { + return _lib._objc_msgSend_371( + _id, _lib._sel_setArgument_atIndex_1, argumentLocation, idx); + } + + void invoke() { + return _lib._objc_msgSend_1(_id, _lib._sel_invoke1); + } + + void invokeWithTarget_(NSObject target) { + return _lib._objc_msgSend_15(_id, _lib._sel_invokeWithTarget_1, target._id); + } + + static NSInvocation new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSInvocation1, _lib._sel_new1); + return NSInvocation._(_ret, _lib, retain: false, release: true); + } + + static NSInvocation alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSInvocation1, _lib._sel_alloc1); + return NSInvocation._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSInvocation1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSInvocation1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSInvocation1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSInvocation1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSInvocation1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSInvocation1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSInvocation1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSInvocation1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSInvocation1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSMethodSignature extends NSObject { + NSMethodSignature._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMethodSignature] that points to the same underlying object as [other]. + static NSMethodSignature castFrom(T other) { + return NSMethodSignature._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSMethodSignature] that wraps the given raw object pointer. + static NSMethodSignature castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMethodSignature._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMethodSignature]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMethodSignature1); + } + + static NSMethodSignature signatureWithObjCTypes_( + AVFAudio _lib, ffi.Pointer types) { + final _ret = _lib._objc_msgSend_9(_lib._class_NSMethodSignature1, + _lib._sel_signatureWithObjCTypes_1, types); + return NSMethodSignature._(_ret, _lib, retain: true, release: true); + } + + int get numberOfArguments { + return _lib._objc_msgSend_10(_id, _lib._sel_numberOfArguments1); + } + + ffi.Pointer getArgumentTypeAtIndex_(int idx) { + return _lib._objc_msgSend_11(_id, _lib._sel_getArgumentTypeAtIndex_1, idx); + } + + int get frameLength { + return _lib._objc_msgSend_10(_id, _lib._sel_frameLength1); + } + + bool isOneway() { + return _lib._objc_msgSend_12(_id, _lib._sel_isOneway1); + } + + ffi.Pointer get methodReturnType { + return _lib._objc_msgSend_13(_id, _lib._sel_methodReturnType1); + } + + int get methodReturnLength { + return _lib._objc_msgSend_10(_id, _lib._sel_methodReturnLength1); + } + + static NSMethodSignature new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMethodSignature1, _lib._sel_new1); + return NSMethodSignature._(_ret, _lib, retain: false, release: true); + } + + static NSMethodSignature alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMethodSignature1, _lib._sel_alloc1); + return NSMethodSignature._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMethodSignature1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMethodSignature1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMethodSignature1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMethodSignature1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMethodSignature1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMethodSignature1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMethodSignature1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSMethodSignature1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMethodSignature1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSUInteger = ffi.UnsignedLong; + +class NSSet extends NSObject { + NSSet._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSSet] that points to the same underlying object as [other]. + static NSSet castFrom(T other) { + return NSSet._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSSet] that wraps the given raw object pointer. + static NSSet castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSSet._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSSet]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSSet1); + } + + int get count { + return _lib._objc_msgSend_10(_id, _lib._sel_count1); + } + + NSObject member_(NSObject object) { + final _ret = _lib._objc_msgSend_16(_id, _lib._sel_member_1, object._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSEnumerator objectEnumerator() { + final _ret = _lib._objc_msgSend_72(_id, _lib._sel_objectEnumerator1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + @override + NSSet init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet initWithObjects_count_( + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61( + _id, _lib._sel_initWithObjects_count_1, objects, cnt); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSArray? get allObjects { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_allObjects1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSObject anyObject() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_anyObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool containsObject_(NSObject anObject) { + return _lib._objc_msgSend_0(_id, _lib._sel_containsObject_1, anObject._id); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_(NSObject locale) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool intersectsSet_(NSSet? otherSet) { + return _lib._objc_msgSend_355( + _id, _lib._sel_intersectsSet_1, otherSet?._id ?? ffi.nullptr); + } + + bool isEqualToSet_(NSSet? otherSet) { + return _lib._objc_msgSend_355( + _id, _lib._sel_isEqualToSet_1, otherSet?._id ?? ffi.nullptr); + } + + bool isSubsetOfSet_(NSSet? otherSet) { + return _lib._objc_msgSend_355( + _id, _lib._sel_isSubsetOfSet_1, otherSet?._id ?? ffi.nullptr); + } + + void makeObjectsPerformSelector_(ffi.Pointer aSelector) { + return _lib._objc_msgSend_7( + _id, _lib._sel_makeObjectsPerformSelector_1, aSelector); + } + + void makeObjectsPerformSelector_withObject_( + ffi.Pointer aSelector, NSObject argument) { + return _lib._objc_msgSend_82( + _id, + _lib._sel_makeObjectsPerformSelector_withObject_1, + aSelector, + argument._id); + } + + NSSet setByAddingObject_(NSObject anObject) { + final _ret = _lib._objc_msgSend_356( + _id, _lib._sel_setByAddingObject_1, anObject._id); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet setByAddingObjectsFromSet_(NSSet? other) { + final _ret = _lib._objc_msgSend_357( + _id, _lib._sel_setByAddingObjectsFromSet_1, other?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet setByAddingObjectsFromArray_(NSArray? other) { + final _ret = _lib._objc_msgSend_358(_id, + _lib._sel_setByAddingObjectsFromArray_1, other?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + void enumerateObjectsUsingBlock_(ObjCBlock13 block) { + return _lib._objc_msgSend_359( + _id, _lib._sel_enumerateObjectsUsingBlock_1, block._impl); + } + + void enumerateObjectsWithOptions_usingBlock_(int opts, ObjCBlock13 block) { + return _lib._objc_msgSend_360(_id, + _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._impl); + } + + NSSet objectsPassingTest_(ObjCBlock14 predicate) { + final _ret = _lib._objc_msgSend_361( + _id, _lib._sel_objectsPassingTest_1, predicate._impl); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet objectsWithOptions_passingTest_(int opts, ObjCBlock14 predicate) { + final _ret = _lib._objc_msgSend_362( + _id, _lib._sel_objectsWithOptions_passingTest_1, opts, predicate._impl); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static NSSet set1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSSet1, _lib._sel_set1); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static NSSet setWithObject_(AVFAudio _lib, NSObject object) { + final _ret = _lib._objc_msgSend_16( + _lib._class_NSSet1, _lib._sel_setWithObject_1, object._id); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static NSSet setWithObjects_count_( + AVFAudio _lib, ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61( + _lib._class_NSSet1, _lib._sel_setWithObjects_count_1, objects, cnt); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static NSSet setWithObjects_(AVFAudio _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_16( + _lib._class_NSSet1, _lib._sel_setWithObjects_1, firstObj._id); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static NSSet setWithSet_(AVFAudio _lib, NSSet? set) { + final _ret = _lib._objc_msgSend_363( + _lib._class_NSSet1, _lib._sel_setWithSet_1, set?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static NSSet setWithArray_(AVFAudio _lib, NSArray? array) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSSet1, + _lib._sel_setWithArray_1, array?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet initWithObjects_(NSObject firstObj) { + final _ret = + _lib._objc_msgSend_16(_id, _lib._sel_initWithObjects_1, firstObj._id); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet initWithSet_(NSSet? set) { + final _ret = _lib._objc_msgSend_363( + _id, _lib._sel_initWithSet_1, set?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet initWithSet_copyItems_(NSSet? set, bool flag) { + final _ret = _lib._objc_msgSend_364( + _id, _lib._sel_initWithSet_copyItems_1, set?._id ?? ffi.nullptr, flag); + return NSSet._(_ret, _lib, retain: false, release: true); + } + + NSSet initWithArray_(NSArray? array) { + final _ret = _lib._objc_msgSend_67( + _id, _lib._sel_initWithArray_1, array?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + @override + NSObject valueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_valueForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + @override + void setValue_forKey_(NSObject value, NSString? key) { + return _lib._objc_msgSend_122( + _id, _lib._sel_setValue_forKey_1, value._id, key?._id ?? ffi.nullptr); + } + + @override + void addObserver_forKeyPath_options_context_(NSObject? observer, + NSString? keyPath, int options, ffi.Pointer context) { + return _lib._objc_msgSend_126( + _id, + _lib._sel_addObserver_forKeyPath_options_context_1, + observer?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + options, + context); + } + + @override + void removeObserver_forKeyPath_context_( + NSObject? observer, NSString? keyPath, ffi.Pointer context) { + return _lib._objc_msgSend_127( + _id, + _lib._sel_removeObserver_forKeyPath_context_1, + observer?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + context); + } + + @override + void removeObserver_forKeyPath_(NSObject? observer, NSString? keyPath) { + return _lib._objc_msgSend_128(_id, _lib._sel_removeObserver_forKeyPath_1, + observer?._id ?? ffi.nullptr, keyPath?._id ?? ffi.nullptr); + } + + NSArray sortedArrayUsingDescriptors_(NSArray? sortDescriptors) { + final _ret = _lib._objc_msgSend_63( + _id, + _lib._sel_sortedArrayUsingDescriptors_1, + sortDescriptors?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSSet filteredSetUsingPredicate_(NSPredicate? predicate) { + final _ret = _lib._objc_msgSend_365(_id, + _lib._sel_filteredSetUsingPredicate_1, predicate?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static NSSet new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSSet1, _lib._sel_new1); + return NSSet._(_ret, _lib, retain: false, release: true); + } + + static NSSet alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSSet1, _lib._sel_alloc1); + return NSSet._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSSet1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSSet1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSSet1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSSet1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSSet1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSSet1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSSet1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSEnumerator extends NSObject { + NSEnumerator._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSEnumerator] that points to the same underlying object as [other]. + static NSEnumerator castFrom(T other) { + return NSEnumerator._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSEnumerator] that wraps the given raw object pointer. + static NSEnumerator castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSEnumerator._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSEnumerator]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSEnumerator1); + } + + NSObject nextObject() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_nextObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSEnumerator new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSEnumerator1, _lib._sel_new1); + return NSEnumerator._(_ret, _lib, retain: false, release: true); + } + + static NSEnumerator alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSEnumerator1, _lib._sel_alloc1); + return NSEnumerator._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSEnumerator1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSEnumerator1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSEnumerator1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSEnumerator1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSEnumerator1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSEnumerator1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSEnumerator1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSEnumerator1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSEnumerator1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSString extends NSObject { + NSString._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSString] that points to the same underlying object as [other]. + static NSString castFrom(T other) { + return NSString._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSString] that wraps the given raw object pointer. + static NSString castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSString._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSString]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSString1); + } + + factory NSString(AVFAudio _lib, String str) { + final cstr = str.toNativeUtf8(); + final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); + pkg_ffi.calloc.free(cstr); + return nsstr; + } + + @override + String toString() => (UTF8String).cast().toDartString(); + + int get length { + return _lib._objc_msgSend_10(_id, _lib._sel_length1); + } + + int characterAtIndex_(int index) { + return _lib._objc_msgSend_17(_id, _lib._sel_characterAtIndex_1, index); + } + + @override + NSString init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString substringFromIndex_(int from) { + final _ret = + _lib._objc_msgSend_293(_id, _lib._sel_substringFromIndex_1, from); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString substringToIndex_(int to) { + final _ret = _lib._objc_msgSend_293(_id, _lib._sel_substringToIndex_1, to); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString substringWithRange_(NSRange range) { + final _ret = + _lib._objc_msgSend_294(_id, _lib._sel_substringWithRange_1, range); + return NSString._(_ret, _lib, retain: true, release: true); + } + + void getCharacters_range_(ffi.Pointer buffer, NSRange range) { + return _lib._objc_msgSend_295( + _id, _lib._sel_getCharacters_range_1, buffer, range); + } + + int compare_(NSString? string) { + return _lib._objc_msgSend_296( + _id, _lib._sel_compare_1, string?._id ?? ffi.nullptr); + } + + int compare_options_(NSString? string, int mask) { + return _lib._objc_msgSend_297( + _id, _lib._sel_compare_options_1, string?._id ?? ffi.nullptr, mask); + } + + int compare_options_range_( + NSString? string, int mask, NSRange rangeOfReceiverToCompare) { + return _lib._objc_msgSend_298(_id, _lib._sel_compare_options_range_1, + string?._id ?? ffi.nullptr, mask, rangeOfReceiverToCompare); + } + + int compare_options_range_locale_(NSString? string, int mask, + NSRange rangeOfReceiverToCompare, NSObject locale) { + return _lib._objc_msgSend_299(_id, _lib._sel_compare_options_range_locale_1, + string?._id ?? ffi.nullptr, mask, rangeOfReceiverToCompare, locale._id); + } + + int caseInsensitiveCompare_(NSString? string) { + return _lib._objc_msgSend_296( + _id, _lib._sel_caseInsensitiveCompare_1, string?._id ?? ffi.nullptr); + } + + int localizedCompare_(NSString? string) { + return _lib._objc_msgSend_296( + _id, _lib._sel_localizedCompare_1, string?._id ?? ffi.nullptr); + } + + int localizedCaseInsensitiveCompare_(NSString? string) { + return _lib._objc_msgSend_296( + _id, + _lib._sel_localizedCaseInsensitiveCompare_1, + string?._id ?? ffi.nullptr); + } + + int localizedStandardCompare_(NSString? string) { + return _lib._objc_msgSend_296( + _id, _lib._sel_localizedStandardCompare_1, string?._id ?? ffi.nullptr); + } + + bool isEqualToString_(NSString? aString) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isEqualToString_1, aString?._id ?? ffi.nullptr); + } + + bool hasPrefix_(NSString? str) { + return _lib._objc_msgSend_59( + _id, _lib._sel_hasPrefix_1, str?._id ?? ffi.nullptr); + } + + bool hasSuffix_(NSString? str) { + return _lib._objc_msgSend_59( + _id, _lib._sel_hasSuffix_1, str?._id ?? ffi.nullptr); + } + + NSString commonPrefixWithString_options_(NSString? str, int mask) { + final _ret = _lib._objc_msgSend_300( + _id, + _lib._sel_commonPrefixWithString_options_1, + str?._id ?? ffi.nullptr, + mask); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool containsString_(NSString? str) { + return _lib._objc_msgSend_59( + _id, _lib._sel_containsString_1, str?._id ?? ffi.nullptr); + } + + bool localizedCaseInsensitiveContainsString_(NSString? str) { + return _lib._objc_msgSend_59( + _id, + _lib._sel_localizedCaseInsensitiveContainsString_1, + str?._id ?? ffi.nullptr); + } + + bool localizedStandardContainsString_(NSString? str) { + return _lib._objc_msgSend_59(_id, + _lib._sel_localizedStandardContainsString_1, str?._id ?? ffi.nullptr); + } + + NSRange localizedStandardRangeOfString_(NSString? str) { + return _lib._objc_msgSend_301(_id, + _lib._sel_localizedStandardRangeOfString_1, str?._id ?? ffi.nullptr); + } + + NSRange rangeOfString_(NSString? searchString) { + return _lib._objc_msgSend_301( + _id, _lib._sel_rangeOfString_1, searchString?._id ?? ffi.nullptr); + } + + NSRange rangeOfString_options_(NSString? searchString, int mask) { + return _lib._objc_msgSend_302(_id, _lib._sel_rangeOfString_options_1, + searchString?._id ?? ffi.nullptr, mask); + } + + NSRange rangeOfString_options_range_( + NSString? searchString, int mask, NSRange rangeOfReceiverToSearch) { + return _lib._objc_msgSend_303(_id, _lib._sel_rangeOfString_options_range_1, + searchString?._id ?? ffi.nullptr, mask, rangeOfReceiverToSearch); + } + + NSRange rangeOfString_options_range_locale_(NSString? searchString, int mask, + NSRange rangeOfReceiverToSearch, NSLocale? locale) { + return _lib._objc_msgSend_304( + _id, + _lib._sel_rangeOfString_options_range_locale_1, + searchString?._id ?? ffi.nullptr, + mask, + rangeOfReceiverToSearch, + locale?._id ?? ffi.nullptr); + } + + NSRange rangeOfCharacterFromSet_(NSCharacterSet? searchSet) { + return _lib._objc_msgSend_305(_id, _lib._sel_rangeOfCharacterFromSet_1, + searchSet?._id ?? ffi.nullptr); + } + + NSRange rangeOfCharacterFromSet_options_( + NSCharacterSet? searchSet, int mask) { + return _lib._objc_msgSend_306( + _id, + _lib._sel_rangeOfCharacterFromSet_options_1, + searchSet?._id ?? ffi.nullptr, + mask); + } + + NSRange rangeOfCharacterFromSet_options_range_( + NSCharacterSet? searchSet, int mask, NSRange rangeOfReceiverToSearch) { + return _lib._objc_msgSend_307( + _id, + _lib._sel_rangeOfCharacterFromSet_options_range_1, + searchSet?._id ?? ffi.nullptr, + mask, + rangeOfReceiverToSearch); + } + + NSRange rangeOfComposedCharacterSequenceAtIndex_(int index) { + return _lib._objc_msgSend_308( + _id, _lib._sel_rangeOfComposedCharacterSequenceAtIndex_1, index); + } + + NSRange rangeOfComposedCharacterSequencesForRange_(NSRange range) { + return _lib._objc_msgSend_309( + _id, _lib._sel_rangeOfComposedCharacterSequencesForRange_1, range); + } + + NSString stringByAppendingString_(NSString? aString) { + final _ret = _lib._objc_msgSend_64( + _id, _lib._sel_stringByAppendingString_1, aString?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByAppendingFormat_(NSString? format) { + final _ret = _lib._objc_msgSend_64( + _id, _lib._sel_stringByAppendingFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + double get doubleValue { + return _lib._objc_msgSend_149(_id, _lib._sel_doubleValue1); + } + + double get floatValue { + return _lib._objc_msgSend_215(_id, _lib._sel_floatValue1); + } + + int get intValue { + return _lib._objc_msgSend_213(_id, _lib._sel_intValue1); + } + + int get integerValue { + return _lib._objc_msgSend_78(_id, _lib._sel_integerValue1); + } + + int get longLongValue { + return _lib._objc_msgSend_214(_id, _lib._sel_longLongValue1); + } + + bool get boolValue { + return _lib._objc_msgSend_12(_id, _lib._sel_boolValue1); + } + + NSString? get uppercaseString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_uppercaseString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get lowercaseString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_lowercaseString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get capitalizedString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_capitalizedString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get localizedUppercaseString { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_localizedUppercaseString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get localizedLowercaseString { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_localizedLowercaseString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get localizedCapitalizedString { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_localizedCapitalizedString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString uppercaseStringWithLocale_(NSLocale? locale) { + final _ret = _lib._objc_msgSend_310( + _id, _lib._sel_uppercaseStringWithLocale_1, locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString lowercaseStringWithLocale_(NSLocale? locale) { + final _ret = _lib._objc_msgSend_310( + _id, _lib._sel_lowercaseStringWithLocale_1, locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString capitalizedStringWithLocale_(NSLocale? locale) { + final _ret = _lib._objc_msgSend_310(_id, + _lib._sel_capitalizedStringWithLocale_1, locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + void getLineStart_end_contentsEnd_forRange_( + ffi.Pointer startPtr, + ffi.Pointer lineEndPtr, + ffi.Pointer contentsEndPtr, + NSRange range) { + return _lib._objc_msgSend_311( + _id, + _lib._sel_getLineStart_end_contentsEnd_forRange_1, + startPtr, + lineEndPtr, + contentsEndPtr, + range); + } + + NSRange lineRangeForRange_(NSRange range) { + return _lib._objc_msgSend_309(_id, _lib._sel_lineRangeForRange_1, range); + } + + void getParagraphStart_end_contentsEnd_forRange_( + ffi.Pointer startPtr, + ffi.Pointer parEndPtr, + ffi.Pointer contentsEndPtr, + NSRange range) { + return _lib._objc_msgSend_311( + _id, + _lib._sel_getParagraphStart_end_contentsEnd_forRange_1, + startPtr, + parEndPtr, + contentsEndPtr, + range); + } + + NSRange paragraphRangeForRange_(NSRange range) { + return _lib._objc_msgSend_309( + _id, _lib._sel_paragraphRangeForRange_1, range); + } + + void enumerateSubstringsInRange_options_usingBlock_( + NSRange range, int opts, ObjCBlock10 block) { + return _lib._objc_msgSend_312( + _id, + _lib._sel_enumerateSubstringsInRange_options_usingBlock_1, + range, + opts, + block._impl); + } + + void enumerateLinesUsingBlock_(ObjCBlock11 block) { + return _lib._objc_msgSend_313( + _id, _lib._sel_enumerateLinesUsingBlock_1, block._impl); + } + + ffi.Pointer get UTF8String { + return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); + } + + int get fastestEncoding { + return _lib._objc_msgSend_10(_id, _lib._sel_fastestEncoding1); + } + + int get smallestEncoding { + return _lib._objc_msgSend_10(_id, _lib._sel_smallestEncoding1); + } + + NSData dataUsingEncoding_allowLossyConversion_(int encoding, bool lossy) { + final _ret = _lib._objc_msgSend_314(_id, + _lib._sel_dataUsingEncoding_allowLossyConversion_1, encoding, lossy); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData dataUsingEncoding_(int encoding) { + final _ret = + _lib._objc_msgSend_315(_id, _lib._sel_dataUsingEncoding_1, encoding); + return NSData._(_ret, _lib, retain: true, release: true); + } + + bool canBeConvertedToEncoding_(int encoding) { + return _lib._objc_msgSend_89( + _id, _lib._sel_canBeConvertedToEncoding_1, encoding); + } + + ffi.Pointer cStringUsingEncoding_(int encoding) { + return _lib._objc_msgSend_11( + _id, _lib._sel_cStringUsingEncoding_1, encoding); + } + + bool getCString_maxLength_encoding_( + ffi.Pointer buffer, int maxBufferCount, int encoding) { + return _lib._objc_msgSend_316( + _id, + _lib._sel_getCString_maxLength_encoding_1, + buffer, + maxBufferCount, + encoding); + } + + bool getBytes_maxLength_usedLength_encoding_options_range_remainingRange_( + ffi.Pointer buffer, + int maxBufferCount, + ffi.Pointer usedBufferCount, + int encoding, + int options, + NSRange range, + NSRangePointer leftover) { + return _lib._objc_msgSend_317( + _id, + _lib._sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_1, + buffer, + maxBufferCount, + usedBufferCount, + encoding, + options, + range, + leftover); + } + + int maximumLengthOfBytesUsingEncoding_(int enc) { + return _lib._objc_msgSend_86( + _id, _lib._sel_maximumLengthOfBytesUsingEncoding_1, enc); + } + + int lengthOfBytesUsingEncoding_(int enc) { + return _lib._objc_msgSend_86( + _id, _lib._sel_lengthOfBytesUsingEncoding_1, enc); + } + + static ffi.Pointer getAvailableStringEncodings( + AVFAudio _lib) { + return _lib._objc_msgSend_318( + _lib._class_NSString1, _lib._sel_availableStringEncodings1); + } + + static NSString localizedNameOfStringEncoding_(AVFAudio _lib, int encoding) { + final _ret = _lib._objc_msgSend_293(_lib._class_NSString1, + _lib._sel_localizedNameOfStringEncoding_1, encoding); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static int getDefaultCStringEncoding(AVFAudio _lib) { + return _lib._objc_msgSend_10( + _lib._class_NSString1, _lib._sel_defaultCStringEncoding1); + } + + NSString? get decomposedStringWithCanonicalMapping { + final _ret = _lib._objc_msgSend_20( + _id, _lib._sel_decomposedStringWithCanonicalMapping1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get precomposedStringWithCanonicalMapping { + final _ret = _lib._objc_msgSend_20( + _id, _lib._sel_precomposedStringWithCanonicalMapping1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get decomposedStringWithCompatibilityMapping { + final _ret = _lib._objc_msgSend_20( + _id, _lib._sel_decomposedStringWithCompatibilityMapping1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get precomposedStringWithCompatibilityMapping { + final _ret = _lib._objc_msgSend_20( + _id, _lib._sel_precomposedStringWithCompatibilityMapping1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray componentsSeparatedByString_(NSString? separator) { + final _ret = _lib._objc_msgSend_119(_id, + _lib._sel_componentsSeparatedByString_1, separator?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray componentsSeparatedByCharactersInSet_(NSCharacterSet? separator) { + final _ret = _lib._objc_msgSend_319( + _id, + _lib._sel_componentsSeparatedByCharactersInSet_1, + separator?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString stringByTrimmingCharactersInSet_(NSCharacterSet? set) { + final _ret = _lib._objc_msgSend_320(_id, + _lib._sel_stringByTrimmingCharactersInSet_1, set?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByPaddingToLength_withString_startingAtIndex_( + int newLength, NSString? padString, int padIndex) { + final _ret = _lib._objc_msgSend_321( + _id, + _lib._sel_stringByPaddingToLength_withString_startingAtIndex_1, + newLength, + padString?._id ?? ffi.nullptr, + padIndex); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByFoldingWithOptions_locale_(int options, NSLocale? locale) { + final _ret = _lib._objc_msgSend_322( + _id, + _lib._sel_stringByFoldingWithOptions_locale_1, + options, + locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByReplacingOccurrencesOfString_withString_options_range_( + NSString? target, + NSString? replacement, + int options, + NSRange searchRange) { + final _ret = _lib._objc_msgSend_323( + _id, + _lib._sel_stringByReplacingOccurrencesOfString_withString_options_range_1, + target?._id ?? ffi.nullptr, + replacement?._id ?? ffi.nullptr, + options, + searchRange); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByReplacingOccurrencesOfString_withString_( + NSString? target, NSString? replacement) { + final _ret = _lib._objc_msgSend_324( + _id, + _lib._sel_stringByReplacingOccurrencesOfString_withString_1, + target?._id ?? ffi.nullptr, + replacement?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByReplacingCharactersInRange_withString_( + NSRange range, NSString? replacement) { + final _ret = _lib._objc_msgSend_325( + _id, + _lib._sel_stringByReplacingCharactersInRange_withString_1, + range, + replacement?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByApplyingTransform_reverse_( + NSStringTransform transform, bool reverse) { + final _ret = _lib._objc_msgSend_326( + _id, _lib._sel_stringByApplyingTransform_reverse_1, transform, reverse); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool writeToURL_atomically_encoding_error_(NSURL? url, bool useAuxiliaryFile, + int enc, ffi.Pointer> error) { + return _lib._objc_msgSend_327( + _id, + _lib._sel_writeToURL_atomically_encoding_error_1, + url?._id ?? ffi.nullptr, + useAuxiliaryFile, + enc, + error); + } + + bool writeToFile_atomically_encoding_error_( + NSString? path, + bool useAuxiliaryFile, + int enc, + ffi.Pointer> error) { + return _lib._objc_msgSend_328( + _id, + _lib._sel_writeToFile_atomically_encoding_error_1, + path?._id ?? ffi.nullptr, + useAuxiliaryFile, + enc, + error); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get hash { + return _lib._objc_msgSend_10(_id, _lib._sel_hash1); + } + + NSString initWithCharactersNoCopy_length_freeWhenDone_( + ffi.Pointer characters, int length, bool freeBuffer) { + final _ret = _lib._objc_msgSend_329( + _id, + _lib._sel_initWithCharactersNoCopy_length_freeWhenDone_1, + characters, + length, + freeBuffer); + return NSString._(_ret, _lib, retain: false, release: true); + } + + NSString initWithCharactersNoCopy_length_deallocator_( + ffi.Pointer chars, int len, ObjCBlock12 deallocator) { + final _ret = _lib._objc_msgSend_330( + _id, + _lib._sel_initWithCharactersNoCopy_length_deallocator_1, + chars, + len, + deallocator._impl); + return NSString._(_ret, _lib, retain: false, release: true); + } + + NSString initWithCharacters_length_( + ffi.Pointer characters, int length) { + final _ret = _lib._objc_msgSend_331( + _id, _lib._sel_initWithCharacters_length_1, characters, length); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithUTF8String_(ffi.Pointer nullTerminatedCString) { + final _ret = _lib._objc_msgSend_332( + _id, _lib._sel_initWithUTF8String_1, nullTerminatedCString); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithString_(NSString? aString) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, aString?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithFormat_(NSString? format) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithFormat_arguments_( + NSString? format, ffi.Pointer<__va_list_tag> argList) { + final _ret = _lib._objc_msgSend_333( + _id, + _lib._sel_initWithFormat_arguments_1, + format?._id ?? ffi.nullptr, + argList); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithFormat_locale_(NSString? format, NSObject locale) { + final _ret = _lib._objc_msgSend_157(_id, _lib._sel_initWithFormat_locale_1, + format?._id ?? ffi.nullptr, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithFormat_locale_arguments_( + NSString? format, NSObject locale, ffi.Pointer<__va_list_tag> argList) { + final _ret = _lib._objc_msgSend_334( + _id, + _lib._sel_initWithFormat_locale_arguments_1, + format?._id ?? ffi.nullptr, + locale._id, + argList); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithData_encoding_(NSData? data, int encoding) { + final _ret = _lib._objc_msgSend_335(_id, _lib._sel_initWithData_encoding_1, + data?._id ?? ffi.nullptr, encoding); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithBytes_length_encoding_( + ffi.Pointer bytes, int len, int encoding) { + final _ret = _lib._objc_msgSend_336( + _id, _lib._sel_initWithBytes_length_encoding_1, bytes, len, encoding); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithBytesNoCopy_length_encoding_freeWhenDone_( + ffi.Pointer bytes, int len, int encoding, bool freeBuffer) { + final _ret = _lib._objc_msgSend_337( + _id, + _lib._sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1, + bytes, + len, + encoding, + freeBuffer); + return NSString._(_ret, _lib, retain: false, release: true); + } + + NSString initWithBytesNoCopy_length_encoding_deallocator_( + ffi.Pointer bytes, + int len, + int encoding, + ObjCBlock9 deallocator) { + final _ret = _lib._objc_msgSend_338( + _id, + _lib._sel_initWithBytesNoCopy_length_encoding_deallocator_1, + bytes, + len, + encoding, + deallocator._impl); + return NSString._(_ret, _lib, retain: false, release: true); + } + + static NSString string(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSString1, _lib._sel_string1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithString_(AVFAudio _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSString1, + _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithCharacters_length_( + AVFAudio _lib, ffi.Pointer characters, int length) { + final _ret = _lib._objc_msgSend_331(_lib._class_NSString1, + _lib._sel_stringWithCharacters_length_1, characters, length); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithUTF8String_( + AVFAudio _lib, ffi.Pointer nullTerminatedCString) { + final _ret = _lib._objc_msgSend_332(_lib._class_NSString1, + _lib._sel_stringWithUTF8String_1, nullTerminatedCString); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithFormat_(AVFAudio _lib, NSString? format) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSString1, + _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString localizedStringWithFormat_(AVFAudio _lib, NSString? format) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSString1, + _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithCString_encoding_( + ffi.Pointer nullTerminatedCString, int encoding) { + final _ret = _lib._objc_msgSend_339(_id, + _lib._sel_initWithCString_encoding_1, nullTerminatedCString, encoding); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithCString_encoding_( + AVFAudio _lib, ffi.Pointer cString, int enc) { + final _ret = _lib._objc_msgSend_339(_lib._class_NSString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithContentsOfURL_encoding_error_( + NSURL? url, int enc, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_340( + _id, + _lib._sel_initWithContentsOfURL_encoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithContentsOfFile_encoding_error_( + NSString? path, int enc, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_341( + _id, + _lib._sel_initWithContentsOfFile_encoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithContentsOfURL_encoding_error_(AVFAudio _lib, + NSURL? url, int enc, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_340( + _lib._class_NSString1, + _lib._sel_stringWithContentsOfURL_encoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithContentsOfFile_encoding_error_(AVFAudio _lib, + NSString? path, int enc, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_341( + _lib._class_NSString1, + _lib._sel_stringWithContentsOfFile_encoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithContentsOfURL_usedEncoding_error_( + NSURL? url, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_342( + _id, + _lib._sel_initWithContentsOfURL_usedEncoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithContentsOfFile_usedEncoding_error_( + NSString? path, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_343( + _id, + _lib._sel_initWithContentsOfFile_usedEncoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithContentsOfURL_usedEncoding_error_( + AVFAudio _lib, + NSURL? url, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_342( + _lib._class_NSString1, + _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithContentsOfFile_usedEncoding_error_( + AVFAudio _lib, + NSString? path, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_343( + _lib._class_NSString1, + _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static int + stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( + AVFAudio _lib, + NSData? data, + NSDictionary? opts, + ffi.Pointer> string, + ffi.Pointer usedLossyConversion) { + return _lib._objc_msgSend_344( + _lib._class_NSString1, + _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, + data?._id ?? ffi.nullptr, + opts?._id ?? ffi.nullptr, + string, + usedLossyConversion); + } + + NSObject propertyList() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_propertyList1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSDictionary propertyListFromStringsFileFormat() { + final _ret = _lib._objc_msgSend_164( + _id, _lib._sel_propertyListFromStringsFileFormat1); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + ffi.Pointer cString() { + return _lib._objc_msgSend_13(_id, _lib._sel_cString1); + } + + ffi.Pointer lossyCString() { + return _lib._objc_msgSend_13(_id, _lib._sel_lossyCString1); + } + + int cStringLength() { + return _lib._objc_msgSend_10(_id, _lib._sel_cStringLength1); + } + + void getCString_(ffi.Pointer bytes) { + return _lib._objc_msgSend_251(_id, _lib._sel_getCString_1, bytes); + } + + void getCString_maxLength_(ffi.Pointer bytes, int maxLength) { + return _lib._objc_msgSend_345( + _id, _lib._sel_getCString_maxLength_1, bytes, maxLength); + } + + void getCString_maxLength_range_remainingRange_(ffi.Pointer bytes, + int maxLength, NSRange aRange, NSRangePointer leftoverRange) { + return _lib._objc_msgSend_346( + _id, + _lib._sel_getCString_maxLength_range_remainingRange_1, + bytes, + maxLength, + aRange, + leftoverRange); + } + + bool writeToFile_atomically_(NSString? path, bool useAuxiliaryFile) { + return _lib._objc_msgSend_25(_id, _lib._sel_writeToFile_atomically_1, + path?._id ?? ffi.nullptr, useAuxiliaryFile); + } + + bool writeToURL_atomically_(NSURL? url, bool atomically) { + return _lib._objc_msgSend_121(_id, _lib._sel_writeToURL_atomically_1, + url?._id ?? ffi.nullptr, atomically); + } + + NSObject initWithContentsOfFile_(NSString? path) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_226( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject stringWithContentsOfFile_(AVFAudio _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSString1, + _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject stringWithContentsOfURL_(AVFAudio _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_226(_lib._class_NSString1, + _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithCStringNoCopy_length_freeWhenDone_( + ffi.Pointer bytes, int length, bool freeBuffer) { + final _ret = _lib._objc_msgSend_347( + _id, + _lib._sel_initWithCStringNoCopy_length_freeWhenDone_1, + bytes, + length, + freeBuffer); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + NSObject initWithCString_length_(ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_339( + _id, _lib._sel_initWithCString_length_1, bytes, length); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithCString_(ffi.Pointer bytes) { + final _ret = + _lib._objc_msgSend_332(_id, _lib._sel_initWithCString_1, bytes); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject stringWithCString_length_( + AVFAudio _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_339(_lib._class_NSString1, + _lib._sel_stringWithCString_length_1, bytes, length); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject stringWithCString_( + AVFAudio _lib, ffi.Pointer bytes) { + final _ret = _lib._objc_msgSend_332( + _lib._class_NSString1, _lib._sel_stringWithCString_1, bytes); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void getCharacters_(ffi.Pointer buffer) { + return _lib._objc_msgSend_348(_id, _lib._sel_getCharacters_1, buffer); + } + + NSString variantFittingPresentationWidth_(int width) { + final _ret = _lib._objc_msgSend_349( + _id, _lib._sel_variantFittingPresentationWidth_1, width); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString pathWithComponents_(AVFAudio _lib, NSArray? components) { + final _ret = _lib._objc_msgSend_350(_lib._class_NSString1, + _lib._sel_pathWithComponents_1, components?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get pathComponents { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_pathComponents1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + bool get absolutePath { + return _lib._objc_msgSend_12(_id, _lib._sel_isAbsolutePath1); + } + + NSString? get lastPathComponent { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_lastPathComponent1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get stringByDeletingLastPathComponent { + final _ret = _lib._objc_msgSend_20( + _id, _lib._sel_stringByDeletingLastPathComponent1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByAppendingPathComponent_(NSString? str) { + final _ret = _lib._objc_msgSend_64(_id, + _lib._sel_stringByAppendingPathComponent_1, str?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get pathExtension { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_pathExtension1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get stringByDeletingPathExtension { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_stringByDeletingPathExtension1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByAppendingPathExtension_(NSString? str) { + final _ret = _lib._objc_msgSend_64(_id, + _lib._sel_stringByAppendingPathExtension_1, str?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get stringByAbbreviatingWithTildeInPath { + final _ret = _lib._objc_msgSend_20( + _id, _lib._sel_stringByAbbreviatingWithTildeInPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get stringByExpandingTildeInPath { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_stringByExpandingTildeInPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get stringByStandardizingPath { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_stringByStandardizingPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get stringByResolvingSymlinksInPath { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_stringByResolvingSymlinksInPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray stringsByAppendingPaths_(NSArray? paths) { + final _ret = _lib._objc_msgSend_63( + _id, _lib._sel_stringsByAppendingPaths_1, paths?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + int completePathIntoString_caseSensitive_matchesIntoArray_filterTypes_( + ffi.Pointer> outputName, + bool flag, + ffi.Pointer> outputArray, + NSArray? filterTypes) { + return _lib._objc_msgSend_351( + _id, + _lib._sel_completePathIntoString_caseSensitive_matchesIntoArray_filterTypes_1, + outputName, + flag, + outputArray, + filterTypes?._id ?? ffi.nullptr); + } + + ffi.Pointer get fileSystemRepresentation { + return _lib._objc_msgSend_13(_id, _lib._sel_fileSystemRepresentation1); + } + + bool getFileSystemRepresentation_maxLength_( + ffi.Pointer cname, int max) { + return _lib._objc_msgSend_218( + _id, _lib._sel_getFileSystemRepresentation_maxLength_1, cname, max); + } + + NSString stringByAddingPercentEncodingWithAllowedCharacters_( + NSCharacterSet? allowedCharacters) { + final _ret = _lib._objc_msgSend_320( + _id, + _lib._sel_stringByAddingPercentEncodingWithAllowedCharacters_1, + allowedCharacters?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get stringByRemovingPercentEncoding { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_stringByRemovingPercentEncoding1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByAddingPercentEscapesUsingEncoding_(int enc) { + final _ret = _lib._objc_msgSend_293( + _id, _lib._sel_stringByAddingPercentEscapesUsingEncoding_1, enc); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByReplacingPercentEscapesUsingEncoding_(int enc) { + final _ret = _lib._objc_msgSend_293( + _id, _lib._sel_stringByReplacingPercentEscapesUsingEncoding_1, enc); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray linguisticTagsInRange_scheme_options_orthography_tokenRanges_( + NSRange range, + NSLinguisticTagScheme scheme, + int options, + NSOrthography? orthography, + ffi.Pointer> tokenRanges) { + final _ret = _lib._objc_msgSend_353( + _id, + _lib._sel_linguisticTagsInRange_scheme_options_orthography_tokenRanges_1, + range, + scheme, + options, + orthography?._id ?? ffi.nullptr, + tokenRanges); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void enumerateLinguisticTagsInRange_scheme_options_orthography_usingBlock_( + NSRange range, + NSLinguisticTagScheme scheme, + int options, + NSOrthography? orthography, + ObjCBlock10 block) { + return _lib._objc_msgSend_354( + _id, + _lib._sel_enumerateLinguisticTagsInRange_scheme_options_orthography_usingBlock_1, + range, + scheme, + options, + orthography?._id ?? ffi.nullptr, + block._impl); + } + + static NSString new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSString1, _lib._sel_new1); + return NSString._(_ret, _lib, retain: false, release: true); + } + + static NSString alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSString1, _lib._sel_alloc1); + return NSString._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSString1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSString1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSString1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSString1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSString1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSString1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSString1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +extension StringToNSString on String { + NSString toNSString(AVFAudio lib) => NSString(lib, this); +} + +typedef unichar = ffi.UnsignedShort; + +class NSCoder extends NSObject { + NSCoder._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSCoder] that points to the same underlying object as [other]. + static NSCoder castFrom(T other) { + return NSCoder._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSCoder] that wraps the given raw object pointer. + static NSCoder castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSCoder._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSCoder]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSCoder1); + } + + void encodeValueOfObjCType_at_( + ffi.Pointer type, ffi.Pointer addr) { + return _lib._objc_msgSend_18( + _id, _lib._sel_encodeValueOfObjCType_at_1, type, addr); + } + + void encodeDataObject_(NSData? data) { + return _lib._objc_msgSend_248( + _id, _lib._sel_encodeDataObject_1, data?._id ?? ffi.nullptr); + } + + NSData decodeDataObject() { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_decodeDataObject1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + void decodeValueOfObjCType_at_size_( + ffi.Pointer type, ffi.Pointer data, int size) { + return _lib._objc_msgSend_249( + _id, _lib._sel_decodeValueOfObjCType_at_size_1, type, data, size); + } + + int versionForClassName_(NSString? className) { + return _lib._objc_msgSend_250( + _id, _lib._sel_versionForClassName_1, className?._id ?? ffi.nullptr); + } + + void encodeObject_(NSObject object) { + return _lib._objc_msgSend_15(_id, _lib._sel_encodeObject_1, object._id); + } + + void encodeRootObject_(NSObject rootObject) { + return _lib._objc_msgSend_15( + _id, _lib._sel_encodeRootObject_1, rootObject._id); + } + + void encodeBycopyObject_(NSObject anObject) { + return _lib._objc_msgSend_15( + _id, _lib._sel_encodeBycopyObject_1, anObject._id); + } + + void encodeByrefObject_(NSObject anObject) { + return _lib._objc_msgSend_15( + _id, _lib._sel_encodeByrefObject_1, anObject._id); + } + + void encodeConditionalObject_(NSObject object) { + return _lib._objc_msgSend_15( + _id, _lib._sel_encodeConditionalObject_1, object._id); + } + + void encodeValuesOfObjCTypes_(ffi.Pointer types) { + return _lib._objc_msgSend_251( + _id, _lib._sel_encodeValuesOfObjCTypes_1, types); + } + + void encodeArrayOfObjCType_count_at_( + ffi.Pointer type, int count, ffi.Pointer array) { + return _lib._objc_msgSend_252( + _id, _lib._sel_encodeArrayOfObjCType_count_at_1, type, count, array); + } + + void encodeBytes_length_(ffi.Pointer byteaddr, int length) { + return _lib._objc_msgSend_21( + _id, _lib._sel_encodeBytes_length_1, byteaddr, length); + } + + NSObject decodeObject() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_decodeObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject decodeTopLevelObjectAndReturnError_( + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_253( + _id, _lib._sel_decodeTopLevelObjectAndReturnError_1, error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void decodeValuesOfObjCTypes_(ffi.Pointer types) { + return _lib._objc_msgSend_251( + _id, _lib._sel_decodeValuesOfObjCTypes_1, types); + } + + void decodeArrayOfObjCType_count_at_( + ffi.Pointer itemType, int count, ffi.Pointer array) { + return _lib._objc_msgSend_252(_id, + _lib._sel_decodeArrayOfObjCType_count_at_1, itemType, count, array); + } + + ffi.Pointer decodeBytesWithReturnedLength_( + ffi.Pointer lengthp) { + return _lib._objc_msgSend_254( + _id, _lib._sel_decodeBytesWithReturnedLength_1, lengthp); + } + + void encodePropertyList_(NSObject aPropertyList) { + return _lib._objc_msgSend_15( + _id, _lib._sel_encodePropertyList_1, aPropertyList._id); + } + + NSObject decodePropertyList() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_decodePropertyList1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void setObjectZone_(ffi.Pointer zone) { + return _lib._objc_msgSend_255(_id, _lib._sel_setObjectZone_1, zone); + } + + ffi.Pointer objectZone() { + return _lib._objc_msgSend_256(_id, _lib._sel_objectZone1); + } + + int get systemVersion { + return _lib._objc_msgSend_191(_id, _lib._sel_systemVersion1); + } + + bool get allowsKeyedCoding { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsKeyedCoding1); + } + + void encodeObject_forKey_(NSObject object, NSString? key) { + return _lib._objc_msgSend_122(_id, _lib._sel_encodeObject_forKey_1, + object._id, key?._id ?? ffi.nullptr); + } + + void encodeConditionalObject_forKey_(NSObject object, NSString? key) { + return _lib._objc_msgSend_122( + _id, + _lib._sel_encodeConditionalObject_forKey_1, + object._id, + key?._id ?? ffi.nullptr); + } + + void encodeBool_forKey_(bool value, NSString? key) { + return _lib._objc_msgSend_257( + _id, _lib._sel_encodeBool_forKey_1, value, key?._id ?? ffi.nullptr); + } + + void encodeInt_forKey_(int value, NSString? key) { + return _lib._objc_msgSend_258( + _id, _lib._sel_encodeInt_forKey_1, value, key?._id ?? ffi.nullptr); + } + + void encodeInt32_forKey_(int value, NSString? key) { + return _lib._objc_msgSend_259( + _id, _lib._sel_encodeInt32_forKey_1, value, key?._id ?? ffi.nullptr); + } + + void encodeInt64_forKey_(int value, NSString? key) { + return _lib._objc_msgSend_260( + _id, _lib._sel_encodeInt64_forKey_1, value, key?._id ?? ffi.nullptr); + } + + void encodeFloat_forKey_(double value, NSString? key) { + return _lib._objc_msgSend_261( + _id, _lib._sel_encodeFloat_forKey_1, value, key?._id ?? ffi.nullptr); + } + + void encodeDouble_forKey_(double value, NSString? key) { + return _lib._objc_msgSend_262( + _id, _lib._sel_encodeDouble_forKey_1, value, key?._id ?? ffi.nullptr); + } + + void encodeBytes_length_forKey_( + ffi.Pointer bytes, int length, NSString? key) { + return _lib._objc_msgSend_263(_id, _lib._sel_encodeBytes_length_forKey_1, + bytes, length, key?._id ?? ffi.nullptr); + } + + bool containsValueForKey_(NSString? key) { + return _lib._objc_msgSend_59( + _id, _lib._sel_containsValueForKey_1, key?._id ?? ffi.nullptr); + } + + NSObject decodeObjectForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_decodeObjectForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject decodeTopLevelObjectForKey_error_( + NSString? key, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_264( + _id, + _lib._sel_decodeTopLevelObjectForKey_error_1, + key?._id ?? ffi.nullptr, + error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool decodeBoolForKey_(NSString? key) { + return _lib._objc_msgSend_59( + _id, _lib._sel_decodeBoolForKey_1, key?._id ?? ffi.nullptr); + } + + int decodeIntForKey_(NSString? key) { + return _lib._objc_msgSend_265( + _id, _lib._sel_decodeIntForKey_1, key?._id ?? ffi.nullptr); + } + + int decodeInt32ForKey_(NSString? key) { + return _lib._objc_msgSend_266( + _id, _lib._sel_decodeInt32ForKey_1, key?._id ?? ffi.nullptr); + } + + int decodeInt64ForKey_(NSString? key) { + return _lib._objc_msgSend_267( + _id, _lib._sel_decodeInt64ForKey_1, key?._id ?? ffi.nullptr); + } + + double decodeFloatForKey_(NSString? key) { + return _lib._objc_msgSend_268( + _id, _lib._sel_decodeFloatForKey_1, key?._id ?? ffi.nullptr); + } + + double decodeDoubleForKey_(NSString? key) { + return _lib._objc_msgSend_269( + _id, _lib._sel_decodeDoubleForKey_1, key?._id ?? ffi.nullptr); + } + + ffi.Pointer decodeBytesForKey_returnedLength_( + NSString? key, ffi.Pointer lengthp) { + return _lib._objc_msgSend_270( + _id, + _lib._sel_decodeBytesForKey_returnedLength_1, + key?._id ?? ffi.nullptr, + lengthp); + } + + void encodeInteger_forKey_(int value, NSString? key) { + return _lib._objc_msgSend_271( + _id, _lib._sel_encodeInteger_forKey_1, value, key?._id ?? ffi.nullptr); + } + + int decodeIntegerForKey_(NSString? key) { + return _lib._objc_msgSend_250( + _id, _lib._sel_decodeIntegerForKey_1, key?._id ?? ffi.nullptr); + } + + bool get requiresSecureCoding { + return _lib._objc_msgSend_12(_id, _lib._sel_requiresSecureCoding1); + } + + NSObject decodeObjectOfClass_forKey_(NSObject aClass, NSString? key) { + final _ret = _lib._objc_msgSend_272( + _id, + _lib._sel_decodeObjectOfClass_forKey_1, + aClass._id, + key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject decodeTopLevelObjectOfClass_forKey_error_(NSObject aClass, + NSString? key, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_273( + _id, + _lib._sel_decodeTopLevelObjectOfClass_forKey_error_1, + aClass._id, + key?._id ?? ffi.nullptr, + error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSArray decodeArrayOfObjectsOfClass_forKey_(NSObject cls, NSString? key) { + final _ret = _lib._objc_msgSend_274( + _id, + _lib._sel_decodeArrayOfObjectsOfClass_forKey_1, + cls._id, + key?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSDictionary decodeDictionaryWithKeysOfClass_objectsOfClass_forKey_( + NSObject keyCls, NSObject objectCls, NSString? key) { + final _ret = _lib._objc_msgSend_275( + _id, + _lib._sel_decodeDictionaryWithKeysOfClass_objectsOfClass_forKey_1, + keyCls._id, + objectCls._id, + key?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSObject decodeObjectOfClasses_forKey_(NSSet? classes, NSString? key) { + final _ret = _lib._objc_msgSend_276( + _id, + _lib._sel_decodeObjectOfClasses_forKey_1, + classes?._id ?? ffi.nullptr, + key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject decodeTopLevelObjectOfClasses_forKey_error_(NSSet? classes, + NSString? key, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_277( + _id, + _lib._sel_decodeTopLevelObjectOfClasses_forKey_error_1, + classes?._id ?? ffi.nullptr, + key?._id ?? ffi.nullptr, + error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSArray decodeArrayOfObjectsOfClasses_forKey_(NSSet? classes, NSString? key) { + final _ret = _lib._objc_msgSend_278( + _id, + _lib._sel_decodeArrayOfObjectsOfClasses_forKey_1, + classes?._id ?? ffi.nullptr, + key?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSDictionary decodeDictionaryWithKeysOfClasses_objectsOfClasses_forKey_( + NSSet? keyClasses, NSSet? objectClasses, NSString? key) { + final _ret = _lib._objc_msgSend_279( + _id, + _lib._sel_decodeDictionaryWithKeysOfClasses_objectsOfClasses_forKey_1, + keyClasses?._id ?? ffi.nullptr, + objectClasses?._id ?? ffi.nullptr, + key?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSObject decodePropertyListForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_decodePropertyListForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSSet? get allowedClasses { + final _ret = _lib._objc_msgSend_280(_id, _lib._sel_allowedClasses1); + return _ret.address == 0 + ? null + : NSSet._(_ret, _lib, retain: true, release: true); + } + + void failWithError_(NSError? error) { + return _lib._objc_msgSend_281( + _id, _lib._sel_failWithError_1, error?._id ?? ffi.nullptr); + } + + int get decodingFailurePolicy { + return _lib._objc_msgSend_282(_id, _lib._sel_decodingFailurePolicy1); + } + + NSError? get error { + final _ret = _lib._objc_msgSend_283(_id, _lib._sel_error1); + return _ret.address == 0 + ? null + : NSError._(_ret, _lib, retain: true, release: true); + } + + void encodeNXObject_(NSObject object) { + return _lib._objc_msgSend_15(_id, _lib._sel_encodeNXObject_1, object._id); + } + + NSObject decodeNXObject() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_decodeNXObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void decodeValueOfObjCType_at_( + ffi.Pointer type, ffi.Pointer data) { + return _lib._objc_msgSend_18( + _id, _lib._sel_decodeValueOfObjCType_at_1, type, data); + } + + void encodePoint_(NSPoint point) { + return _lib._objc_msgSend_284(_id, _lib._sel_encodePoint_1, point); + } + + NSPoint decodePoint() { + return _lib._objc_msgSend_54(_id, _lib._sel_decodePoint1); + } + + void encodeSize_(NSSize size) { + return _lib._objc_msgSend_285(_id, _lib._sel_encodeSize_1, size); + } + + NSSize decodeSize() { + return _lib._objc_msgSend_55(_id, _lib._sel_decodeSize1); + } + + void encodeRect_(NSRect rect) { + return _lib._objc_msgSend_286(_id, _lib._sel_encodeRect_1, rect); + } + + NSRect decodeRect() { + return _lib._objc_msgSend_56(_id, _lib._sel_decodeRect1); + } + + void encodePoint_forKey_(NSPoint point, NSString? key) { + return _lib._objc_msgSend_287( + _id, _lib._sel_encodePoint_forKey_1, point, key?._id ?? ffi.nullptr); + } + + void encodeSize_forKey_(NSSize size, NSString? key) { + return _lib._objc_msgSend_288( + _id, _lib._sel_encodeSize_forKey_1, size, key?._id ?? ffi.nullptr); + } + + void encodeRect_forKey_(NSRect rect, NSString? key) { + return _lib._objc_msgSend_289( + _id, _lib._sel_encodeRect_forKey_1, rect, key?._id ?? ffi.nullptr); + } + + NSPoint decodePointForKey_(NSString? key) { + return _lib._objc_msgSend_290( + _id, _lib._sel_decodePointForKey_1, key?._id ?? ffi.nullptr); + } + + NSSize decodeSizeForKey_(NSString? key) { + return _lib._objc_msgSend_291( + _id, _lib._sel_decodeSizeForKey_1, key?._id ?? ffi.nullptr); + } + + NSRect decodeRectForKey_(NSString? key) { + return _lib._objc_msgSend_292( + _id, _lib._sel_decodeRectForKey_1, key?._id ?? ffi.nullptr); + } + + static NSCoder new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSCoder1, _lib._sel_new1); + return NSCoder._(_ret, _lib, retain: false, release: true); + } + + static NSCoder alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSCoder1, _lib._sel_alloc1); + return NSCoder._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSCoder1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSCoder1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSCoder1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSCoder1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSCoder1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSCoder1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSCoder1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSCoder1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSCoder1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSData extends NSObject { + NSData._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSData] that points to the same underlying object as [other]. + static NSData castFrom(T other) { + return NSData._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSData] that wraps the given raw object pointer. + static NSData castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSData._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSData]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSData1); + } + + int get length { + return _lib._objc_msgSend_10(_id, _lib._sel_length1); + } + + ffi.Pointer get bytes { + return _lib._objc_msgSend_19(_id, _lib._sel_bytes1); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + void getBytes_length_(ffi.Pointer buffer, int length) { + return _lib._objc_msgSend_21( + _id, _lib._sel_getBytes_length_1, buffer, length); + } + + void getBytes_range_(ffi.Pointer buffer, NSRange range) { + return _lib._objc_msgSend_22( + _id, _lib._sel_getBytes_range_1, buffer, range); + } + + bool isEqualToData_(NSData? other) { + return _lib._objc_msgSend_23( + _id, _lib._sel_isEqualToData_1, other?._id ?? ffi.nullptr); + } + + NSData subdataWithRange_(NSRange range) { + final _ret = + _lib._objc_msgSend_24(_id, _lib._sel_subdataWithRange_1, range); + return NSData._(_ret, _lib, retain: true, release: true); + } + + bool writeToFile_atomically_(NSString? path, bool useAuxiliaryFile) { + return _lib._objc_msgSend_25(_id, _lib._sel_writeToFile_atomically_1, + path?._id ?? ffi.nullptr, useAuxiliaryFile); + } + + bool writeToURL_atomically_(NSURL? url, bool atomically) { + return _lib._objc_msgSend_121(_id, _lib._sel_writeToURL_atomically_1, + url?._id ?? ffi.nullptr, atomically); + } + + bool writeToFile_options_error_(NSString? path, int writeOptionsMask, + ffi.Pointer> errorPtr) { + return _lib._objc_msgSend_233(_id, _lib._sel_writeToFile_options_error_1, + path?._id ?? ffi.nullptr, writeOptionsMask, errorPtr); + } + + bool writeToURL_options_error_(NSURL? url, int writeOptionsMask, + ffi.Pointer> errorPtr) { + return _lib._objc_msgSend_234(_id, _lib._sel_writeToURL_options_error_1, + url?._id ?? ffi.nullptr, writeOptionsMask, errorPtr); + } + + NSRange rangeOfData_options_range_( + NSData? dataToFind, int mask, NSRange searchRange) { + return _lib._objc_msgSend_235(_id, _lib._sel_rangeOfData_options_range_1, + dataToFind?._id ?? ffi.nullptr, mask, searchRange); + } + + void enumerateByteRangesUsingBlock_(ObjCBlock8 block) { + return _lib._objc_msgSend_236( + _id, _lib._sel_enumerateByteRangesUsingBlock_1, block._impl); + } + + static NSData data(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSData1, _lib._sel_data1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static NSData dataWithBytes_length_( + AVFAudio _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_237( + _lib._class_NSData1, _lib._sel_dataWithBytes_length_1, bytes, length); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static NSData dataWithBytesNoCopy_length_( + AVFAudio _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_237(_lib._class_NSData1, + _lib._sel_dataWithBytesNoCopy_length_1, bytes, length); + return NSData._(_ret, _lib, retain: false, release: true); + } + + static NSData dataWithBytesNoCopy_length_freeWhenDone_( + AVFAudio _lib, ffi.Pointer bytes, int length, bool b) { + final _ret = _lib._objc_msgSend_238(_lib._class_NSData1, + _lib._sel_dataWithBytesNoCopy_length_freeWhenDone_1, bytes, length, b); + return NSData._(_ret, _lib, retain: false, release: true); + } + + static NSData dataWithContentsOfFile_options_error_( + AVFAudio _lib, + NSString? path, + int readOptionsMask, + ffi.Pointer> errorPtr) { + final _ret = _lib._objc_msgSend_239( + _lib._class_NSData1, + _lib._sel_dataWithContentsOfFile_options_error_1, + path?._id ?? ffi.nullptr, + readOptionsMask, + errorPtr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static NSData dataWithContentsOfURL_options_error_(AVFAudio _lib, NSURL? url, + int readOptionsMask, ffi.Pointer> errorPtr) { + final _ret = _lib._objc_msgSend_240( + _lib._class_NSData1, + _lib._sel_dataWithContentsOfURL_options_error_1, + url?._id ?? ffi.nullptr, + readOptionsMask, + errorPtr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static NSData dataWithContentsOfFile_(AVFAudio _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSData1, + _lib._sel_dataWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static NSData dataWithContentsOfURL_(AVFAudio _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_226(_lib._class_NSData1, + _lib._sel_dataWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData initWithBytes_length_(ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_237( + _id, _lib._sel_initWithBytes_length_1, bytes, length); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData initWithBytesNoCopy_length_(ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_237( + _id, _lib._sel_initWithBytesNoCopy_length_1, bytes, length); + return NSData._(_ret, _lib, retain: false, release: true); + } + + NSData initWithBytesNoCopy_length_freeWhenDone_( + ffi.Pointer bytes, int length, bool b) { + final _ret = _lib._objc_msgSend_238(_id, + _lib._sel_initWithBytesNoCopy_length_freeWhenDone_1, bytes, length, b); + return NSData._(_ret, _lib, retain: false, release: true); + } + + NSData initWithBytesNoCopy_length_deallocator_( + ffi.Pointer bytes, int length, ObjCBlock9 deallocator) { + final _ret = _lib._objc_msgSend_241( + _id, + _lib._sel_initWithBytesNoCopy_length_deallocator_1, + bytes, + length, + deallocator._impl); + return NSData._(_ret, _lib, retain: false, release: true); + } + + NSData initWithContentsOfFile_options_error_(NSString? path, + int readOptionsMask, ffi.Pointer> errorPtr) { + final _ret = _lib._objc_msgSend_239( + _id, + _lib._sel_initWithContentsOfFile_options_error_1, + path?._id ?? ffi.nullptr, + readOptionsMask, + errorPtr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData initWithContentsOfURL_options_error_(NSURL? url, int readOptionsMask, + ffi.Pointer> errorPtr) { + final _ret = _lib._objc_msgSend_240( + _id, + _lib._sel_initWithContentsOfURL_options_error_1, + url?._id ?? ffi.nullptr, + readOptionsMask, + errorPtr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData initWithContentsOfFile_(NSString? path) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_226( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData initWithData_(NSData? data) { + final _ret = _lib._objc_msgSend_242( + _id, _lib._sel_initWithData_1, data?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static NSData dataWithData_(AVFAudio _lib, NSData? data) { + final _ret = _lib._objc_msgSend_242(_lib._class_NSData1, + _lib._sel_dataWithData_1, data?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData initWithBase64EncodedString_options_( + NSString? base64String, int options) { + final _ret = _lib._objc_msgSend_243( + _id, + _lib._sel_initWithBase64EncodedString_options_1, + base64String?._id ?? ffi.nullptr, + options); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSString base64EncodedStringWithOptions_(int options) { + final _ret = _lib._objc_msgSend_244( + _id, _lib._sel_base64EncodedStringWithOptions_1, options); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSData initWithBase64EncodedData_options_(NSData? base64Data, int options) { + final _ret = _lib._objc_msgSend_245( + _id, + _lib._sel_initWithBase64EncodedData_options_1, + base64Data?._id ?? ffi.nullptr, + options); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData base64EncodedDataWithOptions_(int options) { + final _ret = _lib._objc_msgSend_246( + _id, _lib._sel_base64EncodedDataWithOptions_1, options); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData decompressedDataUsingAlgorithm_error_( + int algorithm, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_247(_id, + _lib._sel_decompressedDataUsingAlgorithm_error_1, algorithm, error); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData compressedDataUsingAlgorithm_error_( + int algorithm, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_247( + _id, _lib._sel_compressedDataUsingAlgorithm_error_1, algorithm, error); + return NSData._(_ret, _lib, retain: true, release: true); + } + + void getBytes_(ffi.Pointer buffer) { + return _lib._objc_msgSend_47(_id, _lib._sel_getBytes_1, buffer); + } + + static NSObject dataWithContentsOfMappedFile_(AVFAudio _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSData1, + _lib._sel_dataWithContentsOfMappedFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithContentsOfMappedFile_(NSString? path) { + final _ret = _lib._objc_msgSend_30(_id, + _lib._sel_initWithContentsOfMappedFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithBase64Encoding_(NSString? base64String) { + final _ret = _lib._objc_msgSend_30(_id, _lib._sel_initWithBase64Encoding_1, + base64String?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSString base64Encoding() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_base64Encoding1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSData new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSData1, _lib._sel_new1); + return NSData._(_ret, _lib, retain: false, release: true); + } + + static NSData alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSData1, _lib._sel_alloc1); + return NSData._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSData1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSData1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSData1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSData1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSData1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSData1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSData1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSData1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSData1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSRange = _NSRange; + +class _NSRange extends ffi.Struct { + @NSUInteger() + external int location; + + @NSUInteger() + external int length; +} + +class NSURL extends NSObject { + NSURL._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURL] that points to the same underlying object as [other]. + static NSURL castFrom(T other) { + return NSURL._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSURL] that wraps the given raw object pointer. + static NSURL castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURL._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURL]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURL1); + } + + NSURL initWithScheme_host_path_( + NSString? scheme, NSString? host, NSString? path) { + final _ret = _lib._objc_msgSend_26( + _id, + _lib._sel_initWithScheme_host_path_1, + scheme?._id ?? ffi.nullptr, + host?._id ?? ffi.nullptr, + path?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initFileURLWithPath_isDirectory_relativeToURL_( + NSString? path, bool isDir, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_27( + _id, + _lib._sel_initFileURLWithPath_isDirectory_relativeToURL_1, + path?._id ?? ffi.nullptr, + isDir, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initFileURLWithPath_relativeToURL_(NSString? path, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_28( + _id, + _lib._sel_initFileURLWithPath_relativeToURL_1, + path?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initFileURLWithPath_isDirectory_(NSString? path, bool isDir) { + final _ret = _lib._objc_msgSend_29( + _id, + _lib._sel_initFileURLWithPath_isDirectory_1, + path?._id ?? ffi.nullptr, + isDir); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initFileURLWithPath_(NSString? path) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initFileURLWithPath_1, path?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL fileURLWithPath_isDirectory_relativeToURL_( + AVFAudio _lib, NSString? path, bool isDir, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_31( + _lib._class_NSURL1, + _lib._sel_fileURLWithPath_isDirectory_relativeToURL_1, + path?._id ?? ffi.nullptr, + isDir, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL fileURLWithPath_relativeToURL_( + AVFAudio _lib, NSString? path, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_32( + _lib._class_NSURL1, + _lib._sel_fileURLWithPath_relativeToURL_1, + path?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL fileURLWithPath_isDirectory_( + AVFAudio _lib, NSString? path, bool isDir) { + final _ret = _lib._objc_msgSend_33( + _lib._class_NSURL1, + _lib._sel_fileURLWithPath_isDirectory_1, + path?._id ?? ffi.nullptr, + isDir); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL fileURLWithPath_(AVFAudio _lib, NSString? path) { + final _ret = _lib._objc_msgSend_34(_lib._class_NSURL1, + _lib._sel_fileURLWithPath_1, path?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL_( + ffi.Pointer path, bool isDir, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_35( + _id, + _lib._sel_initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL_1, + path, + isDir, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL fileURLWithFileSystemRepresentation_isDirectory_relativeToURL_( + AVFAudio _lib, ffi.Pointer path, bool isDir, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_36( + _lib._class_NSURL1, + _lib._sel_fileURLWithFileSystemRepresentation_isDirectory_relativeToURL_1, + path, + isDir, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initWithString_(NSString? URLString) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, URLString?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initWithString_relativeToURL_(NSString? URLString, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_28( + _id, + _lib._sel_initWithString_relativeToURL_1, + URLString?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL URLWithString_(AVFAudio _lib, NSString? URLString) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSURL1, + _lib._sel_URLWithString_1, URLString?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL URLWithString_relativeToURL_( + AVFAudio _lib, NSString? URLString, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_28( + _lib._class_NSURL1, + _lib._sel_URLWithString_relativeToURL_1, + URLString?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initWithDataRepresentation_relativeToURL_( + NSData? data, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_37( + _id, + _lib._sel_initWithDataRepresentation_relativeToURL_1, + data?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL URLWithDataRepresentation_relativeToURL_( + AVFAudio _lib, NSData? data, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_38( + _lib._class_NSURL1, + _lib._sel_URLWithDataRepresentation_relativeToURL_1, + data?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initAbsoluteURLWithDataRepresentation_relativeToURL_( + NSData? data, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_37( + _id, + _lib._sel_initAbsoluteURLWithDataRepresentation_relativeToURL_1, + data?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL absoluteURLWithDataRepresentation_relativeToURL_( + AVFAudio _lib, NSData? data, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_38( + _lib._class_NSURL1, + _lib._sel_absoluteURLWithDataRepresentation_relativeToURL_1, + data?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSData? get dataRepresentation { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_dataRepresentation1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSString? get absoluteString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_absoluteString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get relativeString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_relativeString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSURL? get baseURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_baseURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get absoluteURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_absoluteURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSString? get scheme { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_scheme1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get resourceSpecifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_resourceSpecifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get host { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_host1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSNumber? get port { + final _ret = _lib._objc_msgSend_192(_id, _lib._sel_port1); + return _ret.address == 0 + ? null + : NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSString? get user { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_user1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get password { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_password1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get path { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_path1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get fragment { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_fragment1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get parameterString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_parameterString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get query { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_query1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get relativePath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_relativePath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool get hasDirectoryPath { + return _lib._objc_msgSend_12(_id, _lib._sel_hasDirectoryPath1); + } + + bool getFileSystemRepresentation_maxLength_( + ffi.Pointer buffer, int maxBufferLength) { + return _lib._objc_msgSend_218( + _id, + _lib._sel_getFileSystemRepresentation_maxLength_1, + buffer, + maxBufferLength); + } + + ffi.Pointer get fileSystemRepresentation { + return _lib._objc_msgSend_13(_id, _lib._sel_fileSystemRepresentation1); + } + + bool get fileURL { + return _lib._objc_msgSend_12(_id, _lib._sel_isFileURL1); + } + + NSURL? get standardizedURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_standardizedURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + bool checkResourceIsReachableAndReturnError_( + ffi.Pointer> error) { + return _lib._objc_msgSend_219( + _id, _lib._sel_checkResourceIsReachableAndReturnError_1, error); + } + + bool isFileReferenceURL() { + return _lib._objc_msgSend_12(_id, _lib._sel_isFileReferenceURL1); + } + + NSURL fileReferenceURL() { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_fileReferenceURL1); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get filePathURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_filePathURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + bool getResourceValue_forKey_error_( + ffi.Pointer> value, + NSURLResourceKey key, + ffi.Pointer> error) { + return _lib._objc_msgSend_220( + _id, _lib._sel_getResourceValue_forKey_error_1, value, key, error); + } + + bool getPromisedItemResourceValue_forKey_error_( + ffi.Pointer> value, + NSURLResourceKey key, + ffi.Pointer> error) { + return _lib._objc_msgSend_220( + _id, + _lib._sel_getPromisedItemResourceValue_forKey_error_1, + value, + key, + error); + } + + NSDictionary promisedItemResourceValuesForKeys_error_( + NSArray? keys, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_221( + _id, + _lib._sel_promisedItemResourceValuesForKeys_error_1, + keys?._id ?? ffi.nullptr, + error); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + bool checkPromisedItemIsReachableAndReturnError_( + ffi.Pointer> error) { + return _lib._objc_msgSend_219( + _id, _lib._sel_checkPromisedItemIsReachableAndReturnError_1, error); + } + + static NSURL fileURLWithPathComponents_(AVFAudio _lib, NSArray? components) { + final _ret = _lib._objc_msgSend_222(_lib._class_NSURL1, + _lib._sel_fileURLWithPathComponents_1, components?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSArray? get pathComponents { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_pathComponents1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get lastPathComponent { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_lastPathComponent1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get pathExtension { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_pathExtension1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSURL URLByAppendingPathComponent_(NSString? pathComponent) { + final _ret = _lib._objc_msgSend_34( + _id, + _lib._sel_URLByAppendingPathComponent_1, + pathComponent?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL URLByAppendingPathComponent_isDirectory_( + NSString? pathComponent, bool isDirectory) { + final _ret = _lib._objc_msgSend_33( + _id, + _lib._sel_URLByAppendingPathComponent_isDirectory_1, + pathComponent?._id ?? ffi.nullptr, + isDirectory); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get URLByDeletingLastPathComponent { + final _ret = + _lib._objc_msgSend_40(_id, _lib._sel_URLByDeletingLastPathComponent1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL URLByAppendingPathExtension_(NSString? pathExtension) { + final _ret = _lib._objc_msgSend_34( + _id, + _lib._sel_URLByAppendingPathExtension_1, + pathExtension?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get URLByDeletingPathExtension { + final _ret = + _lib._objc_msgSend_40(_id, _lib._sel_URLByDeletingPathExtension1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get URLByStandardizingPath { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_URLByStandardizingPath1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get URLByResolvingSymlinksInPath { + final _ret = + _lib._objc_msgSend_40(_id, _lib._sel_URLByResolvingSymlinksInPath1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSData resourceDataUsingCache_(bool shouldUseCache) { + final _ret = _lib._objc_msgSend_223( + _id, _lib._sel_resourceDataUsingCache_1, shouldUseCache); + return NSData._(_ret, _lib, retain: true, release: true); + } + + void loadResourceDataNotifyingClient_usingCache_( + NSObject client, bool shouldUseCache) { + return _lib._objc_msgSend_224( + _id, + _lib._sel_loadResourceDataNotifyingClient_usingCache_1, + client._id, + shouldUseCache); + } + + NSObject propertyForKey_(NSString? propertyKey) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_propertyForKey_1, propertyKey?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool setResourceData_(NSData? data) { + return _lib._objc_msgSend_23( + _id, _lib._sel_setResourceData_1, data?._id ?? ffi.nullptr); + } + + bool setProperty_forKey_(NSObject property, NSString? propertyKey) { + return _lib._objc_msgSend_225(_id, _lib._sel_setProperty_forKey_1, + property._id, propertyKey?._id ?? ffi.nullptr); + } + + NSURLHandle URLHandleUsingCache_(bool shouldUseCache) { + final _ret = _lib._objc_msgSend_232( + _id, _lib._sel_URLHandleUsingCache_1, shouldUseCache); + return NSURLHandle._(_ret, _lib, retain: true, release: true); + } + + static NSURL new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURL1, _lib._sel_new1); + return NSURL._(_ret, _lib, retain: false, release: true); + } + + static NSURL alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURL1, _lib._sel_alloc1); + return NSURL._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURL1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURL1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURL1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURL1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURL1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURL1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURL1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSURL1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURL1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSNumber extends NSValue { + NSNumber._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSNumber] that points to the same underlying object as [other]. + static NSNumber castFrom(T other) { + return NSNumber._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSNumber] that wraps the given raw object pointer. + static NSNumber castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSNumber._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSNumber]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSNumber1); + } + + @override + NSNumber initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithChar_(int value) { + final _ret = _lib._objc_msgSend_196(_id, _lib._sel_initWithChar_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithUnsignedChar_(int value) { + final _ret = + _lib._objc_msgSend_197(_id, _lib._sel_initWithUnsignedChar_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithShort_(int value) { + final _ret = _lib._objc_msgSend_198(_id, _lib._sel_initWithShort_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithUnsignedShort_(int value) { + final _ret = + _lib._objc_msgSend_199(_id, _lib._sel_initWithUnsignedShort_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithInt_(int value) { + final _ret = _lib._objc_msgSend_200(_id, _lib._sel_initWithInt_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithUnsignedInt_(int value) { + final _ret = + _lib._objc_msgSend_201(_id, _lib._sel_initWithUnsignedInt_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithLong_(int value) { + final _ret = _lib._objc_msgSend_202(_id, _lib._sel_initWithLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithUnsignedLong_(int value) { + final _ret = + _lib._objc_msgSend_203(_id, _lib._sel_initWithUnsignedLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithLongLong_(int value) { + final _ret = + _lib._objc_msgSend_204(_id, _lib._sel_initWithLongLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithUnsignedLongLong_(int value) { + final _ret = _lib._objc_msgSend_205( + _id, _lib._sel_initWithUnsignedLongLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithFloat_(double value) { + final _ret = _lib._objc_msgSend_206(_id, _lib._sel_initWithFloat_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithDouble_(double value) { + final _ret = _lib._objc_msgSend_207(_id, _lib._sel_initWithDouble_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithBool_(bool value) { + final _ret = _lib._objc_msgSend_208(_id, _lib._sel_initWithBool_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithInteger_(int value) { + final _ret = + _lib._objc_msgSend_202(_id, _lib._sel_initWithInteger_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithUnsignedInteger_(int value) { + final _ret = + _lib._objc_msgSend_203(_id, _lib._sel_initWithUnsignedInteger_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + int get charValue { + return _lib._objc_msgSend_209(_id, _lib._sel_charValue1); + } + + int get unsignedCharValue { + return _lib._objc_msgSend_210(_id, _lib._sel_unsignedCharValue1); + } + + int get shortValue { + return _lib._objc_msgSend_211(_id, _lib._sel_shortValue1); + } + + int get unsignedShortValue { + return _lib._objc_msgSend_212(_id, _lib._sel_unsignedShortValue1); + } + + int get intValue { + return _lib._objc_msgSend_213(_id, _lib._sel_intValue1); + } + + int get unsignedIntValue { + return _lib._objc_msgSend_191(_id, _lib._sel_unsignedIntValue1); + } + + int get longValue { + return _lib._objc_msgSend_78(_id, _lib._sel_longValue1); + } + + int get unsignedLongValue { + return _lib._objc_msgSend_10(_id, _lib._sel_unsignedLongValue1); + } + + int get longLongValue { + return _lib._objc_msgSend_214(_id, _lib._sel_longLongValue1); + } + + int get unsignedLongLongValue { + return _lib._objc_msgSend_148(_id, _lib._sel_unsignedLongLongValue1); + } + + double get floatValue { + return _lib._objc_msgSend_215(_id, _lib._sel_floatValue1); + } + + double get doubleValue { + return _lib._objc_msgSend_149(_id, _lib._sel_doubleValue1); + } + + bool get boolValue { + return _lib._objc_msgSend_12(_id, _lib._sel_boolValue1); + } + + int get integerValue { + return _lib._objc_msgSend_78(_id, _lib._sel_integerValue1); + } + + int get unsignedIntegerValue { + return _lib._objc_msgSend_10(_id, _lib._sel_unsignedIntegerValue1); + } + + NSString? get stringValue { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_stringValue1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int compare_(NSNumber? otherNumber) { + return _lib._objc_msgSend_216( + _id, _lib._sel_compare_1, otherNumber?._id ?? ffi.nullptr); + } + + bool isEqualToNumber_(NSNumber? number) { + return _lib._objc_msgSend_217( + _id, _lib._sel_isEqualToNumber_1, number?._id ?? ffi.nullptr); + } + + NSString descriptionWithLocale_(NSObject locale) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithChar_(AVFAudio _lib, int value) { + final _ret = _lib._objc_msgSend_196( + _lib._class_NSNumber1, _lib._sel_numberWithChar_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithUnsignedChar_(AVFAudio _lib, int value) { + final _ret = _lib._objc_msgSend_197( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedChar_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithShort_(AVFAudio _lib, int value) { + final _ret = _lib._objc_msgSend_198( + _lib._class_NSNumber1, _lib._sel_numberWithShort_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithUnsignedShort_(AVFAudio _lib, int value) { + final _ret = _lib._objc_msgSend_199( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedShort_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithInt_(AVFAudio _lib, int value) { + final _ret = _lib._objc_msgSend_200( + _lib._class_NSNumber1, _lib._sel_numberWithInt_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithUnsignedInt_(AVFAudio _lib, int value) { + final _ret = _lib._objc_msgSend_201( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInt_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithLong_(AVFAudio _lib, int value) { + final _ret = _lib._objc_msgSend_202( + _lib._class_NSNumber1, _lib._sel_numberWithLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithUnsignedLong_(AVFAudio _lib, int value) { + final _ret = _lib._objc_msgSend_203( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithLongLong_(AVFAudio _lib, int value) { + final _ret = _lib._objc_msgSend_204( + _lib._class_NSNumber1, _lib._sel_numberWithLongLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithUnsignedLongLong_(AVFAudio _lib, int value) { + final _ret = _lib._objc_msgSend_205( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLongLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithFloat_(AVFAudio _lib, double value) { + final _ret = _lib._objc_msgSend_206( + _lib._class_NSNumber1, _lib._sel_numberWithFloat_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithDouble_(AVFAudio _lib, double value) { + final _ret = _lib._objc_msgSend_207( + _lib._class_NSNumber1, _lib._sel_numberWithDouble_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithBool_(AVFAudio _lib, bool value) { + final _ret = _lib._objc_msgSend_208( + _lib._class_NSNumber1, _lib._sel_numberWithBool_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithInteger_(AVFAudio _lib, int value) { + final _ret = _lib._objc_msgSend_202( + _lib._class_NSNumber1, _lib._sel_numberWithInteger_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithUnsignedInteger_(AVFAudio _lib, int value) { + final _ret = _lib._objc_msgSend_203( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInteger_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithBytes_objCType_( + AVFAudio _lib, ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_43(_lib._class_NSNumber1, + _lib._sel_valueWithBytes_objCType_1, value, type); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue value_withObjCType_( + AVFAudio _lib, ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_43( + _lib._class_NSNumber1, _lib._sel_value_withObjCType_1, value, type); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithNonretainedObject_(AVFAudio _lib, NSObject anObject) { + final _ret = _lib._objc_msgSend_44(_lib._class_NSNumber1, + _lib._sel_valueWithNonretainedObject_1, anObject._id); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithPointer_( + AVFAudio _lib, ffi.Pointer pointer) { + final _ret = _lib._objc_msgSend_45( + _lib._class_NSNumber1, _lib._sel_valueWithPointer_1, pointer); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithRange_(AVFAudio _lib, NSRange range) { + final _ret = _lib._objc_msgSend_48( + _lib._class_NSNumber1, _lib._sel_valueWithRange_1, range); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithPoint_(AVFAudio _lib, NSPoint point) { + final _ret = _lib._objc_msgSend_50( + _lib._class_NSNumber1, _lib._sel_valueWithPoint_1, point); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithSize_(AVFAudio _lib, NSSize size) { + final _ret = _lib._objc_msgSend_51( + _lib._class_NSNumber1, _lib._sel_valueWithSize_1, size); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithRect_(AVFAudio _lib, NSRect rect) { + final _ret = _lib._objc_msgSend_52( + _lib._class_NSNumber1, _lib._sel_valueWithRect_1, rect); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithEdgeInsets_(AVFAudio _lib, NSEdgeInsets insets) { + final _ret = _lib._objc_msgSend_53( + _lib._class_NSNumber1, _lib._sel_valueWithEdgeInsets_1, insets); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSNumber new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSNumber1, _lib._sel_new1); + return NSNumber._(_ret, _lib, retain: false, release: true); + } + + static NSNumber alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSNumber1, _lib._sel_alloc1); + return NSNumber._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSNumber1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSNumber1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSNumber1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSNumber1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSNumber1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSNumber1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSNumber1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSNumber1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSNumber1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSValue extends NSObject { + NSValue._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSValue] that points to the same underlying object as [other]. + static NSValue castFrom(T other) { + return NSValue._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSValue] that wraps the given raw object pointer. + static NSValue castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSValue._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSValue]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSValue1); + } + + void getValue_size_(ffi.Pointer value, int size) { + return _lib._objc_msgSend_21(_id, _lib._sel_getValue_size_1, value, size); + } + + ffi.Pointer get objCType { + return _lib._objc_msgSend_13(_id, _lib._sel_objCType1); + } + + NSValue initWithBytes_objCType_( + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_41( + _id, _lib._sel_initWithBytes_objCType_1, value, type); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + NSValue initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithBytes_objCType_( + AVFAudio _lib, ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_43( + _lib._class_NSValue1, _lib._sel_valueWithBytes_objCType_1, value, type); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue value_withObjCType_( + AVFAudio _lib, ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_43( + _lib._class_NSValue1, _lib._sel_value_withObjCType_1, value, type); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithNonretainedObject_(AVFAudio _lib, NSObject anObject) { + final _ret = _lib._objc_msgSend_44(_lib._class_NSValue1, + _lib._sel_valueWithNonretainedObject_1, anObject._id); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + NSObject get nonretainedObjectValue { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_nonretainedObjectValue1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithPointer_( + AVFAudio _lib, ffi.Pointer pointer) { + final _ret = _lib._objc_msgSend_45( + _lib._class_NSValue1, _lib._sel_valueWithPointer_1, pointer); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + ffi.Pointer get pointerValue { + return _lib._objc_msgSend_19(_id, _lib._sel_pointerValue1); + } + + bool isEqualToValue_(NSValue? value) { + return _lib._objc_msgSend_46( + _id, _lib._sel_isEqualToValue_1, value?._id ?? ffi.nullptr); + } + + void getValue_(ffi.Pointer value) { + return _lib._objc_msgSend_47(_id, _lib._sel_getValue_1, value); + } + + static NSValue valueWithRange_(AVFAudio _lib, NSRange range) { + final _ret = _lib._objc_msgSend_48( + _lib._class_NSValue1, _lib._sel_valueWithRange_1, range); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + NSRange get rangeValue { + return _lib._objc_msgSend_49(_id, _lib._sel_rangeValue1); + } + + static NSValue valueWithPoint_(AVFAudio _lib, NSPoint point) { + final _ret = _lib._objc_msgSend_50( + _lib._class_NSValue1, _lib._sel_valueWithPoint_1, point); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithSize_(AVFAudio _lib, NSSize size) { + final _ret = _lib._objc_msgSend_51( + _lib._class_NSValue1, _lib._sel_valueWithSize_1, size); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithRect_(AVFAudio _lib, NSRect rect) { + final _ret = _lib._objc_msgSend_52( + _lib._class_NSValue1, _lib._sel_valueWithRect_1, rect); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithEdgeInsets_(AVFAudio _lib, NSEdgeInsets insets) { + final _ret = _lib._objc_msgSend_53( + _lib._class_NSValue1, _lib._sel_valueWithEdgeInsets_1, insets); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + NSPoint get pointValue { + return _lib._objc_msgSend_54(_id, _lib._sel_pointValue1); + } + + NSSize get sizeValue { + return _lib._objc_msgSend_55(_id, _lib._sel_sizeValue1); + } + + NSRect get rectValue { + return _lib._objc_msgSend_56(_id, _lib._sel_rectValue1); + } + + NSEdgeInsets get edgeInsetsValue { + return _lib._objc_msgSend_57(_id, _lib._sel_edgeInsetsValue1); + } + + static NSValue new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSValue1, _lib._sel_new1); + return NSValue._(_ret, _lib, retain: false, release: true); + } + + static NSValue alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSValue1, _lib._sel_alloc1); + return NSValue._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSValue1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSValue1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSValue1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSValue1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSValue1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSValue1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSValue1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSValue1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSValue1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSPoint = CGPoint; + +class CGPoint extends ffi.Struct { + @CGFloat() + external double x; + + @CGFloat() + external double y; +} + +typedef CGFloat = ffi.Double; +typedef NSSize = CGSize; + +class CGSize extends ffi.Struct { + @CGFloat() + external double width; + + @CGFloat() + external double height; +} + +typedef NSRect = CGRect; + +class CGRect extends ffi.Struct { + external CGPoint origin; + + external CGSize size; +} + +class NSEdgeInsets extends ffi.Struct { + @CGFloat() + external double top; + + @CGFloat() + external double left; + + @CGFloat() + external double bottom; + + @CGFloat() + external double right; +} + +class NSArray extends NSObject { + NSArray._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSArray] that points to the same underlying object as [other]. + static NSArray castFrom(T other) { + return NSArray._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSArray] that wraps the given raw object pointer. + static NSArray castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSArray._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSArray]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSArray1); + } + + int get count { + return _lib._objc_msgSend_10(_id, _lib._sel_count1); + } + + NSObject objectAtIndex_(int index) { + final _ret = _lib._objc_msgSend_60(_id, _lib._sel_objectAtIndex_1, index); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + @override + NSArray init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray initWithObjects_count_( + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61( + _id, _lib._sel_initWithObjects_count_1, objects, cnt); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray arrayByAddingObject_(NSObject anObject) { + final _ret = _lib._objc_msgSend_62( + _id, _lib._sel_arrayByAddingObject_1, anObject._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray arrayByAddingObjectsFromArray_(NSArray? otherArray) { + final _ret = _lib._objc_msgSend_63( + _id, + _lib._sel_arrayByAddingObjectsFromArray_1, + otherArray?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString componentsJoinedByString_(NSString? separator) { + final _ret = _lib._objc_msgSend_64(_id, + _lib._sel_componentsJoinedByString_1, separator?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool containsObject_(NSObject anObject) { + return _lib._objc_msgSend_0(_id, _lib._sel_containsObject_1, anObject._id); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_(NSObject locale) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_indent_(NSObject locale, int level) { + final _ret = _lib._objc_msgSend_66( + _id, _lib._sel_descriptionWithLocale_indent_1, locale._id, level); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSObject firstObjectCommonWithArray_(NSArray? otherArray) { + final _ret = _lib._objc_msgSend_67(_id, + _lib._sel_firstObjectCommonWithArray_1, otherArray?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void getObjects_range_( + ffi.Pointer> objects, NSRange range) { + return _lib._objc_msgSend_68( + _id, _lib._sel_getObjects_range_1, objects, range); + } + + int indexOfObject_(NSObject anObject) { + return _lib._objc_msgSend_69(_id, _lib._sel_indexOfObject_1, anObject._id); + } + + int indexOfObject_inRange_(NSObject anObject, NSRange range) { + return _lib._objc_msgSend_70( + _id, _lib._sel_indexOfObject_inRange_1, anObject._id, range); + } + + int indexOfObjectIdenticalTo_(NSObject anObject) { + return _lib._objc_msgSend_69( + _id, _lib._sel_indexOfObjectIdenticalTo_1, anObject._id); + } + + int indexOfObjectIdenticalTo_inRange_(NSObject anObject, NSRange range) { + return _lib._objc_msgSend_70( + _id, _lib._sel_indexOfObjectIdenticalTo_inRange_1, anObject._id, range); + } + + bool isEqualToArray_(NSArray? otherArray) { + return _lib._objc_msgSend_71( + _id, _lib._sel_isEqualToArray_1, otherArray?._id ?? ffi.nullptr); + } + + NSObject get firstObject { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_firstObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject get lastObject { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_lastObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSEnumerator objectEnumerator() { + final _ret = _lib._objc_msgSend_72(_id, _lib._sel_objectEnumerator1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + NSEnumerator reverseObjectEnumerator() { + final _ret = _lib._objc_msgSend_72(_id, _lib._sel_reverseObjectEnumerator1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + NSData? get sortedArrayHint { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_sortedArrayHint1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSArray sortedArrayUsingFunction_context_( + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + comparator, + ffi.Pointer context) { + final _ret = _lib._objc_msgSend_73( + _id, _lib._sel_sortedArrayUsingFunction_context_1, comparator, context); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray sortedArrayUsingFunction_context_hint_( + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + comparator, + ffi.Pointer context, + NSData? hint) { + final _ret = _lib._objc_msgSend_74( + _id, + _lib._sel_sortedArrayUsingFunction_context_hint_1, + comparator, + context, + hint?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray sortedArrayUsingSelector_(ffi.Pointer comparator) { + final _ret = _lib._objc_msgSend_75( + _id, _lib._sel_sortedArrayUsingSelector_1, comparator); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray subarrayWithRange_(NSRange range) { + final _ret = + _lib._objc_msgSend_76(_id, _lib._sel_subarrayWithRange_1, range); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + bool writeToURL_error_( + NSURL? url, ffi.Pointer> error) { + return _lib._objc_msgSend_81( + _id, _lib._sel_writeToURL_error_1, url?._id ?? ffi.nullptr, error); + } + + void makeObjectsPerformSelector_(ffi.Pointer aSelector) { + return _lib._objc_msgSend_7( + _id, _lib._sel_makeObjectsPerformSelector_1, aSelector); + } + + void makeObjectsPerformSelector_withObject_( + ffi.Pointer aSelector, NSObject argument) { + return _lib._objc_msgSend_82( + _id, + _lib._sel_makeObjectsPerformSelector_withObject_1, + aSelector, + argument._id); + } + + NSArray objectsAtIndexes_(NSIndexSet? indexes) { + final _ret = _lib._objc_msgSend_103( + _id, _lib._sel_objectsAtIndexes_1, indexes?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSObject objectAtIndexedSubscript_(int idx) { + final _ret = + _lib._objc_msgSend_60(_id, _lib._sel_objectAtIndexedSubscript_1, idx); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void enumerateObjectsUsingBlock_(ObjCBlock3 block) { + return _lib._objc_msgSend_104( + _id, _lib._sel_enumerateObjectsUsingBlock_1, block._impl); + } + + void enumerateObjectsWithOptions_usingBlock_(int opts, ObjCBlock3 block) { + return _lib._objc_msgSend_105(_id, + _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._impl); + } + + void enumerateObjectsAtIndexes_options_usingBlock_( + NSIndexSet? s, int opts, ObjCBlock3 block) { + return _lib._objc_msgSend_106( + _id, + _lib._sel_enumerateObjectsAtIndexes_options_usingBlock_1, + s?._id ?? ffi.nullptr, + opts, + block._impl); + } + + int indexOfObjectPassingTest_(ObjCBlock4 predicate) { + return _lib._objc_msgSend_107( + _id, _lib._sel_indexOfObjectPassingTest_1, predicate._impl); + } + + int indexOfObjectWithOptions_passingTest_(int opts, ObjCBlock4 predicate) { + return _lib._objc_msgSend_108( + _id, + _lib._sel_indexOfObjectWithOptions_passingTest_1, + opts, + predicate._impl); + } + + int indexOfObjectAtIndexes_options_passingTest_( + NSIndexSet? s, int opts, ObjCBlock4 predicate) { + return _lib._objc_msgSend_109( + _id, + _lib._sel_indexOfObjectAtIndexes_options_passingTest_1, + s?._id ?? ffi.nullptr, + opts, + predicate._impl); + } + + NSIndexSet indexesOfObjectsPassingTest_(ObjCBlock4 predicate) { + final _ret = _lib._objc_msgSend_110( + _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._impl); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet indexesOfObjectsWithOptions_passingTest_( + int opts, ObjCBlock4 predicate) { + final _ret = _lib._objc_msgSend_111( + _id, + _lib._sel_indexesOfObjectsWithOptions_passingTest_1, + opts, + predicate._impl); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet indexesOfObjectsAtIndexes_options_passingTest_( + NSIndexSet? s, int opts, ObjCBlock4 predicate) { + final _ret = _lib._objc_msgSend_112( + _id, + _lib._sel_indexesOfObjectsAtIndexes_options_passingTest_1, + s?._id ?? ffi.nullptr, + opts, + predicate._impl); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSArray sortedArrayUsingComparator_(NSComparator cmptr) { + final _ret = _lib._objc_msgSend_113( + _id, _lib._sel_sortedArrayUsingComparator_1, cmptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray sortedArrayWithOptions_usingComparator_( + int opts, NSComparator cmptr) { + final _ret = _lib._objc_msgSend_114( + _id, _lib._sel_sortedArrayWithOptions_usingComparator_1, opts, cmptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + int indexOfObject_inSortedRange_options_usingComparator_( + NSObject obj, NSRange r, int opts, NSComparator cmp) { + return _lib._objc_msgSend_115( + _id, + _lib._sel_indexOfObject_inSortedRange_options_usingComparator_1, + obj._id, + r, + opts, + cmp); + } + + static NSArray array(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSArray1, _lib._sel_array1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray arrayWithObject_(AVFAudio _lib, NSObject anObject) { + final _ret = _lib._objc_msgSend_16( + _lib._class_NSArray1, _lib._sel_arrayWithObject_1, anObject._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray arrayWithObjects_count_( + AVFAudio _lib, ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61( + _lib._class_NSArray1, _lib._sel_arrayWithObjects_count_1, objects, cnt); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray arrayWithObjects_(AVFAudio _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_16( + _lib._class_NSArray1, _lib._sel_arrayWithObjects_1, firstObj._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray arrayWithArray_(AVFAudio _lib, NSArray? array) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSArray1, + _lib._sel_arrayWithArray_1, array?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray initWithObjects_(NSObject firstObj) { + final _ret = + _lib._objc_msgSend_16(_id, _lib._sel_initWithObjects_1, firstObj._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray initWithArray_(NSArray? array) { + final _ret = _lib._objc_msgSend_67( + _id, _lib._sel_initWithArray_1, array?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray initWithArray_copyItems_(NSArray? array, bool flag) { + final _ret = _lib._objc_msgSend_116(_id, + _lib._sel_initWithArray_copyItems_1, array?._id ?? ffi.nullptr, flag); + return NSArray._(_ret, _lib, retain: false, release: true); + } + + NSArray initWithContentsOfURL_error_( + NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_117( + _id, + _lib._sel_initWithContentsOfURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray arrayWithContentsOfURL_error_( + AVFAudio _lib, NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_117( + _lib._class_NSArray1, + _lib._sel_arrayWithContentsOfURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void getObjects_(ffi.Pointer> objects) { + return _lib._objc_msgSend_118(_id, _lib._sel_getObjects_1, objects); + } + + static NSArray arrayWithContentsOfFile_(AVFAudio _lib, NSString? path) { + final _ret = _lib._objc_msgSend_119(_lib._class_NSArray1, + _lib._sel_arrayWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray arrayWithContentsOfURL_(AVFAudio _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_120(_lib._class_NSArray1, + _lib._sel_arrayWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray initWithContentsOfFile_(NSString? path) { + final _ret = _lib._objc_msgSend_119( + _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_120( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + bool writeToFile_atomically_(NSString? path, bool useAuxiliaryFile) { + return _lib._objc_msgSend_25(_id, _lib._sel_writeToFile_atomically_1, + path?._id ?? ffi.nullptr, useAuxiliaryFile); + } + + bool writeToURL_atomically_(NSURL? url, bool atomically) { + return _lib._objc_msgSend_121(_id, _lib._sel_writeToURL_atomically_1, + url?._id ?? ffi.nullptr, atomically); + } + + NSArray pathsMatchingExtensions_(NSArray? filterTypes) { + final _ret = _lib._objc_msgSend_63(_id, _lib._sel_pathsMatchingExtensions_1, + filterTypes?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + @override + NSObject valueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_valueForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + @override + void setValue_forKey_(NSObject value, NSString? key) { + return _lib._objc_msgSend_122( + _id, _lib._sel_setValue_forKey_1, value._id, key?._id ?? ffi.nullptr); + } + + void addObserver_toObjectsAtIndexes_forKeyPath_options_context_( + NSObject? observer, + NSIndexSet? indexes, + NSString? keyPath, + int options, + ffi.Pointer context) { + return _lib._objc_msgSend_123( + _id, + _lib._sel_addObserver_toObjectsAtIndexes_forKeyPath_options_context_1, + observer?._id ?? ffi.nullptr, + indexes?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + options, + context); + } + + void removeObserver_fromObjectsAtIndexes_forKeyPath_context_( + NSObject? observer, + NSIndexSet? indexes, + NSString? keyPath, + ffi.Pointer context) { + return _lib._objc_msgSend_124( + _id, + _lib._sel_removeObserver_fromObjectsAtIndexes_forKeyPath_context_1, + observer?._id ?? ffi.nullptr, + indexes?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + context); + } + + void removeObserver_fromObjectsAtIndexes_forKeyPath_( + NSObject? observer, NSIndexSet? indexes, NSString? keyPath) { + return _lib._objc_msgSend_125( + _id, + _lib._sel_removeObserver_fromObjectsAtIndexes_forKeyPath_1, + observer?._id ?? ffi.nullptr, + indexes?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr); + } + + @override + void addObserver_forKeyPath_options_context_(NSObject? observer, + NSString? keyPath, int options, ffi.Pointer context) { + return _lib._objc_msgSend_126( + _id, + _lib._sel_addObserver_forKeyPath_options_context_1, + observer?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + options, + context); + } + + @override + void removeObserver_forKeyPath_context_( + NSObject? observer, NSString? keyPath, ffi.Pointer context) { + return _lib._objc_msgSend_127( + _id, + _lib._sel_removeObserver_forKeyPath_context_1, + observer?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + context); + } + + @override + void removeObserver_forKeyPath_(NSObject? observer, NSString? keyPath) { + return _lib._objc_msgSend_128(_id, _lib._sel_removeObserver_forKeyPath_1, + observer?._id ?? ffi.nullptr, keyPath?._id ?? ffi.nullptr); + } + + NSArray sortedArrayUsingDescriptors_(NSArray? sortDescriptors) { + final _ret = _lib._objc_msgSend_63( + _id, + _lib._sel_sortedArrayUsingDescriptors_1, + sortDescriptors?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray filteredArrayUsingPredicate_(NSPredicate? predicate) { + final _ret = _lib._objc_msgSend_195(_id, + _lib._sel_filteredArrayUsingPredicate_1, predicate?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSArray1, _lib._sel_new1); + return NSArray._(_ret, _lib, retain: false, release: true); + } + + static NSArray alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSArray1, _lib._sel_alloc1); + return NSArray._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSArray1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSArray1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSArray1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSArray1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSArray1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSArray1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSArray1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSArray1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSArray1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSInteger = ffi.Long; + +class NSError extends NSObject { + NSError._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSError] that points to the same underlying object as [other]. + static NSError castFrom(T other) { + return NSError._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSError] that wraps the given raw object pointer. + static NSError castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSError._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSError]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSError1); + } + + NSError initWithDomain_code_userInfo_(NSErrorDomain domain, int code) { + final _ret = _lib._objc_msgSend_77( + _id, _lib._sel_initWithDomain_code_userInfo_1, domain, code); + return NSError._(_ret, _lib, retain: true, release: true); + } + + static NSError errorWithDomain_code_userInfo_( + AVFAudio _lib, NSErrorDomain domain, int code) { + final _ret = _lib._objc_msgSend_77(_lib._class_NSError1, + _lib._sel_errorWithDomain_code_userInfo_1, domain, code); + return NSError._(_ret, _lib, retain: true, release: true); + } + + NSErrorDomain get domain { + return _lib._objc_msgSend_20(_id, _lib._sel_domain1); + } + + int get code { + return _lib._objc_msgSend_78(_id, _lib._sel_code1); + } + + static NSError new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSError1, _lib._sel_new1); + return NSError._(_ret, _lib, retain: false, release: true); + } + + static NSError alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSError1, _lib._sel_alloc1); + return NSError._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSError1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSError1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSError1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSError1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSError1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSError1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSError1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSError1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSError1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSErrorDomain = ffi.Pointer; + +class NSIndexSet extends NSObject { + NSIndexSet._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSIndexSet] that points to the same underlying object as [other]. + static NSIndexSet castFrom(T other) { + return NSIndexSet._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSIndexSet] that wraps the given raw object pointer. + static NSIndexSet castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSIndexSet._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSIndexSet]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSIndexSet1); + } + + static NSIndexSet indexSet(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSIndexSet1, _lib._sel_indexSet1); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + static NSIndexSet indexSetWithIndex_(AVFAudio _lib, int value) { + final _ret = _lib._objc_msgSend_60( + _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndex_1, value); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + static NSIndexSet indexSetWithIndexesInRange_(AVFAudio _lib, NSRange range) { + final _ret = _lib._objc_msgSend_83( + _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndexesInRange_1, range); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet initWithIndexesInRange_(NSRange range) { + final _ret = + _lib._objc_msgSend_83(_id, _lib._sel_initWithIndexesInRange_1, range); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet initWithIndexSet_(NSIndexSet? indexSet) { + final _ret = _lib._objc_msgSend_84( + _id, _lib._sel_initWithIndexSet_1, indexSet?._id ?? ffi.nullptr); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet initWithIndex_(int value) { + final _ret = _lib._objc_msgSend_60(_id, _lib._sel_initWithIndex_1, value); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + bool isEqualToIndexSet_(NSIndexSet? indexSet) { + return _lib._objc_msgSend_85( + _id, _lib._sel_isEqualToIndexSet_1, indexSet?._id ?? ffi.nullptr); + } + + int get count { + return _lib._objc_msgSend_10(_id, _lib._sel_count1); + } + + int get firstIndex { + return _lib._objc_msgSend_10(_id, _lib._sel_firstIndex1); + } + + int get lastIndex { + return _lib._objc_msgSend_10(_id, _lib._sel_lastIndex1); + } + + int indexGreaterThanIndex_(int value) { + return _lib._objc_msgSend_86(_id, _lib._sel_indexGreaterThanIndex_1, value); + } + + int indexLessThanIndex_(int value) { + return _lib._objc_msgSend_86(_id, _lib._sel_indexLessThanIndex_1, value); + } + + int indexGreaterThanOrEqualToIndex_(int value) { + return _lib._objc_msgSend_86( + _id, _lib._sel_indexGreaterThanOrEqualToIndex_1, value); + } + + int indexLessThanOrEqualToIndex_(int value) { + return _lib._objc_msgSend_86( + _id, _lib._sel_indexLessThanOrEqualToIndex_1, value); + } + + int getIndexes_maxCount_inIndexRange_(ffi.Pointer indexBuffer, + int bufferSize, NSRangePointer range) { + return _lib._objc_msgSend_87( + _id, + _lib._sel_getIndexes_maxCount_inIndexRange_1, + indexBuffer, + bufferSize, + range); + } + + int countOfIndexesInRange_(NSRange range) { + return _lib._objc_msgSend_88(_id, _lib._sel_countOfIndexesInRange_1, range); + } + + bool containsIndex_(int value) { + return _lib._objc_msgSend_89(_id, _lib._sel_containsIndex_1, value); + } + + bool containsIndexesInRange_(NSRange range) { + return _lib._objc_msgSend_90( + _id, _lib._sel_containsIndexesInRange_1, range); + } + + bool containsIndexes_(NSIndexSet? indexSet) { + return _lib._objc_msgSend_85( + _id, _lib._sel_containsIndexes_1, indexSet?._id ?? ffi.nullptr); + } + + bool intersectsIndexesInRange_(NSRange range) { + return _lib._objc_msgSend_90( + _id, _lib._sel_intersectsIndexesInRange_1, range); + } + + void enumerateIndexesUsingBlock_(ObjCBlock block) { + return _lib._objc_msgSend_91( + _id, _lib._sel_enumerateIndexesUsingBlock_1, block._impl); + } + + void enumerateIndexesWithOptions_usingBlock_(int opts, ObjCBlock block) { + return _lib._objc_msgSend_92(_id, + _lib._sel_enumerateIndexesWithOptions_usingBlock_1, opts, block._impl); + } + + void enumerateIndexesInRange_options_usingBlock_( + NSRange range, int opts, ObjCBlock block) { + return _lib._objc_msgSend_93( + _id, + _lib._sel_enumerateIndexesInRange_options_usingBlock_1, + range, + opts, + block._impl); + } + + int indexPassingTest_(ObjCBlock1 predicate) { + return _lib._objc_msgSend_94( + _id, _lib._sel_indexPassingTest_1, predicate._impl); + } + + int indexWithOptions_passingTest_(int opts, ObjCBlock1 predicate) { + return _lib._objc_msgSend_95( + _id, _lib._sel_indexWithOptions_passingTest_1, opts, predicate._impl); + } + + int indexInRange_options_passingTest_( + NSRange range, int opts, ObjCBlock1 predicate) { + return _lib._objc_msgSend_96( + _id, + _lib._sel_indexInRange_options_passingTest_1, + range, + opts, + predicate._impl); + } + + NSIndexSet indexesPassingTest_(ObjCBlock1 predicate) { + final _ret = _lib._objc_msgSend_97( + _id, _lib._sel_indexesPassingTest_1, predicate._impl); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet indexesWithOptions_passingTest_(int opts, ObjCBlock1 predicate) { + final _ret = _lib._objc_msgSend_98( + _id, _lib._sel_indexesWithOptions_passingTest_1, opts, predicate._impl); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet indexesInRange_options_passingTest_( + NSRange range, int opts, ObjCBlock1 predicate) { + final _ret = _lib._objc_msgSend_99( + _id, + _lib._sel_indexesInRange_options_passingTest_1, + range, + opts, + predicate._impl); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + void enumerateRangesUsingBlock_(ObjCBlock2 block) { + return _lib._objc_msgSend_100( + _id, _lib._sel_enumerateRangesUsingBlock_1, block._impl); + } + + void enumerateRangesWithOptions_usingBlock_(int opts, ObjCBlock2 block) { + return _lib._objc_msgSend_101(_id, + _lib._sel_enumerateRangesWithOptions_usingBlock_1, opts, block._impl); + } + + void enumerateRangesInRange_options_usingBlock_( + NSRange range, int opts, ObjCBlock2 block) { + return _lib._objc_msgSend_102( + _id, + _lib._sel_enumerateRangesInRange_options_usingBlock_1, + range, + opts, + block._impl); + } + + static NSIndexSet new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSIndexSet1, _lib._sel_new1); + return NSIndexSet._(_ret, _lib, retain: false, release: true); + } + + static NSIndexSet alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSIndexSet1, _lib._sel_alloc1); + return NSIndexSet._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSIndexSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSIndexSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSIndexSet1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSIndexSet1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSIndexSet1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSIndexSet1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSIndexSet1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSIndexSet1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSIndexSet1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSRangePointer = ffi.Pointer; +void _ObjCBlock_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(NSUInteger arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function(int arg0, ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock_closureRegistry = {}; +int _ObjCBlock_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_registerClosure(Function fn) { + final id = ++_ObjCBlock_closureRegistryIndex; + _ObjCBlock_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) { + return _ObjCBlock_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock._(this._impl, this._lib); + ObjCBlock.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + NSUInteger arg0, ffi.Pointer arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + NSUInteger arg0, + ffi.Pointer arg1)>(_ObjCBlock_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock.fromFunction( + this._lib, void Function(int arg0, ffi.Pointer arg1) fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + NSUInteger arg0, ffi.Pointer arg1)>( + _ObjCBlock_closureTrampoline) + .cast(), + _ObjCBlock_registerClosure(fn)); + void call(int arg0, ffi.Pointer arg1) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + NSUInteger arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, int arg0, + ffi.Pointer arg1)>()(_impl, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class _ObjCBlockDesc extends ffi.Struct { + @ffi.UnsignedLong() + external int reserved; + + @ffi.UnsignedLong() + external int size; + + external ffi.Pointer copy_helper; + + external ffi.Pointer dispose_helper; + + external ffi.Pointer signature; +} + +class _ObjCBlock extends ffi.Struct { + external ffi.Pointer isa; + + @ffi.Int() + external int flags; + + @ffi.Int() + external int reserved; + + external ffi.Pointer invoke; + + external ffi.Pointer<_ObjCBlockDesc> descriptor; + + external ffi.Pointer target; +} + +abstract class NSEnumerationOptions { + static const int NSEnumerationConcurrent = 1; + static const int NSEnumerationReverse = 2; +} + +bool _ObjCBlock1_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function(NSUInteger arg0, ffi.Pointer arg1)>>() + .asFunction< + bool Function(int arg0, ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock1_closureRegistry = {}; +int _ObjCBlock1_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock1_registerClosure(Function fn) { + final id = ++_ObjCBlock1_closureRegistryIndex; + _ObjCBlock1_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +bool _ObjCBlock1_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) { + return _ObjCBlock1_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock1 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock1._(this._impl, this._lib); + ObjCBlock1.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + NSUInteger arg0, ffi.Pointer arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function(ffi.Pointer<_ObjCBlock> block, + NSUInteger arg0, ffi.Pointer arg1)>( + _ObjCBlock1_fnPtrTrampoline, false) + .cast(), + ptr.cast()); + ObjCBlock1.fromFunction( + this._lib, bool Function(int arg0, ffi.Pointer arg1) fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function(ffi.Pointer<_ObjCBlock> block, + NSUInteger arg0, ffi.Pointer arg1)>( + _ObjCBlock1_closureTrampoline, false) + .cast(), + _ObjCBlock1_registerClosure(fn)); + bool call(int arg0, ffi.Pointer arg1) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer<_ObjCBlock> block, + NSUInteger arg0, ffi.Pointer arg1)>>() + .asFunction< + bool Function(ffi.Pointer<_ObjCBlock> block, int arg0, + ffi.Pointer arg1)>()(_impl, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +void _ObjCBlock2_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, NSRange arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(NSRange arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function( + NSRange arg0, ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock2_closureRegistry = {}; +int _ObjCBlock2_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock2_registerClosure(Function fn) { + final id = ++_ObjCBlock2_closureRegistryIndex; + _ObjCBlock2_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock2_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, NSRange arg0, ffi.Pointer arg1) { + return _ObjCBlock2_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock2 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock2._(this._impl, this._lib); + ObjCBlock2.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(NSRange arg0, ffi.Pointer arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + NSRange arg0, ffi.Pointer arg1)>( + _ObjCBlock2_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock2.fromFunction( + this._lib, void Function(NSRange arg0, ffi.Pointer arg1) fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + NSRange arg0, ffi.Pointer arg1)>( + _ObjCBlock2_closureTrampoline) + .cast(), + _ObjCBlock2_registerClosure(fn)); + void call(NSRange arg0, ffi.Pointer arg1) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, NSRange arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, NSRange arg0, + ffi.Pointer arg1)>()(_impl, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +void _ObjCBlock3_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSUInteger arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock3_closureRegistry = {}; +int _ObjCBlock3_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock3_registerClosure(Function fn) { + final id = ++_ObjCBlock3_closureRegistryIndex; + _ObjCBlock3_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock3_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return _ObjCBlock3_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock3 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock3._(this._impl, this._lib); + ObjCBlock3.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + NSUInteger arg1, ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>( + _ObjCBlock3_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock3.fromFunction( + this._lib, + void Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>( + _ObjCBlock3_closureTrampoline) + .cast(), + _ObjCBlock3_registerClosure(fn)); + void call( + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +bool _ObjCBlock4_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, NSUInteger arg1, + ffi.Pointer arg2)>>() + .asFunction< + bool Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock4_closureRegistry = {}; +int _ObjCBlock4_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock4_registerClosure(Function fn) { + final id = ++_ObjCBlock4_closureRegistryIndex; + _ObjCBlock4_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +bool _ObjCBlock4_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return _ObjCBlock4_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock4 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock4._(this._impl, this._lib); + ObjCBlock4.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + NSUInteger arg1, ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>( + _ObjCBlock4_fnPtrTrampoline, false) + .cast(), + ptr.cast()); + ObjCBlock4.fromFunction( + this._lib, + bool Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>( + _ObjCBlock4_closureTrampoline, false) + .cast(), + _ObjCBlock4_registerClosure(fn)); + bool call( + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>>() + .asFunction< + bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +typedef NSComparator = ffi.Pointer<_ObjCBlock>; +int _ObjCBlock5_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + int Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock5_closureRegistry = {}; +int _ObjCBlock5_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock5_registerClosure(Function fn) { + final id = ++_ObjCBlock5_closureRegistryIndex; + _ObjCBlock5_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +int _ObjCBlock5_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return _ObjCBlock5_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock5 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock5._(this._impl, this._lib); + ObjCBlock5.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Int32 Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock5_fnPtrTrampoline, 0) + .cast(), + ptr.cast()); + ObjCBlock5.fromFunction( + this._lib, + int Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Int32 Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock5_closureTrampoline, 0) + .cast(), + _ObjCBlock5_registerClosure(fn)); + int call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + int Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_impl, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +abstract class NSComparisonResult { + static const int NSOrderedAscending = -1; + static const int NSOrderedSame = 0; + static const int NSOrderedDescending = 1; +} + +abstract class NSSortOptions { + static const int NSSortConcurrent = 1; + static const int NSSortStable = 16; +} + +abstract class NSBinarySearchingOptions { + static const int NSBinarySearchingFirstEqual = 256; + static const int NSBinarySearchingLastEqual = 512; + static const int NSBinarySearchingInsertionIndex = 1024; +} + +abstract class NSKeyValueObservingOptions { + static const int NSKeyValueObservingOptionNew = 1; + static const int NSKeyValueObservingOptionOld = 2; + static const int NSKeyValueObservingOptionInitial = 4; + static const int NSKeyValueObservingOptionPrior = 8; +} + +class NSPredicate extends NSObject { + NSPredicate._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSPredicate] that points to the same underlying object as [other]. + static NSPredicate castFrom(T other) { + return NSPredicate._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSPredicate] that wraps the given raw object pointer. + static NSPredicate castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSPredicate._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSPredicate]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSPredicate1); + } + + static NSPredicate predicateWithFormat_argumentArray_( + AVFAudio _lib, NSString? predicateFormat, NSArray? arguments) { + final _ret = _lib._objc_msgSend_129( + _lib._class_NSPredicate1, + _lib._sel_predicateWithFormat_argumentArray_1, + predicateFormat?._id ?? ffi.nullptr, + arguments?._id ?? ffi.nullptr); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + static NSPredicate predicateWithFormat_( + AVFAudio _lib, NSString? predicateFormat) { + final _ret = _lib._objc_msgSend_130(_lib._class_NSPredicate1, + _lib._sel_predicateWithFormat_1, predicateFormat?._id ?? ffi.nullptr); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + static NSPredicate predicateWithFormat_arguments_(AVFAudio _lib, + NSString? predicateFormat, ffi.Pointer<__va_list_tag> argList) { + final _ret = _lib._objc_msgSend_131( + _lib._class_NSPredicate1, + _lib._sel_predicateWithFormat_arguments_1, + predicateFormat?._id ?? ffi.nullptr, + argList); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + static NSPredicate predicateFromMetadataQueryString_( + AVFAudio _lib, NSString? queryString) { + final _ret = _lib._objc_msgSend_130( + _lib._class_NSPredicate1, + _lib._sel_predicateFromMetadataQueryString_1, + queryString?._id ?? ffi.nullptr); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + static NSPredicate predicateWithValue_(AVFAudio _lib, bool value) { + final _ret = _lib._objc_msgSend_132( + _lib._class_NSPredicate1, _lib._sel_predicateWithValue_1, value); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + static NSPredicate predicateWithBlock_(AVFAudio _lib, ObjCBlock6 block) { + final _ret = _lib._objc_msgSend_193( + _lib._class_NSPredicate1, _lib._sel_predicateWithBlock_1, block._impl); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + NSString? get predicateFormat { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_predicateFormat1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSPredicate predicateWithSubstitutionVariables_(NSDictionary? variables) { + final _ret = _lib._objc_msgSend_143( + _id, + _lib._sel_predicateWithSubstitutionVariables_1, + variables?._id ?? ffi.nullptr); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + bool evaluateWithObject_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_evaluateWithObject_1, object._id); + } + + bool evaluateWithObject_substitutionVariables_( + NSObject object, NSDictionary? bindings) { + return _lib._objc_msgSend_194( + _id, + _lib._sel_evaluateWithObject_substitutionVariables_1, + object._id, + bindings?._id ?? ffi.nullptr); + } + + void allowEvaluation() { + return _lib._objc_msgSend_1(_id, _lib._sel_allowEvaluation1); + } + + static NSPredicate new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSPredicate1, _lib._sel_new1); + return NSPredicate._(_ret, _lib, retain: false, release: true); + } + + static NSPredicate alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPredicate1, _lib._sel_alloc1); + return NSPredicate._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSPredicate1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSPredicate1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPredicate1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPredicate1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSPredicate1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSPredicate1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSPredicate1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSPredicate1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPredicate1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class __va_list_tag extends ffi.Struct { + @ffi.UnsignedInt() + external int gp_offset; + + @ffi.UnsignedInt() + external int fp_offset; + + external ffi.Pointer overflow_arg_area; + + external ffi.Pointer reg_save_area; +} + +bool _ObjCBlock6_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock6_closureRegistry = {}; +int _ObjCBlock6_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock6_registerClosure(Function fn) { + final id = ++_ObjCBlock6_closureRegistryIndex; + _ObjCBlock6_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +bool _ObjCBlock6_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return _ObjCBlock6_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock6 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock6._(this._impl, this._lib); + ObjCBlock6.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock6_fnPtrTrampoline, false) + .cast(), + ptr.cast()); + ObjCBlock6.fromFunction( + this._lib, + bool Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock6_closureTrampoline, false) + .cast(), + _ObjCBlock6_registerClosure(fn)); + bool call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_impl, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class NSDictionary extends NSObject { + NSDictionary._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSDictionary] that points to the same underlying object as [other]. + static NSDictionary castFrom(T other) { + return NSDictionary._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSDictionary] that wraps the given raw object pointer. + static NSDictionary castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSDictionary._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSDictionary]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSDictionary1); + } + + int get count { + return _lib._objc_msgSend_10(_id, _lib._sel_count1); + } + + NSObject objectForKey_(NSObject aKey) { + final _ret = _lib._objc_msgSend_16(_id, _lib._sel_objectForKey_1, aKey._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSEnumerator keyEnumerator() { + final _ret = _lib._objc_msgSend_72(_id, _lib._sel_keyEnumerator1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + @override + NSDictionary init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithObjects_forKeys_count_( + ffi.Pointer> objects, + ffi.Pointer> keys, + int cnt) { + final _ret = _lib._objc_msgSend_133( + _id, _lib._sel_initWithObjects_forKeys_count_1, objects, keys, cnt); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSArray? get allKeys { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_allKeys1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray allKeysForObject_(NSObject anObject) { + final _ret = + _lib._objc_msgSend_62(_id, _lib._sel_allKeysForObject_1, anObject._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get allValues { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_allValues1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get descriptionInStringsFileFormat { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_descriptionInStringsFileFormat1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_(NSObject locale) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_indent_(NSObject locale, int level) { + final _ret = _lib._objc_msgSend_66( + _id, _lib._sel_descriptionWithLocale_indent_1, locale._id, level); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool isEqualToDictionary_(NSDictionary? otherDictionary) { + return _lib._objc_msgSend_134(_id, _lib._sel_isEqualToDictionary_1, + otherDictionary?._id ?? ffi.nullptr); + } + + NSEnumerator objectEnumerator() { + final _ret = _lib._objc_msgSend_72(_id, _lib._sel_objectEnumerator1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + NSArray objectsForKeys_notFoundMarker_(NSArray? keys, NSObject marker) { + final _ret = _lib._objc_msgSend_135( + _id, + _lib._sel_objectsForKeys_notFoundMarker_1, + keys?._id ?? ffi.nullptr, + marker._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + bool writeToURL_error_( + NSURL? url, ffi.Pointer> error) { + return _lib._objc_msgSend_81( + _id, _lib._sel_writeToURL_error_1, url?._id ?? ffi.nullptr, error); + } + + NSArray keysSortedByValueUsingSelector_(ffi.Pointer comparator) { + final _ret = _lib._objc_msgSend_75( + _id, _lib._sel_keysSortedByValueUsingSelector_1, comparator); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void getObjects_andKeys_count_(ffi.Pointer> objects, + ffi.Pointer> keys, int count) { + return _lib._objc_msgSend_136( + _id, _lib._sel_getObjects_andKeys_count_1, objects, keys, count); + } + + NSObject objectForKeyedSubscript_(NSObject key) { + final _ret = _lib._objc_msgSend_16( + _id, _lib._sel_objectForKeyedSubscript_1, key._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void enumerateKeysAndObjectsUsingBlock_(ObjCBlock7 block) { + return _lib._objc_msgSend_137( + _id, _lib._sel_enumerateKeysAndObjectsUsingBlock_1, block._impl); + } + + void enumerateKeysAndObjectsWithOptions_usingBlock_( + int opts, ObjCBlock7 block) { + return _lib._objc_msgSend_138( + _id, + _lib._sel_enumerateKeysAndObjectsWithOptions_usingBlock_1, + opts, + block._impl); + } + + NSArray keysSortedByValueUsingComparator_(NSComparator cmptr) { + final _ret = _lib._objc_msgSend_113( + _id, _lib._sel_keysSortedByValueUsingComparator_1, cmptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray keysSortedByValueWithOptions_usingComparator_( + int opts, NSComparator cmptr) { + final _ret = _lib._objc_msgSend_114(_id, + _lib._sel_keysSortedByValueWithOptions_usingComparator_1, opts, cmptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void getObjects_andKeys_(ffi.Pointer> objects, + ffi.Pointer> keys) { + return _lib._objc_msgSend_139( + _id, _lib._sel_getObjects_andKeys_1, objects, keys); + } + + static NSDictionary dictionaryWithContentsOfFile_( + AVFAudio _lib, NSString? path) { + final _ret = _lib._objc_msgSend_140(_lib._class_NSDictionary1, + _lib._sel_dictionaryWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithContentsOfURL_(AVFAudio _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_141(_lib._class_NSDictionary1, + _lib._sel_dictionaryWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithContentsOfFile_(NSString? path) { + final _ret = _lib._objc_msgSend_140( + _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_141( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + bool writeToFile_atomically_(NSString? path, bool useAuxiliaryFile) { + return _lib._objc_msgSend_25(_id, _lib._sel_writeToFile_atomically_1, + path?._id ?? ffi.nullptr, useAuxiliaryFile); + } + + bool writeToURL_atomically_(NSURL? url, bool atomically) { + return _lib._objc_msgSend_121(_id, _lib._sel_writeToURL_atomically_1, + url?._id ?? ffi.nullptr, atomically); + } + + static NSDictionary dictionary(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDictionary1, _lib._sel_dictionary1); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithObject_forKey_( + AVFAudio _lib, NSObject object, NSObject key) { + final _ret = _lib._objc_msgSend_142(_lib._class_NSDictionary1, + _lib._sel_dictionaryWithObject_forKey_1, object._id, key._id); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithObjects_forKeys_count_( + AVFAudio _lib, + ffi.Pointer> objects, + ffi.Pointer> keys, + int cnt) { + final _ret = _lib._objc_msgSend_133(_lib._class_NSDictionary1, + _lib._sel_dictionaryWithObjects_forKeys_count_1, objects, keys, cnt); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithObjectsAndKeys_( + AVFAudio _lib, NSObject firstObject) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSDictionary1, + _lib._sel_dictionaryWithObjectsAndKeys_1, firstObject._id); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithDictionary_( + AVFAudio _lib, NSDictionary? dict) { + final _ret = _lib._objc_msgSend_143(_lib._class_NSDictionary1, + _lib._sel_dictionaryWithDictionary_1, dict?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithObjects_forKeys_( + AVFAudio _lib, NSArray? objects, NSArray? keys) { + final _ret = _lib._objc_msgSend_144( + _lib._class_NSDictionary1, + _lib._sel_dictionaryWithObjects_forKeys_1, + objects?._id ?? ffi.nullptr, + keys?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithObjectsAndKeys_(NSObject firstObject) { + final _ret = _lib._objc_msgSend_16( + _id, _lib._sel_initWithObjectsAndKeys_1, firstObject._id); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithDictionary_(NSDictionary? otherDictionary) { + final _ret = _lib._objc_msgSend_143(_id, _lib._sel_initWithDictionary_1, + otherDictionary?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithDictionary_copyItems_( + NSDictionary? otherDictionary, bool flag) { + final _ret = _lib._objc_msgSend_145( + _id, + _lib._sel_initWithDictionary_copyItems_1, + otherDictionary?._id ?? ffi.nullptr, + flag); + return NSDictionary._(_ret, _lib, retain: false, release: true); + } + + NSDictionary initWithObjects_forKeys_(NSArray? objects, NSArray? keys) { + final _ret = _lib._objc_msgSend_144( + _id, + _lib._sel_initWithObjects_forKeys_1, + objects?._id ?? ffi.nullptr, + keys?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithContentsOfURL_error_( + NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_146( + _id, + _lib._sel_initWithContentsOfURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithContentsOfURL_error_( + AVFAudio _lib, NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_146( + _lib._class_NSDictionary1, + _lib._sel_dictionaryWithContentsOfURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSObject sharedKeySetForKeys_(AVFAudio _lib, NSArray? keys) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSDictionary1, + _lib._sel_sharedKeySetForKeys_1, keys?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + int countByEnumeratingWithState_objects_count_( + ffi.Pointer state, + ffi.Pointer> buffer, + int len) { + return _lib._objc_msgSend_147( + _id, + _lib._sel_countByEnumeratingWithState_objects_count_1, + state, + buffer, + len); + } + + int fileSize() { + return _lib._objc_msgSend_148(_id, _lib._sel_fileSize1); + } + + NSDate fileModificationDate() { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_fileModificationDate1); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSString fileType() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_fileType1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + int filePosixPermissions() { + return _lib._objc_msgSend_10(_id, _lib._sel_filePosixPermissions1); + } + + NSString fileOwnerAccountName() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_fileOwnerAccountName1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString fileGroupOwnerAccountName() { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_fileGroupOwnerAccountName1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + int fileSystemNumber() { + return _lib._objc_msgSend_78(_id, _lib._sel_fileSystemNumber1); + } + + int fileSystemFileNumber() { + return _lib._objc_msgSend_10(_id, _lib._sel_fileSystemFileNumber1); + } + + bool fileExtensionHidden() { + return _lib._objc_msgSend_12(_id, _lib._sel_fileExtensionHidden1); + } + + int fileHFSCreatorCode() { + return _lib._objc_msgSend_191(_id, _lib._sel_fileHFSCreatorCode1); + } + + int fileHFSTypeCode() { + return _lib._objc_msgSend_191(_id, _lib._sel_fileHFSTypeCode1); + } + + bool fileIsImmutable() { + return _lib._objc_msgSend_12(_id, _lib._sel_fileIsImmutable1); + } + + bool fileIsAppendOnly() { + return _lib._objc_msgSend_12(_id, _lib._sel_fileIsAppendOnly1); + } + + NSDate fileCreationDate() { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_fileCreationDate1); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSNumber fileOwnerAccountID() { + final _ret = _lib._objc_msgSend_192(_id, _lib._sel_fileOwnerAccountID1); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber fileGroupOwnerAccountID() { + final _ret = + _lib._objc_msgSend_192(_id, _lib._sel_fileGroupOwnerAccountID1); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + @override + NSObject valueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_valueForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDictionary1, _lib._sel_new1); + return NSDictionary._(_ret, _lib, retain: false, release: true); + } + + static NSDictionary alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDictionary1, _lib._sel_alloc1); + return NSDictionary._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSDictionary1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSDictionary1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSDictionary1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSDictionary1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSDictionary1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSDictionary1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSDictionary1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSDictionary1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSDictionary1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock7_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1, ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock7_closureRegistry = {}; +int _ObjCBlock7_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock7_registerClosure(Function fn) { + final id = ++_ObjCBlock7_closureRegistryIndex; + _ObjCBlock7_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock7_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return _ObjCBlock7_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock7 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock7._(this._impl, this._lib); + ObjCBlock7.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock7_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock7.fromFunction( + this._lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock7_closureTrampoline) + .cast(), + _ObjCBlock7_registerClosure(fn)); + void call(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class NSFastEnumerationState extends ffi.Struct { + @ffi.UnsignedLong() + external int state; + + external ffi.Pointer> itemsPtr; + + external ffi.Pointer mutationsPtr; + + @ffi.Array.multi([5]) + external ffi.Array extra; +} + +class NSDate extends NSObject { + NSDate._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSDate] that points to the same underlying object as [other]. + static NSDate castFrom(T other) { + return NSDate._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSDate] that wraps the given raw object pointer. + static NSDate castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSDate._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSDate]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSDate1); + } + + double get timeIntervalSinceReferenceDate { + return _lib._objc_msgSend_149( + _id, _lib._sel_timeIntervalSinceReferenceDate1); + } + + @override + NSDate init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate initWithTimeIntervalSinceReferenceDate_(double ti) { + final _ret = _lib._objc_msgSend_150( + _id, _lib._sel_initWithTimeIntervalSinceReferenceDate_1, ti); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + double timeIntervalSinceDate_(NSDate? anotherDate) { + return _lib._objc_msgSend_151(_id, _lib._sel_timeIntervalSinceDate_1, + anotherDate?._id ?? ffi.nullptr); + } + + double get timeIntervalSinceNow { + return _lib._objc_msgSend_149(_id, _lib._sel_timeIntervalSinceNow1); + } + + double get timeIntervalSince1970 { + return _lib._objc_msgSend_149(_id, _lib._sel_timeIntervalSince19701); + } + + NSObject addTimeInterval_(double seconds) { + final _ret = + _lib._objc_msgSend_150(_id, _lib._sel_addTimeInterval_1, seconds); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSDate dateByAddingTimeInterval_(double ti) { + final _ret = + _lib._objc_msgSend_150(_id, _lib._sel_dateByAddingTimeInterval_1, ti); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate earlierDate_(NSDate? anotherDate) { + final _ret = _lib._objc_msgSend_152( + _id, _lib._sel_earlierDate_1, anotherDate?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate laterDate_(NSDate? anotherDate) { + final _ret = _lib._objc_msgSend_152( + _id, _lib._sel_laterDate_1, anotherDate?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + int compare_(NSDate? other) { + return _lib._objc_msgSend_153( + _id, _lib._sel_compare_1, other?._id ?? ffi.nullptr); + } + + bool isEqualToDate_(NSDate? otherDate) { + return _lib._objc_msgSend_154( + _id, _lib._sel_isEqualToDate_1, otherDate?._id ?? ffi.nullptr); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_(NSObject locale) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSDate date(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSDate1, _lib._sel_date1); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate dateWithTimeIntervalSinceNow_(AVFAudio _lib, double secs) { + final _ret = _lib._objc_msgSend_150( + _lib._class_NSDate1, _lib._sel_dateWithTimeIntervalSinceNow_1, secs); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate dateWithTimeIntervalSinceReferenceDate_( + AVFAudio _lib, double ti) { + final _ret = _lib._objc_msgSend_150(_lib._class_NSDate1, + _lib._sel_dateWithTimeIntervalSinceReferenceDate_1, ti); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate dateWithTimeIntervalSince1970_(AVFAudio _lib, double secs) { + final _ret = _lib._objc_msgSend_150( + _lib._class_NSDate1, _lib._sel_dateWithTimeIntervalSince1970_1, secs); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate dateWithTimeInterval_sinceDate_( + AVFAudio _lib, double secsToBeAdded, NSDate? date) { + final _ret = _lib._objc_msgSend_155( + _lib._class_NSDate1, + _lib._sel_dateWithTimeInterval_sinceDate_1, + secsToBeAdded, + date?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate? getDistantFuture(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_156(_lib._class_NSDate1, _lib._sel_distantFuture1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate? getDistantPast(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_156(_lib._class_NSDate1, _lib._sel_distantPast1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate? getNow(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_156(_lib._class_NSDate1, _lib._sel_now1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate initWithTimeIntervalSinceNow_(double secs) { + final _ret = _lib._objc_msgSend_150( + _id, _lib._sel_initWithTimeIntervalSinceNow_1, secs); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate initWithTimeIntervalSince1970_(double secs) { + final _ret = _lib._objc_msgSend_150( + _id, _lib._sel_initWithTimeIntervalSince1970_1, secs); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate initWithTimeInterval_sinceDate_(double secsToBeAdded, NSDate? date) { + final _ret = _lib._objc_msgSend_155( + _id, + _lib._sel_initWithTimeInterval_sinceDate_1, + secsToBeAdded, + date?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithNaturalLanguageString_locale_( + AVFAudio _lib, NSString? string, NSObject locale) { + final _ret = _lib._objc_msgSend_157( + _lib._class_NSDate1, + _lib._sel_dateWithNaturalLanguageString_locale_1, + string?._id ?? ffi.nullptr, + locale._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithNaturalLanguageString_( + AVFAudio _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSDate1, + _lib._sel_dateWithNaturalLanguageString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithString_(AVFAudio _lib, NSString? aString) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSDate1, + _lib._sel_dateWithString_1, aString?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSCalendarDate dateWithCalendarFormat_timeZone_( + NSString? format, NSTimeZone? aTimeZone) { + final _ret = _lib._objc_msgSend_189( + _id, + _lib._sel_dateWithCalendarFormat_timeZone_1, + format?._id ?? ffi.nullptr, + aTimeZone?._id ?? ffi.nullptr); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithCalendarFormat_timeZone_locale_( + NSString? format, NSTimeZone? aTimeZone, NSObject locale) { + final _ret = _lib._objc_msgSend_190( + _id, + _lib._sel_descriptionWithCalendarFormat_timeZone_locale_1, + format?._id ?? ffi.nullptr, + aTimeZone?._id ?? ffi.nullptr, + locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithString_(NSString? description) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, description?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSDate new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSDate1, _lib._sel_new1); + return NSDate._(_ret, _lib, retain: false, release: true); + } + + static NSDate alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSDate1, _lib._sel_alloc1); + return NSDate._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSDate1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSDate1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSDate1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSDate1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSDate1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSDate1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSDate1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSDate1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSDate1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSTimeInterval = ffi.Double; + +class NSCalendarDate extends NSDate { + NSCalendarDate._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSCalendarDate] that points to the same underlying object as [other]. + static NSCalendarDate castFrom(T other) { + return NSCalendarDate._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSCalendarDate] that wraps the given raw object pointer. + static NSCalendarDate castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSCalendarDate._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSCalendarDate]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSCalendarDate1); + } + + static NSObject calendarDate(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSCalendarDate1, _lib._sel_calendarDate1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithString_calendarFormat_locale_( + AVFAudio _lib, NSString? description, NSString? format, NSObject locale) { + final _ret = _lib._objc_msgSend_158( + _lib._class_NSCalendarDate1, + _lib._sel_dateWithString_calendarFormat_locale_1, + description?._id ?? ffi.nullptr, + format?._id ?? ffi.nullptr, + locale._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithString_calendarFormat_( + AVFAudio _lib, NSString? description, NSString? format) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSCalendarDate1, + _lib._sel_dateWithString_calendarFormat_1, + description?._id ?? ffi.nullptr, + format?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithYear_month_day_hour_minute_second_timeZone_( + AVFAudio _lib, + int year, + int month, + int day, + int hour, + int minute, + int second, + NSTimeZone? aTimeZone) { + final _ret = _lib._objc_msgSend_184( + _lib._class_NSCalendarDate1, + _lib._sel_dateWithYear_month_day_hour_minute_second_timeZone_1, + year, + month, + day, + hour, + minute, + second, + aTimeZone?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSCalendarDate dateByAddingYears_months_days_hours_minutes_seconds_( + int year, int month, int day, int hour, int minute, int second) { + final _ret = _lib._objc_msgSend_185( + _id, + _lib._sel_dateByAddingYears_months_days_hours_minutes_seconds_1, + year, + month, + day, + hour, + minute, + second); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + int dayOfCommonEra() { + return _lib._objc_msgSend_78(_id, _lib._sel_dayOfCommonEra1); + } + + int dayOfMonth() { + return _lib._objc_msgSend_78(_id, _lib._sel_dayOfMonth1); + } + + int dayOfWeek() { + return _lib._objc_msgSend_78(_id, _lib._sel_dayOfWeek1); + } + + int dayOfYear() { + return _lib._objc_msgSend_78(_id, _lib._sel_dayOfYear1); + } + + int hourOfDay() { + return _lib._objc_msgSend_78(_id, _lib._sel_hourOfDay1); + } + + int minuteOfHour() { + return _lib._objc_msgSend_78(_id, _lib._sel_minuteOfHour1); + } + + int monthOfYear() { + return _lib._objc_msgSend_78(_id, _lib._sel_monthOfYear1); + } + + int secondOfMinute() { + return _lib._objc_msgSend_78(_id, _lib._sel_secondOfMinute1); + } + + int yearOfCommonEra() { + return _lib._objc_msgSend_78(_id, _lib._sel_yearOfCommonEra1); + } + + NSString calendarFormat() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_calendarFormat1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithCalendarFormat_locale_( + NSString? format, NSObject locale) { + final _ret = _lib._objc_msgSend_167( + _id, + _lib._sel_descriptionWithCalendarFormat_locale_1, + format?._id ?? ffi.nullptr, + locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithCalendarFormat_(NSString? format) { + final _ret = _lib._objc_msgSend_64(_id, + _lib._sel_descriptionWithCalendarFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + @override + NSString descriptionWithLocale_(NSObject locale) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSTimeZone timeZone() { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_timeZone1); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithString_calendarFormat_locale_( + NSString? description, NSString? format, NSObject locale) { + final _ret = _lib._objc_msgSend_158( + _id, + _lib._sel_initWithString_calendarFormat_locale_1, + description?._id ?? ffi.nullptr, + format?._id ?? ffi.nullptr, + locale._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithString_calendarFormat_( + NSString? description, NSString? format) { + final _ret = _lib._objc_msgSend_159( + _id, + _lib._sel_initWithString_calendarFormat_1, + description?._id ?? ffi.nullptr, + format?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + @override + NSObject initWithString_(NSString? description) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, description?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithYear_month_day_hour_minute_second_timeZone_( + int year, + int month, + int day, + int hour, + int minute, + int second, + NSTimeZone? aTimeZone) { + final _ret = _lib._objc_msgSend_184( + _id, + _lib._sel_initWithYear_month_day_hour_minute_second_timeZone_1, + year, + month, + day, + hour, + minute, + second, + aTimeZone?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void setCalendarFormat_(NSString? format) { + return _lib._objc_msgSend_186( + _id, _lib._sel_setCalendarFormat_1, format?._id ?? ffi.nullptr); + } + + void setTimeZone_(NSTimeZone? aTimeZone) { + return _lib._objc_msgSend_187( + _id, _lib._sel_setTimeZone_1, aTimeZone?._id ?? ffi.nullptr); + } + + void years_months_days_hours_minutes_seconds_sinceDate_( + ffi.Pointer yp, + ffi.Pointer mop, + ffi.Pointer dp, + ffi.Pointer hp, + ffi.Pointer mip, + ffi.Pointer sp, + NSCalendarDate? date) { + return _lib._objc_msgSend_188( + _id, + _lib._sel_years_months_days_hours_minutes_seconds_sinceDate_1, + yp, + mop, + dp, + hp, + mip, + sp, + date?._id ?? ffi.nullptr); + } + + static NSDate? getDistantFuture(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_156( + _lib._class_NSCalendarDate1, _lib._sel_distantFuture1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate? getDistantPast(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_156( + _lib._class_NSCalendarDate1, _lib._sel_distantPast1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSCalendarDate date(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSCalendarDate1, _lib._sel_date1); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + static NSCalendarDate dateWithTimeIntervalSinceNow_( + AVFAudio _lib, double secs) { + final _ret = _lib._objc_msgSend_150(_lib._class_NSCalendarDate1, + _lib._sel_dateWithTimeIntervalSinceNow_1, secs); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + static NSCalendarDate dateWithTimeIntervalSinceReferenceDate_( + AVFAudio _lib, double ti) { + final _ret = _lib._objc_msgSend_150(_lib._class_NSCalendarDate1, + _lib._sel_dateWithTimeIntervalSinceReferenceDate_1, ti); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + static NSCalendarDate dateWithTimeIntervalSince1970_( + AVFAudio _lib, double secs) { + final _ret = _lib._objc_msgSend_150(_lib._class_NSCalendarDate1, + _lib._sel_dateWithTimeIntervalSince1970_1, secs); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + static NSCalendarDate dateWithTimeInterval_sinceDate_( + AVFAudio _lib, double secsToBeAdded, NSDate? date) { + final _ret = _lib._objc_msgSend_155( + _lib._class_NSCalendarDate1, + _lib._sel_dateWithTimeInterval_sinceDate_1, + secsToBeAdded, + date?._id ?? ffi.nullptr); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate? getNow(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_156(_lib._class_NSCalendarDate1, _lib._sel_now1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithNaturalLanguageString_locale_( + AVFAudio _lib, NSString? string, NSObject locale) { + final _ret = _lib._objc_msgSend_157( + _lib._class_NSCalendarDate1, + _lib._sel_dateWithNaturalLanguageString_locale_1, + string?._id ?? ffi.nullptr, + locale._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithNaturalLanguageString_( + AVFAudio _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSCalendarDate1, + _lib._sel_dateWithNaturalLanguageString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithString_(AVFAudio _lib, NSString? aString) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSCalendarDate1, + _lib._sel_dateWithString_1, aString?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSCalendarDate new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSCalendarDate1, _lib._sel_new1); + return NSCalendarDate._(_ret, _lib, retain: false, release: true); + } + + static NSCalendarDate alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSCalendarDate1, _lib._sel_alloc1); + return NSCalendarDate._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSCalendarDate1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSCalendarDate1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSCalendarDate1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSCalendarDate1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSCalendarDate1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSCalendarDate1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSCalendarDate1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSCalendarDate1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSCalendarDate1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSTimeZone extends NSObject { + NSTimeZone._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSTimeZone] that points to the same underlying object as [other]. + static NSTimeZone castFrom(T other) { + return NSTimeZone._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSTimeZone] that wraps the given raw object pointer. + static NSTimeZone castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSTimeZone._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSTimeZone]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSTimeZone1); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSData? get data { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_data1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + int secondsFromGMTForDate_(NSDate? aDate) { + return _lib._objc_msgSend_160( + _id, _lib._sel_secondsFromGMTForDate_1, aDate?._id ?? ffi.nullptr); + } + + NSString abbreviationForDate_(NSDate? aDate) { + final _ret = _lib._objc_msgSend_161( + _id, _lib._sel_abbreviationForDate_1, aDate?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool isDaylightSavingTimeForDate_(NSDate? aDate) { + return _lib._objc_msgSend_154(_id, _lib._sel_isDaylightSavingTimeForDate_1, + aDate?._id ?? ffi.nullptr); + } + + double daylightSavingTimeOffsetForDate_(NSDate? aDate) { + return _lib._objc_msgSend_151(_id, + _lib._sel_daylightSavingTimeOffsetForDate_1, aDate?._id ?? ffi.nullptr); + } + + NSDate nextDaylightSavingTimeTransitionAfterDate_(NSDate? aDate) { + final _ret = _lib._objc_msgSend_152( + _id, + _lib._sel_nextDaylightSavingTimeTransitionAfterDate_1, + aDate?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSTimeZone? getSystemTimeZone(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_162( + _lib._class_NSTimeZone1, _lib._sel_systemTimeZone1); + return _ret.address == 0 + ? null + : NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + static void resetSystemTimeZone(AVFAudio _lib) { + return _lib._objc_msgSend_1( + _lib._class_NSTimeZone1, _lib._sel_resetSystemTimeZone1); + } + + static NSTimeZone? getDefaultTimeZone(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_162( + _lib._class_NSTimeZone1, _lib._sel_defaultTimeZone1); + return _ret.address == 0 + ? null + : NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + static void setDefaultTimeZone(AVFAudio _lib, NSTimeZone? value) { + _lib._objc_msgSend_163(_lib._class_NSTimeZone1, + _lib._sel_setDefaultTimeZone_1, value?._id ?? ffi.nullptr); + } + + static NSTimeZone? getLocalTimeZone(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_162( + _lib._class_NSTimeZone1, _lib._sel_localTimeZone1); + return _ret.address == 0 + ? null + : NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getKnownTimeZoneNames(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSTimeZone1, _lib._sel_knownTimeZoneNames1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary? getAbbreviationDictionary(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_164( + _lib._class_NSTimeZone1, _lib._sel_abbreviationDictionary1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static void setAbbreviationDictionary(AVFAudio _lib, NSDictionary? value) { + _lib._objc_msgSend_165(_lib._class_NSTimeZone1, + _lib._sel_setAbbreviationDictionary_1, value?._id ?? ffi.nullptr); + } + + static NSString? getTimeZoneDataVersion(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_20( + _lib._class_NSTimeZone1, _lib._sel_timeZoneDataVersion1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get secondsFromGMT { + return _lib._objc_msgSend_78(_id, _lib._sel_secondsFromGMT1); + } + + NSString? get abbreviation { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_abbreviation1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool get daylightSavingTime { + return _lib._objc_msgSend_12(_id, _lib._sel_isDaylightSavingTime1); + } + + double get daylightSavingTimeOffset { + return _lib._objc_msgSend_149(_id, _lib._sel_daylightSavingTimeOffset1); + } + + NSDate? get nextDaylightSavingTimeTransition { + final _ret = _lib._objc_msgSend_156( + _id, _lib._sel_nextDaylightSavingTimeTransition1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool isEqualToTimeZone_(NSTimeZone? aTimeZone) { + return _lib._objc_msgSend_166( + _id, _lib._sel_isEqualToTimeZone_1, aTimeZone?._id ?? ffi.nullptr); + } + + NSString localizedName_locale_(int style, NSLocale? locale) { + final _ret = _lib._objc_msgSend_181(_id, _lib._sel_localizedName_locale_1, + style, locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSTimeZone timeZoneWithName_(AVFAudio _lib, NSString? tzName) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSTimeZone1, + _lib._sel_timeZoneWithName_1, tzName?._id ?? ffi.nullptr); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + static NSTimeZone timeZoneWithName_data_( + AVFAudio _lib, NSString? tzName, NSData? aData) { + final _ret = _lib._objc_msgSend_182( + _lib._class_NSTimeZone1, + _lib._sel_timeZoneWithName_data_1, + tzName?._id ?? ffi.nullptr, + aData?._id ?? ffi.nullptr); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + NSTimeZone initWithName_(NSString? tzName) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithName_1, tzName?._id ?? ffi.nullptr); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + NSTimeZone initWithName_data_(NSString? tzName, NSData? aData) { + final _ret = _lib._objc_msgSend_182(_id, _lib._sel_initWithName_data_1, + tzName?._id ?? ffi.nullptr, aData?._id ?? ffi.nullptr); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + static NSTimeZone timeZoneForSecondsFromGMT_(AVFAudio _lib, int seconds) { + final _ret = _lib._objc_msgSend_183(_lib._class_NSTimeZone1, + _lib._sel_timeZoneForSecondsFromGMT_1, seconds); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + static NSTimeZone timeZoneWithAbbreviation_( + AVFAudio _lib, NSString? abbreviation) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSTimeZone1, + _lib._sel_timeZoneWithAbbreviation_1, abbreviation?._id ?? ffi.nullptr); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + static NSTimeZone new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSTimeZone1, _lib._sel_new1); + return NSTimeZone._(_ret, _lib, retain: false, release: true); + } + + static NSTimeZone alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSTimeZone1, _lib._sel_alloc1); + return NSTimeZone._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSTimeZone1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSTimeZone1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSTimeZone1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSTimeZone1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSTimeZone1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSTimeZone1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSTimeZone1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSTimeZone1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSTimeZone1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSTimeZoneNameStyle { + static const int NSTimeZoneNameStyleStandard = 0; + static const int NSTimeZoneNameStyleShortStandard = 1; + static const int NSTimeZoneNameStyleDaylightSaving = 2; + static const int NSTimeZoneNameStyleShortDaylightSaving = 3; + static const int NSTimeZoneNameStyleGeneric = 4; + static const int NSTimeZoneNameStyleShortGeneric = 5; +} + +class NSLocale extends NSObject { + NSLocale._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSLocale] that points to the same underlying object as [other]. + static NSLocale castFrom(T other) { + return NSLocale._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSLocale] that wraps the given raw object pointer. + static NSLocale castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSLocale._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSLocale]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSLocale1); + } + + NSObject objectForKey_(NSLocaleKey key) { + final _ret = _lib._objc_msgSend_30(_id, _lib._sel_objectForKey_1, key); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSString displayNameForKey_value_(NSLocaleKey key, NSObject value) { + final _ret = _lib._objc_msgSend_167( + _id, _lib._sel_displayNameForKey_value_1, key, value._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSLocale initWithLocaleIdentifier_(NSString? string) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithLocaleIdentifier_1, string?._id ?? ffi.nullptr); + return NSLocale._(_ret, _lib, retain: true, release: true); + } + + NSLocale initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSLocale._(_ret, _lib, retain: true, release: true); + } + + NSString? get localeIdentifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_localeIdentifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForLocaleIdentifier_(NSString? localeIdentifier) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForLocaleIdentifier_1, + localeIdentifier?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get languageCode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_languageCode1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForLanguageCode_(NSString? languageCode) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForLanguageCode_1, + languageCode?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get countryCode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_countryCode1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForCountryCode_(NSString? countryCode) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForCountryCode_1, + countryCode?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get scriptCode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_scriptCode1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForScriptCode_(NSString? scriptCode) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForScriptCode_1, + scriptCode?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get variantCode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_variantCode1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForVariantCode_(NSString? variantCode) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForVariantCode_1, + variantCode?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSCharacterSet? get exemplarCharacterSet { + final _ret = _lib._objc_msgSend_168(_id, _lib._sel_exemplarCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + NSString? get calendarIdentifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_calendarIdentifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForCalendarIdentifier_(NSString? calendarIdentifier) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForCalendarIdentifier_1, + calendarIdentifier?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get collationIdentifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_collationIdentifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForCollationIdentifier_( + NSString? collationIdentifier) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForCollationIdentifier_1, + collationIdentifier?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool get usesMetricSystem { + return _lib._objc_msgSend_12(_id, _lib._sel_usesMetricSystem1); + } + + NSString? get decimalSeparator { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_decimalSeparator1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get groupingSeparator { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_groupingSeparator1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get currencySymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_currencySymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get currencyCode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_currencyCode1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForCurrencyCode_(NSString? currencyCode) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForCurrencyCode_1, + currencyCode?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get collatorIdentifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_collatorIdentifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForCollatorIdentifier_(NSString? collatorIdentifier) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForCollatorIdentifier_1, + collatorIdentifier?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get quotationBeginDelimiter { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_quotationBeginDelimiter1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get quotationEndDelimiter { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_quotationEndDelimiter1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get alternateQuotationBeginDelimiter { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_alternateQuotationBeginDelimiter1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get alternateQuotationEndDelimiter { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_alternateQuotationEndDelimiter1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + static NSLocale? getAutoupdatingCurrentLocale(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_176( + _lib._class_NSLocale1, _lib._sel_autoupdatingCurrentLocale1); + return _ret.address == 0 + ? null + : NSLocale._(_ret, _lib, retain: true, release: true); + } + + static NSLocale? getCurrentLocale(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_176(_lib._class_NSLocale1, _lib._sel_currentLocale1); + return _ret.address == 0 + ? null + : NSLocale._(_ret, _lib, retain: true, release: true); + } + + static NSLocale? getSystemLocale(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_176(_lib._class_NSLocale1, _lib._sel_systemLocale1); + return _ret.address == 0 + ? null + : NSLocale._(_ret, _lib, retain: true, release: true); + } + + static NSLocale localeWithLocaleIdentifier_(AVFAudio _lib, NSString? ident) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSLocale1, + _lib._sel_localeWithLocaleIdentifier_1, ident?._id ?? ffi.nullptr); + return NSLocale._(_ret, _lib, retain: true, release: true); + } + + @override + NSLocale init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSLocale._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getAvailableLocaleIdentifiers(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSLocale1, _lib._sel_availableLocaleIdentifiers1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getISOLanguageCodes(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSLocale1, _lib._sel_ISOLanguageCodes1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getISOCountryCodes(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSLocale1, _lib._sel_ISOCountryCodes1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getISOCurrencyCodes(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSLocale1, _lib._sel_ISOCurrencyCodes1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getCommonISOCurrencyCodes(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSLocale1, _lib._sel_commonISOCurrencyCodes1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getPreferredLanguages(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSLocale1, _lib._sel_preferredLanguages1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary componentsFromLocaleIdentifier_( + AVFAudio _lib, NSString? string) { + final _ret = _lib._objc_msgSend_140(_lib._class_NSLocale1, + _lib._sel_componentsFromLocaleIdentifier_1, string?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSString localeIdentifierFromComponents_( + AVFAudio _lib, NSDictionary? dict) { + final _ret = _lib._objc_msgSend_177(_lib._class_NSLocale1, + _lib._sel_localeIdentifierFromComponents_1, dict?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString canonicalLocaleIdentifierFromString_( + AVFAudio _lib, NSString? string) { + final _ret = _lib._objc_msgSend_64( + _lib._class_NSLocale1, + _lib._sel_canonicalLocaleIdentifierFromString_1, + string?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString canonicalLanguageIdentifierFromString_( + AVFAudio _lib, NSString? string) { + final _ret = _lib._objc_msgSend_64( + _lib._class_NSLocale1, + _lib._sel_canonicalLanguageIdentifierFromString_1, + string?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString localeIdentifierFromWindowsLocaleCode_( + AVFAudio _lib, int lcid) { + final _ret = _lib._objc_msgSend_178(_lib._class_NSLocale1, + _lib._sel_localeIdentifierFromWindowsLocaleCode_1, lcid); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static int windowsLocaleCodeFromLocaleIdentifier_( + AVFAudio _lib, NSString? localeIdentifier) { + return _lib._objc_msgSend_179( + _lib._class_NSLocale1, + _lib._sel_windowsLocaleCodeFromLocaleIdentifier_1, + localeIdentifier?._id ?? ffi.nullptr); + } + + static int characterDirectionForLanguage_( + AVFAudio _lib, NSString? isoLangCode) { + return _lib._objc_msgSend_180( + _lib._class_NSLocale1, + _lib._sel_characterDirectionForLanguage_1, + isoLangCode?._id ?? ffi.nullptr); + } + + static int lineDirectionForLanguage_(AVFAudio _lib, NSString? isoLangCode) { + return _lib._objc_msgSend_180(_lib._class_NSLocale1, + _lib._sel_lineDirectionForLanguage_1, isoLangCode?._id ?? ffi.nullptr); + } + + static NSLocale new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSLocale1, _lib._sel_new1); + return NSLocale._(_ret, _lib, retain: false, release: true); + } + + static NSLocale alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSLocale1, _lib._sel_alloc1); + return NSLocale._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSLocale1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSLocale1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSLocale1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSLocale1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSLocale1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSLocale1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSLocale1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSLocale1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSLocale1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSLocaleKey = ffi.Pointer; + +class NSCharacterSet extends NSObject { + NSCharacterSet._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSCharacterSet] that points to the same underlying object as [other]. + static NSCharacterSet castFrom(T other) { + return NSCharacterSet._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSCharacterSet] that wraps the given raw object pointer. + static NSCharacterSet castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSCharacterSet._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSCharacterSet]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSCharacterSet1); + } + + static NSCharacterSet? getControlCharacterSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_controlCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getWhitespaceCharacterSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_whitespaceCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getWhitespaceAndNewlineCharacterSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_168(_lib._class_NSCharacterSet1, + _lib._sel_whitespaceAndNewlineCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getDecimalDigitCharacterSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_decimalDigitCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getLetterCharacterSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_letterCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getLowercaseLetterCharacterSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_lowercaseLetterCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getUppercaseLetterCharacterSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_uppercaseLetterCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getNonBaseCharacterSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_nonBaseCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getAlphanumericCharacterSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_alphanumericCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getDecomposableCharacterSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_decomposableCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getIllegalCharacterSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_illegalCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getPunctuationCharacterSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_punctuationCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getCapitalizedLetterCharacterSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_capitalizedLetterCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getSymbolCharacterSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_symbolCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getNewlineCharacterSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_newlineCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: false, release: true); + } + + static NSCharacterSet characterSetWithRange_(AVFAudio _lib, NSRange aRange) { + final _ret = _lib._objc_msgSend_169( + _lib._class_NSCharacterSet1, _lib._sel_characterSetWithRange_1, aRange); + return NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet characterSetWithCharactersInString_( + AVFAudio _lib, NSString? aString) { + final _ret = _lib._objc_msgSend_170( + _lib._class_NSCharacterSet1, + _lib._sel_characterSetWithCharactersInString_1, + aString?._id ?? ffi.nullptr); + return NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet characterSetWithBitmapRepresentation_( + AVFAudio _lib, NSData? data) { + final _ret = _lib._objc_msgSend_171( + _lib._class_NSCharacterSet1, + _lib._sel_characterSetWithBitmapRepresentation_1, + data?._id ?? ffi.nullptr); + return NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet characterSetWithContentsOfFile_( + AVFAudio _lib, NSString? fName) { + final _ret = _lib._objc_msgSend_170(_lib._class_NSCharacterSet1, + _lib._sel_characterSetWithContentsOfFile_1, fName?._id ?? ffi.nullptr); + return NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + NSCharacterSet initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + bool characterIsMember_(int aCharacter) { + return _lib._objc_msgSend_172( + _id, _lib._sel_characterIsMember_1, aCharacter); + } + + NSData? get bitmapRepresentation { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_bitmapRepresentation1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSCharacterSet? get invertedSet { + final _ret = _lib._objc_msgSend_168(_id, _lib._sel_invertedSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + bool longCharacterIsMember_(int theLongChar) { + return _lib._objc_msgSend_173( + _id, _lib._sel_longCharacterIsMember_1, theLongChar); + } + + bool isSupersetOfSet_(NSCharacterSet? theOtherSet) { + return _lib._objc_msgSend_174( + _id, _lib._sel_isSupersetOfSet_1, theOtherSet?._id ?? ffi.nullptr); + } + + bool hasMemberInPlane_(int thePlane) { + return _lib._objc_msgSend_175(_id, _lib._sel_hasMemberInPlane_1, thePlane); + } + + static NSCharacterSet? getURLUserAllowedCharacterSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_URLUserAllowedCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getURLPasswordAllowedCharacterSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_URLPasswordAllowedCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getURLHostAllowedCharacterSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_URLHostAllowedCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getURLPathAllowedCharacterSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_URLPathAllowedCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getURLQueryAllowedCharacterSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_URLQueryAllowedCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getURLFragmentAllowedCharacterSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_URLFragmentAllowedCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSCharacterSet1, _lib._sel_new1); + return NSCharacterSet._(_ret, _lib, retain: false, release: true); + } + + static NSCharacterSet alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSCharacterSet1, _lib._sel_alloc1); + return NSCharacterSet._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSCharacterSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSCharacterSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSCharacterSet1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSCharacterSet1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSCharacterSet1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSCharacterSet1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSCharacterSet1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSCharacterSet1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSCharacterSet1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef UTF32Char = UInt32; +typedef UInt32 = ffi.UnsignedInt; + +abstract class NSLocaleLanguageDirection { + static const int NSLocaleLanguageDirectionUnknown = 0; + static const int NSLocaleLanguageDirectionLeftToRight = 1; + static const int NSLocaleLanguageDirectionRightToLeft = 2; + static const int NSLocaleLanguageDirectionTopToBottom = 3; + static const int NSLocaleLanguageDirectionBottomToTop = 4; +} + +typedef OSType = FourCharCode; +typedef FourCharCode = UInt32; +typedef NSURLResourceKey = ffi.Pointer; + +class NSURLHandle extends NSObject { + NSURLHandle._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLHandle] that points to the same underlying object as [other]. + static NSURLHandle castFrom(T other) { + return NSURLHandle._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSURLHandle] that wraps the given raw object pointer. + static NSURLHandle castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLHandle._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLHandle]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLHandle1); + } + + static void registerURLHandleClass_( + AVFAudio _lib, NSObject anURLHandleSubclass) { + return _lib._objc_msgSend_15(_lib._class_NSURLHandle1, + _lib._sel_registerURLHandleClass_1, anURLHandleSubclass._id); + } + + static NSObject URLHandleClassForURL_(AVFAudio _lib, NSURL? anURL) { + final _ret = _lib._objc_msgSend_226(_lib._class_NSURLHandle1, + _lib._sel_URLHandleClassForURL_1, anURL?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + int status() { + return _lib._objc_msgSend_227(_id, _lib._sel_status1); + } + + NSString failureReason() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_failureReason1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + void addClient_(NSObject? client) { + return _lib._objc_msgSend_15( + _id, _lib._sel_addClient_1, client?._id ?? ffi.nullptr); + } + + void removeClient_(NSObject? client) { + return _lib._objc_msgSend_15( + _id, _lib._sel_removeClient_1, client?._id ?? ffi.nullptr); + } + + void loadInBackground() { + return _lib._objc_msgSend_1(_id, _lib._sel_loadInBackground1); + } + + void cancelLoadInBackground() { + return _lib._objc_msgSend_1(_id, _lib._sel_cancelLoadInBackground1); + } + + NSData resourceData() { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_resourceData1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData availableResourceData() { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_availableResourceData1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + int expectedResourceDataSize() { + return _lib._objc_msgSend_214(_id, _lib._sel_expectedResourceDataSize1); + } + + void flushCachedData() { + return _lib._objc_msgSend_1(_id, _lib._sel_flushCachedData1); + } + + void backgroundLoadDidFailWithReason_(NSString? reason) { + return _lib._objc_msgSend_186( + _id, + _lib._sel_backgroundLoadDidFailWithReason_1, + reason?._id ?? ffi.nullptr); + } + + void didLoadBytes_loadComplete_(NSData? newBytes, bool yorn) { + return _lib._objc_msgSend_228(_id, _lib._sel_didLoadBytes_loadComplete_1, + newBytes?._id ?? ffi.nullptr, yorn); + } + + static bool canInitWithURL_(AVFAudio _lib, NSURL? anURL) { + return _lib._objc_msgSend_229(_lib._class_NSURLHandle1, + _lib._sel_canInitWithURL_1, anURL?._id ?? ffi.nullptr); + } + + static NSURLHandle cachedHandleForURL_(AVFAudio _lib, NSURL? anURL) { + final _ret = _lib._objc_msgSend_230(_lib._class_NSURLHandle1, + _lib._sel_cachedHandleForURL_1, anURL?._id ?? ffi.nullptr); + return NSURLHandle._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithURL_cached_(NSURL? anURL, bool willCache) { + final _ret = _lib._objc_msgSend_231(_id, _lib._sel_initWithURL_cached_1, + anURL?._id ?? ffi.nullptr, willCache); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject propertyForKey_(NSString? propertyKey) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_propertyForKey_1, propertyKey?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject propertyForKeyIfAvailable_(NSString? propertyKey) { + final _ret = _lib._objc_msgSend_30(_id, + _lib._sel_propertyForKeyIfAvailable_1, propertyKey?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool writeProperty_forKey_(NSObject propertyValue, NSString? propertyKey) { + return _lib._objc_msgSend_225(_id, _lib._sel_writeProperty_forKey_1, + propertyValue._id, propertyKey?._id ?? ffi.nullptr); + } + + bool writeData_(NSData? data) { + return _lib._objc_msgSend_23( + _id, _lib._sel_writeData_1, data?._id ?? ffi.nullptr); + } + + NSData loadInForeground() { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_loadInForeground1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + void beginLoadInBackground() { + return _lib._objc_msgSend_1(_id, _lib._sel_beginLoadInBackground1); + } + + void endLoadInBackground() { + return _lib._objc_msgSend_1(_id, _lib._sel_endLoadInBackground1); + } + + static NSURLHandle new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLHandle1, _lib._sel_new1); + return NSURLHandle._(_ret, _lib, retain: false, release: true); + } + + static NSURLHandle alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLHandle1, _lib._sel_alloc1); + return NSURLHandle._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLHandle1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLHandle1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLHandle1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLHandle1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLHandle1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLHandle1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLHandle1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSURLHandle1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLHandle1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSURLHandleStatus { + static const int NSURLHandleNotLoaded = 0; + static const int NSURLHandleLoadSucceeded = 1; + static const int NSURLHandleLoadInProgress = 2; + static const int NSURLHandleLoadFailed = 3; +} + +abstract class NSDataWritingOptions { + static const int NSDataWritingAtomic = 1; + static const int NSDataWritingWithoutOverwriting = 2; + static const int NSDataWritingFileProtectionNone = 268435456; + static const int NSDataWritingFileProtectionComplete = 536870912; + static const int NSDataWritingFileProtectionCompleteUnlessOpen = 805306368; + static const int + NSDataWritingFileProtectionCompleteUntilFirstUserAuthentication = + 1073741824; + static const int NSDataWritingFileProtectionMask = 4026531840; + static const int NSAtomicWrite = 1; +} + +abstract class NSDataSearchOptions { + static const int NSDataSearchBackwards = 1; + static const int NSDataSearchAnchored = 2; +} + +void _ObjCBlock8_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock8_closureRegistry = {}; +int _ObjCBlock8_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock8_registerClosure(Function fn) { + final id = ++_ObjCBlock8_closureRegistryIndex; + _ObjCBlock8_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock8_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) { + return _ObjCBlock8_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock8 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock8._(this._impl, this._lib); + ObjCBlock8.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock8_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock8.fromFunction( + this._lib, + void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock8_closureTrampoline) + .cast(), + _ObjCBlock8_registerClosure(fn)); + void call( + ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +abstract class NSDataReadingOptions { + static const int NSDataReadingMappedIfSafe = 1; + static const int NSDataReadingUncached = 2; + static const int NSDataReadingMappedAlways = 8; + static const int NSDataReadingMapped = 1; + static const int NSMappedRead = 1; + static const int NSUncachedRead = 2; +} + +void _ObjCBlock9_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSUInteger arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, int arg1)>()(arg0, arg1); +} + +final _ObjCBlock9_closureRegistry = {}; +int _ObjCBlock9_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock9_registerClosure(Function fn) { + final id = ++_ObjCBlock9_closureRegistryIndex; + _ObjCBlock9_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock9_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) { + return _ObjCBlock9_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock9 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock9._(this._impl, this._lib); + ObjCBlock9.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, NSUInteger arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1)>(_ObjCBlock9_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock9.fromFunction( + this._lib, void Function(ffi.Pointer arg0, int arg1) fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1)>(_ObjCBlock9_closureTrampoline) + .cast(), + _ObjCBlock9_registerClosure(fn)); + void call(ffi.Pointer arg0, int arg1) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, NSUInteger arg1)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1)>()(_impl, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +abstract class NSDataBase64DecodingOptions { + static const int NSDataBase64DecodingIgnoreUnknownCharacters = 1; +} + +abstract class NSDataBase64EncodingOptions { + static const int NSDataBase64Encoding64CharacterLineLength = 1; + static const int NSDataBase64Encoding76CharacterLineLength = 2; + static const int NSDataBase64EncodingEndLineWithCarriageReturn = 16; + static const int NSDataBase64EncodingEndLineWithLineFeed = 32; +} + +abstract class NSDataCompressionAlgorithm { + static const int NSDataCompressionAlgorithmLZFSE = 0; + static const int NSDataCompressionAlgorithmLZ4 = 1; + static const int NSDataCompressionAlgorithmLZMA = 2; + static const int NSDataCompressionAlgorithmZlib = 3; +} + +typedef NSZone = _NSZone; + +abstract class NSDecodingFailurePolicy { + static const int NSDecodingFailurePolicyRaiseException = 0; + static const int NSDecodingFailurePolicySetErrorAndReturn = 1; +} + +abstract class NSStringCompareOptions { + static const int NSCaseInsensitiveSearch = 1; + static const int NSLiteralSearch = 2; + static const int NSBackwardsSearch = 4; + static const int NSAnchoredSearch = 8; + static const int NSNumericSearch = 64; + static const int NSDiacriticInsensitiveSearch = 128; + static const int NSWidthInsensitiveSearch = 256; + static const int NSForcedOrderingSearch = 512; + static const int NSRegularExpressionSearch = 1024; +} + +abstract class NSStringEnumerationOptions { + static const int NSStringEnumerationByLines = 0; + static const int NSStringEnumerationByParagraphs = 1; + static const int NSStringEnumerationByComposedCharacterSequences = 2; + static const int NSStringEnumerationByWords = 3; + static const int NSStringEnumerationBySentences = 4; + static const int NSStringEnumerationByCaretPositions = 5; + static const int NSStringEnumerationByDeletionClusters = 6; + static const int NSStringEnumerationReverse = 256; + static const int NSStringEnumerationSubstringNotRequired = 512; + static const int NSStringEnumerationLocalized = 1024; +} + +void _ObjCBlock10_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSRange arg1, + NSRange arg2, ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3)>()(arg0, arg1, arg2, arg3); +} + +final _ObjCBlock10_closureRegistry = {}; +int _ObjCBlock10_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock10_registerClosure(Function fn) { + final id = ++_ObjCBlock10_closureRegistryIndex; + _ObjCBlock10_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock10_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3) { + return _ObjCBlock10_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2, arg3); +} + +class ObjCBlock10 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock10._(this._impl, this._lib); + ObjCBlock10.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSRange arg1, + NSRange arg2, ffi.Pointer arg3)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3)>( + _ObjCBlock10_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock10.fromFunction( + this._lib, + void Function(ffi.Pointer arg0, NSRange arg1, NSRange arg2, + ffi.Pointer arg3) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3)>( + _ObjCBlock10_closureTrampoline) + .cast(), + _ObjCBlock10_registerClosure(fn)); + void call(ffi.Pointer arg0, NSRange arg1, NSRange arg2, + ffi.Pointer arg3) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3)>()(_impl, arg0, arg1, arg2, arg3); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +void _ObjCBlock11_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock11_closureRegistry = {}; +int _ObjCBlock11_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock11_registerClosure(Function fn) { + final id = ++_ObjCBlock11_closureRegistryIndex; + _ObjCBlock11_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock11_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return _ObjCBlock11_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock11 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock11._(this._impl, this._lib); + ObjCBlock11.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock11_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock11.fromFunction( + this._lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock11_closureTrampoline) + .cast(), + _ObjCBlock11_registerClosure(fn)); + void call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_impl, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +typedef NSStringEncoding = NSUInteger; + +abstract class NSStringEncodingConversionOptions { + static const int NSStringEncodingConversionAllowLossy = 1; + static const int NSStringEncodingConversionExternalRepresentation = 2; +} + +typedef NSStringTransform = ffi.Pointer; +void _ObjCBlock12_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSUInteger arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, int arg1)>()(arg0, arg1); +} + +final _ObjCBlock12_closureRegistry = {}; +int _ObjCBlock12_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock12_registerClosure(Function fn) { + final id = ++_ObjCBlock12_closureRegistryIndex; + _ObjCBlock12_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock12_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) { + return _ObjCBlock12_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock12 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock12._(this._impl, this._lib); + ObjCBlock12.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, NSUInteger arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1)>(_ObjCBlock12_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock12.fromFunction( + this._lib, void Function(ffi.Pointer arg0, int arg1) fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1)>(_ObjCBlock12_closureTrampoline) + .cast(), + _ObjCBlock12_registerClosure(fn)); + void call(ffi.Pointer arg0, int arg1) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, NSUInteger arg1)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1)>()(_impl, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +typedef NSLinguisticTagScheme = ffi.Pointer; + +abstract class NSLinguisticTaggerOptions { + static const int NSLinguisticTaggerOmitWords = 1; + static const int NSLinguisticTaggerOmitPunctuation = 2; + static const int NSLinguisticTaggerOmitWhitespace = 4; + static const int NSLinguisticTaggerOmitOther = 8; + static const int NSLinguisticTaggerJoinNames = 16; +} + +class NSOrthography extends NSObject { + NSOrthography._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSOrthography] that points to the same underlying object as [other]. + static NSOrthography castFrom(T other) { + return NSOrthography._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSOrthography] that wraps the given raw object pointer. + static NSOrthography castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSOrthography._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSOrthography]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSOrthography1); + } + + NSString? get dominantScript { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_dominantScript1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get languageMap { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_languageMap1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSOrthography initWithDominantScript_languageMap_( + NSString? script, NSDictionary? map) { + final _ret = _lib._objc_msgSend_352( + _id, + _lib._sel_initWithDominantScript_languageMap_1, + script?._id ?? ffi.nullptr, + map?._id ?? ffi.nullptr); + return NSOrthography._(_ret, _lib, retain: true, release: true); + } + + NSOrthography initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSOrthography._(_ret, _lib, retain: true, release: true); + } + + NSArray languagesForScript_(NSString? script) { + final _ret = _lib._objc_msgSend_119( + _id, _lib._sel_languagesForScript_1, script?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString dominantLanguageForScript_(NSString? script) { + final _ret = _lib._objc_msgSend_64( + _id, _lib._sel_dominantLanguageForScript_1, script?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get dominantLanguage { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_dominantLanguage1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get allScripts { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_allScripts1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get allLanguages { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_allLanguages1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSOrthography defaultOrthographyForLanguage_( + AVFAudio _lib, NSString? language) { + final _ret = _lib._objc_msgSend_30( + _lib._class_NSOrthography1, + _lib._sel_defaultOrthographyForLanguage_1, + language?._id ?? ffi.nullptr); + return NSOrthography._(_ret, _lib, retain: true, release: true); + } + + static NSOrthography orthographyWithDominantScript_languageMap_( + AVFAudio _lib, NSString? script, NSDictionary? map) { + final _ret = _lib._objc_msgSend_352( + _lib._class_NSOrthography1, + _lib._sel_orthographyWithDominantScript_languageMap_1, + script?._id ?? ffi.nullptr, + map?._id ?? ffi.nullptr); + return NSOrthography._(_ret, _lib, retain: true, release: true); + } + + static NSOrthography new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOrthography1, _lib._sel_new1); + return NSOrthography._(_ret, _lib, retain: false, release: true); + } + + static NSOrthography alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOrthography1, _lib._sel_alloc1); + return NSOrthography._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSOrthography1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSOrthography1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOrthography1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOrthography1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSOrthography1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSOrthography1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSOrthography1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSOrthography1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSOrthography1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock13_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock13_closureRegistry = {}; +int _ObjCBlock13_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock13_registerClosure(Function fn) { + final id = ++_ObjCBlock13_closureRegistryIndex; + _ObjCBlock13_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock13_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return _ObjCBlock13_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock13 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock13._(this._impl, this._lib); + ObjCBlock13.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock13_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock13.fromFunction( + this._lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock13_closureTrampoline) + .cast(), + _ObjCBlock13_registerClosure(fn)); + void call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_impl, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +bool _ObjCBlock14_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer arg0, ffi.Pointer arg1)>>() + .asFunction< + bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock14_closureRegistry = {}; +int _ObjCBlock14_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock14_registerClosure(Function fn) { + final id = ++_ObjCBlock14_closureRegistryIndex; + _ObjCBlock14_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +bool _ObjCBlock14_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return _ObjCBlock14_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock14 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock14._(this._impl, this._lib); + ObjCBlock14.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock14_fnPtrTrampoline, false) + .cast(), + ptr.cast()); + ObjCBlock14.fromFunction( + this._lib, + bool Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock14_closureTrampoline, false) + .cast(), + _ObjCBlock14_registerClosure(fn)); + bool call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_impl, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class NSFileManager extends NSObject { + NSFileManager._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSFileManager] that points to the same underlying object as [other]. + static NSFileManager castFrom(T other) { + return NSFileManager._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSFileManager] that wraps the given raw object pointer. + static NSFileManager castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSFileManager._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSFileManager]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSFileManager1); + } + + static NSFileManager? getDefaultManager(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_382( + _lib._class_NSFileManager1, _lib._sel_defaultManager1); + return _ret.address == 0 + ? null + : NSFileManager._(_ret, _lib, retain: true, release: true); + } + + NSArray mountedVolumeURLsIncludingResourceValuesForKeys_options_( + NSArray? propertyKeys, int options) { + final _ret = _lib._objc_msgSend_383( + _id, + _lib._sel_mountedVolumeURLsIncludingResourceValuesForKeys_options_1, + propertyKeys?._id ?? ffi.nullptr, + options); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void unmountVolumeAtURL_options_completionHandler_( + NSURL? url, int mask, ObjCBlock15 completionHandler) { + return _lib._objc_msgSend_384( + _id, + _lib._sel_unmountVolumeAtURL_options_completionHandler_1, + url?._id ?? ffi.nullptr, + mask, + completionHandler._impl); + } + + NSArray contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_( + NSURL? url, + NSArray? keys, + int mask, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_385( + _id, + _lib._sel_contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_1, + url?._id ?? ffi.nullptr, + keys?._id ?? ffi.nullptr, + mask, + error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray URLsForDirectory_inDomains_(int directory, int domainMask) { + final _ret = _lib._objc_msgSend_386( + _id, _lib._sel_URLsForDirectory_inDomains_1, directory, domainMask); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSURL URLForDirectory_inDomain_appropriateForURL_create_error_( + int directory, + int domain, + NSURL? url, + bool shouldCreate, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_387( + _id, + _lib._sel_URLForDirectory_inDomain_appropriateForURL_create_error_1, + directory, + domain, + url?._id ?? ffi.nullptr, + shouldCreate, + error); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + bool getRelationship_ofDirectoryAtURL_toItemAtURL_error_( + ffi.Pointer outRelationship, + NSURL? directoryURL, + NSURL? otherURL, + ffi.Pointer> error) { + return _lib._objc_msgSend_388( + _id, + _lib._sel_getRelationship_ofDirectoryAtURL_toItemAtURL_error_1, + outRelationship, + directoryURL?._id ?? ffi.nullptr, + otherURL?._id ?? ffi.nullptr, + error); + } + + bool getRelationship_ofDirectory_inDomain_toItemAtURL_error_( + ffi.Pointer outRelationship, + int directory, + int domainMask, + NSURL? url, + ffi.Pointer> error) { + return _lib._objc_msgSend_389( + _id, + _lib._sel_getRelationship_ofDirectory_inDomain_toItemAtURL_error_1, + outRelationship, + directory, + domainMask, + url?._id ?? ffi.nullptr, + error); + } + + bool createDirectoryAtURL_withIntermediateDirectories_attributes_error_( + NSURL? url, + bool createIntermediates, + NSDictionary? attributes, + ffi.Pointer> error) { + return _lib._objc_msgSend_390( + _id, + _lib._sel_createDirectoryAtURL_withIntermediateDirectories_attributes_error_1, + url?._id ?? ffi.nullptr, + createIntermediates, + attributes?._id ?? ffi.nullptr, + error); + } + + bool createSymbolicLinkAtURL_withDestinationURL_error_( + NSURL? url, NSURL? destURL, ffi.Pointer> error) { + return _lib._objc_msgSend_391( + _id, + _lib._sel_createSymbolicLinkAtURL_withDestinationURL_error_1, + url?._id ?? ffi.nullptr, + destURL?._id ?? ffi.nullptr, + error); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + _lib._objc_msgSend_368( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + bool setAttributes_ofItemAtPath_error_(NSDictionary? attributes, + NSString? path, ffi.Pointer> error) { + return _lib._objc_msgSend_392( + _id, + _lib._sel_setAttributes_ofItemAtPath_error_1, + attributes?._id ?? ffi.nullptr, + path?._id ?? ffi.nullptr, + error); + } + + bool createDirectoryAtPath_withIntermediateDirectories_attributes_error_( + NSString? path, + bool createIntermediates, + NSDictionary? attributes, + ffi.Pointer> error) { + return _lib._objc_msgSend_393( + _id, + _lib._sel_createDirectoryAtPath_withIntermediateDirectories_attributes_error_1, + path?._id ?? ffi.nullptr, + createIntermediates, + attributes?._id ?? ffi.nullptr, + error); + } + + NSArray contentsOfDirectoryAtPath_error_( + NSString? path, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_394( + _id, + _lib._sel_contentsOfDirectoryAtPath_error_1, + path?._id ?? ffi.nullptr, + error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray subpathsOfDirectoryAtPath_error_( + NSString? path, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_394( + _id, + _lib._sel_subpathsOfDirectoryAtPath_error_1, + path?._id ?? ffi.nullptr, + error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSDictionary attributesOfItemAtPath_error_( + NSString? path, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_395( + _id, + _lib._sel_attributesOfItemAtPath_error_1, + path?._id ?? ffi.nullptr, + error); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary attributesOfFileSystemForPath_error_( + NSString? path, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_395( + _id, + _lib._sel_attributesOfFileSystemForPath_error_1, + path?._id ?? ffi.nullptr, + error); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + bool createSymbolicLinkAtPath_withDestinationPath_error_(NSString? path, + NSString? destPath, ffi.Pointer> error) { + return _lib._objc_msgSend_396( + _id, + _lib._sel_createSymbolicLinkAtPath_withDestinationPath_error_1, + path?._id ?? ffi.nullptr, + destPath?._id ?? ffi.nullptr, + error); + } + + NSString destinationOfSymbolicLinkAtPath_error_( + NSString? path, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_397( + _id, + _lib._sel_destinationOfSymbolicLinkAtPath_error_1, + path?._id ?? ffi.nullptr, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool copyItemAtPath_toPath_error_(NSString? srcPath, NSString? dstPath, + ffi.Pointer> error) { + return _lib._objc_msgSend_396(_id, _lib._sel_copyItemAtPath_toPath_error_1, + srcPath?._id ?? ffi.nullptr, dstPath?._id ?? ffi.nullptr, error); + } + + bool moveItemAtPath_toPath_error_(NSString? srcPath, NSString? dstPath, + ffi.Pointer> error) { + return _lib._objc_msgSend_396(_id, _lib._sel_moveItemAtPath_toPath_error_1, + srcPath?._id ?? ffi.nullptr, dstPath?._id ?? ffi.nullptr, error); + } + + bool linkItemAtPath_toPath_error_(NSString? srcPath, NSString? dstPath, + ffi.Pointer> error) { + return _lib._objc_msgSend_396(_id, _lib._sel_linkItemAtPath_toPath_error_1, + srcPath?._id ?? ffi.nullptr, dstPath?._id ?? ffi.nullptr, error); + } + + bool removeItemAtPath_error_( + NSString? path, ffi.Pointer> error) { + return _lib._objc_msgSend_398(_id, _lib._sel_removeItemAtPath_error_1, + path?._id ?? ffi.nullptr, error); + } + + bool copyItemAtURL_toURL_error_(NSURL? srcURL, NSURL? dstURL, + ffi.Pointer> error) { + return _lib._objc_msgSend_391(_id, _lib._sel_copyItemAtURL_toURL_error_1, + srcURL?._id ?? ffi.nullptr, dstURL?._id ?? ffi.nullptr, error); + } + + bool moveItemAtURL_toURL_error_(NSURL? srcURL, NSURL? dstURL, + ffi.Pointer> error) { + return _lib._objc_msgSend_391(_id, _lib._sel_moveItemAtURL_toURL_error_1, + srcURL?._id ?? ffi.nullptr, dstURL?._id ?? ffi.nullptr, error); + } + + bool linkItemAtURL_toURL_error_(NSURL? srcURL, NSURL? dstURL, + ffi.Pointer> error) { + return _lib._objc_msgSend_391(_id, _lib._sel_linkItemAtURL_toURL_error_1, + srcURL?._id ?? ffi.nullptr, dstURL?._id ?? ffi.nullptr, error); + } + + bool removeItemAtURL_error_( + NSURL? URL, ffi.Pointer> error) { + return _lib._objc_msgSend_81( + _id, _lib._sel_removeItemAtURL_error_1, URL?._id ?? ffi.nullptr, error); + } + + bool trashItemAtURL_resultingItemURL_error_( + NSURL? url, + ffi.Pointer> outResultingURL, + ffi.Pointer> error) { + return _lib._objc_msgSend_399( + _id, + _lib._sel_trashItemAtURL_resultingItemURL_error_1, + url?._id ?? ffi.nullptr, + outResultingURL, + error); + } + + NSDictionary fileAttributesAtPath_traverseLink_(NSString? path, bool yorn) { + final _ret = _lib._objc_msgSend_400( + _id, + _lib._sel_fileAttributesAtPath_traverseLink_1, + path?._id ?? ffi.nullptr, + yorn); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + bool changeFileAttributes_atPath_(NSDictionary? attributes, NSString? path) { + return _lib._objc_msgSend_401(_id, _lib._sel_changeFileAttributes_atPath_1, + attributes?._id ?? ffi.nullptr, path?._id ?? ffi.nullptr); + } + + NSArray directoryContentsAtPath_(NSString? path) { + final _ret = _lib._objc_msgSend_119( + _id, _lib._sel_directoryContentsAtPath_1, path?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSDictionary fileSystemAttributesAtPath_(NSString? path) { + final _ret = _lib._objc_msgSend_140( + _id, _lib._sel_fileSystemAttributesAtPath_1, path?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSString pathContentOfSymbolicLinkAtPath_(NSString? path) { + final _ret = _lib._objc_msgSend_64(_id, + _lib._sel_pathContentOfSymbolicLinkAtPath_1, path?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool createSymbolicLinkAtPath_pathContent_( + NSString? path, NSString? otherpath) { + return _lib._objc_msgSend_402( + _id, + _lib._sel_createSymbolicLinkAtPath_pathContent_1, + path?._id ?? ffi.nullptr, + otherpath?._id ?? ffi.nullptr); + } + + bool createDirectoryAtPath_attributes_( + NSString? path, NSDictionary? attributes) { + return _lib._objc_msgSend_403( + _id, + _lib._sel_createDirectoryAtPath_attributes_1, + path?._id ?? ffi.nullptr, + attributes?._id ?? ffi.nullptr); + } + + bool linkPath_toPath_handler_( + NSString? src, NSString? dest, NSObject handler) { + return _lib._objc_msgSend_404(_id, _lib._sel_linkPath_toPath_handler_1, + src?._id ?? ffi.nullptr, dest?._id ?? ffi.nullptr, handler._id); + } + + bool copyPath_toPath_handler_( + NSString? src, NSString? dest, NSObject handler) { + return _lib._objc_msgSend_404(_id, _lib._sel_copyPath_toPath_handler_1, + src?._id ?? ffi.nullptr, dest?._id ?? ffi.nullptr, handler._id); + } + + bool movePath_toPath_handler_( + NSString? src, NSString? dest, NSObject handler) { + return _lib._objc_msgSend_404(_id, _lib._sel_movePath_toPath_handler_1, + src?._id ?? ffi.nullptr, dest?._id ?? ffi.nullptr, handler._id); + } + + bool removeFileAtPath_handler_(NSString? path, NSObject handler) { + return _lib._objc_msgSend_405(_id, _lib._sel_removeFileAtPath_handler_1, + path?._id ?? ffi.nullptr, handler._id); + } + + NSString? get currentDirectoryPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_currentDirectoryPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool changeCurrentDirectoryPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_changeCurrentDirectoryPath_1, path?._id ?? ffi.nullptr); + } + + bool fileExistsAtPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_fileExistsAtPath_1, path?._id ?? ffi.nullptr); + } + + bool fileExistsAtPath_isDirectory_( + NSString? path, ffi.Pointer isDirectory) { + return _lib._objc_msgSend_406(_id, _lib._sel_fileExistsAtPath_isDirectory_1, + path?._id ?? ffi.nullptr, isDirectory); + } + + bool isReadableFileAtPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isReadableFileAtPath_1, path?._id ?? ffi.nullptr); + } + + bool isWritableFileAtPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isWritableFileAtPath_1, path?._id ?? ffi.nullptr); + } + + bool isExecutableFileAtPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isExecutableFileAtPath_1, path?._id ?? ffi.nullptr); + } + + bool isDeletableFileAtPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isDeletableFileAtPath_1, path?._id ?? ffi.nullptr); + } + + bool contentsEqualAtPath_andPath_(NSString? path1, NSString? path2) { + return _lib._objc_msgSend_402(_id, _lib._sel_contentsEqualAtPath_andPath_1, + path1?._id ?? ffi.nullptr, path2?._id ?? ffi.nullptr); + } + + NSString displayNameAtPath_(NSString? path) { + final _ret = _lib._objc_msgSend_64( + _id, _lib._sel_displayNameAtPath_1, path?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray componentsToDisplayForPath_(NSString? path) { + final _ret = _lib._objc_msgSend_119( + _id, _lib._sel_componentsToDisplayForPath_1, path?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSURL? get homeDirectoryForCurrentUser { + final _ret = + _lib._objc_msgSend_40(_id, _lib._sel_homeDirectoryForCurrentUser1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get temporaryDirectory { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_temporaryDirectory1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL homeDirectoryForUser_(NSString? userName) { + final _ret = _lib._objc_msgSend_34( + _id, _lib._sel_homeDirectoryForUser_1, userName?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSFileManager new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSFileManager1, _lib._sel_new1); + return NSFileManager._(_ret, _lib, retain: false, release: true); + } + + static NSFileManager alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSFileManager1, _lib._sel_alloc1); + return NSFileManager._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSFileManager1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSFileManager1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFileManager1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFileManager1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSFileManager1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSFileManager1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSFileManager1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSFileManager1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSFileManager1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSVolumeEnumerationOptions { + static const int NSVolumeEnumerationSkipHiddenVolumes = 2; + static const int NSVolumeEnumerationProduceFileReferenceURLs = 4; +} + +abstract class NSFileManagerUnmountOptions { + static const int NSFileManagerUnmountAllPartitionsAndEjectDisk = 1; + static const int NSFileManagerUnmountWithoutUI = 2; +} + +void _ObjCBlock15_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock15_closureRegistry = {}; +int _ObjCBlock15_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock15_registerClosure(Function fn) { + final id = ++_ObjCBlock15_closureRegistryIndex; + _ObjCBlock15_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock15_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return _ObjCBlock15_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock15 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock15._(this._impl, this._lib); + ObjCBlock15.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock15_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock15.fromFunction( + this._lib, void Function(ffi.Pointer arg0) fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock15_closureTrampoline) + .cast(), + _ObjCBlock15_registerClosure(fn)); + void call(ffi.Pointer arg0) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_impl, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +abstract class NSDirectoryEnumerationOptions { + static const int NSDirectoryEnumerationSkipsSubdirectoryDescendants = 1; + static const int NSDirectoryEnumerationSkipsPackageDescendants = 2; + static const int NSDirectoryEnumerationSkipsHiddenFiles = 4; + static const int NSDirectoryEnumerationIncludesDirectoriesPostOrder = 8; + static const int NSDirectoryEnumerationProducesRelativePathURLs = 16; +} + +abstract class NSSearchPathDirectory { + static const int NSApplicationDirectory = 1; + static const int NSDemoApplicationDirectory = 2; + static const int NSDeveloperApplicationDirectory = 3; + static const int NSAdminApplicationDirectory = 4; + static const int NSLibraryDirectory = 5; + static const int NSDeveloperDirectory = 6; + static const int NSUserDirectory = 7; + static const int NSDocumentationDirectory = 8; + static const int NSDocumentDirectory = 9; + static const int NSCoreServiceDirectory = 10; + static const int NSAutosavedInformationDirectory = 11; + static const int NSDesktopDirectory = 12; + static const int NSCachesDirectory = 13; + static const int NSApplicationSupportDirectory = 14; + static const int NSDownloadsDirectory = 15; + static const int NSInputMethodsDirectory = 16; + static const int NSMoviesDirectory = 17; + static const int NSMusicDirectory = 18; + static const int NSPicturesDirectory = 19; + static const int NSPrinterDescriptionDirectory = 20; + static const int NSSharedPublicDirectory = 21; + static const int NSPreferencePanesDirectory = 22; + static const int NSApplicationScriptsDirectory = 23; + static const int NSItemReplacementDirectory = 99; + static const int NSAllApplicationsDirectory = 100; + static const int NSAllLibrariesDirectory = 101; + static const int NSTrashDirectory = 102; +} + +abstract class NSSearchPathDomainMask { + static const int NSUserDomainMask = 1; + static const int NSLocalDomainMask = 2; + static const int NSNetworkDomainMask = 4; + static const int NSSystemDomainMask = 8; + static const int NSAllDomainsMask = 65535; +} + +abstract class NSURLRelationship { + static const int NSURLRelationshipContains = 0; + static const int NSURLRelationshipSame = 1; + static const int NSURLRelationshipOther = 2; +} + +class NSMutableArray extends NSArray { + NSMutableArray._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableArray] that points to the same underlying object as [other]. + static NSMutableArray castFrom(T other) { + return NSMutableArray._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSMutableArray] that wraps the given raw object pointer. + static NSMutableArray castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableArray._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableArray]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMutableArray1); + } + + void addObject_(NSObject anObject) { + return _lib._objc_msgSend_15(_id, _lib._sel_addObject_1, anObject._id); + } + + void insertObject_atIndex_(NSObject anObject, int index) { + return _lib._objc_msgSend_409( + _id, _lib._sel_insertObject_atIndex_1, anObject._id, index); + } + + void removeLastObject() { + return _lib._objc_msgSend_1(_id, _lib._sel_removeLastObject1); + } + + void removeObjectAtIndex_(int index) { + return _lib._objc_msgSend_410(_id, _lib._sel_removeObjectAtIndex_1, index); + } + + void replaceObjectAtIndex_withObject_(int index, NSObject anObject) { + return _lib._objc_msgSend_411( + _id, _lib._sel_replaceObjectAtIndex_withObject_1, index, anObject._id); + } + + @override + NSMutableArray init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + NSMutableArray initWithCapacity_(int numItems) { + final _ret = + _lib._objc_msgSend_60(_id, _lib._sel_initWithCapacity_1, numItems); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableArray initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + void addObjectsFromArray_(NSArray? otherArray) { + return _lib._objc_msgSend_412( + _id, _lib._sel_addObjectsFromArray_1, otherArray?._id ?? ffi.nullptr); + } + + void exchangeObjectAtIndex_withObjectAtIndex_(int idx1, int idx2) { + return _lib._objc_msgSend_413( + _id, _lib._sel_exchangeObjectAtIndex_withObjectAtIndex_1, idx1, idx2); + } + + void removeAllObjects() { + return _lib._objc_msgSend_1(_id, _lib._sel_removeAllObjects1); + } + + void removeObject_inRange_(NSObject anObject, NSRange range) { + return _lib._objc_msgSend_414( + _id, _lib._sel_removeObject_inRange_1, anObject._id, range); + } + + void removeObject_(NSObject anObject) { + return _lib._objc_msgSend_15(_id, _lib._sel_removeObject_1, anObject._id); + } + + void removeObjectIdenticalTo_inRange_(NSObject anObject, NSRange range) { + return _lib._objc_msgSend_414( + _id, _lib._sel_removeObjectIdenticalTo_inRange_1, anObject._id, range); + } + + void removeObjectIdenticalTo_(NSObject anObject) { + return _lib._objc_msgSend_15( + _id, _lib._sel_removeObjectIdenticalTo_1, anObject._id); + } + + void removeObjectsFromIndices_numIndices_( + ffi.Pointer indices, int cnt) { + return _lib._objc_msgSend_415( + _id, _lib._sel_removeObjectsFromIndices_numIndices_1, indices, cnt); + } + + void removeObjectsInArray_(NSArray? otherArray) { + return _lib._objc_msgSend_412( + _id, _lib._sel_removeObjectsInArray_1, otherArray?._id ?? ffi.nullptr); + } + + void removeObjectsInRange_(NSRange range) { + return _lib._objc_msgSend_416(_id, _lib._sel_removeObjectsInRange_1, range); + } + + void replaceObjectsInRange_withObjectsFromArray_range_( + NSRange range, NSArray? otherArray, NSRange otherRange) { + return _lib._objc_msgSend_417( + _id, + _lib._sel_replaceObjectsInRange_withObjectsFromArray_range_1, + range, + otherArray?._id ?? ffi.nullptr, + otherRange); + } + + void replaceObjectsInRange_withObjectsFromArray_( + NSRange range, NSArray? otherArray) { + return _lib._objc_msgSend_418( + _id, + _lib._sel_replaceObjectsInRange_withObjectsFromArray_1, + range, + otherArray?._id ?? ffi.nullptr); + } + + void setArray_(NSArray? otherArray) { + return _lib._objc_msgSend_412( + _id, _lib._sel_setArray_1, otherArray?._id ?? ffi.nullptr); + } + + void sortUsingFunction_context_( + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + compare, + ffi.Pointer context) { + return _lib._objc_msgSend_419( + _id, _lib._sel_sortUsingFunction_context_1, compare, context); + } + + void sortUsingSelector_(ffi.Pointer comparator) { + return _lib._objc_msgSend_7(_id, _lib._sel_sortUsingSelector_1, comparator); + } + + void insertObjects_atIndexes_(NSArray? objects, NSIndexSet? indexes) { + return _lib._objc_msgSend_420(_id, _lib._sel_insertObjects_atIndexes_1, + objects?._id ?? ffi.nullptr, indexes?._id ?? ffi.nullptr); + } + + void removeObjectsAtIndexes_(NSIndexSet? indexes) { + return _lib._objc_msgSend_421( + _id, _lib._sel_removeObjectsAtIndexes_1, indexes?._id ?? ffi.nullptr); + } + + void replaceObjectsAtIndexes_withObjects_( + NSIndexSet? indexes, NSArray? objects) { + return _lib._objc_msgSend_422( + _id, + _lib._sel_replaceObjectsAtIndexes_withObjects_1, + indexes?._id ?? ffi.nullptr, + objects?._id ?? ffi.nullptr); + } + + void setObject_atIndexedSubscript_(NSObject obj, int idx) { + return _lib._objc_msgSend_409( + _id, _lib._sel_setObject_atIndexedSubscript_1, obj._id, idx); + } + + void sortUsingComparator_(NSComparator cmptr) { + return _lib._objc_msgSend_423(_id, _lib._sel_sortUsingComparator_1, cmptr); + } + + void sortWithOptions_usingComparator_(int opts, NSComparator cmptr) { + return _lib._objc_msgSend_424( + _id, _lib._sel_sortWithOptions_usingComparator_1, opts, cmptr); + } + + static NSMutableArray arrayWithCapacity_(AVFAudio _lib, int numItems) { + final _ret = _lib._objc_msgSend_60( + _lib._class_NSMutableArray1, _lib._sel_arrayWithCapacity_1, numItems); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray arrayWithContentsOfFile_( + AVFAudio _lib, NSString? path) { + final _ret = _lib._objc_msgSend_425(_lib._class_NSMutableArray1, + _lib._sel_arrayWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray arrayWithContentsOfURL_(AVFAudio _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_426(_lib._class_NSMutableArray1, + _lib._sel_arrayWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + NSMutableArray initWithContentsOfFile_(NSString? path) { + final _ret = _lib._objc_msgSend_425( + _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + NSMutableArray initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_426( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + void applyDifference_() { + return _lib._objc_msgSend_1(_id, _lib._sel_applyDifference_1); + } + + void sortUsingDescriptors_(NSArray? sortDescriptors) { + return _lib._objc_msgSend_412(_id, _lib._sel_sortUsingDescriptors_1, + sortDescriptors?._id ?? ffi.nullptr); + } + + void filterUsingPredicate_(NSPredicate? predicate) { + return _lib._objc_msgSend_427( + _id, _lib._sel_filterUsingPredicate_1, predicate?._id ?? ffi.nullptr); + } + + static NSMutableArray array(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableArray1, _lib._sel_array1); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray arrayWithObject_(AVFAudio _lib, NSObject anObject) { + final _ret = _lib._objc_msgSend_16( + _lib._class_NSMutableArray1, _lib._sel_arrayWithObject_1, anObject._id); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray arrayWithObjects_count_( + AVFAudio _lib, ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61(_lib._class_NSMutableArray1, + _lib._sel_arrayWithObjects_count_1, objects, cnt); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray arrayWithObjects_(AVFAudio _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSMutableArray1, + _lib._sel_arrayWithObjects_1, firstObj._id); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray arrayWithArray_(AVFAudio _lib, NSArray? array) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSMutableArray1, + _lib._sel_arrayWithArray_1, array?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray arrayWithContentsOfURL_error_( + AVFAudio _lib, NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_117( + _lib._class_NSMutableArray1, + _lib._sel_arrayWithContentsOfURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableArray1, _lib._sel_new1); + return NSMutableArray._(_ret, _lib, retain: false, release: true); + } + + static NSMutableArray alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableArray1, _lib._sel_alloc1); + return NSMutableArray._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMutableArray1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMutableArray1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMutableArray1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableArray1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableArray1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableArray1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMutableArray1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSMutableArray1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableArray1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSMutableOrderedSet extends NSOrderedSet { + NSMutableOrderedSet._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableOrderedSet] that points to the same underlying object as [other]. + static NSMutableOrderedSet castFrom(T other) { + return NSMutableOrderedSet._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSMutableOrderedSet] that wraps the given raw object pointer. + static NSMutableOrderedSet castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableOrderedSet._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableOrderedSet]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMutableOrderedSet1); + } + + void insertObject_atIndex_(NSObject object, int idx) { + return _lib._objc_msgSend_409( + _id, _lib._sel_insertObject_atIndex_1, object._id, idx); + } + + void removeObjectAtIndex_(int idx) { + return _lib._objc_msgSend_410(_id, _lib._sel_removeObjectAtIndex_1, idx); + } + + void replaceObjectAtIndex_withObject_(int idx, NSObject object) { + return _lib._objc_msgSend_411( + _id, _lib._sel_replaceObjectAtIndex_withObject_1, idx, object._id); + } + + @override + NSMutableOrderedSet initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableOrderedSet init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSMutableOrderedSet initWithCapacity_(int numItems) { + final _ret = + _lib._objc_msgSend_60(_id, _lib._sel_initWithCapacity_1, numItems); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + void addObject_(NSObject object) { + return _lib._objc_msgSend_15(_id, _lib._sel_addObject_1, object._id); + } + + void addObjects_count_( + ffi.Pointer> objects, int count) { + return _lib._objc_msgSend_435( + _id, _lib._sel_addObjects_count_1, objects, count); + } + + void addObjectsFromArray_(NSArray? array) { + return _lib._objc_msgSend_412( + _id, _lib._sel_addObjectsFromArray_1, array?._id ?? ffi.nullptr); + } + + void exchangeObjectAtIndex_withObjectAtIndex_(int idx1, int idx2) { + return _lib._objc_msgSend_413( + _id, _lib._sel_exchangeObjectAtIndex_withObjectAtIndex_1, idx1, idx2); + } + + void moveObjectsAtIndexes_toIndex_(NSIndexSet? indexes, int idx) { + return _lib._objc_msgSend_436(_id, _lib._sel_moveObjectsAtIndexes_toIndex_1, + indexes?._id ?? ffi.nullptr, idx); + } + + void insertObjects_atIndexes_(NSArray? objects, NSIndexSet? indexes) { + return _lib._objc_msgSend_420(_id, _lib._sel_insertObjects_atIndexes_1, + objects?._id ?? ffi.nullptr, indexes?._id ?? ffi.nullptr); + } + + void setObject_atIndex_(NSObject obj, int idx) { + return _lib._objc_msgSend_409( + _id, _lib._sel_setObject_atIndex_1, obj._id, idx); + } + + void setObject_atIndexedSubscript_(NSObject obj, int idx) { + return _lib._objc_msgSend_409( + _id, _lib._sel_setObject_atIndexedSubscript_1, obj._id, idx); + } + + void replaceObjectsInRange_withObjects_count_( + NSRange range, ffi.Pointer> objects, int count) { + return _lib._objc_msgSend_437( + _id, + _lib._sel_replaceObjectsInRange_withObjects_count_1, + range, + objects, + count); + } + + void replaceObjectsAtIndexes_withObjects_( + NSIndexSet? indexes, NSArray? objects) { + return _lib._objc_msgSend_422( + _id, + _lib._sel_replaceObjectsAtIndexes_withObjects_1, + indexes?._id ?? ffi.nullptr, + objects?._id ?? ffi.nullptr); + } + + void removeObjectsInRange_(NSRange range) { + return _lib._objc_msgSend_416(_id, _lib._sel_removeObjectsInRange_1, range); + } + + void removeObjectsAtIndexes_(NSIndexSet? indexes) { + return _lib._objc_msgSend_421( + _id, _lib._sel_removeObjectsAtIndexes_1, indexes?._id ?? ffi.nullptr); + } + + void removeAllObjects() { + return _lib._objc_msgSend_1(_id, _lib._sel_removeAllObjects1); + } + + void removeObject_(NSObject object) { + return _lib._objc_msgSend_15(_id, _lib._sel_removeObject_1, object._id); + } + + void removeObjectsInArray_(NSArray? array) { + return _lib._objc_msgSend_412( + _id, _lib._sel_removeObjectsInArray_1, array?._id ?? ffi.nullptr); + } + + void intersectOrderedSet_(NSOrderedSet? other) { + return _lib._objc_msgSend_438( + _id, _lib._sel_intersectOrderedSet_1, other?._id ?? ffi.nullptr); + } + + void minusOrderedSet_(NSOrderedSet? other) { + return _lib._objc_msgSend_438( + _id, _lib._sel_minusOrderedSet_1, other?._id ?? ffi.nullptr); + } + + void unionOrderedSet_(NSOrderedSet? other) { + return _lib._objc_msgSend_438( + _id, _lib._sel_unionOrderedSet_1, other?._id ?? ffi.nullptr); + } + + void intersectSet_(NSSet? other) { + return _lib._objc_msgSend_439( + _id, _lib._sel_intersectSet_1, other?._id ?? ffi.nullptr); + } + + void minusSet_(NSSet? other) { + return _lib._objc_msgSend_439( + _id, _lib._sel_minusSet_1, other?._id ?? ffi.nullptr); + } + + void unionSet_(NSSet? other) { + return _lib._objc_msgSend_439( + _id, _lib._sel_unionSet_1, other?._id ?? ffi.nullptr); + } + + void sortUsingComparator_(NSComparator cmptr) { + return _lib._objc_msgSend_423(_id, _lib._sel_sortUsingComparator_1, cmptr); + } + + void sortWithOptions_usingComparator_(int opts, NSComparator cmptr) { + return _lib._objc_msgSend_424( + _id, _lib._sel_sortWithOptions_usingComparator_1, opts, cmptr); + } + + void sortRange_options_usingComparator_( + NSRange range, int opts, NSComparator cmptr) { + return _lib._objc_msgSend_440( + _id, _lib._sel_sortRange_options_usingComparator_1, range, opts, cmptr); + } + + static NSMutableOrderedSet orderedSetWithCapacity_( + AVFAudio _lib, int numItems) { + final _ret = _lib._objc_msgSend_60(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithCapacity_1, numItems); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + void applyDifference_() { + return _lib._objc_msgSend_1(_id, _lib._sel_applyDifference_1); + } + + void sortUsingDescriptors_(NSArray? sortDescriptors) { + return _lib._objc_msgSend_412(_id, _lib._sel_sortUsingDescriptors_1, + sortDescriptors?._id ?? ffi.nullptr); + } + + void filterUsingPredicate_(NSPredicate? p) { + return _lib._objc_msgSend_427( + _id, _lib._sel_filterUsingPredicate_1, p?._id ?? ffi.nullptr); + } + + static NSMutableOrderedSet orderedSet(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableOrderedSet1, _lib._sel_orderedSet1); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSetWithObject_( + AVFAudio _lib, NSObject object) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithObject_1, object._id); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSetWithObjects_count_( + AVFAudio _lib, ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithObjects_count_1, objects, cnt); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSetWithObjects_( + AVFAudio _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithObjects_1, firstObj._id); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSetWithOrderedSet_( + AVFAudio _lib, NSOrderedSet? set) { + final _ret = _lib._objc_msgSend_430(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithOrderedSet_1, set?._id ?? ffi.nullptr); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSetWithOrderedSet_range_copyItems_( + AVFAudio _lib, NSOrderedSet? set, NSRange range, bool flag) { + final _ret = _lib._objc_msgSend_431( + _lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithOrderedSet_range_copyItems_1, + set?._id ?? ffi.nullptr, + range, + flag); + return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSMutableOrderedSet orderedSetWithArray_( + AVFAudio _lib, NSArray? array) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithArray_1, array?._id ?? ffi.nullptr); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSetWithArray_range_copyItems_( + AVFAudio _lib, NSArray? array, NSRange range, bool flag) { + final _ret = _lib._objc_msgSend_432( + _lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithArray_range_copyItems_1, + array?._id ?? ffi.nullptr, + range, + flag); + return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSMutableOrderedSet orderedSetWithSet_(AVFAudio _lib, NSSet? set) { + final _ret = _lib._objc_msgSend_363(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithSet_1, set?._id ?? ffi.nullptr); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSetWithSet_copyItems_( + AVFAudio _lib, NSSet? set, bool flag) { + final _ret = _lib._objc_msgSend_364(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithSet_copyItems_1, set?._id ?? ffi.nullptr, flag); + return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSMutableOrderedSet new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableOrderedSet1, _lib._sel_new1); + return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSMutableOrderedSet alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableOrderedSet1, _lib._sel_alloc1); + return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMutableOrderedSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMutableOrderedSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMutableOrderedSet1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableOrderedSet1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableOrderedSet1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableOrderedSet1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMutableOrderedSet1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSMutableOrderedSet1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableOrderedSet1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSOrderedSet extends NSObject { + NSOrderedSet._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSOrderedSet] that points to the same underlying object as [other]. + static NSOrderedSet castFrom(T other) { + return NSOrderedSet._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSOrderedSet] that wraps the given raw object pointer. + static NSOrderedSet castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSOrderedSet._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSOrderedSet]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSOrderedSet1); + } + + int get count { + return _lib._objc_msgSend_10(_id, _lib._sel_count1); + } + + NSObject objectAtIndex_(int idx) { + final _ret = _lib._objc_msgSend_60(_id, _lib._sel_objectAtIndex_1, idx); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + int indexOfObject_(NSObject object) { + return _lib._objc_msgSend_69(_id, _lib._sel_indexOfObject_1, object._id); + } + + @override + NSOrderedSet init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet initWithObjects_count_( + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61( + _id, _lib._sel_initWithObjects_count_1, objects, cnt); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + void getObjects_range_( + ffi.Pointer> objects, NSRange range) { + return _lib._objc_msgSend_68( + _id, _lib._sel_getObjects_range_1, objects, range); + } + + NSArray objectsAtIndexes_(NSIndexSet? indexes) { + final _ret = _lib._objc_msgSend_103( + _id, _lib._sel_objectsAtIndexes_1, indexes?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSObject get firstObject { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_firstObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject get lastObject { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_lastObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool isEqualToOrderedSet_(NSOrderedSet? other) { + return _lib._objc_msgSend_428( + _id, _lib._sel_isEqualToOrderedSet_1, other?._id ?? ffi.nullptr); + } + + bool containsObject_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_containsObject_1, object._id); + } + + bool intersectsOrderedSet_(NSOrderedSet? other) { + return _lib._objc_msgSend_428( + _id, _lib._sel_intersectsOrderedSet_1, other?._id ?? ffi.nullptr); + } + + bool intersectsSet_(NSSet? set) { + return _lib._objc_msgSend_355( + _id, _lib._sel_intersectsSet_1, set?._id ?? ffi.nullptr); + } + + bool isSubsetOfOrderedSet_(NSOrderedSet? other) { + return _lib._objc_msgSend_428( + _id, _lib._sel_isSubsetOfOrderedSet_1, other?._id ?? ffi.nullptr); + } + + bool isSubsetOfSet_(NSSet? set) { + return _lib._objc_msgSend_355( + _id, _lib._sel_isSubsetOfSet_1, set?._id ?? ffi.nullptr); + } + + NSObject objectAtIndexedSubscript_(int idx) { + final _ret = + _lib._objc_msgSend_60(_id, _lib._sel_objectAtIndexedSubscript_1, idx); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSEnumerator objectEnumerator() { + final _ret = _lib._objc_msgSend_72(_id, _lib._sel_objectEnumerator1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + NSEnumerator reverseObjectEnumerator() { + final _ret = _lib._objc_msgSend_72(_id, _lib._sel_reverseObjectEnumerator1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet? get reversedOrderedSet { + final _ret = _lib._objc_msgSend_429(_id, _lib._sel_reversedOrderedSet1); + return _ret.address == 0 + ? null + : NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSArray? get array { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_array1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSSet? get set1 { + final _ret = _lib._objc_msgSend_280(_id, _lib._sel_set1); + return _ret.address == 0 + ? null + : NSSet._(_ret, _lib, retain: true, release: true); + } + + void enumerateObjectsUsingBlock_(ObjCBlock3 block) { + return _lib._objc_msgSend_104( + _id, _lib._sel_enumerateObjectsUsingBlock_1, block._impl); + } + + void enumerateObjectsWithOptions_usingBlock_(int opts, ObjCBlock3 block) { + return _lib._objc_msgSend_105(_id, + _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._impl); + } + + void enumerateObjectsAtIndexes_options_usingBlock_( + NSIndexSet? s, int opts, ObjCBlock3 block) { + return _lib._objc_msgSend_106( + _id, + _lib._sel_enumerateObjectsAtIndexes_options_usingBlock_1, + s?._id ?? ffi.nullptr, + opts, + block._impl); + } + + int indexOfObjectPassingTest_(ObjCBlock4 predicate) { + return _lib._objc_msgSend_107( + _id, _lib._sel_indexOfObjectPassingTest_1, predicate._impl); + } + + int indexOfObjectWithOptions_passingTest_(int opts, ObjCBlock4 predicate) { + return _lib._objc_msgSend_108( + _id, + _lib._sel_indexOfObjectWithOptions_passingTest_1, + opts, + predicate._impl); + } + + int indexOfObjectAtIndexes_options_passingTest_( + NSIndexSet? s, int opts, ObjCBlock4 predicate) { + return _lib._objc_msgSend_109( + _id, + _lib._sel_indexOfObjectAtIndexes_options_passingTest_1, + s?._id ?? ffi.nullptr, + opts, + predicate._impl); + } + + NSIndexSet indexesOfObjectsPassingTest_(ObjCBlock4 predicate) { + final _ret = _lib._objc_msgSend_110( + _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._impl); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet indexesOfObjectsWithOptions_passingTest_( + int opts, ObjCBlock4 predicate) { + final _ret = _lib._objc_msgSend_111( + _id, + _lib._sel_indexesOfObjectsWithOptions_passingTest_1, + opts, + predicate._impl); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet indexesOfObjectsAtIndexes_options_passingTest_( + NSIndexSet? s, int opts, ObjCBlock4 predicate) { + final _ret = _lib._objc_msgSend_112( + _id, + _lib._sel_indexesOfObjectsAtIndexes_options_passingTest_1, + s?._id ?? ffi.nullptr, + opts, + predicate._impl); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + int indexOfObject_inSortedRange_options_usingComparator_( + NSObject object, NSRange range, int opts, NSComparator cmp) { + return _lib._objc_msgSend_115( + _id, + _lib._sel_indexOfObject_inSortedRange_options_usingComparator_1, + object._id, + range, + opts, + cmp); + } + + NSArray sortedArrayUsingComparator_(NSComparator cmptr) { + final _ret = _lib._objc_msgSend_113( + _id, _lib._sel_sortedArrayUsingComparator_1, cmptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray sortedArrayWithOptions_usingComparator_( + int opts, NSComparator cmptr) { + final _ret = _lib._objc_msgSend_114( + _id, _lib._sel_sortedArrayWithOptions_usingComparator_1, opts, cmptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_(NSObject locale) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_indent_(NSObject locale, int level) { + final _ret = _lib._objc_msgSend_66( + _id, _lib._sel_descriptionWithLocale_indent_1, locale._id, level); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSet(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOrderedSet1, _lib._sel_orderedSet1); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSetWithObject_(AVFAudio _lib, NSObject object) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithObject_1, object._id); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSetWithObjects_count_( + AVFAudio _lib, ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61(_lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithObjects_count_1, objects, cnt); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSetWithObjects_(AVFAudio _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithObjects_1, firstObj._id); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSetWithOrderedSet_( + AVFAudio _lib, NSOrderedSet? set) { + final _ret = _lib._objc_msgSend_430(_lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithOrderedSet_1, set?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSetWithOrderedSet_range_copyItems_( + AVFAudio _lib, NSOrderedSet? set, NSRange range, bool flag) { + final _ret = _lib._objc_msgSend_431( + _lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithOrderedSet_range_copyItems_1, + set?._id ?? ffi.nullptr, + range, + flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSOrderedSet orderedSetWithArray_(AVFAudio _lib, NSArray? array) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithArray_1, array?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSetWithArray_range_copyItems_( + AVFAudio _lib, NSArray? array, NSRange range, bool flag) { + final _ret = _lib._objc_msgSend_432( + _lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithArray_range_copyItems_1, + array?._id ?? ffi.nullptr, + range, + flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSOrderedSet orderedSetWithSet_(AVFAudio _lib, NSSet? set) { + final _ret = _lib._objc_msgSend_363(_lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithSet_1, set?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSetWithSet_copyItems_( + AVFAudio _lib, NSSet? set, bool flag) { + final _ret = _lib._objc_msgSend_364(_lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithSet_copyItems_1, set?._id ?? ffi.nullptr, flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + NSOrderedSet initWithObject_(NSObject object) { + final _ret = + _lib._objc_msgSend_16(_id, _lib._sel_initWithObject_1, object._id); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet initWithObjects_(NSObject firstObj) { + final _ret = + _lib._objc_msgSend_16(_id, _lib._sel_initWithObjects_1, firstObj._id); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet initWithOrderedSet_(NSOrderedSet? set) { + final _ret = _lib._objc_msgSend_430( + _id, _lib._sel_initWithOrderedSet_1, set?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet initWithOrderedSet_copyItems_(NSOrderedSet? set, bool flag) { + final _ret = _lib._objc_msgSend_433( + _id, + _lib._sel_initWithOrderedSet_copyItems_1, + set?._id ?? ffi.nullptr, + flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + NSOrderedSet initWithOrderedSet_range_copyItems_( + NSOrderedSet? set, NSRange range, bool flag) { + final _ret = _lib._objc_msgSend_431( + _id, + _lib._sel_initWithOrderedSet_range_copyItems_1, + set?._id ?? ffi.nullptr, + range, + flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + NSOrderedSet initWithArray_(NSArray? array) { + final _ret = _lib._objc_msgSend_67( + _id, _lib._sel_initWithArray_1, array?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet initWithArray_copyItems_(NSArray? set, bool flag) { + final _ret = _lib._objc_msgSend_116(_id, + _lib._sel_initWithArray_copyItems_1, set?._id ?? ffi.nullptr, flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + NSOrderedSet initWithArray_range_copyItems_( + NSArray? set, NSRange range, bool flag) { + final _ret = _lib._objc_msgSend_432( + _id, + _lib._sel_initWithArray_range_copyItems_1, + set?._id ?? ffi.nullptr, + range, + flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + NSOrderedSet initWithSet_(NSSet? set) { + final _ret = _lib._objc_msgSend_363( + _id, _lib._sel_initWithSet_1, set?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet initWithSet_copyItems_(NSSet? set, bool flag) { + final _ret = _lib._objc_msgSend_364( + _id, _lib._sel_initWithSet_copyItems_1, set?._id ?? ffi.nullptr, flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + @override + NSObject valueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_valueForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + @override + void setValue_forKey_(NSObject value, NSString? key) { + return _lib._objc_msgSend_122( + _id, _lib._sel_setValue_forKey_1, value._id, key?._id ?? ffi.nullptr); + } + + @override + void addObserver_forKeyPath_options_context_(NSObject? observer, + NSString? keyPath, int options, ffi.Pointer context) { + return _lib._objc_msgSend_126( + _id, + _lib._sel_addObserver_forKeyPath_options_context_1, + observer?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + options, + context); + } + + @override + void removeObserver_forKeyPath_context_( + NSObject? observer, NSString? keyPath, ffi.Pointer context) { + return _lib._objc_msgSend_127( + _id, + _lib._sel_removeObserver_forKeyPath_context_1, + observer?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + context); + } + + @override + void removeObserver_forKeyPath_(NSObject? observer, NSString? keyPath) { + return _lib._objc_msgSend_128(_id, _lib._sel_removeObserver_forKeyPath_1, + observer?._id ?? ffi.nullptr, keyPath?._id ?? ffi.nullptr); + } + + NSArray sortedArrayUsingDescriptors_(NSArray? sortDescriptors) { + final _ret = _lib._objc_msgSend_63( + _id, + _lib._sel_sortedArrayUsingDescriptors_1, + sortDescriptors?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet filteredOrderedSetUsingPredicate_(NSPredicate? p) { + final _ret = _lib._objc_msgSend_434(_id, + _lib._sel_filteredOrderedSetUsingPredicate_1, p?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOrderedSet1, _lib._sel_new1); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSOrderedSet alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOrderedSet1, _lib._sel_alloc1); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSOrderedSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSOrderedSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOrderedSet1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOrderedSet1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSOrderedSet1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSOrderedSet1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSOrderedSet1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSOrderedSet1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSOrderedSet1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSMutableSet extends NSSet { + NSMutableSet._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableSet] that points to the same underlying object as [other]. + static NSMutableSet castFrom(T other) { + return NSMutableSet._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSMutableSet] that wraps the given raw object pointer. + static NSMutableSet castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableSet._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableSet]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSMutableSet1); + } + + void addObject_(NSObject object) { + return _lib._objc_msgSend_15(_id, _lib._sel_addObject_1, object._id); + } + + void removeObject_(NSObject object) { + return _lib._objc_msgSend_15(_id, _lib._sel_removeObject_1, object._id); + } + + @override + NSMutableSet initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableSet init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + NSMutableSet initWithCapacity_(int numItems) { + final _ret = + _lib._objc_msgSend_60(_id, _lib._sel_initWithCapacity_1, numItems); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + void addObjectsFromArray_(NSArray? array) { + return _lib._objc_msgSend_412( + _id, _lib._sel_addObjectsFromArray_1, array?._id ?? ffi.nullptr); + } + + void intersectSet_(NSSet? otherSet) { + return _lib._objc_msgSend_439( + _id, _lib._sel_intersectSet_1, otherSet?._id ?? ffi.nullptr); + } + + void minusSet_(NSSet? otherSet) { + return _lib._objc_msgSend_439( + _id, _lib._sel_minusSet_1, otherSet?._id ?? ffi.nullptr); + } + + void removeAllObjects() { + return _lib._objc_msgSend_1(_id, _lib._sel_removeAllObjects1); + } + + void unionSet_(NSSet? otherSet) { + return _lib._objc_msgSend_439( + _id, _lib._sel_unionSet_1, otherSet?._id ?? ffi.nullptr); + } + + void setSet_(NSSet? otherSet) { + return _lib._objc_msgSend_439( + _id, _lib._sel_setSet_1, otherSet?._id ?? ffi.nullptr); + } + + static NSMutableSet setWithCapacity_(AVFAudio _lib, int numItems) { + final _ret = _lib._objc_msgSend_60( + _lib._class_NSMutableSet1, _lib._sel_setWithCapacity_1, numItems); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + void filterUsingPredicate_(NSPredicate? predicate) { + return _lib._objc_msgSend_427( + _id, _lib._sel_filterUsingPredicate_1, predicate?._id ?? ffi.nullptr); + } + + static NSMutableSet set1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableSet1, _lib._sel_set1); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableSet setWithObject_(AVFAudio _lib, NSObject object) { + final _ret = _lib._objc_msgSend_16( + _lib._class_NSMutableSet1, _lib._sel_setWithObject_1, object._id); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableSet setWithObjects_count_( + AVFAudio _lib, ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61(_lib._class_NSMutableSet1, + _lib._sel_setWithObjects_count_1, objects, cnt); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableSet setWithObjects_(AVFAudio _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_16( + _lib._class_NSMutableSet1, _lib._sel_setWithObjects_1, firstObj._id); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableSet setWithSet_(AVFAudio _lib, NSSet? set) { + final _ret = _lib._objc_msgSend_363(_lib._class_NSMutableSet1, + _lib._sel_setWithSet_1, set?._id ?? ffi.nullptr); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableSet setWithArray_(AVFAudio _lib, NSArray? array) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSMutableSet1, + _lib._sel_setWithArray_1, array?._id ?? ffi.nullptr); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableSet new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableSet1, _lib._sel_new1); + return NSMutableSet._(_ret, _lib, retain: false, release: true); + } + + static NSMutableSet alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableSet1, _lib._sel_alloc1); + return NSMutableSet._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMutableSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMutableSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableSet1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableSet1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableSet1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableSet1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMutableSet1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSMutableSet1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableSet1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSKeyValueChange { + static const int NSKeyValueChangeSetting = 1; + static const int NSKeyValueChangeInsertion = 2; + static const int NSKeyValueChangeRemoval = 3; + static const int NSKeyValueChangeReplacement = 4; +} + +abstract class NSKeyValueSetMutationKind { + static const int NSKeyValueUnionSetMutation = 1; + static const int NSKeyValueMinusSetMutation = 2; + static const int NSKeyValueIntersectSetMutation = 3; + static const int NSKeyValueSetSetMutation = 4; +} + +class NSKeyedArchiver extends NSCoder { + NSKeyedArchiver._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSKeyedArchiver] that points to the same underlying object as [other]. + static NSKeyedArchiver castFrom(T other) { + return NSKeyedArchiver._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSKeyedArchiver] that wraps the given raw object pointer. + static NSKeyedArchiver castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSKeyedArchiver._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSKeyedArchiver]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSKeyedArchiver1); + } + + NSKeyedArchiver initRequiringSecureCoding_(bool requiresSecureCoding) { + final _ret = _lib._objc_msgSend_449( + _id, _lib._sel_initRequiringSecureCoding_1, requiresSecureCoding); + return NSKeyedArchiver._(_ret, _lib, retain: true, release: true); + } + + static NSData archivedDataWithRootObject_requiringSecureCoding_error_( + AVFAudio _lib, + NSObject object, + bool requiresSecureCoding, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_450( + _lib._class_NSKeyedArchiver1, + _lib._sel_archivedDataWithRootObject_requiringSecureCoding_error_1, + object._id, + requiresSecureCoding, + error); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSKeyedArchiver init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSKeyedArchiver._(_ret, _lib, retain: true, release: true); + } + + NSKeyedArchiver initForWritingWithMutableData_(NSMutableData? data) { + final _ret = _lib._objc_msgSend_455(_id, + _lib._sel_initForWritingWithMutableData_1, data?._id ?? ffi.nullptr); + return NSKeyedArchiver._(_ret, _lib, retain: true, release: true); + } + + static NSData archivedDataWithRootObject_( + AVFAudio _lib, NSObject rootObject) { + final _ret = _lib._objc_msgSend_456(_lib._class_NSKeyedArchiver1, + _lib._sel_archivedDataWithRootObject_1, rootObject._id); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static bool archiveRootObject_toFile_( + AVFAudio _lib, NSObject rootObject, NSString? path) { + return _lib._objc_msgSend_225( + _lib._class_NSKeyedArchiver1, + _lib._sel_archiveRootObject_toFile_1, + rootObject._id, + path?._id ?? ffi.nullptr); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + _lib._objc_msgSend_368( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + int get outputFormat { + return _lib._objc_msgSend_457(_id, _lib._sel_outputFormat1); + } + + set outputFormat(int value) { + _lib._objc_msgSend_458(_id, _lib._sel_setOutputFormat_1, value); + } + + NSData? get encodedData { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_encodedData1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + void finishEncoding() { + return _lib._objc_msgSend_1(_id, _lib._sel_finishEncoding1); + } + + static void setClassName_forClass_( + AVFAudio _lib, NSString? codedName, NSObject cls) { + return _lib._objc_msgSend_459( + _lib._class_NSKeyedArchiver1, + _lib._sel_setClassName_forClass_1, + codedName?._id ?? ffi.nullptr, + cls._id); + } + + static NSString classNameForClass_(AVFAudio _lib, NSObject cls) { + final _ret = _lib._objc_msgSend_65( + _lib._class_NSKeyedArchiver1, _lib._sel_classNameForClass_1, cls._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + @override + void encodeObject_forKey_(NSObject object, NSString? key) { + return _lib._objc_msgSend_122(_id, _lib._sel_encodeObject_forKey_1, + object._id, key?._id ?? ffi.nullptr); + } + + @override + void encodeConditionalObject_forKey_(NSObject object, NSString? key) { + return _lib._objc_msgSend_122( + _id, + _lib._sel_encodeConditionalObject_forKey_1, + object._id, + key?._id ?? ffi.nullptr); + } + + @override + void encodeBool_forKey_(bool value, NSString? key) { + return _lib._objc_msgSend_257( + _id, _lib._sel_encodeBool_forKey_1, value, key?._id ?? ffi.nullptr); + } + + @override + void encodeInt_forKey_(int value, NSString? key) { + return _lib._objc_msgSend_258( + _id, _lib._sel_encodeInt_forKey_1, value, key?._id ?? ffi.nullptr); + } + + @override + void encodeInt32_forKey_(int value, NSString? key) { + return _lib._objc_msgSend_259( + _id, _lib._sel_encodeInt32_forKey_1, value, key?._id ?? ffi.nullptr); + } + + @override + void encodeInt64_forKey_(int value, NSString? key) { + return _lib._objc_msgSend_260( + _id, _lib._sel_encodeInt64_forKey_1, value, key?._id ?? ffi.nullptr); + } + + @override + void encodeFloat_forKey_(double value, NSString? key) { + return _lib._objc_msgSend_261( + _id, _lib._sel_encodeFloat_forKey_1, value, key?._id ?? ffi.nullptr); + } + + @override + void encodeDouble_forKey_(double value, NSString? key) { + return _lib._objc_msgSend_262( + _id, _lib._sel_encodeDouble_forKey_1, value, key?._id ?? ffi.nullptr); + } + + @override + void encodeBytes_length_forKey_( + ffi.Pointer bytes, int length, NSString? key) { + return _lib._objc_msgSend_263(_id, _lib._sel_encodeBytes_length_forKey_1, + bytes, length, key?._id ?? ffi.nullptr); + } + + @override + bool get requiresSecureCoding { + return _lib._objc_msgSend_12(_id, _lib._sel_requiresSecureCoding1); + } + + set requiresSecureCoding(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setRequiresSecureCoding_1, value); + } + + static NSKeyedArchiver new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSKeyedArchiver1, _lib._sel_new1); + return NSKeyedArchiver._(_ret, _lib, retain: false, release: true); + } + + static NSKeyedArchiver alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSKeyedArchiver1, _lib._sel_alloc1); + return NSKeyedArchiver._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSKeyedArchiver1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSKeyedArchiver1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSKeyedArchiver1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSKeyedArchiver1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSKeyedArchiver1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSKeyedArchiver1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSKeyedArchiver1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSKeyedArchiver1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSKeyedArchiver1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSMutableData extends NSData { + NSMutableData._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableData] that points to the same underlying object as [other]. + static NSMutableData castFrom(T other) { + return NSMutableData._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSMutableData] that wraps the given raw object pointer. + static NSMutableData castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableData._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableData]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSMutableData1); + } + + ffi.Pointer get mutableBytes { + return _lib._objc_msgSend_19(_id, _lib._sel_mutableBytes1); + } + + @override + int get length { + return _lib._objc_msgSend_10(_id, _lib._sel_length1); + } + + set length(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setLength_1, value); + } + + void appendBytes_length_(ffi.Pointer bytes, int length) { + return _lib._objc_msgSend_21( + _id, _lib._sel_appendBytes_length_1, bytes, length); + } + + void appendData_(NSData? other) { + return _lib._objc_msgSend_248( + _id, _lib._sel_appendData_1, other?._id ?? ffi.nullptr); + } + + void increaseLengthBy_(int extraLength) { + return _lib._objc_msgSend_410( + _id, _lib._sel_increaseLengthBy_1, extraLength); + } + + void replaceBytesInRange_withBytes_( + NSRange range, ffi.Pointer bytes) { + return _lib._objc_msgSend_452( + _id, _lib._sel_replaceBytesInRange_withBytes_1, range, bytes); + } + + void resetBytesInRange_(NSRange range) { + return _lib._objc_msgSend_416(_id, _lib._sel_resetBytesInRange_1, range); + } + + void setData_(NSData? data) { + return _lib._objc_msgSend_248( + _id, _lib._sel_setData_1, data?._id ?? ffi.nullptr); + } + + void replaceBytesInRange_withBytes_length_(NSRange range, + ffi.Pointer replacementBytes, int replacementLength) { + return _lib._objc_msgSend_453( + _id, + _lib._sel_replaceBytesInRange_withBytes_length_1, + range, + replacementBytes, + replacementLength); + } + + static NSMutableData dataWithCapacity_(AVFAudio _lib, int aNumItems) { + final _ret = _lib._objc_msgSend_60( + _lib._class_NSMutableData1, _lib._sel_dataWithCapacity_1, aNumItems); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData dataWithLength_(AVFAudio _lib, int length) { + final _ret = _lib._objc_msgSend_60( + _lib._class_NSMutableData1, _lib._sel_dataWithLength_1, length); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + NSMutableData initWithCapacity_(int capacity) { + final _ret = + _lib._objc_msgSend_60(_id, _lib._sel_initWithCapacity_1, capacity); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + NSMutableData initWithLength_(int length) { + final _ret = _lib._objc_msgSend_60(_id, _lib._sel_initWithLength_1, length); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + bool decompressUsingAlgorithm_error_( + int algorithm, ffi.Pointer> error) { + return _lib._objc_msgSend_454( + _id, _lib._sel_decompressUsingAlgorithm_error_1, algorithm, error); + } + + bool compressUsingAlgorithm_error_( + int algorithm, ffi.Pointer> error) { + return _lib._objc_msgSend_454( + _id, _lib._sel_compressUsingAlgorithm_error_1, algorithm, error); + } + + static NSMutableData data(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableData1, _lib._sel_data1); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData dataWithBytes_length_( + AVFAudio _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_237(_lib._class_NSMutableData1, + _lib._sel_dataWithBytes_length_1, bytes, length); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData dataWithBytesNoCopy_length_( + AVFAudio _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_237(_lib._class_NSMutableData1, + _lib._sel_dataWithBytesNoCopy_length_1, bytes, length); + return NSMutableData._(_ret, _lib, retain: false, release: true); + } + + static NSMutableData dataWithBytesNoCopy_length_freeWhenDone_( + AVFAudio _lib, ffi.Pointer bytes, int length, bool b) { + final _ret = _lib._objc_msgSend_238(_lib._class_NSMutableData1, + _lib._sel_dataWithBytesNoCopy_length_freeWhenDone_1, bytes, length, b); + return NSMutableData._(_ret, _lib, retain: false, release: true); + } + + static NSMutableData dataWithContentsOfFile_options_error_( + AVFAudio _lib, + NSString? path, + int readOptionsMask, + ffi.Pointer> errorPtr) { + final _ret = _lib._objc_msgSend_239( + _lib._class_NSMutableData1, + _lib._sel_dataWithContentsOfFile_options_error_1, + path?._id ?? ffi.nullptr, + readOptionsMask, + errorPtr); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData dataWithContentsOfURL_options_error_( + AVFAudio _lib, + NSURL? url, + int readOptionsMask, + ffi.Pointer> errorPtr) { + final _ret = _lib._objc_msgSend_240( + _lib._class_NSMutableData1, + _lib._sel_dataWithContentsOfURL_options_error_1, + url?._id ?? ffi.nullptr, + readOptionsMask, + errorPtr); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData dataWithContentsOfFile_(AVFAudio _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSMutableData1, + _lib._sel_dataWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData dataWithContentsOfURL_(AVFAudio _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_226(_lib._class_NSMutableData1, + _lib._sel_dataWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData dataWithData_(AVFAudio _lib, NSData? data) { + final _ret = _lib._objc_msgSend_242(_lib._class_NSMutableData1, + _lib._sel_dataWithData_1, data?._id ?? ffi.nullptr); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSObject dataWithContentsOfMappedFile_(AVFAudio _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSMutableData1, + _lib._sel_dataWithContentsOfMappedFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableData1, _lib._sel_new1); + return NSMutableData._(_ret, _lib, retain: false, release: true); + } + + static NSMutableData alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableData1, _lib._sel_alloc1); + return NSMutableData._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMutableData1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMutableData1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableData1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableData1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableData1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableData1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMutableData1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSMutableData1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableData1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSPropertyListFormat { + static const int NSPropertyListOpenStepFormat = 1; + static const int NSPropertyListXMLFormat_v1_0 = 100; + static const int NSPropertyListBinaryFormat_v1_0 = 200; +} + +class NSThread extends NSObject { + NSThread._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSThread] that points to the same underlying object as [other]. + static NSThread castFrom(T other) { + return NSThread._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSThread] that wraps the given raw object pointer. + static NSThread castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSThread._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSThread]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSThread1); + } + + static NSThread? getCurrentThread(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_464(_lib._class_NSThread1, _lib._sel_currentThread1); + return _ret.address == 0 + ? null + : NSThread._(_ret, _lib, retain: true, release: true); + } + + static void detachNewThreadWithBlock_(AVFAudio _lib, ObjCBlock16 block) { + return _lib._objc_msgSend_465(_lib._class_NSThread1, + _lib._sel_detachNewThreadWithBlock_1, block._impl); + } + + static void detachNewThreadSelector_toTarget_withObject_(AVFAudio _lib, + ffi.Pointer selector, NSObject target, NSObject argument) { + return _lib._objc_msgSend_466( + _lib._class_NSThread1, + _lib._sel_detachNewThreadSelector_toTarget_withObject_1, + selector, + target._id, + argument._id); + } + + static bool isMultiThreaded(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSThread1, _lib._sel_isMultiThreaded1); + } + + NSMutableDictionary? get threadDictionary { + final _ret = _lib._objc_msgSend_471(_id, _lib._sel_threadDictionary1); + return _ret.address == 0 + ? null + : NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static void sleepUntilDate_(AVFAudio _lib, NSDate? date) { + return _lib._objc_msgSend_472(_lib._class_NSThread1, + _lib._sel_sleepUntilDate_1, date?._id ?? ffi.nullptr); + } + + static void sleepForTimeInterval_(AVFAudio _lib, double ti) { + return _lib._objc_msgSend_473( + _lib._class_NSThread1, _lib._sel_sleepForTimeInterval_1, ti); + } + + static void exit(AVFAudio _lib) { + return _lib._objc_msgSend_1(_lib._class_NSThread1, _lib._sel_exit1); + } + + double get threadPriority { + return _lib._objc_msgSend_149(_id, _lib._sel_threadPriority1); + } + + set threadPriority(double value) { + _lib._objc_msgSend_474(_id, _lib._sel_setThreadPriority_1, value); + } + + int get qualityOfService { + return _lib._objc_msgSend_475(_id, _lib._sel_qualityOfService1); + } + + set qualityOfService(int value) { + _lib._objc_msgSend_476(_id, _lib._sel_setQualityOfService_1, value); + } + + static NSArray? getCallStackReturnAddresses(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSThread1, _lib._sel_callStackReturnAddresses1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getCallStackSymbols(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSThread1, _lib._sel_callStackSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set name(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setName_1, value?._id ?? ffi.nullptr); + } + + int get stackSize { + return _lib._objc_msgSend_10(_id, _lib._sel_stackSize1); + } + + set stackSize(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setStackSize_1, value); + } + + bool get isMainThread { + return _lib._objc_msgSend_12(_id, _lib._sel_isMainThread1); + } + + static NSThread? getMainThread(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_464(_lib._class_NSThread1, _lib._sel_mainThread1); + return _ret.address == 0 + ? null + : NSThread._(_ret, _lib, retain: true, release: true); + } + + @override + NSThread init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSThread._(_ret, _lib, retain: true, release: true); + } + + NSThread initWithTarget_selector_object_( + NSObject target, ffi.Pointer selector, NSObject argument) { + final _ret = _lib._objc_msgSend_478( + _id, + _lib._sel_initWithTarget_selector_object_1, + target._id, + selector, + argument._id); + return NSThread._(_ret, _lib, retain: true, release: true); + } + + NSThread initWithBlock_(ObjCBlock16 block) { + final _ret = + _lib._objc_msgSend_479(_id, _lib._sel_initWithBlock_1, block._impl); + return NSThread._(_ret, _lib, retain: true, release: true); + } + + bool get executing { + return _lib._objc_msgSend_12(_id, _lib._sel_isExecuting1); + } + + bool get finished { + return _lib._objc_msgSend_12(_id, _lib._sel_isFinished1); + } + + bool get cancelled { + return _lib._objc_msgSend_12(_id, _lib._sel_isCancelled1); + } + + void cancel() { + return _lib._objc_msgSend_1(_id, _lib._sel_cancel1); + } + + void start() { + return _lib._objc_msgSend_1(_id, _lib._sel_start1); + } + + void main() { + return _lib._objc_msgSend_1(_id, _lib._sel_main1); + } + + static NSThread new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSThread1, _lib._sel_new1); + return NSThread._(_ret, _lib, retain: false, release: true); + } + + static NSThread alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSThread1, _lib._sel_alloc1); + return NSThread._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSThread1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSThread1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSThread1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSThread1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSThread1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSThread1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSThread1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSThread1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSThread1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock16_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block) { + return block.ref.target + .cast>() + .asFunction()(); +} + +final _ObjCBlock16_closureRegistry = {}; +int _ObjCBlock16_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock16_registerClosure(Function fn) { + final id = ++_ObjCBlock16_closureRegistryIndex; + _ObjCBlock16_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock16_closureTrampoline(ffi.Pointer<_ObjCBlock> block) { + return _ObjCBlock16_closureRegistry[block.ref.target.address]!(); +} + +class ObjCBlock16 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock16._(this._impl, this._lib); + ObjCBlock16.fromFunctionPointer( + this._lib, ffi.Pointer> ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block)>( + _ObjCBlock16_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock16.fromFunction(this._lib, void Function() fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block)>( + _ObjCBlock16_closureTrampoline) + .cast(), + _ObjCBlock16_registerClosure(fn)); + void call() { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block)>>() + .asFunction block)>()(_impl); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class NSMutableDictionary extends NSDictionary { + NSMutableDictionary._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableDictionary] that points to the same underlying object as [other]. + static NSMutableDictionary castFrom(T other) { + return NSMutableDictionary._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSMutableDictionary] that wraps the given raw object pointer. + static NSMutableDictionary castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableDictionary._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableDictionary]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMutableDictionary1); + } + + void removeObjectForKey_(NSObject aKey) { + return _lib._objc_msgSend_15(_id, _lib._sel_removeObjectForKey_1, aKey._id); + } + + void setObject_forKey_(NSObject anObject, NSObject aKey) { + return _lib._objc_msgSend_467( + _id, _lib._sel_setObject_forKey_1, anObject._id, aKey._id); + } + + @override + NSMutableDictionary init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + NSMutableDictionary initWithCapacity_(int numItems) { + final _ret = + _lib._objc_msgSend_60(_id, _lib._sel_initWithCapacity_1, numItems); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableDictionary initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + void addEntriesFromDictionary_(NSDictionary? otherDictionary) { + return _lib._objc_msgSend_444(_id, _lib._sel_addEntriesFromDictionary_1, + otherDictionary?._id ?? ffi.nullptr); + } + + void removeAllObjects() { + return _lib._objc_msgSend_1(_id, _lib._sel_removeAllObjects1); + } + + void removeObjectsForKeys_(NSArray? keyArray) { + return _lib._objc_msgSend_412( + _id, _lib._sel_removeObjectsForKeys_1, keyArray?._id ?? ffi.nullptr); + } + + void setDictionary_(NSDictionary? otherDictionary) { + return _lib._objc_msgSend_444( + _id, _lib._sel_setDictionary_1, otherDictionary?._id ?? ffi.nullptr); + } + + void setObject_forKeyedSubscript_(NSObject obj, NSObject key) { + return _lib._objc_msgSend_467( + _id, _lib._sel_setObject_forKeyedSubscript_1, obj._id, key._id); + } + + static NSMutableDictionary dictionaryWithCapacity_( + AVFAudio _lib, int numItems) { + final _ret = _lib._objc_msgSend_60(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithCapacity_1, numItems); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithContentsOfFile_( + AVFAudio _lib, NSString? path) { + final _ret = _lib._objc_msgSend_468(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithContentsOfURL_( + AVFAudio _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_469(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + NSMutableDictionary initWithContentsOfFile_(NSString? path) { + final _ret = _lib._objc_msgSend_468( + _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + NSMutableDictionary initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_469( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithSharedKeySet_( + AVFAudio _lib, NSObject keyset) { + final _ret = _lib._objc_msgSend_470(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithSharedKeySet_1, keyset._id); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + void setValue_forKey_(NSObject value, NSString? key) { + return _lib._objc_msgSend_122( + _id, _lib._sel_setValue_forKey_1, value._id, key?._id ?? ffi.nullptr); + } + + static NSMutableDictionary dictionary(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableDictionary1, _lib._sel_dictionary1); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithObject_forKey_( + AVFAudio _lib, NSObject object, NSObject key) { + final _ret = _lib._objc_msgSend_142(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithObject_forKey_1, object._id, key._id); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithObjects_forKeys_count_( + AVFAudio _lib, + ffi.Pointer> objects, + ffi.Pointer> keys, + int cnt) { + final _ret = _lib._objc_msgSend_133(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithObjects_forKeys_count_1, objects, keys, cnt); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithObjectsAndKeys_( + AVFAudio _lib, NSObject firstObject) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithObjectsAndKeys_1, firstObject._id); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithDictionary_( + AVFAudio _lib, NSDictionary? dict) { + final _ret = _lib._objc_msgSend_143(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithDictionary_1, dict?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithObjects_forKeys_( + AVFAudio _lib, NSArray? objects, NSArray? keys) { + final _ret = _lib._objc_msgSend_144( + _lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithObjects_forKeys_1, + objects?._id ?? ffi.nullptr, + keys?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithContentsOfURL_error_( + AVFAudio _lib, NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_146( + _lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithContentsOfURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSObject sharedKeySetForKeys_(AVFAudio _lib, NSArray? keys) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSMutableDictionary1, + _lib._sel_sharedKeySetForKeys_1, keys?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableDictionary1, _lib._sel_new1); + return NSMutableDictionary._(_ret, _lib, retain: false, release: true); + } + + static NSMutableDictionary alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableDictionary1, _lib._sel_alloc1); + return NSMutableDictionary._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMutableDictionary1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMutableDictionary1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMutableDictionary1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableDictionary1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableDictionary1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableDictionary1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMutableDictionary1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSMutableDictionary1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableDictionary1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSQualityOfService { + static const int NSQualityOfServiceUserInteractive = 33; + static const int NSQualityOfServiceUserInitiated = 25; + static const int NSQualityOfServiceUtility = 17; + static const int NSQualityOfServiceBackground = 9; + static const int NSQualityOfServiceDefault = -1; +} + +class NSArchiver extends NSCoder { + NSArchiver._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSArchiver] that points to the same underlying object as [other]. + static NSArchiver castFrom(T other) { + return NSArchiver._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSArchiver] that wraps the given raw object pointer. + static NSArchiver castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSArchiver._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSArchiver]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSArchiver1); + } + + NSArchiver initForWritingWithMutableData_(NSMutableData? mdata) { + final _ret = _lib._objc_msgSend_455(_id, + _lib._sel_initForWritingWithMutableData_1, mdata?._id ?? ffi.nullptr); + return NSArchiver._(_ret, _lib, retain: true, release: true); + } + + NSMutableData? get archiverData { + final _ret = _lib._objc_msgSend_482(_id, _lib._sel_archiverData1); + return _ret.address == 0 + ? null + : NSMutableData._(_ret, _lib, retain: true, release: true); + } + + @override + void encodeRootObject_(NSObject rootObject) { + return _lib._objc_msgSend_15( + _id, _lib._sel_encodeRootObject_1, rootObject._id); + } + + @override + void encodeConditionalObject_(NSObject object) { + return _lib._objc_msgSend_15( + _id, _lib._sel_encodeConditionalObject_1, object._id); + } + + static NSData archivedDataWithRootObject_( + AVFAudio _lib, NSObject rootObject) { + final _ret = _lib._objc_msgSend_456(_lib._class_NSArchiver1, + _lib._sel_archivedDataWithRootObject_1, rootObject._id); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static bool archiveRootObject_toFile_( + AVFAudio _lib, NSObject rootObject, NSString? path) { + return _lib._objc_msgSend_225( + _lib._class_NSArchiver1, + _lib._sel_archiveRootObject_toFile_1, + rootObject._id, + path?._id ?? ffi.nullptr); + } + + void encodeClassName_intoClassName_( + NSString? trueName, NSString? inArchiveName) { + return _lib._objc_msgSend_483( + _id, + _lib._sel_encodeClassName_intoClassName_1, + trueName?._id ?? ffi.nullptr, + inArchiveName?._id ?? ffi.nullptr); + } + + NSString classNameEncodedForTrueClassName_(NSString? trueName) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_classNameEncodedForTrueClassName_1, + trueName?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + void replaceObject_withObject_(NSObject object, NSObject newObject) { + return _lib._objc_msgSend_467( + _id, _lib._sel_replaceObject_withObject_1, object._id, newObject._id); + } + + static NSArchiver new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSArchiver1, _lib._sel_new1); + return NSArchiver._(_ret, _lib, retain: false, release: true); + } + + static NSArchiver alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSArchiver1, _lib._sel_alloc1); + return NSArchiver._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSArchiver1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSArchiver1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSArchiver1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSArchiver1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSArchiver1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSArchiver1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSArchiver1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSArchiver1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSArchiver1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSPortCoder extends NSCoder { + NSPortCoder._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSPortCoder] that points to the same underlying object as [other]. + static NSPortCoder castFrom(T other) { + return NSPortCoder._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSPortCoder] that wraps the given raw object pointer. + static NSPortCoder castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSPortCoder._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSPortCoder]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSPortCoder1); + } + + bool isBycopy() { + return _lib._objc_msgSend_12(_id, _lib._sel_isBycopy1); + } + + bool isByref() { + return _lib._objc_msgSend_12(_id, _lib._sel_isByref1); + } + + void encodePortObject_(NSPort? aport) { + return _lib._objc_msgSend_520( + _id, _lib._sel_encodePortObject_1, aport?._id ?? ffi.nullptr); + } + + NSPort decodePortObject() { + final _ret = _lib._objc_msgSend_485(_id, _lib._sel_decodePortObject1); + return NSPort._(_ret, _lib, retain: true, release: true); + } + + NSConnection connection() { + final _ret = _lib._objc_msgSend_504(_id, _lib._sel_connection1); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSObject portCoderWithReceivePort_sendPort_components_( + AVFAudio _lib, NSPort? rcvPort, NSPort? sndPort, NSArray? comps) { + final _ret = _lib._objc_msgSend_521( + _lib._class_NSPortCoder1, + _lib._sel_portCoderWithReceivePort_sendPort_components_1, + rcvPort?._id ?? ffi.nullptr, + sndPort?._id ?? ffi.nullptr, + comps?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithReceivePort_sendPort_components_( + NSPort? rcvPort, NSPort? sndPort, NSArray? comps) { + final _ret = _lib._objc_msgSend_521( + _id, + _lib._sel_initWithReceivePort_sendPort_components_1, + rcvPort?._id ?? ffi.nullptr, + sndPort?._id ?? ffi.nullptr, + comps?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void dispatch() { + return _lib._objc_msgSend_1(_id, _lib._sel_dispatch1); + } + + static NSPortCoder new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSPortCoder1, _lib._sel_new1); + return NSPortCoder._(_ret, _lib, retain: false, release: true); + } + + static NSPortCoder alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPortCoder1, _lib._sel_alloc1); + return NSPortCoder._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSPortCoder1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSPortCoder1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPortCoder1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPortCoder1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSPortCoder1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSPortCoder1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSPortCoder1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSPortCoder1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPortCoder1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSPort extends NSObject { + NSPort._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSPort] that points to the same underlying object as [other]. + static NSPort castFrom(T other) { + return NSPort._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSPort] that wraps the given raw object pointer. + static NSPort castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSPort._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSPort]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSPort1); + } + + static NSPort port(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_485(_lib._class_NSPort1, _lib._sel_port1); + return NSPort._(_ret, _lib, retain: true, release: true); + } + + void invalidate() { + return _lib._objc_msgSend_1(_id, _lib._sel_invalidate1); + } + + bool get valid { + return _lib._objc_msgSend_12(_id, _lib._sel_isValid1); + } + + void setDelegate_(NSObject? anObject) { + return _lib._objc_msgSend_15( + _id, _lib._sel_setDelegate_1, anObject?._id ?? ffi.nullptr); + } + + NSObject delegate() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void scheduleInRunLoop_forMode_(NSRunLoop? runLoop, NSRunLoopMode mode) { + return _lib._objc_msgSend_501(_id, _lib._sel_scheduleInRunLoop_forMode_1, + runLoop?._id ?? ffi.nullptr, mode); + } + + void removeFromRunLoop_forMode_(NSRunLoop? runLoop, NSRunLoopMode mode) { + return _lib._objc_msgSend_501(_id, _lib._sel_removeFromRunLoop_forMode_1, + runLoop?._id ?? ffi.nullptr, mode); + } + + int get reservedSpaceLength { + return _lib._objc_msgSend_10(_id, _lib._sel_reservedSpaceLength1); + } + + bool sendBeforeDate_components_from_reserved_( + NSDate? limitDate, + NSMutableArray? components, + NSPort? receivePort, + int headerSpaceReserved) { + return _lib._objc_msgSend_502( + _id, + _lib._sel_sendBeforeDate_components_from_reserved_1, + limitDate?._id ?? ffi.nullptr, + components?._id ?? ffi.nullptr, + receivePort?._id ?? ffi.nullptr, + headerSpaceReserved); + } + + bool sendBeforeDate_msgid_components_from_reserved_( + NSDate? limitDate, + int msgID, + NSMutableArray? components, + NSPort? receivePort, + int headerSpaceReserved) { + return _lib._objc_msgSend_503( + _id, + _lib._sel_sendBeforeDate_msgid_components_from_reserved_1, + limitDate?._id ?? ffi.nullptr, + msgID, + components?._id ?? ffi.nullptr, + receivePort?._id ?? ffi.nullptr, + headerSpaceReserved); + } + + void addConnection_toRunLoop_forMode_( + NSConnection? conn, NSRunLoop? runLoop, NSRunLoopMode mode) { + return _lib._objc_msgSend_519( + _id, + _lib._sel_addConnection_toRunLoop_forMode_1, + conn?._id ?? ffi.nullptr, + runLoop?._id ?? ffi.nullptr, + mode); + } + + void removeConnection_fromRunLoop_forMode_( + NSConnection? conn, NSRunLoop? runLoop, NSRunLoopMode mode) { + return _lib._objc_msgSend_519( + _id, + _lib._sel_removeConnection_fromRunLoop_forMode_1, + conn?._id ?? ffi.nullptr, + runLoop?._id ?? ffi.nullptr, + mode); + } + + static NSPort new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSPort1, _lib._sel_new1); + return NSPort._(_ret, _lib, retain: false, release: true); + } + + static NSPort alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSPort1, _lib._sel_alloc1); + return NSPort._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSPort1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSPort1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPort1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPort1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSPort1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSPort1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSPort1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSPort1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPort1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSRunLoop extends NSObject { + NSRunLoop._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSRunLoop] that points to the same underlying object as [other]. + static NSRunLoop castFrom(T other) { + return NSRunLoop._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSRunLoop] that wraps the given raw object pointer. + static NSRunLoop castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSRunLoop._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSRunLoop]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSRunLoop1); + } + + static NSRunLoop? getCurrentRunLoop(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_486( + _lib._class_NSRunLoop1, _lib._sel_currentRunLoop1); + return _ret.address == 0 + ? null + : NSRunLoop._(_ret, _lib, retain: true, release: true); + } + + static NSRunLoop? getMainRunLoop(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_486(_lib._class_NSRunLoop1, _lib._sel_mainRunLoop1); + return _ret.address == 0 + ? null + : NSRunLoop._(_ret, _lib, retain: true, release: true); + } + + NSRunLoopMode get currentMode { + return _lib._objc_msgSend_20(_id, _lib._sel_currentMode1); + } + + CFRunLoopRef getCFRunLoop() { + return _lib._objc_msgSend_487(_id, _lib._sel_getCFRunLoop1); + } + + void addTimer_forMode_(NSTimer? timer, NSRunLoopMode mode) { + return _lib._objc_msgSend_494( + _id, _lib._sel_addTimer_forMode_1, timer?._id ?? ffi.nullptr, mode); + } + + void addPort_forMode_(NSPort? aPort, NSRunLoopMode mode) { + return _lib._objc_msgSend_495( + _id, _lib._sel_addPort_forMode_1, aPort?._id ?? ffi.nullptr, mode); + } + + void removePort_forMode_(NSPort? aPort, NSRunLoopMode mode) { + return _lib._objc_msgSend_495( + _id, _lib._sel_removePort_forMode_1, aPort?._id ?? ffi.nullptr, mode); + } + + NSDate limitDateForMode_(NSRunLoopMode mode) { + final _ret = + _lib._objc_msgSend_496(_id, _lib._sel_limitDateForMode_1, mode); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + void acceptInputForMode_beforeDate_(NSRunLoopMode mode, NSDate? limitDate) { + return _lib._objc_msgSend_497( + _id, + _lib._sel_acceptInputForMode_beforeDate_1, + mode, + limitDate?._id ?? ffi.nullptr); + } + + void run() { + return _lib._objc_msgSend_1(_id, _lib._sel_run1); + } + + void runUntilDate_(NSDate? limitDate) { + return _lib._objc_msgSend_472( + _id, _lib._sel_runUntilDate_1, limitDate?._id ?? ffi.nullptr); + } + + bool runMode_beforeDate_(NSRunLoopMode mode, NSDate? limitDate) { + return _lib._objc_msgSend_498(_id, _lib._sel_runMode_beforeDate_1, mode, + limitDate?._id ?? ffi.nullptr); + } + + void configureAsServer() { + return _lib._objc_msgSend_1(_id, _lib._sel_configureAsServer1); + } + + void performInModes_block_(NSArray? modes, ObjCBlock16 block) { + return _lib._objc_msgSend_499(_id, _lib._sel_performInModes_block_1, + modes?._id ?? ffi.nullptr, block._impl); + } + + void performBlock_(ObjCBlock16 block) { + return _lib._objc_msgSend_465(_id, _lib._sel_performBlock_1, block._impl); + } + + void performSelector_target_argument_order_modes_( + ffi.Pointer aSelector, + NSObject target, + NSObject arg, + int order, + NSArray? modes) { + return _lib._objc_msgSend_500( + _id, + _lib._sel_performSelector_target_argument_order_modes_1, + aSelector, + target._id, + arg._id, + order, + modes?._id ?? ffi.nullptr); + } + + void cancelPerformSelector_target_argument_( + ffi.Pointer aSelector, NSObject target, NSObject arg) { + return _lib._objc_msgSend_466( + _id, + _lib._sel_cancelPerformSelector_target_argument_1, + aSelector, + target._id, + arg._id); + } + + void cancelPerformSelectorsWithTarget_(NSObject target) { + return _lib._objc_msgSend_15( + _id, _lib._sel_cancelPerformSelectorsWithTarget_1, target._id); + } + + static NSRunLoop new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSRunLoop1, _lib._sel_new1); + return NSRunLoop._(_ret, _lib, retain: false, release: true); + } + + static NSRunLoop alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSRunLoop1, _lib._sel_alloc1); + return NSRunLoop._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSRunLoop1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSRunLoop1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSRunLoop1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSRunLoop1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSRunLoop1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSRunLoop1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSRunLoop1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSRunLoop1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSRunLoop1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSRunLoopMode = ffi.Pointer; +typedef CFRunLoopRef = ffi.Pointer<__CFRunLoop>; + +class __CFRunLoop extends ffi.Opaque {} + +class NSTimer extends NSObject { + NSTimer._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSTimer] that points to the same underlying object as [other]. + static NSTimer castFrom(T other) { + return NSTimer._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSTimer] that wraps the given raw object pointer. + static NSTimer castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSTimer._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSTimer]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSTimer1); + } + + static NSTimer timerWithTimeInterval_invocation_repeats_( + AVFAudio _lib, double ti, NSInvocation? invocation, bool yesOrNo) { + final _ret = _lib._objc_msgSend_488( + _lib._class_NSTimer1, + _lib._sel_timerWithTimeInterval_invocation_repeats_1, + ti, + invocation?._id ?? ffi.nullptr, + yesOrNo); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + static NSTimer scheduledTimerWithTimeInterval_invocation_repeats_( + AVFAudio _lib, double ti, NSInvocation? invocation, bool yesOrNo) { + final _ret = _lib._objc_msgSend_488( + _lib._class_NSTimer1, + _lib._sel_scheduledTimerWithTimeInterval_invocation_repeats_1, + ti, + invocation?._id ?? ffi.nullptr, + yesOrNo); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + static NSTimer timerWithTimeInterval_target_selector_userInfo_repeats_( + AVFAudio _lib, + double ti, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject userInfo, + bool yesOrNo) { + final _ret = _lib._objc_msgSend_489( + _lib._class_NSTimer1, + _lib._sel_timerWithTimeInterval_target_selector_userInfo_repeats_1, + ti, + aTarget._id, + aSelector, + userInfo._id, + yesOrNo); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + static NSTimer + scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_( + AVFAudio _lib, + double ti, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject userInfo, + bool yesOrNo) { + final _ret = _lib._objc_msgSend_489( + _lib._class_NSTimer1, + _lib._sel_scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_1, + ti, + aTarget._id, + aSelector, + userInfo._id, + yesOrNo); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + static NSTimer timerWithTimeInterval_repeats_block_( + AVFAudio _lib, double interval, bool repeats, ObjCBlock17 block) { + final _ret = _lib._objc_msgSend_490( + _lib._class_NSTimer1, + _lib._sel_timerWithTimeInterval_repeats_block_1, + interval, + repeats, + block._impl); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + static NSTimer scheduledTimerWithTimeInterval_repeats_block_( + AVFAudio _lib, double interval, bool repeats, ObjCBlock17 block) { + final _ret = _lib._objc_msgSend_490( + _lib._class_NSTimer1, + _lib._sel_scheduledTimerWithTimeInterval_repeats_block_1, + interval, + repeats, + block._impl); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + NSTimer initWithFireDate_interval_repeats_block_( + NSDate? date, double interval, bool repeats, ObjCBlock17 block) { + final _ret = _lib._objc_msgSend_491( + _id, + _lib._sel_initWithFireDate_interval_repeats_block_1, + date?._id ?? ffi.nullptr, + interval, + repeats, + block._impl); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + NSTimer initWithFireDate_interval_target_selector_userInfo_repeats_( + NSDate? date, + double ti, + NSObject t, + ffi.Pointer s, + NSObject ui, + bool rep) { + final _ret = _lib._objc_msgSend_492( + _id, + _lib._sel_initWithFireDate_interval_target_selector_userInfo_repeats_1, + date?._id ?? ffi.nullptr, + ti, + t._id, + s, + ui._id, + rep); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + void fire() { + return _lib._objc_msgSend_1(_id, _lib._sel_fire1); + } + + NSDate? get fireDate { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_fireDate1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + set fireDate(NSDate? value) { + _lib._objc_msgSend_493( + _id, _lib._sel_setFireDate_1, value?._id ?? ffi.nullptr); + } + + double get timeInterval { + return _lib._objc_msgSend_149(_id, _lib._sel_timeInterval1); + } + + double get tolerance { + return _lib._objc_msgSend_149(_id, _lib._sel_tolerance1); + } + + set tolerance(double value) { + _lib._objc_msgSend_474(_id, _lib._sel_setTolerance_1, value); + } + + void invalidate() { + return _lib._objc_msgSend_1(_id, _lib._sel_invalidate1); + } + + bool get valid { + return _lib._objc_msgSend_12(_id, _lib._sel_isValid1); + } + + NSObject get userInfo { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_userInfo1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSTimer new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSTimer1, _lib._sel_new1); + return NSTimer._(_ret, _lib, retain: false, release: true); + } + + static NSTimer alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSTimer1, _lib._sel_alloc1); + return NSTimer._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSTimer1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSTimer1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSTimer1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSTimer1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSTimer1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSTimer1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSTimer1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSTimer1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSTimer1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock17_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock17_closureRegistry = {}; +int _ObjCBlock17_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock17_registerClosure(Function fn) { + final id = ++_ObjCBlock17_closureRegistryIndex; + _ObjCBlock17_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock17_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return _ObjCBlock17_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock17 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock17._(this._impl, this._lib); + ObjCBlock17.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock17_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock17.fromFunction( + this._lib, void Function(ffi.Pointer arg0) fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock17_closureTrampoline) + .cast(), + _ObjCBlock17_registerClosure(fn)); + void call(ffi.Pointer arg0) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_impl, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class NSConnection extends NSObject { + NSConnection._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSConnection] that points to the same underlying object as [other]. + static NSConnection castFrom(T other) { + return NSConnection._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSConnection] that wraps the given raw object pointer. + static NSConnection castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSConnection._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSConnection]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSConnection1); + } + + NSDictionary? get statistics { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_statistics1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSArray allConnections(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSConnection1, _lib._sel_allConnections1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSConnection defaultConnection(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_504( + _lib._class_NSConnection1, _lib._sel_defaultConnection1); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSConnection connectionWithRegisteredName_host_( + AVFAudio _lib, NSString? name, NSString? hostName) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSConnection1, + _lib._sel_connectionWithRegisteredName_host_1, + name?._id ?? ffi.nullptr, + hostName?._id ?? ffi.nullptr); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSConnection connectionWithRegisteredName_host_usingNameServer_( + AVFAudio _lib, + NSString? name, + NSString? hostName, + NSPortNameServer? server) { + final _ret = _lib._objc_msgSend_509( + _lib._class_NSConnection1, + _lib._sel_connectionWithRegisteredName_host_usingNameServer_1, + name?._id ?? ffi.nullptr, + hostName?._id ?? ffi.nullptr, + server?._id ?? ffi.nullptr); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSDistantObject rootProxyForConnectionWithRegisteredName_host_( + AVFAudio _lib, NSString? name, NSString? hostName) { + final _ret = _lib._objc_msgSend_512( + _lib._class_NSConnection1, + _lib._sel_rootProxyForConnectionWithRegisteredName_host_1, + name?._id ?? ffi.nullptr, + hostName?._id ?? ffi.nullptr); + return NSDistantObject._(_ret, _lib, retain: true, release: true); + } + + static NSDistantObject + rootProxyForConnectionWithRegisteredName_host_usingNameServer_( + AVFAudio _lib, + NSString? name, + NSString? hostName, + NSPortNameServer? server) { + final _ret = _lib._objc_msgSend_513( + _lib._class_NSConnection1, + _lib._sel_rootProxyForConnectionWithRegisteredName_host_usingNameServer_1, + name?._id ?? ffi.nullptr, + hostName?._id ?? ffi.nullptr, + server?._id ?? ffi.nullptr); + return NSDistantObject._(_ret, _lib, retain: true, release: true); + } + + static NSConnection serviceConnectionWithName_rootObject_usingNameServer_( + AVFAudio _lib, NSString? name, NSObject root, NSPortNameServer? server) { + final _ret = _lib._objc_msgSend_514( + _lib._class_NSConnection1, + _lib._sel_serviceConnectionWithName_rootObject_usingNameServer_1, + name?._id ?? ffi.nullptr, + root._id, + server?._id ?? ffi.nullptr); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSConnection serviceConnectionWithName_rootObject_( + AVFAudio _lib, NSString? name, NSObject root) { + final _ret = _lib._objc_msgSend_157( + _lib._class_NSConnection1, + _lib._sel_serviceConnectionWithName_rootObject_1, + name?._id ?? ffi.nullptr, + root._id); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + double get requestTimeout { + return _lib._objc_msgSend_149(_id, _lib._sel_requestTimeout1); + } + + set requestTimeout(double value) { + _lib._objc_msgSend_474(_id, _lib._sel_setRequestTimeout_1, value); + } + + double get replyTimeout { + return _lib._objc_msgSend_149(_id, _lib._sel_replyTimeout1); + } + + set replyTimeout(double value) { + _lib._objc_msgSend_474(_id, _lib._sel_setReplyTimeout_1, value); + } + + NSObject get rootObject { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_rootObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set rootObject(NSObject value) { + _lib._objc_msgSend_368(_id, _lib._sel_setRootObject_1, value._id); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + _lib._objc_msgSend_368( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + bool get independentConversationQueueing { + return _lib._objc_msgSend_12( + _id, _lib._sel_independentConversationQueueing1); + } + + set independentConversationQueueing(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setIndependentConversationQueueing_1, value); + } + + bool get valid { + return _lib._objc_msgSend_12(_id, _lib._sel_isValid1); + } + + NSDistantObject? get rootProxy { + final _ret = _lib._objc_msgSend_515(_id, _lib._sel_rootProxy1); + return _ret.address == 0 + ? null + : NSDistantObject._(_ret, _lib, retain: true, release: true); + } + + void invalidate() { + return _lib._objc_msgSend_1(_id, _lib._sel_invalidate1); + } + + void addRequestMode_(NSString? rmode) { + return _lib._objc_msgSend_186( + _id, _lib._sel_addRequestMode_1, rmode?._id ?? ffi.nullptr); + } + + void removeRequestMode_(NSString? rmode) { + return _lib._objc_msgSend_186( + _id, _lib._sel_removeRequestMode_1, rmode?._id ?? ffi.nullptr); + } + + NSArray? get requestModes { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_requestModes1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + bool registerName_(NSString? name) { + return _lib._objc_msgSend_59( + _id, _lib._sel_registerName_1, name?._id ?? ffi.nullptr); + } + + bool registerName_withNameServer_(NSString? name, NSPortNameServer? server) { + return _lib._objc_msgSend_516(_id, _lib._sel_registerName_withNameServer_1, + name?._id ?? ffi.nullptr, server?._id ?? ffi.nullptr); + } + + static NSConnection connectionWithReceivePort_sendPort_( + AVFAudio _lib, NSPort? receivePort, NSPort? sendPort) { + final _ret = _lib._objc_msgSend_517( + _lib._class_NSConnection1, + _lib._sel_connectionWithReceivePort_sendPort_1, + receivePort?._id ?? ffi.nullptr, + sendPort?._id ?? ffi.nullptr); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSObject currentConversation(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSConnection1, _lib._sel_currentConversation1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSConnection initWithReceivePort_sendPort_( + NSPort? receivePort, NSPort? sendPort) { + final _ret = _lib._objc_msgSend_517( + _id, + _lib._sel_initWithReceivePort_sendPort_1, + receivePort?._id ?? ffi.nullptr, + sendPort?._id ?? ffi.nullptr); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + NSPort? get sendPort { + final _ret = _lib._objc_msgSend_485(_id, _lib._sel_sendPort1); + return _ret.address == 0 + ? null + : NSPort._(_ret, _lib, retain: true, release: true); + } + + NSPort? get receivePort { + final _ret = _lib._objc_msgSend_485(_id, _lib._sel_receivePort1); + return _ret.address == 0 + ? null + : NSPort._(_ret, _lib, retain: true, release: true); + } + + void enableMultipleThreads() { + return _lib._objc_msgSend_1(_id, _lib._sel_enableMultipleThreads1); + } + + bool get multipleThreadsEnabled { + return _lib._objc_msgSend_12(_id, _lib._sel_multipleThreadsEnabled1); + } + + void addRunLoop_(NSRunLoop? runloop) { + return _lib._objc_msgSend_518( + _id, _lib._sel_addRunLoop_1, runloop?._id ?? ffi.nullptr); + } + + void removeRunLoop_(NSRunLoop? runloop) { + return _lib._objc_msgSend_518( + _id, _lib._sel_removeRunLoop_1, runloop?._id ?? ffi.nullptr); + } + + void runInNewThread() { + return _lib._objc_msgSend_1(_id, _lib._sel_runInNewThread1); + } + + NSArray? get remoteObjects { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_remoteObjects1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get localObjects { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_localObjects1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + void dispatchWithComponents_(NSArray? components) { + return _lib._objc_msgSend_412(_id, _lib._sel_dispatchWithComponents_1, + components?._id ?? ffi.nullptr); + } + + static NSConnection new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSConnection1, _lib._sel_new1); + return NSConnection._(_ret, _lib, retain: false, release: true); + } + + static NSConnection alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSConnection1, _lib._sel_alloc1); + return NSConnection._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSConnection1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSConnection1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSConnection1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSConnection1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSConnection1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSConnection1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSConnection1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSConnection1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSConnection1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSPortNameServer extends NSObject { + NSPortNameServer._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSPortNameServer] that points to the same underlying object as [other]. + static NSPortNameServer castFrom(T other) { + return NSPortNameServer._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSPortNameServer] that wraps the given raw object pointer. + static NSPortNameServer castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSPortNameServer._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSPortNameServer]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSPortNameServer1); + } + + static NSPortNameServer systemDefaultPortNameServer(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_505( + _lib._class_NSPortNameServer1, _lib._sel_systemDefaultPortNameServer1); + return NSPortNameServer._(_ret, _lib, retain: true, release: true); + } + + NSPort portForName_(NSString? name) { + final _ret = _lib._objc_msgSend_506( + _id, _lib._sel_portForName_1, name?._id ?? ffi.nullptr); + return NSPort._(_ret, _lib, retain: true, release: true); + } + + NSPort portForName_host_(NSString? name, NSString? host) { + final _ret = _lib._objc_msgSend_507(_id, _lib._sel_portForName_host_1, + name?._id ?? ffi.nullptr, host?._id ?? ffi.nullptr); + return NSPort._(_ret, _lib, retain: true, release: true); + } + + bool registerPort_name_(NSPort? port, NSString? name) { + return _lib._objc_msgSend_508(_id, _lib._sel_registerPort_name_1, + port?._id ?? ffi.nullptr, name?._id ?? ffi.nullptr); + } + + bool removePortForName_(NSString? name) { + return _lib._objc_msgSend_59( + _id, _lib._sel_removePortForName_1, name?._id ?? ffi.nullptr); + } + + static NSPortNameServer new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPortNameServer1, _lib._sel_new1); + return NSPortNameServer._(_ret, _lib, retain: false, release: true); + } + + static NSPortNameServer alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPortNameServer1, _lib._sel_alloc1); + return NSPortNameServer._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSPortNameServer1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSPortNameServer1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSPortNameServer1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPortNameServer1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSPortNameServer1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSPortNameServer1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSPortNameServer1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSPortNameServer1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPortNameServer1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSDistantObject extends NSProxy { + NSDistantObject._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSDistantObject] that points to the same underlying object as [other]. + static NSDistantObject castFrom(T other) { + return NSDistantObject._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSDistantObject] that wraps the given raw object pointer. + static NSDistantObject castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSDistantObject._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSDistantObject]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSDistantObject1); + } + + static NSObject proxyWithTarget_connection_( + AVFAudio _lib, NSObject target, NSConnection? connection) { + final _ret = _lib._objc_msgSend_510( + _lib._class_NSDistantObject1, + _lib._sel_proxyWithTarget_connection_1, + target._id, + connection?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSDistantObject initWithTarget_connection_( + NSObject target, NSConnection? connection) { + final _ret = _lib._objc_msgSend_510( + _id, + _lib._sel_initWithTarget_connection_1, + target._id, + connection?._id ?? ffi.nullptr); + return NSDistantObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject proxyWithLocal_connection_( + AVFAudio _lib, NSObject target, NSConnection? connection) { + final _ret = _lib._objc_msgSend_510( + _lib._class_NSDistantObject1, + _lib._sel_proxyWithLocal_connection_1, + target._id, + connection?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSDistantObject initWithLocal_connection_( + NSObject target, NSConnection? connection) { + final _ret = _lib._objc_msgSend_510( + _id, + _lib._sel_initWithLocal_connection_1, + target._id, + connection?._id ?? ffi.nullptr); + return NSDistantObject._(_ret, _lib, retain: true, release: true); + } + + NSDistantObject initWithCoder_(NSCoder? inCoder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, inCoder?._id ?? ffi.nullptr); + return NSDistantObject._(_ret, _lib, retain: true, release: true); + } + + void setProtocolForProxy_(Protocol? proto) { + return _lib._objc_msgSend_511( + _id, _lib._sel_setProtocolForProxy_1, proto?._id ?? ffi.nullptr); + } + + NSConnection? get connectionForProxy { + final _ret = _lib._objc_msgSend_504(_id, _lib._sel_connectionForProxy1); + return _ret.address == 0 + ? null + : NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSObject alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDistantObject1, _lib._sel_alloc1); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static bool respondsToSelector_( + AVFAudio _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_4(_lib._class_NSDistantObject1, + _lib._sel_respondsToSelector_1, aSelector); + } +} + +class NSProxy extends _ObjCWrapper { + NSProxy._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSProxy] that points to the same underlying object as [other]. + static NSProxy castFrom(T other) { + return NSProxy._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSProxy] that wraps the given raw object pointer. + static NSProxy castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSProxy._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSProxy]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSProxy1); + } + + static NSObject alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSProxy1, _lib._sel_alloc1); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static NSObject allocWithZone_(AVFAudio _lib, ffi.Pointer zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSProxy1, _lib._sel_allocWithZone_1, zone); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static NSObject class1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSProxy1, _lib._sel_class1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void forwardInvocation_(NSInvocation? invocation) { + return _lib._objc_msgSend_372( + _id, _lib._sel_forwardInvocation_1, invocation?._id ?? ffi.nullptr); + } + + NSMethodSignature methodSignatureForSelector_(ffi.Pointer sel) { + final _ret = _lib._objc_msgSend_373( + _id, _lib._sel_methodSignatureForSelector_1, sel); + return NSMethodSignature._(_ret, _lib, retain: true, release: true); + } + + void dealloc() { + return _lib._objc_msgSend_1(_id, _lib._sel_dealloc1); + } + + void finalize() { + return _lib._objc_msgSend_1(_id, _lib._sel_finalize1); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get debugDescription { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_debugDescription1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + static bool respondsToSelector_( + AVFAudio _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_4( + _lib._class_NSProxy1, _lib._sel_respondsToSelector_1, aSelector); + } + + bool allowsWeakReference() { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsWeakReference1); + } + + bool retainWeakReference() { + return _lib._objc_msgSend_12(_id, _lib._sel_retainWeakReference1); + } +} + +class NSClassDescription extends NSObject { + NSClassDescription._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSClassDescription] that points to the same underlying object as [other]. + static NSClassDescription castFrom(T other) { + return NSClassDescription._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSClassDescription] that wraps the given raw object pointer. + static NSClassDescription castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSClassDescription._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSClassDescription]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSClassDescription1); + } + + static void registerClassDescription_forClass_( + AVFAudio _lib, NSClassDescription? description, NSObject aClass) { + return _lib._objc_msgSend_523( + _lib._class_NSClassDescription1, + _lib._sel_registerClassDescription_forClass_1, + description?._id ?? ffi.nullptr, + aClass._id); + } + + static void invalidateClassDescriptionCache(AVFAudio _lib) { + return _lib._objc_msgSend_1(_lib._class_NSClassDescription1, + _lib._sel_invalidateClassDescriptionCache1); + } + + static NSClassDescription classDescriptionForClass_( + AVFAudio _lib, NSObject aClass) { + final _ret = _lib._objc_msgSend_524(_lib._class_NSClassDescription1, + _lib._sel_classDescriptionForClass_1, aClass._id); + return NSClassDescription._(_ret, _lib, retain: true, release: true); + } + + @override + NSArray? get attributeKeys { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_attributeKeys1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + @override + NSArray? get toOneRelationshipKeys { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_toOneRelationshipKeys1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + @override + NSArray? get toManyRelationshipKeys { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_toManyRelationshipKeys1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + @override + NSString inverseForRelationshipKey_(NSString? relationshipKey) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_inverseForRelationshipKey_1, + relationshipKey?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSClassDescription new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSClassDescription1, _lib._sel_new1); + return NSClassDescription._(_ret, _lib, retain: false, release: true); + } + + static NSClassDescription alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSClassDescription1, _lib._sel_alloc1); + return NSClassDescription._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSClassDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSClassDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSClassDescription1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSClassDescription1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSClassDescription1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSClassDescription1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSClassDescription1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSClassDescription1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSClassDescription1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSScriptObjectSpecifier extends NSObject { + NSScriptObjectSpecifier._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSScriptObjectSpecifier] that points to the same underlying object as [other]. + static NSScriptObjectSpecifier castFrom(T other) { + return NSScriptObjectSpecifier._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSScriptObjectSpecifier] that wraps the given raw object pointer. + static NSScriptObjectSpecifier castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSScriptObjectSpecifier._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSScriptObjectSpecifier]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSScriptObjectSpecifier1); + } + + static NSScriptObjectSpecifier objectSpecifierWithDescriptor_( + AVFAudio _lib, NSAppleEventDescriptor? descriptor) { + final _ret = _lib._objc_msgSend_548( + _lib._class_NSScriptObjectSpecifier1, + _lib._sel_objectSpecifierWithDescriptor_1, + descriptor?._id ?? ffi.nullptr); + return NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + NSScriptObjectSpecifier initWithContainerSpecifier_key_( + NSScriptObjectSpecifier? container, NSString? property) { + final _ret = _lib._objc_msgSend_549( + _id, + _lib._sel_initWithContainerSpecifier_key_1, + container?._id ?? ffi.nullptr, + property?._id ?? ffi.nullptr); + return NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + NSScriptObjectSpecifier + initWithContainerClassDescription_containerSpecifier_key_( + NSScriptClassDescription? classDesc, + NSScriptObjectSpecifier? container, + NSString? property) { + final _ret = _lib._objc_msgSend_566( + _id, + _lib._sel_initWithContainerClassDescription_containerSpecifier_key_1, + classDesc?._id ?? ffi.nullptr, + container?._id ?? ffi.nullptr, + property?._id ?? ffi.nullptr); + return NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + NSScriptObjectSpecifier initWithCoder_(NSCoder? inCoder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, inCoder?._id ?? ffi.nullptr); + return NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + NSScriptObjectSpecifier? get childSpecifier { + final _ret = _lib._objc_msgSend_556(_id, _lib._sel_childSpecifier1); + return _ret.address == 0 + ? null + : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + set childSpecifier(NSScriptObjectSpecifier? value) { + _lib._objc_msgSend_557( + _id, _lib._sel_setChildSpecifier_1, value?._id ?? ffi.nullptr); + } + + NSScriptObjectSpecifier? get containerSpecifier { + final _ret = _lib._objc_msgSend_556(_id, _lib._sel_containerSpecifier1); + return _ret.address == 0 + ? null + : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + set containerSpecifier(NSScriptObjectSpecifier? value) { + _lib._objc_msgSend_557( + _id, _lib._sel_setContainerSpecifier_1, value?._id ?? ffi.nullptr); + } + + bool get containerIsObjectBeingTested { + return _lib._objc_msgSend_12(_id, _lib._sel_containerIsObjectBeingTested1); + } + + set containerIsObjectBeingTested(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setContainerIsObjectBeingTested_1, value); + } + + bool get containerIsRangeContainerObject { + return _lib._objc_msgSend_12( + _id, _lib._sel_containerIsRangeContainerObject1); + } + + set containerIsRangeContainerObject(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setContainerIsRangeContainerObject_1, value); + } + + NSString? get key { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_key1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set key(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setKey_1, value?._id ?? ffi.nullptr); + } + + NSScriptClassDescription? get containerClassDescription { + final _ret = + _lib._objc_msgSend_552(_id, _lib._sel_containerClassDescription1); + return _ret.address == 0 + ? null + : NSScriptClassDescription._(_ret, _lib, retain: true, release: true); + } + + set containerClassDescription(NSScriptClassDescription? value) { + _lib._objc_msgSend_567(_id, _lib._sel_setContainerClassDescription_1, + value?._id ?? ffi.nullptr); + } + + NSScriptClassDescription? get keyClassDescription { + final _ret = _lib._objc_msgSend_552(_id, _lib._sel_keyClassDescription1); + return _ret.address == 0 + ? null + : NSScriptClassDescription._(_ret, _lib, retain: true, release: true); + } + + ffi.Pointer indicesOfObjectsByEvaluatingWithContainer_count_( + NSObject container, ffi.Pointer count) { + return _lib._objc_msgSend_568( + _id, + _lib._sel_indicesOfObjectsByEvaluatingWithContainer_count_1, + container._id, + count); + } + + NSObject objectsByEvaluatingWithContainers_(NSObject containers) { + final _ret = _lib._objc_msgSend_16( + _id, _lib._sel_objectsByEvaluatingWithContainers_1, containers._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject get objectsByEvaluatingSpecifier { + final _ret = + _lib._objc_msgSend_2(_id, _lib._sel_objectsByEvaluatingSpecifier1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + int get evaluationErrorNumber { + return _lib._objc_msgSend_78(_id, _lib._sel_evaluationErrorNumber1); + } + + set evaluationErrorNumber(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setEvaluationErrorNumber_1, value); + } + + NSScriptObjectSpecifier? get evaluationErrorSpecifier { + final _ret = + _lib._objc_msgSend_556(_id, _lib._sel_evaluationErrorSpecifier1); + return _ret.address == 0 + ? null + : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor? get descriptor { + final _ret = _lib._objc_msgSend_526(_id, _lib._sel_descriptor1); + return _ret.address == 0 + ? null + : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSScriptObjectSpecifier new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScriptObjectSpecifier1, _lib._sel_new1); + return NSScriptObjectSpecifier._(_ret, _lib, retain: false, release: true); + } + + static NSScriptObjectSpecifier alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScriptObjectSpecifier1, _lib._sel_alloc1); + return NSScriptObjectSpecifier._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSScriptObjectSpecifier1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSScriptObjectSpecifier1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSScriptObjectSpecifier1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSScriptObjectSpecifier1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSScriptObjectSpecifier1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSScriptObjectSpecifier1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSScriptObjectSpecifier1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSScriptObjectSpecifier1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSScriptObjectSpecifier1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSAppleEventDescriptor extends NSObject { + NSAppleEventDescriptor._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSAppleEventDescriptor] that points to the same underlying object as [other]. + static NSAppleEventDescriptor castFrom(T other) { + return NSAppleEventDescriptor._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSAppleEventDescriptor] that wraps the given raw object pointer. + static NSAppleEventDescriptor castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSAppleEventDescriptor._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSAppleEventDescriptor]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSAppleEventDescriptor1); + } + + static NSAppleEventDescriptor nullDescriptor(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_526( + _lib._class_NSAppleEventDescriptor1, _lib._sel_nullDescriptor1); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithDescriptorType_bytes_length_( + AVFAudio _lib, + int descriptorType, + ffi.Pointer bytes, + int byteCount) { + final _ret = _lib._objc_msgSend_527( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithDescriptorType_bytes_length_1, + descriptorType, + bytes, + byteCount); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithDescriptorType_data_( + AVFAudio _lib, int descriptorType, NSData? data) { + final _ret = _lib._objc_msgSend_528( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithDescriptorType_data_1, + descriptorType, + data?._id ?? ffi.nullptr); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithBoolean_( + AVFAudio _lib, int boolean) { + final _ret = _lib._objc_msgSend_529(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithBoolean_1, boolean); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithEnumCode_( + AVFAudio _lib, int enumerator) { + final _ret = _lib._objc_msgSend_530(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithEnumCode_1, enumerator); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithInt32_( + AVFAudio _lib, int signedInt) { + final _ret = _lib._objc_msgSend_531(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithInt32_1, signedInt); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithDouble_( + AVFAudio _lib, double doubleValue) { + final _ret = _lib._objc_msgSend_532(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithDouble_1, doubleValue); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithTypeCode_( + AVFAudio _lib, int typeCode) { + final _ret = _lib._objc_msgSend_530(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithTypeCode_1, typeCode); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithString_( + AVFAudio _lib, NSString? string) { + final _ret = _lib._objc_msgSend_533(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithString_1, string?._id ?? ffi.nullptr); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithDate_( + AVFAudio _lib, NSDate? date) { + final _ret = _lib._objc_msgSend_534(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithDate_1, date?._id ?? ffi.nullptr); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithFileURL_( + AVFAudio _lib, NSURL? fileURL) { + final _ret = _lib._objc_msgSend_535(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithFileURL_1, fileURL?._id ?? ffi.nullptr); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor + appleEventWithEventClass_eventID_targetDescriptor_returnID_transactionID_( + AVFAudio _lib, + int eventClass, + int eventID, + NSAppleEventDescriptor? targetDescriptor, + int returnID, + int transactionID) { + final _ret = _lib._objc_msgSend_536( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_appleEventWithEventClass_eventID_targetDescriptor_returnID_transactionID_1, + eventClass, + eventID, + targetDescriptor?._id ?? ffi.nullptr, + returnID, + transactionID); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor listDescriptor(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_526( + _lib._class_NSAppleEventDescriptor1, _lib._sel_listDescriptor1); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor recordDescriptor(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_526( + _lib._class_NSAppleEventDescriptor1, _lib._sel_recordDescriptor1); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor currentProcessDescriptor(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_526(_lib._class_NSAppleEventDescriptor1, + _lib._sel_currentProcessDescriptor1); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithProcessIdentifier_( + AVFAudio _lib, int processIdentifier) { + final _ret = _lib._objc_msgSend_531(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithProcessIdentifier_1, processIdentifier); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithBundleIdentifier_( + AVFAudio _lib, NSString? bundleIdentifier) { + final _ret = _lib._objc_msgSend_533( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithBundleIdentifier_1, + bundleIdentifier?._id ?? ffi.nullptr); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithApplicationURL_( + AVFAudio _lib, NSURL? applicationURL) { + final _ret = _lib._objc_msgSend_535( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithApplicationURL_1, + applicationURL?._id ?? ffi.nullptr); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor initWithAEDescNoCopy_(ffi.Pointer aeDesc) { + final _ret = + _lib._objc_msgSend_537(_id, _lib._sel_initWithAEDescNoCopy_1, aeDesc); + return NSAppleEventDescriptor._(_ret, _lib, retain: false, release: true); + } + + NSAppleEventDescriptor initWithDescriptorType_bytes_length_( + int descriptorType, ffi.Pointer bytes, int byteCount) { + final _ret = _lib._objc_msgSend_538( + _id, + _lib._sel_initWithDescriptorType_bytes_length_1, + descriptorType, + bytes, + byteCount); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor initWithDescriptorType_data_( + int descriptorType, NSData? data) { + final _ret = _lib._objc_msgSend_539( + _id, + _lib._sel_initWithDescriptorType_data_1, + descriptorType, + data?._id ?? ffi.nullptr); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor + initWithEventClass_eventID_targetDescriptor_returnID_transactionID_( + int eventClass, + int eventID, + NSAppleEventDescriptor? targetDescriptor, + int returnID, + int transactionID) { + final _ret = _lib._objc_msgSend_540( + _id, + _lib._sel_initWithEventClass_eventID_targetDescriptor_returnID_transactionID_1, + eventClass, + eventID, + targetDescriptor?._id ?? ffi.nullptr, + returnID, + transactionID); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor initListDescriptor() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_initListDescriptor1); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor initRecordDescriptor() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_initRecordDescriptor1); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + ffi.Pointer get aeDesc { + return _lib._objc_msgSend_541(_id, _lib._sel_aeDesc1); + } + + int get descriptorType { + return _lib._objc_msgSend_191(_id, _lib._sel_descriptorType1); + } + + NSData? get data { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_data1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + int get booleanValue { + return _lib._objc_msgSend_210(_id, _lib._sel_booleanValue1); + } + + int get enumCodeValue { + return _lib._objc_msgSend_191(_id, _lib._sel_enumCodeValue1); + } + + int get int32Value { + return _lib._objc_msgSend_213(_id, _lib._sel_int32Value1); + } + + double get doubleValue { + return _lib._objc_msgSend_149(_id, _lib._sel_doubleValue1); + } + + int get typeCodeValue { + return _lib._objc_msgSend_191(_id, _lib._sel_typeCodeValue1); + } + + NSString? get stringValue { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_stringValue1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSDate? get dateValue { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_dateValue1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + NSURL? get fileURLValue { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_fileURLValue1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + int get eventClass { + return _lib._objc_msgSend_191(_id, _lib._sel_eventClass1); + } + + int get eventID { + return _lib._objc_msgSend_191(_id, _lib._sel_eventID1); + } + + int get returnID { + return _lib._objc_msgSend_211(_id, _lib._sel_returnID1); + } + + int get transactionID { + return _lib._objc_msgSend_213(_id, _lib._sel_transactionID1); + } + + void setParamDescriptor_forKeyword_( + NSAppleEventDescriptor? descriptor, int keyword) { + return _lib._objc_msgSend_542( + _id, + _lib._sel_setParamDescriptor_forKeyword_1, + descriptor?._id ?? ffi.nullptr, + keyword); + } + + NSAppleEventDescriptor paramDescriptorForKeyword_(int keyword) { + final _ret = _lib._objc_msgSend_530( + _id, _lib._sel_paramDescriptorForKeyword_1, keyword); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + void removeParamDescriptorWithKeyword_(int keyword) { + return _lib._objc_msgSend_543( + _id, _lib._sel_removeParamDescriptorWithKeyword_1, keyword); + } + + void setAttributeDescriptor_forKeyword_( + NSAppleEventDescriptor? descriptor, int keyword) { + return _lib._objc_msgSend_542( + _id, + _lib._sel_setAttributeDescriptor_forKeyword_1, + descriptor?._id ?? ffi.nullptr, + keyword); + } + + NSAppleEventDescriptor attributeDescriptorForKeyword_(int keyword) { + final _ret = _lib._objc_msgSend_530( + _id, _lib._sel_attributeDescriptorForKeyword_1, keyword); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor sendEventWithOptions_timeout_error_(int sendOptions, + double timeoutInSeconds, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_544( + _id, + _lib._sel_sendEventWithOptions_timeout_error_1, + sendOptions, + timeoutInSeconds, + error); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + bool get isRecordDescriptor { + return _lib._objc_msgSend_12(_id, _lib._sel_isRecordDescriptor1); + } + + int get numberOfItems { + return _lib._objc_msgSend_78(_id, _lib._sel_numberOfItems1); + } + + void insertDescriptor_atIndex_( + NSAppleEventDescriptor? descriptor, int index) { + return _lib._objc_msgSend_545(_id, _lib._sel_insertDescriptor_atIndex_1, + descriptor?._id ?? ffi.nullptr, index); + } + + NSAppleEventDescriptor descriptorAtIndex_(int index) { + final _ret = + _lib._objc_msgSend_546(_id, _lib._sel_descriptorAtIndex_1, index); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + void removeDescriptorAtIndex_(int index) { + return _lib._objc_msgSend_374( + _id, _lib._sel_removeDescriptorAtIndex_1, index); + } + + void setDescriptor_forKeyword_( + NSAppleEventDescriptor? descriptor, int keyword) { + return _lib._objc_msgSend_542(_id, _lib._sel_setDescriptor_forKeyword_1, + descriptor?._id ?? ffi.nullptr, keyword); + } + + NSAppleEventDescriptor descriptorForKeyword_(int keyword) { + final _ret = + _lib._objc_msgSend_530(_id, _lib._sel_descriptorForKeyword_1, keyword); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + void removeDescriptorWithKeyword_(int keyword) { + return _lib._objc_msgSend_543( + _id, _lib._sel_removeDescriptorWithKeyword_1, keyword); + } + + int keywordForDescriptorAtIndex_(int index) { + return _lib._objc_msgSend_547( + _id, _lib._sel_keywordForDescriptorAtIndex_1, index); + } + + NSAppleEventDescriptor coerceToDescriptorType_(int descriptorType) { + final _ret = _lib._objc_msgSend_530( + _id, _lib._sel_coerceToDescriptorType_1, descriptorType); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSAppleEventDescriptor1, _lib._sel_new1); + return NSAppleEventDescriptor._(_ret, _lib, retain: false, release: true); + } + + static NSAppleEventDescriptor alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSAppleEventDescriptor1, _lib._sel_alloc1); + return NSAppleEventDescriptor._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSAppleEventDescriptor1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSAppleEventDescriptor1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSAppleEventDescriptor1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSAppleEventDescriptor1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSAppleEventDescriptor1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef DescType = ResType; +typedef ResType = FourCharCode; +typedef Boolean = ffi.UnsignedChar; +typedef SInt32 = ffi.Int; +typedef AEEventClass = FourCharCode; +typedef AEEventID = FourCharCode; +typedef AEReturnID = SInt16; +typedef SInt16 = ffi.Short; +typedef AETransactionID = SInt32; +typedef pid_t = __darwin_pid_t; +typedef __darwin_pid_t = __int32_t; +typedef __int32_t = ffi.Int; + +@ffi.Packed(2) +class AEDesc extends ffi.Struct { + @DescType() + external int descriptorType; + + external AEDataStorage dataHandle; +} + +typedef AEDataStorage = ffi.Pointer; +typedef AEDataStorageType = ffi.Pointer; + +class OpaqueAEDataStorageType extends ffi.Opaque {} + +typedef AEKeyword = FourCharCode; + +abstract class NSAppleEventSendOptions { + static const int NSAppleEventSendNoReply = 1; + static const int NSAppleEventSendQueueReply = 2; + static const int NSAppleEventSendWaitForReply = 3; + static const int NSAppleEventSendNeverInteract = 16; + static const int NSAppleEventSendCanInteract = 32; + static const int NSAppleEventSendAlwaysInteract = 48; + static const int NSAppleEventSendCanSwitchLayer = 64; + static const int NSAppleEventSendDontRecord = 4096; + static const int NSAppleEventSendDontExecute = 8192; + static const int NSAppleEventSendDontAnnotate = 65536; + static const int NSAppleEventSendDefaultOptions = 35; +} + +class NSScriptClassDescription extends NSClassDescription { + NSScriptClassDescription._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSScriptClassDescription] that points to the same underlying object as [other]. + static NSScriptClassDescription castFrom(T other) { + return NSScriptClassDescription._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSScriptClassDescription] that wraps the given raw object pointer. + static NSScriptClassDescription castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSScriptClassDescription._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSScriptClassDescription]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSScriptClassDescription1); + } + + static NSScriptClassDescription classDescriptionForClass_( + AVFAudio _lib, NSObject aClass) { + final _ret = _lib._objc_msgSend_550(_lib._class_NSScriptClassDescription1, + _lib._sel_classDescriptionForClass_1, aClass._id); + return NSScriptClassDescription._(_ret, _lib, retain: true, release: true); + } + + NSScriptClassDescription initWithSuiteName_className_dictionary_( + NSString? suiteName, + NSString? className, + NSDictionary? classDeclaration) { + final _ret = _lib._objc_msgSend_551( + _id, + _lib._sel_initWithSuiteName_className_dictionary_1, + suiteName?._id ?? ffi.nullptr, + className?._id ?? ffi.nullptr, + classDeclaration?._id ?? ffi.nullptr); + return NSScriptClassDescription._(_ret, _lib, retain: true, release: true); + } + + NSString? get suiteName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_suiteName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get className { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_className1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get implementationClassName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_implementationClassName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSScriptClassDescription? get superclassDescription { + final _ret = _lib._objc_msgSend_552(_id, _lib._sel_superclassDescription1); + return _ret.address == 0 + ? null + : NSScriptClassDescription._(_ret, _lib, retain: true, release: true); + } + + int get appleEventCode { + return _lib._objc_msgSend_191(_id, _lib._sel_appleEventCode1); + } + + bool matchesAppleEventCode_(int appleEventCode) { + return _lib._objc_msgSend_173( + _id, _lib._sel_matchesAppleEventCode_1, appleEventCode); + } + + bool supportsCommand_(NSScriptCommandDescription? commandDescription) { + return _lib._objc_msgSend_562(_id, _lib._sel_supportsCommand_1, + commandDescription?._id ?? ffi.nullptr); + } + + ffi.Pointer selectorForCommand_( + NSScriptCommandDescription? commandDescription) { + return _lib._objc_msgSend_563(_id, _lib._sel_selectorForCommand_1, + commandDescription?._id ?? ffi.nullptr); + } + + NSString typeForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_64( + _id, _lib._sel_typeForKey_1, key?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSScriptClassDescription classDescriptionForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_564( + _id, _lib._sel_classDescriptionForKey_1, key?._id ?? ffi.nullptr); + return NSScriptClassDescription._(_ret, _lib, retain: true, release: true); + } + + int appleEventCodeForKey_(NSString? key) { + return _lib._objc_msgSend_553( + _id, _lib._sel_appleEventCodeForKey_1, key?._id ?? ffi.nullptr); + } + + NSString keyWithAppleEventCode_(int appleEventCode) { + final _ret = _lib._objc_msgSend_565( + _id, _lib._sel_keyWithAppleEventCode_1, appleEventCode); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get defaultSubcontainerAttributeKey { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_defaultSubcontainerAttributeKey1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool isLocationRequiredToCreateForKey_(NSString? toManyRelationshipKey) { + return _lib._objc_msgSend_59( + _id, + _lib._sel_isLocationRequiredToCreateForKey_1, + toManyRelationshipKey?._id ?? ffi.nullptr); + } + + bool hasPropertyForKey_(NSString? key) { + return _lib._objc_msgSend_59( + _id, _lib._sel_hasPropertyForKey_1, key?._id ?? ffi.nullptr); + } + + bool hasOrderedToManyRelationshipForKey_(NSString? key) { + return _lib._objc_msgSend_59( + _id, + _lib._sel_hasOrderedToManyRelationshipForKey_1, + key?._id ?? ffi.nullptr); + } + + bool hasReadablePropertyForKey_(NSString? key) { + return _lib._objc_msgSend_59( + _id, _lib._sel_hasReadablePropertyForKey_1, key?._id ?? ffi.nullptr); + } + + bool hasWritablePropertyForKey_(NSString? key) { + return _lib._objc_msgSend_59( + _id, _lib._sel_hasWritablePropertyForKey_1, key?._id ?? ffi.nullptr); + } + + bool isReadOnlyKey_(NSString? key) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isReadOnlyKey_1, key?._id ?? ffi.nullptr); + } + + static void registerClassDescription_forClass_( + AVFAudio _lib, NSClassDescription? description, NSObject aClass) { + return _lib._objc_msgSend_523( + _lib._class_NSScriptClassDescription1, + _lib._sel_registerClassDescription_forClass_1, + description?._id ?? ffi.nullptr, + aClass._id); + } + + static void invalidateClassDescriptionCache(AVFAudio _lib) { + return _lib._objc_msgSend_1(_lib._class_NSScriptClassDescription1, + _lib._sel_invalidateClassDescriptionCache1); + } + + static NSScriptClassDescription new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScriptClassDescription1, _lib._sel_new1); + return NSScriptClassDescription._(_ret, _lib, retain: false, release: true); + } + + static NSScriptClassDescription alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScriptClassDescription1, _lib._sel_alloc1); + return NSScriptClassDescription._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSScriptClassDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSScriptClassDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSScriptClassDescription1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSScriptClassDescription1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSScriptClassDescription1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSScriptClassDescription1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSScriptClassDescription1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSScriptClassDescription1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSScriptClassDescription1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSScriptCommandDescription extends NSObject { + NSScriptCommandDescription._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSScriptCommandDescription] that points to the same underlying object as [other]. + static NSScriptCommandDescription castFrom(T other) { + return NSScriptCommandDescription._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSScriptCommandDescription] that wraps the given raw object pointer. + static NSScriptCommandDescription castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSScriptCommandDescription._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSScriptCommandDescription]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSScriptCommandDescription1); + } + + @override + NSObject init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSScriptCommandDescription initWithSuiteName_commandName_dictionary_( + NSString? suiteName, + NSString? commandName, + NSDictionary? commandDeclaration) { + final _ret = _lib._objc_msgSend_551( + _id, + _lib._sel_initWithSuiteName_commandName_dictionary_1, + suiteName?._id ?? ffi.nullptr, + commandName?._id ?? ffi.nullptr, + commandDeclaration?._id ?? ffi.nullptr); + return NSScriptCommandDescription._(_ret, _lib, + retain: true, release: true); + } + + NSScriptCommandDescription initWithCoder_(NSCoder? inCoder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, inCoder?._id ?? ffi.nullptr); + return NSScriptCommandDescription._(_ret, _lib, + retain: true, release: true); + } + + NSString? get suiteName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_suiteName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get commandName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_commandName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get appleEventClassCode { + return _lib._objc_msgSend_191(_id, _lib._sel_appleEventClassCode1); + } + + int get appleEventCode { + return _lib._objc_msgSend_191(_id, _lib._sel_appleEventCode1); + } + + NSString? get commandClassName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_commandClassName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get returnType { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_returnType1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get appleEventCodeForReturnType { + return _lib._objc_msgSend_191(_id, _lib._sel_appleEventCodeForReturnType1); + } + + NSArray? get argumentNames { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_argumentNames1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString typeForArgumentWithName_(NSString? argumentName) { + final _ret = _lib._objc_msgSend_64(_id, _lib._sel_typeForArgumentWithName_1, + argumentName?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + int appleEventCodeForArgumentWithName_(NSString? argumentName) { + return _lib._objc_msgSend_553( + _id, + _lib._sel_appleEventCodeForArgumentWithName_1, + argumentName?._id ?? ffi.nullptr); + } + + bool isOptionalArgumentWithName_(NSString? argumentName) { + return _lib._objc_msgSend_59(_id, _lib._sel_isOptionalArgumentWithName_1, + argumentName?._id ?? ffi.nullptr); + } + + NSScriptCommand createCommandInstance() { + final _ret = _lib._objc_msgSend_560(_id, _lib._sel_createCommandInstance1); + return NSScriptCommand._(_ret, _lib, retain: true, release: true); + } + + NSScriptCommand createCommandInstanceWithZone_(ffi.Pointer zone) { + final _ret = _lib._objc_msgSend_561( + _id, _lib._sel_createCommandInstanceWithZone_1, zone); + return NSScriptCommand._(_ret, _lib, retain: true, release: true); + } + + static NSScriptCommandDescription new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScriptCommandDescription1, _lib._sel_new1); + return NSScriptCommandDescription._(_ret, _lib, + retain: false, release: true); + } + + static NSScriptCommandDescription alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScriptCommandDescription1, _lib._sel_alloc1); + return NSScriptCommandDescription._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSScriptCommandDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSScriptCommandDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSScriptCommandDescription1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSScriptCommandDescription1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSScriptCommandDescription1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSScriptCommandDescription1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSScriptCommandDescription1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSScriptCommandDescription1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSScriptCommandDescription1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSScriptCommand extends NSObject { + NSScriptCommand._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSScriptCommand] that points to the same underlying object as [other]. + static NSScriptCommand castFrom(T other) { + return NSScriptCommand._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSScriptCommand] that wraps the given raw object pointer. + static NSScriptCommand castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSScriptCommand._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSScriptCommand]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSScriptCommand1); + } + + NSScriptCommand initWithCommandDescription_( + NSScriptCommandDescription? commandDef) { + final _ret = _lib._objc_msgSend_554(_id, + _lib._sel_initWithCommandDescription_1, commandDef?._id ?? ffi.nullptr); + return NSScriptCommand._(_ret, _lib, retain: true, release: true); + } + + NSScriptCommand initWithCoder_(NSCoder? inCoder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, inCoder?._id ?? ffi.nullptr); + return NSScriptCommand._(_ret, _lib, retain: true, release: true); + } + + NSScriptCommandDescription? get commandDescription { + final _ret = _lib._objc_msgSend_555(_id, _lib._sel_commandDescription1); + return _ret.address == 0 + ? null + : NSScriptCommandDescription._(_ret, _lib, retain: true, release: true); + } + + NSObject get directParameter { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_directParameter1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set directParameter(NSObject value) { + _lib._objc_msgSend_368(_id, _lib._sel_setDirectParameter_1, value._id); + } + + NSScriptObjectSpecifier? get receiversSpecifier { + final _ret = _lib._objc_msgSend_556(_id, _lib._sel_receiversSpecifier1); + return _ret.address == 0 + ? null + : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + set receiversSpecifier(NSScriptObjectSpecifier? value) { + _lib._objc_msgSend_557( + _id, _lib._sel_setReceiversSpecifier_1, value?._id ?? ffi.nullptr); + } + + NSObject get evaluatedReceivers { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_evaluatedReceivers1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get arguments { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_arguments1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set arguments(NSDictionary? value) { + _lib._objc_msgSend_165( + _id, _lib._sel_setArguments_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get evaluatedArguments { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_evaluatedArguments1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + bool get wellFormed { + return _lib._objc_msgSend_12(_id, _lib._sel_isWellFormed1); + } + + NSObject performDefaultImplementation() { + final _ret = + _lib._objc_msgSend_2(_id, _lib._sel_performDefaultImplementation1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject executeCommand() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_executeCommand1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + int get scriptErrorNumber { + return _lib._objc_msgSend_78(_id, _lib._sel_scriptErrorNumber1); + } + + set scriptErrorNumber(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setScriptErrorNumber_1, value); + } + + NSAppleEventDescriptor? get scriptErrorOffendingObjectDescriptor { + final _ret = _lib._objc_msgSend_526( + _id, _lib._sel_scriptErrorOffendingObjectDescriptor1); + return _ret.address == 0 + ? null + : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + set scriptErrorOffendingObjectDescriptor(NSAppleEventDescriptor? value) { + _lib._objc_msgSend_559( + _id, + _lib._sel_setScriptErrorOffendingObjectDescriptor_1, + value?._id ?? ffi.nullptr); + } + + NSAppleEventDescriptor? get scriptErrorExpectedTypeDescriptor { + final _ret = _lib._objc_msgSend_526( + _id, _lib._sel_scriptErrorExpectedTypeDescriptor1); + return _ret.address == 0 + ? null + : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + set scriptErrorExpectedTypeDescriptor(NSAppleEventDescriptor? value) { + _lib._objc_msgSend_559( + _id, + _lib._sel_setScriptErrorExpectedTypeDescriptor_1, + value?._id ?? ffi.nullptr); + } + + NSString? get scriptErrorString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_scriptErrorString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set scriptErrorString(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setScriptErrorString_1, value?._id ?? ffi.nullptr); + } + + static NSScriptCommand currentCommand(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_560( + _lib._class_NSScriptCommand1, _lib._sel_currentCommand1); + return NSScriptCommand._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor? get appleEvent { + final _ret = _lib._objc_msgSend_526(_id, _lib._sel_appleEvent1); + return _ret.address == 0 + ? null + : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + void suspendExecution() { + return _lib._objc_msgSend_1(_id, _lib._sel_suspendExecution1); + } + + void resumeExecutionWithResult_(NSObject result) { + return _lib._objc_msgSend_15( + _id, _lib._sel_resumeExecutionWithResult_1, result._id); + } + + static NSScriptCommand new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSScriptCommand1, _lib._sel_new1); + return NSScriptCommand._(_ret, _lib, retain: false, release: true); + } + + static NSScriptCommand alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSScriptCommand1, _lib._sel_alloc1); + return NSScriptCommand._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSScriptCommand1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSScriptCommand1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSScriptCommand1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSScriptCommand1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSScriptCommand1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSScriptCommand1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSScriptCommand1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSScriptCommand1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScriptCommand1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSItemProvider extends NSObject { + NSItemProvider._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSItemProvider] that points to the same underlying object as [other]. + static NSItemProvider castFrom(T other) { + return NSItemProvider._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSItemProvider] that wraps the given raw object pointer. + static NSItemProvider castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSItemProvider._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSItemProvider]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSItemProvider1); + } + + @override + NSItemProvider init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSItemProvider._(_ret, _lib, retain: true, release: true); + } + + void registerDataRepresentationForTypeIdentifier_visibility_loadHandler_( + NSString? typeIdentifier, int visibility, ObjCBlock18 loadHandler) { + return _lib._objc_msgSend_588( + _id, + _lib._sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + visibility, + loadHandler._impl); + } + + void + registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_( + NSString? typeIdentifier, + int fileOptions, + int visibility, + ObjCBlock20 loadHandler) { + return _lib._objc_msgSend_589( + _id, + _lib._sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + fileOptions, + visibility, + loadHandler._impl); + } + + NSArray? get registeredTypeIdentifiers { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_registeredTypeIdentifiers1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray registeredTypeIdentifiersWithFileOptions_(int fileOptions) { + final _ret = _lib._objc_msgSend_590( + _id, _lib._sel_registeredTypeIdentifiersWithFileOptions_1, fileOptions); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + bool hasItemConformingToTypeIdentifier_(NSString? typeIdentifier) { + return _lib._objc_msgSend_59( + _id, + _lib._sel_hasItemConformingToTypeIdentifier_1, + typeIdentifier?._id ?? ffi.nullptr); + } + + bool hasRepresentationConformingToTypeIdentifier_fileOptions_( + NSString? typeIdentifier, int fileOptions) { + return _lib._objc_msgSend_591( + _id, + _lib._sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1, + typeIdentifier?._id ?? ffi.nullptr, + fileOptions); + } + + NSProgress loadDataRepresentationForTypeIdentifier_completionHandler_( + NSString? typeIdentifier, ObjCBlock19 completionHandler) { + final _ret = _lib._objc_msgSend_592( + _id, + _lib._sel_loadDataRepresentationForTypeIdentifier_completionHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + completionHandler._impl); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + NSProgress loadFileRepresentationForTypeIdentifier_completionHandler_( + NSString? typeIdentifier, ObjCBlock22 completionHandler) { + final _ret = _lib._objc_msgSend_593( + _id, + _lib._sel_loadFileRepresentationForTypeIdentifier_completionHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + completionHandler._impl); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + NSProgress loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_( + NSString? typeIdentifier, ObjCBlock21 completionHandler) { + final _ret = _lib._objc_msgSend_594( + _id, + _lib._sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + completionHandler._impl); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + NSString? get suggestedName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_suggestedName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set suggestedName(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setSuggestedName_1, value?._id ?? ffi.nullptr); + } + + NSItemProvider initWithObject_(NSObject? object) { + final _ret = _lib._objc_msgSend_16( + _id, _lib._sel_initWithObject_1, object?._id ?? ffi.nullptr); + return NSItemProvider._(_ret, _lib, retain: true, release: true); + } + + void registerObject_visibility_(NSObject? object, int visibility) { + return _lib._objc_msgSend_595(_id, _lib._sel_registerObject_visibility_1, + object?._id ?? ffi.nullptr, visibility); + } + + void registerObjectOfClass_visibility_loadHandler_( + NSObject? aClass, int visibility, ObjCBlock23 loadHandler) { + return _lib._objc_msgSend_596( + _id, + _lib._sel_registerObjectOfClass_visibility_loadHandler_1, + aClass?._id ?? ffi.nullptr, + visibility, + loadHandler._impl); + } + + bool canLoadObjectOfClass_(NSObject? aClass) { + return _lib._objc_msgSend_0( + _id, _lib._sel_canLoadObjectOfClass_1, aClass?._id ?? ffi.nullptr); + } + + NSProgress loadObjectOfClass_completionHandler_( + NSObject? aClass, ObjCBlock24 completionHandler) { + final _ret = _lib._objc_msgSend_597( + _id, + _lib._sel_loadObjectOfClass_completionHandler_1, + aClass?._id ?? ffi.nullptr, + completionHandler._impl); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + NSItemProvider initWithItem_typeIdentifier_( + NSObject? item, NSString? typeIdentifier) { + final _ret = _lib._objc_msgSend_272( + _id, + _lib._sel_initWithItem_typeIdentifier_1, + item?._id ?? ffi.nullptr, + typeIdentifier?._id ?? ffi.nullptr); + return NSItemProvider._(_ret, _lib, retain: true, release: true); + } + + NSItemProvider initWithContentsOfURL_(NSURL? fileURL) { + final _ret = _lib._objc_msgSend_226( + _id, _lib._sel_initWithContentsOfURL_1, fileURL?._id ?? ffi.nullptr); + return NSItemProvider._(_ret, _lib, retain: true, release: true); + } + + void registerItemForTypeIdentifier_loadHandler_( + NSString? typeIdentifier, NSItemProviderLoadHandler loadHandler) { + return _lib._objc_msgSend_598( + _id, + _lib._sel_registerItemForTypeIdentifier_loadHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + loadHandler); + } + + void loadItemForTypeIdentifier_options_completionHandler_( + NSString? typeIdentifier, + NSDictionary? options, + NSItemProviderCompletionHandler completionHandler) { + return _lib._objc_msgSend_599( + _id, + _lib._sel_loadItemForTypeIdentifier_options_completionHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr, + completionHandler); + } + + NSItemProviderLoadHandler get previewImageHandler { + return _lib._objc_msgSend_600(_id, _lib._sel_previewImageHandler1); + } + + set previewImageHandler(NSItemProviderLoadHandler value) { + _lib._objc_msgSend_601(_id, _lib._sel_setPreviewImageHandler_1, value); + } + + void loadPreviewImageWithOptions_completionHandler_(NSDictionary? options, + NSItemProviderCompletionHandler completionHandler) { + return _lib._objc_msgSend_602( + _id, + _lib._sel_loadPreviewImageWithOptions_completionHandler_1, + options?._id ?? ffi.nullptr, + completionHandler); + } + + static NSItemProvider new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSItemProvider1, _lib._sel_new1); + return NSItemProvider._(_ret, _lib, retain: false, release: true); + } + + static NSItemProvider alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSItemProvider1, _lib._sel_alloc1); + return NSItemProvider._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSItemProvider1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSItemProvider1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSItemProvider1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSItemProvider1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSItemProvider1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSItemProvider1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSItemProvider1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSItemProvider1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSItemProvider1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSItemProviderRepresentationVisibility { + static const int NSItemProviderRepresentationVisibilityAll = 0; + static const int NSItemProviderRepresentationVisibilityTeam = 1; + static const int NSItemProviderRepresentationVisibilityGroup = 2; + static const int NSItemProviderRepresentationVisibilityOwnProcess = 3; +} + +ffi.Pointer _ObjCBlock18_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>()(arg0); +} + +final _ObjCBlock18_closureRegistry = {}; +int _ObjCBlock18_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock18_registerClosure(Function fn) { + final id = ++_ObjCBlock18_closureRegistryIndex; + _ObjCBlock18_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +ffi.Pointer _ObjCBlock18_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return _ObjCBlock18_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock18 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock18._(this._impl, this._lib); + ObjCBlock18.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock18_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock18.fromFunction(this._lib, + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0) fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock18_closureTrampoline) + .cast(), + _ObjCBlock18_registerClosure(fn)); + ffi.Pointer call(ffi.Pointer<_ObjCBlock> arg0) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>()(_impl, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class NSProgress extends NSObject { + NSProgress._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSProgress] that points to the same underlying object as [other]. + static NSProgress castFrom(T other) { + return NSProgress._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSProgress] that wraps the given raw object pointer. + static NSProgress castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSProgress._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSProgress]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSProgress1); + } + + static NSProgress currentProgress(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_577( + _lib._class_NSProgress1, _lib._sel_currentProgress1); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + static NSProgress progressWithTotalUnitCount_(AVFAudio _lib, int unitCount) { + final _ret = _lib._objc_msgSend_578(_lib._class_NSProgress1, + _lib._sel_progressWithTotalUnitCount_1, unitCount); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + static NSProgress discreteProgressWithTotalUnitCount_( + AVFAudio _lib, int unitCount) { + final _ret = _lib._objc_msgSend_578(_lib._class_NSProgress1, + _lib._sel_discreteProgressWithTotalUnitCount_1, unitCount); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + static NSProgress progressWithTotalUnitCount_parent_pendingUnitCount_( + AVFAudio _lib, + int unitCount, + NSProgress? parent, + int portionOfParentTotalUnitCount) { + final _ret = _lib._objc_msgSend_579( + _lib._class_NSProgress1, + _lib._sel_progressWithTotalUnitCount_parent_pendingUnitCount_1, + unitCount, + parent?._id ?? ffi.nullptr, + portionOfParentTotalUnitCount); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + NSProgress initWithParent_userInfo_(NSProgress? parentProgressOrNil) { + final _ret = _lib._objc_msgSend_580( + _id, + _lib._sel_initWithParent_userInfo_1, + parentProgressOrNil?._id ?? ffi.nullptr); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + void becomeCurrentWithPendingUnitCount_(int unitCount) { + return _lib._objc_msgSend_581( + _id, _lib._sel_becomeCurrentWithPendingUnitCount_1, unitCount); + } + + void performAsCurrentWithPendingUnitCount_usingBlock_( + int unitCount, ObjCBlock16 work) { + return _lib._objc_msgSend_582( + _id, + _lib._sel_performAsCurrentWithPendingUnitCount_usingBlock_1, + unitCount, + work._impl); + } + + void resignCurrent() { + return _lib._objc_msgSend_1(_id, _lib._sel_resignCurrent1); + } + + void addChild_withPendingUnitCount_(NSProgress? child, int inUnitCount) { + return _lib._objc_msgSend_583( + _id, + _lib._sel_addChild_withPendingUnitCount_1, + child?._id ?? ffi.nullptr, + inUnitCount); + } + + int get totalUnitCount { + return _lib._objc_msgSend_584(_id, _lib._sel_totalUnitCount1); + } + + set totalUnitCount(int value) { + _lib._objc_msgSend_585(_id, _lib._sel_setTotalUnitCount_1, value); + } + + int get completedUnitCount { + return _lib._objc_msgSend_584(_id, _lib._sel_completedUnitCount1); + } + + set completedUnitCount(int value) { + _lib._objc_msgSend_585(_id, _lib._sel_setCompletedUnitCount_1, value); + } + + NSString? get localizedDescription { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_localizedDescription1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set localizedDescription(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setLocalizedDescription_1, value?._id ?? ffi.nullptr); + } + + NSString? get localizedAdditionalDescription { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_localizedAdditionalDescription1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set localizedAdditionalDescription(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setLocalizedAdditionalDescription_1, + value?._id ?? ffi.nullptr); + } + + bool get cancellable { + return _lib._objc_msgSend_12(_id, _lib._sel_isCancellable1); + } + + set cancellable(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setCancellable_1, value); + } + + bool get pausable { + return _lib._objc_msgSend_12(_id, _lib._sel_isPausable1); + } + + set pausable(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setPausable_1, value); + } + + bool get cancelled { + return _lib._objc_msgSend_12(_id, _lib._sel_isCancelled1); + } + + bool get paused { + return _lib._objc_msgSend_12(_id, _lib._sel_isPaused1); + } + + ObjCBlock16 get cancellationHandler { + final _ret = _lib._objc_msgSend_586(_id, _lib._sel_cancellationHandler1); + return ObjCBlock16._(_ret, _lib); + } + + set cancellationHandler(ObjCBlock16 value) { + _lib._objc_msgSend_587( + _id, _lib._sel_setCancellationHandler_1, value._impl); + } + + ObjCBlock16 get pausingHandler { + final _ret = _lib._objc_msgSend_586(_id, _lib._sel_pausingHandler1); + return ObjCBlock16._(_ret, _lib); + } + + set pausingHandler(ObjCBlock16 value) { + _lib._objc_msgSend_587(_id, _lib._sel_setPausingHandler_1, value._impl); + } + + ObjCBlock16 get resumingHandler { + final _ret = _lib._objc_msgSend_586(_id, _lib._sel_resumingHandler1); + return ObjCBlock16._(_ret, _lib); + } + + set resumingHandler(ObjCBlock16 value) { + _lib._objc_msgSend_587(_id, _lib._sel_setResumingHandler_1, value._impl); + } + + void setUserInfoObject_forKey_( + NSObject objectOrNil, NSProgressUserInfoKey key) { + return _lib._objc_msgSend_122( + _id, _lib._sel_setUserInfoObject_forKey_1, objectOrNil._id, key); + } + + bool get indeterminate { + return _lib._objc_msgSend_12(_id, _lib._sel_isIndeterminate1); + } + + double get fractionCompleted { + return _lib._objc_msgSend_149(_id, _lib._sel_fractionCompleted1); + } + + bool get finished { + return _lib._objc_msgSend_12(_id, _lib._sel_isFinished1); + } + + void cancel() { + return _lib._objc_msgSend_1(_id, _lib._sel_cancel1); + } + + void pause() { + return _lib._objc_msgSend_1(_id, _lib._sel_pause1); + } + + void resume() { + return _lib._objc_msgSend_1(_id, _lib._sel_resume1); + } + + static NSProgress new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSProgress1, _lib._sel_new1); + return NSProgress._(_ret, _lib, retain: false, release: true); + } + + static NSProgress alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSProgress1, _lib._sel_alloc1); + return NSProgress._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSProgress1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSProgress1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSProgress1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSProgress1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSProgress1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSProgress1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSProgress1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSProgress1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSProgress1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSProgressUserInfoKey = ffi.Pointer; +void _ObjCBlock19_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock19_closureRegistry = {}; +int _ObjCBlock19_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock19_registerClosure(Function fn) { + final id = ++_ObjCBlock19_closureRegistryIndex; + _ObjCBlock19_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock19_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return _ObjCBlock19_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock19 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock19._(this._impl, this._lib); + ObjCBlock19.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : _impl = + _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock19_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock19.fromFunction( + this._lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock19_closureTrampoline) + .cast(), + _ObjCBlock19_registerClosure(fn)); + void call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_impl, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +abstract class NSItemProviderFileOptions { + static const int NSItemProviderFileOptionOpenInPlace = 1; +} + +ffi.Pointer _ObjCBlock20_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>()(arg0); +} + +final _ObjCBlock20_closureRegistry = {}; +int _ObjCBlock20_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock20_registerClosure(Function fn) { + final id = ++_ObjCBlock20_closureRegistryIndex; + _ObjCBlock20_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +ffi.Pointer _ObjCBlock20_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return _ObjCBlock20_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock20 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock20._(this._impl, this._lib); + ObjCBlock20.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock20_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock20.fromFunction(this._lib, + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0) fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock20_closureTrampoline) + .cast(), + _ObjCBlock20_registerClosure(fn)); + ffi.Pointer call(ffi.Pointer<_ObjCBlock> arg0) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>()(_impl, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +void _ObjCBlock21_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, bool arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock21_closureRegistry = {}; +int _ObjCBlock21_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock21_registerClosure(Function fn) { + final id = ++_ObjCBlock21_closureRegistryIndex; + _ObjCBlock21_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock21_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { + return _ObjCBlock21_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock21 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock21._(this._impl, this._lib); + ObjCBlock21.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, + ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock21_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock21.fromFunction( + this._lib, + void Function(ffi.Pointer arg0, bool arg1, + ffi.Pointer arg2) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock21_closureTrampoline) + .cast(), + _ObjCBlock21_registerClosure(fn)); + void call( + ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + bool arg1, + ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +void _ObjCBlock22_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock22_closureRegistry = {}; +int _ObjCBlock22_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock22_registerClosure(Function fn) { + final id = ++_ObjCBlock22_closureRegistryIndex; + _ObjCBlock22_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock22_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return _ObjCBlock22_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock22 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock22._(this._impl, this._lib); + ObjCBlock22.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : _impl = + _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock22_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock22.fromFunction( + this._lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock22_closureTrampoline) + .cast(), + _ObjCBlock22_registerClosure(fn)); + void call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_impl, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +ffi.Pointer _ObjCBlock23_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>()(arg0); +} + +final _ObjCBlock23_closureRegistry = {}; +int _ObjCBlock23_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock23_registerClosure(Function fn) { + final id = ++_ObjCBlock23_closureRegistryIndex; + _ObjCBlock23_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +ffi.Pointer _ObjCBlock23_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return _ObjCBlock23_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock23 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock23._(this._impl, this._lib); + ObjCBlock23.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock23_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock23.fromFunction(this._lib, + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0) fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock23_closureTrampoline) + .cast(), + _ObjCBlock23_registerClosure(fn)); + ffi.Pointer call(ffi.Pointer<_ObjCBlock> arg0) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>()(_impl, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +void _ObjCBlock24_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock24_closureRegistry = {}; +int _ObjCBlock24_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock24_registerClosure(Function fn) { + final id = ++_ObjCBlock24_closureRegistryIndex; + _ObjCBlock24_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock24_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return _ObjCBlock24_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock24 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock24._(this._impl, this._lib); + ObjCBlock24.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : _impl = + _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock24_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock24.fromFunction( + this._lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock24_closureTrampoline) + .cast(), + _ObjCBlock24_registerClosure(fn)); + void call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_impl, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +typedef NSItemProviderLoadHandler = ffi.Pointer<_ObjCBlock>; +void _ObjCBlock25_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock25_closureRegistry = {}; +int _ObjCBlock25_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock25_registerClosure(Function fn) { + final id = ++_ObjCBlock25_closureRegistryIndex; + _ObjCBlock25_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock25_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return _ObjCBlock25_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock25 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock25._(this._impl, this._lib); + ObjCBlock25.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock25_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock25.fromFunction( + this._lib, + void Function(NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, ffi.Pointer arg2) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock25_closureTrampoline) + .cast(), + _ObjCBlock25_registerClosure(fn)); + void call(NSItemProviderCompletionHandler arg0, ffi.Pointer arg1, + ffi.Pointer arg2) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +typedef NSItemProviderCompletionHandler = ffi.Pointer<_ObjCBlock>; + +class NSMutableString extends NSString { + NSMutableString._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableString] that points to the same underlying object as [other]. + static NSMutableString castFrom(T other) { + return NSMutableString._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSMutableString] that wraps the given raw object pointer. + static NSMutableString castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableString._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableString]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMutableString1); + } + + void replaceCharactersInRange_withString_(NSRange range, NSString? aString) { + return _lib._objc_msgSend_603( + _id, + _lib._sel_replaceCharactersInRange_withString_1, + range, + aString?._id ?? ffi.nullptr); + } + + void insertString_atIndex_(NSString? aString, int loc) { + return _lib._objc_msgSend_604(_id, _lib._sel_insertString_atIndex_1, + aString?._id ?? ffi.nullptr, loc); + } + + void deleteCharactersInRange_(NSRange range) { + return _lib._objc_msgSend_416( + _id, _lib._sel_deleteCharactersInRange_1, range); + } + + void appendString_(NSString? aString) { + return _lib._objc_msgSend_186( + _id, _lib._sel_appendString_1, aString?._id ?? ffi.nullptr); + } + + void appendFormat_(NSString? format) { + return _lib._objc_msgSend_186( + _id, _lib._sel_appendFormat_1, format?._id ?? ffi.nullptr); + } + + void setString_(NSString? aString) { + return _lib._objc_msgSend_186( + _id, _lib._sel_setString_1, aString?._id ?? ffi.nullptr); + } + + int replaceOccurrencesOfString_withString_options_range_(NSString? target, + NSString? replacement, int options, NSRange searchRange) { + return _lib._objc_msgSend_605( + _id, + _lib._sel_replaceOccurrencesOfString_withString_options_range_1, + target?._id ?? ffi.nullptr, + replacement?._id ?? ffi.nullptr, + options, + searchRange); + } + + bool applyTransform_reverse_range_updatedRange_(NSStringTransform transform, + bool reverse, NSRange range, NSRangePointer resultingRange) { + return _lib._objc_msgSend_606( + _id, + _lib._sel_applyTransform_reverse_range_updatedRange_1, + transform, + reverse, + range, + resultingRange); + } + + NSMutableString initWithCapacity_(int capacity) { + final _ret = + _lib._objc_msgSend_607(_id, _lib._sel_initWithCapacity_1, capacity); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithCapacity_(AVFAudio _lib, int capacity) { + final _ret = _lib._objc_msgSend_607( + _lib._class_NSMutableString1, _lib._sel_stringWithCapacity_1, capacity); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static ffi.Pointer getAvailableStringEncodings( + AVFAudio _lib) { + return _lib._objc_msgSend_318( + _lib._class_NSMutableString1, _lib._sel_availableStringEncodings1); + } + + static NSString localizedNameOfStringEncoding_(AVFAudio _lib, int encoding) { + final _ret = _lib._objc_msgSend_293(_lib._class_NSMutableString1, + _lib._sel_localizedNameOfStringEncoding_1, encoding); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static int getDefaultCStringEncoding(AVFAudio _lib) { + return _lib._objc_msgSend_10( + _lib._class_NSMutableString1, _lib._sel_defaultCStringEncoding1); + } + + static NSMutableString string(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableString1, _lib._sel_string1); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithString_(AVFAudio _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSMutableString1, + _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithCharacters_length_( + AVFAudio _lib, ffi.Pointer characters, int length) { + final _ret = _lib._objc_msgSend_331(_lib._class_NSMutableString1, + _lib._sel_stringWithCharacters_length_1, characters, length); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithUTF8String_( + AVFAudio _lib, ffi.Pointer nullTerminatedCString) { + final _ret = _lib._objc_msgSend_332(_lib._class_NSMutableString1, + _lib._sel_stringWithUTF8String_1, nullTerminatedCString); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithFormat_(AVFAudio _lib, NSString? format) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSMutableString1, + _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString localizedStringWithFormat_( + AVFAudio _lib, NSString? format) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSMutableString1, + _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithCString_encoding_( + AVFAudio _lib, ffi.Pointer cString, int enc) { + final _ret = _lib._objc_msgSend_339(_lib._class_NSMutableString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithContentsOfURL_encoding_error_(AVFAudio _lib, + NSURL? url, int enc, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_340( + _lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfURL_encoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithContentsOfFile_encoding_error_(AVFAudio _lib, + NSString? path, int enc, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_341( + _lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfFile_encoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithContentsOfURL_usedEncoding_error_( + AVFAudio _lib, + NSURL? url, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_342( + _lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithContentsOfFile_usedEncoding_error_( + AVFAudio _lib, + NSString? path, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_343( + _lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static int + stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( + AVFAudio _lib, + NSData? data, + NSDictionary? opts, + ffi.Pointer> string, + ffi.Pointer usedLossyConversion) { + return _lib._objc_msgSend_344( + _lib._class_NSMutableString1, + _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, + data?._id ?? ffi.nullptr, + opts?._id ?? ffi.nullptr, + string, + usedLossyConversion); + } + + static NSObject stringWithContentsOfFile_(AVFAudio _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject stringWithContentsOfURL_(AVFAudio _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_226(_lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject stringWithCString_length_( + AVFAudio _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_339(_lib._class_NSMutableString1, + _lib._sel_stringWithCString_length_1, bytes, length); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject stringWithCString_( + AVFAudio _lib, ffi.Pointer bytes) { + final _ret = _lib._objc_msgSend_332( + _lib._class_NSMutableString1, _lib._sel_stringWithCString_1, bytes); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSString pathWithComponents_(AVFAudio _lib, NSArray? components) { + final _ret = _lib._objc_msgSend_350(_lib._class_NSMutableString1, + _lib._sel_pathWithComponents_1, components?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableString1, _lib._sel_new1); + return NSMutableString._(_ret, _lib, retain: false, release: true); + } + + static NSMutableString alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableString1, _lib._sel_alloc1); + return NSMutableString._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMutableString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMutableString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMutableString1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableString1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableString1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableString1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMutableString1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSMutableString1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableString1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSNotification extends NSObject { + NSNotification._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSNotification] that points to the same underlying object as [other]. + static NSNotification castFrom(T other) { + return NSNotification._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSNotification] that wraps the given raw object pointer. + static NSNotification castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSNotification._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSNotification]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSNotification1); + } + + NSNotificationName get name { + return _lib._objc_msgSend_20(_id, _lib._sel_name1); + } + + NSObject get object { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_object1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get userInfo { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_userInfo1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSNotification initWithName_object_userInfo_( + NSNotificationName name, NSObject object, NSDictionary? userInfo) { + final _ret = _lib._objc_msgSend_608( + _id, + _lib._sel_initWithName_object_userInfo_1, + name, + object._id, + userInfo?._id ?? ffi.nullptr); + return NSNotification._(_ret, _lib, retain: true, release: true); + } + + NSNotification initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSNotification._(_ret, _lib, retain: true, release: true); + } + + static NSNotification notificationWithName_object_( + AVFAudio _lib, NSNotificationName aName, NSObject anObject) { + final _ret = _lib._objc_msgSend_157(_lib._class_NSNotification1, + _lib._sel_notificationWithName_object_1, aName, anObject._id); + return NSNotification._(_ret, _lib, retain: true, release: true); + } + + static NSNotification notificationWithName_object_userInfo_(AVFAudio _lib, + NSNotificationName aName, NSObject anObject, NSDictionary? aUserInfo) { + final _ret = _lib._objc_msgSend_608( + _lib._class_NSNotification1, + _lib._sel_notificationWithName_object_userInfo_1, + aName, + anObject._id, + aUserInfo?._id ?? ffi.nullptr); + return NSNotification._(_ret, _lib, retain: true, release: true); + } + + @override + NSNotification init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSNotification._(_ret, _lib, retain: true, release: true); + } + + static NSNotification new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSNotification1, _lib._sel_new1); + return NSNotification._(_ret, _lib, retain: false, release: true); + } + + static NSNotification alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSNotification1, _lib._sel_alloc1); + return NSNotification._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSNotification1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSNotification1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSNotification1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSNotification1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSNotification1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSNotification1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSNotification1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSNotification1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSNotification1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSNotificationName = ffi.Pointer; + +class NSBundle extends NSObject { + NSBundle._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSBundle] that points to the same underlying object as [other]. + static NSBundle castFrom(T other) { + return NSBundle._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSBundle] that wraps the given raw object pointer. + static NSBundle castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSBundle._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSBundle]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSBundle1); + } + + static NSBundle? getMainBundle(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_609(_lib._class_NSBundle1, _lib._sel_mainBundle1); + return _ret.address == 0 + ? null + : NSBundle._(_ret, _lib, retain: true, release: true); + } + + static NSBundle bundleWithPath_(AVFAudio _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSBundle1, + _lib._sel_bundleWithPath_1, path?._id ?? ffi.nullptr); + return NSBundle._(_ret, _lib, retain: true, release: true); + } + + NSBundle initWithPath_(NSString? path) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithPath_1, path?._id ?? ffi.nullptr); + return NSBundle._(_ret, _lib, retain: true, release: true); + } + + static NSBundle bundleWithURL_(AVFAudio _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_226(_lib._class_NSBundle1, + _lib._sel_bundleWithURL_1, url?._id ?? ffi.nullptr); + return NSBundle._(_ret, _lib, retain: true, release: true); + } + + NSBundle initWithURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_226( + _id, _lib._sel_initWithURL_1, url?._id ?? ffi.nullptr); + return NSBundle._(_ret, _lib, retain: true, release: true); + } + + static NSBundle bundleForClass_(AVFAudio _lib, NSObject aClass) { + final _ret = _lib._objc_msgSend_610( + _lib._class_NSBundle1, _lib._sel_bundleForClass_1, aClass._id); + return NSBundle._(_ret, _lib, retain: true, release: true); + } + + static NSBundle bundleWithIdentifier_(AVFAudio _lib, NSString? identifier) { + final _ret = _lib._objc_msgSend_611(_lib._class_NSBundle1, + _lib._sel_bundleWithIdentifier_1, identifier?._id ?? ffi.nullptr); + return NSBundle._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getAllBundles(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_80(_lib._class_NSBundle1, _lib._sel_allBundles1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getAllFrameworks(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_80(_lib._class_NSBundle1, _lib._sel_allFrameworks1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + bool load() { + return _lib._objc_msgSend_12(_id, _lib._sel_load1); + } + + bool get loaded { + return _lib._objc_msgSend_12(_id, _lib._sel_isLoaded1); + } + + bool unload() { + return _lib._objc_msgSend_12(_id, _lib._sel_unload1); + } + + bool preflightAndReturnError_(ffi.Pointer> error) { + return _lib._objc_msgSend_219( + _id, _lib._sel_preflightAndReturnError_1, error); + } + + bool loadAndReturnError_(ffi.Pointer> error) { + return _lib._objc_msgSend_219(_id, _lib._sel_loadAndReturnError_1, error); + } + + NSURL? get bundleURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_bundleURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get resourceURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_resourceURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get executableURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_executableURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL URLForAuxiliaryExecutable_(NSString? executableName) { + final _ret = _lib._objc_msgSend_34( + _id, + _lib._sel_URLForAuxiliaryExecutable_1, + executableName?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get privateFrameworksURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_privateFrameworksURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get sharedFrameworksURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_sharedFrameworksURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get sharedSupportURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_sharedSupportURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get builtInPlugInsURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_builtInPlugInsURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get appStoreReceiptURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_appStoreReceiptURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSString? get bundlePath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_bundlePath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get resourcePath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_resourcePath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get executablePath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_executablePath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString pathForAuxiliaryExecutable_(NSString? executableName) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_pathForAuxiliaryExecutable_1, + executableName?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get privateFrameworksPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_privateFrameworksPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get sharedFrameworksPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_sharedFrameworksPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get sharedSupportPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_sharedSupportPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get builtInPlugInsPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_builtInPlugInsPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + static NSURL URLForResource_withExtension_subdirectory_inBundleWithURL_( + AVFAudio _lib, + NSString? name, + NSString? ext, + NSString? subpath, + NSURL? bundleURL) { + final _ret = _lib._objc_msgSend_612( + _lib._class_NSBundle1, + _lib._sel_URLForResource_withExtension_subdirectory_inBundleWithURL_1, + name?._id ?? ffi.nullptr, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr, + bundleURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSArray URLsForResourcesWithExtension_subdirectory_inBundleWithURL_( + AVFAudio _lib, NSString? ext, NSString? subpath, NSURL? bundleURL) { + final _ret = _lib._objc_msgSend_613( + _lib._class_NSBundle1, + _lib._sel_URLsForResourcesWithExtension_subdirectory_inBundleWithURL_1, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr, + bundleURL?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSURL URLForResource_withExtension_(NSString? name, NSString? ext) { + final _ret = _lib._objc_msgSend_614( + _id, + _lib._sel_URLForResource_withExtension_1, + name?._id ?? ffi.nullptr, + ext?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL URLForResource_withExtension_subdirectory_( + NSString? name, NSString? ext, NSString? subpath) { + final _ret = _lib._objc_msgSend_615( + _id, + _lib._sel_URLForResource_withExtension_subdirectory_1, + name?._id ?? ffi.nullptr, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL URLForResource_withExtension_subdirectory_localization_(NSString? name, + NSString? ext, NSString? subpath, NSString? localizationName) { + final _ret = _lib._objc_msgSend_616( + _id, + _lib._sel_URLForResource_withExtension_subdirectory_localization_1, + name?._id ?? ffi.nullptr, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr, + localizationName?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSArray URLsForResourcesWithExtension_subdirectory_( + NSString? ext, NSString? subpath) { + final _ret = _lib._objc_msgSend_617( + _id, + _lib._sel_URLsForResourcesWithExtension_subdirectory_1, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray URLsForResourcesWithExtension_subdirectory_localization_( + NSString? ext, NSString? subpath, NSString? localizationName) { + final _ret = _lib._objc_msgSend_618( + _id, + _lib._sel_URLsForResourcesWithExtension_subdirectory_localization_1, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr, + localizationName?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSString pathForResource_ofType_inDirectory_( + AVFAudio _lib, NSString? name, NSString? ext, NSString? bundlePath) { + final _ret = _lib._objc_msgSend_619( + _lib._class_NSBundle1, + _lib._sel_pathForResource_ofType_inDirectory_1, + name?._id ?? ffi.nullptr, + ext?._id ?? ffi.nullptr, + bundlePath?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSArray pathsForResourcesOfType_inDirectory_( + AVFAudio _lib, NSString? ext, NSString? bundlePath) { + final _ret = _lib._objc_msgSend_617( + _lib._class_NSBundle1, + _lib._sel_pathsForResourcesOfType_inDirectory_1, + ext?._id ?? ffi.nullptr, + bundlePath?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString pathForResource_ofType_(NSString? name, NSString? ext) { + final _ret = _lib._objc_msgSend_324(_id, _lib._sel_pathForResource_ofType_1, + name?._id ?? ffi.nullptr, ext?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString pathForResource_ofType_inDirectory_forLocalization_(NSString? name, + NSString? ext, NSString? subpath, NSString? localizationName) { + final _ret = _lib._objc_msgSend_620( + _id, + _lib._sel_pathForResource_ofType_inDirectory_forLocalization_1, + name?._id ?? ffi.nullptr, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr, + localizationName?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray pathsForResourcesOfType_inDirectory_forLocalization_( + NSString? ext, NSString? subpath, NSString? localizationName) { + final _ret = _lib._objc_msgSend_618( + _id, + _lib._sel_pathsForResourcesOfType_inDirectory_forLocalization_1, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr, + localizationName?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForKey_value_table_( + NSString? key, NSString? value, NSString? tableName) { + final _ret = _lib._objc_msgSend_619( + _id, + _lib._sel_localizedStringForKey_value_table_1, + key?._id ?? ffi.nullptr, + value?._id ?? ffi.nullptr, + tableName?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString localizedAttributedStringForKey_value_table_( + NSString? key, NSString? value, NSString? tableName) { + final _ret = _lib._objc_msgSend_641( + _id, + _lib._sel_localizedAttributedStringForKey_value_table_1, + key?._id ?? ffi.nullptr, + value?._id ?? ffi.nullptr, + tableName?._id ?? ffi.nullptr); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSString? get bundleIdentifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_bundleIdentifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get infoDictionary { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_infoDictionary1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get localizedInfoDictionary { + final _ret = + _lib._objc_msgSend_164(_id, _lib._sel_localizedInfoDictionary1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSObject objectForInfoDictionaryKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_objectForInfoDictionaryKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject classNamed_(NSString? className) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_classNamed_1, className?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject get principalClass { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_principalClass1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSArray? get preferredLocalizations { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_preferredLocalizations1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get localizations { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_localizations1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get developmentLocalization { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_developmentLocalization1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + static NSArray preferredLocalizationsFromArray_( + AVFAudio _lib, NSArray? localizationsArray) { + final _ret = _lib._objc_msgSend_63( + _lib._class_NSBundle1, + _lib._sel_preferredLocalizationsFromArray_1, + localizationsArray?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray preferredLocalizationsFromArray_forPreferences_( + AVFAudio _lib, NSArray? localizationsArray, NSArray? preferencesArray) { + final _ret = _lib._objc_msgSend_642( + _lib._class_NSBundle1, + _lib._sel_preferredLocalizationsFromArray_forPreferences_1, + localizationsArray?._id ?? ffi.nullptr, + preferencesArray?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get executableArchitectures { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_executableArchitectures1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + void setPreservationPriority_forTags_(double priority, NSSet? tags) { + return _lib._objc_msgSend_643( + _id, + _lib._sel_setPreservationPriority_forTags_1, + priority, + tags?._id ?? ffi.nullptr); + } + + double preservationPriorityForTag_(NSString? tag) { + return _lib._objc_msgSend_269( + _id, _lib._sel_preservationPriorityForTag_1, tag?._id ?? ffi.nullptr); + } + + static NSBundle new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSBundle1, _lib._sel_new1); + return NSBundle._(_ret, _lib, retain: false, release: true); + } + + static NSBundle alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSBundle1, _lib._sel_alloc1); + return NSBundle._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSBundle1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSBundle1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSBundle1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSBundle1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSBundle1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSBundle1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSBundle1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSBundle1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSBundle1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSAttributedString extends NSObject { + NSAttributedString._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSAttributedString] that points to the same underlying object as [other]. + static NSAttributedString castFrom(T other) { + return NSAttributedString._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSAttributedString] that wraps the given raw object pointer. + static NSAttributedString castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSAttributedString._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSAttributedString]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSAttributedString1); + } + + NSString? get string { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_string1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSDictionary attributesAtIndex_effectiveRange_( + int location, NSRangePointer range) { + final _ret = _lib._objc_msgSend_621( + _id, _lib._sel_attributesAtIndex_effectiveRange_1, location, range); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + int get length { + return _lib._objc_msgSend_10(_id, _lib._sel_length1); + } + + NSObject attribute_atIndex_effectiveRange_( + NSAttributedStringKey attrName, int location, NSRangePointer range) { + final _ret = _lib._objc_msgSend_622( + _id, + _lib._sel_attribute_atIndex_effectiveRange_1, + attrName, + location, + range); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString attributedSubstringFromRange_(NSRange range) { + final _ret = _lib._objc_msgSend_623( + _id, _lib._sel_attributedSubstringFromRange_1, range); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSDictionary attributesAtIndex_longestEffectiveRange_inRange_( + int location, NSRangePointer range, NSRange rangeLimit) { + final _ret = _lib._objc_msgSend_624( + _id, + _lib._sel_attributesAtIndex_longestEffectiveRange_inRange_1, + location, + range, + rangeLimit); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSObject attribute_atIndex_longestEffectiveRange_inRange_( + NSAttributedStringKey attrName, + int location, + NSRangePointer range, + NSRange rangeLimit) { + final _ret = _lib._objc_msgSend_625( + _id, + _lib._sel_attribute_atIndex_longestEffectiveRange_inRange_1, + attrName, + location, + range, + rangeLimit); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool isEqualToAttributedString_(NSAttributedString? other) { + return _lib._objc_msgSend_626( + _id, _lib._sel_isEqualToAttributedString_1, other?._id ?? ffi.nullptr); + } + + NSAttributedString initWithString_(NSString? str) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, str?._id ?? ffi.nullptr); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString initWithString_attributes_( + NSString? str, NSDictionary? attrs) { + final _ret = _lib._objc_msgSend_352( + _id, + _lib._sel_initWithString_attributes_1, + str?._id ?? ffi.nullptr, + attrs?._id ?? ffi.nullptr); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString initWithAttributedString_(NSAttributedString? attrStr) { + final _ret = _lib._objc_msgSend_627( + _id, _lib._sel_initWithAttributedString_1, attrStr?._id ?? ffi.nullptr); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + void enumerateAttributesInRange_options_usingBlock_( + NSRange enumerationRange, int opts, ObjCBlock26 block) { + return _lib._objc_msgSend_628( + _id, + _lib._sel_enumerateAttributesInRange_options_usingBlock_1, + enumerationRange, + opts, + block._impl); + } + + void enumerateAttribute_inRange_options_usingBlock_( + NSAttributedStringKey attrName, + NSRange enumerationRange, + int opts, + ObjCBlock27 block) { + return _lib._objc_msgSend_629( + _id, + _lib._sel_enumerateAttribute_inRange_options_usingBlock_1, + attrName, + enumerationRange, + opts, + block._impl); + } + + NSAttributedString initWithContentsOfMarkdownFileAtURL_options_baseURL_error_( + NSURL? markdownFile, + NSAttributedStringMarkdownParsingOptions? options, + NSURL? baseURL, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_634( + _id, + _lib._sel_initWithContentsOfMarkdownFileAtURL_options_baseURL_error_1, + markdownFile?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr, + error); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString initWithMarkdown_options_baseURL_error_( + NSData? markdown, + NSAttributedStringMarkdownParsingOptions? options, + NSURL? baseURL, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_635( + _id, + _lib._sel_initWithMarkdown_options_baseURL_error_1, + markdown?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr, + error); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString initWithMarkdownString_options_baseURL_error_( + NSString? markdownString, + NSAttributedStringMarkdownParsingOptions? options, + NSURL? baseURL, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_636( + _id, + _lib._sel_initWithMarkdownString_options_baseURL_error_1, + markdownString?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr, + error); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString initWithFormat_options_locale_( + NSAttributedString? format, int options, NSLocale? locale) { + final _ret = _lib._objc_msgSend_637( + _id, + _lib._sel_initWithFormat_options_locale_1, + format?._id ?? ffi.nullptr, + options, + locale?._id ?? ffi.nullptr); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString initWithFormat_options_locale_arguments_( + NSAttributedString? format, + int options, + NSLocale? locale, + ffi.Pointer<__va_list_tag> arguments) { + final _ret = _lib._objc_msgSend_638( + _id, + _lib._sel_initWithFormat_options_locale_arguments_1, + format?._id ?? ffi.nullptr, + options, + locale?._id ?? ffi.nullptr, + arguments); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + static NSAttributedString localizedAttributedStringWithFormat_( + AVFAudio _lib, NSAttributedString? format) { + final _ret = _lib._objc_msgSend_627( + _lib._class_NSAttributedString1, + _lib._sel_localizedAttributedStringWithFormat_1, + format?._id ?? ffi.nullptr); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + static NSAttributedString localizedAttributedStringWithFormat_options_( + AVFAudio _lib, NSAttributedString? format, int options) { + final _ret = _lib._objc_msgSend_639( + _lib._class_NSAttributedString1, + _lib._sel_localizedAttributedStringWithFormat_options_1, + format?._id ?? ffi.nullptr, + options); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString attributedStringByInflectingString() { + final _ret = _lib._objc_msgSend_640( + _id, _lib._sel_attributedStringByInflectingString1); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + static NSAttributedString new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSAttributedString1, _lib._sel_new1); + return NSAttributedString._(_ret, _lib, retain: false, release: true); + } + + static NSAttributedString alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSAttributedString1, _lib._sel_alloc1); + return NSAttributedString._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSAttributedString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSAttributedString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSAttributedString1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSAttributedString1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSAttributedString1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSAttributedString1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSAttributedString1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSAttributedString1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSAttributedString1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSAttributedStringKey = ffi.Pointer; + +abstract class NSAttributedStringEnumerationOptions { + static const int NSAttributedStringEnumerationReverse = 2; + static const int + NSAttributedStringEnumerationLongestEffectiveRangeNotRequired = 1048576; +} + +void _ObjCBlock26_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock26_closureRegistry = {}; +int _ObjCBlock26_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock26_registerClosure(Function fn) { + final id = ++_ObjCBlock26_closureRegistryIndex; + _ObjCBlock26_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock26_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) { + return _ObjCBlock26_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock26 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock26._(this._impl, this._lib); + ObjCBlock26.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock26_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock26.fromFunction( + this._lib, + void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock26_closureTrampoline) + .cast(), + _ObjCBlock26_registerClosure(fn)); + void call( + ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +void _ObjCBlock27_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock27_closureRegistry = {}; +int _ObjCBlock27_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock27_registerClosure(Function fn) { + final id = ++_ObjCBlock27_closureRegistryIndex; + _ObjCBlock27_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock27_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) { + return _ObjCBlock27_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock27 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock27._(this._impl, this._lib); + ObjCBlock27.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock27_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock27.fromFunction( + this._lib, + void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock27_closureTrampoline) + .cast(), + _ObjCBlock27_registerClosure(fn)); + void call( + ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class NSAttributedStringMarkdownParsingOptions extends NSObject { + NSAttributedStringMarkdownParsingOptions._( + ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSAttributedStringMarkdownParsingOptions] that points to the same underlying object as [other]. + static NSAttributedStringMarkdownParsingOptions + castFrom(T other) { + return NSAttributedStringMarkdownParsingOptions._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSAttributedStringMarkdownParsingOptions] that wraps the given raw object pointer. + static NSAttributedStringMarkdownParsingOptions castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSAttributedStringMarkdownParsingOptions._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSAttributedStringMarkdownParsingOptions]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSAttributedStringMarkdownParsingOptions1); + } + + @override + NSAttributedStringMarkdownParsingOptions init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSAttributedStringMarkdownParsingOptions._(_ret, _lib, + retain: true, release: true); + } + + bool get allowsExtendedAttributes { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsExtendedAttributes1); + } + + set allowsExtendedAttributes(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setAllowsExtendedAttributes_1, value); + } + + int get interpretedSyntax { + return _lib._objc_msgSend_630(_id, _lib._sel_interpretedSyntax1); + } + + set interpretedSyntax(int value) { + _lib._objc_msgSend_631(_id, _lib._sel_setInterpretedSyntax_1, value); + } + + int get failurePolicy { + return _lib._objc_msgSend_632(_id, _lib._sel_failurePolicy1); + } + + set failurePolicy(int value) { + _lib._objc_msgSend_633(_id, _lib._sel_setFailurePolicy_1, value); + } + + NSString? get languageCode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_languageCode1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set languageCode(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setLanguageCode_1, value?._id ?? ffi.nullptr); + } + + static NSAttributedStringMarkdownParsingOptions new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSAttributedStringMarkdownParsingOptions1, _lib._sel_new1); + return NSAttributedStringMarkdownParsingOptions._(_ret, _lib, + retain: false, release: true); + } + + static NSAttributedStringMarkdownParsingOptions alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_alloc1); + return NSAttributedStringMarkdownParsingOptions._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, + aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSAttributedStringMarkdownInterpretedSyntax { + static const int NSAttributedStringMarkdownInterpretedSyntaxFull = 0; + static const int NSAttributedStringMarkdownInterpretedSyntaxInlineOnly = 1; + static const int + NSAttributedStringMarkdownInterpretedSyntaxInlineOnlyPreservingWhitespace = + 2; +} + +abstract class NSAttributedStringMarkdownParsingFailurePolicy { + static const int NSAttributedStringMarkdownParsingFailureReturnError = 0; + static const int + NSAttributedStringMarkdownParsingFailureReturnPartiallyParsedIfPossible = + 1; +} + +abstract class NSAttributedStringFormattingOptions { + static const int + NSAttributedStringFormattingInsertArgumentAttributesWithoutMerging = 1; + static const int NSAttributedStringFormattingApplyReplacementIndexAttribute = + 2; +} + +class NSMutableAttributedString extends NSAttributedString { + NSMutableAttributedString._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableAttributedString] that points to the same underlying object as [other]. + static NSMutableAttributedString castFrom(T other) { + return NSMutableAttributedString._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSMutableAttributedString] that wraps the given raw object pointer. + static NSMutableAttributedString castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableAttributedString._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableAttributedString]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMutableAttributedString1); + } + + void replaceCharactersInRange_withString_(NSRange range, NSString? str) { + return _lib._objc_msgSend_603( + _id, + _lib._sel_replaceCharactersInRange_withString_1, + range, + str?._id ?? ffi.nullptr); + } + + void setAttributes_range_(NSDictionary? attrs, NSRange range) { + return _lib._objc_msgSend_644( + _id, _lib._sel_setAttributes_range_1, attrs?._id ?? ffi.nullptr, range); + } + + NSMutableString? get mutableString { + final _ret = _lib._objc_msgSend_645(_id, _lib._sel_mutableString1); + return _ret.address == 0 + ? null + : NSMutableString._(_ret, _lib, retain: true, release: true); + } + + void addAttribute_value_range_( + NSAttributedStringKey name, NSObject value, NSRange range) { + return _lib._objc_msgSend_646( + _id, _lib._sel_addAttribute_value_range_1, name, value._id, range); + } + + void addAttributes_range_(NSDictionary? attrs, NSRange range) { + return _lib._objc_msgSend_644( + _id, _lib._sel_addAttributes_range_1, attrs?._id ?? ffi.nullptr, range); + } + + void removeAttribute_range_(NSAttributedStringKey name, NSRange range) { + return _lib._objc_msgSend_647( + _id, _lib._sel_removeAttribute_range_1, name, range); + } + + void replaceCharactersInRange_withAttributedString_( + NSRange range, NSAttributedString? attrString) { + return _lib._objc_msgSend_648( + _id, + _lib._sel_replaceCharactersInRange_withAttributedString_1, + range, + attrString?._id ?? ffi.nullptr); + } + + void insertAttributedString_atIndex_( + NSAttributedString? attrString, int loc) { + return _lib._objc_msgSend_649( + _id, + _lib._sel_insertAttributedString_atIndex_1, + attrString?._id ?? ffi.nullptr, + loc); + } + + void appendAttributedString_(NSAttributedString? attrString) { + return _lib._objc_msgSend_650(_id, _lib._sel_appendAttributedString_1, + attrString?._id ?? ffi.nullptr); + } + + void deleteCharactersInRange_(NSRange range) { + return _lib._objc_msgSend_416( + _id, _lib._sel_deleteCharactersInRange_1, range); + } + + void setAttributedString_(NSAttributedString? attrString) { + return _lib._objc_msgSend_650( + _id, _lib._sel_setAttributedString_1, attrString?._id ?? ffi.nullptr); + } + + void beginEditing() { + return _lib._objc_msgSend_1(_id, _lib._sel_beginEditing1); + } + + void endEditing() { + return _lib._objc_msgSend_1(_id, _lib._sel_endEditing1); + } + + void appendLocalizedFormat_(NSAttributedString? format) { + return _lib._objc_msgSend_650( + _id, _lib._sel_appendLocalizedFormat_1, format?._id ?? ffi.nullptr); + } + + static NSMutableAttributedString localizedAttributedStringWithFormat_( + AVFAudio _lib, NSAttributedString? format) { + final _ret = _lib._objc_msgSend_627( + _lib._class_NSMutableAttributedString1, + _lib._sel_localizedAttributedStringWithFormat_1, + format?._id ?? ffi.nullptr); + return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableAttributedString localizedAttributedStringWithFormat_options_( + AVFAudio _lib, NSAttributedString? format, int options) { + final _ret = _lib._objc_msgSend_639( + _lib._class_NSMutableAttributedString1, + _lib._sel_localizedAttributedStringWithFormat_options_1, + format?._id ?? ffi.nullptr, + options); + return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableAttributedString new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableAttributedString1, _lib._sel_new1); + return NSMutableAttributedString._(_ret, _lib, + retain: false, release: true); + } + + static NSMutableAttributedString alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableAttributedString1, _lib._sel_alloc1); + return NSMutableAttributedString._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMutableAttributedString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMutableAttributedString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMutableAttributedString1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableAttributedString1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableAttributedString1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableAttributedString1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMutableAttributedString1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSMutableAttributedString1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSMutableAttributedString1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSDateFormatter extends NSFormatter { + NSDateFormatter._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSDateFormatter] that points to the same underlying object as [other]. + static NSDateFormatter castFrom(T other) { + return NSDateFormatter._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSDateFormatter] that wraps the given raw object pointer. + static NSDateFormatter castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSDateFormatter._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSDateFormatter]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSDateFormatter1); + } + + int get formattingContext { + return _lib._objc_msgSend_655(_id, _lib._sel_formattingContext1); + } + + set formattingContext(int value) { + _lib._objc_msgSend_656(_id, _lib._sel_setFormattingContext_1, value); + } + + bool getObjectValue_forString_range_error_( + ffi.Pointer> obj, + NSString? string, + ffi.Pointer rangep, + ffi.Pointer> error) { + return _lib._objc_msgSend_657( + _id, + _lib._sel_getObjectValue_forString_range_error_1, + obj, + string?._id ?? ffi.nullptr, + rangep, + error); + } + + NSString stringFromDate_(NSDate? date) { + final _ret = _lib._objc_msgSend_161( + _id, _lib._sel_stringFromDate_1, date?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSDate dateFromString_(NSString? string) { + final _ret = _lib._objc_msgSend_496( + _id, _lib._sel_dateFromString_1, string?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSString localizedStringFromDate_dateStyle_timeStyle_( + AVFAudio _lib, NSDate? date, int dstyle, int tstyle) { + final _ret = _lib._objc_msgSend_658( + _lib._class_NSDateFormatter1, + _lib._sel_localizedStringFromDate_dateStyle_timeStyle_1, + date?._id ?? ffi.nullptr, + dstyle, + tstyle); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString dateFormatFromTemplate_options_locale_( + AVFAudio _lib, NSString? tmplate, int opts, NSLocale? locale) { + final _ret = _lib._objc_msgSend_659( + _lib._class_NSDateFormatter1, + _lib._sel_dateFormatFromTemplate_options_locale_1, + tmplate?._id ?? ffi.nullptr, + opts, + locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static int getDefaultFormatterBehavior(AVFAudio _lib) { + return _lib._objc_msgSend_660( + _lib._class_NSDateFormatter1, _lib._sel_defaultFormatterBehavior1); + } + + static void setDefaultFormatterBehavior(AVFAudio _lib, int value) { + _lib._objc_msgSend_661(_lib._class_NSDateFormatter1, + _lib._sel_setDefaultFormatterBehavior_1, value); + } + + void setLocalizedDateFormatFromTemplate_(NSString? dateFormatTemplate) { + return _lib._objc_msgSend_186( + _id, + _lib._sel_setLocalizedDateFormatFromTemplate_1, + dateFormatTemplate?._id ?? ffi.nullptr); + } + + NSString? get dateFormat { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_dateFormat1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set dateFormat(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setDateFormat_1, value?._id ?? ffi.nullptr); + } + + int get dateStyle { + return _lib._objc_msgSend_662(_id, _lib._sel_dateStyle1); + } + + set dateStyle(int value) { + _lib._objc_msgSend_663(_id, _lib._sel_setDateStyle_1, value); + } + + int get timeStyle { + return _lib._objc_msgSend_662(_id, _lib._sel_timeStyle1); + } + + set timeStyle(int value) { + _lib._objc_msgSend_663(_id, _lib._sel_setTimeStyle_1, value); + } + + NSLocale? get locale { + final _ret = _lib._objc_msgSend_176(_id, _lib._sel_locale1); + return _ret.address == 0 + ? null + : NSLocale._(_ret, _lib, retain: true, release: true); + } + + set locale(NSLocale? value) { + _lib._objc_msgSend_664( + _id, _lib._sel_setLocale_1, value?._id ?? ffi.nullptr); + } + + bool get generatesCalendarDates { + return _lib._objc_msgSend_12(_id, _lib._sel_generatesCalendarDates1); + } + + set generatesCalendarDates(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setGeneratesCalendarDates_1, value); + } + + int get formatterBehavior { + return _lib._objc_msgSend_660(_id, _lib._sel_formatterBehavior1); + } + + set formatterBehavior(int value) { + _lib._objc_msgSend_661(_id, _lib._sel_setFormatterBehavior_1, value); + } + + NSTimeZone? get timeZone { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_timeZone1); + return _ret.address == 0 + ? null + : NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + set timeZone(NSTimeZone? value) { + _lib._objc_msgSend_163( + _id, _lib._sel_setTimeZone_1, value?._id ?? ffi.nullptr); + } + + NSCalendar? get calendar { + final _ret = _lib._objc_msgSend_665(_id, _lib._sel_calendar1); + return _ret.address == 0 + ? null + : NSCalendar._(_ret, _lib, retain: true, release: true); + } + + set calendar(NSCalendar? value) { + _lib._objc_msgSend_671( + _id, _lib._sel_setCalendar_1, value?._id ?? ffi.nullptr); + } + + bool get lenient { + return _lib._objc_msgSend_12(_id, _lib._sel_isLenient1); + } + + set lenient(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setLenient_1, value); + } + + NSDate? get twoDigitStartDate { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_twoDigitStartDate1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + set twoDigitStartDate(NSDate? value) { + _lib._objc_msgSend_493( + _id, _lib._sel_setTwoDigitStartDate_1, value?._id ?? ffi.nullptr); + } + + NSDate? get defaultDate { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_defaultDate1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + set defaultDate(NSDate? value) { + _lib._objc_msgSend_493( + _id, _lib._sel_setDefaultDate_1, value?._id ?? ffi.nullptr); + } + + NSArray? get eraSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_eraSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set eraSymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setEraSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get monthSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_monthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set monthSymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setMonthSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get shortMonthSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_shortMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set shortMonthSymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setShortMonthSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get weekdaySymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_weekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set weekdaySymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setWeekdaySymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get shortWeekdaySymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_shortWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set shortWeekdaySymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setShortWeekdaySymbols_1, value?._id ?? ffi.nullptr); + } + + NSString? get AMSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_AMSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set AMSymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setAMSymbol_1, value?._id ?? ffi.nullptr); + } + + NSString? get PMSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_PMSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set PMSymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPMSymbol_1, value?._id ?? ffi.nullptr); + } + + NSArray? get longEraSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_longEraSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set longEraSymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setLongEraSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get veryShortMonthSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_veryShortMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set veryShortMonthSymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setVeryShortMonthSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get standaloneMonthSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_standaloneMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set standaloneMonthSymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setStandaloneMonthSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get shortStandaloneMonthSymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_shortStandaloneMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set shortStandaloneMonthSymbols(NSArray? value) { + _lib._objc_msgSend_696(_id, _lib._sel_setShortStandaloneMonthSymbols_1, + value?._id ?? ffi.nullptr); + } + + NSArray? get veryShortStandaloneMonthSymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_veryShortStandaloneMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set veryShortStandaloneMonthSymbols(NSArray? value) { + _lib._objc_msgSend_696(_id, _lib._sel_setVeryShortStandaloneMonthSymbols_1, + value?._id ?? ffi.nullptr); + } + + NSArray? get veryShortWeekdaySymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_veryShortWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set veryShortWeekdaySymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setVeryShortWeekdaySymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get standaloneWeekdaySymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_standaloneWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set standaloneWeekdaySymbols(NSArray? value) { + _lib._objc_msgSend_696(_id, _lib._sel_setStandaloneWeekdaySymbols_1, + value?._id ?? ffi.nullptr); + } + + NSArray? get shortStandaloneWeekdaySymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_shortStandaloneWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set shortStandaloneWeekdaySymbols(NSArray? value) { + _lib._objc_msgSend_696(_id, _lib._sel_setShortStandaloneWeekdaySymbols_1, + value?._id ?? ffi.nullptr); + } + + NSArray? get veryShortStandaloneWeekdaySymbols { + final _ret = _lib._objc_msgSend_80( + _id, _lib._sel_veryShortStandaloneWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set veryShortStandaloneWeekdaySymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, + _lib._sel_setVeryShortStandaloneWeekdaySymbols_1, + value?._id ?? ffi.nullptr); + } + + NSArray? get quarterSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_quarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set quarterSymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setQuarterSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get shortQuarterSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_shortQuarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set shortQuarterSymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setShortQuarterSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get standaloneQuarterSymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_standaloneQuarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set standaloneQuarterSymbols(NSArray? value) { + _lib._objc_msgSend_696(_id, _lib._sel_setStandaloneQuarterSymbols_1, + value?._id ?? ffi.nullptr); + } + + NSArray? get shortStandaloneQuarterSymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_shortStandaloneQuarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set shortStandaloneQuarterSymbols(NSArray? value) { + _lib._objc_msgSend_696(_id, _lib._sel_setShortStandaloneQuarterSymbols_1, + value?._id ?? ffi.nullptr); + } + + NSDate? get gregorianStartDate { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_gregorianStartDate1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + set gregorianStartDate(NSDate? value) { + _lib._objc_msgSend_493( + _id, _lib._sel_setGregorianStartDate_1, value?._id ?? ffi.nullptr); + } + + bool get doesRelativeDateFormatting { + return _lib._objc_msgSend_12(_id, _lib._sel_doesRelativeDateFormatting1); + } + + set doesRelativeDateFormatting(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setDoesRelativeDateFormatting_1, value); + } + + NSObject initWithDateFormat_allowNaturalLanguage_( + NSString? format, bool flag) { + final _ret = _lib._objc_msgSend_29( + _id, + _lib._sel_initWithDateFormat_allowNaturalLanguage_1, + format?._id ?? ffi.nullptr, + flag); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool allowsNaturalLanguage() { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsNaturalLanguage1); + } + + static NSDateFormatter new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDateFormatter1, _lib._sel_new1); + return NSDateFormatter._(_ret, _lib, retain: false, release: true); + } + + static NSDateFormatter alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDateFormatter1, _lib._sel_alloc1); + return NSDateFormatter._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSDateFormatter1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSDateFormatter1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSDateFormatter1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSDateFormatter1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSDateFormatter1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSDateFormatter1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSDateFormatter1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSDateFormatter1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSDateFormatter1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSFormatter extends NSObject { + NSFormatter._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSFormatter] that points to the same underlying object as [other]. + static NSFormatter castFrom(T other) { + return NSFormatter._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSFormatter] that wraps the given raw object pointer. + static NSFormatter castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSFormatter._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSFormatter]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSFormatter1); + } + + NSString stringForObjectValue_(NSObject obj) { + final _ret = + _lib._objc_msgSend_65(_id, _lib._sel_stringForObjectValue_1, obj._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString attributedStringForObjectValue_withDefaultAttributes_( + NSObject obj, NSDictionary? attrs) { + final _ret = _lib._objc_msgSend_651( + _id, + _lib._sel_attributedStringForObjectValue_withDefaultAttributes_1, + obj._id, + attrs?._id ?? ffi.nullptr); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSString editingStringForObjectValue_(NSObject obj) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_editingStringForObjectValue_1, obj._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool getObjectValue_forString_errorDescription_( + ffi.Pointer> obj, + NSString? string, + ffi.Pointer> error) { + return _lib._objc_msgSend_652( + _id, + _lib._sel_getObjectValue_forString_errorDescription_1, + obj, + string?._id ?? ffi.nullptr, + error); + } + + bool isPartialStringValid_newEditingString_errorDescription_( + NSString? partialString, + ffi.Pointer> newString, + ffi.Pointer> error) { + return _lib._objc_msgSend_653( + _id, + _lib._sel_isPartialStringValid_newEditingString_errorDescription_1, + partialString?._id ?? ffi.nullptr, + newString, + error); + } + + bool + isPartialStringValid_proposedSelectedRange_originalString_originalSelectedRange_errorDescription_( + ffi.Pointer> partialStringPtr, + NSRangePointer proposedSelRangePtr, + NSString? origString, + NSRange origSelRange, + ffi.Pointer> error) { + return _lib._objc_msgSend_654( + _id, + _lib._sel_isPartialStringValid_proposedSelectedRange_originalString_originalSelectedRange_errorDescription_1, + partialStringPtr, + proposedSelRangePtr, + origString?._id ?? ffi.nullptr, + origSelRange, + error); + } + + static NSFormatter new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSFormatter1, _lib._sel_new1); + return NSFormatter._(_ret, _lib, retain: false, release: true); + } + + static NSFormatter alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSFormatter1, _lib._sel_alloc1); + return NSFormatter._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSFormatter1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSFormatter1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFormatter1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFormatter1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSFormatter1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSFormatter1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSFormatter1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSFormatter1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSFormatter1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSFormattingContext { + static const int NSFormattingContextUnknown = 0; + static const int NSFormattingContextDynamic = 1; + static const int NSFormattingContextStandalone = 2; + static const int NSFormattingContextListItem = 3; + static const int NSFormattingContextBeginningOfSentence = 4; + static const int NSFormattingContextMiddleOfSentence = 5; +} + +abstract class NSDateFormatterStyle { + static const int NSDateFormatterNoStyle = 0; + static const int NSDateFormatterShortStyle = 1; + static const int NSDateFormatterMediumStyle = 2; + static const int NSDateFormatterLongStyle = 3; + static const int NSDateFormatterFullStyle = 4; +} + +abstract class NSDateFormatterBehavior { + static const int NSDateFormatterBehaviorDefault = 0; + static const int NSDateFormatterBehavior10_0 = 1000; + static const int NSDateFormatterBehavior10_4 = 1040; +} + +class NSCalendar extends NSObject { + NSCalendar._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSCalendar] that points to the same underlying object as [other]. + static NSCalendar castFrom(T other) { + return NSCalendar._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSCalendar] that wraps the given raw object pointer. + static NSCalendar castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSCalendar._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSCalendar]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSCalendar1); + } + + static NSCalendar? getCurrentCalendar(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_665( + _lib._class_NSCalendar1, _lib._sel_currentCalendar1); + return _ret.address == 0 + ? null + : NSCalendar._(_ret, _lib, retain: true, release: true); + } + + static NSCalendar? getAutoupdatingCurrentCalendar(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_665( + _lib._class_NSCalendar1, _lib._sel_autoupdatingCurrentCalendar1); + return _ret.address == 0 + ? null + : NSCalendar._(_ret, _lib, retain: true, release: true); + } + + static NSCalendar calendarWithIdentifier_( + AVFAudio _lib, NSCalendarIdentifier calendarIdentifierConstant) { + final _ret = _lib._objc_msgSend_666(_lib._class_NSCalendar1, + _lib._sel_calendarWithIdentifier_1, calendarIdentifierConstant); + return NSCalendar._(_ret, _lib, retain: true, release: true); + } + + @override + NSCalendar init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSCalendar._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithCalendarIdentifier_(NSCalendarIdentifier ident) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithCalendarIdentifier_1, ident); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSCalendarIdentifier get calendarIdentifier { + return _lib._objc_msgSend_20(_id, _lib._sel_calendarIdentifier1); + } + + NSLocale? get locale { + final _ret = _lib._objc_msgSend_176(_id, _lib._sel_locale1); + return _ret.address == 0 + ? null + : NSLocale._(_ret, _lib, retain: true, release: true); + } + + set locale(NSLocale? value) { + _lib._objc_msgSend_664( + _id, _lib._sel_setLocale_1, value?._id ?? ffi.nullptr); + } + + NSTimeZone? get timeZone { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_timeZone1); + return _ret.address == 0 + ? null + : NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + set timeZone(NSTimeZone? value) { + _lib._objc_msgSend_163( + _id, _lib._sel_setTimeZone_1, value?._id ?? ffi.nullptr); + } + + int get firstWeekday { + return _lib._objc_msgSend_10(_id, _lib._sel_firstWeekday1); + } + + set firstWeekday(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setFirstWeekday_1, value); + } + + int get minimumDaysInFirstWeek { + return _lib._objc_msgSend_10(_id, _lib._sel_minimumDaysInFirstWeek1); + } + + set minimumDaysInFirstWeek(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setMinimumDaysInFirstWeek_1, value); + } + + NSArray? get eraSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_eraSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get longEraSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_longEraSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get monthSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_monthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get shortMonthSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_shortMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get veryShortMonthSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_veryShortMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get standaloneMonthSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_standaloneMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get shortStandaloneMonthSymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_shortStandaloneMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get veryShortStandaloneMonthSymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_veryShortStandaloneMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get weekdaySymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_weekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get shortWeekdaySymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_shortWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get veryShortWeekdaySymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_veryShortWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get standaloneWeekdaySymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_standaloneWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get shortStandaloneWeekdaySymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_shortStandaloneWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get veryShortStandaloneWeekdaySymbols { + final _ret = _lib._objc_msgSend_80( + _id, _lib._sel_veryShortStandaloneWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get quarterSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_quarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get shortQuarterSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_shortQuarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get standaloneQuarterSymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_standaloneQuarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get shortStandaloneQuarterSymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_shortStandaloneQuarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get AMSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_AMSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get PMSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_PMSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSRange minimumRangeOfUnit_(int unit) { + return _lib._objc_msgSend_667(_id, _lib._sel_minimumRangeOfUnit_1, unit); + } + + NSRange maximumRangeOfUnit_(int unit) { + return _lib._objc_msgSend_667(_id, _lib._sel_maximumRangeOfUnit_1, unit); + } + + NSRange rangeOfUnit_inUnit_forDate_(int smaller, int larger, NSDate? date) { + return _lib._objc_msgSend_668(_id, _lib._sel_rangeOfUnit_inUnit_forDate_1, + smaller, larger, date?._id ?? ffi.nullptr); + } + + int ordinalityOfUnit_inUnit_forDate_(int smaller, int larger, NSDate? date) { + return _lib._objc_msgSend_669( + _id, + _lib._sel_ordinalityOfUnit_inUnit_forDate_1, + smaller, + larger, + date?._id ?? ffi.nullptr); + } + + bool rangeOfUnit_startDate_interval_forDate_( + int unit, + ffi.Pointer> datep, + ffi.Pointer tip, + NSDate? date) { + return _lib._objc_msgSend_670( + _id, + _lib._sel_rangeOfUnit_startDate_interval_forDate_1, + unit, + datep, + tip, + date?._id ?? ffi.nullptr); + } + + NSDate dateFromComponents_(NSDateComponents? comps) { + final _ret = _lib._objc_msgSend_675( + _id, _lib._sel_dateFromComponents_1, comps?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDateComponents components_fromDate_(int unitFlags, NSDate? date) { + final _ret = _lib._objc_msgSend_676(_id, _lib._sel_components_fromDate_1, + unitFlags, date?._id ?? ffi.nullptr); + return NSDateComponents._(_ret, _lib, retain: true, release: true); + } + + NSDate dateByAddingComponents_toDate_options_( + NSDateComponents? comps, NSDate? date, int opts) { + final _ret = _lib._objc_msgSend_677( + _id, + _lib._sel_dateByAddingComponents_toDate_options_1, + comps?._id ?? ffi.nullptr, + date?._id ?? ffi.nullptr, + opts); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDateComponents components_fromDate_toDate_options_( + int unitFlags, NSDate? startingDate, NSDate? resultDate, int opts) { + final _ret = _lib._objc_msgSend_678( + _id, + _lib._sel_components_fromDate_toDate_options_1, + unitFlags, + startingDate?._id ?? ffi.nullptr, + resultDate?._id ?? ffi.nullptr, + opts); + return NSDateComponents._(_ret, _lib, retain: true, release: true); + } + + void getEra_year_month_day_fromDate_( + ffi.Pointer eraValuePointer, + ffi.Pointer yearValuePointer, + ffi.Pointer monthValuePointer, + ffi.Pointer dayValuePointer, + NSDate? date) { + return _lib._objc_msgSend_679( + _id, + _lib._sel_getEra_year_month_day_fromDate_1, + eraValuePointer, + yearValuePointer, + monthValuePointer, + dayValuePointer, + date?._id ?? ffi.nullptr); + } + + void getEra_yearForWeekOfYear_weekOfYear_weekday_fromDate_( + ffi.Pointer eraValuePointer, + ffi.Pointer yearValuePointer, + ffi.Pointer weekValuePointer, + ffi.Pointer weekdayValuePointer, + NSDate? date) { + return _lib._objc_msgSend_679( + _id, + _lib._sel_getEra_yearForWeekOfYear_weekOfYear_weekday_fromDate_1, + eraValuePointer, + yearValuePointer, + weekValuePointer, + weekdayValuePointer, + date?._id ?? ffi.nullptr); + } + + void getHour_minute_second_nanosecond_fromDate_( + ffi.Pointer hourValuePointer, + ffi.Pointer minuteValuePointer, + ffi.Pointer secondValuePointer, + ffi.Pointer nanosecondValuePointer, + NSDate? date) { + return _lib._objc_msgSend_679( + _id, + _lib._sel_getHour_minute_second_nanosecond_fromDate_1, + hourValuePointer, + minuteValuePointer, + secondValuePointer, + nanosecondValuePointer, + date?._id ?? ffi.nullptr); + } + + int component_fromDate_(int unit, NSDate? date) { + return _lib._objc_msgSend_680( + _id, _lib._sel_component_fromDate_1, unit, date?._id ?? ffi.nullptr); + } + + NSDate dateWithEra_year_month_day_hour_minute_second_nanosecond_( + int eraValue, + int yearValue, + int monthValue, + int dayValue, + int hourValue, + int minuteValue, + int secondValue, + int nanosecondValue) { + final _ret = _lib._objc_msgSend_681( + _id, + _lib._sel_dateWithEra_year_month_day_hour_minute_second_nanosecond_1, + eraValue, + yearValue, + monthValue, + dayValue, + hourValue, + minuteValue, + secondValue, + nanosecondValue); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate + dateWithEra_yearForWeekOfYear_weekOfYear_weekday_hour_minute_second_nanosecond_( + int eraValue, + int yearValue, + int weekValue, + int weekdayValue, + int hourValue, + int minuteValue, + int secondValue, + int nanosecondValue) { + final _ret = _lib._objc_msgSend_681( + _id, + _lib._sel_dateWithEra_yearForWeekOfYear_weekOfYear_weekday_hour_minute_second_nanosecond_1, + eraValue, + yearValue, + weekValue, + weekdayValue, + hourValue, + minuteValue, + secondValue, + nanosecondValue); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate startOfDayForDate_(NSDate? date) { + final _ret = _lib._objc_msgSend_152( + _id, _lib._sel_startOfDayForDate_1, date?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDateComponents componentsInTimeZone_fromDate_( + NSTimeZone? timezone, NSDate? date) { + final _ret = _lib._objc_msgSend_682( + _id, + _lib._sel_componentsInTimeZone_fromDate_1, + timezone?._id ?? ffi.nullptr, + date?._id ?? ffi.nullptr); + return NSDateComponents._(_ret, _lib, retain: true, release: true); + } + + int compareDate_toDate_toUnitGranularity_( + NSDate? date1, NSDate? date2, int unit) { + return _lib._objc_msgSend_683( + _id, + _lib._sel_compareDate_toDate_toUnitGranularity_1, + date1?._id ?? ffi.nullptr, + date2?._id ?? ffi.nullptr, + unit); + } + + bool isDate_equalToDate_toUnitGranularity_( + NSDate? date1, NSDate? date2, int unit) { + return _lib._objc_msgSend_684( + _id, + _lib._sel_isDate_equalToDate_toUnitGranularity_1, + date1?._id ?? ffi.nullptr, + date2?._id ?? ffi.nullptr, + unit); + } + + bool isDate_inSameDayAsDate_(NSDate? date1, NSDate? date2) { + return _lib._objc_msgSend_685(_id, _lib._sel_isDate_inSameDayAsDate_1, + date1?._id ?? ffi.nullptr, date2?._id ?? ffi.nullptr); + } + + bool isDateInToday_(NSDate? date) { + return _lib._objc_msgSend_154( + _id, _lib._sel_isDateInToday_1, date?._id ?? ffi.nullptr); + } + + bool isDateInYesterday_(NSDate? date) { + return _lib._objc_msgSend_154( + _id, _lib._sel_isDateInYesterday_1, date?._id ?? ffi.nullptr); + } + + bool isDateInTomorrow_(NSDate? date) { + return _lib._objc_msgSend_154( + _id, _lib._sel_isDateInTomorrow_1, date?._id ?? ffi.nullptr); + } + + bool isDateInWeekend_(NSDate? date) { + return _lib._objc_msgSend_154( + _id, _lib._sel_isDateInWeekend_1, date?._id ?? ffi.nullptr); + } + + bool rangeOfWeekendStartDate_interval_containingDate_( + ffi.Pointer> datep, + ffi.Pointer tip, + NSDate? date) { + return _lib._objc_msgSend_686( + _id, + _lib._sel_rangeOfWeekendStartDate_interval_containingDate_1, + datep, + tip, + date?._id ?? ffi.nullptr); + } + + bool nextWeekendStartDate_interval_options_afterDate_( + ffi.Pointer> datep, + ffi.Pointer tip, + int options, + NSDate? date) { + return _lib._objc_msgSend_687( + _id, + _lib._sel_nextWeekendStartDate_interval_options_afterDate_1, + datep, + tip, + options, + date?._id ?? ffi.nullptr); + } + + NSDateComponents components_fromDateComponents_toDateComponents_options_( + int unitFlags, + NSDateComponents? startingDateComp, + NSDateComponents? resultDateComp, + int options) { + final _ret = _lib._objc_msgSend_688( + _id, + _lib._sel_components_fromDateComponents_toDateComponents_options_1, + unitFlags, + startingDateComp?._id ?? ffi.nullptr, + resultDateComp?._id ?? ffi.nullptr, + options); + return NSDateComponents._(_ret, _lib, retain: true, release: true); + } + + NSDate dateByAddingUnit_value_toDate_options_( + int unit, int value, NSDate? date, int options) { + final _ret = _lib._objc_msgSend_689( + _id, + _lib._sel_dateByAddingUnit_value_toDate_options_1, + unit, + value, + date?._id ?? ffi.nullptr, + options); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + void enumerateDatesStartingAfterDate_matchingComponents_options_usingBlock_( + NSDate? start, NSDateComponents? comps, int opts, ObjCBlock28 block) { + return _lib._objc_msgSend_690( + _id, + _lib._sel_enumerateDatesStartingAfterDate_matchingComponents_options_usingBlock_1, + start?._id ?? ffi.nullptr, + comps?._id ?? ffi.nullptr, + opts, + block._impl); + } + + NSDate nextDateAfterDate_matchingComponents_options_( + NSDate? date, NSDateComponents? comps, int options) { + final _ret = _lib._objc_msgSend_691( + _id, + _lib._sel_nextDateAfterDate_matchingComponents_options_1, + date?._id ?? ffi.nullptr, + comps?._id ?? ffi.nullptr, + options); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate nextDateAfterDate_matchingUnit_value_options_( + NSDate? date, int unit, int value, int options) { + final _ret = _lib._objc_msgSend_692( + _id, + _lib._sel_nextDateAfterDate_matchingUnit_value_options_1, + date?._id ?? ffi.nullptr, + unit, + value, + options); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate nextDateAfterDate_matchingHour_minute_second_options_(NSDate? date, + int hourValue, int minuteValue, int secondValue, int options) { + final _ret = _lib._objc_msgSend_693( + _id, + _lib._sel_nextDateAfterDate_matchingHour_minute_second_options_1, + date?._id ?? ffi.nullptr, + hourValue, + minuteValue, + secondValue, + options); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate dateBySettingUnit_value_ofDate_options_( + int unit, int v, NSDate? date, int opts) { + final _ret = _lib._objc_msgSend_689( + _id, + _lib._sel_dateBySettingUnit_value_ofDate_options_1, + unit, + v, + date?._id ?? ffi.nullptr, + opts); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate dateBySettingHour_minute_second_ofDate_options_( + int h, int m, int s, NSDate? date, int opts) { + final _ret = _lib._objc_msgSend_694( + _id, + _lib._sel_dateBySettingHour_minute_second_ofDate_options_1, + h, + m, + s, + date?._id ?? ffi.nullptr, + opts); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + bool date_matchesComponents_(NSDate? date, NSDateComponents? components) { + return _lib._objc_msgSend_695(_id, _lib._sel_date_matchesComponents_1, + date?._id ?? ffi.nullptr, components?._id ?? ffi.nullptr); + } + + static NSCalendar new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSCalendar1, _lib._sel_new1); + return NSCalendar._(_ret, _lib, retain: false, release: true); + } + + static NSCalendar alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSCalendar1, _lib._sel_alloc1); + return NSCalendar._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSCalendar1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSCalendar1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSCalendar1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSCalendar1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSCalendar1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSCalendar1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSCalendar1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSCalendar1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSCalendar1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSCalendarIdentifier = ffi.Pointer; + +abstract class NSCalendarUnit { + static const int NSCalendarUnitEra = 2; + static const int NSCalendarUnitYear = 4; + static const int NSCalendarUnitMonth = 8; + static const int NSCalendarUnitDay = 16; + static const int NSCalendarUnitHour = 32; + static const int NSCalendarUnitMinute = 64; + static const int NSCalendarUnitSecond = 128; + static const int NSCalendarUnitWeekday = 512; + static const int NSCalendarUnitWeekdayOrdinal = 1024; + static const int NSCalendarUnitQuarter = 2048; + static const int NSCalendarUnitWeekOfMonth = 4096; + static const int NSCalendarUnitWeekOfYear = 8192; + static const int NSCalendarUnitYearForWeekOfYear = 16384; + static const int NSCalendarUnitNanosecond = 32768; + static const int NSCalendarUnitCalendar = 1048576; + static const int NSCalendarUnitTimeZone = 2097152; + static const int NSEraCalendarUnit = 2; + static const int NSYearCalendarUnit = 4; + static const int NSMonthCalendarUnit = 8; + static const int NSDayCalendarUnit = 16; + static const int NSHourCalendarUnit = 32; + static const int NSMinuteCalendarUnit = 64; + static const int NSSecondCalendarUnit = 128; + static const int NSWeekCalendarUnit = 256; + static const int NSWeekdayCalendarUnit = 512; + static const int NSWeekdayOrdinalCalendarUnit = 1024; + static const int NSQuarterCalendarUnit = 2048; + static const int NSWeekOfMonthCalendarUnit = 4096; + static const int NSWeekOfYearCalendarUnit = 8192; + static const int NSYearForWeekOfYearCalendarUnit = 16384; + static const int NSCalendarCalendarUnit = 1048576; + static const int NSTimeZoneCalendarUnit = 2097152; +} + +class NSDateComponents extends NSObject { + NSDateComponents._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSDateComponents] that points to the same underlying object as [other]. + static NSDateComponents castFrom(T other) { + return NSDateComponents._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSDateComponents] that wraps the given raw object pointer. + static NSDateComponents castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSDateComponents._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSDateComponents]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSDateComponents1); + } + + NSCalendar? get calendar { + final _ret = _lib._objc_msgSend_665(_id, _lib._sel_calendar1); + return _ret.address == 0 + ? null + : NSCalendar._(_ret, _lib, retain: true, release: true); + } + + set calendar(NSCalendar? value) { + _lib._objc_msgSend_671( + _id, _lib._sel_setCalendar_1, value?._id ?? ffi.nullptr); + } + + NSTimeZone? get timeZone { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_timeZone1); + return _ret.address == 0 + ? null + : NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + set timeZone(NSTimeZone? value) { + _lib._objc_msgSend_163( + _id, _lib._sel_setTimeZone_1, value?._id ?? ffi.nullptr); + } + + int get era { + return _lib._objc_msgSend_78(_id, _lib._sel_era1); + } + + set era(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setEra_1, value); + } + + int get year { + return _lib._objc_msgSend_78(_id, _lib._sel_year1); + } + + set year(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setYear_1, value); + } + + int get month { + return _lib._objc_msgSend_78(_id, _lib._sel_month1); + } + + set month(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setMonth_1, value); + } + + int get day { + return _lib._objc_msgSend_78(_id, _lib._sel_day1); + } + + set day(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setDay_1, value); + } + + int get hour { + return _lib._objc_msgSend_78(_id, _lib._sel_hour1); + } + + set hour(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setHour_1, value); + } + + int get minute { + return _lib._objc_msgSend_78(_id, _lib._sel_minute1); + } + + set minute(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setMinute_1, value); + } + + int get second { + return _lib._objc_msgSend_78(_id, _lib._sel_second1); + } + + set second(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setSecond_1, value); + } + + int get nanosecond { + return _lib._objc_msgSend_78(_id, _lib._sel_nanosecond1); + } + + set nanosecond(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setNanosecond_1, value); + } + + int get weekday { + return _lib._objc_msgSend_78(_id, _lib._sel_weekday1); + } + + set weekday(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setWeekday_1, value); + } + + int get weekdayOrdinal { + return _lib._objc_msgSend_78(_id, _lib._sel_weekdayOrdinal1); + } + + set weekdayOrdinal(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setWeekdayOrdinal_1, value); + } + + int get quarter { + return _lib._objc_msgSend_78(_id, _lib._sel_quarter1); + } + + set quarter(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setQuarter_1, value); + } + + int get weekOfMonth { + return _lib._objc_msgSend_78(_id, _lib._sel_weekOfMonth1); + } + + set weekOfMonth(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setWeekOfMonth_1, value); + } + + int get weekOfYear { + return _lib._objc_msgSend_78(_id, _lib._sel_weekOfYear1); + } + + set weekOfYear(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setWeekOfYear_1, value); + } + + int get yearForWeekOfYear { + return _lib._objc_msgSend_78(_id, _lib._sel_yearForWeekOfYear1); + } + + set yearForWeekOfYear(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setYearForWeekOfYear_1, value); + } + + bool get leapMonth { + return _lib._objc_msgSend_12(_id, _lib._sel_isLeapMonth1); + } + + set leapMonth(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setLeapMonth_1, value); + } + + NSDate? get date { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_date1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + int week() { + return _lib._objc_msgSend_78(_id, _lib._sel_week1); + } + + void setWeek_(int v) { + return _lib._objc_msgSend_374(_id, _lib._sel_setWeek_1, v); + } + + void setValue_forComponent_(int value, int unit) { + return _lib._objc_msgSend_672( + _id, _lib._sel_setValue_forComponent_1, value, unit); + } + + int valueForComponent_(int unit) { + return _lib._objc_msgSend_673(_id, _lib._sel_valueForComponent_1, unit); + } + + bool get validDate { + return _lib._objc_msgSend_12(_id, _lib._sel_isValidDate1); + } + + bool isValidDateInCalendar_(NSCalendar? calendar) { + return _lib._objc_msgSend_674( + _id, _lib._sel_isValidDateInCalendar_1, calendar?._id ?? ffi.nullptr); + } + + static NSDateComponents new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDateComponents1, _lib._sel_new1); + return NSDateComponents._(_ret, _lib, retain: false, release: true); + } + + static NSDateComponents alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDateComponents1, _lib._sel_alloc1); + return NSDateComponents._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSDateComponents1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSDateComponents1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSDateComponents1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSDateComponents1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSDateComponents1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSDateComponents1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSDateComponents1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSDateComponents1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSDateComponents1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSCalendarOptions { + static const int NSCalendarWrapComponents = 1; + static const int NSCalendarMatchStrictly = 2; + static const int NSCalendarSearchBackwards = 4; + static const int NSCalendarMatchPreviousTimePreservingSmallerUnits = 256; + static const int NSCalendarMatchNextTimePreservingSmallerUnits = 512; + static const int NSCalendarMatchNextTime = 1024; + static const int NSCalendarMatchFirst = 4096; + static const int NSCalendarMatchLast = 8192; +} + +void _ObjCBlock28_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, bool arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock28_closureRegistry = {}; +int _ObjCBlock28_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock28_registerClosure(Function fn) { + final id = ++_ObjCBlock28_closureRegistryIndex; + _ObjCBlock28_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock28_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { + return _ObjCBlock28_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock28 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock28._(this._impl, this._lib); + ObjCBlock28.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, + ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock28_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock28.fromFunction( + this._lib, + void Function(ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock28_closureTrampoline) + .cast(), + _ObjCBlock28_registerClosure(fn)); + void call( + ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + bool arg1, + ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class NSNumberFormatter extends NSFormatter { + NSNumberFormatter._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSNumberFormatter] that points to the same underlying object as [other]. + static NSNumberFormatter castFrom(T other) { + return NSNumberFormatter._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSNumberFormatter] that wraps the given raw object pointer. + static NSNumberFormatter castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSNumberFormatter._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSNumberFormatter]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSNumberFormatter1); + } + + int get formattingContext { + return _lib._objc_msgSend_655(_id, _lib._sel_formattingContext1); + } + + set formattingContext(int value) { + _lib._objc_msgSend_656(_id, _lib._sel_setFormattingContext_1, value); + } + + bool getObjectValue_forString_range_error_( + ffi.Pointer> obj, + NSString? string, + ffi.Pointer rangep, + ffi.Pointer> error) { + return _lib._objc_msgSend_657( + _id, + _lib._sel_getObjectValue_forString_range_error_1, + obj, + string?._id ?? ffi.nullptr, + rangep, + error); + } + + NSString stringFromNumber_(NSNumber? number) { + final _ret = _lib._objc_msgSend_697( + _id, _lib._sel_stringFromNumber_1, number?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSNumber numberFromString_(NSString? string) { + final _ret = _lib._objc_msgSend_698( + _id, _lib._sel_numberFromString_1, string?._id ?? ffi.nullptr); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSString localizedStringFromNumber_numberStyle_( + AVFAudio _lib, NSNumber? num, int nstyle) { + final _ret = _lib._objc_msgSend_699( + _lib._class_NSNumberFormatter1, + _lib._sel_localizedStringFromNumber_numberStyle_1, + num?._id ?? ffi.nullptr, + nstyle); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static int defaultFormatterBehavior(AVFAudio _lib) { + return _lib._objc_msgSend_700( + _lib._class_NSNumberFormatter1, _lib._sel_defaultFormatterBehavior1); + } + + static void setDefaultFormatterBehavior_(AVFAudio _lib, int behavior) { + return _lib._objc_msgSend_701(_lib._class_NSNumberFormatter1, + _lib._sel_setDefaultFormatterBehavior_1, behavior); + } + + int get numberStyle { + return _lib._objc_msgSend_702(_id, _lib._sel_numberStyle1); + } + + set numberStyle(int value) { + _lib._objc_msgSend_703(_id, _lib._sel_setNumberStyle_1, value); + } + + NSLocale? get locale { + final _ret = _lib._objc_msgSend_176(_id, _lib._sel_locale1); + return _ret.address == 0 + ? null + : NSLocale._(_ret, _lib, retain: true, release: true); + } + + set locale(NSLocale? value) { + _lib._objc_msgSend_664( + _id, _lib._sel_setLocale_1, value?._id ?? ffi.nullptr); + } + + bool get generatesDecimalNumbers { + return _lib._objc_msgSend_12(_id, _lib._sel_generatesDecimalNumbers1); + } + + set generatesDecimalNumbers(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setGeneratesDecimalNumbers_1, value); + } + + int get formatterBehavior { + return _lib._objc_msgSend_700(_id, _lib._sel_formatterBehavior1); + } + + set formatterBehavior(int value) { + _lib._objc_msgSend_704(_id, _lib._sel_setFormatterBehavior_1, value); + } + + NSString? get negativeFormat { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_negativeFormat1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set negativeFormat(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setNegativeFormat_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get textAttributesForNegativeValues { + final _ret = + _lib._objc_msgSend_164(_id, _lib._sel_textAttributesForNegativeValues1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set textAttributesForNegativeValues(NSDictionary? value) { + _lib._objc_msgSend_165(_id, _lib._sel_setTextAttributesForNegativeValues_1, + value?._id ?? ffi.nullptr); + } + + NSString? get positiveFormat { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_positiveFormat1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set positiveFormat(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPositiveFormat_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get textAttributesForPositiveValues { + final _ret = + _lib._objc_msgSend_164(_id, _lib._sel_textAttributesForPositiveValues1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set textAttributesForPositiveValues(NSDictionary? value) { + _lib._objc_msgSend_165(_id, _lib._sel_setTextAttributesForPositiveValues_1, + value?._id ?? ffi.nullptr); + } + + bool get allowsFloats { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsFloats1); + } + + set allowsFloats(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setAllowsFloats_1, value); + } + + NSString? get decimalSeparator { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_decimalSeparator1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set decimalSeparator(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setDecimalSeparator_1, value?._id ?? ffi.nullptr); + } + + bool get alwaysShowsDecimalSeparator { + return _lib._objc_msgSend_12(_id, _lib._sel_alwaysShowsDecimalSeparator1); + } + + set alwaysShowsDecimalSeparator(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setAlwaysShowsDecimalSeparator_1, value); + } + + NSString? get currencyDecimalSeparator { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_currencyDecimalSeparator1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set currencyDecimalSeparator(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setCurrencyDecimalSeparator_1, + value?._id ?? ffi.nullptr); + } + + bool get usesGroupingSeparator { + return _lib._objc_msgSend_12(_id, _lib._sel_usesGroupingSeparator1); + } + + set usesGroupingSeparator(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setUsesGroupingSeparator_1, value); + } + + NSString? get groupingSeparator { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_groupingSeparator1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set groupingSeparator(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setGroupingSeparator_1, value?._id ?? ffi.nullptr); + } + + NSString? get zeroSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_zeroSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set zeroSymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setZeroSymbol_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get textAttributesForZero { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_textAttributesForZero1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set textAttributesForZero(NSDictionary? value) { + _lib._objc_msgSend_165( + _id, _lib._sel_setTextAttributesForZero_1, value?._id ?? ffi.nullptr); + } + + NSString? get nilSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_nilSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set nilSymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setNilSymbol_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get textAttributesForNil { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_textAttributesForNil1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set textAttributesForNil(NSDictionary? value) { + _lib._objc_msgSend_165( + _id, _lib._sel_setTextAttributesForNil_1, value?._id ?? ffi.nullptr); + } + + NSString? get notANumberSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_notANumberSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set notANumberSymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setNotANumberSymbol_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get textAttributesForNotANumber { + final _ret = + _lib._objc_msgSend_164(_id, _lib._sel_textAttributesForNotANumber1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set textAttributesForNotANumber(NSDictionary? value) { + _lib._objc_msgSend_165(_id, _lib._sel_setTextAttributesForNotANumber_1, + value?._id ?? ffi.nullptr); + } + + NSString? get positiveInfinitySymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_positiveInfinitySymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set positiveInfinitySymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPositiveInfinitySymbol_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get textAttributesForPositiveInfinity { + final _ret = _lib._objc_msgSend_164( + _id, _lib._sel_textAttributesForPositiveInfinity1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set textAttributesForPositiveInfinity(NSDictionary? value) { + _lib._objc_msgSend_165( + _id, + _lib._sel_setTextAttributesForPositiveInfinity_1, + value?._id ?? ffi.nullptr); + } + + NSString? get negativeInfinitySymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_negativeInfinitySymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set negativeInfinitySymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setNegativeInfinitySymbol_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get textAttributesForNegativeInfinity { + final _ret = _lib._objc_msgSend_164( + _id, _lib._sel_textAttributesForNegativeInfinity1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set textAttributesForNegativeInfinity(NSDictionary? value) { + _lib._objc_msgSend_165( + _id, + _lib._sel_setTextAttributesForNegativeInfinity_1, + value?._id ?? ffi.nullptr); + } + + NSString? get positivePrefix { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_positivePrefix1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set positivePrefix(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPositivePrefix_1, value?._id ?? ffi.nullptr); + } + + NSString? get positiveSuffix { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_positiveSuffix1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set positiveSuffix(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPositiveSuffix_1, value?._id ?? ffi.nullptr); + } + + NSString? get negativePrefix { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_negativePrefix1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set negativePrefix(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setNegativePrefix_1, value?._id ?? ffi.nullptr); + } + + NSString? get negativeSuffix { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_negativeSuffix1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set negativeSuffix(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setNegativeSuffix_1, value?._id ?? ffi.nullptr); + } + + NSString? get currencyCode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_currencyCode1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set currencyCode(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setCurrencyCode_1, value?._id ?? ffi.nullptr); + } + + NSString? get currencySymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_currencySymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set currencySymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setCurrencySymbol_1, value?._id ?? ffi.nullptr); + } + + NSString? get internationalCurrencySymbol { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_internationalCurrencySymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set internationalCurrencySymbol(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setInternationalCurrencySymbol_1, + value?._id ?? ffi.nullptr); + } + + NSString? get percentSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_percentSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set percentSymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPercentSymbol_1, value?._id ?? ffi.nullptr); + } + + NSString? get perMillSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_perMillSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set perMillSymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPerMillSymbol_1, value?._id ?? ffi.nullptr); + } + + NSString? get minusSign { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_minusSign1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set minusSign(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setMinusSign_1, value?._id ?? ffi.nullptr); + } + + NSString? get plusSign { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_plusSign1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set plusSign(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPlusSign_1, value?._id ?? ffi.nullptr); + } + + NSString? get exponentSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_exponentSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set exponentSymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setExponentSymbol_1, value?._id ?? ffi.nullptr); + } + + int get groupingSize { + return _lib._objc_msgSend_10(_id, _lib._sel_groupingSize1); + } + + set groupingSize(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setGroupingSize_1, value); + } + + int get secondaryGroupingSize { + return _lib._objc_msgSend_10(_id, _lib._sel_secondaryGroupingSize1); + } + + set secondaryGroupingSize(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setSecondaryGroupingSize_1, value); + } + + NSNumber? get multiplier { + final _ret = _lib._objc_msgSend_192(_id, _lib._sel_multiplier1); + return _ret.address == 0 + ? null + : NSNumber._(_ret, _lib, retain: true, release: true); + } + + set multiplier(NSNumber? value) { + _lib._objc_msgSend_705( + _id, _lib._sel_setMultiplier_1, value?._id ?? ffi.nullptr); + } + + int get formatWidth { + return _lib._objc_msgSend_10(_id, _lib._sel_formatWidth1); + } + + set formatWidth(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setFormatWidth_1, value); + } + + NSString? get paddingCharacter { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_paddingCharacter1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set paddingCharacter(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPaddingCharacter_1, value?._id ?? ffi.nullptr); + } + + int get paddingPosition { + return _lib._objc_msgSend_706(_id, _lib._sel_paddingPosition1); + } + + set paddingPosition(int value) { + _lib._objc_msgSend_707(_id, _lib._sel_setPaddingPosition_1, value); + } + + int get roundingMode { + return _lib._objc_msgSend_708(_id, _lib._sel_roundingMode1); + } + + set roundingMode(int value) { + _lib._objc_msgSend_709(_id, _lib._sel_setRoundingMode_1, value); + } + + NSNumber? get roundingIncrement { + final _ret = _lib._objc_msgSend_192(_id, _lib._sel_roundingIncrement1); + return _ret.address == 0 + ? null + : NSNumber._(_ret, _lib, retain: true, release: true); + } + + set roundingIncrement(NSNumber? value) { + _lib._objc_msgSend_705( + _id, _lib._sel_setRoundingIncrement_1, value?._id ?? ffi.nullptr); + } + + int get minimumIntegerDigits { + return _lib._objc_msgSend_10(_id, _lib._sel_minimumIntegerDigits1); + } + + set minimumIntegerDigits(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setMinimumIntegerDigits_1, value); + } + + int get maximumIntegerDigits { + return _lib._objc_msgSend_10(_id, _lib._sel_maximumIntegerDigits1); + } + + set maximumIntegerDigits(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setMaximumIntegerDigits_1, value); + } + + int get minimumFractionDigits { + return _lib._objc_msgSend_10(_id, _lib._sel_minimumFractionDigits1); + } + + set minimumFractionDigits(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setMinimumFractionDigits_1, value); + } + + int get maximumFractionDigits { + return _lib._objc_msgSend_10(_id, _lib._sel_maximumFractionDigits1); + } + + set maximumFractionDigits(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setMaximumFractionDigits_1, value); + } + + NSNumber? get minimum { + final _ret = _lib._objc_msgSend_192(_id, _lib._sel_minimum1); + return _ret.address == 0 + ? null + : NSNumber._(_ret, _lib, retain: true, release: true); + } + + set minimum(NSNumber? value) { + _lib._objc_msgSend_705( + _id, _lib._sel_setMinimum_1, value?._id ?? ffi.nullptr); + } + + NSNumber? get maximum { + final _ret = _lib._objc_msgSend_192(_id, _lib._sel_maximum1); + return _ret.address == 0 + ? null + : NSNumber._(_ret, _lib, retain: true, release: true); + } + + set maximum(NSNumber? value) { + _lib._objc_msgSend_705( + _id, _lib._sel_setMaximum_1, value?._id ?? ffi.nullptr); + } + + NSString? get currencyGroupingSeparator { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_currencyGroupingSeparator1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set currencyGroupingSeparator(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setCurrencyGroupingSeparator_1, + value?._id ?? ffi.nullptr); + } + + bool get lenient { + return _lib._objc_msgSend_12(_id, _lib._sel_isLenient1); + } + + set lenient(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setLenient_1, value); + } + + bool get usesSignificantDigits { + return _lib._objc_msgSend_12(_id, _lib._sel_usesSignificantDigits1); + } + + set usesSignificantDigits(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setUsesSignificantDigits_1, value); + } + + int get minimumSignificantDigits { + return _lib._objc_msgSend_10(_id, _lib._sel_minimumSignificantDigits1); + } + + set minimumSignificantDigits(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setMinimumSignificantDigits_1, value); + } + + int get maximumSignificantDigits { + return _lib._objc_msgSend_10(_id, _lib._sel_maximumSignificantDigits1); + } + + set maximumSignificantDigits(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setMaximumSignificantDigits_1, value); + } + + bool get partialStringValidationEnabled { + return _lib._objc_msgSend_12( + _id, _lib._sel_isPartialStringValidationEnabled1); + } + + set partialStringValidationEnabled(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setPartialStringValidationEnabled_1, value); + } + + bool get hasThousandSeparators { + return _lib._objc_msgSend_12(_id, _lib._sel_hasThousandSeparators1); + } + + set hasThousandSeparators(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setHasThousandSeparators_1, value); + } + + NSString? get thousandSeparator { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_thousandSeparator1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set thousandSeparator(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setThousandSeparator_1, value?._id ?? ffi.nullptr); + } + + bool get localizesFormat { + return _lib._objc_msgSend_12(_id, _lib._sel_localizesFormat1); + } + + set localizesFormat(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setLocalizesFormat_1, value); + } + + NSString? get format { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_format1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set format(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setFormat_1, value?._id ?? ffi.nullptr); + } + + NSAttributedString? get attributedStringForZero { + final _ret = + _lib._objc_msgSend_640(_id, _lib._sel_attributedStringForZero1); + return _ret.address == 0 + ? null + : NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + set attributedStringForZero(NSAttributedString? value) { + _lib._objc_msgSend_710( + _id, _lib._sel_setAttributedStringForZero_1, value?._id ?? ffi.nullptr); + } + + NSAttributedString? get attributedStringForNil { + final _ret = _lib._objc_msgSend_640(_id, _lib._sel_attributedStringForNil1); + return _ret.address == 0 + ? null + : NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + set attributedStringForNil(NSAttributedString? value) { + _lib._objc_msgSend_710( + _id, _lib._sel_setAttributedStringForNil_1, value?._id ?? ffi.nullptr); + } + + NSAttributedString? get attributedStringForNotANumber { + final _ret = + _lib._objc_msgSend_640(_id, _lib._sel_attributedStringForNotANumber1); + return _ret.address == 0 + ? null + : NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + set attributedStringForNotANumber(NSAttributedString? value) { + _lib._objc_msgSend_710(_id, _lib._sel_setAttributedStringForNotANumber_1, + value?._id ?? ffi.nullptr); + } + + NSDecimalNumberHandler? get roundingBehavior { + final _ret = _lib._objc_msgSend_711(_id, _lib._sel_roundingBehavior1); + return _ret.address == 0 + ? null + : NSDecimalNumberHandler._(_ret, _lib, retain: true, release: true); + } + + set roundingBehavior(NSDecimalNumberHandler? value) { + _lib._objc_msgSend_713( + _id, _lib._sel_setRoundingBehavior_1, value?._id ?? ffi.nullptr); + } + + static NSNumberFormatter new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSNumberFormatter1, _lib._sel_new1); + return NSNumberFormatter._(_ret, _lib, retain: false, release: true); + } + + static NSNumberFormatter alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSNumberFormatter1, _lib._sel_alloc1); + return NSNumberFormatter._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSNumberFormatter1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSNumberFormatter1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSNumberFormatter1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSNumberFormatter1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSNumberFormatter1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSNumberFormatter1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSNumberFormatter1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSNumberFormatter1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSNumberFormatter1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSNumberFormatterStyle { + static const int NSNumberFormatterNoStyle = 0; + static const int NSNumberFormatterDecimalStyle = 1; + static const int NSNumberFormatterCurrencyStyle = 2; + static const int NSNumberFormatterPercentStyle = 3; + static const int NSNumberFormatterScientificStyle = 4; + static const int NSNumberFormatterSpellOutStyle = 5; + static const int NSNumberFormatterOrdinalStyle = 6; + static const int NSNumberFormatterCurrencyISOCodeStyle = 8; + static const int NSNumberFormatterCurrencyPluralStyle = 9; + static const int NSNumberFormatterCurrencyAccountingStyle = 10; +} + +abstract class NSNumberFormatterBehavior { + static const int NSNumberFormatterBehaviorDefault = 0; + static const int NSNumberFormatterBehavior10_0 = 1000; + static const int NSNumberFormatterBehavior10_4 = 1040; +} + +abstract class NSNumberFormatterPadPosition { + static const int NSNumberFormatterPadBeforePrefix = 0; + static const int NSNumberFormatterPadAfterPrefix = 1; + static const int NSNumberFormatterPadBeforeSuffix = 2; + static const int NSNumberFormatterPadAfterSuffix = 3; +} + +abstract class NSNumberFormatterRoundingMode { + static const int NSNumberFormatterRoundCeiling = 0; + static const int NSNumberFormatterRoundFloor = 1; + static const int NSNumberFormatterRoundDown = 2; + static const int NSNumberFormatterRoundUp = 3; + static const int NSNumberFormatterRoundHalfEven = 4; + static const int NSNumberFormatterRoundHalfDown = 5; + static const int NSNumberFormatterRoundHalfUp = 6; +} + +class NSDecimalNumberHandler extends NSObject { + NSDecimalNumberHandler._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSDecimalNumberHandler] that points to the same underlying object as [other]. + static NSDecimalNumberHandler castFrom(T other) { + return NSDecimalNumberHandler._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSDecimalNumberHandler] that wraps the given raw object pointer. + static NSDecimalNumberHandler castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSDecimalNumberHandler._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSDecimalNumberHandler]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSDecimalNumberHandler1); + } + + static NSDecimalNumberHandler? getDefaultDecimalNumberHandler(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_711(_lib._class_NSDecimalNumberHandler1, + _lib._sel_defaultDecimalNumberHandler1); + return _ret.address == 0 + ? null + : NSDecimalNumberHandler._(_ret, _lib, retain: true, release: true); + } + + NSDecimalNumberHandler + initWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_( + int roundingMode, + int scale, + bool exact, + bool overflow, + bool underflow, + bool divideByZero) { + final _ret = _lib._objc_msgSend_712( + _id, + _lib._sel_initWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_1, + roundingMode, + scale, + exact, + overflow, + underflow, + divideByZero); + return NSDecimalNumberHandler._(_ret, _lib, retain: true, release: true); + } + + static NSDecimalNumberHandler + decimalNumberHandlerWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_( + AVFAudio _lib, + int roundingMode, + int scale, + bool exact, + bool overflow, + bool underflow, + bool divideByZero) { + final _ret = _lib._objc_msgSend_712( + _lib._class_NSDecimalNumberHandler1, + _lib._sel_decimalNumberHandlerWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_1, + roundingMode, + scale, + exact, + overflow, + underflow, + divideByZero); + return NSDecimalNumberHandler._(_ret, _lib, retain: true, release: true); + } + + static NSDecimalNumberHandler new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSDecimalNumberHandler1, _lib._sel_new1); + return NSDecimalNumberHandler._(_ret, _lib, retain: false, release: true); + } + + static NSDecimalNumberHandler alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSDecimalNumberHandler1, _lib._sel_alloc1); + return NSDecimalNumberHandler._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSDecimalNumberHandler1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSDecimalNumberHandler1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSDecimalNumberHandler1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSDecimalNumberHandler1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSDecimalNumberHandler1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSDecimalNumberHandler1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSDecimalNumberHandler1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSDecimalNumberHandler1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSDecimalNumberHandler1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSRoundingMode { + static const int NSRoundPlain = 0; + static const int NSRoundDown = 1; + static const int NSRoundUp = 2; + static const int NSRoundBankers = 3; +} + +class NSScanner extends NSObject { + NSScanner._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSScanner] that points to the same underlying object as [other]. + static NSScanner castFrom(T other) { + return NSScanner._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSScanner] that wraps the given raw object pointer. + static NSScanner castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSScanner._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSScanner]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSScanner1); + } + + NSString? get string { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_string1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get scanLocation { + return _lib._objc_msgSend_10(_id, _lib._sel_scanLocation1); + } + + set scanLocation(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setScanLocation_1, value); + } + + NSCharacterSet? get charactersToBeSkipped { + final _ret = _lib._objc_msgSend_168(_id, _lib._sel_charactersToBeSkipped1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + set charactersToBeSkipped(NSCharacterSet? value) { + _lib._objc_msgSend_714( + _id, _lib._sel_setCharactersToBeSkipped_1, value?._id ?? ffi.nullptr); + } + + bool get caseSensitive { + return _lib._objc_msgSend_12(_id, _lib._sel_caseSensitive1); + } + + set caseSensitive(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setCaseSensitive_1, value); + } + + NSObject get locale { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_locale1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set locale(NSObject value) { + _lib._objc_msgSend_368(_id, _lib._sel_setLocale_1, value._id); + } + + NSScanner initWithString_(NSString? string) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, string?._id ?? ffi.nullptr); + return NSScanner._(_ret, _lib, retain: true, release: true); + } + + bool scanInt_(ffi.Pointer result) { + return _lib._objc_msgSend_715(_id, _lib._sel_scanInt_1, result); + } + + bool scanInteger_(ffi.Pointer result) { + return _lib._objc_msgSend_716(_id, _lib._sel_scanInteger_1, result); + } + + bool scanLongLong_(ffi.Pointer result) { + return _lib._objc_msgSend_717(_id, _lib._sel_scanLongLong_1, result); + } + + bool scanUnsignedLongLong_(ffi.Pointer result) { + return _lib._objc_msgSend_718( + _id, _lib._sel_scanUnsignedLongLong_1, result); + } + + bool scanFloat_(ffi.Pointer result) { + return _lib._objc_msgSend_719(_id, _lib._sel_scanFloat_1, result); + } + + bool scanDouble_(ffi.Pointer result) { + return _lib._objc_msgSend_720(_id, _lib._sel_scanDouble_1, result); + } + + bool scanHexInt_(ffi.Pointer result) { + return _lib._objc_msgSend_721(_id, _lib._sel_scanHexInt_1, result); + } + + bool scanHexLongLong_(ffi.Pointer result) { + return _lib._objc_msgSend_718(_id, _lib._sel_scanHexLongLong_1, result); + } + + bool scanHexFloat_(ffi.Pointer result) { + return _lib._objc_msgSend_719(_id, _lib._sel_scanHexFloat_1, result); + } + + bool scanHexDouble_(ffi.Pointer result) { + return _lib._objc_msgSend_720(_id, _lib._sel_scanHexDouble_1, result); + } + + bool scanString_intoString_( + NSString? string, ffi.Pointer> result) { + return _lib._objc_msgSend_722(_id, _lib._sel_scanString_intoString_1, + string?._id ?? ffi.nullptr, result); + } + + bool scanCharactersFromSet_intoString_( + NSCharacterSet? set, ffi.Pointer> result) { + return _lib._objc_msgSend_723( + _id, + _lib._sel_scanCharactersFromSet_intoString_1, + set?._id ?? ffi.nullptr, + result); + } + + bool scanUpToString_intoString_( + NSString? string, ffi.Pointer> result) { + return _lib._objc_msgSend_722(_id, _lib._sel_scanUpToString_intoString_1, + string?._id ?? ffi.nullptr, result); + } + + bool scanUpToCharactersFromSet_intoString_( + NSCharacterSet? set, ffi.Pointer> result) { + return _lib._objc_msgSend_723( + _id, + _lib._sel_scanUpToCharactersFromSet_intoString_1, + set?._id ?? ffi.nullptr, + result); + } + + bool get atEnd { + return _lib._objc_msgSend_12(_id, _lib._sel_isAtEnd1); + } + + static NSScanner scannerWithString_(AVFAudio _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSScanner1, + _lib._sel_scannerWithString_1, string?._id ?? ffi.nullptr); + return NSScanner._(_ret, _lib, retain: true, release: true); + } + + static NSObject localizedScannerWithString_(AVFAudio _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSScanner1, + _lib._sel_localizedScannerWithString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool scanDecimal_(ffi.Pointer dcm) { + return _lib._objc_msgSend_724(_id, _lib._sel_scanDecimal_1, dcm); + } + + static NSScanner new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSScanner1, _lib._sel_new1); + return NSScanner._(_ret, _lib, retain: false, release: true); + } + + static NSScanner alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSScanner1, _lib._sel_alloc1); + return NSScanner._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSScanner1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSScanner1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSScanner1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSScanner1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSScanner1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSScanner1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSScanner1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSScanner1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScanner1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSDecimal extends ffi.Opaque {} + +class NSException extends NSObject { + NSException._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSException] that points to the same underlying object as [other]. + static NSException castFrom(T other) { + return NSException._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSException] that wraps the given raw object pointer. + static NSException castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSException._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSException]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSException1); + } + + static NSException exceptionWithName_reason_userInfo_(AVFAudio _lib, + NSExceptionName name, NSString? reason, NSDictionary? userInfo) { + final _ret = _lib._objc_msgSend_725( + _lib._class_NSException1, + _lib._sel_exceptionWithName_reason_userInfo_1, + name, + reason?._id ?? ffi.nullptr, + userInfo?._id ?? ffi.nullptr); + return NSException._(_ret, _lib, retain: true, release: true); + } + + NSException initWithName_reason_userInfo_( + NSExceptionName aName, NSString? aReason, NSDictionary? aUserInfo) { + final _ret = _lib._objc_msgSend_551( + _id, + _lib._sel_initWithName_reason_userInfo_1, + aName, + aReason?._id ?? ffi.nullptr, + aUserInfo?._id ?? ffi.nullptr); + return NSException._(_ret, _lib, retain: true, release: true); + } + + NSExceptionName get name { + return _lib._objc_msgSend_20(_id, _lib._sel_name1); + } + + NSString? get reason { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_reason1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get userInfo { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_userInfo1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSArray? get callStackReturnAddresses { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_callStackReturnAddresses1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get callStackSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_callStackSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + void raise() { + return _lib._objc_msgSend_1(_id, _lib._sel_raise1); + } + + static void raise_format_( + AVFAudio _lib, NSExceptionName name, NSString? format) { + return _lib._objc_msgSend_483(_lib._class_NSException1, + _lib._sel_raise_format_1, name, format?._id ?? ffi.nullptr); + } + + static void raise_format_arguments_(AVFAudio _lib, NSExceptionName name, + NSString? format, ffi.Pointer<__va_list_tag> argList) { + return _lib._objc_msgSend_726( + _lib._class_NSException1, + _lib._sel_raise_format_arguments_1, + name, + format?._id ?? ffi.nullptr, + argList); + } + + static NSException new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSException1, _lib._sel_new1); + return NSException._(_ret, _lib, retain: false, release: true); + } + + static NSException alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSException1, _lib._sel_alloc1); + return NSException._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSException1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSException1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSException1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSException1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSException1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSException1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSException1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSException1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSException1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSExceptionName = ffi.Pointer; + +class NSFileHandle extends NSObject { + NSFileHandle._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSFileHandle] that points to the same underlying object as [other]. + static NSFileHandle castFrom(T other) { + return NSFileHandle._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSFileHandle] that wraps the given raw object pointer. + static NSFileHandle castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSFileHandle._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSFileHandle]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSFileHandle1); + } + + NSData? get availableData { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_availableData1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSFileHandle initWithFileDescriptor_closeOnDealloc_(int fd, bool closeopt) { + final _ret = _lib._objc_msgSend_727( + _id, _lib._sel_initWithFileDescriptor_closeOnDealloc_1, fd, closeopt); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + NSFileHandle initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + NSData readDataToEndOfFileAndReturnError_( + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_728( + _id, _lib._sel_readDataToEndOfFileAndReturnError_1, error); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData readDataUpToLength_error_( + int length, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_729( + _id, _lib._sel_readDataUpToLength_error_1, length, error); + return NSData._(_ret, _lib, retain: true, release: true); + } + + bool writeData_error_( + NSData? data, ffi.Pointer> error) { + return _lib._objc_msgSend_730( + _id, _lib._sel_writeData_error_1, data?._id ?? ffi.nullptr, error); + } + + bool getOffset_error_(ffi.Pointer offsetInFile, + ffi.Pointer> error) { + return _lib._objc_msgSend_731( + _id, _lib._sel_getOffset_error_1, offsetInFile, error); + } + + bool seekToEndReturningOffset_error_( + ffi.Pointer offsetInFile, + ffi.Pointer> error) { + return _lib._objc_msgSend_731( + _id, _lib._sel_seekToEndReturningOffset_error_1, offsetInFile, error); + } + + bool seekToOffset_error_( + int offset, ffi.Pointer> error) { + return _lib._objc_msgSend_732( + _id, _lib._sel_seekToOffset_error_1, offset, error); + } + + bool truncateAtOffset_error_( + int offset, ffi.Pointer> error) { + return _lib._objc_msgSend_732( + _id, _lib._sel_truncateAtOffset_error_1, offset, error); + } + + bool synchronizeAndReturnError_(ffi.Pointer> error) { + return _lib._objc_msgSend_219( + _id, _lib._sel_synchronizeAndReturnError_1, error); + } + + bool closeAndReturnError_(ffi.Pointer> error) { + return _lib._objc_msgSend_219(_id, _lib._sel_closeAndReturnError_1, error); + } + + static NSFileHandle? getFileHandleWithStandardInput(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_733( + _lib._class_NSFileHandle1, _lib._sel_fileHandleWithStandardInput1); + return _ret.address == 0 + ? null + : NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle? getFileHandleWithStandardOutput(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_733( + _lib._class_NSFileHandle1, _lib._sel_fileHandleWithStandardOutput1); + return _ret.address == 0 + ? null + : NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle? getFileHandleWithStandardError(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_733( + _lib._class_NSFileHandle1, _lib._sel_fileHandleWithStandardError1); + return _ret.address == 0 + ? null + : NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle? getFileHandleWithNullDevice(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_733( + _lib._class_NSFileHandle1, _lib._sel_fileHandleWithNullDevice1); + return _ret.address == 0 + ? null + : NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle fileHandleForReadingAtPath_( + AVFAudio _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSFileHandle1, + _lib._sel_fileHandleForReadingAtPath_1, path?._id ?? ffi.nullptr); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle fileHandleForWritingAtPath_( + AVFAudio _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSFileHandle1, + _lib._sel_fileHandleForWritingAtPath_1, path?._id ?? ffi.nullptr); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle fileHandleForUpdatingAtPath_( + AVFAudio _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSFileHandle1, + _lib._sel_fileHandleForUpdatingAtPath_1, path?._id ?? ffi.nullptr); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle fileHandleForReadingFromURL_error_( + AVFAudio _lib, NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_734( + _lib._class_NSFileHandle1, + _lib._sel_fileHandleForReadingFromURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle fileHandleForWritingToURL_error_( + AVFAudio _lib, NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_734( + _lib._class_NSFileHandle1, + _lib._sel_fileHandleForWritingToURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle fileHandleForUpdatingURL_error_( + AVFAudio _lib, NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_734( + _lib._class_NSFileHandle1, + _lib._sel_fileHandleForUpdatingURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + void readInBackgroundAndNotifyForModes_(NSArray? modes) { + return _lib._objc_msgSend_412( + _id, + _lib._sel_readInBackgroundAndNotifyForModes_1, + modes?._id ?? ffi.nullptr); + } + + void readInBackgroundAndNotify() { + return _lib._objc_msgSend_1(_id, _lib._sel_readInBackgroundAndNotify1); + } + + void readToEndOfFileInBackgroundAndNotifyForModes_(NSArray? modes) { + return _lib._objc_msgSend_412( + _id, + _lib._sel_readToEndOfFileInBackgroundAndNotifyForModes_1, + modes?._id ?? ffi.nullptr); + } + + void readToEndOfFileInBackgroundAndNotify() { + return _lib._objc_msgSend_1( + _id, _lib._sel_readToEndOfFileInBackgroundAndNotify1); + } + + void acceptConnectionInBackgroundAndNotifyForModes_(NSArray? modes) { + return _lib._objc_msgSend_412( + _id, + _lib._sel_acceptConnectionInBackgroundAndNotifyForModes_1, + modes?._id ?? ffi.nullptr); + } + + void acceptConnectionInBackgroundAndNotify() { + return _lib._objc_msgSend_1( + _id, _lib._sel_acceptConnectionInBackgroundAndNotify1); + } + + void waitForDataInBackgroundAndNotifyForModes_(NSArray? modes) { + return _lib._objc_msgSend_412( + _id, + _lib._sel_waitForDataInBackgroundAndNotifyForModes_1, + modes?._id ?? ffi.nullptr); + } + + void waitForDataInBackgroundAndNotify() { + return _lib._objc_msgSend_1( + _id, _lib._sel_waitForDataInBackgroundAndNotify1); + } + + ObjCBlock29 get readabilityHandler { + final _ret = _lib._objc_msgSend_735(_id, _lib._sel_readabilityHandler1); + return ObjCBlock29._(_ret, _lib); + } + + set readabilityHandler(ObjCBlock29 value) { + _lib._objc_msgSend_736(_id, _lib._sel_setReadabilityHandler_1, value._impl); + } + + ObjCBlock29 get writeabilityHandler { + final _ret = _lib._objc_msgSend_735(_id, _lib._sel_writeabilityHandler1); + return ObjCBlock29._(_ret, _lib); + } + + set writeabilityHandler(ObjCBlock29 value) { + _lib._objc_msgSend_736( + _id, _lib._sel_setWriteabilityHandler_1, value._impl); + } + + NSFileHandle initWithFileDescriptor_(int fd) { + final _ret = + _lib._objc_msgSend_737(_id, _lib._sel_initWithFileDescriptor_1, fd); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + int get fileDescriptor { + return _lib._objc_msgSend_213(_id, _lib._sel_fileDescriptor1); + } + + NSData readDataToEndOfFile() { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_readDataToEndOfFile1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData readDataOfLength_(int length) { + final _ret = + _lib._objc_msgSend_315(_id, _lib._sel_readDataOfLength_1, length); + return NSData._(_ret, _lib, retain: true, release: true); + } + + void writeData_(NSData? data) { + return _lib._objc_msgSend_248( + _id, _lib._sel_writeData_1, data?._id ?? ffi.nullptr); + } + + int get offsetInFile { + return _lib._objc_msgSend_148(_id, _lib._sel_offsetInFile1); + } + + int seekToEndOfFile() { + return _lib._objc_msgSend_148(_id, _lib._sel_seekToEndOfFile1); + } + + void seekToFileOffset_(int offset) { + return _lib._objc_msgSend_738(_id, _lib._sel_seekToFileOffset_1, offset); + } + + void truncateFileAtOffset_(int offset) { + return _lib._objc_msgSend_738( + _id, _lib._sel_truncateFileAtOffset_1, offset); + } + + void synchronizeFile() { + return _lib._objc_msgSend_1(_id, _lib._sel_synchronizeFile1); + } + + void closeFile() { + return _lib._objc_msgSend_1(_id, _lib._sel_closeFile1); + } + + static NSFileHandle new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSFileHandle1, _lib._sel_new1); + return NSFileHandle._(_ret, _lib, retain: false, release: true); + } + + static NSFileHandle alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSFileHandle1, _lib._sel_alloc1); + return NSFileHandle._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSFileHandle1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSFileHandle1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFileHandle1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFileHandle1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSFileHandle1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSFileHandle1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSFileHandle1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSFileHandle1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSFileHandle1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock29_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock29_closureRegistry = {}; +int _ObjCBlock29_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock29_registerClosure(Function fn) { + final id = ++_ObjCBlock29_closureRegistryIndex; + _ObjCBlock29_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock29_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return _ObjCBlock29_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock29 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock29._(this._impl, this._lib); + ObjCBlock29.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock29_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock29.fromFunction( + this._lib, void Function(ffi.Pointer arg0) fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock29_closureTrampoline) + .cast(), + _ObjCBlock29_registerClosure(fn)); + void call(ffi.Pointer arg0) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_impl, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class NSHTTPCookieStorage extends NSObject { + NSHTTPCookieStorage._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSHTTPCookieStorage] that points to the same underlying object as [other]. + static NSHTTPCookieStorage castFrom(T other) { + return NSHTTPCookieStorage._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSHTTPCookieStorage] that wraps the given raw object pointer. + static NSHTTPCookieStorage castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSHTTPCookieStorage._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSHTTPCookieStorage]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSHTTPCookieStorage1); + } + + static NSHTTPCookieStorage? getSharedHTTPCookieStorage(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_739( + _lib._class_NSHTTPCookieStorage1, _lib._sel_sharedHTTPCookieStorage1); + return _ret.address == 0 + ? null + : NSHTTPCookieStorage._(_ret, _lib, retain: true, release: true); + } + + static NSHTTPCookieStorage sharedCookieStorageForGroupContainerIdentifier_( + AVFAudio _lib, NSString? identifier) { + final _ret = _lib._objc_msgSend_740( + _lib._class_NSHTTPCookieStorage1, + _lib._sel_sharedCookieStorageForGroupContainerIdentifier_1, + identifier?._id ?? ffi.nullptr); + return NSHTTPCookieStorage._(_ret, _lib, retain: true, release: true); + } + + NSArray? get cookies { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_cookies1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + void setCookie_(NSHTTPCookie? cookie) { + return _lib._objc_msgSend_743( + _id, _lib._sel_setCookie_1, cookie?._id ?? ffi.nullptr); + } + + void deleteCookie_(NSHTTPCookie? cookie) { + return _lib._objc_msgSend_743( + _id, _lib._sel_deleteCookie_1, cookie?._id ?? ffi.nullptr); + } + + void removeCookiesSinceDate_(NSDate? date) { + return _lib._objc_msgSend_472( + _id, _lib._sel_removeCookiesSinceDate_1, date?._id ?? ffi.nullptr); + } + + NSArray cookiesForURL_(NSURL? URL) { + final _ret = _lib._objc_msgSend_120( + _id, _lib._sel_cookiesForURL_1, URL?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void setCookies_forURL_mainDocumentURL_( + NSArray? cookies, NSURL? URL, NSURL? mainDocumentURL) { + return _lib._objc_msgSend_744( + _id, + _lib._sel_setCookies_forURL_mainDocumentURL_1, + cookies?._id ?? ffi.nullptr, + URL?._id ?? ffi.nullptr, + mainDocumentURL?._id ?? ffi.nullptr); + } + + int get cookieAcceptPolicy { + return _lib._objc_msgSend_745(_id, _lib._sel_cookieAcceptPolicy1); + } + + set cookieAcceptPolicy(int value) { + _lib._objc_msgSend_746(_id, _lib._sel_setCookieAcceptPolicy_1, value); + } + + NSArray sortedCookiesUsingDescriptors_(NSArray? sortOrder) { + final _ret = _lib._objc_msgSend_63( + _id, + _lib._sel_sortedCookiesUsingDescriptors_1, + sortOrder?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void storeCookies_forTask_(NSArray? cookies, NSURLSessionTask? task) { + return _lib._objc_msgSend_766(_id, _lib._sel_storeCookies_forTask_1, + cookies?._id ?? ffi.nullptr, task?._id ?? ffi.nullptr); + } + + void getCookiesForTask_completionHandler_( + NSURLSessionTask? task, ObjCBlock30 completionHandler) { + return _lib._objc_msgSend_767( + _id, + _lib._sel_getCookiesForTask_completionHandler_1, + task?._id ?? ffi.nullptr, + completionHandler._impl); + } + + static NSHTTPCookieStorage new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSHTTPCookieStorage1, _lib._sel_new1); + return NSHTTPCookieStorage._(_ret, _lib, retain: false, release: true); + } + + static NSHTTPCookieStorage alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSHTTPCookieStorage1, _lib._sel_alloc1); + return NSHTTPCookieStorage._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSHTTPCookieStorage1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSHTTPCookieStorage1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSHTTPCookieStorage1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSHTTPCookieStorage1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSHTTPCookieStorage1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSHTTPCookieStorage1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSHTTPCookieStorage1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSHTTPCookieStorage1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSHTTPCookieStorage1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSHTTPCookie extends NSObject { + NSHTTPCookie._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSHTTPCookie] that points to the same underlying object as [other]. + static NSHTTPCookie castFrom(T other) { + return NSHTTPCookie._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSHTTPCookie] that wraps the given raw object pointer. + static NSHTTPCookie castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSHTTPCookie._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSHTTPCookie]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSHTTPCookie1); + } + + NSHTTPCookie initWithProperties_(NSDictionary? properties) { + final _ret = _lib._objc_msgSend_143( + _id, _lib._sel_initWithProperties_1, properties?._id ?? ffi.nullptr); + return NSHTTPCookie._(_ret, _lib, retain: true, release: true); + } + + static NSHTTPCookie cookieWithProperties_( + AVFAudio _lib, NSDictionary? properties) { + final _ret = _lib._objc_msgSend_741(_lib._class_NSHTTPCookie1, + _lib._sel_cookieWithProperties_1, properties?._id ?? ffi.nullptr); + return NSHTTPCookie._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary requestHeaderFieldsWithCookies_( + AVFAudio _lib, NSArray? cookies) { + final _ret = _lib._objc_msgSend_443( + _lib._class_NSHTTPCookie1, + _lib._sel_requestHeaderFieldsWithCookies_1, + cookies?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSArray cookiesWithResponseHeaderFields_forURL_( + AVFAudio _lib, NSDictionary? headerFields, NSURL? URL) { + final _ret = _lib._objc_msgSend_742( + _lib._class_NSHTTPCookie1, + _lib._sel_cookiesWithResponseHeaderFields_forURL_1, + headerFields?._id ?? ffi.nullptr, + URL?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get properties { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_properties1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + int get version { + return _lib._objc_msgSend_10(_id, _lib._sel_version1); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get value { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_value1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSDate? get expiresDate { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_expiresDate1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + bool get sessionOnly { + return _lib._objc_msgSend_12(_id, _lib._sel_isSessionOnly1); + } + + NSString? get domain { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_domain1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get path { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_path1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool get secure { + return _lib._objc_msgSend_12(_id, _lib._sel_isSecure1); + } + + bool get HTTPOnly { + return _lib._objc_msgSend_12(_id, _lib._sel_isHTTPOnly1); + } + + NSString? get comment { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_comment1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSURL? get commentURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_commentURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSArray? get portList { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_portList1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSHTTPCookieStringPolicy get sameSitePolicy { + return _lib._objc_msgSend_20(_id, _lib._sel_sameSitePolicy1); + } + + static NSHTTPCookie new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSHTTPCookie1, _lib._sel_new1); + return NSHTTPCookie._(_ret, _lib, retain: false, release: true); + } + + static NSHTTPCookie alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSHTTPCookie1, _lib._sel_alloc1); + return NSHTTPCookie._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSHTTPCookie1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSHTTPCookie1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSHTTPCookie1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSHTTPCookie1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSHTTPCookie1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSHTTPCookie1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSHTTPCookie1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSHTTPCookie1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSHTTPCookie1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSHTTPCookieStringPolicy = ffi.Pointer; + +abstract class NSHTTPCookieAcceptPolicy { + static const int NSHTTPCookieAcceptPolicyAlways = 0; + static const int NSHTTPCookieAcceptPolicyNever = 1; + static const int NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain = 2; +} + +class NSURLSessionTask extends NSObject { + NSURLSessionTask._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionTask] that points to the same underlying object as [other]. + static NSURLSessionTask castFrom(T other) { + return NSURLSessionTask._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionTask] that wraps the given raw object pointer. + static NSURLSessionTask castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionTask._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionTask]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionTask1); + } + + int get taskIdentifier { + return _lib._objc_msgSend_10(_id, _lib._sel_taskIdentifier1); + } + + NSURLRequest? get originalRequest { + final _ret = _lib._objc_msgSend_761(_id, _lib._sel_originalRequest1); + return _ret.address == 0 + ? null + : NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + NSURLRequest? get currentRequest { + final _ret = _lib._objc_msgSend_761(_id, _lib._sel_currentRequest1); + return _ret.address == 0 + ? null + : NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + NSURLResponse? get response { + final _ret = _lib._objc_msgSend_763(_id, _lib._sel_response1); + return _ret.address == 0 + ? null + : NSURLResponse._(_ret, _lib, retain: true, release: true); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + _lib._objc_msgSend_368( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + NSProgress? get progress { + final _ret = _lib._objc_msgSend_577(_id, _lib._sel_progress1); + return _ret.address == 0 + ? null + : NSProgress._(_ret, _lib, retain: true, release: true); + } + + NSDate? get earliestBeginDate { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_earliestBeginDate1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + set earliestBeginDate(NSDate? value) { + _lib._objc_msgSend_493( + _id, _lib._sel_setEarliestBeginDate_1, value?._id ?? ffi.nullptr); + } + + int get countOfBytesClientExpectsToSend { + return _lib._objc_msgSend_584( + _id, _lib._sel_countOfBytesClientExpectsToSend1); + } + + set countOfBytesClientExpectsToSend(int value) { + _lib._objc_msgSend_585( + _id, _lib._sel_setCountOfBytesClientExpectsToSend_1, value); + } + + int get countOfBytesClientExpectsToReceive { + return _lib._objc_msgSend_584( + _id, _lib._sel_countOfBytesClientExpectsToReceive1); + } + + set countOfBytesClientExpectsToReceive(int value) { + _lib._objc_msgSend_585( + _id, _lib._sel_setCountOfBytesClientExpectsToReceive_1, value); + } + + int get countOfBytesSent { + return _lib._objc_msgSend_584(_id, _lib._sel_countOfBytesSent1); + } + + int get countOfBytesReceived { + return _lib._objc_msgSend_584(_id, _lib._sel_countOfBytesReceived1); + } + + int get countOfBytesExpectedToSend { + return _lib._objc_msgSend_584(_id, _lib._sel_countOfBytesExpectedToSend1); + } + + int get countOfBytesExpectedToReceive { + return _lib._objc_msgSend_584( + _id, _lib._sel_countOfBytesExpectedToReceive1); + } + + NSString? get taskDescription { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_taskDescription1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set taskDescription(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setTaskDescription_1, value?._id ?? ffi.nullptr); + } + + void cancel() { + return _lib._objc_msgSend_1(_id, _lib._sel_cancel1); + } + + int get state { + return _lib._objc_msgSend_764(_id, _lib._sel_state1); + } + + NSError? get error { + final _ret = _lib._objc_msgSend_283(_id, _lib._sel_error1); + return _ret.address == 0 + ? null + : NSError._(_ret, _lib, retain: true, release: true); + } + + void suspend() { + return _lib._objc_msgSend_1(_id, _lib._sel_suspend1); + } + + void resume() { + return _lib._objc_msgSend_1(_id, _lib._sel_resume1); + } + + double get priority { + return _lib._objc_msgSend_215(_id, _lib._sel_priority1); + } + + set priority(double value) { + _lib._objc_msgSend_765(_id, _lib._sel_setPriority_1, value); + } + + bool get prefersIncrementalDelivery { + return _lib._objc_msgSend_12(_id, _lib._sel_prefersIncrementalDelivery1); + } + + set prefersIncrementalDelivery(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setPrefersIncrementalDelivery_1, value); + } + + @override + NSURLSessionTask init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionTask new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLSessionTask1, _lib._sel_new1); + return NSURLSessionTask._(_ret, _lib, retain: false, release: true); + } + + static NSURLSessionTask alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLSessionTask1, _lib._sel_alloc1); + return NSURLSessionTask._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLSessionTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLSessionTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionTask1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSessionTask1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionTask1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionTask1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLSessionTask1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLSessionTask1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionTask1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSURLRequest extends NSObject { + NSURLRequest._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLRequest] that points to the same underlying object as [other]. + static NSURLRequest castFrom(T other) { + return NSURLRequest._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSURLRequest] that wraps the given raw object pointer. + static NSURLRequest castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLRequest._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLRequest]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLRequest1); + } + + static NSURLRequest requestWithURL_(AVFAudio _lib, NSURL? URL) { + final _ret = _lib._objc_msgSend_226(_lib._class_NSURLRequest1, + _lib._sel_requestWithURL_1, URL?._id ?? ffi.nullptr); + return NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + static bool getSupportsSecureCoding(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLRequest1, _lib._sel_supportsSecureCoding1); + } + + static NSURLRequest requestWithURL_cachePolicy_timeoutInterval_( + AVFAudio _lib, NSURL? URL, int cachePolicy, double timeoutInterval) { + final _ret = _lib._objc_msgSend_747( + _lib._class_NSURLRequest1, + _lib._sel_requestWithURL_cachePolicy_timeoutInterval_1, + URL?._id ?? ffi.nullptr, + cachePolicy, + timeoutInterval); + return NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + NSURLRequest initWithURL_(NSURL? URL) { + final _ret = _lib._objc_msgSend_226( + _id, _lib._sel_initWithURL_1, URL?._id ?? ffi.nullptr); + return NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + NSURLRequest initWithURL_cachePolicy_timeoutInterval_( + NSURL? URL, int cachePolicy, double timeoutInterval) { + final _ret = _lib._objc_msgSend_747( + _id, + _lib._sel_initWithURL_cachePolicy_timeoutInterval_1, + URL?._id ?? ffi.nullptr, + cachePolicy, + timeoutInterval); + return NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + NSURL? get URL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_URL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + int get cachePolicy { + return _lib._objc_msgSend_748(_id, _lib._sel_cachePolicy1); + } + + double get timeoutInterval { + return _lib._objc_msgSend_149(_id, _lib._sel_timeoutInterval1); + } + + NSURL? get mainDocumentURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_mainDocumentURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + int get networkServiceType { + return _lib._objc_msgSend_749(_id, _lib._sel_networkServiceType1); + } + + bool get allowsCellularAccess { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsCellularAccess1); + } + + bool get allowsExpensiveNetworkAccess { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsExpensiveNetworkAccess1); + } + + bool get allowsConstrainedNetworkAccess { + return _lib._objc_msgSend_12( + _id, _lib._sel_allowsConstrainedNetworkAccess1); + } + + bool get assumesHTTP3Capable { + return _lib._objc_msgSend_12(_id, _lib._sel_assumesHTTP3Capable1); + } + + int get attribution { + return _lib._objc_msgSend_750(_id, _lib._sel_attribution1); + } + + NSString? get HTTPMethod { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_HTTPMethod1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get allHTTPHeaderFields { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_allHTTPHeaderFields1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSString valueForHTTPHeaderField_(NSString? field) { + final _ret = _lib._objc_msgSend_64( + _id, _lib._sel_valueForHTTPHeaderField_1, field?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSData? get HTTPBody { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_HTTPBody1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSInputStream? get HTTPBodyStream { + final _ret = _lib._objc_msgSend_760(_id, _lib._sel_HTTPBodyStream1); + return _ret.address == 0 + ? null + : NSInputStream._(_ret, _lib, retain: true, release: true); + } + + bool get HTTPShouldHandleCookies { + return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldHandleCookies1); + } + + bool get HTTPShouldUsePipelining { + return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldUsePipelining1); + } + + static NSURLRequest new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLRequest1, _lib._sel_new1); + return NSURLRequest._(_ret, _lib, retain: false, release: true); + } + + static NSURLRequest alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLRequest1, _lib._sel_alloc1); + return NSURLRequest._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLRequest1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLRequest1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLRequest1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLRequest1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLRequest1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLRequest1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLRequest1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSURLRequest1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLRequest1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSURLRequestCachePolicy { + static const int NSURLRequestUseProtocolCachePolicy = 0; + static const int NSURLRequestReloadIgnoringLocalCacheData = 1; + static const int NSURLRequestReloadIgnoringLocalAndRemoteCacheData = 4; + static const int NSURLRequestReloadIgnoringCacheData = 1; + static const int NSURLRequestReturnCacheDataElseLoad = 2; + static const int NSURLRequestReturnCacheDataDontLoad = 3; + static const int NSURLRequestReloadRevalidatingCacheData = 5; +} + +abstract class NSURLRequestNetworkServiceType { + static const int NSURLNetworkServiceTypeDefault = 0; + static const int NSURLNetworkServiceTypeVoIP = 1; + static const int NSURLNetworkServiceTypeVideo = 2; + static const int NSURLNetworkServiceTypeBackground = 3; + static const int NSURLNetworkServiceTypeVoice = 4; + static const int NSURLNetworkServiceTypeResponsiveData = 6; + static const int NSURLNetworkServiceTypeAVStreaming = 8; + static const int NSURLNetworkServiceTypeResponsiveAV = 9; + static const int NSURLNetworkServiceTypeCallSignaling = 11; +} + +abstract class NSURLRequestAttribution { + static const int NSURLRequestAttributionDeveloper = 0; + static const int NSURLRequestAttributionUser = 1; +} + +class NSInputStream extends NSStream { + NSInputStream._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSInputStream] that points to the same underlying object as [other]. + static NSInputStream castFrom(T other) { + return NSInputStream._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSInputStream] that wraps the given raw object pointer. + static NSInputStream castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSInputStream._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSInputStream]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSInputStream1); + } + + int read_maxLength_(ffi.Pointer buffer, int len) { + return _lib._objc_msgSend_752(_id, _lib._sel_read_maxLength_1, buffer, len); + } + + bool getBuffer_length_( + ffi.Pointer> buffer, ffi.Pointer len) { + return _lib._objc_msgSend_759( + _id, _lib._sel_getBuffer_length_1, buffer, len); + } + + bool get hasBytesAvailable { + return _lib._objc_msgSend_12(_id, _lib._sel_hasBytesAvailable1); + } + + NSInputStream initWithData_(NSData? data) { + final _ret = _lib._objc_msgSend_242( + _id, _lib._sel_initWithData_1, data?._id ?? ffi.nullptr); + return NSInputStream._(_ret, _lib, retain: true, release: true); + } + + NSInputStream initWithURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_226( + _id, _lib._sel_initWithURL_1, url?._id ?? ffi.nullptr); + return NSInputStream._(_ret, _lib, retain: true, release: true); + } + + NSInputStream initWithFileAtPath_(NSString? path) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithFileAtPath_1, path?._id ?? ffi.nullptr); + return NSInputStream._(_ret, _lib, retain: true, release: true); + } + + static NSInputStream inputStreamWithData_(AVFAudio _lib, NSData? data) { + final _ret = _lib._objc_msgSend_242(_lib._class_NSInputStream1, + _lib._sel_inputStreamWithData_1, data?._id ?? ffi.nullptr); + return NSInputStream._(_ret, _lib, retain: true, release: true); + } + + static NSInputStream inputStreamWithFileAtPath_( + AVFAudio _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSInputStream1, + _lib._sel_inputStreamWithFileAtPath_1, path?._id ?? ffi.nullptr); + return NSInputStream._(_ret, _lib, retain: true, release: true); + } + + static NSInputStream inputStreamWithURL_(AVFAudio _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_226(_lib._class_NSInputStream1, + _lib._sel_inputStreamWithURL_1, url?._id ?? ffi.nullptr); + return NSInputStream._(_ret, _lib, retain: true, release: true); + } + + static void getStreamsToHostWithName_port_inputStream_outputStream_( + AVFAudio _lib, + NSString? hostname, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + return _lib._objc_msgSend_754( + _lib._class_NSInputStream1, + _lib._sel_getStreamsToHostWithName_port_inputStream_outputStream_1, + hostname?._id ?? ffi.nullptr, + port, + inputStream, + outputStream); + } + + static void getStreamsToHost_port_inputStream_outputStream_( + AVFAudio _lib, + NSHost? host, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + return _lib._objc_msgSend_757( + _lib._class_NSInputStream1, + _lib._sel_getStreamsToHost_port_inputStream_outputStream_1, + host?._id ?? ffi.nullptr, + port, + inputStream, + outputStream); + } + + static void getBoundStreamsWithBufferSize_inputStream_outputStream_( + AVFAudio _lib, + int bufferSize, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + return _lib._objc_msgSend_758( + _lib._class_NSInputStream1, + _lib._sel_getBoundStreamsWithBufferSize_inputStream_outputStream_1, + bufferSize, + inputStream, + outputStream); + } + + static NSInputStream new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSInputStream1, _lib._sel_new1); + return NSInputStream._(_ret, _lib, retain: false, release: true); + } + + static NSInputStream alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSInputStream1, _lib._sel_alloc1); + return NSInputStream._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSInputStream1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSInputStream1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSInputStream1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSInputStream1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSInputStream1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSInputStream1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSInputStream1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSInputStream1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSInputStream1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSStream extends NSObject { + NSStream._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSStream] that points to the same underlying object as [other]. + static NSStream castFrom(T other) { + return NSStream._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSStream] that wraps the given raw object pointer. + static NSStream castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSStream._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSStream]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSStream1); + } + + void open() { + return _lib._objc_msgSend_1(_id, _lib._sel_open1); + } + + void close() { + return _lib._objc_msgSend_1(_id, _lib._sel_close1); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + _lib._objc_msgSend_368( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + NSObject propertyForKey_(NSStreamPropertyKey key) { + final _ret = _lib._objc_msgSend_30(_id, _lib._sel_propertyForKey_1, key); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool setProperty_forKey_(NSObject property, NSStreamPropertyKey key) { + return _lib._objc_msgSend_225( + _id, _lib._sel_setProperty_forKey_1, property._id, key); + } + + void scheduleInRunLoop_forMode_(NSRunLoop? aRunLoop, NSRunLoopMode mode) { + return _lib._objc_msgSend_501(_id, _lib._sel_scheduleInRunLoop_forMode_1, + aRunLoop?._id ?? ffi.nullptr, mode); + } + + void removeFromRunLoop_forMode_(NSRunLoop? aRunLoop, NSRunLoopMode mode) { + return _lib._objc_msgSend_501(_id, _lib._sel_removeFromRunLoop_forMode_1, + aRunLoop?._id ?? ffi.nullptr, mode); + } + + int get streamStatus { + return _lib._objc_msgSend_751(_id, _lib._sel_streamStatus1); + } + + NSError? get streamError { + final _ret = _lib._objc_msgSend_283(_id, _lib._sel_streamError1); + return _ret.address == 0 + ? null + : NSError._(_ret, _lib, retain: true, release: true); + } + + static void getStreamsToHostWithName_port_inputStream_outputStream_( + AVFAudio _lib, + NSString? hostname, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + return _lib._objc_msgSend_754( + _lib._class_NSStream1, + _lib._sel_getStreamsToHostWithName_port_inputStream_outputStream_1, + hostname?._id ?? ffi.nullptr, + port, + inputStream, + outputStream); + } + + static void getStreamsToHost_port_inputStream_outputStream_( + AVFAudio _lib, + NSHost? host, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + return _lib._objc_msgSend_757( + _lib._class_NSStream1, + _lib._sel_getStreamsToHost_port_inputStream_outputStream_1, + host?._id ?? ffi.nullptr, + port, + inputStream, + outputStream); + } + + static void getBoundStreamsWithBufferSize_inputStream_outputStream_( + AVFAudio _lib, + int bufferSize, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + return _lib._objc_msgSend_758( + _lib._class_NSStream1, + _lib._sel_getBoundStreamsWithBufferSize_inputStream_outputStream_1, + bufferSize, + inputStream, + outputStream); + } + + static NSStream new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSStream1, _lib._sel_new1); + return NSStream._(_ret, _lib, retain: false, release: true); + } + + static NSStream alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSStream1, _lib._sel_alloc1); + return NSStream._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSStream1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSStream1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSStream1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSStream1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSStream1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSStream1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSStream1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSStream1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSStream1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSStreamPropertyKey = ffi.Pointer; + +abstract class NSStreamStatus { + static const int NSStreamStatusNotOpen = 0; + static const int NSStreamStatusOpening = 1; + static const int NSStreamStatusOpen = 2; + static const int NSStreamStatusReading = 3; + static const int NSStreamStatusWriting = 4; + static const int NSStreamStatusAtEnd = 5; + static const int NSStreamStatusClosed = 6; + static const int NSStreamStatusError = 7; +} + +class NSOutputStream extends NSStream { + NSOutputStream._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSOutputStream] that points to the same underlying object as [other]. + static NSOutputStream castFrom(T other) { + return NSOutputStream._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSOutputStream] that wraps the given raw object pointer. + static NSOutputStream castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSOutputStream._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSOutputStream]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSOutputStream1); + } + + int write_maxLength_(ffi.Pointer buffer, int len) { + return _lib._objc_msgSend_752( + _id, _lib._sel_write_maxLength_1, buffer, len); + } + + bool get hasSpaceAvailable { + return _lib._objc_msgSend_12(_id, _lib._sel_hasSpaceAvailable1); + } + + NSOutputStream initToMemory() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_initToMemory1); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + NSOutputStream initToBuffer_capacity_( + ffi.Pointer buffer, int capacity) { + final _ret = _lib._objc_msgSend_753( + _id, _lib._sel_initToBuffer_capacity_1, buffer, capacity); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + NSOutputStream initWithURL_append_(NSURL? url, bool shouldAppend) { + final _ret = _lib._objc_msgSend_231(_id, _lib._sel_initWithURL_append_1, + url?._id ?? ffi.nullptr, shouldAppend); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + NSOutputStream initToFileAtPath_append_(NSString? path, bool shouldAppend) { + final _ret = _lib._objc_msgSend_29(_id, _lib._sel_initToFileAtPath_append_1, + path?._id ?? ffi.nullptr, shouldAppend); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + static NSOutputStream outputStreamToMemory(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSOutputStream1, _lib._sel_outputStreamToMemory1); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + static NSOutputStream outputStreamToBuffer_capacity_( + AVFAudio _lib, ffi.Pointer buffer, int capacity) { + final _ret = _lib._objc_msgSend_753(_lib._class_NSOutputStream1, + _lib._sel_outputStreamToBuffer_capacity_1, buffer, capacity); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + static NSOutputStream outputStreamToFileAtPath_append_( + AVFAudio _lib, NSString? path, bool shouldAppend) { + final _ret = _lib._objc_msgSend_29( + _lib._class_NSOutputStream1, + _lib._sel_outputStreamToFileAtPath_append_1, + path?._id ?? ffi.nullptr, + shouldAppend); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + static NSOutputStream outputStreamWithURL_append_( + AVFAudio _lib, NSURL? url, bool shouldAppend) { + final _ret = _lib._objc_msgSend_231( + _lib._class_NSOutputStream1, + _lib._sel_outputStreamWithURL_append_1, + url?._id ?? ffi.nullptr, + shouldAppend); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + static void getStreamsToHostWithName_port_inputStream_outputStream_( + AVFAudio _lib, + NSString? hostname, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + return _lib._objc_msgSend_754( + _lib._class_NSOutputStream1, + _lib._sel_getStreamsToHostWithName_port_inputStream_outputStream_1, + hostname?._id ?? ffi.nullptr, + port, + inputStream, + outputStream); + } + + static void getStreamsToHost_port_inputStream_outputStream_( + AVFAudio _lib, + NSHost? host, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + return _lib._objc_msgSend_757( + _lib._class_NSOutputStream1, + _lib._sel_getStreamsToHost_port_inputStream_outputStream_1, + host?._id ?? ffi.nullptr, + port, + inputStream, + outputStream); + } + + static void getBoundStreamsWithBufferSize_inputStream_outputStream_( + AVFAudio _lib, + int bufferSize, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + return _lib._objc_msgSend_758( + _lib._class_NSOutputStream1, + _lib._sel_getBoundStreamsWithBufferSize_inputStream_outputStream_1, + bufferSize, + inputStream, + outputStream); + } + + static NSOutputStream new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOutputStream1, _lib._sel_new1); + return NSOutputStream._(_ret, _lib, retain: false, release: true); + } + + static NSOutputStream alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOutputStream1, _lib._sel_alloc1); + return NSOutputStream._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSOutputStream1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSOutputStream1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSOutputStream1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOutputStream1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSOutputStream1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSOutputStream1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSOutputStream1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSOutputStream1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSOutputStream1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSHost extends NSObject { + NSHost._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSHost] that points to the same underlying object as [other]. + static NSHost castFrom(T other) { + return NSHost._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSHost] that wraps the given raw object pointer. + static NSHost castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSHost._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSHost]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSHost1); + } + + static NSHost currentHost(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSHost1, _lib._sel_currentHost1); + return NSHost._(_ret, _lib, retain: true, release: true); + } + + static NSHost hostWithName_(AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSHost1, + _lib._sel_hostWithName_1, name?._id ?? ffi.nullptr); + return NSHost._(_ret, _lib, retain: true, release: true); + } + + static NSHost hostWithAddress_(AVFAudio _lib, NSString? address) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSHost1, + _lib._sel_hostWithAddress_1, address?._id ?? ffi.nullptr); + return NSHost._(_ret, _lib, retain: true, release: true); + } + + bool isEqualToHost_(NSHost? aHost) { + return _lib._objc_msgSend_755( + _id, _lib._sel_isEqualToHost_1, aHost?._id ?? ffi.nullptr); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get names { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_names1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get address { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_address1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get addresses { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_addresses1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get localizedName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_localizedName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + static void setHostCacheEnabled_(AVFAudio _lib, bool flag) { + return _lib._objc_msgSend_756( + _lib._class_NSHost1, _lib._sel_setHostCacheEnabled_1, flag); + } + + static bool isHostCacheEnabled(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSHost1, _lib._sel_isHostCacheEnabled1); + } + + static void flushHostCache(AVFAudio _lib) { + return _lib._objc_msgSend_1(_lib._class_NSHost1, _lib._sel_flushHostCache1); + } + + static NSHost new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSHost1, _lib._sel_new1); + return NSHost._(_ret, _lib, retain: false, release: true); + } + + static NSHost alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSHost1, _lib._sel_alloc1); + return NSHost._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSHost1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSHost1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSHost1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSHost1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSHost1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSHost1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSHost1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSHost1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSHost1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSURLResponse extends NSObject { + NSURLResponse._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLResponse] that points to the same underlying object as [other]. + static NSURLResponse castFrom(T other) { + return NSURLResponse._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSURLResponse] that wraps the given raw object pointer. + static NSURLResponse castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLResponse._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLResponse]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLResponse1); + } + + NSURLResponse initWithURL_MIMEType_expectedContentLength_textEncodingName_( + NSURL? URL, NSString? MIMEType, int length, NSString? name) { + final _ret = _lib._objc_msgSend_762( + _id, + _lib._sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_1, + URL?._id ?? ffi.nullptr, + MIMEType?._id ?? ffi.nullptr, + length, + name?._id ?? ffi.nullptr); + return NSURLResponse._(_ret, _lib, retain: true, release: true); + } + + NSURL? get URL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_URL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSString? get MIMEType { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_MIMEType1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get expectedContentLength { + return _lib._objc_msgSend_214(_id, _lib._sel_expectedContentLength1); + } + + NSString? get textEncodingName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_textEncodingName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get suggestedFilename { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_suggestedFilename1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + static NSURLResponse new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLResponse1, _lib._sel_new1); + return NSURLResponse._(_ret, _lib, retain: false, release: true); + } + + static NSURLResponse alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLResponse1, _lib._sel_alloc1); + return NSURLResponse._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLResponse1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLResponse1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLResponse1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLResponse1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLResponse1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLResponse1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLResponse1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSURLResponse1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLResponse1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSURLSessionTaskState { + static const int NSURLSessionTaskStateRunning = 0; + static const int NSURLSessionTaskStateSuspended = 1; + static const int NSURLSessionTaskStateCanceling = 2; + static const int NSURLSessionTaskStateCompleted = 3; +} + +void _ObjCBlock30_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock30_closureRegistry = {}; +int _ObjCBlock30_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock30_registerClosure(Function fn) { + final id = ++_ObjCBlock30_closureRegistryIndex; + _ObjCBlock30_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock30_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return _ObjCBlock30_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock30 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock30._(this._impl, this._lib); + ObjCBlock30.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock30_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock30.fromFunction( + this._lib, void Function(ffi.Pointer arg0) fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock30_closureTrampoline) + .cast(), + _ObjCBlock30_registerClosure(fn)); + void call(ffi.Pointer arg0) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_impl, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class NSIndexPath extends NSObject { + NSIndexPath._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSIndexPath] that points to the same underlying object as [other]. + static NSIndexPath castFrom(T other) { + return NSIndexPath._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSIndexPath] that wraps the given raw object pointer. + static NSIndexPath castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSIndexPath._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSIndexPath]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSIndexPath1); + } + + static NSIndexPath indexPathWithIndex_(AVFAudio _lib, int index) { + final _ret = _lib._objc_msgSend_60( + _lib._class_NSIndexPath1, _lib._sel_indexPathWithIndex_1, index); + return NSIndexPath._(_ret, _lib, retain: true, release: true); + } + + static NSIndexPath indexPathWithIndexes_length_( + AVFAudio _lib, ffi.Pointer indexes, int length) { + final _ret = _lib._objc_msgSend_768(_lib._class_NSIndexPath1, + _lib._sel_indexPathWithIndexes_length_1, indexes, length); + return NSIndexPath._(_ret, _lib, retain: true, release: true); + } + + NSIndexPath initWithIndexes_length_( + ffi.Pointer indexes, int length) { + final _ret = _lib._objc_msgSend_768( + _id, _lib._sel_initWithIndexes_length_1, indexes, length); + return NSIndexPath._(_ret, _lib, retain: true, release: true); + } + + NSIndexPath initWithIndex_(int index) { + final _ret = _lib._objc_msgSend_60(_id, _lib._sel_initWithIndex_1, index); + return NSIndexPath._(_ret, _lib, retain: true, release: true); + } + + NSIndexPath indexPathByAddingIndex_(int index) { + final _ret = + _lib._objc_msgSend_769(_id, _lib._sel_indexPathByAddingIndex_1, index); + return NSIndexPath._(_ret, _lib, retain: true, release: true); + } + + NSIndexPath indexPathByRemovingLastIndex() { + final _ret = + _lib._objc_msgSend_770(_id, _lib._sel_indexPathByRemovingLastIndex1); + return NSIndexPath._(_ret, _lib, retain: true, release: true); + } + + int indexAtPosition_(int position) { + return _lib._objc_msgSend_86(_id, _lib._sel_indexAtPosition_1, position); + } + + int get length { + return _lib._objc_msgSend_10(_id, _lib._sel_length1); + } + + void getIndexes_range_( + ffi.Pointer indexes, NSRange positionRange) { + return _lib._objc_msgSend_771( + _id, _lib._sel_getIndexes_range_1, indexes, positionRange); + } + + int compare_(NSIndexPath? otherObject) { + return _lib._objc_msgSend_772( + _id, _lib._sel_compare_1, otherObject?._id ?? ffi.nullptr); + } + + void getIndexes_(ffi.Pointer indexes) { + return _lib._objc_msgSend_773(_id, _lib._sel_getIndexes_1, indexes); + } + + static NSIndexPath new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSIndexPath1, _lib._sel_new1); + return NSIndexPath._(_ret, _lib, retain: false, release: true); + } + + static NSIndexPath alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSIndexPath1, _lib._sel_alloc1); + return NSIndexPath._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSIndexPath1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSIndexPath1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSIndexPath1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSIndexPath1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSIndexPath1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSIndexPath1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSIndexPath1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSIndexPath1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSIndexPath1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSInflectionRule extends NSObject { + NSInflectionRule._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSInflectionRule] that points to the same underlying object as [other]. + static NSInflectionRule castFrom(T other) { + return NSInflectionRule._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSInflectionRule] that wraps the given raw object pointer. + static NSInflectionRule castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSInflectionRule._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSInflectionRule]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSInflectionRule1); + } + + @override + NSObject init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSInflectionRule? getAutomaticRule(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_774( + _lib._class_NSInflectionRule1, _lib._sel_automaticRule1); + return _ret.address == 0 + ? null + : NSInflectionRule._(_ret, _lib, retain: true, release: true); + } + + static bool canInflectLanguage_(AVFAudio _lib, NSString? language) { + return _lib._objc_msgSend_59(_lib._class_NSInflectionRule1, + _lib._sel_canInflectLanguage_1, language?._id ?? ffi.nullptr); + } + + static bool getCanInflectPreferredLocalization(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSInflectionRule1, + _lib._sel_canInflectPreferredLocalization1); + } + + static NSInflectionRule new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSInflectionRule1, _lib._sel_new1); + return NSInflectionRule._(_ret, _lib, retain: false, release: true); + } + + static NSInflectionRule alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSInflectionRule1, _lib._sel_alloc1); + return NSInflectionRule._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSInflectionRule1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSInflectionRule1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSInflectionRule1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSInflectionRule1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSInflectionRule1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSInflectionRule1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSInflectionRule1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSInflectionRule1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSInflectionRule1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSMorphology extends NSObject { + NSMorphology._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMorphology] that points to the same underlying object as [other]. + static NSMorphology castFrom(T other) { + return NSMorphology._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSMorphology] that wraps the given raw object pointer. + static NSMorphology castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMorphology._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMorphology]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSMorphology1); + } + + int get grammaticalGender { + return _lib._objc_msgSend_775(_id, _lib._sel_grammaticalGender1); + } + + set grammaticalGender(int value) { + _lib._objc_msgSend_776(_id, _lib._sel_setGrammaticalGender_1, value); + } + + int get partOfSpeech { + return _lib._objc_msgSend_777(_id, _lib._sel_partOfSpeech1); + } + + set partOfSpeech(int value) { + _lib._objc_msgSend_778(_id, _lib._sel_setPartOfSpeech_1, value); + } + + int get number { + return _lib._objc_msgSend_779(_id, _lib._sel_number1); + } + + set number(int value) { + _lib._objc_msgSend_780(_id, _lib._sel_setNumber_1, value); + } + + NSMorphologyCustomPronoun customPronounForLanguage_(NSString? language) { + final _ret = _lib._objc_msgSend_781(_id, + _lib._sel_customPronounForLanguage_1, language?._id ?? ffi.nullptr); + return NSMorphologyCustomPronoun._(_ret, _lib, retain: true, release: true); + } + + bool setCustomPronoun_forLanguage_error_(NSMorphologyCustomPronoun? features, + NSString? language, ffi.Pointer> error) { + return _lib._objc_msgSend_782( + _id, + _lib._sel_setCustomPronoun_forLanguage_error_1, + features?._id ?? ffi.nullptr, + language?._id ?? ffi.nullptr, + error); + } + + bool get unspecified { + return _lib._objc_msgSend_12(_id, _lib._sel_isUnspecified1); + } + + static NSMorphology? getUserMorphology(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_783( + _lib._class_NSMorphology1, _lib._sel_userMorphology1); + return _ret.address == 0 + ? null + : NSMorphology._(_ret, _lib, retain: true, release: true); + } + + static NSMorphology new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMorphology1, _lib._sel_new1); + return NSMorphology._(_ret, _lib, retain: false, release: true); + } + + static NSMorphology alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMorphology1, _lib._sel_alloc1); + return NSMorphology._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMorphology1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMorphology1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMorphology1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMorphology1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMorphology1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMorphology1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMorphology1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSMorphology1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMorphology1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSGrammaticalGender { + static const int NSGrammaticalGenderNotSet = 0; + static const int NSGrammaticalGenderFeminine = 1; + static const int NSGrammaticalGenderMasculine = 2; + static const int NSGrammaticalGenderNeuter = 3; +} + +abstract class NSGrammaticalPartOfSpeech { + static const int NSGrammaticalPartOfSpeechNotSet = 0; + static const int NSGrammaticalPartOfSpeechDeterminer = 1; + static const int NSGrammaticalPartOfSpeechPronoun = 2; + static const int NSGrammaticalPartOfSpeechLetter = 3; + static const int NSGrammaticalPartOfSpeechAdverb = 4; + static const int NSGrammaticalPartOfSpeechParticle = 5; + static const int NSGrammaticalPartOfSpeechAdjective = 6; + static const int NSGrammaticalPartOfSpeechAdposition = 7; + static const int NSGrammaticalPartOfSpeechVerb = 8; + static const int NSGrammaticalPartOfSpeechNoun = 9; + static const int NSGrammaticalPartOfSpeechConjunction = 10; + static const int NSGrammaticalPartOfSpeechNumeral = 11; + static const int NSGrammaticalPartOfSpeechInterjection = 12; + static const int NSGrammaticalPartOfSpeechPreposition = 13; + static const int NSGrammaticalPartOfSpeechAbbreviation = 14; +} + +abstract class NSGrammaticalNumber { + static const int NSGrammaticalNumberNotSet = 0; + static const int NSGrammaticalNumberSingular = 1; + static const int NSGrammaticalNumberZero = 2; + static const int NSGrammaticalNumberPlural = 3; + static const int NSGrammaticalNumberPluralTwo = 4; + static const int NSGrammaticalNumberPluralFew = 5; + static const int NSGrammaticalNumberPluralMany = 6; +} + +class NSMorphologyCustomPronoun extends NSObject { + NSMorphologyCustomPronoun._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMorphologyCustomPronoun] that points to the same underlying object as [other]. + static NSMorphologyCustomPronoun castFrom(T other) { + return NSMorphologyCustomPronoun._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSMorphologyCustomPronoun] that wraps the given raw object pointer. + static NSMorphologyCustomPronoun castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMorphologyCustomPronoun._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMorphologyCustomPronoun]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMorphologyCustomPronoun1); + } + + static bool isSupportedForLanguage_(AVFAudio _lib, NSString? language) { + return _lib._objc_msgSend_59(_lib._class_NSMorphologyCustomPronoun1, + _lib._sel_isSupportedForLanguage_1, language?._id ?? ffi.nullptr); + } + + static NSArray requiredKeysForLanguage_(AVFAudio _lib, NSString? language) { + final _ret = _lib._objc_msgSend_119(_lib._class_NSMorphologyCustomPronoun1, + _lib._sel_requiredKeysForLanguage_1, language?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get subjectForm { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_subjectForm1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set subjectForm(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setSubjectForm_1, value?._id ?? ffi.nullptr); + } + + NSString? get objectForm { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_objectForm1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set objectForm(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setObjectForm_1, value?._id ?? ffi.nullptr); + } + + NSString? get possessiveForm { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_possessiveForm1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set possessiveForm(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPossessiveForm_1, value?._id ?? ffi.nullptr); + } + + NSString? get possessiveAdjectiveForm { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_possessiveAdjectiveForm1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set possessiveAdjectiveForm(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPossessiveAdjectiveForm_1, value?._id ?? ffi.nullptr); + } + + NSString? get reflexiveForm { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_reflexiveForm1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set reflexiveForm(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setReflexiveForm_1, value?._id ?? ffi.nullptr); + } + + static NSMorphologyCustomPronoun new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMorphologyCustomPronoun1, _lib._sel_new1); + return NSMorphologyCustomPronoun._(_ret, _lib, + retain: false, release: true); + } + + static NSMorphologyCustomPronoun alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMorphologyCustomPronoun1, _lib._sel_alloc1); + return NSMorphologyCustomPronoun._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMorphologyCustomPronoun1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMorphologyCustomPronoun1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMorphologyCustomPronoun1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMorphologyCustomPronoun1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMorphologyCustomPronoun1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMorphologyCustomPronoun1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMorphologyCustomPronoun1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSMorphologyCustomPronoun1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSMorphologyCustomPronoun1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSOperationQueue extends NSObject { + NSOperationQueue._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSOperationQueue] that points to the same underlying object as [other]. + static NSOperationQueue castFrom(T other) { + return NSOperationQueue._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSOperationQueue] that wraps the given raw object pointer. + static NSOperationQueue castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSOperationQueue._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSOperationQueue]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSOperationQueue1); + } + + NSProgress? get progress { + final _ret = _lib._objc_msgSend_577(_id, _lib._sel_progress1); + return _ret.address == 0 + ? null + : NSProgress._(_ret, _lib, retain: true, release: true); + } + + void addOperation_(NSOperation? op) { + return _lib._objc_msgSend_784( + _id, _lib._sel_addOperation_1, op?._id ?? ffi.nullptr); + } + + void addOperations_waitUntilFinished_(NSArray? ops, bool wait) { + return _lib._objc_msgSend_787( + _id, + _lib._sel_addOperations_waitUntilFinished_1, + ops?._id ?? ffi.nullptr, + wait); + } + + void addOperationWithBlock_(ObjCBlock16 block) { + return _lib._objc_msgSend_465( + _id, _lib._sel_addOperationWithBlock_1, block._impl); + } + + void addBarrierBlock_(ObjCBlock16 barrier) { + return _lib._objc_msgSend_465( + _id, _lib._sel_addBarrierBlock_1, barrier._impl); + } + + int get maxConcurrentOperationCount { + return _lib._objc_msgSend_78(_id, _lib._sel_maxConcurrentOperationCount1); + } + + set maxConcurrentOperationCount(int value) { + _lib._objc_msgSend_558( + _id, _lib._sel_setMaxConcurrentOperationCount_1, value); + } + + bool get suspended { + return _lib._objc_msgSend_12(_id, _lib._sel_isSuspended1); + } + + set suspended(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setSuspended_1, value); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set name(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setName_1, value?._id ?? ffi.nullptr); + } + + int get qualityOfService { + return _lib._objc_msgSend_475(_id, _lib._sel_qualityOfService1); + } + + set qualityOfService(int value) { + _lib._objc_msgSend_476(_id, _lib._sel_setQualityOfService_1, value); + } + + dispatch_queue_t get underlyingQueue { + return _lib._objc_msgSend_788(_id, _lib._sel_underlyingQueue1); + } + + set underlyingQueue(dispatch_queue_t value) { + _lib._objc_msgSend_789(_id, _lib._sel_setUnderlyingQueue_1, value); + } + + void cancelAllOperations() { + return _lib._objc_msgSend_1(_id, _lib._sel_cancelAllOperations1); + } + + void waitUntilAllOperationsAreFinished() { + return _lib._objc_msgSend_1( + _id, _lib._sel_waitUntilAllOperationsAreFinished1); + } + + static NSOperationQueue? getCurrentQueue(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_790( + _lib._class_NSOperationQueue1, _lib._sel_currentQueue1); + return _ret.address == 0 + ? null + : NSOperationQueue._(_ret, _lib, retain: true, release: true); + } + + static NSOperationQueue? getMainQueue(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_790( + _lib._class_NSOperationQueue1, _lib._sel_mainQueue1); + return _ret.address == 0 + ? null + : NSOperationQueue._(_ret, _lib, retain: true, release: true); + } + + NSArray? get operations { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_operations1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + int get operationCount { + return _lib._objc_msgSend_10(_id, _lib._sel_operationCount1); + } + + static NSOperationQueue new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOperationQueue1, _lib._sel_new1); + return NSOperationQueue._(_ret, _lib, retain: false, release: true); + } + + static NSOperationQueue alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOperationQueue1, _lib._sel_alloc1); + return NSOperationQueue._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSOperationQueue1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSOperationQueue1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSOperationQueue1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOperationQueue1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSOperationQueue1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSOperationQueue1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSOperationQueue1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSOperationQueue1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSOperationQueue1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSOperation extends NSObject { + NSOperation._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSOperation] that points to the same underlying object as [other]. + static NSOperation castFrom(T other) { + return NSOperation._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSOperation] that wraps the given raw object pointer. + static NSOperation castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSOperation._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSOperation]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSOperation1); + } + + void start() { + return _lib._objc_msgSend_1(_id, _lib._sel_start1); + } + + void main() { + return _lib._objc_msgSend_1(_id, _lib._sel_main1); + } + + bool get cancelled { + return _lib._objc_msgSend_12(_id, _lib._sel_isCancelled1); + } + + void cancel() { + return _lib._objc_msgSend_1(_id, _lib._sel_cancel1); + } + + bool get executing { + return _lib._objc_msgSend_12(_id, _lib._sel_isExecuting1); + } + + bool get finished { + return _lib._objc_msgSend_12(_id, _lib._sel_isFinished1); + } + + bool get concurrent { + return _lib._objc_msgSend_12(_id, _lib._sel_isConcurrent1); + } + + bool get asynchronous { + return _lib._objc_msgSend_12(_id, _lib._sel_isAsynchronous1); + } + + bool get ready { + return _lib._objc_msgSend_12(_id, _lib._sel_isReady1); + } + + void addDependency_(NSOperation? op) { + return _lib._objc_msgSend_784( + _id, _lib._sel_addDependency_1, op?._id ?? ffi.nullptr); + } + + void removeDependency_(NSOperation? op) { + return _lib._objc_msgSend_784( + _id, _lib._sel_removeDependency_1, op?._id ?? ffi.nullptr); + } + + NSArray? get dependencies { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_dependencies1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + int get queuePriority { + return _lib._objc_msgSend_785(_id, _lib._sel_queuePriority1); + } + + set queuePriority(int value) { + _lib._objc_msgSend_786(_id, _lib._sel_setQueuePriority_1, value); + } + + ObjCBlock16 get completionBlock { + final _ret = _lib._objc_msgSend_586(_id, _lib._sel_completionBlock1); + return ObjCBlock16._(_ret, _lib); + } + + set completionBlock(ObjCBlock16 value) { + _lib._objc_msgSend_587(_id, _lib._sel_setCompletionBlock_1, value._impl); + } + + void waitUntilFinished() { + return _lib._objc_msgSend_1(_id, _lib._sel_waitUntilFinished1); + } + + double get threadPriority { + return _lib._objc_msgSend_149(_id, _lib._sel_threadPriority1); + } + + set threadPriority(double value) { + _lib._objc_msgSend_474(_id, _lib._sel_setThreadPriority_1, value); + } + + int get qualityOfService { + return _lib._objc_msgSend_475(_id, _lib._sel_qualityOfService1); + } + + set qualityOfService(int value) { + _lib._objc_msgSend_476(_id, _lib._sel_setQualityOfService_1, value); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set name(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setName_1, value?._id ?? ffi.nullptr); + } + + static NSOperation new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSOperation1, _lib._sel_new1); + return NSOperation._(_ret, _lib, retain: false, release: true); + } + + static NSOperation alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOperation1, _lib._sel_alloc1); + return NSOperation._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSOperation1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSOperation1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOperation1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOperation1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSOperation1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSOperation1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSOperation1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSOperation1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSOperation1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSOperationQueuePriority { + static const int NSOperationQueuePriorityVeryLow = -8; + static const int NSOperationQueuePriorityLow = -4; + static const int NSOperationQueuePriorityNormal = 0; + static const int NSOperationQueuePriorityHigh = 4; + static const int NSOperationQueuePriorityVeryHigh = 8; +} + +typedef dispatch_queue_t = ffi.Pointer; + +class NSPointerArray extends NSObject { + NSPointerArray._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSPointerArray] that points to the same underlying object as [other]. + static NSPointerArray castFrom(T other) { + return NSPointerArray._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSPointerArray] that wraps the given raw object pointer. + static NSPointerArray castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSPointerArray._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSPointerArray]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSPointerArray1); + } + + NSPointerArray initWithOptions_(int options) { + final _ret = + _lib._objc_msgSend_791(_id, _lib._sel_initWithOptions_1, options); + return NSPointerArray._(_ret, _lib, retain: true, release: true); + } + + NSPointerArray initWithPointerFunctions_(NSPointerFunctions? functions) { + final _ret = _lib._objc_msgSend_805(_id, + _lib._sel_initWithPointerFunctions_1, functions?._id ?? ffi.nullptr); + return NSPointerArray._(_ret, _lib, retain: true, release: true); + } + + static NSPointerArray pointerArrayWithOptions_(AVFAudio _lib, int options) { + final _ret = _lib._objc_msgSend_806(_lib._class_NSPointerArray1, + _lib._sel_pointerArrayWithOptions_1, options); + return NSPointerArray._(_ret, _lib, retain: true, release: true); + } + + static NSPointerArray pointerArrayWithPointerFunctions_( + AVFAudio _lib, NSPointerFunctions? functions) { + final _ret = _lib._objc_msgSend_807( + _lib._class_NSPointerArray1, + _lib._sel_pointerArrayWithPointerFunctions_1, + functions?._id ?? ffi.nullptr); + return NSPointerArray._(_ret, _lib, retain: true, release: true); + } + + NSPointerFunctions? get pointerFunctions { + final _ret = _lib._objc_msgSend_808(_id, _lib._sel_pointerFunctions1); + return _ret.address == 0 + ? null + : NSPointerFunctions._(_ret, _lib, retain: true, release: true); + } + + ffi.Pointer pointerAtIndex_(int index) { + return _lib._objc_msgSend_809(_id, _lib._sel_pointerAtIndex_1, index); + } + + void addPointer_(ffi.Pointer pointer) { + return _lib._objc_msgSend_47(_id, _lib._sel_addPointer_1, pointer); + } + + void removePointerAtIndex_(int index) { + return _lib._objc_msgSend_410(_id, _lib._sel_removePointerAtIndex_1, index); + } + + void insertPointer_atIndex_(ffi.Pointer item, int index) { + return _lib._objc_msgSend_21( + _id, _lib._sel_insertPointer_atIndex_1, item, index); + } + + void replacePointerAtIndex_withPointer_( + int index, ffi.Pointer item) { + return _lib._objc_msgSend_810( + _id, _lib._sel_replacePointerAtIndex_withPointer_1, index, item); + } + + void compact() { + return _lib._objc_msgSend_1(_id, _lib._sel_compact1); + } + + int get count { + return _lib._objc_msgSend_10(_id, _lib._sel_count1); + } + + set count(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setCount_1, value); + } + + static NSObject pointerArrayWithStrongObjects(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPointerArray1, _lib._sel_pointerArrayWithStrongObjects1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject pointerArrayWithWeakObjects(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPointerArray1, _lib._sel_pointerArrayWithWeakObjects1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSPointerArray strongObjectsPointerArray(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_811( + _lib._class_NSPointerArray1, _lib._sel_strongObjectsPointerArray1); + return NSPointerArray._(_ret, _lib, retain: true, release: true); + } + + static NSPointerArray weakObjectsPointerArray(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_811( + _lib._class_NSPointerArray1, _lib._sel_weakObjectsPointerArray1); + return NSPointerArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get allObjects { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_allObjects1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSPointerArray new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPointerArray1, _lib._sel_new1); + return NSPointerArray._(_ret, _lib, retain: false, release: true); + } + + static NSPointerArray alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPointerArray1, _lib._sel_alloc1); + return NSPointerArray._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSPointerArray1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSPointerArray1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSPointerArray1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPointerArray1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSPointerArray1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSPointerArray1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSPointerArray1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSPointerArray1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPointerArray1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSPointerFunctionsOptions { + static const int NSPointerFunctionsStrongMemory = 0; + static const int NSPointerFunctionsZeroingWeakMemory = 1; + static const int NSPointerFunctionsOpaqueMemory = 2; + static const int NSPointerFunctionsMallocMemory = 3; + static const int NSPointerFunctionsMachVirtualMemory = 4; + static const int NSPointerFunctionsWeakMemory = 5; + static const int NSPointerFunctionsObjectPersonality = 0; + static const int NSPointerFunctionsOpaquePersonality = 256; + static const int NSPointerFunctionsObjectPointerPersonality = 512; + static const int NSPointerFunctionsCStringPersonality = 768; + static const int NSPointerFunctionsStructPersonality = 1024; + static const int NSPointerFunctionsIntegerPersonality = 1280; + static const int NSPointerFunctionsCopyIn = 65536; +} + +class NSPointerFunctions extends NSObject { + NSPointerFunctions._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSPointerFunctions] that points to the same underlying object as [other]. + static NSPointerFunctions castFrom(T other) { + return NSPointerFunctions._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSPointerFunctions] that wraps the given raw object pointer. + static NSPointerFunctions castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSPointerFunctions._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSPointerFunctions]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSPointerFunctions1); + } + + NSPointerFunctions initWithOptions_(int options) { + final _ret = + _lib._objc_msgSend_791(_id, _lib._sel_initWithOptions_1, options); + return NSPointerFunctions._(_ret, _lib, retain: true, release: true); + } + + static NSPointerFunctions pointerFunctionsWithOptions_( + AVFAudio _lib, int options) { + final _ret = _lib._objc_msgSend_792(_lib._class_NSPointerFunctions1, + _lib._sel_pointerFunctionsWithOptions_1, options); + return NSPointerFunctions._(_ret, _lib, retain: true, release: true); + } + + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + get hashFunction { + return _lib._objc_msgSend_793(_id, _lib._sel_hashFunction1); + } + + set hashFunction( + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + value) { + _lib._objc_msgSend_794(_id, _lib._sel_setHashFunction_1, value); + } + + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + get isEqualFunction { + return _lib._objc_msgSend_795(_id, _lib._sel_isEqualFunction1); + } + + set isEqualFunction( + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + value) { + _lib._objc_msgSend_796(_id, _lib._sel_setIsEqualFunction_1, value); + } + + ffi.Pointer)>> + get sizeFunction { + return _lib._objc_msgSend_797(_id, _lib._sel_sizeFunction1); + } + + set sizeFunction( + ffi.Pointer< + ffi.NativeFunction)>> + value) { + _lib._objc_msgSend_798(_id, _lib._sel_setSizeFunction_1, value); + } + + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>> + get descriptionFunction { + return _lib._objc_msgSend_799(_id, _lib._sel_descriptionFunction1); + } + + set descriptionFunction( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>> + value) { + _lib._objc_msgSend_800(_id, _lib._sel_setDescriptionFunction_1, value); + } + + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + get relinquishFunction { + return _lib._objc_msgSend_801(_id, _lib._sel_relinquishFunction1); + } + + set relinquishFunction( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + value) { + _lib._objc_msgSend_802(_id, _lib._sel_setRelinquishFunction_1, value); + } + + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>, + ffi.Bool)>> get acquireFunction { + return _lib._objc_msgSend_803(_id, _lib._sel_acquireFunction1); + } + + set acquireFunction( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>, + ffi.Bool)>> + value) { + _lib._objc_msgSend_804(_id, _lib._sel_setAcquireFunction_1, value); + } + + bool get usesStrongWriteBarrier { + return _lib._objc_msgSend_12(_id, _lib._sel_usesStrongWriteBarrier1); + } + + set usesStrongWriteBarrier(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setUsesStrongWriteBarrier_1, value); + } + + bool get usesWeakReadAndWriteBarriers { + return _lib._objc_msgSend_12(_id, _lib._sel_usesWeakReadAndWriteBarriers1); + } + + set usesWeakReadAndWriteBarriers(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setUsesWeakReadAndWriteBarriers_1, value); + } + + static NSPointerFunctions new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPointerFunctions1, _lib._sel_new1); + return NSPointerFunctions._(_ret, _lib, retain: false, release: true); + } + + static NSPointerFunctions alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPointerFunctions1, _lib._sel_alloc1); + return NSPointerFunctions._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSPointerFunctions1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSPointerFunctions1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSPointerFunctions1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPointerFunctions1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSPointerFunctions1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSPointerFunctions1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSPointerFunctions1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSPointerFunctions1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPointerFunctions1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSProcessInfo extends NSObject { + NSProcessInfo._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSProcessInfo] that points to the same underlying object as [other]. + static NSProcessInfo castFrom(T other) { + return NSProcessInfo._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSProcessInfo] that wraps the given raw object pointer. + static NSProcessInfo castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSProcessInfo._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSProcessInfo]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSProcessInfo1); + } + + static NSProcessInfo? getProcessInfo(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_812( + _lib._class_NSProcessInfo1, _lib._sel_processInfo1); + return _ret.address == 0 + ? null + : NSProcessInfo._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get environment { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_environment1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSArray? get arguments { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_arguments1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get hostName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_hostName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get processName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_processName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set processName(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setProcessName_1, value?._id ?? ffi.nullptr); + } + + int get processIdentifier { + return _lib._objc_msgSend_213(_id, _lib._sel_processIdentifier1); + } + + NSString? get globallyUniqueString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_globallyUniqueString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int operatingSystem() { + return _lib._objc_msgSend_10(_id, _lib._sel_operatingSystem1); + } + + NSString operatingSystemName() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_operatingSystemName1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get operatingSystemVersionString { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_operatingSystemVersionString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSOperatingSystemVersion get operatingSystemVersion { + return _lib._objc_msgSend_813(_id, _lib._sel_operatingSystemVersion1); + } + + int get processorCount { + return _lib._objc_msgSend_10(_id, _lib._sel_processorCount1); + } + + int get activeProcessorCount { + return _lib._objc_msgSend_10(_id, _lib._sel_activeProcessorCount1); + } + + int get physicalMemory { + return _lib._objc_msgSend_148(_id, _lib._sel_physicalMemory1); + } + + bool isOperatingSystemAtLeastVersion_(NSOperatingSystemVersion version) { + return _lib._objc_msgSend_814( + _id, _lib._sel_isOperatingSystemAtLeastVersion_1, version); + } + + double get systemUptime { + return _lib._objc_msgSend_149(_id, _lib._sel_systemUptime1); + } + + void disableSuddenTermination() { + return _lib._objc_msgSend_1(_id, _lib._sel_disableSuddenTermination1); + } + + void enableSuddenTermination() { + return _lib._objc_msgSend_1(_id, _lib._sel_enableSuddenTermination1); + } + + void disableAutomaticTermination_(NSString? reason) { + return _lib._objc_msgSend_186(_id, _lib._sel_disableAutomaticTermination_1, + reason?._id ?? ffi.nullptr); + } + + void enableAutomaticTermination_(NSString? reason) { + return _lib._objc_msgSend_186(_id, _lib._sel_enableAutomaticTermination_1, + reason?._id ?? ffi.nullptr); + } + + bool get automaticTerminationSupportEnabled { + return _lib._objc_msgSend_12( + _id, _lib._sel_automaticTerminationSupportEnabled1); + } + + set automaticTerminationSupportEnabled(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setAutomaticTerminationSupportEnabled_1, value); + } + + NSObject beginActivityWithOptions_reason_(int options, NSString? reason) { + final _ret = _lib._objc_msgSend_815( + _id, + _lib._sel_beginActivityWithOptions_reason_1, + options, + reason?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void endActivity_(NSObject? activity) { + return _lib._objc_msgSend_15( + _id, _lib._sel_endActivity_1, activity?._id ?? ffi.nullptr); + } + + void performActivityWithOptions_reason_usingBlock_( + int options, NSString? reason, ObjCBlock16 block) { + return _lib._objc_msgSend_816( + _id, + _lib._sel_performActivityWithOptions_reason_usingBlock_1, + options, + reason?._id ?? ffi.nullptr, + block._impl); + } + + void performExpiringActivityWithReason_usingBlock_( + NSString? reason, ObjCBlock31 block) { + return _lib._objc_msgSend_817( + _id, + _lib._sel_performExpiringActivityWithReason_usingBlock_1, + reason?._id ?? ffi.nullptr, + block._impl); + } + + NSString? get userName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_userName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get fullUserName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_fullUserName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get thermalState { + return _lib._objc_msgSend_818(_id, _lib._sel_thermalState1); + } + + bool get lowPowerModeEnabled { + return _lib._objc_msgSend_12(_id, _lib._sel_isLowPowerModeEnabled1); + } + + bool get macCatalystApp { + return _lib._objc_msgSend_12(_id, _lib._sel_isMacCatalystApp1); + } + + bool get iOSAppOnMac { + return _lib._objc_msgSend_12(_id, _lib._sel_isiOSAppOnMac1); + } + + static NSProcessInfo new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSProcessInfo1, _lib._sel_new1); + return NSProcessInfo._(_ret, _lib, retain: false, release: true); + } + + static NSProcessInfo alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSProcessInfo1, _lib._sel_alloc1); + return NSProcessInfo._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSProcessInfo1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSProcessInfo1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSProcessInfo1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSProcessInfo1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSProcessInfo1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSProcessInfo1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSProcessInfo1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSProcessInfo1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSProcessInfo1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSOperatingSystemVersion extends ffi.Struct { + @NSInteger() + external int majorVersion; + + @NSInteger() + external int minorVersion; + + @NSInteger() + external int patchVersion; +} + +abstract class NSActivityOptions { + static const int NSActivityIdleDisplaySleepDisabled = 1099511627776; + static const int NSActivityIdleSystemSleepDisabled = 1048576; + static const int NSActivitySuddenTerminationDisabled = 16384; + static const int NSActivityAutomaticTerminationDisabled = 32768; + static const int NSActivityUserInitiated = 16777215; + static const int NSActivityUserInitiatedAllowingIdleSystemSleep = 15728639; + static const int NSActivityBackground = 255; + static const int NSActivityLatencyCritical = 1095216660480; +} + +void _ObjCBlock31_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, bool arg0) { + return block.ref.target + .cast>() + .asFunction()(arg0); +} + +final _ObjCBlock31_closureRegistry = {}; +int _ObjCBlock31_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock31_registerClosure(Function fn) { + final id = ++_ObjCBlock31_closureRegistryIndex; + _ObjCBlock31_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock31_closureTrampoline(ffi.Pointer<_ObjCBlock> block, bool arg0) { + return _ObjCBlock31_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock31 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock31._(this._impl, this._lib); + ObjCBlock31.fromFunctionPointer(this._lib, + ffi.Pointer> ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Bool arg0)>(_ObjCBlock31_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock31.fromFunction(this._lib, void Function(bool arg0) fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Bool arg0)>(_ObjCBlock31_closureTrampoline) + .cast(), + _ObjCBlock31_registerClosure(fn)); + void call(bool arg0) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, ffi.Bool arg0)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, bool arg0)>()(_impl, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +abstract class NSProcessInfoThermalState { + static const int NSProcessInfoThermalStateNominal = 0; + static const int NSProcessInfoThermalStateFair = 1; + static const int NSProcessInfoThermalStateSerious = 2; + static const int NSProcessInfoThermalStateCritical = 3; +} + +class NSTextCheckingResult extends NSObject { + NSTextCheckingResult._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSTextCheckingResult] that points to the same underlying object as [other]. + static NSTextCheckingResult castFrom(T other) { + return NSTextCheckingResult._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSTextCheckingResult] that wraps the given raw object pointer. + static NSTextCheckingResult castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSTextCheckingResult._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSTextCheckingResult]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSTextCheckingResult1); + } + + int get resultType { + return _lib._objc_msgSend_819(_id, _lib._sel_resultType1); + } + + NSRange get range { + return _lib._objc_msgSend_49(_id, _lib._sel_range1); + } + + NSOrthography? get orthography { + final _ret = _lib._objc_msgSend_820(_id, _lib._sel_orthography1); + return _ret.address == 0 + ? null + : NSOrthography._(_ret, _lib, retain: true, release: true); + } + + NSArray? get grammarDetails { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_grammarDetails1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSDate? get date { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_date1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + NSTimeZone? get timeZone { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_timeZone1); + return _ret.address == 0 + ? null + : NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + double get duration { + return _lib._objc_msgSend_149(_id, _lib._sel_duration1); + } + + NSDictionary? get components { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_components1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSURL? get URL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_URL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSString? get replacementString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_replacementString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get alternativeStrings { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_alternativeStrings1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSRegularExpression? get regularExpression { + final _ret = _lib._objc_msgSend_832(_id, _lib._sel_regularExpression1); + return _ret.address == 0 + ? null + : NSRegularExpression._(_ret, _lib, retain: true, release: true); + } + + NSString? get phoneNumber { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_phoneNumber1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get numberOfRanges { + return _lib._objc_msgSend_10(_id, _lib._sel_numberOfRanges1); + } + + NSRange rangeAtIndex_(int idx) { + return _lib._objc_msgSend_308(_id, _lib._sel_rangeAtIndex_1, idx); + } + + NSRange rangeWithName_(NSString? name) { + return _lib._objc_msgSend_301( + _id, _lib._sel_rangeWithName_1, name?._id ?? ffi.nullptr); + } + + NSTextCheckingResult resultByAdjustingRangesWithOffset_(int offset) { + final _ret = _lib._objc_msgSend_833( + _id, _lib._sel_resultByAdjustingRangesWithOffset_1, offset); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get addressComponents { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_addressComponents1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult orthographyCheckingResultWithRange_orthography_( + AVFAudio _lib, NSRange range, NSOrthography? orthography) { + final _ret = _lib._objc_msgSend_834( + _lib._class_NSTextCheckingResult1, + _lib._sel_orthographyCheckingResultWithRange_orthography_1, + range, + orthography?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult spellCheckingResultWithRange_( + AVFAudio _lib, NSRange range) { + final _ret = _lib._objc_msgSend_835(_lib._class_NSTextCheckingResult1, + _lib._sel_spellCheckingResultWithRange_1, range); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult grammarCheckingResultWithRange_details_( + AVFAudio _lib, NSRange range, NSArray? details) { + final _ret = _lib._objc_msgSend_836( + _lib._class_NSTextCheckingResult1, + _lib._sel_grammarCheckingResultWithRange_details_1, + range, + details?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult dateCheckingResultWithRange_date_( + AVFAudio _lib, NSRange range, NSDate? date) { + final _ret = _lib._objc_msgSend_837( + _lib._class_NSTextCheckingResult1, + _lib._sel_dateCheckingResultWithRange_date_1, + range, + date?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult + dateCheckingResultWithRange_date_timeZone_duration_(AVFAudio _lib, + NSRange range, NSDate? date, NSTimeZone? timeZone, double duration) { + final _ret = _lib._objc_msgSend_838( + _lib._class_NSTextCheckingResult1, + _lib._sel_dateCheckingResultWithRange_date_timeZone_duration_1, + range, + date?._id ?? ffi.nullptr, + timeZone?._id ?? ffi.nullptr, + duration); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult addressCheckingResultWithRange_components_( + AVFAudio _lib, NSRange range, NSDictionary? components) { + final _ret = _lib._objc_msgSend_839( + _lib._class_NSTextCheckingResult1, + _lib._sel_addressCheckingResultWithRange_components_1, + range, + components?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult linkCheckingResultWithRange_URL_( + AVFAudio _lib, NSRange range, NSURL? url) { + final _ret = _lib._objc_msgSend_840( + _lib._class_NSTextCheckingResult1, + _lib._sel_linkCheckingResultWithRange_URL_1, + range, + url?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult quoteCheckingResultWithRange_replacementString_( + AVFAudio _lib, NSRange range, NSString? replacementString) { + final _ret = _lib._objc_msgSend_841( + _lib._class_NSTextCheckingResult1, + _lib._sel_quoteCheckingResultWithRange_replacementString_1, + range, + replacementString?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult dashCheckingResultWithRange_replacementString_( + AVFAudio _lib, NSRange range, NSString? replacementString) { + final _ret = _lib._objc_msgSend_841( + _lib._class_NSTextCheckingResult1, + _lib._sel_dashCheckingResultWithRange_replacementString_1, + range, + replacementString?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult + replacementCheckingResultWithRange_replacementString_( + AVFAudio _lib, NSRange range, NSString? replacementString) { + final _ret = _lib._objc_msgSend_841( + _lib._class_NSTextCheckingResult1, + _lib._sel_replacementCheckingResultWithRange_replacementString_1, + range, + replacementString?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult + correctionCheckingResultWithRange_replacementString_( + AVFAudio _lib, NSRange range, NSString? replacementString) { + final _ret = _lib._objc_msgSend_841( + _lib._class_NSTextCheckingResult1, + _lib._sel_correctionCheckingResultWithRange_replacementString_1, + range, + replacementString?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult + correctionCheckingResultWithRange_replacementString_alternativeStrings_( + AVFAudio _lib, + NSRange range, + NSString? replacementString, + NSArray? alternativeStrings) { + final _ret = _lib._objc_msgSend_842( + _lib._class_NSTextCheckingResult1, + _lib._sel_correctionCheckingResultWithRange_replacementString_alternativeStrings_1, + range, + replacementString?._id ?? ffi.nullptr, + alternativeStrings?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult + regularExpressionCheckingResultWithRanges_count_regularExpression_( + AVFAudio _lib, + NSRangePointer ranges, + int count, + NSRegularExpression? regularExpression) { + final _ret = _lib._objc_msgSend_843( + _lib._class_NSTextCheckingResult1, + _lib._sel_regularExpressionCheckingResultWithRanges_count_regularExpression_1, + ranges, + count, + regularExpression?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult phoneNumberCheckingResultWithRange_phoneNumber_( + AVFAudio _lib, NSRange range, NSString? phoneNumber) { + final _ret = _lib._objc_msgSend_841( + _lib._class_NSTextCheckingResult1, + _lib._sel_phoneNumberCheckingResultWithRange_phoneNumber_1, + range, + phoneNumber?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult + transitInformationCheckingResultWithRange_components_( + AVFAudio _lib, NSRange range, NSDictionary? components) { + final _ret = _lib._objc_msgSend_839( + _lib._class_NSTextCheckingResult1, + _lib._sel_transitInformationCheckingResultWithRange_components_1, + range, + components?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSTextCheckingResult1, _lib._sel_new1); + return NSTextCheckingResult._(_ret, _lib, retain: false, release: true); + } + + static NSTextCheckingResult alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSTextCheckingResult1, _lib._sel_alloc1); + return NSTextCheckingResult._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSTextCheckingResult1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSTextCheckingResult1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSTextCheckingResult1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSTextCheckingResult1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSTextCheckingResult1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSTextCheckingResult1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSTextCheckingResult1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSTextCheckingResult1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSTextCheckingResult1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSTextCheckingType { + static const int NSTextCheckingTypeOrthography = 1; + static const int NSTextCheckingTypeSpelling = 2; + static const int NSTextCheckingTypeGrammar = 4; + static const int NSTextCheckingTypeDate = 8; + static const int NSTextCheckingTypeAddress = 16; + static const int NSTextCheckingTypeLink = 32; + static const int NSTextCheckingTypeQuote = 64; + static const int NSTextCheckingTypeDash = 128; + static const int NSTextCheckingTypeReplacement = 256; + static const int NSTextCheckingTypeCorrection = 512; + static const int NSTextCheckingTypeRegularExpression = 1024; + static const int NSTextCheckingTypePhoneNumber = 2048; + static const int NSTextCheckingTypeTransitInformation = 4096; +} + +class NSRegularExpression extends NSObject { + NSRegularExpression._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSRegularExpression] that points to the same underlying object as [other]. + static NSRegularExpression castFrom(T other) { + return NSRegularExpression._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSRegularExpression] that wraps the given raw object pointer. + static NSRegularExpression castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSRegularExpression._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSRegularExpression]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSRegularExpression1); + } + + static NSRegularExpression regularExpressionWithPattern_options_error_( + AVFAudio _lib, + NSString? pattern, + int options, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_821( + _lib._class_NSRegularExpression1, + _lib._sel_regularExpressionWithPattern_options_error_1, + pattern?._id ?? ffi.nullptr, + options, + error); + return NSRegularExpression._(_ret, _lib, retain: true, release: true); + } + + NSRegularExpression initWithPattern_options_error_(NSString? pattern, + int options, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_822( + _id, + _lib._sel_initWithPattern_options_error_1, + pattern?._id ?? ffi.nullptr, + options, + error); + return NSRegularExpression._(_ret, _lib, retain: true, release: true); + } + + NSString? get pattern { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_pattern1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get options { + return _lib._objc_msgSend_823(_id, _lib._sel_options1); + } + + int get numberOfCaptureGroups { + return _lib._objc_msgSend_10(_id, _lib._sel_numberOfCaptureGroups1); + } + + static NSString escapedPatternForString_(AVFAudio _lib, NSString? string) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSRegularExpression1, + _lib._sel_escapedPatternForString_1, string?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + void enumerateMatchesInString_options_range_usingBlock_( + NSString? string, int options, NSRange range, ObjCBlock32 block) { + return _lib._objc_msgSend_824( + _id, + _lib._sel_enumerateMatchesInString_options_range_usingBlock_1, + string?._id ?? ffi.nullptr, + options, + range, + block._impl); + } + + NSArray matchesInString_options_range_( + NSString? string, int options, NSRange range) { + final _ret = _lib._objc_msgSend_825( + _id, + _lib._sel_matchesInString_options_range_1, + string?._id ?? ffi.nullptr, + options, + range); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + int numberOfMatchesInString_options_range_( + NSString? string, int options, NSRange range) { + return _lib._objc_msgSend_826( + _id, + _lib._sel_numberOfMatchesInString_options_range_1, + string?._id ?? ffi.nullptr, + options, + range); + } + + NSTextCheckingResult firstMatchInString_options_range_( + NSString? string, int options, NSRange range) { + final _ret = _lib._objc_msgSend_827( + _id, + _lib._sel_firstMatchInString_options_range_1, + string?._id ?? ffi.nullptr, + options, + range); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + NSRange rangeOfFirstMatchInString_options_range_( + NSString? string, int options, NSRange range) { + return _lib._objc_msgSend_828( + _id, + _lib._sel_rangeOfFirstMatchInString_options_range_1, + string?._id ?? ffi.nullptr, + options, + range); + } + + NSString stringByReplacingMatchesInString_options_range_withTemplate_( + NSString? string, int options, NSRange range, NSString? templ) { + final _ret = _lib._objc_msgSend_829( + _id, + _lib._sel_stringByReplacingMatchesInString_options_range_withTemplate_1, + string?._id ?? ffi.nullptr, + options, + range, + templ?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + int replaceMatchesInString_options_range_withTemplate_( + NSMutableString? string, int options, NSRange range, NSString? templ) { + return _lib._objc_msgSend_830( + _id, + _lib._sel_replaceMatchesInString_options_range_withTemplate_1, + string?._id ?? ffi.nullptr, + options, + range, + templ?._id ?? ffi.nullptr); + } + + NSString replacementStringForResult_inString_offset_template_( + NSTextCheckingResult? result, + NSString? string, + int offset, + NSString? templ) { + final _ret = _lib._objc_msgSend_831( + _id, + _lib._sel_replacementStringForResult_inString_offset_template_1, + result?._id ?? ffi.nullptr, + string?._id ?? ffi.nullptr, + offset, + templ?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString escapedTemplateForString_(AVFAudio _lib, NSString? string) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSRegularExpression1, + _lib._sel_escapedTemplateForString_1, string?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSRegularExpression new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSRegularExpression1, _lib._sel_new1); + return NSRegularExpression._(_ret, _lib, retain: false, release: true); + } + + static NSRegularExpression alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSRegularExpression1, _lib._sel_alloc1); + return NSRegularExpression._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSRegularExpression1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSRegularExpression1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSRegularExpression1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSRegularExpression1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSRegularExpression1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSRegularExpression1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSRegularExpression1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSRegularExpression1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSRegularExpression1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSRegularExpressionOptions { + static const int NSRegularExpressionCaseInsensitive = 1; + static const int NSRegularExpressionAllowCommentsAndWhitespace = 2; + static const int NSRegularExpressionIgnoreMetacharacters = 4; + static const int NSRegularExpressionDotMatchesLineSeparators = 8; + static const int NSRegularExpressionAnchorsMatchLines = 16; + static const int NSRegularExpressionUseUnixLineSeparators = 32; + static const int NSRegularExpressionUseUnicodeWordBoundaries = 64; +} + +abstract class NSMatchingOptions { + static const int NSMatchingReportProgress = 1; + static const int NSMatchingReportCompletion = 2; + static const int NSMatchingAnchored = 4; + static const int NSMatchingWithTransparentBounds = 8; + static const int NSMatchingWithoutAnchoringBounds = 16; +} + +void _ObjCBlock32_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Int32 arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock32_closureRegistry = {}; +int _ObjCBlock32_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock32_registerClosure(Function fn) { + final id = ++_ObjCBlock32_closureRegistryIndex; + _ObjCBlock32_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock32_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return _ObjCBlock32_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock32 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock32._(this._impl, this._lib); + ObjCBlock32.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Int32 arg1, ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Pointer arg2)>( + _ObjCBlock32_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock32.fromFunction( + this._lib, + void Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Pointer arg2)>( + _ObjCBlock32_closureTrampoline) + .cast(), + _ObjCBlock32_registerClosure(fn)); + void call( + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +abstract class NSMatchingFlags { + static const int NSMatchingProgress = 1; + static const int NSMatchingCompleted = 2; + static const int NSMatchingHitEnd = 4; + static const int NSMatchingRequiredEnd = 8; + static const int NSMatchingInternalError = 16; +} + +class NSURLCache extends NSObject { + NSURLCache._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLCache] that points to the same underlying object as [other]. + static NSURLCache castFrom(T other) { + return NSURLCache._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSURLCache] that wraps the given raw object pointer. + static NSURLCache castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLCache._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLCache]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLCache1); + } + + static NSURLCache? getSharedURLCache(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_844( + _lib._class_NSURLCache1, _lib._sel_sharedURLCache1); + return _ret.address == 0 + ? null + : NSURLCache._(_ret, _lib, retain: true, release: true); + } + + static void setSharedURLCache(AVFAudio _lib, NSURLCache? value) { + _lib._objc_msgSend_845(_lib._class_NSURLCache1, + _lib._sel_setSharedURLCache_1, value?._id ?? ffi.nullptr); + } + + NSURLCache initWithMemoryCapacity_diskCapacity_diskPath_( + int memoryCapacity, int diskCapacity, NSString? path) { + final _ret = _lib._objc_msgSend_846( + _id, + _lib._sel_initWithMemoryCapacity_diskCapacity_diskPath_1, + memoryCapacity, + diskCapacity, + path?._id ?? ffi.nullptr); + return NSURLCache._(_ret, _lib, retain: true, release: true); + } + + NSURLCache initWithMemoryCapacity_diskCapacity_directoryURL_( + int memoryCapacity, int diskCapacity, NSURL? directoryURL) { + final _ret = _lib._objc_msgSend_847( + _id, + _lib._sel_initWithMemoryCapacity_diskCapacity_directoryURL_1, + memoryCapacity, + diskCapacity, + directoryURL?._id ?? ffi.nullptr); + return NSURLCache._(_ret, _lib, retain: true, release: true); + } + + NSCachedURLResponse cachedResponseForRequest_(NSURLRequest? request) { + final _ret = _lib._objc_msgSend_851( + _id, _lib._sel_cachedResponseForRequest_1, request?._id ?? ffi.nullptr); + return NSCachedURLResponse._(_ret, _lib, retain: true, release: true); + } + + void storeCachedResponse_forRequest_( + NSCachedURLResponse? cachedResponse, NSURLRequest? request) { + return _lib._objc_msgSend_852( + _id, + _lib._sel_storeCachedResponse_forRequest_1, + cachedResponse?._id ?? ffi.nullptr, + request?._id ?? ffi.nullptr); + } + + void removeCachedResponseForRequest_(NSURLRequest? request) { + return _lib._objc_msgSend_853( + _id, + _lib._sel_removeCachedResponseForRequest_1, + request?._id ?? ffi.nullptr); + } + + void removeAllCachedResponses() { + return _lib._objc_msgSend_1(_id, _lib._sel_removeAllCachedResponses1); + } + + void removeCachedResponsesSinceDate_(NSDate? date) { + return _lib._objc_msgSend_472(_id, + _lib._sel_removeCachedResponsesSinceDate_1, date?._id ?? ffi.nullptr); + } + + int get memoryCapacity { + return _lib._objc_msgSend_10(_id, _lib._sel_memoryCapacity1); + } + + set memoryCapacity(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setMemoryCapacity_1, value); + } + + int get diskCapacity { + return _lib._objc_msgSend_10(_id, _lib._sel_diskCapacity1); + } + + set diskCapacity(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setDiskCapacity_1, value); + } + + int get currentMemoryUsage { + return _lib._objc_msgSend_10(_id, _lib._sel_currentMemoryUsage1); + } + + int get currentDiskUsage { + return _lib._objc_msgSend_10(_id, _lib._sel_currentDiskUsage1); + } + + void storeCachedResponse_forDataTask_( + NSCachedURLResponse? cachedResponse, NSURLSessionDataTask? dataTask) { + return _lib._objc_msgSend_854( + _id, + _lib._sel_storeCachedResponse_forDataTask_1, + cachedResponse?._id ?? ffi.nullptr, + dataTask?._id ?? ffi.nullptr); + } + + void getCachedResponseForDataTask_completionHandler_( + NSURLSessionDataTask? dataTask, ObjCBlock33 completionHandler) { + return _lib._objc_msgSend_855( + _id, + _lib._sel_getCachedResponseForDataTask_completionHandler_1, + dataTask?._id ?? ffi.nullptr, + completionHandler._impl); + } + + void removeCachedResponseForDataTask_(NSURLSessionDataTask? dataTask) { + return _lib._objc_msgSend_856( + _id, + _lib._sel_removeCachedResponseForDataTask_1, + dataTask?._id ?? ffi.nullptr); + } + + static NSURLCache new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLCache1, _lib._sel_new1); + return NSURLCache._(_ret, _lib, retain: false, release: true); + } + + static NSURLCache alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLCache1, _lib._sel_alloc1); + return NSURLCache._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLCache1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLCache1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLCache1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLCache1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLCache1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLCache1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLCache1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSURLCache1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLCache1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSCachedURLResponse extends NSObject { + NSCachedURLResponse._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSCachedURLResponse] that points to the same underlying object as [other]. + static NSCachedURLResponse castFrom(T other) { + return NSCachedURLResponse._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSCachedURLResponse] that wraps the given raw object pointer. + static NSCachedURLResponse castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSCachedURLResponse._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSCachedURLResponse]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSCachedURLResponse1); + } + + NSCachedURLResponse initWithResponse_data_( + NSURLResponse? response, NSData? data) { + final _ret = _lib._objc_msgSend_848(_id, _lib._sel_initWithResponse_data_1, + response?._id ?? ffi.nullptr, data?._id ?? ffi.nullptr); + return NSCachedURLResponse._(_ret, _lib, retain: true, release: true); + } + + NSCachedURLResponse initWithResponse_data_userInfo_storagePolicy_( + NSURLResponse? response, + NSData? data, + NSDictionary? userInfo, + int storagePolicy) { + final _ret = _lib._objc_msgSend_849( + _id, + _lib._sel_initWithResponse_data_userInfo_storagePolicy_1, + response?._id ?? ffi.nullptr, + data?._id ?? ffi.nullptr, + userInfo?._id ?? ffi.nullptr, + storagePolicy); + return NSCachedURLResponse._(_ret, _lib, retain: true, release: true); + } + + NSURLResponse? get response { + final _ret = _lib._objc_msgSend_763(_id, _lib._sel_response1); + return _ret.address == 0 + ? null + : NSURLResponse._(_ret, _lib, retain: true, release: true); + } + + NSData? get data { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_data1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get userInfo { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_userInfo1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + int get storagePolicy { + return _lib._objc_msgSend_850(_id, _lib._sel_storagePolicy1); + } + + static NSCachedURLResponse new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSCachedURLResponse1, _lib._sel_new1); + return NSCachedURLResponse._(_ret, _lib, retain: false, release: true); + } + + static NSCachedURLResponse alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSCachedURLResponse1, _lib._sel_alloc1); + return NSCachedURLResponse._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSCachedURLResponse1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSCachedURLResponse1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSCachedURLResponse1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSCachedURLResponse1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSCachedURLResponse1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSCachedURLResponse1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSCachedURLResponse1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSCachedURLResponse1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSCachedURLResponse1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSURLCacheStoragePolicy { + static const int NSURLCacheStorageAllowed = 0; + static const int NSURLCacheStorageAllowedInMemoryOnly = 1; + static const int NSURLCacheStorageNotAllowed = 2; +} + +class NSURLSessionDataTask extends NSURLSessionTask { + NSURLSessionDataTask._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionDataTask] that points to the same underlying object as [other]. + static NSURLSessionDataTask castFrom(T other) { + return NSURLSessionDataTask._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionDataTask] that wraps the given raw object pointer. + static NSURLSessionDataTask castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionDataTask._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionDataTask]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionDataTask1); + } + + @override + NSURLSessionDataTask init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionDataTask new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLSessionDataTask1, _lib._sel_new1); + return NSURLSessionDataTask._(_ret, _lib, retain: false, release: true); + } + + static NSURLSessionDataTask alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionDataTask1, _lib._sel_alloc1); + return NSURLSessionDataTask._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLSessionDataTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLSessionDataTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionDataTask1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSessionDataTask1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionDataTask1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionDataTask1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLSessionDataTask1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLSessionDataTask1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionDataTask1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock33_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock33_closureRegistry = {}; +int _ObjCBlock33_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock33_registerClosure(Function fn) { + final id = ++_ObjCBlock33_closureRegistryIndex; + _ObjCBlock33_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock33_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return _ObjCBlock33_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock33 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock33._(this._impl, this._lib); + ObjCBlock33.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock33_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock33.fromFunction( + this._lib, void Function(ffi.Pointer arg0) fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock33_closureTrampoline) + .cast(), + _ObjCBlock33_registerClosure(fn)); + void call(ffi.Pointer arg0) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_impl, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class NSURLConnection extends NSObject { + NSURLConnection._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLConnection] that points to the same underlying object as [other]. + static NSURLConnection castFrom(T other) { + return NSURLConnection._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLConnection] that wraps the given raw object pointer. + static NSURLConnection castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLConnection._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLConnection]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLConnection1); + } + + NSURLConnection initWithRequest_delegate_startImmediately_( + NSURLRequest? request, NSObject delegate, bool startImmediately) { + final _ret = _lib._objc_msgSend_857( + _id, + _lib._sel_initWithRequest_delegate_startImmediately_1, + request?._id ?? ffi.nullptr, + delegate._id, + startImmediately); + return NSURLConnection._(_ret, _lib, retain: true, release: true); + } + + NSURLConnection initWithRequest_delegate_( + NSURLRequest? request, NSObject delegate) { + final _ret = _lib._objc_msgSend_858( + _id, + _lib._sel_initWithRequest_delegate_1, + request?._id ?? ffi.nullptr, + delegate._id); + return NSURLConnection._(_ret, _lib, retain: true, release: true); + } + + static NSURLConnection connectionWithRequest_delegate_( + AVFAudio _lib, NSURLRequest? request, NSObject delegate) { + final _ret = _lib._objc_msgSend_859( + _lib._class_NSURLConnection1, + _lib._sel_connectionWithRequest_delegate_1, + request?._id ?? ffi.nullptr, + delegate._id); + return NSURLConnection._(_ret, _lib, retain: true, release: true); + } + + NSURLRequest? get originalRequest { + final _ret = _lib._objc_msgSend_761(_id, _lib._sel_originalRequest1); + return _ret.address == 0 + ? null + : NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + NSURLRequest? get currentRequest { + final _ret = _lib._objc_msgSend_761(_id, _lib._sel_currentRequest1); + return _ret.address == 0 + ? null + : NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + void start() { + return _lib._objc_msgSend_1(_id, _lib._sel_start1); + } + + void cancel() { + return _lib._objc_msgSend_1(_id, _lib._sel_cancel1); + } + + void scheduleInRunLoop_forMode_(NSRunLoop? aRunLoop, NSRunLoopMode mode) { + return _lib._objc_msgSend_501(_id, _lib._sel_scheduleInRunLoop_forMode_1, + aRunLoop?._id ?? ffi.nullptr, mode); + } + + void unscheduleFromRunLoop_forMode_(NSRunLoop? aRunLoop, NSRunLoopMode mode) { + return _lib._objc_msgSend_501( + _id, + _lib._sel_unscheduleFromRunLoop_forMode_1, + aRunLoop?._id ?? ffi.nullptr, + mode); + } + + void setDelegateQueue_(NSOperationQueue? queue) { + return _lib._objc_msgSend_860( + _id, _lib._sel_setDelegateQueue_1, queue?._id ?? ffi.nullptr); + } + + static bool canHandleRequest_(AVFAudio _lib, NSURLRequest? request) { + return _lib._objc_msgSend_861(_lib._class_NSURLConnection1, + _lib._sel_canHandleRequest_1, request?._id ?? ffi.nullptr); + } + + static NSData sendSynchronousRequest_returningResponse_error_( + AVFAudio _lib, + NSURLRequest? request, + ffi.Pointer> response, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_862( + _lib._class_NSURLConnection1, + _lib._sel_sendSynchronousRequest_returningResponse_error_1, + request?._id ?? ffi.nullptr, + response, + error); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static void sendAsynchronousRequest_queue_completionHandler_(AVFAudio _lib, + NSURLRequest? request, NSOperationQueue? queue, ObjCBlock34 handler) { + return _lib._objc_msgSend_863( + _lib._class_NSURLConnection1, + _lib._sel_sendAsynchronousRequest_queue_completionHandler_1, + request?._id ?? ffi.nullptr, + queue?._id ?? ffi.nullptr, + handler._impl); + } + + static NSURLConnection new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLConnection1, _lib._sel_new1); + return NSURLConnection._(_ret, _lib, retain: false, release: true); + } + + static NSURLConnection alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLConnection1, _lib._sel_alloc1); + return NSURLConnection._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLConnection1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLConnection1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLConnection1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLConnection1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLConnection1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLConnection1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLConnection1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLConnection1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLConnection1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock34_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock34_closureRegistry = {}; +int _ObjCBlock34_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock34_registerClosure(Function fn) { + final id = ++_ObjCBlock34_closureRegistryIndex; + _ObjCBlock34_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock34_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return _ObjCBlock34_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock34 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock34._(this._impl, this._lib); + ObjCBlock34.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock34_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock34.fromFunction( + this._lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock34_closureTrampoline) + .cast(), + _ObjCBlock34_registerClosure(fn)); + void call(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class NSURLCredential extends NSObject { + NSURLCredential._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLCredential] that points to the same underlying object as [other]. + static NSURLCredential castFrom(T other) { + return NSURLCredential._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLCredential] that wraps the given raw object pointer. + static NSURLCredential castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLCredential._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLCredential]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLCredential1); + } + + int get persistence { + return _lib._objc_msgSend_864(_id, _lib._sel_persistence1); + } + + NSURLCredential initWithUser_password_persistence_( + NSString? user, NSString? password, int persistence) { + final _ret = _lib._objc_msgSend_865( + _id, + _lib._sel_initWithUser_password_persistence_1, + user?._id ?? ffi.nullptr, + password?._id ?? ffi.nullptr, + persistence); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + static NSURLCredential credentialWithUser_password_persistence_( + AVFAudio _lib, NSString? user, NSString? password, int persistence) { + final _ret = _lib._objc_msgSend_866( + _lib._class_NSURLCredential1, + _lib._sel_credentialWithUser_password_persistence_1, + user?._id ?? ffi.nullptr, + password?._id ?? ffi.nullptr, + persistence); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + NSString? get user { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_user1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get password { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_password1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool get hasPassword { + return _lib._objc_msgSend_12(_id, _lib._sel_hasPassword1); + } + + NSURLCredential initWithIdentity_certificates_persistence_( + SecIdentityRef identity, NSArray? certArray, int persistence) { + final _ret = _lib._objc_msgSend_867( + _id, + _lib._sel_initWithIdentity_certificates_persistence_1, + identity, + certArray?._id ?? ffi.nullptr, + persistence); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + static NSURLCredential credentialWithIdentity_certificates_persistence_( + AVFAudio _lib, + SecIdentityRef identity, + NSArray? certArray, + int persistence) { + final _ret = _lib._objc_msgSend_868( + _lib._class_NSURLCredential1, + _lib._sel_credentialWithIdentity_certificates_persistence_1, + identity, + certArray?._id ?? ffi.nullptr, + persistence); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + SecIdentityRef get identity { + return _lib._objc_msgSend_869(_id, _lib._sel_identity1); + } + + NSArray? get certificates { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_certificates1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSURLCredential initWithTrust_(SecTrustRef trust) { + final _ret = _lib._objc_msgSend_870(_id, _lib._sel_initWithTrust_1, trust); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + static NSURLCredential credentialForTrust_(AVFAudio _lib, SecTrustRef trust) { + final _ret = _lib._objc_msgSend_871( + _lib._class_NSURLCredential1, _lib._sel_credentialForTrust_1, trust); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + static NSURLCredential new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLCredential1, _lib._sel_new1); + return NSURLCredential._(_ret, _lib, retain: false, release: true); + } + + static NSURLCredential alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLCredential1, _lib._sel_alloc1); + return NSURLCredential._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLCredential1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLCredential1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLCredential1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLCredential1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLCredential1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLCredential1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLCredential1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLCredential1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLCredential1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSURLCredentialPersistence { + static const int NSURLCredentialPersistenceNone = 0; + static const int NSURLCredentialPersistenceForSession = 1; + static const int NSURLCredentialPersistencePermanent = 2; + static const int NSURLCredentialPersistenceSynchronizable = 3; +} + +typedef SecIdentityRef = ffi.Pointer<__SecIdentity>; + +class __SecIdentity extends ffi.Opaque {} + +typedef SecTrustRef = ffi.Pointer<__SecTrust>; + +class __SecTrust extends ffi.Opaque {} + +class NSURLProtectionSpace extends NSObject { + NSURLProtectionSpace._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLProtectionSpace] that points to the same underlying object as [other]. + static NSURLProtectionSpace castFrom(T other) { + return NSURLProtectionSpace._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLProtectionSpace] that wraps the given raw object pointer. + static NSURLProtectionSpace castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLProtectionSpace._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLProtectionSpace]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLProtectionSpace1); + } + + NSURLProtectionSpace initWithHost_port_protocol_realm_authenticationMethod_( + NSString? host, + int port, + NSString? protocol, + NSString? realm, + NSString? authenticationMethod) { + final _ret = _lib._objc_msgSend_872( + _id, + _lib._sel_initWithHost_port_protocol_realm_authenticationMethod_1, + host?._id ?? ffi.nullptr, + port, + protocol?._id ?? ffi.nullptr, + realm?._id ?? ffi.nullptr, + authenticationMethod?._id ?? ffi.nullptr); + return NSURLProtectionSpace._(_ret, _lib, retain: true, release: true); + } + + NSURLProtectionSpace initWithProxyHost_port_type_realm_authenticationMethod_( + NSString? host, + int port, + NSString? type, + NSString? realm, + NSString? authenticationMethod) { + final _ret = _lib._objc_msgSend_872( + _id, + _lib._sel_initWithProxyHost_port_type_realm_authenticationMethod_1, + host?._id ?? ffi.nullptr, + port, + type?._id ?? ffi.nullptr, + realm?._id ?? ffi.nullptr, + authenticationMethod?._id ?? ffi.nullptr); + return NSURLProtectionSpace._(_ret, _lib, retain: true, release: true); + } + + NSString? get realm { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_realm1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool get receivesCredentialSecurely { + return _lib._objc_msgSend_12(_id, _lib._sel_receivesCredentialSecurely1); + } + + bool get isProxy { + return _lib._objc_msgSend_12(_id, _lib._sel_isProxy1); + } + + NSString? get host { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_host1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get port { + return _lib._objc_msgSend_78(_id, _lib._sel_port1); + } + + NSString? get proxyType { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_proxyType1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get protocol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_protocol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get authenticationMethod { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_authenticationMethod1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get distinguishedNames { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_distinguishedNames1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + SecTrustRef get serverTrust { + return _lib._objc_msgSend_873(_id, _lib._sel_serverTrust1); + } + + static NSURLProtectionSpace new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLProtectionSpace1, _lib._sel_new1); + return NSURLProtectionSpace._(_ret, _lib, retain: false, release: true); + } + + static NSURLProtectionSpace alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLProtectionSpace1, _lib._sel_alloc1); + return NSURLProtectionSpace._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLProtectionSpace1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLProtectionSpace1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLProtectionSpace1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLProtectionSpace1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLProtectionSpace1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLProtectionSpace1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLProtectionSpace1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLProtectionSpace1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLProtectionSpace1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSURLCredentialStorage extends NSObject { + NSURLCredentialStorage._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLCredentialStorage] that points to the same underlying object as [other]. + static NSURLCredentialStorage castFrom(T other) { + return NSURLCredentialStorage._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLCredentialStorage] that wraps the given raw object pointer. + static NSURLCredentialStorage castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLCredentialStorage._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLCredentialStorage]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLCredentialStorage1); + } + + static NSURLCredentialStorage? getSharedCredentialStorage(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_874(_lib._class_NSURLCredentialStorage1, + _lib._sel_sharedCredentialStorage1); + return _ret.address == 0 + ? null + : NSURLCredentialStorage._(_ret, _lib, retain: true, release: true); + } + + NSDictionary credentialsForProtectionSpace_(NSURLProtectionSpace? space) { + final _ret = _lib._objc_msgSend_875(_id, + _lib._sel_credentialsForProtectionSpace_1, space?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get allCredentials { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_allCredentials1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + void setCredential_forProtectionSpace_( + NSURLCredential? credential, NSURLProtectionSpace? space) { + return _lib._objc_msgSend_876( + _id, + _lib._sel_setCredential_forProtectionSpace_1, + credential?._id ?? ffi.nullptr, + space?._id ?? ffi.nullptr); + } + + void removeCredential_forProtectionSpace_( + NSURLCredential? credential, NSURLProtectionSpace? space) { + return _lib._objc_msgSend_876( + _id, + _lib._sel_removeCredential_forProtectionSpace_1, + credential?._id ?? ffi.nullptr, + space?._id ?? ffi.nullptr); + } + + void removeCredential_forProtectionSpace_options_(NSURLCredential? credential, + NSURLProtectionSpace? space, NSDictionary? options) { + return _lib._objc_msgSend_877( + _id, + _lib._sel_removeCredential_forProtectionSpace_options_1, + credential?._id ?? ffi.nullptr, + space?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr); + } + + NSURLCredential defaultCredentialForProtectionSpace_( + NSURLProtectionSpace? space) { + final _ret = _lib._objc_msgSend_878( + _id, + _lib._sel_defaultCredentialForProtectionSpace_1, + space?._id ?? ffi.nullptr); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + void setDefaultCredential_forProtectionSpace_( + NSURLCredential? credential, NSURLProtectionSpace? space) { + return _lib._objc_msgSend_876( + _id, + _lib._sel_setDefaultCredential_forProtectionSpace_1, + credential?._id ?? ffi.nullptr, + space?._id ?? ffi.nullptr); + } + + void getCredentialsForProtectionSpace_task_completionHandler_( + NSURLProtectionSpace? protectionSpace, + NSURLSessionTask? task, + ObjCBlock35 completionHandler) { + return _lib._objc_msgSend_879( + _id, + _lib._sel_getCredentialsForProtectionSpace_task_completionHandler_1, + protectionSpace?._id ?? ffi.nullptr, + task?._id ?? ffi.nullptr, + completionHandler._impl); + } + + void setCredential_forProtectionSpace_task_(NSURLCredential? credential, + NSURLProtectionSpace? protectionSpace, NSURLSessionTask? task) { + return _lib._objc_msgSend_880( + _id, + _lib._sel_setCredential_forProtectionSpace_task_1, + credential?._id ?? ffi.nullptr, + protectionSpace?._id ?? ffi.nullptr, + task?._id ?? ffi.nullptr); + } + + void removeCredential_forProtectionSpace_options_task_( + NSURLCredential? credential, + NSURLProtectionSpace? protectionSpace, + NSDictionary? options, + NSURLSessionTask? task) { + return _lib._objc_msgSend_881( + _id, + _lib._sel_removeCredential_forProtectionSpace_options_task_1, + credential?._id ?? ffi.nullptr, + protectionSpace?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr, + task?._id ?? ffi.nullptr); + } + + void getDefaultCredentialForProtectionSpace_task_completionHandler_( + NSURLProtectionSpace? space, + NSURLSessionTask? task, + ObjCBlock36 completionHandler) { + return _lib._objc_msgSend_882( + _id, + _lib._sel_getDefaultCredentialForProtectionSpace_task_completionHandler_1, + space?._id ?? ffi.nullptr, + task?._id ?? ffi.nullptr, + completionHandler._impl); + } + + void setDefaultCredential_forProtectionSpace_task_( + NSURLCredential? credential, + NSURLProtectionSpace? protectionSpace, + NSURLSessionTask? task) { + return _lib._objc_msgSend_880( + _id, + _lib._sel_setDefaultCredential_forProtectionSpace_task_1, + credential?._id ?? ffi.nullptr, + protectionSpace?._id ?? ffi.nullptr, + task?._id ?? ffi.nullptr); + } + + static NSURLCredentialStorage new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLCredentialStorage1, _lib._sel_new1); + return NSURLCredentialStorage._(_ret, _lib, retain: false, release: true); + } + + static NSURLCredentialStorage alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLCredentialStorage1, _lib._sel_alloc1); + return NSURLCredentialStorage._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLCredentialStorage1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLCredentialStorage1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLCredentialStorage1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLCredentialStorage1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLCredentialStorage1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLCredentialStorage1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLCredentialStorage1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLCredentialStorage1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLCredentialStorage1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock35_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock35_closureRegistry = {}; +int _ObjCBlock35_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock35_registerClosure(Function fn) { + final id = ++_ObjCBlock35_closureRegistryIndex; + _ObjCBlock35_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock35_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return _ObjCBlock35_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock35 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock35._(this._impl, this._lib); + ObjCBlock35.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock35_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock35.fromFunction( + this._lib, void Function(ffi.Pointer arg0) fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock35_closureTrampoline) + .cast(), + _ObjCBlock35_registerClosure(fn)); + void call(ffi.Pointer arg0) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_impl, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +void _ObjCBlock36_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock36_closureRegistry = {}; +int _ObjCBlock36_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock36_registerClosure(Function fn) { + final id = ++_ObjCBlock36_closureRegistryIndex; + _ObjCBlock36_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock36_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return _ObjCBlock36_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock36 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock36._(this._impl, this._lib); + ObjCBlock36.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock36_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock36.fromFunction( + this._lib, void Function(ffi.Pointer arg0) fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock36_closureTrampoline) + .cast(), + _ObjCBlock36_registerClosure(fn)); + void call(ffi.Pointer arg0) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_impl, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class NSURLProtocol extends NSObject { + NSURLProtocol._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLProtocol] that points to the same underlying object as [other]. + static NSURLProtocol castFrom(T other) { + return NSURLProtocol._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSURLProtocol] that wraps the given raw object pointer. + static NSURLProtocol castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLProtocol._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLProtocol]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLProtocol1); + } + + NSURLProtocol initWithRequest_cachedResponse_client_(NSURLRequest? request, + NSCachedURLResponse? cachedResponse, NSObject? client) { + final _ret = _lib._objc_msgSend_883( + _id, + _lib._sel_initWithRequest_cachedResponse_client_1, + request?._id ?? ffi.nullptr, + cachedResponse?._id ?? ffi.nullptr, + client?._id ?? ffi.nullptr); + return NSURLProtocol._(_ret, _lib, retain: true, release: true); + } + + NSObject? get client { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_client1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + NSURLRequest? get request { + final _ret = _lib._objc_msgSend_761(_id, _lib._sel_request1); + return _ret.address == 0 + ? null + : NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + NSCachedURLResponse? get cachedResponse { + final _ret = _lib._objc_msgSend_884(_id, _lib._sel_cachedResponse1); + return _ret.address == 0 + ? null + : NSCachedURLResponse._(_ret, _lib, retain: true, release: true); + } + + static bool canInitWithRequest_(AVFAudio _lib, NSURLRequest? request) { + return _lib._objc_msgSend_861(_lib._class_NSURLProtocol1, + _lib._sel_canInitWithRequest_1, request?._id ?? ffi.nullptr); + } + + static NSURLRequest canonicalRequestForRequest_( + AVFAudio _lib, NSURLRequest? request) { + final _ret = _lib._objc_msgSend_885(_lib._class_NSURLProtocol1, + _lib._sel_canonicalRequestForRequest_1, request?._id ?? ffi.nullptr); + return NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + static bool requestIsCacheEquivalent_toRequest_( + AVFAudio _lib, NSURLRequest? a, NSURLRequest? b) { + return _lib._objc_msgSend_886( + _lib._class_NSURLProtocol1, + _lib._sel_requestIsCacheEquivalent_toRequest_1, + a?._id ?? ffi.nullptr, + b?._id ?? ffi.nullptr); + } + + void startLoading() { + return _lib._objc_msgSend_1(_id, _lib._sel_startLoading1); + } + + void stopLoading() { + return _lib._objc_msgSend_1(_id, _lib._sel_stopLoading1); + } + + static NSObject propertyForKey_inRequest_( + AVFAudio _lib, NSString? key, NSURLRequest? request) { + final _ret = _lib._objc_msgSend_887( + _lib._class_NSURLProtocol1, + _lib._sel_propertyForKey_inRequest_1, + key?._id ?? ffi.nullptr, + request?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static void setProperty_forKey_inRequest_(AVFAudio _lib, NSObject value, + NSString? key, NSMutableURLRequest? request) { + return _lib._objc_msgSend_894( + _lib._class_NSURLProtocol1, + _lib._sel_setProperty_forKey_inRequest_1, + value._id, + key?._id ?? ffi.nullptr, + request?._id ?? ffi.nullptr); + } + + static void removePropertyForKey_inRequest_( + AVFAudio _lib, NSString? key, NSMutableURLRequest? request) { + return _lib._objc_msgSend_895( + _lib._class_NSURLProtocol1, + _lib._sel_removePropertyForKey_inRequest_1, + key?._id ?? ffi.nullptr, + request?._id ?? ffi.nullptr); + } + + static bool registerClass_(AVFAudio _lib, NSObject protocolClass) { + return _lib._objc_msgSend_0(_lib._class_NSURLProtocol1, + _lib._sel_registerClass_1, protocolClass._id); + } + + static void unregisterClass_(AVFAudio _lib, NSObject protocolClass) { + return _lib._objc_msgSend_15(_lib._class_NSURLProtocol1, + _lib._sel_unregisterClass_1, protocolClass._id); + } + + static bool canInitWithTask_(AVFAudio _lib, NSURLSessionTask? task) { + return _lib._objc_msgSend_896(_lib._class_NSURLProtocol1, + _lib._sel_canInitWithTask_1, task?._id ?? ffi.nullptr); + } + + NSURLProtocol initWithTask_cachedResponse_client_(NSURLSessionTask? task, + NSCachedURLResponse? cachedResponse, NSObject? client) { + final _ret = _lib._objc_msgSend_897( + _id, + _lib._sel_initWithTask_cachedResponse_client_1, + task?._id ?? ffi.nullptr, + cachedResponse?._id ?? ffi.nullptr, + client?._id ?? ffi.nullptr); + return NSURLProtocol._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionTask? get task { + final _ret = _lib._objc_msgSend_898(_id, _lib._sel_task1); + return _ret.address == 0 + ? null + : NSURLSessionTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLProtocol new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLProtocol1, _lib._sel_new1); + return NSURLProtocol._(_ret, _lib, retain: false, release: true); + } + + static NSURLProtocol alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLProtocol1, _lib._sel_alloc1); + return NSURLProtocol._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLProtocol1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLProtocol1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLProtocol1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLProtocol1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLProtocol1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLProtocol1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLProtocol1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSURLProtocol1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLProtocol1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSMutableURLRequest extends NSURLRequest { + NSMutableURLRequest._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableURLRequest] that points to the same underlying object as [other]. + static NSMutableURLRequest castFrom(T other) { + return NSMutableURLRequest._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSMutableURLRequest] that wraps the given raw object pointer. + static NSMutableURLRequest castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableURLRequest._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableURLRequest]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMutableURLRequest1); + } + + @override + NSURL? get URL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_URL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + set URL(NSURL? value) { + _lib._objc_msgSend_888(_id, _lib._sel_setURL_1, value?._id ?? ffi.nullptr); + } + + @override + int get cachePolicy { + return _lib._objc_msgSend_748(_id, _lib._sel_cachePolicy1); + } + + set cachePolicy(int value) { + _lib._objc_msgSend_889(_id, _lib._sel_setCachePolicy_1, value); + } + + @override + double get timeoutInterval { + return _lib._objc_msgSend_149(_id, _lib._sel_timeoutInterval1); + } + + set timeoutInterval(double value) { + _lib._objc_msgSend_474(_id, _lib._sel_setTimeoutInterval_1, value); + } + + @override + NSURL? get mainDocumentURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_mainDocumentURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + set mainDocumentURL(NSURL? value) { + _lib._objc_msgSend_888( + _id, _lib._sel_setMainDocumentURL_1, value?._id ?? ffi.nullptr); + } + + @override + int get networkServiceType { + return _lib._objc_msgSend_749(_id, _lib._sel_networkServiceType1); + } + + set networkServiceType(int value) { + _lib._objc_msgSend_890(_id, _lib._sel_setNetworkServiceType_1, value); + } + + @override + bool get allowsCellularAccess { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsCellularAccess1); + } + + set allowsCellularAccess(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setAllowsCellularAccess_1, value); + } + + @override + bool get allowsExpensiveNetworkAccess { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsExpensiveNetworkAccess1); + } + + set allowsExpensiveNetworkAccess(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setAllowsExpensiveNetworkAccess_1, value); + } + + @override + bool get allowsConstrainedNetworkAccess { + return _lib._objc_msgSend_12( + _id, _lib._sel_allowsConstrainedNetworkAccess1); + } + + set allowsConstrainedNetworkAccess(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setAllowsConstrainedNetworkAccess_1, value); + } + + @override + bool get assumesHTTP3Capable { + return _lib._objc_msgSend_12(_id, _lib._sel_assumesHTTP3Capable1); + } + + set assumesHTTP3Capable(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setAssumesHTTP3Capable_1, value); + } + + @override + int get attribution { + return _lib._objc_msgSend_750(_id, _lib._sel_attribution1); + } + + set attribution(int value) { + _lib._objc_msgSend_891(_id, _lib._sel_setAttribution_1, value); + } + + @override + NSString? get HTTPMethod { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_HTTPMethod1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set HTTPMethod(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setHTTPMethod_1, value?._id ?? ffi.nullptr); + } + + @override + NSDictionary? get allHTTPHeaderFields { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_allHTTPHeaderFields1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set allHTTPHeaderFields(NSDictionary? value) { + _lib._objc_msgSend_165( + _id, _lib._sel_setAllHTTPHeaderFields_1, value?._id ?? ffi.nullptr); + } + + void setValue_forHTTPHeaderField_(NSString? value, NSString? field) { + return _lib._objc_msgSend_483(_id, _lib._sel_setValue_forHTTPHeaderField_1, + value?._id ?? ffi.nullptr, field?._id ?? ffi.nullptr); + } + + void addValue_forHTTPHeaderField_(NSString? value, NSString? field) { + return _lib._objc_msgSend_483(_id, _lib._sel_addValue_forHTTPHeaderField_1, + value?._id ?? ffi.nullptr, field?._id ?? ffi.nullptr); + } + + @override + NSData? get HTTPBody { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_HTTPBody1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + set HTTPBody(NSData? value) { + _lib._objc_msgSend_892( + _id, _lib._sel_setHTTPBody_1, value?._id ?? ffi.nullptr); + } + + @override + NSInputStream? get HTTPBodyStream { + final _ret = _lib._objc_msgSend_760(_id, _lib._sel_HTTPBodyStream1); + return _ret.address == 0 + ? null + : NSInputStream._(_ret, _lib, retain: true, release: true); + } + + set HTTPBodyStream(NSInputStream? value) { + _lib._objc_msgSend_893( + _id, _lib._sel_setHTTPBodyStream_1, value?._id ?? ffi.nullptr); + } + + @override + bool get HTTPShouldHandleCookies { + return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldHandleCookies1); + } + + set HTTPShouldHandleCookies(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setHTTPShouldHandleCookies_1, value); + } + + @override + bool get HTTPShouldUsePipelining { + return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldUsePipelining1); + } + + set HTTPShouldUsePipelining(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setHTTPShouldUsePipelining_1, value); + } + + static NSMutableURLRequest requestWithURL_(AVFAudio _lib, NSURL? URL) { + final _ret = _lib._objc_msgSend_226(_lib._class_NSMutableURLRequest1, + _lib._sel_requestWithURL_1, URL?._id ?? ffi.nullptr); + return NSMutableURLRequest._(_ret, _lib, retain: true, release: true); + } + + static bool getSupportsSecureCoding(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableURLRequest1, _lib._sel_supportsSecureCoding1); + } + + static NSMutableURLRequest requestWithURL_cachePolicy_timeoutInterval_( + AVFAudio _lib, NSURL? URL, int cachePolicy, double timeoutInterval) { + final _ret = _lib._objc_msgSend_747( + _lib._class_NSMutableURLRequest1, + _lib._sel_requestWithURL_cachePolicy_timeoutInterval_1, + URL?._id ?? ffi.nullptr, + cachePolicy, + timeoutInterval); + return NSMutableURLRequest._(_ret, _lib, retain: true, release: true); + } + + static NSMutableURLRequest new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableURLRequest1, _lib._sel_new1); + return NSMutableURLRequest._(_ret, _lib, retain: false, release: true); + } + + static NSMutableURLRequest alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableURLRequest1, _lib._sel_alloc1); + return NSMutableURLRequest._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMutableURLRequest1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMutableURLRequest1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMutableURLRequest1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableURLRequest1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableURLRequest1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableURLRequest1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMutableURLRequest1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSMutableURLRequest1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableURLRequest1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSXMLParser extends NSObject { + NSXMLParser._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSXMLParser] that points to the same underlying object as [other]. + static NSXMLParser castFrom(T other) { + return NSXMLParser._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSXMLParser] that wraps the given raw object pointer. + static NSXMLParser castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSXMLParser._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSXMLParser]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLParser1); + } + + NSXMLParser initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_226( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSXMLParser._(_ret, _lib, retain: true, release: true); + } + + NSXMLParser initWithData_(NSData? data) { + final _ret = _lib._objc_msgSend_242( + _id, _lib._sel_initWithData_1, data?._id ?? ffi.nullptr); + return NSXMLParser._(_ret, _lib, retain: true, release: true); + } + + NSXMLParser initWithStream_(NSInputStream? stream) { + final _ret = _lib._objc_msgSend_899( + _id, _lib._sel_initWithStream_1, stream?._id ?? ffi.nullptr); + return NSXMLParser._(_ret, _lib, retain: true, release: true); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + _lib._objc_msgSend_368( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + bool get shouldProcessNamespaces { + return _lib._objc_msgSend_12(_id, _lib._sel_shouldProcessNamespaces1); + } + + set shouldProcessNamespaces(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setShouldProcessNamespaces_1, value); + } + + bool get shouldReportNamespacePrefixes { + return _lib._objc_msgSend_12(_id, _lib._sel_shouldReportNamespacePrefixes1); + } + + set shouldReportNamespacePrefixes(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setShouldReportNamespacePrefixes_1, value); + } + + int get externalEntityResolvingPolicy { + return _lib._objc_msgSend_900( + _id, _lib._sel_externalEntityResolvingPolicy1); + } + + set externalEntityResolvingPolicy(int value) { + _lib._objc_msgSend_901( + _id, _lib._sel_setExternalEntityResolvingPolicy_1, value); + } + + NSSet? get allowedExternalEntityURLs { + final _ret = + _lib._objc_msgSend_280(_id, _lib._sel_allowedExternalEntityURLs1); + return _ret.address == 0 + ? null + : NSSet._(_ret, _lib, retain: true, release: true); + } + + set allowedExternalEntityURLs(NSSet? value) { + _lib._objc_msgSend_902(_id, _lib._sel_setAllowedExternalEntityURLs_1, + value?._id ?? ffi.nullptr); + } + + bool parse() { + return _lib._objc_msgSend_12(_id, _lib._sel_parse1); + } + + void abortParsing() { + return _lib._objc_msgSend_1(_id, _lib._sel_abortParsing1); + } + + NSError? get parserError { + final _ret = _lib._objc_msgSend_283(_id, _lib._sel_parserError1); + return _ret.address == 0 + ? null + : NSError._(_ret, _lib, retain: true, release: true); + } + + bool get shouldResolveExternalEntities { + return _lib._objc_msgSend_12(_id, _lib._sel_shouldResolveExternalEntities1); + } + + set shouldResolveExternalEntities(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setShouldResolveExternalEntities_1, value); + } + + NSString? get publicID { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_publicID1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get systemID { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_systemID1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get lineNumber { + return _lib._objc_msgSend_78(_id, _lib._sel_lineNumber1); + } + + int get columnNumber { + return _lib._objc_msgSend_78(_id, _lib._sel_columnNumber1); + } + + static NSXMLParser new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSXMLParser1, _lib._sel_new1); + return NSXMLParser._(_ret, _lib, retain: false, release: true); + } + + static NSXMLParser alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLParser1, _lib._sel_alloc1); + return NSXMLParser._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSXMLParser1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSXMLParser1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLParser1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLParser1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSXMLParser1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSXMLParser1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSXMLParser1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSXMLParser1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSXMLParser1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSXMLParserExternalEntityResolvingPolicy { + static const int NSXMLParserResolveExternalEntitiesNever = 0; + static const int NSXMLParserResolveExternalEntitiesNoNetwork = 1; + static const int NSXMLParserResolveExternalEntitiesSameOriginOnly = 2; + static const int NSXMLParserResolveExternalEntitiesAlways = 3; +} + +class NSFileWrapper extends NSObject { + NSFileWrapper._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSFileWrapper] that points to the same underlying object as [other]. + static NSFileWrapper castFrom(T other) { + return NSFileWrapper._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSFileWrapper] that wraps the given raw object pointer. + static NSFileWrapper castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSFileWrapper._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSFileWrapper]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSFileWrapper1); + } + + NSFileWrapper initWithURL_options_error_( + NSURL? url, int options, ffi.Pointer> outError) { + final _ret = _lib._objc_msgSend_903( + _id, + _lib._sel_initWithURL_options_error_1, + url?._id ?? ffi.nullptr, + options, + outError); + return NSFileWrapper._(_ret, _lib, retain: true, release: true); + } + + NSFileWrapper initDirectoryWithFileWrappers_( + NSDictionary? childrenByPreferredName) { + final _ret = _lib._objc_msgSend_143( + _id, + _lib._sel_initDirectoryWithFileWrappers_1, + childrenByPreferredName?._id ?? ffi.nullptr); + return NSFileWrapper._(_ret, _lib, retain: true, release: true); + } + + NSFileWrapper initRegularFileWithContents_(NSData? contents) { + final _ret = _lib._objc_msgSend_242(_id, + _lib._sel_initRegularFileWithContents_1, contents?._id ?? ffi.nullptr); + return NSFileWrapper._(_ret, _lib, retain: true, release: true); + } + + NSFileWrapper initSymbolicLinkWithDestinationURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_226( + _id, + _lib._sel_initSymbolicLinkWithDestinationURL_1, + url?._id ?? ffi.nullptr); + return NSFileWrapper._(_ret, _lib, retain: true, release: true); + } + + NSFileWrapper initWithSerializedRepresentation_( + NSData? serializeRepresentation) { + final _ret = _lib._objc_msgSend_242( + _id, + _lib._sel_initWithSerializedRepresentation_1, + serializeRepresentation?._id ?? ffi.nullptr); + return NSFileWrapper._(_ret, _lib, retain: true, release: true); + } + + NSFileWrapper initWithCoder_(NSCoder? inCoder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, inCoder?._id ?? ffi.nullptr); + return NSFileWrapper._(_ret, _lib, retain: true, release: true); + } + + bool get directory { + return _lib._objc_msgSend_12(_id, _lib._sel_isDirectory1); + } + + bool get regularFile { + return _lib._objc_msgSend_12(_id, _lib._sel_isRegularFile1); + } + + bool get symbolicLink { + return _lib._objc_msgSend_12(_id, _lib._sel_isSymbolicLink1); + } + + NSString? get preferredFilename { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_preferredFilename1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set preferredFilename(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPreferredFilename_1, value?._id ?? ffi.nullptr); + } + + NSString? get filename { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_filename1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set filename(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setFilename_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get fileAttributes { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_fileAttributes1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set fileAttributes(NSDictionary? value) { + _lib._objc_msgSend_165( + _id, _lib._sel_setFileAttributes_1, value?._id ?? ffi.nullptr); + } + + bool matchesContentsOfURL_(NSURL? url) { + return _lib._objc_msgSend_229( + _id, _lib._sel_matchesContentsOfURL_1, url?._id ?? ffi.nullptr); + } + + bool readFromURL_options_error_( + NSURL? url, int options, ffi.Pointer> outError) { + return _lib._objc_msgSend_904(_id, _lib._sel_readFromURL_options_error_1, + url?._id ?? ffi.nullptr, options, outError); + } + + bool writeToURL_options_originalContentsURL_error_( + NSURL? url, + int options, + NSURL? originalContentsURL, + ffi.Pointer> outError) { + return _lib._objc_msgSend_905( + _id, + _lib._sel_writeToURL_options_originalContentsURL_error_1, + url?._id ?? ffi.nullptr, + options, + originalContentsURL?._id ?? ffi.nullptr, + outError); + } + + NSData? get serializedRepresentation { + final _ret = + _lib._objc_msgSend_39(_id, _lib._sel_serializedRepresentation1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSString addFileWrapper_(NSFileWrapper? child) { + final _ret = _lib._objc_msgSend_906( + _id, _lib._sel_addFileWrapper_1, child?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString addRegularFileWithContents_preferredFilename_( + NSData? data, NSString? fileName) { + final _ret = _lib._objc_msgSend_907( + _id, + _lib._sel_addRegularFileWithContents_preferredFilename_1, + data?._id ?? ffi.nullptr, + fileName?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + void removeFileWrapper_(NSFileWrapper? child) { + return _lib._objc_msgSend_908( + _id, _lib._sel_removeFileWrapper_1, child?._id ?? ffi.nullptr); + } + + NSDictionary? get fileWrappers { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_fileWrappers1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSString keyForFileWrapper_(NSFileWrapper? child) { + final _ret = _lib._objc_msgSend_906( + _id, _lib._sel_keyForFileWrapper_1, child?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSData? get regularFileContents { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_regularFileContents1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSURL? get symbolicLinkDestinationURL { + final _ret = + _lib._objc_msgSend_40(_id, _lib._sel_symbolicLinkDestinationURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithPath_(NSString? path) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithPath_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initSymbolicLinkWithDestination_(NSString? path) { + final _ret = _lib._objc_msgSend_30(_id, + _lib._sel_initSymbolicLinkWithDestination_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool needsToBeUpdatedFromPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_needsToBeUpdatedFromPath_1, path?._id ?? ffi.nullptr); + } + + bool updateFromPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_updateFromPath_1, path?._id ?? ffi.nullptr); + } + + bool writeToFile_atomically_updateFilenames_( + NSString? path, bool atomicFlag, bool updateFilenamesFlag) { + return _lib._objc_msgSend_909( + _id, + _lib._sel_writeToFile_atomically_updateFilenames_1, + path?._id ?? ffi.nullptr, + atomicFlag, + updateFilenamesFlag); + } + + NSString addFileWithPath_(NSString? path) { + final _ret = _lib._objc_msgSend_64( + _id, _lib._sel_addFileWithPath_1, path?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString addSymbolicLinkWithDestination_preferredFilename_( + NSString? path, NSString? filename) { + final _ret = _lib._objc_msgSend_324( + _id, + _lib._sel_addSymbolicLinkWithDestination_preferredFilename_1, + path?._id ?? ffi.nullptr, + filename?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString symbolicLinkDestination() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_symbolicLinkDestination1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSFileWrapper new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSFileWrapper1, _lib._sel_new1); + return NSFileWrapper._(_ret, _lib, retain: false, release: true); + } + + static NSFileWrapper alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSFileWrapper1, _lib._sel_alloc1); + return NSFileWrapper._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSFileWrapper1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSFileWrapper1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFileWrapper1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFileWrapper1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSFileWrapper1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSFileWrapper1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSFileWrapper1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSFileWrapper1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSFileWrapper1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSFileWrapperReadingOptions { + static const int NSFileWrapperReadingImmediate = 1; + static const int NSFileWrapperReadingWithoutMapping = 2; +} + +abstract class NSFileWrapperWritingOptions { + static const int NSFileWrapperWritingAtomic = 1; + static const int NSFileWrapperWritingWithNameUpdating = 2; +} + +class NSURLSession extends NSObject { + NSURLSession._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSession] that points to the same underlying object as [other]. + static NSURLSession castFrom(T other) { + return NSURLSession._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSURLSession] that wraps the given raw object pointer. + static NSURLSession castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSession._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSession]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLSession1); + } + + static NSURLSession? getSharedSession(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_910( + _lib._class_NSURLSession1, _lib._sel_sharedSession1); + return _ret.address == 0 + ? null + : NSURLSession._(_ret, _lib, retain: true, release: true); + } + + static NSURLSession sessionWithConfiguration_( + AVFAudio _lib, NSURLSessionConfiguration? configuration) { + final _ret = _lib._objc_msgSend_921( + _lib._class_NSURLSession1, + _lib._sel_sessionWithConfiguration_1, + configuration?._id ?? ffi.nullptr); + return NSURLSession._(_ret, _lib, retain: true, release: true); + } + + static NSURLSession sessionWithConfiguration_delegate_delegateQueue_( + AVFAudio _lib, + NSURLSessionConfiguration? configuration, + NSObject? delegate, + NSOperationQueue? queue) { + final _ret = _lib._objc_msgSend_922( + _lib._class_NSURLSession1, + _lib._sel_sessionWithConfiguration_delegate_delegateQueue_1, + configuration?._id ?? ffi.nullptr, + delegate?._id ?? ffi.nullptr, + queue?._id ?? ffi.nullptr); + return NSURLSession._(_ret, _lib, retain: true, release: true); + } + + NSOperationQueue? get delegateQueue { + final _ret = _lib._objc_msgSend_790(_id, _lib._sel_delegateQueue1); + return _ret.address == 0 + ? null + : NSOperationQueue._(_ret, _lib, retain: true, release: true); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionConfiguration? get configuration { + final _ret = _lib._objc_msgSend_911(_id, _lib._sel_configuration1); + return _ret.address == 0 + ? null + : NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); + } + + NSString? get sessionDescription { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_sessionDescription1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set sessionDescription(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setSessionDescription_1, value?._id ?? ffi.nullptr); + } + + void finishTasksAndInvalidate() { + return _lib._objc_msgSend_1(_id, _lib._sel_finishTasksAndInvalidate1); + } + + void invalidateAndCancel() { + return _lib._objc_msgSend_1(_id, _lib._sel_invalidateAndCancel1); + } + + void resetWithCompletionHandler_(ObjCBlock16 completionHandler) { + return _lib._objc_msgSend_465( + _id, _lib._sel_resetWithCompletionHandler_1, completionHandler._impl); + } + + void flushWithCompletionHandler_(ObjCBlock16 completionHandler) { + return _lib._objc_msgSend_465( + _id, _lib._sel_flushWithCompletionHandler_1, completionHandler._impl); + } + + void getTasksWithCompletionHandler_(ObjCBlock37 completionHandler) { + return _lib._objc_msgSend_923(_id, + _lib._sel_getTasksWithCompletionHandler_1, completionHandler._impl); + } + + void getAllTasksWithCompletionHandler_(ObjCBlock30 completionHandler) { + return _lib._objc_msgSend_924(_id, + _lib._sel_getAllTasksWithCompletionHandler_1, completionHandler._impl); + } + + NSURLSessionDataTask dataTaskWithRequest_(NSURLRequest? request) { + final _ret = _lib._objc_msgSend_925( + _id, _lib._sel_dataTaskWithRequest_1, request?._id ?? ffi.nullptr); + return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDataTask dataTaskWithURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_926( + _id, _lib._sel_dataTaskWithURL_1, url?._id ?? ffi.nullptr); + return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionUploadTask uploadTaskWithRequest_fromFile_( + NSURLRequest? request, NSURL? fileURL) { + final _ret = _lib._objc_msgSend_927( + _id, + _lib._sel_uploadTaskWithRequest_fromFile_1, + request?._id ?? ffi.nullptr, + fileURL?._id ?? ffi.nullptr); + return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionUploadTask uploadTaskWithRequest_fromData_( + NSURLRequest? request, NSData? bodyData) { + final _ret = _lib._objc_msgSend_928( + _id, + _lib._sel_uploadTaskWithRequest_fromData_1, + request?._id ?? ffi.nullptr, + bodyData?._id ?? ffi.nullptr); + return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionUploadTask uploadTaskWithStreamedRequest_(NSURLRequest? request) { + final _ret = _lib._objc_msgSend_929(_id, + _lib._sel_uploadTaskWithStreamedRequest_1, request?._id ?? ffi.nullptr); + return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDownloadTask downloadTaskWithRequest_(NSURLRequest? request) { + final _ret = _lib._objc_msgSend_931( + _id, _lib._sel_downloadTaskWithRequest_1, request?._id ?? ffi.nullptr); + return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDownloadTask downloadTaskWithURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_932( + _id, _lib._sel_downloadTaskWithURL_1, url?._id ?? ffi.nullptr); + return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDownloadTask downloadTaskWithResumeData_(NSData? resumeData) { + final _ret = _lib._objc_msgSend_933(_id, + _lib._sel_downloadTaskWithResumeData_1, resumeData?._id ?? ffi.nullptr); + return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionStreamTask streamTaskWithHostName_port_( + NSString? hostname, int port) { + final _ret = _lib._objc_msgSend_936( + _id, + _lib._sel_streamTaskWithHostName_port_1, + hostname?._id ?? ffi.nullptr, + port); + return NSURLSessionStreamTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionStreamTask streamTaskWithNetService_(NSNetService? service) { + final _ret = _lib._objc_msgSend_942( + _id, _lib._sel_streamTaskWithNetService_1, service?._id ?? ffi.nullptr); + return NSURLSessionStreamTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionWebSocketTask webSocketTaskWithURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_949( + _id, _lib._sel_webSocketTaskWithURL_1, url?._id ?? ffi.nullptr); + return NSURLSessionWebSocketTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionWebSocketTask webSocketTaskWithURL_protocols_( + NSURL? url, NSArray? protocols) { + final _ret = _lib._objc_msgSend_950( + _id, + _lib._sel_webSocketTaskWithURL_protocols_1, + url?._id ?? ffi.nullptr, + protocols?._id ?? ffi.nullptr); + return NSURLSessionWebSocketTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionWebSocketTask webSocketTaskWithRequest_(NSURLRequest? request) { + final _ret = _lib._objc_msgSend_951( + _id, _lib._sel_webSocketTaskWithRequest_1, request?._id ?? ffi.nullptr); + return NSURLSessionWebSocketTask._(_ret, _lib, retain: true, release: true); + } + + @override + NSURLSession init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSession._(_ret, _lib, retain: true, release: true); + } + + static NSURLSession new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLSession1, _lib._sel_new1); + return NSURLSession._(_ret, _lib, retain: false, release: true); + } + + NSURLSessionDataTask dataTaskWithRequest_completionHandler_( + NSURLRequest? request, ObjCBlock41 completionHandler) { + final _ret = _lib._objc_msgSend_952( + _id, + _lib._sel_dataTaskWithRequest_completionHandler_1, + request?._id ?? ffi.nullptr, + completionHandler._impl); + return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDataTask dataTaskWithURL_completionHandler_( + NSURL? url, ObjCBlock41 completionHandler) { + final _ret = _lib._objc_msgSend_953( + _id, + _lib._sel_dataTaskWithURL_completionHandler_1, + url?._id ?? ffi.nullptr, + completionHandler._impl); + return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionUploadTask uploadTaskWithRequest_fromFile_completionHandler_( + NSURLRequest? request, NSURL? fileURL, ObjCBlock41 completionHandler) { + final _ret = _lib._objc_msgSend_954( + _id, + _lib._sel_uploadTaskWithRequest_fromFile_completionHandler_1, + request?._id ?? ffi.nullptr, + fileURL?._id ?? ffi.nullptr, + completionHandler._impl); + return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionUploadTask uploadTaskWithRequest_fromData_completionHandler_( + NSURLRequest? request, NSData? bodyData, ObjCBlock41 completionHandler) { + final _ret = _lib._objc_msgSend_955( + _id, + _lib._sel_uploadTaskWithRequest_fromData_completionHandler_1, + request?._id ?? ffi.nullptr, + bodyData?._id ?? ffi.nullptr, + completionHandler._impl); + return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDownloadTask downloadTaskWithRequest_completionHandler_( + NSURLRequest? request, ObjCBlock42 completionHandler) { + final _ret = _lib._objc_msgSend_956( + _id, + _lib._sel_downloadTaskWithRequest_completionHandler_1, + request?._id ?? ffi.nullptr, + completionHandler._impl); + return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDownloadTask downloadTaskWithURL_completionHandler_( + NSURL? url, ObjCBlock42 completionHandler) { + final _ret = _lib._objc_msgSend_957( + _id, + _lib._sel_downloadTaskWithURL_completionHandler_1, + url?._id ?? ffi.nullptr, + completionHandler._impl); + return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDownloadTask downloadTaskWithResumeData_completionHandler_( + NSData? resumeData, ObjCBlock42 completionHandler) { + final _ret = _lib._objc_msgSend_958( + _id, + _lib._sel_downloadTaskWithResumeData_completionHandler_1, + resumeData?._id ?? ffi.nullptr, + completionHandler._impl); + return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLSession alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLSession1, _lib._sel_alloc1); + return NSURLSession._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLSession1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLSession1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSession1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSession1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSession1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSession1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLSession1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSURLSession1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSession1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSURLSessionConfiguration extends NSObject { + NSURLSessionConfiguration._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionConfiguration] that points to the same underlying object as [other]. + static NSURLSessionConfiguration castFrom(T other) { + return NSURLSessionConfiguration._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionConfiguration] that wraps the given raw object pointer. + static NSURLSessionConfiguration castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionConfiguration._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionConfiguration]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionConfiguration1); + } + + static NSURLSessionConfiguration? getDefaultSessionConfiguration( + AVFAudio _lib) { + final _ret = _lib._objc_msgSend_911(_lib._class_NSURLSessionConfiguration1, + _lib._sel_defaultSessionConfiguration1); + return _ret.address == 0 + ? null + : NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionConfiguration? getEphemeralSessionConfiguration( + AVFAudio _lib) { + final _ret = _lib._objc_msgSend_911(_lib._class_NSURLSessionConfiguration1, + _lib._sel_ephemeralSessionConfiguration1); + return _ret.address == 0 + ? null + : NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionConfiguration + backgroundSessionConfigurationWithIdentifier_( + AVFAudio _lib, NSString? identifier) { + final _ret = _lib._objc_msgSend_912( + _lib._class_NSURLSessionConfiguration1, + _lib._sel_backgroundSessionConfigurationWithIdentifier_1, + identifier?._id ?? ffi.nullptr); + return NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); + } + + NSString? get identifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_identifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get requestCachePolicy { + return _lib._objc_msgSend_748(_id, _lib._sel_requestCachePolicy1); + } + + set requestCachePolicy(int value) { + _lib._objc_msgSend_889(_id, _lib._sel_setRequestCachePolicy_1, value); + } + + double get timeoutIntervalForRequest { + return _lib._objc_msgSend_149(_id, _lib._sel_timeoutIntervalForRequest1); + } + + set timeoutIntervalForRequest(double value) { + _lib._objc_msgSend_474( + _id, _lib._sel_setTimeoutIntervalForRequest_1, value); + } + + double get timeoutIntervalForResource { + return _lib._objc_msgSend_149(_id, _lib._sel_timeoutIntervalForResource1); + } + + set timeoutIntervalForResource(double value) { + _lib._objc_msgSend_474( + _id, _lib._sel_setTimeoutIntervalForResource_1, value); + } + + int get networkServiceType { + return _lib._objc_msgSend_749(_id, _lib._sel_networkServiceType1); + } + + set networkServiceType(int value) { + _lib._objc_msgSend_890(_id, _lib._sel_setNetworkServiceType_1, value); + } + + bool get allowsCellularAccess { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsCellularAccess1); + } + + set allowsCellularAccess(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setAllowsCellularAccess_1, value); + } + + bool get allowsExpensiveNetworkAccess { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsExpensiveNetworkAccess1); + } + + set allowsExpensiveNetworkAccess(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setAllowsExpensiveNetworkAccess_1, value); + } + + bool get allowsConstrainedNetworkAccess { + return _lib._objc_msgSend_12( + _id, _lib._sel_allowsConstrainedNetworkAccess1); + } + + set allowsConstrainedNetworkAccess(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setAllowsConstrainedNetworkAccess_1, value); + } + + bool get waitsForConnectivity { + return _lib._objc_msgSend_12(_id, _lib._sel_waitsForConnectivity1); + } + + set waitsForConnectivity(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setWaitsForConnectivity_1, value); + } + + bool get discretionary { + return _lib._objc_msgSend_12(_id, _lib._sel_isDiscretionary1); + } + + set discretionary(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setDiscretionary_1, value); + } + + NSString? get sharedContainerIdentifier { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_sharedContainerIdentifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set sharedContainerIdentifier(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setSharedContainerIdentifier_1, + value?._id ?? ffi.nullptr); + } + + bool get sessionSendsLaunchEvents { + return _lib._objc_msgSend_12(_id, _lib._sel_sessionSendsLaunchEvents1); + } + + set sessionSendsLaunchEvents(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setSessionSendsLaunchEvents_1, value); + } + + NSDictionary? get connectionProxyDictionary { + final _ret = + _lib._objc_msgSend_164(_id, _lib._sel_connectionProxyDictionary1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set connectionProxyDictionary(NSDictionary? value) { + _lib._objc_msgSend_165(_id, _lib._sel_setConnectionProxyDictionary_1, + value?._id ?? ffi.nullptr); + } + + int get TLSMinimumSupportedProtocol { + return _lib._objc_msgSend_913(_id, _lib._sel_TLSMinimumSupportedProtocol1); + } + + set TLSMinimumSupportedProtocol(int value) { + _lib._objc_msgSend_914( + _id, _lib._sel_setTLSMinimumSupportedProtocol_1, value); + } + + int get TLSMaximumSupportedProtocol { + return _lib._objc_msgSend_913(_id, _lib._sel_TLSMaximumSupportedProtocol1); + } + + set TLSMaximumSupportedProtocol(int value) { + _lib._objc_msgSend_914( + _id, _lib._sel_setTLSMaximumSupportedProtocol_1, value); + } + + int get TLSMinimumSupportedProtocolVersion { + return _lib._objc_msgSend_915( + _id, _lib._sel_TLSMinimumSupportedProtocolVersion1); + } + + set TLSMinimumSupportedProtocolVersion(int value) { + _lib._objc_msgSend_916( + _id, _lib._sel_setTLSMinimumSupportedProtocolVersion_1, value); + } + + int get TLSMaximumSupportedProtocolVersion { + return _lib._objc_msgSend_915( + _id, _lib._sel_TLSMaximumSupportedProtocolVersion1); + } + + set TLSMaximumSupportedProtocolVersion(int value) { + _lib._objc_msgSend_916( + _id, _lib._sel_setTLSMaximumSupportedProtocolVersion_1, value); + } + + bool get HTTPShouldUsePipelining { + return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldUsePipelining1); + } + + set HTTPShouldUsePipelining(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setHTTPShouldUsePipelining_1, value); + } + + bool get HTTPShouldSetCookies { + return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldSetCookies1); + } + + set HTTPShouldSetCookies(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setHTTPShouldSetCookies_1, value); + } + + int get HTTPCookieAcceptPolicy { + return _lib._objc_msgSend_745(_id, _lib._sel_HTTPCookieAcceptPolicy1); + } + + set HTTPCookieAcceptPolicy(int value) { + _lib._objc_msgSend_746(_id, _lib._sel_setHTTPCookieAcceptPolicy_1, value); + } + + NSDictionary? get HTTPAdditionalHeaders { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_HTTPAdditionalHeaders1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set HTTPAdditionalHeaders(NSDictionary? value) { + _lib._objc_msgSend_165( + _id, _lib._sel_setHTTPAdditionalHeaders_1, value?._id ?? ffi.nullptr); + } + + int get HTTPMaximumConnectionsPerHost { + return _lib._objc_msgSend_78(_id, _lib._sel_HTTPMaximumConnectionsPerHost1); + } + + set HTTPMaximumConnectionsPerHost(int value) { + _lib._objc_msgSend_558( + _id, _lib._sel_setHTTPMaximumConnectionsPerHost_1, value); + } + + NSHTTPCookieStorage? get HTTPCookieStorage { + final _ret = _lib._objc_msgSend_739(_id, _lib._sel_HTTPCookieStorage1); + return _ret.address == 0 + ? null + : NSHTTPCookieStorage._(_ret, _lib, retain: true, release: true); + } + + set HTTPCookieStorage(NSHTTPCookieStorage? value) { + _lib._objc_msgSend_917( + _id, _lib._sel_setHTTPCookieStorage_1, value?._id ?? ffi.nullptr); + } + + NSURLCredentialStorage? get URLCredentialStorage { + final _ret = _lib._objc_msgSend_874(_id, _lib._sel_URLCredentialStorage1); + return _ret.address == 0 + ? null + : NSURLCredentialStorage._(_ret, _lib, retain: true, release: true); + } + + set URLCredentialStorage(NSURLCredentialStorage? value) { + _lib._objc_msgSend_918( + _id, _lib._sel_setURLCredentialStorage_1, value?._id ?? ffi.nullptr); + } + + NSURLCache? get URLCache { + final _ret = _lib._objc_msgSend_844(_id, _lib._sel_URLCache1); + return _ret.address == 0 + ? null + : NSURLCache._(_ret, _lib, retain: true, release: true); + } + + set URLCache(NSURLCache? value) { + _lib._objc_msgSend_845( + _id, _lib._sel_setURLCache_1, value?._id ?? ffi.nullptr); + } + + bool get shouldUseExtendedBackgroundIdleMode { + return _lib._objc_msgSend_12( + _id, _lib._sel_shouldUseExtendedBackgroundIdleMode1); + } + + set shouldUseExtendedBackgroundIdleMode(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setShouldUseExtendedBackgroundIdleMode_1, value); + } + + NSArray? get protocolClasses { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_protocolClasses1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set protocolClasses(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setProtocolClasses_1, value?._id ?? ffi.nullptr); + } + + int get multipathServiceType { + return _lib._objc_msgSend_919(_id, _lib._sel_multipathServiceType1); + } + + set multipathServiceType(int value) { + _lib._objc_msgSend_920(_id, _lib._sel_setMultipathServiceType_1, value); + } + + @override + NSURLSessionConfiguration init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionConfiguration new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionConfiguration1, _lib._sel_new1); + return NSURLSessionConfiguration._(_ret, _lib, + retain: false, release: true); + } + + static NSURLSessionConfiguration backgroundSessionConfiguration_( + AVFAudio _lib, NSString? identifier) { + final _ret = _lib._objc_msgSend_912( + _lib._class_NSURLSessionConfiguration1, + _lib._sel_backgroundSessionConfiguration_1, + identifier?._id ?? ffi.nullptr); + return NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionConfiguration alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionConfiguration1, _lib._sel_alloc1); + return NSURLSessionConfiguration._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLSessionConfiguration1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLSessionConfiguration1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionConfiguration1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSessionConfiguration1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionConfiguration1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionConfiguration1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLSessionConfiguration1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLSessionConfiguration1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionConfiguration1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class SSLProtocol { + static const int kSSLProtocolUnknown = 0; + static const int kTLSProtocol1 = 4; + static const int kTLSProtocol11 = 7; + static const int kTLSProtocol12 = 8; + static const int kDTLSProtocol1 = 9; + static const int kTLSProtocol13 = 10; + static const int kDTLSProtocol12 = 11; + static const int kTLSProtocolMaxSupported = 999; + static const int kSSLProtocol2 = 1; + static const int kSSLProtocol3 = 2; + static const int kSSLProtocol3Only = 3; + static const int kTLSProtocol1Only = 5; + static const int kSSLProtocolAll = 6; +} + +abstract class tls_protocol_version_t { + static const int tls_protocol_version_TLSv10 = 769; + static const int tls_protocol_version_TLSv11 = 770; + static const int tls_protocol_version_TLSv12 = 771; + static const int tls_protocol_version_TLSv13 = 772; + static const int tls_protocol_version_DTLSv10 = -257; + static const int tls_protocol_version_DTLSv12 = -259; +} + +abstract class NSURLSessionMultipathServiceType { + static const int NSURLSessionMultipathServiceTypeNone = 0; + static const int NSURLSessionMultipathServiceTypeHandover = 1; + static const int NSURLSessionMultipathServiceTypeInteractive = 2; + static const int NSURLSessionMultipathServiceTypeAggregate = 3; +} + +void _ObjCBlock37_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock37_closureRegistry = {}; +int _ObjCBlock37_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock37_registerClosure(Function fn) { + final id = ++_ObjCBlock37_closureRegistryIndex; + _ObjCBlock37_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock37_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return _ObjCBlock37_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock37 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock37._(this._impl, this._lib); + ObjCBlock37.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock37_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock37.fromFunction( + this._lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock37_closureTrampoline) + .cast(), + _ObjCBlock37_registerClosure(fn)); + void call(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class NSURLSessionUploadTask extends NSURLSessionDataTask { + NSURLSessionUploadTask._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionUploadTask] that points to the same underlying object as [other]. + static NSURLSessionUploadTask castFrom(T other) { + return NSURLSessionUploadTask._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionUploadTask] that wraps the given raw object pointer. + static NSURLSessionUploadTask castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionUploadTask._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionUploadTask]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionUploadTask1); + } + + @override + NSURLSessionUploadTask init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionUploadTask new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionUploadTask1, _lib._sel_new1); + return NSURLSessionUploadTask._(_ret, _lib, retain: false, release: true); + } + + static NSURLSessionUploadTask alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionUploadTask1, _lib._sel_alloc1); + return NSURLSessionUploadTask._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLSessionUploadTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLSessionUploadTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionUploadTask1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSessionUploadTask1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionUploadTask1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionUploadTask1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLSessionUploadTask1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLSessionUploadTask1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionUploadTask1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSURLSessionDownloadTask extends NSURLSessionTask { + NSURLSessionDownloadTask._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionDownloadTask] that points to the same underlying object as [other]. + static NSURLSessionDownloadTask castFrom(T other) { + return NSURLSessionDownloadTask._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionDownloadTask] that wraps the given raw object pointer. + static NSURLSessionDownloadTask castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionDownloadTask._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionDownloadTask]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionDownloadTask1); + } + + void cancelByProducingResumeData_(ObjCBlock38 completionHandler) { + return _lib._objc_msgSend_930( + _id, _lib._sel_cancelByProducingResumeData_1, completionHandler._impl); + } + + @override + NSURLSessionDownloadTask init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionDownloadTask new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionDownloadTask1, _lib._sel_new1); + return NSURLSessionDownloadTask._(_ret, _lib, retain: false, release: true); + } + + static NSURLSessionDownloadTask alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionDownloadTask1, _lib._sel_alloc1); + return NSURLSessionDownloadTask._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLSessionDownloadTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLSessionDownloadTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionDownloadTask1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSessionDownloadTask1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionDownloadTask1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionDownloadTask1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLSessionDownloadTask1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLSessionDownloadTask1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionDownloadTask1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock38_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock38_closureRegistry = {}; +int _ObjCBlock38_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock38_registerClosure(Function fn) { + final id = ++_ObjCBlock38_closureRegistryIndex; + _ObjCBlock38_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock38_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return _ObjCBlock38_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock38 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock38._(this._impl, this._lib); + ObjCBlock38.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock38_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock38.fromFunction( + this._lib, void Function(ffi.Pointer arg0) fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock38_closureTrampoline) + .cast(), + _ObjCBlock38_registerClosure(fn)); + void call(ffi.Pointer arg0) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_impl, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class NSURLSessionStreamTask extends NSURLSessionTask { + NSURLSessionStreamTask._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionStreamTask] that points to the same underlying object as [other]. + static NSURLSessionStreamTask castFrom(T other) { + return NSURLSessionStreamTask._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionStreamTask] that wraps the given raw object pointer. + static NSURLSessionStreamTask castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionStreamTask._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionStreamTask]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionStreamTask1); + } + + void readDataOfMinLength_maxLength_timeout_completionHandler_(int minBytes, + int maxBytes, double timeout, ObjCBlock39 completionHandler) { + return _lib._objc_msgSend_934( + _id, + _lib._sel_readDataOfMinLength_maxLength_timeout_completionHandler_1, + minBytes, + maxBytes, + timeout, + completionHandler._impl); + } + + void writeData_timeout_completionHandler_( + NSData? data, double timeout, ObjCBlock15 completionHandler) { + return _lib._objc_msgSend_935( + _id, + _lib._sel_writeData_timeout_completionHandler_1, + data?._id ?? ffi.nullptr, + timeout, + completionHandler._impl); + } + + void captureStreams() { + return _lib._objc_msgSend_1(_id, _lib._sel_captureStreams1); + } + + void closeWrite() { + return _lib._objc_msgSend_1(_id, _lib._sel_closeWrite1); + } + + void closeRead() { + return _lib._objc_msgSend_1(_id, _lib._sel_closeRead1); + } + + void startSecureConnection() { + return _lib._objc_msgSend_1(_id, _lib._sel_startSecureConnection1); + } + + void stopSecureConnection() { + return _lib._objc_msgSend_1(_id, _lib._sel_stopSecureConnection1); + } + + @override + NSURLSessionStreamTask init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionStreamTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionStreamTask new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionStreamTask1, _lib._sel_new1); + return NSURLSessionStreamTask._(_ret, _lib, retain: false, release: true); + } + + static NSURLSessionStreamTask alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionStreamTask1, _lib._sel_alloc1); + return NSURLSessionStreamTask._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLSessionStreamTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLSessionStreamTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionStreamTask1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSessionStreamTask1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionStreamTask1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionStreamTask1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLSessionStreamTask1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLSessionStreamTask1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionStreamTask1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock39_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, bool arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock39_closureRegistry = {}; +int _ObjCBlock39_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock39_registerClosure(Function fn) { + final id = ++_ObjCBlock39_closureRegistryIndex; + _ObjCBlock39_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock39_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { + return _ObjCBlock39_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock39 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock39._(this._impl, this._lib); + ObjCBlock39.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, + ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock39_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock39.fromFunction( + this._lib, + void Function(ffi.Pointer arg0, bool arg1, + ffi.Pointer arg2) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock39_closureTrampoline) + .cast(), + _ObjCBlock39_registerClosure(fn)); + void call( + ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + bool arg1, + ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class NSNetService extends NSObject { + NSNetService._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSNetService] that points to the same underlying object as [other]. + static NSNetService castFrom(T other) { + return NSNetService._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSNetService] that wraps the given raw object pointer. + static NSNetService castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSNetService._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSNetService]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSNetService1); + } + + NSNetService initWithDomain_type_name_port_( + NSString? domain, NSString? type, NSString? name, int port) { + final _ret = _lib._objc_msgSend_937( + _id, + _lib._sel_initWithDomain_type_name_port_1, + domain?._id ?? ffi.nullptr, + type?._id ?? ffi.nullptr, + name?._id ?? ffi.nullptr, + port); + return NSNetService._(_ret, _lib, retain: true, release: true); + } + + NSNetService initWithDomain_type_name_( + NSString? domain, NSString? type, NSString? name) { + final _ret = _lib._objc_msgSend_26( + _id, + _lib._sel_initWithDomain_type_name_1, + domain?._id ?? ffi.nullptr, + type?._id ?? ffi.nullptr, + name?._id ?? ffi.nullptr); + return NSNetService._(_ret, _lib, retain: true, release: true); + } + + void scheduleInRunLoop_forMode_(NSRunLoop? aRunLoop, NSRunLoopMode mode) { + return _lib._objc_msgSend_501(_id, _lib._sel_scheduleInRunLoop_forMode_1, + aRunLoop?._id ?? ffi.nullptr, mode); + } + + void removeFromRunLoop_forMode_(NSRunLoop? aRunLoop, NSRunLoopMode mode) { + return _lib._objc_msgSend_501(_id, _lib._sel_removeFromRunLoop_forMode_1, + aRunLoop?._id ?? ffi.nullptr, mode); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + _lib._objc_msgSend_368( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + bool get includesPeerToPeer { + return _lib._objc_msgSend_12(_id, _lib._sel_includesPeerToPeer1); + } + + set includesPeerToPeer(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setIncludesPeerToPeer_1, value); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get type { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_type1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get domain { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_domain1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get hostName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_hostName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get addresses { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_addresses1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + int get port { + return _lib._objc_msgSend_78(_id, _lib._sel_port1); + } + + void publish() { + return _lib._objc_msgSend_1(_id, _lib._sel_publish1); + } + + void publishWithOptions_(int options) { + return _lib._objc_msgSend_938(_id, _lib._sel_publishWithOptions_1, options); + } + + void resolve() { + return _lib._objc_msgSend_1(_id, _lib._sel_resolve1); + } + + void stop() { + return _lib._objc_msgSend_1(_id, _lib._sel_stop1); + } + + static NSDictionary dictionaryFromTXTRecordData_( + AVFAudio _lib, NSData? txtData) { + final _ret = _lib._objc_msgSend_939(_lib._class_NSNetService1, + _lib._sel_dictionaryFromTXTRecordData_1, txtData?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSData dataFromTXTRecordDictionary_( + AVFAudio _lib, NSDictionary? txtDictionary) { + final _ret = _lib._objc_msgSend_940( + _lib._class_NSNetService1, + _lib._sel_dataFromTXTRecordDictionary_1, + txtDictionary?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + void resolveWithTimeout_(double timeout) { + return _lib._objc_msgSend_473(_id, _lib._sel_resolveWithTimeout_1, timeout); + } + + bool getInputStream_outputStream_( + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + return _lib._objc_msgSend_941(_id, _lib._sel_getInputStream_outputStream_1, + inputStream, outputStream); + } + + bool setTXTRecordData_(NSData? recordData) { + return _lib._objc_msgSend_23( + _id, _lib._sel_setTXTRecordData_1, recordData?._id ?? ffi.nullptr); + } + + NSData TXTRecordData() { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_TXTRecordData1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + void startMonitoring() { + return _lib._objc_msgSend_1(_id, _lib._sel_startMonitoring1); + } + + void stopMonitoring() { + return _lib._objc_msgSend_1(_id, _lib._sel_stopMonitoring1); + } + + static NSNetService new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSNetService1, _lib._sel_new1); + return NSNetService._(_ret, _lib, retain: false, release: true); + } + + static NSNetService alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSNetService1, _lib._sel_alloc1); + return NSNetService._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSNetService1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSNetService1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSNetService1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSNetService1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSNetService1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSNetService1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSNetService1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSNetService1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSNetService1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSNetServiceOptions { + static const int NSNetServiceNoAutoRename = 1; + static const int NSNetServiceListenForConnections = 2; +} + +class NSURLSessionWebSocketTask extends NSURLSessionTask { + NSURLSessionWebSocketTask._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionWebSocketTask] that points to the same underlying object as [other]. + static NSURLSessionWebSocketTask castFrom(T other) { + return NSURLSessionWebSocketTask._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionWebSocketTask] that wraps the given raw object pointer. + static NSURLSessionWebSocketTask castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionWebSocketTask._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionWebSocketTask]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionWebSocketTask1); + } + + void sendMessage_completionHandler_( + NSURLSessionWebSocketMessage? message, ObjCBlock15 completionHandler) { + return _lib._objc_msgSend_944( + _id, + _lib._sel_sendMessage_completionHandler_1, + message?._id ?? ffi.nullptr, + completionHandler._impl); + } + + void receiveMessageWithCompletionHandler_(ObjCBlock40 completionHandler) { + return _lib._objc_msgSend_945( + _id, + _lib._sel_receiveMessageWithCompletionHandler_1, + completionHandler._impl); + } + + void sendPingWithPongReceiveHandler_(ObjCBlock15 pongReceiveHandler) { + return _lib._objc_msgSend_946(_id, + _lib._sel_sendPingWithPongReceiveHandler_1, pongReceiveHandler._impl); + } + + void cancelWithCloseCode_reason_(int closeCode, NSData? reason) { + return _lib._objc_msgSend_947(_id, _lib._sel_cancelWithCloseCode_reason_1, + closeCode, reason?._id ?? ffi.nullptr); + } + + int get maximumMessageSize { + return _lib._objc_msgSend_78(_id, _lib._sel_maximumMessageSize1); + } + + set maximumMessageSize(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setMaximumMessageSize_1, value); + } + + int get closeCode { + return _lib._objc_msgSend_948(_id, _lib._sel_closeCode1); + } + + NSData? get closeReason { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_closeReason1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + @override + NSURLSessionWebSocketTask init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionWebSocketTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionWebSocketTask new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionWebSocketTask1, _lib._sel_new1); + return NSURLSessionWebSocketTask._(_ret, _lib, + retain: false, release: true); + } + + static NSURLSessionWebSocketTask alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionWebSocketTask1, _lib._sel_alloc1); + return NSURLSessionWebSocketTask._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLSessionWebSocketTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLSessionWebSocketTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionWebSocketTask1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSessionWebSocketTask1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionWebSocketTask1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionWebSocketTask1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLSessionWebSocketTask1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLSessionWebSocketTask1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionWebSocketTask1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSURLSessionWebSocketMessage extends NSObject { + NSURLSessionWebSocketMessage._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionWebSocketMessage] that points to the same underlying object as [other]. + static NSURLSessionWebSocketMessage castFrom( + T other) { + return NSURLSessionWebSocketMessage._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionWebSocketMessage] that wraps the given raw object pointer. + static NSURLSessionWebSocketMessage castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionWebSocketMessage._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionWebSocketMessage]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionWebSocketMessage1); + } + + NSURLSessionWebSocketMessage initWithData_(NSData? data) { + final _ret = _lib._objc_msgSend_242( + _id, _lib._sel_initWithData_1, data?._id ?? ffi.nullptr); + return NSURLSessionWebSocketMessage._(_ret, _lib, + retain: true, release: true); + } + + NSURLSessionWebSocketMessage initWithString_(NSString? string) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, string?._id ?? ffi.nullptr); + return NSURLSessionWebSocketMessage._(_ret, _lib, + retain: true, release: true); + } + + int get type { + return _lib._objc_msgSend_943(_id, _lib._sel_type1); + } + + NSData? get data { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_data1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSString? get string { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_string1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + @override + NSURLSessionWebSocketMessage init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionWebSocketMessage._(_ret, _lib, + retain: true, release: true); + } + + static NSURLSessionWebSocketMessage new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionWebSocketMessage1, _lib._sel_new1); + return NSURLSessionWebSocketMessage._(_ret, _lib, + retain: false, release: true); + } + + static NSURLSessionWebSocketMessage alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionWebSocketMessage1, _lib._sel_alloc1); + return NSURLSessionWebSocketMessage._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSURLSessionWebSocketMessageType { + static const int NSURLSessionWebSocketMessageTypeData = 0; + static const int NSURLSessionWebSocketMessageTypeString = 1; +} + +void _ObjCBlock40_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock40_closureRegistry = {}; +int _ObjCBlock40_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock40_registerClosure(Function fn) { + final id = ++_ObjCBlock40_closureRegistryIndex; + _ObjCBlock40_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock40_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return _ObjCBlock40_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock40 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock40._(this._impl, this._lib); + ObjCBlock40.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : _impl = + _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock40_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock40.fromFunction( + this._lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock40_closureTrampoline) + .cast(), + _ObjCBlock40_registerClosure(fn)); + void call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_impl, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +abstract class NSURLSessionWebSocketCloseCode { + static const int NSURLSessionWebSocketCloseCodeInvalid = 0; + static const int NSURLSessionWebSocketCloseCodeNormalClosure = 1000; + static const int NSURLSessionWebSocketCloseCodeGoingAway = 1001; + static const int NSURLSessionWebSocketCloseCodeProtocolError = 1002; + static const int NSURLSessionWebSocketCloseCodeUnsupportedData = 1003; + static const int NSURLSessionWebSocketCloseCodeNoStatusReceived = 1005; + static const int NSURLSessionWebSocketCloseCodeAbnormalClosure = 1006; + static const int NSURLSessionWebSocketCloseCodeInvalidFramePayloadData = 1007; + static const int NSURLSessionWebSocketCloseCodePolicyViolation = 1008; + static const int NSURLSessionWebSocketCloseCodeMessageTooBig = 1009; + static const int NSURLSessionWebSocketCloseCodeMandatoryExtensionMissing = + 1010; + static const int NSURLSessionWebSocketCloseCodeInternalServerError = 1011; + static const int NSURLSessionWebSocketCloseCodeTLSHandshakeFailure = 1015; +} + +void _ObjCBlock41_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock41_closureRegistry = {}; +int _ObjCBlock41_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock41_registerClosure(Function fn) { + final id = ++_ObjCBlock41_closureRegistryIndex; + _ObjCBlock41_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock41_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return _ObjCBlock41_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock41 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock41._(this._impl, this._lib); + ObjCBlock41.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock41_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock41.fromFunction( + this._lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock41_closureTrampoline) + .cast(), + _ObjCBlock41_registerClosure(fn)); + void call(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +void _ObjCBlock42_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock42_closureRegistry = {}; +int _ObjCBlock42_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock42_registerClosure(Function fn) { + final id = ++_ObjCBlock42_closureRegistryIndex; + _ObjCBlock42_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock42_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return _ObjCBlock42_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock42 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock42._(this._impl, this._lib); + ObjCBlock42.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock42_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock42.fromFunction( + this._lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) + fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock42_closureTrampoline) + .cast(), + _ObjCBlock42_registerClosure(fn)); + void call(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class NSProtocolChecker extends NSProxy { + NSProtocolChecker._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSProtocolChecker] that points to the same underlying object as [other]. + static NSProtocolChecker castFrom(T other) { + return NSProtocolChecker._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSProtocolChecker] that wraps the given raw object pointer. + static NSProtocolChecker castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSProtocolChecker._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSProtocolChecker]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSProtocolChecker1); + } + + Protocol? get protocol { + final _ret = _lib._objc_msgSend_959(_id, _lib._sel_protocol1); + return _ret.address == 0 + ? null + : Protocol._(_ret, _lib, retain: true, release: true); + } + + NSObject? get target { + final _ret = _lib._objc_msgSend_788(_id, _lib._sel_target1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSProtocolChecker protocolCheckerWithTarget_protocol_( + AVFAudio _lib, NSObject? anObject, Protocol? aProtocol) { + final _ret = _lib._objc_msgSend_960( + _lib._class_NSProtocolChecker1, + _lib._sel_protocolCheckerWithTarget_protocol_1, + anObject?._id ?? ffi.nullptr, + aProtocol?._id ?? ffi.nullptr); + return NSProtocolChecker._(_ret, _lib, retain: true, release: true); + } + + NSProtocolChecker initWithTarget_protocol_( + NSObject? anObject, Protocol? aProtocol) { + final _ret = _lib._objc_msgSend_960( + _id, + _lib._sel_initWithTarget_protocol_1, + anObject?._id ?? ffi.nullptr, + aProtocol?._id ?? ffi.nullptr); + return NSProtocolChecker._(_ret, _lib, retain: true, release: true); + } + + static NSObject alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSProtocolChecker1, _lib._sel_alloc1); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static bool respondsToSelector_( + AVFAudio _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_4(_lib._class_NSProtocolChecker1, + _lib._sel_respondsToSelector_1, aSelector); + } +} + +class NSTask extends NSObject { + NSTask._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSTask] that points to the same underlying object as [other]. + static NSTask castFrom(T other) { + return NSTask._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSTask] that wraps the given raw object pointer. + static NSTask castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSTask._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSTask]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSTask1); + } + + @override + NSTask init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSTask._(_ret, _lib, retain: true, release: true); + } + + NSURL? get executableURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_executableURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + set executableURL(NSURL? value) { + _lib._objc_msgSend_888( + _id, _lib._sel_setExecutableURL_1, value?._id ?? ffi.nullptr); + } + + NSArray? get arguments { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_arguments1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set arguments(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setArguments_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get environment { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_environment1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set environment(NSDictionary? value) { + _lib._objc_msgSend_165( + _id, _lib._sel_setEnvironment_1, value?._id ?? ffi.nullptr); + } + + NSURL? get currentDirectoryURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_currentDirectoryURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + set currentDirectoryURL(NSURL? value) { + _lib._objc_msgSend_888( + _id, _lib._sel_setCurrentDirectoryURL_1, value?._id ?? ffi.nullptr); + } + + NSObject get standardInput { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_standardInput1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set standardInput(NSObject value) { + _lib._objc_msgSend_368(_id, _lib._sel_setStandardInput_1, value._id); + } + + NSObject get standardOutput { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_standardOutput1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set standardOutput(NSObject value) { + _lib._objc_msgSend_368(_id, _lib._sel_setStandardOutput_1, value._id); + } + + NSObject get standardError { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_standardError1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set standardError(NSObject value) { + _lib._objc_msgSend_368(_id, _lib._sel_setStandardError_1, value._id); + } + + bool launchAndReturnError_(ffi.Pointer> error) { + return _lib._objc_msgSend_219(_id, _lib._sel_launchAndReturnError_1, error); + } + + void interrupt() { + return _lib._objc_msgSend_1(_id, _lib._sel_interrupt1); + } + + void terminate() { + return _lib._objc_msgSend_1(_id, _lib._sel_terminate1); + } + + bool suspend() { + return _lib._objc_msgSend_12(_id, _lib._sel_suspend1); + } + + bool resume() { + return _lib._objc_msgSend_12(_id, _lib._sel_resume1); + } + + int get processIdentifier { + return _lib._objc_msgSend_213(_id, _lib._sel_processIdentifier1); + } + + bool get running { + return _lib._objc_msgSend_12(_id, _lib._sel_isRunning1); + } + + int get terminationStatus { + return _lib._objc_msgSend_213(_id, _lib._sel_terminationStatus1); + } + + int get terminationReason { + return _lib._objc_msgSend_961(_id, _lib._sel_terminationReason1); + } + + ObjCBlock43 get terminationHandler { + final _ret = _lib._objc_msgSend_962(_id, _lib._sel_terminationHandler1); + return ObjCBlock43._(_ret, _lib); + } + + set terminationHandler(ObjCBlock43 value) { + _lib._objc_msgSend_963(_id, _lib._sel_setTerminationHandler_1, value._impl); + } + + int get qualityOfService { + return _lib._objc_msgSend_475(_id, _lib._sel_qualityOfService1); + } + + set qualityOfService(int value) { + _lib._objc_msgSend_476(_id, _lib._sel_setQualityOfService_1, value); + } + + static NSTask + launchedTaskWithExecutableURL_arguments_error_terminationHandler_( + AVFAudio _lib, + NSURL? url, + NSArray? arguments, + ffi.Pointer> error, + ObjCBlock43 terminationHandler) { + final _ret = _lib._objc_msgSend_964( + _lib._class_NSTask1, + _lib._sel_launchedTaskWithExecutableURL_arguments_error_terminationHandler_1, + url?._id ?? ffi.nullptr, + arguments?._id ?? ffi.nullptr, + error, + terminationHandler._impl); + return NSTask._(_ret, _lib, retain: true, release: true); + } + + void waitUntilExit() { + return _lib._objc_msgSend_1(_id, _lib._sel_waitUntilExit1); + } + + NSString? get launchPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_launchPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set launchPath(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setLaunchPath_1, value?._id ?? ffi.nullptr); + } + + NSString? get currentDirectoryPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_currentDirectoryPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set currentDirectoryPath(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setCurrentDirectoryPath_1, value?._id ?? ffi.nullptr); + } + + void launch() { + return _lib._objc_msgSend_1(_id, _lib._sel_launch1); + } + + static NSTask launchedTaskWithLaunchPath_arguments_( + AVFAudio _lib, NSString? path, NSArray? arguments) { + final _ret = _lib._objc_msgSend_965( + _lib._class_NSTask1, + _lib._sel_launchedTaskWithLaunchPath_arguments_1, + path?._id ?? ffi.nullptr, + arguments?._id ?? ffi.nullptr); + return NSTask._(_ret, _lib, retain: true, release: true); + } + + static NSTask new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSTask1, _lib._sel_new1); + return NSTask._(_ret, _lib, retain: false, release: true); + } + + static NSTask alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSTask1, _lib._sel_alloc1); + return NSTask._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSTask1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSTask1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSTask1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSTask1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSTask1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSTask1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSTask1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSTaskTerminationReason { + static const int NSTaskTerminationReasonExit = 1; + static const int NSTaskTerminationReasonUncaughtSignal = 2; +} + +void _ObjCBlock43_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock43_closureRegistry = {}; +int _ObjCBlock43_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock43_registerClosure(Function fn) { + final id = ++_ObjCBlock43_closureRegistryIndex; + _ObjCBlock43_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock43_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return _ObjCBlock43_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock43 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock43._(this._impl, this._lib); + ObjCBlock43.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock43_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock43.fromFunction( + this._lib, void Function(ffi.Pointer arg0) fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock43_closureTrampoline) + .cast(), + _ObjCBlock43_registerClosure(fn)); + void call(ffi.Pointer arg0) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_impl, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +class NSXMLElement extends NSXMLNode { + NSXMLElement._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSXMLElement] that points to the same underlying object as [other]. + static NSXMLElement castFrom(T other) { + return NSXMLElement._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSXMLElement] that wraps the given raw object pointer. + static NSXMLElement castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSXMLElement._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSXMLElement]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLElement1); + } + + NSXMLElement initWithName_(NSString? name) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithName_1, name?._id ?? ffi.nullptr); + return NSXMLElement._(_ret, _lib, retain: true, release: true); + } + + NSXMLElement initWithName_URI_(NSString? name, NSString? URI) { + final _ret = _lib._objc_msgSend_159(_id, _lib._sel_initWithName_URI_1, + name?._id ?? ffi.nullptr, URI?._id ?? ffi.nullptr); + return NSXMLElement._(_ret, _lib, retain: true, release: true); + } + + NSXMLElement initWithName_stringValue_(NSString? name, NSString? string) { + final _ret = _lib._objc_msgSend_159( + _id, + _lib._sel_initWithName_stringValue_1, + name?._id ?? ffi.nullptr, + string?._id ?? ffi.nullptr); + return NSXMLElement._(_ret, _lib, retain: true, release: true); + } + + NSXMLElement initWithXMLString_error_( + NSString? string, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_264(_id, + _lib._sel_initWithXMLString_error_1, string?._id ?? ffi.nullptr, error); + return NSXMLElement._(_ret, _lib, retain: true, release: true); + } + + @override + NSXMLElement initWithKind_options_(int kind, int options) { + final _ret = _lib._objc_msgSend_967( + _id, _lib._sel_initWithKind_options_1, kind, options); + return NSXMLElement._(_ret, _lib, retain: true, release: true); + } + + NSArray elementsForName_(NSString? name) { + final _ret = _lib._objc_msgSend_119( + _id, _lib._sel_elementsForName_1, name?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray elementsForLocalName_URI_(NSString? localName, NSString? URI) { + final _ret = _lib._objc_msgSend_617( + _id, + _lib._sel_elementsForLocalName_URI_1, + localName?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void addAttribute_(NSXMLNode? attribute) { + return _lib._objc_msgSend_979( + _id, _lib._sel_addAttribute_1, attribute?._id ?? ffi.nullptr); + } + + void removeAttributeForName_(NSString? name) { + return _lib._objc_msgSend_186( + _id, _lib._sel_removeAttributeForName_1, name?._id ?? ffi.nullptr); + } + + NSArray? get attributes { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_attributes1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set attributes(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setAttributes_1, value?._id ?? ffi.nullptr); + } + + void setAttributesWithDictionary_(NSDictionary? attributes) { + return _lib._objc_msgSend_444(_id, _lib._sel_setAttributesWithDictionary_1, + attributes?._id ?? ffi.nullptr); + } + + NSXMLNode attributeForName_(NSString? name) { + final _ret = _lib._objc_msgSend_983( + _id, _lib._sel_attributeForName_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode attributeForLocalName_URI_(NSString? localName, NSString? URI) { + final _ret = _lib._objc_msgSend_1000( + _id, + _lib._sel_attributeForLocalName_URI_1, + localName?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + void addNamespace_(NSXMLNode? aNamespace) { + return _lib._objc_msgSend_979( + _id, _lib._sel_addNamespace_1, aNamespace?._id ?? ffi.nullptr); + } + + void removeNamespaceForPrefix_(NSString? name) { + return _lib._objc_msgSend_186( + _id, _lib._sel_removeNamespaceForPrefix_1, name?._id ?? ffi.nullptr); + } + + NSArray? get namespaces { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_namespaces1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set namespaces(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setNamespaces_1, value?._id ?? ffi.nullptr); + } + + NSXMLNode namespaceForPrefix_(NSString? name) { + final _ret = _lib._objc_msgSend_983( + _id, _lib._sel_namespaceForPrefix_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode resolveNamespaceForName_(NSString? name) { + final _ret = _lib._objc_msgSend_983( + _id, _lib._sel_resolveNamespaceForName_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSString resolvePrefixForNamespaceURI_(NSString? namespaceURI) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_resolvePrefixForNamespaceURI_1, + namespaceURI?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + void insertChild_atIndex_(NSXMLNode? child, int index) { + return _lib._objc_msgSend_977( + _id, _lib._sel_insertChild_atIndex_1, child?._id ?? ffi.nullptr, index); + } + + void insertChildren_atIndex_(NSArray? children, int index) { + return _lib._objc_msgSend_978(_id, _lib._sel_insertChildren_atIndex_1, + children?._id ?? ffi.nullptr, index); + } + + void removeChildAtIndex_(int index) { + return _lib._objc_msgSend_410(_id, _lib._sel_removeChildAtIndex_1, index); + } + + void setChildren_(NSArray? children) { + return _lib._objc_msgSend_412( + _id, _lib._sel_setChildren_1, children?._id ?? ffi.nullptr); + } + + void addChild_(NSXMLNode? child) { + return _lib._objc_msgSend_979( + _id, _lib._sel_addChild_1, child?._id ?? ffi.nullptr); + } + + void replaceChildAtIndex_withNode_(int index, NSXMLNode? node) { + return _lib._objc_msgSend_980(_id, _lib._sel_replaceChildAtIndex_withNode_1, + index, node?._id ?? ffi.nullptr); + } + + void normalizeAdjacentTextNodesPreservingCDATA_(bool preserve) { + return _lib._objc_msgSend_756( + _id, _lib._sel_normalizeAdjacentTextNodesPreservingCDATA_1, preserve); + } + + void setAttributesAsDictionary_(NSDictionary? attributes) { + return _lib._objc_msgSend_444(_id, _lib._sel_setAttributesAsDictionary_1, + attributes?._id ?? ffi.nullptr); + } + + static NSObject document(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLElement1, _lib._sel_document1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject documentWithRootElement_( + AVFAudio _lib, NSXMLElement? element) { + final _ret = _lib._objc_msgSend_968(_lib._class_NSXMLElement1, + _lib._sel_documentWithRootElement_1, element?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_(AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLElement1, + _lib._sel_elementWithName_1, name?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_URI_( + AVFAudio _lib, NSString? name, NSString? URI) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLElement1, + _lib._sel_elementWithName_URI_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_stringValue_( + AVFAudio _lib, NSString? name, NSString? string) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLElement1, + _lib._sel_elementWithName_stringValue_1, + name?._id ?? ffi.nullptr, + string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_children_attributes_( + AVFAudio _lib, NSString? name, NSArray? children, NSArray? attributes) { + final _ret = _lib._objc_msgSend_969( + _lib._class_NSXMLElement1, + _lib._sel_elementWithName_children_attributes_1, + name?._id ?? ffi.nullptr, + children?._id ?? ffi.nullptr, + attributes?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_stringValue_( + AVFAudio _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLElement1, + _lib._sel_attributeWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_URI_stringValue_( + AVFAudio _lib, NSString? name, NSString? URI, NSString? stringValue) { + final _ret = _lib._objc_msgSend_26( + _lib._class_NSXMLElement1, + _lib._sel_attributeWithName_URI_stringValue_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject namespaceWithName_stringValue_( + AVFAudio _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLElement1, + _lib._sel_namespaceWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject processingInstructionWithName_stringValue_( + AVFAudio _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLElement1, + _lib._sel_processingInstructionWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject commentWithStringValue_( + AVFAudio _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLElement1, + _lib._sel_commentWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject textWithStringValue_(AVFAudio _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLElement1, + _lib._sel_textWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject DTDNodeWithXMLString_(AVFAudio _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLElement1, + _lib._sel_DTDNodeWithXMLString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSString localNameForName_(AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLElement1, + _lib._sel_localNameForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString prefixForName_(AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLElement1, + _lib._sel_prefixForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSXMLNode predefinedNamespaceForPrefix_( + AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_983(_lib._class_NSXMLElement1, + _lib._sel_predefinedNamespaceForPrefix_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + static NSXMLElement new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLElement1, _lib._sel_new1); + return NSXMLElement._(_ret, _lib, retain: false, release: true); + } + + static NSXMLElement alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLElement1, _lib._sel_alloc1); + return NSXMLElement._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSXMLElement1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSXMLElement1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLElement1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLElement1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSXMLElement1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSXMLElement1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSXMLElement1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSXMLElement1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSXMLElement1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSXMLNode extends NSObject { + NSXMLNode._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSXMLNode] that points to the same underlying object as [other]. + static NSXMLNode castFrom(T other) { + return NSXMLNode._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSXMLNode] that wraps the given raw object pointer. + static NSXMLNode castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSXMLNode._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSXMLNode]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLNode1); + } + + @override + NSXMLNode init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode initWithKind_(int kind) { + final _ret = _lib._objc_msgSend_966(_id, _lib._sel_initWithKind_1, kind); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode initWithKind_options_(int kind, int options) { + final _ret = _lib._objc_msgSend_967( + _id, _lib._sel_initWithKind_options_1, kind, options); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + static NSObject document(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLNode1, _lib._sel_document1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject documentWithRootElement_( + AVFAudio _lib, NSXMLElement? element) { + final _ret = _lib._objc_msgSend_968(_lib._class_NSXMLNode1, + _lib._sel_documentWithRootElement_1, element?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_(AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLNode1, + _lib._sel_elementWithName_1, name?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_URI_( + AVFAudio _lib, NSString? name, NSString? URI) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLNode1, + _lib._sel_elementWithName_URI_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_stringValue_( + AVFAudio _lib, NSString? name, NSString? string) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLNode1, + _lib._sel_elementWithName_stringValue_1, + name?._id ?? ffi.nullptr, + string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_children_attributes_( + AVFAudio _lib, NSString? name, NSArray? children, NSArray? attributes) { + final _ret = _lib._objc_msgSend_969( + _lib._class_NSXMLNode1, + _lib._sel_elementWithName_children_attributes_1, + name?._id ?? ffi.nullptr, + children?._id ?? ffi.nullptr, + attributes?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_stringValue_( + AVFAudio _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLNode1, + _lib._sel_attributeWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_URI_stringValue_( + AVFAudio _lib, NSString? name, NSString? URI, NSString? stringValue) { + final _ret = _lib._objc_msgSend_26( + _lib._class_NSXMLNode1, + _lib._sel_attributeWithName_URI_stringValue_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject namespaceWithName_stringValue_( + AVFAudio _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLNode1, + _lib._sel_namespaceWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject processingInstructionWithName_stringValue_( + AVFAudio _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLNode1, + _lib._sel_processingInstructionWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject commentWithStringValue_( + AVFAudio _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLNode1, + _lib._sel_commentWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject textWithStringValue_(AVFAudio _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLNode1, + _lib._sel_textWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject DTDNodeWithXMLString_(AVFAudio _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLNode1, + _lib._sel_DTDNodeWithXMLString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + int get kind { + return _lib._objc_msgSend_970(_id, _lib._sel_kind1); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set name(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setName_1, value?._id ?? ffi.nullptr); + } + + NSObject get objectValue { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_objectValue1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set objectValue(NSObject value) { + _lib._objc_msgSend_368(_id, _lib._sel_setObjectValue_1, value._id); + } + + NSString? get stringValue { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_stringValue1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set stringValue(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setStringValue_1, value?._id ?? ffi.nullptr); + } + + void setStringValue_resolvingEntities_(NSString? string, bool resolve) { + return _lib._objc_msgSend_971( + _id, + _lib._sel_setStringValue_resolvingEntities_1, + string?._id ?? ffi.nullptr, + resolve); + } + + int get index { + return _lib._objc_msgSend_10(_id, _lib._sel_index1); + } + + int get level { + return _lib._objc_msgSend_10(_id, _lib._sel_level1); + } + + NSXMLDocument? get rootDocument { + final _ret = _lib._objc_msgSend_994(_id, _lib._sel_rootDocument1); + return _ret.address == 0 + ? null + : NSXMLDocument._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode? get parent { + final _ret = _lib._objc_msgSend_995(_id, _lib._sel_parent1); + return _ret.address == 0 + ? null + : NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + int get childCount { + return _lib._objc_msgSend_10(_id, _lib._sel_childCount1); + } + + NSArray? get children { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_children1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode childAtIndex_(int index) { + final _ret = _lib._objc_msgSend_996(_id, _lib._sel_childAtIndex_1, index); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode? get previousSibling { + final _ret = _lib._objc_msgSend_995(_id, _lib._sel_previousSibling1); + return _ret.address == 0 + ? null + : NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode? get nextSibling { + final _ret = _lib._objc_msgSend_995(_id, _lib._sel_nextSibling1); + return _ret.address == 0 + ? null + : NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode? get previousNode { + final _ret = _lib._objc_msgSend_995(_id, _lib._sel_previousNode1); + return _ret.address == 0 + ? null + : NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode? get nextNode { + final _ret = _lib._objc_msgSend_995(_id, _lib._sel_nextNode1); + return _ret.address == 0 + ? null + : NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + void detach() { + return _lib._objc_msgSend_1(_id, _lib._sel_detach1); + } + + NSString? get XPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_XPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get localName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_localName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get prefix { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_prefix1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get URI { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_URI1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set URI(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setURI_1, value?._id ?? ffi.nullptr); + } + + static NSString localNameForName_(AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLNode1, + _lib._sel_localNameForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString prefixForName_(AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLNode1, + _lib._sel_prefixForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSXMLNode predefinedNamespaceForPrefix_( + AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_983(_lib._class_NSXMLNode1, + _lib._sel_predefinedNamespaceForPrefix_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get XMLString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_XMLString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString XMLStringWithOptions_(int options) { + final _ret = + _lib._objc_msgSend_997(_id, _lib._sel_XMLStringWithOptions_1, options); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString canonicalXMLStringPreservingComments_(bool comments) { + final _ret = _lib._objc_msgSend_998( + _id, _lib._sel_canonicalXMLStringPreservingComments_1, comments); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray nodesForXPath_error_( + NSString? xpath, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_394( + _id, _lib._sel_nodesForXPath_error_1, xpath?._id ?? ffi.nullptr, error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray objectsForXQuery_constants_error_(NSString? xquery, + NSDictionary? constants, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_999( + _id, + _lib._sel_objectsForXQuery_constants_error_1, + xquery?._id ?? ffi.nullptr, + constants?._id ?? ffi.nullptr, + error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray objectsForXQuery_error_( + NSString? xquery, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_394(_id, _lib._sel_objectsForXQuery_error_1, + xquery?._id ?? ffi.nullptr, error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSXMLNode new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSXMLNode1, _lib._sel_new1); + return NSXMLNode._(_ret, _lib, retain: false, release: true); + } + + static NSXMLNode alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSXMLNode1, _lib._sel_alloc1); + return NSXMLNode._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSXMLNode1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSXMLNode1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLNode1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLNode1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSXMLNode1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSXMLNode1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSXMLNode1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSXMLNode1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSXMLNode1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSXMLNodeKind { + static const int NSXMLInvalidKind = 0; + static const int NSXMLDocumentKind = 1; + static const int NSXMLElementKind = 2; + static const int NSXMLAttributeKind = 3; + static const int NSXMLNamespaceKind = 4; + static const int NSXMLProcessingInstructionKind = 5; + static const int NSXMLCommentKind = 6; + static const int NSXMLTextKind = 7; + static const int NSXMLDTDKind = 8; + static const int NSXMLEntityDeclarationKind = 9; + static const int NSXMLAttributeDeclarationKind = 10; + static const int NSXMLElementDeclarationKind = 11; + static const int NSXMLNotationDeclarationKind = 12; +} + +abstract class NSXMLNodeOptions { + static const int NSXMLNodeOptionsNone = 0; + static const int NSXMLNodeIsCDATA = 1; + static const int NSXMLNodeExpandEmptyElement = 2; + static const int NSXMLNodeCompactEmptyElement = 4; + static const int NSXMLNodeUseSingleQuotes = 8; + static const int NSXMLNodeUseDoubleQuotes = 16; + static const int NSXMLNodeNeverEscapeContents = 32; + static const int NSXMLDocumentTidyHTML = 512; + static const int NSXMLDocumentTidyXML = 1024; + static const int NSXMLDocumentValidate = 8192; + static const int NSXMLNodeLoadExternalEntitiesAlways = 16384; + static const int NSXMLNodeLoadExternalEntitiesSameOriginOnly = 32768; + static const int NSXMLNodeLoadExternalEntitiesNever = 524288; + static const int NSXMLDocumentXInclude = 65536; + static const int NSXMLNodePrettyPrint = 131072; + static const int NSXMLDocumentIncludeContentTypeDeclaration = 262144; + static const int NSXMLNodePreserveNamespaceOrder = 1048576; + static const int NSXMLNodePreserveAttributeOrder = 2097152; + static const int NSXMLNodePreserveEntities = 4194304; + static const int NSXMLNodePreservePrefixes = 8388608; + static const int NSXMLNodePreserveCDATA = 16777216; + static const int NSXMLNodePreserveWhitespace = 33554432; + static const int NSXMLNodePreserveDTD = 67108864; + static const int NSXMLNodePreserveCharacterReferences = 134217728; + static const int NSXMLNodePromoteSignificantWhitespace = 268435456; + static const int NSXMLNodePreserveEmptyElements = 6; + static const int NSXMLNodePreserveQuotes = 24; + static const int NSXMLNodePreserveAll = 4293918750; +} + +class NSXMLDocument extends NSXMLNode { + NSXMLDocument._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSXMLDocument] that points to the same underlying object as [other]. + static NSXMLDocument castFrom(T other) { + return NSXMLDocument._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSXMLDocument] that wraps the given raw object pointer. + static NSXMLDocument castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSXMLDocument._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSXMLDocument]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLDocument1); + } + + @override + NSXMLDocument init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSXMLDocument._(_ret, _lib, retain: true, release: true); + } + + NSXMLDocument initWithXMLString_options_error_( + NSString? string, int mask, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_972( + _id, + _lib._sel_initWithXMLString_options_error_1, + string?._id ?? ffi.nullptr, + mask, + error); + return NSXMLDocument._(_ret, _lib, retain: true, release: true); + } + + NSXMLDocument initWithContentsOfURL_options_error_( + NSURL? url, int mask, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_973( + _id, + _lib._sel_initWithContentsOfURL_options_error_1, + url?._id ?? ffi.nullptr, + mask, + error); + return NSXMLDocument._(_ret, _lib, retain: true, release: true); + } + + NSXMLDocument initWithData_options_error_( + NSData? data, int mask, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_974( + _id, + _lib._sel_initWithData_options_error_1, + data?._id ?? ffi.nullptr, + mask, + error); + return NSXMLDocument._(_ret, _lib, retain: true, release: true); + } + + NSXMLDocument initWithRootElement_(NSXMLElement? element) { + final _ret = _lib._objc_msgSend_968( + _id, _lib._sel_initWithRootElement_1, element?._id ?? ffi.nullptr); + return NSXMLDocument._(_ret, _lib, retain: true, release: true); + } + + static NSObject replacementClassForClass_(AVFAudio _lib, NSObject cls) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSXMLDocument1, + _lib._sel_replacementClassForClass_1, cls._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSString? get characterEncoding { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_characterEncoding1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set characterEncoding(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setCharacterEncoding_1, value?._id ?? ffi.nullptr); + } + + NSString? get version { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_version1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set version(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setVersion_1, value?._id ?? ffi.nullptr); + } + + bool get standalone { + return _lib._objc_msgSend_12(_id, _lib._sel_isStandalone1); + } + + set standalone(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setStandalone_1, value); + } + + int get documentContentKind { + return _lib._objc_msgSend_975(_id, _lib._sel_documentContentKind1); + } + + set documentContentKind(int value) { + _lib._objc_msgSend_976(_id, _lib._sel_setDocumentContentKind_1, value); + } + + NSString? get MIMEType { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_MIMEType1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set MIMEType(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setMIMEType_1, value?._id ?? ffi.nullptr); + } + + NSXMLDTD? get DTD { + final _ret = _lib._objc_msgSend_986(_id, _lib._sel_DTD1); + return _ret.address == 0 + ? null + : NSXMLDTD._(_ret, _lib, retain: true, release: true); + } + + set DTD(NSXMLDTD? value) { + _lib._objc_msgSend_987(_id, _lib._sel_setDTD_1, value?._id ?? ffi.nullptr); + } + + void setRootElement_(NSXMLElement? root) { + return _lib._objc_msgSend_988( + _id, _lib._sel_setRootElement_1, root?._id ?? ffi.nullptr); + } + + NSXMLElement rootElement() { + final _ret = _lib._objc_msgSend_989(_id, _lib._sel_rootElement1); + return NSXMLElement._(_ret, _lib, retain: true, release: true); + } + + void insertChild_atIndex_(NSXMLNode? child, int index) { + return _lib._objc_msgSend_977( + _id, _lib._sel_insertChild_atIndex_1, child?._id ?? ffi.nullptr, index); + } + + void insertChildren_atIndex_(NSArray? children, int index) { + return _lib._objc_msgSend_978(_id, _lib._sel_insertChildren_atIndex_1, + children?._id ?? ffi.nullptr, index); + } + + void removeChildAtIndex_(int index) { + return _lib._objc_msgSend_410(_id, _lib._sel_removeChildAtIndex_1, index); + } + + void setChildren_(NSArray? children) { + return _lib._objc_msgSend_412( + _id, _lib._sel_setChildren_1, children?._id ?? ffi.nullptr); + } + + void addChild_(NSXMLNode? child) { + return _lib._objc_msgSend_979( + _id, _lib._sel_addChild_1, child?._id ?? ffi.nullptr); + } + + void replaceChildAtIndex_withNode_(int index, NSXMLNode? node) { + return _lib._objc_msgSend_980(_id, _lib._sel_replaceChildAtIndex_withNode_1, + index, node?._id ?? ffi.nullptr); + } + + NSData? get XMLData { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_XMLData1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSData XMLDataWithOptions_(int options) { + final _ret = + _lib._objc_msgSend_990(_id, _lib._sel_XMLDataWithOptions_1, options); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSObject objectByApplyingXSLT_arguments_error_(NSData? xslt, + NSDictionary? arguments, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_991( + _id, + _lib._sel_objectByApplyingXSLT_arguments_error_1, + xslt?._id ?? ffi.nullptr, + arguments?._id ?? ffi.nullptr, + error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject objectByApplyingXSLTString_arguments_error_(NSString? xslt, + NSDictionary? arguments, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_992( + _id, + _lib._sel_objectByApplyingXSLTString_arguments_error_1, + xslt?._id ?? ffi.nullptr, + arguments?._id ?? ffi.nullptr, + error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject objectByApplyingXSLTAtURL_arguments_error_(NSURL? xsltURL, + NSDictionary? argument, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_993( + _id, + _lib._sel_objectByApplyingXSLTAtURL_arguments_error_1, + xsltURL?._id ?? ffi.nullptr, + argument?._id ?? ffi.nullptr, + error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool validateAndReturnError_(ffi.Pointer> error) { + return _lib._objc_msgSend_219( + _id, _lib._sel_validateAndReturnError_1, error); + } + + static NSObject document(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLDocument1, _lib._sel_document1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject documentWithRootElement_( + AVFAudio _lib, NSXMLElement? element) { + final _ret = _lib._objc_msgSend_968(_lib._class_NSXMLDocument1, + _lib._sel_documentWithRootElement_1, element?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_(AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDocument1, + _lib._sel_elementWithName_1, name?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_URI_( + AVFAudio _lib, NSString? name, NSString? URI) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDocument1, + _lib._sel_elementWithName_URI_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_stringValue_( + AVFAudio _lib, NSString? name, NSString? string) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDocument1, + _lib._sel_elementWithName_stringValue_1, + name?._id ?? ffi.nullptr, + string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_children_attributes_( + AVFAudio _lib, NSString? name, NSArray? children, NSArray? attributes) { + final _ret = _lib._objc_msgSend_969( + _lib._class_NSXMLDocument1, + _lib._sel_elementWithName_children_attributes_1, + name?._id ?? ffi.nullptr, + children?._id ?? ffi.nullptr, + attributes?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_stringValue_( + AVFAudio _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDocument1, + _lib._sel_attributeWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_URI_stringValue_( + AVFAudio _lib, NSString? name, NSString? URI, NSString? stringValue) { + final _ret = _lib._objc_msgSend_26( + _lib._class_NSXMLDocument1, + _lib._sel_attributeWithName_URI_stringValue_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject namespaceWithName_stringValue_( + AVFAudio _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDocument1, + _lib._sel_namespaceWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject processingInstructionWithName_stringValue_( + AVFAudio _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDocument1, + _lib._sel_processingInstructionWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject commentWithStringValue_( + AVFAudio _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDocument1, + _lib._sel_commentWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject textWithStringValue_(AVFAudio _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDocument1, + _lib._sel_textWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject DTDNodeWithXMLString_(AVFAudio _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDocument1, + _lib._sel_DTDNodeWithXMLString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSString localNameForName_(AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLDocument1, + _lib._sel_localNameForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString prefixForName_(AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLDocument1, + _lib._sel_prefixForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSXMLNode predefinedNamespaceForPrefix_( + AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_983(_lib._class_NSXMLDocument1, + _lib._sel_predefinedNamespaceForPrefix_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + static NSXMLDocument new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLDocument1, _lib._sel_new1); + return NSXMLDocument._(_ret, _lib, retain: false, release: true); + } + + static NSXMLDocument alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLDocument1, _lib._sel_alloc1); + return NSXMLDocument._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSXMLDocument1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSXMLDocument1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLDocument1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLDocument1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSXMLDocument1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSXMLDocument1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSXMLDocument1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSXMLDocument1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSXMLDocument1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSXMLDocumentContentKind { + static const int NSXMLDocumentXMLKind = 0; + static const int NSXMLDocumentXHTMLKind = 1; + static const int NSXMLDocumentHTMLKind = 2; + static const int NSXMLDocumentTextKind = 3; +} + +class NSXMLDTD extends NSXMLNode { + NSXMLDTD._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSXMLDTD] that points to the same underlying object as [other]. + static NSXMLDTD castFrom(T other) { + return NSXMLDTD._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSXMLDTD] that wraps the given raw object pointer. + static NSXMLDTD castFromPointer(AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSXMLDTD._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSXMLDTD]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLDTD1); + } + + @override + NSXMLDTD init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSXMLDTD._(_ret, _lib, retain: true, release: true); + } + + @override + NSXMLDTD initWithKind_options_(int kind, int options) { + final _ret = _lib._objc_msgSend_967( + _id, _lib._sel_initWithKind_options_1, kind, options); + return NSXMLDTD._(_ret, _lib, retain: true, release: true); + } + + NSXMLDTD initWithContentsOfURL_options_error_( + NSURL? url, int mask, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_973( + _id, + _lib._sel_initWithContentsOfURL_options_error_1, + url?._id ?? ffi.nullptr, + mask, + error); + return NSXMLDTD._(_ret, _lib, retain: true, release: true); + } + + NSXMLDTD initWithData_options_error_( + NSData? data, int mask, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_974( + _id, + _lib._sel_initWithData_options_error_1, + data?._id ?? ffi.nullptr, + mask, + error); + return NSXMLDTD._(_ret, _lib, retain: true, release: true); + } + + NSString? get publicID { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_publicID1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set publicID(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPublicID_1, value?._id ?? ffi.nullptr); + } + + NSString? get systemID { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_systemID1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set systemID(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setSystemID_1, value?._id ?? ffi.nullptr); + } + + void insertChild_atIndex_(NSXMLNode? child, int index) { + return _lib._objc_msgSend_977( + _id, _lib._sel_insertChild_atIndex_1, child?._id ?? ffi.nullptr, index); + } + + void insertChildren_atIndex_(NSArray? children, int index) { + return _lib._objc_msgSend_978(_id, _lib._sel_insertChildren_atIndex_1, + children?._id ?? ffi.nullptr, index); + } + + void removeChildAtIndex_(int index) { + return _lib._objc_msgSend_410(_id, _lib._sel_removeChildAtIndex_1, index); + } + + void setChildren_(NSArray? children) { + return _lib._objc_msgSend_412( + _id, _lib._sel_setChildren_1, children?._id ?? ffi.nullptr); + } + + void addChild_(NSXMLNode? child) { + return _lib._objc_msgSend_979( + _id, _lib._sel_addChild_1, child?._id ?? ffi.nullptr); + } + + void replaceChildAtIndex_withNode_(int index, NSXMLNode? node) { + return _lib._objc_msgSend_980(_id, _lib._sel_replaceChildAtIndex_withNode_1, + index, node?._id ?? ffi.nullptr); + } + + NSXMLDTDNode entityDeclarationForName_(NSString? name) { + final _ret = _lib._objc_msgSend_984( + _id, _lib._sel_entityDeclarationForName_1, name?._id ?? ffi.nullptr); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLDTDNode notationDeclarationForName_(NSString? name) { + final _ret = _lib._objc_msgSend_984( + _id, _lib._sel_notationDeclarationForName_1, name?._id ?? ffi.nullptr); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLDTDNode elementDeclarationForName_(NSString? name) { + final _ret = _lib._objc_msgSend_984( + _id, _lib._sel_elementDeclarationForName_1, name?._id ?? ffi.nullptr); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLDTDNode attributeDeclarationForName_elementName_( + NSString? name, NSString? elementName) { + final _ret = _lib._objc_msgSend_985( + _id, + _lib._sel_attributeDeclarationForName_elementName_1, + name?._id ?? ffi.nullptr, + elementName?._id ?? ffi.nullptr); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + static NSXMLDTDNode predefinedEntityDeclarationForName_( + AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_984( + _lib._class_NSXMLDTD1, + _lib._sel_predefinedEntityDeclarationForName_1, + name?._id ?? ffi.nullptr); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + static NSObject document(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLDTD1, _lib._sel_document1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject documentWithRootElement_( + AVFAudio _lib, NSXMLElement? element) { + final _ret = _lib._objc_msgSend_968(_lib._class_NSXMLDTD1, + _lib._sel_documentWithRootElement_1, element?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_(AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTD1, + _lib._sel_elementWithName_1, name?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_URI_( + AVFAudio _lib, NSString? name, NSString? URI) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDTD1, + _lib._sel_elementWithName_URI_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_stringValue_( + AVFAudio _lib, NSString? name, NSString? string) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDTD1, + _lib._sel_elementWithName_stringValue_1, + name?._id ?? ffi.nullptr, + string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_children_attributes_( + AVFAudio _lib, NSString? name, NSArray? children, NSArray? attributes) { + final _ret = _lib._objc_msgSend_969( + _lib._class_NSXMLDTD1, + _lib._sel_elementWithName_children_attributes_1, + name?._id ?? ffi.nullptr, + children?._id ?? ffi.nullptr, + attributes?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_stringValue_( + AVFAudio _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDTD1, + _lib._sel_attributeWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_URI_stringValue_( + AVFAudio _lib, NSString? name, NSString? URI, NSString? stringValue) { + final _ret = _lib._objc_msgSend_26( + _lib._class_NSXMLDTD1, + _lib._sel_attributeWithName_URI_stringValue_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject namespaceWithName_stringValue_( + AVFAudio _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDTD1, + _lib._sel_namespaceWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject processingInstructionWithName_stringValue_( + AVFAudio _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDTD1, + _lib._sel_processingInstructionWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject commentWithStringValue_( + AVFAudio _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTD1, + _lib._sel_commentWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject textWithStringValue_(AVFAudio _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTD1, + _lib._sel_textWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject DTDNodeWithXMLString_(AVFAudio _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTD1, + _lib._sel_DTDNodeWithXMLString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSString localNameForName_(AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLDTD1, + _lib._sel_localNameForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString prefixForName_(AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLDTD1, + _lib._sel_prefixForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSXMLNode predefinedNamespaceForPrefix_( + AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_983(_lib._class_NSXMLDTD1, + _lib._sel_predefinedNamespaceForPrefix_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + static NSXMLDTD new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSXMLDTD1, _lib._sel_new1); + return NSXMLDTD._(_ret, _lib, retain: false, release: true); + } + + static NSXMLDTD alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSXMLDTD1, _lib._sel_alloc1); + return NSXMLDTD._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSXMLDTD1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSXMLDTD1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLDTD1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLDTD1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSXMLDTD1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSXMLDTD1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSXMLDTD1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSXMLDTD1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSXMLDTD1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSXMLDTDNode extends NSXMLNode { + NSXMLDTDNode._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSXMLDTDNode] that points to the same underlying object as [other]. + static NSXMLDTDNode castFrom(T other) { + return NSXMLDTDNode._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSXMLDTDNode] that wraps the given raw object pointer. + static NSXMLDTDNode castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSXMLDTDNode._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSXMLDTDNode]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLDTDNode1); + } + + NSXMLDTDNode initWithXMLString_(NSString? string) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithXMLString_1, string?._id ?? ffi.nullptr); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + @override + NSXMLDTDNode initWithKind_options_(int kind, int options) { + final _ret = _lib._objc_msgSend_967( + _id, _lib._sel_initWithKind_options_1, kind, options); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + @override + NSXMLDTDNode init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + int get DTDKind { + return _lib._objc_msgSend_981(_id, _lib._sel_DTDKind1); + } + + set DTDKind(int value) { + _lib._objc_msgSend_982(_id, _lib._sel_setDTDKind_1, value); + } + + bool get external1 { + return _lib._objc_msgSend_12(_id, _lib._sel_isExternal1); + } + + NSString? get publicID { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_publicID1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set publicID(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPublicID_1, value?._id ?? ffi.nullptr); + } + + NSString? get systemID { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_systemID1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set systemID(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setSystemID_1, value?._id ?? ffi.nullptr); + } + + NSString? get notationName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_notationName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set notationName(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setNotationName_1, value?._id ?? ffi.nullptr); + } + + static NSObject document(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLDTDNode1, _lib._sel_document1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject documentWithRootElement_( + AVFAudio _lib, NSXMLElement? element) { + final _ret = _lib._objc_msgSend_968(_lib._class_NSXMLDTDNode1, + _lib._sel_documentWithRootElement_1, element?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_(AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTDNode1, + _lib._sel_elementWithName_1, name?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_URI_( + AVFAudio _lib, NSString? name, NSString? URI) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDTDNode1, + _lib._sel_elementWithName_URI_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_stringValue_( + AVFAudio _lib, NSString? name, NSString? string) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDTDNode1, + _lib._sel_elementWithName_stringValue_1, + name?._id ?? ffi.nullptr, + string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_children_attributes_( + AVFAudio _lib, NSString? name, NSArray? children, NSArray? attributes) { + final _ret = _lib._objc_msgSend_969( + _lib._class_NSXMLDTDNode1, + _lib._sel_elementWithName_children_attributes_1, + name?._id ?? ffi.nullptr, + children?._id ?? ffi.nullptr, + attributes?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_stringValue_( + AVFAudio _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDTDNode1, + _lib._sel_attributeWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_URI_stringValue_( + AVFAudio _lib, NSString? name, NSString? URI, NSString? stringValue) { + final _ret = _lib._objc_msgSend_26( + _lib._class_NSXMLDTDNode1, + _lib._sel_attributeWithName_URI_stringValue_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject namespaceWithName_stringValue_( + AVFAudio _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDTDNode1, + _lib._sel_namespaceWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject processingInstructionWithName_stringValue_( + AVFAudio _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDTDNode1, + _lib._sel_processingInstructionWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject commentWithStringValue_( + AVFAudio _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTDNode1, + _lib._sel_commentWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject textWithStringValue_(AVFAudio _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTDNode1, + _lib._sel_textWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject DTDNodeWithXMLString_(AVFAudio _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTDNode1, + _lib._sel_DTDNodeWithXMLString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSString localNameForName_(AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLDTDNode1, + _lib._sel_localNameForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString prefixForName_(AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLDTDNode1, + _lib._sel_prefixForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSXMLNode predefinedNamespaceForPrefix_( + AVFAudio _lib, NSString? name) { + final _ret = _lib._objc_msgSend_983(_lib._class_NSXMLDTDNode1, + _lib._sel_predefinedNamespaceForPrefix_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + static NSXMLDTDNode new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLDTDNode1, _lib._sel_new1); + return NSXMLDTDNode._(_ret, _lib, retain: false, release: true); + } + + static NSXMLDTDNode alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLDTDNode1, _lib._sel_alloc1); + return NSXMLDTDNode._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSXMLDTDNode1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSXMLDTDNode1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLDTDNode1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLDTDNode1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSXMLDTDNode1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSXMLDTDNode1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSXMLDTDNode1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSXMLDTDNode1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSXMLDTDNode1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSXMLDTDNodeKind { + static const int NSXMLEntityGeneralKind = 1; + static const int NSXMLEntityParsedKind = 2; + static const int NSXMLEntityUnparsedKind = 3; + static const int NSXMLEntityParameterKind = 4; + static const int NSXMLEntityPredefined = 5; + static const int NSXMLAttributeCDATAKind = 6; + static const int NSXMLAttributeIDKind = 7; + static const int NSXMLAttributeIDRefKind = 8; + static const int NSXMLAttributeIDRefsKind = 9; + static const int NSXMLAttributeEntityKind = 10; + static const int NSXMLAttributeEntitiesKind = 11; + static const int NSXMLAttributeNMTokenKind = 12; + static const int NSXMLAttributeNMTokensKind = 13; + static const int NSXMLAttributeEnumerationKind = 14; + static const int NSXMLAttributeNotationKind = 15; + static const int NSXMLElementDeclarationUndefinedKind = 16; + static const int NSXMLElementDeclarationEmptyKind = 17; + static const int NSXMLElementDeclarationAnyKind = 18; + static const int NSXMLElementDeclarationMixedKind = 19; + static const int NSXMLElementDeclarationElementKind = 20; +} + +class AVAudioSession extends NSObject { + AVAudioSession._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [AVAudioSession] that points to the same underlying object as [other]. + static AVAudioSession castFrom(T other) { + return AVAudioSession._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [AVAudioSession] that wraps the given raw object pointer. + static AVAudioSession castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return AVAudioSession._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [AVAudioSession]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_AVAudioSession1); + } + + static AVAudioSession sharedInstance(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_1001( + _lib._class_AVAudioSession1, _lib._sel_sharedInstance1); + return AVAudioSession._(_ret, _lib, retain: true, release: true); + } + + NSArray? get availableCategories { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_availableCategories1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + bool setCategory_error_(AVAudioSessionCategory category, + ffi.Pointer> outError) { + return _lib._objc_msgSend_398( + _id, _lib._sel_setCategory_error_1, category, outError); + } + + bool setCategory_withOptions_error_(AVAudioSessionCategory category, + int options, ffi.Pointer> outError) { + return _lib._objc_msgSend_1002(_id, + _lib._sel_setCategory_withOptions_error_1, category, options, outError); + } + + bool setCategory_mode_options_error_( + AVAudioSessionCategory category, + AVAudioSessionMode mode, + int options, + ffi.Pointer> outError) { + return _lib._objc_msgSend_1003( + _id, + _lib._sel_setCategory_mode_options_error_1, + category, + mode, + options, + outError); + } + + bool setCategory_mode_routeSharingPolicy_options_error_( + AVAudioSessionCategory category, + AVAudioSessionMode mode, + int policy, + int options, + ffi.Pointer> outError) { + return _lib._objc_msgSend_1004( + _id, + _lib._sel_setCategory_mode_routeSharingPolicy_options_error_1, + category, + mode, + policy, + options, + outError); + } + + AVAudioSessionCategory get category { + return _lib._objc_msgSend_20(_id, _lib._sel_category1); + } + + int get categoryOptions { + return _lib._objc_msgSend_1005(_id, _lib._sel_categoryOptions1); + } + + int get routeSharingPolicy { + return _lib._objc_msgSend_1006(_id, _lib._sel_routeSharingPolicy1); + } + + NSArray? get availableModes { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_availableModes1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + bool setMode_error_( + AVAudioSessionMode mode, ffi.Pointer> outError) { + return _lib._objc_msgSend_398( + _id, _lib._sel_setMode_error_1, mode, outError); + } + + AVAudioSessionMode get mode { + return _lib._objc_msgSend_20(_id, _lib._sel_mode1); + } + + bool setAllowHapticsAndSystemSoundsDuringRecording_error_( + bool inValue, ffi.Pointer> outError) { + return _lib._objc_msgSend_1007( + _id, + _lib._sel_setAllowHapticsAndSystemSoundsDuringRecording_error_1, + inValue, + outError); + } + + bool get allowHapticsAndSystemSoundsDuringRecording { + return _lib._objc_msgSend_12( + _id, _lib._sel_allowHapticsAndSystemSoundsDuringRecording1); + } + + int get recordPermission { + return _lib._objc_msgSend_1008(_id, _lib._sel_recordPermission1); + } + + void requestRecordPermission_(ObjCBlock31 response) { + return _lib._objc_msgSend_1009( + _id, _lib._sel_requestRecordPermission_1, response._impl); + } + + bool overrideOutputAudioPort_error_( + int portOverride, ffi.Pointer> outError) { + return _lib._objc_msgSend_1010( + _id, _lib._sel_overrideOutputAudioPort_error_1, portOverride, outError); + } + + bool setPreferredInput_error_(AVAudioSessionPortDescription? inPort, + ffi.Pointer> outError) { + return _lib._objc_msgSend_1013(_id, _lib._sel_setPreferredInput_error_1, + inPort?._id ?? ffi.nullptr, outError); + } + + AVAudioSessionPortDescription? get preferredInput { + final _ret = _lib._objc_msgSend_1014(_id, _lib._sel_preferredInput1); + return _ret.address == 0 + ? null + : AVAudioSessionPortDescription._(_ret, _lib, + retain: true, release: true); + } + + bool setPrefersNoInterruptionsFromSystemAlerts_error_( + bool inValue, ffi.Pointer> outError) { + return _lib._objc_msgSend_1007( + _id, + _lib._sel_setPrefersNoInterruptionsFromSystemAlerts_error_1, + inValue, + outError); + } + + bool get prefersNoInterruptionsFromSystemAlerts { + return _lib._objc_msgSend_12( + _id, _lib._sel_prefersNoInterruptionsFromSystemAlerts1); + } + + bool setActive_error_( + bool active, ffi.Pointer> outError) { + return _lib._objc_msgSend_1007( + _id, _lib._sel_setActive_error_1, active, outError); + } + + bool setActive_withOptions_error_( + bool active, int options, ffi.Pointer> outError) { + return _lib._objc_msgSend_1015(_id, _lib._sel_setActive_withOptions_error_1, + active, options, outError); + } + + void activateWithOptions_completionHandler_( + int options, ObjCBlock44 handler) { + return _lib._objc_msgSend_1016( + _id, + _lib._sel_activateWithOptions_completionHandler_1, + options, + handler._impl); + } + + bool setPreferredSampleRate_error_( + double sampleRate, ffi.Pointer> outError) { + return _lib._objc_msgSend_1017( + _id, _lib._sel_setPreferredSampleRate_error_1, sampleRate, outError); + } + + double get preferredSampleRate { + return _lib._objc_msgSend_149(_id, _lib._sel_preferredSampleRate1); + } + + bool setPreferredIOBufferDuration_error_( + double duration, ffi.Pointer> outError) { + return _lib._objc_msgSend_1017(_id, + _lib._sel_setPreferredIOBufferDuration_error_1, duration, outError); + } + + double get preferredIOBufferDuration { + return _lib._objc_msgSend_149(_id, _lib._sel_preferredIOBufferDuration1); + } + + bool setPreferredInputNumberOfChannels_error_( + int count, ffi.Pointer> outError) { + return _lib._objc_msgSend_1018(_id, + _lib._sel_setPreferredInputNumberOfChannels_error_1, count, outError); + } + + int get preferredInputNumberOfChannels { + return _lib._objc_msgSend_78( + _id, _lib._sel_preferredInputNumberOfChannels1); + } + + bool setPreferredOutputNumberOfChannels_error_( + int count, ffi.Pointer> outError) { + return _lib._objc_msgSend_1018(_id, + _lib._sel_setPreferredOutputNumberOfChannels_error_1, count, outError); + } + + int get preferredOutputNumberOfChannels { + return _lib._objc_msgSend_78( + _id, _lib._sel_preferredOutputNumberOfChannels1); + } + + bool setPreferredInputOrientation_error_( + int orientation, ffi.Pointer> outError) { + return _lib._objc_msgSend_1019(_id, + _lib._sel_setPreferredInputOrientation_error_1, orientation, outError); + } + + int get preferredInputOrientation { + return _lib._objc_msgSend_1020(_id, _lib._sel_preferredInputOrientation1); + } + + int get inputOrientation { + return _lib._objc_msgSend_1020(_id, _lib._sel_inputOrientation1); + } + + int get maximumInputNumberOfChannels { + return _lib._objc_msgSend_78(_id, _lib._sel_maximumInputNumberOfChannels1); + } + + int get maximumOutputNumberOfChannels { + return _lib._objc_msgSend_78(_id, _lib._sel_maximumOutputNumberOfChannels1); + } + + bool setInputGain_error_( + double gain, ffi.Pointer> outError) { + return _lib._objc_msgSend_1021( + _id, _lib._sel_setInputGain_error_1, gain, outError); + } + + double get inputGain { + return _lib._objc_msgSend_215(_id, _lib._sel_inputGain1); + } + + bool get inputGainSettable { + return _lib._objc_msgSend_12(_id, _lib._sel_isInputGainSettable1); + } + + bool get inputAvailable { + return _lib._objc_msgSend_12(_id, _lib._sel_isInputAvailable1); + } + + NSArray? get inputDataSources { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_inputDataSources1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + AVAudioSessionDataSourceDescription? get inputDataSource { + final _ret = _lib._objc_msgSend_1011(_id, _lib._sel_inputDataSource1); + return _ret.address == 0 + ? null + : AVAudioSessionDataSourceDescription._(_ret, _lib, + retain: true, release: true); + } + + bool setInputDataSource_error_( + AVAudioSessionDataSourceDescription? dataSource, + ffi.Pointer> outError) { + return _lib._objc_msgSend_1012(_id, _lib._sel_setInputDataSource_error_1, + dataSource?._id ?? ffi.nullptr, outError); + } + + NSArray? get outputDataSources { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_outputDataSources1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + AVAudioSessionDataSourceDescription? get outputDataSource { + final _ret = _lib._objc_msgSend_1011(_id, _lib._sel_outputDataSource1); + return _ret.address == 0 + ? null + : AVAudioSessionDataSourceDescription._(_ret, _lib, + retain: true, release: true); + } + + bool setOutputDataSource_error_( + AVAudioSessionDataSourceDescription? dataSource, + ffi.Pointer> outError) { + return _lib._objc_msgSend_1012(_id, _lib._sel_setOutputDataSource_error_1, + dataSource?._id ?? ffi.nullptr, outError); + } + + double get sampleRate { + return _lib._objc_msgSend_149(_id, _lib._sel_sampleRate1); + } + + int get inputNumberOfChannels { + return _lib._objc_msgSend_78(_id, _lib._sel_inputNumberOfChannels1); + } + + int get outputNumberOfChannels { + return _lib._objc_msgSend_78(_id, _lib._sel_outputNumberOfChannels1); + } + + double get inputLatency { + return _lib._objc_msgSend_149(_id, _lib._sel_inputLatency1); + } + + double get outputLatency { + return _lib._objc_msgSend_149(_id, _lib._sel_outputLatency1); + } + + double get IOBufferDuration { + return _lib._objc_msgSend_149(_id, _lib._sel_IOBufferDuration1); + } + + bool get otherAudioPlaying { + return _lib._objc_msgSend_12(_id, _lib._sel_isOtherAudioPlaying1); + } + + bool get secondaryAudioShouldBeSilencedHint { + return _lib._objc_msgSend_12( + _id, _lib._sel_secondaryAudioShouldBeSilencedHint1); + } + + double get outputVolume { + return _lib._objc_msgSend_215(_id, _lib._sel_outputVolume1); + } + + int get promptStyle { + return _lib._objc_msgSend_1022(_id, _lib._sel_promptStyle1); + } + + NSArray? get availableInputs { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_availableInputs1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + AVAudioSessionRouteDescription? get currentRoute { + final _ret = _lib._objc_msgSend_1023(_id, _lib._sel_currentRoute1); + return _ret.address == 0 + ? null + : AVAudioSessionRouteDescription._(_ret, _lib, + retain: true, release: true); + } + + bool setAggregatedIOPreference_error_( + int inIOType, ffi.Pointer> outError) { + return _lib._objc_msgSend_1024( + _id, _lib._sel_setAggregatedIOPreference_error_1, inIOType, outError); + } + + bool setSupportsMultichannelContent_error_( + bool inValue, ffi.Pointer> outError) { + return _lib._objc_msgSend_1007(_id, + _lib._sel_setSupportsMultichannelContent_error_1, inValue, outError); + } + + bool get supportsMultichannelContent { + return _lib._objc_msgSend_12(_id, _lib._sel_supportsMultichannelContent1); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + _lib._objc_msgSend_368( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + @override + AVAudioSession init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return AVAudioSession._(_ret, _lib, retain: true, release: true); + } + + bool setActive_withFlags_error_( + bool active, int flags, ffi.Pointer> outError) { + return _lib._objc_msgSend_1025( + _id, _lib._sel_setActive_withFlags_error_1, active, flags, outError); + } + + bool get inputIsAvailable { + return _lib._objc_msgSend_12(_id, _lib._sel_inputIsAvailable1); + } + + double get currentHardwareSampleRate { + return _lib._objc_msgSend_149(_id, _lib._sel_currentHardwareSampleRate1); + } + + int get currentHardwareInputNumberOfChannels { + return _lib._objc_msgSend_78( + _id, _lib._sel_currentHardwareInputNumberOfChannels1); + } + + int get currentHardwareOutputNumberOfChannels { + return _lib._objc_msgSend_78( + _id, _lib._sel_currentHardwareOutputNumberOfChannels1); + } + + bool setPreferredHardwareSampleRate_error_( + double sampleRate, ffi.Pointer> outError) { + return _lib._objc_msgSend_1017(_id, + _lib._sel_setPreferredHardwareSampleRate_error_1, sampleRate, outError); + } + + double get preferredHardwareSampleRate { + return _lib._objc_msgSend_149(_id, _lib._sel_preferredHardwareSampleRate1); + } + + static AVAudioSession new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_AVAudioSession1, _lib._sel_new1); + return AVAudioSession._(_ret, _lib, retain: false, release: true); + } + + static AVAudioSession alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_AVAudioSession1, _lib._sel_alloc1); + return AVAudioSession._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_AVAudioSession1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_AVAudioSession1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_AVAudioSession1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_AVAudioSession1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_AVAudioSession1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_AVAudioSession1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_AVAudioSession1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_AVAudioSession1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_AVAudioSession1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef AVAudioSessionCategory = ffi.Pointer; + +abstract class AVAudioSessionCategoryOptions { + static const int AVAudioSessionCategoryOptionMixWithOthers = 1; + static const int AVAudioSessionCategoryOptionDuckOthers = 2; + static const int AVAudioSessionCategoryOptionAllowBluetooth = 4; + static const int AVAudioSessionCategoryOptionDefaultToSpeaker = 8; + static const int + AVAudioSessionCategoryOptionInterruptSpokenAudioAndMixWithOthers = 17; + static const int AVAudioSessionCategoryOptionAllowBluetoothA2DP = 32; + static const int AVAudioSessionCategoryOptionAllowAirPlay = 64; + static const int + AVAudioSessionCategoryOptionOverrideMutedMicrophoneInterruption = 128; +} + +typedef AVAudioSessionMode = ffi.Pointer; + +abstract class AVAudioSessionRouteSharingPolicy { + static const int AVAudioSessionRouteSharingPolicyDefault = 0; + static const int AVAudioSessionRouteSharingPolicyLongFormAudio = 1; + static const int AVAudioSessionRouteSharingPolicyLongForm = 1; + static const int AVAudioSessionRouteSharingPolicyIndependent = 2; + static const int AVAudioSessionRouteSharingPolicyLongFormVideo = 3; +} + +abstract class AVAudioSessionRecordPermission { + static const int AVAudioSessionRecordPermissionUndetermined = 1970168948; + static const int AVAudioSessionRecordPermissionDenied = 1684369017; + static const int AVAudioSessionRecordPermissionGranted = 1735552628; +} + +abstract class AVAudioSessionPortOverride { + static const int AVAudioSessionPortOverrideNone = 0; + static const int AVAudioSessionPortOverrideSpeaker = 1936747378; +} + +class AVAudioSessionPortDescription extends NSObject { + AVAudioSessionPortDescription._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [AVAudioSessionPortDescription] that points to the same underlying object as [other]. + static AVAudioSessionPortDescription castFrom( + T other) { + return AVAudioSessionPortDescription._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [AVAudioSessionPortDescription] that wraps the given raw object pointer. + static AVAudioSessionPortDescription castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return AVAudioSessionPortDescription._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [AVAudioSessionPortDescription]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_AVAudioSessionPortDescription1); + } + + AVAudioSessionPort get portType { + return _lib._objc_msgSend_20(_id, _lib._sel_portType1); + } + + NSString? get portName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_portName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get UID { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_UID1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool get hasHardwareVoiceCallProcessing { + return _lib._objc_msgSend_12( + _id, _lib._sel_hasHardwareVoiceCallProcessing1); + } + + bool get spatialAudioEnabled { + return _lib._objc_msgSend_12(_id, _lib._sel_isSpatialAudioEnabled1); + } + + NSArray? get channels { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_channels1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get dataSources { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_dataSources1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + AVAudioSessionDataSourceDescription? get selectedDataSource { + final _ret = _lib._objc_msgSend_1011(_id, _lib._sel_selectedDataSource1); + return _ret.address == 0 + ? null + : AVAudioSessionDataSourceDescription._(_ret, _lib, + retain: true, release: true); + } + + AVAudioSessionDataSourceDescription? get preferredDataSource { + final _ret = _lib._objc_msgSend_1011(_id, _lib._sel_preferredDataSource1); + return _ret.address == 0 + ? null + : AVAudioSessionDataSourceDescription._(_ret, _lib, + retain: true, release: true); + } + + bool setPreferredDataSource_error_( + AVAudioSessionDataSourceDescription? dataSource, + ffi.Pointer> outError) { + return _lib._objc_msgSend_1012( + _id, + _lib._sel_setPreferredDataSource_error_1, + dataSource?._id ?? ffi.nullptr, + outError); + } + + static AVAudioSessionPortDescription new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_AVAudioSessionPortDescription1, _lib._sel_new1); + return AVAudioSessionPortDescription._(_ret, _lib, + retain: false, release: true); + } + + static AVAudioSessionPortDescription alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_AVAudioSessionPortDescription1, _lib._sel_alloc1); + return AVAudioSessionPortDescription._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_AVAudioSessionPortDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_AVAudioSessionPortDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_AVAudioSessionPortDescription1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_AVAudioSessionPortDescription1, + _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_AVAudioSessionPortDescription1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_AVAudioSessionPortDescription1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_AVAudioSessionPortDescription1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_AVAudioSessionPortDescription1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_AVAudioSessionPortDescription1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef AVAudioSessionPort = ffi.Pointer; + +class AVAudioSessionDataSourceDescription extends NSObject { + AVAudioSessionDataSourceDescription._( + ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [AVAudioSessionDataSourceDescription] that points to the same underlying object as [other]. + static AVAudioSessionDataSourceDescription castFrom( + T other) { + return AVAudioSessionDataSourceDescription._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [AVAudioSessionDataSourceDescription] that wraps the given raw object pointer. + static AVAudioSessionDataSourceDescription castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return AVAudioSessionDataSourceDescription._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [AVAudioSessionDataSourceDescription]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_AVAudioSessionDataSourceDescription1); + } + + NSNumber? get dataSourceID { + final _ret = _lib._objc_msgSend_192(_id, _lib._sel_dataSourceID1); + return _ret.address == 0 + ? null + : NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSString? get dataSourceName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_dataSourceName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + AVAudioSessionLocation get location { + return _lib._objc_msgSend_20(_id, _lib._sel_location1); + } + + AVAudioSessionOrientation get orientation { + return _lib._objc_msgSend_20(_id, _lib._sel_orientation1); + } + + NSArray? get supportedPolarPatterns { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_supportedPolarPatterns1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + AVAudioSessionPolarPattern get selectedPolarPattern { + return _lib._objc_msgSend_20(_id, _lib._sel_selectedPolarPattern1); + } + + AVAudioSessionPolarPattern get preferredPolarPattern { + return _lib._objc_msgSend_20(_id, _lib._sel_preferredPolarPattern1); + } + + bool setPreferredPolarPattern_error_(AVAudioSessionPolarPattern pattern, + ffi.Pointer> outError) { + return _lib._objc_msgSend_398( + _id, _lib._sel_setPreferredPolarPattern_error_1, pattern, outError); + } + + static AVAudioSessionDataSourceDescription new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_AVAudioSessionDataSourceDescription1, _lib._sel_new1); + return AVAudioSessionDataSourceDescription._(_ret, _lib, + retain: false, release: true); + } + + static AVAudioSessionDataSourceDescription alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_AVAudioSessionDataSourceDescription1, _lib._sel_alloc1); + return AVAudioSessionDataSourceDescription._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_AVAudioSessionDataSourceDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15( + _lib._class_AVAudioSessionDataSourceDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, + aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_AVAudioSessionDataSourceDescription1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_AVAudioSessionDataSourceDescription1, + _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_AVAudioSessionDataSourceDescription1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_AVAudioSessionDataSourceDescription1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_AVAudioSessionDataSourceDescription1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_AVAudioSessionDataSourceDescription1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_AVAudioSessionDataSourceDescription1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef AVAudioSessionLocation = ffi.Pointer; +typedef AVAudioSessionOrientation = ffi.Pointer; +typedef AVAudioSessionPolarPattern = ffi.Pointer; + +abstract class AVAudioSessionSetActiveOptions { + static const int AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation = 1; +} + +abstract class AVAudioSessionActivationOptions { + static const int AVAudioSessionActivationOptionNone = 0; +} + +void _ObjCBlock44_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, bool arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Bool arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function(bool arg0, ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock44_closureRegistry = {}; +int _ObjCBlock44_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock44_registerClosure(Function fn) { + final id = ++_ObjCBlock44_closureRegistryIndex; + _ObjCBlock44_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock44_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, bool arg0, ffi.Pointer arg1) { + return _ObjCBlock44_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock44 { + final ffi.Pointer<_ObjCBlock> _impl; + final AVFAudio _lib; + ObjCBlock44._(this._impl, this._lib); + ObjCBlock44.fromFunctionPointer( + this._lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Bool arg0, ffi.Pointer arg1)>> + ptr) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Bool arg0, ffi.Pointer arg1)>( + _ObjCBlock44_fnPtrTrampoline) + .cast(), + ptr.cast()); + ObjCBlock44.fromFunction( + this._lib, void Function(bool arg0, ffi.Pointer arg1) fn) + : _impl = _lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Bool arg0, ffi.Pointer arg1)>( + _ObjCBlock44_closureTrampoline) + .cast(), + _ObjCBlock44_registerClosure(fn)); + void call(bool arg0, ffi.Pointer arg1) { + return _impl.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, ffi.Bool arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, bool arg0, + ffi.Pointer arg1)>()(_impl, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _impl; +} + +abstract class AVAudioStereoOrientation { + static const int AVAudioStereoOrientationNone = 0; + static const int AVAudioStereoOrientationPortrait = 1; + static const int AVAudioStereoOrientationPortraitUpsideDown = 2; + static const int AVAudioStereoOrientationLandscapeRight = 3; + static const int AVAudioStereoOrientationLandscapeLeft = 4; +} + +abstract class AVAudioSessionPromptStyle { + static const int AVAudioSessionPromptStyleNone = 1852796517; + static const int AVAudioSessionPromptStyleShort = 1936224884; + static const int AVAudioSessionPromptStyleNormal = 1852992876; +} + +class AVAudioSessionRouteDescription extends NSObject { + AVAudioSessionRouteDescription._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [AVAudioSessionRouteDescription] that points to the same underlying object as [other]. + static AVAudioSessionRouteDescription castFrom( + T other) { + return AVAudioSessionRouteDescription._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [AVAudioSessionRouteDescription] that wraps the given raw object pointer. + static AVAudioSessionRouteDescription castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return AVAudioSessionRouteDescription._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [AVAudioSessionRouteDescription]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_AVAudioSessionRouteDescription1); + } + + NSArray? get inputs { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_inputs1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get outputs { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_outputs1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static AVAudioSessionRouteDescription new1(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_AVAudioSessionRouteDescription1, _lib._sel_new1); + return AVAudioSessionRouteDescription._(_ret, _lib, + retain: false, release: true); + } + + static AVAudioSessionRouteDescription alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_AVAudioSessionRouteDescription1, _lib._sel_alloc1); + return AVAudioSessionRouteDescription._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_AVAudioSessionRouteDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_AVAudioSessionRouteDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_AVAudioSessionRouteDescription1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_AVAudioSessionRouteDescription1, + _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_AVAudioSessionRouteDescription1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_AVAudioSessionRouteDescription1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_AVAudioSessionRouteDescription1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_AVAudioSessionRouteDescription1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_AVAudioSessionRouteDescription1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class AVAudioSessionIOType { + static const int AVAudioSessionIOTypeNotSpecified = 0; + static const int AVAudioSessionIOTypeAggregated = 1; +} + +class AVAudioPlayer extends NSObject { + AVAudioPlayer._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [AVAudioPlayer] that points to the same underlying object as [other]. + static AVAudioPlayer castFrom(T other) { + return AVAudioPlayer._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [AVAudioPlayer] that wraps the given raw object pointer. + static AVAudioPlayer castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return AVAudioPlayer._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [AVAudioPlayer]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_AVAudioPlayer1); + } + + AVAudioPlayer initWithContentsOfURL_error_( + NSURL? url, ffi.Pointer> outError) { + final _ret = _lib._objc_msgSend_734( + _id, + _lib._sel_initWithContentsOfURL_error_1, + url?._id ?? ffi.nullptr, + outError); + return AVAudioPlayer._(_ret, _lib, retain: true, release: true); + } + + AVAudioPlayer initWithData_error_( + NSData? data, ffi.Pointer> outError) { + final _ret = _lib._objc_msgSend_1026(_id, _lib._sel_initWithData_error_1, + data?._id ?? ffi.nullptr, outError); + return AVAudioPlayer._(_ret, _lib, retain: true, release: true); + } + + AVAudioPlayer initWithContentsOfURL_fileTypeHint_error_(NSURL? url, + NSString? utiString, ffi.Pointer> outError) { + final _ret = _lib._objc_msgSend_1027( + _id, + _lib._sel_initWithContentsOfURL_fileTypeHint_error_1, + url?._id ?? ffi.nullptr, + utiString?._id ?? ffi.nullptr, + outError); + return AVAudioPlayer._(_ret, _lib, retain: true, release: true); + } + + AVAudioPlayer initWithData_fileTypeHint_error_(NSData? data, + NSString? utiString, ffi.Pointer> outError) { + final _ret = _lib._objc_msgSend_1028( + _id, + _lib._sel_initWithData_fileTypeHint_error_1, + data?._id ?? ffi.nullptr, + utiString?._id ?? ffi.nullptr, + outError); + return AVAudioPlayer._(_ret, _lib, retain: true, release: true); + } + + bool prepareToPlay() { + return _lib._objc_msgSend_12(_id, _lib._sel_prepareToPlay1); + } + + bool play() { + return _lib._objc_msgSend_12(_id, _lib._sel_play1); + } + + bool playAtTime_(double time) { + return _lib._objc_msgSend_1029(_id, _lib._sel_playAtTime_1, time); + } + + void pause() { + return _lib._objc_msgSend_1(_id, _lib._sel_pause1); + } + + void stop() { + return _lib._objc_msgSend_1(_id, _lib._sel_stop1); + } + + bool get playing { + return _lib._objc_msgSend_12(_id, _lib._sel_isPlaying1); + } + + int get numberOfChannels { + return _lib._objc_msgSend_10(_id, _lib._sel_numberOfChannels1); + } + + double get duration { + return _lib._objc_msgSend_149(_id, _lib._sel_duration1); + } + + NSString? get currentDevice { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_currentDevice1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set currentDevice(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setCurrentDevice_1, value?._id ?? ffi.nullptr); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + _lib._objc_msgSend_368( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + NSURL? get url { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_url1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSData? get data { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_data1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + double get pan { + return _lib._objc_msgSend_215(_id, _lib._sel_pan1); + } + + set pan(double value) { + _lib._objc_msgSend_765(_id, _lib._sel_setPan_1, value); + } + + double get volume { + return _lib._objc_msgSend_215(_id, _lib._sel_volume1); + } + + set volume(double value) { + _lib._objc_msgSend_765(_id, _lib._sel_setVolume_1, value); + } + + void setVolume_fadeDuration_(double volume, double duration) { + return _lib._objc_msgSend_1030( + _id, _lib._sel_setVolume_fadeDuration_1, volume, duration); + } + + bool get enableRate { + return _lib._objc_msgSend_12(_id, _lib._sel_enableRate1); + } + + set enableRate(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setEnableRate_1, value); + } + + double get rate { + return _lib._objc_msgSend_215(_id, _lib._sel_rate1); + } + + set rate(double value) { + _lib._objc_msgSend_765(_id, _lib._sel_setRate_1, value); + } + + double get currentTime { + return _lib._objc_msgSend_149(_id, _lib._sel_currentTime1); + } + + set currentTime(double value) { + _lib._objc_msgSend_474(_id, _lib._sel_setCurrentTime_1, value); + } + + double get deviceCurrentTime { + return _lib._objc_msgSend_149(_id, _lib._sel_deviceCurrentTime1); + } + + int get numberOfLoops { + return _lib._objc_msgSend_78(_id, _lib._sel_numberOfLoops1); + } + + set numberOfLoops(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setNumberOfLoops_1, value); + } + + NSDictionary? get settings { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_settings1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + AVAudioFormat? get format { + final _ret = _lib._objc_msgSend_1046(_id, _lib._sel_format1); + return _ret.address == 0 + ? null + : AVAudioFormat._(_ret, _lib, retain: true, release: true); + } + + bool get meteringEnabled { + return _lib._objc_msgSend_12(_id, _lib._sel_isMeteringEnabled1); + } + + set meteringEnabled(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setMeteringEnabled_1, value); + } + + void updateMeters() { + return _lib._objc_msgSend_1(_id, _lib._sel_updateMeters1); + } + + double peakPowerForChannel_(int channelNumber) { + return _lib._objc_msgSend_1047( + _id, _lib._sel_peakPowerForChannel_1, channelNumber); + } + + double averagePowerForChannel_(int channelNumber) { + return _lib._objc_msgSend_1047( + _id, _lib._sel_averagePowerForChannel_1, channelNumber); + } + + NSArray? get channelAssignments { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_channelAssignments1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set channelAssignments(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setChannelAssignments_1, value?._id ?? ffi.nullptr); + } + + static AVAudioPlayer new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_AVAudioPlayer1, _lib._sel_new1); + return AVAudioPlayer._(_ret, _lib, retain: false, release: true); + } + + static AVAudioPlayer alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_AVAudioPlayer1, _lib._sel_alloc1); + return AVAudioPlayer._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_AVAudioPlayer1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_AVAudioPlayer1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_AVAudioPlayer1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_AVAudioPlayer1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_AVAudioPlayer1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_AVAudioPlayer1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_AVAudioPlayer1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_AVAudioPlayer1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_AVAudioPlayer1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class AVAudioFormat extends NSObject { + AVAudioFormat._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [AVAudioFormat] that points to the same underlying object as [other]. + static AVAudioFormat castFrom(T other) { + return AVAudioFormat._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [AVAudioFormat] that wraps the given raw object pointer. + static AVAudioFormat castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return AVAudioFormat._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [AVAudioFormat]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_AVAudioFormat1); + } + + AVAudioFormat initWithStreamDescription_( + ffi.Pointer asbd) { + final _ret = _lib._objc_msgSend_1031( + _id, _lib._sel_initWithStreamDescription_1, asbd); + return AVAudioFormat._(_ret, _lib, retain: true, release: true); + } + + AVAudioFormat initWithStreamDescription_channelLayout_( + ffi.Pointer asbd, + AVAudioChannelLayout? layout) { + final _ret = _lib._objc_msgSend_1036( + _id, + _lib._sel_initWithStreamDescription_channelLayout_1, + asbd, + layout?._id ?? ffi.nullptr); + return AVAudioFormat._(_ret, _lib, retain: true, release: true); + } + + AVAudioFormat initStandardFormatWithSampleRate_channels_( + double sampleRate, int channels) { + final _ret = _lib._objc_msgSend_1037( + _id, + _lib._sel_initStandardFormatWithSampleRate_channels_1, + sampleRate, + channels); + return AVAudioFormat._(_ret, _lib, retain: true, release: true); + } + + AVAudioFormat initStandardFormatWithSampleRate_channelLayout_( + double sampleRate, AVAudioChannelLayout? layout) { + final _ret = _lib._objc_msgSend_1038( + _id, + _lib._sel_initStandardFormatWithSampleRate_channelLayout_1, + sampleRate, + layout?._id ?? ffi.nullptr); + return AVAudioFormat._(_ret, _lib, retain: true, release: true); + } + + AVAudioFormat initWithCommonFormat_sampleRate_channels_interleaved_( + int format, double sampleRate, int channels, bool interleaved) { + final _ret = _lib._objc_msgSend_1039( + _id, + _lib._sel_initWithCommonFormat_sampleRate_channels_interleaved_1, + format, + sampleRate, + channels, + interleaved); + return AVAudioFormat._(_ret, _lib, retain: true, release: true); + } + + AVAudioFormat initWithCommonFormat_sampleRate_interleaved_channelLayout_( + int format, + double sampleRate, + bool interleaved, + AVAudioChannelLayout? layout) { + final _ret = _lib._objc_msgSend_1040( + _id, + _lib._sel_initWithCommonFormat_sampleRate_interleaved_channelLayout_1, + format, + sampleRate, + interleaved, + layout?._id ?? ffi.nullptr); + return AVAudioFormat._(_ret, _lib, retain: true, release: true); + } + + AVAudioFormat initWithSettings_(NSDictionary? settings) { + final _ret = _lib._objc_msgSend_143( + _id, _lib._sel_initWithSettings_1, settings?._id ?? ffi.nullptr); + return AVAudioFormat._(_ret, _lib, retain: true, release: true); + } + + AVAudioFormat initWithCMAudioFormatDescription_( + CMAudioFormatDescriptionRef formatDescription) { + final _ret = _lib._objc_msgSend_1041( + _id, _lib._sel_initWithCMAudioFormatDescription_1, formatDescription); + return AVAudioFormat._(_ret, _lib, retain: true, release: true); + } + + bool isEqual_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_isEqual_1, object._id); + } + + bool get standard { + return _lib._objc_msgSend_12(_id, _lib._sel_isStandard1); + } + + int get commonFormat { + return _lib._objc_msgSend_1042(_id, _lib._sel_commonFormat1); + } + + int get channelCount { + return _lib._objc_msgSend_1035(_id, _lib._sel_channelCount1); + } + + double get sampleRate { + return _lib._objc_msgSend_149(_id, _lib._sel_sampleRate1); + } + + bool get interleaved { + return _lib._objc_msgSend_12(_id, _lib._sel_isInterleaved1); + } + + ffi.Pointer get streamDescription { + return _lib._objc_msgSend_1043(_id, _lib._sel_streamDescription1); + } + + AVAudioChannelLayout? get channelLayout { + final _ret = _lib._objc_msgSend_1044(_id, _lib._sel_channelLayout1); + return _ret.address == 0 + ? null + : AVAudioChannelLayout._(_ret, _lib, retain: true, release: true); + } + + NSData? get magicCookie { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_magicCookie1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + set magicCookie(NSData? value) { + _lib._objc_msgSend_892( + _id, _lib._sel_setMagicCookie_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get settings { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_settings1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + CMAudioFormatDescriptionRef get formatDescription { + return _lib._objc_msgSend_1045(_id, _lib._sel_formatDescription1); + } + + static AVAudioFormat new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_AVAudioFormat1, _lib._sel_new1); + return AVAudioFormat._(_ret, _lib, retain: false, release: true); + } + + static AVAudioFormat alloc(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_AVAudioFormat1, _lib._sel_alloc1); + return AVAudioFormat._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_AVAudioFormat1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_AVAudioFormat1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_AVAudioFormat1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_AVAudioFormat1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_AVAudioFormat1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_AVAudioFormat1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_AVAudioFormat1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_AVAudioFormat1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_AVAudioFormat1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class AudioStreamBasicDescription extends ffi.Struct { + @Float64() + external double mSampleRate; + + @AudioFormatID() + external int mFormatID; + + @AudioFormatFlags() + external int mFormatFlags; + + @UInt32() + external int mBytesPerPacket; + + @UInt32() + external int mFramesPerPacket; + + @UInt32() + external int mBytesPerFrame; + + @UInt32() + external int mChannelsPerFrame; + + @UInt32() + external int mBitsPerChannel; + + @UInt32() + external int mReserved; +} + +typedef Float64 = ffi.Double; +typedef AudioFormatID = UInt32; +typedef AudioFormatFlags = UInt32; + +class AVAudioChannelLayout extends NSObject { + AVAudioChannelLayout._(ffi.Pointer id, AVFAudio lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [AVAudioChannelLayout] that points to the same underlying object as [other]. + static AVAudioChannelLayout castFrom(T other) { + return AVAudioChannelLayout._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [AVAudioChannelLayout] that wraps the given raw object pointer. + static AVAudioChannelLayout castFromPointer( + AVFAudio lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return AVAudioChannelLayout._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [AVAudioChannelLayout]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_AVAudioChannelLayout1); + } + + @override + AVAudioChannelLayout init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return AVAudioChannelLayout._(_ret, _lib, retain: true, release: true); + } + + AVAudioChannelLayout initWithLayoutTag_(int layoutTag) { + final _ret = + _lib._objc_msgSend_1032(_id, _lib._sel_initWithLayoutTag_1, layoutTag); + return AVAudioChannelLayout._(_ret, _lib, retain: true, release: true); + } + + AVAudioChannelLayout initWithLayout_(ffi.Pointer layout) { + final _ret = + _lib._objc_msgSend_1033(_id, _lib._sel_initWithLayout_1, layout); + return AVAudioChannelLayout._(_ret, _lib, retain: true, release: true); + } + + bool isEqual_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_isEqual_1, object._id); + } + + static AVAudioChannelLayout layoutWithLayoutTag_( + AVFAudio _lib, int layoutTag) { + final _ret = _lib._objc_msgSend_1032(_lib._class_AVAudioChannelLayout1, + _lib._sel_layoutWithLayoutTag_1, layoutTag); + return AVAudioChannelLayout._(_ret, _lib, retain: true, release: true); + } + + static AVAudioChannelLayout layoutWithLayout_( + AVFAudio _lib, ffi.Pointer layout) { + final _ret = _lib._objc_msgSend_1033(_lib._class_AVAudioChannelLayout1, + _lib._sel_layoutWithLayout_1, layout); + return AVAudioChannelLayout._(_ret, _lib, retain: true, release: true); + } + + int get layoutTag { + return _lib._objc_msgSend_191(_id, _lib._sel_layoutTag1); + } + + ffi.Pointer get layout { + return _lib._objc_msgSend_1034(_id, _lib._sel_layout1); + } + + int get channelCount { + return _lib._objc_msgSend_1035(_id, _lib._sel_channelCount1); + } + + static AVAudioChannelLayout new1(AVFAudio _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_AVAudioChannelLayout1, _lib._sel_new1); + return AVAudioChannelLayout._(_ret, _lib, retain: false, release: true); + } + + static AVAudioChannelLayout alloc(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_AVAudioChannelLayout1, _lib._sel_alloc1); + return AVAudioChannelLayout._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + AVFAudio _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_AVAudioChannelLayout1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + AVFAudio _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_AVAudioChannelLayout1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(AVFAudio _lib) { + return _lib._objc_msgSend_12(_lib._class_AVAudioChannelLayout1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(AVFAudio _lib) { + return _lib._objc_msgSend_12( + _lib._class_AVAudioChannelLayout1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + AVFAudio _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_AVAudioChannelLayout1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + AVFAudio _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_AVAudioChannelLayout1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + AVFAudio _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_AVAudioChannelLayout1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_AVAudioChannelLayout1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(AVFAudio _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_AVAudioChannelLayout1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef AudioChannelLayoutTag = UInt32; + +class AudioChannelLayout extends ffi.Struct { + @AudioChannelLayoutTag() + external int mChannelLayoutTag; + + @ffi.Int32() + external int mChannelBitmap; + + @UInt32() + external int mNumberChannelDescriptions; + + @ffi.Array.multi([1]) + external ffi.Array mChannelDescriptions; +} + +abstract class AudioChannelBitmap { + static const int kAudioChannelBit_Left = 1; + static const int kAudioChannelBit_Right = 2; + static const int kAudioChannelBit_Center = 4; + static const int kAudioChannelBit_LFEScreen = 8; + static const int kAudioChannelBit_LeftSurround = 16; + static const int kAudioChannelBit_RightSurround = 32; + static const int kAudioChannelBit_LeftCenter = 64; + static const int kAudioChannelBit_RightCenter = 128; + static const int kAudioChannelBit_CenterSurround = 256; + static const int kAudioChannelBit_LeftSurroundDirect = 512; + static const int kAudioChannelBit_RightSurroundDirect = 1024; + static const int kAudioChannelBit_TopCenterSurround = 2048; + static const int kAudioChannelBit_VerticalHeightLeft = 4096; + static const int kAudioChannelBit_VerticalHeightCenter = 8192; + static const int kAudioChannelBit_VerticalHeightRight = 16384; + static const int kAudioChannelBit_TopBackLeft = 32768; + static const int kAudioChannelBit_TopBackCenter = 65536; + static const int kAudioChannelBit_TopBackRight = 131072; + static const int kAudioChannelBit_LeftTopFront = 4096; + static const int kAudioChannelBit_CenterTopFront = 8192; + static const int kAudioChannelBit_RightTopFront = 16384; + static const int kAudioChannelBit_LeftTopMiddle = 2097152; + static const int kAudioChannelBit_CenterTopMiddle = 2048; + static const int kAudioChannelBit_RightTopMiddle = 8388608; + static const int kAudioChannelBit_LeftTopRear = 16777216; + static const int kAudioChannelBit_CenterTopRear = 33554432; + static const int kAudioChannelBit_RightTopRear = 67108864; +} + +class AudioChannelDescription extends ffi.Struct { + @AudioChannelLabel() + external int mChannelLabel; + + @ffi.Int32() + external int mChannelFlags; + + @ffi.Array.multi([3]) + external ffi.Array mCoordinates; +} + +typedef AudioChannelLabel = UInt32; + +abstract class AudioChannelFlags { + static const int kAudioChannelFlags_AllOff = 0; + static const int kAudioChannelFlags_RectangularCoordinates = 1; + static const int kAudioChannelFlags_SphericalCoordinates = 2; + static const int kAudioChannelFlags_Meters = 4; +} + +typedef Float32 = ffi.Float; +typedef AVAudioChannelCount = ffi.Uint32; + +abstract class AVAudioCommonFormat { + static const int AVAudioOtherFormat = 0; + static const int AVAudioPCMFormatFloat32 = 1; + static const int AVAudioPCMFormatFloat64 = 2; + static const int AVAudioPCMFormatInt16 = 3; + static const int AVAudioPCMFormatInt32 = 4; +} + +typedef CMAudioFormatDescriptionRef = CMFormatDescriptionRef; +typedef CMFormatDescriptionRef = ffi.Pointer; + +class opaqueCMFormatDescription extends ffi.Opaque {} diff --git a/pkgs/ffigen/example/objective_c/play_audio.dart b/pkgs/ffigen/example/objective_c/play_audio.dart new file mode 100644 index 0000000000..05708c6e74 --- /dev/null +++ b/pkgs/ffigen/example/objective_c/play_audio.dart @@ -0,0 +1,29 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:ffi'; +import 'avf_audio_bindings.dart'; + +const _dylibPath = + '/System/Library/Frameworks/AVFAudio.framework/Versions/Current/AVFAudio'; + +void main(List args) async { + final lib = AVFAudio(DynamicLibrary.open(_dylibPath)); + for (final file in args) { + final fileStr = NSString(lib, file); + print('Loading $fileStr'); + final fileUrl = NSURL.fileURLWithPath_(lib, fileStr); + final player = + AVAudioPlayer.alloc(lib).initWithContentsOfURL_error_(fileUrl, nullptr); + final durationSeconds = player.duration.ceil(); + print('$durationSeconds sec'); + final status = player.play(); + if (status) { + print('Playing...'); + await Future.delayed(Duration(seconds: durationSeconds)); + } else { + print('Failed to play audio.'); + } + } +} diff --git a/pkgs/ffigen/example/objective_c/pubspec.yaml b/pkgs/ffigen/example/objective_c/pubspec.yaml new file mode 100644 index 0000000000..60fe25378c --- /dev/null +++ b/pkgs/ffigen/example/objective_c/pubspec.yaml @@ -0,0 +1,50 @@ +# Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +name: objective_c_example + +environment: + sdk: '>=2.17.0 <3.0.0' + +dependencies: + ffi: ^2.0.1 +dev_dependencies: + ffigen: + path: '../../' + lints: ^2.0.0 + +ffigen: + name: AVFAudio + description: Bindings for AVFAudio. + language: objc + output: 'avf_audio_bindings.dart' + functions: + exclude: + - '.*' + structs: + exclude: + - '.*' + unions: + exclude: + - '.*' + globals: + exclude: + - '.*' + macros: + exclude: + - '.*' + enums: + exclude: + - '.*' + unnamed-enums: + exclude: + - '.*' + objc-interfaces: + include: + - 'AVAudioPlayer' + headers: + entry-points: + - '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioPlayer.h' + preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field, return_of_invalid_type, void_checks, annotate_overrides, no_leading_underscores_for_local_identifiers, library_private_types_in_public_api diff --git a/pkgs/ffigen/example/objective_c/test.mp3 b/pkgs/ffigen/example/objective_c/test.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..077b6181205498a14acc470f31ff40fcd6fef609 GIT binary patch literal 170147 zcmdpdRaBIJ)b2aO00Rs#bjyI`&>bQS-Q6MGoeHQpba$t8BaNUS-62vU(vqUmNGS*Z z-})}j)ww@&GqcvrTJwAN^FDh&dq4ZVyGfD*{vR(RCwGVYpAZ57s22cdl>iVdC>|jZ z2{|<_Jp(fHui{-#IpJKU4kh7ysYB-`y0-0U%ERc!dT4=sgNY_b@=zNJs>e z05+}=Mx7J@b5q~F0fGT#@KH#x{1*tTjg5`<|NDcS8lN{W7BKpC;_)<0YgWRt6^|Dl zj6whaSWe3uOOPkKdgXN@9ciC=Ry);jWIi>`Yh;A#g3~By5|YCZ*8^drGqAK(AD>`F zfGJs~MRt0&*su}43*X{|PfiA~Fla4dMF>*96NH%{6A1>t8LTp?@r2RoZgUp{ir_8W zf+aOc-I?{O@s3b=mx+f&NPGI2fp8mX8>*x39_Q4|$pKLsS}GK2XxyKsG0Yim$_WA(U<-IkYUbH8Xk&QdMuAXV z7&n)=0BUO!vzhR2mOVFzFKT(5MV6=+wnae%!bV|n z?gMV|XYv327?kaPspPd5ytfWryMvL$2B`IY=mNf5tE% zXUCr*v!Omd%k_Xu-CW&Cf!H8$dKW1H-Mqa}R~NFDRcF{COK6jG6Rr0BpsH7D4@qZ9;-U-ah4C4VF+Qw|)f} z#3~HU(sOsyAh!%)Z1H^j>mJPLYtP<2IYCUSb-?vx5Fj5*3%JTDKK<|(qfzwe1Jpx8g)L9S{xCq!$UqF|Nx&ekp5gi+M+93MMV9j$=EKN6WrBdtFg6Tn_S;4{o$MC3do95jI)| zupm6=k;Gdn#f-Is=W6sq9Xu+(P6vJ=IN9<>wc%)itq=*~6qBJSClqUT5hz7GnsiW#kz)tg>Z3s z&3I|*e%|gp&SHN%NgL4@&k80If0c|&*q9K=wz@9es^CSet~8dxj)XTKV~z*9BuaCkizrq5Oot=uyW62iSMkvjS9;|J06scW5ds` zq6Qi-(e{~(mvuk=39H?Gloju2OXd_;#iWzZQFqa%ar7D`Un&Hs!Zga0-q|wH=CJ|v zyx-NqJ|Tj-I3ZvYp+3juWM*mNx1>zka)d^5^qGU?BMnhrJI-OKpAK*i4q1syAmpv^ zXiu;Mb*Q?4%U;-Sa)~K(#0sE&-@g-@Tk`O;a*e3o*Z`!VWsdaQGd!t&O} zvG9JznU8FC@hHdGEqBEg;@V*Z;|Rbb%OVOcC(GJwxBmoyJ!4;E7iR#;iPGsb+;XzY zi)T7&oHokOUi(cZ*co6)bSr$s$t?c9SX?pV#7*{xsJ}MX%da?0Sdl$2qP9jCI$)ofqLOq(E2VVxi zZp#t{>dT#xiu{Hs{}~YFFRZ}#pHkK3G8C}IQy&>^G*)ek$?2%C*J@7}TS#L{>;clY zxh5(9vEc`P-x06+tdY~DITlr_hoTgoW51x=M#Y8?C5w7z?H^x1t(l(b&5x5hbNRp>N*&US zz{6<(D=SOfsT7wos6mil?jZry5-Y44uTVFZ&~!knKnd0M`ouaLQu-E$!ju?0FM3=Z zUMS%wgqUZMeK$=xP$y~5RL?xORsHu*1g!db=?@G;ArbR-`xt#-tp||F8?F|Vk27gb zV#k@B;7I19`pQgWf?^qGg2C+L(TN+o&9>QZtHudb*!3bL)Cv2*JMZRAh3-EL=HKKmfdgRtR8a z4gUk^C|YKbd-5MZ#`aVt9!M!Xrbb~mWg;sVvYjXQZ0HNyB7e|2y){%aHt1nfLXG*P zh5`QOCEhkFjA|jtTi?~W^zm)H=uOaO^RI-dV%djWykTN~AT;>ZJ?ly0rAQS35xEqy z9#N)g3;8HjQL~M2JzDGEC*7eqc^_Rj+D19MC)Dt`%p;acqbuhCg&drWaC0vW(I4X3&=3ZGt_+EoE=DbBzznrabP@-JOo zhv^J)Pv#ow`0JMiG&?yo!_Efz)VJ|AWHaqoYV&T9mR*N?zQv8q{Aqt#cnk~Qj=`$D z16Q?dq|dZWLrAd*PSpNj-u;Q-ivNV)Y&Gm-euVy9%8;K!DruLA6G;R(Y`(?;@BsHv zB@#bH%3{YchxELM8h@l`@HGPSB0}XNt!H#%PHL$lxmt|>+|2wAa=qpeqV<@6`PYr= zvs(CjWsmT+f|{v=J6KdwP!P_ulcxaSunyQ3g@3H^36~J`H$oKZeiPiJssa?S$Ck?3 z%lY2AIhHyNd01&l#-G3 z=jQZjx0aQgt-8i9RA|QHQ+(t$^rXaskHyFag~08|EmCe$p}5!X4gst(BYXeYa1bub z!mX~W`MA<#V86tJLlXw=7yN1Evhjj!hrPD;7C-zear*Q$#rl040O=7$PB?_B7?Whc zR{aF57aV&$zfYgMW1+UyMqMu2{a7V$O=|nC3gBdo+f>2{E$k05YhG^dK7;hv$ zw#E7@zl6{3Xi9KxL?VoaJz8g|Mlmp1uF9}k)`kq&%gR{?LqJZQmikx%BZ&ZMOhq!n zmzS1zi(tj@VauF>>(lwLHpV_pr2KBKxc*y%Yo*vsb}wXaQfs8XFaD_{ff1=OvG7<|%qoH|=>_34r~+Xi369GqPDz@calG$4bJb+b2J=G!w@t^f+A@&)A)FAPd_}j{hH)Cww!(rw4xn_*X^z6e(V`v zs`y4+7>l7Pg`|H^eMF-y(`4MKCGEFHvyh>70{{jxv%u29aH>krP*SKQCMoYaiI6d4 zvTuoJI=eR~jfO_`$J8|8yvJ-*kS+@AL~YX0Cv!Hi9Ip#yqLk5%WIOL)!9>!RAPvSzb^7P z=dsV;l1}yw&2O>{j&c76dX#;t@hsE z&`e3WmN1Xxm}qRcg6YXXhCy9dng+O8+50XbI6b%_yMrW_cYB;}z)v5J=oG zYJe!qDV2+7^BNG0!w!okASDp8Yr_>?Rlf`_O5Us}VvmV_+LpFWuF6#7q-3~EgI9@U zQYmD&hSYtBbVHq)=Bi=&5}mFh9lZxRcS8(9_)%0EAL%4Gen6?avcU1AyoXH?6V5~_7EFo4U;X{K zw6KuqT_0}n2bxMF(g2h5bZJcw8vaL-D&?!3@4cdN`j}s*xp`W)%y?YcFy>D7>{If2 zc0I2K)dPUuJlejhyPZ!l>&8Uhyqn_louv7*+CPAH01^^zwOq}|NYk=_ z91k`rycZn;>O#I7ZvOzPy&dC~Dg-FlcpXUC1o)gScfG7A96u8cexT)KGlJQ-RbYlq z+U9p;!y80s&p9HldS{iR>gXMN_6|u73~IB65+h%cs=H7+e*WQJviFMm?TiA87x($! zXU4SwAm?oq917M%1Khm1(&b<`PrOecEY*IqGK{{$U7VC623j-H^&0FpVDGZ6@C%`NAwvqoMJklreLN4xR&QhKRA_wgEa4)243x!s z6HN?+NJLAgg=^e?Il~uSk|&?sTD~y`&a==)eFwlGoFD*`S13${mU^kg6}+*@U?zjI zCOU~{ewWu;R>2yQyiDiVLMZs@=^@9YJMDS>2IC^K(gBZ^~ z<`E-x&R}3Z0l7Z`G^1~SU1x!k${{Y%YgF9H&X#Ab_%$W8=J$N4D zxi`M9rV zS?i@TR{L|a2NCBCRfCTF+l3gtv1wyq5V0pTJDWHd9EUAW)(0Uj9oLpmHsX&U4Tq=% zPa4j~p0moLe!bWJopZj~yU8DwY{@127vFUrp}=4Yo|)8!hewbnT&^z_N4uDBf4KTw z9jUDNN_!ORDi`2b2NXTMt|Ica;l7LY0{HhcO|gMX?rJ%9^tb4<#$gD-t6qJ zo|G)nNm%XS8O-mbar!1>^A*aT^sAhH*wF1ZJ+E%>a$-~InLev|b3clLGqA1$;$~9} zbWlgmJl;(Z&d$>jwjV-bLvNDmg6NfD3>R9G#&}y3%gSG*wYdEx#+rj&3hm*Hc##ht z#yc}XpYrB$dHsC&Kx>7n@~0C%+sBv$5C8&Q17O}%1g8Lh|AW_pNm@M+Gx!4ORv3Fs z011~nx*y}APKwNuJhxc&t9MM!%#$i#Nu+nb|5IdV!F@%n>bgeSmxfGNk&b(EYa9*Jn@^{$e5zTivaD)4SD5!+)2p3ZAw0dZ7&0Or@6aE9^t zr)blYn=eEQ5I(Z>^#CwzkGJ@y=NIoDp8cWFpSP*)WIAs*N#xOkPW4qwdFlvSXf~#N zZp6vKfVy4Km~0oL$}1aUHJ=A{I>P<~7#)KF!Mtz##& zUS*RI{HrbL=E165c$%U)?ilWNpjYwR7NwjMfw9XFU{TNXZtKM6ZR$vRUmHrHk1@d}E3o!^u^>h|dnDxR5Fd5*mj75`lw{@ zui+u{_EQyo01ZcX0pRLIAqgC-O&wHG?O7F=(4}XsDm5C+YPaTQcZa&t3OastB z?FRr9x~C!>F>pWkvLH;Zdy`l!U1;?`wIO7UQ|*zzgs8^WeKW|#gBMpXP-mrF#7nZ1 zUrQ&^ll1KYXBMfzop#=vNGw|P)yJN~AiX15?cHgcx4eaiq(cU-Z(xpJQe8E}%v?!CR-VAH~uvLllDIOO6BeItzgAOI;5p) zqL@I7x)s?PVVE{KOQL{H;o4iT2bdW{%qQF5*9=`|Z*Oqq?FTCTSvi#1sedPv+)F)@c((_yZ7Ia6 zfhYh%Bv}ZUhbj^ZTB5OK`l9+&E$t6B0YD%1umL^wJjgmuIS;tQbz%3{>Ra-a2i zBGZ|dH3l?|d3DYbl4$h0YE+yoYO?ya>8ZS;mbbRPDH4@?8YKKGuIDCwCs{0smxEJ} z0%c_RSC9hVv*AHcr(87x^4L+pEZXrG)R;!RFR^wjr9jQ&kcDV}Q|Y zt@yHX1Y{i#69hdOZ81%%Y41S%g;1UpNa&<~Ctc;3SMYQl>LVaeqX&;mD{?Pg$hUqE zRXjDnx8v|$uLDFdK^L`P67bPCOa`pFoQ}{w#Mh;*IggMQhxbFrKxA{Nen0Htx+x5R6UT8iv+PpSCP{$W{-DHS4Ttq zp5-5iUfrpU>;9+&qr!C004Ofsvd96yGHXw(lC@=%rL9&wV?elcZpykB4F1S3XLDV@ zHQTf*-d6lkenE)Le{4YOigJ&;cyJo2h3%(0?FQhb-Ah>sFDpc9`IEAO@Qm*WsseFo z#~H0D`r487t@0i0^R^s{6*uI0Ac_%fF$dtlK6rMoY{aB-u3CBw+cqh~IwffLa%}V%${#j1o$JbnE zc;h24a*3VU_Q{_S$!xro)2ANEMO|t4sD01eEP3P}=rk>_oesJ~1B!^2&`%QzspXct zq?lZS;0gbSCcas69>hd3eOh!JN{UCGx?U-RcuzYPG1Se*B;Rdw{s_UI#F5Ug;j`~i z)Q?*kcr^XKJUBu=hwxz>r0j?VGfZubU6B_6p-Ne+-zHj2^#l>0KW{!x&W^WWI$kw6 ze4xJ8;UUs_2@w8c!%3K~FssTzK){H0*j0{$8xP*Zd!D+^V=DoYohRiF;|3OJw1~guNT+b2Y|3}*=*(GL|>R8xa51~sB>`gQ~5*K*`E#3(q?v@ zsvk?-4|H$@*T1=uopEVsOnJ9TR$A&feXINXH<9t_S@t8vKT-)VQ=9$OaeAo6wFM>h z`#skUo+Vq1jAGIJPW{aLKrZWMxw}1!<8Kd!1fS(FMn?ROL^UF3P&>g6jH|BY6A!c8OaYjNwj?M<@6vZY6A}0>7S|Wf#3LvfNtx$d4gVeH~;eNQEUd@ z5KSe$Xv@3H>WtilS)qgPse@d1a%1PZy-=o^$t{G3xqn@Q{T$u`ms1ppvsv|hw3NFG z!8#F?);K^4e%U|M`wrHB$)}oY6zCXPP9^I>=trP6DD3LN$S_TLFH5@w0k~Zhh@Svu zk5)?NDl1ieV1W0NDOTNHU!z5ZLOuSGe11im#K7}d^MPvqP~Nr@;|9aDA?sA%+IOam zX6Kt_n^VV^qt9`dB64coNabcy|Mq`7tk>*P&DmYs;s05hxd;R+djiNXUTHXdpZCot z0MalD08FSKa#co3FFtozv0o{v9ejGON)X<;(qOgwQ|q1dTIy+isLZd92%l^v{BnDb zJ>5|&ms^!r{ypX6_|*DLwpWt43s z*_tCBIO$(c>nUl(Vhuo4IvaD+V#95)bkNcU)8F&Guw3W3%YS)+_Fj(uvJW7u?1X2I z&mpPu_k#T5O%AR*A*3#0AXM`;_LpF* zir()4Iyi1wZuJ}E{h-sp2!&lCT2o#L!_JSFQYJ3%|BzjtP`IDRP7ltb0l=;v!1Tpp z!XyZl(a382s-ztfip@Y>R!;6#o$XjVml9-$cGmrJmuITnydv_n-?{+y3i2tm{u4RA zuG|v^%CU5w#mN$cJNc|-uzBGd({l6>8(SAkQKbtWJ@;x+<>^d)(??DKjarrfXb}y@ zz;i4yBwJI(KdRn9Ng{csW{m><^&r{99#Bn~YnP~-RULzBii2Gzmmrfoq#!2=xyJcT zgOf(~;Z|wnv;q9YfJxPU*V@W!zV%{ES?slCVTzki5;b%1-XRZdQ02`MlUUbrYf!6c zQ_0K%6Kdt4b1--UMJnU&i9jPlZa~p}RfRw{&_-_qHd*pC(V8at#Deu9ZT#l4WY3r< zLpoa2h0_IRre8klqle$Oj2Um}rr(Dn#fPtapFFGM8~k<3<-09i{_3mI_v%@H_uL?h z_&=|NzNyeqYAIW)1#|vfQ;o9t_CO7{A?xx5G|`23hYSKvkY;AdD~On37`jV@il!V0 z89+PFzFr}G&3`CpHB&>!=lb%{FO%>i3$(hCB6mqtrEjtWt3d#Q`8NOxw)ecYjS+d2 zr5Gxpi_pV>VLdSl&y19b<}U4T`G_tQTCBjqiZLAouU;!(g5pE_!pAr>a9DIejfe4% zDdu#SkE4@(f{vzNwQH;X@PF29=6=eS!oBo4Hfs%DE==|Egb@n@8CeIBVPX|tu0!c~ z9qA;Mvf};&C_Gh?XL2^c*B4m0}V zRQA&fEmPns2ehq)K4U|g27OBq(o4**#7C;lKX~W~rEtYt)Aiz)N_)j~$M%&c5Cy<6 zC)jYULS6mY;LZ)`b+T|Kgmm(c%Y9ziINI%Z@87h6-WcXKL^3J8O=+%K-hEK!h8h>$%^MtEY*(3(5_(CXM{O7GQZiqMIqGs0GcYGImSx@27}>!?uXf&5BH8 zasbXhW$`CiR~D&0YaHmWv#mVl!K#k8RVAjr;j*EbQo-I?CP;8bo^#gpRr5K;bxKmD zn2FT|c7*hDvF^q5utBWfu~N-<=~7Z29OniqZQrT*F3({4zkDso8#8F%$)O0h9y(Ie zO7KhACS!iLwoPjj6<%Wz92#V5`uNj5}UK9_+9CS!X;*K=3ck zJtt3jK?bADfDq5BUG7W z8)uqYfetNUL~hESw9qS}C@oF#0sAp%Q>^y=?N! zmVe0pvEh3-i7v0YuD_{?nVs^m2c899UbpD|JY~Z+b=U8{>)fTNzDRR^thRv(Kq-x0 zqk%%Ubs|@paQjh73Jm#EgblB^w5x$acw?$|Y$<`O)q6r2f_UqXJ9m_Y!8vtUtfG{9 z=K`Ui7M+H_5>KQt|At?GGafPd$~PCDT&I24&C{&vry~SKU~Yyp=ngm_S@Y5g*`RP3 zh>XvxSWwQ3*vlsT>Zxq7t8zJ(zF+6bQ*6Aq3o!&i5vY|k%K}QdzyaU7DIcF_6_Owa zAB^)rg^^D>{Y8%SmQh~X*Aq~edcM~)erBU<1vDrq>3#1Fk7>=aY-d^?cEJEL8WT0J zsc6=z)snfa;@io4>Gln?UpnTEKH}EDII&gye4>jf)Yzir?(CTRo1?x_^UZ6otNx(w z>_^=MxodwZ=kj+pGpl}ouT<}-{LTNLk4#{>g&~dTJxzSX)n^q;kfl`B0QAeLz9f=1 zWP8F9!E)AAm?6pi(rqPPS9_WnrRO_qY^lBC@_k!=C(Nai=%pO9yJN;6HlyW$QcQ?~ z>wf?RV-T@U|SDD@JDB1vx7WM@&*#Oms;-RDozvmh(C!Qyp zL7;^IHY1r$3f#cS>_U6L4*19)*@in>vv-=#*t0>t<^r^1^u1}HwbC$lZ+;cu*BA^| z0DC=JR1BdbeP}C+-$3bAN~m5*#!sGCxh9gF)SI}ttnd0Epk&r)3TEeB<(rH|sm07% zFUEW_N!;PqegS(F<~Ew^D6i1rG*kNG@B!mz>+2~>GyqQ*1t3*GELIq$FPSsuKY;dv zWtMp+bN$8rP2{dp?@bq+%c@7}s0)U0lCu5IRzdIvAVjhJoDNUXNER!bNTF=e6~UiX zCay1a^~6*G{I!GF(uv5vtKf~q`4VAwn(I=`Wg4*r%BtQ!e6i&r&Oz`~G^TeI6+c5S zh%F(-Y}pI$6};`aX@g=aEaF^w<(6Lf_;Xbtbm*cmoWI$D#fVZkApRXU_0uKB5Lv>h=5-kUH7cilIq917;`%vzsG@vPR6zzQ3m4KAU@%3`tY{NDruX2+M zPSWxd^J=30ikID*!TCc&qMNfo`+Yvm;rQBPn`=>s8m>nVNES1K<#7=8<#Jq}PG-k~ zgEI{h%G~BIk_*1QMBT0GyVA zz{FF!ndDQmpa5+tcu`Ca6+p9Uo%N>GF90_c7@9F{)KDPFvSP#nM}n z+P85s`H3vmSeQD$fm?x^rk!TL*s#NI9`ny4RCi5J0T2Mt{RV(7)O?y*Fv*;sRfJlO zK6t`K=_|^r;5AlR3|w&6s|ju{NsQVxO0JryoeKP6Fxstj^CA8C)y}_QpFnlqA=PP& zQyjHR_m}MUOK=x!gny#itQbjl_cNnAcR$OE&f-;IsrRljNJSq90%*)j0K!HLL}jBT ze2+6jEwKT;-g;stK3gq6881F1H}^0D%SI*gt-$57_jptpLoT&4-zQAUHP=zGxLJ9x zSUx1}x~~6fB2b>HZaDeCCir61>BZyQ&(8>p!Ay|dbwCAN$*!a)+o1F5@h+oPbTfHi zlq%DhzWO5mf+c~<6HVhW8Jd+^wbF#zWV7yQ-xu)?uQ`c+F3P**H!597QayNcpself zDNEe!f204e5-UXY!LSLy3!)?xr$npo3`WbOwQ$m0p5Uh;@<#*3Qe?ISkRj zelm92yN_jz8-Zfy+!lWc47)IR{&>>!mIh;&zb(SNIvC!Lw@Ye}WBOWuJVcrJkc1 zw!dPx>49fkA)qd}P^Fk!zMokTmnh>JscDvO9i2j!=z8A;y(Rnb5YwE2vCc``JAO}@ z7@c*5pt!QaV6b%u!8}(RoH8IS!!NL6pAiQSVl91MtK)7~BAXYXWya*>G-{*diguUT zWPobv{~Xir zAaX~$i+Vnl|X0wV)PE70crS`{|YeWc zX}3g`wn|8?Q*R@KWP7Ev^)aTjGo^pietb-5$eg*BnEXJ>nxd=ME!uqhL#d-_i`H#aj zQ!z<@WiZ2xQN(SUO6oC*7x}a{>vV~*O4u%L3<>^uB3Vj3ztlpgvG)R zM28OJ!eo%okY;ZK$_Upnoy zxnN{pGv0Nj&?y}%-w=3_-A%u^C|(<1c{%k*>)yL{=>cG|0HLbQL*6R}Ok$017+Img zXZGl1PMpT%9<-D-2>b;6{!S3DN0gz2AO#LTSvj|IP(Z z6PGq$_@~5AE8BnOdY42KAr)U~1c%0y^Nc~7^Fq~vNcb*hRpZ`sPJ67+Die31KTt_2 zug?J7@|0L+Oe{OwQ{JZK5-&0i+bk+sRfDWIZX-%VAMMR7F>2=6$JuGjkr4c~ui8dy z!i{y8$F98=83RZbUuLy0GE~<^B)^O}o64r}+5^{H7Dzwk(?VO)n5%0rO`a~oKuCIW zlRs*28=gt^N^8tc>r}?yyk=+7q26Vv!V+)BTaq4;Eq0$13FyF;c-yIfXX;OBI1+5R z1Yy^_1jr1DLU!R}WP=e++My-3J7UneWjU3%yI(i0$y1f%wH%P$pxgMdxn&huoZHkl z(CrBe|F#+spR)?a@C1ojROfs7leqBXL`^o!3TG4%_YnXVs7>mRVtC+LTT7Go0vx{1 z|D@$9ms6~hH+I513Z_W~YBR!9{j#CXN@%{|mcOR-zhM7D>&)}2KQdCjG-cY4aUpz+ zqm}wdt@CI@``%8>tjBEp+|maawQSC6$E) z_j~q@nYFaj#7E5dqsxqxK$cyTH-kQJnM%h%=NAUC`UVKaV@YK zBG|W>^pQG^cXsHCnY~~5&chc+af)A4(Drgl<`^mMH0Tm%LGQKkr9ad`MO)l?}0a)@E`Ow*; z)bIne*b=D{ZO5tI-#C9Sc)y~5C>fFeeNg09$&Q}|^vtL_L*VPRV|u!n)ys8&I4l$u zYc63e%iTE7jvJuG*tiJ0Ag9v)>jBWjDeO~^cpe!U+g?3$;o(uS ztm1cVF(}fzpU+oH4wi>o%#l*CB9$LDMEt3`Wg~ArXfidKAs1V2Ebo!#e9kqhzJ0>@ zVpA_`{@4ek|MH+Z>Z=?O#h#8xk->?m^z0#R2O|+k=J>LT7zec0`ycO^CggI)t=?{$ z6;t^UG>NuM!NXbO)vc)vJRB664wXEg1&<3q>{EV|Uuv7J4I>x>ATW-a{^yfxMDG9He2TeqFYsKk=;Uy8fD~Y zGu+^4&r;(($S$9gAHu;$X1y{_q8e)WcgNz)-~2;pz}1Fnfy@z-QhHBSNKwNg-XP`P z3I+rB?i_h^IAuHw9Ye%07B4~x0T7iO9*L5`A($xY+W6L)n9p>}04gftNqI;L;g8`$ zz2j|HM-UNKmU(dM2MtwL!nt`?+`|cYB=d*)e{A@JM_j`+@&3Men?e5V^=K-0MhoBz z30rC0FJ9G3)OL4%CI?W3rhfsPcKa;2qpU zXL)e=vD}n^x$3B3u74OKesU)p{TI^f^A7xiED7gdI*=!>Wi@eEt9tQ{RUw5a@*C;? zepxIqwUah3Wf==tXCsZZ|6Z^*8ADMKXCot)HhDZ3#@asM)}1B%X7R@x=Da+7 zK6Qif^{`@2+X=LUxo=2aLggwU{XY6pIwtV*KFh!aM+oF(8$IvObwUs33x08JE zbrUgLQ6aXZB>ac+!{3e4fbzgG>DSzFsYg>$h>y-`(K|AeL|K)igr35)a!%j|V5O$UCRMo7~P$Qz&dCZ_p zQqJDV^?1I8s5izX0modqNBb$jYiFr-T!TwSHep~pv!fB-;sRY&5{ig__^l_asH#}S z#QP&!CSbx+okKD{q@=Iin|l4_bZ=q3u#E7IHa6!YUi12vCf2HfX1?6C&g&FNcz%?#s-y3rFf*M zFkkO_t_0rfelG{mXq>z49>Yrj3rmo7+{DhSzhJ^%e=tJbKvrRr?~L`85oPO?r=VB+-u0IVO-cN; zK-Bo7_&-pXrKtIhM3w_uAVePW<$i0rQ0^4y`+!t`#3fXz8FrQFfvrh`{)Tirz$$)8 zy&Ydm{TSqh+k??aT56+DJ>~eqVKD}eI^<(-{mMr zBJJa~^Q&_ig+K909raMpUH9{}rzLSpQYYr>e@t7e3R2o{eK`aWVieI7FLtESSGJ-)ODh^XG3LBJu^M19B%<7jin@BEJE3`|5(kV}_2?M6c_W{)h{>X8u(&@&ajo ze}wIc#fFRUgB7S#6&oXUDkQHIZ20Qq6g~*tQ9kGGeopsTSn6uR35H`4l&~Vb4(SE` z_yFLM8U~}YOGBW2Lqxd8($TyVWA*$=mUjETg?ugy<8vnd6n8^=G*?^&Q!@PCOeRSi zYAMO}!`qlU#3{)a-Zc|%+d2gKMP6Tfb9+{7OLLqAuPJ)SO2Hbys6?f=g*+HWpY)O* zFzug@ey5a1z>`C4QOHs%ocl*Sdgl!I+q}UXj2s?Fh5QgfUMdZt=|8PH+Jiw`*; z5SE=3l-1Vzyd%$9Oa1UMnzn(TfKVj<-<@!VhPaAN(iqDHmSR&yx@1$}ZS6{{wOlh~ z=j=IUrgu8EPk+oKk7$pwFTAMV11O<#m_{!E-i92;=ka>RvO=U;L@_4m4(M3iuz<@E zvG6R?lBeQb8+(ew$&JFv(VPkrRCC{><_N#(25yZIPETvuCgckl@{*CCYObmBU)gpj z=5f9FV0axLRO0hhq!0@O#blKP+T=Zslplg;<6~u6QZlLWMq_}++)I3?RT5jH2V? z^G(s0$LsSv-h6c_k+G_;N(vEdj0mE=^d8y#IKfC>xp{@O!jh`4kRtLp-sRUyGhB@U z`_ZQB?ME4<+~&_np1jqTiE>M_Fsk;L`%o4E;?q5`ICvS5xcyrDu=tfB7wB~X8cGVv zg4pmXsrTugLN%pRVcp?rAA^-k`>0FC9V&Imx`I4}_qyH28U41Cf(+jlYe~UnTee5E z12`>3pAHR?S038kydd5AG3E2HSlZt?QX|or=kJ%4ch_0$vN-jqeM_JDaKAw}K9w91?VoDrC0;V=o4NKWFSt{erw zmg8hn6oR7p5VUC6ILXVPzewnd5O#L8RnA| z{3gT78oRGvBb@_>CBDUc{px|s$a@u8tiaoVDTt*giS(icwdM?wwkcge4$~&{JASP- zD(@=v52UViX>R2S9$AWUP;mX6(h1;23At?n1fW)my}?8jQHEZda%3d#nT-vwG0*l) z>z!BOi8PKf`n<+1@9iH`Q#|QPr~9}a_kbd+oRMB;)K_vt?@KCocJ3D?EDh-lzZ!(g zN&l{w=fEuGLNR}|VY2O`QN^Bg z@#;u5Rt3S+Y$f9id?jt;Qo_D>O3yZqt~17f6@cER&gPDH zHoFtT*+)N8k5M`eDV1$;XKAXw8@->{Q0crK4MjW@ZAgpye?t#|H*V=4>ASCZJ5Rs& zJF$kF?B3NGq(G-LVI=cMnpq9anwH`b;m!?@EC0S~6fr_|{I>isGybDD?62C5p(cpB zySfiYtX|{hQ>dwca9--bRcjcTW=v;yo=HBkIEnwgn`*Y(bY4ux*Dxf#BT@vKH%eru zp7<%L6jhjc5CEH>H){2by=P~#)@XcrU8JxQ8|m;9qqN!r*3u?h?*y}?01bQ^c= zMOqbYfpP`Wy7nSpUfR*$$#Y_sDn!q(Essn~+Pxt*hfHJ}HJ6xsipX?50dS7|bLYwH z{SRNurhjA|nG1C<{c2x068O@A12mAN%ngi;?~>Sy49l8@xSzx)?ov@gJ68qVoHNQe z-3i81p7VV=%$Gl3B8fvijz(QPDv28SwzXJ^d?!>}KiAo+MgF z+eyl&RhvaSD(*AZ2R@z-_$+@?H)v-4V>XKYQyGqPbUNxKdKiu6AWaeh>Jxk+H1x~> zr&5Sug5q5%M8k41jbGE_6=nb=$t| zf6l;02cAtTr)Jgc+9gb43sTPotyrieNc})=CPZ83Mo)^~!ofyan!GAE1y7b9msyAm z*7!fO&CR&HP0fA^h@oU$RRRd;`d2=28`VZdv5Bc_*^qZI9a;WZ)~gmKRge#jW21b>F|W8v5R`7cW$H#a7?l2+_kQwtpXi z;t?rPfu!j@TE(tIch`!3!x(n;gFDiC+c~$=VBbIFb9uUi1PXgp)@gn*Lh#e?vJn}S zUoNCKIQ*OqdRTH9)!J`#2t3` zTe!%qe2ZP(rZp2!XzA>aV<{e~yf~N;dsv(tUc9cOyr@fJ45) z5id(0-?4wp9|cq0AQb>p`i*jjg2qJ_ZRk~Y47iP^zhsbDi@7=It(~Ut_m-0tL>D&+ z;U=LAU#q|zSN4B}g1@kNditQSsx?VK9N(4^gd0hF_nOP(iqXF+wsCC-8vPbBQ+$_7btq z%7@1a_7%NGal8R7FW& zrA7r%BZUf_nNYqW`{uY~`}hbsVv~ZO&&{5fP8UBA`!7J>0C1j|!4ZY~iZu@(iQ7*P zl9T~Ooq-m#ADv4>UBg$I7Ky1vEF&p>CPRTYiWLkt386uT(Pa zwYVDX`S4IsZ{>yTudvV6Fb)M_8yrb$R1%XRTO2L`E2=ObRWF7$*0E+{{uN>l3*Cqn zZyFcHoLTcHJ2M{U9!?a}Mx-1@exX_L_Bzn!)Zr`_Lo>*npI`FSr*PIPp8{AB2K}c% zWyXVzuN#ULle*tCXhz<0fVCAvCh6Q9D%O(8lPPI9Tj5EjxjH8No~lR!AsBJ=6MnyL zv7SzvHs^PCa)T{uQ12?r{%v)|T+`~WcJ~vtXA!~HI*AnM;RQs(kg){us)h)OXHGD)KwWMkq5cD( zmVfg9GS;t3YXHFVD?rT;!r-8AYKg*+Z(4`7_jH^I=}hT1rj#?>+@|fzxV%*(SHDNBENyLfJcv2&B1#gGC>lZ zHhh3|D}3nccSP4ZxP*PIbx^lCct zI%Z2I=~98L6hJU?b+A-AOe$g>uj!0ez*A97VSR_ zr`MViM6ESM(IGWC)vf^SEEW*&QK%m&m|wS;)=T zLwicOCHu(bUZ5T>`y%_y(;+EP#iJQ>amq34w2%e;mj-4CL@2jqa?29HV3EYkTOUmq;_e^FJ z*JQ>;+VBNB0>x;rdgd*qk9D=T((gz`9_0UrhHD^t8?O%6k*_ybT^;rMW=;HaT3M&2 z!_J1zC9u2nt9b=152h{&M|>7f=B7$yT$*})3u$qHr_qxxV!@P(a<5k^l=s}GVPom2 zFaf#dSx)lnr^$sLUAQRpB;9rPZ68g9`?o!POuQJr=1oxVYd@CX)jPcSNWDsyJ))v@ zuJcurk=3Kx;ru<~Ax7sP_s(4m8MsS#BhC;>J!=2%8<=mRcicGj7h#gowyfArWeRhQwy0g7>?_0+1C-WRgQC>HjA8(fdS3Wv3+mADmRR zi+_H$q_bKu{e5;~@~Q18ulG5$YDg6f!x8P2gR&>Op$IZ&VU$EW42x1!=U{@eInBDp z{Y@tVm^J5`)w>wB5^L^;O!G*t_3z*sU2S-IMN40xZz=@-|4wXKoouN}?Ka_&56 zvlRlpH2V$k<%)Bq5*tiKD@8vbSc}X1zjMehTvmmUzOnFaSDW3?Znr}`E38*qSMJwl z9bK*4Tz|FSTw!nFv1WC(c1jc@8m_>vhnW~Pnts=Ut^ul|XMC0JQU!}{njEt8wC#m8 zuAB(%U1GRkhCZVQjn|P$S+@oqvLxzW`qnIJn`rR-vUN!3!Xc}=z0Aq3px@* z^6hxuvoo9AAt6Ty=mH@sW*MTE?;_RI5k#|xmD-B6TZ>(qE7tF?v#8kqc6_j8k0*=S zvZW1fGc!ux1=}VL<-cD9&tt^|Bt#QnBNbbQFe4?bAAPJZ9|8l@hftX%5hrKl8~JV= z(#A80#AnH`S&KN5LHG`1Jq&`y3XJQc53n0YKPk9a!rco7?7hemgz>A>X{{*4+-?)Ol5f$?I>rgP)$ zjGY+IAg?;l;`ZjL|4&^4X_n>JPh_?4mvz+-x>oIeE~Nf+F?X%{shQXXAbdd~MrnY1 znsB^EEmXi~CrlJCiSzGq3vcR7aQ-h{or1IKg!J(3Zx41He~jMuBGs72pVEHVMbJ5? zPPXi7eUozNHLxc6BBdr#;nZux5ag_@V(L)Z8v6I-9q;58Z%6S5?F{1XjB#74fQZ^ z`6s6Ub$oRgH&tv%9;>kpx~0b%F9CVzMBrAnZBAA9Vf^!7x9wSKr!6Ll`5i5f3zt8=W-K%L zI40xYss%*Zz5r-gSvYuL*nL0Wau|9zsy3zGceH+s{DN3~PCsFa47??3%BT!qBH(?i zYWO|mlbX?@bpxlfU{i+hK|T9kj(?k$dSF-W_Qjoco6Nz^QkD!UyC|<5M>ox5gU{sz z>nMK`Ar+tLRzl{_unDnBY{1{TJ$6sAv;l!S({fk-iigdqy z{8?26{jf&Zq@RuI`QdikmfxGik+O1zb1cw2rq85VP*b$cP=tc_#>@P){7fNF$BUlm z=po7$z&H{eP&;JhrN6mHY&_Q?E@7|1sM>SoP7Hc;^{76-i!Xukna!VLX=`ioO`-&z z>$&Jiy<^RYUjPCObl(8Ly9qhsz!X$A7(NjwYOetzrU}-TAST(Nc3}uGf=*9FT8uZC z(u~AaJmTfI&lgM!_IQHkrpa)7L{Z7a7FZat@PP;=tW(?5@x41ku>YvMscpae#?lt4?WpJ}CfX4tD{w;B(@>3mk^X|!})yq$Y-3if<FBUhTkPxNx7vm3O>mX=3tB8|C%7Jd`awSiORjAyl&zI z28#g1Gtd{pEF!QZ7ZjB+LT^gJfDD{7Ea-YS9;F|kiZrL((ics92S%>BoydY%$V50xd_OFxL3pC(Xv{NOXDQfBhl-4OF7I*kBwn;=vZA(@IYii#~T&5yMH&2}cqDO7+#C~a^pM>tL6kbO=?IOIbgeL1y+voN=_e;93@ zIGBRgpzN2xpMGl5*KKe9-~J|m2ZZ!)>l?3_#I3%^*C3L)K51R~HuR%>XWj1H)3dGB zKlz(Of3gy`634h}UNpt{1YR1gL?JBucNxX}h<)B+5dhUP0P=ao0m_V1pnoc?T+JRb z463r-(<7^`inttKceG~jFj3g{P z^jVAcVaDfq+g~ZTd+PugY!IE%Lzxf{q|OyV3ay3-=1C;jghc`F{%pQCz&lcK?~er^ zDY2?|w~j&uq4g&n?RBHCAQldm>sp}u2~Vh81_ajDjFg{{`=6L;B+J$};66upwO8bV z&H!M9i|8#VAEXRu(vrtA{3MEd3f5-_uQ^q%wBzPX;`TX2F4u2Hmb z^&^rf{)lDiC@q$DXzAhIiwro`jHF~ri}G1y#-%~=79rGP7%<=@mtws*xq z&X|(-x1U&5;5sf2&k7IAzzRQTS`MGbOt3qr8mt7rKNtRsB$~;D2IBxZ1nY2faaiWC zrS%yY9&~1kFz^jKVgXo)=qOY5fXm<>pjx72@GN?!25^C+ z)$bJusEANuG{??tdKkLQ_jAAK)2HOq5Xf8@O=2z52`q4I8Vm=jkoLd7hZ7kx+1_4b zPK`fKCs(7+Fr3#q2o)P&08Os_)6e%QZ!~S89R06-P62ZUW~&^uWj)Adt_b?j!GC#3 zlGXk4zB2x}gTtq*m%~D@nDlS&TXP*`d!^=TUH3_R<9d$v{BJ&yxV}~n^-?)^RiA`_ zR^vQ4-BsT|d0k|5n7hDi-}e6CeVp#EKE~A|v{~e1#|{2T1u(5*YpQG39E6#|3`U#2 zm%y1KvO>R>{A}Z?F{AT{In56$q3vU&O;5At!}7mstlh+Zin{bUyQ?l_nk||sgn`~) zd=^i&zNSeG-PUIERsqN>ecu^r7ss*Ct%Thh=ok3cHE?g{IB9gGZ_QBuO3yO;D%3z- zUjf|0Ql5lK<3@Hm&^qH;8BtsJ>BCDorTw=NITI;jS*qODPC8)Z7-XRG>uaLiUoX`g zFRTR~IaO*SGYqVeWS?+Vfgd<|Zb8m0mqW=kOJ(d;Wp50sZJri5yO{`Z4dt!c>Z*rK zv>i{?HaREmmv#;KQ$2P+;;ZObrMmN*2BiZhI^Q5vF*dl}fP!X^splBH^F5*LaDrUUXp}j7r47pd?>XxGj zdN;*bd|i`D_91O}ZYME>$sE(8|fMJ?}+e3xh=j-zChwmHj_U_b{(J$Yl z3L8Hfm9}}CMe)pfszHqG+XY+{zpK1g4hA`_rxZbrdGC zWFlFoRNUEg5OFPF!-Y+Aq`V@r!bOVj+nBM(C_jaF{eZ~Uq^1~mad(4MJ9eV(%%)(2oS6Q2K_=B zU^_7|6-}ZPw#GqZktSNS-Ql}IFfV*L7Ryqb0sv5tuAlw^tubcFX@m>w^xtj|m+5{N zGcqKPLRqz}!=D5XZf^2Kzy5iu%l#!-`L9u}3ifsi$gzBtbV3QPqm{ICB{ht8v;tt@ z6-p5qD+vZ#$7B0wua$xVNBXxaile@K%(Mvz%};)4(Bd-=N)c#f zuKPU&td`nk*x6u)^>ZvIJQh-M~l}aQDIqGeRST^8Vt$rD=i%?+WRiaXwxZr zz390kNHR~tcqdzHB`yl=_lalca+n@RtRWx}H+3x<5&{hs6vvmT^a(Va ztRY8C@xog?=`(@KP*|rp)F=dtUy^x!drVr5*Dq}xRpip`ed?DCKnle4>5z1jxtft2g+;;+RaoTpX;l{;o!K)(-=H~eRe zdi-JZ0cjxkyq_=MdmxEuvNpDxBVq1s2!`Hi7jgiM5az*X*-c&I)I?H1MWi6H0$FCj zDi#XR9os3xGe*9i3-vs{L$#nX@%WjJzBb{pJ{`vOp2+fw6zZNurF8fihKgzYG^Iq_ z&Fpm!{P%S<7yvE+s3io%p~?-G!RExv!tJpYSc9=`FzYP`Fm1VZgB7X$6}$T*2@W{1 zGev3Ffqq1GJ@pXNlg|ON^nkYiYh0k9U48xSa)C8ohSM*J=_>Od{kg+(h{S&==7Yf! z|IejRDpKKBOrePvcH;+YUf)7VQ~D$Y@le&scje75{dxhw)Zq|_NWB8HxslWl1C7ua zI)20GBu4Z4TgE*(_zEO2{%)5NGy%Dg))UGf7oTAf4Ad!{^z%vmtik^94U>r}bI zbMp?58^saK)mTy^4cXhuENV9e#|3Sg+m5uXKs~U03eYjj{S}xsDsU0tm`7mH7LQcg z=t%e<=_Lm_e+9~nLSt8xrrZjcMJlO5AQi0Mv@#zVh!{ytLKw&6Wutk^q{}tbZXkKI z+mDa3KY5q0Q*foG-$}W$dcX|V3mY;5<#wY8D_IZ6PIEHqSop$I#n&rHWz$VRUD}^f z!2zHQ3vnSZCCEyFON@cZ1ymSeC?u3LfmnA@!i)sQ=Yb+F9UzlzLcHi(KDigQE&lP9 zUM_rmmjBgI)m|vA|7Uqc2I08h3j{Zp38lnO6!V|wy~MSi#fynb>yKi{ z5osBCu;=H1SwjUY7UPj90lr$r?5dY>E1tWG^!I4upSW3qf2c6uv}gx+8-)~Pcd-__ zNmiKM!3`F#n|G#PH`rzpf4_tr_AqC?Vv11Ve8FB~+hKO^?~xbY85@Z2?U9k#U6#yz zc|ck(f|JR7EJCJaAKfsDwsQ{90?OYv?4h^}O%4WH42~Xr%On;4w6>x<8`v!s*M0eg z4AfcAvjx66t)E^v%%6zk3+*ExzyAR`i>_bB5yazF{E3Ow=@jHpdg8?Yn_3@(-t7zP zE`%6`IMl3G`H();S{%R^yC%B_bk48(1p_9cI-e6g^}<4G7IcDxlw2TckjHE)`?)sm zp?5e9a>ix&STqW#H=W6;a$e#k?+oOKjY8LUko;@zwdDThiLPDn8JU=^;dZ^5J&HgU zfHIZYK`L}KWAw)4w*ui9XNAqN)070&!9i1ehvmTdA~X19)6=OP>L0Pr(%SYWI;KNr zJHuVPU1y|Ss{f+wt>cRo)lb5e7)@us-sNAE7HCjxXF;h|GQKjub5X}!7_gDPCEr1l|nbgLDcLg&TrZ5xoqy6hQ;UnX(0kH zc?tn07#t;Ix`|8<#rR z>cA}1-$H9vX}Nv{08q$qfZDY%M#!ivHi`@6l_a3dS_sgjH8a6_Of!nbep*}*lMgi?T9`L&y0Ys-|z##DMxLMME zR=%GMyhPLq4--n}3ya6(#3OPLr>4+<&BfbBeZMhJy5zwoZGpB*XK|vKJkejVdIbg0 zP6Yw)A^26^@}T9q<^-1xj*}Bo!pw|lJ_?kKQLNVyL2t!wXq3LtOA=3@wENx=Bi*Dl z*+(1SU78nBNmVfRk@{JD!$W46K(b&x5eVd;i13*~gwm!o=rl+gRs3tdXOWA50Yp9k z_=J@`)}C3zd|0GD08t;-(=53Lx*Ml6l(+4`gZ=|MNPR&=@8{BkQ<=dE|t<%74St6)0<2=(UG=R0w`s z+UP^3OT025uak3uHl^iZY32?1NaSCdN##HJtn}_w+)Fl==e5?He0T$49$EFqF|+1r zde9xU<6k4M=0FDgAZNFDEm%SV4saGHVQ8r1;1FC}Hu2FHv3*ah#rD&|nYYNkt__r+ z#TJA$MlRdmch0|d0GFqI@36_6NH|Fld;Nada{s>cU4Zbb-*|f>^F#O(HXa^3!8`I-@b46(&N_Wl6)G}t~6GqQxg}D4Ci9~pqasT^p{}g&z0h%AC#o( z(z;xhe-+!VxJtq^{|Ssax#O!kaW??G$n4r>VnES-rC9aW0gad>RX)nF&+(Eor{+*0t;enZ=Lvc+TY!1|^R!kCMKYWJ)^He7-j>@e$=$zB)@Z zpJCKIKq&xocw?ONWL$adL%x^8&g&!8{*J_vU-MhDxpswEfcy^tGOUMXJ^_58+=}fa z%!a|S3^ZU55THasfMl$QdTG)3ff5Yq)Fitv;50*~o2PtEdX%*Uz4o&hx}vvyRq)65 zwNF-aNKLn{I{qAOt+j7$%)41Ql?p-;1??&vq!_?+5S0WjTztlhjF3UcY0|CJ9Ezym z%;_xqPw&02vdT`J4u3!?jpW@AY-toDM(;k&;A(36lpHC;g&sMVG2`smj&(PRyKXW? z!hytd{5vN+!0@JWB}t_qAueDNv>qcSBm81K&R#SA)>rh`XXyZY9|B?C z6(X|z_W8V@`}eB@R`&%cwv3D{HN^7jWR0}nT)y^WXfy0H07y)V@w_?>Cq%g&45gVJ zU-BkhAz}W679?RPXjMh_l&bQj$!mc&t$aSr`fzoWqU7iQ(C`k6HCFjJLmST$Q zX+`q{H@Tn>BeBgCB9$njRp+D4HV3DChobnTU4Y+&Zq^Xnrokn%fV((@W1q@`6P9EVDT%6^rM_68g?bvfd5b!rVp{@?z_fk%Y(@H7~V2{dud?c06g zivd~B_NSY!G<&JtEjwU}@^Q`fp_oW{iG@4tY#f&4<`!|9$te}6rS$`vf`nF&Y~_eJ zO^R*SF;rvW7Q3NUV!wI-j_NA_3UXj0=JsQ~L(N776`2NGCd5N|Y6!2i;qiEeDI`tn zEaEeZy(MZnKF)59y_R^~c{bfIURC*J31#WFES*31#q7%cWht29-qGFQ^*a@Ji!}eS zhfn9k4dpI#|G7v3BN+0w>c{vo0u{Kay$)GI1VBU>F%_N4q)U_1o*26?!K3;T$?eIT z$6LVT+8Fl%agyf~U2b0c*&tlfz5eJEOq=|W%O=ziwp_lK71yus4&YG$9^;2|qYqPbPO)ijfe4T@Yy5nv{_K3Xsigm@IBT-#ls`pCjeb%W-FJzr zQTF$hOSWcy(OrMX)%Kr$-hJ3>cwZOESwtSxmliNMBh)m1>Xbky(hiq}LDj^;eEvL{RSL%z|HU(-G6BK2SNV(?+zf~YPuV`=5+WF?%F5j zwYzJlmdAsq!8FV9dgM7&yhu>I@VM5565V;)O1rW)6I1#6r;6pf+H7y(&R)b)uUg{_ z?XMOCoUkiEcOl)&$YBY2JwqVEi2|_;T=-=sJG)McR~WRcg!t19kY4VhBt;lU<>hX@ zuWA!}{=|7l3iMSb<>4wBNN_UJ#l3C&Vd_vzzQQfBA)hgd6wLlkn>>drW>v3cRRI7) z*Nz@@(4_F$p<<$g5K(cHqyiF|qEP!JNm>@_?XQ&UUglhKKEjsL9{7Qin(x(&i(T72 zPI^=E5$%U3wFdo-O?MK?crg(}BH|Z|%nxW)Ed`j1<`p1J=KulSiIa#ZFaak|&3p&& zX$jtT5}1e{Y;b)}g=Br;L@8fGB=YxKMYi*J!(SoEALQ`;3E5hvHF#_&{j_1iDGaLf@rk$iczpdRt*PVs(XO+cX#|LmZozqYO@MXzb?noQ36 zk<^D52SaI_dOcY`j!E7;7;4?1w^)ExdZ_hOche3wuXF+|zj5G~iBSa1%p_QD<{an# zOoL-@N1a8~3u|Rk^Ma4ok&Lg$`KBHY`i#f@hlZaZP!V-4*7G?U`zc2Yr`KF-ca?|I`3|Pm= z_(eH8)03NuWl~v?i(r3Y?d&Uzwv#A1-#&do!e>y$p{&+xGD9MA+}0bYg3DKHuXle_|I)R1lz~Np@8@&cEAjS~ zBv1bit~k4zsrCPDP@x}kPIm@BW!YB8dn@3lh;F>4oQZo}VL3Ek#Bhv#E)&uI60Pwu zbhw)^E!!Vb?4R-67^`8;rz_2X`b6iKPp|aAzMeeDZC$OKFE4L`&w6FqxvElsKh` zb5wK&x@t+lyX?q^Er7g`#mA7ttZF^r%o%`Dt>OJvMrc#Yf3iEULTJ&%F%6|ZJ*fOE z2$l>LZ5D5FBS*WJ)Y7IGgZ_CA(zio2ZFp7W*Iy+QKatY@8FBwAH9xH8@WG@01%~Yb zZ-VAKqdD?-ovV3IX*R1OP62Smgb}U%20=``(xFS2of6VcluIqo4p379@3xsbFg`HW z>?)JV>v;Z!r2l=%bf7n1rij>5;9h#G%BOBli1~L5J)@f3qmPY$^i) zF-FBeI|jFwtg#AfGK)h1LU_T7xrX4>+UOXhR$(gysvP|i{3YC={}={I(0={`Tpkq_ z2W-a8{3@AJVB9k5ge4JM@BNN;M{V_=aT_ka@cG^FIe=$7eKA_?AO|J(rD=Fk-deTC z@$ggcnb+H2alfMa0_}(K@mC(i(|JRl{TCqopPT2`J<^wxy{C#V-ap+)6I#T+$vv+q zq2a`tyq(QXlrnpFc&XrJM%(HTav^n z6TX1XOfk*=T6XIWX80GnXE^c*AyfZ;>xOq4g}lK5QuLorgy_idkdWKA#8a!K}?Xkwx)%=yUa{XhXG1Zsc_M4bt<_yIuVFb=nr~3 z6R|1`626j*kMLxJ}3rD&BMUXey|z042TV@kUv`f&ogSe6>=m-=pz?piHA6 zkeiiDn6Bs+R&8BEv0hEYjur$bA#BB5f<$P$(`O-T50z@(%~=Og&`}8;Ja7Bs^o(t_ z?hgF(-!GzkfbM4nfUk`dN3NH~{a=7CAOy<7+P6LL(3_0&e!{0KIQ4+oH~Ap6XHM-| zcS|!v0qZ{BhA1Y3D5E^I4Dp(E+=Nj)rQITYt;un7`j>^?X|49MR2`D+J6vfp&srOl z#mFBi+elw0^{{m1`utX2UiVX`YJmsjH!3?mivtJ%F6;Q2EKY0Av*e8&++eY12d$<8 z7YPb+BUGXlWBxJ4Y(-Mz3>ZgruS$T$&VTXJVTc(GVM%gIPpgcL9G2zAh z@1sBN2aUCGA0cXS3)l{WA7C1MdA%8dKRd?$qC^fAKuQO zBxQ1BAFcaAhRuG z@b7g33?Nk6H;NPJse#qM;GpK``Y%9NTbooO;j1-)0X zu2gcZM3a)vz&QULYTusOQkt@0Iu!ehQ~C{8r1K zvy{TBVlzhNFp_>TId?>H3fP7i5=yOZWh6a_>gi6Q4YAVG2}^L*^W4JSXwvm${)&Yp zjlEYQYhQzm7PbjQa4MmzRv*m>_?iXapX%NF0}#*~!+X<3LRDqHK+5XRfcKiA1|*-` zxJwG&oc!T5?QUC8ZOGBBoi5vjBgM4-rA5EvO#g9nl_;@r-S3M@e!P3If+3{-ZPoko zvZ^aI@wByueX7hJFuYM<5dH6s#$Pa%CK(;3uwkvD$Gt@!6udOA7^J@Kwr|z4*QTcK z&@9(Vlsk+Q0{aw5k!PbQ^#BEf6k0n@=*Ky@K-ehewy5TYhJ)rz(W5o$79{Hvak)-& zzgF3UKD4WU918`b#A4e-m4e0$w^vF2(sa`EjC!ZmZvJysdKIU|zvi|1YKOaK{!0bW zhVwrUv#N6f9V8-;b4XoGs7)vvWjU2C(mI`!q9qOx<(H8YRfhHNruiwhC2aqUB(D4j zO#ds{+;?-`k%j`pz_^|KC`!DDG`954u<8?!UW|QOLfTAzb}1Px$6rhX;nv}++!>XD zD)pp_Zh{lp@7oB3yNc(oVx%;xtm+Zv5XSam z^>!EzLIApB1!iO95$!l3K#BSptFztZs6?F#xe89h;IE>WnF~nDH#$ycL|!_dt0Sa% zQZvPCOhc2~hjLWq@2qo0&KAk+h9l=RZn-w9QSREohWoV_Q*xAT zRWhy*zFAGx5B4TLi%_*KIK)>YFi`aesDaw2@*xzB0SP2*AERriAiST=!zC@|Wt`cA z?|Bi!a?zqY$Sj|uNN>`f^vlJTMrmw`6#CjboLq(U`g^;rZz-Q1UI#|KI$k2UuSfmI zOj$5Pl}5lE+V$$q9X+4sAD3*G!BYpOSo|+y$&Tk~Hhxx9E7&-5Lks4FeBTwoXsxPQ z{6M;Ws%;^p6JslXB$$j8EzU}(8h!o76gtixlYqbEvkAFF4Jwo>8oXXNtAjM59yZl1 zF%#7AJ;wN=Jgm9z^r*>yx7#Iv04e|W2!C7;n(STkLD-TDoGZ52HEkZS)&&$uaw!Z?O?#@rQ zaULtES2Bh;L1ok>wV$oxC`4_pKZ1c-s0*AZNb>p9l#p4=EXa^YlX;YLHgo^kllJ7LN6l)N1g=j?Lqo`6UOcTvU(mnMog)S^ zFOo8~kmwl@ska%n;jYEjf5l-J2Yz+S&{)`g-{}h!;wFZ8n>4df`Qf)>0$ps$Ma43D6b$1RN za04+aOXU5Thk!I81o?MTLPntAm%+oTnU@Rd2YDQ*```bDsqhZ;aP8Q$Bi!Rn8`Tp& zLTphs%F)Bh6&1fySzdA9oky;I6C$1aCH&iQ4M5o+>+6qdK zz3*Nbz8DjJK~7*fbbBBSKH!f|uU>gItO0_EL5ky2B{=HIkFI^UHzzh23d&YRnIq9l8N({^(p2lD3? zukZTfIwAf@!(lluJuLrWhoi?<b00B z-)?Mpobbx?B!(Wfk5WPZU*+QOQT(F%M}~Lkt>PQy-BPRI@FhiExo?}njIO+OPbB23 zGe+#p4VXPGN*M62k(MzlC&#I_7Pva}*^`6U9QE(H*Zl5;wLQ81;x4Q*_{iy`bj#ZvAMnb2?4D?inPr<4-Wd4& z`2%VHm%VE8uHWms(k+_B;XLvd7;Up{W^WFi_qw`q22>qntfnfLHBZ z8kzBLTh~Wlf&?bT=$-yU&=LqdBWY-?pFMS7t>Mb+(1%oFN$J}i(u$0dx`Xc0(_R5_ z{#s?+6YQ5r(#}mnqSOfCRGKZbq2<67(ytlaTsqwb8=46nrIZ(ucRU~c8W~#7{9zM; z1_xdMZ&Fl9>gx?0(zpmR<3>sSzwuEMa(_n{S*eKBauX$g>>_^p5#_bm#*9gEfAaZfNxmP`V0SBi<_J*9p!}7<4MxE;nT1e=EHm>t`p` zsQgCH@gkhvJwB)!t`#4bD5Wcu=$Gfc6tecY{ze@Gh-i>}TY;l65S$iRi69@g%^YH^ zI^nSU!^^CrNY<~Ok-Z>$RZp{3P%tl-k^y=%`SvZ3!#b!_Z)v;#jH|(({_*puGp_Jo zrXC`T5AmYHp;`POkM~H%5J?Y19iYp^DkiuuBqQRk&Lo7k?Wm$8^sQ_}yutKOc0S`+ zHNw{K+QMT32KU@c@xC(|Dr+zT=Uci==2;=u6AkAM{~7m>%Y7XbMq4u1^Hx7M@qlBn zfAY(GJ-~A6%{I9UHW?9+?67#Hk&)Ed#J6XZwlX(26JS74Ug7RWi?fVBbF!twYnC++ zgAVT-px_GC2nCiW8o-65@@HuhBiZeYJB*NC0e@e^CxXF{Cb;10?& zF8LVBuP-?|!{WCT`@KK9{#)k*q44h*;0UI z6H>VMwA-~y>INJZYZdH#sD`NshuK3DG3@cnAeqGmfjpBz6Rlal+kd?dWL{809u5OJ zoEE-t`cgF!Bv!$JatCmGIzR(tEb#@X8oydA9&;5t3vg*BM-uCQ@G^TDAJOAg9>vm)?Z-)Q;lAx!B{$$B19mCAL=Cvgy%Nw2ph z<&8~$SEv8wLHrRp(U8d9%Qvck?Ft|OxMI=M8z2ya;JkT;1WbWg0-Z6%$oBBr^Ed5Q{)*VsnG-Y+8tG^Orr zym~tgaQ+0WmDuSqF96m8dRaTW%vU*rjw8bxQPW|`6L5MJLJe}#jBzUXnkzXx^_lt1 z{iV`cPhT;qs~1)&W?OVkmNr^ppCeDw*GE3&QBT({dr74%bV)nSNIx*!EG!UZM)4bgC^(JoF~9xhv_K$5_7`B4B2F+R%ftWGoEN}VySHY4xG;aB zz=KIl*^RByi%|r4);gigg!H)JP~2qoK|r^Fsuydf%oCCUQP<}cub*2?#OD6qi?2ud zlM<$bO)LDo;tI-V&QxJf<`nTND;by}=<_eXB(BYE;Bh z629*?okTe_=_kKw*0WM#46-ssubZ&N#9oEO-u1JEnNdyMF#cZ1d}_%0N2{)5*t(SQ z_3~pJk-I;j-R@xkNi79n>FHX?4-dt|@cXs8dTi$BQvoi4t^qh8)eSQ5+R}=#iLa0M zGP`HWv~yXvBUPPTz4%UZ*8g9r{=~;>5Yna%c>ddky}ZSJCyqeBPt^Tjb2E#kWVJMl z7j700N78v^jt`+f=O!yFjJX<0Qh+~5ANyWsIwy?XHYjiiJ(GYT|dDr&HJ*JEt_%NVmckV;;;U2tqtL=RWmYlz-~{ zCxuwHxreK6Zzq0^j4ANsyIpl+Jm$fXPEd>)D;{FCNWSoJamRpRwWZOiV%BP*Fnku^Ex z?MOYzGcIQ-h`!Q1szn7uN5XCaAf8xVA~u3FGCgoAfA)wZWoVQh0?=7Bdz0KWb!p1h zl{oS(gOo*ABcH3Xv~W)KA3!UyJ(@xos-Np`Tb%Ouu1C@Em>!JgscthdtK?Nn9&7QJ zbm%+s+Dr+{aAg0dmQT4!pWK}abCw3KKhy8+p~Bt%TCW=YL0LXh{al2=Ua!NV$2HS8 zED)iHhams7>app{@{Ffno zMZ;Tc+$K2PS%1}@>`@6*sJd1NZr>MJiOEXp`+Qqrv3*beu z+=JUyl2g-=8dBW}#A(iD`h96Anj*g21YP>Z38WV+IFo=eY)(3+sQF3^_Xt;x2BLa09 zMi3W-VuKlT^i&wtze<4pK&@2udq2gVrL|hJ9NY4zNb;j-smpxIFqN~k7g*G#N21N< zeWo4KL0wM!!}_MY=5-$wNt6$e<5GKq9Ks5Te^WW^5we2wVKwOr3f(OHN^-m(?(4F% zbCS4WPrHAa^%P;8u>$`C=u0dXKJT~@hMMs(it9hklX}xVjB}oC7gh1tN7-X(y2{Z8 zeuc87ZHvdRctd_H-!&I4{+9gpY(BGokSSDM;+fFHgtC163p6e+5R0W2lT5%Pq0srX zdq12g7I<#-7ei>XCfhI}ha}=K1eato@^l{JiVnZp7AXjnKIGb=`u;fWro$05M;b7{ z5O^otPpSO$M@I=q|F&zZv)0#nCUJ}_4bNW{#%VA{E6&`tguiAix+DhGzSdBprXSEz zNFKpUU^wOqlkRN?91fPwo*bk)8{VEj7$1x=fgRe{+Y>eRIEty_eo4 zA*}R{#_aA*`c6I?Do+&LiB%kv!@MD%zmGEwo8`^d)UFEK5}5H*q2#qD!!nk}>%+%& z8DL(N{<11zyV!uUZ(EW z*F{g(Ff2iQEKK~289qug8L9!4m7wVu>Z!ihO%#yxceOYk?RDMQI@;@N zVw9D^<`23(Uq-a}{MU`dgJ=0LqBJs74ACpa_3#xuze)P>$Fa?*42&m3^~aH|=)r_> zlKj$WSVO9%VUl0F2J2hb>D>qOnzx>KLGmEjHX&aTNgPhIXeeQa_YxDY*$5>Kf}A@C z-q~Kz)O*Pic*2t^XJL%}3Dmb^^fAgOd56~sI{#o}noN<|Pc*J4-!9j0*e->cb7Yk+ zAiNivLl3uWulYs8b^Y?^1^Sn@Lc?h0B$`?Hfb$V<3@BW^nl+9U%uJQ2YsxV?9kCz~ zyQptC=jfAZ?g5$XE1NLd%#y+RQ6NLk_;8%7Hop5MUTUz!BckPy4r~?YPq7taeXb7nvfg19%W;M`J%oW{CFo$S`{)jITcLt=wp%1#5 z^ZdJUl?r2hZcY{t8ZM7~QzG+q;`w{4G|EG$yA$keGPul^PJ+@t-?Q(3;<|}WE*0-n zoX}$hLI6-$jI$^K_2@hWHx=DyoBE-uP{OuoT}SLJc~t@_bc7qa%oc=VAS9uLlqpR+ zQWXZ9k2RTYxLvzn z4~8Drcq%>qtT`I?0MeQ@`Sb51@4S!&t)KeY{UxcQ?zZFnJ~)zixExy*2id)*f{%Xti(4 z(H5!4QhVApUl#H8F}?8{yJ+i>O)n4HM}8nVF%ga0_M~q@*_j1})(wk~u%|A(g zwv@h@o~(e_s^X|yp?O3QPtrwKvKZQmh!LOvg}2UlMZh+cy?FX0#mLILa`n1|@zyQ~ z3ycY$Lor7Tn?qiM?mfiEBmLc`&`I&pp}}A%De6tdpy{=mi1Phkg`(d4F`5U@iC-l| zDyvT(SKqyKJz?LwIrN)G#i$Cc^ni+o@W@ithvhhCo29W)e`EqE0IH5z6$glPey2gzKL=!!&^D_7%NXmZx& z{;Qy=7}CdrBmeq&Th)InyL))gnxrsNP+N1VQm*2>97uiRD-#I|Rh^=vuW=QOU6S#5 z644y&9rT(T{gu}09@0oR1G&#ct0Chh;FiCCG>#t=tAXWetP`~=zRq5T6hT4a8^AHv zYpigROfab^@pxe$7XTJWQZU>qewb=(qt#^cJ}Sk>aO2t}`b)q=H%nQ6f2-{Nf;`FW zXFHH*KelhE47eonh*j{6CjJSat+*e2TstcF6=Rp^wJ+Nq%I|Xt80Cnk z6Ea9J6EV&%$eu?g1iig@iCK%Ft>YtvL%Sm&;L%LdOZ>Ga1%yr59cOEO;hE%1NH+Ae z(fF%)l}2BBr@NIx`)fPCy!K|QZ;Mm>=U1ruz>q&te32|OqfW|Myjf4EJ{2ozdc|?` zKKsK53+CVhkRpc|1+DO zfRW<-V5YGOoZC5@WGXPexfht$akEUpY|mnXIgdb!c}J$Acse=0HSiyY=O+FW7P3PSPzK_M698RQld=nDZVe*#S6-aSzDNEMJJ$d1ZwGgKQ8&Bp;A+efW_JqH8H zDfX!=lCS5}3?<(raMY4`WW(HOWrl+1XP|a3#-pV)ql?E?R53}D_o>Y?@J6J@#|`4L zN%E5*9I~YkrDlj7!7(u~D&mN(WXRX8eLq^4wQ#1}vhMG#SY`<~)53Q@NdMi4XVBmU zOp{>t%=BRi*E`n}YXXZ8n3>YpAuXL#d1>*d3gF}t0Qr6u1e<|ag!;5$7ac-9iraDQ zc3s%GB(KHT=V8$u#lt#=->GMhi;GcFvpO<}6Rz&u!I1Qf4V9%s6`G!gXc65gF>L+X zsMG^0k|XJ=ndo@+<%tK=YIL4>L!_)o9M<&s+`n4JOE80wWod8b2ETml_wvd;p&mS0 z zAUXdHn2ruYAXs3G6;#jtT&c5^Xr6o2LU2?e$xtA%e4aeg42)=@NX+8TZquL+BX+^h zj=B{tUG3(Dvk0Yj8e~8|0mPluF3Q=H!X9;vf8m_^rd~tA4=>cE%t(^-V{0%|TXJ8@ zoIPS82T)(GOmg~eR5B!WQp-bvEut8c-FKbVxj`VV{ekfd%k8vs=#cfgtD!58gCKUg z+Z9Jj;LRPhr*Vii_co-c_9E$R*G=_X;a!6=m7Io~5R(H7`b7{NAYszF0~JPy5d#i( zh?m-33-ZF8(YOM2D4OBSlrR48-fRN-BnNHIE;+?~Ia%+K`3-0qvzrrzGktyS`lC4` zGP)$g_4*E0JglRS!(S&)X{Bd;ykI|@I3I`R-tyuQ!SV}I6f{E0oS0hv+peRrQ&lnJ z-w=4OOIx~!^nD^@N~LPHk4(q;WnxugLBoUVWeQ3Dzj)>D-r95)A!rFhT8XF+jX4lm&E05+)d)9<0=nG0mQBVG#6*V%L$7&LHeRi!;`Wu%qADJgZ+;D`(h zx;0=gZ5K7ZVj$mZwz|L241+`nmNwjVQMqt3*StxQ)`-h(nu~jd^`s#KTVj}?E=C3| z@&e-2Qt#v;y0zYC6%D8(U?M?vgk|#2dEZzHkBTM^9)uABY8Lxo3s<@oChcTGkDd35 zY_r4uBMy1WjMYYsUs&hOrdg*5Y5A4Z4WE%4yd1aiOI&aj53rjAXBbPg&)PlEab;AA zfSQ-ICo6Y{+a@a;qK5+IOKVtelf)H@zp5qS>Wf-R;hnV5 zJ1y`#frc0aqs+?`*Nw$)L$iY_Tc3B5z0tj$q!}Cp|IJ_;wHSUW%B;Lt@pHFulvy-K zzZc6JzsN(eh+EsN@!($Z@bJkfQ^vm65WZpEe5<|3eO-MpHtC;W8?}Bzfv*CaY(@BL z^BE+Q=VJG;;MtQYQPKLd2J_g%+#&Skm3zb?qnTCgnmFAg-8<_*Y9t>1zq4l>zzR|@ za1)S=@lls1@F2O5-}yu7xbtU0Zyv`%Y4gf6;cKu`Oc)haTq_k{E(^(XhOa6!{mB=H zr|&Z^LZp*&3@6=NxL*g*;o1e68cM74(x%TabAZ6)4HAr4c;>qB@aM`te^msg_+7Hj zQqDeEt%VbkW(yq2J1KWYLGWcE+}z~!$a29>1VR|l_llX*SvXmHVWp+DqR*j6y*T#> zAh&Jm_R2$G{gg0B_hbS+c<|dhmDBI;eht^{(~Yd<+9turFYH=lIh)tNN3g4obsBPX zCtM?Ta>xB51OdgThaeFCCLh=mBFI^Q6McrHy(b|2G&wR_iEw1$xgIvDgtuCjc7x8@ z0lqto#qBB|`LHu6WN8&edQg3>HyrWw)MI(!A(-2(y#d5=0pJUP zsUyAQLDy0^+8W|Ww&iU;II3>C-s-&!77LXzP zrij9;em)xz5NZcQHLPwYDE9e4IbH@K6 zS&>sNE_sX&o0XcM=K4e-A+pQ0uK%dl^QXeGLdaDkV%zWT@3qOC|8~?rfQ~^}Q2EIt zN$KBid$7N*dp&rvn;1vCI@>}z7qQZcRN=sc%=-DaYVtf6RxT5?ch-kmUuJD#U@}+h zzo3RxX(tK_2scv_*TR$*w7GMnt~biGL0DXvfixd%z1U*RE005aTu=p7#UltB1^IdE`;Jz zql`snkt`<_Y*DfGBN0I0+3xrLknzu^f=<|Z-!Pk$6-<1H6C8B8_uMDkLT^Bk?s}rt zEU9^f-%))0N7GM}Cho$Yemrn;ZB9l#qzJ*u$)Up*E0)A8wjn-TSfk)wev%ROEWM`- zjk9oZMs+p8@smcPG3TH}^8P({8CQxcWKZVFoY^XKPI~a8uKoPW&5QV9Ba06w%C}?5 zSyyY;XNIL`?+&l#yL88Zb#A-%3F4DSgx&*7*kG2e)F=M2f@<(=~Q~YSc;NIYeNB;oYLWB1tC;u^( ztet7-9WfTRl3g-7DioVewEJA8&190AJ60OMAMdgr#z12U!0fkZX*i+EWw)?o_e(Kp zwb1l@NfJImvBW`_oGZ6l@$c}^a_``ydfnKx!^yRhN{y;{r-zwb^CP$#9bGdIONJ9x zpX1|At!=*$OA*csp~z(H>DMdw*uNXhK<4Y?-PVzKipbj@UkPX%jJGQc78{ouLr$m* zD(#~d?R?{ATRW73y>ERDi`C&@=g*=#F_OoAir}rO5Ph{^jPC+-o)g_l!s8`;WRdrmlze3A~Awm zu}thOYn#F`YOFp1 zF8wmRt**~U;$Yq{Z{MGdOfMA1D|3El^ULsmN54$0x`;_{ODLTH%;O#uO%XmR?=8jh zqC3bYP{zWFU{~ItkBhrgxf*Yp=N;xMY`W(hYr-ini1Px0{Zq1VRNAo9Hye>EJU*CS z(7@K<+1m7zjG9A}GPfzp1dU+eqMVuQExb=hx$i2ErIJ=Cb*emxxAezSas%YucSEov z|KP!zdkw+x_c$8)s&bB>og}-Td0$)T{7x@lpEN}PAbD$VkWF|}UnrmeBntt8;fat_ z8{lZ}1D{h?cfETN(MKI0EO14WVR!?A-(Gz|GOLqc%56ebKkfU?MDN`C-C3kW)j&V7 z1L4J}Y=7{P*;|p1BA0KD-Kl?1EaeXc`tx`{K7=A5z#SB<$i9LW471=8>~*5_l5gBn z7qeAUEIWl#l?%uj9Td0&euS1%g)6T_Eg$ajOWj6+uFzS?tr2?WWHNo*re<*zzOs5DU77+LStZWcLrMcvWgEB2r?q66 zp_apy$wp3^p6{p<%2pNroN>{UXJoRYx%8Ze&p!@6XZ(YckGPJg?NqZa`)ehS0LV`O zF3e8kO__xrc^TXFSuTCt*KA6lp8?JeyWLNCpkJDDM@75l% z9QsSrk?oNy)?7H4Q0~>>)a*&@+PmdJ8Snp|mtgt^*Z|-T7sxWq0Z@#EVsRq^s;Ki( z&#r+O95*19PGL)LHg-ys!o@txvFH8eQ#p&*RG^ZpUGe1(CFSt|f)D^(waKca{zNs<|E`zsugwR!7wC^q2MCE6GWFV2zu8>3k;B zbk|bW-HDUCR!92L^raiJ4WT57|IG(_i?ETDkB8Rz5viz+Errr9#_cPzpNj@RsZhJ1 z_MRrLu3>3>G>~G3oO_b-R8qJ2^ZUOs><;Sn$Jn|rMs@*jm%;~LRN#`-Yiu4SNI>mf01ygIoIn8HNw`s=j=f6aoNo^Q@~k!ASJoyHq*9ffqp=$gi|tBk-#0e@ zaP`2ewfJ6tb~$J10^^NSkcZfbQn$b#KWRth{c9nC=Rd=bnn9F2kGIfJ;LZjj2`Lo) zZR+cfjr2i~7}~so_V!^>Lo42u)jr7X947))gE%XSeVD9Dic$(Z2j+}X7GSmm*@dq# zA9;F@1Vm3#!)65T&qq&OtX?`V?xy@s(Ed^DP??#^^FF@|0^s)mO3F-VRwNn|{&=1% zB4KlJO+uuzb&f3$lc)W8LMUA72*Y%J_;xdiv3z+Y`k?NP_)Tzj`!G-w*XTt6OtE6!&j*(gmU80P>kam*@_A0F zB@T?N1|^=As~gYmublwnThREY}ww-fU0k;n>K~jk`mkwo9HmqeVn;UYOOQNw~1si`->QI zYd)AK^pnJ|oBVjkh%{d~QQMB%>$u1f{JWcM@4FpKf$zKk?$pOui&ISUFR3Ug?Dw%E zC~O%YFnO7nN^Un>;w5{1d4d$;dq&Xi{K8Cp!mFCPKdeAn;m2(O5hyk2S#|wtK+~OS zjd}S`f)$B%__5^re4RckdINliMo^3Hv@7EKA}~7qYc>W3Ej9rXic*(A*YLUV9tH?B zTc3MYwFkh3i)OtO@{S)_;8anmOf4gJ_e3&^qND@#Q2T)#{Db*K4pKB`dmt;Q(`?47M8WX5>1cklqN@_3z#MKi=-b?-^j3uGXiWV896 z3%{Lan>_k#`ARM~Y-cVMVtC@>f|{9SDqtnJ3ZpR|@vzZ!3*v_U)pK;@8Q&d&A9C!F z-&5+~pc(x~nh~+-)OSHz03;Mn|1}AiHakUN!idOl-!>Xn?S^|Fp3`v;bHv%2(r~z@ z=aKD^e02mAx?D2`)zq7NDmD@b4JY{&UyEdb! zyH@qk@d{ZJ9=?tD$M0M8jZahipk7mJp>v(zf0o~U9fSfQ`9PN{SGQP<4tJiW!d5_o zBm%j)Tqyk#@J#)h#nNb#>ln%(Z>;tdM_4S5e%>4u{>qY_HkGsfvsoNR$FO^uKtT2e z?7`(^d_>RXRzol2$m0W4$a3v3q02>R7&Igw#Hnm5s5oM30x%aW@zWb?RKlL8aUth- zpx&hI$7pzr!1XCWExtfQXUt;VdQ_tdP@PNVF4HcT9YlEehx&AFoOIl9a3Cx_TKnKt=dy zaWV)m{J9MNNY4Q4ck8n5D6Jw@VO0BoD1MVxK}7gLJ6m&fCWVR-%X#s`-POt?{-J+zO8m3lz+@ESWrk3aF*I#KQ(lorzU zL=i(qf<4(GJ39*P6~aW7zlisD!DdwJvfF4rzs zWImCMtrMqlqi2}j&gC5%nL;HgPt_I9gKyuQ45J5I788--a0&uKfwB25gYY?aSEeLn$AqQQ&|hX@$BDKzI)2@MA^#j@UIG&AO4uy_4^5L z1|1O6lY~?gd;;uJR!Dwp5V^J=Xn-ceq*dLNS9n&5%%V<)4@0E3ns`;8fkFUqzQSdA zI3h+C=^J_gC{dGtXCSCW#`@f!eZs@_)H-s+zcMvhbadDD;u-##ED!NFmfN8P@6R9Q z;{4iH9r-=dSSxr`oM@VI)a=%55D3h+i7^p~K)-OMazr|O6#FvN)~yIh+592U9gt6K zRTTcvt?|gSPvx@y9$)Q0)%I@?cn6bkuO~BT+z-R3wxjXXyF^c9$I8QL*v6_vZ`e^H z>E)B{05e!slS&o)`KF;0S}4mv%TdxJuLQfwR_I(Cz*??qihsgv6fLdPiNFGQdKJe^ z-$B73fLur++!RJjPBOaCZSoQ_~qw_q|4=@Ta%|(Osz5E#nG0KJ5!y$Su~~Iq>=C!L9ddJkC<@pqmcLy;OZI2 z-3o&mj%-sZ7r&l7)`ST$bIgmGzcP+V!XBwhI1HGuVDbE9LgwyO(t1hS{&&w(SVH$T zNceNcIaZzjlqT?{ptyfFdikNpO~+YbD>V%AmwpwKvh=F9f#1q1PBQ8 z#XrO>wMJbhOHHk5FziI2^GvR4>)m@33nx|miueg=SdS7s8 z?tRs)&{u$BB+)ywb79_1Ln11da4fQO8Vi^Zg}>8-&CaR)xvRao9xPoIZ^v(`(-gm8 zv};mm?e-yvKY?>_8`+>~X?+!`rJk9k(vEJw_J{3KOP$N~^SNHk!vgX)0GE+M*K|ZO z-^xH3vcw4l!8MN<%50|}gfujo*pBG;Nq7DH`1hz-)-jEs$yYA?XZ(ZwF|^+9U$Peu z#INE$h7R~s*QoqEu8u-UP6Wn2=<)2kv&X)4KZ?aS?GV$s$9M1~gWa-<_pd;LB29Ue zs#-#Y57<0B;jxo48bE_F27#uTk>D^!)(8vGEqqHb42!p}1SY?kyy?gNLCutbH^q{& z;H}J0n>QO2#8*3T0yi7OhQipi(wzkJB|CBDox8gq6rZ2W3d($wVj0@4Ykn;Xw)?B?4kWdA!Cj1WMl*I!WEy7Fyt!0NpmsbJxhbQdXm?zf}1F9ghAVWSP z36+n~7CIe~WF-cA6_QlI$j(U-uu<^@uV=jeu)9d7m2Brd?@xM|Z4F52q7CH`q4G;z z8BP7#YHnToCdlIfm)A$N=E?oQ@kUS#Rju=7Fm%td$ z6gAGR>`r#zj@zhy-u8muhyHH;NB*; zh{w9G_7U&QV#kyL$H<^bXQ>c3k#i*WCwWo(nILVUGEqyAwe!=>bbYWd7233*Pg+|@ za7$fwmpWXd^DHt0zvMgbb3kn`Ljl5jXgFuaRtTuABl<|b*3kl0d~s7G*o zQ86U!OsJSm=F}tSe)E9ug)ux_o_~zzrZ**w38&%m zr7)HoRXTT4vUf6mX1$L@Xo48w65S#yrM9z1pwslDO zR)gA|2U5Zx0O3@mzN+vTn0`I;ZpEN2@ucQ!_|@cFQ;oP9 zxj}{d?jSXCc4-X|^V(Mdhbj9q#!iokKLmEYeR!7_C2XssU-`3#C3N00Qt=jSg?WIf zapS&oS|)5Nj#>@Nt!PUvC-)>LokS5OA2o7tcv3T$GgvyU%_lZT_j z4Ap;hrAW@pE25YPy;#2q_S4Z!<+?h0$=wuam#uZ&n{GAws_?mRC1Hn=g0-*F$XP@V zpH?T1AQ;M%~ zk^E5(5MS_MC=mqyg>4Ui(}{zxE$#v*?j-JOlGW}%|LQ7(&itm<=-8dOWU0F#w14s~ za}(}8Fdzmx^}u>#*Qiacf_0pjDc9Druq<}%kapE`CnQ&E{=zxT>koi~o59_RfKY*x zqn2%KUjknZ^%th`2pI&9;;6T9XRRsE)ee{YrpSR;gS1WEA#j!I;Kw#p?n)yDyYMQ!&6C#!jYJ!%?F4$hE@&dmgClg~9KDUWY0Or&>Sam>hH zM_!4wAw$=aSI?M>hTlF6VQg$qcr+if<_^K(2SS-g(u@3t`z}v)-x&v zg)fF-EQ4KA<`Dtjb~-L8u_90E%2@e9R*yJSb?TC0&t}1{LBYoUuj~h7VO}j}fj^ge zmChE%?_>CJC;z^xry%f|l);fe*#47fsTuc^I6T2mO4^@lZKHC^TuTRUSb$L^3x6P* zDGWDWa1@6)XZ&V)jhg^_AQqRM5Jb-5P3Gh)oAP&M%g0@7xY&QyWsz(k^+Y$Wu-V;F zetwv3J7fIy#guqLlCq`4AGSLIi!YyCg6h@{+?t%PSDn#Jug!qb?|=x1Fg5tH@4U?fTNAUZGX_ke2S7)qDdYl-1O zMd0E0lY#>6-!o0MPm==c`aj5E`L2PC`nNxHBTkYH{^Id>-T>3QyAgQ3%Im0tUp1g zLLH}srI7&-uA{1G9XGzaGY7?K=c3rT0seq_6sQb2hq!nxUzXsDzr`uke4=m8E36gc zXiyAarl!kMp71watVq|lJnHgQC)8Z)Ii-gf*v~dk*q5&FNlRt~vMTxq65!tYwwO0% zIG{=6Ho!gq0K&}LdxS9ng{xccaq~HzS;8ZR)c%G3*5;J@edG$F`ieYs`B{cP))Q;` ztj^Yt&ZusC%MKw1()Qt)axz6+#2V+v<2br5j)A(?)IRWgwhw-I!{zY-dxI@g;%AP+ z%GqfduJ)4k{*_kzdS2Ml`?ju)7rd98%d(YC02l#QBzgh}2(ovg`V~(leTuMa3`u6| zUuW{XvZ0Rb-LivJ*%#0jBlFFEtc}kk&@fTGnzk!Mqg9 zOMd5T`qn`MOzRKB5z7`Mv=W#%b1PQ6zW~DxEA2f~sjsK66nFWasIOzt?yE zyj7Gx$+C_4jd_A=zNqwT#&QpT)9}#G-;XyTFlL*sSvB%967{HkeHZDW^P+^kGk!bI z2aFBFBWL;%Z+CIxGMS`ZGmwC`d}_-E&O^^>0&Z#_@^3*;5c4_PjHSFN zE*@yfZ4Rj<+B)4Pxw9YK%AEA3@qy!LggGrb8s7icUijAJxtI8_n&Om+JyZqKiH3i*5U#Pa{%VwiFAGQ5aM(7uI?>4~ov$cN13%AFo z#GRvr=6ph8=;=b_(-scrEZR!g6MFfGR~6ayw&fUJ86UKj%)~kgaUwuO0o?iN5qNKGs1=?G&2vA5)vP^ zDTt^fpW`vyCt|%a@$8YaY8P4io9|xsF;Fr{#WmRX$6tm3%|4A)hffz`at|QLR+)%hu;Wh8sh~b z3HhG}Dn~UOL~-tXdXyV)5>?T*V`G>gwDM);g}*mxZRw=fMS))fGWou%0ulGk=(;}o zUj-dQNl7r7vU+YV_Bca_u4k5bK|2cC^$oUOv>bmi#+ZnQK$^e?ydUP3&I*D=g))pO z6Bix_Cmk{1#CZ0?+ttAE@aQsXv4ZM3kjJLQ!W4JXZ*ldccDpQh)fin(wwI}z44I7j zf0%XN9NZl3pfU>o?jD^-H2!)LH%^ge2V#Tb#kZyI4|SP@Q`o4Sl2D6k#Sb7AV4K** zJ*nkX$Y-8%T74j->$}t{l`hq+SZpE`{kwbL%r+2MYGy|brs897|5&!wM8{d~n$gH> zKBuX}{gc7I;N|6!_$r-wABvPG3_JyI*n5=_p+N_u6m-a04NfvF+)hUj*Dw`+t(CL- zvwQJTSqVhxl-gzN4aK{bI)lqAwxXv@RoZorgCL%k>G)hkp$!G6?|`#tA#zR!3f-Xh zBZGqN&Wk1P9!wn9mS#PcaXz6Px{L-=<{fuWNE7-s}jbf^-VXvN@Vs`o2cV>8~mn%qC*4McH-WEn&4pPATYb z6lxgnHHW^cEM4I1Q+l>ARV%M(c@)VN{pry2j4nk|rFsE~(e$N!wHjPFx8;2=3Ck0L z6Qmu%)2mzBn)X?a{2vP+Zto7=Eu&@HhKt;B%vFDBaiNGEN_-$O-%UP`pV~7sYmm;~ z5)2E4HgW@YQJUkE`0L$6iWNT`JA_Y|o`=hytAiMYjw!!41aGM@`WSL{Rx&Eck%mUy ztLB-tqvNUiptQ%R$9UTybNp=@4f-yRRS<=eS4K_ERCQt^hLuLKs|)<`)w$A`A%=>L z>f!2-aHC$UVT@N)v6-^ji(kW#%~h@4`JFQ3psT4JcgbN!>`Ld|v?D>q?bcRbJyON< zNYdr;SlHbQ#I|{#7|?ecc4f|MMw)g|1o0>dmCv_3 z`fHrPGgbiPRtFBxG>3(QG6oGeHFE7TE~K7^fs71%GUOF+ROfgs307QW>nQDw_0o3J zmbzu*X&=2P_I4ysVtw42+ossx#zTy?CwJ0(+#jpZL19l+xs7j`kusD-ILnknAn`f1 z0?6Rv?7a95$P?ol+(1+rqLIE?Am<^4m`Hf4nO5uimxqO_Ia8xQf`-3XePWVf5N;%fAgw4Ny)cdR(n{`7>sn6#8wpJm63tVAAb`%dz?r&_Rid|KB7ie!#?> z3K;%=tO~2}Ad-N!Rx4C}JhF|W#B8g|kMlU?%{gS@#zON9OyD;|iTU<7WB6bjm&CHV zoEev9pE_6d_31;;{Kkg|89QBg^G%#jTPyGP*57&R#Sa{q8D7$6c)s<~GveKw)cCwU ziRW&}^7_SZFoO(Kuy2`J!83VoT!Bq26k$-`%=?mNJV4P~$S(GZzasPaWVyRtCUN?O z>Qf^5BZ~r&1WT?&Z@+@s4|f9{lDaQEra?yekg44JFkv7)p2`zeXNN!+?bunlmjQ^h zSQ14W7veMk(k>N*lt=37`v7N_Q$%H&bq}CiOUTcJkL%$!VtjnI z(ErBS<8h4`b7;!-^9JPxrWOBM&)&znvpz>G-e1N<YPj-i;3!x z@fBslnCRkjBE|UUvFCyBJ}*#w)_=Yqi4WQ+ zPV2~__pVzn;GWg@wd+ndpJUP(nzLrF@=YgO);UqxPY?5QdMLs3oQ5mq zg!Y&gK6kP)p*D60zgXDU%MV1Hazlp|)qjUSk!fQnQ)!gp*ndRZCN15sh z+JztMRUSER#F#^XrP?(fY18*yThia9J6g-P8DNoez<2|nmF!v{Y-74Pk;V>%*6b1@(p?p*bKJP3 zTi6|NpuGw+nIBR@5cuY7mBk2k1mAZwwzy;oQ+rpHu{Qn~JEfb!49M|0MOBE&LO}3zy^t%GHXqyGx}r$1)bd+tw7bNH3e`R-agb9Q{sx{Ayb&8~5f= zJHOCLPWcx(*tqY|Iq3Wfm}>t7{luToduD(3HRd}g+efIrKCEH4*b67LCtWWFRwqHC zdQ96;)`>_xG~%37`C$gwcee zKj%E>KIaY+#CST@Us=S&90+hf4@qOWZ~cJ9^sn;CESc2rWyLGqS@Y1#nsKL2A5!@m ze8!|(gdA{yYoSZV6FTdH8Id`pq72_Y+v^(Lf}EP=&OWmO*UNf-cOEDJyY?N8P12E2>*; zvirwNjrZ^F>*og?4gHbivmPGecy%<$vF07PK@j<3T$tAP<;8+5DSi25R*we8DD5P? z>Paf$vs@7KSbN&2%4}Q_{amjZSSB~k4O$Du)E&OW#VJ*QBFr-fwS-hlg{d^A)+{4V z50ecZke@S~XjZ6kp3df}#y^{xX?W(I-FWbWXeZtnH#4CUiny}}basO@3&31a-M9)7 zA1JPj(A?60#C`ByI1`Pk|D*dFyr<6yqRqn@k~pVHR4M}-r+msDDVulWh+CuRkdIar zPNENN7PgJHTq>W1^clog=TA zDQ*b+=kop(+GC}4B#b3*#dqm>MX}xsP(OV9ELL(;@6H@Wcc!NYsPE`}68r^#SJE{1 ztPY?@B)~R~=z87o%<5|?HV4i8H_D~;4duu!5ip6$GSW)SwCrY5ll%2tTGi(J5oEC` zh*&Mr-f4#Yp;z(r$#foBmIxMa7vV?>`DXCWK`?&48%pT1Yg2V(5pIp{fn)OCZ?1og ztBx#-rCasIX>vX@A~iP(|GS!pNsSH~#0McfC^|msY1xr;s^` zotfsgdKTng6$u5`L;)a)QsH6DK?WyS~ zM`V0YEyQIBWnwrT70YdpP^TbEqgG`UE2Ac{4s#HAs3k>BL!K(rrP<=57n@9M^e-AN zNDX6!{wu&Lg3|LXIIlyo6tJ#RY);?o+OG%Q7aIapY#>V(-0V&zFaEc zDRO)o^h4xn-ct)PUSSIWkX;3;WcVc*>dVn84rPj(K7{w!>+>jEEeK+VjfXLIjVACh zwErVAs5+^D05u>l&$ed3Q#D1%+U8(9``|C@#`ACru?vHOGBDw?CUlgQ`6ZE|9Nl`k zglQtsi@;j^CIr(%%Vs}mW~(*7^}W=xSYGA4CrB7hbyxg$RKu%mFY!()eKc92N1pkv zwj)&UEvuj%);l$&k@iAm2xzu7sJK}L1(Vxdy-^W(OXxr>P=jhR6cUT6y5jdPlANQn zGn5v$l4Z)|t7osCIdmf=}t)5-DL&Qv7KWwIk@B4O3Tz z^#(l(0;M1Dy^sULrLs$Aawff@0(_wlL=2H@%tVX+7Vz;RbR8~KF*!lZE##~2-8I&! zro|V$F-k|J7+*G$y)1!vL1S;ek8XBZ&-S^`bDwOfPLgD4sHf6xb9^3iHB#7J93^~2 zMM&I)^jTGhhy6!I+2Si}ysaNqP-PT&IQ`z%Y+O^&<*lM!t2p)i+tl0-N%s~e9=%I# zT3cJ4~Kj;$=icWsQ6Vqd=4@#+y5B{9#Pp zZF?X$=lv5juAt7nazw_dDf%1nF5+mpCrQ=QYoYODDE(y)z$PmLATdKK$`P1}txJ(b zwn4tWD^s;OW7cN0#D0IBM^Wv zK+{FCiv(R#I3%=`&28ysxnp$%c>0|ZxzT;OYNY93>`Hv^Bn)77C~2u&%UH`giB#_~ zC=`dArQEsfkC;S?ppaEw#UNTpVn)Pg5$af2Hi2*r?$v4-7p1JwCQoVw+bIh&K0 zYr`HVSu54KNx8pIWAhm2j$$GqQ7K0Y25V36SxN2Ct1=i7w;XPt2>~iO-ar~6G0Z$s z)4YcWyZ>;fTRtIouWJ)+tuo2ai=@j4xtua{)8nV!EPQzH2zc0_GMa6KpTNeSY!Ib6 z9_(9kyOwH;Z#|-Nw5ZyZv7+@Q4{4owE7+;n;yR0hN^samT@0hu_u)$y!F8<_ZdLAq=1GnZ8wnnwUrX*j4K@N+F)>(sh*>6m47iw*;#t9*PkU14B&+Zmji zj=oq9GOC)C_HNFVG#4fFjclh}G_{sAV0tGh^9XlT?bQNe#V&2QGF1Bh^ zmLK%ap5Iryull}43d&1u^W*{}T449-Go_HMhfqNDvka#OB+J+{=BPXIu&Oet?-3ax ze!C5C{=2o=4FLmRyFoljY%}Bz^8^qUk-ibVsr*%~)d+FGJe~3M5CVbM5B?TW{7foMBHT}A}c~#!{tZWr|^R&!$p>2fq9RolLsrU(i zyIn{jrcO}uKTvPK-E$ZyuodY-#>Oz4dF)YXtYsKYmS$oos?exq`qM(WV5sU$s8&40 z&HJ>FI+;t1J7B8j?w>auPv^$SunPTYIeqxFGWr}K5rP{4@|m*qpYn>Fa{t8IDDu--?BW#3|X6J5)tj2)j04ePyQQg;mvQY9{FFi_sQI zcTziqD@mQ*e}_tF)woa7Ecm^EpeK@=nd(`jqC1sErZ@3s!~S!NCCg9Grx~;^}6x+{cfSncH3@U6p1T zaTH330>n+^9-KuOGI-x@7&A7{S06Fb^d1U1H&o+BJx}X z!ko;pH0m^FC=1Cp0&i`s4V0<+ekIPFkYETP0-)QLI}S;#aQlv z<6^!?d;+|`{r}4!oN1kkn&Zn72=>_#tX$ObgTcMZb-JGm-g8pFsp5>sJU45~XMT9$ zVKE9v@$tv{U;KEJkkAO|?>}DTy>Va>{3OYnZeDznKw!0(Z<^wG+e2b@=<38py` z`)~C^kU_AlG1+wQVC|s8$^O^n9UdRS&u6yM_F+ZI!l9L)6pxCDd-tf&umwH^3rBRYa)Ph0TIIS(NFJj@|2AdK7d@)x{=lS3V}QXUZFz z(x<;Gmvf(luH3x!K{=W8FVanvIebNs)=XCe%TPgK9ZJq8gSfHT_VKpuD|-pXX8^asR&b-XZd7Rb;T{K-%AXC3GVPg z8ECx$6-_$C0q_m^eP=0GL0{d7l7W?ms^Nu$4moF<7P9jb01;{+1OVRIWUeCC+0eLGR6~qHDD$VLMo}!D zapAo=V_~+o*-ip>kCmd*WmiR@3_s%tW9@!Xu(K0>;h|=X0sop|3L^6x{_JcfbF$q1 z^rVO9xE4U8RDuC;Nm5`BV}^i?rtO3#F#~-t+K^9y2vrQdm*QyX@ufeA!7n6f7oMw1 zb9;#;XllQo#PGL%UdI+6iuUQ`DJMB|$7p^fOfQ~I3-J%^^Ds&;A^c;U+^#9%Vx`MS z1032ekF7s0F~jHctt^~*S8Sn~La85c5CsS~t%_y0L}Rg^JQIWo1(Ts#6SJ!6e`*u3 zCeq4YFz}@l;3Bso_opW_DZ!Q}^)KoUS4FFx^^c>xge_VOW?XE(vj)M@;_HtgUI6GJ zC1ec#Oqo6bZI|VzKsZ9WY3Q!Drf++fo8fl$5MFV#M_WFR=9TvUZ^bTsh|k2@X=o=d z7O`^YDXV4l!?B$=M;`(X;h?Aa-QM2=$E(+7N{PXJqnDU)p#{bDl44EK9XR5fe;KSLKbX4Eu6WOk3UwDgyl z*Zp#QlEx-B|4}V?2!@;JwbQ>Td9d#+e^alMHJ&tLFx!eRthEg-R?!{9FCKHyWx$z$xDq-pw+EJP%v@(fNGto#Jnao1E!a zSPoB?yz5lPlw;zUZm!ZIR{7qF{v>b++YuVH!p@MIu%8sp zw}kF=6>cpDOuu!|5&Q60@-;LxVo6%3njptaU+QGVl;G}%bYd3}5cldFxYHkvy^S8i zXijMPx%|;`WBSJ4<34LaX^aq!t}(&Y(-Ca_1N$dPCnA8@U4O^Shcw@ZC* z@O6EJKiO}yPK%7_TbBL~Q=9SIjQAyO$TvLpPEm^no7R+TS962 zX!knKS^cQkTd!LFq^uWEtj>6eB+{Ze(sI30q6A-a($%=tA> z%R`e_E%^#Fe`h2<|LS62>fCAM1E3I!F1*iy?MLD;O1!|?801gDFG)z6E1Tw33TZam zH{>Gzf-pKNr-chk9ZF6937m~LtE@}x_vHv>wq70;>FZop1D*M|#JQpmNiAvaYfz|? zuOuslVJC)C!2`2vcnJp@s6mu=<+CCrfgYS%^On6x$;JSoDlv4VzvS2Y-|V%5?mA1R{-J?m=6u^pPbmYP zu3Y2%!akAJFPD!N(loU$Hr!o%uD)k(zxHg(V_>Ji8wu?zALY=kApH%+Ct@_>RT|es zDCl2@D{>aVyeVy0a%m={XBzh`S4%SQxA+-+d6NIfP9QnsLT!
    G(gXSKY@@Pxj`3 zk!SquGeQ+&B=V9Nqj?q33IKYVSV-4suNO9GbH9(liI|Ws`ioN{8ed*&zQj@8a+(k@ zaVU;n($DTj)ER2qo%y})^*qwsFu!ulg~~#noElV&Vwh^bYjGDy3$y;WMPSuD2S5Re zI{O-{cR#z%ze{EyBs!NO`Xb>7N3svrw&LiKDtWii~mw&te@pUW-_ z>S}_C9h~?Yer$GPDJ`b{*XyFA{MTunz2&-%2Jo#d23ko4!rj*S1HhT=VaWqx;AzeO zK0>R&betsA0vOThs#x3^%HfC@UjyJUXV3_Q(AZ3XN`M*WBEvNyiv;MD`d4Zqg|+K7x^h3oGL5q7Ltmj z=mbE}RHhR$E)I=i5<(FpN~C$(lXMs3(Zo^Hv6pgjUhVuS%|9`R)*W|Dtz6dJl=|9A zJ*C!Yp3Eb)Iidr0re@J#$u{rbo$IjlQKH1qV`caaBN`X;2O#WnVPi89I|F5rUir`5 zL+f%_5 z{kcB-V*nh9?dzi|BSdM6&VT~Br4rkj6JwW8=Ukc9!Gs9; zJEm8%srCiip-&8Fa_rmcxZC&s+5S2BkFCbuE(Vl+@@VtI<9rFdw8P4}J9XH~G;H^} z%e|_geh-PdS~Zimy_WSz5{?<$8FOE>_W6U*G;8M}Yy=Z`_L_8wE}WSS-d8hPd=wkA z4y};uveSIUi(~>KKNJH~$|aH9X|WKIFEe73;q)nlhJ0sAliOI>eHze2j~RPnS~)oZ zz0j4G-a>72&b_@Yd#$s7(Qq7R*eNtFZ|)kP?Fh?ojmd(?wo7=}a+R3f-sbHP_+ClH zPEOluvhmK?b#!K1N^bf=1qiZ|#={Fs^p+98YGulJqhr7{?6a_#Tms&XR+<^bB-Qap z?5aeXsvQNgyo;-7OS_m^kw4F@yK7WKOZ4A$TfH{*DTS7995*@his3C;g;3&a3(M6G zH~BU$}lAxU08D+>=-2ziPy)D7YarFaZsl&O+zVm|= zVwl>;BwPliH1*ZvUMKL|yus*uO4JIQ+BYbT$oSXy2y-VPfqF=ur7@X-B7eNUN1V~d zk4h?;HRevDH)X-~5F97TDj=xLVdJ7dwR+r^qyn?fpa~EA5_7~df+Ms=)h5L2yrj>a z#lW&&%hsVK~^1M|;~44z4(s!5W~eea61(zm*J@=>e)urrIW;q2^Z=4H%>Y8%si z6ulwZ2{AoH#^b$qdmO+HYQ2<1Hulj&sOWYFZk65AAi2LAyv*i%4vzX#oQ|!ZPsg{l2e-GzJ8J)g5Re{u1&Jl) z9)0t4=F4hmTDAHbm?nMm=-{k<`p0$I_`SHF!`%SmA%I|$hLR2#(G}NZhM{Hj>2*|e zsqZ@x)NmVqo8WYpiBVV0;Zs@sHP6jAQ*mgN1Lr!(z{fggdf%EeCBOP z1Pfoq57pKBCw8s;;^Zv6T86%Sf606n9=C3PL&97$AD!K`_F<*#?NjLq+OI*5FWe9+ z?(YC;c5;kXp?6B5$Ld=!Js~u?x*zTaGKju3-9_~^7`www+#@1x7n&~UH^}p|4%*fX z3=N%Nux*)1X?0G!SGS+SeY8Us8EB7iEVWbJASgif^$?)_gbYRi_DCmkl(W7%yA8&{ z1WZaCGZ3cn|Ewo=I$sDshC^j;vUw4Kmzuy2JH>Ss_4gi7IgxdA)PkscGn2tnO;$Dk zmD+NK#kToc*;>D!9#~PIe_)PdxL(5fF~mOe*jx}7QR>#bEUT--y$A4I;OI;=1$1Zi zO_7oMSraDV?gDDn93ouryGJDhUKx4LljIVSIQ-_Na$irHeU!y-N2b~S~g17k!exjMsm(lq=v@!>fG<+#~*QYK-yOTk_dOnvPl=0Krft&7)KL; zFZZTl;-<~A&oh`^5zrZfGVVAA8P6HBzTKrrZ$F?+KN9|$ul{&xTXAia_ zuV@eZ@*nk_9PKlq_ADYL(zLpIb$2YD%U@ici&Ah`5M0a5Dvxt zMwFpMdC;hodfgOKbTi7pVJ4D2+jPb#uU&P#7v@|tr+U~M`&e5+>BJ+}1Whxs6T@)x zsW`yk=lo@`vGb*3++~iO`}_{$dvJnj{G`Gr7<%3^Xh{k~(O@J}`^1W5WR9wV)r!|G zW70ZfU3$f-*_gJTV^;Rl}9P@ ziO4GxFa+S}0zeEKnN+=ntn4NbK3Sziy4x(eWD79La()di4$POiJ_Sy4a%JrrEpfX{ z1woeL{%8gB)C9iIxS-RP5&{yblqUue^Ofbx&ti0QT|l-HWW4RiS$TCw9?s z|G!j0hULQ80(0dc1I~+_e@cdj?GoS1o7m7)+{|yYHg}rMtS&-pZ>DoXAE$x30SDx& z4pxDQDF~5ktHnc10wFc7d<>Vns{ZVw{C!%LKs3yMB)pHvS_2Qt|0{Lw*Q>V4eC+E^6}*1=V2UsyFJBDpJ@P_UjLf+AO`+FB#Jem2O2%;w zfR77f!pw`ql;LBCw`md^!{_hYV{co@-ECpxHsUHAnOqGIa`^7`6Rif#(M0~9Ppd`W z;twrgl7lB%`qG)BUZA$KXwAJ7D@S~03wDkDQaOVGpuLQ6jbb^s%u#eP#-5wbhVBm& zhOxN?QwwRFkBaA0FW4umV9=!O728sD%o|vy&)y&-AgQ&eSYWrIftb0u?$(FgEdT#f z4Nq^x=kr*BDt*jFju(s{PTDSUu%@;qgikRm;G75iF_xJk>4wRn&W@L)GrItY@{M3v zx|~U}n8SD#q?Mx34a~8tA`wa2@K7mHu)eCD-QV;A^W<+L_xSq>4wp4O6H>PyFpU-| z&8>BVXt3{M?wNLeyJ?g8U&P`IeGLO>9P1=N1J{o1zD?>G-z`?WqtnAqi4V3CS)6sw5RFynFL)*4gUTbH1(*Kdpskt}sj@wuB6Y}wn%@UKE5>;wqA z?LJXGR1$3^m;i;}1DB?wYrB0ayoaW=zCMA5ACMD*8E|RwGlO?tV(r{+XM?|fKE}MB zl`NSFsjR+N_jF<7;52U*a(^gApWqSz^&-RUArcaZFw~6Du7rWUpXOM}T;W4ogJMA* z3j>v2yAJEbp3=rRMak@ox$91IL>inM;Ri!-nA0$o zcl={B=CbGJ4j1-*yozwl8*yFEQ(GP??xM16CW+hq;@+0rc8uBfY-IQ<1C$qA3>pkB zj?GJZt`?gKN?@_300)+8!luqRo*^7 zO@ORZg{}{xhW^wA@q|?Ey;)r>=BxlKs3MLfO@Tbcx*u;#wIuSKke~-QYH}^ zO&>EGLRYxbsgpq9CzH9tF;VX${~5v6zy|hWZf#jHruN&VnAJGC4*!WQ#Xc(p=r_do*SF*N?M%+W%5wKaQQ2E zVSpLqjeOKouQ~p=@{0?s1jj$T`_F&6bI-A~xt&QL~f}}Jki9( zbh4SAez%AOFaUjQGRzW^`qFe?DElWVdSRFSP5T_#C{zA$%is(Y$39fVnH;!t*7?M4 zWP5!|`NgHSNun4p7`XM%>X~BlWv)4JvevQNTX8nB3@~}y+NjW4)~uOW(|!+}4+ul- zmR#0!35ziZ$@}f5kl*SL%&?m_59!>eR(^Xkv#OT-_D6oq-UIpj*ZiwDsilTP)`3u1N5mT{tv;X-Jsh8s_LYsWXv2=2`B5%? zJ=cp|%=aSU*TK|@>UJEiVQ%Bc>N(F|RLiJ7UH{BN#&+vh53%4y;l&$q)jN4lN}rF8 zKKUAIq=~nyeU+C3dO+yr9`34M#0CZ<;b9~Mbi-zrIbyQC$8RCBVY#8!5(R12ZuIIm zpUicsg-3L$GZ!fQ?QgbdGgGrj72n>wGBcVEMU@Q{(NLEh`$XIYxn`d;%Y0iD!S(db zH(GZQ;D#vgXcL7|;vAGq4+5XmhZ)r@n>vH28w9=|PCXdWAVj1~>>AkL+8E!SQMhnx zZVqXWD zOp*jD948j`EC`DE+-^z*o~Tx;i^Zn$f6C9U2yx)g{|ELi+_0X1Og_;3 z+<S1iLFX;sQslg7F=zn>CC0$+Vl>dLSK`Nbiuq`YC^weMx z9=lIqvl)_DMUoP}bf@YH>Sffre&Q74(L$k8!P}>~^W3Yk;4U~!MwS#DRyRnBB&@n8 z_bQc*9wNaMz&;d6X*8(>v-m_hNkum>dyC4GV|5}xUM@fG*Fp57^pN`=b%Sap#E)~; zhzUj;dbM61Cq0s~+Sk!12W*N~0U;wNeGrV=bc&n;+IvFN>_Q$EZtYv2j>}F#{91X* zT8q_KnsMB(Pt5nO7S^07=xe;X5T3>MDCG^z5r4QAPd0zB3&cXGuK|dNA_i+Ps1gDq z0?aghSH-~Ym6kPKjzmF==F=5c)tWweMl(l;pX#fy=(0_ARc;xAmmvcx$#*YQ@M_?< z!oM>o#|o_RPBcI|{`Dlfq)3N^)TWn{hpw$ue{Kk)!llk6HpKw{k$&s(E?2#w1^Th^ zZn>l2d5Z3P>Bm(ZiqF zfiD=FgbhrGr5?!;9KN6)9h@rvLCL=ig=n|evlh&~)*IW%vNgS*`T42;+zQtb6!!og zNw=#2b_9VjgJcLf!{nD@EwDZnmEZgXQl5M?c@2Xf$p_hIv$xV_`s_sBX`o}H^aNyd z8A>Q3oEE5WD@I1Xzj?3W4nU!|{{j$vH;r(fScLnvy;ZEPN?4daLy6iqjmIjb!s*-W z$|&Qo(UTY=BZ<0T7bWlT;y(8e7Cd|}Zc0j2dLHCb|0nQ$z3gjT`yQ)j_$3Z+)rY5J zQjsLIZbf*7!bimNgDtZ55s)kKDkWvm z{YfU*^)uog(1Air|Ix`9wJg93Ktj8Lp7Aba;(uTt;nE-T>l&HspJVZ$W9>Zh9lm#3E*eW&r2`@g zpLVs%@7MW~8(Y#d?}06YZ0U3;n?}xl%!dE)sf!r_`>x$pmR|a4x^NqB>9`7ri<=i4 z1oWZfD)kD4``TWH>TxBA^~4=|3sWQ;{!-#c9`0%I(NC4A_T z<>>QTws}&V<)bazg9=S#-ewio%WqbqFRNa@yv*8Z0TG$4;#aD#)y5rqM`|-^B0ph%0IX-!pw6?*WDqQimhO*C;IBk#+zXKpY)cYVKjAx?FgS z#Ma~KRCNp|7NN@X$eeUEkf1dgdher2n6lfb_Dj#dm(2O2FoiQI?R{skb4aCRzCQlH z03qs3_3`6|06^cM=f_x5qY-_#k7-~L$$KF;p}&I0WgUoMx%7#2o&)mioy^x5IbPH0g*{Rc(+hA z^-`@6gakGr`r*BHs<8#dmX?Imdj$X9M!w;|NBlaSZZ=R8&Wk5?3Lvt?KfB+m|9{E){(Pwu=CvgwC z+ea$WjS{lqsel7v+ja`<#Ny{NmhtKK!-;3Yj={l{5Rf=3` z8l8|NVOnO*9^jamUNQ8q@-DSMYD6uH;CIdSY&a#m; z@fsc2X3bbRY%T;w6EzgmV4C(G(A;_aI74sk6YkL#s$SX09&jKrJ_&r5s9ps>xf%E~ z{`Q7@KMjZefCEV3dN%Dy%Jlf{hJPREGpH9|)O>IPpf(P9;s>jE>wpsRx;6VXZiEwA zEoXCB-0S*SmJO|lEb?egX@46^tw!i~y53@3i99%sed|AI6NuQ-4_PkhhstdHC*_@0 zd+2BfXWmC&$Z{aXX0rfPouuBm!?}v6YRO>}{_uTiMP*MaMvK|i5Q(GSowG0xO7-!C zv>U2K? z<+G9a(X9{KLU^jL#8bVh+?u=cJ`*}#EPv=-LF^BGG+m33<5*|C_!@_^kq^rQIE|nw zOj24ws!s1#!t2eBaPl~+=lb6uf*dO)NIQM)OM0^k!SlbE7ifT&Lsg5SFq(>3j_yzO zDM@zMdNUhB_i>T>>U&Elqa0=NybA z0l9upT?*Vkx5RguL7=;<0OdcPKZH`|@{bvrD+gdBFJfHT6JV1iLJ#q|Ie!K|Hy5al zlg^HOAl3}7M~7+Oe<@KXTFXdU4~6Judb-4NcqZZ8{GE1>lLv9n_}<**a`&n`;ai+U z`VW>=Jyn12k6Ld|?+`FP&T~7Zs!g@@o;J9F zAcB?V{)=xW1SP+Ea|GF0^{c!p>Y&fE%PC+*hk=Ijk1-^-8|mb6HbO>h6^ywtP<735TPx}vIX%r|`(k}>6 zdD#A@ZOn`jXW;7>sY+43m(4Y!GCzYp?tdzfGMs-(9vXCjnX-Gc{)qhp0JM!$h$ADZ z1$y#DSjkpJsW8NIgY1Y6#MB_C0?~V(FWhZp3WE3TMLa1H*%(t5g}Vd0u!Nm&&g!2w+Ft0$>qUo@%^g-PR2*4 z)sWif@s{mlQO>NL20uA(Slrq_AsMGeuU@3Qi1_;F_2nzFO8`h^3PKtnNLg&6D%_)8 zN%&^z=-ppSzch(>pK6On%95=({(<|MljtVVNlOHZ4$RdXj?PmH zy0Mj6Ybpu1{u$ilnUCxt{O_xn8DPUCUgb z|4r<(nMeg_Nq$lPe3`@y&KQ}^t%{5uRBie`Z9Otq4N8cwA(V1z%dlc9w(bY6g z8iRby-7QTYYg*H*`eWwbF-Pw>`U*&h^O^bZUp-2JGYqGPS1rZ=MfU{8`wTZqoE&$Y zga6iypm>$OUsXQ{1X~ezv7A3xPKzPvPOZLOaykU zQqhrw?F^zx#BrNJ(TP;GkJ+{N(%|;GB)dnlSIr(g)3hwqyb)apiwASh@{Q6-KDG*l z&UH~eMBnOPk+S{=_En^s3+h zK{Va;3^^)lcdFa2s4MDPv*l1hZiECves&%(R9F%;_ub1mc)5>eg~hqhp}+Dgr*r)E zO+^bs0AfRNjAst!G6|qX-<~fHY?g?Rf%tWaU^ko|50 zwavcqk5pA~_dPN329d%5w#nJ$tXKe+68y1hO{|{BRmpfw1y)1JRG-5IBz*s=aehz6T~N;vIq8P zxpD9@mI_3%(iUjZQYm>thWnSp-AxyLT5dC%y1uF<_RWwSkJVg|_?BeaT3S?Y(N#P! z_8|US_w{u_T$SWrxQ}O*mguX8wa<^lU9BeDIn~bSd&{FwAV4a3Cdj4X3&D zQ&d@BzOOAJj2-H$Bs%MBQ8<3GAn^IlSC$D%%bV-tXWiMK`_|wDZZY{gQ!DhR0OEzq zfjyK?9`woIFMu(%n0<5+RNf%=V<=9}Lmub4 z=*YngZ8=y?3s5UsoddVmH5YXjA0_DuniVY!6Qw(DzgSEKo}vNk6Txb`B7o@AVB7w? zVk7T=C;JAP9?qsCe@j9W+qd`x&)M2cVFCw^YiqiP$idrl^cwafUM{nv2b-qd;pIy4S)6rT|itE03p!Qy+i_PFeuHAax z26E4NFmG9o+(jhsQ>|?VDHTq?gOZ(zkTSRp;A~@%(Ci=2dAMUNEyevfroN>qi{;B6 zkd`E*ansP2l+eaU`rxXmC~5%d@bbjKuHZ1TAZaodK47@RV#`i}_R32?L%%Sd9v z8=|9VsM|{vX6X0f6t*UkMXvt8%yeMtVrtY0y1wK)?|u#0mAF(leeRT+fWg<(jmA~6`4E{a&JK`e%YE^Zb~ z^QZ(minaS%fh$(f8QDWKF=hO0ThUA-J ze3C5UhqI~-z*ftXA#5_j|g=6O*?I7EVSLrc$Kp;C@gg>0f-CLb5l4E1{|pDR1) zHmcwJ?7fW5udH1WJ#tCi2Al}M(^FrK@=mCj-6v|_3hxcx(1K!Gc^S1z9jXGacI(zIo|5Ju3Su+qRSkg13bloRzG|D!S{`jh z3H6Ckoqi4zD==zct8tz(%T1L`TSpuS47+vTj!ibd%2B))6|7!U&b+GKhg>@Rzo>yu z7qjUwng?p$EzMK)yCto)9ECctjVjSYY>s!(2M@94ufK{>%k@VN1NOi=Hy5J1)kYy2 z)laM7@Ig3yQ{88ke59vGzapNljI+w!RG1CZ-=!fo{#`~*Lg>!ew1I*mm!#{miFzb* zg0x?z->j#6FcqSJak3-^XH&ssmI*mw;S$D)_r$;irJsRJWCg{^5TY5=^SINvMoH3m zH?vM)xM}7mOD6ZLBKwugIJZ8_0-yV)OxwnxZ-D>+7}gu-u2OkN2uS@Be*{^#&Y(BQ z)hc8^hr2(qQ^C753une zT!D}tj-auc%?z(?(9t4#Zh_8D+_K#!B$%z-hC5?)eRLSgCYsi(uJ=X#f8C}7czr2L zm3Q=%BiwFYO5c@4QWX|`-5!Xk{*j4)o-nzJG3A#2$Oz~n!Sq9BahNtj znsZ8n>-Cr!|6^}Ux-VY>YUPQg@M`GVFSUV<825*2u`s0p&Xkz)2REd9u%}O4vcDZH z!0^9SL+Mc54avr_-;x+Qd1C|PARG7}OJ5z<^#8s6UI1eZ7(LR_4I@QB8Qt9iN;iU( zgy87zPDh7;G>D*d2}mP~2+{&dD#k~C^ZPveZ~yGtbzbK_ai4OTCNcha!6s(HxH0R) zRn=Q+W>(?A6;D+p=w(q?$>s$)_`8!iM_2>!spH+>;@hEcJ>a%j!W7klesX$xm!H{w ze?6NdMJ?g57*6F^ic$5y2qtLX6gnZ{wHpc-iX+(hn7Ui(JFLBx?Hoaz0|B|RktU`t z2Y)^I;Jy#sS=xPo`lOKO{uaLgYxUTjd0E`A`y8*ye`eD3QUFManvQ(Qd*Ak}R*w6@vpf~Sq&Kf%y0QFF_$$R&YSi+tXeZL-Kh(_NE`)YzL}m^3Jg&&!UtOo7sg(B@V-ofYt>^o7c2i|4mR zL$Cz)J>GdtTl3tOHb8PO@sXWp{{Yxu(VP$a{+Uy+V64MN}B(|o~Z`8F-(= z%;gPx_y{_89&@C9>t3d+P@hqAO#o~++@{zcf7TM}5HevCgO&d!;ZN>3G#ZOZexYHZ zBSc?B`641#Eq`Ce=XGL<JlLkyG4!GurdDr}z_G@$FrxiZ!xX zr}3*W0>q?sX_THq+LM+vEKOza-VtICcAe)u!05n1c6&y6R&}Xgd3B*J9ur=Ihb5i> z=wtzNfMwBa;LoJ0<&WP80C|cjR+h$RoKRCV<&cRcl~2Lm|9xKlR_!BWB~PcPIjccb2$=))KSD?p3^h%ra#n>7S2fPeT@2rEAYMnzWj8BRJMvS44BOt#@%I+^rGCZPYAx4{{Jq{L&<#tDCVu0I z)Et+YBDw3Iv&wqRj{^+W+ktKfaj}J~7!(V3Bp#&@at(4~arH5E&F9Q?j5d6@!9-{o z_E9-a$c$yzEV9%LQrqVDbKqwsXsMviCif;fjoXHxrLO#;NRy$D9YK*Da{6bMBRf*h z<9S{}MnZIxsh!0A^Y1?S^PlT9N8qcDM0B5>S|%GiJCBu!t&z{>nn^P$*{z@i>-O2% zGEBGIm*Tkuk5KYheekl2K2y{QHn{CTHIna&@nd9> z_^`&S#V@!${wF&1~>Mq2dEx(~Da9ZOeP-b=w7hn-%|jfAP>5+$~lWrPB5f z-utBUcW-FDw9tH~yG<(L&3~H|AI0Of!+pR=>7?6R*&q=O;e?BwZc)ksJWZMDL@WsT zb-bE;u;@|mY&x^kU|0)Yx* z&psw6YlcV0hX<2wR%|Iwk+f0cyPYn=K1SLZy(?7hOsX5mYv(Q131{Z*@7GYWd(RhL z7sUT+$m&1JI+4*AhhbAcct8Za4{<46q^xaGLup;V0ZYTx=yzip+9wFdi1IpL1Al69 z=GOUhQci03^ipXgigeDeE~2}M+sv&Y`bOTyK04)Bss1fyaV00Xk4M5^yuK}f*aUiQ z8@5=GXqnv8%piw%5pS^RB@}k-kvL?|okHb9Dt0^ba?U&4=hS}j|FrZw zd1e?|i#bR!L?>$1*n?C~%OHx&YbUM_NOmeo!N|XYq+Z9SJ!OgICo8Bjswy(id(J@8 zRLY;j;vyaB^30lJ6v1#t4X!}XvvX$=Q;=!0{e=KNR_1f4oYGqUy6&<2TEv0xM3zl6 zx`vgwG$oq9zd~34y2$-(TQB|k;P18nE%>4OVf5n$ZKB77Myp#-*>jPtH52G0EHPSg z7^In|L#|3W_fwluLRHDJOiQJ-TrM#<4_vjrzIxawEjiTPZh~B$jBhaPcw38?d--v} z|AD_h5J{**+Km)SsB!aCFM^ooc8g%N6UpPY->6Ii1RGcb; zpAAz>z~8@-lejtcf%Oji`_*rcDx+I^9=*6t(bdC8IZ%detEP(Q?~eyml^)m|0+L59+~4{@zEZ@Faa zB_k8rh!$!YdZB>1#-^zC&eHRmekV~k*W0#*V9gBWad%Xn!hViWu?rI8kBxW)>*+CXSj=o@|{#?iH`%}$a2LIz}RqE4I zVmX95eL^sUPXWrnLO#2?Q^#+XZ~I|)*q7ag+m=ZxT@ws4R1$ac5#k2a+c6lvsb`80 znKB-y*r{_i+ogkLW)&aX!~$MZgo)N55A9^fzXUE3Ce@Z@SMstq-B%@|;rIU!mCOjC zlBm3Z-ZsJGlgeqd2MhcQm0*dUTj{M`qXOV9U58KC_AIk8UrQbJn=3%?pg?wx^0E*E2w6gxTI!uC7Rs_)e zgaf21Oj$@kq&g?W@+066G0TxuoA4@OBBj^w-E9P5cj#65zX)l!F1tDG1W2IK*kL8K_4n(?T^q$40C-M(xIYD2C3VwYmQUcb+h>%%=6y z(l$hMnDHOHVQZlT!EGO)2)49=>nJ<5yJRqYucm@&!1_}hK5%m{J z5WS!{olYq$l$5=)ZTKLYYb*ZNs~t zSmboBPj&Vf(A_k?I)@(z=>bNsaKK6VIVJiod{1(jf>kjhkwg=eiHlQNa3sC=R9Ma< zLvdX*w(OE()oXCGtzGR!@2b}r=Z84nuj|3}X5ahB%}k-|?Z;T?CsmT-7B$4+K=Gv8 zYC@$ZoR&(uTY%^>#=plr=9Brn8ZD9mT=4MsATzsSv2zUgpWwbGWGbNEytD`kQRe(- z7lk$X90l21>bd>74+5}xiAb?bDgC6W_JA=EiI zvB@7D1|hc2U`N~|Px{UihJOlv!k|$FfBwQo{u#7`NGJwu7_fRxYd%`!Og#S`4kDz!3 z%Zts|@NbOqD8Aw9H`f{L=YDLQrp5u(7cQ<}kB#o0Ylc-QK}0tI^0kjp^gXu-hLeE< z@e#zn*zD1~KPa9u1xi|8Z= zE+<$&7#;HRkK1y3zVBK6!@qTsUsuZnM;N>NkM54n*R!7f?`1!+W0n7a|i(zyPG zN}C5<>6Oz2cvGr${l;gsE=zmxNRfYN^H+q`Bw$@RDA4pw8@H__UJHrP3t!}=mnKZi zw`T^gI>q%;ZwFM0RPfm-2m72L;{5uX)3rzbqwHcRgYGlF{$TkbK%bA5?G|hF7YQE# zK;njHKzux@I{p2;4#X;~yz%ddv{tf(bKq3uB})+}ewCjrN9aB5j?VS-&aUX=kgri0 zr_@`zBK?O}uN!F8ntUMcj{y)ULYeqh8I3<3?JGJaE(ECH^`<}1d*?h=n>yOf96jkH zC^3a%OhhDI^sy$3CbZ;hvfiEsL$24(r@TptT_mWm-L&t5Fxmu?LYK?ZtxY?8RL5IX zQ1iH%>T7|l#th@yf0!m^JdnT3JSbJK`1YURP9mu9F-sOz+O zz?bI4n%6R=lU&)QyK*>_7A*c>(h%=uUF6n1r9Z$*Ty$DEJ~C&+iPPw8Y*dW2)XN9s zlQHhxNPt)R!*m=cNZN*GzXE|pK;A8ty%P`Xj#l4ghi-}d?Tq_TnXlV_+a@0Sal!Oo zB}D`DQ-%R;pOvG>6d3zCq(?xC7{(tTvHv~NNf1H1pI*H9pDs@VjX|wd07Ap)wB4hT z;aTWt;ICr(N@4SfAKDDktM=HlHadnd0LU2=LK0zRIb2YoSp66VBQp3IfW_S?-zI`M z9ws`)DL+^+33en;f7oeBMRr5e=H8BbfbK=aZpWt&_uAZ!%~sutHV_;Akccllh5%7? znN%1F%&=hA0K>tnt|$78*r`_Lsp~&@?6xvOPT;O^9zAh(ihUv-BGEpL|~t%@0e zh|B83Z(%5$I9@A`+;=sK_12PlHf6N)BhWPSBG+Vccwg~kdaC78#Q$Zs!d()6*5@gn z3Oe`9Uy^nLV)wBC(ddm1C*{p_B5ch#xA+I1t3i@XacSq&ub%vVZJMJjT&yHq7ApPy zt>3IEMC5PFi>w^ollc_V+@sy_R_9{Ucw+fQ_y$&&pg%6jhv`mPe014N_0{3WG6pxD zRLLB1FRHlEq_laSLo`M@?0S_(HEDgZAQe{_$m`XgKC6e~wh8J-jz77xizbjkV%njt=EhA0HBIu_YKsjI`svnWm9P&c}kX7 zE4If|HoyzuZZ;q04>CWwnI74UuKeuOPod^vV9YKWa zC>u9&l%ySzOcLbXw&~FwI>V~iFnT!#^Qn$JO?R0FN2quNte78)O*m6R26Dd)FttpK ztZn`e)2hq0O|SWw&?*?QMpyb1L-6b-C-ZxPOBC2{Y0mggq8^IA{TS%P^8JZ2dirISqw#`8Y| z2mrZB`pQuUz^?%PAn}JfS-1@+JGwt6LPYtpn)o=zcA?~1$D{U|)~QU;ui#-~uLRxL zY#x`FdI_L*gRA!c_B3XO0!Rrko|Bo69>KmrbBQ@X+)S287Q6eP zmuPVQhI1UGkKGq_n0}M}SeRUpD(Z(ZS6(LT*R#@f^|1PIZ$6|JAvyO4jS9fx?KL%% zIgHH>3T^Gu>xm>XNImOiwI1EJ9wIME>eePw6-tHhQh&y<`~3R&{^NhVGXQ1Q#lSSAzkV-O9M0vyv94{op9SP2A>@$k|-CpybDh)-{`y6Sz z&C6Xq6Y6J&!>bh=gnlg_m7^4DW;U%NLcFM=yy{LME!2lYg*;o3b@XXYZY5lgrOnFF zlCBrOULh|Eh3IKLdM83-fzWv(7p91P8mPT&^k&&y&o|s1KKr|uTqDRj@Po`3sm3*J zADLgx@_qe!3OS|Ml+<}fdsq*bjChtXf>PU^C+(2@R+9+0%@DjZNDt%cXp4Y>71QA_ zI5jv*qpgTl%LT_7#qtG%Ddo1`KiO#&9%ba#^r~|=eKmjC6=sPz3_KyqzV)%_@lhzk zw7`+Cs}BGy)3a%N7um#JD$z$>_Ax@Wu9}YRz8R)$w8Dc4FTAtT$q=b!4_O{$wLfwF z%60ReSls=cN45|*20m!ZTj zGkosnnp50gIaK&rNcj?-QJQfy05>{57{Zokk= zXvQNGQ;QdFsgjiHSK*M|NP$7~+2pb(O*x6JQ?040U%gpTWj@7B*ZJYIDa%#33T29( z3|E10Wu~GRQ^w-OQwA&==-0%S`L*RFpNGlCfM<~VDrz8uF3v|{XJjOc?e-Y@Sr-3z z7mz@LCTjnGY!8T94XyPu$Sz17GGXo%8w1M^7CN@uWM@KhlQ&>?{7Aju(5%wDxfyJx z^Oi2b_=j_OnyAP1f7?QC>-;XT{%S_e4m`ww;R&Mn)7%K!b;LjoJex4vpSdbtRhrfm z(yo&A-w((6qmMg=B*_98qEve>_cjM=`4@64ce?TiF;VvdrN{E>U1$_?Z~!C22>^i! zy*DAD9mH!7NyF=$A|)5bOX&sl`$d=%OrCsgE#rLasIvN1V(lH;sa{*Zb~PpNrNgr7 zTJWungPk!-inRq8jPgDXfSE}sodL_jN@;|l#cVLRy7DZ5qr%r&vuCqA<>T|WGtI*9 z8X`kp2$X9y&M^?L#dI{0!nE)ICwtUI`J_JClx0{G4}A_sk0vGLQcK47Dhp{43#1#u z@Zymh>Cqs|VIDV*dmRI$kjpfmHo|Q)`OEpp3qmV(O_>D6$r;*pO|**q`DLF56es@R zhVtWR!og&MLjh4Uq23%)YNOOSR|%wrsOAxY?XlZo{|E0BuG_P3V$8~ldB~a_sEeJ} zBo`m(=Q91_X>IJ_amc7v*;@%4$S{uDIKgtLt+pN(InS!oSy0m98!B(k$Im(uPDTI# zIc0G$C?OMNu}T$@MTr{siN~1atI^-zg3)mkiONwJI|a?m;kPK1RgA}s-?>Q8v4`lZ zzs&mP5&cSjio~yo{QOk++Z~Gk+^Flc2^LX;pOOi36FUW?O616Y{3u_t%uuuz`>7hM%l-u_B@oiTvRnad3 zhk>>b5E$qPe4IUtB6R+XXYlodws3_?$wR{Av60oBl=-k(XGmRYY%B|LzCT=?1;dAM z!~D;oL{MW<(2<=xO2!PT++l4IQ42un4C55>y*OpKd*o0 zzP5fX`a3 z!SQyCS;DA>Tay#tD|7-`e5D9HOKJ0qsoLhX|6V+~{(m1i<7f2%Kv3nS@B3iF*iE>i z#0QpnYz154)LR}YXg*k4?8gM`W?`!h}IJ)h}6mW=kmkd#LPmn zATNfx+|F1P9i{^vXP1ML&Am0Lf{tN_K^&^b7R%l_?Cio&j6ir%pg!{iYB>ABbSxj@ zkRTCf<@&`0iY8=se~tJUC)zU-!=*Gg#hR^RLo;raVab9pu$V)MRT!~~a=616ZTF?q zg%C2`tw9xpxrUQyS?;>}m{-lW_)sQwGqEO4PaDQRuNOrM{`ZphI8l*5(S6yAN!g47 z8j=0%m%{aX0Eq%#_k)Qb2NW~SkmkM$*M?|!Y{eDIt`(Z9J27sJMasRr4IZh!A);Rh`q5kftsdc$Y=_QlV+q$++7(e(TwP`7us^{=B~a-K?^PBhnYs zHuFOR-NdB4Gp+z-(AG_x1{`~BuFL%{0D8^u_cZSMrt#(a7*k4-LLK+FzP!Mn4l{p$ zq(1pC`;pM^&__8INOFlQ5GP2NC)(PvJeJGaAIha1VK;vf1A))yz~w7K9Z(eJ?-t4T z!x*@RuB;7#JAytvBMZh?F(!x|t_L$LJ9qH5h8X4C;{QVO+nKBPhS(8TH-kkkl}fS-|p=5465pd)s| zmWqYZM*1MG7h-*Nf^ML=+w+vEkwkIAb|E(OU8SvVA%`!9)~y_3mVa7y&f~EwDh*yM z&<|K36hIYdE|jxOM8wlE$r`?iDL_jS$8z+e8!-lpEI7w$u_Q(zf3*lYBx^V*OIb(p zcTz{G#CN&Ihul#biH9ZPpsu&_);2bF&*NhLB(>4&OXqjf&ZQ`g+k7@yjC&5EZnsq| z6(gR#GSs-a;kxhW4>B+wRhT3uj)Z~?43FNBOWZ1?5ngZ6iwkXU9$M63l@It^qd15Z zz1b{P^n0~X_>KfL?7mRK(7I&-a^dHqpj&^8LPMd2F9*RWz^>L@zEjd@0uEP{zuLh(NZeCSYmgT{-P)e?4S5ed8!oUL0tDBa!17 zZ%y8N7A`|e2~Zl?(K>qn7`N+dZLmX?)2I~SvFNtb=cwtmnBXx(np9RIW&Gt15~c?8 z1@D$GI&czW>b*8cc@UF|1F;%#ia+W*6!#O`Hwbr1i)UBUEpm6aX-KOl1jOI(VE3*E z72`hss+x2(3jMQ&^=Rcoyob|Ye68U1U!g$+kEC+UNAVG?=mB*DkwpO&tUn!Ayst9l zi6HD^vCD`0KGO<$e$h{*dsLKeR5kqZ$~r}kd*KXLU?BOzp^^;NZCgkdzD*r*SyqGf zrGYcVNGw)}Q>Kdqkh;{i&A^ug0&;()EfMxZ0^R@^qPE1}&|^QJpS;VC;h$8F(E=!# zIJT8dZw0fKWyGgy5P6v6E2dr01$S?0aIBBsyZ&{Imi#z4qm20XKpzsQ$3=k0&`+ zc{44$KmczrE;8?1Gl*2?q=3ew3Vh6#xX|nYe57BL3N)Fv8}N^mM1J-q9~|Y#ebcn< zteFyg38Isk&EMAWLD@(xG3M#ZlE$3YHY8fM2W&escI4B#&yZv@tIi%OQ1nC4`WjIV z8^D^NB*O+&cZD4#gFK0$mz=z>HVPLDpn5_76luaI9#y3~c%RP8z3v0se+LSX4AqYx zp}F7hX3&Qz{XFKNeUdLm#ATy4?axR=*v9^#tzF}@M@lO3ZGm`!GoqE2Z()XJ+!%=1z~f~}<0&yfi^2Hnaw~03Md>0*l~*Yk zSLkDVkxk90UB$oEI667@`w^^rK|HOoeBE$sVYZ`L@HFi^`hN&YH2NT*v#X07n z##>mQjHN>Q*iO65GP{P*j(H>`IU@P^-clNag#F7D0R6R?P!gIhv$a>c&ez;?m9r+M zH8iF$QBsVkD;zd1g9SDCI{Uvit#jd$ENs!oW`9|k*<@y7DqhG&K1=)XHOb_2_u zfhzk7cC17?nE2{jkoU6s@3u~qc$57}eRDXnqw6H}<9Bnm-o^3Vjq=ZOH7%C)=k(~O z8_x>?UBg($OUgIfSb=1A0lZXFOd85H4tgsan2CZgij5vI=?di&qlk#iUFnSlv5MY< zAADc5oS93IhuM$X@fBI&rMrITh}B2-Ez)`GeFpPyrU^WH_6gI2#e$i>WbYIbJt&Wo zBTKXzV2r2I?f)JdgK?P)#X%I0Ff?{eo+LGsn!T5 zk_C0BKW^`5ZdR)dgC;lo%OluKe`m{Ob02S`$}FAiD!QFvFZ$VUq*XT>jiu#0y$oQC zI&FP#;_4ot#qsRH4XOvtt~lJ|(IHe&{1t_?13r47%D@0ws{#p9viOn-x-4CNyyK=V zc3YLhAFmldtQtlm_|?s1@%VdR6T^4)hE0=~s5Umw+pISI0h#*Tmo)OV;U7u#7Qg`a z6(Iib_t0h%+GVY@&SsP5AEG81<`W{Un{ zfec(WE6L&fDcQB~<%ULV-S+3-tie_{t(x9Q_|y~wtS9?EnEj1J-eQ@|e%JtWGk}IB z5x)?Teadt*UTJRnGj{lwvvHrn>AiR2iAUe~kpW_=|AhS$n)yqVV6GzHS*s>Yy6uI+ zeX3-<>}ode=kk2)<@aBV_>bnZICnKy$FO|ZyE^TaJC*RT?W+%)i<5D`5QoSFydfhY z?tmo9Q;ms&66l+^px9W%1Z{;W{l~~$O+oYb4IUMdhi2ch#`NX6m`QRZjBuT*zngE0 zHtxivEz8rn{F+oTJA499@%C}LVE9tsPWB3s@DU2Crj>Lk1NyVbw22Z3PE%POhykS` z&E~!2+?L&FH?1XVJvN`Ml<C5}UBC+pkoMx8Hk%QiPY`fRGr^mPVKRh^Byg$9%Fx4A6uGh$X z)UkAz7l(z39QK3yDe4`_x^V@3caY?87$B5x{6Ew4g=oH5R8LOdlg})sV90AP3_jH- zeJpQi7eLQ5-PToEWhhOrnG7(K~edX}U<{ z$M86n&yz3x#yPj_sx4o_2N$xfS(_HCs;3g2mzLQf;u+P!mko25tkTcSXL>%A`u@fN zeWO7e3uGj8Vl=0zyEaQI_3)qi!QhZp!emc#22}9kR8e0gXcg6*8yuFCU#CYhRuh zZxd=LpDqFDQ)%{Suwq#{k&Ag@R`|x)eE1&HZ{UAuh>83xs(a||sbTDt@cthfbpGAq zYA#cy=S|6L8h)@_lN5@|SP%EPuDwE`VYdmC6bb3<@RW+H)R4tVJk0?}QHhu|;$yei zUAhizrtia_qO4}tX9t;)!|5>@JMRF_+-TD-?EBpC`bhMLx`JTL^sl$(IUW?(H~>lE z3>s#~X3!wGWUvN`{Wz#CBOWqj;plJcWeYHh-F`15vDEZlT4R<%yOuLw=%&U4z{q)# z4`f4s72WHgPp`v%gJIyEhdcLEYUcZoVw+Z~nLhO9eK5Jc=IjBmNC5PA1JJVlL{2t~ zQB6)FCU&E)Mj5nQ>#i+eopfehADYM#X+Lc?NDTa*=yqmun1ONkX0~BU7qbK}y^c0I zV40k~{G!CR0vj6C**y@?O?p~q`AAdTQ0ly{Tm@T1sIqCHSE#t?HB5{KX6^|&CBetlz6_kX5m%#6VM&xYAsfll<73TRRi8OQ_ z2bdV1QakLW_h1BK$Cxk_{2UtsZC`1~70|JG;eI?EZ}lz6{zzSGrrXIN4>s1n^a?Y| z$L20IeB;TW&Vw{R=lef!@3HsIryUliiN2pEV@v1n9wZ;nV*w!5r&~FkWuRP$PV6`0 zDyv&DgD!~A)?XRM=_1fi;V}(;jjA*mzDRA$faebAo20Yd^+|$E$arZ0*pmlFQk;pV zJgr8ZnQ=?5zdf6 z&c`a#{Q9#JF1Nn^cSm2xYaXZ8^DpW-0;vBA=^pAwYglm?ba{~Jli5}g*8lEr2GaA? zHK_ES00NNweVmLiGlJ{g29`Ynhjz815PDOd+$6`P!Q%kWQe85GWsbKzSlNF2)nGFE z$HnECxQ#}P#U9x4}8HZlq_pLpgZ@dxvkT&X3TWPI~fKIclJf+}m572YT zVW&?dd7zMYEm}(_1>tWEy{~M*p!-(58=3X`CvkWyw4E-E8FkT8>)Kqr&vsnt)Qu7E*5!&Ap1p7h>9qnSdJT3P z!bYQ85GtV;CW^FWa#4k1Ni4M8{~qWhIf{f|hdC&u_I^x4m)GF{*=z;IYxB^K;E1Pt zh2_~}g!oufBR9-g_EjvCQJ#%7D!oUIHQiR;+kbeB^jZd-zZcCX$oQ`mW+#i0BT~4(x*pKCvUvk#LH9q|a_dn|k5!5LyGk&%l4J{Sk zI90^r=WTUAbByFtQ5#}Dmrru44k?XlL>vdqm*iGf($wm@Jjn1CYG;f{spX~O{jh?i>MrM-w{+?9 z9~?J6ubrB|{M`A?62^MmWpWz)&s?3yQ^)WVoVWXxNmatJ)82hD$qFf5JC8EMT%MAu zr--A_nMmeiH7gXY^;XeNALJF&EZHXS%E`S zadtk{INM>}wZ1^k@PLgY2K1ZIAkDZTtF{jMPk-g*dt50$^^!lTe5*2rOv+PX@1+p_ zuDaMl&De(rsv_4kv#ZB(wGU=%vrUnSBmj(fp-6S{uPFUDz$!;#dUWHbALHxf#0Yi! z>)su%fs&(bCe{3VjJatX#*%5>f+=CT5AtZgRv}$tz*hsG*g${#0qSVCZ=9a^O-_Wt zO@M}&QRHgEErFl8p3yyy(rYM2aunLiA^hT|58*13z1uGw%`4DR!LA5^^VR^Oh|%nyF=!mV zMR_sot`eS@m?J^Vt^W~g{K-FIe+87%_;p|EyT3CbN_g)SHvoS};Gxi0c9!%!2UU59 zi`vI;X`eO=ZrwH$99C zsjPM=m4f1x>S84dZnDBGa148sRf;k?$|iTvcgq*WqdS@;*I1K_!l0s-r}1JOe$;oa zYkw?lgm;j*gW91En;r#&a=u-xTn7^96Y|w+UvT;&8+}?-1cn`6pT%`qA zV_^2RQc4%_s*uWTpZBc0o1TATHpBmRK&nxyns-X0o>;9HS-Ocdgnb&GFmQ0W0}<}} z%vIs>wX^dwq%`f4zje-ooN*z2l!$`#!@ADEQYc(%jK1-X_SBM z1E~8L0d9nI*W)9vkT}P9Ul+%a2Pk0MZB)FnLD=FApKHgn_lmc`Hr$~mS|0ZV^t|QC8Bzi*xQ!M* z^!F5c2H`E|jfaW8Z(FNE2*w4ZuNXb5o?Z@$qu?7Y6#qh;BxWb9Yp+ur$2fk{OVaYz z?1$@x7K_*N$M*Ye4_48b(?yY+URG79&IXU1C^1)A&ic9_!aA1$9_3KH&MFx@J8E&+ z`{XosgzRd7dx(}dxin76V37Na!k;dpMI5G4X10)*pHzF^>03V2CPhmTxpwzbv)hr_ zugd5c!&m3^EJKSv*xb|z@_=5~b>pbiV^`&ku$cc)xWe_}lfkDCROATt-EPI==)8Pe z=-@!=_G8*`K6oW=Xkh3c8cvgGNcr9rg#=$2IwgGcAkim#S0&=rduqp>!CO~TBJVp8 z!RO^s&Y6AE*h+TAyE$4bOQ)wx7OA3YC8t12dp^zQA>mSaL#?{wdFM)JO#|wjIx;FX zY!CuZsvw((T;c%hdGEG?6vtSYG>S3NjXJ{;22ddR<6_6$h$taRu5dn?!P8hrE+98P z+sCBZ`*7`y%Xo4%7W}*gei-aw$IOi{@m*A!-dN= zIgAQ!8B_U*j@G$6xqf>6y;#?PsOt)#HJOMM36UkzEyXBdlQAFzzSMiwtHy#kf3igC z_1_G@`r;jB8v=V`2!X2*A)oF{x)ReKbCQybe8eX0tI1# zk=XMwHiTdV<|k^H%2*hT2qEL3j-(z{woMi!o6&kl4G^v$peDF+059i2in}Su+^a3s zLS)|Br`e*yKfLZA8upVR5BN2U3PScRxcRfZ4udHk_whV%IxN$rt>Ld3spQ`;1$NWv z>O5vSg%zHci_93T*8!2=l~aCM-*`F!d!dv@S*=lbdb;^dVd&9lm3r&5eZ$-G)9eZBM;s9mLLslP3m$&iQk55RYu5;eX#lN#ec}*{YjaLE?u!8;zG~CPmeFbGfGD6GJNJai?VdmNy|Uz!?$|T6BhPKp%NfXlg?# zUA2zddVqGwC7lEjivhaBnxot*SVPL&ZSj6dP{mM;zs2Z&bZ-|~ z9zC&C_^aF^5oDrZy}3XwIT)%GAEekRcckpyLF}4cuCRWx4n7+O?Isbqr*X>lf2&$`g7qYh1 z;(|QXHVOMoW|X!TY0lfNXO@MT5Wt_t8xQ`TR?OGLr*ZDAY+xH%TXp6GDH=b19sM+| zOO;vx#LD%*r5;Dx8D_P^qG zq><{NhTOA>wqwvpSiiJhU;g5~_ow*cuM<D^P^KWJ@F>)3=m2hRVCvF+D%! zZkTdF0ffMpJprH(s0$^1)K0b{H8P@7CzQsROhF0YZsBMquJ1xShm_GY^VJ=uF7D#L z7mro{8`J)0OXnkug#`4BEkc5fiTFQyljxG`3`jNZYP(^w_nfNer&L%X*zw6_iwx>c z@mk@h-G3q!qJEL-FjspNyKAJQJf-zsKI!VabawZf95u-SBg+7w@dR+}->LvWjDQRe z;JX?VS>8P{4r`!Qim$PqXZF8i;W9_x`i!VUOUK5)KDJ$4{iHcvB@tD7=OfWeH(1JFWixUk?vlqr!VknjOiJ zle{)!&PFBE*^0*e&}#?jILJe%ETj3~k=xby?@v{nr~OCZZVgXVx_m2YkJXF2_)>n< z=iI8(SYHlZuNxKvNbCT&H~<9`j|FW`)1n4csR5*x$Q_p6$BqM(s{0f~PaC5jN7b^? zZ7;lsZzG3<1+_(Nc5Q1+=O4r`Q?jF7KPH&y$?)R&Af8{9(E;jhQf3hpf zj6Iw%Ud~c)c3KMM^Ptj(-2@nXhs+&63R!`TGO7;DH@Hc$Pkf$5yV-vsTs(D z+idRfFR8i6Q{R5R7W+Vd0FG)2h-tU|_SU-<6c*(7)&|&*jSzaDNGVvRYFsHfZ-=i- zF0EuaI8O}b`G^Ky6Mi2%t)Uaag+$m()b&|%F z$L?W*9_;8_7+fz$*GyCLJxyCdz(wCRNb%d))puqjNqUQF?TwlOnIfeMccXyKM>2n2 zQHr;Zo>w1MH4P7j{A9Zw+Xp3yKlr-+LpC&pC z9W9U7c&47QXYKzD_+I1PQ5Am7AWKeRBTCS&I~qWs2;@yA^IEKs-o#4 z!6ECY&v|z4?4b3QkRT;QVZ|0Cn^f-O3QG^ylmE)Jy&tOniCekoky79ae!}(1x}C7% zXM>2)nH^DmgtgOihRgeyV{H{b2Y!)5`Kn;Ew0kr0iEEWfjJJQw;BW>r1t-R*Fn6C; zvJVEDd}?)K0-3D_@b$jm552D+svd0^-Cs*EbWwBR`+&YQsDOmu+xx1ubn~9xHW~o5 z=}i!|wgVs^h(feP{}7T}cll=!TIZ zqHHjvI|Kx!8wpWDzcRYJL%KT^2^rlXCEaa-f&zlP^Zf^&AD;8M?)$p0bIx^47`01& z(g$tuQG7pQ>$>su{Z~P2U>Zf_{{b?<3@^C|DZnhtkZ!w9n^rWXhxj|lAmGL1mw=5P zd)|scwbv4_hfg;v-#=HVdAH=%6af;$Pye7p;1QBR0A~GaGEfCOGlo+}t#MAap>(y% z`_q-vJ8zGE7h91DSp>KIE+u@i^u$Ad%*FY>?Q){$_n=kx$KetIACUnE|Ggsld-g}q z`GoNohkx8)wP1nA5kY>iWua|!#@4R~(TK{)2=eV(z+@w1VqXB)FzFYGeigDV2()`XYY;HDqxmc-GnZmDG5qsS` z`18sVMT`SbNICO?z^FiMb}*p`GB7_MOJ9-2YuPKrzlF3zY~id9)i=Vl4KjsPxC#B^ zZk0ll>h>J<%zJ^770+(w--C8psUN@Byl#DWUHDh6q4V!-VO(@EXR@ZG8w-4$NzoY& zRLKI=WKwo8uN@5Jk{Lm&`Q!&s@Hs3z;xdNc3dcV}mqp9>}HKHuXTQzNQ?iO}m@vb)1&;HEEZUbmn52{Z#>*uu)_WQ$=Z9 z&kzn=BM(N^B%MkXr1DNuBzS)&6t0FSK42|3CKn>2HeO9emqn+wyNA&6_V5Lh1fE5! zQ?j-vAG#6}7B@t#q!?%97L_W{6}FHMamV1^K6%6Q;>~ASI@4E1_5}QnSlAVCOZOWE zX3?a${{xJv97ZASN%EP$5(qT>X+-xT90`c^cHQz_>T)=OLQ<~>{hq9^Z6IAb6j#c! z0^n;_;kQ!sjQZo}RYIo2{G9<5egqz{0SGbz!mQnoVyi-eC5m)AgbibkKbD2I5-9Qo z)4f`*BwVi`Dv69+C`aYMkt`Z|zECUEpS(MJvzY%%`NujSPc1UoQYC4A&ril`nc09) z1Qg@Gz(0UiLkao>wc1T1&n;{Z)19iDNT_!+BXX zI(7+bDJ9QmVp24C-C!L&q(u$oZ8_7;eomG%j9S88+XnjrPizOunzB!xmbF?`Vm-Ct zQxd>v@9a*i;>A}i6ggk zMvLmxU-_hVzZvF+lb%k@r*d>NirpA~i+>bp+rcpEs2VdtAxG8c>Q$I`D3JacMg@S0 zb|aE)t(nuqr9q<^#i6|j4jo=EyCez5CC@N2b_PRrU^WcKc z&HN_s;JEdAlj+tfYh^U+%W$rdTOBTFI=J_CGQRJ6^cMgr<|`>X(~gZz6O&S?$M8$p zqG*_$YEA6u{vfpb?YXv>u2x*{>4OqeomM94*t5T!g{ zj8IiQ|BF898o*$eo8d%XOo~z?wK-Q_S*I|r@u-rT9ufdxr!N468Pvj?A`5mHV+E1o z4d}6!eYLj{2BY!->TU^ zJQ6A&`~%z^>iO_rsm)pNaeoNHz~Jb-bHH!bQ`z!P5s09ij>J`DmOKd#HdFq9qJx;I zUu7HLU48*!S;l!A1Q;~iod=n5f}l^|;ixF{z(1<{axuf^V+TK6CX;QM?9aegH~=>i z%N;Teo=US%?CUEAqGZBUkYLP@YXgJ(`kZP-=;?~^1+sg&eakVF8WcSrcl)xFq;%_z zul*n+ex16q2;G56uB-F`TkZX$lnEK-1?DQiiuDb6Qr>>o{%prx(R+unWtE~fX{_9%v)*~Tf z(gj7~O{+HmWREgpP8`cp8A~efT&#T3iGdLDkTdkx)rRiG1@=6Sw6K!dWctK6_ICue zI=>D@Yb}B%Rth`OQ_I#~i>^`?Y$(Fg+8FGY6ZGUj#()mvFJw;d zvs!ccO(UU!0`H#V_uitH9_uEg1aojhplitTrec_{HFtmLEs0{LTcn#A9JO2=DT5im zZ(Z6dxTNzkZSY%MvHv&%{|@N0bEl1q@|Zm*JIi}NCUeWU$~89OCoy2tC< zEDe}nBiqm4(TMwS#O~0A6#3?Eb!UBndUDzG^itNKY*U?^_I6xFuO zGA7GA$wYNZnOwnq?0kd`(auAIZ3lbi#G*l}3+Ta$qc*!V63>Jc4O~YrH_gMJ+nc|q zi(IruX|jSISFT*NTN#%A?5e*{0)=bl0R&S}IRsm9A&K?m=zQP~hjMtK79*~gAYYZh zvHwjs_a`34`hyZ_sY9UJMRWYa@|;m4bDpR|ZNM_b>~HW~I0yTaJ}#df2iiAbuF5er zctsJz6#%@qNz*L<$}|B-s(M(Z?qCDI?K0cPoT8h55~IUzgEMlHXgiO&z}kX$djf$^IWqz}a{03j(B z)e0;QL~;r|m^y~xGsc719hI}2yY-LDQu^)nBC?}a*DGFSEOB)bNl1HBjg9b^35nGZ zWXIdmmBT3)0D|oae-KL$h<6t^IP+;!ovg;~;=rB?e4=Xm zCRJT=MWg9#9U3@oF;wc7(wg|WFvU8cs#l|L#ya&ibMmV5cEHn{t3!cq7+^rRjwK)% zLq_N*T9swW*fo+-tf-apYukz7P$Tn21!5}8hUqNS1+hx>x?Zak8-ulHF2byOJCm#r z^Es1u)BPTK2&=LL6(XvyhkFZ(d73!`1r&&xJQm45X@2ETfmMkMIJUL0Xh z9}ivf*O>?KiQ1%-D9|!Y6#>gYo$}6lpe;RVW5}@dvyA@zT&0Dj)l7a?s3sG|%$Yy~Hoq)Q8Rkg_wytBy;33nQ5#=gQ z4JHfI0()w|9o$d(;XulNBsjosU00X+I1p!}ny_9-ce)#*l%>p+h7k^-)eATQ(-_wet0A>rDqceR4 z2~+gNhXQeqQ31)Ys>3>>>-ZY4U;b`vy3_#KO&o|UijBxn-u?;k4rz?FTCpasJJ_R} zQ_~C6X76mTC^`J3?0H+K$8#w!i~!?zYw{u4pDVSiBt@a>U*mLY<-{OclH*kTiw(vO zRdi+#CzATDNn7vCu!uZrX}+xvtl>Z!;3EjM_y}xZ>%EI2jqXT)WnbS`hTJG8Ig~ziQxdK9-X2fE z;&;~I@E!F*J|D;+tWaPIYD>W2hg9#Ssx;=j=ub$+e6k8Y|5pv)L#gq-Zo7%u!owYW z3U*ZkX-A2~S1YHA@Z>##>U-7PPtT_RG&2n@K^P64!vZ%&Q$CbDPr>A^?km3hyZh1P zvkYvf(=Pj*YuO&;lIUEmuQc;MLkMiMt8za)reWbB>i?1A%ph>ZJW zmzHBcDQcL>gBJY{X)Pwdh_gKY&dyyEMp{Wt~2`**Dg>P(bYKcVKxf zQ~mHiW4DGI7wn%6fcx0OK7meAsMrd--3>tg8zRxF*nkrW9Ssyh$5ug4@6>7wvOk`` zM-S&FEFrMN_4yWr8|Kz zGOUCHItKt!B6ZK42F<%7rP*l{ND$rsCRxWjKZ!bigdN&*+ruCWYNO)B4tg#Ta$4oj z$a&wVcgp#*v82E?yo`JqYWyx+mR?)GN86b2YDb#Vu=b&?Rh}vogkC)WRC?*r(C$)t z2N&l;FbHhd#TK|gRc{H?eD=s;ha)t!lPw7zHvS!5oe#s0Q}D~mLxOVoG+DH?vL1&V zM!8Vxka6eXt0D3bi(dmByMw8$N(s5y>Yvg*{F+L|U2R}zfBV3;YnJT2TKY*PVeF$P z(GEY9?~l9;-l9?9wfgmIqkzGakBtW zXgRrSAL3~$3=z^TsojklVeMG&s!6a=J)ho?NUd*5nC@D%B~h8Yu+CZ>B!K4t z#m2uLTMSZ)H^xM>JQNjJZA;jh0sde?zLXVI^v2uv0$kx~B2)D|vb+g3v5wHk74WkR zLohs4C|oRT#Xi*I0%Q8R`~LSq9$d*W>Sb$h|9E{Z6G?I(|H`cG*yu%@y3EKdXxRfG zJHTO82@Rw^+D~vJO;mAcBR|PjuX`sE7=coM)jL|a37Y?#NshqO{Q_g{I>IJq#fMpT zhv}rUWl~@4YzoY2?Qgv+Wpy^+sa5#2;?UJy|h8n1FoR@C&5@;+$}MDKY-N`0vj}&LjbX0Q?Zxs({%}wR^x>5CuY&>X9O-dp5d7GZ5fF zF{<~Ns8MARBP4xgRQD^@uQj~)sM<~>ZY`YL55SDcRTF+cRgL(af2W0Rwu&xE@wC{! zA=>|S#n}9 zwXOy7$p`7O`rV=;gd#l<7&9pbDiaY$w?Hrjq8v2DsZOF{=^*$?`+4rE?63UWq9BLl z>T#{PvCrSI&pcDXPqjzrcHR;%7c81&ILDws5yW8y=V=-b)k(mo11vVdq}Ou4m&U)1 zUNzX@gLajLB5oC+2zI^zQk)C`RYXzu;z`DPRj4l#+w-p)E<+Uk1vRsE3|cLfnZn%# zp1_3PNNe3gR=DE$d2<67gm(;hJF=@pJLrnLhcWK-Ku8vfJ1fajWu znF~r?k&mJ)%CVQXp~Y+j>M7H5yYPoGi!9{-7))8=jg+y|@OC{WJBCyZbhD3fO?-Kw zFy!=k?}j5`NTAwan`bgBoCuTYeXH=IHK2XOEkOYK#&qcGQ zVl9g@y&=XKGuQ+NE`d?N8k-3y|CF+i;e=yLnpBPLjYXQOxtJqLMo&PhEJ6r(rZCSl zS8LHP`mz$_FW$S4-@OMxnApAj8`(3KlxxpH`G)i#ZFvx55GJgdEoR5rB@1fo9Zo_p1#nyBn2px=`aR70)97APOAZHs4geZ_ zOQ;NzFk~Ph%M10iIK^m(B=q2 zDrXeUkoW&XajD)}Ow?m|!@A!baM>=q_59$S9=~AnOX`>w)38zZiJj+!)Ehuin69ry zt5m_v{IeLMTVe^^2}r6<-s7YerVW${#{%59?&uz>W(2ju_~sME9t35aG9=Q?Z5C>? zVsNZS)BXv1STyeD;=d$`1x4)Fp+4_ZIi%S^!E4g%A zmiD0M%Az9F5{4roB~{U7XLs^UXE5{^B|1!@#4AHT>{6)-UD9U(ETO3#kz5X!iFlyF zeLKnm@h#d4onTQhiD`l_1wUM5QB!lQE?>v{F%0LqykU$eYxXfAoPr?rl2LR%GR60* zCax%3K<-1V+yz=#%D8a3opLEk`_DwlBW*&X+g^UQ+L3=N0SFF&@w#ns@@!hp+}FMX zOaY|c(najV_gP^?#!;>SxD^T7Hn|i6#f2bE|8)u5L|v~=nLH(fm5@OLLUJ4PT@IwL#rgftEx8!G$^L3O)(D{zXk)S!5}WUWM_;*0iP zKf;gE&Y_EmuCLT4*--io2U7BT55puQmoGzZx*?gH(1+RYZ0-6tshGEu>n_iKULKFn zzs|7d;XDllC}0v^k}>-t33PgCoc5{=P95T0Ap_|<4@kCrM{`0C|47uvz)cXVFY0B~ z{CE`o^x(Iit^>cQ<{&=#%F1)B6)r=;u|@go3LUoJ^5A6d1(m04q6>^997d8DTj<6F zOhz*viQFW5Wi~ASAQpRK4OYbBY`HWo=IYZak0kpUCkxjkGV`02n9-Zo--&(eqxdSr z3m)y+S*<;p3LQRB={?flNefg?_;qg|LZ8mW>I_)o30KVx0EL(`xz+p@Bo=#s&lNR_ zPzu73ObBxjz|_H6afr>5KaZ7CoZ9#4Lpo{y0W=q?|66pN#ZTYgPC2s4o$?VrpZ z{PCej%0Au&$@;tdFWe6*R~*(?=&Wb~0xsjK%Dfeu5)B9sn?hkW!^bA=rviP6oQANw3DwMTw?(nmrWXku zixV08F^vWEc>16V!AB76REk*r4p;4qC`J`WytcQokKiV~kE|~$V1FHb04K2F+I!&| ziUGkSJR;EKI6JZ^&X>QYcZ6>(lD|W!YHOXYwe6EuSW3* z?PHt`R<-#(zZ5^p`E>m1r^54sPcPr-Q~U#H0ixe4rtM-P=kK6=5&TTVf;6P$u9p1q zW?FjbYKO?H@#rx}bwURdgn6so-40yDJ06n%y!|JV%hzRIdoDg;Ccr}PiUA}|FdjmY zz+_d`un}yxHTL^4So3300vH9YSVks{1=_$JK-@N(D;;(O@oxg`vx1mHKLxnj<}Cgn-N6$ zB{Ph595~u=3|*?P&D_?VG+Q3giegFKAI}PN9#{le$@YI1ygJE)klnOy%qFq+ZW%^e z&0*m?QA0LSio*c6B#pxz&w~6?ARL>>wJFJpHXz$LBPg>U3oJEPlcn1XUO0XHh&l=l zH$~R8+>_K08(lxu?`!E4PA}gGK)yDCz448?^OA5Oj^A^8O_b#m|D&mPPW3rJ7Y_sF z1`tlj>$^#)Q1RXR0FUIN|TPJf3Y+i)GU!?3pVC z36$3J9%S*zT~miADjYon8+kceHw^y+Xfc$!UI0)02cDbr2rRknza+tB->Z@TToCfl zR#YL+o(3n7JqJ)h6SxO~(3sGl+5(cKxcrkyZg-{Ncpm><9G%k-|ZgeM{*J}c&ME#gZJKeDJ$6#>7r_Ne6hx@!g?#R7kRo^zUl705P zHtS7H_=l77g3sqz&bgiB7aC{3H>aeiop&P`GYEJ(36`M|7A+9{5HjXh5jg&;DIA!O zcQmE%O`CF2`P%Du)cVEF!j~09;yThr(2l{7Zysfe87H6k;B=bD#yqI>l#WBPz4KTA zh5zTq8-Ob9mLTY!M{hmx0_YywqgPPnX;r(m5Yj$b%)5xKT!APHQo^>_km3uaqS-|h z_>Wr*j)JnvCg$&F(mFN9VK)X+`3Vz7F6+{b8P~`7k<5pX4NEL|c>@%QR}@_!KE4km z3+yKXU~rONT8I$m^TbdWxqiHeDgm=kuAjj(@!7=5*US!YzBqbG%3UJoCM{E-Oj}k_ z*5a+*#HTr4wHSOcG^{R^68j@^5gz)nZvqzbK`02FYR*jZOeg#h9n#FTxvO(>XRV+s z2_j!gm>siNChUbsohlDB0NGGUdPBTmJT?Y>LCe_ejW* z%2h^C*i%C91wTH~l-Us})^dS)TQNt2FL#3%f4-G9`JP%@+W33^zbULn6-vS?MvrQf zry6p~%v|anfpiFc4{0^tcV(qIb8`DODO6Zk7FUsJWmx22yT&-EewT_ZGAFXEFA(|k z;7Hh?B#qP3WZSwp*RaK_s7tH_4)C1=cZgmr)+$c-6hdRuPDrdJ6axW*dCs63`N5U$C~n?Uu*!{`BPgv7}&dh4*5V26$Fu$-*4YHr5qz+$VuP-uznwO%p*6K$4~ydi-v zpIKfQg`1gu5LYwwW)&##d!CKo?Ty7;$Li1Etw=hCvj0T6Zg?Ib0KA6!h^nu0?QG*S)yNA5wd+*2-S~z zAZ0=|_-D=Oo+rN^tPd2h^{nncby0xQ?!Ru+UQe~-|CP#7tq5E4k)op};oznt(JbT7 zy`)q zk+VF>s{V_sf4pAyP8h#m)(@F)UYZS{X)9iJ(LYFuszFDf8TfHC&M|r~KU=ZH8#>>N z&2R&@c$ty?28fbTfC!$gY2+1yGk_Qnf}zTRk0APqsw#rB-%sbkE`{vkE!fR-H3% zx^uAzf&g_6Z(QK*$QpK8-{~J!oFJ4n&uD#?R3JgitgTaQIlq&VIi&fA$V2V-igQ%1 z=Vs!6!&j|r1T~-hw<30e{q$f)_s5@?V~*X2l*-JA=-x5@J{eU z6{u2y$LWTVjz3dsG&(BvkrgRP#Hu zoh^vEf}0*uz(nQ>=Dd?pnj0y}=-biYgDeW@#m}@)qx^qmTSa%7R9@1s1!gS7Ch}#s zLB%CM2juF$SOACLYyh)EDUb;upAMW7tSPP+k*3Pn8%hchS^A^l$!eo3B%|p#QK2wL z4okGt%otg6>eP>$zxY4tav4ex!K>q<>B|2&G;##5`6LbLysO#KU}c`h*MfJ|tE^#= zwXU5ViN7nUhh_Z?T^Bnr=K+XraG;QwQ%K@6GS7nFLmZ?1<2SiGD3X-cF}C}| za{(vS-rmDTXMFd z1MMpqYBhs;y)^132eJ^ECxPEI6i5ShIqq*(RJwC?s@z;Eo+0qJ0_Zjlu=w~86#h=q zj#?6yKZYK%Ad2#cNVM7UOatOl%A0_Pz_;tb;R25!bmiYz+tteBwP&9eAH9EJULcsq z6w83hqH1y3=KQMJ;`yQ;0VpLO1Ijd{)vQR_#N;&lK*Hdb@Mdam3`uN}6zpdr8@2$G z8j{)WIeeEDHoX7!-_dgtLVX~nWuW7#YS z%2^{1Rj)O`p@K>BCDXPr*yKpsGv26vVysO;_H;%X?{6~-fqbVge5R2Pl!eLV20v<8 z=(O3kw^8)Z3KUCw`FjHfuK;Q#L-VO%A#TgUynLK>WQ;11f1)(N4WeD@%IAzXhn-Q9 zE1ki15brGrexSdIjhIMg_UO6OHK; z?0bbL+)40+I}}kF{8-u$R%OXd)vXK~1_vsELmzF4M_cvt0u^&Pcl5iVy>rpf6KBz< zdB1v@2!N^NP)@U<9jYmOiWbSse8z_}4N2^Zz#Smjkeh*SyQx zne;_~dV4Tf?|(hP8p?MVkF;S;J0ps{wa?JxUiS zY|alHoi6Gt9yQy}W_-~)UjO+%uZBW>4vC%SLn0(9l~>oN zV&5qlBR@20iK`SV>}22UIGOLg2>g=tJl$gqEc@Ju30_~&6D7_o(HYL*-)G;S`V9r4CDd-@r3gES162x%m$^dMtlmJ6!%!eeoz6 ziUQ?%0I``3j$ziLglue__Kke`F_R0YiLxp(BVPh*K=M(yi)6^8q1d8y_ky?{*Z88M zS%alqZ(Rqt&Td6$TBZ&$6 zAVqP)Ym%{qadzyDGf?yH9~uT2 zm@wU4ru->7`+oraidWp`AD_{|m{^rW*0_rakmi@jklSr;zQVuOtL2Ne^)}RxtCN3H zl9}NOP4#RY2sT+`qvmgoG|NG(!RKkyV;)u#6{YNCF+7w6?TsH2=5>D*4(w{o@I#r0 z`AI0!UY>}fAU9Zm8oJ3up$jN}i){j8Z1fF1z8Ovl*hD48ehe2OSfQ_94-prwJ`BCX zd&iJjQ(H{Bs6L0M$hcegvi`Vzpk;fT-6MqMs7}b@%30NP;7r6PdlPwd7KjyU1;|W# zl7Ybi0zpeBP{Fn})U1j`m-Qnv*j$_YoG8pNUQPPBrc2lKnN_-6ypN~SX0s>}Slok; z_%I`+@A72nw_$ukqEwt=WLt1(qKu3d{r>BsbrCqAbpZHP;Fuy%Ciq=#6tuE^y@Nqe zLXrXsIGq)%wcS|yF+aFW8S_wdMgK*|YhrT|lDdM;uB%8s8~yHX z{RzIy0v$j6TNDsG@mHkcN~dP_{ErtZ3JMVXUI7G@s7N@_-BcX!HxiUVv^C|Trj>yLJ)imF$pb<51S5?88Hm*5+TtlJHX#LQWae>%}cv>50&pq7CX##bg%Yl!- z>Wu>M)E2zJh(mYPXFmG%$3Co(?@7deG+f)5hH^$ZD_qpu7>Tv##%FXCa}Bc=@{4Hb z-DhwCc-^o-)?9yT;(0B_$_4e?orpf6M<6QUNCrl@cvJ&+II#OOX-Ww|h(2sJ1i_$D zv8-Kn!#q-i`X`{?5EA+{I%`!&DlXI90pIKf+0FC3^=+Y)&KmWci~V~SK@Uo*4#W?j zCGkk=Ms|@7Jk!E(0B~Ck%4Pd`-GT|k^bbWr6*qSX^0%AXiCIZWTcMB#jEDyPH59pQ zTR}-+*q;6!FJXBf8L4*jSmo8kb}NTAO+kUGS!J;(zevdo-O=myT+%`PaoIBpGYU)H z^}qjrH-HVu1T@?6KU=pya`m5AthnU1);*6+4~9~wcW=IyU0Wgm<;!Eh2iC9?4g?`3 zH4h0afA$4Etey@b1lN`6f|>)3gB6J-Tf#9B${F*^ehXT65%4oEqAr8K=;CVnW7B?gCr^k zVG*1JO8mtPP$9{FYv<|6D|lSm%%yR8 z^IoQhxbd3bqPSm$7#xci#!aekJFl-zriNsZPq}YdoSYV&o?!#&ULYm-<6iUXQ(3=9?Sl_T5yi#&V7g}Fqk=?G*!jf9T(TD!VKX-&z@4IQg z$|q^M+hhOOh$*xoJ;OKo-Vz_oH@vzwPEbJbwSqy0;fE$g#6EExUd;)(y?#q|&P2AA+JK=6kZ3NS`M2q~zuf*n_CO3lU3NGFpEWQ)H$ zYxB+&5oRDCW*bdl4lh>9LZ5~7MGE{NJ9;?4P9OM2dmW*0@(Yr?y!$|+FVHOc$oYnv za@bahiW4BXX$6dhg%JS4fE4Yg6k|n3C7W3BUt1i_w|liq&ka9V|6mWPd=T^RxVnJo z9}8%?n3x^dLL$TQdQ?(xypI?^yRuBNKkJY$ZV_EHc>EvZs97{})5(1q6wX1b?;tJz znxch5>5-Z{{{@mb1Rx^r*)JkM_Mr(mj6#%Y2uP?qda*QI>{=gk=?NKmQPV}JG1Vrb z=9DeHSTbPHHI@@(SAep?0fYKxPO)X(_U0=8IWj$)eezV1LiFgvF(f|Js1Bn2)H;G5 zel4aWbMjvF+i`QL;@?}Jm$%Ppz77Q;IsXy4I6*@ZYQv|Vj6kWQEEqU|REH|3n~^gA zBqDG8Nfr$Kjx8}vJC$Z0Sy{2)3_Dl7#WpiQ!51ABM-YCS>`yvh2jUo5Ln$JcE>R_( zF`d!?US9_lwLRIxP6;CAsa=aoVWd(}%K<*v)7N286IsMmH9l(x4NOs=l7iw1laHTu z49(?ayfrWe#YMB}SmhXqmm3x6W%jc(fl@;u8mHz1R;Bt_izv;V_DilBgg!osA6%K3%4o_pY zC+5yfWVKRH1xbAJgRQrCbcIItm-Og87D{9>h6O%(rXggNUF&woqxIy!F0V7K7n)dUV8EXOpp1p|kkx@uz8h z49}~PZ{p*xtI;BNQ|t4-8H>Gma}&D1zPlnA@b{}Z;lI@da@(aeShyrek%0n6In><; zMJ<|95220TC&mC8=Efy{cVnybdke-%%+#uM-%Fi-S1zjC%AkK-L-|0pL9+GcdGp&b zw{``e&Z0UB_ewFr@7dp|KN;w_um=GE4I?y#pk(!i7++M1Aro0_oR%7l6^a%?yNZ;# ze1j%%u!-rVVy5_p5|Kqikz)GZi+XSZwx=n>8;vE3?CHk$v%2{7aQt417$r3Ub-bEx z!DLsU)9K(P1#741^A3RHC2eWt+hd4N46UOQ2mII4i#4y6z^MwNz^YUu)yUEg`BuJr zi}V!ppE`F^MU#umZBJU(Szj~V4PfbFb@@x6GMD=oAdUCSs{mmzdf)DuhC?2}}5VF|)Z~#RFf@GNJT5ojMe^)KFe@`hH3QSy=jE{0 zp_*5jW5H|CuN6 zNAGLf_#g6fU0lh-bJG#b6x6%fSeWX4BIS}m&#@SSDSv7u7TxJooEHD~v-F4WP#Kvj zKWZK$f2w=coxZfpP|q_li60A=Q#|U^t#D2;;L+c+Y+A~A@gY7W+~f91{3XkI_f6lE zVh(QiY2XW?Vo*L|cehP~enpIXq)Oeamxj-VpyJ8{y{)homN6TB*sJ@)Q~*3dh%rYENXO;IR9P({#38$HEztuoby$b2(Bg!i?EG&8J` zH!Z?#FmKoE(T{G0tJu3&+h7E3pr=2$o-scJoCe&FA`<1uj~G(s5U>>ok5)z7{+vP&DNyQ^7W{S!%&SKcR#iJu4(wqJO>|Q7Xfaa6zGbzODS1 zOIkEgR?hw)_fsy`DTAl5zdcN;uic<+C4teIXi)6N!Q<`88b1!+7hXLr@bmtwCSR+U zej020jj?3TfI`2>CH1b3$CffcLeaOo0&Fs#S_1yaO%{EUI_7eIs#pJxgf%R|JX+rc zE>iC6DDcUh%7SbTg4V?SDj3Y+J1fi6+_&tT&2zJW#(cn8QtVp?&6a=g%I-*SFyVe6 zmkVf!1EgklPDHw)wn^im%FAhxz|IVZ6S7C;_eY|AD{h_~s3HXcW$v{D!ngbcFw#(s zAR1!c=pEVnkLH8sl2=9Ct3LmvjtR`4^?E%2m?d~9VIQo@0Jb$;sJYa3NcbuIaKK&_ zByY{$#L4gNKf})98DC=Br%~c<+_;TkZ@Tq5(&-uR&Yc_ifQqYl3st15C&TRp=wiG; zTp*&5+d2$wvltPh_@i;7=}Ie&Qo3m_b&C2t=sLEwgmUP~2NfK!SGkuLiDK93GW7uW zpru=E%q^GG2Oj=FzWd6N?JTEksw`PU&IdbDc=Udv91sQ`sXW&Qv5K(}Gs$A|C*}!b zME@*FkOZNH1TQ->YeqLwZSi{Jn7relpT{n9CSi-OjJ4obNW&7!Dwpc{2dChZO$!FGz+KZ+Xhci~`gXvU)Ch z_sX63vdG=x7Gzf~O4T2P3Nrrzlv|u)tY{4+0`XySBG_%-gb2ZfkMmU<)28O7`mCYv zl{*k`SDEbOQy!%o#6q0eWajDne(OazIDQWjuY6lcrI5o$^UTxjtvZw_X5Gt2<;3Sl z(T6ot1VDcZ^5|BHG4U9}j?sDa3~K2#?}kh%TGN9(Y(bdtbequMzEU-AvZHN`{w#O5 zj=OOi$hf}DqKD1c!)HmBU+SMi_^ONHsL`!c>vsm>bHv35Bvzw2(q^DOc5#u6(xzty zLljBMQ+lLNqtCLFD1XR5O5mUXx;}%f6hk!uZHP)fk_JBlloFPcFX+!jLnO1#)!mgi zm5#0LjT+@?ONUOV{RRH$DC9IeT3yLj?OxJz04acz^zsavp~9J4Az zY?ujSU(ww@krMt1h)qv;URqIhOjb?34@ADC2oJ zNxHkF0@+5Fg4R7xj=CH^fp@u5&$~_^hS=vVZZEFN*vm8czz-V^K+fd7H*;NjI%o4> z6p>cIcOc>oG?LUhcY zf+hncc*1$o;9x}xRZLcg35tTnmCE#8>IEC!7;2*^BJRtMbZ~)W_-~MUi34gnt1do7 z>-GoLFj@lfW;8z77~bw^CHl`AGXaP*FlNc%dha!q(sUG!JG9$+H)?ExU1ZH-vpZgO*&M*5!aR%oAsw1@f>l}4OT^hVz# z^uEsWVG?esczmt0?1;_3@`-p@%_QeP0l{)-F4GR4r9d(k|KI;&2|Z=U4Rl2LpQwa%u^n6cX+%$+SjBuJWA;)*n-E3OR0#}fzb5cQcLaD?>yHYiS-`+(9fJA=twp2 z)O}j_=Gm`t)v}+ZMrqDw^9jGvwzC()>+#{2m)D%)07%u~FOE(X7ef(L9$PE|Cm?VL zffNl*Cw;nhP)ldo=8jXr1dWiZ%3NZQ#V2g-M{F!$F4wC_*MsJB^fhF)$RoF} z;bc=?3f0~81&LYqhh@1^yg{k4*67EkG?!*V%3KqntQqU&le|%>&lN6Rp-|x`i~uv3 zlNCw$49)=MAXd+GcSZkL&*!*L<5Nm6}3{LT@R40DG%;Y2YIT?H4V^ zH*XF`g1X(mfRn>7uh3ji(>^=|!HQk+(s9i@W-JSBxVGN)2D7@JuGVjY0M>-yl`ct} zTc5Nx(FK$oChLqVrU9 z64clPOy$>M+T)n)#mFJ~RMz>dK*)5OukPmF54+2{xxW|?RIC9c29@9-Wg|lB_6m|q z;v-U#`P7t*jKWq{5C9=99OU}JyC3~QV3B3$9-v&Bdgc`4wt5ugN47yBSaf~Um+upO zbA>K^?7B~UF7x<_@Nu(`zU#EeCN-H|JKQPs+#+v_diAkREf^sFfk33p<1@Tc27vQK z-P*>fU~WbljbycUu&7|Qx=eHCDF$~J?k@cC{@8OC#Idc4Ns_ zy6$LpzbL3?wqL~`aawh4>kmc4$Yr0`pum_Je@CnfqMiHWZMrutEZ{0fHfgaI+A&>K zSqn;2m9&Sl*H6A20b-dTE;NBHmo1LNhLeNFIE@^iO~+B7IJaN|`3mEWf&LI1G6m7b zk-S8DJvrVKs>7_jNb0y_EcUY1O#O?n3pdsqzBqeQ-rzqU!JDT_i;D0VQIiaU6IlsA za{jnO9Z&_o-*ppnF`=_&2^Kg;A#sPAn5i!|vKXl3iQN<;mK*abk!Nj=jN6Sj}9tmPWtA z^&4L({KghsLyu%6MZ)z+8UXn1h(?^QI7i|pec_yj`f_QrdYk<`E5o>c#p_Z75|h!& zh0E%*-1KxVhPzz@#57?ySLHEv-;u=R_Q7$fY0HNvT%UF8f}ZHQcI^v=UEaHjl>&jO zyIi4;zY``={jAI*6h(pZjtJjG=|VJy2ow1apm{JMTx`7E#Od5+&o9}nqL(b83r`K! zY(_HjuD+|~Hcj!kQ-;+`^D9))qlad?HO-$CFcHjLcW;_36qJSt_jHJGtrKS zNVKzR{BwVmXY@PSEjJ0D@mD6ijvI<(_d)43IZuGv>99rvS3@KSH`5A z+wHe8_JS>4#%$vyGI?XO?PF71M{_|2X6`#F;y%CKXC?ABk#os)%q{=DUuE4JBi&Ydqzbm7^Fb-R|$E2^1B9T6WRzYmbes_^8EeNQqLV z*4VQ(?!Fr!=5{~(^DBDtdM)gVsh%puGA(!ZRX%x2?N`2&nGO2Y#I2_#037zN3koTg zo~1RFLXAw}r~W{kn691_M4}*wrks=eA3zg;;)2+OfmpPOmEA?9)8|OCkbhfR$TuSx zc@N(e3O6c^Qu~ryD93CRvo&sHjVkCW5}0wYNtX5Ga5@;MCT?5uLe#)xhWQ7IKheJg zB6!nPao=J;Cj5FG*xSbaq3|s40>QQd+&Z!BzYQVISTuPq%b7FL_Yp!i7@U)cf(Y1t z`SE8MTE;*L&Nuf=4sQv%YtJOq);d&v{4h%}RDclxi>ZCGXDF zvkD3(Cc5z2r+aO#+16cz|@G4$MO@n%oYe$@t&Ne(9{SD!>C& z&C!t|XLsTX{i!{;G=(+)3fsvdaUJQVZHd#OI6n6ClIr+$0|qaoK9dASe72wh9J2|# z_MMXUAaJTwP-)=7Oa(l=IHl=VoLEkj_}-Sqoj%(M4FzV3lt|(Q3p{{l@W?t zeYTg_AIbXppDL2d&t&U_wT@`H_ahzMm;RrOj;qUo4*z56EZmy>zc>DD)CL1a4HNSMA}a$SsmTfs3~+kBSliWIN^0$9bHW2hW#M*`xT@2(g2hr$^gcX^7?@cLK0vrf0n#Tsh^BU;i7k}qBzVoyl*($8KxRZ4BQ}H4N>ZW( zYW^FGe_0ZTF6%%$1XkR$)VgmkL(8I-$WM?&pLFlH7pyy4iFhTIN3nuIj-q3l(bXE% zJNnxa=>QNt1_;ri&B+)FkvumB)IGns8frfWcd#}0KY^x5saS=l3beElHWk;)o@cQn z;{Bo?uRhlJ=5yhS1P<|F#{CR8dXb2C710aL6cXnnQ7(Dy=>d;^W*(W!ax+RLP}BL? z$#^=GRLfWHsKl9_op+r7IQYsX3L@6Y1?3}HA%6w1E3aA7X-b8FsFooJ_3KT}i2(X( zNrBFUOV<`K!fXYd-ONN?JSL0@KG4&U{O zvhDki9RTrP0&HjD#Fltuu;RWz3XQVxQ6&yyBI#`;e0s-jo`3F1HJ|mH=owYK5C*NM zC9VMhpDV@xQ&r&TxGtmldvdLEc<1JXCaw3aJDK+rndN$`e8c}_F2P)j#T&xYh+;kL zou2^sdtP%fBGU#vOct%LN>I!O#-H{j0xg-(*cVa$69@<5Z9{1rkh`1Mas^kpevK#D z?iW9n7jeZF{u4+%EH${bv#x+<>Do(gHGQn)z9ZS5g8xHWqW6);-2Dt8l`KQ#?=58i z^Rj5T8TZ&|6n}zdc!9>#LD^v<8wWvHKKy=pO3iTmaK)uV%=T2aTweD)F}g&jNA@L1 zu*{sHgZ6=4P{#b}z0Ll1S&AQ>3?cG*{WKvdtOk||T}Sv~3el}+d%vsV&`5l!HKjBm zRiO=5?Ag+TR0@3<5^V1ERa$qC#vawdsrV>uYL3GdBT6~?Bbz=X;?C@>kz_+mVe8iT za*uEK!SX|~r{Cq37TERhJdr<=&OJ` z+_hLp2>t}yHZ|JHb7t{GF>_}3gj(6e4{|T!Slg+XIgnyG3gadyo#KY!ot5g79+MN}!b)4}9mIzkV8K8XgmiuelTl zz=?_b*^IAD2|XG=N;D^13{=r%8Cy?+j>A^piG(M2uP`icFS9@IH354^?ey*OznJ%Z z`=@d)qA>xV*J9o-_`d{V|Ejx5IaqNJ|4%GoCaKnw47mS{&}sC#9|2Z5mev!bEBjcj zT5`MbU<2|!&26l6nTFpVT4DSS-$cy&E;6UmmvCLRODm}7h-)>w&DZa{y6wA}8?wQI zW7I&=y%4S=(fqCh{Sfe+^0G*>@MIzdDFiUEE3ZAAb_$sUYyQ{=vw3 zcGcx7<>>3bKQd(8PQ{)v1iY1?dE5bFIeV@P#tjYGx%yL^ml&XOj2}m9B!EzAKx2xA&qw7R|4 z4V$FHA0t&>PBEia6zTesuyL{QEGF!iqWJ;wkh`K=EGYA#Y5uOzZi<(0r6T^Q3gvb4 zmOFa9kWIfoe!2M@`uqO=K5jA@+Y8{&i5xyC0U}~cbmQN%BVaI*uL-NN;?*l!>4VW< znPhwWQxBfJ%cEzLhu52*Y->F(+BAJ=@cV!7piS7o87>D23%J--#>cwuB*9WUP@eL_ zC6PGS#j0%aYlF1Ov)d`DG^r_Fm!YjL+bat>?tYqLjyQ|8CcGJ?8rSqmM%?(vt)Q!*J6tS^<6kSGFy71}w9C`4@(}%VbCnwU2dOtnGG>SyT z+^BfGg(?Y?@6Ubq%sxkRf0Pa!?zKUGqCHEJ5q14Srb%OOqH7PkJcK$lGz*57bvVo$ zD|_~~iS`yFZJ5QrHKEy#O{;mn2+V@}DavlsZ>gz~cYSTm#J?*H@x4mCUkM}Z@^uix z$NLX=E+T4*l$#Hi>c9&L$5A+H;y83wgCA3gFz1zhJLMfPMvqWWeJd9vl;@-&TA?V5 z8_s0gAKSRc45mMCD|o7jCn0rweWmmqbLJevbJn%KEK!*u5&X?z_i{`y?vMzH2B7i) zDAh@^xOhlMVqs$g*x;FUjfFUczj8)UI|;a?Mda29g>waLPyCVAN3NhcJBye1j@Rpo6 zF=v;lD!csS9!q6d|5$SRy9+F+Zz^aQEpV~HB@?ZQv31gd!!V;*)zRkr+wM2wH6wAe zh{%sirFPR?C@AUECiQr||1enH^Ar2Q7+9Mb4viYb@HKbs7p$CGxa+)Aw$yuBKzUX5 zPTsaEey!?L3a$q&V9SnFkktXhxRXh3K;#`_LNUrnJQ_@-5(6BWnw$pRHEB%E{!K_? zieF}@pRYDz_;$-cT8%ZA(keH7xL5wgy44{C+4!tgTgc+N5f$O*JYTX7`wf#qtH+dV zI|1iBQq`W-R&1nJxw`_imYdUwX7nzuttd_>G-1FTU+pSi^qmKgfFAGP7UQwd@gM42 z8i{=l!^a%0-&ht>*}EiYZ}v2TZ%D= zvU99u;~*2T+U}1)pDcuRy6f2s_`|qDaWiN7kp5E4+>?eeY3c;<*bGG9O3C%r`yTfJaBK>BSI+>)~8`;CAy-7&E zqvTMRyJs>HQx(L}Aw^pg%NkUb<3V=!1dt;r0kVz~9xeu6bNU9&jQx@ON;w#L%lqk2 zp7-+2CU+-!HRU}d9;A9|NO~o1lc8nRO_U<#Ibk|6BG<$wEw5gOHI^NzIz8JqT|boqJWhG2BU}r>e?GO?vN>MmZs|toRbXqB&6{<;Bu7MNWU>Vf#z* z#f`>MhV9P@pBx2dNtitMf3^}jZ0<<^&sY{a2o}aQOXW;lVxab(do^(M2b8Dn-e!6s z$Mj1Vi{jN3G>?g{Z!Wr`nMmrUoOHhPI_5^ z&dqrG=nBQ~A1nGp6*e3{jD@7(J-YoxXM5{rzZTfgl*{HYb2?5( zaadQ(dKi59_sd+HPD<`V`s*&W*h=yVK(r2`A>+~Y^mhvSKybe# zqF;+1x$b1s)x`G8hTxss;vdfDuSI~4LPQ(&jS0n)`|%}+O8u9 z%Gel0K)@#?iHy5y!~;St9y7T4qXH9`-9anwO00sOcz@>VzGyi>@BYH7rB{6bDdKw2~2ntcYF7r0wBpv!7?&(;w zk(PR&e?Uc*6q(?ebCcD))Uw@~LE|gzUJ%+&VrO9V%?PD($3o{RLH`BqB z(68plnilZ$@`{A#+NJ3HFJ(5zT5rZKDE-)#{|y|Glofiz?2#a(8 z9-+S!HZq1EWmiTZA!A#{!YLZQMM+3Rfo;zqedo0WBIyqlXpg3#8j_$&8;XUzs2jG!Y3#gE>Jw?M)TOfRq!dT zsPO2eP{Sd1uo_C~bxA!Yt25hmj#Ny(^yyIk7m1Z{k?)@*GEcN5NhzMG55?v5rq>M9 zaO#dP1-T09AF3_+v`ybL-NQ5DoSM~h9o%`}+KK|CvB5ud@j@L43(yWX0Ht2jM0E#b1-BRIQNbw!RDaxbmmGS58TkU{%aT4R~XB?N{5-v-Njq{*O2PZwvFo}!* z$kSo^&bc%xZ1Yc&{%e^|E%$KQDOqINMelYLk?Uh-^A7ET^aE+rqKb($KFd z&$zoz3i)gizW`NMUo{JQD^KkNP&wn{l61S>zsHq*tvEw#CbfoR2j`nnPM$sOyyc|K z${wGV`t{O|*Yi&Qy||kIkn{mQ3eUk_>UUZQwS6aWOPv|CB1+L{sx~2QeT6v%lGJ3t zb#jO?Rz^!=m-)*izh}!mA3*`}blf@}?vM>iC4tg12$J1*SH8v(OD##7`XxQ>h&B@G zDyQ3}Ncj?O-;pud74Xr4Wx=cGn=Dnqx|?*4uJYSg@88`dTbO<{firfjgER?CVSOIM zQBkU~4h#gID8-+e7-~<2gE)2>y^6?!G@x(cO|?1aQ>1a{F@|ZC%ivnN+FOAS(VnW_ zUwojr7w}2Ib`0@fwUrZPQ&p3d7ApsWwnvEbJbc2#>Lf?7E9?URJOv;|cdD!6Hs}2GtCI{b)1qYV)cqAoUIa5j?a%k>b%obyo=q_V6XxO_)%}BxA&+H4C)wLdEpDC;| zRq%c&Z0Y#377XADcj9h*Lg`q|1d%-S&0xhdHjF|g`RfSN-<;wL5^7a?a5dftBB}vv zki<^)cjHAw)^KZJu9-`YIB=w&^-rKx$ilJUbio5{2HdS~hc~e$38GQ**ydovA!m=Y zzDQ0qV7Y|~C74#xdrd3E8zsHWy}0LnyKvk195LoN(+36@^U&u+(L<1gCM%;;CJ6PZ zx5}5e8X>v^yROmXZpb`ry*I4kljM68%IP0}QIAB2XT*}D^u@^VP#dYN(j4)y zwT`1||36gBa?eF0)tjD;9CvwUB`@3*Sq1YlsiX_Z^?u8xO1kfxOdkrq4yTWSR)s5aQce zEpfsP{R+5czJ`_k%I70c6Z6*|SMqryZKdOmFieIMpK+FLfo2X%oe!^Bl2g{ptZP(uy<^w(hh85oxaz|HG83m^)3X-T=6rJ=vvfdpO;rblNY#|=@07OOcxouKa zLcytQl3KH!pN)sk2}#7UFsyyHRJ(M)KIcsi0uQenAV@9TB{bQmFV@}X6CkD$Jw{OU zy>wIig3Z%2EO*t(z>9_xRMm0mmNDHS;f-`nug!R(q&p-SwP3(7?2y6nfMj{mm zoB0!gCP{t12ERsK>)!ufcI!~wF*U9~e|OAO1^NMZ;6UQ>?-W#R!!>7*x1LGP@FOM8 z03t4`L{~@}pdwL71Q9sDdxeZ=?Kc=hn&_k3^);VKeyd#Knha4GJJ6FF88pSvN@Rl` zQ_k5ET zN)t>4Df;Zzvkf#UsIlG_h#eXO8un9A`8b9}@ zE6m*YlU`miv^6Cc&WxNea~k~ieyYaS;H(fKJb|aaSA07`>hkVRaP+rBT$=!BW5W94 zQ}>G~YKABwqIA>ABQg*+MACdWkw&J%n);79wd-MKTBCt_^>UQsYX$a=@BL2{olGY? z2-Tv!W}n|-GJrjz27XI&%=mgN&-P|7eXoD{SfNUb0$}^B9+g&{uRAA7hz(=A1E8mZ z+QZTOdaF9`;dbC3K-yXQP^Z5o6QMfYa*kbDkf|h;HR9T{Q;4PNNn8#kZbQ6r+Go%$ zMbLhD^vt(SJ^6<0EDHq4cLI=o(%(Zc8Fo?!SH7s}zC~hc@6s_L)FrC(n^=(Srzd-y zq310fT*C4fg2$Yu%7I^9_4|zGyUd|}WFvx%&Jl6C=P9}QLR|}47H^h)Ny<=!0QkNS zKwNBJNlRfG9VAO2sw-Qlo;k$)JMO6<;f#dA^KF{MvS%a>9obhJ)hjsfCkdGuW()hN zF@&zQqTRop`(NRdvqCd>bY7~;g(OT$ZhubD<}Zaev`RmCihC^f}GkpuG%G1+#!i36~FF9kr<*%=_bFKi4bnJ zUn;JEI-u_}xFg!rbPSRv|A1Qko@f|2->3ca(m{{O(;WKr#4HkT*+qS6IZ@~Q_{c+;wVA6~p$;+l1 zuV=q!%CYE8NT0ZsWF?w>vvg02-J6tQ_X)m< z+~bCJD$SKq8{5V&JHF)%JE~tAol0YH({PC}0Hn9OT2etM4jIh7XE%^F9vL3j*z8ig z&d2<`4L452VopH%4Z<^b1(`Y@a^l!s$H624y)s(zg2`0%0L-yzc!<_Vu$?b+Yk6gfW_{<;LYCoOq-3{kxz4{M4k;?Tn2 zSjb9a7z{EKN+(A4q>oGx;lp~DeL#;OxQ~~*nIv6Prl5o?If3m^oQwIyov^mw=E)8z zn~1Z;x(U}q8Qw$ulmb$n<6JRvU%kt039r9)=vfQnP6MuzO9jH_AqxPBzqAwH_7P)< z1RDdV>+6Gpgk+o`oFS=UKJ+2GHR_b`ZzxrZeRf3!-hOSOuENH}BoIovqus_+*gd`3 zfw;?Bppaag9fjE(tzVemVk`|t<5rR&P#nad=~QNs<6LptXy!+FZ*Co1+6%piL#xF5 zJYUtzXdJdbF@q%J3@S(o?OG)9j=#G0H1yjyoS->BNS_)Hy?>(pD|prC7i;@yX2D2- zWY+lcca#4wfB$Vi=+N@uXx0<1hruubT=JIdv^B`aZQvDcBi^z5Z*Bek87hCj=p4Y! z830}Cg~%ys8x+sD@eH*tWXZmS)2<&-D2hdl8<=`h#Xp<4?v9rcsNNI4NGUvVh}WQP zwBos1C_!Uh=Pr3-{qFArtxFZwy!3!HP>Ps;n{ ziPd<5hTU8|YHco~c;rM?b)`qIc2#G?`$6DI$y@>cB7wHw;YLP33zw58tLxi#vU|Lo z>l`zm*CbJG#;AUsHq+#yD2p{k>!z3yvZD_!n+M*|(+_W26*-&x)8NE%64Xb4 zGq)3<2IGsfx+k*}#2NUAWY!17$Gj~6p#Sa>H*wVjZ_M7SK;NkiZ~vvy6txc%L7%db zEz*CdEHF&z=Q|I?mbmv)qWxKns9t0W?vWixd1C=31Z3(-F}eiqKjhv2oee>p$z zw0M+tQxzfn(?boo|9XvYO~P(4{Y)+dj3&XI2hpeyOh$28>>}0V^&V{4vjOPhXYrJV zBg6*H>*BK)`gyhoPE~~_?!=asA!?CheAZYhv!05j=*cd>ycrf|t<*Zq4R>2pbyq?{ z6idg*cz4z0-P?n&xH?zr4-T};K*c4^uLs9-*`UCW@_}P&vh;=yeGF%Zy6!w{daoKD z9tF1O`8M*2A!peC>TnG?!}x><>)2HPEtNnZXX887M4_uan; z+J%9Sgr^I1Jf!ub;(;1|KOoK<9To2*wI$7j;xn)^&`1E{ADF~;AL-v zJCqwi@c1TF!`0fw^^>bv0FNcGKR1qzH7rC)3L~?ow27}>lT)u| zq+9bpNX@T9GCN$Wk^U{$q-{MO_7ncuu%5cMTlY@y1C7U(`0Ea4B0;73-^CphI9yx- z3RVvM20%mKeaOU+K9TyI-vi0X^u*3i_4i9;rb(dSw+B6{s93zzG$;YBRLsTX8LQB; zrNp(0)SUy^*7-Jh!n@m+>PDk$R8vg`^y+7(@C}~x6%I<~SsvJQWNIdk03b-%3mX8* zC1^O6{S?8v0k$)u#^6!eohhszZef(enNtkfiX8GdW5ohj*pF+p>x6d!j6SCRP!H*?9_ z!TP!cCoXh}GqX0k>m^fnf1x8R6m|O+vX3qfUwo99{|n22s(}fkNksmnq3(a z;Jk!z-osNBICQOhi6$*~U{z7T-SfQ#QFF7%Pm!S59jPC)jMpoRClQ(yMGzhhuk<7+ zr?J(XpmLjld+=f`$&(GQ#pvw!<_p9xa4A!1$Z&v?AL2ey&`ijQEXi~Np38A9nwIrU z*`gM02}-@OX(64%ww13|Iy>$`BG>BI66{#Z$^@>+95k&ApJ?m6ip&_>-rZ9%|BjA! z_FB|UbP)eLObDm_+d@2y4`LRwJC15$ea%KFCns$R7a#UR47CxtutJ?gF9|W9p3CPV zYWzyZ2Yb9ZYU9#8pxkp3HMC@pt;u?$-#*+uC2nv>M}|wC*tB|3rdTO7mFV9t$f+(W)u6Wp5qHl7{U6Q2J!cKa%@v zfR6Vnac zT;g<7FWbd~XY_v9al95JS7wWU#xkCGmzmGKn(Zh`seX6g@qguSoc@f!KY_j)bLO>r zlinvu#6=L!?8zeAnW?JeqV;tOEN`&qK$JS*`9_%T#fKAWFGB`1mWn@YQ4_*ExAF3Y z1<^RynRU4>$P)qGi2|axBB-gz%t%%oIEsg#E7#rTD>lCXntw^vBc`9tm(PFvaZ-n- z^4#!Jfnz!TCsJSSiQ6I~_>1X%ugCE{XLdQ(!>W>Bgrtmb-FIF;IUdpmR5NY>yq81* zMxaHSkw7rO4Jrea13F5G!RiXeXyg-I~=h z&UW+vJ{*6T2|d(TcI)6=shpkh%Wo)eHTby?2KY|_;nEIHZu#KzYeO)%KXit_c&hhFRb7)*GI;k1`O!_~PDThyXdVdOgc;7yWB8kL_zB61qO;4${ zz&;9+c86KAtmY&rIHme$EVCmVq=rL3b55bkR8S-7{{*^>$HNnzdgG0=x7nfp=eR=h z@vW$*yq>Ks_3md}$t;mcdZyc;&jZO-6zEYVCC0|Yh~uF^zXNokeYa2I?~U7b2Jj2= zVY**V%jZ=DcSfOnC67FgNM9zvC%$_xIq8ZdHH8CvS>L92Z`X!z;^6$Ma487Ta0Jj6 zenj?1eTv$eV(eVT2b1$TEjU>uu}3h-#zkLnqMDaCWwx0 znmdvPnZ4SBDu!1b<7`yti!aVe!W-kfxDLIRbNbPn(OVn4j6$Z&hUG%HejV`z)Q%;J zRj%b9=nmBmet|`jA$b5~4$E^f3Dcf>HC!@PPCZbF#Y>DPzN{)%NCn`9JT&z79%&0Lyg{e)&f&$d0ad-&d{UQey6L-^&psRdl0wD zAYHQd5AZ4Sww))?&4a$3{y&w~$M3aecGu(54^XQvl2Yr5B@(D0D!wl9kM<7w5>M~n zV7?1igI@q7K&d_(0fu#kxfg|0l7gc)*)jMJXmqW)1Zs#8?>b9F&MF^D7M;p%?>IB-G!p@7n^>A%C57~=B1B+- z0jIeA0F!-$XkA_$$WVO9`(dO019>(S%}2!-b)dJ9fWg;p#nrlDuEb*aui87Jj30j3qtB_d>#EN3CE0w@1w@7e8+{gJl`49XNebbdXkEqu zG%K%i#MsM4lLdCHu?AfPmxgilLUjXlBx6E>-EeX9)9^sX$5%6;9G}GI*pV}T)j-zF zN0mm0u@9vpJ!_)!D3vY%`98oG8wHVBH>6)MaT!qP_ea|}Y^W>A9}Nv&XvKcwKo=&} zGCr!+uV>=E#GKt)BfqKmcMd9+Us5fJ{u5|9$v{$A`wq^+;Gr__pf|S`Ou9zWlk*Da z##Na$RV4A`jB)m^)KR-dHGSS{`gAoY%sac z(!W~Mh-6LVls|DdE~=iM6e$OxsL#GLIAX$csq65FDahb#h!97L2sOzgU<71xkWf); z_xyA$kxNbPTIDmsfT5w5dJM!=m_2DS_Hd2UJ571xZ}VGkmqc5)PX?q_hTqKk>cg+f zH)`wAGrLKr!WGJ;vxt3jMgpROBQtqVBiDwQrBleFu!}{pFu=S{7wFKiAJrth!DyHQaYkKgR%2T|*46Crd5( zv`BURr$Qt&HxA)bGm6EFCZNH~W#WdXUNr5WH3}HWC_M}+^;NK8TNG8+h6i|M9Ds-d ziIgjO_@o%#kggzF>{5ev#yuUyVxda|&9yOqSr0x>SeuW#CbS6zBi8~;KK#(L-~ zOA590hg+9ZHq#6>HG;u=LT}so<%rd1KNoSi(o`iP#~5GG3nU8|ux%S{4UUaN%Ix_> zBh)s~0oAR^4sNeq&q)aG{1a%OK>rV)HqHY2#?tZAYg`18Xx88wlCB%>IKF*%kwhP$ z$OSipbC8iqZ)T_yfuV>4wQxFy>UqbB?HHhql!i=aptj1w?4c7R@{0_o{vXxH1Tyx9 z6%DWZM*Y#Qb!dEg0{Y2&ksl8`GU;kua#0JHW;x1Bwd!@_) z!^G2P$1#rG(;ehMX0)gIjciNu*vfGF=3*LtJvAUQdtKVEHzAsxC}`I4Meak(Umlmp zU_9%20gJYzzQ>^~mDkSBTj#7UsFs}~>2#r2sEGOX@O1;VY#0SN8AO0_RsaaV=yeHx zVw$&*U(_F|pMP*oq*FMtp|qU)L5bw6VdTUhC4L3+8bWfPmW>bGqUxL_&h-xkE&c_#SkR{3lH`V^Wi=t$-F$QKQWJTsmvDv{RUteawLOw#W3t|^Z zBc{?sr?f9#d%nWRdM%+_(L4>}Q9^GFlO_TZrZ4`3(v3YEJHEf;Z1hCrhsCiXeN9u} z>n|b6MzU)U#dJ;z|I85Q@<90&`sdMOU)Y@pz%~gN4O;UI1Jn=`&Z-ot$a%Fy zzU0KWxboDDr9|1g6DC4(pyqp!t>9nXW=d+A^rrgZAIWU`FaU_dit|8xA1k)1e~Gk6 zj}+Y+V5s$T@c1XtPyF<4?&(Ek6^Ml+{e(M2M+@i|#c?+e?q=Y|%Dm!$t@%Jn(@}ZJ z*`qzHqNBi1;?fWmYXTL*4CSKHTKsdh;$_b+)^Bi6bQsQ(M=LX7Ou|6M}mK@r%NJ(nwbuhe!fQ z^~kB;#Cu{qFBi5$G!6fH7A5UQl;o$**Cc%ls#*HKD4#i)5kl3Nph99$fCig z&vVU%0+L`EdC}Z8J~RM@FaXLdb|0BCfu0ScHFF&i__^_U1%x(u#-TA*^9Jp~Jvf-xcrD>CZJ1E?sVG z8C8GR7UH0X+jm&ku()*SkPE7m#zH}T?Y6jQY_d!`LsV#m?66)Y96vYLb}H1f6QTB6sp`{l&zzkeK1}- zlZ|V!NSy-oFtddZyyFFkYZ69yxUOJz?l}VMNBbRF_!uaD5pa;fMR|BPfZ$!(d;2Dc z?m8_l;bSqU;R~&}5wQthkV(`*hdYTDi9?(Cv3R?!QpTQEY{lvdoZIRiua3&CWOUZ( z@3nVgcCrKud*hme+($7uTS_G@zy>b5frv-i0=nT?g^K7Dwj~-tWr?|(&Eq)~N7mI0 zacP(DFX#8YM#Kbq3zoWbr$wt)sZk@qe4w6qInFV z#1vfd^$b-8f1c(Zw!EiDkBN1ysu@;iEuxY0s)>6C-qyW;Oz~b|f8I=w@>ev?6eO_a zE?BoYWx;tb*>K**)(Z9Te8%P$v`0l2$}AXO@hlo`gM7G18dVijR(_^@IP6D1;Dwc;qcCLN zdc3)DKH#@0<9FlOa_=F-WdIdxBplL zmMT^QuY73kpuKE(`pNL&A04KdUd6_gc{3*A{Q5n{_k!=QxN#q zFw|cCyd!99fkL^_hzA4!|Neb=hE4lRq8ySbKz2%;P$IBCHnMmiR%{*pz>;yLAcl-< z>-Dnyr?2+4BNuDj)d9-bH^?n_79!f?Emk?!VSLNeb3zt56@48APbWd~OX_0W{sQjm zAyo}N6^x_<9kJiIL?+D5kM%Y}fFsLfXCPBMl-&%p)vxnPf47#OT=u63&7b?KZm$2L z;dj!&1&;FMtzlw0Odsh^;!Ye?^-myMyNq3}Zn=xn>xezd{|?z#=Q~?q8~N(CV61<0s3JA4^(k?3?C^cC6M~zrPNulHvPHGVPCN zX0li7ELA5$vO{Yz;ti~!fvCJn9<%2CUG+HG<>uVtu?Q|1vG;Ol#RhpeWyO8~TRd3I z-P3;3S*=G0X|0ZKu@q%`296ExdVBDkCBA;a`g+Lq{^Bc3Z$C?X1MZ&|OAR73bxHtq z#CO+lNFJ1G|*yNY@7j=0OeANweZ zvIm88g%^;1fI0YJn^Z!gStfdH3*FGqsB*0rlsnUGR&FqsXm!hhk_>TnCbZe^-dFsi zal&6)PT9i;W=~hv90!Z?AStPw0Fekd6Hl(V^hF9(mE$n}Rcez=T!;bOb6Y26lET>IH18c)T>E>0rp^EEv`VSm{#mPfT)`QNBXGikbcYPQTpwe*Ze@XQ#6g-SG zmetXe*4)0nvE3^pt}eq}b)q)Rs4A!HIpwxvE5WK=l)*Hl9LFkl9ktenMv0F`h1qV- zE{v0MyHiIE;;@S^Qk5y=GYF*a?F4XzVS&2}HxT}`j3|0ggTmZSq8)aVNObNaLj0AU zgWwxKNdLzW6IZSuVHH!J-}Hm3{xb@fA`y1W$f0 z{oPfsGrA! z8^dCxt?{p8|2e!HmPvZN_1dt=sMMaDaMD`1*h|>!u9LOC4X1sKh42`jdH)Hz6E- zNn^d6QN;9GlAfkU_AmAF>+&D(^v8qo{B@>*c}A66=scVPMm)=u5IS7K#2}{)_8i+6}8k@`Mf6>Nci&I zvsQld!lUG=5&j7P)O7NS-UBT&aVOTw1wjqK>9t%o35G8s)v}x6OQga;>0L@QXq8mm z@n4Pq3f}~p32PixST<@iziXJ~{q-mMP_xh|yzR=bw$lkJ7g6}s?D})SMjoyOPhZ^U z+X=ypR;zDo^5`zA=v<~|cYo6Vp1uK;4hF>F`x(eMg#JRRqrXik)BXGO{D2L7;hnyt zqoJ-JbzO#Yg(nfOLV3!~ZMaeGYL)iF-u62-X?c?lg{P3-5AoJHST~jFrM+Ey{9L2v z$?ceAiCdd=)xes;;)Ei=v=5M}Q$v;oz^3b9cLYZq0U@P)Q#&8!S~PvYlFUdxPur1I zKH12yKX^>~Wc3x-@-uv@d*O;wxrafqRs$_C&3KQf5krAVj**{*0xt3E|X@XZdIjiIl-$Ww0`J9t=PI2j%<6)P~#k0KsZq@R#Q}K)?Qyz z@lILq_=B*5F9VtAJmm1yl=5wj8$NDn!X|!S+HE-e0ZBf}fmW46LqQ4|uJZmj0z$pm zmq3nm#AYYzs;gMo+=&rclZtu8S@NKU*W}B7$}^(TQjf^5Z1}bxVF@}Zw9-9KO^F4{ zcm=cYy^BFGYzbZtL9!;xtKkS3r|#G@GKrbA`O{5Sx<#5`I%|%fxW`i}<^X@;4USVO zAW>@;P4DkbE>DbKA)(m}uhIS&4T1r^n)NMtu4syPhosS?gZj8tQYHaSRh4?4);ebW z+d%!3!N$`UZb8&3^}p5i6{7P@eaSNID|dEXJzV&&0DL^MQ;G#bIDIj3w(Au;t!k;n zv#vK1`kzro#DSl62c?BMO@!V)e!E>%wl=bHv@h8=l(!A}`eo+RlVhbzz3^T8@^9|) zjvp2uvl#6|a04B7xK=8RqjguI`3T~8 zZGMAtm1tSZjWGpw+Gu;6`u@AG%bIC?p z0BIo$!BsqvJRLmb(-$0^)TofPprIb3A)};4Z;`{Z8e1)m+A6qT_)wK*e48y&EFyzu zA(V#R4qnt6sp>m5=8?{b>z^C~mw&xyIE8ri{LTJ`T;`9z?{7R0S9O?s-&MjJ4M2Ix z?#Ot!B>C9hDAH-;a8KP!vr;(rA97CW8P`$tHZgq0{1^2u6kN@69LHp*Qqt>+VCb3oa;?h<@tnLpVT|em2 z2B4D_dG$T5fLRjTnhUTYlrK~OqAms0W3x)pC$VvG&A7x&Y09P6A=GS%D2pYxn|g!r zu{FK&6YGNdZv2tov?QnsR+09geD2phl^yNzcdw(2SKIOv)K*?5#1q`5D4yG%Pl++4 z3e`u(|9cImDT5jO#;jsSLN>!cY{#ei(O$=MxrBnAUS~b6ND8ksCiH&;eVBC5?+arxyeEFtnJlGtkX>kh!f* ziNJhTQx<$)nA7KI*&!k$GLYP@f#pc&uAt|& zbfvO&8ZpkvI<4)Ua*aG%H~wQAvAWvxNSCGCs7G(xl`rD^qQ@>4Z@vKRh(Mg&gk*TY zOZ|WQa^F$QPU1$ak%m!;I)bDF3Nq^JRtQw4udXg>$n5L;Dp{ZBiH^%Q)Tw-U43$>H zGnz1iMQ6?QoPUn9>W#e>qvbxado0sg<>)P<=o82OnoA&eY)MxxOl&SMT&;k+GGs;l z#lg?N{w8e@yHd7QG>L8x)!wF1tEv^PmZ7bch2X^@VIX*LKTJolj>(@SBm|Kk^6BJ^sp}A>fRo=}~ zUB5Y!8f?+K@|zXTvsp=eTBV@JPAP@*#jliZeU^G}bB$AS=TR`QKx1o;9*UcwHu4yj zKLb;_b*gQ_s*E=&gmWuss90Fn5mx2})773ZD*cYDi8O}(x(wc`f`@7@$J1Ns+Enu7 z+H8DvLVsGcXRX8@@jO2$mgM?3%p13vnG~Q@fk#O$6F1D-F-_GJ@DjZ|{nF2PsZz^M zwjC}vxS?p<$qcXNNJ4$^>sb9@;g>b;L-)eB%sr*k81w^vYz2sz+!jZ^oNmc*x={U8 zQ6~GU_Ja4m@6Meztl(d9a*I!Oqsudn(l=LC05AYtA_7DD#CWo39goDMLn%)z0PYma z{FfJhA{N&~XUmPHdmKF@hk__n4duEOja?fz%^BWP_EnrKE6H=&V78JvAD!V@E>p|X zAHCfgHnY197Nrx4vV;jFbu_Eu$dGi4xmVO5GN-GcPjXbZx<_<9c!t|3I;M>FSzKgv}maw{St28`kT2NDUh?rxUwEt%Mb%HJk$N@2ngT<)I_OD zB_ak;g5j@;*L}iV5xH0&w_3Bvo5pTF96K+}8UBbE34mLp32{k3r19yDy|l?6z~Jh9 zGc_;s={&x0-r!E(d&Tp~=CU`8uvD5M?4&UpNEQGwf9WJF3rKoq)o_dQSee&s7#+%W z#flo5)A2DZ3p(S#YTZ|d2xfK@!z#iRNd~peS|8U^hd%c6(z%}vudJmP1+N9pzngLX zmlqE+^Yg@wNaEQMS751=L2y+RdWiH9^4+v7+?yc?Ul-R zr($S8cLU&}5bw(8flA1_OX0c9I3=XI)ue=96DlPYeQC9FqCfSvv@eHxubvMA&RXwz(Ok zVt*wao4@eurxIAZU>K@1lB-x1*WLa7%;`S+W2;{Yd7s*k4h;ab%cF(0>4=qqp&91$ zrFdaxr>4i)gS`E<#Ouvwxk<5kzqGGj7IPTh>4<7yY))4h@%e>+9&_ecMuse;L}Fz0 zTH1!(uX5hHB>L;TSe~?@@F!3U4xmA|0SI{QC>M3?@w`bemtGA&7-Wzen>fdA3rEU7 z0Is1P*BVkIGBp-4qDQj~Mgj_{C#DNE8x#+%1S?h|th~*yv)?ajMpdxeJYO@j{jZGM z11$-P&Mes)L^$nXI)emMNs=K_N1OVaR{tH)pDbYu?++aK+OgGxv56b1!8n=ox4&P3 z)p$v;@=Td6AC4w*HZT|RxF&L3&J^!+g^rS!cKB3+cWc5-*db6rO<}$ng62Z*?FzOV zkMGqD#EQG?#$~x$hoZ)! zlEWo+cF?HUT$JERGnu)2rf?onT`kGh&Qnl!+vvPGc31h>q9b3>>}^2alZFxGc1<$< zRn4_ap3F)XeMZQoy9eOTVi0dM9;dS#-j0>j7^s?FB@Drl zTxdO&D-AwtynVZ4C<9%;F#u+RBt4lFMi2n9Ze1AE@ z$1DsUon)ao;yKB1xFIf;PZKtv?%e6u9RGOWh892#o-lOg^toz zl~!u=&1L-30cY0z+{PT0xCZ~{q4<&KT7y?iiEZOF!8_ssM<9h*L8jE)chx zv_RXUE!@PbgDD>KlqP~rIkCgIV~LnmV=gYgJ;zsX_5RSZDZ!fFDD#1XaPOTrV@Kt5 zAQWXC+m;3LEet#9{MCbk4KY-O+v6YV7^q{x(x&f6>>U<+qWDi+gi__{IRT2&jShV*7-c%4JHj z_|V@MJcQcnKEdppk!{(?pMGhZa0nJ^Yt6&Bbv9`Utv8QjT?R*z)zvE^Hm!0wuv_83 zXvoKBeA6(#r86w#BB?@vnmh?9F33b^&1#~)`fLJ5%$}|p1F1K;7fnkAIpd0I%mn#e zRjM@)WS{6DJZD?R*n(}7^C+YBinUXX#HD&YL@cNW|4QA$XB9dd17<;}{!r$PXcaOVIDi zsCE6$-i;cl2i$m2T%}nudoJ^K+J&^!<3c}_^*jG>@~h0xdQgyl0x%M{TTVx&3pc~M z5cKlB%-FGVr!}H}{8fmeB6YtFIZE4db}5N|@!N0>I-2wuqg-&*#~$m~$k=9%%7W3? zZ@aD=8@rWuJ)~K7no-Pi3Tc+HS3P~1aKYG)mxu;HUVy`>?Z7h?_o6a$FfoHX$1IG8 zhX6v3*f(cM+w3^;)rbAK%i~r!VHFXPvD2-*W&#K)bx*U0jVIh0Na%d|xLRE5 z8;jd<>vUnGzzG~l$6PpJ#y3`Pbo#;Y5|pQy11g@3?!n1vyld%w`R{<SLr=FOJq7HcqZs@mrJX5y!4%qtG|nQw~q1Uzsh8ffWrJ2aIwB zLt53wWZG%Muq;gJohjWhN?G2;yB}|V7KH+z@DF3VQo6}J<>X_R#;92)Mx_kE7D6(g z>^y$q$S9JT`dtonQA(7U z+Ou`xn-8DHJAcV1ax@-a_1i#w1W@v|Hq3kU(o8eVi`>=jdyN{h)ab`#>DB3e9* ztmAitA{Ubp(BXr+yf~TV451WxU;_P;2G!arBgAsPYB__roko2s(&-eVH}*8YU%~ey z$e943tz3wQ|VI-l{eB~M#rVP9%N*scd7#fkP!Y3uNEWgrfaWfknYq@_)yRjMu_|N~Twhb` zxZt66b$`+%To--oPR#2Adp>vSI1%l?al;BUAuN-VIt*p(I>rg)TQt9dS0e5gc{|j7 zcKWcLz53)m^$oth6i5^Ra?xbDfgh4&-hzTCZ4=>{d2;K_)$<@P4N3(ac+&`8mR9zk(Wq^j<1I7E5G?NdQ3{S ze0Yy&aBl;unx+fnqBDJzxcfACb6L!!|0@2SFx2tuU(*sZ`A?(!W5$q@D2eW<5#f{= znI9yqO0i6OL7U#2H%P!*U)y>1#Y~KKALuy%+Tgo~h?fa@1$ho3l<1B%xQ;hZQ-xGd z3RLeTf)ymo4lH(EOL2&iQJfx)-|JdC4`!H9>dDi#wT`>o<#C;ppQQgJJ(%#2>XKA6 z`7!+Pw)-9a56f>{pa7tF2Jog%)5YhYk_y(qD13Aaqx;5Sx{k)xSfteGCq|?V-_Xu9 z;hW2m^3#6HW1-Xnuq;YE!LTSCo->}1Cuchni=0X3d#|Ujx;;d%VrVDC`|$R3&x5}3 z%UwQS-_%jjq6W-9laE#aRC;4VEu&aD|BS7%d6kb~I z_cVJ`Ri|grB`IEN5OpiU+9F=ib+=gR(^|$vRTh9ouvUKd-`YLpmbT9ki4Hu>GK zI?i&C^VNx69^(3`JlsE?R^V5+U6p+UqX84g1&`yE{<4bA3i)rt9*lri6`FVl0J~$f z$=S^$1P3_S^+J3{0?0^1p~yI@dSb}HD|wdX4(z+<^oaz~*Y%7T|D}SilGa_nY{gTV zcA*R$L-HX;#9DT<}n<+EZkUCS-8MXkYYKk5n z=r(WOw~WO$4o;cx-J)KL_2$zi+Ze6&J?ngZ-9M+8Xhb`Kc8qOJ93;*%#_d19#r0XF zi}&LP<|FU%N_h#e69JTxQPRhmP|f-^_SwT+5*SA!Yf;6+g{R9S?9QBa4&wj4Am+Og zq&}$HlCGh-m0haDrCD^mR>zNcjragpy$z6I;P-i>UzuYJoW>rTBmJRN_pH`3+mkoH zS3V?Lb^djaLwjXS^U#O=;5W0qA636(yHV4X?hmsvJ%jMHUVy;3VMPanF&eUGP+hka zcj<&mBddvg0$U^S)uts1OWk&)rtPcs_nLBU5gx*;AKSIc^3K~=6s+VV{8C+{ci^>r zdJn zzI{WbfP?3OZ5f3|(XR~oOeJ#*&Uf#x*DgsIN_{WS)8;pA6=s{7SE=CBJ-_}J0ee>( zDUp+`u=9c3a)9sV0UE$2_LHvCyhSylQ%7r0O}r*&dRPFQgTi)cY$bz;A`I!O;!mnt zEyw4%s2;zkExPmQSBHofw>z^IbVKDyoygZl=W5}*`BoUw(dk-6nO(Y7iX&V2kuU>{ zbp3UuSjHEXrGlvl@jd{H&jC?^Ln;OR-wM|^#NaDo5*Nt)%*Es2S`bc|f`=r(xkxvZai9Dh;kYX3sS4j7wm(N1<+J6X~5SsU{Q!_UtP$Z-!>7yQN#QoULHr^tDxwxj$REh2h?ULjixfWT z7bhqO*h2!S!@jwJGpW1;?#|cy6@Et_n?0zgCT!Q3N8^_lw{ZbDi|=;UQLjE+>|UJz z?6QDd0e~%A0lm32qZp;dBH~h<_%(rYBN|)-JojbPGY|p!paUIn;i^Hnpu#uBpe z5+$b#aTG9HHE@F!mAfv+EJ?tYNaMmqvv1a(6R?%#kk$iOdIfan1Vqx2#Y|SQ$wdEM zde+I@bj~$ggi8BsYwGt!Rcr9-wcU8*Ul~k+^s>Tg8D(7`PAXpla~l9u9EZ-A!?4*3 z0I1a~bU2l8*hYa%2Tr{je8dsdF9z}d@IJmzq@sl zRkrKAMoQnR)uz38uK5N|vH$zmXECqKOMof>xVUiPmQqkd_=#bZ8bTG-x-teMiE%w8 znDdaS3QY4z97?wdpjj9|+4mL8Im4IMY@6RFHlAG7+~hJ(&IjonhW)ly`k2FqgFrK^u{h_CR}hbV&xi(!)B3b`sJyjRkA*LzcyZg0J~@*{Nq zh)y(ON?&H@QaC2is4EL(L~g*1+208mw^kXT#d@V zTcvdqtE?ZbqLW1_294j{dd3`{KCiD-!VJD3014`^8QBQlp~z(UXkFF^p`IHxJHX;6 zXIHxqb@Ll8=CUX6V=FJWpB9Mxru9lSS$@J>m)6Sp#I5-7erV2zhaw$R$z7#)F*id3 zHzS(~UolN^=Dz^&l-quJEkV43tQvgpX@em)SG;OuLM=+LYSA2`XEw%KN1J6$_bCfh ztb|%!Yv5Bel_jQ z>}+C+QR1vIK;rZK4nqssj}kRiU)kR{7cNA z70y$eu!L+WbN zj>ERB=%xr?Fd|&};^T`Y|6aqV6pi06Kpv)M>wt#4vIa=KU67-v(hN7qnELItAu zW4#VF?o)FxxIF(x9m5^vzfJ$xxvBHF*iVbMrRsifX;%By$iHStzYqr|+#I!1q|jtg ziFrsZLqaW&2~`gZU6QZAV)0hGfQ!5UG~73ZlqicFGo9x6;?a`!_u zZfk1CvknB^yn11{WoWbg8PrOzY&wpUfjYsJ{7%oV=yD7)TIVJP8)S2ccK5&e7Bgev z`GVms=oSDH%vc`wND$MI`cWzfN>WKfVe$4fltgp7Tmv=TCtT~3CL3cp2H%G%ECmt} zd5l+5^9b%MKL(>8abFD|5&0}y9AUBVNAk@QEQ{%7(Jea7V)@ zD?>P!)wpM(=EFcuq1t^FW0 zUt-55$+h93%7Q*|+(*&5x(@%^FzCwN!Ln%a(Tny&*qy%EI(<9aU}+f+jkD)8-(R+0 zoZddSk0lMV(Hv4#l-%lLYH2PV@rlM>G}qIGr0kl&TnMmP@cA6_x7SAo`hX7G$njLp z*H|8mlV5O#yNyS9<7?Odz743wJ$}RT$jEVDX zg!h@trEaylJ#(vLmET%Dzytv9b7$BxV<*mJbu;!oKqc_~BnSFUyt*!-7q>3_mhl#> zK+N;yj?wLF4=iKF8J6)o%ZDUy^qrELySh;Y4>d9 z)a2aB7o`>FbEnWk`QTmR>gS6ROPbYnE!zhWQYY|{zZvWA zHBXMIAIst4Q>oAhZzR?6Rs^{G*LQ}L(u3d^qVRtUqRjG%*5gD8+$$PBSt-|Y#)hAE zAWL{bg)d9LW6lPAm5s*jnZfn2G_H@_LeiEVv7aPgaZjfjRUO=Yup0u&;hl{&;@YY5 z^0vY6%#+`1Oj8M-$C|tafN;)n%~-wQXfm@}$R(0%D23VZS&%s<9z=eFFMaZ$tB{BH ztw?jC`^esA^poU&!TwHljZ2g?NsHLG^7xtWFQ95L+$|M|drV3_d)9r}b9frujPV{j zzHHbIp zXBo(vIeRLKG9xz5lWU$2hFX5BX3t)oIx=OAX>+9cK6jJqOYR<@kDjy<2P!UZI8+w~ zYjWj$?DHxjzFvGUEg?QyBWGv|KdX^5U9>YomZfAeVA!?E{BhSU9^(M?-(j%<8-ejk zNP8v82Op>DK(bH8FF!i;h3deb(tIQcOc765>U^}mr8#47zIv5CQ}Dc5TL?_@Mzz+_ zEyHe1?p63^Ng>c~4Nr($o)36&l|GL9)YM_iPx}a*SEWqu?Izxsv6*nU3{D)f$&1|a zV}AB$%5kSSl!adNHh0bt)FdoP?0#6`HO*%-38%!^LK28xb#RP0)oVccc&i-rcpcc=Br%9l2^iFPG&%s|g-iJ9 zB%x^XB}ZeI3q<-jWpJQAOZDokNj)ApmPav;_vukza`F?yD*aU{6^E?*MI_2kmsFYRw0DG&+R3KwObVe6N-3qqr2fR^;a@*p*S)2P?%{aAs3RriyI%RG8c<5^WH1O^bw zNw+jg)v$*|u>Tu{{q{JwRCxJ=K_pW~koj`|%wdOq|SrI)=D@gZ}EPm7y*M}vJFz6}!-Qlwb^t1XBp+?u`G`L*-i zbXX4ef`(zV_llQ(%a}bMtd7+Dj7I3BY_I zMaUx-&&5!yUl=PqOlCJ|Ey3`D&SehXPWCLYRA*<=Jez!4B(O<~QeKur#N>B$=_hMr zrJUMKiD_rEKZUCKuWe~gG%Sszpq0#r0|ithh}h9=E)?=rtcEPE5d}k#*}B}sfc5I5 zdTxCdKKS01>Z0V?<}hr`TF)vihCi}^KW83XUNhyf)|WledHrMmImf+<*C9V4AW{o~ zi@v3v2!M5hSuo;*Ab>nxBabhFSZ0ehWALVxgmm)qtV&baTz}7vP!z0BRStm4h1n}H zr@niS=<&o`JY{eH;F9RB8Sc4+GsBR|-73K*W*D?wtp$$Y6i1EWjzj0bt<12unFD&v zTd%Nu6?Kf!63H_vhLA@^bD}9yE=2tMkT0kCYlB)CLihP<^-C`;-f1Z)nW0J*AW$WWsXR}w)?M1`$ks{N05{;n0KwftUS|mlIim< zOVD}_3O=?<2^v!-_D{E2j+d*$bPgQ9a6iLvQ#htLy)_{cjIL(y{51-fcWF`mMBg9% zfgv#Cw{_&-Cd|7krBP-9TW}}Wv7!iJ7peBm+cxZ`5ctZ01t1^l%SJ9J=fO*vrW3zj z#x7X8xA({Cac&!112`Zeu<#PKx+}|SaP^mo+zDBl5o2D;poOW^wwZ$4@a+WDNDs`vK<@w0?;09>jnV?H9iJtVWhzm zLF)%#5l*7C7>O`nuJer#LMiLl#mju$+^$y5;ajg%s_=uPAfXEG)6CdzG+2YQmQ$$z zpyo%@@qAH1w`CYU-n@*@54tu~@hW<-+p?P8(e}GaS>xKNLw6d_kmcNajJR-?&zQP@ zqHeu|A81yA#mBvYjcTtn1$)hoR+( zCV8(cVPx$~YRYjlnl+6_CPz*?8~uv-qQ#Bx``yI*{PZP09C+?vJ z)2qBU{3|*Ifg2!|x=5;}TxHkzwENSuRslzcG|}ITZg#TCkJ7;W!xdlN|3rTYq$AMz zS$+FbQq&8FRNG0y69OPaCnaR0hDCCNpL+OH(&=f#BU$3>7T}MsB9KCYty3%=Mx6)X zkD=^8S2OI-_g;EXTo!$0T$nY~&lqf;1etA9T4O{#7Vjog2|LVU0^s0>L_p{XD@Up;Cnv+WBarv>c72tc5%9b3a=oW6Ck{0g z*H67~A%Dh!kjU6YCY|WJb+~@c-)a<`kZG_Xb0z|6QUW~U0&TSic&aT==zTZ%RNQTj*oDH>z z<0tV%adPIv2l+l@orckO#qTSHaI#U8yl^VlRCf67WP40)Ce1VF#h&B1q&XT(AOI2r0l!rY`|~+K2y;GR#V4G7vTG@ z$b7nGMcdf!byKvTSD)r=j9IZNBp4c{b4?H-9C8oz7XZwwGvZvd2$ChQu$;{wUDArx zjTv1MI@l89m*SHQtPs*5J%QI1JPvlg-R@y2TlHQJ4zdt7xU; zSo+rG{5}rcw*i2M04?y&wDuDIE4CYM>CMRnc4Z006-f@-@R?@5u!UJtqcV8$R*^c7$qYLpQI zH|AYqj6zb86I={cs5rH1K0SJ5q$ZCqkQmqsO_jQ$NN(s1vnaAK?c)U9|Lks9`exE8 zR8K`IP&9LIVeiFpKhSx5%@0t!N$U0QP_l9)z^2)8DJyt*u4^@Jz?K||=kbh;2kETh zs_^SP3enx|?aZ3uW_4QmVLAbC^L+fTKmFtENN6FXE>=6`^$7vr*&Rrf#Sututeh5NFsO8=dvg96#v;U3` zNz|d^*;H@zlyrT|xE3uPBUi!_1we%}Ry1kRCW8M`uSLggpI9ia*PXaNBuPzVqgrb@Z zH;BGP*+FQ%l$o$i(2g{NLT|?48j7zz$bsRy-{PkP(HAznmp?|TFg#>@=}hn@I^u27ER$&9LmTq1L2F$-&E5@6LbbkbozH>+1b_(I06<)1JdVU> z4X)wp+tb39Y$+1Mf*K)!MN+S@-Q?PU``5IqX+K9%QymMJlGs%po~&b^dKPpWpq^7$ z(uLOVgU>k`Bzd+t7hCnq(MjZRD4}{LAf;MrqOrT z7dif~^lRtDqP;R(vF8p+#ZyOe>8&(EcfB53zIKy(F_F=8G*e&BH$^20kKI~t`}u1O z(L+ot{oSl&cHzNpzY|cTM%tgc`~)4Vbs4Ks@RHFXmBXW2bjw|P&M8qC|AH!s*N-ta z$d7KZ+h9&K;HLx~f0*V4DIFb^BD|RLtk0BxQ|$zj_Y{I}0YFZ{M{-E2Q8&-NKB`Kb zW^iUl&7g`I3^Ku}&m+(xulAeb1!I5TU{F|ze;Z*aB`|fiugR?&h+BMXqkmI3_9kxOu&!z@~xnMOq%mE_$Qn0w2n1NLwM1i{r^=K2dT7guv5Kukr6s|f=8b3O_A6{ zQcB?8#Gv`58><6!mq*L&-xo!#17i^Vf zdX#B0%c?Mqo_180gs{F|P&9yL>sJOpahum8_EM?L{;0pj?!?_W6!9b}d)ItJSo)M?P z#;0qnmYfJjWata=sp42LjC3;btmfr6xINtrxabAHe*Vzor6u=#zb$P-MhZ>tcxeLp zvXK7Kh?iIF?4iZ>gD>Tu0P8s-z$acnB?rY3H|nUAV0s?BU|kiXE_#fjj2iM;StN7$ ziJ{bhXXe00r)h@7id}CYU5wMCem<*1@V}IBf}%t58?r{Y?dvCCNWNmm6k5r+z}?+V zdbAe_%2i5w21))TN&I#hPNmE_iX3_q2a1^?3Tn`oc93Js9u?{XW(gE-lvQS>(Q2S= ztgEQ@(@z{^ahZ(6^OO9Xw0}%%9Y?c&5|qemm)_g`HR&b3|C6aW^u-^ZnDUtODcj+z znC?_)@l)ZHadQX~D}FIL0FCX2=s1ipQK3r*a#Ini3*dm{=FKjxJJ(lY?+A1hBDL0g zNHW&Amu+u{vkSbQlPL0cwf;iXJ?^bTZUcZvYPLxq>aJu6vtB0)gdWb5RzHFjr-RWt zZEF_)rm-{BVE3O#o{#*sz8+lseE z9IKMQ6X75}Qp@7_#i)~AGaT~M8>JJl=xc0VD=L4DES4!pj{Aj(lfe>=O#mDu_=B#+ zcT(dxBQ@QaaPW=KmhN88L#yk3hFu>2f_)6j8z;fCk#=XMT9`(kv3A5tyu^{R2&ZHY zDJ3XXd=?93v-!GUoWw%0)@yP=5*S82hK#whi`hi$dTIWyw!2+gt+rl}+1&jF?5|_qYom9hMfg|+U z93U`-r3AHZLyAsGGpv`zFwd6Nkzj7rBXc+Tfi2Np@A&n*GoDl_4esiNw@ZF^Q1&vq$qYX=- zw($JmsYxJ!tZ1>HP2{sAmCZ+u-p}LM%_|ioMci$c8cWk?Hp!T@`6k*CxIeE_>C|2T zYWROWGPYB|_a$c^O(AfEr`>p*C6}iK*Gw~g*76v=+mZ0XyN$bUw?EIK+O?a0XF=}c z=hg-FXpPderYmrM(P>sYMa&y31vIFZl1z45Wo{l1lDE0^Gpub2-@_ z;J$*G1+f7@Kyr*VlAH0S=1Rj0C!GjaIql9wsD_%|pSHXzP0GR{Xi^cPmnSz#nyZq| zpzz_m7bYdPsr8I?aK!ZUJDVn*(W2~ZYu`@+amkKLcO{q}WC~sj7{jTFY565Rr>9cJ zA70b+5GR_cEhP0osTxUqn_#VTg2i?0jHRuCt!^Er)*UB^G>R7us4u9t%&9+UReE8D zrF9E3yR)(dW+J)`%;+(#N2ubvFTt)D_hu_CV6=UXZ^piB*HdZp{*WU1-Olznfcq-v z^>FvKO@JeVZG%k315C`i=FBHYx5UCN*$shV@l_{k5Ls?u?Fm z?0Ziv=f%r&%(o>s@J$iwR?-F@gaRv_{{;mV=gp^^kqGe!lq$5)%p7DGPbb8I63Qu) zCB7yUga6>teZ->5zgwyvWe=5?48kcQ!{TvAo5F(rxjdPD_XC!S7SFSd zo^c1eOgs`^>}6U+bDGLumx^)z-GI5} zL300-T!2Hoh97&moQ$-2q`}Nsv}#XrA0H*w=QDsVjiqf$d|O^hyTtBYaDSpm)y{YV zv(HcK$+vECb4l`P?9AhWTYCJ%ZVaZ}%$KR&CI|uQ7yAHH4qQ1bYmtT%CdmPJUjn5u z(eM!CQ8{94+p$>3{M|ms0~$eX`+2tYryGv~eOruOULhwq-=9gOzbduyO!MY6nL@Ie zjuf|&#Mq%JFbIkYpEEo~THG+_$_W=p8-^Ie5|!Vm^h_&Wbsgq{}Dh&AABvTI$>u*x9X{{I~R?+V6g&7C0^V{ z_8XVatn$@4$u_lrH~TMW@hWz@*H(Yuepp|VM6=M_i6`wz@ovh{@cyIv>D#n=F2=fk z`^g&4ywPo*T!sodbZxae>CrTV(?Oq8E9N`Dx?Vw(WtgaG`o1Ur9R!A{BJk}ow7<;Y zD4X%#lggNh9JrLZK5UvjK zLu+RfO1hIU`OFb<@)`q7M@T!tx=?mTtd!P4c(u{3X@`@J7Orl`Hr^e4ZX6^3Lw3Ji zt*<#}alRQOgJpu&K?*5wq-MiyTyFyHpdK8hC#Bu(TM(DgH|_*RL2J?l+vQwNl( zsO|RO>m;`uTi`Wxl!&;7mZUYHfRYg7l&G-k>bopsFxxYx1=;lJmx$DG=Z0KFSy+zC z{fMDwP>@tfo-H-agvXLArTV?es9Tu7_xRDP4>&1ryqF7WE>#UC;HOSpAp&Gj&Vse( z-o|ma0Z{FiV=|G1c_t58;W{B|L1qf`y1lyB6G`zm+Frf$iv8iW@S(ZA|MQw)m%hx1 zH2~mQhXJ75wFE;>nMqX>T7)zNC?BW6~Ad29H_7 z*1Y+jGhGRSgLQ@9`}^I#*m>D)$anE7=2PpN^8=osizW~pq)G%37CcWVGj0EyBjIK4{SUt+f40+ssa;jvgR6O->*rf)jIRl8I0PzkxviWHa;hh z2qV#6NMs;V8JB6%L#ml0_0PoU zrNvL3|3IknC1Y3M<;FG>=CJ&x;PFAM^ck1C;2!XNl-eZ+W*`eWSU;OsQye@~2$QJ2c!0z&(F-?^Myq4Y&KY`w+A}nswD$hJB zMmn8dMv90%WbZ7#d67snUJ0m?rUcAof^`pIvnXnG;<5bkXaXt=JvtMQ|jP*W-ODk_2vpqFoG9MY<}H+l}2E{$dZZ9>G0Q~{nXU9-_MBk zQe~$vPQS19$0S}JIjq7EZNhX4s3s&rxbqw&A^9LiiKn?h)#<`blw+SPc?WNk)lNKz z5H)p(__pzjKgnfkHshO=5)H(W3gw9)^^B;GpFdmNI<^yA=#h`^-#%FHM;bTiiR}+; ztCDHx%%QmCq2mo}OM6+Tj zNy(yeeT=sl1PcQxxoKy8HL;vCaR~}MQ$K`)SHIAO&(SX|dv&&p=w{h>$%_4#dPqC{ zoRg|SSh!(=VEo565V9#=AaFCinI^}}skpx2Wk%TBg=DVd(w>4_QHgK%#uT{PX;jY7 zb8sC2X$@#DXs-ApJZ*4>8tqv}LLDan@gZ3pF3+d22=x5DtVw)R-%h2VZALeW+m+n? zv?MgWO}K9P$KdyH=r=_^1^!O*nn=`en?2}H0>XrIF~K!-ONFn>yrTM@+Lt7dmN9d1 z%OXwU5Y@AeSPVDGk=fg-b9ve32fHn|Ywt*NH9Y=C0x6 z`Oxtg)5-h7-tK#2Ru8!mSOVw6ab7MoKu$sexZq;djN&MwT=bxR z2GhVen8HT~n9}ARt`OBM1Zgf5aWWYEC}T;>&3k-xtWo;2N8?`*i+NkzzhEC`TQqVS zlt;S$GTp&Md45RLuZYJ{?s^~Sp*<^G+a8hXhP$Gv?AnwOEg~M-pTSr-#a{uXv25)s zo_IH7invZl-5e9|215^ko(1b@2e<^n1l(>Y8Z*Y$QtB)>A2UH?-l<@=-@xAe!f;9N z6yFT@%r;&wuR?Jeh!QXxctHtCFnT0IL0~RcqGh06$U=#J0xE$Y=&*FPCUEUOO1udp zIkkyjE1@umcJUqCvS0pSJbc}5H2IJEXmvN{uugg|Q`m9jMI9p(+U=+vc20^hABN1s zbrgB54W{A%qevEtP3A{6DNPB>9NyIn{vtgB2wpb13;nI*4_8bP{)dBXH{K|4OsSWu zBu#~4Y<@qK*Sp6y&k2^aZ`D&I0I(rB&rD_@3=&H;+N^2nCb*I}NK*hF$-!nx>*P(Q z6oZa87D5`1(T@X0tK-ZZo%6a!9JMD4Piw_EW0ni=(dHKU+8Ou$3-%GhBA?Tc)z)C& z)I%`MUGNgZCtlLnHF47r?aAIM65#Lmbmf^WH9P@12%yRSKAwHb<>5}uXbV>39B2Oy zZW7S%V`^&7c`>K`ICQ^r=W=vNfw%oRene5~gb7yC{MBeFQ$J=)i$75E_LGd!rvi$n zF-S=VHOxkE=c3P}LCNtr%b2IslvcI0l=dr^O52}CzubSQ+D?AnF0!;#cH&`HbWq? z;~_VocN&BCxl9HS0vfIoYLKsXv_f4hCH~kq+`Yb;DZK~(@kUN!EpBldmPe?cS=C`A z{l!EO5s9Q=dmh-Lch*~<89RAOjQ*wDuFs1Z;|ps@z16^WLWvbcp?P*4GnjXX@+M(V zDK*@IK~-*&hZsEwhFZ_C3$Wu=A?gG40@y>c>(P1+1?_1{v%n*c@Mr@*6C+`hBPnuo zX^w34SfSV$Z2#t!+){y@cVItDyQct5CQ%Z z1DGm61oCcOE4-30ZuC;geVyHm*g}ZK2fHUZPv!D^`*ZzK^-8a+KhpjLfSg8c4+a8WO-F%FftbZCA^(IhAk9FDuSY6i9!{6^ z_3I7c?gyzo(z0sbgSnmARHJRG?0^2CPJ`6`NED{3(c7+@DrRprHq+pT(y2XH-7@t0gb zy7fdzu^{;7pZfQKg(}Gl4%)x_?c`vqJvE7})=Q&3lf50o`lc?^!|UdN<>&tiAtoy) z5PDRNc5DZ*#sQ#GZH*NRS__htrIP*XHI;m^@&!K8cZ{f?QhSOS!yk|F*skz2FHGN` zyBM*PJ=n-+C@lN8c27r5OjzNUAM`^0()6FDy>*8-bSJP@I}u0KB!Y_84zFOQ@4ft^ zSTYRB;KGZi(y5U)&(9dB4dyw(9@)`enw!bU9_7pPd!AwXYRX3Qy9a6e2LoP$GZYoH zze{c@_iSd)a*y+l42Oe`D6|J^; zJi2h_!wQK}*WAr_l+%7yq6xomYP4bEF?B}<&XJvLK9VoRU)@NwVO2G6bZ5_E8X)wR zHl>Wt2SinGbF)~#{cE+XB{ecB zxYy%&uknlTr>Y0#g|^-rCRcRN!wHjlBQ07+I%0r4#TN-)ia0fPW)x`bD5E`t0qj-s zt`7t5l=_LUA*tR>xuWy*M$fygT6q;w1A=ZFmh~Ie*A(qT4sVnlm~;*Acrc+9I5S5E zCwc!oy;`1_`O)Ivg?Cr4_Iw3kXKILZ`9osfPa;htlZ1HZS7n7dYqd*h@*WVru{2b4 zW$wHY4^R_9!uK3X+Xs|@TxH_>UlBMi`7t7)gu#iLptN1`yHuFjQ9 zjW4|AGi(048 ztQ1=)SDXOmtph$QkClQ9)*m7CMw^%#TczZ{h+tVPSod2x+6XsZ=pcV$q$_!i1a>z8 zv2viXYgAEW*CPB;o15|uv$JR2d8fa!33)F!pWeG5$}Z7-&ho4EPwh~NqK`9oyaD#xS>`e(CjD}cXKLOtWz-E30io|)1YMMUs9i~k? z=kg9pu-P!c2~HTsTwo65W=&IvY4w-y7#mOjXsdcD<}-2j_g`*t%7ClCN!(tFIp2g#3s3R%g>TcUg;mZZfnUZcOSaX_uiq} zj;JXcmKe3*HGSn~g!(T9zk8pXRUX9+2Kx0~@xENnFS0pNLAl)jv~s-kLB?SM?O{FLI8Q5Hll*OS;OlkQyOcx zS*VEN&fE}vt%}f1ZwwfD*J3#7uV$TeF!ta{+AwGRP~+WL(Y*eWs|lX_vOji`;BO|A zmR=a+h!P#AQLPCmBCx@xenf}8NF+u_=<3`nX2q(%r!iy}r95Sy(a-lI*90JpMu}5(MUN$M3=g}hJ?)vTe{X$V}E9veI{sB80F+|x+$p>fHa{$ikCWF zE2RxGi~7djAzjcDT(Ju3D;mM^TK*MU_YrRGVY zJLq3AYvOZ1_tcF)zieyJA}uUW8ZE>l|IYD$PU=HGNOZ}Mc-(E)6P;W~o4PiX2D1u8 zcn2JLabHQgxL&=D(i?>{>nQL*3!PE!8 zqb~(Mig?Pvbk7!Xx-Ao2&cjlkUHl{N@xIQ1prT6Z1t) zL!d+2g3_%cqc9d_A)Om^)C<&-5CDILxmC?qwbr*_ta($YN;*yy*I6t0q~fWo$bWO# zEY~J>61@5FQpncpnZEWmEjNT~UvJf^u|XPFj2i6fT|)#>lJI7!}I{>ZL0NB<}4L~TBX%m^45)E z=*(o@;1*?AwEk{0PnE53?dsCvx$kKrbHVSG$Iq^hA4z4)`z}oh18mnEw&TFL0sxS@ zL~>vC^l-K2HiGEp$^WPnq!TwwD}vE9So-Hp+($SBZ zr`6RJ@&>#`D?S)1G&tu}9;*AKh|rq!^~$?QDKS$7-=jcjd>_ zA>SqI7A*bIpW-;c0<1jHamt}^`OiFpdvU0N1I7Di(*TNjW~NjUa|s{$_}g5*5KT*> zkVU;<{Lsb~*(C_1@#KM#gI@DUe@1%CIVs$;h5SzFh^Ck-J9q*DAdCcf(#pwrypFGw z?_-?-8uAnlMsD`>NFQo5zEz4A*Gaz7D9vvx=)Cy)&GYS^gX=?ePTmL0v0w|_YSd$o zvqOf3-CR653f z8oh^omq25gz^yKF8tne0qjPX$;O=#Q3oj6}k>?m}Kp0t*tT}foy(^C2;Gpox%!-z^ z!T#7sHfDwkQqk;N4#iHa#a6w9!<40_*SAG|DRuktw^|%!&NH@Lo`MVOigXDO&&C+h zzAaJm)n^;3HzJIbn~e0sSbY5xSWPr`BG>GACz1?39$Q!UaPG$<7y2(jL*vg>7{jxK za&8KX{QCCurJfnh&@;)(gNN&TAFlU=qyk!}c~2qMzBC#b%)P3@TgjXg_4QB#wPvq? z!a&5wB=7R(j`;4>4GaELP?tR~o-j;it?)SGk4Sk$KlJ$q%S%3uXFIk(u3UYW;*F>< zi3EV2R3=kgca>0}kBN6A4oQoTw2E(`NK6cnwD5S|Tg(g(13oo|7by6%Rvb zJqaO^68_vFBP70GtG8n%X}WuWU}kF+)$gQHp$bJ@pek|5&NOU9ag{xYD*En0L!s!0 z0D%e=V*yQThmbHJRI)MiTu7LlxzGdtmHDABuCi2)tB@4B`g}?b(u!`Lp&)|jdIYUq z!%#?zKhP${NiQ-InqM2dK1vWsYr%e$U&awG71aLmq-zoo+sl-ZeT|(=4eJRF#Q&lJ z4biWp5|^Np&+_on2!mxJ{m!cP)-%}?ECgW!fmSVFB9xvLNwT>tj7u?fhKkeouRa${ zmAQXmP%iyM7N6_bLd#h9Wve07+2r8yOugoo;U~O)A!jd0Y<7N0CD%nz6={TxFPDDY{MQ>2Ag1!e#FXj8 zs`1p=d&yRjxUr{EBqv)iX8{ftf#oW>z+J&zK~!aNu27os41Ur#Ei1j5p;jP>3FA7x z^$)ArQuF&_#U(hZD|3*lA|%z7El;VO$Si6kvR8|1UI`Z(RX+W*7A5` z8E_gbTghunH~#O6RY%fj?biqN9a7=OZ`9fI{bY#3ukJ}@v)TqZPhmbA9=tqx^VWGi zS>j&h+h2=G(?KBA#N!zlp>(VY-nR8X?~1rn zV;?hFrGSv&Nb)r~rE#JK)-|4J!J}o} zMOcSzx!xWv7>0TW#PP)au~B9MaxG5loiI1QWFA)|Y+6;tDc&gUx6)b#PaI_;?b1cA zEaP=~SgT%fga);E-21jjOj^U;ZM$E#{I{i%!)%}kj0-j*pwXO2I_rcBNm>(V7kvj} zOlne3EC;5gx349q{#V_Av7fP4H??0FNUmfYc|pU+on0|$zEuQHr2Q)9|85&}S^lpR zYpENgPj3Qg%&40WjHbgXe#9yl&8O=9bM5PaKq_iH1X`QFiAmyJsxQ5C{$Ktf{eOAp z$fyzHO{^zqYzE(W5s)*Na-hgHxttzutdr z_5@frDpQ_fim^K8=@D^A^J}?DVHRW`rCJKxFSM%BjNinfZiuBF(la_~amP>Pmu7Hk zWtU6OxTRmxT&F3tj>?a@9C>9M^Mnyh!S}r2Q}T+<-~AvPeIF?-Gks`QaRsgVGyzl7 zl_>VSnBjtZ(uZ5_+!+>{I;A4UxWw)6PMH^6-8*^-@r5IDnMQ(S6U% ziyo|CYZxJ;Pgz2Z2&&Sr9{)DagPVml5*S) z#(f7Xh&9JcAK#M9kmIFqW`5HP+X$a2xrS=5fqd`tN=vakTv$XkO0q=U4%Pf!08>v^7g~DXT*&y~p&&*8K$C z=Qm&Kca-X7IVM{k?D_>A_*{8&rt|&O5{RtddjN)doieUGUDNSg?j@2fkNMy)-Jwf3 zU#woIJRDO}^*KxKRXky!R56q?ZL|(QS)>y|1hz zLeLG#|Ft@BPF3*=le{I)TWPm($t#oBcei{vRs@~jD}eC^-r=t!_dh(T|bp7 z*=xkohpkYx+x(k>=f1`3EwD*!diakZILw-ojU^RCOzs@nGJ;UR1AEECoat#^6rB)8 z&7e{57-+pkQ^UrXDHC7ToEao-)frxMGC(RET`x1Xwj9|!D;K8OX8oW3f9CoGx4Al& zl^>HoLeFg=fETL(;CoGoqNNp0w#5z1VCjps@(7JJ`eCXtTraI9gMGlQ5PtaN=U`*; z_4^skBjAY1pr6vrdVteldHeHwvShKF@Bbz2JQ#iS|GhK;RB2$A%(4RO6hN#-Xa`h%$nT2r|AzRPddsD1x-oX=&z+25|*9B@>CVqm~nfy8S)D! z7mf$4iP>vicAN{>CkIoz<{(kd3)b-4XBL_{9;V0NfF)40AQX>i{cB<#{W#V+U<#u; zjwnD~^B_PUFs3Lw&Fbee1zql*$hT0vqp>rn%rf?FscrOUxAs4tZ13uuca8ZPcDRe8 zBf`-ZR+7dD;2oIm&c1IamW`!c3%bM5io_OQ;g*WaPiY*GsZ~t+Q5z#phpsng@^3It z;pIg@@o9P7{)Y7yns&`Y-Cy!=bnND)q{p&)4vecCgs@e`ja5n~M4ovqewW|yw({)wr_h3%C&7|T zLVsU8W%zFABHNpYEpm9;LmH-;975>2_5VFJ_F=r0vw(4-1L?Jy2-f~G%UQ(Hb*WFJ zM3OdYbF#bQ_Z?k(__6V^2Rq~0fKko?tOS+y4tcqNYLfT%f&pxuPpqY_=t7orK%@4# zX&G$p_2d zx$1v-8u*n8LylgfP4m5tO)$PkQL~2s7_D{bK7aGO#t4GJsI0~obj=_L=UZd-Jw7L< z151dAFVO8vRIzc_wbvrC+h!XWCwVgD_%$9Iufr}uAw?}&n~uZ}o8rUN zBw%65AGU>@lw{8%8ngsE6k`Z|ceqHB^U zGE=>%Y`te_n8R|@?$wV|-OkD28WXo;b<=8?B}`GJa$?7$*7|BIt_+JnP)KL7nR>l@ z3Y^*xbCMIZZ5&@jd(1wOzGh);`4o91Q&qWjbD>b|uK16yHbFf6qQ~jQ{wavE)A&y~ zfjSIkD+EvWppb%b(X&bGvXsWSpDz8*?iJpqR~?4%Au+VS^o5!tLjwBNSYREB=cA?1 ztf+Ur&}a=Y_I4Mt_wF7XSj8y}g1*ii1A!A9am{rt%s@`(_L%o#o{|I$oznDYOPVS! z#;EX3b51UJvtjEwfJTtUgBa$ZJT<>^RyH`>*Zt=)$8!(m%`}c1?)R0DtKNqWB{>9^ zd0vSK4g{$vo|-hc0;EByo0_MFJ4i>L<3IJ%5mOj8=rZjE1ogU9VB_?zHkB+{FLDh3 zYz%$F#9P7$0gOGvao)3PEWK9^;*}B>f)p*ruWleeby)m0vD!3$s35x9=DRt;@zb%cQQeX}xz6F^)qXL*CHTo!Y}{`kI1ydCZYaNs)p%k7~G=bxCV9FdkL;c0mog zvf%TEoUK~&iZ^3sF)MU!2TE?o`x(|K!LH}SWb$K2a!K+|%i%&2`T5FBEe^N^YS(i^ zD^hGJ_fzI#QWY%?O6~8Zg+(K2N0@E-NR`w4Z2u{peO;~2D(w!vJJ`EcPWtlUvf$9{ znT`@+X8>mR-`AOu zO1|1(M4jvfYn7jz8v82~I)eXH-bR963I?uo^fylHV(~TSGelPE8&?Jl%;c2ST%}a1 z#zVH~hluI8(W9-f@~^IsZF!9Mr!@8){!B5RZC8zdY_}d8M;R<^N;oeZSFrJT@_cXz zC1haJ8r2p0{$96Xs;u!Y6!v~>;`7%VzUb7~=L0``Aqr>xx)R;DoWl^0Vh%QywB)8m zsMi1j_)Ia7-Wqs3_KSDPG**i)b%2TCLXNIuOgywP{|UN6!tRM_g8tVe&(EKGP>AVd z#+PwV7dCh14A_WPULWfB@t60{-Hz(J7Z0$%1pwnY7oY@EAj9p*6t5risBp7T^bG{l zl>+s|`)ubppB40cUb`-{PX@Z?nwPayc`|+HMEUI>vR)scW!p=x{dN8CxN=ao?4CDm zFMouQ2uda9aSw~Z(WdK;n}obo~CFMWzv&kzuR%upuGxdD} z>HYs)ats4+^?+CkZ+74x(>R5MO{{@Wpd=zVN-D4kwT7XRAyq=Q*1QbY`!+M&5Cl`b zkx4o&{cRY`J4A~B6}iVDz#v41Os@;dXehEjTMtl1##-sNGSw!U$* zh!r+z5Lx9(VNLuSr%2p{0HdGANqI z95`)X=rn!l`&N4KUtu20j#AhveIg|-?_@@2Aa-;67=}2Hfa~Mfk#I+$d2OS}1t|E1n%ANL@CFND9W#P&no5Y$ zD(4pVly>M{AVT!GiDug;HvYsl7I#0XAMFWJ!!i==LK~ghV$e4I=~ktdvg~I?0tSf} z?Q2GzXiDZSV!gu*xxfHNFXR`!j7i|c+ev7r@$7IBpXN^^DCnelsmvwyAlc`!udIy? z$+uo#Fz8pEG8Ix7V6Zv9cYgHceqBLF#oLflGY{kY;bk@>!zqezom5X`v7WM_ zk+@KToa)32^YVpCts6gGu*-W_4-x*p>c_^7Q!o7i znT-+{1)HrSjfC?R1CScVz;%&N zjhFuT{vt#=iM{>rfPfNxi!^1+rr=+mkze)4YxVhm7zmJm1OR34739!^Vjjq|Sw3^m z@LM)(wh4!x?H{&<^-3~ZBaYQ&Mq=72&|&HB{^CRVCwnKXQ!6H1Y2;h?-}>@|jVPf7;zhVAUiu;4 z%1*!-#6@Gh@??7-qyT;7b+J!tqPwCfua$a{BS54qKZCbYa*U0jtD!T;r24s$gM4SD z)k+mGi;=?ETiN^=394I zsY+=im&#|Tj8JAK>HFceD=S0&_#YM>wh$7$frjr2tG@B9w3wjg-6EIDftTa|ofQA0 zGr=?GmYrt#=GjO2!l*X@QDHqK#!N`7S3y>z%=n47SXTx;;h}^;=gs7?17Tu2ZbE6x zw)(jD`~?*OJ7huVncNlSY7|#D05JNp@A+QKFXvR!)UFtK%?gD}IKUO5jDbCCrnX)6 zj#cW9OT@$m-(qG7^~}#MBz|mvwD$z1=xqjJ{#f=qMYXnOD>e&M_^pK6PQaF6|HFn zRG#)u+aYSP>7DAaJ8x~|A1ZsjFkm>^U#9BPMoVppxh62YlvPh%Y%XJPxHDcfr-Le! z#KrFcT7N;v z7-mV$ZM7essI|jvF6zW{o>j4B6|P|OU=lu`LiAa&STqq5Tm?7saJpY;Il@_Snlifq z=15~3hbW>fy+1pXlWn<^nOMwgQ!di4tSzBj6=i2k>~=3|%NXqO3fBF^Vnr)p!XtJL zW2`f3;Atd)Sc;NBf=UR>1U_&4{%7l0AB@rRdP!!6_{ZBydY@1*j^C^mDyu{>?;biY zesy{ouN&eLxUtX7;tIkio>-gbF191ToaiwBM>n zzYwp!@_L5fedb0jVmx+K*D2iX(~BS#YzwnCJ4dx$bQ!7V)Nmi8t%SM9K#yB8pjo!} zp%T$lJnqO0M#D+(&1eg6!7WGcBzeP~l)5o+UCLakaTGCC9)cyFlT6o+EjbEmAQXjxOR~y;ptFX&Y@@3)Y|a2fL^%Y5IiZ) zxV}ZIW8>Y-t6c{FTX&w_zPiYfr~fexWRddTX)|7bwaeWa0TJ%7nLT*ptJZhgtH+}!JBpfzy`Qx0jvduY@R#s!d4Oy{G<@JQi<wMY9qfR)124o-49L;w-aqe&u?Naqf>1lJnG~Z zbKUUJ?^Fqu0_mq6DqG~DnOVIO`CbvK+E`*TQ7T_#gOm48vfzu&|IWxN5X}FfIhh?Y zXeG5GX=4RNCYNtaR%K^GL>Ibwo5)X1kQ|x4!*lFPd?0uz^=5 zHksy*jdPUl)*I%MjdZUw@Hc3L8Ln(zXxRSOcKK??>HFm_$)L$rFqO{~z*y>h*4n^W zEsatHJ=t(jCuN%s+r111cdk)$x9j5Z?60RxSdOa(!VytL8Kg)%Z62e4KA!rChqRYy z+GtgTT;3cj#L*=|lsCQl@YC6XaLEF8ZV1!E^3#Cw5snV!H~M%QiR0)&38`VYc^x#I z=o){zsB1lbrSE#(mA|3emX&U=2Hn;*`1|0^n19UURY=cm z(^&a##Nn;pl61cHB^nxIh*sXZF4s{ve&GCpqRrQb5eu~u;_xTm$ZXKiZ~p>^x`ZYk zLf4jOr~bXVb^nBEUlwD&zJmfmc#CrL`9*ZA0BLWS@I)n{@g{Lp}@ zudmL-zVaIQyNAjRhav_?qy;&3kh6C|33-|{&OFaQR_GA1ptwyMwzof__E`m7;H&Lugd%r=(6YNv*=%ypq4Qeuq&vxr%` z$ju?2zvmRMopH}$d$@ydqbejdQrTB~wV+tq7*iHq?{bpu$6x{7+c-%Z~0 zHsbx3*a5oJX3|JK!nOl*q2}`6oZqa2bOZ)ElD93YMvRDSblmXZce=dyP zRZM#wVftnFh%9x-0v)3pH+yP0aE?F^%t?aJ`$DXv4>{=yV)gWSuhnoff!)^l{dP2? z@rEsTXQpDP{Qc6<*0+sM&bT~?We5Z4vnZHoIsn#bK#O`JkU+feO%Rm8jXdvTbu--1 zJb4tQaV4g|X916&rt04<<*}UvvzQI#17;=p?hca6oD0%B0Fb+Yp|kQ;RZUfdIgFFM zm}H)zG7n0UwO%#jaID!+#~coJKNU596$@vlVH41*dK3bYu(%O4g{?oU*aB)k3 z1soxxh7m9f^muD@k6{l6l{VNi>U#yw&=>;>_^azLxr8I0YVaT-MDn3&;S}&YkLxP}Kl7zk}49<)= z%rY^IiJ_jk_%QX)Em!dh zY+OHP{7%)pd-UJ@i^xqb&YE@Y?~m&(dVP#i&x>K??;6sY#+8#A`Q01mU0&I8Itrn( zZ0oD)F4{0OgrO6{2F>r>vT|0k$E^~<#DlWuL zR}$5hh{&|S@$g;_JU z163D2%oYIENt{&w1I$fkB;U_m&L0)G-k#9F4eQ5!nQ+Ds++m4CWoISHU{Fu}MV96g zd#$^Fg(2j^z*c$1k69sfo{ z|JSPo4lR508$LZvT5Mo-0wgsMVF4gtr1#@Y7XcH%#{o^SQiw%K2A~+mr6@FfzwMjE z^(n}nNb^T10~v*luQqJmCffwe%GydDGv2aAhnkBxYPKa)7wXTl?0gN)oFwMhCS_+2 z%7iO|IRg4nErm>e{#S-M{0Q}!WFt+h)>MX^G8Nr-No}G6ejGM6numxCj}XlhouC)Z zOZKv_9<&hK=0?uHrCzx`K27ieSDmGd-V#PYw;dCe;*`e3v;?JgugY<*kf=c!a^Z(E zKuCf7l;F|+j(k};jONedx4UoC7aGks>Y-_#46SNp(jT}oXDd!CI-6naqQ}R)A<;(y zs-3gHZ~G6_aS?2SoxaB|$sKfLI`|FUs02^y zdw9Pujv7k=m*Y#s7gS~MGes*8lRQTFK1|bz+DJ9(-I*HTCfT6XANCS$rhq&z`bR}21EZY8T9+EbB(BPfD&a{54IgD~LQbN(a|qJ?Z6#;xu^GI$ zN>^vzdZ%Rp|LkwM!7bOWRKb)d)W8p*aEPIw!Q&`ni7~lxZk=Ta1WFxX7tAr~?a_^| z5tTzJ$-H-0iTe4I-stM5WW)KpSCen*H_U(JAmV@IMcum~2=|AS^`H5v=q~s zUdsFWfA-4mbbO}VKN=)eDyvOJ(YU%r(dSZw~Q`A1W&_neOw z-&=~15408;ukPoJYh6S*ZNrj`cU5bpmZc*b&L6n&u31?(y-{rG8`*urQCPDPM@lX@oucJ@`?3WW&H8%*g@l-XUiYMb4izX5U7g- zMkpZ#!WfhI=py&|ehRz1DNz^@%V)iJ6l6c4w>HQU#S^#bruE3qJF8>4;ii&@hyH<3 znIxneKi4`l-Gggl%&;G&8iw?l+VgTF*>4IYfvhpd!8Pzz=`AV(r z3(9H}^)|jGn2O*_ijS{J_GWI@Ij8+;jIHsAnu&f;wpHfn(fFh6DtEe&`%WG# z0S0At<(pk$%^p1O9eF#@_giQZV!P0Fsn#$hQ~clFsaWY5Huq%~3h9d!y40wGOpZL;D2a)r^_=7M07)iIJ7`$PCL zQo|@1B+Xm#yMoMQzhZn*gN_iqiV?^WZBnqInzb%nUBJ0ubyW9W_e*2Db-c~51c94m zl56@z`!TvcmLz`12TCoUDqZOT!Sl2*!;Z|i42GP~smzwo{{}reA8a!%KM1HOtc#b` zK2;A{+y1XHAUsr$GE%H7nW}jCuF|-@VqSA4)R3)x;SJ{nm78G0J0L&-b?!bdVIq!J z&w@fu-3*IN($zI@oe*DYdhab$WBuCc?nF*5(vFo8(0v?wo7UOvnrpm(GK;A!cZ2u1 zTf@T(OFupop-y)ektNh|RKW%9CLbGj3M>9)Z0c-lMh~K@zIyEf4`%Z`_zg;|MofbaqH5a}+^-{1!(Dt-^;C{`p|A+c1Uu*?& zQFCgIo7tNGGF%Wkn$rTfY1J z^b5(Omi)IjoV@6Z;2WzyxU+BDR%SO^`*(W&C+<-w?mg#NwXJvdx_{Jy!nP;@0RaIG zbJM#>J_SiGhx?@EU};I#sUft}O^istP@^>0=$Q(hu5^~ZrsvbiY$pTU?WCWCx7`aD zo64@fc6n2T{dBL+ZY)AU>Iu^&5{OcV2 zECu<83VwFUFlhE{GIx_5UbrtX7FgOOPH0Z1raU9r{AwpH-`joGAc!{p&1}KV?t%8J z2#2}O|D%CkBvlryhG>zp)qF4P);=&?V2BbtHQYhGl{x>YwS)Vf9u3yO^D@0rQWPld z#MgN4kp0pcD*@E`>3TY0cf)C=g5brxXW>-`f$dp_CL!%~9E^D{OC-m! zgAA`k-4W5vC;NU_`PADDeT72yrk94giifal8@p{2LwSgHqfps0 zMK7zyDO0URNi?*yQ6g7Zh9NCI-7eGcf8#E@@Yw`zBd`>(r{53OP-HX=eWN5kkpop61Fgm|-@&N`DX-yuED27$>?-+4YgFB~Y06ZEqwGtyHtHP-t&1lu^Pv$W_3m9qC>xUkrprE6`d7vAV9E=?; zQ${MkbJIfJ7&h~7A}mM(Q^2$UtE{sJ%IB@xe_DOjy|2RP#sLU%)!3R=@)VjX!{`=_ z^!&0rClrqjy+L`1;zZsW8kL|5Af;Xnb!0IRD<1Fz(VUINflnOPbz19wQg&t(qRaP& zp&}s|_DDe`Cd%hbf%Z?k>2_RKCbR(i5vjb5YEi9ysj@gCjCytG185)kUHO%TrJbLp)e^t8uZh=+-Ao&lNO_;N^7G~{9 zE2*GOl)r^*i;?Nt`}fOT_aEF!iGTE|B(J(*tfR5tt_IzNpJe@-;2IM7KfY+uv0iq& zA;Ei92Nr96wy!T%`1PR3m&{j=HwTH!?b~YCE@uA6ckhv-9){r$NMc^mc$tohxNpJ3 z1PRrtw_5Ggm9pS36Sia~N2zD*U8`skOxBQS=ePAp%Wi!IVppO7NF0IvxY0~)^W1@{P;g}J7^k#Fyp5NmiCAlmT1r@AFsjIYe~tC~qJd~kV5 zqJ0&P?6wJ(rot$?urRGYc2;4vY4lSa_JYzF?*Ogk2)84lJDKqheY|3wT}vq6_KUl} zK=VZY`?C<*x+wE~Xi6n$z8xed3BZnW3v2rGBpNKo>oX7sX%1}@C>QoWk6q#vFP-Ci z_x=T{NuLpSWrdK$vuoSg{Mk9>=7S9%WI9%|ZS;9BJtsvIX+Y@=pb^ko!W(!=P8**chWq+5|a6_9CtKOOMH*%nDr}AFgO5x z0ENfs8T3^GueDPVXcUF^L*Iy;`vEJks!Z=tAxxKH9w(6Wt)OO_Go)wd8X}(*n-?AT zfNJ@=;M8#2iD*@Bqo=BdJA|?y#sSE)bU1rSS|#gVHX+C%pO5uula z>nT@`9!^F>@J|Ng;94EV6)8dCo@qMY3k-~my9X$Do>L84H)Dq{6ZKL1iC>=N#m^n{ z_&c!V(BKdk!CnnoW+P4sgs!{oz=#|XpK7Q&){}wV{o2~iVx^QNp1uHik}fAa?Z=k$ zSH-KvwA}D9YW3zX46nNs09gD4EtM@1ECs_>43#j8+pGip5pUVe=%9Gvo!HhB@j7Ud z(EQ+1Ygo67@Ulx>&P1CpU9xvtTxLPP@*I^KQ+p3a=m8}E@MiWsUacGFVPtQwg{hKj z9XFkgb4s~l-@$XRK3NT&O<#v8)>fkZ<0dWjm5;C9Iu{vPV;IB1&By=4OPqqjc0_xE z6AQt*|3T1axJP-g?t9vx;XI9G4SoH@>z|32Let5T4=Z!DU>>IH*81_`+7oXftC>fH zI%fGsk@C?Wx2;AxZuu%{+&IlxWlm`9GGv#gXa%`~S6>*%-FD zUt=!KeXb$2%`o@-oieu&B~iMXxy?2AOQq(Pdm##?5V=)v_guQTM|4w4D8HA__xCTH z=i@xiIgfLBrii(lpZ;qStNRDbgq>(Zpvzbp0bS9k_C`>v?{3<+W=Z5xjPSQe7usz0Gt zgI9O5wllTz7ThWN?aeiFyiCKK4T{4^Rfs2tM;81RQI|m#J^BXpKLY2nhI}poP$|r_ z&K`qI?Qa58X9cv)pI3EuPVTTdTjw4aZWDs}D=_HDYoTxAXRa8$=8A9w`ARl??svMJ zLS>P1chZ(lHEr;5quZu5f1(o%lK|b5PHvBm1t5S)S5rB@`Coxplo1GawJ&8i&N}*1QG!c@A zbj6cZwm8MjfzdD=#F!mH{B=O|e`2w`qJyW9T8bpbwDn0VC9{po3RdNIbGxYl+65Km zD=mC7yeu+!oc`ggxCauF5I=Ox?5X?|R<#~<(J%Q_$evC&o z$(fSK)MWivzi)jXsC?t3i!!O+KhK+Q6(-Z;SX4wurt9|Ghc=YU;WZ5rZ zJlem@jV*Y|*Vbj_qw;yF$FANwawbHt*g!6D4WO5FQ-mLzly&u`dHT-tqigSNW&mC3 z6Wz~~odYwjJb4bem}O{T_v8TrZo?6f*m6Ymn4kCiHP3t|4o4hL`i$W+KmLUr_WZSn+T0SS4CRI6A#gS?6`0p*qcG9mj zayIt7JcayHEwVEEBJEBnyD>N5@Bz#j`XH^3>@8JODX%RG6S%|$Dy!j7mUU9j>aSus z92g>Y>ewO64|&zR`3=X8+AkV=F;IC1P!-{X5B(|ahCOy7Pm%w0GzKIKy?o^=+z|rx z2;rK;?4%|l_YcC^O4lISNs*>CBejnXg9D%<*wiB}m@X0Wi+lgb*~gJAJMR6><63tk zg1=|Q^@W-aL2~Q*!F4vU3V>i`M9tULEc%Vgkk)<*+-9Ap6s!og3LL5aYiSLknCJ9n zoxWWGIqB8k75()tR_j7RbsVrp-Kh!Zw--do;a&GM@vgLB*$W}&Fz5#s0HqX!p_p37 z8=B^Q&{cEO&gs@}zF!84lvI`YQG7x5u$Tle&rZ5};7QYQjM>+P@b^Meup!4iTWva zz3EyXHHfs(o7bG%@BKMv(I@f@8tWJkjOlNpC&}RqSln0#AW)cM<=gFruw>4Jg*ZQ0 zfXQx4>tE&c)v?Mcj>O3LdK22$k|k{abyG43CJ$xIz_ zI_efZjPxJrX>sj%7Mgx33@IX7*cY1N0Afl=i)!_R;t2O{{Z?`_lb}*XbgH=h_};FC z_k2UP2E0zBPN@jhsBXQv%vra&d0Q>L+FUDO;=&I5xZjp%_HC&#dH8hN>uRTo@Wq9w& zQhl6tkK@cS+-SSoll0fN@jUiA80VeiQK-5G!C$>hdUw9YZCjqL{|a7bU+itovB2%# zlNZ$_BLU6>^eo3>rG*E^P?oJ^HW5WX1r@XA6Zj27{F(r_oOVI^-tJtQ6uY}#{P3nl zP5w$6y@`wZ3|)SRde(y~X!{_vLq~N2v(TjU_FO(IGWT!&B4P16@>JO6^ZrjB|1&{n z$GHi`bONwkv08DoI6sXKJFcEqr5-$)C8Oop*Uh>jT1^hB_A(a0B*k=CI{=;4eQ!_yDoo{8rCC0gy(1bivYfb_;6~TH4zb%2R~RpPCoOrSaA{VqB`6 z?oD}37gu_16bFhqTGW=SaFqp-&l9PtB3iU2!Cw2ZOwzwL1cnYhu_Hsc z12+YKWjL5O!7PakJVuEPnn2quXlvFSX&`CK+Ddb!`)?H#h1pk~@jVZ1;MD8)RmG8E zw@tX)Wyj?Binwo*d(3gUad{s`=e**ENPkOCUi|}|NRyKqo*9i z1F~ILCPE&Kx&BFCv`Ltu68}U};CO2-C0tki#uwQi63Xo-GoFk77jN=eYKR|QMwY%z zGUe)cu6aS7ogcz?4Rszsw{``=_a6X%#;VgUz{T9yw=m#Xr{Wf;RAcoUv)0)!lU($IF z47U}F6%w>?3O)$P_dc~L|jq@|7}sS!6AFjsa)ghbx$epAL!3k z?^Paax7E$d>8Eg_VYb_J;4f$4EFQIgH$I38eFPHS5ICS5JFZoF)$taEkKg^p zr^Iwp^NAFT*ow}&cYWm)KHc^s9+Bc#P4{g*f9}!6#NleY9WzYu=i;N=#v{)1)EDkP z$szK`!%Inrp<*YTlv*;}Go^4!;7%T)HMNA^vB4|C!BdLo5(t@t(n2eVTK;tP+1QBGsC}c*yZj?_HU^41HW&XX#HDrn=}X=N zzS@b!d=)rw)fAE+(lB5#*lZ8n@i4@%{@`9(E0(SJ)aGkmsmtsUo}lCH5Gr7Crd`G9auv73`9}(T)s=O> zv$Qh=tLrG`9e0Ljgrpz@^o3m_Bq4T{qeXn;3Dvw`fE4bpK*+YNFm!$VvvcxXFV9Ff zjL;-g)fm-nIX>%kUZw4->r#xT*Tlcg$94Q`p45M=6%Jvho1%(gL^BICA zNe`@}#QF^uruF?4l+2=Cl|b|av!^WmEl97Jo1I&-mA9{DQdq$rb+2bSsP;Wi?&xAZ zdeV24?)2BO?2Is1zl?fuvONhITsY1~hmufw;3Z#Wf|VOiMWIn?9eNsX%y||98!h~6 zAzVr0l>W4&64PUPTO7<1E#J5$T>O0FgI9>j)av!)Fit>Vs}lg`q|rqC5R+^bn)^Fa4F0ConBd zK*;W3gCi!KyU2D56d!tjp%#fn{XtQS{)SUpI%zilpsyO+MJ?4Fb z6dE}3)#1vZ+Jzywd7eV)A%=Vt8UD#DJPo?OQm^g={fLRztQ};#BhtovZKx z?uts)6Q#==f1X_~2O!7~V6^-#whAGhg)Gt@ruF!o4cs(JxW4%;!1tYWZbP-+0^91W z8;w!>_!q`Lf0f7n*7W1_Er727JmEvegCD>Id(66->SdO?Cc4iityDben~-B%w3P$r z^UPd4amhKGLAmYTE>Ml11K1xe05G>+T~mm!57OQZ z{egh;e;#h$To=flb!}lwH%-w3e`#39{&l=ckp52T}j(Y`ot;xCih*>w%&dN0AE1y9aijQ&6_@vQM){R7N5fTcqSz^5uiKxY6RVO z)TdOD6#p#AiCNmWlqZ$(8UBumVmbWBrJZ~iAOZmF>No(HIBxkgvhG;*aP{n^Lhhfe!BERadGP&|vn2Rug;MAU)AEVSdYx`ya!_5GQ@Kj@;`c3qh|4!wg*rgX6x~iyS>LKeom38QOUC-QVeWn;xgS`d}G%+m$(@ z6zSYQiB8B2)pKc3HKID!P(old#60D-=((rE2Zs9zVEGT+&Qh3Yte_vfatw(IIBX?5 z%-ZDfU(4sN|CZ8>PD&TmPw>q?=GL6@-W9+5Rq?T4(5&Ll(P56}Dr7%G4TO_9=^+`y z<>C*esdriel`-NhtYiLdp6mK5KaqSl&loH7N{f3ayPbccR_b=HCFsJH@?0w}w5jSN z!YO~NaQ&2j!vHW3%~6qZX8g`qVdJaR_1F62`&n)&zzQ4ul}`p18pGLic6-Km;>7&j zTwj!@sLkzxb!=*OGeDq|J~%}}+KLdHb3A!>Qaaqt64R06Ps+aVuhSn8j3?QJn{rCog^~uZAz9FT`EdoIliB|x=?e9~tNIx2M}@)bMi~!V?s_!exg6Nf$->6$6THmT5WYGh8mx);4o+Dr%@*v5?Du@i8(xpZl_^yG`P62_Ufw__@{#&YS zbwQ(SEa_Z*QEq+%Uu(MKBUg`HH+0x3m88;=$wL?Gl$x)7e(Fr;B*N61!3jh;2W$0W zD4knBE@8()e#L}iwZvs)giaFqa!ztSYlRwTJ^vZGYpH@1<>$r+%6p-=24!n_v4ZCxClusDGorXZ!clBe;^%wV;b$0OO}jU6_`$IDx&(EYeiiM2yv z4_Hl>tmFJz6!iX<5D%R49g(_;a9k0GENdl16q+A@iUUGb;1f>eN0f?8nO$G6GyCuI z)X;~WZfS5b-rV2PyJvVpEz?|R4-rb^)YnrFf3NTWvUU1IhQ4C$Bkj?M2IjL2OX_vt zVeF#m6+X^5cCNCJH*8dOQbzazdVWJN8-jyiw5u}otu_Qd+n`cTDAW;N;eRIkN2MEB z_ad~g|M1`s2bAPY9+I;J1x;&W;Jf$uMI#M{hrdZepQj^f46%Ovdt$*AoYNS_EhsA$ z-+Kr}u(~tO?iu0*lkZjoD;xMH&T=dc-I5! ztW9d}z&E8WzKTVEoF&MPnCm(OBS){T*KYia`3Md;QQ*8+1npQNBRKk9^FEenc{q=+ z2Ra#YdQzpP`$(9a7)&-g(yQ=y9@l^S-Ije#w~x4fK7t`P50f$>$M%$b>Q4C9c4I#i zWpWhTeV-=mNwD+0c5|3PY~Q--^YVQG4r4g>^TFM_Kd-(2^H%C}oBmW=wVEzi4kAd8yyHMm!TXW`^b62P{7z+BBT%nyPm*#hTigKo4LT^pb z%IhQQ7r zn{y_)b}FK<c`Wqn6-zz@ktW_v?shXDy=cP=(_LhF002yM*IdwI1P}t?-p>6kag1@-&uOyRr65=CC5T}N~#r1rcmM26)MfyCDJwMKV z@uEofgZ*4{Qn%1e&*g{Qf-J!i)idBohsLnEc!M$5mHT|rQA0jhjsWe#>>k%1`H!0= zd2Ft@qRq1eISSPd`|E~%$BWmyq{WWlcVQjtDEN9L)ukimHvm;j7Wju25Q&wJFm)iZ zjr<}clur|S?A;hYqndcT zTu36Qdu02zqayeGmCGhBG@j zy;+<-WHmX1JF=5Xjd_tj@-86`$o}5Mi1-nE7C$F?{ic7_$zklsj#u~zot)7@&*->V0(l6xKXhn0>zKU1pj@75ddQl^xxNS7 zoQNDNej{g^j*2pZ=Q)KKM6Qm^<(8#eg7l0~=GXEuu@K;A(oxe6`Hds?=bO@BPFxOg z8wlQpbSFDX4W1WTmJ9~hC$IyV)iVc zo?&q{Iy#Bu0BvRACueRrn~DrR3le*1gyPdOmz!Yk37SPu)-ZRjU&{3O03M75%MAdt zEpR~EHN-fiA&n7C4Yvj}?IfvfWclB;C;Xo9wZ~rqkRjY>{;~j~X4QBP22(~yFSAbp zV#*K&m`ZPLyGk9b2gWX!!(49a40)H`VC&@cmg7%>(isgdZcH(XJ;5SfE9pe_8%J+6 z5a>@n3|;|(@@0&yBJgH926QP1oP0}disgEW!z=Z)8aFmRE5WKQG3l{QNY0d1Rx(di zvBJ!mZ@;wl@s=3#wCm<=X=yNZtS2G^mrOirMUGer^A>*57)(&YU%!8o67b4*=n!03 z^$f?4oafK-F{!z1*21ZpJIzCVozr*z;bbSTTC}1Tk4qmtA;f6bLmi+8tnvl;!SJo& zX2fVSJc$ycYMnT2)o~cVfvhmRC95qntjRGIOH@A{_MqA+=h%egSdeYpsko~V6MsxP zYLC9}=wChm6%^98;EmSFb~F;kBU6NPk7c9ynMVM~?(;&g!1K$zR_?h8JiS3pob#G~ z_(k;J=G{KDAWsfX}C-U(Ch`Q8+~4>dNnft1+{o)&^Hn z)7jo$HygF$sD>j%p;gvDj2b7Jpy~XNc2FXf@<#y3kciS`K**2l6CI*E?CF=P!eKc?(!P(JoHxN-VGH) zo=BC2eYc4+MKS0L7{{#{!z^>Icx)Wo$$pl0=nPuqES97Pb=qNcrpk7cFtS|ZL+OLi ztS%L5X19~Q&22-Ta^s6H$^W(E=n{`mDiAgD41dsoSb$EpxR33%K`s}?c+F$`9)Prl zZ6+NBsXm7Msiiey4eL?Hmi0G?*-uX&Hq(Tqxue~N{+IW}VrIec4JLmE-R6dVyc}j5 zpuz}7u1#*)s|D$yv7Llyc{vS9*`9_7WA0;Ch%Qrc+ooAJnc%s0OmxFCG08*g1IV(@ zeD8NNjELNP+uZ2y983@Rr&?OFqka3FT^qi;lq}_XXJU=*xXLr0hR=n%B2lyJEqxI` z2@4@7z>0!{5-YT-vWPDf7bNHcz!6#D=7$}{ny%)m1V0JIto_0@|>zEyaNa(;nNpXmFDxK6Onk%*XlcuK1R7KnUK zk#97YJoGAm>Fv68oH*L@xb^CObJ?spd0eW9Im=i~4jP$~eH@&uD>EAdM zJj8wVUeh6@-%tQ5{9abip2o`6|G3 zuFP2C@rAy&LeOfXKQiF0@#j@|5dW0frD=zc>OARSll(jq+`sk~cq1t>iMb}n`(XxP zqw|0-kp04#u>oZkD)PfMY!xpAdvccG$%)bGN^AY5(Mfs3Gy5DFe??eaq+$R1}htayvlJI)GUe2G>@^T8+rT*0k$qsnMqldhW&HV$UE0h-CyRqCEYfGd00A=z zlh*sqT~#*fyz}hWv&?`35v1*woZTZK`rX&r>^f3BK*MB%Uj4|tf9iHh;gL`)Hyw#y zcVVGe_S+_P+R9c?gP;cfvgbBeQ~Ex-`zT1I@2_@4#`)3uWiv5?+~WO+&qkbCC_YG- z!uc_5r+ovPb|E~uk!2_9m(t{m#ycw1f!wpeJP7&z z_K;7iC&v>igr?NJTj&6jXnN%An*#C39AY+X!AHV2p)Hg#cq*}{=_B#G9W%bXI@~bhHb9UUY_}Ra`0Q+DN=UeDc2_``= zvn>HJcA^VV)Ct@wbnF$?IY7_HSS-K5z&bc~qt8&VrX~AvJh43t8bN9WG(u8^m4=h5 z1V5TR(btP8e4~2i(nm<%W8$P~%$+iicm;QruUoNzw6d0K4;h{LDGx~=RGpIw#fVMp zcF&o}W`vW%8?1_vo!c}?zUj<2Zns7g{A<(^Srp=?kkf+%wSW_qXZAl0Bc|0qgQ|4# zTpV~u&(Howu8?68VgO$Cq-D^yL8kh)scNR8s!~b%vp!1m3wNHfKi@?8AR0QJ&-RXL z(JxYc#7QF>^N1q5EKC5Chk+_53BVHu+FL?wwRw7-jobyzSS-48C{KWTYf#C5A`y}PCs z$|;q6V3DrSj)1hui%0#=^oIYD${s9uUdQg~em7Fqm&M=Ac6Ur5Vo`B2dTibD0RmO;@yD@;aDdkhZi@o$j!b{)ReRSJ~rf7aC|&zy3_P3>D)@n+tO50 zRz>Iyv1jW4i(H>$u|$!9bp^3jtpzaoOAas_HU?WfDM23)a#1LPvMh?F=BpaB%>vBr zWsN#}?=P?l2u^I)0*c%+LCz^O^20U-sS*{$Ih)E*!#h^B8CxHYzdIqB3appj{Ab2*Q} zV<`JuEpG5ff&SgGnD>Z)?lZHL0D^@(RD^wXw-d-cT;;Qj_#+Z6fJ znpf352E$L@P|c$be_x1FZ~5p<_7M@qoasOT)TYmxjr`EkQ}t6F8Pv@z+LrNbL!^U8 zXX+F1Y=RHv9|X(8|39h2pwwOBBvQ=cL|7K`8Hy*+><0r-yWwG9suyzZ*N< zu3qCcSr(X41OND)1Dphc`$sY3FOt`d?jBG3<@&FN4XaId-T&t8xFzsQNu;ZOMieU@ zo#XwN3#sV7gY}5)xMzHQgREOK-2UB{pm-_lzlZhQeKHoKx8MC|cpUd+E9mh#Nl>x@ ze>emsQwUb{AZr$#Isyd=IPs(z-WhbEjn$20{{sU4k6PXWwURZt1_*aKvpP&ZMGjA# zoiqh>jS`~O;AmA!C6JK zQ$skTR8tT_WZWdZG-MsCYxBn~{JY^b$Tigd-6hT9o6qXUob2#rj-$`kiysVIMHc`1 zNr2#!j#LG31- z@&mx)_|4amnuP|X!78*3M~+Bar2`(>Pn83C}6O8wE|E|0}FY#OB z=ZY^a%a^UKOrx9D}>LcNJF{48`(Y~3sl3H?!*2(QW?6` zZL+gFVqsep)@i|iD&6JxIVV$ztit^%9%@IZTPH5KBcMYuSC~IsvA5Nsw>2}T-2Q^I zG)msIku)lm_#mjqjrrr4u&lQVApa&HCk~@y^%xG0V9DFvi}fwLc^(#zhFrWAAMKlZ z*5(Fk@${$fr)0*Rqn|t~yE@BOEoBwW{@2ihsWhy$6$i4^gRUt<|A4;~f*$BhBV z2$=i{Q$zF^de(kw0vtV-hwJ8JOC*p7=n0KRWT&%-H>ZvL^h_D&@+E#(Hs@n|NF|=k zkq8yZ=)L*nrsJ(}{2hx8Ke3MNCP{BOz-{5?d=LPO6m}eTk9cT5tt|T*6W2RrwA}Cu zr%^JB9DYSW_$H+ASS2{3YL*Mz?(7yD-}mIQ#@q+hsvKlnf|V0Fms>%S9-wQ2wv|a5 zZIm4KIuSydsZbm*9-cDkvkiZR9Zz&Oz9_$c&oiO{UsNO7x4U#)y2W0|`lKUb`U;F@ zQ#B|r1YK3kL2AZIXW4fS&+FcjlyfW8xg40e)!q~4m42Kon``cCzrTH8gdY&hKhT9x znu;W_OB%4I$KhrVCV%+3S%iNJI7|iJi7aoHQb>^Q^$nhpF(*n)N<9+9O0^Hb03A6u zb3wjcKAh%=ypcp}qYAlFa6d<&xLW0*FvV_!ShimQK+zmj>oKTZ_XoL$?9$C@20^A` z?iU>9tJ(!WHx3b1IAj8lQss(g!`kc4Tc1JZig9L;&Z{4~iod$b&-(bu<-}j9?xkE* zJzRh?8VF4}bBX_<&Wo3kk{P8Xm=f?eR$M zN)3XUk6kED?u^N=`5}8Y0rtX)HTyC`_LU?fWeY_ntCm6 z9Er+)AlF$)<%k}OI$d4c^Pg0H?CYG&&Ocb0I9l>z?dAMDQQb7dQz88CnA)d-a9~AA zN&#}77b(^c%{Gs$v$>@BbVKB4glP0QrIaDD+~A40JhC+%7Vz}>wzr_HrP$@K8>>B2 zkd{7n+gCg(w}j=U^x1m`ih_KdRO&UHZu_uT-8#-qE;nEey5sj&-xI{}z3BYO?iJba{W z3sc@hfz|Y+l}jb4*IzhqoVhhut6M3X{Um#91}BKR_v}vF>h9xo&My|$|L&s!mC(%R z6lZoUCW|lM&&zCcPhSP$O`E{)6&_djFmMZGZ=B~f>ZqIQS0q#oe|-=!VPdKOcK2Ix z$%~c}=1X&U;z?S!T!a#Y9mjaL~)zmGLx&LNmso? zEFXyH@xH=-TCFnfNV8A^M<2Y@>Vg0@mo{_d*?PB7@;k9Pk^VQcGaxw)3(%KdD|DTD zM3w>0v89$DvPo!u-4#KaIrokJ)bU@5)7EA6MtfZscKzinSR(RjQ;A3kh1kBOpth)_ zaP81pVG_xm9)&UYUt8}|T7g{qjBiJ7x!Do)StXZjImR9 zzS$}dSwHUVOP4~K+j$t)R~p`JZ#6lo+6GmhM_jY~2$yCf642T5tK_jvVsN#umMBDzaAe=+`N9BunIZ$k$u>kZQ zv67VsW6_k#!%z9FA2Zc$>(Va>M0OUn8w}ihuOxEHc&bUEvO1*H;ANnV2$?ykK0R<* z@ZY@n*wLrp5T&@T!pk{hhe0{t@95=s92Zkj@iFL4x0F+ahZ!fRLfEH)(vAK1+n;kB zQY?f12ok!e9ZTIy9bV%t^?U3NKy>=5@Br~;pK*?xIGYSELN^)FbR@?@wyWK=s)|cz zU=uLZ<(@tH_NL3EMNqg_I9vvlWhM7I5a#xmD4Hf&ai^``&8`!{L6t;=q_k(28k9dE z_O?A!{4Q%e~+j$j^DYpAKwUGoOq{d$A>3t89t-~0?qe$sr^G#@8$*`0^RyzTg{tyy>52C zERn2%1qJXkC61Esy9y5CPV6~>Av+&WbcHdPeTTC3<<+)W}c z8{#Yc)%aVmQ<`GoMOSoRy)Y-UkMpb~h+nXyC7Mi-aoGWXXT;%_2?^ghXKe4pxQN4A z2667EN2BTswBaI9ubVs-S!vh3>S{+v-r5J5|IF~ZvFp7f1lzdXzcSQ$lB8RMa+tmLzzng1jTV^rz)2F)r=r2lB5c_0`v4 zun0m4=>R=@bSRR~eD?r7-6Eh1xgr5q&~S=A8yujNS^hRqtL#Cx%IEhY7AYwzKKfC7 zqawQxKrdWf0q|1(${6HBjDiWaOWm_fnueBbEYo&)Y>`Q!Nq3S^XVx@i!=Ba%$@H&X z&3b)Ap=^jv_i!oWR)*ozZGg>}^r*asC3UAtnBD0bHEB=RZ|_>}Jj$$C_-##VnHu@` zyDaVvoi}-Al6I{NA9;Jx<)hfwiod4dfVi-%2FV4#>(C_U`q(~L=9CTIQpy>6m1+i}5c~!0 zU;qHh&S!oZWvOUX@<%N|?HmGaeHaYI;5B+#?SgdWDTP`{KMCprZVdMKw=U1qSFA^s zI6ZFG_8T)wBbGde-4~xL7#q0mZ%r&6t-TflO2352>nD5ZxWP;H-zfIEtkjm0db5E_ zvCMAtRMU2fiF{VvCsgwyx8CjJ9pCs@#+Ns&XC%vo@)3BmvPmyn*jbR=uE z5#x*Yfe$t;X%Z`5BR&gfa=--rE`ALwfV-JSUOv07Iw9+z6t3IKJj*WmFcILQzyi^p zKW(7Wjwq?j(|^)n&?PEHo!8&J)KA)EL%&uU+odSe;By=Gh&v~i(3vgCo`5y5n<^aJ zA6_)(7=se2fz*fZ0HUC>@4^w`dy$FV#Zq)*4%?^%HgqEOU(HK+#FcN%W8iKqNWgR` zk5oT6C)lb_`(sVput$j79!Qz2y=1U)m#)l~^isLxY zhw1-f$nNj&A097UuIbYAy%yHW0_x`2JdLaL@$xY*D^!r=5qHPt7v%$~(h5N&Rd}z7 z2?VXAk65Z+a=z7bElSKd4^jE%SYwt6?Df9E3yD)g|6$GLAA`Sj-+}VqNfBn}eBQ$a zQ)}NVC;wCrc5RQdK8dz?R^((yzqoGFZzW^NNOu8Mw1B_+`6hr( zScUBc0xvvRvsRF|BWchrCD-2lB=yR;OPS)r8qK5Ji!ZeDlc@Z{Km>9106oie$X7n| zbzvWmqa}ZAX&c6f4SQ*jd*%(1<%VE3YhA-tWqKmtt2%8Aeg61T0}EGk#YeoL_D@AwuVyqZb(V-onydM=ZSpWUFjQROV)d5&aM4-hiMW!*C{f`8V<7SB8Um> z?@y*+kp0DvLPP;A|8v)q z{tsA0(h#8sq>Y*zMaUT@RU~KtQaROsP*7$`NP1&1a|WF(i%iHQ$$x~)_asB?3JLhk zm#kazBeCN#WR077BMNipKeUtrx}@4?rt0jByfb*Wl5F?n+bOhLV)(FzTc##1MXLG7 z_3`4YD(MWRl+#*|r7m>inBY$z_L7@Ua@zaNBzl|EV?Qx0;k$O+0OQnf=7+yvpr@>!w_9UQ~*KG~q2ZM7@(ZIctc$YAJbC)0wJ& zXf@29C-wXFA<3nq@sA=>u5cRr;xJL>ZY zet{Mh$6%<$^ggLH$oHxW6#5G6J{^=&yrKAX-wuEh$bAJr@K8pU?;wRJYOMoNUWpIpC|mvCuG3w&1nsKL%Md1P#X#Zw4BU zS%N~yYTq)*jXj%)9dYP?DD*Ji#<0M&oNCQvbv&L(^YBj%cK=+D22Zw=3~=c0 zMRhE?ao_Q;JDydkR?%W}h5TZ0h7VbX5peyy5JEj&B$^eqAuckNP>q4dIq!e);B~ul zyihK~FlrJ2ta(WGIps-@Z#X8%P>kB%wQe8&_WcmpiiK+n}Uyljmu^v9mBT|)=g6gQru2-Ozfp+IWS-iaFox;pZV1K> zPRnL-y%56hPy0tE{{0^Lce;jw(Y6z?RH1`OAJP>lB0fcONpP}z^K!?Ohp21)`s4Of z_Ii);$Z3jEo>{El-OMbN5&bo-R=Y>xrp3_%F9xVGiZu`S*8#Q)t+QtRs%j5S!fUiH z3hFBf))jDd5e*y^VJbzUJy73^k4ButwPcQSUzhyW|9tWKfbNW`6vGbicsl#J^@Bhz z!G$b;B8t(>`8_1XYFvQ5Kzd#wuS$bzA1+(TB#P2C1rH3j5et>XfFli5H=-|6#TY~n>ZDwq?CCWj zgv?e_QQoj!iyis9iJ5v%+gxa7<|c63Pct3i9+o&`zF6@FK)aJotR+s)J$EWW)f$dZPd%HL3c|_4xWDO#dsRe(YJ+7wJ2Egu>z?Hq;!Ec zyNmHMj9tlcZ+gZt$o33u$GuE?Fu2^!|K4h&y*W z5Wf3E?cwLekB=VQl1f%W3$LG&^Eabvbtc8-Cq?D+bE+x#)Ox2(y>^S@;&B=EZILzh zH|yIBR$mQ+o$bZylnf$V|JylR5TdmIWp<^s$oJgm1{5$d{H{~luGeA3LGxP!vb1w} z^_8F!H=EK~`_Ko-|0;|mM>qS$jhT-R+-@rt^9M`4tn1@Oou39Hq%#N0Qf|XA*=LC< z+mR?2KN|J&=}Ic8#S+C>@!tQNWRzFK6~bc~0uHCB`!vP*p|*+8FS10Zva_M9yr=8i zDbF|9&!w6zTfXK!ozpGEYgxrNt8X8G`&I7rQrtM!SL_2-Rb%-PSa-DFaOj6FVPTC; zB53XNh`oxca|Jjr$IcF9Y$M%DJ~Gv5+2gABdhH60XRWCKE-qvOKggA6pIQE^kTX zzEzeT5AaEcKQ7BTD#>;_ag>)peSnPL(U@dZAKLX(73Do7srrt;%=B*PZnn^X_RN*L zJ$4ud{#) zbXovmVc_tssGt|B3@)upH}}8R8{LwU7{SPZ-3pGmTH(+d&77>w*14`z%8i_|ai~cW zRIb1@u-y5@9avMH?k8h*XQkGajAxv6L%d-Hp1&SqPLICvj`M-sJf^iO<4%8}J>SVz zW99p^UV0_PzLslkyh`D1K@ZLto-mxaw9@}5_7P3NAV(E?+ejE`*?D5i+10Me<>o|@ z*pb7toEY)7;Y1Q>`U|=B$*`0fCO#L5$R+i0ZOJmyS$4n@#!z; z6;1d&7JZmj>Opz->MWH9DgxVBhKMwuNw}YHx^Mp0i3OrQyReTeyKwGtj@ZLldb2Vx z;0EdSRf>`tKK=E)f4>_)qs=CyPH1Uuk1AC-R+gEP6QvNXWl_~wCODI6)I=3D$AgM9!T?%95a{BIFVW0LptYo#aP+^x& zhF&USx9c4$u?xcrA-&23buGFz@6>s<|2OF$rE9HxCng?X7ZlNQQ_?v|ty2hiA z?MBn@&UG<4F)kO=Tw1;y816R!*} z_D`=_6Z86XcDOi)13gHeuC^0Y-R5?2s4f)X>k3nk4`D-z_XzV7geTtj-maE-VT-|| zU@0EF`A{o1_LEHKlc~jg1eg~V=fo7mNj!mn*TZDlt`!Q!eq@3pT^PHpg0Olf0$*c? ziwpRsr{unX;YTkp^98!Ptu2g2ewz{wzoGlA`Sr1XUkhtm`SB%d<+?&fLso09@=FDme;H!#C>}bQPm#YHTc0 z-~~_YF&y@>hPjv8n%%vZwAc5~{S*1U``#$(Ou*SBj%-Ua86SwETpUa3M^|z&f#N$O zH>)8G;m{dw$~xeye*l!9zYol>rjE`}tAL23;z?q4hDp-wsY@+MCAk)RehwpUbvxT# z&uiNo0F#NefD6SIhl6~(hXkXL{!ZO3*b(FjJD|*;LeH}fPo-!V0x6=RCbS)P_0Ktf z)24l{B~;j_ktvdijM!=}Sy7yW7wq=T@ke)rq-IQtqma2oR~`RT{~i(q`(I;yFgg0P zqDHjkm+KjP`tpq!6A^@=Z)0j-Cx37TrUB7^ zD}x%Gbhc5)dYPrn?MBriIUO|W z{IzA1b0J8;@+@F>rmLPN_e!OS_Dlg$eZm!Wn%%;m25#iy-zkT@4c2vb_>=7q&=t;^ zfE$G1KsX%>piTYM)cdWvFCL?r9*(8IX$ErK0**Gk9c$}CjzVp1_m=je zO8Mos%dIYZp7XvdeezX8xO`Gzrm{Urpg8urtVxenzL2&IuAZEhiy(Z7IMyNqtnmNZ zxs%ecnLE|>`r~52uj=Xrk=auype^ZkKb#+KXIBFw;C8!*>FvS)Z@u!_&5RH3O6I*; zztFHo|F^+PAfU-nI;HvXTDAP1RN;-lQ_VLS`zRmFsytLGl)GU??*R`c zX1*fM7B3!+(8JCShN(i{EeQcrI74)G+GeGm%(xyGBERaGU;MG(%H$Rr`6z=u* ztbbFtJJ;1F9u#md8UzmuoXF-$=I~CEv<0qa<=hh}yT*{`!CQ_crR_6Ad8V%OE;|66 zuY4x|D4VGDY>yiL>^=OT zSm*!0=Qm|TFCM!o8o7X>FJY(50mUs7N> z@zV0xx{3a4GL1Xax&jKf8&5jcz_e5{=@lD~@%h)GY&@A>Qg3)3&sgU&xzy<8USu2SM{cz zh+C&?C+#@Eyp-)>Ek}pR@2{K=6P3YDi#H8S!U7)I5(&VCoGWz`n@T-moTb+!K6uF7 zp;8LWsxd1Y_D3XrFIf@q=H7bLd(yLxm6j6flUhFxiMcDokfBd|B24_Ot?DzPeqg6ta&Q)KiDxJcX?lb#yUT( zG&8lm!+BSTvf`px-L_MUjsZ{3<6dJP*fC?nhO3*OTy|iT;P||j%gn~XqT%T7j!6Q6 zW~}{BHXKa@-q-W*n5|qqi-?71!~Oq1^?RP43|ePD<^TVGhHF!woC}Od0W$0V@4pjq zere<1s|zl8*fIUJ(K_s?w)@{(#V{$>St;88@1}nhWav6@%E!^y)mYEaz#x<;07`LR zS{T>xAA1bkyWw{5$KS*^t{fW4(py^^6jj)tm~HsLLX<%xP0|0~0WQBA7+3JSJp-nX dI@TL&&g=mu6UKisz%rYG!TvCCN$^k#69A+?Arb%p literal 0 HcmV?d00001 diff --git a/pkgs/ffigen/test/example_tests/objective_c_example_test.dart b/pkgs/ffigen/test/example_tests/objective_c_example_test.dart new file mode 100644 index 0000000000..b53f341862 --- /dev/null +++ b/pkgs/ffigen/test/example_tests/objective_c_example_test.dart @@ -0,0 +1,48 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +import 'dart:io'; + +import 'package:ffigen/src/config_provider/config.dart'; +import 'package:ffigen/src/header_parser.dart'; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart'; + +import '../test_utils.dart'; + +void main() { + group('objective_c_example_test', () { + setUpAll(() { + logWarnings(Level.SEVERE); + }); + + test('objective_c', () { + final pubspecFile = File('example/objective_c/pubspec.yaml'); + final pubspecYaml = loadYaml(pubspecFile.readAsStringSync()) as YamlMap; + final config = Config.fromYaml(pubspecYaml['ffigen'] as YamlMap); + final output = parse(config).generate(); + + // Verify that the output contains all the methods and classes that the + // example app uses. + expect(output, contains('class AVFAudio{')); + expect(output, contains('class NSString extends NSObject {')); + expect(output, contains('class NSURL extends NSObject {')); + expect( + output, + contains( + 'static NSURL fileURLWithPath_(AVFAudio _lib, NSString? path) {')); + expect(output, contains('class AVAudioPlayer extends NSObject {')); + expect( + output, + contains('AVAudioPlayer initWithContentsOfURL_error_(' + 'NSURL? url, ffi.Pointer> outError) {')); + expect(output, contains('double get duration {')); + expect(output, contains('bool play() {')); + }); + }); +} From 5507e994764253b27ee5086933f5fe94e6d68941 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Thu, 21 Jul 2022 08:13:16 -0700 Subject: [PATCH 168/276] [ffigen] Update clang to fix CI failure (#425) * Use a special matcher for diffing large strings. * fmt * fmt * Fix CI * Use more recent version of linux So that we can use a more recent clang * Try ubuntu-22.04 --- .../ffigen/.github/workflows/test-package.yml | 7 ++-- pkgs/ffigen/pubspec.yaml | 1 + .../_expected_libclang_bindings.dart | 4 +- pkgs/ffigen/test/test_utils.dart | 40 ++++++++++++++++++- 4 files changed, 45 insertions(+), 7 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 672f339040..6d6c47061f 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -39,8 +39,7 @@ jobs: test-linux: needs: analyze - # This job requires clang-10 which is the default on 20.04 - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1.0 @@ -48,8 +47,8 @@ jobs: sdk: stable - name: Install dependencies run: dart pub get - - name: Install libclang-10-dev - run: sudo apt-get install libclang-10-dev + - name: Install libclang-14-dev + run: sudo apt-get install libclang-14-dev - name: Build test dylib and bindings run: dart test/setup.dart - name: Run VM tests diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 400fdd3db2..dff502390b 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -23,4 +23,5 @@ dependencies: dev_dependencies: lints: ^1.0.1 + list_diff: ^2.0.1 test: ^1.16.2 diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index 53e3a65ef2..d060bd427b 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -3962,8 +3962,8 @@ class LibClang { /// 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". + /// "\@optional". Returns zero if the cursor is not such a declaration or it + /// is "\@required". int clang_Cursor_isObjCOptional( CXCursor C, ) { diff --git a/pkgs/ffigen/test/test_utils.dart b/pkgs/ffigen/test/test_utils.dart index 314f8aad1e..fef4c4cf11 100644 --- a/pkgs/ffigen/test/test_utils.dart +++ b/pkgs/ffigen/test/test_utils.dart @@ -5,6 +5,7 @@ import 'dart:io'; import 'package:ffigen/src/code_generator.dart'; +import 'package:list_diff/list_diff.dart' as list_diff; import 'package:logging/logging.dart'; import 'package:path/path.dart' as path; import 'package:test/test.dart'; @@ -40,6 +41,43 @@ void verifySetupFile(File file) { } } +// String matcher for large strings, which prints the diffs between the expected +// and actual values, rather than just printing the entire strings. +class _LargeStringMatcher extends Matcher { + final String expected; + + _LargeStringMatcher(this.expected); + + @override + bool matches(dynamic item, Map matchState) { + return expected == item; + } + + @override + Description describe(Description description) { + return description.add('Has no diffs'); + } + + @override + Description describeMismatch(Object? item, Description mismatchDescription, + Map matchState, bool verbose) { + if (item is! String) { + return mismatchDescription.add('is ').addDescriptionOf(item); + } + return mismatchDescription.add('has diff:\n').add(_diff(item)); + } + + String _diff(String actual) { + final out = StringBuffer(); + for (final op + in list_diff.diffSync(expected.split('\n'), actual.split('\n'))) { + out.write(op.isInsertion ? 'ACT ' : 'EXP '); + out.write('${op.index}\t${op.item}\n'); + } + return out.toString(); + } +} + /// Generates actual file using library and tests using [expect] with expected /// /// This will not delete the actual debug file incase [expect] throws an error. @@ -55,7 +93,7 @@ void matchLibraryWithExpected( final expected = File(path.joinAll(pathToExpected)) .readAsStringSync() .replaceAll('\r', ''); - expect(actual, expected); + expect(actual, _LargeStringMatcher(expected)); if (file.existsSync()) { file.delete(); } From e0dc7c5db9d9e10ad9a19629006da7b55aa21fc6 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Thu, 21 Jul 2022 13:59:52 -0700 Subject: [PATCH 169/276] [ffigen] Throw an error if ObjC class fails to load (#423) --- .../objc_built_in_functions.dart | 17 +++++---- .../failed_to_load_config.yaml | 12 +++++++ .../native_objc_test/failed_to_load_test.dart | 36 +++++++++++++++++++ .../native_objc_test/failed_to_load_test.m | 15 ++++++++ pkgs/ffigen/test/native_objc_test/setup.dart | 28 +++++++-------- 5 files changed, 87 insertions(+), 21 deletions(-) create mode 100644 pkgs/ffigen/test/native_objc_test/failed_to_load_config.yaml create mode 100644 pkgs/ffigen/test/native_objc_test/failed_to_load_test.dart create mode 100644 pkgs/ffigen/test/native_objc_test/failed_to_load_test.m diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index a92dbcbc95..c7208a9ae7 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -40,12 +40,17 @@ class ObjCBuiltInFunctions { ObjCInternalFunction('_getClass', _getClassFunc, (Writer w, String name) { final s = StringBuffer(); final objType = _getClassFunc.functionType.returnType.getCType(w); - s.write('\n$objType $name(String name) {\n'); - s.write(' final cstr = name.toNativeUtf8();\n'); - s.write(' final clazz = ${_getClassFunc.name}(cstr.cast());\n'); - s.write(' ${w.ffiPkgLibraryPrefix}.calloc.free(cstr);\n'); - s.write(' return clazz;\n'); - s.write('}\n'); + s.write(''' +$objType $name(String name) { + final cstr = name.toNativeUtf8(); + final clazz = ${_getClassFunc.name}(cstr.cast()); + ${w.ffiPkgLibraryPrefix}.calloc.free(cstr); + if (clazz == ${w.ffiLibraryPrefix}.nullptr) { + throw Exception('Failed to load Objective-C class: \$name'); + } + return clazz; +} +'''); return s.toString(); }); diff --git a/pkgs/ffigen/test/native_objc_test/failed_to_load_config.yaml b/pkgs/ffigen/test/native_objc_test/failed_to_load_config.yaml new file mode 100644 index 0000000000..2d114a1c84 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/failed_to_load_config.yaml @@ -0,0 +1,12 @@ +name: FailedToLoadTestObjCLibrary +description: 'Tests failing to load an Objective-C library' +language: objc +output: 'test/native_objc_test/failed_to_load_bindings.dart' +functions: + exclude: + - '.*' +headers: + entry-points: + - 'test/native_objc_test/failed_to_load_test.m' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/failed_to_load_test.dart b/pkgs/ffigen/test/native_objc_test/failed_to_load_test.dart new file mode 100644 index 0000000000..8d1bb70917 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/failed_to_load_test.dart @@ -0,0 +1,36 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:test/test.dart'; +import '../test_utils.dart'; +import 'failed_to_load_bindings.dart'; +import 'util.dart'; + +void main() { + group('Failed to load', () { + setUpAll(() { + logWarnings(); + generateBindingsForCoverage('failed_to_load'); + }); + + test('Failed to load Objective-C class', () { + // Load from the host executable, which is missing all the classes for + // this test, but has the core ObjC functions, such as objc_getClass. The + // library should load ok, because the classes are lazy loaded. + final lib = FailedToLoadTestObjCLibrary(DynamicLibrary.executable()); + + // But when we try to instantiate one of the classes, we get an error. + expect( + () => ClassThatWillFailToLoad.new1(lib), + throwsA(predicate( + (e) => e.toString().contains('ClassThatWillFailToLoad')))); + }); + }); +} diff --git a/pkgs/ffigen/test/native_objc_test/failed_to_load_test.m b/pkgs/ffigen/test/native_objc_test/failed_to_load_test.m new file mode 100644 index 0000000000..b4d5e68787 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/failed_to_load_test.m @@ -0,0 +1,15 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#import + +@interface ClassThatWillFailToLoad : NSObject {} +-(int32_t)get123; +@end + +@implementation ClassThatWillFailToLoad +-(int32_t)get123 { + return 123; +} +@end diff --git a/pkgs/ffigen/test/native_objc_test/setup.dart b/pkgs/ffigen/test/native_objc_test/setup.dart index 78c7427362..9194c45afe 100644 --- a/pkgs/ffigen/test/native_objc_test/setup.dart +++ b/pkgs/ffigen/test/native_objc_test/setup.dart @@ -45,21 +45,19 @@ Future _generateBindings(String config) async { print('Generated bindings for: $config'); } -const testNames = [ - 'automated_ref_count', - 'bad_method', - 'block', - 'cast', - 'category', - 'forward_decl', - 'is_instance', - 'method', - 'native_objc', - 'nullable', - 'property', - 'rename', - 'string', -]; +List _getTestNames() { + const configSuffix = '_config.yaml'; + final names = []; + for (final entity in Directory.current.listSync()) { + final filename = entity.uri.pathSegments.last; + if (filename.endsWith(configSuffix)) { + names.add(filename.substring(0, filename.length - configSuffix.length)); + } + } + return names; +} + +final testNames = _getTestNames(); Future build() async { print('Building Dynamic Library for Objective C Native Tests...'); From 7592ecb7349663f3ae84ad365a8373695c6d09e8 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Thu, 28 Jul 2022 11:00:43 -0700 Subject: [PATCH 170/276] [ffigen] Memory management for Blocks (#429) * Parse args in objc test setup.dart to allow building specific tests * Load block copy/release functions * Copy created block, and delete original * Add finalizer to block * Basic test * Another test * Small refactor * Fix tests --- .../lib/src/code_generator/objc_block.dart | 40 ++-- .../objc_built_in_functions.dart | 197 ++++++++++++------ .../src/code_generator/objc_interface.dart | 7 +- .../test/native_objc_test/block_test.dart | 39 ++++ .../ffigen/test/native_objc_test/block_test.m | 28 +++ pkgs/ffigen/test/native_objc_test/setup.dart | 10 +- 6 files changed, 225 insertions(+), 96 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/objc_block.dart b/pkgs/ffigen/lib/src/code_generator/objc_block.dart index 711e469375..73f5a311dc 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_block.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_block.dart @@ -28,6 +28,8 @@ class ObjCBlock extends BindingType { BindingString toBindingString(Writer w) { final s = StringBuffer(); + builtInFunctions.ensureBlockUtilsExist(w, s); + final params = []; for (int i = 0; i < argTypes.length; ++i) { params.add(Parameter(name: 'arg$i', type: argTypes[i])); @@ -97,25 +99,26 @@ $voidPtr $registerClosure(Function fn) { s.write('}\n'); // Write the wrapper class. - s.write('class $name {\n'); - s.write(' final ${blockPtr.getCType(w)} _impl;\n'); - s.write(' final ${w.className} _lib;\n'); - s.write(' $name._(this._impl, this._lib);\n'); - - // Constructor from a function pointer. final defaultValue = returnType.getDefaultValue(w, '_lib'); final exceptionalReturn = defaultValue == null ? '' : ', $defaultValue'; s.write(''' - $name.fromFunctionPointer(this._lib, $natFnPtr ptr) - : _impl = _lib.${builtInFunctions.newBlock.name}( +class $name extends _ObjCBlockBase { + $name._(${blockPtr.getCType(w)} id, ${w.className} lib) : + super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + $name.fromFunctionPointer(${w.className} lib, $natFnPtr ptr) : + this._(lib.${builtInFunctions.newBlock.name}( ${w.ffiLibraryPrefix}.Pointer.fromFunction< ${trampFuncType.getCType(w)}>($funcPtrTrampoline - $exceptionalReturn).cast(), ptr.cast()); - $name.fromFunction(this._lib, ${funcType.getDartType(w)} fn) - : _impl = _lib.${builtInFunctions.newBlock.name}( + $exceptionalReturn).cast(), ptr.cast()), lib); + + /// Creates a block from a Dart function. + $name.fromFunction(${w.className} lib, ${funcType.getDartType(w)} fn) : + this._(lib.${builtInFunctions.newBlock.name}( ${w.ffiLibraryPrefix}.Pointer.fromFunction< ${trampFuncType.getCType(w)}>($closureTrampoline - $exceptionalReturn).cast(), $registerClosure(fn)); + $exceptionalReturn).cast(), $registerClosure(fn)), lib); '''); // Call method. @@ -125,9 +128,9 @@ $voidPtr $registerClosure(Function fn) { s.write(' ${params[i].name}'); } s.write(''') { - ${isVoid ? '' : 'return '}_impl.ref.invoke.cast< + ${isVoid ? '' : 'return '}_id.ref.invoke.cast< ${natTrampFnType.getCType(w)}>().asFunction< - ${trampFuncType.getDartType(w)}>()(_impl'''); + ${trampFuncType.getDartType(w)}>()(_id'''); for (int i = 0; i < params.length; ++i) { s.write(', ${params[i].name}'); } @@ -135,7 +138,7 @@ $voidPtr $registerClosure(Function fn) { }'''); // Get the pointer to the underlying block. - s.write(' ${blockPtr.getCType(w)} get pointer => _impl;\n'); + s.write(' ${blockPtr.getCType(w)} get pointer => _id;\n'); s.write('}\n'); return BindingString( @@ -151,12 +154,7 @@ $voidPtr $registerClosure(Function fn) { for (final t in argTypes) { t.addDependencies(dependencies); } - - builtInFunctions.newBlockDesc.addDependencies(dependencies); - builtInFunctions.blockDescSingleton.addDependencies(dependencies); - builtInFunctions.blockStruct.addDependencies(dependencies); - builtInFunctions.concreteGlobalBlock.addDependencies(dependencies); - builtInFunctions.newBlock.addDependencies(dependencies); + builtInFunctions.addBlockDependencies(dependencies); } @override diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index c7208a9ae7..ff96125122 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -18,15 +18,15 @@ class ObjCBuiltInFunctions { ); late final registerName = ObjCInternalFunction( '_registerName', _registerNameFunc, (Writer w, String name) { - final s = StringBuffer(); final selType = _registerNameFunc.functionType.returnType.getCType(w); - s.write('\n$selType $name(String name) {\n'); - s.write(' final cstr = name.toNativeUtf8();\n'); - s.write(' final sel = ${_registerNameFunc.name}(cstr.cast());\n'); - s.write(' ${w.ffiPkgLibraryPrefix}.calloc.free(cstr);\n'); - s.write(' return sel;\n'); - s.write('}\n'); - return s.toString(); + return ''' +$selType $name(String name) { + final cstr = name.toNativeUtf8(); + final sel = ${_registerNameFunc.name}(cstr.cast()); + ${w.ffiPkgLibraryPrefix}.calloc.free(cstr); + return sel; +} +'''; }); late final _getClassFunc = Func( @@ -38,9 +38,8 @@ class ObjCBuiltInFunctions { ); late final getClass = ObjCInternalFunction('_getClass', _getClassFunc, (Writer w, String name) { - final s = StringBuffer(); final objType = _getClassFunc.functionType.returnType.getCType(w); - s.write(''' + return ''' $objType $name(String name) { final cstr = name.toNativeUtf8(); final clazz = ${_getClassFunc.name}(cstr.cast()); @@ -50,8 +49,7 @@ $objType $name(String name) { } return clazz; } -'''); - return s.toString(); +'''; }); late final _retainFunc = Func( @@ -75,6 +73,27 @@ $objType $name(String name) { _releaseFunc, ); + late final _blockCopyFunc = Func( + name: '_Block_copy', + originalName: '_Block_copy', + returnType: PointerType(voidType), + parameters: [Parameter(name: 'value', type: PointerType(voidType))], + isInternal: true, + ); + late final _blockReleaseFunc = Func( + name: '_Block_release', + originalName: '_Block_release', + returnType: voidType, + parameters: [Parameter(name: 'value', type: PointerType(voidType))], + isInternal: true, + ); + late final _blockReleaseFinalizer = ObjCInternalGlobal( + '_objc_releaseFinalizer', + (Writer w) => '${w.ffiLibraryPrefix}.NativeFinalizer(' + '${_blockReleaseFunc.funcPointerName}.cast())', + _blockReleaseFunc, + ); + // We need to load a separate instance of objc_msgSend for each signature. final _msgSendFuncs = {}; Func getMsgSendFunc(Type returnType, List params) { @@ -130,17 +149,17 @@ $objType $name(String name) { ); late final newBlockDesc = ObjCInternalFunction('_newBlockDesc', null, (Writer w, String name) { - final s = StringBuffer(); final blockType = blockStruct.getCType(w); final descType = blockDescStruct.getCType(w); final descPtr = PointerType(blockDescStruct).getCType(w); - s.write('\n$descPtr $name() {\n'); - s.write(' final d = ${w.ffiPkgLibraryPrefix}.calloc.allocate<$descType>(' - '${w.ffiLibraryPrefix}.sizeOf<$descType>());\n'); - s.write(' d.ref.size = ${w.ffiLibraryPrefix}.sizeOf<$blockType>();\n'); - s.write(' return d;\n'); - s.write('}\n'); - return s.toString(); + return ''' +$descPtr $name() { + final d = ${w.ffiPkgLibraryPrefix}.calloc.allocate<$descType>( + ${w.ffiLibraryPrefix}.sizeOf<$descType>()); + d.ref.size = ${w.ffiLibraryPrefix}.sizeOf<$blockType>(); + return d; +} +'''; }); late final blockDescSingleton = ObjCInternalGlobal( '_objc_block_desc', @@ -152,62 +171,67 @@ $objType $name(String name) { (Writer w) => '${w.lookupFuncIdentifier}<${voidType.getCType(w)}>(' "'_NSConcreteGlobalBlock')", ); - late final newBlock = - ObjCInternalFunction('_newBlock', null, (Writer w, String name) { - final s = StringBuffer(); + late final newBlock = ObjCInternalFunction('_newBlock', _blockCopyFunc, + (Writer w, String name) { final blockType = blockStruct.getCType(w); final blockPtr = PointerType(blockStruct).getCType(w); final voidPtr = PointerType(voidType).getCType(w); - s.write('\n$blockPtr $name($voidPtr invoke, $voidPtr target) {\n'); - s.write(' final b = ${w.ffiPkgLibraryPrefix}.calloc.allocate<$blockType>(' - '${w.ffiLibraryPrefix}.sizeOf<$blockType>());\n'); - s.write(' b.ref.isa = ${concreteGlobalBlock.name};\n'); - s.write(' b.ref.invoke = invoke;\n'); - s.write(' b.ref.target = target;\n'); - s.write(' b.ref.descriptor = ${blockDescSingleton.name};\n'); - s.write(' return b;\n'); - s.write('}\n'); - return s.toString(); + return ''' +$blockPtr $name($voidPtr invoke, $voidPtr target) { + final b = ${w.ffiPkgLibraryPrefix}.calloc.allocate<$blockType>( + ${w.ffiLibraryPrefix}.sizeOf<$blockType>()); + b.ref.isa = ${concreteGlobalBlock.name}; + b.ref.invoke = invoke; + b.ref.target = target; + b.ref.descriptor = ${blockDescSingleton.name}; + final copy = ${_blockCopyFunc.name}(b.cast()).cast<$blockType>(); + ${w.ffiPkgLibraryPrefix}.calloc.free(b); + return copy; +} +'''; }); - bool utilsExist = false; - void ensureUtilsExist(Writer w, StringBuffer s) { - if (utilsExist) return; - utilsExist = true; - - final objType = PointerType(objCObjectType).getCType(w); + void _writeFinalizableClass( + Writer w, + StringBuffer s, + String name, + String kind, + String idType, + String retain, + String release, + String finalizer) { s.write(''' -class _ObjCWrapper implements ${w.ffiLibraryPrefix}.Finalizable { - final $objType _id; +class $name implements ${w.ffiLibraryPrefix}.Finalizable { + final $idType _id; final ${w.className} _lib; bool _pendingRelease; - _ObjCWrapper._(this._id, this._lib, + $name._(this._id, this._lib, {bool retain = false, bool release = false}) : _pendingRelease = release { if (retain) { - _lib.${_retainFunc.name}(_id); + _lib.$retain(_id.cast()); } if (release) { - _lib.${_releaseFinalizer.name}.attach(this, _id.cast(), detach: this); + _lib.$finalizer.attach(this, _id.cast(), detach: this); } } - /// Releases the reference to the underlying ObjC object held by this wrapper. + /// Releases the reference to the underlying ObjC $kind held by this wrapper. /// Throws a StateError if this wrapper doesn't currently hold a reference. void release() { if (_pendingRelease) { _pendingRelease = false; - _lib.${_releaseFunc.name}(_id); - _lib.${_releaseFinalizer.name}.detach(this); + _lib.$release(_id.cast()); + _lib.$finalizer.detach(this); } else { throw StateError( - 'Released an ObjC object that was unowned or already released.'); + 'Released an ObjC $kind that was unowned or already released.'); } } @override bool operator ==(Object other) { - return other is _ObjCWrapper && _id == other._id; + return other is $name && _id == other._id; } @override @@ -216,6 +240,36 @@ class _ObjCWrapper implements ${w.ffiLibraryPrefix}.Finalizable { '''); } + bool utilsExist = false; + void ensureUtilsExist(Writer w, StringBuffer s) { + if (utilsExist) return; + utilsExist = true; + _writeFinalizableClass( + w, + s, + '_ObjCWrapper', + 'object', + PointerType(objCObjectType).getCType(w), + _retainFunc.name, + _releaseFunc.name, + _releaseFinalizer.name); + } + + bool blockUtilsExist = false; + void ensureBlockUtilsExist(Writer w, StringBuffer s) { + if (blockUtilsExist) return; + blockUtilsExist = true; + _writeFinalizableClass( + w, + s, + '_ObjCBlockBase', + 'block', + PointerType(blockStruct).getCType(w), + _blockCopyFunc.name, + _blockReleaseFunc.name, + _blockReleaseFinalizer.name); + } + void addDependencies(Set dependencies) { registerName.addDependencies(dependencies); getClass.addDependencies(dependencies); @@ -230,33 +284,46 @@ class _ObjCWrapper implements ${w.ffiLibraryPrefix}.Finalizable { } } + void addBlockDependencies(Set dependencies) { + newBlockDesc.addDependencies(dependencies); + blockDescSingleton.addDependencies(dependencies); + blockStruct.addDependencies(dependencies); + concreteGlobalBlock.addDependencies(dependencies); + newBlock.addDependencies(dependencies); + _blockCopyFunc.addDependencies(dependencies); + _blockReleaseFunc.addDependencies(dependencies); + _blockReleaseFinalizer.addDependencies(dependencies); + } + final _interfaceRegistry = {}; void registerInterface(ObjCInterface interface) { _interfaceRegistry[interface.originalName] = interface; } void generateNSStringUtils(Writer w, StringBuffer s) { - // Generate a constructor that wraps stringWithCString. - s.write(' factory NSString(${w.className} _lib, String str) {\n'); - s.write(' final cstr = str.toNativeUtf8();\n'); - s.write(' final nsstr = stringWithCString_encoding_(' - '_lib, cstr.cast(), 4 /* UTF8 */);\n'); - s.write(' ${w.ffiPkgLibraryPrefix}.calloc.free(cstr);\n'); - s.write(' return nsstr;\n'); - s.write(' }\n\n'); + // Generate a constructor that wraps stringWithCString, and a toString + // method that wraps UTF8String. + s.write(''' + factory NSString(${w.className} _lib, String str) { + final cstr = str.toNativeUtf8(); + final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); + ${w.ffiPkgLibraryPrefix}.calloc.free(cstr); + return nsstr; + } - // Generate a toString method that wraps UTF8String. - s.write(' @override\n'); - s.write(' String toString() => (UTF8String).cast<' - '${w.ffiPkgLibraryPrefix}.Utf8>().toDartString();\n\n'); + @override + String toString() => + (UTF8String).cast<${w.ffiPkgLibraryPrefix}.Utf8>().toDartString(); +'''); } void generateStringUtils(Writer w, StringBuffer s) { // Generate an extension on String to convert to NSString - s.write('extension StringToNSString on String {\n'); - s.write(' NSString toNSString(${w.className} lib) => ' - 'NSString(lib, this);\n'); - s.write('}\n\n'); + s.write(''' +extension StringToNSString on String { + NSString toNSString(${w.className} lib) => NSString(lib, this); +} +'''); } } diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index b33e97b75d..61e88ef569 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -103,7 +103,7 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { } /// Returns a [$name] that wraps the given raw object pointer. - static $name castFromPointer($natLib lib, ffi.Pointer other, + static $name castFromPointer($natLib lib, $objType other, {bool retain = false, bool release = false}) { return $name._(other, lib, retain: retain, release: release); } @@ -350,11 +350,10 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { _isObject(arg.type) || _isInstanceType(arg.type) || arg.type is ObjCBlock) { - final field = arg.type is ObjCBlock ? '_impl' : '_id'; if (arg.isNullable) { - return '${arg.name}?.$field ?? ffi.nullptr'; + return '${arg.name}?._id ?? ffi.nullptr'; } else { - return '${arg.name}.$field'; + return '${arg.name}._id'; } } return arg.name; diff --git a/pkgs/ffigen/test/native_objc_test/block_test.dart b/pkgs/ffigen/test/native_objc_test/block_test.dart index 87f882da4c..99d1460365 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.dart +++ b/pkgs/ffigen/test/native_objc_test/block_test.dart @@ -9,12 +9,14 @@ import 'dart:ffi'; import 'dart:io'; import 'package:test/test.dart'; +import 'package:ffi/ffi.dart'; import '../test_utils.dart'; import 'block_bindings.dart'; import 'util.dart'; void main() { late BlockTestObjCLibrary lib; + late void Function(Pointer, Pointer) executeInternalCommand; group('Blocks', () { setUpAll(() { @@ -22,9 +24,21 @@ void main() { final dylib = File('test/native_objc_test/block_test.dylib'); verifySetupFile(dylib); lib = BlockTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); + + executeInternalCommand = DynamicLibrary.process().lookupFunction< + Void Function(Pointer, Pointer), + void Function( + Pointer, Pointer)>('Dart_ExecuteInternalCommand'); + generateBindingsForCoverage('block'); }); + doGC() { + final gcNow = "gc-now".toNativeUtf8(); + executeInternalCommand(gcNow.cast(), nullptr); + calloc.free(gcNow); + } + test('BlockTester is working', () { // This doesn't test any Block functionality, just that the BlockTester // itself is working correctly. @@ -56,6 +70,31 @@ void main() { expect(blockTester.call_(123), 4123); expect(block(123), 4123); }); + + Pointer funcPointerBlockRefCountTest() { + final block = ObjCBlock.fromFunctionPointer( + lib, Pointer.fromFunction(_add100, 999)); + expect(BlockTester.getBlockRetainCount_(lib, block.pointer), 1); + return block.pointer.cast(); + } + + test('Function pointer block ref counting', () { + final rawBlock = funcPointerBlockRefCountTest(); + doGC(); + expect(BlockTester.getBlockRetainCount_(lib, rawBlock.cast()), 0); + }); + + Pointer funcBlockRefCountTest() { + final block = ObjCBlock.fromFunction(lib, makeAdder(4000)); + expect(BlockTester.getBlockRetainCount_(lib, block.pointer), 1); + return block.pointer.cast(); + } + + test('Function pointer block ref counting', () { + final rawBlock = funcBlockRefCountTest(); + doGC(); + expect(BlockTester.getBlockRetainCount_(lib, rawBlock.cast()), 0); + }); }); } diff --git a/pkgs/ffigen/test/native_objc_test/block_test.m b/pkgs/ffigen/test/native_objc_test/block_test.m index 7d170801fc..c0052e3d90 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.m +++ b/pkgs/ffigen/test/native_objc_test/block_test.m @@ -13,6 +13,7 @@ @interface BlockTester : NSObject { } + (BlockTester*)makeFromBlock:(IntBlock)block; + (BlockTester*)makeFromMultiplier:(int32_t)mult; ++ (uint64_t)getBlockRetainCount:(IntBlock)block; - (int32_t)call:(int32_t)x; - (IntBlock)getBlock; - (void)pokeBlock; @@ -33,6 +34,33 @@ + (BlockTester*)makeFromMultiplier:(int32_t)mult { return bt; } +typedef struct { + void* isa; + int flags; + // There are other fields, but we just need the flags and isa. +} BlockRefCountExtractor; + +void* valid_block_isa = NULL; ++ (uint64_t)getBlockRetainCount:(IntBlock)block { + BlockRefCountExtractor* b = (BlockRefCountExtractor*)block; + // HACK: The only way I can find to reliably figure out that a block has been + // deleted is to check the isa field (the lower bits of the flags field seem + // to be randomized, not just set to 0). But we also don't know the value this + // field has when it's constructed (copying the block changes it from + // _NSConcreteGlobalBlock to an internal value). So we assume that the first + // time this function is called, we have a valid block, and on subsequent + // calls we check to see if the isa field changed. + if (valid_block_isa == NULL) { + valid_block_isa = b->isa; + } + if (b->isa != valid_block_isa) { + return 0; + } + // The ref count is stored in the lower bits of the flags field, but skips the + // 0x1 bit. + return (b->flags & 0xFFFF) >> 1; +} + - (int32_t)call:(int32_t)x { return myBlock(x); } diff --git a/pkgs/ffigen/test/native_objc_test/setup.dart b/pkgs/ffigen/test/native_objc_test/setup.dart index 9194c45afe..2e6701b55b 100644 --- a/pkgs/ffigen/test/native_objc_test/setup.dart +++ b/pkgs/ffigen/test/native_objc_test/setup.dart @@ -57,9 +57,7 @@ List _getTestNames() { return names; } -final testNames = _getTestNames(); - -Future build() async { +Future build(List testNames) async { print('Building Dynamic Library for Objective C Native Tests...'); for (final name in testNames) { await _buildLib('${name}_test.m', '${name}_test.dylib'); @@ -71,7 +69,7 @@ Future build() async { } } -Future clean() async { +Future clean(List testNames) async { print('Deleting generated and built files...'); final filenames = [ for (final name in testNames) ...[ @@ -93,8 +91,8 @@ Future main(List arguments) async { } if (arguments.isNotEmpty && arguments[0] == 'clean') { - return await clean(); + return await clean(_getTestNames()); } - return await build(); + return await build(arguments.isNotEmpty ? arguments : _getTestNames()); } From 43a485c9f9aca18738c7ce9e3c9fb8647363bc89 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Mon, 1 Aug 2022 11:25:20 -0700 Subject: [PATCH 171/276] [ffigen] Add exclude-all-by-default config flag (#431) * Config option to exclude everything by default * Bump minor version, update readme and changelog * Format * Add a dedicated exclude_all_by_default test --- pkgs/ffigen/CHANGELOG.md | 5 + pkgs/ffigen/README.md | 15 + pkgs/ffigen/example/objective_c/README.md | 80 +- .../objective_c/avf_audio_bindings.dart | 2925 ++++++++++------- pkgs/ffigen/example/objective_c/pubspec.yaml | 22 +- .../lib/src/config_provider/config.dart | 16 +- .../lib/src/config_provider/config_types.dart | 8 +- .../lib/src/header_parser/includer.dart | 9 +- .../sub_parsers/typedefdecl_parser.dart | 3 +- .../type_extractor/extractor.dart | 4 +- pkgs/ffigen/lib/src/strings.dart | 2 + pkgs/ffigen/pubspec.yaml | 2 +- .../config_tests/exclude_all_by_default.h | 25 + .../exclude_all_by_default_test.dart | 57 + .../automated_ref_count_config.yaml | 5 + .../native_objc_test/bad_method_config.yaml | 4 +- .../test/native_objc_test/block_config.yaml | 7 +- .../test/native_objc_test/cast_config.yaml | 7 +- .../native_objc_test/category_config.yaml | 7 +- .../failed_to_load_config.yaml | 7 +- .../native_objc_test/forward_decl_config.yaml | 7 +- .../native_objc_test/is_instance_config.yaml | 8 +- .../test/native_objc_test/method_config.yaml | 7 +- .../native_objc_test/native_objc_config.yaml | 7 +- .../native_objc_test/nullable_config.yaml | 7 +- .../native_objc_test/property_config.yaml | 7 +- .../test/native_objc_test/rename_config.yaml | 6 +- .../test/native_objc_test/string_config.yaml | 7 +- 28 files changed, 1882 insertions(+), 1384 deletions(-) create mode 100644 pkgs/ffigen/test/config_tests/exclude_all_by_default.h create mode 100644 pkgs/ffigen/test/config_tests/exclude_all_by_default_test.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 27f1fc68bd..5c91860b67 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,8 @@ +# 6.1.0 + +- Added `exclude-all-by-default` config flag, which changes the default behavior + of declaration filters to exclude everything, rather than include everything. + # 6.0.2 - Bump `package:ffi` to 2.0.1. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 929e12820a..437ba54c41 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -409,6 +409,21 @@ use-supported-typedefs: true ```yaml use-dart-handle: true +``` + + + + exclude-all-by-default + + When a declaration filter (eg `functions:` or `structs:`) is empty or + unset, it defaults to including everything. If this flag is enabled, the + default behavior is to exclude everything instead.
    + Default: false + + + +```yaml +exclude-all-by-default: true ``` diff --git a/pkgs/ffigen/example/objective_c/README.md b/pkgs/ffigen/example/objective_c/README.md index 6add3e91e8..1d62972135 100644 --- a/pkgs/ffigen/example/objective_c/README.md +++ b/pkgs/ffigen/example/objective_c/README.md @@ -1,36 +1,44 @@ -# Objective C example - -This example shows how to use ffigen to generate bindings for an Objective C -library. It uses the AVFAudio framework to play audio files. - -``` -dart play_audio.dart test.mp3 -``` - -## Config notes - -The ffigen config for an Objective C library looks very similar to a C library. -The most important difference is that you must set `language: objc`. If you want -to filter which interfaces are included you can use the `objc-interfaces:` -option. This works similarly to the other filtering options. - -It is recommended that you filter out just about everything you're not -interested in binding (see the ffigen config in [pubspec.yaml](./pubspec.yaml)). -Virtually all Objective C libraries depend on Apple's internal libraries, which -are huge. Filtering can reduce the generated bindings from millions of lines to -tens of thousands. - -In this example, we're only interested in `AVAudioPlayer`, so we've filtered out -everything else. But ffigen will automatically pull in anything referenced by -any of the fields or methods of `AVAudioPlayer`, so we're still able to use -`NSURL` etc to load our audio file. - -## Generating bindings - -At the root of this example (`example/objective_c`), run: - -``` -dart run ffigen -``` - -This will generate [avf_audio_bindings.dart](./avf_audio_bindings.dart). +# Objective C example + +This example shows how to use ffigen to generate bindings for an Objective C +library. It uses the AVFAudio framework to play audio files. + +``` +dart play_audio.dart test.mp3 +``` + +## Config notes + +The ffigen config for an Objective C library looks very similar to a C library. +The most important difference is that you must set `language: objc`. If you want +to filter which interfaces are included you can use the `objc-interfaces:` +option. This works similarly to the other filtering options. + +It is recommended that you filter out just about everything you're not +interested in binding (see the ffigen config in [pubspec.yaml](./pubspec.yaml)). +Virtually all Objective C libraries depend on Apple's internal libraries, which +are huge. Filtering can reduce the generated bindings from millions of lines to +tens of thousands. You can use the `exclude-all-by-default` flag, or exclude +individual sets of declarations like this: + +```yaml +functions: + exclude: + - '.*' +# Same for structs/unions/enums etc. +``` + +In this example, we're only interested in `AVAudioPlayer`, so we've filtered out +everything else. But ffigen will automatically pull in anything referenced by +any of the fields or methods of `AVAudioPlayer`, so we're still able to use +`NSURL` etc to load our audio file. + +## Generating bindings + +At the root of this example (`example/objective_c`), run: + +``` +dart run ffigen +``` + +This will generate [avf_audio_bindings.dart](./avf_audio_bindings.dart). diff --git a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart index 37f1ca2f84..9fbc212868 100644 --- a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart +++ b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart @@ -47,6 +47,9 @@ class AVFAudio { final cstr = name.toNativeUtf8(); final clazz = _objc_getClass(cstr.cast()); pkg_ffi.calloc.free(cstr); + if (clazz == ffi.nullptr) { + throw Exception('Failed to load Objective-C class: $name'); + } return clazz; } @@ -94,7 +97,7 @@ class AVFAudio { late final __objc_release = __objc_releasePtr.asFunction)>(); - late final _objc_releaseFinalizer1 = + late final _objc_releaseFinalizer2 = ffi.NativeFinalizer(__objc_releasePtr.cast()); late final _class_NSObject1 = _getClass1("NSObject"); late final _sel_load1 = _registerName1("load"); @@ -2305,9 +2308,42 @@ class AVFAudio { b.ref.invoke = invoke; b.ref.target = target; b.ref.descriptor = _objc_block_desc1; - return b; + final copy = _Block_copy(b.cast()).cast<_ObjCBlock>(); + pkg_ffi.calloc.free(b); + return copy; + } + + ffi.Pointer _Block_copy( + ffi.Pointer value, + ) { + return __Block_copy( + value, + ); } + late final __Block_copyPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('_Block_copy'); + late final __Block_copy = __Block_copyPtr + .asFunction Function(ffi.Pointer)>(); + + void _Block_release( + ffi.Pointer value, + ) { + return __Block_release( + value, + ); + } + + late final __Block_releasePtr = + _lookup)>>( + '_Block_release'); + late final __Block_release = + __Block_releasePtr.asFunction)>(); + + late final _objc_releaseFinalizer11 = + ffi.NativeFinalizer(__Block_releasePtr.cast()); late final _sel_enumerateIndexesUsingBlock_1 = _registerName1("enumerateIndexesUsingBlock:"); void _objc_msgSend_91( @@ -29346,10 +29382,10 @@ class _ObjCWrapper implements ffi.Finalizable { {bool retain = false, bool release = false}) : _pendingRelease = release { if (retain) { - _lib._objc_retain(_id); + _lib._objc_retain(_id.cast()); } if (release) { - _lib._objc_releaseFinalizer1.attach(this, _id.cast(), detach: this); + _lib._objc_releaseFinalizer2.attach(this, _id.cast(), detach: this); } } @@ -29358,8 +29394,8 @@ class _ObjCWrapper implements ffi.Finalizable { void release() { if (_pendingRelease) { _pendingRelease = false; - _lib._objc_release(_id); - _lib._objc_releaseFinalizer1.detach(this); + _lib._objc_release(_id.cast()); + _lib._objc_releaseFinalizer2.detach(this); } else { throw StateError( 'Released an ObjC object that was unowned or already released.'); @@ -30825,23 +30861,23 @@ class NSSet extends NSObject { void enumerateObjectsUsingBlock_(ObjCBlock13 block) { return _lib._objc_msgSend_359( - _id, _lib._sel_enumerateObjectsUsingBlock_1, block._impl); + _id, _lib._sel_enumerateObjectsUsingBlock_1, block._id); } void enumerateObjectsWithOptions_usingBlock_(int opts, ObjCBlock13 block) { return _lib._objc_msgSend_360(_id, - _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._impl); + _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._id); } NSSet objectsPassingTest_(ObjCBlock14 predicate) { final _ret = _lib._objc_msgSend_361( - _id, _lib._sel_objectsPassingTest_1, predicate._impl); + _id, _lib._sel_objectsPassingTest_1, predicate._id); return NSSet._(_ret, _lib, retain: true, release: true); } NSSet objectsWithOptions_passingTest_(int opts, ObjCBlock14 predicate) { final _ret = _lib._objc_msgSend_362( - _id, _lib._sel_objectsWithOptions_passingTest_1, opts, predicate._impl); + _id, _lib._sel_objectsWithOptions_passingTest_1, opts, predicate._id); return NSSet._(_ret, _lib, retain: true, release: true); } @@ -31178,7 +31214,6 @@ class NSString extends NSObject { @override String toString() => (UTF8String).cast().toDartString(); - int get length { return _lib._objc_msgSend_10(_id, _lib._sel_length1); } @@ -31515,12 +31550,12 @@ class NSString extends NSObject { _lib._sel_enumerateSubstringsInRange_options_usingBlock_1, range, opts, - block._impl); + block._id); } void enumerateLinesUsingBlock_(ObjCBlock11 block) { return _lib._objc_msgSend_313( - _id, _lib._sel_enumerateLinesUsingBlock_1, block._impl); + _id, _lib._sel_enumerateLinesUsingBlock_1, block._id); } ffi.Pointer get UTF8String { @@ -31782,7 +31817,7 @@ class NSString extends NSObject { _lib._sel_initWithCharactersNoCopy_length_deallocator_1, chars, len, - deallocator._impl); + deallocator._id); return NSString._(_ret, _lib, retain: false, release: true); } @@ -31874,7 +31909,7 @@ class NSString extends NSObject { bytes, len, encoding, - deallocator._impl); + deallocator._id); return NSString._(_ret, _lib, retain: false, release: true); } @@ -32347,7 +32382,7 @@ class NSString extends NSObject { scheme, options, orthography?._id ?? ffi.nullptr, - block._impl); + block._id); } static NSString new1(AVFAudio _lib) { @@ -33045,7 +33080,7 @@ class NSData extends NSObject { void enumerateByteRangesUsingBlock_(ObjCBlock8 block) { return _lib._objc_msgSend_236( - _id, _lib._sel_enumerateByteRangesUsingBlock_1, block._impl); + _id, _lib._sel_enumerateByteRangesUsingBlock_1, block._id); } static NSData data(AVFAudio _lib) { @@ -33137,7 +33172,7 @@ class NSData extends NSObject { _lib._sel_initWithBytesNoCopy_length_deallocator_1, bytes, length, - deallocator._impl); + deallocator._id); return NSData._(_ret, _lib, retain: false, release: true); } @@ -34852,12 +34887,12 @@ class NSArray extends NSObject { void enumerateObjectsUsingBlock_(ObjCBlock3 block) { return _lib._objc_msgSend_104( - _id, _lib._sel_enumerateObjectsUsingBlock_1, block._impl); + _id, _lib._sel_enumerateObjectsUsingBlock_1, block._id); } void enumerateObjectsWithOptions_usingBlock_(int opts, ObjCBlock3 block) { return _lib._objc_msgSend_105(_id, - _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._impl); + _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._id); } void enumerateObjectsAtIndexes_options_usingBlock_( @@ -34867,20 +34902,17 @@ class NSArray extends NSObject { _lib._sel_enumerateObjectsAtIndexes_options_usingBlock_1, s?._id ?? ffi.nullptr, opts, - block._impl); + block._id); } int indexOfObjectPassingTest_(ObjCBlock4 predicate) { return _lib._objc_msgSend_107( - _id, _lib._sel_indexOfObjectPassingTest_1, predicate._impl); + _id, _lib._sel_indexOfObjectPassingTest_1, predicate._id); } int indexOfObjectWithOptions_passingTest_(int opts, ObjCBlock4 predicate) { - return _lib._objc_msgSend_108( - _id, - _lib._sel_indexOfObjectWithOptions_passingTest_1, - opts, - predicate._impl); + return _lib._objc_msgSend_108(_id, + _lib._sel_indexOfObjectWithOptions_passingTest_1, opts, predicate._id); } int indexOfObjectAtIndexes_options_passingTest_( @@ -34890,12 +34922,12 @@ class NSArray extends NSObject { _lib._sel_indexOfObjectAtIndexes_options_passingTest_1, s?._id ?? ffi.nullptr, opts, - predicate._impl); + predicate._id); } NSIndexSet indexesOfObjectsPassingTest_(ObjCBlock4 predicate) { final _ret = _lib._objc_msgSend_110( - _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._impl); + _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._id); return NSIndexSet._(_ret, _lib, retain: true, release: true); } @@ -34905,7 +34937,7 @@ class NSArray extends NSObject { _id, _lib._sel_indexesOfObjectsWithOptions_passingTest_1, opts, - predicate._impl); + predicate._id); return NSIndexSet._(_ret, _lib, retain: true, release: true); } @@ -34916,7 +34948,7 @@ class NSArray extends NSObject { _lib._sel_indexesOfObjectsAtIndexes_options_passingTest_1, s?._id ?? ffi.nullptr, opts, - predicate._impl); + predicate._id); return NSIndexSet._(_ret, _lib, retain: true, release: true); } @@ -35482,12 +35514,12 @@ class NSIndexSet extends NSObject { void enumerateIndexesUsingBlock_(ObjCBlock block) { return _lib._objc_msgSend_91( - _id, _lib._sel_enumerateIndexesUsingBlock_1, block._impl); + _id, _lib._sel_enumerateIndexesUsingBlock_1, block._id); } void enumerateIndexesWithOptions_usingBlock_(int opts, ObjCBlock block) { return _lib._objc_msgSend_92(_id, - _lib._sel_enumerateIndexesWithOptions_usingBlock_1, opts, block._impl); + _lib._sel_enumerateIndexesWithOptions_usingBlock_1, opts, block._id); } void enumerateIndexesInRange_options_usingBlock_( @@ -35497,17 +35529,17 @@ class NSIndexSet extends NSObject { _lib._sel_enumerateIndexesInRange_options_usingBlock_1, range, opts, - block._impl); + block._id); } int indexPassingTest_(ObjCBlock1 predicate) { return _lib._objc_msgSend_94( - _id, _lib._sel_indexPassingTest_1, predicate._impl); + _id, _lib._sel_indexPassingTest_1, predicate._id); } int indexWithOptions_passingTest_(int opts, ObjCBlock1 predicate) { return _lib._objc_msgSend_95( - _id, _lib._sel_indexWithOptions_passingTest_1, opts, predicate._impl); + _id, _lib._sel_indexWithOptions_passingTest_1, opts, predicate._id); } int indexInRange_options_passingTest_( @@ -35517,18 +35549,18 @@ class NSIndexSet extends NSObject { _lib._sel_indexInRange_options_passingTest_1, range, opts, - predicate._impl); + predicate._id); } NSIndexSet indexesPassingTest_(ObjCBlock1 predicate) { final _ret = _lib._objc_msgSend_97( - _id, _lib._sel_indexesPassingTest_1, predicate._impl); + _id, _lib._sel_indexesPassingTest_1, predicate._id); return NSIndexSet._(_ret, _lib, retain: true, release: true); } NSIndexSet indexesWithOptions_passingTest_(int opts, ObjCBlock1 predicate) { final _ret = _lib._objc_msgSend_98( - _id, _lib._sel_indexesWithOptions_passingTest_1, opts, predicate._impl); + _id, _lib._sel_indexesWithOptions_passingTest_1, opts, predicate._id); return NSIndexSet._(_ret, _lib, retain: true, release: true); } @@ -35539,18 +35571,18 @@ class NSIndexSet extends NSObject { _lib._sel_indexesInRange_options_passingTest_1, range, opts, - predicate._impl); + predicate._id); return NSIndexSet._(_ret, _lib, retain: true, release: true); } void enumerateRangesUsingBlock_(ObjCBlock2 block) { return _lib._objc_msgSend_100( - _id, _lib._sel_enumerateRangesUsingBlock_1, block._impl); + _id, _lib._sel_enumerateRangesUsingBlock_1, block._id); } void enumerateRangesWithOptions_usingBlock_(int opts, ObjCBlock2 block) { return _lib._objc_msgSend_101(_id, - _lib._sel_enumerateRangesWithOptions_usingBlock_1, opts, block._impl); + _lib._sel_enumerateRangesWithOptions_usingBlock_1, opts, block._id); } void enumerateRangesInRange_options_usingBlock_( @@ -35560,7 +35592,7 @@ class NSIndexSet extends NSObject { _lib._sel_enumerateRangesInRange_options_usingBlock_1, range, opts, - block._impl); + block._id); } static NSIndexSet new1(AVFAudio _lib) { @@ -35643,6 +35675,45 @@ class NSIndexSet extends NSObject { } typedef NSRangePointer = ffi.Pointer; + +class _ObjCBlockBase implements ffi.Finalizable { + final ffi.Pointer<_ObjCBlock> _id; + final AVFAudio _lib; + bool _pendingRelease; + + _ObjCBlockBase._(this._id, this._lib, + {bool retain = false, bool release = false}) + : _pendingRelease = release { + if (retain) { + _lib._Block_copy(_id.cast()); + } + if (release) { + _lib._objc_releaseFinalizer11.attach(this, _id.cast(), detach: this); + } + } + + /// Releases the reference to the underlying ObjC block held by this wrapper. + /// Throws a StateError if this wrapper doesn't currently hold a reference. + void release() { + if (_pendingRelease) { + _pendingRelease = false; + _lib._Block_release(_id.cast()); + _lib._objc_releaseFinalizer11.detach(this); + } else { + throw StateError( + 'Released an ObjC block that was unowned or already released.'); + } + } + + @override + bool operator ==(Object other) { + return other is _ObjCBlockBase && _id == other._id; + } + + @override + int get hashCode => _id.hashCode; +} + void _ObjCBlock_fnPtrTrampoline( ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) { return block.ref.target @@ -35666,46 +35737,52 @@ void _ObjCBlock_closureTrampoline( return _ObjCBlock_closureRegistry[block.ref.target.address]!(arg0, arg1); } -class ObjCBlock { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock._(this._impl, this._lib); +class ObjCBlock extends _ObjCBlockBase { + ObjCBlock._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( NSUInteger arg0, ffi.Pointer arg1)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - NSUInteger arg0, - ffi.Pointer arg1)>(_ObjCBlock_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + NSUInteger arg0, ffi.Pointer arg1)>( + _ObjCBlock_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock.fromFunction( - this._lib, void Function(int arg0, ffi.Pointer arg1) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - NSUInteger arg0, ffi.Pointer arg1)>( - _ObjCBlock_closureTrampoline) - .cast(), - _ObjCBlock_registerClosure(fn)); + AVFAudio lib, void Function(int arg0, ffi.Pointer arg1) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + NSUInteger arg0, ffi.Pointer arg1)>( + _ObjCBlock_closureTrampoline) + .cast(), + _ObjCBlock_registerClosure(fn)), + lib); void call(int arg0, ffi.Pointer arg1) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_ObjCBlock> block, NSUInteger arg0, ffi.Pointer arg1)>>() .asFunction< void Function(ffi.Pointer<_ObjCBlock> block, int arg0, - ffi.Pointer arg1)>()(_impl, arg0, arg1); + ffi.Pointer arg1)>()(_id, arg0, arg1); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } class _ObjCBlockDesc extends ffi.Struct { @@ -35766,45 +35843,52 @@ bool _ObjCBlock1_closureTrampoline( return _ObjCBlock1_closureRegistry[block.ref.target.address]!(arg0, arg1); } -class ObjCBlock1 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock1._(this._impl, this._lib); +class ObjCBlock1 extends _ObjCBlockBase { + ObjCBlock1._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock1.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Bool Function( NSUInteger arg0, ffi.Pointer arg1)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Bool Function(ffi.Pointer<_ObjCBlock> block, - NSUInteger arg0, ffi.Pointer arg1)>( - _ObjCBlock1_fnPtrTrampoline, false) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function(ffi.Pointer<_ObjCBlock> block, + NSUInteger arg0, ffi.Pointer arg1)>( + _ObjCBlock1_fnPtrTrampoline, false) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock1.fromFunction( - this._lib, bool Function(int arg0, ffi.Pointer arg1) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Bool Function(ffi.Pointer<_ObjCBlock> block, - NSUInteger arg0, ffi.Pointer arg1)>( - _ObjCBlock1_closureTrampoline, false) - .cast(), - _ObjCBlock1_registerClosure(fn)); + AVFAudio lib, bool Function(int arg0, ffi.Pointer arg1) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function(ffi.Pointer<_ObjCBlock> block, + NSUInteger arg0, ffi.Pointer arg1)>( + _ObjCBlock1_closureTrampoline, false) + .cast(), + _ObjCBlock1_registerClosure(fn)), + lib); bool call(int arg0, ffi.Pointer arg1) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Bool Function(ffi.Pointer<_ObjCBlock> block, NSUInteger arg0, ffi.Pointer arg1)>>() .asFunction< bool Function(ffi.Pointer<_ObjCBlock> block, int arg0, - ffi.Pointer arg1)>()(_impl, arg0, arg1); + ffi.Pointer arg1)>()(_id, arg0, arg1); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } void _ObjCBlock2_fnPtrTrampoline( @@ -35831,44 +35915,51 @@ void _ObjCBlock2_closureTrampoline( return _ObjCBlock2_closureRegistry[block.ref.target.address]!(arg0, arg1); } -class ObjCBlock2 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock2._(this._impl, this._lib); +class ObjCBlock2 extends _ObjCBlockBase { + ObjCBlock2._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock2.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(NSRange arg0, ffi.Pointer arg1)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - NSRange arg0, ffi.Pointer arg1)>( - _ObjCBlock2_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + NSRange arg0, ffi.Pointer arg1)>( + _ObjCBlock2_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock2.fromFunction( - this._lib, void Function(NSRange arg0, ffi.Pointer arg1) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - NSRange arg0, ffi.Pointer arg1)>( - _ObjCBlock2_closureTrampoline) - .cast(), - _ObjCBlock2_registerClosure(fn)); + AVFAudio lib, void Function(NSRange arg0, ffi.Pointer arg1) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + NSRange arg0, ffi.Pointer arg1)>( + _ObjCBlock2_closureTrampoline) + .cast(), + _ObjCBlock2_registerClosure(fn)), + lib); void call(NSRange arg0, ffi.Pointer arg1) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_ObjCBlock> block, NSRange arg0, ffi.Pointer arg1)>>() .asFunction< void Function(ffi.Pointer<_ObjCBlock> block, NSRange arg0, - ffi.Pointer arg1)>()(_impl, arg0, arg1); + ffi.Pointer arg1)>()(_id, arg0, arg1); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } void _ObjCBlock3_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, @@ -35897,45 +35988,52 @@ void _ObjCBlock3_closureTrampoline(ffi.Pointer<_ObjCBlock> block, arg0, arg1, arg2); } -class ObjCBlock3 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock3._(this._impl, this._lib); +class ObjCBlock3 extends _ObjCBlockBase { + ObjCBlock3._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock3.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0, NSUInteger arg1, ffi.Pointer arg2)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSUInteger arg1, - ffi.Pointer arg2)>( - _ObjCBlock3_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>( + _ObjCBlock3_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock3.fromFunction( - this._lib, + AVFAudio lib, void Function(ffi.Pointer arg0, int arg1, ffi.Pointer arg2) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSUInteger arg1, - ffi.Pointer arg2)>( - _ObjCBlock3_closureTrampoline) - .cast(), - _ObjCBlock3_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>( + _ObjCBlock3_closureTrampoline) + .cast(), + _ObjCBlock3_registerClosure(fn)), + lib); void call( ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( @@ -35948,10 +36046,10 @@ class ObjCBlock3 { ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1, - ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } bool _ObjCBlock4_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, @@ -35980,45 +36078,52 @@ bool _ObjCBlock4_closureTrampoline(ffi.Pointer<_ObjCBlock> block, arg0, arg1, arg2); } -class ObjCBlock4 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock4._(this._impl, this._lib); +class ObjCBlock4 extends _ObjCBlockBase { + ObjCBlock4._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock4.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Bool Function(ffi.Pointer arg0, NSUInteger arg1, ffi.Pointer arg2)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSUInteger arg1, - ffi.Pointer arg2)>( - _ObjCBlock4_fnPtrTrampoline, false) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>( + _ObjCBlock4_fnPtrTrampoline, false) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock4.fromFunction( - this._lib, + AVFAudio lib, bool Function(ffi.Pointer arg0, int arg1, ffi.Pointer arg2) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSUInteger arg1, - ffi.Pointer arg2)>( - _ObjCBlock4_closureTrampoline, false) - .cast(), - _ObjCBlock4_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>( + _ObjCBlock4_closureTrampoline, false) + .cast(), + _ObjCBlock4_registerClosure(fn)), + lib); bool call( ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Bool Function( @@ -36031,10 +36136,10 @@ class ObjCBlock4 { ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1, - ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } typedef NSComparator = ffi.Pointer<_ObjCBlock>; @@ -36063,41 +36168,48 @@ int _ObjCBlock5_closureTrampoline(ffi.Pointer<_ObjCBlock> block, return _ObjCBlock5_closureRegistry[block.ref.target.address]!(arg0, arg1); } -class ObjCBlock5 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock5._(this._impl, this._lib); +class ObjCBlock5 extends _ObjCBlockBase { + ObjCBlock5._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock5.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Int32 Function(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Int32 Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock5_fnPtrTrampoline, 0) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Int32 Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock5_fnPtrTrampoline, 0) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock5.fromFunction( - this._lib, + AVFAudio lib, int Function(ffi.Pointer arg0, ffi.Pointer arg1) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Int32 Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock5_closureTrampoline, 0) - .cast(), - _ObjCBlock5_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Int32 Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock5_closureTrampoline, 0) + .cast(), + _ObjCBlock5_registerClosure(fn)), + lib); int call(ffi.Pointer arg0, ffi.Pointer arg1) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Int32 Function( @@ -36108,10 +36220,10 @@ class ObjCBlock5 { int Function( ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, - ffi.Pointer arg1)>()(_impl, arg0, arg1); + ffi.Pointer arg1)>()(_id, arg0, arg1); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } abstract class NSComparisonResult { @@ -36205,7 +36317,7 @@ class NSPredicate extends NSObject { static NSPredicate predicateWithBlock_(AVFAudio _lib, ObjCBlock6 block) { final _ret = _lib._objc_msgSend_193( - _lib._class_NSPredicate1, _lib._sel_predicateWithBlock_1, block._impl); + _lib._class_NSPredicate1, _lib._sel_predicateWithBlock_1, block._id); return NSPredicate._(_ret, _lib, retain: true, release: true); } @@ -36358,41 +36470,48 @@ bool _ObjCBlock6_closureTrampoline(ffi.Pointer<_ObjCBlock> block, return _ObjCBlock6_closureRegistry[block.ref.target.address]!(arg0, arg1); } -class ObjCBlock6 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock6._(this._impl, this._lib); +class ObjCBlock6 extends _ObjCBlockBase { + ObjCBlock6._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock6.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Bool Function(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock6_fnPtrTrampoline, false) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock6_fnPtrTrampoline, false) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock6.fromFunction( - this._lib, + AVFAudio lib, bool Function(ffi.Pointer arg0, ffi.Pointer arg1) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock6_closureTrampoline, false) - .cast(), - _ObjCBlock6_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock6_closureTrampoline, false) + .cast(), + _ObjCBlock6_registerClosure(fn)), + lib); bool call(ffi.Pointer arg0, ffi.Pointer arg1) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Bool Function( @@ -36403,10 +36522,10 @@ class ObjCBlock6 { bool Function( ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, - ffi.Pointer arg1)>()(_impl, arg0, arg1); + ffi.Pointer arg1)>()(_id, arg0, arg1); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } class NSDictionary extends NSObject { @@ -36559,7 +36678,7 @@ class NSDictionary extends NSObject { void enumerateKeysAndObjectsUsingBlock_(ObjCBlock7 block) { return _lib._objc_msgSend_137( - _id, _lib._sel_enumerateKeysAndObjectsUsingBlock_1, block._impl); + _id, _lib._sel_enumerateKeysAndObjectsUsingBlock_1, block._id); } void enumerateKeysAndObjectsWithOptions_usingBlock_( @@ -36568,7 +36687,7 @@ class NSDictionary extends NSObject { _id, _lib._sel_enumerateKeysAndObjectsWithOptions_usingBlock_1, opts, - block._impl); + block._id); } NSArray keysSortedByValueUsingComparator_(NSComparator cmptr) { @@ -36935,12 +37054,13 @@ void _ObjCBlock7_closureTrampoline( arg0, arg1, arg2); } -class ObjCBlock7 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock7._(this._impl, this._lib); +class ObjCBlock7 extends _ObjCBlockBase { + ObjCBlock7._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock7.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -36948,34 +37068,40 @@ class ObjCBlock7 { ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>( - _ObjCBlock7_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock7_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock7.fromFunction( - this._lib, + AVFAudio lib, void Function(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>( - _ObjCBlock7_closureTrampoline) - .cast(), - _ObjCBlock7_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock7_closureTrampoline) + .cast(), + _ObjCBlock7_registerClosure(fn)), + lib); void call(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( @@ -36988,10 +37114,10 @@ class ObjCBlock7 { ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } class NSFastEnumerationState extends ffi.Struct { @@ -39116,45 +39242,52 @@ void _ObjCBlock8_closureTrampoline(ffi.Pointer<_ObjCBlock> block, arg0, arg1, arg2); } -class ObjCBlock8 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock8._(this._impl, this._lib); +class ObjCBlock8 extends _ObjCBlockBase { + ObjCBlock8._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock8.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSRange arg1, - ffi.Pointer arg2)>( - _ObjCBlock8_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock8_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock8.fromFunction( - this._lib, + AVFAudio lib, void Function(ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSRange arg1, - ffi.Pointer arg2)>( - _ObjCBlock8_closureTrampoline) - .cast(), - _ObjCBlock8_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock8_closureTrampoline) + .cast(), + _ObjCBlock8_registerClosure(fn)), + lib); void call( ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( @@ -39167,10 +39300,10 @@ class ObjCBlock8 { ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, NSRange arg1, - ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } abstract class NSDataReadingOptions { @@ -39205,47 +39338,54 @@ void _ObjCBlock9_closureTrampoline( return _ObjCBlock9_closureRegistry[block.ref.target.address]!(arg0, arg1); } -class ObjCBlock9 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock9._(this._impl, this._lib); +class ObjCBlock9 extends _ObjCBlockBase { + ObjCBlock9._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock9.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, NSUInteger arg1)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSUInteger arg1)>(_ObjCBlock9_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1)>(_ObjCBlock9_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock9.fromFunction( - this._lib, void Function(ffi.Pointer arg0, int arg1) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSUInteger arg1)>(_ObjCBlock9_closureTrampoline) - .cast(), - _ObjCBlock9_registerClosure(fn)); + AVFAudio lib, void Function(ffi.Pointer arg0, int arg1) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1)>(_ObjCBlock9_closureTrampoline) + .cast(), + _ObjCBlock9_registerClosure(fn)), + lib); void call(ffi.Pointer arg0, int arg1) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, NSUInteger arg1)>>() .asFunction< void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, int arg1)>()(_impl, arg0, arg1); + ffi.Pointer arg0, int arg1)>()(_id, arg0, arg1); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } abstract class NSDataBase64DecodingOptions { @@ -39335,47 +39475,54 @@ void _ObjCBlock10_closureTrampoline( arg0, arg1, arg2, arg3); } -class ObjCBlock10 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock10._(this._impl, this._lib); +class ObjCBlock10 extends _ObjCBlockBase { + ObjCBlock10._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock10.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0, NSRange arg1, NSRange arg2, ffi.Pointer arg3)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSRange arg1, - NSRange arg2, - ffi.Pointer arg3)>( - _ObjCBlock10_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3)>( + _ObjCBlock10_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock10.fromFunction( - this._lib, + AVFAudio lib, void Function(ffi.Pointer arg0, NSRange arg1, NSRange arg2, ffi.Pointer arg3) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSRange arg1, - NSRange arg2, - ffi.Pointer arg3)>( - _ObjCBlock10_closureTrampoline) - .cast(), - _ObjCBlock10_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3)>( + _ObjCBlock10_closureTrampoline) + .cast(), + _ObjCBlock10_registerClosure(fn)), + lib); void call(ffi.Pointer arg0, NSRange arg1, NSRange arg2, ffi.Pointer arg3) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( @@ -39390,10 +39537,10 @@ class ObjCBlock10 { ffi.Pointer arg0, NSRange arg1, NSRange arg2, - ffi.Pointer arg3)>()(_impl, arg0, arg1, arg2, arg3); + ffi.Pointer arg3)>()(_id, arg0, arg1, arg2, arg3); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } void _ObjCBlock11_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, @@ -39421,41 +39568,48 @@ void _ObjCBlock11_closureTrampoline(ffi.Pointer<_ObjCBlock> block, return _ObjCBlock11_closureRegistry[block.ref.target.address]!(arg0, arg1); } -class ObjCBlock11 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock11._(this._impl, this._lib); +class ObjCBlock11 extends _ObjCBlockBase { + ObjCBlock11._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock11.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock11_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock11_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock11.fromFunction( - this._lib, + AVFAudio lib, void Function(ffi.Pointer arg0, ffi.Pointer arg1) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock11_closureTrampoline) - .cast(), - _ObjCBlock11_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock11_closureTrampoline) + .cast(), + _ObjCBlock11_registerClosure(fn)), + lib); void call(ffi.Pointer arg0, ffi.Pointer arg1) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( @@ -39466,10 +39620,10 @@ class ObjCBlock11 { void Function( ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, - ffi.Pointer arg1)>()(_impl, arg0, arg1); + ffi.Pointer arg1)>()(_id, arg0, arg1); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } typedef NSStringEncoding = NSUInteger; @@ -39503,47 +39657,54 @@ void _ObjCBlock12_closureTrampoline( return _ObjCBlock12_closureRegistry[block.ref.target.address]!(arg0, arg1); } -class ObjCBlock12 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock12._(this._impl, this._lib); +class ObjCBlock12 extends _ObjCBlockBase { + ObjCBlock12._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock12.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, NSUInteger arg1)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSUInteger arg1)>(_ObjCBlock12_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1)>(_ObjCBlock12_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock12.fromFunction( - this._lib, void Function(ffi.Pointer arg0, int arg1) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSUInteger arg1)>(_ObjCBlock12_closureTrampoline) - .cast(), - _ObjCBlock12_registerClosure(fn)); + AVFAudio lib, void Function(ffi.Pointer arg0, int arg1) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1)>(_ObjCBlock12_closureTrampoline) + .cast(), + _ObjCBlock12_registerClosure(fn)), + lib); void call(ffi.Pointer arg0, int arg1) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, NSUInteger arg1)>>() .asFunction< void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, int arg1)>()(_impl, arg0, arg1); + ffi.Pointer arg0, int arg1)>()(_id, arg0, arg1); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } typedef NSLinguisticTagScheme = ffi.Pointer; @@ -39766,41 +39927,48 @@ void _ObjCBlock13_closureTrampoline(ffi.Pointer<_ObjCBlock> block, return _ObjCBlock13_closureRegistry[block.ref.target.address]!(arg0, arg1); } -class ObjCBlock13 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock13._(this._impl, this._lib); +class ObjCBlock13 extends _ObjCBlockBase { + ObjCBlock13._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock13.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock13_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock13_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock13.fromFunction( - this._lib, + AVFAudio lib, void Function(ffi.Pointer arg0, ffi.Pointer arg1) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock13_closureTrampoline) - .cast(), - _ObjCBlock13_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock13_closureTrampoline) + .cast(), + _ObjCBlock13_registerClosure(fn)), + lib); void call(ffi.Pointer arg0, ffi.Pointer arg1) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( @@ -39811,10 +39979,10 @@ class ObjCBlock13 { void Function( ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, - ffi.Pointer arg1)>()(_impl, arg0, arg1); + ffi.Pointer arg1)>()(_id, arg0, arg1); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } bool _ObjCBlock14_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, @@ -39842,41 +40010,48 @@ bool _ObjCBlock14_closureTrampoline(ffi.Pointer<_ObjCBlock> block, return _ObjCBlock14_closureRegistry[block.ref.target.address]!(arg0, arg1); } -class ObjCBlock14 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock14._(this._impl, this._lib); +class ObjCBlock14 extends _ObjCBlockBase { + ObjCBlock14._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock14.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Bool Function(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock14_fnPtrTrampoline, false) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock14_fnPtrTrampoline, false) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock14.fromFunction( - this._lib, + AVFAudio lib, bool Function(ffi.Pointer arg0, ffi.Pointer arg1) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock14_closureTrampoline, false) - .cast(), - _ObjCBlock14_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock14_closureTrampoline, false) + .cast(), + _ObjCBlock14_registerClosure(fn)), + lib); bool call(ffi.Pointer arg0, ffi.Pointer arg1) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Bool Function( @@ -39887,10 +40062,10 @@ class ObjCBlock14 { bool Function( ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, - ffi.Pointer arg1)>()(_impl, arg0, arg1); + ffi.Pointer arg1)>()(_id, arg0, arg1); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } class NSFileManager extends NSObject { @@ -39941,7 +40116,7 @@ class NSFileManager extends NSObject { _lib._sel_unmountVolumeAtURL_options_completionHandler_1, url?._id ?? ffi.nullptr, mask, - completionHandler._impl); + completionHandler._id); } NSArray contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_( @@ -40457,44 +40632,51 @@ void _ObjCBlock15_closureTrampoline( return _ObjCBlock15_closureRegistry[block.ref.target.address]!(arg0); } -class ObjCBlock15 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock15._(this._impl, this._lib); +class ObjCBlock15 extends _ObjCBlockBase { + ObjCBlock15._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock15.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>( - _ObjCBlock15_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock15_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock15.fromFunction( - this._lib, void Function(ffi.Pointer arg0) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>( - _ObjCBlock15_closureTrampoline) - .cast(), - _ObjCBlock15_registerClosure(fn)); + AVFAudio lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock15_closureTrampoline) + .cast(), + _ObjCBlock15_registerClosure(fn)), + lib); void call(ffi.Pointer arg0) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0)>>() .asFunction< void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>()(_impl, arg0); + ffi.Pointer arg0)>()(_id, arg0); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } abstract class NSDirectoryEnumerationOptions { @@ -41404,12 +41586,12 @@ class NSOrderedSet extends NSObject { void enumerateObjectsUsingBlock_(ObjCBlock3 block) { return _lib._objc_msgSend_104( - _id, _lib._sel_enumerateObjectsUsingBlock_1, block._impl); + _id, _lib._sel_enumerateObjectsUsingBlock_1, block._id); } void enumerateObjectsWithOptions_usingBlock_(int opts, ObjCBlock3 block) { return _lib._objc_msgSend_105(_id, - _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._impl); + _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._id); } void enumerateObjectsAtIndexes_options_usingBlock_( @@ -41419,20 +41601,17 @@ class NSOrderedSet extends NSObject { _lib._sel_enumerateObjectsAtIndexes_options_usingBlock_1, s?._id ?? ffi.nullptr, opts, - block._impl); + block._id); } int indexOfObjectPassingTest_(ObjCBlock4 predicate) { return _lib._objc_msgSend_107( - _id, _lib._sel_indexOfObjectPassingTest_1, predicate._impl); + _id, _lib._sel_indexOfObjectPassingTest_1, predicate._id); } int indexOfObjectWithOptions_passingTest_(int opts, ObjCBlock4 predicate) { - return _lib._objc_msgSend_108( - _id, - _lib._sel_indexOfObjectWithOptions_passingTest_1, - opts, - predicate._impl); + return _lib._objc_msgSend_108(_id, + _lib._sel_indexOfObjectWithOptions_passingTest_1, opts, predicate._id); } int indexOfObjectAtIndexes_options_passingTest_( @@ -41442,12 +41621,12 @@ class NSOrderedSet extends NSObject { _lib._sel_indexOfObjectAtIndexes_options_passingTest_1, s?._id ?? ffi.nullptr, opts, - predicate._impl); + predicate._id); } NSIndexSet indexesOfObjectsPassingTest_(ObjCBlock4 predicate) { final _ret = _lib._objc_msgSend_110( - _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._impl); + _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._id); return NSIndexSet._(_ret, _lib, retain: true, release: true); } @@ -41457,7 +41636,7 @@ class NSOrderedSet extends NSObject { _id, _lib._sel_indexesOfObjectsWithOptions_passingTest_1, opts, - predicate._impl); + predicate._id); return NSIndexSet._(_ret, _lib, retain: true, release: true); } @@ -41468,7 +41647,7 @@ class NSOrderedSet extends NSObject { _lib._sel_indexesOfObjectsAtIndexes_options_passingTest_1, s?._id ?? ffi.nullptr, opts, - predicate._impl); + predicate._id); return NSIndexSet._(_ret, _lib, retain: true, release: true); } @@ -42589,8 +42768,8 @@ class NSThread extends NSObject { } static void detachNewThreadWithBlock_(AVFAudio _lib, ObjCBlock16 block) { - return _lib._objc_msgSend_465(_lib._class_NSThread1, - _lib._sel_detachNewThreadWithBlock_1, block._impl); + return _lib._objc_msgSend_465( + _lib._class_NSThread1, _lib._sel_detachNewThreadWithBlock_1, block._id); } static void detachNewThreadSelector_toTarget_withObject_(AVFAudio _lib, @@ -42711,7 +42890,7 @@ class NSThread extends NSObject { NSThread initWithBlock_(ObjCBlock16 block) { final _ret = - _lib._objc_msgSend_479(_id, _lib._sel_initWithBlock_1, block._impl); + _lib._objc_msgSend_479(_id, _lib._sel_initWithBlock_1, block._id); return NSThread._(_ret, _lib, retain: true, release: true); } @@ -42835,34 +43014,41 @@ void _ObjCBlock16_closureTrampoline(ffi.Pointer<_ObjCBlock> block) { return _ObjCBlock16_closureRegistry[block.ref.target.address]!(); } -class ObjCBlock16 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock16._(this._impl, this._lib); +class ObjCBlock16 extends _ObjCBlockBase { + ObjCBlock16._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock16.fromFunctionPointer( - this._lib, ffi.Pointer> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block)>( - _ObjCBlock16_fnPtrTrampoline) - .cast(), - ptr.cast()); - ObjCBlock16.fromFunction(this._lib, void Function() fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block)>( - _ObjCBlock16_closureTrampoline) - .cast(), - _ObjCBlock16_registerClosure(fn)); + AVFAudio lib, ffi.Pointer> ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block)>( + _ObjCBlock16_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock16.fromFunction(AVFAudio lib, void Function() fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block)>( + _ObjCBlock16_closureTrampoline) + .cast(), + _ObjCBlock16_registerClosure(fn)), + lib); void call() { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_ObjCBlock> block)>>() - .asFunction block)>()(_impl); + .asFunction block)>()(_id); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } class NSMutableDictionary extends NSDictionary { @@ -43734,11 +43920,11 @@ class NSRunLoop extends NSObject { void performInModes_block_(NSArray? modes, ObjCBlock16 block) { return _lib._objc_msgSend_499(_id, _lib._sel_performInModes_block_1, - modes?._id ?? ffi.nullptr, block._impl); + modes?._id ?? ffi.nullptr, block._id); } void performBlock_(ObjCBlock16 block) { - return _lib._objc_msgSend_465(_id, _lib._sel_performBlock_1, block._impl); + return _lib._objc_msgSend_465(_id, _lib._sel_performBlock_1, block._id); } void performSelector_target_argument_order_modes_( @@ -43943,7 +44129,7 @@ class NSTimer extends NSObject { _lib._sel_timerWithTimeInterval_repeats_block_1, interval, repeats, - block._impl); + block._id); return NSTimer._(_ret, _lib, retain: true, release: true); } @@ -43954,7 +44140,7 @@ class NSTimer extends NSObject { _lib._sel_scheduledTimerWithTimeInterval_repeats_block_1, interval, repeats, - block._impl); + block._id); return NSTimer._(_ret, _lib, retain: true, release: true); } @@ -43966,7 +44152,7 @@ class NSTimer extends NSObject { date?._id ?? ffi.nullptr, interval, repeats, - block._impl); + block._id); return NSTimer._(_ret, _lib, retain: true, release: true); } @@ -44129,44 +44315,51 @@ void _ObjCBlock17_closureTrampoline( return _ObjCBlock17_closureRegistry[block.ref.target.address]!(arg0); } -class ObjCBlock17 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock17._(this._impl, this._lib); +class ObjCBlock17 extends _ObjCBlockBase { + ObjCBlock17._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock17.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>( - _ObjCBlock17_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock17_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock17.fromFunction( - this._lib, void Function(ffi.Pointer arg0) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>( - _ObjCBlock17_closureTrampoline) - .cast(), - _ObjCBlock17_registerClosure(fn)); + AVFAudio lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock17_closureTrampoline) + .cast(), + _ObjCBlock17_registerClosure(fn)), + lib); void call(ffi.Pointer arg0) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0)>>() .asFunction< void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>()(_impl, arg0); + ffi.Pointer arg0)>()(_id, arg0); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } class NSConnection extends NSObject { @@ -46539,7 +46732,7 @@ class NSItemProvider extends NSObject { _lib._sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1, typeIdentifier?._id ?? ffi.nullptr, visibility, - loadHandler._impl); + loadHandler._id); } void @@ -46554,7 +46747,7 @@ class NSItemProvider extends NSObject { typeIdentifier?._id ?? ffi.nullptr, fileOptions, visibility, - loadHandler._impl); + loadHandler._id); } NSArray? get registeredTypeIdentifiers { @@ -46593,7 +46786,7 @@ class NSItemProvider extends NSObject { _id, _lib._sel_loadDataRepresentationForTypeIdentifier_completionHandler_1, typeIdentifier?._id ?? ffi.nullptr, - completionHandler._impl); + completionHandler._id); return NSProgress._(_ret, _lib, retain: true, release: true); } @@ -46603,7 +46796,7 @@ class NSItemProvider extends NSObject { _id, _lib._sel_loadFileRepresentationForTypeIdentifier_completionHandler_1, typeIdentifier?._id ?? ffi.nullptr, - completionHandler._impl); + completionHandler._id); return NSProgress._(_ret, _lib, retain: true, release: true); } @@ -46613,7 +46806,7 @@ class NSItemProvider extends NSObject { _id, _lib._sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1, typeIdentifier?._id ?? ffi.nullptr, - completionHandler._impl); + completionHandler._id); return NSProgress._(_ret, _lib, retain: true, release: true); } @@ -46647,7 +46840,7 @@ class NSItemProvider extends NSObject { _lib._sel_registerObjectOfClass_visibility_loadHandler_1, aClass?._id ?? ffi.nullptr, visibility, - loadHandler._impl); + loadHandler._id); } bool canLoadObjectOfClass_(NSObject? aClass) { @@ -46661,7 +46854,7 @@ class NSItemProvider extends NSObject { _id, _lib._sel_loadObjectOfClass_completionHandler_1, aClass?._id ?? ffi.nullptr, - completionHandler._impl); + completionHandler._id); return NSProgress._(_ret, _lib, retain: true, release: true); } @@ -46830,47 +47023,54 @@ ffi.Pointer _ObjCBlock18_closureTrampoline( return _ObjCBlock18_closureRegistry[block.ref.target.address]!(arg0); } -class ObjCBlock18 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock18._(this._impl, this._lib); +class ObjCBlock18 extends _ObjCBlockBase { + ObjCBlock18._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock18.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer<_ObjCBlock> arg0)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0)>( - _ObjCBlock18_fnPtrTrampoline) - .cast(), - ptr.cast()); - ObjCBlock18.fromFunction(this._lib, + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock18_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock18.fromFunction(AVFAudio lib, ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0)>( - _ObjCBlock18_closureTrampoline) - .cast(), - _ObjCBlock18_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock18_closureTrampoline) + .cast(), + _ObjCBlock18_registerClosure(fn)), + lib); ffi.Pointer call(ffi.Pointer<_ObjCBlock> arg0) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0)>>() .asFunction< ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0)>()(_impl, arg0); + ffi.Pointer<_ObjCBlock> arg0)>()(_id, arg0); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } class NSProgress extends NSObject { @@ -46947,7 +47147,7 @@ class NSProgress extends NSObject { _id, _lib._sel_performAsCurrentWithPendingUnitCount_usingBlock_1, unitCount, - work._impl); + work._id); } void resignCurrent() { @@ -47033,8 +47233,7 @@ class NSProgress extends NSObject { } set cancellationHandler(ObjCBlock16 value) { - _lib._objc_msgSend_587( - _id, _lib._sel_setCancellationHandler_1, value._impl); + _lib._objc_msgSend_587(_id, _lib._sel_setCancellationHandler_1, value._id); } ObjCBlock16 get pausingHandler { @@ -47043,7 +47242,7 @@ class NSProgress extends NSObject { } set pausingHandler(ObjCBlock16 value) { - _lib._objc_msgSend_587(_id, _lib._sel_setPausingHandler_1, value._impl); + _lib._objc_msgSend_587(_id, _lib._sel_setPausingHandler_1, value._id); } ObjCBlock16 get resumingHandler { @@ -47052,7 +47251,7 @@ class NSProgress extends NSObject { } set resumingHandler(ObjCBlock16 value) { - _lib._objc_msgSend_587(_id, _lib._sel_setResumingHandler_1, value._impl); + _lib._objc_msgSend_587(_id, _lib._sel_setResumingHandler_1, value._id); } void setUserInfoObject_forKey_( @@ -47190,19 +47389,20 @@ void _ObjCBlock19_closureTrampoline(ffi.Pointer<_ObjCBlock> block, return _ObjCBlock19_closureRegistry[block.ref.target.address]!(arg0, arg1); } -class ObjCBlock19 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock19._(this._impl, this._lib); +class ObjCBlock19 extends _ObjCBlockBase { + ObjCBlock19._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock19.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) - : _impl = - _lib._newBlock1( + : this._( + lib._newBlock1( ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer<_ObjCBlock> block, @@ -47210,22 +47410,27 @@ class ObjCBlock19 { ffi.Pointer arg1)>( _ObjCBlock19_fnPtrTrampoline) .cast(), - ptr.cast()); + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock19.fromFunction( - this._lib, + AVFAudio lib, void Function(ffi.Pointer arg0, ffi.Pointer arg1) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock19_closureTrampoline) - .cast(), - _ObjCBlock19_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock19_closureTrampoline) + .cast(), + _ObjCBlock19_registerClosure(fn)), + lib); void call(ffi.Pointer arg0, ffi.Pointer arg1) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( @@ -47236,10 +47441,10 @@ class ObjCBlock19 { void Function( ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, - ffi.Pointer arg1)>()(_impl, arg0, arg1); + ffi.Pointer arg1)>()(_id, arg0, arg1); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } abstract class NSItemProviderFileOptions { @@ -47270,47 +47475,54 @@ ffi.Pointer _ObjCBlock20_closureTrampoline( return _ObjCBlock20_closureRegistry[block.ref.target.address]!(arg0); } -class ObjCBlock20 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock20._(this._impl, this._lib); +class ObjCBlock20 extends _ObjCBlockBase { + ObjCBlock20._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock20.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer<_ObjCBlock> arg0)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0)>( - _ObjCBlock20_fnPtrTrampoline) - .cast(), - ptr.cast()); - ObjCBlock20.fromFunction(this._lib, + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock20_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock20.fromFunction(AVFAudio lib, ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0)>( - _ObjCBlock20_closureTrampoline) - .cast(), - _ObjCBlock20_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock20_closureTrampoline) + .cast(), + _ObjCBlock20_registerClosure(fn)), + lib); ffi.Pointer call(ffi.Pointer<_ObjCBlock> arg0) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0)>>() .asFunction< ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0)>()(_impl, arg0); + ffi.Pointer<_ObjCBlock> arg0)>()(_id, arg0); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } void _ObjCBlock21_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, @@ -47339,45 +47551,52 @@ void _ObjCBlock21_closureTrampoline(ffi.Pointer<_ObjCBlock> block, arg0, arg1, arg2); } -class ObjCBlock21 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock21._(this._impl, this._lib); +class ObjCBlock21 extends _ObjCBlockBase { + ObjCBlock21._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock21.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, ffi.Pointer arg2)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Bool arg1, - ffi.Pointer arg2)>( - _ObjCBlock21_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock21_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock21.fromFunction( - this._lib, + AVFAudio lib, void Function(ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Bool arg1, - ffi.Pointer arg2)>( - _ObjCBlock21_closureTrampoline) - .cast(), - _ObjCBlock21_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock21_closureTrampoline) + .cast(), + _ObjCBlock21_registerClosure(fn)), + lib); void call( ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( @@ -47390,10 +47609,10 @@ class ObjCBlock21 { ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, bool arg1, - ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } void _ObjCBlock22_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, @@ -47421,19 +47640,20 @@ void _ObjCBlock22_closureTrampoline(ffi.Pointer<_ObjCBlock> block, return _ObjCBlock22_closureRegistry[block.ref.target.address]!(arg0, arg1); } -class ObjCBlock22 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock22._(this._impl, this._lib); +class ObjCBlock22 extends _ObjCBlockBase { + ObjCBlock22._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock22.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) - : _impl = - _lib._newBlock1( + : this._( + lib._newBlock1( ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer<_ObjCBlock> block, @@ -47441,22 +47661,27 @@ class ObjCBlock22 { ffi.Pointer arg1)>( _ObjCBlock22_fnPtrTrampoline) .cast(), - ptr.cast()); + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock22.fromFunction( - this._lib, + AVFAudio lib, void Function(ffi.Pointer arg0, ffi.Pointer arg1) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock22_closureTrampoline) - .cast(), - _ObjCBlock22_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock22_closureTrampoline) + .cast(), + _ObjCBlock22_registerClosure(fn)), + lib); void call(ffi.Pointer arg0, ffi.Pointer arg1) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( @@ -47467,10 +47692,10 @@ class ObjCBlock22 { void Function( ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, - ffi.Pointer arg1)>()(_impl, arg0, arg1); + ffi.Pointer arg1)>()(_id, arg0, arg1); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } ffi.Pointer _ObjCBlock23_fnPtrTrampoline( @@ -47497,47 +47722,54 @@ ffi.Pointer _ObjCBlock23_closureTrampoline( return _ObjCBlock23_closureRegistry[block.ref.target.address]!(arg0); } -class ObjCBlock23 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock23._(this._impl, this._lib); +class ObjCBlock23 extends _ObjCBlockBase { + ObjCBlock23._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock23.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer<_ObjCBlock> arg0)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0)>( - _ObjCBlock23_fnPtrTrampoline) - .cast(), - ptr.cast()); - ObjCBlock23.fromFunction(this._lib, + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock23_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock23.fromFunction(AVFAudio lib, ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0)>( - _ObjCBlock23_closureTrampoline) - .cast(), - _ObjCBlock23_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock23_closureTrampoline) + .cast(), + _ObjCBlock23_registerClosure(fn)), + lib); ffi.Pointer call(ffi.Pointer<_ObjCBlock> arg0) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0)>>() .asFunction< ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0)>()(_impl, arg0); + ffi.Pointer<_ObjCBlock> arg0)>()(_id, arg0); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } void _ObjCBlock24_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, @@ -47565,19 +47797,20 @@ void _ObjCBlock24_closureTrampoline(ffi.Pointer<_ObjCBlock> block, return _ObjCBlock24_closureRegistry[block.ref.target.address]!(arg0, arg1); } -class ObjCBlock24 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock24._(this._impl, this._lib); +class ObjCBlock24 extends _ObjCBlockBase { + ObjCBlock24._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock24.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) - : _impl = - _lib._newBlock1( + : this._( + lib._newBlock1( ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer<_ObjCBlock> block, @@ -47585,22 +47818,27 @@ class ObjCBlock24 { ffi.Pointer arg1)>( _ObjCBlock24_fnPtrTrampoline) .cast(), - ptr.cast()); + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock24.fromFunction( - this._lib, + AVFAudio lib, void Function(ffi.Pointer arg0, ffi.Pointer arg1) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock24_closureTrampoline) - .cast(), - _ObjCBlock24_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock24_closureTrampoline) + .cast(), + _ObjCBlock24_registerClosure(fn)), + lib); void call(ffi.Pointer arg0, ffi.Pointer arg1) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( @@ -47611,10 +47849,10 @@ class ObjCBlock24 { void Function( ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, - ffi.Pointer arg1)>()(_impl, arg0, arg1); + ffi.Pointer arg1)>()(_id, arg0, arg1); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } typedef NSItemProviderLoadHandler = ffi.Pointer<_ObjCBlock>; @@ -47654,12 +47892,13 @@ void _ObjCBlock25_closureTrampoline( arg0, arg1, arg2); } -class ObjCBlock25 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock25._(this._impl, this._lib); +class ObjCBlock25 extends _ObjCBlockBase { + ObjCBlock25._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock25.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -47667,34 +47906,40 @@ class ObjCBlock25 { ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>( - _ObjCBlock25_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock25_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock25.fromFunction( - this._lib, + AVFAudio lib, void Function(NSItemProviderCompletionHandler arg0, ffi.Pointer arg1, ffi.Pointer arg2) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>( - _ObjCBlock25_closureTrampoline) - .cast(), - _ObjCBlock25_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock25_closureTrampoline) + .cast(), + _ObjCBlock25_registerClosure(fn)), + lib); void call(NSItemProviderCompletionHandler arg0, ffi.Pointer arg1, ffi.Pointer arg2) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( @@ -47707,10 +47952,10 @@ class ObjCBlock25 { ffi.Pointer<_ObjCBlock> block, NSItemProviderCompletionHandler arg0, ffi.Pointer arg1, - ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } typedef NSItemProviderCompletionHandler = ffi.Pointer<_ObjCBlock>; @@ -48881,7 +49126,7 @@ class NSAttributedString extends NSObject { _lib._sel_enumerateAttributesInRange_options_usingBlock_1, enumerationRange, opts, - block._impl); + block._id); } void enumerateAttribute_inRange_options_usingBlock_( @@ -48895,7 +49140,7 @@ class NSAttributedString extends NSObject { attrName, enumerationRange, opts, - block._impl); + block._id); } NSAttributedString initWithContentsOfMarkdownFileAtURL_options_baseURL_error_( @@ -49108,45 +49353,52 @@ void _ObjCBlock26_closureTrampoline(ffi.Pointer<_ObjCBlock> block, arg0, arg1, arg2); } -class ObjCBlock26 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock26._(this._impl, this._lib); +class ObjCBlock26 extends _ObjCBlockBase { + ObjCBlock26._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock26.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSRange arg1, - ffi.Pointer arg2)>( - _ObjCBlock26_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock26_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock26.fromFunction( - this._lib, + AVFAudio lib, void Function(ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSRange arg1, - ffi.Pointer arg2)>( - _ObjCBlock26_closureTrampoline) - .cast(), - _ObjCBlock26_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock26_closureTrampoline) + .cast(), + _ObjCBlock26_registerClosure(fn)), + lib); void call( ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( @@ -49159,10 +49411,10 @@ class ObjCBlock26 { ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, NSRange arg1, - ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } void _ObjCBlock27_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, @@ -49191,45 +49443,52 @@ void _ObjCBlock27_closureTrampoline(ffi.Pointer<_ObjCBlock> block, arg0, arg1, arg2); } -class ObjCBlock27 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock27._(this._impl, this._lib); +class ObjCBlock27 extends _ObjCBlockBase { + ObjCBlock27._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock27.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSRange arg1, - ffi.Pointer arg2)>( - _ObjCBlock27_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock27_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock27.fromFunction( - this._lib, + AVFAudio lib, void Function(ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSRange arg1, - ffi.Pointer arg2)>( - _ObjCBlock27_closureTrampoline) - .cast(), - _ObjCBlock27_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock27_closureTrampoline) + .cast(), + _ObjCBlock27_registerClosure(fn)), + lib); void call( ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( @@ -49242,10 +49501,10 @@ class ObjCBlock27 { ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, NSRange arg1, - ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } class NSAttributedStringMarkdownParsingOptions extends NSObject { @@ -50939,7 +51198,7 @@ class NSCalendar extends NSObject { start?._id ?? ffi.nullptr, comps?._id ?? ffi.nullptr, opts, - block._impl); + block._id); } NSDate nextDateAfterDate_matchingComponents_options_( @@ -51442,44 +51701,52 @@ void _ObjCBlock28_closureTrampoline(ffi.Pointer<_ObjCBlock> block, arg0, arg1, arg2); } -class ObjCBlock28 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock28._(this._impl, this._lib); +class ObjCBlock28 extends _ObjCBlockBase { + ObjCBlock28._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock28.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, ffi.Pointer arg2)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Bool arg1, - ffi.Pointer arg2)>( - _ObjCBlock28_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock28_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock28.fromFunction( - this._lib, - void Function(ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) + AVFAudio lib, + void Function(ffi.Pointer arg0, bool arg1, + ffi.Pointer arg2) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Bool arg1, - ffi.Pointer arg2)>( - _ObjCBlock28_closureTrampoline) - .cast(), - _ObjCBlock28_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock28_closureTrampoline) + .cast(), + _ObjCBlock28_registerClosure(fn)), + lib); void call( ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( @@ -51492,10 +51759,10 @@ class ObjCBlock28 { ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, bool arg1, - ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } class NSNumberFormatter extends NSFormatter { @@ -53204,7 +53471,7 @@ class NSFileHandle extends NSObject { } set readabilityHandler(ObjCBlock29 value) { - _lib._objc_msgSend_736(_id, _lib._sel_setReadabilityHandler_1, value._impl); + _lib._objc_msgSend_736(_id, _lib._sel_setReadabilityHandler_1, value._id); } ObjCBlock29 get writeabilityHandler { @@ -53213,8 +53480,7 @@ class NSFileHandle extends NSObject { } set writeabilityHandler(ObjCBlock29 value) { - _lib._objc_msgSend_736( - _id, _lib._sel_setWriteabilityHandler_1, value._impl); + _lib._objc_msgSend_736(_id, _lib._sel_setWriteabilityHandler_1, value._id); } NSFileHandle initWithFileDescriptor_(int fd) { @@ -53369,44 +53635,51 @@ void _ObjCBlock29_closureTrampoline( return _ObjCBlock29_closureRegistry[block.ref.target.address]!(arg0); } -class ObjCBlock29 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock29._(this._impl, this._lib); +class ObjCBlock29 extends _ObjCBlockBase { + ObjCBlock29._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock29.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>( - _ObjCBlock29_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock29_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock29.fromFunction( - this._lib, void Function(ffi.Pointer arg0) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>( - _ObjCBlock29_closureTrampoline) - .cast(), - _ObjCBlock29_registerClosure(fn)); + AVFAudio lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock29_closureTrampoline) + .cast(), + _ObjCBlock29_registerClosure(fn)), + lib); void call(ffi.Pointer arg0) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0)>>() .asFunction< void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>()(_impl, arg0); + ffi.Pointer arg0)>()(_id, arg0); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } class NSHTTPCookieStorage extends NSObject { @@ -53515,7 +53788,7 @@ class NSHTTPCookieStorage extends NSObject { _id, _lib._sel_getCookiesForTask_completionHandler_1, task?._id ?? ffi.nullptr, - completionHandler._impl); + completionHandler._id); } static NSHTTPCookieStorage new1(AVFAudio _lib) { @@ -55300,44 +55573,51 @@ void _ObjCBlock30_closureTrampoline( return _ObjCBlock30_closureRegistry[block.ref.target.address]!(arg0); } -class ObjCBlock30 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock30._(this._impl, this._lib); +class ObjCBlock30 extends _ObjCBlockBase { + ObjCBlock30._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock30.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>( - _ObjCBlock30_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock30_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock30.fromFunction( - this._lib, void Function(ffi.Pointer arg0) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>( - _ObjCBlock30_closureTrampoline) - .cast(), - _ObjCBlock30_registerClosure(fn)); + AVFAudio lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock30_closureTrampoline) + .cast(), + _ObjCBlock30_registerClosure(fn)), + lib); void call(ffi.Pointer arg0) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0)>>() .asFunction< void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>()(_impl, arg0); + ffi.Pointer arg0)>()(_id, arg0); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } class NSIndexPath extends NSObject { @@ -56044,12 +56324,12 @@ class NSOperationQueue extends NSObject { void addOperationWithBlock_(ObjCBlock16 block) { return _lib._objc_msgSend_465( - _id, _lib._sel_addOperationWithBlock_1, block._impl); + _id, _lib._sel_addOperationWithBlock_1, block._id); } void addBarrierBlock_(ObjCBlock16 barrier) { return _lib._objc_msgSend_465( - _id, _lib._sel_addBarrierBlock_1, barrier._impl); + _id, _lib._sel_addBarrierBlock_1, barrier._id); } int get maxConcurrentOperationCount { @@ -56302,7 +56582,7 @@ class NSOperation extends NSObject { } set completionBlock(ObjCBlock16 value) { - _lib._objc_msgSend_587(_id, _lib._sel_setCompletionBlock_1, value._impl); + _lib._objc_msgSend_587(_id, _lib._sel_setCompletionBlock_1, value._id); } void waitUntilFinished() { @@ -57066,7 +57346,7 @@ class NSProcessInfo extends NSObject { _lib._sel_performActivityWithOptions_reason_usingBlock_1, options, reason?._id ?? ffi.nullptr, - block._impl); + block._id); } void performExpiringActivityWithReason_usingBlock_( @@ -57075,7 +57355,7 @@ class NSProcessInfo extends NSObject { _id, _lib._sel_performExpiringActivityWithReason_usingBlock_1, reason?._id ?? ffi.nullptr, - block._impl); + block._id); } NSString? get userName { @@ -57228,37 +57508,44 @@ void _ObjCBlock31_closureTrampoline(ffi.Pointer<_ObjCBlock> block, bool arg0) { return _ObjCBlock31_closureRegistry[block.ref.target.address]!(arg0); } -class ObjCBlock31 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock31._(this._impl, this._lib); - ObjCBlock31.fromFunctionPointer(this._lib, +class ObjCBlock31 extends _ObjCBlockBase { + ObjCBlock31._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock31.fromFunctionPointer(AVFAudio lib, ffi.Pointer> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Bool arg0)>(_ObjCBlock31_fnPtrTrampoline) - .cast(), - ptr.cast()); - ObjCBlock31.fromFunction(this._lib, void Function(bool arg0) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Bool arg0)>(_ObjCBlock31_closureTrampoline) - .cast(), - _ObjCBlock31_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Bool arg0)>(_ObjCBlock31_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock31.fromFunction(AVFAudio lib, void Function(bool arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Bool arg0)>(_ObjCBlock31_closureTrampoline) + .cast(), + _ObjCBlock31_registerClosure(fn)), + lib); void call(bool arg0) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( ffi.Pointer<_ObjCBlock> block, ffi.Bool arg0)>>() .asFunction< void Function( - ffi.Pointer<_ObjCBlock> block, bool arg0)>()(_impl, arg0); + ffi.Pointer<_ObjCBlock> block, bool arg0)>()(_id, arg0); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } abstract class NSProcessInfoThermalState { @@ -57737,7 +58024,7 @@ class NSRegularExpression extends NSObject { string?._id ?? ffi.nullptr, options, range, - block._impl); + block._id); } NSArray matchesInString_options_range_( @@ -57950,45 +58237,52 @@ void _ObjCBlock32_closureTrampoline(ffi.Pointer<_ObjCBlock> block, arg0, arg1, arg2); } -class ObjCBlock32 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock32._(this._impl, this._lib); +class ObjCBlock32 extends _ObjCBlockBase { + ObjCBlock32._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock32.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0, ffi.Int32 arg1, ffi.Pointer arg2)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Pointer arg2)>( - _ObjCBlock32_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Pointer arg2)>( + _ObjCBlock32_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock32.fromFunction( - this._lib, + AVFAudio lib, void Function(ffi.Pointer arg0, int arg1, ffi.Pointer arg2) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Pointer arg2)>( - _ObjCBlock32_closureTrampoline) - .cast(), - _ObjCBlock32_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Pointer arg2)>( + _ObjCBlock32_closureTrampoline) + .cast(), + _ObjCBlock32_registerClosure(fn)), + lib); void call( ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( @@ -58001,10 +58295,10 @@ class ObjCBlock32 { ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1, - ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } abstract class NSMatchingFlags { @@ -58142,7 +58436,7 @@ class NSURLCache extends NSObject { _id, _lib._sel_getCachedResponseForDataTask_completionHandler_1, dataTask?._id ?? ffi.nullptr, - completionHandler._impl); + completionHandler._id); } void removeCachedResponseForDataTask_(NSURLSessionDataTask? dataTask) { @@ -58519,44 +58813,51 @@ void _ObjCBlock33_closureTrampoline( return _ObjCBlock33_closureRegistry[block.ref.target.address]!(arg0); } -class ObjCBlock33 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock33._(this._impl, this._lib); +class ObjCBlock33 extends _ObjCBlockBase { + ObjCBlock33._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock33.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>( - _ObjCBlock33_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock33_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock33.fromFunction( - this._lib, void Function(ffi.Pointer arg0) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>( - _ObjCBlock33_closureTrampoline) - .cast(), - _ObjCBlock33_registerClosure(fn)); + AVFAudio lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock33_closureTrampoline) + .cast(), + _ObjCBlock33_registerClosure(fn)), + lib); void call(ffi.Pointer arg0) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0)>>() .asFunction< void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>()(_impl, arg0); + ffi.Pointer arg0)>()(_id, arg0); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } class NSURLConnection extends NSObject { @@ -58680,7 +58981,7 @@ class NSURLConnection extends NSObject { _lib._sel_sendAsynchronousRequest_queue_completionHandler_1, request?._id ?? ffi.nullptr, queue?._id ?? ffi.nullptr, - handler._impl); + handler._id); } static NSURLConnection new1(AVFAudio _lib) { @@ -58799,12 +59100,13 @@ void _ObjCBlock34_closureTrampoline( arg0, arg1, arg2); } -class ObjCBlock34 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock34._(this._impl, this._lib); +class ObjCBlock34 extends _ObjCBlockBase { + ObjCBlock34._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock34.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -58812,34 +59114,40 @@ class ObjCBlock34 { ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>( - _ObjCBlock34_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock34_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock34.fromFunction( - this._lib, + AVFAudio lib, void Function(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>( - _ObjCBlock34_closureTrampoline) - .cast(), - _ObjCBlock34_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock34_closureTrampoline) + .cast(), + _ObjCBlock34_registerClosure(fn)), + lib); void call(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( @@ -58852,10 +59160,10 @@ class ObjCBlock34 { ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } class NSURLCredential extends NSObject { @@ -59365,7 +59673,7 @@ class NSURLCredentialStorage extends NSObject { _lib._sel_getCredentialsForProtectionSpace_task_completionHandler_1, protectionSpace?._id ?? ffi.nullptr, task?._id ?? ffi.nullptr, - completionHandler._impl); + completionHandler._id); } void setCredential_forProtectionSpace_task_(NSURLCredential? credential, @@ -59401,7 +59709,7 @@ class NSURLCredentialStorage extends NSObject { _lib._sel_getDefaultCredentialForProtectionSpace_task_completionHandler_1, space?._id ?? ffi.nullptr, task?._id ?? ffi.nullptr, - completionHandler._impl); + completionHandler._id); } void setDefaultCredential_forProtectionSpace_task_( @@ -59517,44 +59825,51 @@ void _ObjCBlock35_closureTrampoline( return _ObjCBlock35_closureRegistry[block.ref.target.address]!(arg0); } -class ObjCBlock35 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock35._(this._impl, this._lib); +class ObjCBlock35 extends _ObjCBlockBase { + ObjCBlock35._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock35.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>( - _ObjCBlock35_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock35_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock35.fromFunction( - this._lib, void Function(ffi.Pointer arg0) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>( - _ObjCBlock35_closureTrampoline) - .cast(), - _ObjCBlock35_registerClosure(fn)); + AVFAudio lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock35_closureTrampoline) + .cast(), + _ObjCBlock35_registerClosure(fn)), + lib); void call(ffi.Pointer arg0) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0)>>() .asFunction< void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>()(_impl, arg0); + ffi.Pointer arg0)>()(_id, arg0); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } void _ObjCBlock36_fnPtrTrampoline( @@ -59578,44 +59893,51 @@ void _ObjCBlock36_closureTrampoline( return _ObjCBlock36_closureRegistry[block.ref.target.address]!(arg0); } -class ObjCBlock36 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock36._(this._impl, this._lib); +class ObjCBlock36 extends _ObjCBlockBase { + ObjCBlock36._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock36.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>( - _ObjCBlock36_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock36_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock36.fromFunction( - this._lib, void Function(ffi.Pointer arg0) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>( - _ObjCBlock36_closureTrampoline) - .cast(), - _ObjCBlock36_registerClosure(fn)); + AVFAudio lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock36_closureTrampoline) + .cast(), + _ObjCBlock36_registerClosure(fn)), + lib); void call(ffi.Pointer arg0) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0)>>() .asFunction< void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>()(_impl, arg0); + ffi.Pointer arg0)>()(_id, arg0); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } class NSURLProtocol extends NSObject { @@ -60817,22 +61139,22 @@ class NSURLSession extends NSObject { void resetWithCompletionHandler_(ObjCBlock16 completionHandler) { return _lib._objc_msgSend_465( - _id, _lib._sel_resetWithCompletionHandler_1, completionHandler._impl); + _id, _lib._sel_resetWithCompletionHandler_1, completionHandler._id); } void flushWithCompletionHandler_(ObjCBlock16 completionHandler) { return _lib._objc_msgSend_465( - _id, _lib._sel_flushWithCompletionHandler_1, completionHandler._impl); + _id, _lib._sel_flushWithCompletionHandler_1, completionHandler._id); } void getTasksWithCompletionHandler_(ObjCBlock37 completionHandler) { - return _lib._objc_msgSend_923(_id, - _lib._sel_getTasksWithCompletionHandler_1, completionHandler._impl); + return _lib._objc_msgSend_923( + _id, _lib._sel_getTasksWithCompletionHandler_1, completionHandler._id); } void getAllTasksWithCompletionHandler_(ObjCBlock30 completionHandler) { return _lib._objc_msgSend_924(_id, - _lib._sel_getAllTasksWithCompletionHandler_1, completionHandler._impl); + _lib._sel_getAllTasksWithCompletionHandler_1, completionHandler._id); } NSURLSessionDataTask dataTaskWithRequest_(NSURLRequest? request) { @@ -60947,7 +61269,7 @@ class NSURLSession extends NSObject { _id, _lib._sel_dataTaskWithRequest_completionHandler_1, request?._id ?? ffi.nullptr, - completionHandler._impl); + completionHandler._id); return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); } @@ -60957,7 +61279,7 @@ class NSURLSession extends NSObject { _id, _lib._sel_dataTaskWithURL_completionHandler_1, url?._id ?? ffi.nullptr, - completionHandler._impl); + completionHandler._id); return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); } @@ -60968,7 +61290,7 @@ class NSURLSession extends NSObject { _lib._sel_uploadTaskWithRequest_fromFile_completionHandler_1, request?._id ?? ffi.nullptr, fileURL?._id ?? ffi.nullptr, - completionHandler._impl); + completionHandler._id); return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); } @@ -60979,7 +61301,7 @@ class NSURLSession extends NSObject { _lib._sel_uploadTaskWithRequest_fromData_completionHandler_1, request?._id ?? ffi.nullptr, bodyData?._id ?? ffi.nullptr, - completionHandler._impl); + completionHandler._id); return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); } @@ -60989,7 +61311,7 @@ class NSURLSession extends NSObject { _id, _lib._sel_downloadTaskWithRequest_completionHandler_1, request?._id ?? ffi.nullptr, - completionHandler._impl); + completionHandler._id); return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); } @@ -60999,7 +61321,7 @@ class NSURLSession extends NSObject { _id, _lib._sel_downloadTaskWithURL_completionHandler_1, url?._id ?? ffi.nullptr, - completionHandler._impl); + completionHandler._id); return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); } @@ -61009,7 +61331,7 @@ class NSURLSession extends NSObject { _id, _lib._sel_downloadTaskWithResumeData_completionHandler_1, resumeData?._id ?? ffi.nullptr, - completionHandler._impl); + completionHandler._id); return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); } @@ -61572,12 +61894,13 @@ void _ObjCBlock37_closureTrampoline( arg0, arg1, arg2); } -class ObjCBlock37 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock37._(this._impl, this._lib); +class ObjCBlock37 extends _ObjCBlockBase { + ObjCBlock37._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock37.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -61585,34 +61908,40 @@ class ObjCBlock37 { ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>( - _ObjCBlock37_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock37_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock37.fromFunction( - this._lib, + AVFAudio lib, void Function(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>( - _ObjCBlock37_closureTrampoline) - .cast(), - _ObjCBlock37_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock37_closureTrampoline) + .cast(), + _ObjCBlock37_registerClosure(fn)), + lib); void call(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( @@ -61625,10 +61954,10 @@ class ObjCBlock37 { ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } class NSURLSessionUploadTask extends NSURLSessionDataTask { @@ -61769,7 +62098,7 @@ class NSURLSessionDownloadTask extends NSURLSessionTask { void cancelByProducingResumeData_(ObjCBlock38 completionHandler) { return _lib._objc_msgSend_930( - _id, _lib._sel_cancelByProducingResumeData_1, completionHandler._impl); + _id, _lib._sel_cancelByProducingResumeData_1, completionHandler._id); } @override @@ -61879,44 +62208,51 @@ void _ObjCBlock38_closureTrampoline( return _ObjCBlock38_closureRegistry[block.ref.target.address]!(arg0); } -class ObjCBlock38 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock38._(this._impl, this._lib); +class ObjCBlock38 extends _ObjCBlockBase { + ObjCBlock38._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock38.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>( - _ObjCBlock38_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock38_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock38.fromFunction( - this._lib, void Function(ffi.Pointer arg0) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>( - _ObjCBlock38_closureTrampoline) - .cast(), - _ObjCBlock38_registerClosure(fn)); + AVFAudio lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock38_closureTrampoline) + .cast(), + _ObjCBlock38_registerClosure(fn)), + lib); void call(ffi.Pointer arg0) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0)>>() .asFunction< void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>()(_impl, arg0); + ffi.Pointer arg0)>()(_id, arg0); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } class NSURLSessionStreamTask extends NSURLSessionTask { @@ -61952,7 +62288,7 @@ class NSURLSessionStreamTask extends NSURLSessionTask { minBytes, maxBytes, timeout, - completionHandler._impl); + completionHandler._id); } void writeData_timeout_completionHandler_( @@ -61962,7 +62298,7 @@ class NSURLSessionStreamTask extends NSURLSessionTask { _lib._sel_writeData_timeout_completionHandler_1, data?._id ?? ffi.nullptr, timeout, - completionHandler._impl); + completionHandler._id); } void captureStreams() { @@ -62097,45 +62433,52 @@ void _ObjCBlock39_closureTrampoline(ffi.Pointer<_ObjCBlock> block, arg0, arg1, arg2); } -class ObjCBlock39 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock39._(this._impl, this._lib); +class ObjCBlock39 extends _ObjCBlockBase { + ObjCBlock39._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock39.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, ffi.Pointer arg2)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Bool arg1, - ffi.Pointer arg2)>( - _ObjCBlock39_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock39_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock39.fromFunction( - this._lib, + AVFAudio lib, void Function(ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Bool arg1, - ffi.Pointer arg2)>( - _ObjCBlock39_closureTrampoline) - .cast(), - _ObjCBlock39_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock39_closureTrampoline) + .cast(), + _ObjCBlock39_registerClosure(fn)), + lib); void call( ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( @@ -62148,10 +62491,10 @@ class ObjCBlock39 { ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, bool arg1, - ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } class NSNetService extends NSObject { @@ -62446,19 +62789,17 @@ class NSURLSessionWebSocketTask extends NSURLSessionTask { _id, _lib._sel_sendMessage_completionHandler_1, message?._id ?? ffi.nullptr, - completionHandler._impl); + completionHandler._id); } void receiveMessageWithCompletionHandler_(ObjCBlock40 completionHandler) { - return _lib._objc_msgSend_945( - _id, - _lib._sel_receiveMessageWithCompletionHandler_1, - completionHandler._impl); + return _lib._objc_msgSend_945(_id, + _lib._sel_receiveMessageWithCompletionHandler_1, completionHandler._id); } void sendPingWithPongReceiveHandler_(ObjCBlock15 pongReceiveHandler) { return _lib._objc_msgSend_946(_id, - _lib._sel_sendPingWithPongReceiveHandler_1, pongReceiveHandler._impl); + _lib._sel_sendPingWithPongReceiveHandler_1, pongReceiveHandler._id); } void cancelWithCloseCode_reason_(int closeCode, NSData? reason) { @@ -62751,19 +63092,20 @@ void _ObjCBlock40_closureTrampoline(ffi.Pointer<_ObjCBlock> block, return _ObjCBlock40_closureRegistry[block.ref.target.address]!(arg0, arg1); } -class ObjCBlock40 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock40._(this._impl, this._lib); +class ObjCBlock40 extends _ObjCBlockBase { + ObjCBlock40._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock40.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) - : _impl = - _lib._newBlock1( + : this._( + lib._newBlock1( ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer<_ObjCBlock> block, @@ -62771,22 +63113,27 @@ class ObjCBlock40 { ffi.Pointer arg1)>( _ObjCBlock40_fnPtrTrampoline) .cast(), - ptr.cast()); + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock40.fromFunction( - this._lib, + AVFAudio lib, void Function(ffi.Pointer arg0, ffi.Pointer arg1) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock40_closureTrampoline) - .cast(), - _ObjCBlock40_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock40_closureTrampoline) + .cast(), + _ObjCBlock40_registerClosure(fn)), + lib); void call(ffi.Pointer arg0, ffi.Pointer arg1) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( @@ -62797,10 +63144,10 @@ class ObjCBlock40 { void Function( ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, - ffi.Pointer arg1)>()(_impl, arg0, arg1); + ffi.Pointer arg1)>()(_id, arg0, arg1); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } abstract class NSURLSessionWebSocketCloseCode { @@ -62856,12 +63203,13 @@ void _ObjCBlock41_closureTrampoline( arg0, arg1, arg2); } -class ObjCBlock41 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock41._(this._impl, this._lib); +class ObjCBlock41 extends _ObjCBlockBase { + ObjCBlock41._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock41.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -62869,34 +63217,40 @@ class ObjCBlock41 { ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>( - _ObjCBlock41_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock41_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock41.fromFunction( - this._lib, + AVFAudio lib, void Function(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>( - _ObjCBlock41_closureTrampoline) - .cast(), - _ObjCBlock41_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock41_closureTrampoline) + .cast(), + _ObjCBlock41_registerClosure(fn)), + lib); void call(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( @@ -62909,10 +63263,10 @@ class ObjCBlock41 { ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } void _ObjCBlock42_fnPtrTrampoline( @@ -62951,12 +63305,13 @@ void _ObjCBlock42_closureTrampoline( arg0, arg1, arg2); } -class ObjCBlock42 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock42._(this._impl, this._lib); +class ObjCBlock42 extends _ObjCBlockBase { + ObjCBlock42._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock42.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -62964,34 +63319,40 @@ class ObjCBlock42 { ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>( - _ObjCBlock42_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock42_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock42.fromFunction( - this._lib, + AVFAudio lib, void Function(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>( - _ObjCBlock42_closureTrampoline) - .cast(), - _ObjCBlock42_registerClosure(fn)); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock42_closureTrampoline) + .cast(), + _ObjCBlock42_registerClosure(fn)), + lib); void call(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( @@ -63004,10 +63365,10 @@ class ObjCBlock42 { ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2)>()(_impl, arg0, arg1, arg2); + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } class NSProtocolChecker extends NSProxy { @@ -63226,7 +63587,7 @@ class NSTask extends NSObject { } set terminationHandler(ObjCBlock43 value) { - _lib._objc_msgSend_963(_id, _lib._sel_setTerminationHandler_1, value._impl); + _lib._objc_msgSend_963(_id, _lib._sel_setTerminationHandler_1, value._id); } int get qualityOfService { @@ -63250,7 +63611,7 @@ class NSTask extends NSObject { url?._id ?? ffi.nullptr, arguments?._id ?? ffi.nullptr, error, - terminationHandler._impl); + terminationHandler._id); return NSTask._(_ret, _lib, retain: true, release: true); } @@ -63400,44 +63761,51 @@ void _ObjCBlock43_closureTrampoline( return _ObjCBlock43_closureRegistry[block.ref.target.address]!(arg0); } -class ObjCBlock43 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock43._(this._impl, this._lib); +class ObjCBlock43 extends _ObjCBlockBase { + ObjCBlock43._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock43.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>( - _ObjCBlock43_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock43_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock43.fromFunction( - this._lib, void Function(ffi.Pointer arg0) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>( - _ObjCBlock43_closureTrampoline) - .cast(), - _ObjCBlock43_registerClosure(fn)); + AVFAudio lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock43_closureTrampoline) + .cast(), + _ObjCBlock43_registerClosure(fn)), + lib); void call(ffi.Pointer arg0) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0)>>() .asFunction< void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>()(_impl, arg0); + ffi.Pointer arg0)>()(_id, arg0); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } class NSXMLElement extends NSXMLNode { @@ -65581,7 +65949,7 @@ class AVAudioSession extends NSObject { void requestRecordPermission_(ObjCBlock31 response) { return _lib._objc_msgSend_1009( - _id, _lib._sel_requestRecordPermission_1, response._impl); + _id, _lib._sel_requestRecordPermission_1, response._id); } bool overrideOutputAudioPort_error_( @@ -65636,7 +66004,7 @@ class AVAudioSession extends NSObject { _id, _lib._sel_activateWithOptions_completionHandler_1, options, - handler._impl); + handler._id); } bool setPreferredSampleRate_error_( @@ -66377,45 +66745,52 @@ void _ObjCBlock44_closureTrampoline( return _ObjCBlock44_closureRegistry[block.ref.target.address]!(arg0, arg1); } -class ObjCBlock44 { - final ffi.Pointer<_ObjCBlock> _impl; - final AVFAudio _lib; - ObjCBlock44._(this._impl, this._lib); +class ObjCBlock44 extends _ObjCBlockBase { + ObjCBlock44._(ffi.Pointer<_ObjCBlock> id, AVFAudio lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. ObjCBlock44.fromFunctionPointer( - this._lib, + AVFAudio lib, ffi.Pointer< ffi.NativeFunction< ffi.Void Function( ffi.Bool arg0, ffi.Pointer arg1)>> ptr) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Bool arg0, ffi.Pointer arg1)>( - _ObjCBlock44_fnPtrTrampoline) - .cast(), - ptr.cast()); + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Bool arg0, ffi.Pointer arg1)>( + _ObjCBlock44_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. ObjCBlock44.fromFunction( - this._lib, void Function(bool arg0, ffi.Pointer arg1) fn) - : _impl = _lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Bool arg0, ffi.Pointer arg1)>( - _ObjCBlock44_closureTrampoline) - .cast(), - _ObjCBlock44_registerClosure(fn)); + AVFAudio lib, void Function(bool arg0, ffi.Pointer arg1) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Bool arg0, ffi.Pointer arg1)>( + _ObjCBlock44_closureTrampoline) + .cast(), + _ObjCBlock44_registerClosure(fn)), + lib); void call(bool arg0, ffi.Pointer arg1) { - return _impl.ref.invoke + return _id.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_ObjCBlock> block, ffi.Bool arg0, ffi.Pointer arg1)>>() .asFunction< void Function(ffi.Pointer<_ObjCBlock> block, bool arg0, - ffi.Pointer arg1)>()(_impl, arg0, arg1); + ffi.Pointer arg1)>()(_id, arg0, arg1); } - ffi.Pointer<_ObjCBlock> get pointer => _impl; + ffi.Pointer<_ObjCBlock> get pointer => _id; } abstract class AVAudioStereoOrientation { diff --git a/pkgs/ffigen/example/objective_c/pubspec.yaml b/pkgs/ffigen/example/objective_c/pubspec.yaml index 60fe25378c..239fcdcc7b 100644 --- a/pkgs/ffigen/example/objective_c/pubspec.yaml +++ b/pkgs/ffigen/example/objective_c/pubspec.yaml @@ -19,27 +19,7 @@ ffigen: description: Bindings for AVFAudio. language: objc output: 'avf_audio_bindings.dart' - functions: - exclude: - - '.*' - structs: - exclude: - - '.*' - unions: - exclude: - - '.*' - globals: - exclude: - - '.*' - macros: - exclude: - - '.*' - enums: - exclude: - - '.*' - unnamed-enums: - exclude: - - '.*' + exclude-all-by-default: true objc-interfaces: include: - 'AVAudioPlayer' diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index e9d1f97d9e..de609978fa 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -75,6 +75,11 @@ class Config { Declaration get objcInterfaces => _objcInterfaces; late Declaration _objcInterfaces; + /// If enabled, the default behavior of all declaration filters is to exclude + /// everything, rather than include everything. + bool get excludeAllByDefault => _excludeAllByDefault; + late bool _excludeAllByDefault; + /// If generated bindings should be sorted alphabetically. bool get sort => _sort; late bool _sort; @@ -83,7 +88,8 @@ class Config { bool get useSupportedTypedefs => _useSupportedTypedefs; late bool _useSupportedTypedefs; - /// Stores all the library imports specified by user including those for ffi and pkg_ffi. + /// Stores all the library imports specified by user including those for ffi + /// and pkg_ffi. Map get libraryImports => _libraryImports; late Map _libraryImports; @@ -383,6 +389,14 @@ class Config { result as Map>, _libraryImports); }, ), + [strings.excludeAllByDefault]: Specification( + requirement: Requirement.no, + validator: booleanValidator, + extractor: booleanExtractor, + defaultValue: () => false, + extractedResult: (dynamic result) => + _excludeAllByDefault = result as bool, + ), [strings.sort]: Specification( requirement: Requirement.no, validator: booleanValidator, diff --git a/pkgs/ffigen/lib/src/config_provider/config_types.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart index 6ba4f4e5b8..f6029768c8 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_types.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart @@ -156,7 +156,8 @@ class Declaration { _memberRenamer.rename(declaration, member); /// Checks if a name is allowed by a filter. - bool shouldInclude(String name) => _includer.shouldInclude(name); + bool shouldInclude(String name, bool excludeAllByDefault) => + _includer.shouldInclude(name, excludeAllByDefault); /// Checks if the symbol address should be included for this name. bool shouldIncludeSymbolAddress(String name) => @@ -235,7 +236,7 @@ class Includer { /// Returns true if [name] is allowed. /// /// Exclude overrides include. - bool shouldInclude(String name) { + bool shouldInclude(String name, [bool excludeAllByDefault = false]) { if (_excludeFull.contains(name)) { return false; } @@ -261,7 +262,8 @@ class Includer { if (_includeMatchers.isNotEmpty || _includeFull.isNotEmpty) { return false; } else { - return true; + // Otherwise, fall back to the default behavior for empty filters. + return !excludeAllByDefault; } } } diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart index a9041a6123..6bc0d122bc 100644 --- a/pkgs/ffigen/lib/src/header_parser/includer.dart +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -9,11 +9,14 @@ import '../config_provider/config_types.dart'; import '../strings.dart' as strings; import 'data.dart'; -bool _shouldIncludeDecl(String usr, String name, - bool Function(String) isSeenDecl, bool Function(String) configIncludes) { +bool _shouldIncludeDecl( + String usr, + String name, + bool Function(String) isSeenDecl, + bool Function(String, bool) configIncludes) { if (isSeenDecl(usr) || name == '') { return false; - } else if (configIncludes(name)) { + } else if (configIncludes(name, config.excludeAllByDefault)) { return true; } else { return false; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart index 988a45e39b..22767ed872 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart @@ -34,11 +34,12 @@ final _logger = Logger('ffigen.header_parser.typedefdecl_parser'); /// by the config. Typealias? parseTypedefDeclaration( clang_types.CXCursor cursor, { + bool ignoreFilter = false, bool pointerReference = false, }) { final typedefName = cursor.spelling(); final typedefUsr = cursor.usr(); - if (shouldIncludeTypealias(typedefUsr, typedefName)) { + if (ignoreFilter || shouldIncludeTypealias(typedefUsr, typedefName)) { final ct = clang.clang_getTypedefDeclUnderlyingType(cursor); final s = getCodeGenType(ct, pointerReference: pointerReference); diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 31420cdc69..7e62d7879f 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -192,8 +192,8 @@ _CreateTypeFromCursorResult _createTypeFromCursor(clang_types.CXType cxtype, } } - final typealias = - parseTypedefDeclaration(cursor, pointerReference: pointerReference); + final typealias = parseTypedefDeclaration(cursor, + ignoreFilter: ignoreFilter, pointerReference: pointerReference); if (typealias != null) { return _CreateTypeFromCursorResult(typealias); diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index f2603d3dbf..8094df182a 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -74,6 +74,8 @@ const macros = 'macros'; const typedefs = 'typedefs'; const objcInterfaces = 'objc-interfaces'; +const excludeAllByDefault = 'exclude-all-by-default'; + // Sub-fields of Declarations. const include = 'include'; const exclude = 'exclude'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index dff502390b..d46f5fdc43 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 6.0.2 +version: 6.1.0 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen diff --git a/pkgs/ffigen/test/config_tests/exclude_all_by_default.h b/pkgs/ffigen/test/config_tests/exclude_all_by_default.h new file mode 100644 index 0000000000..e45634a478 --- /dev/null +++ b/pkgs/ffigen/test/config_tests/exclude_all_by_default.h @@ -0,0 +1,25 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +void func(); + +struct Struct { + int a; +}; + +union Union { + int a; +}; + +int global; + +#define MACRO 123 + +enum Enum { + zero = 0, +}; + +enum { + unnamedEnum = 123, +}; diff --git a/pkgs/ffigen/test/config_tests/exclude_all_by_default_test.dart b/pkgs/ffigen/test/config_tests/exclude_all_by_default_test.dart new file mode 100644 index 0000000000..40bf1b29b4 --- /dev/null +++ b/pkgs/ffigen/test/config_tests/exclude_all_by_default_test.dart @@ -0,0 +1,57 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/ffigen.dart'; +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; + +import '../test_utils.dart'; + +void main() { + group('exclude_all_by_default', () { + test('exclude_all_by_default test flag false', () { + final config = Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'exclude_all_by_default test' +${strings.output}: 'unused' +${strings.excludeAllByDefault}: false +${strings.headers}: + ${strings.entryPoints}: + - 'test/config_tests/exclude_all_by_default.h' +''') as yaml.YamlMap); + + final library = parse(config); + expect(library.getBinding('func'), isA()); + expect(library.getBinding('Struct'), isA()); + expect(library.getBinding('Union'), isA()); + expect(library.getBinding('global'), isA()); + expect(library.getBinding('MACRO'), isA()); + expect(library.getBinding('Enum'), isA()); + expect(library.getBinding('unnamedEnum'), isA()); + }); + + test('exclude_all_by_default test flag true', () { + final config = Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'exclude_all_by_default test' +${strings.output}: 'unused' +${strings.excludeAllByDefault}: true +${strings.headers}: + ${strings.entryPoints}: + - 'test/config_tests/exclude_all_by_default.h' +''') as yaml.YamlMap); + + final library = parse(config); + expect(() => library.getBinding('func'), throwsException); + expect(() => library.getBinding('Struct'), throwsException); + expect(() => library.getBinding('Union'), throwsException); + expect(() => library.getBinding('global'), throwsException); + expect(() => library.getBinding('MACRO'), throwsException); + expect(() => library.getBinding('Enum'), throwsException); + expect(() => library.getBinding('unnamedEnum'), throwsException); + }); + }); +} diff --git a/pkgs/ffigen/test/native_objc_test/automated_ref_count_config.yaml b/pkgs/ffigen/test/native_objc_test/automated_ref_count_config.yaml index bc4982efd3..8884260d0b 100644 --- a/pkgs/ffigen/test/native_objc_test/automated_ref_count_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/automated_ref_count_config.yaml @@ -2,10 +2,15 @@ name: AutomatedRefCountTestObjCLibrary description: 'Tests automatic reference counting of Objective-C objects' language: objc output: 'test/native_objc_test/automated_ref_count_bindings.dart' +exclude-all-by-default: true functions: include: - createAutoreleasePool - destroyAutoreleasePool +objc-interfaces: + include: + - ArcTestObject + - RefCounted headers: entry-points: - 'test/native_objc_test/automated_ref_count_test.m' diff --git a/pkgs/ffigen/test/native_objc_test/bad_method_config.yaml b/pkgs/ffigen/test/native_objc_test/bad_method_config.yaml index d26ff79c56..fa71887544 100644 --- a/pkgs/ffigen/test/native_objc_test/bad_method_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/bad_method_config.yaml @@ -10,12 +10,10 @@ name: NativeObjCLibrary description: 'Native Objective C test' language: objc output: 'test/native_objc_test/bad_method_test_bindings.dart' +exclude-all-by-default: true objc-interfaces: include: - 'BadMethodTestObject' -functions: - exclude: - - '.*' headers: entry-points: - 'test/native_objc_test/bad_method_test.m' diff --git a/pkgs/ffigen/test/native_objc_test/block_config.yaml b/pkgs/ffigen/test/native_objc_test/block_config.yaml index 38316c2be9..3ea866d70f 100644 --- a/pkgs/ffigen/test/native_objc_test/block_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/block_config.yaml @@ -2,9 +2,10 @@ name: BlockTestObjCLibrary description: 'Tests calling Objective-C blocks' language: objc output: 'test/native_objc_test/block_bindings.dart' -functions: - exclude: - - '.*' +exclude-all-by-default: true +objc-interfaces: + include: + - BlockTester headers: entry-points: - 'test/native_objc_test/block_test.m' diff --git a/pkgs/ffigen/test/native_objc_test/cast_config.yaml b/pkgs/ffigen/test/native_objc_test/cast_config.yaml index c080359058..da7ecb368b 100644 --- a/pkgs/ffigen/test/native_objc_test/cast_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/cast_config.yaml @@ -2,9 +2,10 @@ name: CastTestObjCLibrary description: 'Tests casting objects' language: objc output: 'test/native_objc_test/cast_bindings.dart' -functions: - exclude: - - '.*' +exclude-all-by-default: true +objc-interfaces: + include: + - Castaway headers: entry-points: - 'test/native_objc_test/cast_test.m' diff --git a/pkgs/ffigen/test/native_objc_test/category_config.yaml b/pkgs/ffigen/test/native_objc_test/category_config.yaml index 92afb061e2..f70b10af39 100644 --- a/pkgs/ffigen/test/native_objc_test/category_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/category_config.yaml @@ -2,9 +2,10 @@ name: CategoryTestObjCLibrary description: 'Tests handling Objective-C categories' language: objc output: 'test/native_objc_test/category_bindings.dart' -functions: - exclude: - - '.*' +exclude-all-by-default: true +objc-interfaces: + include: + - Thing headers: entry-points: - 'test/native_objc_test/category_test.m' diff --git a/pkgs/ffigen/test/native_objc_test/failed_to_load_config.yaml b/pkgs/ffigen/test/native_objc_test/failed_to_load_config.yaml index 2d114a1c84..11ddbb9133 100644 --- a/pkgs/ffigen/test/native_objc_test/failed_to_load_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/failed_to_load_config.yaml @@ -2,9 +2,10 @@ name: FailedToLoadTestObjCLibrary description: 'Tests failing to load an Objective-C library' language: objc output: 'test/native_objc_test/failed_to_load_bindings.dart' -functions: - exclude: - - '.*' +exclude-all-by-default: true +objc-interfaces: + include: + - ClassThatWillFailToLoad headers: entry-points: - 'test/native_objc_test/failed_to_load_test.m' diff --git a/pkgs/ffigen/test/native_objc_test/forward_decl_config.yaml b/pkgs/ffigen/test/native_objc_test/forward_decl_config.yaml index 73b0aee095..2ccb3f64ba 100644 --- a/pkgs/ffigen/test/native_objc_test/forward_decl_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/forward_decl_config.yaml @@ -2,9 +2,10 @@ name: ForwardDeclTestObjCLibrary description: 'Test that forward declared ObjC classes are correctly filled' language: objc output: 'test/native_objc_test/forward_decl_bindings.dart' -functions: - exclude: - - '.*' +exclude-all-by-default: true +objc-interfaces: + include: + - ForwardDeclaredClass headers: entry-points: - 'test/native_objc_test/forward_decl_test.h' diff --git a/pkgs/ffigen/test/native_objc_test/is_instance_config.yaml b/pkgs/ffigen/test/native_objc_test/is_instance_config.yaml index 90ca44b76e..647ff04439 100644 --- a/pkgs/ffigen/test/native_objc_test/is_instance_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/is_instance_config.yaml @@ -2,9 +2,11 @@ name: IsInstanceTestObjCLibrary description: 'Tests isInstance' language: objc output: 'test/native_objc_test/is_instance_bindings.dart' -functions: - exclude: - - '.*' +exclude-all-by-default: true +objc-interfaces: + include: + - ChildClass + - UnrelatedClass headers: entry-points: - 'test/native_objc_test/is_instance_test.m' diff --git a/pkgs/ffigen/test/native_objc_test/method_config.yaml b/pkgs/ffigen/test/native_objc_test/method_config.yaml index 0f68e597a4..b841187ccc 100644 --- a/pkgs/ffigen/test/native_objc_test/method_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/method_config.yaml @@ -2,9 +2,10 @@ name: MethodTestObjCLibrary description: 'Tests calling Objective-C methods' language: objc output: 'test/native_objc_test/method_bindings.dart' -functions: - exclude: - - '.*' +exclude-all-by-default: true +objc-interfaces: + include: + - MethodInterface headers: entry-points: - 'test/native_objc_test/method_test.m' diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_config.yaml b/pkgs/ffigen/test/native_objc_test/native_objc_config.yaml index c111fca32d..89a4943956 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/native_objc_config.yaml @@ -10,13 +10,10 @@ name: NativeObjCLibrary description: 'Native Objective C test' language: objc output: 'test/native_objc_test/native_objc_test_bindings.dart' +exclude-all-by-default: true objc-interfaces: include: - - 'Foo' - - 'StringUtil' -functions: - exclude: - - '.*' + - Foo headers: entry-points: - 'test/native_objc_test/native_objc_test.m' diff --git a/pkgs/ffigen/test/native_objc_test/nullable_config.yaml b/pkgs/ffigen/test/native_objc_test/nullable_config.yaml index 1d59062875..58de440e95 100644 --- a/pkgs/ffigen/test/native_objc_test/nullable_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/nullable_config.yaml @@ -2,9 +2,10 @@ name: NullableTestObjCLibrary description: 'Tests calling Objective-C methods' language: objc output: 'test/native_objc_test/nullable_bindings.dart' -functions: - exclude: - - '.*' +exclude-all-by-default: true +objc-interfaces: + include: + - NullableInterface headers: entry-points: - 'test/native_objc_test/nullable_test.m' diff --git a/pkgs/ffigen/test/native_objc_test/property_config.yaml b/pkgs/ffigen/test/native_objc_test/property_config.yaml index 5caaad215e..ee3081553c 100644 --- a/pkgs/ffigen/test/native_objc_test/property_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/property_config.yaml @@ -2,9 +2,10 @@ name: PropertyTestObjCLibrary description: 'Tests calling Objective-C properties i.e. getters and setters' language: objc output: 'test/native_objc_test/property_bindings.dart' -functions: - exclude: - - '.*' +exclude-all-by-default: true +objc-interfaces: + include: + - PropertyInterface headers: entry-points: - 'test/native_objc_test/property_test.m' diff --git a/pkgs/ffigen/test/native_objc_test/rename_config.yaml b/pkgs/ffigen/test/native_objc_test/rename_config.yaml index 1de0786e44..1d0b98acb7 100644 --- a/pkgs/ffigen/test/native_objc_test/rename_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/rename_config.yaml @@ -10,12 +10,12 @@ name: RenameLibrary description: 'Rename test' language: objc output: 'test/native_objc_test/rename_test_bindings.dart' +exclude-all-by-default: true objc-interfaces: + include: + - _Renamed rename: '_(.*)': '$1' -functions: - exclude: - - '.*' headers: entry-points: - 'test/native_objc_test/rename_test.m' diff --git a/pkgs/ffigen/test/native_objc_test/string_config.yaml b/pkgs/ffigen/test/native_objc_test/string_config.yaml index 9f387a95b2..55110a39f5 100644 --- a/pkgs/ffigen/test/native_objc_test/string_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/string_config.yaml @@ -2,9 +2,10 @@ name: StringTestObjCLibrary description: 'Tests calling Objective-C string methods' language: objc output: 'test/native_objc_test/string_bindings.dart' -functions: - exclude: - - '.*' +exclude-all-by-default: true +objc-interfaces: + include: + - StringUtil headers: entry-points: - 'test/native_objc_test/string_test.m' From f28313b2bd3508dde0343509f4a5f7f0613f4f3c Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Mon, 8 Aug 2022 12:41:47 -0700 Subject: [PATCH 172/276] [ffigen] Add an objective-C module prefix option (#438) * Add an objective-C module prefix option * Fix analysis * Update readme * Update readme again --- pkgs/ffigen/README.md | 77 ++++++++++++++++++- .../src/code_generator/objc_interface.dart | 4 +- .../lib/src/config_provider/config.dart | 13 ++++ .../lib/src/config_provider/config_types.dart | 29 +++++++ .../lib/src/config_provider/spec_utils.dart | 23 ++++++ .../sub_parsers/objcinterfacedecl_parser.dart | 1 + pkgs/ffigen/lib/src/strings.dart | 3 + pkgs/ffigen/test/native_objc_test/.gitignore | 1 + pkgs/ffigen/test/native_objc_test/setup.dart | 35 ++++++++- .../native_objc_test/swift_class_config.yaml | 15 ++++ .../native_objc_test/swift_class_test.dart | 34 ++++++++ .../native_objc_test/swift_class_test.swift | 11 +++ 12 files changed, 243 insertions(+), 3 deletions(-) create mode 100644 pkgs/ffigen/test/native_objc_test/swift_class_config.yaml create mode 100644 pkgs/ffigen/test/native_objc_test/swift_class_test.dart create mode 100644 pkgs/ffigen/test/native_objc_test/swift_class_test.swift diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 437ba54c41..6442b42c5b 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -186,7 +186,7 @@ compiler-opts-automatic: functions

    structs

    unions

    enums

    - unnamed-enums

    macros

    globals

    objc-interfaces + unnamed-enums

    macros

    globals Filters for declarations.
    Default: all are included.

    Options -
    @@ -507,6 +507,81 @@ language: 'objc' +### Objective-C config options + + + + + + + + + + + + + + + + + + + + + + + + + + +
    KeyExplainationExample
    + objc-interfaces + + Filters for interface declarations. This option works the same as other + declaration filters like `functions` and `structs`. + + +```yaml +objc-interfaces: + include: + # Includes a specific interface. + - 'MyInterface' + # Includes all interfaces starting with "NS". + - 'NS.*' + exclude: + # Override the above NS.* inclusion, to exclude NSURL. + - 'NSURL' + rename: + # Removes '_' prefix from interface names. + '_(.*)': '$1' +``` + +
    + objc-interfaces -> module + + Adds a module prefix to the class name when loading the class + from the dylib. This is only relevent for ObjC headers that are generated + wrappers for a Swift library. See example/swift for more information. + + +```yaml +headers: + entry-points: + # Generated by swiftc to wrap foo_lib.swift. + - 'foo_lib-Swift.h' +objc-interfaces: + include: + # Eg, foo_lib contains a set of classes prefixed with FL. + - 'FL.*' + module: + # Use 'foo_lib' as the module name for all the FL.* classes. + # We don't match .* here because other classes like NSString + # shouldn't be given a module prefix. + 'FL.*': 'foo_lib' +``` + +
    + ## Trying out examples 1. `cd examples/`, Run `dart pub get`. 2. Run `dart run ffigen`. diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 61e88ef569..a6099b8175 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -41,6 +41,7 @@ class ObjCInterface extends BindingType { final methods = {}; bool filled = false; + final String lookupName; final ObjCBuiltInFunctions builtInFunctions; final bool isBuiltIn; late final ObjCInternalGlobal _classObject; @@ -51,6 +52,7 @@ class ObjCInterface extends BindingType { String? usr, required String originalName, required String name, + required this.lookupName, String? dartDoc, required this.builtInFunctions, required this.isBuiltIn, @@ -228,7 +230,7 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { _classObject = ObjCInternalGlobal( '_class_$originalName', - (Writer w) => '${builtInFunctions.getClass.name}("$originalName")', + (Writer w) => '${builtInFunctions.getClass.name}("$lookupName")', builtInFunctions.getClass) ..addDependencies(dependencies); _isKindOfClass = builtInFunctions.getSelObject('isKindOfClass:'); diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index de609978fa..56b2df1d9d 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -125,6 +125,10 @@ class Config { StructPackingOverride get structPackingOverride => _structPackingOverride; late StructPackingOverride _structPackingOverride; + /// Module prefixes for ObjC interfaces. + ObjCModulePrefixer get objcModulePrefixer => _objcModulePrefixer; + late ObjCModulePrefixer _objcModulePrefixer; + /// Name of the wrapper class. String get wrapperName => _wrapperName; late String _wrapperName; @@ -341,6 +345,15 @@ class Config { _objcInterfaces = result as Declaration; }, ), + [strings.objcInterfaces, strings.objcModule]: + Specification>( + requirement: Requirement.no, + validator: stringStringMapValidator, + extractor: stringStringMapExtractor, + defaultValue: () => {}, + extractedResult: (dynamic result) => _objcModulePrefixer = + ObjCModulePrefixer(result as Map), + ), [strings.libraryImports]: Specification>( validator: libraryImportsValidator, extractor: libraryImportsExtractor, diff --git a/pkgs/ffigen/lib/src/config_provider/config_types.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart index f6029768c8..8146917e90 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_types.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart @@ -373,3 +373,32 @@ class CompilerOptsAuto { return []; } } + +class _ObjCModulePrefixerEntry { + final RegExp pattern; + final String moduleName; + + _ObjCModulePrefixerEntry(this.pattern, this.moduleName); +} + +/// Handles applying module prefixes to ObjC classes. +class ObjCModulePrefixer { + final _prefixes = <_ObjCModulePrefixerEntry>[]; + + ObjCModulePrefixer(Map prefixes) { + for (final entry in prefixes.entries) { + _prefixes.add(_ObjCModulePrefixerEntry(RegExp(entry.key), entry.value)); + } + } + + /// If any of the prefixing patterns match, applies that module prefix. + /// Otherwise returns the class name unmodified. + String applyPrefix(String className) { + for (final entry in _prefixes) { + if (quiver.matchesFull(entry.pattern, className)) { + return '${entry.moduleName}.$className'; + } + } + return className; + } +} diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 015d92e4e7..ac154ce1e2 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -179,6 +179,29 @@ bool typeMapValidator(List name, dynamic yamlConfig) { return result; } +Map stringStringMapExtractor(dynamic yamlConfig) { + final resultMap = {}; + final inputMap = yamlConfig as YamlMap?; + if (inputMap != null) { + for (final key in inputMap.keys) { + resultMap[key as String] = inputMap[key] as String; + } + } + return resultMap; +} + +bool stringStringMapValidator(List name, dynamic yamlConfig) { + if (!checkType(name, yamlConfig)) { + return false; + } + for (final key in (yamlConfig as YamlMap).keys) { + if (!checkType([...name, key as String], yamlConfig[key])) { + return false; + } + } + return true; +} + Map makeImportTypeMapping( Map> rawTypeMappings, Map libraryImportsMap) { diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index 3c8aab34cc..bace1c4e80 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -51,6 +51,7 @@ Type? parseObjCInterfaceDeclaration( usr: itfUsr, originalName: name, name: config.objcInterfaces.renameUsingConfig(name), + lookupName: config.objcModulePrefixer.applyPrefix(name), dartDoc: getCursorDocComment(cursor), builtInFunctions: objCBuiltInFunctions, isBuiltIn: cursor.isInSystemHeader(), diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 8094df182a..6995adabe8 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -87,6 +87,9 @@ const symbolAddress = 'symbol-address'; const exposeFunctionTypedefs = 'expose-typedefs'; const leafFunctions = 'leaf'; +// Sub-fields of ObjC interfaces. +const objcModule = 'module'; + const dependencyOnly = 'dependency-only'; // Values for `compoundDependencies`. const fullCompoundDependencies = 'full'; diff --git a/pkgs/ffigen/test/native_objc_test/.gitignore b/pkgs/ffigen/test/native_objc_test/.gitignore index 62dd4b54c3..ad4daf662c 100644 --- a/pkgs/ffigen/test/native_objc_test/.gitignore +++ b/pkgs/ffigen/test/native_objc_test/.gitignore @@ -1 +1,2 @@ *_bindings.dart +*-Swift.h diff --git a/pkgs/ffigen/test/native_objc_test/setup.dart b/pkgs/ffigen/test/native_objc_test/setup.dart index 2e6701b55b..5eff12cc4b 100644 --- a/pkgs/ffigen/test/native_objc_test/setup.dart +++ b/pkgs/ffigen/test/native_objc_test/setup.dart @@ -27,6 +27,27 @@ Future _buildLib(String input, String output) async { print('Generated file: $output'); } +Future _buildSwift( + String input, String outputHeader, String outputLib) async { + final args = [ + '-c', + input, + '-emit-objc-header-path', + outputHeader, + '-emit-library', + '-o', + outputLib, + ]; + final process = await Process.start('swiftc', args); + unawaited(stdout.addStream(process.stdout)); + unawaited(stderr.addStream(process.stderr)); + final result = await process.exitCode; + if (result != 0) { + throw ProcessException('swiftc', args, 'Build failed', result); + } + print('Generated files: $outputHeader and $outputLib'); +} + Future _generateBindings(String config) async { final args = [ 'run', @@ -60,7 +81,19 @@ List _getTestNames() { Future build(List testNames) async { print('Building Dynamic Library for Objective C Native Tests...'); for (final name in testNames) { - await _buildLib('${name}_test.m', '${name}_test.dylib'); + final mFile = '${name}_test.m'; + if (await File(mFile).exists()) { + await _buildLib(mFile, '${name}_test.dylib'); + } + } + + print('Building Dynamic Library and Header for Swift Tests...'); + for (final name in testNames) { + final swiftFile = '${name}_test.swift'; + if (await File(swiftFile).exists()) { + await _buildSwift( + swiftFile, '${name}_test-Swift.h', '${name}_test.dylib'); + } } print('Generating Bindings for Objective C Native Tests...'); diff --git a/pkgs/ffigen/test/native_objc_test/swift_class_config.yaml b/pkgs/ffigen/test/native_objc_test/swift_class_config.yaml new file mode 100644 index 0000000000..e845ed1abb --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/swift_class_config.yaml @@ -0,0 +1,15 @@ +name: SwiftClassTestLibrary +description: 'Tests Swift classes' +language: objc +output: 'test/native_objc_test/swift_class_bindings.dart' +exclude-all-by-default: true +objc-interfaces: + include: + - MySwiftClass + module: + 'MySwiftClass': 'swift_class_test' +headers: + entry-points: + - 'test/native_objc_test/swift_class_test-Swift.h' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/swift_class_test.dart b/pkgs/ffigen/test/native_objc_test/swift_class_test.dart new file mode 100644 index 0000000000..09a2714dd3 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/swift_class_test.dart @@ -0,0 +1,34 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:test/test.dart'; +import '../test_utils.dart'; +import 'swift_class_bindings.dart'; +import 'util.dart'; + +void main() { + late SwiftClassTestLibrary lib; + group('swift_class_test', () { + setUpAll(() { + logWarnings(); + final dylib = File('test/native_objc_test/swift_class_test.dylib'); + verifySetupFile(dylib); + lib = SwiftClassTestLibrary(DynamicLibrary.open(dylib.absolute.path)); + generateBindingsForCoverage('swift_class'); + }); + + test('Renamed class', () { + final swiftObject = MySwiftClass.new1(lib); + expect(swiftObject.getValue(), 123); + swiftObject.setValueWithX_(456); + expect(swiftObject.getValue(), 456); + }); + }); +} diff --git a/pkgs/ffigen/test/native_objc_test/swift_class_test.swift b/pkgs/ffigen/test/native_objc_test/swift_class_test.swift new file mode 100644 index 0000000000..26ae01693b --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/swift_class_test.swift @@ -0,0 +1,11 @@ +import Foundation + +@objc public class MySwiftClass: NSObject { + var val = 123; + @objc public func getValue() -> Int { + return val; + } + @objc public func setValue(x: Int) { + val = x; + } +} From 409e87a6220ecd6df8d88b33b83132da2816f416 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Tue, 9 Aug 2022 09:25:57 -0700 Subject: [PATCH 173/276] [ffigen] Fix obscure NSTimeZone parsing bug (#440) * Fix edge case that came up when parsing NSTimeZone * Property test * fmt --- .../header_parser/type_extractor/extractor.dart | 4 +++- .../test/native_objc_test/category_test.dart | 8 +++++--- .../ffigen/test/native_objc_test/category_test.m | 16 ++++++++++++++++ .../ffigen/test/native_objc_test/property_test.m | 3 +++ 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 7e62d7879f..1590d73db8 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -224,7 +224,9 @@ _CreateTypeFromCursorResult _createTypeFromCursor(clang_types.CXType cxtype, return _CreateTypeFromCursorResult( parseObjCInterfaceDeclaration(cursor, ignoreFilter: ignoreFilter)); default: - throw UnimplementedError('Unknown type: ${cxtype.completeStringRepr()}'); + return _CreateTypeFromCursorResult( + UnimplementedType('Unknown type: ${cxtype.completeStringRepr()}'), + addToCache: false); } } diff --git a/pkgs/ffigen/test/native_objc_test/category_test.dart b/pkgs/ffigen/test/native_objc_test/category_test.dart index 8a8df0b4ec..a424c46e4b 100644 --- a/pkgs/ffigen/test/native_objc_test/category_test.dart +++ b/pkgs/ffigen/test/native_objc_test/category_test.dart @@ -14,7 +14,7 @@ import 'category_bindings.dart'; import 'util.dart'; void main() { - Thing? testInstance; + late Thing testInstance; late CategoryTestObjCLibrary lib; group('categories', () { @@ -28,8 +28,10 @@ void main() { }); test('Category method', () { - expect(testInstance!.add_Y_(1000, 234), 1234); - expect(testInstance!.sub_Y_(1234, 1000), 234); + expect(testInstance.add_Y_(1000, 234), 1234); + expect(testInstance.sub_Y_(1234, 1000), 234); + expect(testInstance.mul_Y_(1234, 1000), 1234000); + expect(testInstance.someProperty, 456); }); }); } diff --git a/pkgs/ffigen/test/native_objc_test/category_test.m b/pkgs/ffigen/test/native_objc_test/category_test.m index bfbf4aebaf..63cd8731c2 100644 --- a/pkgs/ffigen/test/native_objc_test/category_test.m +++ b/pkgs/ffigen/test/native_objc_test/category_test.m @@ -19,3 +19,19 @@ -(int32_t)sub:(int32_t)x Y:(int32_t) y { return x - y; } @end + +@interface Thing (Mul) +-(int32_t)mul:(int32_t)x Y:(int32_t) y; + +@property (readonly) int32_t someProperty; +@end + +@implementation Thing (Mul) +-(int32_t)mul:(int32_t)x Y:(int32_t) y { + return x * y; +} + +-(int32_t)someProperty { + return 456; +} +@end diff --git a/pkgs/ffigen/test/native_objc_test/property_test.m b/pkgs/ffigen/test/native_objc_test/property_test.m index 74728e55b9..117c6d53f1 100644 --- a/pkgs/ffigen/test/native_objc_test/property_test.m +++ b/pkgs/ffigen/test/native_objc_test/property_test.m @@ -1,10 +1,13 @@ #import +@class UndefinedTemplate; + @interface PropertyInterface : NSObject { } @property (readonly) int32_t readOnlyProperty; @property int32_t readWriteProperty; +@property (class, readonly, copy) UndefinedTemplate *regressGH436; @property (class, readonly) int32_t classReadOnlyProperty; @property (class) int32_t classReadWriteProperty; From a88db78f16d08c13dd9a2fd74a973b3c561bf79b Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Mon, 15 Aug 2022 09:58:55 +0200 Subject: [PATCH 174/276] [ffigen] Run Flutter FFI plugin template ffigen on CI (#433) --- .../ffigen/.github/workflows/test-package.yml | 27 ++- .../flutter_plugin_ffi_test.dart | 164 ++++++++++++++++++ 2 files changed, 190 insertions(+), 1 deletion(-) create mode 100644 pkgs/ffigen/test_flutter/flutter_template_tests/flutter_plugin_ffi_test.dart diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 6d6c47061f..fdc7a01331 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -75,7 +75,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: lcov.info - + test-windows: needs: analyze runs-on: windows-latest @@ -90,3 +90,28 @@ jobs: run: dart test/setup.dart - name: Run VM tests run: dart test --platform vm + + # Sanity check the latest `flutter create --template plugin_ffi`. + # This will break if we change the Flutter template or the generated code. + # But, getting libclang on the LUCI infrastructure has proven to be + # non-trivial. See discussion on + # https://github.com/flutter/flutter/issues/105513. + # If we need to change the generated code, we should temporarily disable this + # test, or temporarily disable the requirement for all bots to be green to + # merge PRs. + # Running this sanity check on one OS should be sufficient. Chosing Windows + # because it is the most likely to break. + test-windows-flutter: + needs: analyze + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - uses: subosito/flutter-action@v2 + with: + channel: 'master' + - name: Install dependencies + run: flutter pub get + - name: Build test dylib and bindings + run: dart test/setup.dart + - name: Run VM tests + run: flutter pub run test test_flutter/ --platform vm diff --git a/pkgs/ffigen/test_flutter/flutter_template_tests/flutter_plugin_ffi_test.dart b/pkgs/ffigen/test_flutter/flutter_template_tests/flutter_plugin_ffi_test.dart new file mode 100644 index 0000000000..9f74c814b2 --- /dev/null +++ b/pkgs/ffigen/test_flutter/flutter_template_tests/flutter_plugin_ffi_test.dart @@ -0,0 +1,164 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:convert'; +import 'dart:io'; + +import 'package:test/test.dart'; + +void main() { + Uri? tempDirUri; + final projectName = 'test_project'; + + setUp(() async { + tempDirUri = (await Directory.current.createTemp('.temp_test_')).uri; + }); + + tearDown(() async { + final dir = Directory(tempDirUri!.toFilePath()); + if (await dir.exists()) { + await dir.delete(recursive: true); + } + }); + + test('Run Flutter', () async { + final projectDirUri = tempDirUri!.resolve('$projectName/'); + final libDirUri = projectDirUri.resolve('lib/'); + final bindingsGeneratedUri = + libDirUri.resolve('${projectName}_bindings_generated.dart'); + final bindingsGeneratedCopyUri = + libDirUri.resolve('${projectName}_bindings_generated_copy.dart'); + + await Task.serial([ + RunProcess( + executable: 'flutter', + arguments: [ + 'create', + '--template=plugin_ffi', + projectName, + ], + workingDirectory: tempDirUri, + ), + Copy( + source: bindingsGeneratedUri, + target: bindingsGeneratedCopyUri, + ), + RunProcess( + executable: 'flutter', + arguments: [ + 'pub', + 'run', + 'ffigen', + '--config', + 'ffigen.yaml', + ], + workingDirectory: projectDirUri, + ), + ]).run(); + + final originalBindings = await readFileAsString(bindingsGeneratedCopyUri); + final regeneratedBindings = await readFileAsString(bindingsGeneratedUri); + + expect(originalBindings, regeneratedBindings); + }); +} + +Future readFileAsString(Uri uri) async { + final contents = await File(uri.toFilePath()).readAsString(); + return contents.replaceAll('\r', ''); +} + +abstract class Task { + Future run(); + + factory Task.serial(Iterable tasks) => _SerialTask(tasks); +} + +class _SerialTask implements Task { + final Iterable tasks; + + _SerialTask(this.tasks); + + @override + Future run() async { + for (final task in tasks) { + await task.run(); + } + } +} + +class RunProcess implements Task { + final List arguments; + final String executable; + final Uri? workingDirectory; + Map? environment; + final bool throwOnFailure; + + RunProcess({ + required this.arguments, + required this.executable, + this.workingDirectory, + this.environment, + this.throwOnFailure = true, + }); + + /// Excluding [workingDirectory]. + String get commandString => [ + if (workingDirectory != null) '(cd ${workingDirectory!.path};', + ...?environment?.entries.map((entry) => '${entry.key}=${entry.value}'), + executable, + ...arguments.map((a) => a.contains(' ') ? "'$a'" : a), + if (workingDirectory != null) ')', + ].join(' '); + + @override + Future run() async { + final workingDirectoryString = workingDirectory?.toFilePath(); + + print('Running `$commandString`.'); + final process = await Process.start(executable, arguments, + runInShell: true, + includeParentEnvironment: true, + workingDirectory: workingDirectoryString, + environment: environment) + .then((process) { + process.stdout.transform(utf8.decoder).forEach((s) => print(' $s')); + process.stderr.transform(utf8.decoder).forEach((s) => print(' $s')); + return process; + }); + final exitCode = await process.exitCode; + if (exitCode != 0) { + final message = + 'Command `$commandString` failed with exit code $exitCode.'; + print(message); + if (throwOnFailure) { + throw Exception(message); + } + } + print('Command `$commandString` done.'); + } +} + +class Copy implements Task { + final Uri source; + final Uri target; + + Copy({ + required this.source, + required this.target, + }); + + @override + Future run() async { + final file = File.fromUri(source); + if (!await file.exists()) { + final message = + "File not in expected location: '${source.toFilePath()}'."; + print(message); + throw Exception(message); + } + print('Copying ${source.toFilePath()} to ${target.toFilePath()}.'); + await file.copy(target.toFilePath()); + } +} From a97fe3facb988d6fdcace3ac30fc1c89daee114d Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Mon, 15 Aug 2022 19:01:53 +0200 Subject: [PATCH 175/276] [ffigen] Increase timeout Flutter integration test (#446) --- .../flutter_template_tests/flutter_plugin_ffi_test.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/ffigen/test_flutter/flutter_template_tests/flutter_plugin_ffi_test.dart b/pkgs/ffigen/test_flutter/flutter_template_tests/flutter_plugin_ffi_test.dart index 9f74c814b2..06b9df74ef 100644 --- a/pkgs/ffigen/test_flutter/flutter_template_tests/flutter_plugin_ffi_test.dart +++ b/pkgs/ffigen/test_flutter/flutter_template_tests/flutter_plugin_ffi_test.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +@Timeout(Duration(seconds: 120)) + import 'dart:convert'; import 'dart:io'; From 22c90064c013e76e9aa71a21adfa1fd4799dde7b Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Mon, 15 Aug 2022 11:19:19 -0700 Subject: [PATCH 176/276] [ffigen] Add a swift example (#441) * swift experiment * Add the header * Got swift interop working, with caveats * Clean up Swift example * Update README.md * Fix some nits * Daco's comments --- pkgs/ffigen/.gitignore | 3 + pkgs/ffigen/example/README.md | 1 + pkgs/ffigen/example/swift/README.md | 72 + pkgs/ffigen/example/swift/example.dart | 16 + pkgs/ffigen/example/swift/pubspec.yaml | 36 + pkgs/ffigen/example/swift/swift_api.h | 223 + pkgs/ffigen/example/swift/swift_api.swift | 13 + .../example/swift/swift_api_bindings.dart | 64749 ++++++++++++++++ 8 files changed, 65113 insertions(+) create mode 100644 pkgs/ffigen/example/swift/README.md create mode 100644 pkgs/ffigen/example/swift/example.dart create mode 100644 pkgs/ffigen/example/swift/pubspec.yaml create mode 100644 pkgs/ffigen/example/swift/swift_api.h create mode 100644 pkgs/ffigen/example/swift/swift_api.swift create mode 100644 pkgs/ffigen/example/swift/swift_api_bindings.dart diff --git a/pkgs/ffigen/.gitignore b/pkgs/ffigen/.gitignore index 71c0ba13d5..d9616e8fae 100644 --- a/pkgs/ffigen/.gitignore +++ b/pkgs/ffigen/.gitignore @@ -39,3 +39,6 @@ test/debug_generated/* !test/debug_generated/readme.md lcov.info coverage.json + +# Files generated by various OSs. +.DS_Store diff --git a/pkgs/ffigen/example/README.md b/pkgs/ffigen/example/README.md index dd66dbb343..91a8db8ed4 100644 --- a/pkgs/ffigen/example/README.md +++ b/pkgs/ffigen/example/README.md @@ -4,3 +4,4 @@ - [cJSON](https://github.com/dart-lang/ffigen/tree/master/example/c_json) - [LibClang](https://github.com/dart-lang/ffigen/tree/master/example/libclang-example) - [ObjectiveC](https://github.com/dart-lang/ffigen/tree/master/example/objective_c) +- [Swift](https://github.com/dart-lang/ffigen/tree/master/example/swift) diff --git a/pkgs/ffigen/example/swift/README.md b/pkgs/ffigen/example/swift/README.md new file mode 100644 index 0000000000..05c1c3442c --- /dev/null +++ b/pkgs/ffigen/example/swift/README.md @@ -0,0 +1,72 @@ +# Swift example + +This example shows how to use ffigen to interact with Swift libraries. + +Swift APIs can be made compatible with Objective-C, using the `@objc` +annotation. Then you can use the `swiftc` tool to build a dylib for the library +using `-emit-library`, and generate an Objective-C wrapper header using +`-emit-objc-header-path filename.h`: + +```shell +swiftc -c swift_api.swift \ + -module-name swift_module \ + -emit-objc-header-path swift_api.h \ + -emit-library -o libswiftapi.dylib +``` + +This should generate libswiftapi.dylib and swift_api.h. +For more information about Objective-C / Swift interoperability, see the +[Apple documentation](https://developer.apple.com/documentation/swift/importing-swift-into-objective-c). + +Once you have an Objective-C wrapper header, ffigen can parse it like +any other header: + +```shell +dart run ffigen +``` + +This will generate [swift_api_bindings.dart](./swift_api_bindings.dart), +using the config in the ffigen section of the pubspec.yaml. + +Finally, you can run the example using this command: + +```shell +dart run example.dart +``` + +## Config notes + +Ffigen only sees the Objective-C wrapper header, swift_api.h. So you +need to set the language to objc, and set the entry-point to the header: + +```yaml +language: objc +headers: + entry-points: + - 'swift_api.h' +``` + +Swift classes become Objective-C interfaces, so include them like this: + +```yaml +objc-interfaces: + include: + - 'SwiftClass' +``` + +There is one extra option you need to set when wrapping a Swift library. +When `swiftc` compiles the library, it gives the Objective-C interface +a module prefix. Internally, our `SwiftClass` is actually registered +as `swift_module.SwiftClass`. So you need to tell ffigen about this prefix, +so it loads the correct class from the dylib: + +```yaml +objc-interfaces: + include: + - 'SwiftClass' + module: + 'SwiftClass': 'swift_module' +``` + +The module prefix is whatever you passed to `swiftc` in the +`-module-name` flag. diff --git a/pkgs/ffigen/example/swift/example.dart b/pkgs/ffigen/example/swift/example.dart new file mode 100644 index 0000000000..0e6d9282c4 --- /dev/null +++ b/pkgs/ffigen/example/swift/example.dart @@ -0,0 +1,16 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:ffi'; +import 'swift_api_bindings.dart'; + +void main() { + // TODO(#443): Add a test for this. + final lib = SwiftLibrary(DynamicLibrary.open('libswiftapi.dylib')); + final object = SwiftClass.new1(lib); + print(object.sayHello()); + print('field = ${object.someField}'); + object.someField = 456; + print('field = ${object.someField}'); +} diff --git a/pkgs/ffigen/example/swift/pubspec.yaml b/pkgs/ffigen/example/swift/pubspec.yaml new file mode 100644 index 0000000000..f088c220f3 --- /dev/null +++ b/pkgs/ffigen/example/swift/pubspec.yaml @@ -0,0 +1,36 @@ +# Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +name: swift_example + +environment: + sdk: '>=2.17.0 <3.0.0' + +dependencies: + ffi: ^2.0.1 +dev_dependencies: + ffigen: + path: '../../' + lints: ^2.0.0 + +ffigen: + name: SwiftLibrary + description: Bindings for swift_api. + language: objc + output: 'swift_api_bindings.dart' + exclude-all-by-default: true + objc-interfaces: + include: + - 'SwiftClass' + module: + 'SwiftClass': 'swift_module' + headers: + entry-points: + - 'swift_api.h' + preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names + // ignore_for_file: unused_element, unused_field, return_of_invalid_type + // ignore_for_file: void_checks, annotate_overrides + // ignore_for_file: no_leading_underscores_for_local_identifiers + // ignore_for_file: library_private_types_in_public_api diff --git a/pkgs/ffigen/example/swift/swift_api.h b/pkgs/ffigen/example/swift/swift_api.h new file mode 100644 index 0000000000..45e5010ff9 --- /dev/null +++ b/pkgs/ffigen/example/swift/swift_api.h @@ -0,0 +1,223 @@ +// Generated by Apple Swift version 5.5.2 (swiftlang-1300.0.40.106 clang-1300.0.29.21) +#ifndef SWIFT_MODULE_SWIFT_H +#define SWIFT_MODULE_SWIFT_H +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" + +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wauto-import" +#include +#include +#include +#include + +#if !defined(SWIFT_TYPEDEFS) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif +#if !defined(SWIFT_CLASS_PROPERTY) +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif +#endif + +#if __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if __has_attribute(swift_name) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#else +# define SWIFT_COMPILE_NAME(X) +#endif +#if __has_attribute(objc_method_family) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#else +# define SWIFT_METHOD_FAMILY(X) +#endif +#if __has_attribute(noescape) +# define SWIFT_NOESCAPE __attribute__((noescape)) +#else +# define SWIFT_NOESCAPE +#endif +#if __has_attribute(ns_consumed) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#else +# define SWIFT_RELEASES_ARGUMENT +#endif +#if __has_attribute(warn_unused_result) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +# define SWIFT_WARN_UNUSED_RESULT +#endif +#if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) +#else +# define SWIFT_NORETURN +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif +#if !defined(SWIFT_RESILIENT_CLASS) +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif +#endif +#if !defined(SWIFT_UNAVAILABLE) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#endif +#if !defined(SWIFT_UNAVAILABLE_MSG) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#endif +#if !defined(SWIFT_AVAILABILITY) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#endif +#if !defined(SWIFT_WEAK_IMPORT) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#endif +#if !defined(SWIFT_DEPRECATED) +# define SWIFT_DEPRECATED __attribute__((deprecated)) +#endif +#if !defined(SWIFT_DEPRECATED_MSG) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#endif +#if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#else +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#endif +#if !defined(IBSegueAction) +# define IBSegueAction +#endif +#if __has_feature(modules) +#if __has_warning("-Watimport-in-framework-header") +#pragma clang diagnostic ignored "-Watimport-in-framework-header" +#endif +@import ObjectiveC; +#endif + +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" + +#if __has_attribute(external_source_symbol) +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="swift_module",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") +#endif + +@class NSString; +@class NSNumber; + +SWIFT_CLASS("_TtC12swift_module10SwiftClass") +@interface SwiftClass : NSObject +- (NSString * _Nonnull)sayHello SWIFT_WARN_UNUSED_RESULT; +@property (nonatomic) NSInteger someField; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + +#if __has_attribute(external_source_symbol) +# pragma clang attribute pop +#endif +#pragma clang diagnostic pop +#endif diff --git a/pkgs/ffigen/example/swift/swift_api.swift b/pkgs/ffigen/example/swift/swift_api.swift new file mode 100644 index 0000000000..a97822645a --- /dev/null +++ b/pkgs/ffigen/example/swift/swift_api.swift @@ -0,0 +1,13 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import Foundation + +@objc public class SwiftClass: NSObject { + @objc public func sayHello() -> String { + return "Hello from Swift!"; + } + + @objc public var someField = 123; +} diff --git a/pkgs/ffigen/example/swift/swift_api_bindings.dart b/pkgs/ffigen/example/swift/swift_api_bindings.dart new file mode 100644 index 0000000000..0221cc8cad --- /dev/null +++ b/pkgs/ffigen/example/swift/swift_api_bindings.dart @@ -0,0 +1,64749 @@ +// ignore_for_file: camel_case_types, non_constant_identifier_names +// ignore_for_file: unused_element, unused_field, return_of_invalid_type +// ignore_for_file: void_checks, annotate_overrides +// ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: library_private_types_in_public_api + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; + +/// Bindings for swift_api. +class SwiftLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + SwiftLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + SwiftLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + ffi.Pointer _registerName1(String name) { + final cstr = name.toNativeUtf8(); + final sel = _sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; + } + + ffi.Pointer _sel_registerName( + ffi.Pointer str, + ) { + return __sel_registerName( + str, + ); + } + + late final __sel_registerNamePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sel_registerName'); + late final __sel_registerName = __sel_registerNamePtr + .asFunction Function(ffi.Pointer)>(); + + ffi.Pointer _getClass1(String name) { + final cstr = name.toNativeUtf8(); + final clazz = _objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + if (clazz == ffi.nullptr) { + throw Exception('Failed to load Objective-C class: $name'); + } + return clazz; + } + + ffi.Pointer _objc_getClass( + ffi.Pointer str, + ) { + return __objc_getClass( + str, + ); + } + + late final __objc_getClassPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('objc_getClass'); + late final __objc_getClass = __objc_getClassPtr + .asFunction Function(ffi.Pointer)>(); + + ffi.Pointer _objc_retain( + ffi.Pointer value, + ) { + return __objc_retain( + value, + ); + } + + late final __objc_retainPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('objc_retain'); + late final __objc_retain = __objc_retainPtr + .asFunction Function(ffi.Pointer)>(); + + void _objc_release( + ffi.Pointer value, + ) { + return __objc_release( + value, + ); + } + + late final __objc_releasePtr = + _lookup)>>( + 'objc_release'); + late final __objc_release = + __objc_releasePtr.asFunction)>(); + + late final _objc_releaseFinalizer2 = + ffi.NativeFinalizer(__objc_releasePtr.cast()); + late final _class_NSObject1 = _getClass1("NSObject"); + late final _sel_load1 = _registerName1("load"); + void _objc_msgSend_1( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1( + obj, + sel, + ); + } + + late final __objc_msgSend_1Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initialize1 = _registerName1("initialize"); + late final _sel_init1 = _registerName1("init"); + instancetype _objc_msgSend_2( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_2( + obj, + sel, + ); + } + + late final __objc_msgSend_2Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_new1 = _registerName1("new"); + late final _sel_allocWithZone_1 = _registerName1("allocWithZone:"); + instancetype _objc_msgSend_3( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_3( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_3Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>(); + + late final _sel_alloc1 = _registerName1("alloc"); + late final _sel_dealloc1 = _registerName1("dealloc"); + late final _sel_finalize1 = _registerName1("finalize"); + late final _sel_copy1 = _registerName1("copy"); + late final _sel_mutableCopy1 = _registerName1("mutableCopy"); + late final _sel_copyWithZone_1 = _registerName1("copyWithZone:"); + late final _sel_mutableCopyWithZone_1 = + _registerName1("mutableCopyWithZone:"); + late final _sel_instancesRespondToSelector_1 = + _registerName1("instancesRespondToSelector:"); + bool _objc_msgSend_4( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_4( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_4Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + bool _objc_msgSend_0( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer clazz, + ) { + return __objc_msgSend_0( + obj, + sel, + clazz, + ); + } + + late final __objc_msgSend_0Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_isKindOfClass_1 = _registerName1("isKindOfClass:"); + late final _class_Protocol1 = _getClass1("Protocol"); + late final _sel_conformsToProtocol_1 = _registerName1("conformsToProtocol:"); + bool _objc_msgSend_5( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer protocol, + ) { + return __objc_msgSend_5( + obj, + sel, + protocol, + ); + } + + late final __objc_msgSend_5Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_methodForSelector_1 = _registerName1("methodForSelector:"); + IMP _objc_msgSend_6( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_6( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_6Ptr = _lookup< + ffi.NativeFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< + IMP Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_instanceMethodForSelector_1 = + _registerName1("instanceMethodForSelector:"); + late final _sel_doesNotRecognizeSelector_1 = + _registerName1("doesNotRecognizeSelector:"); + void _objc_msgSend_7( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_7( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_7Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_forwardingTargetForSelector_1 = + _registerName1("forwardingTargetForSelector:"); + ffi.Pointer _objc_msgSend_8( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_8( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_8Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSInvocation1 = _getClass1("NSInvocation"); + late final _class_NSMethodSignature1 = _getClass1("NSMethodSignature"); + late final _sel_signatureWithObjCTypes_1 = + _registerName1("signatureWithObjCTypes:"); + ffi.Pointer _objc_msgSend_9( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer types, + ) { + return __objc_msgSend_9( + obj, + sel, + types, + ); + } + + late final __objc_msgSend_9Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_numberOfArguments1 = _registerName1("numberOfArguments"); + int _objc_msgSend_10( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_10( + obj, + sel, + ); + } + + late final __objc_msgSend_10Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_getArgumentTypeAtIndex_1 = + _registerName1("getArgumentTypeAtIndex:"); + ffi.Pointer _objc_msgSend_11( + ffi.Pointer obj, + ffi.Pointer sel, + int idx, + ) { + return __objc_msgSend_11( + obj, + sel, + idx, + ); + } + + late final __objc_msgSend_11Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_frameLength1 = _registerName1("frameLength"); + late final _sel_isOneway1 = _registerName1("isOneway"); + bool _objc_msgSend_12( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_12( + obj, + sel, + ); + } + + late final __objc_msgSend_12Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_methodReturnType1 = _registerName1("methodReturnType"); + ffi.Pointer _objc_msgSend_13( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_13( + obj, + sel, + ); + } + + late final __objc_msgSend_13Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_methodReturnLength1 = _registerName1("methodReturnLength"); + late final _sel_cancelPreviousPerformRequestsWithTarget_selector_object_1 = + _registerName1( + "cancelPreviousPerformRequestsWithTarget:selector:object:"); + void _objc_msgSend_14( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aTarget, + ffi.Pointer aSelector, + ffi.Pointer anArgument, + ) { + return __objc_msgSend_14( + obj, + sel, + aTarget, + aSelector, + anArgument, + ); + } + + late final __objc_msgSend_14Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_cancelPreviousPerformRequestsWithTarget_1 = + _registerName1("cancelPreviousPerformRequestsWithTarget:"); + void _objc_msgSend_15( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aTarget, + ) { + return __objc_msgSend_15( + obj, + sel, + aTarget, + ); + } + + late final __objc_msgSend_15Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_accessInstanceVariablesDirectly1 = + _registerName1("accessInstanceVariablesDirectly"); + late final _sel_useStoredAccessor1 = _registerName1("useStoredAccessor"); + late final _class_NSSet1 = _getClass1("NSSet"); + late final _sel_count1 = _registerName1("count"); + late final _sel_member_1 = _registerName1("member:"); + ffi.Pointer _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer object, + ) { + return __objc_msgSend_16( + obj, + sel, + object, + ); + } + + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSEnumerator1 = _getClass1("NSEnumerator"); + late final _sel_nextObject1 = _registerName1("nextObject"); + late final _class_NSString1 = _getClass1("NSString"); + late final _sel_length1 = _registerName1("length"); + late final _sel_characterAtIndex_1 = _registerName1("characterAtIndex:"); + int _objc_msgSend_17( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_17( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_17Ptr = _lookup< + ffi.NativeFunction< + unichar Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _class_NSCoder1 = _getClass1("NSCoder"); + late final _sel_encodeValueOfObjCType_at_1 = + _registerName1("encodeValueOfObjCType:at:"); + void _objc_msgSend_18( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer type, + ffi.Pointer addr, + ) { + return __objc_msgSend_18( + obj, + sel, + type, + addr, + ); + } + + late final __objc_msgSend_18Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSData1 = _getClass1("NSData"); + late final _sel_bytes1 = _registerName1("bytes"); + ffi.Pointer _objc_msgSend_19( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_19( + obj, + sel, + ); + } + + late final __objc_msgSend_19Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_description1 = _registerName1("description"); + ffi.Pointer _objc_msgSend_20( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_20( + obj, + sel, + ); + } + + late final __objc_msgSend_20Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_getBytes_length_1 = _registerName1("getBytes:length:"); + void _objc_msgSend_21( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + int length, + ) { + return __objc_msgSend_21( + obj, + sel, + buffer, + length, + ); + } + + late final __objc_msgSend_21Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_getBytes_range_1 = _registerName1("getBytes:range:"); + void _objc_msgSend_22( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + NSRange range, + ) { + return __objc_msgSend_22( + obj, + sel, + buffer, + range, + ); + } + + late final __objc_msgSend_22Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>(); + + late final _sel_isEqualToData_1 = _registerName1("isEqualToData:"); + bool _objc_msgSend_23( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_23( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_23Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_subdataWithRange_1 = _registerName1("subdataWithRange:"); + ffi.Pointer _objc_msgSend_24( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_24( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_24Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_writeToFile_atomically_1 = + _registerName1("writeToFile:atomically:"); + bool _objc_msgSend_25( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool useAuxiliaryFile, + ) { + return __objc_msgSend_25( + obj, + sel, + path, + useAuxiliaryFile, + ); + } + + late final __objc_msgSend_25Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _class_NSURL1 = _getClass1("NSURL"); + late final _sel_initWithScheme_host_path_1 = + _registerName1("initWithScheme:host:path:"); + instancetype _objc_msgSend_26( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer scheme, + ffi.Pointer host, + ffi.Pointer path, + ) { + return __objc_msgSend_26( + obj, + sel, + scheme, + host, + path, + ); + } + + late final __objc_msgSend_26Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initFileURLWithPath_isDirectory_relativeToURL_1 = + _registerName1("initFileURLWithPath:isDirectory:relativeToURL:"); + instancetype _objc_msgSend_27( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool isDir, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_27( + obj, + sel, + path, + isDir, + baseURL, + ); + } + + late final __objc_msgSend_27Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool, ffi.Pointer)>(); + + late final _sel_initFileURLWithPath_relativeToURL_1 = + _registerName1("initFileURLWithPath:relativeToURL:"); + instancetype _objc_msgSend_28( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_28( + obj, + sel, + path, + baseURL, + ); + } + + late final __objc_msgSend_28Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_28 = __objc_msgSend_28Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initFileURLWithPath_isDirectory_1 = + _registerName1("initFileURLWithPath:isDirectory:"); + instancetype _objc_msgSend_29( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool isDir, + ) { + return __objc_msgSend_29( + obj, + sel, + path, + isDir, + ); + } + + late final __objc_msgSend_29Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_29 = __objc_msgSend_29Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_initFileURLWithPath_1 = + _registerName1("initFileURLWithPath:"); + instancetype _objc_msgSend_30( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ) { + return __objc_msgSend_30( + obj, + sel, + path, + ); + } + + late final __objc_msgSend_30Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_30 = __objc_msgSend_30Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_fileURLWithPath_isDirectory_relativeToURL_1 = + _registerName1("fileURLWithPath:isDirectory:relativeToURL:"); + ffi.Pointer _objc_msgSend_31( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool isDir, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_31( + obj, + sel, + path, + isDir, + baseURL, + ); + } + + late final __objc_msgSend_31Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_31 = __objc_msgSend_31Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer)>(); + + late final _sel_fileURLWithPath_relativeToURL_1 = + _registerName1("fileURLWithPath:relativeToURL:"); + ffi.Pointer _objc_msgSend_32( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_32( + obj, + sel, + path, + baseURL, + ); + } + + late final __objc_msgSend_32Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_32 = __objc_msgSend_32Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_fileURLWithPath_isDirectory_1 = + _registerName1("fileURLWithPath:isDirectory:"); + ffi.Pointer _objc_msgSend_33( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool isDir, + ) { + return __objc_msgSend_33( + obj, + sel, + path, + isDir, + ); + } + + late final __objc_msgSend_33Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_33 = __objc_msgSend_33Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_fileURLWithPath_1 = _registerName1("fileURLWithPath:"); + ffi.Pointer _objc_msgSend_34( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ) { + return __objc_msgSend_34( + obj, + sel, + path, + ); + } + + late final __objc_msgSend_34Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_34 = __objc_msgSend_34Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL_1 = + _registerName1( + "initFileURLWithFileSystemRepresentation:isDirectory:relativeToURL:"); + instancetype _objc_msgSend_35( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool isDir, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_35( + obj, + sel, + path, + isDir, + baseURL, + ); + } + + late final __objc_msgSend_35Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_35 = __objc_msgSend_35Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool, ffi.Pointer)>(); + + late final _sel_fileURLWithFileSystemRepresentation_isDirectory_relativeToURL_1 = + _registerName1( + "fileURLWithFileSystemRepresentation:isDirectory:relativeToURL:"); + ffi.Pointer _objc_msgSend_36( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool isDir, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_36( + obj, + sel, + path, + isDir, + baseURL, + ); + } + + late final __objc_msgSend_36Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_36 = __objc_msgSend_36Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer)>(); + + late final _sel_initWithString_1 = _registerName1("initWithString:"); + late final _sel_initWithString_relativeToURL_1 = + _registerName1("initWithString:relativeToURL:"); + late final _sel_URLWithString_1 = _registerName1("URLWithString:"); + late final _sel_URLWithString_relativeToURL_1 = + _registerName1("URLWithString:relativeToURL:"); + late final _sel_initWithDataRepresentation_relativeToURL_1 = + _registerName1("initWithDataRepresentation:relativeToURL:"); + instancetype _objc_msgSend_37( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_37( + obj, + sel, + data, + baseURL, + ); + } + + late final __objc_msgSend_37Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_37 = __objc_msgSend_37Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_URLWithDataRepresentation_relativeToURL_1 = + _registerName1("URLWithDataRepresentation:relativeToURL:"); + ffi.Pointer _objc_msgSend_38( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_38( + obj, + sel, + data, + baseURL, + ); + } + + late final __objc_msgSend_38Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_38 = __objc_msgSend_38Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initAbsoluteURLWithDataRepresentation_relativeToURL_1 = + _registerName1("initAbsoluteURLWithDataRepresentation:relativeToURL:"); + late final _sel_absoluteURLWithDataRepresentation_relativeToURL_1 = + _registerName1("absoluteURLWithDataRepresentation:relativeToURL:"); + late final _sel_dataRepresentation1 = _registerName1("dataRepresentation"); + ffi.Pointer _objc_msgSend_39( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_39( + obj, + sel, + ); + } + + late final __objc_msgSend_39Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_39 = __objc_msgSend_39Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_absoluteString1 = _registerName1("absoluteString"); + late final _sel_relativeString1 = _registerName1("relativeString"); + late final _sel_baseURL1 = _registerName1("baseURL"); + ffi.Pointer _objc_msgSend_40( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_40( + obj, + sel, + ); + } + + late final __objc_msgSend_40Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_40 = __objc_msgSend_40Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_absoluteURL1 = _registerName1("absoluteURL"); + late final _sel_scheme1 = _registerName1("scheme"); + late final _sel_resourceSpecifier1 = _registerName1("resourceSpecifier"); + late final _sel_host1 = _registerName1("host"); + late final _class_NSNumber1 = _getClass1("NSNumber"); + late final _class_NSValue1 = _getClass1("NSValue"); + late final _sel_getValue_size_1 = _registerName1("getValue:size:"); + late final _sel_objCType1 = _registerName1("objCType"); + late final _sel_initWithBytes_objCType_1 = + _registerName1("initWithBytes:objCType:"); + instancetype _objc_msgSend_41( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ffi.Pointer type, + ) { + return __objc_msgSend_41( + obj, + sel, + value, + type, + ); + } + + late final __objc_msgSend_41Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_41 = __objc_msgSend_41Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithCoder_1 = _registerName1("initWithCoder:"); + instancetype _objc_msgSend_42( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_42( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_42Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_42 = __objc_msgSend_42Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_valueWithBytes_objCType_1 = + _registerName1("valueWithBytes:objCType:"); + ffi.Pointer _objc_msgSend_43( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ffi.Pointer type, + ) { + return __objc_msgSend_43( + obj, + sel, + value, + type, + ); + } + + late final __objc_msgSend_43Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_43 = __objc_msgSend_43Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_value_withObjCType_1 = _registerName1("value:withObjCType:"); + late final _sel_valueWithNonretainedObject_1 = + _registerName1("valueWithNonretainedObject:"); + ffi.Pointer _objc_msgSend_44( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ) { + return __objc_msgSend_44( + obj, + sel, + anObject, + ); + } + + late final __objc_msgSend_44Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_44 = __objc_msgSend_44Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_nonretainedObjectValue1 = + _registerName1("nonretainedObjectValue"); + late final _sel_valueWithPointer_1 = _registerName1("valueWithPointer:"); + ffi.Pointer _objc_msgSend_45( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer pointer, + ) { + return __objc_msgSend_45( + obj, + sel, + pointer, + ); + } + + late final __objc_msgSend_45Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_45 = __objc_msgSend_45Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_pointerValue1 = _registerName1("pointerValue"); + late final _sel_isEqualToValue_1 = _registerName1("isEqualToValue:"); + bool _objc_msgSend_46( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_46( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_46Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_46 = __objc_msgSend_46Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_getValue_1 = _registerName1("getValue:"); + void _objc_msgSend_47( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_47( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_47Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_47 = __objc_msgSend_47Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_valueWithRange_1 = _registerName1("valueWithRange:"); + ffi.Pointer _objc_msgSend_48( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_48( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_48Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_48 = __objc_msgSend_48Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_rangeValue1 = _registerName1("rangeValue"); + NSRange _objc_msgSend_49( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_49( + obj, + sel, + ); + } + + late final __objc_msgSend_49Ptr = _lookup< + ffi.NativeFunction< + NSRange Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_49 = __objc_msgSend_49Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_valueWithPoint_1 = _registerName1("valueWithPoint:"); + ffi.Pointer _objc_msgSend_50( + ffi.Pointer obj, + ffi.Pointer sel, + NSPoint point, + ) { + return __objc_msgSend_50( + obj, + sel, + point, + ); + } + + late final __objc_msgSend_50Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSPoint)>>('objc_msgSend'); + late final __objc_msgSend_50 = __objc_msgSend_50Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSPoint)>(); + + late final _sel_valueWithSize_1 = _registerName1("valueWithSize:"); + ffi.Pointer _objc_msgSend_51( + ffi.Pointer obj, + ffi.Pointer sel, + NSSize size, + ) { + return __objc_msgSend_51( + obj, + sel, + size, + ); + } + + late final __objc_msgSend_51Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSSize)>>('objc_msgSend'); + late final __objc_msgSend_51 = __objc_msgSend_51Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSSize)>(); + + late final _sel_valueWithRect_1 = _registerName1("valueWithRect:"); + ffi.Pointer _objc_msgSend_52( + ffi.Pointer obj, + ffi.Pointer sel, + NSRect rect, + ) { + return __objc_msgSend_52( + obj, + sel, + rect, + ); + } + + late final __objc_msgSend_52Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRect)>>('objc_msgSend'); + late final __objc_msgSend_52 = __objc_msgSend_52Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRect)>(); + + late final _sel_valueWithEdgeInsets_1 = + _registerName1("valueWithEdgeInsets:"); + ffi.Pointer _objc_msgSend_53( + ffi.Pointer obj, + ffi.Pointer sel, + NSEdgeInsets insets, + ) { + return __objc_msgSend_53( + obj, + sel, + insets, + ); + } + + late final __objc_msgSend_53Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSEdgeInsets)>>('objc_msgSend'); + late final __objc_msgSend_53 = __objc_msgSend_53Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSEdgeInsets)>(); + + late final _sel_pointValue1 = _registerName1("pointValue"); + NSPoint _objc_msgSend_54( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_54( + obj, + sel, + ); + } + + late final __objc_msgSend_54Ptr = _lookup< + ffi.NativeFunction< + NSPoint Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< + NSPoint Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_sizeValue1 = _registerName1("sizeValue"); + NSSize _objc_msgSend_55( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_55( + obj, + sel, + ); + } + + late final __objc_msgSend_55Ptr = _lookup< + ffi.NativeFunction< + NSSize Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_55 = __objc_msgSend_55Ptr.asFunction< + NSSize Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_rectValue1 = _registerName1("rectValue"); + NSRect _objc_msgSend_56( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_56( + obj, + sel, + ); + } + + late final __objc_msgSend_56Ptr = _lookup< + ffi.NativeFunction< + NSRect Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_56 = __objc_msgSend_56Ptr.asFunction< + NSRect Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_edgeInsetsValue1 = _registerName1("edgeInsetsValue"); + NSEdgeInsets _objc_msgSend_57( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_57( + obj, + sel, + ); + } + + late final __objc_msgSend_57Ptr = _lookup< + ffi.NativeFunction< + NSEdgeInsets Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_57 = __objc_msgSend_57Ptr.asFunction< + NSEdgeInsets Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_keyPathsForValuesAffectingValueForKey_1 = + _registerName1("keyPathsForValuesAffectingValueForKey:"); + ffi.Pointer _objc_msgSend_58( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_58( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_58Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_58 = __objc_msgSend_58Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_automaticallyNotifiesObserversForKey_1 = + _registerName1("automaticallyNotifiesObserversForKey:"); + bool _objc_msgSend_59( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_59( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_59Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSArray1 = _getClass1("NSArray"); + late final _sel_objectAtIndex_1 = _registerName1("objectAtIndex:"); + ffi.Pointer _objc_msgSend_60( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_60( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_60Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithObjects_count_1 = + _registerName1("initWithObjects:count:"); + instancetype _objc_msgSend_61( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + int cnt, + ) { + return __objc_msgSend_61( + obj, + sel, + objects, + cnt, + ); + } + + late final __objc_msgSend_61Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_61 = __objc_msgSend_61Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, int)>(); + + late final _sel_arrayByAddingObject_1 = + _registerName1("arrayByAddingObject:"); + ffi.Pointer _objc_msgSend_62( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ) { + return __objc_msgSend_62( + obj, + sel, + anObject, + ); + } + + late final __objc_msgSend_62Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_arrayByAddingObjectsFromArray_1 = + _registerName1("arrayByAddingObjectsFromArray:"); + ffi.Pointer _objc_msgSend_63( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherArray, + ) { + return __objc_msgSend_63( + obj, + sel, + otherArray, + ); + } + + late final __objc_msgSend_63Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_63 = __objc_msgSend_63Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_componentsJoinedByString_1 = + _registerName1("componentsJoinedByString:"); + ffi.Pointer _objc_msgSend_64( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer separator, + ) { + return __objc_msgSend_64( + obj, + sel, + separator, + ); + } + + late final __objc_msgSend_64Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_64 = __objc_msgSend_64Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_containsObject_1 = _registerName1("containsObject:"); + late final _sel_descriptionWithLocale_1 = + _registerName1("descriptionWithLocale:"); + ffi.Pointer _objc_msgSend_65( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer locale, + ) { + return __objc_msgSend_65( + obj, + sel, + locale, + ); + } + + late final __objc_msgSend_65Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_65 = __objc_msgSend_65Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_descriptionWithLocale_indent_1 = + _registerName1("descriptionWithLocale:indent:"); + ffi.Pointer _objc_msgSend_66( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer locale, + int level, + ) { + return __objc_msgSend_66( + obj, + sel, + locale, + level, + ); + } + + late final __objc_msgSend_66Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_66 = __objc_msgSend_66Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_firstObjectCommonWithArray_1 = + _registerName1("firstObjectCommonWithArray:"); + ffi.Pointer _objc_msgSend_67( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherArray, + ) { + return __objc_msgSend_67( + obj, + sel, + otherArray, + ); + } + + late final __objc_msgSend_67Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_67 = __objc_msgSend_67Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_getObjects_range_1 = _registerName1("getObjects:range:"); + void _objc_msgSend_68( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + NSRange range, + ) { + return __objc_msgSend_68( + obj, + sel, + objects, + range, + ); + } + + late final __objc_msgSend_68Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_68 = __objc_msgSend_68Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, NSRange)>(); + + late final _sel_indexOfObject_1 = _registerName1("indexOfObject:"); + int _objc_msgSend_69( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ) { + return __objc_msgSend_69( + obj, + sel, + anObject, + ); + } + + late final __objc_msgSend_69Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_69 = __objc_msgSend_69Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_indexOfObject_inRange_1 = + _registerName1("indexOfObject:inRange:"); + int _objc_msgSend_70( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + NSRange range, + ) { + return __objc_msgSend_70( + obj, + sel, + anObject, + range, + ); + } + + late final __objc_msgSend_70Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_70 = __objc_msgSend_70Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>(); + + late final _sel_indexOfObjectIdenticalTo_1 = + _registerName1("indexOfObjectIdenticalTo:"); + late final _sel_indexOfObjectIdenticalTo_inRange_1 = + _registerName1("indexOfObjectIdenticalTo:inRange:"); + late final _sel_isEqualToArray_1 = _registerName1("isEqualToArray:"); + bool _objc_msgSend_71( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherArray, + ) { + return __objc_msgSend_71( + obj, + sel, + otherArray, + ); + } + + late final __objc_msgSend_71Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_71 = __objc_msgSend_71Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_firstObject1 = _registerName1("firstObject"); + late final _sel_lastObject1 = _registerName1("lastObject"); + late final _sel_objectEnumerator1 = _registerName1("objectEnumerator"); + ffi.Pointer _objc_msgSend_72( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_72( + obj, + sel, + ); + } + + late final __objc_msgSend_72Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_72 = __objc_msgSend_72Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_reverseObjectEnumerator1 = + _registerName1("reverseObjectEnumerator"); + late final _sel_sortedArrayHint1 = _registerName1("sortedArrayHint"); + late final _sel_sortedArrayUsingFunction_context_1 = + _registerName1("sortedArrayUsingFunction:context:"); + ffi.Pointer _objc_msgSend_73( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + comparator, + ffi.Pointer context, + ) { + return __objc_msgSend_73( + obj, + sel, + comparator, + context, + ); + } + + late final __objc_msgSend_73Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_73 = __objc_msgSend_73Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>(); + + late final _sel_sortedArrayUsingFunction_context_hint_1 = + _registerName1("sortedArrayUsingFunction:context:hint:"); + ffi.Pointer _objc_msgSend_74( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + comparator, + ffi.Pointer context, + ffi.Pointer hint, + ) { + return __objc_msgSend_74( + obj, + sel, + comparator, + context, + hint, + ); + } + + late final __objc_msgSend_74Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_74 = __objc_msgSend_74Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_sortedArrayUsingSelector_1 = + _registerName1("sortedArrayUsingSelector:"); + ffi.Pointer _objc_msgSend_75( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer comparator, + ) { + return __objc_msgSend_75( + obj, + sel, + comparator, + ); + } + + late final __objc_msgSend_75Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_75 = __objc_msgSend_75Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_subarrayWithRange_1 = _registerName1("subarrayWithRange:"); + ffi.Pointer _objc_msgSend_76( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_76( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_76Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_76 = __objc_msgSend_76Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _class_NSError1 = _getClass1("NSError"); + late final _sel_initWithDomain_code_userInfo_1 = + _registerName1("initWithDomain:code:userInfo:"); + instancetype _objc_msgSend_77( + ffi.Pointer obj, + ffi.Pointer sel, + NSErrorDomain domain, + int code, + ) { + return __objc_msgSend_77( + obj, + sel, + domain, + code, + ); + } + + late final __objc_msgSend_77Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + NSErrorDomain, NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_77 = __objc_msgSend_77Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, NSErrorDomain, int)>(); + + late final _sel_errorWithDomain_code_userInfo_1 = + _registerName1("errorWithDomain:code:userInfo:"); + late final _sel_domain1 = _registerName1("domain"); + late final _sel_code1 = _registerName1("code"); + int _objc_msgSend_78( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_78( + obj, + sel, + ); + } + + late final __objc_msgSend_78Ptr = _lookup< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_78 = __objc_msgSend_78Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setKeys_triggerChangeNotificationsForDependentKey_1 = + _registerName1("setKeys:triggerChangeNotificationsForDependentKey:"); + void _objc_msgSend_79( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keys, + ffi.Pointer dependentKey, + ) { + return __objc_msgSend_79( + obj, + sel, + keys, + dependentKey, + ); + } + + late final __objc_msgSend_79Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_79 = __objc_msgSend_79Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_classFallbacksForKeyedArchiver1 = + _registerName1("classFallbacksForKeyedArchiver"); + ffi.Pointer _objc_msgSend_80( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_80( + obj, + sel, + ); + } + + late final __objc_msgSend_80Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_classForKeyedUnarchiver1 = + _registerName1("classForKeyedUnarchiver"); + late final _sel_writeToURL_error_1 = _registerName1("writeToURL:error:"); + bool _objc_msgSend_81( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer> error, + ) { + return __objc_msgSend_81( + obj, + sel, + url, + error, + ); + } + + late final __objc_msgSend_81Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_81 = __objc_msgSend_81Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_makeObjectsPerformSelector_1 = + _registerName1("makeObjectsPerformSelector:"); + late final _sel_makeObjectsPerformSelector_withObject_1 = + _registerName1("makeObjectsPerformSelector:withObject:"); + void _objc_msgSend_82( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer argument, + ) { + return __objc_msgSend_82( + obj, + sel, + aSelector, + argument, + ); + } + + late final __objc_msgSend_82Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_82 = __objc_msgSend_82Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSIndexSet1 = _getClass1("NSIndexSet"); + late final _sel_indexSet1 = _registerName1("indexSet"); + late final _sel_indexSetWithIndex_1 = _registerName1("indexSetWithIndex:"); + late final _sel_indexSetWithIndexesInRange_1 = + _registerName1("indexSetWithIndexesInRange:"); + instancetype _objc_msgSend_83( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_83( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_83Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_83 = __objc_msgSend_83Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_initWithIndexesInRange_1 = + _registerName1("initWithIndexesInRange:"); + late final _sel_initWithIndexSet_1 = _registerName1("initWithIndexSet:"); + instancetype _objc_msgSend_84( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexSet, + ) { + return __objc_msgSend_84( + obj, + sel, + indexSet, + ); + } + + late final __objc_msgSend_84Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_84 = __objc_msgSend_84Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithIndex_1 = _registerName1("initWithIndex:"); + late final _sel_isEqualToIndexSet_1 = _registerName1("isEqualToIndexSet:"); + bool _objc_msgSend_85( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexSet, + ) { + return __objc_msgSend_85( + obj, + sel, + indexSet, + ); + } + + late final __objc_msgSend_85Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_85 = __objc_msgSend_85Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_firstIndex1 = _registerName1("firstIndex"); + late final _sel_lastIndex1 = _registerName1("lastIndex"); + late final _sel_indexGreaterThanIndex_1 = + _registerName1("indexGreaterThanIndex:"); + int _objc_msgSend_86( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_86( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_86Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_86 = __objc_msgSend_86Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_indexLessThanIndex_1 = _registerName1("indexLessThanIndex:"); + late final _sel_indexGreaterThanOrEqualToIndex_1 = + _registerName1("indexGreaterThanOrEqualToIndex:"); + late final _sel_indexLessThanOrEqualToIndex_1 = + _registerName1("indexLessThanOrEqualToIndex:"); + late final _sel_getIndexes_maxCount_inIndexRange_1 = + _registerName1("getIndexes:maxCount:inIndexRange:"); + int _objc_msgSend_87( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexBuffer, + int bufferSize, + NSRangePointer range, + ) { + return __objc_msgSend_87( + obj, + sel, + indexBuffer, + bufferSize, + range, + ); + } + + late final __objc_msgSend_87Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSRangePointer)>>('objc_msgSend'); + late final __objc_msgSend_87 = __objc_msgSend_87Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRangePointer)>(); + + late final _sel_countOfIndexesInRange_1 = + _registerName1("countOfIndexesInRange:"); + int _objc_msgSend_88( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_88( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_88Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_88 = __objc_msgSend_88Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_containsIndex_1 = _registerName1("containsIndex:"); + bool _objc_msgSend_89( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_89( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_89Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_89 = __objc_msgSend_89Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_containsIndexesInRange_1 = + _registerName1("containsIndexesInRange:"); + bool _objc_msgSend_90( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_90( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_90Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_90 = __objc_msgSend_90Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_containsIndexes_1 = _registerName1("containsIndexes:"); + late final _sel_intersectsIndexesInRange_1 = + _registerName1("intersectsIndexesInRange:"); + ffi.Pointer<_ObjCBlockDesc> _newBlockDesc1() { + final d = + pkg_ffi.calloc.allocate<_ObjCBlockDesc>(ffi.sizeOf<_ObjCBlockDesc>()); + d.ref.size = ffi.sizeOf<_ObjCBlock>(); + return d; + } + + late final _objc_block_desc1 = _newBlockDesc1(); + late final _objc_concrete_global_block1 = + _lookup('_NSConcreteGlobalBlock'); + ffi.Pointer<_ObjCBlock> _newBlock1( + ffi.Pointer invoke, ffi.Pointer target) { + final b = pkg_ffi.calloc.allocate<_ObjCBlock>(ffi.sizeOf<_ObjCBlock>()); + b.ref.isa = _objc_concrete_global_block1; + b.ref.invoke = invoke; + b.ref.target = target; + b.ref.descriptor = _objc_block_desc1; + final copy = _Block_copy(b.cast()).cast<_ObjCBlock>(); + pkg_ffi.calloc.free(b); + return copy; + } + + ffi.Pointer _Block_copy( + ffi.Pointer value, + ) { + return __Block_copy( + value, + ); + } + + late final __Block_copyPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('_Block_copy'); + late final __Block_copy = __Block_copyPtr + .asFunction Function(ffi.Pointer)>(); + + void _Block_release( + ffi.Pointer value, + ) { + return __Block_release( + value, + ); + } + + late final __Block_releasePtr = + _lookup)>>( + '_Block_release'); + late final __Block_release = + __Block_releasePtr.asFunction)>(); + + late final _objc_releaseFinalizer11 = + ffi.NativeFinalizer(__Block_releasePtr.cast()); + late final _sel_enumerateIndexesUsingBlock_1 = + _registerName1("enumerateIndexesUsingBlock:"); + void _objc_msgSend_91( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_91( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_91Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_91 = __objc_msgSend_91Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateIndexesWithOptions_usingBlock_1 = + _registerName1("enumerateIndexesWithOptions:usingBlock:"); + void _objc_msgSend_92( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_92( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_92Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_92 = __objc_msgSend_92Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateIndexesInRange_options_usingBlock_1 = + _registerName1("enumerateIndexesInRange:options:usingBlock:"); + void _objc_msgSend_93( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_93( + obj, + sel, + range, + opts, + block, + ); + } + + late final __objc_msgSend_93Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_93 = __objc_msgSend_93Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexPassingTest_1 = _registerName1("indexPassingTest:"); + int _objc_msgSend_94( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_94( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_94Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_94 = __objc_msgSend_94Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexWithOptions_passingTest_1 = + _registerName1("indexWithOptions:passingTest:"); + int _objc_msgSend_95( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_95( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_95Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_95 = __objc_msgSend_95Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexInRange_options_passingTest_1 = + _registerName1("indexInRange:options:passingTest:"); + int _objc_msgSend_96( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_96( + obj, + sel, + range, + opts, + predicate, + ); + } + + late final __objc_msgSend_96Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_96 = __objc_msgSend_96Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexesPassingTest_1 = _registerName1("indexesPassingTest:"); + ffi.Pointer _objc_msgSend_97( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_97( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_97Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_97 = __objc_msgSend_97Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexesWithOptions_passingTest_1 = + _registerName1("indexesWithOptions:passingTest:"); + ffi.Pointer _objc_msgSend_98( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_98( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_98Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_98 = __objc_msgSend_98Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexesInRange_options_passingTest_1 = + _registerName1("indexesInRange:options:passingTest:"); + ffi.Pointer _objc_msgSend_99( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_99( + obj, + sel, + range, + opts, + predicate, + ); + } + + late final __objc_msgSend_99Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_99 = __objc_msgSend_99Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateRangesUsingBlock_1 = + _registerName1("enumerateRangesUsingBlock:"); + void _objc_msgSend_100( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_100( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_100Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_100 = __objc_msgSend_100Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateRangesWithOptions_usingBlock_1 = + _registerName1("enumerateRangesWithOptions:usingBlock:"); + void _objc_msgSend_101( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_101( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_101Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_101 = __objc_msgSend_101Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateRangesInRange_options_usingBlock_1 = + _registerName1("enumerateRangesInRange:options:usingBlock:"); + void _objc_msgSend_102( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_102( + obj, + sel, + range, + opts, + block, + ); + } + + late final __objc_msgSend_102Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_102 = __objc_msgSend_102Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_objectsAtIndexes_1 = _registerName1("objectsAtIndexes:"); + ffi.Pointer _objc_msgSend_103( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexes, + ) { + return __objc_msgSend_103( + obj, + sel, + indexes, + ); + } + + late final __objc_msgSend_103Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_103 = __objc_msgSend_103Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_objectAtIndexedSubscript_1 = + _registerName1("objectAtIndexedSubscript:"); + late final _sel_enumerateObjectsUsingBlock_1 = + _registerName1("enumerateObjectsUsingBlock:"); + void _objc_msgSend_104( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_104( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_104Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_104 = __objc_msgSend_104Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateObjectsWithOptions_usingBlock_1 = + _registerName1("enumerateObjectsWithOptions:usingBlock:"); + void _objc_msgSend_105( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_105( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_105Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_105 = __objc_msgSend_105Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateObjectsAtIndexes_options_usingBlock_1 = + _registerName1("enumerateObjectsAtIndexes:options:usingBlock:"); + void _objc_msgSend_106( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer s, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_106( + obj, + sel, + s, + opts, + block, + ); + } + + late final __objc_msgSend_106Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_106 = __objc_msgSend_106Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexOfObjectPassingTest_1 = + _registerName1("indexOfObjectPassingTest:"); + int _objc_msgSend_107( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_107( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_107Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_107 = __objc_msgSend_107Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexOfObjectWithOptions_passingTest_1 = + _registerName1("indexOfObjectWithOptions:passingTest:"); + int _objc_msgSend_108( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_108( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_108Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_108 = __objc_msgSend_108Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexOfObjectAtIndexes_options_passingTest_1 = + _registerName1("indexOfObjectAtIndexes:options:passingTest:"); + int _objc_msgSend_109( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer s, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_109( + obj, + sel, + s, + opts, + predicate, + ); + } + + late final __objc_msgSend_109Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_109 = __objc_msgSend_109Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexesOfObjectsPassingTest_1 = + _registerName1("indexesOfObjectsPassingTest:"); + ffi.Pointer _objc_msgSend_110( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_110( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_110Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_110 = __objc_msgSend_110Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexesOfObjectsWithOptions_passingTest_1 = + _registerName1("indexesOfObjectsWithOptions:passingTest:"); + ffi.Pointer _objc_msgSend_111( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_111( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_111Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_111 = __objc_msgSend_111Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexesOfObjectsAtIndexes_options_passingTest_1 = + _registerName1("indexesOfObjectsAtIndexes:options:passingTest:"); + ffi.Pointer _objc_msgSend_112( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer s, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_112( + obj, + sel, + s, + opts, + predicate, + ); + } + + late final __objc_msgSend_112Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_112 = __objc_msgSend_112Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_sortedArrayUsingComparator_1 = + _registerName1("sortedArrayUsingComparator:"); + ffi.Pointer _objc_msgSend_113( + ffi.Pointer obj, + ffi.Pointer sel, + NSComparator cmptr, + ) { + return __objc_msgSend_113( + obj, + sel, + cmptr, + ); + } + + late final __objc_msgSend_113Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSComparator)>>('objc_msgSend'); + late final __objc_msgSend_113 = __objc_msgSend_113Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSComparator)>(); + + late final _sel_sortedArrayWithOptions_usingComparator_1 = + _registerName1("sortedArrayWithOptions:usingComparator:"); + ffi.Pointer _objc_msgSend_114( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + NSComparator cmptr, + ) { + return __objc_msgSend_114( + obj, + sel, + opts, + cmptr, + ); + } + + late final __objc_msgSend_114Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32, NSComparator)>>('objc_msgSend'); + late final __objc_msgSend_114 = __objc_msgSend_114Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int, NSComparator)>(); + + late final _sel_indexOfObject_inSortedRange_options_usingComparator_1 = + _registerName1("indexOfObject:inSortedRange:options:usingComparator:"); + int _objc_msgSend_115( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer obj1, + NSRange r, + int opts, + NSComparator cmp, + ) { + return __objc_msgSend_115( + obj, + sel, + obj1, + r, + opts, + cmp, + ); + } + + late final __objc_msgSend_115Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Int32, + NSComparator)>>('objc_msgSend'); + late final __objc_msgSend_115 = __objc_msgSend_115Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange, int, NSComparator)>(); + + late final _sel_array1 = _registerName1("array"); + late final _sel_arrayWithObject_1 = _registerName1("arrayWithObject:"); + late final _sel_arrayWithObjects_count_1 = + _registerName1("arrayWithObjects:count:"); + late final _sel_arrayWithObjects_1 = _registerName1("arrayWithObjects:"); + late final _sel_arrayWithArray_1 = _registerName1("arrayWithArray:"); + late final _sel_initWithObjects_1 = _registerName1("initWithObjects:"); + late final _sel_initWithArray_1 = _registerName1("initWithArray:"); + late final _sel_initWithArray_copyItems_1 = + _registerName1("initWithArray:copyItems:"); + instancetype _objc_msgSend_116( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer array, + bool flag, + ) { + return __objc_msgSend_116( + obj, + sel, + array, + flag, + ); + } + + late final __objc_msgSend_116Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_116 = __objc_msgSend_116Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_initWithContentsOfURL_error_1 = + _registerName1("initWithContentsOfURL:error:"); + ffi.Pointer _objc_msgSend_117( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer> error, + ) { + return __objc_msgSend_117( + obj, + sel, + url, + error, + ); + } + + late final __objc_msgSend_117Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_117 = __objc_msgSend_117Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_arrayWithContentsOfURL_error_1 = + _registerName1("arrayWithContentsOfURL:error:"); + late final _sel_getObjects_1 = _registerName1("getObjects:"); + void _objc_msgSend_118( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + ) { + return __objc_msgSend_118( + obj, + sel, + objects, + ); + } + + late final __objc_msgSend_118Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_118 = __objc_msgSend_118Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_arrayWithContentsOfFile_1 = + _registerName1("arrayWithContentsOfFile:"); + ffi.Pointer _objc_msgSend_119( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ) { + return __objc_msgSend_119( + obj, + sel, + path, + ); + } + + late final __objc_msgSend_119Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_119 = __objc_msgSend_119Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_arrayWithContentsOfURL_1 = + _registerName1("arrayWithContentsOfURL:"); + ffi.Pointer _objc_msgSend_120( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ) { + return __objc_msgSend_120( + obj, + sel, + url, + ); + } + + late final __objc_msgSend_120Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_120 = __objc_msgSend_120Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithContentsOfFile_1 = + _registerName1("initWithContentsOfFile:"); + late final _sel_initWithContentsOfURL_1 = + _registerName1("initWithContentsOfURL:"); + late final _sel_writeToURL_atomically_1 = + _registerName1("writeToURL:atomically:"); + bool _objc_msgSend_121( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + bool atomically, + ) { + return __objc_msgSend_121( + obj, + sel, + url, + atomically, + ); + } + + late final __objc_msgSend_121Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_121 = __objc_msgSend_121Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_pathsMatchingExtensions_1 = + _registerName1("pathsMatchingExtensions:"); + late final _sel_valueForKey_1 = _registerName1("valueForKey:"); + late final _sel_setValue_forKey_1 = _registerName1("setValue:forKey:"); + void _objc_msgSend_122( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ffi.Pointer key, + ) { + return __objc_msgSend_122( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_122Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_122 = __objc_msgSend_122Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_addObserver_toObjectsAtIndexes_forKeyPath_options_context_1 = + _registerName1( + "addObserver:toObjectsAtIndexes:forKeyPath:options:context:"); + void _objc_msgSend_123( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer observer, + ffi.Pointer indexes, + ffi.Pointer keyPath, + int options, + ffi.Pointer context, + ) { + return __objc_msgSend_123( + obj, + sel, + observer, + indexes, + keyPath, + options, + context, + ); + } + + late final __objc_msgSend_123Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_123 = __objc_msgSend_123Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final _sel_removeObserver_fromObjectsAtIndexes_forKeyPath_context_1 = + _registerName1("removeObserver:fromObjectsAtIndexes:forKeyPath:context:"); + void _objc_msgSend_124( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer observer, + ffi.Pointer indexes, + ffi.Pointer keyPath, + ffi.Pointer context, + ) { + return __objc_msgSend_124( + obj, + sel, + observer, + indexes, + keyPath, + context, + ); + } + + late final __objc_msgSend_124Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_124 = __objc_msgSend_124Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeObserver_fromObjectsAtIndexes_forKeyPath_1 = + _registerName1("removeObserver:fromObjectsAtIndexes:forKeyPath:"); + void _objc_msgSend_125( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer observer, + ffi.Pointer indexes, + ffi.Pointer keyPath, + ) { + return __objc_msgSend_125( + obj, + sel, + observer, + indexes, + keyPath, + ); + } + + late final __objc_msgSend_125Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_125 = __objc_msgSend_125Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_addObserver_forKeyPath_options_context_1 = + _registerName1("addObserver:forKeyPath:options:context:"); + void _objc_msgSend_126( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer observer, + ffi.Pointer keyPath, + int options, + ffi.Pointer context, + ) { + return __objc_msgSend_126( + obj, + sel, + observer, + keyPath, + options, + context, + ); + } + + late final __objc_msgSend_126Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_126 = __objc_msgSend_126Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final _sel_removeObserver_forKeyPath_context_1 = + _registerName1("removeObserver:forKeyPath:context:"); + void _objc_msgSend_127( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer observer, + ffi.Pointer keyPath, + ffi.Pointer context, + ) { + return __objc_msgSend_127( + obj, + sel, + observer, + keyPath, + context, + ); + } + + late final __objc_msgSend_127Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_127 = __objc_msgSend_127Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeObserver_forKeyPath_1 = + _registerName1("removeObserver:forKeyPath:"); + void _objc_msgSend_128( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer observer, + ffi.Pointer keyPath, + ) { + return __objc_msgSend_128( + obj, + sel, + observer, + keyPath, + ); + } + + late final __objc_msgSend_128Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_128 = __objc_msgSend_128Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_sortedArrayUsingDescriptors_1 = + _registerName1("sortedArrayUsingDescriptors:"); + late final _class_NSPredicate1 = _getClass1("NSPredicate"); + late final _sel_predicateWithFormat_argumentArray_1 = + _registerName1("predicateWithFormat:argumentArray:"); + ffi.Pointer _objc_msgSend_129( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicateFormat, + ffi.Pointer arguments, + ) { + return __objc_msgSend_129( + obj, + sel, + predicateFormat, + arguments, + ); + } + + late final __objc_msgSend_129Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_129 = __objc_msgSend_129Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_predicateWithFormat_1 = + _registerName1("predicateWithFormat:"); + ffi.Pointer _objc_msgSend_130( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicateFormat, + ) { + return __objc_msgSend_130( + obj, + sel, + predicateFormat, + ); + } + + late final __objc_msgSend_130Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_130 = __objc_msgSend_130Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_predicateWithFormat_arguments_1 = + _registerName1("predicateWithFormat:arguments:"); + ffi.Pointer _objc_msgSend_131( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicateFormat, + ffi.Pointer<__va_list_tag> argList, + ) { + return __objc_msgSend_131( + obj, + sel, + predicateFormat, + argList, + ); + } + + late final __objc_msgSend_131Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); + late final __objc_msgSend_131 = __objc_msgSend_131Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>(); + + late final _sel_predicateFromMetadataQueryString_1 = + _registerName1("predicateFromMetadataQueryString:"); + late final _sel_predicateWithValue_1 = _registerName1("predicateWithValue:"); + ffi.Pointer _objc_msgSend_132( + ffi.Pointer obj, + ffi.Pointer sel, + bool value, + ) { + return __objc_msgSend_132( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_132Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_132 = __objc_msgSend_132Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _class_NSDictionary1 = _getClass1("NSDictionary"); + late final _sel_objectForKey_1 = _registerName1("objectForKey:"); + late final _sel_keyEnumerator1 = _registerName1("keyEnumerator"); + late final _sel_initWithObjects_forKeys_count_1 = + _registerName1("initWithObjects:forKeys:count:"); + instancetype _objc_msgSend_133( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + ffi.Pointer> keys, + int cnt, + ) { + return __objc_msgSend_133( + obj, + sel, + objects, + keys, + cnt, + ); + } + + late final __objc_msgSend_133Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_133 = __objc_msgSend_133Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + int)>(); + + late final _sel_allKeys1 = _registerName1("allKeys"); + late final _sel_allKeysForObject_1 = _registerName1("allKeysForObject:"); + late final _sel_allValues1 = _registerName1("allValues"); + late final _sel_descriptionInStringsFileFormat1 = + _registerName1("descriptionInStringsFileFormat"); + late final _sel_isEqualToDictionary_1 = + _registerName1("isEqualToDictionary:"); + bool _objc_msgSend_134( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherDictionary, + ) { + return __objc_msgSend_134( + obj, + sel, + otherDictionary, + ); + } + + late final __objc_msgSend_134Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_134 = __objc_msgSend_134Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_objectsForKeys_notFoundMarker_1 = + _registerName1("objectsForKeys:notFoundMarker:"); + ffi.Pointer _objc_msgSend_135( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keys, + ffi.Pointer marker, + ) { + return __objc_msgSend_135( + obj, + sel, + keys, + marker, + ); + } + + late final __objc_msgSend_135Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_135 = __objc_msgSend_135Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_keysSortedByValueUsingSelector_1 = + _registerName1("keysSortedByValueUsingSelector:"); + late final _sel_getObjects_andKeys_count_1 = + _registerName1("getObjects:andKeys:count:"); + void _objc_msgSend_136( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + ffi.Pointer> keys, + int count, + ) { + return __objc_msgSend_136( + obj, + sel, + objects, + keys, + count, + ); + } + + late final __objc_msgSend_136Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_136 = __objc_msgSend_136Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + int)>(); + + late final _sel_objectForKeyedSubscript_1 = + _registerName1("objectForKeyedSubscript:"); + late final _sel_enumerateKeysAndObjectsUsingBlock_1 = + _registerName1("enumerateKeysAndObjectsUsingBlock:"); + void _objc_msgSend_137( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_137( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_137Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_137 = __objc_msgSend_137Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateKeysAndObjectsWithOptions_usingBlock_1 = + _registerName1("enumerateKeysAndObjectsWithOptions:usingBlock:"); + void _objc_msgSend_138( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_138( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_138Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_138 = __objc_msgSend_138Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_keysSortedByValueUsingComparator_1 = + _registerName1("keysSortedByValueUsingComparator:"); + late final _sel_keysSortedByValueWithOptions_usingComparator_1 = + _registerName1("keysSortedByValueWithOptions:usingComparator:"); + late final _sel_getObjects_andKeys_1 = _registerName1("getObjects:andKeys:"); + void _objc_msgSend_139( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + ffi.Pointer> keys, + ) { + return __objc_msgSend_139( + obj, + sel, + objects, + keys, + ); + } + + late final __objc_msgSend_139Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_139 = __objc_msgSend_139Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_dictionaryWithContentsOfFile_1 = + _registerName1("dictionaryWithContentsOfFile:"); + ffi.Pointer _objc_msgSend_140( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ) { + return __objc_msgSend_140( + obj, + sel, + path, + ); + } + + late final __objc_msgSend_140Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_140 = __objc_msgSend_140Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_dictionaryWithContentsOfURL_1 = + _registerName1("dictionaryWithContentsOfURL:"); + ffi.Pointer _objc_msgSend_141( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ) { + return __objc_msgSend_141( + obj, + sel, + url, + ); + } + + late final __objc_msgSend_141Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_141 = __objc_msgSend_141Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_dictionary1 = _registerName1("dictionary"); + late final _sel_dictionaryWithObject_forKey_1 = + _registerName1("dictionaryWithObject:forKey:"); + instancetype _objc_msgSend_142( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer object, + ffi.Pointer key, + ) { + return __objc_msgSend_142( + obj, + sel, + object, + key, + ); + } + + late final __objc_msgSend_142Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_142 = __objc_msgSend_142Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_dictionaryWithObjects_forKeys_count_1 = + _registerName1("dictionaryWithObjects:forKeys:count:"); + late final _sel_dictionaryWithObjectsAndKeys_1 = + _registerName1("dictionaryWithObjectsAndKeys:"); + late final _sel_dictionaryWithDictionary_1 = + _registerName1("dictionaryWithDictionary:"); + instancetype _objc_msgSend_143( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dict, + ) { + return __objc_msgSend_143( + obj, + sel, + dict, + ); + } + + late final __objc_msgSend_143Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_143 = __objc_msgSend_143Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_dictionaryWithObjects_forKeys_1 = + _registerName1("dictionaryWithObjects:forKeys:"); + instancetype _objc_msgSend_144( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer objects, + ffi.Pointer keys, + ) { + return __objc_msgSend_144( + obj, + sel, + objects, + keys, + ); + } + + late final __objc_msgSend_144Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_144 = __objc_msgSend_144Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithObjectsAndKeys_1 = + _registerName1("initWithObjectsAndKeys:"); + late final _sel_initWithDictionary_1 = _registerName1("initWithDictionary:"); + late final _sel_initWithDictionary_copyItems_1 = + _registerName1("initWithDictionary:copyItems:"); + instancetype _objc_msgSend_145( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherDictionary, + bool flag, + ) { + return __objc_msgSend_145( + obj, + sel, + otherDictionary, + flag, + ); + } + + late final __objc_msgSend_145Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_145 = __objc_msgSend_145Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_initWithObjects_forKeys_1 = + _registerName1("initWithObjects:forKeys:"); + ffi.Pointer _objc_msgSend_146( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer> error, + ) { + return __objc_msgSend_146( + obj, + sel, + url, + error, + ); + } + + late final __objc_msgSend_146Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_146 = __objc_msgSend_146Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_dictionaryWithContentsOfURL_error_1 = + _registerName1("dictionaryWithContentsOfURL:error:"); + late final _sel_sharedKeySetForKeys_1 = + _registerName1("sharedKeySetForKeys:"); + late final _sel_countByEnumeratingWithState_objects_count_1 = + _registerName1("countByEnumeratingWithState:objects:count:"); + int _objc_msgSend_147( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer state, + ffi.Pointer> buffer, + int len, + ) { + return __objc_msgSend_147( + obj, + sel, + state, + buffer, + len, + ); + } + + late final __objc_msgSend_147Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_147 = __objc_msgSend_147Ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + int)>(); + + late final _sel_fileSize1 = _registerName1("fileSize"); + int _objc_msgSend_148( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_148( + obj, + sel, + ); + } + + late final __objc_msgSend_148Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLongLong Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_148 = __objc_msgSend_148Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSDate1 = _getClass1("NSDate"); + late final _sel_timeIntervalSinceReferenceDate1 = + _registerName1("timeIntervalSinceReferenceDate"); + double _objc_msgSend_149( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_149( + obj, + sel, + ); + } + + late final __objc_msgSend_149Ptr = _lookup< + ffi.NativeFunction< + NSTimeInterval Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_149 = __objc_msgSend_149Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithTimeIntervalSinceReferenceDate_1 = + _registerName1("initWithTimeIntervalSinceReferenceDate:"); + instancetype _objc_msgSend_150( + ffi.Pointer obj, + ffi.Pointer sel, + double ti, + ) { + return __objc_msgSend_150( + obj, + sel, + ti, + ); + } + + late final __objc_msgSend_150Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + NSTimeInterval)>>('objc_msgSend'); + late final __objc_msgSend_150 = __objc_msgSend_150Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_timeIntervalSinceDate_1 = + _registerName1("timeIntervalSinceDate:"); + double _objc_msgSend_151( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anotherDate, + ) { + return __objc_msgSend_151( + obj, + sel, + anotherDate, + ); + } + + late final __objc_msgSend_151Ptr = _lookup< + ffi.NativeFunction< + NSTimeInterval Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_151 = __objc_msgSend_151Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_timeIntervalSinceNow1 = + _registerName1("timeIntervalSinceNow"); + late final _sel_timeIntervalSince19701 = + _registerName1("timeIntervalSince1970"); + late final _sel_addTimeInterval_1 = _registerName1("addTimeInterval:"); + late final _sel_dateByAddingTimeInterval_1 = + _registerName1("dateByAddingTimeInterval:"); + late final _sel_earlierDate_1 = _registerName1("earlierDate:"); + ffi.Pointer _objc_msgSend_152( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anotherDate, + ) { + return __objc_msgSend_152( + obj, + sel, + anotherDate, + ); + } + + late final __objc_msgSend_152Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_152 = __objc_msgSend_152Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_laterDate_1 = _registerName1("laterDate:"); + late final _sel_compare_1 = _registerName1("compare:"); + int _objc_msgSend_153( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_153( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_153Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_153 = __objc_msgSend_153Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_isEqualToDate_1 = _registerName1("isEqualToDate:"); + bool _objc_msgSend_154( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherDate, + ) { + return __objc_msgSend_154( + obj, + sel, + otherDate, + ); + } + + late final __objc_msgSend_154Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_154 = __objc_msgSend_154Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_date1 = _registerName1("date"); + late final _sel_dateWithTimeIntervalSinceNow_1 = + _registerName1("dateWithTimeIntervalSinceNow:"); + late final _sel_dateWithTimeIntervalSinceReferenceDate_1 = + _registerName1("dateWithTimeIntervalSinceReferenceDate:"); + late final _sel_dateWithTimeIntervalSince1970_1 = + _registerName1("dateWithTimeIntervalSince1970:"); + late final _sel_dateWithTimeInterval_sinceDate_1 = + _registerName1("dateWithTimeInterval:sinceDate:"); + instancetype _objc_msgSend_155( + ffi.Pointer obj, + ffi.Pointer sel, + double secsToBeAdded, + ffi.Pointer date, + ) { + return __objc_msgSend_155( + obj, + sel, + secsToBeAdded, + date, + ); + } + + late final __objc_msgSend_155Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + NSTimeInterval, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_155 = __objc_msgSend_155Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + double, ffi.Pointer)>(); + + late final _sel_distantFuture1 = _registerName1("distantFuture"); + ffi.Pointer _objc_msgSend_156( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_156( + obj, + sel, + ); + } + + late final __objc_msgSend_156Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_156 = __objc_msgSend_156Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_distantPast1 = _registerName1("distantPast"); + late final _sel_now1 = _registerName1("now"); + late final _sel_initWithTimeIntervalSinceNow_1 = + _registerName1("initWithTimeIntervalSinceNow:"); + late final _sel_initWithTimeIntervalSince1970_1 = + _registerName1("initWithTimeIntervalSince1970:"); + late final _sel_initWithTimeInterval_sinceDate_1 = + _registerName1("initWithTimeInterval:sinceDate:"); + late final _sel_dateWithNaturalLanguageString_locale_1 = + _registerName1("dateWithNaturalLanguageString:locale:"); + ffi.Pointer _objc_msgSend_157( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + ffi.Pointer locale, + ) { + return __objc_msgSend_157( + obj, + sel, + string, + locale, + ); + } + + late final __objc_msgSend_157Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_157 = __objc_msgSend_157Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_dateWithNaturalLanguageString_1 = + _registerName1("dateWithNaturalLanguageString:"); + late final _sel_dateWithString_1 = _registerName1("dateWithString:"); + late final _class_NSCalendarDate1 = _getClass1("NSCalendarDate"); + late final _sel_calendarDate1 = _registerName1("calendarDate"); + late final _sel_dateWithString_calendarFormat_locale_1 = + _registerName1("dateWithString:calendarFormat:locale:"); + ffi.Pointer _objc_msgSend_158( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer description, + ffi.Pointer format, + ffi.Pointer locale, + ) { + return __objc_msgSend_158( + obj, + sel, + description, + format, + locale, + ); + } + + late final __objc_msgSend_158Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_158 = __objc_msgSend_158Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_dateWithString_calendarFormat_1 = + _registerName1("dateWithString:calendarFormat:"); + ffi.Pointer _objc_msgSend_159( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer description, + ffi.Pointer format, + ) { + return __objc_msgSend_159( + obj, + sel, + description, + format, + ); + } + + late final __objc_msgSend_159Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_159 = __objc_msgSend_159Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSTimeZone1 = _getClass1("NSTimeZone"); + late final _sel_name1 = _registerName1("name"); + late final _sel_data1 = _registerName1("data"); + late final _sel_secondsFromGMTForDate_1 = + _registerName1("secondsFromGMTForDate:"); + int _objc_msgSend_160( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aDate, + ) { + return __objc_msgSend_160( + obj, + sel, + aDate, + ); + } + + late final __objc_msgSend_160Ptr = _lookup< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_160 = __objc_msgSend_160Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_abbreviationForDate_1 = + _registerName1("abbreviationForDate:"); + ffi.Pointer _objc_msgSend_161( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aDate, + ) { + return __objc_msgSend_161( + obj, + sel, + aDate, + ); + } + + late final __objc_msgSend_161Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_161 = __objc_msgSend_161Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isDaylightSavingTimeForDate_1 = + _registerName1("isDaylightSavingTimeForDate:"); + late final _sel_daylightSavingTimeOffsetForDate_1 = + _registerName1("daylightSavingTimeOffsetForDate:"); + late final _sel_nextDaylightSavingTimeTransitionAfterDate_1 = + _registerName1("nextDaylightSavingTimeTransitionAfterDate:"); + late final _sel_systemTimeZone1 = _registerName1("systemTimeZone"); + ffi.Pointer _objc_msgSend_162( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_162( + obj, + sel, + ); + } + + late final __objc_msgSend_162Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_162 = __objc_msgSend_162Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_resetSystemTimeZone1 = _registerName1("resetSystemTimeZone"); + late final _sel_defaultTimeZone1 = _registerName1("defaultTimeZone"); + late final _sel_setDefaultTimeZone_1 = _registerName1("setDefaultTimeZone:"); + void _objc_msgSend_163( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_163( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_163Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_163 = __objc_msgSend_163Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_localTimeZone1 = _registerName1("localTimeZone"); + late final _sel_knownTimeZoneNames1 = _registerName1("knownTimeZoneNames"); + late final _sel_abbreviationDictionary1 = + _registerName1("abbreviationDictionary"); + ffi.Pointer _objc_msgSend_164( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_164( + obj, + sel, + ); + } + + late final __objc_msgSend_164Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_164 = __objc_msgSend_164Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setAbbreviationDictionary_1 = + _registerName1("setAbbreviationDictionary:"); + void _objc_msgSend_165( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_165( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_165Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_165 = __objc_msgSend_165Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_timeZoneDataVersion1 = _registerName1("timeZoneDataVersion"); + late final _sel_secondsFromGMT1 = _registerName1("secondsFromGMT"); + late final _sel_abbreviation1 = _registerName1("abbreviation"); + late final _sel_isDaylightSavingTime1 = + _registerName1("isDaylightSavingTime"); + late final _sel_daylightSavingTimeOffset1 = + _registerName1("daylightSavingTimeOffset"); + late final _sel_nextDaylightSavingTimeTransition1 = + _registerName1("nextDaylightSavingTimeTransition"); + late final _sel_isEqualToTimeZone_1 = _registerName1("isEqualToTimeZone:"); + bool _objc_msgSend_166( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aTimeZone, + ) { + return __objc_msgSend_166( + obj, + sel, + aTimeZone, + ); + } + + late final __objc_msgSend_166Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_166 = __objc_msgSend_166Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSLocale1 = _getClass1("NSLocale"); + late final _sel_displayNameForKey_value_1 = + _registerName1("displayNameForKey:value:"); + ffi.Pointer _objc_msgSend_167( + ffi.Pointer obj, + ffi.Pointer sel, + NSLocaleKey key, + ffi.Pointer value, + ) { + return __objc_msgSend_167( + obj, + sel, + key, + value, + ); + } + + late final __objc_msgSend_167Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSLocaleKey, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_167 = __objc_msgSend_167Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSLocaleKey, ffi.Pointer)>(); + + late final _sel_initWithLocaleIdentifier_1 = + _registerName1("initWithLocaleIdentifier:"); + late final _sel_localeIdentifier1 = _registerName1("localeIdentifier"); + late final _sel_localizedStringForLocaleIdentifier_1 = + _registerName1("localizedStringForLocaleIdentifier:"); + late final _sel_languageCode1 = _registerName1("languageCode"); + late final _sel_localizedStringForLanguageCode_1 = + _registerName1("localizedStringForLanguageCode:"); + late final _sel_countryCode1 = _registerName1("countryCode"); + late final _sel_localizedStringForCountryCode_1 = + _registerName1("localizedStringForCountryCode:"); + late final _sel_scriptCode1 = _registerName1("scriptCode"); + late final _sel_localizedStringForScriptCode_1 = + _registerName1("localizedStringForScriptCode:"); + late final _sel_variantCode1 = _registerName1("variantCode"); + late final _sel_localizedStringForVariantCode_1 = + _registerName1("localizedStringForVariantCode:"); + late final _class_NSCharacterSet1 = _getClass1("NSCharacterSet"); + late final _sel_controlCharacterSet1 = _registerName1("controlCharacterSet"); + ffi.Pointer _objc_msgSend_168( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_168( + obj, + sel, + ); + } + + late final __objc_msgSend_168Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_168 = __objc_msgSend_168Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_whitespaceCharacterSet1 = + _registerName1("whitespaceCharacterSet"); + late final _sel_whitespaceAndNewlineCharacterSet1 = + _registerName1("whitespaceAndNewlineCharacterSet"); + late final _sel_decimalDigitCharacterSet1 = + _registerName1("decimalDigitCharacterSet"); + late final _sel_letterCharacterSet1 = _registerName1("letterCharacterSet"); + late final _sel_lowercaseLetterCharacterSet1 = + _registerName1("lowercaseLetterCharacterSet"); + late final _sel_uppercaseLetterCharacterSet1 = + _registerName1("uppercaseLetterCharacterSet"); + late final _sel_nonBaseCharacterSet1 = _registerName1("nonBaseCharacterSet"); + late final _sel_alphanumericCharacterSet1 = + _registerName1("alphanumericCharacterSet"); + late final _sel_decomposableCharacterSet1 = + _registerName1("decomposableCharacterSet"); + late final _sel_illegalCharacterSet1 = _registerName1("illegalCharacterSet"); + late final _sel_punctuationCharacterSet1 = + _registerName1("punctuationCharacterSet"); + late final _sel_capitalizedLetterCharacterSet1 = + _registerName1("capitalizedLetterCharacterSet"); + late final _sel_symbolCharacterSet1 = _registerName1("symbolCharacterSet"); + late final _sel_newlineCharacterSet1 = _registerName1("newlineCharacterSet"); + late final _sel_characterSetWithRange_1 = + _registerName1("characterSetWithRange:"); + ffi.Pointer _objc_msgSend_169( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange aRange, + ) { + return __objc_msgSend_169( + obj, + sel, + aRange, + ); + } + + late final __objc_msgSend_169Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_169 = __objc_msgSend_169Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_characterSetWithCharactersInString_1 = + _registerName1("characterSetWithCharactersInString:"); + ffi.Pointer _objc_msgSend_170( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aString, + ) { + return __objc_msgSend_170( + obj, + sel, + aString, + ); + } + + late final __objc_msgSend_170Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_170 = __objc_msgSend_170Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_characterSetWithBitmapRepresentation_1 = + _registerName1("characterSetWithBitmapRepresentation:"); + ffi.Pointer _objc_msgSend_171( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ) { + return __objc_msgSend_171( + obj, + sel, + data, + ); + } + + late final __objc_msgSend_171Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_171 = __objc_msgSend_171Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_characterSetWithContentsOfFile_1 = + _registerName1("characterSetWithContentsOfFile:"); + late final _sel_characterIsMember_1 = _registerName1("characterIsMember:"); + bool _objc_msgSend_172( + ffi.Pointer obj, + ffi.Pointer sel, + int aCharacter, + ) { + return __objc_msgSend_172( + obj, + sel, + aCharacter, + ); + } + + late final __objc_msgSend_172Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + unichar)>>('objc_msgSend'); + late final __objc_msgSend_172 = __objc_msgSend_172Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_bitmapRepresentation1 = + _registerName1("bitmapRepresentation"); + late final _sel_invertedSet1 = _registerName1("invertedSet"); + late final _sel_longCharacterIsMember_1 = + _registerName1("longCharacterIsMember:"); + bool _objc_msgSend_173( + ffi.Pointer obj, + ffi.Pointer sel, + int theLongChar, + ) { + return __objc_msgSend_173( + obj, + sel, + theLongChar, + ); + } + + late final __objc_msgSend_173Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + UTF32Char)>>('objc_msgSend'); + late final __objc_msgSend_173 = __objc_msgSend_173Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_isSupersetOfSet_1 = _registerName1("isSupersetOfSet:"); + bool _objc_msgSend_174( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer theOtherSet, + ) { + return __objc_msgSend_174( + obj, + sel, + theOtherSet, + ); + } + + late final __objc_msgSend_174Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_174 = __objc_msgSend_174Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_hasMemberInPlane_1 = _registerName1("hasMemberInPlane:"); + bool _objc_msgSend_175( + ffi.Pointer obj, + ffi.Pointer sel, + int thePlane, + ) { + return __objc_msgSend_175( + obj, + sel, + thePlane, + ); + } + + late final __objc_msgSend_175Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8)>>('objc_msgSend'); + late final __objc_msgSend_175 = __objc_msgSend_175Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_URLUserAllowedCharacterSet1 = + _registerName1("URLUserAllowedCharacterSet"); + late final _sel_URLPasswordAllowedCharacterSet1 = + _registerName1("URLPasswordAllowedCharacterSet"); + late final _sel_URLHostAllowedCharacterSet1 = + _registerName1("URLHostAllowedCharacterSet"); + late final _sel_URLPathAllowedCharacterSet1 = + _registerName1("URLPathAllowedCharacterSet"); + late final _sel_URLQueryAllowedCharacterSet1 = + _registerName1("URLQueryAllowedCharacterSet"); + late final _sel_URLFragmentAllowedCharacterSet1 = + _registerName1("URLFragmentAllowedCharacterSet"); + late final _sel_exemplarCharacterSet1 = + _registerName1("exemplarCharacterSet"); + late final _sel_calendarIdentifier1 = _registerName1("calendarIdentifier"); + late final _sel_localizedStringForCalendarIdentifier_1 = + _registerName1("localizedStringForCalendarIdentifier:"); + late final _sel_collationIdentifier1 = _registerName1("collationIdentifier"); + late final _sel_localizedStringForCollationIdentifier_1 = + _registerName1("localizedStringForCollationIdentifier:"); + late final _sel_usesMetricSystem1 = _registerName1("usesMetricSystem"); + late final _sel_decimalSeparator1 = _registerName1("decimalSeparator"); + late final _sel_groupingSeparator1 = _registerName1("groupingSeparator"); + late final _sel_currencySymbol1 = _registerName1("currencySymbol"); + late final _sel_currencyCode1 = _registerName1("currencyCode"); + late final _sel_localizedStringForCurrencyCode_1 = + _registerName1("localizedStringForCurrencyCode:"); + late final _sel_collatorIdentifier1 = _registerName1("collatorIdentifier"); + late final _sel_localizedStringForCollatorIdentifier_1 = + _registerName1("localizedStringForCollatorIdentifier:"); + late final _sel_quotationBeginDelimiter1 = + _registerName1("quotationBeginDelimiter"); + late final _sel_quotationEndDelimiter1 = + _registerName1("quotationEndDelimiter"); + late final _sel_alternateQuotationBeginDelimiter1 = + _registerName1("alternateQuotationBeginDelimiter"); + late final _sel_alternateQuotationEndDelimiter1 = + _registerName1("alternateQuotationEndDelimiter"); + late final _sel_autoupdatingCurrentLocale1 = + _registerName1("autoupdatingCurrentLocale"); + ffi.Pointer _objc_msgSend_176( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_176( + obj, + sel, + ); + } + + late final __objc_msgSend_176Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_176 = __objc_msgSend_176Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_currentLocale1 = _registerName1("currentLocale"); + late final _sel_systemLocale1 = _registerName1("systemLocale"); + late final _sel_localeWithLocaleIdentifier_1 = + _registerName1("localeWithLocaleIdentifier:"); + late final _sel_availableLocaleIdentifiers1 = + _registerName1("availableLocaleIdentifiers"); + late final _sel_ISOLanguageCodes1 = _registerName1("ISOLanguageCodes"); + late final _sel_ISOCountryCodes1 = _registerName1("ISOCountryCodes"); + late final _sel_ISOCurrencyCodes1 = _registerName1("ISOCurrencyCodes"); + late final _sel_commonISOCurrencyCodes1 = + _registerName1("commonISOCurrencyCodes"); + late final _sel_preferredLanguages1 = _registerName1("preferredLanguages"); + late final _sel_componentsFromLocaleIdentifier_1 = + _registerName1("componentsFromLocaleIdentifier:"); + late final _sel_localeIdentifierFromComponents_1 = + _registerName1("localeIdentifierFromComponents:"); + ffi.Pointer _objc_msgSend_177( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dict, + ) { + return __objc_msgSend_177( + obj, + sel, + dict, + ); + } + + late final __objc_msgSend_177Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_177 = __objc_msgSend_177Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_canonicalLocaleIdentifierFromString_1 = + _registerName1("canonicalLocaleIdentifierFromString:"); + late final _sel_canonicalLanguageIdentifierFromString_1 = + _registerName1("canonicalLanguageIdentifierFromString:"); + late final _sel_localeIdentifierFromWindowsLocaleCode_1 = + _registerName1("localeIdentifierFromWindowsLocaleCode:"); + ffi.Pointer _objc_msgSend_178( + ffi.Pointer obj, + ffi.Pointer sel, + int lcid, + ) { + return __objc_msgSend_178( + obj, + sel, + lcid, + ); + } + + late final __objc_msgSend_178Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Uint32)>>('objc_msgSend'); + late final __objc_msgSend_178 = __objc_msgSend_178Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_windowsLocaleCodeFromLocaleIdentifier_1 = + _registerName1("windowsLocaleCodeFromLocaleIdentifier:"); + int _objc_msgSend_179( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer localeIdentifier, + ) { + return __objc_msgSend_179( + obj, + sel, + localeIdentifier, + ); + } + + late final __objc_msgSend_179Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_179 = __objc_msgSend_179Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_characterDirectionForLanguage_1 = + _registerName1("characterDirectionForLanguage:"); + int _objc_msgSend_180( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer isoLangCode, + ) { + return __objc_msgSend_180( + obj, + sel, + isoLangCode, + ); + } + + late final __objc_msgSend_180Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_180 = __objc_msgSend_180Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_lineDirectionForLanguage_1 = + _registerName1("lineDirectionForLanguage:"); + late final _sel_localizedName_locale_1 = + _registerName1("localizedName:locale:"); + ffi.Pointer _objc_msgSend_181( + ffi.Pointer obj, + ffi.Pointer sel, + int style, + ffi.Pointer locale, + ) { + return __objc_msgSend_181( + obj, + sel, + style, + locale, + ); + } + + late final __objc_msgSend_181Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_181 = __objc_msgSend_181Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_timeZoneWithName_1 = _registerName1("timeZoneWithName:"); + late final _sel_timeZoneWithName_data_1 = + _registerName1("timeZoneWithName:data:"); + instancetype _objc_msgSend_182( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer tzName, + ffi.Pointer aData, + ) { + return __objc_msgSend_182( + obj, + sel, + tzName, + aData, + ); + } + + late final __objc_msgSend_182Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_182 = __objc_msgSend_182Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithName_1 = _registerName1("initWithName:"); + late final _sel_initWithName_data_1 = _registerName1("initWithName:data:"); + late final _sel_timeZoneForSecondsFromGMT_1 = + _registerName1("timeZoneForSecondsFromGMT:"); + instancetype _objc_msgSend_183( + ffi.Pointer obj, + ffi.Pointer sel, + int seconds, + ) { + return __objc_msgSend_183( + obj, + sel, + seconds, + ); + } + + late final __objc_msgSend_183Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_183 = __objc_msgSend_183Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_timeZoneWithAbbreviation_1 = + _registerName1("timeZoneWithAbbreviation:"); + late final _sel_dateWithYear_month_day_hour_minute_second_timeZone_1 = + _registerName1("dateWithYear:month:day:hour:minute:second:timeZone:"); + ffi.Pointer _objc_msgSend_184( + ffi.Pointer obj, + ffi.Pointer sel, + int year, + int month, + int day, + int hour, + int minute, + int second, + ffi.Pointer aTimeZone, + ) { + return __objc_msgSend_184( + obj, + sel, + year, + month, + day, + hour, + minute, + second, + aTimeZone, + ); + } + + late final __objc_msgSend_184Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + NSUInteger, + NSUInteger, + NSUInteger, + NSUInteger, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_184 = __objc_msgSend_184Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + int, + int, + int, + int, + ffi.Pointer)>(); + + late final _sel_dateByAddingYears_months_days_hours_minutes_seconds_1 = + _registerName1("dateByAddingYears:months:days:hours:minutes:seconds:"); + ffi.Pointer _objc_msgSend_185( + ffi.Pointer obj, + ffi.Pointer sel, + int year, + int month, + int day, + int hour, + int minute, + int second, + ) { + return __objc_msgSend_185( + obj, + sel, + year, + month, + day, + hour, + minute, + second, + ); + } + + late final __objc_msgSend_185Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + NSInteger, + NSInteger, + NSInteger, + NSInteger, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_185 = __objc_msgSend_185Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, int, int, int, int, int)>(); + + late final _sel_dayOfCommonEra1 = _registerName1("dayOfCommonEra"); + late final _sel_dayOfMonth1 = _registerName1("dayOfMonth"); + late final _sel_dayOfWeek1 = _registerName1("dayOfWeek"); + late final _sel_dayOfYear1 = _registerName1("dayOfYear"); + late final _sel_hourOfDay1 = _registerName1("hourOfDay"); + late final _sel_minuteOfHour1 = _registerName1("minuteOfHour"); + late final _sel_monthOfYear1 = _registerName1("monthOfYear"); + late final _sel_secondOfMinute1 = _registerName1("secondOfMinute"); + late final _sel_yearOfCommonEra1 = _registerName1("yearOfCommonEra"); + late final _sel_calendarFormat1 = _registerName1("calendarFormat"); + late final _sel_descriptionWithCalendarFormat_locale_1 = + _registerName1("descriptionWithCalendarFormat:locale:"); + late final _sel_descriptionWithCalendarFormat_1 = + _registerName1("descriptionWithCalendarFormat:"); + late final _sel_timeZone1 = _registerName1("timeZone"); + late final _sel_initWithString_calendarFormat_locale_1 = + _registerName1("initWithString:calendarFormat:locale:"); + late final _sel_initWithString_calendarFormat_1 = + _registerName1("initWithString:calendarFormat:"); + late final _sel_initWithYear_month_day_hour_minute_second_timeZone_1 = + _registerName1("initWithYear:month:day:hour:minute:second:timeZone:"); + late final _sel_setCalendarFormat_1 = _registerName1("setCalendarFormat:"); + void _objc_msgSend_186( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ) { + return __objc_msgSend_186( + obj, + sel, + format, + ); + } + + late final __objc_msgSend_186Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_186 = __objc_msgSend_186Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setTimeZone_1 = _registerName1("setTimeZone:"); + void _objc_msgSend_187( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aTimeZone, + ) { + return __objc_msgSend_187( + obj, + sel, + aTimeZone, + ); + } + + late final __objc_msgSend_187Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_187 = __objc_msgSend_187Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_years_months_days_hours_minutes_seconds_sinceDate_1 = + _registerName1("years:months:days:hours:minutes:seconds:sinceDate:"); + void _objc_msgSend_188( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer yp, + ffi.Pointer mop, + ffi.Pointer dp, + ffi.Pointer hp, + ffi.Pointer mip, + ffi.Pointer sp, + ffi.Pointer date, + ) { + return __objc_msgSend_188( + obj, + sel, + yp, + mop, + dp, + hp, + mip, + sp, + date, + ); + } + + late final __objc_msgSend_188Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_188 = __objc_msgSend_188Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_dateWithCalendarFormat_timeZone_1 = + _registerName1("dateWithCalendarFormat:timeZone:"); + ffi.Pointer _objc_msgSend_189( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ffi.Pointer aTimeZone, + ) { + return __objc_msgSend_189( + obj, + sel, + format, + aTimeZone, + ); + } + + late final __objc_msgSend_189Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_189 = __objc_msgSend_189Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_descriptionWithCalendarFormat_timeZone_locale_1 = + _registerName1("descriptionWithCalendarFormat:timeZone:locale:"); + ffi.Pointer _objc_msgSend_190( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ffi.Pointer aTimeZone, + ffi.Pointer locale, + ) { + return __objc_msgSend_190( + obj, + sel, + format, + aTimeZone, + locale, + ); + } + + late final __objc_msgSend_190Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_190 = __objc_msgSend_190Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_fileModificationDate1 = + _registerName1("fileModificationDate"); + late final _sel_fileType1 = _registerName1("fileType"); + late final _sel_filePosixPermissions1 = + _registerName1("filePosixPermissions"); + late final _sel_fileOwnerAccountName1 = + _registerName1("fileOwnerAccountName"); + late final _sel_fileGroupOwnerAccountName1 = + _registerName1("fileGroupOwnerAccountName"); + late final _sel_fileSystemNumber1 = _registerName1("fileSystemNumber"); + late final _sel_fileSystemFileNumber1 = + _registerName1("fileSystemFileNumber"); + late final _sel_fileExtensionHidden1 = _registerName1("fileExtensionHidden"); + late final _sel_fileHFSCreatorCode1 = _registerName1("fileHFSCreatorCode"); + int _objc_msgSend_191( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_191( + obj, + sel, + ); + } + + late final __objc_msgSend_191Ptr = _lookup< + ffi.NativeFunction< + OSType Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_191 = __objc_msgSend_191Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_fileHFSTypeCode1 = _registerName1("fileHFSTypeCode"); + late final _sel_fileIsImmutable1 = _registerName1("fileIsImmutable"); + late final _sel_fileIsAppendOnly1 = _registerName1("fileIsAppendOnly"); + late final _sel_fileCreationDate1 = _registerName1("fileCreationDate"); + late final _sel_fileOwnerAccountID1 = _registerName1("fileOwnerAccountID"); + ffi.Pointer _objc_msgSend_192( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_192( + obj, + sel, + ); + } + + late final __objc_msgSend_192Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_192 = __objc_msgSend_192Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_fileGroupOwnerAccountID1 = + _registerName1("fileGroupOwnerAccountID"); + late final _sel_predicateWithBlock_1 = _registerName1("predicateWithBlock:"); + ffi.Pointer _objc_msgSend_193( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_193( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_193Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_193 = __objc_msgSend_193Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_predicateFormat1 = _registerName1("predicateFormat"); + late final _sel_predicateWithSubstitutionVariables_1 = + _registerName1("predicateWithSubstitutionVariables:"); + late final _sel_evaluateWithObject_1 = _registerName1("evaluateWithObject:"); + late final _sel_evaluateWithObject_substitutionVariables_1 = + _registerName1("evaluateWithObject:substitutionVariables:"); + bool _objc_msgSend_194( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer object, + ffi.Pointer bindings, + ) { + return __objc_msgSend_194( + obj, + sel, + object, + bindings, + ); + } + + late final __objc_msgSend_194Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_194 = __objc_msgSend_194Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_allowEvaluation1 = _registerName1("allowEvaluation"); + late final _sel_filteredArrayUsingPredicate_1 = + _registerName1("filteredArrayUsingPredicate:"); + ffi.Pointer _objc_msgSend_195( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicate, + ) { + return __objc_msgSend_195( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_195Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_195 = __objc_msgSend_195Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithChar_1 = _registerName1("initWithChar:"); + ffi.Pointer _objc_msgSend_196( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_196( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_196Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Char)>>('objc_msgSend'); + late final __objc_msgSend_196 = __objc_msgSend_196Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithUnsignedChar_1 = + _registerName1("initWithUnsignedChar:"); + ffi.Pointer _objc_msgSend_197( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_197( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_197Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedChar)>>('objc_msgSend'); + late final __objc_msgSend_197 = __objc_msgSend_197Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithShort_1 = _registerName1("initWithShort:"); + ffi.Pointer _objc_msgSend_198( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_198( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_198Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Short)>>('objc_msgSend'); + late final __objc_msgSend_198 = __objc_msgSend_198Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithUnsignedShort_1 = + _registerName1("initWithUnsignedShort:"); + ffi.Pointer _objc_msgSend_199( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_199( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_199Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedShort)>>('objc_msgSend'); + late final __objc_msgSend_199 = __objc_msgSend_199Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithInt_1 = _registerName1("initWithInt:"); + ffi.Pointer _objc_msgSend_200( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_200( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_200Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int)>>('objc_msgSend'); + late final __objc_msgSend_200 = __objc_msgSend_200Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithUnsignedInt_1 = + _registerName1("initWithUnsignedInt:"); + ffi.Pointer _objc_msgSend_201( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_201( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_201Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_201 = __objc_msgSend_201Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithLong_1 = _registerName1("initWithLong:"); + ffi.Pointer _objc_msgSend_202( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_202( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_202Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Long)>>('objc_msgSend'); + late final __objc_msgSend_202 = __objc_msgSend_202Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithUnsignedLong_1 = + _registerName1("initWithUnsignedLong:"); + ffi.Pointer _objc_msgSend_203( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_203( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_203Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_203 = __objc_msgSend_203Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithLongLong_1 = _registerName1("initWithLongLong:"); + ffi.Pointer _objc_msgSend_204( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_204( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_204Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.LongLong)>>('objc_msgSend'); + late final __objc_msgSend_204 = __objc_msgSend_204Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithUnsignedLongLong_1 = + _registerName1("initWithUnsignedLongLong:"); + ffi.Pointer _objc_msgSend_205( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_205( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_205Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLongLong)>>('objc_msgSend'); + late final __objc_msgSend_205 = __objc_msgSend_205Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithFloat_1 = _registerName1("initWithFloat:"); + ffi.Pointer _objc_msgSend_206( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_206( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_206Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Float)>>('objc_msgSend'); + late final __objc_msgSend_206 = __objc_msgSend_206Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_initWithDouble_1 = _registerName1("initWithDouble:"); + ffi.Pointer _objc_msgSend_207( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_207( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_207Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_207 = __objc_msgSend_207Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_initWithBool_1 = _registerName1("initWithBool:"); + ffi.Pointer _objc_msgSend_208( + ffi.Pointer obj, + ffi.Pointer sel, + bool value, + ) { + return __objc_msgSend_208( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_208Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_208 = __objc_msgSend_208Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_initWithInteger_1 = _registerName1("initWithInteger:"); + late final _sel_initWithUnsignedInteger_1 = + _registerName1("initWithUnsignedInteger:"); + late final _sel_charValue1 = _registerName1("charValue"); + int _objc_msgSend_209( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_209( + obj, + sel, + ); + } + + late final __objc_msgSend_209Ptr = _lookup< + ffi.NativeFunction< + ffi.Char Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_209 = __objc_msgSend_209Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_unsignedCharValue1 = _registerName1("unsignedCharValue"); + int _objc_msgSend_210( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_210( + obj, + sel, + ); + } + + late final __objc_msgSend_210Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedChar Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_210 = __objc_msgSend_210Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_shortValue1 = _registerName1("shortValue"); + int _objc_msgSend_211( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_211( + obj, + sel, + ); + } + + late final __objc_msgSend_211Ptr = _lookup< + ffi.NativeFunction< + ffi.Short Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_211 = __objc_msgSend_211Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_unsignedShortValue1 = _registerName1("unsignedShortValue"); + int _objc_msgSend_212( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_212( + obj, + sel, + ); + } + + late final __objc_msgSend_212Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedShort Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_212 = __objc_msgSend_212Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_intValue1 = _registerName1("intValue"); + int _objc_msgSend_213( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_213( + obj, + sel, + ); + } + + late final __objc_msgSend_213Ptr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_213 = __objc_msgSend_213Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_unsignedIntValue1 = _registerName1("unsignedIntValue"); + late final _sel_longValue1 = _registerName1("longValue"); + late final _sel_unsignedLongValue1 = _registerName1("unsignedLongValue"); + late final _sel_longLongValue1 = _registerName1("longLongValue"); + int _objc_msgSend_214( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_214( + obj, + sel, + ); + } + + late final __objc_msgSend_214Ptr = _lookup< + ffi.NativeFunction< + ffi.LongLong Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_214 = __objc_msgSend_214Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_unsignedLongLongValue1 = + _registerName1("unsignedLongLongValue"); + late final _sel_floatValue1 = _registerName1("floatValue"); + double _objc_msgSend_215( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_215( + obj, + sel, + ); + } + + late final __objc_msgSend_215Ptr = _lookup< + ffi.NativeFunction< + ffi.Float Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_215 = __objc_msgSend_215Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_doubleValue1 = _registerName1("doubleValue"); + late final _sel_boolValue1 = _registerName1("boolValue"); + late final _sel_integerValue1 = _registerName1("integerValue"); + late final _sel_unsignedIntegerValue1 = + _registerName1("unsignedIntegerValue"); + late final _sel_stringValue1 = _registerName1("stringValue"); + int _objc_msgSend_216( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherNumber, + ) { + return __objc_msgSend_216( + obj, + sel, + otherNumber, + ); + } + + late final __objc_msgSend_216Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_216 = __objc_msgSend_216Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_isEqualToNumber_1 = _registerName1("isEqualToNumber:"); + bool _objc_msgSend_217( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer number, + ) { + return __objc_msgSend_217( + obj, + sel, + number, + ); + } + + late final __objc_msgSend_217Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_217 = __objc_msgSend_217Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_numberWithChar_1 = _registerName1("numberWithChar:"); + late final _sel_numberWithUnsignedChar_1 = + _registerName1("numberWithUnsignedChar:"); + late final _sel_numberWithShort_1 = _registerName1("numberWithShort:"); + late final _sel_numberWithUnsignedShort_1 = + _registerName1("numberWithUnsignedShort:"); + late final _sel_numberWithInt_1 = _registerName1("numberWithInt:"); + late final _sel_numberWithUnsignedInt_1 = + _registerName1("numberWithUnsignedInt:"); + late final _sel_numberWithLong_1 = _registerName1("numberWithLong:"); + late final _sel_numberWithUnsignedLong_1 = + _registerName1("numberWithUnsignedLong:"); + late final _sel_numberWithLongLong_1 = _registerName1("numberWithLongLong:"); + late final _sel_numberWithUnsignedLongLong_1 = + _registerName1("numberWithUnsignedLongLong:"); + late final _sel_numberWithFloat_1 = _registerName1("numberWithFloat:"); + late final _sel_numberWithDouble_1 = _registerName1("numberWithDouble:"); + late final _sel_numberWithBool_1 = _registerName1("numberWithBool:"); + late final _sel_numberWithInteger_1 = _registerName1("numberWithInteger:"); + late final _sel_numberWithUnsignedInteger_1 = + _registerName1("numberWithUnsignedInteger:"); + late final _sel_port1 = _registerName1("port"); + late final _sel_user1 = _registerName1("user"); + late final _sel_password1 = _registerName1("password"); + late final _sel_path1 = _registerName1("path"); + late final _sel_fragment1 = _registerName1("fragment"); + late final _sel_parameterString1 = _registerName1("parameterString"); + late final _sel_query1 = _registerName1("query"); + late final _sel_relativePath1 = _registerName1("relativePath"); + late final _sel_hasDirectoryPath1 = _registerName1("hasDirectoryPath"); + late final _sel_getFileSystemRepresentation_maxLength_1 = + _registerName1("getFileSystemRepresentation:maxLength:"); + bool _objc_msgSend_218( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + int maxBufferLength, + ) { + return __objc_msgSend_218( + obj, + sel, + buffer, + maxBufferLength, + ); + } + + late final __objc_msgSend_218Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_218 = __objc_msgSend_218Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_fileSystemRepresentation1 = + _registerName1("fileSystemRepresentation"); + late final _sel_isFileURL1 = _registerName1("isFileURL"); + late final _sel_standardizedURL1 = _registerName1("standardizedURL"); + late final _sel_checkResourceIsReachableAndReturnError_1 = + _registerName1("checkResourceIsReachableAndReturnError:"); + bool _objc_msgSend_219( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> error, + ) { + return __objc_msgSend_219( + obj, + sel, + error, + ); + } + + late final __objc_msgSend_219Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_219 = __objc_msgSend_219Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_isFileReferenceURL1 = _registerName1("isFileReferenceURL"); + late final _sel_fileReferenceURL1 = _registerName1("fileReferenceURL"); + late final _sel_filePathURL1 = _registerName1("filePathURL"); + late final _sel_getResourceValue_forKey_error_1 = + _registerName1("getResourceValue:forKey:error:"); + bool _objc_msgSend_220( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> value, + NSURLResourceKey key, + ffi.Pointer> error, + ) { + return __objc_msgSend_220( + obj, + sel, + value, + key, + error, + ); + } + + late final __objc_msgSend_220Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSURLResourceKey, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_220 = __objc_msgSend_220Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSURLResourceKey, + ffi.Pointer>)>(); + + late final _sel_getPromisedItemResourceValue_forKey_error_1 = + _registerName1("getPromisedItemResourceValue:forKey:error:"); + late final _sel_promisedItemResourceValuesForKeys_error_1 = + _registerName1("promisedItemResourceValuesForKeys:error:"); + ffi.Pointer _objc_msgSend_221( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keys, + ffi.Pointer> error, + ) { + return __objc_msgSend_221( + obj, + sel, + keys, + error, + ); + } + + late final __objc_msgSend_221Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_221 = __objc_msgSend_221Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_checkPromisedItemIsReachableAndReturnError_1 = + _registerName1("checkPromisedItemIsReachableAndReturnError:"); + late final _sel_fileURLWithPathComponents_1 = + _registerName1("fileURLWithPathComponents:"); + ffi.Pointer _objc_msgSend_222( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer components, + ) { + return __objc_msgSend_222( + obj, + sel, + components, + ); + } + + late final __objc_msgSend_222Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_222 = __objc_msgSend_222Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_pathComponents1 = _registerName1("pathComponents"); + late final _sel_lastPathComponent1 = _registerName1("lastPathComponent"); + late final _sel_pathExtension1 = _registerName1("pathExtension"); + late final _sel_URLByAppendingPathComponent_1 = + _registerName1("URLByAppendingPathComponent:"); + late final _sel_URLByAppendingPathComponent_isDirectory_1 = + _registerName1("URLByAppendingPathComponent:isDirectory:"); + late final _sel_URLByDeletingLastPathComponent1 = + _registerName1("URLByDeletingLastPathComponent"); + late final _sel_URLByAppendingPathExtension_1 = + _registerName1("URLByAppendingPathExtension:"); + late final _sel_URLByDeletingPathExtension1 = + _registerName1("URLByDeletingPathExtension"); + late final _sel_URLByStandardizingPath1 = + _registerName1("URLByStandardizingPath"); + late final _sel_URLByResolvingSymlinksInPath1 = + _registerName1("URLByResolvingSymlinksInPath"); + late final _sel_resourceDataUsingCache_1 = + _registerName1("resourceDataUsingCache:"); + ffi.Pointer _objc_msgSend_223( + ffi.Pointer obj, + ffi.Pointer sel, + bool shouldUseCache, + ) { + return __objc_msgSend_223( + obj, + sel, + shouldUseCache, + ); + } + + late final __objc_msgSend_223Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_223 = __objc_msgSend_223Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_loadResourceDataNotifyingClient_usingCache_1 = + _registerName1("loadResourceDataNotifyingClient:usingCache:"); + void _objc_msgSend_224( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer client, + bool shouldUseCache, + ) { + return __objc_msgSend_224( + obj, + sel, + client, + shouldUseCache, + ); + } + + late final __objc_msgSend_224Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_224 = __objc_msgSend_224Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_propertyForKey_1 = _registerName1("propertyForKey:"); + late final _sel_setResourceData_1 = _registerName1("setResourceData:"); + late final _sel_setProperty_forKey_1 = _registerName1("setProperty:forKey:"); + bool _objc_msgSend_225( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer property, + ffi.Pointer propertyKey, + ) { + return __objc_msgSend_225( + obj, + sel, + property, + propertyKey, + ); + } + + late final __objc_msgSend_225Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_225 = __objc_msgSend_225Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSURLHandle1 = _getClass1("NSURLHandle"); + late final _sel_registerURLHandleClass_1 = + _registerName1("registerURLHandleClass:"); + late final _sel_URLHandleClassForURL_1 = + _registerName1("URLHandleClassForURL:"); + ffi.Pointer _objc_msgSend_226( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anURL, + ) { + return __objc_msgSend_226( + obj, + sel, + anURL, + ); + } + + late final __objc_msgSend_226Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_226 = __objc_msgSend_226Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_status1 = _registerName1("status"); + int _objc_msgSend_227( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_227( + obj, + sel, + ); + } + + late final __objc_msgSend_227Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_227 = __objc_msgSend_227Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_failureReason1 = _registerName1("failureReason"); + late final _sel_addClient_1 = _registerName1("addClient:"); + late final _sel_removeClient_1 = _registerName1("removeClient:"); + late final _sel_loadInBackground1 = _registerName1("loadInBackground"); + late final _sel_cancelLoadInBackground1 = + _registerName1("cancelLoadInBackground"); + late final _sel_resourceData1 = _registerName1("resourceData"); + late final _sel_availableResourceData1 = + _registerName1("availableResourceData"); + late final _sel_expectedResourceDataSize1 = + _registerName1("expectedResourceDataSize"); + late final _sel_flushCachedData1 = _registerName1("flushCachedData"); + late final _sel_backgroundLoadDidFailWithReason_1 = + _registerName1("backgroundLoadDidFailWithReason:"); + late final _sel_didLoadBytes_loadComplete_1 = + _registerName1("didLoadBytes:loadComplete:"); + void _objc_msgSend_228( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer newBytes, + bool yorn, + ) { + return __objc_msgSend_228( + obj, + sel, + newBytes, + yorn, + ); + } + + late final __objc_msgSend_228Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_228 = __objc_msgSend_228Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_canInitWithURL_1 = _registerName1("canInitWithURL:"); + bool _objc_msgSend_229( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anURL, + ) { + return __objc_msgSend_229( + obj, + sel, + anURL, + ); + } + + late final __objc_msgSend_229Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_229 = __objc_msgSend_229Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_cachedHandleForURL_1 = _registerName1("cachedHandleForURL:"); + ffi.Pointer _objc_msgSend_230( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anURL, + ) { + return __objc_msgSend_230( + obj, + sel, + anURL, + ); + } + + late final __objc_msgSend_230Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_230 = __objc_msgSend_230Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithURL_cached_1 = _registerName1("initWithURL:cached:"); + ffi.Pointer _objc_msgSend_231( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anURL, + bool willCache, + ) { + return __objc_msgSend_231( + obj, + sel, + anURL, + willCache, + ); + } + + late final __objc_msgSend_231Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_231 = __objc_msgSend_231Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_propertyForKeyIfAvailable_1 = + _registerName1("propertyForKeyIfAvailable:"); + late final _sel_writeProperty_forKey_1 = + _registerName1("writeProperty:forKey:"); + late final _sel_writeData_1 = _registerName1("writeData:"); + late final _sel_loadInForeground1 = _registerName1("loadInForeground"); + late final _sel_beginLoadInBackground1 = + _registerName1("beginLoadInBackground"); + late final _sel_endLoadInBackground1 = _registerName1("endLoadInBackground"); + late final _sel_URLHandleUsingCache_1 = + _registerName1("URLHandleUsingCache:"); + ffi.Pointer _objc_msgSend_232( + ffi.Pointer obj, + ffi.Pointer sel, + bool shouldUseCache, + ) { + return __objc_msgSend_232( + obj, + sel, + shouldUseCache, + ); + } + + late final __objc_msgSend_232Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_232 = __objc_msgSend_232Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_writeToFile_options_error_1 = + _registerName1("writeToFile:options:error:"); + bool _objc_msgSend_233( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + int writeOptionsMask, + ffi.Pointer> errorPtr, + ) { + return __objc_msgSend_233( + obj, + sel, + path, + writeOptionsMask, + errorPtr, + ); + } + + late final __objc_msgSend_233Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_233 = __objc_msgSend_233Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_writeToURL_options_error_1 = + _registerName1("writeToURL:options:error:"); + bool _objc_msgSend_234( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int writeOptionsMask, + ffi.Pointer> errorPtr, + ) { + return __objc_msgSend_234( + obj, + sel, + url, + writeOptionsMask, + errorPtr, + ); + } + + late final __objc_msgSend_234Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_234 = __objc_msgSend_234Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_rangeOfData_options_range_1 = + _registerName1("rangeOfData:options:range:"); + NSRange _objc_msgSend_235( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dataToFind, + int mask, + NSRange searchRange, + ) { + return __objc_msgSend_235( + obj, + sel, + dataToFind, + mask, + searchRange, + ); + } + + late final __objc_msgSend_235Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_235 = __objc_msgSend_235Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange)>(); + + late final _sel_enumerateByteRangesUsingBlock_1 = + _registerName1("enumerateByteRangesUsingBlock:"); + void _objc_msgSend_236( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_236( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_236Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_236 = __objc_msgSend_236Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_dataWithBytes_length_1 = + _registerName1("dataWithBytes:length:"); + instancetype _objc_msgSend_237( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int length, + ) { + return __objc_msgSend_237( + obj, + sel, + bytes, + length, + ); + } + + late final __objc_msgSend_237Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_237 = __objc_msgSend_237Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_dataWithBytesNoCopy_length_1 = + _registerName1("dataWithBytesNoCopy:length:"); + late final _sel_dataWithBytesNoCopy_length_freeWhenDone_1 = + _registerName1("dataWithBytesNoCopy:length:freeWhenDone:"); + instancetype _objc_msgSend_238( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int length, + bool b, + ) { + return __objc_msgSend_238( + obj, + sel, + bytes, + length, + b, + ); + } + + late final __objc_msgSend_238Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_238 = __objc_msgSend_238Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, bool)>(); + + late final _sel_dataWithContentsOfFile_options_error_1 = + _registerName1("dataWithContentsOfFile:options:error:"); + instancetype _objc_msgSend_239( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + int readOptionsMask, + ffi.Pointer> errorPtr, + ) { + return __objc_msgSend_239( + obj, + sel, + path, + readOptionsMask, + errorPtr, + ); + } + + late final __objc_msgSend_239Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_239 = __objc_msgSend_239Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_dataWithContentsOfURL_options_error_1 = + _registerName1("dataWithContentsOfURL:options:error:"); + instancetype _objc_msgSend_240( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int readOptionsMask, + ffi.Pointer> errorPtr, + ) { + return __objc_msgSend_240( + obj, + sel, + url, + readOptionsMask, + errorPtr, + ); + } + + late final __objc_msgSend_240Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_240 = __objc_msgSend_240Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_dataWithContentsOfFile_1 = + _registerName1("dataWithContentsOfFile:"); + late final _sel_dataWithContentsOfURL_1 = + _registerName1("dataWithContentsOfURL:"); + late final _sel_initWithBytes_length_1 = + _registerName1("initWithBytes:length:"); + late final _sel_initWithBytesNoCopy_length_1 = + _registerName1("initWithBytesNoCopy:length:"); + late final _sel_initWithBytesNoCopy_length_freeWhenDone_1 = + _registerName1("initWithBytesNoCopy:length:freeWhenDone:"); + late final _sel_initWithBytesNoCopy_length_deallocator_1 = + _registerName1("initWithBytesNoCopy:length:deallocator:"); + instancetype _objc_msgSend_241( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int length, + ffi.Pointer<_ObjCBlock> deallocator, + ) { + return __objc_msgSend_241( + obj, + sel, + bytes, + length, + deallocator, + ); + } + + late final __objc_msgSend_241Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_241 = __objc_msgSend_241Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_initWithContentsOfFile_options_error_1 = + _registerName1("initWithContentsOfFile:options:error:"); + late final _sel_initWithContentsOfURL_options_error_1 = + _registerName1("initWithContentsOfURL:options:error:"); + late final _sel_initWithData_1 = _registerName1("initWithData:"); + instancetype _objc_msgSend_242( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ) { + return __objc_msgSend_242( + obj, + sel, + data, + ); + } + + late final __objc_msgSend_242Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_242 = __objc_msgSend_242Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_dataWithData_1 = _registerName1("dataWithData:"); + late final _sel_initWithBase64EncodedString_options_1 = + _registerName1("initWithBase64EncodedString:options:"); + instancetype _objc_msgSend_243( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer base64String, + int options, + ) { + return __objc_msgSend_243( + obj, + sel, + base64String, + options, + ); + } + + late final __objc_msgSend_243Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_243 = __objc_msgSend_243Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_base64EncodedStringWithOptions_1 = + _registerName1("base64EncodedStringWithOptions:"); + ffi.Pointer _objc_msgSend_244( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_244( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_244Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_244 = __objc_msgSend_244Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithBase64EncodedData_options_1 = + _registerName1("initWithBase64EncodedData:options:"); + instancetype _objc_msgSend_245( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer base64Data, + int options, + ) { + return __objc_msgSend_245( + obj, + sel, + base64Data, + options, + ); + } + + late final __objc_msgSend_245Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_245 = __objc_msgSend_245Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_base64EncodedDataWithOptions_1 = + _registerName1("base64EncodedDataWithOptions:"); + ffi.Pointer _objc_msgSend_246( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_246( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_246Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_246 = __objc_msgSend_246Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_decompressedDataUsingAlgorithm_error_1 = + _registerName1("decompressedDataUsingAlgorithm:error:"); + instancetype _objc_msgSend_247( + ffi.Pointer obj, + ffi.Pointer sel, + int algorithm, + ffi.Pointer> error, + ) { + return __objc_msgSend_247( + obj, + sel, + algorithm, + error, + ); + } + + late final __objc_msgSend_247Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_247 = __objc_msgSend_247Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer>)>(); + + late final _sel_compressedDataUsingAlgorithm_error_1 = + _registerName1("compressedDataUsingAlgorithm:error:"); + late final _sel_getBytes_1 = _registerName1("getBytes:"); + late final _sel_dataWithContentsOfMappedFile_1 = + _registerName1("dataWithContentsOfMappedFile:"); + late final _sel_initWithContentsOfMappedFile_1 = + _registerName1("initWithContentsOfMappedFile:"); + late final _sel_initWithBase64Encoding_1 = + _registerName1("initWithBase64Encoding:"); + late final _sel_base64Encoding1 = _registerName1("base64Encoding"); + late final _sel_encodeDataObject_1 = _registerName1("encodeDataObject:"); + void _objc_msgSend_248( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ) { + return __objc_msgSend_248( + obj, + sel, + data, + ); + } + + late final __objc_msgSend_248Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_248 = __objc_msgSend_248Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeDataObject1 = _registerName1("decodeDataObject"); + late final _sel_decodeValueOfObjCType_at_size_1 = + _registerName1("decodeValueOfObjCType:at:size:"); + void _objc_msgSend_249( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer type, + ffi.Pointer data, + int size, + ) { + return __objc_msgSend_249( + obj, + sel, + type, + data, + size, + ); + } + + late final __objc_msgSend_249Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_249 = __objc_msgSend_249Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_versionForClassName_1 = + _registerName1("versionForClassName:"); + int _objc_msgSend_250( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer className, + ) { + return __objc_msgSend_250( + obj, + sel, + className, + ); + } + + late final __objc_msgSend_250Ptr = _lookup< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_250 = __objc_msgSend_250Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_encodeObject_1 = _registerName1("encodeObject:"); + late final _sel_encodeRootObject_1 = _registerName1("encodeRootObject:"); + late final _sel_encodeBycopyObject_1 = _registerName1("encodeBycopyObject:"); + late final _sel_encodeByrefObject_1 = _registerName1("encodeByrefObject:"); + late final _sel_encodeConditionalObject_1 = + _registerName1("encodeConditionalObject:"); + late final _sel_encodeValuesOfObjCTypes_1 = + _registerName1("encodeValuesOfObjCTypes:"); + void _objc_msgSend_251( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer types, + ) { + return __objc_msgSend_251( + obj, + sel, + types, + ); + } + + late final __objc_msgSend_251Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_251 = __objc_msgSend_251Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_encodeArrayOfObjCType_count_at_1 = + _registerName1("encodeArrayOfObjCType:count:at:"); + void _objc_msgSend_252( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer type, + int count, + ffi.Pointer array, + ) { + return __objc_msgSend_252( + obj, + sel, + type, + count, + array, + ); + } + + late final __objc_msgSend_252Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_252 = __objc_msgSend_252Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_encodeBytes_length_1 = _registerName1("encodeBytes:length:"); + late final _sel_decodeObject1 = _registerName1("decodeObject"); + late final _sel_decodeTopLevelObjectAndReturnError_1 = + _registerName1("decodeTopLevelObjectAndReturnError:"); + ffi.Pointer _objc_msgSend_253( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> error, + ) { + return __objc_msgSend_253( + obj, + sel, + error, + ); + } + + late final __objc_msgSend_253Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_253 = __objc_msgSend_253Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_decodeValuesOfObjCTypes_1 = + _registerName1("decodeValuesOfObjCTypes:"); + late final _sel_decodeArrayOfObjCType_count_at_1 = + _registerName1("decodeArrayOfObjCType:count:at:"); + late final _sel_decodeBytesWithReturnedLength_1 = + _registerName1("decodeBytesWithReturnedLength:"); + ffi.Pointer _objc_msgSend_254( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer lengthp, + ) { + return __objc_msgSend_254( + obj, + sel, + lengthp, + ); + } + + late final __objc_msgSend_254Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_254 = __objc_msgSend_254Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_encodePropertyList_1 = _registerName1("encodePropertyList:"); + late final _sel_decodePropertyList1 = _registerName1("decodePropertyList"); + late final _sel_setObjectZone_1 = _registerName1("setObjectZone:"); + void _objc_msgSend_255( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer zone, + ) { + return __objc_msgSend_255( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_255Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_255 = __objc_msgSend_255Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_objectZone1 = _registerName1("objectZone"); + ffi.Pointer _objc_msgSend_256( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_256( + obj, + sel, + ); + } + + late final __objc_msgSend_256Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_256 = __objc_msgSend_256Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_systemVersion1 = _registerName1("systemVersion"); + late final _sel_allowsKeyedCoding1 = _registerName1("allowsKeyedCoding"); + late final _sel_encodeObject_forKey_1 = + _registerName1("encodeObject:forKey:"); + late final _sel_encodeConditionalObject_forKey_1 = + _registerName1("encodeConditionalObject:forKey:"); + late final _sel_encodeBool_forKey_1 = _registerName1("encodeBool:forKey:"); + void _objc_msgSend_257( + ffi.Pointer obj, + ffi.Pointer sel, + bool value, + ffi.Pointer key, + ) { + return __objc_msgSend_257( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_257Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Bool, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_257 = __objc_msgSend_257Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, bool, + ffi.Pointer)>(); + + late final _sel_encodeInt_forKey_1 = _registerName1("encodeInt:forKey:"); + void _objc_msgSend_258( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ffi.Pointer key, + ) { + return __objc_msgSend_258( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_258Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_258 = __objc_msgSend_258Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_encodeInt32_forKey_1 = _registerName1("encodeInt32:forKey:"); + void _objc_msgSend_259( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ffi.Pointer key, + ) { + return __objc_msgSend_259( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_259Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_259 = __objc_msgSend_259Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_encodeInt64_forKey_1 = _registerName1("encodeInt64:forKey:"); + void _objc_msgSend_260( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ffi.Pointer key, + ) { + return __objc_msgSend_260( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_260Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int64, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_260 = __objc_msgSend_260Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_encodeFloat_forKey_1 = _registerName1("encodeFloat:forKey:"); + void _objc_msgSend_261( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ffi.Pointer key, + ) { + return __objc_msgSend_261( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_261Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Float, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_261 = __objc_msgSend_261Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double, + ffi.Pointer)>(); + + late final _sel_encodeDouble_forKey_1 = + _registerName1("encodeDouble:forKey:"); + void _objc_msgSend_262( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ffi.Pointer key, + ) { + return __objc_msgSend_262( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_262Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Double, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_262 = __objc_msgSend_262Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double, + ffi.Pointer)>(); + + late final _sel_encodeBytes_length_forKey_1 = + _registerName1("encodeBytes:length:forKey:"); + void _objc_msgSend_263( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int length, + ffi.Pointer key, + ) { + return __objc_msgSend_263( + obj, + sel, + bytes, + length, + key, + ); + } + + late final __objc_msgSend_263Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_263 = __objc_msgSend_263Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_containsValueForKey_1 = + _registerName1("containsValueForKey:"); + late final _sel_decodeObjectForKey_1 = _registerName1("decodeObjectForKey:"); + late final _sel_decodeTopLevelObjectForKey_error_1 = + _registerName1("decodeTopLevelObjectForKey:error:"); + ffi.Pointer _objc_msgSend_264( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ffi.Pointer> error, + ) { + return __objc_msgSend_264( + obj, + sel, + key, + error, + ); + } + + late final __objc_msgSend_264Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_264 = __objc_msgSend_264Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_decodeBoolForKey_1 = _registerName1("decodeBoolForKey:"); + late final _sel_decodeIntForKey_1 = _registerName1("decodeIntForKey:"); + int _objc_msgSend_265( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_265( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_265Ptr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_265 = __objc_msgSend_265Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeInt32ForKey_1 = _registerName1("decodeInt32ForKey:"); + int _objc_msgSend_266( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_266( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_266Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_266 = __objc_msgSend_266Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeInt64ForKey_1 = _registerName1("decodeInt64ForKey:"); + int _objc_msgSend_267( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_267( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_267Ptr = _lookup< + ffi.NativeFunction< + ffi.Int64 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_267 = __objc_msgSend_267Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeFloatForKey_1 = _registerName1("decodeFloatForKey:"); + double _objc_msgSend_268( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_268( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_268Ptr = _lookup< + ffi.NativeFunction< + ffi.Float Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_268 = __objc_msgSend_268Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeDoubleForKey_1 = _registerName1("decodeDoubleForKey:"); + double _objc_msgSend_269( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_269( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_269Ptr = _lookup< + ffi.NativeFunction< + ffi.Double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_269 = __objc_msgSend_269Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeBytesForKey_returnedLength_1 = + _registerName1("decodeBytesForKey:returnedLength:"); + ffi.Pointer _objc_msgSend_270( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ffi.Pointer lengthp, + ) { + return __objc_msgSend_270( + obj, + sel, + key, + lengthp, + ); + } + + late final __objc_msgSend_270Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_270 = __objc_msgSend_270Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_encodeInteger_forKey_1 = + _registerName1("encodeInteger:forKey:"); + void _objc_msgSend_271( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ffi.Pointer key, + ) { + return __objc_msgSend_271( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_271Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSInteger, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_271 = __objc_msgSend_271Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_decodeIntegerForKey_1 = + _registerName1("decodeIntegerForKey:"); + late final _sel_requiresSecureCoding1 = + _registerName1("requiresSecureCoding"); + late final _sel_decodeObjectOfClass_forKey_1 = + _registerName1("decodeObjectOfClass:forKey:"); + ffi.Pointer _objc_msgSend_272( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ffi.Pointer key, + ) { + return __objc_msgSend_272( + obj, + sel, + aClass, + key, + ); + } + + late final __objc_msgSend_272Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_272 = __objc_msgSend_272Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeTopLevelObjectOfClass_forKey_error_1 = + _registerName1("decodeTopLevelObjectOfClass:forKey:error:"); + ffi.Pointer _objc_msgSend_273( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ffi.Pointer key, + ffi.Pointer> error, + ) { + return __objc_msgSend_273( + obj, + sel, + aClass, + key, + error, + ); + } + + late final __objc_msgSend_273Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_273 = __objc_msgSend_273Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_decodeArrayOfObjectsOfClass_forKey_1 = + _registerName1("decodeArrayOfObjectsOfClass:forKey:"); + ffi.Pointer _objc_msgSend_274( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cls, + ffi.Pointer key, + ) { + return __objc_msgSend_274( + obj, + sel, + cls, + key, + ); + } + + late final __objc_msgSend_274Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_274 = __objc_msgSend_274Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeDictionaryWithKeysOfClass_objectsOfClass_forKey_1 = + _registerName1("decodeDictionaryWithKeysOfClass:objectsOfClass:forKey:"); + ffi.Pointer _objc_msgSend_275( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keyCls, + ffi.Pointer objectCls, + ffi.Pointer key, + ) { + return __objc_msgSend_275( + obj, + sel, + keyCls, + objectCls, + key, + ); + } + + late final __objc_msgSend_275Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_275 = __objc_msgSend_275Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeObjectOfClasses_forKey_1 = + _registerName1("decodeObjectOfClasses:forKey:"); + ffi.Pointer _objc_msgSend_276( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer classes, + ffi.Pointer key, + ) { + return __objc_msgSend_276( + obj, + sel, + classes, + key, + ); + } + + late final __objc_msgSend_276Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_276 = __objc_msgSend_276Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeTopLevelObjectOfClasses_forKey_error_1 = + _registerName1("decodeTopLevelObjectOfClasses:forKey:error:"); + ffi.Pointer _objc_msgSend_277( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer classes, + ffi.Pointer key, + ffi.Pointer> error, + ) { + return __objc_msgSend_277( + obj, + sel, + classes, + key, + error, + ); + } + + late final __objc_msgSend_277Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_277 = __objc_msgSend_277Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_decodeArrayOfObjectsOfClasses_forKey_1 = + _registerName1("decodeArrayOfObjectsOfClasses:forKey:"); + ffi.Pointer _objc_msgSend_278( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer classes, + ffi.Pointer key, + ) { + return __objc_msgSend_278( + obj, + sel, + classes, + key, + ); + } + + late final __objc_msgSend_278Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_278 = __objc_msgSend_278Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeDictionaryWithKeysOfClasses_objectsOfClasses_forKey_1 = + _registerName1( + "decodeDictionaryWithKeysOfClasses:objectsOfClasses:forKey:"); + ffi.Pointer _objc_msgSend_279( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keyClasses, + ffi.Pointer objectClasses, + ffi.Pointer key, + ) { + return __objc_msgSend_279( + obj, + sel, + keyClasses, + objectClasses, + key, + ); + } + + late final __objc_msgSend_279Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_279 = __objc_msgSend_279Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodePropertyListForKey_1 = + _registerName1("decodePropertyListForKey:"); + late final _sel_allowedClasses1 = _registerName1("allowedClasses"); + ffi.Pointer _objc_msgSend_280( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_280( + obj, + sel, + ); + } + + late final __objc_msgSend_280Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_280 = __objc_msgSend_280Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_failWithError_1 = _registerName1("failWithError:"); + void _objc_msgSend_281( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer error, + ) { + return __objc_msgSend_281( + obj, + sel, + error, + ); + } + + late final __objc_msgSend_281Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_281 = __objc_msgSend_281Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodingFailurePolicy1 = + _registerName1("decodingFailurePolicy"); + int _objc_msgSend_282( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_282( + obj, + sel, + ); + } + + late final __objc_msgSend_282Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_282 = __objc_msgSend_282Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_error1 = _registerName1("error"); + ffi.Pointer _objc_msgSend_283( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_283( + obj, + sel, + ); + } + + late final __objc_msgSend_283Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_283 = __objc_msgSend_283Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_encodeNXObject_1 = _registerName1("encodeNXObject:"); + late final _sel_decodeNXObject1 = _registerName1("decodeNXObject"); + late final _sel_decodeValueOfObjCType_at_1 = + _registerName1("decodeValueOfObjCType:at:"); + late final _sel_encodePoint_1 = _registerName1("encodePoint:"); + void _objc_msgSend_284( + ffi.Pointer obj, + ffi.Pointer sel, + NSPoint point, + ) { + return __objc_msgSend_284( + obj, + sel, + point, + ); + } + + late final __objc_msgSend_284Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSPoint)>>('objc_msgSend'); + late final __objc_msgSend_284 = __objc_msgSend_284Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSPoint)>(); + + late final _sel_decodePoint1 = _registerName1("decodePoint"); + late final _sel_encodeSize_1 = _registerName1("encodeSize:"); + void _objc_msgSend_285( + ffi.Pointer obj, + ffi.Pointer sel, + NSSize size, + ) { + return __objc_msgSend_285( + obj, + sel, + size, + ); + } + + late final __objc_msgSend_285Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSSize)>>('objc_msgSend'); + late final __objc_msgSend_285 = __objc_msgSend_285Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSSize)>(); + + late final _sel_decodeSize1 = _registerName1("decodeSize"); + late final _sel_encodeRect_1 = _registerName1("encodeRect:"); + void _objc_msgSend_286( + ffi.Pointer obj, + ffi.Pointer sel, + NSRect rect, + ) { + return __objc_msgSend_286( + obj, + sel, + rect, + ); + } + + late final __objc_msgSend_286Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRect)>>('objc_msgSend'); + late final __objc_msgSend_286 = __objc_msgSend_286Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRect)>(); + + late final _sel_decodeRect1 = _registerName1("decodeRect"); + late final _sel_encodePoint_forKey_1 = _registerName1("encodePoint:forKey:"); + void _objc_msgSend_287( + ffi.Pointer obj, + ffi.Pointer sel, + NSPoint point, + ffi.Pointer key, + ) { + return __objc_msgSend_287( + obj, + sel, + point, + key, + ); + } + + late final __objc_msgSend_287Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSPoint, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_287 = __objc_msgSend_287Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSPoint, + ffi.Pointer)>(); + + late final _sel_encodeSize_forKey_1 = _registerName1("encodeSize:forKey:"); + void _objc_msgSend_288( + ffi.Pointer obj, + ffi.Pointer sel, + NSSize size, + ffi.Pointer key, + ) { + return __objc_msgSend_288( + obj, + sel, + size, + key, + ); + } + + late final __objc_msgSend_288Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSSize, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_288 = __objc_msgSend_288Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSSize, + ffi.Pointer)>(); + + late final _sel_encodeRect_forKey_1 = _registerName1("encodeRect:forKey:"); + void _objc_msgSend_289( + ffi.Pointer obj, + ffi.Pointer sel, + NSRect rect, + ffi.Pointer key, + ) { + return __objc_msgSend_289( + obj, + sel, + rect, + key, + ); + } + + late final __objc_msgSend_289Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRect, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_289 = __objc_msgSend_289Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRect, + ffi.Pointer)>(); + + late final _sel_decodePointForKey_1 = _registerName1("decodePointForKey:"); + NSPoint _objc_msgSend_290( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_290( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_290Ptr = _lookup< + ffi.NativeFunction< + NSPoint Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_290 = __objc_msgSend_290Ptr.asFunction< + NSPoint Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeSizeForKey_1 = _registerName1("decodeSizeForKey:"); + NSSize _objc_msgSend_291( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_291( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_291Ptr = _lookup< + ffi.NativeFunction< + NSSize Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_291 = __objc_msgSend_291Ptr.asFunction< + NSSize Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeRectForKey_1 = _registerName1("decodeRectForKey:"); + NSRect _objc_msgSend_292( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_292( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_292Ptr = _lookup< + ffi.NativeFunction< + NSRect Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_292 = __objc_msgSend_292Ptr.asFunction< + NSRect Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_substringFromIndex_1 = _registerName1("substringFromIndex:"); + ffi.Pointer _objc_msgSend_293( + ffi.Pointer obj, + ffi.Pointer sel, + int from, + ) { + return __objc_msgSend_293( + obj, + sel, + from, + ); + } + + late final __objc_msgSend_293Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_293 = __objc_msgSend_293Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_substringToIndex_1 = _registerName1("substringToIndex:"); + late final _sel_substringWithRange_1 = _registerName1("substringWithRange:"); + ffi.Pointer _objc_msgSend_294( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_294( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_294Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_294 = __objc_msgSend_294Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_getCharacters_range_1 = + _registerName1("getCharacters:range:"); + void _objc_msgSend_295( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + NSRange range, + ) { + return __objc_msgSend_295( + obj, + sel, + buffer, + range, + ); + } + + late final __objc_msgSend_295Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_295 = __objc_msgSend_295Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>(); + + int _objc_msgSend_296( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + ) { + return __objc_msgSend_296( + obj, + sel, + string, + ); + } + + late final __objc_msgSend_296Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_296 = __objc_msgSend_296Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_compare_options_1 = _registerName1("compare:options:"); + int _objc_msgSend_297( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int mask, + ) { + return __objc_msgSend_297( + obj, + sel, + string, + mask, + ); + } + + late final __objc_msgSend_297Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_297 = __objc_msgSend_297Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_compare_options_range_1 = + _registerName1("compare:options:range:"); + int _objc_msgSend_298( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int mask, + NSRange rangeOfReceiverToCompare, + ) { + return __objc_msgSend_298( + obj, + sel, + string, + mask, + rangeOfReceiverToCompare, + ); + } + + late final __objc_msgSend_298Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_298 = __objc_msgSend_298Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange)>(); + + late final _sel_compare_options_range_locale_1 = + _registerName1("compare:options:range:locale:"); + int _objc_msgSend_299( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int mask, + NSRange rangeOfReceiverToCompare, + ffi.Pointer locale, + ) { + return __objc_msgSend_299( + obj, + sel, + string, + mask, + rangeOfReceiverToCompare, + locale, + ); + } + + late final __objc_msgSend_299Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_299 = __objc_msgSend_299Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange, ffi.Pointer)>(); + + late final _sel_caseInsensitiveCompare_1 = + _registerName1("caseInsensitiveCompare:"); + late final _sel_localizedCompare_1 = _registerName1("localizedCompare:"); + late final _sel_localizedCaseInsensitiveCompare_1 = + _registerName1("localizedCaseInsensitiveCompare:"); + late final _sel_localizedStandardCompare_1 = + _registerName1("localizedStandardCompare:"); + late final _sel_isEqualToString_1 = _registerName1("isEqualToString:"); + late final _sel_hasPrefix_1 = _registerName1("hasPrefix:"); + late final _sel_hasSuffix_1 = _registerName1("hasSuffix:"); + late final _sel_commonPrefixWithString_options_1 = + _registerName1("commonPrefixWithString:options:"); + ffi.Pointer _objc_msgSend_300( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer str, + int mask, + ) { + return __objc_msgSend_300( + obj, + sel, + str, + mask, + ); + } + + late final __objc_msgSend_300Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_300 = __objc_msgSend_300Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_containsString_1 = _registerName1("containsString:"); + late final _sel_localizedCaseInsensitiveContainsString_1 = + _registerName1("localizedCaseInsensitiveContainsString:"); + late final _sel_localizedStandardContainsString_1 = + _registerName1("localizedStandardContainsString:"); + late final _sel_localizedStandardRangeOfString_1 = + _registerName1("localizedStandardRangeOfString:"); + NSRange _objc_msgSend_301( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer str, + ) { + return __objc_msgSend_301( + obj, + sel, + str, + ); + } + + late final __objc_msgSend_301Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_301 = __objc_msgSend_301Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_rangeOfString_1 = _registerName1("rangeOfString:"); + late final _sel_rangeOfString_options_1 = + _registerName1("rangeOfString:options:"); + NSRange _objc_msgSend_302( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchString, + int mask, + ) { + return __objc_msgSend_302( + obj, + sel, + searchString, + mask, + ); + } + + late final __objc_msgSend_302Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_302 = __objc_msgSend_302Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_rangeOfString_options_range_1 = + _registerName1("rangeOfString:options:range:"); + NSRange _objc_msgSend_303( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchString, + int mask, + NSRange rangeOfReceiverToSearch, + ) { + return __objc_msgSend_303( + obj, + sel, + searchString, + mask, + rangeOfReceiverToSearch, + ); + } + + late final __objc_msgSend_303Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_303 = __objc_msgSend_303Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange)>(); + + late final _sel_rangeOfString_options_range_locale_1 = + _registerName1("rangeOfString:options:range:locale:"); + NSRange _objc_msgSend_304( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchString, + int mask, + NSRange rangeOfReceiverToSearch, + ffi.Pointer locale, + ) { + return __objc_msgSend_304( + obj, + sel, + searchString, + mask, + rangeOfReceiverToSearch, + locale, + ); + } + + late final __objc_msgSend_304Ptr = _lookup< + ffi.NativeFunction< + NSRange Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_304 = __objc_msgSend_304Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange, ffi.Pointer)>(); + + late final _sel_rangeOfCharacterFromSet_1 = + _registerName1("rangeOfCharacterFromSet:"); + NSRange _objc_msgSend_305( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchSet, + ) { + return __objc_msgSend_305( + obj, + sel, + searchSet, + ); + } + + late final __objc_msgSend_305Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_305 = __objc_msgSend_305Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_rangeOfCharacterFromSet_options_1 = + _registerName1("rangeOfCharacterFromSet:options:"); + NSRange _objc_msgSend_306( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchSet, + int mask, + ) { + return __objc_msgSend_306( + obj, + sel, + searchSet, + mask, + ); + } + + late final __objc_msgSend_306Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_306 = __objc_msgSend_306Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_rangeOfCharacterFromSet_options_range_1 = + _registerName1("rangeOfCharacterFromSet:options:range:"); + NSRange _objc_msgSend_307( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchSet, + int mask, + NSRange rangeOfReceiverToSearch, + ) { + return __objc_msgSend_307( + obj, + sel, + searchSet, + mask, + rangeOfReceiverToSearch, + ); + } + + late final __objc_msgSend_307Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_307 = __objc_msgSend_307Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange)>(); + + late final _sel_rangeOfComposedCharacterSequenceAtIndex_1 = + _registerName1("rangeOfComposedCharacterSequenceAtIndex:"); + NSRange _objc_msgSend_308( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_308( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_308Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_308 = __objc_msgSend_308Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_rangeOfComposedCharacterSequencesForRange_1 = + _registerName1("rangeOfComposedCharacterSequencesForRange:"); + NSRange _objc_msgSend_309( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_309( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_309Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_309 = __objc_msgSend_309Ptr.asFunction< + NSRange Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_stringByAppendingString_1 = + _registerName1("stringByAppendingString:"); + late final _sel_stringByAppendingFormat_1 = + _registerName1("stringByAppendingFormat:"); + late final _sel_uppercaseString1 = _registerName1("uppercaseString"); + late final _sel_lowercaseString1 = _registerName1("lowercaseString"); + late final _sel_capitalizedString1 = _registerName1("capitalizedString"); + late final _sel_localizedUppercaseString1 = + _registerName1("localizedUppercaseString"); + late final _sel_localizedLowercaseString1 = + _registerName1("localizedLowercaseString"); + late final _sel_localizedCapitalizedString1 = + _registerName1("localizedCapitalizedString"); + late final _sel_uppercaseStringWithLocale_1 = + _registerName1("uppercaseStringWithLocale:"); + ffi.Pointer _objc_msgSend_310( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer locale, + ) { + return __objc_msgSend_310( + obj, + sel, + locale, + ); + } + + late final __objc_msgSend_310Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_310 = __objc_msgSend_310Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_lowercaseStringWithLocale_1 = + _registerName1("lowercaseStringWithLocale:"); + late final _sel_capitalizedStringWithLocale_1 = + _registerName1("capitalizedStringWithLocale:"); + late final _sel_getLineStart_end_contentsEnd_forRange_1 = + _registerName1("getLineStart:end:contentsEnd:forRange:"); + void _objc_msgSend_311( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer startPtr, + ffi.Pointer lineEndPtr, + ffi.Pointer contentsEndPtr, + NSRange range, + ) { + return __objc_msgSend_311( + obj, + sel, + startPtr, + lineEndPtr, + contentsEndPtr, + range, + ); + } + + late final __objc_msgSend_311Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_311 = __objc_msgSend_311Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSRange)>(); + + late final _sel_lineRangeForRange_1 = _registerName1("lineRangeForRange:"); + late final _sel_getParagraphStart_end_contentsEnd_forRange_1 = + _registerName1("getParagraphStart:end:contentsEnd:forRange:"); + late final _sel_paragraphRangeForRange_1 = + _registerName1("paragraphRangeForRange:"); + late final _sel_enumerateSubstringsInRange_options_usingBlock_1 = + _registerName1("enumerateSubstringsInRange:options:usingBlock:"); + void _objc_msgSend_312( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_312( + obj, + sel, + range, + opts, + block, + ); + } + + late final __objc_msgSend_312Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_312 = __objc_msgSend_312Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateLinesUsingBlock_1 = + _registerName1("enumerateLinesUsingBlock:"); + void _objc_msgSend_313( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_313( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_313Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_313 = __objc_msgSend_313Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_UTF8String1 = _registerName1("UTF8String"); + late final _sel_fastestEncoding1 = _registerName1("fastestEncoding"); + late final _sel_smallestEncoding1 = _registerName1("smallestEncoding"); + late final _sel_dataUsingEncoding_allowLossyConversion_1 = + _registerName1("dataUsingEncoding:allowLossyConversion:"); + ffi.Pointer _objc_msgSend_314( + ffi.Pointer obj, + ffi.Pointer sel, + int encoding, + bool lossy, + ) { + return __objc_msgSend_314( + obj, + sel, + encoding, + lossy, + ); + } + + late final __objc_msgSend_314Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSStringEncoding, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_314 = __objc_msgSend_314Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int, bool)>(); + + late final _sel_dataUsingEncoding_1 = _registerName1("dataUsingEncoding:"); + ffi.Pointer _objc_msgSend_315( + ffi.Pointer obj, + ffi.Pointer sel, + int encoding, + ) { + return __objc_msgSend_315( + obj, + sel, + encoding, + ); + } + + late final __objc_msgSend_315Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); + late final __objc_msgSend_315 = __objc_msgSend_315Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_canBeConvertedToEncoding_1 = + _registerName1("canBeConvertedToEncoding:"); + late final _sel_cStringUsingEncoding_1 = + _registerName1("cStringUsingEncoding:"); + late final _sel_getCString_maxLength_encoding_1 = + _registerName1("getCString:maxLength:encoding:"); + bool _objc_msgSend_316( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + int maxBufferCount, + int encoding, + ) { + return __objc_msgSend_316( + obj, + sel, + buffer, + maxBufferCount, + encoding, + ); + } + + late final __objc_msgSend_316Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSStringEncoding)>>('objc_msgSend'); + late final __objc_msgSend_316 = __objc_msgSend_316Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int)>(); + + late final _sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_1 = + _registerName1( + "getBytes:maxLength:usedLength:encoding:options:range:remainingRange:"); + bool _objc_msgSend_317( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + int maxBufferCount, + ffi.Pointer usedBufferCount, + int encoding, + int options, + NSRange range, + NSRangePointer leftover, + ) { + return __objc_msgSend_317( + obj, + sel, + buffer, + maxBufferCount, + usedBufferCount, + encoding, + options, + range, + leftover, + ); + } + + late final __objc_msgSend_317Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer, + NSStringEncoding, + ffi.Int32, + NSRange, + NSRangePointer)>>('objc_msgSend'); + late final __objc_msgSend_317 = __objc_msgSend_317Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + int, + int, + NSRange, + NSRangePointer)>(); + + late final _sel_maximumLengthOfBytesUsingEncoding_1 = + _registerName1("maximumLengthOfBytesUsingEncoding:"); + late final _sel_lengthOfBytesUsingEncoding_1 = + _registerName1("lengthOfBytesUsingEncoding:"); + late final _sel_availableStringEncodings1 = + _registerName1("availableStringEncodings"); + ffi.Pointer _objc_msgSend_318( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_318( + obj, + sel, + ); + } + + late final __objc_msgSend_318Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_318 = __objc_msgSend_318Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_localizedNameOfStringEncoding_1 = + _registerName1("localizedNameOfStringEncoding:"); + late final _sel_defaultCStringEncoding1 = + _registerName1("defaultCStringEncoding"); + late final _sel_decomposedStringWithCanonicalMapping1 = + _registerName1("decomposedStringWithCanonicalMapping"); + late final _sel_precomposedStringWithCanonicalMapping1 = + _registerName1("precomposedStringWithCanonicalMapping"); + late final _sel_decomposedStringWithCompatibilityMapping1 = + _registerName1("decomposedStringWithCompatibilityMapping"); + late final _sel_precomposedStringWithCompatibilityMapping1 = + _registerName1("precomposedStringWithCompatibilityMapping"); + late final _sel_componentsSeparatedByString_1 = + _registerName1("componentsSeparatedByString:"); + late final _sel_componentsSeparatedByCharactersInSet_1 = + _registerName1("componentsSeparatedByCharactersInSet:"); + ffi.Pointer _objc_msgSend_319( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer separator, + ) { + return __objc_msgSend_319( + obj, + sel, + separator, + ); + } + + late final __objc_msgSend_319Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_319 = __objc_msgSend_319Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_stringByTrimmingCharactersInSet_1 = + _registerName1("stringByTrimmingCharactersInSet:"); + ffi.Pointer _objc_msgSend_320( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer set1, + ) { + return __objc_msgSend_320( + obj, + sel, + set1, + ); + } + + late final __objc_msgSend_320Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_320 = __objc_msgSend_320Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_stringByPaddingToLength_withString_startingAtIndex_1 = + _registerName1("stringByPaddingToLength:withString:startingAtIndex:"); + ffi.Pointer _objc_msgSend_321( + ffi.Pointer obj, + ffi.Pointer sel, + int newLength, + ffi.Pointer padString, + int padIndex, + ) { + return __objc_msgSend_321( + obj, + sel, + newLength, + padString, + padIndex, + ); + } + + late final __objc_msgSend_321Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_321 = __objc_msgSend_321Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer, int)>(); + + late final _sel_stringByFoldingWithOptions_locale_1 = + _registerName1("stringByFoldingWithOptions:locale:"); + ffi.Pointer _objc_msgSend_322( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ffi.Pointer locale, + ) { + return __objc_msgSend_322( + obj, + sel, + options, + locale, + ); + } + + late final __objc_msgSend_322Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_322 = __objc_msgSend_322Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_stringByReplacingOccurrencesOfString_withString_options_range_1 = + _registerName1( + "stringByReplacingOccurrencesOfString:withString:options:range:"); + ffi.Pointer _objc_msgSend_323( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer target, + ffi.Pointer replacement, + int options, + NSRange searchRange, + ) { + return __objc_msgSend_323( + obj, + sel, + target, + replacement, + options, + searchRange, + ); + } + + late final __objc_msgSend_323Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_323 = __objc_msgSend_323Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + NSRange)>(); + + late final _sel_stringByReplacingOccurrencesOfString_withString_1 = + _registerName1("stringByReplacingOccurrencesOfString:withString:"); + ffi.Pointer _objc_msgSend_324( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer target, + ffi.Pointer replacement, + ) { + return __objc_msgSend_324( + obj, + sel, + target, + replacement, + ); + } + + late final __objc_msgSend_324Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_324 = __objc_msgSend_324Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_stringByReplacingCharactersInRange_withString_1 = + _registerName1("stringByReplacingCharactersInRange:withString:"); + ffi.Pointer _objc_msgSend_325( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer replacement, + ) { + return __objc_msgSend_325( + obj, + sel, + range, + replacement, + ); + } + + late final __objc_msgSend_325Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_325 = __objc_msgSend_325Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, ffi.Pointer)>(); + + late final _sel_stringByApplyingTransform_reverse_1 = + _registerName1("stringByApplyingTransform:reverse:"); + ffi.Pointer _objc_msgSend_326( + ffi.Pointer obj, + ffi.Pointer sel, + NSStringTransform transform, + bool reverse, + ) { + return __objc_msgSend_326( + obj, + sel, + transform, + reverse, + ); + } + + late final __objc_msgSend_326Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSStringTransform, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_326 = __objc_msgSend_326Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSStringTransform, bool)>(); + + late final _sel_writeToURL_atomically_encoding_error_1 = + _registerName1("writeToURL:atomically:encoding:error:"); + bool _objc_msgSend_327( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + bool useAuxiliaryFile, + int enc, + ffi.Pointer> error, + ) { + return __objc_msgSend_327( + obj, + sel, + url, + useAuxiliaryFile, + enc, + error, + ); + } + + late final __objc_msgSend_327Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + NSStringEncoding, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_327 = __objc_msgSend_327Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + int, + ffi.Pointer>)>(); + + late final _sel_writeToFile_atomically_encoding_error_1 = + _registerName1("writeToFile:atomically:encoding:error:"); + bool _objc_msgSend_328( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool useAuxiliaryFile, + int enc, + ffi.Pointer> error, + ) { + return __objc_msgSend_328( + obj, + sel, + path, + useAuxiliaryFile, + enc, + error, + ); + } + + late final __objc_msgSend_328Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + NSStringEncoding, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_328 = __objc_msgSend_328Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + int, + ffi.Pointer>)>(); + + late final _sel_hash1 = _registerName1("hash"); + late final _sel_initWithCharactersNoCopy_length_freeWhenDone_1 = + _registerName1("initWithCharactersNoCopy:length:freeWhenDone:"); + instancetype _objc_msgSend_329( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer characters, + int length, + bool freeBuffer, + ) { + return __objc_msgSend_329( + obj, + sel, + characters, + length, + freeBuffer, + ); + } + + late final __objc_msgSend_329Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_329 = __objc_msgSend_329Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, bool)>(); + + late final _sel_initWithCharactersNoCopy_length_deallocator_1 = + _registerName1("initWithCharactersNoCopy:length:deallocator:"); + instancetype _objc_msgSend_330( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer chars, + int len, + ffi.Pointer<_ObjCBlock> deallocator, + ) { + return __objc_msgSend_330( + obj, + sel, + chars, + len, + deallocator, + ); + } + + late final __objc_msgSend_330Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_330 = __objc_msgSend_330Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_initWithCharacters_length_1 = + _registerName1("initWithCharacters:length:"); + instancetype _objc_msgSend_331( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer characters, + int length, + ) { + return __objc_msgSend_331( + obj, + sel, + characters, + length, + ); + } + + late final __objc_msgSend_331Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_331 = __objc_msgSend_331Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_initWithUTF8String_1 = _registerName1("initWithUTF8String:"); + instancetype _objc_msgSend_332( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer nullTerminatedCString, + ) { + return __objc_msgSend_332( + obj, + sel, + nullTerminatedCString, + ); + } + + late final __objc_msgSend_332Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_332 = __objc_msgSend_332Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithFormat_1 = _registerName1("initWithFormat:"); + late final _sel_initWithFormat_arguments_1 = + _registerName1("initWithFormat:arguments:"); + instancetype _objc_msgSend_333( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ffi.Pointer<__va_list_tag> argList, + ) { + return __objc_msgSend_333( + obj, + sel, + format, + argList, + ); + } + + late final __objc_msgSend_333Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); + late final __objc_msgSend_333 = __objc_msgSend_333Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<__va_list_tag>)>(); + + late final _sel_initWithFormat_locale_1 = + _registerName1("initWithFormat:locale:"); + late final _sel_initWithFormat_locale_arguments_1 = + _registerName1("initWithFormat:locale:arguments:"); + instancetype _objc_msgSend_334( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ffi.Pointer locale, + ffi.Pointer<__va_list_tag> argList, + ) { + return __objc_msgSend_334( + obj, + sel, + format, + locale, + argList, + ); + } + + late final __objc_msgSend_334Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); + late final __objc_msgSend_334 = __objc_msgSend_334Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>(); + + late final _sel_initWithData_encoding_1 = + _registerName1("initWithData:encoding:"); + instancetype _objc_msgSend_335( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + int encoding, + ) { + return __objc_msgSend_335( + obj, + sel, + data, + encoding, + ); + } + + late final __objc_msgSend_335Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); + late final __objc_msgSend_335 = __objc_msgSend_335Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_initWithBytes_length_encoding_1 = + _registerName1("initWithBytes:length:encoding:"); + instancetype _objc_msgSend_336( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int len, + int encoding, + ) { + return __objc_msgSend_336( + obj, + sel, + bytes, + len, + encoding, + ); + } + + late final __objc_msgSend_336Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSStringEncoding)>>('objc_msgSend'); + late final __objc_msgSend_336 = __objc_msgSend_336Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int)>(); + + late final _sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1 = + _registerName1("initWithBytesNoCopy:length:encoding:freeWhenDone:"); + instancetype _objc_msgSend_337( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int len, + int encoding, + bool freeBuffer, + ) { + return __objc_msgSend_337( + obj, + sel, + bytes, + len, + encoding, + freeBuffer, + ); + } + + late final __objc_msgSend_337Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSStringEncoding, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_337 = __objc_msgSend_337Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, bool)>(); + + late final _sel_initWithBytesNoCopy_length_encoding_deallocator_1 = + _registerName1("initWithBytesNoCopy:length:encoding:deallocator:"); + instancetype _objc_msgSend_338( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int len, + int encoding, + ffi.Pointer<_ObjCBlock> deallocator, + ) { + return __objc_msgSend_338( + obj, + sel, + bytes, + len, + encoding, + deallocator, + ); + } + + late final __objc_msgSend_338Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSStringEncoding, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_338 = __objc_msgSend_338Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_string1 = _registerName1("string"); + late final _sel_stringWithString_1 = _registerName1("stringWithString:"); + late final _sel_stringWithCharacters_length_1 = + _registerName1("stringWithCharacters:length:"); + late final _sel_stringWithUTF8String_1 = + _registerName1("stringWithUTF8String:"); + late final _sel_stringWithFormat_1 = _registerName1("stringWithFormat:"); + late final _sel_localizedStringWithFormat_1 = + _registerName1("localizedStringWithFormat:"); + late final _sel_initWithCString_encoding_1 = + _registerName1("initWithCString:encoding:"); + instancetype _objc_msgSend_339( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer nullTerminatedCString, + int encoding, + ) { + return __objc_msgSend_339( + obj, + sel, + nullTerminatedCString, + encoding, + ); + } + + late final __objc_msgSend_339Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); + late final __objc_msgSend_339 = __objc_msgSend_339Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_stringWithCString_encoding_1 = + _registerName1("stringWithCString:encoding:"); + late final _sel_initWithContentsOfURL_encoding_error_1 = + _registerName1("initWithContentsOfURL:encoding:error:"); + instancetype _objc_msgSend_340( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int enc, + ffi.Pointer> error, + ) { + return __objc_msgSend_340( + obj, + sel, + url, + enc, + error, + ); + } + + late final __objc_msgSend_340Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSStringEncoding, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_340 = __objc_msgSend_340Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_initWithContentsOfFile_encoding_error_1 = + _registerName1("initWithContentsOfFile:encoding:error:"); + instancetype _objc_msgSend_341( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + int enc, + ffi.Pointer> error, + ) { + return __objc_msgSend_341( + obj, + sel, + path, + enc, + error, + ); + } + + late final __objc_msgSend_341Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSStringEncoding, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_341 = __objc_msgSend_341Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_stringWithContentsOfURL_encoding_error_1 = + _registerName1("stringWithContentsOfURL:encoding:error:"); + late final _sel_stringWithContentsOfFile_encoding_error_1 = + _registerName1("stringWithContentsOfFile:encoding:error:"); + late final _sel_initWithContentsOfURL_usedEncoding_error_1 = + _registerName1("initWithContentsOfURL:usedEncoding:error:"); + instancetype _objc_msgSend_342( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer enc, + ffi.Pointer> error, + ) { + return __objc_msgSend_342( + obj, + sel, + url, + enc, + error, + ); + } + + late final __objc_msgSend_342Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_342 = __objc_msgSend_342Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_initWithContentsOfFile_usedEncoding_error_1 = + _registerName1("initWithContentsOfFile:usedEncoding:error:"); + instancetype _objc_msgSend_343( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer enc, + ffi.Pointer> error, + ) { + return __objc_msgSend_343( + obj, + sel, + path, + enc, + error, + ); + } + + late final __objc_msgSend_343Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_343 = __objc_msgSend_343Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_stringWithContentsOfURL_usedEncoding_error_1 = + _registerName1("stringWithContentsOfURL:usedEncoding:error:"); + late final _sel_stringWithContentsOfFile_usedEncoding_error_1 = + _registerName1("stringWithContentsOfFile:usedEncoding:error:"); + late final _sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1 = + _registerName1( + "stringEncodingForData:encodingOptions:convertedString:usedLossyConversion:"); + int _objc_msgSend_344( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ffi.Pointer opts, + ffi.Pointer> string, + ffi.Pointer usedLossyConversion, + ) { + return __objc_msgSend_344( + obj, + sel, + data, + opts, + string, + usedLossyConversion, + ); + } + + late final __objc_msgSend_344Ptr = _lookup< + ffi.NativeFunction< + NSStringEncoding Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_344 = __objc_msgSend_344Ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer)>(); + + late final _sel_propertyList1 = _registerName1("propertyList"); + late final _sel_propertyListFromStringsFileFormat1 = + _registerName1("propertyListFromStringsFileFormat"); + late final _sel_cString1 = _registerName1("cString"); + late final _sel_lossyCString1 = _registerName1("lossyCString"); + late final _sel_cStringLength1 = _registerName1("cStringLength"); + late final _sel_getCString_1 = _registerName1("getCString:"); + late final _sel_getCString_maxLength_1 = + _registerName1("getCString:maxLength:"); + void _objc_msgSend_345( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int maxLength, + ) { + return __objc_msgSend_345( + obj, + sel, + bytes, + maxLength, + ); + } + + late final __objc_msgSend_345Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_345 = __objc_msgSend_345Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_getCString_maxLength_range_remainingRange_1 = + _registerName1("getCString:maxLength:range:remainingRange:"); + void _objc_msgSend_346( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int maxLength, + NSRange aRange, + NSRangePointer leftoverRange, + ) { + return __objc_msgSend_346( + obj, + sel, + bytes, + maxLength, + aRange, + leftoverRange, + ); + } + + late final __objc_msgSend_346Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSRange, + NSRangePointer)>>('objc_msgSend'); + late final __objc_msgSend_346 = __objc_msgSend_346Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange, NSRangePointer)>(); + + late final _sel_stringWithContentsOfFile_1 = + _registerName1("stringWithContentsOfFile:"); + late final _sel_stringWithContentsOfURL_1 = + _registerName1("stringWithContentsOfURL:"); + late final _sel_initWithCStringNoCopy_length_freeWhenDone_1 = + _registerName1("initWithCStringNoCopy:length:freeWhenDone:"); + ffi.Pointer _objc_msgSend_347( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int length, + bool freeBuffer, + ) { + return __objc_msgSend_347( + obj, + sel, + bytes, + length, + freeBuffer, + ); + } + + late final __objc_msgSend_347Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_347 = __objc_msgSend_347Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, bool)>(); + + late final _sel_initWithCString_length_1 = + _registerName1("initWithCString:length:"); + late final _sel_initWithCString_1 = _registerName1("initWithCString:"); + late final _sel_stringWithCString_length_1 = + _registerName1("stringWithCString:length:"); + late final _sel_stringWithCString_1 = _registerName1("stringWithCString:"); + late final _sel_getCharacters_1 = _registerName1("getCharacters:"); + void _objc_msgSend_348( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + ) { + return __objc_msgSend_348( + obj, + sel, + buffer, + ); + } + + late final __objc_msgSend_348Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_348 = __objc_msgSend_348Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_variantFittingPresentationWidth_1 = + _registerName1("variantFittingPresentationWidth:"); + ffi.Pointer _objc_msgSend_349( + ffi.Pointer obj, + ffi.Pointer sel, + int width, + ) { + return __objc_msgSend_349( + obj, + sel, + width, + ); + } + + late final __objc_msgSend_349Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_349 = __objc_msgSend_349Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_pathWithComponents_1 = _registerName1("pathWithComponents:"); + ffi.Pointer _objc_msgSend_350( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer components, + ) { + return __objc_msgSend_350( + obj, + sel, + components, + ); + } + + late final __objc_msgSend_350Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_350 = __objc_msgSend_350Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isAbsolutePath1 = _registerName1("isAbsolutePath"); + late final _sel_stringByDeletingLastPathComponent1 = + _registerName1("stringByDeletingLastPathComponent"); + late final _sel_stringByAppendingPathComponent_1 = + _registerName1("stringByAppendingPathComponent:"); + late final _sel_stringByDeletingPathExtension1 = + _registerName1("stringByDeletingPathExtension"); + late final _sel_stringByAppendingPathExtension_1 = + _registerName1("stringByAppendingPathExtension:"); + late final _sel_stringByAbbreviatingWithTildeInPath1 = + _registerName1("stringByAbbreviatingWithTildeInPath"); + late final _sel_stringByExpandingTildeInPath1 = + _registerName1("stringByExpandingTildeInPath"); + late final _sel_stringByStandardizingPath1 = + _registerName1("stringByStandardizingPath"); + late final _sel_stringByResolvingSymlinksInPath1 = + _registerName1("stringByResolvingSymlinksInPath"); + late final _sel_stringsByAppendingPaths_1 = + _registerName1("stringsByAppendingPaths:"); + late final _sel_completePathIntoString_caseSensitive_matchesIntoArray_filterTypes_1 = + _registerName1( + "completePathIntoString:caseSensitive:matchesIntoArray:filterTypes:"); + int _objc_msgSend_351( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> outputName, + bool flag, + ffi.Pointer> outputArray, + ffi.Pointer filterTypes, + ) { + return __objc_msgSend_351( + obj, + sel, + outputName, + flag, + outputArray, + filterTypes, + ); + } + + late final __objc_msgSend_351Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Bool, + ffi.Pointer>, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_351 = __objc_msgSend_351Ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + bool, + ffi.Pointer>, + ffi.Pointer)>(); + + late final _sel_stringByAddingPercentEncodingWithAllowedCharacters_1 = + _registerName1("stringByAddingPercentEncodingWithAllowedCharacters:"); + late final _sel_stringByRemovingPercentEncoding1 = + _registerName1("stringByRemovingPercentEncoding"); + late final _sel_stringByAddingPercentEscapesUsingEncoding_1 = + _registerName1("stringByAddingPercentEscapesUsingEncoding:"); + late final _sel_stringByReplacingPercentEscapesUsingEncoding_1 = + _registerName1("stringByReplacingPercentEscapesUsingEncoding:"); + late final _class_NSOrthography1 = _getClass1("NSOrthography"); + late final _sel_dominantScript1 = _registerName1("dominantScript"); + late final _sel_languageMap1 = _registerName1("languageMap"); + late final _sel_initWithDominantScript_languageMap_1 = + _registerName1("initWithDominantScript:languageMap:"); + instancetype _objc_msgSend_352( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer script, + ffi.Pointer map, + ) { + return __objc_msgSend_352( + obj, + sel, + script, + map, + ); + } + + late final __objc_msgSend_352Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_352 = __objc_msgSend_352Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_languagesForScript_1 = _registerName1("languagesForScript:"); + late final _sel_dominantLanguageForScript_1 = + _registerName1("dominantLanguageForScript:"); + late final _sel_dominantLanguage1 = _registerName1("dominantLanguage"); + late final _sel_allScripts1 = _registerName1("allScripts"); + late final _sel_allLanguages1 = _registerName1("allLanguages"); + late final _sel_defaultOrthographyForLanguage_1 = + _registerName1("defaultOrthographyForLanguage:"); + late final _sel_orthographyWithDominantScript_languageMap_1 = + _registerName1("orthographyWithDominantScript:languageMap:"); + late final _sel_linguisticTagsInRange_scheme_options_orthography_tokenRanges_1 = + _registerName1( + "linguisticTagsInRange:scheme:options:orthography:tokenRanges:"); + ffi.Pointer _objc_msgSend_353( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + NSLinguisticTagScheme scheme, + int options, + ffi.Pointer orthography, + ffi.Pointer> tokenRanges, + ) { + return __objc_msgSend_353( + obj, + sel, + range, + scheme, + options, + orthography, + tokenRanges, + ); + } + + late final __objc_msgSend_353Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + NSLinguisticTagScheme, + ffi.Int32, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_353 = __objc_msgSend_353Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + NSLinguisticTagScheme, + int, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_enumerateLinguisticTagsInRange_scheme_options_orthography_usingBlock_1 = + _registerName1( + "enumerateLinguisticTagsInRange:scheme:options:orthography:usingBlock:"); + void _objc_msgSend_354( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + NSLinguisticTagScheme scheme, + int options, + ffi.Pointer orthography, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_354( + obj, + sel, + range, + scheme, + options, + orthography, + block, + ); + } + + late final __objc_msgSend_354Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + NSLinguisticTagScheme, + ffi.Int32, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_354 = __objc_msgSend_354Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + NSLinguisticTagScheme, + int, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_allObjects1 = _registerName1("allObjects"); + late final _sel_anyObject1 = _registerName1("anyObject"); + late final _sel_intersectsSet_1 = _registerName1("intersectsSet:"); + bool _objc_msgSend_355( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherSet, + ) { + return __objc_msgSend_355( + obj, + sel, + otherSet, + ); + } + + late final __objc_msgSend_355Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_355 = __objc_msgSend_355Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_isEqualToSet_1 = _registerName1("isEqualToSet:"); + late final _sel_isSubsetOfSet_1 = _registerName1("isSubsetOfSet:"); + late final _sel_setByAddingObject_1 = _registerName1("setByAddingObject:"); + ffi.Pointer _objc_msgSend_356( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ) { + return __objc_msgSend_356( + obj, + sel, + anObject, + ); + } + + late final __objc_msgSend_356Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_356 = __objc_msgSend_356Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setByAddingObjectsFromSet_1 = + _registerName1("setByAddingObjectsFromSet:"); + ffi.Pointer _objc_msgSend_357( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_357( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_357Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_357 = __objc_msgSend_357Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setByAddingObjectsFromArray_1 = + _registerName1("setByAddingObjectsFromArray:"); + ffi.Pointer _objc_msgSend_358( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_358( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_358Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_358 = __objc_msgSend_358Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_359( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_359( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_359Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_359 = __objc_msgSend_359Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + void _objc_msgSend_360( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_360( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_360Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_360 = __objc_msgSend_360Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_objectsPassingTest_1 = _registerName1("objectsPassingTest:"); + ffi.Pointer _objc_msgSend_361( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_361( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_361Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_361 = __objc_msgSend_361Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_objectsWithOptions_passingTest_1 = + _registerName1("objectsWithOptions:passingTest:"); + ffi.Pointer _objc_msgSend_362( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_362( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_362Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_362 = __objc_msgSend_362Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_set1 = _registerName1("set"); + late final _sel_setWithObject_1 = _registerName1("setWithObject:"); + late final _sel_setWithObjects_count_1 = + _registerName1("setWithObjects:count:"); + late final _sel_setWithObjects_1 = _registerName1("setWithObjects:"); + late final _sel_setWithSet_1 = _registerName1("setWithSet:"); + instancetype _objc_msgSend_363( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer set1, + ) { + return __objc_msgSend_363( + obj, + sel, + set1, + ); + } + + late final __objc_msgSend_363Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_363 = __objc_msgSend_363Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setWithArray_1 = _registerName1("setWithArray:"); + late final _sel_initWithSet_1 = _registerName1("initWithSet:"); + late final _sel_initWithSet_copyItems_1 = + _registerName1("initWithSet:copyItems:"); + instancetype _objc_msgSend_364( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer set1, + bool flag, + ) { + return __objc_msgSend_364( + obj, + sel, + set1, + flag, + ); + } + + late final __objc_msgSend_364Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_364 = __objc_msgSend_364Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_filteredSetUsingPredicate_1 = + _registerName1("filteredSetUsingPredicate:"); + ffi.Pointer _objc_msgSend_365( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicate, + ) { + return __objc_msgSend_365( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_365Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_365 = __objc_msgSend_365Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_invocationWithMethodSignature_1 = + _registerName1("invocationWithMethodSignature:"); + ffi.Pointer _objc_msgSend_366( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sig, + ) { + return __objc_msgSend_366( + obj, + sel, + sig, + ); + } + + late final __objc_msgSend_366Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_366 = __objc_msgSend_366Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_methodSignature1 = _registerName1("methodSignature"); + ffi.Pointer _objc_msgSend_367( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_367( + obj, + sel, + ); + } + + late final __objc_msgSend_367Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_367 = __objc_msgSend_367Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_retainArguments1 = _registerName1("retainArguments"); + late final _sel_argumentsRetained1 = _registerName1("argumentsRetained"); + late final _sel_target1 = _registerName1("target"); + late final _sel_setTarget_1 = _registerName1("setTarget:"); + void _objc_msgSend_368( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_368( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_368Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_368 = __objc_msgSend_368Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_selector1 = _registerName1("selector"); + ffi.Pointer _objc_msgSend_369( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_369( + obj, + sel, + ); + } + + late final __objc_msgSend_369Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_369 = __objc_msgSend_369Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setSelector_1 = _registerName1("setSelector:"); + void _objc_msgSend_370( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_370( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_370Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_370 = __objc_msgSend_370Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_getReturnValue_1 = _registerName1("getReturnValue:"); + late final _sel_setReturnValue_1 = _registerName1("setReturnValue:"); + late final _sel_getArgument_atIndex_1 = + _registerName1("getArgument:atIndex:"); + void _objc_msgSend_371( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer argumentLocation, + int idx, + ) { + return __objc_msgSend_371( + obj, + sel, + argumentLocation, + idx, + ); + } + + late final __objc_msgSend_371Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_371 = __objc_msgSend_371Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_setArgument_atIndex_1 = + _registerName1("setArgument:atIndex:"); + late final _sel_invoke1 = _registerName1("invoke"); + late final _sel_invokeWithTarget_1 = _registerName1("invokeWithTarget:"); + late final _sel_forwardInvocation_1 = _registerName1("forwardInvocation:"); + void _objc_msgSend_372( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anInvocation, + ) { + return __objc_msgSend_372( + obj, + sel, + anInvocation, + ); + } + + late final __objc_msgSend_372Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_372 = __objc_msgSend_372Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_methodSignatureForSelector_1 = + _registerName1("methodSignatureForSelector:"); + ffi.Pointer _objc_msgSend_373( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_373( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_373Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_373 = __objc_msgSend_373Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_instanceMethodSignatureForSelector_1 = + _registerName1("instanceMethodSignatureForSelector:"); + late final _sel_allowsWeakReference1 = _registerName1("allowsWeakReference"); + late final _sel_retainWeakReference1 = _registerName1("retainWeakReference"); + late final _sel_isSubclassOfClass_1 = _registerName1("isSubclassOfClass:"); + late final _sel_resolveClassMethod_1 = _registerName1("resolveClassMethod:"); + late final _sel_resolveInstanceMethod_1 = + _registerName1("resolveInstanceMethod:"); + late final _sel_superclass1 = _registerName1("superclass"); + late final _sel_class1 = _registerName1("class"); + late final _sel_debugDescription1 = _registerName1("debugDescription"); + late final _sel_version1 = _registerName1("version"); + late final _sel_setVersion_1 = _registerName1("setVersion:"); + void _objc_msgSend_374( + ffi.Pointer obj, + ffi.Pointer sel, + int aVersion, + ) { + return __objc_msgSend_374( + obj, + sel, + aVersion, + ); + } + + late final __objc_msgSend_374Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_374 = __objc_msgSend_374Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_classForCoder1 = _registerName1("classForCoder"); + late final _sel_replacementObjectForCoder_1 = + _registerName1("replacementObjectForCoder:"); + late final _sel_awakeAfterUsingCoder_1 = + _registerName1("awakeAfterUsingCoder:"); + late final _sel_poseAsClass_1 = _registerName1("poseAsClass:"); + late final _sel_autoContentAccessingProxy1 = + _registerName1("autoContentAccessingProxy"); + late final _sel_attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_1 = + _registerName1( + "attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo:"); + void _objc_msgSend_375( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer error, + int recoveryOptionIndex, + ffi.Pointer delegate, + ffi.Pointer didRecoverSelector, + ffi.Pointer contextInfo, + ) { + return __objc_msgSend_375( + obj, + sel, + error, + recoveryOptionIndex, + delegate, + didRecoverSelector, + contextInfo, + ); + } + + late final __objc_msgSend_375Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_375 = __objc_msgSend_375Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_attemptRecoveryFromError_optionIndex_1 = + _registerName1("attemptRecoveryFromError:optionIndex:"); + bool _objc_msgSend_376( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer error, + int recoveryOptionIndex, + ) { + return __objc_msgSend_376( + obj, + sel, + error, + recoveryOptionIndex, + ); + } + + late final __objc_msgSend_376Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_376 = __objc_msgSend_376Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_performSelector_withObject_afterDelay_inModes_1 = + _registerName1("performSelector:withObject:afterDelay:inModes:"); + void _objc_msgSend_377( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer anArgument, + double delay, + ffi.Pointer modes, + ) { + return __objc_msgSend_377( + obj, + sel, + aSelector, + anArgument, + delay, + modes, + ); + } + + late final __objc_msgSend_377Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSTimeInterval, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_377 = __objc_msgSend_377Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + double, + ffi.Pointer)>(); + + late final _sel_performSelector_withObject_afterDelay_1 = + _registerName1("performSelector:withObject:afterDelay:"); + void _objc_msgSend_378( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer anArgument, + double delay, + ) { + return __objc_msgSend_378( + obj, + sel, + aSelector, + anArgument, + delay, + ); + } + + late final __objc_msgSend_378Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSTimeInterval)>>('objc_msgSend'); + late final __objc_msgSend_378 = __objc_msgSend_378Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_URL_resourceDataDidBecomeAvailable_1 = + _registerName1("URL:resourceDataDidBecomeAvailable:"); + void _objc_msgSend_379( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sender, + ffi.Pointer newBytes, + ) { + return __objc_msgSend_379( + obj, + sel, + sender, + newBytes, + ); + } + + late final __objc_msgSend_379Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_379 = __objc_msgSend_379Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_URLResourceDidFinishLoading_1 = + _registerName1("URLResourceDidFinishLoading:"); + void _objc_msgSend_380( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sender, + ) { + return __objc_msgSend_380( + obj, + sel, + sender, + ); + } + + late final __objc_msgSend_380Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_380 = __objc_msgSend_380Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLResourceDidCancelLoading_1 = + _registerName1("URLResourceDidCancelLoading:"); + late final _sel_URL_resourceDidFailLoadingWithReason_1 = + _registerName1("URL:resourceDidFailLoadingWithReason:"); + void _objc_msgSend_381( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sender, + ffi.Pointer reason, + ) { + return __objc_msgSend_381( + obj, + sel, + sender, + reason, + ); + } + + late final __objc_msgSend_381Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_381 = __objc_msgSend_381Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSFileManager1 = _getClass1("NSFileManager"); + late final _sel_defaultManager1 = _registerName1("defaultManager"); + ffi.Pointer _objc_msgSend_382( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_382( + obj, + sel, + ); + } + + late final __objc_msgSend_382Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_382 = __objc_msgSend_382Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_mountedVolumeURLsIncludingResourceValuesForKeys_options_1 = + _registerName1( + "mountedVolumeURLsIncludingResourceValuesForKeys:options:"); + ffi.Pointer _objc_msgSend_383( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer propertyKeys, + int options, + ) { + return __objc_msgSend_383( + obj, + sel, + propertyKeys, + options, + ); + } + + late final __objc_msgSend_383Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_383 = __objc_msgSend_383Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_unmountVolumeAtURL_options_completionHandler_1 = + _registerName1("unmountVolumeAtURL:options:completionHandler:"); + void _objc_msgSend_384( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int mask, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_384( + obj, + sel, + url, + mask, + completionHandler, + ); + } + + late final __objc_msgSend_384Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_384 = __objc_msgSend_384Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_1 = + _registerName1( + "contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error:"); + ffi.Pointer _objc_msgSend_385( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer keys, + int mask, + ffi.Pointer> error, + ) { + return __objc_msgSend_385( + obj, + sel, + url, + keys, + mask, + error, + ); + } + + late final __objc_msgSend_385Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_385 = __objc_msgSend_385Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_URLsForDirectory_inDomains_1 = + _registerName1("URLsForDirectory:inDomains:"); + ffi.Pointer _objc_msgSend_386( + ffi.Pointer obj, + ffi.Pointer sel, + int directory, + int domainMask, + ) { + return __objc_msgSend_386( + obj, + sel, + directory, + domainMask, + ); + } + + late final __objc_msgSend_386Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_386 = __objc_msgSend_386Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int, int)>(); + + late final _sel_URLForDirectory_inDomain_appropriateForURL_create_error_1 = + _registerName1( + "URLForDirectory:inDomain:appropriateForURL:create:error:"); + ffi.Pointer _objc_msgSend_387( + ffi.Pointer obj, + ffi.Pointer sel, + int directory, + int domain, + ffi.Pointer url, + bool shouldCreate, + ffi.Pointer> error, + ) { + return __objc_msgSend_387( + obj, + sel, + directory, + domain, + url, + shouldCreate, + error, + ); + } + + late final __objc_msgSend_387Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer, + ffi.Bool, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_387 = __objc_msgSend_387Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer, + bool, + ffi.Pointer>)>(); + + late final _sel_getRelationship_ofDirectoryAtURL_toItemAtURL_error_1 = + _registerName1("getRelationship:ofDirectoryAtURL:toItemAtURL:error:"); + bool _objc_msgSend_388( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer outRelationship, + ffi.Pointer directoryURL, + ffi.Pointer otherURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_388( + obj, + sel, + outRelationship, + directoryURL, + otherURL, + error, + ); + } + + late final __objc_msgSend_388Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_388 = __objc_msgSend_388Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_getRelationship_ofDirectory_inDomain_toItemAtURL_error_1 = + _registerName1("getRelationship:ofDirectory:inDomain:toItemAtURL:error:"); + bool _objc_msgSend_389( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer outRelationship, + int directory, + int domainMask, + ffi.Pointer url, + ffi.Pointer> error, + ) { + return __objc_msgSend_389( + obj, + sel, + outRelationship, + directory, + domainMask, + url, + error, + ); + } + + late final __objc_msgSend_389Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_389 = __objc_msgSend_389Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_createDirectoryAtURL_withIntermediateDirectories_attributes_error_1 = + _registerName1( + "createDirectoryAtURL:withIntermediateDirectories:attributes:error:"); + bool _objc_msgSend_390( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + bool createIntermediates, + ffi.Pointer attributes, + ffi.Pointer> error, + ) { + return __objc_msgSend_390( + obj, + sel, + url, + createIntermediates, + attributes, + error, + ); + } + + late final __objc_msgSend_390Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_390 = __objc_msgSend_390Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_createSymbolicLinkAtURL_withDestinationURL_error_1 = + _registerName1("createSymbolicLinkAtURL:withDestinationURL:error:"); + bool _objc_msgSend_391( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer destURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_391( + obj, + sel, + url, + destURL, + error, + ); + } + + late final __objc_msgSend_391Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_391 = __objc_msgSend_391Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_delegate1 = _registerName1("delegate"); + late final _sel_setDelegate_1 = _registerName1("setDelegate:"); + late final _sel_setAttributes_ofItemAtPath_error_1 = + _registerName1("setAttributes:ofItemAtPath:error:"); + bool _objc_msgSend_392( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attributes, + ffi.Pointer path, + ffi.Pointer> error, + ) { + return __objc_msgSend_392( + obj, + sel, + attributes, + path, + error, + ); + } + + late final __objc_msgSend_392Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_392 = __objc_msgSend_392Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_createDirectoryAtPath_withIntermediateDirectories_attributes_error_1 = + _registerName1( + "createDirectoryAtPath:withIntermediateDirectories:attributes:error:"); + bool _objc_msgSend_393( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool createIntermediates, + ffi.Pointer attributes, + ffi.Pointer> error, + ) { + return __objc_msgSend_393( + obj, + sel, + path, + createIntermediates, + attributes, + error, + ); + } + + late final __objc_msgSend_393Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_393 = __objc_msgSend_393Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_contentsOfDirectoryAtPath_error_1 = + _registerName1("contentsOfDirectoryAtPath:error:"); + ffi.Pointer _objc_msgSend_394( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer> error, + ) { + return __objc_msgSend_394( + obj, + sel, + path, + error, + ); + } + + late final __objc_msgSend_394Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_394 = __objc_msgSend_394Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_subpathsOfDirectoryAtPath_error_1 = + _registerName1("subpathsOfDirectoryAtPath:error:"); + late final _sel_attributesOfItemAtPath_error_1 = + _registerName1("attributesOfItemAtPath:error:"); + ffi.Pointer _objc_msgSend_395( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer> error, + ) { + return __objc_msgSend_395( + obj, + sel, + path, + error, + ); + } + + late final __objc_msgSend_395Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_395 = __objc_msgSend_395Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_attributesOfFileSystemForPath_error_1 = + _registerName1("attributesOfFileSystemForPath:error:"); + late final _sel_createSymbolicLinkAtPath_withDestinationPath_error_1 = + _registerName1("createSymbolicLinkAtPath:withDestinationPath:error:"); + bool _objc_msgSend_396( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer destPath, + ffi.Pointer> error, + ) { + return __objc_msgSend_396( + obj, + sel, + path, + destPath, + error, + ); + } + + late final __objc_msgSend_396Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_396 = __objc_msgSend_396Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_destinationOfSymbolicLinkAtPath_error_1 = + _registerName1("destinationOfSymbolicLinkAtPath:error:"); + ffi.Pointer _objc_msgSend_397( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer> error, + ) { + return __objc_msgSend_397( + obj, + sel, + path, + error, + ); + } + + late final __objc_msgSend_397Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_397 = __objc_msgSend_397Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_copyItemAtPath_toPath_error_1 = + _registerName1("copyItemAtPath:toPath:error:"); + late final _sel_moveItemAtPath_toPath_error_1 = + _registerName1("moveItemAtPath:toPath:error:"); + late final _sel_linkItemAtPath_toPath_error_1 = + _registerName1("linkItemAtPath:toPath:error:"); + late final _sel_removeItemAtPath_error_1 = + _registerName1("removeItemAtPath:error:"); + bool _objc_msgSend_398( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer> error, + ) { + return __objc_msgSend_398( + obj, + sel, + path, + error, + ); + } + + late final __objc_msgSend_398Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_398 = __objc_msgSend_398Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_copyItemAtURL_toURL_error_1 = + _registerName1("copyItemAtURL:toURL:error:"); + late final _sel_moveItemAtURL_toURL_error_1 = + _registerName1("moveItemAtURL:toURL:error:"); + late final _sel_linkItemAtURL_toURL_error_1 = + _registerName1("linkItemAtURL:toURL:error:"); + late final _sel_removeItemAtURL_error_1 = + _registerName1("removeItemAtURL:error:"); + late final _sel_trashItemAtURL_resultingItemURL_error_1 = + _registerName1("trashItemAtURL:resultingItemURL:error:"); + bool _objc_msgSend_399( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer> outResultingURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_399( + obj, + sel, + url, + outResultingURL, + error, + ); + } + + late final __objc_msgSend_399Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_399 = __objc_msgSend_399Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_fileAttributesAtPath_traverseLink_1 = + _registerName1("fileAttributesAtPath:traverseLink:"); + ffi.Pointer _objc_msgSend_400( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool yorn, + ) { + return __objc_msgSend_400( + obj, + sel, + path, + yorn, + ); + } + + late final __objc_msgSend_400Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_400 = __objc_msgSend_400Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_changeFileAttributes_atPath_1 = + _registerName1("changeFileAttributes:atPath:"); + bool _objc_msgSend_401( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attributes, + ffi.Pointer path, + ) { + return __objc_msgSend_401( + obj, + sel, + attributes, + path, + ); + } + + late final __objc_msgSend_401Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_401 = __objc_msgSend_401Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_directoryContentsAtPath_1 = + _registerName1("directoryContentsAtPath:"); + late final _sel_fileSystemAttributesAtPath_1 = + _registerName1("fileSystemAttributesAtPath:"); + late final _sel_pathContentOfSymbolicLinkAtPath_1 = + _registerName1("pathContentOfSymbolicLinkAtPath:"); + late final _sel_createSymbolicLinkAtPath_pathContent_1 = + _registerName1("createSymbolicLinkAtPath:pathContent:"); + bool _objc_msgSend_402( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer otherpath, + ) { + return __objc_msgSend_402( + obj, + sel, + path, + otherpath, + ); + } + + late final __objc_msgSend_402Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_402 = __objc_msgSend_402Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_createDirectoryAtPath_attributes_1 = + _registerName1("createDirectoryAtPath:attributes:"); + bool _objc_msgSend_403( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer attributes, + ) { + return __objc_msgSend_403( + obj, + sel, + path, + attributes, + ); + } + + late final __objc_msgSend_403Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_403 = __objc_msgSend_403Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_linkPath_toPath_handler_1 = + _registerName1("linkPath:toPath:handler:"); + bool _objc_msgSend_404( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer src, + ffi.Pointer dest, + ffi.Pointer handler, + ) { + return __objc_msgSend_404( + obj, + sel, + src, + dest, + handler, + ); + } + + late final __objc_msgSend_404Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_404 = __objc_msgSend_404Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_copyPath_toPath_handler_1 = + _registerName1("copyPath:toPath:handler:"); + late final _sel_movePath_toPath_handler_1 = + _registerName1("movePath:toPath:handler:"); + late final _sel_removeFileAtPath_handler_1 = + _registerName1("removeFileAtPath:handler:"); + bool _objc_msgSend_405( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer handler, + ) { + return __objc_msgSend_405( + obj, + sel, + path, + handler, + ); + } + + late final __objc_msgSend_405Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_405 = __objc_msgSend_405Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_currentDirectoryPath1 = + _registerName1("currentDirectoryPath"); + late final _sel_changeCurrentDirectoryPath_1 = + _registerName1("changeCurrentDirectoryPath:"); + late final _sel_fileExistsAtPath_1 = _registerName1("fileExistsAtPath:"); + late final _sel_fileExistsAtPath_isDirectory_1 = + _registerName1("fileExistsAtPath:isDirectory:"); + bool _objc_msgSend_406( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer isDirectory, + ) { + return __objc_msgSend_406( + obj, + sel, + path, + isDirectory, + ); + } + + late final __objc_msgSend_406Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_406 = __objc_msgSend_406Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isReadableFileAtPath_1 = + _registerName1("isReadableFileAtPath:"); + late final _sel_isWritableFileAtPath_1 = + _registerName1("isWritableFileAtPath:"); + late final _sel_isExecutableFileAtPath_1 = + _registerName1("isExecutableFileAtPath:"); + late final _sel_isDeletableFileAtPath_1 = + _registerName1("isDeletableFileAtPath:"); + late final _sel_contentsEqualAtPath_andPath_1 = + _registerName1("contentsEqualAtPath:andPath:"); + late final _sel_displayNameAtPath_1 = _registerName1("displayNameAtPath:"); + late final _sel_componentsToDisplayForPath_1 = + _registerName1("componentsToDisplayForPath:"); + late final _sel_homeDirectoryForCurrentUser1 = + _registerName1("homeDirectoryForCurrentUser"); + late final _sel_temporaryDirectory1 = _registerName1("temporaryDirectory"); + late final _sel_homeDirectoryForUser_1 = + _registerName1("homeDirectoryForUser:"); + late final _sel_fileManager_shouldProceedAfterError_1 = + _registerName1("fileManager:shouldProceedAfterError:"); + bool _objc_msgSend_407( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer fm, + ffi.Pointer errorInfo, + ) { + return __objc_msgSend_407( + obj, + sel, + fm, + errorInfo, + ); + } + + late final __objc_msgSend_407Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_407 = __objc_msgSend_407Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_fileManager_willProcessPath_1 = + _registerName1("fileManager:willProcessPath:"); + void _objc_msgSend_408( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer fm, + ffi.Pointer path, + ) { + return __objc_msgSend_408( + obj, + sel, + fm, + path, + ); + } + + late final __objc_msgSend_408Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_408 = __objc_msgSend_408Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_validateValue_forKey_error_1 = + _registerName1("validateValue:forKey:error:"); + late final _class_NSMutableArray1 = _getClass1("NSMutableArray"); + late final _sel_addObject_1 = _registerName1("addObject:"); + late final _sel_insertObject_atIndex_1 = + _registerName1("insertObject:atIndex:"); + void _objc_msgSend_409( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + int index, + ) { + return __objc_msgSend_409( + obj, + sel, + anObject, + index, + ); + } + + late final __objc_msgSend_409Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_409 = __objc_msgSend_409Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_removeLastObject1 = _registerName1("removeLastObject"); + late final _sel_removeObjectAtIndex_1 = + _registerName1("removeObjectAtIndex:"); + void _objc_msgSend_410( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_410( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_410Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_410 = __objc_msgSend_410Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_replaceObjectAtIndex_withObject_1 = + _registerName1("replaceObjectAtIndex:withObject:"); + void _objc_msgSend_411( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer anObject, + ) { + return __objc_msgSend_411( + obj, + sel, + index, + anObject, + ); + } + + late final __objc_msgSend_411Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_411 = __objc_msgSend_411Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_initWithCapacity_1 = _registerName1("initWithCapacity:"); + late final _sel_addObjectsFromArray_1 = + _registerName1("addObjectsFromArray:"); + void _objc_msgSend_412( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherArray, + ) { + return __objc_msgSend_412( + obj, + sel, + otherArray, + ); + } + + late final __objc_msgSend_412Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_412 = __objc_msgSend_412Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_exchangeObjectAtIndex_withObjectAtIndex_1 = + _registerName1("exchangeObjectAtIndex:withObjectAtIndex:"); + void _objc_msgSend_413( + ffi.Pointer obj, + ffi.Pointer sel, + int idx1, + int idx2, + ) { + return __objc_msgSend_413( + obj, + sel, + idx1, + idx2, + ); + } + + late final __objc_msgSend_413Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_413 = __objc_msgSend_413Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, int)>(); + + late final _sel_removeAllObjects1 = _registerName1("removeAllObjects"); + late final _sel_removeObject_inRange_1 = + _registerName1("removeObject:inRange:"); + void _objc_msgSend_414( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + NSRange range, + ) { + return __objc_msgSend_414( + obj, + sel, + anObject, + range, + ); + } + + late final __objc_msgSend_414Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_414 = __objc_msgSend_414Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>(); + + late final _sel_removeObject_1 = _registerName1("removeObject:"); + late final _sel_removeObjectIdenticalTo_inRange_1 = + _registerName1("removeObjectIdenticalTo:inRange:"); + late final _sel_removeObjectIdenticalTo_1 = + _registerName1("removeObjectIdenticalTo:"); + late final _sel_removeObjectsFromIndices_numIndices_1 = + _registerName1("removeObjectsFromIndices:numIndices:"); + void _objc_msgSend_415( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indices, + int cnt, + ) { + return __objc_msgSend_415( + obj, + sel, + indices, + cnt, + ); + } + + late final __objc_msgSend_415Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_415 = __objc_msgSend_415Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_removeObjectsInArray_1 = + _registerName1("removeObjectsInArray:"); + late final _sel_removeObjectsInRange_1 = + _registerName1("removeObjectsInRange:"); + void _objc_msgSend_416( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_416( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_416Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_416 = __objc_msgSend_416Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_replaceObjectsInRange_withObjectsFromArray_range_1 = + _registerName1("replaceObjectsInRange:withObjectsFromArray:range:"); + void _objc_msgSend_417( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer otherArray, + NSRange otherRange, + ) { + return __objc_msgSend_417( + obj, + sel, + range, + otherArray, + otherRange, + ); + } + + late final __objc_msgSend_417Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_417 = __objc_msgSend_417Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, + ffi.Pointer, NSRange)>(); + + late final _sel_replaceObjectsInRange_withObjectsFromArray_1 = + _registerName1("replaceObjectsInRange:withObjectsFromArray:"); + void _objc_msgSend_418( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer otherArray, + ) { + return __objc_msgSend_418( + obj, + sel, + range, + otherArray, + ); + } + + late final __objc_msgSend_418Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_418 = __objc_msgSend_418Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, + ffi.Pointer)>(); + + late final _sel_setArray_1 = _registerName1("setArray:"); + late final _sel_sortUsingFunction_context_1 = + _registerName1("sortUsingFunction:context:"); + void _objc_msgSend_419( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + compare, + ffi.Pointer context, + ) { + return __objc_msgSend_419( + obj, + sel, + compare, + context, + ); + } + + late final __objc_msgSend_419Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_419 = __objc_msgSend_419Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>(); + + late final _sel_sortUsingSelector_1 = _registerName1("sortUsingSelector:"); + late final _sel_insertObjects_atIndexes_1 = + _registerName1("insertObjects:atIndexes:"); + void _objc_msgSend_420( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer objects, + ffi.Pointer indexes, + ) { + return __objc_msgSend_420( + obj, + sel, + objects, + indexes, + ); + } + + late final __objc_msgSend_420Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_420 = __objc_msgSend_420Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_removeObjectsAtIndexes_1 = + _registerName1("removeObjectsAtIndexes:"); + void _objc_msgSend_421( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexes, + ) { + return __objc_msgSend_421( + obj, + sel, + indexes, + ); + } + + late final __objc_msgSend_421Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_421 = __objc_msgSend_421Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_replaceObjectsAtIndexes_withObjects_1 = + _registerName1("replaceObjectsAtIndexes:withObjects:"); + void _objc_msgSend_422( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexes, + ffi.Pointer objects, + ) { + return __objc_msgSend_422( + obj, + sel, + indexes, + objects, + ); + } + + late final __objc_msgSend_422Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_422 = __objc_msgSend_422Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setObject_atIndexedSubscript_1 = + _registerName1("setObject:atIndexedSubscript:"); + late final _sel_sortUsingComparator_1 = + _registerName1("sortUsingComparator:"); + void _objc_msgSend_423( + ffi.Pointer obj, + ffi.Pointer sel, + NSComparator cmptr, + ) { + return __objc_msgSend_423( + obj, + sel, + cmptr, + ); + } + + late final __objc_msgSend_423Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSComparator)>>('objc_msgSend'); + late final __objc_msgSend_423 = __objc_msgSend_423Ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, NSComparator)>(); + + late final _sel_sortWithOptions_usingComparator_1 = + _registerName1("sortWithOptions:usingComparator:"); + void _objc_msgSend_424( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + NSComparator cmptr, + ) { + return __objc_msgSend_424( + obj, + sel, + opts, + cmptr, + ); + } + + late final __objc_msgSend_424Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, NSComparator)>>('objc_msgSend'); + late final __objc_msgSend_424 = __objc_msgSend_424Ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, int, NSComparator)>(); + + late final _sel_arrayWithCapacity_1 = _registerName1("arrayWithCapacity:"); + ffi.Pointer _objc_msgSend_425( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ) { + return __objc_msgSend_425( + obj, + sel, + path, + ); + } + + late final __objc_msgSend_425Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_425 = __objc_msgSend_425Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_426( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ) { + return __objc_msgSend_426( + obj, + sel, + url, + ); + } + + late final __objc_msgSend_426Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_426 = __objc_msgSend_426Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_applyDifference_1 = _registerName1("applyDifference:"); + late final _sel_sortUsingDescriptors_1 = + _registerName1("sortUsingDescriptors:"); + late final _sel_filterUsingPredicate_1 = + _registerName1("filterUsingPredicate:"); + void _objc_msgSend_427( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicate, + ) { + return __objc_msgSend_427( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_427Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_427 = __objc_msgSend_427Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_mutableArrayValueForKey_1 = + _registerName1("mutableArrayValueForKey:"); + late final _class_NSMutableOrderedSet1 = _getClass1("NSMutableOrderedSet"); + late final _class_NSOrderedSet1 = _getClass1("NSOrderedSet"); + late final _sel_isEqualToOrderedSet_1 = + _registerName1("isEqualToOrderedSet:"); + bool _objc_msgSend_428( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_428( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_428Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_428 = __objc_msgSend_428Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_intersectsOrderedSet_1 = + _registerName1("intersectsOrderedSet:"); + late final _sel_isSubsetOfOrderedSet_1 = + _registerName1("isSubsetOfOrderedSet:"); + late final _sel_reversedOrderedSet1 = _registerName1("reversedOrderedSet"); + ffi.Pointer _objc_msgSend_429( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_429( + obj, + sel, + ); + } + + late final __objc_msgSend_429Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_429 = __objc_msgSend_429Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_orderedSet1 = _registerName1("orderedSet"); + late final _sel_orderedSetWithObject_1 = + _registerName1("orderedSetWithObject:"); + late final _sel_orderedSetWithObjects_count_1 = + _registerName1("orderedSetWithObjects:count:"); + late final _sel_orderedSetWithObjects_1 = + _registerName1("orderedSetWithObjects:"); + late final _sel_orderedSetWithOrderedSet_1 = + _registerName1("orderedSetWithOrderedSet:"); + instancetype _objc_msgSend_430( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer set1, + ) { + return __objc_msgSend_430( + obj, + sel, + set1, + ); + } + + late final __objc_msgSend_430Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_430 = __objc_msgSend_430Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_orderedSetWithOrderedSet_range_copyItems_1 = + _registerName1("orderedSetWithOrderedSet:range:copyItems:"); + instancetype _objc_msgSend_431( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer set1, + NSRange range, + bool flag, + ) { + return __objc_msgSend_431( + obj, + sel, + set1, + range, + flag, + ); + } + + late final __objc_msgSend_431Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_431 = __objc_msgSend_431Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange, bool)>(); + + late final _sel_orderedSetWithArray_1 = + _registerName1("orderedSetWithArray:"); + late final _sel_orderedSetWithArray_range_copyItems_1 = + _registerName1("orderedSetWithArray:range:copyItems:"); + instancetype _objc_msgSend_432( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer array, + NSRange range, + bool flag, + ) { + return __objc_msgSend_432( + obj, + sel, + array, + range, + flag, + ); + } + + late final __objc_msgSend_432Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_432 = __objc_msgSend_432Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange, bool)>(); + + late final _sel_orderedSetWithSet_1 = _registerName1("orderedSetWithSet:"); + late final _sel_orderedSetWithSet_copyItems_1 = + _registerName1("orderedSetWithSet:copyItems:"); + late final _sel_initWithObject_1 = _registerName1("initWithObject:"); + late final _sel_initWithOrderedSet_1 = _registerName1("initWithOrderedSet:"); + late final _sel_initWithOrderedSet_copyItems_1 = + _registerName1("initWithOrderedSet:copyItems:"); + instancetype _objc_msgSend_433( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer set1, + bool flag, + ) { + return __objc_msgSend_433( + obj, + sel, + set1, + flag, + ); + } + + late final __objc_msgSend_433Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_433 = __objc_msgSend_433Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_initWithOrderedSet_range_copyItems_1 = + _registerName1("initWithOrderedSet:range:copyItems:"); + late final _sel_initWithArray_range_copyItems_1 = + _registerName1("initWithArray:range:copyItems:"); + late final _sel_filteredOrderedSetUsingPredicate_1 = + _registerName1("filteredOrderedSetUsingPredicate:"); + ffi.Pointer _objc_msgSend_434( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer p, + ) { + return __objc_msgSend_434( + obj, + sel, + p, + ); + } + + late final __objc_msgSend_434Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_434 = __objc_msgSend_434Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_addObjects_count_1 = _registerName1("addObjects:count:"); + void _objc_msgSend_435( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + int count, + ) { + return __objc_msgSend_435( + obj, + sel, + objects, + count, + ); + } + + late final __objc_msgSend_435Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_435 = __objc_msgSend_435Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, int)>(); + + late final _sel_moveObjectsAtIndexes_toIndex_1 = + _registerName1("moveObjectsAtIndexes:toIndex:"); + void _objc_msgSend_436( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexes, + int idx, + ) { + return __objc_msgSend_436( + obj, + sel, + indexes, + idx, + ); + } + + late final __objc_msgSend_436Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_436 = __objc_msgSend_436Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_setObject_atIndex_1 = _registerName1("setObject:atIndex:"); + late final _sel_replaceObjectsInRange_withObjects_count_1 = + _registerName1("replaceObjectsInRange:withObjects:count:"); + void _objc_msgSend_437( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer> objects, + int count, + ) { + return __objc_msgSend_437( + obj, + sel, + range, + objects, + count, + ); + } + + late final __objc_msgSend_437Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer>, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_437 = __objc_msgSend_437Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, + ffi.Pointer>, int)>(); + + late final _sel_intersectOrderedSet_1 = + _registerName1("intersectOrderedSet:"); + void _objc_msgSend_438( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_438( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_438Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_438 = __objc_msgSend_438Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_minusOrderedSet_1 = _registerName1("minusOrderedSet:"); + late final _sel_unionOrderedSet_1 = _registerName1("unionOrderedSet:"); + late final _sel_intersectSet_1 = _registerName1("intersectSet:"); + void _objc_msgSend_439( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_439( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_439Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_439 = __objc_msgSend_439Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_minusSet_1 = _registerName1("minusSet:"); + late final _sel_unionSet_1 = _registerName1("unionSet:"); + late final _sel_sortRange_options_usingComparator_1 = + _registerName1("sortRange:options:usingComparator:"); + void _objc_msgSend_440( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + int opts, + NSComparator cmptr, + ) { + return __objc_msgSend_440( + obj, + sel, + range, + opts, + cmptr, + ); + } + + late final __objc_msgSend_440Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, NSComparator)>>('objc_msgSend'); + late final __objc_msgSend_440 = __objc_msgSend_440Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, int, + NSComparator)>(); + + late final _sel_orderedSetWithCapacity_1 = + _registerName1("orderedSetWithCapacity:"); + late final _sel_mutableOrderedSetValueForKey_1 = + _registerName1("mutableOrderedSetValueForKey:"); + ffi.Pointer _objc_msgSend_441( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_441( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_441Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_441 = __objc_msgSend_441Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSMutableSet1 = _getClass1("NSMutableSet"); + late final _sel_setSet_1 = _registerName1("setSet:"); + late final _sel_setWithCapacity_1 = _registerName1("setWithCapacity:"); + late final _sel_mutableSetValueForKey_1 = + _registerName1("mutableSetValueForKey:"); + ffi.Pointer _objc_msgSend_442( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_442( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_442Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_442 = __objc_msgSend_442Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_valueForKeyPath_1 = _registerName1("valueForKeyPath:"); + late final _sel_setValue_forKeyPath_1 = + _registerName1("setValue:forKeyPath:"); + late final _sel_validateValue_forKeyPath_error_1 = + _registerName1("validateValue:forKeyPath:error:"); + late final _sel_mutableArrayValueForKeyPath_1 = + _registerName1("mutableArrayValueForKeyPath:"); + late final _sel_mutableOrderedSetValueForKeyPath_1 = + _registerName1("mutableOrderedSetValueForKeyPath:"); + late final _sel_mutableSetValueForKeyPath_1 = + _registerName1("mutableSetValueForKeyPath:"); + late final _sel_valueForUndefinedKey_1 = + _registerName1("valueForUndefinedKey:"); + late final _sel_setValue_forUndefinedKey_1 = + _registerName1("setValue:forUndefinedKey:"); + late final _sel_setNilValueForKey_1 = _registerName1("setNilValueForKey:"); + late final _sel_dictionaryWithValuesForKeys_1 = + _registerName1("dictionaryWithValuesForKeys:"); + ffi.Pointer _objc_msgSend_443( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keys, + ) { + return __objc_msgSend_443( + obj, + sel, + keys, + ); + } + + late final __objc_msgSend_443Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_443 = __objc_msgSend_443Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setValuesForKeysWithDictionary_1 = + _registerName1("setValuesForKeysWithDictionary:"); + void _objc_msgSend_444( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keyedValues, + ) { + return __objc_msgSend_444( + obj, + sel, + keyedValues, + ); + } + + late final __objc_msgSend_444Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_444 = __objc_msgSend_444Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_storedValueForKey_1 = _registerName1("storedValueForKey:"); + late final _sel_takeStoredValue_forKey_1 = + _registerName1("takeStoredValue:forKey:"); + late final _sel_takeValue_forKey_1 = _registerName1("takeValue:forKey:"); + late final _sel_takeValue_forKeyPath_1 = + _registerName1("takeValue:forKeyPath:"); + late final _sel_handleQueryWithUnboundKey_1 = + _registerName1("handleQueryWithUnboundKey:"); + late final _sel_handleTakeValue_forUnboundKey_1 = + _registerName1("handleTakeValue:forUnboundKey:"); + late final _sel_unableToSetNilForKey_1 = + _registerName1("unableToSetNilForKey:"); + late final _sel_valuesForKeys_1 = _registerName1("valuesForKeys:"); + late final _sel_takeValuesFromDictionary_1 = + _registerName1("takeValuesFromDictionary:"); + late final _sel_observeValueForKeyPath_ofObject_change_context_1 = + _registerName1("observeValueForKeyPath:ofObject:change:context:"); + void _objc_msgSend_445( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keyPath, + ffi.Pointer object, + ffi.Pointer change, + ffi.Pointer context, + ) { + return __objc_msgSend_445( + obj, + sel, + keyPath, + object, + change, + context, + ); + } + + late final __objc_msgSend_445Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_445 = __objc_msgSend_445Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_willChangeValueForKey_1 = + _registerName1("willChangeValueForKey:"); + late final _sel_didChangeValueForKey_1 = + _registerName1("didChangeValueForKey:"); + late final _sel_willChange_valuesAtIndexes_forKey_1 = + _registerName1("willChange:valuesAtIndexes:forKey:"); + void _objc_msgSend_446( + ffi.Pointer obj, + ffi.Pointer sel, + int changeKind, + ffi.Pointer indexes, + ffi.Pointer key, + ) { + return __objc_msgSend_446( + obj, + sel, + changeKind, + indexes, + key, + ); + } + + late final __objc_msgSend_446Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_446 = __objc_msgSend_446Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_didChange_valuesAtIndexes_forKey_1 = + _registerName1("didChange:valuesAtIndexes:forKey:"); + late final _sel_willChangeValueForKey_withSetMutation_usingObjects_1 = + _registerName1("willChangeValueForKey:withSetMutation:usingObjects:"); + void _objc_msgSend_447( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + int mutationKind, + ffi.Pointer objects, + ) { + return __objc_msgSend_447( + obj, + sel, + key, + mutationKind, + objects, + ); + } + + late final __objc_msgSend_447Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_447 = __objc_msgSend_447Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_didChangeValueForKey_withSetMutation_usingObjects_1 = + _registerName1("didChangeValueForKey:withSetMutation:usingObjects:"); + late final _sel_observationInfo1 = _registerName1("observationInfo"); + late final _sel_setObservationInfo_1 = _registerName1("setObservationInfo:"); + void _objc_msgSend_448( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_448( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_448Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_448 = __objc_msgSend_448Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_classForKeyedArchiver1 = + _registerName1("classForKeyedArchiver"); + late final _class_NSKeyedArchiver1 = _getClass1("NSKeyedArchiver"); + late final _sel_initRequiringSecureCoding_1 = + _registerName1("initRequiringSecureCoding:"); + instancetype _objc_msgSend_449( + ffi.Pointer obj, + ffi.Pointer sel, + bool requiresSecureCoding, + ) { + return __objc_msgSend_449( + obj, + sel, + requiresSecureCoding, + ); + } + + late final __objc_msgSend_449Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_449 = __objc_msgSend_449Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_archivedDataWithRootObject_requiringSecureCoding_error_1 = + _registerName1("archivedDataWithRootObject:requiringSecureCoding:error:"); + ffi.Pointer _objc_msgSend_450( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer object, + bool requiresSecureCoding, + ffi.Pointer> error, + ) { + return __objc_msgSend_450( + obj, + sel, + object, + requiresSecureCoding, + error, + ); + } + + late final __objc_msgSend_450Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_450 = __objc_msgSend_450Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer>)>(); + + late final _class_NSMutableData1 = _getClass1("NSMutableData"); + late final _sel_mutableBytes1 = _registerName1("mutableBytes"); + late final _sel_setLength_1 = _registerName1("setLength:"); + void _objc_msgSend_451( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_451( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_451Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_451 = __objc_msgSend_451Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_appendBytes_length_1 = _registerName1("appendBytes:length:"); + late final _sel_appendData_1 = _registerName1("appendData:"); + late final _sel_increaseLengthBy_1 = _registerName1("increaseLengthBy:"); + late final _sel_replaceBytesInRange_withBytes_1 = + _registerName1("replaceBytesInRange:withBytes:"); + void _objc_msgSend_452( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer bytes, + ) { + return __objc_msgSend_452( + obj, + sel, + range, + bytes, + ); + } + + late final __objc_msgSend_452Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_452 = __objc_msgSend_452Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, + ffi.Pointer)>(); + + late final _sel_resetBytesInRange_1 = _registerName1("resetBytesInRange:"); + late final _sel_setData_1 = _registerName1("setData:"); + late final _sel_replaceBytesInRange_withBytes_length_1 = + _registerName1("replaceBytesInRange:withBytes:length:"); + void _objc_msgSend_453( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer replacementBytes, + int replacementLength, + ) { + return __objc_msgSend_453( + obj, + sel, + range, + replacementBytes, + replacementLength, + ); + } + + late final __objc_msgSend_453Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_453 = __objc_msgSend_453Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, + ffi.Pointer, int)>(); + + late final _sel_dataWithCapacity_1 = _registerName1("dataWithCapacity:"); + late final _sel_dataWithLength_1 = _registerName1("dataWithLength:"); + late final _sel_initWithLength_1 = _registerName1("initWithLength:"); + late final _sel_decompressUsingAlgorithm_error_1 = + _registerName1("decompressUsingAlgorithm:error:"); + bool _objc_msgSend_454( + ffi.Pointer obj, + ffi.Pointer sel, + int algorithm, + ffi.Pointer> error, + ) { + return __objc_msgSend_454( + obj, + sel, + algorithm, + error, + ); + } + + late final __objc_msgSend_454Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_454 = __objc_msgSend_454Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer>)>(); + + late final _sel_compressUsingAlgorithm_error_1 = + _registerName1("compressUsingAlgorithm:error:"); + late final _sel_initForWritingWithMutableData_1 = + _registerName1("initForWritingWithMutableData:"); + instancetype _objc_msgSend_455( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ) { + return __objc_msgSend_455( + obj, + sel, + data, + ); + } + + late final __objc_msgSend_455Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_455 = __objc_msgSend_455Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_archivedDataWithRootObject_1 = + _registerName1("archivedDataWithRootObject:"); + ffi.Pointer _objc_msgSend_456( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer rootObject, + ) { + return __objc_msgSend_456( + obj, + sel, + rootObject, + ); + } + + late final __objc_msgSend_456Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_456 = __objc_msgSend_456Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_archiveRootObject_toFile_1 = + _registerName1("archiveRootObject:toFile:"); + late final _sel_outputFormat1 = _registerName1("outputFormat"); + int _objc_msgSend_457( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_457( + obj, + sel, + ); + } + + late final __objc_msgSend_457Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_457 = __objc_msgSend_457Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setOutputFormat_1 = _registerName1("setOutputFormat:"); + void _objc_msgSend_458( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_458( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_458Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_458 = __objc_msgSend_458Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_encodedData1 = _registerName1("encodedData"); + late final _sel_finishEncoding1 = _registerName1("finishEncoding"); + late final _sel_setClassName_forClass_1 = + _registerName1("setClassName:forClass:"); + void _objc_msgSend_459( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer codedName, + ffi.Pointer cls, + ) { + return __objc_msgSend_459( + obj, + sel, + codedName, + cls, + ); + } + + late final __objc_msgSend_459Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_459 = __objc_msgSend_459Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_classNameForClass_1 = _registerName1("classNameForClass:"); + late final _sel_setRequiresSecureCoding_1 = + _registerName1("setRequiresSecureCoding:"); + void _objc_msgSend_460( + ffi.Pointer obj, + ffi.Pointer sel, + bool value, + ) { + return __objc_msgSend_460( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_460Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_460 = __objc_msgSend_460Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_replacementObjectForKeyedArchiver_1 = + _registerName1("replacementObjectForKeyedArchiver:"); + ffi.Pointer _objc_msgSend_461( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer archiver, + ) { + return __objc_msgSend_461( + obj, + sel, + archiver, + ); + } + + late final __objc_msgSend_461Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_461 = __objc_msgSend_461Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_performSelectorOnMainThread_withObject_waitUntilDone_modes_1 = + _registerName1( + "performSelectorOnMainThread:withObject:waitUntilDone:modes:"); + void _objc_msgSend_462( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer arg, + bool wait, + ffi.Pointer array, + ) { + return __objc_msgSend_462( + obj, + sel, + aSelector, + arg, + wait, + array, + ); + } + + late final __objc_msgSend_462Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_462 = __objc_msgSend_462Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer)>(); + + late final _sel_performSelectorOnMainThread_withObject_waitUntilDone_1 = + _registerName1("performSelectorOnMainThread:withObject:waitUntilDone:"); + void _objc_msgSend_463( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer arg, + bool wait, + ) { + return __objc_msgSend_463( + obj, + sel, + aSelector, + arg, + wait, + ); + } + + late final __objc_msgSend_463Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_463 = __objc_msgSend_463Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _class_NSThread1 = _getClass1("NSThread"); + late final _sel_currentThread1 = _registerName1("currentThread"); + ffi.Pointer _objc_msgSend_464( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_464( + obj, + sel, + ); + } + + late final __objc_msgSend_464Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_464 = __objc_msgSend_464Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_detachNewThreadWithBlock_1 = + _registerName1("detachNewThreadWithBlock:"); + void _objc_msgSend_465( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_465( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_465Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_465 = __objc_msgSend_465Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_detachNewThreadSelector_toTarget_withObject_1 = + _registerName1("detachNewThreadSelector:toTarget:withObject:"); + void _objc_msgSend_466( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer selector, + ffi.Pointer target, + ffi.Pointer argument, + ) { + return __objc_msgSend_466( + obj, + sel, + selector, + target, + argument, + ); + } + + late final __objc_msgSend_466Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_466 = __objc_msgSend_466Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_isMultiThreaded1 = _registerName1("isMultiThreaded"); + late final _class_NSMutableDictionary1 = _getClass1("NSMutableDictionary"); + late final _sel_removeObjectForKey_1 = _registerName1("removeObjectForKey:"); + late final _sel_setObject_forKey_1 = _registerName1("setObject:forKey:"); + void _objc_msgSend_467( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ffi.Pointer aKey, + ) { + return __objc_msgSend_467( + obj, + sel, + anObject, + aKey, + ); + } + + late final __objc_msgSend_467Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_467 = __objc_msgSend_467Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_addEntriesFromDictionary_1 = + _registerName1("addEntriesFromDictionary:"); + late final _sel_removeObjectsForKeys_1 = + _registerName1("removeObjectsForKeys:"); + late final _sel_setDictionary_1 = _registerName1("setDictionary:"); + late final _sel_setObject_forKeyedSubscript_1 = + _registerName1("setObject:forKeyedSubscript:"); + late final _sel_dictionaryWithCapacity_1 = + _registerName1("dictionaryWithCapacity:"); + ffi.Pointer _objc_msgSend_468( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ) { + return __objc_msgSend_468( + obj, + sel, + path, + ); + } + + late final __objc_msgSend_468Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_468 = __objc_msgSend_468Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_469( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ) { + return __objc_msgSend_469( + obj, + sel, + url, + ); + } + + late final __objc_msgSend_469Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_469 = __objc_msgSend_469Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_dictionaryWithSharedKeySet_1 = + _registerName1("dictionaryWithSharedKeySet:"); + ffi.Pointer _objc_msgSend_470( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keyset, + ) { + return __objc_msgSend_470( + obj, + sel, + keyset, + ); + } + + late final __objc_msgSend_470Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_470 = __objc_msgSend_470Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_threadDictionary1 = _registerName1("threadDictionary"); + ffi.Pointer _objc_msgSend_471( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_471( + obj, + sel, + ); + } + + late final __objc_msgSend_471Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_471 = __objc_msgSend_471Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_sleepUntilDate_1 = _registerName1("sleepUntilDate:"); + void _objc_msgSend_472( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + ) { + return __objc_msgSend_472( + obj, + sel, + date, + ); + } + + late final __objc_msgSend_472Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_472 = __objc_msgSend_472Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_sleepForTimeInterval_1 = + _registerName1("sleepForTimeInterval:"); + void _objc_msgSend_473( + ffi.Pointer obj, + ffi.Pointer sel, + double ti, + ) { + return __objc_msgSend_473( + obj, + sel, + ti, + ); + } + + late final __objc_msgSend_473Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSTimeInterval)>>('objc_msgSend'); + late final __objc_msgSend_473 = __objc_msgSend_473Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_exit1 = _registerName1("exit"); + late final _sel_threadPriority1 = _registerName1("threadPriority"); + late final _sel_setThreadPriority_1 = _registerName1("setThreadPriority:"); + void _objc_msgSend_474( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_474( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_474Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_474 = __objc_msgSend_474Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_qualityOfService1 = _registerName1("qualityOfService"); + int _objc_msgSend_475( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_475( + obj, + sel, + ); + } + + late final __objc_msgSend_475Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_475 = __objc_msgSend_475Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setQualityOfService_1 = + _registerName1("setQualityOfService:"); + void _objc_msgSend_476( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_476( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_476Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_476 = __objc_msgSend_476Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_callStackReturnAddresses1 = + _registerName1("callStackReturnAddresses"); + late final _sel_callStackSymbols1 = _registerName1("callStackSymbols"); + late final _sel_setName_1 = _registerName1("setName:"); + void _objc_msgSend_477( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_477( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_477Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_477 = __objc_msgSend_477Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_stackSize1 = _registerName1("stackSize"); + late final _sel_setStackSize_1 = _registerName1("setStackSize:"); + late final _sel_isMainThread1 = _registerName1("isMainThread"); + late final _sel_mainThread1 = _registerName1("mainThread"); + late final _sel_initWithTarget_selector_object_1 = + _registerName1("initWithTarget:selector:object:"); + instancetype _objc_msgSend_478( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer target, + ffi.Pointer selector, + ffi.Pointer argument, + ) { + return __objc_msgSend_478( + obj, + sel, + target, + selector, + argument, + ); + } + + late final __objc_msgSend_478Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_478 = __objc_msgSend_478Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithBlock_1 = _registerName1("initWithBlock:"); + instancetype _objc_msgSend_479( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_479( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_479Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_479 = __objc_msgSend_479Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_isExecuting1 = _registerName1("isExecuting"); + late final _sel_isFinished1 = _registerName1("isFinished"); + late final _sel_isCancelled1 = _registerName1("isCancelled"); + late final _sel_cancel1 = _registerName1("cancel"); + late final _sel_start1 = _registerName1("start"); + late final _sel_main1 = _registerName1("main"); + late final _sel_performSelector_onThread_withObject_waitUntilDone_modes_1 = + _registerName1( + "performSelector:onThread:withObject:waitUntilDone:modes:"); + void _objc_msgSend_480( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer thr, + ffi.Pointer arg, + bool wait, + ffi.Pointer array, + ) { + return __objc_msgSend_480( + obj, + sel, + aSelector, + thr, + arg, + wait, + array, + ); + } + + late final __objc_msgSend_480Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_480 = __objc_msgSend_480Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer)>(); + + late final _sel_performSelector_onThread_withObject_waitUntilDone_1 = + _registerName1("performSelector:onThread:withObject:waitUntilDone:"); + void _objc_msgSend_481( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer thr, + ffi.Pointer arg, + bool wait, + ) { + return __objc_msgSend_481( + obj, + sel, + aSelector, + thr, + arg, + wait, + ); + } + + late final __objc_msgSend_481Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_481 = __objc_msgSend_481Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); + + late final _sel_performSelectorInBackground_withObject_1 = + _registerName1("performSelectorInBackground:withObject:"); + late final _sel_classForArchiver1 = _registerName1("classForArchiver"); + late final _class_NSArchiver1 = _getClass1("NSArchiver"); + late final _sel_archiverData1 = _registerName1("archiverData"); + ffi.Pointer _objc_msgSend_482( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_482( + obj, + sel, + ); + } + + late final __objc_msgSend_482Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_482 = __objc_msgSend_482Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_encodeClassName_intoClassName_1 = + _registerName1("encodeClassName:intoClassName:"); + void _objc_msgSend_483( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer trueName, + ffi.Pointer inArchiveName, + ) { + return __objc_msgSend_483( + obj, + sel, + trueName, + inArchiveName, + ); + } + + late final __objc_msgSend_483Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_483 = __objc_msgSend_483Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_classNameEncodedForTrueClassName_1 = + _registerName1("classNameEncodedForTrueClassName:"); + late final _sel_replaceObject_withObject_1 = + _registerName1("replaceObject:withObject:"); + late final _sel_replacementObjectForArchiver_1 = + _registerName1("replacementObjectForArchiver:"); + ffi.Pointer _objc_msgSend_484( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer archiver, + ) { + return __objc_msgSend_484( + obj, + sel, + archiver, + ); + } + + late final __objc_msgSend_484Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_484 = __objc_msgSend_484Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_classForPortCoder1 = _registerName1("classForPortCoder"); + late final _class_NSPortCoder1 = _getClass1("NSPortCoder"); + late final _sel_isBycopy1 = _registerName1("isBycopy"); + late final _sel_isByref1 = _registerName1("isByref"); + late final _class_NSPort1 = _getClass1("NSPort"); + ffi.Pointer _objc_msgSend_485( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_485( + obj, + sel, + ); + } + + late final __objc_msgSend_485Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_485 = __objc_msgSend_485Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_invalidate1 = _registerName1("invalidate"); + late final _sel_isValid1 = _registerName1("isValid"); + late final _class_NSRunLoop1 = _getClass1("NSRunLoop"); + late final _sel_currentRunLoop1 = _registerName1("currentRunLoop"); + ffi.Pointer _objc_msgSend_486( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_486( + obj, + sel, + ); + } + + late final __objc_msgSend_486Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_486 = __objc_msgSend_486Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_mainRunLoop1 = _registerName1("mainRunLoop"); + late final _sel_currentMode1 = _registerName1("currentMode"); + late final _sel_getCFRunLoop1 = _registerName1("getCFRunLoop"); + CFRunLoopRef _objc_msgSend_487( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_487( + obj, + sel, + ); + } + + late final __objc_msgSend_487Ptr = _lookup< + ffi.NativeFunction< + CFRunLoopRef Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_487 = __objc_msgSend_487Ptr.asFunction< + CFRunLoopRef Function(ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSTimer1 = _getClass1("NSTimer"); + late final _sel_timerWithTimeInterval_invocation_repeats_1 = + _registerName1("timerWithTimeInterval:invocation:repeats:"); + ffi.Pointer _objc_msgSend_488( + ffi.Pointer obj, + ffi.Pointer sel, + double ti, + ffi.Pointer invocation, + bool yesOrNo, + ) { + return __objc_msgSend_488( + obj, + sel, + ti, + invocation, + yesOrNo, + ); + } + + late final __objc_msgSend_488Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSTimeInterval, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_488 = __objc_msgSend_488Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, double, ffi.Pointer, bool)>(); + + late final _sel_scheduledTimerWithTimeInterval_invocation_repeats_1 = + _registerName1("scheduledTimerWithTimeInterval:invocation:repeats:"); + late final _sel_timerWithTimeInterval_target_selector_userInfo_repeats_1 = + _registerName1("timerWithTimeInterval:target:selector:userInfo:repeats:"); + ffi.Pointer _objc_msgSend_489( + ffi.Pointer obj, + ffi.Pointer sel, + double ti, + ffi.Pointer aTarget, + ffi.Pointer aSelector, + ffi.Pointer userInfo, + bool yesOrNo, + ) { + return __objc_msgSend_489( + obj, + sel, + ti, + aTarget, + aSelector, + userInfo, + yesOrNo, + ); + } + + late final __objc_msgSend_489Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSTimeInterval, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_489 = __objc_msgSend_489Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + double, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); + + late final _sel_scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_1 = + _registerName1( + "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"); + late final _sel_timerWithTimeInterval_repeats_block_1 = + _registerName1("timerWithTimeInterval:repeats:block:"); + ffi.Pointer _objc_msgSend_490( + ffi.Pointer obj, + ffi.Pointer sel, + double interval, + bool repeats, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_490( + obj, + sel, + interval, + repeats, + block, + ); + } + + late final __objc_msgSend_490Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSTimeInterval, + ffi.Bool, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_490 = __objc_msgSend_490Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, double, bool, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_scheduledTimerWithTimeInterval_repeats_block_1 = + _registerName1("scheduledTimerWithTimeInterval:repeats:block:"); + late final _sel_initWithFireDate_interval_repeats_block_1 = + _registerName1("initWithFireDate:interval:repeats:block:"); + instancetype _objc_msgSend_491( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + double interval, + bool repeats, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_491( + obj, + sel, + date, + interval, + repeats, + block, + ); + } + + late final __objc_msgSend_491Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSTimeInterval, + ffi.Bool, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_491 = __objc_msgSend_491Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, double, bool, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_initWithFireDate_interval_target_selector_userInfo_repeats_1 = + _registerName1( + "initWithFireDate:interval:target:selector:userInfo:repeats:"); + instancetype _objc_msgSend_492( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + double ti, + ffi.Pointer t, + ffi.Pointer s, + ffi.Pointer ui, + bool rep, + ) { + return __objc_msgSend_492( + obj, + sel, + date, + ti, + t, + s, + ui, + rep, + ); + } + + late final __objc_msgSend_492Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSTimeInterval, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_492 = __objc_msgSend_492Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + double, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); + + late final _sel_fire1 = _registerName1("fire"); + late final _sel_fireDate1 = _registerName1("fireDate"); + late final _sel_setFireDate_1 = _registerName1("setFireDate:"); + void _objc_msgSend_493( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_493( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_493Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_493 = __objc_msgSend_493Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_timeInterval1 = _registerName1("timeInterval"); + late final _sel_tolerance1 = _registerName1("tolerance"); + late final _sel_setTolerance_1 = _registerName1("setTolerance:"); + late final _sel_userInfo1 = _registerName1("userInfo"); + late final _sel_addTimer_forMode_1 = _registerName1("addTimer:forMode:"); + void _objc_msgSend_494( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer timer, + NSRunLoopMode mode, + ) { + return __objc_msgSend_494( + obj, + sel, + timer, + mode, + ); + } + + late final __objc_msgSend_494Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRunLoopMode)>>('objc_msgSend'); + late final __objc_msgSend_494 = __objc_msgSend_494Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRunLoopMode)>(); + + late final _sel_addPort_forMode_1 = _registerName1("addPort:forMode:"); + void _objc_msgSend_495( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aPort, + NSRunLoopMode mode, + ) { + return __objc_msgSend_495( + obj, + sel, + aPort, + mode, + ); + } + + late final __objc_msgSend_495Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRunLoopMode)>>('objc_msgSend'); + late final __objc_msgSend_495 = __objc_msgSend_495Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRunLoopMode)>(); + + late final _sel_removePort_forMode_1 = _registerName1("removePort:forMode:"); + late final _sel_limitDateForMode_1 = _registerName1("limitDateForMode:"); + ffi.Pointer _objc_msgSend_496( + ffi.Pointer obj, + ffi.Pointer sel, + NSRunLoopMode mode, + ) { + return __objc_msgSend_496( + obj, + sel, + mode, + ); + } + + late final __objc_msgSend_496Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRunLoopMode)>>('objc_msgSend'); + late final __objc_msgSend_496 = __objc_msgSend_496Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRunLoopMode)>(); + + late final _sel_acceptInputForMode_beforeDate_1 = + _registerName1("acceptInputForMode:beforeDate:"); + void _objc_msgSend_497( + ffi.Pointer obj, + ffi.Pointer sel, + NSRunLoopMode mode, + ffi.Pointer limitDate, + ) { + return __objc_msgSend_497( + obj, + sel, + mode, + limitDate, + ); + } + + late final __objc_msgSend_497Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRunLoopMode, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_497 = __objc_msgSend_497Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + NSRunLoopMode, ffi.Pointer)>(); + + late final _sel_run1 = _registerName1("run"); + late final _sel_runUntilDate_1 = _registerName1("runUntilDate:"); + late final _sel_runMode_beforeDate_1 = _registerName1("runMode:beforeDate:"); + bool _objc_msgSend_498( + ffi.Pointer obj, + ffi.Pointer sel, + NSRunLoopMode mode, + ffi.Pointer limitDate, + ) { + return __objc_msgSend_498( + obj, + sel, + mode, + limitDate, + ); + } + + late final __objc_msgSend_498Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + NSRunLoopMode, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_498 = __objc_msgSend_498Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + NSRunLoopMode, ffi.Pointer)>(); + + late final _sel_configureAsServer1 = _registerName1("configureAsServer"); + late final _sel_performInModes_block_1 = + _registerName1("performInModes:block:"); + void _objc_msgSend_499( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer modes, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_499( + obj, + sel, + modes, + block, + ); + } + + late final __objc_msgSend_499Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_499 = __objc_msgSend_499Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_performBlock_1 = _registerName1("performBlock:"); + late final _sel_performSelector_target_argument_order_modes_1 = + _registerName1("performSelector:target:argument:order:modes:"); + void _objc_msgSend_500( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer target, + ffi.Pointer arg, + int order, + ffi.Pointer modes, + ) { + return __objc_msgSend_500( + obj, + sel, + aSelector, + target, + arg, + order, + modes, + ); + } + + late final __objc_msgSend_500Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_500 = __objc_msgSend_500Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final _sel_cancelPerformSelector_target_argument_1 = + _registerName1("cancelPerformSelector:target:argument:"); + late final _sel_cancelPerformSelectorsWithTarget_1 = + _registerName1("cancelPerformSelectorsWithTarget:"); + late final _sel_scheduleInRunLoop_forMode_1 = + _registerName1("scheduleInRunLoop:forMode:"); + void _objc_msgSend_501( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer runLoop, + NSRunLoopMode mode, + ) { + return __objc_msgSend_501( + obj, + sel, + runLoop, + mode, + ); + } + + late final __objc_msgSend_501Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRunLoopMode)>>('objc_msgSend'); + late final __objc_msgSend_501 = __objc_msgSend_501Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRunLoopMode)>(); + + late final _sel_removeFromRunLoop_forMode_1 = + _registerName1("removeFromRunLoop:forMode:"); + late final _sel_reservedSpaceLength1 = _registerName1("reservedSpaceLength"); + late final _sel_sendBeforeDate_components_from_reserved_1 = + _registerName1("sendBeforeDate:components:from:reserved:"); + bool _objc_msgSend_502( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer limitDate, + ffi.Pointer components, + ffi.Pointer receivePort, + int headerSpaceReserved, + ) { + return __objc_msgSend_502( + obj, + sel, + limitDate, + components, + receivePort, + headerSpaceReserved, + ); + } + + late final __objc_msgSend_502Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_502 = __objc_msgSend_502Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_sendBeforeDate_msgid_components_from_reserved_1 = + _registerName1("sendBeforeDate:msgid:components:from:reserved:"); + bool _objc_msgSend_503( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer limitDate, + int msgID, + ffi.Pointer components, + ffi.Pointer receivePort, + int headerSpaceReserved, + ) { + return __objc_msgSend_503( + obj, + sel, + limitDate, + msgID, + components, + receivePort, + headerSpaceReserved, + ); + } + + late final __objc_msgSend_503Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer, + ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_503 = __objc_msgSend_503Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _class_NSConnection1 = _getClass1("NSConnection"); + late final _sel_statistics1 = _registerName1("statistics"); + late final _sel_allConnections1 = _registerName1("allConnections"); + late final _sel_defaultConnection1 = _registerName1("defaultConnection"); + ffi.Pointer _objc_msgSend_504( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_504( + obj, + sel, + ); + } + + late final __objc_msgSend_504Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_504 = __objc_msgSend_504Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_connectionWithRegisteredName_host_1 = + _registerName1("connectionWithRegisteredName:host:"); + late final _class_NSPortNameServer1 = _getClass1("NSPortNameServer"); + late final _sel_systemDefaultPortNameServer1 = + _registerName1("systemDefaultPortNameServer"); + ffi.Pointer _objc_msgSend_505( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_505( + obj, + sel, + ); + } + + late final __objc_msgSend_505Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_505 = __objc_msgSend_505Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_portForName_1 = _registerName1("portForName:"); + ffi.Pointer _objc_msgSend_506( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ) { + return __objc_msgSend_506( + obj, + sel, + name, + ); + } + + late final __objc_msgSend_506Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_506 = __objc_msgSend_506Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_portForName_host_1 = _registerName1("portForName:host:"); + ffi.Pointer _objc_msgSend_507( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer host, + ) { + return __objc_msgSend_507( + obj, + sel, + name, + host, + ); + } + + late final __objc_msgSend_507Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_507 = __objc_msgSend_507Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_registerPort_name_1 = _registerName1("registerPort:name:"); + bool _objc_msgSend_508( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer port, + ffi.Pointer name, + ) { + return __objc_msgSend_508( + obj, + sel, + port, + name, + ); + } + + late final __objc_msgSend_508Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_508 = __objc_msgSend_508Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_removePortForName_1 = _registerName1("removePortForName:"); + late final _sel_connectionWithRegisteredName_host_usingNameServer_1 = + _registerName1("connectionWithRegisteredName:host:usingNameServer:"); + instancetype _objc_msgSend_509( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer hostName, + ffi.Pointer server, + ) { + return __objc_msgSend_509( + obj, + sel, + name, + hostName, + server, + ); + } + + late final __objc_msgSend_509Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_509 = __objc_msgSend_509Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSDistantObject1 = _getClass1("NSDistantObject"); + late final _class_NSProxy1 = _getClass1("NSProxy"); + late final _sel_respondsToSelector_1 = _registerName1("respondsToSelector:"); + late final _sel_proxyWithTarget_connection_1 = + _registerName1("proxyWithTarget:connection:"); + ffi.Pointer _objc_msgSend_510( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer target, + ffi.Pointer connection, + ) { + return __objc_msgSend_510( + obj, + sel, + target, + connection, + ); + } + + late final __objc_msgSend_510Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_510 = __objc_msgSend_510Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithTarget_connection_1 = + _registerName1("initWithTarget:connection:"); + late final _sel_proxyWithLocal_connection_1 = + _registerName1("proxyWithLocal:connection:"); + late final _sel_initWithLocal_connection_1 = + _registerName1("initWithLocal:connection:"); + late final _sel_setProtocolForProxy_1 = + _registerName1("setProtocolForProxy:"); + void _objc_msgSend_511( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer proto, + ) { + return __objc_msgSend_511( + obj, + sel, + proto, + ); + } + + late final __objc_msgSend_511Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_511 = __objc_msgSend_511Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_connectionForProxy1 = _registerName1("connectionForProxy"); + late final _sel_rootProxyForConnectionWithRegisteredName_host_1 = + _registerName1("rootProxyForConnectionWithRegisteredName:host:"); + ffi.Pointer _objc_msgSend_512( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer hostName, + ) { + return __objc_msgSend_512( + obj, + sel, + name, + hostName, + ); + } + + late final __objc_msgSend_512Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_512 = __objc_msgSend_512Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_rootProxyForConnectionWithRegisteredName_host_usingNameServer_1 = + _registerName1( + "rootProxyForConnectionWithRegisteredName:host:usingNameServer:"); + ffi.Pointer _objc_msgSend_513( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer hostName, + ffi.Pointer server, + ) { + return __objc_msgSend_513( + obj, + sel, + name, + hostName, + server, + ); + } + + late final __objc_msgSend_513Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_513 = __objc_msgSend_513Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_serviceConnectionWithName_rootObject_usingNameServer_1 = + _registerName1("serviceConnectionWithName:rootObject:usingNameServer:"); + instancetype _objc_msgSend_514( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer root, + ffi.Pointer server, + ) { + return __objc_msgSend_514( + obj, + sel, + name, + root, + server, + ); + } + + late final __objc_msgSend_514Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_514 = __objc_msgSend_514Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_serviceConnectionWithName_rootObject_1 = + _registerName1("serviceConnectionWithName:rootObject:"); + late final _sel_requestTimeout1 = _registerName1("requestTimeout"); + late final _sel_setRequestTimeout_1 = _registerName1("setRequestTimeout:"); + late final _sel_replyTimeout1 = _registerName1("replyTimeout"); + late final _sel_setReplyTimeout_1 = _registerName1("setReplyTimeout:"); + late final _sel_rootObject1 = _registerName1("rootObject"); + late final _sel_setRootObject_1 = _registerName1("setRootObject:"); + late final _sel_independentConversationQueueing1 = + _registerName1("independentConversationQueueing"); + late final _sel_setIndependentConversationQueueing_1 = + _registerName1("setIndependentConversationQueueing:"); + late final _sel_rootProxy1 = _registerName1("rootProxy"); + ffi.Pointer _objc_msgSend_515( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_515( + obj, + sel, + ); + } + + late final __objc_msgSend_515Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_515 = __objc_msgSend_515Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_addRequestMode_1 = _registerName1("addRequestMode:"); + late final _sel_removeRequestMode_1 = _registerName1("removeRequestMode:"); + late final _sel_requestModes1 = _registerName1("requestModes"); + late final _sel_registerName_1 = _registerName1("registerName:"); + late final _sel_registerName_withNameServer_1 = + _registerName1("registerName:withNameServer:"); + bool _objc_msgSend_516( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer server, + ) { + return __objc_msgSend_516( + obj, + sel, + name, + server, + ); + } + + late final __objc_msgSend_516Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_516 = __objc_msgSend_516Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_connectionWithReceivePort_sendPort_1 = + _registerName1("connectionWithReceivePort:sendPort:"); + instancetype _objc_msgSend_517( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer receivePort, + ffi.Pointer sendPort, + ) { + return __objc_msgSend_517( + obj, + sel, + receivePort, + sendPort, + ); + } + + late final __objc_msgSend_517Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_517 = __objc_msgSend_517Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_currentConversation1 = _registerName1("currentConversation"); + late final _sel_initWithReceivePort_sendPort_1 = + _registerName1("initWithReceivePort:sendPort:"); + late final _sel_sendPort1 = _registerName1("sendPort"); + late final _sel_receivePort1 = _registerName1("receivePort"); + late final _sel_enableMultipleThreads1 = + _registerName1("enableMultipleThreads"); + late final _sel_multipleThreadsEnabled1 = + _registerName1("multipleThreadsEnabled"); + late final _sel_addRunLoop_1 = _registerName1("addRunLoop:"); + void _objc_msgSend_518( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer runloop, + ) { + return __objc_msgSend_518( + obj, + sel, + runloop, + ); + } + + late final __objc_msgSend_518Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_518 = __objc_msgSend_518Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeRunLoop_1 = _registerName1("removeRunLoop:"); + late final _sel_runInNewThread1 = _registerName1("runInNewThread"); + late final _sel_remoteObjects1 = _registerName1("remoteObjects"); + late final _sel_localObjects1 = _registerName1("localObjects"); + late final _sel_dispatchWithComponents_1 = + _registerName1("dispatchWithComponents:"); + late final _sel_addConnection_toRunLoop_forMode_1 = + _registerName1("addConnection:toRunLoop:forMode:"); + void _objc_msgSend_519( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer conn, + ffi.Pointer runLoop, + NSRunLoopMode mode, + ) { + return __objc_msgSend_519( + obj, + sel, + conn, + runLoop, + mode, + ); + } + + late final __objc_msgSend_519Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSRunLoopMode)>>('objc_msgSend'); + late final __objc_msgSend_519 = __objc_msgSend_519Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, NSRunLoopMode)>(); + + late final _sel_removeConnection_fromRunLoop_forMode_1 = + _registerName1("removeConnection:fromRunLoop:forMode:"); + late final _sel_encodePortObject_1 = _registerName1("encodePortObject:"); + void _objc_msgSend_520( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aport, + ) { + return __objc_msgSend_520( + obj, + sel, + aport, + ); + } + + late final __objc_msgSend_520Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_520 = __objc_msgSend_520Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodePortObject1 = _registerName1("decodePortObject"); + late final _sel_connection1 = _registerName1("connection"); + late final _sel_portCoderWithReceivePort_sendPort_components_1 = + _registerName1("portCoderWithReceivePort:sendPort:components:"); + ffi.Pointer _objc_msgSend_521( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer rcvPort, + ffi.Pointer sndPort, + ffi.Pointer comps, + ) { + return __objc_msgSend_521( + obj, + sel, + rcvPort, + sndPort, + comps, + ); + } + + late final __objc_msgSend_521Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_521 = __objc_msgSend_521Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithReceivePort_sendPort_components_1 = + _registerName1("initWithReceivePort:sendPort:components:"); + late final _sel_dispatch1 = _registerName1("dispatch"); + late final _sel_replacementObjectForPortCoder_1 = + _registerName1("replacementObjectForPortCoder:"); + ffi.Pointer _objc_msgSend_522( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_522( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_522Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_522 = __objc_msgSend_522Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSClassDescription1 = _getClass1("NSClassDescription"); + late final _sel_registerClassDescription_forClass_1 = + _registerName1("registerClassDescription:forClass:"); + void _objc_msgSend_523( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer description, + ffi.Pointer aClass, + ) { + return __objc_msgSend_523( + obj, + sel, + description, + aClass, + ); + } + + late final __objc_msgSend_523Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_523 = __objc_msgSend_523Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_invalidateClassDescriptionCache1 = + _registerName1("invalidateClassDescriptionCache"); + late final _sel_classDescriptionForClass_1 = + _registerName1("classDescriptionForClass:"); + ffi.Pointer _objc_msgSend_524( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ) { + return __objc_msgSend_524( + obj, + sel, + aClass, + ); + } + + late final __objc_msgSend_524Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_524 = __objc_msgSend_524Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_attributeKeys1 = _registerName1("attributeKeys"); + late final _sel_toOneRelationshipKeys1 = + _registerName1("toOneRelationshipKeys"); + late final _sel_toManyRelationshipKeys1 = + _registerName1("toManyRelationshipKeys"); + late final _sel_inverseForRelationshipKey_1 = + _registerName1("inverseForRelationshipKey:"); + late final _sel_classDescription1 = _registerName1("classDescription"); + ffi.Pointer _objc_msgSend_525( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_525( + obj, + sel, + ); + } + + late final __objc_msgSend_525Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_525 = __objc_msgSend_525Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSScriptObjectSpecifier1 = + _getClass1("NSScriptObjectSpecifier"); + late final _class_NSAppleEventDescriptor1 = + _getClass1("NSAppleEventDescriptor"); + late final _sel_nullDescriptor1 = _registerName1("nullDescriptor"); + ffi.Pointer _objc_msgSend_526( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_526( + obj, + sel, + ); + } + + late final __objc_msgSend_526Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_526 = __objc_msgSend_526Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_descriptorWithDescriptorType_bytes_length_1 = + _registerName1("descriptorWithDescriptorType:bytes:length:"); + ffi.Pointer _objc_msgSend_527( + ffi.Pointer obj, + ffi.Pointer sel, + int descriptorType, + ffi.Pointer bytes, + int byteCount, + ) { + return __objc_msgSend_527( + obj, + sel, + descriptorType, + bytes, + byteCount, + ); + } + + late final __objc_msgSend_527Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + DescType, + ffi.Pointer, + NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_527 = __objc_msgSend_527Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer, int)>(); + + late final _sel_descriptorWithDescriptorType_data_1 = + _registerName1("descriptorWithDescriptorType:data:"); + ffi.Pointer _objc_msgSend_528( + ffi.Pointer obj, + ffi.Pointer sel, + int descriptorType, + ffi.Pointer data, + ) { + return __objc_msgSend_528( + obj, + sel, + descriptorType, + data, + ); + } + + late final __objc_msgSend_528Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + DescType, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_528 = __objc_msgSend_528Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_descriptorWithBoolean_1 = + _registerName1("descriptorWithBoolean:"); + ffi.Pointer _objc_msgSend_529( + ffi.Pointer obj, + ffi.Pointer sel, + int boolean, + ) { + return __objc_msgSend_529( + obj, + sel, + boolean, + ); + } + + late final __objc_msgSend_529Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, Boolean)>>('objc_msgSend'); + late final __objc_msgSend_529 = __objc_msgSend_529Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_descriptorWithEnumCode_1 = + _registerName1("descriptorWithEnumCode:"); + ffi.Pointer _objc_msgSend_530( + ffi.Pointer obj, + ffi.Pointer sel, + int enumerator, + ) { + return __objc_msgSend_530( + obj, + sel, + enumerator, + ); + } + + late final __objc_msgSend_530Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, OSType)>>('objc_msgSend'); + late final __objc_msgSend_530 = __objc_msgSend_530Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_descriptorWithInt32_1 = + _registerName1("descriptorWithInt32:"); + ffi.Pointer _objc_msgSend_531( + ffi.Pointer obj, + ffi.Pointer sel, + int signedInt, + ) { + return __objc_msgSend_531( + obj, + sel, + signedInt, + ); + } + + late final __objc_msgSend_531Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, SInt32)>>('objc_msgSend'); + late final __objc_msgSend_531 = __objc_msgSend_531Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_descriptorWithDouble_1 = + _registerName1("descriptorWithDouble:"); + ffi.Pointer _objc_msgSend_532( + ffi.Pointer obj, + ffi.Pointer sel, + double doubleValue, + ) { + return __objc_msgSend_532( + obj, + sel, + doubleValue, + ); + } + + late final __objc_msgSend_532Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_532 = __objc_msgSend_532Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_descriptorWithTypeCode_1 = + _registerName1("descriptorWithTypeCode:"); + late final _sel_descriptorWithString_1 = + _registerName1("descriptorWithString:"); + ffi.Pointer _objc_msgSend_533( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + ) { + return __objc_msgSend_533( + obj, + sel, + string, + ); + } + + late final __objc_msgSend_533Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_533 = __objc_msgSend_533Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_descriptorWithDate_1 = _registerName1("descriptorWithDate:"); + ffi.Pointer _objc_msgSend_534( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + ) { + return __objc_msgSend_534( + obj, + sel, + date, + ); + } + + late final __objc_msgSend_534Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_534 = __objc_msgSend_534Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_descriptorWithFileURL_1 = + _registerName1("descriptorWithFileURL:"); + ffi.Pointer _objc_msgSend_535( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer fileURL, + ) { + return __objc_msgSend_535( + obj, + sel, + fileURL, + ); + } + + late final __objc_msgSend_535Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_535 = __objc_msgSend_535Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_appleEventWithEventClass_eventID_targetDescriptor_returnID_transactionID_1 = + _registerName1( + "appleEventWithEventClass:eventID:targetDescriptor:returnID:transactionID:"); + ffi.Pointer _objc_msgSend_536( + ffi.Pointer obj, + ffi.Pointer sel, + int eventClass, + int eventID, + ffi.Pointer targetDescriptor, + int returnID, + int transactionID, + ) { + return __objc_msgSend_536( + obj, + sel, + eventClass, + eventID, + targetDescriptor, + returnID, + transactionID, + ); + } + + late final __objc_msgSend_536Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + AEEventClass, + AEEventID, + ffi.Pointer, + AEReturnID, + AETransactionID)>>('objc_msgSend'); + late final __objc_msgSend_536 = __objc_msgSend_536Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer, int, int)>(); + + late final _sel_listDescriptor1 = _registerName1("listDescriptor"); + late final _sel_recordDescriptor1 = _registerName1("recordDescriptor"); + late final _sel_currentProcessDescriptor1 = + _registerName1("currentProcessDescriptor"); + late final _sel_descriptorWithProcessIdentifier_1 = + _registerName1("descriptorWithProcessIdentifier:"); + late final _sel_descriptorWithBundleIdentifier_1 = + _registerName1("descriptorWithBundleIdentifier:"); + late final _sel_descriptorWithApplicationURL_1 = + _registerName1("descriptorWithApplicationURL:"); + late final _sel_initWithAEDescNoCopy_1 = + _registerName1("initWithAEDescNoCopy:"); + instancetype _objc_msgSend_537( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aeDesc, + ) { + return __objc_msgSend_537( + obj, + sel, + aeDesc, + ); + } + + late final __objc_msgSend_537Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_537 = __objc_msgSend_537Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithDescriptorType_bytes_length_1 = + _registerName1("initWithDescriptorType:bytes:length:"); + instancetype _objc_msgSend_538( + ffi.Pointer obj, + ffi.Pointer sel, + int descriptorType, + ffi.Pointer bytes, + int byteCount, + ) { + return __objc_msgSend_538( + obj, + sel, + descriptorType, + bytes, + byteCount, + ); + } + + late final __objc_msgSend_538Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + DescType, ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_538 = __objc_msgSend_538Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer, int)>(); + + late final _sel_initWithDescriptorType_data_1 = + _registerName1("initWithDescriptorType:data:"); + instancetype _objc_msgSend_539( + ffi.Pointer obj, + ffi.Pointer sel, + int descriptorType, + ffi.Pointer data, + ) { + return __objc_msgSend_539( + obj, + sel, + descriptorType, + data, + ); + } + + late final __objc_msgSend_539Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + DescType, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_539 = __objc_msgSend_539Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_initWithEventClass_eventID_targetDescriptor_returnID_transactionID_1 = + _registerName1( + "initWithEventClass:eventID:targetDescriptor:returnID:transactionID:"); + instancetype _objc_msgSend_540( + ffi.Pointer obj, + ffi.Pointer sel, + int eventClass, + int eventID, + ffi.Pointer targetDescriptor, + int returnID, + int transactionID, + ) { + return __objc_msgSend_540( + obj, + sel, + eventClass, + eventID, + targetDescriptor, + returnID, + transactionID, + ); + } + + late final __objc_msgSend_540Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + AEEventClass, + AEEventID, + ffi.Pointer, + AEReturnID, + AETransactionID)>>('objc_msgSend'); + late final __objc_msgSend_540 = __objc_msgSend_540Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + int, ffi.Pointer, int, int)>(); + + late final _sel_initListDescriptor1 = _registerName1("initListDescriptor"); + late final _sel_initRecordDescriptor1 = + _registerName1("initRecordDescriptor"); + late final _sel_aeDesc1 = _registerName1("aeDesc"); + ffi.Pointer _objc_msgSend_541( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_541( + obj, + sel, + ); + } + + late final __objc_msgSend_541Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_541 = __objc_msgSend_541Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_descriptorType1 = _registerName1("descriptorType"); + late final _sel_booleanValue1 = _registerName1("booleanValue"); + late final _sel_enumCodeValue1 = _registerName1("enumCodeValue"); + late final _sel_int32Value1 = _registerName1("int32Value"); + late final _sel_typeCodeValue1 = _registerName1("typeCodeValue"); + late final _sel_dateValue1 = _registerName1("dateValue"); + late final _sel_fileURLValue1 = _registerName1("fileURLValue"); + late final _sel_eventClass1 = _registerName1("eventClass"); + late final _sel_eventID1 = _registerName1("eventID"); + late final _sel_returnID1 = _registerName1("returnID"); + late final _sel_transactionID1 = _registerName1("transactionID"); + late final _sel_setParamDescriptor_forKeyword_1 = + _registerName1("setParamDescriptor:forKeyword:"); + void _objc_msgSend_542( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer descriptor, + int keyword, + ) { + return __objc_msgSend_542( + obj, + sel, + descriptor, + keyword, + ); + } + + late final __objc_msgSend_542Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, AEKeyword)>>('objc_msgSend'); + late final __objc_msgSend_542 = __objc_msgSend_542Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_paramDescriptorForKeyword_1 = + _registerName1("paramDescriptorForKeyword:"); + late final _sel_removeParamDescriptorWithKeyword_1 = + _registerName1("removeParamDescriptorWithKeyword:"); + void _objc_msgSend_543( + ffi.Pointer obj, + ffi.Pointer sel, + int keyword, + ) { + return __objc_msgSend_543( + obj, + sel, + keyword, + ); + } + + late final __objc_msgSend_543Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + AEKeyword)>>('objc_msgSend'); + late final __objc_msgSend_543 = __objc_msgSend_543Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_setAttributeDescriptor_forKeyword_1 = + _registerName1("setAttributeDescriptor:forKeyword:"); + late final _sel_attributeDescriptorForKeyword_1 = + _registerName1("attributeDescriptorForKeyword:"); + late final _sel_sendEventWithOptions_timeout_error_1 = + _registerName1("sendEventWithOptions:timeout:error:"); + ffi.Pointer _objc_msgSend_544( + ffi.Pointer obj, + ffi.Pointer sel, + int sendOptions, + double timeoutInSeconds, + ffi.Pointer> error, + ) { + return __objc_msgSend_544( + obj, + sel, + sendOptions, + timeoutInSeconds, + error, + ); + } + + late final __objc_msgSend_544Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSTimeInterval, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_544 = __objc_msgSend_544Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + double, + ffi.Pointer>)>(); + + late final _sel_isRecordDescriptor1 = _registerName1("isRecordDescriptor"); + late final _sel_numberOfItems1 = _registerName1("numberOfItems"); + late final _sel_insertDescriptor_atIndex_1 = + _registerName1("insertDescriptor:atIndex:"); + void _objc_msgSend_545( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer descriptor, + int index, + ) { + return __objc_msgSend_545( + obj, + sel, + descriptor, + index, + ); + } + + late final __objc_msgSend_545Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_545 = __objc_msgSend_545Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_descriptorAtIndex_1 = _registerName1("descriptorAtIndex:"); + ffi.Pointer _objc_msgSend_546( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_546( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_546Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_546 = __objc_msgSend_546Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_removeDescriptorAtIndex_1 = + _registerName1("removeDescriptorAtIndex:"); + late final _sel_setDescriptor_forKeyword_1 = + _registerName1("setDescriptor:forKeyword:"); + late final _sel_descriptorForKeyword_1 = + _registerName1("descriptorForKeyword:"); + late final _sel_removeDescriptorWithKeyword_1 = + _registerName1("removeDescriptorWithKeyword:"); + late final _sel_keywordForDescriptorAtIndex_1 = + _registerName1("keywordForDescriptorAtIndex:"); + int _objc_msgSend_547( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_547( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_547Ptr = _lookup< + ffi.NativeFunction< + AEKeyword Function(ffi.Pointer, ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_547 = __objc_msgSend_547Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_coerceToDescriptorType_1 = + _registerName1("coerceToDescriptorType:"); + late final _sel_objectSpecifierWithDescriptor_1 = + _registerName1("objectSpecifierWithDescriptor:"); + ffi.Pointer _objc_msgSend_548( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer descriptor, + ) { + return __objc_msgSend_548( + obj, + sel, + descriptor, + ); + } + + late final __objc_msgSend_548Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_548 = __objc_msgSend_548Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithContainerSpecifier_key_1 = + _registerName1("initWithContainerSpecifier:key:"); + instancetype _objc_msgSend_549( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer container, + ffi.Pointer property, + ) { + return __objc_msgSend_549( + obj, + sel, + container, + property, + ); + } + + late final __objc_msgSend_549Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_549 = __objc_msgSend_549Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSScriptClassDescription1 = + _getClass1("NSScriptClassDescription"); + ffi.Pointer _objc_msgSend_550( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ) { + return __objc_msgSend_550( + obj, + sel, + aClass, + ); + } + + late final __objc_msgSend_550Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_550 = __objc_msgSend_550Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithSuiteName_className_dictionary_1 = + _registerName1("initWithSuiteName:className:dictionary:"); + instancetype _objc_msgSend_551( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer suiteName, + ffi.Pointer className, + ffi.Pointer classDeclaration, + ) { + return __objc_msgSend_551( + obj, + sel, + suiteName, + className, + classDeclaration, + ); + } + + late final __objc_msgSend_551Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_551 = __objc_msgSend_551Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_suiteName1 = _registerName1("suiteName"); + late final _sel_className1 = _registerName1("className"); + late final _sel_implementationClassName1 = + _registerName1("implementationClassName"); + late final _sel_superclassDescription1 = + _registerName1("superclassDescription"); + ffi.Pointer _objc_msgSend_552( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_552( + obj, + sel, + ); + } + + late final __objc_msgSend_552Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_552 = __objc_msgSend_552Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_appleEventCode1 = _registerName1("appleEventCode"); + late final _sel_matchesAppleEventCode_1 = + _registerName1("matchesAppleEventCode:"); + late final _class_NSScriptCommandDescription1 = + _getClass1("NSScriptCommandDescription"); + late final _sel_initWithSuiteName_commandName_dictionary_1 = + _registerName1("initWithSuiteName:commandName:dictionary:"); + late final _sel_commandName1 = _registerName1("commandName"); + late final _sel_appleEventClassCode1 = _registerName1("appleEventClassCode"); + late final _sel_commandClassName1 = _registerName1("commandClassName"); + late final _sel_returnType1 = _registerName1("returnType"); + late final _sel_appleEventCodeForReturnType1 = + _registerName1("appleEventCodeForReturnType"); + late final _sel_argumentNames1 = _registerName1("argumentNames"); + late final _sel_typeForArgumentWithName_1 = + _registerName1("typeForArgumentWithName:"); + late final _sel_appleEventCodeForArgumentWithName_1 = + _registerName1("appleEventCodeForArgumentWithName:"); + int _objc_msgSend_553( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer argumentName, + ) { + return __objc_msgSend_553( + obj, + sel, + argumentName, + ); + } + + late final __objc_msgSend_553Ptr = _lookup< + ffi.NativeFunction< + FourCharCode Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_553 = __objc_msgSend_553Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_isOptionalArgumentWithName_1 = + _registerName1("isOptionalArgumentWithName:"); + late final _class_NSScriptCommand1 = _getClass1("NSScriptCommand"); + late final _sel_initWithCommandDescription_1 = + _registerName1("initWithCommandDescription:"); + instancetype _objc_msgSend_554( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer commandDef, + ) { + return __objc_msgSend_554( + obj, + sel, + commandDef, + ); + } + + late final __objc_msgSend_554Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_554 = __objc_msgSend_554Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_commandDescription1 = _registerName1("commandDescription"); + ffi.Pointer _objc_msgSend_555( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_555( + obj, + sel, + ); + } + + late final __objc_msgSend_555Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_555 = __objc_msgSend_555Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_directParameter1 = _registerName1("directParameter"); + late final _sel_setDirectParameter_1 = _registerName1("setDirectParameter:"); + late final _sel_receiversSpecifier1 = _registerName1("receiversSpecifier"); + ffi.Pointer _objc_msgSend_556( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_556( + obj, + sel, + ); + } + + late final __objc_msgSend_556Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_556 = __objc_msgSend_556Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setReceiversSpecifier_1 = + _registerName1("setReceiversSpecifier:"); + void _objc_msgSend_557( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_557( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_557Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_557 = __objc_msgSend_557Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_evaluatedReceivers1 = _registerName1("evaluatedReceivers"); + late final _sel_arguments1 = _registerName1("arguments"); + late final _sel_setArguments_1 = _registerName1("setArguments:"); + late final _sel_evaluatedArguments1 = _registerName1("evaluatedArguments"); + late final _sel_isWellFormed1 = _registerName1("isWellFormed"); + late final _sel_performDefaultImplementation1 = + _registerName1("performDefaultImplementation"); + late final _sel_executeCommand1 = _registerName1("executeCommand"); + late final _sel_scriptErrorNumber1 = _registerName1("scriptErrorNumber"); + late final _sel_setScriptErrorNumber_1 = + _registerName1("setScriptErrorNumber:"); + void _objc_msgSend_558( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_558( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_558Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_558 = __objc_msgSend_558Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_scriptErrorOffendingObjectDescriptor1 = + _registerName1("scriptErrorOffendingObjectDescriptor"); + late final _sel_setScriptErrorOffendingObjectDescriptor_1 = + _registerName1("setScriptErrorOffendingObjectDescriptor:"); + void _objc_msgSend_559( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_559( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_559Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_559 = __objc_msgSend_559Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scriptErrorExpectedTypeDescriptor1 = + _registerName1("scriptErrorExpectedTypeDescriptor"); + late final _sel_setScriptErrorExpectedTypeDescriptor_1 = + _registerName1("setScriptErrorExpectedTypeDescriptor:"); + late final _sel_scriptErrorString1 = _registerName1("scriptErrorString"); + late final _sel_setScriptErrorString_1 = + _registerName1("setScriptErrorString:"); + late final _sel_currentCommand1 = _registerName1("currentCommand"); + ffi.Pointer _objc_msgSend_560( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_560( + obj, + sel, + ); + } + + late final __objc_msgSend_560Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_560 = __objc_msgSend_560Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_appleEvent1 = _registerName1("appleEvent"); + late final _sel_suspendExecution1 = _registerName1("suspendExecution"); + late final _sel_resumeExecutionWithResult_1 = + _registerName1("resumeExecutionWithResult:"); + late final _sel_createCommandInstance1 = + _registerName1("createCommandInstance"); + late final _sel_createCommandInstanceWithZone_1 = + _registerName1("createCommandInstanceWithZone:"); + ffi.Pointer _objc_msgSend_561( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer zone, + ) { + return __objc_msgSend_561( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_561Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_561 = __objc_msgSend_561Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_supportsCommand_1 = _registerName1("supportsCommand:"); + bool _objc_msgSend_562( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer commandDescription, + ) { + return __objc_msgSend_562( + obj, + sel, + commandDescription, + ); + } + + late final __objc_msgSend_562Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_562 = __objc_msgSend_562Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_selectorForCommand_1 = _registerName1("selectorForCommand:"); + ffi.Pointer _objc_msgSend_563( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer commandDescription, + ) { + return __objc_msgSend_563( + obj, + sel, + commandDescription, + ); + } + + late final __objc_msgSend_563Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_563 = __objc_msgSend_563Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_typeForKey_1 = _registerName1("typeForKey:"); + late final _sel_classDescriptionForKey_1 = + _registerName1("classDescriptionForKey:"); + ffi.Pointer _objc_msgSend_564( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_564( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_564Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_564 = __objc_msgSend_564Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_appleEventCodeForKey_1 = + _registerName1("appleEventCodeForKey:"); + late final _sel_keyWithAppleEventCode_1 = + _registerName1("keyWithAppleEventCode:"); + ffi.Pointer _objc_msgSend_565( + ffi.Pointer obj, + ffi.Pointer sel, + int appleEventCode, + ) { + return __objc_msgSend_565( + obj, + sel, + appleEventCode, + ); + } + + late final __objc_msgSend_565Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, FourCharCode)>>('objc_msgSend'); + late final __objc_msgSend_565 = __objc_msgSend_565Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_defaultSubcontainerAttributeKey1 = + _registerName1("defaultSubcontainerAttributeKey"); + late final _sel_isLocationRequiredToCreateForKey_1 = + _registerName1("isLocationRequiredToCreateForKey:"); + late final _sel_hasPropertyForKey_1 = _registerName1("hasPropertyForKey:"); + late final _sel_hasOrderedToManyRelationshipForKey_1 = + _registerName1("hasOrderedToManyRelationshipForKey:"); + late final _sel_hasReadablePropertyForKey_1 = + _registerName1("hasReadablePropertyForKey:"); + late final _sel_hasWritablePropertyForKey_1 = + _registerName1("hasWritablePropertyForKey:"); + late final _sel_isReadOnlyKey_1 = _registerName1("isReadOnlyKey:"); + late final _sel_initWithContainerClassDescription_containerSpecifier_key_1 = + _registerName1( + "initWithContainerClassDescription:containerSpecifier:key:"); + instancetype _objc_msgSend_566( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer classDesc, + ffi.Pointer container, + ffi.Pointer property, + ) { + return __objc_msgSend_566( + obj, + sel, + classDesc, + container, + property, + ); + } + + late final __objc_msgSend_566Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_566 = __objc_msgSend_566Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_childSpecifier1 = _registerName1("childSpecifier"); + late final _sel_setChildSpecifier_1 = _registerName1("setChildSpecifier:"); + late final _sel_containerSpecifier1 = _registerName1("containerSpecifier"); + late final _sel_setContainerSpecifier_1 = + _registerName1("setContainerSpecifier:"); + late final _sel_containerIsObjectBeingTested1 = + _registerName1("containerIsObjectBeingTested"); + late final _sel_setContainerIsObjectBeingTested_1 = + _registerName1("setContainerIsObjectBeingTested:"); + late final _sel_containerIsRangeContainerObject1 = + _registerName1("containerIsRangeContainerObject"); + late final _sel_setContainerIsRangeContainerObject_1 = + _registerName1("setContainerIsRangeContainerObject:"); + late final _sel_key1 = _registerName1("key"); + late final _sel_setKey_1 = _registerName1("setKey:"); + late final _sel_containerClassDescription1 = + _registerName1("containerClassDescription"); + late final _sel_setContainerClassDescription_1 = + _registerName1("setContainerClassDescription:"); + void _objc_msgSend_567( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_567( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_567Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_567 = __objc_msgSend_567Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_keyClassDescription1 = _registerName1("keyClassDescription"); + late final _sel_indicesOfObjectsByEvaluatingWithContainer_count_1 = + _registerName1("indicesOfObjectsByEvaluatingWithContainer:count:"); + ffi.Pointer _objc_msgSend_568( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer container, + ffi.Pointer count, + ) { + return __objc_msgSend_568( + obj, + sel, + container, + count, + ); + } + + late final __objc_msgSend_568Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_568 = __objc_msgSend_568Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_objectsByEvaluatingWithContainers_1 = + _registerName1("objectsByEvaluatingWithContainers:"); + late final _sel_objectsByEvaluatingSpecifier1 = + _registerName1("objectsByEvaluatingSpecifier"); + late final _sel_evaluationErrorNumber1 = + _registerName1("evaluationErrorNumber"); + late final _sel_setEvaluationErrorNumber_1 = + _registerName1("setEvaluationErrorNumber:"); + late final _sel_evaluationErrorSpecifier1 = + _registerName1("evaluationErrorSpecifier"); + late final _sel_descriptor1 = _registerName1("descriptor"); + late final _sel_scriptingValueForSpecifier_1 = + _registerName1("scriptingValueForSpecifier:"); + ffi.Pointer _objc_msgSend_569( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer objectSpecifier, + ) { + return __objc_msgSend_569( + obj, + sel, + objectSpecifier, + ); + } + + late final __objc_msgSend_569Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_569 = __objc_msgSend_569Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_scriptingProperties1 = _registerName1("scriptingProperties"); + late final _sel_setScriptingProperties_1 = + _registerName1("setScriptingProperties:"); + late final _sel_copyScriptingValue_forKey_withProperties_1 = + _registerName1("copyScriptingValue:forKey:withProperties:"); + ffi.Pointer _objc_msgSend_570( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ffi.Pointer key, + ffi.Pointer properties, + ) { + return __objc_msgSend_570( + obj, + sel, + value, + key, + properties, + ); + } + + late final __objc_msgSend_570Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_570 = __objc_msgSend_570Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_newScriptingObjectOfClass_forValueForKey_withContentsValue_properties_1 = + _registerName1( + "newScriptingObjectOfClass:forValueForKey:withContentsValue:properties:"); + ffi.Pointer _objc_msgSend_571( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer objectClass, + ffi.Pointer key, + ffi.Pointer contentsValue, + ffi.Pointer properties, + ) { + return __objc_msgSend_571( + obj, + sel, + objectClass, + key, + contentsValue, + properties, + ); + } + + late final __objc_msgSend_571Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_571 = __objc_msgSend_571Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_classCode1 = _registerName1("classCode"); + late final _sel_valueAtIndex_inPropertyWithKey_1 = + _registerName1("valueAtIndex:inPropertyWithKey:"); + ffi.Pointer _objc_msgSend_572( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer key, + ) { + return __objc_msgSend_572( + obj, + sel, + index, + key, + ); + } + + late final __objc_msgSend_572Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_572 = __objc_msgSend_572Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_valueWithName_inPropertyWithKey_1 = + _registerName1("valueWithName:inPropertyWithKey:"); + late final _sel_valueWithUniqueID_inPropertyWithKey_1 = + _registerName1("valueWithUniqueID:inPropertyWithKey:"); + late final _sel_insertValue_atIndex_inPropertyWithKey_1 = + _registerName1("insertValue:atIndex:inPropertyWithKey:"); + void _objc_msgSend_573( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + int index, + ffi.Pointer key, + ) { + return __objc_msgSend_573( + obj, + sel, + value, + index, + key, + ); + } + + late final __objc_msgSend_573Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_573 = __objc_msgSend_573Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_removeValueAtIndex_fromPropertyWithKey_1 = + _registerName1("removeValueAtIndex:fromPropertyWithKey:"); + void _objc_msgSend_574( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer key, + ) { + return __objc_msgSend_574( + obj, + sel, + index, + key, + ); + } + + late final __objc_msgSend_574Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_574 = __objc_msgSend_574Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_replaceValueAtIndex_inPropertyWithKey_withValue_1 = + _registerName1("replaceValueAtIndex:inPropertyWithKey:withValue:"); + void _objc_msgSend_575( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer key, + ffi.Pointer value, + ) { + return __objc_msgSend_575( + obj, + sel, + index, + key, + value, + ); + } + + late final __objc_msgSend_575Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_575 = __objc_msgSend_575Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_insertValue_inPropertyWithKey_1 = + _registerName1("insertValue:inPropertyWithKey:"); + late final _sel_coerceValue_forKey_1 = _registerName1("coerceValue:forKey:"); + late final _sel_objectSpecifier1 = _registerName1("objectSpecifier"); + late final _sel_indicesOfObjectsByEvaluatingObjectSpecifier_1 = + _registerName1("indicesOfObjectsByEvaluatingObjectSpecifier:"); + ffi.Pointer _objc_msgSend_576( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer specifier, + ) { + return __objc_msgSend_576( + obj, + sel, + specifier, + ); + } + + late final __objc_msgSend_576Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_576 = __objc_msgSend_576Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isEqualTo_1 = _registerName1("isEqualTo:"); + late final _sel_isLessThanOrEqualTo_1 = + _registerName1("isLessThanOrEqualTo:"); + late final _sel_isLessThan_1 = _registerName1("isLessThan:"); + late final _sel_isGreaterThanOrEqualTo_1 = + _registerName1("isGreaterThanOrEqualTo:"); + late final _sel_isGreaterThan_1 = _registerName1("isGreaterThan:"); + late final _sel_isNotEqualTo_1 = _registerName1("isNotEqualTo:"); + late final _sel_doesContain_1 = _registerName1("doesContain:"); + late final _sel_isLike_1 = _registerName1("isLike:"); + late final _sel_isCaseInsensitiveLike_1 = + _registerName1("isCaseInsensitiveLike:"); + late final _sel_scriptingIsEqualTo_1 = _registerName1("scriptingIsEqualTo:"); + late final _sel_scriptingIsLessThanOrEqualTo_1 = + _registerName1("scriptingIsLessThanOrEqualTo:"); + late final _sel_scriptingIsLessThan_1 = + _registerName1("scriptingIsLessThan:"); + late final _sel_scriptingIsGreaterThanOrEqualTo_1 = + _registerName1("scriptingIsGreaterThanOrEqualTo:"); + late final _sel_scriptingIsGreaterThan_1 = + _registerName1("scriptingIsGreaterThan:"); + late final _sel_scriptingBeginsWith_1 = + _registerName1("scriptingBeginsWith:"); + late final _sel_scriptingEndsWith_1 = _registerName1("scriptingEndsWith:"); + late final _sel_scriptingContains_1 = _registerName1("scriptingContains:"); + late final _class_NSItemProvider1 = _getClass1("NSItemProvider"); + late final _class_NSProgress1 = _getClass1("NSProgress"); + late final _sel_currentProgress1 = _registerName1("currentProgress"); + ffi.Pointer _objc_msgSend_577( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_577( + obj, + sel, + ); + } + + late final __objc_msgSend_577Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_577 = __objc_msgSend_577Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_progressWithTotalUnitCount_1 = + _registerName1("progressWithTotalUnitCount:"); + ffi.Pointer _objc_msgSend_578( + ffi.Pointer obj, + ffi.Pointer sel, + int unitCount, + ) { + return __objc_msgSend_578( + obj, + sel, + unitCount, + ); + } + + late final __objc_msgSend_578Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int64)>>('objc_msgSend'); + late final __objc_msgSend_578 = __objc_msgSend_578Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_discreteProgressWithTotalUnitCount_1 = + _registerName1("discreteProgressWithTotalUnitCount:"); + late final _sel_progressWithTotalUnitCount_parent_pendingUnitCount_1 = + _registerName1("progressWithTotalUnitCount:parent:pendingUnitCount:"); + ffi.Pointer _objc_msgSend_579( + ffi.Pointer obj, + ffi.Pointer sel, + int unitCount, + ffi.Pointer parent, + int portionOfParentTotalUnitCount, + ) { + return __objc_msgSend_579( + obj, + sel, + unitCount, + parent, + portionOfParentTotalUnitCount, + ); + } + + late final __objc_msgSend_579Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer, + ffi.Int64)>>('objc_msgSend'); + late final __objc_msgSend_579 = __objc_msgSend_579Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer, int)>(); + + late final _sel_initWithParent_userInfo_1 = + _registerName1("initWithParent:userInfo:"); + instancetype _objc_msgSend_580( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer parentProgressOrNil, + ) { + return __objc_msgSend_580( + obj, + sel, + parentProgressOrNil, + ); + } + + late final __objc_msgSend_580Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_580 = __objc_msgSend_580Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_becomeCurrentWithPendingUnitCount_1 = + _registerName1("becomeCurrentWithPendingUnitCount:"); + void _objc_msgSend_581( + ffi.Pointer obj, + ffi.Pointer sel, + int unitCount, + ) { + return __objc_msgSend_581( + obj, + sel, + unitCount, + ); + } + + late final __objc_msgSend_581Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int64)>>('objc_msgSend'); + late final __objc_msgSend_581 = __objc_msgSend_581Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_performAsCurrentWithPendingUnitCount_usingBlock_1 = + _registerName1("performAsCurrentWithPendingUnitCount:usingBlock:"); + void _objc_msgSend_582( + ffi.Pointer obj, + ffi.Pointer sel, + int unitCount, + ffi.Pointer<_ObjCBlock> work, + ) { + return __objc_msgSend_582( + obj, + sel, + unitCount, + work, + ); + } + + late final __objc_msgSend_582Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int64, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_582 = __objc_msgSend_582Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_resignCurrent1 = _registerName1("resignCurrent"); + late final _sel_addChild_withPendingUnitCount_1 = + _registerName1("addChild:withPendingUnitCount:"); + void _objc_msgSend_583( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer child, + int inUnitCount, + ) { + return __objc_msgSend_583( + obj, + sel, + child, + inUnitCount, + ); + } + + late final __objc_msgSend_583Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int64)>>('objc_msgSend'); + late final __objc_msgSend_583 = __objc_msgSend_583Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_totalUnitCount1 = _registerName1("totalUnitCount"); + int _objc_msgSend_584( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_584( + obj, + sel, + ); + } + + late final __objc_msgSend_584Ptr = _lookup< + ffi.NativeFunction< + ffi.Int64 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_584 = __objc_msgSend_584Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setTotalUnitCount_1 = _registerName1("setTotalUnitCount:"); + void _objc_msgSend_585( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_585( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_585Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int64)>>('objc_msgSend'); + late final __objc_msgSend_585 = __objc_msgSend_585Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_completedUnitCount1 = _registerName1("completedUnitCount"); + late final _sel_setCompletedUnitCount_1 = + _registerName1("setCompletedUnitCount:"); + late final _sel_localizedDescription1 = + _registerName1("localizedDescription"); + late final _sel_setLocalizedDescription_1 = + _registerName1("setLocalizedDescription:"); + late final _sel_localizedAdditionalDescription1 = + _registerName1("localizedAdditionalDescription"); + late final _sel_setLocalizedAdditionalDescription_1 = + _registerName1("setLocalizedAdditionalDescription:"); + late final _sel_isCancellable1 = _registerName1("isCancellable"); + late final _sel_setCancellable_1 = _registerName1("setCancellable:"); + late final _sel_isPausable1 = _registerName1("isPausable"); + late final _sel_setPausable_1 = _registerName1("setPausable:"); + late final _sel_isPaused1 = _registerName1("isPaused"); + late final _sel_cancellationHandler1 = _registerName1("cancellationHandler"); + ffi.Pointer<_ObjCBlock> _objc_msgSend_586( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_586( + obj, + sel, + ); + } + + late final __objc_msgSend_586Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_586 = __objc_msgSend_586Ptr.asFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setCancellationHandler_1 = + _registerName1("setCancellationHandler:"); + void _objc_msgSend_587( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> value, + ) { + return __objc_msgSend_587( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_587Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_587 = __objc_msgSend_587Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_pausingHandler1 = _registerName1("pausingHandler"); + late final _sel_setPausingHandler_1 = _registerName1("setPausingHandler:"); + late final _sel_resumingHandler1 = _registerName1("resumingHandler"); + late final _sel_setResumingHandler_1 = _registerName1("setResumingHandler:"); + late final _sel_setUserInfoObject_forKey_1 = + _registerName1("setUserInfoObject:forKey:"); + late final _sel_isIndeterminate1 = _registerName1("isIndeterminate"); + late final _sel_fractionCompleted1 = _registerName1("fractionCompleted"); + late final _sel_pause1 = _registerName1("pause"); + late final _sel_resume1 = _registerName1("resume"); + late final _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1 = + _registerName1( + "registerDataRepresentationForTypeIdentifier:visibility:loadHandler:"); + void _objc_msgSend_588( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + int visibility, + ffi.Pointer<_ObjCBlock> loadHandler, + ) { + return __objc_msgSend_588( + obj, + sel, + typeIdentifier, + visibility, + loadHandler, + ); + } + + late final __objc_msgSend_588Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_588 = __objc_msgSend_588Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1 = + _registerName1( + "registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:"); + void _objc_msgSend_589( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + int fileOptions, + int visibility, + ffi.Pointer<_ObjCBlock> loadHandler, + ) { + return __objc_msgSend_589( + obj, + sel, + typeIdentifier, + fileOptions, + visibility, + loadHandler, + ); + } + + late final __objc_msgSend_589Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_589 = __objc_msgSend_589Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_registeredTypeIdentifiers1 = + _registerName1("registeredTypeIdentifiers"); + late final _sel_registeredTypeIdentifiersWithFileOptions_1 = + _registerName1("registeredTypeIdentifiersWithFileOptions:"); + ffi.Pointer _objc_msgSend_590( + ffi.Pointer obj, + ffi.Pointer sel, + int fileOptions, + ) { + return __objc_msgSend_590( + obj, + sel, + fileOptions, + ); + } + + late final __objc_msgSend_590Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_590 = __objc_msgSend_590Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_hasItemConformingToTypeIdentifier_1 = + _registerName1("hasItemConformingToTypeIdentifier:"); + late final _sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1 = + _registerName1( + "hasRepresentationConformingToTypeIdentifier:fileOptions:"); + bool _objc_msgSend_591( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + int fileOptions, + ) { + return __objc_msgSend_591( + obj, + sel, + typeIdentifier, + fileOptions, + ); + } + + late final __objc_msgSend_591Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_591 = __objc_msgSend_591Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_loadDataRepresentationForTypeIdentifier_completionHandler_1 = + _registerName1( + "loadDataRepresentationForTypeIdentifier:completionHandler:"); + ffi.Pointer _objc_msgSend_592( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_592( + obj, + sel, + typeIdentifier, + completionHandler, + ); + } + + late final __objc_msgSend_592Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_592 = __objc_msgSend_592Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_loadFileRepresentationForTypeIdentifier_completionHandler_1 = + _registerName1( + "loadFileRepresentationForTypeIdentifier:completionHandler:"); + ffi.Pointer _objc_msgSend_593( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_593( + obj, + sel, + typeIdentifier, + completionHandler, + ); + } + + late final __objc_msgSend_593Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_593 = __objc_msgSend_593Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1 = + _registerName1( + "loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:"); + ffi.Pointer _objc_msgSend_594( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_594( + obj, + sel, + typeIdentifier, + completionHandler, + ); + } + + late final __objc_msgSend_594Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_594 = __objc_msgSend_594Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_suggestedName1 = _registerName1("suggestedName"); + late final _sel_setSuggestedName_1 = _registerName1("setSuggestedName:"); + late final _sel_registerObject_visibility_1 = + _registerName1("registerObject:visibility:"); + void _objc_msgSend_595( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer object, + int visibility, + ) { + return __objc_msgSend_595( + obj, + sel, + object, + visibility, + ); + } + + late final __objc_msgSend_595Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_595 = __objc_msgSend_595Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_registerObjectOfClass_visibility_loadHandler_1 = + _registerName1("registerObjectOfClass:visibility:loadHandler:"); + void _objc_msgSend_596( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + int visibility, + ffi.Pointer<_ObjCBlock> loadHandler, + ) { + return __objc_msgSend_596( + obj, + sel, + aClass, + visibility, + loadHandler, + ); + } + + late final __objc_msgSend_596Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_596 = __objc_msgSend_596Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_canLoadObjectOfClass_1 = + _registerName1("canLoadObjectOfClass:"); + late final _sel_loadObjectOfClass_completionHandler_1 = + _registerName1("loadObjectOfClass:completionHandler:"); + ffi.Pointer _objc_msgSend_597( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_597( + obj, + sel, + aClass, + completionHandler, + ); + } + + late final __objc_msgSend_597Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_597 = __objc_msgSend_597Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_initWithItem_typeIdentifier_1 = + _registerName1("initWithItem:typeIdentifier:"); + late final _sel_registerItemForTypeIdentifier_loadHandler_1 = + _registerName1("registerItemForTypeIdentifier:loadHandler:"); + void _objc_msgSend_598( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + NSItemProviderLoadHandler loadHandler, + ) { + return __objc_msgSend_598( + obj, + sel, + typeIdentifier, + loadHandler, + ); + } + + late final __objc_msgSend_598Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderLoadHandler)>>('objc_msgSend'); + late final __objc_msgSend_598 = __objc_msgSend_598Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSItemProviderLoadHandler)>(); + + late final _sel_loadItemForTypeIdentifier_options_completionHandler_1 = + _registerName1("loadItemForTypeIdentifier:options:completionHandler:"); + void _objc_msgSend_599( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer options, + NSItemProviderCompletionHandler completionHandler, + ) { + return __objc_msgSend_599( + obj, + sel, + typeIdentifier, + options, + completionHandler, + ); + } + + late final __objc_msgSend_599Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler)>>('objc_msgSend'); + late final __objc_msgSend_599 = __objc_msgSend_599Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler)>(); + + late final _sel_previewImageHandler1 = _registerName1("previewImageHandler"); + NSItemProviderLoadHandler _objc_msgSend_600( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_600( + obj, + sel, + ); + } + + late final __objc_msgSend_600Ptr = _lookup< + ffi.NativeFunction< + NSItemProviderLoadHandler Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_600 = __objc_msgSend_600Ptr.asFunction< + NSItemProviderLoadHandler Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setPreviewImageHandler_1 = + _registerName1("setPreviewImageHandler:"); + void _objc_msgSend_601( + ffi.Pointer obj, + ffi.Pointer sel, + NSItemProviderLoadHandler value, + ) { + return __objc_msgSend_601( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_601Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSItemProviderLoadHandler)>>('objc_msgSend'); + late final __objc_msgSend_601 = __objc_msgSend_601Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + NSItemProviderLoadHandler)>(); + + late final _sel_loadPreviewImageWithOptions_completionHandler_1 = + _registerName1("loadPreviewImageWithOptions:completionHandler:"); + void _objc_msgSend_602( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer options, + NSItemProviderCompletionHandler completionHandler, + ) { + return __objc_msgSend_602( + obj, + sel, + options, + completionHandler, + ); + } + + late final __objc_msgSend_602Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler)>>('objc_msgSend'); + late final __objc_msgSend_602 = __objc_msgSend_602Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSItemProviderCompletionHandler)>(); + + late final _class_NSMutableString1 = _getClass1("NSMutableString"); + late final _sel_replaceCharactersInRange_withString_1 = + _registerName1("replaceCharactersInRange:withString:"); + void _objc_msgSend_603( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer aString, + ) { + return __objc_msgSend_603( + obj, + sel, + range, + aString, + ); + } + + late final __objc_msgSend_603Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_603 = __objc_msgSend_603Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, + ffi.Pointer)>(); + + late final _sel_insertString_atIndex_1 = + _registerName1("insertString:atIndex:"); + void _objc_msgSend_604( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aString, + int loc, + ) { + return __objc_msgSend_604( + obj, + sel, + aString, + loc, + ); + } + + late final __objc_msgSend_604Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_604 = __objc_msgSend_604Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_deleteCharactersInRange_1 = + _registerName1("deleteCharactersInRange:"); + late final _sel_appendString_1 = _registerName1("appendString:"); + late final _sel_appendFormat_1 = _registerName1("appendFormat:"); + late final _sel_setString_1 = _registerName1("setString:"); + late final _sel_replaceOccurrencesOfString_withString_options_range_1 = + _registerName1("replaceOccurrencesOfString:withString:options:range:"); + int _objc_msgSend_605( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer target, + ffi.Pointer replacement, + int options, + NSRange searchRange, + ) { + return __objc_msgSend_605( + obj, + sel, + target, + replacement, + options, + searchRange, + ); + } + + late final __objc_msgSend_605Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_605 = __objc_msgSend_605Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, NSRange)>(); + + late final _sel_applyTransform_reverse_range_updatedRange_1 = + _registerName1("applyTransform:reverse:range:updatedRange:"); + bool _objc_msgSend_606( + ffi.Pointer obj, + ffi.Pointer sel, + NSStringTransform transform, + bool reverse, + NSRange range, + NSRangePointer resultingRange, + ) { + return __objc_msgSend_606( + obj, + sel, + transform, + reverse, + range, + resultingRange, + ); + } + + late final __objc_msgSend_606Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + NSStringTransform, + ffi.Bool, + NSRange, + NSRangePointer)>>('objc_msgSend'); + late final __objc_msgSend_606 = __objc_msgSend_606Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + NSStringTransform, bool, NSRange, NSRangePointer)>(); + + ffi.Pointer _objc_msgSend_607( + ffi.Pointer obj, + ffi.Pointer sel, + int capacity, + ) { + return __objc_msgSend_607( + obj, + sel, + capacity, + ); + } + + late final __objc_msgSend_607Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_607 = __objc_msgSend_607Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_stringWithCapacity_1 = _registerName1("stringWithCapacity:"); + late final _class_NSNotification1 = _getClass1("NSNotification"); + late final _sel_object1 = _registerName1("object"); + late final _sel_initWithName_object_userInfo_1 = + _registerName1("initWithName:object:userInfo:"); + instancetype _objc_msgSend_608( + ffi.Pointer obj, + ffi.Pointer sel, + NSNotificationName name, + ffi.Pointer object, + ffi.Pointer userInfo, + ) { + return __objc_msgSend_608( + obj, + sel, + name, + object, + userInfo, + ); + } + + late final __objc_msgSend_608Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + NSNotificationName, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_608 = __objc_msgSend_608Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + NSNotificationName, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_notificationWithName_object_1 = + _registerName1("notificationWithName:object:"); + late final _sel_notificationWithName_object_userInfo_1 = + _registerName1("notificationWithName:object:userInfo:"); + late final _class_NSBundle1 = _getClass1("NSBundle"); + late final _sel_mainBundle1 = _registerName1("mainBundle"); + ffi.Pointer _objc_msgSend_609( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_609( + obj, + sel, + ); + } + + late final __objc_msgSend_609Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_609 = __objc_msgSend_609Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_bundleWithPath_1 = _registerName1("bundleWithPath:"); + late final _sel_initWithPath_1 = _registerName1("initWithPath:"); + late final _sel_bundleWithURL_1 = _registerName1("bundleWithURL:"); + late final _sel_initWithURL_1 = _registerName1("initWithURL:"); + late final _sel_bundleForClass_1 = _registerName1("bundleForClass:"); + ffi.Pointer _objc_msgSend_610( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ) { + return __objc_msgSend_610( + obj, + sel, + aClass, + ); + } + + late final __objc_msgSend_610Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_610 = __objc_msgSend_610Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_bundleWithIdentifier_1 = + _registerName1("bundleWithIdentifier:"); + ffi.Pointer _objc_msgSend_611( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer identifier, + ) { + return __objc_msgSend_611( + obj, + sel, + identifier, + ); + } + + late final __objc_msgSend_611Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_611 = __objc_msgSend_611Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_allBundles1 = _registerName1("allBundles"); + late final _sel_allFrameworks1 = _registerName1("allFrameworks"); + late final _sel_isLoaded1 = _registerName1("isLoaded"); + late final _sel_unload1 = _registerName1("unload"); + late final _sel_preflightAndReturnError_1 = + _registerName1("preflightAndReturnError:"); + late final _sel_loadAndReturnError_1 = _registerName1("loadAndReturnError:"); + late final _sel_bundleURL1 = _registerName1("bundleURL"); + late final _sel_resourceURL1 = _registerName1("resourceURL"); + late final _sel_executableURL1 = _registerName1("executableURL"); + late final _sel_URLForAuxiliaryExecutable_1 = + _registerName1("URLForAuxiliaryExecutable:"); + late final _sel_privateFrameworksURL1 = + _registerName1("privateFrameworksURL"); + late final _sel_sharedFrameworksURL1 = _registerName1("sharedFrameworksURL"); + late final _sel_sharedSupportURL1 = _registerName1("sharedSupportURL"); + late final _sel_builtInPlugInsURL1 = _registerName1("builtInPlugInsURL"); + late final _sel_appStoreReceiptURL1 = _registerName1("appStoreReceiptURL"); + late final _sel_bundlePath1 = _registerName1("bundlePath"); + late final _sel_resourcePath1 = _registerName1("resourcePath"); + late final _sel_executablePath1 = _registerName1("executablePath"); + late final _sel_pathForAuxiliaryExecutable_1 = + _registerName1("pathForAuxiliaryExecutable:"); + late final _sel_privateFrameworksPath1 = + _registerName1("privateFrameworksPath"); + late final _sel_sharedFrameworksPath1 = + _registerName1("sharedFrameworksPath"); + late final _sel_sharedSupportPath1 = _registerName1("sharedSupportPath"); + late final _sel_builtInPlugInsPath1 = _registerName1("builtInPlugInsPath"); + late final _sel_URLForResource_withExtension_subdirectory_inBundleWithURL_1 = + _registerName1( + "URLForResource:withExtension:subdirectory:inBundleWithURL:"); + ffi.Pointer _objc_msgSend_612( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer ext, + ffi.Pointer subpath, + ffi.Pointer bundleURL, + ) { + return __objc_msgSend_612( + obj, + sel, + name, + ext, + subpath, + bundleURL, + ); + } + + late final __objc_msgSend_612Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_612 = __objc_msgSend_612Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLsForResourcesWithExtension_subdirectory_inBundleWithURL_1 = + _registerName1( + "URLsForResourcesWithExtension:subdirectory:inBundleWithURL:"); + ffi.Pointer _objc_msgSend_613( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer ext, + ffi.Pointer subpath, + ffi.Pointer bundleURL, + ) { + return __objc_msgSend_613( + obj, + sel, + ext, + subpath, + bundleURL, + ); + } + + late final __objc_msgSend_613Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_613 = __objc_msgSend_613Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLForResource_withExtension_1 = + _registerName1("URLForResource:withExtension:"); + ffi.Pointer _objc_msgSend_614( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer ext, + ) { + return __objc_msgSend_614( + obj, + sel, + name, + ext, + ); + } + + late final __objc_msgSend_614Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_614 = __objc_msgSend_614Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLForResource_withExtension_subdirectory_1 = + _registerName1("URLForResource:withExtension:subdirectory:"); + ffi.Pointer _objc_msgSend_615( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer ext, + ffi.Pointer subpath, + ) { + return __objc_msgSend_615( + obj, + sel, + name, + ext, + subpath, + ); + } + + late final __objc_msgSend_615Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_615 = __objc_msgSend_615Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLForResource_withExtension_subdirectory_localization_1 = + _registerName1("URLForResource:withExtension:subdirectory:localization:"); + ffi.Pointer _objc_msgSend_616( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer ext, + ffi.Pointer subpath, + ffi.Pointer localizationName, + ) { + return __objc_msgSend_616( + obj, + sel, + name, + ext, + subpath, + localizationName, + ); + } + + late final __objc_msgSend_616Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_616 = __objc_msgSend_616Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLsForResourcesWithExtension_subdirectory_1 = + _registerName1("URLsForResourcesWithExtension:subdirectory:"); + ffi.Pointer _objc_msgSend_617( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer ext, + ffi.Pointer subpath, + ) { + return __objc_msgSend_617( + obj, + sel, + ext, + subpath, + ); + } + + late final __objc_msgSend_617Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_617 = __objc_msgSend_617Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLsForResourcesWithExtension_subdirectory_localization_1 = + _registerName1( + "URLsForResourcesWithExtension:subdirectory:localization:"); + ffi.Pointer _objc_msgSend_618( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer ext, + ffi.Pointer subpath, + ffi.Pointer localizationName, + ) { + return __objc_msgSend_618( + obj, + sel, + ext, + subpath, + localizationName, + ); + } + + late final __objc_msgSend_618Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_618 = __objc_msgSend_618Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_pathForResource_ofType_inDirectory_1 = + _registerName1("pathForResource:ofType:inDirectory:"); + ffi.Pointer _objc_msgSend_619( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer ext, + ffi.Pointer bundlePath, + ) { + return __objc_msgSend_619( + obj, + sel, + name, + ext, + bundlePath, + ); + } + + late final __objc_msgSend_619Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_619 = __objc_msgSend_619Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_pathsForResourcesOfType_inDirectory_1 = + _registerName1("pathsForResourcesOfType:inDirectory:"); + late final _sel_pathForResource_ofType_1 = + _registerName1("pathForResource:ofType:"); + late final _sel_pathForResource_ofType_inDirectory_forLocalization_1 = + _registerName1("pathForResource:ofType:inDirectory:forLocalization:"); + ffi.Pointer _objc_msgSend_620( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer ext, + ffi.Pointer subpath, + ffi.Pointer localizationName, + ) { + return __objc_msgSend_620( + obj, + sel, + name, + ext, + subpath, + localizationName, + ); + } + + late final __objc_msgSend_620Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_620 = __objc_msgSend_620Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_pathsForResourcesOfType_inDirectory_forLocalization_1 = + _registerName1("pathsForResourcesOfType:inDirectory:forLocalization:"); + late final _sel_localizedStringForKey_value_table_1 = + _registerName1("localizedStringForKey:value:table:"); + late final _class_NSAttributedString1 = _getClass1("NSAttributedString"); + late final _sel_attributesAtIndex_effectiveRange_1 = + _registerName1("attributesAtIndex:effectiveRange:"); + ffi.Pointer _objc_msgSend_621( + ffi.Pointer obj, + ffi.Pointer sel, + int location, + NSRangePointer range, + ) { + return __objc_msgSend_621( + obj, + sel, + location, + range, + ); + } + + late final __objc_msgSend_621Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSRangePointer)>>('objc_msgSend'); + late final __objc_msgSend_621 = __objc_msgSend_621Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, NSRangePointer)>(); + + late final _sel_attribute_atIndex_effectiveRange_1 = + _registerName1("attribute:atIndex:effectiveRange:"); + ffi.Pointer _objc_msgSend_622( + ffi.Pointer obj, + ffi.Pointer sel, + NSAttributedStringKey attrName, + int location, + NSRangePointer range, + ) { + return __objc_msgSend_622( + obj, + sel, + attrName, + location, + range, + ); + } + + late final __objc_msgSend_622Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSAttributedStringKey, + NSUInteger, + NSRangePointer)>>('objc_msgSend'); + late final __objc_msgSend_622 = __objc_msgSend_622Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSAttributedStringKey, int, NSRangePointer)>(); + + late final _sel_attributedSubstringFromRange_1 = + _registerName1("attributedSubstringFromRange:"); + ffi.Pointer _objc_msgSend_623( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_623( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_623Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_623 = __objc_msgSend_623Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_attributesAtIndex_longestEffectiveRange_inRange_1 = + _registerName1("attributesAtIndex:longestEffectiveRange:inRange:"); + ffi.Pointer _objc_msgSend_624( + ffi.Pointer obj, + ffi.Pointer sel, + int location, + NSRangePointer range, + NSRange rangeLimit, + ) { + return __objc_msgSend_624( + obj, + sel, + location, + range, + rangeLimit, + ); + } + + late final __objc_msgSend_624Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSRangePointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_624 = __objc_msgSend_624Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, NSRangePointer, NSRange)>(); + + late final _sel_attribute_atIndex_longestEffectiveRange_inRange_1 = + _registerName1("attribute:atIndex:longestEffectiveRange:inRange:"); + ffi.Pointer _objc_msgSend_625( + ffi.Pointer obj, + ffi.Pointer sel, + NSAttributedStringKey attrName, + int location, + NSRangePointer range, + NSRange rangeLimit, + ) { + return __objc_msgSend_625( + obj, + sel, + attrName, + location, + range, + rangeLimit, + ); + } + + late final __objc_msgSend_625Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSAttributedStringKey, + NSUInteger, + NSRangePointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_625 = __objc_msgSend_625Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSAttributedStringKey, + int, + NSRangePointer, + NSRange)>(); + + late final _sel_isEqualToAttributedString_1 = + _registerName1("isEqualToAttributedString:"); + bool _objc_msgSend_626( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_626( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_626Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_626 = __objc_msgSend_626Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithString_attributes_1 = + _registerName1("initWithString:attributes:"); + late final _sel_initWithAttributedString_1 = + _registerName1("initWithAttributedString:"); + instancetype _objc_msgSend_627( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attrStr, + ) { + return __objc_msgSend_627( + obj, + sel, + attrStr, + ); + } + + late final __objc_msgSend_627Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_627 = __objc_msgSend_627Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_enumerateAttributesInRange_options_usingBlock_1 = + _registerName1("enumerateAttributesInRange:options:usingBlock:"); + void _objc_msgSend_628( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange enumerationRange, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_628( + obj, + sel, + enumerationRange, + opts, + block, + ); + } + + late final __objc_msgSend_628Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_628 = __objc_msgSend_628Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateAttribute_inRange_options_usingBlock_1 = + _registerName1("enumerateAttribute:inRange:options:usingBlock:"); + void _objc_msgSend_629( + ffi.Pointer obj, + ffi.Pointer sel, + NSAttributedStringKey attrName, + NSRange enumerationRange, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_629( + obj, + sel, + attrName, + enumerationRange, + opts, + block, + ); + } + + late final __objc_msgSend_629Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSAttributedStringKey, + NSRange, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_629 = __objc_msgSend_629Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + NSAttributedStringKey, NSRange, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _class_NSAttributedStringMarkdownParsingOptions1 = + _getClass1("NSAttributedStringMarkdownParsingOptions"); + late final _sel_allowsExtendedAttributes1 = + _registerName1("allowsExtendedAttributes"); + late final _sel_setAllowsExtendedAttributes_1 = + _registerName1("setAllowsExtendedAttributes:"); + late final _sel_interpretedSyntax1 = _registerName1("interpretedSyntax"); + int _objc_msgSend_630( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_630( + obj, + sel, + ); + } + + late final __objc_msgSend_630Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_630 = __objc_msgSend_630Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setInterpretedSyntax_1 = + _registerName1("setInterpretedSyntax:"); + void _objc_msgSend_631( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_631( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_631Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_631 = __objc_msgSend_631Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_failurePolicy1 = _registerName1("failurePolicy"); + int _objc_msgSend_632( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_632( + obj, + sel, + ); + } + + late final __objc_msgSend_632Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_632 = __objc_msgSend_632Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setFailurePolicy_1 = _registerName1("setFailurePolicy:"); + void _objc_msgSend_633( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_633( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_633Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_633 = __objc_msgSend_633Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_setLanguageCode_1 = _registerName1("setLanguageCode:"); + late final _sel_initWithContentsOfMarkdownFileAtURL_options_baseURL_error_1 = + _registerName1( + "initWithContentsOfMarkdownFileAtURL:options:baseURL:error:"); + instancetype _objc_msgSend_634( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer markdownFile, + ffi.Pointer options, + ffi.Pointer baseURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_634( + obj, + sel, + markdownFile, + options, + baseURL, + error, + ); + } + + late final __objc_msgSend_634Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_634 = __objc_msgSend_634Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_initWithMarkdown_options_baseURL_error_1 = + _registerName1("initWithMarkdown:options:baseURL:error:"); + instancetype _objc_msgSend_635( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer markdown, + ffi.Pointer options, + ffi.Pointer baseURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_635( + obj, + sel, + markdown, + options, + baseURL, + error, + ); + } + + late final __objc_msgSend_635Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_635 = __objc_msgSend_635Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_initWithMarkdownString_options_baseURL_error_1 = + _registerName1("initWithMarkdownString:options:baseURL:error:"); + instancetype _objc_msgSend_636( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer markdownString, + ffi.Pointer options, + ffi.Pointer baseURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_636( + obj, + sel, + markdownString, + options, + baseURL, + error, + ); + } + + late final __objc_msgSend_636Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_636 = __objc_msgSend_636Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_initWithFormat_options_locale_1 = + _registerName1("initWithFormat:options:locale:"); + instancetype _objc_msgSend_637( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + int options, + ffi.Pointer locale, + ) { + return __objc_msgSend_637( + obj, + sel, + format, + options, + locale, + ); + } + + late final __objc_msgSend_637Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_637 = __objc_msgSend_637Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_initWithFormat_options_locale_arguments_1 = + _registerName1("initWithFormat:options:locale:arguments:"); + instancetype _objc_msgSend_638( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + int options, + ffi.Pointer locale, + ffi.Pointer<__va_list_tag> arguments, + ) { + return __objc_msgSend_638( + obj, + sel, + format, + options, + locale, + arguments, + ); + } + + late final __objc_msgSend_638Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); + late final __objc_msgSend_638 = __objc_msgSend_638Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>(); + + late final _sel_localizedAttributedStringWithFormat_1 = + _registerName1("localizedAttributedStringWithFormat:"); + late final _sel_localizedAttributedStringWithFormat_options_1 = + _registerName1("localizedAttributedStringWithFormat:options:"); + instancetype _objc_msgSend_639( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + int options, + ) { + return __objc_msgSend_639( + obj, + sel, + format, + options, + ); + } + + late final __objc_msgSend_639Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_639 = __objc_msgSend_639Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_attributedStringByInflectingString1 = + _registerName1("attributedStringByInflectingString"); + ffi.Pointer _objc_msgSend_640( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_640( + obj, + sel, + ); + } + + late final __objc_msgSend_640Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_640 = __objc_msgSend_640Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_localizedAttributedStringForKey_value_table_1 = + _registerName1("localizedAttributedStringForKey:value:table:"); + ffi.Pointer _objc_msgSend_641( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ffi.Pointer value, + ffi.Pointer tableName, + ) { + return __objc_msgSend_641( + obj, + sel, + key, + value, + tableName, + ); + } + + late final __objc_msgSend_641Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_641 = __objc_msgSend_641Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_bundleIdentifier1 = _registerName1("bundleIdentifier"); + late final _sel_infoDictionary1 = _registerName1("infoDictionary"); + late final _sel_localizedInfoDictionary1 = + _registerName1("localizedInfoDictionary"); + late final _sel_objectForInfoDictionaryKey_1 = + _registerName1("objectForInfoDictionaryKey:"); + late final _sel_classNamed_1 = _registerName1("classNamed:"); + late final _sel_principalClass1 = _registerName1("principalClass"); + late final _sel_preferredLocalizations1 = + _registerName1("preferredLocalizations"); + late final _sel_localizations1 = _registerName1("localizations"); + late final _sel_developmentLocalization1 = + _registerName1("developmentLocalization"); + late final _sel_preferredLocalizationsFromArray_1 = + _registerName1("preferredLocalizationsFromArray:"); + late final _sel_preferredLocalizationsFromArray_forPreferences_1 = + _registerName1("preferredLocalizationsFromArray:forPreferences:"); + ffi.Pointer _objc_msgSend_642( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer localizationsArray, + ffi.Pointer preferencesArray, + ) { + return __objc_msgSend_642( + obj, + sel, + localizationsArray, + preferencesArray, + ); + } + + late final __objc_msgSend_642Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_642 = __objc_msgSend_642Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_executableArchitectures1 = + _registerName1("executableArchitectures"); + late final _sel_setPreservationPriority_forTags_1 = + _registerName1("setPreservationPriority:forTags:"); + void _objc_msgSend_643( + ffi.Pointer obj, + ffi.Pointer sel, + double priority, + ffi.Pointer tags, + ) { + return __objc_msgSend_643( + obj, + sel, + priority, + tags, + ); + } + + late final __objc_msgSend_643Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Double, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_643 = __objc_msgSend_643Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double, + ffi.Pointer)>(); + + late final _sel_preservationPriorityForTag_1 = + _registerName1("preservationPriorityForTag:"); + late final _class_NSMutableAttributedString1 = + _getClass1("NSMutableAttributedString"); + late final _sel_setAttributes_range_1 = + _registerName1("setAttributes:range:"); + void _objc_msgSend_644( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attrs, + NSRange range, + ) { + return __objc_msgSend_644( + obj, + sel, + attrs, + range, + ); + } + + late final __objc_msgSend_644Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_644 = __objc_msgSend_644Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>(); + + late final _sel_mutableString1 = _registerName1("mutableString"); + ffi.Pointer _objc_msgSend_645( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_645( + obj, + sel, + ); + } + + late final __objc_msgSend_645Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_645 = __objc_msgSend_645Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_addAttribute_value_range_1 = + _registerName1("addAttribute:value:range:"); + void _objc_msgSend_646( + ffi.Pointer obj, + ffi.Pointer sel, + NSAttributedStringKey name, + ffi.Pointer value, + NSRange range, + ) { + return __objc_msgSend_646( + obj, + sel, + name, + value, + range, + ); + } + + late final __objc_msgSend_646Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSAttributedStringKey, + ffi.Pointer, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_646 = __objc_msgSend_646Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + NSAttributedStringKey, ffi.Pointer, NSRange)>(); + + late final _sel_addAttributes_range_1 = + _registerName1("addAttributes:range:"); + late final _sel_removeAttribute_range_1 = + _registerName1("removeAttribute:range:"); + void _objc_msgSend_647( + ffi.Pointer obj, + ffi.Pointer sel, + NSAttributedStringKey name, + NSRange range, + ) { + return __objc_msgSend_647( + obj, + sel, + name, + range, + ); + } + + late final __objc_msgSend_647Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSAttributedStringKey, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_647 = __objc_msgSend_647Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + NSAttributedStringKey, NSRange)>(); + + late final _sel_replaceCharactersInRange_withAttributedString_1 = + _registerName1("replaceCharactersInRange:withAttributedString:"); + void _objc_msgSend_648( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer attrString, + ) { + return __objc_msgSend_648( + obj, + sel, + range, + attrString, + ); + } + + late final __objc_msgSend_648Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSRange, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_648 = __objc_msgSend_648Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, NSRange, + ffi.Pointer)>(); + + late final _sel_insertAttributedString_atIndex_1 = + _registerName1("insertAttributedString:atIndex:"); + void _objc_msgSend_649( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attrString, + int loc, + ) { + return __objc_msgSend_649( + obj, + sel, + attrString, + loc, + ); + } + + late final __objc_msgSend_649Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_649 = __objc_msgSend_649Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_appendAttributedString_1 = + _registerName1("appendAttributedString:"); + void _objc_msgSend_650( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attrString, + ) { + return __objc_msgSend_650( + obj, + sel, + attrString, + ); + } + + late final __objc_msgSend_650Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_650 = __objc_msgSend_650Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setAttributedString_1 = + _registerName1("setAttributedString:"); + late final _sel_beginEditing1 = _registerName1("beginEditing"); + late final _sel_endEditing1 = _registerName1("endEditing"); + late final _sel_appendLocalizedFormat_1 = + _registerName1("appendLocalizedFormat:"); + late final _class_NSDateFormatter1 = _getClass1("NSDateFormatter"); + late final _class_NSFormatter1 = _getClass1("NSFormatter"); + late final _sel_stringForObjectValue_1 = + _registerName1("stringForObjectValue:"); + late final _sel_attributedStringForObjectValue_withDefaultAttributes_1 = + _registerName1("attributedStringForObjectValue:withDefaultAttributes:"); + ffi.Pointer _objc_msgSend_651( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer obj1, + ffi.Pointer attrs, + ) { + return __objc_msgSend_651( + obj, + sel, + obj1, + attrs, + ); + } + + late final __objc_msgSend_651Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_651 = __objc_msgSend_651Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_editingStringForObjectValue_1 = + _registerName1("editingStringForObjectValue:"); + late final _sel_getObjectValue_forString_errorDescription_1 = + _registerName1("getObjectValue:forString:errorDescription:"); + bool _objc_msgSend_652( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> obj1, + ffi.Pointer string, + ffi.Pointer> error, + ) { + return __objc_msgSend_652( + obj, + sel, + obj1, + string, + error, + ); + } + + late final __objc_msgSend_652Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_652 = __objc_msgSend_652Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_isPartialStringValid_newEditingString_errorDescription_1 = + _registerName1("isPartialStringValid:newEditingString:errorDescription:"); + bool _objc_msgSend_653( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer partialString, + ffi.Pointer> newString, + ffi.Pointer> error, + ) { + return __objc_msgSend_653( + obj, + sel, + partialString, + newString, + error, + ); + } + + late final __objc_msgSend_653Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_653 = __objc_msgSend_653Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_isPartialStringValid_proposedSelectedRange_originalString_originalSelectedRange_errorDescription_1 = + _registerName1( + "isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:"); + bool _objc_msgSend_654( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> partialStringPtr, + NSRangePointer proposedSelRangePtr, + ffi.Pointer origString, + NSRange origSelRange, + ffi.Pointer> error, + ) { + return __objc_msgSend_654( + obj, + sel, + partialStringPtr, + proposedSelRangePtr, + origString, + origSelRange, + error, + ); + } + + late final __objc_msgSend_654Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSRangePointer, + ffi.Pointer, + NSRange, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_654 = __objc_msgSend_654Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSRangePointer, + ffi.Pointer, + NSRange, + ffi.Pointer>)>(); + + late final _sel_formattingContext1 = _registerName1("formattingContext"); + int _objc_msgSend_655( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_655( + obj, + sel, + ); + } + + late final __objc_msgSend_655Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_655 = __objc_msgSend_655Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setFormattingContext_1 = + _registerName1("setFormattingContext:"); + void _objc_msgSend_656( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_656( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_656Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_656 = __objc_msgSend_656Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_getObjectValue_forString_range_error_1 = + _registerName1("getObjectValue:forString:range:error:"); + bool _objc_msgSend_657( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> obj1, + ffi.Pointer string, + ffi.Pointer rangep, + ffi.Pointer> error, + ) { + return __objc_msgSend_657( + obj, + sel, + obj1, + string, + rangep, + error, + ); + } + + late final __objc_msgSend_657Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_657 = __objc_msgSend_657Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_stringFromDate_1 = _registerName1("stringFromDate:"); + late final _sel_dateFromString_1 = _registerName1("dateFromString:"); + late final _sel_localizedStringFromDate_dateStyle_timeStyle_1 = + _registerName1("localizedStringFromDate:dateStyle:timeStyle:"); + ffi.Pointer _objc_msgSend_658( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + int dstyle, + int tstyle, + ) { + return __objc_msgSend_658( + obj, + sel, + date, + dstyle, + tstyle, + ); + } + + late final __objc_msgSend_658Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_658 = __objc_msgSend_658Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, int)>(); + + late final _sel_dateFormatFromTemplate_options_locale_1 = + _registerName1("dateFormatFromTemplate:options:locale:"); + ffi.Pointer _objc_msgSend_659( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer tmplate, + int opts, + ffi.Pointer locale, + ) { + return __objc_msgSend_659( + obj, + sel, + tmplate, + opts, + locale, + ); + } + + late final __objc_msgSend_659Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_659 = __objc_msgSend_659Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final _sel_defaultFormatterBehavior1 = + _registerName1("defaultFormatterBehavior"); + int _objc_msgSend_660( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_660( + obj, + sel, + ); + } + + late final __objc_msgSend_660Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_660 = __objc_msgSend_660Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setDefaultFormatterBehavior_1 = + _registerName1("setDefaultFormatterBehavior:"); + void _objc_msgSend_661( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_661( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_661Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_661 = __objc_msgSend_661Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_setLocalizedDateFormatFromTemplate_1 = + _registerName1("setLocalizedDateFormatFromTemplate:"); + late final _sel_dateFormat1 = _registerName1("dateFormat"); + late final _sel_setDateFormat_1 = _registerName1("setDateFormat:"); + late final _sel_dateStyle1 = _registerName1("dateStyle"); + int _objc_msgSend_662( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_662( + obj, + sel, + ); + } + + late final __objc_msgSend_662Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_662 = __objc_msgSend_662Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setDateStyle_1 = _registerName1("setDateStyle:"); + void _objc_msgSend_663( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_663( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_663Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_663 = __objc_msgSend_663Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_timeStyle1 = _registerName1("timeStyle"); + late final _sel_setTimeStyle_1 = _registerName1("setTimeStyle:"); + late final _sel_locale1 = _registerName1("locale"); + late final _sel_setLocale_1 = _registerName1("setLocale:"); + void _objc_msgSend_664( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_664( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_664Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_664 = __objc_msgSend_664Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_generatesCalendarDates1 = + _registerName1("generatesCalendarDates"); + late final _sel_setGeneratesCalendarDates_1 = + _registerName1("setGeneratesCalendarDates:"); + late final _sel_formatterBehavior1 = _registerName1("formatterBehavior"); + late final _sel_setFormatterBehavior_1 = + _registerName1("setFormatterBehavior:"); + late final _class_NSCalendar1 = _getClass1("NSCalendar"); + late final _sel_currentCalendar1 = _registerName1("currentCalendar"); + ffi.Pointer _objc_msgSend_665( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_665( + obj, + sel, + ); + } + + late final __objc_msgSend_665Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_665 = __objc_msgSend_665Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_autoupdatingCurrentCalendar1 = + _registerName1("autoupdatingCurrentCalendar"); + late final _sel_calendarWithIdentifier_1 = + _registerName1("calendarWithIdentifier:"); + ffi.Pointer _objc_msgSend_666( + ffi.Pointer obj, + ffi.Pointer sel, + NSCalendarIdentifier calendarIdentifierConstant, + ) { + return __objc_msgSend_666( + obj, + sel, + calendarIdentifierConstant, + ); + } + + late final __objc_msgSend_666Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSCalendarIdentifier)>>('objc_msgSend'); + late final __objc_msgSend_666 = __objc_msgSend_666Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSCalendarIdentifier)>(); + + late final _sel_initWithCalendarIdentifier_1 = + _registerName1("initWithCalendarIdentifier:"); + late final _sel_firstWeekday1 = _registerName1("firstWeekday"); + late final _sel_setFirstWeekday_1 = _registerName1("setFirstWeekday:"); + late final _sel_minimumDaysInFirstWeek1 = + _registerName1("minimumDaysInFirstWeek"); + late final _sel_setMinimumDaysInFirstWeek_1 = + _registerName1("setMinimumDaysInFirstWeek:"); + late final _sel_eraSymbols1 = _registerName1("eraSymbols"); + late final _sel_longEraSymbols1 = _registerName1("longEraSymbols"); + late final _sel_monthSymbols1 = _registerName1("monthSymbols"); + late final _sel_shortMonthSymbols1 = _registerName1("shortMonthSymbols"); + late final _sel_veryShortMonthSymbols1 = + _registerName1("veryShortMonthSymbols"); + late final _sel_standaloneMonthSymbols1 = + _registerName1("standaloneMonthSymbols"); + late final _sel_shortStandaloneMonthSymbols1 = + _registerName1("shortStandaloneMonthSymbols"); + late final _sel_veryShortStandaloneMonthSymbols1 = + _registerName1("veryShortStandaloneMonthSymbols"); + late final _sel_weekdaySymbols1 = _registerName1("weekdaySymbols"); + late final _sel_shortWeekdaySymbols1 = _registerName1("shortWeekdaySymbols"); + late final _sel_veryShortWeekdaySymbols1 = + _registerName1("veryShortWeekdaySymbols"); + late final _sel_standaloneWeekdaySymbols1 = + _registerName1("standaloneWeekdaySymbols"); + late final _sel_shortStandaloneWeekdaySymbols1 = + _registerName1("shortStandaloneWeekdaySymbols"); + late final _sel_veryShortStandaloneWeekdaySymbols1 = + _registerName1("veryShortStandaloneWeekdaySymbols"); + late final _sel_quarterSymbols1 = _registerName1("quarterSymbols"); + late final _sel_shortQuarterSymbols1 = _registerName1("shortQuarterSymbols"); + late final _sel_standaloneQuarterSymbols1 = + _registerName1("standaloneQuarterSymbols"); + late final _sel_shortStandaloneQuarterSymbols1 = + _registerName1("shortStandaloneQuarterSymbols"); + late final _sel_AMSymbol1 = _registerName1("AMSymbol"); + late final _sel_PMSymbol1 = _registerName1("PMSymbol"); + late final _sel_minimumRangeOfUnit_1 = _registerName1("minimumRangeOfUnit:"); + NSRange _objc_msgSend_667( + ffi.Pointer obj, + ffi.Pointer sel, + int unit, + ) { + return __objc_msgSend_667( + obj, + sel, + unit, + ); + } + + late final __objc_msgSend_667Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_667 = __objc_msgSend_667Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_maximumRangeOfUnit_1 = _registerName1("maximumRangeOfUnit:"); + late final _sel_rangeOfUnit_inUnit_forDate_1 = + _registerName1("rangeOfUnit:inUnit:forDate:"); + NSRange _objc_msgSend_668( + ffi.Pointer obj, + ffi.Pointer sel, + int smaller, + int larger, + ffi.Pointer date, + ) { + return __objc_msgSend_668( + obj, + sel, + smaller, + larger, + date, + ); + } + + late final __objc_msgSend_668Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_668 = __objc_msgSend_668Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, int, int, + ffi.Pointer)>(); + + late final _sel_ordinalityOfUnit_inUnit_forDate_1 = + _registerName1("ordinalityOfUnit:inUnit:forDate:"); + int _objc_msgSend_669( + ffi.Pointer obj, + ffi.Pointer sel, + int smaller, + int larger, + ffi.Pointer date, + ) { + return __objc_msgSend_669( + obj, + sel, + smaller, + larger, + date, + ); + } + + late final __objc_msgSend_669Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_669 = __objc_msgSend_669Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, int, + ffi.Pointer)>(); + + late final _sel_rangeOfUnit_startDate_interval_forDate_1 = + _registerName1("rangeOfUnit:startDate:interval:forDate:"); + bool _objc_msgSend_670( + ffi.Pointer obj, + ffi.Pointer sel, + int unit, + ffi.Pointer> datep, + ffi.Pointer tip, + ffi.Pointer date, + ) { + return __objc_msgSend_670( + obj, + sel, + unit, + datep, + tip, + date, + ); + } + + late final __objc_msgSend_670Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_670 = __objc_msgSend_670Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSDateComponents1 = _getClass1("NSDateComponents"); + late final _sel_calendar1 = _registerName1("calendar"); + late final _sel_setCalendar_1 = _registerName1("setCalendar:"); + void _objc_msgSend_671( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_671( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_671Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_671 = __objc_msgSend_671Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_era1 = _registerName1("era"); + late final _sel_setEra_1 = _registerName1("setEra:"); + late final _sel_year1 = _registerName1("year"); + late final _sel_setYear_1 = _registerName1("setYear:"); + late final _sel_month1 = _registerName1("month"); + late final _sel_setMonth_1 = _registerName1("setMonth:"); + late final _sel_day1 = _registerName1("day"); + late final _sel_setDay_1 = _registerName1("setDay:"); + late final _sel_hour1 = _registerName1("hour"); + late final _sel_setHour_1 = _registerName1("setHour:"); + late final _sel_minute1 = _registerName1("minute"); + late final _sel_setMinute_1 = _registerName1("setMinute:"); + late final _sel_second1 = _registerName1("second"); + late final _sel_setSecond_1 = _registerName1("setSecond:"); + late final _sel_nanosecond1 = _registerName1("nanosecond"); + late final _sel_setNanosecond_1 = _registerName1("setNanosecond:"); + late final _sel_weekday1 = _registerName1("weekday"); + late final _sel_setWeekday_1 = _registerName1("setWeekday:"); + late final _sel_weekdayOrdinal1 = _registerName1("weekdayOrdinal"); + late final _sel_setWeekdayOrdinal_1 = _registerName1("setWeekdayOrdinal:"); + late final _sel_quarter1 = _registerName1("quarter"); + late final _sel_setQuarter_1 = _registerName1("setQuarter:"); + late final _sel_weekOfMonth1 = _registerName1("weekOfMonth"); + late final _sel_setWeekOfMonth_1 = _registerName1("setWeekOfMonth:"); + late final _sel_weekOfYear1 = _registerName1("weekOfYear"); + late final _sel_setWeekOfYear_1 = _registerName1("setWeekOfYear:"); + late final _sel_yearForWeekOfYear1 = _registerName1("yearForWeekOfYear"); + late final _sel_setYearForWeekOfYear_1 = + _registerName1("setYearForWeekOfYear:"); + late final _sel_isLeapMonth1 = _registerName1("isLeapMonth"); + late final _sel_setLeapMonth_1 = _registerName1("setLeapMonth:"); + late final _sel_week1 = _registerName1("week"); + late final _sel_setWeek_1 = _registerName1("setWeek:"); + late final _sel_setValue_forComponent_1 = + _registerName1("setValue:forComponent:"); + void _objc_msgSend_672( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + int unit, + ) { + return __objc_msgSend_672( + obj, + sel, + value, + unit, + ); + } + + late final __objc_msgSend_672Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSInteger, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_672 = __objc_msgSend_672Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, int)>(); + + late final _sel_valueForComponent_1 = _registerName1("valueForComponent:"); + int _objc_msgSend_673( + ffi.Pointer obj, + ffi.Pointer sel, + int unit, + ) { + return __objc_msgSend_673( + obj, + sel, + unit, + ); + } + + late final __objc_msgSend_673Ptr = _lookup< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_673 = __objc_msgSend_673Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_isValidDate1 = _registerName1("isValidDate"); + late final _sel_isValidDateInCalendar_1 = + _registerName1("isValidDateInCalendar:"); + bool _objc_msgSend_674( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer calendar, + ) { + return __objc_msgSend_674( + obj, + sel, + calendar, + ); + } + + late final __objc_msgSend_674Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_674 = __objc_msgSend_674Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_dateFromComponents_1 = _registerName1("dateFromComponents:"); + ffi.Pointer _objc_msgSend_675( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer comps, + ) { + return __objc_msgSend_675( + obj, + sel, + comps, + ); + } + + late final __objc_msgSend_675Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_675 = __objc_msgSend_675Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_components_fromDate_1 = + _registerName1("components:fromDate:"); + ffi.Pointer _objc_msgSend_676( + ffi.Pointer obj, + ffi.Pointer sel, + int unitFlags, + ffi.Pointer date, + ) { + return __objc_msgSend_676( + obj, + sel, + unitFlags, + date, + ); + } + + late final __objc_msgSend_676Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_676 = __objc_msgSend_676Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_dateByAddingComponents_toDate_options_1 = + _registerName1("dateByAddingComponents:toDate:options:"); + ffi.Pointer _objc_msgSend_677( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer comps, + ffi.Pointer date, + int opts, + ) { + return __objc_msgSend_677( + obj, + sel, + comps, + date, + opts, + ); + } + + late final __objc_msgSend_677Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_677 = __objc_msgSend_677Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_components_fromDate_toDate_options_1 = + _registerName1("components:fromDate:toDate:options:"); + ffi.Pointer _objc_msgSend_678( + ffi.Pointer obj, + ffi.Pointer sel, + int unitFlags, + ffi.Pointer startingDate, + ffi.Pointer resultDate, + int opts, + ) { + return __objc_msgSend_678( + obj, + sel, + unitFlags, + startingDate, + resultDate, + opts, + ); + } + + late final __objc_msgSend_678Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_678 = __objc_msgSend_678Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_getEra_year_month_day_fromDate_1 = + _registerName1("getEra:year:month:day:fromDate:"); + void _objc_msgSend_679( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer eraValuePointer, + ffi.Pointer yearValuePointer, + ffi.Pointer monthValuePointer, + ffi.Pointer dayValuePointer, + ffi.Pointer date, + ) { + return __objc_msgSend_679( + obj, + sel, + eraValuePointer, + yearValuePointer, + monthValuePointer, + dayValuePointer, + date, + ); + } + + late final __objc_msgSend_679Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_679 = __objc_msgSend_679Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_getEra_yearForWeekOfYear_weekOfYear_weekday_fromDate_1 = + _registerName1("getEra:yearForWeekOfYear:weekOfYear:weekday:fromDate:"); + late final _sel_getHour_minute_second_nanosecond_fromDate_1 = + _registerName1("getHour:minute:second:nanosecond:fromDate:"); + late final _sel_component_fromDate_1 = _registerName1("component:fromDate:"); + int _objc_msgSend_680( + ffi.Pointer obj, + ffi.Pointer sel, + int unit, + ffi.Pointer date, + ) { + return __objc_msgSend_680( + obj, + sel, + unit, + date, + ); + } + + late final __objc_msgSend_680Ptr = _lookup< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_680 = __objc_msgSend_680Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_dateWithEra_year_month_day_hour_minute_second_nanosecond_1 = + _registerName1( + "dateWithEra:year:month:day:hour:minute:second:nanosecond:"); + ffi.Pointer _objc_msgSend_681( + ffi.Pointer obj, + ffi.Pointer sel, + int eraValue, + int yearValue, + int monthValue, + int dayValue, + int hourValue, + int minuteValue, + int secondValue, + int nanosecondValue, + ) { + return __objc_msgSend_681( + obj, + sel, + eraValue, + yearValue, + monthValue, + dayValue, + hourValue, + minuteValue, + secondValue, + nanosecondValue, + ); + } + + late final __objc_msgSend_681Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + NSInteger, + NSInteger, + NSInteger, + NSInteger, + NSInteger, + NSInteger, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_681 = __objc_msgSend_681Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, int, int, int, int, int, int, int)>(); + + late final _sel_dateWithEra_yearForWeekOfYear_weekOfYear_weekday_hour_minute_second_nanosecond_1 = + _registerName1( + "dateWithEra:yearForWeekOfYear:weekOfYear:weekday:hour:minute:second:nanosecond:"); + late final _sel_startOfDayForDate_1 = _registerName1("startOfDayForDate:"); + late final _sel_componentsInTimeZone_fromDate_1 = + _registerName1("componentsInTimeZone:fromDate:"); + ffi.Pointer _objc_msgSend_682( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer timezone, + ffi.Pointer date, + ) { + return __objc_msgSend_682( + obj, + sel, + timezone, + date, + ); + } + + late final __objc_msgSend_682Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_682 = __objc_msgSend_682Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_compareDate_toDate_toUnitGranularity_1 = + _registerName1("compareDate:toDate:toUnitGranularity:"); + int _objc_msgSend_683( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date1, + ffi.Pointer date2, + int unit, + ) { + return __objc_msgSend_683( + obj, + sel, + date1, + date2, + unit, + ); + } + + late final __objc_msgSend_683Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_683 = __objc_msgSend_683Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_isDate_equalToDate_toUnitGranularity_1 = + _registerName1("isDate:equalToDate:toUnitGranularity:"); + bool _objc_msgSend_684( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date1, + ffi.Pointer date2, + int unit, + ) { + return __objc_msgSend_684( + obj, + sel, + date1, + date2, + unit, + ); + } + + late final __objc_msgSend_684Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_684 = __objc_msgSend_684Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_isDate_inSameDayAsDate_1 = + _registerName1("isDate:inSameDayAsDate:"); + bool _objc_msgSend_685( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date1, + ffi.Pointer date2, + ) { + return __objc_msgSend_685( + obj, + sel, + date1, + date2, + ); + } + + late final __objc_msgSend_685Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_685 = __objc_msgSend_685Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isDateInToday_1 = _registerName1("isDateInToday:"); + late final _sel_isDateInYesterday_1 = _registerName1("isDateInYesterday:"); + late final _sel_isDateInTomorrow_1 = _registerName1("isDateInTomorrow:"); + late final _sel_isDateInWeekend_1 = _registerName1("isDateInWeekend:"); + late final _sel_rangeOfWeekendStartDate_interval_containingDate_1 = + _registerName1("rangeOfWeekendStartDate:interval:containingDate:"); + bool _objc_msgSend_686( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> datep, + ffi.Pointer tip, + ffi.Pointer date, + ) { + return __objc_msgSend_686( + obj, + sel, + datep, + tip, + date, + ); + } + + late final __objc_msgSend_686Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_686 = __objc_msgSend_686Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_nextWeekendStartDate_interval_options_afterDate_1 = + _registerName1("nextWeekendStartDate:interval:options:afterDate:"); + bool _objc_msgSend_687( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> datep, + ffi.Pointer tip, + int options, + ffi.Pointer date, + ) { + return __objc_msgSend_687( + obj, + sel, + datep, + tip, + options, + date, + ); + } + + late final __objc_msgSend_687Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_687 = __objc_msgSend_687Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final _sel_components_fromDateComponents_toDateComponents_options_1 = + _registerName1("components:fromDateComponents:toDateComponents:options:"); + ffi.Pointer _objc_msgSend_688( + ffi.Pointer obj, + ffi.Pointer sel, + int unitFlags, + ffi.Pointer startingDateComp, + ffi.Pointer resultDateComp, + int options, + ) { + return __objc_msgSend_688( + obj, + sel, + unitFlags, + startingDateComp, + resultDateComp, + options, + ); + } + + late final __objc_msgSend_688Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_688 = __objc_msgSend_688Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_dateByAddingUnit_value_toDate_options_1 = + _registerName1("dateByAddingUnit:value:toDate:options:"); + ffi.Pointer _objc_msgSend_689( + ffi.Pointer obj, + ffi.Pointer sel, + int unit, + int value, + ffi.Pointer date, + int options, + ) { + return __objc_msgSend_689( + obj, + sel, + unit, + value, + date, + options, + ); + } + + late final __objc_msgSend_689Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSInteger, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_689 = __objc_msgSend_689Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer, int)>(); + + late final _sel_enumerateDatesStartingAfterDate_matchingComponents_options_usingBlock_1 = + _registerName1( + "enumerateDatesStartingAfterDate:matchingComponents:options:usingBlock:"); + void _objc_msgSend_690( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer start, + ffi.Pointer comps, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_690( + obj, + sel, + start, + comps, + opts, + block, + ); + } + + late final __objc_msgSend_690Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_690 = __objc_msgSend_690Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_nextDateAfterDate_matchingComponents_options_1 = + _registerName1("nextDateAfterDate:matchingComponents:options:"); + ffi.Pointer _objc_msgSend_691( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + ffi.Pointer comps, + int options, + ) { + return __objc_msgSend_691( + obj, + sel, + date, + comps, + options, + ); + } + + late final __objc_msgSend_691Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_691 = __objc_msgSend_691Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_nextDateAfterDate_matchingUnit_value_options_1 = + _registerName1("nextDateAfterDate:matchingUnit:value:options:"); + ffi.Pointer _objc_msgSend_692( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + int unit, + int value, + int options, + ) { + return __objc_msgSend_692( + obj, + sel, + date, + unit, + value, + options, + ); + } + + late final __objc_msgSend_692Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSInteger, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_692 = __objc_msgSend_692Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, int, int)>(); + + late final _sel_nextDateAfterDate_matchingHour_minute_second_options_1 = + _registerName1("nextDateAfterDate:matchingHour:minute:second:options:"); + ffi.Pointer _objc_msgSend_693( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + int hourValue, + int minuteValue, + int secondValue, + int options, + ) { + return __objc_msgSend_693( + obj, + sel, + date, + hourValue, + minuteValue, + secondValue, + options, + ); + } + + late final __objc_msgSend_693Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + NSInteger, + NSInteger, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_693 = __objc_msgSend_693Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, int, int, int)>(); + + late final _sel_dateBySettingUnit_value_ofDate_options_1 = + _registerName1("dateBySettingUnit:value:ofDate:options:"); + late final _sel_dateBySettingHour_minute_second_ofDate_options_1 = + _registerName1("dateBySettingHour:minute:second:ofDate:options:"); + ffi.Pointer _objc_msgSend_694( + ffi.Pointer obj, + ffi.Pointer sel, + int h, + int m, + int s, + ffi.Pointer date, + int opts, + ) { + return __objc_msgSend_694( + obj, + sel, + h, + m, + s, + date, + opts, + ); + } + + late final __objc_msgSend_694Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + NSInteger, + NSInteger, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_694 = __objc_msgSend_694Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, int, int, ffi.Pointer, int)>(); + + late final _sel_date_matchesComponents_1 = + _registerName1("date:matchesComponents:"); + bool _objc_msgSend_695( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + ffi.Pointer components, + ) { + return __objc_msgSend_695( + obj, + sel, + date, + components, + ); + } + + late final __objc_msgSend_695Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_695 = __objc_msgSend_695Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isLenient1 = _registerName1("isLenient"); + late final _sel_setLenient_1 = _registerName1("setLenient:"); + late final _sel_twoDigitStartDate1 = _registerName1("twoDigitStartDate"); + late final _sel_setTwoDigitStartDate_1 = + _registerName1("setTwoDigitStartDate:"); + late final _sel_defaultDate1 = _registerName1("defaultDate"); + late final _sel_setDefaultDate_1 = _registerName1("setDefaultDate:"); + late final _sel_setEraSymbols_1 = _registerName1("setEraSymbols:"); + void _objc_msgSend_696( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_696( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_696Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_696 = __objc_msgSend_696Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setMonthSymbols_1 = _registerName1("setMonthSymbols:"); + late final _sel_setShortMonthSymbols_1 = + _registerName1("setShortMonthSymbols:"); + late final _sel_setWeekdaySymbols_1 = _registerName1("setWeekdaySymbols:"); + late final _sel_setShortWeekdaySymbols_1 = + _registerName1("setShortWeekdaySymbols:"); + late final _sel_setAMSymbol_1 = _registerName1("setAMSymbol:"); + late final _sel_setPMSymbol_1 = _registerName1("setPMSymbol:"); + late final _sel_setLongEraSymbols_1 = _registerName1("setLongEraSymbols:"); + late final _sel_setVeryShortMonthSymbols_1 = + _registerName1("setVeryShortMonthSymbols:"); + late final _sel_setStandaloneMonthSymbols_1 = + _registerName1("setStandaloneMonthSymbols:"); + late final _sel_setShortStandaloneMonthSymbols_1 = + _registerName1("setShortStandaloneMonthSymbols:"); + late final _sel_setVeryShortStandaloneMonthSymbols_1 = + _registerName1("setVeryShortStandaloneMonthSymbols:"); + late final _sel_setVeryShortWeekdaySymbols_1 = + _registerName1("setVeryShortWeekdaySymbols:"); + late final _sel_setStandaloneWeekdaySymbols_1 = + _registerName1("setStandaloneWeekdaySymbols:"); + late final _sel_setShortStandaloneWeekdaySymbols_1 = + _registerName1("setShortStandaloneWeekdaySymbols:"); + late final _sel_setVeryShortStandaloneWeekdaySymbols_1 = + _registerName1("setVeryShortStandaloneWeekdaySymbols:"); + late final _sel_setQuarterSymbols_1 = _registerName1("setQuarterSymbols:"); + late final _sel_setShortQuarterSymbols_1 = + _registerName1("setShortQuarterSymbols:"); + late final _sel_setStandaloneQuarterSymbols_1 = + _registerName1("setStandaloneQuarterSymbols:"); + late final _sel_setShortStandaloneQuarterSymbols_1 = + _registerName1("setShortStandaloneQuarterSymbols:"); + late final _sel_gregorianStartDate1 = _registerName1("gregorianStartDate"); + late final _sel_setGregorianStartDate_1 = + _registerName1("setGregorianStartDate:"); + late final _sel_doesRelativeDateFormatting1 = + _registerName1("doesRelativeDateFormatting"); + late final _sel_setDoesRelativeDateFormatting_1 = + _registerName1("setDoesRelativeDateFormatting:"); + late final _sel_initWithDateFormat_allowNaturalLanguage_1 = + _registerName1("initWithDateFormat:allowNaturalLanguage:"); + late final _sel_allowsNaturalLanguage1 = + _registerName1("allowsNaturalLanguage"); + late final _class_NSNumberFormatter1 = _getClass1("NSNumberFormatter"); + late final _sel_stringFromNumber_1 = _registerName1("stringFromNumber:"); + ffi.Pointer _objc_msgSend_697( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer number, + ) { + return __objc_msgSend_697( + obj, + sel, + number, + ); + } + + late final __objc_msgSend_697Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_697 = __objc_msgSend_697Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_numberFromString_1 = _registerName1("numberFromString:"); + ffi.Pointer _objc_msgSend_698( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + ) { + return __objc_msgSend_698( + obj, + sel, + string, + ); + } + + late final __objc_msgSend_698Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_698 = __objc_msgSend_698Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_localizedStringFromNumber_numberStyle_1 = + _registerName1("localizedStringFromNumber:numberStyle:"); + ffi.Pointer _objc_msgSend_699( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer num, + int nstyle, + ) { + return __objc_msgSend_699( + obj, + sel, + num, + nstyle, + ); + } + + late final __objc_msgSend_699Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_699 = __objc_msgSend_699Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + int _objc_msgSend_700( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_700( + obj, + sel, + ); + } + + late final __objc_msgSend_700Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_700 = __objc_msgSend_700Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_701( + ffi.Pointer obj, + ffi.Pointer sel, + int behavior, + ) { + return __objc_msgSend_701( + obj, + sel, + behavior, + ); + } + + late final __objc_msgSend_701Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_701 = __objc_msgSend_701Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_numberStyle1 = _registerName1("numberStyle"); + int _objc_msgSend_702( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_702( + obj, + sel, + ); + } + + late final __objc_msgSend_702Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_702 = __objc_msgSend_702Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setNumberStyle_1 = _registerName1("setNumberStyle:"); + void _objc_msgSend_703( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_703( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_703Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_703 = __objc_msgSend_703Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_generatesDecimalNumbers1 = + _registerName1("generatesDecimalNumbers"); + late final _sel_setGeneratesDecimalNumbers_1 = + _registerName1("setGeneratesDecimalNumbers:"); + void _objc_msgSend_704( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_704( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_704Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_704 = __objc_msgSend_704Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_negativeFormat1 = _registerName1("negativeFormat"); + late final _sel_setNegativeFormat_1 = _registerName1("setNegativeFormat:"); + late final _sel_textAttributesForNegativeValues1 = + _registerName1("textAttributesForNegativeValues"); + late final _sel_setTextAttributesForNegativeValues_1 = + _registerName1("setTextAttributesForNegativeValues:"); + late final _sel_positiveFormat1 = _registerName1("positiveFormat"); + late final _sel_setPositiveFormat_1 = _registerName1("setPositiveFormat:"); + late final _sel_textAttributesForPositiveValues1 = + _registerName1("textAttributesForPositiveValues"); + late final _sel_setTextAttributesForPositiveValues_1 = + _registerName1("setTextAttributesForPositiveValues:"); + late final _sel_allowsFloats1 = _registerName1("allowsFloats"); + late final _sel_setAllowsFloats_1 = _registerName1("setAllowsFloats:"); + late final _sel_setDecimalSeparator_1 = + _registerName1("setDecimalSeparator:"); + late final _sel_alwaysShowsDecimalSeparator1 = + _registerName1("alwaysShowsDecimalSeparator"); + late final _sel_setAlwaysShowsDecimalSeparator_1 = + _registerName1("setAlwaysShowsDecimalSeparator:"); + late final _sel_currencyDecimalSeparator1 = + _registerName1("currencyDecimalSeparator"); + late final _sel_setCurrencyDecimalSeparator_1 = + _registerName1("setCurrencyDecimalSeparator:"); + late final _sel_usesGroupingSeparator1 = + _registerName1("usesGroupingSeparator"); + late final _sel_setUsesGroupingSeparator_1 = + _registerName1("setUsesGroupingSeparator:"); + late final _sel_setGroupingSeparator_1 = + _registerName1("setGroupingSeparator:"); + late final _sel_zeroSymbol1 = _registerName1("zeroSymbol"); + late final _sel_setZeroSymbol_1 = _registerName1("setZeroSymbol:"); + late final _sel_textAttributesForZero1 = + _registerName1("textAttributesForZero"); + late final _sel_setTextAttributesForZero_1 = + _registerName1("setTextAttributesForZero:"); + late final _sel_nilSymbol1 = _registerName1("nilSymbol"); + late final _sel_setNilSymbol_1 = _registerName1("setNilSymbol:"); + late final _sel_textAttributesForNil1 = + _registerName1("textAttributesForNil"); + late final _sel_setTextAttributesForNil_1 = + _registerName1("setTextAttributesForNil:"); + late final _sel_notANumberSymbol1 = _registerName1("notANumberSymbol"); + late final _sel_setNotANumberSymbol_1 = + _registerName1("setNotANumberSymbol:"); + late final _sel_textAttributesForNotANumber1 = + _registerName1("textAttributesForNotANumber"); + late final _sel_setTextAttributesForNotANumber_1 = + _registerName1("setTextAttributesForNotANumber:"); + late final _sel_positiveInfinitySymbol1 = + _registerName1("positiveInfinitySymbol"); + late final _sel_setPositiveInfinitySymbol_1 = + _registerName1("setPositiveInfinitySymbol:"); + late final _sel_textAttributesForPositiveInfinity1 = + _registerName1("textAttributesForPositiveInfinity"); + late final _sel_setTextAttributesForPositiveInfinity_1 = + _registerName1("setTextAttributesForPositiveInfinity:"); + late final _sel_negativeInfinitySymbol1 = + _registerName1("negativeInfinitySymbol"); + late final _sel_setNegativeInfinitySymbol_1 = + _registerName1("setNegativeInfinitySymbol:"); + late final _sel_textAttributesForNegativeInfinity1 = + _registerName1("textAttributesForNegativeInfinity"); + late final _sel_setTextAttributesForNegativeInfinity_1 = + _registerName1("setTextAttributesForNegativeInfinity:"); + late final _sel_positivePrefix1 = _registerName1("positivePrefix"); + late final _sel_setPositivePrefix_1 = _registerName1("setPositivePrefix:"); + late final _sel_positiveSuffix1 = _registerName1("positiveSuffix"); + late final _sel_setPositiveSuffix_1 = _registerName1("setPositiveSuffix:"); + late final _sel_negativePrefix1 = _registerName1("negativePrefix"); + late final _sel_setNegativePrefix_1 = _registerName1("setNegativePrefix:"); + late final _sel_negativeSuffix1 = _registerName1("negativeSuffix"); + late final _sel_setNegativeSuffix_1 = _registerName1("setNegativeSuffix:"); + late final _sel_setCurrencyCode_1 = _registerName1("setCurrencyCode:"); + late final _sel_setCurrencySymbol_1 = _registerName1("setCurrencySymbol:"); + late final _sel_internationalCurrencySymbol1 = + _registerName1("internationalCurrencySymbol"); + late final _sel_setInternationalCurrencySymbol_1 = + _registerName1("setInternationalCurrencySymbol:"); + late final _sel_percentSymbol1 = _registerName1("percentSymbol"); + late final _sel_setPercentSymbol_1 = _registerName1("setPercentSymbol:"); + late final _sel_perMillSymbol1 = _registerName1("perMillSymbol"); + late final _sel_setPerMillSymbol_1 = _registerName1("setPerMillSymbol:"); + late final _sel_minusSign1 = _registerName1("minusSign"); + late final _sel_setMinusSign_1 = _registerName1("setMinusSign:"); + late final _sel_plusSign1 = _registerName1("plusSign"); + late final _sel_setPlusSign_1 = _registerName1("setPlusSign:"); + late final _sel_exponentSymbol1 = _registerName1("exponentSymbol"); + late final _sel_setExponentSymbol_1 = _registerName1("setExponentSymbol:"); + late final _sel_groupingSize1 = _registerName1("groupingSize"); + late final _sel_setGroupingSize_1 = _registerName1("setGroupingSize:"); + late final _sel_secondaryGroupingSize1 = + _registerName1("secondaryGroupingSize"); + late final _sel_setSecondaryGroupingSize_1 = + _registerName1("setSecondaryGroupingSize:"); + late final _sel_multiplier1 = _registerName1("multiplier"); + late final _sel_setMultiplier_1 = _registerName1("setMultiplier:"); + void _objc_msgSend_705( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_705( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_705Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_705 = __objc_msgSend_705Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_formatWidth1 = _registerName1("formatWidth"); + late final _sel_setFormatWidth_1 = _registerName1("setFormatWidth:"); + late final _sel_paddingCharacter1 = _registerName1("paddingCharacter"); + late final _sel_setPaddingCharacter_1 = + _registerName1("setPaddingCharacter:"); + late final _sel_paddingPosition1 = _registerName1("paddingPosition"); + int _objc_msgSend_706( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_706( + obj, + sel, + ); + } + + late final __objc_msgSend_706Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_706 = __objc_msgSend_706Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setPaddingPosition_1 = _registerName1("setPaddingPosition:"); + void _objc_msgSend_707( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_707( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_707Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_707 = __objc_msgSend_707Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_roundingMode1 = _registerName1("roundingMode"); + int _objc_msgSend_708( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_708( + obj, + sel, + ); + } + + late final __objc_msgSend_708Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_708 = __objc_msgSend_708Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setRoundingMode_1 = _registerName1("setRoundingMode:"); + void _objc_msgSend_709( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_709( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_709Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_709 = __objc_msgSend_709Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_roundingIncrement1 = _registerName1("roundingIncrement"); + late final _sel_setRoundingIncrement_1 = + _registerName1("setRoundingIncrement:"); + late final _sel_minimumIntegerDigits1 = + _registerName1("minimumIntegerDigits"); + late final _sel_setMinimumIntegerDigits_1 = + _registerName1("setMinimumIntegerDigits:"); + late final _sel_maximumIntegerDigits1 = + _registerName1("maximumIntegerDigits"); + late final _sel_setMaximumIntegerDigits_1 = + _registerName1("setMaximumIntegerDigits:"); + late final _sel_minimumFractionDigits1 = + _registerName1("minimumFractionDigits"); + late final _sel_setMinimumFractionDigits_1 = + _registerName1("setMinimumFractionDigits:"); + late final _sel_maximumFractionDigits1 = + _registerName1("maximumFractionDigits"); + late final _sel_setMaximumFractionDigits_1 = + _registerName1("setMaximumFractionDigits:"); + late final _sel_minimum1 = _registerName1("minimum"); + late final _sel_setMinimum_1 = _registerName1("setMinimum:"); + late final _sel_maximum1 = _registerName1("maximum"); + late final _sel_setMaximum_1 = _registerName1("setMaximum:"); + late final _sel_currencyGroupingSeparator1 = + _registerName1("currencyGroupingSeparator"); + late final _sel_setCurrencyGroupingSeparator_1 = + _registerName1("setCurrencyGroupingSeparator:"); + late final _sel_usesSignificantDigits1 = + _registerName1("usesSignificantDigits"); + late final _sel_setUsesSignificantDigits_1 = + _registerName1("setUsesSignificantDigits:"); + late final _sel_minimumSignificantDigits1 = + _registerName1("minimumSignificantDigits"); + late final _sel_setMinimumSignificantDigits_1 = + _registerName1("setMinimumSignificantDigits:"); + late final _sel_maximumSignificantDigits1 = + _registerName1("maximumSignificantDigits"); + late final _sel_setMaximumSignificantDigits_1 = + _registerName1("setMaximumSignificantDigits:"); + late final _sel_isPartialStringValidationEnabled1 = + _registerName1("isPartialStringValidationEnabled"); + late final _sel_setPartialStringValidationEnabled_1 = + _registerName1("setPartialStringValidationEnabled:"); + late final _sel_hasThousandSeparators1 = + _registerName1("hasThousandSeparators"); + late final _sel_setHasThousandSeparators_1 = + _registerName1("setHasThousandSeparators:"); + late final _sel_thousandSeparator1 = _registerName1("thousandSeparator"); + late final _sel_setThousandSeparator_1 = + _registerName1("setThousandSeparator:"); + late final _sel_localizesFormat1 = _registerName1("localizesFormat"); + late final _sel_setLocalizesFormat_1 = _registerName1("setLocalizesFormat:"); + late final _sel_format1 = _registerName1("format"); + late final _sel_setFormat_1 = _registerName1("setFormat:"); + late final _sel_attributedStringForZero1 = + _registerName1("attributedStringForZero"); + late final _sel_setAttributedStringForZero_1 = + _registerName1("setAttributedStringForZero:"); + void _objc_msgSend_710( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_710( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_710Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_710 = __objc_msgSend_710Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_attributedStringForNil1 = + _registerName1("attributedStringForNil"); + late final _sel_setAttributedStringForNil_1 = + _registerName1("setAttributedStringForNil:"); + late final _sel_attributedStringForNotANumber1 = + _registerName1("attributedStringForNotANumber"); + late final _sel_setAttributedStringForNotANumber_1 = + _registerName1("setAttributedStringForNotANumber:"); + late final _class_NSDecimalNumberHandler1 = + _getClass1("NSDecimalNumberHandler"); + late final _sel_defaultDecimalNumberHandler1 = + _registerName1("defaultDecimalNumberHandler"); + ffi.Pointer _objc_msgSend_711( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_711( + obj, + sel, + ); + } + + late final __objc_msgSend_711Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_711 = __objc_msgSend_711Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_1 = + _registerName1( + "initWithRoundingMode:scale:raiseOnExactness:raiseOnOverflow:raiseOnUnderflow:raiseOnDivideByZero:"); + instancetype _objc_msgSend_712( + ffi.Pointer obj, + ffi.Pointer sel, + int roundingMode, + int scale, + bool exact, + bool overflow, + bool underflow, + bool divideByZero, + ) { + return __objc_msgSend_712( + obj, + sel, + roundingMode, + scale, + exact, + overflow, + underflow, + divideByZero, + ); + } + + late final __objc_msgSend_712Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Short, + ffi.Bool, + ffi.Bool, + ffi.Bool, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_712 = __objc_msgSend_712Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + int, bool, bool, bool, bool)>(); + + late final _sel_decimalNumberHandlerWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_1 = + _registerName1( + "decimalNumberHandlerWithRoundingMode:scale:raiseOnExactness:raiseOnOverflow:raiseOnUnderflow:raiseOnDivideByZero:"); + late final _sel_roundingBehavior1 = _registerName1("roundingBehavior"); + late final _sel_setRoundingBehavior_1 = + _registerName1("setRoundingBehavior:"); + void _objc_msgSend_713( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_713( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_713Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_713 = __objc_msgSend_713Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSScanner1 = _getClass1("NSScanner"); + late final _sel_scanLocation1 = _registerName1("scanLocation"); + late final _sel_setScanLocation_1 = _registerName1("setScanLocation:"); + late final _sel_charactersToBeSkipped1 = + _registerName1("charactersToBeSkipped"); + late final _sel_setCharactersToBeSkipped_1 = + _registerName1("setCharactersToBeSkipped:"); + void _objc_msgSend_714( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_714( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_714Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_714 = __objc_msgSend_714Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_caseSensitive1 = _registerName1("caseSensitive"); + late final _sel_setCaseSensitive_1 = _registerName1("setCaseSensitive:"); + late final _sel_scanInt_1 = _registerName1("scanInt:"); + bool _objc_msgSend_715( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ) { + return __objc_msgSend_715( + obj, + sel, + result, + ); + } + + late final __objc_msgSend_715Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_715 = __objc_msgSend_715Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scanInteger_1 = _registerName1("scanInteger:"); + bool _objc_msgSend_716( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ) { + return __objc_msgSend_716( + obj, + sel, + result, + ); + } + + late final __objc_msgSend_716Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_716 = __objc_msgSend_716Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scanLongLong_1 = _registerName1("scanLongLong:"); + bool _objc_msgSend_717( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ) { + return __objc_msgSend_717( + obj, + sel, + result, + ); + } + + late final __objc_msgSend_717Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_717 = __objc_msgSend_717Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scanUnsignedLongLong_1 = + _registerName1("scanUnsignedLongLong:"); + bool _objc_msgSend_718( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ) { + return __objc_msgSend_718( + obj, + sel, + result, + ); + } + + late final __objc_msgSend_718Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_718 = __objc_msgSend_718Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scanFloat_1 = _registerName1("scanFloat:"); + bool _objc_msgSend_719( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ) { + return __objc_msgSend_719( + obj, + sel, + result, + ); + } + + late final __objc_msgSend_719Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_719 = __objc_msgSend_719Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scanDouble_1 = _registerName1("scanDouble:"); + bool _objc_msgSend_720( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ) { + return __objc_msgSend_720( + obj, + sel, + result, + ); + } + + late final __objc_msgSend_720Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_720 = __objc_msgSend_720Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scanHexInt_1 = _registerName1("scanHexInt:"); + bool _objc_msgSend_721( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ) { + return __objc_msgSend_721( + obj, + sel, + result, + ); + } + + late final __objc_msgSend_721Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_721 = __objc_msgSend_721Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scanHexLongLong_1 = _registerName1("scanHexLongLong:"); + late final _sel_scanHexFloat_1 = _registerName1("scanHexFloat:"); + late final _sel_scanHexDouble_1 = _registerName1("scanHexDouble:"); + late final _sel_scanString_intoString_1 = + _registerName1("scanString:intoString:"); + bool _objc_msgSend_722( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + ffi.Pointer> result, + ) { + return __objc_msgSend_722( + obj, + sel, + string, + result, + ); + } + + late final __objc_msgSend_722Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_722 = __objc_msgSend_722Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_scanCharactersFromSet_intoString_1 = + _registerName1("scanCharactersFromSet:intoString:"); + bool _objc_msgSend_723( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer set1, + ffi.Pointer> result, + ) { + return __objc_msgSend_723( + obj, + sel, + set1, + result, + ); + } + + late final __objc_msgSend_723Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_723 = __objc_msgSend_723Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_scanUpToString_intoString_1 = + _registerName1("scanUpToString:intoString:"); + late final _sel_scanUpToCharactersFromSet_intoString_1 = + _registerName1("scanUpToCharactersFromSet:intoString:"); + late final _sel_isAtEnd1 = _registerName1("isAtEnd"); + late final _sel_scannerWithString_1 = _registerName1("scannerWithString:"); + late final _sel_localizedScannerWithString_1 = + _registerName1("localizedScannerWithString:"); + late final _sel_scanDecimal_1 = _registerName1("scanDecimal:"); + bool _objc_msgSend_724( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dcm, + ) { + return __objc_msgSend_724( + obj, + sel, + dcm, + ); + } + + late final __objc_msgSend_724Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_724 = __objc_msgSend_724Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSException1 = _getClass1("NSException"); + late final _sel_exceptionWithName_reason_userInfo_1 = + _registerName1("exceptionWithName:reason:userInfo:"); + ffi.Pointer _objc_msgSend_725( + ffi.Pointer obj, + ffi.Pointer sel, + NSExceptionName name, + ffi.Pointer reason, + ffi.Pointer userInfo, + ) { + return __objc_msgSend_725( + obj, + sel, + name, + reason, + userInfo, + ); + } + + late final __objc_msgSend_725Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSExceptionName, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_725 = __objc_msgSend_725Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSExceptionName, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithName_reason_userInfo_1 = + _registerName1("initWithName:reason:userInfo:"); + late final _sel_reason1 = _registerName1("reason"); + late final _sel_raise1 = _registerName1("raise"); + late final _sel_raise_format_1 = _registerName1("raise:format:"); + late final _sel_raise_format_arguments_1 = + _registerName1("raise:format:arguments:"); + void _objc_msgSend_726( + ffi.Pointer obj, + ffi.Pointer sel, + NSExceptionName name, + ffi.Pointer format, + ffi.Pointer<__va_list_tag> argList, + ) { + return __objc_msgSend_726( + obj, + sel, + name, + format, + argList, + ); + } + + late final __objc_msgSend_726Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSExceptionName, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); + late final __objc_msgSend_726 = __objc_msgSend_726Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + NSExceptionName, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>(); + + late final _class_NSFileHandle1 = _getClass1("NSFileHandle"); + late final _sel_availableData1 = _registerName1("availableData"); + late final _sel_initWithFileDescriptor_closeOnDealloc_1 = + _registerName1("initWithFileDescriptor:closeOnDealloc:"); + instancetype _objc_msgSend_727( + ffi.Pointer obj, + ffi.Pointer sel, + int fd, + bool closeopt, + ) { + return __objc_msgSend_727( + obj, + sel, + fd, + closeopt, + ); + } + + late final __objc_msgSend_727Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Int, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_727 = __objc_msgSend_727Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int, bool)>(); + + late final _sel_readDataToEndOfFileAndReturnError_1 = + _registerName1("readDataToEndOfFileAndReturnError:"); + ffi.Pointer _objc_msgSend_728( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> error, + ) { + return __objc_msgSend_728( + obj, + sel, + error, + ); + } + + late final __objc_msgSend_728Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_728 = __objc_msgSend_728Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_readDataUpToLength_error_1 = + _registerName1("readDataUpToLength:error:"); + ffi.Pointer _objc_msgSend_729( + ffi.Pointer obj, + ffi.Pointer sel, + int length, + ffi.Pointer> error, + ) { + return __objc_msgSend_729( + obj, + sel, + length, + error, + ); + } + + late final __objc_msgSend_729Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_729 = __objc_msgSend_729Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer>)>(); + + late final _sel_writeData_error_1 = _registerName1("writeData:error:"); + bool _objc_msgSend_730( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ffi.Pointer> error, + ) { + return __objc_msgSend_730( + obj, + sel, + data, + error, + ); + } + + late final __objc_msgSend_730Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_730 = __objc_msgSend_730Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_getOffset_error_1 = _registerName1("getOffset:error:"); + bool _objc_msgSend_731( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer offsetInFile, + ffi.Pointer> error, + ) { + return __objc_msgSend_731( + obj, + sel, + offsetInFile, + error, + ); + } + + late final __objc_msgSend_731Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_731 = __objc_msgSend_731Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_seekToEndReturningOffset_error_1 = + _registerName1("seekToEndReturningOffset:error:"); + late final _sel_seekToOffset_error_1 = _registerName1("seekToOffset:error:"); + bool _objc_msgSend_732( + ffi.Pointer obj, + ffi.Pointer sel, + int offset, + ffi.Pointer> error, + ) { + return __objc_msgSend_732( + obj, + sel, + offset, + error, + ); + } + + late final __objc_msgSend_732Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLongLong, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_732 = __objc_msgSend_732Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer>)>(); + + late final _sel_truncateAtOffset_error_1 = + _registerName1("truncateAtOffset:error:"); + late final _sel_synchronizeAndReturnError_1 = + _registerName1("synchronizeAndReturnError:"); + late final _sel_closeAndReturnError_1 = + _registerName1("closeAndReturnError:"); + late final _sel_fileHandleWithStandardInput1 = + _registerName1("fileHandleWithStandardInput"); + ffi.Pointer _objc_msgSend_733( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_733( + obj, + sel, + ); + } + + late final __objc_msgSend_733Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_733 = __objc_msgSend_733Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_fileHandleWithStandardOutput1 = + _registerName1("fileHandleWithStandardOutput"); + late final _sel_fileHandleWithStandardError1 = + _registerName1("fileHandleWithStandardError"); + late final _sel_fileHandleWithNullDevice1 = + _registerName1("fileHandleWithNullDevice"); + late final _sel_fileHandleForReadingAtPath_1 = + _registerName1("fileHandleForReadingAtPath:"); + late final _sel_fileHandleForWritingAtPath_1 = + _registerName1("fileHandleForWritingAtPath:"); + late final _sel_fileHandleForUpdatingAtPath_1 = + _registerName1("fileHandleForUpdatingAtPath:"); + late final _sel_fileHandleForReadingFromURL_error_1 = + _registerName1("fileHandleForReadingFromURL:error:"); + instancetype _objc_msgSend_734( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer> error, + ) { + return __objc_msgSend_734( + obj, + sel, + url, + error, + ); + } + + late final __objc_msgSend_734Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_734 = __objc_msgSend_734Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_fileHandleForWritingToURL_error_1 = + _registerName1("fileHandleForWritingToURL:error:"); + late final _sel_fileHandleForUpdatingURL_error_1 = + _registerName1("fileHandleForUpdatingURL:error:"); + late final _sel_readInBackgroundAndNotifyForModes_1 = + _registerName1("readInBackgroundAndNotifyForModes:"); + late final _sel_readInBackgroundAndNotify1 = + _registerName1("readInBackgroundAndNotify"); + late final _sel_readToEndOfFileInBackgroundAndNotifyForModes_1 = + _registerName1("readToEndOfFileInBackgroundAndNotifyForModes:"); + late final _sel_readToEndOfFileInBackgroundAndNotify1 = + _registerName1("readToEndOfFileInBackgroundAndNotify"); + late final _sel_acceptConnectionInBackgroundAndNotifyForModes_1 = + _registerName1("acceptConnectionInBackgroundAndNotifyForModes:"); + late final _sel_acceptConnectionInBackgroundAndNotify1 = + _registerName1("acceptConnectionInBackgroundAndNotify"); + late final _sel_waitForDataInBackgroundAndNotifyForModes_1 = + _registerName1("waitForDataInBackgroundAndNotifyForModes:"); + late final _sel_waitForDataInBackgroundAndNotify1 = + _registerName1("waitForDataInBackgroundAndNotify"); + late final _sel_readabilityHandler1 = _registerName1("readabilityHandler"); + ffi.Pointer<_ObjCBlock> _objc_msgSend_735( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_735( + obj, + sel, + ); + } + + late final __objc_msgSend_735Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_735 = __objc_msgSend_735Ptr.asFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setReadabilityHandler_1 = + _registerName1("setReadabilityHandler:"); + void _objc_msgSend_736( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> value, + ) { + return __objc_msgSend_736( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_736Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_736 = __objc_msgSend_736Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_writeabilityHandler1 = _registerName1("writeabilityHandler"); + late final _sel_setWriteabilityHandler_1 = + _registerName1("setWriteabilityHandler:"); + late final _sel_initWithFileDescriptor_1 = + _registerName1("initWithFileDescriptor:"); + instancetype _objc_msgSend_737( + ffi.Pointer obj, + ffi.Pointer sel, + int fd, + ) { + return __objc_msgSend_737( + obj, + sel, + fd, + ); + } + + late final __objc_msgSend_737Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Int)>>('objc_msgSend'); + late final __objc_msgSend_737 = __objc_msgSend_737Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_fileDescriptor1 = _registerName1("fileDescriptor"); + late final _sel_readDataToEndOfFile1 = _registerName1("readDataToEndOfFile"); + late final _sel_readDataOfLength_1 = _registerName1("readDataOfLength:"); + late final _sel_offsetInFile1 = _registerName1("offsetInFile"); + late final _sel_seekToEndOfFile1 = _registerName1("seekToEndOfFile"); + late final _sel_seekToFileOffset_1 = _registerName1("seekToFileOffset:"); + void _objc_msgSend_738( + ffi.Pointer obj, + ffi.Pointer sel, + int offset, + ) { + return __objc_msgSend_738( + obj, + sel, + offset, + ); + } + + late final __objc_msgSend_738Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedLongLong)>>('objc_msgSend'); + late final __objc_msgSend_738 = __objc_msgSend_738Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_truncateFileAtOffset_1 = + _registerName1("truncateFileAtOffset:"); + late final _sel_synchronizeFile1 = _registerName1("synchronizeFile"); + late final _sel_closeFile1 = _registerName1("closeFile"); + late final _class_NSHTTPCookieStorage1 = _getClass1("NSHTTPCookieStorage"); + late final _sel_sharedHTTPCookieStorage1 = + _registerName1("sharedHTTPCookieStorage"); + ffi.Pointer _objc_msgSend_739( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_739( + obj, + sel, + ); + } + + late final __objc_msgSend_739Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_739 = __objc_msgSend_739Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_sharedCookieStorageForGroupContainerIdentifier_1 = + _registerName1("sharedCookieStorageForGroupContainerIdentifier:"); + ffi.Pointer _objc_msgSend_740( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer identifier, + ) { + return __objc_msgSend_740( + obj, + sel, + identifier, + ); + } + + late final __objc_msgSend_740Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_740 = __objc_msgSend_740Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_cookies1 = _registerName1("cookies"); + late final _class_NSHTTPCookie1 = _getClass1("NSHTTPCookie"); + late final _sel_initWithProperties_1 = _registerName1("initWithProperties:"); + late final _sel_cookieWithProperties_1 = + _registerName1("cookieWithProperties:"); + ffi.Pointer _objc_msgSend_741( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer properties, + ) { + return __objc_msgSend_741( + obj, + sel, + properties, + ); + } + + late final __objc_msgSend_741Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_741 = __objc_msgSend_741Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_requestHeaderFieldsWithCookies_1 = + _registerName1("requestHeaderFieldsWithCookies:"); + late final _sel_cookiesWithResponseHeaderFields_forURL_1 = + _registerName1("cookiesWithResponseHeaderFields:forURL:"); + ffi.Pointer _objc_msgSend_742( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer headerFields, + ffi.Pointer URL, + ) { + return __objc_msgSend_742( + obj, + sel, + headerFields, + URL, + ); + } + + late final __objc_msgSend_742Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_742 = __objc_msgSend_742Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_properties1 = _registerName1("properties"); + late final _sel_value1 = _registerName1("value"); + late final _sel_expiresDate1 = _registerName1("expiresDate"); + late final _sel_isSessionOnly1 = _registerName1("isSessionOnly"); + late final _sel_isSecure1 = _registerName1("isSecure"); + late final _sel_isHTTPOnly1 = _registerName1("isHTTPOnly"); + late final _sel_comment1 = _registerName1("comment"); + late final _sel_commentURL1 = _registerName1("commentURL"); + late final _sel_portList1 = _registerName1("portList"); + late final _sel_sameSitePolicy1 = _registerName1("sameSitePolicy"); + late final _sel_setCookie_1 = _registerName1("setCookie:"); + void _objc_msgSend_743( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cookie, + ) { + return __objc_msgSend_743( + obj, + sel, + cookie, + ); + } + + late final __objc_msgSend_743Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_743 = __objc_msgSend_743Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_deleteCookie_1 = _registerName1("deleteCookie:"); + late final _sel_removeCookiesSinceDate_1 = + _registerName1("removeCookiesSinceDate:"); + late final _sel_cookiesForURL_1 = _registerName1("cookiesForURL:"); + late final _sel_setCookies_forURL_mainDocumentURL_1 = + _registerName1("setCookies:forURL:mainDocumentURL:"); + void _objc_msgSend_744( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cookies, + ffi.Pointer URL, + ffi.Pointer mainDocumentURL, + ) { + return __objc_msgSend_744( + obj, + sel, + cookies, + URL, + mainDocumentURL, + ); + } + + late final __objc_msgSend_744Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_744 = __objc_msgSend_744Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_cookieAcceptPolicy1 = _registerName1("cookieAcceptPolicy"); + int _objc_msgSend_745( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_745( + obj, + sel, + ); + } + + late final __objc_msgSend_745Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_745 = __objc_msgSend_745Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setCookieAcceptPolicy_1 = + _registerName1("setCookieAcceptPolicy:"); + void _objc_msgSend_746( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_746( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_746Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_746 = __objc_msgSend_746Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_sortedCookiesUsingDescriptors_1 = + _registerName1("sortedCookiesUsingDescriptors:"); + late final _class_NSURLSessionTask1 = _getClass1("NSURLSessionTask"); + late final _sel_taskIdentifier1 = _registerName1("taskIdentifier"); + late final _class_NSURLRequest1 = _getClass1("NSURLRequest"); + late final _sel_requestWithURL_1 = _registerName1("requestWithURL:"); + late final _sel_supportsSecureCoding1 = + _registerName1("supportsSecureCoding"); + late final _sel_requestWithURL_cachePolicy_timeoutInterval_1 = + _registerName1("requestWithURL:cachePolicy:timeoutInterval:"); + instancetype _objc_msgSend_747( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer URL, + int cachePolicy, + double timeoutInterval, + ) { + return __objc_msgSend_747( + obj, + sel, + URL, + cachePolicy, + timeoutInterval, + ); + } + + late final __objc_msgSend_747Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSTimeInterval)>>('objc_msgSend'); + late final __objc_msgSend_747 = __objc_msgSend_747Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, double)>(); + + late final _sel_initWithURL_cachePolicy_timeoutInterval_1 = + _registerName1("initWithURL:cachePolicy:timeoutInterval:"); + late final _sel_URL1 = _registerName1("URL"); + late final _sel_cachePolicy1 = _registerName1("cachePolicy"); + int _objc_msgSend_748( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_748( + obj, + sel, + ); + } + + late final __objc_msgSend_748Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_748 = __objc_msgSend_748Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_timeoutInterval1 = _registerName1("timeoutInterval"); + late final _sel_mainDocumentURL1 = _registerName1("mainDocumentURL"); + late final _sel_networkServiceType1 = _registerName1("networkServiceType"); + int _objc_msgSend_749( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_749( + obj, + sel, + ); + } + + late final __objc_msgSend_749Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_749 = __objc_msgSend_749Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_allowsCellularAccess1 = + _registerName1("allowsCellularAccess"); + late final _sel_allowsExpensiveNetworkAccess1 = + _registerName1("allowsExpensiveNetworkAccess"); + late final _sel_allowsConstrainedNetworkAccess1 = + _registerName1("allowsConstrainedNetworkAccess"); + late final _sel_assumesHTTP3Capable1 = _registerName1("assumesHTTP3Capable"); + late final _sel_attribution1 = _registerName1("attribution"); + int _objc_msgSend_750( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_750( + obj, + sel, + ); + } + + late final __objc_msgSend_750Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_750 = __objc_msgSend_750Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_HTTPMethod1 = _registerName1("HTTPMethod"); + late final _sel_allHTTPHeaderFields1 = _registerName1("allHTTPHeaderFields"); + late final _sel_valueForHTTPHeaderField_1 = + _registerName1("valueForHTTPHeaderField:"); + late final _sel_HTTPBody1 = _registerName1("HTTPBody"); + late final _class_NSInputStream1 = _getClass1("NSInputStream"); + late final _class_NSStream1 = _getClass1("NSStream"); + late final _sel_open1 = _registerName1("open"); + late final _sel_close1 = _registerName1("close"); + late final _sel_streamStatus1 = _registerName1("streamStatus"); + int _objc_msgSend_751( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_751( + obj, + sel, + ); + } + + late final __objc_msgSend_751Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_751 = __objc_msgSend_751Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_streamError1 = _registerName1("streamError"); + late final _class_NSOutputStream1 = _getClass1("NSOutputStream"); + late final _sel_write_maxLength_1 = _registerName1("write:maxLength:"); + int _objc_msgSend_752( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + int len, + ) { + return __objc_msgSend_752( + obj, + sel, + buffer, + len, + ); + } + + late final __objc_msgSend_752Ptr = _lookup< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_752 = __objc_msgSend_752Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_hasSpaceAvailable1 = _registerName1("hasSpaceAvailable"); + late final _sel_initToMemory1 = _registerName1("initToMemory"); + late final _sel_initToBuffer_capacity_1 = + _registerName1("initToBuffer:capacity:"); + instancetype _objc_msgSend_753( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + int capacity, + ) { + return __objc_msgSend_753( + obj, + sel, + buffer, + capacity, + ); + } + + late final __objc_msgSend_753Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_753 = __objc_msgSend_753Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_initWithURL_append_1 = _registerName1("initWithURL:append:"); + late final _sel_initToFileAtPath_append_1 = + _registerName1("initToFileAtPath:append:"); + late final _sel_outputStreamToMemory1 = + _registerName1("outputStreamToMemory"); + late final _sel_outputStreamToBuffer_capacity_1 = + _registerName1("outputStreamToBuffer:capacity:"); + late final _sel_outputStreamToFileAtPath_append_1 = + _registerName1("outputStreamToFileAtPath:append:"); + late final _sel_outputStreamWithURL_append_1 = + _registerName1("outputStreamWithURL:append:"); + late final _sel_getStreamsToHostWithName_port_inputStream_outputStream_1 = + _registerName1("getStreamsToHostWithName:port:inputStream:outputStream:"); + void _objc_msgSend_754( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer hostname, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream, + ) { + return __objc_msgSend_754( + obj, + sel, + hostname, + port, + inputStream, + outputStream, + ); + } + + late final __objc_msgSend_754Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_754 = __objc_msgSend_754Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _class_NSHost1 = _getClass1("NSHost"); + late final _sel_currentHost1 = _registerName1("currentHost"); + late final _sel_hostWithName_1 = _registerName1("hostWithName:"); + late final _sel_hostWithAddress_1 = _registerName1("hostWithAddress:"); + late final _sel_isEqualToHost_1 = _registerName1("isEqualToHost:"); + bool _objc_msgSend_755( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aHost, + ) { + return __objc_msgSend_755( + obj, + sel, + aHost, + ); + } + + late final __objc_msgSend_755Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_755 = __objc_msgSend_755Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_names1 = _registerName1("names"); + late final _sel_address1 = _registerName1("address"); + late final _sel_addresses1 = _registerName1("addresses"); + late final _sel_localizedName1 = _registerName1("localizedName"); + late final _sel_setHostCacheEnabled_1 = + _registerName1("setHostCacheEnabled:"); + void _objc_msgSend_756( + ffi.Pointer obj, + ffi.Pointer sel, + bool flag, + ) { + return __objc_msgSend_756( + obj, + sel, + flag, + ); + } + + late final __objc_msgSend_756Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_756 = __objc_msgSend_756Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_isHostCacheEnabled1 = _registerName1("isHostCacheEnabled"); + late final _sel_flushHostCache1 = _registerName1("flushHostCache"); + late final _sel_getStreamsToHost_port_inputStream_outputStream_1 = + _registerName1("getStreamsToHost:port:inputStream:outputStream:"); + void _objc_msgSend_757( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer host, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream, + ) { + return __objc_msgSend_757( + obj, + sel, + host, + port, + inputStream, + outputStream, + ); + } + + late final __objc_msgSend_757Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_757 = __objc_msgSend_757Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_getBoundStreamsWithBufferSize_inputStream_outputStream_1 = + _registerName1("getBoundStreamsWithBufferSize:inputStream:outputStream:"); + void _objc_msgSend_758( + ffi.Pointer obj, + ffi.Pointer sel, + int bufferSize, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream, + ) { + return __objc_msgSend_758( + obj, + sel, + bufferSize, + inputStream, + outputStream, + ); + } + + late final __objc_msgSend_758Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_758 = __objc_msgSend_758Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_read_maxLength_1 = _registerName1("read:maxLength:"); + late final _sel_getBuffer_length_1 = _registerName1("getBuffer:length:"); + bool _objc_msgSend_759( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> buffer, + ffi.Pointer len, + ) { + return __objc_msgSend_759( + obj, + sel, + buffer, + len, + ); + } + + late final __objc_msgSend_759Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_759 = __objc_msgSend_759Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, ffi.Pointer)>(); + + late final _sel_hasBytesAvailable1 = _registerName1("hasBytesAvailable"); + late final _sel_initWithFileAtPath_1 = _registerName1("initWithFileAtPath:"); + late final _sel_inputStreamWithData_1 = + _registerName1("inputStreamWithData:"); + late final _sel_inputStreamWithFileAtPath_1 = + _registerName1("inputStreamWithFileAtPath:"); + late final _sel_inputStreamWithURL_1 = _registerName1("inputStreamWithURL:"); + late final _sel_HTTPBodyStream1 = _registerName1("HTTPBodyStream"); + ffi.Pointer _objc_msgSend_760( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_760( + obj, + sel, + ); + } + + late final __objc_msgSend_760Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_760 = __objc_msgSend_760Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_HTTPShouldHandleCookies1 = + _registerName1("HTTPShouldHandleCookies"); + late final _sel_HTTPShouldUsePipelining1 = + _registerName1("HTTPShouldUsePipelining"); + late final _sel_originalRequest1 = _registerName1("originalRequest"); + ffi.Pointer _objc_msgSend_761( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_761( + obj, + sel, + ); + } + + late final __objc_msgSend_761Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_761 = __objc_msgSend_761Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_currentRequest1 = _registerName1("currentRequest"); + late final _class_NSURLResponse1 = _getClass1("NSURLResponse"); + late final _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_1 = + _registerName1( + "initWithURL:MIMEType:expectedContentLength:textEncodingName:"); + instancetype _objc_msgSend_762( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer URL, + ffi.Pointer MIMEType, + int length, + ffi.Pointer name, + ) { + return __objc_msgSend_762( + obj, + sel, + URL, + MIMEType, + length, + name, + ); + } + + late final __objc_msgSend_762Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_762 = __objc_msgSend_762Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final _sel_MIMEType1 = _registerName1("MIMEType"); + late final _sel_expectedContentLength1 = + _registerName1("expectedContentLength"); + late final _sel_textEncodingName1 = _registerName1("textEncodingName"); + late final _sel_suggestedFilename1 = _registerName1("suggestedFilename"); + late final _sel_response1 = _registerName1("response"); + ffi.Pointer _objc_msgSend_763( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_763( + obj, + sel, + ); + } + + late final __objc_msgSend_763Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_763 = __objc_msgSend_763Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_progress1 = _registerName1("progress"); + late final _sel_earliestBeginDate1 = _registerName1("earliestBeginDate"); + late final _sel_setEarliestBeginDate_1 = + _registerName1("setEarliestBeginDate:"); + late final _sel_countOfBytesClientExpectsToSend1 = + _registerName1("countOfBytesClientExpectsToSend"); + late final _sel_setCountOfBytesClientExpectsToSend_1 = + _registerName1("setCountOfBytesClientExpectsToSend:"); + late final _sel_countOfBytesClientExpectsToReceive1 = + _registerName1("countOfBytesClientExpectsToReceive"); + late final _sel_setCountOfBytesClientExpectsToReceive_1 = + _registerName1("setCountOfBytesClientExpectsToReceive:"); + late final _sel_countOfBytesSent1 = _registerName1("countOfBytesSent"); + late final _sel_countOfBytesReceived1 = + _registerName1("countOfBytesReceived"); + late final _sel_countOfBytesExpectedToSend1 = + _registerName1("countOfBytesExpectedToSend"); + late final _sel_countOfBytesExpectedToReceive1 = + _registerName1("countOfBytesExpectedToReceive"); + late final _sel_taskDescription1 = _registerName1("taskDescription"); + late final _sel_setTaskDescription_1 = _registerName1("setTaskDescription:"); + late final _sel_state1 = _registerName1("state"); + int _objc_msgSend_764( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_764( + obj, + sel, + ); + } + + late final __objc_msgSend_764Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_764 = __objc_msgSend_764Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_suspend1 = _registerName1("suspend"); + late final _sel_priority1 = _registerName1("priority"); + late final _sel_setPriority_1 = _registerName1("setPriority:"); + void _objc_msgSend_765( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_765( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_765Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Float)>>('objc_msgSend'); + late final __objc_msgSend_765 = __objc_msgSend_765Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_prefersIncrementalDelivery1 = + _registerName1("prefersIncrementalDelivery"); + late final _sel_setPrefersIncrementalDelivery_1 = + _registerName1("setPrefersIncrementalDelivery:"); + late final _sel_storeCookies_forTask_1 = + _registerName1("storeCookies:forTask:"); + void _objc_msgSend_766( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cookies, + ffi.Pointer task, + ) { + return __objc_msgSend_766( + obj, + sel, + cookies, + task, + ); + } + + late final __objc_msgSend_766Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_766 = __objc_msgSend_766Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_getCookiesForTask_completionHandler_1 = + _registerName1("getCookiesForTask:completionHandler:"); + void _objc_msgSend_767( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer task, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_767( + obj, + sel, + task, + completionHandler, + ); + } + + late final __objc_msgSend_767Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_767 = __objc_msgSend_767Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _class_NSIndexPath1 = _getClass1("NSIndexPath"); + late final _sel_indexPathWithIndex_1 = _registerName1("indexPathWithIndex:"); + late final _sel_indexPathWithIndexes_length_1 = + _registerName1("indexPathWithIndexes:length:"); + instancetype _objc_msgSend_768( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexes, + int length, + ) { + return __objc_msgSend_768( + obj, + sel, + indexes, + length, + ); + } + + late final __objc_msgSend_768Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_768 = __objc_msgSend_768Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_initWithIndexes_length_1 = + _registerName1("initWithIndexes:length:"); + late final _sel_indexPathByAddingIndex_1 = + _registerName1("indexPathByAddingIndex:"); + ffi.Pointer _objc_msgSend_769( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_769( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_769Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_769 = __objc_msgSend_769Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_indexPathByRemovingLastIndex1 = + _registerName1("indexPathByRemovingLastIndex"); + ffi.Pointer _objc_msgSend_770( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_770( + obj, + sel, + ); + } + + late final __objc_msgSend_770Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_770 = __objc_msgSend_770Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_indexAtPosition_1 = _registerName1("indexAtPosition:"); + late final _sel_getIndexes_range_1 = _registerName1("getIndexes:range:"); + void _objc_msgSend_771( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexes, + NSRange positionRange, + ) { + return __objc_msgSend_771( + obj, + sel, + indexes, + positionRange, + ); + } + + late final __objc_msgSend_771Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_771 = __objc_msgSend_771Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSRange)>(); + + int _objc_msgSend_772( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherObject, + ) { + return __objc_msgSend_772( + obj, + sel, + otherObject, + ); + } + + late final __objc_msgSend_772Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_772 = __objc_msgSend_772Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_getIndexes_1 = _registerName1("getIndexes:"); + void _objc_msgSend_773( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexes, + ) { + return __objc_msgSend_773( + obj, + sel, + indexes, + ); + } + + late final __objc_msgSend_773Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_773 = __objc_msgSend_773Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSInflectionRule1 = _getClass1("NSInflectionRule"); + late final _sel_automaticRule1 = _registerName1("automaticRule"); + ffi.Pointer _objc_msgSend_774( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_774( + obj, + sel, + ); + } + + late final __objc_msgSend_774Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_774 = __objc_msgSend_774Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_canInflectLanguage_1 = _registerName1("canInflectLanguage:"); + late final _sel_canInflectPreferredLocalization1 = + _registerName1("canInflectPreferredLocalization"); + late final _class_NSMorphology1 = _getClass1("NSMorphology"); + late final _sel_grammaticalGender1 = _registerName1("grammaticalGender"); + int _objc_msgSend_775( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_775( + obj, + sel, + ); + } + + late final __objc_msgSend_775Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_775 = __objc_msgSend_775Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setGrammaticalGender_1 = + _registerName1("setGrammaticalGender:"); + void _objc_msgSend_776( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_776( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_776Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_776 = __objc_msgSend_776Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_partOfSpeech1 = _registerName1("partOfSpeech"); + int _objc_msgSend_777( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_777( + obj, + sel, + ); + } + + late final __objc_msgSend_777Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_777 = __objc_msgSend_777Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setPartOfSpeech_1 = _registerName1("setPartOfSpeech:"); + void _objc_msgSend_778( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_778( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_778Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_778 = __objc_msgSend_778Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_number1 = _registerName1("number"); + int _objc_msgSend_779( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_779( + obj, + sel, + ); + } + + late final __objc_msgSend_779Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_779 = __objc_msgSend_779Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setNumber_1 = _registerName1("setNumber:"); + void _objc_msgSend_780( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_780( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_780Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_780 = __objc_msgSend_780Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _class_NSMorphologyCustomPronoun1 = + _getClass1("NSMorphologyCustomPronoun"); + late final _sel_isSupportedForLanguage_1 = + _registerName1("isSupportedForLanguage:"); + late final _sel_requiredKeysForLanguage_1 = + _registerName1("requiredKeysForLanguage:"); + late final _sel_subjectForm1 = _registerName1("subjectForm"); + late final _sel_setSubjectForm_1 = _registerName1("setSubjectForm:"); + late final _sel_objectForm1 = _registerName1("objectForm"); + late final _sel_setObjectForm_1 = _registerName1("setObjectForm:"); + late final _sel_possessiveForm1 = _registerName1("possessiveForm"); + late final _sel_setPossessiveForm_1 = _registerName1("setPossessiveForm:"); + late final _sel_possessiveAdjectiveForm1 = + _registerName1("possessiveAdjectiveForm"); + late final _sel_setPossessiveAdjectiveForm_1 = + _registerName1("setPossessiveAdjectiveForm:"); + late final _sel_reflexiveForm1 = _registerName1("reflexiveForm"); + late final _sel_setReflexiveForm_1 = _registerName1("setReflexiveForm:"); + late final _sel_customPronounForLanguage_1 = + _registerName1("customPronounForLanguage:"); + ffi.Pointer _objc_msgSend_781( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer language, + ) { + return __objc_msgSend_781( + obj, + sel, + language, + ); + } + + late final __objc_msgSend_781Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_781 = __objc_msgSend_781Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setCustomPronoun_forLanguage_error_1 = + _registerName1("setCustomPronoun:forLanguage:error:"); + bool _objc_msgSend_782( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer features, + ffi.Pointer language, + ffi.Pointer> error, + ) { + return __objc_msgSend_782( + obj, + sel, + features, + language, + error, + ); + } + + late final __objc_msgSend_782Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_782 = __objc_msgSend_782Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_isUnspecified1 = _registerName1("isUnspecified"); + late final _sel_userMorphology1 = _registerName1("userMorphology"); + ffi.Pointer _objc_msgSend_783( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_783( + obj, + sel, + ); + } + + late final __objc_msgSend_783Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_783 = __objc_msgSend_783Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSOperationQueue1 = _getClass1("NSOperationQueue"); + late final _class_NSOperation1 = _getClass1("NSOperation"); + late final _sel_isConcurrent1 = _registerName1("isConcurrent"); + late final _sel_isAsynchronous1 = _registerName1("isAsynchronous"); + late final _sel_isReady1 = _registerName1("isReady"); + late final _sel_addDependency_1 = _registerName1("addDependency:"); + void _objc_msgSend_784( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer op, + ) { + return __objc_msgSend_784( + obj, + sel, + op, + ); + } + + late final __objc_msgSend_784Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_784 = __objc_msgSend_784Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeDependency_1 = _registerName1("removeDependency:"); + late final _sel_dependencies1 = _registerName1("dependencies"); + late final _sel_queuePriority1 = _registerName1("queuePriority"); + int _objc_msgSend_785( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_785( + obj, + sel, + ); + } + + late final __objc_msgSend_785Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_785 = __objc_msgSend_785Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setQueuePriority_1 = _registerName1("setQueuePriority:"); + void _objc_msgSend_786( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_786( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_786Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_786 = __objc_msgSend_786Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_completionBlock1 = _registerName1("completionBlock"); + late final _sel_setCompletionBlock_1 = _registerName1("setCompletionBlock:"); + late final _sel_waitUntilFinished1 = _registerName1("waitUntilFinished"); + late final _sel_addOperation_1 = _registerName1("addOperation:"); + late final _sel_addOperations_waitUntilFinished_1 = + _registerName1("addOperations:waitUntilFinished:"); + void _objc_msgSend_787( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer ops, + bool wait, + ) { + return __objc_msgSend_787( + obj, + sel, + ops, + wait, + ); + } + + late final __objc_msgSend_787Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_787 = __objc_msgSend_787Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_addOperationWithBlock_1 = + _registerName1("addOperationWithBlock:"); + late final _sel_addBarrierBlock_1 = _registerName1("addBarrierBlock:"); + late final _sel_maxConcurrentOperationCount1 = + _registerName1("maxConcurrentOperationCount"); + late final _sel_setMaxConcurrentOperationCount_1 = + _registerName1("setMaxConcurrentOperationCount:"); + late final _sel_isSuspended1 = _registerName1("isSuspended"); + late final _sel_setSuspended_1 = _registerName1("setSuspended:"); + late final _sel_underlyingQueue1 = _registerName1("underlyingQueue"); + dispatch_queue_t _objc_msgSend_788( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_788( + obj, + sel, + ); + } + + late final __objc_msgSend_788Ptr = _lookup< + ffi.NativeFunction< + dispatch_queue_t Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_788 = __objc_msgSend_788Ptr.asFunction< + dispatch_queue_t Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setUnderlyingQueue_1 = _registerName1("setUnderlyingQueue:"); + void _objc_msgSend_789( + ffi.Pointer obj, + ffi.Pointer sel, + dispatch_queue_t value, + ) { + return __objc_msgSend_789( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_789Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + dispatch_queue_t)>>('objc_msgSend'); + late final __objc_msgSend_789 = __objc_msgSend_789Ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, dispatch_queue_t)>(); + + late final _sel_cancelAllOperations1 = _registerName1("cancelAllOperations"); + late final _sel_waitUntilAllOperationsAreFinished1 = + _registerName1("waitUntilAllOperationsAreFinished"); + late final _sel_currentQueue1 = _registerName1("currentQueue"); + ffi.Pointer _objc_msgSend_790( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_790( + obj, + sel, + ); + } + + late final __objc_msgSend_790Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_790 = __objc_msgSend_790Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_mainQueue1 = _registerName1("mainQueue"); + late final _sel_operations1 = _registerName1("operations"); + late final _sel_operationCount1 = _registerName1("operationCount"); + late final _class_NSPointerArray1 = _getClass1("NSPointerArray"); + late final _sel_initWithOptions_1 = _registerName1("initWithOptions:"); + instancetype _objc_msgSend_791( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_791( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_791Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_791 = __objc_msgSend_791Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _class_NSPointerFunctions1 = _getClass1("NSPointerFunctions"); + late final _sel_pointerFunctionsWithOptions_1 = + _registerName1("pointerFunctionsWithOptions:"); + ffi.Pointer _objc_msgSend_792( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_792( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_792Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_792 = __objc_msgSend_792Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_hashFunction1 = _registerName1("hashFunction"); + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + _objc_msgSend_793( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_793( + obj, + sel, + ); + } + + late final __objc_msgSend_793Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); + late final __objc_msgSend_793 = __objc_msgSend_793Ptr.asFunction< + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setHashFunction_1 = _registerName1("setHashFunction:"); + void _objc_msgSend_794( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + value, + ) { + return __objc_msgSend_794( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_794Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>)>>)>>( + 'objc_msgSend'); + late final __objc_msgSend_794 = __objc_msgSend_794Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>)>>)>(); + + late final _sel_isEqualFunction1 = _registerName1("isEqualFunction"); + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + _objc_msgSend_795( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_795( + obj, + sel, + ); + } + + late final __objc_msgSend_795Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); + late final __objc_msgSend_795 = __objc_msgSend_795Ptr.asFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setIsEqualFunction_1 = _registerName1("setIsEqualFunction:"); + void _objc_msgSend_796( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + value, + ) { + return __objc_msgSend_796( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_796Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>)>>)>>( + 'objc_msgSend'); + late final __objc_msgSend_796 = __objc_msgSend_796Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>)>>)>(); + + late final _sel_sizeFunction1 = _registerName1("sizeFunction"); + ffi.Pointer)>> + _objc_msgSend_797( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_797( + obj, + sel, + ); + } + + late final __objc_msgSend_797Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); + late final __objc_msgSend_797 = __objc_msgSend_797Ptr.asFunction< + ffi.Pointer< + ffi.NativeFunction)>> + Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setSizeFunction_1 = _registerName1("setSizeFunction:"); + void _objc_msgSend_798( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer)>> + value, + ) { + return __objc_msgSend_798( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_798Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>)>>('objc_msgSend'); + late final __objc_msgSend_798 = __objc_msgSend_798Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>(); + + late final _sel_descriptionFunction1 = _registerName1("descriptionFunction"); + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>> + _objc_msgSend_799( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_799( + obj, + sel, + ); + } + + late final __objc_msgSend_799Ptr = + _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); + late final __objc_msgSend_799 = __objc_msgSend_799Ptr.asFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>> + Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setDescriptionFunction_1 = + _registerName1("setDescriptionFunction:"); + void _objc_msgSend_800( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>> + value, + ) { + return __objc_msgSend_800( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_800Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>)>>('objc_msgSend'); + late final __objc_msgSend_800 = __objc_msgSend_800Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>>)>(); + + late final _sel_relinquishFunction1 = _registerName1("relinquishFunction"); + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + _objc_msgSend_801( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_801( + obj, + sel, + ); + } + + late final __objc_msgSend_801Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); + late final __objc_msgSend_801 = __objc_msgSend_801Ptr.asFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setRelinquishFunction_1 = + _registerName1("setRelinquishFunction:"); + void _objc_msgSend_802( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + value, + ) { + return __objc_msgSend_802( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_802Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>)>>)>>( + 'objc_msgSend'); + late final __objc_msgSend_802 = __objc_msgSend_802Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>)>>)>(); + + late final _sel_acquireFunction1 = _registerName1("acquireFunction"); + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>, + ffi.Bool)>> _objc_msgSend_803( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_803( + obj, + sel, + ); + } + + late final __objc_msgSend_803Ptr = + _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer)>>, + ffi.Bool)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); + late final __objc_msgSend_803 = __objc_msgSend_803Ptr.asFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>, + ffi.Bool)>> + Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setAcquireFunction_1 = _registerName1("setAcquireFunction:"); + void _objc_msgSend_804( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>, + ffi.Bool)>> + value, + ) { + return __objc_msgSend_804( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_804Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>, + ffi.Bool)>>)>>('objc_msgSend'); + late final __objc_msgSend_804 = __objc_msgSend_804Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>, + ffi.Bool)>>)>(); + + late final _sel_usesStrongWriteBarrier1 = + _registerName1("usesStrongWriteBarrier"); + late final _sel_setUsesStrongWriteBarrier_1 = + _registerName1("setUsesStrongWriteBarrier:"); + late final _sel_usesWeakReadAndWriteBarriers1 = + _registerName1("usesWeakReadAndWriteBarriers"); + late final _sel_setUsesWeakReadAndWriteBarriers_1 = + _registerName1("setUsesWeakReadAndWriteBarriers:"); + late final _sel_initWithPointerFunctions_1 = + _registerName1("initWithPointerFunctions:"); + instancetype _objc_msgSend_805( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer functions, + ) { + return __objc_msgSend_805( + obj, + sel, + functions, + ); + } + + late final __objc_msgSend_805Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_805 = __objc_msgSend_805Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_pointerArrayWithOptions_1 = + _registerName1("pointerArrayWithOptions:"); + ffi.Pointer _objc_msgSend_806( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_806( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_806Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_806 = __objc_msgSend_806Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_pointerArrayWithPointerFunctions_1 = + _registerName1("pointerArrayWithPointerFunctions:"); + ffi.Pointer _objc_msgSend_807( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer functions, + ) { + return __objc_msgSend_807( + obj, + sel, + functions, + ); + } + + late final __objc_msgSend_807Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_807 = __objc_msgSend_807Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_pointerFunctions1 = _registerName1("pointerFunctions"); + ffi.Pointer _objc_msgSend_808( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_808( + obj, + sel, + ); + } + + late final __objc_msgSend_808Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_808 = __objc_msgSend_808Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_pointerAtIndex_1 = _registerName1("pointerAtIndex:"); + ffi.Pointer _objc_msgSend_809( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_809( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_809Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_809 = __objc_msgSend_809Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_addPointer_1 = _registerName1("addPointer:"); + late final _sel_removePointerAtIndex_1 = + _registerName1("removePointerAtIndex:"); + late final _sel_insertPointer_atIndex_1 = + _registerName1("insertPointer:atIndex:"); + late final _sel_replacePointerAtIndex_withPointer_1 = + _registerName1("replacePointerAtIndex:withPointer:"); + void _objc_msgSend_810( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer item, + ) { + return __objc_msgSend_810( + obj, + sel, + index, + item, + ); + } + + late final __objc_msgSend_810Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_810 = __objc_msgSend_810Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_compact1 = _registerName1("compact"); + late final _sel_setCount_1 = _registerName1("setCount:"); + late final _sel_pointerArrayWithStrongObjects1 = + _registerName1("pointerArrayWithStrongObjects"); + late final _sel_pointerArrayWithWeakObjects1 = + _registerName1("pointerArrayWithWeakObjects"); + late final _sel_strongObjectsPointerArray1 = + _registerName1("strongObjectsPointerArray"); + ffi.Pointer _objc_msgSend_811( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_811( + obj, + sel, + ); + } + + late final __objc_msgSend_811Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_811 = __objc_msgSend_811Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_weakObjectsPointerArray1 = + _registerName1("weakObjectsPointerArray"); + late final _class_NSProcessInfo1 = _getClass1("NSProcessInfo"); + late final _sel_processInfo1 = _registerName1("processInfo"); + ffi.Pointer _objc_msgSend_812( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_812( + obj, + sel, + ); + } + + late final __objc_msgSend_812Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_812 = __objc_msgSend_812Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_environment1 = _registerName1("environment"); + late final _sel_hostName1 = _registerName1("hostName"); + late final _sel_processName1 = _registerName1("processName"); + late final _sel_setProcessName_1 = _registerName1("setProcessName:"); + late final _sel_processIdentifier1 = _registerName1("processIdentifier"); + late final _sel_globallyUniqueString1 = + _registerName1("globallyUniqueString"); + late final _sel_operatingSystem1 = _registerName1("operatingSystem"); + late final _sel_operatingSystemName1 = _registerName1("operatingSystemName"); + late final _sel_operatingSystemVersionString1 = + _registerName1("operatingSystemVersionString"); + late final _sel_operatingSystemVersion1 = + _registerName1("operatingSystemVersion"); + NSOperatingSystemVersion _objc_msgSend_813( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_813( + obj, + sel, + ); + } + + late final __objc_msgSend_813Ptr = _lookup< + ffi.NativeFunction< + NSOperatingSystemVersion Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_813 = __objc_msgSend_813Ptr.asFunction< + NSOperatingSystemVersion Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_processorCount1 = _registerName1("processorCount"); + late final _sel_activeProcessorCount1 = + _registerName1("activeProcessorCount"); + late final _sel_physicalMemory1 = _registerName1("physicalMemory"); + late final _sel_isOperatingSystemAtLeastVersion_1 = + _registerName1("isOperatingSystemAtLeastVersion:"); + bool _objc_msgSend_814( + ffi.Pointer obj, + ffi.Pointer sel, + NSOperatingSystemVersion version, + ) { + return __objc_msgSend_814( + obj, + sel, + version, + ); + } + + late final __objc_msgSend_814Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + NSOperatingSystemVersion)>>('objc_msgSend'); + late final __objc_msgSend_814 = __objc_msgSend_814Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + NSOperatingSystemVersion)>(); + + late final _sel_systemUptime1 = _registerName1("systemUptime"); + late final _sel_disableSuddenTermination1 = + _registerName1("disableSuddenTermination"); + late final _sel_enableSuddenTermination1 = + _registerName1("enableSuddenTermination"); + late final _sel_disableAutomaticTermination_1 = + _registerName1("disableAutomaticTermination:"); + late final _sel_enableAutomaticTermination_1 = + _registerName1("enableAutomaticTermination:"); + late final _sel_automaticTerminationSupportEnabled1 = + _registerName1("automaticTerminationSupportEnabled"); + late final _sel_setAutomaticTerminationSupportEnabled_1 = + _registerName1("setAutomaticTerminationSupportEnabled:"); + late final _sel_beginActivityWithOptions_reason_1 = + _registerName1("beginActivityWithOptions:reason:"); + ffi.Pointer _objc_msgSend_815( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ffi.Pointer reason, + ) { + return __objc_msgSend_815( + obj, + sel, + options, + reason, + ); + } + + late final __objc_msgSend_815Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_815 = __objc_msgSend_815Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_endActivity_1 = _registerName1("endActivity:"); + late final _sel_performActivityWithOptions_reason_usingBlock_1 = + _registerName1("performActivityWithOptions:reason:usingBlock:"); + void _objc_msgSend_816( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ffi.Pointer reason, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_816( + obj, + sel, + options, + reason, + block, + ); + } + + late final __objc_msgSend_816Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_816 = __objc_msgSend_816Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_performExpiringActivityWithReason_usingBlock_1 = + _registerName1("performExpiringActivityWithReason:usingBlock:"); + void _objc_msgSend_817( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer reason, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_817( + obj, + sel, + reason, + block, + ); + } + + late final __objc_msgSend_817Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_817 = __objc_msgSend_817Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_userName1 = _registerName1("userName"); + late final _sel_fullUserName1 = _registerName1("fullUserName"); + late final _sel_thermalState1 = _registerName1("thermalState"); + int _objc_msgSend_818( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_818( + obj, + sel, + ); + } + + late final __objc_msgSend_818Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_818 = __objc_msgSend_818Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isLowPowerModeEnabled1 = + _registerName1("isLowPowerModeEnabled"); + late final _sel_isMacCatalystApp1 = _registerName1("isMacCatalystApp"); + late final _sel_isiOSAppOnMac1 = _registerName1("isiOSAppOnMac"); + late final _class_NSTextCheckingResult1 = _getClass1("NSTextCheckingResult"); + late final _sel_resultType1 = _registerName1("resultType"); + int _objc_msgSend_819( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_819( + obj, + sel, + ); + } + + late final __objc_msgSend_819Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_819 = __objc_msgSend_819Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_range1 = _registerName1("range"); + late final _sel_orthography1 = _registerName1("orthography"); + ffi.Pointer _objc_msgSend_820( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_820( + obj, + sel, + ); + } + + late final __objc_msgSend_820Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_820 = __objc_msgSend_820Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_grammarDetails1 = _registerName1("grammarDetails"); + late final _sel_duration1 = _registerName1("duration"); + late final _sel_components1 = _registerName1("components"); + late final _sel_replacementString1 = _registerName1("replacementString"); + late final _sel_alternativeStrings1 = _registerName1("alternativeStrings"); + late final _class_NSRegularExpression1 = _getClass1("NSRegularExpression"); + late final _sel_regularExpressionWithPattern_options_error_1 = + _registerName1("regularExpressionWithPattern:options:error:"); + ffi.Pointer _objc_msgSend_821( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer pattern, + int options, + ffi.Pointer> error, + ) { + return __objc_msgSend_821( + obj, + sel, + pattern, + options, + error, + ); + } + + late final __objc_msgSend_821Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_821 = __objc_msgSend_821Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_initWithPattern_options_error_1 = + _registerName1("initWithPattern:options:error:"); + instancetype _objc_msgSend_822( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer pattern, + int options, + ffi.Pointer> error, + ) { + return __objc_msgSend_822( + obj, + sel, + pattern, + options, + error, + ); + } + + late final __objc_msgSend_822Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_822 = __objc_msgSend_822Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_pattern1 = _registerName1("pattern"); + late final _sel_options1 = _registerName1("options"); + int _objc_msgSend_823( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_823( + obj, + sel, + ); + } + + late final __objc_msgSend_823Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_823 = __objc_msgSend_823Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_numberOfCaptureGroups1 = + _registerName1("numberOfCaptureGroups"); + late final _sel_escapedPatternForString_1 = + _registerName1("escapedPatternForString:"); + late final _sel_enumerateMatchesInString_options_range_usingBlock_1 = + _registerName1("enumerateMatchesInString:options:range:usingBlock:"); + void _objc_msgSend_824( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + NSRange range, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_824( + obj, + sel, + string, + options, + range, + block, + ); + } + + late final __objc_msgSend_824Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_824 = __objc_msgSend_824Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_matchesInString_options_range_1 = + _registerName1("matchesInString:options:range:"); + ffi.Pointer _objc_msgSend_825( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + NSRange range, + ) { + return __objc_msgSend_825( + obj, + sel, + string, + options, + range, + ); + } + + late final __objc_msgSend_825Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_825 = __objc_msgSend_825Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, NSRange)>(); + + late final _sel_numberOfMatchesInString_options_range_1 = + _registerName1("numberOfMatchesInString:options:range:"); + int _objc_msgSend_826( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + NSRange range, + ) { + return __objc_msgSend_826( + obj, + sel, + string, + options, + range, + ); + } + + late final __objc_msgSend_826Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_826 = __objc_msgSend_826Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange)>(); + + late final _sel_firstMatchInString_options_range_1 = + _registerName1("firstMatchInString:options:range:"); + ffi.Pointer _objc_msgSend_827( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + NSRange range, + ) { + return __objc_msgSend_827( + obj, + sel, + string, + options, + range, + ); + } + + late final __objc_msgSend_827Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange)>>('objc_msgSend'); + late final __objc_msgSend_827 = __objc_msgSend_827Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, NSRange)>(); + + late final _sel_rangeOfFirstMatchInString_options_range_1 = + _registerName1("rangeOfFirstMatchInString:options:range:"); + NSRange _objc_msgSend_828( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + NSRange range, + ) { + return __objc_msgSend_828( + obj, + sel, + string, + options, + range, + ); + } + + late final __objc_msgSend_828Ptr = _lookup< + ffi.NativeFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_828 = __objc_msgSend_828Ptr.asFunction< + NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange)>(); + + late final _sel_stringByReplacingMatchesInString_options_range_withTemplate_1 = + _registerName1( + "stringByReplacingMatchesInString:options:range:withTemplate:"); + ffi.Pointer _objc_msgSend_829( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + NSRange range, + ffi.Pointer templ, + ) { + return __objc_msgSend_829( + obj, + sel, + string, + options, + range, + templ, + ); + } + + late final __objc_msgSend_829Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_829 = __objc_msgSend_829Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + NSRange, + ffi.Pointer)>(); + + late final _sel_replaceMatchesInString_options_range_withTemplate_1 = + _registerName1("replaceMatchesInString:options:range:withTemplate:"); + int _objc_msgSend_830( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + NSRange range, + ffi.Pointer templ, + ) { + return __objc_msgSend_830( + obj, + sel, + string, + options, + range, + templ, + ); + } + + late final __objc_msgSend_830Ptr = _lookup< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_830 = __objc_msgSend_830Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, NSRange, ffi.Pointer)>(); + + late final _sel_replacementStringForResult_inString_offset_template_1 = + _registerName1("replacementStringForResult:inString:offset:template:"); + ffi.Pointer _objc_msgSend_831( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ffi.Pointer string, + int offset, + ffi.Pointer templ, + ) { + return __objc_msgSend_831( + obj, + sel, + result, + string, + offset, + templ, + ); + } + + late final __objc_msgSend_831Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_831 = __objc_msgSend_831Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final _sel_escapedTemplateForString_1 = + _registerName1("escapedTemplateForString:"); + late final _sel_regularExpression1 = _registerName1("regularExpression"); + ffi.Pointer _objc_msgSend_832( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_832( + obj, + sel, + ); + } + + late final __objc_msgSend_832Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_832 = __objc_msgSend_832Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_phoneNumber1 = _registerName1("phoneNumber"); + late final _sel_numberOfRanges1 = _registerName1("numberOfRanges"); + late final _sel_rangeAtIndex_1 = _registerName1("rangeAtIndex:"); + late final _sel_rangeWithName_1 = _registerName1("rangeWithName:"); + late final _sel_resultByAdjustingRangesWithOffset_1 = + _registerName1("resultByAdjustingRangesWithOffset:"); + ffi.Pointer _objc_msgSend_833( + ffi.Pointer obj, + ffi.Pointer sel, + int offset, + ) { + return __objc_msgSend_833( + obj, + sel, + offset, + ); + } + + late final __objc_msgSend_833Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_833 = __objc_msgSend_833Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_addressComponents1 = _registerName1("addressComponents"); + late final _sel_orthographyCheckingResultWithRange_orthography_1 = + _registerName1("orthographyCheckingResultWithRange:orthography:"); + ffi.Pointer _objc_msgSend_834( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer orthography, + ) { + return __objc_msgSend_834( + obj, + sel, + range, + orthography, + ); + } + + late final __objc_msgSend_834Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_834 = __objc_msgSend_834Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, ffi.Pointer)>(); + + late final _sel_spellCheckingResultWithRange_1 = + _registerName1("spellCheckingResultWithRange:"); + ffi.Pointer _objc_msgSend_835( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ) { + return __objc_msgSend_835( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_835Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange)>>('objc_msgSend'); + late final __objc_msgSend_835 = __objc_msgSend_835Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSRange)>(); + + late final _sel_grammarCheckingResultWithRange_details_1 = + _registerName1("grammarCheckingResultWithRange:details:"); + ffi.Pointer _objc_msgSend_836( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer details, + ) { + return __objc_msgSend_836( + obj, + sel, + range, + details, + ); + } + + late final __objc_msgSend_836Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_836 = __objc_msgSend_836Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, ffi.Pointer)>(); + + late final _sel_dateCheckingResultWithRange_date_1 = + _registerName1("dateCheckingResultWithRange:date:"); + ffi.Pointer _objc_msgSend_837( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer date, + ) { + return __objc_msgSend_837( + obj, + sel, + range, + date, + ); + } + + late final __objc_msgSend_837Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_837 = __objc_msgSend_837Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, ffi.Pointer)>(); + + late final _sel_dateCheckingResultWithRange_date_timeZone_duration_1 = + _registerName1("dateCheckingResultWithRange:date:timeZone:duration:"); + ffi.Pointer _objc_msgSend_838( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer date, + ffi.Pointer timeZone, + double duration, + ) { + return __objc_msgSend_838( + obj, + sel, + range, + date, + timeZone, + duration, + ); + } + + late final __objc_msgSend_838Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer, + ffi.Pointer, + NSTimeInterval)>>('objc_msgSend'); + late final __objc_msgSend_838 = __objc_msgSend_838Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer, + ffi.Pointer, + double)>(); + + late final _sel_addressCheckingResultWithRange_components_1 = + _registerName1("addressCheckingResultWithRange:components:"); + ffi.Pointer _objc_msgSend_839( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer components, + ) { + return __objc_msgSend_839( + obj, + sel, + range, + components, + ); + } + + late final __objc_msgSend_839Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_839 = __objc_msgSend_839Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, ffi.Pointer)>(); + + late final _sel_linkCheckingResultWithRange_URL_1 = + _registerName1("linkCheckingResultWithRange:URL:"); + ffi.Pointer _objc_msgSend_840( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer url, + ) { + return __objc_msgSend_840( + obj, + sel, + range, + url, + ); + } + + late final __objc_msgSend_840Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_840 = __objc_msgSend_840Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, ffi.Pointer)>(); + + late final _sel_quoteCheckingResultWithRange_replacementString_1 = + _registerName1("quoteCheckingResultWithRange:replacementString:"); + ffi.Pointer _objc_msgSend_841( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer replacementString, + ) { + return __objc_msgSend_841( + obj, + sel, + range, + replacementString, + ); + } + + late final __objc_msgSend_841Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_841 = __objc_msgSend_841Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSRange, ffi.Pointer)>(); + + late final _sel_dashCheckingResultWithRange_replacementString_1 = + _registerName1("dashCheckingResultWithRange:replacementString:"); + late final _sel_replacementCheckingResultWithRange_replacementString_1 = + _registerName1("replacementCheckingResultWithRange:replacementString:"); + late final _sel_correctionCheckingResultWithRange_replacementString_1 = + _registerName1("correctionCheckingResultWithRange:replacementString:"); + late final _sel_correctionCheckingResultWithRange_replacementString_alternativeStrings_1 = + _registerName1( + "correctionCheckingResultWithRange:replacementString:alternativeStrings:"); + ffi.Pointer _objc_msgSend_842( + ffi.Pointer obj, + ffi.Pointer sel, + NSRange range, + ffi.Pointer replacementString, + ffi.Pointer alternativeStrings, + ) { + return __objc_msgSend_842( + obj, + sel, + range, + replacementString, + alternativeStrings, + ); + } + + late final __objc_msgSend_842Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_842 = __objc_msgSend_842Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_regularExpressionCheckingResultWithRanges_count_regularExpression_1 = + _registerName1( + "regularExpressionCheckingResultWithRanges:count:regularExpression:"); + ffi.Pointer _objc_msgSend_843( + ffi.Pointer obj, + ffi.Pointer sel, + NSRangePointer ranges, + int count, + ffi.Pointer regularExpression, + ) { + return __objc_msgSend_843( + obj, + sel, + ranges, + count, + regularExpression, + ); + } + + late final __objc_msgSend_843Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRangePointer, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_843 = __objc_msgSend_843Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSRangePointer, + int, + ffi.Pointer)>(); + + late final _sel_phoneNumberCheckingResultWithRange_phoneNumber_1 = + _registerName1("phoneNumberCheckingResultWithRange:phoneNumber:"); + late final _sel_transitInformationCheckingResultWithRange_components_1 = + _registerName1("transitInformationCheckingResultWithRange:components:"); + late final _class_NSURLCache1 = _getClass1("NSURLCache"); + late final _sel_sharedURLCache1 = _registerName1("sharedURLCache"); + ffi.Pointer _objc_msgSend_844( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_844( + obj, + sel, + ); + } + + late final __objc_msgSend_844Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_844 = __objc_msgSend_844Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setSharedURLCache_1 = _registerName1("setSharedURLCache:"); + void _objc_msgSend_845( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_845( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_845Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_845 = __objc_msgSend_845Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithMemoryCapacity_diskCapacity_diskPath_1 = + _registerName1("initWithMemoryCapacity:diskCapacity:diskPath:"); + instancetype _objc_msgSend_846( + ffi.Pointer obj, + ffi.Pointer sel, + int memoryCapacity, + int diskCapacity, + ffi.Pointer path, + ) { + return __objc_msgSend_846( + obj, + sel, + memoryCapacity, + diskCapacity, + path, + ); + } + + late final __objc_msgSend_846Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_846 = __objc_msgSend_846Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + int, ffi.Pointer)>(); + + late final _sel_initWithMemoryCapacity_diskCapacity_directoryURL_1 = + _registerName1("initWithMemoryCapacity:diskCapacity:directoryURL:"); + instancetype _objc_msgSend_847( + ffi.Pointer obj, + ffi.Pointer sel, + int memoryCapacity, + int diskCapacity, + ffi.Pointer directoryURL, + ) { + return __objc_msgSend_847( + obj, + sel, + memoryCapacity, + diskCapacity, + directoryURL, + ); + } + + late final __objc_msgSend_847Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSUInteger, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_847 = __objc_msgSend_847Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + int, ffi.Pointer)>(); + + late final _class_NSCachedURLResponse1 = _getClass1("NSCachedURLResponse"); + late final _sel_initWithResponse_data_1 = + _registerName1("initWithResponse:data:"); + instancetype _objc_msgSend_848( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer response, + ffi.Pointer data, + ) { + return __objc_msgSend_848( + obj, + sel, + response, + data, + ); + } + + late final __objc_msgSend_848Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_848 = __objc_msgSend_848Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithResponse_data_userInfo_storagePolicy_1 = + _registerName1("initWithResponse:data:userInfo:storagePolicy:"); + instancetype _objc_msgSend_849( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer response, + ffi.Pointer data, + ffi.Pointer userInfo, + int storagePolicy, + ) { + return __objc_msgSend_849( + obj, + sel, + response, + data, + userInfo, + storagePolicy, + ); + } + + late final __objc_msgSend_849Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_849 = __objc_msgSend_849Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_storagePolicy1 = _registerName1("storagePolicy"); + int _objc_msgSend_850( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_850( + obj, + sel, + ); + } + + late final __objc_msgSend_850Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_850 = __objc_msgSend_850Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_cachedResponseForRequest_1 = + _registerName1("cachedResponseForRequest:"); + ffi.Pointer _objc_msgSend_851( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_851( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_851Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_851 = __objc_msgSend_851Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_storeCachedResponse_forRequest_1 = + _registerName1("storeCachedResponse:forRequest:"); + void _objc_msgSend_852( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cachedResponse, + ffi.Pointer request, + ) { + return __objc_msgSend_852( + obj, + sel, + cachedResponse, + request, + ); + } + + late final __objc_msgSend_852Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_852 = __objc_msgSend_852Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_removeCachedResponseForRequest_1 = + _registerName1("removeCachedResponseForRequest:"); + void _objc_msgSend_853( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_853( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_853Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_853 = __objc_msgSend_853Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeAllCachedResponses1 = + _registerName1("removeAllCachedResponses"); + late final _sel_removeCachedResponsesSinceDate_1 = + _registerName1("removeCachedResponsesSinceDate:"); + late final _sel_memoryCapacity1 = _registerName1("memoryCapacity"); + late final _sel_setMemoryCapacity_1 = _registerName1("setMemoryCapacity:"); + late final _sel_diskCapacity1 = _registerName1("diskCapacity"); + late final _sel_setDiskCapacity_1 = _registerName1("setDiskCapacity:"); + late final _sel_currentMemoryUsage1 = _registerName1("currentMemoryUsage"); + late final _sel_currentDiskUsage1 = _registerName1("currentDiskUsage"); + late final _class_NSURLSessionDataTask1 = _getClass1("NSURLSessionDataTask"); + late final _sel_storeCachedResponse_forDataTask_1 = + _registerName1("storeCachedResponse:forDataTask:"); + void _objc_msgSend_854( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cachedResponse, + ffi.Pointer dataTask, + ) { + return __objc_msgSend_854( + obj, + sel, + cachedResponse, + dataTask, + ); + } + + late final __objc_msgSend_854Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_854 = __objc_msgSend_854Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_getCachedResponseForDataTask_completionHandler_1 = + _registerName1("getCachedResponseForDataTask:completionHandler:"); + void _objc_msgSend_855( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dataTask, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_855( + obj, + sel, + dataTask, + completionHandler, + ); + } + + late final __objc_msgSend_855Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_855 = __objc_msgSend_855Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_removeCachedResponseForDataTask_1 = + _registerName1("removeCachedResponseForDataTask:"); + void _objc_msgSend_856( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dataTask, + ) { + return __objc_msgSend_856( + obj, + sel, + dataTask, + ); + } + + late final __objc_msgSend_856Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_856 = __objc_msgSend_856Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSURLConnection1 = _getClass1("NSURLConnection"); + late final _sel_initWithRequest_delegate_startImmediately_1 = + _registerName1("initWithRequest:delegate:startImmediately:"); + instancetype _objc_msgSend_857( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer delegate, + bool startImmediately, + ) { + return __objc_msgSend_857( + obj, + sel, + request, + delegate, + startImmediately, + ); + } + + late final __objc_msgSend_857Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_857 = __objc_msgSend_857Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_initWithRequest_delegate_1 = + _registerName1("initWithRequest:delegate:"); + instancetype _objc_msgSend_858( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer delegate, + ) { + return __objc_msgSend_858( + obj, + sel, + request, + delegate, + ); + } + + late final __objc_msgSend_858Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_858 = __objc_msgSend_858Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_connectionWithRequest_delegate_1 = + _registerName1("connectionWithRequest:delegate:"); + ffi.Pointer _objc_msgSend_859( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer delegate, + ) { + return __objc_msgSend_859( + obj, + sel, + request, + delegate, + ); + } + + late final __objc_msgSend_859Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_859 = __objc_msgSend_859Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_unscheduleFromRunLoop_forMode_1 = + _registerName1("unscheduleFromRunLoop:forMode:"); + late final _sel_setDelegateQueue_1 = _registerName1("setDelegateQueue:"); + void _objc_msgSend_860( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer queue, + ) { + return __objc_msgSend_860( + obj, + sel, + queue, + ); + } + + late final __objc_msgSend_860Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_860 = __objc_msgSend_860Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_canHandleRequest_1 = _registerName1("canHandleRequest:"); + bool _objc_msgSend_861( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_861( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_861Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_861 = __objc_msgSend_861Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_sendSynchronousRequest_returningResponse_error_1 = + _registerName1("sendSynchronousRequest:returningResponse:error:"); + ffi.Pointer _objc_msgSend_862( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer> response, + ffi.Pointer> error, + ) { + return __objc_msgSend_862( + obj, + sel, + request, + response, + error, + ); + } + + late final __objc_msgSend_862Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_862 = __objc_msgSend_862Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_sendAsynchronousRequest_queue_completionHandler_1 = + _registerName1("sendAsynchronousRequest:queue:completionHandler:"); + void _objc_msgSend_863( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer queue, + ffi.Pointer<_ObjCBlock> handler, + ) { + return __objc_msgSend_863( + obj, + sel, + request, + queue, + handler, + ); + } + + late final __objc_msgSend_863Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_863 = __objc_msgSend_863Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _class_NSURLCredential1 = _getClass1("NSURLCredential"); + late final _sel_persistence1 = _registerName1("persistence"); + int _objc_msgSend_864( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_864( + obj, + sel, + ); + } + + late final __objc_msgSend_864Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_864 = __objc_msgSend_864Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithUser_password_persistence_1 = + _registerName1("initWithUser:password:persistence:"); + instancetype _objc_msgSend_865( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer user, + ffi.Pointer password, + int persistence, + ) { + return __objc_msgSend_865( + obj, + sel, + user, + password, + persistence, + ); + } + + late final __objc_msgSend_865Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_865 = __objc_msgSend_865Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_credentialWithUser_password_persistence_1 = + _registerName1("credentialWithUser:password:persistence:"); + ffi.Pointer _objc_msgSend_866( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer user, + ffi.Pointer password, + int persistence, + ) { + return __objc_msgSend_866( + obj, + sel, + user, + password, + persistence, + ); + } + + late final __objc_msgSend_866Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_866 = __objc_msgSend_866Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_hasPassword1 = _registerName1("hasPassword"); + late final _sel_initWithIdentity_certificates_persistence_1 = + _registerName1("initWithIdentity:certificates:persistence:"); + instancetype _objc_msgSend_867( + ffi.Pointer obj, + ffi.Pointer sel, + SecIdentityRef identity, + ffi.Pointer certArray, + int persistence, + ) { + return __objc_msgSend_867( + obj, + sel, + identity, + certArray, + persistence, + ); + } + + late final __objc_msgSend_867Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + SecIdentityRef, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_867 = __objc_msgSend_867Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + SecIdentityRef, ffi.Pointer, int)>(); + + late final _sel_credentialWithIdentity_certificates_persistence_1 = + _registerName1("credentialWithIdentity:certificates:persistence:"); + ffi.Pointer _objc_msgSend_868( + ffi.Pointer obj, + ffi.Pointer sel, + SecIdentityRef identity, + ffi.Pointer certArray, + int persistence, + ) { + return __objc_msgSend_868( + obj, + sel, + identity, + certArray, + persistence, + ); + } + + late final __objc_msgSend_868Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + SecIdentityRef, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_868 = __objc_msgSend_868Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + SecIdentityRef, + ffi.Pointer, + int)>(); + + late final _sel_identity1 = _registerName1("identity"); + SecIdentityRef _objc_msgSend_869( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_869( + obj, + sel, + ); + } + + late final __objc_msgSend_869Ptr = _lookup< + ffi.NativeFunction< + SecIdentityRef Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_869 = __objc_msgSend_869Ptr.asFunction< + SecIdentityRef Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_certificates1 = _registerName1("certificates"); + late final _sel_initWithTrust_1 = _registerName1("initWithTrust:"); + instancetype _objc_msgSend_870( + ffi.Pointer obj, + ffi.Pointer sel, + SecTrustRef trust, + ) { + return __objc_msgSend_870( + obj, + sel, + trust, + ); + } + + late final __objc_msgSend_870Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + SecTrustRef)>>('objc_msgSend'); + late final __objc_msgSend_870 = __objc_msgSend_870Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, SecTrustRef)>(); + + late final _sel_credentialForTrust_1 = _registerName1("credentialForTrust:"); + ffi.Pointer _objc_msgSend_871( + ffi.Pointer obj, + ffi.Pointer sel, + SecTrustRef trust, + ) { + return __objc_msgSend_871( + obj, + sel, + trust, + ); + } + + late final __objc_msgSend_871Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, SecTrustRef)>>('objc_msgSend'); + late final __objc_msgSend_871 = __objc_msgSend_871Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, SecTrustRef)>(); + + late final _class_NSURLProtectionSpace1 = _getClass1("NSURLProtectionSpace"); + late final _sel_initWithHost_port_protocol_realm_authenticationMethod_1 = + _registerName1("initWithHost:port:protocol:realm:authenticationMethod:"); + instancetype _objc_msgSend_872( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer host, + int port, + ffi.Pointer protocol, + ffi.Pointer realm, + ffi.Pointer authenticationMethod, + ) { + return __objc_msgSend_872( + obj, + sel, + host, + port, + protocol, + realm, + authenticationMethod, + ); + } + + late final __objc_msgSend_872Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_872 = __objc_msgSend_872Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithProxyHost_port_type_realm_authenticationMethod_1 = + _registerName1("initWithProxyHost:port:type:realm:authenticationMethod:"); + late final _sel_realm1 = _registerName1("realm"); + late final _sel_receivesCredentialSecurely1 = + _registerName1("receivesCredentialSecurely"); + late final _sel_isProxy1 = _registerName1("isProxy"); + late final _sel_proxyType1 = _registerName1("proxyType"); + late final _sel_protocol1 = _registerName1("protocol"); + late final _sel_authenticationMethod1 = + _registerName1("authenticationMethod"); + late final _sel_distinguishedNames1 = _registerName1("distinguishedNames"); + late final _sel_serverTrust1 = _registerName1("serverTrust"); + SecTrustRef _objc_msgSend_873( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_873( + obj, + sel, + ); + } + + late final __objc_msgSend_873Ptr = _lookup< + ffi.NativeFunction< + SecTrustRef Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_873 = __objc_msgSend_873Ptr.asFunction< + SecTrustRef Function(ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSURLCredentialStorage1 = + _getClass1("NSURLCredentialStorage"); + late final _sel_sharedCredentialStorage1 = + _registerName1("sharedCredentialStorage"); + ffi.Pointer _objc_msgSend_874( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_874( + obj, + sel, + ); + } + + late final __objc_msgSend_874Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_874 = __objc_msgSend_874Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_credentialsForProtectionSpace_1 = + _registerName1("credentialsForProtectionSpace:"); + ffi.Pointer _objc_msgSend_875( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer space, + ) { + return __objc_msgSend_875( + obj, + sel, + space, + ); + } + + late final __objc_msgSend_875Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_875 = __objc_msgSend_875Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_allCredentials1 = _registerName1("allCredentials"); + late final _sel_setCredential_forProtectionSpace_1 = + _registerName1("setCredential:forProtectionSpace:"); + void _objc_msgSend_876( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer credential, + ffi.Pointer space, + ) { + return __objc_msgSend_876( + obj, + sel, + credential, + space, + ); + } + + late final __objc_msgSend_876Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_876 = __objc_msgSend_876Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_removeCredential_forProtectionSpace_1 = + _registerName1("removeCredential:forProtectionSpace:"); + late final _sel_removeCredential_forProtectionSpace_options_1 = + _registerName1("removeCredential:forProtectionSpace:options:"); + void _objc_msgSend_877( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer credential, + ffi.Pointer space, + ffi.Pointer options, + ) { + return __objc_msgSend_877( + obj, + sel, + credential, + space, + options, + ); + } + + late final __objc_msgSend_877Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_877 = __objc_msgSend_877Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_defaultCredentialForProtectionSpace_1 = + _registerName1("defaultCredentialForProtectionSpace:"); + ffi.Pointer _objc_msgSend_878( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer space, + ) { + return __objc_msgSend_878( + obj, + sel, + space, + ); + } + + late final __objc_msgSend_878Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_878 = __objc_msgSend_878Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setDefaultCredential_forProtectionSpace_1 = + _registerName1("setDefaultCredential:forProtectionSpace:"); + late final _sel_getCredentialsForProtectionSpace_task_completionHandler_1 = + _registerName1( + "getCredentialsForProtectionSpace:task:completionHandler:"); + void _objc_msgSend_879( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer protectionSpace, + ffi.Pointer task, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_879( + obj, + sel, + protectionSpace, + task, + completionHandler, + ); + } + + late final __objc_msgSend_879Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_879 = __objc_msgSend_879Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_setCredential_forProtectionSpace_task_1 = + _registerName1("setCredential:forProtectionSpace:task:"); + void _objc_msgSend_880( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer credential, + ffi.Pointer protectionSpace, + ffi.Pointer task, + ) { + return __objc_msgSend_880( + obj, + sel, + credential, + protectionSpace, + task, + ); + } + + late final __objc_msgSend_880Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_880 = __objc_msgSend_880Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeCredential_forProtectionSpace_options_task_1 = + _registerName1("removeCredential:forProtectionSpace:options:task:"); + void _objc_msgSend_881( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer credential, + ffi.Pointer protectionSpace, + ffi.Pointer options, + ffi.Pointer task, + ) { + return __objc_msgSend_881( + obj, + sel, + credential, + protectionSpace, + options, + task, + ); + } + + late final __objc_msgSend_881Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_881 = __objc_msgSend_881Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_getDefaultCredentialForProtectionSpace_task_completionHandler_1 = + _registerName1( + "getDefaultCredentialForProtectionSpace:task:completionHandler:"); + void _objc_msgSend_882( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer space, + ffi.Pointer task, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_882( + obj, + sel, + space, + task, + completionHandler, + ); + } + + late final __objc_msgSend_882Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_882 = __objc_msgSend_882Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_setDefaultCredential_forProtectionSpace_task_1 = + _registerName1("setDefaultCredential:forProtectionSpace:task:"); + late final _class_NSURLProtocol1 = _getClass1("NSURLProtocol"); + late final _sel_initWithRequest_cachedResponse_client_1 = + _registerName1("initWithRequest:cachedResponse:client:"); + instancetype _objc_msgSend_883( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer cachedResponse, + ffi.Pointer client, + ) { + return __objc_msgSend_883( + obj, + sel, + request, + cachedResponse, + client, + ); + } + + late final __objc_msgSend_883Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_883 = __objc_msgSend_883Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_client1 = _registerName1("client"); + late final _sel_request1 = _registerName1("request"); + late final _sel_cachedResponse1 = _registerName1("cachedResponse"); + ffi.Pointer _objc_msgSend_884( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_884( + obj, + sel, + ); + } + + late final __objc_msgSend_884Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_884 = __objc_msgSend_884Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_canInitWithRequest_1 = _registerName1("canInitWithRequest:"); + late final _sel_canonicalRequestForRequest_1 = + _registerName1("canonicalRequestForRequest:"); + ffi.Pointer _objc_msgSend_885( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_885( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_885Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_885 = __objc_msgSend_885Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_requestIsCacheEquivalent_toRequest_1 = + _registerName1("requestIsCacheEquivalent:toRequest:"); + bool _objc_msgSend_886( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer a, + ffi.Pointer b, + ) { + return __objc_msgSend_886( + obj, + sel, + a, + b, + ); + } + + late final __objc_msgSend_886Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_886 = __objc_msgSend_886Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_startLoading1 = _registerName1("startLoading"); + late final _sel_stopLoading1 = _registerName1("stopLoading"); + late final _sel_propertyForKey_inRequest_1 = + _registerName1("propertyForKey:inRequest:"); + ffi.Pointer _objc_msgSend_887( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ffi.Pointer request, + ) { + return __objc_msgSend_887( + obj, + sel, + key, + request, + ); + } + + late final __objc_msgSend_887Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_887 = __objc_msgSend_887Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSMutableURLRequest1 = _getClass1("NSMutableURLRequest"); + late final _sel_setURL_1 = _registerName1("setURL:"); + void _objc_msgSend_888( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_888( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_888Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_888 = __objc_msgSend_888Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setCachePolicy_1 = _registerName1("setCachePolicy:"); + void _objc_msgSend_889( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_889( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_889Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_889 = __objc_msgSend_889Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_setTimeoutInterval_1 = _registerName1("setTimeoutInterval:"); + late final _sel_setMainDocumentURL_1 = _registerName1("setMainDocumentURL:"); + late final _sel_setNetworkServiceType_1 = + _registerName1("setNetworkServiceType:"); + void _objc_msgSend_890( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_890( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_890Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_890 = __objc_msgSend_890Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_setAllowsCellularAccess_1 = + _registerName1("setAllowsCellularAccess:"); + late final _sel_setAllowsExpensiveNetworkAccess_1 = + _registerName1("setAllowsExpensiveNetworkAccess:"); + late final _sel_setAllowsConstrainedNetworkAccess_1 = + _registerName1("setAllowsConstrainedNetworkAccess:"); + late final _sel_setAssumesHTTP3Capable_1 = + _registerName1("setAssumesHTTP3Capable:"); + late final _sel_setAttribution_1 = _registerName1("setAttribution:"); + void _objc_msgSend_891( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_891( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_891Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_891 = __objc_msgSend_891Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_setHTTPMethod_1 = _registerName1("setHTTPMethod:"); + late final _sel_setAllHTTPHeaderFields_1 = + _registerName1("setAllHTTPHeaderFields:"); + late final _sel_setValue_forHTTPHeaderField_1 = + _registerName1("setValue:forHTTPHeaderField:"); + late final _sel_addValue_forHTTPHeaderField_1 = + _registerName1("addValue:forHTTPHeaderField:"); + late final _sel_setHTTPBody_1 = _registerName1("setHTTPBody:"); + void _objc_msgSend_892( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_892( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_892Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_892 = __objc_msgSend_892Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setHTTPBodyStream_1 = _registerName1("setHTTPBodyStream:"); + void _objc_msgSend_893( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_893( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_893Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_893 = __objc_msgSend_893Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setHTTPShouldHandleCookies_1 = + _registerName1("setHTTPShouldHandleCookies:"); + late final _sel_setHTTPShouldUsePipelining_1 = + _registerName1("setHTTPShouldUsePipelining:"); + late final _sel_setProperty_forKey_inRequest_1 = + _registerName1("setProperty:forKey:inRequest:"); + void _objc_msgSend_894( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ffi.Pointer key, + ffi.Pointer request, + ) { + return __objc_msgSend_894( + obj, + sel, + value, + key, + request, + ); + } + + late final __objc_msgSend_894Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_894 = __objc_msgSend_894Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removePropertyForKey_inRequest_1 = + _registerName1("removePropertyForKey:inRequest:"); + void _objc_msgSend_895( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ffi.Pointer request, + ) { + return __objc_msgSend_895( + obj, + sel, + key, + request, + ); + } + + late final __objc_msgSend_895Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_895 = __objc_msgSend_895Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_registerClass_1 = _registerName1("registerClass:"); + late final _sel_unregisterClass_1 = _registerName1("unregisterClass:"); + late final _sel_canInitWithTask_1 = _registerName1("canInitWithTask:"); + bool _objc_msgSend_896( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer task, + ) { + return __objc_msgSend_896( + obj, + sel, + task, + ); + } + + late final __objc_msgSend_896Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_896 = __objc_msgSend_896Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithTask_cachedResponse_client_1 = + _registerName1("initWithTask:cachedResponse:client:"); + instancetype _objc_msgSend_897( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer task, + ffi.Pointer cachedResponse, + ffi.Pointer client, + ) { + return __objc_msgSend_897( + obj, + sel, + task, + cachedResponse, + client, + ); + } + + late final __objc_msgSend_897Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_897 = __objc_msgSend_897Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_task1 = _registerName1("task"); + ffi.Pointer _objc_msgSend_898( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_898( + obj, + sel, + ); + } + + late final __objc_msgSend_898Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_898 = __objc_msgSend_898Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSXMLParser1 = _getClass1("NSXMLParser"); + late final _sel_initWithStream_1 = _registerName1("initWithStream:"); + instancetype _objc_msgSend_899( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer stream, + ) { + return __objc_msgSend_899( + obj, + sel, + stream, + ); + } + + late final __objc_msgSend_899Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_899 = __objc_msgSend_899Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_shouldProcessNamespaces1 = + _registerName1("shouldProcessNamespaces"); + late final _sel_setShouldProcessNamespaces_1 = + _registerName1("setShouldProcessNamespaces:"); + late final _sel_shouldReportNamespacePrefixes1 = + _registerName1("shouldReportNamespacePrefixes"); + late final _sel_setShouldReportNamespacePrefixes_1 = + _registerName1("setShouldReportNamespacePrefixes:"); + late final _sel_externalEntityResolvingPolicy1 = + _registerName1("externalEntityResolvingPolicy"); + int _objc_msgSend_900( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_900( + obj, + sel, + ); + } + + late final __objc_msgSend_900Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_900 = __objc_msgSend_900Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setExternalEntityResolvingPolicy_1 = + _registerName1("setExternalEntityResolvingPolicy:"); + void _objc_msgSend_901( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_901( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_901Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_901 = __objc_msgSend_901Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_allowedExternalEntityURLs1 = + _registerName1("allowedExternalEntityURLs"); + late final _sel_setAllowedExternalEntityURLs_1 = + _registerName1("setAllowedExternalEntityURLs:"); + void _objc_msgSend_902( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_902( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_902Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_902 = __objc_msgSend_902Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_parse1 = _registerName1("parse"); + late final _sel_abortParsing1 = _registerName1("abortParsing"); + late final _sel_parserError1 = _registerName1("parserError"); + late final _sel_shouldResolveExternalEntities1 = + _registerName1("shouldResolveExternalEntities"); + late final _sel_setShouldResolveExternalEntities_1 = + _registerName1("setShouldResolveExternalEntities:"); + late final _sel_publicID1 = _registerName1("publicID"); + late final _sel_systemID1 = _registerName1("systemID"); + late final _sel_lineNumber1 = _registerName1("lineNumber"); + late final _sel_columnNumber1 = _registerName1("columnNumber"); + late final _class_NSFileWrapper1 = _getClass1("NSFileWrapper"); + late final _sel_initWithURL_options_error_1 = + _registerName1("initWithURL:options:error:"); + instancetype _objc_msgSend_903( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int options, + ffi.Pointer> outError, + ) { + return __objc_msgSend_903( + obj, + sel, + url, + options, + outError, + ); + } + + late final __objc_msgSend_903Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_903 = __objc_msgSend_903Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_initDirectoryWithFileWrappers_1 = + _registerName1("initDirectoryWithFileWrappers:"); + late final _sel_initRegularFileWithContents_1 = + _registerName1("initRegularFileWithContents:"); + late final _sel_initSymbolicLinkWithDestinationURL_1 = + _registerName1("initSymbolicLinkWithDestinationURL:"); + late final _sel_initWithSerializedRepresentation_1 = + _registerName1("initWithSerializedRepresentation:"); + late final _sel_isDirectory1 = _registerName1("isDirectory"); + late final _sel_isRegularFile1 = _registerName1("isRegularFile"); + late final _sel_isSymbolicLink1 = _registerName1("isSymbolicLink"); + late final _sel_preferredFilename1 = _registerName1("preferredFilename"); + late final _sel_setPreferredFilename_1 = + _registerName1("setPreferredFilename:"); + late final _sel_filename1 = _registerName1("filename"); + late final _sel_setFilename_1 = _registerName1("setFilename:"); + late final _sel_fileAttributes1 = _registerName1("fileAttributes"); + late final _sel_setFileAttributes_1 = _registerName1("setFileAttributes:"); + late final _sel_matchesContentsOfURL_1 = + _registerName1("matchesContentsOfURL:"); + late final _sel_readFromURL_options_error_1 = + _registerName1("readFromURL:options:error:"); + bool _objc_msgSend_904( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int options, + ffi.Pointer> outError, + ) { + return __objc_msgSend_904( + obj, + sel, + url, + options, + outError, + ); + } + + late final __objc_msgSend_904Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_904 = __objc_msgSend_904Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_writeToURL_options_originalContentsURL_error_1 = + _registerName1("writeToURL:options:originalContentsURL:error:"); + bool _objc_msgSend_905( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int options, + ffi.Pointer originalContentsURL, + ffi.Pointer> outError, + ) { + return __objc_msgSend_905( + obj, + sel, + url, + options, + originalContentsURL, + outError, + ); + } + + late final __objc_msgSend_905Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_905 = __objc_msgSend_905Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_serializedRepresentation1 = + _registerName1("serializedRepresentation"); + late final _sel_addFileWrapper_1 = _registerName1("addFileWrapper:"); + ffi.Pointer _objc_msgSend_906( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer child, + ) { + return __objc_msgSend_906( + obj, + sel, + child, + ); + } + + late final __objc_msgSend_906Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_906 = __objc_msgSend_906Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_addRegularFileWithContents_preferredFilename_1 = + _registerName1("addRegularFileWithContents:preferredFilename:"); + ffi.Pointer _objc_msgSend_907( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ffi.Pointer fileName, + ) { + return __objc_msgSend_907( + obj, + sel, + data, + fileName, + ); + } + + late final __objc_msgSend_907Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_907 = __objc_msgSend_907Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeFileWrapper_1 = _registerName1("removeFileWrapper:"); + void _objc_msgSend_908( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer child, + ) { + return __objc_msgSend_908( + obj, + sel, + child, + ); + } + + late final __objc_msgSend_908Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_908 = __objc_msgSend_908Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_fileWrappers1 = _registerName1("fileWrappers"); + late final _sel_keyForFileWrapper_1 = _registerName1("keyForFileWrapper:"); + late final _sel_regularFileContents1 = _registerName1("regularFileContents"); + late final _sel_symbolicLinkDestinationURL1 = + _registerName1("symbolicLinkDestinationURL"); + late final _sel_initSymbolicLinkWithDestination_1 = + _registerName1("initSymbolicLinkWithDestination:"); + late final _sel_needsToBeUpdatedFromPath_1 = + _registerName1("needsToBeUpdatedFromPath:"); + late final _sel_updateFromPath_1 = _registerName1("updateFromPath:"); + late final _sel_writeToFile_atomically_updateFilenames_1 = + _registerName1("writeToFile:atomically:updateFilenames:"); + bool _objc_msgSend_909( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool atomicFlag, + bool updateFilenamesFlag, + ) { + return __objc_msgSend_909( + obj, + sel, + path, + atomicFlag, + updateFilenamesFlag, + ); + } + + late final __objc_msgSend_909Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_909 = __objc_msgSend_909Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool, bool)>(); + + late final _sel_addFileWithPath_1 = _registerName1("addFileWithPath:"); + late final _sel_addSymbolicLinkWithDestination_preferredFilename_1 = + _registerName1("addSymbolicLinkWithDestination:preferredFilename:"); + late final _sel_symbolicLinkDestination1 = + _registerName1("symbolicLinkDestination"); + late final _class_NSURLSession1 = _getClass1("NSURLSession"); + late final _sel_sharedSession1 = _registerName1("sharedSession"); + ffi.Pointer _objc_msgSend_910( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_910( + obj, + sel, + ); + } + + late final __objc_msgSend_910Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_910 = __objc_msgSend_910Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSURLSessionConfiguration1 = + _getClass1("NSURLSessionConfiguration"); + late final _sel_defaultSessionConfiguration1 = + _registerName1("defaultSessionConfiguration"); + ffi.Pointer _objc_msgSend_911( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_911( + obj, + sel, + ); + } + + late final __objc_msgSend_911Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_911 = __objc_msgSend_911Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_ephemeralSessionConfiguration1 = + _registerName1("ephemeralSessionConfiguration"); + late final _sel_backgroundSessionConfigurationWithIdentifier_1 = + _registerName1("backgroundSessionConfigurationWithIdentifier:"); + ffi.Pointer _objc_msgSend_912( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer identifier, + ) { + return __objc_msgSend_912( + obj, + sel, + identifier, + ); + } + + late final __objc_msgSend_912Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_912 = __objc_msgSend_912Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_identifier1 = _registerName1("identifier"); + late final _sel_requestCachePolicy1 = _registerName1("requestCachePolicy"); + late final _sel_setRequestCachePolicy_1 = + _registerName1("setRequestCachePolicy:"); + late final _sel_timeoutIntervalForRequest1 = + _registerName1("timeoutIntervalForRequest"); + late final _sel_setTimeoutIntervalForRequest_1 = + _registerName1("setTimeoutIntervalForRequest:"); + late final _sel_timeoutIntervalForResource1 = + _registerName1("timeoutIntervalForResource"); + late final _sel_setTimeoutIntervalForResource_1 = + _registerName1("setTimeoutIntervalForResource:"); + late final _sel_waitsForConnectivity1 = + _registerName1("waitsForConnectivity"); + late final _sel_setWaitsForConnectivity_1 = + _registerName1("setWaitsForConnectivity:"); + late final _sel_isDiscretionary1 = _registerName1("isDiscretionary"); + late final _sel_setDiscretionary_1 = _registerName1("setDiscretionary:"); + late final _sel_sharedContainerIdentifier1 = + _registerName1("sharedContainerIdentifier"); + late final _sel_setSharedContainerIdentifier_1 = + _registerName1("setSharedContainerIdentifier:"); + late final _sel_sessionSendsLaunchEvents1 = + _registerName1("sessionSendsLaunchEvents"); + late final _sel_setSessionSendsLaunchEvents_1 = + _registerName1("setSessionSendsLaunchEvents:"); + late final _sel_connectionProxyDictionary1 = + _registerName1("connectionProxyDictionary"); + late final _sel_setConnectionProxyDictionary_1 = + _registerName1("setConnectionProxyDictionary:"); + late final _sel_TLSMinimumSupportedProtocol1 = + _registerName1("TLSMinimumSupportedProtocol"); + int _objc_msgSend_913( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_913( + obj, + sel, + ); + } + + late final __objc_msgSend_913Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_913 = __objc_msgSend_913Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setTLSMinimumSupportedProtocol_1 = + _registerName1("setTLSMinimumSupportedProtocol:"); + void _objc_msgSend_914( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_914( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_914Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_914 = __objc_msgSend_914Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_TLSMaximumSupportedProtocol1 = + _registerName1("TLSMaximumSupportedProtocol"); + late final _sel_setTLSMaximumSupportedProtocol_1 = + _registerName1("setTLSMaximumSupportedProtocol:"); + late final _sel_TLSMinimumSupportedProtocolVersion1 = + _registerName1("TLSMinimumSupportedProtocolVersion"); + int _objc_msgSend_915( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_915( + obj, + sel, + ); + } + + late final __objc_msgSend_915Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_915 = __objc_msgSend_915Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setTLSMinimumSupportedProtocolVersion_1 = + _registerName1("setTLSMinimumSupportedProtocolVersion:"); + void _objc_msgSend_916( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_916( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_916Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_916 = __objc_msgSend_916Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_TLSMaximumSupportedProtocolVersion1 = + _registerName1("TLSMaximumSupportedProtocolVersion"); + late final _sel_setTLSMaximumSupportedProtocolVersion_1 = + _registerName1("setTLSMaximumSupportedProtocolVersion:"); + late final _sel_HTTPShouldSetCookies1 = + _registerName1("HTTPShouldSetCookies"); + late final _sel_setHTTPShouldSetCookies_1 = + _registerName1("setHTTPShouldSetCookies:"); + late final _sel_HTTPCookieAcceptPolicy1 = + _registerName1("HTTPCookieAcceptPolicy"); + late final _sel_setHTTPCookieAcceptPolicy_1 = + _registerName1("setHTTPCookieAcceptPolicy:"); + late final _sel_HTTPAdditionalHeaders1 = + _registerName1("HTTPAdditionalHeaders"); + late final _sel_setHTTPAdditionalHeaders_1 = + _registerName1("setHTTPAdditionalHeaders:"); + late final _sel_HTTPMaximumConnectionsPerHost1 = + _registerName1("HTTPMaximumConnectionsPerHost"); + late final _sel_setHTTPMaximumConnectionsPerHost_1 = + _registerName1("setHTTPMaximumConnectionsPerHost:"); + late final _sel_HTTPCookieStorage1 = _registerName1("HTTPCookieStorage"); + late final _sel_setHTTPCookieStorage_1 = + _registerName1("setHTTPCookieStorage:"); + void _objc_msgSend_917( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_917( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_917Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_917 = __objc_msgSend_917Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLCredentialStorage1 = + _registerName1("URLCredentialStorage"); + late final _sel_setURLCredentialStorage_1 = + _registerName1("setURLCredentialStorage:"); + void _objc_msgSend_918( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_918( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_918Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_918 = __objc_msgSend_918Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLCache1 = _registerName1("URLCache"); + late final _sel_setURLCache_1 = _registerName1("setURLCache:"); + late final _sel_shouldUseExtendedBackgroundIdleMode1 = + _registerName1("shouldUseExtendedBackgroundIdleMode"); + late final _sel_setShouldUseExtendedBackgroundIdleMode_1 = + _registerName1("setShouldUseExtendedBackgroundIdleMode:"); + late final _sel_protocolClasses1 = _registerName1("protocolClasses"); + late final _sel_setProtocolClasses_1 = _registerName1("setProtocolClasses:"); + late final _sel_multipathServiceType1 = + _registerName1("multipathServiceType"); + int _objc_msgSend_919( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_919( + obj, + sel, + ); + } + + late final __objc_msgSend_919Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_919 = __objc_msgSend_919Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setMultipathServiceType_1 = + _registerName1("setMultipathServiceType:"); + void _objc_msgSend_920( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_920( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_920Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_920 = __objc_msgSend_920Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_backgroundSessionConfiguration_1 = + _registerName1("backgroundSessionConfiguration:"); + late final _sel_sessionWithConfiguration_1 = + _registerName1("sessionWithConfiguration:"); + ffi.Pointer _objc_msgSend_921( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer configuration, + ) { + return __objc_msgSend_921( + obj, + sel, + configuration, + ); + } + + late final __objc_msgSend_921Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_921 = __objc_msgSend_921Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_sessionWithConfiguration_delegate_delegateQueue_1 = + _registerName1("sessionWithConfiguration:delegate:delegateQueue:"); + ffi.Pointer _objc_msgSend_922( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer configuration, + ffi.Pointer delegate, + ffi.Pointer queue, + ) { + return __objc_msgSend_922( + obj, + sel, + configuration, + delegate, + queue, + ); + } + + late final __objc_msgSend_922Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_922 = __objc_msgSend_922Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_delegateQueue1 = _registerName1("delegateQueue"); + late final _sel_configuration1 = _registerName1("configuration"); + late final _sel_sessionDescription1 = _registerName1("sessionDescription"); + late final _sel_setSessionDescription_1 = + _registerName1("setSessionDescription:"); + late final _sel_finishTasksAndInvalidate1 = + _registerName1("finishTasksAndInvalidate"); + late final _sel_invalidateAndCancel1 = _registerName1("invalidateAndCancel"); + late final _sel_resetWithCompletionHandler_1 = + _registerName1("resetWithCompletionHandler:"); + late final _sel_flushWithCompletionHandler_1 = + _registerName1("flushWithCompletionHandler:"); + late final _sel_getTasksWithCompletionHandler_1 = + _registerName1("getTasksWithCompletionHandler:"); + void _objc_msgSend_923( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_923( + obj, + sel, + completionHandler, + ); + } + + late final __objc_msgSend_923Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_923 = __objc_msgSend_923Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_getAllTasksWithCompletionHandler_1 = + _registerName1("getAllTasksWithCompletionHandler:"); + void _objc_msgSend_924( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_924( + obj, + sel, + completionHandler, + ); + } + + late final __objc_msgSend_924Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_924 = __objc_msgSend_924Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_dataTaskWithRequest_1 = + _registerName1("dataTaskWithRequest:"); + ffi.Pointer _objc_msgSend_925( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_925( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_925Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_925 = __objc_msgSend_925Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_dataTaskWithURL_1 = _registerName1("dataTaskWithURL:"); + ffi.Pointer _objc_msgSend_926( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ) { + return __objc_msgSend_926( + obj, + sel, + url, + ); + } + + late final __objc_msgSend_926Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_926 = __objc_msgSend_926Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSURLSessionUploadTask1 = + _getClass1("NSURLSessionUploadTask"); + late final _sel_uploadTaskWithRequest_fromFile_1 = + _registerName1("uploadTaskWithRequest:fromFile:"); + ffi.Pointer _objc_msgSend_927( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer fileURL, + ) { + return __objc_msgSend_927( + obj, + sel, + request, + fileURL, + ); + } + + late final __objc_msgSend_927Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_927 = __objc_msgSend_927Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_uploadTaskWithRequest_fromData_1 = + _registerName1("uploadTaskWithRequest:fromData:"); + ffi.Pointer _objc_msgSend_928( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer bodyData, + ) { + return __objc_msgSend_928( + obj, + sel, + request, + bodyData, + ); + } + + late final __objc_msgSend_928Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_928 = __objc_msgSend_928Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_uploadTaskWithStreamedRequest_1 = + _registerName1("uploadTaskWithStreamedRequest:"); + ffi.Pointer _objc_msgSend_929( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_929( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_929Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_929 = __objc_msgSend_929Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSURLSessionDownloadTask1 = + _getClass1("NSURLSessionDownloadTask"); + late final _sel_cancelByProducingResumeData_1 = + _registerName1("cancelByProducingResumeData:"); + void _objc_msgSend_930( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_930( + obj, + sel, + completionHandler, + ); + } + + late final __objc_msgSend_930Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_930 = __objc_msgSend_930Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_downloadTaskWithRequest_1 = + _registerName1("downloadTaskWithRequest:"); + ffi.Pointer _objc_msgSend_931( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_931( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_931Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_931 = __objc_msgSend_931Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_downloadTaskWithURL_1 = + _registerName1("downloadTaskWithURL:"); + ffi.Pointer _objc_msgSend_932( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ) { + return __objc_msgSend_932( + obj, + sel, + url, + ); + } + + late final __objc_msgSend_932Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_932 = __objc_msgSend_932Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_downloadTaskWithResumeData_1 = + _registerName1("downloadTaskWithResumeData:"); + ffi.Pointer _objc_msgSend_933( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer resumeData, + ) { + return __objc_msgSend_933( + obj, + sel, + resumeData, + ); + } + + late final __objc_msgSend_933Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_933 = __objc_msgSend_933Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSURLSessionStreamTask1 = + _getClass1("NSURLSessionStreamTask"); + late final _sel_readDataOfMinLength_maxLength_timeout_completionHandler_1 = + _registerName1( + "readDataOfMinLength:maxLength:timeout:completionHandler:"); + void _objc_msgSend_934( + ffi.Pointer obj, + ffi.Pointer sel, + int minBytes, + int maxBytes, + double timeout, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_934( + obj, + sel, + minBytes, + maxBytes, + timeout, + completionHandler, + ); + } + + late final __objc_msgSend_934Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSUInteger, + NSTimeInterval, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_934 = __objc_msgSend_934Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, int, + double, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_writeData_timeout_completionHandler_1 = + _registerName1("writeData:timeout:completionHandler:"); + void _objc_msgSend_935( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + double timeout, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_935( + obj, + sel, + data, + timeout, + completionHandler, + ); + } + + late final __objc_msgSend_935Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSTimeInterval, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_935 = __objc_msgSend_935Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, double, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_captureStreams1 = _registerName1("captureStreams"); + late final _sel_closeWrite1 = _registerName1("closeWrite"); + late final _sel_closeRead1 = _registerName1("closeRead"); + late final _sel_startSecureConnection1 = + _registerName1("startSecureConnection"); + late final _sel_stopSecureConnection1 = + _registerName1("stopSecureConnection"); + late final _sel_streamTaskWithHostName_port_1 = + _registerName1("streamTaskWithHostName:port:"); + ffi.Pointer _objc_msgSend_936( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer hostname, + int port, + ) { + return __objc_msgSend_936( + obj, + sel, + hostname, + port, + ); + } + + late final __objc_msgSend_936Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger)>>('objc_msgSend'); + late final __objc_msgSend_936 = __objc_msgSend_936Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _class_NSNetService1 = _getClass1("NSNetService"); + late final _sel_initWithDomain_type_name_port_1 = + _registerName1("initWithDomain:type:name:port:"); + instancetype _objc_msgSend_937( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer domain, + ffi.Pointer type, + ffi.Pointer name, + int port, + ) { + return __objc_msgSend_937( + obj, + sel, + domain, + type, + name, + port, + ); + } + + late final __objc_msgSend_937Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int)>>('objc_msgSend'); + late final __objc_msgSend_937 = __objc_msgSend_937Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_initWithDomain_type_name_1 = + _registerName1("initWithDomain:type:name:"); + late final _sel_includesPeerToPeer1 = _registerName1("includesPeerToPeer"); + late final _sel_setIncludesPeerToPeer_1 = + _registerName1("setIncludesPeerToPeer:"); + late final _sel_type1 = _registerName1("type"); + late final _sel_publish1 = _registerName1("publish"); + late final _sel_publishWithOptions_1 = _registerName1("publishWithOptions:"); + void _objc_msgSend_938( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_938( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_938Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_938 = __objc_msgSend_938Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_resolve1 = _registerName1("resolve"); + late final _sel_stop1 = _registerName1("stop"); + late final _sel_dictionaryFromTXTRecordData_1 = + _registerName1("dictionaryFromTXTRecordData:"); + ffi.Pointer _objc_msgSend_939( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer txtData, + ) { + return __objc_msgSend_939( + obj, + sel, + txtData, + ); + } + + late final __objc_msgSend_939Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_939 = __objc_msgSend_939Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_dataFromTXTRecordDictionary_1 = + _registerName1("dataFromTXTRecordDictionary:"); + ffi.Pointer _objc_msgSend_940( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer txtDictionary, + ) { + return __objc_msgSend_940( + obj, + sel, + txtDictionary, + ); + } + + late final __objc_msgSend_940Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_940 = __objc_msgSend_940Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_resolveWithTimeout_1 = _registerName1("resolveWithTimeout:"); + late final _sel_getInputStream_outputStream_1 = + _registerName1("getInputStream:outputStream:"); + bool _objc_msgSend_941( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream, + ) { + return __objc_msgSend_941( + obj, + sel, + inputStream, + outputStream, + ); + } + + late final __objc_msgSend_941Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_941 = __objc_msgSend_941Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_setTXTRecordData_1 = _registerName1("setTXTRecordData:"); + late final _sel_TXTRecordData1 = _registerName1("TXTRecordData"); + late final _sel_startMonitoring1 = _registerName1("startMonitoring"); + late final _sel_stopMonitoring1 = _registerName1("stopMonitoring"); + late final _sel_streamTaskWithNetService_1 = + _registerName1("streamTaskWithNetService:"); + ffi.Pointer _objc_msgSend_942( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer service, + ) { + return __objc_msgSend_942( + obj, + sel, + service, + ); + } + + late final __objc_msgSend_942Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_942 = __objc_msgSend_942Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSURLSessionWebSocketTask1 = + _getClass1("NSURLSessionWebSocketTask"); + late final _class_NSURLSessionWebSocketMessage1 = + _getClass1("NSURLSessionWebSocketMessage"); + int _objc_msgSend_943( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_943( + obj, + sel, + ); + } + + late final __objc_msgSend_943Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_943 = __objc_msgSend_943Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_sendMessage_completionHandler_1 = + _registerName1("sendMessage:completionHandler:"); + void _objc_msgSend_944( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer message, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_944( + obj, + sel, + message, + completionHandler, + ); + } + + late final __objc_msgSend_944Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_944 = __objc_msgSend_944Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_receiveMessageWithCompletionHandler_1 = + _registerName1("receiveMessageWithCompletionHandler:"); + void _objc_msgSend_945( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_945( + obj, + sel, + completionHandler, + ); + } + + late final __objc_msgSend_945Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_945 = __objc_msgSend_945Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_sendPingWithPongReceiveHandler_1 = + _registerName1("sendPingWithPongReceiveHandler:"); + void _objc_msgSend_946( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> pongReceiveHandler, + ) { + return __objc_msgSend_946( + obj, + sel, + pongReceiveHandler, + ); + } + + late final __objc_msgSend_946Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_946 = __objc_msgSend_946Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_cancelWithCloseCode_reason_1 = + _registerName1("cancelWithCloseCode:reason:"); + void _objc_msgSend_947( + ffi.Pointer obj, + ffi.Pointer sel, + int closeCode, + ffi.Pointer reason, + ) { + return __objc_msgSend_947( + obj, + sel, + closeCode, + reason, + ); + } + + late final __objc_msgSend_947Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_947 = __objc_msgSend_947Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_maximumMessageSize1 = _registerName1("maximumMessageSize"); + late final _sel_setMaximumMessageSize_1 = + _registerName1("setMaximumMessageSize:"); + late final _sel_closeCode1 = _registerName1("closeCode"); + int _objc_msgSend_948( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_948( + obj, + sel, + ); + } + + late final __objc_msgSend_948Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_948 = __objc_msgSend_948Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_closeReason1 = _registerName1("closeReason"); + late final _sel_webSocketTaskWithURL_1 = + _registerName1("webSocketTaskWithURL:"); + ffi.Pointer _objc_msgSend_949( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ) { + return __objc_msgSend_949( + obj, + sel, + url, + ); + } + + late final __objc_msgSend_949Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_949 = __objc_msgSend_949Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_webSocketTaskWithURL_protocols_1 = + _registerName1("webSocketTaskWithURL:protocols:"); + ffi.Pointer _objc_msgSend_950( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer protocols, + ) { + return __objc_msgSend_950( + obj, + sel, + url, + protocols, + ); + } + + late final __objc_msgSend_950Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_950 = __objc_msgSend_950Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_webSocketTaskWithRequest_1 = + _registerName1("webSocketTaskWithRequest:"); + ffi.Pointer _objc_msgSend_951( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_951( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_951Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_951 = __objc_msgSend_951Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_dataTaskWithRequest_completionHandler_1 = + _registerName1("dataTaskWithRequest:completionHandler:"); + ffi.Pointer _objc_msgSend_952( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_952( + obj, + sel, + request, + completionHandler, + ); + } + + late final __objc_msgSend_952Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_952 = __objc_msgSend_952Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_dataTaskWithURL_completionHandler_1 = + _registerName1("dataTaskWithURL:completionHandler:"); + ffi.Pointer _objc_msgSend_953( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_953( + obj, + sel, + url, + completionHandler, + ); + } + + late final __objc_msgSend_953Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_953 = __objc_msgSend_953Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_uploadTaskWithRequest_fromFile_completionHandler_1 = + _registerName1("uploadTaskWithRequest:fromFile:completionHandler:"); + ffi.Pointer _objc_msgSend_954( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer fileURL, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_954( + obj, + sel, + request, + fileURL, + completionHandler, + ); + } + + late final __objc_msgSend_954Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_954 = __objc_msgSend_954Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_uploadTaskWithRequest_fromData_completionHandler_1 = + _registerName1("uploadTaskWithRequest:fromData:completionHandler:"); + ffi.Pointer _objc_msgSend_955( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer bodyData, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_955( + obj, + sel, + request, + bodyData, + completionHandler, + ); + } + + late final __objc_msgSend_955Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_955 = __objc_msgSend_955Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_downloadTaskWithRequest_completionHandler_1 = + _registerName1("downloadTaskWithRequest:completionHandler:"); + ffi.Pointer _objc_msgSend_956( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_956( + obj, + sel, + request, + completionHandler, + ); + } + + late final __objc_msgSend_956Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_956 = __objc_msgSend_956Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_downloadTaskWithURL_completionHandler_1 = + _registerName1("downloadTaskWithURL:completionHandler:"); + ffi.Pointer _objc_msgSend_957( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_957( + obj, + sel, + url, + completionHandler, + ); + } + + late final __objc_msgSend_957Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_957 = __objc_msgSend_957Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_downloadTaskWithResumeData_completionHandler_1 = + _registerName1("downloadTaskWithResumeData:completionHandler:"); + ffi.Pointer _objc_msgSend_958( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer resumeData, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_958( + obj, + sel, + resumeData, + completionHandler, + ); + } + + late final __objc_msgSend_958Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_958 = __objc_msgSend_958Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _class_NSProtocolChecker1 = _getClass1("NSProtocolChecker"); + ffi.Pointer _objc_msgSend_959( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_959( + obj, + sel, + ); + } + + late final __objc_msgSend_959Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_959 = __objc_msgSend_959Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_protocolCheckerWithTarget_protocol_1 = + _registerName1("protocolCheckerWithTarget:protocol:"); + instancetype _objc_msgSend_960( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ffi.Pointer aProtocol, + ) { + return __objc_msgSend_960( + obj, + sel, + anObject, + aProtocol, + ); + } + + late final __objc_msgSend_960Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_960 = __objc_msgSend_960Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithTarget_protocol_1 = + _registerName1("initWithTarget:protocol:"); + late final _class_NSTask1 = _getClass1("NSTask"); + late final _sel_setExecutableURL_1 = _registerName1("setExecutableURL:"); + late final _sel_setEnvironment_1 = _registerName1("setEnvironment:"); + late final _sel_currentDirectoryURL1 = _registerName1("currentDirectoryURL"); + late final _sel_setCurrentDirectoryURL_1 = + _registerName1("setCurrentDirectoryURL:"); + late final _sel_standardInput1 = _registerName1("standardInput"); + late final _sel_setStandardInput_1 = _registerName1("setStandardInput:"); + late final _sel_standardOutput1 = _registerName1("standardOutput"); + late final _sel_setStandardOutput_1 = _registerName1("setStandardOutput:"); + late final _sel_standardError1 = _registerName1("standardError"); + late final _sel_setStandardError_1 = _registerName1("setStandardError:"); + late final _sel_launchAndReturnError_1 = + _registerName1("launchAndReturnError:"); + late final _sel_interrupt1 = _registerName1("interrupt"); + late final _sel_terminate1 = _registerName1("terminate"); + late final _sel_isRunning1 = _registerName1("isRunning"); + late final _sel_terminationStatus1 = _registerName1("terminationStatus"); + late final _sel_terminationReason1 = _registerName1("terminationReason"); + int _objc_msgSend_961( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_961( + obj, + sel, + ); + } + + late final __objc_msgSend_961Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_961 = __objc_msgSend_961Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_terminationHandler1 = _registerName1("terminationHandler"); + ffi.Pointer<_ObjCBlock> _objc_msgSend_962( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_962( + obj, + sel, + ); + } + + late final __objc_msgSend_962Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_962 = __objc_msgSend_962Ptr.asFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setTerminationHandler_1 = + _registerName1("setTerminationHandler:"); + void _objc_msgSend_963( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> value, + ) { + return __objc_msgSend_963( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_963Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_963 = __objc_msgSend_963Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_launchedTaskWithExecutableURL_arguments_error_terminationHandler_1 = + _registerName1( + "launchedTaskWithExecutableURL:arguments:error:terminationHandler:"); + ffi.Pointer _objc_msgSend_964( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer arguments, + ffi.Pointer> error, + ffi.Pointer<_ObjCBlock> terminationHandler, + ) { + return __objc_msgSend_964( + obj, + sel, + url, + arguments, + error, + terminationHandler, + ); + } + + late final __objc_msgSend_964Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_964 = __objc_msgSend_964Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_waitUntilExit1 = _registerName1("waitUntilExit"); + late final _sel_launchPath1 = _registerName1("launchPath"); + late final _sel_setLaunchPath_1 = _registerName1("setLaunchPath:"); + late final _sel_setCurrentDirectoryPath_1 = + _registerName1("setCurrentDirectoryPath:"); + late final _sel_launch1 = _registerName1("launch"); + late final _sel_launchedTaskWithLaunchPath_arguments_1 = + _registerName1("launchedTaskWithLaunchPath:arguments:"); + ffi.Pointer _objc_msgSend_965( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer arguments, + ) { + return __objc_msgSend_965( + obj, + sel, + path, + arguments, + ); + } + + late final __objc_msgSend_965Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_965 = __objc_msgSend_965Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSXMLElement1 = _getClass1("NSXMLElement"); + late final _class_NSXMLNode1 = _getClass1("NSXMLNode"); + late final _sel_initWithKind_1 = _registerName1("initWithKind:"); + instancetype _objc_msgSend_966( + ffi.Pointer obj, + ffi.Pointer sel, + int kind, + ) { + return __objc_msgSend_966( + obj, + sel, + kind, + ); + } + + late final __objc_msgSend_966Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_966 = __objc_msgSend_966Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithKind_options_1 = + _registerName1("initWithKind:options:"); + instancetype _objc_msgSend_967( + ffi.Pointer obj, + ffi.Pointer sel, + int kind, + int options, + ) { + return __objc_msgSend_967( + obj, + sel, + kind, + options, + ); + } + + late final __objc_msgSend_967Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_967 = __objc_msgSend_967Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int, int)>(); + + late final _sel_document1 = _registerName1("document"); + late final _sel_documentWithRootElement_1 = + _registerName1("documentWithRootElement:"); + ffi.Pointer _objc_msgSend_968( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer element, + ) { + return __objc_msgSend_968( + obj, + sel, + element, + ); + } + + late final __objc_msgSend_968Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_968 = __objc_msgSend_968Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_elementWithName_1 = _registerName1("elementWithName:"); + late final _sel_elementWithName_URI_1 = + _registerName1("elementWithName:URI:"); + late final _sel_elementWithName_stringValue_1 = + _registerName1("elementWithName:stringValue:"); + late final _sel_elementWithName_children_attributes_1 = + _registerName1("elementWithName:children:attributes:"); + ffi.Pointer _objc_msgSend_969( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer children, + ffi.Pointer attributes, + ) { + return __objc_msgSend_969( + obj, + sel, + name, + children, + attributes, + ); + } + + late final __objc_msgSend_969Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_969 = __objc_msgSend_969Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_attributeWithName_stringValue_1 = + _registerName1("attributeWithName:stringValue:"); + late final _sel_attributeWithName_URI_stringValue_1 = + _registerName1("attributeWithName:URI:stringValue:"); + late final _sel_namespaceWithName_stringValue_1 = + _registerName1("namespaceWithName:stringValue:"); + late final _sel_processingInstructionWithName_stringValue_1 = + _registerName1("processingInstructionWithName:stringValue:"); + late final _sel_commentWithStringValue_1 = + _registerName1("commentWithStringValue:"); + late final _sel_textWithStringValue_1 = + _registerName1("textWithStringValue:"); + late final _sel_DTDNodeWithXMLString_1 = + _registerName1("DTDNodeWithXMLString:"); + late final _sel_kind1 = _registerName1("kind"); + int _objc_msgSend_970( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_970( + obj, + sel, + ); + } + + late final __objc_msgSend_970Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_970 = __objc_msgSend_970Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_objectValue1 = _registerName1("objectValue"); + late final _sel_setObjectValue_1 = _registerName1("setObjectValue:"); + late final _sel_setStringValue_1 = _registerName1("setStringValue:"); + late final _sel_setStringValue_resolvingEntities_1 = + _registerName1("setStringValue:resolvingEntities:"); + void _objc_msgSend_971( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + bool resolve, + ) { + return __objc_msgSend_971( + obj, + sel, + string, + resolve, + ); + } + + late final __objc_msgSend_971Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_971 = __objc_msgSend_971Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_index1 = _registerName1("index"); + late final _sel_level1 = _registerName1("level"); + late final _class_NSXMLDocument1 = _getClass1("NSXMLDocument"); + late final _sel_initWithXMLString_options_error_1 = + _registerName1("initWithXMLString:options:error:"); + instancetype _objc_msgSend_972( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int mask, + ffi.Pointer> error, + ) { + return __objc_msgSend_972( + obj, + sel, + string, + mask, + error, + ); + } + + late final __objc_msgSend_972Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_972 = __objc_msgSend_972Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + instancetype _objc_msgSend_973( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int mask, + ffi.Pointer> error, + ) { + return __objc_msgSend_973( + obj, + sel, + url, + mask, + error, + ); + } + + late final __objc_msgSend_973Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_973 = __objc_msgSend_973Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_initWithData_options_error_1 = + _registerName1("initWithData:options:error:"); + instancetype _objc_msgSend_974( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + int mask, + ffi.Pointer> error, + ) { + return __objc_msgSend_974( + obj, + sel, + data, + mask, + error, + ); + } + + late final __objc_msgSend_974Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_974 = __objc_msgSend_974Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_initWithRootElement_1 = + _registerName1("initWithRootElement:"); + late final _sel_replacementClassForClass_1 = + _registerName1("replacementClassForClass:"); + late final _sel_characterEncoding1 = _registerName1("characterEncoding"); + late final _sel_setCharacterEncoding_1 = + _registerName1("setCharacterEncoding:"); + late final _sel_isStandalone1 = _registerName1("isStandalone"); + late final _sel_setStandalone_1 = _registerName1("setStandalone:"); + late final _sel_documentContentKind1 = _registerName1("documentContentKind"); + int _objc_msgSend_975( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_975( + obj, + sel, + ); + } + + late final __objc_msgSend_975Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_975 = __objc_msgSend_975Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setDocumentContentKind_1 = + _registerName1("setDocumentContentKind:"); + void _objc_msgSend_976( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_976( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_976Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_976 = __objc_msgSend_976Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_setMIMEType_1 = _registerName1("setMIMEType:"); + late final _class_NSXMLDTD1 = _getClass1("NSXMLDTD"); + late final _sel_setPublicID_1 = _registerName1("setPublicID:"); + late final _sel_setSystemID_1 = _registerName1("setSystemID:"); + late final _sel_insertChild_atIndex_1 = + _registerName1("insertChild:atIndex:"); + void _objc_msgSend_977( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer child, + int index, + ) { + return __objc_msgSend_977( + obj, + sel, + child, + index, + ); + } + + late final __objc_msgSend_977Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_977 = __objc_msgSend_977Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_insertChildren_atIndex_1 = + _registerName1("insertChildren:atIndex:"); + void _objc_msgSend_978( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer children, + int index, + ) { + return __objc_msgSend_978( + obj, + sel, + children, + index, + ); + } + + late final __objc_msgSend_978Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_978 = __objc_msgSend_978Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_removeChildAtIndex_1 = _registerName1("removeChildAtIndex:"); + late final _sel_setChildren_1 = _registerName1("setChildren:"); + late final _sel_addChild_1 = _registerName1("addChild:"); + void _objc_msgSend_979( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer child, + ) { + return __objc_msgSend_979( + obj, + sel, + child, + ); + } + + late final __objc_msgSend_979Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_979 = __objc_msgSend_979Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_replaceChildAtIndex_withNode_1 = + _registerName1("replaceChildAtIndex:withNode:"); + void _objc_msgSend_980( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer node, + ) { + return __objc_msgSend_980( + obj, + sel, + index, + node, + ); + } + + late final __objc_msgSend_980Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_980 = __objc_msgSend_980Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _class_NSXMLDTDNode1 = _getClass1("NSXMLDTDNode"); + late final _sel_initWithXMLString_1 = _registerName1("initWithXMLString:"); + late final _sel_DTDKind1 = _registerName1("DTDKind"); + int _objc_msgSend_981( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_981( + obj, + sel, + ); + } + + late final __objc_msgSend_981Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_981 = __objc_msgSend_981Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setDTDKind_1 = _registerName1("setDTDKind:"); + void _objc_msgSend_982( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_982( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_982Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_982 = __objc_msgSend_982Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_isExternal1 = _registerName1("isExternal"); + late final _sel_notationName1 = _registerName1("notationName"); + late final _sel_setNotationName_1 = _registerName1("setNotationName:"); + late final _sel_localNameForName_1 = _registerName1("localNameForName:"); + late final _sel_prefixForName_1 = _registerName1("prefixForName:"); + late final _sel_predefinedNamespaceForPrefix_1 = + _registerName1("predefinedNamespaceForPrefix:"); + ffi.Pointer _objc_msgSend_983( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ) { + return __objc_msgSend_983( + obj, + sel, + name, + ); + } + + late final __objc_msgSend_983Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_983 = __objc_msgSend_983Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_entityDeclarationForName_1 = + _registerName1("entityDeclarationForName:"); + ffi.Pointer _objc_msgSend_984( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ) { + return __objc_msgSend_984( + obj, + sel, + name, + ); + } + + late final __objc_msgSend_984Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_984 = __objc_msgSend_984Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_notationDeclarationForName_1 = + _registerName1("notationDeclarationForName:"); + late final _sel_elementDeclarationForName_1 = + _registerName1("elementDeclarationForName:"); + late final _sel_attributeDeclarationForName_elementName_1 = + _registerName1("attributeDeclarationForName:elementName:"); + ffi.Pointer _objc_msgSend_985( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer elementName, + ) { + return __objc_msgSend_985( + obj, + sel, + name, + elementName, + ); + } + + late final __objc_msgSend_985Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_985 = __objc_msgSend_985Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_predefinedEntityDeclarationForName_1 = + _registerName1("predefinedEntityDeclarationForName:"); + late final _sel_DTD1 = _registerName1("DTD"); + ffi.Pointer _objc_msgSend_986( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_986( + obj, + sel, + ); + } + + late final __objc_msgSend_986Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_986 = __objc_msgSend_986Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setDTD_1 = _registerName1("setDTD:"); + void _objc_msgSend_987( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_987( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_987Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_987 = __objc_msgSend_987Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setRootElement_1 = _registerName1("setRootElement:"); + void _objc_msgSend_988( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer root, + ) { + return __objc_msgSend_988( + obj, + sel, + root, + ); + } + + late final __objc_msgSend_988Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_988 = __objc_msgSend_988Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_rootElement1 = _registerName1("rootElement"); + ffi.Pointer _objc_msgSend_989( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_989( + obj, + sel, + ); + } + + late final __objc_msgSend_989Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_989 = __objc_msgSend_989Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_XMLData1 = _registerName1("XMLData"); + late final _sel_XMLDataWithOptions_1 = _registerName1("XMLDataWithOptions:"); + ffi.Pointer _objc_msgSend_990( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_990( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_990Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_990 = __objc_msgSend_990Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_objectByApplyingXSLT_arguments_error_1 = + _registerName1("objectByApplyingXSLT:arguments:error:"); + ffi.Pointer _objc_msgSend_991( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer xslt, + ffi.Pointer arguments, + ffi.Pointer> error, + ) { + return __objc_msgSend_991( + obj, + sel, + xslt, + arguments, + error, + ); + } + + late final __objc_msgSend_991Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_991 = __objc_msgSend_991Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_objectByApplyingXSLTString_arguments_error_1 = + _registerName1("objectByApplyingXSLTString:arguments:error:"); + ffi.Pointer _objc_msgSend_992( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer xslt, + ffi.Pointer arguments, + ffi.Pointer> error, + ) { + return __objc_msgSend_992( + obj, + sel, + xslt, + arguments, + error, + ); + } + + late final __objc_msgSend_992Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_992 = __objc_msgSend_992Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_objectByApplyingXSLTAtURL_arguments_error_1 = + _registerName1("objectByApplyingXSLTAtURL:arguments:error:"); + ffi.Pointer _objc_msgSend_993( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer xsltURL, + ffi.Pointer argument, + ffi.Pointer> error, + ) { + return __objc_msgSend_993( + obj, + sel, + xsltURL, + argument, + error, + ); + } + + late final __objc_msgSend_993Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_993 = __objc_msgSend_993Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_validateAndReturnError_1 = + _registerName1("validateAndReturnError:"); + late final _sel_rootDocument1 = _registerName1("rootDocument"); + ffi.Pointer _objc_msgSend_994( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_994( + obj, + sel, + ); + } + + late final __objc_msgSend_994Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_994 = __objc_msgSend_994Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_parent1 = _registerName1("parent"); + ffi.Pointer _objc_msgSend_995( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_995( + obj, + sel, + ); + } + + late final __objc_msgSend_995Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_995 = __objc_msgSend_995Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_childCount1 = _registerName1("childCount"); + late final _sel_children1 = _registerName1("children"); + late final _sel_childAtIndex_1 = _registerName1("childAtIndex:"); + ffi.Pointer _objc_msgSend_996( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_996( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_996Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('objc_msgSend'); + late final __objc_msgSend_996 = __objc_msgSend_996Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_previousSibling1 = _registerName1("previousSibling"); + late final _sel_nextSibling1 = _registerName1("nextSibling"); + late final _sel_previousNode1 = _registerName1("previousNode"); + late final _sel_nextNode1 = _registerName1("nextNode"); + late final _sel_detach1 = _registerName1("detach"); + late final _sel_XPath1 = _registerName1("XPath"); + late final _sel_localName1 = _registerName1("localName"); + late final _sel_prefix1 = _registerName1("prefix"); + late final _sel_URI1 = _registerName1("URI"); + late final _sel_setURI_1 = _registerName1("setURI:"); + late final _sel_XMLString1 = _registerName1("XMLString"); + late final _sel_XMLStringWithOptions_1 = + _registerName1("XMLStringWithOptions:"); + ffi.Pointer _objc_msgSend_997( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_997( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_997Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_997 = __objc_msgSend_997Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_canonicalXMLStringPreservingComments_1 = + _registerName1("canonicalXMLStringPreservingComments:"); + ffi.Pointer _objc_msgSend_998( + ffi.Pointer obj, + ffi.Pointer sel, + bool comments, + ) { + return __objc_msgSend_998( + obj, + sel, + comments, + ); + } + + late final __objc_msgSend_998Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_998 = __objc_msgSend_998Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_nodesForXPath_error_1 = + _registerName1("nodesForXPath:error:"); + late final _sel_objectsForXQuery_constants_error_1 = + _registerName1("objectsForXQuery:constants:error:"); + ffi.Pointer _objc_msgSend_999( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer xquery, + ffi.Pointer constants, + ffi.Pointer> error, + ) { + return __objc_msgSend_999( + obj, + sel, + xquery, + constants, + error, + ); + } + + late final __objc_msgSend_999Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_999 = __objc_msgSend_999Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_objectsForXQuery_error_1 = + _registerName1("objectsForXQuery:error:"); + late final _sel_initWithName_URI_1 = _registerName1("initWithName:URI:"); + late final _sel_initWithName_stringValue_1 = + _registerName1("initWithName:stringValue:"); + late final _sel_initWithXMLString_error_1 = + _registerName1("initWithXMLString:error:"); + late final _sel_elementsForName_1 = _registerName1("elementsForName:"); + late final _sel_elementsForLocalName_URI_1 = + _registerName1("elementsForLocalName:URI:"); + late final _sel_addAttribute_1 = _registerName1("addAttribute:"); + late final _sel_removeAttributeForName_1 = + _registerName1("removeAttributeForName:"); + late final _sel_attributes1 = _registerName1("attributes"); + late final _sel_setAttributes_1 = _registerName1("setAttributes:"); + late final _sel_setAttributesWithDictionary_1 = + _registerName1("setAttributesWithDictionary:"); + late final _sel_attributeForName_1 = _registerName1("attributeForName:"); + late final _sel_attributeForLocalName_URI_1 = + _registerName1("attributeForLocalName:URI:"); + ffi.Pointer _objc_msgSend_1000( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer localName, + ffi.Pointer URI, + ) { + return __objc_msgSend_1000( + obj, + sel, + localName, + URI, + ); + } + + late final __objc_msgSend_1000Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1000 = __objc_msgSend_1000Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_addNamespace_1 = _registerName1("addNamespace:"); + late final _sel_removeNamespaceForPrefix_1 = + _registerName1("removeNamespaceForPrefix:"); + late final _sel_namespaces1 = _registerName1("namespaces"); + late final _sel_setNamespaces_1 = _registerName1("setNamespaces:"); + late final _sel_namespaceForPrefix_1 = _registerName1("namespaceForPrefix:"); + late final _sel_resolveNamespaceForName_1 = + _registerName1("resolveNamespaceForName:"); + late final _sel_resolvePrefixForNamespaceURI_1 = + _registerName1("resolvePrefixForNamespaceURI:"); + late final _sel_normalizeAdjacentTextNodesPreservingCDATA_1 = + _registerName1("normalizeAdjacentTextNodesPreservingCDATA:"); + late final _sel_setAttributesAsDictionary_1 = + _registerName1("setAttributesAsDictionary:"); + late final _class_SwiftClass1 = _getClass1("swift_module.SwiftClass"); + late final _sel_sayHello1 = _registerName1("sayHello"); + late final _sel_someField1 = _registerName1("someField"); + late final _sel_setSomeField_1 = _registerName1("setSomeField:"); +} + +class _ObjCWrapper implements ffi.Finalizable { + final ffi.Pointer _id; + final SwiftLibrary _lib; + bool _pendingRelease; + + _ObjCWrapper._(this._id, this._lib, + {bool retain = false, bool release = false}) + : _pendingRelease = release { + if (retain) { + _lib._objc_retain(_id.cast()); + } + if (release) { + _lib._objc_releaseFinalizer2.attach(this, _id.cast(), detach: this); + } + } + + /// Releases the reference to the underlying ObjC object held by this wrapper. + /// Throws a StateError if this wrapper doesn't currently hold a reference. + void release() { + if (_pendingRelease) { + _pendingRelease = false; + _lib._objc_release(_id.cast()); + _lib._objc_releaseFinalizer2.detach(this); + } else { + throw StateError( + 'Released an ObjC object that was unowned or already released.'); + } + } + + @override + bool operator ==(Object other) { + return other is _ObjCWrapper && _id == other._id; + } + + @override + int get hashCode => _id.hashCode; +} + +class NSObject extends _ObjCWrapper { + NSObject._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSObject] that points to the same underlying object as [other]. + static NSObject castFrom(T other) { + return NSObject._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSObject] that wraps the given raw object pointer. + static NSObject castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSObject._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSObject]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSObject1); + } + + static void load(SwiftLibrary _lib) { + return _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_load1); + } + + static void initialize(SwiftLibrary _lib) { + return _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_initialize1); + } + + NSObject init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSObject1, _lib._sel_new1); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static NSObject allocWithZone_(SwiftLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static NSObject alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSObject1, _lib._sel_alloc1); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + void dealloc() { + return _lib._objc_msgSend_1(_id, _lib._sel_dealloc1); + } + + void finalize() { + return _lib._objc_msgSend_1(_id, _lib._sel_finalize1); + } + + NSObject copy() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_copy1); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + NSObject mutableCopy() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_mutableCopy1); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static NSObject copyWithZone_(SwiftLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static NSObject mutableCopyWithZone_( + SwiftLibrary _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static bool instancesRespondToSelector_( + SwiftLibrary _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_4(_lib._class_NSObject1, + _lib._sel_instancesRespondToSelector_1, aSelector); + } + + static bool conformsToProtocol_(SwiftLibrary _lib, Protocol? protocol) { + return _lib._objc_msgSend_5(_lib._class_NSObject1, + _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); + } + + IMP methodForSelector_(ffi.Pointer aSelector) { + return _lib._objc_msgSend_6(_id, _lib._sel_methodForSelector_1, aSelector); + } + + static IMP instanceMethodForSelector_( + SwiftLibrary _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_6(_lib._class_NSObject1, + _lib._sel_instanceMethodForSelector_1, aSelector); + } + + void doesNotRecognizeSelector_(ffi.Pointer aSelector) { + return _lib._objc_msgSend_7( + _id, _lib._sel_doesNotRecognizeSelector_1, aSelector); + } + + NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_8( + _id, _lib._sel_forwardingTargetForSelector_1, aSelector); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void forwardInvocation_(NSInvocation? anInvocation) { + return _lib._objc_msgSend_372( + _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); + } + + NSMethodSignature methodSignatureForSelector_( + ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_373( + _id, _lib._sel_methodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib, retain: true, release: true); + } + + static NSMethodSignature instanceMethodSignatureForSelector_( + SwiftLibrary _lib, ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_373(_lib._class_NSObject1, + _lib._sel_instanceMethodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib, retain: true, release: true); + } + + bool allowsWeakReference() { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsWeakReference1); + } + + bool retainWeakReference() { + return _lib._objc_msgSend_12(_id, _lib._sel_retainWeakReference1); + } + + static bool isSubclassOfClass_(SwiftLibrary _lib, NSObject aClass) { + return _lib._objc_msgSend_0( + _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); + } + + static bool resolveClassMethod_(SwiftLibrary _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_4( + _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); + } + + static bool resolveInstanceMethod_( + SwiftLibrary _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_4( + _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); + } + + static int hash(SwiftLibrary _lib) { + return _lib._objc_msgSend_10(_lib._class_NSObject1, _lib._sel_hash1); + } + + static NSObject superclass(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSObject1, _lib._sel_superclass1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject class1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSObject1, _lib._sel_class1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSString description(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_20(_lib._class_NSObject1, _lib._sel_description1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString debugDescription(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_20( + _lib._class_NSObject1, _lib._sel_debugDescription1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static int version(SwiftLibrary _lib) { + return _lib._objc_msgSend_78(_lib._class_NSObject1, _lib._sel_version1); + } + + static void setVersion_(SwiftLibrary _lib, int aVersion) { + return _lib._objc_msgSend_374( + _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); + } + + NSObject get classForCoder { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_classForCoder1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject replacementObjectForCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject awakeAfterUsingCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static void poseAsClass_(SwiftLibrary _lib, NSObject aClass) { + return _lib._objc_msgSend_15( + _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); + } + + NSObject get autoContentAccessingProxy { + final _ret = + _lib._objc_msgSend_2(_id, _lib._sel_autoContentAccessingProxy1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void + attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_( + NSError? error, + int recoveryOptionIndex, + NSObject delegate, + ffi.Pointer didRecoverSelector, + ffi.Pointer contextInfo) { + return _lib._objc_msgSend_375( + _id, + _lib._sel_attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_1, + error?._id ?? ffi.nullptr, + recoveryOptionIndex, + delegate._id, + didRecoverSelector, + contextInfo); + } + + bool attemptRecoveryFromError_optionIndex_( + NSError? error, int recoveryOptionIndex) { + return _lib._objc_msgSend_376( + _id, + _lib._sel_attemptRecoveryFromError_optionIndex_1, + error?._id ?? ffi.nullptr, + recoveryOptionIndex); + } + + void performSelector_withObject_afterDelay_inModes_( + ffi.Pointer aSelector, + NSObject anArgument, + double delay, + NSArray? modes) { + return _lib._objc_msgSend_377( + _id, + _lib._sel_performSelector_withObject_afterDelay_inModes_1, + aSelector, + anArgument._id, + delay, + modes?._id ?? ffi.nullptr); + } + + void performSelector_withObject_afterDelay_( + ffi.Pointer aSelector, NSObject anArgument, double delay) { + return _lib._objc_msgSend_378( + _id, + _lib._sel_performSelector_withObject_afterDelay_1, + aSelector, + anArgument._id, + delay); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSObject1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSObject1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + void URL_resourceDataDidBecomeAvailable_(NSURL? sender, NSData? newBytes) { + return _lib._objc_msgSend_379( + _id, + _lib._sel_URL_resourceDataDidBecomeAvailable_1, + sender?._id ?? ffi.nullptr, + newBytes?._id ?? ffi.nullptr); + } + + void URLResourceDidFinishLoading_(NSURL? sender) { + return _lib._objc_msgSend_380(_id, _lib._sel_URLResourceDidFinishLoading_1, + sender?._id ?? ffi.nullptr); + } + + void URLResourceDidCancelLoading_(NSURL? sender) { + return _lib._objc_msgSend_380(_id, _lib._sel_URLResourceDidCancelLoading_1, + sender?._id ?? ffi.nullptr); + } + + void URL_resourceDidFailLoadingWithReason_(NSURL? sender, NSString? reason) { + return _lib._objc_msgSend_381( + _id, + _lib._sel_URL_resourceDidFailLoadingWithReason_1, + sender?._id ?? ffi.nullptr, + reason?._id ?? ffi.nullptr); + } + + bool fileManager_shouldProceedAfterError_( + NSFileManager? fm, NSDictionary? errorInfo) { + return _lib._objc_msgSend_407( + _id, + _lib._sel_fileManager_shouldProceedAfterError_1, + fm?._id ?? ffi.nullptr, + errorInfo?._id ?? ffi.nullptr); + } + + void fileManager_willProcessPath_(NSFileManager? fm, NSString? path) { + return _lib._objc_msgSend_408(_id, _lib._sel_fileManager_willProcessPath_1, + fm?._id ?? ffi.nullptr, path?._id ?? ffi.nullptr); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSObject1, _lib._sel_accessInstanceVariablesDirectly1); + } + + NSObject valueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_valueForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void setValue_forKey_(NSObject value, NSString? key) { + return _lib._objc_msgSend_122( + _id, _lib._sel_setValue_forKey_1, value._id, key?._id ?? ffi.nullptr); + } + + bool validateValue_forKey_error_(ffi.Pointer> ioValue, + NSString? inKey, ffi.Pointer> outError) { + return _lib._objc_msgSend_220(_id, _lib._sel_validateValue_forKey_error_1, + ioValue, inKey?._id ?? ffi.nullptr, outError); + } + + NSMutableArray mutableArrayValueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_425( + _id, _lib._sel_mutableArrayValueForKey_1, key?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + NSMutableOrderedSet mutableOrderedSetValueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_441( + _id, _lib._sel_mutableOrderedSetValueForKey_1, key?._id ?? ffi.nullptr); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSMutableSet mutableSetValueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_442( + _id, _lib._sel_mutableSetValueForKey_1, key?._id ?? ffi.nullptr); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + NSObject valueForKeyPath_(NSString? keyPath) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_valueForKeyPath_1, keyPath?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void setValue_forKeyPath_(NSObject value, NSString? keyPath) { + return _lib._objc_msgSend_122(_id, _lib._sel_setValue_forKeyPath_1, + value._id, keyPath?._id ?? ffi.nullptr); + } + + bool validateValue_forKeyPath_error_( + ffi.Pointer> ioValue, + NSString? inKeyPath, + ffi.Pointer> outError) { + return _lib._objc_msgSend_220( + _id, + _lib._sel_validateValue_forKeyPath_error_1, + ioValue, + inKeyPath?._id ?? ffi.nullptr, + outError); + } + + NSMutableArray mutableArrayValueForKeyPath_(NSString? keyPath) { + final _ret = _lib._objc_msgSend_425(_id, + _lib._sel_mutableArrayValueForKeyPath_1, keyPath?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + NSMutableOrderedSet mutableOrderedSetValueForKeyPath_(NSString? keyPath) { + final _ret = _lib._objc_msgSend_441( + _id, + _lib._sel_mutableOrderedSetValueForKeyPath_1, + keyPath?._id ?? ffi.nullptr); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSMutableSet mutableSetValueForKeyPath_(NSString? keyPath) { + final _ret = _lib._objc_msgSend_442(_id, + _lib._sel_mutableSetValueForKeyPath_1, keyPath?._id ?? ffi.nullptr); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + NSObject valueForUndefinedKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_valueForUndefinedKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void setValue_forUndefinedKey_(NSObject value, NSString? key) { + return _lib._objc_msgSend_122(_id, _lib._sel_setValue_forUndefinedKey_1, + value._id, key?._id ?? ffi.nullptr); + } + + void setNilValueForKey_(NSString? key) { + return _lib._objc_msgSend_186( + _id, _lib._sel_setNilValueForKey_1, key?._id ?? ffi.nullptr); + } + + NSDictionary dictionaryWithValuesForKeys_(NSArray? keys) { + final _ret = _lib._objc_msgSend_443( + _id, _lib._sel_dictionaryWithValuesForKeys_1, keys?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + void setValuesForKeysWithDictionary_(NSDictionary? keyedValues) { + return _lib._objc_msgSend_444( + _id, + _lib._sel_setValuesForKeysWithDictionary_1, + keyedValues?._id ?? ffi.nullptr); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSObject1, _lib._sel_useStoredAccessor1); + } + + NSObject storedValueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_storedValueForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void takeStoredValue_forKey_(NSObject value, NSString? key) { + return _lib._objc_msgSend_122(_id, _lib._sel_takeStoredValue_forKey_1, + value._id, key?._id ?? ffi.nullptr); + } + + void takeValue_forKey_(NSObject value, NSString? key) { + return _lib._objc_msgSend_122( + _id, _lib._sel_takeValue_forKey_1, value._id, key?._id ?? ffi.nullptr); + } + + void takeValue_forKeyPath_(NSObject value, NSString? keyPath) { + return _lib._objc_msgSend_122(_id, _lib._sel_takeValue_forKeyPath_1, + value._id, keyPath?._id ?? ffi.nullptr); + } + + NSObject handleQueryWithUnboundKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_handleQueryWithUnboundKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void handleTakeValue_forUnboundKey_(NSObject value, NSString? key) { + return _lib._objc_msgSend_122( + _id, + _lib._sel_handleTakeValue_forUnboundKey_1, + value._id, + key?._id ?? ffi.nullptr); + } + + void unableToSetNilForKey_(NSString? key) { + return _lib._objc_msgSend_186( + _id, _lib._sel_unableToSetNilForKey_1, key?._id ?? ffi.nullptr); + } + + NSDictionary valuesForKeys_(NSArray? keys) { + final _ret = _lib._objc_msgSend_443( + _id, _lib._sel_valuesForKeys_1, keys?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + void takeValuesFromDictionary_(NSDictionary? properties) { + return _lib._objc_msgSend_444(_id, _lib._sel_takeValuesFromDictionary_1, + properties?._id ?? ffi.nullptr); + } + + void observeValueForKeyPath_ofObject_change_context_(NSString? keyPath, + NSObject object, NSDictionary? change, ffi.Pointer context) { + return _lib._objc_msgSend_445( + _id, + _lib._sel_observeValueForKeyPath_ofObject_change_context_1, + keyPath?._id ?? ffi.nullptr, + object._id, + change?._id ?? ffi.nullptr, + context); + } + + void addObserver_forKeyPath_options_context_(NSObject? observer, + NSString? keyPath, int options, ffi.Pointer context) { + return _lib._objc_msgSend_126( + _id, + _lib._sel_addObserver_forKeyPath_options_context_1, + observer?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + options, + context); + } + + void removeObserver_forKeyPath_context_( + NSObject? observer, NSString? keyPath, ffi.Pointer context) { + return _lib._objc_msgSend_127( + _id, + _lib._sel_removeObserver_forKeyPath_context_1, + observer?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + context); + } + + void removeObserver_forKeyPath_(NSObject? observer, NSString? keyPath) { + return _lib._objc_msgSend_128(_id, _lib._sel_removeObserver_forKeyPath_1, + observer?._id ?? ffi.nullptr, keyPath?._id ?? ffi.nullptr); + } + + void willChangeValueForKey_(NSString? key) { + return _lib._objc_msgSend_186( + _id, _lib._sel_willChangeValueForKey_1, key?._id ?? ffi.nullptr); + } + + void didChangeValueForKey_(NSString? key) { + return _lib._objc_msgSend_186( + _id, _lib._sel_didChangeValueForKey_1, key?._id ?? ffi.nullptr); + } + + void willChange_valuesAtIndexes_forKey_( + int changeKind, NSIndexSet? indexes, NSString? key) { + return _lib._objc_msgSend_446( + _id, + _lib._sel_willChange_valuesAtIndexes_forKey_1, + changeKind, + indexes?._id ?? ffi.nullptr, + key?._id ?? ffi.nullptr); + } + + void didChange_valuesAtIndexes_forKey_( + int changeKind, NSIndexSet? indexes, NSString? key) { + return _lib._objc_msgSend_446( + _id, + _lib._sel_didChange_valuesAtIndexes_forKey_1, + changeKind, + indexes?._id ?? ffi.nullptr, + key?._id ?? ffi.nullptr); + } + + void willChangeValueForKey_withSetMutation_usingObjects_( + NSString? key, int mutationKind, NSSet? objects) { + return _lib._objc_msgSend_447( + _id, + _lib._sel_willChangeValueForKey_withSetMutation_usingObjects_1, + key?._id ?? ffi.nullptr, + mutationKind, + objects?._id ?? ffi.nullptr); + } + + void didChangeValueForKey_withSetMutation_usingObjects_( + NSString? key, int mutationKind, NSSet? objects) { + return _lib._objc_msgSend_447( + _id, + _lib._sel_didChangeValueForKey_withSetMutation_usingObjects_1, + key?._id ?? ffi.nullptr, + mutationKind, + objects?._id ?? ffi.nullptr); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSObject1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSObject1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + ffi.Pointer get observationInfo { + return _lib._objc_msgSend_19(_id, _lib._sel_observationInfo1); + } + + set observationInfo(ffi.Pointer value) { + _lib._objc_msgSend_448(_id, _lib._sel_setObservationInfo_1, value); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSObject1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + NSObject get classForKeyedArchiver { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_classForKeyedArchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject replacementObjectForKeyedArchiver_(NSKeyedArchiver? archiver) { + final _ret = _lib._objc_msgSend_461( + _id, + _lib._sel_replacementObjectForKeyedArchiver_1, + archiver?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSObject1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void performSelectorOnMainThread_withObject_waitUntilDone_modes_( + ffi.Pointer aSelector, NSObject arg, bool wait, NSArray? array) { + return _lib._objc_msgSend_462( + _id, + _lib._sel_performSelectorOnMainThread_withObject_waitUntilDone_modes_1, + aSelector, + arg._id, + wait, + array?._id ?? ffi.nullptr); + } + + void performSelectorOnMainThread_withObject_waitUntilDone_( + ffi.Pointer aSelector, NSObject arg, bool wait) { + return _lib._objc_msgSend_463( + _id, + _lib._sel_performSelectorOnMainThread_withObject_waitUntilDone_1, + aSelector, + arg._id, + wait); + } + + void performSelector_onThread_withObject_waitUntilDone_modes_( + ffi.Pointer aSelector, + NSThread? thr, + NSObject arg, + bool wait, + NSArray? array) { + return _lib._objc_msgSend_480( + _id, + _lib._sel_performSelector_onThread_withObject_waitUntilDone_modes_1, + aSelector, + thr?._id ?? ffi.nullptr, + arg._id, + wait, + array?._id ?? ffi.nullptr); + } + + void performSelector_onThread_withObject_waitUntilDone_( + ffi.Pointer aSelector, NSThread? thr, NSObject arg, bool wait) { + return _lib._objc_msgSend_481( + _id, + _lib._sel_performSelector_onThread_withObject_waitUntilDone_1, + aSelector, + thr?._id ?? ffi.nullptr, + arg._id, + wait); + } + + void performSelectorInBackground_withObject_( + ffi.Pointer aSelector, NSObject arg) { + return _lib._objc_msgSend_82(_id, + _lib._sel_performSelectorInBackground_withObject_1, aSelector, arg._id); + } + + NSObject get classForArchiver { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_classForArchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject replacementObjectForArchiver_(NSArchiver? archiver) { + final _ret = _lib._objc_msgSend_484(_id, + _lib._sel_replacementObjectForArchiver_1, archiver?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject get classForPortCoder { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_classForPortCoder1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject replacementObjectForPortCoder_(NSPortCoder? coder) { + final _ret = _lib._objc_msgSend_522(_id, + _lib._sel_replacementObjectForPortCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSClassDescription? get classDescription { + final _ret = _lib._objc_msgSend_525(_id, _lib._sel_classDescription1); + return _ret.address == 0 + ? null + : NSClassDescription._(_ret, _lib, retain: true, release: true); + } + + NSArray? get attributeKeys { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_attributeKeys1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get toOneRelationshipKeys { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_toOneRelationshipKeys1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get toManyRelationshipKeys { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_toManyRelationshipKeys1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString inverseForRelationshipKey_(NSString? relationshipKey) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_inverseForRelationshipKey_1, + relationshipKey?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSObject scriptingValueForSpecifier_( + NSScriptObjectSpecifier? objectSpecifier) { + final _ret = _lib._objc_msgSend_569( + _id, + _lib._sel_scriptingValueForSpecifier_1, + objectSpecifier?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get scriptingProperties { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_scriptingProperties1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set scriptingProperties(NSDictionary? value) { + _lib._objc_msgSend_165( + _id, _lib._sel_setScriptingProperties_1, value?._id ?? ffi.nullptr); + } + + NSObject copyScriptingValue_forKey_withProperties_( + NSObject value, NSString? key, NSDictionary? properties) { + final _ret = _lib._objc_msgSend_570( + _id, + _lib._sel_copyScriptingValue_forKey_withProperties_1, + value._id, + key?._id ?? ffi.nullptr, + properties?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + NSObject + newScriptingObjectOfClass_forValueForKey_withContentsValue_properties_( + NSObject objectClass, + NSString? key, + NSObject contentsValue, + NSDictionary? properties) { + final _ret = _lib._objc_msgSend_571( + _id, + _lib._sel_newScriptingObjectOfClass_forValueForKey_withContentsValue_properties_1, + objectClass._id, + key?._id ?? ffi.nullptr, + contentsValue._id, + properties?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + int get classCode { + return _lib._objc_msgSend_191(_id, _lib._sel_classCode1); + } + + NSString? get className { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_className1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSObject valueAtIndex_inPropertyWithKey_(int index, NSString? key) { + final _ret = _lib._objc_msgSend_572( + _id, + _lib._sel_valueAtIndex_inPropertyWithKey_1, + index, + key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject valueWithName_inPropertyWithKey_(NSString? name, NSString? key) { + final _ret = _lib._objc_msgSend_159( + _id, + _lib._sel_valueWithName_inPropertyWithKey_1, + name?._id ?? ffi.nullptr, + key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject valueWithUniqueID_inPropertyWithKey_( + NSObject uniqueID, NSString? key) { + final _ret = _lib._objc_msgSend_272( + _id, + _lib._sel_valueWithUniqueID_inPropertyWithKey_1, + uniqueID._id, + key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void insertValue_atIndex_inPropertyWithKey_( + NSObject value, int index, NSString? key) { + return _lib._objc_msgSend_573( + _id, + _lib._sel_insertValue_atIndex_inPropertyWithKey_1, + value._id, + index, + key?._id ?? ffi.nullptr); + } + + void removeValueAtIndex_fromPropertyWithKey_(int index, NSString? key) { + return _lib._objc_msgSend_574( + _id, + _lib._sel_removeValueAtIndex_fromPropertyWithKey_1, + index, + key?._id ?? ffi.nullptr); + } + + void replaceValueAtIndex_inPropertyWithKey_withValue_( + int index, NSString? key, NSObject value) { + return _lib._objc_msgSend_575( + _id, + _lib._sel_replaceValueAtIndex_inPropertyWithKey_withValue_1, + index, + key?._id ?? ffi.nullptr, + value._id); + } + + void insertValue_inPropertyWithKey_(NSObject value, NSString? key) { + return _lib._objc_msgSend_122( + _id, + _lib._sel_insertValue_inPropertyWithKey_1, + value._id, + key?._id ?? ffi.nullptr); + } + + NSObject coerceValue_forKey_(NSObject value, NSString? key) { + final _ret = _lib._objc_msgSend_272(_id, _lib._sel_coerceValue_forKey_1, + value._id, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSScriptObjectSpecifier? get objectSpecifier { + final _ret = _lib._objc_msgSend_556(_id, _lib._sel_objectSpecifier1); + return _ret.address == 0 + ? null + : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + NSArray indicesOfObjectsByEvaluatingObjectSpecifier_( + NSScriptObjectSpecifier? specifier) { + final _ret = _lib._objc_msgSend_576( + _id, + _lib._sel_indicesOfObjectsByEvaluatingObjectSpecifier_1, + specifier?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + bool isEqualTo_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_isEqualTo_1, object._id); + } + + bool isLessThanOrEqualTo_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_isLessThanOrEqualTo_1, object._id); + } + + bool isLessThan_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_isLessThan_1, object._id); + } + + bool isGreaterThanOrEqualTo_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_isGreaterThanOrEqualTo_1, object._id); + } + + bool isGreaterThan_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_isGreaterThan_1, object._id); + } + + bool isNotEqualTo_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_isNotEqualTo_1, object._id); + } + + bool doesContain_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_doesContain_1, object._id); + } + + bool isLike_(NSString? object) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isLike_1, object?._id ?? ffi.nullptr); + } + + bool isCaseInsensitiveLike_(NSString? object) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isCaseInsensitiveLike_1, object?._id ?? ffi.nullptr); + } + + bool scriptingIsEqualTo_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_scriptingIsEqualTo_1, object._id); + } + + bool scriptingIsLessThanOrEqualTo_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_scriptingIsLessThanOrEqualTo_1, object._id); + } + + bool scriptingIsLessThan_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_scriptingIsLessThan_1, object._id); + } + + bool scriptingIsGreaterThanOrEqualTo_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_scriptingIsGreaterThanOrEqualTo_1, object._id); + } + + bool scriptingIsGreaterThan_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_scriptingIsGreaterThan_1, object._id); + } + + bool scriptingBeginsWith_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_scriptingBeginsWith_1, object._id); + } + + bool scriptingEndsWith_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_scriptingEndsWith_1, object._id); + } + + bool scriptingContains_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_scriptingContains_1, object._id); + } +} + +class ObjCSel extends ffi.Opaque {} + +class ObjCObject extends ffi.Opaque {} + +typedef instancetype = ffi.Pointer; + +class _NSZone extends ffi.Opaque {} + +class Protocol extends _ObjCWrapper { + Protocol._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [Protocol] that points to the same underlying object as [other]. + static Protocol castFrom(T other) { + return Protocol._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [Protocol] that wraps the given raw object pointer. + static Protocol castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return Protocol._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [Protocol]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_Protocol1); + } +} + +typedef IMP = ffi.Pointer>; + +class NSInvocation extends NSObject { + NSInvocation._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSInvocation] that points to the same underlying object as [other]. + static NSInvocation castFrom(T other) { + return NSInvocation._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSInvocation] that wraps the given raw object pointer. + static NSInvocation castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSInvocation._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSInvocation]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSInvocation1); + } + + static NSInvocation invocationWithMethodSignature_( + SwiftLibrary _lib, NSMethodSignature? sig) { + final _ret = _lib._objc_msgSend_366(_lib._class_NSInvocation1, + _lib._sel_invocationWithMethodSignature_1, sig?._id ?? ffi.nullptr); + return NSInvocation._(_ret, _lib, retain: true, release: true); + } + + NSMethodSignature? get methodSignature { + final _ret = _lib._objc_msgSend_367(_id, _lib._sel_methodSignature1); + return _ret.address == 0 + ? null + : NSMethodSignature._(_ret, _lib, retain: true, release: true); + } + + void retainArguments() { + return _lib._objc_msgSend_1(_id, _lib._sel_retainArguments1); + } + + bool get argumentsRetained { + return _lib._objc_msgSend_12(_id, _lib._sel_argumentsRetained1); + } + + NSObject get target { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_target1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set target(NSObject value) { + _lib._objc_msgSend_368(_id, _lib._sel_setTarget_1, value._id); + } + + ffi.Pointer get selector { + return _lib._objc_msgSend_369(_id, _lib._sel_selector1); + } + + set selector(ffi.Pointer value) { + _lib._objc_msgSend_370(_id, _lib._sel_setSelector_1, value); + } + + void getReturnValue_(ffi.Pointer retLoc) { + return _lib._objc_msgSend_47(_id, _lib._sel_getReturnValue_1, retLoc); + } + + void setReturnValue_(ffi.Pointer retLoc) { + return _lib._objc_msgSend_47(_id, _lib._sel_setReturnValue_1, retLoc); + } + + void getArgument_atIndex_(ffi.Pointer argumentLocation, int idx) { + return _lib._objc_msgSend_371( + _id, _lib._sel_getArgument_atIndex_1, argumentLocation, idx); + } + + void setArgument_atIndex_(ffi.Pointer argumentLocation, int idx) { + return _lib._objc_msgSend_371( + _id, _lib._sel_setArgument_atIndex_1, argumentLocation, idx); + } + + void invoke() { + return _lib._objc_msgSend_1(_id, _lib._sel_invoke1); + } + + void invokeWithTarget_(NSObject target) { + return _lib._objc_msgSend_15(_id, _lib._sel_invokeWithTarget_1, target._id); + } + + static NSInvocation new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSInvocation1, _lib._sel_new1); + return NSInvocation._(_ret, _lib, retain: false, release: true); + } + + static NSInvocation alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSInvocation1, _lib._sel_alloc1); + return NSInvocation._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSInvocation1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSInvocation1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSInvocation1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSInvocation1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSInvocation1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSInvocation1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSInvocation1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSInvocation1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSInvocation1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSMethodSignature extends NSObject { + NSMethodSignature._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMethodSignature] that points to the same underlying object as [other]. + static NSMethodSignature castFrom(T other) { + return NSMethodSignature._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSMethodSignature] that wraps the given raw object pointer. + static NSMethodSignature castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMethodSignature._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMethodSignature]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMethodSignature1); + } + + static NSMethodSignature signatureWithObjCTypes_( + SwiftLibrary _lib, ffi.Pointer types) { + final _ret = _lib._objc_msgSend_9(_lib._class_NSMethodSignature1, + _lib._sel_signatureWithObjCTypes_1, types); + return NSMethodSignature._(_ret, _lib, retain: true, release: true); + } + + int get numberOfArguments { + return _lib._objc_msgSend_10(_id, _lib._sel_numberOfArguments1); + } + + ffi.Pointer getArgumentTypeAtIndex_(int idx) { + return _lib._objc_msgSend_11(_id, _lib._sel_getArgumentTypeAtIndex_1, idx); + } + + int get frameLength { + return _lib._objc_msgSend_10(_id, _lib._sel_frameLength1); + } + + bool isOneway() { + return _lib._objc_msgSend_12(_id, _lib._sel_isOneway1); + } + + ffi.Pointer get methodReturnType { + return _lib._objc_msgSend_13(_id, _lib._sel_methodReturnType1); + } + + int get methodReturnLength { + return _lib._objc_msgSend_10(_id, _lib._sel_methodReturnLength1); + } + + static NSMethodSignature new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMethodSignature1, _lib._sel_new1); + return NSMethodSignature._(_ret, _lib, retain: false, release: true); + } + + static NSMethodSignature alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMethodSignature1, _lib._sel_alloc1); + return NSMethodSignature._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMethodSignature1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMethodSignature1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMethodSignature1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMethodSignature1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMethodSignature1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMethodSignature1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMethodSignature1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSMethodSignature1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMethodSignature1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSUInteger = ffi.UnsignedLong; + +class NSSet extends NSObject { + NSSet._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSSet] that points to the same underlying object as [other]. + static NSSet castFrom(T other) { + return NSSet._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSSet] that wraps the given raw object pointer. + static NSSet castFromPointer(SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSSet._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSSet]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSSet1); + } + + int get count { + return _lib._objc_msgSend_10(_id, _lib._sel_count1); + } + + NSObject member_(NSObject object) { + final _ret = _lib._objc_msgSend_16(_id, _lib._sel_member_1, object._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSEnumerator objectEnumerator() { + final _ret = _lib._objc_msgSend_72(_id, _lib._sel_objectEnumerator1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + @override + NSSet init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet initWithObjects_count_( + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61( + _id, _lib._sel_initWithObjects_count_1, objects, cnt); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSArray? get allObjects { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_allObjects1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSObject anyObject() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_anyObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool containsObject_(NSObject anObject) { + return _lib._objc_msgSend_0(_id, _lib._sel_containsObject_1, anObject._id); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_(NSObject locale) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool intersectsSet_(NSSet? otherSet) { + return _lib._objc_msgSend_355( + _id, _lib._sel_intersectsSet_1, otherSet?._id ?? ffi.nullptr); + } + + bool isEqualToSet_(NSSet? otherSet) { + return _lib._objc_msgSend_355( + _id, _lib._sel_isEqualToSet_1, otherSet?._id ?? ffi.nullptr); + } + + bool isSubsetOfSet_(NSSet? otherSet) { + return _lib._objc_msgSend_355( + _id, _lib._sel_isSubsetOfSet_1, otherSet?._id ?? ffi.nullptr); + } + + void makeObjectsPerformSelector_(ffi.Pointer aSelector) { + return _lib._objc_msgSend_7( + _id, _lib._sel_makeObjectsPerformSelector_1, aSelector); + } + + void makeObjectsPerformSelector_withObject_( + ffi.Pointer aSelector, NSObject argument) { + return _lib._objc_msgSend_82( + _id, + _lib._sel_makeObjectsPerformSelector_withObject_1, + aSelector, + argument._id); + } + + NSSet setByAddingObject_(NSObject anObject) { + final _ret = _lib._objc_msgSend_356( + _id, _lib._sel_setByAddingObject_1, anObject._id); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet setByAddingObjectsFromSet_(NSSet? other) { + final _ret = _lib._objc_msgSend_357( + _id, _lib._sel_setByAddingObjectsFromSet_1, other?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet setByAddingObjectsFromArray_(NSArray? other) { + final _ret = _lib._objc_msgSend_358(_id, + _lib._sel_setByAddingObjectsFromArray_1, other?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + void enumerateObjectsUsingBlock_(ObjCBlock13 block) { + return _lib._objc_msgSend_359( + _id, _lib._sel_enumerateObjectsUsingBlock_1, block._id); + } + + void enumerateObjectsWithOptions_usingBlock_(int opts, ObjCBlock13 block) { + return _lib._objc_msgSend_360(_id, + _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._id); + } + + NSSet objectsPassingTest_(ObjCBlock14 predicate) { + final _ret = _lib._objc_msgSend_361( + _id, _lib._sel_objectsPassingTest_1, predicate._id); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet objectsWithOptions_passingTest_(int opts, ObjCBlock14 predicate) { + final _ret = _lib._objc_msgSend_362( + _id, _lib._sel_objectsWithOptions_passingTest_1, opts, predicate._id); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static NSSet set1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSSet1, _lib._sel_set1); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static NSSet setWithObject_(SwiftLibrary _lib, NSObject object) { + final _ret = _lib._objc_msgSend_16( + _lib._class_NSSet1, _lib._sel_setWithObject_1, object._id); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static NSSet setWithObjects_count_(SwiftLibrary _lib, + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61( + _lib._class_NSSet1, _lib._sel_setWithObjects_count_1, objects, cnt); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static NSSet setWithObjects_(SwiftLibrary _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_16( + _lib._class_NSSet1, _lib._sel_setWithObjects_1, firstObj._id); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static NSSet setWithSet_(SwiftLibrary _lib, NSSet? set) { + final _ret = _lib._objc_msgSend_363( + _lib._class_NSSet1, _lib._sel_setWithSet_1, set?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static NSSet setWithArray_(SwiftLibrary _lib, NSArray? array) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSSet1, + _lib._sel_setWithArray_1, array?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet initWithObjects_(NSObject firstObj) { + final _ret = + _lib._objc_msgSend_16(_id, _lib._sel_initWithObjects_1, firstObj._id); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet initWithSet_(NSSet? set) { + final _ret = _lib._objc_msgSend_363( + _id, _lib._sel_initWithSet_1, set?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet initWithSet_copyItems_(NSSet? set, bool flag) { + final _ret = _lib._objc_msgSend_364( + _id, _lib._sel_initWithSet_copyItems_1, set?._id ?? ffi.nullptr, flag); + return NSSet._(_ret, _lib, retain: false, release: true); + } + + NSSet initWithArray_(NSArray? array) { + final _ret = _lib._objc_msgSend_67( + _id, _lib._sel_initWithArray_1, array?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + @override + NSObject valueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_valueForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + @override + void setValue_forKey_(NSObject value, NSString? key) { + return _lib._objc_msgSend_122( + _id, _lib._sel_setValue_forKey_1, value._id, key?._id ?? ffi.nullptr); + } + + @override + void addObserver_forKeyPath_options_context_(NSObject? observer, + NSString? keyPath, int options, ffi.Pointer context) { + return _lib._objc_msgSend_126( + _id, + _lib._sel_addObserver_forKeyPath_options_context_1, + observer?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + options, + context); + } + + @override + void removeObserver_forKeyPath_context_( + NSObject? observer, NSString? keyPath, ffi.Pointer context) { + return _lib._objc_msgSend_127( + _id, + _lib._sel_removeObserver_forKeyPath_context_1, + observer?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + context); + } + + @override + void removeObserver_forKeyPath_(NSObject? observer, NSString? keyPath) { + return _lib._objc_msgSend_128(_id, _lib._sel_removeObserver_forKeyPath_1, + observer?._id ?? ffi.nullptr, keyPath?._id ?? ffi.nullptr); + } + + NSArray sortedArrayUsingDescriptors_(NSArray? sortDescriptors) { + final _ret = _lib._objc_msgSend_63( + _id, + _lib._sel_sortedArrayUsingDescriptors_1, + sortDescriptors?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSSet filteredSetUsingPredicate_(NSPredicate? predicate) { + final _ret = _lib._objc_msgSend_365(_id, + _lib._sel_filteredSetUsingPredicate_1, predicate?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static NSSet new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSSet1, _lib._sel_new1); + return NSSet._(_ret, _lib, retain: false, release: true); + } + + static NSSet alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSSet1, _lib._sel_alloc1); + return NSSet._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSSet1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSSet1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSSet1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSSet1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSSet1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSSet1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSSet1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSEnumerator extends NSObject { + NSEnumerator._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSEnumerator] that points to the same underlying object as [other]. + static NSEnumerator castFrom(T other) { + return NSEnumerator._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSEnumerator] that wraps the given raw object pointer. + static NSEnumerator castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSEnumerator._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSEnumerator]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSEnumerator1); + } + + NSObject nextObject() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_nextObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSEnumerator new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSEnumerator1, _lib._sel_new1); + return NSEnumerator._(_ret, _lib, retain: false, release: true); + } + + static NSEnumerator alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSEnumerator1, _lib._sel_alloc1); + return NSEnumerator._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSEnumerator1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSEnumerator1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSEnumerator1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSEnumerator1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSEnumerator1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSEnumerator1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSEnumerator1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSEnumerator1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSEnumerator1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSString extends NSObject { + NSString._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSString] that points to the same underlying object as [other]. + static NSString castFrom(T other) { + return NSString._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSString] that wraps the given raw object pointer. + static NSString castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSString._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSString]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSString1); + } + + factory NSString(SwiftLibrary _lib, String str) { + final cstr = str.toNativeUtf8(); + final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); + pkg_ffi.calloc.free(cstr); + return nsstr; + } + + @override + String toString() => (UTF8String).cast().toDartString(); + int get length { + return _lib._objc_msgSend_10(_id, _lib._sel_length1); + } + + int characterAtIndex_(int index) { + return _lib._objc_msgSend_17(_id, _lib._sel_characterAtIndex_1, index); + } + + @override + NSString init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString substringFromIndex_(int from) { + final _ret = + _lib._objc_msgSend_293(_id, _lib._sel_substringFromIndex_1, from); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString substringToIndex_(int to) { + final _ret = _lib._objc_msgSend_293(_id, _lib._sel_substringToIndex_1, to); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString substringWithRange_(NSRange range) { + final _ret = + _lib._objc_msgSend_294(_id, _lib._sel_substringWithRange_1, range); + return NSString._(_ret, _lib, retain: true, release: true); + } + + void getCharacters_range_(ffi.Pointer buffer, NSRange range) { + return _lib._objc_msgSend_295( + _id, _lib._sel_getCharacters_range_1, buffer, range); + } + + int compare_(NSString? string) { + return _lib._objc_msgSend_296( + _id, _lib._sel_compare_1, string?._id ?? ffi.nullptr); + } + + int compare_options_(NSString? string, int mask) { + return _lib._objc_msgSend_297( + _id, _lib._sel_compare_options_1, string?._id ?? ffi.nullptr, mask); + } + + int compare_options_range_( + NSString? string, int mask, NSRange rangeOfReceiverToCompare) { + return _lib._objc_msgSend_298(_id, _lib._sel_compare_options_range_1, + string?._id ?? ffi.nullptr, mask, rangeOfReceiverToCompare); + } + + int compare_options_range_locale_(NSString? string, int mask, + NSRange rangeOfReceiverToCompare, NSObject locale) { + return _lib._objc_msgSend_299(_id, _lib._sel_compare_options_range_locale_1, + string?._id ?? ffi.nullptr, mask, rangeOfReceiverToCompare, locale._id); + } + + int caseInsensitiveCompare_(NSString? string) { + return _lib._objc_msgSend_296( + _id, _lib._sel_caseInsensitiveCompare_1, string?._id ?? ffi.nullptr); + } + + int localizedCompare_(NSString? string) { + return _lib._objc_msgSend_296( + _id, _lib._sel_localizedCompare_1, string?._id ?? ffi.nullptr); + } + + int localizedCaseInsensitiveCompare_(NSString? string) { + return _lib._objc_msgSend_296( + _id, + _lib._sel_localizedCaseInsensitiveCompare_1, + string?._id ?? ffi.nullptr); + } + + int localizedStandardCompare_(NSString? string) { + return _lib._objc_msgSend_296( + _id, _lib._sel_localizedStandardCompare_1, string?._id ?? ffi.nullptr); + } + + bool isEqualToString_(NSString? aString) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isEqualToString_1, aString?._id ?? ffi.nullptr); + } + + bool hasPrefix_(NSString? str) { + return _lib._objc_msgSend_59( + _id, _lib._sel_hasPrefix_1, str?._id ?? ffi.nullptr); + } + + bool hasSuffix_(NSString? str) { + return _lib._objc_msgSend_59( + _id, _lib._sel_hasSuffix_1, str?._id ?? ffi.nullptr); + } + + NSString commonPrefixWithString_options_(NSString? str, int mask) { + final _ret = _lib._objc_msgSend_300( + _id, + _lib._sel_commonPrefixWithString_options_1, + str?._id ?? ffi.nullptr, + mask); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool containsString_(NSString? str) { + return _lib._objc_msgSend_59( + _id, _lib._sel_containsString_1, str?._id ?? ffi.nullptr); + } + + bool localizedCaseInsensitiveContainsString_(NSString? str) { + return _lib._objc_msgSend_59( + _id, + _lib._sel_localizedCaseInsensitiveContainsString_1, + str?._id ?? ffi.nullptr); + } + + bool localizedStandardContainsString_(NSString? str) { + return _lib._objc_msgSend_59(_id, + _lib._sel_localizedStandardContainsString_1, str?._id ?? ffi.nullptr); + } + + NSRange localizedStandardRangeOfString_(NSString? str) { + return _lib._objc_msgSend_301(_id, + _lib._sel_localizedStandardRangeOfString_1, str?._id ?? ffi.nullptr); + } + + NSRange rangeOfString_(NSString? searchString) { + return _lib._objc_msgSend_301( + _id, _lib._sel_rangeOfString_1, searchString?._id ?? ffi.nullptr); + } + + NSRange rangeOfString_options_(NSString? searchString, int mask) { + return _lib._objc_msgSend_302(_id, _lib._sel_rangeOfString_options_1, + searchString?._id ?? ffi.nullptr, mask); + } + + NSRange rangeOfString_options_range_( + NSString? searchString, int mask, NSRange rangeOfReceiverToSearch) { + return _lib._objc_msgSend_303(_id, _lib._sel_rangeOfString_options_range_1, + searchString?._id ?? ffi.nullptr, mask, rangeOfReceiverToSearch); + } + + NSRange rangeOfString_options_range_locale_(NSString? searchString, int mask, + NSRange rangeOfReceiverToSearch, NSLocale? locale) { + return _lib._objc_msgSend_304( + _id, + _lib._sel_rangeOfString_options_range_locale_1, + searchString?._id ?? ffi.nullptr, + mask, + rangeOfReceiverToSearch, + locale?._id ?? ffi.nullptr); + } + + NSRange rangeOfCharacterFromSet_(NSCharacterSet? searchSet) { + return _lib._objc_msgSend_305(_id, _lib._sel_rangeOfCharacterFromSet_1, + searchSet?._id ?? ffi.nullptr); + } + + NSRange rangeOfCharacterFromSet_options_( + NSCharacterSet? searchSet, int mask) { + return _lib._objc_msgSend_306( + _id, + _lib._sel_rangeOfCharacterFromSet_options_1, + searchSet?._id ?? ffi.nullptr, + mask); + } + + NSRange rangeOfCharacterFromSet_options_range_( + NSCharacterSet? searchSet, int mask, NSRange rangeOfReceiverToSearch) { + return _lib._objc_msgSend_307( + _id, + _lib._sel_rangeOfCharacterFromSet_options_range_1, + searchSet?._id ?? ffi.nullptr, + mask, + rangeOfReceiverToSearch); + } + + NSRange rangeOfComposedCharacterSequenceAtIndex_(int index) { + return _lib._objc_msgSend_308( + _id, _lib._sel_rangeOfComposedCharacterSequenceAtIndex_1, index); + } + + NSRange rangeOfComposedCharacterSequencesForRange_(NSRange range) { + return _lib._objc_msgSend_309( + _id, _lib._sel_rangeOfComposedCharacterSequencesForRange_1, range); + } + + NSString stringByAppendingString_(NSString? aString) { + final _ret = _lib._objc_msgSend_64( + _id, _lib._sel_stringByAppendingString_1, aString?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByAppendingFormat_(NSString? format) { + final _ret = _lib._objc_msgSend_64( + _id, _lib._sel_stringByAppendingFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + double get doubleValue { + return _lib._objc_msgSend_149(_id, _lib._sel_doubleValue1); + } + + double get floatValue { + return _lib._objc_msgSend_215(_id, _lib._sel_floatValue1); + } + + int get intValue { + return _lib._objc_msgSend_213(_id, _lib._sel_intValue1); + } + + int get integerValue { + return _lib._objc_msgSend_78(_id, _lib._sel_integerValue1); + } + + int get longLongValue { + return _lib._objc_msgSend_214(_id, _lib._sel_longLongValue1); + } + + bool get boolValue { + return _lib._objc_msgSend_12(_id, _lib._sel_boolValue1); + } + + NSString? get uppercaseString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_uppercaseString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get lowercaseString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_lowercaseString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get capitalizedString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_capitalizedString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get localizedUppercaseString { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_localizedUppercaseString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get localizedLowercaseString { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_localizedLowercaseString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get localizedCapitalizedString { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_localizedCapitalizedString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString uppercaseStringWithLocale_(NSLocale? locale) { + final _ret = _lib._objc_msgSend_310( + _id, _lib._sel_uppercaseStringWithLocale_1, locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString lowercaseStringWithLocale_(NSLocale? locale) { + final _ret = _lib._objc_msgSend_310( + _id, _lib._sel_lowercaseStringWithLocale_1, locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString capitalizedStringWithLocale_(NSLocale? locale) { + final _ret = _lib._objc_msgSend_310(_id, + _lib._sel_capitalizedStringWithLocale_1, locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + void getLineStart_end_contentsEnd_forRange_( + ffi.Pointer startPtr, + ffi.Pointer lineEndPtr, + ffi.Pointer contentsEndPtr, + NSRange range) { + return _lib._objc_msgSend_311( + _id, + _lib._sel_getLineStart_end_contentsEnd_forRange_1, + startPtr, + lineEndPtr, + contentsEndPtr, + range); + } + + NSRange lineRangeForRange_(NSRange range) { + return _lib._objc_msgSend_309(_id, _lib._sel_lineRangeForRange_1, range); + } + + void getParagraphStart_end_contentsEnd_forRange_( + ffi.Pointer startPtr, + ffi.Pointer parEndPtr, + ffi.Pointer contentsEndPtr, + NSRange range) { + return _lib._objc_msgSend_311( + _id, + _lib._sel_getParagraphStart_end_contentsEnd_forRange_1, + startPtr, + parEndPtr, + contentsEndPtr, + range); + } + + NSRange paragraphRangeForRange_(NSRange range) { + return _lib._objc_msgSend_309( + _id, _lib._sel_paragraphRangeForRange_1, range); + } + + void enumerateSubstringsInRange_options_usingBlock_( + NSRange range, int opts, ObjCBlock10 block) { + return _lib._objc_msgSend_312( + _id, + _lib._sel_enumerateSubstringsInRange_options_usingBlock_1, + range, + opts, + block._id); + } + + void enumerateLinesUsingBlock_(ObjCBlock11 block) { + return _lib._objc_msgSend_313( + _id, _lib._sel_enumerateLinesUsingBlock_1, block._id); + } + + ffi.Pointer get UTF8String { + return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); + } + + int get fastestEncoding { + return _lib._objc_msgSend_10(_id, _lib._sel_fastestEncoding1); + } + + int get smallestEncoding { + return _lib._objc_msgSend_10(_id, _lib._sel_smallestEncoding1); + } + + NSData dataUsingEncoding_allowLossyConversion_(int encoding, bool lossy) { + final _ret = _lib._objc_msgSend_314(_id, + _lib._sel_dataUsingEncoding_allowLossyConversion_1, encoding, lossy); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData dataUsingEncoding_(int encoding) { + final _ret = + _lib._objc_msgSend_315(_id, _lib._sel_dataUsingEncoding_1, encoding); + return NSData._(_ret, _lib, retain: true, release: true); + } + + bool canBeConvertedToEncoding_(int encoding) { + return _lib._objc_msgSend_89( + _id, _lib._sel_canBeConvertedToEncoding_1, encoding); + } + + ffi.Pointer cStringUsingEncoding_(int encoding) { + return _lib._objc_msgSend_11( + _id, _lib._sel_cStringUsingEncoding_1, encoding); + } + + bool getCString_maxLength_encoding_( + ffi.Pointer buffer, int maxBufferCount, int encoding) { + return _lib._objc_msgSend_316( + _id, + _lib._sel_getCString_maxLength_encoding_1, + buffer, + maxBufferCount, + encoding); + } + + bool getBytes_maxLength_usedLength_encoding_options_range_remainingRange_( + ffi.Pointer buffer, + int maxBufferCount, + ffi.Pointer usedBufferCount, + int encoding, + int options, + NSRange range, + NSRangePointer leftover) { + return _lib._objc_msgSend_317( + _id, + _lib._sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_1, + buffer, + maxBufferCount, + usedBufferCount, + encoding, + options, + range, + leftover); + } + + int maximumLengthOfBytesUsingEncoding_(int enc) { + return _lib._objc_msgSend_86( + _id, _lib._sel_maximumLengthOfBytesUsingEncoding_1, enc); + } + + int lengthOfBytesUsingEncoding_(int enc) { + return _lib._objc_msgSend_86( + _id, _lib._sel_lengthOfBytesUsingEncoding_1, enc); + } + + static ffi.Pointer getAvailableStringEncodings( + SwiftLibrary _lib) { + return _lib._objc_msgSend_318( + _lib._class_NSString1, _lib._sel_availableStringEncodings1); + } + + static NSString localizedNameOfStringEncoding_( + SwiftLibrary _lib, int encoding) { + final _ret = _lib._objc_msgSend_293(_lib._class_NSString1, + _lib._sel_localizedNameOfStringEncoding_1, encoding); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static int getDefaultCStringEncoding(SwiftLibrary _lib) { + return _lib._objc_msgSend_10( + _lib._class_NSString1, _lib._sel_defaultCStringEncoding1); + } + + NSString? get decomposedStringWithCanonicalMapping { + final _ret = _lib._objc_msgSend_20( + _id, _lib._sel_decomposedStringWithCanonicalMapping1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get precomposedStringWithCanonicalMapping { + final _ret = _lib._objc_msgSend_20( + _id, _lib._sel_precomposedStringWithCanonicalMapping1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get decomposedStringWithCompatibilityMapping { + final _ret = _lib._objc_msgSend_20( + _id, _lib._sel_decomposedStringWithCompatibilityMapping1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get precomposedStringWithCompatibilityMapping { + final _ret = _lib._objc_msgSend_20( + _id, _lib._sel_precomposedStringWithCompatibilityMapping1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray componentsSeparatedByString_(NSString? separator) { + final _ret = _lib._objc_msgSend_119(_id, + _lib._sel_componentsSeparatedByString_1, separator?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray componentsSeparatedByCharactersInSet_(NSCharacterSet? separator) { + final _ret = _lib._objc_msgSend_319( + _id, + _lib._sel_componentsSeparatedByCharactersInSet_1, + separator?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString stringByTrimmingCharactersInSet_(NSCharacterSet? set) { + final _ret = _lib._objc_msgSend_320(_id, + _lib._sel_stringByTrimmingCharactersInSet_1, set?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByPaddingToLength_withString_startingAtIndex_( + int newLength, NSString? padString, int padIndex) { + final _ret = _lib._objc_msgSend_321( + _id, + _lib._sel_stringByPaddingToLength_withString_startingAtIndex_1, + newLength, + padString?._id ?? ffi.nullptr, + padIndex); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByFoldingWithOptions_locale_(int options, NSLocale? locale) { + final _ret = _lib._objc_msgSend_322( + _id, + _lib._sel_stringByFoldingWithOptions_locale_1, + options, + locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByReplacingOccurrencesOfString_withString_options_range_( + NSString? target, + NSString? replacement, + int options, + NSRange searchRange) { + final _ret = _lib._objc_msgSend_323( + _id, + _lib._sel_stringByReplacingOccurrencesOfString_withString_options_range_1, + target?._id ?? ffi.nullptr, + replacement?._id ?? ffi.nullptr, + options, + searchRange); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByReplacingOccurrencesOfString_withString_( + NSString? target, NSString? replacement) { + final _ret = _lib._objc_msgSend_324( + _id, + _lib._sel_stringByReplacingOccurrencesOfString_withString_1, + target?._id ?? ffi.nullptr, + replacement?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByReplacingCharactersInRange_withString_( + NSRange range, NSString? replacement) { + final _ret = _lib._objc_msgSend_325( + _id, + _lib._sel_stringByReplacingCharactersInRange_withString_1, + range, + replacement?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByApplyingTransform_reverse_( + NSStringTransform transform, bool reverse) { + final _ret = _lib._objc_msgSend_326( + _id, _lib._sel_stringByApplyingTransform_reverse_1, transform, reverse); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool writeToURL_atomically_encoding_error_(NSURL? url, bool useAuxiliaryFile, + int enc, ffi.Pointer> error) { + return _lib._objc_msgSend_327( + _id, + _lib._sel_writeToURL_atomically_encoding_error_1, + url?._id ?? ffi.nullptr, + useAuxiliaryFile, + enc, + error); + } + + bool writeToFile_atomically_encoding_error_( + NSString? path, + bool useAuxiliaryFile, + int enc, + ffi.Pointer> error) { + return _lib._objc_msgSend_328( + _id, + _lib._sel_writeToFile_atomically_encoding_error_1, + path?._id ?? ffi.nullptr, + useAuxiliaryFile, + enc, + error); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get hash { + return _lib._objc_msgSend_10(_id, _lib._sel_hash1); + } + + NSString initWithCharactersNoCopy_length_freeWhenDone_( + ffi.Pointer characters, int length, bool freeBuffer) { + final _ret = _lib._objc_msgSend_329( + _id, + _lib._sel_initWithCharactersNoCopy_length_freeWhenDone_1, + characters, + length, + freeBuffer); + return NSString._(_ret, _lib, retain: false, release: true); + } + + NSString initWithCharactersNoCopy_length_deallocator_( + ffi.Pointer chars, int len, ObjCBlock12 deallocator) { + final _ret = _lib._objc_msgSend_330( + _id, + _lib._sel_initWithCharactersNoCopy_length_deallocator_1, + chars, + len, + deallocator._id); + return NSString._(_ret, _lib, retain: false, release: true); + } + + NSString initWithCharacters_length_( + ffi.Pointer characters, int length) { + final _ret = _lib._objc_msgSend_331( + _id, _lib._sel_initWithCharacters_length_1, characters, length); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithUTF8String_(ffi.Pointer nullTerminatedCString) { + final _ret = _lib._objc_msgSend_332( + _id, _lib._sel_initWithUTF8String_1, nullTerminatedCString); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithString_(NSString? aString) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, aString?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithFormat_(NSString? format) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithFormat_arguments_( + NSString? format, ffi.Pointer<__va_list_tag> argList) { + final _ret = _lib._objc_msgSend_333( + _id, + _lib._sel_initWithFormat_arguments_1, + format?._id ?? ffi.nullptr, + argList); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithFormat_locale_(NSString? format, NSObject locale) { + final _ret = _lib._objc_msgSend_157(_id, _lib._sel_initWithFormat_locale_1, + format?._id ?? ffi.nullptr, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithFormat_locale_arguments_( + NSString? format, NSObject locale, ffi.Pointer<__va_list_tag> argList) { + final _ret = _lib._objc_msgSend_334( + _id, + _lib._sel_initWithFormat_locale_arguments_1, + format?._id ?? ffi.nullptr, + locale._id, + argList); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithData_encoding_(NSData? data, int encoding) { + final _ret = _lib._objc_msgSend_335(_id, _lib._sel_initWithData_encoding_1, + data?._id ?? ffi.nullptr, encoding); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithBytes_length_encoding_( + ffi.Pointer bytes, int len, int encoding) { + final _ret = _lib._objc_msgSend_336( + _id, _lib._sel_initWithBytes_length_encoding_1, bytes, len, encoding); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithBytesNoCopy_length_encoding_freeWhenDone_( + ffi.Pointer bytes, int len, int encoding, bool freeBuffer) { + final _ret = _lib._objc_msgSend_337( + _id, + _lib._sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1, + bytes, + len, + encoding, + freeBuffer); + return NSString._(_ret, _lib, retain: false, release: true); + } + + NSString initWithBytesNoCopy_length_encoding_deallocator_( + ffi.Pointer bytes, + int len, + int encoding, + ObjCBlock9 deallocator) { + final _ret = _lib._objc_msgSend_338( + _id, + _lib._sel_initWithBytesNoCopy_length_encoding_deallocator_1, + bytes, + len, + encoding, + deallocator._id); + return NSString._(_ret, _lib, retain: false, release: true); + } + + static NSString string(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSString1, _lib._sel_string1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithString_(SwiftLibrary _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSString1, + _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithCharacters_length_( + SwiftLibrary _lib, ffi.Pointer characters, int length) { + final _ret = _lib._objc_msgSend_331(_lib._class_NSString1, + _lib._sel_stringWithCharacters_length_1, characters, length); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithUTF8String_( + SwiftLibrary _lib, ffi.Pointer nullTerminatedCString) { + final _ret = _lib._objc_msgSend_332(_lib._class_NSString1, + _lib._sel_stringWithUTF8String_1, nullTerminatedCString); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithFormat_(SwiftLibrary _lib, NSString? format) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSString1, + _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString localizedStringWithFormat_( + SwiftLibrary _lib, NSString? format) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSString1, + _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithCString_encoding_( + ffi.Pointer nullTerminatedCString, int encoding) { + final _ret = _lib._objc_msgSend_339(_id, + _lib._sel_initWithCString_encoding_1, nullTerminatedCString, encoding); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithCString_encoding_( + SwiftLibrary _lib, ffi.Pointer cString, int enc) { + final _ret = _lib._objc_msgSend_339(_lib._class_NSString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithContentsOfURL_encoding_error_( + NSURL? url, int enc, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_340( + _id, + _lib._sel_initWithContentsOfURL_encoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithContentsOfFile_encoding_error_( + NSString? path, int enc, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_341( + _id, + _lib._sel_initWithContentsOfFile_encoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithContentsOfURL_encoding_error_(SwiftLibrary _lib, + NSURL? url, int enc, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_340( + _lib._class_NSString1, + _lib._sel_stringWithContentsOfURL_encoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithContentsOfFile_encoding_error_(SwiftLibrary _lib, + NSString? path, int enc, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_341( + _lib._class_NSString1, + _lib._sel_stringWithContentsOfFile_encoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithContentsOfURL_usedEncoding_error_( + NSURL? url, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_342( + _id, + _lib._sel_initWithContentsOfURL_usedEncoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithContentsOfFile_usedEncoding_error_( + NSString? path, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_343( + _id, + _lib._sel_initWithContentsOfFile_usedEncoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithContentsOfURL_usedEncoding_error_( + SwiftLibrary _lib, + NSURL? url, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_342( + _lib._class_NSString1, + _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithContentsOfFile_usedEncoding_error_( + SwiftLibrary _lib, + NSString? path, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_343( + _lib._class_NSString1, + _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static int + stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( + SwiftLibrary _lib, + NSData? data, + NSDictionary? opts, + ffi.Pointer> string, + ffi.Pointer usedLossyConversion) { + return _lib._objc_msgSend_344( + _lib._class_NSString1, + _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, + data?._id ?? ffi.nullptr, + opts?._id ?? ffi.nullptr, + string, + usedLossyConversion); + } + + NSObject propertyList() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_propertyList1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSDictionary propertyListFromStringsFileFormat() { + final _ret = _lib._objc_msgSend_164( + _id, _lib._sel_propertyListFromStringsFileFormat1); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + ffi.Pointer cString() { + return _lib._objc_msgSend_13(_id, _lib._sel_cString1); + } + + ffi.Pointer lossyCString() { + return _lib._objc_msgSend_13(_id, _lib._sel_lossyCString1); + } + + int cStringLength() { + return _lib._objc_msgSend_10(_id, _lib._sel_cStringLength1); + } + + void getCString_(ffi.Pointer bytes) { + return _lib._objc_msgSend_251(_id, _lib._sel_getCString_1, bytes); + } + + void getCString_maxLength_(ffi.Pointer bytes, int maxLength) { + return _lib._objc_msgSend_345( + _id, _lib._sel_getCString_maxLength_1, bytes, maxLength); + } + + void getCString_maxLength_range_remainingRange_(ffi.Pointer bytes, + int maxLength, NSRange aRange, NSRangePointer leftoverRange) { + return _lib._objc_msgSend_346( + _id, + _lib._sel_getCString_maxLength_range_remainingRange_1, + bytes, + maxLength, + aRange, + leftoverRange); + } + + bool writeToFile_atomically_(NSString? path, bool useAuxiliaryFile) { + return _lib._objc_msgSend_25(_id, _lib._sel_writeToFile_atomically_1, + path?._id ?? ffi.nullptr, useAuxiliaryFile); + } + + bool writeToURL_atomically_(NSURL? url, bool atomically) { + return _lib._objc_msgSend_121(_id, _lib._sel_writeToURL_atomically_1, + url?._id ?? ffi.nullptr, atomically); + } + + NSObject initWithContentsOfFile_(NSString? path) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_226( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject stringWithContentsOfFile_(SwiftLibrary _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSString1, + _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject stringWithContentsOfURL_(SwiftLibrary _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_226(_lib._class_NSString1, + _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithCStringNoCopy_length_freeWhenDone_( + ffi.Pointer bytes, int length, bool freeBuffer) { + final _ret = _lib._objc_msgSend_347( + _id, + _lib._sel_initWithCStringNoCopy_length_freeWhenDone_1, + bytes, + length, + freeBuffer); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + NSObject initWithCString_length_(ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_339( + _id, _lib._sel_initWithCString_length_1, bytes, length); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithCString_(ffi.Pointer bytes) { + final _ret = + _lib._objc_msgSend_332(_id, _lib._sel_initWithCString_1, bytes); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject stringWithCString_length_( + SwiftLibrary _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_339(_lib._class_NSString1, + _lib._sel_stringWithCString_length_1, bytes, length); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject stringWithCString_( + SwiftLibrary _lib, ffi.Pointer bytes) { + final _ret = _lib._objc_msgSend_332( + _lib._class_NSString1, _lib._sel_stringWithCString_1, bytes); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void getCharacters_(ffi.Pointer buffer) { + return _lib._objc_msgSend_348(_id, _lib._sel_getCharacters_1, buffer); + } + + NSString variantFittingPresentationWidth_(int width) { + final _ret = _lib._objc_msgSend_349( + _id, _lib._sel_variantFittingPresentationWidth_1, width); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString pathWithComponents_(SwiftLibrary _lib, NSArray? components) { + final _ret = _lib._objc_msgSend_350(_lib._class_NSString1, + _lib._sel_pathWithComponents_1, components?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get pathComponents { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_pathComponents1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + bool get absolutePath { + return _lib._objc_msgSend_12(_id, _lib._sel_isAbsolutePath1); + } + + NSString? get lastPathComponent { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_lastPathComponent1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get stringByDeletingLastPathComponent { + final _ret = _lib._objc_msgSend_20( + _id, _lib._sel_stringByDeletingLastPathComponent1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByAppendingPathComponent_(NSString? str) { + final _ret = _lib._objc_msgSend_64(_id, + _lib._sel_stringByAppendingPathComponent_1, str?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get pathExtension { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_pathExtension1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get stringByDeletingPathExtension { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_stringByDeletingPathExtension1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByAppendingPathExtension_(NSString? str) { + final _ret = _lib._objc_msgSend_64(_id, + _lib._sel_stringByAppendingPathExtension_1, str?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get stringByAbbreviatingWithTildeInPath { + final _ret = _lib._objc_msgSend_20( + _id, _lib._sel_stringByAbbreviatingWithTildeInPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get stringByExpandingTildeInPath { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_stringByExpandingTildeInPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get stringByStandardizingPath { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_stringByStandardizingPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get stringByResolvingSymlinksInPath { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_stringByResolvingSymlinksInPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray stringsByAppendingPaths_(NSArray? paths) { + final _ret = _lib._objc_msgSend_63( + _id, _lib._sel_stringsByAppendingPaths_1, paths?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + int completePathIntoString_caseSensitive_matchesIntoArray_filterTypes_( + ffi.Pointer> outputName, + bool flag, + ffi.Pointer> outputArray, + NSArray? filterTypes) { + return _lib._objc_msgSend_351( + _id, + _lib._sel_completePathIntoString_caseSensitive_matchesIntoArray_filterTypes_1, + outputName, + flag, + outputArray, + filterTypes?._id ?? ffi.nullptr); + } + + ffi.Pointer get fileSystemRepresentation { + return _lib._objc_msgSend_13(_id, _lib._sel_fileSystemRepresentation1); + } + + bool getFileSystemRepresentation_maxLength_( + ffi.Pointer cname, int max) { + return _lib._objc_msgSend_218( + _id, _lib._sel_getFileSystemRepresentation_maxLength_1, cname, max); + } + + NSString stringByAddingPercentEncodingWithAllowedCharacters_( + NSCharacterSet? allowedCharacters) { + final _ret = _lib._objc_msgSend_320( + _id, + _lib._sel_stringByAddingPercentEncodingWithAllowedCharacters_1, + allowedCharacters?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get stringByRemovingPercentEncoding { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_stringByRemovingPercentEncoding1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByAddingPercentEscapesUsingEncoding_(int enc) { + final _ret = _lib._objc_msgSend_293( + _id, _lib._sel_stringByAddingPercentEscapesUsingEncoding_1, enc); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByReplacingPercentEscapesUsingEncoding_(int enc) { + final _ret = _lib._objc_msgSend_293( + _id, _lib._sel_stringByReplacingPercentEscapesUsingEncoding_1, enc); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray linguisticTagsInRange_scheme_options_orthography_tokenRanges_( + NSRange range, + NSLinguisticTagScheme scheme, + int options, + NSOrthography? orthography, + ffi.Pointer> tokenRanges) { + final _ret = _lib._objc_msgSend_353( + _id, + _lib._sel_linguisticTagsInRange_scheme_options_orthography_tokenRanges_1, + range, + scheme, + options, + orthography?._id ?? ffi.nullptr, + tokenRanges); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void enumerateLinguisticTagsInRange_scheme_options_orthography_usingBlock_( + NSRange range, + NSLinguisticTagScheme scheme, + int options, + NSOrthography? orthography, + ObjCBlock10 block) { + return _lib._objc_msgSend_354( + _id, + _lib._sel_enumerateLinguisticTagsInRange_scheme_options_orthography_usingBlock_1, + range, + scheme, + options, + orthography?._id ?? ffi.nullptr, + block._id); + } + + static NSString new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSString1, _lib._sel_new1); + return NSString._(_ret, _lib, retain: false, release: true); + } + + static NSString alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSString1, _lib._sel_alloc1); + return NSString._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSString1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSString1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSString1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSString1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSString1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSString1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSString1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +extension StringToNSString on String { + NSString toNSString(SwiftLibrary lib) => NSString(lib, this); +} + +typedef unichar = ffi.UnsignedShort; + +class NSCoder extends NSObject { + NSCoder._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSCoder] that points to the same underlying object as [other]. + static NSCoder castFrom(T other) { + return NSCoder._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSCoder] that wraps the given raw object pointer. + static NSCoder castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSCoder._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSCoder]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSCoder1); + } + + void encodeValueOfObjCType_at_( + ffi.Pointer type, ffi.Pointer addr) { + return _lib._objc_msgSend_18( + _id, _lib._sel_encodeValueOfObjCType_at_1, type, addr); + } + + void encodeDataObject_(NSData? data) { + return _lib._objc_msgSend_248( + _id, _lib._sel_encodeDataObject_1, data?._id ?? ffi.nullptr); + } + + NSData decodeDataObject() { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_decodeDataObject1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + void decodeValueOfObjCType_at_size_( + ffi.Pointer type, ffi.Pointer data, int size) { + return _lib._objc_msgSend_249( + _id, _lib._sel_decodeValueOfObjCType_at_size_1, type, data, size); + } + + int versionForClassName_(NSString? className) { + return _lib._objc_msgSend_250( + _id, _lib._sel_versionForClassName_1, className?._id ?? ffi.nullptr); + } + + void encodeObject_(NSObject object) { + return _lib._objc_msgSend_15(_id, _lib._sel_encodeObject_1, object._id); + } + + void encodeRootObject_(NSObject rootObject) { + return _lib._objc_msgSend_15( + _id, _lib._sel_encodeRootObject_1, rootObject._id); + } + + void encodeBycopyObject_(NSObject anObject) { + return _lib._objc_msgSend_15( + _id, _lib._sel_encodeBycopyObject_1, anObject._id); + } + + void encodeByrefObject_(NSObject anObject) { + return _lib._objc_msgSend_15( + _id, _lib._sel_encodeByrefObject_1, anObject._id); + } + + void encodeConditionalObject_(NSObject object) { + return _lib._objc_msgSend_15( + _id, _lib._sel_encodeConditionalObject_1, object._id); + } + + void encodeValuesOfObjCTypes_(ffi.Pointer types) { + return _lib._objc_msgSend_251( + _id, _lib._sel_encodeValuesOfObjCTypes_1, types); + } + + void encodeArrayOfObjCType_count_at_( + ffi.Pointer type, int count, ffi.Pointer array) { + return _lib._objc_msgSend_252( + _id, _lib._sel_encodeArrayOfObjCType_count_at_1, type, count, array); + } + + void encodeBytes_length_(ffi.Pointer byteaddr, int length) { + return _lib._objc_msgSend_21( + _id, _lib._sel_encodeBytes_length_1, byteaddr, length); + } + + NSObject decodeObject() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_decodeObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject decodeTopLevelObjectAndReturnError_( + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_253( + _id, _lib._sel_decodeTopLevelObjectAndReturnError_1, error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void decodeValuesOfObjCTypes_(ffi.Pointer types) { + return _lib._objc_msgSend_251( + _id, _lib._sel_decodeValuesOfObjCTypes_1, types); + } + + void decodeArrayOfObjCType_count_at_( + ffi.Pointer itemType, int count, ffi.Pointer array) { + return _lib._objc_msgSend_252(_id, + _lib._sel_decodeArrayOfObjCType_count_at_1, itemType, count, array); + } + + ffi.Pointer decodeBytesWithReturnedLength_( + ffi.Pointer lengthp) { + return _lib._objc_msgSend_254( + _id, _lib._sel_decodeBytesWithReturnedLength_1, lengthp); + } + + void encodePropertyList_(NSObject aPropertyList) { + return _lib._objc_msgSend_15( + _id, _lib._sel_encodePropertyList_1, aPropertyList._id); + } + + NSObject decodePropertyList() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_decodePropertyList1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void setObjectZone_(ffi.Pointer zone) { + return _lib._objc_msgSend_255(_id, _lib._sel_setObjectZone_1, zone); + } + + ffi.Pointer objectZone() { + return _lib._objc_msgSend_256(_id, _lib._sel_objectZone1); + } + + int get systemVersion { + return _lib._objc_msgSend_191(_id, _lib._sel_systemVersion1); + } + + bool get allowsKeyedCoding { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsKeyedCoding1); + } + + void encodeObject_forKey_(NSObject object, NSString? key) { + return _lib._objc_msgSend_122(_id, _lib._sel_encodeObject_forKey_1, + object._id, key?._id ?? ffi.nullptr); + } + + void encodeConditionalObject_forKey_(NSObject object, NSString? key) { + return _lib._objc_msgSend_122( + _id, + _lib._sel_encodeConditionalObject_forKey_1, + object._id, + key?._id ?? ffi.nullptr); + } + + void encodeBool_forKey_(bool value, NSString? key) { + return _lib._objc_msgSend_257( + _id, _lib._sel_encodeBool_forKey_1, value, key?._id ?? ffi.nullptr); + } + + void encodeInt_forKey_(int value, NSString? key) { + return _lib._objc_msgSend_258( + _id, _lib._sel_encodeInt_forKey_1, value, key?._id ?? ffi.nullptr); + } + + void encodeInt32_forKey_(int value, NSString? key) { + return _lib._objc_msgSend_259( + _id, _lib._sel_encodeInt32_forKey_1, value, key?._id ?? ffi.nullptr); + } + + void encodeInt64_forKey_(int value, NSString? key) { + return _lib._objc_msgSend_260( + _id, _lib._sel_encodeInt64_forKey_1, value, key?._id ?? ffi.nullptr); + } + + void encodeFloat_forKey_(double value, NSString? key) { + return _lib._objc_msgSend_261( + _id, _lib._sel_encodeFloat_forKey_1, value, key?._id ?? ffi.nullptr); + } + + void encodeDouble_forKey_(double value, NSString? key) { + return _lib._objc_msgSend_262( + _id, _lib._sel_encodeDouble_forKey_1, value, key?._id ?? ffi.nullptr); + } + + void encodeBytes_length_forKey_( + ffi.Pointer bytes, int length, NSString? key) { + return _lib._objc_msgSend_263(_id, _lib._sel_encodeBytes_length_forKey_1, + bytes, length, key?._id ?? ffi.nullptr); + } + + bool containsValueForKey_(NSString? key) { + return _lib._objc_msgSend_59( + _id, _lib._sel_containsValueForKey_1, key?._id ?? ffi.nullptr); + } + + NSObject decodeObjectForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_decodeObjectForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject decodeTopLevelObjectForKey_error_( + NSString? key, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_264( + _id, + _lib._sel_decodeTopLevelObjectForKey_error_1, + key?._id ?? ffi.nullptr, + error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool decodeBoolForKey_(NSString? key) { + return _lib._objc_msgSend_59( + _id, _lib._sel_decodeBoolForKey_1, key?._id ?? ffi.nullptr); + } + + int decodeIntForKey_(NSString? key) { + return _lib._objc_msgSend_265( + _id, _lib._sel_decodeIntForKey_1, key?._id ?? ffi.nullptr); + } + + int decodeInt32ForKey_(NSString? key) { + return _lib._objc_msgSend_266( + _id, _lib._sel_decodeInt32ForKey_1, key?._id ?? ffi.nullptr); + } + + int decodeInt64ForKey_(NSString? key) { + return _lib._objc_msgSend_267( + _id, _lib._sel_decodeInt64ForKey_1, key?._id ?? ffi.nullptr); + } + + double decodeFloatForKey_(NSString? key) { + return _lib._objc_msgSend_268( + _id, _lib._sel_decodeFloatForKey_1, key?._id ?? ffi.nullptr); + } + + double decodeDoubleForKey_(NSString? key) { + return _lib._objc_msgSend_269( + _id, _lib._sel_decodeDoubleForKey_1, key?._id ?? ffi.nullptr); + } + + ffi.Pointer decodeBytesForKey_returnedLength_( + NSString? key, ffi.Pointer lengthp) { + return _lib._objc_msgSend_270( + _id, + _lib._sel_decodeBytesForKey_returnedLength_1, + key?._id ?? ffi.nullptr, + lengthp); + } + + void encodeInteger_forKey_(int value, NSString? key) { + return _lib._objc_msgSend_271( + _id, _lib._sel_encodeInteger_forKey_1, value, key?._id ?? ffi.nullptr); + } + + int decodeIntegerForKey_(NSString? key) { + return _lib._objc_msgSend_250( + _id, _lib._sel_decodeIntegerForKey_1, key?._id ?? ffi.nullptr); + } + + bool get requiresSecureCoding { + return _lib._objc_msgSend_12(_id, _lib._sel_requiresSecureCoding1); + } + + NSObject decodeObjectOfClass_forKey_(NSObject aClass, NSString? key) { + final _ret = _lib._objc_msgSend_272( + _id, + _lib._sel_decodeObjectOfClass_forKey_1, + aClass._id, + key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject decodeTopLevelObjectOfClass_forKey_error_(NSObject aClass, + NSString? key, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_273( + _id, + _lib._sel_decodeTopLevelObjectOfClass_forKey_error_1, + aClass._id, + key?._id ?? ffi.nullptr, + error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSArray decodeArrayOfObjectsOfClass_forKey_(NSObject cls, NSString? key) { + final _ret = _lib._objc_msgSend_274( + _id, + _lib._sel_decodeArrayOfObjectsOfClass_forKey_1, + cls._id, + key?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSDictionary decodeDictionaryWithKeysOfClass_objectsOfClass_forKey_( + NSObject keyCls, NSObject objectCls, NSString? key) { + final _ret = _lib._objc_msgSend_275( + _id, + _lib._sel_decodeDictionaryWithKeysOfClass_objectsOfClass_forKey_1, + keyCls._id, + objectCls._id, + key?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSObject decodeObjectOfClasses_forKey_(NSSet? classes, NSString? key) { + final _ret = _lib._objc_msgSend_276( + _id, + _lib._sel_decodeObjectOfClasses_forKey_1, + classes?._id ?? ffi.nullptr, + key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject decodeTopLevelObjectOfClasses_forKey_error_(NSSet? classes, + NSString? key, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_277( + _id, + _lib._sel_decodeTopLevelObjectOfClasses_forKey_error_1, + classes?._id ?? ffi.nullptr, + key?._id ?? ffi.nullptr, + error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSArray decodeArrayOfObjectsOfClasses_forKey_(NSSet? classes, NSString? key) { + final _ret = _lib._objc_msgSend_278( + _id, + _lib._sel_decodeArrayOfObjectsOfClasses_forKey_1, + classes?._id ?? ffi.nullptr, + key?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSDictionary decodeDictionaryWithKeysOfClasses_objectsOfClasses_forKey_( + NSSet? keyClasses, NSSet? objectClasses, NSString? key) { + final _ret = _lib._objc_msgSend_279( + _id, + _lib._sel_decodeDictionaryWithKeysOfClasses_objectsOfClasses_forKey_1, + keyClasses?._id ?? ffi.nullptr, + objectClasses?._id ?? ffi.nullptr, + key?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSObject decodePropertyListForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_decodePropertyListForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSSet? get allowedClasses { + final _ret = _lib._objc_msgSend_280(_id, _lib._sel_allowedClasses1); + return _ret.address == 0 + ? null + : NSSet._(_ret, _lib, retain: true, release: true); + } + + void failWithError_(NSError? error) { + return _lib._objc_msgSend_281( + _id, _lib._sel_failWithError_1, error?._id ?? ffi.nullptr); + } + + int get decodingFailurePolicy { + return _lib._objc_msgSend_282(_id, _lib._sel_decodingFailurePolicy1); + } + + NSError? get error { + final _ret = _lib._objc_msgSend_283(_id, _lib._sel_error1); + return _ret.address == 0 + ? null + : NSError._(_ret, _lib, retain: true, release: true); + } + + void encodeNXObject_(NSObject object) { + return _lib._objc_msgSend_15(_id, _lib._sel_encodeNXObject_1, object._id); + } + + NSObject decodeNXObject() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_decodeNXObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void decodeValueOfObjCType_at_( + ffi.Pointer type, ffi.Pointer data) { + return _lib._objc_msgSend_18( + _id, _lib._sel_decodeValueOfObjCType_at_1, type, data); + } + + void encodePoint_(NSPoint point) { + return _lib._objc_msgSend_284(_id, _lib._sel_encodePoint_1, point); + } + + NSPoint decodePoint() { + return _lib._objc_msgSend_54(_id, _lib._sel_decodePoint1); + } + + void encodeSize_(NSSize size) { + return _lib._objc_msgSend_285(_id, _lib._sel_encodeSize_1, size); + } + + NSSize decodeSize() { + return _lib._objc_msgSend_55(_id, _lib._sel_decodeSize1); + } + + void encodeRect_(NSRect rect) { + return _lib._objc_msgSend_286(_id, _lib._sel_encodeRect_1, rect); + } + + NSRect decodeRect() { + return _lib._objc_msgSend_56(_id, _lib._sel_decodeRect1); + } + + void encodePoint_forKey_(NSPoint point, NSString? key) { + return _lib._objc_msgSend_287( + _id, _lib._sel_encodePoint_forKey_1, point, key?._id ?? ffi.nullptr); + } + + void encodeSize_forKey_(NSSize size, NSString? key) { + return _lib._objc_msgSend_288( + _id, _lib._sel_encodeSize_forKey_1, size, key?._id ?? ffi.nullptr); + } + + void encodeRect_forKey_(NSRect rect, NSString? key) { + return _lib._objc_msgSend_289( + _id, _lib._sel_encodeRect_forKey_1, rect, key?._id ?? ffi.nullptr); + } + + NSPoint decodePointForKey_(NSString? key) { + return _lib._objc_msgSend_290( + _id, _lib._sel_decodePointForKey_1, key?._id ?? ffi.nullptr); + } + + NSSize decodeSizeForKey_(NSString? key) { + return _lib._objc_msgSend_291( + _id, _lib._sel_decodeSizeForKey_1, key?._id ?? ffi.nullptr); + } + + NSRect decodeRectForKey_(NSString? key) { + return _lib._objc_msgSend_292( + _id, _lib._sel_decodeRectForKey_1, key?._id ?? ffi.nullptr); + } + + static NSCoder new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSCoder1, _lib._sel_new1); + return NSCoder._(_ret, _lib, retain: false, release: true); + } + + static NSCoder alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSCoder1, _lib._sel_alloc1); + return NSCoder._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSCoder1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSCoder1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSCoder1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSCoder1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSCoder1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSCoder1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSCoder1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSCoder1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSCoder1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSData extends NSObject { + NSData._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSData] that points to the same underlying object as [other]. + static NSData castFrom(T other) { + return NSData._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSData] that wraps the given raw object pointer. + static NSData castFromPointer(SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSData._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSData]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSData1); + } + + int get length { + return _lib._objc_msgSend_10(_id, _lib._sel_length1); + } + + ffi.Pointer get bytes { + return _lib._objc_msgSend_19(_id, _lib._sel_bytes1); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + void getBytes_length_(ffi.Pointer buffer, int length) { + return _lib._objc_msgSend_21( + _id, _lib._sel_getBytes_length_1, buffer, length); + } + + void getBytes_range_(ffi.Pointer buffer, NSRange range) { + return _lib._objc_msgSend_22( + _id, _lib._sel_getBytes_range_1, buffer, range); + } + + bool isEqualToData_(NSData? other) { + return _lib._objc_msgSend_23( + _id, _lib._sel_isEqualToData_1, other?._id ?? ffi.nullptr); + } + + NSData subdataWithRange_(NSRange range) { + final _ret = + _lib._objc_msgSend_24(_id, _lib._sel_subdataWithRange_1, range); + return NSData._(_ret, _lib, retain: true, release: true); + } + + bool writeToFile_atomically_(NSString? path, bool useAuxiliaryFile) { + return _lib._objc_msgSend_25(_id, _lib._sel_writeToFile_atomically_1, + path?._id ?? ffi.nullptr, useAuxiliaryFile); + } + + bool writeToURL_atomically_(NSURL? url, bool atomically) { + return _lib._objc_msgSend_121(_id, _lib._sel_writeToURL_atomically_1, + url?._id ?? ffi.nullptr, atomically); + } + + bool writeToFile_options_error_(NSString? path, int writeOptionsMask, + ffi.Pointer> errorPtr) { + return _lib._objc_msgSend_233(_id, _lib._sel_writeToFile_options_error_1, + path?._id ?? ffi.nullptr, writeOptionsMask, errorPtr); + } + + bool writeToURL_options_error_(NSURL? url, int writeOptionsMask, + ffi.Pointer> errorPtr) { + return _lib._objc_msgSend_234(_id, _lib._sel_writeToURL_options_error_1, + url?._id ?? ffi.nullptr, writeOptionsMask, errorPtr); + } + + NSRange rangeOfData_options_range_( + NSData? dataToFind, int mask, NSRange searchRange) { + return _lib._objc_msgSend_235(_id, _lib._sel_rangeOfData_options_range_1, + dataToFind?._id ?? ffi.nullptr, mask, searchRange); + } + + void enumerateByteRangesUsingBlock_(ObjCBlock8 block) { + return _lib._objc_msgSend_236( + _id, _lib._sel_enumerateByteRangesUsingBlock_1, block._id); + } + + static NSData data(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSData1, _lib._sel_data1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static NSData dataWithBytes_length_( + SwiftLibrary _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_237( + _lib._class_NSData1, _lib._sel_dataWithBytes_length_1, bytes, length); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static NSData dataWithBytesNoCopy_length_( + SwiftLibrary _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_237(_lib._class_NSData1, + _lib._sel_dataWithBytesNoCopy_length_1, bytes, length); + return NSData._(_ret, _lib, retain: false, release: true); + } + + static NSData dataWithBytesNoCopy_length_freeWhenDone_( + SwiftLibrary _lib, ffi.Pointer bytes, int length, bool b) { + final _ret = _lib._objc_msgSend_238(_lib._class_NSData1, + _lib._sel_dataWithBytesNoCopy_length_freeWhenDone_1, bytes, length, b); + return NSData._(_ret, _lib, retain: false, release: true); + } + + static NSData dataWithContentsOfFile_options_error_( + SwiftLibrary _lib, + NSString? path, + int readOptionsMask, + ffi.Pointer> errorPtr) { + final _ret = _lib._objc_msgSend_239( + _lib._class_NSData1, + _lib._sel_dataWithContentsOfFile_options_error_1, + path?._id ?? ffi.nullptr, + readOptionsMask, + errorPtr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static NSData dataWithContentsOfURL_options_error_( + SwiftLibrary _lib, + NSURL? url, + int readOptionsMask, + ffi.Pointer> errorPtr) { + final _ret = _lib._objc_msgSend_240( + _lib._class_NSData1, + _lib._sel_dataWithContentsOfURL_options_error_1, + url?._id ?? ffi.nullptr, + readOptionsMask, + errorPtr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static NSData dataWithContentsOfFile_(SwiftLibrary _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSData1, + _lib._sel_dataWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static NSData dataWithContentsOfURL_(SwiftLibrary _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_226(_lib._class_NSData1, + _lib._sel_dataWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData initWithBytes_length_(ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_237( + _id, _lib._sel_initWithBytes_length_1, bytes, length); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData initWithBytesNoCopy_length_(ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_237( + _id, _lib._sel_initWithBytesNoCopy_length_1, bytes, length); + return NSData._(_ret, _lib, retain: false, release: true); + } + + NSData initWithBytesNoCopy_length_freeWhenDone_( + ffi.Pointer bytes, int length, bool b) { + final _ret = _lib._objc_msgSend_238(_id, + _lib._sel_initWithBytesNoCopy_length_freeWhenDone_1, bytes, length, b); + return NSData._(_ret, _lib, retain: false, release: true); + } + + NSData initWithBytesNoCopy_length_deallocator_( + ffi.Pointer bytes, int length, ObjCBlock9 deallocator) { + final _ret = _lib._objc_msgSend_241( + _id, + _lib._sel_initWithBytesNoCopy_length_deallocator_1, + bytes, + length, + deallocator._id); + return NSData._(_ret, _lib, retain: false, release: true); + } + + NSData initWithContentsOfFile_options_error_(NSString? path, + int readOptionsMask, ffi.Pointer> errorPtr) { + final _ret = _lib._objc_msgSend_239( + _id, + _lib._sel_initWithContentsOfFile_options_error_1, + path?._id ?? ffi.nullptr, + readOptionsMask, + errorPtr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData initWithContentsOfURL_options_error_(NSURL? url, int readOptionsMask, + ffi.Pointer> errorPtr) { + final _ret = _lib._objc_msgSend_240( + _id, + _lib._sel_initWithContentsOfURL_options_error_1, + url?._id ?? ffi.nullptr, + readOptionsMask, + errorPtr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData initWithContentsOfFile_(NSString? path) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_226( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData initWithData_(NSData? data) { + final _ret = _lib._objc_msgSend_242( + _id, _lib._sel_initWithData_1, data?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static NSData dataWithData_(SwiftLibrary _lib, NSData? data) { + final _ret = _lib._objc_msgSend_242(_lib._class_NSData1, + _lib._sel_dataWithData_1, data?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData initWithBase64EncodedString_options_( + NSString? base64String, int options) { + final _ret = _lib._objc_msgSend_243( + _id, + _lib._sel_initWithBase64EncodedString_options_1, + base64String?._id ?? ffi.nullptr, + options); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSString base64EncodedStringWithOptions_(int options) { + final _ret = _lib._objc_msgSend_244( + _id, _lib._sel_base64EncodedStringWithOptions_1, options); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSData initWithBase64EncodedData_options_(NSData? base64Data, int options) { + final _ret = _lib._objc_msgSend_245( + _id, + _lib._sel_initWithBase64EncodedData_options_1, + base64Data?._id ?? ffi.nullptr, + options); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData base64EncodedDataWithOptions_(int options) { + final _ret = _lib._objc_msgSend_246( + _id, _lib._sel_base64EncodedDataWithOptions_1, options); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData decompressedDataUsingAlgorithm_error_( + int algorithm, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_247(_id, + _lib._sel_decompressedDataUsingAlgorithm_error_1, algorithm, error); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData compressedDataUsingAlgorithm_error_( + int algorithm, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_247( + _id, _lib._sel_compressedDataUsingAlgorithm_error_1, algorithm, error); + return NSData._(_ret, _lib, retain: true, release: true); + } + + void getBytes_(ffi.Pointer buffer) { + return _lib._objc_msgSend_47(_id, _lib._sel_getBytes_1, buffer); + } + + static NSObject dataWithContentsOfMappedFile_( + SwiftLibrary _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSData1, + _lib._sel_dataWithContentsOfMappedFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithContentsOfMappedFile_(NSString? path) { + final _ret = _lib._objc_msgSend_30(_id, + _lib._sel_initWithContentsOfMappedFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithBase64Encoding_(NSString? base64String) { + final _ret = _lib._objc_msgSend_30(_id, _lib._sel_initWithBase64Encoding_1, + base64String?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSString base64Encoding() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_base64Encoding1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSData new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSData1, _lib._sel_new1); + return NSData._(_ret, _lib, retain: false, release: true); + } + + static NSData alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSData1, _lib._sel_alloc1); + return NSData._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSData1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSData1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSData1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSData1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSData1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSData1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSData1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSData1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSData1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSRange = _NSRange; + +class _NSRange extends ffi.Struct { + @NSUInteger() + external int location; + + @NSUInteger() + external int length; +} + +class NSURL extends NSObject { + NSURL._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURL] that points to the same underlying object as [other]. + static NSURL castFrom(T other) { + return NSURL._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSURL] that wraps the given raw object pointer. + static NSURL castFromPointer(SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURL._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURL]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURL1); + } + + NSURL initWithScheme_host_path_( + NSString? scheme, NSString? host, NSString? path) { + final _ret = _lib._objc_msgSend_26( + _id, + _lib._sel_initWithScheme_host_path_1, + scheme?._id ?? ffi.nullptr, + host?._id ?? ffi.nullptr, + path?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initFileURLWithPath_isDirectory_relativeToURL_( + NSString? path, bool isDir, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_27( + _id, + _lib._sel_initFileURLWithPath_isDirectory_relativeToURL_1, + path?._id ?? ffi.nullptr, + isDir, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initFileURLWithPath_relativeToURL_(NSString? path, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_28( + _id, + _lib._sel_initFileURLWithPath_relativeToURL_1, + path?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initFileURLWithPath_isDirectory_(NSString? path, bool isDir) { + final _ret = _lib._objc_msgSend_29( + _id, + _lib._sel_initFileURLWithPath_isDirectory_1, + path?._id ?? ffi.nullptr, + isDir); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initFileURLWithPath_(NSString? path) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initFileURLWithPath_1, path?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL fileURLWithPath_isDirectory_relativeToURL_( + SwiftLibrary _lib, NSString? path, bool isDir, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_31( + _lib._class_NSURL1, + _lib._sel_fileURLWithPath_isDirectory_relativeToURL_1, + path?._id ?? ffi.nullptr, + isDir, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL fileURLWithPath_relativeToURL_( + SwiftLibrary _lib, NSString? path, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_32( + _lib._class_NSURL1, + _lib._sel_fileURLWithPath_relativeToURL_1, + path?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL fileURLWithPath_isDirectory_( + SwiftLibrary _lib, NSString? path, bool isDir) { + final _ret = _lib._objc_msgSend_33( + _lib._class_NSURL1, + _lib._sel_fileURLWithPath_isDirectory_1, + path?._id ?? ffi.nullptr, + isDir); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL fileURLWithPath_(SwiftLibrary _lib, NSString? path) { + final _ret = _lib._objc_msgSend_34(_lib._class_NSURL1, + _lib._sel_fileURLWithPath_1, path?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL_( + ffi.Pointer path, bool isDir, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_35( + _id, + _lib._sel_initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL_1, + path, + isDir, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL fileURLWithFileSystemRepresentation_isDirectory_relativeToURL_( + SwiftLibrary _lib, + ffi.Pointer path, + bool isDir, + NSURL? baseURL) { + final _ret = _lib._objc_msgSend_36( + _lib._class_NSURL1, + _lib._sel_fileURLWithFileSystemRepresentation_isDirectory_relativeToURL_1, + path, + isDir, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initWithString_(NSString? URLString) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, URLString?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initWithString_relativeToURL_(NSString? URLString, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_28( + _id, + _lib._sel_initWithString_relativeToURL_1, + URLString?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL URLWithString_(SwiftLibrary _lib, NSString? URLString) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSURL1, + _lib._sel_URLWithString_1, URLString?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL URLWithString_relativeToURL_( + SwiftLibrary _lib, NSString? URLString, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_28( + _lib._class_NSURL1, + _lib._sel_URLWithString_relativeToURL_1, + URLString?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initWithDataRepresentation_relativeToURL_( + NSData? data, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_37( + _id, + _lib._sel_initWithDataRepresentation_relativeToURL_1, + data?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL URLWithDataRepresentation_relativeToURL_( + SwiftLibrary _lib, NSData? data, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_38( + _lib._class_NSURL1, + _lib._sel_URLWithDataRepresentation_relativeToURL_1, + data?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initAbsoluteURLWithDataRepresentation_relativeToURL_( + NSData? data, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_37( + _id, + _lib._sel_initAbsoluteURLWithDataRepresentation_relativeToURL_1, + data?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL absoluteURLWithDataRepresentation_relativeToURL_( + SwiftLibrary _lib, NSData? data, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_38( + _lib._class_NSURL1, + _lib._sel_absoluteURLWithDataRepresentation_relativeToURL_1, + data?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSData? get dataRepresentation { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_dataRepresentation1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSString? get absoluteString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_absoluteString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get relativeString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_relativeString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSURL? get baseURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_baseURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get absoluteURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_absoluteURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSString? get scheme { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_scheme1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get resourceSpecifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_resourceSpecifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get host { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_host1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSNumber? get port { + final _ret = _lib._objc_msgSend_192(_id, _lib._sel_port1); + return _ret.address == 0 + ? null + : NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSString? get user { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_user1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get password { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_password1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get path { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_path1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get fragment { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_fragment1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get parameterString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_parameterString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get query { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_query1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get relativePath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_relativePath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool get hasDirectoryPath { + return _lib._objc_msgSend_12(_id, _lib._sel_hasDirectoryPath1); + } + + bool getFileSystemRepresentation_maxLength_( + ffi.Pointer buffer, int maxBufferLength) { + return _lib._objc_msgSend_218( + _id, + _lib._sel_getFileSystemRepresentation_maxLength_1, + buffer, + maxBufferLength); + } + + ffi.Pointer get fileSystemRepresentation { + return _lib._objc_msgSend_13(_id, _lib._sel_fileSystemRepresentation1); + } + + bool get fileURL { + return _lib._objc_msgSend_12(_id, _lib._sel_isFileURL1); + } + + NSURL? get standardizedURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_standardizedURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + bool checkResourceIsReachableAndReturnError_( + ffi.Pointer> error) { + return _lib._objc_msgSend_219( + _id, _lib._sel_checkResourceIsReachableAndReturnError_1, error); + } + + bool isFileReferenceURL() { + return _lib._objc_msgSend_12(_id, _lib._sel_isFileReferenceURL1); + } + + NSURL fileReferenceURL() { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_fileReferenceURL1); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get filePathURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_filePathURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + bool getResourceValue_forKey_error_( + ffi.Pointer> value, + NSURLResourceKey key, + ffi.Pointer> error) { + return _lib._objc_msgSend_220( + _id, _lib._sel_getResourceValue_forKey_error_1, value, key, error); + } + + bool getPromisedItemResourceValue_forKey_error_( + ffi.Pointer> value, + NSURLResourceKey key, + ffi.Pointer> error) { + return _lib._objc_msgSend_220( + _id, + _lib._sel_getPromisedItemResourceValue_forKey_error_1, + value, + key, + error); + } + + NSDictionary promisedItemResourceValuesForKeys_error_( + NSArray? keys, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_221( + _id, + _lib._sel_promisedItemResourceValuesForKeys_error_1, + keys?._id ?? ffi.nullptr, + error); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + bool checkPromisedItemIsReachableAndReturnError_( + ffi.Pointer> error) { + return _lib._objc_msgSend_219( + _id, _lib._sel_checkPromisedItemIsReachableAndReturnError_1, error); + } + + static NSURL fileURLWithPathComponents_( + SwiftLibrary _lib, NSArray? components) { + final _ret = _lib._objc_msgSend_222(_lib._class_NSURL1, + _lib._sel_fileURLWithPathComponents_1, components?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSArray? get pathComponents { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_pathComponents1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get lastPathComponent { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_lastPathComponent1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get pathExtension { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_pathExtension1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSURL URLByAppendingPathComponent_(NSString? pathComponent) { + final _ret = _lib._objc_msgSend_34( + _id, + _lib._sel_URLByAppendingPathComponent_1, + pathComponent?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL URLByAppendingPathComponent_isDirectory_( + NSString? pathComponent, bool isDirectory) { + final _ret = _lib._objc_msgSend_33( + _id, + _lib._sel_URLByAppendingPathComponent_isDirectory_1, + pathComponent?._id ?? ffi.nullptr, + isDirectory); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get URLByDeletingLastPathComponent { + final _ret = + _lib._objc_msgSend_40(_id, _lib._sel_URLByDeletingLastPathComponent1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL URLByAppendingPathExtension_(NSString? pathExtension) { + final _ret = _lib._objc_msgSend_34( + _id, + _lib._sel_URLByAppendingPathExtension_1, + pathExtension?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get URLByDeletingPathExtension { + final _ret = + _lib._objc_msgSend_40(_id, _lib._sel_URLByDeletingPathExtension1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get URLByStandardizingPath { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_URLByStandardizingPath1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get URLByResolvingSymlinksInPath { + final _ret = + _lib._objc_msgSend_40(_id, _lib._sel_URLByResolvingSymlinksInPath1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSData resourceDataUsingCache_(bool shouldUseCache) { + final _ret = _lib._objc_msgSend_223( + _id, _lib._sel_resourceDataUsingCache_1, shouldUseCache); + return NSData._(_ret, _lib, retain: true, release: true); + } + + void loadResourceDataNotifyingClient_usingCache_( + NSObject client, bool shouldUseCache) { + return _lib._objc_msgSend_224( + _id, + _lib._sel_loadResourceDataNotifyingClient_usingCache_1, + client._id, + shouldUseCache); + } + + NSObject propertyForKey_(NSString? propertyKey) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_propertyForKey_1, propertyKey?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool setResourceData_(NSData? data) { + return _lib._objc_msgSend_23( + _id, _lib._sel_setResourceData_1, data?._id ?? ffi.nullptr); + } + + bool setProperty_forKey_(NSObject property, NSString? propertyKey) { + return _lib._objc_msgSend_225(_id, _lib._sel_setProperty_forKey_1, + property._id, propertyKey?._id ?? ffi.nullptr); + } + + NSURLHandle URLHandleUsingCache_(bool shouldUseCache) { + final _ret = _lib._objc_msgSend_232( + _id, _lib._sel_URLHandleUsingCache_1, shouldUseCache); + return NSURLHandle._(_ret, _lib, retain: true, release: true); + } + + static NSURL new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURL1, _lib._sel_new1); + return NSURL._(_ret, _lib, retain: false, release: true); + } + + static NSURL alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURL1, _lib._sel_alloc1); + return NSURL._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURL1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURL1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURL1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURL1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURL1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURL1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURL1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSURL1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURL1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSNumber extends NSValue { + NSNumber._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSNumber] that points to the same underlying object as [other]. + static NSNumber castFrom(T other) { + return NSNumber._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSNumber] that wraps the given raw object pointer. + static NSNumber castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSNumber._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSNumber]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSNumber1); + } + + @override + NSNumber initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithChar_(int value) { + final _ret = _lib._objc_msgSend_196(_id, _lib._sel_initWithChar_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithUnsignedChar_(int value) { + final _ret = + _lib._objc_msgSend_197(_id, _lib._sel_initWithUnsignedChar_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithShort_(int value) { + final _ret = _lib._objc_msgSend_198(_id, _lib._sel_initWithShort_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithUnsignedShort_(int value) { + final _ret = + _lib._objc_msgSend_199(_id, _lib._sel_initWithUnsignedShort_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithInt_(int value) { + final _ret = _lib._objc_msgSend_200(_id, _lib._sel_initWithInt_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithUnsignedInt_(int value) { + final _ret = + _lib._objc_msgSend_201(_id, _lib._sel_initWithUnsignedInt_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithLong_(int value) { + final _ret = _lib._objc_msgSend_202(_id, _lib._sel_initWithLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithUnsignedLong_(int value) { + final _ret = + _lib._objc_msgSend_203(_id, _lib._sel_initWithUnsignedLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithLongLong_(int value) { + final _ret = + _lib._objc_msgSend_204(_id, _lib._sel_initWithLongLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithUnsignedLongLong_(int value) { + final _ret = _lib._objc_msgSend_205( + _id, _lib._sel_initWithUnsignedLongLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithFloat_(double value) { + final _ret = _lib._objc_msgSend_206(_id, _lib._sel_initWithFloat_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithDouble_(double value) { + final _ret = _lib._objc_msgSend_207(_id, _lib._sel_initWithDouble_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithBool_(bool value) { + final _ret = _lib._objc_msgSend_208(_id, _lib._sel_initWithBool_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithInteger_(int value) { + final _ret = + _lib._objc_msgSend_202(_id, _lib._sel_initWithInteger_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithUnsignedInteger_(int value) { + final _ret = + _lib._objc_msgSend_203(_id, _lib._sel_initWithUnsignedInteger_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + int get charValue { + return _lib._objc_msgSend_209(_id, _lib._sel_charValue1); + } + + int get unsignedCharValue { + return _lib._objc_msgSend_210(_id, _lib._sel_unsignedCharValue1); + } + + int get shortValue { + return _lib._objc_msgSend_211(_id, _lib._sel_shortValue1); + } + + int get unsignedShortValue { + return _lib._objc_msgSend_212(_id, _lib._sel_unsignedShortValue1); + } + + int get intValue { + return _lib._objc_msgSend_213(_id, _lib._sel_intValue1); + } + + int get unsignedIntValue { + return _lib._objc_msgSend_191(_id, _lib._sel_unsignedIntValue1); + } + + int get longValue { + return _lib._objc_msgSend_78(_id, _lib._sel_longValue1); + } + + int get unsignedLongValue { + return _lib._objc_msgSend_10(_id, _lib._sel_unsignedLongValue1); + } + + int get longLongValue { + return _lib._objc_msgSend_214(_id, _lib._sel_longLongValue1); + } + + int get unsignedLongLongValue { + return _lib._objc_msgSend_148(_id, _lib._sel_unsignedLongLongValue1); + } + + double get floatValue { + return _lib._objc_msgSend_215(_id, _lib._sel_floatValue1); + } + + double get doubleValue { + return _lib._objc_msgSend_149(_id, _lib._sel_doubleValue1); + } + + bool get boolValue { + return _lib._objc_msgSend_12(_id, _lib._sel_boolValue1); + } + + int get integerValue { + return _lib._objc_msgSend_78(_id, _lib._sel_integerValue1); + } + + int get unsignedIntegerValue { + return _lib._objc_msgSend_10(_id, _lib._sel_unsignedIntegerValue1); + } + + NSString? get stringValue { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_stringValue1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int compare_(NSNumber? otherNumber) { + return _lib._objc_msgSend_216( + _id, _lib._sel_compare_1, otherNumber?._id ?? ffi.nullptr); + } + + bool isEqualToNumber_(NSNumber? number) { + return _lib._objc_msgSend_217( + _id, _lib._sel_isEqualToNumber_1, number?._id ?? ffi.nullptr); + } + + NSString descriptionWithLocale_(NSObject locale) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithChar_(SwiftLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_196( + _lib._class_NSNumber1, _lib._sel_numberWithChar_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithUnsignedChar_(SwiftLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_197( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedChar_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithShort_(SwiftLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_198( + _lib._class_NSNumber1, _lib._sel_numberWithShort_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithUnsignedShort_(SwiftLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_199( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedShort_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithInt_(SwiftLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_200( + _lib._class_NSNumber1, _lib._sel_numberWithInt_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithUnsignedInt_(SwiftLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_201( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInt_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithLong_(SwiftLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_202( + _lib._class_NSNumber1, _lib._sel_numberWithLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithUnsignedLong_(SwiftLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_203( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithLongLong_(SwiftLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_204( + _lib._class_NSNumber1, _lib._sel_numberWithLongLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithUnsignedLongLong_(SwiftLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_205( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLongLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithFloat_(SwiftLibrary _lib, double value) { + final _ret = _lib._objc_msgSend_206( + _lib._class_NSNumber1, _lib._sel_numberWithFloat_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithDouble_(SwiftLibrary _lib, double value) { + final _ret = _lib._objc_msgSend_207( + _lib._class_NSNumber1, _lib._sel_numberWithDouble_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithBool_(SwiftLibrary _lib, bool value) { + final _ret = _lib._objc_msgSend_208( + _lib._class_NSNumber1, _lib._sel_numberWithBool_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithInteger_(SwiftLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_202( + _lib._class_NSNumber1, _lib._sel_numberWithInteger_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithUnsignedInteger_(SwiftLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_203( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInteger_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithBytes_objCType_(SwiftLibrary _lib, + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_43(_lib._class_NSNumber1, + _lib._sel_valueWithBytes_objCType_1, value, type); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue value_withObjCType_(SwiftLibrary _lib, + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_43( + _lib._class_NSNumber1, _lib._sel_value_withObjCType_1, value, type); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithNonretainedObject_( + SwiftLibrary _lib, NSObject anObject) { + final _ret = _lib._objc_msgSend_44(_lib._class_NSNumber1, + _lib._sel_valueWithNonretainedObject_1, anObject._id); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithPointer_( + SwiftLibrary _lib, ffi.Pointer pointer) { + final _ret = _lib._objc_msgSend_45( + _lib._class_NSNumber1, _lib._sel_valueWithPointer_1, pointer); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithRange_(SwiftLibrary _lib, NSRange range) { + final _ret = _lib._objc_msgSend_48( + _lib._class_NSNumber1, _lib._sel_valueWithRange_1, range); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithPoint_(SwiftLibrary _lib, NSPoint point) { + final _ret = _lib._objc_msgSend_50( + _lib._class_NSNumber1, _lib._sel_valueWithPoint_1, point); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithSize_(SwiftLibrary _lib, NSSize size) { + final _ret = _lib._objc_msgSend_51( + _lib._class_NSNumber1, _lib._sel_valueWithSize_1, size); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithRect_(SwiftLibrary _lib, NSRect rect) { + final _ret = _lib._objc_msgSend_52( + _lib._class_NSNumber1, _lib._sel_valueWithRect_1, rect); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithEdgeInsets_(SwiftLibrary _lib, NSEdgeInsets insets) { + final _ret = _lib._objc_msgSend_53( + _lib._class_NSNumber1, _lib._sel_valueWithEdgeInsets_1, insets); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSNumber new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSNumber1, _lib._sel_new1); + return NSNumber._(_ret, _lib, retain: false, release: true); + } + + static NSNumber alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSNumber1, _lib._sel_alloc1); + return NSNumber._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSNumber1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSNumber1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSNumber1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSNumber1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSNumber1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSNumber1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSNumber1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSNumber1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSNumber1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSValue extends NSObject { + NSValue._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSValue] that points to the same underlying object as [other]. + static NSValue castFrom(T other) { + return NSValue._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSValue] that wraps the given raw object pointer. + static NSValue castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSValue._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSValue]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSValue1); + } + + void getValue_size_(ffi.Pointer value, int size) { + return _lib._objc_msgSend_21(_id, _lib._sel_getValue_size_1, value, size); + } + + ffi.Pointer get objCType { + return _lib._objc_msgSend_13(_id, _lib._sel_objCType1); + } + + NSValue initWithBytes_objCType_( + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_41( + _id, _lib._sel_initWithBytes_objCType_1, value, type); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + NSValue initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithBytes_objCType_(SwiftLibrary _lib, + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_43( + _lib._class_NSValue1, _lib._sel_valueWithBytes_objCType_1, value, type); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue value_withObjCType_(SwiftLibrary _lib, + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_43( + _lib._class_NSValue1, _lib._sel_value_withObjCType_1, value, type); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithNonretainedObject_( + SwiftLibrary _lib, NSObject anObject) { + final _ret = _lib._objc_msgSend_44(_lib._class_NSValue1, + _lib._sel_valueWithNonretainedObject_1, anObject._id); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + NSObject get nonretainedObjectValue { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_nonretainedObjectValue1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithPointer_( + SwiftLibrary _lib, ffi.Pointer pointer) { + final _ret = _lib._objc_msgSend_45( + _lib._class_NSValue1, _lib._sel_valueWithPointer_1, pointer); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + ffi.Pointer get pointerValue { + return _lib._objc_msgSend_19(_id, _lib._sel_pointerValue1); + } + + bool isEqualToValue_(NSValue? value) { + return _lib._objc_msgSend_46( + _id, _lib._sel_isEqualToValue_1, value?._id ?? ffi.nullptr); + } + + void getValue_(ffi.Pointer value) { + return _lib._objc_msgSend_47(_id, _lib._sel_getValue_1, value); + } + + static NSValue valueWithRange_(SwiftLibrary _lib, NSRange range) { + final _ret = _lib._objc_msgSend_48( + _lib._class_NSValue1, _lib._sel_valueWithRange_1, range); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + NSRange get rangeValue { + return _lib._objc_msgSend_49(_id, _lib._sel_rangeValue1); + } + + static NSValue valueWithPoint_(SwiftLibrary _lib, NSPoint point) { + final _ret = _lib._objc_msgSend_50( + _lib._class_NSValue1, _lib._sel_valueWithPoint_1, point); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithSize_(SwiftLibrary _lib, NSSize size) { + final _ret = _lib._objc_msgSend_51( + _lib._class_NSValue1, _lib._sel_valueWithSize_1, size); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithRect_(SwiftLibrary _lib, NSRect rect) { + final _ret = _lib._objc_msgSend_52( + _lib._class_NSValue1, _lib._sel_valueWithRect_1, rect); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithEdgeInsets_(SwiftLibrary _lib, NSEdgeInsets insets) { + final _ret = _lib._objc_msgSend_53( + _lib._class_NSValue1, _lib._sel_valueWithEdgeInsets_1, insets); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + NSPoint get pointValue { + return _lib._objc_msgSend_54(_id, _lib._sel_pointValue1); + } + + NSSize get sizeValue { + return _lib._objc_msgSend_55(_id, _lib._sel_sizeValue1); + } + + NSRect get rectValue { + return _lib._objc_msgSend_56(_id, _lib._sel_rectValue1); + } + + NSEdgeInsets get edgeInsetsValue { + return _lib._objc_msgSend_57(_id, _lib._sel_edgeInsetsValue1); + } + + static NSValue new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSValue1, _lib._sel_new1); + return NSValue._(_ret, _lib, retain: false, release: true); + } + + static NSValue alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSValue1, _lib._sel_alloc1); + return NSValue._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSValue1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSValue1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSValue1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSValue1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSValue1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSValue1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSValue1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSValue1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSValue1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSPoint = CGPoint; + +class CGPoint extends ffi.Struct { + @CGFloat() + external double x; + + @CGFloat() + external double y; +} + +typedef CGFloat = ffi.Double; +typedef NSSize = CGSize; + +class CGSize extends ffi.Struct { + @CGFloat() + external double width; + + @CGFloat() + external double height; +} + +typedef NSRect = CGRect; + +class CGRect extends ffi.Struct { + external CGPoint origin; + + external CGSize size; +} + +class NSEdgeInsets extends ffi.Struct { + @CGFloat() + external double top; + + @CGFloat() + external double left; + + @CGFloat() + external double bottom; + + @CGFloat() + external double right; +} + +class NSArray extends NSObject { + NSArray._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSArray] that points to the same underlying object as [other]. + static NSArray castFrom(T other) { + return NSArray._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSArray] that wraps the given raw object pointer. + static NSArray castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSArray._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSArray]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSArray1); + } + + int get count { + return _lib._objc_msgSend_10(_id, _lib._sel_count1); + } + + NSObject objectAtIndex_(int index) { + final _ret = _lib._objc_msgSend_60(_id, _lib._sel_objectAtIndex_1, index); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + @override + NSArray init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray initWithObjects_count_( + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61( + _id, _lib._sel_initWithObjects_count_1, objects, cnt); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray arrayByAddingObject_(NSObject anObject) { + final _ret = _lib._objc_msgSend_62( + _id, _lib._sel_arrayByAddingObject_1, anObject._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray arrayByAddingObjectsFromArray_(NSArray? otherArray) { + final _ret = _lib._objc_msgSend_63( + _id, + _lib._sel_arrayByAddingObjectsFromArray_1, + otherArray?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString componentsJoinedByString_(NSString? separator) { + final _ret = _lib._objc_msgSend_64(_id, + _lib._sel_componentsJoinedByString_1, separator?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool containsObject_(NSObject anObject) { + return _lib._objc_msgSend_0(_id, _lib._sel_containsObject_1, anObject._id); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_(NSObject locale) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_indent_(NSObject locale, int level) { + final _ret = _lib._objc_msgSend_66( + _id, _lib._sel_descriptionWithLocale_indent_1, locale._id, level); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSObject firstObjectCommonWithArray_(NSArray? otherArray) { + final _ret = _lib._objc_msgSend_67(_id, + _lib._sel_firstObjectCommonWithArray_1, otherArray?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void getObjects_range_( + ffi.Pointer> objects, NSRange range) { + return _lib._objc_msgSend_68( + _id, _lib._sel_getObjects_range_1, objects, range); + } + + int indexOfObject_(NSObject anObject) { + return _lib._objc_msgSend_69(_id, _lib._sel_indexOfObject_1, anObject._id); + } + + int indexOfObject_inRange_(NSObject anObject, NSRange range) { + return _lib._objc_msgSend_70( + _id, _lib._sel_indexOfObject_inRange_1, anObject._id, range); + } + + int indexOfObjectIdenticalTo_(NSObject anObject) { + return _lib._objc_msgSend_69( + _id, _lib._sel_indexOfObjectIdenticalTo_1, anObject._id); + } + + int indexOfObjectIdenticalTo_inRange_(NSObject anObject, NSRange range) { + return _lib._objc_msgSend_70( + _id, _lib._sel_indexOfObjectIdenticalTo_inRange_1, anObject._id, range); + } + + bool isEqualToArray_(NSArray? otherArray) { + return _lib._objc_msgSend_71( + _id, _lib._sel_isEqualToArray_1, otherArray?._id ?? ffi.nullptr); + } + + NSObject get firstObject { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_firstObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject get lastObject { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_lastObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSEnumerator objectEnumerator() { + final _ret = _lib._objc_msgSend_72(_id, _lib._sel_objectEnumerator1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + NSEnumerator reverseObjectEnumerator() { + final _ret = _lib._objc_msgSend_72(_id, _lib._sel_reverseObjectEnumerator1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + NSData? get sortedArrayHint { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_sortedArrayHint1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSArray sortedArrayUsingFunction_context_( + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + comparator, + ffi.Pointer context) { + final _ret = _lib._objc_msgSend_73( + _id, _lib._sel_sortedArrayUsingFunction_context_1, comparator, context); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray sortedArrayUsingFunction_context_hint_( + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + comparator, + ffi.Pointer context, + NSData? hint) { + final _ret = _lib._objc_msgSend_74( + _id, + _lib._sel_sortedArrayUsingFunction_context_hint_1, + comparator, + context, + hint?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray sortedArrayUsingSelector_(ffi.Pointer comparator) { + final _ret = _lib._objc_msgSend_75( + _id, _lib._sel_sortedArrayUsingSelector_1, comparator); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray subarrayWithRange_(NSRange range) { + final _ret = + _lib._objc_msgSend_76(_id, _lib._sel_subarrayWithRange_1, range); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + bool writeToURL_error_( + NSURL? url, ffi.Pointer> error) { + return _lib._objc_msgSend_81( + _id, _lib._sel_writeToURL_error_1, url?._id ?? ffi.nullptr, error); + } + + void makeObjectsPerformSelector_(ffi.Pointer aSelector) { + return _lib._objc_msgSend_7( + _id, _lib._sel_makeObjectsPerformSelector_1, aSelector); + } + + void makeObjectsPerformSelector_withObject_( + ffi.Pointer aSelector, NSObject argument) { + return _lib._objc_msgSend_82( + _id, + _lib._sel_makeObjectsPerformSelector_withObject_1, + aSelector, + argument._id); + } + + NSArray objectsAtIndexes_(NSIndexSet? indexes) { + final _ret = _lib._objc_msgSend_103( + _id, _lib._sel_objectsAtIndexes_1, indexes?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSObject objectAtIndexedSubscript_(int idx) { + final _ret = + _lib._objc_msgSend_60(_id, _lib._sel_objectAtIndexedSubscript_1, idx); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void enumerateObjectsUsingBlock_(ObjCBlock3 block) { + return _lib._objc_msgSend_104( + _id, _lib._sel_enumerateObjectsUsingBlock_1, block._id); + } + + void enumerateObjectsWithOptions_usingBlock_(int opts, ObjCBlock3 block) { + return _lib._objc_msgSend_105(_id, + _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._id); + } + + void enumerateObjectsAtIndexes_options_usingBlock_( + NSIndexSet? s, int opts, ObjCBlock3 block) { + return _lib._objc_msgSend_106( + _id, + _lib._sel_enumerateObjectsAtIndexes_options_usingBlock_1, + s?._id ?? ffi.nullptr, + opts, + block._id); + } + + int indexOfObjectPassingTest_(ObjCBlock4 predicate) { + return _lib._objc_msgSend_107( + _id, _lib._sel_indexOfObjectPassingTest_1, predicate._id); + } + + int indexOfObjectWithOptions_passingTest_(int opts, ObjCBlock4 predicate) { + return _lib._objc_msgSend_108(_id, + _lib._sel_indexOfObjectWithOptions_passingTest_1, opts, predicate._id); + } + + int indexOfObjectAtIndexes_options_passingTest_( + NSIndexSet? s, int opts, ObjCBlock4 predicate) { + return _lib._objc_msgSend_109( + _id, + _lib._sel_indexOfObjectAtIndexes_options_passingTest_1, + s?._id ?? ffi.nullptr, + opts, + predicate._id); + } + + NSIndexSet indexesOfObjectsPassingTest_(ObjCBlock4 predicate) { + final _ret = _lib._objc_msgSend_110( + _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._id); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet indexesOfObjectsWithOptions_passingTest_( + int opts, ObjCBlock4 predicate) { + final _ret = _lib._objc_msgSend_111( + _id, + _lib._sel_indexesOfObjectsWithOptions_passingTest_1, + opts, + predicate._id); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet indexesOfObjectsAtIndexes_options_passingTest_( + NSIndexSet? s, int opts, ObjCBlock4 predicate) { + final _ret = _lib._objc_msgSend_112( + _id, + _lib._sel_indexesOfObjectsAtIndexes_options_passingTest_1, + s?._id ?? ffi.nullptr, + opts, + predicate._id); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSArray sortedArrayUsingComparator_(NSComparator cmptr) { + final _ret = _lib._objc_msgSend_113( + _id, _lib._sel_sortedArrayUsingComparator_1, cmptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray sortedArrayWithOptions_usingComparator_( + int opts, NSComparator cmptr) { + final _ret = _lib._objc_msgSend_114( + _id, _lib._sel_sortedArrayWithOptions_usingComparator_1, opts, cmptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + int indexOfObject_inSortedRange_options_usingComparator_( + NSObject obj, NSRange r, int opts, NSComparator cmp) { + return _lib._objc_msgSend_115( + _id, + _lib._sel_indexOfObject_inSortedRange_options_usingComparator_1, + obj._id, + r, + opts, + cmp); + } + + static NSArray array(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSArray1, _lib._sel_array1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray arrayWithObject_(SwiftLibrary _lib, NSObject anObject) { + final _ret = _lib._objc_msgSend_16( + _lib._class_NSArray1, _lib._sel_arrayWithObject_1, anObject._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray arrayWithObjects_count_(SwiftLibrary _lib, + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61( + _lib._class_NSArray1, _lib._sel_arrayWithObjects_count_1, objects, cnt); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray arrayWithObjects_(SwiftLibrary _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_16( + _lib._class_NSArray1, _lib._sel_arrayWithObjects_1, firstObj._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray arrayWithArray_(SwiftLibrary _lib, NSArray? array) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSArray1, + _lib._sel_arrayWithArray_1, array?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray initWithObjects_(NSObject firstObj) { + final _ret = + _lib._objc_msgSend_16(_id, _lib._sel_initWithObjects_1, firstObj._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray initWithArray_(NSArray? array) { + final _ret = _lib._objc_msgSend_67( + _id, _lib._sel_initWithArray_1, array?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray initWithArray_copyItems_(NSArray? array, bool flag) { + final _ret = _lib._objc_msgSend_116(_id, + _lib._sel_initWithArray_copyItems_1, array?._id ?? ffi.nullptr, flag); + return NSArray._(_ret, _lib, retain: false, release: true); + } + + NSArray initWithContentsOfURL_error_( + NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_117( + _id, + _lib._sel_initWithContentsOfURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray arrayWithContentsOfURL_error_(SwiftLibrary _lib, NSURL? url, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_117( + _lib._class_NSArray1, + _lib._sel_arrayWithContentsOfURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void getObjects_(ffi.Pointer> objects) { + return _lib._objc_msgSend_118(_id, _lib._sel_getObjects_1, objects); + } + + static NSArray arrayWithContentsOfFile_(SwiftLibrary _lib, NSString? path) { + final _ret = _lib._objc_msgSend_119(_lib._class_NSArray1, + _lib._sel_arrayWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray arrayWithContentsOfURL_(SwiftLibrary _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_120(_lib._class_NSArray1, + _lib._sel_arrayWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray initWithContentsOfFile_(NSString? path) { + final _ret = _lib._objc_msgSend_119( + _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_120( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + bool writeToFile_atomically_(NSString? path, bool useAuxiliaryFile) { + return _lib._objc_msgSend_25(_id, _lib._sel_writeToFile_atomically_1, + path?._id ?? ffi.nullptr, useAuxiliaryFile); + } + + bool writeToURL_atomically_(NSURL? url, bool atomically) { + return _lib._objc_msgSend_121(_id, _lib._sel_writeToURL_atomically_1, + url?._id ?? ffi.nullptr, atomically); + } + + NSArray pathsMatchingExtensions_(NSArray? filterTypes) { + final _ret = _lib._objc_msgSend_63(_id, _lib._sel_pathsMatchingExtensions_1, + filterTypes?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + @override + NSObject valueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_valueForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + @override + void setValue_forKey_(NSObject value, NSString? key) { + return _lib._objc_msgSend_122( + _id, _lib._sel_setValue_forKey_1, value._id, key?._id ?? ffi.nullptr); + } + + void addObserver_toObjectsAtIndexes_forKeyPath_options_context_( + NSObject? observer, + NSIndexSet? indexes, + NSString? keyPath, + int options, + ffi.Pointer context) { + return _lib._objc_msgSend_123( + _id, + _lib._sel_addObserver_toObjectsAtIndexes_forKeyPath_options_context_1, + observer?._id ?? ffi.nullptr, + indexes?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + options, + context); + } + + void removeObserver_fromObjectsAtIndexes_forKeyPath_context_( + NSObject? observer, + NSIndexSet? indexes, + NSString? keyPath, + ffi.Pointer context) { + return _lib._objc_msgSend_124( + _id, + _lib._sel_removeObserver_fromObjectsAtIndexes_forKeyPath_context_1, + observer?._id ?? ffi.nullptr, + indexes?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + context); + } + + void removeObserver_fromObjectsAtIndexes_forKeyPath_( + NSObject? observer, NSIndexSet? indexes, NSString? keyPath) { + return _lib._objc_msgSend_125( + _id, + _lib._sel_removeObserver_fromObjectsAtIndexes_forKeyPath_1, + observer?._id ?? ffi.nullptr, + indexes?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr); + } + + @override + void addObserver_forKeyPath_options_context_(NSObject? observer, + NSString? keyPath, int options, ffi.Pointer context) { + return _lib._objc_msgSend_126( + _id, + _lib._sel_addObserver_forKeyPath_options_context_1, + observer?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + options, + context); + } + + @override + void removeObserver_forKeyPath_context_( + NSObject? observer, NSString? keyPath, ffi.Pointer context) { + return _lib._objc_msgSend_127( + _id, + _lib._sel_removeObserver_forKeyPath_context_1, + observer?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + context); + } + + @override + void removeObserver_forKeyPath_(NSObject? observer, NSString? keyPath) { + return _lib._objc_msgSend_128(_id, _lib._sel_removeObserver_forKeyPath_1, + observer?._id ?? ffi.nullptr, keyPath?._id ?? ffi.nullptr); + } + + NSArray sortedArrayUsingDescriptors_(NSArray? sortDescriptors) { + final _ret = _lib._objc_msgSend_63( + _id, + _lib._sel_sortedArrayUsingDescriptors_1, + sortDescriptors?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray filteredArrayUsingPredicate_(NSPredicate? predicate) { + final _ret = _lib._objc_msgSend_195(_id, + _lib._sel_filteredArrayUsingPredicate_1, predicate?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSArray1, _lib._sel_new1); + return NSArray._(_ret, _lib, retain: false, release: true); + } + + static NSArray alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSArray1, _lib._sel_alloc1); + return NSArray._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSArray1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSArray1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSArray1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSArray1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSArray1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSArray1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSArray1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSArray1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSArray1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSInteger = ffi.Long; + +class NSError extends NSObject { + NSError._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSError] that points to the same underlying object as [other]. + static NSError castFrom(T other) { + return NSError._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSError] that wraps the given raw object pointer. + static NSError castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSError._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSError]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSError1); + } + + NSError initWithDomain_code_userInfo_(NSErrorDomain domain, int code) { + final _ret = _lib._objc_msgSend_77( + _id, _lib._sel_initWithDomain_code_userInfo_1, domain, code); + return NSError._(_ret, _lib, retain: true, release: true); + } + + static NSError errorWithDomain_code_userInfo_( + SwiftLibrary _lib, NSErrorDomain domain, int code) { + final _ret = _lib._objc_msgSend_77(_lib._class_NSError1, + _lib._sel_errorWithDomain_code_userInfo_1, domain, code); + return NSError._(_ret, _lib, retain: true, release: true); + } + + NSErrorDomain get domain { + return _lib._objc_msgSend_20(_id, _lib._sel_domain1); + } + + int get code { + return _lib._objc_msgSend_78(_id, _lib._sel_code1); + } + + static NSError new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSError1, _lib._sel_new1); + return NSError._(_ret, _lib, retain: false, release: true); + } + + static NSError alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSError1, _lib._sel_alloc1); + return NSError._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSError1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSError1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSError1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSError1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSError1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSError1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSError1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSError1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSError1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSErrorDomain = ffi.Pointer; + +class NSIndexSet extends NSObject { + NSIndexSet._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSIndexSet] that points to the same underlying object as [other]. + static NSIndexSet castFrom(T other) { + return NSIndexSet._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSIndexSet] that wraps the given raw object pointer. + static NSIndexSet castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSIndexSet._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSIndexSet]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSIndexSet1); + } + + static NSIndexSet indexSet(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSIndexSet1, _lib._sel_indexSet1); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + static NSIndexSet indexSetWithIndex_(SwiftLibrary _lib, int value) { + final _ret = _lib._objc_msgSend_60( + _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndex_1, value); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + static NSIndexSet indexSetWithIndexesInRange_( + SwiftLibrary _lib, NSRange range) { + final _ret = _lib._objc_msgSend_83( + _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndexesInRange_1, range); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet initWithIndexesInRange_(NSRange range) { + final _ret = + _lib._objc_msgSend_83(_id, _lib._sel_initWithIndexesInRange_1, range); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet initWithIndexSet_(NSIndexSet? indexSet) { + final _ret = _lib._objc_msgSend_84( + _id, _lib._sel_initWithIndexSet_1, indexSet?._id ?? ffi.nullptr); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet initWithIndex_(int value) { + final _ret = _lib._objc_msgSend_60(_id, _lib._sel_initWithIndex_1, value); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + bool isEqualToIndexSet_(NSIndexSet? indexSet) { + return _lib._objc_msgSend_85( + _id, _lib._sel_isEqualToIndexSet_1, indexSet?._id ?? ffi.nullptr); + } + + int get count { + return _lib._objc_msgSend_10(_id, _lib._sel_count1); + } + + int get firstIndex { + return _lib._objc_msgSend_10(_id, _lib._sel_firstIndex1); + } + + int get lastIndex { + return _lib._objc_msgSend_10(_id, _lib._sel_lastIndex1); + } + + int indexGreaterThanIndex_(int value) { + return _lib._objc_msgSend_86(_id, _lib._sel_indexGreaterThanIndex_1, value); + } + + int indexLessThanIndex_(int value) { + return _lib._objc_msgSend_86(_id, _lib._sel_indexLessThanIndex_1, value); + } + + int indexGreaterThanOrEqualToIndex_(int value) { + return _lib._objc_msgSend_86( + _id, _lib._sel_indexGreaterThanOrEqualToIndex_1, value); + } + + int indexLessThanOrEqualToIndex_(int value) { + return _lib._objc_msgSend_86( + _id, _lib._sel_indexLessThanOrEqualToIndex_1, value); + } + + int getIndexes_maxCount_inIndexRange_(ffi.Pointer indexBuffer, + int bufferSize, NSRangePointer range) { + return _lib._objc_msgSend_87( + _id, + _lib._sel_getIndexes_maxCount_inIndexRange_1, + indexBuffer, + bufferSize, + range); + } + + int countOfIndexesInRange_(NSRange range) { + return _lib._objc_msgSend_88(_id, _lib._sel_countOfIndexesInRange_1, range); + } + + bool containsIndex_(int value) { + return _lib._objc_msgSend_89(_id, _lib._sel_containsIndex_1, value); + } + + bool containsIndexesInRange_(NSRange range) { + return _lib._objc_msgSend_90( + _id, _lib._sel_containsIndexesInRange_1, range); + } + + bool containsIndexes_(NSIndexSet? indexSet) { + return _lib._objc_msgSend_85( + _id, _lib._sel_containsIndexes_1, indexSet?._id ?? ffi.nullptr); + } + + bool intersectsIndexesInRange_(NSRange range) { + return _lib._objc_msgSend_90( + _id, _lib._sel_intersectsIndexesInRange_1, range); + } + + void enumerateIndexesUsingBlock_(ObjCBlock block) { + return _lib._objc_msgSend_91( + _id, _lib._sel_enumerateIndexesUsingBlock_1, block._id); + } + + void enumerateIndexesWithOptions_usingBlock_(int opts, ObjCBlock block) { + return _lib._objc_msgSend_92(_id, + _lib._sel_enumerateIndexesWithOptions_usingBlock_1, opts, block._id); + } + + void enumerateIndexesInRange_options_usingBlock_( + NSRange range, int opts, ObjCBlock block) { + return _lib._objc_msgSend_93( + _id, + _lib._sel_enumerateIndexesInRange_options_usingBlock_1, + range, + opts, + block._id); + } + + int indexPassingTest_(ObjCBlock1 predicate) { + return _lib._objc_msgSend_94( + _id, _lib._sel_indexPassingTest_1, predicate._id); + } + + int indexWithOptions_passingTest_(int opts, ObjCBlock1 predicate) { + return _lib._objc_msgSend_95( + _id, _lib._sel_indexWithOptions_passingTest_1, opts, predicate._id); + } + + int indexInRange_options_passingTest_( + NSRange range, int opts, ObjCBlock1 predicate) { + return _lib._objc_msgSend_96( + _id, + _lib._sel_indexInRange_options_passingTest_1, + range, + opts, + predicate._id); + } + + NSIndexSet indexesPassingTest_(ObjCBlock1 predicate) { + final _ret = _lib._objc_msgSend_97( + _id, _lib._sel_indexesPassingTest_1, predicate._id); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet indexesWithOptions_passingTest_(int opts, ObjCBlock1 predicate) { + final _ret = _lib._objc_msgSend_98( + _id, _lib._sel_indexesWithOptions_passingTest_1, opts, predicate._id); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet indexesInRange_options_passingTest_( + NSRange range, int opts, ObjCBlock1 predicate) { + final _ret = _lib._objc_msgSend_99( + _id, + _lib._sel_indexesInRange_options_passingTest_1, + range, + opts, + predicate._id); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + void enumerateRangesUsingBlock_(ObjCBlock2 block) { + return _lib._objc_msgSend_100( + _id, _lib._sel_enumerateRangesUsingBlock_1, block._id); + } + + void enumerateRangesWithOptions_usingBlock_(int opts, ObjCBlock2 block) { + return _lib._objc_msgSend_101(_id, + _lib._sel_enumerateRangesWithOptions_usingBlock_1, opts, block._id); + } + + void enumerateRangesInRange_options_usingBlock_( + NSRange range, int opts, ObjCBlock2 block) { + return _lib._objc_msgSend_102( + _id, + _lib._sel_enumerateRangesInRange_options_usingBlock_1, + range, + opts, + block._id); + } + + static NSIndexSet new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSIndexSet1, _lib._sel_new1); + return NSIndexSet._(_ret, _lib, retain: false, release: true); + } + + static NSIndexSet alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSIndexSet1, _lib._sel_alloc1); + return NSIndexSet._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSIndexSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSIndexSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSIndexSet1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSIndexSet1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSIndexSet1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSIndexSet1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSIndexSet1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSIndexSet1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSIndexSet1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSRangePointer = ffi.Pointer; + +class _ObjCBlockBase implements ffi.Finalizable { + final ffi.Pointer<_ObjCBlock> _id; + final SwiftLibrary _lib; + bool _pendingRelease; + + _ObjCBlockBase._(this._id, this._lib, + {bool retain = false, bool release = false}) + : _pendingRelease = release { + if (retain) { + _lib._Block_copy(_id.cast()); + } + if (release) { + _lib._objc_releaseFinalizer11.attach(this, _id.cast(), detach: this); + } + } + + /// Releases the reference to the underlying ObjC block held by this wrapper. + /// Throws a StateError if this wrapper doesn't currently hold a reference. + void release() { + if (_pendingRelease) { + _pendingRelease = false; + _lib._Block_release(_id.cast()); + _lib._objc_releaseFinalizer11.detach(this); + } else { + throw StateError( + 'Released an ObjC block that was unowned or already released.'); + } + } + + @override + bool operator ==(Object other) { + return other is _ObjCBlockBase && _id == other._id; + } + + @override + int get hashCode => _id.hashCode; +} + +void _ObjCBlock_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(NSUInteger arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function(int arg0, ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock_closureRegistry = {}; +int _ObjCBlock_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_registerClosure(Function fn) { + final id = ++_ObjCBlock_closureRegistryIndex; + _ObjCBlock_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) { + return _ObjCBlock_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock extends _ObjCBlockBase { + ObjCBlock._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + NSUInteger arg0, ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + NSUInteger arg0, ffi.Pointer arg1)>( + _ObjCBlock_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock.fromFunction( + SwiftLibrary lib, void Function(int arg0, ffi.Pointer arg1) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + NSUInteger arg0, ffi.Pointer arg1)>( + _ObjCBlock_closureTrampoline) + .cast(), + _ObjCBlock_registerClosure(fn)), + lib); + void call(int arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + NSUInteger arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, int arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +class _ObjCBlockDesc extends ffi.Struct { + @ffi.UnsignedLong() + external int reserved; + + @ffi.UnsignedLong() + external int size; + + external ffi.Pointer copy_helper; + + external ffi.Pointer dispose_helper; + + external ffi.Pointer signature; +} + +class _ObjCBlock extends ffi.Struct { + external ffi.Pointer isa; + + @ffi.Int() + external int flags; + + @ffi.Int() + external int reserved; + + external ffi.Pointer invoke; + + external ffi.Pointer<_ObjCBlockDesc> descriptor; + + external ffi.Pointer target; +} + +abstract class NSEnumerationOptions { + static const int NSEnumerationConcurrent = 1; + static const int NSEnumerationReverse = 2; +} + +bool _ObjCBlock1_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function(NSUInteger arg0, ffi.Pointer arg1)>>() + .asFunction< + bool Function(int arg0, ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock1_closureRegistry = {}; +int _ObjCBlock1_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock1_registerClosure(Function fn) { + final id = ++_ObjCBlock1_closureRegistryIndex; + _ObjCBlock1_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +bool _ObjCBlock1_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) { + return _ObjCBlock1_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock1 extends _ObjCBlockBase { + ObjCBlock1._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock1.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + NSUInteger arg0, ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function(ffi.Pointer<_ObjCBlock> block, + NSUInteger arg0, ffi.Pointer arg1)>( + _ObjCBlock1_fnPtrTrampoline, false) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock1.fromFunction( + SwiftLibrary lib, bool Function(int arg0, ffi.Pointer arg1) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function(ffi.Pointer<_ObjCBlock> block, + NSUInteger arg0, ffi.Pointer arg1)>( + _ObjCBlock1_closureTrampoline, false) + .cast(), + _ObjCBlock1_registerClosure(fn)), + lib); + bool call(int arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer<_ObjCBlock> block, + NSUInteger arg0, ffi.Pointer arg1)>>() + .asFunction< + bool Function(ffi.Pointer<_ObjCBlock> block, int arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +void _ObjCBlock2_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, NSRange arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(NSRange arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function( + NSRange arg0, ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock2_closureRegistry = {}; +int _ObjCBlock2_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock2_registerClosure(Function fn) { + final id = ++_ObjCBlock2_closureRegistryIndex; + _ObjCBlock2_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock2_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, NSRange arg0, ffi.Pointer arg1) { + return _ObjCBlock2_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock2 extends _ObjCBlockBase { + ObjCBlock2._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock2.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(NSRange arg0, ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + NSRange arg0, ffi.Pointer arg1)>( + _ObjCBlock2_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock2.fromFunction(SwiftLibrary lib, + void Function(NSRange arg0, ffi.Pointer arg1) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + NSRange arg0, ffi.Pointer arg1)>( + _ObjCBlock2_closureTrampoline) + .cast(), + _ObjCBlock2_registerClosure(fn)), + lib); + void call(NSRange arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, NSRange arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, NSRange arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +void _ObjCBlock3_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSUInteger arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock3_closureRegistry = {}; +int _ObjCBlock3_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock3_registerClosure(Function fn) { + final id = ++_ObjCBlock3_closureRegistryIndex; + _ObjCBlock3_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock3_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return _ObjCBlock3_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock3 extends _ObjCBlockBase { + ObjCBlock3._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock3.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + NSUInteger arg1, ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>( + _ObjCBlock3_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock3.fromFunction( + SwiftLibrary lib, + void Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>( + _ObjCBlock3_closureTrampoline) + .cast(), + _ObjCBlock3_registerClosure(fn)), + lib); + void call( + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +bool _ObjCBlock4_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, NSUInteger arg1, + ffi.Pointer arg2)>>() + .asFunction< + bool Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock4_closureRegistry = {}; +int _ObjCBlock4_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock4_registerClosure(Function fn) { + final id = ++_ObjCBlock4_closureRegistryIndex; + _ObjCBlock4_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +bool _ObjCBlock4_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return _ObjCBlock4_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock4 extends _ObjCBlockBase { + ObjCBlock4._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock4.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer arg0, NSUInteger arg1, ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>( + _ObjCBlock4_fnPtrTrampoline, false) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock4.fromFunction( + SwiftLibrary lib, + bool Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>( + _ObjCBlock4_closureTrampoline, false) + .cast(), + _ObjCBlock4_registerClosure(fn)), + lib); + bool call( + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>>() + .asFunction< + bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +typedef NSComparator = ffi.Pointer<_ObjCBlock>; +int _ObjCBlock5_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + int Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock5_closureRegistry = {}; +int _ObjCBlock5_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock5_registerClosure(Function fn) { + final id = ++_ObjCBlock5_closureRegistryIndex; + _ObjCBlock5_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +int _ObjCBlock5_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return _ObjCBlock5_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock5 extends _ObjCBlockBase { + ObjCBlock5._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock5.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Int32 Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock5_fnPtrTrampoline, 0) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock5.fromFunction( + SwiftLibrary lib, + int Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Int32 Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock5_closureTrampoline, 0) + .cast(), + _ObjCBlock5_registerClosure(fn)), + lib); + int call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + int Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +abstract class NSComparisonResult { + static const int NSOrderedAscending = -1; + static const int NSOrderedSame = 0; + static const int NSOrderedDescending = 1; +} + +abstract class NSSortOptions { + static const int NSSortConcurrent = 1; + static const int NSSortStable = 16; +} + +abstract class NSBinarySearchingOptions { + static const int NSBinarySearchingFirstEqual = 256; + static const int NSBinarySearchingLastEqual = 512; + static const int NSBinarySearchingInsertionIndex = 1024; +} + +abstract class NSKeyValueObservingOptions { + static const int NSKeyValueObservingOptionNew = 1; + static const int NSKeyValueObservingOptionOld = 2; + static const int NSKeyValueObservingOptionInitial = 4; + static const int NSKeyValueObservingOptionPrior = 8; +} + +class NSPredicate extends NSObject { + NSPredicate._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSPredicate] that points to the same underlying object as [other]. + static NSPredicate castFrom(T other) { + return NSPredicate._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSPredicate] that wraps the given raw object pointer. + static NSPredicate castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSPredicate._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSPredicate]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSPredicate1); + } + + static NSPredicate predicateWithFormat_argumentArray_( + SwiftLibrary _lib, NSString? predicateFormat, NSArray? arguments) { + final _ret = _lib._objc_msgSend_129( + _lib._class_NSPredicate1, + _lib._sel_predicateWithFormat_argumentArray_1, + predicateFormat?._id ?? ffi.nullptr, + arguments?._id ?? ffi.nullptr); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + static NSPredicate predicateWithFormat_( + SwiftLibrary _lib, NSString? predicateFormat) { + final _ret = _lib._objc_msgSend_130(_lib._class_NSPredicate1, + _lib._sel_predicateWithFormat_1, predicateFormat?._id ?? ffi.nullptr); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + static NSPredicate predicateWithFormat_arguments_(SwiftLibrary _lib, + NSString? predicateFormat, ffi.Pointer<__va_list_tag> argList) { + final _ret = _lib._objc_msgSend_131( + _lib._class_NSPredicate1, + _lib._sel_predicateWithFormat_arguments_1, + predicateFormat?._id ?? ffi.nullptr, + argList); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + static NSPredicate predicateFromMetadataQueryString_( + SwiftLibrary _lib, NSString? queryString) { + final _ret = _lib._objc_msgSend_130( + _lib._class_NSPredicate1, + _lib._sel_predicateFromMetadataQueryString_1, + queryString?._id ?? ffi.nullptr); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + static NSPredicate predicateWithValue_(SwiftLibrary _lib, bool value) { + final _ret = _lib._objc_msgSend_132( + _lib._class_NSPredicate1, _lib._sel_predicateWithValue_1, value); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + static NSPredicate predicateWithBlock_(SwiftLibrary _lib, ObjCBlock6 block) { + final _ret = _lib._objc_msgSend_193( + _lib._class_NSPredicate1, _lib._sel_predicateWithBlock_1, block._id); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + NSString? get predicateFormat { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_predicateFormat1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSPredicate predicateWithSubstitutionVariables_(NSDictionary? variables) { + final _ret = _lib._objc_msgSend_143( + _id, + _lib._sel_predicateWithSubstitutionVariables_1, + variables?._id ?? ffi.nullptr); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + bool evaluateWithObject_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_evaluateWithObject_1, object._id); + } + + bool evaluateWithObject_substitutionVariables_( + NSObject object, NSDictionary? bindings) { + return _lib._objc_msgSend_194( + _id, + _lib._sel_evaluateWithObject_substitutionVariables_1, + object._id, + bindings?._id ?? ffi.nullptr); + } + + void allowEvaluation() { + return _lib._objc_msgSend_1(_id, _lib._sel_allowEvaluation1); + } + + static NSPredicate new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSPredicate1, _lib._sel_new1); + return NSPredicate._(_ret, _lib, retain: false, release: true); + } + + static NSPredicate alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPredicate1, _lib._sel_alloc1); + return NSPredicate._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSPredicate1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSPredicate1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPredicate1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPredicate1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSPredicate1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSPredicate1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSPredicate1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSPredicate1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPredicate1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class __va_list_tag extends ffi.Struct { + @ffi.UnsignedInt() + external int gp_offset; + + @ffi.UnsignedInt() + external int fp_offset; + + external ffi.Pointer overflow_arg_area; + + external ffi.Pointer reg_save_area; +} + +bool _ObjCBlock6_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock6_closureRegistry = {}; +int _ObjCBlock6_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock6_registerClosure(Function fn) { + final id = ++_ObjCBlock6_closureRegistryIndex; + _ObjCBlock6_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +bool _ObjCBlock6_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return _ObjCBlock6_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock6 extends _ObjCBlockBase { + ObjCBlock6._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock6.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock6_fnPtrTrampoline, false) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock6.fromFunction( + SwiftLibrary lib, + bool Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock6_closureTrampoline, false) + .cast(), + _ObjCBlock6_registerClosure(fn)), + lib); + bool call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +class NSDictionary extends NSObject { + NSDictionary._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSDictionary] that points to the same underlying object as [other]. + static NSDictionary castFrom(T other) { + return NSDictionary._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSDictionary] that wraps the given raw object pointer. + static NSDictionary castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSDictionary._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSDictionary]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSDictionary1); + } + + int get count { + return _lib._objc_msgSend_10(_id, _lib._sel_count1); + } + + NSObject objectForKey_(NSObject aKey) { + final _ret = _lib._objc_msgSend_16(_id, _lib._sel_objectForKey_1, aKey._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSEnumerator keyEnumerator() { + final _ret = _lib._objc_msgSend_72(_id, _lib._sel_keyEnumerator1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + @override + NSDictionary init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithObjects_forKeys_count_( + ffi.Pointer> objects, + ffi.Pointer> keys, + int cnt) { + final _ret = _lib._objc_msgSend_133( + _id, _lib._sel_initWithObjects_forKeys_count_1, objects, keys, cnt); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSArray? get allKeys { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_allKeys1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray allKeysForObject_(NSObject anObject) { + final _ret = + _lib._objc_msgSend_62(_id, _lib._sel_allKeysForObject_1, anObject._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get allValues { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_allValues1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get descriptionInStringsFileFormat { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_descriptionInStringsFileFormat1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_(NSObject locale) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_indent_(NSObject locale, int level) { + final _ret = _lib._objc_msgSend_66( + _id, _lib._sel_descriptionWithLocale_indent_1, locale._id, level); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool isEqualToDictionary_(NSDictionary? otherDictionary) { + return _lib._objc_msgSend_134(_id, _lib._sel_isEqualToDictionary_1, + otherDictionary?._id ?? ffi.nullptr); + } + + NSEnumerator objectEnumerator() { + final _ret = _lib._objc_msgSend_72(_id, _lib._sel_objectEnumerator1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + NSArray objectsForKeys_notFoundMarker_(NSArray? keys, NSObject marker) { + final _ret = _lib._objc_msgSend_135( + _id, + _lib._sel_objectsForKeys_notFoundMarker_1, + keys?._id ?? ffi.nullptr, + marker._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + bool writeToURL_error_( + NSURL? url, ffi.Pointer> error) { + return _lib._objc_msgSend_81( + _id, _lib._sel_writeToURL_error_1, url?._id ?? ffi.nullptr, error); + } + + NSArray keysSortedByValueUsingSelector_(ffi.Pointer comparator) { + final _ret = _lib._objc_msgSend_75( + _id, _lib._sel_keysSortedByValueUsingSelector_1, comparator); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void getObjects_andKeys_count_(ffi.Pointer> objects, + ffi.Pointer> keys, int count) { + return _lib._objc_msgSend_136( + _id, _lib._sel_getObjects_andKeys_count_1, objects, keys, count); + } + + NSObject objectForKeyedSubscript_(NSObject key) { + final _ret = _lib._objc_msgSend_16( + _id, _lib._sel_objectForKeyedSubscript_1, key._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void enumerateKeysAndObjectsUsingBlock_(ObjCBlock7 block) { + return _lib._objc_msgSend_137( + _id, _lib._sel_enumerateKeysAndObjectsUsingBlock_1, block._id); + } + + void enumerateKeysAndObjectsWithOptions_usingBlock_( + int opts, ObjCBlock7 block) { + return _lib._objc_msgSend_138( + _id, + _lib._sel_enumerateKeysAndObjectsWithOptions_usingBlock_1, + opts, + block._id); + } + + NSArray keysSortedByValueUsingComparator_(NSComparator cmptr) { + final _ret = _lib._objc_msgSend_113( + _id, _lib._sel_keysSortedByValueUsingComparator_1, cmptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray keysSortedByValueWithOptions_usingComparator_( + int opts, NSComparator cmptr) { + final _ret = _lib._objc_msgSend_114(_id, + _lib._sel_keysSortedByValueWithOptions_usingComparator_1, opts, cmptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void getObjects_andKeys_(ffi.Pointer> objects, + ffi.Pointer> keys) { + return _lib._objc_msgSend_139( + _id, _lib._sel_getObjects_andKeys_1, objects, keys); + } + + static NSDictionary dictionaryWithContentsOfFile_( + SwiftLibrary _lib, NSString? path) { + final _ret = _lib._objc_msgSend_140(_lib._class_NSDictionary1, + _lib._sel_dictionaryWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithContentsOfURL_( + SwiftLibrary _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_141(_lib._class_NSDictionary1, + _lib._sel_dictionaryWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithContentsOfFile_(NSString? path) { + final _ret = _lib._objc_msgSend_140( + _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_141( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + bool writeToFile_atomically_(NSString? path, bool useAuxiliaryFile) { + return _lib._objc_msgSend_25(_id, _lib._sel_writeToFile_atomically_1, + path?._id ?? ffi.nullptr, useAuxiliaryFile); + } + + bool writeToURL_atomically_(NSURL? url, bool atomically) { + return _lib._objc_msgSend_121(_id, _lib._sel_writeToURL_atomically_1, + url?._id ?? ffi.nullptr, atomically); + } + + static NSDictionary dictionary(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDictionary1, _lib._sel_dictionary1); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithObject_forKey_( + SwiftLibrary _lib, NSObject object, NSObject key) { + final _ret = _lib._objc_msgSend_142(_lib._class_NSDictionary1, + _lib._sel_dictionaryWithObject_forKey_1, object._id, key._id); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithObjects_forKeys_count_( + SwiftLibrary _lib, + ffi.Pointer> objects, + ffi.Pointer> keys, + int cnt) { + final _ret = _lib._objc_msgSend_133(_lib._class_NSDictionary1, + _lib._sel_dictionaryWithObjects_forKeys_count_1, objects, keys, cnt); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithObjectsAndKeys_( + SwiftLibrary _lib, NSObject firstObject) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSDictionary1, + _lib._sel_dictionaryWithObjectsAndKeys_1, firstObject._id); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithDictionary_( + SwiftLibrary _lib, NSDictionary? dict) { + final _ret = _lib._objc_msgSend_143(_lib._class_NSDictionary1, + _lib._sel_dictionaryWithDictionary_1, dict?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithObjects_forKeys_( + SwiftLibrary _lib, NSArray? objects, NSArray? keys) { + final _ret = _lib._objc_msgSend_144( + _lib._class_NSDictionary1, + _lib._sel_dictionaryWithObjects_forKeys_1, + objects?._id ?? ffi.nullptr, + keys?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithObjectsAndKeys_(NSObject firstObject) { + final _ret = _lib._objc_msgSend_16( + _id, _lib._sel_initWithObjectsAndKeys_1, firstObject._id); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithDictionary_(NSDictionary? otherDictionary) { + final _ret = _lib._objc_msgSend_143(_id, _lib._sel_initWithDictionary_1, + otherDictionary?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithDictionary_copyItems_( + NSDictionary? otherDictionary, bool flag) { + final _ret = _lib._objc_msgSend_145( + _id, + _lib._sel_initWithDictionary_copyItems_1, + otherDictionary?._id ?? ffi.nullptr, + flag); + return NSDictionary._(_ret, _lib, retain: false, release: true); + } + + NSDictionary initWithObjects_forKeys_(NSArray? objects, NSArray? keys) { + final _ret = _lib._objc_msgSend_144( + _id, + _lib._sel_initWithObjects_forKeys_1, + objects?._id ?? ffi.nullptr, + keys?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithContentsOfURL_error_( + NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_146( + _id, + _lib._sel_initWithContentsOfURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithContentsOfURL_error_(SwiftLibrary _lib, + NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_146( + _lib._class_NSDictionary1, + _lib._sel_dictionaryWithContentsOfURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSObject sharedKeySetForKeys_(SwiftLibrary _lib, NSArray? keys) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSDictionary1, + _lib._sel_sharedKeySetForKeys_1, keys?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + int countByEnumeratingWithState_objects_count_( + ffi.Pointer state, + ffi.Pointer> buffer, + int len) { + return _lib._objc_msgSend_147( + _id, + _lib._sel_countByEnumeratingWithState_objects_count_1, + state, + buffer, + len); + } + + int fileSize() { + return _lib._objc_msgSend_148(_id, _lib._sel_fileSize1); + } + + NSDate fileModificationDate() { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_fileModificationDate1); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSString fileType() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_fileType1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + int filePosixPermissions() { + return _lib._objc_msgSend_10(_id, _lib._sel_filePosixPermissions1); + } + + NSString fileOwnerAccountName() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_fileOwnerAccountName1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString fileGroupOwnerAccountName() { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_fileGroupOwnerAccountName1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + int fileSystemNumber() { + return _lib._objc_msgSend_78(_id, _lib._sel_fileSystemNumber1); + } + + int fileSystemFileNumber() { + return _lib._objc_msgSend_10(_id, _lib._sel_fileSystemFileNumber1); + } + + bool fileExtensionHidden() { + return _lib._objc_msgSend_12(_id, _lib._sel_fileExtensionHidden1); + } + + int fileHFSCreatorCode() { + return _lib._objc_msgSend_191(_id, _lib._sel_fileHFSCreatorCode1); + } + + int fileHFSTypeCode() { + return _lib._objc_msgSend_191(_id, _lib._sel_fileHFSTypeCode1); + } + + bool fileIsImmutable() { + return _lib._objc_msgSend_12(_id, _lib._sel_fileIsImmutable1); + } + + bool fileIsAppendOnly() { + return _lib._objc_msgSend_12(_id, _lib._sel_fileIsAppendOnly1); + } + + NSDate fileCreationDate() { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_fileCreationDate1); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSNumber fileOwnerAccountID() { + final _ret = _lib._objc_msgSend_192(_id, _lib._sel_fileOwnerAccountID1); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber fileGroupOwnerAccountID() { + final _ret = + _lib._objc_msgSend_192(_id, _lib._sel_fileGroupOwnerAccountID1); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + @override + NSObject valueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_valueForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDictionary1, _lib._sel_new1); + return NSDictionary._(_ret, _lib, retain: false, release: true); + } + + static NSDictionary alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDictionary1, _lib._sel_alloc1); + return NSDictionary._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSDictionary1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSDictionary1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSDictionary1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSDictionary1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSDictionary1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSDictionary1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSDictionary1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSDictionary1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSDictionary1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock7_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1, ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock7_closureRegistry = {}; +int _ObjCBlock7_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock7_registerClosure(Function fn) { + final id = ++_ObjCBlock7_closureRegistryIndex; + _ObjCBlock7_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock7_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return _ObjCBlock7_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock7 extends _ObjCBlockBase { + ObjCBlock7._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock7.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock7_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock7.fromFunction( + SwiftLibrary lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock7_closureTrampoline) + .cast(), + _ObjCBlock7_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +class NSFastEnumerationState extends ffi.Struct { + @ffi.UnsignedLong() + external int state; + + external ffi.Pointer> itemsPtr; + + external ffi.Pointer mutationsPtr; + + @ffi.Array.multi([5]) + external ffi.Array extra; +} + +class NSDate extends NSObject { + NSDate._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSDate] that points to the same underlying object as [other]. + static NSDate castFrom(T other) { + return NSDate._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSDate] that wraps the given raw object pointer. + static NSDate castFromPointer(SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSDate._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSDate]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSDate1); + } + + double get timeIntervalSinceReferenceDate { + return _lib._objc_msgSend_149( + _id, _lib._sel_timeIntervalSinceReferenceDate1); + } + + @override + NSDate init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate initWithTimeIntervalSinceReferenceDate_(double ti) { + final _ret = _lib._objc_msgSend_150( + _id, _lib._sel_initWithTimeIntervalSinceReferenceDate_1, ti); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + double timeIntervalSinceDate_(NSDate? anotherDate) { + return _lib._objc_msgSend_151(_id, _lib._sel_timeIntervalSinceDate_1, + anotherDate?._id ?? ffi.nullptr); + } + + double get timeIntervalSinceNow { + return _lib._objc_msgSend_149(_id, _lib._sel_timeIntervalSinceNow1); + } + + double get timeIntervalSince1970 { + return _lib._objc_msgSend_149(_id, _lib._sel_timeIntervalSince19701); + } + + NSObject addTimeInterval_(double seconds) { + final _ret = + _lib._objc_msgSend_150(_id, _lib._sel_addTimeInterval_1, seconds); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSDate dateByAddingTimeInterval_(double ti) { + final _ret = + _lib._objc_msgSend_150(_id, _lib._sel_dateByAddingTimeInterval_1, ti); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate earlierDate_(NSDate? anotherDate) { + final _ret = _lib._objc_msgSend_152( + _id, _lib._sel_earlierDate_1, anotherDate?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate laterDate_(NSDate? anotherDate) { + final _ret = _lib._objc_msgSend_152( + _id, _lib._sel_laterDate_1, anotherDate?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + int compare_(NSDate? other) { + return _lib._objc_msgSend_153( + _id, _lib._sel_compare_1, other?._id ?? ffi.nullptr); + } + + bool isEqualToDate_(NSDate? otherDate) { + return _lib._objc_msgSend_154( + _id, _lib._sel_isEqualToDate_1, otherDate?._id ?? ffi.nullptr); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_(NSObject locale) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSDate date(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSDate1, _lib._sel_date1); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate dateWithTimeIntervalSinceNow_(SwiftLibrary _lib, double secs) { + final _ret = _lib._objc_msgSend_150( + _lib._class_NSDate1, _lib._sel_dateWithTimeIntervalSinceNow_1, secs); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate dateWithTimeIntervalSinceReferenceDate_( + SwiftLibrary _lib, double ti) { + final _ret = _lib._objc_msgSend_150(_lib._class_NSDate1, + _lib._sel_dateWithTimeIntervalSinceReferenceDate_1, ti); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate dateWithTimeIntervalSince1970_(SwiftLibrary _lib, double secs) { + final _ret = _lib._objc_msgSend_150( + _lib._class_NSDate1, _lib._sel_dateWithTimeIntervalSince1970_1, secs); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate dateWithTimeInterval_sinceDate_( + SwiftLibrary _lib, double secsToBeAdded, NSDate? date) { + final _ret = _lib._objc_msgSend_155( + _lib._class_NSDate1, + _lib._sel_dateWithTimeInterval_sinceDate_1, + secsToBeAdded, + date?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate? getDistantFuture(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_156(_lib._class_NSDate1, _lib._sel_distantFuture1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate? getDistantPast(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_156(_lib._class_NSDate1, _lib._sel_distantPast1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate? getNow(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_156(_lib._class_NSDate1, _lib._sel_now1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate initWithTimeIntervalSinceNow_(double secs) { + final _ret = _lib._objc_msgSend_150( + _id, _lib._sel_initWithTimeIntervalSinceNow_1, secs); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate initWithTimeIntervalSince1970_(double secs) { + final _ret = _lib._objc_msgSend_150( + _id, _lib._sel_initWithTimeIntervalSince1970_1, secs); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate initWithTimeInterval_sinceDate_(double secsToBeAdded, NSDate? date) { + final _ret = _lib._objc_msgSend_155( + _id, + _lib._sel_initWithTimeInterval_sinceDate_1, + secsToBeAdded, + date?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithNaturalLanguageString_locale_( + SwiftLibrary _lib, NSString? string, NSObject locale) { + final _ret = _lib._objc_msgSend_157( + _lib._class_NSDate1, + _lib._sel_dateWithNaturalLanguageString_locale_1, + string?._id ?? ffi.nullptr, + locale._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithNaturalLanguageString_( + SwiftLibrary _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSDate1, + _lib._sel_dateWithNaturalLanguageString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithString_(SwiftLibrary _lib, NSString? aString) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSDate1, + _lib._sel_dateWithString_1, aString?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSCalendarDate dateWithCalendarFormat_timeZone_( + NSString? format, NSTimeZone? aTimeZone) { + final _ret = _lib._objc_msgSend_189( + _id, + _lib._sel_dateWithCalendarFormat_timeZone_1, + format?._id ?? ffi.nullptr, + aTimeZone?._id ?? ffi.nullptr); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithCalendarFormat_timeZone_locale_( + NSString? format, NSTimeZone? aTimeZone, NSObject locale) { + final _ret = _lib._objc_msgSend_190( + _id, + _lib._sel_descriptionWithCalendarFormat_timeZone_locale_1, + format?._id ?? ffi.nullptr, + aTimeZone?._id ?? ffi.nullptr, + locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithString_(NSString? description) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, description?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSDate new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSDate1, _lib._sel_new1); + return NSDate._(_ret, _lib, retain: false, release: true); + } + + static NSDate alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSDate1, _lib._sel_alloc1); + return NSDate._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSDate1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSDate1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSDate1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSDate1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSDate1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSDate1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSDate1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSDate1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSDate1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSTimeInterval = ffi.Double; + +class NSCalendarDate extends NSDate { + NSCalendarDate._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSCalendarDate] that points to the same underlying object as [other]. + static NSCalendarDate castFrom(T other) { + return NSCalendarDate._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSCalendarDate] that wraps the given raw object pointer. + static NSCalendarDate castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSCalendarDate._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSCalendarDate]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSCalendarDate1); + } + + static NSObject calendarDate(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSCalendarDate1, _lib._sel_calendarDate1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithString_calendarFormat_locale_(SwiftLibrary _lib, + NSString? description, NSString? format, NSObject locale) { + final _ret = _lib._objc_msgSend_158( + _lib._class_NSCalendarDate1, + _lib._sel_dateWithString_calendarFormat_locale_1, + description?._id ?? ffi.nullptr, + format?._id ?? ffi.nullptr, + locale._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithString_calendarFormat_( + SwiftLibrary _lib, NSString? description, NSString? format) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSCalendarDate1, + _lib._sel_dateWithString_calendarFormat_1, + description?._id ?? ffi.nullptr, + format?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithYear_month_day_hour_minute_second_timeZone_( + SwiftLibrary _lib, + int year, + int month, + int day, + int hour, + int minute, + int second, + NSTimeZone? aTimeZone) { + final _ret = _lib._objc_msgSend_184( + _lib._class_NSCalendarDate1, + _lib._sel_dateWithYear_month_day_hour_minute_second_timeZone_1, + year, + month, + day, + hour, + minute, + second, + aTimeZone?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSCalendarDate dateByAddingYears_months_days_hours_minutes_seconds_( + int year, int month, int day, int hour, int minute, int second) { + final _ret = _lib._objc_msgSend_185( + _id, + _lib._sel_dateByAddingYears_months_days_hours_minutes_seconds_1, + year, + month, + day, + hour, + minute, + second); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + int dayOfCommonEra() { + return _lib._objc_msgSend_78(_id, _lib._sel_dayOfCommonEra1); + } + + int dayOfMonth() { + return _lib._objc_msgSend_78(_id, _lib._sel_dayOfMonth1); + } + + int dayOfWeek() { + return _lib._objc_msgSend_78(_id, _lib._sel_dayOfWeek1); + } + + int dayOfYear() { + return _lib._objc_msgSend_78(_id, _lib._sel_dayOfYear1); + } + + int hourOfDay() { + return _lib._objc_msgSend_78(_id, _lib._sel_hourOfDay1); + } + + int minuteOfHour() { + return _lib._objc_msgSend_78(_id, _lib._sel_minuteOfHour1); + } + + int monthOfYear() { + return _lib._objc_msgSend_78(_id, _lib._sel_monthOfYear1); + } + + int secondOfMinute() { + return _lib._objc_msgSend_78(_id, _lib._sel_secondOfMinute1); + } + + int yearOfCommonEra() { + return _lib._objc_msgSend_78(_id, _lib._sel_yearOfCommonEra1); + } + + NSString calendarFormat() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_calendarFormat1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithCalendarFormat_locale_( + NSString? format, NSObject locale) { + final _ret = _lib._objc_msgSend_167( + _id, + _lib._sel_descriptionWithCalendarFormat_locale_1, + format?._id ?? ffi.nullptr, + locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithCalendarFormat_(NSString? format) { + final _ret = _lib._objc_msgSend_64(_id, + _lib._sel_descriptionWithCalendarFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + @override + NSString descriptionWithLocale_(NSObject locale) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSTimeZone timeZone() { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_timeZone1); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithString_calendarFormat_locale_( + NSString? description, NSString? format, NSObject locale) { + final _ret = _lib._objc_msgSend_158( + _id, + _lib._sel_initWithString_calendarFormat_locale_1, + description?._id ?? ffi.nullptr, + format?._id ?? ffi.nullptr, + locale._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithString_calendarFormat_( + NSString? description, NSString? format) { + final _ret = _lib._objc_msgSend_159( + _id, + _lib._sel_initWithString_calendarFormat_1, + description?._id ?? ffi.nullptr, + format?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + @override + NSObject initWithString_(NSString? description) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, description?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithYear_month_day_hour_minute_second_timeZone_( + int year, + int month, + int day, + int hour, + int minute, + int second, + NSTimeZone? aTimeZone) { + final _ret = _lib._objc_msgSend_184( + _id, + _lib._sel_initWithYear_month_day_hour_minute_second_timeZone_1, + year, + month, + day, + hour, + minute, + second, + aTimeZone?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void setCalendarFormat_(NSString? format) { + return _lib._objc_msgSend_186( + _id, _lib._sel_setCalendarFormat_1, format?._id ?? ffi.nullptr); + } + + void setTimeZone_(NSTimeZone? aTimeZone) { + return _lib._objc_msgSend_187( + _id, _lib._sel_setTimeZone_1, aTimeZone?._id ?? ffi.nullptr); + } + + void years_months_days_hours_minutes_seconds_sinceDate_( + ffi.Pointer yp, + ffi.Pointer mop, + ffi.Pointer dp, + ffi.Pointer hp, + ffi.Pointer mip, + ffi.Pointer sp, + NSCalendarDate? date) { + return _lib._objc_msgSend_188( + _id, + _lib._sel_years_months_days_hours_minutes_seconds_sinceDate_1, + yp, + mop, + dp, + hp, + mip, + sp, + date?._id ?? ffi.nullptr); + } + + static NSDate? getDistantFuture(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_156( + _lib._class_NSCalendarDate1, _lib._sel_distantFuture1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate? getDistantPast(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_156( + _lib._class_NSCalendarDate1, _lib._sel_distantPast1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSCalendarDate date(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSCalendarDate1, _lib._sel_date1); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + static NSCalendarDate dateWithTimeIntervalSinceNow_( + SwiftLibrary _lib, double secs) { + final _ret = _lib._objc_msgSend_150(_lib._class_NSCalendarDate1, + _lib._sel_dateWithTimeIntervalSinceNow_1, secs); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + static NSCalendarDate dateWithTimeIntervalSinceReferenceDate_( + SwiftLibrary _lib, double ti) { + final _ret = _lib._objc_msgSend_150(_lib._class_NSCalendarDate1, + _lib._sel_dateWithTimeIntervalSinceReferenceDate_1, ti); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + static NSCalendarDate dateWithTimeIntervalSince1970_( + SwiftLibrary _lib, double secs) { + final _ret = _lib._objc_msgSend_150(_lib._class_NSCalendarDate1, + _lib._sel_dateWithTimeIntervalSince1970_1, secs); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + static NSCalendarDate dateWithTimeInterval_sinceDate_( + SwiftLibrary _lib, double secsToBeAdded, NSDate? date) { + final _ret = _lib._objc_msgSend_155( + _lib._class_NSCalendarDate1, + _lib._sel_dateWithTimeInterval_sinceDate_1, + secsToBeAdded, + date?._id ?? ffi.nullptr); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate? getNow(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_156(_lib._class_NSCalendarDate1, _lib._sel_now1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithNaturalLanguageString_locale_( + SwiftLibrary _lib, NSString? string, NSObject locale) { + final _ret = _lib._objc_msgSend_157( + _lib._class_NSCalendarDate1, + _lib._sel_dateWithNaturalLanguageString_locale_1, + string?._id ?? ffi.nullptr, + locale._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithNaturalLanguageString_( + SwiftLibrary _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSCalendarDate1, + _lib._sel_dateWithNaturalLanguageString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithString_(SwiftLibrary _lib, NSString? aString) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSCalendarDate1, + _lib._sel_dateWithString_1, aString?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSCalendarDate new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSCalendarDate1, _lib._sel_new1); + return NSCalendarDate._(_ret, _lib, retain: false, release: true); + } + + static NSCalendarDate alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSCalendarDate1, _lib._sel_alloc1); + return NSCalendarDate._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSCalendarDate1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSCalendarDate1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSCalendarDate1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSCalendarDate1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSCalendarDate1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSCalendarDate1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSCalendarDate1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSCalendarDate1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSCalendarDate1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSTimeZone extends NSObject { + NSTimeZone._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSTimeZone] that points to the same underlying object as [other]. + static NSTimeZone castFrom(T other) { + return NSTimeZone._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSTimeZone] that wraps the given raw object pointer. + static NSTimeZone castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSTimeZone._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSTimeZone]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSTimeZone1); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSData? get data { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_data1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + int secondsFromGMTForDate_(NSDate? aDate) { + return _lib._objc_msgSend_160( + _id, _lib._sel_secondsFromGMTForDate_1, aDate?._id ?? ffi.nullptr); + } + + NSString abbreviationForDate_(NSDate? aDate) { + final _ret = _lib._objc_msgSend_161( + _id, _lib._sel_abbreviationForDate_1, aDate?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool isDaylightSavingTimeForDate_(NSDate? aDate) { + return _lib._objc_msgSend_154(_id, _lib._sel_isDaylightSavingTimeForDate_1, + aDate?._id ?? ffi.nullptr); + } + + double daylightSavingTimeOffsetForDate_(NSDate? aDate) { + return _lib._objc_msgSend_151(_id, + _lib._sel_daylightSavingTimeOffsetForDate_1, aDate?._id ?? ffi.nullptr); + } + + NSDate nextDaylightSavingTimeTransitionAfterDate_(NSDate? aDate) { + final _ret = _lib._objc_msgSend_152( + _id, + _lib._sel_nextDaylightSavingTimeTransitionAfterDate_1, + aDate?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSTimeZone? getSystemTimeZone(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_162( + _lib._class_NSTimeZone1, _lib._sel_systemTimeZone1); + return _ret.address == 0 + ? null + : NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + static void resetSystemTimeZone(SwiftLibrary _lib) { + return _lib._objc_msgSend_1( + _lib._class_NSTimeZone1, _lib._sel_resetSystemTimeZone1); + } + + static NSTimeZone? getDefaultTimeZone(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_162( + _lib._class_NSTimeZone1, _lib._sel_defaultTimeZone1); + return _ret.address == 0 + ? null + : NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + static void setDefaultTimeZone(SwiftLibrary _lib, NSTimeZone? value) { + _lib._objc_msgSend_163(_lib._class_NSTimeZone1, + _lib._sel_setDefaultTimeZone_1, value?._id ?? ffi.nullptr); + } + + static NSTimeZone? getLocalTimeZone(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_162( + _lib._class_NSTimeZone1, _lib._sel_localTimeZone1); + return _ret.address == 0 + ? null + : NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getKnownTimeZoneNames(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSTimeZone1, _lib._sel_knownTimeZoneNames1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary? getAbbreviationDictionary(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_164( + _lib._class_NSTimeZone1, _lib._sel_abbreviationDictionary1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static void setAbbreviationDictionary( + SwiftLibrary _lib, NSDictionary? value) { + _lib._objc_msgSend_165(_lib._class_NSTimeZone1, + _lib._sel_setAbbreviationDictionary_1, value?._id ?? ffi.nullptr); + } + + static NSString? getTimeZoneDataVersion(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_20( + _lib._class_NSTimeZone1, _lib._sel_timeZoneDataVersion1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get secondsFromGMT { + return _lib._objc_msgSend_78(_id, _lib._sel_secondsFromGMT1); + } + + NSString? get abbreviation { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_abbreviation1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool get daylightSavingTime { + return _lib._objc_msgSend_12(_id, _lib._sel_isDaylightSavingTime1); + } + + double get daylightSavingTimeOffset { + return _lib._objc_msgSend_149(_id, _lib._sel_daylightSavingTimeOffset1); + } + + NSDate? get nextDaylightSavingTimeTransition { + final _ret = _lib._objc_msgSend_156( + _id, _lib._sel_nextDaylightSavingTimeTransition1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool isEqualToTimeZone_(NSTimeZone? aTimeZone) { + return _lib._objc_msgSend_166( + _id, _lib._sel_isEqualToTimeZone_1, aTimeZone?._id ?? ffi.nullptr); + } + + NSString localizedName_locale_(int style, NSLocale? locale) { + final _ret = _lib._objc_msgSend_181(_id, _lib._sel_localizedName_locale_1, + style, locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSTimeZone timeZoneWithName_(SwiftLibrary _lib, NSString? tzName) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSTimeZone1, + _lib._sel_timeZoneWithName_1, tzName?._id ?? ffi.nullptr); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + static NSTimeZone timeZoneWithName_data_( + SwiftLibrary _lib, NSString? tzName, NSData? aData) { + final _ret = _lib._objc_msgSend_182( + _lib._class_NSTimeZone1, + _lib._sel_timeZoneWithName_data_1, + tzName?._id ?? ffi.nullptr, + aData?._id ?? ffi.nullptr); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + NSTimeZone initWithName_(NSString? tzName) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithName_1, tzName?._id ?? ffi.nullptr); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + NSTimeZone initWithName_data_(NSString? tzName, NSData? aData) { + final _ret = _lib._objc_msgSend_182(_id, _lib._sel_initWithName_data_1, + tzName?._id ?? ffi.nullptr, aData?._id ?? ffi.nullptr); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + static NSTimeZone timeZoneForSecondsFromGMT_(SwiftLibrary _lib, int seconds) { + final _ret = _lib._objc_msgSend_183(_lib._class_NSTimeZone1, + _lib._sel_timeZoneForSecondsFromGMT_1, seconds); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + static NSTimeZone timeZoneWithAbbreviation_( + SwiftLibrary _lib, NSString? abbreviation) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSTimeZone1, + _lib._sel_timeZoneWithAbbreviation_1, abbreviation?._id ?? ffi.nullptr); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + static NSTimeZone new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSTimeZone1, _lib._sel_new1); + return NSTimeZone._(_ret, _lib, retain: false, release: true); + } + + static NSTimeZone alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSTimeZone1, _lib._sel_alloc1); + return NSTimeZone._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSTimeZone1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSTimeZone1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSTimeZone1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSTimeZone1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSTimeZone1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSTimeZone1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSTimeZone1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSTimeZone1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSTimeZone1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSTimeZoneNameStyle { + static const int NSTimeZoneNameStyleStandard = 0; + static const int NSTimeZoneNameStyleShortStandard = 1; + static const int NSTimeZoneNameStyleDaylightSaving = 2; + static const int NSTimeZoneNameStyleShortDaylightSaving = 3; + static const int NSTimeZoneNameStyleGeneric = 4; + static const int NSTimeZoneNameStyleShortGeneric = 5; +} + +class NSLocale extends NSObject { + NSLocale._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSLocale] that points to the same underlying object as [other]. + static NSLocale castFrom(T other) { + return NSLocale._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSLocale] that wraps the given raw object pointer. + static NSLocale castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSLocale._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSLocale]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSLocale1); + } + + NSObject objectForKey_(NSLocaleKey key) { + final _ret = _lib._objc_msgSend_30(_id, _lib._sel_objectForKey_1, key); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSString displayNameForKey_value_(NSLocaleKey key, NSObject value) { + final _ret = _lib._objc_msgSend_167( + _id, _lib._sel_displayNameForKey_value_1, key, value._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSLocale initWithLocaleIdentifier_(NSString? string) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithLocaleIdentifier_1, string?._id ?? ffi.nullptr); + return NSLocale._(_ret, _lib, retain: true, release: true); + } + + NSLocale initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSLocale._(_ret, _lib, retain: true, release: true); + } + + NSString? get localeIdentifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_localeIdentifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForLocaleIdentifier_(NSString? localeIdentifier) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForLocaleIdentifier_1, + localeIdentifier?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get languageCode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_languageCode1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForLanguageCode_(NSString? languageCode) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForLanguageCode_1, + languageCode?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get countryCode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_countryCode1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForCountryCode_(NSString? countryCode) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForCountryCode_1, + countryCode?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get scriptCode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_scriptCode1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForScriptCode_(NSString? scriptCode) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForScriptCode_1, + scriptCode?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get variantCode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_variantCode1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForVariantCode_(NSString? variantCode) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForVariantCode_1, + variantCode?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSCharacterSet? get exemplarCharacterSet { + final _ret = _lib._objc_msgSend_168(_id, _lib._sel_exemplarCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + NSString? get calendarIdentifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_calendarIdentifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForCalendarIdentifier_(NSString? calendarIdentifier) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForCalendarIdentifier_1, + calendarIdentifier?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get collationIdentifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_collationIdentifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForCollationIdentifier_( + NSString? collationIdentifier) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForCollationIdentifier_1, + collationIdentifier?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool get usesMetricSystem { + return _lib._objc_msgSend_12(_id, _lib._sel_usesMetricSystem1); + } + + NSString? get decimalSeparator { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_decimalSeparator1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get groupingSeparator { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_groupingSeparator1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get currencySymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_currencySymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get currencyCode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_currencyCode1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForCurrencyCode_(NSString? currencyCode) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForCurrencyCode_1, + currencyCode?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get collatorIdentifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_collatorIdentifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForCollatorIdentifier_(NSString? collatorIdentifier) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForCollatorIdentifier_1, + collatorIdentifier?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get quotationBeginDelimiter { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_quotationBeginDelimiter1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get quotationEndDelimiter { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_quotationEndDelimiter1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get alternateQuotationBeginDelimiter { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_alternateQuotationBeginDelimiter1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get alternateQuotationEndDelimiter { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_alternateQuotationEndDelimiter1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + static NSLocale? getAutoupdatingCurrentLocale(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_176( + _lib._class_NSLocale1, _lib._sel_autoupdatingCurrentLocale1); + return _ret.address == 0 + ? null + : NSLocale._(_ret, _lib, retain: true, release: true); + } + + static NSLocale? getCurrentLocale(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_176(_lib._class_NSLocale1, _lib._sel_currentLocale1); + return _ret.address == 0 + ? null + : NSLocale._(_ret, _lib, retain: true, release: true); + } + + static NSLocale? getSystemLocale(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_176(_lib._class_NSLocale1, _lib._sel_systemLocale1); + return _ret.address == 0 + ? null + : NSLocale._(_ret, _lib, retain: true, release: true); + } + + static NSLocale localeWithLocaleIdentifier_( + SwiftLibrary _lib, NSString? ident) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSLocale1, + _lib._sel_localeWithLocaleIdentifier_1, ident?._id ?? ffi.nullptr); + return NSLocale._(_ret, _lib, retain: true, release: true); + } + + @override + NSLocale init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSLocale._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getAvailableLocaleIdentifiers(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSLocale1, _lib._sel_availableLocaleIdentifiers1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getISOLanguageCodes(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSLocale1, _lib._sel_ISOLanguageCodes1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getISOCountryCodes(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSLocale1, _lib._sel_ISOCountryCodes1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getISOCurrencyCodes(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSLocale1, _lib._sel_ISOCurrencyCodes1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getCommonISOCurrencyCodes(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSLocale1, _lib._sel_commonISOCurrencyCodes1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getPreferredLanguages(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSLocale1, _lib._sel_preferredLanguages1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary componentsFromLocaleIdentifier_( + SwiftLibrary _lib, NSString? string) { + final _ret = _lib._objc_msgSend_140(_lib._class_NSLocale1, + _lib._sel_componentsFromLocaleIdentifier_1, string?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSString localeIdentifierFromComponents_( + SwiftLibrary _lib, NSDictionary? dict) { + final _ret = _lib._objc_msgSend_177(_lib._class_NSLocale1, + _lib._sel_localeIdentifierFromComponents_1, dict?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString canonicalLocaleIdentifierFromString_( + SwiftLibrary _lib, NSString? string) { + final _ret = _lib._objc_msgSend_64( + _lib._class_NSLocale1, + _lib._sel_canonicalLocaleIdentifierFromString_1, + string?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString canonicalLanguageIdentifierFromString_( + SwiftLibrary _lib, NSString? string) { + final _ret = _lib._objc_msgSend_64( + _lib._class_NSLocale1, + _lib._sel_canonicalLanguageIdentifierFromString_1, + string?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString localeIdentifierFromWindowsLocaleCode_( + SwiftLibrary _lib, int lcid) { + final _ret = _lib._objc_msgSend_178(_lib._class_NSLocale1, + _lib._sel_localeIdentifierFromWindowsLocaleCode_1, lcid); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static int windowsLocaleCodeFromLocaleIdentifier_( + SwiftLibrary _lib, NSString? localeIdentifier) { + return _lib._objc_msgSend_179( + _lib._class_NSLocale1, + _lib._sel_windowsLocaleCodeFromLocaleIdentifier_1, + localeIdentifier?._id ?? ffi.nullptr); + } + + static int characterDirectionForLanguage_( + SwiftLibrary _lib, NSString? isoLangCode) { + return _lib._objc_msgSend_180( + _lib._class_NSLocale1, + _lib._sel_characterDirectionForLanguage_1, + isoLangCode?._id ?? ffi.nullptr); + } + + static int lineDirectionForLanguage_( + SwiftLibrary _lib, NSString? isoLangCode) { + return _lib._objc_msgSend_180(_lib._class_NSLocale1, + _lib._sel_lineDirectionForLanguage_1, isoLangCode?._id ?? ffi.nullptr); + } + + static NSLocale new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSLocale1, _lib._sel_new1); + return NSLocale._(_ret, _lib, retain: false, release: true); + } + + static NSLocale alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSLocale1, _lib._sel_alloc1); + return NSLocale._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSLocale1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSLocale1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSLocale1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSLocale1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSLocale1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSLocale1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSLocale1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSLocale1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSLocale1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSLocaleKey = ffi.Pointer; + +class NSCharacterSet extends NSObject { + NSCharacterSet._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSCharacterSet] that points to the same underlying object as [other]. + static NSCharacterSet castFrom(T other) { + return NSCharacterSet._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSCharacterSet] that wraps the given raw object pointer. + static NSCharacterSet castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSCharacterSet._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSCharacterSet]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSCharacterSet1); + } + + static NSCharacterSet? getControlCharacterSet(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_controlCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getWhitespaceCharacterSet(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_whitespaceCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getWhitespaceAndNewlineCharacterSet( + SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_168(_lib._class_NSCharacterSet1, + _lib._sel_whitespaceAndNewlineCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getDecimalDigitCharacterSet(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_decimalDigitCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getLetterCharacterSet(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_letterCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getLowercaseLetterCharacterSet(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_lowercaseLetterCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getUppercaseLetterCharacterSet(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_uppercaseLetterCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getNonBaseCharacterSet(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_nonBaseCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getAlphanumericCharacterSet(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_alphanumericCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getDecomposableCharacterSet(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_decomposableCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getIllegalCharacterSet(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_illegalCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getPunctuationCharacterSet(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_punctuationCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getCapitalizedLetterCharacterSet(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_capitalizedLetterCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getSymbolCharacterSet(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_symbolCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getNewlineCharacterSet(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_newlineCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: false, release: true); + } + + static NSCharacterSet characterSetWithRange_( + SwiftLibrary _lib, NSRange aRange) { + final _ret = _lib._objc_msgSend_169( + _lib._class_NSCharacterSet1, _lib._sel_characterSetWithRange_1, aRange); + return NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet characterSetWithCharactersInString_( + SwiftLibrary _lib, NSString? aString) { + final _ret = _lib._objc_msgSend_170( + _lib._class_NSCharacterSet1, + _lib._sel_characterSetWithCharactersInString_1, + aString?._id ?? ffi.nullptr); + return NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet characterSetWithBitmapRepresentation_( + SwiftLibrary _lib, NSData? data) { + final _ret = _lib._objc_msgSend_171( + _lib._class_NSCharacterSet1, + _lib._sel_characterSetWithBitmapRepresentation_1, + data?._id ?? ffi.nullptr); + return NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet characterSetWithContentsOfFile_( + SwiftLibrary _lib, NSString? fName) { + final _ret = _lib._objc_msgSend_170(_lib._class_NSCharacterSet1, + _lib._sel_characterSetWithContentsOfFile_1, fName?._id ?? ffi.nullptr); + return NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + NSCharacterSet initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + bool characterIsMember_(int aCharacter) { + return _lib._objc_msgSend_172( + _id, _lib._sel_characterIsMember_1, aCharacter); + } + + NSData? get bitmapRepresentation { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_bitmapRepresentation1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSCharacterSet? get invertedSet { + final _ret = _lib._objc_msgSend_168(_id, _lib._sel_invertedSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + bool longCharacterIsMember_(int theLongChar) { + return _lib._objc_msgSend_173( + _id, _lib._sel_longCharacterIsMember_1, theLongChar); + } + + bool isSupersetOfSet_(NSCharacterSet? theOtherSet) { + return _lib._objc_msgSend_174( + _id, _lib._sel_isSupersetOfSet_1, theOtherSet?._id ?? ffi.nullptr); + } + + bool hasMemberInPlane_(int thePlane) { + return _lib._objc_msgSend_175(_id, _lib._sel_hasMemberInPlane_1, thePlane); + } + + static NSCharacterSet? getURLUserAllowedCharacterSet(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_URLUserAllowedCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getURLPasswordAllowedCharacterSet(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_URLPasswordAllowedCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getURLHostAllowedCharacterSet(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_URLHostAllowedCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getURLPathAllowedCharacterSet(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_URLPathAllowedCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getURLQueryAllowedCharacterSet(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_URLQueryAllowedCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getURLFragmentAllowedCharacterSet(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSCharacterSet1, _lib._sel_URLFragmentAllowedCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSCharacterSet1, _lib._sel_new1); + return NSCharacterSet._(_ret, _lib, retain: false, release: true); + } + + static NSCharacterSet alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSCharacterSet1, _lib._sel_alloc1); + return NSCharacterSet._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSCharacterSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSCharacterSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSCharacterSet1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSCharacterSet1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSCharacterSet1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSCharacterSet1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSCharacterSet1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSCharacterSet1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSCharacterSet1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef UTF32Char = UInt32; +typedef UInt32 = ffi.UnsignedInt; + +abstract class NSLocaleLanguageDirection { + static const int NSLocaleLanguageDirectionUnknown = 0; + static const int NSLocaleLanguageDirectionLeftToRight = 1; + static const int NSLocaleLanguageDirectionRightToLeft = 2; + static const int NSLocaleLanguageDirectionTopToBottom = 3; + static const int NSLocaleLanguageDirectionBottomToTop = 4; +} + +typedef OSType = FourCharCode; +typedef FourCharCode = UInt32; +typedef NSURLResourceKey = ffi.Pointer; + +class NSURLHandle extends NSObject { + NSURLHandle._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLHandle] that points to the same underlying object as [other]. + static NSURLHandle castFrom(T other) { + return NSURLHandle._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSURLHandle] that wraps the given raw object pointer. + static NSURLHandle castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLHandle._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLHandle]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLHandle1); + } + + static void registerURLHandleClass_( + SwiftLibrary _lib, NSObject anURLHandleSubclass) { + return _lib._objc_msgSend_15(_lib._class_NSURLHandle1, + _lib._sel_registerURLHandleClass_1, anURLHandleSubclass._id); + } + + static NSObject URLHandleClassForURL_(SwiftLibrary _lib, NSURL? anURL) { + final _ret = _lib._objc_msgSend_226(_lib._class_NSURLHandle1, + _lib._sel_URLHandleClassForURL_1, anURL?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + int status() { + return _lib._objc_msgSend_227(_id, _lib._sel_status1); + } + + NSString failureReason() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_failureReason1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + void addClient_(NSObject? client) { + return _lib._objc_msgSend_15( + _id, _lib._sel_addClient_1, client?._id ?? ffi.nullptr); + } + + void removeClient_(NSObject? client) { + return _lib._objc_msgSend_15( + _id, _lib._sel_removeClient_1, client?._id ?? ffi.nullptr); + } + + void loadInBackground() { + return _lib._objc_msgSend_1(_id, _lib._sel_loadInBackground1); + } + + void cancelLoadInBackground() { + return _lib._objc_msgSend_1(_id, _lib._sel_cancelLoadInBackground1); + } + + NSData resourceData() { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_resourceData1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData availableResourceData() { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_availableResourceData1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + int expectedResourceDataSize() { + return _lib._objc_msgSend_214(_id, _lib._sel_expectedResourceDataSize1); + } + + void flushCachedData() { + return _lib._objc_msgSend_1(_id, _lib._sel_flushCachedData1); + } + + void backgroundLoadDidFailWithReason_(NSString? reason) { + return _lib._objc_msgSend_186( + _id, + _lib._sel_backgroundLoadDidFailWithReason_1, + reason?._id ?? ffi.nullptr); + } + + void didLoadBytes_loadComplete_(NSData? newBytes, bool yorn) { + return _lib._objc_msgSend_228(_id, _lib._sel_didLoadBytes_loadComplete_1, + newBytes?._id ?? ffi.nullptr, yorn); + } + + static bool canInitWithURL_(SwiftLibrary _lib, NSURL? anURL) { + return _lib._objc_msgSend_229(_lib._class_NSURLHandle1, + _lib._sel_canInitWithURL_1, anURL?._id ?? ffi.nullptr); + } + + static NSURLHandle cachedHandleForURL_(SwiftLibrary _lib, NSURL? anURL) { + final _ret = _lib._objc_msgSend_230(_lib._class_NSURLHandle1, + _lib._sel_cachedHandleForURL_1, anURL?._id ?? ffi.nullptr); + return NSURLHandle._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithURL_cached_(NSURL? anURL, bool willCache) { + final _ret = _lib._objc_msgSend_231(_id, _lib._sel_initWithURL_cached_1, + anURL?._id ?? ffi.nullptr, willCache); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject propertyForKey_(NSString? propertyKey) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_propertyForKey_1, propertyKey?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject propertyForKeyIfAvailable_(NSString? propertyKey) { + final _ret = _lib._objc_msgSend_30(_id, + _lib._sel_propertyForKeyIfAvailable_1, propertyKey?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool writeProperty_forKey_(NSObject propertyValue, NSString? propertyKey) { + return _lib._objc_msgSend_225(_id, _lib._sel_writeProperty_forKey_1, + propertyValue._id, propertyKey?._id ?? ffi.nullptr); + } + + bool writeData_(NSData? data) { + return _lib._objc_msgSend_23( + _id, _lib._sel_writeData_1, data?._id ?? ffi.nullptr); + } + + NSData loadInForeground() { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_loadInForeground1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + void beginLoadInBackground() { + return _lib._objc_msgSend_1(_id, _lib._sel_beginLoadInBackground1); + } + + void endLoadInBackground() { + return _lib._objc_msgSend_1(_id, _lib._sel_endLoadInBackground1); + } + + static NSURLHandle new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLHandle1, _lib._sel_new1); + return NSURLHandle._(_ret, _lib, retain: false, release: true); + } + + static NSURLHandle alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLHandle1, _lib._sel_alloc1); + return NSURLHandle._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLHandle1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLHandle1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLHandle1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLHandle1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLHandle1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLHandle1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLHandle1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSURLHandle1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLHandle1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSURLHandleStatus { + static const int NSURLHandleNotLoaded = 0; + static const int NSURLHandleLoadSucceeded = 1; + static const int NSURLHandleLoadInProgress = 2; + static const int NSURLHandleLoadFailed = 3; +} + +abstract class NSDataWritingOptions { + static const int NSDataWritingAtomic = 1; + static const int NSDataWritingWithoutOverwriting = 2; + static const int NSDataWritingFileProtectionNone = 268435456; + static const int NSDataWritingFileProtectionComplete = 536870912; + static const int NSDataWritingFileProtectionCompleteUnlessOpen = 805306368; + static const int + NSDataWritingFileProtectionCompleteUntilFirstUserAuthentication = + 1073741824; + static const int NSDataWritingFileProtectionMask = 4026531840; + static const int NSAtomicWrite = 1; +} + +abstract class NSDataSearchOptions { + static const int NSDataSearchBackwards = 1; + static const int NSDataSearchAnchored = 2; +} + +void _ObjCBlock8_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock8_closureRegistry = {}; +int _ObjCBlock8_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock8_registerClosure(Function fn) { + final id = ++_ObjCBlock8_closureRegistryIndex; + _ObjCBlock8_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock8_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) { + return _ObjCBlock8_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock8 extends _ObjCBlockBase { + ObjCBlock8._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock8.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock8_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock8.fromFunction( + SwiftLibrary lib, + void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock8_closureTrampoline) + .cast(), + _ObjCBlock8_registerClosure(fn)), + lib); + void call( + ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +abstract class NSDataReadingOptions { + static const int NSDataReadingMappedIfSafe = 1; + static const int NSDataReadingUncached = 2; + static const int NSDataReadingMappedAlways = 8; + static const int NSDataReadingMapped = 1; + static const int NSMappedRead = 1; + static const int NSUncachedRead = 2; +} + +void _ObjCBlock9_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSUInteger arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, int arg1)>()(arg0, arg1); +} + +final _ObjCBlock9_closureRegistry = {}; +int _ObjCBlock9_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock9_registerClosure(Function fn) { + final id = ++_ObjCBlock9_closureRegistryIndex; + _ObjCBlock9_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock9_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) { + return _ObjCBlock9_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock9 extends _ObjCBlockBase { + ObjCBlock9._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock9.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, NSUInteger arg1)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1)>(_ObjCBlock9_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock9.fromFunction( + SwiftLibrary lib, void Function(ffi.Pointer arg0, int arg1) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1)>(_ObjCBlock9_closureTrampoline) + .cast(), + _ObjCBlock9_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0, int arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, NSUInteger arg1)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1)>()(_id, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +abstract class NSDataBase64DecodingOptions { + static const int NSDataBase64DecodingIgnoreUnknownCharacters = 1; +} + +abstract class NSDataBase64EncodingOptions { + static const int NSDataBase64Encoding64CharacterLineLength = 1; + static const int NSDataBase64Encoding76CharacterLineLength = 2; + static const int NSDataBase64EncodingEndLineWithCarriageReturn = 16; + static const int NSDataBase64EncodingEndLineWithLineFeed = 32; +} + +abstract class NSDataCompressionAlgorithm { + static const int NSDataCompressionAlgorithmLZFSE = 0; + static const int NSDataCompressionAlgorithmLZ4 = 1; + static const int NSDataCompressionAlgorithmLZMA = 2; + static const int NSDataCompressionAlgorithmZlib = 3; +} + +typedef NSZone = _NSZone; + +abstract class NSDecodingFailurePolicy { + static const int NSDecodingFailurePolicyRaiseException = 0; + static const int NSDecodingFailurePolicySetErrorAndReturn = 1; +} + +abstract class NSStringCompareOptions { + static const int NSCaseInsensitiveSearch = 1; + static const int NSLiteralSearch = 2; + static const int NSBackwardsSearch = 4; + static const int NSAnchoredSearch = 8; + static const int NSNumericSearch = 64; + static const int NSDiacriticInsensitiveSearch = 128; + static const int NSWidthInsensitiveSearch = 256; + static const int NSForcedOrderingSearch = 512; + static const int NSRegularExpressionSearch = 1024; +} + +abstract class NSStringEnumerationOptions { + static const int NSStringEnumerationByLines = 0; + static const int NSStringEnumerationByParagraphs = 1; + static const int NSStringEnumerationByComposedCharacterSequences = 2; + static const int NSStringEnumerationByWords = 3; + static const int NSStringEnumerationBySentences = 4; + static const int NSStringEnumerationByCaretPositions = 5; + static const int NSStringEnumerationByDeletionClusters = 6; + static const int NSStringEnumerationReverse = 256; + static const int NSStringEnumerationSubstringNotRequired = 512; + static const int NSStringEnumerationLocalized = 1024; +} + +void _ObjCBlock10_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSRange arg1, + NSRange arg2, ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3)>()(arg0, arg1, arg2, arg3); +} + +final _ObjCBlock10_closureRegistry = {}; +int _ObjCBlock10_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock10_registerClosure(Function fn) { + final id = ++_ObjCBlock10_closureRegistryIndex; + _ObjCBlock10_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock10_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3) { + return _ObjCBlock10_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2, arg3); +} + +class ObjCBlock10 extends _ObjCBlockBase { + ObjCBlock10._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock10.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSRange arg1, + NSRange arg2, ffi.Pointer arg3)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3)>( + _ObjCBlock10_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock10.fromFunction( + SwiftLibrary lib, + void Function(ffi.Pointer arg0, NSRange arg1, NSRange arg2, + ffi.Pointer arg3) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3)>( + _ObjCBlock10_closureTrampoline) + .cast(), + _ObjCBlock10_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0, NSRange arg1, NSRange arg2, + ffi.Pointer arg3) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3)>()(_id, arg0, arg1, arg2, arg3); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +void _ObjCBlock11_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock11_closureRegistry = {}; +int _ObjCBlock11_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock11_registerClosure(Function fn) { + final id = ++_ObjCBlock11_closureRegistryIndex; + _ObjCBlock11_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock11_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return _ObjCBlock11_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock11 extends _ObjCBlockBase { + ObjCBlock11._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock11.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock11_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock11.fromFunction( + SwiftLibrary lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock11_closureTrampoline) + .cast(), + _ObjCBlock11_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +typedef NSStringEncoding = NSUInteger; + +abstract class NSStringEncodingConversionOptions { + static const int NSStringEncodingConversionAllowLossy = 1; + static const int NSStringEncodingConversionExternalRepresentation = 2; +} + +typedef NSStringTransform = ffi.Pointer; +void _ObjCBlock12_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSUInteger arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, int arg1)>()(arg0, arg1); +} + +final _ObjCBlock12_closureRegistry = {}; +int _ObjCBlock12_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock12_registerClosure(Function fn) { + final id = ++_ObjCBlock12_closureRegistryIndex; + _ObjCBlock12_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock12_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) { + return _ObjCBlock12_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock12 extends _ObjCBlockBase { + ObjCBlock12._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock12.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, NSUInteger arg1)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1)>(_ObjCBlock12_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock12.fromFunction( + SwiftLibrary lib, void Function(ffi.Pointer arg0, int arg1) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1)>(_ObjCBlock12_closureTrampoline) + .cast(), + _ObjCBlock12_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0, int arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, NSUInteger arg1)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1)>()(_id, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +typedef NSLinguisticTagScheme = ffi.Pointer; + +abstract class NSLinguisticTaggerOptions { + static const int NSLinguisticTaggerOmitWords = 1; + static const int NSLinguisticTaggerOmitPunctuation = 2; + static const int NSLinguisticTaggerOmitWhitespace = 4; + static const int NSLinguisticTaggerOmitOther = 8; + static const int NSLinguisticTaggerJoinNames = 16; +} + +class NSOrthography extends NSObject { + NSOrthography._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSOrthography] that points to the same underlying object as [other]. + static NSOrthography castFrom(T other) { + return NSOrthography._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSOrthography] that wraps the given raw object pointer. + static NSOrthography castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSOrthography._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSOrthography]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSOrthography1); + } + + NSString? get dominantScript { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_dominantScript1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get languageMap { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_languageMap1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSOrthography initWithDominantScript_languageMap_( + NSString? script, NSDictionary? map) { + final _ret = _lib._objc_msgSend_352( + _id, + _lib._sel_initWithDominantScript_languageMap_1, + script?._id ?? ffi.nullptr, + map?._id ?? ffi.nullptr); + return NSOrthography._(_ret, _lib, retain: true, release: true); + } + + NSOrthography initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSOrthography._(_ret, _lib, retain: true, release: true); + } + + NSArray languagesForScript_(NSString? script) { + final _ret = _lib._objc_msgSend_119( + _id, _lib._sel_languagesForScript_1, script?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString dominantLanguageForScript_(NSString? script) { + final _ret = _lib._objc_msgSend_64( + _id, _lib._sel_dominantLanguageForScript_1, script?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get dominantLanguage { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_dominantLanguage1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get allScripts { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_allScripts1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get allLanguages { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_allLanguages1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSOrthography defaultOrthographyForLanguage_( + SwiftLibrary _lib, NSString? language) { + final _ret = _lib._objc_msgSend_30( + _lib._class_NSOrthography1, + _lib._sel_defaultOrthographyForLanguage_1, + language?._id ?? ffi.nullptr); + return NSOrthography._(_ret, _lib, retain: true, release: true); + } + + static NSOrthography orthographyWithDominantScript_languageMap_( + SwiftLibrary _lib, NSString? script, NSDictionary? map) { + final _ret = _lib._objc_msgSend_352( + _lib._class_NSOrthography1, + _lib._sel_orthographyWithDominantScript_languageMap_1, + script?._id ?? ffi.nullptr, + map?._id ?? ffi.nullptr); + return NSOrthography._(_ret, _lib, retain: true, release: true); + } + + static NSOrthography new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOrthography1, _lib._sel_new1); + return NSOrthography._(_ret, _lib, retain: false, release: true); + } + + static NSOrthography alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOrthography1, _lib._sel_alloc1); + return NSOrthography._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSOrthography1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSOrthography1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOrthography1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOrthography1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSOrthography1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSOrthography1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSOrthography1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSOrthography1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSOrthography1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock13_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock13_closureRegistry = {}; +int _ObjCBlock13_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock13_registerClosure(Function fn) { + final id = ++_ObjCBlock13_closureRegistryIndex; + _ObjCBlock13_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock13_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return _ObjCBlock13_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock13 extends _ObjCBlockBase { + ObjCBlock13._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock13.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock13_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock13.fromFunction( + SwiftLibrary lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock13_closureTrampoline) + .cast(), + _ObjCBlock13_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +bool _ObjCBlock14_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer arg0, ffi.Pointer arg1)>>() + .asFunction< + bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock14_closureRegistry = {}; +int _ObjCBlock14_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock14_registerClosure(Function fn) { + final id = ++_ObjCBlock14_closureRegistryIndex; + _ObjCBlock14_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +bool _ObjCBlock14_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return _ObjCBlock14_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock14 extends _ObjCBlockBase { + ObjCBlock14._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock14.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock14_fnPtrTrampoline, false) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock14.fromFunction( + SwiftLibrary lib, + bool Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock14_closureTrampoline, false) + .cast(), + _ObjCBlock14_registerClosure(fn)), + lib); + bool call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +class NSFileManager extends NSObject { + NSFileManager._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSFileManager] that points to the same underlying object as [other]. + static NSFileManager castFrom(T other) { + return NSFileManager._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSFileManager] that wraps the given raw object pointer. + static NSFileManager castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSFileManager._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSFileManager]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSFileManager1); + } + + static NSFileManager? getDefaultManager(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_382( + _lib._class_NSFileManager1, _lib._sel_defaultManager1); + return _ret.address == 0 + ? null + : NSFileManager._(_ret, _lib, retain: true, release: true); + } + + NSArray mountedVolumeURLsIncludingResourceValuesForKeys_options_( + NSArray? propertyKeys, int options) { + final _ret = _lib._objc_msgSend_383( + _id, + _lib._sel_mountedVolumeURLsIncludingResourceValuesForKeys_options_1, + propertyKeys?._id ?? ffi.nullptr, + options); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void unmountVolumeAtURL_options_completionHandler_( + NSURL? url, int mask, ObjCBlock15 completionHandler) { + return _lib._objc_msgSend_384( + _id, + _lib._sel_unmountVolumeAtURL_options_completionHandler_1, + url?._id ?? ffi.nullptr, + mask, + completionHandler._id); + } + + NSArray contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_( + NSURL? url, + NSArray? keys, + int mask, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_385( + _id, + _lib._sel_contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_1, + url?._id ?? ffi.nullptr, + keys?._id ?? ffi.nullptr, + mask, + error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray URLsForDirectory_inDomains_(int directory, int domainMask) { + final _ret = _lib._objc_msgSend_386( + _id, _lib._sel_URLsForDirectory_inDomains_1, directory, domainMask); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSURL URLForDirectory_inDomain_appropriateForURL_create_error_( + int directory, + int domain, + NSURL? url, + bool shouldCreate, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_387( + _id, + _lib._sel_URLForDirectory_inDomain_appropriateForURL_create_error_1, + directory, + domain, + url?._id ?? ffi.nullptr, + shouldCreate, + error); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + bool getRelationship_ofDirectoryAtURL_toItemAtURL_error_( + ffi.Pointer outRelationship, + NSURL? directoryURL, + NSURL? otherURL, + ffi.Pointer> error) { + return _lib._objc_msgSend_388( + _id, + _lib._sel_getRelationship_ofDirectoryAtURL_toItemAtURL_error_1, + outRelationship, + directoryURL?._id ?? ffi.nullptr, + otherURL?._id ?? ffi.nullptr, + error); + } + + bool getRelationship_ofDirectory_inDomain_toItemAtURL_error_( + ffi.Pointer outRelationship, + int directory, + int domainMask, + NSURL? url, + ffi.Pointer> error) { + return _lib._objc_msgSend_389( + _id, + _lib._sel_getRelationship_ofDirectory_inDomain_toItemAtURL_error_1, + outRelationship, + directory, + domainMask, + url?._id ?? ffi.nullptr, + error); + } + + bool createDirectoryAtURL_withIntermediateDirectories_attributes_error_( + NSURL? url, + bool createIntermediates, + NSDictionary? attributes, + ffi.Pointer> error) { + return _lib._objc_msgSend_390( + _id, + _lib._sel_createDirectoryAtURL_withIntermediateDirectories_attributes_error_1, + url?._id ?? ffi.nullptr, + createIntermediates, + attributes?._id ?? ffi.nullptr, + error); + } + + bool createSymbolicLinkAtURL_withDestinationURL_error_( + NSURL? url, NSURL? destURL, ffi.Pointer> error) { + return _lib._objc_msgSend_391( + _id, + _lib._sel_createSymbolicLinkAtURL_withDestinationURL_error_1, + url?._id ?? ffi.nullptr, + destURL?._id ?? ffi.nullptr, + error); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + _lib._objc_msgSend_368( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + bool setAttributes_ofItemAtPath_error_(NSDictionary? attributes, + NSString? path, ffi.Pointer> error) { + return _lib._objc_msgSend_392( + _id, + _lib._sel_setAttributes_ofItemAtPath_error_1, + attributes?._id ?? ffi.nullptr, + path?._id ?? ffi.nullptr, + error); + } + + bool createDirectoryAtPath_withIntermediateDirectories_attributes_error_( + NSString? path, + bool createIntermediates, + NSDictionary? attributes, + ffi.Pointer> error) { + return _lib._objc_msgSend_393( + _id, + _lib._sel_createDirectoryAtPath_withIntermediateDirectories_attributes_error_1, + path?._id ?? ffi.nullptr, + createIntermediates, + attributes?._id ?? ffi.nullptr, + error); + } + + NSArray contentsOfDirectoryAtPath_error_( + NSString? path, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_394( + _id, + _lib._sel_contentsOfDirectoryAtPath_error_1, + path?._id ?? ffi.nullptr, + error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray subpathsOfDirectoryAtPath_error_( + NSString? path, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_394( + _id, + _lib._sel_subpathsOfDirectoryAtPath_error_1, + path?._id ?? ffi.nullptr, + error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSDictionary attributesOfItemAtPath_error_( + NSString? path, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_395( + _id, + _lib._sel_attributesOfItemAtPath_error_1, + path?._id ?? ffi.nullptr, + error); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary attributesOfFileSystemForPath_error_( + NSString? path, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_395( + _id, + _lib._sel_attributesOfFileSystemForPath_error_1, + path?._id ?? ffi.nullptr, + error); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + bool createSymbolicLinkAtPath_withDestinationPath_error_(NSString? path, + NSString? destPath, ffi.Pointer> error) { + return _lib._objc_msgSend_396( + _id, + _lib._sel_createSymbolicLinkAtPath_withDestinationPath_error_1, + path?._id ?? ffi.nullptr, + destPath?._id ?? ffi.nullptr, + error); + } + + NSString destinationOfSymbolicLinkAtPath_error_( + NSString? path, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_397( + _id, + _lib._sel_destinationOfSymbolicLinkAtPath_error_1, + path?._id ?? ffi.nullptr, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool copyItemAtPath_toPath_error_(NSString? srcPath, NSString? dstPath, + ffi.Pointer> error) { + return _lib._objc_msgSend_396(_id, _lib._sel_copyItemAtPath_toPath_error_1, + srcPath?._id ?? ffi.nullptr, dstPath?._id ?? ffi.nullptr, error); + } + + bool moveItemAtPath_toPath_error_(NSString? srcPath, NSString? dstPath, + ffi.Pointer> error) { + return _lib._objc_msgSend_396(_id, _lib._sel_moveItemAtPath_toPath_error_1, + srcPath?._id ?? ffi.nullptr, dstPath?._id ?? ffi.nullptr, error); + } + + bool linkItemAtPath_toPath_error_(NSString? srcPath, NSString? dstPath, + ffi.Pointer> error) { + return _lib._objc_msgSend_396(_id, _lib._sel_linkItemAtPath_toPath_error_1, + srcPath?._id ?? ffi.nullptr, dstPath?._id ?? ffi.nullptr, error); + } + + bool removeItemAtPath_error_( + NSString? path, ffi.Pointer> error) { + return _lib._objc_msgSend_398(_id, _lib._sel_removeItemAtPath_error_1, + path?._id ?? ffi.nullptr, error); + } + + bool copyItemAtURL_toURL_error_(NSURL? srcURL, NSURL? dstURL, + ffi.Pointer> error) { + return _lib._objc_msgSend_391(_id, _lib._sel_copyItemAtURL_toURL_error_1, + srcURL?._id ?? ffi.nullptr, dstURL?._id ?? ffi.nullptr, error); + } + + bool moveItemAtURL_toURL_error_(NSURL? srcURL, NSURL? dstURL, + ffi.Pointer> error) { + return _lib._objc_msgSend_391(_id, _lib._sel_moveItemAtURL_toURL_error_1, + srcURL?._id ?? ffi.nullptr, dstURL?._id ?? ffi.nullptr, error); + } + + bool linkItemAtURL_toURL_error_(NSURL? srcURL, NSURL? dstURL, + ffi.Pointer> error) { + return _lib._objc_msgSend_391(_id, _lib._sel_linkItemAtURL_toURL_error_1, + srcURL?._id ?? ffi.nullptr, dstURL?._id ?? ffi.nullptr, error); + } + + bool removeItemAtURL_error_( + NSURL? URL, ffi.Pointer> error) { + return _lib._objc_msgSend_81( + _id, _lib._sel_removeItemAtURL_error_1, URL?._id ?? ffi.nullptr, error); + } + + bool trashItemAtURL_resultingItemURL_error_( + NSURL? url, + ffi.Pointer> outResultingURL, + ffi.Pointer> error) { + return _lib._objc_msgSend_399( + _id, + _lib._sel_trashItemAtURL_resultingItemURL_error_1, + url?._id ?? ffi.nullptr, + outResultingURL, + error); + } + + NSDictionary fileAttributesAtPath_traverseLink_(NSString? path, bool yorn) { + final _ret = _lib._objc_msgSend_400( + _id, + _lib._sel_fileAttributesAtPath_traverseLink_1, + path?._id ?? ffi.nullptr, + yorn); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + bool changeFileAttributes_atPath_(NSDictionary? attributes, NSString? path) { + return _lib._objc_msgSend_401(_id, _lib._sel_changeFileAttributes_atPath_1, + attributes?._id ?? ffi.nullptr, path?._id ?? ffi.nullptr); + } + + NSArray directoryContentsAtPath_(NSString? path) { + final _ret = _lib._objc_msgSend_119( + _id, _lib._sel_directoryContentsAtPath_1, path?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSDictionary fileSystemAttributesAtPath_(NSString? path) { + final _ret = _lib._objc_msgSend_140( + _id, _lib._sel_fileSystemAttributesAtPath_1, path?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSString pathContentOfSymbolicLinkAtPath_(NSString? path) { + final _ret = _lib._objc_msgSend_64(_id, + _lib._sel_pathContentOfSymbolicLinkAtPath_1, path?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool createSymbolicLinkAtPath_pathContent_( + NSString? path, NSString? otherpath) { + return _lib._objc_msgSend_402( + _id, + _lib._sel_createSymbolicLinkAtPath_pathContent_1, + path?._id ?? ffi.nullptr, + otherpath?._id ?? ffi.nullptr); + } + + bool createDirectoryAtPath_attributes_( + NSString? path, NSDictionary? attributes) { + return _lib._objc_msgSend_403( + _id, + _lib._sel_createDirectoryAtPath_attributes_1, + path?._id ?? ffi.nullptr, + attributes?._id ?? ffi.nullptr); + } + + bool linkPath_toPath_handler_( + NSString? src, NSString? dest, NSObject handler) { + return _lib._objc_msgSend_404(_id, _lib._sel_linkPath_toPath_handler_1, + src?._id ?? ffi.nullptr, dest?._id ?? ffi.nullptr, handler._id); + } + + bool copyPath_toPath_handler_( + NSString? src, NSString? dest, NSObject handler) { + return _lib._objc_msgSend_404(_id, _lib._sel_copyPath_toPath_handler_1, + src?._id ?? ffi.nullptr, dest?._id ?? ffi.nullptr, handler._id); + } + + bool movePath_toPath_handler_( + NSString? src, NSString? dest, NSObject handler) { + return _lib._objc_msgSend_404(_id, _lib._sel_movePath_toPath_handler_1, + src?._id ?? ffi.nullptr, dest?._id ?? ffi.nullptr, handler._id); + } + + bool removeFileAtPath_handler_(NSString? path, NSObject handler) { + return _lib._objc_msgSend_405(_id, _lib._sel_removeFileAtPath_handler_1, + path?._id ?? ffi.nullptr, handler._id); + } + + NSString? get currentDirectoryPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_currentDirectoryPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool changeCurrentDirectoryPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_changeCurrentDirectoryPath_1, path?._id ?? ffi.nullptr); + } + + bool fileExistsAtPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_fileExistsAtPath_1, path?._id ?? ffi.nullptr); + } + + bool fileExistsAtPath_isDirectory_( + NSString? path, ffi.Pointer isDirectory) { + return _lib._objc_msgSend_406(_id, _lib._sel_fileExistsAtPath_isDirectory_1, + path?._id ?? ffi.nullptr, isDirectory); + } + + bool isReadableFileAtPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isReadableFileAtPath_1, path?._id ?? ffi.nullptr); + } + + bool isWritableFileAtPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isWritableFileAtPath_1, path?._id ?? ffi.nullptr); + } + + bool isExecutableFileAtPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isExecutableFileAtPath_1, path?._id ?? ffi.nullptr); + } + + bool isDeletableFileAtPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isDeletableFileAtPath_1, path?._id ?? ffi.nullptr); + } + + bool contentsEqualAtPath_andPath_(NSString? path1, NSString? path2) { + return _lib._objc_msgSend_402(_id, _lib._sel_contentsEqualAtPath_andPath_1, + path1?._id ?? ffi.nullptr, path2?._id ?? ffi.nullptr); + } + + NSString displayNameAtPath_(NSString? path) { + final _ret = _lib._objc_msgSend_64( + _id, _lib._sel_displayNameAtPath_1, path?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray componentsToDisplayForPath_(NSString? path) { + final _ret = _lib._objc_msgSend_119( + _id, _lib._sel_componentsToDisplayForPath_1, path?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSURL? get homeDirectoryForCurrentUser { + final _ret = + _lib._objc_msgSend_40(_id, _lib._sel_homeDirectoryForCurrentUser1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get temporaryDirectory { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_temporaryDirectory1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL homeDirectoryForUser_(NSString? userName) { + final _ret = _lib._objc_msgSend_34( + _id, _lib._sel_homeDirectoryForUser_1, userName?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSFileManager new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSFileManager1, _lib._sel_new1); + return NSFileManager._(_ret, _lib, retain: false, release: true); + } + + static NSFileManager alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSFileManager1, _lib._sel_alloc1); + return NSFileManager._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSFileManager1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSFileManager1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFileManager1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFileManager1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSFileManager1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSFileManager1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSFileManager1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSFileManager1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSFileManager1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSVolumeEnumerationOptions { + static const int NSVolumeEnumerationSkipHiddenVolumes = 2; + static const int NSVolumeEnumerationProduceFileReferenceURLs = 4; +} + +abstract class NSFileManagerUnmountOptions { + static const int NSFileManagerUnmountAllPartitionsAndEjectDisk = 1; + static const int NSFileManagerUnmountWithoutUI = 2; +} + +void _ObjCBlock15_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock15_closureRegistry = {}; +int _ObjCBlock15_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock15_registerClosure(Function fn) { + final id = ++_ObjCBlock15_closureRegistryIndex; + _ObjCBlock15_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock15_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return _ObjCBlock15_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock15 extends _ObjCBlockBase { + ObjCBlock15._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock15.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock15_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock15.fromFunction( + SwiftLibrary lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock15_closureTrampoline) + .cast(), + _ObjCBlock15_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_id, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +abstract class NSDirectoryEnumerationOptions { + static const int NSDirectoryEnumerationSkipsSubdirectoryDescendants = 1; + static const int NSDirectoryEnumerationSkipsPackageDescendants = 2; + static const int NSDirectoryEnumerationSkipsHiddenFiles = 4; + static const int NSDirectoryEnumerationIncludesDirectoriesPostOrder = 8; + static const int NSDirectoryEnumerationProducesRelativePathURLs = 16; +} + +abstract class NSSearchPathDirectory { + static const int NSApplicationDirectory = 1; + static const int NSDemoApplicationDirectory = 2; + static const int NSDeveloperApplicationDirectory = 3; + static const int NSAdminApplicationDirectory = 4; + static const int NSLibraryDirectory = 5; + static const int NSDeveloperDirectory = 6; + static const int NSUserDirectory = 7; + static const int NSDocumentationDirectory = 8; + static const int NSDocumentDirectory = 9; + static const int NSCoreServiceDirectory = 10; + static const int NSAutosavedInformationDirectory = 11; + static const int NSDesktopDirectory = 12; + static const int NSCachesDirectory = 13; + static const int NSApplicationSupportDirectory = 14; + static const int NSDownloadsDirectory = 15; + static const int NSInputMethodsDirectory = 16; + static const int NSMoviesDirectory = 17; + static const int NSMusicDirectory = 18; + static const int NSPicturesDirectory = 19; + static const int NSPrinterDescriptionDirectory = 20; + static const int NSSharedPublicDirectory = 21; + static const int NSPreferencePanesDirectory = 22; + static const int NSApplicationScriptsDirectory = 23; + static const int NSItemReplacementDirectory = 99; + static const int NSAllApplicationsDirectory = 100; + static const int NSAllLibrariesDirectory = 101; + static const int NSTrashDirectory = 102; +} + +abstract class NSSearchPathDomainMask { + static const int NSUserDomainMask = 1; + static const int NSLocalDomainMask = 2; + static const int NSNetworkDomainMask = 4; + static const int NSSystemDomainMask = 8; + static const int NSAllDomainsMask = 65535; +} + +abstract class NSURLRelationship { + static const int NSURLRelationshipContains = 0; + static const int NSURLRelationshipSame = 1; + static const int NSURLRelationshipOther = 2; +} + +class NSMutableArray extends NSArray { + NSMutableArray._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableArray] that points to the same underlying object as [other]. + static NSMutableArray castFrom(T other) { + return NSMutableArray._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSMutableArray] that wraps the given raw object pointer. + static NSMutableArray castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableArray._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableArray]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMutableArray1); + } + + void addObject_(NSObject anObject) { + return _lib._objc_msgSend_15(_id, _lib._sel_addObject_1, anObject._id); + } + + void insertObject_atIndex_(NSObject anObject, int index) { + return _lib._objc_msgSend_409( + _id, _lib._sel_insertObject_atIndex_1, anObject._id, index); + } + + void removeLastObject() { + return _lib._objc_msgSend_1(_id, _lib._sel_removeLastObject1); + } + + void removeObjectAtIndex_(int index) { + return _lib._objc_msgSend_410(_id, _lib._sel_removeObjectAtIndex_1, index); + } + + void replaceObjectAtIndex_withObject_(int index, NSObject anObject) { + return _lib._objc_msgSend_411( + _id, _lib._sel_replaceObjectAtIndex_withObject_1, index, anObject._id); + } + + @override + NSMutableArray init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + NSMutableArray initWithCapacity_(int numItems) { + final _ret = + _lib._objc_msgSend_60(_id, _lib._sel_initWithCapacity_1, numItems); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableArray initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + void addObjectsFromArray_(NSArray? otherArray) { + return _lib._objc_msgSend_412( + _id, _lib._sel_addObjectsFromArray_1, otherArray?._id ?? ffi.nullptr); + } + + void exchangeObjectAtIndex_withObjectAtIndex_(int idx1, int idx2) { + return _lib._objc_msgSend_413( + _id, _lib._sel_exchangeObjectAtIndex_withObjectAtIndex_1, idx1, idx2); + } + + void removeAllObjects() { + return _lib._objc_msgSend_1(_id, _lib._sel_removeAllObjects1); + } + + void removeObject_inRange_(NSObject anObject, NSRange range) { + return _lib._objc_msgSend_414( + _id, _lib._sel_removeObject_inRange_1, anObject._id, range); + } + + void removeObject_(NSObject anObject) { + return _lib._objc_msgSend_15(_id, _lib._sel_removeObject_1, anObject._id); + } + + void removeObjectIdenticalTo_inRange_(NSObject anObject, NSRange range) { + return _lib._objc_msgSend_414( + _id, _lib._sel_removeObjectIdenticalTo_inRange_1, anObject._id, range); + } + + void removeObjectIdenticalTo_(NSObject anObject) { + return _lib._objc_msgSend_15( + _id, _lib._sel_removeObjectIdenticalTo_1, anObject._id); + } + + void removeObjectsFromIndices_numIndices_( + ffi.Pointer indices, int cnt) { + return _lib._objc_msgSend_415( + _id, _lib._sel_removeObjectsFromIndices_numIndices_1, indices, cnt); + } + + void removeObjectsInArray_(NSArray? otherArray) { + return _lib._objc_msgSend_412( + _id, _lib._sel_removeObjectsInArray_1, otherArray?._id ?? ffi.nullptr); + } + + void removeObjectsInRange_(NSRange range) { + return _lib._objc_msgSend_416(_id, _lib._sel_removeObjectsInRange_1, range); + } + + void replaceObjectsInRange_withObjectsFromArray_range_( + NSRange range, NSArray? otherArray, NSRange otherRange) { + return _lib._objc_msgSend_417( + _id, + _lib._sel_replaceObjectsInRange_withObjectsFromArray_range_1, + range, + otherArray?._id ?? ffi.nullptr, + otherRange); + } + + void replaceObjectsInRange_withObjectsFromArray_( + NSRange range, NSArray? otherArray) { + return _lib._objc_msgSend_418( + _id, + _lib._sel_replaceObjectsInRange_withObjectsFromArray_1, + range, + otherArray?._id ?? ffi.nullptr); + } + + void setArray_(NSArray? otherArray) { + return _lib._objc_msgSend_412( + _id, _lib._sel_setArray_1, otherArray?._id ?? ffi.nullptr); + } + + void sortUsingFunction_context_( + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + compare, + ffi.Pointer context) { + return _lib._objc_msgSend_419( + _id, _lib._sel_sortUsingFunction_context_1, compare, context); + } + + void sortUsingSelector_(ffi.Pointer comparator) { + return _lib._objc_msgSend_7(_id, _lib._sel_sortUsingSelector_1, comparator); + } + + void insertObjects_atIndexes_(NSArray? objects, NSIndexSet? indexes) { + return _lib._objc_msgSend_420(_id, _lib._sel_insertObjects_atIndexes_1, + objects?._id ?? ffi.nullptr, indexes?._id ?? ffi.nullptr); + } + + void removeObjectsAtIndexes_(NSIndexSet? indexes) { + return _lib._objc_msgSend_421( + _id, _lib._sel_removeObjectsAtIndexes_1, indexes?._id ?? ffi.nullptr); + } + + void replaceObjectsAtIndexes_withObjects_( + NSIndexSet? indexes, NSArray? objects) { + return _lib._objc_msgSend_422( + _id, + _lib._sel_replaceObjectsAtIndexes_withObjects_1, + indexes?._id ?? ffi.nullptr, + objects?._id ?? ffi.nullptr); + } + + void setObject_atIndexedSubscript_(NSObject obj, int idx) { + return _lib._objc_msgSend_409( + _id, _lib._sel_setObject_atIndexedSubscript_1, obj._id, idx); + } + + void sortUsingComparator_(NSComparator cmptr) { + return _lib._objc_msgSend_423(_id, _lib._sel_sortUsingComparator_1, cmptr); + } + + void sortWithOptions_usingComparator_(int opts, NSComparator cmptr) { + return _lib._objc_msgSend_424( + _id, _lib._sel_sortWithOptions_usingComparator_1, opts, cmptr); + } + + static NSMutableArray arrayWithCapacity_(SwiftLibrary _lib, int numItems) { + final _ret = _lib._objc_msgSend_60( + _lib._class_NSMutableArray1, _lib._sel_arrayWithCapacity_1, numItems); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray arrayWithContentsOfFile_( + SwiftLibrary _lib, NSString? path) { + final _ret = _lib._objc_msgSend_425(_lib._class_NSMutableArray1, + _lib._sel_arrayWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray arrayWithContentsOfURL_(SwiftLibrary _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_426(_lib._class_NSMutableArray1, + _lib._sel_arrayWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + NSMutableArray initWithContentsOfFile_(NSString? path) { + final _ret = _lib._objc_msgSend_425( + _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + NSMutableArray initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_426( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + void applyDifference_() { + return _lib._objc_msgSend_1(_id, _lib._sel_applyDifference_1); + } + + void sortUsingDescriptors_(NSArray? sortDescriptors) { + return _lib._objc_msgSend_412(_id, _lib._sel_sortUsingDescriptors_1, + sortDescriptors?._id ?? ffi.nullptr); + } + + void filterUsingPredicate_(NSPredicate? predicate) { + return _lib._objc_msgSend_427( + _id, _lib._sel_filterUsingPredicate_1, predicate?._id ?? ffi.nullptr); + } + + static NSMutableArray array(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableArray1, _lib._sel_array1); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray arrayWithObject_(SwiftLibrary _lib, NSObject anObject) { + final _ret = _lib._objc_msgSend_16( + _lib._class_NSMutableArray1, _lib._sel_arrayWithObject_1, anObject._id); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray arrayWithObjects_count_(SwiftLibrary _lib, + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61(_lib._class_NSMutableArray1, + _lib._sel_arrayWithObjects_count_1, objects, cnt); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray arrayWithObjects_( + SwiftLibrary _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSMutableArray1, + _lib._sel_arrayWithObjects_1, firstObj._id); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray arrayWithArray_(SwiftLibrary _lib, NSArray? array) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSMutableArray1, + _lib._sel_arrayWithArray_1, array?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray arrayWithContentsOfURL_error_(SwiftLibrary _lib, NSURL? url, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_117( + _lib._class_NSMutableArray1, + _lib._sel_arrayWithContentsOfURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableArray1, _lib._sel_new1); + return NSMutableArray._(_ret, _lib, retain: false, release: true); + } + + static NSMutableArray alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableArray1, _lib._sel_alloc1); + return NSMutableArray._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMutableArray1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMutableArray1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMutableArray1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableArray1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableArray1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableArray1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMutableArray1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSMutableArray1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableArray1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSMutableOrderedSet extends NSOrderedSet { + NSMutableOrderedSet._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableOrderedSet] that points to the same underlying object as [other]. + static NSMutableOrderedSet castFrom(T other) { + return NSMutableOrderedSet._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSMutableOrderedSet] that wraps the given raw object pointer. + static NSMutableOrderedSet castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableOrderedSet._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableOrderedSet]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMutableOrderedSet1); + } + + void insertObject_atIndex_(NSObject object, int idx) { + return _lib._objc_msgSend_409( + _id, _lib._sel_insertObject_atIndex_1, object._id, idx); + } + + void removeObjectAtIndex_(int idx) { + return _lib._objc_msgSend_410(_id, _lib._sel_removeObjectAtIndex_1, idx); + } + + void replaceObjectAtIndex_withObject_(int idx, NSObject object) { + return _lib._objc_msgSend_411( + _id, _lib._sel_replaceObjectAtIndex_withObject_1, idx, object._id); + } + + @override + NSMutableOrderedSet initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableOrderedSet init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSMutableOrderedSet initWithCapacity_(int numItems) { + final _ret = + _lib._objc_msgSend_60(_id, _lib._sel_initWithCapacity_1, numItems); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + void addObject_(NSObject object) { + return _lib._objc_msgSend_15(_id, _lib._sel_addObject_1, object._id); + } + + void addObjects_count_( + ffi.Pointer> objects, int count) { + return _lib._objc_msgSend_435( + _id, _lib._sel_addObjects_count_1, objects, count); + } + + void addObjectsFromArray_(NSArray? array) { + return _lib._objc_msgSend_412( + _id, _lib._sel_addObjectsFromArray_1, array?._id ?? ffi.nullptr); + } + + void exchangeObjectAtIndex_withObjectAtIndex_(int idx1, int idx2) { + return _lib._objc_msgSend_413( + _id, _lib._sel_exchangeObjectAtIndex_withObjectAtIndex_1, idx1, idx2); + } + + void moveObjectsAtIndexes_toIndex_(NSIndexSet? indexes, int idx) { + return _lib._objc_msgSend_436(_id, _lib._sel_moveObjectsAtIndexes_toIndex_1, + indexes?._id ?? ffi.nullptr, idx); + } + + void insertObjects_atIndexes_(NSArray? objects, NSIndexSet? indexes) { + return _lib._objc_msgSend_420(_id, _lib._sel_insertObjects_atIndexes_1, + objects?._id ?? ffi.nullptr, indexes?._id ?? ffi.nullptr); + } + + void setObject_atIndex_(NSObject obj, int idx) { + return _lib._objc_msgSend_409( + _id, _lib._sel_setObject_atIndex_1, obj._id, idx); + } + + void setObject_atIndexedSubscript_(NSObject obj, int idx) { + return _lib._objc_msgSend_409( + _id, _lib._sel_setObject_atIndexedSubscript_1, obj._id, idx); + } + + void replaceObjectsInRange_withObjects_count_( + NSRange range, ffi.Pointer> objects, int count) { + return _lib._objc_msgSend_437( + _id, + _lib._sel_replaceObjectsInRange_withObjects_count_1, + range, + objects, + count); + } + + void replaceObjectsAtIndexes_withObjects_( + NSIndexSet? indexes, NSArray? objects) { + return _lib._objc_msgSend_422( + _id, + _lib._sel_replaceObjectsAtIndexes_withObjects_1, + indexes?._id ?? ffi.nullptr, + objects?._id ?? ffi.nullptr); + } + + void removeObjectsInRange_(NSRange range) { + return _lib._objc_msgSend_416(_id, _lib._sel_removeObjectsInRange_1, range); + } + + void removeObjectsAtIndexes_(NSIndexSet? indexes) { + return _lib._objc_msgSend_421( + _id, _lib._sel_removeObjectsAtIndexes_1, indexes?._id ?? ffi.nullptr); + } + + void removeAllObjects() { + return _lib._objc_msgSend_1(_id, _lib._sel_removeAllObjects1); + } + + void removeObject_(NSObject object) { + return _lib._objc_msgSend_15(_id, _lib._sel_removeObject_1, object._id); + } + + void removeObjectsInArray_(NSArray? array) { + return _lib._objc_msgSend_412( + _id, _lib._sel_removeObjectsInArray_1, array?._id ?? ffi.nullptr); + } + + void intersectOrderedSet_(NSOrderedSet? other) { + return _lib._objc_msgSend_438( + _id, _lib._sel_intersectOrderedSet_1, other?._id ?? ffi.nullptr); + } + + void minusOrderedSet_(NSOrderedSet? other) { + return _lib._objc_msgSend_438( + _id, _lib._sel_minusOrderedSet_1, other?._id ?? ffi.nullptr); + } + + void unionOrderedSet_(NSOrderedSet? other) { + return _lib._objc_msgSend_438( + _id, _lib._sel_unionOrderedSet_1, other?._id ?? ffi.nullptr); + } + + void intersectSet_(NSSet? other) { + return _lib._objc_msgSend_439( + _id, _lib._sel_intersectSet_1, other?._id ?? ffi.nullptr); + } + + void minusSet_(NSSet? other) { + return _lib._objc_msgSend_439( + _id, _lib._sel_minusSet_1, other?._id ?? ffi.nullptr); + } + + void unionSet_(NSSet? other) { + return _lib._objc_msgSend_439( + _id, _lib._sel_unionSet_1, other?._id ?? ffi.nullptr); + } + + void sortUsingComparator_(NSComparator cmptr) { + return _lib._objc_msgSend_423(_id, _lib._sel_sortUsingComparator_1, cmptr); + } + + void sortWithOptions_usingComparator_(int opts, NSComparator cmptr) { + return _lib._objc_msgSend_424( + _id, _lib._sel_sortWithOptions_usingComparator_1, opts, cmptr); + } + + void sortRange_options_usingComparator_( + NSRange range, int opts, NSComparator cmptr) { + return _lib._objc_msgSend_440( + _id, _lib._sel_sortRange_options_usingComparator_1, range, opts, cmptr); + } + + static NSMutableOrderedSet orderedSetWithCapacity_( + SwiftLibrary _lib, int numItems) { + final _ret = _lib._objc_msgSend_60(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithCapacity_1, numItems); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + void applyDifference_() { + return _lib._objc_msgSend_1(_id, _lib._sel_applyDifference_1); + } + + void sortUsingDescriptors_(NSArray? sortDescriptors) { + return _lib._objc_msgSend_412(_id, _lib._sel_sortUsingDescriptors_1, + sortDescriptors?._id ?? ffi.nullptr); + } + + void filterUsingPredicate_(NSPredicate? p) { + return _lib._objc_msgSend_427( + _id, _lib._sel_filterUsingPredicate_1, p?._id ?? ffi.nullptr); + } + + static NSMutableOrderedSet orderedSet(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableOrderedSet1, _lib._sel_orderedSet1); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSetWithObject_( + SwiftLibrary _lib, NSObject object) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithObject_1, object._id); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSetWithObjects_count_(SwiftLibrary _lib, + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithObjects_count_1, objects, cnt); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSetWithObjects_( + SwiftLibrary _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithObjects_1, firstObj._id); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSetWithOrderedSet_( + SwiftLibrary _lib, NSOrderedSet? set) { + final _ret = _lib._objc_msgSend_430(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithOrderedSet_1, set?._id ?? ffi.nullptr); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSetWithOrderedSet_range_copyItems_( + SwiftLibrary _lib, NSOrderedSet? set, NSRange range, bool flag) { + final _ret = _lib._objc_msgSend_431( + _lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithOrderedSet_range_copyItems_1, + set?._id ?? ffi.nullptr, + range, + flag); + return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSMutableOrderedSet orderedSetWithArray_( + SwiftLibrary _lib, NSArray? array) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithArray_1, array?._id ?? ffi.nullptr); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSetWithArray_range_copyItems_( + SwiftLibrary _lib, NSArray? array, NSRange range, bool flag) { + final _ret = _lib._objc_msgSend_432( + _lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithArray_range_copyItems_1, + array?._id ?? ffi.nullptr, + range, + flag); + return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSMutableOrderedSet orderedSetWithSet_(SwiftLibrary _lib, NSSet? set) { + final _ret = _lib._objc_msgSend_363(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithSet_1, set?._id ?? ffi.nullptr); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSetWithSet_copyItems_( + SwiftLibrary _lib, NSSet? set, bool flag) { + final _ret = _lib._objc_msgSend_364(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithSet_copyItems_1, set?._id ?? ffi.nullptr, flag); + return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSMutableOrderedSet new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableOrderedSet1, _lib._sel_new1); + return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSMutableOrderedSet alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableOrderedSet1, _lib._sel_alloc1); + return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMutableOrderedSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMutableOrderedSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMutableOrderedSet1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableOrderedSet1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableOrderedSet1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableOrderedSet1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMutableOrderedSet1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSMutableOrderedSet1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableOrderedSet1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSOrderedSet extends NSObject { + NSOrderedSet._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSOrderedSet] that points to the same underlying object as [other]. + static NSOrderedSet castFrom(T other) { + return NSOrderedSet._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSOrderedSet] that wraps the given raw object pointer. + static NSOrderedSet castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSOrderedSet._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSOrderedSet]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSOrderedSet1); + } + + int get count { + return _lib._objc_msgSend_10(_id, _lib._sel_count1); + } + + NSObject objectAtIndex_(int idx) { + final _ret = _lib._objc_msgSend_60(_id, _lib._sel_objectAtIndex_1, idx); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + int indexOfObject_(NSObject object) { + return _lib._objc_msgSend_69(_id, _lib._sel_indexOfObject_1, object._id); + } + + @override + NSOrderedSet init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet initWithObjects_count_( + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61( + _id, _lib._sel_initWithObjects_count_1, objects, cnt); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + void getObjects_range_( + ffi.Pointer> objects, NSRange range) { + return _lib._objc_msgSend_68( + _id, _lib._sel_getObjects_range_1, objects, range); + } + + NSArray objectsAtIndexes_(NSIndexSet? indexes) { + final _ret = _lib._objc_msgSend_103( + _id, _lib._sel_objectsAtIndexes_1, indexes?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSObject get firstObject { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_firstObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject get lastObject { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_lastObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool isEqualToOrderedSet_(NSOrderedSet? other) { + return _lib._objc_msgSend_428( + _id, _lib._sel_isEqualToOrderedSet_1, other?._id ?? ffi.nullptr); + } + + bool containsObject_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_containsObject_1, object._id); + } + + bool intersectsOrderedSet_(NSOrderedSet? other) { + return _lib._objc_msgSend_428( + _id, _lib._sel_intersectsOrderedSet_1, other?._id ?? ffi.nullptr); + } + + bool intersectsSet_(NSSet? set) { + return _lib._objc_msgSend_355( + _id, _lib._sel_intersectsSet_1, set?._id ?? ffi.nullptr); + } + + bool isSubsetOfOrderedSet_(NSOrderedSet? other) { + return _lib._objc_msgSend_428( + _id, _lib._sel_isSubsetOfOrderedSet_1, other?._id ?? ffi.nullptr); + } + + bool isSubsetOfSet_(NSSet? set) { + return _lib._objc_msgSend_355( + _id, _lib._sel_isSubsetOfSet_1, set?._id ?? ffi.nullptr); + } + + NSObject objectAtIndexedSubscript_(int idx) { + final _ret = + _lib._objc_msgSend_60(_id, _lib._sel_objectAtIndexedSubscript_1, idx); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSEnumerator objectEnumerator() { + final _ret = _lib._objc_msgSend_72(_id, _lib._sel_objectEnumerator1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + NSEnumerator reverseObjectEnumerator() { + final _ret = _lib._objc_msgSend_72(_id, _lib._sel_reverseObjectEnumerator1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet? get reversedOrderedSet { + final _ret = _lib._objc_msgSend_429(_id, _lib._sel_reversedOrderedSet1); + return _ret.address == 0 + ? null + : NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSArray? get array { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_array1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSSet? get set1 { + final _ret = _lib._objc_msgSend_280(_id, _lib._sel_set1); + return _ret.address == 0 + ? null + : NSSet._(_ret, _lib, retain: true, release: true); + } + + void enumerateObjectsUsingBlock_(ObjCBlock3 block) { + return _lib._objc_msgSend_104( + _id, _lib._sel_enumerateObjectsUsingBlock_1, block._id); + } + + void enumerateObjectsWithOptions_usingBlock_(int opts, ObjCBlock3 block) { + return _lib._objc_msgSend_105(_id, + _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._id); + } + + void enumerateObjectsAtIndexes_options_usingBlock_( + NSIndexSet? s, int opts, ObjCBlock3 block) { + return _lib._objc_msgSend_106( + _id, + _lib._sel_enumerateObjectsAtIndexes_options_usingBlock_1, + s?._id ?? ffi.nullptr, + opts, + block._id); + } + + int indexOfObjectPassingTest_(ObjCBlock4 predicate) { + return _lib._objc_msgSend_107( + _id, _lib._sel_indexOfObjectPassingTest_1, predicate._id); + } + + int indexOfObjectWithOptions_passingTest_(int opts, ObjCBlock4 predicate) { + return _lib._objc_msgSend_108(_id, + _lib._sel_indexOfObjectWithOptions_passingTest_1, opts, predicate._id); + } + + int indexOfObjectAtIndexes_options_passingTest_( + NSIndexSet? s, int opts, ObjCBlock4 predicate) { + return _lib._objc_msgSend_109( + _id, + _lib._sel_indexOfObjectAtIndexes_options_passingTest_1, + s?._id ?? ffi.nullptr, + opts, + predicate._id); + } + + NSIndexSet indexesOfObjectsPassingTest_(ObjCBlock4 predicate) { + final _ret = _lib._objc_msgSend_110( + _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._id); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet indexesOfObjectsWithOptions_passingTest_( + int opts, ObjCBlock4 predicate) { + final _ret = _lib._objc_msgSend_111( + _id, + _lib._sel_indexesOfObjectsWithOptions_passingTest_1, + opts, + predicate._id); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet indexesOfObjectsAtIndexes_options_passingTest_( + NSIndexSet? s, int opts, ObjCBlock4 predicate) { + final _ret = _lib._objc_msgSend_112( + _id, + _lib._sel_indexesOfObjectsAtIndexes_options_passingTest_1, + s?._id ?? ffi.nullptr, + opts, + predicate._id); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + int indexOfObject_inSortedRange_options_usingComparator_( + NSObject object, NSRange range, int opts, NSComparator cmp) { + return _lib._objc_msgSend_115( + _id, + _lib._sel_indexOfObject_inSortedRange_options_usingComparator_1, + object._id, + range, + opts, + cmp); + } + + NSArray sortedArrayUsingComparator_(NSComparator cmptr) { + final _ret = _lib._objc_msgSend_113( + _id, _lib._sel_sortedArrayUsingComparator_1, cmptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray sortedArrayWithOptions_usingComparator_( + int opts, NSComparator cmptr) { + final _ret = _lib._objc_msgSend_114( + _id, _lib._sel_sortedArrayWithOptions_usingComparator_1, opts, cmptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_(NSObject locale) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_indent_(NSObject locale, int level) { + final _ret = _lib._objc_msgSend_66( + _id, _lib._sel_descriptionWithLocale_indent_1, locale._id, level); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSet(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOrderedSet1, _lib._sel_orderedSet1); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSetWithObject_( + SwiftLibrary _lib, NSObject object) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithObject_1, object._id); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSetWithObjects_count_(SwiftLibrary _lib, + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61(_lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithObjects_count_1, objects, cnt); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSetWithObjects_( + SwiftLibrary _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithObjects_1, firstObj._id); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSetWithOrderedSet_( + SwiftLibrary _lib, NSOrderedSet? set) { + final _ret = _lib._objc_msgSend_430(_lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithOrderedSet_1, set?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSetWithOrderedSet_range_copyItems_( + SwiftLibrary _lib, NSOrderedSet? set, NSRange range, bool flag) { + final _ret = _lib._objc_msgSend_431( + _lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithOrderedSet_range_copyItems_1, + set?._id ?? ffi.nullptr, + range, + flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSOrderedSet orderedSetWithArray_(SwiftLibrary _lib, NSArray? array) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithArray_1, array?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSetWithArray_range_copyItems_( + SwiftLibrary _lib, NSArray? array, NSRange range, bool flag) { + final _ret = _lib._objc_msgSend_432( + _lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithArray_range_copyItems_1, + array?._id ?? ffi.nullptr, + range, + flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSOrderedSet orderedSetWithSet_(SwiftLibrary _lib, NSSet? set) { + final _ret = _lib._objc_msgSend_363(_lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithSet_1, set?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSetWithSet_copyItems_( + SwiftLibrary _lib, NSSet? set, bool flag) { + final _ret = _lib._objc_msgSend_364(_lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithSet_copyItems_1, set?._id ?? ffi.nullptr, flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + NSOrderedSet initWithObject_(NSObject object) { + final _ret = + _lib._objc_msgSend_16(_id, _lib._sel_initWithObject_1, object._id); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet initWithObjects_(NSObject firstObj) { + final _ret = + _lib._objc_msgSend_16(_id, _lib._sel_initWithObjects_1, firstObj._id); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet initWithOrderedSet_(NSOrderedSet? set) { + final _ret = _lib._objc_msgSend_430( + _id, _lib._sel_initWithOrderedSet_1, set?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet initWithOrderedSet_copyItems_(NSOrderedSet? set, bool flag) { + final _ret = _lib._objc_msgSend_433( + _id, + _lib._sel_initWithOrderedSet_copyItems_1, + set?._id ?? ffi.nullptr, + flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + NSOrderedSet initWithOrderedSet_range_copyItems_( + NSOrderedSet? set, NSRange range, bool flag) { + final _ret = _lib._objc_msgSend_431( + _id, + _lib._sel_initWithOrderedSet_range_copyItems_1, + set?._id ?? ffi.nullptr, + range, + flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + NSOrderedSet initWithArray_(NSArray? array) { + final _ret = _lib._objc_msgSend_67( + _id, _lib._sel_initWithArray_1, array?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet initWithArray_copyItems_(NSArray? set, bool flag) { + final _ret = _lib._objc_msgSend_116(_id, + _lib._sel_initWithArray_copyItems_1, set?._id ?? ffi.nullptr, flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + NSOrderedSet initWithArray_range_copyItems_( + NSArray? set, NSRange range, bool flag) { + final _ret = _lib._objc_msgSend_432( + _id, + _lib._sel_initWithArray_range_copyItems_1, + set?._id ?? ffi.nullptr, + range, + flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + NSOrderedSet initWithSet_(NSSet? set) { + final _ret = _lib._objc_msgSend_363( + _id, _lib._sel_initWithSet_1, set?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet initWithSet_copyItems_(NSSet? set, bool flag) { + final _ret = _lib._objc_msgSend_364( + _id, _lib._sel_initWithSet_copyItems_1, set?._id ?? ffi.nullptr, flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + @override + NSObject valueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_valueForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + @override + void setValue_forKey_(NSObject value, NSString? key) { + return _lib._objc_msgSend_122( + _id, _lib._sel_setValue_forKey_1, value._id, key?._id ?? ffi.nullptr); + } + + @override + void addObserver_forKeyPath_options_context_(NSObject? observer, + NSString? keyPath, int options, ffi.Pointer context) { + return _lib._objc_msgSend_126( + _id, + _lib._sel_addObserver_forKeyPath_options_context_1, + observer?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + options, + context); + } + + @override + void removeObserver_forKeyPath_context_( + NSObject? observer, NSString? keyPath, ffi.Pointer context) { + return _lib._objc_msgSend_127( + _id, + _lib._sel_removeObserver_forKeyPath_context_1, + observer?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + context); + } + + @override + void removeObserver_forKeyPath_(NSObject? observer, NSString? keyPath) { + return _lib._objc_msgSend_128(_id, _lib._sel_removeObserver_forKeyPath_1, + observer?._id ?? ffi.nullptr, keyPath?._id ?? ffi.nullptr); + } + + NSArray sortedArrayUsingDescriptors_(NSArray? sortDescriptors) { + final _ret = _lib._objc_msgSend_63( + _id, + _lib._sel_sortedArrayUsingDescriptors_1, + sortDescriptors?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet filteredOrderedSetUsingPredicate_(NSPredicate? p) { + final _ret = _lib._objc_msgSend_434(_id, + _lib._sel_filteredOrderedSetUsingPredicate_1, p?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOrderedSet1, _lib._sel_new1); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSOrderedSet alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOrderedSet1, _lib._sel_alloc1); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSOrderedSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSOrderedSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOrderedSet1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOrderedSet1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSOrderedSet1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSOrderedSet1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSOrderedSet1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSOrderedSet1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSOrderedSet1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSMutableSet extends NSSet { + NSMutableSet._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableSet] that points to the same underlying object as [other]. + static NSMutableSet castFrom(T other) { + return NSMutableSet._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSMutableSet] that wraps the given raw object pointer. + static NSMutableSet castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableSet._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableSet]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSMutableSet1); + } + + void addObject_(NSObject object) { + return _lib._objc_msgSend_15(_id, _lib._sel_addObject_1, object._id); + } + + void removeObject_(NSObject object) { + return _lib._objc_msgSend_15(_id, _lib._sel_removeObject_1, object._id); + } + + @override + NSMutableSet initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableSet init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + NSMutableSet initWithCapacity_(int numItems) { + final _ret = + _lib._objc_msgSend_60(_id, _lib._sel_initWithCapacity_1, numItems); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + void addObjectsFromArray_(NSArray? array) { + return _lib._objc_msgSend_412( + _id, _lib._sel_addObjectsFromArray_1, array?._id ?? ffi.nullptr); + } + + void intersectSet_(NSSet? otherSet) { + return _lib._objc_msgSend_439( + _id, _lib._sel_intersectSet_1, otherSet?._id ?? ffi.nullptr); + } + + void minusSet_(NSSet? otherSet) { + return _lib._objc_msgSend_439( + _id, _lib._sel_minusSet_1, otherSet?._id ?? ffi.nullptr); + } + + void removeAllObjects() { + return _lib._objc_msgSend_1(_id, _lib._sel_removeAllObjects1); + } + + void unionSet_(NSSet? otherSet) { + return _lib._objc_msgSend_439( + _id, _lib._sel_unionSet_1, otherSet?._id ?? ffi.nullptr); + } + + void setSet_(NSSet? otherSet) { + return _lib._objc_msgSend_439( + _id, _lib._sel_setSet_1, otherSet?._id ?? ffi.nullptr); + } + + static NSMutableSet setWithCapacity_(SwiftLibrary _lib, int numItems) { + final _ret = _lib._objc_msgSend_60( + _lib._class_NSMutableSet1, _lib._sel_setWithCapacity_1, numItems); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + void filterUsingPredicate_(NSPredicate? predicate) { + return _lib._objc_msgSend_427( + _id, _lib._sel_filterUsingPredicate_1, predicate?._id ?? ffi.nullptr); + } + + static NSMutableSet set1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableSet1, _lib._sel_set1); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableSet setWithObject_(SwiftLibrary _lib, NSObject object) { + final _ret = _lib._objc_msgSend_16( + _lib._class_NSMutableSet1, _lib._sel_setWithObject_1, object._id); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableSet setWithObjects_count_(SwiftLibrary _lib, + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61(_lib._class_NSMutableSet1, + _lib._sel_setWithObjects_count_1, objects, cnt); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableSet setWithObjects_(SwiftLibrary _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_16( + _lib._class_NSMutableSet1, _lib._sel_setWithObjects_1, firstObj._id); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableSet setWithSet_(SwiftLibrary _lib, NSSet? set) { + final _ret = _lib._objc_msgSend_363(_lib._class_NSMutableSet1, + _lib._sel_setWithSet_1, set?._id ?? ffi.nullptr); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableSet setWithArray_(SwiftLibrary _lib, NSArray? array) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSMutableSet1, + _lib._sel_setWithArray_1, array?._id ?? ffi.nullptr); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableSet new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableSet1, _lib._sel_new1); + return NSMutableSet._(_ret, _lib, retain: false, release: true); + } + + static NSMutableSet alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableSet1, _lib._sel_alloc1); + return NSMutableSet._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMutableSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMutableSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableSet1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableSet1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableSet1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableSet1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMutableSet1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSMutableSet1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableSet1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSKeyValueChange { + static const int NSKeyValueChangeSetting = 1; + static const int NSKeyValueChangeInsertion = 2; + static const int NSKeyValueChangeRemoval = 3; + static const int NSKeyValueChangeReplacement = 4; +} + +abstract class NSKeyValueSetMutationKind { + static const int NSKeyValueUnionSetMutation = 1; + static const int NSKeyValueMinusSetMutation = 2; + static const int NSKeyValueIntersectSetMutation = 3; + static const int NSKeyValueSetSetMutation = 4; +} + +class NSKeyedArchiver extends NSCoder { + NSKeyedArchiver._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSKeyedArchiver] that points to the same underlying object as [other]. + static NSKeyedArchiver castFrom(T other) { + return NSKeyedArchiver._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSKeyedArchiver] that wraps the given raw object pointer. + static NSKeyedArchiver castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSKeyedArchiver._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSKeyedArchiver]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSKeyedArchiver1); + } + + NSKeyedArchiver initRequiringSecureCoding_(bool requiresSecureCoding) { + final _ret = _lib._objc_msgSend_449( + _id, _lib._sel_initRequiringSecureCoding_1, requiresSecureCoding); + return NSKeyedArchiver._(_ret, _lib, retain: true, release: true); + } + + static NSData archivedDataWithRootObject_requiringSecureCoding_error_( + SwiftLibrary _lib, + NSObject object, + bool requiresSecureCoding, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_450( + _lib._class_NSKeyedArchiver1, + _lib._sel_archivedDataWithRootObject_requiringSecureCoding_error_1, + object._id, + requiresSecureCoding, + error); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSKeyedArchiver init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSKeyedArchiver._(_ret, _lib, retain: true, release: true); + } + + NSKeyedArchiver initForWritingWithMutableData_(NSMutableData? data) { + final _ret = _lib._objc_msgSend_455(_id, + _lib._sel_initForWritingWithMutableData_1, data?._id ?? ffi.nullptr); + return NSKeyedArchiver._(_ret, _lib, retain: true, release: true); + } + + static NSData archivedDataWithRootObject_( + SwiftLibrary _lib, NSObject rootObject) { + final _ret = _lib._objc_msgSend_456(_lib._class_NSKeyedArchiver1, + _lib._sel_archivedDataWithRootObject_1, rootObject._id); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static bool archiveRootObject_toFile_( + SwiftLibrary _lib, NSObject rootObject, NSString? path) { + return _lib._objc_msgSend_225( + _lib._class_NSKeyedArchiver1, + _lib._sel_archiveRootObject_toFile_1, + rootObject._id, + path?._id ?? ffi.nullptr); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + _lib._objc_msgSend_368( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + int get outputFormat { + return _lib._objc_msgSend_457(_id, _lib._sel_outputFormat1); + } + + set outputFormat(int value) { + _lib._objc_msgSend_458(_id, _lib._sel_setOutputFormat_1, value); + } + + NSData? get encodedData { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_encodedData1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + void finishEncoding() { + return _lib._objc_msgSend_1(_id, _lib._sel_finishEncoding1); + } + + static void setClassName_forClass_( + SwiftLibrary _lib, NSString? codedName, NSObject cls) { + return _lib._objc_msgSend_459( + _lib._class_NSKeyedArchiver1, + _lib._sel_setClassName_forClass_1, + codedName?._id ?? ffi.nullptr, + cls._id); + } + + static NSString classNameForClass_(SwiftLibrary _lib, NSObject cls) { + final _ret = _lib._objc_msgSend_65( + _lib._class_NSKeyedArchiver1, _lib._sel_classNameForClass_1, cls._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + @override + void encodeObject_forKey_(NSObject object, NSString? key) { + return _lib._objc_msgSend_122(_id, _lib._sel_encodeObject_forKey_1, + object._id, key?._id ?? ffi.nullptr); + } + + @override + void encodeConditionalObject_forKey_(NSObject object, NSString? key) { + return _lib._objc_msgSend_122( + _id, + _lib._sel_encodeConditionalObject_forKey_1, + object._id, + key?._id ?? ffi.nullptr); + } + + @override + void encodeBool_forKey_(bool value, NSString? key) { + return _lib._objc_msgSend_257( + _id, _lib._sel_encodeBool_forKey_1, value, key?._id ?? ffi.nullptr); + } + + @override + void encodeInt_forKey_(int value, NSString? key) { + return _lib._objc_msgSend_258( + _id, _lib._sel_encodeInt_forKey_1, value, key?._id ?? ffi.nullptr); + } + + @override + void encodeInt32_forKey_(int value, NSString? key) { + return _lib._objc_msgSend_259( + _id, _lib._sel_encodeInt32_forKey_1, value, key?._id ?? ffi.nullptr); + } + + @override + void encodeInt64_forKey_(int value, NSString? key) { + return _lib._objc_msgSend_260( + _id, _lib._sel_encodeInt64_forKey_1, value, key?._id ?? ffi.nullptr); + } + + @override + void encodeFloat_forKey_(double value, NSString? key) { + return _lib._objc_msgSend_261( + _id, _lib._sel_encodeFloat_forKey_1, value, key?._id ?? ffi.nullptr); + } + + @override + void encodeDouble_forKey_(double value, NSString? key) { + return _lib._objc_msgSend_262( + _id, _lib._sel_encodeDouble_forKey_1, value, key?._id ?? ffi.nullptr); + } + + @override + void encodeBytes_length_forKey_( + ffi.Pointer bytes, int length, NSString? key) { + return _lib._objc_msgSend_263(_id, _lib._sel_encodeBytes_length_forKey_1, + bytes, length, key?._id ?? ffi.nullptr); + } + + @override + bool get requiresSecureCoding { + return _lib._objc_msgSend_12(_id, _lib._sel_requiresSecureCoding1); + } + + set requiresSecureCoding(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setRequiresSecureCoding_1, value); + } + + static NSKeyedArchiver new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSKeyedArchiver1, _lib._sel_new1); + return NSKeyedArchiver._(_ret, _lib, retain: false, release: true); + } + + static NSKeyedArchiver alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSKeyedArchiver1, _lib._sel_alloc1); + return NSKeyedArchiver._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSKeyedArchiver1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSKeyedArchiver1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSKeyedArchiver1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSKeyedArchiver1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSKeyedArchiver1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSKeyedArchiver1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSKeyedArchiver1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSKeyedArchiver1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSKeyedArchiver1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSMutableData extends NSData { + NSMutableData._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableData] that points to the same underlying object as [other]. + static NSMutableData castFrom(T other) { + return NSMutableData._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSMutableData] that wraps the given raw object pointer. + static NSMutableData castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableData._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableData]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSMutableData1); + } + + ffi.Pointer get mutableBytes { + return _lib._objc_msgSend_19(_id, _lib._sel_mutableBytes1); + } + + @override + int get length { + return _lib._objc_msgSend_10(_id, _lib._sel_length1); + } + + set length(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setLength_1, value); + } + + void appendBytes_length_(ffi.Pointer bytes, int length) { + return _lib._objc_msgSend_21( + _id, _lib._sel_appendBytes_length_1, bytes, length); + } + + void appendData_(NSData? other) { + return _lib._objc_msgSend_248( + _id, _lib._sel_appendData_1, other?._id ?? ffi.nullptr); + } + + void increaseLengthBy_(int extraLength) { + return _lib._objc_msgSend_410( + _id, _lib._sel_increaseLengthBy_1, extraLength); + } + + void replaceBytesInRange_withBytes_( + NSRange range, ffi.Pointer bytes) { + return _lib._objc_msgSend_452( + _id, _lib._sel_replaceBytesInRange_withBytes_1, range, bytes); + } + + void resetBytesInRange_(NSRange range) { + return _lib._objc_msgSend_416(_id, _lib._sel_resetBytesInRange_1, range); + } + + void setData_(NSData? data) { + return _lib._objc_msgSend_248( + _id, _lib._sel_setData_1, data?._id ?? ffi.nullptr); + } + + void replaceBytesInRange_withBytes_length_(NSRange range, + ffi.Pointer replacementBytes, int replacementLength) { + return _lib._objc_msgSend_453( + _id, + _lib._sel_replaceBytesInRange_withBytes_length_1, + range, + replacementBytes, + replacementLength); + } + + static NSMutableData dataWithCapacity_(SwiftLibrary _lib, int aNumItems) { + final _ret = _lib._objc_msgSend_60( + _lib._class_NSMutableData1, _lib._sel_dataWithCapacity_1, aNumItems); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData dataWithLength_(SwiftLibrary _lib, int length) { + final _ret = _lib._objc_msgSend_60( + _lib._class_NSMutableData1, _lib._sel_dataWithLength_1, length); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + NSMutableData initWithCapacity_(int capacity) { + final _ret = + _lib._objc_msgSend_60(_id, _lib._sel_initWithCapacity_1, capacity); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + NSMutableData initWithLength_(int length) { + final _ret = _lib._objc_msgSend_60(_id, _lib._sel_initWithLength_1, length); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + bool decompressUsingAlgorithm_error_( + int algorithm, ffi.Pointer> error) { + return _lib._objc_msgSend_454( + _id, _lib._sel_decompressUsingAlgorithm_error_1, algorithm, error); + } + + bool compressUsingAlgorithm_error_( + int algorithm, ffi.Pointer> error) { + return _lib._objc_msgSend_454( + _id, _lib._sel_compressUsingAlgorithm_error_1, algorithm, error); + } + + static NSMutableData data(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableData1, _lib._sel_data1); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData dataWithBytes_length_( + SwiftLibrary _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_237(_lib._class_NSMutableData1, + _lib._sel_dataWithBytes_length_1, bytes, length); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData dataWithBytesNoCopy_length_( + SwiftLibrary _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_237(_lib._class_NSMutableData1, + _lib._sel_dataWithBytesNoCopy_length_1, bytes, length); + return NSMutableData._(_ret, _lib, retain: false, release: true); + } + + static NSMutableData dataWithBytesNoCopy_length_freeWhenDone_( + SwiftLibrary _lib, ffi.Pointer bytes, int length, bool b) { + final _ret = _lib._objc_msgSend_238(_lib._class_NSMutableData1, + _lib._sel_dataWithBytesNoCopy_length_freeWhenDone_1, bytes, length, b); + return NSMutableData._(_ret, _lib, retain: false, release: true); + } + + static NSMutableData dataWithContentsOfFile_options_error_( + SwiftLibrary _lib, + NSString? path, + int readOptionsMask, + ffi.Pointer> errorPtr) { + final _ret = _lib._objc_msgSend_239( + _lib._class_NSMutableData1, + _lib._sel_dataWithContentsOfFile_options_error_1, + path?._id ?? ffi.nullptr, + readOptionsMask, + errorPtr); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData dataWithContentsOfURL_options_error_( + SwiftLibrary _lib, + NSURL? url, + int readOptionsMask, + ffi.Pointer> errorPtr) { + final _ret = _lib._objc_msgSend_240( + _lib._class_NSMutableData1, + _lib._sel_dataWithContentsOfURL_options_error_1, + url?._id ?? ffi.nullptr, + readOptionsMask, + errorPtr); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData dataWithContentsOfFile_( + SwiftLibrary _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSMutableData1, + _lib._sel_dataWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData dataWithContentsOfURL_(SwiftLibrary _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_226(_lib._class_NSMutableData1, + _lib._sel_dataWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData dataWithData_(SwiftLibrary _lib, NSData? data) { + final _ret = _lib._objc_msgSend_242(_lib._class_NSMutableData1, + _lib._sel_dataWithData_1, data?._id ?? ffi.nullptr); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSObject dataWithContentsOfMappedFile_( + SwiftLibrary _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSMutableData1, + _lib._sel_dataWithContentsOfMappedFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableData1, _lib._sel_new1); + return NSMutableData._(_ret, _lib, retain: false, release: true); + } + + static NSMutableData alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableData1, _lib._sel_alloc1); + return NSMutableData._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMutableData1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMutableData1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableData1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableData1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableData1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableData1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMutableData1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSMutableData1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableData1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSPropertyListFormat { + static const int NSPropertyListOpenStepFormat = 1; + static const int NSPropertyListXMLFormat_v1_0 = 100; + static const int NSPropertyListBinaryFormat_v1_0 = 200; +} + +class NSThread extends NSObject { + NSThread._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSThread] that points to the same underlying object as [other]. + static NSThread castFrom(T other) { + return NSThread._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSThread] that wraps the given raw object pointer. + static NSThread castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSThread._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSThread]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSThread1); + } + + static NSThread? getCurrentThread(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_464(_lib._class_NSThread1, _lib._sel_currentThread1); + return _ret.address == 0 + ? null + : NSThread._(_ret, _lib, retain: true, release: true); + } + + static void detachNewThreadWithBlock_(SwiftLibrary _lib, ObjCBlock16 block) { + return _lib._objc_msgSend_465( + _lib._class_NSThread1, _lib._sel_detachNewThreadWithBlock_1, block._id); + } + + static void detachNewThreadSelector_toTarget_withObject_(SwiftLibrary _lib, + ffi.Pointer selector, NSObject target, NSObject argument) { + return _lib._objc_msgSend_466( + _lib._class_NSThread1, + _lib._sel_detachNewThreadSelector_toTarget_withObject_1, + selector, + target._id, + argument._id); + } + + static bool isMultiThreaded(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSThread1, _lib._sel_isMultiThreaded1); + } + + NSMutableDictionary? get threadDictionary { + final _ret = _lib._objc_msgSend_471(_id, _lib._sel_threadDictionary1); + return _ret.address == 0 + ? null + : NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static void sleepUntilDate_(SwiftLibrary _lib, NSDate? date) { + return _lib._objc_msgSend_472(_lib._class_NSThread1, + _lib._sel_sleepUntilDate_1, date?._id ?? ffi.nullptr); + } + + static void sleepForTimeInterval_(SwiftLibrary _lib, double ti) { + return _lib._objc_msgSend_473( + _lib._class_NSThread1, _lib._sel_sleepForTimeInterval_1, ti); + } + + static void exit(SwiftLibrary _lib) { + return _lib._objc_msgSend_1(_lib._class_NSThread1, _lib._sel_exit1); + } + + double get threadPriority { + return _lib._objc_msgSend_149(_id, _lib._sel_threadPriority1); + } + + set threadPriority(double value) { + _lib._objc_msgSend_474(_id, _lib._sel_setThreadPriority_1, value); + } + + int get qualityOfService { + return _lib._objc_msgSend_475(_id, _lib._sel_qualityOfService1); + } + + set qualityOfService(int value) { + _lib._objc_msgSend_476(_id, _lib._sel_setQualityOfService_1, value); + } + + static NSArray? getCallStackReturnAddresses(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSThread1, _lib._sel_callStackReturnAddresses1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getCallStackSymbols(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSThread1, _lib._sel_callStackSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set name(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setName_1, value?._id ?? ffi.nullptr); + } + + int get stackSize { + return _lib._objc_msgSend_10(_id, _lib._sel_stackSize1); + } + + set stackSize(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setStackSize_1, value); + } + + bool get isMainThread { + return _lib._objc_msgSend_12(_id, _lib._sel_isMainThread1); + } + + static NSThread? getMainThread(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_464(_lib._class_NSThread1, _lib._sel_mainThread1); + return _ret.address == 0 + ? null + : NSThread._(_ret, _lib, retain: true, release: true); + } + + @override + NSThread init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSThread._(_ret, _lib, retain: true, release: true); + } + + NSThread initWithTarget_selector_object_( + NSObject target, ffi.Pointer selector, NSObject argument) { + final _ret = _lib._objc_msgSend_478( + _id, + _lib._sel_initWithTarget_selector_object_1, + target._id, + selector, + argument._id); + return NSThread._(_ret, _lib, retain: true, release: true); + } + + NSThread initWithBlock_(ObjCBlock16 block) { + final _ret = + _lib._objc_msgSend_479(_id, _lib._sel_initWithBlock_1, block._id); + return NSThread._(_ret, _lib, retain: true, release: true); + } + + bool get executing { + return _lib._objc_msgSend_12(_id, _lib._sel_isExecuting1); + } + + bool get finished { + return _lib._objc_msgSend_12(_id, _lib._sel_isFinished1); + } + + bool get cancelled { + return _lib._objc_msgSend_12(_id, _lib._sel_isCancelled1); + } + + void cancel() { + return _lib._objc_msgSend_1(_id, _lib._sel_cancel1); + } + + void start() { + return _lib._objc_msgSend_1(_id, _lib._sel_start1); + } + + void main() { + return _lib._objc_msgSend_1(_id, _lib._sel_main1); + } + + static NSThread new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSThread1, _lib._sel_new1); + return NSThread._(_ret, _lib, retain: false, release: true); + } + + static NSThread alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSThread1, _lib._sel_alloc1); + return NSThread._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSThread1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSThread1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSThread1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSThread1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSThread1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSThread1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSThread1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSThread1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSThread1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock16_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block) { + return block.ref.target + .cast>() + .asFunction()(); +} + +final _ObjCBlock16_closureRegistry = {}; +int _ObjCBlock16_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock16_registerClosure(Function fn) { + final id = ++_ObjCBlock16_closureRegistryIndex; + _ObjCBlock16_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock16_closureTrampoline(ffi.Pointer<_ObjCBlock> block) { + return _ObjCBlock16_closureRegistry[block.ref.target.address]!(); +} + +class ObjCBlock16 extends _ObjCBlockBase { + ObjCBlock16._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock16.fromFunctionPointer(SwiftLibrary lib, + ffi.Pointer> ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block)>( + _ObjCBlock16_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock16.fromFunction(SwiftLibrary lib, void Function() fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block)>( + _ObjCBlock16_closureTrampoline) + .cast(), + _ObjCBlock16_registerClosure(fn)), + lib); + void call() { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block)>>() + .asFunction block)>()(_id); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +class NSMutableDictionary extends NSDictionary { + NSMutableDictionary._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableDictionary] that points to the same underlying object as [other]. + static NSMutableDictionary castFrom(T other) { + return NSMutableDictionary._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSMutableDictionary] that wraps the given raw object pointer. + static NSMutableDictionary castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableDictionary._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableDictionary]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMutableDictionary1); + } + + void removeObjectForKey_(NSObject aKey) { + return _lib._objc_msgSend_15(_id, _lib._sel_removeObjectForKey_1, aKey._id); + } + + void setObject_forKey_(NSObject anObject, NSObject aKey) { + return _lib._objc_msgSend_467( + _id, _lib._sel_setObject_forKey_1, anObject._id, aKey._id); + } + + @override + NSMutableDictionary init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + NSMutableDictionary initWithCapacity_(int numItems) { + final _ret = + _lib._objc_msgSend_60(_id, _lib._sel_initWithCapacity_1, numItems); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableDictionary initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + void addEntriesFromDictionary_(NSDictionary? otherDictionary) { + return _lib._objc_msgSend_444(_id, _lib._sel_addEntriesFromDictionary_1, + otherDictionary?._id ?? ffi.nullptr); + } + + void removeAllObjects() { + return _lib._objc_msgSend_1(_id, _lib._sel_removeAllObjects1); + } + + void removeObjectsForKeys_(NSArray? keyArray) { + return _lib._objc_msgSend_412( + _id, _lib._sel_removeObjectsForKeys_1, keyArray?._id ?? ffi.nullptr); + } + + void setDictionary_(NSDictionary? otherDictionary) { + return _lib._objc_msgSend_444( + _id, _lib._sel_setDictionary_1, otherDictionary?._id ?? ffi.nullptr); + } + + void setObject_forKeyedSubscript_(NSObject obj, NSObject key) { + return _lib._objc_msgSend_467( + _id, _lib._sel_setObject_forKeyedSubscript_1, obj._id, key._id); + } + + static NSMutableDictionary dictionaryWithCapacity_( + SwiftLibrary _lib, int numItems) { + final _ret = _lib._objc_msgSend_60(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithCapacity_1, numItems); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithContentsOfFile_( + SwiftLibrary _lib, NSString? path) { + final _ret = _lib._objc_msgSend_468(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithContentsOfURL_( + SwiftLibrary _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_469(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + NSMutableDictionary initWithContentsOfFile_(NSString? path) { + final _ret = _lib._objc_msgSend_468( + _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + NSMutableDictionary initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_469( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithSharedKeySet_( + SwiftLibrary _lib, NSObject keyset) { + final _ret = _lib._objc_msgSend_470(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithSharedKeySet_1, keyset._id); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + void setValue_forKey_(NSObject value, NSString? key) { + return _lib._objc_msgSend_122( + _id, _lib._sel_setValue_forKey_1, value._id, key?._id ?? ffi.nullptr); + } + + static NSMutableDictionary dictionary(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableDictionary1, _lib._sel_dictionary1); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithObject_forKey_( + SwiftLibrary _lib, NSObject object, NSObject key) { + final _ret = _lib._objc_msgSend_142(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithObject_forKey_1, object._id, key._id); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithObjects_forKeys_count_( + SwiftLibrary _lib, + ffi.Pointer> objects, + ffi.Pointer> keys, + int cnt) { + final _ret = _lib._objc_msgSend_133(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithObjects_forKeys_count_1, objects, keys, cnt); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithObjectsAndKeys_( + SwiftLibrary _lib, NSObject firstObject) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithObjectsAndKeys_1, firstObject._id); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithDictionary_( + SwiftLibrary _lib, NSDictionary? dict) { + final _ret = _lib._objc_msgSend_143(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithDictionary_1, dict?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithObjects_forKeys_( + SwiftLibrary _lib, NSArray? objects, NSArray? keys) { + final _ret = _lib._objc_msgSend_144( + _lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithObjects_forKeys_1, + objects?._id ?? ffi.nullptr, + keys?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithContentsOfURL_error_(SwiftLibrary _lib, + NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_146( + _lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithContentsOfURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSObject sharedKeySetForKeys_(SwiftLibrary _lib, NSArray? keys) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSMutableDictionary1, + _lib._sel_sharedKeySetForKeys_1, keys?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableDictionary1, _lib._sel_new1); + return NSMutableDictionary._(_ret, _lib, retain: false, release: true); + } + + static NSMutableDictionary alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableDictionary1, _lib._sel_alloc1); + return NSMutableDictionary._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMutableDictionary1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMutableDictionary1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMutableDictionary1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableDictionary1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableDictionary1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableDictionary1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMutableDictionary1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSMutableDictionary1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableDictionary1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSQualityOfService { + static const int NSQualityOfServiceUserInteractive = 33; + static const int NSQualityOfServiceUserInitiated = 25; + static const int NSQualityOfServiceUtility = 17; + static const int NSQualityOfServiceBackground = 9; + static const int NSQualityOfServiceDefault = -1; +} + +class NSArchiver extends NSCoder { + NSArchiver._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSArchiver] that points to the same underlying object as [other]. + static NSArchiver castFrom(T other) { + return NSArchiver._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSArchiver] that wraps the given raw object pointer. + static NSArchiver castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSArchiver._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSArchiver]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSArchiver1); + } + + NSArchiver initForWritingWithMutableData_(NSMutableData? mdata) { + final _ret = _lib._objc_msgSend_455(_id, + _lib._sel_initForWritingWithMutableData_1, mdata?._id ?? ffi.nullptr); + return NSArchiver._(_ret, _lib, retain: true, release: true); + } + + NSMutableData? get archiverData { + final _ret = _lib._objc_msgSend_482(_id, _lib._sel_archiverData1); + return _ret.address == 0 + ? null + : NSMutableData._(_ret, _lib, retain: true, release: true); + } + + @override + void encodeRootObject_(NSObject rootObject) { + return _lib._objc_msgSend_15( + _id, _lib._sel_encodeRootObject_1, rootObject._id); + } + + @override + void encodeConditionalObject_(NSObject object) { + return _lib._objc_msgSend_15( + _id, _lib._sel_encodeConditionalObject_1, object._id); + } + + static NSData archivedDataWithRootObject_( + SwiftLibrary _lib, NSObject rootObject) { + final _ret = _lib._objc_msgSend_456(_lib._class_NSArchiver1, + _lib._sel_archivedDataWithRootObject_1, rootObject._id); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static bool archiveRootObject_toFile_( + SwiftLibrary _lib, NSObject rootObject, NSString? path) { + return _lib._objc_msgSend_225( + _lib._class_NSArchiver1, + _lib._sel_archiveRootObject_toFile_1, + rootObject._id, + path?._id ?? ffi.nullptr); + } + + void encodeClassName_intoClassName_( + NSString? trueName, NSString? inArchiveName) { + return _lib._objc_msgSend_483( + _id, + _lib._sel_encodeClassName_intoClassName_1, + trueName?._id ?? ffi.nullptr, + inArchiveName?._id ?? ffi.nullptr); + } + + NSString classNameEncodedForTrueClassName_(NSString? trueName) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_classNameEncodedForTrueClassName_1, + trueName?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + void replaceObject_withObject_(NSObject object, NSObject newObject) { + return _lib._objc_msgSend_467( + _id, _lib._sel_replaceObject_withObject_1, object._id, newObject._id); + } + + static NSArchiver new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSArchiver1, _lib._sel_new1); + return NSArchiver._(_ret, _lib, retain: false, release: true); + } + + static NSArchiver alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSArchiver1, _lib._sel_alloc1); + return NSArchiver._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSArchiver1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSArchiver1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSArchiver1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSArchiver1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSArchiver1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSArchiver1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSArchiver1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSArchiver1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSArchiver1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSPortCoder extends NSCoder { + NSPortCoder._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSPortCoder] that points to the same underlying object as [other]. + static NSPortCoder castFrom(T other) { + return NSPortCoder._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSPortCoder] that wraps the given raw object pointer. + static NSPortCoder castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSPortCoder._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSPortCoder]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSPortCoder1); + } + + bool isBycopy() { + return _lib._objc_msgSend_12(_id, _lib._sel_isBycopy1); + } + + bool isByref() { + return _lib._objc_msgSend_12(_id, _lib._sel_isByref1); + } + + void encodePortObject_(NSPort? aport) { + return _lib._objc_msgSend_520( + _id, _lib._sel_encodePortObject_1, aport?._id ?? ffi.nullptr); + } + + NSPort decodePortObject() { + final _ret = _lib._objc_msgSend_485(_id, _lib._sel_decodePortObject1); + return NSPort._(_ret, _lib, retain: true, release: true); + } + + NSConnection connection() { + final _ret = _lib._objc_msgSend_504(_id, _lib._sel_connection1); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSObject portCoderWithReceivePort_sendPort_components_( + SwiftLibrary _lib, NSPort? rcvPort, NSPort? sndPort, NSArray? comps) { + final _ret = _lib._objc_msgSend_521( + _lib._class_NSPortCoder1, + _lib._sel_portCoderWithReceivePort_sendPort_components_1, + rcvPort?._id ?? ffi.nullptr, + sndPort?._id ?? ffi.nullptr, + comps?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithReceivePort_sendPort_components_( + NSPort? rcvPort, NSPort? sndPort, NSArray? comps) { + final _ret = _lib._objc_msgSend_521( + _id, + _lib._sel_initWithReceivePort_sendPort_components_1, + rcvPort?._id ?? ffi.nullptr, + sndPort?._id ?? ffi.nullptr, + comps?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void dispatch() { + return _lib._objc_msgSend_1(_id, _lib._sel_dispatch1); + } + + static NSPortCoder new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSPortCoder1, _lib._sel_new1); + return NSPortCoder._(_ret, _lib, retain: false, release: true); + } + + static NSPortCoder alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPortCoder1, _lib._sel_alloc1); + return NSPortCoder._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSPortCoder1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSPortCoder1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPortCoder1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPortCoder1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSPortCoder1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSPortCoder1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSPortCoder1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSPortCoder1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPortCoder1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSPort extends NSObject { + NSPort._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSPort] that points to the same underlying object as [other]. + static NSPort castFrom(T other) { + return NSPort._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSPort] that wraps the given raw object pointer. + static NSPort castFromPointer(SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSPort._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSPort]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSPort1); + } + + static NSPort port(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_485(_lib._class_NSPort1, _lib._sel_port1); + return NSPort._(_ret, _lib, retain: true, release: true); + } + + void invalidate() { + return _lib._objc_msgSend_1(_id, _lib._sel_invalidate1); + } + + bool get valid { + return _lib._objc_msgSend_12(_id, _lib._sel_isValid1); + } + + void setDelegate_(NSObject? anObject) { + return _lib._objc_msgSend_15( + _id, _lib._sel_setDelegate_1, anObject?._id ?? ffi.nullptr); + } + + NSObject delegate() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void scheduleInRunLoop_forMode_(NSRunLoop? runLoop, NSRunLoopMode mode) { + return _lib._objc_msgSend_501(_id, _lib._sel_scheduleInRunLoop_forMode_1, + runLoop?._id ?? ffi.nullptr, mode); + } + + void removeFromRunLoop_forMode_(NSRunLoop? runLoop, NSRunLoopMode mode) { + return _lib._objc_msgSend_501(_id, _lib._sel_removeFromRunLoop_forMode_1, + runLoop?._id ?? ffi.nullptr, mode); + } + + int get reservedSpaceLength { + return _lib._objc_msgSend_10(_id, _lib._sel_reservedSpaceLength1); + } + + bool sendBeforeDate_components_from_reserved_( + NSDate? limitDate, + NSMutableArray? components, + NSPort? receivePort, + int headerSpaceReserved) { + return _lib._objc_msgSend_502( + _id, + _lib._sel_sendBeforeDate_components_from_reserved_1, + limitDate?._id ?? ffi.nullptr, + components?._id ?? ffi.nullptr, + receivePort?._id ?? ffi.nullptr, + headerSpaceReserved); + } + + bool sendBeforeDate_msgid_components_from_reserved_( + NSDate? limitDate, + int msgID, + NSMutableArray? components, + NSPort? receivePort, + int headerSpaceReserved) { + return _lib._objc_msgSend_503( + _id, + _lib._sel_sendBeforeDate_msgid_components_from_reserved_1, + limitDate?._id ?? ffi.nullptr, + msgID, + components?._id ?? ffi.nullptr, + receivePort?._id ?? ffi.nullptr, + headerSpaceReserved); + } + + void addConnection_toRunLoop_forMode_( + NSConnection? conn, NSRunLoop? runLoop, NSRunLoopMode mode) { + return _lib._objc_msgSend_519( + _id, + _lib._sel_addConnection_toRunLoop_forMode_1, + conn?._id ?? ffi.nullptr, + runLoop?._id ?? ffi.nullptr, + mode); + } + + void removeConnection_fromRunLoop_forMode_( + NSConnection? conn, NSRunLoop? runLoop, NSRunLoopMode mode) { + return _lib._objc_msgSend_519( + _id, + _lib._sel_removeConnection_fromRunLoop_forMode_1, + conn?._id ?? ffi.nullptr, + runLoop?._id ?? ffi.nullptr, + mode); + } + + static NSPort new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSPort1, _lib._sel_new1); + return NSPort._(_ret, _lib, retain: false, release: true); + } + + static NSPort alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSPort1, _lib._sel_alloc1); + return NSPort._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSPort1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSPort1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPort1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPort1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSPort1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSPort1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSPort1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSPort1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPort1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSRunLoop extends NSObject { + NSRunLoop._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSRunLoop] that points to the same underlying object as [other]. + static NSRunLoop castFrom(T other) { + return NSRunLoop._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSRunLoop] that wraps the given raw object pointer. + static NSRunLoop castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSRunLoop._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSRunLoop]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSRunLoop1); + } + + static NSRunLoop? getCurrentRunLoop(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_486( + _lib._class_NSRunLoop1, _lib._sel_currentRunLoop1); + return _ret.address == 0 + ? null + : NSRunLoop._(_ret, _lib, retain: true, release: true); + } + + static NSRunLoop? getMainRunLoop(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_486(_lib._class_NSRunLoop1, _lib._sel_mainRunLoop1); + return _ret.address == 0 + ? null + : NSRunLoop._(_ret, _lib, retain: true, release: true); + } + + NSRunLoopMode get currentMode { + return _lib._objc_msgSend_20(_id, _lib._sel_currentMode1); + } + + CFRunLoopRef getCFRunLoop() { + return _lib._objc_msgSend_487(_id, _lib._sel_getCFRunLoop1); + } + + void addTimer_forMode_(NSTimer? timer, NSRunLoopMode mode) { + return _lib._objc_msgSend_494( + _id, _lib._sel_addTimer_forMode_1, timer?._id ?? ffi.nullptr, mode); + } + + void addPort_forMode_(NSPort? aPort, NSRunLoopMode mode) { + return _lib._objc_msgSend_495( + _id, _lib._sel_addPort_forMode_1, aPort?._id ?? ffi.nullptr, mode); + } + + void removePort_forMode_(NSPort? aPort, NSRunLoopMode mode) { + return _lib._objc_msgSend_495( + _id, _lib._sel_removePort_forMode_1, aPort?._id ?? ffi.nullptr, mode); + } + + NSDate limitDateForMode_(NSRunLoopMode mode) { + final _ret = + _lib._objc_msgSend_496(_id, _lib._sel_limitDateForMode_1, mode); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + void acceptInputForMode_beforeDate_(NSRunLoopMode mode, NSDate? limitDate) { + return _lib._objc_msgSend_497( + _id, + _lib._sel_acceptInputForMode_beforeDate_1, + mode, + limitDate?._id ?? ffi.nullptr); + } + + void run() { + return _lib._objc_msgSend_1(_id, _lib._sel_run1); + } + + void runUntilDate_(NSDate? limitDate) { + return _lib._objc_msgSend_472( + _id, _lib._sel_runUntilDate_1, limitDate?._id ?? ffi.nullptr); + } + + bool runMode_beforeDate_(NSRunLoopMode mode, NSDate? limitDate) { + return _lib._objc_msgSend_498(_id, _lib._sel_runMode_beforeDate_1, mode, + limitDate?._id ?? ffi.nullptr); + } + + void configureAsServer() { + return _lib._objc_msgSend_1(_id, _lib._sel_configureAsServer1); + } + + void performInModes_block_(NSArray? modes, ObjCBlock16 block) { + return _lib._objc_msgSend_499(_id, _lib._sel_performInModes_block_1, + modes?._id ?? ffi.nullptr, block._id); + } + + void performBlock_(ObjCBlock16 block) { + return _lib._objc_msgSend_465(_id, _lib._sel_performBlock_1, block._id); + } + + void performSelector_target_argument_order_modes_( + ffi.Pointer aSelector, + NSObject target, + NSObject arg, + int order, + NSArray? modes) { + return _lib._objc_msgSend_500( + _id, + _lib._sel_performSelector_target_argument_order_modes_1, + aSelector, + target._id, + arg._id, + order, + modes?._id ?? ffi.nullptr); + } + + void cancelPerformSelector_target_argument_( + ffi.Pointer aSelector, NSObject target, NSObject arg) { + return _lib._objc_msgSend_466( + _id, + _lib._sel_cancelPerformSelector_target_argument_1, + aSelector, + target._id, + arg._id); + } + + void cancelPerformSelectorsWithTarget_(NSObject target) { + return _lib._objc_msgSend_15( + _id, _lib._sel_cancelPerformSelectorsWithTarget_1, target._id); + } + + static NSRunLoop new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSRunLoop1, _lib._sel_new1); + return NSRunLoop._(_ret, _lib, retain: false, release: true); + } + + static NSRunLoop alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSRunLoop1, _lib._sel_alloc1); + return NSRunLoop._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSRunLoop1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSRunLoop1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSRunLoop1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSRunLoop1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSRunLoop1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSRunLoop1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSRunLoop1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSRunLoop1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSRunLoop1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSRunLoopMode = ffi.Pointer; +typedef CFRunLoopRef = ffi.Pointer<__CFRunLoop>; + +class __CFRunLoop extends ffi.Opaque {} + +class NSTimer extends NSObject { + NSTimer._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSTimer] that points to the same underlying object as [other]. + static NSTimer castFrom(T other) { + return NSTimer._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSTimer] that wraps the given raw object pointer. + static NSTimer castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSTimer._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSTimer]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSTimer1); + } + + static NSTimer timerWithTimeInterval_invocation_repeats_( + SwiftLibrary _lib, double ti, NSInvocation? invocation, bool yesOrNo) { + final _ret = _lib._objc_msgSend_488( + _lib._class_NSTimer1, + _lib._sel_timerWithTimeInterval_invocation_repeats_1, + ti, + invocation?._id ?? ffi.nullptr, + yesOrNo); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + static NSTimer scheduledTimerWithTimeInterval_invocation_repeats_( + SwiftLibrary _lib, double ti, NSInvocation? invocation, bool yesOrNo) { + final _ret = _lib._objc_msgSend_488( + _lib._class_NSTimer1, + _lib._sel_scheduledTimerWithTimeInterval_invocation_repeats_1, + ti, + invocation?._id ?? ffi.nullptr, + yesOrNo); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + static NSTimer timerWithTimeInterval_target_selector_userInfo_repeats_( + SwiftLibrary _lib, + double ti, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject userInfo, + bool yesOrNo) { + final _ret = _lib._objc_msgSend_489( + _lib._class_NSTimer1, + _lib._sel_timerWithTimeInterval_target_selector_userInfo_repeats_1, + ti, + aTarget._id, + aSelector, + userInfo._id, + yesOrNo); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + static NSTimer + scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_( + SwiftLibrary _lib, + double ti, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject userInfo, + bool yesOrNo) { + final _ret = _lib._objc_msgSend_489( + _lib._class_NSTimer1, + _lib._sel_scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_1, + ti, + aTarget._id, + aSelector, + userInfo._id, + yesOrNo); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + static NSTimer timerWithTimeInterval_repeats_block_( + SwiftLibrary _lib, double interval, bool repeats, ObjCBlock17 block) { + final _ret = _lib._objc_msgSend_490( + _lib._class_NSTimer1, + _lib._sel_timerWithTimeInterval_repeats_block_1, + interval, + repeats, + block._id); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + static NSTimer scheduledTimerWithTimeInterval_repeats_block_( + SwiftLibrary _lib, double interval, bool repeats, ObjCBlock17 block) { + final _ret = _lib._objc_msgSend_490( + _lib._class_NSTimer1, + _lib._sel_scheduledTimerWithTimeInterval_repeats_block_1, + interval, + repeats, + block._id); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + NSTimer initWithFireDate_interval_repeats_block_( + NSDate? date, double interval, bool repeats, ObjCBlock17 block) { + final _ret = _lib._objc_msgSend_491( + _id, + _lib._sel_initWithFireDate_interval_repeats_block_1, + date?._id ?? ffi.nullptr, + interval, + repeats, + block._id); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + NSTimer initWithFireDate_interval_target_selector_userInfo_repeats_( + NSDate? date, + double ti, + NSObject t, + ffi.Pointer s, + NSObject ui, + bool rep) { + final _ret = _lib._objc_msgSend_492( + _id, + _lib._sel_initWithFireDate_interval_target_selector_userInfo_repeats_1, + date?._id ?? ffi.nullptr, + ti, + t._id, + s, + ui._id, + rep); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + void fire() { + return _lib._objc_msgSend_1(_id, _lib._sel_fire1); + } + + NSDate? get fireDate { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_fireDate1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + set fireDate(NSDate? value) { + _lib._objc_msgSend_493( + _id, _lib._sel_setFireDate_1, value?._id ?? ffi.nullptr); + } + + double get timeInterval { + return _lib._objc_msgSend_149(_id, _lib._sel_timeInterval1); + } + + double get tolerance { + return _lib._objc_msgSend_149(_id, _lib._sel_tolerance1); + } + + set tolerance(double value) { + _lib._objc_msgSend_474(_id, _lib._sel_setTolerance_1, value); + } + + void invalidate() { + return _lib._objc_msgSend_1(_id, _lib._sel_invalidate1); + } + + bool get valid { + return _lib._objc_msgSend_12(_id, _lib._sel_isValid1); + } + + NSObject get userInfo { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_userInfo1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSTimer new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSTimer1, _lib._sel_new1); + return NSTimer._(_ret, _lib, retain: false, release: true); + } + + static NSTimer alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSTimer1, _lib._sel_alloc1); + return NSTimer._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSTimer1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSTimer1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSTimer1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSTimer1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSTimer1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSTimer1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSTimer1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSTimer1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSTimer1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock17_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock17_closureRegistry = {}; +int _ObjCBlock17_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock17_registerClosure(Function fn) { + final id = ++_ObjCBlock17_closureRegistryIndex; + _ObjCBlock17_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock17_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return _ObjCBlock17_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock17 extends _ObjCBlockBase { + ObjCBlock17._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock17.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock17_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock17.fromFunction( + SwiftLibrary lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock17_closureTrampoline) + .cast(), + _ObjCBlock17_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_id, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +class NSConnection extends NSObject { + NSConnection._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSConnection] that points to the same underlying object as [other]. + static NSConnection castFrom(T other) { + return NSConnection._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSConnection] that wraps the given raw object pointer. + static NSConnection castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSConnection._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSConnection]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSConnection1); + } + + NSDictionary? get statistics { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_statistics1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSArray allConnections(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSConnection1, _lib._sel_allConnections1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSConnection defaultConnection(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_504( + _lib._class_NSConnection1, _lib._sel_defaultConnection1); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSConnection connectionWithRegisteredName_host_( + SwiftLibrary _lib, NSString? name, NSString? hostName) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSConnection1, + _lib._sel_connectionWithRegisteredName_host_1, + name?._id ?? ffi.nullptr, + hostName?._id ?? ffi.nullptr); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSConnection connectionWithRegisteredName_host_usingNameServer_( + SwiftLibrary _lib, + NSString? name, + NSString? hostName, + NSPortNameServer? server) { + final _ret = _lib._objc_msgSend_509( + _lib._class_NSConnection1, + _lib._sel_connectionWithRegisteredName_host_usingNameServer_1, + name?._id ?? ffi.nullptr, + hostName?._id ?? ffi.nullptr, + server?._id ?? ffi.nullptr); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSDistantObject rootProxyForConnectionWithRegisteredName_host_( + SwiftLibrary _lib, NSString? name, NSString? hostName) { + final _ret = _lib._objc_msgSend_512( + _lib._class_NSConnection1, + _lib._sel_rootProxyForConnectionWithRegisteredName_host_1, + name?._id ?? ffi.nullptr, + hostName?._id ?? ffi.nullptr); + return NSDistantObject._(_ret, _lib, retain: true, release: true); + } + + static NSDistantObject + rootProxyForConnectionWithRegisteredName_host_usingNameServer_( + SwiftLibrary _lib, + NSString? name, + NSString? hostName, + NSPortNameServer? server) { + final _ret = _lib._objc_msgSend_513( + _lib._class_NSConnection1, + _lib._sel_rootProxyForConnectionWithRegisteredName_host_usingNameServer_1, + name?._id ?? ffi.nullptr, + hostName?._id ?? ffi.nullptr, + server?._id ?? ffi.nullptr); + return NSDistantObject._(_ret, _lib, retain: true, release: true); + } + + static NSConnection serviceConnectionWithName_rootObject_usingNameServer_( + SwiftLibrary _lib, + NSString? name, + NSObject root, + NSPortNameServer? server) { + final _ret = _lib._objc_msgSend_514( + _lib._class_NSConnection1, + _lib._sel_serviceConnectionWithName_rootObject_usingNameServer_1, + name?._id ?? ffi.nullptr, + root._id, + server?._id ?? ffi.nullptr); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSConnection serviceConnectionWithName_rootObject_( + SwiftLibrary _lib, NSString? name, NSObject root) { + final _ret = _lib._objc_msgSend_157( + _lib._class_NSConnection1, + _lib._sel_serviceConnectionWithName_rootObject_1, + name?._id ?? ffi.nullptr, + root._id); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + double get requestTimeout { + return _lib._objc_msgSend_149(_id, _lib._sel_requestTimeout1); + } + + set requestTimeout(double value) { + _lib._objc_msgSend_474(_id, _lib._sel_setRequestTimeout_1, value); + } + + double get replyTimeout { + return _lib._objc_msgSend_149(_id, _lib._sel_replyTimeout1); + } + + set replyTimeout(double value) { + _lib._objc_msgSend_474(_id, _lib._sel_setReplyTimeout_1, value); + } + + NSObject get rootObject { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_rootObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set rootObject(NSObject value) { + _lib._objc_msgSend_368(_id, _lib._sel_setRootObject_1, value._id); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + _lib._objc_msgSend_368( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + bool get independentConversationQueueing { + return _lib._objc_msgSend_12( + _id, _lib._sel_independentConversationQueueing1); + } + + set independentConversationQueueing(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setIndependentConversationQueueing_1, value); + } + + bool get valid { + return _lib._objc_msgSend_12(_id, _lib._sel_isValid1); + } + + NSDistantObject? get rootProxy { + final _ret = _lib._objc_msgSend_515(_id, _lib._sel_rootProxy1); + return _ret.address == 0 + ? null + : NSDistantObject._(_ret, _lib, retain: true, release: true); + } + + void invalidate() { + return _lib._objc_msgSend_1(_id, _lib._sel_invalidate1); + } + + void addRequestMode_(NSString? rmode) { + return _lib._objc_msgSend_186( + _id, _lib._sel_addRequestMode_1, rmode?._id ?? ffi.nullptr); + } + + void removeRequestMode_(NSString? rmode) { + return _lib._objc_msgSend_186( + _id, _lib._sel_removeRequestMode_1, rmode?._id ?? ffi.nullptr); + } + + NSArray? get requestModes { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_requestModes1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + bool registerName_(NSString? name) { + return _lib._objc_msgSend_59( + _id, _lib._sel_registerName_1, name?._id ?? ffi.nullptr); + } + + bool registerName_withNameServer_(NSString? name, NSPortNameServer? server) { + return _lib._objc_msgSend_516(_id, _lib._sel_registerName_withNameServer_1, + name?._id ?? ffi.nullptr, server?._id ?? ffi.nullptr); + } + + static NSConnection connectionWithReceivePort_sendPort_( + SwiftLibrary _lib, NSPort? receivePort, NSPort? sendPort) { + final _ret = _lib._objc_msgSend_517( + _lib._class_NSConnection1, + _lib._sel_connectionWithReceivePort_sendPort_1, + receivePort?._id ?? ffi.nullptr, + sendPort?._id ?? ffi.nullptr); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSObject currentConversation(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSConnection1, _lib._sel_currentConversation1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSConnection initWithReceivePort_sendPort_( + NSPort? receivePort, NSPort? sendPort) { + final _ret = _lib._objc_msgSend_517( + _id, + _lib._sel_initWithReceivePort_sendPort_1, + receivePort?._id ?? ffi.nullptr, + sendPort?._id ?? ffi.nullptr); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + NSPort? get sendPort { + final _ret = _lib._objc_msgSend_485(_id, _lib._sel_sendPort1); + return _ret.address == 0 + ? null + : NSPort._(_ret, _lib, retain: true, release: true); + } + + NSPort? get receivePort { + final _ret = _lib._objc_msgSend_485(_id, _lib._sel_receivePort1); + return _ret.address == 0 + ? null + : NSPort._(_ret, _lib, retain: true, release: true); + } + + void enableMultipleThreads() { + return _lib._objc_msgSend_1(_id, _lib._sel_enableMultipleThreads1); + } + + bool get multipleThreadsEnabled { + return _lib._objc_msgSend_12(_id, _lib._sel_multipleThreadsEnabled1); + } + + void addRunLoop_(NSRunLoop? runloop) { + return _lib._objc_msgSend_518( + _id, _lib._sel_addRunLoop_1, runloop?._id ?? ffi.nullptr); + } + + void removeRunLoop_(NSRunLoop? runloop) { + return _lib._objc_msgSend_518( + _id, _lib._sel_removeRunLoop_1, runloop?._id ?? ffi.nullptr); + } + + void runInNewThread() { + return _lib._objc_msgSend_1(_id, _lib._sel_runInNewThread1); + } + + NSArray? get remoteObjects { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_remoteObjects1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get localObjects { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_localObjects1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + void dispatchWithComponents_(NSArray? components) { + return _lib._objc_msgSend_412(_id, _lib._sel_dispatchWithComponents_1, + components?._id ?? ffi.nullptr); + } + + static NSConnection new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSConnection1, _lib._sel_new1); + return NSConnection._(_ret, _lib, retain: false, release: true); + } + + static NSConnection alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSConnection1, _lib._sel_alloc1); + return NSConnection._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSConnection1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSConnection1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSConnection1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSConnection1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSConnection1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSConnection1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSConnection1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSConnection1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSConnection1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSPortNameServer extends NSObject { + NSPortNameServer._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSPortNameServer] that points to the same underlying object as [other]. + static NSPortNameServer castFrom(T other) { + return NSPortNameServer._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSPortNameServer] that wraps the given raw object pointer. + static NSPortNameServer castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSPortNameServer._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSPortNameServer]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSPortNameServer1); + } + + static NSPortNameServer systemDefaultPortNameServer(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_505( + _lib._class_NSPortNameServer1, _lib._sel_systemDefaultPortNameServer1); + return NSPortNameServer._(_ret, _lib, retain: true, release: true); + } + + NSPort portForName_(NSString? name) { + final _ret = _lib._objc_msgSend_506( + _id, _lib._sel_portForName_1, name?._id ?? ffi.nullptr); + return NSPort._(_ret, _lib, retain: true, release: true); + } + + NSPort portForName_host_(NSString? name, NSString? host) { + final _ret = _lib._objc_msgSend_507(_id, _lib._sel_portForName_host_1, + name?._id ?? ffi.nullptr, host?._id ?? ffi.nullptr); + return NSPort._(_ret, _lib, retain: true, release: true); + } + + bool registerPort_name_(NSPort? port, NSString? name) { + return _lib._objc_msgSend_508(_id, _lib._sel_registerPort_name_1, + port?._id ?? ffi.nullptr, name?._id ?? ffi.nullptr); + } + + bool removePortForName_(NSString? name) { + return _lib._objc_msgSend_59( + _id, _lib._sel_removePortForName_1, name?._id ?? ffi.nullptr); + } + + static NSPortNameServer new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPortNameServer1, _lib._sel_new1); + return NSPortNameServer._(_ret, _lib, retain: false, release: true); + } + + static NSPortNameServer alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPortNameServer1, _lib._sel_alloc1); + return NSPortNameServer._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSPortNameServer1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSPortNameServer1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSPortNameServer1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPortNameServer1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSPortNameServer1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSPortNameServer1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSPortNameServer1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSPortNameServer1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPortNameServer1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSDistantObject extends NSProxy { + NSDistantObject._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSDistantObject] that points to the same underlying object as [other]. + static NSDistantObject castFrom(T other) { + return NSDistantObject._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSDistantObject] that wraps the given raw object pointer. + static NSDistantObject castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSDistantObject._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSDistantObject]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSDistantObject1); + } + + static NSObject proxyWithTarget_connection_( + SwiftLibrary _lib, NSObject target, NSConnection? connection) { + final _ret = _lib._objc_msgSend_510( + _lib._class_NSDistantObject1, + _lib._sel_proxyWithTarget_connection_1, + target._id, + connection?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSDistantObject initWithTarget_connection_( + NSObject target, NSConnection? connection) { + final _ret = _lib._objc_msgSend_510( + _id, + _lib._sel_initWithTarget_connection_1, + target._id, + connection?._id ?? ffi.nullptr); + return NSDistantObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject proxyWithLocal_connection_( + SwiftLibrary _lib, NSObject target, NSConnection? connection) { + final _ret = _lib._objc_msgSend_510( + _lib._class_NSDistantObject1, + _lib._sel_proxyWithLocal_connection_1, + target._id, + connection?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSDistantObject initWithLocal_connection_( + NSObject target, NSConnection? connection) { + final _ret = _lib._objc_msgSend_510( + _id, + _lib._sel_initWithLocal_connection_1, + target._id, + connection?._id ?? ffi.nullptr); + return NSDistantObject._(_ret, _lib, retain: true, release: true); + } + + NSDistantObject initWithCoder_(NSCoder? inCoder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, inCoder?._id ?? ffi.nullptr); + return NSDistantObject._(_ret, _lib, retain: true, release: true); + } + + void setProtocolForProxy_(Protocol? proto) { + return _lib._objc_msgSend_511( + _id, _lib._sel_setProtocolForProxy_1, proto?._id ?? ffi.nullptr); + } + + NSConnection? get connectionForProxy { + final _ret = _lib._objc_msgSend_504(_id, _lib._sel_connectionForProxy1); + return _ret.address == 0 + ? null + : NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSObject alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDistantObject1, _lib._sel_alloc1); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static bool respondsToSelector_( + SwiftLibrary _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_4(_lib._class_NSDistantObject1, + _lib._sel_respondsToSelector_1, aSelector); + } +} + +class NSProxy extends _ObjCWrapper { + NSProxy._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSProxy] that points to the same underlying object as [other]. + static NSProxy castFrom(T other) { + return NSProxy._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSProxy] that wraps the given raw object pointer. + static NSProxy castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSProxy._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSProxy]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSProxy1); + } + + static NSObject alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSProxy1, _lib._sel_alloc1); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static NSObject allocWithZone_(SwiftLibrary _lib, ffi.Pointer zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSProxy1, _lib._sel_allocWithZone_1, zone); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static NSObject class1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSProxy1, _lib._sel_class1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void forwardInvocation_(NSInvocation? invocation) { + return _lib._objc_msgSend_372( + _id, _lib._sel_forwardInvocation_1, invocation?._id ?? ffi.nullptr); + } + + NSMethodSignature methodSignatureForSelector_(ffi.Pointer sel) { + final _ret = _lib._objc_msgSend_373( + _id, _lib._sel_methodSignatureForSelector_1, sel); + return NSMethodSignature._(_ret, _lib, retain: true, release: true); + } + + void dealloc() { + return _lib._objc_msgSend_1(_id, _lib._sel_dealloc1); + } + + void finalize() { + return _lib._objc_msgSend_1(_id, _lib._sel_finalize1); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get debugDescription { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_debugDescription1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + static bool respondsToSelector_( + SwiftLibrary _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_4( + _lib._class_NSProxy1, _lib._sel_respondsToSelector_1, aSelector); + } + + bool allowsWeakReference() { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsWeakReference1); + } + + bool retainWeakReference() { + return _lib._objc_msgSend_12(_id, _lib._sel_retainWeakReference1); + } +} + +class NSClassDescription extends NSObject { + NSClassDescription._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSClassDescription] that points to the same underlying object as [other]. + static NSClassDescription castFrom(T other) { + return NSClassDescription._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSClassDescription] that wraps the given raw object pointer. + static NSClassDescription castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSClassDescription._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSClassDescription]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSClassDescription1); + } + + static void registerClassDescription_forClass_( + SwiftLibrary _lib, NSClassDescription? description, NSObject aClass) { + return _lib._objc_msgSend_523( + _lib._class_NSClassDescription1, + _lib._sel_registerClassDescription_forClass_1, + description?._id ?? ffi.nullptr, + aClass._id); + } + + static void invalidateClassDescriptionCache(SwiftLibrary _lib) { + return _lib._objc_msgSend_1(_lib._class_NSClassDescription1, + _lib._sel_invalidateClassDescriptionCache1); + } + + static NSClassDescription classDescriptionForClass_( + SwiftLibrary _lib, NSObject aClass) { + final _ret = _lib._objc_msgSend_524(_lib._class_NSClassDescription1, + _lib._sel_classDescriptionForClass_1, aClass._id); + return NSClassDescription._(_ret, _lib, retain: true, release: true); + } + + @override + NSArray? get attributeKeys { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_attributeKeys1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + @override + NSArray? get toOneRelationshipKeys { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_toOneRelationshipKeys1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + @override + NSArray? get toManyRelationshipKeys { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_toManyRelationshipKeys1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + @override + NSString inverseForRelationshipKey_(NSString? relationshipKey) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_inverseForRelationshipKey_1, + relationshipKey?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSClassDescription new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSClassDescription1, _lib._sel_new1); + return NSClassDescription._(_ret, _lib, retain: false, release: true); + } + + static NSClassDescription alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSClassDescription1, _lib._sel_alloc1); + return NSClassDescription._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSClassDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSClassDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSClassDescription1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSClassDescription1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSClassDescription1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSClassDescription1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSClassDescription1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSClassDescription1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSClassDescription1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSScriptObjectSpecifier extends NSObject { + NSScriptObjectSpecifier._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSScriptObjectSpecifier] that points to the same underlying object as [other]. + static NSScriptObjectSpecifier castFrom(T other) { + return NSScriptObjectSpecifier._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSScriptObjectSpecifier] that wraps the given raw object pointer. + static NSScriptObjectSpecifier castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSScriptObjectSpecifier._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSScriptObjectSpecifier]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSScriptObjectSpecifier1); + } + + static NSScriptObjectSpecifier objectSpecifierWithDescriptor_( + SwiftLibrary _lib, NSAppleEventDescriptor? descriptor) { + final _ret = _lib._objc_msgSend_548( + _lib._class_NSScriptObjectSpecifier1, + _lib._sel_objectSpecifierWithDescriptor_1, + descriptor?._id ?? ffi.nullptr); + return NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + NSScriptObjectSpecifier initWithContainerSpecifier_key_( + NSScriptObjectSpecifier? container, NSString? property) { + final _ret = _lib._objc_msgSend_549( + _id, + _lib._sel_initWithContainerSpecifier_key_1, + container?._id ?? ffi.nullptr, + property?._id ?? ffi.nullptr); + return NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + NSScriptObjectSpecifier + initWithContainerClassDescription_containerSpecifier_key_( + NSScriptClassDescription? classDesc, + NSScriptObjectSpecifier? container, + NSString? property) { + final _ret = _lib._objc_msgSend_566( + _id, + _lib._sel_initWithContainerClassDescription_containerSpecifier_key_1, + classDesc?._id ?? ffi.nullptr, + container?._id ?? ffi.nullptr, + property?._id ?? ffi.nullptr); + return NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + NSScriptObjectSpecifier initWithCoder_(NSCoder? inCoder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, inCoder?._id ?? ffi.nullptr); + return NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + NSScriptObjectSpecifier? get childSpecifier { + final _ret = _lib._objc_msgSend_556(_id, _lib._sel_childSpecifier1); + return _ret.address == 0 + ? null + : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + set childSpecifier(NSScriptObjectSpecifier? value) { + _lib._objc_msgSend_557( + _id, _lib._sel_setChildSpecifier_1, value?._id ?? ffi.nullptr); + } + + NSScriptObjectSpecifier? get containerSpecifier { + final _ret = _lib._objc_msgSend_556(_id, _lib._sel_containerSpecifier1); + return _ret.address == 0 + ? null + : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + set containerSpecifier(NSScriptObjectSpecifier? value) { + _lib._objc_msgSend_557( + _id, _lib._sel_setContainerSpecifier_1, value?._id ?? ffi.nullptr); + } + + bool get containerIsObjectBeingTested { + return _lib._objc_msgSend_12(_id, _lib._sel_containerIsObjectBeingTested1); + } + + set containerIsObjectBeingTested(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setContainerIsObjectBeingTested_1, value); + } + + bool get containerIsRangeContainerObject { + return _lib._objc_msgSend_12( + _id, _lib._sel_containerIsRangeContainerObject1); + } + + set containerIsRangeContainerObject(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setContainerIsRangeContainerObject_1, value); + } + + NSString? get key { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_key1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set key(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setKey_1, value?._id ?? ffi.nullptr); + } + + NSScriptClassDescription? get containerClassDescription { + final _ret = + _lib._objc_msgSend_552(_id, _lib._sel_containerClassDescription1); + return _ret.address == 0 + ? null + : NSScriptClassDescription._(_ret, _lib, retain: true, release: true); + } + + set containerClassDescription(NSScriptClassDescription? value) { + _lib._objc_msgSend_567(_id, _lib._sel_setContainerClassDescription_1, + value?._id ?? ffi.nullptr); + } + + NSScriptClassDescription? get keyClassDescription { + final _ret = _lib._objc_msgSend_552(_id, _lib._sel_keyClassDescription1); + return _ret.address == 0 + ? null + : NSScriptClassDescription._(_ret, _lib, retain: true, release: true); + } + + ffi.Pointer indicesOfObjectsByEvaluatingWithContainer_count_( + NSObject container, ffi.Pointer count) { + return _lib._objc_msgSend_568( + _id, + _lib._sel_indicesOfObjectsByEvaluatingWithContainer_count_1, + container._id, + count); + } + + NSObject objectsByEvaluatingWithContainers_(NSObject containers) { + final _ret = _lib._objc_msgSend_16( + _id, _lib._sel_objectsByEvaluatingWithContainers_1, containers._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject get objectsByEvaluatingSpecifier { + final _ret = + _lib._objc_msgSend_2(_id, _lib._sel_objectsByEvaluatingSpecifier1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + int get evaluationErrorNumber { + return _lib._objc_msgSend_78(_id, _lib._sel_evaluationErrorNumber1); + } + + set evaluationErrorNumber(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setEvaluationErrorNumber_1, value); + } + + NSScriptObjectSpecifier? get evaluationErrorSpecifier { + final _ret = + _lib._objc_msgSend_556(_id, _lib._sel_evaluationErrorSpecifier1); + return _ret.address == 0 + ? null + : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor? get descriptor { + final _ret = _lib._objc_msgSend_526(_id, _lib._sel_descriptor1); + return _ret.address == 0 + ? null + : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSScriptObjectSpecifier new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScriptObjectSpecifier1, _lib._sel_new1); + return NSScriptObjectSpecifier._(_ret, _lib, retain: false, release: true); + } + + static NSScriptObjectSpecifier alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScriptObjectSpecifier1, _lib._sel_alloc1); + return NSScriptObjectSpecifier._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSScriptObjectSpecifier1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSScriptObjectSpecifier1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSScriptObjectSpecifier1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSScriptObjectSpecifier1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSScriptObjectSpecifier1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSScriptObjectSpecifier1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSScriptObjectSpecifier1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSScriptObjectSpecifier1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSScriptObjectSpecifier1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSAppleEventDescriptor extends NSObject { + NSAppleEventDescriptor._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSAppleEventDescriptor] that points to the same underlying object as [other]. + static NSAppleEventDescriptor castFrom(T other) { + return NSAppleEventDescriptor._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSAppleEventDescriptor] that wraps the given raw object pointer. + static NSAppleEventDescriptor castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSAppleEventDescriptor._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSAppleEventDescriptor]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSAppleEventDescriptor1); + } + + static NSAppleEventDescriptor nullDescriptor(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_526( + _lib._class_NSAppleEventDescriptor1, _lib._sel_nullDescriptor1); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithDescriptorType_bytes_length_( + SwiftLibrary _lib, + int descriptorType, + ffi.Pointer bytes, + int byteCount) { + final _ret = _lib._objc_msgSend_527( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithDescriptorType_bytes_length_1, + descriptorType, + bytes, + byteCount); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithDescriptorType_data_( + SwiftLibrary _lib, int descriptorType, NSData? data) { + final _ret = _lib._objc_msgSend_528( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithDescriptorType_data_1, + descriptorType, + data?._id ?? ffi.nullptr); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithBoolean_( + SwiftLibrary _lib, int boolean) { + final _ret = _lib._objc_msgSend_529(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithBoolean_1, boolean); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithEnumCode_( + SwiftLibrary _lib, int enumerator) { + final _ret = _lib._objc_msgSend_530(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithEnumCode_1, enumerator); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithInt32_( + SwiftLibrary _lib, int signedInt) { + final _ret = _lib._objc_msgSend_531(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithInt32_1, signedInt); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithDouble_( + SwiftLibrary _lib, double doubleValue) { + final _ret = _lib._objc_msgSend_532(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithDouble_1, doubleValue); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithTypeCode_( + SwiftLibrary _lib, int typeCode) { + final _ret = _lib._objc_msgSend_530(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithTypeCode_1, typeCode); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithString_( + SwiftLibrary _lib, NSString? string) { + final _ret = _lib._objc_msgSend_533(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithString_1, string?._id ?? ffi.nullptr); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithDate_( + SwiftLibrary _lib, NSDate? date) { + final _ret = _lib._objc_msgSend_534(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithDate_1, date?._id ?? ffi.nullptr); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithFileURL_( + SwiftLibrary _lib, NSURL? fileURL) { + final _ret = _lib._objc_msgSend_535(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithFileURL_1, fileURL?._id ?? ffi.nullptr); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor + appleEventWithEventClass_eventID_targetDescriptor_returnID_transactionID_( + SwiftLibrary _lib, + int eventClass, + int eventID, + NSAppleEventDescriptor? targetDescriptor, + int returnID, + int transactionID) { + final _ret = _lib._objc_msgSend_536( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_appleEventWithEventClass_eventID_targetDescriptor_returnID_transactionID_1, + eventClass, + eventID, + targetDescriptor?._id ?? ffi.nullptr, + returnID, + transactionID); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor listDescriptor(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_526( + _lib._class_NSAppleEventDescriptor1, _lib._sel_listDescriptor1); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor recordDescriptor(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_526( + _lib._class_NSAppleEventDescriptor1, _lib._sel_recordDescriptor1); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor currentProcessDescriptor(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_526(_lib._class_NSAppleEventDescriptor1, + _lib._sel_currentProcessDescriptor1); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithProcessIdentifier_( + SwiftLibrary _lib, int processIdentifier) { + final _ret = _lib._objc_msgSend_531(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithProcessIdentifier_1, processIdentifier); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithBundleIdentifier_( + SwiftLibrary _lib, NSString? bundleIdentifier) { + final _ret = _lib._objc_msgSend_533( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithBundleIdentifier_1, + bundleIdentifier?._id ?? ffi.nullptr); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithApplicationURL_( + SwiftLibrary _lib, NSURL? applicationURL) { + final _ret = _lib._objc_msgSend_535( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithApplicationURL_1, + applicationURL?._id ?? ffi.nullptr); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor initWithAEDescNoCopy_(ffi.Pointer aeDesc) { + final _ret = + _lib._objc_msgSend_537(_id, _lib._sel_initWithAEDescNoCopy_1, aeDesc); + return NSAppleEventDescriptor._(_ret, _lib, retain: false, release: true); + } + + NSAppleEventDescriptor initWithDescriptorType_bytes_length_( + int descriptorType, ffi.Pointer bytes, int byteCount) { + final _ret = _lib._objc_msgSend_538( + _id, + _lib._sel_initWithDescriptorType_bytes_length_1, + descriptorType, + bytes, + byteCount); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor initWithDescriptorType_data_( + int descriptorType, NSData? data) { + final _ret = _lib._objc_msgSend_539( + _id, + _lib._sel_initWithDescriptorType_data_1, + descriptorType, + data?._id ?? ffi.nullptr); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor + initWithEventClass_eventID_targetDescriptor_returnID_transactionID_( + int eventClass, + int eventID, + NSAppleEventDescriptor? targetDescriptor, + int returnID, + int transactionID) { + final _ret = _lib._objc_msgSend_540( + _id, + _lib._sel_initWithEventClass_eventID_targetDescriptor_returnID_transactionID_1, + eventClass, + eventID, + targetDescriptor?._id ?? ffi.nullptr, + returnID, + transactionID); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor initListDescriptor() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_initListDescriptor1); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor initRecordDescriptor() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_initRecordDescriptor1); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + ffi.Pointer get aeDesc { + return _lib._objc_msgSend_541(_id, _lib._sel_aeDesc1); + } + + int get descriptorType { + return _lib._objc_msgSend_191(_id, _lib._sel_descriptorType1); + } + + NSData? get data { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_data1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + int get booleanValue { + return _lib._objc_msgSend_210(_id, _lib._sel_booleanValue1); + } + + int get enumCodeValue { + return _lib._objc_msgSend_191(_id, _lib._sel_enumCodeValue1); + } + + int get int32Value { + return _lib._objc_msgSend_213(_id, _lib._sel_int32Value1); + } + + double get doubleValue { + return _lib._objc_msgSend_149(_id, _lib._sel_doubleValue1); + } + + int get typeCodeValue { + return _lib._objc_msgSend_191(_id, _lib._sel_typeCodeValue1); + } + + NSString? get stringValue { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_stringValue1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSDate? get dateValue { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_dateValue1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + NSURL? get fileURLValue { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_fileURLValue1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + int get eventClass { + return _lib._objc_msgSend_191(_id, _lib._sel_eventClass1); + } + + int get eventID { + return _lib._objc_msgSend_191(_id, _lib._sel_eventID1); + } + + int get returnID { + return _lib._objc_msgSend_211(_id, _lib._sel_returnID1); + } + + int get transactionID { + return _lib._objc_msgSend_213(_id, _lib._sel_transactionID1); + } + + void setParamDescriptor_forKeyword_( + NSAppleEventDescriptor? descriptor, int keyword) { + return _lib._objc_msgSend_542( + _id, + _lib._sel_setParamDescriptor_forKeyword_1, + descriptor?._id ?? ffi.nullptr, + keyword); + } + + NSAppleEventDescriptor paramDescriptorForKeyword_(int keyword) { + final _ret = _lib._objc_msgSend_530( + _id, _lib._sel_paramDescriptorForKeyword_1, keyword); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + void removeParamDescriptorWithKeyword_(int keyword) { + return _lib._objc_msgSend_543( + _id, _lib._sel_removeParamDescriptorWithKeyword_1, keyword); + } + + void setAttributeDescriptor_forKeyword_( + NSAppleEventDescriptor? descriptor, int keyword) { + return _lib._objc_msgSend_542( + _id, + _lib._sel_setAttributeDescriptor_forKeyword_1, + descriptor?._id ?? ffi.nullptr, + keyword); + } + + NSAppleEventDescriptor attributeDescriptorForKeyword_(int keyword) { + final _ret = _lib._objc_msgSend_530( + _id, _lib._sel_attributeDescriptorForKeyword_1, keyword); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor sendEventWithOptions_timeout_error_(int sendOptions, + double timeoutInSeconds, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_544( + _id, + _lib._sel_sendEventWithOptions_timeout_error_1, + sendOptions, + timeoutInSeconds, + error); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + bool get isRecordDescriptor { + return _lib._objc_msgSend_12(_id, _lib._sel_isRecordDescriptor1); + } + + int get numberOfItems { + return _lib._objc_msgSend_78(_id, _lib._sel_numberOfItems1); + } + + void insertDescriptor_atIndex_( + NSAppleEventDescriptor? descriptor, int index) { + return _lib._objc_msgSend_545(_id, _lib._sel_insertDescriptor_atIndex_1, + descriptor?._id ?? ffi.nullptr, index); + } + + NSAppleEventDescriptor descriptorAtIndex_(int index) { + final _ret = + _lib._objc_msgSend_546(_id, _lib._sel_descriptorAtIndex_1, index); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + void removeDescriptorAtIndex_(int index) { + return _lib._objc_msgSend_374( + _id, _lib._sel_removeDescriptorAtIndex_1, index); + } + + void setDescriptor_forKeyword_( + NSAppleEventDescriptor? descriptor, int keyword) { + return _lib._objc_msgSend_542(_id, _lib._sel_setDescriptor_forKeyword_1, + descriptor?._id ?? ffi.nullptr, keyword); + } + + NSAppleEventDescriptor descriptorForKeyword_(int keyword) { + final _ret = + _lib._objc_msgSend_530(_id, _lib._sel_descriptorForKeyword_1, keyword); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + void removeDescriptorWithKeyword_(int keyword) { + return _lib._objc_msgSend_543( + _id, _lib._sel_removeDescriptorWithKeyword_1, keyword); + } + + int keywordForDescriptorAtIndex_(int index) { + return _lib._objc_msgSend_547( + _id, _lib._sel_keywordForDescriptorAtIndex_1, index); + } + + NSAppleEventDescriptor coerceToDescriptorType_(int descriptorType) { + final _ret = _lib._objc_msgSend_530( + _id, _lib._sel_coerceToDescriptorType_1, descriptorType); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSAppleEventDescriptor1, _lib._sel_new1); + return NSAppleEventDescriptor._(_ret, _lib, retain: false, release: true); + } + + static NSAppleEventDescriptor alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSAppleEventDescriptor1, _lib._sel_alloc1); + return NSAppleEventDescriptor._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSAppleEventDescriptor1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSAppleEventDescriptor1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSAppleEventDescriptor1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSAppleEventDescriptor1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSAppleEventDescriptor1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef DescType = ResType; +typedef ResType = FourCharCode; +typedef Boolean = ffi.UnsignedChar; +typedef SInt32 = ffi.Int; +typedef AEEventClass = FourCharCode; +typedef AEEventID = FourCharCode; +typedef AEReturnID = SInt16; +typedef SInt16 = ffi.Short; +typedef AETransactionID = SInt32; +typedef pid_t = __darwin_pid_t; +typedef __darwin_pid_t = __int32_t; +typedef __int32_t = ffi.Int; + +@ffi.Packed(2) +class AEDesc extends ffi.Struct { + @DescType() + external int descriptorType; + + external AEDataStorage dataHandle; +} + +typedef AEDataStorage = ffi.Pointer; +typedef AEDataStorageType = ffi.Pointer; + +class OpaqueAEDataStorageType extends ffi.Opaque {} + +typedef AEKeyword = FourCharCode; + +abstract class NSAppleEventSendOptions { + static const int NSAppleEventSendNoReply = 1; + static const int NSAppleEventSendQueueReply = 2; + static const int NSAppleEventSendWaitForReply = 3; + static const int NSAppleEventSendNeverInteract = 16; + static const int NSAppleEventSendCanInteract = 32; + static const int NSAppleEventSendAlwaysInteract = 48; + static const int NSAppleEventSendCanSwitchLayer = 64; + static const int NSAppleEventSendDontRecord = 4096; + static const int NSAppleEventSendDontExecute = 8192; + static const int NSAppleEventSendDontAnnotate = 65536; + static const int NSAppleEventSendDefaultOptions = 35; +} + +class NSScriptClassDescription extends NSClassDescription { + NSScriptClassDescription._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSScriptClassDescription] that points to the same underlying object as [other]. + static NSScriptClassDescription castFrom(T other) { + return NSScriptClassDescription._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSScriptClassDescription] that wraps the given raw object pointer. + static NSScriptClassDescription castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSScriptClassDescription._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSScriptClassDescription]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSScriptClassDescription1); + } + + static NSScriptClassDescription classDescriptionForClass_( + SwiftLibrary _lib, NSObject aClass) { + final _ret = _lib._objc_msgSend_550(_lib._class_NSScriptClassDescription1, + _lib._sel_classDescriptionForClass_1, aClass._id); + return NSScriptClassDescription._(_ret, _lib, retain: true, release: true); + } + + NSScriptClassDescription initWithSuiteName_className_dictionary_( + NSString? suiteName, + NSString? className, + NSDictionary? classDeclaration) { + final _ret = _lib._objc_msgSend_551( + _id, + _lib._sel_initWithSuiteName_className_dictionary_1, + suiteName?._id ?? ffi.nullptr, + className?._id ?? ffi.nullptr, + classDeclaration?._id ?? ffi.nullptr); + return NSScriptClassDescription._(_ret, _lib, retain: true, release: true); + } + + NSString? get suiteName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_suiteName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get className { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_className1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get implementationClassName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_implementationClassName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSScriptClassDescription? get superclassDescription { + final _ret = _lib._objc_msgSend_552(_id, _lib._sel_superclassDescription1); + return _ret.address == 0 + ? null + : NSScriptClassDescription._(_ret, _lib, retain: true, release: true); + } + + int get appleEventCode { + return _lib._objc_msgSend_191(_id, _lib._sel_appleEventCode1); + } + + bool matchesAppleEventCode_(int appleEventCode) { + return _lib._objc_msgSend_173( + _id, _lib._sel_matchesAppleEventCode_1, appleEventCode); + } + + bool supportsCommand_(NSScriptCommandDescription? commandDescription) { + return _lib._objc_msgSend_562(_id, _lib._sel_supportsCommand_1, + commandDescription?._id ?? ffi.nullptr); + } + + ffi.Pointer selectorForCommand_( + NSScriptCommandDescription? commandDescription) { + return _lib._objc_msgSend_563(_id, _lib._sel_selectorForCommand_1, + commandDescription?._id ?? ffi.nullptr); + } + + NSString typeForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_64( + _id, _lib._sel_typeForKey_1, key?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSScriptClassDescription classDescriptionForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_564( + _id, _lib._sel_classDescriptionForKey_1, key?._id ?? ffi.nullptr); + return NSScriptClassDescription._(_ret, _lib, retain: true, release: true); + } + + int appleEventCodeForKey_(NSString? key) { + return _lib._objc_msgSend_553( + _id, _lib._sel_appleEventCodeForKey_1, key?._id ?? ffi.nullptr); + } + + NSString keyWithAppleEventCode_(int appleEventCode) { + final _ret = _lib._objc_msgSend_565( + _id, _lib._sel_keyWithAppleEventCode_1, appleEventCode); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get defaultSubcontainerAttributeKey { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_defaultSubcontainerAttributeKey1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool isLocationRequiredToCreateForKey_(NSString? toManyRelationshipKey) { + return _lib._objc_msgSend_59( + _id, + _lib._sel_isLocationRequiredToCreateForKey_1, + toManyRelationshipKey?._id ?? ffi.nullptr); + } + + bool hasPropertyForKey_(NSString? key) { + return _lib._objc_msgSend_59( + _id, _lib._sel_hasPropertyForKey_1, key?._id ?? ffi.nullptr); + } + + bool hasOrderedToManyRelationshipForKey_(NSString? key) { + return _lib._objc_msgSend_59( + _id, + _lib._sel_hasOrderedToManyRelationshipForKey_1, + key?._id ?? ffi.nullptr); + } + + bool hasReadablePropertyForKey_(NSString? key) { + return _lib._objc_msgSend_59( + _id, _lib._sel_hasReadablePropertyForKey_1, key?._id ?? ffi.nullptr); + } + + bool hasWritablePropertyForKey_(NSString? key) { + return _lib._objc_msgSend_59( + _id, _lib._sel_hasWritablePropertyForKey_1, key?._id ?? ffi.nullptr); + } + + bool isReadOnlyKey_(NSString? key) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isReadOnlyKey_1, key?._id ?? ffi.nullptr); + } + + static void registerClassDescription_forClass_( + SwiftLibrary _lib, NSClassDescription? description, NSObject aClass) { + return _lib._objc_msgSend_523( + _lib._class_NSScriptClassDescription1, + _lib._sel_registerClassDescription_forClass_1, + description?._id ?? ffi.nullptr, + aClass._id); + } + + static void invalidateClassDescriptionCache(SwiftLibrary _lib) { + return _lib._objc_msgSend_1(_lib._class_NSScriptClassDescription1, + _lib._sel_invalidateClassDescriptionCache1); + } + + static NSScriptClassDescription new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScriptClassDescription1, _lib._sel_new1); + return NSScriptClassDescription._(_ret, _lib, retain: false, release: true); + } + + static NSScriptClassDescription alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScriptClassDescription1, _lib._sel_alloc1); + return NSScriptClassDescription._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSScriptClassDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSScriptClassDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSScriptClassDescription1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSScriptClassDescription1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSScriptClassDescription1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSScriptClassDescription1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSScriptClassDescription1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSScriptClassDescription1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSScriptClassDescription1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSScriptCommandDescription extends NSObject { + NSScriptCommandDescription._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSScriptCommandDescription] that points to the same underlying object as [other]. + static NSScriptCommandDescription castFrom(T other) { + return NSScriptCommandDescription._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSScriptCommandDescription] that wraps the given raw object pointer. + static NSScriptCommandDescription castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSScriptCommandDescription._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSScriptCommandDescription]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSScriptCommandDescription1); + } + + @override + NSObject init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSScriptCommandDescription initWithSuiteName_commandName_dictionary_( + NSString? suiteName, + NSString? commandName, + NSDictionary? commandDeclaration) { + final _ret = _lib._objc_msgSend_551( + _id, + _lib._sel_initWithSuiteName_commandName_dictionary_1, + suiteName?._id ?? ffi.nullptr, + commandName?._id ?? ffi.nullptr, + commandDeclaration?._id ?? ffi.nullptr); + return NSScriptCommandDescription._(_ret, _lib, + retain: true, release: true); + } + + NSScriptCommandDescription initWithCoder_(NSCoder? inCoder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, inCoder?._id ?? ffi.nullptr); + return NSScriptCommandDescription._(_ret, _lib, + retain: true, release: true); + } + + NSString? get suiteName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_suiteName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get commandName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_commandName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get appleEventClassCode { + return _lib._objc_msgSend_191(_id, _lib._sel_appleEventClassCode1); + } + + int get appleEventCode { + return _lib._objc_msgSend_191(_id, _lib._sel_appleEventCode1); + } + + NSString? get commandClassName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_commandClassName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get returnType { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_returnType1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get appleEventCodeForReturnType { + return _lib._objc_msgSend_191(_id, _lib._sel_appleEventCodeForReturnType1); + } + + NSArray? get argumentNames { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_argumentNames1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString typeForArgumentWithName_(NSString? argumentName) { + final _ret = _lib._objc_msgSend_64(_id, _lib._sel_typeForArgumentWithName_1, + argumentName?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + int appleEventCodeForArgumentWithName_(NSString? argumentName) { + return _lib._objc_msgSend_553( + _id, + _lib._sel_appleEventCodeForArgumentWithName_1, + argumentName?._id ?? ffi.nullptr); + } + + bool isOptionalArgumentWithName_(NSString? argumentName) { + return _lib._objc_msgSend_59(_id, _lib._sel_isOptionalArgumentWithName_1, + argumentName?._id ?? ffi.nullptr); + } + + NSScriptCommand createCommandInstance() { + final _ret = _lib._objc_msgSend_560(_id, _lib._sel_createCommandInstance1); + return NSScriptCommand._(_ret, _lib, retain: true, release: true); + } + + NSScriptCommand createCommandInstanceWithZone_(ffi.Pointer zone) { + final _ret = _lib._objc_msgSend_561( + _id, _lib._sel_createCommandInstanceWithZone_1, zone); + return NSScriptCommand._(_ret, _lib, retain: true, release: true); + } + + static NSScriptCommandDescription new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScriptCommandDescription1, _lib._sel_new1); + return NSScriptCommandDescription._(_ret, _lib, + retain: false, release: true); + } + + static NSScriptCommandDescription alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScriptCommandDescription1, _lib._sel_alloc1); + return NSScriptCommandDescription._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSScriptCommandDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSScriptCommandDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSScriptCommandDescription1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSScriptCommandDescription1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSScriptCommandDescription1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSScriptCommandDescription1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSScriptCommandDescription1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSScriptCommandDescription1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSScriptCommandDescription1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSScriptCommand extends NSObject { + NSScriptCommand._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSScriptCommand] that points to the same underlying object as [other]. + static NSScriptCommand castFrom(T other) { + return NSScriptCommand._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSScriptCommand] that wraps the given raw object pointer. + static NSScriptCommand castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSScriptCommand._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSScriptCommand]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSScriptCommand1); + } + + NSScriptCommand initWithCommandDescription_( + NSScriptCommandDescription? commandDef) { + final _ret = _lib._objc_msgSend_554(_id, + _lib._sel_initWithCommandDescription_1, commandDef?._id ?? ffi.nullptr); + return NSScriptCommand._(_ret, _lib, retain: true, release: true); + } + + NSScriptCommand initWithCoder_(NSCoder? inCoder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, inCoder?._id ?? ffi.nullptr); + return NSScriptCommand._(_ret, _lib, retain: true, release: true); + } + + NSScriptCommandDescription? get commandDescription { + final _ret = _lib._objc_msgSend_555(_id, _lib._sel_commandDescription1); + return _ret.address == 0 + ? null + : NSScriptCommandDescription._(_ret, _lib, retain: true, release: true); + } + + NSObject get directParameter { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_directParameter1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set directParameter(NSObject value) { + _lib._objc_msgSend_368(_id, _lib._sel_setDirectParameter_1, value._id); + } + + NSScriptObjectSpecifier? get receiversSpecifier { + final _ret = _lib._objc_msgSend_556(_id, _lib._sel_receiversSpecifier1); + return _ret.address == 0 + ? null + : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + set receiversSpecifier(NSScriptObjectSpecifier? value) { + _lib._objc_msgSend_557( + _id, _lib._sel_setReceiversSpecifier_1, value?._id ?? ffi.nullptr); + } + + NSObject get evaluatedReceivers { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_evaluatedReceivers1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get arguments { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_arguments1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set arguments(NSDictionary? value) { + _lib._objc_msgSend_165( + _id, _lib._sel_setArguments_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get evaluatedArguments { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_evaluatedArguments1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + bool get wellFormed { + return _lib._objc_msgSend_12(_id, _lib._sel_isWellFormed1); + } + + NSObject performDefaultImplementation() { + final _ret = + _lib._objc_msgSend_2(_id, _lib._sel_performDefaultImplementation1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject executeCommand() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_executeCommand1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + int get scriptErrorNumber { + return _lib._objc_msgSend_78(_id, _lib._sel_scriptErrorNumber1); + } + + set scriptErrorNumber(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setScriptErrorNumber_1, value); + } + + NSAppleEventDescriptor? get scriptErrorOffendingObjectDescriptor { + final _ret = _lib._objc_msgSend_526( + _id, _lib._sel_scriptErrorOffendingObjectDescriptor1); + return _ret.address == 0 + ? null + : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + set scriptErrorOffendingObjectDescriptor(NSAppleEventDescriptor? value) { + _lib._objc_msgSend_559( + _id, + _lib._sel_setScriptErrorOffendingObjectDescriptor_1, + value?._id ?? ffi.nullptr); + } + + NSAppleEventDescriptor? get scriptErrorExpectedTypeDescriptor { + final _ret = _lib._objc_msgSend_526( + _id, _lib._sel_scriptErrorExpectedTypeDescriptor1); + return _ret.address == 0 + ? null + : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + set scriptErrorExpectedTypeDescriptor(NSAppleEventDescriptor? value) { + _lib._objc_msgSend_559( + _id, + _lib._sel_setScriptErrorExpectedTypeDescriptor_1, + value?._id ?? ffi.nullptr); + } + + NSString? get scriptErrorString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_scriptErrorString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set scriptErrorString(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setScriptErrorString_1, value?._id ?? ffi.nullptr); + } + + static NSScriptCommand currentCommand(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_560( + _lib._class_NSScriptCommand1, _lib._sel_currentCommand1); + return NSScriptCommand._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor? get appleEvent { + final _ret = _lib._objc_msgSend_526(_id, _lib._sel_appleEvent1); + return _ret.address == 0 + ? null + : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + void suspendExecution() { + return _lib._objc_msgSend_1(_id, _lib._sel_suspendExecution1); + } + + void resumeExecutionWithResult_(NSObject result) { + return _lib._objc_msgSend_15( + _id, _lib._sel_resumeExecutionWithResult_1, result._id); + } + + static NSScriptCommand new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSScriptCommand1, _lib._sel_new1); + return NSScriptCommand._(_ret, _lib, retain: false, release: true); + } + + static NSScriptCommand alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSScriptCommand1, _lib._sel_alloc1); + return NSScriptCommand._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSScriptCommand1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSScriptCommand1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSScriptCommand1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSScriptCommand1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSScriptCommand1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSScriptCommand1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSScriptCommand1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSScriptCommand1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScriptCommand1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSItemProvider extends NSObject { + NSItemProvider._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSItemProvider] that points to the same underlying object as [other]. + static NSItemProvider castFrom(T other) { + return NSItemProvider._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSItemProvider] that wraps the given raw object pointer. + static NSItemProvider castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSItemProvider._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSItemProvider]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSItemProvider1); + } + + @override + NSItemProvider init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSItemProvider._(_ret, _lib, retain: true, release: true); + } + + void registerDataRepresentationForTypeIdentifier_visibility_loadHandler_( + NSString? typeIdentifier, int visibility, ObjCBlock18 loadHandler) { + return _lib._objc_msgSend_588( + _id, + _lib._sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + visibility, + loadHandler._id); + } + + void + registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_( + NSString? typeIdentifier, + int fileOptions, + int visibility, + ObjCBlock20 loadHandler) { + return _lib._objc_msgSend_589( + _id, + _lib._sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + fileOptions, + visibility, + loadHandler._id); + } + + NSArray? get registeredTypeIdentifiers { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_registeredTypeIdentifiers1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray registeredTypeIdentifiersWithFileOptions_(int fileOptions) { + final _ret = _lib._objc_msgSend_590( + _id, _lib._sel_registeredTypeIdentifiersWithFileOptions_1, fileOptions); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + bool hasItemConformingToTypeIdentifier_(NSString? typeIdentifier) { + return _lib._objc_msgSend_59( + _id, + _lib._sel_hasItemConformingToTypeIdentifier_1, + typeIdentifier?._id ?? ffi.nullptr); + } + + bool hasRepresentationConformingToTypeIdentifier_fileOptions_( + NSString? typeIdentifier, int fileOptions) { + return _lib._objc_msgSend_591( + _id, + _lib._sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1, + typeIdentifier?._id ?? ffi.nullptr, + fileOptions); + } + + NSProgress loadDataRepresentationForTypeIdentifier_completionHandler_( + NSString? typeIdentifier, ObjCBlock19 completionHandler) { + final _ret = _lib._objc_msgSend_592( + _id, + _lib._sel_loadDataRepresentationForTypeIdentifier_completionHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + completionHandler._id); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + NSProgress loadFileRepresentationForTypeIdentifier_completionHandler_( + NSString? typeIdentifier, ObjCBlock22 completionHandler) { + final _ret = _lib._objc_msgSend_593( + _id, + _lib._sel_loadFileRepresentationForTypeIdentifier_completionHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + completionHandler._id); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + NSProgress loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_( + NSString? typeIdentifier, ObjCBlock21 completionHandler) { + final _ret = _lib._objc_msgSend_594( + _id, + _lib._sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + completionHandler._id); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + NSString? get suggestedName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_suggestedName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set suggestedName(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setSuggestedName_1, value?._id ?? ffi.nullptr); + } + + NSItemProvider initWithObject_(NSObject? object) { + final _ret = _lib._objc_msgSend_16( + _id, _lib._sel_initWithObject_1, object?._id ?? ffi.nullptr); + return NSItemProvider._(_ret, _lib, retain: true, release: true); + } + + void registerObject_visibility_(NSObject? object, int visibility) { + return _lib._objc_msgSend_595(_id, _lib._sel_registerObject_visibility_1, + object?._id ?? ffi.nullptr, visibility); + } + + void registerObjectOfClass_visibility_loadHandler_( + NSObject? aClass, int visibility, ObjCBlock23 loadHandler) { + return _lib._objc_msgSend_596( + _id, + _lib._sel_registerObjectOfClass_visibility_loadHandler_1, + aClass?._id ?? ffi.nullptr, + visibility, + loadHandler._id); + } + + bool canLoadObjectOfClass_(NSObject? aClass) { + return _lib._objc_msgSend_0( + _id, _lib._sel_canLoadObjectOfClass_1, aClass?._id ?? ffi.nullptr); + } + + NSProgress loadObjectOfClass_completionHandler_( + NSObject? aClass, ObjCBlock24 completionHandler) { + final _ret = _lib._objc_msgSend_597( + _id, + _lib._sel_loadObjectOfClass_completionHandler_1, + aClass?._id ?? ffi.nullptr, + completionHandler._id); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + NSItemProvider initWithItem_typeIdentifier_( + NSObject? item, NSString? typeIdentifier) { + final _ret = _lib._objc_msgSend_272( + _id, + _lib._sel_initWithItem_typeIdentifier_1, + item?._id ?? ffi.nullptr, + typeIdentifier?._id ?? ffi.nullptr); + return NSItemProvider._(_ret, _lib, retain: true, release: true); + } + + NSItemProvider initWithContentsOfURL_(NSURL? fileURL) { + final _ret = _lib._objc_msgSend_226( + _id, _lib._sel_initWithContentsOfURL_1, fileURL?._id ?? ffi.nullptr); + return NSItemProvider._(_ret, _lib, retain: true, release: true); + } + + void registerItemForTypeIdentifier_loadHandler_( + NSString? typeIdentifier, NSItemProviderLoadHandler loadHandler) { + return _lib._objc_msgSend_598( + _id, + _lib._sel_registerItemForTypeIdentifier_loadHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + loadHandler); + } + + void loadItemForTypeIdentifier_options_completionHandler_( + NSString? typeIdentifier, + NSDictionary? options, + NSItemProviderCompletionHandler completionHandler) { + return _lib._objc_msgSend_599( + _id, + _lib._sel_loadItemForTypeIdentifier_options_completionHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr, + completionHandler); + } + + NSItemProviderLoadHandler get previewImageHandler { + return _lib._objc_msgSend_600(_id, _lib._sel_previewImageHandler1); + } + + set previewImageHandler(NSItemProviderLoadHandler value) { + _lib._objc_msgSend_601(_id, _lib._sel_setPreviewImageHandler_1, value); + } + + void loadPreviewImageWithOptions_completionHandler_(NSDictionary? options, + NSItemProviderCompletionHandler completionHandler) { + return _lib._objc_msgSend_602( + _id, + _lib._sel_loadPreviewImageWithOptions_completionHandler_1, + options?._id ?? ffi.nullptr, + completionHandler); + } + + static NSItemProvider new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSItemProvider1, _lib._sel_new1); + return NSItemProvider._(_ret, _lib, retain: false, release: true); + } + + static NSItemProvider alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSItemProvider1, _lib._sel_alloc1); + return NSItemProvider._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSItemProvider1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSItemProvider1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSItemProvider1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSItemProvider1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSItemProvider1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSItemProvider1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSItemProvider1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSItemProvider1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSItemProvider1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSItemProviderRepresentationVisibility { + static const int NSItemProviderRepresentationVisibilityAll = 0; + static const int NSItemProviderRepresentationVisibilityTeam = 1; + static const int NSItemProviderRepresentationVisibilityGroup = 2; + static const int NSItemProviderRepresentationVisibilityOwnProcess = 3; +} + +ffi.Pointer _ObjCBlock18_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>()(arg0); +} + +final _ObjCBlock18_closureRegistry = {}; +int _ObjCBlock18_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock18_registerClosure(Function fn) { + final id = ++_ObjCBlock18_closureRegistryIndex; + _ObjCBlock18_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +ffi.Pointer _ObjCBlock18_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return _ObjCBlock18_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock18 extends _ObjCBlockBase { + ObjCBlock18._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock18.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock18_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock18.fromFunction(SwiftLibrary lib, + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock18_closureTrampoline) + .cast(), + _ObjCBlock18_registerClosure(fn)), + lib); + ffi.Pointer call(ffi.Pointer<_ObjCBlock> arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>()(_id, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +class NSProgress extends NSObject { + NSProgress._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSProgress] that points to the same underlying object as [other]. + static NSProgress castFrom(T other) { + return NSProgress._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSProgress] that wraps the given raw object pointer. + static NSProgress castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSProgress._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSProgress]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSProgress1); + } + + static NSProgress currentProgress(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_577( + _lib._class_NSProgress1, _lib._sel_currentProgress1); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + static NSProgress progressWithTotalUnitCount_( + SwiftLibrary _lib, int unitCount) { + final _ret = _lib._objc_msgSend_578(_lib._class_NSProgress1, + _lib._sel_progressWithTotalUnitCount_1, unitCount); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + static NSProgress discreteProgressWithTotalUnitCount_( + SwiftLibrary _lib, int unitCount) { + final _ret = _lib._objc_msgSend_578(_lib._class_NSProgress1, + _lib._sel_discreteProgressWithTotalUnitCount_1, unitCount); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + static NSProgress progressWithTotalUnitCount_parent_pendingUnitCount_( + SwiftLibrary _lib, + int unitCount, + NSProgress? parent, + int portionOfParentTotalUnitCount) { + final _ret = _lib._objc_msgSend_579( + _lib._class_NSProgress1, + _lib._sel_progressWithTotalUnitCount_parent_pendingUnitCount_1, + unitCount, + parent?._id ?? ffi.nullptr, + portionOfParentTotalUnitCount); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + NSProgress initWithParent_userInfo_(NSProgress? parentProgressOrNil) { + final _ret = _lib._objc_msgSend_580( + _id, + _lib._sel_initWithParent_userInfo_1, + parentProgressOrNil?._id ?? ffi.nullptr); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + void becomeCurrentWithPendingUnitCount_(int unitCount) { + return _lib._objc_msgSend_581( + _id, _lib._sel_becomeCurrentWithPendingUnitCount_1, unitCount); + } + + void performAsCurrentWithPendingUnitCount_usingBlock_( + int unitCount, ObjCBlock16 work) { + return _lib._objc_msgSend_582( + _id, + _lib._sel_performAsCurrentWithPendingUnitCount_usingBlock_1, + unitCount, + work._id); + } + + void resignCurrent() { + return _lib._objc_msgSend_1(_id, _lib._sel_resignCurrent1); + } + + void addChild_withPendingUnitCount_(NSProgress? child, int inUnitCount) { + return _lib._objc_msgSend_583( + _id, + _lib._sel_addChild_withPendingUnitCount_1, + child?._id ?? ffi.nullptr, + inUnitCount); + } + + int get totalUnitCount { + return _lib._objc_msgSend_584(_id, _lib._sel_totalUnitCount1); + } + + set totalUnitCount(int value) { + _lib._objc_msgSend_585(_id, _lib._sel_setTotalUnitCount_1, value); + } + + int get completedUnitCount { + return _lib._objc_msgSend_584(_id, _lib._sel_completedUnitCount1); + } + + set completedUnitCount(int value) { + _lib._objc_msgSend_585(_id, _lib._sel_setCompletedUnitCount_1, value); + } + + NSString? get localizedDescription { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_localizedDescription1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set localizedDescription(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setLocalizedDescription_1, value?._id ?? ffi.nullptr); + } + + NSString? get localizedAdditionalDescription { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_localizedAdditionalDescription1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set localizedAdditionalDescription(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setLocalizedAdditionalDescription_1, + value?._id ?? ffi.nullptr); + } + + bool get cancellable { + return _lib._objc_msgSend_12(_id, _lib._sel_isCancellable1); + } + + set cancellable(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setCancellable_1, value); + } + + bool get pausable { + return _lib._objc_msgSend_12(_id, _lib._sel_isPausable1); + } + + set pausable(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setPausable_1, value); + } + + bool get cancelled { + return _lib._objc_msgSend_12(_id, _lib._sel_isCancelled1); + } + + bool get paused { + return _lib._objc_msgSend_12(_id, _lib._sel_isPaused1); + } + + ObjCBlock16 get cancellationHandler { + final _ret = _lib._objc_msgSend_586(_id, _lib._sel_cancellationHandler1); + return ObjCBlock16._(_ret, _lib); + } + + set cancellationHandler(ObjCBlock16 value) { + _lib._objc_msgSend_587(_id, _lib._sel_setCancellationHandler_1, value._id); + } + + ObjCBlock16 get pausingHandler { + final _ret = _lib._objc_msgSend_586(_id, _lib._sel_pausingHandler1); + return ObjCBlock16._(_ret, _lib); + } + + set pausingHandler(ObjCBlock16 value) { + _lib._objc_msgSend_587(_id, _lib._sel_setPausingHandler_1, value._id); + } + + ObjCBlock16 get resumingHandler { + final _ret = _lib._objc_msgSend_586(_id, _lib._sel_resumingHandler1); + return ObjCBlock16._(_ret, _lib); + } + + set resumingHandler(ObjCBlock16 value) { + _lib._objc_msgSend_587(_id, _lib._sel_setResumingHandler_1, value._id); + } + + void setUserInfoObject_forKey_( + NSObject objectOrNil, NSProgressUserInfoKey key) { + return _lib._objc_msgSend_122( + _id, _lib._sel_setUserInfoObject_forKey_1, objectOrNil._id, key); + } + + bool get indeterminate { + return _lib._objc_msgSend_12(_id, _lib._sel_isIndeterminate1); + } + + double get fractionCompleted { + return _lib._objc_msgSend_149(_id, _lib._sel_fractionCompleted1); + } + + bool get finished { + return _lib._objc_msgSend_12(_id, _lib._sel_isFinished1); + } + + void cancel() { + return _lib._objc_msgSend_1(_id, _lib._sel_cancel1); + } + + void pause() { + return _lib._objc_msgSend_1(_id, _lib._sel_pause1); + } + + void resume() { + return _lib._objc_msgSend_1(_id, _lib._sel_resume1); + } + + static NSProgress new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSProgress1, _lib._sel_new1); + return NSProgress._(_ret, _lib, retain: false, release: true); + } + + static NSProgress alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSProgress1, _lib._sel_alloc1); + return NSProgress._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSProgress1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSProgress1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSProgress1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSProgress1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSProgress1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSProgress1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSProgress1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSProgress1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSProgress1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSProgressUserInfoKey = ffi.Pointer; +void _ObjCBlock19_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock19_closureRegistry = {}; +int _ObjCBlock19_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock19_registerClosure(Function fn) { + final id = ++_ObjCBlock19_closureRegistryIndex; + _ObjCBlock19_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock19_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return _ObjCBlock19_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock19 extends _ObjCBlockBase { + ObjCBlock19._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock19.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock19_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock19.fromFunction( + SwiftLibrary lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock19_closureTrampoline) + .cast(), + _ObjCBlock19_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +abstract class NSItemProviderFileOptions { + static const int NSItemProviderFileOptionOpenInPlace = 1; +} + +ffi.Pointer _ObjCBlock20_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>()(arg0); +} + +final _ObjCBlock20_closureRegistry = {}; +int _ObjCBlock20_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock20_registerClosure(Function fn) { + final id = ++_ObjCBlock20_closureRegistryIndex; + _ObjCBlock20_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +ffi.Pointer _ObjCBlock20_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return _ObjCBlock20_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock20 extends _ObjCBlockBase { + ObjCBlock20._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock20.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock20_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock20.fromFunction(SwiftLibrary lib, + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock20_closureTrampoline) + .cast(), + _ObjCBlock20_registerClosure(fn)), + lib); + ffi.Pointer call(ffi.Pointer<_ObjCBlock> arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>()(_id, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +void _ObjCBlock21_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, bool arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock21_closureRegistry = {}; +int _ObjCBlock21_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock21_registerClosure(Function fn) { + final id = ++_ObjCBlock21_closureRegistryIndex; + _ObjCBlock21_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock21_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { + return _ObjCBlock21_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock21 extends _ObjCBlockBase { + ObjCBlock21._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock21.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock21_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock21.fromFunction( + SwiftLibrary lib, + void Function(ffi.Pointer arg0, bool arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock21_closureTrampoline) + .cast(), + _ObjCBlock21_registerClosure(fn)), + lib); + void call( + ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + bool arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +void _ObjCBlock22_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock22_closureRegistry = {}; +int _ObjCBlock22_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock22_registerClosure(Function fn) { + final id = ++_ObjCBlock22_closureRegistryIndex; + _ObjCBlock22_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock22_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return _ObjCBlock22_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock22 extends _ObjCBlockBase { + ObjCBlock22._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock22.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock22_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock22.fromFunction( + SwiftLibrary lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock22_closureTrampoline) + .cast(), + _ObjCBlock22_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +ffi.Pointer _ObjCBlock23_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>()(arg0); +} + +final _ObjCBlock23_closureRegistry = {}; +int _ObjCBlock23_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock23_registerClosure(Function fn) { + final id = ++_ObjCBlock23_closureRegistryIndex; + _ObjCBlock23_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +ffi.Pointer _ObjCBlock23_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return _ObjCBlock23_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock23 extends _ObjCBlockBase { + ObjCBlock23._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock23.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock23_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock23.fromFunction(SwiftLibrary lib, + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock23_closureTrampoline) + .cast(), + _ObjCBlock23_registerClosure(fn)), + lib); + ffi.Pointer call(ffi.Pointer<_ObjCBlock> arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>()(_id, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +void _ObjCBlock24_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock24_closureRegistry = {}; +int _ObjCBlock24_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock24_registerClosure(Function fn) { + final id = ++_ObjCBlock24_closureRegistryIndex; + _ObjCBlock24_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock24_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return _ObjCBlock24_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock24 extends _ObjCBlockBase { + ObjCBlock24._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock24.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock24_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock24.fromFunction( + SwiftLibrary lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock24_closureTrampoline) + .cast(), + _ObjCBlock24_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +typedef NSItemProviderLoadHandler = ffi.Pointer<_ObjCBlock>; +void _ObjCBlock25_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock25_closureRegistry = {}; +int _ObjCBlock25_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock25_registerClosure(Function fn) { + final id = ++_ObjCBlock25_closureRegistryIndex; + _ObjCBlock25_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock25_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return _ObjCBlock25_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock25 extends _ObjCBlockBase { + ObjCBlock25._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock25.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock25_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock25.fromFunction( + SwiftLibrary lib, + void Function(NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock25_closureTrampoline) + .cast(), + _ObjCBlock25_registerClosure(fn)), + lib); + void call(NSItemProviderCompletionHandler arg0, ffi.Pointer arg1, + ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +typedef NSItemProviderCompletionHandler = ffi.Pointer<_ObjCBlock>; + +class NSMutableString extends NSString { + NSMutableString._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableString] that points to the same underlying object as [other]. + static NSMutableString castFrom(T other) { + return NSMutableString._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSMutableString] that wraps the given raw object pointer. + static NSMutableString castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableString._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableString]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMutableString1); + } + + void replaceCharactersInRange_withString_(NSRange range, NSString? aString) { + return _lib._objc_msgSend_603( + _id, + _lib._sel_replaceCharactersInRange_withString_1, + range, + aString?._id ?? ffi.nullptr); + } + + void insertString_atIndex_(NSString? aString, int loc) { + return _lib._objc_msgSend_604(_id, _lib._sel_insertString_atIndex_1, + aString?._id ?? ffi.nullptr, loc); + } + + void deleteCharactersInRange_(NSRange range) { + return _lib._objc_msgSend_416( + _id, _lib._sel_deleteCharactersInRange_1, range); + } + + void appendString_(NSString? aString) { + return _lib._objc_msgSend_186( + _id, _lib._sel_appendString_1, aString?._id ?? ffi.nullptr); + } + + void appendFormat_(NSString? format) { + return _lib._objc_msgSend_186( + _id, _lib._sel_appendFormat_1, format?._id ?? ffi.nullptr); + } + + void setString_(NSString? aString) { + return _lib._objc_msgSend_186( + _id, _lib._sel_setString_1, aString?._id ?? ffi.nullptr); + } + + int replaceOccurrencesOfString_withString_options_range_(NSString? target, + NSString? replacement, int options, NSRange searchRange) { + return _lib._objc_msgSend_605( + _id, + _lib._sel_replaceOccurrencesOfString_withString_options_range_1, + target?._id ?? ffi.nullptr, + replacement?._id ?? ffi.nullptr, + options, + searchRange); + } + + bool applyTransform_reverse_range_updatedRange_(NSStringTransform transform, + bool reverse, NSRange range, NSRangePointer resultingRange) { + return _lib._objc_msgSend_606( + _id, + _lib._sel_applyTransform_reverse_range_updatedRange_1, + transform, + reverse, + range, + resultingRange); + } + + NSMutableString initWithCapacity_(int capacity) { + final _ret = + _lib._objc_msgSend_607(_id, _lib._sel_initWithCapacity_1, capacity); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithCapacity_(SwiftLibrary _lib, int capacity) { + final _ret = _lib._objc_msgSend_607( + _lib._class_NSMutableString1, _lib._sel_stringWithCapacity_1, capacity); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static ffi.Pointer getAvailableStringEncodings( + SwiftLibrary _lib) { + return _lib._objc_msgSend_318( + _lib._class_NSMutableString1, _lib._sel_availableStringEncodings1); + } + + static NSString localizedNameOfStringEncoding_( + SwiftLibrary _lib, int encoding) { + final _ret = _lib._objc_msgSend_293(_lib._class_NSMutableString1, + _lib._sel_localizedNameOfStringEncoding_1, encoding); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static int getDefaultCStringEncoding(SwiftLibrary _lib) { + return _lib._objc_msgSend_10( + _lib._class_NSMutableString1, _lib._sel_defaultCStringEncoding1); + } + + static NSMutableString string(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableString1, _lib._sel_string1); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithString_( + SwiftLibrary _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSMutableString1, + _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithCharacters_length_( + SwiftLibrary _lib, ffi.Pointer characters, int length) { + final _ret = _lib._objc_msgSend_331(_lib._class_NSMutableString1, + _lib._sel_stringWithCharacters_length_1, characters, length); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithUTF8String_( + SwiftLibrary _lib, ffi.Pointer nullTerminatedCString) { + final _ret = _lib._objc_msgSend_332(_lib._class_NSMutableString1, + _lib._sel_stringWithUTF8String_1, nullTerminatedCString); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithFormat_( + SwiftLibrary _lib, NSString? format) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSMutableString1, + _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString localizedStringWithFormat_( + SwiftLibrary _lib, NSString? format) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSMutableString1, + _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithCString_encoding_( + SwiftLibrary _lib, ffi.Pointer cString, int enc) { + final _ret = _lib._objc_msgSend_339(_lib._class_NSMutableString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithContentsOfURL_encoding_error_( + SwiftLibrary _lib, + NSURL? url, + int enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_340( + _lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfURL_encoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithContentsOfFile_encoding_error_( + SwiftLibrary _lib, + NSString? path, + int enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_341( + _lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfFile_encoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithContentsOfURL_usedEncoding_error_( + SwiftLibrary _lib, + NSURL? url, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_342( + _lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithContentsOfFile_usedEncoding_error_( + SwiftLibrary _lib, + NSString? path, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_343( + _lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static int + stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( + SwiftLibrary _lib, + NSData? data, + NSDictionary? opts, + ffi.Pointer> string, + ffi.Pointer usedLossyConversion) { + return _lib._objc_msgSend_344( + _lib._class_NSMutableString1, + _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, + data?._id ?? ffi.nullptr, + opts?._id ?? ffi.nullptr, + string, + usedLossyConversion); + } + + static NSObject stringWithContentsOfFile_(SwiftLibrary _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject stringWithContentsOfURL_(SwiftLibrary _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_226(_lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject stringWithCString_length_( + SwiftLibrary _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_339(_lib._class_NSMutableString1, + _lib._sel_stringWithCString_length_1, bytes, length); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject stringWithCString_( + SwiftLibrary _lib, ffi.Pointer bytes) { + final _ret = _lib._objc_msgSend_332( + _lib._class_NSMutableString1, _lib._sel_stringWithCString_1, bytes); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSString pathWithComponents_(SwiftLibrary _lib, NSArray? components) { + final _ret = _lib._objc_msgSend_350(_lib._class_NSMutableString1, + _lib._sel_pathWithComponents_1, components?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableString1, _lib._sel_new1); + return NSMutableString._(_ret, _lib, retain: false, release: true); + } + + static NSMutableString alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableString1, _lib._sel_alloc1); + return NSMutableString._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMutableString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMutableString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMutableString1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableString1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableString1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableString1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMutableString1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSMutableString1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableString1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSNotification extends NSObject { + NSNotification._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSNotification] that points to the same underlying object as [other]. + static NSNotification castFrom(T other) { + return NSNotification._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSNotification] that wraps the given raw object pointer. + static NSNotification castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSNotification._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSNotification]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSNotification1); + } + + NSNotificationName get name { + return _lib._objc_msgSend_20(_id, _lib._sel_name1); + } + + NSObject get object { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_object1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get userInfo { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_userInfo1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSNotification initWithName_object_userInfo_( + NSNotificationName name, NSObject object, NSDictionary? userInfo) { + final _ret = _lib._objc_msgSend_608( + _id, + _lib._sel_initWithName_object_userInfo_1, + name, + object._id, + userInfo?._id ?? ffi.nullptr); + return NSNotification._(_ret, _lib, retain: true, release: true); + } + + NSNotification initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSNotification._(_ret, _lib, retain: true, release: true); + } + + static NSNotification notificationWithName_object_( + SwiftLibrary _lib, NSNotificationName aName, NSObject anObject) { + final _ret = _lib._objc_msgSend_157(_lib._class_NSNotification1, + _lib._sel_notificationWithName_object_1, aName, anObject._id); + return NSNotification._(_ret, _lib, retain: true, release: true); + } + + static NSNotification notificationWithName_object_userInfo_(SwiftLibrary _lib, + NSNotificationName aName, NSObject anObject, NSDictionary? aUserInfo) { + final _ret = _lib._objc_msgSend_608( + _lib._class_NSNotification1, + _lib._sel_notificationWithName_object_userInfo_1, + aName, + anObject._id, + aUserInfo?._id ?? ffi.nullptr); + return NSNotification._(_ret, _lib, retain: true, release: true); + } + + @override + NSNotification init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSNotification._(_ret, _lib, retain: true, release: true); + } + + static NSNotification new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSNotification1, _lib._sel_new1); + return NSNotification._(_ret, _lib, retain: false, release: true); + } + + static NSNotification alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSNotification1, _lib._sel_alloc1); + return NSNotification._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSNotification1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSNotification1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSNotification1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSNotification1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSNotification1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSNotification1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSNotification1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSNotification1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSNotification1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSNotificationName = ffi.Pointer; + +class NSBundle extends NSObject { + NSBundle._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSBundle] that points to the same underlying object as [other]. + static NSBundle castFrom(T other) { + return NSBundle._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSBundle] that wraps the given raw object pointer. + static NSBundle castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSBundle._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSBundle]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSBundle1); + } + + static NSBundle? getMainBundle(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_609(_lib._class_NSBundle1, _lib._sel_mainBundle1); + return _ret.address == 0 + ? null + : NSBundle._(_ret, _lib, retain: true, release: true); + } + + static NSBundle bundleWithPath_(SwiftLibrary _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSBundle1, + _lib._sel_bundleWithPath_1, path?._id ?? ffi.nullptr); + return NSBundle._(_ret, _lib, retain: true, release: true); + } + + NSBundle initWithPath_(NSString? path) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithPath_1, path?._id ?? ffi.nullptr); + return NSBundle._(_ret, _lib, retain: true, release: true); + } + + static NSBundle bundleWithURL_(SwiftLibrary _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_226(_lib._class_NSBundle1, + _lib._sel_bundleWithURL_1, url?._id ?? ffi.nullptr); + return NSBundle._(_ret, _lib, retain: true, release: true); + } + + NSBundle initWithURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_226( + _id, _lib._sel_initWithURL_1, url?._id ?? ffi.nullptr); + return NSBundle._(_ret, _lib, retain: true, release: true); + } + + static NSBundle bundleForClass_(SwiftLibrary _lib, NSObject aClass) { + final _ret = _lib._objc_msgSend_610( + _lib._class_NSBundle1, _lib._sel_bundleForClass_1, aClass._id); + return NSBundle._(_ret, _lib, retain: true, release: true); + } + + static NSBundle bundleWithIdentifier_( + SwiftLibrary _lib, NSString? identifier) { + final _ret = _lib._objc_msgSend_611(_lib._class_NSBundle1, + _lib._sel_bundleWithIdentifier_1, identifier?._id ?? ffi.nullptr); + return NSBundle._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getAllBundles(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_80(_lib._class_NSBundle1, _lib._sel_allBundles1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getAllFrameworks(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_80(_lib._class_NSBundle1, _lib._sel_allFrameworks1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + bool load() { + return _lib._objc_msgSend_12(_id, _lib._sel_load1); + } + + bool get loaded { + return _lib._objc_msgSend_12(_id, _lib._sel_isLoaded1); + } + + bool unload() { + return _lib._objc_msgSend_12(_id, _lib._sel_unload1); + } + + bool preflightAndReturnError_(ffi.Pointer> error) { + return _lib._objc_msgSend_219( + _id, _lib._sel_preflightAndReturnError_1, error); + } + + bool loadAndReturnError_(ffi.Pointer> error) { + return _lib._objc_msgSend_219(_id, _lib._sel_loadAndReturnError_1, error); + } + + NSURL? get bundleURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_bundleURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get resourceURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_resourceURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get executableURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_executableURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL URLForAuxiliaryExecutable_(NSString? executableName) { + final _ret = _lib._objc_msgSend_34( + _id, + _lib._sel_URLForAuxiliaryExecutable_1, + executableName?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get privateFrameworksURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_privateFrameworksURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get sharedFrameworksURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_sharedFrameworksURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get sharedSupportURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_sharedSupportURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get builtInPlugInsURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_builtInPlugInsURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get appStoreReceiptURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_appStoreReceiptURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSString? get bundlePath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_bundlePath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get resourcePath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_resourcePath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get executablePath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_executablePath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString pathForAuxiliaryExecutable_(NSString? executableName) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_pathForAuxiliaryExecutable_1, + executableName?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get privateFrameworksPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_privateFrameworksPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get sharedFrameworksPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_sharedFrameworksPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get sharedSupportPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_sharedSupportPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get builtInPlugInsPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_builtInPlugInsPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + static NSURL URLForResource_withExtension_subdirectory_inBundleWithURL_( + SwiftLibrary _lib, + NSString? name, + NSString? ext, + NSString? subpath, + NSURL? bundleURL) { + final _ret = _lib._objc_msgSend_612( + _lib._class_NSBundle1, + _lib._sel_URLForResource_withExtension_subdirectory_inBundleWithURL_1, + name?._id ?? ffi.nullptr, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr, + bundleURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSArray URLsForResourcesWithExtension_subdirectory_inBundleWithURL_( + SwiftLibrary _lib, NSString? ext, NSString? subpath, NSURL? bundleURL) { + final _ret = _lib._objc_msgSend_613( + _lib._class_NSBundle1, + _lib._sel_URLsForResourcesWithExtension_subdirectory_inBundleWithURL_1, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr, + bundleURL?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSURL URLForResource_withExtension_(NSString? name, NSString? ext) { + final _ret = _lib._objc_msgSend_614( + _id, + _lib._sel_URLForResource_withExtension_1, + name?._id ?? ffi.nullptr, + ext?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL URLForResource_withExtension_subdirectory_( + NSString? name, NSString? ext, NSString? subpath) { + final _ret = _lib._objc_msgSend_615( + _id, + _lib._sel_URLForResource_withExtension_subdirectory_1, + name?._id ?? ffi.nullptr, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL URLForResource_withExtension_subdirectory_localization_(NSString? name, + NSString? ext, NSString? subpath, NSString? localizationName) { + final _ret = _lib._objc_msgSend_616( + _id, + _lib._sel_URLForResource_withExtension_subdirectory_localization_1, + name?._id ?? ffi.nullptr, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr, + localizationName?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSArray URLsForResourcesWithExtension_subdirectory_( + NSString? ext, NSString? subpath) { + final _ret = _lib._objc_msgSend_617( + _id, + _lib._sel_URLsForResourcesWithExtension_subdirectory_1, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray URLsForResourcesWithExtension_subdirectory_localization_( + NSString? ext, NSString? subpath, NSString? localizationName) { + final _ret = _lib._objc_msgSend_618( + _id, + _lib._sel_URLsForResourcesWithExtension_subdirectory_localization_1, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr, + localizationName?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSString pathForResource_ofType_inDirectory_( + SwiftLibrary _lib, NSString? name, NSString? ext, NSString? bundlePath) { + final _ret = _lib._objc_msgSend_619( + _lib._class_NSBundle1, + _lib._sel_pathForResource_ofType_inDirectory_1, + name?._id ?? ffi.nullptr, + ext?._id ?? ffi.nullptr, + bundlePath?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSArray pathsForResourcesOfType_inDirectory_( + SwiftLibrary _lib, NSString? ext, NSString? bundlePath) { + final _ret = _lib._objc_msgSend_617( + _lib._class_NSBundle1, + _lib._sel_pathsForResourcesOfType_inDirectory_1, + ext?._id ?? ffi.nullptr, + bundlePath?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString pathForResource_ofType_(NSString? name, NSString? ext) { + final _ret = _lib._objc_msgSend_324(_id, _lib._sel_pathForResource_ofType_1, + name?._id ?? ffi.nullptr, ext?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString pathForResource_ofType_inDirectory_forLocalization_(NSString? name, + NSString? ext, NSString? subpath, NSString? localizationName) { + final _ret = _lib._objc_msgSend_620( + _id, + _lib._sel_pathForResource_ofType_inDirectory_forLocalization_1, + name?._id ?? ffi.nullptr, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr, + localizationName?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray pathsForResourcesOfType_inDirectory_forLocalization_( + NSString? ext, NSString? subpath, NSString? localizationName) { + final _ret = _lib._objc_msgSend_618( + _id, + _lib._sel_pathsForResourcesOfType_inDirectory_forLocalization_1, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr, + localizationName?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForKey_value_table_( + NSString? key, NSString? value, NSString? tableName) { + final _ret = _lib._objc_msgSend_619( + _id, + _lib._sel_localizedStringForKey_value_table_1, + key?._id ?? ffi.nullptr, + value?._id ?? ffi.nullptr, + tableName?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString localizedAttributedStringForKey_value_table_( + NSString? key, NSString? value, NSString? tableName) { + final _ret = _lib._objc_msgSend_641( + _id, + _lib._sel_localizedAttributedStringForKey_value_table_1, + key?._id ?? ffi.nullptr, + value?._id ?? ffi.nullptr, + tableName?._id ?? ffi.nullptr); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSString? get bundleIdentifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_bundleIdentifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get infoDictionary { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_infoDictionary1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get localizedInfoDictionary { + final _ret = + _lib._objc_msgSend_164(_id, _lib._sel_localizedInfoDictionary1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSObject objectForInfoDictionaryKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_objectForInfoDictionaryKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject classNamed_(NSString? className) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_classNamed_1, className?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject get principalClass { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_principalClass1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSArray? get preferredLocalizations { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_preferredLocalizations1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get localizations { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_localizations1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get developmentLocalization { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_developmentLocalization1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + static NSArray preferredLocalizationsFromArray_( + SwiftLibrary _lib, NSArray? localizationsArray) { + final _ret = _lib._objc_msgSend_63( + _lib._class_NSBundle1, + _lib._sel_preferredLocalizationsFromArray_1, + localizationsArray?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray preferredLocalizationsFromArray_forPreferences_( + SwiftLibrary _lib, + NSArray? localizationsArray, + NSArray? preferencesArray) { + final _ret = _lib._objc_msgSend_642( + _lib._class_NSBundle1, + _lib._sel_preferredLocalizationsFromArray_forPreferences_1, + localizationsArray?._id ?? ffi.nullptr, + preferencesArray?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get executableArchitectures { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_executableArchitectures1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + void setPreservationPriority_forTags_(double priority, NSSet? tags) { + return _lib._objc_msgSend_643( + _id, + _lib._sel_setPreservationPriority_forTags_1, + priority, + tags?._id ?? ffi.nullptr); + } + + double preservationPriorityForTag_(NSString? tag) { + return _lib._objc_msgSend_269( + _id, _lib._sel_preservationPriorityForTag_1, tag?._id ?? ffi.nullptr); + } + + static NSBundle new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSBundle1, _lib._sel_new1); + return NSBundle._(_ret, _lib, retain: false, release: true); + } + + static NSBundle alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSBundle1, _lib._sel_alloc1); + return NSBundle._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSBundle1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSBundle1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSBundle1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSBundle1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSBundle1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSBundle1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSBundle1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSBundle1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSBundle1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSAttributedString extends NSObject { + NSAttributedString._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSAttributedString] that points to the same underlying object as [other]. + static NSAttributedString castFrom(T other) { + return NSAttributedString._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSAttributedString] that wraps the given raw object pointer. + static NSAttributedString castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSAttributedString._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSAttributedString]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSAttributedString1); + } + + NSString? get string { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_string1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSDictionary attributesAtIndex_effectiveRange_( + int location, NSRangePointer range) { + final _ret = _lib._objc_msgSend_621( + _id, _lib._sel_attributesAtIndex_effectiveRange_1, location, range); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + int get length { + return _lib._objc_msgSend_10(_id, _lib._sel_length1); + } + + NSObject attribute_atIndex_effectiveRange_( + NSAttributedStringKey attrName, int location, NSRangePointer range) { + final _ret = _lib._objc_msgSend_622( + _id, + _lib._sel_attribute_atIndex_effectiveRange_1, + attrName, + location, + range); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString attributedSubstringFromRange_(NSRange range) { + final _ret = _lib._objc_msgSend_623( + _id, _lib._sel_attributedSubstringFromRange_1, range); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSDictionary attributesAtIndex_longestEffectiveRange_inRange_( + int location, NSRangePointer range, NSRange rangeLimit) { + final _ret = _lib._objc_msgSend_624( + _id, + _lib._sel_attributesAtIndex_longestEffectiveRange_inRange_1, + location, + range, + rangeLimit); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSObject attribute_atIndex_longestEffectiveRange_inRange_( + NSAttributedStringKey attrName, + int location, + NSRangePointer range, + NSRange rangeLimit) { + final _ret = _lib._objc_msgSend_625( + _id, + _lib._sel_attribute_atIndex_longestEffectiveRange_inRange_1, + attrName, + location, + range, + rangeLimit); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool isEqualToAttributedString_(NSAttributedString? other) { + return _lib._objc_msgSend_626( + _id, _lib._sel_isEqualToAttributedString_1, other?._id ?? ffi.nullptr); + } + + NSAttributedString initWithString_(NSString? str) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, str?._id ?? ffi.nullptr); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString initWithString_attributes_( + NSString? str, NSDictionary? attrs) { + final _ret = _lib._objc_msgSend_352( + _id, + _lib._sel_initWithString_attributes_1, + str?._id ?? ffi.nullptr, + attrs?._id ?? ffi.nullptr); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString initWithAttributedString_(NSAttributedString? attrStr) { + final _ret = _lib._objc_msgSend_627( + _id, _lib._sel_initWithAttributedString_1, attrStr?._id ?? ffi.nullptr); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + void enumerateAttributesInRange_options_usingBlock_( + NSRange enumerationRange, int opts, ObjCBlock26 block) { + return _lib._objc_msgSend_628( + _id, + _lib._sel_enumerateAttributesInRange_options_usingBlock_1, + enumerationRange, + opts, + block._id); + } + + void enumerateAttribute_inRange_options_usingBlock_( + NSAttributedStringKey attrName, + NSRange enumerationRange, + int opts, + ObjCBlock27 block) { + return _lib._objc_msgSend_629( + _id, + _lib._sel_enumerateAttribute_inRange_options_usingBlock_1, + attrName, + enumerationRange, + opts, + block._id); + } + + NSAttributedString initWithContentsOfMarkdownFileAtURL_options_baseURL_error_( + NSURL? markdownFile, + NSAttributedStringMarkdownParsingOptions? options, + NSURL? baseURL, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_634( + _id, + _lib._sel_initWithContentsOfMarkdownFileAtURL_options_baseURL_error_1, + markdownFile?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr, + error); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString initWithMarkdown_options_baseURL_error_( + NSData? markdown, + NSAttributedStringMarkdownParsingOptions? options, + NSURL? baseURL, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_635( + _id, + _lib._sel_initWithMarkdown_options_baseURL_error_1, + markdown?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr, + error); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString initWithMarkdownString_options_baseURL_error_( + NSString? markdownString, + NSAttributedStringMarkdownParsingOptions? options, + NSURL? baseURL, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_636( + _id, + _lib._sel_initWithMarkdownString_options_baseURL_error_1, + markdownString?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr, + error); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString initWithFormat_options_locale_( + NSAttributedString? format, int options, NSLocale? locale) { + final _ret = _lib._objc_msgSend_637( + _id, + _lib._sel_initWithFormat_options_locale_1, + format?._id ?? ffi.nullptr, + options, + locale?._id ?? ffi.nullptr); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString initWithFormat_options_locale_arguments_( + NSAttributedString? format, + int options, + NSLocale? locale, + ffi.Pointer<__va_list_tag> arguments) { + final _ret = _lib._objc_msgSend_638( + _id, + _lib._sel_initWithFormat_options_locale_arguments_1, + format?._id ?? ffi.nullptr, + options, + locale?._id ?? ffi.nullptr, + arguments); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + static NSAttributedString localizedAttributedStringWithFormat_( + SwiftLibrary _lib, NSAttributedString? format) { + final _ret = _lib._objc_msgSend_627( + _lib._class_NSAttributedString1, + _lib._sel_localizedAttributedStringWithFormat_1, + format?._id ?? ffi.nullptr); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + static NSAttributedString localizedAttributedStringWithFormat_options_( + SwiftLibrary _lib, NSAttributedString? format, int options) { + final _ret = _lib._objc_msgSend_639( + _lib._class_NSAttributedString1, + _lib._sel_localizedAttributedStringWithFormat_options_1, + format?._id ?? ffi.nullptr, + options); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString attributedStringByInflectingString() { + final _ret = _lib._objc_msgSend_640( + _id, _lib._sel_attributedStringByInflectingString1); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + static NSAttributedString new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSAttributedString1, _lib._sel_new1); + return NSAttributedString._(_ret, _lib, retain: false, release: true); + } + + static NSAttributedString alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSAttributedString1, _lib._sel_alloc1); + return NSAttributedString._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSAttributedString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSAttributedString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSAttributedString1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSAttributedString1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSAttributedString1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSAttributedString1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSAttributedString1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSAttributedString1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSAttributedString1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSAttributedStringKey = ffi.Pointer; + +abstract class NSAttributedStringEnumerationOptions { + static const int NSAttributedStringEnumerationReverse = 2; + static const int + NSAttributedStringEnumerationLongestEffectiveRangeNotRequired = 1048576; +} + +void _ObjCBlock26_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock26_closureRegistry = {}; +int _ObjCBlock26_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock26_registerClosure(Function fn) { + final id = ++_ObjCBlock26_closureRegistryIndex; + _ObjCBlock26_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock26_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) { + return _ObjCBlock26_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock26 extends _ObjCBlockBase { + ObjCBlock26._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock26.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock26_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock26.fromFunction( + SwiftLibrary lib, + void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock26_closureTrampoline) + .cast(), + _ObjCBlock26_registerClosure(fn)), + lib); + void call( + ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +void _ObjCBlock27_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock27_closureRegistry = {}; +int _ObjCBlock27_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock27_registerClosure(Function fn) { + final id = ++_ObjCBlock27_closureRegistryIndex; + _ObjCBlock27_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock27_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) { + return _ObjCBlock27_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock27 extends _ObjCBlockBase { + ObjCBlock27._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock27.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock27_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock27.fromFunction( + SwiftLibrary lib, + void Function(ffi.Pointer arg0, NSRange arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock27_closureTrampoline) + .cast(), + _ObjCBlock27_registerClosure(fn)), + lib); + void call( + ffi.Pointer arg0, NSRange arg1, ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +class NSAttributedStringMarkdownParsingOptions extends NSObject { + NSAttributedStringMarkdownParsingOptions._( + ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSAttributedStringMarkdownParsingOptions] that points to the same underlying object as [other]. + static NSAttributedStringMarkdownParsingOptions + castFrom(T other) { + return NSAttributedStringMarkdownParsingOptions._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSAttributedStringMarkdownParsingOptions] that wraps the given raw object pointer. + static NSAttributedStringMarkdownParsingOptions castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSAttributedStringMarkdownParsingOptions._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSAttributedStringMarkdownParsingOptions]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSAttributedStringMarkdownParsingOptions1); + } + + @override + NSAttributedStringMarkdownParsingOptions init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSAttributedStringMarkdownParsingOptions._(_ret, _lib, + retain: true, release: true); + } + + bool get allowsExtendedAttributes { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsExtendedAttributes1); + } + + set allowsExtendedAttributes(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setAllowsExtendedAttributes_1, value); + } + + int get interpretedSyntax { + return _lib._objc_msgSend_630(_id, _lib._sel_interpretedSyntax1); + } + + set interpretedSyntax(int value) { + _lib._objc_msgSend_631(_id, _lib._sel_setInterpretedSyntax_1, value); + } + + int get failurePolicy { + return _lib._objc_msgSend_632(_id, _lib._sel_failurePolicy1); + } + + set failurePolicy(int value) { + _lib._objc_msgSend_633(_id, _lib._sel_setFailurePolicy_1, value); + } + + NSString? get languageCode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_languageCode1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set languageCode(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setLanguageCode_1, value?._id ?? ffi.nullptr); + } + + static NSAttributedStringMarkdownParsingOptions new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSAttributedStringMarkdownParsingOptions1, _lib._sel_new1); + return NSAttributedStringMarkdownParsingOptions._(_ret, _lib, + retain: false, release: true); + } + + static NSAttributedStringMarkdownParsingOptions alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_alloc1); + return NSAttributedStringMarkdownParsingOptions._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, + aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSAttributedStringMarkdownInterpretedSyntax { + static const int NSAttributedStringMarkdownInterpretedSyntaxFull = 0; + static const int NSAttributedStringMarkdownInterpretedSyntaxInlineOnly = 1; + static const int + NSAttributedStringMarkdownInterpretedSyntaxInlineOnlyPreservingWhitespace = + 2; +} + +abstract class NSAttributedStringMarkdownParsingFailurePolicy { + static const int NSAttributedStringMarkdownParsingFailureReturnError = 0; + static const int + NSAttributedStringMarkdownParsingFailureReturnPartiallyParsedIfPossible = + 1; +} + +abstract class NSAttributedStringFormattingOptions { + static const int + NSAttributedStringFormattingInsertArgumentAttributesWithoutMerging = 1; + static const int NSAttributedStringFormattingApplyReplacementIndexAttribute = + 2; +} + +class NSMutableAttributedString extends NSAttributedString { + NSMutableAttributedString._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableAttributedString] that points to the same underlying object as [other]. + static NSMutableAttributedString castFrom(T other) { + return NSMutableAttributedString._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSMutableAttributedString] that wraps the given raw object pointer. + static NSMutableAttributedString castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableAttributedString._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableAttributedString]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMutableAttributedString1); + } + + void replaceCharactersInRange_withString_(NSRange range, NSString? str) { + return _lib._objc_msgSend_603( + _id, + _lib._sel_replaceCharactersInRange_withString_1, + range, + str?._id ?? ffi.nullptr); + } + + void setAttributes_range_(NSDictionary? attrs, NSRange range) { + return _lib._objc_msgSend_644( + _id, _lib._sel_setAttributes_range_1, attrs?._id ?? ffi.nullptr, range); + } + + NSMutableString? get mutableString { + final _ret = _lib._objc_msgSend_645(_id, _lib._sel_mutableString1); + return _ret.address == 0 + ? null + : NSMutableString._(_ret, _lib, retain: true, release: true); + } + + void addAttribute_value_range_( + NSAttributedStringKey name, NSObject value, NSRange range) { + return _lib._objc_msgSend_646( + _id, _lib._sel_addAttribute_value_range_1, name, value._id, range); + } + + void addAttributes_range_(NSDictionary? attrs, NSRange range) { + return _lib._objc_msgSend_644( + _id, _lib._sel_addAttributes_range_1, attrs?._id ?? ffi.nullptr, range); + } + + void removeAttribute_range_(NSAttributedStringKey name, NSRange range) { + return _lib._objc_msgSend_647( + _id, _lib._sel_removeAttribute_range_1, name, range); + } + + void replaceCharactersInRange_withAttributedString_( + NSRange range, NSAttributedString? attrString) { + return _lib._objc_msgSend_648( + _id, + _lib._sel_replaceCharactersInRange_withAttributedString_1, + range, + attrString?._id ?? ffi.nullptr); + } + + void insertAttributedString_atIndex_( + NSAttributedString? attrString, int loc) { + return _lib._objc_msgSend_649( + _id, + _lib._sel_insertAttributedString_atIndex_1, + attrString?._id ?? ffi.nullptr, + loc); + } + + void appendAttributedString_(NSAttributedString? attrString) { + return _lib._objc_msgSend_650(_id, _lib._sel_appendAttributedString_1, + attrString?._id ?? ffi.nullptr); + } + + void deleteCharactersInRange_(NSRange range) { + return _lib._objc_msgSend_416( + _id, _lib._sel_deleteCharactersInRange_1, range); + } + + void setAttributedString_(NSAttributedString? attrString) { + return _lib._objc_msgSend_650( + _id, _lib._sel_setAttributedString_1, attrString?._id ?? ffi.nullptr); + } + + void beginEditing() { + return _lib._objc_msgSend_1(_id, _lib._sel_beginEditing1); + } + + void endEditing() { + return _lib._objc_msgSend_1(_id, _lib._sel_endEditing1); + } + + void appendLocalizedFormat_(NSAttributedString? format) { + return _lib._objc_msgSend_650( + _id, _lib._sel_appendLocalizedFormat_1, format?._id ?? ffi.nullptr); + } + + static NSMutableAttributedString localizedAttributedStringWithFormat_( + SwiftLibrary _lib, NSAttributedString? format) { + final _ret = _lib._objc_msgSend_627( + _lib._class_NSMutableAttributedString1, + _lib._sel_localizedAttributedStringWithFormat_1, + format?._id ?? ffi.nullptr); + return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableAttributedString localizedAttributedStringWithFormat_options_( + SwiftLibrary _lib, NSAttributedString? format, int options) { + final _ret = _lib._objc_msgSend_639( + _lib._class_NSMutableAttributedString1, + _lib._sel_localizedAttributedStringWithFormat_options_1, + format?._id ?? ffi.nullptr, + options); + return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableAttributedString new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableAttributedString1, _lib._sel_new1); + return NSMutableAttributedString._(_ret, _lib, + retain: false, release: true); + } + + static NSMutableAttributedString alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableAttributedString1, _lib._sel_alloc1); + return NSMutableAttributedString._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMutableAttributedString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMutableAttributedString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMutableAttributedString1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableAttributedString1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableAttributedString1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableAttributedString1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMutableAttributedString1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSMutableAttributedString1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSMutableAttributedString1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSDateFormatter extends NSFormatter { + NSDateFormatter._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSDateFormatter] that points to the same underlying object as [other]. + static NSDateFormatter castFrom(T other) { + return NSDateFormatter._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSDateFormatter] that wraps the given raw object pointer. + static NSDateFormatter castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSDateFormatter._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSDateFormatter]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSDateFormatter1); + } + + int get formattingContext { + return _lib._objc_msgSend_655(_id, _lib._sel_formattingContext1); + } + + set formattingContext(int value) { + _lib._objc_msgSend_656(_id, _lib._sel_setFormattingContext_1, value); + } + + bool getObjectValue_forString_range_error_( + ffi.Pointer> obj, + NSString? string, + ffi.Pointer rangep, + ffi.Pointer> error) { + return _lib._objc_msgSend_657( + _id, + _lib._sel_getObjectValue_forString_range_error_1, + obj, + string?._id ?? ffi.nullptr, + rangep, + error); + } + + NSString stringFromDate_(NSDate? date) { + final _ret = _lib._objc_msgSend_161( + _id, _lib._sel_stringFromDate_1, date?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSDate dateFromString_(NSString? string) { + final _ret = _lib._objc_msgSend_496( + _id, _lib._sel_dateFromString_1, string?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSString localizedStringFromDate_dateStyle_timeStyle_( + SwiftLibrary _lib, NSDate? date, int dstyle, int tstyle) { + final _ret = _lib._objc_msgSend_658( + _lib._class_NSDateFormatter1, + _lib._sel_localizedStringFromDate_dateStyle_timeStyle_1, + date?._id ?? ffi.nullptr, + dstyle, + tstyle); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString dateFormatFromTemplate_options_locale_( + SwiftLibrary _lib, NSString? tmplate, int opts, NSLocale? locale) { + final _ret = _lib._objc_msgSend_659( + _lib._class_NSDateFormatter1, + _lib._sel_dateFormatFromTemplate_options_locale_1, + tmplate?._id ?? ffi.nullptr, + opts, + locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static int getDefaultFormatterBehavior(SwiftLibrary _lib) { + return _lib._objc_msgSend_660( + _lib._class_NSDateFormatter1, _lib._sel_defaultFormatterBehavior1); + } + + static void setDefaultFormatterBehavior(SwiftLibrary _lib, int value) { + _lib._objc_msgSend_661(_lib._class_NSDateFormatter1, + _lib._sel_setDefaultFormatterBehavior_1, value); + } + + void setLocalizedDateFormatFromTemplate_(NSString? dateFormatTemplate) { + return _lib._objc_msgSend_186( + _id, + _lib._sel_setLocalizedDateFormatFromTemplate_1, + dateFormatTemplate?._id ?? ffi.nullptr); + } + + NSString? get dateFormat { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_dateFormat1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set dateFormat(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setDateFormat_1, value?._id ?? ffi.nullptr); + } + + int get dateStyle { + return _lib._objc_msgSend_662(_id, _lib._sel_dateStyle1); + } + + set dateStyle(int value) { + _lib._objc_msgSend_663(_id, _lib._sel_setDateStyle_1, value); + } + + int get timeStyle { + return _lib._objc_msgSend_662(_id, _lib._sel_timeStyle1); + } + + set timeStyle(int value) { + _lib._objc_msgSend_663(_id, _lib._sel_setTimeStyle_1, value); + } + + NSLocale? get locale { + final _ret = _lib._objc_msgSend_176(_id, _lib._sel_locale1); + return _ret.address == 0 + ? null + : NSLocale._(_ret, _lib, retain: true, release: true); + } + + set locale(NSLocale? value) { + _lib._objc_msgSend_664( + _id, _lib._sel_setLocale_1, value?._id ?? ffi.nullptr); + } + + bool get generatesCalendarDates { + return _lib._objc_msgSend_12(_id, _lib._sel_generatesCalendarDates1); + } + + set generatesCalendarDates(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setGeneratesCalendarDates_1, value); + } + + int get formatterBehavior { + return _lib._objc_msgSend_660(_id, _lib._sel_formatterBehavior1); + } + + set formatterBehavior(int value) { + _lib._objc_msgSend_661(_id, _lib._sel_setFormatterBehavior_1, value); + } + + NSTimeZone? get timeZone { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_timeZone1); + return _ret.address == 0 + ? null + : NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + set timeZone(NSTimeZone? value) { + _lib._objc_msgSend_163( + _id, _lib._sel_setTimeZone_1, value?._id ?? ffi.nullptr); + } + + NSCalendar? get calendar { + final _ret = _lib._objc_msgSend_665(_id, _lib._sel_calendar1); + return _ret.address == 0 + ? null + : NSCalendar._(_ret, _lib, retain: true, release: true); + } + + set calendar(NSCalendar? value) { + _lib._objc_msgSend_671( + _id, _lib._sel_setCalendar_1, value?._id ?? ffi.nullptr); + } + + bool get lenient { + return _lib._objc_msgSend_12(_id, _lib._sel_isLenient1); + } + + set lenient(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setLenient_1, value); + } + + NSDate? get twoDigitStartDate { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_twoDigitStartDate1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + set twoDigitStartDate(NSDate? value) { + _lib._objc_msgSend_493( + _id, _lib._sel_setTwoDigitStartDate_1, value?._id ?? ffi.nullptr); + } + + NSDate? get defaultDate { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_defaultDate1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + set defaultDate(NSDate? value) { + _lib._objc_msgSend_493( + _id, _lib._sel_setDefaultDate_1, value?._id ?? ffi.nullptr); + } + + NSArray? get eraSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_eraSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set eraSymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setEraSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get monthSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_monthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set monthSymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setMonthSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get shortMonthSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_shortMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set shortMonthSymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setShortMonthSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get weekdaySymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_weekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set weekdaySymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setWeekdaySymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get shortWeekdaySymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_shortWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set shortWeekdaySymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setShortWeekdaySymbols_1, value?._id ?? ffi.nullptr); + } + + NSString? get AMSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_AMSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set AMSymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setAMSymbol_1, value?._id ?? ffi.nullptr); + } + + NSString? get PMSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_PMSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set PMSymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPMSymbol_1, value?._id ?? ffi.nullptr); + } + + NSArray? get longEraSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_longEraSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set longEraSymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setLongEraSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get veryShortMonthSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_veryShortMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set veryShortMonthSymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setVeryShortMonthSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get standaloneMonthSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_standaloneMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set standaloneMonthSymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setStandaloneMonthSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get shortStandaloneMonthSymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_shortStandaloneMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set shortStandaloneMonthSymbols(NSArray? value) { + _lib._objc_msgSend_696(_id, _lib._sel_setShortStandaloneMonthSymbols_1, + value?._id ?? ffi.nullptr); + } + + NSArray? get veryShortStandaloneMonthSymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_veryShortStandaloneMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set veryShortStandaloneMonthSymbols(NSArray? value) { + _lib._objc_msgSend_696(_id, _lib._sel_setVeryShortStandaloneMonthSymbols_1, + value?._id ?? ffi.nullptr); + } + + NSArray? get veryShortWeekdaySymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_veryShortWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set veryShortWeekdaySymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setVeryShortWeekdaySymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get standaloneWeekdaySymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_standaloneWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set standaloneWeekdaySymbols(NSArray? value) { + _lib._objc_msgSend_696(_id, _lib._sel_setStandaloneWeekdaySymbols_1, + value?._id ?? ffi.nullptr); + } + + NSArray? get shortStandaloneWeekdaySymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_shortStandaloneWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set shortStandaloneWeekdaySymbols(NSArray? value) { + _lib._objc_msgSend_696(_id, _lib._sel_setShortStandaloneWeekdaySymbols_1, + value?._id ?? ffi.nullptr); + } + + NSArray? get veryShortStandaloneWeekdaySymbols { + final _ret = _lib._objc_msgSend_80( + _id, _lib._sel_veryShortStandaloneWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set veryShortStandaloneWeekdaySymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, + _lib._sel_setVeryShortStandaloneWeekdaySymbols_1, + value?._id ?? ffi.nullptr); + } + + NSArray? get quarterSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_quarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set quarterSymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setQuarterSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get shortQuarterSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_shortQuarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set shortQuarterSymbols(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setShortQuarterSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get standaloneQuarterSymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_standaloneQuarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set standaloneQuarterSymbols(NSArray? value) { + _lib._objc_msgSend_696(_id, _lib._sel_setStandaloneQuarterSymbols_1, + value?._id ?? ffi.nullptr); + } + + NSArray? get shortStandaloneQuarterSymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_shortStandaloneQuarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set shortStandaloneQuarterSymbols(NSArray? value) { + _lib._objc_msgSend_696(_id, _lib._sel_setShortStandaloneQuarterSymbols_1, + value?._id ?? ffi.nullptr); + } + + NSDate? get gregorianStartDate { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_gregorianStartDate1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + set gregorianStartDate(NSDate? value) { + _lib._objc_msgSend_493( + _id, _lib._sel_setGregorianStartDate_1, value?._id ?? ffi.nullptr); + } + + bool get doesRelativeDateFormatting { + return _lib._objc_msgSend_12(_id, _lib._sel_doesRelativeDateFormatting1); + } + + set doesRelativeDateFormatting(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setDoesRelativeDateFormatting_1, value); + } + + NSObject initWithDateFormat_allowNaturalLanguage_( + NSString? format, bool flag) { + final _ret = _lib._objc_msgSend_29( + _id, + _lib._sel_initWithDateFormat_allowNaturalLanguage_1, + format?._id ?? ffi.nullptr, + flag); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool allowsNaturalLanguage() { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsNaturalLanguage1); + } + + static NSDateFormatter new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDateFormatter1, _lib._sel_new1); + return NSDateFormatter._(_ret, _lib, retain: false, release: true); + } + + static NSDateFormatter alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDateFormatter1, _lib._sel_alloc1); + return NSDateFormatter._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSDateFormatter1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSDateFormatter1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSDateFormatter1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSDateFormatter1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSDateFormatter1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSDateFormatter1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSDateFormatter1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSDateFormatter1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSDateFormatter1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSFormatter extends NSObject { + NSFormatter._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSFormatter] that points to the same underlying object as [other]. + static NSFormatter castFrom(T other) { + return NSFormatter._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSFormatter] that wraps the given raw object pointer. + static NSFormatter castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSFormatter._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSFormatter]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSFormatter1); + } + + NSString stringForObjectValue_(NSObject obj) { + final _ret = + _lib._objc_msgSend_65(_id, _lib._sel_stringForObjectValue_1, obj._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString attributedStringForObjectValue_withDefaultAttributes_( + NSObject obj, NSDictionary? attrs) { + final _ret = _lib._objc_msgSend_651( + _id, + _lib._sel_attributedStringForObjectValue_withDefaultAttributes_1, + obj._id, + attrs?._id ?? ffi.nullptr); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSString editingStringForObjectValue_(NSObject obj) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_editingStringForObjectValue_1, obj._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool getObjectValue_forString_errorDescription_( + ffi.Pointer> obj, + NSString? string, + ffi.Pointer> error) { + return _lib._objc_msgSend_652( + _id, + _lib._sel_getObjectValue_forString_errorDescription_1, + obj, + string?._id ?? ffi.nullptr, + error); + } + + bool isPartialStringValid_newEditingString_errorDescription_( + NSString? partialString, + ffi.Pointer> newString, + ffi.Pointer> error) { + return _lib._objc_msgSend_653( + _id, + _lib._sel_isPartialStringValid_newEditingString_errorDescription_1, + partialString?._id ?? ffi.nullptr, + newString, + error); + } + + bool + isPartialStringValid_proposedSelectedRange_originalString_originalSelectedRange_errorDescription_( + ffi.Pointer> partialStringPtr, + NSRangePointer proposedSelRangePtr, + NSString? origString, + NSRange origSelRange, + ffi.Pointer> error) { + return _lib._objc_msgSend_654( + _id, + _lib._sel_isPartialStringValid_proposedSelectedRange_originalString_originalSelectedRange_errorDescription_1, + partialStringPtr, + proposedSelRangePtr, + origString?._id ?? ffi.nullptr, + origSelRange, + error); + } + + static NSFormatter new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSFormatter1, _lib._sel_new1); + return NSFormatter._(_ret, _lib, retain: false, release: true); + } + + static NSFormatter alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSFormatter1, _lib._sel_alloc1); + return NSFormatter._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSFormatter1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSFormatter1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFormatter1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFormatter1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSFormatter1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSFormatter1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSFormatter1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSFormatter1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSFormatter1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSFormattingContext { + static const int NSFormattingContextUnknown = 0; + static const int NSFormattingContextDynamic = 1; + static const int NSFormattingContextStandalone = 2; + static const int NSFormattingContextListItem = 3; + static const int NSFormattingContextBeginningOfSentence = 4; + static const int NSFormattingContextMiddleOfSentence = 5; +} + +abstract class NSDateFormatterStyle { + static const int NSDateFormatterNoStyle = 0; + static const int NSDateFormatterShortStyle = 1; + static const int NSDateFormatterMediumStyle = 2; + static const int NSDateFormatterLongStyle = 3; + static const int NSDateFormatterFullStyle = 4; +} + +abstract class NSDateFormatterBehavior { + static const int NSDateFormatterBehaviorDefault = 0; + static const int NSDateFormatterBehavior10_0 = 1000; + static const int NSDateFormatterBehavior10_4 = 1040; +} + +class NSCalendar extends NSObject { + NSCalendar._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSCalendar] that points to the same underlying object as [other]. + static NSCalendar castFrom(T other) { + return NSCalendar._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSCalendar] that wraps the given raw object pointer. + static NSCalendar castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSCalendar._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSCalendar]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSCalendar1); + } + + static NSCalendar? getCurrentCalendar(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_665( + _lib._class_NSCalendar1, _lib._sel_currentCalendar1); + return _ret.address == 0 + ? null + : NSCalendar._(_ret, _lib, retain: true, release: true); + } + + static NSCalendar? getAutoupdatingCurrentCalendar(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_665( + _lib._class_NSCalendar1, _lib._sel_autoupdatingCurrentCalendar1); + return _ret.address == 0 + ? null + : NSCalendar._(_ret, _lib, retain: true, release: true); + } + + static NSCalendar calendarWithIdentifier_( + SwiftLibrary _lib, NSCalendarIdentifier calendarIdentifierConstant) { + final _ret = _lib._objc_msgSend_666(_lib._class_NSCalendar1, + _lib._sel_calendarWithIdentifier_1, calendarIdentifierConstant); + return NSCalendar._(_ret, _lib, retain: true, release: true); + } + + @override + NSCalendar init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSCalendar._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithCalendarIdentifier_(NSCalendarIdentifier ident) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithCalendarIdentifier_1, ident); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSCalendarIdentifier get calendarIdentifier { + return _lib._objc_msgSend_20(_id, _lib._sel_calendarIdentifier1); + } + + NSLocale? get locale { + final _ret = _lib._objc_msgSend_176(_id, _lib._sel_locale1); + return _ret.address == 0 + ? null + : NSLocale._(_ret, _lib, retain: true, release: true); + } + + set locale(NSLocale? value) { + _lib._objc_msgSend_664( + _id, _lib._sel_setLocale_1, value?._id ?? ffi.nullptr); + } + + NSTimeZone? get timeZone { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_timeZone1); + return _ret.address == 0 + ? null + : NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + set timeZone(NSTimeZone? value) { + _lib._objc_msgSend_163( + _id, _lib._sel_setTimeZone_1, value?._id ?? ffi.nullptr); + } + + int get firstWeekday { + return _lib._objc_msgSend_10(_id, _lib._sel_firstWeekday1); + } + + set firstWeekday(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setFirstWeekday_1, value); + } + + int get minimumDaysInFirstWeek { + return _lib._objc_msgSend_10(_id, _lib._sel_minimumDaysInFirstWeek1); + } + + set minimumDaysInFirstWeek(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setMinimumDaysInFirstWeek_1, value); + } + + NSArray? get eraSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_eraSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get longEraSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_longEraSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get monthSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_monthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get shortMonthSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_shortMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get veryShortMonthSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_veryShortMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get standaloneMonthSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_standaloneMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get shortStandaloneMonthSymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_shortStandaloneMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get veryShortStandaloneMonthSymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_veryShortStandaloneMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get weekdaySymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_weekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get shortWeekdaySymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_shortWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get veryShortWeekdaySymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_veryShortWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get standaloneWeekdaySymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_standaloneWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get shortStandaloneWeekdaySymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_shortStandaloneWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get veryShortStandaloneWeekdaySymbols { + final _ret = _lib._objc_msgSend_80( + _id, _lib._sel_veryShortStandaloneWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get quarterSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_quarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get shortQuarterSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_shortQuarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get standaloneQuarterSymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_standaloneQuarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get shortStandaloneQuarterSymbols { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_shortStandaloneQuarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get AMSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_AMSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get PMSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_PMSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSRange minimumRangeOfUnit_(int unit) { + return _lib._objc_msgSend_667(_id, _lib._sel_minimumRangeOfUnit_1, unit); + } + + NSRange maximumRangeOfUnit_(int unit) { + return _lib._objc_msgSend_667(_id, _lib._sel_maximumRangeOfUnit_1, unit); + } + + NSRange rangeOfUnit_inUnit_forDate_(int smaller, int larger, NSDate? date) { + return _lib._objc_msgSend_668(_id, _lib._sel_rangeOfUnit_inUnit_forDate_1, + smaller, larger, date?._id ?? ffi.nullptr); + } + + int ordinalityOfUnit_inUnit_forDate_(int smaller, int larger, NSDate? date) { + return _lib._objc_msgSend_669( + _id, + _lib._sel_ordinalityOfUnit_inUnit_forDate_1, + smaller, + larger, + date?._id ?? ffi.nullptr); + } + + bool rangeOfUnit_startDate_interval_forDate_( + int unit, + ffi.Pointer> datep, + ffi.Pointer tip, + NSDate? date) { + return _lib._objc_msgSend_670( + _id, + _lib._sel_rangeOfUnit_startDate_interval_forDate_1, + unit, + datep, + tip, + date?._id ?? ffi.nullptr); + } + + NSDate dateFromComponents_(NSDateComponents? comps) { + final _ret = _lib._objc_msgSend_675( + _id, _lib._sel_dateFromComponents_1, comps?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDateComponents components_fromDate_(int unitFlags, NSDate? date) { + final _ret = _lib._objc_msgSend_676(_id, _lib._sel_components_fromDate_1, + unitFlags, date?._id ?? ffi.nullptr); + return NSDateComponents._(_ret, _lib, retain: true, release: true); + } + + NSDate dateByAddingComponents_toDate_options_( + NSDateComponents? comps, NSDate? date, int opts) { + final _ret = _lib._objc_msgSend_677( + _id, + _lib._sel_dateByAddingComponents_toDate_options_1, + comps?._id ?? ffi.nullptr, + date?._id ?? ffi.nullptr, + opts); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDateComponents components_fromDate_toDate_options_( + int unitFlags, NSDate? startingDate, NSDate? resultDate, int opts) { + final _ret = _lib._objc_msgSend_678( + _id, + _lib._sel_components_fromDate_toDate_options_1, + unitFlags, + startingDate?._id ?? ffi.nullptr, + resultDate?._id ?? ffi.nullptr, + opts); + return NSDateComponents._(_ret, _lib, retain: true, release: true); + } + + void getEra_year_month_day_fromDate_( + ffi.Pointer eraValuePointer, + ffi.Pointer yearValuePointer, + ffi.Pointer monthValuePointer, + ffi.Pointer dayValuePointer, + NSDate? date) { + return _lib._objc_msgSend_679( + _id, + _lib._sel_getEra_year_month_day_fromDate_1, + eraValuePointer, + yearValuePointer, + monthValuePointer, + dayValuePointer, + date?._id ?? ffi.nullptr); + } + + void getEra_yearForWeekOfYear_weekOfYear_weekday_fromDate_( + ffi.Pointer eraValuePointer, + ffi.Pointer yearValuePointer, + ffi.Pointer weekValuePointer, + ffi.Pointer weekdayValuePointer, + NSDate? date) { + return _lib._objc_msgSend_679( + _id, + _lib._sel_getEra_yearForWeekOfYear_weekOfYear_weekday_fromDate_1, + eraValuePointer, + yearValuePointer, + weekValuePointer, + weekdayValuePointer, + date?._id ?? ffi.nullptr); + } + + void getHour_minute_second_nanosecond_fromDate_( + ffi.Pointer hourValuePointer, + ffi.Pointer minuteValuePointer, + ffi.Pointer secondValuePointer, + ffi.Pointer nanosecondValuePointer, + NSDate? date) { + return _lib._objc_msgSend_679( + _id, + _lib._sel_getHour_minute_second_nanosecond_fromDate_1, + hourValuePointer, + minuteValuePointer, + secondValuePointer, + nanosecondValuePointer, + date?._id ?? ffi.nullptr); + } + + int component_fromDate_(int unit, NSDate? date) { + return _lib._objc_msgSend_680( + _id, _lib._sel_component_fromDate_1, unit, date?._id ?? ffi.nullptr); + } + + NSDate dateWithEra_year_month_day_hour_minute_second_nanosecond_( + int eraValue, + int yearValue, + int monthValue, + int dayValue, + int hourValue, + int minuteValue, + int secondValue, + int nanosecondValue) { + final _ret = _lib._objc_msgSend_681( + _id, + _lib._sel_dateWithEra_year_month_day_hour_minute_second_nanosecond_1, + eraValue, + yearValue, + monthValue, + dayValue, + hourValue, + minuteValue, + secondValue, + nanosecondValue); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate + dateWithEra_yearForWeekOfYear_weekOfYear_weekday_hour_minute_second_nanosecond_( + int eraValue, + int yearValue, + int weekValue, + int weekdayValue, + int hourValue, + int minuteValue, + int secondValue, + int nanosecondValue) { + final _ret = _lib._objc_msgSend_681( + _id, + _lib._sel_dateWithEra_yearForWeekOfYear_weekOfYear_weekday_hour_minute_second_nanosecond_1, + eraValue, + yearValue, + weekValue, + weekdayValue, + hourValue, + minuteValue, + secondValue, + nanosecondValue); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate startOfDayForDate_(NSDate? date) { + final _ret = _lib._objc_msgSend_152( + _id, _lib._sel_startOfDayForDate_1, date?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDateComponents componentsInTimeZone_fromDate_( + NSTimeZone? timezone, NSDate? date) { + final _ret = _lib._objc_msgSend_682( + _id, + _lib._sel_componentsInTimeZone_fromDate_1, + timezone?._id ?? ffi.nullptr, + date?._id ?? ffi.nullptr); + return NSDateComponents._(_ret, _lib, retain: true, release: true); + } + + int compareDate_toDate_toUnitGranularity_( + NSDate? date1, NSDate? date2, int unit) { + return _lib._objc_msgSend_683( + _id, + _lib._sel_compareDate_toDate_toUnitGranularity_1, + date1?._id ?? ffi.nullptr, + date2?._id ?? ffi.nullptr, + unit); + } + + bool isDate_equalToDate_toUnitGranularity_( + NSDate? date1, NSDate? date2, int unit) { + return _lib._objc_msgSend_684( + _id, + _lib._sel_isDate_equalToDate_toUnitGranularity_1, + date1?._id ?? ffi.nullptr, + date2?._id ?? ffi.nullptr, + unit); + } + + bool isDate_inSameDayAsDate_(NSDate? date1, NSDate? date2) { + return _lib._objc_msgSend_685(_id, _lib._sel_isDate_inSameDayAsDate_1, + date1?._id ?? ffi.nullptr, date2?._id ?? ffi.nullptr); + } + + bool isDateInToday_(NSDate? date) { + return _lib._objc_msgSend_154( + _id, _lib._sel_isDateInToday_1, date?._id ?? ffi.nullptr); + } + + bool isDateInYesterday_(NSDate? date) { + return _lib._objc_msgSend_154( + _id, _lib._sel_isDateInYesterday_1, date?._id ?? ffi.nullptr); + } + + bool isDateInTomorrow_(NSDate? date) { + return _lib._objc_msgSend_154( + _id, _lib._sel_isDateInTomorrow_1, date?._id ?? ffi.nullptr); + } + + bool isDateInWeekend_(NSDate? date) { + return _lib._objc_msgSend_154( + _id, _lib._sel_isDateInWeekend_1, date?._id ?? ffi.nullptr); + } + + bool rangeOfWeekendStartDate_interval_containingDate_( + ffi.Pointer> datep, + ffi.Pointer tip, + NSDate? date) { + return _lib._objc_msgSend_686( + _id, + _lib._sel_rangeOfWeekendStartDate_interval_containingDate_1, + datep, + tip, + date?._id ?? ffi.nullptr); + } + + bool nextWeekendStartDate_interval_options_afterDate_( + ffi.Pointer> datep, + ffi.Pointer tip, + int options, + NSDate? date) { + return _lib._objc_msgSend_687( + _id, + _lib._sel_nextWeekendStartDate_interval_options_afterDate_1, + datep, + tip, + options, + date?._id ?? ffi.nullptr); + } + + NSDateComponents components_fromDateComponents_toDateComponents_options_( + int unitFlags, + NSDateComponents? startingDateComp, + NSDateComponents? resultDateComp, + int options) { + final _ret = _lib._objc_msgSend_688( + _id, + _lib._sel_components_fromDateComponents_toDateComponents_options_1, + unitFlags, + startingDateComp?._id ?? ffi.nullptr, + resultDateComp?._id ?? ffi.nullptr, + options); + return NSDateComponents._(_ret, _lib, retain: true, release: true); + } + + NSDate dateByAddingUnit_value_toDate_options_( + int unit, int value, NSDate? date, int options) { + final _ret = _lib._objc_msgSend_689( + _id, + _lib._sel_dateByAddingUnit_value_toDate_options_1, + unit, + value, + date?._id ?? ffi.nullptr, + options); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + void enumerateDatesStartingAfterDate_matchingComponents_options_usingBlock_( + NSDate? start, NSDateComponents? comps, int opts, ObjCBlock28 block) { + return _lib._objc_msgSend_690( + _id, + _lib._sel_enumerateDatesStartingAfterDate_matchingComponents_options_usingBlock_1, + start?._id ?? ffi.nullptr, + comps?._id ?? ffi.nullptr, + opts, + block._id); + } + + NSDate nextDateAfterDate_matchingComponents_options_( + NSDate? date, NSDateComponents? comps, int options) { + final _ret = _lib._objc_msgSend_691( + _id, + _lib._sel_nextDateAfterDate_matchingComponents_options_1, + date?._id ?? ffi.nullptr, + comps?._id ?? ffi.nullptr, + options); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate nextDateAfterDate_matchingUnit_value_options_( + NSDate? date, int unit, int value, int options) { + final _ret = _lib._objc_msgSend_692( + _id, + _lib._sel_nextDateAfterDate_matchingUnit_value_options_1, + date?._id ?? ffi.nullptr, + unit, + value, + options); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate nextDateAfterDate_matchingHour_minute_second_options_(NSDate? date, + int hourValue, int minuteValue, int secondValue, int options) { + final _ret = _lib._objc_msgSend_693( + _id, + _lib._sel_nextDateAfterDate_matchingHour_minute_second_options_1, + date?._id ?? ffi.nullptr, + hourValue, + minuteValue, + secondValue, + options); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate dateBySettingUnit_value_ofDate_options_( + int unit, int v, NSDate? date, int opts) { + final _ret = _lib._objc_msgSend_689( + _id, + _lib._sel_dateBySettingUnit_value_ofDate_options_1, + unit, + v, + date?._id ?? ffi.nullptr, + opts); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate dateBySettingHour_minute_second_ofDate_options_( + int h, int m, int s, NSDate? date, int opts) { + final _ret = _lib._objc_msgSend_694( + _id, + _lib._sel_dateBySettingHour_minute_second_ofDate_options_1, + h, + m, + s, + date?._id ?? ffi.nullptr, + opts); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + bool date_matchesComponents_(NSDate? date, NSDateComponents? components) { + return _lib._objc_msgSend_695(_id, _lib._sel_date_matchesComponents_1, + date?._id ?? ffi.nullptr, components?._id ?? ffi.nullptr); + } + + static NSCalendar new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSCalendar1, _lib._sel_new1); + return NSCalendar._(_ret, _lib, retain: false, release: true); + } + + static NSCalendar alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSCalendar1, _lib._sel_alloc1); + return NSCalendar._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSCalendar1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSCalendar1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSCalendar1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSCalendar1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSCalendar1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSCalendar1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSCalendar1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSCalendar1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSCalendar1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSCalendarIdentifier = ffi.Pointer; + +abstract class NSCalendarUnit { + static const int NSCalendarUnitEra = 2; + static const int NSCalendarUnitYear = 4; + static const int NSCalendarUnitMonth = 8; + static const int NSCalendarUnitDay = 16; + static const int NSCalendarUnitHour = 32; + static const int NSCalendarUnitMinute = 64; + static const int NSCalendarUnitSecond = 128; + static const int NSCalendarUnitWeekday = 512; + static const int NSCalendarUnitWeekdayOrdinal = 1024; + static const int NSCalendarUnitQuarter = 2048; + static const int NSCalendarUnitWeekOfMonth = 4096; + static const int NSCalendarUnitWeekOfYear = 8192; + static const int NSCalendarUnitYearForWeekOfYear = 16384; + static const int NSCalendarUnitNanosecond = 32768; + static const int NSCalendarUnitCalendar = 1048576; + static const int NSCalendarUnitTimeZone = 2097152; + static const int NSEraCalendarUnit = 2; + static const int NSYearCalendarUnit = 4; + static const int NSMonthCalendarUnit = 8; + static const int NSDayCalendarUnit = 16; + static const int NSHourCalendarUnit = 32; + static const int NSMinuteCalendarUnit = 64; + static const int NSSecondCalendarUnit = 128; + static const int NSWeekCalendarUnit = 256; + static const int NSWeekdayCalendarUnit = 512; + static const int NSWeekdayOrdinalCalendarUnit = 1024; + static const int NSQuarterCalendarUnit = 2048; + static const int NSWeekOfMonthCalendarUnit = 4096; + static const int NSWeekOfYearCalendarUnit = 8192; + static const int NSYearForWeekOfYearCalendarUnit = 16384; + static const int NSCalendarCalendarUnit = 1048576; + static const int NSTimeZoneCalendarUnit = 2097152; +} + +class NSDateComponents extends NSObject { + NSDateComponents._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSDateComponents] that points to the same underlying object as [other]. + static NSDateComponents castFrom(T other) { + return NSDateComponents._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSDateComponents] that wraps the given raw object pointer. + static NSDateComponents castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSDateComponents._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSDateComponents]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSDateComponents1); + } + + NSCalendar? get calendar { + final _ret = _lib._objc_msgSend_665(_id, _lib._sel_calendar1); + return _ret.address == 0 + ? null + : NSCalendar._(_ret, _lib, retain: true, release: true); + } + + set calendar(NSCalendar? value) { + _lib._objc_msgSend_671( + _id, _lib._sel_setCalendar_1, value?._id ?? ffi.nullptr); + } + + NSTimeZone? get timeZone { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_timeZone1); + return _ret.address == 0 + ? null + : NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + set timeZone(NSTimeZone? value) { + _lib._objc_msgSend_163( + _id, _lib._sel_setTimeZone_1, value?._id ?? ffi.nullptr); + } + + int get era { + return _lib._objc_msgSend_78(_id, _lib._sel_era1); + } + + set era(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setEra_1, value); + } + + int get year { + return _lib._objc_msgSend_78(_id, _lib._sel_year1); + } + + set year(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setYear_1, value); + } + + int get month { + return _lib._objc_msgSend_78(_id, _lib._sel_month1); + } + + set month(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setMonth_1, value); + } + + int get day { + return _lib._objc_msgSend_78(_id, _lib._sel_day1); + } + + set day(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setDay_1, value); + } + + int get hour { + return _lib._objc_msgSend_78(_id, _lib._sel_hour1); + } + + set hour(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setHour_1, value); + } + + int get minute { + return _lib._objc_msgSend_78(_id, _lib._sel_minute1); + } + + set minute(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setMinute_1, value); + } + + int get second { + return _lib._objc_msgSend_78(_id, _lib._sel_second1); + } + + set second(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setSecond_1, value); + } + + int get nanosecond { + return _lib._objc_msgSend_78(_id, _lib._sel_nanosecond1); + } + + set nanosecond(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setNanosecond_1, value); + } + + int get weekday { + return _lib._objc_msgSend_78(_id, _lib._sel_weekday1); + } + + set weekday(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setWeekday_1, value); + } + + int get weekdayOrdinal { + return _lib._objc_msgSend_78(_id, _lib._sel_weekdayOrdinal1); + } + + set weekdayOrdinal(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setWeekdayOrdinal_1, value); + } + + int get quarter { + return _lib._objc_msgSend_78(_id, _lib._sel_quarter1); + } + + set quarter(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setQuarter_1, value); + } + + int get weekOfMonth { + return _lib._objc_msgSend_78(_id, _lib._sel_weekOfMonth1); + } + + set weekOfMonth(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setWeekOfMonth_1, value); + } + + int get weekOfYear { + return _lib._objc_msgSend_78(_id, _lib._sel_weekOfYear1); + } + + set weekOfYear(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setWeekOfYear_1, value); + } + + int get yearForWeekOfYear { + return _lib._objc_msgSend_78(_id, _lib._sel_yearForWeekOfYear1); + } + + set yearForWeekOfYear(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setYearForWeekOfYear_1, value); + } + + bool get leapMonth { + return _lib._objc_msgSend_12(_id, _lib._sel_isLeapMonth1); + } + + set leapMonth(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setLeapMonth_1, value); + } + + NSDate? get date { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_date1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + int week() { + return _lib._objc_msgSend_78(_id, _lib._sel_week1); + } + + void setWeek_(int v) { + return _lib._objc_msgSend_374(_id, _lib._sel_setWeek_1, v); + } + + void setValue_forComponent_(int value, int unit) { + return _lib._objc_msgSend_672( + _id, _lib._sel_setValue_forComponent_1, value, unit); + } + + int valueForComponent_(int unit) { + return _lib._objc_msgSend_673(_id, _lib._sel_valueForComponent_1, unit); + } + + bool get validDate { + return _lib._objc_msgSend_12(_id, _lib._sel_isValidDate1); + } + + bool isValidDateInCalendar_(NSCalendar? calendar) { + return _lib._objc_msgSend_674( + _id, _lib._sel_isValidDateInCalendar_1, calendar?._id ?? ffi.nullptr); + } + + static NSDateComponents new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDateComponents1, _lib._sel_new1); + return NSDateComponents._(_ret, _lib, retain: false, release: true); + } + + static NSDateComponents alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDateComponents1, _lib._sel_alloc1); + return NSDateComponents._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSDateComponents1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSDateComponents1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSDateComponents1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSDateComponents1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSDateComponents1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSDateComponents1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSDateComponents1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSDateComponents1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSDateComponents1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSCalendarOptions { + static const int NSCalendarWrapComponents = 1; + static const int NSCalendarMatchStrictly = 2; + static const int NSCalendarSearchBackwards = 4; + static const int NSCalendarMatchPreviousTimePreservingSmallerUnits = 256; + static const int NSCalendarMatchNextTimePreservingSmallerUnits = 512; + static const int NSCalendarMatchNextTime = 1024; + static const int NSCalendarMatchFirst = 4096; + static const int NSCalendarMatchLast = 8192; +} + +void _ObjCBlock28_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, bool arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock28_closureRegistry = {}; +int _ObjCBlock28_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock28_registerClosure(Function fn) { + final id = ++_ObjCBlock28_closureRegistryIndex; + _ObjCBlock28_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock28_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { + return _ObjCBlock28_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock28 extends _ObjCBlockBase { + ObjCBlock28._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock28.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock28_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock28.fromFunction( + SwiftLibrary lib, + void Function(ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock28_closureTrampoline) + .cast(), + _ObjCBlock28_registerClosure(fn)), + lib); + void call( + ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + bool arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +class NSNumberFormatter extends NSFormatter { + NSNumberFormatter._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSNumberFormatter] that points to the same underlying object as [other]. + static NSNumberFormatter castFrom(T other) { + return NSNumberFormatter._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSNumberFormatter] that wraps the given raw object pointer. + static NSNumberFormatter castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSNumberFormatter._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSNumberFormatter]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSNumberFormatter1); + } + + int get formattingContext { + return _lib._objc_msgSend_655(_id, _lib._sel_formattingContext1); + } + + set formattingContext(int value) { + _lib._objc_msgSend_656(_id, _lib._sel_setFormattingContext_1, value); + } + + bool getObjectValue_forString_range_error_( + ffi.Pointer> obj, + NSString? string, + ffi.Pointer rangep, + ffi.Pointer> error) { + return _lib._objc_msgSend_657( + _id, + _lib._sel_getObjectValue_forString_range_error_1, + obj, + string?._id ?? ffi.nullptr, + rangep, + error); + } + + NSString stringFromNumber_(NSNumber? number) { + final _ret = _lib._objc_msgSend_697( + _id, _lib._sel_stringFromNumber_1, number?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSNumber numberFromString_(NSString? string) { + final _ret = _lib._objc_msgSend_698( + _id, _lib._sel_numberFromString_1, string?._id ?? ffi.nullptr); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSString localizedStringFromNumber_numberStyle_( + SwiftLibrary _lib, NSNumber? num, int nstyle) { + final _ret = _lib._objc_msgSend_699( + _lib._class_NSNumberFormatter1, + _lib._sel_localizedStringFromNumber_numberStyle_1, + num?._id ?? ffi.nullptr, + nstyle); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static int defaultFormatterBehavior(SwiftLibrary _lib) { + return _lib._objc_msgSend_700( + _lib._class_NSNumberFormatter1, _lib._sel_defaultFormatterBehavior1); + } + + static void setDefaultFormatterBehavior_(SwiftLibrary _lib, int behavior) { + return _lib._objc_msgSend_701(_lib._class_NSNumberFormatter1, + _lib._sel_setDefaultFormatterBehavior_1, behavior); + } + + int get numberStyle { + return _lib._objc_msgSend_702(_id, _lib._sel_numberStyle1); + } + + set numberStyle(int value) { + _lib._objc_msgSend_703(_id, _lib._sel_setNumberStyle_1, value); + } + + NSLocale? get locale { + final _ret = _lib._objc_msgSend_176(_id, _lib._sel_locale1); + return _ret.address == 0 + ? null + : NSLocale._(_ret, _lib, retain: true, release: true); + } + + set locale(NSLocale? value) { + _lib._objc_msgSend_664( + _id, _lib._sel_setLocale_1, value?._id ?? ffi.nullptr); + } + + bool get generatesDecimalNumbers { + return _lib._objc_msgSend_12(_id, _lib._sel_generatesDecimalNumbers1); + } + + set generatesDecimalNumbers(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setGeneratesDecimalNumbers_1, value); + } + + int get formatterBehavior { + return _lib._objc_msgSend_700(_id, _lib._sel_formatterBehavior1); + } + + set formatterBehavior(int value) { + _lib._objc_msgSend_704(_id, _lib._sel_setFormatterBehavior_1, value); + } + + NSString? get negativeFormat { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_negativeFormat1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set negativeFormat(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setNegativeFormat_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get textAttributesForNegativeValues { + final _ret = + _lib._objc_msgSend_164(_id, _lib._sel_textAttributesForNegativeValues1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set textAttributesForNegativeValues(NSDictionary? value) { + _lib._objc_msgSend_165(_id, _lib._sel_setTextAttributesForNegativeValues_1, + value?._id ?? ffi.nullptr); + } + + NSString? get positiveFormat { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_positiveFormat1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set positiveFormat(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPositiveFormat_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get textAttributesForPositiveValues { + final _ret = + _lib._objc_msgSend_164(_id, _lib._sel_textAttributesForPositiveValues1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set textAttributesForPositiveValues(NSDictionary? value) { + _lib._objc_msgSend_165(_id, _lib._sel_setTextAttributesForPositiveValues_1, + value?._id ?? ffi.nullptr); + } + + bool get allowsFloats { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsFloats1); + } + + set allowsFloats(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setAllowsFloats_1, value); + } + + NSString? get decimalSeparator { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_decimalSeparator1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set decimalSeparator(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setDecimalSeparator_1, value?._id ?? ffi.nullptr); + } + + bool get alwaysShowsDecimalSeparator { + return _lib._objc_msgSend_12(_id, _lib._sel_alwaysShowsDecimalSeparator1); + } + + set alwaysShowsDecimalSeparator(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setAlwaysShowsDecimalSeparator_1, value); + } + + NSString? get currencyDecimalSeparator { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_currencyDecimalSeparator1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set currencyDecimalSeparator(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setCurrencyDecimalSeparator_1, + value?._id ?? ffi.nullptr); + } + + bool get usesGroupingSeparator { + return _lib._objc_msgSend_12(_id, _lib._sel_usesGroupingSeparator1); + } + + set usesGroupingSeparator(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setUsesGroupingSeparator_1, value); + } + + NSString? get groupingSeparator { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_groupingSeparator1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set groupingSeparator(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setGroupingSeparator_1, value?._id ?? ffi.nullptr); + } + + NSString? get zeroSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_zeroSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set zeroSymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setZeroSymbol_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get textAttributesForZero { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_textAttributesForZero1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set textAttributesForZero(NSDictionary? value) { + _lib._objc_msgSend_165( + _id, _lib._sel_setTextAttributesForZero_1, value?._id ?? ffi.nullptr); + } + + NSString? get nilSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_nilSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set nilSymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setNilSymbol_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get textAttributesForNil { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_textAttributesForNil1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set textAttributesForNil(NSDictionary? value) { + _lib._objc_msgSend_165( + _id, _lib._sel_setTextAttributesForNil_1, value?._id ?? ffi.nullptr); + } + + NSString? get notANumberSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_notANumberSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set notANumberSymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setNotANumberSymbol_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get textAttributesForNotANumber { + final _ret = + _lib._objc_msgSend_164(_id, _lib._sel_textAttributesForNotANumber1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set textAttributesForNotANumber(NSDictionary? value) { + _lib._objc_msgSend_165(_id, _lib._sel_setTextAttributesForNotANumber_1, + value?._id ?? ffi.nullptr); + } + + NSString? get positiveInfinitySymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_positiveInfinitySymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set positiveInfinitySymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPositiveInfinitySymbol_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get textAttributesForPositiveInfinity { + final _ret = _lib._objc_msgSend_164( + _id, _lib._sel_textAttributesForPositiveInfinity1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set textAttributesForPositiveInfinity(NSDictionary? value) { + _lib._objc_msgSend_165( + _id, + _lib._sel_setTextAttributesForPositiveInfinity_1, + value?._id ?? ffi.nullptr); + } + + NSString? get negativeInfinitySymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_negativeInfinitySymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set negativeInfinitySymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setNegativeInfinitySymbol_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get textAttributesForNegativeInfinity { + final _ret = _lib._objc_msgSend_164( + _id, _lib._sel_textAttributesForNegativeInfinity1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set textAttributesForNegativeInfinity(NSDictionary? value) { + _lib._objc_msgSend_165( + _id, + _lib._sel_setTextAttributesForNegativeInfinity_1, + value?._id ?? ffi.nullptr); + } + + NSString? get positivePrefix { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_positivePrefix1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set positivePrefix(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPositivePrefix_1, value?._id ?? ffi.nullptr); + } + + NSString? get positiveSuffix { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_positiveSuffix1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set positiveSuffix(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPositiveSuffix_1, value?._id ?? ffi.nullptr); + } + + NSString? get negativePrefix { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_negativePrefix1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set negativePrefix(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setNegativePrefix_1, value?._id ?? ffi.nullptr); + } + + NSString? get negativeSuffix { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_negativeSuffix1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set negativeSuffix(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setNegativeSuffix_1, value?._id ?? ffi.nullptr); + } + + NSString? get currencyCode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_currencyCode1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set currencyCode(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setCurrencyCode_1, value?._id ?? ffi.nullptr); + } + + NSString? get currencySymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_currencySymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set currencySymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setCurrencySymbol_1, value?._id ?? ffi.nullptr); + } + + NSString? get internationalCurrencySymbol { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_internationalCurrencySymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set internationalCurrencySymbol(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setInternationalCurrencySymbol_1, + value?._id ?? ffi.nullptr); + } + + NSString? get percentSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_percentSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set percentSymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPercentSymbol_1, value?._id ?? ffi.nullptr); + } + + NSString? get perMillSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_perMillSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set perMillSymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPerMillSymbol_1, value?._id ?? ffi.nullptr); + } + + NSString? get minusSign { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_minusSign1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set minusSign(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setMinusSign_1, value?._id ?? ffi.nullptr); + } + + NSString? get plusSign { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_plusSign1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set plusSign(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPlusSign_1, value?._id ?? ffi.nullptr); + } + + NSString? get exponentSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_exponentSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set exponentSymbol(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setExponentSymbol_1, value?._id ?? ffi.nullptr); + } + + int get groupingSize { + return _lib._objc_msgSend_10(_id, _lib._sel_groupingSize1); + } + + set groupingSize(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setGroupingSize_1, value); + } + + int get secondaryGroupingSize { + return _lib._objc_msgSend_10(_id, _lib._sel_secondaryGroupingSize1); + } + + set secondaryGroupingSize(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setSecondaryGroupingSize_1, value); + } + + NSNumber? get multiplier { + final _ret = _lib._objc_msgSend_192(_id, _lib._sel_multiplier1); + return _ret.address == 0 + ? null + : NSNumber._(_ret, _lib, retain: true, release: true); + } + + set multiplier(NSNumber? value) { + _lib._objc_msgSend_705( + _id, _lib._sel_setMultiplier_1, value?._id ?? ffi.nullptr); + } + + int get formatWidth { + return _lib._objc_msgSend_10(_id, _lib._sel_formatWidth1); + } + + set formatWidth(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setFormatWidth_1, value); + } + + NSString? get paddingCharacter { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_paddingCharacter1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set paddingCharacter(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPaddingCharacter_1, value?._id ?? ffi.nullptr); + } + + int get paddingPosition { + return _lib._objc_msgSend_706(_id, _lib._sel_paddingPosition1); + } + + set paddingPosition(int value) { + _lib._objc_msgSend_707(_id, _lib._sel_setPaddingPosition_1, value); + } + + int get roundingMode { + return _lib._objc_msgSend_708(_id, _lib._sel_roundingMode1); + } + + set roundingMode(int value) { + _lib._objc_msgSend_709(_id, _lib._sel_setRoundingMode_1, value); + } + + NSNumber? get roundingIncrement { + final _ret = _lib._objc_msgSend_192(_id, _lib._sel_roundingIncrement1); + return _ret.address == 0 + ? null + : NSNumber._(_ret, _lib, retain: true, release: true); + } + + set roundingIncrement(NSNumber? value) { + _lib._objc_msgSend_705( + _id, _lib._sel_setRoundingIncrement_1, value?._id ?? ffi.nullptr); + } + + int get minimumIntegerDigits { + return _lib._objc_msgSend_10(_id, _lib._sel_minimumIntegerDigits1); + } + + set minimumIntegerDigits(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setMinimumIntegerDigits_1, value); + } + + int get maximumIntegerDigits { + return _lib._objc_msgSend_10(_id, _lib._sel_maximumIntegerDigits1); + } + + set maximumIntegerDigits(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setMaximumIntegerDigits_1, value); + } + + int get minimumFractionDigits { + return _lib._objc_msgSend_10(_id, _lib._sel_minimumFractionDigits1); + } + + set minimumFractionDigits(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setMinimumFractionDigits_1, value); + } + + int get maximumFractionDigits { + return _lib._objc_msgSend_10(_id, _lib._sel_maximumFractionDigits1); + } + + set maximumFractionDigits(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setMaximumFractionDigits_1, value); + } + + NSNumber? get minimum { + final _ret = _lib._objc_msgSend_192(_id, _lib._sel_minimum1); + return _ret.address == 0 + ? null + : NSNumber._(_ret, _lib, retain: true, release: true); + } + + set minimum(NSNumber? value) { + _lib._objc_msgSend_705( + _id, _lib._sel_setMinimum_1, value?._id ?? ffi.nullptr); + } + + NSNumber? get maximum { + final _ret = _lib._objc_msgSend_192(_id, _lib._sel_maximum1); + return _ret.address == 0 + ? null + : NSNumber._(_ret, _lib, retain: true, release: true); + } + + set maximum(NSNumber? value) { + _lib._objc_msgSend_705( + _id, _lib._sel_setMaximum_1, value?._id ?? ffi.nullptr); + } + + NSString? get currencyGroupingSeparator { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_currencyGroupingSeparator1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set currencyGroupingSeparator(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setCurrencyGroupingSeparator_1, + value?._id ?? ffi.nullptr); + } + + bool get lenient { + return _lib._objc_msgSend_12(_id, _lib._sel_isLenient1); + } + + set lenient(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setLenient_1, value); + } + + bool get usesSignificantDigits { + return _lib._objc_msgSend_12(_id, _lib._sel_usesSignificantDigits1); + } + + set usesSignificantDigits(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setUsesSignificantDigits_1, value); + } + + int get minimumSignificantDigits { + return _lib._objc_msgSend_10(_id, _lib._sel_minimumSignificantDigits1); + } + + set minimumSignificantDigits(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setMinimumSignificantDigits_1, value); + } + + int get maximumSignificantDigits { + return _lib._objc_msgSend_10(_id, _lib._sel_maximumSignificantDigits1); + } + + set maximumSignificantDigits(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setMaximumSignificantDigits_1, value); + } + + bool get partialStringValidationEnabled { + return _lib._objc_msgSend_12( + _id, _lib._sel_isPartialStringValidationEnabled1); + } + + set partialStringValidationEnabled(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setPartialStringValidationEnabled_1, value); + } + + bool get hasThousandSeparators { + return _lib._objc_msgSend_12(_id, _lib._sel_hasThousandSeparators1); + } + + set hasThousandSeparators(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setHasThousandSeparators_1, value); + } + + NSString? get thousandSeparator { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_thousandSeparator1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set thousandSeparator(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setThousandSeparator_1, value?._id ?? ffi.nullptr); + } + + bool get localizesFormat { + return _lib._objc_msgSend_12(_id, _lib._sel_localizesFormat1); + } + + set localizesFormat(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setLocalizesFormat_1, value); + } + + NSString? get format { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_format1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set format(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setFormat_1, value?._id ?? ffi.nullptr); + } + + NSAttributedString? get attributedStringForZero { + final _ret = + _lib._objc_msgSend_640(_id, _lib._sel_attributedStringForZero1); + return _ret.address == 0 + ? null + : NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + set attributedStringForZero(NSAttributedString? value) { + _lib._objc_msgSend_710( + _id, _lib._sel_setAttributedStringForZero_1, value?._id ?? ffi.nullptr); + } + + NSAttributedString? get attributedStringForNil { + final _ret = _lib._objc_msgSend_640(_id, _lib._sel_attributedStringForNil1); + return _ret.address == 0 + ? null + : NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + set attributedStringForNil(NSAttributedString? value) { + _lib._objc_msgSend_710( + _id, _lib._sel_setAttributedStringForNil_1, value?._id ?? ffi.nullptr); + } + + NSAttributedString? get attributedStringForNotANumber { + final _ret = + _lib._objc_msgSend_640(_id, _lib._sel_attributedStringForNotANumber1); + return _ret.address == 0 + ? null + : NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + set attributedStringForNotANumber(NSAttributedString? value) { + _lib._objc_msgSend_710(_id, _lib._sel_setAttributedStringForNotANumber_1, + value?._id ?? ffi.nullptr); + } + + NSDecimalNumberHandler? get roundingBehavior { + final _ret = _lib._objc_msgSend_711(_id, _lib._sel_roundingBehavior1); + return _ret.address == 0 + ? null + : NSDecimalNumberHandler._(_ret, _lib, retain: true, release: true); + } + + set roundingBehavior(NSDecimalNumberHandler? value) { + _lib._objc_msgSend_713( + _id, _lib._sel_setRoundingBehavior_1, value?._id ?? ffi.nullptr); + } + + static NSNumberFormatter new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSNumberFormatter1, _lib._sel_new1); + return NSNumberFormatter._(_ret, _lib, retain: false, release: true); + } + + static NSNumberFormatter alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSNumberFormatter1, _lib._sel_alloc1); + return NSNumberFormatter._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSNumberFormatter1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSNumberFormatter1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSNumberFormatter1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSNumberFormatter1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSNumberFormatter1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSNumberFormatter1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSNumberFormatter1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSNumberFormatter1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSNumberFormatter1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSNumberFormatterStyle { + static const int NSNumberFormatterNoStyle = 0; + static const int NSNumberFormatterDecimalStyle = 1; + static const int NSNumberFormatterCurrencyStyle = 2; + static const int NSNumberFormatterPercentStyle = 3; + static const int NSNumberFormatterScientificStyle = 4; + static const int NSNumberFormatterSpellOutStyle = 5; + static const int NSNumberFormatterOrdinalStyle = 6; + static const int NSNumberFormatterCurrencyISOCodeStyle = 8; + static const int NSNumberFormatterCurrencyPluralStyle = 9; + static const int NSNumberFormatterCurrencyAccountingStyle = 10; +} + +abstract class NSNumberFormatterBehavior { + static const int NSNumberFormatterBehaviorDefault = 0; + static const int NSNumberFormatterBehavior10_0 = 1000; + static const int NSNumberFormatterBehavior10_4 = 1040; +} + +abstract class NSNumberFormatterPadPosition { + static const int NSNumberFormatterPadBeforePrefix = 0; + static const int NSNumberFormatterPadAfterPrefix = 1; + static const int NSNumberFormatterPadBeforeSuffix = 2; + static const int NSNumberFormatterPadAfterSuffix = 3; +} + +abstract class NSNumberFormatterRoundingMode { + static const int NSNumberFormatterRoundCeiling = 0; + static const int NSNumberFormatterRoundFloor = 1; + static const int NSNumberFormatterRoundDown = 2; + static const int NSNumberFormatterRoundUp = 3; + static const int NSNumberFormatterRoundHalfEven = 4; + static const int NSNumberFormatterRoundHalfDown = 5; + static const int NSNumberFormatterRoundHalfUp = 6; +} + +class NSDecimalNumberHandler extends NSObject { + NSDecimalNumberHandler._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSDecimalNumberHandler] that points to the same underlying object as [other]. + static NSDecimalNumberHandler castFrom(T other) { + return NSDecimalNumberHandler._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSDecimalNumberHandler] that wraps the given raw object pointer. + static NSDecimalNumberHandler castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSDecimalNumberHandler._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSDecimalNumberHandler]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSDecimalNumberHandler1); + } + + static NSDecimalNumberHandler? getDefaultDecimalNumberHandler( + SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_711(_lib._class_NSDecimalNumberHandler1, + _lib._sel_defaultDecimalNumberHandler1); + return _ret.address == 0 + ? null + : NSDecimalNumberHandler._(_ret, _lib, retain: true, release: true); + } + + NSDecimalNumberHandler + initWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_( + int roundingMode, + int scale, + bool exact, + bool overflow, + bool underflow, + bool divideByZero) { + final _ret = _lib._objc_msgSend_712( + _id, + _lib._sel_initWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_1, + roundingMode, + scale, + exact, + overflow, + underflow, + divideByZero); + return NSDecimalNumberHandler._(_ret, _lib, retain: true, release: true); + } + + static NSDecimalNumberHandler + decimalNumberHandlerWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_( + SwiftLibrary _lib, + int roundingMode, + int scale, + bool exact, + bool overflow, + bool underflow, + bool divideByZero) { + final _ret = _lib._objc_msgSend_712( + _lib._class_NSDecimalNumberHandler1, + _lib._sel_decimalNumberHandlerWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_1, + roundingMode, + scale, + exact, + overflow, + underflow, + divideByZero); + return NSDecimalNumberHandler._(_ret, _lib, retain: true, release: true); + } + + static NSDecimalNumberHandler new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSDecimalNumberHandler1, _lib._sel_new1); + return NSDecimalNumberHandler._(_ret, _lib, retain: false, release: true); + } + + static NSDecimalNumberHandler alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSDecimalNumberHandler1, _lib._sel_alloc1); + return NSDecimalNumberHandler._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSDecimalNumberHandler1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSDecimalNumberHandler1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSDecimalNumberHandler1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSDecimalNumberHandler1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSDecimalNumberHandler1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSDecimalNumberHandler1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSDecimalNumberHandler1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSDecimalNumberHandler1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSDecimalNumberHandler1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSRoundingMode { + static const int NSRoundPlain = 0; + static const int NSRoundDown = 1; + static const int NSRoundUp = 2; + static const int NSRoundBankers = 3; +} + +class NSScanner extends NSObject { + NSScanner._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSScanner] that points to the same underlying object as [other]. + static NSScanner castFrom(T other) { + return NSScanner._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSScanner] that wraps the given raw object pointer. + static NSScanner castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSScanner._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSScanner]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSScanner1); + } + + NSString? get string { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_string1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get scanLocation { + return _lib._objc_msgSend_10(_id, _lib._sel_scanLocation1); + } + + set scanLocation(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setScanLocation_1, value); + } + + NSCharacterSet? get charactersToBeSkipped { + final _ret = _lib._objc_msgSend_168(_id, _lib._sel_charactersToBeSkipped1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + set charactersToBeSkipped(NSCharacterSet? value) { + _lib._objc_msgSend_714( + _id, _lib._sel_setCharactersToBeSkipped_1, value?._id ?? ffi.nullptr); + } + + bool get caseSensitive { + return _lib._objc_msgSend_12(_id, _lib._sel_caseSensitive1); + } + + set caseSensitive(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setCaseSensitive_1, value); + } + + NSObject get locale { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_locale1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set locale(NSObject value) { + _lib._objc_msgSend_368(_id, _lib._sel_setLocale_1, value._id); + } + + NSScanner initWithString_(NSString? string) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, string?._id ?? ffi.nullptr); + return NSScanner._(_ret, _lib, retain: true, release: true); + } + + bool scanInt_(ffi.Pointer result) { + return _lib._objc_msgSend_715(_id, _lib._sel_scanInt_1, result); + } + + bool scanInteger_(ffi.Pointer result) { + return _lib._objc_msgSend_716(_id, _lib._sel_scanInteger_1, result); + } + + bool scanLongLong_(ffi.Pointer result) { + return _lib._objc_msgSend_717(_id, _lib._sel_scanLongLong_1, result); + } + + bool scanUnsignedLongLong_(ffi.Pointer result) { + return _lib._objc_msgSend_718( + _id, _lib._sel_scanUnsignedLongLong_1, result); + } + + bool scanFloat_(ffi.Pointer result) { + return _lib._objc_msgSend_719(_id, _lib._sel_scanFloat_1, result); + } + + bool scanDouble_(ffi.Pointer result) { + return _lib._objc_msgSend_720(_id, _lib._sel_scanDouble_1, result); + } + + bool scanHexInt_(ffi.Pointer result) { + return _lib._objc_msgSend_721(_id, _lib._sel_scanHexInt_1, result); + } + + bool scanHexLongLong_(ffi.Pointer result) { + return _lib._objc_msgSend_718(_id, _lib._sel_scanHexLongLong_1, result); + } + + bool scanHexFloat_(ffi.Pointer result) { + return _lib._objc_msgSend_719(_id, _lib._sel_scanHexFloat_1, result); + } + + bool scanHexDouble_(ffi.Pointer result) { + return _lib._objc_msgSend_720(_id, _lib._sel_scanHexDouble_1, result); + } + + bool scanString_intoString_( + NSString? string, ffi.Pointer> result) { + return _lib._objc_msgSend_722(_id, _lib._sel_scanString_intoString_1, + string?._id ?? ffi.nullptr, result); + } + + bool scanCharactersFromSet_intoString_( + NSCharacterSet? set, ffi.Pointer> result) { + return _lib._objc_msgSend_723( + _id, + _lib._sel_scanCharactersFromSet_intoString_1, + set?._id ?? ffi.nullptr, + result); + } + + bool scanUpToString_intoString_( + NSString? string, ffi.Pointer> result) { + return _lib._objc_msgSend_722(_id, _lib._sel_scanUpToString_intoString_1, + string?._id ?? ffi.nullptr, result); + } + + bool scanUpToCharactersFromSet_intoString_( + NSCharacterSet? set, ffi.Pointer> result) { + return _lib._objc_msgSend_723( + _id, + _lib._sel_scanUpToCharactersFromSet_intoString_1, + set?._id ?? ffi.nullptr, + result); + } + + bool get atEnd { + return _lib._objc_msgSend_12(_id, _lib._sel_isAtEnd1); + } + + static NSScanner scannerWithString_(SwiftLibrary _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSScanner1, + _lib._sel_scannerWithString_1, string?._id ?? ffi.nullptr); + return NSScanner._(_ret, _lib, retain: true, release: true); + } + + static NSObject localizedScannerWithString_( + SwiftLibrary _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSScanner1, + _lib._sel_localizedScannerWithString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool scanDecimal_(ffi.Pointer dcm) { + return _lib._objc_msgSend_724(_id, _lib._sel_scanDecimal_1, dcm); + } + + static NSScanner new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSScanner1, _lib._sel_new1); + return NSScanner._(_ret, _lib, retain: false, release: true); + } + + static NSScanner alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSScanner1, _lib._sel_alloc1); + return NSScanner._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSScanner1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSScanner1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSScanner1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSScanner1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSScanner1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSScanner1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSScanner1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSScanner1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScanner1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSDecimal extends ffi.Opaque {} + +class NSException extends NSObject { + NSException._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSException] that points to the same underlying object as [other]. + static NSException castFrom(T other) { + return NSException._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSException] that wraps the given raw object pointer. + static NSException castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSException._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSException]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSException1); + } + + static NSException exceptionWithName_reason_userInfo_(SwiftLibrary _lib, + NSExceptionName name, NSString? reason, NSDictionary? userInfo) { + final _ret = _lib._objc_msgSend_725( + _lib._class_NSException1, + _lib._sel_exceptionWithName_reason_userInfo_1, + name, + reason?._id ?? ffi.nullptr, + userInfo?._id ?? ffi.nullptr); + return NSException._(_ret, _lib, retain: true, release: true); + } + + NSException initWithName_reason_userInfo_( + NSExceptionName aName, NSString? aReason, NSDictionary? aUserInfo) { + final _ret = _lib._objc_msgSend_551( + _id, + _lib._sel_initWithName_reason_userInfo_1, + aName, + aReason?._id ?? ffi.nullptr, + aUserInfo?._id ?? ffi.nullptr); + return NSException._(_ret, _lib, retain: true, release: true); + } + + NSExceptionName get name { + return _lib._objc_msgSend_20(_id, _lib._sel_name1); + } + + NSString? get reason { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_reason1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get userInfo { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_userInfo1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSArray? get callStackReturnAddresses { + final _ret = + _lib._objc_msgSend_80(_id, _lib._sel_callStackReturnAddresses1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get callStackSymbols { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_callStackSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + void raise() { + return _lib._objc_msgSend_1(_id, _lib._sel_raise1); + } + + static void raise_format_( + SwiftLibrary _lib, NSExceptionName name, NSString? format) { + return _lib._objc_msgSend_483(_lib._class_NSException1, + _lib._sel_raise_format_1, name, format?._id ?? ffi.nullptr); + } + + static void raise_format_arguments_(SwiftLibrary _lib, NSExceptionName name, + NSString? format, ffi.Pointer<__va_list_tag> argList) { + return _lib._objc_msgSend_726( + _lib._class_NSException1, + _lib._sel_raise_format_arguments_1, + name, + format?._id ?? ffi.nullptr, + argList); + } + + static NSException new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSException1, _lib._sel_new1); + return NSException._(_ret, _lib, retain: false, release: true); + } + + static NSException alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSException1, _lib._sel_alloc1); + return NSException._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSException1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSException1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSException1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSException1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSException1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSException1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSException1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSException1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSException1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSExceptionName = ffi.Pointer; + +class NSFileHandle extends NSObject { + NSFileHandle._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSFileHandle] that points to the same underlying object as [other]. + static NSFileHandle castFrom(T other) { + return NSFileHandle._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSFileHandle] that wraps the given raw object pointer. + static NSFileHandle castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSFileHandle._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSFileHandle]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSFileHandle1); + } + + NSData? get availableData { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_availableData1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSFileHandle initWithFileDescriptor_closeOnDealloc_(int fd, bool closeopt) { + final _ret = _lib._objc_msgSend_727( + _id, _lib._sel_initWithFileDescriptor_closeOnDealloc_1, fd, closeopt); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + NSFileHandle initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + NSData readDataToEndOfFileAndReturnError_( + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_728( + _id, _lib._sel_readDataToEndOfFileAndReturnError_1, error); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData readDataUpToLength_error_( + int length, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_729( + _id, _lib._sel_readDataUpToLength_error_1, length, error); + return NSData._(_ret, _lib, retain: true, release: true); + } + + bool writeData_error_( + NSData? data, ffi.Pointer> error) { + return _lib._objc_msgSend_730( + _id, _lib._sel_writeData_error_1, data?._id ?? ffi.nullptr, error); + } + + bool getOffset_error_(ffi.Pointer offsetInFile, + ffi.Pointer> error) { + return _lib._objc_msgSend_731( + _id, _lib._sel_getOffset_error_1, offsetInFile, error); + } + + bool seekToEndReturningOffset_error_( + ffi.Pointer offsetInFile, + ffi.Pointer> error) { + return _lib._objc_msgSend_731( + _id, _lib._sel_seekToEndReturningOffset_error_1, offsetInFile, error); + } + + bool seekToOffset_error_( + int offset, ffi.Pointer> error) { + return _lib._objc_msgSend_732( + _id, _lib._sel_seekToOffset_error_1, offset, error); + } + + bool truncateAtOffset_error_( + int offset, ffi.Pointer> error) { + return _lib._objc_msgSend_732( + _id, _lib._sel_truncateAtOffset_error_1, offset, error); + } + + bool synchronizeAndReturnError_(ffi.Pointer> error) { + return _lib._objc_msgSend_219( + _id, _lib._sel_synchronizeAndReturnError_1, error); + } + + bool closeAndReturnError_(ffi.Pointer> error) { + return _lib._objc_msgSend_219(_id, _lib._sel_closeAndReturnError_1, error); + } + + static NSFileHandle? getFileHandleWithStandardInput(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_733( + _lib._class_NSFileHandle1, _lib._sel_fileHandleWithStandardInput1); + return _ret.address == 0 + ? null + : NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle? getFileHandleWithStandardOutput(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_733( + _lib._class_NSFileHandle1, _lib._sel_fileHandleWithStandardOutput1); + return _ret.address == 0 + ? null + : NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle? getFileHandleWithStandardError(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_733( + _lib._class_NSFileHandle1, _lib._sel_fileHandleWithStandardError1); + return _ret.address == 0 + ? null + : NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle? getFileHandleWithNullDevice(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_733( + _lib._class_NSFileHandle1, _lib._sel_fileHandleWithNullDevice1); + return _ret.address == 0 + ? null + : NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle fileHandleForReadingAtPath_( + SwiftLibrary _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSFileHandle1, + _lib._sel_fileHandleForReadingAtPath_1, path?._id ?? ffi.nullptr); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle fileHandleForWritingAtPath_( + SwiftLibrary _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSFileHandle1, + _lib._sel_fileHandleForWritingAtPath_1, path?._id ?? ffi.nullptr); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle fileHandleForUpdatingAtPath_( + SwiftLibrary _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSFileHandle1, + _lib._sel_fileHandleForUpdatingAtPath_1, path?._id ?? ffi.nullptr); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle fileHandleForReadingFromURL_error_(SwiftLibrary _lib, + NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_734( + _lib._class_NSFileHandle1, + _lib._sel_fileHandleForReadingFromURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle fileHandleForWritingToURL_error_(SwiftLibrary _lib, + NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_734( + _lib._class_NSFileHandle1, + _lib._sel_fileHandleForWritingToURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle fileHandleForUpdatingURL_error_(SwiftLibrary _lib, + NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_734( + _lib._class_NSFileHandle1, + _lib._sel_fileHandleForUpdatingURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + void readInBackgroundAndNotifyForModes_(NSArray? modes) { + return _lib._objc_msgSend_412( + _id, + _lib._sel_readInBackgroundAndNotifyForModes_1, + modes?._id ?? ffi.nullptr); + } + + void readInBackgroundAndNotify() { + return _lib._objc_msgSend_1(_id, _lib._sel_readInBackgroundAndNotify1); + } + + void readToEndOfFileInBackgroundAndNotifyForModes_(NSArray? modes) { + return _lib._objc_msgSend_412( + _id, + _lib._sel_readToEndOfFileInBackgroundAndNotifyForModes_1, + modes?._id ?? ffi.nullptr); + } + + void readToEndOfFileInBackgroundAndNotify() { + return _lib._objc_msgSend_1( + _id, _lib._sel_readToEndOfFileInBackgroundAndNotify1); + } + + void acceptConnectionInBackgroundAndNotifyForModes_(NSArray? modes) { + return _lib._objc_msgSend_412( + _id, + _lib._sel_acceptConnectionInBackgroundAndNotifyForModes_1, + modes?._id ?? ffi.nullptr); + } + + void acceptConnectionInBackgroundAndNotify() { + return _lib._objc_msgSend_1( + _id, _lib._sel_acceptConnectionInBackgroundAndNotify1); + } + + void waitForDataInBackgroundAndNotifyForModes_(NSArray? modes) { + return _lib._objc_msgSend_412( + _id, + _lib._sel_waitForDataInBackgroundAndNotifyForModes_1, + modes?._id ?? ffi.nullptr); + } + + void waitForDataInBackgroundAndNotify() { + return _lib._objc_msgSend_1( + _id, _lib._sel_waitForDataInBackgroundAndNotify1); + } + + ObjCBlock29 get readabilityHandler { + final _ret = _lib._objc_msgSend_735(_id, _lib._sel_readabilityHandler1); + return ObjCBlock29._(_ret, _lib); + } + + set readabilityHandler(ObjCBlock29 value) { + _lib._objc_msgSend_736(_id, _lib._sel_setReadabilityHandler_1, value._id); + } + + ObjCBlock29 get writeabilityHandler { + final _ret = _lib._objc_msgSend_735(_id, _lib._sel_writeabilityHandler1); + return ObjCBlock29._(_ret, _lib); + } + + set writeabilityHandler(ObjCBlock29 value) { + _lib._objc_msgSend_736(_id, _lib._sel_setWriteabilityHandler_1, value._id); + } + + NSFileHandle initWithFileDescriptor_(int fd) { + final _ret = + _lib._objc_msgSend_737(_id, _lib._sel_initWithFileDescriptor_1, fd); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + int get fileDescriptor { + return _lib._objc_msgSend_213(_id, _lib._sel_fileDescriptor1); + } + + NSData readDataToEndOfFile() { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_readDataToEndOfFile1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData readDataOfLength_(int length) { + final _ret = + _lib._objc_msgSend_315(_id, _lib._sel_readDataOfLength_1, length); + return NSData._(_ret, _lib, retain: true, release: true); + } + + void writeData_(NSData? data) { + return _lib._objc_msgSend_248( + _id, _lib._sel_writeData_1, data?._id ?? ffi.nullptr); + } + + int get offsetInFile { + return _lib._objc_msgSend_148(_id, _lib._sel_offsetInFile1); + } + + int seekToEndOfFile() { + return _lib._objc_msgSend_148(_id, _lib._sel_seekToEndOfFile1); + } + + void seekToFileOffset_(int offset) { + return _lib._objc_msgSend_738(_id, _lib._sel_seekToFileOffset_1, offset); + } + + void truncateFileAtOffset_(int offset) { + return _lib._objc_msgSend_738( + _id, _lib._sel_truncateFileAtOffset_1, offset); + } + + void synchronizeFile() { + return _lib._objc_msgSend_1(_id, _lib._sel_synchronizeFile1); + } + + void closeFile() { + return _lib._objc_msgSend_1(_id, _lib._sel_closeFile1); + } + + static NSFileHandle new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSFileHandle1, _lib._sel_new1); + return NSFileHandle._(_ret, _lib, retain: false, release: true); + } + + static NSFileHandle alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSFileHandle1, _lib._sel_alloc1); + return NSFileHandle._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSFileHandle1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSFileHandle1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFileHandle1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFileHandle1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSFileHandle1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSFileHandle1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSFileHandle1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSFileHandle1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSFileHandle1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock29_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock29_closureRegistry = {}; +int _ObjCBlock29_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock29_registerClosure(Function fn) { + final id = ++_ObjCBlock29_closureRegistryIndex; + _ObjCBlock29_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock29_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return _ObjCBlock29_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock29 extends _ObjCBlockBase { + ObjCBlock29._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock29.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock29_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock29.fromFunction( + SwiftLibrary lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock29_closureTrampoline) + .cast(), + _ObjCBlock29_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_id, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +class NSHTTPCookieStorage extends NSObject { + NSHTTPCookieStorage._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSHTTPCookieStorage] that points to the same underlying object as [other]. + static NSHTTPCookieStorage castFrom(T other) { + return NSHTTPCookieStorage._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSHTTPCookieStorage] that wraps the given raw object pointer. + static NSHTTPCookieStorage castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSHTTPCookieStorage._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSHTTPCookieStorage]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSHTTPCookieStorage1); + } + + static NSHTTPCookieStorage? getSharedHTTPCookieStorage(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_739( + _lib._class_NSHTTPCookieStorage1, _lib._sel_sharedHTTPCookieStorage1); + return _ret.address == 0 + ? null + : NSHTTPCookieStorage._(_ret, _lib, retain: true, release: true); + } + + static NSHTTPCookieStorage sharedCookieStorageForGroupContainerIdentifier_( + SwiftLibrary _lib, NSString? identifier) { + final _ret = _lib._objc_msgSend_740( + _lib._class_NSHTTPCookieStorage1, + _lib._sel_sharedCookieStorageForGroupContainerIdentifier_1, + identifier?._id ?? ffi.nullptr); + return NSHTTPCookieStorage._(_ret, _lib, retain: true, release: true); + } + + NSArray? get cookies { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_cookies1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + void setCookie_(NSHTTPCookie? cookie) { + return _lib._objc_msgSend_743( + _id, _lib._sel_setCookie_1, cookie?._id ?? ffi.nullptr); + } + + void deleteCookie_(NSHTTPCookie? cookie) { + return _lib._objc_msgSend_743( + _id, _lib._sel_deleteCookie_1, cookie?._id ?? ffi.nullptr); + } + + void removeCookiesSinceDate_(NSDate? date) { + return _lib._objc_msgSend_472( + _id, _lib._sel_removeCookiesSinceDate_1, date?._id ?? ffi.nullptr); + } + + NSArray cookiesForURL_(NSURL? URL) { + final _ret = _lib._objc_msgSend_120( + _id, _lib._sel_cookiesForURL_1, URL?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void setCookies_forURL_mainDocumentURL_( + NSArray? cookies, NSURL? URL, NSURL? mainDocumentURL) { + return _lib._objc_msgSend_744( + _id, + _lib._sel_setCookies_forURL_mainDocumentURL_1, + cookies?._id ?? ffi.nullptr, + URL?._id ?? ffi.nullptr, + mainDocumentURL?._id ?? ffi.nullptr); + } + + int get cookieAcceptPolicy { + return _lib._objc_msgSend_745(_id, _lib._sel_cookieAcceptPolicy1); + } + + set cookieAcceptPolicy(int value) { + _lib._objc_msgSend_746(_id, _lib._sel_setCookieAcceptPolicy_1, value); + } + + NSArray sortedCookiesUsingDescriptors_(NSArray? sortOrder) { + final _ret = _lib._objc_msgSend_63( + _id, + _lib._sel_sortedCookiesUsingDescriptors_1, + sortOrder?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void storeCookies_forTask_(NSArray? cookies, NSURLSessionTask? task) { + return _lib._objc_msgSend_766(_id, _lib._sel_storeCookies_forTask_1, + cookies?._id ?? ffi.nullptr, task?._id ?? ffi.nullptr); + } + + void getCookiesForTask_completionHandler_( + NSURLSessionTask? task, ObjCBlock30 completionHandler) { + return _lib._objc_msgSend_767( + _id, + _lib._sel_getCookiesForTask_completionHandler_1, + task?._id ?? ffi.nullptr, + completionHandler._id); + } + + static NSHTTPCookieStorage new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSHTTPCookieStorage1, _lib._sel_new1); + return NSHTTPCookieStorage._(_ret, _lib, retain: false, release: true); + } + + static NSHTTPCookieStorage alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSHTTPCookieStorage1, _lib._sel_alloc1); + return NSHTTPCookieStorage._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSHTTPCookieStorage1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSHTTPCookieStorage1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSHTTPCookieStorage1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSHTTPCookieStorage1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSHTTPCookieStorage1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSHTTPCookieStorage1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSHTTPCookieStorage1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSHTTPCookieStorage1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSHTTPCookieStorage1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSHTTPCookie extends NSObject { + NSHTTPCookie._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSHTTPCookie] that points to the same underlying object as [other]. + static NSHTTPCookie castFrom(T other) { + return NSHTTPCookie._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSHTTPCookie] that wraps the given raw object pointer. + static NSHTTPCookie castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSHTTPCookie._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSHTTPCookie]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSHTTPCookie1); + } + + NSHTTPCookie initWithProperties_(NSDictionary? properties) { + final _ret = _lib._objc_msgSend_143( + _id, _lib._sel_initWithProperties_1, properties?._id ?? ffi.nullptr); + return NSHTTPCookie._(_ret, _lib, retain: true, release: true); + } + + static NSHTTPCookie cookieWithProperties_( + SwiftLibrary _lib, NSDictionary? properties) { + final _ret = _lib._objc_msgSend_741(_lib._class_NSHTTPCookie1, + _lib._sel_cookieWithProperties_1, properties?._id ?? ffi.nullptr); + return NSHTTPCookie._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary requestHeaderFieldsWithCookies_( + SwiftLibrary _lib, NSArray? cookies) { + final _ret = _lib._objc_msgSend_443( + _lib._class_NSHTTPCookie1, + _lib._sel_requestHeaderFieldsWithCookies_1, + cookies?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSArray cookiesWithResponseHeaderFields_forURL_( + SwiftLibrary _lib, NSDictionary? headerFields, NSURL? URL) { + final _ret = _lib._objc_msgSend_742( + _lib._class_NSHTTPCookie1, + _lib._sel_cookiesWithResponseHeaderFields_forURL_1, + headerFields?._id ?? ffi.nullptr, + URL?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get properties { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_properties1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + int get version { + return _lib._objc_msgSend_10(_id, _lib._sel_version1); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get value { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_value1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSDate? get expiresDate { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_expiresDate1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + bool get sessionOnly { + return _lib._objc_msgSend_12(_id, _lib._sel_isSessionOnly1); + } + + NSString? get domain { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_domain1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get path { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_path1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool get secure { + return _lib._objc_msgSend_12(_id, _lib._sel_isSecure1); + } + + bool get HTTPOnly { + return _lib._objc_msgSend_12(_id, _lib._sel_isHTTPOnly1); + } + + NSString? get comment { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_comment1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSURL? get commentURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_commentURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSArray? get portList { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_portList1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSHTTPCookieStringPolicy get sameSitePolicy { + return _lib._objc_msgSend_20(_id, _lib._sel_sameSitePolicy1); + } + + static NSHTTPCookie new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSHTTPCookie1, _lib._sel_new1); + return NSHTTPCookie._(_ret, _lib, retain: false, release: true); + } + + static NSHTTPCookie alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSHTTPCookie1, _lib._sel_alloc1); + return NSHTTPCookie._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSHTTPCookie1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSHTTPCookie1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSHTTPCookie1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSHTTPCookie1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSHTTPCookie1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSHTTPCookie1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSHTTPCookie1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSHTTPCookie1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSHTTPCookie1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSHTTPCookieStringPolicy = ffi.Pointer; + +abstract class NSHTTPCookieAcceptPolicy { + static const int NSHTTPCookieAcceptPolicyAlways = 0; + static const int NSHTTPCookieAcceptPolicyNever = 1; + static const int NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain = 2; +} + +class NSURLSessionTask extends NSObject { + NSURLSessionTask._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionTask] that points to the same underlying object as [other]. + static NSURLSessionTask castFrom(T other) { + return NSURLSessionTask._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionTask] that wraps the given raw object pointer. + static NSURLSessionTask castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionTask._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionTask]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionTask1); + } + + int get taskIdentifier { + return _lib._objc_msgSend_10(_id, _lib._sel_taskIdentifier1); + } + + NSURLRequest? get originalRequest { + final _ret = _lib._objc_msgSend_761(_id, _lib._sel_originalRequest1); + return _ret.address == 0 + ? null + : NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + NSURLRequest? get currentRequest { + final _ret = _lib._objc_msgSend_761(_id, _lib._sel_currentRequest1); + return _ret.address == 0 + ? null + : NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + NSURLResponse? get response { + final _ret = _lib._objc_msgSend_763(_id, _lib._sel_response1); + return _ret.address == 0 + ? null + : NSURLResponse._(_ret, _lib, retain: true, release: true); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + _lib._objc_msgSend_368( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + NSProgress? get progress { + final _ret = _lib._objc_msgSend_577(_id, _lib._sel_progress1); + return _ret.address == 0 + ? null + : NSProgress._(_ret, _lib, retain: true, release: true); + } + + NSDate? get earliestBeginDate { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_earliestBeginDate1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + set earliestBeginDate(NSDate? value) { + _lib._objc_msgSend_493( + _id, _lib._sel_setEarliestBeginDate_1, value?._id ?? ffi.nullptr); + } + + int get countOfBytesClientExpectsToSend { + return _lib._objc_msgSend_584( + _id, _lib._sel_countOfBytesClientExpectsToSend1); + } + + set countOfBytesClientExpectsToSend(int value) { + _lib._objc_msgSend_585( + _id, _lib._sel_setCountOfBytesClientExpectsToSend_1, value); + } + + int get countOfBytesClientExpectsToReceive { + return _lib._objc_msgSend_584( + _id, _lib._sel_countOfBytesClientExpectsToReceive1); + } + + set countOfBytesClientExpectsToReceive(int value) { + _lib._objc_msgSend_585( + _id, _lib._sel_setCountOfBytesClientExpectsToReceive_1, value); + } + + int get countOfBytesSent { + return _lib._objc_msgSend_584(_id, _lib._sel_countOfBytesSent1); + } + + int get countOfBytesReceived { + return _lib._objc_msgSend_584(_id, _lib._sel_countOfBytesReceived1); + } + + int get countOfBytesExpectedToSend { + return _lib._objc_msgSend_584(_id, _lib._sel_countOfBytesExpectedToSend1); + } + + int get countOfBytesExpectedToReceive { + return _lib._objc_msgSend_584( + _id, _lib._sel_countOfBytesExpectedToReceive1); + } + + NSString? get taskDescription { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_taskDescription1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set taskDescription(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setTaskDescription_1, value?._id ?? ffi.nullptr); + } + + void cancel() { + return _lib._objc_msgSend_1(_id, _lib._sel_cancel1); + } + + int get state { + return _lib._objc_msgSend_764(_id, _lib._sel_state1); + } + + NSError? get error { + final _ret = _lib._objc_msgSend_283(_id, _lib._sel_error1); + return _ret.address == 0 + ? null + : NSError._(_ret, _lib, retain: true, release: true); + } + + void suspend() { + return _lib._objc_msgSend_1(_id, _lib._sel_suspend1); + } + + void resume() { + return _lib._objc_msgSend_1(_id, _lib._sel_resume1); + } + + double get priority { + return _lib._objc_msgSend_215(_id, _lib._sel_priority1); + } + + set priority(double value) { + _lib._objc_msgSend_765(_id, _lib._sel_setPriority_1, value); + } + + bool get prefersIncrementalDelivery { + return _lib._objc_msgSend_12(_id, _lib._sel_prefersIncrementalDelivery1); + } + + set prefersIncrementalDelivery(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setPrefersIncrementalDelivery_1, value); + } + + @override + NSURLSessionTask init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionTask new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLSessionTask1, _lib._sel_new1); + return NSURLSessionTask._(_ret, _lib, retain: false, release: true); + } + + static NSURLSessionTask alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLSessionTask1, _lib._sel_alloc1); + return NSURLSessionTask._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLSessionTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLSessionTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionTask1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSessionTask1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionTask1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionTask1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLSessionTask1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLSessionTask1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionTask1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSURLRequest extends NSObject { + NSURLRequest._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLRequest] that points to the same underlying object as [other]. + static NSURLRequest castFrom(T other) { + return NSURLRequest._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSURLRequest] that wraps the given raw object pointer. + static NSURLRequest castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLRequest._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLRequest]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLRequest1); + } + + static NSURLRequest requestWithURL_(SwiftLibrary _lib, NSURL? URL) { + final _ret = _lib._objc_msgSend_226(_lib._class_NSURLRequest1, + _lib._sel_requestWithURL_1, URL?._id ?? ffi.nullptr); + return NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + static bool getSupportsSecureCoding(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLRequest1, _lib._sel_supportsSecureCoding1); + } + + static NSURLRequest requestWithURL_cachePolicy_timeoutInterval_( + SwiftLibrary _lib, NSURL? URL, int cachePolicy, double timeoutInterval) { + final _ret = _lib._objc_msgSend_747( + _lib._class_NSURLRequest1, + _lib._sel_requestWithURL_cachePolicy_timeoutInterval_1, + URL?._id ?? ffi.nullptr, + cachePolicy, + timeoutInterval); + return NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + NSURLRequest initWithURL_(NSURL? URL) { + final _ret = _lib._objc_msgSend_226( + _id, _lib._sel_initWithURL_1, URL?._id ?? ffi.nullptr); + return NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + NSURLRequest initWithURL_cachePolicy_timeoutInterval_( + NSURL? URL, int cachePolicy, double timeoutInterval) { + final _ret = _lib._objc_msgSend_747( + _id, + _lib._sel_initWithURL_cachePolicy_timeoutInterval_1, + URL?._id ?? ffi.nullptr, + cachePolicy, + timeoutInterval); + return NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + NSURL? get URL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_URL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + int get cachePolicy { + return _lib._objc_msgSend_748(_id, _lib._sel_cachePolicy1); + } + + double get timeoutInterval { + return _lib._objc_msgSend_149(_id, _lib._sel_timeoutInterval1); + } + + NSURL? get mainDocumentURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_mainDocumentURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + int get networkServiceType { + return _lib._objc_msgSend_749(_id, _lib._sel_networkServiceType1); + } + + bool get allowsCellularAccess { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsCellularAccess1); + } + + bool get allowsExpensiveNetworkAccess { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsExpensiveNetworkAccess1); + } + + bool get allowsConstrainedNetworkAccess { + return _lib._objc_msgSend_12( + _id, _lib._sel_allowsConstrainedNetworkAccess1); + } + + bool get assumesHTTP3Capable { + return _lib._objc_msgSend_12(_id, _lib._sel_assumesHTTP3Capable1); + } + + int get attribution { + return _lib._objc_msgSend_750(_id, _lib._sel_attribution1); + } + + NSString? get HTTPMethod { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_HTTPMethod1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get allHTTPHeaderFields { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_allHTTPHeaderFields1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSString valueForHTTPHeaderField_(NSString? field) { + final _ret = _lib._objc_msgSend_64( + _id, _lib._sel_valueForHTTPHeaderField_1, field?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSData? get HTTPBody { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_HTTPBody1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSInputStream? get HTTPBodyStream { + final _ret = _lib._objc_msgSend_760(_id, _lib._sel_HTTPBodyStream1); + return _ret.address == 0 + ? null + : NSInputStream._(_ret, _lib, retain: true, release: true); + } + + bool get HTTPShouldHandleCookies { + return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldHandleCookies1); + } + + bool get HTTPShouldUsePipelining { + return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldUsePipelining1); + } + + static NSURLRequest new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLRequest1, _lib._sel_new1); + return NSURLRequest._(_ret, _lib, retain: false, release: true); + } + + static NSURLRequest alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLRequest1, _lib._sel_alloc1); + return NSURLRequest._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLRequest1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLRequest1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLRequest1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLRequest1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLRequest1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLRequest1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLRequest1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSURLRequest1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLRequest1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSURLRequestCachePolicy { + static const int NSURLRequestUseProtocolCachePolicy = 0; + static const int NSURLRequestReloadIgnoringLocalCacheData = 1; + static const int NSURLRequestReloadIgnoringLocalAndRemoteCacheData = 4; + static const int NSURLRequestReloadIgnoringCacheData = 1; + static const int NSURLRequestReturnCacheDataElseLoad = 2; + static const int NSURLRequestReturnCacheDataDontLoad = 3; + static const int NSURLRequestReloadRevalidatingCacheData = 5; +} + +abstract class NSURLRequestNetworkServiceType { + static const int NSURLNetworkServiceTypeDefault = 0; + static const int NSURLNetworkServiceTypeVoIP = 1; + static const int NSURLNetworkServiceTypeVideo = 2; + static const int NSURLNetworkServiceTypeBackground = 3; + static const int NSURLNetworkServiceTypeVoice = 4; + static const int NSURLNetworkServiceTypeResponsiveData = 6; + static const int NSURLNetworkServiceTypeAVStreaming = 8; + static const int NSURLNetworkServiceTypeResponsiveAV = 9; + static const int NSURLNetworkServiceTypeCallSignaling = 11; +} + +abstract class NSURLRequestAttribution { + static const int NSURLRequestAttributionDeveloper = 0; + static const int NSURLRequestAttributionUser = 1; +} + +class NSInputStream extends NSStream { + NSInputStream._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSInputStream] that points to the same underlying object as [other]. + static NSInputStream castFrom(T other) { + return NSInputStream._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSInputStream] that wraps the given raw object pointer. + static NSInputStream castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSInputStream._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSInputStream]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSInputStream1); + } + + int read_maxLength_(ffi.Pointer buffer, int len) { + return _lib._objc_msgSend_752(_id, _lib._sel_read_maxLength_1, buffer, len); + } + + bool getBuffer_length_( + ffi.Pointer> buffer, ffi.Pointer len) { + return _lib._objc_msgSend_759( + _id, _lib._sel_getBuffer_length_1, buffer, len); + } + + bool get hasBytesAvailable { + return _lib._objc_msgSend_12(_id, _lib._sel_hasBytesAvailable1); + } + + NSInputStream initWithData_(NSData? data) { + final _ret = _lib._objc_msgSend_242( + _id, _lib._sel_initWithData_1, data?._id ?? ffi.nullptr); + return NSInputStream._(_ret, _lib, retain: true, release: true); + } + + NSInputStream initWithURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_226( + _id, _lib._sel_initWithURL_1, url?._id ?? ffi.nullptr); + return NSInputStream._(_ret, _lib, retain: true, release: true); + } + + NSInputStream initWithFileAtPath_(NSString? path) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithFileAtPath_1, path?._id ?? ffi.nullptr); + return NSInputStream._(_ret, _lib, retain: true, release: true); + } + + static NSInputStream inputStreamWithData_(SwiftLibrary _lib, NSData? data) { + final _ret = _lib._objc_msgSend_242(_lib._class_NSInputStream1, + _lib._sel_inputStreamWithData_1, data?._id ?? ffi.nullptr); + return NSInputStream._(_ret, _lib, retain: true, release: true); + } + + static NSInputStream inputStreamWithFileAtPath_( + SwiftLibrary _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSInputStream1, + _lib._sel_inputStreamWithFileAtPath_1, path?._id ?? ffi.nullptr); + return NSInputStream._(_ret, _lib, retain: true, release: true); + } + + static NSInputStream inputStreamWithURL_(SwiftLibrary _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_226(_lib._class_NSInputStream1, + _lib._sel_inputStreamWithURL_1, url?._id ?? ffi.nullptr); + return NSInputStream._(_ret, _lib, retain: true, release: true); + } + + static void getStreamsToHostWithName_port_inputStream_outputStream_( + SwiftLibrary _lib, + NSString? hostname, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + return _lib._objc_msgSend_754( + _lib._class_NSInputStream1, + _lib._sel_getStreamsToHostWithName_port_inputStream_outputStream_1, + hostname?._id ?? ffi.nullptr, + port, + inputStream, + outputStream); + } + + static void getStreamsToHost_port_inputStream_outputStream_( + SwiftLibrary _lib, + NSHost? host, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + return _lib._objc_msgSend_757( + _lib._class_NSInputStream1, + _lib._sel_getStreamsToHost_port_inputStream_outputStream_1, + host?._id ?? ffi.nullptr, + port, + inputStream, + outputStream); + } + + static void getBoundStreamsWithBufferSize_inputStream_outputStream_( + SwiftLibrary _lib, + int bufferSize, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + return _lib._objc_msgSend_758( + _lib._class_NSInputStream1, + _lib._sel_getBoundStreamsWithBufferSize_inputStream_outputStream_1, + bufferSize, + inputStream, + outputStream); + } + + static NSInputStream new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSInputStream1, _lib._sel_new1); + return NSInputStream._(_ret, _lib, retain: false, release: true); + } + + static NSInputStream alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSInputStream1, _lib._sel_alloc1); + return NSInputStream._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSInputStream1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSInputStream1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSInputStream1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSInputStream1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSInputStream1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSInputStream1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSInputStream1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSInputStream1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSInputStream1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSStream extends NSObject { + NSStream._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSStream] that points to the same underlying object as [other]. + static NSStream castFrom(T other) { + return NSStream._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSStream] that wraps the given raw object pointer. + static NSStream castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSStream._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSStream]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSStream1); + } + + void open() { + return _lib._objc_msgSend_1(_id, _lib._sel_open1); + } + + void close() { + return _lib._objc_msgSend_1(_id, _lib._sel_close1); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + _lib._objc_msgSend_368( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + NSObject propertyForKey_(NSStreamPropertyKey key) { + final _ret = _lib._objc_msgSend_30(_id, _lib._sel_propertyForKey_1, key); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool setProperty_forKey_(NSObject property, NSStreamPropertyKey key) { + return _lib._objc_msgSend_225( + _id, _lib._sel_setProperty_forKey_1, property._id, key); + } + + void scheduleInRunLoop_forMode_(NSRunLoop? aRunLoop, NSRunLoopMode mode) { + return _lib._objc_msgSend_501(_id, _lib._sel_scheduleInRunLoop_forMode_1, + aRunLoop?._id ?? ffi.nullptr, mode); + } + + void removeFromRunLoop_forMode_(NSRunLoop? aRunLoop, NSRunLoopMode mode) { + return _lib._objc_msgSend_501(_id, _lib._sel_removeFromRunLoop_forMode_1, + aRunLoop?._id ?? ffi.nullptr, mode); + } + + int get streamStatus { + return _lib._objc_msgSend_751(_id, _lib._sel_streamStatus1); + } + + NSError? get streamError { + final _ret = _lib._objc_msgSend_283(_id, _lib._sel_streamError1); + return _ret.address == 0 + ? null + : NSError._(_ret, _lib, retain: true, release: true); + } + + static void getStreamsToHostWithName_port_inputStream_outputStream_( + SwiftLibrary _lib, + NSString? hostname, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + return _lib._objc_msgSend_754( + _lib._class_NSStream1, + _lib._sel_getStreamsToHostWithName_port_inputStream_outputStream_1, + hostname?._id ?? ffi.nullptr, + port, + inputStream, + outputStream); + } + + static void getStreamsToHost_port_inputStream_outputStream_( + SwiftLibrary _lib, + NSHost? host, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + return _lib._objc_msgSend_757( + _lib._class_NSStream1, + _lib._sel_getStreamsToHost_port_inputStream_outputStream_1, + host?._id ?? ffi.nullptr, + port, + inputStream, + outputStream); + } + + static void getBoundStreamsWithBufferSize_inputStream_outputStream_( + SwiftLibrary _lib, + int bufferSize, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + return _lib._objc_msgSend_758( + _lib._class_NSStream1, + _lib._sel_getBoundStreamsWithBufferSize_inputStream_outputStream_1, + bufferSize, + inputStream, + outputStream); + } + + static NSStream new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSStream1, _lib._sel_new1); + return NSStream._(_ret, _lib, retain: false, release: true); + } + + static NSStream alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSStream1, _lib._sel_alloc1); + return NSStream._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSStream1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSStream1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSStream1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSStream1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSStream1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSStream1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSStream1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSStream1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSStream1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +typedef NSStreamPropertyKey = ffi.Pointer; + +abstract class NSStreamStatus { + static const int NSStreamStatusNotOpen = 0; + static const int NSStreamStatusOpening = 1; + static const int NSStreamStatusOpen = 2; + static const int NSStreamStatusReading = 3; + static const int NSStreamStatusWriting = 4; + static const int NSStreamStatusAtEnd = 5; + static const int NSStreamStatusClosed = 6; + static const int NSStreamStatusError = 7; +} + +class NSOutputStream extends NSStream { + NSOutputStream._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSOutputStream] that points to the same underlying object as [other]. + static NSOutputStream castFrom(T other) { + return NSOutputStream._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSOutputStream] that wraps the given raw object pointer. + static NSOutputStream castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSOutputStream._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSOutputStream]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSOutputStream1); + } + + int write_maxLength_(ffi.Pointer buffer, int len) { + return _lib._objc_msgSend_752( + _id, _lib._sel_write_maxLength_1, buffer, len); + } + + bool get hasSpaceAvailable { + return _lib._objc_msgSend_12(_id, _lib._sel_hasSpaceAvailable1); + } + + NSOutputStream initToMemory() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_initToMemory1); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + NSOutputStream initToBuffer_capacity_( + ffi.Pointer buffer, int capacity) { + final _ret = _lib._objc_msgSend_753( + _id, _lib._sel_initToBuffer_capacity_1, buffer, capacity); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + NSOutputStream initWithURL_append_(NSURL? url, bool shouldAppend) { + final _ret = _lib._objc_msgSend_231(_id, _lib._sel_initWithURL_append_1, + url?._id ?? ffi.nullptr, shouldAppend); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + NSOutputStream initToFileAtPath_append_(NSString? path, bool shouldAppend) { + final _ret = _lib._objc_msgSend_29(_id, _lib._sel_initToFileAtPath_append_1, + path?._id ?? ffi.nullptr, shouldAppend); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + static NSOutputStream outputStreamToMemory(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSOutputStream1, _lib._sel_outputStreamToMemory1); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + static NSOutputStream outputStreamToBuffer_capacity_( + SwiftLibrary _lib, ffi.Pointer buffer, int capacity) { + final _ret = _lib._objc_msgSend_753(_lib._class_NSOutputStream1, + _lib._sel_outputStreamToBuffer_capacity_1, buffer, capacity); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + static NSOutputStream outputStreamToFileAtPath_append_( + SwiftLibrary _lib, NSString? path, bool shouldAppend) { + final _ret = _lib._objc_msgSend_29( + _lib._class_NSOutputStream1, + _lib._sel_outputStreamToFileAtPath_append_1, + path?._id ?? ffi.nullptr, + shouldAppend); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + static NSOutputStream outputStreamWithURL_append_( + SwiftLibrary _lib, NSURL? url, bool shouldAppend) { + final _ret = _lib._objc_msgSend_231( + _lib._class_NSOutputStream1, + _lib._sel_outputStreamWithURL_append_1, + url?._id ?? ffi.nullptr, + shouldAppend); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + static void getStreamsToHostWithName_port_inputStream_outputStream_( + SwiftLibrary _lib, + NSString? hostname, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + return _lib._objc_msgSend_754( + _lib._class_NSOutputStream1, + _lib._sel_getStreamsToHostWithName_port_inputStream_outputStream_1, + hostname?._id ?? ffi.nullptr, + port, + inputStream, + outputStream); + } + + static void getStreamsToHost_port_inputStream_outputStream_( + SwiftLibrary _lib, + NSHost? host, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + return _lib._objc_msgSend_757( + _lib._class_NSOutputStream1, + _lib._sel_getStreamsToHost_port_inputStream_outputStream_1, + host?._id ?? ffi.nullptr, + port, + inputStream, + outputStream); + } + + static void getBoundStreamsWithBufferSize_inputStream_outputStream_( + SwiftLibrary _lib, + int bufferSize, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + return _lib._objc_msgSend_758( + _lib._class_NSOutputStream1, + _lib._sel_getBoundStreamsWithBufferSize_inputStream_outputStream_1, + bufferSize, + inputStream, + outputStream); + } + + static NSOutputStream new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOutputStream1, _lib._sel_new1); + return NSOutputStream._(_ret, _lib, retain: false, release: true); + } + + static NSOutputStream alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOutputStream1, _lib._sel_alloc1); + return NSOutputStream._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSOutputStream1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSOutputStream1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSOutputStream1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOutputStream1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSOutputStream1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSOutputStream1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSOutputStream1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSOutputStream1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSOutputStream1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSHost extends NSObject { + NSHost._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSHost] that points to the same underlying object as [other]. + static NSHost castFrom(T other) { + return NSHost._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSHost] that wraps the given raw object pointer. + static NSHost castFromPointer(SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSHost._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSHost]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSHost1); + } + + static NSHost currentHost(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSHost1, _lib._sel_currentHost1); + return NSHost._(_ret, _lib, retain: true, release: true); + } + + static NSHost hostWithName_(SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSHost1, + _lib._sel_hostWithName_1, name?._id ?? ffi.nullptr); + return NSHost._(_ret, _lib, retain: true, release: true); + } + + static NSHost hostWithAddress_(SwiftLibrary _lib, NSString? address) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSHost1, + _lib._sel_hostWithAddress_1, address?._id ?? ffi.nullptr); + return NSHost._(_ret, _lib, retain: true, release: true); + } + + bool isEqualToHost_(NSHost? aHost) { + return _lib._objc_msgSend_755( + _id, _lib._sel_isEqualToHost_1, aHost?._id ?? ffi.nullptr); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get names { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_names1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get address { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_address1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get addresses { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_addresses1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get localizedName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_localizedName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + static void setHostCacheEnabled_(SwiftLibrary _lib, bool flag) { + return _lib._objc_msgSend_756( + _lib._class_NSHost1, _lib._sel_setHostCacheEnabled_1, flag); + } + + static bool isHostCacheEnabled(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSHost1, _lib._sel_isHostCacheEnabled1); + } + + static void flushHostCache(SwiftLibrary _lib) { + return _lib._objc_msgSend_1(_lib._class_NSHost1, _lib._sel_flushHostCache1); + } + + static NSHost new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSHost1, _lib._sel_new1); + return NSHost._(_ret, _lib, retain: false, release: true); + } + + static NSHost alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSHost1, _lib._sel_alloc1); + return NSHost._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSHost1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSHost1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSHost1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSHost1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSHost1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSHost1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSHost1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSHost1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSHost1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSURLResponse extends NSObject { + NSURLResponse._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLResponse] that points to the same underlying object as [other]. + static NSURLResponse castFrom(T other) { + return NSURLResponse._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSURLResponse] that wraps the given raw object pointer. + static NSURLResponse castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLResponse._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLResponse]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLResponse1); + } + + NSURLResponse initWithURL_MIMEType_expectedContentLength_textEncodingName_( + NSURL? URL, NSString? MIMEType, int length, NSString? name) { + final _ret = _lib._objc_msgSend_762( + _id, + _lib._sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_1, + URL?._id ?? ffi.nullptr, + MIMEType?._id ?? ffi.nullptr, + length, + name?._id ?? ffi.nullptr); + return NSURLResponse._(_ret, _lib, retain: true, release: true); + } + + NSURL? get URL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_URL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSString? get MIMEType { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_MIMEType1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get expectedContentLength { + return _lib._objc_msgSend_214(_id, _lib._sel_expectedContentLength1); + } + + NSString? get textEncodingName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_textEncodingName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get suggestedFilename { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_suggestedFilename1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + static NSURLResponse new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLResponse1, _lib._sel_new1); + return NSURLResponse._(_ret, _lib, retain: false, release: true); + } + + static NSURLResponse alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLResponse1, _lib._sel_alloc1); + return NSURLResponse._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLResponse1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLResponse1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLResponse1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLResponse1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLResponse1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLResponse1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLResponse1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSURLResponse1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLResponse1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSURLSessionTaskState { + static const int NSURLSessionTaskStateRunning = 0; + static const int NSURLSessionTaskStateSuspended = 1; + static const int NSURLSessionTaskStateCanceling = 2; + static const int NSURLSessionTaskStateCompleted = 3; +} + +void _ObjCBlock30_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock30_closureRegistry = {}; +int _ObjCBlock30_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock30_registerClosure(Function fn) { + final id = ++_ObjCBlock30_closureRegistryIndex; + _ObjCBlock30_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock30_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return _ObjCBlock30_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock30 extends _ObjCBlockBase { + ObjCBlock30._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock30.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock30_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock30.fromFunction( + SwiftLibrary lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock30_closureTrampoline) + .cast(), + _ObjCBlock30_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_id, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +class NSIndexPath extends NSObject { + NSIndexPath._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSIndexPath] that points to the same underlying object as [other]. + static NSIndexPath castFrom(T other) { + return NSIndexPath._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSIndexPath] that wraps the given raw object pointer. + static NSIndexPath castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSIndexPath._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSIndexPath]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSIndexPath1); + } + + static NSIndexPath indexPathWithIndex_(SwiftLibrary _lib, int index) { + final _ret = _lib._objc_msgSend_60( + _lib._class_NSIndexPath1, _lib._sel_indexPathWithIndex_1, index); + return NSIndexPath._(_ret, _lib, retain: true, release: true); + } + + static NSIndexPath indexPathWithIndexes_length_( + SwiftLibrary _lib, ffi.Pointer indexes, int length) { + final _ret = _lib._objc_msgSend_768(_lib._class_NSIndexPath1, + _lib._sel_indexPathWithIndexes_length_1, indexes, length); + return NSIndexPath._(_ret, _lib, retain: true, release: true); + } + + NSIndexPath initWithIndexes_length_( + ffi.Pointer indexes, int length) { + final _ret = _lib._objc_msgSend_768( + _id, _lib._sel_initWithIndexes_length_1, indexes, length); + return NSIndexPath._(_ret, _lib, retain: true, release: true); + } + + NSIndexPath initWithIndex_(int index) { + final _ret = _lib._objc_msgSend_60(_id, _lib._sel_initWithIndex_1, index); + return NSIndexPath._(_ret, _lib, retain: true, release: true); + } + + NSIndexPath indexPathByAddingIndex_(int index) { + final _ret = + _lib._objc_msgSend_769(_id, _lib._sel_indexPathByAddingIndex_1, index); + return NSIndexPath._(_ret, _lib, retain: true, release: true); + } + + NSIndexPath indexPathByRemovingLastIndex() { + final _ret = + _lib._objc_msgSend_770(_id, _lib._sel_indexPathByRemovingLastIndex1); + return NSIndexPath._(_ret, _lib, retain: true, release: true); + } + + int indexAtPosition_(int position) { + return _lib._objc_msgSend_86(_id, _lib._sel_indexAtPosition_1, position); + } + + int get length { + return _lib._objc_msgSend_10(_id, _lib._sel_length1); + } + + void getIndexes_range_( + ffi.Pointer indexes, NSRange positionRange) { + return _lib._objc_msgSend_771( + _id, _lib._sel_getIndexes_range_1, indexes, positionRange); + } + + int compare_(NSIndexPath? otherObject) { + return _lib._objc_msgSend_772( + _id, _lib._sel_compare_1, otherObject?._id ?? ffi.nullptr); + } + + void getIndexes_(ffi.Pointer indexes) { + return _lib._objc_msgSend_773(_id, _lib._sel_getIndexes_1, indexes); + } + + static NSIndexPath new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSIndexPath1, _lib._sel_new1); + return NSIndexPath._(_ret, _lib, retain: false, release: true); + } + + static NSIndexPath alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSIndexPath1, _lib._sel_alloc1); + return NSIndexPath._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSIndexPath1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSIndexPath1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSIndexPath1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSIndexPath1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSIndexPath1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSIndexPath1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSIndexPath1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSIndexPath1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSIndexPath1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSInflectionRule extends NSObject { + NSInflectionRule._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSInflectionRule] that points to the same underlying object as [other]. + static NSInflectionRule castFrom(T other) { + return NSInflectionRule._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSInflectionRule] that wraps the given raw object pointer. + static NSInflectionRule castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSInflectionRule._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSInflectionRule]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSInflectionRule1); + } + + @override + NSObject init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSInflectionRule? getAutomaticRule(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_774( + _lib._class_NSInflectionRule1, _lib._sel_automaticRule1); + return _ret.address == 0 + ? null + : NSInflectionRule._(_ret, _lib, retain: true, release: true); + } + + static bool canInflectLanguage_(SwiftLibrary _lib, NSString? language) { + return _lib._objc_msgSend_59(_lib._class_NSInflectionRule1, + _lib._sel_canInflectLanguage_1, language?._id ?? ffi.nullptr); + } + + static bool getCanInflectPreferredLocalization(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSInflectionRule1, + _lib._sel_canInflectPreferredLocalization1); + } + + static NSInflectionRule new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSInflectionRule1, _lib._sel_new1); + return NSInflectionRule._(_ret, _lib, retain: false, release: true); + } + + static NSInflectionRule alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSInflectionRule1, _lib._sel_alloc1); + return NSInflectionRule._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSInflectionRule1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSInflectionRule1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSInflectionRule1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSInflectionRule1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSInflectionRule1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSInflectionRule1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSInflectionRule1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSInflectionRule1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSInflectionRule1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSMorphology extends NSObject { + NSMorphology._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMorphology] that points to the same underlying object as [other]. + static NSMorphology castFrom(T other) { + return NSMorphology._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSMorphology] that wraps the given raw object pointer. + static NSMorphology castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMorphology._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMorphology]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSMorphology1); + } + + int get grammaticalGender { + return _lib._objc_msgSend_775(_id, _lib._sel_grammaticalGender1); + } + + set grammaticalGender(int value) { + _lib._objc_msgSend_776(_id, _lib._sel_setGrammaticalGender_1, value); + } + + int get partOfSpeech { + return _lib._objc_msgSend_777(_id, _lib._sel_partOfSpeech1); + } + + set partOfSpeech(int value) { + _lib._objc_msgSend_778(_id, _lib._sel_setPartOfSpeech_1, value); + } + + int get number { + return _lib._objc_msgSend_779(_id, _lib._sel_number1); + } + + set number(int value) { + _lib._objc_msgSend_780(_id, _lib._sel_setNumber_1, value); + } + + NSMorphologyCustomPronoun customPronounForLanguage_(NSString? language) { + final _ret = _lib._objc_msgSend_781(_id, + _lib._sel_customPronounForLanguage_1, language?._id ?? ffi.nullptr); + return NSMorphologyCustomPronoun._(_ret, _lib, retain: true, release: true); + } + + bool setCustomPronoun_forLanguage_error_(NSMorphologyCustomPronoun? features, + NSString? language, ffi.Pointer> error) { + return _lib._objc_msgSend_782( + _id, + _lib._sel_setCustomPronoun_forLanguage_error_1, + features?._id ?? ffi.nullptr, + language?._id ?? ffi.nullptr, + error); + } + + bool get unspecified { + return _lib._objc_msgSend_12(_id, _lib._sel_isUnspecified1); + } + + static NSMorphology? getUserMorphology(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_783( + _lib._class_NSMorphology1, _lib._sel_userMorphology1); + return _ret.address == 0 + ? null + : NSMorphology._(_ret, _lib, retain: true, release: true); + } + + static NSMorphology new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMorphology1, _lib._sel_new1); + return NSMorphology._(_ret, _lib, retain: false, release: true); + } + + static NSMorphology alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMorphology1, _lib._sel_alloc1); + return NSMorphology._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMorphology1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMorphology1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMorphology1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMorphology1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMorphology1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMorphology1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMorphology1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSMorphology1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMorphology1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSGrammaticalGender { + static const int NSGrammaticalGenderNotSet = 0; + static const int NSGrammaticalGenderFeminine = 1; + static const int NSGrammaticalGenderMasculine = 2; + static const int NSGrammaticalGenderNeuter = 3; +} + +abstract class NSGrammaticalPartOfSpeech { + static const int NSGrammaticalPartOfSpeechNotSet = 0; + static const int NSGrammaticalPartOfSpeechDeterminer = 1; + static const int NSGrammaticalPartOfSpeechPronoun = 2; + static const int NSGrammaticalPartOfSpeechLetter = 3; + static const int NSGrammaticalPartOfSpeechAdverb = 4; + static const int NSGrammaticalPartOfSpeechParticle = 5; + static const int NSGrammaticalPartOfSpeechAdjective = 6; + static const int NSGrammaticalPartOfSpeechAdposition = 7; + static const int NSGrammaticalPartOfSpeechVerb = 8; + static const int NSGrammaticalPartOfSpeechNoun = 9; + static const int NSGrammaticalPartOfSpeechConjunction = 10; + static const int NSGrammaticalPartOfSpeechNumeral = 11; + static const int NSGrammaticalPartOfSpeechInterjection = 12; + static const int NSGrammaticalPartOfSpeechPreposition = 13; + static const int NSGrammaticalPartOfSpeechAbbreviation = 14; +} + +abstract class NSGrammaticalNumber { + static const int NSGrammaticalNumberNotSet = 0; + static const int NSGrammaticalNumberSingular = 1; + static const int NSGrammaticalNumberZero = 2; + static const int NSGrammaticalNumberPlural = 3; + static const int NSGrammaticalNumberPluralTwo = 4; + static const int NSGrammaticalNumberPluralFew = 5; + static const int NSGrammaticalNumberPluralMany = 6; +} + +class NSMorphologyCustomPronoun extends NSObject { + NSMorphologyCustomPronoun._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMorphologyCustomPronoun] that points to the same underlying object as [other]. + static NSMorphologyCustomPronoun castFrom(T other) { + return NSMorphologyCustomPronoun._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSMorphologyCustomPronoun] that wraps the given raw object pointer. + static NSMorphologyCustomPronoun castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMorphologyCustomPronoun._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMorphologyCustomPronoun]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMorphologyCustomPronoun1); + } + + static bool isSupportedForLanguage_(SwiftLibrary _lib, NSString? language) { + return _lib._objc_msgSend_59(_lib._class_NSMorphologyCustomPronoun1, + _lib._sel_isSupportedForLanguage_1, language?._id ?? ffi.nullptr); + } + + static NSArray requiredKeysForLanguage_( + SwiftLibrary _lib, NSString? language) { + final _ret = _lib._objc_msgSend_119(_lib._class_NSMorphologyCustomPronoun1, + _lib._sel_requiredKeysForLanguage_1, language?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get subjectForm { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_subjectForm1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set subjectForm(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setSubjectForm_1, value?._id ?? ffi.nullptr); + } + + NSString? get objectForm { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_objectForm1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set objectForm(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setObjectForm_1, value?._id ?? ffi.nullptr); + } + + NSString? get possessiveForm { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_possessiveForm1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set possessiveForm(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPossessiveForm_1, value?._id ?? ffi.nullptr); + } + + NSString? get possessiveAdjectiveForm { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_possessiveAdjectiveForm1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set possessiveAdjectiveForm(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPossessiveAdjectiveForm_1, value?._id ?? ffi.nullptr); + } + + NSString? get reflexiveForm { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_reflexiveForm1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set reflexiveForm(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setReflexiveForm_1, value?._id ?? ffi.nullptr); + } + + static NSMorphologyCustomPronoun new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMorphologyCustomPronoun1, _lib._sel_new1); + return NSMorphologyCustomPronoun._(_ret, _lib, + retain: false, release: true); + } + + static NSMorphologyCustomPronoun alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMorphologyCustomPronoun1, _lib._sel_alloc1); + return NSMorphologyCustomPronoun._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMorphologyCustomPronoun1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMorphologyCustomPronoun1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMorphologyCustomPronoun1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMorphologyCustomPronoun1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMorphologyCustomPronoun1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMorphologyCustomPronoun1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMorphologyCustomPronoun1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSMorphologyCustomPronoun1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSMorphologyCustomPronoun1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSOperationQueue extends NSObject { + NSOperationQueue._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSOperationQueue] that points to the same underlying object as [other]. + static NSOperationQueue castFrom(T other) { + return NSOperationQueue._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSOperationQueue] that wraps the given raw object pointer. + static NSOperationQueue castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSOperationQueue._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSOperationQueue]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSOperationQueue1); + } + + NSProgress? get progress { + final _ret = _lib._objc_msgSend_577(_id, _lib._sel_progress1); + return _ret.address == 0 + ? null + : NSProgress._(_ret, _lib, retain: true, release: true); + } + + void addOperation_(NSOperation? op) { + return _lib._objc_msgSend_784( + _id, _lib._sel_addOperation_1, op?._id ?? ffi.nullptr); + } + + void addOperations_waitUntilFinished_(NSArray? ops, bool wait) { + return _lib._objc_msgSend_787( + _id, + _lib._sel_addOperations_waitUntilFinished_1, + ops?._id ?? ffi.nullptr, + wait); + } + + void addOperationWithBlock_(ObjCBlock16 block) { + return _lib._objc_msgSend_465( + _id, _lib._sel_addOperationWithBlock_1, block._id); + } + + void addBarrierBlock_(ObjCBlock16 barrier) { + return _lib._objc_msgSend_465( + _id, _lib._sel_addBarrierBlock_1, barrier._id); + } + + int get maxConcurrentOperationCount { + return _lib._objc_msgSend_78(_id, _lib._sel_maxConcurrentOperationCount1); + } + + set maxConcurrentOperationCount(int value) { + _lib._objc_msgSend_558( + _id, _lib._sel_setMaxConcurrentOperationCount_1, value); + } + + bool get suspended { + return _lib._objc_msgSend_12(_id, _lib._sel_isSuspended1); + } + + set suspended(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setSuspended_1, value); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set name(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setName_1, value?._id ?? ffi.nullptr); + } + + int get qualityOfService { + return _lib._objc_msgSend_475(_id, _lib._sel_qualityOfService1); + } + + set qualityOfService(int value) { + _lib._objc_msgSend_476(_id, _lib._sel_setQualityOfService_1, value); + } + + dispatch_queue_t get underlyingQueue { + return _lib._objc_msgSend_788(_id, _lib._sel_underlyingQueue1); + } + + set underlyingQueue(dispatch_queue_t value) { + _lib._objc_msgSend_789(_id, _lib._sel_setUnderlyingQueue_1, value); + } + + void cancelAllOperations() { + return _lib._objc_msgSend_1(_id, _lib._sel_cancelAllOperations1); + } + + void waitUntilAllOperationsAreFinished() { + return _lib._objc_msgSend_1( + _id, _lib._sel_waitUntilAllOperationsAreFinished1); + } + + static NSOperationQueue? getCurrentQueue(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_790( + _lib._class_NSOperationQueue1, _lib._sel_currentQueue1); + return _ret.address == 0 + ? null + : NSOperationQueue._(_ret, _lib, retain: true, release: true); + } + + static NSOperationQueue? getMainQueue(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_790( + _lib._class_NSOperationQueue1, _lib._sel_mainQueue1); + return _ret.address == 0 + ? null + : NSOperationQueue._(_ret, _lib, retain: true, release: true); + } + + NSArray? get operations { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_operations1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + int get operationCount { + return _lib._objc_msgSend_10(_id, _lib._sel_operationCount1); + } + + static NSOperationQueue new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOperationQueue1, _lib._sel_new1); + return NSOperationQueue._(_ret, _lib, retain: false, release: true); + } + + static NSOperationQueue alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOperationQueue1, _lib._sel_alloc1); + return NSOperationQueue._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSOperationQueue1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSOperationQueue1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSOperationQueue1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOperationQueue1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSOperationQueue1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSOperationQueue1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSOperationQueue1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSOperationQueue1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSOperationQueue1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSOperation extends NSObject { + NSOperation._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSOperation] that points to the same underlying object as [other]. + static NSOperation castFrom(T other) { + return NSOperation._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSOperation] that wraps the given raw object pointer. + static NSOperation castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSOperation._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSOperation]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSOperation1); + } + + void start() { + return _lib._objc_msgSend_1(_id, _lib._sel_start1); + } + + void main() { + return _lib._objc_msgSend_1(_id, _lib._sel_main1); + } + + bool get cancelled { + return _lib._objc_msgSend_12(_id, _lib._sel_isCancelled1); + } + + void cancel() { + return _lib._objc_msgSend_1(_id, _lib._sel_cancel1); + } + + bool get executing { + return _lib._objc_msgSend_12(_id, _lib._sel_isExecuting1); + } + + bool get finished { + return _lib._objc_msgSend_12(_id, _lib._sel_isFinished1); + } + + bool get concurrent { + return _lib._objc_msgSend_12(_id, _lib._sel_isConcurrent1); + } + + bool get asynchronous { + return _lib._objc_msgSend_12(_id, _lib._sel_isAsynchronous1); + } + + bool get ready { + return _lib._objc_msgSend_12(_id, _lib._sel_isReady1); + } + + void addDependency_(NSOperation? op) { + return _lib._objc_msgSend_784( + _id, _lib._sel_addDependency_1, op?._id ?? ffi.nullptr); + } + + void removeDependency_(NSOperation? op) { + return _lib._objc_msgSend_784( + _id, _lib._sel_removeDependency_1, op?._id ?? ffi.nullptr); + } + + NSArray? get dependencies { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_dependencies1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + int get queuePriority { + return _lib._objc_msgSend_785(_id, _lib._sel_queuePriority1); + } + + set queuePriority(int value) { + _lib._objc_msgSend_786(_id, _lib._sel_setQueuePriority_1, value); + } + + ObjCBlock16 get completionBlock { + final _ret = _lib._objc_msgSend_586(_id, _lib._sel_completionBlock1); + return ObjCBlock16._(_ret, _lib); + } + + set completionBlock(ObjCBlock16 value) { + _lib._objc_msgSend_587(_id, _lib._sel_setCompletionBlock_1, value._id); + } + + void waitUntilFinished() { + return _lib._objc_msgSend_1(_id, _lib._sel_waitUntilFinished1); + } + + double get threadPriority { + return _lib._objc_msgSend_149(_id, _lib._sel_threadPriority1); + } + + set threadPriority(double value) { + _lib._objc_msgSend_474(_id, _lib._sel_setThreadPriority_1, value); + } + + int get qualityOfService { + return _lib._objc_msgSend_475(_id, _lib._sel_qualityOfService1); + } + + set qualityOfService(int value) { + _lib._objc_msgSend_476(_id, _lib._sel_setQualityOfService_1, value); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set name(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setName_1, value?._id ?? ffi.nullptr); + } + + static NSOperation new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSOperation1, _lib._sel_new1); + return NSOperation._(_ret, _lib, retain: false, release: true); + } + + static NSOperation alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOperation1, _lib._sel_alloc1); + return NSOperation._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSOperation1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSOperation1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOperation1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOperation1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSOperation1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSOperation1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSOperation1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSOperation1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSOperation1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSOperationQueuePriority { + static const int NSOperationQueuePriorityVeryLow = -8; + static const int NSOperationQueuePriorityLow = -4; + static const int NSOperationQueuePriorityNormal = 0; + static const int NSOperationQueuePriorityHigh = 4; + static const int NSOperationQueuePriorityVeryHigh = 8; +} + +typedef dispatch_queue_t = ffi.Pointer; + +class NSPointerArray extends NSObject { + NSPointerArray._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSPointerArray] that points to the same underlying object as [other]. + static NSPointerArray castFrom(T other) { + return NSPointerArray._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSPointerArray] that wraps the given raw object pointer. + static NSPointerArray castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSPointerArray._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSPointerArray]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSPointerArray1); + } + + NSPointerArray initWithOptions_(int options) { + final _ret = + _lib._objc_msgSend_791(_id, _lib._sel_initWithOptions_1, options); + return NSPointerArray._(_ret, _lib, retain: true, release: true); + } + + NSPointerArray initWithPointerFunctions_(NSPointerFunctions? functions) { + final _ret = _lib._objc_msgSend_805(_id, + _lib._sel_initWithPointerFunctions_1, functions?._id ?? ffi.nullptr); + return NSPointerArray._(_ret, _lib, retain: true, release: true); + } + + static NSPointerArray pointerArrayWithOptions_( + SwiftLibrary _lib, int options) { + final _ret = _lib._objc_msgSend_806(_lib._class_NSPointerArray1, + _lib._sel_pointerArrayWithOptions_1, options); + return NSPointerArray._(_ret, _lib, retain: true, release: true); + } + + static NSPointerArray pointerArrayWithPointerFunctions_( + SwiftLibrary _lib, NSPointerFunctions? functions) { + final _ret = _lib._objc_msgSend_807( + _lib._class_NSPointerArray1, + _lib._sel_pointerArrayWithPointerFunctions_1, + functions?._id ?? ffi.nullptr); + return NSPointerArray._(_ret, _lib, retain: true, release: true); + } + + NSPointerFunctions? get pointerFunctions { + final _ret = _lib._objc_msgSend_808(_id, _lib._sel_pointerFunctions1); + return _ret.address == 0 + ? null + : NSPointerFunctions._(_ret, _lib, retain: true, release: true); + } + + ffi.Pointer pointerAtIndex_(int index) { + return _lib._objc_msgSend_809(_id, _lib._sel_pointerAtIndex_1, index); + } + + void addPointer_(ffi.Pointer pointer) { + return _lib._objc_msgSend_47(_id, _lib._sel_addPointer_1, pointer); + } + + void removePointerAtIndex_(int index) { + return _lib._objc_msgSend_410(_id, _lib._sel_removePointerAtIndex_1, index); + } + + void insertPointer_atIndex_(ffi.Pointer item, int index) { + return _lib._objc_msgSend_21( + _id, _lib._sel_insertPointer_atIndex_1, item, index); + } + + void replacePointerAtIndex_withPointer_( + int index, ffi.Pointer item) { + return _lib._objc_msgSend_810( + _id, _lib._sel_replacePointerAtIndex_withPointer_1, index, item); + } + + void compact() { + return _lib._objc_msgSend_1(_id, _lib._sel_compact1); + } + + int get count { + return _lib._objc_msgSend_10(_id, _lib._sel_count1); + } + + set count(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setCount_1, value); + } + + static NSObject pointerArrayWithStrongObjects(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPointerArray1, _lib._sel_pointerArrayWithStrongObjects1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject pointerArrayWithWeakObjects(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPointerArray1, _lib._sel_pointerArrayWithWeakObjects1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSPointerArray strongObjectsPointerArray(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_811( + _lib._class_NSPointerArray1, _lib._sel_strongObjectsPointerArray1); + return NSPointerArray._(_ret, _lib, retain: true, release: true); + } + + static NSPointerArray weakObjectsPointerArray(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_811( + _lib._class_NSPointerArray1, _lib._sel_weakObjectsPointerArray1); + return NSPointerArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get allObjects { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_allObjects1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSPointerArray new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPointerArray1, _lib._sel_new1); + return NSPointerArray._(_ret, _lib, retain: false, release: true); + } + + static NSPointerArray alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPointerArray1, _lib._sel_alloc1); + return NSPointerArray._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSPointerArray1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSPointerArray1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSPointerArray1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPointerArray1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSPointerArray1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSPointerArray1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSPointerArray1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSPointerArray1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPointerArray1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSPointerFunctionsOptions { + static const int NSPointerFunctionsStrongMemory = 0; + static const int NSPointerFunctionsZeroingWeakMemory = 1; + static const int NSPointerFunctionsOpaqueMemory = 2; + static const int NSPointerFunctionsMallocMemory = 3; + static const int NSPointerFunctionsMachVirtualMemory = 4; + static const int NSPointerFunctionsWeakMemory = 5; + static const int NSPointerFunctionsObjectPersonality = 0; + static const int NSPointerFunctionsOpaquePersonality = 256; + static const int NSPointerFunctionsObjectPointerPersonality = 512; + static const int NSPointerFunctionsCStringPersonality = 768; + static const int NSPointerFunctionsStructPersonality = 1024; + static const int NSPointerFunctionsIntegerPersonality = 1280; + static const int NSPointerFunctionsCopyIn = 65536; +} + +class NSPointerFunctions extends NSObject { + NSPointerFunctions._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSPointerFunctions] that points to the same underlying object as [other]. + static NSPointerFunctions castFrom(T other) { + return NSPointerFunctions._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSPointerFunctions] that wraps the given raw object pointer. + static NSPointerFunctions castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSPointerFunctions._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSPointerFunctions]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSPointerFunctions1); + } + + NSPointerFunctions initWithOptions_(int options) { + final _ret = + _lib._objc_msgSend_791(_id, _lib._sel_initWithOptions_1, options); + return NSPointerFunctions._(_ret, _lib, retain: true, release: true); + } + + static NSPointerFunctions pointerFunctionsWithOptions_( + SwiftLibrary _lib, int options) { + final _ret = _lib._objc_msgSend_792(_lib._class_NSPointerFunctions1, + _lib._sel_pointerFunctionsWithOptions_1, options); + return NSPointerFunctions._(_ret, _lib, retain: true, release: true); + } + + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + get hashFunction { + return _lib._objc_msgSend_793(_id, _lib._sel_hashFunction1); + } + + set hashFunction( + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + value) { + _lib._objc_msgSend_794(_id, _lib._sel_setHashFunction_1, value); + } + + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + get isEqualFunction { + return _lib._objc_msgSend_795(_id, _lib._sel_isEqualFunction1); + } + + set isEqualFunction( + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + value) { + _lib._objc_msgSend_796(_id, _lib._sel_setIsEqualFunction_1, value); + } + + ffi.Pointer)>> + get sizeFunction { + return _lib._objc_msgSend_797(_id, _lib._sel_sizeFunction1); + } + + set sizeFunction( + ffi.Pointer< + ffi.NativeFunction)>> + value) { + _lib._objc_msgSend_798(_id, _lib._sel_setSizeFunction_1, value); + } + + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>> + get descriptionFunction { + return _lib._objc_msgSend_799(_id, _lib._sel_descriptionFunction1); + } + + set descriptionFunction( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>> + value) { + _lib._objc_msgSend_800(_id, _lib._sel_setDescriptionFunction_1, value); + } + + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + get relinquishFunction { + return _lib._objc_msgSend_801(_id, _lib._sel_relinquishFunction1); + } + + set relinquishFunction( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>)>> + value) { + _lib._objc_msgSend_802(_id, _lib._sel_setRelinquishFunction_1, value); + } + + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>, + ffi.Bool)>> get acquireFunction { + return _lib._objc_msgSend_803(_id, _lib._sel_acquireFunction1); + } + + set acquireFunction( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer)>>, + ffi.Bool)>> + value) { + _lib._objc_msgSend_804(_id, _lib._sel_setAcquireFunction_1, value); + } + + bool get usesStrongWriteBarrier { + return _lib._objc_msgSend_12(_id, _lib._sel_usesStrongWriteBarrier1); + } + + set usesStrongWriteBarrier(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setUsesStrongWriteBarrier_1, value); + } + + bool get usesWeakReadAndWriteBarriers { + return _lib._objc_msgSend_12(_id, _lib._sel_usesWeakReadAndWriteBarriers1); + } + + set usesWeakReadAndWriteBarriers(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setUsesWeakReadAndWriteBarriers_1, value); + } + + static NSPointerFunctions new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPointerFunctions1, _lib._sel_new1); + return NSPointerFunctions._(_ret, _lib, retain: false, release: true); + } + + static NSPointerFunctions alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPointerFunctions1, _lib._sel_alloc1); + return NSPointerFunctions._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSPointerFunctions1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSPointerFunctions1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSPointerFunctions1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPointerFunctions1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSPointerFunctions1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSPointerFunctions1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSPointerFunctions1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSPointerFunctions1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPointerFunctions1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSProcessInfo extends NSObject { + NSProcessInfo._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSProcessInfo] that points to the same underlying object as [other]. + static NSProcessInfo castFrom(T other) { + return NSProcessInfo._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSProcessInfo] that wraps the given raw object pointer. + static NSProcessInfo castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSProcessInfo._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSProcessInfo]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSProcessInfo1); + } + + static NSProcessInfo? getProcessInfo(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_812( + _lib._class_NSProcessInfo1, _lib._sel_processInfo1); + return _ret.address == 0 + ? null + : NSProcessInfo._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get environment { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_environment1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSArray? get arguments { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_arguments1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get hostName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_hostName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get processName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_processName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set processName(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setProcessName_1, value?._id ?? ffi.nullptr); + } + + int get processIdentifier { + return _lib._objc_msgSend_213(_id, _lib._sel_processIdentifier1); + } + + NSString? get globallyUniqueString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_globallyUniqueString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int operatingSystem() { + return _lib._objc_msgSend_10(_id, _lib._sel_operatingSystem1); + } + + NSString operatingSystemName() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_operatingSystemName1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get operatingSystemVersionString { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_operatingSystemVersionString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSOperatingSystemVersion get operatingSystemVersion { + return _lib._objc_msgSend_813(_id, _lib._sel_operatingSystemVersion1); + } + + int get processorCount { + return _lib._objc_msgSend_10(_id, _lib._sel_processorCount1); + } + + int get activeProcessorCount { + return _lib._objc_msgSend_10(_id, _lib._sel_activeProcessorCount1); + } + + int get physicalMemory { + return _lib._objc_msgSend_148(_id, _lib._sel_physicalMemory1); + } + + bool isOperatingSystemAtLeastVersion_(NSOperatingSystemVersion version) { + return _lib._objc_msgSend_814( + _id, _lib._sel_isOperatingSystemAtLeastVersion_1, version); + } + + double get systemUptime { + return _lib._objc_msgSend_149(_id, _lib._sel_systemUptime1); + } + + void disableSuddenTermination() { + return _lib._objc_msgSend_1(_id, _lib._sel_disableSuddenTermination1); + } + + void enableSuddenTermination() { + return _lib._objc_msgSend_1(_id, _lib._sel_enableSuddenTermination1); + } + + void disableAutomaticTermination_(NSString? reason) { + return _lib._objc_msgSend_186(_id, _lib._sel_disableAutomaticTermination_1, + reason?._id ?? ffi.nullptr); + } + + void enableAutomaticTermination_(NSString? reason) { + return _lib._objc_msgSend_186(_id, _lib._sel_enableAutomaticTermination_1, + reason?._id ?? ffi.nullptr); + } + + bool get automaticTerminationSupportEnabled { + return _lib._objc_msgSend_12( + _id, _lib._sel_automaticTerminationSupportEnabled1); + } + + set automaticTerminationSupportEnabled(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setAutomaticTerminationSupportEnabled_1, value); + } + + NSObject beginActivityWithOptions_reason_(int options, NSString? reason) { + final _ret = _lib._objc_msgSend_815( + _id, + _lib._sel_beginActivityWithOptions_reason_1, + options, + reason?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void endActivity_(NSObject? activity) { + return _lib._objc_msgSend_15( + _id, _lib._sel_endActivity_1, activity?._id ?? ffi.nullptr); + } + + void performActivityWithOptions_reason_usingBlock_( + int options, NSString? reason, ObjCBlock16 block) { + return _lib._objc_msgSend_816( + _id, + _lib._sel_performActivityWithOptions_reason_usingBlock_1, + options, + reason?._id ?? ffi.nullptr, + block._id); + } + + void performExpiringActivityWithReason_usingBlock_( + NSString? reason, ObjCBlock31 block) { + return _lib._objc_msgSend_817( + _id, + _lib._sel_performExpiringActivityWithReason_usingBlock_1, + reason?._id ?? ffi.nullptr, + block._id); + } + + NSString? get userName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_userName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get fullUserName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_fullUserName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get thermalState { + return _lib._objc_msgSend_818(_id, _lib._sel_thermalState1); + } + + bool get lowPowerModeEnabled { + return _lib._objc_msgSend_12(_id, _lib._sel_isLowPowerModeEnabled1); + } + + bool get macCatalystApp { + return _lib._objc_msgSend_12(_id, _lib._sel_isMacCatalystApp1); + } + + bool get iOSAppOnMac { + return _lib._objc_msgSend_12(_id, _lib._sel_isiOSAppOnMac1); + } + + static NSProcessInfo new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSProcessInfo1, _lib._sel_new1); + return NSProcessInfo._(_ret, _lib, retain: false, release: true); + } + + static NSProcessInfo alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSProcessInfo1, _lib._sel_alloc1); + return NSProcessInfo._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSProcessInfo1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSProcessInfo1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSProcessInfo1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSProcessInfo1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSProcessInfo1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSProcessInfo1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSProcessInfo1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSProcessInfo1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSProcessInfo1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSOperatingSystemVersion extends ffi.Struct { + @NSInteger() + external int majorVersion; + + @NSInteger() + external int minorVersion; + + @NSInteger() + external int patchVersion; +} + +abstract class NSActivityOptions { + static const int NSActivityIdleDisplaySleepDisabled = 1099511627776; + static const int NSActivityIdleSystemSleepDisabled = 1048576; + static const int NSActivitySuddenTerminationDisabled = 16384; + static const int NSActivityAutomaticTerminationDisabled = 32768; + static const int NSActivityUserInitiated = 16777215; + static const int NSActivityUserInitiatedAllowingIdleSystemSleep = 15728639; + static const int NSActivityBackground = 255; + static const int NSActivityLatencyCritical = 1095216660480; +} + +void _ObjCBlock31_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, bool arg0) { + return block.ref.target + .cast>() + .asFunction()(arg0); +} + +final _ObjCBlock31_closureRegistry = {}; +int _ObjCBlock31_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock31_registerClosure(Function fn) { + final id = ++_ObjCBlock31_closureRegistryIndex; + _ObjCBlock31_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock31_closureTrampoline(ffi.Pointer<_ObjCBlock> block, bool arg0) { + return _ObjCBlock31_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock31 extends _ObjCBlockBase { + ObjCBlock31._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock31.fromFunctionPointer(SwiftLibrary lib, + ffi.Pointer> ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Bool arg0)>(_ObjCBlock31_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock31.fromFunction(SwiftLibrary lib, void Function(bool arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Bool arg0)>(_ObjCBlock31_closureTrampoline) + .cast(), + _ObjCBlock31_registerClosure(fn)), + lib); + void call(bool arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, ffi.Bool arg0)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, bool arg0)>()(_id, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +abstract class NSProcessInfoThermalState { + static const int NSProcessInfoThermalStateNominal = 0; + static const int NSProcessInfoThermalStateFair = 1; + static const int NSProcessInfoThermalStateSerious = 2; + static const int NSProcessInfoThermalStateCritical = 3; +} + +class NSTextCheckingResult extends NSObject { + NSTextCheckingResult._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSTextCheckingResult] that points to the same underlying object as [other]. + static NSTextCheckingResult castFrom(T other) { + return NSTextCheckingResult._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSTextCheckingResult] that wraps the given raw object pointer. + static NSTextCheckingResult castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSTextCheckingResult._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSTextCheckingResult]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSTextCheckingResult1); + } + + int get resultType { + return _lib._objc_msgSend_819(_id, _lib._sel_resultType1); + } + + NSRange get range { + return _lib._objc_msgSend_49(_id, _lib._sel_range1); + } + + NSOrthography? get orthography { + final _ret = _lib._objc_msgSend_820(_id, _lib._sel_orthography1); + return _ret.address == 0 + ? null + : NSOrthography._(_ret, _lib, retain: true, release: true); + } + + NSArray? get grammarDetails { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_grammarDetails1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSDate? get date { + final _ret = _lib._objc_msgSend_156(_id, _lib._sel_date1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + NSTimeZone? get timeZone { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_timeZone1); + return _ret.address == 0 + ? null + : NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + double get duration { + return _lib._objc_msgSend_149(_id, _lib._sel_duration1); + } + + NSDictionary? get components { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_components1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSURL? get URL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_URL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSString? get replacementString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_replacementString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get alternativeStrings { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_alternativeStrings1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSRegularExpression? get regularExpression { + final _ret = _lib._objc_msgSend_832(_id, _lib._sel_regularExpression1); + return _ret.address == 0 + ? null + : NSRegularExpression._(_ret, _lib, retain: true, release: true); + } + + NSString? get phoneNumber { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_phoneNumber1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get numberOfRanges { + return _lib._objc_msgSend_10(_id, _lib._sel_numberOfRanges1); + } + + NSRange rangeAtIndex_(int idx) { + return _lib._objc_msgSend_308(_id, _lib._sel_rangeAtIndex_1, idx); + } + + NSRange rangeWithName_(NSString? name) { + return _lib._objc_msgSend_301( + _id, _lib._sel_rangeWithName_1, name?._id ?? ffi.nullptr); + } + + NSTextCheckingResult resultByAdjustingRangesWithOffset_(int offset) { + final _ret = _lib._objc_msgSend_833( + _id, _lib._sel_resultByAdjustingRangesWithOffset_1, offset); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get addressComponents { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_addressComponents1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult orthographyCheckingResultWithRange_orthography_( + SwiftLibrary _lib, NSRange range, NSOrthography? orthography) { + final _ret = _lib._objc_msgSend_834( + _lib._class_NSTextCheckingResult1, + _lib._sel_orthographyCheckingResultWithRange_orthography_1, + range, + orthography?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult spellCheckingResultWithRange_( + SwiftLibrary _lib, NSRange range) { + final _ret = _lib._objc_msgSend_835(_lib._class_NSTextCheckingResult1, + _lib._sel_spellCheckingResultWithRange_1, range); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult grammarCheckingResultWithRange_details_( + SwiftLibrary _lib, NSRange range, NSArray? details) { + final _ret = _lib._objc_msgSend_836( + _lib._class_NSTextCheckingResult1, + _lib._sel_grammarCheckingResultWithRange_details_1, + range, + details?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult dateCheckingResultWithRange_date_( + SwiftLibrary _lib, NSRange range, NSDate? date) { + final _ret = _lib._objc_msgSend_837( + _lib._class_NSTextCheckingResult1, + _lib._sel_dateCheckingResultWithRange_date_1, + range, + date?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult + dateCheckingResultWithRange_date_timeZone_duration_(SwiftLibrary _lib, + NSRange range, NSDate? date, NSTimeZone? timeZone, double duration) { + final _ret = _lib._objc_msgSend_838( + _lib._class_NSTextCheckingResult1, + _lib._sel_dateCheckingResultWithRange_date_timeZone_duration_1, + range, + date?._id ?? ffi.nullptr, + timeZone?._id ?? ffi.nullptr, + duration); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult addressCheckingResultWithRange_components_( + SwiftLibrary _lib, NSRange range, NSDictionary? components) { + final _ret = _lib._objc_msgSend_839( + _lib._class_NSTextCheckingResult1, + _lib._sel_addressCheckingResultWithRange_components_1, + range, + components?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult linkCheckingResultWithRange_URL_( + SwiftLibrary _lib, NSRange range, NSURL? url) { + final _ret = _lib._objc_msgSend_840( + _lib._class_NSTextCheckingResult1, + _lib._sel_linkCheckingResultWithRange_URL_1, + range, + url?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult quoteCheckingResultWithRange_replacementString_( + SwiftLibrary _lib, NSRange range, NSString? replacementString) { + final _ret = _lib._objc_msgSend_841( + _lib._class_NSTextCheckingResult1, + _lib._sel_quoteCheckingResultWithRange_replacementString_1, + range, + replacementString?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult dashCheckingResultWithRange_replacementString_( + SwiftLibrary _lib, NSRange range, NSString? replacementString) { + final _ret = _lib._objc_msgSend_841( + _lib._class_NSTextCheckingResult1, + _lib._sel_dashCheckingResultWithRange_replacementString_1, + range, + replacementString?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult + replacementCheckingResultWithRange_replacementString_( + SwiftLibrary _lib, NSRange range, NSString? replacementString) { + final _ret = _lib._objc_msgSend_841( + _lib._class_NSTextCheckingResult1, + _lib._sel_replacementCheckingResultWithRange_replacementString_1, + range, + replacementString?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult + correctionCheckingResultWithRange_replacementString_( + SwiftLibrary _lib, NSRange range, NSString? replacementString) { + final _ret = _lib._objc_msgSend_841( + _lib._class_NSTextCheckingResult1, + _lib._sel_correctionCheckingResultWithRange_replacementString_1, + range, + replacementString?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult + correctionCheckingResultWithRange_replacementString_alternativeStrings_( + SwiftLibrary _lib, + NSRange range, + NSString? replacementString, + NSArray? alternativeStrings) { + final _ret = _lib._objc_msgSend_842( + _lib._class_NSTextCheckingResult1, + _lib._sel_correctionCheckingResultWithRange_replacementString_alternativeStrings_1, + range, + replacementString?._id ?? ffi.nullptr, + alternativeStrings?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult + regularExpressionCheckingResultWithRanges_count_regularExpression_( + SwiftLibrary _lib, + NSRangePointer ranges, + int count, + NSRegularExpression? regularExpression) { + final _ret = _lib._objc_msgSend_843( + _lib._class_NSTextCheckingResult1, + _lib._sel_regularExpressionCheckingResultWithRanges_count_regularExpression_1, + ranges, + count, + regularExpression?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult phoneNumberCheckingResultWithRange_phoneNumber_( + SwiftLibrary _lib, NSRange range, NSString? phoneNumber) { + final _ret = _lib._objc_msgSend_841( + _lib._class_NSTextCheckingResult1, + _lib._sel_phoneNumberCheckingResultWithRange_phoneNumber_1, + range, + phoneNumber?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult + transitInformationCheckingResultWithRange_components_( + SwiftLibrary _lib, NSRange range, NSDictionary? components) { + final _ret = _lib._objc_msgSend_839( + _lib._class_NSTextCheckingResult1, + _lib._sel_transitInformationCheckingResultWithRange_components_1, + range, + components?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSTextCheckingResult1, _lib._sel_new1); + return NSTextCheckingResult._(_ret, _lib, retain: false, release: true); + } + + static NSTextCheckingResult alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSTextCheckingResult1, _lib._sel_alloc1); + return NSTextCheckingResult._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSTextCheckingResult1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSTextCheckingResult1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSTextCheckingResult1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSTextCheckingResult1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSTextCheckingResult1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSTextCheckingResult1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSTextCheckingResult1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSTextCheckingResult1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSTextCheckingResult1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSTextCheckingType { + static const int NSTextCheckingTypeOrthography = 1; + static const int NSTextCheckingTypeSpelling = 2; + static const int NSTextCheckingTypeGrammar = 4; + static const int NSTextCheckingTypeDate = 8; + static const int NSTextCheckingTypeAddress = 16; + static const int NSTextCheckingTypeLink = 32; + static const int NSTextCheckingTypeQuote = 64; + static const int NSTextCheckingTypeDash = 128; + static const int NSTextCheckingTypeReplacement = 256; + static const int NSTextCheckingTypeCorrection = 512; + static const int NSTextCheckingTypeRegularExpression = 1024; + static const int NSTextCheckingTypePhoneNumber = 2048; + static const int NSTextCheckingTypeTransitInformation = 4096; +} + +class NSRegularExpression extends NSObject { + NSRegularExpression._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSRegularExpression] that points to the same underlying object as [other]. + static NSRegularExpression castFrom(T other) { + return NSRegularExpression._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSRegularExpression] that wraps the given raw object pointer. + static NSRegularExpression castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSRegularExpression._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSRegularExpression]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSRegularExpression1); + } + + static NSRegularExpression regularExpressionWithPattern_options_error_( + SwiftLibrary _lib, + NSString? pattern, + int options, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_821( + _lib._class_NSRegularExpression1, + _lib._sel_regularExpressionWithPattern_options_error_1, + pattern?._id ?? ffi.nullptr, + options, + error); + return NSRegularExpression._(_ret, _lib, retain: true, release: true); + } + + NSRegularExpression initWithPattern_options_error_(NSString? pattern, + int options, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_822( + _id, + _lib._sel_initWithPattern_options_error_1, + pattern?._id ?? ffi.nullptr, + options, + error); + return NSRegularExpression._(_ret, _lib, retain: true, release: true); + } + + NSString? get pattern { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_pattern1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get options { + return _lib._objc_msgSend_823(_id, _lib._sel_options1); + } + + int get numberOfCaptureGroups { + return _lib._objc_msgSend_10(_id, _lib._sel_numberOfCaptureGroups1); + } + + static NSString escapedPatternForString_( + SwiftLibrary _lib, NSString? string) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSRegularExpression1, + _lib._sel_escapedPatternForString_1, string?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + void enumerateMatchesInString_options_range_usingBlock_( + NSString? string, int options, NSRange range, ObjCBlock32 block) { + return _lib._objc_msgSend_824( + _id, + _lib._sel_enumerateMatchesInString_options_range_usingBlock_1, + string?._id ?? ffi.nullptr, + options, + range, + block._id); + } + + NSArray matchesInString_options_range_( + NSString? string, int options, NSRange range) { + final _ret = _lib._objc_msgSend_825( + _id, + _lib._sel_matchesInString_options_range_1, + string?._id ?? ffi.nullptr, + options, + range); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + int numberOfMatchesInString_options_range_( + NSString? string, int options, NSRange range) { + return _lib._objc_msgSend_826( + _id, + _lib._sel_numberOfMatchesInString_options_range_1, + string?._id ?? ffi.nullptr, + options, + range); + } + + NSTextCheckingResult firstMatchInString_options_range_( + NSString? string, int options, NSRange range) { + final _ret = _lib._objc_msgSend_827( + _id, + _lib._sel_firstMatchInString_options_range_1, + string?._id ?? ffi.nullptr, + options, + range); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + NSRange rangeOfFirstMatchInString_options_range_( + NSString? string, int options, NSRange range) { + return _lib._objc_msgSend_828( + _id, + _lib._sel_rangeOfFirstMatchInString_options_range_1, + string?._id ?? ffi.nullptr, + options, + range); + } + + NSString stringByReplacingMatchesInString_options_range_withTemplate_( + NSString? string, int options, NSRange range, NSString? templ) { + final _ret = _lib._objc_msgSend_829( + _id, + _lib._sel_stringByReplacingMatchesInString_options_range_withTemplate_1, + string?._id ?? ffi.nullptr, + options, + range, + templ?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + int replaceMatchesInString_options_range_withTemplate_( + NSMutableString? string, int options, NSRange range, NSString? templ) { + return _lib._objc_msgSend_830( + _id, + _lib._sel_replaceMatchesInString_options_range_withTemplate_1, + string?._id ?? ffi.nullptr, + options, + range, + templ?._id ?? ffi.nullptr); + } + + NSString replacementStringForResult_inString_offset_template_( + NSTextCheckingResult? result, + NSString? string, + int offset, + NSString? templ) { + final _ret = _lib._objc_msgSend_831( + _id, + _lib._sel_replacementStringForResult_inString_offset_template_1, + result?._id ?? ffi.nullptr, + string?._id ?? ffi.nullptr, + offset, + templ?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString escapedTemplateForString_( + SwiftLibrary _lib, NSString? string) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSRegularExpression1, + _lib._sel_escapedTemplateForString_1, string?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSRegularExpression new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSRegularExpression1, _lib._sel_new1); + return NSRegularExpression._(_ret, _lib, retain: false, release: true); + } + + static NSRegularExpression alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSRegularExpression1, _lib._sel_alloc1); + return NSRegularExpression._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSRegularExpression1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSRegularExpression1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSRegularExpression1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSRegularExpression1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSRegularExpression1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSRegularExpression1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSRegularExpression1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSRegularExpression1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSRegularExpression1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSRegularExpressionOptions { + static const int NSRegularExpressionCaseInsensitive = 1; + static const int NSRegularExpressionAllowCommentsAndWhitespace = 2; + static const int NSRegularExpressionIgnoreMetacharacters = 4; + static const int NSRegularExpressionDotMatchesLineSeparators = 8; + static const int NSRegularExpressionAnchorsMatchLines = 16; + static const int NSRegularExpressionUseUnixLineSeparators = 32; + static const int NSRegularExpressionUseUnicodeWordBoundaries = 64; +} + +abstract class NSMatchingOptions { + static const int NSMatchingReportProgress = 1; + static const int NSMatchingReportCompletion = 2; + static const int NSMatchingAnchored = 4; + static const int NSMatchingWithTransparentBounds = 8; + static const int NSMatchingWithoutAnchoringBounds = 16; +} + +void _ObjCBlock32_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Int32 arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock32_closureRegistry = {}; +int _ObjCBlock32_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock32_registerClosure(Function fn) { + final id = ++_ObjCBlock32_closureRegistryIndex; + _ObjCBlock32_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock32_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return _ObjCBlock32_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock32 extends _ObjCBlockBase { + ObjCBlock32._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock32.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Int32 arg1, ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Pointer arg2)>( + _ObjCBlock32_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock32.fromFunction( + SwiftLibrary lib, + void Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Pointer arg2)>( + _ObjCBlock32_closureTrampoline) + .cast(), + _ObjCBlock32_registerClosure(fn)), + lib); + void call( + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +abstract class NSMatchingFlags { + static const int NSMatchingProgress = 1; + static const int NSMatchingCompleted = 2; + static const int NSMatchingHitEnd = 4; + static const int NSMatchingRequiredEnd = 8; + static const int NSMatchingInternalError = 16; +} + +class NSURLCache extends NSObject { + NSURLCache._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLCache] that points to the same underlying object as [other]. + static NSURLCache castFrom(T other) { + return NSURLCache._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSURLCache] that wraps the given raw object pointer. + static NSURLCache castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLCache._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLCache]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLCache1); + } + + static NSURLCache? getSharedURLCache(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_844( + _lib._class_NSURLCache1, _lib._sel_sharedURLCache1); + return _ret.address == 0 + ? null + : NSURLCache._(_ret, _lib, retain: true, release: true); + } + + static void setSharedURLCache(SwiftLibrary _lib, NSURLCache? value) { + _lib._objc_msgSend_845(_lib._class_NSURLCache1, + _lib._sel_setSharedURLCache_1, value?._id ?? ffi.nullptr); + } + + NSURLCache initWithMemoryCapacity_diskCapacity_diskPath_( + int memoryCapacity, int diskCapacity, NSString? path) { + final _ret = _lib._objc_msgSend_846( + _id, + _lib._sel_initWithMemoryCapacity_diskCapacity_diskPath_1, + memoryCapacity, + diskCapacity, + path?._id ?? ffi.nullptr); + return NSURLCache._(_ret, _lib, retain: true, release: true); + } + + NSURLCache initWithMemoryCapacity_diskCapacity_directoryURL_( + int memoryCapacity, int diskCapacity, NSURL? directoryURL) { + final _ret = _lib._objc_msgSend_847( + _id, + _lib._sel_initWithMemoryCapacity_diskCapacity_directoryURL_1, + memoryCapacity, + diskCapacity, + directoryURL?._id ?? ffi.nullptr); + return NSURLCache._(_ret, _lib, retain: true, release: true); + } + + NSCachedURLResponse cachedResponseForRequest_(NSURLRequest? request) { + final _ret = _lib._objc_msgSend_851( + _id, _lib._sel_cachedResponseForRequest_1, request?._id ?? ffi.nullptr); + return NSCachedURLResponse._(_ret, _lib, retain: true, release: true); + } + + void storeCachedResponse_forRequest_( + NSCachedURLResponse? cachedResponse, NSURLRequest? request) { + return _lib._objc_msgSend_852( + _id, + _lib._sel_storeCachedResponse_forRequest_1, + cachedResponse?._id ?? ffi.nullptr, + request?._id ?? ffi.nullptr); + } + + void removeCachedResponseForRequest_(NSURLRequest? request) { + return _lib._objc_msgSend_853( + _id, + _lib._sel_removeCachedResponseForRequest_1, + request?._id ?? ffi.nullptr); + } + + void removeAllCachedResponses() { + return _lib._objc_msgSend_1(_id, _lib._sel_removeAllCachedResponses1); + } + + void removeCachedResponsesSinceDate_(NSDate? date) { + return _lib._objc_msgSend_472(_id, + _lib._sel_removeCachedResponsesSinceDate_1, date?._id ?? ffi.nullptr); + } + + int get memoryCapacity { + return _lib._objc_msgSend_10(_id, _lib._sel_memoryCapacity1); + } + + set memoryCapacity(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setMemoryCapacity_1, value); + } + + int get diskCapacity { + return _lib._objc_msgSend_10(_id, _lib._sel_diskCapacity1); + } + + set diskCapacity(int value) { + _lib._objc_msgSend_451(_id, _lib._sel_setDiskCapacity_1, value); + } + + int get currentMemoryUsage { + return _lib._objc_msgSend_10(_id, _lib._sel_currentMemoryUsage1); + } + + int get currentDiskUsage { + return _lib._objc_msgSend_10(_id, _lib._sel_currentDiskUsage1); + } + + void storeCachedResponse_forDataTask_( + NSCachedURLResponse? cachedResponse, NSURLSessionDataTask? dataTask) { + return _lib._objc_msgSend_854( + _id, + _lib._sel_storeCachedResponse_forDataTask_1, + cachedResponse?._id ?? ffi.nullptr, + dataTask?._id ?? ffi.nullptr); + } + + void getCachedResponseForDataTask_completionHandler_( + NSURLSessionDataTask? dataTask, ObjCBlock33 completionHandler) { + return _lib._objc_msgSend_855( + _id, + _lib._sel_getCachedResponseForDataTask_completionHandler_1, + dataTask?._id ?? ffi.nullptr, + completionHandler._id); + } + + void removeCachedResponseForDataTask_(NSURLSessionDataTask? dataTask) { + return _lib._objc_msgSend_856( + _id, + _lib._sel_removeCachedResponseForDataTask_1, + dataTask?._id ?? ffi.nullptr); + } + + static NSURLCache new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLCache1, _lib._sel_new1); + return NSURLCache._(_ret, _lib, retain: false, release: true); + } + + static NSURLCache alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLCache1, _lib._sel_alloc1); + return NSURLCache._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLCache1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLCache1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLCache1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLCache1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLCache1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLCache1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLCache1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSURLCache1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLCache1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSCachedURLResponse extends NSObject { + NSCachedURLResponse._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSCachedURLResponse] that points to the same underlying object as [other]. + static NSCachedURLResponse castFrom(T other) { + return NSCachedURLResponse._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSCachedURLResponse] that wraps the given raw object pointer. + static NSCachedURLResponse castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSCachedURLResponse._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSCachedURLResponse]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSCachedURLResponse1); + } + + NSCachedURLResponse initWithResponse_data_( + NSURLResponse? response, NSData? data) { + final _ret = _lib._objc_msgSend_848(_id, _lib._sel_initWithResponse_data_1, + response?._id ?? ffi.nullptr, data?._id ?? ffi.nullptr); + return NSCachedURLResponse._(_ret, _lib, retain: true, release: true); + } + + NSCachedURLResponse initWithResponse_data_userInfo_storagePolicy_( + NSURLResponse? response, + NSData? data, + NSDictionary? userInfo, + int storagePolicy) { + final _ret = _lib._objc_msgSend_849( + _id, + _lib._sel_initWithResponse_data_userInfo_storagePolicy_1, + response?._id ?? ffi.nullptr, + data?._id ?? ffi.nullptr, + userInfo?._id ?? ffi.nullptr, + storagePolicy); + return NSCachedURLResponse._(_ret, _lib, retain: true, release: true); + } + + NSURLResponse? get response { + final _ret = _lib._objc_msgSend_763(_id, _lib._sel_response1); + return _ret.address == 0 + ? null + : NSURLResponse._(_ret, _lib, retain: true, release: true); + } + + NSData? get data { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_data1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get userInfo { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_userInfo1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + int get storagePolicy { + return _lib._objc_msgSend_850(_id, _lib._sel_storagePolicy1); + } + + static NSCachedURLResponse new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSCachedURLResponse1, _lib._sel_new1); + return NSCachedURLResponse._(_ret, _lib, retain: false, release: true); + } + + static NSCachedURLResponse alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSCachedURLResponse1, _lib._sel_alloc1); + return NSCachedURLResponse._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSCachedURLResponse1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSCachedURLResponse1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSCachedURLResponse1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSCachedURLResponse1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSCachedURLResponse1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSCachedURLResponse1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSCachedURLResponse1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSCachedURLResponse1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSCachedURLResponse1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSURLCacheStoragePolicy { + static const int NSURLCacheStorageAllowed = 0; + static const int NSURLCacheStorageAllowedInMemoryOnly = 1; + static const int NSURLCacheStorageNotAllowed = 2; +} + +class NSURLSessionDataTask extends NSURLSessionTask { + NSURLSessionDataTask._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionDataTask] that points to the same underlying object as [other]. + static NSURLSessionDataTask castFrom(T other) { + return NSURLSessionDataTask._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionDataTask] that wraps the given raw object pointer. + static NSURLSessionDataTask castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionDataTask._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionDataTask]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionDataTask1); + } + + @override + NSURLSessionDataTask init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionDataTask new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLSessionDataTask1, _lib._sel_new1); + return NSURLSessionDataTask._(_ret, _lib, retain: false, release: true); + } + + static NSURLSessionDataTask alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionDataTask1, _lib._sel_alloc1); + return NSURLSessionDataTask._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLSessionDataTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLSessionDataTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionDataTask1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSessionDataTask1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionDataTask1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionDataTask1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLSessionDataTask1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLSessionDataTask1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionDataTask1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock33_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock33_closureRegistry = {}; +int _ObjCBlock33_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock33_registerClosure(Function fn) { + final id = ++_ObjCBlock33_closureRegistryIndex; + _ObjCBlock33_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock33_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return _ObjCBlock33_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock33 extends _ObjCBlockBase { + ObjCBlock33._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock33.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock33_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock33.fromFunction( + SwiftLibrary lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock33_closureTrampoline) + .cast(), + _ObjCBlock33_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_id, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +class NSURLConnection extends NSObject { + NSURLConnection._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLConnection] that points to the same underlying object as [other]. + static NSURLConnection castFrom(T other) { + return NSURLConnection._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLConnection] that wraps the given raw object pointer. + static NSURLConnection castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLConnection._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLConnection]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLConnection1); + } + + NSURLConnection initWithRequest_delegate_startImmediately_( + NSURLRequest? request, NSObject delegate, bool startImmediately) { + final _ret = _lib._objc_msgSend_857( + _id, + _lib._sel_initWithRequest_delegate_startImmediately_1, + request?._id ?? ffi.nullptr, + delegate._id, + startImmediately); + return NSURLConnection._(_ret, _lib, retain: true, release: true); + } + + NSURLConnection initWithRequest_delegate_( + NSURLRequest? request, NSObject delegate) { + final _ret = _lib._objc_msgSend_858( + _id, + _lib._sel_initWithRequest_delegate_1, + request?._id ?? ffi.nullptr, + delegate._id); + return NSURLConnection._(_ret, _lib, retain: true, release: true); + } + + static NSURLConnection connectionWithRequest_delegate_( + SwiftLibrary _lib, NSURLRequest? request, NSObject delegate) { + final _ret = _lib._objc_msgSend_859( + _lib._class_NSURLConnection1, + _lib._sel_connectionWithRequest_delegate_1, + request?._id ?? ffi.nullptr, + delegate._id); + return NSURLConnection._(_ret, _lib, retain: true, release: true); + } + + NSURLRequest? get originalRequest { + final _ret = _lib._objc_msgSend_761(_id, _lib._sel_originalRequest1); + return _ret.address == 0 + ? null + : NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + NSURLRequest? get currentRequest { + final _ret = _lib._objc_msgSend_761(_id, _lib._sel_currentRequest1); + return _ret.address == 0 + ? null + : NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + void start() { + return _lib._objc_msgSend_1(_id, _lib._sel_start1); + } + + void cancel() { + return _lib._objc_msgSend_1(_id, _lib._sel_cancel1); + } + + void scheduleInRunLoop_forMode_(NSRunLoop? aRunLoop, NSRunLoopMode mode) { + return _lib._objc_msgSend_501(_id, _lib._sel_scheduleInRunLoop_forMode_1, + aRunLoop?._id ?? ffi.nullptr, mode); + } + + void unscheduleFromRunLoop_forMode_(NSRunLoop? aRunLoop, NSRunLoopMode mode) { + return _lib._objc_msgSend_501( + _id, + _lib._sel_unscheduleFromRunLoop_forMode_1, + aRunLoop?._id ?? ffi.nullptr, + mode); + } + + void setDelegateQueue_(NSOperationQueue? queue) { + return _lib._objc_msgSend_860( + _id, _lib._sel_setDelegateQueue_1, queue?._id ?? ffi.nullptr); + } + + static bool canHandleRequest_(SwiftLibrary _lib, NSURLRequest? request) { + return _lib._objc_msgSend_861(_lib._class_NSURLConnection1, + _lib._sel_canHandleRequest_1, request?._id ?? ffi.nullptr); + } + + static NSData sendSynchronousRequest_returningResponse_error_( + SwiftLibrary _lib, + NSURLRequest? request, + ffi.Pointer> response, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_862( + _lib._class_NSURLConnection1, + _lib._sel_sendSynchronousRequest_returningResponse_error_1, + request?._id ?? ffi.nullptr, + response, + error); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static void sendAsynchronousRequest_queue_completionHandler_( + SwiftLibrary _lib, + NSURLRequest? request, + NSOperationQueue? queue, + ObjCBlock34 handler) { + return _lib._objc_msgSend_863( + _lib._class_NSURLConnection1, + _lib._sel_sendAsynchronousRequest_queue_completionHandler_1, + request?._id ?? ffi.nullptr, + queue?._id ?? ffi.nullptr, + handler._id); + } + + static NSURLConnection new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLConnection1, _lib._sel_new1); + return NSURLConnection._(_ret, _lib, retain: false, release: true); + } + + static NSURLConnection alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLConnection1, _lib._sel_alloc1); + return NSURLConnection._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLConnection1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLConnection1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLConnection1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLConnection1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLConnection1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLConnection1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLConnection1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLConnection1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLConnection1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock34_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock34_closureRegistry = {}; +int _ObjCBlock34_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock34_registerClosure(Function fn) { + final id = ++_ObjCBlock34_closureRegistryIndex; + _ObjCBlock34_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock34_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return _ObjCBlock34_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock34 extends _ObjCBlockBase { + ObjCBlock34._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock34.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock34_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock34.fromFunction( + SwiftLibrary lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock34_closureTrampoline) + .cast(), + _ObjCBlock34_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +class NSURLCredential extends NSObject { + NSURLCredential._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLCredential] that points to the same underlying object as [other]. + static NSURLCredential castFrom(T other) { + return NSURLCredential._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLCredential] that wraps the given raw object pointer. + static NSURLCredential castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLCredential._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLCredential]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLCredential1); + } + + int get persistence { + return _lib._objc_msgSend_864(_id, _lib._sel_persistence1); + } + + NSURLCredential initWithUser_password_persistence_( + NSString? user, NSString? password, int persistence) { + final _ret = _lib._objc_msgSend_865( + _id, + _lib._sel_initWithUser_password_persistence_1, + user?._id ?? ffi.nullptr, + password?._id ?? ffi.nullptr, + persistence); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + static NSURLCredential credentialWithUser_password_persistence_( + SwiftLibrary _lib, NSString? user, NSString? password, int persistence) { + final _ret = _lib._objc_msgSend_866( + _lib._class_NSURLCredential1, + _lib._sel_credentialWithUser_password_persistence_1, + user?._id ?? ffi.nullptr, + password?._id ?? ffi.nullptr, + persistence); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + NSString? get user { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_user1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get password { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_password1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool get hasPassword { + return _lib._objc_msgSend_12(_id, _lib._sel_hasPassword1); + } + + NSURLCredential initWithIdentity_certificates_persistence_( + SecIdentityRef identity, NSArray? certArray, int persistence) { + final _ret = _lib._objc_msgSend_867( + _id, + _lib._sel_initWithIdentity_certificates_persistence_1, + identity, + certArray?._id ?? ffi.nullptr, + persistence); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + static NSURLCredential credentialWithIdentity_certificates_persistence_( + SwiftLibrary _lib, + SecIdentityRef identity, + NSArray? certArray, + int persistence) { + final _ret = _lib._objc_msgSend_868( + _lib._class_NSURLCredential1, + _lib._sel_credentialWithIdentity_certificates_persistence_1, + identity, + certArray?._id ?? ffi.nullptr, + persistence); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + SecIdentityRef get identity { + return _lib._objc_msgSend_869(_id, _lib._sel_identity1); + } + + NSArray? get certificates { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_certificates1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSURLCredential initWithTrust_(SecTrustRef trust) { + final _ret = _lib._objc_msgSend_870(_id, _lib._sel_initWithTrust_1, trust); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + static NSURLCredential credentialForTrust_( + SwiftLibrary _lib, SecTrustRef trust) { + final _ret = _lib._objc_msgSend_871( + _lib._class_NSURLCredential1, _lib._sel_credentialForTrust_1, trust); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + static NSURLCredential new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLCredential1, _lib._sel_new1); + return NSURLCredential._(_ret, _lib, retain: false, release: true); + } + + static NSURLCredential alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLCredential1, _lib._sel_alloc1); + return NSURLCredential._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLCredential1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLCredential1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLCredential1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLCredential1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLCredential1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLCredential1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLCredential1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLCredential1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLCredential1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSURLCredentialPersistence { + static const int NSURLCredentialPersistenceNone = 0; + static const int NSURLCredentialPersistenceForSession = 1; + static const int NSURLCredentialPersistencePermanent = 2; + static const int NSURLCredentialPersistenceSynchronizable = 3; +} + +typedef SecIdentityRef = ffi.Pointer<__SecIdentity>; + +class __SecIdentity extends ffi.Opaque {} + +typedef SecTrustRef = ffi.Pointer<__SecTrust>; + +class __SecTrust extends ffi.Opaque {} + +class NSURLProtectionSpace extends NSObject { + NSURLProtectionSpace._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLProtectionSpace] that points to the same underlying object as [other]. + static NSURLProtectionSpace castFrom(T other) { + return NSURLProtectionSpace._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLProtectionSpace] that wraps the given raw object pointer. + static NSURLProtectionSpace castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLProtectionSpace._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLProtectionSpace]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLProtectionSpace1); + } + + NSURLProtectionSpace initWithHost_port_protocol_realm_authenticationMethod_( + NSString? host, + int port, + NSString? protocol, + NSString? realm, + NSString? authenticationMethod) { + final _ret = _lib._objc_msgSend_872( + _id, + _lib._sel_initWithHost_port_protocol_realm_authenticationMethod_1, + host?._id ?? ffi.nullptr, + port, + protocol?._id ?? ffi.nullptr, + realm?._id ?? ffi.nullptr, + authenticationMethod?._id ?? ffi.nullptr); + return NSURLProtectionSpace._(_ret, _lib, retain: true, release: true); + } + + NSURLProtectionSpace initWithProxyHost_port_type_realm_authenticationMethod_( + NSString? host, + int port, + NSString? type, + NSString? realm, + NSString? authenticationMethod) { + final _ret = _lib._objc_msgSend_872( + _id, + _lib._sel_initWithProxyHost_port_type_realm_authenticationMethod_1, + host?._id ?? ffi.nullptr, + port, + type?._id ?? ffi.nullptr, + realm?._id ?? ffi.nullptr, + authenticationMethod?._id ?? ffi.nullptr); + return NSURLProtectionSpace._(_ret, _lib, retain: true, release: true); + } + + NSString? get realm { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_realm1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool get receivesCredentialSecurely { + return _lib._objc_msgSend_12(_id, _lib._sel_receivesCredentialSecurely1); + } + + bool get isProxy { + return _lib._objc_msgSend_12(_id, _lib._sel_isProxy1); + } + + NSString? get host { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_host1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get port { + return _lib._objc_msgSend_78(_id, _lib._sel_port1); + } + + NSString? get proxyType { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_proxyType1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get protocol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_protocol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get authenticationMethod { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_authenticationMethod1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get distinguishedNames { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_distinguishedNames1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + SecTrustRef get serverTrust { + return _lib._objc_msgSend_873(_id, _lib._sel_serverTrust1); + } + + static NSURLProtectionSpace new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLProtectionSpace1, _lib._sel_new1); + return NSURLProtectionSpace._(_ret, _lib, retain: false, release: true); + } + + static NSURLProtectionSpace alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLProtectionSpace1, _lib._sel_alloc1); + return NSURLProtectionSpace._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLProtectionSpace1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLProtectionSpace1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLProtectionSpace1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLProtectionSpace1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLProtectionSpace1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLProtectionSpace1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLProtectionSpace1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLProtectionSpace1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLProtectionSpace1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSURLCredentialStorage extends NSObject { + NSURLCredentialStorage._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLCredentialStorage] that points to the same underlying object as [other]. + static NSURLCredentialStorage castFrom(T other) { + return NSURLCredentialStorage._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLCredentialStorage] that wraps the given raw object pointer. + static NSURLCredentialStorage castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLCredentialStorage._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLCredentialStorage]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLCredentialStorage1); + } + + static NSURLCredentialStorage? getSharedCredentialStorage(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_874(_lib._class_NSURLCredentialStorage1, + _lib._sel_sharedCredentialStorage1); + return _ret.address == 0 + ? null + : NSURLCredentialStorage._(_ret, _lib, retain: true, release: true); + } + + NSDictionary credentialsForProtectionSpace_(NSURLProtectionSpace? space) { + final _ret = _lib._objc_msgSend_875(_id, + _lib._sel_credentialsForProtectionSpace_1, space?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get allCredentials { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_allCredentials1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + void setCredential_forProtectionSpace_( + NSURLCredential? credential, NSURLProtectionSpace? space) { + return _lib._objc_msgSend_876( + _id, + _lib._sel_setCredential_forProtectionSpace_1, + credential?._id ?? ffi.nullptr, + space?._id ?? ffi.nullptr); + } + + void removeCredential_forProtectionSpace_( + NSURLCredential? credential, NSURLProtectionSpace? space) { + return _lib._objc_msgSend_876( + _id, + _lib._sel_removeCredential_forProtectionSpace_1, + credential?._id ?? ffi.nullptr, + space?._id ?? ffi.nullptr); + } + + void removeCredential_forProtectionSpace_options_(NSURLCredential? credential, + NSURLProtectionSpace? space, NSDictionary? options) { + return _lib._objc_msgSend_877( + _id, + _lib._sel_removeCredential_forProtectionSpace_options_1, + credential?._id ?? ffi.nullptr, + space?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr); + } + + NSURLCredential defaultCredentialForProtectionSpace_( + NSURLProtectionSpace? space) { + final _ret = _lib._objc_msgSend_878( + _id, + _lib._sel_defaultCredentialForProtectionSpace_1, + space?._id ?? ffi.nullptr); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + void setDefaultCredential_forProtectionSpace_( + NSURLCredential? credential, NSURLProtectionSpace? space) { + return _lib._objc_msgSend_876( + _id, + _lib._sel_setDefaultCredential_forProtectionSpace_1, + credential?._id ?? ffi.nullptr, + space?._id ?? ffi.nullptr); + } + + void getCredentialsForProtectionSpace_task_completionHandler_( + NSURLProtectionSpace? protectionSpace, + NSURLSessionTask? task, + ObjCBlock35 completionHandler) { + return _lib._objc_msgSend_879( + _id, + _lib._sel_getCredentialsForProtectionSpace_task_completionHandler_1, + protectionSpace?._id ?? ffi.nullptr, + task?._id ?? ffi.nullptr, + completionHandler._id); + } + + void setCredential_forProtectionSpace_task_(NSURLCredential? credential, + NSURLProtectionSpace? protectionSpace, NSURLSessionTask? task) { + return _lib._objc_msgSend_880( + _id, + _lib._sel_setCredential_forProtectionSpace_task_1, + credential?._id ?? ffi.nullptr, + protectionSpace?._id ?? ffi.nullptr, + task?._id ?? ffi.nullptr); + } + + void removeCredential_forProtectionSpace_options_task_( + NSURLCredential? credential, + NSURLProtectionSpace? protectionSpace, + NSDictionary? options, + NSURLSessionTask? task) { + return _lib._objc_msgSend_881( + _id, + _lib._sel_removeCredential_forProtectionSpace_options_task_1, + credential?._id ?? ffi.nullptr, + protectionSpace?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr, + task?._id ?? ffi.nullptr); + } + + void getDefaultCredentialForProtectionSpace_task_completionHandler_( + NSURLProtectionSpace? space, + NSURLSessionTask? task, + ObjCBlock36 completionHandler) { + return _lib._objc_msgSend_882( + _id, + _lib._sel_getDefaultCredentialForProtectionSpace_task_completionHandler_1, + space?._id ?? ffi.nullptr, + task?._id ?? ffi.nullptr, + completionHandler._id); + } + + void setDefaultCredential_forProtectionSpace_task_( + NSURLCredential? credential, + NSURLProtectionSpace? protectionSpace, + NSURLSessionTask? task) { + return _lib._objc_msgSend_880( + _id, + _lib._sel_setDefaultCredential_forProtectionSpace_task_1, + credential?._id ?? ffi.nullptr, + protectionSpace?._id ?? ffi.nullptr, + task?._id ?? ffi.nullptr); + } + + static NSURLCredentialStorage new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLCredentialStorage1, _lib._sel_new1); + return NSURLCredentialStorage._(_ret, _lib, retain: false, release: true); + } + + static NSURLCredentialStorage alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLCredentialStorage1, _lib._sel_alloc1); + return NSURLCredentialStorage._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLCredentialStorage1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLCredentialStorage1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLCredentialStorage1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLCredentialStorage1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLCredentialStorage1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLCredentialStorage1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLCredentialStorage1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLCredentialStorage1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLCredentialStorage1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock35_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock35_closureRegistry = {}; +int _ObjCBlock35_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock35_registerClosure(Function fn) { + final id = ++_ObjCBlock35_closureRegistryIndex; + _ObjCBlock35_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock35_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return _ObjCBlock35_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock35 extends _ObjCBlockBase { + ObjCBlock35._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock35.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock35_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock35.fromFunction( + SwiftLibrary lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock35_closureTrampoline) + .cast(), + _ObjCBlock35_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_id, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +void _ObjCBlock36_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock36_closureRegistry = {}; +int _ObjCBlock36_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock36_registerClosure(Function fn) { + final id = ++_ObjCBlock36_closureRegistryIndex; + _ObjCBlock36_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock36_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return _ObjCBlock36_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock36 extends _ObjCBlockBase { + ObjCBlock36._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock36.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock36_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock36.fromFunction( + SwiftLibrary lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock36_closureTrampoline) + .cast(), + _ObjCBlock36_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_id, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +class NSURLProtocol extends NSObject { + NSURLProtocol._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLProtocol] that points to the same underlying object as [other]. + static NSURLProtocol castFrom(T other) { + return NSURLProtocol._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSURLProtocol] that wraps the given raw object pointer. + static NSURLProtocol castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLProtocol._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLProtocol]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLProtocol1); + } + + NSURLProtocol initWithRequest_cachedResponse_client_(NSURLRequest? request, + NSCachedURLResponse? cachedResponse, NSObject? client) { + final _ret = _lib._objc_msgSend_883( + _id, + _lib._sel_initWithRequest_cachedResponse_client_1, + request?._id ?? ffi.nullptr, + cachedResponse?._id ?? ffi.nullptr, + client?._id ?? ffi.nullptr); + return NSURLProtocol._(_ret, _lib, retain: true, release: true); + } + + NSObject? get client { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_client1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + NSURLRequest? get request { + final _ret = _lib._objc_msgSend_761(_id, _lib._sel_request1); + return _ret.address == 0 + ? null + : NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + NSCachedURLResponse? get cachedResponse { + final _ret = _lib._objc_msgSend_884(_id, _lib._sel_cachedResponse1); + return _ret.address == 0 + ? null + : NSCachedURLResponse._(_ret, _lib, retain: true, release: true); + } + + static bool canInitWithRequest_(SwiftLibrary _lib, NSURLRequest? request) { + return _lib._objc_msgSend_861(_lib._class_NSURLProtocol1, + _lib._sel_canInitWithRequest_1, request?._id ?? ffi.nullptr); + } + + static NSURLRequest canonicalRequestForRequest_( + SwiftLibrary _lib, NSURLRequest? request) { + final _ret = _lib._objc_msgSend_885(_lib._class_NSURLProtocol1, + _lib._sel_canonicalRequestForRequest_1, request?._id ?? ffi.nullptr); + return NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + static bool requestIsCacheEquivalent_toRequest_( + SwiftLibrary _lib, NSURLRequest? a, NSURLRequest? b) { + return _lib._objc_msgSend_886( + _lib._class_NSURLProtocol1, + _lib._sel_requestIsCacheEquivalent_toRequest_1, + a?._id ?? ffi.nullptr, + b?._id ?? ffi.nullptr); + } + + void startLoading() { + return _lib._objc_msgSend_1(_id, _lib._sel_startLoading1); + } + + void stopLoading() { + return _lib._objc_msgSend_1(_id, _lib._sel_stopLoading1); + } + + static NSObject propertyForKey_inRequest_( + SwiftLibrary _lib, NSString? key, NSURLRequest? request) { + final _ret = _lib._objc_msgSend_887( + _lib._class_NSURLProtocol1, + _lib._sel_propertyForKey_inRequest_1, + key?._id ?? ffi.nullptr, + request?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static void setProperty_forKey_inRequest_(SwiftLibrary _lib, NSObject value, + NSString? key, NSMutableURLRequest? request) { + return _lib._objc_msgSend_894( + _lib._class_NSURLProtocol1, + _lib._sel_setProperty_forKey_inRequest_1, + value._id, + key?._id ?? ffi.nullptr, + request?._id ?? ffi.nullptr); + } + + static void removePropertyForKey_inRequest_( + SwiftLibrary _lib, NSString? key, NSMutableURLRequest? request) { + return _lib._objc_msgSend_895( + _lib._class_NSURLProtocol1, + _lib._sel_removePropertyForKey_inRequest_1, + key?._id ?? ffi.nullptr, + request?._id ?? ffi.nullptr); + } + + static bool registerClass_(SwiftLibrary _lib, NSObject protocolClass) { + return _lib._objc_msgSend_0(_lib._class_NSURLProtocol1, + _lib._sel_registerClass_1, protocolClass._id); + } + + static void unregisterClass_(SwiftLibrary _lib, NSObject protocolClass) { + return _lib._objc_msgSend_15(_lib._class_NSURLProtocol1, + _lib._sel_unregisterClass_1, protocolClass._id); + } + + static bool canInitWithTask_(SwiftLibrary _lib, NSURLSessionTask? task) { + return _lib._objc_msgSend_896(_lib._class_NSURLProtocol1, + _lib._sel_canInitWithTask_1, task?._id ?? ffi.nullptr); + } + + NSURLProtocol initWithTask_cachedResponse_client_(NSURLSessionTask? task, + NSCachedURLResponse? cachedResponse, NSObject? client) { + final _ret = _lib._objc_msgSend_897( + _id, + _lib._sel_initWithTask_cachedResponse_client_1, + task?._id ?? ffi.nullptr, + cachedResponse?._id ?? ffi.nullptr, + client?._id ?? ffi.nullptr); + return NSURLProtocol._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionTask? get task { + final _ret = _lib._objc_msgSend_898(_id, _lib._sel_task1); + return _ret.address == 0 + ? null + : NSURLSessionTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLProtocol new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLProtocol1, _lib._sel_new1); + return NSURLProtocol._(_ret, _lib, retain: false, release: true); + } + + static NSURLProtocol alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLProtocol1, _lib._sel_alloc1); + return NSURLProtocol._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLProtocol1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLProtocol1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLProtocol1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLProtocol1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLProtocol1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLProtocol1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLProtocol1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSURLProtocol1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLProtocol1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSMutableURLRequest extends NSURLRequest { + NSMutableURLRequest._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableURLRequest] that points to the same underlying object as [other]. + static NSMutableURLRequest castFrom(T other) { + return NSMutableURLRequest._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSMutableURLRequest] that wraps the given raw object pointer. + static NSMutableURLRequest castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableURLRequest._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableURLRequest]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMutableURLRequest1); + } + + @override + NSURL? get URL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_URL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + set URL(NSURL? value) { + _lib._objc_msgSend_888(_id, _lib._sel_setURL_1, value?._id ?? ffi.nullptr); + } + + @override + int get cachePolicy { + return _lib._objc_msgSend_748(_id, _lib._sel_cachePolicy1); + } + + set cachePolicy(int value) { + _lib._objc_msgSend_889(_id, _lib._sel_setCachePolicy_1, value); + } + + @override + double get timeoutInterval { + return _lib._objc_msgSend_149(_id, _lib._sel_timeoutInterval1); + } + + set timeoutInterval(double value) { + _lib._objc_msgSend_474(_id, _lib._sel_setTimeoutInterval_1, value); + } + + @override + NSURL? get mainDocumentURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_mainDocumentURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + set mainDocumentURL(NSURL? value) { + _lib._objc_msgSend_888( + _id, _lib._sel_setMainDocumentURL_1, value?._id ?? ffi.nullptr); + } + + @override + int get networkServiceType { + return _lib._objc_msgSend_749(_id, _lib._sel_networkServiceType1); + } + + set networkServiceType(int value) { + _lib._objc_msgSend_890(_id, _lib._sel_setNetworkServiceType_1, value); + } + + @override + bool get allowsCellularAccess { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsCellularAccess1); + } + + set allowsCellularAccess(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setAllowsCellularAccess_1, value); + } + + @override + bool get allowsExpensiveNetworkAccess { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsExpensiveNetworkAccess1); + } + + set allowsExpensiveNetworkAccess(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setAllowsExpensiveNetworkAccess_1, value); + } + + @override + bool get allowsConstrainedNetworkAccess { + return _lib._objc_msgSend_12( + _id, _lib._sel_allowsConstrainedNetworkAccess1); + } + + set allowsConstrainedNetworkAccess(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setAllowsConstrainedNetworkAccess_1, value); + } + + @override + bool get assumesHTTP3Capable { + return _lib._objc_msgSend_12(_id, _lib._sel_assumesHTTP3Capable1); + } + + set assumesHTTP3Capable(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setAssumesHTTP3Capable_1, value); + } + + @override + int get attribution { + return _lib._objc_msgSend_750(_id, _lib._sel_attribution1); + } + + set attribution(int value) { + _lib._objc_msgSend_891(_id, _lib._sel_setAttribution_1, value); + } + + @override + NSString? get HTTPMethod { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_HTTPMethod1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set HTTPMethod(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setHTTPMethod_1, value?._id ?? ffi.nullptr); + } + + @override + NSDictionary? get allHTTPHeaderFields { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_allHTTPHeaderFields1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set allHTTPHeaderFields(NSDictionary? value) { + _lib._objc_msgSend_165( + _id, _lib._sel_setAllHTTPHeaderFields_1, value?._id ?? ffi.nullptr); + } + + void setValue_forHTTPHeaderField_(NSString? value, NSString? field) { + return _lib._objc_msgSend_483(_id, _lib._sel_setValue_forHTTPHeaderField_1, + value?._id ?? ffi.nullptr, field?._id ?? ffi.nullptr); + } + + void addValue_forHTTPHeaderField_(NSString? value, NSString? field) { + return _lib._objc_msgSend_483(_id, _lib._sel_addValue_forHTTPHeaderField_1, + value?._id ?? ffi.nullptr, field?._id ?? ffi.nullptr); + } + + @override + NSData? get HTTPBody { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_HTTPBody1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + set HTTPBody(NSData? value) { + _lib._objc_msgSend_892( + _id, _lib._sel_setHTTPBody_1, value?._id ?? ffi.nullptr); + } + + @override + NSInputStream? get HTTPBodyStream { + final _ret = _lib._objc_msgSend_760(_id, _lib._sel_HTTPBodyStream1); + return _ret.address == 0 + ? null + : NSInputStream._(_ret, _lib, retain: true, release: true); + } + + set HTTPBodyStream(NSInputStream? value) { + _lib._objc_msgSend_893( + _id, _lib._sel_setHTTPBodyStream_1, value?._id ?? ffi.nullptr); + } + + @override + bool get HTTPShouldHandleCookies { + return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldHandleCookies1); + } + + set HTTPShouldHandleCookies(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setHTTPShouldHandleCookies_1, value); + } + + @override + bool get HTTPShouldUsePipelining { + return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldUsePipelining1); + } + + set HTTPShouldUsePipelining(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setHTTPShouldUsePipelining_1, value); + } + + static NSMutableURLRequest requestWithURL_(SwiftLibrary _lib, NSURL? URL) { + final _ret = _lib._objc_msgSend_226(_lib._class_NSMutableURLRequest1, + _lib._sel_requestWithURL_1, URL?._id ?? ffi.nullptr); + return NSMutableURLRequest._(_ret, _lib, retain: true, release: true); + } + + static bool getSupportsSecureCoding(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableURLRequest1, _lib._sel_supportsSecureCoding1); + } + + static NSMutableURLRequest requestWithURL_cachePolicy_timeoutInterval_( + SwiftLibrary _lib, NSURL? URL, int cachePolicy, double timeoutInterval) { + final _ret = _lib._objc_msgSend_747( + _lib._class_NSMutableURLRequest1, + _lib._sel_requestWithURL_cachePolicy_timeoutInterval_1, + URL?._id ?? ffi.nullptr, + cachePolicy, + timeoutInterval); + return NSMutableURLRequest._(_ret, _lib, retain: true, release: true); + } + + static NSMutableURLRequest new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableURLRequest1, _lib._sel_new1); + return NSMutableURLRequest._(_ret, _lib, retain: false, release: true); + } + + static NSMutableURLRequest alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableURLRequest1, _lib._sel_alloc1); + return NSMutableURLRequest._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSMutableURLRequest1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSMutableURLRequest1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMutableURLRequest1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableURLRequest1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableURLRequest1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableURLRequest1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSMutableURLRequest1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSMutableURLRequest1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableURLRequest1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSXMLParser extends NSObject { + NSXMLParser._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSXMLParser] that points to the same underlying object as [other]. + static NSXMLParser castFrom(T other) { + return NSXMLParser._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSXMLParser] that wraps the given raw object pointer. + static NSXMLParser castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSXMLParser._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSXMLParser]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLParser1); + } + + NSXMLParser initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_226( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSXMLParser._(_ret, _lib, retain: true, release: true); + } + + NSXMLParser initWithData_(NSData? data) { + final _ret = _lib._objc_msgSend_242( + _id, _lib._sel_initWithData_1, data?._id ?? ffi.nullptr); + return NSXMLParser._(_ret, _lib, retain: true, release: true); + } + + NSXMLParser initWithStream_(NSInputStream? stream) { + final _ret = _lib._objc_msgSend_899( + _id, _lib._sel_initWithStream_1, stream?._id ?? ffi.nullptr); + return NSXMLParser._(_ret, _lib, retain: true, release: true); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + _lib._objc_msgSend_368( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + bool get shouldProcessNamespaces { + return _lib._objc_msgSend_12(_id, _lib._sel_shouldProcessNamespaces1); + } + + set shouldProcessNamespaces(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setShouldProcessNamespaces_1, value); + } + + bool get shouldReportNamespacePrefixes { + return _lib._objc_msgSend_12(_id, _lib._sel_shouldReportNamespacePrefixes1); + } + + set shouldReportNamespacePrefixes(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setShouldReportNamespacePrefixes_1, value); + } + + int get externalEntityResolvingPolicy { + return _lib._objc_msgSend_900( + _id, _lib._sel_externalEntityResolvingPolicy1); + } + + set externalEntityResolvingPolicy(int value) { + _lib._objc_msgSend_901( + _id, _lib._sel_setExternalEntityResolvingPolicy_1, value); + } + + NSSet? get allowedExternalEntityURLs { + final _ret = + _lib._objc_msgSend_280(_id, _lib._sel_allowedExternalEntityURLs1); + return _ret.address == 0 + ? null + : NSSet._(_ret, _lib, retain: true, release: true); + } + + set allowedExternalEntityURLs(NSSet? value) { + _lib._objc_msgSend_902(_id, _lib._sel_setAllowedExternalEntityURLs_1, + value?._id ?? ffi.nullptr); + } + + bool parse() { + return _lib._objc_msgSend_12(_id, _lib._sel_parse1); + } + + void abortParsing() { + return _lib._objc_msgSend_1(_id, _lib._sel_abortParsing1); + } + + NSError? get parserError { + final _ret = _lib._objc_msgSend_283(_id, _lib._sel_parserError1); + return _ret.address == 0 + ? null + : NSError._(_ret, _lib, retain: true, release: true); + } + + bool get shouldResolveExternalEntities { + return _lib._objc_msgSend_12(_id, _lib._sel_shouldResolveExternalEntities1); + } + + set shouldResolveExternalEntities(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setShouldResolveExternalEntities_1, value); + } + + NSString? get publicID { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_publicID1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get systemID { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_systemID1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get lineNumber { + return _lib._objc_msgSend_78(_id, _lib._sel_lineNumber1); + } + + int get columnNumber { + return _lib._objc_msgSend_78(_id, _lib._sel_columnNumber1); + } + + static NSXMLParser new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSXMLParser1, _lib._sel_new1); + return NSXMLParser._(_ret, _lib, retain: false, release: true); + } + + static NSXMLParser alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLParser1, _lib._sel_alloc1); + return NSXMLParser._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSXMLParser1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSXMLParser1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLParser1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLParser1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSXMLParser1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSXMLParser1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSXMLParser1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSXMLParser1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSXMLParser1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSXMLParserExternalEntityResolvingPolicy { + static const int NSXMLParserResolveExternalEntitiesNever = 0; + static const int NSXMLParserResolveExternalEntitiesNoNetwork = 1; + static const int NSXMLParserResolveExternalEntitiesSameOriginOnly = 2; + static const int NSXMLParserResolveExternalEntitiesAlways = 3; +} + +class NSFileWrapper extends NSObject { + NSFileWrapper._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSFileWrapper] that points to the same underlying object as [other]. + static NSFileWrapper castFrom(T other) { + return NSFileWrapper._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSFileWrapper] that wraps the given raw object pointer. + static NSFileWrapper castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSFileWrapper._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSFileWrapper]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSFileWrapper1); + } + + NSFileWrapper initWithURL_options_error_( + NSURL? url, int options, ffi.Pointer> outError) { + final _ret = _lib._objc_msgSend_903( + _id, + _lib._sel_initWithURL_options_error_1, + url?._id ?? ffi.nullptr, + options, + outError); + return NSFileWrapper._(_ret, _lib, retain: true, release: true); + } + + NSFileWrapper initDirectoryWithFileWrappers_( + NSDictionary? childrenByPreferredName) { + final _ret = _lib._objc_msgSend_143( + _id, + _lib._sel_initDirectoryWithFileWrappers_1, + childrenByPreferredName?._id ?? ffi.nullptr); + return NSFileWrapper._(_ret, _lib, retain: true, release: true); + } + + NSFileWrapper initRegularFileWithContents_(NSData? contents) { + final _ret = _lib._objc_msgSend_242(_id, + _lib._sel_initRegularFileWithContents_1, contents?._id ?? ffi.nullptr); + return NSFileWrapper._(_ret, _lib, retain: true, release: true); + } + + NSFileWrapper initSymbolicLinkWithDestinationURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_226( + _id, + _lib._sel_initSymbolicLinkWithDestinationURL_1, + url?._id ?? ffi.nullptr); + return NSFileWrapper._(_ret, _lib, retain: true, release: true); + } + + NSFileWrapper initWithSerializedRepresentation_( + NSData? serializeRepresentation) { + final _ret = _lib._objc_msgSend_242( + _id, + _lib._sel_initWithSerializedRepresentation_1, + serializeRepresentation?._id ?? ffi.nullptr); + return NSFileWrapper._(_ret, _lib, retain: true, release: true); + } + + NSFileWrapper initWithCoder_(NSCoder? inCoder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, inCoder?._id ?? ffi.nullptr); + return NSFileWrapper._(_ret, _lib, retain: true, release: true); + } + + bool get directory { + return _lib._objc_msgSend_12(_id, _lib._sel_isDirectory1); + } + + bool get regularFile { + return _lib._objc_msgSend_12(_id, _lib._sel_isRegularFile1); + } + + bool get symbolicLink { + return _lib._objc_msgSend_12(_id, _lib._sel_isSymbolicLink1); + } + + NSString? get preferredFilename { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_preferredFilename1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set preferredFilename(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPreferredFilename_1, value?._id ?? ffi.nullptr); + } + + NSString? get filename { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_filename1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set filename(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setFilename_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get fileAttributes { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_fileAttributes1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set fileAttributes(NSDictionary? value) { + _lib._objc_msgSend_165( + _id, _lib._sel_setFileAttributes_1, value?._id ?? ffi.nullptr); + } + + bool matchesContentsOfURL_(NSURL? url) { + return _lib._objc_msgSend_229( + _id, _lib._sel_matchesContentsOfURL_1, url?._id ?? ffi.nullptr); + } + + bool readFromURL_options_error_( + NSURL? url, int options, ffi.Pointer> outError) { + return _lib._objc_msgSend_904(_id, _lib._sel_readFromURL_options_error_1, + url?._id ?? ffi.nullptr, options, outError); + } + + bool writeToURL_options_originalContentsURL_error_( + NSURL? url, + int options, + NSURL? originalContentsURL, + ffi.Pointer> outError) { + return _lib._objc_msgSend_905( + _id, + _lib._sel_writeToURL_options_originalContentsURL_error_1, + url?._id ?? ffi.nullptr, + options, + originalContentsURL?._id ?? ffi.nullptr, + outError); + } + + NSData? get serializedRepresentation { + final _ret = + _lib._objc_msgSend_39(_id, _lib._sel_serializedRepresentation1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSString addFileWrapper_(NSFileWrapper? child) { + final _ret = _lib._objc_msgSend_906( + _id, _lib._sel_addFileWrapper_1, child?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString addRegularFileWithContents_preferredFilename_( + NSData? data, NSString? fileName) { + final _ret = _lib._objc_msgSend_907( + _id, + _lib._sel_addRegularFileWithContents_preferredFilename_1, + data?._id ?? ffi.nullptr, + fileName?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + void removeFileWrapper_(NSFileWrapper? child) { + return _lib._objc_msgSend_908( + _id, _lib._sel_removeFileWrapper_1, child?._id ?? ffi.nullptr); + } + + NSDictionary? get fileWrappers { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_fileWrappers1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSString keyForFileWrapper_(NSFileWrapper? child) { + final _ret = _lib._objc_msgSend_906( + _id, _lib._sel_keyForFileWrapper_1, child?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSData? get regularFileContents { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_regularFileContents1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSURL? get symbolicLinkDestinationURL { + final _ret = + _lib._objc_msgSend_40(_id, _lib._sel_symbolicLinkDestinationURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithPath_(NSString? path) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithPath_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initSymbolicLinkWithDestination_(NSString? path) { + final _ret = _lib._objc_msgSend_30(_id, + _lib._sel_initSymbolicLinkWithDestination_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool needsToBeUpdatedFromPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_needsToBeUpdatedFromPath_1, path?._id ?? ffi.nullptr); + } + + bool updateFromPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_updateFromPath_1, path?._id ?? ffi.nullptr); + } + + bool writeToFile_atomically_updateFilenames_( + NSString? path, bool atomicFlag, bool updateFilenamesFlag) { + return _lib._objc_msgSend_909( + _id, + _lib._sel_writeToFile_atomically_updateFilenames_1, + path?._id ?? ffi.nullptr, + atomicFlag, + updateFilenamesFlag); + } + + NSString addFileWithPath_(NSString? path) { + final _ret = _lib._objc_msgSend_64( + _id, _lib._sel_addFileWithPath_1, path?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString addSymbolicLinkWithDestination_preferredFilename_( + NSString? path, NSString? filename) { + final _ret = _lib._objc_msgSend_324( + _id, + _lib._sel_addSymbolicLinkWithDestination_preferredFilename_1, + path?._id ?? ffi.nullptr, + filename?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString symbolicLinkDestination() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_symbolicLinkDestination1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSFileWrapper new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSFileWrapper1, _lib._sel_new1); + return NSFileWrapper._(_ret, _lib, retain: false, release: true); + } + + static NSFileWrapper alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSFileWrapper1, _lib._sel_alloc1); + return NSFileWrapper._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSFileWrapper1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSFileWrapper1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFileWrapper1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFileWrapper1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSFileWrapper1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSFileWrapper1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSFileWrapper1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSFileWrapper1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSFileWrapper1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSFileWrapperReadingOptions { + static const int NSFileWrapperReadingImmediate = 1; + static const int NSFileWrapperReadingWithoutMapping = 2; +} + +abstract class NSFileWrapperWritingOptions { + static const int NSFileWrapperWritingAtomic = 1; + static const int NSFileWrapperWritingWithNameUpdating = 2; +} + +class NSURLSession extends NSObject { + NSURLSession._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSession] that points to the same underlying object as [other]. + static NSURLSession castFrom(T other) { + return NSURLSession._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSURLSession] that wraps the given raw object pointer. + static NSURLSession castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSession._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSession]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLSession1); + } + + static NSURLSession? getSharedSession(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_910( + _lib._class_NSURLSession1, _lib._sel_sharedSession1); + return _ret.address == 0 + ? null + : NSURLSession._(_ret, _lib, retain: true, release: true); + } + + static NSURLSession sessionWithConfiguration_( + SwiftLibrary _lib, NSURLSessionConfiguration? configuration) { + final _ret = _lib._objc_msgSend_921( + _lib._class_NSURLSession1, + _lib._sel_sessionWithConfiguration_1, + configuration?._id ?? ffi.nullptr); + return NSURLSession._(_ret, _lib, retain: true, release: true); + } + + static NSURLSession sessionWithConfiguration_delegate_delegateQueue_( + SwiftLibrary _lib, + NSURLSessionConfiguration? configuration, + NSObject? delegate, + NSOperationQueue? queue) { + final _ret = _lib._objc_msgSend_922( + _lib._class_NSURLSession1, + _lib._sel_sessionWithConfiguration_delegate_delegateQueue_1, + configuration?._id ?? ffi.nullptr, + delegate?._id ?? ffi.nullptr, + queue?._id ?? ffi.nullptr); + return NSURLSession._(_ret, _lib, retain: true, release: true); + } + + NSOperationQueue? get delegateQueue { + final _ret = _lib._objc_msgSend_790(_id, _lib._sel_delegateQueue1); + return _ret.address == 0 + ? null + : NSOperationQueue._(_ret, _lib, retain: true, release: true); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionConfiguration? get configuration { + final _ret = _lib._objc_msgSend_911(_id, _lib._sel_configuration1); + return _ret.address == 0 + ? null + : NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); + } + + NSString? get sessionDescription { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_sessionDescription1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set sessionDescription(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setSessionDescription_1, value?._id ?? ffi.nullptr); + } + + void finishTasksAndInvalidate() { + return _lib._objc_msgSend_1(_id, _lib._sel_finishTasksAndInvalidate1); + } + + void invalidateAndCancel() { + return _lib._objc_msgSend_1(_id, _lib._sel_invalidateAndCancel1); + } + + void resetWithCompletionHandler_(ObjCBlock16 completionHandler) { + return _lib._objc_msgSend_465( + _id, _lib._sel_resetWithCompletionHandler_1, completionHandler._id); + } + + void flushWithCompletionHandler_(ObjCBlock16 completionHandler) { + return _lib._objc_msgSend_465( + _id, _lib._sel_flushWithCompletionHandler_1, completionHandler._id); + } + + void getTasksWithCompletionHandler_(ObjCBlock37 completionHandler) { + return _lib._objc_msgSend_923( + _id, _lib._sel_getTasksWithCompletionHandler_1, completionHandler._id); + } + + void getAllTasksWithCompletionHandler_(ObjCBlock30 completionHandler) { + return _lib._objc_msgSend_924(_id, + _lib._sel_getAllTasksWithCompletionHandler_1, completionHandler._id); + } + + NSURLSessionDataTask dataTaskWithRequest_(NSURLRequest? request) { + final _ret = _lib._objc_msgSend_925( + _id, _lib._sel_dataTaskWithRequest_1, request?._id ?? ffi.nullptr); + return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDataTask dataTaskWithURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_926( + _id, _lib._sel_dataTaskWithURL_1, url?._id ?? ffi.nullptr); + return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionUploadTask uploadTaskWithRequest_fromFile_( + NSURLRequest? request, NSURL? fileURL) { + final _ret = _lib._objc_msgSend_927( + _id, + _lib._sel_uploadTaskWithRequest_fromFile_1, + request?._id ?? ffi.nullptr, + fileURL?._id ?? ffi.nullptr); + return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionUploadTask uploadTaskWithRequest_fromData_( + NSURLRequest? request, NSData? bodyData) { + final _ret = _lib._objc_msgSend_928( + _id, + _lib._sel_uploadTaskWithRequest_fromData_1, + request?._id ?? ffi.nullptr, + bodyData?._id ?? ffi.nullptr); + return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionUploadTask uploadTaskWithStreamedRequest_(NSURLRequest? request) { + final _ret = _lib._objc_msgSend_929(_id, + _lib._sel_uploadTaskWithStreamedRequest_1, request?._id ?? ffi.nullptr); + return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDownloadTask downloadTaskWithRequest_(NSURLRequest? request) { + final _ret = _lib._objc_msgSend_931( + _id, _lib._sel_downloadTaskWithRequest_1, request?._id ?? ffi.nullptr); + return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDownloadTask downloadTaskWithURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_932( + _id, _lib._sel_downloadTaskWithURL_1, url?._id ?? ffi.nullptr); + return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDownloadTask downloadTaskWithResumeData_(NSData? resumeData) { + final _ret = _lib._objc_msgSend_933(_id, + _lib._sel_downloadTaskWithResumeData_1, resumeData?._id ?? ffi.nullptr); + return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionStreamTask streamTaskWithHostName_port_( + NSString? hostname, int port) { + final _ret = _lib._objc_msgSend_936( + _id, + _lib._sel_streamTaskWithHostName_port_1, + hostname?._id ?? ffi.nullptr, + port); + return NSURLSessionStreamTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionStreamTask streamTaskWithNetService_(NSNetService? service) { + final _ret = _lib._objc_msgSend_942( + _id, _lib._sel_streamTaskWithNetService_1, service?._id ?? ffi.nullptr); + return NSURLSessionStreamTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionWebSocketTask webSocketTaskWithURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_949( + _id, _lib._sel_webSocketTaskWithURL_1, url?._id ?? ffi.nullptr); + return NSURLSessionWebSocketTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionWebSocketTask webSocketTaskWithURL_protocols_( + NSURL? url, NSArray? protocols) { + final _ret = _lib._objc_msgSend_950( + _id, + _lib._sel_webSocketTaskWithURL_protocols_1, + url?._id ?? ffi.nullptr, + protocols?._id ?? ffi.nullptr); + return NSURLSessionWebSocketTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionWebSocketTask webSocketTaskWithRequest_(NSURLRequest? request) { + final _ret = _lib._objc_msgSend_951( + _id, _lib._sel_webSocketTaskWithRequest_1, request?._id ?? ffi.nullptr); + return NSURLSessionWebSocketTask._(_ret, _lib, retain: true, release: true); + } + + @override + NSURLSession init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSession._(_ret, _lib, retain: true, release: true); + } + + static NSURLSession new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLSession1, _lib._sel_new1); + return NSURLSession._(_ret, _lib, retain: false, release: true); + } + + NSURLSessionDataTask dataTaskWithRequest_completionHandler_( + NSURLRequest? request, ObjCBlock41 completionHandler) { + final _ret = _lib._objc_msgSend_952( + _id, + _lib._sel_dataTaskWithRequest_completionHandler_1, + request?._id ?? ffi.nullptr, + completionHandler._id); + return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDataTask dataTaskWithURL_completionHandler_( + NSURL? url, ObjCBlock41 completionHandler) { + final _ret = _lib._objc_msgSend_953( + _id, + _lib._sel_dataTaskWithURL_completionHandler_1, + url?._id ?? ffi.nullptr, + completionHandler._id); + return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionUploadTask uploadTaskWithRequest_fromFile_completionHandler_( + NSURLRequest? request, NSURL? fileURL, ObjCBlock41 completionHandler) { + final _ret = _lib._objc_msgSend_954( + _id, + _lib._sel_uploadTaskWithRequest_fromFile_completionHandler_1, + request?._id ?? ffi.nullptr, + fileURL?._id ?? ffi.nullptr, + completionHandler._id); + return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionUploadTask uploadTaskWithRequest_fromData_completionHandler_( + NSURLRequest? request, NSData? bodyData, ObjCBlock41 completionHandler) { + final _ret = _lib._objc_msgSend_955( + _id, + _lib._sel_uploadTaskWithRequest_fromData_completionHandler_1, + request?._id ?? ffi.nullptr, + bodyData?._id ?? ffi.nullptr, + completionHandler._id); + return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDownloadTask downloadTaskWithRequest_completionHandler_( + NSURLRequest? request, ObjCBlock42 completionHandler) { + final _ret = _lib._objc_msgSend_956( + _id, + _lib._sel_downloadTaskWithRequest_completionHandler_1, + request?._id ?? ffi.nullptr, + completionHandler._id); + return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDownloadTask downloadTaskWithURL_completionHandler_( + NSURL? url, ObjCBlock42 completionHandler) { + final _ret = _lib._objc_msgSend_957( + _id, + _lib._sel_downloadTaskWithURL_completionHandler_1, + url?._id ?? ffi.nullptr, + completionHandler._id); + return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDownloadTask downloadTaskWithResumeData_completionHandler_( + NSData? resumeData, ObjCBlock42 completionHandler) { + final _ret = _lib._objc_msgSend_958( + _id, + _lib._sel_downloadTaskWithResumeData_completionHandler_1, + resumeData?._id ?? ffi.nullptr, + completionHandler._id); + return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLSession alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLSession1, _lib._sel_alloc1); + return NSURLSession._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLSession1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLSession1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSession1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSession1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSession1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSession1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLSession1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSURLSession1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSession1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSURLSessionConfiguration extends NSObject { + NSURLSessionConfiguration._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionConfiguration] that points to the same underlying object as [other]. + static NSURLSessionConfiguration castFrom(T other) { + return NSURLSessionConfiguration._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionConfiguration] that wraps the given raw object pointer. + static NSURLSessionConfiguration castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionConfiguration._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionConfiguration]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionConfiguration1); + } + + static NSURLSessionConfiguration? getDefaultSessionConfiguration( + SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_911(_lib._class_NSURLSessionConfiguration1, + _lib._sel_defaultSessionConfiguration1); + return _ret.address == 0 + ? null + : NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionConfiguration? getEphemeralSessionConfiguration( + SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_911(_lib._class_NSURLSessionConfiguration1, + _lib._sel_ephemeralSessionConfiguration1); + return _ret.address == 0 + ? null + : NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionConfiguration + backgroundSessionConfigurationWithIdentifier_( + SwiftLibrary _lib, NSString? identifier) { + final _ret = _lib._objc_msgSend_912( + _lib._class_NSURLSessionConfiguration1, + _lib._sel_backgroundSessionConfigurationWithIdentifier_1, + identifier?._id ?? ffi.nullptr); + return NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); + } + + NSString? get identifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_identifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get requestCachePolicy { + return _lib._objc_msgSend_748(_id, _lib._sel_requestCachePolicy1); + } + + set requestCachePolicy(int value) { + _lib._objc_msgSend_889(_id, _lib._sel_setRequestCachePolicy_1, value); + } + + double get timeoutIntervalForRequest { + return _lib._objc_msgSend_149(_id, _lib._sel_timeoutIntervalForRequest1); + } + + set timeoutIntervalForRequest(double value) { + _lib._objc_msgSend_474( + _id, _lib._sel_setTimeoutIntervalForRequest_1, value); + } + + double get timeoutIntervalForResource { + return _lib._objc_msgSend_149(_id, _lib._sel_timeoutIntervalForResource1); + } + + set timeoutIntervalForResource(double value) { + _lib._objc_msgSend_474( + _id, _lib._sel_setTimeoutIntervalForResource_1, value); + } + + int get networkServiceType { + return _lib._objc_msgSend_749(_id, _lib._sel_networkServiceType1); + } + + set networkServiceType(int value) { + _lib._objc_msgSend_890(_id, _lib._sel_setNetworkServiceType_1, value); + } + + bool get allowsCellularAccess { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsCellularAccess1); + } + + set allowsCellularAccess(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setAllowsCellularAccess_1, value); + } + + bool get allowsExpensiveNetworkAccess { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsExpensiveNetworkAccess1); + } + + set allowsExpensiveNetworkAccess(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setAllowsExpensiveNetworkAccess_1, value); + } + + bool get allowsConstrainedNetworkAccess { + return _lib._objc_msgSend_12( + _id, _lib._sel_allowsConstrainedNetworkAccess1); + } + + set allowsConstrainedNetworkAccess(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setAllowsConstrainedNetworkAccess_1, value); + } + + bool get waitsForConnectivity { + return _lib._objc_msgSend_12(_id, _lib._sel_waitsForConnectivity1); + } + + set waitsForConnectivity(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setWaitsForConnectivity_1, value); + } + + bool get discretionary { + return _lib._objc_msgSend_12(_id, _lib._sel_isDiscretionary1); + } + + set discretionary(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setDiscretionary_1, value); + } + + NSString? get sharedContainerIdentifier { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_sharedContainerIdentifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set sharedContainerIdentifier(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setSharedContainerIdentifier_1, + value?._id ?? ffi.nullptr); + } + + bool get sessionSendsLaunchEvents { + return _lib._objc_msgSend_12(_id, _lib._sel_sessionSendsLaunchEvents1); + } + + set sessionSendsLaunchEvents(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setSessionSendsLaunchEvents_1, value); + } + + NSDictionary? get connectionProxyDictionary { + final _ret = + _lib._objc_msgSend_164(_id, _lib._sel_connectionProxyDictionary1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set connectionProxyDictionary(NSDictionary? value) { + _lib._objc_msgSend_165(_id, _lib._sel_setConnectionProxyDictionary_1, + value?._id ?? ffi.nullptr); + } + + int get TLSMinimumSupportedProtocol { + return _lib._objc_msgSend_913(_id, _lib._sel_TLSMinimumSupportedProtocol1); + } + + set TLSMinimumSupportedProtocol(int value) { + _lib._objc_msgSend_914( + _id, _lib._sel_setTLSMinimumSupportedProtocol_1, value); + } + + int get TLSMaximumSupportedProtocol { + return _lib._objc_msgSend_913(_id, _lib._sel_TLSMaximumSupportedProtocol1); + } + + set TLSMaximumSupportedProtocol(int value) { + _lib._objc_msgSend_914( + _id, _lib._sel_setTLSMaximumSupportedProtocol_1, value); + } + + int get TLSMinimumSupportedProtocolVersion { + return _lib._objc_msgSend_915( + _id, _lib._sel_TLSMinimumSupportedProtocolVersion1); + } + + set TLSMinimumSupportedProtocolVersion(int value) { + _lib._objc_msgSend_916( + _id, _lib._sel_setTLSMinimumSupportedProtocolVersion_1, value); + } + + int get TLSMaximumSupportedProtocolVersion { + return _lib._objc_msgSend_915( + _id, _lib._sel_TLSMaximumSupportedProtocolVersion1); + } + + set TLSMaximumSupportedProtocolVersion(int value) { + _lib._objc_msgSend_916( + _id, _lib._sel_setTLSMaximumSupportedProtocolVersion_1, value); + } + + bool get HTTPShouldUsePipelining { + return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldUsePipelining1); + } + + set HTTPShouldUsePipelining(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setHTTPShouldUsePipelining_1, value); + } + + bool get HTTPShouldSetCookies { + return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldSetCookies1); + } + + set HTTPShouldSetCookies(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setHTTPShouldSetCookies_1, value); + } + + int get HTTPCookieAcceptPolicy { + return _lib._objc_msgSend_745(_id, _lib._sel_HTTPCookieAcceptPolicy1); + } + + set HTTPCookieAcceptPolicy(int value) { + _lib._objc_msgSend_746(_id, _lib._sel_setHTTPCookieAcceptPolicy_1, value); + } + + NSDictionary? get HTTPAdditionalHeaders { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_HTTPAdditionalHeaders1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set HTTPAdditionalHeaders(NSDictionary? value) { + _lib._objc_msgSend_165( + _id, _lib._sel_setHTTPAdditionalHeaders_1, value?._id ?? ffi.nullptr); + } + + int get HTTPMaximumConnectionsPerHost { + return _lib._objc_msgSend_78(_id, _lib._sel_HTTPMaximumConnectionsPerHost1); + } + + set HTTPMaximumConnectionsPerHost(int value) { + _lib._objc_msgSend_558( + _id, _lib._sel_setHTTPMaximumConnectionsPerHost_1, value); + } + + NSHTTPCookieStorage? get HTTPCookieStorage { + final _ret = _lib._objc_msgSend_739(_id, _lib._sel_HTTPCookieStorage1); + return _ret.address == 0 + ? null + : NSHTTPCookieStorage._(_ret, _lib, retain: true, release: true); + } + + set HTTPCookieStorage(NSHTTPCookieStorage? value) { + _lib._objc_msgSend_917( + _id, _lib._sel_setHTTPCookieStorage_1, value?._id ?? ffi.nullptr); + } + + NSURLCredentialStorage? get URLCredentialStorage { + final _ret = _lib._objc_msgSend_874(_id, _lib._sel_URLCredentialStorage1); + return _ret.address == 0 + ? null + : NSURLCredentialStorage._(_ret, _lib, retain: true, release: true); + } + + set URLCredentialStorage(NSURLCredentialStorage? value) { + _lib._objc_msgSend_918( + _id, _lib._sel_setURLCredentialStorage_1, value?._id ?? ffi.nullptr); + } + + NSURLCache? get URLCache { + final _ret = _lib._objc_msgSend_844(_id, _lib._sel_URLCache1); + return _ret.address == 0 + ? null + : NSURLCache._(_ret, _lib, retain: true, release: true); + } + + set URLCache(NSURLCache? value) { + _lib._objc_msgSend_845( + _id, _lib._sel_setURLCache_1, value?._id ?? ffi.nullptr); + } + + bool get shouldUseExtendedBackgroundIdleMode { + return _lib._objc_msgSend_12( + _id, _lib._sel_shouldUseExtendedBackgroundIdleMode1); + } + + set shouldUseExtendedBackgroundIdleMode(bool value) { + _lib._objc_msgSend_460( + _id, _lib._sel_setShouldUseExtendedBackgroundIdleMode_1, value); + } + + NSArray? get protocolClasses { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_protocolClasses1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set protocolClasses(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setProtocolClasses_1, value?._id ?? ffi.nullptr); + } + + int get multipathServiceType { + return _lib._objc_msgSend_919(_id, _lib._sel_multipathServiceType1); + } + + set multipathServiceType(int value) { + _lib._objc_msgSend_920(_id, _lib._sel_setMultipathServiceType_1, value); + } + + @override + NSURLSessionConfiguration init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionConfiguration new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionConfiguration1, _lib._sel_new1); + return NSURLSessionConfiguration._(_ret, _lib, + retain: false, release: true); + } + + static NSURLSessionConfiguration backgroundSessionConfiguration_( + SwiftLibrary _lib, NSString? identifier) { + final _ret = _lib._objc_msgSend_912( + _lib._class_NSURLSessionConfiguration1, + _lib._sel_backgroundSessionConfiguration_1, + identifier?._id ?? ffi.nullptr); + return NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionConfiguration alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionConfiguration1, _lib._sel_alloc1); + return NSURLSessionConfiguration._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLSessionConfiguration1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLSessionConfiguration1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionConfiguration1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSessionConfiguration1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionConfiguration1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionConfiguration1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLSessionConfiguration1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLSessionConfiguration1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionConfiguration1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class SSLProtocol { + static const int kSSLProtocolUnknown = 0; + static const int kTLSProtocol1 = 4; + static const int kTLSProtocol11 = 7; + static const int kTLSProtocol12 = 8; + static const int kDTLSProtocol1 = 9; + static const int kTLSProtocol13 = 10; + static const int kDTLSProtocol12 = 11; + static const int kTLSProtocolMaxSupported = 999; + static const int kSSLProtocol2 = 1; + static const int kSSLProtocol3 = 2; + static const int kSSLProtocol3Only = 3; + static const int kTLSProtocol1Only = 5; + static const int kSSLProtocolAll = 6; +} + +abstract class tls_protocol_version_t { + static const int tls_protocol_version_TLSv10 = 769; + static const int tls_protocol_version_TLSv11 = 770; + static const int tls_protocol_version_TLSv12 = 771; + static const int tls_protocol_version_TLSv13 = 772; + static const int tls_protocol_version_DTLSv10 = -257; + static const int tls_protocol_version_DTLSv12 = -259; +} + +abstract class NSURLSessionMultipathServiceType { + static const int NSURLSessionMultipathServiceTypeNone = 0; + static const int NSURLSessionMultipathServiceTypeHandover = 1; + static const int NSURLSessionMultipathServiceTypeInteractive = 2; + static const int NSURLSessionMultipathServiceTypeAggregate = 3; +} + +void _ObjCBlock37_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock37_closureRegistry = {}; +int _ObjCBlock37_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock37_registerClosure(Function fn) { + final id = ++_ObjCBlock37_closureRegistryIndex; + _ObjCBlock37_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock37_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return _ObjCBlock37_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock37 extends _ObjCBlockBase { + ObjCBlock37._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock37.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock37_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock37.fromFunction( + SwiftLibrary lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock37_closureTrampoline) + .cast(), + _ObjCBlock37_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +class NSURLSessionUploadTask extends NSURLSessionDataTask { + NSURLSessionUploadTask._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionUploadTask] that points to the same underlying object as [other]. + static NSURLSessionUploadTask castFrom(T other) { + return NSURLSessionUploadTask._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionUploadTask] that wraps the given raw object pointer. + static NSURLSessionUploadTask castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionUploadTask._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionUploadTask]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionUploadTask1); + } + + @override + NSURLSessionUploadTask init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionUploadTask new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionUploadTask1, _lib._sel_new1); + return NSURLSessionUploadTask._(_ret, _lib, retain: false, release: true); + } + + static NSURLSessionUploadTask alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionUploadTask1, _lib._sel_alloc1); + return NSURLSessionUploadTask._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLSessionUploadTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLSessionUploadTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionUploadTask1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSessionUploadTask1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionUploadTask1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionUploadTask1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLSessionUploadTask1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLSessionUploadTask1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionUploadTask1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSURLSessionDownloadTask extends NSURLSessionTask { + NSURLSessionDownloadTask._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionDownloadTask] that points to the same underlying object as [other]. + static NSURLSessionDownloadTask castFrom(T other) { + return NSURLSessionDownloadTask._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionDownloadTask] that wraps the given raw object pointer. + static NSURLSessionDownloadTask castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionDownloadTask._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionDownloadTask]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionDownloadTask1); + } + + void cancelByProducingResumeData_(ObjCBlock38 completionHandler) { + return _lib._objc_msgSend_930( + _id, _lib._sel_cancelByProducingResumeData_1, completionHandler._id); + } + + @override + NSURLSessionDownloadTask init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionDownloadTask new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionDownloadTask1, _lib._sel_new1); + return NSURLSessionDownloadTask._(_ret, _lib, retain: false, release: true); + } + + static NSURLSessionDownloadTask alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionDownloadTask1, _lib._sel_alloc1); + return NSURLSessionDownloadTask._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLSessionDownloadTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLSessionDownloadTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionDownloadTask1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSessionDownloadTask1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionDownloadTask1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionDownloadTask1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLSessionDownloadTask1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLSessionDownloadTask1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionDownloadTask1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock38_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock38_closureRegistry = {}; +int _ObjCBlock38_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock38_registerClosure(Function fn) { + final id = ++_ObjCBlock38_closureRegistryIndex; + _ObjCBlock38_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock38_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return _ObjCBlock38_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock38 extends _ObjCBlockBase { + ObjCBlock38._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock38.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock38_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock38.fromFunction( + SwiftLibrary lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock38_closureTrampoline) + .cast(), + _ObjCBlock38_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_id, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +class NSURLSessionStreamTask extends NSURLSessionTask { + NSURLSessionStreamTask._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionStreamTask] that points to the same underlying object as [other]. + static NSURLSessionStreamTask castFrom(T other) { + return NSURLSessionStreamTask._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionStreamTask] that wraps the given raw object pointer. + static NSURLSessionStreamTask castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionStreamTask._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionStreamTask]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionStreamTask1); + } + + void readDataOfMinLength_maxLength_timeout_completionHandler_(int minBytes, + int maxBytes, double timeout, ObjCBlock39 completionHandler) { + return _lib._objc_msgSend_934( + _id, + _lib._sel_readDataOfMinLength_maxLength_timeout_completionHandler_1, + minBytes, + maxBytes, + timeout, + completionHandler._id); + } + + void writeData_timeout_completionHandler_( + NSData? data, double timeout, ObjCBlock15 completionHandler) { + return _lib._objc_msgSend_935( + _id, + _lib._sel_writeData_timeout_completionHandler_1, + data?._id ?? ffi.nullptr, + timeout, + completionHandler._id); + } + + void captureStreams() { + return _lib._objc_msgSend_1(_id, _lib._sel_captureStreams1); + } + + void closeWrite() { + return _lib._objc_msgSend_1(_id, _lib._sel_closeWrite1); + } + + void closeRead() { + return _lib._objc_msgSend_1(_id, _lib._sel_closeRead1); + } + + void startSecureConnection() { + return _lib._objc_msgSend_1(_id, _lib._sel_startSecureConnection1); + } + + void stopSecureConnection() { + return _lib._objc_msgSend_1(_id, _lib._sel_stopSecureConnection1); + } + + @override + NSURLSessionStreamTask init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionStreamTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionStreamTask new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionStreamTask1, _lib._sel_new1); + return NSURLSessionStreamTask._(_ret, _lib, retain: false, release: true); + } + + static NSURLSessionStreamTask alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionStreamTask1, _lib._sel_alloc1); + return NSURLSessionStreamTask._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLSessionStreamTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLSessionStreamTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionStreamTask1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSessionStreamTask1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionStreamTask1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionStreamTask1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLSessionStreamTask1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLSessionStreamTask1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionStreamTask1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock39_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, bool arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock39_closureRegistry = {}; +int _ObjCBlock39_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock39_registerClosure(Function fn) { + final id = ++_ObjCBlock39_closureRegistryIndex; + _ObjCBlock39_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock39_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { + return _ObjCBlock39_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock39 extends _ObjCBlockBase { + ObjCBlock39._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock39.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock39_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock39.fromFunction( + SwiftLibrary lib, + void Function(ffi.Pointer arg0, bool arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock39_closureTrampoline) + .cast(), + _ObjCBlock39_registerClosure(fn)), + lib); + void call( + ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + bool arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +class NSNetService extends NSObject { + NSNetService._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSNetService] that points to the same underlying object as [other]. + static NSNetService castFrom(T other) { + return NSNetService._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSNetService] that wraps the given raw object pointer. + static NSNetService castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSNetService._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSNetService]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSNetService1); + } + + NSNetService initWithDomain_type_name_port_( + NSString? domain, NSString? type, NSString? name, int port) { + final _ret = _lib._objc_msgSend_937( + _id, + _lib._sel_initWithDomain_type_name_port_1, + domain?._id ?? ffi.nullptr, + type?._id ?? ffi.nullptr, + name?._id ?? ffi.nullptr, + port); + return NSNetService._(_ret, _lib, retain: true, release: true); + } + + NSNetService initWithDomain_type_name_( + NSString? domain, NSString? type, NSString? name) { + final _ret = _lib._objc_msgSend_26( + _id, + _lib._sel_initWithDomain_type_name_1, + domain?._id ?? ffi.nullptr, + type?._id ?? ffi.nullptr, + name?._id ?? ffi.nullptr); + return NSNetService._(_ret, _lib, retain: true, release: true); + } + + void scheduleInRunLoop_forMode_(NSRunLoop? aRunLoop, NSRunLoopMode mode) { + return _lib._objc_msgSend_501(_id, _lib._sel_scheduleInRunLoop_forMode_1, + aRunLoop?._id ?? ffi.nullptr, mode); + } + + void removeFromRunLoop_forMode_(NSRunLoop? aRunLoop, NSRunLoopMode mode) { + return _lib._objc_msgSend_501(_id, _lib._sel_removeFromRunLoop_forMode_1, + aRunLoop?._id ?? ffi.nullptr, mode); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + _lib._objc_msgSend_368( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + bool get includesPeerToPeer { + return _lib._objc_msgSend_12(_id, _lib._sel_includesPeerToPeer1); + } + + set includesPeerToPeer(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setIncludesPeerToPeer_1, value); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get type { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_type1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get domain { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_domain1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get hostName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_hostName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get addresses { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_addresses1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + int get port { + return _lib._objc_msgSend_78(_id, _lib._sel_port1); + } + + void publish() { + return _lib._objc_msgSend_1(_id, _lib._sel_publish1); + } + + void publishWithOptions_(int options) { + return _lib._objc_msgSend_938(_id, _lib._sel_publishWithOptions_1, options); + } + + void resolve() { + return _lib._objc_msgSend_1(_id, _lib._sel_resolve1); + } + + void stop() { + return _lib._objc_msgSend_1(_id, _lib._sel_stop1); + } + + static NSDictionary dictionaryFromTXTRecordData_( + SwiftLibrary _lib, NSData? txtData) { + final _ret = _lib._objc_msgSend_939(_lib._class_NSNetService1, + _lib._sel_dictionaryFromTXTRecordData_1, txtData?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSData dataFromTXTRecordDictionary_( + SwiftLibrary _lib, NSDictionary? txtDictionary) { + final _ret = _lib._objc_msgSend_940( + _lib._class_NSNetService1, + _lib._sel_dataFromTXTRecordDictionary_1, + txtDictionary?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + void resolveWithTimeout_(double timeout) { + return _lib._objc_msgSend_473(_id, _lib._sel_resolveWithTimeout_1, timeout); + } + + bool getInputStream_outputStream_( + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + return _lib._objc_msgSend_941(_id, _lib._sel_getInputStream_outputStream_1, + inputStream, outputStream); + } + + bool setTXTRecordData_(NSData? recordData) { + return _lib._objc_msgSend_23( + _id, _lib._sel_setTXTRecordData_1, recordData?._id ?? ffi.nullptr); + } + + NSData TXTRecordData() { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_TXTRecordData1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + void startMonitoring() { + return _lib._objc_msgSend_1(_id, _lib._sel_startMonitoring1); + } + + void stopMonitoring() { + return _lib._objc_msgSend_1(_id, _lib._sel_stopMonitoring1); + } + + static NSNetService new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSNetService1, _lib._sel_new1); + return NSNetService._(_ret, _lib, retain: false, release: true); + } + + static NSNetService alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSNetService1, _lib._sel_alloc1); + return NSNetService._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSNetService1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSNetService1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSNetService1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSNetService1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSNetService1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSNetService1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSNetService1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSNetService1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSNetService1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSNetServiceOptions { + static const int NSNetServiceNoAutoRename = 1; + static const int NSNetServiceListenForConnections = 2; +} + +class NSURLSessionWebSocketTask extends NSURLSessionTask { + NSURLSessionWebSocketTask._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionWebSocketTask] that points to the same underlying object as [other]. + static NSURLSessionWebSocketTask castFrom(T other) { + return NSURLSessionWebSocketTask._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionWebSocketTask] that wraps the given raw object pointer. + static NSURLSessionWebSocketTask castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionWebSocketTask._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionWebSocketTask]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionWebSocketTask1); + } + + void sendMessage_completionHandler_( + NSURLSessionWebSocketMessage? message, ObjCBlock15 completionHandler) { + return _lib._objc_msgSend_944( + _id, + _lib._sel_sendMessage_completionHandler_1, + message?._id ?? ffi.nullptr, + completionHandler._id); + } + + void receiveMessageWithCompletionHandler_(ObjCBlock40 completionHandler) { + return _lib._objc_msgSend_945(_id, + _lib._sel_receiveMessageWithCompletionHandler_1, completionHandler._id); + } + + void sendPingWithPongReceiveHandler_(ObjCBlock15 pongReceiveHandler) { + return _lib._objc_msgSend_946(_id, + _lib._sel_sendPingWithPongReceiveHandler_1, pongReceiveHandler._id); + } + + void cancelWithCloseCode_reason_(int closeCode, NSData? reason) { + return _lib._objc_msgSend_947(_id, _lib._sel_cancelWithCloseCode_reason_1, + closeCode, reason?._id ?? ffi.nullptr); + } + + int get maximumMessageSize { + return _lib._objc_msgSend_78(_id, _lib._sel_maximumMessageSize1); + } + + set maximumMessageSize(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setMaximumMessageSize_1, value); + } + + int get closeCode { + return _lib._objc_msgSend_948(_id, _lib._sel_closeCode1); + } + + NSData? get closeReason { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_closeReason1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + @override + NSURLSessionWebSocketTask init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionWebSocketTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionWebSocketTask new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionWebSocketTask1, _lib._sel_new1); + return NSURLSessionWebSocketTask._(_ret, _lib, + retain: false, release: true); + } + + static NSURLSessionWebSocketTask alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionWebSocketTask1, _lib._sel_alloc1); + return NSURLSessionWebSocketTask._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLSessionWebSocketTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLSessionWebSocketTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionWebSocketTask1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSessionWebSocketTask1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionWebSocketTask1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionWebSocketTask1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLSessionWebSocketTask1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80(_lib._class_NSURLSessionWebSocketTask1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionWebSocketTask1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSURLSessionWebSocketMessage extends NSObject { + NSURLSessionWebSocketMessage._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionWebSocketMessage] that points to the same underlying object as [other]. + static NSURLSessionWebSocketMessage castFrom( + T other) { + return NSURLSessionWebSocketMessage._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionWebSocketMessage] that wraps the given raw object pointer. + static NSURLSessionWebSocketMessage castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionWebSocketMessage._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionWebSocketMessage]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionWebSocketMessage1); + } + + NSURLSessionWebSocketMessage initWithData_(NSData? data) { + final _ret = _lib._objc_msgSend_242( + _id, _lib._sel_initWithData_1, data?._id ?? ffi.nullptr); + return NSURLSessionWebSocketMessage._(_ret, _lib, + retain: true, release: true); + } + + NSURLSessionWebSocketMessage initWithString_(NSString? string) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, string?._id ?? ffi.nullptr); + return NSURLSessionWebSocketMessage._(_ret, _lib, + retain: true, release: true); + } + + int get type { + return _lib._objc_msgSend_943(_id, _lib._sel_type1); + } + + NSData? get data { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_data1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSString? get string { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_string1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + @override + NSURLSessionWebSocketMessage init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionWebSocketMessage._(_ret, _lib, + retain: true, release: true); + } + + static NSURLSessionWebSocketMessage new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionWebSocketMessage1, _lib._sel_new1); + return NSURLSessionWebSocketMessage._(_ret, _lib, + retain: false, release: true); + } + + static NSURLSessionWebSocketMessage alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionWebSocketMessage1, _lib._sel_alloc1); + return NSURLSessionWebSocketMessage._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSURLSessionWebSocketMessageType { + static const int NSURLSessionWebSocketMessageTypeData = 0; + static const int NSURLSessionWebSocketMessageTypeString = 1; +} + +void _ObjCBlock40_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock40_closureRegistry = {}; +int _ObjCBlock40_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock40_registerClosure(Function fn) { + final id = ++_ObjCBlock40_closureRegistryIndex; + _ObjCBlock40_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock40_closureTrampoline(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.Pointer arg1) { + return _ObjCBlock40_closureRegistry[block.ref.target.address]!(arg0, arg1); +} + +class ObjCBlock40 extends _ObjCBlockBase { + ObjCBlock40._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock40.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock40_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock40.fromFunction( + SwiftLibrary lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock40_closureTrampoline) + .cast(), + _ObjCBlock40_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +abstract class NSURLSessionWebSocketCloseCode { + static const int NSURLSessionWebSocketCloseCodeInvalid = 0; + static const int NSURLSessionWebSocketCloseCodeNormalClosure = 1000; + static const int NSURLSessionWebSocketCloseCodeGoingAway = 1001; + static const int NSURLSessionWebSocketCloseCodeProtocolError = 1002; + static const int NSURLSessionWebSocketCloseCodeUnsupportedData = 1003; + static const int NSURLSessionWebSocketCloseCodeNoStatusReceived = 1005; + static const int NSURLSessionWebSocketCloseCodeAbnormalClosure = 1006; + static const int NSURLSessionWebSocketCloseCodeInvalidFramePayloadData = 1007; + static const int NSURLSessionWebSocketCloseCodePolicyViolation = 1008; + static const int NSURLSessionWebSocketCloseCodeMessageTooBig = 1009; + static const int NSURLSessionWebSocketCloseCodeMandatoryExtensionMissing = + 1010; + static const int NSURLSessionWebSocketCloseCodeInternalServerError = 1011; + static const int NSURLSessionWebSocketCloseCodeTLSHandshakeFailure = 1015; +} + +void _ObjCBlock41_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock41_closureRegistry = {}; +int _ObjCBlock41_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock41_registerClosure(Function fn) { + final id = ++_ObjCBlock41_closureRegistryIndex; + _ObjCBlock41_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock41_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return _ObjCBlock41_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock41 extends _ObjCBlockBase { + ObjCBlock41._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock41.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock41_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock41.fromFunction( + SwiftLibrary lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock41_closureTrampoline) + .cast(), + _ObjCBlock41_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +void _ObjCBlock42_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock42_closureRegistry = {}; +int _ObjCBlock42_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock42_registerClosure(Function fn) { + final id = ++_ObjCBlock42_closureRegistryIndex; + _ObjCBlock42_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock42_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return _ObjCBlock42_closureRegistry[block.ref.target.address]!( + arg0, arg1, arg2); +} + +class ObjCBlock42 extends _ObjCBlockBase { + ObjCBlock42._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock42.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock42_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock42.fromFunction( + SwiftLibrary lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock42_closureTrampoline) + .cast(), + _ObjCBlock42_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +class NSProtocolChecker extends NSProxy { + NSProtocolChecker._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSProtocolChecker] that points to the same underlying object as [other]. + static NSProtocolChecker castFrom(T other) { + return NSProtocolChecker._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSProtocolChecker] that wraps the given raw object pointer. + static NSProtocolChecker castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSProtocolChecker._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSProtocolChecker]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSProtocolChecker1); + } + + Protocol? get protocol { + final _ret = _lib._objc_msgSend_959(_id, _lib._sel_protocol1); + return _ret.address == 0 + ? null + : Protocol._(_ret, _lib, retain: true, release: true); + } + + NSObject? get target { + final _ret = _lib._objc_msgSend_788(_id, _lib._sel_target1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSProtocolChecker protocolCheckerWithTarget_protocol_( + SwiftLibrary _lib, NSObject? anObject, Protocol? aProtocol) { + final _ret = _lib._objc_msgSend_960( + _lib._class_NSProtocolChecker1, + _lib._sel_protocolCheckerWithTarget_protocol_1, + anObject?._id ?? ffi.nullptr, + aProtocol?._id ?? ffi.nullptr); + return NSProtocolChecker._(_ret, _lib, retain: true, release: true); + } + + NSProtocolChecker initWithTarget_protocol_( + NSObject? anObject, Protocol? aProtocol) { + final _ret = _lib._objc_msgSend_960( + _id, + _lib._sel_initWithTarget_protocol_1, + anObject?._id ?? ffi.nullptr, + aProtocol?._id ?? ffi.nullptr); + return NSProtocolChecker._(_ret, _lib, retain: true, release: true); + } + + static NSObject alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSProtocolChecker1, _lib._sel_alloc1); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static bool respondsToSelector_( + SwiftLibrary _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_4(_lib._class_NSProtocolChecker1, + _lib._sel_respondsToSelector_1, aSelector); + } +} + +class NSTask extends NSObject { + NSTask._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSTask] that points to the same underlying object as [other]. + static NSTask castFrom(T other) { + return NSTask._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSTask] that wraps the given raw object pointer. + static NSTask castFromPointer(SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSTask._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSTask]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSTask1); + } + + @override + NSTask init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSTask._(_ret, _lib, retain: true, release: true); + } + + NSURL? get executableURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_executableURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + set executableURL(NSURL? value) { + _lib._objc_msgSend_888( + _id, _lib._sel_setExecutableURL_1, value?._id ?? ffi.nullptr); + } + + NSArray? get arguments { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_arguments1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set arguments(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setArguments_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get environment { + final _ret = _lib._objc_msgSend_164(_id, _lib._sel_environment1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set environment(NSDictionary? value) { + _lib._objc_msgSend_165( + _id, _lib._sel_setEnvironment_1, value?._id ?? ffi.nullptr); + } + + NSURL? get currentDirectoryURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_currentDirectoryURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + set currentDirectoryURL(NSURL? value) { + _lib._objc_msgSend_888( + _id, _lib._sel_setCurrentDirectoryURL_1, value?._id ?? ffi.nullptr); + } + + NSObject get standardInput { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_standardInput1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set standardInput(NSObject value) { + _lib._objc_msgSend_368(_id, _lib._sel_setStandardInput_1, value._id); + } + + NSObject get standardOutput { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_standardOutput1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set standardOutput(NSObject value) { + _lib._objc_msgSend_368(_id, _lib._sel_setStandardOutput_1, value._id); + } + + NSObject get standardError { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_standardError1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set standardError(NSObject value) { + _lib._objc_msgSend_368(_id, _lib._sel_setStandardError_1, value._id); + } + + bool launchAndReturnError_(ffi.Pointer> error) { + return _lib._objc_msgSend_219(_id, _lib._sel_launchAndReturnError_1, error); + } + + void interrupt() { + return _lib._objc_msgSend_1(_id, _lib._sel_interrupt1); + } + + void terminate() { + return _lib._objc_msgSend_1(_id, _lib._sel_terminate1); + } + + bool suspend() { + return _lib._objc_msgSend_12(_id, _lib._sel_suspend1); + } + + bool resume() { + return _lib._objc_msgSend_12(_id, _lib._sel_resume1); + } + + int get processIdentifier { + return _lib._objc_msgSend_213(_id, _lib._sel_processIdentifier1); + } + + bool get running { + return _lib._objc_msgSend_12(_id, _lib._sel_isRunning1); + } + + int get terminationStatus { + return _lib._objc_msgSend_213(_id, _lib._sel_terminationStatus1); + } + + int get terminationReason { + return _lib._objc_msgSend_961(_id, _lib._sel_terminationReason1); + } + + ObjCBlock43 get terminationHandler { + final _ret = _lib._objc_msgSend_962(_id, _lib._sel_terminationHandler1); + return ObjCBlock43._(_ret, _lib); + } + + set terminationHandler(ObjCBlock43 value) { + _lib._objc_msgSend_963(_id, _lib._sel_setTerminationHandler_1, value._id); + } + + int get qualityOfService { + return _lib._objc_msgSend_475(_id, _lib._sel_qualityOfService1); + } + + set qualityOfService(int value) { + _lib._objc_msgSend_476(_id, _lib._sel_setQualityOfService_1, value); + } + + static NSTask + launchedTaskWithExecutableURL_arguments_error_terminationHandler_( + SwiftLibrary _lib, + NSURL? url, + NSArray? arguments, + ffi.Pointer> error, + ObjCBlock43 terminationHandler) { + final _ret = _lib._objc_msgSend_964( + _lib._class_NSTask1, + _lib._sel_launchedTaskWithExecutableURL_arguments_error_terminationHandler_1, + url?._id ?? ffi.nullptr, + arguments?._id ?? ffi.nullptr, + error, + terminationHandler._id); + return NSTask._(_ret, _lib, retain: true, release: true); + } + + void waitUntilExit() { + return _lib._objc_msgSend_1(_id, _lib._sel_waitUntilExit1); + } + + NSString? get launchPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_launchPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set launchPath(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setLaunchPath_1, value?._id ?? ffi.nullptr); + } + + NSString? get currentDirectoryPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_currentDirectoryPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set currentDirectoryPath(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setCurrentDirectoryPath_1, value?._id ?? ffi.nullptr); + } + + void launch() { + return _lib._objc_msgSend_1(_id, _lib._sel_launch1); + } + + static NSTask launchedTaskWithLaunchPath_arguments_( + SwiftLibrary _lib, NSString? path, NSArray? arguments) { + final _ret = _lib._objc_msgSend_965( + _lib._class_NSTask1, + _lib._sel_launchedTaskWithLaunchPath_arguments_1, + path?._id ?? ffi.nullptr, + arguments?._id ?? ffi.nullptr); + return NSTask._(_ret, _lib, retain: true, release: true); + } + + static NSTask new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSTask1, _lib._sel_new1); + return NSTask._(_ret, _lib, retain: false, release: true); + } + + static NSTask alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSTask1, _lib._sel_alloc1); + return NSTask._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSTask1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSTask1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSTask1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSTask1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSTask1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSTask1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSTask1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSTaskTerminationReason { + static const int NSTaskTerminationReasonExit = 1; + static const int NSTaskTerminationReasonUncaughtSignal = 2; +} + +void _ObjCBlock43_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock43_closureRegistry = {}; +int _ObjCBlock43_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock43_registerClosure(Function fn) { + final id = ++_ObjCBlock43_closureRegistryIndex; + _ObjCBlock43_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock43_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return _ObjCBlock43_closureRegistry[block.ref.target.address]!(arg0); +} + +class ObjCBlock43 extends _ObjCBlockBase { + ObjCBlock43._(ffi.Pointer<_ObjCBlock> id, SwiftLibrary lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock43.fromFunctionPointer( + SwiftLibrary lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock43_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + + /// Creates a block from a Dart function. + ObjCBlock43.fromFunction( + SwiftLibrary lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock43_closureTrampoline) + .cast(), + _ObjCBlock43_registerClosure(fn)), + lib); + void call(ffi.Pointer arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_id, arg0); + } + + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +class NSXMLElement extends NSXMLNode { + NSXMLElement._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSXMLElement] that points to the same underlying object as [other]. + static NSXMLElement castFrom(T other) { + return NSXMLElement._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSXMLElement] that wraps the given raw object pointer. + static NSXMLElement castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSXMLElement._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSXMLElement]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLElement1); + } + + NSXMLElement initWithName_(NSString? name) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithName_1, name?._id ?? ffi.nullptr); + return NSXMLElement._(_ret, _lib, retain: true, release: true); + } + + NSXMLElement initWithName_URI_(NSString? name, NSString? URI) { + final _ret = _lib._objc_msgSend_159(_id, _lib._sel_initWithName_URI_1, + name?._id ?? ffi.nullptr, URI?._id ?? ffi.nullptr); + return NSXMLElement._(_ret, _lib, retain: true, release: true); + } + + NSXMLElement initWithName_stringValue_(NSString? name, NSString? string) { + final _ret = _lib._objc_msgSend_159( + _id, + _lib._sel_initWithName_stringValue_1, + name?._id ?? ffi.nullptr, + string?._id ?? ffi.nullptr); + return NSXMLElement._(_ret, _lib, retain: true, release: true); + } + + NSXMLElement initWithXMLString_error_( + NSString? string, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_264(_id, + _lib._sel_initWithXMLString_error_1, string?._id ?? ffi.nullptr, error); + return NSXMLElement._(_ret, _lib, retain: true, release: true); + } + + @override + NSXMLElement initWithKind_options_(int kind, int options) { + final _ret = _lib._objc_msgSend_967( + _id, _lib._sel_initWithKind_options_1, kind, options); + return NSXMLElement._(_ret, _lib, retain: true, release: true); + } + + NSArray elementsForName_(NSString? name) { + final _ret = _lib._objc_msgSend_119( + _id, _lib._sel_elementsForName_1, name?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray elementsForLocalName_URI_(NSString? localName, NSString? URI) { + final _ret = _lib._objc_msgSend_617( + _id, + _lib._sel_elementsForLocalName_URI_1, + localName?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void addAttribute_(NSXMLNode? attribute) { + return _lib._objc_msgSend_979( + _id, _lib._sel_addAttribute_1, attribute?._id ?? ffi.nullptr); + } + + void removeAttributeForName_(NSString? name) { + return _lib._objc_msgSend_186( + _id, _lib._sel_removeAttributeForName_1, name?._id ?? ffi.nullptr); + } + + NSArray? get attributes { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_attributes1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set attributes(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setAttributes_1, value?._id ?? ffi.nullptr); + } + + void setAttributesWithDictionary_(NSDictionary? attributes) { + return _lib._objc_msgSend_444(_id, _lib._sel_setAttributesWithDictionary_1, + attributes?._id ?? ffi.nullptr); + } + + NSXMLNode attributeForName_(NSString? name) { + final _ret = _lib._objc_msgSend_983( + _id, _lib._sel_attributeForName_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode attributeForLocalName_URI_(NSString? localName, NSString? URI) { + final _ret = _lib._objc_msgSend_1000( + _id, + _lib._sel_attributeForLocalName_URI_1, + localName?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + void addNamespace_(NSXMLNode? aNamespace) { + return _lib._objc_msgSend_979( + _id, _lib._sel_addNamespace_1, aNamespace?._id ?? ffi.nullptr); + } + + void removeNamespaceForPrefix_(NSString? name) { + return _lib._objc_msgSend_186( + _id, _lib._sel_removeNamespaceForPrefix_1, name?._id ?? ffi.nullptr); + } + + NSArray? get namespaces { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_namespaces1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set namespaces(NSArray? value) { + _lib._objc_msgSend_696( + _id, _lib._sel_setNamespaces_1, value?._id ?? ffi.nullptr); + } + + NSXMLNode namespaceForPrefix_(NSString? name) { + final _ret = _lib._objc_msgSend_983( + _id, _lib._sel_namespaceForPrefix_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode resolveNamespaceForName_(NSString? name) { + final _ret = _lib._objc_msgSend_983( + _id, _lib._sel_resolveNamespaceForName_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSString resolvePrefixForNamespaceURI_(NSString? namespaceURI) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_resolvePrefixForNamespaceURI_1, + namespaceURI?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + void insertChild_atIndex_(NSXMLNode? child, int index) { + return _lib._objc_msgSend_977( + _id, _lib._sel_insertChild_atIndex_1, child?._id ?? ffi.nullptr, index); + } + + void insertChildren_atIndex_(NSArray? children, int index) { + return _lib._objc_msgSend_978(_id, _lib._sel_insertChildren_atIndex_1, + children?._id ?? ffi.nullptr, index); + } + + void removeChildAtIndex_(int index) { + return _lib._objc_msgSend_410(_id, _lib._sel_removeChildAtIndex_1, index); + } + + void setChildren_(NSArray? children) { + return _lib._objc_msgSend_412( + _id, _lib._sel_setChildren_1, children?._id ?? ffi.nullptr); + } + + void addChild_(NSXMLNode? child) { + return _lib._objc_msgSend_979( + _id, _lib._sel_addChild_1, child?._id ?? ffi.nullptr); + } + + void replaceChildAtIndex_withNode_(int index, NSXMLNode? node) { + return _lib._objc_msgSend_980(_id, _lib._sel_replaceChildAtIndex_withNode_1, + index, node?._id ?? ffi.nullptr); + } + + void normalizeAdjacentTextNodesPreservingCDATA_(bool preserve) { + return _lib._objc_msgSend_756( + _id, _lib._sel_normalizeAdjacentTextNodesPreservingCDATA_1, preserve); + } + + void setAttributesAsDictionary_(NSDictionary? attributes) { + return _lib._objc_msgSend_444(_id, _lib._sel_setAttributesAsDictionary_1, + attributes?._id ?? ffi.nullptr); + } + + static NSObject document(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLElement1, _lib._sel_document1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject documentWithRootElement_( + SwiftLibrary _lib, NSXMLElement? element) { + final _ret = _lib._objc_msgSend_968(_lib._class_NSXMLElement1, + _lib._sel_documentWithRootElement_1, element?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_(SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLElement1, + _lib._sel_elementWithName_1, name?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_URI_( + SwiftLibrary _lib, NSString? name, NSString? URI) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLElement1, + _lib._sel_elementWithName_URI_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? string) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLElement1, + _lib._sel_elementWithName_stringValue_1, + name?._id ?? ffi.nullptr, + string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_children_attributes_(SwiftLibrary _lib, + NSString? name, NSArray? children, NSArray? attributes) { + final _ret = _lib._objc_msgSend_969( + _lib._class_NSXMLElement1, + _lib._sel_elementWithName_children_attributes_1, + name?._id ?? ffi.nullptr, + children?._id ?? ffi.nullptr, + attributes?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLElement1, + _lib._sel_attributeWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_URI_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? URI, NSString? stringValue) { + final _ret = _lib._objc_msgSend_26( + _lib._class_NSXMLElement1, + _lib._sel_attributeWithName_URI_stringValue_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject namespaceWithName_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLElement1, + _lib._sel_namespaceWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject processingInstructionWithName_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLElement1, + _lib._sel_processingInstructionWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject commentWithStringValue_( + SwiftLibrary _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLElement1, + _lib._sel_commentWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject textWithStringValue_( + SwiftLibrary _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLElement1, + _lib._sel_textWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject DTDNodeWithXMLString_(SwiftLibrary _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLElement1, + _lib._sel_DTDNodeWithXMLString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSString localNameForName_(SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLElement1, + _lib._sel_localNameForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString prefixForName_(SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLElement1, + _lib._sel_prefixForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSXMLNode predefinedNamespaceForPrefix_( + SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_983(_lib._class_NSXMLElement1, + _lib._sel_predefinedNamespaceForPrefix_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + static NSXMLElement new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLElement1, _lib._sel_new1); + return NSXMLElement._(_ret, _lib, retain: false, release: true); + } + + static NSXMLElement alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLElement1, _lib._sel_alloc1); + return NSXMLElement._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSXMLElement1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSXMLElement1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLElement1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLElement1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSXMLElement1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSXMLElement1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSXMLElement1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSXMLElement1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSXMLElement1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSXMLNode extends NSObject { + NSXMLNode._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSXMLNode] that points to the same underlying object as [other]. + static NSXMLNode castFrom(T other) { + return NSXMLNode._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSXMLNode] that wraps the given raw object pointer. + static NSXMLNode castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSXMLNode._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSXMLNode]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLNode1); + } + + @override + NSXMLNode init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode initWithKind_(int kind) { + final _ret = _lib._objc_msgSend_966(_id, _lib._sel_initWithKind_1, kind); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode initWithKind_options_(int kind, int options) { + final _ret = _lib._objc_msgSend_967( + _id, _lib._sel_initWithKind_options_1, kind, options); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + static NSObject document(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLNode1, _lib._sel_document1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject documentWithRootElement_( + SwiftLibrary _lib, NSXMLElement? element) { + final _ret = _lib._objc_msgSend_968(_lib._class_NSXMLNode1, + _lib._sel_documentWithRootElement_1, element?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_(SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLNode1, + _lib._sel_elementWithName_1, name?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_URI_( + SwiftLibrary _lib, NSString? name, NSString? URI) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLNode1, + _lib._sel_elementWithName_URI_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? string) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLNode1, + _lib._sel_elementWithName_stringValue_1, + name?._id ?? ffi.nullptr, + string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_children_attributes_(SwiftLibrary _lib, + NSString? name, NSArray? children, NSArray? attributes) { + final _ret = _lib._objc_msgSend_969( + _lib._class_NSXMLNode1, + _lib._sel_elementWithName_children_attributes_1, + name?._id ?? ffi.nullptr, + children?._id ?? ffi.nullptr, + attributes?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLNode1, + _lib._sel_attributeWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_URI_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? URI, NSString? stringValue) { + final _ret = _lib._objc_msgSend_26( + _lib._class_NSXMLNode1, + _lib._sel_attributeWithName_URI_stringValue_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject namespaceWithName_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLNode1, + _lib._sel_namespaceWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject processingInstructionWithName_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLNode1, + _lib._sel_processingInstructionWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject commentWithStringValue_( + SwiftLibrary _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLNode1, + _lib._sel_commentWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject textWithStringValue_( + SwiftLibrary _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLNode1, + _lib._sel_textWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject DTDNodeWithXMLString_(SwiftLibrary _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLNode1, + _lib._sel_DTDNodeWithXMLString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + int get kind { + return _lib._objc_msgSend_970(_id, _lib._sel_kind1); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set name(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setName_1, value?._id ?? ffi.nullptr); + } + + NSObject get objectValue { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_objectValue1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set objectValue(NSObject value) { + _lib._objc_msgSend_368(_id, _lib._sel_setObjectValue_1, value._id); + } + + NSString? get stringValue { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_stringValue1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set stringValue(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setStringValue_1, value?._id ?? ffi.nullptr); + } + + void setStringValue_resolvingEntities_(NSString? string, bool resolve) { + return _lib._objc_msgSend_971( + _id, + _lib._sel_setStringValue_resolvingEntities_1, + string?._id ?? ffi.nullptr, + resolve); + } + + int get index { + return _lib._objc_msgSend_10(_id, _lib._sel_index1); + } + + int get level { + return _lib._objc_msgSend_10(_id, _lib._sel_level1); + } + + NSXMLDocument? get rootDocument { + final _ret = _lib._objc_msgSend_994(_id, _lib._sel_rootDocument1); + return _ret.address == 0 + ? null + : NSXMLDocument._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode? get parent { + final _ret = _lib._objc_msgSend_995(_id, _lib._sel_parent1); + return _ret.address == 0 + ? null + : NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + int get childCount { + return _lib._objc_msgSend_10(_id, _lib._sel_childCount1); + } + + NSArray? get children { + final _ret = _lib._objc_msgSend_80(_id, _lib._sel_children1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode childAtIndex_(int index) { + final _ret = _lib._objc_msgSend_996(_id, _lib._sel_childAtIndex_1, index); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode? get previousSibling { + final _ret = _lib._objc_msgSend_995(_id, _lib._sel_previousSibling1); + return _ret.address == 0 + ? null + : NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode? get nextSibling { + final _ret = _lib._objc_msgSend_995(_id, _lib._sel_nextSibling1); + return _ret.address == 0 + ? null + : NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode? get previousNode { + final _ret = _lib._objc_msgSend_995(_id, _lib._sel_previousNode1); + return _ret.address == 0 + ? null + : NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode? get nextNode { + final _ret = _lib._objc_msgSend_995(_id, _lib._sel_nextNode1); + return _ret.address == 0 + ? null + : NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + void detach() { + return _lib._objc_msgSend_1(_id, _lib._sel_detach1); + } + + NSString? get XPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_XPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get localName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_localName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get prefix { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_prefix1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get URI { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_URI1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set URI(NSString? value) { + _lib._objc_msgSend_477(_id, _lib._sel_setURI_1, value?._id ?? ffi.nullptr); + } + + static NSString localNameForName_(SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLNode1, + _lib._sel_localNameForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString prefixForName_(SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLNode1, + _lib._sel_prefixForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSXMLNode predefinedNamespaceForPrefix_( + SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_983(_lib._class_NSXMLNode1, + _lib._sel_predefinedNamespaceForPrefix_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get XMLString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_XMLString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString XMLStringWithOptions_(int options) { + final _ret = + _lib._objc_msgSend_997(_id, _lib._sel_XMLStringWithOptions_1, options); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString canonicalXMLStringPreservingComments_(bool comments) { + final _ret = _lib._objc_msgSend_998( + _id, _lib._sel_canonicalXMLStringPreservingComments_1, comments); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray nodesForXPath_error_( + NSString? xpath, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_394( + _id, _lib._sel_nodesForXPath_error_1, xpath?._id ?? ffi.nullptr, error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray objectsForXQuery_constants_error_(NSString? xquery, + NSDictionary? constants, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_999( + _id, + _lib._sel_objectsForXQuery_constants_error_1, + xquery?._id ?? ffi.nullptr, + constants?._id ?? ffi.nullptr, + error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray objectsForXQuery_error_( + NSString? xquery, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_394(_id, _lib._sel_objectsForXQuery_error_1, + xquery?._id ?? ffi.nullptr, error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSXMLNode new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSXMLNode1, _lib._sel_new1); + return NSXMLNode._(_ret, _lib, retain: false, release: true); + } + + static NSXMLNode alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSXMLNode1, _lib._sel_alloc1); + return NSXMLNode._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSXMLNode1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSXMLNode1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLNode1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLNode1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSXMLNode1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSXMLNode1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSXMLNode1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSXMLNode1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSXMLNode1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSXMLNodeKind { + static const int NSXMLInvalidKind = 0; + static const int NSXMLDocumentKind = 1; + static const int NSXMLElementKind = 2; + static const int NSXMLAttributeKind = 3; + static const int NSXMLNamespaceKind = 4; + static const int NSXMLProcessingInstructionKind = 5; + static const int NSXMLCommentKind = 6; + static const int NSXMLTextKind = 7; + static const int NSXMLDTDKind = 8; + static const int NSXMLEntityDeclarationKind = 9; + static const int NSXMLAttributeDeclarationKind = 10; + static const int NSXMLElementDeclarationKind = 11; + static const int NSXMLNotationDeclarationKind = 12; +} + +abstract class NSXMLNodeOptions { + static const int NSXMLNodeOptionsNone = 0; + static const int NSXMLNodeIsCDATA = 1; + static const int NSXMLNodeExpandEmptyElement = 2; + static const int NSXMLNodeCompactEmptyElement = 4; + static const int NSXMLNodeUseSingleQuotes = 8; + static const int NSXMLNodeUseDoubleQuotes = 16; + static const int NSXMLNodeNeverEscapeContents = 32; + static const int NSXMLDocumentTidyHTML = 512; + static const int NSXMLDocumentTidyXML = 1024; + static const int NSXMLDocumentValidate = 8192; + static const int NSXMLNodeLoadExternalEntitiesAlways = 16384; + static const int NSXMLNodeLoadExternalEntitiesSameOriginOnly = 32768; + static const int NSXMLNodeLoadExternalEntitiesNever = 524288; + static const int NSXMLDocumentXInclude = 65536; + static const int NSXMLNodePrettyPrint = 131072; + static const int NSXMLDocumentIncludeContentTypeDeclaration = 262144; + static const int NSXMLNodePreserveNamespaceOrder = 1048576; + static const int NSXMLNodePreserveAttributeOrder = 2097152; + static const int NSXMLNodePreserveEntities = 4194304; + static const int NSXMLNodePreservePrefixes = 8388608; + static const int NSXMLNodePreserveCDATA = 16777216; + static const int NSXMLNodePreserveWhitespace = 33554432; + static const int NSXMLNodePreserveDTD = 67108864; + static const int NSXMLNodePreserveCharacterReferences = 134217728; + static const int NSXMLNodePromoteSignificantWhitespace = 268435456; + static const int NSXMLNodePreserveEmptyElements = 6; + static const int NSXMLNodePreserveQuotes = 24; + static const int NSXMLNodePreserveAll = 4293918750; +} + +class NSXMLDocument extends NSXMLNode { + NSXMLDocument._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSXMLDocument] that points to the same underlying object as [other]. + static NSXMLDocument castFrom(T other) { + return NSXMLDocument._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSXMLDocument] that wraps the given raw object pointer. + static NSXMLDocument castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSXMLDocument._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSXMLDocument]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLDocument1); + } + + @override + NSXMLDocument init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSXMLDocument._(_ret, _lib, retain: true, release: true); + } + + NSXMLDocument initWithXMLString_options_error_( + NSString? string, int mask, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_972( + _id, + _lib._sel_initWithXMLString_options_error_1, + string?._id ?? ffi.nullptr, + mask, + error); + return NSXMLDocument._(_ret, _lib, retain: true, release: true); + } + + NSXMLDocument initWithContentsOfURL_options_error_( + NSURL? url, int mask, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_973( + _id, + _lib._sel_initWithContentsOfURL_options_error_1, + url?._id ?? ffi.nullptr, + mask, + error); + return NSXMLDocument._(_ret, _lib, retain: true, release: true); + } + + NSXMLDocument initWithData_options_error_( + NSData? data, int mask, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_974( + _id, + _lib._sel_initWithData_options_error_1, + data?._id ?? ffi.nullptr, + mask, + error); + return NSXMLDocument._(_ret, _lib, retain: true, release: true); + } + + NSXMLDocument initWithRootElement_(NSXMLElement? element) { + final _ret = _lib._objc_msgSend_968( + _id, _lib._sel_initWithRootElement_1, element?._id ?? ffi.nullptr); + return NSXMLDocument._(_ret, _lib, retain: true, release: true); + } + + static NSObject replacementClassForClass_(SwiftLibrary _lib, NSObject cls) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSXMLDocument1, + _lib._sel_replacementClassForClass_1, cls._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSString? get characterEncoding { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_characterEncoding1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set characterEncoding(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setCharacterEncoding_1, value?._id ?? ffi.nullptr); + } + + NSString? get version { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_version1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set version(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setVersion_1, value?._id ?? ffi.nullptr); + } + + bool get standalone { + return _lib._objc_msgSend_12(_id, _lib._sel_isStandalone1); + } + + set standalone(bool value) { + _lib._objc_msgSend_460(_id, _lib._sel_setStandalone_1, value); + } + + int get documentContentKind { + return _lib._objc_msgSend_975(_id, _lib._sel_documentContentKind1); + } + + set documentContentKind(int value) { + _lib._objc_msgSend_976(_id, _lib._sel_setDocumentContentKind_1, value); + } + + NSString? get MIMEType { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_MIMEType1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set MIMEType(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setMIMEType_1, value?._id ?? ffi.nullptr); + } + + NSXMLDTD? get DTD { + final _ret = _lib._objc_msgSend_986(_id, _lib._sel_DTD1); + return _ret.address == 0 + ? null + : NSXMLDTD._(_ret, _lib, retain: true, release: true); + } + + set DTD(NSXMLDTD? value) { + _lib._objc_msgSend_987(_id, _lib._sel_setDTD_1, value?._id ?? ffi.nullptr); + } + + void setRootElement_(NSXMLElement? root) { + return _lib._objc_msgSend_988( + _id, _lib._sel_setRootElement_1, root?._id ?? ffi.nullptr); + } + + NSXMLElement rootElement() { + final _ret = _lib._objc_msgSend_989(_id, _lib._sel_rootElement1); + return NSXMLElement._(_ret, _lib, retain: true, release: true); + } + + void insertChild_atIndex_(NSXMLNode? child, int index) { + return _lib._objc_msgSend_977( + _id, _lib._sel_insertChild_atIndex_1, child?._id ?? ffi.nullptr, index); + } + + void insertChildren_atIndex_(NSArray? children, int index) { + return _lib._objc_msgSend_978(_id, _lib._sel_insertChildren_atIndex_1, + children?._id ?? ffi.nullptr, index); + } + + void removeChildAtIndex_(int index) { + return _lib._objc_msgSend_410(_id, _lib._sel_removeChildAtIndex_1, index); + } + + void setChildren_(NSArray? children) { + return _lib._objc_msgSend_412( + _id, _lib._sel_setChildren_1, children?._id ?? ffi.nullptr); + } + + void addChild_(NSXMLNode? child) { + return _lib._objc_msgSend_979( + _id, _lib._sel_addChild_1, child?._id ?? ffi.nullptr); + } + + void replaceChildAtIndex_withNode_(int index, NSXMLNode? node) { + return _lib._objc_msgSend_980(_id, _lib._sel_replaceChildAtIndex_withNode_1, + index, node?._id ?? ffi.nullptr); + } + + NSData? get XMLData { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_XMLData1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSData XMLDataWithOptions_(int options) { + final _ret = + _lib._objc_msgSend_990(_id, _lib._sel_XMLDataWithOptions_1, options); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSObject objectByApplyingXSLT_arguments_error_(NSData? xslt, + NSDictionary? arguments, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_991( + _id, + _lib._sel_objectByApplyingXSLT_arguments_error_1, + xslt?._id ?? ffi.nullptr, + arguments?._id ?? ffi.nullptr, + error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject objectByApplyingXSLTString_arguments_error_(NSString? xslt, + NSDictionary? arguments, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_992( + _id, + _lib._sel_objectByApplyingXSLTString_arguments_error_1, + xslt?._id ?? ffi.nullptr, + arguments?._id ?? ffi.nullptr, + error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject objectByApplyingXSLTAtURL_arguments_error_(NSURL? xsltURL, + NSDictionary? argument, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_993( + _id, + _lib._sel_objectByApplyingXSLTAtURL_arguments_error_1, + xsltURL?._id ?? ffi.nullptr, + argument?._id ?? ffi.nullptr, + error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool validateAndReturnError_(ffi.Pointer> error) { + return _lib._objc_msgSend_219( + _id, _lib._sel_validateAndReturnError_1, error); + } + + static NSObject document(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLDocument1, _lib._sel_document1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject documentWithRootElement_( + SwiftLibrary _lib, NSXMLElement? element) { + final _ret = _lib._objc_msgSend_968(_lib._class_NSXMLDocument1, + _lib._sel_documentWithRootElement_1, element?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_(SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDocument1, + _lib._sel_elementWithName_1, name?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_URI_( + SwiftLibrary _lib, NSString? name, NSString? URI) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDocument1, + _lib._sel_elementWithName_URI_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? string) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDocument1, + _lib._sel_elementWithName_stringValue_1, + name?._id ?? ffi.nullptr, + string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_children_attributes_(SwiftLibrary _lib, + NSString? name, NSArray? children, NSArray? attributes) { + final _ret = _lib._objc_msgSend_969( + _lib._class_NSXMLDocument1, + _lib._sel_elementWithName_children_attributes_1, + name?._id ?? ffi.nullptr, + children?._id ?? ffi.nullptr, + attributes?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDocument1, + _lib._sel_attributeWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_URI_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? URI, NSString? stringValue) { + final _ret = _lib._objc_msgSend_26( + _lib._class_NSXMLDocument1, + _lib._sel_attributeWithName_URI_stringValue_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject namespaceWithName_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDocument1, + _lib._sel_namespaceWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject processingInstructionWithName_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDocument1, + _lib._sel_processingInstructionWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject commentWithStringValue_( + SwiftLibrary _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDocument1, + _lib._sel_commentWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject textWithStringValue_( + SwiftLibrary _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDocument1, + _lib._sel_textWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject DTDNodeWithXMLString_(SwiftLibrary _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDocument1, + _lib._sel_DTDNodeWithXMLString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSString localNameForName_(SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLDocument1, + _lib._sel_localNameForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString prefixForName_(SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLDocument1, + _lib._sel_prefixForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSXMLNode predefinedNamespaceForPrefix_( + SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_983(_lib._class_NSXMLDocument1, + _lib._sel_predefinedNamespaceForPrefix_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + static NSXMLDocument new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLDocument1, _lib._sel_new1); + return NSXMLDocument._(_ret, _lib, retain: false, release: true); + } + + static NSXMLDocument alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLDocument1, _lib._sel_alloc1); + return NSXMLDocument._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSXMLDocument1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSXMLDocument1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLDocument1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLDocument1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSXMLDocument1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSXMLDocument1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSXMLDocument1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSXMLDocument1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSXMLDocument1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSXMLDocumentContentKind { + static const int NSXMLDocumentXMLKind = 0; + static const int NSXMLDocumentXHTMLKind = 1; + static const int NSXMLDocumentHTMLKind = 2; + static const int NSXMLDocumentTextKind = 3; +} + +class NSXMLDTD extends NSXMLNode { + NSXMLDTD._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSXMLDTD] that points to the same underlying object as [other]. + static NSXMLDTD castFrom(T other) { + return NSXMLDTD._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSXMLDTD] that wraps the given raw object pointer. + static NSXMLDTD castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSXMLDTD._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSXMLDTD]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLDTD1); + } + + @override + NSXMLDTD init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSXMLDTD._(_ret, _lib, retain: true, release: true); + } + + @override + NSXMLDTD initWithKind_options_(int kind, int options) { + final _ret = _lib._objc_msgSend_967( + _id, _lib._sel_initWithKind_options_1, kind, options); + return NSXMLDTD._(_ret, _lib, retain: true, release: true); + } + + NSXMLDTD initWithContentsOfURL_options_error_( + NSURL? url, int mask, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_973( + _id, + _lib._sel_initWithContentsOfURL_options_error_1, + url?._id ?? ffi.nullptr, + mask, + error); + return NSXMLDTD._(_ret, _lib, retain: true, release: true); + } + + NSXMLDTD initWithData_options_error_( + NSData? data, int mask, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_974( + _id, + _lib._sel_initWithData_options_error_1, + data?._id ?? ffi.nullptr, + mask, + error); + return NSXMLDTD._(_ret, _lib, retain: true, release: true); + } + + NSString? get publicID { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_publicID1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set publicID(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPublicID_1, value?._id ?? ffi.nullptr); + } + + NSString? get systemID { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_systemID1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set systemID(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setSystemID_1, value?._id ?? ffi.nullptr); + } + + void insertChild_atIndex_(NSXMLNode? child, int index) { + return _lib._objc_msgSend_977( + _id, _lib._sel_insertChild_atIndex_1, child?._id ?? ffi.nullptr, index); + } + + void insertChildren_atIndex_(NSArray? children, int index) { + return _lib._objc_msgSend_978(_id, _lib._sel_insertChildren_atIndex_1, + children?._id ?? ffi.nullptr, index); + } + + void removeChildAtIndex_(int index) { + return _lib._objc_msgSend_410(_id, _lib._sel_removeChildAtIndex_1, index); + } + + void setChildren_(NSArray? children) { + return _lib._objc_msgSend_412( + _id, _lib._sel_setChildren_1, children?._id ?? ffi.nullptr); + } + + void addChild_(NSXMLNode? child) { + return _lib._objc_msgSend_979( + _id, _lib._sel_addChild_1, child?._id ?? ffi.nullptr); + } + + void replaceChildAtIndex_withNode_(int index, NSXMLNode? node) { + return _lib._objc_msgSend_980(_id, _lib._sel_replaceChildAtIndex_withNode_1, + index, node?._id ?? ffi.nullptr); + } + + NSXMLDTDNode entityDeclarationForName_(NSString? name) { + final _ret = _lib._objc_msgSend_984( + _id, _lib._sel_entityDeclarationForName_1, name?._id ?? ffi.nullptr); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLDTDNode notationDeclarationForName_(NSString? name) { + final _ret = _lib._objc_msgSend_984( + _id, _lib._sel_notationDeclarationForName_1, name?._id ?? ffi.nullptr); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLDTDNode elementDeclarationForName_(NSString? name) { + final _ret = _lib._objc_msgSend_984( + _id, _lib._sel_elementDeclarationForName_1, name?._id ?? ffi.nullptr); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLDTDNode attributeDeclarationForName_elementName_( + NSString? name, NSString? elementName) { + final _ret = _lib._objc_msgSend_985( + _id, + _lib._sel_attributeDeclarationForName_elementName_1, + name?._id ?? ffi.nullptr, + elementName?._id ?? ffi.nullptr); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + static NSXMLDTDNode predefinedEntityDeclarationForName_( + SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_984( + _lib._class_NSXMLDTD1, + _lib._sel_predefinedEntityDeclarationForName_1, + name?._id ?? ffi.nullptr); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + static NSObject document(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLDTD1, _lib._sel_document1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject documentWithRootElement_( + SwiftLibrary _lib, NSXMLElement? element) { + final _ret = _lib._objc_msgSend_968(_lib._class_NSXMLDTD1, + _lib._sel_documentWithRootElement_1, element?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_(SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTD1, + _lib._sel_elementWithName_1, name?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_URI_( + SwiftLibrary _lib, NSString? name, NSString? URI) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDTD1, + _lib._sel_elementWithName_URI_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? string) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDTD1, + _lib._sel_elementWithName_stringValue_1, + name?._id ?? ffi.nullptr, + string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_children_attributes_(SwiftLibrary _lib, + NSString? name, NSArray? children, NSArray? attributes) { + final _ret = _lib._objc_msgSend_969( + _lib._class_NSXMLDTD1, + _lib._sel_elementWithName_children_attributes_1, + name?._id ?? ffi.nullptr, + children?._id ?? ffi.nullptr, + attributes?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDTD1, + _lib._sel_attributeWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_URI_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? URI, NSString? stringValue) { + final _ret = _lib._objc_msgSend_26( + _lib._class_NSXMLDTD1, + _lib._sel_attributeWithName_URI_stringValue_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject namespaceWithName_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDTD1, + _lib._sel_namespaceWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject processingInstructionWithName_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDTD1, + _lib._sel_processingInstructionWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject commentWithStringValue_( + SwiftLibrary _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTD1, + _lib._sel_commentWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject textWithStringValue_( + SwiftLibrary _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTD1, + _lib._sel_textWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject DTDNodeWithXMLString_(SwiftLibrary _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTD1, + _lib._sel_DTDNodeWithXMLString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSString localNameForName_(SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLDTD1, + _lib._sel_localNameForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString prefixForName_(SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLDTD1, + _lib._sel_prefixForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSXMLNode predefinedNamespaceForPrefix_( + SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_983(_lib._class_NSXMLDTD1, + _lib._sel_predefinedNamespaceForPrefix_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + static NSXMLDTD new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSXMLDTD1, _lib._sel_new1); + return NSXMLDTD._(_ret, _lib, retain: false, release: true); + } + + static NSXMLDTD alloc(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSXMLDTD1, _lib._sel_alloc1); + return NSXMLDTD._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSXMLDTD1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSXMLDTD1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLDTD1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLDTD1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSXMLDTD1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSXMLDTD1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSXMLDTD1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSXMLDTD1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSXMLDTD1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSXMLDTDNode extends NSXMLNode { + NSXMLDTDNode._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSXMLDTDNode] that points to the same underlying object as [other]. + static NSXMLDTDNode castFrom(T other) { + return NSXMLDTDNode._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSXMLDTDNode] that wraps the given raw object pointer. + static NSXMLDTDNode castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSXMLDTDNode._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSXMLDTDNode]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLDTDNode1); + } + + NSXMLDTDNode initWithXMLString_(NSString? string) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithXMLString_1, string?._id ?? ffi.nullptr); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + @override + NSXMLDTDNode initWithKind_options_(int kind, int options) { + final _ret = _lib._objc_msgSend_967( + _id, _lib._sel_initWithKind_options_1, kind, options); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + @override + NSXMLDTDNode init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + int get DTDKind { + return _lib._objc_msgSend_981(_id, _lib._sel_DTDKind1); + } + + set DTDKind(int value) { + _lib._objc_msgSend_982(_id, _lib._sel_setDTDKind_1, value); + } + + bool get external1 { + return _lib._objc_msgSend_12(_id, _lib._sel_isExternal1); + } + + NSString? get publicID { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_publicID1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set publicID(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setPublicID_1, value?._id ?? ffi.nullptr); + } + + NSString? get systemID { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_systemID1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set systemID(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setSystemID_1, value?._id ?? ffi.nullptr); + } + + NSString? get notationName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_notationName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set notationName(NSString? value) { + _lib._objc_msgSend_477( + _id, _lib._sel_setNotationName_1, value?._id ?? ffi.nullptr); + } + + static NSObject document(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLDTDNode1, _lib._sel_document1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject documentWithRootElement_( + SwiftLibrary _lib, NSXMLElement? element) { + final _ret = _lib._objc_msgSend_968(_lib._class_NSXMLDTDNode1, + _lib._sel_documentWithRootElement_1, element?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_(SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTDNode1, + _lib._sel_elementWithName_1, name?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_URI_( + SwiftLibrary _lib, NSString? name, NSString? URI) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDTDNode1, + _lib._sel_elementWithName_URI_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? string) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDTDNode1, + _lib._sel_elementWithName_stringValue_1, + name?._id ?? ffi.nullptr, + string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_children_attributes_(SwiftLibrary _lib, + NSString? name, NSArray? children, NSArray? attributes) { + final _ret = _lib._objc_msgSend_969( + _lib._class_NSXMLDTDNode1, + _lib._sel_elementWithName_children_attributes_1, + name?._id ?? ffi.nullptr, + children?._id ?? ffi.nullptr, + attributes?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDTDNode1, + _lib._sel_attributeWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_URI_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? URI, NSString? stringValue) { + final _ret = _lib._objc_msgSend_26( + _lib._class_NSXMLDTDNode1, + _lib._sel_attributeWithName_URI_stringValue_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject namespaceWithName_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDTDNode1, + _lib._sel_namespaceWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject processingInstructionWithName_stringValue_( + SwiftLibrary _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_159( + _lib._class_NSXMLDTDNode1, + _lib._sel_processingInstructionWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject commentWithStringValue_( + SwiftLibrary _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTDNode1, + _lib._sel_commentWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject textWithStringValue_( + SwiftLibrary _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTDNode1, + _lib._sel_textWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject DTDNodeWithXMLString_(SwiftLibrary _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTDNode1, + _lib._sel_DTDNodeWithXMLString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSString localNameForName_(SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLDTDNode1, + _lib._sel_localNameForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString prefixForName_(SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLDTDNode1, + _lib._sel_prefixForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSXMLNode predefinedNamespaceForPrefix_( + SwiftLibrary _lib, NSString? name) { + final _ret = _lib._objc_msgSend_983(_lib._class_NSXMLDTDNode1, + _lib._sel_predefinedNamespaceForPrefix_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + static NSXMLDTDNode new1(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLDTDNode1, _lib._sel_new1); + return NSXMLDTDNode._(_ret, _lib, retain: false, release: true); + } + + static NSXMLDTDNode alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLDTDNode1, _lib._sel_alloc1); + return NSXMLDTDNode._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_NSXMLDTDNode1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_NSXMLDTDNode1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLDTDNode1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLDTDNode1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSXMLDTDNode1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSXMLDTDNode1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_NSXMLDTDNode1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_NSXMLDTDNode1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSXMLDTDNode1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSXMLDTDNodeKind { + static const int NSXMLEntityGeneralKind = 1; + static const int NSXMLEntityParsedKind = 2; + static const int NSXMLEntityUnparsedKind = 3; + static const int NSXMLEntityParameterKind = 4; + static const int NSXMLEntityPredefined = 5; + static const int NSXMLAttributeCDATAKind = 6; + static const int NSXMLAttributeIDKind = 7; + static const int NSXMLAttributeIDRefKind = 8; + static const int NSXMLAttributeIDRefsKind = 9; + static const int NSXMLAttributeEntityKind = 10; + static const int NSXMLAttributeEntitiesKind = 11; + static const int NSXMLAttributeNMTokenKind = 12; + static const int NSXMLAttributeNMTokensKind = 13; + static const int NSXMLAttributeEnumerationKind = 14; + static const int NSXMLAttributeNotationKind = 15; + static const int NSXMLElementDeclarationUndefinedKind = 16; + static const int NSXMLElementDeclarationEmptyKind = 17; + static const int NSXMLElementDeclarationAnyKind = 18; + static const int NSXMLElementDeclarationMixedKind = 19; + static const int NSXMLElementDeclarationElementKind = 20; +} + +class SwiftClass extends NSObject { + SwiftClass._(ffi.Pointer id, SwiftLibrary lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [SwiftClass] that points to the same underlying object as [other]. + static SwiftClass castFrom(T other) { + return SwiftClass._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [SwiftClass] that wraps the given raw object pointer. + static SwiftClass castFromPointer( + SwiftLibrary lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return SwiftClass._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [SwiftClass]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_SwiftClass1); + } + + NSString sayHello() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_sayHello1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + int get someField { + return _lib._objc_msgSend_78(_id, _lib._sel_someField1); + } + + set someField(int value) { + _lib._objc_msgSend_558(_id, _lib._sel_setSomeField_1, value); + } + + @override + SwiftClass init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return SwiftClass._(_ret, _lib, retain: true, release: true); + } + + static SwiftClass new1(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_SwiftClass1, _lib._sel_new1); + return SwiftClass._(_ret, _lib, retain: false, release: true); + } + + static SwiftClass alloc(SwiftLibrary _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_SwiftClass1, _lib._sel_alloc1); + return SwiftClass._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SwiftLibrary _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + return _lib._objc_msgSend_14( + _lib._class_SwiftClass1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SwiftLibrary _lib, NSObject aTarget) { + return _lib._objc_msgSend_15(_lib._class_SwiftClass1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_SwiftClass1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SwiftLibrary _lib) { + return _lib._objc_msgSend_12( + _lib._class_SwiftClass1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SwiftLibrary _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_SwiftClass1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SwiftLibrary _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_SwiftClass1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) { + return _lib._objc_msgSend_79( + _lib._class_SwiftClass1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_80( + _lib._class_SwiftClass1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_SwiftClass1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} From 50f06156f71c42239dcd60b3b9f73eb44a65d3d0 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 18 Aug 2022 10:27:42 +0200 Subject: [PATCH 177/276] [ffigen] `FfiNative` support (#447) --- pkgs/ffigen/CHANGELOG.md | 5 + pkgs/ffigen/README.md | 17 ++++ pkgs/ffigen/example/ffinative/.gitignore | 11 +++ pkgs/ffigen/example/ffinative/README.md | 10 ++ .../example/ffinative/generated_bindings.dart | 41 +++++++++ .../example/ffinative/headers/example.h | 18 ++++ pkgs/ffigen/example/ffinative/pubspec.yaml | 25 +++++ .../example/simple/generated_bindings.dart | 10 +- pkgs/ffigen/example/simple/headers/example.h | 2 +- pkgs/ffigen/lib/src/code_generator/func.dart | 91 +++++++++++++------ .../lib/src/code_generator/library.dart | 32 ++++++- .../ffigen/lib/src/code_generator/writer.dart | 12 ++- .../lib/src/config_provider/config.dart | 11 +++ .../lib/src/config_provider/config_types.dart | 7 ++ .../lib/src/config_provider/spec_utils.dart | 32 ++++++- .../sub_parsers/enumdecl_parser.dart | 1 - .../sub_parsers/functiondecl_parser.dart | 1 + .../sub_parsers/macro_parser.dart | 1 - .../sub_parsers/unnamed_enumdecl_parser.dart | 1 - .../header_parser/sub_parsers/var_parser.dart | 7 +- pkgs/ffigen/lib/src/strings.dart | 3 + pkgs/ffigen/pubspec.yaml | 2 +- .../example_tests/ffinative_example_test.dart | 39 ++++++++ .../_expected_cjson_bindings.dart | 7 +- .../_expected_libclang_bindings.dart | 7 +- .../large_integration_tests/large_test.dart | 10 -- 26 files changed, 335 insertions(+), 68 deletions(-) create mode 100644 pkgs/ffigen/example/ffinative/.gitignore create mode 100644 pkgs/ffigen/example/ffinative/README.md create mode 100644 pkgs/ffigen/example/ffinative/generated_bindings.dart create mode 100644 pkgs/ffigen/example/ffinative/headers/example.h create mode 100644 pkgs/ffigen/example/ffinative/pubspec.yaml create mode 100644 pkgs/ffigen/test/example_tests/ffinative_example_test.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 5c91860b67..0fe443604a 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,8 @@ +# 6.1.1 + +- _EXPERIMENTAL_ support for `FfiNative`. The API and output + might change at any point. + # 6.1.0 - Added `exclude-all-by-default` config flag, which changes the default behavior diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 6442b42c5b..96a88d03ab 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -489,6 +489,23 @@ type-map: 'dart-type': 'CustomType3' ``` + + + ffi-native + + WARNING: FfiNative support is EXPERIMENTAL. The API may change + in a breaking way without notice. +

    + Generate `@FfiNative` bindings instead of bindings using `DynamicLibrary` or `lookup`. + + + +```yaml +ffi-native: + asset: 'myasset' # Optional. +``` + + language diff --git a/pkgs/ffigen/example/ffinative/.gitignore b/pkgs/ffigen/example/ffinative/.gitignore new file mode 100644 index 0000000000..1b05164275 --- /dev/null +++ b/pkgs/ffigen/example/ffinative/.gitignore @@ -0,0 +1,11 @@ +# Files and directories created by pub. +.dart_tool/ +.packages +# Remove the following pattern if you wish to check in your lock file. +pubspec.lock + +# Conventional directory for build outputs. +build/ + +# Directory created by dartdoc. +doc/api/ diff --git a/pkgs/ffigen/example/ffinative/README.md b/pkgs/ffigen/example/ffinative/README.md new file mode 100644 index 0000000000..c1469402d0 --- /dev/null +++ b/pkgs/ffigen/example/ffinative/README.md @@ -0,0 +1,10 @@ +# FfiNatives example + +A simple example generating `FfiNative` bindings for a very small header file (`headers/example.h`). + +## Generating bindings +At the root of this example (`example/simple`), run - +``` +dart run ffigen +``` +This will generate bindings in a file: [generated_bindings.dart](./generated_bindings.dart). diff --git a/pkgs/ffigen/example/ffinative/generated_bindings.dart b/pkgs/ffigen/example/ffinative/generated_bindings.dart new file mode 100644 index 0000000000..794f28f3db --- /dev/null +++ b/pkgs/ffigen/example/ffinative/generated_bindings.dart @@ -0,0 +1,41 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Adds 2 integers. +@ffi.FfiNative('sum') +external int sum( + int a, + int b, +); + +/// Subtracts 2 integers. +@ffi.FfiNative, ffi.Int)>('subtract') +external int subtract( + ffi.Pointer a, + int b, +); + +/// Multiplies 2 integers, returns pointer to an integer,. +@ffi.FfiNative Function(ffi.Int, ffi.Int)>('multiply') +external ffi.Pointer multiply( + int a, + int b, +); + +/// Divides 2 integers, returns pointer to a float. +@ffi.FfiNative Function(ffi.Int, ffi.Int)>('divide') +external ffi.Pointer divide( + int a, + int b, +); + +/// Divides 2 floats, returns a pointer to double. +@ffi.FfiNative< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>('dividePrecision') +external ffi.Pointer dividePrecision( + ffi.Pointer a, + ffi.Pointer b, +); diff --git a/pkgs/ffigen/example/ffinative/headers/example.h b/pkgs/ffigen/example/ffinative/headers/example.h new file mode 100644 index 0000000000..40c6b9e769 --- /dev/null +++ b/pkgs/ffigen/example/ffinative/headers/example.h @@ -0,0 +1,18 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** Adds 2 integers. */ +int sum(int a, int b); + +/** Subtracts 2 integers. */ +int subtract(int *a, int b); + +/** Multiplies 2 integers, returns pointer to an integer,. */ +int *multiply(int a, int b); + +/** Divides 2 integers, returns pointer to a float. */ +float *divide(int a, int b); + +/** Divides 2 floats, returns a pointer to double. */ +double *dividePrecision(float *a, float *b); diff --git a/pkgs/ffigen/example/ffinative/pubspec.yaml b/pkgs/ffigen/example/ffinative/pubspec.yaml new file mode 100644 index 0000000000..5ba0423fe6 --- /dev/null +++ b/pkgs/ffigen/example/ffinative/pubspec.yaml @@ -0,0 +1,25 @@ +# Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +name: ffinative_example + +environment: + sdk: '>=2.17.0 <3.0.0' + +dependencies: + ffi: ^2.0.1 +dev_dependencies: + ffigen: + path: '../../' + lints: ^2.0.0 + +ffigen: + name: NativeLibrary + ffi-native: + # asset: 'assetname' # (optional) + description: Bindings to `headers/example.h`. + output: 'generated_bindings.dart' + headers: + entry-points: + - 'headers/example.h' diff --git a/pkgs/ffigen/example/simple/generated_bindings.dart b/pkgs/ffigen/example/simple/generated_bindings.dart index 1612b64ec3..b4c885a1da 100644 --- a/pkgs/ffigen/example/simple/generated_bindings.dart +++ b/pkgs/ffigen/example/simple/generated_bindings.dart @@ -86,21 +86,21 @@ class NativeLibrary { _dividePtr.asFunction Function(int, int)>(); /// Divides 2 floats, returns a pointer to double. - ffi.Pointer dividePercision( + ffi.Pointer dividePrecision( ffi.Pointer a, ffi.Pointer b, ) { - return _dividePercision( + return _dividePrecision( a, b, ); } - late final _dividePercisionPtr = _lookup< + late final _dividePrecisionPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('dividePercision'); - late final _dividePercision = _dividePercisionPtr.asFunction< + ffi.Pointer)>>('dividePrecision'); + late final _dividePrecision = _dividePrecisionPtr.asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); } diff --git a/pkgs/ffigen/example/simple/headers/example.h b/pkgs/ffigen/example/simple/headers/example.h index 0f936ee33c..40c6b9e769 100644 --- a/pkgs/ffigen/example/simple/headers/example.h +++ b/pkgs/ffigen/example/simple/headers/example.h @@ -15,4 +15,4 @@ int *multiply(int a, int b); float *divide(int a, int b); /** Divides 2 floats, returns a pointer to double. */ -double *dividePercision(float *a, float *b); +double *dividePrecision(float *a, float *b); diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index c10b0c8dd5..4496e71efa 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/config_provider/config_types.dart'; import 'binding_string.dart'; import 'utils.dart'; @@ -10,11 +11,14 @@ import 'writer.dart'; /// A binding for C function. /// -/// For a C function - +/// For example, take the following C function. +/// /// ```c /// int sum(int a, int b); /// ``` -/// The Generated dart code is - +/// +/// The generated Dart code for this function (without `FfiNative`) is as follows. +/// /// ```dart /// int sum(int a, int b) { /// return _sum(a, b); @@ -26,11 +30,19 @@ import 'writer.dart'; /// /// typedef _dart_sum = int Function(int a, int b); /// ``` +/// +/// When using `FfiNative`, the code is as follows. +/// +/// ```dart +/// @ffi.FfiNative('sum') +/// external int sum(int a, int b); +/// ``` class Func extends LookUpBinding { final FunctionType functionType; final bool exposeSymbolAddress; final bool exposeFunctionTypedefs; final bool isLeaf; + final FfiNativeConfig ffiNativeConfig; late final String funcPointerName; /// Contains typealias for function type if [exposeFunctionTypedefs] is true. @@ -50,6 +62,7 @@ class Func extends LookUpBinding { this.exposeFunctionTypedefs = false, this.isLeaf = false, bool isInternal = false, + this.ffiNativeConfig = const FfiNativeConfig(enabled: false), }) : functionType = FunctionType( returnType: returnType, parameters: parameters ?? const [], @@ -97,20 +110,6 @@ class Func extends LookUpBinding { for (final p in functionType.parameters) { p.name = paramNamer.makeUnique(p.name); } - // Write enclosing function. - s.write('${functionType.returnType.getDartType(w)} $enclosingFuncName(\n'); - for (final p in functionType.parameters) { - s.write(' ${p.type.getDartType(w)} ${p.name},\n'); - } - s.write(') {\n'); - s.write('return $funcVarName'); - - s.write('(\n'); - for (final p in functionType.parameters) { - s.write(' ${p.name},\n'); - } - s.write(' );\n'); - s.write('}\n'); final cType = exposeFunctionTypedefs ? _exposedCFunctionTypealias!.name @@ -119,21 +118,53 @@ class Func extends LookUpBinding { ? _exposedDartFunctionTypealias!.name : functionType.getDartType(w, writeArgumentNames: false); - if (exposeSymbolAddress) { - // Add to SymbolAddress in writer. - w.symbolAddressWriter.addSymbol( - type: - '${w.ffiLibraryPrefix}.Pointer<${w.ffiLibraryPrefix}.NativeFunction<$cType>>', - name: name, - ptrName: funcPointerName, - ); + if (ffiNativeConfig.enabled) { + final assetString = ffiNativeConfig.asset != null + ? ", asset: '${ffiNativeConfig.asset}'" + : ''; + final isLeafString = isLeaf ? ', isLeaf: true' : ''; + s.write( + "@${w.ffiLibraryPrefix}.FfiNative<$cType>('$originalName'$assetString$isLeafString)\n"); + + s.write( + 'external ${functionType.returnType.getDartType(w)} $enclosingFuncName(\n'); + for (final p in functionType.parameters) { + s.write(' ${p.type.getDartType(w)} ${p.name},\n'); + } + s.write(');\n\n'); + } else { + // Write enclosing function. + s.write( + '${functionType.returnType.getDartType(w)} $enclosingFuncName(\n'); + for (final p in functionType.parameters) { + s.write(' ${p.type.getDartType(w)} ${p.name},\n'); + } + s.write(') {\n'); + s.write('return $funcVarName'); + + s.write('(\n'); + for (final p in functionType.parameters) { + s.write(' ${p.name},\n'); + } + s.write(' );\n'); + s.write('}\n'); + + if (exposeSymbolAddress) { + // Add to SymbolAddress in writer. + w.symbolAddressWriter.addSymbol( + type: + '${w.ffiLibraryPrefix}.Pointer<${w.ffiLibraryPrefix}.NativeFunction<$cType>>', + name: name, + ptrName: funcPointerName, + ); + } + // Write function pointer. + s.write( + "late final $funcPointerName = ${w.lookupFuncIdentifier}<${w.ffiLibraryPrefix}.NativeFunction<$cType>>('$originalName');\n"); + final isLeafString = isLeaf ? 'isLeaf:true' : ''; + s.write( + 'late final $funcVarName = $funcPointerName.asFunction<$dartType>($isLeafString);\n\n'); } - // Write function pointer. - s.write( - "late final $funcPointerName = ${w.lookupFuncIdentifier}<${w.ffiLibraryPrefix}.NativeFunction<$cType>>('$originalName');\n"); - final isLeafString = isLeaf ? 'isLeaf:true' : ''; - s.write( - 'late final $funcVarName = $funcPointerName.asFunction<$dartType>($isLeafString);\n\n'); return BindingString(type: BindingStringType.func, string: s.toString()); } diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index a651871f51..7c7ce47820 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -5,12 +5,12 @@ import 'dart:io'; import 'package:cli_util/cli_util.dart'; +import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/config_provider/config_types.dart'; import 'package:logging/logging.dart'; import 'package:path/path.dart' as p; -import 'binding.dart'; -import 'imports.dart'; -import 'struct.dart'; + +import '../strings.dart' as strings; import 'utils.dart'; import 'writer.dart'; @@ -46,11 +46,12 @@ class Library { _sort(); } - /// Handle any declaration-declaration name conflicts. + /// Handle any declaration-declaration name conflicts and emit warnings. final declConflictHandler = UniqueNamer({}); for (final b in this.bindings) { _warnIfPrivateDeclaration(b); _resolveIfNameConflicts(declConflictHandler, b); + _warnIfExposeSymbolAddressAndFfiNative(b); } // Override pack values according to config. We do this after declaration @@ -64,12 +65,23 @@ class Library { } // Seperate bindings which require lookup. - final lookUpBindings = this.bindings.whereType().toList(); + final lookUpBindings = this.bindings.whereType().where((e) { + if (e is Func) { + return !e.ffiNativeConfig.enabled; + } + return true; + }).toList(); + final ffiNativeBindings = this + .bindings + .whereType() + .where((e) => e.ffiNativeConfig.enabled) + .toList(); final noLookUpBindings = this.bindings.whereType().toList(); _writer = Writer( lookUpBindings: lookUpBindings, + ffiNativeBindings: ffiNativeBindings, noLookUpBindings: noLookUpBindings, className: name, classDocComment: description, @@ -100,6 +112,16 @@ class Library { } } + /// Logs a warning if generated declaration will be private. + void _warnIfExposeSymbolAddressAndFfiNative(Binding b) { + if (b is Func) { + if (b.exposeSymbolAddress && b.ffiNativeConfig.enabled) { + _logger.warning( + "Ignoring ${strings.symbolAddress} for '${b.name}' because it is generated as FfiNative."); + } + } + } + /// Sort all bindings in alphabetical order. void _sort() { bindings.sort((b1, b2) => b1.name.compareTo(b2.name)); diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index 77e9e834e5..1f054fc7d2 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -2,11 +2,9 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:ffigen/src/code_generator/imports.dart'; +import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/code_generator/utils.dart'; -import 'binding.dart'; - /// To store generated String bindings. class Writer { final String? header; @@ -14,6 +12,9 @@ class Writer { /// Holds bindings, which lookup symbols. final List lookUpBindings; + /// Holds bindings, which lookup symbols through `FfiNative`. + final List ffiNativeBindings; + /// Holds bindings which don't lookup symbols. final List noLookUpBindings; @@ -78,6 +79,7 @@ class Writer { /// already used. This is used to avoid name collisions. Writer({ required this.lookUpBindings, + required this.ffiNativeBindings, required this.noLookUpBindings, required String className, Set? additionalImports, @@ -233,6 +235,10 @@ class Writer { s.write('}\n\n'); } + for (final b in ffiNativeBindings) { + s.write(b.toBindingString(this).string); + } + if (symbolAddressWriter.shouldGenerate) { s.write(symbolAddressWriter.writeClass(this)); } diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 56b2df1d9d..1fdb77e0c5 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -151,6 +151,9 @@ class Config { Includer get leafFunctions => _leafFunctions; late Includer _leafFunctions; + FfiNativeConfig get ffiNativeConfig => _ffiNativeConfig; + late FfiNativeConfig _ffiNativeConfig; + Config._(); /// Create config from Yaml map. @@ -505,6 +508,14 @@ class Config { extractedResult: (dynamic result) => _leafFunctions = result as Includer, ), + [strings.ffiNative]: Specification( + requirement: Requirement.no, + validator: ffiNativeValidator, + extractor: ffiNativeExtractor, + defaultValue: () => FfiNativeConfig(enabled: false), + extractedResult: (dynamic result) => + _ffiNativeConfig = result as FfiNativeConfig, + ) }; } } diff --git a/pkgs/ffigen/lib/src/config_provider/config_types.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart index 8146917e90..e3965c0b8a 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_types.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart @@ -402,3 +402,10 @@ class ObjCModulePrefixer { return className; } } + +class FfiNativeConfig { + final bool enabled; + final String? asset; + + const FfiNativeConfig({required this.enabled, this.asset}); +} diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index ac154ce1e2..149bd9f7a3 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -49,7 +49,8 @@ bool checkKeyInYaml(List key, YamlMap map) { return false; } } - return last != null; + // The entry for the last key may be null. + return true; } /// Extracts value of nested [key] from [map]. @@ -918,3 +919,32 @@ bool structPackingOverrideValidator(List name, dynamic value) { return _result; } + +FfiNativeConfig ffiNativeExtractor(dynamic yamlConfig) { + final yamlMap = yamlConfig as YamlMap?; + return FfiNativeConfig( + enabled: true, + asset: yamlMap?[strings.ffiNativeAsset] as String?, + ); +} + +bool ffiNativeValidator(List name, dynamic yamlConfig) { + if (!checkType(name, yamlConfig)) { + return false; + } + // ignore: prefer_void_to_null + if (checkType(name, yamlConfig)) { + return true; + } + for (final key in (yamlConfig as YamlMap).keys) { + if (!checkType([...name, key as String], yamlConfig[key])) { + return false; + } + if (key != strings.ffiNativeAsset) { + _logger.severe("'$name -> $key' must be one of the following - ${[ + strings.ffiNativeAsset + ]}"); + } + } + return true; +} diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index 4e5e1506c9..7eb65a8193 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -10,7 +10,6 @@ import 'package:ffigen/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dar import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang_types; -import '../data.dart'; import '../includer.dart'; import '../utils.dart'; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index b4c40fc22e..848f60bbce 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -80,6 +80,7 @@ Func? parseFunctionDeclaration(clang_types.CXCursor cursor) { exposeFunctionTypedefs: config.exposeFunctionTypedefs.shouldInclude(funcName), isLeaf: config.leafFunctions.shouldInclude(funcName), + ffiNativeConfig: config.ffiNativeConfig, ); bindingsIndex.addFuncToSeen(funcUsr, _stack.top.func!); } else if (bindingsIndex.isSeenFunc(funcUsr)) { diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart index cdfe078d1a..753a4b51f3 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart @@ -15,7 +15,6 @@ import 'package:logging/logging.dart'; import 'package:path/path.dart' as p; import '../clang_bindings/clang_bindings.dart' as clang_types; -import '../data.dart'; import '../utils.dart'; final _logger = Logger('ffigen.header_parser.macro_parser'); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart index 940369ae26..81c0a77bcc 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart @@ -10,7 +10,6 @@ import 'package:ffigen/src/header_parser/includer.dart'; import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang_types; -import '../data.dart'; import '../utils.dart'; final _logger = Logger('ffigen.header_parser.unnamed_enumdecl_parser'); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart index 8376199fbf..a8d46d3477 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart @@ -8,7 +8,6 @@ import 'package:ffigen/src/header_parser/includer.dart'; import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang_types; -import '../data.dart'; import '../utils.dart'; final _logger = Logger('ffigen.header_parser.var_parser'); @@ -34,6 +33,12 @@ Global? parseVarDeclaration(clang_types.CXCursor cursor) { return null; } + if (config.ffiNativeConfig.enabled) { + _logger.warning( + "Skipped global variable '$name', not supported in FfiNatives."); + return null; + } + final global = Global( originalName: name, name: config.globals.renameUsingConfig(name), diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 6995adabe8..96e3c34ff7 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -232,3 +232,6 @@ const doubleNaN = 'double.nan'; /// USR for struct `_Dart_Handle`. const dartHandleUsr = 'c:@S@_Dart_Handle'; + +const ffiNative = 'ffi-native'; +const ffiNativeAsset = 'asset'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index d46f5fdc43..3de14a4cda 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 6.1.0 +version: 6.1.1 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen diff --git a/pkgs/ffigen/test/example_tests/ffinative_example_test.dart b/pkgs/ffigen/test/example_tests/ffinative_example_test.dart new file mode 100644 index 0000000000..67962a003d --- /dev/null +++ b/pkgs/ffigen/test/example_tests/ffinative_example_test.dart @@ -0,0 +1,39 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/config_provider/config.dart'; +import 'package:ffigen/src/header_parser.dart'; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart'; + +import '../test_utils.dart'; + +void main() { + group('ffinative_example_test', () { + setUpAll(() { + logWarnings(Level.SEVERE); + }); + + test('ffinative', () { + final config = Config.fromYaml(loadYaml(''' +${strings.name}: NativeLibrary +${strings.ffiNative}: +${strings.description}: Bindings to `headers/example.h`. +${strings.output}: 'generated_bindings.dart' +${strings.headers}: + ${strings.entryPoints}: + - 'example/ffinative/headers/example.h' +''') as YamlMap); + final library = parse(config); + + matchLibraryWithExpected( + library, + ['test', 'debug_generated', 'example_ffinative.dart'], + ['example', 'ffinative', config.output], + ); + }); + }); +} diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart index ad8b2b5b4f..2abffa6d91 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart @@ -4,7 +4,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; /// Bindings to Cjson. class CJson { @@ -1195,7 +1194,7 @@ class CJson { } late final _cJSON_mallocPtr = - _lookup Function(pkg_ffi.Size)>>( + _lookup Function(ffi.Size)>>( 'cJSON_malloc'); late final _cJSON_malloc = _cJSON_mallocPtr.asFunction Function(int)>(); @@ -1237,8 +1236,8 @@ class cJSON extends ffi.Struct { } class cJSON_Hooks extends ffi.Struct { - external ffi.Pointer< - ffi.NativeFunction Function(pkg_ffi.Size)>> + external ffi + .Pointer Function(ffi.Size)>> malloc_fn; external ffi diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index d060bd427b..f5f332e200 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -4,7 +4,6 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; /// Bindings to LibClang. class LibClang { @@ -482,7 +481,7 @@ class LibClang { ffi.Pointer clang_getFileContents( CXTranslationUnit tu, CXFile file, - ffi.Pointer size, + ffi.Pointer size, ) { return _clang_getFileContents( tu, @@ -494,10 +493,10 @@ class LibClang { late final _clang_getFileContentsPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(CXTranslationUnit, CXFile, - ffi.Pointer)>>('clang_getFileContents'); + ffi.Pointer)>>('clang_getFileContents'); late final _clang_getFileContents = _clang_getFileContentsPtr.asFunction< ffi.Pointer Function( - CXTranslationUnit, CXFile, ffi.Pointer)>(); + CXTranslationUnit, CXFile, ffi.Pointer)>(); /// Returns non-zero if the file1 and file2 point to the same file, or they /// are both NULL. diff --git a/pkgs/ffigen/test/large_integration_tests/large_test.dart b/pkgs/ffigen/test/large_integration_tests/large_test.dart index 14c54bf243..163895111b 100644 --- a/pkgs/ffigen/test/large_integration_tests/large_test.dart +++ b/pkgs/ffigen/test/large_integration_tests/large_test.dart @@ -39,10 +39,6 @@ ${strings.headers}: - '**Index.h' ${strings.typeMap}: ${strings.typeMapTypedefs}: - 'size_t': - lib: 'pkg_ffi' - c-type: 'Size' - dart-type: 'int' 'time_t': lib: 'ffi' c-type: 'Int64' @@ -71,12 +67,6 @@ ${strings.headers}: - third_party/cjson_library/cJSON.h ${strings.includeDirectives}: - '**cJSON.h' -${strings.typeMap}: - ${strings.typeMapTypedefs}: - 'size_t': - lib: 'pkg_ffi' - c-type: 'Size' - dart-type: 'int' ${strings.preamble}: | // ignore_for_file: camel_case_types, non_constant_identifier_names ''') as YamlMap); From 4d938396a7fbec4cc679df8e7ac1c2a5ede278f0 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 18 Aug 2022 17:45:54 +0200 Subject: [PATCH 178/276] [ffigen] `ffi-native` -> `asset` stop logger warning (#449) --- pkgs/ffigen/lib/src/config_provider/spec_utils.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 149bd9f7a3..56cc872e64 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -932,8 +932,8 @@ bool ffiNativeValidator(List name, dynamic yamlConfig) { if (!checkType(name, yamlConfig)) { return false; } - // ignore: prefer_void_to_null - if (checkType(name, yamlConfig)) { + if (yamlConfig == null) { + // Empty means no asset name. return true; } for (final key in (yamlConfig as YamlMap).keys) { From 2081ac096942bd450090ab0ec50b94280b502506 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 24 Aug 2022 23:27:58 -0700 Subject: [PATCH 179/276] [ffigen] Fix function deduplication (#450) --- pkgs/ffigen/CHANGELOG.md | 4 ++ .../lib/src/header_parser/includer.dart | 2 +- pkgs/ffigen/pubspec.yaml | 2 +- .../_expected_regress_384_bindings.dart | 28 +++++++++++ .../regress_384_header_1.h | 5 ++ .../regress_384_header_2.h | 5 ++ .../header_parser_tests/regress_384_shared.h | 10 ++++ .../header_parser_tests/regress_384_test.dart | 46 +++++++++++++++++++ .../test/header_parser_tests/unions_test.dart | 2 +- 9 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_regress_384_bindings.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/regress_384_header_1.h create mode 100644 pkgs/ffigen/test/header_parser_tests/regress_384_header_2.h create mode 100644 pkgs/ffigen/test/header_parser_tests/regress_384_shared.h create mode 100644 pkgs/ffigen/test/header_parser_tests/regress_384_test.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 0fe443604a..38be29725a 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 6.1.2 + +- Fix bug where function bindings were not deduped correctly. + # 6.1.1 - _EXPERIMENTAL_ support for `FfiNative`. The API and output diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart index 6bc0d122bc..05bfa54acf 100644 --- a/pkgs/ffigen/lib/src/header_parser/includer.dart +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -35,7 +35,7 @@ bool shouldIncludeUnion(String usr, String name) { bool shouldIncludeFunc(String usr, String name) { return _shouldIncludeDecl( - usr, name, bindingsIndex.isSeenType, config.functionDecl.shouldInclude); + usr, name, bindingsIndex.isSeenFunc, config.functionDecl.shouldInclude); } bool shouldIncludeEnumClass(String usr, String name) { diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 3de14a4cda..1bdec3a24c 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 6.1.1 +version: 6.1.2 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_regress_384_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_regress_384_bindings.dart new file mode 100644 index 0000000000..745cd34e5c --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_regress_384_bindings.dart @@ -0,0 +1,28 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Regression test for #384 +class NativeLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + NativeLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NativeLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + void foo() { + return _foo(); + } + + late final _fooPtr = _lookup>('foo'); + late final _foo = _fooPtr.asFunction(); +} diff --git a/pkgs/ffigen/test/header_parser_tests/regress_384_header_1.h b/pkgs/ffigen/test/header_parser_tests/regress_384_header_1.h new file mode 100644 index 0000000000..3129b2d700 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/regress_384_header_1.h @@ -0,0 +1,5 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#include "regress_384_shared.h" diff --git a/pkgs/ffigen/test/header_parser_tests/regress_384_header_2.h b/pkgs/ffigen/test/header_parser_tests/regress_384_header_2.h new file mode 100644 index 0000000000..3129b2d700 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/regress_384_header_2.h @@ -0,0 +1,5 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#include "regress_384_shared.h" diff --git a/pkgs/ffigen/test/header_parser_tests/regress_384_shared.h b/pkgs/ffigen/test/header_parser_tests/regress_384_shared.h new file mode 100644 index 0000000000..265a786d3c --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/regress_384_shared.h @@ -0,0 +1,10 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#ifndef __REGRESS_384_SHARED__ +#define __REGRESS_384_SHARED__ + +void foo(); + +#endif diff --git a/pkgs/ffigen/test/header_parser_tests/regress_384_test.dart b/pkgs/ffigen/test/header_parser_tests/regress_384_test.dart new file mode 100644 index 0000000000..950d985a0e --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/regress_384_test.dart @@ -0,0 +1,46 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; + +import '../test_utils.dart'; + +late Library actual; +void main() { + group('regress_384_test', () { + setUpAll(() { + logWarnings(Level.SEVERE); + actual = parser.parse( + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Regression test for #384' +${strings.output}: 'unused' +${strings.headers}: + ${strings.entryPoints}: + - 'test/header_parser_tests/regress_384_header_1.h' + - 'test/header_parser_tests/regress_384_header_2.h' + ''') as yaml.YamlMap), + ); + }); + + test('Expected bindings', () { + matchLibraryWithExpected(actual, [ + 'test', + 'debug_generated', + 'header_parser_regress_384_test_output.dart' + ], [ + 'test', + 'header_parser_tests', + 'expected_bindings', + '_expected_regress_384_bindings.dart' + ]); + }); + }); +} diff --git a/pkgs/ffigen/test/header_parser_tests/unions_test.dart b/pkgs/ffigen/test/header_parser_tests/unions_test.dart index 5146d627d5..ce2b0ea618 100644 --- a/pkgs/ffigen/test/header_parser_tests/unions_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/unions_test.dart @@ -14,7 +14,7 @@ import '../test_utils.dart'; late Library actual; void main() { - group('packed_structs_test', () { + group('unions_test', () { setUpAll(() { logWarnings(Level.SEVERE); actual = parser.parse( From a2465f94e6d1819a4eac69bd7299905387987377 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 15 Sep 2022 17:30:50 +0200 Subject: [PATCH 180/276] [ffigen] Work around analyzer bug for FfiNatives (#455) * Work around analyzer bug for FfiNatives * another pointer arg --- .../example/ffinative/generated_bindings.dart | 13 ++++++------- pkgs/ffigen/example/ffinative/headers/example.h | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/pkgs/ffigen/example/ffinative/generated_bindings.dart b/pkgs/ffigen/example/ffinative/generated_bindings.dart index 794f28f3db..ea0436b0c9 100644 --- a/pkgs/ffigen/example/ffinative/generated_bindings.dart +++ b/pkgs/ffigen/example/ffinative/generated_bindings.dart @@ -11,9 +11,9 @@ external int sum( ); /// Subtracts 2 integers. -@ffi.FfiNative, ffi.Int)>('subtract') +@ffi.FfiNative('subtract') external int subtract( - ffi.Pointer a, + int a, int b, ); @@ -32,10 +32,9 @@ external ffi.Pointer divide( ); /// Divides 2 floats, returns a pointer to double. -@ffi.FfiNative< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>('dividePrecision') +@ffi.FfiNative Function(ffi.Float, ffi.Float)>( + 'dividePrecision') external ffi.Pointer dividePrecision( - ffi.Pointer a, - ffi.Pointer b, + double a, + double b, ); diff --git a/pkgs/ffigen/example/ffinative/headers/example.h b/pkgs/ffigen/example/ffinative/headers/example.h index 40c6b9e769..44056dd7da 100644 --- a/pkgs/ffigen/example/ffinative/headers/example.h +++ b/pkgs/ffigen/example/ffinative/headers/example.h @@ -6,7 +6,7 @@ int sum(int a, int b); /** Subtracts 2 integers. */ -int subtract(int *a, int b); +int subtract(int a, int b); /** Multiplies 2 integers, returns pointer to an integer,. */ int *multiply(int a, int b); @@ -15,4 +15,4 @@ int *multiply(int a, int b); float *divide(int a, int b); /** Divides 2 floats, returns a pointer to double. */ -double *dividePrecision(float *a, float *b); +double *dividePrecision(float a, float b); From 820c2b1eb667391f94e02b5a8dddb332be4e1cbc Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Fri, 16 Sep 2022 10:27:57 -0700 Subject: [PATCH 181/276] [ffigen] Correctly handle strings with null characters (#454) * String fix mostly working using NSString.dataUsingEncoding: * Handle case where NSData wasn't parsed * Fix formatting (apparently Dart at HEAD disagrees with v2.18) --- .../objc_built_in_functions.dart | 25 ++++++--- .../src/code_generator/objc_interface.dart | 53 ++++++++++++++----- .../test/native_objc_test/string_test.dart | 9 ++-- 3 files changed, 63 insertions(+), 24 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index ff96125122..270cd1839f 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -300,20 +300,33 @@ class $name implements ${w.ffiLibraryPrefix}.Finalizable { _interfaceRegistry[interface.originalName] = interface; } + ObjCInterface get nsData { + return _interfaceRegistry["NSData"] ?? + (ObjCInterface( + originalName: "NSData", + builtInFunctions: this, + isBuiltIn: true, + )); + } + void generateNSStringUtils(Writer w, StringBuffer s) { - // Generate a constructor that wraps stringWithCString, and a toString - // method that wraps UTF8String. + // Generate a constructor that wraps stringWithCharacters, and a toString + // method that wraps dataUsingEncoding. s.write(''' factory NSString(${w.className} _lib, String str) { - final cstr = str.toNativeUtf8(); - final nsstr = stringWithCString_encoding_(_lib, cstr.cast(), 4 /* UTF8 */); + final cstr = str.toNativeUtf16(); + final nsstr = stringWithCharacters_length_(_lib, cstr.cast(), str.length); ${w.ffiPkgLibraryPrefix}.calloc.free(cstr); return nsstr; } @override - String toString() => - (UTF8String).cast<${w.ffiPkgLibraryPrefix}.Utf8>().toDartString(); + String toString() { + final data = dataUsingEncoding_( + 0x94000100 /* NSUTF16LittleEndianStringEncoding */); + return data.bytes.cast<${w.ffiPkgLibraryPrefix}.Utf16>().toDartString( + length: length); + } '''); } diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index a6099b8175..68da95dab1 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -51,19 +51,25 @@ class ObjCInterface extends BindingType { ObjCInterface({ String? usr, required String originalName, - required String name, - required this.lookupName, + String? name, + String? lookupName, String? dartDoc, required this.builtInFunctions, required this.isBuiltIn, - }) : super( + }) : lookupName = lookupName ?? originalName, + super( usr: usr, originalName: originalName, - name: name, + name: name ?? originalName, dartDoc: dartDoc, - ); + ) { + if (isBuiltIn) { + builtInFunctions.registerInterface(this); + } + } bool get isNSString => isBuiltIn && originalName == "NSString"; + bool get isNSData => isBuiltIn && originalName == "NSData"; @override BindingString toBindingString(Writer w) { @@ -224,10 +230,6 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { dependencies.add(this); builtInFunctions.addDependencies(dependencies); - if (isBuiltIn) { - builtInFunctions.registerInterface(this); - } - _classObject = ObjCInternalGlobal( '_class_$originalName', (Writer w) => '${builtInFunctions.getClass.name}("$lookupName")', @@ -241,6 +243,10 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { _addNSStringMethods(); } + if (isNSData) { + _addNSDataMethods(); + } + if (superType != null) { superType!.addDependencies(dependencies); _copyClassMethodsFromSuperType(); @@ -290,20 +296,39 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { void _addNSStringMethods() { addMethod(ObjCMethod( - originalName: 'stringWithCString:encoding:', + originalName: 'stringWithCharacters:length:', kind: ObjCMethodKind.method, isClass: true, returnType: this, params_: [ - ObjCMethodParam(PointerType(charType), 'cString'), - ObjCMethodParam(unsignedIntType, 'enc'), + ObjCMethodParam(PointerType(wCharType), 'characters'), + ObjCMethodParam(unsignedIntType, 'length'), ], )); addMethod(ObjCMethod( - originalName: 'UTF8String', + originalName: 'dataUsingEncoding:', + kind: ObjCMethodKind.method, + isClass: false, + returnType: builtInFunctions.nsData, + params_: [ + ObjCMethodParam(unsignedIntType, 'encoding'), + ], + )); + addMethod(ObjCMethod( + originalName: 'length', + kind: ObjCMethodKind.propertyGetter, + isClass: false, + returnType: unsignedIntType, + params_: [], + )); + } + + void _addNSDataMethods() { + addMethod(ObjCMethod( + originalName: 'bytes', kind: ObjCMethodKind.propertyGetter, isClass: false, - returnType: PointerType(charType), + returnType: PointerType(voidType), params_: [], )); } diff --git a/pkgs/ffigen/test/native_objc_test/string_test.dart b/pkgs/ffigen/test/native_objc_test/string_test.dart index 458621ed2b..068e5ed52e 100644 --- a/pkgs/ffigen/test/native_objc_test/string_test.dart +++ b/pkgs/ffigen/test/native_objc_test/string_test.dart @@ -25,16 +25,17 @@ void main() { generateBindingsForCoverage('string'); }); - // TODO(#329): Add 'Embedded\u0000Null'. - for (final s in ['Hello', '🇵🇬']) { + for (final s in ['Hello', '🇵🇬', 'Embedded\u0000Null']) { test('NSString to/from Dart string [$s]', () { final ns1 = NSString(lib, s); - expect(ns1.toString(), s); expect(ns1.length, s.length); + expect(ns1.toString().length, s.length); + expect(ns1.toString(), s); final ns2 = s.toNSString(lib); - expect(ns2.toString(), s); expect(ns2.length, s.length); + expect(ns2.toString().length, s.length); + expect(ns2.toString(), s); }); } From 6ef32d590306839b24ed6a67606e89a441aba0ca Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Thu, 22 Sep 2022 09:37:03 -0700 Subject: [PATCH 182/276] [ffigen] Remove list_diff package (#456) --- pkgs/ffigen/pubspec.yaml | 1 - pkgs/ffigen/test/test_utils.dart | 40 +------------------------------- 2 files changed, 1 insertion(+), 40 deletions(-) diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 1bdec3a24c..f144be142a 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -23,5 +23,4 @@ dependencies: dev_dependencies: lints: ^1.0.1 - list_diff: ^2.0.1 test: ^1.16.2 diff --git a/pkgs/ffigen/test/test_utils.dart b/pkgs/ffigen/test/test_utils.dart index fef4c4cf11..314f8aad1e 100644 --- a/pkgs/ffigen/test/test_utils.dart +++ b/pkgs/ffigen/test/test_utils.dart @@ -5,7 +5,6 @@ import 'dart:io'; import 'package:ffigen/src/code_generator.dart'; -import 'package:list_diff/list_diff.dart' as list_diff; import 'package:logging/logging.dart'; import 'package:path/path.dart' as path; import 'package:test/test.dart'; @@ -41,43 +40,6 @@ void verifySetupFile(File file) { } } -// String matcher for large strings, which prints the diffs between the expected -// and actual values, rather than just printing the entire strings. -class _LargeStringMatcher extends Matcher { - final String expected; - - _LargeStringMatcher(this.expected); - - @override - bool matches(dynamic item, Map matchState) { - return expected == item; - } - - @override - Description describe(Description description) { - return description.add('Has no diffs'); - } - - @override - Description describeMismatch(Object? item, Description mismatchDescription, - Map matchState, bool verbose) { - if (item is! String) { - return mismatchDescription.add('is ').addDescriptionOf(item); - } - return mismatchDescription.add('has diff:\n').add(_diff(item)); - } - - String _diff(String actual) { - final out = StringBuffer(); - for (final op - in list_diff.diffSync(expected.split('\n'), actual.split('\n'))) { - out.write(op.isInsertion ? 'ACT ' : 'EXP '); - out.write('${op.index}\t${op.item}\n'); - } - return out.toString(); - } -} - /// Generates actual file using library and tests using [expect] with expected /// /// This will not delete the actual debug file incase [expect] throws an error. @@ -93,7 +55,7 @@ void matchLibraryWithExpected( final expected = File(path.joinAll(pathToExpected)) .readAsStringSync() .replaceAll('\r', ''); - expect(actual, _LargeStringMatcher(expected)); + expect(actual, expected); if (file.existsSync()) { file.delete(); } From 5c4b3abc293b992b8c3ac8bf6e38291de842b39b Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Mon, 26 Sep 2022 08:53:26 -0700 Subject: [PATCH 183/276] [ffigen] Pointer.fromFunction leaks, so store result in static variable (#459) --- .../lib/src/code_generator/objc_block.dart | 6 ++-- .../sub_parsers/compounddecl_parser.dart | 9 ++++- .../sub_parsers/enumdecl_parser.dart | 9 ++++- .../sub_parsers/macro_parser.dart | 9 ++++- .../sub_parsers/objcinterfacedecl_parser.dart | 34 ++++++++++++++++--- .../sub_parsers/unnamed_enumdecl_parser.dart | 9 ++++- .../translation_unit_parser.dart | 9 ++++- pkgs/ffigen/lib/src/header_parser/utils.dart | 8 ++++- 8 files changed, 80 insertions(+), 13 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/objc_block.dart b/pkgs/ffigen/lib/src/code_generator/objc_block.dart index 73f5a311dc..310fef16ec 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_block.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_block.dart @@ -109,16 +109,18 @@ class $name extends _ObjCBlockBase { /// Creates a block from a C function pointer. $name.fromFunctionPointer(${w.className} lib, $natFnPtr ptr) : this._(lib.${builtInFunctions.newBlock.name}( - ${w.ffiLibraryPrefix}.Pointer.fromFunction< + _cFuncTrampoline ??= ${w.ffiLibraryPrefix}.Pointer.fromFunction< ${trampFuncType.getCType(w)}>($funcPtrTrampoline $exceptionalReturn).cast(), ptr.cast()), lib); + static $voidPtr? _cFuncTrampoline; /// Creates a block from a Dart function. $name.fromFunction(${w.className} lib, ${funcType.getDartType(w)} fn) : this._(lib.${builtInFunctions.newBlock.name}( - ${w.ffiLibraryPrefix}.Pointer.fromFunction< + _dartFuncTrampoline ??= ${w.ffiLibraryPrefix}.Pointer.fromFunction< ${trampFuncType.getCType(w)}>($closureTrampoline $exceptionalReturn).cast(), $registerClosure(fn)), lib); + static $voidPtr? _dartFuncTrampoline; '''); // Call method. diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart index 49e241867e..9e284b219c 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart @@ -16,6 +16,12 @@ import '../utils.dart'; final _logger = Logger('ffigen.header_parser.compounddecl_parser'); +Pointer< + NativeFunction< + Int32 Function( + clang_types.CXCursor, clang_types.CXCursor, Pointer)>>? + _compoundMembersVisitorPtr; + /// Holds temporary information regarding [compound] while parsing. class _ParsedCompound { Compound compound; @@ -179,7 +185,8 @@ void fillCompoundMembersIfNeeded( _stack.push(parsed); final resultCode = clang.clang_visitChildren( cursor, - Pointer.fromFunction(_compoundMembersVisitor, exceptional_visitor_return), + _compoundMembersVisitorPtr ??= Pointer.fromFunction( + _compoundMembersVisitor, exceptional_visitor_return), nullptr, ); _stack.pop(); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index 7eb65a8193..1353f2d8fe 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -15,6 +15,12 @@ import '../utils.dart'; final _logger = Logger('ffigen.header_parser.enumdecl_parser'); +Pointer< + NativeFunction< + Int32 Function( + clang_types.CXCursor, clang_types.CXCursor, Pointer)>>? + _enumCursorVisitorPtr; + /// Holds temporary information regarding [EnumClass] while parsing. class _ParsedEnum { EnumClass? enumClass; @@ -70,7 +76,8 @@ EnumClass? parseEnumDeclaration( void _addEnumConstant(clang_types.CXCursor cursor) { final resultCode = clang.clang_visitChildren( cursor, - Pointer.fromFunction(_enumCursorVisitor, exceptional_visitor_return), + _enumCursorVisitorPtr ??= + Pointer.fromFunction(_enumCursorVisitor, exceptional_visitor_return), nullptr, ); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart index 753a4b51f3..cb5fbdb45b 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart @@ -19,6 +19,12 @@ import '../utils.dart'; final _logger = Logger('ffigen.header_parser.macro_parser'); +Pointer< + NativeFunction< + Int32 Function( + clang_types.CXCursor, clang_types.CXCursor, Pointer)>>? + _macroVariablevisitorPtr; + /// Adds a macro definition to be parsed later. void saveMacroDefinition(clang_types.CXCursor cursor) { final macroUsr = cursor.usr(); @@ -79,7 +85,8 @@ List? parseSavedMacros() { final resultCode = clang.clang_visitChildren( rootCursor, - Pointer.fromFunction(_macroVariablevisitor, exceptional_visitor_return), + _macroVariablevisitorPtr ??= Pointer.fromFunction( + _macroVariablevisitor, exceptional_visitor_return), nullptr, ); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index bace1c4e80..16cec51494 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -14,6 +14,27 @@ import '../utils.dart'; final _logger = Logger('ffigen.header_parser.objcinterfacedecl_parser'); +Pointer< + NativeFunction< + Int32 Function( + clang_types.CXCursor, clang_types.CXCursor, Pointer)>>? + _parseInterfaceVisitorPtr; +Pointer< + NativeFunction< + Int32 Function( + clang_types.CXCursor, clang_types.CXCursor, Pointer)>>? + _isClassDeclarationVisitorPtr; +Pointer< + NativeFunction< + Int32 Function( + clang_types.CXCursor, clang_types.CXCursor, Pointer)>>? + _parseMethodVisitorPtr; +Pointer< + NativeFunction< + Int32 Function( + clang_types.CXCursor, clang_types.CXCursor, Pointer)>>? + _findCategoryInterfaceVisitorPtr; + class _ParsedObjCInterface { ObjCInterface interface; _ParsedObjCInterface(this.interface); @@ -75,7 +96,8 @@ void fillObjCInterfaceMethodsIfNeeded( _interfaceStack.push(_ParsedObjCInterface(itf)); clang.clang_visitChildren( cursor, - Pointer.fromFunction(_parseInterfaceVisitor, exceptional_visitor_return), + _parseInterfaceVisitorPtr ??= Pointer.fromFunction( + _parseInterfaceVisitor, exceptional_visitor_return), nullptr); _interfaceStack.pop(); @@ -89,7 +111,7 @@ bool _isClassDeclaration(clang_types.CXCursor cursor) { _isClassDeclarationResult = true; clang.clang_visitChildren( cursor, - Pointer.fromFunction( + _isClassDeclarationVisitorPtr ??= Pointer.fromFunction( _isClassDeclarationVisitor, exceptional_visitor_return), nullptr); return _isClassDeclarationResult; @@ -218,7 +240,8 @@ void _parseMethod(clang_types.CXCursor cursor) { _methodStack.push(parsed); clang.clang_visitChildren( cursor, - Pointer.fromFunction(_parseMethodVisitor, exceptional_visitor_return), + _parseMethodVisitorPtr ??= + Pointer.fromFunction(_parseMethodVisitor, exceptional_visitor_return), nullptr); _methodStack.pop(); if (parsed.hasError) { @@ -292,7 +315,7 @@ BindingType? parseObjCCategoryDeclaration(clang_types.CXCursor cursor) { _findCategoryInterfaceVisitorResult = null; clang.clang_visitChildren( cursor, - Pointer.fromFunction( + _findCategoryInterfaceVisitorPtr ??= Pointer.fromFunction( _findCategoryInterfaceVisitor, exceptional_visitor_return), nullptr); final itfCursor = _findCategoryInterfaceVisitorResult; @@ -312,7 +335,8 @@ BindingType? parseObjCCategoryDeclaration(clang_types.CXCursor cursor) { _interfaceStack.push(_ParsedObjCInterface(itf)); clang.clang_visitChildren( cursor, - Pointer.fromFunction(_parseInterfaceVisitor, exceptional_visitor_return), + _parseInterfaceVisitorPtr ??= Pointer.fromFunction( + _parseInterfaceVisitor, exceptional_visitor_return), nullptr); _interfaceStack.pop(); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart index 81c0a77bcc..879dfea8de 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart @@ -14,11 +14,18 @@ import '../utils.dart'; final _logger = Logger('ffigen.header_parser.unnamed_enumdecl_parser'); +Pointer< + NativeFunction< + Int32 Function( + clang_types.CXCursor, clang_types.CXCursor, Pointer)>>? + _unnamedenumCursorVisitorPtr; + /// Saves unnamed enums. void saveUnNamedEnum(clang_types.CXCursor cursor) { final resultCode = clang.clang_visitChildren( cursor, - Pointer.fromFunction(_unnamedenumCursorVisitor, exceptional_visitor_return), + _unnamedenumCursorVisitorPtr ??= Pointer.fromFunction( + _unnamedenumCursorVisitor, exceptional_visitor_return), nullptr, ); diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart index 7831ae8aa4..b34b1b163b 100644 --- a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -21,12 +21,19 @@ final _logger = Logger('ffigen.header_parser.translation_unit_parser'); late Set _bindings; +Pointer< + NativeFunction< + Int32 Function( + clang_types.CXCursor, clang_types.CXCursor, Pointer)>>? + _rootCursorVisitorPtr; + /// Parses the translation unit and returns the generated bindings. Set parseTranslationUnit(clang_types.CXCursor translationUnitCursor) { _bindings = {}; final resultCode = clang.clang_visitChildren( translationUnitCursor, - Pointer.fromFunction(_rootCursorVisitor, exceptional_visitor_return), + _rootCursorVisitorPtr ??= + Pointer.fromFunction(_rootCursorVisitor, exceptional_visitor_return), nullptr, ); diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index 7352642cf7..5f9bd33ea5 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -127,6 +127,11 @@ extension CXCursorExt on clang_types.CXCursor { } } +Pointer< + NativeFunction< + Int32 Function( + clang_types.CXCursor, clang_types.CXCursor, Pointer)>>? + _printAstVisitorPtr; int _printAstVisitorMaxDepth = 0; int _printAstVisitor(clang_types.CXCursor cursor, clang_types.CXCursor parent, Pointer clientData) { @@ -137,7 +142,8 @@ int _printAstVisitor(clang_types.CXCursor cursor, clang_types.CXCursor parent, print((' ' * depth) + cursor.completeStringRepr()); clang.clang_visitChildren( cursor, - Pointer.fromFunction(_printAstVisitor, exceptional_visitor_return), + _printAstVisitorPtr ??= + Pointer.fromFunction(_printAstVisitor, exceptional_visitor_return), Pointer.fromAddress(depth + 1)); return clang_types.CXChildVisitResult.CXChildVisit_Continue; } From 2a430c6732bb3973ea7cb82f22992afdc34567d2 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Tue, 27 Sep 2022 01:33:46 -0700 Subject: [PATCH 184/276] [ffigen] NativeFunc's child should be a FunctionType (#461) --- pkgs/ffigen/lib/src/code_generator/func_type.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ffigen/lib/src/code_generator/func_type.dart b/pkgs/ffigen/lib/src/code_generator/func_type.dart index 0b8abfd1d4..3025bd2a26 100644 --- a/pkgs/ffigen/lib/src/code_generator/func_type.dart +++ b/pkgs/ffigen/lib/src/code_generator/func_type.dart @@ -58,7 +58,7 @@ class FunctionType extends Type { /// Represents a NativeFunction. class NativeFunc extends Type { - final Type type; + final FunctionType type; NativeFunc(this.type); From 4fe87834db519491972cda61d55031154217deeb Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Tue, 27 Sep 2022 15:47:20 +0200 Subject: [PATCH 185/276] [ffigen] Update LICENSE (#457) Follow Protobuf's practice of including a trailer in the LICENSE file. --- pkgs/ffigen/LICENSE | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/ffigen/LICENSE b/pkgs/ffigen/LICENSE index 467a982862..c7e642d2e2 100644 --- a/pkgs/ffigen/LICENSE +++ b/pkgs/ffigen/LICENSE @@ -25,3 +25,6 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Code generated by FFIgen is owned by the owner of the input file used +when generating it. From 27d9b9f0500bcf6249ecd99444d9ec3e18ef6dbf Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Thu, 29 Sep 2022 15:13:03 -0700 Subject: [PATCH 186/276] [ffigen] Fix mac bot (#466) --- .../clang_bindings/clang_bindings.dart | 11 +++++++++++ .../large_integration_tests/large_test.dart | 4 ++++ ...class_test.dart => swift_class_test_.dart} | 0 pkgs/ffigen/test/test_utils.dart | 19 ++++++++++++++----- pkgs/ffigen/tool/libclang_config.yaml | 1 + 5 files changed, 30 insertions(+), 5 deletions(-) rename pkgs/ffigen/test/native_objc_test/{swift_class_test.dart => swift_class_test_.dart} (100%) diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index e8755f51d1..8185f345a6 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -1176,6 +1176,17 @@ class Clang { late final _clang_getCursorKindSpelling = _clang_getCursorKindSpellingPtr.asFunction(); + /// 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(); + } + + late final _clang_getClangVersionPtr = + _lookup>('clang_getClangVersion'); + late final _clang_getClangVersion = + _clang_getClangVersionPtr.asFunction(); + /// If cursor is a statement declaration tries to evaluate the /// statement and if its variable, tries to evaluate its initializer, /// into its corresponding type. diff --git a/pkgs/ffigen/test/large_integration_tests/large_test.dart b/pkgs/ffigen/test/large_integration_tests/large_test.dart index 163895111b..d789b816a0 100644 --- a/pkgs/ffigen/test/large_integration_tests/large_test.dart +++ b/pkgs/ffigen/test/large_integration_tests/large_test.dart @@ -52,6 +52,10 @@ ${strings.preamble}: | library, ['test', 'debug_generated', 'large_test_libclang.dart'], ['test', 'large_integration_tests', '_expected_libclang_bindings.dart'], + // Remove comments containing @ to hack around a mismatch in the + // documentation generated by different clang versions. + codeNormalizer: (code) => + code.replaceAll(RegExp('[^\n]*///[^\n]*@[^\n]*\n'), ''), ); }); diff --git a/pkgs/ffigen/test/native_objc_test/swift_class_test.dart b/pkgs/ffigen/test/native_objc_test/swift_class_test_.dart similarity index 100% rename from pkgs/ffigen/test/native_objc_test/swift_class_test.dart rename to pkgs/ffigen/test/native_objc_test/swift_class_test_.dart diff --git a/pkgs/ffigen/test/test_utils.dart b/pkgs/ffigen/test/test_utils.dart index 314f8aad1e..bc12c6408f 100644 --- a/pkgs/ffigen/test/test_utils.dart +++ b/pkgs/ffigen/test/test_utils.dart @@ -40,21 +40,30 @@ void verifySetupFile(File file) { } } +// Remove '\r' for Windows compatibility, then apply user's normalizer. +String _normalizeGeneratedCode( + String generated, String Function(String)? codeNormalizer) { + final noCR = generated.replaceAll('\r', ''); + if (codeNormalizer == null) return noCR; + return codeNormalizer(noCR); +} + /// Generates actual file using library and tests using [expect] with expected /// /// This will not delete the actual debug file incase [expect] throws an error. void matchLibraryWithExpected( - Library library, List pathForActual, List pathToExpected) { + Library library, List pathForActual, List pathToExpected, + {String Function(String)? codeNormalizer}) { final file = File( path.joinAll(pathForActual), ); library.generateFile(file); try { - final actual = file.readAsStringSync().replaceAll('\r', ''); - final expected = File(path.joinAll(pathToExpected)) - .readAsStringSync() - .replaceAll('\r', ''); + final actual = + _normalizeGeneratedCode(file.readAsStringSync(), codeNormalizer); + final expected = _normalizeGeneratedCode( + File(path.joinAll(pathToExpected)).readAsStringSync(), codeNormalizer); expect(actual, expected); if (file.existsSync()) { file.delete(); diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index 3087cf8c06..79cbbd6c68 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -118,3 +118,4 @@ functions: - clang_Cursor_getObjCPropertySetterName - clang_Type_getNullability - clang_Location_isInSystemHeader + - clang_getClangVersion From 30cc93d5490d0ced83c39e9d15ba71fbd9c8387d Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Fri, 30 Sep 2022 11:34:54 -0700 Subject: [PATCH 187/276] [ffigen] Assume relative paths are relative to the config file (#465) * WIP relative paths * wip * Migrate tests * Fix swift test * Update changelog and fix analysis --- pkgs/ffigen/CHANGELOG.md | 5 ++ .../lib/src/config_provider/config.dart | 25 +++++-- .../lib/src/config_provider/spec_utils.dart | 51 ++++---------- pkgs/ffigen/lib/src/executables/ffigen.dart | 8 +-- pkgs/ffigen/pubspec.yaml | 2 +- .../example_tests/swift_example_test.dart | 70 +++++++++++++++++++ .../automated_ref_count_config.yaml | 4 +- .../native_objc_test/bad_method_config.yaml | 4 +- .../test/native_objc_test/block_config.yaml | 4 +- .../test/native_objc_test/cast_config.yaml | 4 +- .../native_objc_test/category_config.yaml | 6 +- .../failed_to_load_config.yaml | 4 +- .../native_objc_test/forward_decl_config.yaml | 6 +- .../native_objc_test/is_instance_config.yaml | 4 +- .../test/native_objc_test/method_config.yaml | 4 +- .../native_objc_test/native_objc_config.yaml | 4 +- .../native_objc_test/nullable_config.yaml | 4 +- .../native_objc_test/property_config.yaml | 4 +- .../test/native_objc_test/rename_config.yaml | 4 +- .../test/native_objc_test/string_config.yaml | 4 +- .../native_objc_test/swift_class_config.yaml | 4 +- pkgs/ffigen/tool/libclang_config.yaml | 4 +- 22 files changed, 146 insertions(+), 83 deletions(-) create mode 100644 pkgs/ffigen/test/example_tests/swift_example_test.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 38be29725a..28b04351de 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,8 @@ +# 7.0.0-dev + +- Relative paths in ffigen config files are now assumed to be relative to the + config file, rather than the working directory of the tool invocation. + # 6.1.2 - Fix bug where function bindings were not deduped correctly. diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 1fdb77e0c5..3457c91577 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -4,8 +4,9 @@ /// Validates the yaml input by the user, prints useful info for the user -import 'package:ffigen/src/code_generator.dart'; +import 'dart:io'; +import 'package:ffigen/src/code_generator.dart'; import 'package:logging/logging.dart'; import 'package:yaml/yaml.dart'; @@ -19,6 +20,10 @@ final _logger = Logger('ffigen.config_provider.config'); /// /// Handles validation, extraction of confiurations from yaml file. class Config { + /// Input filename. + String? get filename => _filename; + String? _filename; + /// Location for llvm/lib folder. String get libclangDylib => _libclangDylib; late String _libclangDylib; @@ -154,11 +159,11 @@ class Config { FfiNativeConfig get ffiNativeConfig => _ffiNativeConfig; late FfiNativeConfig _ffiNativeConfig; - Config._(); + Config._(this._filename); /// Create config from Yaml map. - factory Config.fromYaml(YamlMap map) { - final configspecs = Config._(); + factory Config.fromYaml(YamlMap map, [String? filename]) { + final configspecs = Config._(filename); _logger.finest('Config Map: ' + map.toString()); final specs = configspecs._getSpecs(); @@ -172,6 +177,14 @@ class Config { return configspecs; } + /// Create config from a file. + factory Config.fromFile(File file) { + // Throws a [YamlException] if it's unable to parse the Yaml. + final configYaml = loadYaml(file.readAsStringSync()) as YamlMap; + + return Config.fromYaml(configYaml, file.path); + } + /// Add compiler options for clang. If [highPriority] is true these are added /// to the front of the list. void addCompilerOpts(String compilerOpts, {bool highPriority = false}) { @@ -235,7 +248,7 @@ class Config { [strings.output]: Specification( requirement: Requirement.yes, validator: outputValidator, - extractor: outputExtractor, + extractor: (dynamic value) => outputExtractor(value, filename), extractedResult: (dynamic result) => _output = result as String, ), [strings.language]: Specification( @@ -248,7 +261,7 @@ class Config { [strings.headers]: Specification( requirement: Requirement.yes, validator: headersValidator, - extractor: headersExtractor, + extractor: (dynamic value) => headersExtractor(value, filename), extractedResult: (dynamic result) => _headers = result as Headers, ), [strings.compilerOpts]: Specification>( diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 56cc872e64..53c8ce92dd 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -26,6 +26,14 @@ String _replaceSeparators(String path) { } } +/// Replaces the path separators according to current platform. If a relative +/// path is passed in, it is resolved relative to the config path, and the +/// absolute path is returned. +String _normalizePath(String path, String? configFilename) { + return _replaceSeparators( + configFilename == null ? path : p.join(p.dirname(configFilename), path)); +} + /// Checks if type of value is [T], logs an error if it's not. /// /// [key] is printed as `'item1 -> item2 => item3'` in log message. @@ -305,23 +313,23 @@ bool compilerOptsAutoValidator(List name, dynamic value) { return _result; } -Headers headersExtractor(dynamic yamlConfig) { +Headers headersExtractor(dynamic yamlConfig, String? configFilename) { final entryPoints = []; final includeGlobs = []; for (final key in (yamlConfig as YamlMap).keys) { if (key == strings.entryPoints) { for (final h in (yamlConfig[key] as YamlList)) { - final headerGlob = h as String; + final headerGlob = _normalizePath(h as String, configFilename); // Add file directly to header if it's not a Glob but a File. if (File(headerGlob).existsSync()) { - final osSpecificPath = _replaceSeparators(headerGlob); + final osSpecificPath = headerGlob; entryPoints.add(osSpecificPath); _logger.fine('Adding header/file: $headerGlob'); } else { final glob = Glob(headerGlob); for (final file in glob.listFileSystemSync(const LocalFileSystem(), followLinks: true)) { - final fixedPath = _replaceSeparators(file.path); + final fixedPath = file.path; entryPoints.add(fixedPath); _logger.fine('Adding header/file: $fixedPath'); } @@ -331,7 +339,7 @@ Headers headersExtractor(dynamic yamlConfig) { if (key == strings.includeDirectives) { for (final h in (yamlConfig[key] as YamlList)) { final headerGlob = h as String; - final fixedGlob = _replaceSeparators(headerGlob); + final fixedGlob = _normalizePath(headerGlob, configFilename); includeGlobs.add(quiver.Glob(fixedGlob)); } } @@ -366,36 +374,6 @@ bool headersValidator(List name, dynamic value) { } } -String libclangDylibExtractor(dynamic value) => getDylibPath(value as String); - -bool libclangDylibValidator(List name, dynamic value) { - if (!checkType(name, value)) { - return false; - } else { - final dylibPath = getDylibPath(value as String); - if (!File(dylibPath).existsSync()) { - _logger.severe( - 'Dynamic library: $dylibPath does not exist or is corrupt, input folder: $value.'); - return false; - } else { - return true; - } - } -} - -String getDylibPath(String dylibParentFoler) { - dylibParentFoler = _replaceSeparators(dylibParentFoler); - String dylibPath; - if (Platform.isMacOS) { - dylibPath = p.join(dylibParentFoler, strings.libclang_dylib_macos); - } else if (Platform.isWindows) { - dylibPath = p.join(dylibParentFoler, strings.libclang_dylib_windows); - } else { - dylibPath = p.join(dylibParentFoler, strings.libclang_dylib_linux); - } - return dylibPath; -} - /// Returns location of dynamic library by searching default locations. Logs /// error and throws an Exception if not found. String findDylibAtDefaultLocations() { @@ -504,7 +482,8 @@ bool llvmPathValidator(List name, dynamic value) { return true; } -String outputExtractor(dynamic value) => _replaceSeparators(value as String); +String outputExtractor(dynamic value, String? configFilename) => + _normalizePath(value as String, configFilename); bool outputValidator(List name, dynamic value) => checkType(name, value); diff --git a/pkgs/ffigen/lib/src/executables/ffigen.dart b/pkgs/ffigen/lib/src/executables/ffigen.dart index 12dd868d1f..b3e7c41bb9 100644 --- a/pkgs/ffigen/lib/src/executables/ffigen.dart +++ b/pkgs/ffigen/lib/src/executables/ffigen.dart @@ -101,7 +101,7 @@ Config getConfigFromPubspec() { _logger.severe("Couldn't find an entry for '$configKey' in $pubspecName."); exit(1); } - return Config.fromYaml(bindingsConfigMap); + return Config.fromYaml(bindingsConfigMap, pubspecFile.path); } /// Extracts configuration from a custom yaml file. @@ -113,11 +113,7 @@ Config getConfigFromCustomYaml(String yamlPath) { exit(1); } - // Throws a [YamlException] if it's unable to parse the Yaml. - final bindingsConfigMap = - yaml.loadYaml(yamlFile.readAsStringSync()) as yaml.YamlMap; - - return Config.fromYaml(bindingsConfigMap); + return Config.fromFile(yamlFile); } /// Parses the cmd line arguments. diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index f144be142a..302f458128 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 6.1.2 +version: 7.0.0-dev description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen diff --git a/pkgs/ffigen/test/example_tests/swift_example_test.dart b/pkgs/ffigen/test/example_tests/swift_example_test.dart new file mode 100644 index 0000000000..151b89547f --- /dev/null +++ b/pkgs/ffigen/test/example_tests/swift_example_test.dart @@ -0,0 +1,70 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Swift support is only available on mac. +@TestOn('mac-os') + +import 'dart:async'; +import 'dart:io'; + +import 'package:ffigen/src/config_provider/config.dart'; +import 'package:ffigen/src/header_parser.dart'; +import 'package:logging/logging.dart'; +import 'package:path/path.dart' as p; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart'; + +import '../test_utils.dart'; + +void main() { + group('swift_example_test', () { + setUpAll(() { + logWarnings(Level.SEVERE); + }); + + test('swift', () async { + // Run the swiftc command from the example README, to generate the header. + final process = await Process.start( + 'swiftc', + [ + '-c', + 'swift_api.swift', + '-module-name', + 'swift_module', + '-emit-objc-header-path', + 'swift_api.h', + '-emit-library', + '-o', + 'libswiftapi.dylib', + ], + workingDirectory: p.join(Directory.current.path, 'example/swift')); + unawaited(stdout.addStream(process.stdout)); + unawaited(stderr.addStream(process.stderr)); + final result = await process.exitCode; + expect(result, 0); + + final pubspecFile = File('example/swift/pubspec.yaml'); + final pubspecYaml = loadYaml(pubspecFile.readAsStringSync()) as YamlMap; + final config = + Config.fromYaml(pubspecYaml['ffigen'] as YamlMap, pubspecFile.path); + final output = parse(config).generate(); + + // Verify that the output contains all the methods and classes that the + // example app uses. + expect(output, contains('class SwiftLibrary{')); + expect(output, contains('class NSString extends NSObject {')); + expect(output, contains('class SwiftClass extends NSObject {')); + expect(output, contains('static SwiftClass new1(SwiftLibrary _lib) {')); + expect(output, contains('NSString sayHello() {')); + expect(output, contains('int get someField {')); + expect(output, contains('set someField(int value) {')); + + // Verify that SwiftClass is loaded using the swift_module prefix. + expect( + output, + contains(RegExp(r'late final _class_SwiftClass.* = ' + r'_getClass.*\("swift_module\.SwiftClass"\)'))); + }); + }); +} diff --git a/pkgs/ffigen/test/native_objc_test/automated_ref_count_config.yaml b/pkgs/ffigen/test/native_objc_test/automated_ref_count_config.yaml index 8884260d0b..600d33dd32 100644 --- a/pkgs/ffigen/test/native_objc_test/automated_ref_count_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/automated_ref_count_config.yaml @@ -1,7 +1,7 @@ name: AutomatedRefCountTestObjCLibrary description: 'Tests automatic reference counting of Objective-C objects' language: objc -output: 'test/native_objc_test/automated_ref_count_bindings.dart' +output: 'automated_ref_count_bindings.dart' exclude-all-by-default: true functions: include: @@ -13,6 +13,6 @@ objc-interfaces: - RefCounted headers: entry-points: - - 'test/native_objc_test/automated_ref_count_test.m' + - 'automated_ref_count_test.m' preamble: | // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/bad_method_config.yaml b/pkgs/ffigen/test/native_objc_test/bad_method_config.yaml index fa71887544..5ad9c1b9b1 100644 --- a/pkgs/ffigen/test/native_objc_test/bad_method_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/bad_method_config.yaml @@ -9,13 +9,13 @@ name: NativeObjCLibrary description: 'Native Objective C test' language: objc -output: 'test/native_objc_test/bad_method_test_bindings.dart' +output: 'bad_method_test_bindings.dart' exclude-all-by-default: true objc-interfaces: include: - 'BadMethodTestObject' headers: entry-points: - - 'test/native_objc_test/bad_method_test.m' + - 'bad_method_test.m' preamble: | // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/block_config.yaml b/pkgs/ffigen/test/native_objc_test/block_config.yaml index 3ea866d70f..e83c6b70b8 100644 --- a/pkgs/ffigen/test/native_objc_test/block_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/block_config.yaml @@ -1,13 +1,13 @@ name: BlockTestObjCLibrary description: 'Tests calling Objective-C blocks' language: objc -output: 'test/native_objc_test/block_bindings.dart' +output: 'block_bindings.dart' exclude-all-by-default: true objc-interfaces: include: - BlockTester headers: entry-points: - - 'test/native_objc_test/block_test.m' + - 'block_test.m' preamble: | // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/cast_config.yaml b/pkgs/ffigen/test/native_objc_test/cast_config.yaml index da7ecb368b..af3394113d 100644 --- a/pkgs/ffigen/test/native_objc_test/cast_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/cast_config.yaml @@ -1,13 +1,13 @@ name: CastTestObjCLibrary description: 'Tests casting objects' language: objc -output: 'test/native_objc_test/cast_bindings.dart' +output: 'cast_bindings.dart' exclude-all-by-default: true objc-interfaces: include: - Castaway headers: entry-points: - - 'test/native_objc_test/cast_test.m' + - 'cast_test.m' preamble: | // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/category_config.yaml b/pkgs/ffigen/test/native_objc_test/category_config.yaml index f70b10af39..5c74e1a541 100644 --- a/pkgs/ffigen/test/native_objc_test/category_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/category_config.yaml @@ -1,15 +1,15 @@ name: CategoryTestObjCLibrary description: 'Tests handling Objective-C categories' language: objc -output: 'test/native_objc_test/category_bindings.dart' +output: 'category_bindings.dart' exclude-all-by-default: true objc-interfaces: include: - Thing headers: entry-points: - - 'test/native_objc_test/category_test.m' + - 'category_test.m' # Include it twice, as a regression test for #353 - - 'test/native_objc_test/category_test.m' + - 'category_test.m' preamble: | // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/failed_to_load_config.yaml b/pkgs/ffigen/test/native_objc_test/failed_to_load_config.yaml index 11ddbb9133..c96702d809 100644 --- a/pkgs/ffigen/test/native_objc_test/failed_to_load_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/failed_to_load_config.yaml @@ -1,13 +1,13 @@ name: FailedToLoadTestObjCLibrary description: 'Tests failing to load an Objective-C library' language: objc -output: 'test/native_objc_test/failed_to_load_bindings.dart' +output: 'failed_to_load_bindings.dart' exclude-all-by-default: true objc-interfaces: include: - ClassThatWillFailToLoad headers: entry-points: - - 'test/native_objc_test/failed_to_load_test.m' + - 'failed_to_load_test.m' preamble: | // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/forward_decl_config.yaml b/pkgs/ffigen/test/native_objc_test/forward_decl_config.yaml index 2ccb3f64ba..7a5c815fc2 100644 --- a/pkgs/ffigen/test/native_objc_test/forward_decl_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/forward_decl_config.yaml @@ -1,14 +1,14 @@ name: ForwardDeclTestObjCLibrary description: 'Test that forward declared ObjC classes are correctly filled' language: objc -output: 'test/native_objc_test/forward_decl_bindings.dart' +output: 'forward_decl_bindings.dart' exclude-all-by-default: true objc-interfaces: include: - ForwardDeclaredClass headers: entry-points: - - 'test/native_objc_test/forward_decl_test.h' - - 'test/native_objc_test/forward_decl_test.m' + - 'forward_decl_test.h' + - 'forward_decl_test.m' preamble: | // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/is_instance_config.yaml b/pkgs/ffigen/test/native_objc_test/is_instance_config.yaml index 647ff04439..2673c0bab4 100644 --- a/pkgs/ffigen/test/native_objc_test/is_instance_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/is_instance_config.yaml @@ -1,7 +1,7 @@ name: IsInstanceTestObjCLibrary description: 'Tests isInstance' language: objc -output: 'test/native_objc_test/is_instance_bindings.dart' +output: 'is_instance_bindings.dart' exclude-all-by-default: true objc-interfaces: include: @@ -9,6 +9,6 @@ objc-interfaces: - UnrelatedClass headers: entry-points: - - 'test/native_objc_test/is_instance_test.m' + - 'is_instance_test.m' preamble: | // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/method_config.yaml b/pkgs/ffigen/test/native_objc_test/method_config.yaml index b841187ccc..969ab7cf3e 100644 --- a/pkgs/ffigen/test/native_objc_test/method_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/method_config.yaml @@ -1,13 +1,13 @@ name: MethodTestObjCLibrary description: 'Tests calling Objective-C methods' language: objc -output: 'test/native_objc_test/method_bindings.dart' +output: 'method_bindings.dart' exclude-all-by-default: true objc-interfaces: include: - MethodInterface headers: entry-points: - - 'test/native_objc_test/method_test.m' + - 'method_test.m' preamble: | // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_config.yaml b/pkgs/ffigen/test/native_objc_test/native_objc_config.yaml index 89a4943956..58bcf5016c 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/native_objc_config.yaml @@ -9,13 +9,13 @@ name: NativeObjCLibrary description: 'Native Objective C test' language: objc -output: 'test/native_objc_test/native_objc_test_bindings.dart' +output: 'native_objc_test_bindings.dart' exclude-all-by-default: true objc-interfaces: include: - Foo headers: entry-points: - - 'test/native_objc_test/native_objc_test.m' + - 'native_objc_test.m' preamble: | // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/nullable_config.yaml b/pkgs/ffigen/test/native_objc_test/nullable_config.yaml index 58de440e95..e46cf06078 100644 --- a/pkgs/ffigen/test/native_objc_test/nullable_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/nullable_config.yaml @@ -1,13 +1,13 @@ name: NullableTestObjCLibrary description: 'Tests calling Objective-C methods' language: objc -output: 'test/native_objc_test/nullable_bindings.dart' +output: 'nullable_bindings.dart' exclude-all-by-default: true objc-interfaces: include: - NullableInterface headers: entry-points: - - 'test/native_objc_test/nullable_test.m' + - 'nullable_test.m' preamble: | // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/property_config.yaml b/pkgs/ffigen/test/native_objc_test/property_config.yaml index ee3081553c..220a83a30a 100644 --- a/pkgs/ffigen/test/native_objc_test/property_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/property_config.yaml @@ -1,13 +1,13 @@ name: PropertyTestObjCLibrary description: 'Tests calling Objective-C properties i.e. getters and setters' language: objc -output: 'test/native_objc_test/property_bindings.dart' +output: 'property_bindings.dart' exclude-all-by-default: true objc-interfaces: include: - PropertyInterface headers: entry-points: - - 'test/native_objc_test/property_test.m' + - 'property_test.m' preamble: | // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/rename_config.yaml b/pkgs/ffigen/test/native_objc_test/rename_config.yaml index 1d0b98acb7..8dbae035ed 100644 --- a/pkgs/ffigen/test/native_objc_test/rename_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/rename_config.yaml @@ -9,7 +9,7 @@ name: RenameLibrary description: 'Rename test' language: objc -output: 'test/native_objc_test/rename_test_bindings.dart' +output: 'rename_test_bindings.dart' exclude-all-by-default: true objc-interfaces: include: @@ -18,6 +18,6 @@ objc-interfaces: '_(.*)': '$1' headers: entry-points: - - 'test/native_objc_test/rename_test.m' + - 'rename_test.m' preamble: | // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/string_config.yaml b/pkgs/ffigen/test/native_objc_test/string_config.yaml index 55110a39f5..016b2bd933 100644 --- a/pkgs/ffigen/test/native_objc_test/string_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/string_config.yaml @@ -1,13 +1,13 @@ name: StringTestObjCLibrary description: 'Tests calling Objective-C string methods' language: objc -output: 'test/native_objc_test/string_bindings.dart' +output: 'string_bindings.dart' exclude-all-by-default: true objc-interfaces: include: - StringUtil headers: entry-points: - - 'test/native_objc_test/string_test.m' + - 'string_test.m' preamble: | // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/swift_class_config.yaml b/pkgs/ffigen/test/native_objc_test/swift_class_config.yaml index e845ed1abb..20bd2881d5 100644 --- a/pkgs/ffigen/test/native_objc_test/swift_class_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/swift_class_config.yaml @@ -1,7 +1,7 @@ name: SwiftClassTestLibrary description: 'Tests Swift classes' language: objc -output: 'test/native_objc_test/swift_class_bindings.dart' +output: 'swift_class_bindings.dart' exclude-all-by-default: true objc-interfaces: include: @@ -10,6 +10,6 @@ objc-interfaces: 'MySwiftClass': 'swift_class_test' headers: entry-points: - - 'test/native_objc_test/swift_class_test-Swift.h' + - 'swift_class_test-Swift.h' preamble: | // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index 79cbbd6c68..b2ea7b4940 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -11,13 +11,13 @@ name: Clang description: Holds bindings to LibClang. -output: 'lib/src/header_parser/clang_bindings/clang_bindings.dart' +output: '../lib/src/header_parser/clang_bindings/clang_bindings.dart' compiler-opts: - '-Ithird_party/libclang/include' - '-Wno-nullability-completeness' headers: entry-points: - - 'third_party/libclang/include/clang-c/Index.h' + - '../third_party/libclang/include/clang-c/Index.h' include-directives: - '**wrapper.c' - '**Index.h' From 0aba098bdea1a6260415c898c8e92b3b623c1321 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Sun, 2 Oct 2022 21:44:56 +0530 Subject: [PATCH 188/276] [ffigen] Remove ignoreFilter from typedef parsing. (#462) --- pkgs/ffigen/CHANGELOG.md | 5 ++ .../src/code_generator/objc_interface.dart | 3 +- .../lib/src/header_parser/includer.dart | 4 + .../sub_parsers/typedefdecl_parser.dart | 3 +- .../type_extractor/extractor.dart | 4 +- pkgs/ffigen/lib/src/strings.dart | 3 + pkgs/ffigen/pubspec.yaml | 2 +- .../test/config_tests/include_exclude.h | 28 +++++++ .../config_tests/include_exclude_test.dart | 74 +++++++++++++++++++ .../test/native_objc_test/block_test.dart | 8 +- .../ffigen/test/native_objc_test/block_test.m | 4 +- ...class_test_.dart => swift_class_test.dart} | 0 12 files changed, 126 insertions(+), 12 deletions(-) create mode 100644 pkgs/ffigen/test/config_tests/include_exclude.h create mode 100644 pkgs/ffigen/test/config_tests/include_exclude_test.dart rename pkgs/ffigen/test/native_objc_test/{swift_class_test_.dart => swift_class_test.dart} (100%) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 28b04351de..9801108be3 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,8 @@ +# 7.0.0 + +- Fix typedef include/exclude config. +- Return `ObjCBlock` wrapper instead of raw pointer in more cases. + # 7.0.0-dev - Relative paths in ffigen config files are now assumed to be relative to the diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 68da95dab1..cda85cae81 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -5,6 +5,7 @@ import 'package:ffigen/src/code_generator.dart'; import 'package:logging/logging.dart'; +import '../strings.dart' as strings; import 'binding_string.dart'; import 'utils.dart'; import 'writer.dart'; @@ -341,7 +342,7 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { bool _isInstanceType(Type type) => type is Typealias && - type.originalName == 'instancetype' && + type.originalName == strings.objcInstanceType && _isObject(type.type); // Utils for converting between the internal types passed to native code, and diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart index 05bfa54acf..4cb1662211 100644 --- a/pkgs/ffigen/lib/src/header_parser/includer.dart +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -59,6 +59,10 @@ bool shouldIncludeMacro(String usr, String name) { } bool shouldIncludeTypealias(String usr, String name) { + // Objective C has some core typedefs that are important to keep. + if (config.language == Language.objc && name == strings.objcInstanceType) { + return true; + } return _shouldIncludeDecl( usr, name, bindingsIndex.isSeenType, config.typedefs.shouldInclude); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart index 22767ed872..988a45e39b 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart @@ -34,12 +34,11 @@ final _logger = Logger('ffigen.header_parser.typedefdecl_parser'); /// by the config. Typealias? parseTypedefDeclaration( clang_types.CXCursor cursor, { - bool ignoreFilter = false, bool pointerReference = false, }) { final typedefName = cursor.spelling(); final typedefUsr = cursor.usr(); - if (ignoreFilter || shouldIncludeTypealias(typedefUsr, typedefName)) { + if (shouldIncludeTypealias(typedefUsr, typedefName)) { final ct = clang.clang_getTypedefDeclUnderlyingType(cursor); final s = getCodeGenType(ct, pointerReference: pointerReference); diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 1590d73db8..065e789fc7 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -192,8 +192,8 @@ _CreateTypeFromCursorResult _createTypeFromCursor(clang_types.CXType cxtype, } } - final typealias = parseTypedefDeclaration(cursor, - ignoreFilter: ignoreFilter, pointerReference: pointerReference); + final typealias = + parseTypedefDeclaration(cursor, pointerReference: pointerReference); if (typealias != null) { return _CreateTypeFromCursorResult(typealias); diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 96e3c34ff7..735dc1327e 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -39,7 +39,10 @@ const langObjC = 'objc'; const clangLangObjC = ['-x', 'objective-c']; const clangObjCBoolDefine = '__OBJC_BOOL_IS_BOOL'; const clangInclude = '-include'; + +// Special objective C types. const objcBOOL = 'BOOL'; +const objcInstanceType = 'instancetype'; // Internal objective C directories that are automatically pulled in by clang, // and should be excluded from output (unless explicitly used). diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 302f458128..3ac38226d0 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 7.0.0-dev +version: 7.0.0 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen diff --git a/pkgs/ffigen/test/config_tests/include_exclude.h b/pkgs/ffigen/test/config_tests/include_exclude.h new file mode 100644 index 0000000000..b62e8f35c5 --- /dev/null +++ b/pkgs/ffigen/test/config_tests/include_exclude.h @@ -0,0 +1,28 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +typedef int Typedef; + +void func(Typedef s); + +struct Struct { + int a; +}; + +union Union { + int a; +}; + +int global; + +#define MACRO 123 + +enum Enum { + zero = 0, +}; + +enum { + unnamedEnum = 123, +}; + diff --git a/pkgs/ffigen/test/config_tests/include_exclude_test.dart b/pkgs/ffigen/test/config_tests/include_exclude_test.dart new file mode 100644 index 0000000000..5cc1156d59 --- /dev/null +++ b/pkgs/ffigen/test/config_tests/include_exclude_test.dart @@ -0,0 +1,74 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/ffigen.dart'; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; + +import '../test_utils.dart'; + +void main() { + group('include_exclude', () { + const fieldsAndNameMap = { + strings.functions: 'func', + strings.structs: 'Struct', + strings.unions: 'Union', + strings.enums: 'Enum', + strings.unnamedEnums: 'unnamedEnum', + strings.macros: 'MACRO', + strings.globals: 'global', + strings.typedefs: 'Typedef', + }; + for (final f in fieldsAndNameMap.keys) { + test('include $f', () { + final config = _makeFieldIncludeExcludeConfig( + field: f, include: fieldsAndNameMap[f]); + final library = parse(config); + expect(library.getBinding(fieldsAndNameMap[f]!), isNotNull); + }); + test('exclude $f', () { + final config = _makeFieldIncludeExcludeConfig( + field: f, exclude: fieldsAndNameMap[f]); + final library = parse(config); + expect(() => library.getBinding(fieldsAndNameMap[f]!), throwsException); + }); + } + }); +} + +Config _makeFieldIncludeExcludeConfig({ + required String field, + String? include, + String? exclude, +}) { + var templateString = ''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'include_exclude test' +${strings.output}: 'unused' +${strings.headers}: + ${strings.entryPoints}: + - 'test/config_tests/include_exclude.h' +'''; + if (include != null || exclude != null) { + templateString += ''' +$field: +'''; + if (include != null) { + templateString += ''' + ${strings.include}: + - $include +'''; + } + if (exclude != null) { + templateString += ''' + ${strings.exclude}: + - $exclude +'''; + } + } + + final config = Config.fromYaml(yaml.loadYaml(templateString) as yaml.YamlMap); + return config; +} diff --git a/pkgs/ffigen/test/native_objc_test/block_test.dart b/pkgs/ffigen/test/native_objc_test/block_test.dart index 99d1460365..92e6fe7108 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.dart +++ b/pkgs/ffigen/test/native_objc_test/block_test.dart @@ -53,7 +53,7 @@ void main() { test('Block from function pointer', () { final block = ObjCBlock.fromFunctionPointer( lib, Pointer.fromFunction(_add100, 999)); - final blockTester = BlockTester.makeFromBlock_(lib, block.pointer); + final blockTester = BlockTester.makeFromBlock_(lib, block); blockTester.pokeBlock(); expect(blockTester.call_(123), 223); expect(block(123), 223); @@ -65,7 +65,7 @@ void main() { test('Block from function', () { final block = ObjCBlock.fromFunction(lib, makeAdder(4000)); - final blockTester = BlockTester.makeFromBlock_(lib, block.pointer); + final blockTester = BlockTester.makeFromBlock_(lib, block); blockTester.pokeBlock(); expect(blockTester.call_(123), 4123); expect(block(123), 4123); @@ -74,7 +74,7 @@ void main() { Pointer funcPointerBlockRefCountTest() { final block = ObjCBlock.fromFunctionPointer( lib, Pointer.fromFunction(_add100, 999)); - expect(BlockTester.getBlockRetainCount_(lib, block.pointer), 1); + expect(BlockTester.getBlockRetainCount_(lib, block.pointer.cast()), 1); return block.pointer.cast(); } @@ -86,7 +86,7 @@ void main() { Pointer funcBlockRefCountTest() { final block = ObjCBlock.fromFunction(lib, makeAdder(4000)); - expect(BlockTester.getBlockRetainCount_(lib, block.pointer), 1); + expect(BlockTester.getBlockRetainCount_(lib, block.pointer.cast()), 1); return block.pointer.cast(); } diff --git a/pkgs/ffigen/test/native_objc_test/block_test.m b/pkgs/ffigen/test/native_objc_test/block_test.m index c0052e3d90..bdd37a79e1 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.m +++ b/pkgs/ffigen/test/native_objc_test/block_test.m @@ -13,7 +13,7 @@ @interface BlockTester : NSObject { } + (BlockTester*)makeFromBlock:(IntBlock)block; + (BlockTester*)makeFromMultiplier:(int32_t)mult; -+ (uint64_t)getBlockRetainCount:(IntBlock)block; ++ (uint64_t)getBlockRetainCount:(void*)block; - (int32_t)call:(int32_t)x; - (IntBlock)getBlock; - (void)pokeBlock; @@ -41,7 +41,7 @@ + (BlockTester*)makeFromMultiplier:(int32_t)mult { } BlockRefCountExtractor; void* valid_block_isa = NULL; -+ (uint64_t)getBlockRetainCount:(IntBlock)block { ++ (uint64_t)getBlockRetainCount:(void*)block { BlockRefCountExtractor* b = (BlockRefCountExtractor*)block; // HACK: The only way I can find to reliably figure out that a block has been // deleted is to check the isa field (the lower bits of the flags field seem diff --git a/pkgs/ffigen/test/native_objc_test/swift_class_test_.dart b/pkgs/ffigen/test/native_objc_test/swift_class_test.dart similarity index 100% rename from pkgs/ffigen/test/native_objc_test/swift_class_test_.dart rename to pkgs/ffigen/test/native_objc_test/swift_class_test.dart From 848ac94303aa8593315e94887a51537f3b61ed5f Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Thu, 6 Oct 2022 11:21:09 -0700 Subject: [PATCH 189/276] [ffigen] Remove unnecessary root cursor filtering (#471) --- pkgs/ffigen/lib/src/header_parser/includer.dart | 7 ------- pkgs/ffigen/lib/src/strings.dart | 8 -------- 2 files changed, 15 deletions(-) diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart index 4cb1662211..415f6d900e 100644 --- a/pkgs/ffigen/lib/src/header_parser/includer.dart +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -80,13 +80,6 @@ bool shouldIncludeRootCursor(String sourceFile) { return false; } - // Objective C has some extra system headers that have a non-empty sourceFile. - if (config.language == Language.objc && - strings.objCInternalDirectories - .any((path) => sourceFile.startsWith(path))) { - return false; - } - // Add header to seen if it's not. if (!bindingsIndex.isSeenHeader(sourceFile)) { bindingsIndex.addHeaderToSeen( diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 735dc1327e..755ca746c1 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -44,14 +44,6 @@ const clangInclude = '-include'; const objcBOOL = 'BOOL'; const objcInstanceType = 'instancetype'; -// Internal objective C directories that are automatically pulled in by clang, -// and should be excluded from output (unless explicitly used). -const objCInternalDirectories = [ - '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include', - '/Applications/Xcode.app/Contents/Developer', - '/usr/local/opt/llvm/lib', -]; - const headers = 'headers'; // Sub-fields of headers From 5563b5cbff9317087892468ede592a7424d919d8 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Thu, 6 Oct 2022 11:22:58 -0700 Subject: [PATCH 190/276] [ffigen] Fix some noisy warnings that often show up in ObjC binding generation (#469) --- .../clang_bindings/clang_bindings.dart | 26 +++++++++++++++++++ .../sub_parsers/compounddecl_parser.dart | 5 ++-- .../sub_parsers/enumdecl_parser.dart | 3 +++ .../sub_parsers/unnamed_enumdecl_parser.dart | 3 +++ pkgs/ffigen/tool/libclang_config.yaml | 1 + 5 files changed, 36 insertions(+), 2 deletions(-) diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 8185f345a6..5bb0d639fd 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -2522,6 +2522,32 @@ abstract class CXTypeNullabilityKind { static const int CXTypeNullability_Invalid = 3; } +/// List the possible error codes for \c clang_Type_getSizeOf, +/// \c clang_Type_getAlignOf, \c clang_Type_getOffsetOf and +/// \c clang_Cursor_getOffsetOf. +/// +/// A value of this enumeration type can be returned if the target type is not +/// a valid argument to sizeof, alignof or offsetof. +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; +} + /// Describes how the traversal of the children of a particular /// cursor should proceed after visiting a particular child cursor. /// diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart index 9e284b219c..81c97618aa 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart @@ -38,7 +38,8 @@ class _ParsedCompound { flexibleArrayMember || bitFieldMember || (dartHandleMember && config.useDartHandle) || - incompleteCompoundMember; + incompleteCompoundMember || + alignment == clang_types.CXTypeLayoutError.CXTypeLayoutError_Incomplete; // A struct without any attribute is definitely not packed. #pragma pack(...) // also adds an attribute, but it's unexposed and cannot be travesed. @@ -60,7 +61,7 @@ class _ParsedCompound { /// Returns pack value of a struct depending on config, returns null for no /// packing. int? get packValue { - if (compound.isStruct && _isPacked) { + if (compound.isStruct && _isPacked && !isIncomplete) { if (strings.packingValuesMap.containsKey(alignment)) { return alignment; } else { diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index 1353f2d8fe..b33e3e7f68 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -96,6 +96,9 @@ int _enumCursorVisitor(clang_types.CXCursor cursor, clang_types.CXCursor parent, case clang_types.CXCursorKind.CXCursor_EnumConstantDecl: _addEnumConstantToEnumClass(cursor); break; + case clang_types.CXCursorKind.CXCursor_UnexposedAttr: + // Ignore. + break; default: _logger.fine('invalid enum constant'); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart index 879dfea8de..320e0848d9 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/unnamed_enumdecl_parser.dart @@ -47,6 +47,9 @@ int _unnamedenumCursorVisitor(clang_types.CXCursor cursor, _addUnNamedEnumConstant(cursor); } break; + case clang_types.CXCursorKind.CXCursor_UnexposedAttr: + // Ignore. + break; default: _logger.severe('Invalid enum constant.'); } diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index b2ea7b4940..339c52c09f 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -41,6 +41,7 @@ enums: - CXEvalResultKind - CXObjCPropertyAttrKind - CXTypeNullabilityKind + - CXTypeLayoutError structs: include: From 0fb321c5f5c849c0af3ce7031b3e460f0ee8b89f Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Thu, 13 Oct 2022 02:31:57 +0530 Subject: [PATCH 191/276] [ffigen] Add a step for building cursor definition map. (#474) --- pkgs/ffigen/CHANGELOG.md | 3 ++ pkgs/ffigen/lib/src/header_parser/data.dart | 5 ++ pkgs/ffigen/lib/src/header_parser/parser.dart | 20 +++++++- .../sub_parsers/compounddecl_parser.dart | 5 +- .../sub_parsers/enumdecl_parser.dart | 4 +- .../translation_unit_parser.dart | 32 ++++++++++++ pkgs/ffigen/lib/src/header_parser/utils.dart | 47 +++++++++++++++-- pkgs/ffigen/pubspec.yaml | 2 +- .../header_parser_tests/separate_definition.h | 11 ++++ .../separate_definition_base.h | 8 +++ .../separate_definition_test.dart | 50 +++++++++++++++++++ 11 files changed, 173 insertions(+), 14 deletions(-) create mode 100644 pkgs/ffigen/test/header_parser_tests/separate_definition.h create mode 100644 pkgs/ffigen/test/header_parser_tests/separate_definition_base.h create mode 100644 pkgs/ffigen/test/header_parser_tests/separate_definition_test.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 9801108be3..9980c10e83 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,6 @@ +# 7.1.0 +- Handle declarations with definition accessible from a different entry-point. + # 7.0.0 - Fix typedef include/exclude config. diff --git a/pkgs/ffigen/lib/src/header_parser/data.dart b/pkgs/ffigen/lib/src/header_parser/data.dart index 1381fd3c3b..5bd4e903a8 100644 --- a/pkgs/ffigen/lib/src/header_parser/data.dart +++ b/pkgs/ffigen/lib/src/header_parser/data.dart @@ -21,6 +21,10 @@ late Config _config; Clang get clang => _clang; late Clang _clang; +// Cursor index. +CursorIndex get cursorIndex => _cursorIndex; +CursorIndex _cursorIndex = CursorIndex(); + // Tracks seen status for bindings BindingsIndex get bindingsIndex => _bindingsIndex; BindingsIndex _bindingsIndex = BindingsIndex(); @@ -47,6 +51,7 @@ void initializeGlobals({required Config config}) { _incrementalNamer = IncrementalNamer(); _savedMacros = {}; _unnamedEnumConstants = []; + _cursorIndex = CursorIndex(); _bindingsIndex = BindingsIndex(); _objCBuiltInFunctions = ObjCBuiltInFunctions(); } diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index 837d158711..080d2f83c2 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -82,6 +82,9 @@ List parseToBindings() { // Log all headers for user. _logger.info('Input Headers: ${config.headers.entryPoints}'); + final tuList = >[]; + + // Parse all translation units from entry points. for (final headerLocation in config.headers.entryPoints) { _logger.fine('Creating TranslationUnit for header: $headerLocation'); @@ -105,11 +108,24 @@ List parseToBindings() { } logTuDiagnostics(tu, _logger, headerLocation); - final rootCursor = clang.clang_getTranslationUnitCursor(tu); + tuList.add(tu); + } + + final tuCursors = + tuList.map((tu) => clang.clang_getTranslationUnitCursor(tu)); + // Build usr to CXCusror map from translation units. + for (final rootCursor in tuCursors) { + buildUsrCursorDefinitionMap(rootCursor); + } + + // Parse definitions from translation units. + for (final rootCursor in tuCursors) { bindings.addAll(parseTranslationUnit(rootCursor)); + } - // Cleanup. + // Dispose translation units. + for (final tu in tuList) { clang.clang_disposeTranslationUnit(tu); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart index 81c97618aa..6d9824790d 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart @@ -106,9 +106,7 @@ Compound? parseCompoundDeclaration( } // Parse the cursor definition instead, if this is a forward declaration. - if (isForwardDeclaration(cursor)) { - cursor = clang.clang_getCursorDefinition(cursor); - } + cursor = cursorIndex.getDefinition(cursor); final declUsr = cursor.usr(); final String declName; @@ -163,6 +161,7 @@ void fillCompoundMembersIfNeeded( /// generate these as opaque if `dependency-only` was set to opaque). bool pointerReference = false, }) { + cursor = cursorIndex.getDefinition(cursor); final compoundType = compound.compoundType; // Skip dependencies if already seen OR user has specified `dependency-only` diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index b33e3e7f68..76cccd2ab6 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -40,9 +40,7 @@ EnumClass? parseEnumDeclaration( _stack.push(_ParsedEnum()); // Parse the cursor definition instead, if this is a forward declaration. - if (isForwardDeclaration(cursor)) { - cursor = clang.clang_getCursorDefinition(cursor); - } + cursor = cursorIndex.getDefinition(cursor); final enumUsr = cursor.usr(); final String enumName; diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart index b34b1b163b..ea9d5945fd 100644 --- a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -27,6 +27,12 @@ Pointer< clang_types.CXCursor, clang_types.CXCursor, Pointer)>>? _rootCursorVisitorPtr; +Pointer< + NativeFunction< + Int32 Function( + clang_types.CXCursor, clang_types.CXCursor, Pointer)>>? + _cursorDefinitionVisitorPtr; + /// Parses the translation unit and returns the generated bindings. Set parseTranslationUnit(clang_types.CXCursor translationUnitCursor) { _bindings = {}; @@ -94,3 +100,29 @@ BindingType? _getCodeGenTypeFromCursor(clang_types.CXCursor cursor) { final t = getCodeGenType(cursor.type(), ignoreFilter: false); return t is BindingType ? t : null; } + +/// Visits all cursors and builds a map of usr and [CXCursor]. +void buildUsrCursorDefinitionMap(clang_types.CXCursor translationUnitCursor) { + _bindings = {}; + final resultCode = clang.clang_visitChildren( + translationUnitCursor, + _cursorDefinitionVisitorPtr ??= Pointer.fromFunction( + _definitionCursorVisitor, exceptional_visitor_return), + nullptr, + ); + + visitChildrenResultChecker(resultCode); +} + +/// Child visitor invoked on translationUnitCursor [CXCursorKind.CXCursor_TranslationUnit]. +int _definitionCursorVisitor(clang_types.CXCursor cursor, + clang_types.CXCursor parent, Pointer clientData) { + try { + cursorIndex.saveDefinition(cursor); + } catch (e, s) { + _logger.severe(e); + _logger.severe(s); + rethrow; + } + return clang_types.CXChildVisitResult.CXChildVisit_Continue; +} diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index 5f9bd33ea5..614d5e5a79 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -13,6 +13,8 @@ import 'clang_bindings/clang_bindings.dart' as clang_types; import 'data.dart'; import 'type_extractor/extractor.dart'; +final _logger = Logger('ffigen.header_parser.utils'); + const exceptional_visitor_return = clang_types.CXChildVisitResult.CXChildVisit_Break; @@ -242,11 +244,6 @@ String? removeRawCommentMarkups(String? string) { return sb.toString().trim(); } -bool isForwardDeclaration(clang_types.CXCursor cursor) { - return clang.clang_Cursor_isNull(clang.clang_getCursorDefinition(cursor)) == - 0; -} - extension CXTypeExt on clang_types.CXType { /// Get code_gen [Type] representation of [clang_types.CXType]. Type toCodeGenType() { @@ -399,3 +396,43 @@ class BindingsIndex { void addObjCBlockToSeen(String key, ObjCBlock t) => _objcBlocks[key] = t; ObjCBlock? getSeenObjCBlock(String key) => _objcBlocks[key]; } + +class CursorIndex { + final _usrCursorDefinition = {}; + + /// Returns the Cursor definition (if found) or itself. + clang_types.CXCursor getDefinition(clang_types.CXCursor cursor) { + final cursorDefinition = clang.clang_getCursorDefinition(cursor); + if (clang.clang_Cursor_isNull(cursorDefinition) == 0) { + return cursorDefinition; + } else { + final usr = cursor.usr(); + if (_usrCursorDefinition.containsKey(usr)) { + return _usrCursorDefinition[cursor.usr()]!; + } else { + _logger.warning( + "No definition found for declaration - ${cursor.completeStringRepr()}"); + return cursor; + } + } + } + + /// Saves cursor definition based on its kind. + void saveDefinition(clang_types.CXCursor cursor) { + switch (cursor.kind) { + case clang_types.CXCursorKind.CXCursor_StructDecl: + case clang_types.CXCursorKind.CXCursor_UnionDecl: + case clang_types.CXCursorKind.CXCursor_EnumDecl: + final usr = cursor.usr(); + if (!_usrCursorDefinition.containsKey(usr)) { + final cursorDefinition = clang.clang_getCursorDefinition(cursor); + if (clang.clang_Cursor_isNull(cursorDefinition) == 0) { + _usrCursorDefinition[usr] = cursorDefinition; + } else { + _logger.finest( + "Missing cursor definition in current translation unit: ${cursor.completeStringRepr()}"); + } + } + } + } +} diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 3ac38226d0..c13dfb51f5 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 7.0.0 +version: 7.1.0 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen diff --git a/pkgs/ffigen/test/header_parser_tests/separate_definition.h b/pkgs/ffigen/test/header_parser_tests/separate_definition.h new file mode 100644 index 0000000000..4c8584b92d --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/separate_definition.h @@ -0,0 +1,11 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Forward declaration to SeparatelyDefinedStruct, with definition in +// separate_definition_base.h +struct SeparatelyDefinedStruct; + +void func(struct SeparatelyDefinedStruct s); + +void func2(struct SeparatelyDefinedStruct *s); diff --git a/pkgs/ffigen/test/header_parser_tests/separate_definition_base.h b/pkgs/ffigen/test/header_parser_tests/separate_definition_base.h new file mode 100644 index 0000000000..2342bdf321 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/separate_definition_base.h @@ -0,0 +1,8 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +struct SeparatelyDefinedStruct{ + int a; + int b; +}; diff --git a/pkgs/ffigen/test/header_parser_tests/separate_definition_test.dart b/pkgs/ffigen/test/header_parser_tests/separate_definition_test.dart new file mode 100644 index 0000000000..6b62adee1e --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/separate_definition_test.dart @@ -0,0 +1,50 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; + +import '../test_utils.dart'; + +late Library actual, expected; + +void main() { + group('separate_definition', () { + setUpAll(() { + logWarnings(Level.SEVERE); + }); + test('different header order', () { + final entryPoints = [ + "test/header_parser_tests/separate_definition_base.h", + "test/header_parser_tests/separate_definition.h" + ]; + final library1String = parser.parse(_makeConfig(entryPoints)).generate(); + final library2String = + parser.parse(_makeConfig(entryPoints.reversed.toList())).generate(); + + expect(library1String, library2String); + }); + }); +} + +Config _makeConfig(List entryPoints) { + final entryPointBuilder = StringBuffer(); + for (final ep in entryPoints) { + entryPointBuilder.writeln(" - $ep"); + } + final config = Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'Bindings' +${strings.output}: 'unused' + +${strings.headers}: + ${strings.entryPoints}: +${entryPointBuilder.toString()} +''') as yaml.YamlMap); + return config; +} From 637134b2806452260ebcf40cbc505e4af81ef6f7 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Fri, 14 Oct 2022 16:17:34 -0700 Subject: [PATCH 192/276] [ffigen] Zero initialize unused Block fields (#475) * Zero init unused Block fields * fmt * Fix bug --- .../code_generator/objc_built_in_functions.dart | 6 ++++++ .../ffigen/test/native_objc_test/block_test.dart | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index 270cd1839f..d796763e35 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -156,7 +156,11 @@ $objType $name(String name) { $descPtr $name() { final d = ${w.ffiPkgLibraryPrefix}.calloc.allocate<$descType>( ${w.ffiLibraryPrefix}.sizeOf<$descType>()); + d.ref.reserved = 0; d.ref.size = ${w.ffiLibraryPrefix}.sizeOf<$blockType>(); + d.ref.copy_helper = ${w.ffiLibraryPrefix}.nullptr; + d.ref.dispose_helper = ${w.ffiLibraryPrefix}.nullptr; + d.ref.signature = ${w.ffiLibraryPrefix}.nullptr; return d; } '''; @@ -181,6 +185,8 @@ $blockPtr $name($voidPtr invoke, $voidPtr target) { final b = ${w.ffiPkgLibraryPrefix}.calloc.allocate<$blockType>( ${w.ffiLibraryPrefix}.sizeOf<$blockType>()); b.ref.isa = ${concreteGlobalBlock.name}; + b.ref.flags = 0; + b.ref.reserved = 0; b.ref.invoke = invoke; b.ref.target = target; b.ref.descriptor = ${blockDescSingleton.name}; diff --git a/pkgs/ffigen/test/native_objc_test/block_test.dart b/pkgs/ffigen/test/native_objc_test/block_test.dart index 92e6fe7108..76f7a93684 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.dart +++ b/pkgs/ffigen/test/native_objc_test/block_test.dart @@ -95,6 +95,22 @@ void main() { doGC(); expect(BlockTester.getBlockRetainCount_(lib, rawBlock.cast()), 0); }); + + test('Block fields have sensible values', () { + final block = ObjCBlock.fromFunction(lib, makeAdder(4000)); + final blockPtr = block.pointer; + expect(blockPtr.ref.isa, isNot(0)); + expect(blockPtr.ref.flags, isNot(0)); // Set by Block_copy. + expect(blockPtr.ref.reserved, 0); + expect(blockPtr.ref.invoke, isNot(0)); + expect(blockPtr.ref.target, isNot(0)); + final descPtr = blockPtr.ref.descriptor; + expect(descPtr.ref.reserved, 0); + expect(descPtr.ref.size, isNot(0)); + expect(descPtr.ref.copy_helper, nullptr); + expect(descPtr.ref.dispose_helper, nullptr); + expect(descPtr.ref.signature, nullptr); + }); }); } From e50394b823773add84d3619273d5dbca368bb6e1 Mon Sep 17 00:00:00 2001 From: Tzvi Melamed Date: Wed, 19 Oct 2022 16:35:12 -0400 Subject: [PATCH 193/276] [ffigen] Use tmpDir over working directory (#464) --- pkgs/ffigen/README.md | 6 ++++++ .../header_parser/sub_parsers/macro_parser.dart | 15 +++++++++++---- pkgs/ffigen/lib/src/strings.dart | 13 +++++++++++++ .../code_generator_tests/code_generator_test.dart | 6 +----- .../decl_symbol_address_collision_test.dart | 7 ++----- .../decl_type_name_collision_test.dart | 7 ++----- .../test/example_tests/cjson_example_test.dart | 2 +- .../example_tests/ffinative_example_test.dart | 2 +- .../test/example_tests/libclang_example_test.dart | 2 +- .../test/example_tests/simple_example_test.dart | 2 +- .../header_parser_tests/comment_markup_test.dart | 7 ++----- .../header_parser_tests/dart_handle_test.dart | 7 ++----- .../header_parser_tests/forward_decl_test.dart | 7 ++----- .../test/header_parser_tests/functions_test.dart | 7 ++----- .../header_parser_tests/imported_types_test.dart | 7 ++----- .../native_func_typedef_test.dart | 7 ++----- .../opaque_dependencies_test.dart | 7 ++----- .../header_parser_tests/packed_structs_test.dart | 7 ++----- .../header_parser_tests/regress_384_test.dart | 7 ++----- .../test/header_parser_tests/typedef_test.dart | 7 ++----- .../test/header_parser_tests/unions_test.dart | 7 ++----- .../test/large_integration_tests/large_test.dart | 6 +++--- pkgs/ffigen/test/test_utils.dart | 5 +++-- 23 files changed, 67 insertions(+), 83 deletions(-) diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 96a88d03ab..c72249b294 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -733,6 +733,12 @@ The following typedefs are not generated - - They refer to a struct/union having the same name as itself. - They refer to a boolean, enum, inline array, Handle or any unsupported type. +### How are macros handled? + +`ffigen` uses `clang`'s own compiler frontend to parse and traverse the `C` header files. `ffigen` expands the macros using `clang`'s macro expansion and then traverses the expanded code. To do this, `ffigen` generates temporary files in a system tmp directory. + +A custom temporary directory can be specified by setting the `TEST_TMPDIR` environment variable. + ### What are these logs generated by ffigen and how to fix them? Ffigen can sometimes generate a lot of logs, especially when it's parsing a lot of code. diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart index cb5fbdb45b..7478ea825d 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart @@ -66,7 +66,13 @@ List? parseSavedMacros() { final index = clang.clang_createIndex(0, 0); Pointer> clangCmdArgs = nullptr; var cmdLen = 0; - clangCmdArgs = createDynamicStringArray(config.compilerOpts); + + final compilerOpts = config.compilerOpts; + config.headers.entryPoints.followedBy([file.path]).forEach((entryFile) { + compilerOpts.add("-imacros$entryFile"); + }); + clangCmdArgs = createDynamicStringArray(compilerOpts); + cmdLen = config.compilerOpts.length; final tu = clang.clang_parseTranslationUnit( index, @@ -179,7 +185,7 @@ late Set _macroVarNames; /// Creates a temporary file for parsing macros in current directory. File createFileForMacros() { - final fileNameBase = 'temp_for_macros'; + final fileNameBase = p.join(strings.tmpDir, 'temp_for_macros'); final fileExt = 'hpp'; // Find a filename which doesn't already exist. @@ -187,12 +193,13 @@ File createFileForMacros() { var i = 0; while (file.existsSync()) { i++; - file = File('${fileNameBase.split('.')[0]}_$i.$fileExt'); + file = File('${fileNameBase}_$i.$fileExt'); } // Create file. file.createSync(); - // Save generted name. + + // Save generated name. _generatedFileBaseName = p.basename(file.path); // Write file contents. diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 755ca746c1..99d10c2031 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -230,3 +230,16 @@ const dartHandleUsr = 'c:@S@_Dart_Handle'; const ffiNative = 'ffi-native'; const ffiNativeAsset = 'asset'; + +Directory? _tmpDir; + +/// A path to a unique temporary directory that should be used for files meant +/// to be discarded after the current execution is finished. +String get tmpDir { + if (Platform.environment.containsKey('TEST_TMPDIR')) { + return Platform.environment['TEST_TMPDIR']!; + } + + _tmpDir ??= Directory.systemTemp.createTempSync(); + return _tmpDir!.path; +} diff --git a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart index 046ee8fa19..35fa0a9207 100644 --- a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart @@ -459,11 +459,7 @@ void main() { /// Utility to match expected bindings to the generated bindings. void _matchLib(Library lib, String testName) { - matchLibraryWithExpected(lib, [ - 'test', - 'debug_generated', - 'code_generator_test_${testName}_output.dart' - ], [ + matchLibraryWithExpected(lib, 'code_generator_test_${testName}_output.dart', [ 'test', 'code_generator_tests', 'expected_bindings', diff --git a/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart b/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart index 1d2744b135..0280732ba9 100644 --- a/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart @@ -35,11 +35,8 @@ void main() { ); }); test('declaration and symbol address conflict', () { - matchLibraryWithExpected(actual, [ - 'test', - 'debug_generated', - 'collision_test_decl_symbol_address_collision_output.dart' - ], [ + matchLibraryWithExpected( + actual, 'collision_test_decl_symbol_address_collision_output.dart', [ 'test', 'collision_tests', 'expected_bindings', diff --git a/pkgs/ffigen/test/collision_tests/decl_type_name_collision_test.dart b/pkgs/ffigen/test/collision_tests/decl_type_name_collision_test.dart index 5bb8f8229e..40d9f88d28 100644 --- a/pkgs/ffigen/test/collision_tests/decl_type_name_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/decl_type_name_collision_test.dart @@ -32,11 +32,8 @@ ${strings.preamble}: | }); test('Expected bindings', () { - matchLibraryWithExpected(actual, [ - 'test', - 'debug_generated', - 'decl_type_name_collision_test_output.dart' - ], [ + matchLibraryWithExpected( + actual, 'decl_type_name_collision_test_output.dart', [ 'test', 'collision_tests', 'expected_bindings', diff --git a/pkgs/ffigen/test/example_tests/cjson_example_test.dart b/pkgs/ffigen/test/example_tests/cjson_example_test.dart index 15d0c5406d..44246155fc 100644 --- a/pkgs/ffigen/test/example_tests/cjson_example_test.dart +++ b/pkgs/ffigen/test/example_tests/cjson_example_test.dart @@ -54,7 +54,7 @@ ${strings.preamble}: | matchLibraryWithExpected( library, - ['test', 'debug_generated', 'example_c_json.dart'], + 'example_c_json.dart', ['example', 'c_json', config.output], ); }); diff --git a/pkgs/ffigen/test/example_tests/ffinative_example_test.dart b/pkgs/ffigen/test/example_tests/ffinative_example_test.dart index 67962a003d..6895a8e989 100644 --- a/pkgs/ffigen/test/example_tests/ffinative_example_test.dart +++ b/pkgs/ffigen/test/example_tests/ffinative_example_test.dart @@ -31,7 +31,7 @@ ${strings.headers}: matchLibraryWithExpected( library, - ['test', 'debug_generated', 'example_ffinative.dart'], + 'example_ffinative.dart', ['example', 'ffinative', config.output], ); }); diff --git a/pkgs/ffigen/test/example_tests/libclang_example_test.dart b/pkgs/ffigen/test/example_tests/libclang_example_test.dart index d0218c77ee..c226c4cfe6 100644 --- a/pkgs/ffigen/test/example_tests/libclang_example_test.dart +++ b/pkgs/ffigen/test/example_tests/libclang_example_test.dart @@ -74,7 +74,7 @@ ${strings.preamble}: | matchLibraryWithExpected( library, - ['test', 'debug_generated', 'example_libclang.dart'], + 'example_libclang.dart', ['example', 'libclang-example', config.output], ); }); diff --git a/pkgs/ffigen/test/example_tests/simple_example_test.dart b/pkgs/ffigen/test/example_tests/simple_example_test.dart index 190e65e7d7..b79b576f03 100644 --- a/pkgs/ffigen/test/example_tests/simple_example_test.dart +++ b/pkgs/ffigen/test/example_tests/simple_example_test.dart @@ -30,7 +30,7 @@ ${strings.headers}: matchLibraryWithExpected( library, - ['test', 'debug_generated', 'example_simple.dart'], + 'example_simple.dart', ['example', 'simple', config.output], ); }); diff --git a/pkgs/ffigen/test/header_parser_tests/comment_markup_test.dart b/pkgs/ffigen/test/header_parser_tests/comment_markup_test.dart index 3fadaea6b5..b7e5cfa610 100644 --- a/pkgs/ffigen/test/header_parser_tests/comment_markup_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/comment_markup_test.dart @@ -33,11 +33,8 @@ ${strings.comments}: }); test('Expected bindings', () { - matchLibraryWithExpected(actual, [ - 'test', - 'debug_generated', - 'header_parser_comment_markup_test_output.dart' - ], [ + matchLibraryWithExpected( + actual, 'header_parser_comment_markup_test_output.dart', [ 'test', 'header_parser_tests', 'expected_bindings', diff --git a/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart b/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart index 9089302644..dec4deca04 100644 --- a/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart @@ -35,11 +35,8 @@ ${strings.headers}: ); }); test('Expected Bindings', () { - matchLibraryWithExpected(actual, [ - 'test', - 'debug_generated', - 'header_parser_dart_handle_test_output.dart' - ], [ + matchLibraryWithExpected( + actual, 'header_parser_dart_handle_test_output.dart', [ 'test', 'header_parser_tests', 'expected_bindings', diff --git a/pkgs/ffigen/test/header_parser_tests/forward_decl_test.dart b/pkgs/ffigen/test/header_parser_tests/forward_decl_test.dart index ca16de4ffc..f8f5894e24 100644 --- a/pkgs/ffigen/test/header_parser_tests/forward_decl_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/forward_decl_test.dart @@ -30,11 +30,8 @@ ${strings.headers}: }); test('Expected bindings', () { - matchLibraryWithExpected(actual, [ - 'test', - 'debug_generated', - 'header_parser_forward_decl_test_output.dart' - ], [ + matchLibraryWithExpected( + actual, 'header_parser_forward_decl_test_output.dart', [ 'test', 'header_parser_tests', 'expected_bindings', diff --git a/pkgs/ffigen/test/header_parser_tests/functions_test.dart b/pkgs/ffigen/test/header_parser_tests/functions_test.dart index 7b075628e3..b2718aa1a2 100644 --- a/pkgs/ffigen/test/header_parser_tests/functions_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/functions_test.dart @@ -44,11 +44,8 @@ ${strings.preamble}: | ); }); test('Expected Bindings', () { - matchLibraryWithExpected(actual, [ - 'test', - 'debug_generated', - 'header_parser_functions_test_output.dart' - ], [ + matchLibraryWithExpected( + actual, 'header_parser_functions_test_output.dart', [ 'test', 'header_parser_tests', 'expected_bindings', diff --git a/pkgs/ffigen/test/header_parser_tests/imported_types_test.dart b/pkgs/ffigen/test/header_parser_tests/imported_types_test.dart index a018af2833..2d26c1f042 100644 --- a/pkgs/ffigen/test/header_parser_tests/imported_types_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/imported_types_test.dart @@ -35,11 +35,8 @@ ${strings.preamble}: | ); }); test('Expected Bindings', () { - matchLibraryWithExpected(actual, [ - 'test', - 'debug_generated', - 'header_parser_imported_types_test_output.dart' - ], [ + matchLibraryWithExpected( + actual, 'header_parser_imported_types_test_output.dart', [ 'test', 'header_parser_tests', 'expected_bindings', diff --git a/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart index 4f9187c5b8..e576080b9a 100644 --- a/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart @@ -35,11 +35,8 @@ ${strings.headers}: }); test('Expected bindings', () { - matchLibraryWithExpected(actual, [ - 'test', - 'debug_generated', - 'header_parser_native_func_typedef_test_output.dart' - ], [ + matchLibraryWithExpected( + actual, 'header_parser_native_func_typedef_test_output.dart', [ 'test', 'header_parser_tests', 'expected_bindings', diff --git a/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart b/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart index 782f761fbf..c2572d571d 100644 --- a/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart @@ -37,11 +37,8 @@ ${strings.unions}: ); }); test('Expected bindings', () { - matchLibraryWithExpected(actual, [ - 'test', - 'debug_generated', - 'header_parser_opaque_dependencies_test_output.dart' - ], [ + matchLibraryWithExpected( + actual, 'header_parser_opaque_dependencies_test_output.dart', [ 'test', 'header_parser_tests', 'expected_bindings', diff --git a/pkgs/ffigen/test/header_parser_tests/packed_structs_test.dart b/pkgs/ffigen/test/header_parser_tests/packed_structs_test.dart index 357412e42b..bbd1ea7f3f 100644 --- a/pkgs/ffigen/test/header_parser_tests/packed_structs_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/packed_structs_test.dart @@ -30,11 +30,8 @@ ${strings.headers}: }); test('Expected bindings', () { - matchLibraryWithExpected(actual, [ - 'test', - 'debug_generated', - 'header_parser_packed_structs_test_output.dart' - ], [ + matchLibraryWithExpected( + actual, 'header_parser_packed_structs_test_output.dart', [ 'test', 'header_parser_tests', 'expected_bindings', diff --git a/pkgs/ffigen/test/header_parser_tests/regress_384_test.dart b/pkgs/ffigen/test/header_parser_tests/regress_384_test.dart index 950d985a0e..054474c7be 100644 --- a/pkgs/ffigen/test/header_parser_tests/regress_384_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/regress_384_test.dart @@ -31,11 +31,8 @@ ${strings.headers}: }); test('Expected bindings', () { - matchLibraryWithExpected(actual, [ - 'test', - 'debug_generated', - 'header_parser_regress_384_test_output.dart' - ], [ + matchLibraryWithExpected( + actual, 'header_parser_regress_384_test_output.dart', [ 'test', 'header_parser_tests', 'expected_bindings', diff --git a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart index abac0e09b1..0c75f308c7 100644 --- a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart @@ -45,11 +45,8 @@ ${strings.preamble}: | }); test('Expected Bindings', () { - matchLibraryWithExpected(actual, [ - 'test', - 'debug_generated', - 'header_parser_typedef_test_output.dart' - ], [ + matchLibraryWithExpected( + actual, 'header_parser_typedef_test_output.dart', [ 'test', 'header_parser_tests', 'expected_bindings', diff --git a/pkgs/ffigen/test/header_parser_tests/unions_test.dart b/pkgs/ffigen/test/header_parser_tests/unions_test.dart index ce2b0ea618..8e8949ea7c 100644 --- a/pkgs/ffigen/test/header_parser_tests/unions_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/unions_test.dart @@ -30,11 +30,8 @@ ${strings.headers}: }); test('Expected bindings', () { - matchLibraryWithExpected(actual, [ - 'test', - 'debug_generated', - 'header_parser_unions_test_output.dart' - ], [ + matchLibraryWithExpected( + actual, 'header_parser_unions_test_output.dart', [ 'test', 'header_parser_tests', 'expected_bindings', diff --git a/pkgs/ffigen/test/large_integration_tests/large_test.dart b/pkgs/ffigen/test/large_integration_tests/large_test.dart index d789b816a0..77fe1ec333 100644 --- a/pkgs/ffigen/test/large_integration_tests/large_test.dart +++ b/pkgs/ffigen/test/large_integration_tests/large_test.dart @@ -50,7 +50,7 @@ ${strings.preamble}: | matchLibraryWithExpected( library, - ['test', 'debug_generated', 'large_test_libclang.dart'], + 'large_test_libclang.dart', ['test', 'large_integration_tests', '_expected_libclang_bindings.dart'], // Remove comments containing @ to hack around a mismatch in the // documentation generated by different clang versions. @@ -78,7 +78,7 @@ ${strings.preamble}: | matchLibraryWithExpected( library, - ['test', 'debug_generated', 'large_test_cjson.dart'], + 'large_test_cjson.dart', ['test', 'large_integration_tests', '_expected_cjson_bindings.dart'], ); }); @@ -110,7 +110,7 @@ ${strings.preamble}: | matchLibraryWithExpected( library, - ['test', 'debug_generated', 'large_test_sqlite.dart'], + 'large_test_sqlite.dart', ['test', 'large_integration_tests', '_expected_sqlite_bindings.dart'], ); }); diff --git a/pkgs/ffigen/test/test_utils.dart b/pkgs/ffigen/test/test_utils.dart index bc12c6408f..8aa8b44639 100644 --- a/pkgs/ffigen/test/test_utils.dart +++ b/pkgs/ffigen/test/test_utils.dart @@ -5,6 +5,7 @@ import 'dart:io'; import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:path/path.dart' as path; import 'package:test/test.dart'; @@ -52,10 +53,10 @@ String _normalizeGeneratedCode( /// /// This will not delete the actual debug file incase [expect] throws an error. void matchLibraryWithExpected( - Library library, List pathForActual, List pathToExpected, + Library library, String pathForActual, List pathToExpected, {String Function(String)? codeNormalizer}) { final file = File( - path.joinAll(pathForActual), + path.join(strings.tmpDir, pathForActual), ); library.generateFile(file); From 07d8c725f55547c79a0a8246712fd5c1bfa6aaed Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 24 Oct 2022 16:07:35 +0530 Subject: [PATCH 194/276] [ffigen] Symbol file import export (#468) --- .../ffigen/.github/workflows/test-package.yml | 2 +- pkgs/ffigen/CHANGELOG.md | 4 + pkgs/ffigen/README.md | 49 +++++ .../ffigen/example/shared_bindings/.gitignore | 11 ++ pkgs/ffigen/example/shared_bindings/README.md | 10 + .../shared_bindings/ffigen_configs/a.yaml | 12 ++ .../ffigen_configs/a_shared_base.yaml | 16 ++ .../shared_bindings/ffigen_configs/base.yaml | 17 ++ .../example/shared_bindings/generate.dart | 32 +++ .../example/shared_bindings/headers/a.h | 21 ++ .../example/shared_bindings/headers/base.h | 31 +++ .../shared_bindings/lib/generated/a_gen.dart | 112 +++++++++++ .../lib/generated/a_shared_b_gen.dart | 70 +++++++ .../lib/generated/base_gen.dart | 69 +++++++ .../lib/generated/base_symbols.yaml | 22 +++ .../example/shared_bindings/pubspec.yaml | 15 ++ pkgs/ffigen/lib/src/code_generator/func.dart | 2 + .../lib/src/code_generator/library.dart | 14 ++ .../lib/src/code_generator/typealias.dart | 2 + .../ffigen/lib/src/code_generator/writer.dart | 57 ++++++ .../lib/src/config_provider/config.dart | 45 ++++- .../lib/src/config_provider/config_types.dart | 14 ++ .../lib/src/config_provider/spec_utils.dart | 183 +++++++++++++++++- pkgs/ffigen/lib/src/executables/ffigen.dart | 28 ++- .../lib/src/header_parser/includer.dart | 2 + .../type_extractor/extractor.dart | 10 +- pkgs/ffigen/lib/src/strings.dart | 27 +++ pkgs/ffigen/pubspec.yaml | 4 +- .../shared_bindings_example_test.dart | 67 +++++++ .../example_tests/swift_example_test.dart | 4 +- pkgs/ffigen/test/test_utils.dart | 41 +++- 31 files changed, 964 insertions(+), 29 deletions(-) create mode 100644 pkgs/ffigen/example/shared_bindings/.gitignore create mode 100644 pkgs/ffigen/example/shared_bindings/README.md create mode 100644 pkgs/ffigen/example/shared_bindings/ffigen_configs/a.yaml create mode 100644 pkgs/ffigen/example/shared_bindings/ffigen_configs/a_shared_base.yaml create mode 100644 pkgs/ffigen/example/shared_bindings/ffigen_configs/base.yaml create mode 100644 pkgs/ffigen/example/shared_bindings/generate.dart create mode 100644 pkgs/ffigen/example/shared_bindings/headers/a.h create mode 100644 pkgs/ffigen/example/shared_bindings/headers/base.h create mode 100644 pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart create mode 100644 pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart create mode 100644 pkgs/ffigen/example/shared_bindings/lib/generated/base_gen.dart create mode 100644 pkgs/ffigen/example/shared_bindings/lib/generated/base_symbols.yaml create mode 100644 pkgs/ffigen/example/shared_bindings/pubspec.yaml create mode 100644 pkgs/ffigen/test/example_tests/shared_bindings_example_test.dart diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index fdc7a01331..f6deae35fd 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -27,7 +27,7 @@ jobs: sdk: ${{ matrix.sdk }} - id: install name: Install dependencies - run: dart pub get + run: dart pub get && dart pub get --directory="example/shared_bindings" - name: Check formatting run: dart format --output=none --set-exit-if-changed . if: always() && steps.install.outcome == 'success' diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 9980c10e83..1a577daca0 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 7.2.0 +- Added support for sharing bindings using `symbol-file` config. (See `README.md` +and examples/shared_bindings). + # 7.1.0 - Handle declarations with definition accessible from a different entry-point. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index c72249b294..76e944f65c 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -91,6 +91,12 @@ The following configuration options are available- ```yaml output: 'generated_bindings.dart' +``` +or +```yaml +output: + bindings: 'generated_bindings.dart' + ... ``` @@ -521,6 +527,36 @@ language: 'objc' ``` + + output -> symbol-file + Generates a symbol file yaml containing all types defined in the generated output. + + +```yaml +output: + ... + symbol-file: + # Although file paths are supported here, prefer Package Uri's here + # so that other pacakges can use them. + output: 'package:some_pkg/symbols.yaml' + import-path: 'package:some_pkg/base.dart' +``` + + + + import -> symbol-files + Import symbols from a symbol file. Used for sharing type definitions from other pacakges. + + +```yaml +import: + symbol-files: + # Both package Uri and file paths are supported here. + - 'package:some_pkg/symbols.yaml' + - 'path/to/some/symbol_file.yaml' +``` + + @@ -757,3 +793,16 @@ Ffigen can sometimes generate a lot of logs, especially when it's parsing a lot Level options are - `[all, fine, info (default), warning, severe]`. The `all` and `fine` will print a ton of logs are meant for debugging purposes only. + +### How can type definitions be shared? + +Ffigen can share type definitions using symbol files. +- A package can generate a symbol file using the `output -> symbol-file` config. +- And another package can then import this, using `import -> symbol-files` config. +- Doing so will reuse all the types such as Struct/Unions, and will automatically + exclude generating other types (E.g functions, enums, macros). + +Checkout `examples/shared_bindings` for details. + +For manually reusing definitions from another package, the `library-imports` +and `type-map` config can be used. diff --git a/pkgs/ffigen/example/shared_bindings/.gitignore b/pkgs/ffigen/example/shared_bindings/.gitignore new file mode 100644 index 0000000000..1b05164275 --- /dev/null +++ b/pkgs/ffigen/example/shared_bindings/.gitignore @@ -0,0 +1,11 @@ +# Files and directories created by pub. +.dart_tool/ +.packages +# Remove the following pattern if you wish to check in your lock file. +pubspec.lock + +# Conventional directory for build outputs. +build/ + +# Directory created by dartdoc. +doc/api/ diff --git a/pkgs/ffigen/example/shared_bindings/README.md b/pkgs/ffigen/example/shared_bindings/README.md new file mode 100644 index 0000000000..6a81fdd31c --- /dev/null +++ b/pkgs/ffigen/example/shared_bindings/README.md @@ -0,0 +1,10 @@ +# Shared bindings + +An example to showcase how bindings can share types +with other bindings. + +## Generating bindings +At the root of this example (`example/shared_bindings`), run - +``` +dart run generate.dart +``` diff --git a/pkgs/ffigen/example/shared_bindings/ffigen_configs/a.yaml b/pkgs/ffigen/example/shared_bindings/ffigen_configs/a.yaml new file mode 100644 index 0000000000..55a720e0a1 --- /dev/null +++ b/pkgs/ffigen/example/shared_bindings/ffigen_configs/a.yaml @@ -0,0 +1,12 @@ +# Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +name: NativeLibraryA +description: Bindings to `headers/a.h`. +output: '../lib/generated/a_gen.dart' +headers: + entry-points: + - '../headers/a.h' +preamble: | + // ignore_for_file: non_constant_identifier_names, camel_case_types diff --git a/pkgs/ffigen/example/shared_bindings/ffigen_configs/a_shared_base.yaml b/pkgs/ffigen/example/shared_bindings/ffigen_configs/a_shared_base.yaml new file mode 100644 index 0000000000..0adcc204df --- /dev/null +++ b/pkgs/ffigen/example/shared_bindings/ffigen_configs/a_shared_base.yaml @@ -0,0 +1,16 @@ +# Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +name: NativeLibraryASharedB +description: Bindings to `headers/a.h` with shared definitions from `headers/base.h`. +output: '../lib/generated/a_shared_b_gen.dart' +headers: + entry-points: + - '../headers/a.h' +import: + symbol-files: + # Both package Uri and file paths are supported here. + - 'package:shared_bindings/generated/base_symbols.yaml' +preamble: | + // ignore_for_file: non_constant_identifier_names, camel_case_types diff --git a/pkgs/ffigen/example/shared_bindings/ffigen_configs/base.yaml b/pkgs/ffigen/example/shared_bindings/ffigen_configs/base.yaml new file mode 100644 index 0000000000..474d0f9f45 --- /dev/null +++ b/pkgs/ffigen/example/shared_bindings/ffigen_configs/base.yaml @@ -0,0 +1,17 @@ +# Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +name: NativeLibraryBase +description: Bindings to `headers/base.h`. +output: + bindings: '../lib/generated/base_gen.dart' + symbol-file: + # Although file paths are supported here, prefer Package Uri's here. + output: 'package:shared_bindings/generated/base_symbols.yaml' + import-path: 'package:shared_bindings/generated/base_gen.dart' +headers: + entry-points: + - '../headers/base.h' +preamble: | + // ignore_for_file: non_constant_identifier_names, camel_case_types diff --git a/pkgs/ffigen/example/shared_bindings/generate.dart b/pkgs/ffigen/example/shared_bindings/generate.dart new file mode 100644 index 0000000000..8e565cf81c --- /dev/null +++ b/pkgs/ffigen/example/shared_bindings/generate.dart @@ -0,0 +1,32 @@ +import 'dart:io'; + +import 'package:cli_util/cli_util.dart'; +import 'package:path/path.dart' as p; + +ProcessResult runFfigenForConfig(String sdkPath, String configPath) { + return Process.runSync( + p.join(sdkPath, 'bin', 'dart'), + [ + 'run', + 'ffigen', + '--config=$configPath', + ], + runInShell: Platform.isWindows, + ); +} + +void main() { + final sdkPath = getSdkPath(); + final configPaths = [ + 'ffigen_configs/base.yaml', + 'ffigen_configs/a.yaml', + 'ffigen_configs/a_shared_base.yaml' + ]; + for (final configPath in configPaths) { + final res = runFfigenForConfig(sdkPath, configPath); + print(res.stdout.toString()); + if (res.exitCode != 0) { + throw Exception("Some error occurred: ${res.stderr.toString()}"); + } + } +} diff --git a/pkgs/ffigen/example/shared_bindings/headers/a.h b/pkgs/ffigen/example/shared_bindings/headers/a.h new file mode 100644 index 0000000000..ef3bbea37c --- /dev/null +++ b/pkgs/ffigen/example/shared_bindings/headers/a.h @@ -0,0 +1,21 @@ + +#include "base.h" + +struct A_Struct1{ + int a; +}; + +union A_Union1{ + int a; +}; + +enum A_Enum{ + A_ENUM_1, + A_ENUM_2, +}; + +#define A_MACRO_1 1; + +void a_func1(); + +void a_func2(struct BaseStruct2 s, union BaseUnion2 u, BaseTypedef2 t); diff --git a/pkgs/ffigen/example/shared_bindings/headers/base.h b/pkgs/ffigen/example/shared_bindings/headers/base.h new file mode 100644 index 0000000000..345cac64ea --- /dev/null +++ b/pkgs/ffigen/example/shared_bindings/headers/base.h @@ -0,0 +1,31 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +struct BaseStruct1{ + int a; +}; + +union BaseUnion1{ + int a; +}; + +struct BaseStruct2{ + int a; +}; + +union BaseUnion2{ + int a; +}; + +typedef struct BaseStruct1 BaseTypedef1; +typedef struct BaseStruct2 BaseTypedef2; + +enum BaseEnum{ + BASE_ENUM_1, + BASE_ENUM_2, +}; + +#define BASE_MACRO_1 1; + +void base_func1(BaseTypedef1 t1, BaseTypedef2 t2); diff --git a/pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart b/pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart new file mode 100644 index 0000000000..631aff8b73 --- /dev/null +++ b/pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart @@ -0,0 +1,112 @@ +// ignore_for_file: non_constant_identifier_names, camel_case_types + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Bindings to `headers/a.h`. +class NativeLibraryA { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + NativeLibraryA(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NativeLibraryA.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + void base_func1( + BaseTypedef1 t1, + BaseTypedef2 t2, + ) { + return _base_func1( + t1, + t2, + ); + } + + late final _base_func1Ptr = _lookup< + ffi.NativeFunction>( + 'base_func1'); + late final _base_func1 = + _base_func1Ptr.asFunction(); + + void a_func1() { + return _a_func1(); + } + + late final _a_func1Ptr = + _lookup>('a_func1'); + late final _a_func1 = _a_func1Ptr.asFunction(); + + void a_func2( + BaseStruct2 s, + BaseUnion2 u, + BaseTypedef2 t, + ) { + return _a_func2( + s, + u, + t, + ); + } + + late final _a_func2Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(BaseStruct2, BaseUnion2, BaseTypedef2)>>('a_func2'); + late final _a_func2 = _a_func2Ptr + .asFunction(); +} + +class BaseStruct1 extends ffi.Struct { + @ffi.Int() + external int a; +} + +class BaseUnion1 extends ffi.Union { + @ffi.Int() + external int a; +} + +class BaseStruct2 extends ffi.Struct { + @ffi.Int() + external int a; +} + +class BaseUnion2 extends ffi.Union { + @ffi.Int() + external int a; +} + +abstract class BaseEnum { + static const int BASE_ENUM_1 = 0; + static const int BASE_ENUM_2 = 1; +} + +typedef BaseTypedef1 = BaseStruct1; +typedef BaseTypedef2 = BaseStruct2; + +class A_Struct1 extends ffi.Struct { + @ffi.Int() + external int a; +} + +class A_Union1 extends ffi.Union { + @ffi.Int() + external int a; +} + +abstract class A_Enum { + static const int A_ENUM_1 = 0; + static const int A_ENUM_2 = 1; +} + +const int BASE_MACRO_1 = 1; + +const int A_MACRO_1 = 1; diff --git a/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart b/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart new file mode 100644 index 0000000000..fbf9c16019 --- /dev/null +++ b/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart @@ -0,0 +1,70 @@ +// ignore_for_file: non_constant_identifier_names, camel_case_types + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; +import 'package:shared_bindings/generated/base_gen.dart' as _imp1; + +/// Bindings to `headers/a.h` with shared definitions from `headers/base.h`. +class NativeLibraryASharedB { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + NativeLibraryASharedB(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NativeLibraryASharedB.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + void a_func1() { + return _a_func1(); + } + + late final _a_func1Ptr = + _lookup>('a_func1'); + late final _a_func1 = _a_func1Ptr.asFunction(); + + void a_func2( + _imp1.BaseStruct2 s, + _imp1.BaseUnion2 u, + _imp1.BaseTypedef2 t, + ) { + return _a_func2( + s, + u, + t, + ); + } + + late final _a_func2Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(_imp1.BaseStruct2, _imp1.BaseUnion2, + _imp1.BaseTypedef2)>>('a_func2'); + late final _a_func2 = _a_func2Ptr.asFunction< + void Function(_imp1.BaseStruct2, _imp1.BaseUnion2, _imp1.BaseTypedef2)>(); +} + +class A_Struct1 extends ffi.Struct { + @ffi.Int() + external int a; +} + +class A_Union1 extends ffi.Union { + @ffi.Int() + external int a; +} + +abstract class A_Enum { + static const int A_ENUM_1 = 0; + static const int A_ENUM_2 = 1; +} + +const int BASE_MACRO_1 = 1; + +const int A_MACRO_1 = 1; diff --git a/pkgs/ffigen/example/shared_bindings/lib/generated/base_gen.dart b/pkgs/ffigen/example/shared_bindings/lib/generated/base_gen.dart new file mode 100644 index 0000000000..d4cfdb5cbd --- /dev/null +++ b/pkgs/ffigen/example/shared_bindings/lib/generated/base_gen.dart @@ -0,0 +1,69 @@ +// ignore_for_file: non_constant_identifier_names, camel_case_types + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Bindings to `headers/base.h`. +class NativeLibraryBase { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + NativeLibraryBase(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NativeLibraryBase.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + void base_func1( + BaseTypedef1 t1, + BaseTypedef2 t2, + ) { + return _base_func1( + t1, + t2, + ); + } + + late final _base_func1Ptr = _lookup< + ffi.NativeFunction>( + 'base_func1'); + late final _base_func1 = + _base_func1Ptr.asFunction(); +} + +class BaseStruct1 extends ffi.Struct { + @ffi.Int() + external int a; +} + +class BaseUnion1 extends ffi.Union { + @ffi.Int() + external int a; +} + +class BaseStruct2 extends ffi.Struct { + @ffi.Int() + external int a; +} + +class BaseUnion2 extends ffi.Union { + @ffi.Int() + external int a; +} + +abstract class BaseEnum { + static const int BASE_ENUM_1 = 0; + static const int BASE_ENUM_2 = 1; +} + +typedef BaseTypedef1 = BaseStruct1; +typedef BaseTypedef2 = BaseStruct2; + +const int BASE_MACRO_1 = 1; diff --git a/pkgs/ffigen/example/shared_bindings/lib/generated/base_symbols.yaml b/pkgs/ffigen/example/shared_bindings/lib/generated/base_symbols.yaml new file mode 100644 index 0000000000..ad455faa48 --- /dev/null +++ b/pkgs/ffigen/example/shared_bindings/lib/generated/base_symbols.yaml @@ -0,0 +1,22 @@ +format_version: 1.0.0 +files: + package:shared_bindings/generated/base_gen.dart: + used-config: + ffi-native: false + symbols: + c:@E@BaseEnum: + name: BaseEnum + c:@F@base_func1: + name: base_func1 + c:@S@BaseStruct1: + name: BaseStruct1 + c:@S@BaseStruct2: + name: BaseStruct2 + c:@U@BaseUnion1: + name: BaseUnion1 + c:@U@BaseUnion2: + name: BaseUnion2 + c:base.h@T@BaseTypedef1: + name: BaseTypedef1 + c:base.h@T@BaseTypedef2: + name: BaseTypedef2 diff --git a/pkgs/ffigen/example/shared_bindings/pubspec.yaml b/pkgs/ffigen/example/shared_bindings/pubspec.yaml new file mode 100644 index 0000000000..b89304f2a0 --- /dev/null +++ b/pkgs/ffigen/example/shared_bindings/pubspec.yaml @@ -0,0 +1,15 @@ +# Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +name: shared_bindings + +environment: + sdk: '>=2.17.0 <3.0.0' + +dependencies: + ffi: ^2.0.1 +dev_dependencies: + ffigen: + path: '../../' + lints: ^1.0.1 diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index 4496e71efa..590f63cde3 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -86,11 +86,13 @@ class Func extends LookUpBinding { _exposedCFunctionTypealias = Typealias( name: 'Native$upperCaseName', type: functionType, + isInternal: true, ); _exposedDartFunctionTypealias = Typealias( name: 'Dart$upperCaseName', type: functionType, useDartType: true, + isInternal: true, ); } } diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index 7c7ce47820..befdfcecb9 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -9,6 +9,7 @@ import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/config_provider/config_types.dart'; import 'package:logging/logging.dart'; import 'package:path/path.dart' as p; +import 'package:yaml_edit/yaml_edit.dart'; import '../strings.dart' as strings; import 'utils.dart'; @@ -138,6 +139,19 @@ class Library { } } + /// Generates [file] with symbol output yaml. + void generateSymbolOutputFile(File file, String importPath) { + if (!file.existsSync()) file.createSync(recursive: true); + final symbolFileYamlMap = writer.generateSymbolOutputYamlMap(importPath); + final yamlEditor = YamlEditor(""); + yamlEditor.update([], wrapAsYamlNode(symbolFileYamlMap)); + var yamlString = yamlEditor.toString(); + if (!yamlString.endsWith('\n')) { + yamlString += "\n"; + } + file.writeAsStringSync(yamlString); + } + /// Formats a file using the Dart formatter. void _dartFormat(String path) { final sdkPath = getSdkPath(); diff --git a/pkgs/ffigen/lib/src/code_generator/typealias.dart b/pkgs/ffigen/lib/src/code_generator/typealias.dart index f42e863601..6a47f6182c 100644 --- a/pkgs/ffigen/lib/src/code_generator/typealias.dart +++ b/pkgs/ffigen/lib/src/code_generator/typealias.dart @@ -29,12 +29,14 @@ class Typealias extends BindingType { /// /// E.g if C type is ffi.Void func(ffi.Int32), Dart type is void func(int). bool useDartType = false, + bool isInternal = false, }) : _useDartType = useDartType, super( usr: usr, name: name, dartDoc: dartDoc, originalName: originalName, + isInternal: isInternal, ); @override diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index 1f054fc7d2..748275d26e 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -4,6 +4,11 @@ import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/code_generator/utils.dart'; +import 'package:logging/logging.dart'; + +import '../strings.dart' as strings; + +final _logger = Logger('ffigen.code_generator.writer'); /// To store generated String bindings. class Writer { @@ -75,6 +80,11 @@ class Writer { /// Guaranteed to be a unique prefix. String get arrayHelperClassPrefix => _arrayHelperClassPrefix; + /// Set true after calling [generate]. Indicates if + /// [generateSymbolOutputYamlMap] can be called. + bool get canGenerateSymbolOutput => _canGenerateSymbolOutput; + bool _canGenerateSymbolOutput = false; + /// [_usedUpNames] should contain names of all the declarations which are /// already used. This is used to avoid name collisions. Writer({ @@ -256,8 +266,55 @@ class Writer { } result.write(s); + _canGenerateSymbolOutput = true; return result.toString(); } + + Map generateSymbolOutputYamlMap(String importFilePath) { + final bindings = [ + ...noLookUpBindings, + ...ffiNativeBindings, + ...lookUpBindings + ]; + if (!canGenerateSymbolOutput) { + throw Exception( + "Invalid state: generateSymbolOutputYamlMap() called before generate()"); + } + final result = {}; + + result[strings.formatVersion] = strings.symbolFileFormatVersion; + result[strings.files] = {}; + result[strings.files][importFilePath] = {}; + + final fileConfig = result[strings.files][importFilePath]; + fileConfig[strings.usedConfig] = {}; + + // Warn for macros. + final hasMacroBindings = bindings.any( + (element) => element is Constant && element.usr.contains('@macro@')); + if (hasMacroBindings) { + _logger.info( + 'Removing all Macros from symbol file since they cannot be cross referenced reliably.'); + } + // Remove internal bindings and macros. + bindings.removeWhere((element) { + return element.isInternal || + (element is Constant && element.usr.contains('@macro@')); + }); + // Sort bindings alphabetically by USR. + bindings.sort((a, b) => a.usr.compareTo(b.usr)); + fileConfig[strings.usedConfig][strings.ffiNative] = bindings + .whereType() + .any((element) => element.ffiNativeConfig.enabled); + fileConfig[strings.symbols] = {}; + final symbolConfig = fileConfig[strings.symbols]; + for (final binding in bindings) { + symbolConfig[binding.usr] = { + strings.name: binding.name, + }; + } + return result; + } } /// Manages the generated `_SymbolAddress` class. diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 3457c91577..9c094ed41f 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -8,6 +8,7 @@ import 'dart:io'; import 'package:ffigen/src/code_generator.dart'; import 'package:logging/logging.dart'; +import 'package:package_config/package_config_types.dart'; import 'package:yaml/yaml.dart'; import '../strings.dart' as strings; @@ -24,6 +25,10 @@ class Config { String? get filename => _filename; String? _filename; + /// Package config. + PackageConfig? get packageConfig => _packageConfig; + PackageConfig? _packageConfig; + /// Location for llvm/lib folder. String get libclangDylib => _libclangDylib; late String _libclangDylib; @@ -32,6 +37,10 @@ class Config { String get output => _output; late String _output; + /// Symbol file config. + SymbolFile? get symbolFile => _symbolFile; + late SymbolFile? _symbolFile; + /// Language that ffigen is consuming. Language get language => _language; late Language _language; @@ -98,6 +107,10 @@ class Config { Map get libraryImports => _libraryImports; late Map _libraryImports; + /// Stores all the symbol file maps name to ImportedType mappings specified by user. + Map get usrTypeMappings => _usrTypeMappings; + late Map _usrTypeMappings; + /// Stores typedef name to ImportedType mappings specified by user. Map get typedefTypeMappings => _typedefTypeMappings; late Map _typedefTypeMappings; @@ -159,11 +172,12 @@ class Config { FfiNativeConfig get ffiNativeConfig => _ffiNativeConfig; late FfiNativeConfig _ffiNativeConfig; - Config._(this._filename); + Config._(this._filename, this._packageConfig); /// Create config from Yaml map. - factory Config.fromYaml(YamlMap map, [String? filename]) { - final configspecs = Config._(filename); + factory Config.fromYaml(YamlMap map, + {String? filename, PackageConfig? packageConfig}) { + final configspecs = Config._(filename, packageConfig); _logger.finest('Config Map: ' + map.toString()); final specs = configspecs._getSpecs(); @@ -178,11 +192,12 @@ class Config { } /// Create config from a file. - factory Config.fromFile(File file) { + factory Config.fromFile(File file, {PackageConfig? packageConfig}) { // Throws a [YamlException] if it's unable to parse the Yaml. final configYaml = loadYaml(file.readAsStringSync()) as YamlMap; - return Config.fromYaml(configYaml, file.path); + return Config.fromYaml(configYaml, + filename: file.path, packageConfig: packageConfig); } /// Add compiler options for clang. If [highPriority] is true these are added @@ -245,11 +260,15 @@ class Config { _libclangDylib = result as String; }, ), - [strings.output]: Specification( + [strings.output]: Specification( requirement: Requirement.yes, validator: outputValidator, - extractor: (dynamic value) => outputExtractor(value, filename), - extractedResult: (dynamic result) => _output = result as String, + extractor: (dynamic value) => + outputExtractor(value, filename, packageConfig), + extractedResult: (dynamic result) { + _output = (result as OutputConfig).output; + _symbolFile = result.symbolFile; + }, ), [strings.language]: Specification( requirement: Requirement.no, @@ -378,6 +397,16 @@ class Config { _libraryImports = result as Map; }, ), + [strings.import, strings.symbolFilesImport]: + Specification>( + validator: symbolFileImportValidator, + extractor: (value) => symbolFileImportExtractor( + value, _libraryImports, filename, packageConfig), + defaultValue: () => {}, + extractedResult: (dynamic result) { + _usrTypeMappings = result as Map; + }, + ), [strings.typeMap, strings.typeMapTypedefs]: Specification>>( validator: typeMapValidator, diff --git a/pkgs/ffigen/lib/src/config_provider/config_types.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart index e3965c0b8a..8521bdb111 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_types.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart @@ -409,3 +409,17 @@ class FfiNativeConfig { const FfiNativeConfig({required this.enabled, this.asset}); } + +class SymbolFile { + final String importPath; + final String output; + + SymbolFile(this.importPath, this.output); +} + +class OutputConfig { + final String output; + final SymbolFile? symbolFile; + + OutputConfig(this.output, this.symbolFile); +} diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 53c8ce92dd..176646e731 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -5,9 +5,11 @@ import 'dart:io'; import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/code_generator/utils.dart'; import 'package:file/local.dart'; import 'package:glob/glob.dart'; import 'package:logging/logging.dart'; +import 'package:package_config/package_config.dart'; import 'package:path/path.dart' as p; import 'package:quiver/pattern.dart' as quiver; import 'package:yaml/yaml.dart'; @@ -143,6 +145,99 @@ bool libraryImportsValidator(List name, dynamic yamlConfig) { return true; } +void loadImportedTypes(YamlMap fileConfig, + Map usrTypeMappings, LibraryImport libraryImport) { + final symbols = fileConfig['symbols'] as YamlMap; + for (final key in symbols.keys) { + final usr = key as String; + final value = symbols[usr]! as YamlMap; + usrTypeMappings[usr] = ImportedType( + libraryImport, value['name'] as String, value['name'] as String); + } +} + +YamlMap loadSymbolFile(String symbolFilePath, String? configFileName, + PackageConfig? packageConfig) { + final path = symbolFilePath.startsWith('package:') + ? packageConfig!.resolve(Uri.parse(symbolFilePath))!.toFilePath() + : _normalizePath(symbolFilePath, configFileName); + + return loadYaml(File(path).readAsStringSync()) as YamlMap; +} + +Map symbolFileImportExtractor( + dynamic yamlConfig, + Map libraryImports, + String? configFileName, + PackageConfig? packageConfig) { + final resultMap = {}; + for (final item in (yamlConfig as YamlList)) { + String symbolFilePath; + if (item is String) { + symbolFilePath = item; + } else { + symbolFilePath = item[strings.symbolFile] as String; + } + final symbolFile = + loadSymbolFile(symbolFilePath, configFileName, packageConfig); + final formatVersion = symbolFile[strings.formatVersion] as String; + if (formatVersion.split('.')[0] != + strings.symbolFileFormatVersion.split('.')[0]) { + _logger.severe( + 'Incompatible format versions for file $symbolFilePath: ${strings.symbolFileFormatVersion}(ours), $formatVersion(theirs).'); + exit(1); + } + final uniqueNamer = UniqueNamer(libraryImports.keys + .followedBy([strings.defaultSymbolFileImportPrefix]).toSet()); + for (final file in (symbolFile[strings.files] as YamlMap).keys) { + final existingImports = + libraryImports.values.where((element) => element.importPath == file); + if (existingImports.isEmpty) { + final name = + uniqueNamer.makeUnique(strings.defaultSymbolFileImportPrefix); + libraryImports[name] = LibraryImport(name, file as String); + } + final libraryImport = libraryImports.values.firstWhere( + (element) => element.importPath == file, + ); + loadImportedTypes( + symbolFile[strings.files][file] as YamlMap, resultMap, libraryImport); + } + } + return resultMap; +} + +bool symbolFileImportValidator(List name, dynamic yamlConfig) { + if (!checkType(name, yamlConfig)) { + return false; + } + var result = true; + (yamlConfig as YamlList).asMap().forEach((idx, value) { + if (value is YamlMap) { + if (!value.keys.contains(strings.symbolFile)) { + result = false; + _logger + .severe('Key $name -> $idx -> ${strings.symbolFile} is required.'); + } + for (final key in value.keys) { + if (key == strings.symbolFile) { + if (!checkType( + [...name, idx.toString(), key as String], value[key])) { + result = false; + } + } else { + result = false; + _logger.severe('Unknown key : $name -> $idx -> $key.'); + } + } + } else if (value is! String) { + result = false; + _logger.severe('Expected $name -> $idx should be a String or Map.'); + } + }); + return result; +} + Map> typeMapExtractor(dynamic yamlConfig) { // Key - type_name, Value - [lib, cType, dartType]. final resultMap = >{}; @@ -482,11 +577,91 @@ bool llvmPathValidator(List name, dynamic value) { return true; } -String outputExtractor(dynamic value, String? configFilename) => - _normalizePath(value as String, configFilename); +OutputConfig outputExtractor( + dynamic value, String? configFilename, PackageConfig? packageConfig) { + if (value is String) { + return OutputConfig(_normalizePath(value, configFilename), null); + } + value = value as YamlMap; + return OutputConfig( + _normalizePath((value)[strings.bindings] as String, configFilename), + value.containsKey(strings.symbolFile) + ? symbolFileOutputExtractor( + value[strings.symbolFile], configFilename, packageConfig) + : null, + ); +} + +bool outputValidator(List name, dynamic value) { + if (value is String) { + return true; + } else if (value is YamlMap) { + final keys = value.keys; + var result = true; + for (final key in keys) { + if (key == strings.bindings) { + if (!checkType([...name, key as String], value[key])) { + result = false; + } + } else if (key == strings.symbolFile) { + result = symbolFileOutputValidator( + [...name, strings.symbolFile], value[key]); + } else { + result = false; + _logger.severe("Unknown key '$key' in '$name'."); + } + } + return result; + } else { + _logger.severe( + "Expected value of key '${name.join(' -> ')}' to be a String or Map."); + return false; + } +} -bool outputValidator(List name, dynamic value) => - checkType(name, value); +SymbolFile symbolFileOutputExtractor( + dynamic value, String? configFilename, PackageConfig? packageConfig) { + value = value as YamlMap; + var output = value[strings.output] as String; + if (Uri.parse(output).scheme != "package") { + _logger.warning( + 'Consider using a Package Uri for ${strings.symbolFile} -> ${strings.output}: $output so that external packages can use it.'); + output = _normalizePath(output, configFilename); + } else { + output = packageConfig!.resolve(Uri.parse(output))!.toFilePath(); + } + final importPath = value[strings.importPath] as String; + if (Uri.parse(importPath).scheme != "package") { + _logger.warning( + 'Consider using a Package Uri for ${strings.symbolFile} -> ${strings.importPath}: $importPath so that external packages can use it.'); + } + return SymbolFile(importPath, output); +} + +bool symbolFileOutputValidator(List name, dynamic value) { + if (!checkType(name, value)) { + return false; + } + if (!(value as YamlMap).containsKey(strings.output)) { + _logger.severe("Required '$name -> ${strings.output}'."); + return false; + } + if (!(value).containsKey(strings.importPath)) { + _logger.severe("Required '$name -> ${strings.importPath}'."); + return false; + } + for (final key in value.keys) { + if (key == strings.output || key == strings.importPath) { + if (!checkType([...name, key as String], value[key])) { + return false; + } + } else { + _logger.severe("Unknown key '$key' in '$name'."); + return false; + } + } + return true; +} Language languageExtractor(dynamic value) { if (value == strings.langC) { diff --git a/pkgs/ffigen/lib/src/executables/ffigen.dart b/pkgs/ffigen/lib/src/executables/ffigen.dart index b3e7c41bb9..c37cb4f850 100644 --- a/pkgs/ffigen/lib/src/executables/ffigen.dart +++ b/pkgs/ffigen/lib/src/executables/ffigen.dart @@ -9,6 +9,7 @@ import 'package:args/args.dart'; import 'package:cli_util/cli_logging.dart' show Ansi; import 'package:ffigen/ffigen.dart'; import 'package:logging/logging.dart'; +import 'package:package_config/package_config.dart'; import 'package:yaml/yaml.dart' as yaml; final _logger = Logger('ffigen.ffigen'); @@ -34,7 +35,7 @@ String errorPen(String str) { return '${_ansi.red}$str${_ansi.none}'; } -void main(List args) { +void main(List args) async { // Parses the cmd args. This will print usage and exit if --help was passed. final argResult = getArgResults(args); @@ -44,7 +45,7 @@ void main(List args) { // Create a config object. Config config; try { - config = getConfig(argResult); + config = getConfig(argResult, await findPackageConfig(Directory.current)); } on FormatException { _logger.severe('Please fix configuration errors and re-run the tool.'); exit(1); @@ -58,17 +59,25 @@ void main(List args) { library.generateFile(gen); _logger .info(successPen('Finished, Bindings generated in ${gen.absolute.path}')); + + if (config.symbolFile != null) { + final symbolFileGen = File(config.symbolFile!.output); + library.generateSymbolOutputFile( + symbolFileGen, config.symbolFile!.importPath); + _logger.info(successPen( + 'Finished, Symbol Output generated in ${symbolFileGen.absolute.path}')); + } } -Config getConfig(ArgResults result) { +Config getConfig(ArgResults result, PackageConfig? packageConfig) { _logger.info('Running in ${Directory.current}'); Config config; // Parse config from yaml. if (result.wasParsed(conf)) { - config = getConfigFromCustomYaml(result[conf] as String); + config = getConfigFromCustomYaml(result[conf] as String, packageConfig); } else { - config = getConfigFromPubspec(); + config = getConfigFromPubspec(packageConfig); } // Add compiler options from command line. @@ -82,7 +91,7 @@ Config getConfig(ArgResults result) { } /// Extracts configuration from pubspec file. -Config getConfigFromPubspec() { +Config getConfigFromPubspec(PackageConfig? packageConfig) { final pubspecFile = File(pubspecName); if (!pubspecFile.existsSync()) { @@ -101,11 +110,12 @@ Config getConfigFromPubspec() { _logger.severe("Couldn't find an entry for '$configKey' in $pubspecName."); exit(1); } - return Config.fromYaml(bindingsConfigMap, pubspecFile.path); + return Config.fromYaml(bindingsConfigMap, + filename: pubspecFile.path, packageConfig: packageConfig); } /// Extracts configuration from a custom yaml file. -Config getConfigFromCustomYaml(String yamlPath) { +Config getConfigFromCustomYaml(String yamlPath, PackageConfig? packageConfig) { final yamlFile = File(yamlPath); if (!yamlFile.existsSync()) { @@ -113,7 +123,7 @@ Config getConfigFromCustomYaml(String yamlPath) { exit(1); } - return Config.fromFile(yamlFile); + return Config.fromFile(yamlFile, packageConfig: packageConfig); } /// Parses the cmd line arguments. diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart index 415f6d900e..5e55aa2fb5 100644 --- a/pkgs/ffigen/lib/src/header_parser/includer.dart +++ b/pkgs/ffigen/lib/src/header_parser/includer.dart @@ -16,6 +16,8 @@ bool _shouldIncludeDecl( bool Function(String, bool) configIncludes) { if (isSeenDecl(usr) || name == '') { return false; + } else if (config.usrTypeMappings.containsKey(usr)) { + return false; } else if (configIncludes(name, config.excludeAllByDefault)) { return true; } else { diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 065e789fc7..05691d3d4f 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -174,11 +174,16 @@ _CreateTypeFromCursorResult _createTypeFromCursor(clang_types.CXType cxtype, // those two types are ABI compatible, so just return bool regardless. return _CreateTypeFromCursorResult(BooleanType()); } + final usr = cursor.usr(); if (config.typedefTypeMappings.containsKey(spelling)) { _logger.fine(' Type $spelling mapped from type-map'); return _CreateTypeFromCursorResult( config.typedefTypeMappings[spelling]!); } + if (config.usrTypeMappings.containsKey(usr)) { + _logger.fine(' Type $spelling mapped from usr'); + return _CreateTypeFromCursorResult(config.usrTypeMappings[usr]!); + } // Get name from supported typedef name if config allows. if (config.useSupportedTypedefs) { if (suportedTypedefToSuportedNativeType.containsKey(spelling)) { @@ -249,6 +254,7 @@ Type? _extractfromRecord(clang_types.CXType cxtype, clang_types.CXCursor cursor, if (cursorKind == clang_types.CXCursorKind.CXCursor_StructDecl || cursorKind == clang_types.CXCursorKind.CXCursor_UnionDecl) { final declSpelling = cursor.spelling(); + final declUsr = cursor.usr(); // Set includer functions according to compoundType. final CompoundType compoundType; @@ -268,10 +274,12 @@ Type? _extractfromRecord(clang_types.CXType cxtype, clang_types.CXCursor cursor, } // Also add a struct binding, if its unseen. - // TODO(23): Check if we should auto add compound declarations. if (compoundTypeMappings.containsKey(declSpelling)) { _logger.fine(' Type Mapped from type-map'); return compoundTypeMappings[declSpelling]!; + } else if (config.usrTypeMappings.containsKey(declUsr)) { + _logger.fine(' Type Mapped from usr'); + return config.usrTypeMappings[declUsr]!; } else { final struct = parseCompoundDeclaration( cursor, diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 99d10c2031..4c99ba42f1 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -29,6 +29,10 @@ String get dynamicLibParentName => Platform.isWindows ? 'bin' : 'lib'; const output = 'output'; +// Sub-keys of output. +const bindings = "bindings"; +const symbolFile = 'symbol-file'; + const language = 'language'; // String mappings for the Language enum. @@ -131,6 +135,29 @@ const sizemap_native_mapping = { // Library imports. const libraryImports = 'library-imports'; +// Sub Keys of symbol file. +const symbols = 'symbols'; + +// Symbol file yaml. +const formatVersion = "format_version"; + +/// Current symbol file format version. +/// +/// This is generated when generating any symbol file. When importing any other +/// symbol file, this version is compared according to `semantic` versioning +/// to determine compatibility. +const symbolFileFormatVersion = "1.0.0"; +const files = "files"; +const usedConfig = "used-config"; + +const import = 'import'; +const defaultSymbolFileImportPrefix = '_imp'; + +// Sub keys of import. +const symbolFilesImport = 'symbol-files'; +// Sub-Sub keys of symbolFilesImport. +const importPath = 'import-path'; + final predefinedLibraryImports = { ffiImport.name: ffiImport, ffiPkgImport.name: ffiPkgImport diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index c13dfb51f5..1608ea8bb9 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 7.1.0 +version: 7.2.0 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen @@ -20,6 +20,8 @@ dependencies: cli_util: ^0.3.0 glob: ^2.0.0 file: ^6.0.0 + package_config: ^2.1.0 + yaml_edit: ^2.0.3 dev_dependencies: lints: ^1.0.1 diff --git a/pkgs/ffigen/test/example_tests/shared_bindings_example_test.dart b/pkgs/ffigen/test/example_tests/shared_bindings_example_test.dart new file mode 100644 index 0000000000..290ea40906 --- /dev/null +++ b/pkgs/ffigen/test/example_tests/shared_bindings_example_test.dart @@ -0,0 +1,67 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/config_provider/config.dart'; +import 'package:ffigen/src/header_parser.dart'; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart'; + +import '../test_utils.dart'; + +void main() { + group('shared_bindings_example', () { + setUpAll(() { + logWarnings(Level.SEVERE); + }); + + test('a_shared_base bindings', () { + final config = Config.fromYaml(loadYaml(''' +${strings.name}: NativeLibraryASharedB +${strings.description}: Bindings to `headers/a.h` with shared definitions from `headers/base.h`. +${strings.output}: 'lib/generated/a_shared_b_gen.dart' +${strings.headers}: + ${strings.entryPoints}: + - 'example/shared_bindings/headers/a.h' +${strings.import}: + ${strings.symbolFilesImport}: + - 'example/shared_bindings/lib/generated/base_symbols.yaml' +${strings.preamble}: | + // ignore_for_file: non_constant_identifier_names, camel_case_types +''') as YamlMap); + final library = parse(config); + + matchLibraryWithExpected( + library, + 'example_shared_bindings.dart', + ['example', 'shared_bindings', config.output], + ); + }); + + test('base symbol file output', () { + final config = Config.fromYaml(loadYaml(''' +${strings.name}: NativeLibraryBase +${strings.description}: Bindings to `headers/base.h`. +${strings.output}: + ${strings.bindings}: 'lib/generated/base_gen.dart' + ${strings.symbolFile}: + ${strings.output}: 'lib/generated/base_symbols.yaml' + ${strings.importPath}: 'package:shared_bindings/generated/base_gen.dart' +${strings.headers}: + ${strings.entryPoints}: + - 'example/shared_bindings/headers/base.h' +${strings.preamble}: | + // ignore_for_file: non_constant_identifier_names, camel_case_types +''') as YamlMap); + final library = parse(config); + matchLibrarySymbolFileWithExpected( + library, + 'example_shared_bindings.yaml', + ['example', 'shared_bindings', config.symbolFile!.output], + config.symbolFile!.importPath, + ); + }); + }); +} diff --git a/pkgs/ffigen/test/example_tests/swift_example_test.dart b/pkgs/ffigen/test/example_tests/swift_example_test.dart index 151b89547f..05c854cb6b 100644 --- a/pkgs/ffigen/test/example_tests/swift_example_test.dart +++ b/pkgs/ffigen/test/example_tests/swift_example_test.dart @@ -46,8 +46,8 @@ void main() { final pubspecFile = File('example/swift/pubspec.yaml'); final pubspecYaml = loadYaml(pubspecFile.readAsStringSync()) as YamlMap; - final config = - Config.fromYaml(pubspecYaml['ffigen'] as YamlMap, pubspecFile.path); + final config = Config.fromYaml(pubspecYaml['ffigen'] as YamlMap, + filename: pubspecFile.path); final output = parse(config).generate(); // Verify that the output contains all the methods and classes that the diff --git a/pkgs/ffigen/test/test_utils.dart b/pkgs/ffigen/test/test_utils.dart index 8aa8b44639..93ea29575b 100644 --- a/pkgs/ffigen/test/test_utils.dart +++ b/pkgs/ffigen/test/test_utils.dart @@ -49,17 +49,52 @@ String _normalizeGeneratedCode( return codeNormalizer(noCR); } -/// Generates actual file using library and tests using [expect] with expected +/// Generates actual file using library and tests using [expect] with expected. /// /// This will not delete the actual debug file incase [expect] throws an error. void matchLibraryWithExpected( Library library, String pathForActual, List pathToExpected, {String Function(String)? codeNormalizer}) { + _matchFileWithExpected( + library: library, + pathForActual: pathForActual, + pathToExpected: pathToExpected, + fileWriter: ({required Library library, required File file}) => + library.generateFile(file), + codeNormalizer: codeNormalizer, + ); +} + +/// Generates actual file using library and tests using [expect] with expected. +/// +/// This will not delete the actual debug file incase [expect] throws an error. +void matchLibrarySymbolFileWithExpected(Library library, String pathForActual, + List pathToExpected, String importPath) { + _matchFileWithExpected( + library: library, + pathForActual: pathForActual, + pathToExpected: pathToExpected, + fileWriter: ({required Library library, required File file}) { + if (!library.writer.canGenerateSymbolOutput) library.generate(); + library.generateSymbolOutputFile(file, importPath); + }); +} + +/// Generates actual file using library and tests using [expect] with expected. +/// +/// This will not delete the actual debug file incase [expect] throws an error. +void _matchFileWithExpected({ + required Library library, + required String pathForActual, + required List pathToExpected, + required void Function({required Library library, required File file}) + fileWriter, + String Function(String)? codeNormalizer, +}) { final file = File( path.join(strings.tmpDir, pathForActual), ); - library.generateFile(file); - + fileWriter(library: library, file: file); try { final actual = _normalizeGeneratedCode(file.readAsStringSync(), codeNormalizer); From 1972596e456bd8c20bc56af51b1a74620896addb Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Tue, 25 Oct 2022 08:31:54 +0200 Subject: [PATCH 195/276] [ffigen] Prevent warnings in FfiNative example (#479) --- pkgs/ffigen/example/ffinative/generated_bindings.dart | 2 ++ pkgs/ffigen/example/ffinative/pubspec.yaml | 2 ++ pkgs/ffigen/test/example_tests/ffinative_example_test.dart | 2 ++ 3 files changed, 6 insertions(+) diff --git a/pkgs/ffigen/example/ffinative/generated_bindings.dart b/pkgs/ffigen/example/ffinative/generated_bindings.dart index ea0436b0c9..1bb65d0f6c 100644 --- a/pkgs/ffigen/example/ffinative/generated_bindings.dart +++ b/pkgs/ffigen/example/ffinative/generated_bindings.dart @@ -1,3 +1,5 @@ +// ignore_for_file: deprecated_member_use + // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. diff --git a/pkgs/ffigen/example/ffinative/pubspec.yaml b/pkgs/ffigen/example/ffinative/pubspec.yaml index 5ba0423fe6..2132d8b359 100644 --- a/pkgs/ffigen/example/ffinative/pubspec.yaml +++ b/pkgs/ffigen/example/ffinative/pubspec.yaml @@ -23,3 +23,5 @@ ffigen: headers: entry-points: - 'headers/example.h' + preamble: | + // ignore_for_file: deprecated_member_use diff --git a/pkgs/ffigen/test/example_tests/ffinative_example_test.dart b/pkgs/ffigen/test/example_tests/ffinative_example_test.dart index 6895a8e989..779b41a01a 100644 --- a/pkgs/ffigen/test/example_tests/ffinative_example_test.dart +++ b/pkgs/ffigen/test/example_tests/ffinative_example_test.dart @@ -26,6 +26,8 @@ ${strings.output}: 'generated_bindings.dart' ${strings.headers}: ${strings.entryPoints}: - 'example/ffinative/headers/example.h' +${strings.preamble}: | + // ignore_for_file: deprecated_member_use ''') as YamlMap); final library = parse(config); From 18f94998cd9d5e53577eb8f8f103f1053f387aca Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Wed, 9 Nov 2022 15:48:08 -0800 Subject: [PATCH 196/276] [ffigen] blast_repo fixes (#481) Dependabot GitHub Action --- pkgs/ffigen/.github/dependabot.yml | 9 ++++++++ .../ffigen/.github/workflows/test-package.yml | 22 +++++++++---------- 2 files changed, 20 insertions(+), 11 deletions(-) create mode 100644 pkgs/ffigen/.github/dependabot.yml diff --git a/pkgs/ffigen/.github/dependabot.yml b/pkgs/ffigen/.github/dependabot.yml new file mode 100644 index 0000000000..1603cdd9ee --- /dev/null +++ b/pkgs/ffigen/.github/dependabot.yml @@ -0,0 +1,9 @@ +# Dependabot configuration file. +# See https://docs.github.com/en/code-security/dependabot/dependabot-version-updates +version: 2 + +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index f6deae35fd..064e4c7490 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -21,8 +21,8 @@ jobs: matrix: sdk: [stable] steps: - - uses: actions/checkout@v2 - - uses: dart-lang/setup-dart@v1.0 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d with: sdk: ${{ matrix.sdk }} - id: install @@ -41,8 +41,8 @@ jobs: needs: analyze runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 - - uses: dart-lang/setup-dart@v1.0 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d with: sdk: stable - name: Install dependencies @@ -58,8 +58,8 @@ jobs: needs: analyze runs-on: macos-latest steps: - - uses: actions/checkout@v2 - - uses: dart-lang/setup-dart@v1.0 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d with: sdk: stable - name: Install dependencies @@ -71,7 +71,7 @@ jobs: - name: Collect coverage run: ./tool/coverage.sh - name: Upload coverage - uses: coverallsapp/github-action@v1.1.2 + uses: coverallsapp/github-action@8cbef1dea373ebce56de0a14c68d6267baa10b44 with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: lcov.info @@ -80,8 +80,8 @@ jobs: needs: analyze runs-on: windows-latest steps: - - uses: actions/checkout@v2 - - uses: dart-lang/setup-dart@v1.0 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d with: sdk: stable - name: Install dependencies @@ -105,8 +105,8 @@ jobs: needs: analyze runs-on: windows-latest steps: - - uses: actions/checkout@v3 - - uses: subosito/flutter-action@v2 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + - uses: subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d with: channel: 'master' - name: Install dependencies From 77ee8707f046148c5a3bf62e373a7c92246c13c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Nov 2022 08:34:10 +0100 Subject: [PATCH 197/276] [ffigen] Bump coverallsapp/github-action from 1.1.2 to 1.1.3 (#482) Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 1.1.2 to 1.1.3. - [Release notes](https://github.com/coverallsapp/github-action/releases) - [Commits](https://github.com/coverallsapp/github-action/compare/8cbef1dea373ebce56de0a14c68d6267baa10b44...9ba913c152ae4be1327bfb9085dc806cedb44057) --- updated-dependencies: - dependency-name: coverallsapp/github-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkgs/ffigen/.github/workflows/test-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 064e4c7490..8ab406c50c 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -71,7 +71,7 @@ jobs: - name: Collect coverage run: ./tool/coverage.sh - name: Upload coverage - uses: coverallsapp/github-action@8cbef1dea373ebce56de0a14c68d6267baa10b44 + uses: coverallsapp/github-action@9ba913c152ae4be1327bfb9085dc806cedb44057 with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: lcov.info From 878ec39baa404e558ec5e346f8e362194d27ca0e Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Thu, 17 Nov 2022 23:41:06 -0800 Subject: [PATCH 198/276] [ffigen] Remove the built in flag from ObjC interfaces (#487) --- pkgs/ffigen/CHANGELOG.md | 6 ++++++ .../src/code_generator/objc_built_in_functions.dart | 1 - pkgs/ffigen/lib/src/code_generator/objc_interface.dart | 10 +++------- .../sub_parsers/objcinterfacedecl_parser.dart | 1 - pkgs/ffigen/pubspec.yaml | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 1a577daca0..6f64cf7cd9 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,8 +1,14 @@ +# 7.2.1 + +- Fix helper methods sometimes missing from NSString. + # 7.2.0 + - Added support for sharing bindings using `symbol-file` config. (See `README.md` and examples/shared_bindings). # 7.1.0 + - Handle declarations with definition accessible from a different entry-point. # 7.0.0 diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index d796763e35..e7f5bd5ce7 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -311,7 +311,6 @@ class $name implements ${w.ffiLibraryPrefix}.Finalizable { (ObjCInterface( originalName: "NSData", builtInFunctions: this, - isBuiltIn: true, )); } diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index cda85cae81..8ca0b8e71a 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -44,7 +44,6 @@ class ObjCInterface extends BindingType { final String lookupName; final ObjCBuiltInFunctions builtInFunctions; - final bool isBuiltIn; late final ObjCInternalGlobal _classObject; late final ObjCInternalGlobal _isKindOfClass; late final Func _isKindOfClassMsgSend; @@ -56,7 +55,6 @@ class ObjCInterface extends BindingType { String? lookupName, String? dartDoc, required this.builtInFunctions, - required this.isBuiltIn, }) : lookupName = lookupName ?? originalName, super( usr: usr, @@ -64,13 +62,11 @@ class ObjCInterface extends BindingType { name: name ?? originalName, dartDoc: dartDoc, ) { - if (isBuiltIn) { - builtInFunctions.registerInterface(this); - } + builtInFunctions.registerInterface(this); } - bool get isNSString => isBuiltIn && originalName == "NSString"; - bool get isNSData => isBuiltIn && originalName == "NSData"; + bool get isNSString => originalName == "NSString"; + bool get isNSData => originalName == "NSData"; @override BindingString toBindingString(Writer w) { diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index 16cec51494..64f1e28152 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -75,7 +75,6 @@ Type? parseObjCInterfaceDeclaration( lookupName: config.objcModulePrefixer.applyPrefix(name), dartDoc: getCursorDocComment(cursor), builtInFunctions: objCBuiltInFunctions, - isBuiltIn: cursor.isInSystemHeader(), ); } diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 1608ea8bb9..c5d8d67baa 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 7.2.0 +version: 7.2.1 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen From e19d7d66d0f5d795a15f46d2789848ecce96b661 Mon Sep 17 00:00:00 2001 From: Hossein Yousefi Date: Wed, 23 Nov 2022 15:42:13 +0100 Subject: [PATCH 199/276] [ffigen] Added new llvm versions to linuxDylibLocations (#489) --- pkgs/ffigen/CHANGELOG.md | 4 ++++ pkgs/ffigen/lib/src/strings.dart | 2 ++ pkgs/ffigen/pubspec.yaml | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 6f64cf7cd9..40dd82ee69 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 7.2.2 + +- Added newer versions of LLVM, to default `linuxDylibLocations`. + # 7.2.1 - Fix helper methods sometimes missing from NSString. diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 4c99ba42f1..180c198465 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -227,6 +227,8 @@ const linuxDylibLocations = { '/usr/lib/llvm-11/lib/', '/usr/lib/llvm-12/lib/', '/usr/lib/llvm-13/lib/', + '/usr/lib/llvm-14/lib/', + '/usr/lib/llvm-15/lib/', '/usr/lib/', '/usr/lib64/', }; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index c5d8d67baa..2a94b853ac 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 7.2.1 +version: 7.2.2 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen From faebd8b42d19f0373ad32b7023f7fae76180a7e3 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Tue, 13 Dec 2022 23:09:08 +1300 Subject: [PATCH 200/276] [ffigen] Allow user compiler options to override built-in options (#495) * Change compiler option order so that user options can override built-in options. * Revert unnecessary order change --- pkgs/ffigen/CHANGELOG.md | 5 +++++ pkgs/ffigen/lib/src/header_parser/parser.dart | 9 ++++++--- pkgs/ffigen/pubspec.yaml | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 40dd82ee69..15ed9657fa 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,8 @@ +# 7.2.3 + +- Change compiler option order so that user options can override built-in + options. + # 7.2.2 - Added newer versions of LLVM, to default `linuxDylibLocations`. diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index 080d2f83c2..b45b0626ad 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -56,15 +56,15 @@ List parseToBindings() { final index = clang.clang_createIndex(0, 0); Pointer> clangCmdArgs = nullptr; - final compilerOpts = List.from(config.compilerOpts); + final compilerOpts = []; - /// Add compiler opt for comment parsing for clang based on config. + // Add compiler opt for comment parsing for clang based on config. if (config.commentType.length != CommentLength.none && config.commentType.style == CommentStyle.any) { compilerOpts.add(strings.fparseAllComments); } - /// If the config targets Objective C, add a compiler opt for it. + // If the config targets Objective C, add a compiler opt for it. if (config.language == Language.objc) { compilerOpts.addAll([ ...strings.clangLangObjC, @@ -72,6 +72,9 @@ List parseToBindings() { ]); } + // Add the user options last so they can override any other options. + compilerOpts.addAll(config.compilerOpts); + _logger.fine('CompilerOpts used: $compilerOpts'); clangCmdArgs = createDynamicStringArray(compilerOpts); final cmdLen = compilerOpts.length; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 2a94b853ac..4c109ec97a 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 7.2.2 +version: 7.2.3 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen From 82c0e16fa93c8910840372e5946d29be8c1b979b Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Tue, 13 Dec 2022 02:26:01 -0800 Subject: [PATCH 201/276] [ffigen] Code cleanup (#496) --- pkgs/ffigen/lib/src/header_parser/parser.dart | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index b45b0626ad..871da44ef2 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -56,24 +56,21 @@ List parseToBindings() { final index = clang.clang_createIndex(0, 0); Pointer> clangCmdArgs = nullptr; - final compilerOpts = []; - - // Add compiler opt for comment parsing for clang based on config. - if (config.commentType.length != CommentLength.none && - config.commentType.style == CommentStyle.any) { - compilerOpts.add(strings.fparseAllComments); - } - - // If the config targets Objective C, add a compiler opt for it. - if (config.language == Language.objc) { - compilerOpts.addAll([ + final compilerOpts = [ + // Add compiler opt for comment parsing for clang based on config. + if (config.commentType.length != CommentLength.none && + config.commentType.style == CommentStyle.any) + strings.fparseAllComments, + + // If the config targets Objective C, add a compiler opt for it. + if (config.language == Language.objc) ...[ ...strings.clangLangObjC, ..._findObjectiveCSysroot(), - ]); - } + ], - // Add the user options last so they can override any other options. - compilerOpts.addAll(config.compilerOpts); + // Add the user options last so they can override any other options. + ...config.compilerOpts + ]; _logger.fine('CompilerOpts used: $compilerOpts'); clangCmdArgs = createDynamicStringArray(compilerOpts); From 4c5f570fd80870ca89158f4a6977817cfb1f5e08 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Fri, 16 Dec 2022 13:55:30 +0530 Subject: [PATCH 202/276] [ffigen] Add new supported typedef - `uintptr_t` (mapped to `ffi.UintPtr`). (#499) --- pkgs/ffigen/CHANGELOG.md | 4 ++++ .../lib/src/code_generator/native_type.dart | 2 ++ .../type_extractor/cxtypekindmap.dart | 1 + pkgs/ffigen/pubspec.yaml | 2 +- .../code_generator_test.dart | 23 +++++++++++++++++++ .../_expected_struct_bindings.dart | 6 +++++ pkgs/ffigen/test/native_test/native_test.c | 2 ++ .../native_test/native_test_bindings.dart | 14 +++++++++++ 8 files changed, 53 insertions(+), 1 deletion(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 15ed9657fa..400cc2f49b 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 7.2.4 + +- Add new supported typedef - `uintptr_t` (mapped to `ffi.UintPtr`). + # 7.2.3 - Change compiler option order so that user options can override built-in diff --git a/pkgs/ffigen/lib/src/code_generator/native_type.dart b/pkgs/ffigen/lib/src/code_generator/native_type.dart index 4be4b16f3a..d76e7e75ea 100644 --- a/pkgs/ffigen/lib/src/code_generator/native_type.dart +++ b/pkgs/ffigen/lib/src/code_generator/native_type.dart @@ -20,6 +20,7 @@ enum SupportedNativeType { Float, Double, IntPtr, + UintPtr, } /// Represents a primitive native type, such as float. @@ -38,6 +39,7 @@ class NativeType extends Type { SupportedNativeType.Float: NativeType._('Float', 'double', '0'), SupportedNativeType.Double: NativeType._('Double', 'double', '0'), SupportedNativeType.IntPtr: NativeType._('IntPtr', 'int', '0'), + SupportedNativeType.UintPtr: NativeType._('UintPtr', 'int', '0'), }; final String _cType; diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart index 41af99a9da..2d25d9f2ab 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/cxtypekindmap.dart @@ -32,6 +32,7 @@ var suportedTypedefToSuportedNativeType = { 'int32_t': SupportedNativeType.Int32, 'int64_t': SupportedNativeType.Int64, 'intptr_t': SupportedNativeType.IntPtr, + 'uintptr_t': SupportedNativeType.UintPtr, }; var supportedTypedefToImportedType = { diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 4c109ec97a..387e08dc85 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 7.2.3 +version: 7.2.4 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen diff --git a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart index 35fa0a9207..e16d3d9dea 100644 --- a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart @@ -149,6 +149,29 @@ void main() { ), ], ), + Struct( + name: 'WithIntPtrUintPtr', + members: [ + Member( + name: 'a', + type: PointerType( + NativeType( + SupportedNativeType.UintPtr, + ), + ), + ), + Member( + name: 'b', + type: PointerType( + PointerType( + NativeType( + SupportedNativeType.IntPtr, + ), + ), + ), + ), + ], + ), ], ); diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart index f84642b090..5668f9ddb9 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart @@ -26,3 +26,9 @@ class WithPointerMember extends ffi.Struct { @ffi.Uint8() external int c; } + +class WithIntPtrUintPtr extends ffi.Struct { + external ffi.Pointer a; + + external ffi.Pointer> b; +} diff --git a/pkgs/ffigen/test/native_test/native_test.c b/pkgs/ffigen/test/native_test/native_test.c index 037a73b193..f971ac6c7f 100644 --- a/pkgs/ffigen/test/native_test/native_test.c +++ b/pkgs/ffigen/test/native_test/native_test.c @@ -27,6 +27,8 @@ int64_t Function1Int64(int64_t x) { return x + 42; } intptr_t Function1IntPtr(intptr_t x) { return x + 42; } +uintptr_t Function1UintPtr(uintptr_t x) { return x + 42; } + float Function1Float(float x) { return x + 42.0f; } double Function1Double(double x) { return x + 42.0; } diff --git a/pkgs/ffigen/test/native_test/native_test_bindings.dart b/pkgs/ffigen/test/native_test/native_test_bindings.dart index 6fd5a6a460..2e8471faaf 100644 --- a/pkgs/ffigen/test/native_test/native_test_bindings.dart +++ b/pkgs/ffigen/test/native_test/native_test_bindings.dart @@ -158,6 +158,20 @@ class NativeLibrary { late final _Function1IntPtr = _Function1IntPtrPtr.asFunction(); + int Function1UintPtr( + int x, + ) { + return _Function1UintPtr( + x, + ); + } + + late final _Function1UintPtrPtr = + _lookup>( + 'Function1UintPtr'); + late final _Function1UintPtr = + _Function1UintPtrPtr.asFunction(); + double Function1Float( double x, ) { From 8f00f5f720b7e95763582d5dfcf64ae0a99ddc81 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Tue, 27 Dec 2022 15:42:59 +0530 Subject: [PATCH 203/276] [ffigen] Update example in README.md (#501) --- pkgs/ffigen/README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 76e944f65c..7e463ceddc 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -22,14 +22,14 @@ ffigen: ``` Output (_generated_bindings.dart_). ```dart -import 'package:ffi/ffi.dart' as pkg_ffi; +import 'dart:ffi' as ffi; class NativeLibrary { - final Pointer Function(String symbolName) + final ffi.Pointer Function(String symbolName) _lookup; - NativeLibrary(DynamicLibrary dynamicLibrary) + NativeLibrary(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; NativeLibrary.fromLookup( - Pointer Function(String symbolName) + ffi.Pointer Function(String symbolName) lookup) : _lookup = lookup; @@ -37,8 +37,9 @@ class NativeLibrary { return _sum(a, b); } - late final _sumPtr = _lookup>('sum'); - late final _sum = _sum_ptr.asFunction(); + late final _sumPtr = _lookup>('sum'); + late final _sum = _sumPtr.asFunction(); +} } ``` ## Using this package From 4e3eeb51b8b4808fdec7d708ab197001f8ae1026 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Jan 2023 15:45:42 +0100 Subject: [PATCH 204/276] [ffigen] Bump actions/checkout from 3.1.0 to 3.2.0 (#502) Bumps [actions/checkout](https://github.com/actions/checkout) from 3.1.0 to 3.2.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8...755da8c3cf115ac066823e79a1e1788f8940201b) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkgs/ffigen/.github/workflows/test-package.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 8ab406c50c..a579370401 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -21,7 +21,7 @@ jobs: matrix: sdk: [stable] steps: - - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d with: sdk: ${{ matrix.sdk }} @@ -41,7 +41,7 @@ jobs: needs: analyze runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d with: sdk: stable @@ -58,7 +58,7 @@ jobs: needs: analyze runs-on: macos-latest steps: - - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d with: sdk: stable @@ -80,7 +80,7 @@ jobs: needs: analyze runs-on: windows-latest steps: - - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d with: sdk: stable @@ -105,7 +105,7 @@ jobs: needs: analyze runs-on: windows-latest steps: - - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b - uses: subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d with: channel: 'master' From d9ae6e2fc1b07ef4742f8d3acd79e05eb9609374 Mon Sep 17 00:00:00 2001 From: Michael Thomsen Date: Mon, 23 Jan 2023 17:27:17 +0300 Subject: [PATCH 205/276] [ffigen] Add a bit more introduction to readme (#505) --- pkgs/ffigen/README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 7e463ceddc..c4f5a0237e 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -4,7 +4,16 @@ Binding generator for [FFI](https://dart.dev/guides/libraries/c-interop) bindings. -> Note: ffigen only supports parsing `C` headers. +> Note: ffigen only supports parsing `C` headers, not `C++` headers. + +This bindings generator can be used to call C code -- or code in another +language that compiles to C modules that follow the C calling convention -- +such as Go or Rust. For more details, see: +https://dart.dev/guides/libraries/c-interop + +ffigen also has experimental support for calling ObjC and Swift code; +for details see: +https://dart.dev/guides/libraries/objective-c-interop ## Example From 55b84ad4f8dd7e89202933d8aae39081bb3bfc20 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 2 Feb 2023 09:12:53 +0100 Subject: [PATCH 206/276] [ffigen] Fix formatting (#509) --- .../lib/src/header_parser/sub_parsers/compounddecl_parser.dart | 2 -- .../lib/src/header_parser/sub_parsers/enumdecl_parser.dart | 1 - .../src/header_parser/sub_parsers/objcinterfacedecl_parser.dart | 1 - pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart | 1 - 4 files changed, 5 deletions(-) diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart index 6d9824790d..c2efed69f8 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart @@ -81,7 +81,6 @@ final _stack = Stack<_ParsedCompound>(); Compound? parseCompoundDeclaration( clang_types.CXCursor cursor, CompoundType compoundType, { - /// Option to ignore declaration filter (Useful in case of extracting /// declarations when they are passed/returned by an included function.) bool ignoreFilter = false, @@ -152,7 +151,6 @@ Compound? parseCompoundDeclaration( void fillCompoundMembersIfNeeded( Compound compound, clang_types.CXCursor cursor, { - /// Option to ignore declaration filter (Useful in case of extracting /// declarations when they are passed/returned by an included function.) bool ignoreFilter = false, diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index 76cccd2ab6..e66781c605 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -32,7 +32,6 @@ final _stack = Stack<_ParsedEnum>(); /// Parses an enum declaration. EnumClass? parseEnumDeclaration( clang_types.CXCursor cursor, { - /// Option to ignore declaration filter (Useful in case of extracting /// declarations when they are passed/returned by an included function.) bool ignoreFilter = false, diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index 64f1e28152..572190504f 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -51,7 +51,6 @@ final _methodStack = Stack<_ParsedObjCMethod>(); Type? parseObjCInterfaceDeclaration( clang_types.CXCursor cursor, { - /// Option to ignore declaration filter (Useful in case of extracting /// declarations when they are passed/returned by an included function.) bool ignoreFilter = false, diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 05691d3d4f..135265fc60 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -24,7 +24,6 @@ const _padding = ' '; /// Converts cxtype to a typestring code_generator can accept. Type getCodeGenType( clang_types.CXType cxtype, { - /// Option to ignore declaration filter (Useful in case of extracting /// declarations when they are passed/returned by an included function.) bool ignoreFilter = true, From bcdbe76bc8c7ba4964342398aabfc3b3f43c5a0b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Feb 2023 09:16:30 +0100 Subject: [PATCH 207/276] [ffigen] Bump actions/checkout from 3.2.0 to 3.3.0 (#507) Bumps [actions/checkout](https://github.com/actions/checkout) from 3.2.0 to 3.3.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/755da8c3cf115ac066823e79a1e1788f8940201b...ac593985615ec2ede58e132d2e21d2b1cbd6127c) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkgs/ffigen/.github/workflows/test-package.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index a579370401..dc2abea29f 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -21,7 +21,7 @@ jobs: matrix: sdk: [stable] steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d with: sdk: ${{ matrix.sdk }} @@ -41,7 +41,7 @@ jobs: needs: analyze runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d with: sdk: stable @@ -58,7 +58,7 @@ jobs: needs: analyze runs-on: macos-latest steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d with: sdk: stable @@ -80,7 +80,7 @@ jobs: needs: analyze runs-on: windows-latest steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d with: sdk: stable @@ -105,7 +105,7 @@ jobs: needs: analyze runs-on: windows-latest steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d with: channel: 'master' From 6c47900ccb389b34e9b346517f70d43b5bfa6ff7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Feb 2023 09:17:25 +0100 Subject: [PATCH 208/276] [ffigen] Bump dart-lang/setup-dart from 1.3 to 1.4 (#508) Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.3 to 1.4. - [Release notes](https://github.com/dart-lang/setup-dart/releases) - [Changelog](https://github.com/dart-lang/setup-dart/blob/main/CHANGELOG.md) - [Commits](https://github.com/dart-lang/setup-dart/compare/6a218f2413a3e78e9087f638a238f6b40893203d...a57a6c04cf7d4840e88432aad6281d1e125f0d46) --- updated-dependencies: - dependency-name: dart-lang/setup-dart dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkgs/ffigen/.github/workflows/test-package.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index dc2abea29f..a9c0cf6eb2 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -22,7 +22,7 @@ jobs: sdk: [stable] steps: - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d + - uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46 with: sdk: ${{ matrix.sdk }} - id: install @@ -42,7 +42,7 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d + - uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46 with: sdk: stable - name: Install dependencies @@ -59,7 +59,7 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d + - uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46 with: sdk: stable - name: Install dependencies @@ -81,7 +81,7 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d + - uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46 with: sdk: stable - name: Install dependencies From 5ab08fdb1f8004d5d05648a3fe1c93a3f83a6c0a Mon Sep 17 00:00:00 2001 From: Nikita Dauhashei Date: Thu, 9 Feb 2023 09:51:36 +0100 Subject: [PATCH 209/276] [ffigen] Add support nested anonymous union/struct (#511) --- pkgs/ffigen/CHANGELOG.md | 4 + pkgs/ffigen/lib/src/code_generator/utils.dart | 5 + .../sub_parsers/compounddecl_parser.dart | 117 +++++++++++------- pkgs/ffigen/lib/src/header_parser/utils.dart | 6 + pkgs/ffigen/pubspec.yaml | 2 +- .../test/header_parser_tests/nested_parsing.h | 20 +++ .../nested_parsing_test.dart | 45 +++++++ 7 files changed, 156 insertions(+), 43 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 400cc2f49b..bd0617dd0e 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 7.2.5 + +- Add support nested anonymous union/struct + # 7.2.4 - Add new supported typedef - `uintptr_t` (mapped to `ffi.UintPtr`). diff --git a/pkgs/ffigen/lib/src/code_generator/utils.dart b/pkgs/ffigen/lib/src/code_generator/utils.dart index c000bdf92e..5c18c7f621 100644 --- a/pkgs/ffigen/lib/src/code_generator/utils.dart +++ b/pkgs/ffigen/lib/src/code_generator/utils.dart @@ -15,6 +15,11 @@ class UniqueNamer { /// /// Adds the resulting name to the used names by default. String makeUnique(String name, [bool addToUsedUpNames = true]) { + // For example, nested structures/unions may not have a name + if (name.isEmpty) { + name = 'unnamed'; + } + var crName = name; var i = 1; while (_usedUpNames.contains(crName)) { diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart index c2efed69f8..5a7709c5b2 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart @@ -44,10 +44,13 @@ class _ParsedCompound { // A struct without any attribute is definitely not packed. #pragma pack(...) // also adds an attribute, but it's unexposed and cannot be travesed. bool hasAttr = false; + // A struct which as a __packed__ attribute is definitely packed. bool hasPackedAttr = false; + // Stores the maximum alignment from all the children. int maxChildAlignment = 0; + // Alignment of this struct. int alignment = 0; @@ -240,50 +243,80 @@ int _compoundMembersVisitor(clang_types.CXCursor cursor, clang_types.CXCursor parent, Pointer clientData) { final parsed = _stack.top; try { - if (cursor.kind == clang_types.CXCursorKind.CXCursor_FieldDecl) { - _logger.finer('===== member: ${cursor.completeStringRepr()}'); - - // Set maxChildAlignValue. - final align = cursor.type().alignment(); - if (align > parsed.maxChildAlignment) { - parsed.maxChildAlignment = align; - } - - final mt = cursor.type().toCodeGenType(); - if (mt is IncompleteArray) { - // TODO(68): Structs with flexible Array Members are not supported. - parsed.flexibleArrayMember = true; - } - if (clang.clang_getFieldDeclBitWidth(cursor) != -1) { - // TODO(84): Struct with bitfields are not suppoorted. - parsed.bitFieldMember = true; - } - if (mt is HandleType) { - parsed.dartHandleMember = true; - } - if (mt.isIncompleteCompound) { - parsed.incompleteCompoundMember = true; - } - if (mt.baseType is UnimplementedType) { - parsed.unimplementedMemberType = true; - } - - parsed.compound.members.add( - Member( - dartDoc: getCursorDocComment( - cursor, - nesting.length + commentPrefix.length, + switch (cursor.kind) { + case clang_types.CXCursorKind.CXCursor_FieldDecl: + _logger.finer('===== member: ${cursor.completeStringRepr()}'); + + // Set maxChildAlignValue. + final align = cursor.type().alignment(); + if (align > parsed.maxChildAlignment) { + parsed.maxChildAlignment = align; + } + + final mt = cursor.type().toCodeGenType(); + if (mt is IncompleteArray) { + // TODO(68): Structs with flexible Array Members are not supported. + parsed.flexibleArrayMember = true; + } + if (clang.clang_getFieldDeclBitWidth(cursor) != -1) { + // TODO(84): Struct with bitfields are not suppoorted. + parsed.bitFieldMember = true; + } + if (mt is HandleType) { + parsed.dartHandleMember = true; + } + if (mt.isIncompleteCompound) { + parsed.incompleteCompoundMember = true; + } + if (mt.baseType is UnimplementedType) { + parsed.unimplementedMemberType = true; + } + + parsed.compound.members.add( + Member( + dartDoc: getCursorDocComment( + cursor, + nesting.length + commentPrefix.length, + ), + originalName: cursor.spelling(), + name: config.structDecl.renameMemberUsingConfig( + parsed.compound.originalName, + cursor.spelling(), + ), + type: mt, ), - originalName: cursor.spelling(), - name: config.structDecl.renameMemberUsingConfig( - parsed.compound.originalName, - cursor.spelling(), + ); + + break; + + case clang_types.CXCursorKind.CXCursor_PackedAttr: + parsed.hasPackedAttr = true; + + break; + case clang_types.CXCursorKind.CXCursor_UnionDecl: + case clang_types.CXCursorKind.CXCursor_StructDecl: + final mt = cursor.type().toCodeGenType(); + + // If the union/struct are anonymous, then we need to add them now, + // otherwise they will be added in the next iteration. + if (!cursor.isAnonymousRecordDecl()) break; + + parsed.compound.members.add( + Member( + dartDoc: getCursorDocComment( + cursor, + nesting.length + commentPrefix.length, + ), + originalName: cursor.spelling(), + name: config.structDecl.renameMemberUsingConfig( + parsed.compound.originalName, + cursor.spelling(), + ), + type: mt, ), - type: mt, - ), - ); - } else if (cursor.kind == clang_types.CXCursorKind.CXCursor_PackedAttr) { - parsed.hasPackedAttr = true; + ); + + break; } } catch (e, s) { _logger.severe(e); diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index 614d5e5a79..d53cb8b523 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -97,6 +97,12 @@ extension CXCursorExt on clang_types.CXCursor { return clang.clang_getCursorType(this); } + /// Determine whether the given cursor + /// represents an anonymous record declaration. + bool isAnonymousRecordDecl() { + return clang.clang_Cursor_isAnonymousRecordDecl(this) == 1; + } + /// Only valid for [clang.CXCursorKind.CXCursor_FunctionDecl]. Type will have /// kind [clang.CXTypeKind.CXType_Invalid] otherwise. clang_types.CXType returnType() { diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 387e08dc85..04b52efaa7 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 7.2.4 +version: 7.2.5 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen diff --git a/pkgs/ffigen/test/header_parser_tests/nested_parsing.h b/pkgs/ffigen/test/header_parser_tests/nested_parsing.h index cb218252af..8557b64d47 100644 --- a/pkgs/ffigen/test/header_parser_tests/nested_parsing.h +++ b/pkgs/ffigen/test/header_parser_tests/nested_parsing.h @@ -40,3 +40,23 @@ struct Struct5{ // Incomplete struct array. struct EmptyStruct b[3]; }; + +struct Struct6 +{ + // An anonymous, unnamed union. + union + { + float a; + }; + + // An unnamed union. + union + { + float b; + } c; + + union + { + float d; + } e; +}; diff --git a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart index 70c205d764..813c74723d 100644 --- a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart @@ -57,6 +57,10 @@ ${strings.structs}: expect(actual.getBindingAsString('Struct5'), expected.getBindingAsString('Struct5')); }); + test('Struct6', () { + expect(actual.getBindingAsString('Struct6'), + expected.getBindingAsString('Struct6')); + }); }); } @@ -110,6 +114,47 @@ Library expectedLibrary() { Struct(name: 'EmptyStruct'), Struct(name: 'Struct4'), Struct(name: 'Struct5'), + Struct( + name: 'Struct6', + members: [ + Member( + name: '', + type: Union( + name: 'UnnamedUnion1', + members: [ + Member( + name: 'a', + type: floatType, + ), + ], + ), + ), + Member( + name: 'c', + type: Union( + name: 'UnnamedUnion2', + members: [ + Member( + name: 'b', + type: floatType, + ), + ], + ), + ), + Member( + name: 'e', + type: Union( + name: 'UnnamedUnion3', + members: [ + Member( + name: 'd', + type: floatType, + ), + ], + ), + ), + ], + ), ], ); } From f27c722c892a1ae3f133134e19426598146a9a11 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Thu, 16 Feb 2023 21:50:23 +0530 Subject: [PATCH 210/276] [ffigen] Fix path normalization for absolute paths and globs starting with ** (#516) --- pkgs/ffigen/CHANGELOG.md | 4 ++++ pkgs/ffigen/lib/src/config_provider/spec_utils.dart | 4 +++- pkgs/ffigen/pubspec.yaml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index bd0617dd0e..2861c6500a 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 7.2.6 + +- Fix path normalization behaviour for absolute paths and globs starting with `**`. + # 7.2.5 - Add support nested anonymous union/struct diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 176646e731..8430c62afb 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -32,8 +32,10 @@ String _replaceSeparators(String path) { /// path is passed in, it is resolved relative to the config path, and the /// absolute path is returned. String _normalizePath(String path, String? configFilename) { + final skipNormalization = + (configFilename == null) || p.isAbsolute(path) || path.startsWith("**"); return _replaceSeparators( - configFilename == null ? path : p.join(p.dirname(configFilename), path)); + skipNormalization ? path : p.join(p.dirname(configFilename), path)); } /// Checks if type of value is [T], logs an error if it's not. diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 04b52efaa7..5dd77d4700 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 7.2.5 +version: 7.2.6 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen From b94aa02bd124c61f09b1c77beff2c6c6cde2247d Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 16 Feb 2023 21:53:44 +0100 Subject: [PATCH 211/276] [ffigen] Bump SDK constraint to 4.0.0 (#517) --- pkgs/ffigen/example/c_json/pubspec.yaml | 2 +- pkgs/ffigen/example/ffinative/pubspec.yaml | 2 +- pkgs/ffigen/example/libclang-example/pubspec.yaml | 2 +- pkgs/ffigen/example/objective_c/pubspec.yaml | 2 +- pkgs/ffigen/example/shared_bindings/pubspec.yaml | 2 +- pkgs/ffigen/example/simple/pubspec.yaml | 2 +- pkgs/ffigen/example/swift/pubspec.yaml | 2 +- pkgs/ffigen/pubspec.yaml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index 7ef1ce8375..3f9c865d82 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -5,7 +5,7 @@ name: c_json_example environment: - sdk: '>=2.17.0 <3.0.0' + sdk: '>=2.17.0 <4.0.0' dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/ffinative/pubspec.yaml b/pkgs/ffigen/example/ffinative/pubspec.yaml index 2132d8b359..9747ec7da8 100644 --- a/pkgs/ffigen/example/ffinative/pubspec.yaml +++ b/pkgs/ffigen/example/ffinative/pubspec.yaml @@ -5,7 +5,7 @@ name: ffinative_example environment: - sdk: '>=2.17.0 <3.0.0' + sdk: '>=2.17.0 <4.0.0' dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index f47795758e..ab3b75cd7f 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -5,7 +5,7 @@ name: libclang_example environment: - sdk: '>=2.17.0 <3.0.0' + sdk: '>=2.17.0 <4.0.0' dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/objective_c/pubspec.yaml b/pkgs/ffigen/example/objective_c/pubspec.yaml index 239fcdcc7b..ab1e395678 100644 --- a/pkgs/ffigen/example/objective_c/pubspec.yaml +++ b/pkgs/ffigen/example/objective_c/pubspec.yaml @@ -5,7 +5,7 @@ name: objective_c_example environment: - sdk: '>=2.17.0 <3.0.0' + sdk: '>=2.17.0 <4.0.0' dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/shared_bindings/pubspec.yaml b/pkgs/ffigen/example/shared_bindings/pubspec.yaml index b89304f2a0..b1b5cfd691 100644 --- a/pkgs/ffigen/example/shared_bindings/pubspec.yaml +++ b/pkgs/ffigen/example/shared_bindings/pubspec.yaml @@ -5,7 +5,7 @@ name: shared_bindings environment: - sdk: '>=2.17.0 <3.0.0' + sdk: '>=2.17.0 <4.0.0' dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index e1a3e14d51..275555422b 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -5,7 +5,7 @@ name: simple_example environment: - sdk: '>=2.17.0 <3.0.0' + sdk: '>=2.17.0 <4.0.0' dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/swift/pubspec.yaml b/pkgs/ffigen/example/swift/pubspec.yaml index f088c220f3..8bd5e710eb 100644 --- a/pkgs/ffigen/example/swift/pubspec.yaml +++ b/pkgs/ffigen/example/swift/pubspec.yaml @@ -5,7 +5,7 @@ name: swift_example environment: - sdk: '>=2.17.0 <3.0.0' + sdk: '>=2.17.0 <4.0.0' dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 5dd77d4700..dbb5194d2d 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -8,7 +8,7 @@ description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen environment: - sdk: '>=2.17.0 <3.0.0' + sdk: '>=2.17.0 <4.0.0' dependencies: ffi: ^2.0.1 From abace99f481eb9e29e1f0cad44ba4d7e3557bd48 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Mar 2023 10:43:41 +0100 Subject: [PATCH 212/276] [ffigen] Bump coverallsapp/github-action from 1.1.3 to 1.2.4 (#523) Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 1.1.3 to 1.2.4. - [Release notes](https://github.com/coverallsapp/github-action/releases) - [Commits](https://github.com/coverallsapp/github-action/compare/9ba913c152ae4be1327bfb9085dc806cedb44057...50c33ad324a9902697adbf2f92c22cf5023eacf1) --- updated-dependencies: - dependency-name: coverallsapp/github-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkgs/ffigen/.github/workflows/test-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index a9c0cf6eb2..67c991cb02 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -71,7 +71,7 @@ jobs: - name: Collect coverage run: ./tool/coverage.sh - name: Upload coverage - uses: coverallsapp/github-action@9ba913c152ae4be1327bfb9085dc806cedb44057 + uses: coverallsapp/github-action@50c33ad324a9902697adbf2f92c22cf5023eacf1 with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: lcov.info From 06d224f09c376f7918cc40922acb04ad82acc5ca Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 6 Mar 2023 13:39:41 +0530 Subject: [PATCH 213/276] [ffigen] Fix macro file parser (#524) --- pkgs/ffigen/CHANGELOG.md | 4 ++++ .../header_parser/sub_parsers/macro_parser.dart | 7 +++---- pkgs/ffigen/lib/src/header_parser/utils.dart | 11 ++++------- pkgs/ffigen/pubspec.yaml | 2 +- pkgs/ffigen/test/header_parser_tests/macros.h | 13 +++++++++++++ .../test/header_parser_tests/macros_test.dart | 15 +++++++++++++++ 6 files changed, 40 insertions(+), 12 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 2861c6500a..5144ff00b3 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 7.2.7 + +- Fix some macros not being generated in some cases due to relative header paths. + # 7.2.6 - Fix path normalization behaviour for absolute paths and globs starting with `**`. diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart index 7478ea825d..535e46d970 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/macro_parser.dart @@ -68,9 +68,6 @@ List? parseSavedMacros() { var cmdLen = 0; final compilerOpts = config.compilerOpts; - config.headers.entryPoints.followedBy([file.path]).forEach((entryFile) { - compilerOpts.add("-imacros$entryFile"); - }); clangCmdArgs = createDynamicStringArray(compilerOpts); cmdLen = config.compilerOpts.length; @@ -87,6 +84,7 @@ List? parseSavedMacros() { if (tu == nullptr) { _logger.severe('Unable to parse Macros.'); } else { + logTuDiagnostics(tu, _logger, file.path, logLevel: Level.FINEST); final rootCursor = clang.clang_getTranslationUnitCursor(tu); final resultCode = clang.clang_visitChildren( @@ -205,7 +203,8 @@ File createFileForMacros() { // Write file contents. final sb = StringBuffer(); for (final h in config.headers.entryPoints) { - sb.writeln('#include "$h"'); + final fullHeaderPath = File(h).absolute.path; + sb.writeln('#include "$fullHeaderPath"'); } _macroVarNames = {}; diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index d53cb8b523..355bf3ab79 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -30,16 +30,13 @@ void visitChildrenResultChecker(int resultCode) { /// Logs the warnings/errors returned by clang for a translation unit. void logTuDiagnostics( - Pointer tu, - Logger logger, - String header, -) { + Pointer tu, Logger logger, String header, + {Level logLevel = Level.SEVERE}) { final total = clang.clang_getNumDiagnostics(tu); if (total == 0) { return; } - - logger.severe('Header $header: Total errors/warnings: $total.'); + logger.log(logLevel, 'Header $header: Total errors/warnings: $total.'); for (var i = 0; i < total; i++) { final diag = clang.clang_getDiagnostic(tu, i); final cxstring = clang.clang_formatDiagnostic( @@ -50,7 +47,7 @@ void logTuDiagnostics( clang_types .CXDiagnosticDisplayOptions.CXDiagnostic_DisplayCategoryName, ); - logger.severe(' ' + cxstring.toStringAndDispose()); + logger.log(logLevel, ' ' + cxstring.toStringAndDispose()); clang.clang_disposeDiagnostic(diag); } } diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index dbb5194d2d..015c592e3f 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 7.2.6 +version: 7.2.7 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen diff --git a/pkgs/ffigen/test/header_parser_tests/macros.h b/pkgs/ffigen/test/header_parser_tests/macros.h index 90bbd453d3..5cae8374bf 100644 --- a/pkgs/ffigen/test/header_parser_tests/macros.h +++ b/pkgs/ffigen/test/header_parser_tests/macros.h @@ -30,3 +30,16 @@ #define TEST14 INFINITY #define TEST15 -INFINITY #define TEST16 NAN + + +// Inside include guard. +#ifndef __TEST_INCLUDE_GUARD_1__ +#define __TEST_INCLUDE_GUARD_1__ + +#define TEST17 TEST_FUNCTION_MACRO(0) +#define TEST18 TEST_FUNCTION_MACRO(1) +#define TEST19 TEST_FUNCTION_MACRO(2) + +#define TEST_FUNCTION_MACRO(x) ((unsigned long)((x) << (2))) + +#endif /* __TEST_INCLUDE_GUARD_1__ */ diff --git a/pkgs/ffigen/test/header_parser_tests/macros_test.dart b/pkgs/ffigen/test/header_parser_tests/macros_test.dart index d615b2643f..689a289808 100644 --- a/pkgs/ffigen/test/header_parser_tests/macros_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/macros_test.dart @@ -98,6 +98,18 @@ ${strings.headers}: expect(actual.getBindingAsString('TEST16'), expected.getBindingAsString('TEST16')); }); + test('TEST17', () { + expect(actual.getBindingAsString('TEST17'), + expected.getBindingAsString('TEST17')); + }); + test('TEST18', () { + expect(actual.getBindingAsString('TEST18'), + expected.getBindingAsString('TEST18')); + }); + test('TEST19', () { + expect(actual.getBindingAsString('TEST19'), + expected.getBindingAsString('TEST19')); + }); }); } @@ -125,6 +137,9 @@ Library expectedLibrary() { rawType: 'double', rawValue: strings.doubleNegativeInfinity), Constant(name: 'TEST16', rawType: 'double', rawValue: strings.doubleNaN), + Constant(name: 'TEST17', rawType: 'int', rawValue: "0"), + Constant(name: 'TEST18', rawType: 'int', rawValue: "4"), + Constant(name: 'TEST19', rawType: 'int', rawValue: "8"), ], ); } From 11611875815eb7816d1266d9e84db934c0a92257 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Wed, 8 Mar 2023 21:40:56 +0100 Subject: [PATCH 214/276] [ffigen] Bump dependencies and fix lints (#527) --- pkgs/ffigen/example/c_json/main.dart | 4 +- pkgs/ffigen/example/c_json/pubspec.yaml | 2 +- .../example/libclang-example/pubspec.yaml | 2 +- .../lib/generated/a_shared_b_gen.dart | 14 ++-- .../example/shared_bindings/pubspec.yaml | 5 +- pkgs/ffigen/example/simple/pubspec.yaml | 2 +- .../lib/src/code_generator/compound.dart | 4 +- .../lib/src/code_generator/enum_class.dart | 6 +- .../objc_built_in_functions.dart | 2 +- .../src/code_generator/objc_interface.dart | 4 +- .../lib/src/config_provider/config.dart | 11 ++- .../lib/src/config_provider/path_finder.dart | 6 +- .../lib/src/config_provider/spec_utils.dart | 70 +++++++++---------- .../sub_parsers/objc_block_parser.dart | 4 +- .../type_extractor/extractor.dart | 6 +- pkgs/ffigen/lib/src/header_parser/utils.dart | 2 +- pkgs/ffigen/lib/src/strings.dart | 2 +- pkgs/ffigen/pubspec.yaml | 4 +- .../packed_struct_override_test.dart | 6 +- 19 files changed, 79 insertions(+), 77 deletions(-) diff --git a/pkgs/ffigen/example/c_json/main.dart b/pkgs/ffigen/example/c_json/main.dart index 99042ebbd0..adbdac6bf6 100644 --- a/pkgs/ffigen/example/c_json/main.dart +++ b/pkgs/ffigen/example/c_json/main.dart @@ -40,8 +40,8 @@ void main() { print('Json converted successfully'); } else { print("Converted json doesn't match\n"); - print('Actual:\n' + dartJson.toString() + '\n'); - print('Expected:\n' + json.decode(jsonString).toString()); + print('Actual:\n$dartJson\n'); + print('Expected:\n${json.decode(jsonString)}'); } } diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index 3f9c865d82..7b76a5c212 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -14,7 +14,7 @@ dependencies: dev_dependencies: ffigen: path: '../../' - lints: ^1.0.1 + lints: ^2.0.1 ffigen: output: 'cjson_generated_bindings.dart' diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index ab3b75cd7f..bff5a3cbe8 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: dev_dependencies: ffigen: path: '../../' - lints: ^1.0.1 + lints: ^2.0.1 ffigen: output: 'generated_bindings.dart' diff --git a/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart b/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart index fbf9c16019..1a221f213e 100644 --- a/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart +++ b/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart @@ -4,7 +4,7 @@ // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; -import 'package:shared_bindings/generated/base_gen.dart' as _imp1; +import 'package:shared_bindings/generated/base_gen.dart' as imp1; /// Bindings to `headers/a.h` with shared definitions from `headers/base.h`. class NativeLibraryASharedB { @@ -31,9 +31,9 @@ class NativeLibraryASharedB { late final _a_func1 = _a_func1Ptr.asFunction(); void a_func2( - _imp1.BaseStruct2 s, - _imp1.BaseUnion2 u, - _imp1.BaseTypedef2 t, + imp1.BaseStruct2 s, + imp1.BaseUnion2 u, + imp1.BaseTypedef2 t, ) { return _a_func2( s, @@ -44,10 +44,10 @@ class NativeLibraryASharedB { late final _a_func2Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(_imp1.BaseStruct2, _imp1.BaseUnion2, - _imp1.BaseTypedef2)>>('a_func2'); + ffi.Void Function(imp1.BaseStruct2, imp1.BaseUnion2, + imp1.BaseTypedef2)>>('a_func2'); late final _a_func2 = _a_func2Ptr.asFunction< - void Function(_imp1.BaseStruct2, _imp1.BaseUnion2, _imp1.BaseTypedef2)>(); + void Function(imp1.BaseStruct2, imp1.BaseUnion2, imp1.BaseTypedef2)>(); } class A_Struct1 extends ffi.Struct { diff --git a/pkgs/ffigen/example/shared_bindings/pubspec.yaml b/pkgs/ffigen/example/shared_bindings/pubspec.yaml index b1b5cfd691..fbe942e4ae 100644 --- a/pkgs/ffigen/example/shared_bindings/pubspec.yaml +++ b/pkgs/ffigen/example/shared_bindings/pubspec.yaml @@ -8,8 +8,11 @@ environment: sdk: '>=2.17.0 <4.0.0' dependencies: + cli_util: ^0.4.0 ffi: ^2.0.1 + path: ^1.8.0 + dev_dependencies: ffigen: path: '../../' - lints: ^1.0.1 + lints: ^2.0.1 diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index 275555422b..33b93ebae4 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: dev_dependencies: ffigen: path: '../../' - lints: ^1.0.1 + lints: ^2.0.1 ffigen: name: NativeLibrary diff --git a/pkgs/ffigen/lib/src/code_generator/compound.dart b/pkgs/ffigen/lib/src/code_generator/compound.dart index 70a1cd62db..2c915a2819 100644 --- a/pkgs/ffigen/lib/src/code_generator/compound.dart +++ b/pkgs/ffigen/lib/src/code_generator/compound.dart @@ -141,8 +141,8 @@ abstract class Compound extends BindingType { s.write('${m.name};\n\n'); } else { if (m.dartDoc != null) { - s.write(depth + '/// '); - s.writeAll(m.dartDoc!.split('\n'), '\n' + depth + '/// '); + s.write('$depth/// '); + s.writeAll(m.dartDoc!.split('\n'), '\n$depth/// '); s.write('\n'); } if (!sameDartAndCType(m.type, w)) { diff --git a/pkgs/ffigen/lib/src/code_generator/enum_class.dart b/pkgs/ffigen/lib/src/code_generator/enum_class.dart index 4e8ec3aac2..081c864f23 100644 --- a/pkgs/ffigen/lib/src/code_generator/enum_class.dart +++ b/pkgs/ffigen/lib/src/code_generator/enum_class.dart @@ -61,11 +61,11 @@ class EnumClass extends BindingType { for (final ec in enumConstants) { final enumValueName = localUniqueNamer.makeUnique(ec.name); if (ec.dartDoc != null) { - s.write(depth + '/// '); - s.writeAll(ec.dartDoc!.split('\n'), '\n' + depth + '/// '); + s.write('$depth/// '); + s.writeAll(ec.dartDoc!.split('\n'), '\n$depth/// '); s.write('\n'); } - s.write(depth + 'static const int $enumValueName = ${ec.value};\n'); + s.write('${depth}static const int $enumValueName = ${ec.value};\n'); } s.write('}\n\n'); diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index e7f5bd5ce7..ebb4b207c6 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -99,7 +99,7 @@ $objType $name(String name) { Func getMsgSendFunc(Type returnType, List params) { var key = returnType.cacheKey(); for (final p in params) { - key += ' ' + p.type.cacheKey(); + key += ' ${p.type.cacheKey()}'; } return _msgSendFuncs[key] ??= Func( name: '_objc_msgSend_${_msgSendFuncs.length}', diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 8ca0b8e71a..2cf44af1d3 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -81,7 +81,7 @@ class ObjCInterface extends BindingType { (_getConvertedType(p.type, w, name) + (p.isNullable ? "? " : " ") + p.name))); - return '(' + stringParams.join(", ") + ')'; + return '(${stringParams.join(", ")})'; } final s = StringBuffer(); @@ -364,7 +364,7 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { Type type, Writer w, String enclosingClass, bool isNullableReturn) { final result = _getConvertedType(type, w, enclosingClass); if (isNullableReturn) { - return result + "?"; + return "$result?"; } return result; } diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 9c094ed41f..6290bac811 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -178,7 +178,7 @@ class Config { factory Config.fromYaml(YamlMap map, {String? filename, PackageConfig? packageConfig}) { final configspecs = Config._(filename, packageConfig); - _logger.finest('Config Map: ' + map.toString()); + _logger.finest('Config Map: $map'); final specs = configspecs._getSpecs(); @@ -213,15 +213,14 @@ class Config { /// Validates Yaml according to given specs. bool _checkConfigs(YamlMap map, Map, Specification> specs) { - var _result = true; + var result = true; for (final key in specs.keys) { final spec = specs[key]; if (checkKeyInYaml(key, map)) { - _result = - _result && spec!.validator(key, getKeyValueFromYaml(key, map)); + result = result && spec!.validator(key, getKeyValueFromYaml(key, map)); } else if (spec!.requirement == Requirement.yes) { _logger.severe("Key '$key' is required."); - _result = false; + result = false; } else if (spec.requirement == Requirement.prefer) { _logger.warning("Prefer adding Key '$key' to your config."); } @@ -229,7 +228,7 @@ class Config { // Warn about unknown keys. warnUnknownKeys(specs.keys.toList(), map); - return _result; + return result; } /// Extracts variables from Yaml according to given specs. diff --git a/pkgs/ffigen/lib/src/config_provider/path_finder.dart b/pkgs/ffigen/lib/src/config_provider/path_finder.dart index 3f6a59760c..715e1ac1e1 100644 --- a/pkgs/ffigen/lib/src/config_provider/path_finder.dart +++ b/pkgs/ffigen/lib/src/config_provider/path_finder.dart @@ -20,7 +20,7 @@ List getCStandardLibraryHeadersForMac() { '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include'; if (Directory(systemHeaders).existsSync()) { _logger.fine('Added $systemHeaders to compiler-opts.'); - includePaths.add('-I' + systemHeaders); + includePaths.add('-I$systemHeaders'); } /// Find headers from XCode or LLVM installed via brew. @@ -39,7 +39,7 @@ List getCStandardLibraryHeadersForMac() { final path = p.join(searchPath, version, 'include'); if (Directory(path).existsSync()) { _logger.fine('Added stdlib path: $path to compiler-opts.'); - includePaths.add('-I' + path); + includePaths.add('-I$path'); return includePaths; } } @@ -51,7 +51,7 @@ List getCStandardLibraryHeadersForMac() { '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Headers/'; if (Directory(cmdLineToolHeaders).existsSync()) { _logger.fine('Added stdlib path: $cmdLineToolHeaders to compiler-opts.'); - includePaths.add('-I' + cmdLineToolHeaders); + includePaths.add('-I$cmdLineToolHeaders'); return includePaths; } diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 8430c62afb..9b03ebb622 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -82,13 +82,13 @@ dynamic getKeyValueFromYaml(List key, YamlMap map) { void warnUnknownKeys(List> allowedKeyList, YamlMap configKeyMap) { final allowedKeyMap = {}; for (final specKeys in allowedKeyList) { - var _item = allowedKeyMap; + var item = allowedKeyMap; for (final specSubKey in specKeys) { - _item.putIfAbsent(specSubKey, () => {}); - _item = _item[specSubKey] as Map; + item.putIfAbsent(specSubKey, () => {}); + item = item[specSubKey] as Map; } // Add empty key to mark that any sub-keys of this key are allowed. - _item[''] = {}; + item[''] = {}; } _warnUnknownKeysInMap(allowedKeyMap, configKeyMap, []); } @@ -379,7 +379,7 @@ CompilerOptsAuto compilerOptsAutoExtractor(dynamic value) { } bool compilerOptsAutoValidator(List name, dynamic value) { - var _result = true; + var result = true; if (!checkType(name, value)) { return false; @@ -395,19 +395,19 @@ bool compilerOptsAutoValidator(List name, dynamic value) { if (inckey == strings.includeCStdLib) { if (!checkType( [...name, oskey, inckey as String], value[oskey][inckey])) { - _result = false; + result = false; } } else { _logger.severe("Unknown key '$inckey' in '$name -> $oskey."); - _result = false; + result = false; } } } else { _logger.severe("Unknown key '$oskey' in '$name'."); - _result = false; + result = false; } } - return _result; + return result; } Headers headersExtractor(dynamic yamlConfig, String? configFilename) { @@ -814,32 +814,32 @@ Declaration declarationConfigExtractor(dynamic yamlMap) { } bool declarationConfigValidator(List name, dynamic value) { - var _result = true; + var result = true; if (value is YamlMap) { for (final key in value.keys) { if (key == strings.include || key == strings.exclude) { if (!checkType([...name, key as String], value[key])) { - _result = false; + result = false; } } else if (key == strings.rename) { if (!checkType([...name, key as String], value[key])) { - _result = false; + result = false; } else { for (final subkey in (value[key] as YamlMap).keys) { if (!checkType( [...name, key, subkey as String], value[key][subkey])) { - _result = false; + result = false; } } } } else if (key == strings.memberRename) { if (!checkType([...name, key as String], value[key])) { - _result = false; + result = false; } else { for (final declNameKey in (value[key] as YamlMap).keys) { if (!checkType([...name, key, declNameKey as String], value[key][declNameKey])) { - _result = false; + result = false; } else { for (final memberNameKey in ((value[key] as YamlMap)[declNameKey] as YamlMap).keys) { @@ -849,7 +849,7 @@ bool declarationConfigValidator(List name, dynamic value) { declNameKey, memberNameKey as String, ], value[key][declNameKey][memberNameKey])) { - _result = false; + result = false; } } } @@ -857,17 +857,17 @@ bool declarationConfigValidator(List name, dynamic value) { } } else if (key == strings.symbolAddress) { if (!checkType([...name, key as String], value[key])) { - _result = false; + result = false; } else { for (final subkey in (value[key] as YamlMap).keys) { if (subkey == strings.include || subkey == strings.exclude) { if (!checkType( [...name, key, subkey as String], value[key][subkey])) { - _result = false; + result = false; } } else { _logger.severe("Unknown key '$subkey' in '$name -> $key'."); - _result = false; + result = false; } } } @@ -875,59 +875,59 @@ bool declarationConfigValidator(List name, dynamic value) { } } else { _logger.severe("Expected value '$name' to be a Map."); - _result = false; + result = false; } - return _result; + return result; } Includer exposeFunctionTypeExtractor(dynamic value) => _extractIncluderFromYaml(value); bool exposeFunctionTypeValidator(List name, dynamic value) { - var _result = true; + var result = true; if (!checkType(name, value)) { - _result = false; + result = false; } else { final mp = value as YamlMap; for (final key in mp.keys) { if (key == strings.include || key == strings.exclude) { if (!checkType([...name, key as String], value[key])) { - _result = false; + result = false; } } else { _logger.severe("Unknown subkey '$key' in '$name'."); - _result = false; + result = false; } } } - return _result; + return result; } Includer leafFunctionExtractor(dynamic value) => _extractIncluderFromYaml(value); bool leafFunctionValidator(List name, dynamic value) { - var _result = true; + var result = true; if (!checkType(name, value)) { - _result = false; + result = false; } else { final mp = value as YamlMap; for (final key in mp.keys) { if (key == strings.include || key == strings.exclude) { if (!checkType([...name, key as String], value[key])) { - _result = false; + result = false; } } else { _logger.severe("Unknown subkey '$key' in '$name'."); - _result = false; + result = false; } } } - return _result; + return result; } SupportedNativeType nativeSupportedType(int value, {bool signed = true}) { @@ -1059,21 +1059,21 @@ StructPackingOverride structPackingOverrideExtractor(dynamic value) { } bool structPackingOverrideValidator(List name, dynamic value) { - var _result = true; + var result = true; if (!checkType([...name], value)) { - _result = false; + result = false; } else { for (final key in (value as YamlMap).keys) { if (!(strings.packingValuesMap.keys.contains(value[key]))) { _logger.severe( "'$name -> $key' must be one of the following - ${strings.packingValuesMap.keys.toList()}"); - _result = false; + result = false; } } } - return _result; + return result; } FfiNativeConfig ffiNativeExtractor(dynamic yamlConfig) { diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objc_block_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objc_block_parser.dart index 83f82234a9..f7ac6628c6 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objc_block_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objc_block_parser.dart @@ -22,9 +22,9 @@ ObjCBlock parseObjCBlock(clang_types.CXType cxtype) { // Create a fake USR code for the block. This code is used to dedupe blocks // with the same signature. - var usr = 'objcBlock: ' + returnType.cacheKey(); + var usr = 'objcBlock: ${returnType.cacheKey()}'; for (final type in argTypes) { - usr += ' ' + type.cacheKey(); + usr += ' ${type.cacheKey()}'; } _logger.fine('++++ Adding ObjC block: ' diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 135265fc60..d6b87f27c9 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -296,7 +296,7 @@ Type? _extractfromRecord(clang_types.CXType cxtype, clang_types.CXCursor cursor, // Used for function pointer arguments. Type _extractFromFunctionProto(clang_types.CXType cxtype) { - final _parameters = []; + final parameters = []; final totalArgs = clang.clang_getNumArgTypes(cxtype); for (var i = 0; i < totalArgs; i++) { final t = clang.clang_getArgType(cxtype, i); @@ -309,13 +309,13 @@ Type _extractFromFunctionProto(clang_types.CXType cxtype) { return UnimplementedType('Function parameter has an unsupported type.'); } - _parameters.add( + parameters.add( Parameter(name: '', type: pt), ); } return NativeFunc(FunctionType( - parameters: _parameters, + parameters: parameters, returnType: clang.clang_getResultType(cxtype).toCodeGenType(), )); } diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index 355bf3ab79..0b4770f92d 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -47,7 +47,7 @@ void logTuDiagnostics( clang_types .CXDiagnosticDisplayOptions.CXDiagnostic_DisplayCategoryName, ); - logger.log(logLevel, ' ' + cxstring.toStringAndDispose()); + logger.log(logLevel, ' ${cxstring.toStringAndDispose()}'); clang.clang_disposeDiagnostic(diag); } } diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 180c198465..e0f276190e 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -151,7 +151,7 @@ const files = "files"; const usedConfig = "used-config"; const import = 'import'; -const defaultSymbolFileImportPrefix = '_imp'; +const defaultSymbolFileImportPrefix = 'imp'; // Sub keys of import. const symbolFilesImport = 'symbol-files'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 015c592e3f..96c6027996 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -17,12 +17,12 @@ dependencies: quiver: ^3.0.0 args: ^2.0.0 logging: ^1.0.0 - cli_util: ^0.3.0 + cli_util: ^0.4.0 glob: ^2.0.0 file: ^6.0.0 package_config: ^2.1.0 yaml_edit: ^2.0.3 dev_dependencies: - lints: ^1.0.1 + lints: ^2.0.1 test: ^1.16.2 diff --git a/pkgs/ffigen/test/config_tests/packed_struct_override_test.dart b/pkgs/ffigen/test/config_tests/packed_struct_override_test.dart index 9f9726dfce..cb0bf3c341 100644 --- a/pkgs/ffigen/test/config_tests/packed_struct_override_test.dart +++ b/pkgs/ffigen/test/config_tests/packed_struct_override_test.dart @@ -26,15 +26,15 @@ ${strings.structs}: '''; expect( () => Config.fromYaml( - yaml.loadYaml(baseYaml + "'.*': null") as yaml.YamlMap), + yaml.loadYaml("$baseYaml'.*': null") as yaml.YamlMap), throwsA(TypeMatcher())); expect( () => Config.fromYaml( - yaml.loadYaml(baseYaml + "'.*': 3") as yaml.YamlMap), + yaml.loadYaml("$baseYaml'.*': 3") as yaml.YamlMap), throwsA(TypeMatcher())); expect( () => Config.fromYaml( - yaml.loadYaml(baseYaml + "'.*': 32") as yaml.YamlMap), + yaml.loadYaml("$baseYaml'.*': 32") as yaml.YamlMap), throwsA(TypeMatcher())); }); test('Override values', () { From b26e13d9290086a2dfc7eb30d418e973c30e93f6 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Fri, 10 Mar 2023 14:29:58 +0530 Subject: [PATCH 215/276] [ffigen] Automatically generate `ignore_for_file: type=lint` if not specified in preamble. (#532) --- pkgs/ffigen/CHANGELOG.md | 4 ++++ pkgs/ffigen/example/c_json/cjson_generated_bindings.dart | 1 + pkgs/ffigen/example/ffinative/generated_bindings.dart | 1 + pkgs/ffigen/example/libclang-example/generated_bindings.dart | 1 + pkgs/ffigen/example/objective_c/avf_audio_bindings.dart | 1 + pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart | 1 + .../shared_bindings/lib/generated/a_shared_b_gen.dart | 1 + .../example/shared_bindings/lib/generated/base_gen.dart | 1 + pkgs/ffigen/example/simple/generated_bindings.dart | 1 + pkgs/ffigen/example/swift/swift_api_bindings.dart | 1 + pkgs/ffigen/lib/src/code_generator/writer.dart | 5 +++++ .../lib/src/header_parser/clang_bindings/clang_bindings.dart | 1 + pkgs/ffigen/pubspec.yaml | 2 +- .../_expected_boolean_dartbool_bindings.dart | 1 + .../expected_bindings/_expected_constant_bindings.dart | 1 + .../expected_bindings/_expected_enumclass_bindings.dart | 1 + .../expected_bindings/_expected_function_bindings.dart | 1 + .../_expected_function_n_struct_bindings.dart | 1 + .../expected_bindings/_expected_global_bindings.dart | 1 + .../_expected_internal_conflict_resolution_bindings.dart | 1 + .../expected_bindings/_expected_packed_structs_bindings.dart | 1 + .../expected_bindings/_expected_sort_bindings_bindings.dart | 1 + .../expected_bindings/_expected_struct_bindings.dart | 1 + .../expected_bindings/_expected_typealias_bindings.dart | 1 + .../expected_bindings/_expected_unions_bindings.dart | 1 + .../_expected_decl_symbol_address_collision_bindings.dart | 1 + .../_expected_decl_type_name_collision_bindings.dart | 1 + .../expected_bindings/_expected_comment_markup_bindings.dart | 1 + .../expected_bindings/_expected_dart_handle_bindings.dart | 1 + .../expected_bindings/_expected_forward_decl_bindings.dart | 1 + .../expected_bindings/_expected_functions_bindings.dart | 1 + .../expected_bindings/_expected_imported_types_bindings.dart | 1 + .../_expected_native_func_typedef_bindings.dart | 1 + .../_expected_opaque_dependencies_bindings.dart | 1 + .../expected_bindings/_expected_packed_structs_bindings.dart | 1 + .../expected_bindings/_expected_regress_384_bindings.dart | 1 + .../expected_bindings/_expected_typedef_bindings.dart | 1 + .../expected_bindings/_expected_unions_bindings.dart | 1 + .../large_integration_tests/_expected_cjson_bindings.dart | 1 + .../large_integration_tests/_expected_libclang_bindings.dart | 1 + .../large_integration_tests/_expected_sqlite_bindings.dart | 1 + pkgs/ffigen/test/native_test/native_test_bindings.dart | 1 + 42 files changed, 49 insertions(+), 1 deletion(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 5144ff00b3..d507dde168 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 7.2.8 + +- Automatically generate `ignore_for_file: type=lint` if not specified in preamble. + # 7.2.7 - Fix some macros not being generated in some cases due to relative header paths. diff --git a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart index 57b66722e1..ad704b5719 100644 --- a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart +++ b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart @@ -23,6 +23,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; /// Holds bindings to cJSON. diff --git a/pkgs/ffigen/example/ffinative/generated_bindings.dart b/pkgs/ffigen/example/ffinative/generated_bindings.dart index 1bb65d0f6c..1529564609 100644 --- a/pkgs/ffigen/example/ffinative/generated_bindings.dart +++ b/pkgs/ffigen/example/ffinative/generated_bindings.dart @@ -3,6 +3,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; /// Adds 2 integers. diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index c114c5e6b0..e41aaf945f 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -8,6 +8,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; import 'custom_import.dart' as custom_import; diff --git a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart index 9fbc212868..972e8fedcb 100644 --- a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart +++ b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart @@ -3,6 +3,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; import 'package:ffi/ffi.dart' as pkg_ffi; diff --git a/pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart b/pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart index 631aff8b73..6cd4f8a015 100644 --- a/pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart +++ b/pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart @@ -3,6 +3,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; /// Bindings to `headers/a.h`. diff --git a/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart b/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart index 1a221f213e..1346bec6d0 100644 --- a/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart +++ b/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart @@ -3,6 +3,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; import 'package:shared_bindings/generated/base_gen.dart' as imp1; diff --git a/pkgs/ffigen/example/shared_bindings/lib/generated/base_gen.dart b/pkgs/ffigen/example/shared_bindings/lib/generated/base_gen.dart index d4cfdb5cbd..b31c2e88d1 100644 --- a/pkgs/ffigen/example/shared_bindings/lib/generated/base_gen.dart +++ b/pkgs/ffigen/example/shared_bindings/lib/generated/base_gen.dart @@ -3,6 +3,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; /// Bindings to `headers/base.h`. diff --git a/pkgs/ffigen/example/simple/generated_bindings.dart b/pkgs/ffigen/example/simple/generated_bindings.dart index b4c885a1da..71f0414a8f 100644 --- a/pkgs/ffigen/example/simple/generated_bindings.dart +++ b/pkgs/ffigen/example/simple/generated_bindings.dart @@ -1,6 +1,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; /// Bindings to `headers/example.h`. diff --git a/pkgs/ffigen/example/swift/swift_api_bindings.dart b/pkgs/ffigen/example/swift/swift_api_bindings.dart index 0221cc8cad..383944f1f0 100644 --- a/pkgs/ffigen/example/swift/swift_api_bindings.dart +++ b/pkgs/ffigen/example/swift/swift_api_bindings.dart @@ -7,6 +7,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; import 'package:ffi/ffi.dart' as pkg_ffi; diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index 748275d26e..d20db66c17 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -212,6 +212,11 @@ class Writer { result.write(makeDoc( 'AUTO GENERATED FILE, DO NOT EDIT.\n\nGenerated by `package:ffigen`.')); + // Write lint ignore if not specified by user already. + if (!RegExp(r'ignore_for_file:\s*type\s*=\s*lint').hasMatch(header ?? '')) { + result.write(makeDoc('ignore_for_file: type=lint')); + } + /// Write [lookUpBindings]. if (lookUpBindings.isNotEmpty) { // Write doc comment for wrapper class. diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 5bb0d639fd..6b77794381 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -8,6 +8,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; /// Holds bindings to LibClang. diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 96c6027996..4f647fbc8b 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 7.2.7 +version: 7.2.8 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart index 188f972165..0bc046c189 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart @@ -1,6 +1,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; class Bindings { diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart index 88d27fac2a..a425c42201 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart @@ -3,6 +3,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint const int test1 = 20; diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart index 45a2b209cd..1f759d57f1 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart @@ -3,6 +3,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint /// test line 1 /// test line 2 abstract class Constants { diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart index ada968c86e..ae9fc13519 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart @@ -1,6 +1,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; class Bindings { diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart index f539b01cab..cad19809fb 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart @@ -1,6 +1,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; class Bindings { diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart index 0a531fac85..f3f3f12099 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart @@ -1,6 +1,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; class Bindings { diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart index b6e1378385..edc39352c4 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart @@ -3,6 +3,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; class init_dylib1 { diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart index 4aea89af06..e703e283d8 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart @@ -1,6 +1,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; class NoPacking extends ffi.Struct { diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart index cbae1f827e..3a9aa67b62 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart @@ -1,6 +1,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; class Bindings { diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart index 5668f9ddb9..f8482e74cf 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart @@ -1,6 +1,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; /// Just a test struct diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart index f49d183080..00306c6d0c 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart @@ -3,6 +3,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; class Bindings { diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart index cdd8632caf..1865919dc0 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart @@ -1,6 +1,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; class Struct1 extends ffi.Struct { diff --git a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart index b45cdcd88d..3b3e791c5e 100644 --- a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart +++ b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart @@ -3,6 +3,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; class Bindings1 { diff --git a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_type_name_collision_bindings.dart b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_type_name_collision_bindings.dart index 4106ae2f3b..f7207cf3f7 100644 --- a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_type_name_collision_bindings.dart +++ b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_type_name_collision_bindings.dart @@ -3,6 +3,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; class A extends ffi.Struct { diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart index 4b5a35a169..ea88b5b31c 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart @@ -1,6 +1,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; /// Comment Markup Test diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart index d268b653fe..f51bf57f70 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart @@ -1,6 +1,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; /// Dart_Handle Test diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart index 98f2ddf000..81cb2e3602 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart @@ -1,6 +1,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; /// Forward Declaration Test diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart index acd30181ee..f9e8c1ab4a 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart @@ -3,6 +3,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; /// Functions Test diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_imported_types_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_imported_types_bindings.dart index 80d1217d48..ab0fc5a238 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_imported_types_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_imported_types_bindings.dart @@ -3,6 +3,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; /// Imported types test diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart index 6be2cfb5b6..7153ce4780 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart @@ -1,6 +1,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; /// Native Func Typedef Test. diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart index 1faa573338..c53f04f46e 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart @@ -1,6 +1,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; /// Opaque Dependencies Test diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_packed_structs_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_packed_structs_bindings.dart index 49d4df57b4..9dfabd26a4 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_packed_structs_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_packed_structs_bindings.dart @@ -1,6 +1,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; class NormalStruct1 extends ffi.Struct { diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_regress_384_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_regress_384_bindings.dart index 745cd34e5c..ab9ec8f1c2 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_regress_384_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_regress_384_bindings.dart @@ -1,6 +1,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; /// Regression test for #384 diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart index 546f1ce0cf..412acb228f 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart @@ -3,6 +3,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; class Bindings { diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart index 6a37746767..585ab9a4a2 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart @@ -1,6 +1,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; /// Unions Test diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart index 2abffa6d91..98db26e78e 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart @@ -3,6 +3,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; /// Bindings to Cjson. diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index f5f332e200..47e997ae3a 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -3,6 +3,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; /// Bindings to LibClang. diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index fb4724dda6..62480fbf44 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -3,6 +3,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; /// Bindings to SQLite. diff --git a/pkgs/ffigen/test/native_test/native_test_bindings.dart b/pkgs/ffigen/test/native_test/native_test_bindings.dart index 2e8471faaf..d4a25d673d 100644 --- a/pkgs/ffigen/test/native_test/native_test_bindings.dart +++ b/pkgs/ffigen/test/native_test/native_test_bindings.dart @@ -3,6 +3,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; /// Native tests. From d7eb3f1ca669e3366b73e2554b2e0bca89de6441 Mon Sep 17 00:00:00 2001 From: Mahesh Hegde <46179734+mahesh-hegde@users.noreply.github.com> Date: Wed, 15 Mar 2023 22:59:00 +0530 Subject: [PATCH 216/276] [ffigen] Detect Scoop LLVM installation on Windows (#535) --- pkgs/ffigen/CHANGELOG.md | 4 ++++ pkgs/ffigen/lib/src/config_provider/spec_utils.dart | 8 +++++++- pkgs/ffigen/pubspec.yaml | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index d507dde168..6dd3b69eb6 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 7.2.9 + +- Detect LLVM installed using Scoop on Windows machines. + # 7.2.8 - Automatically generate `ignore_for_file: type=lint` if not specified in preamble. diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 9b03ebb622..dfe6bbf270 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -495,7 +495,13 @@ String findDylibAtDefaultLocations() { } } } else if (Platform.isWindows) { - for (final l in strings.windowsDylibLocations) { + final dylibLocations = strings.windowsDylibLocations.toList(); + final userHome = Platform.environment['USERPROFILE']; + if (userHome != null) { + dylibLocations + .add(p.join(userHome, 'scoop', 'apps', 'llvm', 'current', 'bin')); + } + for (final l in dylibLocations) { k = findLibclangDylib(l); if (k != null) return k; } diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 4f647fbc8b..e9ef8be724 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 7.2.8 +version: 7.2.9 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen From 0727f8a0e40ecb1c5231be8ec85cf03a78e54f16 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 08:24:45 +0200 Subject: [PATCH 217/276] [ffigen] Bump subosito/flutter-action from 2.8.0 to 2.10.0 (#544) Bumps [subosito/flutter-action](https://github.com/subosito/flutter-action) from 2.8.0 to 2.10.0. - [Release notes](https://github.com/subosito/flutter-action/releases) - [Commits](https://github.com/subosito/flutter-action/compare/dbf1fa04f4d2e52c33185153d06cdb5443aa189d...48cafc24713cca54bbe03cdc3a423187d413aafa) --- updated-dependencies: - dependency-name: subosito/flutter-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkgs/ffigen/.github/workflows/test-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 67c991cb02..b0db8f4a40 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -106,7 +106,7 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - - uses: subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d + - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa with: channel: 'master' - name: Install dependencies From 6110c118ed997791f6b8ac3a47e36e34660454a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 08:25:24 +0200 Subject: [PATCH 218/276] [ffigen] Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (#541) Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.4.0 to 1.5.0. - [Release notes](https://github.com/dart-lang/setup-dart/releases) - [Changelog](https://github.com/dart-lang/setup-dart/blob/main/CHANGELOG.md) - [Commits](https://github.com/dart-lang/setup-dart/compare/a57a6c04cf7d4840e88432aad6281d1e125f0d46...d6a63dab3335f427404425de0fbfed4686d93c4f) --- updated-dependencies: - dependency-name: dart-lang/setup-dart dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkgs/ffigen/.github/workflows/test-package.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index b0db8f4a40..c25794c4c7 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -22,7 +22,7 @@ jobs: sdk: [stable] steps: - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - - uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46 + - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: ${{ matrix.sdk }} - id: install @@ -42,7 +42,7 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - - uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46 + - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: stable - name: Install dependencies @@ -59,7 +59,7 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - - uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46 + - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: stable - name: Install dependencies @@ -81,7 +81,7 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - - uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46 + - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: stable - name: Install dependencies From 0279f34480bb0540ee3c3449d4e5186de85ff7d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 08:49:43 +0200 Subject: [PATCH 219/276] [ffigen] Bump actions/checkout from 3.3.0 to 3.5.0 (#542) Bumps [actions/checkout](https://github.com/actions/checkout) from 3.3.0 to 3.5.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/ac593985615ec2ede58e132d2e21d2b1cbd6127c...8f4b7f84864484a7bf31766abe9204da3cbe65b3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkgs/ffigen/.github/workflows/test-package.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index c25794c4c7..5b3cdeefa3 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -21,7 +21,7 @@ jobs: matrix: sdk: [stable] steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c + - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: ${{ matrix.sdk }} @@ -41,7 +41,7 @@ jobs: needs: analyze runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c + - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: stable @@ -58,7 +58,7 @@ jobs: needs: analyze runs-on: macos-latest steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c + - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: stable @@ -80,7 +80,7 @@ jobs: needs: analyze runs-on: windows-latest steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c + - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: stable @@ -105,7 +105,7 @@ jobs: needs: analyze runs-on: windows-latest steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c + - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa with: channel: 'master' From a80742b9b6ef9ed0111d740e676cabfab4a40523 Mon Sep 17 00:00:00 2001 From: Mahesh Hegde <46179734+mahesh-hegde@users.noreply.github.com> Date: Mon, 3 Apr 2023 23:51:03 +0530 Subject: [PATCH 220/276] [ffigen] Parameter names in function pointer fields (#537) --- pkgs/ffigen/CHANGELOG.md | 4 + .../c_json/cjson_generated_bindings.dart | 9 +- .../libclang-example/generated_bindings.dart | 33 +++-- .../lib/src/code_generator/func_type.dart | 16 +++ .../sub_parsers/compounddecl_parser.dart | 5 +- .../function_type_param_parser.dart | 54 ++++++++ .../sub_parsers/functiondecl_parser.dart | 2 +- .../sub_parsers/typedefdecl_parser.dart | 3 +- .../type_extractor/extractor.dart | 59 ++++++++- pkgs/ffigen/lib/src/header_parser/utils.dart | 5 + .../_expected_functions_bindings.dart | 2 +- ...expected_native_func_typedef_bindings.dart | 15 +-- ..._expected_struct_fptr_fields_bindings.dart | 72 +++++++++++ .../header_parser_tests/struct_fptr_fields.h | 41 ++++++ .../struct_fptr_fields_test.dart | 42 +++++++ .../_expected_cjson_bindings.dart | 9 +- .../_expected_libclang_bindings.dart | 33 +++-- .../_expected_sqlite_bindings.dart | 119 ++++++++++-------- 18 files changed, 415 insertions(+), 108 deletions(-) create mode 100644 pkgs/ffigen/lib/src/header_parser/sub_parsers/function_type_param_parser.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_struct_fptr_fields_bindings.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/struct_fptr_fields.h create mode 100644 pkgs/ffigen/test/header_parser_tests/struct_fptr_fields_test.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 6dd3b69eb6..2cad2a036e 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 7.2.10 + +- Generate parameter names in function pointer fields + # 7.2.9 - Detect LLVM installed using Scoop on Windows machines. diff --git a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart index ad704b5719..0571e62121 100644 --- a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart +++ b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart @@ -1257,13 +1257,12 @@ class cJSON extends ffi.Struct { } class cJSON_Hooks extends ffi.Struct { - external ffi - .Pointer Function(ffi.Size)>> + external ffi.Pointer< + ffi.NativeFunction Function(ffi.Size sz)>> malloc_fn; - external ffi - .Pointer)>> - free_fn; + external ffi.Pointer< + ffi.NativeFunction ptr)>> free_fn; } typedef cJSON_bool = ffi.Int; diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index e41aaf945f..800c5807ba 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -9748,7 +9748,9 @@ typedef DartClang_getIBOutletCollectionType = CXType Function(CXCursor arg0); /// The visitor should return one of the \c CXChildVisitResult values /// to direct clang_visitCursorChildren(). typedef CXCursorVisitor = ffi.Pointer< - ffi.NativeFunction>; + ffi.NativeFunction< + ffi.Int32 Function( + CXCursor cursor, CXCursor parent, CXClientData client_data)>>; /// Describes how the traversal of the children of a particular /// cursor should proceed after visiting a particular child cursor. @@ -10425,8 +10427,11 @@ typedef DartClang_toggleCrashRecovery = void Function(int isEnabled); /// the first element refers to the location that included 'included_file'. typedef CXInclusionVisitor = ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(CXFile, ffi.Pointer, - ffi.UnsignedInt, CXClientData)>>; + ffi.Void Function( + CXFile included_file, + ffi.Pointer inclusion_stack, + ffi.UnsignedInt include_len, + CXClientData client_data)>>; typedef NativeClang_getInclusions = ffi.Void Function( CXTranslationUnit tu, CXInclusionVisitor visitor, CXClientData client_data); typedef DartClang_getInclusions = void Function( @@ -10943,8 +10948,10 @@ 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< - ffi.NativeFunction< - ffi.Int Function(CXClientData, ffi.Pointer)>> abortQuery; + ffi.NativeFunction< + ffi.Int Function( + CXClientData client_data, ffi.Pointer reserved)>> + abortQuery; /// Called at the end of indexing; passes the complete diagnostic set. external ffi.Pointer< @@ -10955,8 +10962,8 @@ class IndexerCallbacks extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< - CXIdxClientFile Function( - CXClientData, CXFile, ffi.Pointer)>> enteredMainFile; + CXIdxClientFile Function(CXClientData client_data, CXFile mainFile, + ffi.Pointer reserved)>> enteredMainFile; /// Called when a file gets \#included/\#imported. external ffi.Pointer< @@ -10979,9 +10986,10 @@ class IndexerCallbacks extends ffi.Struct { /// Called at the beginning of indexing a translation unit. external ffi.Pointer< - ffi.NativeFunction< - CXIdxClientContainer Function( - CXClientData, ffi.Pointer)>> startedTranslationUnit; + ffi.NativeFunction< + CXIdxClientContainer Function( + CXClientData client_data, ffi.Pointer reserved)>> + startedTranslationUnit; external ffi.Pointer< ffi.NativeFunction< @@ -11095,8 +11103,9 @@ typedef DartClang_indexLoc_getCXSourceLocation = CXSourceLocation Function( /// /// The visitor should return one of the \c CXVisitorResult values /// to direct \c clang_Type_visitFields. -typedef CXFieldVisitor = ffi - .Pointer>; +typedef CXFieldVisitor = ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(CXCursor C, CXClientData client_data)>>; typedef NativeClang_Type_visitFields = ffi.UnsignedInt Function( CXType T, CXFieldVisitor visitor, CXClientData client_data); typedef DartClang_Type_visitFields = int Function( diff --git a/pkgs/ffigen/lib/src/code_generator/func_type.dart b/pkgs/ffigen/lib/src/code_generator/func_type.dart index 3025bd2a26..54020285aa 100644 --- a/pkgs/ffigen/lib/src/code_generator/func_type.dart +++ b/pkgs/ffigen/lib/src/code_generator/func_type.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/code_generator/utils.dart'; import 'writer.dart'; @@ -54,6 +55,21 @@ class FunctionType extends Type { p.type.addDependencies(dependencies); } } + + void addParameterNames(List names) { + if (names.length != parameters.length) { + return; + } + final paramNamer = UniqueNamer({}); + for (int i = 0; i < parameters.length; i++) { + final finalName = paramNamer.makeUnique(names[i]); + parameters[i] = Parameter( + type: parameters[i].type, + originalName: names[i], + name: finalName, + ); + } + } } /// Represents a NativeFunction. diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart index 5a7709c5b2..a88f5fce96 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart @@ -253,7 +253,7 @@ int _compoundMembersVisitor(clang_types.CXCursor cursor, parsed.maxChildAlignment = align; } - final mt = cursor.type().toCodeGenType(); + final mt = cursor.toCodeGenType(); if (mt is IncompleteArray) { // TODO(68): Structs with flexible Array Members are not supported. parsed.flexibleArrayMember = true; @@ -271,7 +271,6 @@ int _compoundMembersVisitor(clang_types.CXCursor cursor, if (mt.baseType is UnimplementedType) { parsed.unimplementedMemberType = true; } - parsed.compound.members.add( Member( dartDoc: getCursorDocComment( @@ -295,7 +294,7 @@ int _compoundMembersVisitor(clang_types.CXCursor cursor, break; case clang_types.CXCursorKind.CXCursor_UnionDecl: case clang_types.CXCursorKind.CXCursor_StructDecl: - final mt = cursor.type().toCodeGenType(); + final mt = cursor.toCodeGenType(); // If the union/struct are anonymous, then we need to add them now, // otherwise they will be added in the next iteration. diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/function_type_param_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/function_type_param_parser.dart new file mode 100644 index 0000000000..739b3b1332 --- /dev/null +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/function_type_param_parser.dart @@ -0,0 +1,54 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:ffi'; + +import '../clang_bindings/clang_bindings.dart'; +import '../data.dart'; +import '../utils.dart'; + +/// This type holds the list of `ParmDecl` nodes of a function type declaration. +class FunctionTypeParams { + final List paramNames; + final Map params; + FunctionTypeParams() + : paramNames = [], + params = {}; +} + +FunctionTypeParams? _params; + +int _functionPointerFieldVisitor( + CXCursor cursor, CXCursor parent, Pointer clientData) { + if (cursor.kind == CXCursorKind.CXCursor_ParmDecl) { + final spelling = cursor.spelling(); + if (spelling.isNotEmpty) { + _params!.paramNames.add(spelling); + _params!.params[spelling] = cursor; + return CXChildVisitResult.CXChildVisit_Continue; + } else { + // A parameter's spelling is empty, do not continue further traversal. + _params!.paramNames.clear(); + _params!.params.clear(); + return CXChildVisitResult.CXChildVisit_Break; + } + } + // The cursor itself may be a pointer etc.. + return CXChildVisitResult.CXChildVisit_Recurse; +} + +/// Returns `ParmDecl` nodes of function pointer declaration +/// directly or indirectly pointed to by [cursor]. +FunctionTypeParams parseFunctionPointerParamNames(CXCursor cursor) { + _params = FunctionTypeParams(); + clang.clang_visitChildren( + cursor, + Pointer.fromFunction( + _functionPointerFieldVisitor, exceptional_visitor_return), + nullptr, + ); + final result = _params; + _params = null; + return result!; +} diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index 848f60bbce..d2d3412274 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -127,5 +127,5 @@ List _getParameters(clang_types.CXCursor cursor, String funcName) { } Type _getParameterType(clang_types.CXCursor cursor) { - return cursor.type().toCodeGenType(); + return cursor.toCodeGenType(); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart index 988a45e39b..85df348063 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart @@ -40,7 +40,8 @@ Typealias? parseTypedefDeclaration( final typedefUsr = cursor.usr(); if (shouldIncludeTypealias(typedefUsr, typedefName)) { final ct = clang.clang_getTypedefDeclUnderlyingType(cursor); - final s = getCodeGenType(ct, pointerReference: pointerReference); + final s = getCodeGenType(ct, + pointerReference: pointerReference, originalCursor: cursor); if (bindingsIndex.isSeenUnsupportedTypealias(typedefUsr)) { // Do not process unsupported typealiases again. diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index d6b87f27c9..c6a0951904 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -4,6 +4,7 @@ /// Extracts code_gen Type from type. import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser/sub_parsers/function_type_param_parser.dart'; import 'package:ffigen/src/header_parser/sub_parsers/typedefdecl_parser.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; @@ -21,6 +22,8 @@ import '../utils.dart'; final _logger = Logger('ffigen.header_parser.extractor'); const _padding = ' '; +const maxRecursionDepth = 5; + /// Converts cxtype to a typestring code_generator can accept. Type getCodeGenType( clang_types.CXType cxtype, { @@ -30,6 +33,10 @@ Type getCodeGenType( /// Passed on if a value was marked as a pointer before this one. bool pointerReference = false, + + /// Cursor of the declaration, currently this is useful only to extract + /// parameter names in function types. + clang_types.CXCursor? originalCursor, }) { _logger.fine('${_padding}getCodeGenType ${cxtype.completeStringRepr()}'); @@ -89,7 +96,11 @@ Type getCodeGenType( switch (cxtype.kind) { case clang_types.CXTypeKind.CXType_Pointer: final pt = clang.clang_getPointeeType(cxtype); - final s = getCodeGenType(pt, pointerReference: true); + final s = getCodeGenType( + pt, + pointerReference: true, + originalCursor: originalCursor, + ); // Replace Pointer<_Dart_Handle> with Handle. if (config.useDartHandle && @@ -101,10 +112,10 @@ Type getCodeGenType( return PointerType(s); case clang_types.CXTypeKind.CXType_FunctionProto: // Primarily used for function pointers. - return _extractFromFunctionProto(cxtype); + return _extractFromFunctionProto(cxtype, cursor: originalCursor); case clang_types.CXTypeKind.CXType_FunctionNoProto: // Primarily used for function types with zero arguments. - return _extractFromFunctionProto(cxtype); + return _extractFromFunctionProto(cxtype, cursor: originalCursor); case clang_types.CXTypeKind .CXType_ConstantArray: // Primarily used for constant array in struct members. return ConstantArray( @@ -295,7 +306,8 @@ Type? _extractfromRecord(clang_types.CXType cxtype, clang_types.CXCursor cursor, } // Used for function pointer arguments. -Type _extractFromFunctionProto(clang_types.CXType cxtype) { +Type _extractFromFunctionProto(clang_types.CXType cxtype, + {clang_types.CXCursor? cursor}) { final parameters = []; final totalArgs = clang.clang_getNumArgTypes(cxtype); for (var i = 0; i < totalArgs; i++) { @@ -314,8 +326,43 @@ Type _extractFromFunctionProto(clang_types.CXType cxtype) { ); } - return NativeFunc(FunctionType( + final functionType = FunctionType( parameters: parameters, returnType: clang.clang_getResultType(cxtype).toCodeGenType(), - )); + ); + _parseAndMergeParamNames(functionType, cursor, maxRecursionDepth); + return NativeFunc(functionType); +} + +void _parseAndMergeParamNames( + FunctionType functionType, + clang_types.CXCursor? cursor, + int recursionDepth, +) { + if (cursor == null) { + return; + } + if (recursionDepth == 0) { + final cursorRepr = cursor.completeStringRepr(); + _logger.warning('Recursion depth exceeded when merging function parameters.' + ' Last cursor encountered was $cursorRepr'); + return; + } + + final paramsInfo = parseFunctionPointerParamNames(cursor); + functionType.addParameterNames(paramsInfo.paramNames); + + for (final param in functionType.parameters) { + final paramRealType = param.type.typealiasType; + final paramBaseType = paramRealType.baseType.typealiasType; + if (paramBaseType is NativeFunc && param.name.isNotEmpty) { + final paramFunctionType = paramBaseType.type; + final paramCursor = paramsInfo.params[param.name]; + _parseAndMergeParamNames( + paramFunctionType, + paramCursor, + recursionDepth - 1, + ); + } + } } diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index 0b4770f92d..a674618f18 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -80,6 +80,11 @@ extension CXCursorExt on clang_types.CXCursor { .toStringAndDispose(); } + /// Get code_gen [Type] representation of [clang_types.CXType]. + Type toCodeGenType() { + return getCodeGenType(type(), originalCursor: this); + } + /// for debug: returns [spelling] [kind] [kindSpelling] [type] [typeSpelling]. String completeStringRepr() { final cxtype = type(); diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart index f9e8c1ab4a..c4a01b3909 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart @@ -138,4 +138,4 @@ class _SymbolAddresses { } typedef shortHand = ffi.NativeFunction< - ffi.Void Function(ffi.Pointer>)>; + ffi.Void Function(ffi.Pointer> b)>; diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart index 7153ce4780..6ef30ff9fc 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart @@ -24,7 +24,8 @@ class NativeLibrary { ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer>)>> + ffi.Pointer> + unnamed2)>> unnamed1, ) { return _func( @@ -38,16 +39,15 @@ class NativeLibrary { ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function()>>)>>)>>('func'); + ffi.Pointer> + unnamed2)>>)>>('func'); late final _func = _funcPtr.asFunction< void Function( ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer< - ffi.NativeFunction>)>>)>(); + ffi.Pointer> + unnamed2)>>)>(); void funcWithNativeFunc( WithTypedefReturnType named, @@ -68,7 +68,8 @@ class Struct extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer>)>> unnamed1; + ffi.Pointer> + unnamed2)>> unnamed1; } typedef WithTypedefReturnType diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_struct_fptr_fields_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_struct_fptr_fields_bindings.dart new file mode 100644 index 0000000000..b0490b26e2 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_struct_fptr_fields_bindings.dart @@ -0,0 +1,72 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +// ignore_for_file: type=lint +import 'dart:ffi' as ffi; + +class S extends ffi.Struct { + external ffi.Pointer> func1; + + external ffi + .Pointer> + comparator; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(ffi.Double a, ffi.Float b, ffi.Pointer c, + ffi.Int d, ffi.LongLong e)>> veryManyArguments; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function( + ffi.Int, ffi.Int, ffi.Int, ffi.Float, ffi.Pointer)>> + argsDontHaveNames; + + external ArithmeticOperation operation; + + external ffi.Pointer< + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer array, ffi.Int len)>>> + sortPtr; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer array, + ffi.Int len, + ffi.Pointer> + evaluator)>> sortBy; + + external ffi.Pointer< + ffi.NativeFunction> + improperlyDeclaredParams; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer array, + ffi.Pointer> + primaryEvaluator, + ffi.Pointer> + fallbackEvaluator)>> sortByWithFallback; + + @ffi.Array.multi([2]) + external ffi.Array< + ffi.Pointer< + ffi.NativeFunction>> + manyFunctions; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer> + Function(ffi.Int, ffi.Int)>> functionReturningFunction; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer> + Function(ffi.Int, ffi.Int)>> functionReturningFunctionImproper; +} + +typedef ArithmeticOperation + = ffi.Pointer>; diff --git a/pkgs/ffigen/test/header_parser_tests/struct_fptr_fields.h b/pkgs/ffigen/test/header_parser_tests/struct_fptr_fields.h new file mode 100644 index 0000000000..e95d1ca8e3 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/struct_fptr_fields.h @@ -0,0 +1,41 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +typedef int (*ArithmeticOperation)(int a, int b); + +struct S +{ + // Function pointer field, but no parameters. + int (*func1)(void); + // Function pointer field with parameters. + int (*comparator)(int a, int b); + // Function pointer field with lot of parameters + int (*veryManyArguments)(double a, float b, char *c, int d, long long e); + // Function pointer field with parameters, but no names + int (*argsDontHaveNames)(int, int, int, float, char *); + // Function pointer through typedef + ArithmeticOperation operation; + // Pointer to function pointer + void (**sortPtr)(int *array, int len); + // Function pointer with a function pointer parameter + void (*sortBy)(int *array, int len, int (*evaluator)(int x)); + // Function where few parameters are named. This should not + // produce parameters in output. + void (*improperlyDeclaredParams)(int a, int, char); + // Function pointer with 2 function pointer parameters + void (*sortByWithFallback)(int *array, + int (*primaryEvaluator)(int x), + int (*fallbackEvaluator)(int x)); + + // TODO(#545): Handle remaining cases of parsing param names + // --- + // Array of function pointers. Does not produce proper output right now. + void (*manyFunctions[2])(char a, char b); + // Function pointer returning function pointer. Does not produce valid output. + int (*(*functionReturningFunction)(int a, int b))(int c, int d); + // Function pointer returning function pointer. The return type has param + // names, but the function itself doesn't. This also shouldn't produce + // any parameters in output. + int (*(*functionReturningFunctionImproper)(int a, int b))(int, int); +}; diff --git a/pkgs/ffigen/test/header_parser_tests/struct_fptr_fields_test.dart b/pkgs/ffigen/test/header_parser_tests/struct_fptr_fields_test.dart new file mode 100644 index 0000000000..765b8b0d77 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/struct_fptr_fields_test.dart @@ -0,0 +1,42 @@ +// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:logging/logging.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; + +import '../test_utils.dart'; + +late Library actual; +void main() { + group('Function pointer parameters parsing test', () { + setUpAll(() { + logWarnings(Level.SEVERE); + actual = parser.parse( + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'Function pointer fields in structs Test' +${strings.output}: 'unused' +${strings.headers}: + ${strings.entryPoints}: + - 'test/header_parser_tests/struct_fptr_fields.h' + ''') as yaml.YamlMap), + ); + }); + + test('Expected bindings', () { + matchLibraryWithExpected( + actual, 'header_parser_struct_fptr_fields_output.dart', [ + 'test', + 'header_parser_tests', + 'expected_bindings', + '_expected_struct_fptr_fields_bindings.dart', + ]); + }); + }); +} diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart index 98db26e78e..fe6b0080a5 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart @@ -1237,13 +1237,12 @@ class cJSON extends ffi.Struct { } class cJSON_Hooks extends ffi.Struct { - external ffi - .Pointer Function(ffi.Size)>> + external ffi.Pointer< + ffi.NativeFunction Function(ffi.Size sz)>> malloc_fn; - external ffi - .Pointer)>> - free_fn; + external ffi.Pointer< + ffi.NativeFunction ptr)>> free_fn; } typedef cJSON_bool = ffi.Int; diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index 47e997ae3a..510e0b0dbc 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -7431,7 +7431,9 @@ abstract class CXChildVisitResult { /// Visitor invoked for each cursor found by a traversal. typedef CXCursorVisitor = ffi.Pointer< - ffi.NativeFunction>; + ffi.NativeFunction< + ffi.Int32 Function( + CXCursor cursor, CXCursor parent, CXClientData client_data)>>; /// Opaque pointer representing client data that will be passed through to /// various callbacks and visitors. @@ -7761,8 +7763,11 @@ abstract class CXCompletionContext { /// clang_getInclusions()). typedef CXInclusionVisitor = ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(CXFile, ffi.Pointer, - ffi.UnsignedInt, CXClientData)>>; + ffi.Void Function( + CXFile included_file, + ffi.Pointer inclusion_stack, + ffi.UnsignedInt include_len, + CXClientData client_data)>>; abstract class CXEvalResultKind { static const int CXEval_Int = 1; @@ -8124,8 +8129,10 @@ 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< - ffi.NativeFunction< - ffi.Int Function(CXClientData, ffi.Pointer)>> abortQuery; + ffi.NativeFunction< + ffi.Int Function( + CXClientData client_data, ffi.Pointer reserved)>> + abortQuery; /// Called at the end of indexing; passes the complete diagnostic set. external ffi.Pointer< @@ -8136,8 +8143,8 @@ class IndexerCallbacks extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< - CXIdxClientFile Function( - CXClientData, CXFile, ffi.Pointer)>> enteredMainFile; + CXIdxClientFile Function(CXClientData client_data, CXFile mainFile, + ffi.Pointer reserved)>> enteredMainFile; /// Called when a file gets #included/#imported. external ffi.Pointer< @@ -8155,9 +8162,10 @@ class IndexerCallbacks extends ffi.Struct { /// Called at the beginning of indexing a translation unit. external ffi.Pointer< - ffi.NativeFunction< - CXIdxClientContainer Function( - CXClientData, ffi.Pointer)>> startedTranslationUnit; + ffi.NativeFunction< + CXIdxClientContainer Function( + CXClientData client_data, ffi.Pointer reserved)>> + startedTranslationUnit; external ffi.Pointer< ffi.NativeFunction< @@ -8216,8 +8224,9 @@ abstract class CXIndexOptFlags { } /// Visitor invoked for each field found by a traversal. -typedef CXFieldVisitor = ffi - .Pointer>; +typedef CXFieldVisitor = ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(CXCursor C, CXClientData client_data)>>; const int CINDEX_VERSION_MAJOR = 0; diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index 62480fbf44..d3b48db089 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -9585,7 +9585,8 @@ class SQLite { ffi.Pointer pBlocked, ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer>, ffi.Int)>> + ffi.Void Function( + ffi.Pointer> apArg, ffi.Int nArg)>> xNotify, ffi.Pointer pNotifyArg, ) { @@ -9603,7 +9604,8 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer>, ffi.Int)>>, + ffi.Pointer> apArg, + ffi.Int nArg)>>, ffi.Pointer)>>('sqlite3_unlock_notify'); late final _sqlite3_unlock_notify = _sqlite3_unlock_notifyPtr.asFunction< int Function( @@ -9611,7 +9613,7 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer>, ffi.Int)>>, + ffi.Pointer> apArg, ffi.Int nArg)>>, ffi.Pointer)>(); /// CAPI3REF: String Comparison @@ -10969,16 +10971,17 @@ class sqlite3_module extends ffi.Struct { xBestIndex; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction pVTab)>> xDisconnect; external ffi.Pointer< - ffi.NativeFunction)>> xDestroy; + ffi.NativeFunction pVTab)>> + xDestroy; external ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer>)>> xOpen; + ffi.Int Function(ffi.Pointer pVTab, + ffi.Pointer> ppCursor)>> xOpen; external ffi.Pointer< ffi.NativeFunction< @@ -11020,37 +11023,42 @@ class sqlite3_module extends ffi.Struct { ffi.Pointer)>> xUpdate; external ffi.Pointer< - ffi.NativeFunction)>> xBegin; + ffi.NativeFunction pVTab)>> + xBegin; external ffi.Pointer< - ffi.NativeFunction)>> xSync; + ffi.NativeFunction pVTab)>> + xSync; external ffi.Pointer< - ffi.NativeFunction)>> xCommit; + ffi.NativeFunction pVTab)>> + xCommit; external ffi.Pointer< - ffi.NativeFunction)>> + ffi.NativeFunction pVTab)>> xRollback; external ffi.Pointer< ffi.NativeFunction< ffi.Int Function( - ffi.Pointer, - ffi.Int, - ffi.Pointer, + ffi.Pointer pVtab, + ffi.Int nArg, + ffi.Pointer zName, ffi.Pointer< - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Int, - ffi.Pointer>)>>>, - ffi.Pointer>)>> xFindFunction; + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int, + ffi.Pointer>)>>> + pxFunc, + ffi.Pointer> ppArg)>> xFindFunction; external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>> xRename; + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer pVtab, ffi.Pointer zNew)>> + xRename; /// The methods above are in version 1 of the sqlite_module object. Those /// below are for version 2 and greater. @@ -11344,9 +11352,9 @@ class sqlite3_pcache_methods2 extends ffi.Struct { xShutdown; external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Int, ffi.Int, ffi.Int)>> - xCreate; + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Int szPage, ffi.Int szExtra, ffi.Int bPurgeable)>> xCreate; external ffi.Pointer< ffi.NativeFunction< @@ -11401,7 +11409,8 @@ class sqlite3_pcache_methods extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< - ffi.Pointer Function(ffi.Int, ffi.Int)>> xCreate; + ffi.Pointer Function( + ffi.Int szPage, ffi.Int bPurgeable)>> xCreate; external ffi.Pointer< ffi.NativeFunction< @@ -11952,48 +11961,48 @@ class fts5_api extends ffi.Struct { /// Create a new tokenizer external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer pApi, + ffi.Pointer zName, + ffi.Pointer pContext, + ffi.Pointer pTokenizer, + ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>)>> - xCreateTokenizer; + ffi.Void Function(ffi.Pointer)>> + xDestroy)>> xCreateTokenizer; /// Find an existing tokenizer external ffi.Pointer< ffi.NativeFunction< ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>> xFindTokenizer; + ffi.Pointer pApi, + ffi.Pointer zName, + ffi.Pointer> ppContext, + ffi.Pointer pTokenizer)>> xFindTokenizer; /// Create a new auxiliary function external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - fts5_extension_function, - ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer pApi, + ffi.Pointer zName, + ffi.Pointer pContext, + fts5_extension_function xFunction, + ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>)>> - xCreateFunction; + ffi.Void Function(ffi.Pointer)>> + xDestroy)>> xCreateFunction; } typedef fts5_extension_function = ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Pointer>)>>; + ffi.Pointer pApi, + ffi.Pointer pFts, + ffi.Pointer pCtx, + ffi.Int nVal, + ffi.Pointer> apVal)>>; const String SQLITE_VERSION = '3.32.3'; From 8bfec3dc98ad37dc19cd96053aaf31826ce038fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 20:30:40 +0200 Subject: [PATCH 221/276] [ffigen] Bump coverallsapp/github-action from 1.2.4 to 2.0.0 (#543) Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 1.2.4 to 2.0.0. - [Release notes](https://github.com/coverallsapp/github-action/releases) - [Commits](https://github.com/coverallsapp/github-action/compare/50c33ad324a9902697adbf2f92c22cf5023eacf1...67662d24394fd74bffcf7b462d1b432814159afd) --- updated-dependencies: - dependency-name: coverallsapp/github-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkgs/ffigen/.github/workflows/test-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 5b3cdeefa3..e1c1ad06cc 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -71,7 +71,7 @@ jobs: - name: Collect coverage run: ./tool/coverage.sh - name: Upload coverage - uses: coverallsapp/github-action@50c33ad324a9902697adbf2f92c22cf5023eacf1 + uses: coverallsapp/github-action@67662d24394fd74bffcf7b462d1b432814159afd with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: lcov.info From 9543583612eceb0bf59da7410cbb971c4a8ed48a Mon Sep 17 00:00:00 2001 From: Mahesh Hegde <46179734+mahesh-hegde@users.noreply.github.com> Date: Tue, 4 Apr 2023 11:07:32 +0530 Subject: [PATCH 222/276] [ffigen] Update version and changelog (#546) --- pkgs/ffigen/CHANGELOG.md | 2 +- pkgs/ffigen/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 2cad2a036e..e996b1ccfd 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,6 +1,6 @@ # 7.2.10 -- Generate parameter names in function pointer fields +- Generate parameter names in function pointer fields and typedefs. # 7.2.9 diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index e9ef8be724..6c2e147356 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 7.2.9 +version: 7.2.10 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen From fd98f9273b3ed6f6e301c0c105ec93582531ee88 Mon Sep 17 00:00:00 2001 From: Tzvi Melamed Date: Fri, 7 Apr 2023 13:07:17 -0400 Subject: [PATCH 223/276] [ffigen] Add common code path for test configs (#491) * Add common code path for test configs * separate example configs from pubspec.yaml for testing * share example configs with tests * use chDir for native test * Ensure local package paths work in tests * regen + concurrency=1 to fix race conditions --- .../ffigen/.github/workflows/test-package.yml | 6 +- pkgs/ffigen/example/c_json/README.md | 2 +- .../c_json/cjson_generated_bindings.dart | 1 - pkgs/ffigen/example/c_json/config.yaml | 31 ++++++++ pkgs/ffigen/example/c_json/pubspec.yaml | 33 -------- pkgs/ffigen/example/ffinative/README.md | 2 +- pkgs/ffigen/example/ffinative/config.yaml | 10 +++ pkgs/ffigen/example/ffinative/pubspec.yaml | 12 --- .../example/libclang-example/config.yaml | 74 ++++++++++++++++++ .../example/libclang-example/pubspec.yaml | 75 ------------------- .../ffigen/example/libclang-example/readme.md | 2 +- pkgs/ffigen/example/objective_c/README.md | 2 +- pkgs/ffigen/example/objective_c/config.yaml | 13 ++++ pkgs/ffigen/example/objective_c/pubspec.yaml | 15 ---- pkgs/ffigen/example/simple/README.md | 2 +- pkgs/ffigen/example/simple/config.yaml | 6 ++ pkgs/ffigen/example/simple/pubspec.yaml | 7 -- pkgs/ffigen/example/swift/README.md | 2 +- pkgs/ffigen/example/swift/config.yaml | 19 +++++ pkgs/ffigen/example/swift/pubspec.yaml | 21 ------ pkgs/ffigen/example/swift/swift_api.h | 49 +++++++++++- .../lib/src/config_provider/config.dart | 2 +- .../decl_type_name_collision_test.dart | 6 +- .../test/config_tests/compiler_opts_test.dart | 7 +- .../exclude_all_by_default_test.dart | 9 +-- .../config_tests/include_exclude_test.dart | 3 +- .../packed_struct_override_test.dart | 17 ++--- .../config_tests/unknown_keys_warn_test.dart | 5 +- .../example_tests/cjson_example_test.dart | 41 +--------- .../example_tests/ffinative_example_test.dart | 19 +---- .../example_tests/libclang_example_test.dart | 71 ++++-------------- .../objective_c_example_test.dart | 10 +-- .../shared_bindings_example_test.dart | 47 ++++-------- .../example_tests/simple_example_test.dart | 19 ++--- .../example_tests/swift_example_test.dart | 15 ++-- .../comment_markup_test.dart | 6 +- .../header_parser_tests/dart_handle_test.dart | 6 +- .../forward_decl_test.dart | 6 +- .../function_n_struct_test.dart | 6 +- .../header_parser_tests/functions_test.dart | 6 +- .../header_parser_tests/globals_test.dart | 6 +- .../imported_types_test.dart | 6 +- .../test/header_parser_tests/macros_test.dart | 6 +- .../native_func_typedef_test.dart | 6 +- .../nested_parsing_test.dart | 6 +- .../opaque_dependencies_test.dart | 6 +- .../packed_structs_test.dart | 6 +- .../header_parser_tests/regress_384_test.dart | 6 +- .../separate_definition_test.dart | 5 +- .../header_parser_tests/typedef_test.dart | 6 +- .../test/header_parser_tests/unions_test.dart | 6 +- .../unnamed_enums_test.dart | 6 +- .../large_integration_tests/large_test.dart | 14 ++-- pkgs/ffigen/test/native_objc_test/util.dart | 7 +- pkgs/ffigen/test/native_test/config.yaml | 4 +- pkgs/ffigen/test/native_test/native_test.dart | 28 ++++--- pkgs/ffigen/test/regen.dart | 64 +++++++--------- .../ffigen/test/rename_tests/rename_test.dart | 6 +- pkgs/ffigen/test/test_utils.dart | 39 +++++++++- 59 files changed, 410 insertions(+), 508 deletions(-) create mode 100644 pkgs/ffigen/example/c_json/config.yaml create mode 100644 pkgs/ffigen/example/ffinative/config.yaml create mode 100644 pkgs/ffigen/example/libclang-example/config.yaml create mode 100644 pkgs/ffigen/example/objective_c/config.yaml create mode 100644 pkgs/ffigen/example/simple/config.yaml create mode 100644 pkgs/ffigen/example/swift/config.yaml diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index e1c1ad06cc..8bcf6e6468 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -52,7 +52,7 @@ jobs: - name: Build test dylib and bindings run: dart test/setup.dart - name: Run VM tests - run: dart test --platform vm + run: dart test --platform vm --concurrency=1 test-mac: needs: analyze @@ -67,7 +67,7 @@ jobs: - name: Build test dylib and bindings run: dart test/setup.dart - name: Run VM tests - run: dart test --platform vm + run: dart test --platform vm --concurrency=1 - name: Collect coverage run: ./tool/coverage.sh - name: Upload coverage @@ -89,7 +89,7 @@ jobs: - name: Build test dylib and bindings run: dart test/setup.dart - name: Run VM tests - run: dart test --platform vm + run: dart test --platform vm --concurrency=1 # Sanity check the latest `flutter create --template plugin_ffi`. # This will break if we change the Flutter template or the generated code. diff --git a/pkgs/ffigen/example/c_json/README.md b/pkgs/ffigen/example/c_json/README.md index 229d65b7d8..f222cc2ef2 100644 --- a/pkgs/ffigen/example/c_json/README.md +++ b/pkgs/ffigen/example/c_json/README.md @@ -15,7 +15,7 @@ make ## Generating bindings At the root of this example (`example/c_json`), run - ``` -dart run ffigen +dart run ffigen --config config.yaml ``` This will generate bindings in a file: [cjson_generated_bindings.dart](./cjson_generated_bindings.dart) diff --git a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart index 0571e62121..c520c20b33 100644 --- a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart +++ b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart @@ -19,7 +19,6 @@ // THE SOFTWARE. // ignore_for_file: camel_case_types, non_constant_identifier_names - // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. diff --git a/pkgs/ffigen/example/c_json/config.yaml b/pkgs/ffigen/example/c_json/config.yaml new file mode 100644 index 0000000000..08c5891a54 --- /dev/null +++ b/pkgs/ffigen/example/c_json/config.yaml @@ -0,0 +1,31 @@ +output: 'cjson_generated_bindings.dart' +name: 'CJson' +description: 'Holds bindings to cJSON.' +headers: + entry-points: + - '../../third_party/cjson_library/cJSON.h' + include-directives: + - '**cJSON.h' +comments: false +preamble: | + // Copyright (c) 2009-2017 Dave Gamble and cJSON contributors + // + // Permission is hereby granted, free of charge, to any person obtaining a copy + // of this software and associated documentation files (the "Software"), to deal + // in the Software without restriction, including without limitation the rights + // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + // copies of the Software, and to permit persons to whom the Software is + // furnished to do so, subject to the following conditions: + // + // The above copyright notice and this permission notice shall be included in + // all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + // THE SOFTWARE. + + // ignore_for_file: camel_case_types, non_constant_identifier_names \ No newline at end of file diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index 7b76a5c212..1733b5fc96 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -15,36 +15,3 @@ dev_dependencies: ffigen: path: '../../' lints: ^2.0.1 - -ffigen: - output: 'cjson_generated_bindings.dart' - name: 'CJson' - description: 'Holds bindings to cJSON.' - headers: - entry-points: - - '../../third_party/cjson_library/cJSON.h' - include-directives: - - '**cJSON.h' - comments: false - preamble: | - // Copyright (c) 2009-2017 Dave Gamble and cJSON contributors - // - // Permission is hereby granted, free of charge, to any person obtaining a copy - // of this software and associated documentation files (the "Software"), to deal - // in the Software without restriction, including without limitation the rights - // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - // copies of the Software, and to permit persons to whom the Software is - // furnished to do so, subject to the following conditions: - // - // The above copyright notice and this permission notice shall be included in - // all copies or substantial portions of the Software. - // - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - // THE SOFTWARE. - - // ignore_for_file: camel_case_types, non_constant_identifier_names diff --git a/pkgs/ffigen/example/ffinative/README.md b/pkgs/ffigen/example/ffinative/README.md index c1469402d0..82b0e88f18 100644 --- a/pkgs/ffigen/example/ffinative/README.md +++ b/pkgs/ffigen/example/ffinative/README.md @@ -5,6 +5,6 @@ A simple example generating `FfiNative` bindings for a very small header file (` ## Generating bindings At the root of this example (`example/simple`), run - ``` -dart run ffigen +dart run ffigen --config config.yaml ``` This will generate bindings in a file: [generated_bindings.dart](./generated_bindings.dart). diff --git a/pkgs/ffigen/example/ffinative/config.yaml b/pkgs/ffigen/example/ffinative/config.yaml new file mode 100644 index 0000000000..18aeb3f6dd --- /dev/null +++ b/pkgs/ffigen/example/ffinative/config.yaml @@ -0,0 +1,10 @@ +name: NativeLibrary +ffi-native: + # asset: 'assetname' # (optional) +description: Bindings to `headers/example.h`. +output: 'generated_bindings.dart' +headers: + entry-points: + - 'headers/example.h' +preamble: | + // ignore_for_file: deprecated_member_use \ No newline at end of file diff --git a/pkgs/ffigen/example/ffinative/pubspec.yaml b/pkgs/ffigen/example/ffinative/pubspec.yaml index 9747ec7da8..2247de409f 100644 --- a/pkgs/ffigen/example/ffinative/pubspec.yaml +++ b/pkgs/ffigen/example/ffinative/pubspec.yaml @@ -13,15 +13,3 @@ dev_dependencies: ffigen: path: '../../' lints: ^2.0.0 - -ffigen: - name: NativeLibrary - ffi-native: - # asset: 'assetname' # (optional) - description: Bindings to `headers/example.h`. - output: 'generated_bindings.dart' - headers: - entry-points: - - 'headers/example.h' - preamble: | - // ignore_for_file: deprecated_member_use diff --git a/pkgs/ffigen/example/libclang-example/config.yaml b/pkgs/ffigen/example/libclang-example/config.yaml new file mode 100644 index 0000000000..f6517c0899 --- /dev/null +++ b/pkgs/ffigen/example/libclang-example/config.yaml @@ -0,0 +1,74 @@ +output: 'generated_bindings.dart' + +# This will sort the bindings alphabetically. +# sort: true + +# This is required if LLVM can't be found in default locations by ffigen. +# llvm-path: +# - '/usr/local/opt/llvm' + +# Bash style Glob matching is also supported. +# TODO(11): Globs dont work on windows if they begin with '.' or '..'. +headers: + entry-points: + - ../../third_party/libclang/include/clang-c/Index.h + include-directives: # use glob syntax to match with header file path. + - '**CXString.h' + - '**Index.h' + +compiler-opts: + - '-I../../third_party/libclang/include' + - '-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/' + - '-Wno-nullability-completeness' +functions: + include: + - 'clang_.*' # Can be a regexp, '.' matches any character. + symbol-address: + include: + - 'clang_.*' # Symbol Address for these functions will be exposed via addresses. + expose-typedefs: + include: + - 'clang_.*' # Typedefs for Native and Dart type for these functions will be generated. +structs: + include: + - 'CX.*' +enums: + include: + - 'CXTypeKind' # Full names are given higher priority than regexp. + - 'CXGlobalOptFlags' + +library-imports: + custom_import: 'custom_import.dart' + +# These can be used to map any typedef to a specific native type. +type-map: + typedefs: + 'time_t': + lib: 'ffi' + c-type: 'Int64' + dart-type: 'int' + structs: + 'CXCursorSetImpl': + lib: 'custom_import' + c-type: 'CXCursorSetImpl' + dart-type: 'CXCursorSetImpl' + +# Default is 'NativeLibrary' +name: 'LibClang' + +description: 'Holds bindings to LibClang.' + +# Doc Comments for generated binings. +# Comments can be disabled by using comments: false +comments: + style: doxygen # Options - doxygen(default) / any. + length: full # Options - brief / full(default). + +# The header of the file, this is pasted as it is. +preamble: | + // Part of the LLVM Project, under the Apache License v2.0 with LLVM + // Exceptions. + // See https://llvm.org/LICENSE.txt for license information. + // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + + // ignore_for_file: camel_case_types, non_constant_identifier_names diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index bff5a3cbe8..daef35bc6a 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -13,78 +13,3 @@ dev_dependencies: ffigen: path: '../../' lints: ^2.0.1 - -ffigen: - output: 'generated_bindings.dart' - - # This will sort the bindings alphabetically. - # sort: true - - # This is required if LLVM can't be found in default locations by ffigen. - # llvm-path: - # - '/usr/local/opt/llvm' - - # Bash style Glob matching is also supported. - # TODO(11): Globs dont work on windows if they begin with '.' or '..'. - headers: - entry-points: - - ../../third_party/libclang/include/clang-c/Index.h - include-directives: # use glob syntax to match with header file path. - - '**CXString.h' - - '**Index.h' - - compiler-opts: - - '-I../../third_party/libclang/include' - - '-Wno-nullability-completeness' - functions: - include: - - 'clang_.*' # Can be a regexp, '.' matches any character. - symbol-address: - include: - - 'clang_.*' # Symbol Address for these functions will be exposed via addresses. - expose-typedefs: - include: - - 'clang_.*' # Typedefs for Native and Dart type for these functions will be generated. - structs: - include: - - 'CX.*' - enums: - include: - - 'CXTypeKind' # Full names are given higher priority than regexp. - - 'CXGlobalOptFlags' - - library-imports: - custom_import: 'custom_import.dart' - - # These can be used to map any typedef to a specific native type. - type-map: - typedefs: - 'time_t': - lib: 'ffi' - c-type: 'Int64' - dart-type: 'int' - structs: - 'CXCursorSetImpl': - lib: 'custom_import' - c-type: 'CXCursorSetImpl' - dart-type: 'CXCursorSetImpl' - - # Default is 'NativeLibrary' - name: 'LibClang' - - description: 'Holds bindings to LibClang.' - - # Doc Comments for generated binings. - # Comments can be disabled by using comments: false - comments: - style: doxygen # Options - doxygen(default) / any. - length: full # Options - brief / full(default). - - # The header of the file, this is pasted as it is. - preamble: | - // Part of the LLVM Project, under the Apache License v2.0 with LLVM - // Exceptions. - // See https://llvm.org/LICENSE.txt for license information. - // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - - // ignore_for_file: camel_case_types, non_constant_identifier_names diff --git a/pkgs/ffigen/example/libclang-example/readme.md b/pkgs/ffigen/example/libclang-example/readme.md index dab0bdf3cc..39f24747ab 100644 --- a/pkgs/ffigen/example/libclang-example/readme.md +++ b/pkgs/ffigen/example/libclang-example/readme.md @@ -6,6 +6,6 @@ The C header source files for libclang are in [third_party/libclang](/third_part ## Generating bindings At the root of this example (`example/libclang-example`), run - ``` -dart run ffigen +dart run ffigen --config config.yaml ``` This will generate bindings in a file: [generated_bindings.dart](./generated_bindings.dart). diff --git a/pkgs/ffigen/example/objective_c/README.md b/pkgs/ffigen/example/objective_c/README.md index 1d62972135..846b77a268 100644 --- a/pkgs/ffigen/example/objective_c/README.md +++ b/pkgs/ffigen/example/objective_c/README.md @@ -38,7 +38,7 @@ any of the fields or methods of `AVAudioPlayer`, so we're still able to use At the root of this example (`example/objective_c`), run: ``` -dart run ffigen +dart run ffigen --config config.yaml ``` This will generate [avf_audio_bindings.dart](./avf_audio_bindings.dart). diff --git a/pkgs/ffigen/example/objective_c/config.yaml b/pkgs/ffigen/example/objective_c/config.yaml new file mode 100644 index 0000000000..94764ca409 --- /dev/null +++ b/pkgs/ffigen/example/objective_c/config.yaml @@ -0,0 +1,13 @@ +name: AVFAudio +description: Bindings for AVFAudio. +language: objc +output: 'avf_audio_bindings.dart' +exclude-all-by-default: true +objc-interfaces: + include: + - 'AVAudioPlayer' +headers: + entry-points: + - '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioPlayer.h' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field, return_of_invalid_type, void_checks, annotate_overrides, no_leading_underscores_for_local_identifiers, library_private_types_in_public_api diff --git a/pkgs/ffigen/example/objective_c/pubspec.yaml b/pkgs/ffigen/example/objective_c/pubspec.yaml index ab1e395678..33b0c31936 100644 --- a/pkgs/ffigen/example/objective_c/pubspec.yaml +++ b/pkgs/ffigen/example/objective_c/pubspec.yaml @@ -13,18 +13,3 @@ dev_dependencies: ffigen: path: '../../' lints: ^2.0.0 - -ffigen: - name: AVFAudio - description: Bindings for AVFAudio. - language: objc - output: 'avf_audio_bindings.dart' - exclude-all-by-default: true - objc-interfaces: - include: - - 'AVAudioPlayer' - headers: - entry-points: - - '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioPlayer.h' - preamble: | - // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field, return_of_invalid_type, void_checks, annotate_overrides, no_leading_underscores_for_local_identifiers, library_private_types_in_public_api diff --git a/pkgs/ffigen/example/simple/README.md b/pkgs/ffigen/example/simple/README.md index 026ae9f64a..81d95692fe 100644 --- a/pkgs/ffigen/example/simple/README.md +++ b/pkgs/ffigen/example/simple/README.md @@ -5,6 +5,6 @@ A very simple example, generates bindings for a very small header file (`headers ## Generating bindings At the root of this example (`example/simple`), run - ``` -dart run ffigen +dart run ffigen --config config.yaml ``` This will generate bindings in a file: [generated_bindings.dart](./generated_bindings.dart). diff --git a/pkgs/ffigen/example/simple/config.yaml b/pkgs/ffigen/example/simple/config.yaml new file mode 100644 index 0000000000..82ed925195 --- /dev/null +++ b/pkgs/ffigen/example/simple/config.yaml @@ -0,0 +1,6 @@ +name: NativeLibrary +description: Bindings to `headers/example.h`. +output: 'generated_bindings.dart' +headers: + entry-points: + - 'headers/example.h' \ No newline at end of file diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index 33b93ebae4..d59f53e066 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -14,10 +14,3 @@ dev_dependencies: path: '../../' lints: ^2.0.1 -ffigen: - name: NativeLibrary - description: Bindings to `headers/example.h`. - output: 'generated_bindings.dart' - headers: - entry-points: - - 'headers/example.h' diff --git a/pkgs/ffigen/example/swift/README.md b/pkgs/ffigen/example/swift/README.md index 05c1c3442c..d53778e14b 100644 --- a/pkgs/ffigen/example/swift/README.md +++ b/pkgs/ffigen/example/swift/README.md @@ -22,7 +22,7 @@ Once you have an Objective-C wrapper header, ffigen can parse it like any other header: ```shell -dart run ffigen +dart run ffigen --config config.yaml ``` This will generate [swift_api_bindings.dart](./swift_api_bindings.dart), diff --git a/pkgs/ffigen/example/swift/config.yaml b/pkgs/ffigen/example/swift/config.yaml new file mode 100644 index 0000000000..e1a83225a3 --- /dev/null +++ b/pkgs/ffigen/example/swift/config.yaml @@ -0,0 +1,19 @@ +name: SwiftLibrary +description: Bindings for swift_api. +language: objc +output: 'swift_api_bindings.dart' +exclude-all-by-default: true +objc-interfaces: + include: + - 'SwiftClass' + module: + 'SwiftClass': 'swift_module' +headers: + entry-points: + - 'swift_api.h' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names + // ignore_for_file: unused_element, unused_field, return_of_invalid_type + // ignore_for_file: void_checks, annotate_overrides + // ignore_for_file: no_leading_underscores_for_local_identifiers + // ignore_for_file: library_private_types_in_public_api \ No newline at end of file diff --git a/pkgs/ffigen/example/swift/pubspec.yaml b/pkgs/ffigen/example/swift/pubspec.yaml index 8bd5e710eb..d00ffa9190 100644 --- a/pkgs/ffigen/example/swift/pubspec.yaml +++ b/pkgs/ffigen/example/swift/pubspec.yaml @@ -13,24 +13,3 @@ dev_dependencies: ffigen: path: '../../' lints: ^2.0.0 - -ffigen: - name: SwiftLibrary - description: Bindings for swift_api. - language: objc - output: 'swift_api_bindings.dart' - exclude-all-by-default: true - objc-interfaces: - include: - - 'SwiftClass' - module: - 'SwiftClass': 'swift_module' - headers: - entry-points: - - 'swift_api.h' - preamble: | - // ignore_for_file: camel_case_types, non_constant_identifier_names - // ignore_for_file: unused_element, unused_field, return_of_invalid_type - // ignore_for_file: void_checks, annotate_overrides - // ignore_for_file: no_leading_underscores_for_local_identifiers - // ignore_for_file: library_private_types_in_public_api diff --git a/pkgs/ffigen/example/swift/swift_api.h b/pkgs/ffigen/example/swift/swift_api.h index 45e5010ff9..0928c492b6 100644 --- a/pkgs/ffigen/example/swift/swift_api.h +++ b/pkgs/ffigen/example/swift/swift_api.h @@ -1,4 +1,4 @@ -// Generated by Apple Swift version 5.5.2 (swiftlang-1300.0.40.106 clang-1300.0.29.21) +// Generated by Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) #ifndef SWIFT_MODULE_SWIFT_H #define SWIFT_MODULE_SWIFT_H #pragma clang diagnostic push @@ -21,11 +21,20 @@ # include #endif +#pragma clang diagnostic ignored "-Wduplicate-method-match" #pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) #include +#endif +#if defined(__cplusplus) +#include +#include +#include +#else #include #include #include +#endif #if !defined(SWIFT_TYPEDEFS) # define SWIFT_TYPEDEFS 1 @@ -181,9 +190,40 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #else # define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif +#if defined(__OBJC__) #if !defined(IBSegueAction) # define IBSegueAction #endif +#endif +#if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif +#if defined(__cplusplus) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept +#endif +#else +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT +#endif +#endif +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} +#endif +#endif +#if defined(__OBJC__) #if __has_feature(modules) #if __has_warning("-Watimport-in-framework-header") #pragma clang diagnostic ignored "-Watimport-in-framework-header" @@ -191,6 +231,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); @import ObjectiveC; #endif +#endif #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") @@ -198,6 +239,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) # pragma push_macro("any") @@ -206,8 +248,8 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); # pragma pop_macro("any") #endif +#if defined(__OBJC__) @class NSString; -@class NSNumber; SWIFT_CLASS("_TtC12swift_module10SwiftClass") @interface SwiftClass : NSObject @@ -216,6 +258,9 @@ SWIFT_CLASS("_TtC12swift_module10SwiftClass") - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; @end +#endif +#if defined(__cplusplus) +#endif #if __has_attribute(external_source_symbol) # pragma clang attribute pop #endif diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 6290bac811..e012e56a87 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -19,7 +19,7 @@ final _logger = Logger('ffigen.config_provider.config'); /// Provides configurations to other modules. /// -/// Handles validation, extraction of confiurations from yaml file. +/// Handles validation, extraction of configurations from a yaml file. class Config { /// Input filename. String? get filename => _filename; diff --git a/pkgs/ffigen/test/collision_tests/decl_type_name_collision_test.dart b/pkgs/ffigen/test/collision_tests/decl_type_name_collision_test.dart index 40d9f88d28..19e9497f73 100644 --- a/pkgs/ffigen/test/collision_tests/decl_type_name_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/decl_type_name_collision_test.dart @@ -3,12 +3,10 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -18,7 +16,7 @@ void main() { setUpAll(() { logWarnings(Level.SEVERE); actual = parser.parse( - Config.fromYaml(yaml.loadYaml(''' + testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'Decl type name collision test' ${strings.output}: 'unused' @@ -27,7 +25,7 @@ ${strings.headers}: - 'test/collision_tests/decl_type_name_collision.h' ${strings.preamble}: | // ignore_for_file: non_constant_identifier_names, - ''') as yaml.YamlMap), + '''), ); }); diff --git a/pkgs/ffigen/test/config_tests/compiler_opts_test.dart b/pkgs/ffigen/test/config_tests/compiler_opts_test.dart index 5193d4dba2..0b711acd6b 100644 --- a/pkgs/ffigen/test/config_tests/compiler_opts_test.dart +++ b/pkgs/ffigen/test/config_tests/compiler_opts_test.dart @@ -6,7 +6,8 @@ import 'package:ffigen/ffigen.dart'; import 'package:ffigen/src/config_provider/spec_utils.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; + +import '../test_utils.dart'; late Library actual, expected; @@ -28,7 +29,7 @@ void main() { ); }); test('Compiler Opts Automatic', () { - final config = Config.fromYaml(yaml.loadYaml(''' + final config = testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'Compiler Opts Test' ${strings.output}: 'unused' @@ -38,7 +39,7 @@ ${strings.headers}: ${strings.compilerOptsAuto}: ${strings.macos}: ${strings.includeCStdLib}: false - ''') as yaml.YamlMap); + '''); expect(config.compilerOpts.isEmpty, true); }); }); diff --git a/pkgs/ffigen/test/config_tests/exclude_all_by_default_test.dart b/pkgs/ffigen/test/config_tests/exclude_all_by_default_test.dart index 40bf1b29b4..361e4b27f8 100644 --- a/pkgs/ffigen/test/config_tests/exclude_all_by_default_test.dart +++ b/pkgs/ffigen/test/config_tests/exclude_all_by_default_test.dart @@ -6,14 +6,13 @@ import 'package:ffigen/ffigen.dart'; import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; void main() { group('exclude_all_by_default', () { test('exclude_all_by_default test flag false', () { - final config = Config.fromYaml(yaml.loadYaml(''' + final config = testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'exclude_all_by_default test' ${strings.output}: 'unused' @@ -21,7 +20,7 @@ ${strings.excludeAllByDefault}: false ${strings.headers}: ${strings.entryPoints}: - 'test/config_tests/exclude_all_by_default.h' -''') as yaml.YamlMap); +'''); final library = parse(config); expect(library.getBinding('func'), isA()); @@ -34,7 +33,7 @@ ${strings.headers}: }); test('exclude_all_by_default test flag true', () { - final config = Config.fromYaml(yaml.loadYaml(''' + final config = testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'exclude_all_by_default test' ${strings.output}: 'unused' @@ -42,7 +41,7 @@ ${strings.excludeAllByDefault}: true ${strings.headers}: ${strings.entryPoints}: - 'test/config_tests/exclude_all_by_default.h' -''') as yaml.YamlMap); +'''); final library = parse(config); expect(() => library.getBinding('func'), throwsException); diff --git a/pkgs/ffigen/test/config_tests/include_exclude_test.dart b/pkgs/ffigen/test/config_tests/include_exclude_test.dart index 5cc1156d59..1f278859ac 100644 --- a/pkgs/ffigen/test/config_tests/include_exclude_test.dart +++ b/pkgs/ffigen/test/config_tests/include_exclude_test.dart @@ -5,7 +5,6 @@ import 'package:ffigen/ffigen.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -69,6 +68,6 @@ $field: } } - final config = Config.fromYaml(yaml.loadYaml(templateString) as yaml.YamlMap); + final config = testConfig(templateString); return config; } diff --git a/pkgs/ffigen/test/config_tests/packed_struct_override_test.dart b/pkgs/ffigen/test/config_tests/packed_struct_override_test.dart index cb0bf3c341..68f8954185 100644 --- a/pkgs/ffigen/test/config_tests/packed_struct_override_test.dart +++ b/pkgs/ffigen/test/config_tests/packed_struct_override_test.dart @@ -6,7 +6,6 @@ import 'package:ffigen/ffigen.dart'; import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -24,21 +23,15 @@ ${strings.headers}: ${strings.structs}: ${strings.structPack}: '''; - expect( - () => Config.fromYaml( - yaml.loadYaml("$baseYaml'.*': null") as yaml.YamlMap), + expect(() => testConfig("$baseYaml'.*': null"), throwsA(TypeMatcher())); - expect( - () => Config.fromYaml( - yaml.loadYaml("$baseYaml'.*': 3") as yaml.YamlMap), + expect(() => testConfig("$baseYaml'.*': 3"), throwsA(TypeMatcher())); - expect( - () => Config.fromYaml( - yaml.loadYaml("$baseYaml'.*': 32") as yaml.YamlMap), + expect(() => testConfig("$baseYaml'.*': 32"), throwsA(TypeMatcher())); }); test('Override values', () { - final config = Config.fromYaml(yaml.loadYaml(''' + final config = testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'Packed Struct Override Test' ${strings.output}: 'unused' @@ -50,7 +43,7 @@ ${strings.structs}: 'Normal.*': 1 'StructWithAttr': 2 'PackedAttr': none - ''') as yaml.YamlMap); + '''); final library = parse(config); diff --git a/pkgs/ffigen/test/config_tests/unknown_keys_warn_test.dart b/pkgs/ffigen/test/config_tests/unknown_keys_warn_test.dart index 4fcb680ec1..3dd04517f2 100644 --- a/pkgs/ffigen/test/config_tests/unknown_keys_warn_test.dart +++ b/pkgs/ffigen/test/config_tests/unknown_keys_warn_test.dart @@ -6,7 +6,6 @@ import 'package:ffigen/ffigen.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -18,7 +17,7 @@ void main() { setUpAll(() { final logArr = []; logWarningsToArray(logArr, Level.WARNING); - Config.fromYaml(yaml.loadYaml(''' + testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'Warn for unknown keys.' ${strings.output}: 'unused' @@ -35,7 +34,7 @@ ${strings.structs}: 'warn-5': 'skip' ${strings.unions}: 'warn-6': 'skip' - ''') as yaml.YamlMap); + '''); logString = logArr.join("\n"); }); test('Warn for unknown keys.', () { diff --git a/pkgs/ffigen/test/example_tests/cjson_example_test.dart b/pkgs/ffigen/test/example_tests/cjson_example_test.dart index 44246155fc..714cb70b56 100644 --- a/pkgs/ffigen/test/example_tests/cjson_example_test.dart +++ b/pkgs/ffigen/test/example_tests/cjson_example_test.dart @@ -2,12 +2,10 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:ffigen/src/config_provider/config.dart'; import 'package:ffigen/src/header_parser.dart'; -import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; +import 'package:path/path.dart' as path; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart'; import '../test_utils.dart'; @@ -17,45 +15,14 @@ void main() { logWarnings(Level.SEVERE); }); test('c_json', () { - final config = Config.fromYaml(loadYaml(''' -${strings.output}: 'cjson_generated_bindings.dart' -${strings.name}: 'CJson' -${strings.description}: 'Holds bindings to cJSON.' -${strings.headers}: - ${strings.entryPoints}: - - 'third_party/cjson_library/cJSON.h' - ${strings.includeDirectives}: - - '**cJSON.h' -${strings.comments}: false -${strings.preamble}: | - // Copyright (c) 2009-2017 Dave Gamble and cJSON contributors - // - // Permission is hereby granted, free of charge, to any person obtaining a copy - // of this software and associated documentation files (the "Software"), to deal - // in the Software without restriction, including without limitation the rights - // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - // copies of the Software, and to permit persons to whom the Software is - // furnished to do so, subject to the following conditions: - // - // The above copyright notice and this permission notice shall be included in - // all copies or substantial portions of the Software. - // - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - // THE SOFTWARE. - - // ignore_for_file: camel_case_types, non_constant_identifier_names -''') as YamlMap); + final config = + testConfigFromPath(path.join('example', 'c_json', 'config.yaml')); final library = parse(config); matchLibraryWithExpected( library, 'example_c_json.dart', - ['example', 'c_json', config.output], + [config.output], ); }); }); diff --git a/pkgs/ffigen/test/example_tests/ffinative_example_test.dart b/pkgs/ffigen/test/example_tests/ffinative_example_test.dart index 779b41a01a..28588b16c2 100644 --- a/pkgs/ffigen/test/example_tests/ffinative_example_test.dart +++ b/pkgs/ffigen/test/example_tests/ffinative_example_test.dart @@ -2,12 +2,10 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:ffigen/src/config_provider/config.dart'; import 'package:ffigen/src/header_parser.dart'; -import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; +import 'package:path/path.dart' as path; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart'; import '../test_utils.dart'; @@ -18,23 +16,14 @@ void main() { }); test('ffinative', () { - final config = Config.fromYaml(loadYaml(''' -${strings.name}: NativeLibrary -${strings.ffiNative}: -${strings.description}: Bindings to `headers/example.h`. -${strings.output}: 'generated_bindings.dart' -${strings.headers}: - ${strings.entryPoints}: - - 'example/ffinative/headers/example.h' -${strings.preamble}: | - // ignore_for_file: deprecated_member_use -''') as YamlMap); + final config = + testConfigFromPath(path.join('example', 'ffinative', 'config.yaml')); final library = parse(config); matchLibraryWithExpected( library, 'example_ffinative.dart', - ['example', 'ffinative', config.output], + [config.output], ); }); }); diff --git a/pkgs/ffigen/test/example_tests/libclang_example_test.dart b/pkgs/ffigen/test/example_tests/libclang_example_test.dart index c226c4cfe6..8414e499c6 100644 --- a/pkgs/ffigen/test/example_tests/libclang_example_test.dart +++ b/pkgs/ffigen/test/example_tests/libclang_example_test.dart @@ -2,12 +2,14 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'dart:io'; + +import 'package:ffigen/src/code_generator/library.dart'; import 'package:ffigen/src/config_provider/config.dart'; import 'package:ffigen/src/header_parser.dart'; -import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; +import 'package:path/path.dart' as path; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart'; import '../test_utils.dart'; @@ -17,65 +19,20 @@ void main() { logWarnings(Level.SEVERE); }); test('libclang-example', () { - final config = Config.fromYaml(loadYaml(''' -${strings.output}: 'generated_bindings.dart' -${strings.headers}: - ${strings.entryPoints}: - - third_party/libclang/include/clang-c/Index.h - ${strings.includeDirectives}: - - '**CXString.h' - - '**Index.h' - -${strings.compilerOpts}: '-Ithird_party/libclang/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -Wno-nullability-completeness' -${strings.functions}: - ${strings.include}: - - 'clang_.*' - ${strings.symbolAddress}: - ${strings.include}: - - 'clang_.*' - ${strings.exposeFunctionTypedefs}: - ${strings.include}: - - 'clang_.*' -${strings.structs}: - ${strings.include}: - - 'CX.*' -${strings.enums}: - ${strings.include}: - - 'CXTypeKind' - - 'CXGlobalOptFlags' -${strings.libraryImports}: - custom_import: 'custom_import.dart' -${strings.typeMap}: - ${strings.typeMapTypedefs}: - 'time_t': - lib: 'ffi' - c-type: 'Int64' - dart-type: 'int' - ${strings.typeMapStructs}: - 'CXCursorSetImpl': - lib: 'custom_import' - c-type: 'CXCursorSetImpl' - dart-type: 'CXCursorSetImpl' -${strings.name}: 'LibClang' -${strings.description}: 'Holds bindings to LibClang.' -${strings.comments}: - ${strings.style}: ${strings.doxygen} - ${strings.length}: ${strings.full} - -${strings.preamble}: | - // Part of the LLVM Project, under the Apache License v2.0 with LLVM - // Exceptions. - // See https://llvm.org/LICENSE.txt for license information. - // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - - // ignore_for_file: camel_case_types, non_constant_identifier_names -''') as YamlMap); - final library = parse(config); + final configYaml = + File(path.join('example', 'libclang-example', 'config.yaml')) + .absolute; + late Config config; + late Library library; + withChDir(configYaml.path, () { + config = testConfigFromPath(configYaml.path); + library = parse(config); + }); matchLibraryWithExpected( library, 'example_libclang.dart', - ['example', 'libclang-example', config.output], + [config.output], ); }); }); diff --git a/pkgs/ffigen/test/example_tests/objective_c_example_test.dart b/pkgs/ffigen/test/example_tests/objective_c_example_test.dart index b53f341862..b291edbc0b 100644 --- a/pkgs/ffigen/test/example_tests/objective_c_example_test.dart +++ b/pkgs/ffigen/test/example_tests/objective_c_example_test.dart @@ -5,13 +5,10 @@ // Objective C support is only available on mac. @TestOn('mac-os') -import 'dart:io'; - -import 'package:ffigen/src/config_provider/config.dart'; import 'package:ffigen/src/header_parser.dart'; import 'package:logging/logging.dart'; +import 'package:path/path.dart' as path; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart'; import '../test_utils.dart'; @@ -22,9 +19,8 @@ void main() { }); test('objective_c', () { - final pubspecFile = File('example/objective_c/pubspec.yaml'); - final pubspecYaml = loadYaml(pubspecFile.readAsStringSync()) as YamlMap; - final config = Config.fromYaml(pubspecYaml['ffigen'] as YamlMap); + final config = testConfigFromPath( + path.join('example', 'objective_c', 'config.yaml')); final output = parse(config).generate(); // Verify that the output contains all the methods and classes that the diff --git a/pkgs/ffigen/test/example_tests/shared_bindings_example_test.dart b/pkgs/ffigen/test/example_tests/shared_bindings_example_test.dart index 290ea40906..0d4e39b104 100644 --- a/pkgs/ffigen/test/example_tests/shared_bindings_example_test.dart +++ b/pkgs/ffigen/test/example_tests/shared_bindings_example_test.dart @@ -2,12 +2,10 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:ffigen/src/config_provider/config.dart'; import 'package:ffigen/src/header_parser.dart'; -import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; +import 'package:path/path.dart' as path; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart'; import '../test_utils.dart'; @@ -18,48 +16,33 @@ void main() { }); test('a_shared_base bindings', () { - final config = Config.fromYaml(loadYaml(''' -${strings.name}: NativeLibraryASharedB -${strings.description}: Bindings to `headers/a.h` with shared definitions from `headers/base.h`. -${strings.output}: 'lib/generated/a_shared_b_gen.dart' -${strings.headers}: - ${strings.entryPoints}: - - 'example/shared_bindings/headers/a.h' -${strings.import}: - ${strings.symbolFilesImport}: - - 'example/shared_bindings/lib/generated/base_symbols.yaml' -${strings.preamble}: | - // ignore_for_file: non_constant_identifier_names, camel_case_types -''') as YamlMap); + final config = testConfigFromPath(path.join( + 'example', + 'shared_bindings', + 'ffigen_configs', + 'a_shared_base.yaml', + )); final library = parse(config); matchLibraryWithExpected( library, 'example_shared_bindings.dart', - ['example', 'shared_bindings', config.output], + [config.output], ); }); test('base symbol file output', () { - final config = Config.fromYaml(loadYaml(''' -${strings.name}: NativeLibraryBase -${strings.description}: Bindings to `headers/base.h`. -${strings.output}: - ${strings.bindings}: 'lib/generated/base_gen.dart' - ${strings.symbolFile}: - ${strings.output}: 'lib/generated/base_symbols.yaml' - ${strings.importPath}: 'package:shared_bindings/generated/base_gen.dart' -${strings.headers}: - ${strings.entryPoints}: - - 'example/shared_bindings/headers/base.h' -${strings.preamble}: | - // ignore_for_file: non_constant_identifier_names, camel_case_types -''') as YamlMap); + final config = testConfigFromPath(path.join( + 'example', + 'shared_bindings', + 'ffigen_configs', + 'base.yaml', + )); final library = parse(config); matchLibrarySymbolFileWithExpected( library, 'example_shared_bindings.yaml', - ['example', 'shared_bindings', config.symbolFile!.output], + [config.symbolFile!.output], config.symbolFile!.importPath, ); }); diff --git a/pkgs/ffigen/test/example_tests/simple_example_test.dart b/pkgs/ffigen/test/example_tests/simple_example_test.dart index b79b576f03..343bf1ccdf 100644 --- a/pkgs/ffigen/test/example_tests/simple_example_test.dart +++ b/pkgs/ffigen/test/example_tests/simple_example_test.dart @@ -2,12 +2,10 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:ffigen/src/config_provider/config.dart'; import 'package:ffigen/src/header_parser.dart'; -import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; +import 'package:path/path.dart' as path; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart'; import '../test_utils.dart'; @@ -18,20 +16,17 @@ void main() { }); test('simple', () { - final config = Config.fromYaml(loadYaml(''' -${strings.name}: NativeLibrary -${strings.description}: Bindings to `headers/example.h`. -${strings.output}: 'generated_bindings.dart' -${strings.headers}: - ${strings.entryPoints}: - - 'example/simple/headers/example.h' -''') as YamlMap); + final config = testConfigFromPath(path.join( + 'example', + 'simple', + 'config.yaml', + )); final library = parse(config); matchLibraryWithExpected( library, 'example_simple.dart', - ['example', 'simple', config.output], + [config.output], ); }); }); diff --git a/pkgs/ffigen/test/example_tests/swift_example_test.dart b/pkgs/ffigen/test/example_tests/swift_example_test.dart index 05c854cb6b..02ed00ad02 100644 --- a/pkgs/ffigen/test/example_tests/swift_example_test.dart +++ b/pkgs/ffigen/test/example_tests/swift_example_test.dart @@ -8,12 +8,10 @@ import 'dart:async'; import 'dart:io'; -import 'package:ffigen/src/config_provider/config.dart'; import 'package:ffigen/src/header_parser.dart'; import 'package:logging/logging.dart'; -import 'package:path/path.dart' as p; +import 'package:path/path.dart' as path; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart'; import '../test_utils.dart'; @@ -38,16 +36,17 @@ void main() { '-o', 'libswiftapi.dylib', ], - workingDirectory: p.join(Directory.current.path, 'example/swift')); + workingDirectory: path.join(Directory.current.path, 'example/swift')); unawaited(stdout.addStream(process.stdout)); unawaited(stderr.addStream(process.stderr)); final result = await process.exitCode; expect(result, 0); - final pubspecFile = File('example/swift/pubspec.yaml'); - final pubspecYaml = loadYaml(pubspecFile.readAsStringSync()) as YamlMap; - final config = Config.fromYaml(pubspecYaml['ffigen'] as YamlMap, - filename: pubspecFile.path); + final config = testConfigFromPath(path.join( + 'example', + 'swift', + 'config.yaml', + )); final output = parse(config).generate(); // Verify that the output contains all the methods and classes that the diff --git a/pkgs/ffigen/test/header_parser_tests/comment_markup_test.dart b/pkgs/ffigen/test/header_parser_tests/comment_markup_test.dart index b7e5cfa610..e31098aadd 100644 --- a/pkgs/ffigen/test/header_parser_tests/comment_markup_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/comment_markup_test.dart @@ -3,12 +3,10 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -18,7 +16,7 @@ void main() { setUpAll(() { logWarnings(Level.SEVERE); actual = parser.parse( - Config.fromYaml(yaml.loadYaml(''' + testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'Comment Markup Test' ${strings.output}: 'unused' @@ -28,7 +26,7 @@ ${strings.headers}: ${strings.comments}: ${strings.style}: ${strings.any} ${strings.length}: ${strings.full} - ''') as yaml.YamlMap), + '''), ); }); diff --git a/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart b/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart index dec4deca04..484d8b0a9f 100644 --- a/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart @@ -4,12 +4,10 @@ import 'package:cli_util/cli_util.dart'; import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/strings.dart' as strings; import 'package:path/path.dart' as path; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -20,7 +18,7 @@ void main() { setUpAll(() { logWarnings(); actual = parser.parse( - Config.fromYaml(yaml.loadYaml(''' + testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'Dart_Handle Test' ${strings.output}: 'unused' @@ -31,7 +29,7 @@ ${strings.headers}: - 'test/header_parser_tests/dart_handle.h' ${strings.includeDirectives}: - '**dart_handle.h' - ''') as yaml.YamlMap), + '''), ); }); test('Expected Bindings', () { diff --git a/pkgs/ffigen/test/header_parser_tests/forward_decl_test.dart b/pkgs/ffigen/test/header_parser_tests/forward_decl_test.dart index f8f5894e24..73b9f32102 100644 --- a/pkgs/ffigen/test/header_parser_tests/forward_decl_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/forward_decl_test.dart @@ -3,12 +3,10 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -18,14 +16,14 @@ void main() { setUpAll(() { logWarnings(Level.SEVERE); actual = parser.parse( - Config.fromYaml(yaml.loadYaml(''' + testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'Forward Declaration Test' ${strings.output}: 'unused' ${strings.headers}: ${strings.entryPoints}: - 'test/header_parser_tests/forward_decl.h' - ''') as yaml.YamlMap), + '''), ); }); diff --git a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart index 98dfafec4d..b61070c57a 100644 --- a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart @@ -3,12 +3,10 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -20,7 +18,7 @@ void main() { logWarnings(Level.SEVERE); expected = expectedLibrary(); actual = parser.parse( - Config.fromYaml(yaml.loadYaml(''' + testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'Function And Struct Test' ${strings.output}: 'unused' @@ -28,7 +26,7 @@ ${strings.output}: 'unused' ${strings.headers}: ${strings.entryPoints}: - 'test/header_parser_tests/function_n_struct.h' - ''') as yaml.YamlMap), + '''), ); }); diff --git a/pkgs/ffigen/test/header_parser_tests/functions_test.dart b/pkgs/ffigen/test/header_parser_tests/functions_test.dart index b2718aa1a2..97685b0a21 100644 --- a/pkgs/ffigen/test/header_parser_tests/functions_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/functions_test.dart @@ -3,11 +3,9 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/strings.dart' as strings; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -18,7 +16,7 @@ void main() { setUpAll(() { logWarnings(); actual = parser.parse( - Config.fromYaml(yaml.loadYaml(''' + testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'Functions Test' ${strings.output}: 'unused' @@ -40,7 +38,7 @@ ${strings.functions}: ${strings.preamble}: | // ignore_for_file: camel_case_types - ''') as yaml.YamlMap), + '''), ); }); test('Expected Bindings', () { diff --git a/pkgs/ffigen/test/header_parser_tests/globals_test.dart b/pkgs/ffigen/test/header_parser_tests/globals_test.dart index 1872ced9ce..55184a8608 100644 --- a/pkgs/ffigen/test/header_parser_tests/globals_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/globals_test.dart @@ -3,11 +3,9 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/strings.dart' as strings; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -19,7 +17,7 @@ void main() { logWarnings(); expected = expectedLibrary(); actual = parser.parse( - Config.fromYaml(yaml.loadYaml(''' + testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'Globals Test' ${strings.output}: 'unused' @@ -37,7 +35,7 @@ ${strings.globals}: - pointerToLongDouble - globalStruct ${strings.compilerOpts}: '-Wno-nullability-completeness' - ''') as yaml.YamlMap), + '''), ); }); diff --git a/pkgs/ffigen/test/header_parser_tests/imported_types_test.dart b/pkgs/ffigen/test/header_parser_tests/imported_types_test.dart index 2d26c1f042..fc02cff70d 100644 --- a/pkgs/ffigen/test/header_parser_tests/imported_types_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/imported_types_test.dart @@ -3,11 +3,9 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/strings.dart' as strings; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -18,7 +16,7 @@ void main() { setUpAll(() { logWarnings(); actual = parser.parse( - Config.fromYaml(yaml.loadYaml(''' + testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'Imported types test' ${strings.output}: 'unused' @@ -31,7 +29,7 @@ ${strings.headers}: ${strings.preamble}: | // ignore_for_file: camel_case_types - ''') as yaml.YamlMap), + '''), ); }); test('Expected Bindings', () { diff --git a/pkgs/ffigen/test/header_parser_tests/macros_test.dart b/pkgs/ffigen/test/header_parser_tests/macros_test.dart index 689a289808..70439ef482 100644 --- a/pkgs/ffigen/test/header_parser_tests/macros_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/macros_test.dart @@ -3,12 +3,10 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -20,7 +18,7 @@ void main() { logWarnings(Level.WARNING); expected = expectedLibrary(); actual = parser.parse( - Config.fromYaml(yaml.loadYaml(''' + testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'Macros Test' ${strings.output}: 'unused' @@ -29,7 +27,7 @@ ${strings.headers}: - 'test/header_parser_tests/macros.h' ${strings.includeDirectives}: - '**macros.h' - ''') as yaml.YamlMap), + '''), ); }); test('Total bindings count', () { diff --git a/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart index e576080b9a..180ff4d2ce 100644 --- a/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/native_func_typedef_test.dart @@ -3,12 +3,10 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -18,14 +16,14 @@ void main() { setUpAll(() { logWarnings(Level.SEVERE); actual = parser.parse( - Config.fromYaml(yaml.loadYaml(''' + testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'Native Func Typedef Test.' ${strings.output}: 'unused' ${strings.headers}: ${strings.entryPoints}: - 'test/header_parser_tests/native_func_typedef.h' - ''') as yaml.YamlMap), + '''), ); }); diff --git a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart index 813c74723d..75803a0b02 100644 --- a/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/nested_parsing_test.dart @@ -3,11 +3,9 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/strings.dart' as strings; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -19,7 +17,7 @@ void main() { logWarnings(); expected = expectedLibrary(); actual = parser.parse( - Config.fromYaml(yaml.loadYaml(''' + testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'Nested Parsing Test' ${strings.output}: 'unused' @@ -29,7 +27,7 @@ ${strings.headers}: ${strings.structs}: ${strings.exclude}: - Struct2 - ''') as yaml.YamlMap), + '''), ); }); diff --git a/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart b/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart index c2572d571d..fc73cfe8da 100644 --- a/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/opaque_dependencies_test.dart @@ -3,12 +3,10 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -18,7 +16,7 @@ void main() { setUpAll(() { logWarnings(Level.SEVERE); actual = parser.parse( - Config.fromYaml(yaml.loadYaml(''' + testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'Opaque Dependencies Test' ${strings.output}: 'unused' @@ -33,7 +31,7 @@ ${strings.unions}: ${strings.include}: - 'UE' ${strings.dependencyOnly}: ${strings.opaqueCompoundDependencies} - ''') as yaml.YamlMap), + '''), ); }); test('Expected bindings', () { diff --git a/pkgs/ffigen/test/header_parser_tests/packed_structs_test.dart b/pkgs/ffigen/test/header_parser_tests/packed_structs_test.dart index bbd1ea7f3f..62b70757b0 100644 --- a/pkgs/ffigen/test/header_parser_tests/packed_structs_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/packed_structs_test.dart @@ -3,12 +3,10 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -18,14 +16,14 @@ void main() { setUpAll(() { logWarnings(Level.SEVERE); actual = parser.parse( - Config.fromYaml(yaml.loadYaml(''' + testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'Packed Structs Test' ${strings.output}: 'unused' ${strings.headers}: ${strings.entryPoints}: - 'test/header_parser_tests/packed_structs.h' - ''') as yaml.YamlMap), + '''), ); }); diff --git a/pkgs/ffigen/test/header_parser_tests/regress_384_test.dart b/pkgs/ffigen/test/header_parser_tests/regress_384_test.dart index 054474c7be..b5751d10f8 100644 --- a/pkgs/ffigen/test/header_parser_tests/regress_384_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/regress_384_test.dart @@ -3,12 +3,10 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -18,7 +16,7 @@ void main() { setUpAll(() { logWarnings(Level.SEVERE); actual = parser.parse( - Config.fromYaml(yaml.loadYaml(''' + testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'Regression test for #384' ${strings.output}: 'unused' @@ -26,7 +24,7 @@ ${strings.headers}: ${strings.entryPoints}: - 'test/header_parser_tests/regress_384_header_1.h' - 'test/header_parser_tests/regress_384_header_2.h' - ''') as yaml.YamlMap), + '''), ); }); diff --git a/pkgs/ffigen/test/header_parser_tests/separate_definition_test.dart b/pkgs/ffigen/test/header_parser_tests/separate_definition_test.dart index 6b62adee1e..663bebff4e 100644 --- a/pkgs/ffigen/test/header_parser_tests/separate_definition_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/separate_definition_test.dart @@ -8,7 +8,6 @@ import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -38,13 +37,13 @@ Config _makeConfig(List entryPoints) { for (final ep in entryPoints) { entryPointBuilder.writeln(" - $ep"); } - final config = Config.fromYaml(yaml.loadYaml(''' + final config = testConfig(''' ${strings.name}: 'Bindings' ${strings.output}: 'unused' ${strings.headers}: ${strings.entryPoints}: ${entryPointBuilder.toString()} -''') as yaml.YamlMap); +'''); return config; } diff --git a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart index 0c75f308c7..51b90e6565 100644 --- a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart @@ -3,12 +3,10 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -19,7 +17,7 @@ void main() { setUpAll(() { logWarnings(Level.SEVERE); actual = parser.parse( - Config.fromYaml(yaml.loadYaml(''' + testConfig(''' ${strings.name}: 'Bindings' ${strings.output}: 'unused' @@ -40,7 +38,7 @@ ${strings.typeMap}: dart-type: 'int' ${strings.preamble}: | // ignore_for_file: unused_element, unused_field - ''') as yaml.YamlMap), + '''), ); }); diff --git a/pkgs/ffigen/test/header_parser_tests/unions_test.dart b/pkgs/ffigen/test/header_parser_tests/unions_test.dart index 8e8949ea7c..e248dfb812 100644 --- a/pkgs/ffigen/test/header_parser_tests/unions_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/unions_test.dart @@ -3,12 +3,10 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -18,14 +16,14 @@ void main() { setUpAll(() { logWarnings(Level.SEVERE); actual = parser.parse( - Config.fromYaml(yaml.loadYaml(''' + testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'Unions Test' ${strings.output}: 'unused' ${strings.headers}: ${strings.entryPoints}: - 'test/header_parser_tests/unions.h' - ''') as yaml.YamlMap), + '''), ); }); diff --git a/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart b/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart index ea9f32d302..eae9cf3a05 100644 --- a/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/unnamed_enums_test.dart @@ -3,11 +3,9 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/strings.dart' as strings; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -19,7 +17,7 @@ void main() { logWarnings(); expected = expectedLibrary(); actual = parser.parse( - Config.fromYaml(yaml.loadYaml(''' + testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'Unnamed Enums Test' ${strings.output}: 'unused' @@ -32,7 +30,7 @@ ${strings.enums}: ${strings.unnamedEnums}: ${strings.exclude}: - B - ''') as yaml.YamlMap), + '''), ); }); diff --git a/pkgs/ffigen/test/large_integration_tests/large_test.dart b/pkgs/ffigen/test/large_integration_tests/large_test.dart index 77fe1ec333..257ff26483 100644 --- a/pkgs/ffigen/test/large_integration_tests/large_test.dart +++ b/pkgs/ffigen/test/large_integration_tests/large_test.dart @@ -2,13 +2,11 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:ffigen/src/config_provider/config.dart'; import 'package:ffigen/src/header_parser.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import 'package:path/path.dart' as path; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart'; import '../test_utils.dart'; @@ -18,7 +16,7 @@ void main() { logWarnings(Level.SEVERE); }); test('Libclang test', () { - final config = Config.fromYaml(loadYaml(''' + final config = testConfig(''' ${strings.name}: LibClang ${strings.description}: Bindings to LibClang. ${strings.output}: unused @@ -45,7 +43,7 @@ ${strings.typeMap}: dart-type: 'int' ${strings.preamble}: | // ignore_for_file: camel_case_types, non_constant_identifier_names - ''') as YamlMap); + '''); final library = parse(config); matchLibraryWithExpected( @@ -60,7 +58,7 @@ ${strings.preamble}: | }); test('CJSON test', () { - final config = Config.fromYaml(loadYaml(''' + final config = testConfig(''' ${strings.name}: CJson ${strings.description}: Bindings to Cjson. ${strings.output}: unused @@ -73,7 +71,7 @@ ${strings.headers}: - '**cJSON.h' ${strings.preamble}: | // ignore_for_file: camel_case_types, non_constant_identifier_names - ''') as YamlMap); + '''); final library = parse(config); matchLibraryWithExpected( @@ -86,7 +84,7 @@ ${strings.preamble}: | test('SQLite test', () { // Excluding functions that use 'va_list' because it can either be a // Pointer<__va_list_tag> or int depending on the OS. - final config = Config.fromYaml(loadYaml(''' + final config = testConfig(''' ${strings.name}: SQLite ${strings.description}: Bindings to SQLite. ${strings.output}: unused @@ -105,7 +103,7 @@ ${strings.functions}: - sqlite3_str_vappendf ${strings.preamble}: | // ignore_for_file: camel_case_types, non_constant_identifier_names - ''') as YamlMap); + '''); final library = parse(config); matchLibraryWithExpected( diff --git a/pkgs/ffigen/test/native_objc_test/util.dart b/pkgs/ffigen/test/native_objc_test/util.dart index 1eb0746985..7ef14bf625 100644 --- a/pkgs/ffigen/test/native_objc_test/util.dart +++ b/pkgs/ffigen/test/native_objc_test/util.dart @@ -7,16 +7,17 @@ import 'dart:io'; import 'package:ffigen/ffigen.dart'; import 'package:path/path.dart' as path; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart'; + +import '../test_utils.dart'; void generateBindingsForCoverage(String testName) { // The ObjC test bindings are generated in setup.dart (see #362), which means // that the ObjC related bits of ffigen are missed by test coverage. So this // function just regenerates those bindings. It doesn't test anything except // that the generation succeeded, by asserting the file exists. - final config = Config.fromYaml(loadYaml( + final config = testConfig( File(path.join('test', 'native_objc_test', '${testName}_config.yaml')) - .readAsStringSync()) as YamlMap); + .readAsStringSync()); final library = parse(config); final file = File( path.join('test', 'debug_generated', '${testName}_test.dart'), diff --git a/pkgs/ffigen/test/native_test/config.yaml b/pkgs/ffigen/test/native_test/config.yaml index 6d8e475284..901e55975d 100644 --- a/pkgs/ffigen/test/native_test/config.yaml +++ b/pkgs/ffigen/test/native_test/config.yaml @@ -8,10 +8,10 @@ name: NativeLibrary description: 'Native tests.' -output: 'test/native_test/native_test_bindings.dart' +output: 'native_test_bindings.dart' headers: entry-points: - - 'test/native_test/native_test.c' + - 'native_test.c' include-directives: - '**native_test.c' diff --git a/pkgs/ffigen/test/native_test/native_test.dart b/pkgs/ffigen/test/native_test/native_test.dart index 4365214fbf..7a19c2a268 100644 --- a/pkgs/ffigen/test/native_test/native_test.dart +++ b/pkgs/ffigen/test/native_test/native_test.dart @@ -9,7 +9,6 @@ import 'dart:math'; import 'package:ffigen/ffigen.dart'; import 'package:path/path.dart' as path; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart'; import '../test_utils.dart'; import 'native_test_bindings.dart'; @@ -30,26 +29,31 @@ void main() { }); test('generate_bindings', () { - final config = Config.fromYaml(loadYaml( - File(path.join('test', 'native_test', 'config.yaml')) - .readAsStringSync()) as YamlMap); - final library = parse(config); - final file = File( + final configFile = + File(path.join('test', 'native_test', 'config.yaml')).absolute; + final outFile = File( path.join('test', 'debug_generated', 'native_test_bindings.dart'), - ); - library.generateFile(file); + ).absolute; + + late Config config; + withChDir(configFile.path, () { + config = testConfigFromPath(configFile.path); + }); + final library = parse(config); + + library.generateFile(outFile); try { - final actual = file.readAsStringSync().replaceAll('\r', ''); + final actual = outFile.readAsStringSync().replaceAll('\r', ''); final expected = File(path.join(config.output)) .readAsStringSync() .replaceAll('\r', ''); expect(actual, expected); - if (file.existsSync()) { - file.delete(); + if (outFile.existsSync()) { + outFile.delete(); } } catch (e) { - print('Failed test: Debug generated file: ${file.absolute.path}'); + print('Failed test: Debug generated file: ${outFile.absolute.path}'); rethrow; } }); diff --git a/pkgs/ffigen/test/regen.dart b/pkgs/ffigen/test/regen.dart index 5b0fc2cd16..1ee0df3c20 100644 --- a/pkgs/ffigen/test/regen.dart +++ b/pkgs/ffigen/test/regen.dart @@ -8,7 +8,7 @@ import 'dart:io'; import 'package:args/args.dart'; import 'package:ffigen/ffigen.dart'; import 'package:logging/logging.dart'; -import 'package:yaml/yaml.dart'; +import './test_utils.dart'; const usage = r'''Regenerates the Dart FFI bindings used in tests and examples. @@ -18,31 +18,12 @@ e.g. with this command: $ dart run test/setup.dart && dart run test/regen.dart && dart test '''; -Future _regenConfig(File yamlConfig, File bindingOutput, - {bool chDir = false}) async { +Future _regenConfig(File yamlConfig, File bindingOutput) async { yamlConfig = yamlConfig.absolute; bindingOutput = bindingOutput.absolute; - - Directory? oldDir; - var yaml = loadYaml(await yamlConfig.readAsString()) as YamlMap; - - if (chDir) { - oldDir = Directory.current; - Directory.current = yamlConfig.parent; - } - try { - if (yaml.containsKey("ffigen")) { - yaml = yaml["ffigen"] as YamlMap; - } - - final config = Config.fromYaml(yaml); - final library = parse(config); - library.generateFile(bindingOutput); - } finally { - if (oldDir != null) { - Directory.current = oldDir; - } - } + final config = testConfigFromPath(yamlConfig.path); + final library = parse(config); + library.generateFile(bindingOutput); } Future main(List args) async { @@ -69,18 +50,25 @@ Future main(List args) async { print('${record.level.name}: ${record.time}: ${record.message}'); }); - await _regenConfig(File('test/native_test/config.yaml'), - File('test/native_test/native_test_bindings.dart')); - - await _regenConfig(File('example/libclang-example/pubspec.yaml'), - File('example/libclang-example/generated_bindings.dart'), - chDir: true); - - await _regenConfig(File('example/simple/pubspec.yaml'), - File('example/simple/generated_bindings.dart'), - chDir: true); - - await _regenConfig(File('example/c_json/pubspec.yaml'), - File('example/c_json/cjson_generated_bindings.dart'), - chDir: true); + final nativeTestConfig = File('test/native_test/config.yaml').absolute; + final nativeTestOut = + File('test/native_test/native_test_bindings.dart').absolute; + await withChDir(nativeTestConfig.path, + () => _regenConfig(nativeTestConfig, nativeTestOut)); + + final libclangConfig = File('example/libclang-example/config.yaml').absolute; + final libclangOut = + File('example/libclang-example/generated_bindings.dart').absolute; + await withChDir( + libclangConfig.path, () => _regenConfig(libclangConfig, libclangOut)); + + final simpleConfig = File('example/simple/config.yaml').absolute; + final simpleOut = File('example/simple/generated_bindings.dart').absolute; + await withChDir( + simpleConfig.path, () => _regenConfig(simpleConfig, simpleOut)); + + final cJsonConfig = File('example/c_json/config.yaml').absolute; + final cJsonOut = + File('example/c_json/cjson_generated_bindings.dart').absolute; + await withChDir(cJsonConfig.path, () => _regenConfig(cJsonConfig, cJsonOut)); } diff --git a/pkgs/ffigen/test/rename_tests/rename_test.dart b/pkgs/ffigen/test/rename_tests/rename_test.dart index 0b976a89cb..24a136a03e 100644 --- a/pkgs/ffigen/test/rename_tests/rename_test.dart +++ b/pkgs/ffigen/test/rename_tests/rename_test.dart @@ -3,11 +3,9 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/config_provider.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/strings.dart' as strings; import 'package:test/test.dart'; -import 'package:yaml/yaml.dart' as yaml; import '../test_utils.dart'; @@ -22,7 +20,7 @@ void main() { setUpAll(() { logWarnings(); expected = expectedLibrary(); - actual = parser.parse(Config.fromYaml(yaml.loadYaml(''' + actual = parser.parse(testConfig(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'Rename Test' ${strings.output}: 'unused' @@ -78,7 +76,7 @@ ${strings.macros}: ${strings.typedefs}: ${strings.rename}: 'Struct5_Alias': 'Struct5_Alias_Renamed' - ''') as yaml.YamlMap)); + ''')); }); test('Function addPrefix', () { diff --git a/pkgs/ffigen/test/test_utils.dart b/pkgs/ffigen/test/test_utils.dart index 93ea29575b..50cb30e319 100644 --- a/pkgs/ffigen/test/test_utils.dart +++ b/pkgs/ffigen/test/test_utils.dart @@ -5,10 +5,13 @@ import 'dart:io'; import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/config_provider/config.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; +import 'package:package_config/package_config_types.dart'; import 'package:path/path.dart' as path; import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; extension LibraryTestExt on Library { /// Get a [Binding]'s generated string with a given name. @@ -44,7 +47,7 @@ void verifySetupFile(File file) { // Remove '\r' for Windows compatibility, then apply user's normalizer. String _normalizeGeneratedCode( String generated, String Function(String)? codeNormalizer) { - final noCR = generated.replaceAll('\r', ''); + final noCR = generated.replaceAll('\r', '').replaceAll(RegExp(r'\n+'), '\n'); if (codeNormalizer == null) return noCR; return codeNormalizer(noCR); } @@ -133,3 +136,37 @@ void logWarningsToArray(List logArr, [Level level = Level.WARNING]) { logArr.add('${record.level.name.padRight(8)}: ${record.message}'); }); } + +Config testConfig(String yamlBody, {String? filename}) { + return Config.fromYaml( + yaml.loadYaml(yamlBody) as yaml.YamlMap, + filename: filename, + packageConfig: PackageConfig([ + Package( + 'shared_bindings', + Uri.file(path.join(path.current, 'example', 'shared_bindings', 'lib/')), + ), + ]), + ); +} + +Config testConfigFromPath(String path) { + final file = File(path); + final yamlBody = file.readAsStringSync(); + return testConfig(yamlBody, filename: path); +} + +T withChDir(String path, T Function() inner) { + final oldDir = Directory.current; + Directory.current = File(path).parent; + + late T result; + + try { + result = inner(); + } finally { + Directory.current = oldDir; + } + + return result; +} From ac318a25ecd7bea6685f8b3f8cabbdea16519936 Mon Sep 17 00:00:00 2001 From: Tzvi Melamed Date: Thu, 13 Apr 2023 19:00:20 -0400 Subject: [PATCH 224/276] [ffigen] Explicit '' as name for anon structs/unions (#552) --- .../header_parser/sub_parsers/compounddecl_parser.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart index a88f5fce96..93d662df8b 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart @@ -300,16 +300,21 @@ int _compoundMembersVisitor(clang_types.CXCursor cursor, // otherwise they will be added in the next iteration. if (!cursor.isAnonymousRecordDecl()) break; + // Anonymous members are always unnamed. To avoid environment- + // dependent naming issues with the generated code, we explicitly + // use the empty string as spelling. + final spelling = ''; + parsed.compound.members.add( Member( dartDoc: getCursorDocComment( cursor, nesting.length + commentPrefix.length, ), - originalName: cursor.spelling(), + originalName: spelling, name: config.structDecl.renameMemberUsingConfig( parsed.compound.originalName, - cursor.spelling(), + spelling, ), type: mt, ), From 767f24495caeccbd915e111399d54a21f59f505b Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Wed, 19 Apr 2023 00:47:15 -0700 Subject: [PATCH 225/276] [ffigen] 3.0 Class modifiers (#553) --- .../ffigen/.github/workflows/test-package.yml | 14 ++-- pkgs/ffigen/CHANGELOG.md | 12 +++ .../c_json/cjson_generated_bindings.dart | 4 +- pkgs/ffigen/example/c_json/pubspec.yaml | 4 +- pkgs/ffigen/example/ffinative/pubspec.yaml | 4 +- .../libclang-example/custom_import.dart | 6 +- .../libclang-example/generated_bindings.dart | 74 ++++++++--------- .../example/libclang-example/pubspec.yaml | 4 +- .../objective_c/avf_audio_bindings.dart | 46 +++++------ pkgs/ffigen/example/objective_c/pubspec.yaml | 4 +- .../shared_bindings/lib/generated/a_gen.dart | 12 +-- .../lib/generated/a_shared_b_gen.dart | 4 +- .../lib/generated/base_gen.dart | 8 +- .../example/shared_bindings/pubspec.yaml | 4 +- pkgs/ffigen/example/simple/pubspec.yaml | 5 +- pkgs/ffigen/example/swift/pubspec.yaml | 4 +- .../example/swift/swift_api_bindings.dart | 38 ++++----- .../lib/src/code_generator/compound.dart | 2 +- .../ffigen/lib/src/code_generator/struct.dart | 2 +- pkgs/ffigen/lib/src/code_generator/union.dart | 2 +- .../clang_bindings/clang_bindings.dart | 14 ++-- .../type_extractor/extractor.dart | 4 +- pkgs/ffigen/pubspec.yaml | 4 +- .../_expected_boolean_dartbool_bindings.dart | 2 +- .../_expected_function_n_struct_bindings.dart | 2 +- .../_expected_global_bindings.dart | 4 +- ...internal_conflict_resolution_bindings.dart | 4 +- .../_expected_packed_structs_bindings.dart | 12 +-- .../_expected_sort_bindings_bindings.dart | 4 +- .../_expected_struct_bindings.dart | 8 +- .../_expected_typealias_bindings.dart | 8 +- .../_expected_unions_bindings.dart | 12 +-- ...ecl_symbol_address_collision_bindings.dart | 4 +- ...ted_decl_type_name_collision_bindings.dart | 8 +- .../_expected_comment_markup_bindings.dart | 2 +- .../_expected_dart_handle_bindings.dart | 4 +- .../_expected_forward_decl_bindings.dart | 2 +- ...expected_native_func_typedef_bindings.dart | 4 +- ...expected_opaque_dependencies_bindings.dart | 20 ++--- .../_expected_packed_structs_bindings.dart | 14 ++-- ..._expected_struct_fptr_fields_bindings.dart | 2 +- .../_expected_typedef_bindings.dart | 12 +-- .../_expected_unions_bindings.dart | 10 +-- .../_expected_cjson_bindings.dart | 4 +- .../_expected_libclang_bindings.dart | 80 +++++++++---------- .../_expected_sqlite_bindings.dart | 68 ++++++++-------- .../native_test/native_test_bindings.dart | 4 +- 47 files changed, 290 insertions(+), 279 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 8bcf6e6468..d9aa8a4d60 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -3,9 +3,9 @@ name: Dart CI on: # Run on PRs and pushes to the default branch. push: - branches: [ master, stable] + branches: [master, stable] pull_request: - branches: [ master, stable] + branches: [master, stable] schedule: - cron: "0 0 * * 0" @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: [stable] + sdk: [3.0.0-417.0.dev] # TODO(#554) steps: - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f @@ -44,7 +44,7 @@ jobs: - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: - sdk: stable + sdk: 3.0.0-417.0.dev # TODO(#554) - name: Install dependencies run: dart pub get - name: Install libclang-14-dev @@ -61,7 +61,7 @@ jobs: - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: - sdk: stable + sdk: 3.0.0-417.0.dev # TODO(#554) - name: Install dependencies run: dart pub get - name: Build test dylib and bindings @@ -83,7 +83,7 @@ jobs: - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: - sdk: stable + sdk: 3.0.0-417.0.dev # TODO(#554) - name: Install dependencies run: dart pub get - name: Build test dylib and bindings @@ -108,7 +108,7 @@ jobs: - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa with: - channel: 'master' + channel: "master" - name: Install dependencies run: flutter pub get - name: Build test dylib and bindings diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index e996b1ccfd..6b405764a0 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,15 @@ +# 8.0.0-dev.0 + +- Adds `final` class modifier to generated sub types `Struct`, `Union` and + `Opaque`. A class modifier is required in Dart 3.0 because the classes + `dart:ffi` as marked `base`. + When migrating a package that uses FFIgen, _and_ exposes the generated code in + the public API of the package, to Dart 3.0, that package does not + need a major version bump. Sub typing `Struct`, `Union` and + `Opaque` sub types is already disallowed by `dart:ffi` pre 3.0, so adding the + `final` keyword is not a breaking change. +- Bumps SDK lowerbound to 3.0. + # 7.2.10 - Generate parameter names in function pointer fields and typedefs. diff --git a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart index c520c20b33..0fb9e1aa88 100644 --- a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart +++ b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart @@ -1234,7 +1234,7 @@ class CJson { _cJSON_freePtr.asFunction)>(); } -class cJSON extends ffi.Struct { +final class cJSON extends ffi.Struct { external ffi.Pointer next; external ffi.Pointer prev; @@ -1255,7 +1255,7 @@ class cJSON extends ffi.Struct { external ffi.Pointer string; } -class cJSON_Hooks extends ffi.Struct { +final class cJSON_Hooks extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction Function(ffi.Size sz)>> malloc_fn; diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index 1733b5fc96..120d19743e 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -5,7 +5,7 @@ name: c_json_example environment: - sdk: '>=2.17.0 <4.0.0' + sdk: ">=3.0.0-417.0.dev <4.0.0" dependencies: ffi: ^2.0.1 @@ -13,5 +13,5 @@ dependencies: dev_dependencies: ffigen: - path: '../../' + path: "../../" lints: ^2.0.1 diff --git a/pkgs/ffigen/example/ffinative/pubspec.yaml b/pkgs/ffigen/example/ffinative/pubspec.yaml index 2247de409f..920ec996ba 100644 --- a/pkgs/ffigen/example/ffinative/pubspec.yaml +++ b/pkgs/ffigen/example/ffinative/pubspec.yaml @@ -5,11 +5,11 @@ name: ffinative_example environment: - sdk: '>=2.17.0 <4.0.0' + sdk: ">=3.0.0-417.0.dev <4.0.0" dependencies: ffi: ^2.0.1 dev_dependencies: ffigen: - path: '../../' + path: "../../" lints: ^2.0.0 diff --git a/pkgs/ffigen/example/libclang-example/custom_import.dart b/pkgs/ffigen/example/libclang-example/custom_import.dart index df11af43ca..dd6196c1f7 100644 --- a/pkgs/ffigen/example/libclang-example/custom_import.dart +++ b/pkgs/ffigen/example/libclang-example/custom_import.dart @@ -28,7 +28,7 @@ import 'dart:ffi'; Abi.windowsIA32: Uint32(), Abi.windowsX64: Uint64(), }) -class UintPtr extends AbiSpecificInteger { +final class UintPtr extends AbiSpecificInteger { const UintPtr(); } @@ -56,8 +56,8 @@ class UintPtr extends AbiSpecificInteger { Abi.windowsIA32: Uint32(), Abi.windowsX64: Uint32(), }) -class UnsignedLong extends AbiSpecificInteger { +final class UnsignedLong extends AbiSpecificInteger { const UnsignedLong(); } -class CXCursorSetImpl extends Opaque {} +final class CXCursorSetImpl extends Opaque {} diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index 800c5807ba..64de33cb1e 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -7647,14 +7647,14 @@ class _SymbolAddresses { /// 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 { +final class CXString extends ffi.Struct { external ffi.Pointer data; @ffi.UnsignedInt() external int private_flags; } -class CXStringSet extends ffi.Struct { +final class CXStringSet extends ffi.Struct { external ffi.Pointer Strings; @ffi.UnsignedInt() @@ -7671,16 +7671,16 @@ typedef NativeClang_disposeStringSet = ffi.Void Function( typedef DartClang_disposeStringSet = void Function( ffi.Pointer set1); -class CXTargetInfoImpl extends ffi.Opaque {} +final class CXTargetInfoImpl extends ffi.Opaque {} -class CXTranslationUnitImpl extends ffi.Opaque {} +final class CXTranslationUnitImpl extends ffi.Opaque {} /// 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 { +final class CXUnsavedFile extends ffi.Struct { /// The file whose contents have not yet been saved. /// /// This file must already exist in the file system. @@ -7695,7 +7695,7 @@ class CXUnsavedFile extends ffi.Struct { } /// Describes a version number of the form major.minor.subminor. -class CXVersion extends ffi.Struct { +final 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.Int() @@ -7768,7 +7768,7 @@ typedef DartClang_getFileTime = int Function(CXFile SFile); /// Uniquely identifies a CXFile, that refers to the same underlying file, /// across an indexing session. -class CXFileUniqueID extends ffi.Struct { +final class CXFileUniqueID extends ffi.Struct { @ffi.Array.multi([3]) external ffi.Array data; } @@ -7802,7 +7802,7 @@ typedef DartClang_File_tryGetRealPathName = CXString Function(CXFile file); /// /// Use clang_getExpansionLocation() or clang_getSpellingLocation() /// to map a source location to a particular file, line, and column. -class CXSourceLocation extends ffi.Struct { +final class CXSourceLocation extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; @@ -7814,7 +7814,7 @@ class CXSourceLocation extends ffi.Struct { /// /// Use clang_getRangeStart() and clang_getRangeEnd() to retrieve the /// starting and end locations from a source range, respectively. -class CXSourceRange extends ffi.Struct { +final class CXSourceRange extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; @@ -7929,7 +7929,7 @@ typedef NativeClang_getRangeEnd = CXSourceLocation Function( typedef DartClang_getRangeEnd = CXSourceLocation Function(CXSourceRange range); /// Identifies an array of ranges. -class CXSourceRangeList extends ffi.Struct { +final class CXSourceRangeList extends ffi.Struct { /// The number of ranges in the \c ranges array. @ffi.UnsignedInt() external int count; @@ -8251,7 +8251,7 @@ typedef NativeClang_getTUResourceUsageName = ffi.Pointer Function( typedef DartClang_getTUResourceUsageName = ffi.Pointer Function( int kind); -class CXTUResourceUsageEntry extends ffi.Struct { +final class CXTUResourceUsageEntry extends ffi.Struct { @ffi.Int32() external int kind; @@ -8260,7 +8260,7 @@ class CXTUResourceUsageEntry extends ffi.Struct { } /// The memory usage of a CXTranslationUnit, broken into categories. -class CXTUResourceUsage extends ffi.Struct { +final class CXTUResourceUsage extends ffi.Struct { external ffi.Pointer data; @ffi.UnsignedInt() @@ -8309,7 +8309,7 @@ typedef DartClang_TargetInfo_getPointerWidth = int Function(CXTargetInfo Info); /// 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 { +final class CXCursor extends ffi.Struct { @ffi.Int32() external int kind; @@ -9212,7 +9212,7 @@ typedef DartClang_getCursorAvailability = int Function(CXCursor cursor); /// 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 { +final class CXPlatformAvailability extends ffi.Struct { /// A string that describes the platform for which this structure /// provides availability information. /// @@ -9460,7 +9460,7 @@ abstract class CXTypeKind { } /// The type of an element in the abstract syntax tree. -class CXType extends ffi.Struct { +final class CXType extends ffi.Struct { @ffi.Int32() external int kind; @@ -10007,7 +10007,7 @@ typedef DartClang_getCursorReferenceNameRange = CXSourceRange Function( CXCursor C, int NameFlags, int PieceIndex); /// Describes a single preprocessing token. -class CXToken extends ffi.Struct { +final class CXToken extends ffi.Struct { @ffi.Array.multi([4]) external ffi.Array int_data; @@ -10104,7 +10104,7 @@ typedef DartClang_executeOnThread = void Function( int stack_size); /// A single result of code completion. -class CXCompletionResult extends ffi.Struct { +final 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 @@ -10332,7 +10332,7 @@ typedef DartClang_getCursorCompletionString = CXCompletionString Function( /// 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 { +final class CXCodeCompleteResults extends ffi.Struct { /// The code-completion results. external ffi.Pointer Results; @@ -10501,7 +10501,7 @@ typedef DartClang_remap_getFilenames = void Function( typedef NativeClang_remap_dispose = ffi.Void Function(CXRemapping arg0); typedef DartClang_remap_dispose = void Function(CXRemapping arg0); -class CXCursorAndRangeVisitor extends ffi.Struct { +final class CXCursorAndRangeVisitor extends ffi.Struct { external ffi.Pointer context; external ffi.Pointer< @@ -10540,7 +10540,7 @@ typedef DartClang_findIncludesInFile = int Function( CXTranslationUnit TU, CXFile file, CXCursorAndRangeVisitor visitor); /// Source location passed to index callbacks. -class CXIdxLoc extends ffi.Struct { +final class CXIdxLoc extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; @@ -10549,7 +10549,7 @@ class CXIdxLoc extends ffi.Struct { } /// Data for ppIncludedFile callback. -class CXIdxIncludedFileInfo extends ffi.Struct { +final class CXIdxIncludedFileInfo extends ffi.Struct { /// Location of '#' in the \#include/\#import directive. external CXIdxLoc hashLoc; @@ -10572,7 +10572,7 @@ class CXIdxIncludedFileInfo extends ffi.Struct { } /// Data for IndexerCallbacks#importedASTFile. -class CXIdxImportedASTFileInfo extends ffi.Struct { +final class CXIdxImportedASTFileInfo extends ffi.Struct { /// Top level AST file containing the imported PCH, module or submodule. external CXFile file; @@ -10588,7 +10588,7 @@ class CXIdxImportedASTFileInfo extends ffi.Struct { external int isImplicit; } -class CXIdxAttrInfo extends ffi.Struct { +final class CXIdxAttrInfo extends ffi.Struct { @ffi.Int32() external int kind; @@ -10604,7 +10604,7 @@ abstract class CXIdxAttrKind { static const int CXIdxAttr_IBOutletCollection = 3; } -class CXIdxEntityInfo extends ffi.Struct { +final class CXIdxEntityInfo extends ffi.Struct { @ffi.Int32() external int kind; @@ -10679,11 +10679,11 @@ abstract class CXIdxEntityLanguage { static const int CXIdxEntityLang_Swift = 4; } -class CXIdxContainerInfo extends ffi.Struct { +final class CXIdxContainerInfo extends ffi.Struct { external CXCursor cursor; } -class CXIdxIBOutletCollectionAttrInfo extends ffi.Struct { +final class CXIdxIBOutletCollectionAttrInfo extends ffi.Struct { external ffi.Pointer attrInfo; external ffi.Pointer objcClass; @@ -10693,7 +10693,7 @@ class CXIdxIBOutletCollectionAttrInfo extends ffi.Struct { external CXIdxLoc classLoc; } -class CXIdxDeclInfo extends ffi.Struct { +final class CXIdxDeclInfo extends ffi.Struct { external ffi.Pointer entityInfo; external CXCursor cursor; @@ -10731,7 +10731,7 @@ class CXIdxDeclInfo extends ffi.Struct { external int flags; } -class CXIdxObjCContainerDeclInfo extends ffi.Struct { +final class CXIdxObjCContainerDeclInfo extends ffi.Struct { external ffi.Pointer declInfo; @ffi.Int32() @@ -10744,7 +10744,7 @@ abstract class CXIdxObjCContainerKind { static const int CXIdxObjCContainer_Implementation = 2; } -class CXIdxBaseClassInfo extends ffi.Struct { +final class CXIdxBaseClassInfo extends ffi.Struct { external ffi.Pointer base; external CXCursor cursor; @@ -10752,7 +10752,7 @@ class CXIdxBaseClassInfo extends ffi.Struct { external CXIdxLoc loc; } -class CXIdxObjCProtocolRefInfo extends ffi.Struct { +final class CXIdxObjCProtocolRefInfo extends ffi.Struct { external ffi.Pointer protocol; external CXCursor cursor; @@ -10760,14 +10760,14 @@ class CXIdxObjCProtocolRefInfo extends ffi.Struct { external CXIdxLoc loc; } -class CXIdxObjCProtocolRefListInfo extends ffi.Struct { +final class CXIdxObjCProtocolRefListInfo extends ffi.Struct { external ffi.Pointer> protocols; @ffi.UnsignedInt() external int numProtocols; } -class CXIdxObjCInterfaceDeclInfo extends ffi.Struct { +final class CXIdxObjCInterfaceDeclInfo extends ffi.Struct { external ffi.Pointer containerInfo; external ffi.Pointer superInfo; @@ -10775,7 +10775,7 @@ class CXIdxObjCInterfaceDeclInfo extends ffi.Struct { external ffi.Pointer protocols; } -class CXIdxObjCCategoryDeclInfo extends ffi.Struct { +final class CXIdxObjCCategoryDeclInfo extends ffi.Struct { external ffi.Pointer containerInfo; external ffi.Pointer objcClass; @@ -10787,7 +10787,7 @@ class CXIdxObjCCategoryDeclInfo extends ffi.Struct { external ffi.Pointer protocols; } -class CXIdxObjCPropertyDeclInfo extends ffi.Struct { +final class CXIdxObjCPropertyDeclInfo extends ffi.Struct { external ffi.Pointer declInfo; external ffi.Pointer getter; @@ -10795,7 +10795,7 @@ class CXIdxObjCPropertyDeclInfo extends ffi.Struct { external ffi.Pointer setter; } -class CXIdxCXXClassDeclInfo extends ffi.Struct { +final class CXIdxCXXClassDeclInfo extends ffi.Struct { external ffi.Pointer declInfo; external ffi.Pointer> bases; @@ -10805,7 +10805,7 @@ class CXIdxCXXClassDeclInfo extends ffi.Struct { } /// Data for IndexerCallbacks#indexEntityReference. -class CXIdxEntityRefInfo extends ffi.Struct { +final class CXIdxEntityRefInfo extends ffi.Struct { @ffi.Int32() external int kind; @@ -10944,7 +10944,7 @@ typedef DartClang_IndexAction_dispose = void Function(CXIndexAction arg0); /// A group of callbacks used by #clang_indexSourceFile and /// #clang_indexTranslationUnit. -class IndexerCallbacks extends ffi.Struct { +final 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< diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index daef35bc6a..c263c76359 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -5,11 +5,11 @@ name: libclang_example environment: - sdk: '>=2.17.0 <4.0.0' + sdk: ">=3.0.0-417.0.dev <4.0.0" dependencies: ffi: ^2.0.1 dev_dependencies: ffigen: - path: '../../' + path: "../../" lints: ^2.0.1 diff --git a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart index 972e8fedcb..ae0d3fd941 100644 --- a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart +++ b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart @@ -30391,13 +30391,13 @@ class NSObject extends _ObjCWrapper { } } -class ObjCSel extends ffi.Opaque {} +final class ObjCSel extends ffi.Opaque {} -class ObjCObject extends ffi.Opaque {} +final class ObjCObject extends ffi.Opaque {} typedef instancetype = ffi.Pointer; -class _NSZone extends ffi.Opaque {} +final class _NSZone extends ffi.Opaque {} class Protocol extends _ObjCWrapper { Protocol._(ffi.Pointer id, AVFAudio lib, @@ -33375,7 +33375,7 @@ class NSData extends NSObject { typedef NSRange = _NSRange; -class _NSRange extends ffi.Struct { +final class _NSRange extends ffi.Struct { @NSUInteger() external int location; @@ -34616,7 +34616,7 @@ class NSValue extends NSObject { typedef NSPoint = CGPoint; -class CGPoint extends ffi.Struct { +final class CGPoint extends ffi.Struct { @CGFloat() external double x; @@ -34627,7 +34627,7 @@ class CGPoint extends ffi.Struct { typedef CGFloat = ffi.Double; typedef NSSize = CGSize; -class CGSize extends ffi.Struct { +final class CGSize extends ffi.Struct { @CGFloat() external double width; @@ -34637,13 +34637,13 @@ class CGSize extends ffi.Struct { typedef NSRect = CGRect; -class CGRect extends ffi.Struct { +final class CGRect extends ffi.Struct { external CGPoint origin; external CGSize size; } -class NSEdgeInsets extends ffi.Struct { +final class NSEdgeInsets extends ffi.Struct { @CGFloat() external double top; @@ -35786,7 +35786,7 @@ class ObjCBlock extends _ObjCBlockBase { ffi.Pointer<_ObjCBlock> get pointer => _id; } -class _ObjCBlockDesc extends ffi.Struct { +final class _ObjCBlockDesc extends ffi.Struct { @ffi.UnsignedLong() external int reserved; @@ -35800,7 +35800,7 @@ class _ObjCBlockDesc extends ffi.Struct { external ffi.Pointer signature; } -class _ObjCBlock extends ffi.Struct { +final class _ObjCBlock extends ffi.Struct { external ffi.Pointer isa; @ffi.Int() @@ -36434,7 +36434,7 @@ class NSPredicate extends NSObject { } } -class __va_list_tag extends ffi.Struct { +final class __va_list_tag extends ffi.Struct { @ffi.UnsignedInt() external int gp_offset; @@ -37121,7 +37121,7 @@ class ObjCBlock7 extends _ObjCBlockBase { ffi.Pointer<_ObjCBlock> get pointer => _id; } -class NSFastEnumerationState extends ffi.Struct { +final class NSFastEnumerationState extends ffi.Struct { @ffi.UnsignedLong() external int state; @@ -44040,7 +44040,7 @@ class NSRunLoop extends NSObject { typedef NSRunLoopMode = ffi.Pointer; typedef CFRunLoopRef = ffi.Pointer<__CFRunLoop>; -class __CFRunLoop extends ffi.Opaque {} +final class __CFRunLoop extends ffi.Opaque {} class NSTimer extends NSObject { NSTimer._(ffi.Pointer id, AVFAudio lib, @@ -45951,7 +45951,7 @@ typedef __darwin_pid_t = __int32_t; typedef __int32_t = ffi.Int; @ffi.Packed(2) -class AEDesc extends ffi.Struct { +final class AEDesc extends ffi.Struct { @DescType() external int descriptorType; @@ -45961,7 +45961,7 @@ class AEDesc extends ffi.Struct { typedef AEDataStorage = ffi.Pointer; typedef AEDataStorageType = ffi.Pointer; -class OpaqueAEDataStorageType extends ffi.Opaque {} +final class OpaqueAEDataStorageType extends ffi.Opaque {} typedef AEKeyword = FourCharCode; @@ -53059,7 +53059,7 @@ class NSScanner extends NSObject { } } -class NSDecimal extends ffi.Opaque {} +final class NSDecimal extends ffi.Opaque {} class NSException extends NSObject { NSException._(ffi.Pointer id, AVFAudio lib, @@ -57469,7 +57469,7 @@ class NSProcessInfo extends NSObject { } } -class NSOperatingSystemVersion extends ffi.Struct { +final class NSOperatingSystemVersion extends ffi.Struct { @NSInteger() external int majorVersion; @@ -59371,11 +59371,11 @@ abstract class NSURLCredentialPersistence { typedef SecIdentityRef = ffi.Pointer<__SecIdentity>; -class __SecIdentity extends ffi.Opaque {} +final class __SecIdentity extends ffi.Opaque {} typedef SecTrustRef = ffi.Pointer<__SecTrust>; -class __SecTrust extends ffi.Opaque {} +final class __SecTrust extends ffi.Opaque {} class NSURLProtectionSpace extends NSObject { NSURLProtectionSpace._(ffi.Pointer id, AVFAudio lib, @@ -67493,7 +67493,7 @@ class AVAudioFormat extends NSObject { } } -class AudioStreamBasicDescription extends ffi.Struct { +final class AudioStreamBasicDescription extends ffi.Struct { @Float64() external double mSampleRate; @@ -67680,7 +67680,7 @@ class AVAudioChannelLayout extends NSObject { typedef AudioChannelLayoutTag = UInt32; -class AudioChannelLayout extends ffi.Struct { +final class AudioChannelLayout extends ffi.Struct { @AudioChannelLayoutTag() external int mChannelLayoutTag; @@ -67724,7 +67724,7 @@ abstract class AudioChannelBitmap { static const int kAudioChannelBit_RightTopRear = 67108864; } -class AudioChannelDescription extends ffi.Struct { +final class AudioChannelDescription extends ffi.Struct { @AudioChannelLabel() external int mChannelLabel; @@ -67758,4 +67758,4 @@ abstract class AVAudioCommonFormat { typedef CMAudioFormatDescriptionRef = CMFormatDescriptionRef; typedef CMFormatDescriptionRef = ffi.Pointer; -class opaqueCMFormatDescription extends ffi.Opaque {} +final class opaqueCMFormatDescription extends ffi.Opaque {} diff --git a/pkgs/ffigen/example/objective_c/pubspec.yaml b/pkgs/ffigen/example/objective_c/pubspec.yaml index 33b0c31936..76aef5f5c3 100644 --- a/pkgs/ffigen/example/objective_c/pubspec.yaml +++ b/pkgs/ffigen/example/objective_c/pubspec.yaml @@ -5,11 +5,11 @@ name: objective_c_example environment: - sdk: '>=2.17.0 <4.0.0' + sdk: ">=3.0.0-417.0.dev <4.0.0" dependencies: ffi: ^2.0.1 dev_dependencies: ffigen: - path: '../../' + path: "../../" lints: ^2.0.0 diff --git a/pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart b/pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart index 6cd4f8a015..4661c25f3d 100644 --- a/pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart +++ b/pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart @@ -65,22 +65,22 @@ class NativeLibraryA { .asFunction(); } -class BaseStruct1 extends ffi.Struct { +final class BaseStruct1 extends ffi.Struct { @ffi.Int() external int a; } -class BaseUnion1 extends ffi.Union { +final class BaseUnion1 extends ffi.Union { @ffi.Int() external int a; } -class BaseStruct2 extends ffi.Struct { +final class BaseStruct2 extends ffi.Struct { @ffi.Int() external int a; } -class BaseUnion2 extends ffi.Union { +final class BaseUnion2 extends ffi.Union { @ffi.Int() external int a; } @@ -93,12 +93,12 @@ abstract class BaseEnum { typedef BaseTypedef1 = BaseStruct1; typedef BaseTypedef2 = BaseStruct2; -class A_Struct1 extends ffi.Struct { +final class A_Struct1 extends ffi.Struct { @ffi.Int() external int a; } -class A_Union1 extends ffi.Union { +final class A_Union1 extends ffi.Union { @ffi.Int() external int a; } diff --git a/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart b/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart index 1346bec6d0..ba61da49f3 100644 --- a/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart +++ b/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart @@ -51,12 +51,12 @@ class NativeLibraryASharedB { void Function(imp1.BaseStruct2, imp1.BaseUnion2, imp1.BaseTypedef2)>(); } -class A_Struct1 extends ffi.Struct { +final class A_Struct1 extends ffi.Struct { @ffi.Int() external int a; } -class A_Union1 extends ffi.Union { +final class A_Union1 extends ffi.Union { @ffi.Int() external int a; } diff --git a/pkgs/ffigen/example/shared_bindings/lib/generated/base_gen.dart b/pkgs/ffigen/example/shared_bindings/lib/generated/base_gen.dart index b31c2e88d1..9d90b53bc6 100644 --- a/pkgs/ffigen/example/shared_bindings/lib/generated/base_gen.dart +++ b/pkgs/ffigen/example/shared_bindings/lib/generated/base_gen.dart @@ -39,22 +39,22 @@ class NativeLibraryBase { _base_func1Ptr.asFunction(); } -class BaseStruct1 extends ffi.Struct { +final class BaseStruct1 extends ffi.Struct { @ffi.Int() external int a; } -class BaseUnion1 extends ffi.Union { +final class BaseUnion1 extends ffi.Union { @ffi.Int() external int a; } -class BaseStruct2 extends ffi.Struct { +final class BaseStruct2 extends ffi.Struct { @ffi.Int() external int a; } -class BaseUnion2 extends ffi.Union { +final class BaseUnion2 extends ffi.Union { @ffi.Int() external int a; } diff --git a/pkgs/ffigen/example/shared_bindings/pubspec.yaml b/pkgs/ffigen/example/shared_bindings/pubspec.yaml index fbe942e4ae..fd8cbde615 100644 --- a/pkgs/ffigen/example/shared_bindings/pubspec.yaml +++ b/pkgs/ffigen/example/shared_bindings/pubspec.yaml @@ -5,7 +5,7 @@ name: shared_bindings environment: - sdk: '>=2.17.0 <4.0.0' + sdk: ">=3.0.0-417.0.dev <4.0.0" dependencies: cli_util: ^0.4.0 @@ -14,5 +14,5 @@ dependencies: dev_dependencies: ffigen: - path: '../../' + path: "../../" lints: ^2.0.1 diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index d59f53e066..b6a4c67676 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -5,12 +5,11 @@ name: simple_example environment: - sdk: '>=2.17.0 <4.0.0' + sdk: ">=3.0.0-417.0.dev <4.0.0" dependencies: ffi: ^2.0.1 dev_dependencies: ffigen: - path: '../../' + path: "../../" lints: ^2.0.1 - diff --git a/pkgs/ffigen/example/swift/pubspec.yaml b/pkgs/ffigen/example/swift/pubspec.yaml index d00ffa9190..d0725ddb68 100644 --- a/pkgs/ffigen/example/swift/pubspec.yaml +++ b/pkgs/ffigen/example/swift/pubspec.yaml @@ -5,11 +5,11 @@ name: swift_example environment: - sdk: '>=2.17.0 <4.0.0' + sdk: ">=3.0.0-417.0.dev <4.0.0" dependencies: ffi: ^2.0.1 dev_dependencies: ffigen: - path: '../../' + path: "../../" lints: ^2.0.0 diff --git a/pkgs/ffigen/example/swift/swift_api_bindings.dart b/pkgs/ffigen/example/swift/swift_api_bindings.dart index 383944f1f0..f741f7fa45 100644 --- a/pkgs/ffigen/example/swift/swift_api_bindings.dart +++ b/pkgs/ffigen/example/swift/swift_api_bindings.dart @@ -29122,13 +29122,13 @@ class NSObject extends _ObjCWrapper { } } -class ObjCSel extends ffi.Opaque {} +final class ObjCSel extends ffi.Opaque {} -class ObjCObject extends ffi.Opaque {} +final class ObjCObject extends ffi.Opaque {} typedef instancetype = ffi.Pointer; -class _NSZone extends ffi.Opaque {} +final class _NSZone extends ffi.Opaque {} class Protocol extends _ObjCWrapper { Protocol._(ffi.Pointer id, SwiftLibrary lib, @@ -32115,7 +32115,7 @@ class NSData extends NSObject { typedef NSRange = _NSRange; -class _NSRange extends ffi.Struct { +final class _NSRange extends ffi.Struct { @NSUInteger() external int location; @@ -33364,7 +33364,7 @@ class NSValue extends NSObject { typedef NSPoint = CGPoint; -class CGPoint extends ffi.Struct { +final class CGPoint extends ffi.Struct { @CGFloat() external double x; @@ -33375,7 +33375,7 @@ class CGPoint extends ffi.Struct { typedef CGFloat = ffi.Double; typedef NSSize = CGSize; -class CGSize extends ffi.Struct { +final class CGSize extends ffi.Struct { @CGFloat() external double width; @@ -33385,13 +33385,13 @@ class CGSize extends ffi.Struct { typedef NSRect = CGRect; -class CGRect extends ffi.Struct { +final class CGRect extends ffi.Struct { external CGPoint origin; external CGSize size; } -class NSEdgeInsets extends ffi.Struct { +final class NSEdgeInsets extends ffi.Struct { @CGFloat() external double top; @@ -34538,7 +34538,7 @@ class ObjCBlock extends _ObjCBlockBase { ffi.Pointer<_ObjCBlock> get pointer => _id; } -class _ObjCBlockDesc extends ffi.Struct { +final class _ObjCBlockDesc extends ffi.Struct { @ffi.UnsignedLong() external int reserved; @@ -34552,7 +34552,7 @@ class _ObjCBlockDesc extends ffi.Struct { external ffi.Pointer signature; } -class _ObjCBlock extends ffi.Struct { +final class _ObjCBlock extends ffi.Struct { external ffi.Pointer isa; @ffi.Int() @@ -35183,7 +35183,7 @@ class NSPredicate extends NSObject { } } -class __va_list_tag extends ffi.Struct { +final class __va_list_tag extends ffi.Struct { @ffi.UnsignedInt() external int gp_offset; @@ -35871,7 +35871,7 @@ class ObjCBlock7 extends _ObjCBlockBase { ffi.Pointer<_ObjCBlock> get pointer => _id; } -class NSFastEnumerationState extends ffi.Struct { +final class NSFastEnumerationState extends ffi.Struct { @ffi.UnsignedLong() external int state; @@ -42805,7 +42805,7 @@ class NSRunLoop extends NSObject { typedef NSRunLoopMode = ffi.Pointer; typedef CFRunLoopRef = ffi.Pointer<__CFRunLoop>; -class __CFRunLoop extends ffi.Opaque {} +final class __CFRunLoop extends ffi.Opaque {} class NSTimer extends NSObject { NSTimer._(ffi.Pointer id, SwiftLibrary lib, @@ -44721,7 +44721,7 @@ typedef __darwin_pid_t = __int32_t; typedef __int32_t = ffi.Int; @ffi.Packed(2) -class AEDesc extends ffi.Struct { +final class AEDesc extends ffi.Struct { @DescType() external int descriptorType; @@ -44731,7 +44731,7 @@ class AEDesc extends ffi.Struct { typedef AEDataStorage = ffi.Pointer; typedef AEDataStorageType = ffi.Pointer; -class OpaqueAEDataStorageType extends ffi.Opaque {} +final class OpaqueAEDataStorageType extends ffi.Opaque {} typedef AEKeyword = FourCharCode; @@ -51847,7 +51847,7 @@ class NSScanner extends NSObject { } } -class NSDecimal extends ffi.Opaque {} +final class NSDecimal extends ffi.Opaque {} class NSException extends NSObject { NSException._(ffi.Pointer id, SwiftLibrary lib, @@ -56260,7 +56260,7 @@ class NSProcessInfo extends NSObject { } } -class NSOperatingSystemVersion extends ffi.Struct { +final class NSOperatingSystemVersion extends ffi.Struct { @NSInteger() external int majorVersion; @@ -58169,11 +58169,11 @@ abstract class NSURLCredentialPersistence { typedef SecIdentityRef = ffi.Pointer<__SecIdentity>; -class __SecIdentity extends ffi.Opaque {} +final class __SecIdentity extends ffi.Opaque {} typedef SecTrustRef = ffi.Pointer<__SecTrust>; -class __SecTrust extends ffi.Opaque {} +final class __SecTrust extends ffi.Opaque {} class NSURLProtectionSpace extends NSObject { NSURLProtectionSpace._(ffi.Pointer id, SwiftLibrary lib, diff --git a/pkgs/ffigen/lib/src/code_generator/compound.dart b/pkgs/ffigen/lib/src/code_generator/compound.dart index 2c915a2819..894d3799ed 100644 --- a/pkgs/ffigen/lib/src/code_generator/compound.dart +++ b/pkgs/ffigen/lib/src/code_generator/compound.dart @@ -129,7 +129,7 @@ abstract class Compound extends BindingType { } final dartClassName = isStruct ? 'Struct' : 'Union'; // Write class declaration. - s.write('class $enclosingClassName extends '); + s.write('final class $enclosingClassName extends '); s.write('${w.ffiLibraryPrefix}.${isOpaque ? 'Opaque' : dartClassName}{\n'); const depth = ' '; for (final m in members) { diff --git a/pkgs/ffigen/lib/src/code_generator/struct.dart b/pkgs/ffigen/lib/src/code_generator/struct.dart index c65e04b992..ae9e35bfda 100644 --- a/pkgs/ffigen/lib/src/code_generator/struct.dart +++ b/pkgs/ffigen/lib/src/code_generator/struct.dart @@ -16,7 +16,7 @@ import 'package:ffigen/src/code_generator/compound.dart'; /// ``` /// The generated dart code is - /// ```dart -/// class Struct extends ffi.Struct{ +/// final class Struct extends ffi.Struct { /// @ffi.Int32() /// int a; /// diff --git a/pkgs/ffigen/lib/src/code_generator/union.dart b/pkgs/ffigen/lib/src/code_generator/union.dart index fc7be967c7..8455004b02 100644 --- a/pkgs/ffigen/lib/src/code_generator/union.dart +++ b/pkgs/ffigen/lib/src/code_generator/union.dart @@ -15,7 +15,7 @@ import 'package:ffigen/src/code_generator/compound.dart'; /// ``` /// The generated dart code is - /// ```dart -/// class Union extends ffi.Union{ +/// final class Union extends ffi.Union{ /// @ffi.Int32() /// int a; /// diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 6b77794381..4c4c472621 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -1310,21 +1310,21 @@ class Clang { /// 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 { +final class CXString extends ffi.Struct { external ffi.Pointer data; @ffi.UnsignedInt() external int private_flags; } -class CXTranslationUnitImpl extends ffi.Opaque {} +final class CXTranslationUnitImpl extends ffi.Opaque {} /// 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 { +final class CXUnsavedFile extends ffi.Struct { /// The file whose contents have not yet been saved. /// /// This file must already exist in the file system. @@ -1350,7 +1350,7 @@ typedef CXFile = ffi.Pointer; /// /// Use clang_getExpansionLocation() or clang_getSpellingLocation() /// to map a source location to a particular file, line, and column. -class CXSourceLocation extends ffi.Struct { +final class CXSourceLocation extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; @@ -1362,7 +1362,7 @@ class CXSourceLocation extends ffi.Struct { /// /// Use clang_getRangeStart() and clang_getRangeEnd() to retrieve the /// starting and end locations from a source range, respectively. -class CXSourceRange extends ffi.Struct { +final class CXSourceRange extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; @@ -2356,7 +2356,7 @@ abstract class CXCursorKind { /// 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 { +final class CXCursor extends ffi.Struct { @ffi.Int32() external int kind; @@ -2498,7 +2498,7 @@ abstract class CXTypeKind { } /// The type of an element in the abstract syntax tree. -class CXType extends ffi.Struct { +final class CXType extends ffi.Struct { @ffi.Int32() external int kind; diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index c6a0951904..5b2620b294 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -117,13 +117,13 @@ Type getCodeGenType( // Primarily used for function types with zero arguments. return _extractFromFunctionProto(cxtype, cursor: originalCursor); case clang_types.CXTypeKind - .CXType_ConstantArray: // Primarily used for constant array in struct members. + .CXType_ConstantArray: // Primarily used for constant array in struct members. return ConstantArray( clang.clang_getNumElements(cxtype), clang.clang_getArrayElementType(cxtype).toCodeGenType(), ); case clang_types.CXTypeKind - .CXType_IncompleteArray: // Primarily used for incomplete array in function parameters. + .CXType_IncompleteArray: // Primarily used for incomplete array in function parameters. return IncompleteArray( clang.clang_getArrayElementType(cxtype).toCodeGenType(), ); diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 6c2e147356..53dc9f2fe8 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,12 +3,12 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 7.2.10 +version: 8.0.0-dev.0 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen environment: - sdk: '>=2.17.0 <4.0.0' + sdk: ">=3.0.0-417.0.dev <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart index 0bc046c189..015821ea28 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart @@ -35,7 +35,7 @@ class Bindings { _test1Ptr.asFunction)>(); } -class Test2 extends ffi.Struct { +final class Test2 extends ffi.Struct { @ffi.Bool() external bool a; } diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart index cad19809fb..cf255b2ca8 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart @@ -34,7 +34,7 @@ class Bindings { ffi.Pointer Function(ffi.Pointer>)>(); } -class SomeStruct extends ffi.Struct { +final class SomeStruct extends ffi.Struct { @ffi.Int32() external int a; diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart index f3f3f12099..37081b8634 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart @@ -44,6 +44,6 @@ class Bindings { ffi.Pointer get globalStruct => _globalStruct; } -class Some extends ffi.Opaque {} +final class Some extends ffi.Opaque {} -class EmptyStruct extends ffi.Opaque {} +final class EmptyStruct extends ffi.Opaque {} diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart index edc39352c4..1a71e3bf0f 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart @@ -62,12 +62,12 @@ class init_dylib1 { late final _Test = _TestPtr.asFunction(); } -class _Test extends ffi.Struct { +final class _Test extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array array; } -class ArrayHelperPrefixCollisionTest extends ffi.Opaque {} +final class ArrayHelperPrefixCollisionTest extends ffi.Opaque {} abstract class _c_Test {} diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart index e703e283d8..f882e7e1e6 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart @@ -4,37 +4,37 @@ // ignore_for_file: type=lint import 'dart:ffi' as ffi; -class NoPacking extends ffi.Struct { +final class NoPacking extends ffi.Struct { @ffi.Uint8() external int a; } @ffi.Packed(1) -class Pack1 extends ffi.Struct { +final class Pack1 extends ffi.Struct { @ffi.Uint8() external int a; } @ffi.Packed(2) -class Pack2 extends ffi.Struct { +final class Pack2 extends ffi.Struct { @ffi.Uint8() external int a; } @ffi.Packed(4) -class Pack21 extends ffi.Struct { +final class Pack21 extends ffi.Struct { @ffi.Uint8() external int a; } @ffi.Packed(8) -class Pack22 extends ffi.Struct { +final class Pack22 extends ffi.Struct { @ffi.Uint8() external int a; } @ffi.Packed(16) -class Pack16 extends ffi.Struct { +final class Pack16 extends ffi.Struct { @ffi.Uint8() external int a; } diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart index 3a9aa67b62..eddeeb7337 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart @@ -33,6 +33,6 @@ class Bindings { late final _b = _bPtr.asFunction(); } -class C extends ffi.Opaque {} +final class C extends ffi.Opaque {} -class D extends ffi.Opaque {} +final class D extends ffi.Opaque {} diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart index f8482e74cf..b7a4e9d3fd 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart @@ -6,9 +6,9 @@ import 'dart:ffi' as ffi; /// Just a test struct /// heres another line -class NoMember extends ffi.Opaque {} +final class NoMember extends ffi.Opaque {} -class WithPrimitiveMember extends ffi.Struct { +final class WithPrimitiveMember extends ffi.Struct { @ffi.Int32() external int a; @@ -19,7 +19,7 @@ class WithPrimitiveMember extends ffi.Struct { external int c; } -class WithPointerMember extends ffi.Struct { +final class WithPointerMember extends ffi.Struct { external ffi.Pointer a; external ffi.Pointer> b; @@ -28,7 +28,7 @@ class WithPointerMember extends ffi.Struct { external int c; } -class WithIntPtrUintPtr extends ffi.Struct { +final class WithIntPtrUintPtr extends ffi.Struct { external ffi.Pointer a; external ffi.Pointer> b; diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart index 00306c6d0c..4383756eb6 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart @@ -39,19 +39,19 @@ class Bindings { typedef RawUnused = Struct1; -class Struct1 extends ffi.Opaque {} +final class Struct1 extends ffi.Opaque {} -class WithTypealiasStruct extends ffi.Struct { +final class WithTypealiasStruct extends ffi.Struct { external Struct2Typealias t; } typedef Struct2Typealias = Struct2; -class Struct2 extends ffi.Struct { +final class Struct2 extends ffi.Struct { @ffi.Double() external double a; } typedef Struct3Typealias = Struct3; -class Struct3 extends ffi.Opaque {} +final class Struct3 extends ffi.Opaque {} diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart index 1865919dc0..692f0d67a3 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart @@ -4,19 +4,19 @@ // ignore_for_file: type=lint import 'dart:ffi' as ffi; -class Struct1 extends ffi.Struct { +final class Struct1 extends ffi.Struct { @ffi.Char() external int a; } -class Union1 extends ffi.Union { +final class Union1 extends ffi.Union { @ffi.Char() external int a; } -class EmptyUnion extends ffi.Opaque {} +final class EmptyUnion extends ffi.Opaque {} -class Primitives extends ffi.Union { +final class Primitives extends ffi.Union { @ffi.Char() external int a; @@ -30,7 +30,7 @@ class Primitives extends ffi.Union { external double d; } -class PrimitivesWithPointers extends ffi.Union { +final class PrimitivesWithPointers extends ffi.Union { @ffi.Char() external int a; @@ -44,7 +44,7 @@ class PrimitivesWithPointers extends ffi.Union { external ffi.Pointer d1; } -class WithArray extends ffi.Union { +final class WithArray extends ffi.Union { @ffi.Array.multi([10]) external ffi.Array a; diff --git a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart index 3b3e791c5e..0d5473f942 100644 --- a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart +++ b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart @@ -50,9 +50,9 @@ class _SymbolAddresses1 { _library1.__SymbolAddresses_1Ptr; } -class addresses extends ffi.Opaque {} +final class addresses extends ffi.Opaque {} -class _SymbolAddresses extends ffi.Opaque {} +final class _SymbolAddresses extends ffi.Opaque {} abstract class Bindings {} diff --git a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_type_name_collision_bindings.dart b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_type_name_collision_bindings.dart index f7207cf3f7..625c69a41d 100644 --- a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_type_name_collision_bindings.dart +++ b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_type_name_collision_bindings.dart @@ -6,12 +6,12 @@ // ignore_for_file: type=lint import 'dart:ffi' as ffi; -class A extends ffi.Struct { +final class A extends ffi.Struct { @ffi.Int() external int a; } -class B extends ffi.Struct { +final class B extends ffi.Struct { @ffi.Int() external int B1; @@ -19,13 +19,13 @@ class B extends ffi.Struct { external int A; } -class C extends ffi.Struct { +final class C extends ffi.Struct { external A A1; external B B1; } -class D extends ffi.Struct { +final class D extends ffi.Struct { external B A1; external A B1; diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart index ea88b5b31c..0575478177 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart @@ -52,7 +52,7 @@ class NativeLibrary { } /// Test comment for struct. -class Com4 extends ffi.Struct { +final class Com4 extends ffi.Struct { /// Muli-line test comment for struct field /// With multiple line and both // and ///. @ffi.Int() diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart index f51bf57f70..8455b7adfd 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart @@ -71,8 +71,8 @@ class NativeLibrary { typedef Typedef1 = ffi.Pointer>; -class Struct1 extends ffi.Opaque {} +final class Struct1 extends ffi.Opaque {} -class Struct2 extends ffi.Struct { +final class Struct2 extends ffi.Struct { external ffi.Pointer h; } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart index 81cb2e3602..f1175cc97a 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart @@ -36,7 +36,7 @@ class NativeLibrary { late final _func = _funcPtr.asFunction, int)>(); } -class A extends ffi.Struct { +final class A extends ffi.Struct { @ffi.Int() external int a; diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart index 6ef30ff9fc..f77a57bfbe 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart @@ -64,7 +64,7 @@ class NativeLibrary { _funcWithNativeFuncPtr.asFunction(); } -class Struct extends ffi.Struct { +final class Struct extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< ffi.Void Function( @@ -76,7 +76,7 @@ typedef WithTypedefReturnType = ffi.Pointer>; typedef InsideReturnType = ffi.Pointer>; -class Struct2 extends ffi.Struct { +final class Struct2 extends ffi.Struct { external VoidFuncPointer constFuncPointer; } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart index c53f04f46e..648142006d 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart @@ -51,36 +51,36 @@ class NativeLibrary { typedef BAlias = B; -class B extends ffi.Opaque {} +final class B extends ffi.Opaque {} -class A extends ffi.Opaque {} +final class A extends ffi.Opaque {} -class E extends ffi.Struct { +final class E extends ffi.Struct { external ffi.Pointer c; external D d; } -class C extends ffi.Opaque {} +final class C extends ffi.Opaque {} -class D extends ffi.Struct { +final class D extends ffi.Struct { @ffi.Int() external int a; } -class UB extends ffi.Opaque {} +final class UB extends ffi.Opaque {} -class UA extends ffi.Opaque {} +final class UA extends ffi.Opaque {} -class UE extends ffi.Union { +final class UE extends ffi.Union { external ffi.Pointer c; external UD d; } -class UC extends ffi.Opaque {} +final class UC extends ffi.Opaque {} -class UD extends ffi.Union { +final class UD extends ffi.Union { @ffi.Int() external int a; } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_packed_structs_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_packed_structs_bindings.dart index 9dfabd26a4..dc2ea75078 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_packed_structs_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_packed_structs_bindings.dart @@ -4,13 +4,13 @@ // ignore_for_file: type=lint import 'dart:ffi' as ffi; -class NormalStruct1 extends ffi.Struct { +final class NormalStruct1 extends ffi.Struct { @ffi.Char() external int a; } /// Should not be packed. -class StructWithAttr extends ffi.Struct { +final class StructWithAttr extends ffi.Struct { external ffi.Pointer a; external ffi.Pointer b; @@ -18,33 +18,33 @@ class StructWithAttr extends ffi.Struct { /// Should be packed with 1. @ffi.Packed(1) -class PackedAttr extends ffi.Struct { +final class PackedAttr extends ffi.Struct { @ffi.Int() external int a; } /// Should be packed with 8. @ffi.Packed(8) -class PackedAttrAlign8 extends ffi.Struct { +final class PackedAttrAlign8 extends ffi.Struct { @ffi.Int() external int a; } /// Should be packed with 2. @ffi.Packed(2) -class Pack2WithPragma extends ffi.Struct { +final class Pack2WithPragma extends ffi.Struct { @ffi.Int() external int a; } /// Should be packed with 4. @ffi.Packed(4) -class Pack4WithPragma extends ffi.Struct { +final class Pack4WithPragma extends ffi.Struct { @ffi.LongLong() external int a; } -class NormalStruct2 extends ffi.Struct { +final class NormalStruct2 extends ffi.Struct { @ffi.Char() external int a; } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_struct_fptr_fields_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_struct_fptr_fields_bindings.dart index b0490b26e2..2b2fe8a3ab 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_struct_fptr_fields_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_struct_fptr_fields_bindings.dart @@ -4,7 +4,7 @@ // ignore_for_file: type=lint import 'dart:ffi' as ffi; -class S extends ffi.Struct { +final class S extends ffi.Struct { external ffi.Pointer> func1; external ffi diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart index 412acb228f..b88074614e 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart @@ -84,7 +84,7 @@ class Bindings { _func4Ptr.asFunction)>(); } -class Struct1 extends ffi.Struct { +final class Struct1 extends ffi.Struct { external NamedFunctionProto named; external ffi.Pointer> unnamed; @@ -93,14 +93,14 @@ class Struct1 extends ffi.Struct { typedef NamedFunctionProto = ffi.Pointer>; -class AnonymousStructInTypedef extends ffi.Opaque {} +final class AnonymousStructInTypedef extends ffi.Opaque {} -class _NamedStructInTypedef extends ffi.Opaque {} +final class _NamedStructInTypedef extends ffi.Opaque {} typedef NTyperef1 = ExcludedStruct; typedef ExcludedStruct = _ExcludedStruct; -class _ExcludedStruct extends ffi.Opaque {} +final class _ExcludedStruct extends ffi.Opaque {} abstract class AnonymousEnumInTypedef { static const int a = 0; @@ -112,9 +112,9 @@ abstract class _NamedEnumInTypedef { typedef NestingASpecifiedType = ffi.IntPtr; -class Struct2 extends ffi.Opaque {} +final class Struct2 extends ffi.Opaque {} -class WithBoolAlias extends ffi.Struct { +final class WithBoolAlias extends ffi.Struct { @ffi.Bool() external bool b; } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart index 585ab9a4a2..ca7a938fb3 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart @@ -49,17 +49,17 @@ class NativeLibrary { _func2Ptr.asFunction)>(); } -class Union1 extends ffi.Union { +final class Union1 extends ffi.Union { @ffi.Int() external int a; } -class Union2 extends ffi.Union { +final class Union2 extends ffi.Union { external Union1 a; } -class Union3 extends ffi.Opaque {} +final class Union3 extends ffi.Opaque {} -class Union4 extends ffi.Opaque {} +final class Union4 extends ffi.Opaque {} -class Union5 extends ffi.Opaque {} +final class Union5 extends ffi.Opaque {} diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart index fe6b0080a5..b93c74f1a2 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart @@ -1215,7 +1215,7 @@ class CJson { _cJSON_freePtr.asFunction)>(); } -class cJSON extends ffi.Struct { +final class cJSON extends ffi.Struct { external ffi.Pointer next; external ffi.Pointer prev; @@ -1236,7 +1236,7 @@ class cJSON extends ffi.Struct { external ffi.Pointer string; } -class cJSON_Hooks extends ffi.Struct { +final class cJSON_Hooks extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction Function(ffi.Size sz)>> malloc_fn; diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index 510e0b0dbc..22c6f266eb 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -6036,37 +6036,37 @@ abstract class CXErrorCode { } /// A character string. -class CXString extends ffi.Struct { +final class CXString extends ffi.Struct { external ffi.Pointer data; @ffi.UnsignedInt() external int private_flags; } -class CXStringSet extends ffi.Struct { +final class CXStringSet extends ffi.Struct { external ffi.Pointer Strings; @ffi.UnsignedInt() external int Count; } -class CXVirtualFileOverlayImpl extends ffi.Opaque {} +final class CXVirtualFileOverlayImpl extends ffi.Opaque {} /// Object encapsulating information about overlaying virtual file/directories /// over the real file system. typedef CXVirtualFileOverlay = ffi.Pointer; -class CXModuleMapDescriptorImpl extends ffi.Opaque {} +final class CXModuleMapDescriptorImpl extends ffi.Opaque {} /// Object encapsulating information about a module.map file. typedef CXModuleMapDescriptor = ffi.Pointer; -class CXTargetInfoImpl extends ffi.Opaque {} +final class CXTargetInfoImpl extends ffi.Opaque {} -class CXTranslationUnitImpl extends ffi.Opaque {} +final class CXTranslationUnitImpl extends ffi.Opaque {} /// Provides the contents of a file that has not yet been saved to disk. -class CXUnsavedFile extends ffi.Struct { +final class CXUnsavedFile extends ffi.Struct { /// The file whose contents have not yet been saved. external ffi.Pointer Filename; @@ -6098,7 +6098,7 @@ abstract class CXAvailabilityKind { } /// Describes a version number of the form major.minor.subminor. -class CXVersion extends ffi.Struct { +final 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.Int() @@ -6175,7 +6175,7 @@ typedef CXFile = ffi.Pointer; /// Uniquely identifies a CXFile, that refers to the same underlying file, /// across an indexing session. -class CXFileUniqueID extends ffi.Struct { +final class CXFileUniqueID extends ffi.Struct { @ffi.Array.multi([3]) external ffi.Array data; } @@ -6184,7 +6184,7 @@ class CXFileUniqueID extends ffi.Struct { typedef CXTranslationUnit = ffi.Pointer; /// Identifies a specific source location within a translation unit. -class CXSourceLocation extends ffi.Struct { +final class CXSourceLocation extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; @@ -6193,7 +6193,7 @@ class CXSourceLocation extends ffi.Struct { } /// Identifies a half-open character range in the source code. -class CXSourceRange extends ffi.Struct { +final class CXSourceRange extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; @@ -6205,7 +6205,7 @@ class CXSourceRange extends ffi.Struct { } /// Identifies an array of ranges. -class CXSourceRangeList extends ffi.Struct { +final class CXSourceRangeList extends ffi.Struct { /// The number of ranges in the ranges array. @ffi.UnsignedInt() external int count; @@ -6399,7 +6399,7 @@ abstract class CXTUResourceUsageKind { static const int CXTUResourceUsage_Last = 14; } -class CXTUResourceUsageEntry extends ffi.Struct { +final class CXTUResourceUsageEntry extends ffi.Struct { @ffi.Int32() external int kind; @@ -6408,7 +6408,7 @@ class CXTUResourceUsageEntry extends ffi.Struct { } /// The memory usage of a CXTranslationUnit, broken into categories. -class CXTUResourceUsage extends ffi.Struct { +final class CXTUResourceUsage extends ffi.Struct { external ffi.Pointer data; @ffi.UnsignedInt() @@ -7074,7 +7074,7 @@ abstract class CXCursorKind { /// A cursor representing some element in the abstract syntax tree for a /// translation unit. -class CXCursor extends ffi.Struct { +final class CXCursor extends ffi.Struct { @ffi.Int32() external int kind; @@ -7123,7 +7123,7 @@ abstract class CXVisibilityKind { /// 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 { +final class CXPlatformAvailability extends ffi.Struct { /// A string that describes the platform for which this structure provides /// availability information. external CXString Platform; @@ -7164,7 +7164,7 @@ abstract class CXTLSKind { static const int CXTLS_Static = 2; } -class CXCursorSetImpl extends ffi.Opaque {} +final class CXCursorSetImpl extends ffi.Opaque {} /// A fast container representing a set of CXCursors. typedef CXCursorSet = ffi.Pointer; @@ -7321,7 +7321,7 @@ abstract class CXCallingConv { } /// The type of an element in the abstract syntax tree. -class CXType extends ffi.Struct { +final class CXType extends ffi.Struct { @ffi.Int32() external int kind; @@ -7538,7 +7538,7 @@ abstract class CXTokenKind { } /// Describes a single preprocessing token. -class CXToken extends ffi.Struct { +final class CXToken extends ffi.Struct { @ffi.Array.multi([4]) external ffi.Array int_data; @@ -7546,7 +7546,7 @@ class CXToken extends ffi.Struct { } /// A single result of code completion. -class CXCompletionResult extends ffi.Struct { +final class CXCompletionResult extends ffi.Struct { /// The kind of entity that this completion refers to. @ffi.Int32() external int CursorKind; @@ -7633,7 +7633,7 @@ abstract class CXCompletionChunkKind { } /// Contains the results of code-completion. -class CXCodeCompleteResults extends ffi.Struct { +final class CXCodeCompleteResults extends ffi.Struct { /// The code-completion results. external ffi.Pointer Results; @@ -7791,7 +7791,7 @@ abstract class CXVisitorResult { static const int CXVisit_Continue = 1; } -class CXCursorAndRangeVisitor extends ffi.Struct { +final class CXCursorAndRangeVisitor extends ffi.Struct { external ffi.Pointer context; external ffi.Pointer< @@ -7812,7 +7812,7 @@ abstract class CXResult { } /// Source location passed to index callbacks. -class CXIdxLoc extends ffi.Struct { +final class CXIdxLoc extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array> ptr_data; @@ -7821,7 +7821,7 @@ class CXIdxLoc extends ffi.Struct { } /// Data for ppIncludedFile callback. -class CXIdxIncludedFileInfo extends ffi.Struct { +final class CXIdxIncludedFileInfo extends ffi.Struct { /// Location of '#' in the #include/#import directive. external CXIdxLoc hashLoc; @@ -7843,7 +7843,7 @@ class CXIdxIncludedFileInfo extends ffi.Struct { } /// Data for IndexerCallbacks#importedASTFile. -class CXIdxImportedASTFileInfo extends ffi.Struct { +final class CXIdxImportedASTFileInfo extends ffi.Struct { /// Top level AST file containing the imported PCH, module or submodule. external CXFile file; @@ -7915,7 +7915,7 @@ abstract class CXIdxAttrKind { static const int CXIdxAttr_IBOutletCollection = 3; } -class CXIdxAttrInfo extends ffi.Struct { +final class CXIdxAttrInfo extends ffi.Struct { @ffi.Int32() external int kind; @@ -7924,7 +7924,7 @@ class CXIdxAttrInfo extends ffi.Struct { external CXIdxLoc loc; } -class CXIdxEntityInfo extends ffi.Struct { +final class CXIdxEntityInfo extends ffi.Struct { @ffi.Int32() external int kind; @@ -7946,11 +7946,11 @@ class CXIdxEntityInfo extends ffi.Struct { external int numAttributes; } -class CXIdxContainerInfo extends ffi.Struct { +final class CXIdxContainerInfo extends ffi.Struct { external CXCursor cursor; } -class CXIdxIBOutletCollectionAttrInfo extends ffi.Struct { +final class CXIdxIBOutletCollectionAttrInfo extends ffi.Struct { external ffi.Pointer attrInfo; external ffi.Pointer objcClass; @@ -7964,7 +7964,7 @@ abstract class CXIdxDeclInfoFlags { static const int CXIdxDeclFlag_Skipped = 1; } -class CXIdxDeclInfo extends ffi.Struct { +final class CXIdxDeclInfo extends ffi.Struct { external ffi.Pointer entityInfo; external CXCursor cursor; @@ -8008,14 +8008,14 @@ abstract class CXIdxObjCContainerKind { static const int CXIdxObjCContainer_Implementation = 2; } -class CXIdxObjCContainerDeclInfo extends ffi.Struct { +final class CXIdxObjCContainerDeclInfo extends ffi.Struct { external ffi.Pointer declInfo; @ffi.Int32() external int kind; } -class CXIdxBaseClassInfo extends ffi.Struct { +final class CXIdxBaseClassInfo extends ffi.Struct { external ffi.Pointer base; external CXCursor cursor; @@ -8023,7 +8023,7 @@ class CXIdxBaseClassInfo extends ffi.Struct { external CXIdxLoc loc; } -class CXIdxObjCProtocolRefInfo extends ffi.Struct { +final class CXIdxObjCProtocolRefInfo extends ffi.Struct { external ffi.Pointer protocol; external CXCursor cursor; @@ -8031,14 +8031,14 @@ class CXIdxObjCProtocolRefInfo extends ffi.Struct { external CXIdxLoc loc; } -class CXIdxObjCProtocolRefListInfo extends ffi.Struct { +final class CXIdxObjCProtocolRefListInfo extends ffi.Struct { external ffi.Pointer> protocols; @ffi.UnsignedInt() external int numProtocols; } -class CXIdxObjCInterfaceDeclInfo extends ffi.Struct { +final class CXIdxObjCInterfaceDeclInfo extends ffi.Struct { external ffi.Pointer containerInfo; external ffi.Pointer superInfo; @@ -8046,7 +8046,7 @@ class CXIdxObjCInterfaceDeclInfo extends ffi.Struct { external ffi.Pointer protocols; } -class CXIdxObjCCategoryDeclInfo extends ffi.Struct { +final class CXIdxObjCCategoryDeclInfo extends ffi.Struct { external ffi.Pointer containerInfo; external ffi.Pointer objcClass; @@ -8058,7 +8058,7 @@ class CXIdxObjCCategoryDeclInfo extends ffi.Struct { external ffi.Pointer protocols; } -class CXIdxObjCPropertyDeclInfo extends ffi.Struct { +final class CXIdxObjCPropertyDeclInfo extends ffi.Struct { external ffi.Pointer declInfo; external ffi.Pointer getter; @@ -8066,7 +8066,7 @@ class CXIdxObjCPropertyDeclInfo extends ffi.Struct { external ffi.Pointer setter; } -class CXIdxCXXClassDeclInfo extends ffi.Struct { +final class CXIdxCXXClassDeclInfo extends ffi.Struct { external ffi.Pointer declInfo; external ffi.Pointer> bases; @@ -8100,7 +8100,7 @@ abstract class CXSymbolRole { } /// Data for IndexerCallbacks#indexEntityReference. -class CXIdxEntityRefInfo extends ffi.Struct { +final class CXIdxEntityRefInfo extends ffi.Struct { @ffi.Int32() external int kind; @@ -8125,7 +8125,7 @@ class CXIdxEntityRefInfo extends ffi.Struct { /// A group of callbacks used by #clang_indexSourceFile and /// #clang_indexTranslationUnit. -class IndexerCallbacks extends ffi.Struct { +final 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< diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index d3b48db089..af6cccf44a 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -10718,20 +10718,20 @@ class SQLite { ffi.Void Function(ffi.Pointer)>>)>(); } -class sqlite3 extends ffi.Opaque {} +final class sqlite3 extends ffi.Opaque {} -class sqlite3_file extends ffi.Struct { +final class sqlite3_file extends ffi.Struct { /// Methods for an open file external ffi.Pointer pMethods; } -class sqlite3_io_methods extends ffi.Opaque {} +final class sqlite3_io_methods extends ffi.Opaque {} -class sqlite3_mutex extends ffi.Opaque {} +final class sqlite3_mutex extends ffi.Opaque {} -class sqlite3_api_routines extends ffi.Opaque {} +final class sqlite3_api_routines extends ffi.Opaque {} -class sqlite3_vfs extends ffi.Struct { +final class sqlite3_vfs extends ffi.Struct { /// Structure version number (currently 3) @ffi.Int() external int iVersion; @@ -10850,7 +10850,7 @@ typedef sqlite_int64 = ffi.LongLong; typedef sqlite3_syscall_ptr = ffi.Pointer>; -class sqlite3_mem_methods extends ffi.Struct { +final class sqlite3_mem_methods extends ffi.Struct { /// Memory allocation function external ffi .Pointer Function(ffi.Int)>> @@ -10892,11 +10892,11 @@ class sqlite3_mem_methods extends ffi.Struct { typedef sqlite3_uint64 = sqlite_uint64; typedef sqlite_uint64 = ffi.UnsignedLongLong; -class sqlite3_stmt extends ffi.Opaque {} +final class sqlite3_stmt extends ffi.Opaque {} -class sqlite3_value extends ffi.Opaque {} +final class sqlite3_value extends ffi.Opaque {} -class sqlite3_context extends ffi.Opaque {} +final class sqlite3_context extends ffi.Opaque {} /// CAPI3REF: Virtual Table Instance Object /// KEYWORDS: sqlite3_vtab @@ -10914,7 +10914,7 @@ class sqlite3_context extends ffi.Opaque {} /// prior to assigning a new string to zErrMsg. ^After the error message /// is delivered up to the client application, the string will be automatically /// freed by sqlite3_free() and the zErrMsg field will be zeroed. -class sqlite3_vtab extends ffi.Struct { +final class sqlite3_vtab extends ffi.Struct { /// The module for this virtual table external ffi.Pointer pModule; @@ -10940,7 +10940,7 @@ class sqlite3_vtab extends ffi.Struct { /// module or until the [database connection] closes. The content /// of this structure must not change while it is registered with /// any database connection. -class sqlite3_module extends ffi.Struct { +final class sqlite3_module extends ffi.Struct { @ffi.Int() external int iVersion; @@ -11181,7 +11181,7 @@ class sqlite3_module extends ffi.Struct { /// It may therefore only be used if /// sqlite3_libversion_number() returns a value greater than or equal to /// 3009000. -class sqlite3_index_info extends ffi.Struct { +final class sqlite3_index_info extends ffi.Struct { /// Number of entries in aConstraint @ffi.Int() external int nConstraint; @@ -11230,7 +11230,7 @@ class sqlite3_index_info extends ffi.Struct { external int colUsed; } -class sqlite3_index_constraint extends ffi.Struct { +final class sqlite3_index_constraint extends ffi.Struct { /// Column constrained. -1 for ROWID @ffi.Int() external int iColumn; @@ -11248,7 +11248,7 @@ class sqlite3_index_constraint extends ffi.Struct { external int iTermOffset; } -class sqlite3_index_orderby extends ffi.Struct { +final class sqlite3_index_orderby extends ffi.Struct { /// Column number @ffi.Int() external int iColumn; @@ -11259,7 +11259,7 @@ class sqlite3_index_orderby extends ffi.Struct { } /// Outputs -class sqlite3_index_constraint_usage extends ffi.Struct { +final class sqlite3_index_constraint_usage extends ffi.Struct { /// if >0, constraint is part of argv to xFilter @ffi.Int() external int argvIndex; @@ -11284,14 +11284,14 @@ class sqlite3_index_constraint_usage extends ffi.Struct { /// /// This superclass exists in order to define fields of the cursor that /// are common to all implementations. -class sqlite3_vtab_cursor extends ffi.Struct { +final class sqlite3_vtab_cursor extends ffi.Struct { /// Virtual table of this cursor external ffi.Pointer pVtab; } -class sqlite3_blob extends ffi.Opaque {} +final class sqlite3_blob extends ffi.Opaque {} -class sqlite3_mutex_methods extends ffi.Struct { +final class sqlite3_mutex_methods extends ffi.Struct { external ffi.Pointer> xMutexInit; external ffi.Pointer> xMutexEnd; @@ -11325,11 +11325,11 @@ class sqlite3_mutex_methods extends ffi.Struct { xMutexNotheld; } -class sqlite3_str extends ffi.Opaque {} +final class sqlite3_str extends ffi.Opaque {} -class sqlite3_pcache extends ffi.Opaque {} +final class sqlite3_pcache extends ffi.Opaque {} -class sqlite3_pcache_page extends ffi.Struct { +final class sqlite3_pcache_page extends ffi.Struct { /// The content of the page external ffi.Pointer pBuf; @@ -11337,7 +11337,7 @@ class sqlite3_pcache_page extends ffi.Struct { external ffi.Pointer pExtra; } -class sqlite3_pcache_methods2 extends ffi.Struct { +final class sqlite3_pcache_methods2 extends ffi.Struct { @ffi.Int() external int iVersion; @@ -11396,7 +11396,7 @@ class sqlite3_pcache_methods2 extends ffi.Struct { xShrink; } -class sqlite3_pcache_methods extends ffi.Struct { +final class sqlite3_pcache_methods extends ffi.Struct { external ffi.Pointer pArg; external ffi @@ -11446,7 +11446,7 @@ class sqlite3_pcache_methods extends ffi.Struct { xDestroy; } -class sqlite3_backup extends ffi.Opaque {} +final class sqlite3_backup extends ffi.Opaque {} /// CAPI3REF: Database Snapshot /// KEYWORDS: {snapshot} {sqlite3_snapshot} @@ -11466,14 +11466,14 @@ class sqlite3_backup extends ffi.Opaque {} /// version of the database file so that it is possible to later open a new read /// transaction that sees that historical version of the database rather than /// the most recent version. -class sqlite3_snapshot extends ffi.Struct { +final class sqlite3_snapshot extends ffi.Struct { @ffi.Array.multi([48]) external ffi.Array hidden; } /// A pointer to a structure of the following type is passed as the first /// argument to callbacks registered using rtree_geometry_callback(). -class sqlite3_rtree_geometry extends ffi.Struct { +final class sqlite3_rtree_geometry extends ffi.Struct { /// Copy of pContext passed to s_r_g_c() external ffi.Pointer pContext; @@ -11502,7 +11502,7 @@ typedef sqlite3_rtree_dbl = ffi.Double; /// Note that the first 5 fields of this structure are identical to /// sqlite3_rtree_geometry. This structure is a subclass of /// sqlite3_rtree_geometry. -class sqlite3_rtree_query_info extends ffi.Struct { +final class sqlite3_rtree_query_info extends ffi.Struct { /// pContext from when function registered external ffi.Pointer pContext; @@ -11772,7 +11772,7 @@ class sqlite3_rtree_query_info extends ffi.Struct { /// /// xPhraseNextColumn() /// See xPhraseFirstColumn above. -class Fts5ExtensionApi extends ffi.Struct { +final class Fts5ExtensionApi extends ffi.Struct { /// Currently always set to 3 @ffi.Int() external int iVersion; @@ -11912,17 +11912,17 @@ class Fts5ExtensionApi extends ffi.Struct { ffi.Pointer)>> xPhraseNextColumn; } -class Fts5Context extends ffi.Opaque {} +final class Fts5Context extends ffi.Opaque {} -class Fts5PhraseIter extends ffi.Struct { +final class Fts5PhraseIter extends ffi.Struct { external ffi.Pointer a; external ffi.Pointer b; } -class Fts5Tokenizer extends ffi.Opaque {} +final class Fts5Tokenizer extends ffi.Opaque {} -class fts5_tokenizer extends ffi.Struct { +final class fts5_tokenizer extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< ffi.Int Function( @@ -11954,7 +11954,7 @@ class fts5_tokenizer extends ffi.Struct { ffi.Int)>>)>> xTokenize; } -class fts5_api extends ffi.Struct { +final class fts5_api extends ffi.Struct { /// Currently always set to 2 @ffi.Int() external int iVersion; diff --git a/pkgs/ffigen/test/native_test/native_test_bindings.dart b/pkgs/ffigen/test/native_test/native_test_bindings.dart index d4a25d673d..58934cf450 100644 --- a/pkgs/ffigen/test/native_test/native_test_bindings.dart +++ b/pkgs/ffigen/test/native_test/native_test_bindings.dart @@ -244,7 +244,7 @@ class NativeLibrary { _Function1StructPassByValuePtr.asFunction(); } -class Struct1 extends ffi.Struct { +final class Struct1 extends ffi.Struct { @ffi.Int8() external int a; @@ -252,7 +252,7 @@ class Struct1 extends ffi.Struct { external ffi.Array>> data; } -class Struct3 extends ffi.Struct { +final class Struct3 extends ffi.Struct { @ffi.Int() external int a; From ba48bf7410ec6a6c23c83fc09d64d4eeb87d0c7c Mon Sep 17 00:00:00 2001 From: Tzvi Melamed Date: Wed, 19 Apr 2023 14:50:50 -0400 Subject: [PATCH 226/276] [ffigen] Change native test bindings name for consistency (#556) --- pkgs/ffigen/test/README.md | 2 +- ...est_bindings.dart => _expected_native_test_bindings.dart} | 0 pkgs/ffigen/test/native_test/config.yaml | 2 +- pkgs/ffigen/test/native_test/native_test.dart | 5 +++-- pkgs/ffigen/test/regen.dart | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) rename pkgs/ffigen/test/native_test/{native_test_bindings.dart => _expected_native_test_bindings.dart} (100%) diff --git a/pkgs/ffigen/test/README.md b/pkgs/ffigen/test/README.md index 1a499a4717..cfcc3141ed 100644 --- a/pkgs/ffigen/test/README.md +++ b/pkgs/ffigen/test/README.md @@ -34,7 +34,7 @@ works by: `test/debug_generated` directory. 3. Comparing the golden file (i.e. - [`test/native_test/native_test_bindings.dart`](https://github.com/dart-lang/ffigen/blob/master/test/native_test/native_test_bindings.dart)) + [`test/native_test/_expected_native_test_bindings.dart`](https://github.com/dart-lang/ffigen/blob/master/test/native_test/_expected_native_test_bindings.dart)) to the generated file and generating a test failure if they do not match. 4. Using the *golden* bindings to excercise the dynamic library. diff --git a/pkgs/ffigen/test/native_test/native_test_bindings.dart b/pkgs/ffigen/test/native_test/_expected_native_test_bindings.dart similarity index 100% rename from pkgs/ffigen/test/native_test/native_test_bindings.dart rename to pkgs/ffigen/test/native_test/_expected_native_test_bindings.dart diff --git a/pkgs/ffigen/test/native_test/config.yaml b/pkgs/ffigen/test/native_test/config.yaml index 901e55975d..3942f6f26d 100644 --- a/pkgs/ffigen/test/native_test/config.yaml +++ b/pkgs/ffigen/test/native_test/config.yaml @@ -8,7 +8,7 @@ name: NativeLibrary description: 'Native tests.' -output: 'native_test_bindings.dart' +output: '_expected_native_test_bindings.dart' headers: entry-points: - 'native_test.c' diff --git a/pkgs/ffigen/test/native_test/native_test.dart b/pkgs/ffigen/test/native_test/native_test.dart index 7a19c2a268..cc31709e39 100644 --- a/pkgs/ffigen/test/native_test/native_test.dart +++ b/pkgs/ffigen/test/native_test/native_test.dart @@ -10,7 +10,7 @@ import 'package:ffigen/ffigen.dart'; import 'package:path/path.dart' as path; import 'package:test/test.dart'; import '../test_utils.dart'; -import 'native_test_bindings.dart'; +import '_expected_native_test_bindings.dart'; void main() { late NativeLibrary bindings; @@ -32,7 +32,8 @@ void main() { final configFile = File(path.join('test', 'native_test', 'config.yaml')).absolute; final outFile = File( - path.join('test', 'debug_generated', 'native_test_bindings.dart'), + path.join( + 'test', 'debug_generated', '_expected_native_test_bindings.dart'), ).absolute; late Config config; diff --git a/pkgs/ffigen/test/regen.dart b/pkgs/ffigen/test/regen.dart index 1ee0df3c20..1617eda338 100644 --- a/pkgs/ffigen/test/regen.dart +++ b/pkgs/ffigen/test/regen.dart @@ -52,7 +52,7 @@ Future main(List args) async { final nativeTestConfig = File('test/native_test/config.yaml').absolute; final nativeTestOut = - File('test/native_test/native_test_bindings.dart').absolute; + File('test/native_test/_expected_native_test_bindings.dart').absolute; await withChDir(nativeTestConfig.path, () => _regenConfig(nativeTestConfig, nativeTestOut)); From 97f6ecc003b318803580d3bdfa01040c8b173759 Mon Sep 17 00:00:00 2001 From: Tzvi Melamed Date: Thu, 20 Apr 2023 02:19:07 -0400 Subject: [PATCH 227/276] [ffigen] Add description to typedef test (#557) --- .../expected_bindings/_expected_typedef_bindings.dart | 1 + pkgs/ffigen/test/header_parser_tests/typedef_test.dart | 1 + 2 files changed, 2 insertions(+) diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart index b88074614e..885f6410ab 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart @@ -6,6 +6,7 @@ // ignore_for_file: type=lint import 'dart:ffi' as ffi; +/// Typedef Test class Bindings { /// Holds the symbol lookup function. final ffi.Pointer Function(String symbolName) diff --git a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart index 51b90e6565..5c373f5986 100644 --- a/pkgs/ffigen/test/header_parser_tests/typedef_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/typedef_test.dart @@ -19,6 +19,7 @@ void main() { actual = parser.parse( testConfig(''' ${strings.name}: 'Bindings' +${strings.description}: 'Typedef Test' ${strings.output}: 'unused' ${strings.headers}: From 54215ca1274c235035d1b77b4ff7e7c2c5b1de6f Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Wed, 26 Apr 2023 01:31:19 +0530 Subject: [PATCH 228/276] [ffigen] Handle multi anonymous struct with same USR (#559) --- pkgs/ffigen/CHANGELOG.md | 4 ++++ pkgs/ffigen/lib/src/header_parser/utils.dart | 17 ++++++++++++++++- pkgs/ffigen/pubspec.yaml | 2 +- .../_expected_unions_bindings.dart | 16 ++++++++++++++++ pkgs/ffigen/test/header_parser_tests/unions.h | 14 ++++++++++++++ 5 files changed, 51 insertions(+), 2 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index e996b1ccfd..45b59932d2 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 7.2.11 + +- Fix invalid struct/enum member references due to multiple anonymous struct/enum in a declaration. + # 7.2.10 - Generate parameter names in function pointer fields and typedefs. diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index a674618f18..f03df3fb56 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -60,7 +60,11 @@ extension CXSourceRangeExt on Pointer { extension CXCursorExt on clang_types.CXCursor { String usr() { - return clang.clang_getCursorUSR(this).toStringAndDispose(); + var res = clang.clang_getCursorUSR(this).toStringAndDispose(); + if (isAnonymousRecordDecl()) { + res += "@offset:${sourceFileOffset()}"; + } + return res; } /// Returns the kind int from [clang_types.CXCursorKind]. @@ -124,6 +128,17 @@ extension CXCursorExt on clang_types.CXCursor { return s; } + int sourceFileOffset() { + final cxsource = clang.clang_getCursorLocation(this); + final cxOffset = calloc(); + + // Puts the values in these pointers. + clang.clang_getFileLocation(cxsource, nullptr, nullptr, nullptr, cxOffset); + final offset = cxOffset.value; + calloc.free(cxOffset); + return offset; + } + /// Returns whether the file that the cursor is inside is a system header. bool isInSystemHeader() { final location = clang.clang_getCursorLocation(this); diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 6c2e147356..bebcaf5ccc 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 7.2.10 +version: 7.2.11 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart index 585ab9a4a2..b35cd3d4cc 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart @@ -63,3 +63,19 @@ class Union3 extends ffi.Opaque {} class Union4 extends ffi.Opaque {} class Union5 extends ffi.Opaque {} + +class Union6 extends ffi.Union { + external UnnamedUnion1 unnamed; + + external UnnamedUnion2 unnamed1; +} + +class UnnamedUnion1 extends ffi.Union { + @ffi.Float() + external double a; +} + +class UnnamedUnion2 extends ffi.Union { + @ffi.Float() + external double b; +} diff --git a/pkgs/ffigen/test/header_parser_tests/unions.h b/pkgs/ffigen/test/header_parser_tests/unions.h index 1bd9ae1a7f..e7d86ffd8a 100644 --- a/pkgs/ffigen/test/header_parser_tests/unions.h +++ b/pkgs/ffigen/test/header_parser_tests/unions.h @@ -32,6 +32,20 @@ union Union5 union Union3 s; // Incomplete nested union. }; +// Multiple anonymous declarations +union Union6 +{ + union + { + float a; + }; + + union + { + float b; + }; +}; + void func1(union Union2 *s); // Incomplete array parameter will be treated as a pointer. From 1efea34203bb296cb11b921bfb3203be98a9ffd5 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Wed, 26 Apr 2023 12:13:44 +0530 Subject: [PATCH 229/276] [ffigen] Merge stable to master, bump version (#561) * Handle multi anonymous struct with same USR (#559) Co-authored-by: Daco Harkes --- pkgs/ffigen/CHANGELOG.md | 7 +++++++ pkgs/ffigen/lib/src/header_parser/utils.dart | 17 ++++++++++++++++- pkgs/ffigen/pubspec.yaml | 2 +- .../_expected_unions_bindings.dart | 16 ++++++++++++++++ pkgs/ffigen/test/header_parser_tests/unions.h | 14 ++++++++++++++ 5 files changed, 54 insertions(+), 2 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 6b405764a0..168d731c9a 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 8.0.0-dev.1 + +- Fix invalid struct/enum member references due to multiple anonymous struct/enum in a declaration. + # 8.0.0-dev.0 - Adds `final` class modifier to generated sub types `Struct`, `Union` and @@ -9,6 +13,9 @@ `Opaque` sub types is already disallowed by `dart:ffi` pre 3.0, so adding the `final` keyword is not a breaking change. - Bumps SDK lowerbound to 3.0. +# 7.2.11 + +- Fix invalid struct/enum member references due to multiple anonymous struct/enum in a declaration. # 7.2.10 diff --git a/pkgs/ffigen/lib/src/header_parser/utils.dart b/pkgs/ffigen/lib/src/header_parser/utils.dart index a674618f18..f03df3fb56 100644 --- a/pkgs/ffigen/lib/src/header_parser/utils.dart +++ b/pkgs/ffigen/lib/src/header_parser/utils.dart @@ -60,7 +60,11 @@ extension CXSourceRangeExt on Pointer { extension CXCursorExt on clang_types.CXCursor { String usr() { - return clang.clang_getCursorUSR(this).toStringAndDispose(); + var res = clang.clang_getCursorUSR(this).toStringAndDispose(); + if (isAnonymousRecordDecl()) { + res += "@offset:${sourceFileOffset()}"; + } + return res; } /// Returns the kind int from [clang_types.CXCursorKind]. @@ -124,6 +128,17 @@ extension CXCursorExt on clang_types.CXCursor { return s; } + int sourceFileOffset() { + final cxsource = clang.clang_getCursorLocation(this); + final cxOffset = calloc(); + + // Puts the values in these pointers. + clang.clang_getFileLocation(cxsource, nullptr, nullptr, nullptr, cxOffset); + final offset = cxOffset.value; + calloc.free(cxOffset); + return offset; + } + /// Returns whether the file that the cursor is inside is a system header. bool isInSystemHeader() { final location = clang.clang_getCursorLocation(this); diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 53dc9f2fe8..d477965262 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 8.0.0-dev.0 +version: 8.0.0-dev.1 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart index ca7a938fb3..82fedd077d 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart @@ -63,3 +63,19 @@ final class Union3 extends ffi.Opaque {} final class Union4 extends ffi.Opaque {} final class Union5 extends ffi.Opaque {} + +final class Union6 extends ffi.Union { + external UnnamedUnion1 unnamed; + + external UnnamedUnion2 unnamed1; +} + +final class UnnamedUnion1 extends ffi.Union { + @ffi.Float() + external double a; +} + +final class UnnamedUnion2 extends ffi.Union { + @ffi.Float() + external double b; +} diff --git a/pkgs/ffigen/test/header_parser_tests/unions.h b/pkgs/ffigen/test/header_parser_tests/unions.h index 1bd9ae1a7f..e7d86ffd8a 100644 --- a/pkgs/ffigen/test/header_parser_tests/unions.h +++ b/pkgs/ffigen/test/header_parser_tests/unions.h @@ -32,6 +32,20 @@ union Union5 union Union3 s; // Incomplete nested union. }; +// Multiple anonymous declarations +union Union6 +{ + union + { + float a; + }; + + union + { + float b; + }; +}; + void func1(union Union2 *s); // Incomplete array parameter will be treated as a pointer. From f0ab18e89d259883af7a4abb2e76d93860ea9b3c Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Mon, 1 May 2023 10:21:28 +0200 Subject: [PATCH 230/276] [ffigen] Use `@Native` syntax (#562) --- pkgs/ffigen/CHANGELOG.md | 5 +++++ pkgs/ffigen/README.md | 4 ++-- pkgs/ffigen/example/ffinative/README.md | 4 ++-- .../ffigen/example/ffinative/generated_bindings.dart | 12 ++++++------ pkgs/ffigen/lib/src/code_generator/func.dart | 6 +++--- .../src/header_parser/sub_parsers/var_parser.dart | 4 ++-- pkgs/ffigen/pubspec.yaml | 2 +- 7 files changed, 21 insertions(+), 16 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 168d731c9a..a9e26eb6cd 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,8 @@ +# 8.0.0-dev.2 + +- Use `@Native` syntax instead of deprecated `@FfiNative` syntax. + + # 8.0.0-dev.1 - Fix invalid struct/enum member references due to multiple anonymous struct/enum in a declaration. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index c4f5a0237e..5195ad9399 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -509,10 +509,10 @@ type-map: ffi-native - WARNING: FfiNative support is EXPERIMENTAL. The API may change + WARNING: Native support is EXPERIMENTAL. The API may change in a breaking way without notice.

    - Generate `@FfiNative` bindings instead of bindings using `DynamicLibrary` or `lookup`. + Generate `@Native` bindings instead of bindings using `DynamicLibrary` or `lookup`. diff --git a/pkgs/ffigen/example/ffinative/README.md b/pkgs/ffigen/example/ffinative/README.md index 82b0e88f18..7c5b16934a 100644 --- a/pkgs/ffigen/example/ffinative/README.md +++ b/pkgs/ffigen/example/ffinative/README.md @@ -1,6 +1,6 @@ -# FfiNatives example +# Natives example -A simple example generating `FfiNative` bindings for a very small header file (`headers/example.h`). +A simple example generating `Native` bindings for a very small header file (`headers/example.h`). ## Generating bindings At the root of this example (`example/simple`), run - diff --git a/pkgs/ffigen/example/ffinative/generated_bindings.dart b/pkgs/ffigen/example/ffinative/generated_bindings.dart index 1529564609..389620d8a6 100644 --- a/pkgs/ffigen/example/ffinative/generated_bindings.dart +++ b/pkgs/ffigen/example/ffinative/generated_bindings.dart @@ -7,36 +7,36 @@ import 'dart:ffi' as ffi; /// Adds 2 integers. -@ffi.FfiNative('sum') +@ffi.Native(symbol: 'sum') external int sum( int a, int b, ); /// Subtracts 2 integers. -@ffi.FfiNative('subtract') +@ffi.Native(symbol: 'subtract') external int subtract( int a, int b, ); /// Multiplies 2 integers, returns pointer to an integer,. -@ffi.FfiNative Function(ffi.Int, ffi.Int)>('multiply') +@ffi.Native Function(ffi.Int, ffi.Int)>(symbol: 'multiply') external ffi.Pointer multiply( int a, int b, ); /// Divides 2 integers, returns pointer to a float. -@ffi.FfiNative Function(ffi.Int, ffi.Int)>('divide') +@ffi.Native Function(ffi.Int, ffi.Int)>(symbol: 'divide') external ffi.Pointer divide( int a, int b, ); /// Divides 2 floats, returns a pointer to double. -@ffi.FfiNative Function(ffi.Float, ffi.Float)>( - 'dividePrecision') +@ffi.Native Function(ffi.Float, ffi.Float)>( + symbol: 'dividePrecision') external ffi.Pointer dividePrecision( double a, double b, diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index 590f63cde3..55aec86f16 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -31,10 +31,10 @@ import 'writer.dart'; /// typedef _dart_sum = int Function(int a, int b); /// ``` /// -/// When using `FfiNative`, the code is as follows. +/// When using `Native`, the code is as follows. /// /// ```dart -/// @ffi.FfiNative('sum') +/// @ffi.Native('sum') /// external int sum(int a, int b); /// ``` class Func extends LookUpBinding { @@ -126,7 +126,7 @@ class Func extends LookUpBinding { : ''; final isLeafString = isLeaf ? ', isLeaf: true' : ''; s.write( - "@${w.ffiLibraryPrefix}.FfiNative<$cType>('$originalName'$assetString$isLeafString)\n"); + "@${w.ffiLibraryPrefix}.Native<$cType>(symbol: '$originalName'$assetString$isLeafString)\n"); s.write( 'external ${functionType.returnType.getDartType(w)} $enclosingFuncName(\n'); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart index a8d46d3477..90b38533bb 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart @@ -34,8 +34,8 @@ Global? parseVarDeclaration(clang_types.CXCursor cursor) { } if (config.ffiNativeConfig.enabled) { - _logger.warning( - "Skipped global variable '$name', not supported in FfiNatives."); + _logger + .warning("Skipped global variable '$name', not supported in Natives."); return null; } diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index d477965262..d4a7013ff5 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 8.0.0-dev.1 +version: 8.0.0-dev.2 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen From 79e845f7882f1f067913ac2fe61ded0ec9a9d9c7 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 1 May 2023 18:27:20 +0530 Subject: [PATCH 231/276] [ffigen] Support for generating Variadic functions (#515) --- pkgs/ffigen/CHANGELOG.md | 4 + pkgs/ffigen/README.md | 20 ++ pkgs/ffigen/lib/src/code_generator/func.dart | 10 +- .../lib/src/code_generator/func_type.dart | 53 ++++- .../lib/src/code_generator/imports.dart | 19 ++ .../lib/src/config_provider/config.dart | 15 ++ .../lib/src/config_provider/config_types.dart | 15 ++ .../lib/src/config_provider/spec_utils.dart | 173 ++++++++++++++++ .../clang_bindings/clang_bindings.dart | 15 ++ .../sub_parsers/functiondecl_parser.dart | 69 +++--- .../translation_unit_parser.dart | 10 +- pkgs/ffigen/lib/src/strings.dart | 5 + pkgs/ffigen/pubspec.yaml | 2 +- .../_expected_varargs_bindings.dart | 196 ++++++++++++++++++ .../ffigen/test/header_parser_tests/varargs.h | 15 ++ .../header_parser_tests/varargs_test.dart | 59 ++++++ pkgs/ffigen/test/test_utils.dart | 4 +- pkgs/ffigen/tool/libclang_config.yaml | 1 + 18 files changed, 644 insertions(+), 41 deletions(-) create mode 100644 pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_varargs_bindings.dart create mode 100644 pkgs/ffigen/test/header_parser_tests/varargs.h create mode 100644 pkgs/ffigen/test/header_parser_tests/varargs_test.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index a9e26eb6cd..f577aa51a0 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 8.0.0-dev.3 + +- Added support for variadic functions using config `functions -> variadic-arguments`. + # 8.0.0-dev.2 - Use `@Native` syntax instead of deprecated `@FfiNative` syntax. diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 5195ad9399..674c3471d0 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -331,6 +331,26 @@ functions: # If you only use exclude, then everything # not excluded is generated. - 'dispose' +``` + + + + functions -> variadic-arguments + Generate multiple functions with different variadic arguments.
    + Default: var args for any function are ignored. + + + +```yaml +functions: + variadic-arguments: + myfunc: + // Native C types are supported + - [int, unsigned char, long*, float**] + // Common C typedefs (stddef.h) are supported too + - [uint8_t, intptr_t, size_t, wchar_t*] + // Structs/Unions/Typedefs from generated code or a library import can be referred too. + - [MyStruct*, my_custom_lib.CustomUnion] ``` diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index 55aec86f16..f8d32e2414 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -58,6 +58,7 @@ class Func extends LookUpBinding { String? dartDoc, required Type returnType, List? parameters, + List? varArgParameters, this.exposeSymbolAddress = false, this.exposeFunctionTypedefs = false, this.isLeaf = false, @@ -66,6 +67,7 @@ class Func extends LookUpBinding { }) : functionType = FunctionType( returnType: returnType, parameters: parameters ?? const [], + varArgParameters: varArgParameters ?? const [], ), super( usr: usr, @@ -109,7 +111,7 @@ class Func extends LookUpBinding { } // Resolve name conflicts in function parameter names. final paramNamer = UniqueNamer({}); - for (final p in functionType.parameters) { + for (final p in functionType.dartTypeParameters) { p.name = paramNamer.makeUnique(p.name); } @@ -130,7 +132,7 @@ class Func extends LookUpBinding { s.write( 'external ${functionType.returnType.getDartType(w)} $enclosingFuncName(\n'); - for (final p in functionType.parameters) { + for (final p in functionType.dartTypeParameters) { s.write(' ${p.type.getDartType(w)} ${p.name},\n'); } s.write(');\n\n'); @@ -138,14 +140,14 @@ class Func extends LookUpBinding { // Write enclosing function. s.write( '${functionType.returnType.getDartType(w)} $enclosingFuncName(\n'); - for (final p in functionType.parameters) { + for (final p in functionType.dartTypeParameters) { s.write(' ${p.type.getDartType(w)} ${p.name},\n'); } s.write(') {\n'); s.write('return $funcVarName'); s.write('(\n'); - for (final p in functionType.parameters) { + for (final p in functionType.dartTypeParameters) { s.write(' ${p.name},\n'); } s.write(' );\n'); diff --git a/pkgs/ffigen/lib/src/code_generator/func_type.dart b/pkgs/ffigen/lib/src/code_generator/func_type.dart index 54020285aa..d4c74f6866 100644 --- a/pkgs/ffigen/lib/src/code_generator/func_type.dart +++ b/pkgs/ffigen/lib/src/code_generator/func_type.dart @@ -11,13 +11,19 @@ import 'writer.dart'; class FunctionType extends Type { final Type returnType; final List parameters; + final List varArgParameters; + + /// Get all the parameters for generating the dart type. This includes both + /// [parameters] and [varArgParameters]. + List get dartTypeParameters => parameters + varArgParameters; FunctionType({ required this.returnType, required this.parameters, + this.varArgParameters = const [], }); - String _getTypeString( + String _getCacheKeyString( bool writeArgumentNames, String Function(Type) typeToString) { final sb = StringBuffer(); @@ -35,18 +41,51 @@ class FunctionType extends Type { } @override - String getCType(Writer w, {bool writeArgumentNames = true}) => - _getTypeString(writeArgumentNames, (Type t) => t.getCType(w)); + String getCType(Writer w, {bool writeArgumentNames = true}) { + final sb = StringBuffer(); + + // Write return Type. + sb.write(returnType.getCType(w)); + + // Write Function. + sb.write(' Function('); + sb.write((parameters).map((p) { + return '${p.type.getCType(w)} ${writeArgumentNames ? p.name : ""}'; + }).join(', ')); + if (varArgParameters.isNotEmpty) { + sb.write(", ${w.ffiLibraryPrefix}.VarArgs<("); + sb.write((varArgParameters).map((p) { + return '${p.type.getCType(w)} ${writeArgumentNames ? p.name : ""}'; + }).join(', ')); + sb.write(",)>"); + } + sb.write(')'); + + return sb.toString(); + } @override - String getDartType(Writer w, {bool writeArgumentNames = true}) => - _getTypeString(writeArgumentNames, (Type t) => t.getDartType(w)); + String getDartType(Writer w, {bool writeArgumentNames = true}) { + final sb = StringBuffer(); + + // Write return Type. + sb.write(returnType.getDartType(w)); + + // Write Function. + sb.write(' Function('); + sb.write(dartTypeParameters.map((p) { + return '${p.type.getDartType(w)} ${writeArgumentNames ? p.name : ""}'; + }).join(', ')); + sb.write(')'); + + return sb.toString(); + } @override - String toString() => _getTypeString(false, (Type t) => t.toString()); + String toString() => _getCacheKeyString(false, (Type t) => t.toString()); @override - String cacheKey() => _getTypeString(false, (Type t) => t.cacheKey()); + String cacheKey() => _getCacheKeyString(false, (Type t) => t.cacheKey()); @override void addDependencies(Set dependencies) { diff --git a/pkgs/ffigen/lib/src/code_generator/imports.dart b/pkgs/ffigen/lib/src/code_generator/imports.dart index 41f71617f7..d6dcd06014 100644 --- a/pkgs/ffigen/lib/src/code_generator/imports.dart +++ b/pkgs/ffigen/lib/src/code_generator/imports.dart @@ -49,6 +49,25 @@ class ImportedType extends Type { String? getDefaultValue(Writer w, String nativeLib) => defaultValue; } +/// An unchecked type similar to [ImportedType] which exists in the generated +/// binding itself. +class SelfImportedType extends Type { + final String cType; + final String dartType; + final String? defaultValue; + + SelfImportedType(this.cType, this.dartType, [this.defaultValue]); + + @override + String getCType(Writer w) => cType; + + @override + String getDartType(Writer w) => dartType; + + @override + String toString() => cType; +} + final ffiImport = LibraryImport('ffi', 'dart:ffi'); final ffiPkgImport = LibraryImport('pkg_ffi', 'package:ffi/ffi.dart'); diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index e012e56a87..12a7e69f7f 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -53,6 +53,10 @@ class Config { List get compilerOpts => _compilerOpts; late List _compilerOpts; + /// VarArg function handling. + Map> get varArgFunctions => _varArgFunctions; + late Map> _varArgFunctions = {}; + /// Declaration config for Functions. Declaration get functionDecl => _functionDecl; late Declaration _functionDecl; @@ -446,6 +450,17 @@ class Config { result as Map>, _libraryImports); }, ), + [strings.functions, strings.varArgFunctions]: + Specification>>( + requirement: Requirement.no, + validator: varArgFunctionConfigValidator, + extractor: varArgFunctionConfigExtractor, + defaultValue: () => >{}, + extractedResult: (dynamic result) { + _varArgFunctions = makeVarArgFunctionsMapping( + result as Map>, _libraryImports); + }, + ), [strings.excludeAllByDefault]: Specification( requirement: Requirement.no, validator: booleanValidator, diff --git a/pkgs/ffigen/lib/src/config_provider/config_types.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart index 8521bdb111..1eddfc98fe 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_types.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart @@ -5,6 +5,7 @@ /// Contains all the neccesary classes required by config. import 'dart:io'; +import 'package:ffigen/src/code_generator.dart'; import 'package:quiver/pattern.dart' as quiver; import 'path_finder.dart'; @@ -423,3 +424,17 @@ class OutputConfig { OutputConfig(this.output, this.symbolFile); } + +class RawVarArgFunction { + String? postfix; + final List rawTypeStrings; + + RawVarArgFunction(this.postfix, this.rawTypeStrings); +} + +class VarArgFunction { + final String postfix; + final List types; + + VarArgFunction(this.postfix, this.types); +} diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index dfe6bbf270..8bb3e2b837 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -6,6 +6,7 @@ import 'dart:io'; import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/code_generator/utils.dart'; +import 'package:ffigen/src/header_parser/type_extractor/cxtypekindmap.dart'; import 'package:file/local.dart'; import 'package:glob/glob.dart'; import 'package:logging/logging.dart'; @@ -329,6 +330,99 @@ Map makeImportTypeMapping( return typeMappings; } +Type makePointerToType(Type type, int pointerCount) { + for (var i = 0; i < pointerCount; i++) { + type = PointerType(type); + } + return type; +} + +String makePostfixFromRawVarArgType(List rawVarArgType) { + return rawVarArgType + .map((e) => e + .replaceAll('*', 'Ptr') + .replaceAll(RegExp(r'_t$'), '') + .replaceAll(' ', '') + .replaceAll(RegExp('[^A-Za-z0-9_]'), '')) + .map((e) => e.length > 1 ? '${e[0].toUpperCase()}${e.substring(1)}' : e) + .join(''); +} + +Type makeTypeFromRawVarArgType( + String rawVarArgType, Map libraryImportsMap) { + Type baseType; + var rawBaseType = rawVarArgType.trim(); + // Split the raw type based on pointer usage. E.g - + // int => [int] + // char* => [char,*] + // ffi.Hello ** => [ffi.Hello,**] + final typeStringRegexp = RegExp(r'([a-zA-Z0-9_\s\.]+)(\**)$'); + if (!typeStringRegexp.hasMatch(rawBaseType)) { + throw Exception('Cannot parse variadic argument type - $rawVarArgType.'); + } + final regExpMatch = typeStringRegexp.firstMatch(rawBaseType)!; + final groups = regExpMatch.groups([1, 2]); + rawBaseType = groups[0]!; + // Handle basic supported types. + if (cxTypeKindToImportedTypes.containsKey(rawBaseType)) { + baseType = cxTypeKindToImportedTypes[rawBaseType]!; + } else if (supportedTypedefToImportedType.containsKey(rawBaseType)) { + baseType = supportedTypedefToImportedType[rawBaseType]!; + } else if (suportedTypedefToSuportedNativeType.containsKey(rawBaseType)) { + baseType = NativeType(suportedTypedefToSuportedNativeType[rawBaseType]!); + } else { + // Use library import if specified (E.g - ffi.UintPtr or custom.MyStruct) + final rawVarArgTypeSplit = rawBaseType.split('.'); + if (rawVarArgTypeSplit.length == 1) { + final typeName = rawVarArgTypeSplit[0].replaceAll(' ', ''); + baseType = SelfImportedType(typeName, typeName); + } else if (rawVarArgTypeSplit.length == 2) { + final lib = rawVarArgTypeSplit[0]; + final libraryImport = strings.predefinedLibraryImports[lib] ?? + libraryImportsMap[rawVarArgTypeSplit[0]]; + if (libraryImport == null) { + throw Exception('Please declare $lib in library-imports.'); + } + final typeName = rawVarArgTypeSplit[1].replaceAll(' ', ''); + baseType = ImportedType(libraryImport, typeName, typeName); + } else { + throw Exception( + 'Invalid type $rawVarArgType : Expected 0 or 1 .(dot) separators.'); + } + } + + // Handle pointers + final pointerCount = groups[1]!.length; + return makePointerToType(baseType, pointerCount); +} + +Map> makeVarArgFunctionsMapping( + Map> rawVarArgMappings, + Map libraryImportsMap) { + final mappings = >{}; + for (final key in rawVarArgMappings.keys) { + final varArgList = []; + for (final rawVarArg in rawVarArgMappings[key]!) { + var postfix = rawVarArg.postfix ?? ''; + final types = []; + for (final rva in rawVarArg.rawTypeStrings) { + types.add(makeTypeFromRawVarArgType(rva, libraryImportsMap)); + } + if (postfix.isEmpty) { + if (rawVarArgMappings[key]!.length == 1) { + postfix = ''; + } else { + postfix = makePostfixFromRawVarArgType(rawVarArg.rawTypeStrings); + } + } + // Extract postfix from config and/or deduce from var names. + varArgList.add(VarArgFunction(postfix, types)); + } + mappings[key] = varArgList; + } + return mappings; +} + final _quoteMatcher = RegExp(r'''^["'](.*)["']$''', dotAll: true); final _cmdlineArgMatcher = RegExp(r'''['"](\\"|[^"])*?['"]|[^ ]+'''); List compilerOptsToList(String compilerOpts) { @@ -743,6 +837,85 @@ Includer _extractIncluderFromYaml(dynamic yamlMap) { ); } +Map> varArgFunctionConfigExtractor( + dynamic yamlMap) { + final result = >{}; + final configMap = (yamlMap as YamlMap); + for (final key in configMap.keys) { + final List vafuncs = []; + for (final rawVaFunc in (configMap[key] as YamlList)) { + if (rawVaFunc is YamlList) { + vafuncs.add(RawVarArgFunction(null, rawVaFunc.cast())); + } else if (rawVaFunc is YamlMap) { + vafuncs.add(RawVarArgFunction(rawVaFunc[strings.postfix] as String?, + (rawVaFunc[strings.types] as YamlList).cast())); + } else { + throw Exception("Unexpected type in variadic-argument config."); + } + } + result[key as String] = vafuncs; + } + + return result; +} + +bool varArgFunctionConfigValidator(List name, dynamic value) { + if (!checkType(name, value)) { + return false; + } + var result = true; + for (final key in (value as YamlMap).keys) { + final list = value[key as String]; + if (!checkType([...name, key], list)) { + result = false; + continue; + } + (list as YamlList).asMap().forEach((idx, subList) { + if (subList is YamlMap) { + if (!subList.containsKey(strings.types)) { + result = false; + _logger.severe('Missing required key - ${[ + ...name, + key, + idx.toString(), + strings.types + ].join(" -> ")}'); + } + subList.forEach((subkey, subvalue) { + subkey = subkey as String; + if (subkey == strings.postfix) { + if (!checkType( + [...name, key, idx.toString(), subkey], subvalue)) { + result = false; + } + } else if (subkey == strings.types) { + if (!checkType( + [...name, key, idx.toString(), subkey], subvalue)) { + result = false; + } + } else { + result = false; + _logger.severe('Unknown key - ${[ + ...name, + key, + idx.toString(), + subkey + ].join(" -> ")}'); + } + }); + } else if (subList is! YamlList) { + result = false; + _logger.severe('Expected ${[ + ...name, + key, + idx + ].join(" -> ")} to be a List or a Map.'); + } + }); + } + return result; +} + Declaration declarationConfigExtractor(dynamic yamlMap) { final renamePatterns = []; final renameFull = {}; diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 4c4c472621..c7d6e2f400 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -792,6 +792,21 @@ class Clang { _clang_Type_getObjCObjectBaseTypePtr .asFunction(); + /// Return 1 if the CXType is a variadic function type, and 0 otherwise. + int clang_isFunctionTypeVariadic( + CXType T, + ) { + return _clang_isFunctionTypeVariadic( + T, + ); + } + + late final _clang_isFunctionTypeVariadicPtr = + _lookup>( + 'clang_isFunctionTypeVariadic'); + late final _clang_isFunctionTypeVariadic = + _clang_isFunctionTypeVariadicPtr.asFunction(); + /// Retrieve the return type associated with a given cursor. /// /// This only returns a valid type if the cursor refers to a function or method. diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index d2d3412274..94d5ed01b2 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/config_provider/config_types.dart'; import 'package:ffigen/src/header_parser/data.dart'; import 'package:logging/logging.dart'; @@ -14,7 +15,9 @@ final _logger = Logger('ffigen.header_parser.functiondecl_parser'); /// Holds temporary information regarding [Func] while parsing. class _ParserFunc { - Func? func; + /// Multiple values are since there may be more than one instance of the + /// same base C function with different variadic arguments. + List funcs = []; bool incompleteStructParameter = false; bool unimplementedParameterType = false; _ParserFunc(); @@ -23,7 +26,7 @@ class _ParserFunc { final _stack = Stack<_ParserFunc>(); /// Parses a function declaration. -Func? parseFunctionDeclaration(clang_types.CXCursor cursor) { +List? parseFunctionDeclaration(clang_types.CXCursor cursor) { _stack.push(_ParserFunc()); final funcUsr = cursor.usr(); @@ -39,8 +42,8 @@ Func? parseFunctionDeclaration(clang_types.CXCursor cursor) { '${cursor.completeStringRepr()}'); _logger.warning( "Skipped Function '$funcName', inline functions are not supported."); - // Returning null so that [addToBindings] function excludes this. - return _stack.pop().func; + // Returning empty so that [addToBindings] function excludes this. + return _stack.pop().funcs; } if (rt.isIncompleteCompound || _stack.top.incompleteStructParameter) { @@ -51,7 +54,7 @@ Func? parseFunctionDeclaration(clang_types.CXCursor cursor) { "Skipped Function '$funcName', Incomplete struct pass/return by " 'value not supported.'); // Returning null so that [addToBindings] function excludes this. - return _stack.pop().func; + return _stack.pop().funcs; } if (rt.baseType is UnimplementedType || @@ -62,32 +65,46 @@ Func? parseFunctionDeclaration(clang_types.CXCursor cursor) { "Skipped Function '$funcName', function has unsupported return type " 'or parameter type.'); // Returning null so that [addToBindings] function excludes this. - return _stack.pop().func; + return _stack.pop().funcs; } - _stack.top.func = Func( - dartDoc: getCursorDocComment( - cursor, - nesting.length + commentPrefix.length, - ), - usr: funcUsr, - name: config.functionDecl.renameUsingConfig(funcName), - originalName: funcName, - returnType: rt, - parameters: parameters, - exposeSymbolAddress: - config.functionDecl.shouldIncludeSymbolAddress(funcName), - exposeFunctionTypedefs: - config.exposeFunctionTypedefs.shouldInclude(funcName), - isLeaf: config.leafFunctions.shouldInclude(funcName), - ffiNativeConfig: config.ffiNativeConfig, - ); - bindingsIndex.addFuncToSeen(funcUsr, _stack.top.func!); + // Initialized with a single value with no prefix and empty var args. + var varArgFunctions = [VarArgFunction('', [])]; + if (clang.clang_isFunctionTypeVariadic(cursor.type()) == 1) { + if (config.varArgFunctions.containsKey(funcName)) { + varArgFunctions = config.varArgFunctions[funcName]!; + } else { + _logger.warning( + "Skipping variadic-argument config for function $funcName since its not variadic."); + } + } + for (final vaFunc in varArgFunctions) { + _stack.top.funcs.add(Func( + dartDoc: getCursorDocComment( + cursor, + nesting.length + commentPrefix.length, + ), + usr: funcUsr + vaFunc.postfix, + name: config.functionDecl.renameUsingConfig(funcName) + vaFunc.postfix, + originalName: funcName, + returnType: rt, + parameters: parameters, + varArgParameters: + vaFunc.types.map((ta) => Parameter(type: ta, name: 'va')).toList(), + exposeSymbolAddress: + config.functionDecl.shouldIncludeSymbolAddress(funcName), + exposeFunctionTypedefs: + config.exposeFunctionTypedefs.shouldInclude(funcName), + isLeaf: config.leafFunctions.shouldInclude(funcName), + ffiNativeConfig: config.ffiNativeConfig, + )); + } + bindingsIndex.addFuncToSeen(funcUsr, _stack.top.funcs.last); } else if (bindingsIndex.isSeenFunc(funcUsr)) { - _stack.top.func = bindingsIndex.getSeenFunc(funcUsr); + _stack.top.funcs.add(bindingsIndex.getSeenFunc(funcUsr)!); } - return _stack.pop().func; + return _stack.pop().funcs; } Type _getFunctionReturnType(clang_types.CXCursor cursor) { diff --git a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart index ea9d5945fd..31f50b865d 100644 --- a/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/translation_unit_parser.dart @@ -56,7 +56,7 @@ int _rootCursorVisitor(clang_types.CXCursor cursor, clang_types.CXCursor parent, _logger.finest('rootCursorVisitor: ${cursor.completeStringRepr()}'); switch (clang.clang_getCursorKind(cursor)) { case clang_types.CXCursorKind.CXCursor_FunctionDecl: - addToBindings(parseFunctionDeclaration(cursor)); + addAllToBindings(parseFunctionDeclaration(cursor) as List); break; case clang_types.CXCursorKind.CXCursor_StructDecl: case clang_types.CXCursorKind.CXCursor_UnionDecl: @@ -96,6 +96,14 @@ void addToBindings(Binding? b) { } } +/// Adds all binding if not empty. +void addAllToBindings(List b) { + if (b.isNotEmpty) { + // This is a set, and hence will not have duplicates. + _bindings.addAll(b); + } +} + BindingType? _getCodeGenTypeFromCursor(clang_types.CXCursor cursor) { final t = getCodeGenType(cursor.type(), ignoreFilter: false); return t is BindingType ? t : null; diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index e0f276190e..245dd7c472 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -85,6 +85,11 @@ const symbolAddress = 'symbol-address'; // Nested under `functions` const exposeFunctionTypedefs = 'expose-typedefs'; const leafFunctions = 'leaf'; +const varArgFunctions = 'variadic-arguments'; + +// Nested under varArg entries +const postfix = "postfix"; +const types = "types"; // Sub-fields of ObjC interfaces. const objcModule = 'module'; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index d4a7013ff5..fa5c897588 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 8.0.0-dev.2 +version: 8.0.0-dev.3 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_varargs_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_varargs_bindings.dart new file mode 100644 index 0000000000..5b51bcd287 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_varargs_bindings.dart @@ -0,0 +1,196 @@ +// ignore_for_file: camel_case_types + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +// ignore_for_file: type=lint +import 'dart:ffi' as ffi; + +/// VarArgs Test +class NativeLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + NativeLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NativeLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + int myfunc( + int a, + int va, + ffi.Pointer va1, + SA va2, + ) { + return _myfunc( + a, + va, + va1, + va2, + ); + } + + late final _myfuncPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Int, + ffi.VarArgs< + ( + ffi.Int, + ffi.Pointer, + SA, + )>)>>('myfunc'); + late final _myfunc = _myfuncPtr + .asFunction, SA)>(); + + void myfunc2CharPtrLongPtrPtr( + int a, + int b, + ffi.Pointer va, + ffi.Pointer> va1, + ) { + return _myfunc2CharPtrLongPtrPtr( + a, + b, + va, + va1, + ); + } + + late final _myfunc2CharPtrLongPtrPtrPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Char, + ffi.Char, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer>, + )>)>>('myfunc2'); + late final _myfunc2CharPtrLongPtrPtr = + _myfunc2CharPtrLongPtrPtrPtr.asFunction< + void Function(int, int, ffi.Pointer, + ffi.Pointer>)>(); + + void myfunc2SAIntPtrUnsignedcharPtrPtr( + int a, + int b, + SA va, + ffi.Pointer va1, + ffi.Pointer> va2, + ) { + return _myfunc2SAIntPtrUnsignedcharPtrPtr( + a, + b, + va, + va1, + va2, + ); + } + + late final _myfunc2SAIntPtrUnsignedcharPtrPtrPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Char, + ffi.Char, + ffi.VarArgs< + ( + SA, + ffi.Pointer, + ffi.Pointer>, + )>)>>('myfunc2'); + late final _myfunc2SAIntPtrUnsignedcharPtrPtr = + _myfunc2SAIntPtrUnsignedcharPtrPtrPtr.asFunction< + void Function(int, int, SA, ffi.Pointer, + ffi.Pointer>)>(); + + void myfunc2_custompostfix( + int a, + int b, + SA va, + ffi.Pointer va1, + ffi.Pointer> va2, + ) { + return _myfunc2_custompostfix( + a, + b, + va, + va1, + va2, + ); + } + + late final _myfunc2_custompostfixPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Char, + ffi.Char, + ffi.VarArgs< + ( + SA, + ffi.Pointer, + ffi.Pointer>, + )>)>>('myfunc2'); + late final _myfunc2_custompostfix = _myfunc2_custompostfixPtr.asFunction< + void Function(int, int, SA, ffi.Pointer, + ffi.Pointer>)>(); + + void myfunc3Struct_WithLong_Name_testPtrFloatPtr( + int a, + ffi.Pointer va, + ffi.Pointer va1, + ) { + return _myfunc3Struct_WithLong_Name_testPtrFloatPtr( + a, + va, + va1, + ); + } + + late final _myfunc3Struct_WithLong_Name_testPtrFloatPtrPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Long, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer, + )>)>>('myfunc3'); + late final _myfunc3Struct_WithLong_Name_testPtrFloatPtr = + _myfunc3Struct_WithLong_Name_testPtrFloatPtrPtr.asFunction< + void Function(int, ffi.Pointer, + ffi.Pointer)>(); + + void myfunc3_custompostfix2( + int a, + Struct_WithLong_Name_test va, + ) { + return _myfunc3_custompostfix2( + a, + va, + ); + } + + late final _myfunc3_custompostfix2Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Long, ffi.VarArgs<(Struct_WithLong_Name_test,)>)>>('myfunc3'); + late final _myfunc3_custompostfix2 = _myfunc3_custompostfix2Ptr + .asFunction(); +} + +final class SA extends ffi.Struct { + @ffi.Int() + external int a; +} + +final class Struct_WithLong_Name_test extends ffi.Struct { + @ffi.Int() + external int a; +} diff --git a/pkgs/ffigen/test/header_parser_tests/varargs.h b/pkgs/ffigen/test/header_parser_tests/varargs.h new file mode 100644 index 0000000000..e316b90c02 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/varargs.h @@ -0,0 +1,15 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +int myfunc(int a, ...); +void myfunc2(char a, char b, ...); +void myfunc3(long a, ...); + +struct SA { + int a; +}; + +struct Struct_WithLong_Name_test { + int a; +}; diff --git a/pkgs/ffigen/test/header_parser_tests/varargs_test.dart b/pkgs/ffigen/test/header_parser_tests/varargs_test.dart new file mode 100644 index 0000000000..deaa5af1d7 --- /dev/null +++ b/pkgs/ffigen/test/header_parser_tests/varargs_test.dart @@ -0,0 +1,59 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/config_provider.dart'; +import 'package:ffigen/src/header_parser.dart' as parser; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart' as yaml; + +import '../test_utils.dart'; + +late Library actual, expected; + +void main() { + group('varargs_test', () { + setUpAll(() { + logWarnings(); + actual = parser.parse( + Config.fromYaml(yaml.loadYaml(''' +${strings.name}: 'NativeLibrary' +${strings.description}: 'VarArgs Test' +${strings.output}: 'unused' + +${strings.headers}: + ${strings.entryPoints}: + - 'test/header_parser_tests/varargs.h' + +${strings.functions}: + ${strings.varArgFunctions}: + myfunc: + - [int, char*, SA] + myfunc2: + - [char*, long**] + - [SA, int*, unsigned char**] + - types: [SA, int*, unsigned char**] + postfix: _custompostfix + myfunc3: + - [Struct_WithLong_Name_test*, float*] + - types: [Struct_WithLong_Name_test] + postfix: _custompostfix2 + +${strings.preamble}: | + // ignore_for_file: camel_case_types + ''') as yaml.YamlMap), + ); + }); + test('Expected Bindings', () { + matchLibraryWithExpected( + actual, 'header_parser_varargs_test_output.dart', [ + 'test', + 'header_parser_tests', + 'expected_bindings', + '_expected_varargs_bindings.dart' + ]); + }); + }); +} diff --git a/pkgs/ffigen/test/test_utils.dart b/pkgs/ffigen/test/test_utils.dart index 50cb30e319..95434ff7de 100644 --- a/pkgs/ffigen/test/test_utils.dart +++ b/pkgs/ffigen/test/test_utils.dart @@ -57,13 +57,13 @@ String _normalizeGeneratedCode( /// This will not delete the actual debug file incase [expect] throws an error. void matchLibraryWithExpected( Library library, String pathForActual, List pathToExpected, - {String Function(String)? codeNormalizer}) { + {String Function(String)? codeNormalizer, bool format = true}) { _matchFileWithExpected( library: library, pathForActual: pathForActual, pathToExpected: pathToExpected, fileWriter: ({required Library library, required File file}) => - library.generateFile(file), + library.generateFile(file, format: format), codeNormalizer: codeNormalizer, ); } diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index 339c52c09f..6ac924f7a9 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -91,6 +91,7 @@ functions: - clang_Cursor_getArgument - clang_getNumArgTypes - clang_getArgType + - clang_isFunctionTypeVariadic - clang_getCursorResultType - clang_getEnumConstantDeclValue - clang_equalRanges From 417543900c7d7ca54b5ffc0bbd4d96eeabf4825b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 May 2023 09:09:12 +0200 Subject: [PATCH 232/276] [ffigen] Bump actions/checkout from 3.5.0 to 3.5.2 (#563) Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.0 to 3.5.2. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/8f4b7f84864484a7bf31766abe9204da3cbe65b3...8e5e7e5ab8b370d6c329ec480221332ada57f0ab) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkgs/ffigen/.github/workflows/test-package.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index d9aa8a4d60..af8b1f62a3 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -21,7 +21,7 @@ jobs: matrix: sdk: [3.0.0-417.0.dev] # TODO(#554) steps: - - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: ${{ matrix.sdk }} @@ -41,7 +41,7 @@ jobs: needs: analyze runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: 3.0.0-417.0.dev # TODO(#554) @@ -58,7 +58,7 @@ jobs: needs: analyze runs-on: macos-latest steps: - - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: 3.0.0-417.0.dev # TODO(#554) @@ -80,7 +80,7 @@ jobs: needs: analyze runs-on: windows-latest steps: - - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: 3.0.0-417.0.dev # TODO(#554) @@ -105,7 +105,7 @@ jobs: needs: analyze runs-on: windows-latest steps: - - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa with: channel: "master" From 21c4801ba0038bd0c8146b4602e55a04a8917740 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 May 2023 09:09:29 +0200 Subject: [PATCH 233/276] [ffigen] Bump coverallsapp/github-action from 2.0.0 to 2.1.2 (#564) Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 2.0.0 to 2.1.2. - [Release notes](https://github.com/coverallsapp/github-action/releases) - [Commits](https://github.com/coverallsapp/github-action/compare/67662d24394fd74bffcf7b462d1b432814159afd...f350da2c033043742f89e8c0b7b5145a1616da6d) --- updated-dependencies: - dependency-name: coverallsapp/github-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkgs/ffigen/.github/workflows/test-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index af8b1f62a3..b739392c13 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -71,7 +71,7 @@ jobs: - name: Collect coverage run: ./tool/coverage.sh - name: Upload coverage - uses: coverallsapp/github-action@67662d24394fd74bffcf7b462d1b432814159afd + uses: coverallsapp/github-action@f350da2c033043742f89e8c0b7b5145a1616da6d with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: lcov.info From 8059f72b6cdbe483ea9538455045ff42dd02498e Mon Sep 17 00:00:00 2001 From: Michael Thomsen Date: Tue, 2 May 2023 14:06:59 +0200 Subject: [PATCH 234/276] [ffigen] Add topics in pubspec.yaml (#567) --- pkgs/ffigen/pubspec.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index fa5c897588..76adf997fd 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -7,6 +7,11 @@ version: 8.0.0-dev.3 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen +topics: + - interop + - ffi + - codegen + environment: sdk: ">=3.0.0-417.0.dev <4.0.0" From c06c23366350028421ba3643884d7bece48760c6 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Tue, 2 May 2023 14:29:07 +0200 Subject: [PATCH 235/276] [ffigen] Bump version to 8.0.0 stable (#566) --- pkgs/ffigen/CHANGELOG.md | 4 ++++ pkgs/ffigen/example/c_json/pubspec.yaml | 2 +- pkgs/ffigen/example/ffinative/pubspec.yaml | 2 +- pkgs/ffigen/example/libclang-example/pubspec.yaml | 2 +- pkgs/ffigen/example/objective_c/pubspec.yaml | 2 +- pkgs/ffigen/example/shared_bindings/pubspec.yaml | 2 +- pkgs/ffigen/example/simple/pubspec.yaml | 2 +- pkgs/ffigen/example/swift/pubspec.yaml | 2 +- pkgs/ffigen/pubspec.yaml | 4 ++-- 9 files changed, 13 insertions(+), 9 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index f577aa51a0..9b0772469e 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 8.0.0 + +- Stable release for Dart 3.0 with support for class modifers, variadic arguments, and `@Native`s. + # 8.0.0-dev.3 - Added support for variadic functions using config `functions -> variadic-arguments`. diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index 120d19743e..8eb2a3729a 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -5,7 +5,7 @@ name: c_json_example environment: - sdk: ">=3.0.0-417.0.dev <4.0.0" + sdk: ">=3.0.0-417 <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/ffinative/pubspec.yaml b/pkgs/ffigen/example/ffinative/pubspec.yaml index 920ec996ba..1d5778838f 100644 --- a/pkgs/ffigen/example/ffinative/pubspec.yaml +++ b/pkgs/ffigen/example/ffinative/pubspec.yaml @@ -5,7 +5,7 @@ name: ffinative_example environment: - sdk: ">=3.0.0-417.0.dev <4.0.0" + sdk: ">=3.0.0-417 <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index c263c76359..d7503f0d6c 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -5,7 +5,7 @@ name: libclang_example environment: - sdk: ">=3.0.0-417.0.dev <4.0.0" + sdk: ">=3.0.0-417 <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/objective_c/pubspec.yaml b/pkgs/ffigen/example/objective_c/pubspec.yaml index 76aef5f5c3..5e5c43b59d 100644 --- a/pkgs/ffigen/example/objective_c/pubspec.yaml +++ b/pkgs/ffigen/example/objective_c/pubspec.yaml @@ -5,7 +5,7 @@ name: objective_c_example environment: - sdk: ">=3.0.0-417.0.dev <4.0.0" + sdk: ">=3.0.0-417 <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/shared_bindings/pubspec.yaml b/pkgs/ffigen/example/shared_bindings/pubspec.yaml index fd8cbde615..d5a9c389af 100644 --- a/pkgs/ffigen/example/shared_bindings/pubspec.yaml +++ b/pkgs/ffigen/example/shared_bindings/pubspec.yaml @@ -5,7 +5,7 @@ name: shared_bindings environment: - sdk: ">=3.0.0-417.0.dev <4.0.0" + sdk: ">=3.0.0-417 <4.0.0" dependencies: cli_util: ^0.4.0 diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index b6a4c67676..29c4a1b5a0 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -5,7 +5,7 @@ name: simple_example environment: - sdk: ">=3.0.0-417.0.dev <4.0.0" + sdk: ">=3.0.0-417 <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/swift/pubspec.yaml b/pkgs/ffigen/example/swift/pubspec.yaml index d0725ddb68..31c3aaffb6 100644 --- a/pkgs/ffigen/example/swift/pubspec.yaml +++ b/pkgs/ffigen/example/swift/pubspec.yaml @@ -5,7 +5,7 @@ name: swift_example environment: - sdk: ">=3.0.0-417.0.dev <4.0.0" + sdk: ">=3.0.0-417 <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 76adf997fd..58e6bfbbfc 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 8.0.0-dev.3 +version: 8.0.0 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen @@ -13,7 +13,7 @@ topics: - codegen environment: - sdk: ">=3.0.0-417.0.dev <4.0.0" + sdk: ">=3.0.0-417 <4.0.0" dependencies: ffi: ^2.0.1 From 013eee20b2a386ed27f8cc8c45e327dea15352a6 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Tue, 2 May 2023 14:10:06 -0700 Subject: [PATCH 236/276] [ffigen] Add the ability to get a pointer to an objective C object (#568) --- pkgs/ffigen/lib/src/code_generator/objc_block.dart | 3 --- .../lib/src/code_generator/objc_built_in_functions.dart | 3 +++ pkgs/ffigen/test/native_objc_test/cast_test.dart | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/objc_block.dart b/pkgs/ffigen/lib/src/code_generator/objc_block.dart index 310fef16ec..1599748c84 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_block.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_block.dart @@ -139,9 +139,6 @@ class $name extends _ObjCBlockBase { s.write('''); }'''); - // Get the pointer to the underlying block. - s.write(' ${blockPtr.getCType(w)} get pointer => _id;\n'); - s.write('}\n'); return BindingString( type: BindingStringType.objcBlock, string: s.toString()); diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index ebb4b207c6..05cd13009a 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -242,6 +242,9 @@ class $name implements ${w.ffiLibraryPrefix}.Finalizable { @override int get hashCode => _id.hashCode; + + /// Return a pointer to this object. + $idType get pointer => _id; } '''); } diff --git a/pkgs/ffigen/test/native_objc_test/cast_test.dart b/pkgs/ffigen/test/native_objc_test/cast_test.dart index 55b787bbd0..c63d940375 100644 --- a/pkgs/ffigen/test/native_objc_test/cast_test.dart +++ b/pkgs/ffigen/test/native_objc_test/cast_test.dart @@ -40,6 +40,11 @@ void main() { expect(fromCast, testInstance!); }); + test('pointers are equal', () { + final meAsInt = testInstance!.meAsInt(); + expect(testInstance!.pointer.address, meAsInt); + }); + test('equality equals', () { final meAsInt = testInstance!.meAsInt(); final fromCast = Castaway.castFromPointer( From 6648a18a78d800c2613950a43fde46fef6422333 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Fri, 12 May 2023 12:30:30 +0530 Subject: [PATCH 237/276] [ffigen] Fix invalid code generated due to anoymous structs/unions (#572) --- pkgs/ffigen/CHANGELOG.md | 4 ++++ .../sub_parsers/compounddecl_parser.dart | 7 +++++-- pkgs/ffigen/pubspec.yaml | 2 +- .../_expected_unions_bindings.dart | 2 ++ pkgs/ffigen/test/header_parser_tests/unions.h | 15 +++++++++++++++ 5 files changed, 27 insertions(+), 3 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 9b0772469e..b9e9aecb11 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 8.0.1 + +- Fixed invalid code generated due to anonymous structs/unions with unsupported types. + # 8.0.0 - Stable release for Dart 3.0 with support for class modifers, variadic arguments, and `@Native`s. diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart index 93d662df8b..8c700c96a1 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart @@ -294,12 +294,15 @@ int _compoundMembersVisitor(clang_types.CXCursor cursor, break; case clang_types.CXCursorKind.CXCursor_UnionDecl: case clang_types.CXCursorKind.CXCursor_StructDecl: - final mt = cursor.toCodeGenType(); - // If the union/struct are anonymous, then we need to add them now, // otherwise they will be added in the next iteration. if (!cursor.isAnonymousRecordDecl()) break; + final mt = cursor.toCodeGenType(); + if (mt.isIncompleteCompound) { + parsed.incompleteCompoundMember = true; + } + // Anonymous members are always unnamed. To avoid environment- // dependent naming issues with the generated code, we explicitly // use the empty string as spelling. diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 58e6bfbbfc..fcc83caeee 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 8.0.0 +version: 8.0.1 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart index 82fedd077d..9ef50eb4d5 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart @@ -79,3 +79,5 @@ final class UnnamedUnion2 extends ffi.Union { @ffi.Float() external double b; } + +final class Union7 extends ffi.Opaque {} diff --git a/pkgs/ffigen/test/header_parser_tests/unions.h b/pkgs/ffigen/test/header_parser_tests/unions.h index e7d86ffd8a..7f038348f9 100644 --- a/pkgs/ffigen/test/header_parser_tests/unions.h +++ b/pkgs/ffigen/test/header_parser_tests/unions.h @@ -46,6 +46,21 @@ union Union6 }; }; +// Multiple anonymous declarations with incomplete members +union Union7 +{ + union + { + float a; + }; + + union + { + float b; + int c[]; + }; +}; + void func1(union Union2 *s); // Incomplete array parameter will be treated as a pointer. From ede5a9cc3ce6f0385734da06645ca09df6445979 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Fri, 12 May 2023 09:32:41 +0200 Subject: [PATCH 238/276] [ffigen] Set SDK version to 3.0 stable (#573) --- pkgs/ffigen/.github/workflows/test-package.yml | 8 ++++---- pkgs/ffigen/example/c_json/pubspec.yaml | 2 +- pkgs/ffigen/example/ffinative/pubspec.yaml | 2 +- pkgs/ffigen/example/libclang-example/pubspec.yaml | 2 +- pkgs/ffigen/example/objective_c/pubspec.yaml | 2 +- pkgs/ffigen/example/shared_bindings/pubspec.yaml | 2 +- pkgs/ffigen/example/simple/pubspec.yaml | 2 +- pkgs/ffigen/example/swift/pubspec.yaml | 2 +- pkgs/ffigen/pubspec.yaml | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index b739392c13..62003941fe 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: [3.0.0-417.0.dev] # TODO(#554) + sdk: [3.0.0] steps: - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f @@ -44,7 +44,7 @@ jobs: - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: - sdk: 3.0.0-417.0.dev # TODO(#554) + sdk: 3.0.0 - name: Install dependencies run: dart pub get - name: Install libclang-14-dev @@ -61,7 +61,7 @@ jobs: - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: - sdk: 3.0.0-417.0.dev # TODO(#554) + sdk: 3.0.0 - name: Install dependencies run: dart pub get - name: Build test dylib and bindings @@ -83,7 +83,7 @@ jobs: - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: - sdk: 3.0.0-417.0.dev # TODO(#554) + sdk: 3.0.0 - name: Install dependencies run: dart pub get - name: Build test dylib and bindings diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index 8eb2a3729a..3301013586 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -5,7 +5,7 @@ name: c_json_example environment: - sdk: ">=3.0.0-417 <4.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/ffinative/pubspec.yaml b/pkgs/ffigen/example/ffinative/pubspec.yaml index 1d5778838f..ef452f8110 100644 --- a/pkgs/ffigen/example/ffinative/pubspec.yaml +++ b/pkgs/ffigen/example/ffinative/pubspec.yaml @@ -5,7 +5,7 @@ name: ffinative_example environment: - sdk: ">=3.0.0-417 <4.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index d7503f0d6c..9d7e8ab856 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -5,7 +5,7 @@ name: libclang_example environment: - sdk: ">=3.0.0-417 <4.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/objective_c/pubspec.yaml b/pkgs/ffigen/example/objective_c/pubspec.yaml index 5e5c43b59d..4cedaa343c 100644 --- a/pkgs/ffigen/example/objective_c/pubspec.yaml +++ b/pkgs/ffigen/example/objective_c/pubspec.yaml @@ -5,7 +5,7 @@ name: objective_c_example environment: - sdk: ">=3.0.0-417 <4.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/shared_bindings/pubspec.yaml b/pkgs/ffigen/example/shared_bindings/pubspec.yaml index d5a9c389af..2f270f1029 100644 --- a/pkgs/ffigen/example/shared_bindings/pubspec.yaml +++ b/pkgs/ffigen/example/shared_bindings/pubspec.yaml @@ -5,7 +5,7 @@ name: shared_bindings environment: - sdk: ">=3.0.0-417 <4.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: cli_util: ^0.4.0 diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index 29c4a1b5a0..ea4357279b 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -5,7 +5,7 @@ name: simple_example environment: - sdk: ">=3.0.0-417 <4.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/swift/pubspec.yaml b/pkgs/ffigen/example/swift/pubspec.yaml index 31c3aaffb6..07d93ebaf3 100644 --- a/pkgs/ffigen/example/swift/pubspec.yaml +++ b/pkgs/ffigen/example/swift/pubspec.yaml @@ -5,7 +5,7 @@ name: swift_example environment: - sdk: ">=3.0.0-417 <4.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index fcc83caeee..c7e48f151e 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -13,7 +13,7 @@ topics: - codegen environment: - sdk: ">=3.0.0-417 <4.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: ffi: ^2.0.1 From 29739cfd7c6af1f97bec03b24b0917c6efb6c9c4 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 15 May 2023 16:34:11 +0530 Subject: [PATCH 239/276] [ffigen] Fixed invalid code generated due to zero-length arrays in structs/union. (#575) --- pkgs/ffigen/CHANGELOG.md | 4 ++++ .../src/header_parser/type_extractor/extractor.dart | 11 +++++++---- pkgs/ffigen/pubspec.yaml | 2 +- .../test/header_parser_tests/function_n_struct.h | 8 ++++++++ .../header_parser_tests/function_n_struct_test.dart | 4 ++++ 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index b9e9aecb11..7418a01a0b 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 8.0.2 + +- Fixed invalid code generated due to zero-length arrays in structs/union. + # 8.0.1 - Fixed invalid code generated due to anonymous structs/unions with unsupported types. diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index 5b2620b294..c3c8054177 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -118,10 +118,13 @@ Type getCodeGenType( return _extractFromFunctionProto(cxtype, cursor: originalCursor); case clang_types.CXTypeKind .CXType_ConstantArray: // Primarily used for constant array in struct members. - return ConstantArray( - clang.clang_getNumElements(cxtype), - clang.clang_getArrayElementType(cxtype).toCodeGenType(), - ); + final numElements = clang.clang_getNumElements(cxtype); + final elementType = + clang.clang_getArrayElementType(cxtype).toCodeGenType(); + // Handle numElements being 0 as an incomplete array. + return numElements == 0 + ? IncompleteArray(elementType) + : ConstantArray(numElements, elementType); case clang_types.CXTypeKind .CXType_IncompleteArray: // Primarily used for incomplete array in function parameters. return IncompleteArray( diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index c7e48f151e..c8fad030bb 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 8.0.1 +version: 8.0.2 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen diff --git a/pkgs/ffigen/test/header_parser_tests/function_n_struct.h b/pkgs/ffigen/test/header_parser_tests/function_n_struct.h index e428cf38f8..b3c43a72b7 100644 --- a/pkgs/ffigen/test/header_parser_tests/function_n_struct.h +++ b/pkgs/ffigen/test/header_parser_tests/function_n_struct.h @@ -40,6 +40,14 @@ struct Struct6 arr10 a[2]; }; +// All members should be removed, Zero-length arrays are equivalent to +// flexible arrays members (by an extension) are not supported. +struct Struct7 +{ + int a; + int b[0]; // Flexible array member. +}; + void func1(struct Struct2 *s); // Incomplete array parameter will be treated as a pointer. diff --git a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart index b61070c57a..5ddd58afa9 100644 --- a/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart +++ b/pkgs/ffigen/test/header_parser_tests/function_n_struct_test.dart @@ -58,6 +58,9 @@ ${strings.headers}: expect(actual.getBindingAsString('Struct6'), expected.getBindingAsString('Struct6')); }); + test('Struct7 zero length array (extension on flexible array member)', () { + expect((actual.getBinding('Struct7') as Struct).members.isEmpty, true); + }); test('func3 constant typedef array parameter', () { expect(actual.getBindingAsString('func3'), expected.getBindingAsString('func3')); @@ -117,6 +120,7 @@ Library expectedLibrary() { Struct(name: 'Struct6', members: [ Member(name: 'a', type: ConstantArray(2, ConstantArray(10, intType))) ]), + Struct(name: 'Struct7'), ], ); } From cd0d754582f68964cd50ad71d8b1e55fe6245879 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Tue, 16 May 2023 11:14:23 -0700 Subject: [PATCH 240/276] [ffigen] blast_repo fixes (#576) dependabot --- pkgs/ffigen/.github/dependabot.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/ffigen/.github/dependabot.yml b/pkgs/ffigen/.github/dependabot.yml index 1603cdd9ee..725f03af2e 100644 --- a/pkgs/ffigen/.github/dependabot.yml +++ b/pkgs/ffigen/.github/dependabot.yml @@ -3,7 +3,9 @@ version: 2 updates: - - package-ecosystem: "github-actions" - directory: "/" + - package-ecosystem: github-actions + directory: / schedule: - interval: "monthly" + interval: monthly + labels: + - autosubmit From 19c89a3c0c9fac38e58b857009d7e6d9addf3f63 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Wed, 17 May 2023 13:17:42 +0200 Subject: [PATCH 241/276] [ffigen] Rename `master` branch to `main` (#582) --- pkgs/ffigen/.github/workflows/test-package.yml | 4 ++-- pkgs/ffigen/README.md | 2 +- pkgs/ffigen/example/README.md | 10 +++++----- pkgs/ffigen/test/README.md | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 62003941fe..1ca09eb551 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -3,9 +3,9 @@ name: Dart CI on: # Run on PRs and pushes to the default branch. push: - branches: [master, stable] + branches: [main, stable] pull_request: - branches: [master, stable] + branches: [main, stable] schedule: - cron: "0 0 * * 0" diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 674c3471d0..b703655afe 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -1,6 +1,6 @@ [![pub package](https://img.shields.io/pub/v/ffigen.svg)](https://pub.dev/packages/ffigen) [![Build Status](https://github.com/dart-lang/ffigen/workflows/Dart%20CI/badge.svg)](https://github.com/dart-lang/ffigen/actions?query=workflow%3A"Dart+CI") -[![Coverage Status](https://coveralls.io/repos/github/dart-lang/ffigen/badge.svg?branch=master)](https://coveralls.io/github/dart-lang/ffigen?branch=master) +[![Coverage Status](https://coveralls.io/repos/github/dart-lang/ffigen/badge.svg?branch=main)](https://coveralls.io/github/dart-lang/ffigen?branch=main) Binding generator for [FFI](https://dart.dev/guides/libraries/c-interop) bindings. diff --git a/pkgs/ffigen/example/README.md b/pkgs/ffigen/example/README.md index 91a8db8ed4..cb1ce8cd32 100644 --- a/pkgs/ffigen/example/README.md +++ b/pkgs/ffigen/example/README.md @@ -1,7 +1,7 @@ ## Examples -- [Simple](https://github.com/dart-lang/ffigen/tree/master/example/simple) -- [cJSON](https://github.com/dart-lang/ffigen/tree/master/example/c_json) -- [LibClang](https://github.com/dart-lang/ffigen/tree/master/example/libclang-example) -- [ObjectiveC](https://github.com/dart-lang/ffigen/tree/master/example/objective_c) -- [Swift](https://github.com/dart-lang/ffigen/tree/master/example/swift) +- [Simple](https://github.com/dart-lang/ffigen/tree/main/example/simple) +- [cJSON](https://github.com/dart-lang/ffigen/tree/main/example/c_json) +- [LibClang](https://github.com/dart-lang/ffigen/tree/main/example/libclang-example) +- [ObjectiveC](https://github.com/dart-lang/ffigen/tree/main/example/objective_c) +- [Swift](https://github.com/dart-lang/ffigen/tree/main/example/swift) diff --git a/pkgs/ffigen/test/README.md b/pkgs/ffigen/test/README.md index cfcc3141ed..dc57474a2d 100644 --- a/pkgs/ffigen/test/README.md +++ b/pkgs/ffigen/test/README.md @@ -1,5 +1,5 @@ [![Build Status](https://github.com/dart-lang/ffigen/workflows/Dart%20CI/badge.svg)](https://github.com/dart-lang/ffigen/actions?query=workflow%3A"Dart+CI") -[![Coverage Status](https://coveralls.io/repos/github/dart-lang/ffigen/badge.svg?branch=master)](https://coveralls.io/github/dart-lang/ffigen?branch=master) +[![Coverage Status](https://coveralls.io/repos/github/dart-lang/ffigen/badge.svg?branch=main)](https://coveralls.io/github/dart-lang/ffigen?branch=main) # ffigen testing @@ -23,18 +23,18 @@ Some tests verify that the generated Dart FFI bindings match a golden file. For example, the test -[`test/native_test/native_test.dart`](https://github.com/dart-lang/ffigen/blob/master/test/native_test/native_test.dart) +[`test/native_test/native_test.dart`](https://github.com/dart-lang/ffigen/blob/main/test/native_test/native_test.dart) works by: 1. Loading the dynamic library for - [`test/native_test/native_test.c`](https://github.com/dart-lang/ffigen/blob/master/test/native_test/native_test.c) + [`test/native_test/native_test.c`](https://github.com/dart-lang/ffigen/blob/main/test/native_test/native_test.c) (which was generated by `dart run test/setup.dart`). 2. Generating binding files for that dynamic library in the `test/debug_generated` directory. 3. Comparing the golden file (i.e. - [`test/native_test/_expected_native_test_bindings.dart`](https://github.com/dart-lang/ffigen/blob/master/test/native_test/_expected_native_test_bindings.dart)) + [`test/native_test/_expected_native_test_bindings.dart`](https://github.com/dart-lang/ffigen/blob/main/test/native_test/_expected_native_test_bindings.dart)) to the generated file and generating a test failure if they do not match. 4. Using the *golden* bindings to excercise the dynamic library. From 09eeb5369584297db02cd1862bbd41a4d4c88102 Mon Sep 17 00:00:00 2001 From: CicadaCinema <52425971+CicadaCinema@users.noreply.github.com> Date: Tue, 30 May 2023 20:12:04 +0100 Subject: [PATCH 242/276] [ffigen] add LLVM installation instructions for Fedora (#584) --- pkgs/ffigen/README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index b703655afe..38c66e5363 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -63,8 +63,12 @@ Jump to [FAQ](#faq). ## Installing LLVM `package:ffigen` uses LLVM. Install LLVM (9+) in the following way. -#### ubuntu/linux -1. Install libclangdev - `sudo apt-get install libclang-dev`. +#### Linux +1. Install libclangdev. + + With apt-get: `sudo apt-get install libclang-dev`. + + With dnf: `sudo dnf install clang-devel`. #### Windows 1. Install Visual Studio with C++ development support. From 4854160d51ffa431e7c89dfd375df4baf277ea1c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Jul 2023 22:47:32 +0000 Subject: [PATCH 243/276] [ffigen] Bump actions/checkout from 3.5.2 to 3.5.3 (#589) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.2 to 3.5.3.
    Changelog

    Sourced from actions/checkout's changelog.

    Changelog

    v3.5.3

    v3.5.2

    v3.5.1

    v3.5.0

    v3.4.0

    v3.3.0

    v3.2.0

    v3.1.0

    v3.0.2

    v3.0.1

    v3.0.0

    v2.3.1

    ... (truncated)

    Commits

    [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=3.5.2&new-version=3.5.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
    Dependabot commands and options
    You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    --- pkgs/ffigen/.github/workflows/test-package.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 1ca09eb551..07df32f8ad 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -21,7 +21,7 @@ jobs: matrix: sdk: [3.0.0] steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: ${{ matrix.sdk }} @@ -41,7 +41,7 @@ jobs: needs: analyze runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: 3.0.0 @@ -58,7 +58,7 @@ jobs: needs: analyze runs-on: macos-latest steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: 3.0.0 @@ -80,7 +80,7 @@ jobs: needs: analyze runs-on: windows-latest steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: 3.0.0 @@ -105,7 +105,7 @@ jobs: needs: analyze runs-on: windows-latest steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa with: channel: "master" From 34714a4ecf6382c9a55ff47fd9728d46bdc91450 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Jul 2023 22:50:59 +0000 Subject: [PATCH 244/276] [ffigen] Bump coverallsapp/github-action from 2.1.2 to 2.2.0 (#590) Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 2.1.2 to 2.2.0.
    Commits

    [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=coverallsapp/github-action&package-manager=github_actions&previous-version=2.1.2&new-version=2.2.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
    Dependabot commands and options
    You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    --- pkgs/ffigen/.github/workflows/test-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 07df32f8ad..9ee11ac803 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -71,7 +71,7 @@ jobs: - name: Collect coverage run: ./tool/coverage.sh - name: Upload coverage - uses: coverallsapp/github-action@f350da2c033043742f89e8c0b7b5145a1616da6d + uses: coverallsapp/github-action@c7885c00cb7ec0b8f9f5ff3f53cddb980f7a4412 with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: lcov.info From 3a5a9bea1bd000b979f74f8e2d9ed81b83ffb271 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Wed, 12 Jul 2023 12:57:29 +0530 Subject: [PATCH 245/276] [ffigen] Add ffigen yaml schema (#586) --- pkgs/ffigen/CHANGELOG.md | 4 + pkgs/ffigen/example/c_json/config.yaml | 2 + pkgs/ffigen/example/ffinative/config.yaml | 4 +- .../example/libclang-example/config.yaml | 2 + pkgs/ffigen/example/objective_c/config.yaml | 2 + .../shared_bindings/ffigen_configs/a.yaml | 2 + .../ffigen_configs/a_shared_base.yaml | 2 + .../shared_bindings/ffigen_configs/base.yaml | 2 + pkgs/ffigen/example/simple/config.yaml | 2 + pkgs/ffigen/example/swift/config.yaml | 2 + pkgs/ffigen/ffigen.schema.json | 524 ++++++++ .../lib/src/config_provider/config.dart | 1057 +++++++++++------ .../lib/src/config_provider/config_spec.dart | 822 +++++++++++++ .../lib/src/config_provider/config_types.dart | 22 - .../lib/src/config_provider/spec_utils.dart | 778 +----------- .../clang_bindings/clang_bindings.dart | 4 +- pkgs/ffigen/lib/src/strings.dart | 4 + pkgs/ffigen/pubspec.yaml | 5 +- .../test/config_tests/json_schema_test.dart | 89 ++ .../config_tests/unknown_keys_warn_test.dart | 11 - pkgs/ffigen/tool/generate_json_schema.dart | 28 + pkgs/ffigen/tool/libclang_config.yaml | 2 + 22 files changed, 2246 insertions(+), 1124 deletions(-) create mode 100644 pkgs/ffigen/ffigen.schema.json create mode 100644 pkgs/ffigen/lib/src/config_provider/config_spec.dart create mode 100644 pkgs/ffigen/test/config_tests/json_schema_test.dart create mode 100644 pkgs/ffigen/tool/generate_json_schema.dart diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 7418a01a0b..c6919af9c9 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 9.0.0 + +- Added a JSON schema for FFIgen config files. + # 8.0.2 - Fixed invalid code generated due to zero-length arrays in structs/union. diff --git a/pkgs/ffigen/example/c_json/config.yaml b/pkgs/ffigen/example/c_json/config.yaml index 08c5891a54..3d61cbd25f 100644 --- a/pkgs/ffigen/example/c_json/config.yaml +++ b/pkgs/ffigen/example/c_json/config.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=../../ffigen.schema.json + output: 'cjson_generated_bindings.dart' name: 'CJson' description: 'Holds bindings to cJSON.' diff --git a/pkgs/ffigen/example/ffinative/config.yaml b/pkgs/ffigen/example/ffinative/config.yaml index 18aeb3f6dd..397dbba8f7 100644 --- a/pkgs/ffigen/example/ffinative/config.yaml +++ b/pkgs/ffigen/example/ffinative/config.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=../../ffigen.schema.json + name: NativeLibrary ffi-native: # asset: 'assetname' # (optional) @@ -7,4 +9,4 @@ headers: entry-points: - 'headers/example.h' preamble: | - // ignore_for_file: deprecated_member_use \ No newline at end of file + // ignore_for_file: deprecated_member_use diff --git a/pkgs/ffigen/example/libclang-example/config.yaml b/pkgs/ffigen/example/libclang-example/config.yaml index f6517c0899..69c111e766 100644 --- a/pkgs/ffigen/example/libclang-example/config.yaml +++ b/pkgs/ffigen/example/libclang-example/config.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=../../ffigen.schema.json + output: 'generated_bindings.dart' # This will sort the bindings alphabetically. diff --git a/pkgs/ffigen/example/objective_c/config.yaml b/pkgs/ffigen/example/objective_c/config.yaml index 94764ca409..b44cc69069 100644 --- a/pkgs/ffigen/example/objective_c/config.yaml +++ b/pkgs/ffigen/example/objective_c/config.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=../../ffigen.schema.json + name: AVFAudio description: Bindings for AVFAudio. language: objc diff --git a/pkgs/ffigen/example/shared_bindings/ffigen_configs/a.yaml b/pkgs/ffigen/example/shared_bindings/ffigen_configs/a.yaml index 55a720e0a1..a23faa18b2 100644 --- a/pkgs/ffigen/example/shared_bindings/ffigen_configs/a.yaml +++ b/pkgs/ffigen/example/shared_bindings/ffigen_configs/a.yaml @@ -2,6 +2,8 @@ # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. +# yaml-language-server: $schema=../../../ffigen.schema.json + name: NativeLibraryA description: Bindings to `headers/a.h`. output: '../lib/generated/a_gen.dart' diff --git a/pkgs/ffigen/example/shared_bindings/ffigen_configs/a_shared_base.yaml b/pkgs/ffigen/example/shared_bindings/ffigen_configs/a_shared_base.yaml index 0adcc204df..aa4f1b10a1 100644 --- a/pkgs/ffigen/example/shared_bindings/ffigen_configs/a_shared_base.yaml +++ b/pkgs/ffigen/example/shared_bindings/ffigen_configs/a_shared_base.yaml @@ -2,6 +2,8 @@ # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. +# yaml-language-server: $schema=../../../ffigen.schema.json + name: NativeLibraryASharedB description: Bindings to `headers/a.h` with shared definitions from `headers/base.h`. output: '../lib/generated/a_shared_b_gen.dart' diff --git a/pkgs/ffigen/example/shared_bindings/ffigen_configs/base.yaml b/pkgs/ffigen/example/shared_bindings/ffigen_configs/base.yaml index 474d0f9f45..da03542dfa 100644 --- a/pkgs/ffigen/example/shared_bindings/ffigen_configs/base.yaml +++ b/pkgs/ffigen/example/shared_bindings/ffigen_configs/base.yaml @@ -2,6 +2,8 @@ # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. +# yaml-language-server: $schema=../../../ffigen.schema.json + name: NativeLibraryBase description: Bindings to `headers/base.h`. output: diff --git a/pkgs/ffigen/example/simple/config.yaml b/pkgs/ffigen/example/simple/config.yaml index 82ed925195..f12c34931d 100644 --- a/pkgs/ffigen/example/simple/config.yaml +++ b/pkgs/ffigen/example/simple/config.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=../../ffigen.schema.json + name: NativeLibrary description: Bindings to `headers/example.h`. output: 'generated_bindings.dart' diff --git a/pkgs/ffigen/example/swift/config.yaml b/pkgs/ffigen/example/swift/config.yaml index e1a83225a3..6082e97891 100644 --- a/pkgs/ffigen/example/swift/config.yaml +++ b/pkgs/ffigen/example/swift/config.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=../../ffigen.schema.json + name: SwiftLibrary description: Bindings for swift_api. language: objc diff --git a/pkgs/ffigen/ffigen.schema.json b/pkgs/ffigen/ffigen.schema.json new file mode 100644 index 0000000000..a557a87cde --- /dev/null +++ b/pkgs/ffigen/ffigen.schema.json @@ -0,0 +1,524 @@ +{ + "$id": "https://json.schemastore.org/ffigen", + "$comment": "This file is generated. To regenerate run: dart tool/generate_json_schema.dart in github.com/dart-lang/ffigen", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "properties": { + "llvm-path": { + "type": "array", + "items": { + "type": "string" + } + }, + "output": { + "$oneOf": [ + { + "$ref": "#/$defs/filePath" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "bindings": { + "$ref": "#/$defs/filePath" + }, + "symbol-file": { + "type": "object", + "additionalProperties": false, + "properties": { + "output": { + "$ref": "#/$defs/filePath" + }, + "import-path": { + "type": "string" + } + }, + "required": [ + "output", + "import-path" + ] + } + }, + "required": [ + "bindings" + ] + } + ] + }, + "language": { + "enum": [ + "c", + "objc" + ] + }, + "headers": { + "type": "object", + "additionalProperties": false, + "properties": { + "entry-points": { + "type": "array", + "items": { + "type": "string" + } + }, + "include-directives": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "entry-points" + ] + }, + "compiler-opts": { + "$oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "compiler-opts-automatic": { + "type": "object", + "additionalProperties": false, + "properties": { + "macos": { + "type": "object", + "additionalProperties": false, + "properties": { + "include-c-standard-library": { + "type": "boolean" + } + } + } + } + }, + "library-imports": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "functions": { + "type": "object", + "additionalProperties": false, + "properties": { + "include": { + "$ref": "#/$defs/fullMatchOrRegexpList" + }, + "exclude": { + "$ref": "#/$defs/fullMatchOrRegexpList" + }, + "rename": { + "$ref": "#/$defs/rename" + }, + "member-rename": { + "$ref": "#/$defs/memberRename" + }, + "symbol-address": { + "$ref": "#/$defs/includeExclude" + }, + "expose-typedefs": { + "$ref": "#/$defs/includeExclude" + }, + "leaf": { + "$ref": "#/$defs/includeExclude" + }, + "variadic-arguments": { + "type": "object", + "patternProperties": { + ".*": { + "type": "array", + "items": { + "$oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "types": { + "type": "array", + "items": { + "type": "string" + } + }, + "postfix": { + "type": "string" + } + }, + "required": [ + "types" + ] + } + ] + } + } + } + } + } + }, + "structs": { + "type": "object", + "additionalProperties": false, + "properties": { + "include": { + "$ref": "#/$defs/fullMatchOrRegexpList" + }, + "exclude": { + "$ref": "#/$defs/fullMatchOrRegexpList" + }, + "rename": { + "$ref": "#/$defs/rename" + }, + "member-rename": { + "$ref": "#/$defs/memberRename" + }, + "dependency-only": { + "$ref": "#/$defs/dependencyOnly" + }, + "pack": { + "type": "object", + "patternProperties": { + ".*": { + "enum": [ + "none", + 1, + 2, + 4, + 8, + 16 + ] + } + } + } + } + }, + "unions": { + "type": "object", + "additionalProperties": false, + "properties": { + "include": { + "$ref": "#/$defs/fullMatchOrRegexpList" + }, + "exclude": { + "$ref": "#/$defs/fullMatchOrRegexpList" + }, + "rename": { + "$ref": "#/$defs/rename" + }, + "member-rename": { + "$ref": "#/$defs/memberRename" + }, + "dependency-only": { + "$ref": "#/$defs/dependencyOnly" + } + } + }, + "enums": { + "type": "object", + "additionalProperties": false, + "properties": { + "include": { + "$ref": "#/$defs/fullMatchOrRegexpList" + }, + "exclude": { + "$ref": "#/$defs/fullMatchOrRegexpList" + }, + "rename": { + "$ref": "#/$defs/rename" + }, + "member-rename": { + "$ref": "#/$defs/memberRename" + } + } + }, + "unnamed-enums": { + "type": "object", + "additionalProperties": false, + "properties": { + "include": { + "$ref": "#/$defs/fullMatchOrRegexpList" + }, + "exclude": { + "$ref": "#/$defs/fullMatchOrRegexpList" + }, + "rename": { + "$ref": "#/$defs/rename" + } + } + }, + "globals": { + "type": "object", + "additionalProperties": false, + "properties": { + "include": { + "$ref": "#/$defs/fullMatchOrRegexpList" + }, + "exclude": { + "$ref": "#/$defs/fullMatchOrRegexpList" + }, + "rename": { + "$ref": "#/$defs/rename" + }, + "symbol-address": { + "$ref": "#/$defs/includeExclude" + } + } + }, + "macros": { + "type": "object", + "additionalProperties": false, + "properties": { + "include": { + "$ref": "#/$defs/fullMatchOrRegexpList" + }, + "exclude": { + "$ref": "#/$defs/fullMatchOrRegexpList" + }, + "rename": { + "$ref": "#/$defs/rename" + } + } + }, + "typedefs": { + "type": "object", + "additionalProperties": false, + "properties": { + "include": { + "$ref": "#/$defs/fullMatchOrRegexpList" + }, + "exclude": { + "$ref": "#/$defs/fullMatchOrRegexpList" + }, + "rename": { + "$ref": "#/$defs/rename" + } + } + }, + "objc-interfaces": { + "type": "object", + "additionalProperties": false, + "properties": { + "include": { + "$ref": "#/$defs/fullMatchOrRegexpList" + }, + "exclude": { + "$ref": "#/$defs/fullMatchOrRegexpList" + }, + "rename": { + "$ref": "#/$defs/rename" + }, + "member-rename": { + "$ref": "#/$defs/memberRename" + }, + "module": { + "$ref": "#/$defs/objcInterfaceModule" + } + } + }, + "import": { + "type": "object", + "additionalProperties": false, + "properties": { + "symbol-files": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "type-map": { + "type": "object", + "additionalProperties": false, + "properties": { + "typedefs": { + "$ref": "#/$defs/mappedTypes" + }, + "structs": { + "$ref": "#/$defs/mappedTypes" + }, + "unions": { + "$ref": "#/$defs/mappedTypes" + }, + "native-types": { + "$ref": "#/$defs/mappedTypes" + } + } + }, + "exclude-all-by-default": { + "type": "boolean" + }, + "sort": { + "type": "boolean" + }, + "use-supported-typedefs": { + "type": "boolean" + }, + "comments": { + "$oneOf": [ + { + "type": "boolean" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "style": { + "enum": [ + "doxygen", + "any" + ] + }, + "length": { + "enum": [ + "brief", + "full" + ] + } + } + } + ] + }, + "name": { + "$ref": "#/$defs/publicDartClass" + }, + "description": { + "$ref": "#/$defs/nonEmptyString" + }, + "preamble": { + "type": "string" + }, + "use-dart-handle": { + "type": "boolean" + }, + "ffi-native": { + "$oneOf": [ + { + "enum": [ + null + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "asset": { + "type": "string" + } + }, + "required": [ + "asset" + ] + } + ] + } + }, + "required": [ + "output", + "headers" + ], + "$defs": { + "filePath": { + "type": "string", + "description": "A file path" + }, + "fullMatchOrRegexpList": { + "type": "array", + "items": { + "type": "string" + } + }, + "rename": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "memberRename": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + } + }, + "includeExclude": { + "type": "object", + "additionalProperties": false, + "properties": { + "include": { + "$ref": "#/$defs/fullMatchOrRegexpList" + }, + "exclude": { + "$ref": "#/$defs/fullMatchOrRegexpList" + } + } + }, + "dependencyOnly": { + "enum": [ + "full", + "opaque" + ] + }, + "objcInterfaceModule": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "mappedTypes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": false, + "properties": { + "lib": { + "type": "string" + }, + "c-type": { + "type": "string" + }, + "dart-type": { + "type": "string" + } + } + } + } + }, + "publicDartClass": { + "type": "string", + "description": "A public dart class name.", + "pattern": "^[a-zA-Z]+[_a-zA-Z0-9]*$" + }, + "nonEmptyString": { + "type": "string", + "pattern": ".+" + } + } +} \ No newline at end of file diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart index 12a7e69f7f..5109a0c80e 100644 --- a/pkgs/ffigen/lib/src/config_provider/config.dart +++ b/pkgs/ffigen/lib/src/config_provider/config.dart @@ -12,6 +12,7 @@ import 'package:package_config/package_config_types.dart'; import 'package:yaml/yaml.dart'; import '../strings.dart' as strings; +import 'config_spec.dart'; import 'config_types.dart'; import 'spec_utils.dart'; @@ -22,12 +23,10 @@ final _logger = Logger('ffigen.config_provider.config'); /// Handles validation, extraction of configurations from a yaml file. class Config { /// Input filename. - String? get filename => _filename; - String? _filename; + final String? filename; /// Package config. - PackageConfig? get packageConfig => _packageConfig; - PackageConfig? _packageConfig; + final PackageConfig? packageConfig; /// Location for llvm/lib folder. String get libclangDylib => _libclangDylib; @@ -176,23 +175,22 @@ class Config { FfiNativeConfig get ffiNativeConfig => _ffiNativeConfig; late FfiNativeConfig _ffiNativeConfig; - Config._(this._filename, this._packageConfig); + Config._({required this.filename, required this.packageConfig}); /// Create config from Yaml map. factory Config.fromYaml(YamlMap map, {String? filename, PackageConfig? packageConfig}) { - final configspecs = Config._(filename, packageConfig); + final config = Config._(filename: filename, packageConfig: packageConfig); _logger.finest('Config Map: $map'); - final specs = configspecs._getSpecs(); - - final result = configspecs._checkConfigs(map, specs); + final ffigenConfigSpec = config._getRootConfigSpec(); + final result = ffigenConfigSpec.validate(map); if (!result) { throw FormatException('Invalid configurations provided.'); } - configspecs._extract(map, specs); - return configspecs; + ffigenConfigSpec.extract(map); + return config; } /// Create config from a file. @@ -204,6 +202,12 @@ class Config { filename: file.path, packageConfig: packageConfig); } + /// Returns the root ConfigSpec object. + static ConfigSpec getsRootConfigSpec() { + final configspecs = Config._(filename: null, packageConfig: null); + return configspecs._getRootConfigSpec(); + } + /// Add compiler options for clang. If [highPriority] is true these are added /// to the front of the list. void addCompilerOpts(String compilerOpts, {bool highPriority = false}) { @@ -215,363 +219,698 @@ class Config { } } - /// Validates Yaml according to given specs. - bool _checkConfigs(YamlMap map, Map, Specification> specs) { - var result = true; - for (final key in specs.keys) { - final spec = specs[key]; - if (checkKeyInYaml(key, map)) { - result = result && spec!.validator(key, getKeyValueFromYaml(key, map)); - } else if (spec!.requirement == Requirement.yes) { - _logger.severe("Key '$key' is required."); - result = false; - } else if (spec.requirement == Requirement.prefer) { - _logger.warning("Prefer adding Key '$key' to your config."); - } + ConfigSpec _getRootConfigSpec() { + return HeterogeneousMapConfigSpec( + entries: [ + HeterogeneousMapEntry( + key: strings.llvmPath, + valueConfigSpec: ListConfigSpec( + childConfigSpec: StringConfigSpec(), + transform: (node) => llvmPathExtractor(node.value), + ), + defaultValue: (node) => findDylibAtDefaultLocations(), + resultOrDefault: (node) => _libclangDylib = node.value as String, + ), + HeterogeneousMapEntry( + key: strings.output, + required: true, + valueConfigSpec: OneOfConfigSpec( + childConfigSpecs: [ + _filePathStringConfigSpec(), + _outputFullConfigSpec(), + ], + transform: (node) => + outputExtractor(node.value, filename, packageConfig), + result: (node) { + _output = (node.value as OutputConfig).output; + _symbolFile = (node.value as OutputConfig).symbolFile; + }, + )), + HeterogeneousMapEntry( + key: strings.language, + valueConfigSpec: EnumConfigSpec( + allowedValues: {strings.langC, strings.langObjC}, + transform: (node) { + if ((node.value == strings.langObjC)) { + _logger.severe( + 'Objective C support is EXPERIMENTAL. The API may change ' + 'in a breaking way without notice.'); + return Language.objc; + } else { + return Language.c; + } + }, + ), + defaultValue: (node) => Language.c, + resultOrDefault: (node) => _language = node.value as Language, + ), + HeterogeneousMapEntry( + key: strings.headers, + required: true, + valueConfigSpec: HeterogeneousMapConfigSpec, Headers>( + entries: [ + HeterogeneousMapEntry( + key: strings.entryPoints, + valueConfigSpec: ListConfigSpec>( + childConfigSpec: StringConfigSpec()), + required: true, + ), + HeterogeneousMapEntry( + key: strings.includeDirectives, + valueConfigSpec: ListConfigSpec>( + childConfigSpec: StringConfigSpec()), + ), + ], + transform: (node) => headersExtractor(node.value, filename), + result: (node) => _headers = node.value, + )), + HeterogeneousMapEntry( + key: strings.compilerOpts, + valueConfigSpec: OneOfConfigSpec, List>( + childConfigSpecs: [ + StringConfigSpec( + transform: (node) => [node.value], + ), + ListConfigSpec>( + childConfigSpec: StringConfigSpec()) + ], + transform: (node) => compilerOptsExtractor(node.value), + ), + defaultValue: (node) => [], + resultOrDefault: (node) => _compilerOpts = node.value as List, + ), + HeterogeneousMapEntry( + key: strings.compilerOptsAuto, + valueConfigSpec: HeterogeneousMapConfigSpec( + entries: [ + HeterogeneousMapEntry( + key: strings.macos, + valueConfigSpec: HeterogeneousMapConfigSpec( + entries: [ + HeterogeneousMapEntry( + key: strings.includeCStdLib, + valueConfigSpec: BoolConfigSpec(), + defaultValue: (node) => true, + ) + ], + ), + ) + ], + transform: (node) => CompilerOptsAuto( + macIncludeStdLib: ((node.value)[strings.macos] + as Map?)?[strings.includeCStdLib] as bool, + ), + result: (node) => _compilerOpts.addAll( + (node.value as CompilerOptsAuto).extractCompilerOpts()), + )), + HeterogeneousMapEntry( + key: strings.libraryImports, + valueConfigSpec: MapConfigSpec>( + keyValueConfigSpecs: [ + (keyRegexp: ".*", valueConfigSpec: StringConfigSpec()), + ], + customValidation: _libraryImportsPredefinedValidation, + transform: (node) => libraryImportsExtractor(node.value.cast()), + ), + defaultValue: (node) => {}, + resultOrDefault: (node) => + _libraryImports = (node.value) as Map, + ), + HeterogeneousMapEntry( + key: strings.functions, + valueConfigSpec: HeterogeneousMapConfigSpec( + entries: [ + ..._includeExcludeProperties(), + ..._renameProperties(), + ..._memberRenameProperties(), + HeterogeneousMapEntry( + key: strings.symbolAddress, + valueConfigSpec: _includeExcludeObject(), + defaultValue: (node) => Includer.excludeByDefault(), + ), + HeterogeneousMapEntry( + key: strings.exposeFunctionTypedefs, + valueConfigSpec: _includeExcludeObject(), + defaultValue: (node) => Includer.excludeByDefault(), + ), + HeterogeneousMapEntry( + key: strings.leafFunctions, + valueConfigSpec: _includeExcludeObject(), + defaultValue: (node) => Includer.excludeByDefault(), + ), + HeterogeneousMapEntry( + key: strings.varArgFunctions, + valueConfigSpec: _functionVarArgsConfigSpec(), + defaultValue: (node) => >{}, + resultOrDefault: (node) { + _varArgFunctions = makeVarArgFunctionsMapping( + node.value as Map>, + _libraryImports); + }, + ), + ], + result: (node) { + _functionDecl = declarationConfigExtractor( + node.value as Map); + _exposeFunctionTypedefs = (node.value + as Map)[strings.exposeFunctionTypedefs] as Includer; + _leafFunctions = + (node.value as Map)[strings.leafFunctions] as Includer; + }, + )), + HeterogeneousMapEntry( + key: strings.structs, + valueConfigSpec: HeterogeneousMapConfigSpec( + entries: [ + ..._includeExcludeProperties(), + ..._renameProperties(), + ..._memberRenameProperties(), + _dependencyOnlyHeterogeneousMapKey(), + HeterogeneousMapEntry( + key: strings.structPack, + valueConfigSpec: MapConfigSpec( + keyValueConfigSpecs: [ + ( + keyRegexp: '.*', + valueConfigSpec: EnumConfigSpec( + allowedValues: {'none', 1, 2, 4, 8, 16}, + transform: (node) => + node.value == 'none' ? null : node.value, + ), + ) + ], + transform: (node) => + structPackingOverrideExtractor(node.value), + ), + defaultValue: (node) => StructPackingOverride(), + resultOrDefault: (node) => _structPackingOverride = + node.value as StructPackingOverride, + ), + ], + result: (node) { + _structDecl = declarationConfigExtractor( + node.value as Map); + _structDependencies = (node.value + as Map)[strings.dependencyOnly] as CompoundDependencies; + }, + )), + HeterogeneousMapEntry( + key: strings.unions, + valueConfigSpec: HeterogeneousMapConfigSpec( + entries: [ + ..._includeExcludeProperties(), + ..._renameProperties(), + ..._memberRenameProperties(), + _dependencyOnlyHeterogeneousMapKey(), + ], + result: (node) { + _unionDecl = declarationConfigExtractor( + node.value as Map); + _unionDependencies = (node.value as Map)[strings.dependencyOnly] + as CompoundDependencies; + }, + )), + HeterogeneousMapEntry( + key: strings.enums, + valueConfigSpec: HeterogeneousMapConfigSpec( + entries: [ + ..._includeExcludeProperties(), + ..._renameProperties(), + ..._memberRenameProperties(), + ], + result: (node) { + _enumClassDecl = declarationConfigExtractor( + node.value as Map); + }, + )), + HeterogeneousMapEntry( + key: strings.unnamedEnums, + valueConfigSpec: HeterogeneousMapConfigSpec( + entries: [ + ..._includeExcludeProperties(), + ..._renameProperties(), + ], + result: (node) { + _unnamedEnumConstants = declarationConfigExtractor( + node.value as Map); + }, + )), + HeterogeneousMapEntry( + key: strings.globals, + valueConfigSpec: HeterogeneousMapConfigSpec( + entries: [ + ..._includeExcludeProperties(), + ..._renameProperties(), + HeterogeneousMapEntry( + key: strings.symbolAddress, + valueConfigSpec: _includeExcludeObject(), + defaultValue: (node) => Includer.excludeByDefault(), + ) + ], + result: (node) { + _globals = declarationConfigExtractor( + node.value as Map); + }, + )), + HeterogeneousMapEntry( + key: strings.macros, + valueConfigSpec: HeterogeneousMapConfigSpec( + entries: [ + ..._includeExcludeProperties(), + ..._renameProperties(), + ], + result: (node) { + _macroDecl = declarationConfigExtractor( + node.value as Map); + }, + )), + HeterogeneousMapEntry( + key: strings.typedefs, + valueConfigSpec: HeterogeneousMapConfigSpec( + entries: [ + ..._includeExcludeProperties(), + ..._renameProperties(), + ], + result: (node) { + _typedefs = declarationConfigExtractor( + node.value as Map); + }, + )), + HeterogeneousMapEntry( + key: strings.objcInterfaces, + valueConfigSpec: HeterogeneousMapConfigSpec( + entries: [ + ..._includeExcludeProperties(), + ..._renameProperties(), + ..._memberRenameProperties(), + HeterogeneousMapEntry( + key: strings.objcModule, + valueConfigSpec: _objcInterfaceModuleObject(), + defaultValue: (node) => ObjCModulePrefixer({}), + ) + ], + result: (node) { + _objcInterfaces = declarationConfigExtractor( + node.value as Map); + _objcModulePrefixer = (node.value as Map)[strings.objcModule] + as ObjCModulePrefixer; + }, + )), + HeterogeneousMapEntry( + key: strings.import, + valueConfigSpec: HeterogeneousMapConfigSpec( + entries: [ + HeterogeneousMapEntry( + key: strings.symbolFilesImport, + valueConfigSpec: + ListConfigSpec>( + childConfigSpec: StringConfigSpec(), + transform: (node) => symbolFileImportExtractor( + node.value, _libraryImports, filename, packageConfig), + ), + defaultValue: (node) => {}, + resultOrDefault: (node) => _usrTypeMappings = + node.value as Map, + ) + ], + )), + HeterogeneousMapEntry( + key: strings.typeMap, + valueConfigSpec: HeterogeneousMapConfigSpec( + entries: [ + HeterogeneousMapEntry( + key: strings.typeMapTypedefs, + valueConfigSpec: _mappedTypeObject(), + defaultValue: (node) => >{}, + ), + HeterogeneousMapEntry( + key: strings.typeMapStructs, + valueConfigSpec: _mappedTypeObject(), + defaultValue: (node) => >{}, + ), + HeterogeneousMapEntry( + key: strings.typeMapUnions, + valueConfigSpec: _mappedTypeObject(), + defaultValue: (node) => >{}, + ), + HeterogeneousMapEntry( + key: strings.typeMapNativeTypes, + valueConfigSpec: _mappedTypeObject(), + defaultValue: (node) => >{}, + ), + ], + result: (node) { + final nodeValue = node.value as Map; + _typedefTypeMappings = makeImportTypeMapping( + (nodeValue[strings.typeMapTypedefs]) + as Map>, + _libraryImports, + ); + _structTypeMappings = makeImportTypeMapping( + (nodeValue[strings.typeMapStructs]) + as Map>, + _libraryImports, + ); + _unionTypeMappings = makeImportTypeMapping( + (nodeValue[strings.typeMapUnions]) + as Map>, + _libraryImports, + ); + _nativeTypeMappings = makeImportTypeMapping( + (nodeValue[strings.typeMapNativeTypes]) + as Map>, + _libraryImports, + ); + }, + )), + HeterogeneousMapEntry( + key: strings.excludeAllByDefault, + valueConfigSpec: BoolConfigSpec(), + defaultValue: (node) => false, + resultOrDefault: (node) => _excludeAllByDefault = node.value as bool, + ), + HeterogeneousMapEntry( + key: strings.sort, + valueConfigSpec: BoolConfigSpec(), + defaultValue: (node) => false, + resultOrDefault: (node) => _sort = node.value as bool, + ), + HeterogeneousMapEntry( + key: strings.useSupportedTypedefs, + valueConfigSpec: BoolConfigSpec(), + defaultValue: (node) => true, + resultOrDefault: (node) => _useSupportedTypedefs = node.value as bool, + ), + HeterogeneousMapEntry( + key: strings.comments, + valueConfigSpec: _commentConfigSpec(), + defaultValue: (node) => CommentType.def(), + resultOrDefault: (node) => _commentType = node.value as CommentType, + ), + HeterogeneousMapEntry( + key: strings.name, + valueConfigSpec: _dartClassNameStringConfigSpec(), + defaultValue: (node) { + _logger.warning( + "Prefer adding Key '${node.pathString}' to your config."); + return 'NativeLibrary'; + }, + resultOrDefault: (node) => _wrapperName = node.value as String, + ), + HeterogeneousMapEntry( + key: strings.description, + valueConfigSpec: _nonEmptyStringConfigSpec(), + defaultValue: (node) { + _logger.warning( + "Prefer adding Key '${node.pathString}' to your config."); + return null; + }, + resultOrDefault: (node) => _wrapperDocComment = node.value as String?, + ), + HeterogeneousMapEntry( + key: strings.preamble, + valueConfigSpec: StringConfigSpec( + result: (node) => _preamble = node.value as String?, + )), + HeterogeneousMapEntry( + key: strings.useDartHandle, + valueConfigSpec: BoolConfigSpec(), + defaultValue: (node) => true, + resultOrDefault: (node) => _useDartHandle = node.value as bool, + ), + HeterogeneousMapEntry( + key: strings.ffiNative, + valueConfigSpec: OneOfConfigSpec( + childConfigSpecs: [ + EnumConfigSpec(allowedValues: {null}), + HeterogeneousMapConfigSpec( + entries: [ + HeterogeneousMapEntry( + key: strings.ffiNativeAsset, + valueConfigSpec: StringConfigSpec(), + required: true, + ) + ], + ) + ], + transform: (node) => ffiNativeExtractor(node.value), + ), + defaultValue: (node) => FfiNativeConfig(enabled: false), + resultOrDefault: (node) => + _ffiNativeConfig = (node.value) as FfiNativeConfig, + ), + ], + ); + } + + bool _libraryImportsPredefinedValidation(ConfigValue node) { + if (node.value is YamlMap) { + return (node.value as YamlMap).keys.where((key) { + if (strings.predefinedLibraryImports.containsKey(key)) { + _logger.severe( + '${node.pathString} -> $key should not collide with any predefined imports - ${strings.predefinedLibraryImports.keys}.'); + return true; + } + return false; + }).isEmpty; } - // Warn about unknown keys. - warnUnknownKeys(specs.keys.toList(), map); + return true; + } - return result; + OneOfConfigSpec _commentConfigSpec() { + return OneOfConfigSpec( + childConfigSpecs: [ + BoolConfigSpec( + transform: (node) => + (node.value == true) ? CommentType.def() : CommentType.none(), + ), + HeterogeneousMapConfigSpec( + entries: [ + HeterogeneousMapEntry( + key: strings.style, + valueConfigSpec: EnumConfigSpec( + allowedValues: {strings.doxygen, strings.any}, + transform: (node) => node.value == strings.doxygen + ? CommentStyle.doxygen + : CommentStyle.any, + ), + defaultValue: (node) => CommentStyle.doxygen, + ), + HeterogeneousMapEntry( + key: strings.length, + valueConfigSpec: EnumConfigSpec( + allowedValues: {strings.brief, strings.full}, + transform: (node) => node.value == strings.brief + ? CommentLength.brief + : CommentLength.full, + ), + defaultValue: (node) => CommentLength.full, + ), + ], + transform: (node) => CommentType( + (node.value)[strings.style] as CommentStyle, + (node.value)[strings.length] as CommentLength, + ), + ), + ], + ); } - /// Extracts variables from Yaml according to given specs. - /// - /// Validation must be done beforehand, using [_checkConfigs]. - void _extract(YamlMap map, Map, Specification> specs) { - for (final key in specs.keys) { - final spec = specs[key]; - if (checkKeyInYaml(key, map)) { - spec!.extractedResult(spec.extractor(getKeyValueFromYaml(key, map))); - } else { - spec!.extractedResult(spec.defaultValue?.call()); - } - } + MapConfigSpec _functionVarArgsConfigSpec() { + return MapConfigSpec( + keyValueConfigSpecs: [ + ( + keyRegexp: ".*", + valueConfigSpec: ListConfigSpec( + childConfigSpec: OneOfConfigSpec( + childConfigSpecs: [ + ListConfigSpec(childConfigSpec: StringConfigSpec()), + HeterogeneousMapConfigSpec( + entries: [ + HeterogeneousMapEntry( + key: strings.types, + valueConfigSpec: ListConfigSpec>( + childConfigSpec: StringConfigSpec()), + required: true, + ), + HeterogeneousMapEntry( + key: strings.postfix, + valueConfigSpec: StringConfigSpec(), + ), + ], + ) + ], + ), + ) + ) + ], + transform: (node) => varArgFunctionConfigExtractor(node.value), + ); } - /// Returns map of various specifications avaialble for our tool. - /// - /// Key: Name, Value: [Specification] - Map, Specification> _getSpecs() { - return , Specification>{ - [strings.llvmPath]: Specification( - requirement: Requirement.no, - validator: llvmPathValidator, - extractor: llvmPathExtractor, - defaultValue: () => findDylibAtDefaultLocations(), - extractedResult: (dynamic result) { - _libclangDylib = result as String; - }, - ), - [strings.output]: Specification( - requirement: Requirement.yes, - validator: outputValidator, - extractor: (dynamic value) => - outputExtractor(value, filename, packageConfig), - extractedResult: (dynamic result) { - _output = (result as OutputConfig).output; - _symbolFile = result.symbolFile; - }, - ), - [strings.language]: Specification( - requirement: Requirement.no, - validator: languageValidator, - extractor: languageExtractor, - defaultValue: () => Language.c, - extractedResult: (dynamic result) => _language = result as Language, - ), - [strings.headers]: Specification( - requirement: Requirement.yes, - validator: headersValidator, - extractor: (dynamic value) => headersExtractor(value, filename), - extractedResult: (dynamic result) => _headers = result as Headers, - ), - [strings.compilerOpts]: Specification>( - requirement: Requirement.no, - validator: compilerOptsValidator, - extractor: compilerOptsExtractor, - defaultValue: () => [], - extractedResult: (dynamic result) => - _compilerOpts = result as List, - ), - [strings.compilerOptsAuto]: Specification( - requirement: Requirement.no, - validator: compilerOptsAutoValidator, - extractor: compilerOptsAutoExtractor, - defaultValue: () => CompilerOptsAuto(), - extractedResult: (dynamic result) { - _compilerOpts - .addAll((result as CompilerOptsAuto).extractCompilerOpts()); - }), - [strings.functions]: Specification( - requirement: Requirement.no, - validator: declarationConfigValidator, - extractor: declarationConfigExtractor, - defaultValue: () => Declaration(), - extractedResult: (dynamic result) { - _functionDecl = result as Declaration; - }, - ), - [strings.structs]: Specification( - requirement: Requirement.no, - validator: declarationConfigValidator, - extractor: declarationConfigExtractor, - defaultValue: () => Declaration(), - extractedResult: (dynamic result) { - _structDecl = result as Declaration; - }, - ), - [strings.unions]: Specification( - requirement: Requirement.no, - validator: declarationConfigValidator, - extractor: declarationConfigExtractor, - defaultValue: () => Declaration(), - extractedResult: (dynamic result) { - _unionDecl = result as Declaration; - }, - ), - [strings.enums]: Specification( - requirement: Requirement.no, - validator: declarationConfigValidator, - extractor: declarationConfigExtractor, - defaultValue: () => Declaration(), - extractedResult: (dynamic result) { - _enumClassDecl = result as Declaration; - }, - ), - [strings.unnamedEnums]: Specification( - requirement: Requirement.no, - validator: declarationConfigValidator, - extractor: declarationConfigExtractor, - defaultValue: () => Declaration(), - extractedResult: (dynamic result) => - _unnamedEnumConstants = result as Declaration, - ), - [strings.globals]: Specification( - requirement: Requirement.no, - validator: declarationConfigValidator, - extractor: declarationConfigExtractor, - defaultValue: () => Declaration(), - extractedResult: (dynamic result) { - _globals = result as Declaration; - }, - ), - [strings.macros]: Specification( - requirement: Requirement.no, - validator: declarationConfigValidator, - extractor: declarationConfigExtractor, - defaultValue: () => Declaration(), - extractedResult: (dynamic result) { - _macroDecl = result as Declaration; - }, - ), - [strings.typedefs]: Specification( - requirement: Requirement.no, - validator: declarationConfigValidator, - extractor: declarationConfigExtractor, - defaultValue: () => Declaration(), - extractedResult: (dynamic result) { - _typedefs = result as Declaration; - }, - ), - [strings.objcInterfaces]: Specification( - requirement: Requirement.no, - validator: declarationConfigValidator, - extractor: declarationConfigExtractor, - defaultValue: () => Declaration(), - extractedResult: (dynamic result) { - _objcInterfaces = result as Declaration; - }, - ), - [strings.objcInterfaces, strings.objcModule]: - Specification>( - requirement: Requirement.no, - validator: stringStringMapValidator, - extractor: stringStringMapExtractor, - defaultValue: () => {}, - extractedResult: (dynamic result) => _objcModulePrefixer = - ObjCModulePrefixer(result as Map), - ), - [strings.libraryImports]: Specification>( - validator: libraryImportsValidator, - extractor: libraryImportsExtractor, - defaultValue: () => {}, - extractedResult: (dynamic result) { - _libraryImports = result as Map; - }, - ), - [strings.import, strings.symbolFilesImport]: - Specification>( - validator: symbolFileImportValidator, - extractor: (value) => symbolFileImportExtractor( - value, _libraryImports, filename, packageConfig), - defaultValue: () => {}, - extractedResult: (dynamic result) { - _usrTypeMappings = result as Map; - }, - ), - [strings.typeMap, strings.typeMapTypedefs]: - Specification>>( - validator: typeMapValidator, - extractor: typeMapExtractor, - defaultValue: () => >{}, - extractedResult: (dynamic result) { - _typedefTypeMappings = makeImportTypeMapping( - result as Map>, _libraryImports); - }, - ), - [strings.typeMap, strings.typeMapStructs]: - Specification>>( - validator: typeMapValidator, - extractor: typeMapExtractor, - defaultValue: () => >{}, - extractedResult: (dynamic result) { - _structTypeMappings = makeImportTypeMapping( - result as Map>, _libraryImports); - }, + HeterogeneousMapConfigSpec _outputFullConfigSpec() { + return HeterogeneousMapConfigSpec( + entries: [ + HeterogeneousMapEntry( + key: strings.bindings, + valueConfigSpec: _filePathStringConfigSpec(), + required: true, + ), + HeterogeneousMapEntry( + key: strings.symbolFile, + valueConfigSpec: HeterogeneousMapConfigSpec( + entries: [ + HeterogeneousMapEntry( + key: strings.output, + valueConfigSpec: _filePathStringConfigSpec(), + required: true, + ), + HeterogeneousMapEntry( + key: strings.importPath, + valueConfigSpec: StringConfigSpec(), + required: true, + ), + ], + ), + ), + ], + ); + } + + StringConfigSpec _filePathStringConfigSpec() { + return StringConfigSpec( + schemaDefName: 'filePath', + schemaDescription: "A file path", + ); + } + + StringConfigSpec _nonEmptyStringConfigSpec() { + return StringConfigSpec( + schemaDefName: 'nonEmptyString', + pattern: r'.+', + ); + } + + StringConfigSpec _dartClassNameStringConfigSpec() { + return StringConfigSpec( + schemaDefName: 'publicDartClass', + schemaDescription: "A public dart class name.", + pattern: r'^[a-zA-Z]+[_a-zA-Z0-9]*$', + ); + } + + List _includeExcludeProperties() { + return [ + HeterogeneousMapEntry( + key: strings.include, + valueConfigSpec: _fullMatchOrRegexpList(), ), - [strings.typeMap, strings.typeMapUnions]: - Specification>>( - validator: typeMapValidator, - extractor: typeMapExtractor, - defaultValue: () => >{}, - extractedResult: (dynamic result) { - _unionTypeMappings = makeImportTypeMapping( - result as Map>, _libraryImports); - }, + HeterogeneousMapEntry( + key: strings.exclude, + valueConfigSpec: _fullMatchOrRegexpList(), + defaultValue: (node) => [], ), - [strings.typeMap, strings.typeMapNativeTypes]: - Specification>>( - validator: typeMapValidator, - extractor: typeMapExtractor, - defaultValue: () => >{}, - extractedResult: (dynamic result) { - _nativeTypeMappings = makeImportTypeMapping( - result as Map>, _libraryImports); - }, - ), - [strings.functions, strings.varArgFunctions]: - Specification>>( - requirement: Requirement.no, - validator: varArgFunctionConfigValidator, - extractor: varArgFunctionConfigExtractor, - defaultValue: () => >{}, - extractedResult: (dynamic result) { - _varArgFunctions = makeVarArgFunctionsMapping( - result as Map>, _libraryImports); + ]; + } + + ListConfigSpec> _fullMatchOrRegexpList() { + return ListConfigSpec( + schemaDefName: "fullMatchOrRegexpList", + childConfigSpec: StringConfigSpec(), + ); + } + + List _renameProperties() { + return [ + HeterogeneousMapEntry( + key: strings.rename, + valueConfigSpec: MapConfigSpec( + schemaDefName: "rename", + keyValueConfigSpecs: [ + (keyRegexp: ".*", valueConfigSpec: StringConfigSpec()), + ], + ), + ), + ]; + } + + List _memberRenameProperties() { + return [ + HeterogeneousMapEntry( + key: strings.memberRename, + valueConfigSpec: MapConfigSpec, + Map>>( + schemaDefName: "memberRename", + keyValueConfigSpecs: [ + ( + keyRegexp: ".*", + valueConfigSpec: MapConfigSpec>( + keyValueConfigSpecs: [ + (keyRegexp: ".*", valueConfigSpec: StringConfigSpec()) + ], + ), + ), + ], + ), + ), + ]; + } + + HeterogeneousMapConfigSpec, Includer> _includeExcludeObject() { + return HeterogeneousMapConfigSpec( + schemaDefName: "includeExclude", + entries: [ + ..._includeExcludeProperties(), + ], + transform: (node) => extractIncluderFromYaml(node.value), + ); + } + + HeterogeneousMapEntry _dependencyOnlyHeterogeneousMapKey() { + return HeterogeneousMapEntry( + key: strings.dependencyOnly, + valueConfigSpec: EnumConfigSpec( + schemaDefName: "dependencyOnly", + allowedValues: { + strings.fullCompoundDependencies, + strings.opaqueCompoundDependencies, }, + transform: (node) => node.value == strings.opaqueCompoundDependencies + ? CompoundDependencies.opaque + : CompoundDependencies.full, ), - [strings.excludeAllByDefault]: Specification( - requirement: Requirement.no, - validator: booleanValidator, - extractor: booleanExtractor, - defaultValue: () => false, - extractedResult: (dynamic result) => - _excludeAllByDefault = result as bool, - ), - [strings.sort]: Specification( - requirement: Requirement.no, - validator: booleanValidator, - extractor: booleanExtractor, - defaultValue: () => false, - extractedResult: (dynamic result) => _sort = result as bool, - ), - [strings.useSupportedTypedefs]: Specification( - requirement: Requirement.no, - validator: booleanValidator, - extractor: booleanExtractor, - defaultValue: () => true, - extractedResult: (dynamic result) => - _useSupportedTypedefs = result as bool, - ), - [strings.comments]: Specification( - requirement: Requirement.no, - validator: commentValidator, - extractor: commentExtractor, - defaultValue: () => CommentType.def(), - extractedResult: (dynamic result) => - _commentType = result as CommentType, - ), - [strings.structs, strings.dependencyOnly]: - Specification( - requirement: Requirement.no, - validator: dependencyOnlyValidator, - extractor: dependencyOnlyExtractor, - defaultValue: () => CompoundDependencies.full, - extractedResult: (dynamic result) => - _structDependencies = result as CompoundDependencies, - ), - [strings.unions, strings.dependencyOnly]: - Specification( - requirement: Requirement.no, - validator: dependencyOnlyValidator, - extractor: dependencyOnlyExtractor, - defaultValue: () => CompoundDependencies.full, - extractedResult: (dynamic result) => - _unionDependencies = result as CompoundDependencies, - ), - [strings.structs, strings.structPack]: - Specification( - requirement: Requirement.no, - validator: structPackingOverrideValidator, - extractor: structPackingOverrideExtractor, - defaultValue: () => StructPackingOverride(), - extractedResult: (dynamic result) => - _structPackingOverride = result as StructPackingOverride, - ), - [strings.name]: Specification( - requirement: Requirement.prefer, - validator: dartClassNameValidator, - extractor: stringExtractor, - defaultValue: () => 'NativeLibrary', - extractedResult: (dynamic result) => _wrapperName = result as String, - ), - [strings.description]: Specification( - requirement: Requirement.prefer, - validator: nonEmptyStringValidator, - extractor: stringExtractor, - defaultValue: () => null, - extractedResult: (dynamic result) => - _wrapperDocComment = result as String?, - ), - [strings.preamble]: Specification( - requirement: Requirement.no, - validator: nonEmptyStringValidator, - extractor: stringExtractor, - extractedResult: (dynamic result) => _preamble = result as String?, - ), - [strings.useDartHandle]: Specification( - requirement: Requirement.no, - validator: booleanValidator, - extractor: booleanExtractor, - defaultValue: () => true, - extractedResult: (dynamic result) => _useDartHandle = result as bool, - ), - [strings.functions, strings.exposeFunctionTypedefs]: - Specification( - requirement: Requirement.no, - validator: exposeFunctionTypeValidator, - extractor: exposeFunctionTypeExtractor, - defaultValue: () => Includer.excludeByDefault(), - extractedResult: (dynamic result) => - _exposeFunctionTypedefs = result as Includer, - ), - [strings.functions, strings.leafFunctions]: Specification( - requirement: Requirement.no, - validator: leafFunctionValidator, - extractor: leafFunctionExtractor, - defaultValue: () => Includer.excludeByDefault(), - extractedResult: (dynamic result) => - _leafFunctions = result as Includer, - ), - [strings.ffiNative]: Specification( - requirement: Requirement.no, - validator: ffiNativeValidator, - extractor: ffiNativeExtractor, - defaultValue: () => FfiNativeConfig(enabled: false), - extractedResult: (dynamic result) => - _ffiNativeConfig = result as FfiNativeConfig, - ) - }; + defaultValue: (node) => CompoundDependencies.full, + ); + } + + MapConfigSpec _mappedTypeObject() { + return MapConfigSpec( + schemaDefName: "mappedTypes", + keyValueConfigSpecs: [ + ( + keyRegexp: ".*", + valueConfigSpec: HeterogeneousMapConfigSpec(entries: [ + HeterogeneousMapEntry( + key: strings.lib, valueConfigSpec: StringConfigSpec()), + HeterogeneousMapEntry( + key: strings.cType, valueConfigSpec: StringConfigSpec()), + HeterogeneousMapEntry( + key: strings.dartType, valueConfigSpec: StringConfigSpec()), + ]), + ) + ], + transform: (node) => typeMapExtractor(node.value), + ); + } + + MapConfigSpec _objcInterfaceModuleObject() { + return MapConfigSpec( + schemaDefName: "objcInterfaceModule", + keyValueConfigSpecs: [ + (keyRegexp: ".*", valueConfigSpec: StringConfigSpec()), + ], + transform: (node) => + ObjCModulePrefixer(node.value.cast()), + ); } } diff --git a/pkgs/ffigen/lib/src/config_provider/config_spec.dart b/pkgs/ffigen/lib/src/config_provider/config_spec.dart new file mode 100644 index 0000000000..3ad3249168 --- /dev/null +++ b/pkgs/ffigen/lib/src/config_provider/config_spec.dart @@ -0,0 +1,822 @@ +import 'package:logging/logging.dart'; +import 'package:yaml/yaml.dart'; + +final _logger = Logger('ffigen.config_provider.config'); + +/// Base class for all ConfigSpecs to extend. +/// +/// [TE] - type input for [transform], [RE] - type input for [result]. +/// +/// Validation - +/// +/// - [customValidation] is called after the ConfigSpec hierarchical validations +/// are completed. +/// +/// Extraction - +/// +/// - The data is first validated, if invalid it throws a +/// ConfigSpecExtractionError. +/// - The extracted data from the child(s) is collected and the value is +/// transformed via [transform] (if specified). +/// - Finally the [result] closure is called (if specified). +abstract class ConfigSpec { + /// Used to generate and refer the reference definition generated in json + /// schema. Must be unique for a nested Schema. + String? schemaDefName; + + /// Used to generate the description field in json schema. + String? schemaDescription; + + /// Custom validation hook, called post validation if successful. + bool Function(ConfigValue node)? customValidation; + + /// Used to transform the payload to another type before passing to parent + /// nodes and [result]. + RE Function(ConfigValue node)? transform; + + /// Called when final result is prepared via [_extractNode]. + void Function(ConfigValue node)? result; + ConfigSpec({ + required this.schemaDefName, + required this.schemaDescription, + required this.customValidation, + required this.transform, + required this.result, + }); + + bool _validateNode(ConfigValue o, {bool log = true}); + + ConfigValue _extractNode(ConfigValue o); + + /// ConfigSpec objects should call [_getJsonRefOrSchemaNode] instead to get the + /// child json schema. + Map _generateJsonSchemaNode(Map defs); + + Map _getJsonRefOrSchemaNode(Map defs) { + if (schemaDefName == null) { + return _generateJsonSchemaNode(defs); + } + defs.putIfAbsent(schemaDefName!, () => _generateJsonSchemaNode(defs)); + return {r"$ref": "#/\$defs/$schemaDefName"}; + } + + Map generateJsonSchema(String schemaId) { + final defs = {}; + final schemaMap = _generateJsonSchemaNode(defs); + return { + r"$id": schemaId, + r"$comment": + "This file is generated. To regenerate run: dart tool/generate_json_schema.dart in github.com/dart-lang/ffigen", + r"$schema": "https://json-schema.org/draft/2020-12/schema", + ...schemaMap, + r"$defs": defs, + }; + } + + /// Run validation on an object [value]. + bool validate(dynamic value) { + return _validateNode(ConfigValue(path: [], value: value)); + } + + /// Extract ConfigSpecNode from [value]. This will call the [transform] for all + /// underlying ConfigSpecs if valid. + /// Should ideally only be called if [validate] returns True. Throws + /// [ConfigSpecExtractionError] if any validation fails. + ConfigValue extract(dynamic value) { + return _extractNode(ConfigValue(path: [], value: value)); + } +} + +/// An individual value in a config for a specific [path] instantiated from a [ConfigSpec]. +/// +/// A config value contains both the [value] that users of the configuration would want +/// to use, as well as the [rawValue] that was provided as input to the configuration. +class ConfigValue { + /// The path to this node. + /// + /// E.g - ["path", "to", "arr", "[1]", "item"] + final List path; + + /// Get a string representation for path. + /// + /// E.g - "path -> to -> arr -> [1] -> item" + String get pathString => path.join(" -> "); + + /// Contains the underlying node value after all transformations and + /// default values have been applied. + final TE value; + + /// Contains the raw underlying node value. Would be null for fields populated + /// but default values + final Object? rawValue; + + ConfigValue({ + required this.path, + required this.value, + Object? rawValue, + bool nullRawValue = false, + }) : rawValue = nullRawValue ? null : (rawValue ?? value); + + /// Copy object with a different value. + ConfigValue withValue(T value, Object? rawValue) { + return ConfigValue( + path: path, + value: value, + rawValue: rawValue, + nullRawValue: rawValue == null, + ); + } + + /// Transforms this with a nullable [transform] or return itself + /// and calls the [result] callback + ConfigValue transformOrThis( + RE Function(ConfigValue value)? transform, + void Function(ConfigValue node)? resultCallback, + ) { + ConfigValue returnValue; + if (transform != null) { + returnValue = this.withValue(transform.call(this), rawValue); + } else { + returnValue = this.withValue(this.value as RE, rawValue); + } + resultCallback?.call(returnValue); + return returnValue; + } + + /// Returns true if [value] is of Type [T]. + bool checkType({bool log = true}) { + if (value is! T) { + if (log) { + _logger.severe( + "Expected value of key '$pathString' to be of type '$T' (Got ${value.runtimeType})."); + } + return false; + } + return true; + } +} + +class ConfigSpecExtractionError extends Error { + final ConfigValue? item; + final String message; + ConfigSpecExtractionError(this.item, [this.message = "Invalid ConfigSpec"]); + + @override + String toString() { + if (item != null) { + return "$runtimeType: $message @ ${item!.pathString}"; + } + return "$runtimeType: $message"; + } +} + +class HeterogeneousMapEntry { + final String key; + final ConfigSpec valueConfigSpec; + final Object? Function(ConfigValue o)? defaultValue; + void Function(ConfigValue node)? resultOrDefault; + final bool required; + + HeterogeneousMapEntry({ + required this.key, + required this.valueConfigSpec, + this.defaultValue, + this.resultOrDefault, + this.required = false, + }); +} + +enum AdditionalProperties { Allow, Warn, Error } + +/// ConfigSpec for a Map which has a fixed set of known keys. +/// +/// [CE] typecasts result from entries->{}->valueConfigSpec. +/// +/// [RE] typecasts result returned by this node. +class HeterogeneousMapConfigSpec + extends ConfigSpec, RE> { + final List entries; + final Set allKeys; + final Set requiredKeys; + final AdditionalProperties additionalProperties; + + HeterogeneousMapConfigSpec({ + required this.entries, + super.schemaDefName, + super.schemaDescription, + super.customValidation, + super.transform, + super.result, + this.additionalProperties = AdditionalProperties.Warn, + }) : requiredKeys = { + for (final kv in entries.where((kv) => kv.required)) kv.key + }, + allKeys = {for (final kv in entries) kv.key}; + + @override + bool _validateNode(ConfigValue o, {bool log = true}) { + if (!o.checkType(log: log)) { + return false; + } + + var result = true; + final inputMap = (o.value as Map); + + for (final requiredKey in requiredKeys) { + if (!inputMap.containsKey(requiredKey)) { + if (log) { + _logger.severe( + "Key '${[...o.path, requiredKey].join(' -> ')}' is required."); + } + result = false; + } + } + + for (final entry in entries) { + final path = [...o.path, entry.key.toString()]; + if (!inputMap.containsKey(entry.key)) { + continue; + } + final configSpecNode = + ConfigValue(path: path, value: inputMap[entry.key]); + if (!entry.valueConfigSpec._validateNode(configSpecNode, log: log)) { + result = false; + continue; + } + } + + if (additionalProperties != AdditionalProperties.Allow) { + for (final key in inputMap.keys) { + if (!allKeys.contains(key)) { + if (log) { + _logger.severe("Unknown key - '${[...o.path, key].join(' -> ')}'."); + } + if (additionalProperties == AdditionalProperties.Error) { + result = false; + } + } + } + } + + if (!result && customValidation != null) { + return customValidation!.call(o); + } + return result; + } + + dynamic _getAllDefaults(ConfigValue o) { + final result = {}; + for (final entry in entries) { + final path = [...o.path, entry.key]; + if (entry.defaultValue != null) { + result[entry.key] = entry.defaultValue! + .call(ConfigValue(path: path, value: null)) as CE; + } else if (entry.valueConfigSpec is HeterogeneousMapConfigSpec) { + final defaultValue = + (entry.valueConfigSpec as HeterogeneousMapConfigSpec) + ._getAllDefaults(ConfigValue(path: path, value: null)); + if (defaultValue != null) { + result[entry.key] = + (entry.valueConfigSpec as HeterogeneousMapConfigSpec) + ._getAllDefaults(ConfigValue(path: path, value: null)) as CE; + } + } + if (result.containsKey(entry.key) && entry.resultOrDefault != null) { + // Call resultOrDefault hook for HeterogeneousMapEntry. + entry.resultOrDefault!.call(ConfigValue( + path: path, value: result[entry.key], nullRawValue: true)); + } + } + return result.isEmpty + ? null + : o + .withValue(result, null) + .transformOrThis(transform, this.result) + .value; + } + + @override + ConfigValue _extractNode(ConfigValue o) { + if (!o.checkType(log: false)) { + throw ConfigSpecExtractionError(o); + } + + final inputMap = (o.value as Map); + final childExtracts = {}; + + for (final requiredKey in requiredKeys) { + if (!inputMap.containsKey(requiredKey)) { + throw ConfigSpecExtractionError( + null, "Invalid config spec, missing required key - $requiredKey."); + } + } + + for (final entry in entries) { + final path = [...o.path, entry.key.toString()]; + if (!inputMap.containsKey(entry.key)) { + // No value specified, fill in with default value instead. + if (entry.defaultValue != null) { + childExtracts[entry.key] = entry.defaultValue! + .call(ConfigValue(path: path, value: null)) as CE; + } else if (entry.valueConfigSpec is HeterogeneousMapConfigSpec) { + final defaultValue = + (entry.valueConfigSpec as HeterogeneousMapConfigSpec) + ._getAllDefaults(ConfigValue(path: path, value: null)); + if (defaultValue != null) { + childExtracts[entry.key] = (entry.valueConfigSpec + as HeterogeneousMapConfigSpec) + ._getAllDefaults(ConfigValue(path: path, value: null)) as CE; + } + } + } else { + // Extract value from node. + final configSpecNode = + ConfigValue(path: path, value: inputMap[entry.key]); + if (!entry.valueConfigSpec._validateNode(configSpecNode, log: false)) { + throw ConfigSpecExtractionError(configSpecNode); + } + childExtracts[entry.key] = + entry.valueConfigSpec._extractNode(configSpecNode).value as CE; + } + + if (childExtracts.containsKey(entry.key) && + entry.resultOrDefault != null) { + // Call resultOrDefault hook for HeterogeneousMapEntry. + entry.resultOrDefault!.call(ConfigValue( + path: path, value: childExtracts[entry.key], nullRawValue: true)); + } + } + + if (additionalProperties == AdditionalProperties.Error) { + for (final key in inputMap.keys) { + if (!allKeys.contains(key)) { + throw ConfigSpecExtractionError( + o, "Invalid ConfigSpec: additional properties not allowed."); + } + } + } + + return o + .withValue(childExtracts, o.rawValue) + .transformOrThis(transform, result); + } + + @override + Map _generateJsonSchemaNode(Map defs) { + return { + "type": "object", + if (additionalProperties != AdditionalProperties.Allow) + "additionalProperties": false, + if (schemaDescription != null) "description": schemaDescription!, + if (entries.isNotEmpty) + "properties": { + for (final kv in entries) + kv.key: kv.valueConfigSpec._getJsonRefOrSchemaNode(defs) + }, + if (requiredKeys.isNotEmpty) "required": requiredKeys.toList(), + }; + } +} + +/// ConfigSpec for a Map that can have any number of keys. +/// +/// [CE] typecasts result from keyValueConfigSpecs->{}->valueConfigSpec. +/// +/// [RE] typecasts result returned by this node. +class MapConfigSpec + extends ConfigSpec, RE> { + /// Both [keyRegexp] - [valueConfigSpec] pair is used to match a set of + /// key-value input. Atleast one entry must match against an input for it + /// to be considered valid. + /// + /// Note: [keyRegexp] will be matched against key.toString() + final List<({String keyRegexp, ConfigSpec valueConfigSpec})> + keyValueConfigSpecs; + + MapConfigSpec({ + required this.keyValueConfigSpecs, + super.schemaDefName, + super.schemaDescription, + super.customValidation, + super.transform, + super.result, + }); + + @override + bool _validateNode(ConfigValue o, {bool log = true}) { + if (!o.checkType(log: log)) { + return false; + } + + var result = true; + final inputMap = (o.value as Map); + + for (final MapEntry(key: key, value: value) in inputMap.entries) { + final configSpecNode = + ConfigValue(path: [...o.path, key.toString()], value: value); + var keyValueMatch = false; + + /// Running first time with no logs. + for (final (keyRegexp: keyRegexp, valueConfigSpec: valueConfigSpec) + in keyValueConfigSpecs) { + if (RegExp(keyRegexp, dotAll: true).hasMatch(key.toString()) && + valueConfigSpec._validateNode(configSpecNode, log: false)) { + keyValueMatch = true; + break; + } + } + if (!keyValueMatch) { + result = false; + // No configSpec matched, running again to print logs this time. + if (log) { + _logger.severe( + "'${configSpecNode.pathString}' must match atleast one of the allowed key regex and configSpec."); + for (final (keyRegexp: keyRegexp, valueConfigSpec: valueConfigSpec) + in keyValueConfigSpecs) { + if (!RegExp(keyRegexp, dotAll: true).hasMatch(key.toString())) { + _logger.severe( + "'${configSpecNode.pathString}' does not match regex - '$keyRegexp' (Input - $key)"); + continue; + } + if (valueConfigSpec._validateNode(configSpecNode, log: log)) { + continue; + } + } + } + } + } + + if (!result && customValidation != null) { + return customValidation!.call(o); + } + return result; + } + + @override + ConfigValue _extractNode(ConfigValue o) { + if (!o.checkType(log: false)) { + throw ConfigSpecExtractionError(o); + } + + final inputMap = (o.value as Map); + final childExtracts = {}; + for (final MapEntry(key: key, value: value) in inputMap.entries) { + final configSpecNode = + ConfigValue(path: [...o.path, key.toString()], value: value); + var keyValueMatch = false; + for (final (keyRegexp: keyRegexp, valueConfigSpec: valueConfigSpec) + in keyValueConfigSpecs) { + if (RegExp(keyRegexp, dotAll: true).hasMatch(key.toString()) && + valueConfigSpec._validateNode(configSpecNode, log: false)) { + childExtracts[key] = + valueConfigSpec._extractNode(configSpecNode).value as CE; + keyValueMatch = true; + break; + } + } + if (!keyValueMatch) { + throw ConfigSpecExtractionError(configSpecNode); + } + } + + return o + .withValue(childExtracts, o.rawValue) + .transformOrThis(transform, result); + } + + @override + Map _generateJsonSchemaNode(Map defs) { + return { + "type": "object", + if (schemaDescription != null) "description": schemaDescription!, + if (keyValueConfigSpecs.isNotEmpty) + "patternProperties": { + for (final (keyRegexp: keyRegexp, valueConfigSpec: valueConfigSpec) + in keyValueConfigSpecs) + keyRegexp: valueConfigSpec._getJsonRefOrSchemaNode(defs) + } + }; + } +} + +/// ConfigSpec for a List. +/// +/// [CE] typecasts result from [childConfigSpec]. +/// +/// [RE] typecasts result returned by this node. +class ListConfigSpec + extends ConfigSpec, RE> { + final ConfigSpec childConfigSpec; + + ListConfigSpec({ + required this.childConfigSpec, + super.schemaDefName, + super.schemaDescription, + super.customValidation, + super.transform, + super.result, + }); + + @override + bool _validateNode(ConfigValue o, {bool log = true}) { + if (!o.checkType(log: log)) { + return false; + } + final inputList = (o.value as YamlList).cast(); + var result = true; + for (final (i, input) in inputList.indexed) { + final configSpecNode = + ConfigValue(path: [...o.path, "[$i]"], value: input); + if (!childConfigSpec._validateNode(configSpecNode, log: log)) { + result = false; + continue; + } + } + + if (!result && customValidation != null) { + return customValidation!.call(o); + } + return result; + } + + @override + ConfigValue _extractNode(ConfigValue o) { + if (!o.checkType(log: false)) { + throw ConfigSpecExtractionError(o); + } + final inputList = (o.value as YamlList).cast(); + final childExtracts = []; + for (final (i, input) in inputList.indexed) { + final configSpecNode = + ConfigValue(path: [...o.path, i.toString()], value: input); + if (!childConfigSpec._validateNode(configSpecNode, log: false)) { + throw ConfigSpecExtractionError(configSpecNode); + } + childExtracts + .add(childConfigSpec._extractNode(configSpecNode).value as CE); + } + return o + .withValue(childExtracts, o.rawValue) + .transformOrThis(transform, result); + } + + @override + Map _generateJsonSchemaNode(Map defs) { + return { + "type": "array", + if (schemaDescription != null) "description": schemaDescription!, + "items": childConfigSpec._getJsonRefOrSchemaNode(defs), + }; + } +} + +/// ConfigSpec for a String. +/// +/// [RE] typecasts result returned by this node. +class StringConfigSpec extends ConfigSpec { + final String? pattern; + final RegExp? _regexp; + + StringConfigSpec({ + super.schemaDefName, + super.schemaDescription, + super.customValidation, + super.transform, + super.result, + this.pattern, + }) : _regexp = pattern == null ? null : RegExp(pattern, dotAll: true); + + @override + bool _validateNode(ConfigValue o, {bool log = true}) { + if (!o.checkType(log: log)) { + return false; + } + if (_regexp != null && !_regexp!.hasMatch(o.value as String)) { + if (log) { + _logger.severe( + "Expected value of key '${o.pathString}' to match pattern $pattern (Input - ${o.value})."); + } + return false; + } + if (customValidation != null) { + return customValidation!.call(o); + } + return true; + } + + @override + ConfigValue _extractNode(ConfigValue o) { + if (!o.checkType(log: false)) { + throw ConfigSpecExtractionError(o); + } + return o + .withValue(o.value as String, o.rawValue) + .transformOrThis(transform, result); + } + + @override + Map _generateJsonSchemaNode(Map defs) { + return { + "type": "string", + if (schemaDescription != null) "description": schemaDescription!, + if (pattern != null) "pattern": pattern, + }; + } +} + +/// ConfigSpec for an Int. +/// +/// [RE] typecasts result returned by this node. +class IntConfigSpec extends ConfigSpec { + IntConfigSpec({ + super.schemaDefName, + super.schemaDescription, + super.customValidation, + super.transform, + super.result, + }); + + @override + bool _validateNode(ConfigValue o, {bool log = true}) { + if (!o.checkType(log: log)) { + return false; + } + if (customValidation != null) { + return customValidation!.call(o); + } + return true; + } + + @override + ConfigValue _extractNode(ConfigValue o) { + if (!o.checkType(log: false)) { + throw ConfigSpecExtractionError(o); + } + return o + .withValue(o.value as int, o.rawValue) + .transformOrThis(transform, result); + } + + @override + Map _generateJsonSchemaNode(Map defs) { + return { + "type": "integer", + if (schemaDescription != null) "description": schemaDescription!, + }; + } +} + +/// ConfigSpec for an object where only specific values are allowed. +/// [CE] is the type for elements in [allowedValues]. +/// +/// [RE] typecasts result returned by this node. +class EnumConfigSpec + extends ConfigSpec { + Set allowedValues; + EnumConfigSpec({ + required this.allowedValues, + super.schemaDefName, + super.schemaDescription, + super.customValidation, + super.transform, + super.result, + }); + + @override + bool _validateNode(ConfigValue o, {bool log = true}) { + if (!allowedValues.contains(o.value)) { + if (log) { + _logger.severe( + "'${o.pathString}' must be one of the following - $allowedValues (Got ${o.value})"); + } + return false; + } + if (customValidation != null) { + return customValidation!.call(o); + } + return true; + } + + @override + ConfigValue _extractNode(ConfigValue o) { + if (!allowedValues.contains(o.value)) { + throw ConfigSpecExtractionError(o); + } + return o + .withValue(o.value as CE, o.rawValue) + .transformOrThis(transform, result); + } + + @override + Map _generateJsonSchemaNode(Map defs) { + return { + "enum": allowedValues.toList(), + if (schemaDescription != null) "description": schemaDescription!, + }; + } +} + +/// ConfigSpec for a bool. +/// +/// [RE] typecasts result returned by this node. +class BoolConfigSpec extends ConfigSpec { + BoolConfigSpec({ + super.schemaDefName, + super.schemaDescription, + super.customValidation, + super.transform, + super.result, + }); + + @override + bool _validateNode(ConfigValue o, {bool log = true}) { + if (!o.checkType(log: log)) { + return false; + } + if (customValidation != null) { + return customValidation!.call(o); + } + return true; + } + + @override + ConfigValue _extractNode(ConfigValue o) { + if (!o.checkType(log: false)) { + throw ConfigSpecExtractionError(o); + } + return o + .withValue(o.value as bool, o.rawValue) + .transformOrThis(transform, result); + } + + @override + Map _generateJsonSchemaNode(Map defs) { + return { + "type": "boolean", + if (schemaDescription != null) "description": schemaDescription!, + }; + } +} + +/// ConfigSpec that requires atleast one underlying match. +/// +/// [TE] typecasts the result returned by the the first valid [childConfigSpecs]. +/// +/// [RE] typecasts result returned by this node. +class OneOfConfigSpec + extends ConfigSpec { + final List childConfigSpecs; + + OneOfConfigSpec({ + required this.childConfigSpecs, + super.schemaDefName, + super.schemaDescription, + super.customValidation, + super.transform, + super.result, + }); + + @override + bool _validateNode(ConfigValue o, {bool log = true}) { + // Running first time with no logs. + for (final spec in childConfigSpecs) { + if (spec._validateNode(o, log: false)) { + if (customValidation != null) { + return customValidation!.call(o); + } + return true; + } + } + // No configSpec matched, running again to print logs this time. + if (log) { + _logger.severe( + "'${o.pathString}' must match atleast one of the allowed configSpec -"); + for (final spec in childConfigSpecs) { + spec._validateNode(o, log: log); + } + } + return false; + } + + @override + ConfigValue _extractNode(ConfigValue o) { + for (final spec in childConfigSpecs) { + if (spec._validateNode(o, log: false)) { + return o + .withValue(spec._extractNode(o).value as TE, o.rawValue) + .transformOrThis(transform, result); + } + } + throw ConfigSpecExtractionError(o); + } + + @override + Map _generateJsonSchemaNode(Map defs) { + return { + if (schemaDescription != null) "description": schemaDescription!, + r"$oneOf": childConfigSpecs + .map((child) => child._getJsonRefOrSchemaNode(defs)) + .toList(), + }; + } +} diff --git a/pkgs/ffigen/lib/src/config_provider/config_types.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart index 1eddfc98fe..75d5fcaeed 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_types.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart @@ -64,28 +64,6 @@ class StructPackingOverride { } } -/// Represents a single specification in configurations. -/// -/// [E] is the return type of the extractedResult. -class Specification { - final bool Function(List name, dynamic value) validator; - final E Function(dynamic map) extractor; - final E Function()? defaultValue; - - final Requirement requirement; - final void Function(dynamic result) extractedResult; - - Specification({ - required this.extractedResult, - required this.validator, - required this.extractor, - this.defaultValue, - this.requirement = Requirement.no, - }); -} - -enum Requirement { yes, prefer, no } - // Holds headers and filters for header. class Headers { /// Path to headers. diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 8bb3e2b837..ff4e1b76e4 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -39,115 +39,18 @@ String _normalizePath(String path, String? configFilename) { skipNormalization ? path : p.join(p.dirname(configFilename), path)); } -/// Checks if type of value is [T], logs an error if it's not. -/// -/// [key] is printed as `'item1 -> item2 => item3'` in log message. -bool checkType(List keys, dynamic value) { - if (value is! T) { - _logger.severe( - "Expected value of key '${keys.join(' -> ')}' to be of type '$T'."); - return false; - } - return true; -} - -/// Checks if there are nested [key] in [map]. -bool checkKeyInYaml(List key, YamlMap map) { - dynamic last = map; - for (final k in key) { - if (last is YamlMap) { - if (!last.containsKey(k)) return false; - last = last[k]; - } else { - return false; - } - } - // The entry for the last key may be null. - return true; -} - -/// Extracts value of nested [key] from [map]. -dynamic getKeyValueFromYaml(List key, YamlMap map) { - if (checkKeyInYaml(key, map)) { - dynamic last = map; - for (final k in key) { - last = last[k]; - } - return last; - } - - return null; -} - -/// Recursively checks the keys in [configKeyMap] from [allowedKeyList]. -void warnUnknownKeys(List> allowedKeyList, YamlMap configKeyMap) { - final allowedKeyMap = {}; - for (final specKeys in allowedKeyList) { - var item = allowedKeyMap; - for (final specSubKey in specKeys) { - item.putIfAbsent(specSubKey, () => {}); - item = item[specSubKey] as Map; - } - // Add empty key to mark that any sub-keys of this key are allowed. - item[''] = {}; - } - _warnUnknownKeysInMap(allowedKeyMap, configKeyMap, []); -} - -/// Recursive function to check a key set in a configKeyMap. -void _warnUnknownKeysInMap(Map allowedKeyMap, - dynamic configKeyMap, List prev) { - if (allowedKeyMap.containsKey('') || configKeyMap is! YamlMap) { - return; - } - for (final key in configKeyMap.keys) { - if (allowedKeyMap.containsKey(key)) { - prev.add(key); - _warnUnknownKeysInMap( - allowedKeyMap[key] as Map, configKeyMap[key], prev); - prev.removeLast(); - } else { - prev.add(key); - _logger.warning('Unknown key - ${prev.join(' -> ')}.'); - prev.removeLast(); - } - } -} - -bool booleanExtractor(dynamic value) => value as bool; - -bool booleanValidator(List name, dynamic value) => - checkType(name, value); - -Map libraryImportsExtractor(dynamic yamlConfig) { +Map libraryImportsExtractor( + Map? typeMap) { final resultMap = {}; - final typeMap = yamlConfig as YamlMap?; if (typeMap != null) { for (final typeName in typeMap.keys) { - resultMap[typeName as String] = + resultMap[typeName] = LibraryImport(typeName, typeMap[typeName] as String); } } return resultMap; } -bool libraryImportsValidator(List name, dynamic yamlConfig) { - if (!checkType(name, yamlConfig)) { - return false; - } - for (final key in (yamlConfig as YamlMap).keys) { - if (!checkType([...name, key as String], yamlConfig[key])) { - return false; - } - if (strings.predefinedLibraryImports.containsKey(key)) { - _logger.severe( - 'library-import -> $key should not collide with any predefined imports - ${strings.predefinedLibraryImports.keys}.'); - return false; - } - } - return true; -} - void loadImportedTypes(YamlMap fileConfig, Map usrTypeMappings, LibraryImport libraryImport) { final symbols = fileConfig['symbols'] as YamlMap; @@ -169,18 +72,14 @@ YamlMap loadSymbolFile(String symbolFilePath, String? configFileName, } Map symbolFileImportExtractor( - dynamic yamlConfig, + List yamlConfig, Map libraryImports, String? configFileName, PackageConfig? packageConfig) { final resultMap = {}; - for (final item in (yamlConfig as YamlList)) { + for (final item in yamlConfig) { String symbolFilePath; - if (item is String) { - symbolFilePath = item; - } else { - symbolFilePath = item[strings.symbolFile] as String; - } + symbolFilePath = item; final symbolFile = loadSymbolFile(symbolFilePath, configFileName, packageConfig); final formatVersion = symbolFile[strings.formatVersion] as String; @@ -210,44 +109,13 @@ Map symbolFileImportExtractor( return resultMap; } -bool symbolFileImportValidator(List name, dynamic yamlConfig) { - if (!checkType(name, yamlConfig)) { - return false; - } - var result = true; - (yamlConfig as YamlList).asMap().forEach((idx, value) { - if (value is YamlMap) { - if (!value.keys.contains(strings.symbolFile)) { - result = false; - _logger - .severe('Key $name -> $idx -> ${strings.symbolFile} is required.'); - } - for (final key in value.keys) { - if (key == strings.symbolFile) { - if (!checkType( - [...name, idx.toString(), key as String], value[key])) { - result = false; - } - } else { - result = false; - _logger.severe('Unknown key : $name -> $idx -> $key.'); - } - } - } else if (value is! String) { - result = false; - _logger.severe('Expected $name -> $idx should be a String or Map.'); - } - }); - return result; -} - -Map> typeMapExtractor(dynamic yamlConfig) { +Map> typeMapExtractor(Map? yamlConfig) { // Key - type_name, Value - [lib, cType, dartType]. final resultMap = >{}; - final typeMap = yamlConfig as YamlMap?; + final typeMap = yamlConfig; if (typeMap != null) { for (final typeName in typeMap.keys) { - final typeConfigItem = typeMap[typeName] as YamlMap; + final typeConfigItem = typeMap[typeName] as Map; resultMap[typeName as String] = [ typeConfigItem[strings.lib] as String, typeConfigItem[strings.cType] as String, @@ -258,57 +126,6 @@ Map> typeMapExtractor(dynamic yamlConfig) { return resultMap; } -bool typeMapValidator(List name, dynamic yamlConfig) { - if (!checkType(name, yamlConfig)) { - return false; - } - var result = true; - for (final key in (yamlConfig as YamlMap).keys) { - if (!checkType([...name, key as String], yamlConfig[key])) { - return false; - } - final lib = (yamlConfig[key] as YamlMap).containsKey(strings.lib); - if (!lib) { - _logger.severe("Key '${strings.lib}' in $name -> $key is required."); - result = false; - } - final cType = (yamlConfig[key] as YamlMap).containsKey(strings.cType); - if (!cType) { - _logger.severe("Key '${strings.cType}' in $name -> $key is required."); - result = false; - } - final dartType = (yamlConfig[key] as YamlMap).containsKey(strings.dartType); - if (!dartType) { - _logger.severe("Key '${strings.dartType}' in $name -> $key is required."); - result = false; - } - } - return result; -} - -Map stringStringMapExtractor(dynamic yamlConfig) { - final resultMap = {}; - final inputMap = yamlConfig as YamlMap?; - if (inputMap != null) { - for (final key in inputMap.keys) { - resultMap[key as String] = inputMap[key] as String; - } - } - return resultMap; -} - -bool stringStringMapValidator(List name, dynamic yamlConfig) { - if (!checkType(name, yamlConfig)) { - return false; - } - for (final key in (yamlConfig as YamlMap).keys) { - if (!checkType([...name, key as String], yamlConfig[key])) { - return false; - } - } - return true; -} - Map makeImportTypeMapping( Map> rawTypeMappings, Map libraryImportsMap) { @@ -440,77 +257,22 @@ List compilerOptsToList(String compilerOpts) { return list; } -List compilerOptsExtractor(dynamic value) { - if (value is String) { - return compilerOptsToList(value); - } - +List compilerOptsExtractor(List value) { final list = []; - for (final el in (value as YamlList)) { - if (el is String) { - list.addAll(compilerOptsToList(el)); - } + for (final el in (value)) { + list.addAll(compilerOptsToList(el)); } return list; } -bool compilerOptsValidator(List name, dynamic value) { - if (value is String || value is YamlList) { - return true; - } else { - _logger.severe('Expected $name to be a String or List of String.'); - return false; - } -} - -CompilerOptsAuto compilerOptsAutoExtractor(dynamic value) { - return CompilerOptsAuto( - macIncludeStdLib: getKeyValueFromYaml( - [strings.macos, strings.includeCStdLib], - value as YamlMap, - ) as bool?, - ); -} - -bool compilerOptsAutoValidator(List name, dynamic value) { - var result = true; - - if (!checkType(name, value)) { - return false; - } - - for (final oskey in (value as YamlMap).keys) { - if (oskey == strings.macos) { - if (!checkType([...name, oskey as String], value[oskey])) { - return false; - } - - for (final inckey in (value[oskey] as YamlMap).keys) { - if (inckey == strings.includeCStdLib) { - if (!checkType( - [...name, oskey, inckey as String], value[oskey][inckey])) { - result = false; - } - } else { - _logger.severe("Unknown key '$inckey' in '$name -> $oskey."); - result = false; - } - } - } else { - _logger.severe("Unknown key '$oskey' in '$name'."); - result = false; - } - } - return result; -} - -Headers headersExtractor(dynamic yamlConfig, String? configFilename) { +Headers headersExtractor( + Map> yamlConfig, String? configFilename) { final entryPoints = []; final includeGlobs = []; - for (final key in (yamlConfig as YamlMap).keys) { + for (final key in yamlConfig.keys) { if (key == strings.entryPoints) { - for (final h in (yamlConfig[key] as YamlList)) { - final headerGlob = _normalizePath(h as String, configFilename); + for (final h in (yamlConfig[key]!)) { + final headerGlob = _normalizePath(h, configFilename); // Add file directly to header if it's not a Glob but a File. if (File(headerGlob).existsSync()) { final osSpecificPath = headerGlob; @@ -528,8 +290,8 @@ Headers headersExtractor(dynamic yamlConfig, String? configFilename) { } } if (key == strings.includeDirectives) { - for (final h in (yamlConfig[key] as YamlList)) { - final headerGlob = h as String; + for (final h in yamlConfig[key]!) { + final headerGlob = h; final fixedGlob = _normalizePath(headerGlob, configFilename); includeGlobs.add(quiver.Glob(fixedGlob)); } @@ -543,28 +305,6 @@ Headers headersExtractor(dynamic yamlConfig, String? configFilename) { ); } -bool headersValidator(List name, dynamic value) { - if (!checkType(name, value)) { - return false; - } - if (!(value as YamlMap).containsKey(strings.entryPoints)) { - _logger.severe("Required '$name -> ${strings.entryPoints}'."); - return false; - } else { - for (final key in value.keys) { - if (key == strings.entryPoints || key == strings.includeDirectives) { - if (!checkType([...name, key as String], value[key])) { - return false; - } - } else { - _logger.severe("Unknown key '$key' in '$name'."); - return false; - } - } - return true; - } -} - /// Returns location of dynamic library by searching default locations. Logs /// error and throws an Exception if not found. String findDylibAtDefaultLocations() { @@ -640,10 +380,9 @@ String? findLibclangDylib(String parentFolder) { } } -String llvmPathExtractor(dynamic value) { +String llvmPathExtractor(List value) { // Extract libclang's dylib from user specified paths. - for (final path in (value as YamlList)) { - if (path is! String) continue; + for (final path in value) { final dylibPath = findLibclangDylib(p.join(path, strings.dynamicLibParentName)); if (dylibPath != null) { @@ -672,19 +411,12 @@ String llvmPathExtractor(dynamic value) { } } -bool llvmPathValidator(List name, dynamic value) { - if (!checkType(name, value)) { - return false; - } - return true; -} - OutputConfig outputExtractor( dynamic value, String? configFilename, PackageConfig? packageConfig) { if (value is String) { return OutputConfig(_normalizePath(value, configFilename), null); } - value = value as YamlMap; + value = value as Map; return OutputConfig( _normalizePath((value)[strings.bindings] as String, configFilename), value.containsKey(strings.symbolFile) @@ -694,36 +426,9 @@ OutputConfig outputExtractor( ); } -bool outputValidator(List name, dynamic value) { - if (value is String) { - return true; - } else if (value is YamlMap) { - final keys = value.keys; - var result = true; - for (final key in keys) { - if (key == strings.bindings) { - if (!checkType([...name, key as String], value[key])) { - result = false; - } - } else if (key == strings.symbolFile) { - result = symbolFileOutputValidator( - [...name, strings.symbolFile], value[key]); - } else { - result = false; - _logger.severe("Unknown key '$key' in '$name'."); - } - } - return result; - } else { - _logger.severe( - "Expected value of key '${name.join(' -> ')}' to be a String or Map."); - return false; - } -} - SymbolFile symbolFileOutputExtractor( dynamic value, String? configFilename, PackageConfig? packageConfig) { - value = value as YamlMap; + value = value as Map; var output = value[strings.output] as String; if (Uri.parse(output).scheme != "package") { _logger.warning( @@ -740,71 +445,19 @@ SymbolFile symbolFileOutputExtractor( return SymbolFile(importPath, output); } -bool symbolFileOutputValidator(List name, dynamic value) { - if (!checkType(name, value)) { - return false; - } - if (!(value as YamlMap).containsKey(strings.output)) { - _logger.severe("Required '$name -> ${strings.output}'."); - return false; - } - if (!(value).containsKey(strings.importPath)) { - _logger.severe("Required '$name -> ${strings.importPath}'."); - return false; - } - for (final key in value.keys) { - if (key == strings.output || key == strings.importPath) { - if (!checkType([...name, key as String], value[key])) { - return false; - } - } else { - _logger.severe("Unknown key '$key' in '$name'."); - return false; - } - } - return true; -} - -Language languageExtractor(dynamic value) { - if (value == strings.langC) { - return Language.c; - } else if (value == strings.langObjC) { - return Language.objc; - } - return Language.c; -} - -bool languageValidator(List name, dynamic value) { - if (value is String) { - if (value == strings.langC) { - return true; - } - if (value == strings.langObjC) { - _logger.severe('Objective C support is EXPERIMENTAL. The API may change ' - 'in a breaking way without notice.'); - return true; - } - _logger.severe("'$name' must be one of the following - " - "{${strings.langC}, ${strings.langObjC}}"); - return false; - } - _logger.severe("Expected value of key '$name' to be a String."); - return false; -} - /// Returns true if [str] is not a full name. /// /// E.g `abc` is a full name, `abc.*` is not. bool isFullDeclarationName(String str) => quiver.matchesFull(RegExp('[a-zA-Z_0-9]*'), str); -Includer _extractIncluderFromYaml(dynamic yamlMap) { +Includer extractIncluderFromYaml(Map yamlMap) { final includeMatchers = [], includeFull = {}, excludeMatchers = [], excludeFull = {}; - final include = (yamlMap[strings.include] as YamlList?)?.cast(); + final include = yamlMap[strings.include] as List?; if (include != null) { if (include.isEmpty) { return Includer.excludeByDefault(); @@ -818,7 +471,7 @@ Includer _extractIncluderFromYaml(dynamic yamlMap) { } } - final exclude = (yamlMap[strings.exclude] as YamlList?)?.cast(); + final exclude = yamlMap[strings.exclude] as List?; if (exclude != null) { for (final str in exclude) { if (isFullDeclarationName(str)) { @@ -838,17 +491,17 @@ Includer _extractIncluderFromYaml(dynamic yamlMap) { } Map> varArgFunctionConfigExtractor( - dynamic yamlMap) { + Map yamlMap) { final result = >{}; - final configMap = (yamlMap as YamlMap); + final configMap = yamlMap; for (final key in configMap.keys) { final List vafuncs = []; - for (final rawVaFunc in (configMap[key] as YamlList)) { - if (rawVaFunc is YamlList) { + for (final rawVaFunc in (configMap[key] as List)) { + if (rawVaFunc is List) { vafuncs.add(RawVarArgFunction(null, rawVaFunc.cast())); - } else if (rawVaFunc is YamlMap) { + } else if (rawVaFunc is Map) { vafuncs.add(RawVarArgFunction(rawVaFunc[strings.postfix] as String?, - (rawVaFunc[strings.types] as YamlList).cast())); + (rawVaFunc[strings.types] as List).cast())); } else { throw Exception("Unexpected type in variadic-argument config."); } @@ -859,80 +512,21 @@ Map> varArgFunctionConfigExtractor( return result; } -bool varArgFunctionConfigValidator(List name, dynamic value) { - if (!checkType(name, value)) { - return false; - } - var result = true; - for (final key in (value as YamlMap).keys) { - final list = value[key as String]; - if (!checkType([...name, key], list)) { - result = false; - continue; - } - (list as YamlList).asMap().forEach((idx, subList) { - if (subList is YamlMap) { - if (!subList.containsKey(strings.types)) { - result = false; - _logger.severe('Missing required key - ${[ - ...name, - key, - idx.toString(), - strings.types - ].join(" -> ")}'); - } - subList.forEach((subkey, subvalue) { - subkey = subkey as String; - if (subkey == strings.postfix) { - if (!checkType( - [...name, key, idx.toString(), subkey], subvalue)) { - result = false; - } - } else if (subkey == strings.types) { - if (!checkType( - [...name, key, idx.toString(), subkey], subvalue)) { - result = false; - } - } else { - result = false; - _logger.severe('Unknown key - ${[ - ...name, - key, - idx.toString(), - subkey - ].join(" -> ")}'); - } - }); - } else if (subList is! YamlList) { - result = false; - _logger.severe('Expected ${[ - ...name, - key, - idx - ].join(" -> ")} to be a List or a Map.'); - } - }); - } - return result; -} - -Declaration declarationConfigExtractor(dynamic yamlMap) { +Declaration declarationConfigExtractor(Map yamlMap) { final renamePatterns = []; final renameFull = {}; final memberRenamePatterns = []; final memberRenamerFull = {}; - final includer = _extractIncluderFromYaml(yamlMap); + final includer = extractIncluderFromYaml(yamlMap); - Includer? symbolIncluder; - if (yamlMap[strings.symbolAddress] != null) { - symbolIncluder = _extractIncluderFromYaml(yamlMap[strings.symbolAddress]); - } + final symbolIncluder = yamlMap[strings.symbolAddress] as Includer?; - final rename = (yamlMap[strings.rename] as YamlMap?)?.cast(); + final rename = yamlMap[strings.rename] as Map?; if (rename != null) { - for (final str in rename.keys) { + for (final key in rename.keys) { + final str = key.toString(); if (isFullDeclarationName(str)) { renameFull[str] = rename[str]!; } else { @@ -943,20 +537,22 @@ Declaration declarationConfigExtractor(dynamic yamlMap) { } final memberRename = - (yamlMap[strings.memberRename] as YamlMap?)?.cast(); + yamlMap[strings.memberRename] as Map>?; if (memberRename != null) { - for (final decl in memberRename.keys) { + for (final key in memberRename.keys) { + final decl = key.toString(); final renamePatterns = []; final renameFull = {}; - final memberRenameMap = memberRename[decl]!.cast(); + final memberRenameMap = memberRename[decl]!; for (final member in memberRenameMap.keys) { - if (isFullDeclarationName(member)) { - renameFull[member] = memberRenameMap[member]!; + final memberStr = member.toString(); + if (isFullDeclarationName(memberStr)) { + renameFull[memberStr] = memberRenameMap[member]!; } else { renamePatterns.add(RegExpRenamer( - RegExp(member, dotAll: true), memberRenameMap[member]!)); + RegExp(memberStr, dotAll: true), memberRenameMap[member]!)); } } if (isFullDeclarationName(decl)) { @@ -992,294 +588,20 @@ Declaration declarationConfigExtractor(dynamic yamlMap) { ); } -bool declarationConfigValidator(List name, dynamic value) { - var result = true; - if (value is YamlMap) { - for (final key in value.keys) { - if (key == strings.include || key == strings.exclude) { - if (!checkType([...name, key as String], value[key])) { - result = false; - } - } else if (key == strings.rename) { - if (!checkType([...name, key as String], value[key])) { - result = false; - } else { - for (final subkey in (value[key] as YamlMap).keys) { - if (!checkType( - [...name, key, subkey as String], value[key][subkey])) { - result = false; - } - } - } - } else if (key == strings.memberRename) { - if (!checkType([...name, key as String], value[key])) { - result = false; - } else { - for (final declNameKey in (value[key] as YamlMap).keys) { - if (!checkType([...name, key, declNameKey as String], - value[key][declNameKey])) { - result = false; - } else { - for (final memberNameKey - in ((value[key] as YamlMap)[declNameKey] as YamlMap).keys) { - if (!checkType([ - ...name, - key, - declNameKey, - memberNameKey as String, - ], value[key][declNameKey][memberNameKey])) { - result = false; - } - } - } - } - } - } else if (key == strings.symbolAddress) { - if (!checkType([...name, key as String], value[key])) { - result = false; - } else { - for (final subkey in (value[key] as YamlMap).keys) { - if (subkey == strings.include || subkey == strings.exclude) { - if (!checkType( - [...name, key, subkey as String], value[key][subkey])) { - result = false; - } - } else { - _logger.severe("Unknown key '$subkey' in '$name -> $key'."); - result = false; - } - } - } - } - } - } else { - _logger.severe("Expected value '$name' to be a Map."); - result = false; - } - return result; -} - -Includer exposeFunctionTypeExtractor(dynamic value) => - _extractIncluderFromYaml(value); - -bool exposeFunctionTypeValidator(List name, dynamic value) { - var result = true; - - if (!checkType(name, value)) { - result = false; - } else { - final mp = value as YamlMap; - for (final key in mp.keys) { - if (key == strings.include || key == strings.exclude) { - if (!checkType([...name, key as String], value[key])) { - result = false; - } - } else { - _logger.severe("Unknown subkey '$key' in '$name'."); - result = false; - } - } - } - - return result; -} - -Includer leafFunctionExtractor(dynamic value) => - _extractIncluderFromYaml(value); - -bool leafFunctionValidator(List name, dynamic value) { - var result = true; - - if (!checkType(name, value)) { - result = false; - } else { - final mp = value as YamlMap; - for (final key in mp.keys) { - if (key == strings.include || key == strings.exclude) { - if (!checkType([...name, key as String], value[key])) { - result = false; - } - } else { - _logger.severe("Unknown subkey '$key' in '$name'."); - result = false; - } - } - } - - return result; -} - -SupportedNativeType nativeSupportedType(int value, {bool signed = true}) { - switch (value) { - case 1: - return signed ? SupportedNativeType.Int8 : SupportedNativeType.Uint8; - case 2: - return signed ? SupportedNativeType.Int16 : SupportedNativeType.Uint16; - case 4: - return signed ? SupportedNativeType.Int32 : SupportedNativeType.Uint32; - case 8: - return signed ? SupportedNativeType.Int64 : SupportedNativeType.Uint64; - default: - throw Exception( - 'Unsupported value given to sizemap, Allowed values for sizes are: 1, 2, 4, 8'); - } -} - -String stringExtractor(dynamic value) => value as String; - -bool nonEmptyStringValidator(List name, dynamic value) { - if (value is String && value.isNotEmpty) { - return true; - } else { - _logger.severe("Expected value of key '$name' to be a non-empty String."); - return false; - } -} - -bool dartClassNameValidator(List name, dynamic value) { - if (value is String && - quiver.matchesFull(RegExp('[a-zA-Z]+[_a-zA-Z0-9]*'), value)) { - return true; - } else { - _logger.severe( - "Expected value of key '$name' to be a valid public class name."); - return false; - } -} - -CommentType commentExtractor(dynamic value) { - if (value is bool) { - if (value) { - return CommentType.def(); - } else { - return CommentType.none(); - } - } - final ct = CommentType.def(); - if (value is YamlMap) { - for (final key in value.keys) { - if (key == strings.style) { - if (value[key] == strings.any) { - ct.style = CommentStyle.any; - } else if (value[key] == strings.doxygen) { - ct.style = CommentStyle.doxygen; - } - } else if (key == strings.length) { - if (value[key] == strings.full) { - ct.length = CommentLength.full; - } else if (value[key] == strings.brief) { - ct.length = CommentLength.brief; - } - } - } - } - return ct; -} - -bool commentValidator(List name, dynamic value) { - if (value is bool) { - return true; - } else if (value is YamlMap) { - var result = true; - for (final key in value.keys) { - if (key == strings.style) { - if (value[key] is! String || - !(value[key] == strings.doxygen || value[key] == strings.any)) { - _logger.severe( - "'$name'>'${strings.style}' must be one of the following - {${strings.doxygen}, ${strings.any}}"); - result = false; - } - } else if (key == strings.length) { - if (value[key] is! String || - !(value[key] == strings.brief || value[key] == strings.full)) { - _logger.severe( - "'$name'>'${strings.length}' must be one of the following - {${strings.brief}, ${strings.full}}"); - result = false; - } - } else { - _logger.severe("Unknown key '$key' in '$name'."); - result = false; - } - } - return result; - } else { - _logger.severe("Expected value of key '$name' to be a bool or a Map."); - return false; - } -} - -CompoundDependencies dependencyOnlyExtractor(dynamic value) { - var result = CompoundDependencies.full; - if (value == strings.opaqueCompoundDependencies) { - result = CompoundDependencies.opaque; - } - return result; -} - -bool dependencyOnlyValidator(List name, dynamic value) { - var result = true; - if (value is! String || - !(value == strings.fullCompoundDependencies || - value == strings.opaqueCompoundDependencies)) { - _logger.severe( - "'$name' must be one of the following - {${strings.fullCompoundDependencies}, ${strings.opaqueCompoundDependencies}}"); - result = false; - } - return result; -} - -StructPackingOverride structPackingOverrideExtractor(dynamic value) { +StructPackingOverride structPackingOverrideExtractor( + Map value) { final matcherMap = {}; - for (final key in (value as YamlMap).keys) { + for (final key in value.keys) { matcherMap[RegExp(key as String, dotAll: true)] = strings.packingValuesMap[value[key]]; } return StructPackingOverride(matcherMap: matcherMap); } -bool structPackingOverrideValidator(List name, dynamic value) { - var result = true; - - if (!checkType([...name], value)) { - result = false; - } else { - for (final key in (value as YamlMap).keys) { - if (!(strings.packingValuesMap.keys.contains(value[key]))) { - _logger.severe( - "'$name -> $key' must be one of the following - ${strings.packingValuesMap.keys.toList()}"); - result = false; - } - } - } - - return result; -} - FfiNativeConfig ffiNativeExtractor(dynamic yamlConfig) { - final yamlMap = yamlConfig as YamlMap?; + final yamlMap = yamlConfig as Map?; return FfiNativeConfig( enabled: true, asset: yamlMap?[strings.ffiNativeAsset] as String?, ); } - -bool ffiNativeValidator(List name, dynamic yamlConfig) { - if (!checkType(name, yamlConfig)) { - return false; - } - if (yamlConfig == null) { - // Empty means no asset name. - return true; - } - for (final key in (yamlConfig as YamlMap).keys) { - if (!checkType([...name, key as String], yamlConfig[key])) { - return false; - } - if (key != strings.ffiNativeAsset) { - _logger.severe("'$name -> $key' must be one of the following - ${[ - strings.ffiNativeAsset - ]}"); - } - } - return true; -} diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index c7d6e2f400..a2217b4365 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -2593,7 +2593,9 @@ abstract class CXChildVisitResult { /// The visitor should return one of the \c CXChildVisitResult values /// to direct clang_visitCursorChildren(). typedef CXCursorVisitor = ffi.Pointer< - ffi.NativeFunction>; + ffi.NativeFunction< + ffi.Int32 Function( + CXCursor cursor, CXCursor parent, CXClientData client_data)>>; /// Opaque pointer representing client data that will be passed through /// to various callbacks and visitors. diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 245dd7c472..7613289a9a 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -277,3 +277,7 @@ String get tmpDir { _tmpDir ??= Directory.systemTemp.createTempSync(); return _tmpDir!.path; } + +const ffigenJsonSchemaIndent = ' '; +const ffigenJsonSchemaId = "https://json.schemastore.org/ffigen"; +const ffigenJsonSchemaFileName = "ffigen.schema.json"; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index c8fad030bb..68a0862842 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 8.0.2 +version: 9.0.0 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen @@ -24,10 +24,11 @@ dependencies: logging: ^1.0.0 cli_util: ^0.4.0 glob: ^2.0.0 - file: ^6.0.0 + file: ^7.0.0 package_config: ^2.1.0 yaml_edit: ^2.0.3 dev_dependencies: lints: ^2.0.1 test: ^1.16.2 + json_schema: ^5.1.1 diff --git a/pkgs/ffigen/test/config_tests/json_schema_test.dart b/pkgs/ffigen/test/config_tests/json_schema_test.dart new file mode 100644 index 0000000000..44ea1e7884 --- /dev/null +++ b/pkgs/ffigen/test/config_tests/json_schema_test.dart @@ -0,0 +1,89 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:convert'; +import 'dart:io'; + +import 'package:ffigen/ffigen.dart'; +import 'package:ffigen/src/strings.dart' as strings; +import 'package:file/local.dart'; +import 'package:glob/glob.dart'; +import 'package:json_schema/json_schema.dart'; +import 'package:test/test.dart'; +import 'package:yaml/yaml.dart'; + +late Library actual, expected; + +void main() { + group('json_schema_test', () { + final schema = Config.getsRootConfigSpec() + .generateJsonSchema(strings.ffigenJsonSchemaId); + + test('Schema Changes', () { + final actualJsonSchema = + JsonEncoder.withIndent(strings.ffigenJsonSchemaIndent).convert( + Config.getsRootConfigSpec() + .generateJsonSchema(strings.ffigenJsonSchemaId), + ); + final expectedJsonSchema = File(strings.ffigenJsonSchemaFileName) + .readAsStringSync() + .replaceAll('\r\n', '\n'); + expect(actualJsonSchema, expectedJsonSchema); + }); + + final jsonSchema = JsonSchema.create(schema); + test('Valid json schema', () { + expect(jsonSchema, isNot(null)); + }); + + // Find all ffigen config files in the repo. + final configYamlGlob = Glob("**config.yaml"); + final configYamlFiles = + configYamlGlob.listFileSystemSync(const LocalFileSystem()); + test('$configYamlGlob files not empty', () { + expect(configYamlFiles.isNotEmpty, true); + }); + + final sharedBindingsConfigYamlGlob = + Glob("example/shared_bindings/ffigen_configs/**.yaml"); + final sharedBindingsConfigYamlFiles = sharedBindingsConfigYamlGlob + .listFileSystemSync(const LocalFileSystem()); + test('$sharedBindingsConfigYamlGlob files not emty', () { + expect(sharedBindingsConfigYamlFiles.isNotEmpty, true); + }); + + final allConfigFiles = configYamlFiles + sharedBindingsConfigYamlFiles; + + for (final fe in allConfigFiles) { + test('validate config file: ${fe.path}', () { + final yamlDoc = loadYaml(File(fe.absolute.path).readAsStringSync()); + final validationResult = jsonSchema.validate(yamlDoc); + expect(validationResult.errors.isEmpty, true, + reason: "Schema Errors: ${validationResult.errors}"); + expect(validationResult.warnings.isEmpty, true, + reason: "Schema Warnings: ${validationResult.errors}"); + }); + } + + test('Bare minimal input', () { + expect( + jsonSchema + .validate({ + "output": "abcd.dart", + "headers": { + "entry-points": ["a.h"] + } + }) + .errors + .isEmpty, + true); + }); + test('Fail input', () { + expect(jsonSchema.validate(null).errors.isNotEmpty, true); + expect(jsonSchema.validate({"a": 1}).errors.isNotEmpty, true); + expect( + jsonSchema.validate({"output": "abcd.dart"}).errors.isNotEmpty, true); + }); + }); +} diff --git a/pkgs/ffigen/test/config_tests/unknown_keys_warn_test.dart b/pkgs/ffigen/test/config_tests/unknown_keys_warn_test.dart index 3dd04517f2..6f80757fc0 100644 --- a/pkgs/ffigen/test/config_tests/unknown_keys_warn_test.dart +++ b/pkgs/ffigen/test/config_tests/unknown_keys_warn_test.dart @@ -28,12 +28,6 @@ ${strings.headers}: ${strings.typeMap}: 'warn-2': 'warn' 'warn-3': 'warn' -${strings.functions}: - 'warn-4': 'skip' -${strings.structs}: - 'warn-5': 'skip' -${strings.unions}: - 'warn-6': 'skip' '''); logString = logArr.join("\n"); }); @@ -42,10 +36,5 @@ ${strings.unions}: expect(logString.contains('warn-2'), true); expect(logString.contains('warn-3'), true); }); - test('Do not warn for unknown keys in declarations.', () { - expect(logString.contains('warn-4'), false); - expect(logString.contains('warn-5'), false); - expect(logString.contains('warn-6'), false); - }); }); } diff --git a/pkgs/ffigen/tool/generate_json_schema.dart b/pkgs/ffigen/tool/generate_json_schema.dart new file mode 100644 index 0000000000..7a5a030c7b --- /dev/null +++ b/pkgs/ffigen/tool/generate_json_schema.dart @@ -0,0 +1,28 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// ================== GENERATING JSON SCHEMA ===================== +// cd to project's root, and run - +// dart generate_json_schema.dart +// =============================================================== +import 'dart:convert'; +import 'dart:io'; + +import 'package:ffigen/ffigen.dart'; +import 'package:ffigen/src/strings.dart' as strings; + +void main() async { + final actualJsonSchema = + JsonEncoder.withIndent(strings.ffigenJsonSchemaIndent).convert( + Config.getsRootConfigSpec().generateJsonSchema(strings.ffigenJsonSchemaId), + ); + + final file = File(strings.ffigenJsonSchemaFileName); + if (!await file.exists()) { + throw Exception("File '${file.absolute.path}' does not exist."); + } + await file.writeAsString(actualJsonSchema); + + print("Generated json schema: ${file.absolute.path}"); +} diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index 6ac924f7a9..f0f9b3bebb 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -9,6 +9,8 @@ # dart run ffigen --config tool/libclang_config.yaml # =============================================================== +# yaml-language-server: $schema=../ffigen.schema.json + name: Clang description: Holds bindings to LibClang. output: '../lib/src/header_parser/clang_bindings/clang_bindings.dart' From cc604f91b0c9d296c519d34dc4d7298a5c93ecfc Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 24 Jul 2023 17:20:36 +0530 Subject: [PATCH 246/276] =?UTF-8?q?[ffigen]=20Fix=20doc=20comment=20missin?= =?UTF-8?q?g=20on=20struct/union=20array=20fields,=20update=20test,=20ve?= =?UTF-8?q?=E2=80=A6=20(#593)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/ffigen/CHANGELOG.md | 4 ++++ pkgs/ffigen/lib/src/code_generator/compound.dart | 10 +++++----- .../header_parser/sub_parsers/functiondecl_parser.dart | 4 ++-- pkgs/ffigen/pubspec.yaml | 2 +- pkgs/ffigen/test/header_parser_tests/comment_markup.h | 3 +++ .../_expected_comment_markup_bindings.dart | 4 ++++ 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index c6919af9c9..1b70ff7579 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,7 @@ +# 9.0.1 + +- Fix doc comment missing on struct/union array fields. + # 9.0.0 - Added a JSON schema for FFIgen config files. diff --git a/pkgs/ffigen/lib/src/code_generator/compound.dart b/pkgs/ffigen/lib/src/code_generator/compound.dart index 894d3799ed..db755826c9 100644 --- a/pkgs/ffigen/lib/src/code_generator/compound.dart +++ b/pkgs/ffigen/lib/src/code_generator/compound.dart @@ -134,17 +134,17 @@ abstract class Compound extends BindingType { const depth = ' '; for (final m in members) { m.name = localUniqueNamer.makeUnique(m.name); + if (m.dartDoc != null) { + s.write('$depth/// '); + s.writeAll(m.dartDoc!.split('\n'), '\n$depth/// '); + s.write('\n'); + } if (m.type is ConstantArray) { s.write('$depth@${w.ffiLibraryPrefix}.Array.multi('); s.write('${_getArrayDimensionLengths(m.type)})\n'); s.write('${depth}external ${_getInlineArrayTypeString(m.type, w)} '); s.write('${m.name};\n\n'); } else { - if (m.dartDoc != null) { - s.write('$depth/// '); - s.writeAll(m.dartDoc!.split('\n'), '\n$depth/// '); - s.write('\n'); - } if (!sameDartAndCType(m.type, w)) { s.write('$depth@${m.type.getCType(w)}()\n'); } diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index 94d5ed01b2..552a0d43d3 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -70,8 +70,8 @@ List? parseFunctionDeclaration(clang_types.CXCursor cursor) { // Initialized with a single value with no prefix and empty var args. var varArgFunctions = [VarArgFunction('', [])]; - if (clang.clang_isFunctionTypeVariadic(cursor.type()) == 1) { - if (config.varArgFunctions.containsKey(funcName)) { + if (config.varArgFunctions.containsKey(funcName)) { + if (clang.clang_isFunctionTypeVariadic(cursor.type()) == 1) { varArgFunctions = config.varArgFunctions[funcName]!; } else { _logger.warning( diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 68a0862842..3a8e0c15be 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 9.0.0 +version: 9.0.1 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen diff --git a/pkgs/ffigen/test/header_parser_tests/comment_markup.h b/pkgs/ffigen/test/header_parser_tests/comment_markup.h index b3912dabd4..635c2c3c37 100644 --- a/pkgs/ffigen/test/header_parser_tests/comment_markup.h +++ b/pkgs/ffigen/test/header_parser_tests/comment_markup.h @@ -23,4 +23,7 @@ struct Com4{ /* Single line field comment. */ float b; + + /* Comment on array member. */ + int c[3]; }; diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart index 0575478177..91d9908811 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart @@ -61,4 +61,8 @@ final class Com4 extends ffi.Struct { /// Single line field comment. @ffi.Float() external double b; + + /// Comment on array member. + @ffi.Array.multi([3]) + external ffi.Array c; } From ac1b0498ecc81ef4f358c4fc93c770c7ff07d9a6 Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Mon, 24 Jul 2023 17:55:11 +0530 Subject: [PATCH 247/276] [ffigen] Allow extern inline functions to be generated. (#594) --- pkgs/ffigen/CHANGELOG.md | 1 + .../clang_bindings/clang_bindings.dart | 31 +++++++++++++++++++ .../sub_parsers/functiondecl_parser.dart | 5 +-- .../_expected_functions_bindings.dart | 14 +++++++++ .../test/header_parser_tests/functions.h | 3 ++ pkgs/ffigen/tool/libclang_config.yaml | 1 + 6 files changed, 53 insertions(+), 2 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 1b70ff7579..b4bdf28741 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,6 +1,7 @@ # 9.0.1 - Fix doc comment missing on struct/union array fields. +- Allow extern inline functions to be generated. # 9.0.0 diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index a2217b4365..4c5fba22fa 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -948,6 +948,24 @@ class Clang { _clang_Cursor_isAnonymousRecordDeclPtr .asFunction(); + /// Returns the storage class for a function or variable declaration. + /// + /// 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_Cursor_getStorageClass( + arg0, + ); + } + + late final _clang_Cursor_getStorageClassPtr = + _lookup>( + 'clang_Cursor_getStorageClass'); + late final _clang_Cursor_getStorageClass = + _clang_Cursor_getStorageClassPtr.asFunction(); + /// Visit the children of a particular cursor. /// /// This function visits all the direct children of the given cursor, @@ -2564,6 +2582,19 @@ abstract class CXTypeLayoutError { static const int CXTypeLayoutError_Undeduced = -6; } +/// 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. /// diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index 552a0d43d3..f9d1121def 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -36,8 +36,9 @@ List? parseFunctionDeclaration(clang_types.CXCursor cursor) { final rt = _getFunctionReturnType(cursor); final parameters = _getParameters(cursor, funcName); - - if (clang.clang_Cursor_isFunctionInlined(cursor) != 0) { + if (clang.clang_Cursor_isFunctionInlined(cursor) != 0 && + clang.clang_Cursor_getStorageClass(cursor) != + clang_types.CX_StorageClass.CX_SC_Extern) { _logger.fine('---- Removed Function, reason: inline function: ' '${cursor.completeStringRepr()}'); _logger.warning( diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart index c4a01b3909..7475b09d3a 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart @@ -103,6 +103,20 @@ class NativeLibrary { void Function(ffi.Pointer, ffi.Pointer>)>(); + void externInlineFunc( + int a, + ) { + return _externInlineFunc( + a, + ); + } + + late final _externInlineFuncPtr = + _lookup>( + 'externInlineFunc'); + late final _externInlineFunc = + _externInlineFuncPtr.asFunction(); + int diffChars( int a, int b, diff --git a/pkgs/ffigen/test/header_parser_tests/functions.h b/pkgs/ffigen/test/header_parser_tests/functions.h index 28b8546358..9cf6a3b428 100644 --- a/pkgs/ffigen/test/header_parser_tests/functions.h +++ b/pkgs/ffigen/test/header_parser_tests/functions.h @@ -20,4 +20,7 @@ void func5(shortHand a, void(b)()); // Should be skipped as inline functions are not supported. static inline void inlineFunc(); +// Not skipped since it is extern. +extern inline void externInlineFunc(int a); + char diffChars(unsigned char a, signed char b); diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index f0f9b3bebb..b948e5ce1d 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -94,6 +94,7 @@ functions: - clang_getNumArgTypes - clang_getArgType - clang_isFunctionTypeVariadic + - clang_Cursor_getStorageClass - clang_getCursorResultType - clang_getEnumConstantDeclValue - clang_equalRanges From b5b238c9064026efd9094b6733e7634a11a34b6c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Aug 2023 23:10:18 +0000 Subject: [PATCH 248/276] [ffigen] Bump coverallsapp/github-action from 2.2.0 to 2.2.1 (#596) Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 2.2.0 to 2.2.1.
    Commits

    [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=coverallsapp/github-action&package-manager=github_actions&previous-version=2.2.0&new-version=2.2.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
    Dependabot commands and options
    You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    --- pkgs/ffigen/.github/workflows/test-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 9ee11ac803..df0d88a8ee 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -71,7 +71,7 @@ jobs: - name: Collect coverage run: ./tool/coverage.sh - name: Upload coverage - uses: coverallsapp/github-action@c7885c00cb7ec0b8f9f5ff3f53cddb980f7a4412 + uses: coverallsapp/github-action@95b1a2355bd0e526ad2fd62da9fd386ad4c98474 with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: lcov.info From 128d61ec00db888b5daa3de8655944cf4906ab6f Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Mon, 28 Aug 2023 18:07:02 -0700 Subject: [PATCH 249/276] [ffigen] Mention installing xcode command line tools on mac --- pkgs/ffigen/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 38c66e5363..61464fdea5 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -76,7 +76,8 @@ Jump to [FAQ](#faq). #### MacOS 1. Install Xcode. -2. Install LLVM - `brew install llvm`. +2. Install Xcode command line tools - `xcode-select --install`. +3. Install LLVM - `brew install llvm`. ## Configurations Configurations can be provided in 2 ways- From e0814e1abaf6aecbb8c0c828f46cc67fa876e2dc Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 30 Aug 2023 15:46:58 -0700 Subject: [PATCH 250/276] [ffigen] Listener/Async Blocks (#601) * First bits of async callback support * Listener blocks working * Bump package version and min SDK version * Bump SDK again * Fix analysis * Bump SDK version again * Daco's comments --- .../ffigen/.github/workflows/test-package.yml | 9 +- pkgs/ffigen/CHANGELOG.md | 6 + .../c_json/cjson_generated_bindings.dart | 55 +++--- pkgs/ffigen/example/c_json/pubspec.yaml | 2 +- pkgs/ffigen/example/ffinative/pubspec.yaml | 2 +- .../libclang-example/generated_bindings.dart | 28 +-- .../example/libclang-example/pubspec.yaml | 2 +- .../objective_c/avf_audio_bindings.dart | 177 ++++++++--------- pkgs/ffigen/example/objective_c/pubspec.yaml | 2 +- .../example/shared_bindings/pubspec.yaml | 2 +- .../example/simple/generated_bindings.dart | 5 +- pkgs/ffigen/example/simple/pubspec.yaml | 2 +- pkgs/ffigen/example/swift/pubspec.yaml | 2 +- .../example/swift/swift_api_bindings.dart | 86 +++++---- .../lib/src/code_generator/objc_block.dart | 35 +++- .../lib/src/config_provider/config_spec.dart | 2 +- .../clang_bindings/clang_bindings.dart | 6 +- pkgs/ffigen/pubspec.yaml | 8 +- .../_expected_boolean_dartbool_bindings.dart | 5 +- .../_expected_functions_bindings.dart | 5 +- ..._expected_struct_fptr_fields_bindings.dart | 6 +- .../_expected_cjson_bindings.dart | 55 +++--- .../_expected_libclang_bindings.dart | 50 ++--- .../_expected_sqlite_bindings.dart | 179 ++++++++++-------- .../test/native_objc_test/block_test.dart | 40 +++- .../ffigen/test/native_objc_test/block_test.m | 13 ++ 26 files changed, 452 insertions(+), 332 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index df0d88a8ee..134d7dfac4 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -19,7 +19,8 @@ jobs: strategy: fail-fast: false matrix: - sdk: [3.0.0] + # TODO: Change to 3.2.0 stable once it's released. + sdk: [3.2.0-114.0.dev] steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f @@ -44,7 +45,7 @@ jobs: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: - sdk: 3.0.0 + sdk: 3.2.0-114.0.dev - name: Install dependencies run: dart pub get - name: Install libclang-14-dev @@ -61,7 +62,7 @@ jobs: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: - sdk: 3.0.0 + sdk: 3.2.0-114.0.dev - name: Install dependencies run: dart pub get - name: Build test dylib and bindings @@ -83,7 +84,7 @@ jobs: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: - sdk: 3.0.0 + sdk: 3.2.0-114.0.dev - name: Install dependencies run: dart pub get - name: Build test dylib and bindings diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index b4bdf28741..7036a8c4bb 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,9 @@ +# 10.0.0-dev.0 + +- Add support for ObjC Blocks that can be invoked from any thread, using + NativeCallable.listener. +- Bump min SDK version to 3.2.0-114.0.dev. + # 9.0.1 - Fix doc comment missing on struct/union array fields. diff --git a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart index 0fb9e1aa88..fa9e56efaa 100644 --- a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart +++ b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart @@ -73,8 +73,9 @@ class CJson { } late final _cJSON_ParsePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('cJSON_Parse'); + ffi + .NativeFunction Function(ffi.Pointer)>>( + 'cJSON_Parse'); late final _cJSON_Parse = _cJSON_ParsePtr .asFunction Function(ffi.Pointer)>(); @@ -109,8 +110,9 @@ class CJson { } late final _cJSON_PrintPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('cJSON_Print'); + ffi + .NativeFunction Function(ffi.Pointer)>>( + 'cJSON_Print'); late final _cJSON_Print = _cJSON_PrintPtr .asFunction Function(ffi.Pointer)>(); @@ -123,9 +125,9 @@ class CJson { } late final _cJSON_PrintUnformattedPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('cJSON_PrintUnformatted'); + ffi + .NativeFunction Function(ffi.Pointer)>>( + 'cJSON_PrintUnformatted'); late final _cJSON_PrintUnformatted = _cJSON_PrintUnformattedPtr .asFunction Function(ffi.Pointer)>(); @@ -286,9 +288,9 @@ class CJson { } late final _cJSON_GetStringValuePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('cJSON_GetStringValue'); + ffi + .NativeFunction Function(ffi.Pointer)>>( + 'cJSON_GetStringValue'); late final _cJSON_GetStringValue = _cJSON_GetStringValuePtr .asFunction Function(ffi.Pointer)>(); @@ -499,9 +501,9 @@ class CJson { } late final _cJSON_CreateStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('cJSON_CreateString'); + ffi + .NativeFunction Function(ffi.Pointer)>>( + 'cJSON_CreateString'); late final _cJSON_CreateString = _cJSON_CreateStringPtr .asFunction Function(ffi.Pointer)>(); @@ -514,9 +516,9 @@ class CJson { } late final _cJSON_CreateRawPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('cJSON_CreateRaw'); + ffi + .NativeFunction Function(ffi.Pointer)>>( + 'cJSON_CreateRaw'); late final _cJSON_CreateRaw = _cJSON_CreateRawPtr .asFunction Function(ffi.Pointer)>(); @@ -549,9 +551,9 @@ class CJson { } late final _cJSON_CreateStringReferencePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('cJSON_CreateStringReference'); + ffi + .NativeFunction Function(ffi.Pointer)>>( + 'cJSON_CreateStringReference'); late final _cJSON_CreateStringReference = _cJSON_CreateStringReferencePtr .asFunction Function(ffi.Pointer)>(); @@ -1199,9 +1201,9 @@ class CJson { } late final _cJSON_SetNumberHelperPtr = _lookup< - ffi.NativeFunction< - ffi.Double Function( - ffi.Pointer, ffi.Double)>>('cJSON_SetNumberHelper'); + ffi + .NativeFunction, ffi.Double)>>( + 'cJSON_SetNumberHelper'); late final _cJSON_SetNumberHelper = _cJSON_SetNumberHelperPtr .asFunction, double)>(); @@ -1256,12 +1258,13 @@ final class cJSON extends ffi.Struct { } final class cJSON_Hooks extends ffi.Struct { - external ffi.Pointer< - ffi.NativeFunction Function(ffi.Size sz)>> + external ffi + .Pointer Function(ffi.Size sz)>> malloc_fn; - external ffi.Pointer< - ffi.NativeFunction ptr)>> free_fn; + external ffi + .Pointer ptr)>> + free_fn; } typedef cJSON_bool = ffi.Int; diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index 3301013586..c1277a898b 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -5,7 +5,7 @@ name: c_json_example environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ">=3.2.0-114.0.dev <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/ffinative/pubspec.yaml b/pkgs/ffigen/example/ffinative/pubspec.yaml index ef452f8110..7be76fc128 100644 --- a/pkgs/ffigen/example/ffinative/pubspec.yaml +++ b/pkgs/ffigen/example/ffinative/pubspec.yaml @@ -5,7 +5,7 @@ name: ffinative_example environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ">=3.2.0-114.0.dev <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index 64de33cb1e..fe7f3c4f7d 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -205,8 +205,8 @@ class LibClang { } late final _clang_CXIndex_setInvocationEmissionPathOptionPtr = _lookup< - ffi.NativeFunction< - NativeClang_CXIndex_setInvocationEmissionPathOption>>( + ffi + .NativeFunction>( 'clang_CXIndex_setInvocationEmissionPathOption'); late final _clang_CXIndex_setInvocationEmissionPathOption = _clang_CXIndex_setInvocationEmissionPathOptionPtr @@ -2938,8 +2938,8 @@ class LibClang { } late final _clang_Cursor_getTemplateArgumentUnsignedValuePtr = _lookup< - ffi.NativeFunction< - NativeClang_Cursor_getTemplateArgumentUnsignedValue>>( + ffi + .NativeFunction>( 'clang_Cursor_getTemplateArgumentUnsignedValue'); late final _clang_Cursor_getTemplateArgumentUnsignedValue = _clang_Cursor_getTemplateArgumentUnsignedValuePtr @@ -4849,8 +4849,8 @@ class LibClang { } late final _clang_CXXConstructor_isConvertingConstructorPtr = _lookup< - ffi.NativeFunction< - NativeClang_CXXConstructor_isConvertingConstructor>>( + ffi + .NativeFunction>( 'clang_CXXConstructor_isConvertingConstructor'); late final _clang_CXXConstructor_isConvertingConstructor = _clang_CXXConstructor_isConvertingConstructorPtr @@ -6850,8 +6850,8 @@ class _SymbolAddresses { get clang_CXIndex_getGlobalOptions => _library._clang_CXIndex_getGlobalOptionsPtr; ffi.Pointer< - ffi.NativeFunction< - NativeClang_CXIndex_setInvocationEmissionPathOption>> + ffi + .NativeFunction> get clang_CXIndex_setInvocationEmissionPathOption => _library._clang_CXIndex_setInvocationEmissionPathOptionPtr; ffi.Pointer> @@ -7148,8 +7148,8 @@ class _SymbolAddresses { get clang_Cursor_getTemplateArgumentValue => _library._clang_Cursor_getTemplateArgumentValuePtr; ffi.Pointer< - ffi.NativeFunction< - NativeClang_Cursor_getTemplateArgumentUnsignedValue>> + ffi + .NativeFunction> get clang_Cursor_getTemplateArgumentUnsignedValue => _library._clang_Cursor_getTemplateArgumentUnsignedValuePtr; ffi.Pointer> @@ -7406,8 +7406,8 @@ class _SymbolAddresses { get clang_Module_getTopLevelHeader => _library._clang_Module_getTopLevelHeaderPtr; ffi.Pointer< - ffi.NativeFunction< - NativeClang_CXXConstructor_isConvertingConstructor>> + ffi + .NativeFunction> get clang_CXXConstructor_isConvertingConstructor => _library._clang_CXXConstructor_isConvertingConstructorPtr; ffi.Pointer> @@ -11104,8 +11104,8 @@ typedef DartClang_indexLoc_getCXSourceLocation = CXSourceLocation Function( /// The visitor should return one of the \c CXVisitorResult values /// to direct \c clang_Type_visitFields. typedef CXFieldVisitor = ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function(CXCursor C, CXClientData client_data)>>; + ffi + .NativeFunction>; typedef NativeClang_Type_visitFields = ffi.UnsignedInt Function( CXType T, CXFieldVisitor visitor, CXClientData client_data); typedef DartClang_Type_visitFields = int Function( diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index 9d7e8ab856..a8ecc544b3 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -5,7 +5,7 @@ name: libclang_example environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ">=3.2.0-114.0.dev <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart index ae0d3fd941..eaa669d753 100644 --- a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart +++ b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart @@ -22381,8 +22381,8 @@ class AVFAudio { ffi.Pointer, ffi.Pointer, ffi.Pointer< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer)>>)>(); + ffi + .NativeFunction)>>)>(); late final _sel_descriptionFunction1 = _registerName1("descriptionFunction"); ffi.Pointer< @@ -22541,8 +22541,8 @@ class AVFAudio { ffi.Pointer Function( ffi.Pointer, ffi.Pointer< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer)>>, + ffi + .NativeFunction)>>, ffi.Bool)>> _objc_msgSend_803( ffi.Pointer obj, ffi.Pointer sel, @@ -22553,20 +22553,20 @@ class AVFAudio { ); } - late final __objc_msgSend_803Ptr = - _lookup< - ffi.NativeFunction< - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer< + late final __objc_msgSend_803Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi + .Pointer< ffi.NativeFunction< NSUInteger Function( ffi.Pointer)>>, - ffi.Bool)>> - Function(ffi.Pointer, ffi.Pointer)>>( - 'objc_msgSend'); + ffi.Bool)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); late final __objc_msgSend_803 = __objc_msgSend_803Ptr.asFunction< ffi.Pointer< ffi.NativeFunction< @@ -36092,16 +36092,17 @@ class ObjCBlock4 extends _ObjCBlockBase { NSUInteger arg1, ffi.Pointer arg2)>> ptr) : this._( - lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSUInteger arg1, - ffi.Pointer arg2)>( - _ObjCBlock4_fnPtrTrampoline, false) - .cast(), - ptr.cast()), + lib + ._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>( + _ObjCBlock4_fnPtrTrampoline, false) + .cast(), + ptr.cast()), lib); /// Creates a block from a Dart function. @@ -40641,8 +40642,8 @@ class ObjCBlock15 extends _ObjCBlockBase { ObjCBlock15.fromFunctionPointer( AVFAudio lib, ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> + ffi + .NativeFunction arg0)>> ptr) : this._( lib._newBlock1( @@ -43044,8 +43045,8 @@ class ObjCBlock16 extends _ObjCBlockBase { void call() { return _id.ref.invoke .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block)>>() + ffi + .NativeFunction block)>>() .asFunction block)>()(_id); } @@ -44324,8 +44325,8 @@ class ObjCBlock17 extends _ObjCBlockBase { ObjCBlock17.fromFunctionPointer( AVFAudio lib, ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> + ffi + .NativeFunction arg0)>> ptr) : this._( lib._newBlock1( @@ -47403,15 +47404,16 @@ class ObjCBlock19 extends _ObjCBlockBase { ffi.Pointer arg1)>> ptr) : this._( - lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock19_fnPtrTrampoline) - .cast(), - ptr.cast()), + lib + ._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock19_fnPtrTrampoline) + .cast(), + ptr.cast()), lib); /// Creates a block from a Dart function. @@ -47560,7 +47562,8 @@ class ObjCBlock21 extends _ObjCBlockBase { ObjCBlock21.fromFunctionPointer( AVFAudio lib, ffi.Pointer< - ffi.NativeFunction< + ffi + .NativeFunction< ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, ffi.Pointer arg2)>> ptr) @@ -47654,15 +47657,16 @@ class ObjCBlock22 extends _ObjCBlockBase { ffi.Pointer arg1)>> ptr) : this._( - lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock22_fnPtrTrampoline) - .cast(), - ptr.cast()), + lib + ._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock22_fnPtrTrampoline) + .cast(), + ptr.cast()), lib); /// Creates a block from a Dart function. @@ -47811,15 +47815,16 @@ class ObjCBlock24 extends _ObjCBlockBase { ffi.Pointer arg1)>> ptr) : this._( - lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock24_fnPtrTrampoline) - .cast(), - ptr.cast()), + lib + ._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock24_fnPtrTrampoline) + .cast(), + ptr.cast()), lib); /// Creates a block from a Dart function. @@ -53644,8 +53649,8 @@ class ObjCBlock29 extends _ObjCBlockBase { ObjCBlock29.fromFunctionPointer( AVFAudio lib, ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> + ffi + .NativeFunction arg0)>> ptr) : this._( lib._newBlock1( @@ -55582,8 +55587,8 @@ class ObjCBlock30 extends _ObjCBlockBase { ObjCBlock30.fromFunctionPointer( AVFAudio lib, ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> + ffi + .NativeFunction arg0)>> ptr) : this._( lib._newBlock1( @@ -57065,8 +57070,8 @@ class NSPointerFunctions extends NSObject { ffi.Pointer Function( ffi.Pointer, ffi.Pointer< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer)>>, + ffi + .NativeFunction)>>, ffi.Bool)>> get acquireFunction { return _lib._objc_msgSend_803(_id, _lib._sel_acquireFunction1); } @@ -58822,8 +58827,8 @@ class ObjCBlock33 extends _ObjCBlockBase { ObjCBlock33.fromFunctionPointer( AVFAudio lib, ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> + ffi + .NativeFunction arg0)>> ptr) : this._( lib._newBlock1( @@ -59834,8 +59839,8 @@ class ObjCBlock35 extends _ObjCBlockBase { ObjCBlock35.fromFunctionPointer( AVFAudio lib, ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> + ffi + .NativeFunction arg0)>> ptr) : this._( lib._newBlock1( @@ -59902,8 +59907,8 @@ class ObjCBlock36 extends _ObjCBlockBase { ObjCBlock36.fromFunctionPointer( AVFAudio lib, ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> + ffi + .NativeFunction arg0)>> ptr) : this._( lib._newBlock1( @@ -62217,8 +62222,8 @@ class ObjCBlock38 extends _ObjCBlockBase { ObjCBlock38.fromFunctionPointer( AVFAudio lib, ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> + ffi + .NativeFunction arg0)>> ptr) : this._( lib._newBlock1( @@ -62442,7 +62447,8 @@ class ObjCBlock39 extends _ObjCBlockBase { ObjCBlock39.fromFunctionPointer( AVFAudio lib, ffi.Pointer< - ffi.NativeFunction< + ffi + .NativeFunction< ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, ffi.Pointer arg2)>> ptr) @@ -63106,15 +63112,16 @@ class ObjCBlock40 extends _ObjCBlockBase { ffi.Pointer arg1)>> ptr) : this._( - lib._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock40_fnPtrTrampoline) - .cast(), - ptr.cast()), + lib + ._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock40_fnPtrTrampoline) + .cast(), + ptr.cast()), lib); /// Creates a block from a Dart function. @@ -63770,8 +63777,8 @@ class ObjCBlock43 extends _ObjCBlockBase { ObjCBlock43.fromFunctionPointer( AVFAudio lib, ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> + ffi + .NativeFunction arg0)>> ptr) : this._( lib._newBlock1( diff --git a/pkgs/ffigen/example/objective_c/pubspec.yaml b/pkgs/ffigen/example/objective_c/pubspec.yaml index 4cedaa343c..c06b7a0ab1 100644 --- a/pkgs/ffigen/example/objective_c/pubspec.yaml +++ b/pkgs/ffigen/example/objective_c/pubspec.yaml @@ -5,7 +5,7 @@ name: objective_c_example environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ">=3.2.0-114.0.dev <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/shared_bindings/pubspec.yaml b/pkgs/ffigen/example/shared_bindings/pubspec.yaml index 2f270f1029..23008d23ac 100644 --- a/pkgs/ffigen/example/shared_bindings/pubspec.yaml +++ b/pkgs/ffigen/example/shared_bindings/pubspec.yaml @@ -5,7 +5,7 @@ name: shared_bindings environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ">=3.2.0-114.0.dev <4.0.0" dependencies: cli_util: ^0.4.0 diff --git a/pkgs/ffigen/example/simple/generated_bindings.dart b/pkgs/ffigen/example/simple/generated_bindings.dart index 71f0414a8f..b26a8ac7a7 100644 --- a/pkgs/ffigen/example/simple/generated_bindings.dart +++ b/pkgs/ffigen/example/simple/generated_bindings.dart @@ -81,8 +81,9 @@ class NativeLibrary { } late final _dividePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Int, ffi.Int)>>('divide'); + ffi + .NativeFunction Function(ffi.Int, ffi.Int)>>( + 'divide'); late final _divide = _dividePtr.asFunction Function(int, int)>(); diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index ea4357279b..bef37902c4 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -5,7 +5,7 @@ name: simple_example environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ">=3.2.0-114.0.dev <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/swift/pubspec.yaml b/pkgs/ffigen/example/swift/pubspec.yaml index 07d93ebaf3..de19bf2467 100644 --- a/pkgs/ffigen/example/swift/pubspec.yaml +++ b/pkgs/ffigen/example/swift/pubspec.yaml @@ -5,7 +5,7 @@ name: swift_example environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ">=3.2.0-42.1.beta <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/swift/swift_api_bindings.dart b/pkgs/ffigen/example/swift/swift_api_bindings.dart index f741f7fa45..2a8783aa26 100644 --- a/pkgs/ffigen/example/swift/swift_api_bindings.dart +++ b/pkgs/ffigen/example/swift/swift_api_bindings.dart @@ -22386,8 +22386,8 @@ class SwiftLibrary { ffi.Pointer, ffi.Pointer, ffi.Pointer< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer)>>)>(); + ffi + .NativeFunction)>>)>(); late final _sel_descriptionFunction1 = _registerName1("descriptionFunction"); ffi.Pointer< @@ -22546,8 +22546,8 @@ class SwiftLibrary { ffi.Pointer Function( ffi.Pointer, ffi.Pointer< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer)>>, + ffi + .NativeFunction)>>, ffi.Bool)>> _objc_msgSend_803( ffi.Pointer obj, ffi.Pointer sel, @@ -22558,20 +22558,20 @@ class SwiftLibrary { ); } - late final __objc_msgSend_803Ptr = - _lookup< - ffi.NativeFunction< - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer< + late final __objc_msgSend_803Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi + .Pointer< ffi.NativeFunction< NSUInteger Function( ffi.Pointer)>>, - ffi.Bool)>> - Function(ffi.Pointer, ffi.Pointer)>>( - 'objc_msgSend'); + ffi.Bool)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); late final __objc_msgSend_803 = __objc_msgSend_803Ptr.asFunction< ffi.Pointer< ffi.NativeFunction< @@ -34838,7 +34838,11 @@ class ObjCBlock4 extends _ObjCBlockBase { /// Creates a block from a C function pointer. ObjCBlock4.fromFunctionPointer( SwiftLibrary lib, - ffi.Pointer arg0, NSUInteger arg1, ffi.Pointer arg2)>> + ffi.Pointer< + ffi + .NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + NSUInteger arg1, ffi.Pointer arg2)>> ptr) : this._( lib._newBlock1( @@ -39398,8 +39402,8 @@ class ObjCBlock15 extends _ObjCBlockBase { ObjCBlock15.fromFunctionPointer( SwiftLibrary lib, ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> + ffi + .NativeFunction arg0)>> ptr) : this._( lib._newBlock1( @@ -41807,8 +41811,8 @@ class ObjCBlock16 extends _ObjCBlockBase { void call() { return _id.ref.invoke .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block)>>() + ffi + .NativeFunction block)>>() .asFunction block)>()(_id); } @@ -43090,8 +43094,8 @@ class ObjCBlock17 extends _ObjCBlockBase { ObjCBlock17.fromFunctionPointer( SwiftLibrary lib, ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> + ffi + .NativeFunction arg0)>> ptr) : this._( lib._newBlock1( @@ -46332,7 +46336,8 @@ class ObjCBlock21 extends _ObjCBlockBase { ObjCBlock21.fromFunctionPointer( SwiftLibrary lib, ffi.Pointer< - ffi.NativeFunction< + ffi + .NativeFunction< ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, ffi.Pointer arg2)>> ptr) @@ -52432,8 +52437,8 @@ class ObjCBlock29 extends _ObjCBlockBase { ObjCBlock29.fromFunctionPointer( SwiftLibrary lib, ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> + ffi + .NativeFunction arg0)>> ptr) : this._( lib._newBlock1( @@ -54371,8 +54376,8 @@ class ObjCBlock30 extends _ObjCBlockBase { ObjCBlock30.fromFunctionPointer( SwiftLibrary lib, ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> + ffi + .NativeFunction arg0)>> ptr) : this._( lib._newBlock1( @@ -55856,8 +55861,8 @@ class NSPointerFunctions extends NSObject { ffi.Pointer Function( ffi.Pointer, ffi.Pointer< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer)>>, + ffi + .NativeFunction)>>, ffi.Bool)>> get acquireFunction { return _lib._objc_msgSend_803(_id, _lib._sel_acquireFunction1); } @@ -57616,8 +57621,8 @@ class ObjCBlock33 extends _ObjCBlockBase { ObjCBlock33.fromFunctionPointer( SwiftLibrary lib, ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> + ffi + .NativeFunction arg0)>> ptr) : this._( lib._newBlock1( @@ -58632,8 +58637,8 @@ class ObjCBlock35 extends _ObjCBlockBase { ObjCBlock35.fromFunctionPointer( SwiftLibrary lib, ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> + ffi + .NativeFunction arg0)>> ptr) : this._( lib._newBlock1( @@ -58700,8 +58705,8 @@ class ObjCBlock36 extends _ObjCBlockBase { ObjCBlock36.fromFunctionPointer( SwiftLibrary lib, ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> + ffi + .NativeFunction arg0)>> ptr) : this._( lib._newBlock1( @@ -61015,8 +61020,8 @@ class ObjCBlock38 extends _ObjCBlockBase { ObjCBlock38.fromFunctionPointer( SwiftLibrary lib, ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> + ffi + .NativeFunction arg0)>> ptr) : this._( lib._newBlock1( @@ -61240,7 +61245,8 @@ class ObjCBlock39 extends _ObjCBlockBase { ObjCBlock39.fromFunctionPointer( SwiftLibrary lib, ffi.Pointer< - ffi.NativeFunction< + ffi + .NativeFunction< ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, ffi.Pointer arg2)>> ptr) @@ -62568,8 +62574,8 @@ class ObjCBlock43 extends _ObjCBlockBase { ObjCBlock43.fromFunctionPointer( SwiftLibrary lib, ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> + ffi + .NativeFunction arg0)>> ptr) : this._( lib._newBlock1( diff --git a/pkgs/ffigen/lib/src/code_generator/objc_block.dart b/pkgs/ffigen/lib/src/code_generator/objc_block.dart index 1599748c84..883acd731d 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_block.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_block.dart @@ -35,7 +35,7 @@ class ObjCBlock extends BindingType { params.add(Parameter(name: 'arg$i', type: argTypes[i])); } - final isVoid = returnType == NativeType(SupportedNativeType.Void); + final isVoid = returnType == voidType; final voidPtr = PointerType(voidType).getCType(w); final blockPtr = PointerType(builtInFunctions.blockStruct); final funcType = FunctionType(returnType: returnType, parameters: params); @@ -55,6 +55,8 @@ class ObjCBlock extends BindingType { returnType: returnType, parameters: [Parameter(type: blockPtr, name: 'block'), ...params]); final natTrampFnType = NativeFunc(trampFuncType); + final nativeCallableType = + '${w.ffiLibraryPrefix}.NativeCallable<${trampFuncType.getCType(w)}>'; // Write the function pointer based trampoline function. s.write(returnType.getDartType(w)); @@ -107,6 +109,10 @@ class $name extends _ObjCBlockBase { super._(id, lib, retain: false, release: true); /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. $name.fromFunctionPointer(${w.className} lib, $natFnPtr ptr) : this._(lib.${builtInFunctions.newBlock.name}( _cFuncTrampoline ??= ${w.ffiLibraryPrefix}.Pointer.fromFunction< @@ -115,13 +121,40 @@ class $name extends _ObjCBlockBase { static $voidPtr? _cFuncTrampoline; /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. $name.fromFunction(${w.className} lib, ${funcType.getDartType(w)} fn) : this._(lib.${builtInFunctions.newBlock.name}( _dartFuncTrampoline ??= ${w.ffiLibraryPrefix}.Pointer.fromFunction< ${trampFuncType.getCType(w)}>($closureTrampoline $exceptionalReturn).cast(), $registerClosure(fn)), lib); static $voidPtr? _dartFuncTrampoline; + +'''); + + // Listener block constructor is only available for void blocks. + if (isVoid) { + s.write(''' + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + $name.listener(${w.className} lib, ${funcType.getDartType(w)} fn) : + this._(lib.${builtInFunctions.newBlock.name}( + (_dartFuncListenerTrampoline ??= $nativeCallableType.listener($closureTrampoline + $exceptionalReturn)..keepIsolateAlive = false).nativeFunction.cast(), + $registerClosure(fn)), lib); + static $nativeCallableType? _dartFuncListenerTrampoline; + '''); + } // Call method. s.write(' ${returnType.getDartType(w)} call('); diff --git a/pkgs/ffigen/lib/src/config_provider/config_spec.dart b/pkgs/ffigen/lib/src/config_provider/config_spec.dart index 3ad3249168..c7ed4061de 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_spec.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_spec.dart @@ -591,7 +591,7 @@ class StringConfigSpec extends ConfigSpec { if (!o.checkType(log: log)) { return false; } - if (_regexp != null && !_regexp!.hasMatch(o.value as String)) { + if (_regexp != null && !_regexp.hasMatch(o.value as String)) { if (log) { _logger.severe( "Expected value of key '${o.pathString}' to match pattern $pattern (Input - ${o.value})."); diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 4c5fba22fa..fc5ca177ae 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -1097,9 +1097,9 @@ class Clang { } late final _clang_Cursor_getObjCPropertyAttributesPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedInt Function(CXCursor, - ffi.UnsignedInt)>>('clang_Cursor_getObjCPropertyAttributes'); + ffi + .NativeFunction>( + 'clang_Cursor_getObjCPropertyAttributes'); late final _clang_Cursor_getObjCPropertyAttributes = _clang_Cursor_getObjCPropertyAttributesPtr .asFunction(); diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 3a8e0c15be..ae45a104d7 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,8 +3,10 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 9.0.1 -description: Generator for FFI bindings, using LibClang to parse C header files. +version: 10.0.0-dev.0 +description: > + Generator for FFI bindings, using LibClang to parse C, Objective-C, and Swift + files. repository: https://github.com/dart-lang/ffigen topics: @@ -13,7 +15,7 @@ topics: - codegen environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ">=3.2.0-114.0.dev <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart index 015821ea28..ff7dc120a3 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart @@ -29,8 +29,9 @@ class Bindings { } late final _test1Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Bool, ffi.Pointer)>>('test1'); + ffi + .NativeFunction)>>( + 'test1'); late final _test1 = _test1Ptr.asFunction)>(); } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart index 7475b09d3a..7b6682c465 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart @@ -128,8 +128,9 @@ class NativeLibrary { } late final _diffCharsPtr = _lookup< - ffi.NativeFunction< - ffi.Char Function(ffi.UnsignedChar, ffi.SignedChar)>>('diffChars'); + ffi + .NativeFunction>( + 'diffChars'); late final _diffChars = _diffCharsPtr.asFunction(); late final addresses = _SymbolAddresses(this); diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_struct_fptr_fields_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_struct_fptr_fields_bindings.dart index 2b2fe8a3ab..2a769db26e 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_struct_fptr_fields_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_struct_fptr_fields_bindings.dart @@ -8,7 +8,7 @@ final class S extends ffi.Struct { external ffi.Pointer> func1; external ffi - .Pointer> + .Pointer> comparator; external ffi.Pointer< @@ -53,8 +53,8 @@ final class S extends ffi.Struct { @ffi.Array.multi([2]) external ffi.Array< - ffi.Pointer< - ffi.NativeFunction>> + ffi + .Pointer>> manyFunctions; external ffi.Pointer< diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart index b93c74f1a2..f4edb598ec 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart @@ -54,8 +54,9 @@ class CJson { } late final _cJSON_ParsePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('cJSON_Parse'); + ffi + .NativeFunction Function(ffi.Pointer)>>( + 'cJSON_Parse'); late final _cJSON_Parse = _cJSON_ParsePtr .asFunction Function(ffi.Pointer)>(); @@ -90,8 +91,9 @@ class CJson { } late final _cJSON_PrintPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('cJSON_Print'); + ffi + .NativeFunction Function(ffi.Pointer)>>( + 'cJSON_Print'); late final _cJSON_Print = _cJSON_PrintPtr .asFunction Function(ffi.Pointer)>(); @@ -104,9 +106,9 @@ class CJson { } late final _cJSON_PrintUnformattedPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('cJSON_PrintUnformatted'); + ffi + .NativeFunction Function(ffi.Pointer)>>( + 'cJSON_PrintUnformatted'); late final _cJSON_PrintUnformatted = _cJSON_PrintUnformattedPtr .asFunction Function(ffi.Pointer)>(); @@ -267,9 +269,9 @@ class CJson { } late final _cJSON_GetStringValuePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('cJSON_GetStringValue'); + ffi + .NativeFunction Function(ffi.Pointer)>>( + 'cJSON_GetStringValue'); late final _cJSON_GetStringValue = _cJSON_GetStringValuePtr .asFunction Function(ffi.Pointer)>(); @@ -480,9 +482,9 @@ class CJson { } late final _cJSON_CreateStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('cJSON_CreateString'); + ffi + .NativeFunction Function(ffi.Pointer)>>( + 'cJSON_CreateString'); late final _cJSON_CreateString = _cJSON_CreateStringPtr .asFunction Function(ffi.Pointer)>(); @@ -495,9 +497,9 @@ class CJson { } late final _cJSON_CreateRawPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('cJSON_CreateRaw'); + ffi + .NativeFunction Function(ffi.Pointer)>>( + 'cJSON_CreateRaw'); late final _cJSON_CreateRaw = _cJSON_CreateRawPtr .asFunction Function(ffi.Pointer)>(); @@ -530,9 +532,9 @@ class CJson { } late final _cJSON_CreateStringReferencePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('cJSON_CreateStringReference'); + ffi + .NativeFunction Function(ffi.Pointer)>>( + 'cJSON_CreateStringReference'); late final _cJSON_CreateStringReference = _cJSON_CreateStringReferencePtr .asFunction Function(ffi.Pointer)>(); @@ -1180,9 +1182,9 @@ class CJson { } late final _cJSON_SetNumberHelperPtr = _lookup< - ffi.NativeFunction< - ffi.Double Function( - ffi.Pointer, ffi.Double)>>('cJSON_SetNumberHelper'); + ffi + .NativeFunction, ffi.Double)>>( + 'cJSON_SetNumberHelper'); late final _cJSON_SetNumberHelper = _cJSON_SetNumberHelperPtr .asFunction, double)>(); @@ -1237,12 +1239,13 @@ final class cJSON extends ffi.Struct { } final class cJSON_Hooks extends ffi.Struct { - external ffi.Pointer< - ffi.NativeFunction Function(ffi.Size sz)>> + external ffi + .Pointer Function(ffi.Size sz)>> malloc_fn; - external ffi.Pointer< - ffi.NativeFunction ptr)>> free_fn; + external ffi + .Pointer ptr)>> + free_fn; } typedef cJSON_bool = ffi.Int; diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index 22c6f266eb..2bc76881f2 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -133,9 +133,9 @@ class LibClang { } late final _clang_VirtualFileOverlay_setCaseSensitivityPtr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(CXVirtualFileOverlay, - ffi.Int)>>('clang_VirtualFileOverlay_setCaseSensitivity'); + ffi + .NativeFunction>( + 'clang_VirtualFileOverlay_setCaseSensitivity'); late final _clang_VirtualFileOverlay_setCaseSensitivity = _clang_VirtualFileOverlay_setCaseSensitivityPtr .asFunction(); @@ -384,8 +384,8 @@ class LibClang { } late final _clang_CXIndex_setInvocationEmissionPathOptionPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CXIndex, ffi.Pointer)>>( + ffi + .NativeFunction)>>( 'clang_CXIndex_setInvocationEmissionPathOption'); late final _clang_CXIndex_setInvocationEmissionPathOption = _clang_CXIndex_setInvocationEmissionPathOptionPtr @@ -453,9 +453,9 @@ class LibClang { } late final _clang_isFileMultipleIncludeGuardedPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedInt Function(CXTranslationUnit, - CXFile)>>('clang_isFileMultipleIncludeGuarded'); + ffi + .NativeFunction>( + 'clang_isFileMultipleIncludeGuarded'); late final _clang_isFileMultipleIncludeGuarded = _clang_isFileMultipleIncludeGuardedPtr .asFunction(); @@ -943,9 +943,9 @@ class LibClang { } late final _clang_disposeSourceRangeListPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer)>>('clang_disposeSourceRangeList'); + ffi + .NativeFunction)>>( + 'clang_disposeSourceRangeList'); late final _clang_disposeSourceRangeList = _clang_disposeSourceRangeListPtr .asFunction)>(); @@ -3586,9 +3586,9 @@ class LibClang { } late final _clang_constructUSR_ObjCIvarPtr = _lookup< - ffi.NativeFunction< - CXString Function( - ffi.Pointer, CXString)>>('clang_constructUSR_ObjCIvar'); + ffi + .NativeFunction, CXString)>>( + 'clang_constructUSR_ObjCIvar'); late final _clang_constructUSR_ObjCIvar = _clang_constructUSR_ObjCIvarPtr .asFunction, CXString)>(); @@ -3626,9 +3626,9 @@ class LibClang { } late final _clang_constructUSR_ObjCPropertyPtr = _lookup< - ffi.NativeFunction< - CXString Function(ffi.Pointer, - CXString)>>('clang_constructUSR_ObjCProperty'); + ffi + .NativeFunction, CXString)>>( + 'clang_constructUSR_ObjCProperty'); late final _clang_constructUSR_ObjCProperty = _clang_constructUSR_ObjCPropertyPtr .asFunction, CXString)>(); @@ -3900,9 +3900,9 @@ class LibClang { } late final _clang_Cursor_getObjCPropertyAttributesPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedInt Function(CXCursor, - ffi.UnsignedInt)>>('clang_Cursor_getObjCPropertyAttributes'); + ffi + .NativeFunction>( + 'clang_Cursor_getObjCPropertyAttributes'); late final _clang_Cursor_getObjCPropertyAttributes = _clang_Cursor_getObjCPropertyAttributesPtr .asFunction(); @@ -4595,9 +4595,9 @@ class LibClang { } late final _clang_getTokenExtentPtr = _lookup< - ffi.NativeFunction< - CXSourceRange Function( - CXTranslationUnit, CXToken)>>('clang_getTokenExtent'); + ffi + .NativeFunction>( + 'clang_getTokenExtent'); late final _clang_getTokenExtent = _clang_getTokenExtentPtr .asFunction(); @@ -8225,8 +8225,8 @@ abstract class CXIndexOptFlags { /// Visitor invoked for each field found by a traversal. typedef CXFieldVisitor = ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function(CXCursor C, CXClientData client_data)>>; + ffi + .NativeFunction>; const int CINDEX_VERSION_MAJOR = 0; diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index af6cccf44a..984fad3c19 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -914,8 +914,8 @@ class SQLite { int sqlite3_busy_handler( ffi.Pointer arg0, ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Int)>> + ffi + .NativeFunction, ffi.Int)>> arg1, ffi.Pointer arg2, ) { @@ -1410,9 +1410,9 @@ class SQLite { } late final _sqlite3_randomnessPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int, ffi.Pointer)>>('sqlite3_randomness'); + ffi + .NativeFunction)>>( + 'sqlite3_randomness'); late final _sqlite3_randomness = _sqlite3_randomnessPtr .asFunction)>(); @@ -4733,10 +4733,11 @@ class SQLite { ffi.Pointer, ffi.Int, ffi.Pointer>)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer)>>)>>( + ffi + .Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>( 'sqlite3_create_function'); late final _sqlite3_create_function = _sqlite3_create_functionPtr.asFunction< int Function( @@ -4810,10 +4811,11 @@ class SQLite { ffi.Pointer, ffi.Int, ffi.Pointer>)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer)>>)>>( + ffi + .Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>( 'sqlite3_create_function16'); late final _sqlite3_create_function16 = _sqlite3_create_function16Ptr.asFunction< @@ -4894,9 +4896,10 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>)>>( + ffi + .Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( 'sqlite3_create_function_v2'); late final _sqlite3_create_function_v2 = _sqlite3_create_function_v2Ptr.asFunction< @@ -4987,9 +4990,10 @@ class SQLite { ffi.Pointer, ffi.Int, ffi.Pointer>)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>)>>( + ffi + .Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( 'sqlite3_create_window_function'); late final _sqlite3_create_window_function = _sqlite3_create_window_functionPtr.asFunction< @@ -5294,9 +5298,9 @@ class SQLite { } late final _sqlite3_value_int64Ptr = _lookup< - ffi.NativeFunction< - sqlite3_int64 Function( - ffi.Pointer)>>('sqlite3_value_int64'); + ffi + .NativeFunction)>>( + 'sqlite3_value_int64'); late final _sqlite3_value_int64 = _sqlite3_value_int64Ptr .asFunction)>(); @@ -8361,9 +8365,9 @@ class SQLite { } late final _sqlite3_vfs_registerPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Int)>>('sqlite3_vfs_register'); + ffi + .NativeFunction, ffi.Int)>>( + 'sqlite3_vfs_register'); late final _sqlite3_vfs_register = _sqlite3_vfs_registerPtr .asFunction, int)>(); @@ -9756,8 +9760,9 @@ class SQLite { } late final _sqlite3_logPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int, ffi.Pointer)>>('sqlite3_log'); + ffi + .NativeFunction)>>( + 'sqlite3_log'); late final _sqlite3_log = _sqlite3_logPtr.asFunction)>(); @@ -10689,21 +10694,22 @@ class SQLite { ); } - late final _sqlite3_rtree_query_callbackPtr = - _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< + late final _sqlite3_rtree_query_callbackPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + ffi + .Pointer< ffi.NativeFunction< ffi.Int Function( ffi.Pointer)>>, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>)>>( - 'sqlite3_rtree_query_callback'); + ffi.Pointer, + ffi.Pointer< + ffi + .NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( + 'sqlite3_rtree_query_callback'); late final _sqlite3_rtree_query_callback = _sqlite3_rtree_query_callbackPtr.asFunction< int Function( @@ -10804,8 +10810,9 @@ final class sqlite3_vfs extends ffi.Struct { xRandomness; external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Int)>> xSleep; + ffi + .NativeFunction, ffi.Int)>> + xSleep; external ffi.Pointer< ffi.NativeFunction< @@ -10853,12 +10860,12 @@ typedef sqlite3_syscall_ptr final class sqlite3_mem_methods extends ffi.Struct { /// Memory allocation function external ffi - .Pointer Function(ffi.Int)>> + .Pointer Function(ffi.Int)>> xMalloc; /// Free a prior allocation external ffi - .Pointer)>> + .Pointer)>> xFree; /// Resize an allocation @@ -10869,7 +10876,7 @@ final class sqlite3_mem_methods extends ffi.Struct { /// Return the size of an allocation external ffi - .Pointer)>> + .Pointer)>> xSize; /// Round up request size to allocation size @@ -10877,12 +10884,12 @@ final class sqlite3_mem_methods extends ffi.Struct { /// Initialize the memory allocator external ffi - .Pointer)>> + .Pointer)>> xInit; /// Deinitialize the memory allocator external ffi - .Pointer)>> + .Pointer)>> xShutdown; /// Argument to xInit() and xShutdown() @@ -10984,8 +10991,9 @@ final class sqlite3_module extends ffi.Struct { ffi.Pointer> ppCursor)>> xOpen; external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer)>> xClose; + ffi + .NativeFunction)>> + xClose; external ffi.Pointer< ffi.NativeFunction< @@ -10997,12 +11005,13 @@ final class sqlite3_module extends ffi.Struct { ffi.Pointer>)>> xFilter; external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer)>> xNext; + ffi + .NativeFunction)>> + xNext; external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer)>> xEof; + ffi + .NativeFunction)>> xEof; external ffi.Pointer< ffi.NativeFunction< @@ -11063,21 +11072,24 @@ final class sqlite3_module extends ffi.Struct { /// The methods above are in version 1 of the sqlite_module object. Those /// below are for version 2 and greater. external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Int)>> xSavepoint; + ffi + .NativeFunction, ffi.Int)>> + xSavepoint; external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Int)>> xRelease; + ffi + .NativeFunction, ffi.Int)>> + xRelease; external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Int)>> xRollbackTo; + ffi + .NativeFunction, ffi.Int)>> + xRollbackTo; /// The methods above are in versions 1 and 2 of the sqlite_module object. /// Those below are for version 3 and greater. external ffi - .Pointer)>> + .Pointer)>> xShadowName; } @@ -11296,8 +11308,8 @@ final class sqlite3_mutex_methods extends ffi.Struct { external ffi.Pointer> xMutexEnd; - external ffi.Pointer< - ffi.NativeFunction Function(ffi.Int)>> + external ffi + .Pointer Function(ffi.Int)>> xMutexAlloc; external ffi.Pointer< @@ -11308,20 +11320,20 @@ final class sqlite3_mutex_methods extends ffi.Struct { ffi.NativeFunction)>> xMutexEnter; - external ffi.Pointer< - ffi.NativeFunction)>> + external ffi + .Pointer)>> xMutexTry; external ffi.Pointer< ffi.NativeFunction)>> xMutexLeave; - external ffi.Pointer< - ffi.NativeFunction)>> + external ffi + .Pointer)>> xMutexHeld; - external ffi.Pointer< - ffi.NativeFunction)>> + external ffi + .Pointer)>> xMutexNotheld; } @@ -11344,11 +11356,11 @@ final class sqlite3_pcache_methods2 extends ffi.Struct { external ffi.Pointer pArg; external ffi - .Pointer)>> + .Pointer)>> xInit; external ffi - .Pointer)>> + .Pointer)>> xShutdown; external ffi.Pointer< @@ -11400,11 +11412,11 @@ final class sqlite3_pcache_methods extends ffi.Struct { external ffi.Pointer pArg; external ffi - .Pointer)>> + .Pointer)>> xInit; external ffi - .Pointer)>> + .Pointer)>> xShutdown; external ffi.Pointer< @@ -11489,7 +11501,7 @@ final class sqlite3_rtree_geometry extends ffi.Struct { /// Called by SQLite to clean up pUser external ffi - .Pointer)>> + .Pointer)>> xDelUser; } @@ -11518,7 +11530,7 @@ final class sqlite3_rtree_query_info extends ffi.Struct { /// function to free pUser external ffi - .Pointer)>> + .Pointer)>> xDelUser; /// Coordinates of node or entry to check @@ -11781,8 +11793,8 @@ final class Fts5ExtensionApi extends ffi.Struct { ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer)>> xUserData; - external ffi.Pointer< - ffi.NativeFunction)>> + external ffi + .Pointer)>> xColumnCount; external ffi.Pointer< @@ -11812,13 +11824,14 @@ final class Fts5ExtensionApi extends ffi.Struct { ffi.Int, ffi.Int)>>)>> xTokenize; - external ffi.Pointer< - ffi.NativeFunction)>> + external ffi + .Pointer)>> xPhraseCount; external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Int)>> xPhraseSize; + ffi + .NativeFunction, ffi.Int)>> + xPhraseSize; external ffi.Pointer< ffi.NativeFunction< @@ -11968,8 +11981,8 @@ final class fts5_api extends ffi.Struct { ffi.Pointer pContext, ffi.Pointer pTokenizer, ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>> + ffi + .NativeFunction)>> xDestroy)>> xCreateTokenizer; /// Find an existing tokenizer @@ -11990,8 +12003,8 @@ final class fts5_api extends ffi.Struct { ffi.Pointer pContext, fts5_extension_function xFunction, ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>> + ffi + .NativeFunction)>> xDestroy)>> xCreateFunction; } diff --git a/pkgs/ffigen/test/native_objc_test/block_test.dart b/pkgs/ffigen/test/native_objc_test/block_test.dart index 76f7a93684..fd8c491fe8 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.dart +++ b/pkgs/ffigen/test/native_objc_test/block_test.dart @@ -5,6 +5,7 @@ // Objective C support is only available on mac. @TestOn('mac-os') +import 'dart:async'; import 'dart:ffi'; import 'dart:io'; @@ -51,7 +52,7 @@ void main() { }); test('Block from function pointer', () { - final block = ObjCBlock.fromFunctionPointer( + final block = ObjCBlock1.fromFunctionPointer( lib, Pointer.fromFunction(_add100, 999)); final blockTester = BlockTester.makeFromBlock_(lib, block); blockTester.pokeBlock(); @@ -64,15 +65,44 @@ void main() { } test('Block from function', () { - final block = ObjCBlock.fromFunction(lib, makeAdder(4000)); + final block = ObjCBlock1.fromFunction(lib, makeAdder(4000)); final blockTester = BlockTester.makeFromBlock_(lib, block); blockTester.pokeBlock(); expect(blockTester.call_(123), 4123); expect(block(123), 4123); }); + test('Listener block same thread', () async { + final hasRun = Completer(); + int value = 0; + final block = ObjCBlock.listener(lib, () { + value = 123; + hasRun.complete(); + }); + + BlockTester.callOnSameThread_(lib, block); + + await hasRun.future; + expect(value, 123); + }); + + test('Listener block new thread', () async { + final hasRun = Completer(); + int value = 0; + final block = ObjCBlock.listener(lib, () { + value = 123; + hasRun.complete(); + }); + + final thread = BlockTester.callOnNewThread_(lib, block); + thread.start(); + + await hasRun.future; + expect(value, 123); + }); + Pointer funcPointerBlockRefCountTest() { - final block = ObjCBlock.fromFunctionPointer( + final block = ObjCBlock1.fromFunctionPointer( lib, Pointer.fromFunction(_add100, 999)); expect(BlockTester.getBlockRetainCount_(lib, block.pointer.cast()), 1); return block.pointer.cast(); @@ -85,7 +115,7 @@ void main() { }); Pointer funcBlockRefCountTest() { - final block = ObjCBlock.fromFunction(lib, makeAdder(4000)); + final block = ObjCBlock1.fromFunction(lib, makeAdder(4000)); expect(BlockTester.getBlockRetainCount_(lib, block.pointer.cast()), 1); return block.pointer.cast(); } @@ -97,7 +127,7 @@ void main() { }); test('Block fields have sensible values', () { - final block = ObjCBlock.fromFunction(lib, makeAdder(4000)); + final block = ObjCBlock1.fromFunction(lib, makeAdder(4000)); final blockPtr = block.pointer; expect(blockPtr.ref.isa, isNot(0)); expect(blockPtr.ref.flags, isNot(0)); // Set by Block_copy. diff --git a/pkgs/ffigen/test/native_objc_test/block_test.m b/pkgs/ffigen/test/native_objc_test/block_test.m index bdd37a79e1..5e0174f068 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.m +++ b/pkgs/ffigen/test/native_objc_test/block_test.m @@ -3,8 +3,10 @@ // BSD-style license that can be found in the LICENSE file. #import +#import typedef int32_t (^IntBlock)(int32_t); +typedef void (^VoidBlock)(); // Wrapper around a block, so that our Dart code can test creating and invoking // blocks in Objective C code. @@ -17,6 +19,8 @@ + (uint64_t)getBlockRetainCount:(void*)block; - (int32_t)call:(int32_t)x; - (IntBlock)getBlock; - (void)pokeBlock; ++ (void)callOnSameThread:(VoidBlock)block; ++ (NSThread*)callOnNewThread:(VoidBlock)block; @end @implementation BlockTester @@ -73,4 +77,13 @@ - (void)pokeBlock { // Used to repro https://github.com/dart-lang/ffigen/issues/376 [[myBlock retain] release]; } + ++ (void)callOnSameThread:(VoidBlock)block { + block(); +} + ++ (NSThread*)callOnNewThread:(VoidBlock)block { + return [[NSThread alloc] initWithBlock: block]; +} + @end From 92d51378579e197a9ff777a9f54292ebcc96a43f Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Thu, 31 Aug 2023 10:47:25 -0700 Subject: [PATCH 251/276] [ffigen] Fix null inference weirdness (#605) --- pkgs/ffigen/lib/src/config_provider/config_spec.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ffigen/lib/src/config_provider/config_spec.dart b/pkgs/ffigen/lib/src/config_provider/config_spec.dart index c7ed4061de..3d67be9dc4 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_spec.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_spec.dart @@ -591,7 +591,7 @@ class StringConfigSpec extends ConfigSpec { if (!o.checkType(log: log)) { return false; } - if (_regexp != null && !_regexp.hasMatch(o.value as String)) { + if (!(_regexp?.hasMatch(o.value as String) ?? true)) { if (log) { _logger.severe( "Expected value of key '${o.pathString}' to match pattern $pattern (Input - ${o.value})."); From 2042ea0be3b988dac6c7b632400d581dfcfdff9f Mon Sep 17 00:00:00 2001 From: Ivan Dlugos <6349682+vaind@users.noreply.github.com> Date: Fri, 1 Sep 2023 11:21:53 +0200 Subject: [PATCH 252/276] [ffigen] fix: objc block trampoline invalid return type (#607) --- pkgs/ffigen/example/objective_c/config.yaml | 2 +- pkgs/ffigen/lib/src/code_generator/objc_block.dart | 10 ++++++++-- pkgs/ffigen/test/native_objc_test/setup.dart | 2 ++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/ffigen/example/objective_c/config.yaml b/pkgs/ffigen/example/objective_c/config.yaml index b44cc69069..3a76517eb3 100644 --- a/pkgs/ffigen/example/objective_c/config.yaml +++ b/pkgs/ffigen/example/objective_c/config.yaml @@ -12,4 +12,4 @@ headers: entry-points: - '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioPlayer.h' preamble: | - // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field, return_of_invalid_type, void_checks, annotate_overrides, no_leading_underscores_for_local_identifiers, library_private_types_in_public_api + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field, void_checks, annotate_overrides, no_leading_underscores_for_local_identifiers, library_private_types_in_public_api diff --git a/pkgs/ffigen/lib/src/code_generator/objc_block.dart b/pkgs/ffigen/lib/src/code_generator/objc_block.dart index 883acd731d..ba028d661f 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_block.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_block.dart @@ -92,8 +92,14 @@ $voidPtr $registerClosure(Function fn) { s.write(', ${params[i].type.getDartType(w)} ${params[i].name}'); } s.write(') {\n'); - s.write(' ${isVoid ? '' : 'return '}$closureRegistry[' - 'block.ref.target.address]!('); + s.write(' ${isVoid ? '' : 'return '}'); + s.write('($closureRegistry[block.ref.target.address]'); + s.write(' as ${returnType.getDartType(w)} Function('); + for (int i = 0; i < params.length; ++i) { + s.write('${i == 0 ? '' : ', '}${params[i].type.getDartType(w)}'); + } + s.write('))'); + s.write('('); for (int i = 0; i < params.length; ++i) { s.write('${i == 0 ? '' : ', '}${params[i].name}'); } diff --git a/pkgs/ffigen/test/native_objc_test/setup.dart b/pkgs/ffigen/test/native_objc_test/setup.dart index 5eff12cc4b..8e74d878dd 100644 --- a/pkgs/ffigen/test/native_objc_test/setup.dart +++ b/pkgs/ffigen/test/native_objc_test/setup.dart @@ -119,6 +119,8 @@ Future clean(List testNames) async { } Future main(List arguments) async { + // Allow running this script directly from any path (or an IDE). + Directory.current = Platform.script.resolve('.').toFilePath(); if (!Platform.isMacOS) { throw OSError('Objective C tests are only supported on MacOS'); } From 79e36f0a0191d06da7ab65e3866850409c1c824f Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Fri, 1 Sep 2023 02:25:54 -0700 Subject: [PATCH 253/276] [ffigen] Fix #577 (#609) --- pkgs/ffigen/lib/src/code_generator/imports.dart | 4 ++-- pkgs/ffigen/lib/src/code_generator/native_type.dart | 4 ++-- pkgs/ffigen/test/native_objc_test/block_test.dart | 8 ++++++++ pkgs/ffigen/test/native_objc_test/block_test.m | 6 ++++++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/imports.dart b/pkgs/ffigen/lib/src/code_generator/imports.dart index d6dcd06014..93af5ad161 100644 --- a/pkgs/ffigen/lib/src/code_generator/imports.dart +++ b/pkgs/ffigen/lib/src/code_generator/imports.dart @@ -86,8 +86,8 @@ final unsignedLongLongType = ImportedType(ffiImport, 'UnsignedLongLong', 'int', '0'); final longLongType = ImportedType(ffiImport, 'LongLong', 'int', '0'); -final floatType = ImportedType(ffiImport, 'Float', 'double', '0'); -final doubleType = ImportedType(ffiImport, 'Double', 'double', '0'); +final floatType = ImportedType(ffiImport, 'Float', 'double', '0.0'); +final doubleType = ImportedType(ffiImport, 'Double', 'double', '0.0'); final sizeType = ImportedType(ffiImport, 'Size', 'int', '0'); final wCharType = ImportedType(ffiImport, 'WChar', 'int', '0'); diff --git a/pkgs/ffigen/lib/src/code_generator/native_type.dart b/pkgs/ffigen/lib/src/code_generator/native_type.dart index d76e7e75ea..dfb43a574b 100644 --- a/pkgs/ffigen/lib/src/code_generator/native_type.dart +++ b/pkgs/ffigen/lib/src/code_generator/native_type.dart @@ -36,8 +36,8 @@ class NativeType extends Type { SupportedNativeType.Uint16: NativeType._('Uint16', 'int', '0'), SupportedNativeType.Uint32: NativeType._('Uint32', 'int', '0'), SupportedNativeType.Uint64: NativeType._('Uint64', 'int', '0'), - SupportedNativeType.Float: NativeType._('Float', 'double', '0'), - SupportedNativeType.Double: NativeType._('Double', 'double', '0'), + SupportedNativeType.Float: NativeType._('Float', 'double', '0.0'), + SupportedNativeType.Double: NativeType._('Double', 'double', '0.0'), SupportedNativeType.IntPtr: NativeType._('IntPtr', 'int', '0'), SupportedNativeType.UintPtr: NativeType._('UintPtr', 'int', '0'), }; diff --git a/pkgs/ffigen/test/native_objc_test/block_test.dart b/pkgs/ffigen/test/native_objc_test/block_test.dart index fd8c491fe8..87a735a92a 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.dart +++ b/pkgs/ffigen/test/native_objc_test/block_test.dart @@ -101,6 +101,14 @@ void main() { expect(value, 123); }); + test('Float block', () { + final block = ObjCBlock2.fromFunction(lib, (double x) { + return x + 4.56; + }); + expect(block(1.23), closeTo(5.79, 1e-6)); + expect(BlockTester.callFloatBlock_(lib, block), closeTo(5.79, 1e-6)); + }); + Pointer funcPointerBlockRefCountTest() { final block = ObjCBlock1.fromFunctionPointer( lib, Pointer.fromFunction(_add100, 999)); diff --git a/pkgs/ffigen/test/native_objc_test/block_test.m b/pkgs/ffigen/test/native_objc_test/block_test.m index 5e0174f068..9e619b646a 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.m +++ b/pkgs/ffigen/test/native_objc_test/block_test.m @@ -6,6 +6,7 @@ #import typedef int32_t (^IntBlock)(int32_t); +typedef float (^FloatBlock)(float); typedef void (^VoidBlock)(); // Wrapper around a block, so that our Dart code can test creating and invoking @@ -21,6 +22,7 @@ - (IntBlock)getBlock; - (void)pokeBlock; + (void)callOnSameThread:(VoidBlock)block; + (NSThread*)callOnNewThread:(VoidBlock)block; ++ (float)callFloatBlock:(FloatBlock)block; @end @implementation BlockTester @@ -86,4 +88,8 @@ + (NSThread*)callOnNewThread:(VoidBlock)block { return [[NSThread alloc] initWithBlock: block]; } ++ (float)callFloatBlock:(FloatBlock)block { + return block(1.23); +} + @end From fa9846405475d6827ef6e8cedb08984d17ec965b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Sep 2023 23:05:05 +0000 Subject: [PATCH 254/276] [ffigen] Bump actions/checkout from 3.5.3 to 3.6.0 (#611) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.3 to 3.6.0.
    Release notes

    Sourced from actions/checkout's releases.

    v3.6.0

    What's Changed

    New Contributors

    Full Changelog: https://github.com/actions/checkout/compare/v3.5.3...v3.6.0

    Changelog

    Sourced from actions/checkout's changelog.

    Changelog

    v3.6.0

    v3.5.3

    v3.5.2

    v3.5.1

    v3.5.0

    v3.4.0

    v3.3.0

    v3.2.0

    v3.1.0

    v3.0.2

    v3.0.1

    v3.0.0

    ... (truncated)

    Commits

    [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=3.5.3&new-version=3.6.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
    Dependabot commands and options
    You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    --- pkgs/ffigen/.github/workflows/test-package.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 134d7dfac4..75f4585131 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -22,7 +22,7 @@ jobs: # TODO: Change to 3.2.0 stable once it's released. sdk: [3.2.0-114.0.dev] steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: ${{ matrix.sdk }} @@ -42,7 +42,7 @@ jobs: needs: analyze runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: 3.2.0-114.0.dev @@ -59,7 +59,7 @@ jobs: needs: analyze runs-on: macos-latest steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: 3.2.0-114.0.dev @@ -81,7 +81,7 @@ jobs: needs: analyze runs-on: windows-latest steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: 3.2.0-114.0.dev @@ -106,7 +106,7 @@ jobs: needs: analyze runs-on: windows-latest steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa with: channel: "master" From 1e1eeee80cb896706a88f04826cab6b300911849 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Mon, 4 Sep 2023 16:54:51 -0700 Subject: [PATCH 255/276] [ffigen] Use stret and fpret variants of objc_msgSend where appropriate (#613) * Use stret and fpret variants of objc_msgSend where appropriate * Changelog * Daco's comment --- pkgs/ffigen/CHANGELOG.md | 3 + pkgs/ffigen/example/swift/swift_api.h | 144 +++++++++++------- .../objc_built_in_functions.dart | 73 +++++++-- .../src/code_generator/objc_interface.dart | 35 +++-- .../test/native_objc_test/block_test.dart | 46 ++++++ .../ffigen/test/native_objc_test/block_test.m | 24 +++ .../test/native_objc_test/method_test.dart | 41 ++++- .../test/native_objc_test/method_test.m | 28 ++++ .../test/native_objc_test/property_test.dart | 42 ++++- .../test/native_objc_test/property_test.m | 12 +- 10 files changed, 356 insertions(+), 92 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 7036a8c4bb..b90e619881 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -2,6 +2,9 @@ - Add support for ObjC Blocks that can be invoked from any thread, using NativeCallable.listener. +- Fix invalid exceptional return value ObjCBlocks that return floats. +- Fix return_of_invalid_type analysis error for ObjCBlocks. +- Fix crash in ObjC methods and blocks that return structs by value. - Bump min SDK version to 3.2.0-114.0.dev. # 9.0.1 diff --git a/pkgs/ffigen/example/swift/swift_api.h b/pkgs/ffigen/example/swift/swift_api.h index 0928c492b6..14ebedf926 100644 --- a/pkgs/ffigen/example/swift/swift_api.h +++ b/pkgs/ffigen/example/swift/swift_api.h @@ -1,4 +1,4 @@ -// Generated by Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) +// Generated by Apple Swift version 5.8.1 (swiftlang-5.8.0.124.5 clang-1403.0.22.11.100) #ifndef SWIFT_MODULE_SWIFT_H #define SWIFT_MODULE_SWIFT_H #pragma clang diagnostic push @@ -21,7 +21,6 @@ # include #endif -#pragma clang diagnostic ignored "-Wduplicate-method-match" #pragma clang diagnostic ignored "-Wauto-import" #if defined(__OBJC__) #include @@ -30,10 +29,24 @@ #include #include #include +#include +#include +#include +#include #else #include #include #include +#include +#endif +#if defined(__cplusplus) +#if __has_include() +# include +#else +# ifndef __ptrauth_swift_value_witness_function_pointer +# define __ptrauth_swift_value_witness_function_pointer(x) +# endif +#endif #endif #if !defined(SWIFT_TYPEDEFS) @@ -69,53 +82,66 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); # if __has_feature(objc_class_property) # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ # else -# define SWIFT_CLASS_PROPERTY(...) +# define SWIFT_CLASS_PROPERTY(...) # endif #endif - -#if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) -#else -# define SWIFT_RUNTIME_NAME(X) +#if !defined(SWIFT_RUNTIME_NAME) +# if __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +# else +# define SWIFT_RUNTIME_NAME(X) +# endif #endif -#if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) -#else -# define SWIFT_COMPILE_NAME(X) +#if !defined(SWIFT_COMPILE_NAME) +# if __has_attribute(swift_name) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +# else +# define SWIFT_COMPILE_NAME(X) +# endif #endif -#if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) -#else -# define SWIFT_METHOD_FAMILY(X) +#if !defined(SWIFT_METHOD_FAMILY) +# if __has_attribute(objc_method_family) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +# else +# define SWIFT_METHOD_FAMILY(X) +# endif #endif -#if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) -#else -# define SWIFT_NOESCAPE +#if !defined(SWIFT_NOESCAPE) +# if __has_attribute(noescape) +# define SWIFT_NOESCAPE __attribute__((noescape)) +# else +# define SWIFT_NOESCAPE +# endif #endif -#if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) -#else -# define SWIFT_RELEASES_ARGUMENT +#if !defined(SWIFT_RELEASES_ARGUMENT) +# if __has_attribute(ns_consumed) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +# else +# define SWIFT_RELEASES_ARGUMENT +# endif #endif -#if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) -#else -# define SWIFT_WARN_UNUSED_RESULT +#if !defined(SWIFT_WARN_UNUSED_RESULT) +# if __has_attribute(warn_unused_result) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +# else +# define SWIFT_WARN_UNUSED_RESULT +# endif #endif -#if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) -#else -# define SWIFT_NORETURN +#if !defined(SWIFT_NORETURN) +# if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) +# else +# define SWIFT_NORETURN +# endif #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +# define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) # if __has_attribute(objc_subclassing_restricted) @@ -135,28 +161,25 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) # endif #endif - #if !defined(SWIFT_PROTOCOL) # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif - #if !defined(SWIFT_EXTENSION) # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif - #if !defined(OBJC_DESIGNATED_INITIALIZER) # if __has_attribute(objc_designated_initializer) # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) # else -# define OBJC_DESIGNATED_INITIALIZER +# define OBJC_DESIGNATED_INITIALIZER # endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# if __has_attribute(enum_extensibility) # define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) # else -# define SWIFT_ENUM_ATTR(_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) # endif #endif #if !defined(SWIFT_ENUM) @@ -185,14 +208,16 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #if !defined(SWIFT_DEPRECATED_MSG) # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif -#if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) -#else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#if !defined(SWIFT_DEPRECATED_OBJC) +# if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +# else +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +# endif #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +# define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) @@ -205,26 +230,31 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #if !defined(SWIFT_CALL) # define SWIFT_CALL __attribute__((swiftcall)) #endif +#if !defined(SWIFT_INDIRECT_RESULT) +# define SWIFT_INDIRECT_RESULT __attribute__((swift_indirect_result)) +#endif +#if !defined(SWIFT_CONTEXT) +# define SWIFT_CONTEXT __attribute__((swift_context)) +#endif +#if !defined(SWIFT_ERROR_RESULT) +# define SWIFT_ERROR_RESULT __attribute__((swift_error_result)) +#endif #if defined(__cplusplus) -#if !defined(SWIFT_NOEXCEPT) # define SWIFT_NOEXCEPT noexcept -#endif #else -#if !defined(SWIFT_NOEXCEPT) # define SWIFT_NOEXCEPT #endif +#if defined(_WIN32) +#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) +# define SWIFT_IMPORT_STDLIB_SYMBOL __declspec(dllimport) #endif -#if defined(__cplusplus) -#if !defined(SWIFT_CXX_INT_DEFINED) -#define SWIFT_CXX_INT_DEFINED -namespace swift { -using Int = ptrdiff_t; -using UInt = size_t; -} +#else +#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) +# define SWIFT_IMPORT_STDLIB_SYMBOL #endif #endif #if defined(__OBJC__) -#if __has_feature(modules) +#if __has_feature(objc_modules) #if __has_warning("-Watimport-in-framework-header") #pragma clang diagnostic ignored "-Watimport-in-framework-header" #endif diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index 05cd13009a..b092e738c0 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -94,24 +94,18 @@ $objType $name(String name) { _blockReleaseFunc, ); - // We need to load a separate instance of objc_msgSend for each signature. - final _msgSendFuncs = {}; - Func getMsgSendFunc(Type returnType, List params) { + // We need to load a separate instance of objc_msgSend for each signature. If + // the return type is a struct, we need to use objc_msgSend_stret instead, and + // for float return types we need objc_msgSend_fpret. + final _msgSendFuncs = {}; + ObjCMsgSendFunc getMsgSendFunc( + Type returnType, List params) { var key = returnType.cacheKey(); for (final p in params) { key += ' ${p.type.cacheKey()}'; } - return _msgSendFuncs[key] ??= Func( - name: '_objc_msgSend_${_msgSendFuncs.length}', - originalName: 'objc_msgSend', - returnType: returnType, - parameters: [ - Parameter(name: 'obj', type: PointerType(objCObjectType)), - Parameter(name: 'sel', type: PointerType(objCSelType)), - for (final p in params) Parameter(name: p.name, type: p.type), - ], - isInternal: true, - ); + return _msgSendFuncs[key] ??= ObjCMsgSendFunc( + '_objc_msgSend_${_msgSendFuncs.length}', returnType, params); } final _selObjects = {}; @@ -285,8 +279,8 @@ class $name implements ${w.ffiLibraryPrefix}.Finalizable { _retainFunc.addDependencies(dependencies); _releaseFunc.addDependencies(dependencies); _releaseFinalizer.addDependencies(dependencies); - for (final func in _msgSendFuncs.values) { - func.addDependencies(dependencies); + for (final msgSendFunc in _msgSendFuncs.values) { + msgSendFunc.func.addDependencies(dependencies); } for (final sel in _selObjects.values) { sel.addDependencies(dependencies); @@ -396,3 +390,50 @@ class ObjCInternalGlobal extends LookUpBinding { binding?.addDependencies(dependencies); } } + +enum ObjCMsgSendVariant { + normal('objc_msgSend'), + stret('objc_msgSend_stret'), + fpret('objc_msgSend_fpret'); + + final String name; + const ObjCMsgSendVariant(this.name); + + static ObjCMsgSendVariant fromReturnType(Type returnType) { + if (returnType is Compound && returnType.isStruct) { + return ObjCMsgSendVariant.stret; + } else if (returnType == floatType || returnType == doubleType) { + return ObjCMsgSendVariant.fpret; + } + return ObjCMsgSendVariant.normal; + } +} + +/// A wrapper around the objc_msgSend function, or the stret or fpret variants. +class ObjCMsgSendFunc { + final ObjCMsgSendVariant variant; + late final Func func; + + ObjCMsgSendFunc(String name, Type returnType, List params) + : variant = ObjCMsgSendVariant.fromReturnType(returnType) { + func = Func( + name: name, + originalName: variant.name, + returnType: isStret ? voidType : returnType, + parameters: [ + if (isStret) Parameter(name: 'stret', type: PointerType(returnType)), + Parameter(name: 'obj', type: PointerType(objCObjectType)), + Parameter(name: 'sel', type: PointerType(objCSelType)), + for (final p in params) Parameter(name: p.name, type: p.type), + ], + isInternal: true, + ); + } + + String get name => func.name; + bool get isStret => variant == ObjCMsgSendVariant.stret; + + void addDependencies(Set dependencies) { + func.addDependencies(dependencies); + } +} diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 2cf44af1d3..bf4d887227 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -46,7 +46,7 @@ class ObjCInterface extends BindingType { final ObjCBuiltInFunctions builtInFunctions; late final ObjCInternalGlobal _classObject; late final ObjCInternalGlobal _isKindOfClass; - late final Func _isKindOfClassMsgSend; + late final ObjCMsgSendFunc _isKindOfClassMsgSend; ObjCInterface({ String? usr, @@ -130,7 +130,14 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { for (final m in methods.values) { final methodName = m._getDartMethodName(uniqueNamer); final isStatic = m.isClass; - final returnType = m.returnType; + final isStret = m.msgSend!.isStret; + + var returnType = m.returnType; + var params = m.params; + if (isStret) { + params = [ObjCMethodParam(PointerType(returnType), 'stret'), ...params]; + returnType = voidType; + } // The method declaration. if (m.dartDoc != null) { @@ -159,7 +166,7 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { s.write(methodName[0].toUpperCase() + methodName.substring(1)); break; } - s.write(paramsToString(m.params, isStatic: true)); + s.write(paramsToString(params, isStatic: true)); } else { if (superType?.methods[m.originalName]?.sameAs(m) ?? false) { s.write('@override\n '); @@ -170,18 +177,25 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { s.write(_getConvertedReturnType( returnType, w, name, m.isNullableReturn)); s.write(' $methodName'); - s.write(paramsToString(m.params, isStatic: false)); + s.write(paramsToString(params, isStatic: false)); break; case ObjCMethodKind.propertyGetter: - // returnType get methodName s.write(_getConvertedReturnType( returnType, w, name, m.isNullableReturn)); - s.write(' get $methodName'); + if (isStret) { + // void getMethodName(Pointer stret, NativeLibrary _lib) + s.write(' get'); + s.write(methodName[0].toUpperCase() + methodName.substring(1)); + s.write(paramsToString(params, isStatic: false)); + } else { + // returnType get methodName + s.write(' get $methodName'); + } break; case ObjCMethodKind.propertySetter: // set methodName(...) s.write(' set $methodName'); - s.write(paramsToString(m.params, isStatic: false)); + s.write(paramsToString(params, isStatic: false)); break; } } @@ -192,10 +206,13 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { final convertReturn = m.kind != ObjCMethodKind.propertySetter && _needsConverting(returnType); - if (returnType != NativeType(SupportedNativeType.Void)) { + if (returnType != voidType) { s.write(' ${convertReturn ? 'final _ret = ' : 'return '}'); } s.write('_lib.${m.msgSend!.name}('); + if (isStret) { + s.write('stret, '); + } s.write(isStatic ? '_lib.${_classObject.name}' : '_id'); s.write(', _lib.${m.selObject!.name}'); for (final p in m.params) { @@ -427,7 +444,7 @@ class ObjCMethod { final bool isClass; bool returnsRetained = false; ObjCInternalGlobal? selObject; - Func? msgSend; + ObjCMsgSendFunc? msgSend; ObjCMethod({ required this.originalName, diff --git a/pkgs/ffigen/test/native_objc_test/block_test.dart b/pkgs/ffigen/test/native_objc_test/block_test.dart index 87a735a92a..908e8fc4f5 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.dart +++ b/pkgs/ffigen/test/native_objc_test/block_test.dart @@ -109,6 +109,52 @@ void main() { expect(BlockTester.callFloatBlock_(lib, block), closeTo(5.79, 1e-6)); }); + test('Double block', () { + final block = ObjCBlock3.fromFunction(lib, (double x) { + return x + 4.56; + }); + expect(block(1.23), closeTo(5.79, 1e-6)); + expect(BlockTester.callDoubleBlock_(lib, block), closeTo(5.79, 1e-6)); + }); + + test('Struct block', () { + final inputPtr = calloc(); + final input = inputPtr.ref; + input.x = 1.2; + input.y = 3.4; + input.z = 5.6; + input.w = 7.8; + + final tempPtr = calloc(); + final temp = tempPtr.ref; + final block = ObjCBlock4.fromFunction(lib, (Vec4 v) { + // Twiddle the Vec4 components. + temp.x = v.y; + temp.y = v.z; + temp.z = v.w; + temp.w = v.x; + return temp; + }); + + final result1 = block(input); + expect(result1.x, 3.4); + expect(result1.y, 5.6); + expect(result1.z, 7.8); + expect(result1.w, 1.2); + + final result2Ptr = calloc(); + final result2 = result2Ptr.ref; + BlockTester.callVec4Block_(lib, result2Ptr, block); + expect(result2.x, 3.4); + expect(result2.y, 5.6); + expect(result2.z, 7.8); + expect(result2.w, 1.2); + + calloc.free(inputPtr); + calloc.free(tempPtr); + calloc.free(result2Ptr); + }); + Pointer funcPointerBlockRefCountTest() { final block = ObjCBlock1.fromFunctionPointer( lib, Pointer.fromFunction(_add100, 999)); diff --git a/pkgs/ffigen/test/native_objc_test/block_test.m b/pkgs/ffigen/test/native_objc_test/block_test.m index 9e619b646a..a864f2ef81 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.m +++ b/pkgs/ffigen/test/native_objc_test/block_test.m @@ -5,8 +5,17 @@ #import #import +typedef struct { + double x; + double y; + double z; + double w; +} Vec4; + typedef int32_t (^IntBlock)(int32_t); typedef float (^FloatBlock)(float); +typedef double (^DoubleBlock)(double); +typedef Vec4 (^Vec4Block)(Vec4); typedef void (^VoidBlock)(); // Wrapper around a block, so that our Dart code can test creating and invoking @@ -23,6 +32,8 @@ - (void)pokeBlock; + (void)callOnSameThread:(VoidBlock)block; + (NSThread*)callOnNewThread:(VoidBlock)block; + (float)callFloatBlock:(FloatBlock)block; ++ (double)callDoubleBlock:(DoubleBlock)block; ++ (Vec4)callVec4Block:(Vec4Block)block; @end @implementation BlockTester @@ -92,4 +103,17 @@ + (float)callFloatBlock:(FloatBlock)block { return block(1.23); } ++ (double)callDoubleBlock:(DoubleBlock)block { + return block(1.23); +} + ++ (Vec4)callVec4Block:(Vec4Block)block { + Vec4 vec4; + vec4.x = 1.2; + vec4.y = 3.4; + vec4.z = 5.6; + vec4.w = 7.8; + return block(vec4); +} + @end diff --git a/pkgs/ffigen/test/native_objc_test/method_test.dart b/pkgs/ffigen/test/native_objc_test/method_test.dart index ebb1fba976..21ba7e061f 100644 --- a/pkgs/ffigen/test/native_objc_test/method_test.dart +++ b/pkgs/ffigen/test/native_objc_test/method_test.dart @@ -8,13 +8,14 @@ import 'dart:ffi'; import 'dart:io'; +import 'package:ffi/ffi.dart'; import 'package:test/test.dart'; import '../test_utils.dart'; import 'method_bindings.dart'; import 'util.dart'; void main() { - MethodInterface? testInstance; + late MethodInterface testInstance; late MethodTestObjCLibrary lib; group('method calls', () { @@ -29,19 +30,19 @@ void main() { group('Instance methods', () { test('No arguments', () { - expect(testInstance!.add(), 5); + expect(testInstance.add(), 5); }); test('One argument', () { - expect(testInstance!.add_(23), 23); + expect(testInstance.add_(23), 23); }); test('Two arguments', () { - expect(testInstance!.add_Y_(23, 17), 40); + expect(testInstance.add_Y_(23, 17), 40); }); test('Three arguments', () { - expect(testInstance!.add_Y_Z_(23, 17, 60), 100); + expect(testInstance.add_Y_Z_(23, 17, 60), 100); }); }); @@ -62,5 +63,35 @@ void main() { expect(MethodInterface.sub_Y_Z_(lib, 10, 7, 3), -20); }); }); + + group('Regress #608', () { + test('Structs', () { + final inputPtr = calloc(); + final input = inputPtr.ref; + input.x = 1.2; + input.y = 3.4; + input.z = 5.6; + input.w = 7.8; + + final resultPtr = calloc(); + final result = resultPtr.ref; + testInstance.twiddleVec4Components_(resultPtr, input); + expect(result.x, 3.4); + expect(result.y, 5.6); + expect(result.z, 7.8); + expect(result.w, 1.2); + + calloc.free(inputPtr); + calloc.free(resultPtr); + }); + + test('Floats', () { + expect(testInstance.addFloats_Y_(1.23, 4.56), closeTo(5.79, 1e-6)); + }); + + test('Doubles', () { + expect(testInstance.addDoubles_Y_(1.23, 4.56), closeTo(5.79, 1e-6)); + }); + }); }); } diff --git a/pkgs/ffigen/test/native_objc_test/method_test.m b/pkgs/ffigen/test/native_objc_test/method_test.m index 86ea09040e..179f4ef6d4 100644 --- a/pkgs/ffigen/test/native_objc_test/method_test.m +++ b/pkgs/ffigen/test/native_objc_test/method_test.m @@ -1,5 +1,12 @@ #import +typedef struct { + double x; + double y; + double z; + double w; +} Vec4; + @interface MethodInterface : NSObject { } @@ -14,6 +21,10 @@ +(int32_t)sub:(int32_t)x; +(int32_t)sub:(int32_t)x Y:(int32_t) y; +(int32_t)sub:(int32_t)x Y:(int32_t) y Z:(int32_t) z; +-(Vec4)twiddleVec4Components:(Vec4)v; +-(float)addFloats:(float)x Y:(float) y; +-(double)addDoubles:(double)x Y:(double) y; + @end @implementation MethodInterface @@ -50,4 +61,21 @@ +(int32_t)sub:(int32_t)x Y:(int32_t) y Z:(int32_t) z { return - x - y - z; } +-(Vec4)twiddleVec4Components:(Vec4)v { + Vec4 u; + u.x = v.y; + u.y = v.z; + u.z = v.w; + u.w = v.x; + return u; +} + +-(float)addFloats:(float)x Y:(float) y { + return x + y; +} + +-(double)addDoubles:(double)x Y:(double) y { + return x + y; +} + @end diff --git a/pkgs/ffigen/test/native_objc_test/property_test.dart b/pkgs/ffigen/test/native_objc_test/property_test.dart index 72c11e039a..9bd4f3c682 100644 --- a/pkgs/ffigen/test/native_objc_test/property_test.dart +++ b/pkgs/ffigen/test/native_objc_test/property_test.dart @@ -8,13 +8,14 @@ import 'dart:ffi'; import 'dart:io'; +import 'package:ffi/ffi.dart'; import 'package:test/test.dart'; import '../test_utils.dart'; import 'property_bindings.dart'; import 'util.dart'; void main() { - PropertyInterface? testInstance; + late PropertyInterface testInstance; late PropertyTestObjCLibrary lib; group('properties', () { @@ -29,12 +30,12 @@ void main() { group('instance properties', () { test('read-only property', () { - expect(testInstance!.readOnlyProperty, 7); + expect(testInstance.readOnlyProperty, 7); }); test('read-write property', () { - testInstance!.readWriteProperty = 23; - expect(testInstance!.readWriteProperty, 23); + testInstance.readWriteProperty = 23; + expect(testInstance.readWriteProperty, 23); }); }); @@ -48,5 +49,38 @@ void main() { expect(PropertyInterface.getClassReadWriteProperty(lib), 101); }); }); + + group('Regress #608', () { + test('Structs', () { + final inputPtr = calloc(); + final input = inputPtr.ref; + input.x = 1.2; + input.y = 3.4; + input.z = 5.6; + input.w = 7.8; + + final resultPtr = calloc(); + final result = resultPtr.ref; + testInstance.structProperty = input; + testInstance.getStructProperty(resultPtr); + expect(result.x, 1.2); + expect(result.y, 3.4); + expect(result.z, 5.6); + expect(result.w, 7.8); + + calloc.free(inputPtr); + calloc.free(resultPtr); + }); + + test('Floats', () { + testInstance.floatProperty = 1.23; + expect(testInstance.floatProperty, closeTo(1.23, 1e-6)); + }); + + test('Doubles', () { + testInstance.doubleProperty = 1.23; + expect(testInstance.doubleProperty, 1.23); + }); + }); }); } diff --git a/pkgs/ffigen/test/native_objc_test/property_test.m b/pkgs/ffigen/test/native_objc_test/property_test.m index 117c6d53f1..0085034cf8 100644 --- a/pkgs/ffigen/test/native_objc_test/property_test.m +++ b/pkgs/ffigen/test/native_objc_test/property_test.m @@ -2,6 +2,13 @@ @class UndefinedTemplate; +typedef struct { + double x; + double y; + double z; + double w; +} Vec4; + @interface PropertyInterface : NSObject { } @@ -10,6 +17,9 @@ @interface PropertyInterface : NSObject { @property (class, readonly, copy) UndefinedTemplate *regressGH436; @property (class, readonly) int32_t classReadOnlyProperty; @property (class) int32_t classReadWriteProperty; +@property float floatProperty; +@property double doubleProperty; +@property Vec4 structProperty; @end @@ -33,4 +43,4 @@ + (void)setClassReadWriteProperty:(int32_t)x { _classReadWriteProperty = x; } -@end \ No newline at end of file +@end From 4e53697fb0a242eca06ba2b7e24608146e6c867e Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 6 Sep 2023 18:23:56 -0700 Subject: [PATCH 256/276] [ffigen] Better block names (#606) * Better Block names * Test * Move swift_api.h to third_party * merge cruft --- pkgs/ffigen/example/swift/README.md | 8 ++--- pkgs/ffigen/example/swift/config.yaml | 4 +-- .../swift/{ => third_party}/swift_api.h | 0 .../lib/src/code_generator/objc_block.dart | 23 ++++++++++++++ .../sub_parsers/objc_block_parser.dart | 1 - .../example_tests/swift_example_test.dart | 2 +- .../test/native_objc_test/block_test.dart | 31 ++++++++++++------- 7 files changed, 49 insertions(+), 20 deletions(-) rename pkgs/ffigen/example/swift/{ => third_party}/swift_api.h (100%) diff --git a/pkgs/ffigen/example/swift/README.md b/pkgs/ffigen/example/swift/README.md index d53778e14b..caa482ef64 100644 --- a/pkgs/ffigen/example/swift/README.md +++ b/pkgs/ffigen/example/swift/README.md @@ -8,9 +8,9 @@ using `-emit-library`, and generate an Objective-C wrapper header using `-emit-objc-header-path filename.h`: ```shell -swiftc -c swift_api.swift \ - -module-name swift_module \ - -emit-objc-header-path swift_api.h \ +swiftc -c swift_api.swift \ + -module-name swift_module \ + -emit-objc-header-path third_party/swift_api.h \ -emit-library -o libswiftapi.dylib ``` @@ -43,7 +43,7 @@ need to set the language to objc, and set the entry-point to the header: language: objc headers: entry-points: - - 'swift_api.h' + - 'third_party/swift_api.h' ``` Swift classes become Objective-C interfaces, so include them like this: diff --git a/pkgs/ffigen/example/swift/config.yaml b/pkgs/ffigen/example/swift/config.yaml index 6082e97891..7f820baab0 100644 --- a/pkgs/ffigen/example/swift/config.yaml +++ b/pkgs/ffigen/example/swift/config.yaml @@ -12,10 +12,10 @@ objc-interfaces: 'SwiftClass': 'swift_module' headers: entry-points: - - 'swift_api.h' + - 'third_party/swift_api.h' preamble: | // ignore_for_file: camel_case_types, non_constant_identifier_names // ignore_for_file: unused_element, unused_field, return_of_invalid_type // ignore_for_file: void_checks, annotate_overrides // ignore_for_file: no_leading_underscores_for_local_identifiers - // ignore_for_file: library_private_types_in_public_api \ No newline at end of file + // ignore_for_file: library_private_types_in_public_api diff --git a/pkgs/ffigen/example/swift/swift_api.h b/pkgs/ffigen/example/swift/third_party/swift_api.h similarity index 100% rename from pkgs/ffigen/example/swift/swift_api.h rename to pkgs/ffigen/example/swift/third_party/swift_api.h diff --git a/pkgs/ffigen/lib/src/code_generator/objc_block.dart b/pkgs/ffigen/lib/src/code_generator/objc_block.dart index ba028d661f..7bbb4c0e43 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_block.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_block.dart @@ -13,6 +13,19 @@ class ObjCBlock extends BindingType { final ObjCBuiltInFunctions builtInFunctions; ObjCBlock({ + required String usr, + required Type returnType, + required List argTypes, + required ObjCBuiltInFunctions builtInFunctions, + }) : this._( + usr: usr, + name: _getBlockName(returnType, argTypes), + returnType: returnType, + argTypes: argTypes, + builtInFunctions: builtInFunctions, + ); + + ObjCBlock._({ required String usr, required String name, required this.returnType, @@ -24,6 +37,16 @@ class ObjCBlock extends BindingType { name: name, ); + // Generates a human readable name for the block based on the args and return + // type. These names will be pretty verbose and unweildy, but they're at least + // sensible and stable. Users can always add their own typedef with a simpler + // name if necessary. + static String _getBlockName(Type returnType, List argTypes) => + 'ObjCBlock_${[returnType, ...argTypes].map(_typeName).join('_')}'; + static String _typeName(Type type) => + type.toString().replaceAll(_illegalNameChar, ''); + static final _illegalNameChar = RegExp(r'[^0-9a-zA-Z]'); + @override BindingString toBindingString(Writer w) { final s = StringBuffer(); diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objc_block_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objc_block_parser.dart index f7ac6628c6..313de4e1e9 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objc_block_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objc_block_parser.dart @@ -32,7 +32,6 @@ ObjCBlock parseObjCBlock(clang_types.CXType cxtype) { return ObjCBlock( usr: usr.toString(), - name: 'ObjCBlock', returnType: returnType, argTypes: argTypes, builtInFunctions: objCBuiltInFunctions, diff --git a/pkgs/ffigen/test/example_tests/swift_example_test.dart b/pkgs/ffigen/test/example_tests/swift_example_test.dart index 02ed00ad02..a4ac61e5e6 100644 --- a/pkgs/ffigen/test/example_tests/swift_example_test.dart +++ b/pkgs/ffigen/test/example_tests/swift_example_test.dart @@ -31,7 +31,7 @@ void main() { '-module-name', 'swift_module', '-emit-objc-header-path', - 'swift_api.h', + 'third_party/swift_api.h', '-emit-library', '-o', 'libswiftapi.dylib', diff --git a/pkgs/ffigen/test/native_objc_test/block_test.dart b/pkgs/ffigen/test/native_objc_test/block_test.dart index 908e8fc4f5..0253eaf1d8 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.dart +++ b/pkgs/ffigen/test/native_objc_test/block_test.dart @@ -15,6 +15,13 @@ import '../test_utils.dart'; import 'block_bindings.dart'; import 'util.dart'; +// The generated block names are stable but verbose, so typedef them. +typedef IntBlock = ObjCBlock_Int32_Int32; +typedef FloatBlock = ObjCBlock_ffiFloat_ffiFloat; +typedef DoubleBlock = ObjCBlock_ffiDouble_ffiDouble; +typedef Vec4Block = ObjCBlock_Vec4_Vec4; +typedef VoidBlock = ObjCBlock_ffiVoid; + void main() { late BlockTestObjCLibrary lib; late void Function(Pointer, Pointer) executeInternalCommand; @@ -52,8 +59,8 @@ void main() { }); test('Block from function pointer', () { - final block = ObjCBlock1.fromFunctionPointer( - lib, Pointer.fromFunction(_add100, 999)); + final block = + IntBlock.fromFunctionPointer(lib, Pointer.fromFunction(_add100, 999)); final blockTester = BlockTester.makeFromBlock_(lib, block); blockTester.pokeBlock(); expect(blockTester.call_(123), 223); @@ -65,7 +72,7 @@ void main() { } test('Block from function', () { - final block = ObjCBlock1.fromFunction(lib, makeAdder(4000)); + final block = IntBlock.fromFunction(lib, makeAdder(4000)); final blockTester = BlockTester.makeFromBlock_(lib, block); blockTester.pokeBlock(); expect(blockTester.call_(123), 4123); @@ -75,7 +82,7 @@ void main() { test('Listener block same thread', () async { final hasRun = Completer(); int value = 0; - final block = ObjCBlock.listener(lib, () { + final block = VoidBlock.listener(lib, () { value = 123; hasRun.complete(); }); @@ -89,7 +96,7 @@ void main() { test('Listener block new thread', () async { final hasRun = Completer(); int value = 0; - final block = ObjCBlock.listener(lib, () { + final block = VoidBlock.listener(lib, () { value = 123; hasRun.complete(); }); @@ -102,7 +109,7 @@ void main() { }); test('Float block', () { - final block = ObjCBlock2.fromFunction(lib, (double x) { + final block = FloatBlock.fromFunction(lib, (double x) { return x + 4.56; }); expect(block(1.23), closeTo(5.79, 1e-6)); @@ -110,7 +117,7 @@ void main() { }); test('Double block', () { - final block = ObjCBlock3.fromFunction(lib, (double x) { + final block = DoubleBlock.fromFunction(lib, (double x) { return x + 4.56; }); expect(block(1.23), closeTo(5.79, 1e-6)); @@ -127,7 +134,7 @@ void main() { final tempPtr = calloc(); final temp = tempPtr.ref; - final block = ObjCBlock4.fromFunction(lib, (Vec4 v) { + final block = Vec4Block.fromFunction(lib, (Vec4 v) { // Twiddle the Vec4 components. temp.x = v.y; temp.y = v.z; @@ -156,8 +163,8 @@ void main() { }); Pointer funcPointerBlockRefCountTest() { - final block = ObjCBlock1.fromFunctionPointer( - lib, Pointer.fromFunction(_add100, 999)); + final block = + IntBlock.fromFunctionPointer(lib, Pointer.fromFunction(_add100, 999)); expect(BlockTester.getBlockRetainCount_(lib, block.pointer.cast()), 1); return block.pointer.cast(); } @@ -169,7 +176,7 @@ void main() { }); Pointer funcBlockRefCountTest() { - final block = ObjCBlock1.fromFunction(lib, makeAdder(4000)); + final block = IntBlock.fromFunction(lib, makeAdder(4000)); expect(BlockTester.getBlockRetainCount_(lib, block.pointer.cast()), 1); return block.pointer.cast(); } @@ -181,7 +188,7 @@ void main() { }); test('Block fields have sensible values', () { - final block = ObjCBlock1.fromFunction(lib, makeAdder(4000)); + final block = IntBlock.fromFunction(lib, makeAdder(4000)); final blockPtr = block.pointer; expect(blockPtr.ref.isa, isNot(0)); expect(blockPtr.ref.flags, isNot(0)); // Set by Block_copy. From e0b74862b75b354e0c4c2f4d58cf164a11957952 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Mon, 11 Sep 2023 21:32:38 -0700 Subject: [PATCH 257/276] [ffigen] Fix ObjC `instancetype` inheritance issue. (#618) * Fix #486 * changelog and format * Fix nit --- pkgs/ffigen/CHANGELOG.md | 1 + .../src/code_generator/objc_interface.dart | 13 ++-- .../inherited_instancetype_config.yaml | 13 ++++ .../inherited_instancetype_test.dart | 59 +++++++++++++++++++ .../inherited_instancetype_test.m | 33 +++++++++++ 5 files changed, 115 insertions(+), 4 deletions(-) create mode 100644 pkgs/ffigen/test/native_objc_test/inherited_instancetype_config.yaml create mode 100644 pkgs/ffigen/test/native_objc_test/inherited_instancetype_test.dart create mode 100644 pkgs/ffigen/test/native_objc_test/inherited_instancetype_test.m diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index b90e619881..efc5af315e 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -5,6 +5,7 @@ - Fix invalid exceptional return value ObjCBlocks that return floats. - Fix return_of_invalid_type analysis error for ObjCBlocks. - Fix crash in ObjC methods and blocks that return structs by value. +- Fix ObjC methods returning instancetype having the wrong type in sublasses. - Bump min SDK version to 3.2.0-114.0.dev. # 9.0.1 diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index bf4d887227..782d75c9fa 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -263,7 +263,7 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { if (superType != null) { superType!.addDependencies(dependencies); - _copyClassMethodsFromSuperType(); + _copyMethodsFromSuperType(); } for (final m in methods.values) { @@ -271,13 +271,18 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { } } - void _copyClassMethodsFromSuperType() { - // Copy class methods from the super type, because Dart classes don't - // inherit static methods. + void _copyMethodsFromSuperType() { + // We need to copy certain methods from the super type: + // - Class methods, because Dart classes don't inherit static methods. + // - Methods that return instancetype, because the subclass's copy of the + // method needs to return the subclass, not the super class. + // Note: instancetype is only allowed as a return type, not an arg type. for (final m in superType!.methods.values) { if (m.isClass && !_excludedNSObjectClassMethods.contains(m.originalName)) { addMethod(m); + } else if (_isInstanceType(m.returnType)) { + addMethod(m); } } } diff --git a/pkgs/ffigen/test/native_objc_test/inherited_instancetype_config.yaml b/pkgs/ffigen/test/native_objc_test/inherited_instancetype_config.yaml new file mode 100644 index 0000000000..926197921e --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/inherited_instancetype_config.yaml @@ -0,0 +1,13 @@ +name: InheritedInstancetypeTestObjCLibrary +description: 'Regression tests for https://github.com/dart-lang/ffigen/issues/486' +language: objc +output: 'inherited_instancetype_bindings.dart' +exclude-all-by-default: true +objc-interfaces: + include: + - ChildClass +headers: + entry-points: + - 'inherited_instancetype_test.m' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/inherited_instancetype_test.dart b/pkgs/ffigen/test/native_objc_test/inherited_instancetype_test.dart new file mode 100644 index 0000000000..93f93556d6 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/inherited_instancetype_test.dart @@ -0,0 +1,59 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +// Regression tests for https://github.com/dart-lang/ffigen/issues/486. + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:test/test.dart'; +import '../test_utils.dart'; +import 'inherited_instancetype_bindings.dart'; +import 'util.dart'; + +void main() { + late InheritedInstancetypeTestObjCLibrary lib; + + group('inheritedInstancetype', () { + setUpAll(() { + logWarnings(); + final dylib = + File('test/native_objc_test/inherited_instancetype_test.dylib'); + verifySetupFile(dylib); + lib = InheritedInstancetypeTestObjCLibrary( + DynamicLibrary.open(dylib.absolute.path)); + generateBindingsForCoverage('inherited_instancetype'); + }); + + test('Ordinary init method', () { + final ChildClass child = ChildClass.alloc(lib).init(); + expect(child.field, 123); + final ChildClass sameChild = child.getSelf(); + sameChild.field = 456; + expect(child.field, 456); + }); + + test('Custom create method', () { + final ChildClass child = ChildClass.create(lib); + expect(child.field, 123); + final ChildClass sameChild = child.getSelf(); + sameChild.field = 456; + expect(child.field, 456); + }); + + test('Polymorphism', () { + final ChildClass child = ChildClass.alloc(lib).init(); + final BaseClass base = child; + + // Calling base.getSelf() should still go through ChildClass.getSelf, so + // the result will have a compile time type of BaseClass, but a runtime + // type of ChildClass. + final BaseClass sameChild = base.getSelf(); + expect(sameChild, isA()); + }); + }); +} diff --git a/pkgs/ffigen/test/native_objc_test/inherited_instancetype_test.m b/pkgs/ffigen/test/native_objc_test/inherited_instancetype_test.m new file mode 100644 index 0000000000..8f1b20b883 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/inherited_instancetype_test.m @@ -0,0 +1,33 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#import + +@interface BaseClass : NSObject {} ++ (instancetype)create; +- (instancetype)getSelf; +@end + +@interface ChildClass : BaseClass {} +@property int32_t field; +@end + +@implementation BaseClass ++ (instancetype)create { + return [[[self class] alloc] init]; +} + +- (instancetype)getSelf { + return self; +} +@end + +@implementation ChildClass +- (instancetype)init { + if (self = [super init]) { + self.field = 123; + } + return self; +} +@end From f3b2369b22aba60dd76f14534ee851b2da052ff3 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Thu, 14 Sep 2023 22:41:13 -0700 Subject: [PATCH 258/276] [ffigen] Simplify flutter_plugin_ffi_test (#620) --- .../flutter_plugin_ffi_test.dart | 182 +++++++----------- 1 file changed, 70 insertions(+), 112 deletions(-) diff --git a/pkgs/ffigen/test_flutter/flutter_template_tests/flutter_plugin_ffi_test.dart b/pkgs/ffigen/test_flutter/flutter_template_tests/flutter_plugin_ffi_test.dart index 06b9df74ef..aa867313d8 100644 --- a/pkgs/ffigen/test_flutter/flutter_template_tests/flutter_plugin_ffi_test.dart +++ b/pkgs/ffigen/test_flutter/flutter_template_tests/flutter_plugin_ffi_test.dart @@ -32,32 +32,30 @@ void main() { final bindingsGeneratedCopyUri = libDirUri.resolve('${projectName}_bindings_generated_copy.dart'); - await Task.serial([ - RunProcess( - executable: 'flutter', - arguments: [ - 'create', - '--template=plugin_ffi', - projectName, - ], - workingDirectory: tempDirUri, - ), - Copy( - source: bindingsGeneratedUri, - target: bindingsGeneratedCopyUri, - ), - RunProcess( - executable: 'flutter', - arguments: [ - 'pub', - 'run', - 'ffigen', - '--config', - 'ffigen.yaml', - ], - workingDirectory: projectDirUri, - ), - ]).run(); + await runProcess( + executable: 'flutter', + arguments: [ + 'create', + '--template=plugin_ffi', + projectName, + ], + workingDirectory: tempDirUri, + ); + await copyFile( + source: bindingsGeneratedUri, + target: bindingsGeneratedCopyUri, + ); + await runProcess( + executable: 'flutter', + arguments: [ + 'pub', + 'run', + 'ffigen', + '--config', + 'ffigen.yaml', + ], + workingDirectory: projectDirUri, + ); final originalBindings = await readFileAsString(bindingsGeneratedCopyUri); final regeneratedBindings = await readFileAsString(bindingsGeneratedUri); @@ -71,96 +69,56 @@ Future readFileAsString(Uri uri) async { return contents.replaceAll('\r', ''); } -abstract class Task { - Future run(); - - factory Task.serial(Iterable tasks) => _SerialTask(tasks); -} - -class _SerialTask implements Task { - final Iterable tasks; - - _SerialTask(this.tasks); - - @override - Future run() async { - for (final task in tasks) { - await task.run(); - } - } -} - -class RunProcess implements Task { - final List arguments; - final String executable; - final Uri? workingDirectory; - Map? environment; - final bool throwOnFailure; - - RunProcess({ - required this.arguments, - required this.executable, - this.workingDirectory, - this.environment, - this.throwOnFailure = true, +Future runProcess({ + required List arguments, + required String executable, + Uri? workingDirectory, + Map? environment, + bool throwOnFailure = true, +}) async { + // Excluding [workingDirectory]. + final String commandString = [ + if (workingDirectory != null) '(cd ${workingDirectory.path};', + ...?environment?.entries.map((entry) => '${entry.key}=${entry.value}'), + executable, + ...arguments.map((a) => a.contains(' ') ? "'$a'" : a), + if (workingDirectory != null) ')', + ].join(' '); + + final workingDirectoryString = workingDirectory?.toFilePath(); + + print('Running `$commandString`.'); + final process = await Process.start(executable, arguments, + runInShell: true, + includeParentEnvironment: true, + workingDirectory: workingDirectoryString, + environment: environment) + .then((process) { + process.stdout.transform(utf8.decoder).forEach((s) => print(' $s')); + process.stderr.transform(utf8.decoder).forEach((s) => print(' $s')); + return process; }); - - /// Excluding [workingDirectory]. - String get commandString => [ - if (workingDirectory != null) '(cd ${workingDirectory!.path};', - ...?environment?.entries.map((entry) => '${entry.key}=${entry.value}'), - executable, - ...arguments.map((a) => a.contains(' ') ? "'$a'" : a), - if (workingDirectory != null) ')', - ].join(' '); - - @override - Future run() async { - final workingDirectoryString = workingDirectory?.toFilePath(); - - print('Running `$commandString`.'); - final process = await Process.start(executable, arguments, - runInShell: true, - includeParentEnvironment: true, - workingDirectory: workingDirectoryString, - environment: environment) - .then((process) { - process.stdout.transform(utf8.decoder).forEach((s) => print(' $s')); - process.stderr.transform(utf8.decoder).forEach((s) => print(' $s')); - return process; - }); - final exitCode = await process.exitCode; - if (exitCode != 0) { - final message = - 'Command `$commandString` failed with exit code $exitCode.'; - print(message); - if (throwOnFailure) { - throw Exception(message); - } + final exitCode = await process.exitCode; + if (exitCode != 0) { + final message = 'Command `$commandString` failed with exit code $exitCode.'; + print(message); + if (throwOnFailure) { + throw Exception(message); } - print('Command `$commandString` done.'); } + print('Command `$commandString` done.'); } -class Copy implements Task { - final Uri source; - final Uri target; - - Copy({ - required this.source, - required this.target, - }); - - @override - Future run() async { - final file = File.fromUri(source); - if (!await file.exists()) { - final message = - "File not in expected location: '${source.toFilePath()}'."; - print(message); - throw Exception(message); - } - print('Copying ${source.toFilePath()} to ${target.toFilePath()}.'); - await file.copy(target.toFilePath()); +Future copyFile({ + required Uri source, + required Uri target, +}) async { + final file = File.fromUri(source); + if (!await file.exists()) { + final message = "File not in expected location: '${source.toFilePath()}'."; + print(message); + throw Exception(message); } + print('Copying ${source.toFilePath()} to ${target.toFilePath()}.'); + await file.copy(target.toFilePath()); } From cb147547b624d8dad2db2295250f68bbd0014d3b Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Tue, 19 Sep 2023 14:30:48 -0700 Subject: [PATCH 259/276] [ffigen] Better typedefs for `NativeFunction`s (#621) * Fix #614 * Update test expectations * Hacky fix * Refactor * Fix analysis * Fix analysis * Fix analysis --- pkgs/ffigen/CHANGELOG.md | 2 + .../libclang-example/generated_bindings.dart | 29 +++++++------- .../lib/src/code_generator/func_type.dart | 25 ++++++++---- .../lib/src/code_generator/typealias.dart | 40 ++++++++++++++++++- .../_expected_dart_handle_bindings.dart | 4 +- ...expected_native_func_typedef_bindings.dart | 11 +++-- ..._expected_struct_fptr_fields_bindings.dart | 3 +- .../_expected_typedef_bindings.dart | 3 +- .../_expected_libclang_bindings.dart | 29 +++++++------- .../_expected_sqlite_bindings.dart | 19 ++++----- 10 files changed, 111 insertions(+), 54 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index efc5af315e..d9d4b88050 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -6,6 +6,8 @@ - Fix return_of_invalid_type analysis error for ObjCBlocks. - Fix crash in ObjC methods and blocks that return structs by value. - Fix ObjC methods returning instancetype having the wrong type in sublasses. +- When generating typedefs for `Pointer>`, also + generate a typedef for the `Function`. - Bump min SDK version to 3.2.0-114.0.dev. # 9.0.1 diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index fe7f3c4f7d..a0ae7a2eb7 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -9747,10 +9747,10 @@ typedef DartClang_getIBOutletCollectionType = CXType Function(CXCursor arg0); /// /// The visitor should return one of the \c CXChildVisitResult values /// to direct clang_visitCursorChildren(). -typedef CXCursorVisitor = ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function( - CXCursor cursor, CXCursor parent, CXClientData client_data)>>; +typedef CXCursorVisitor + = ffi.Pointer>; +typedef CXCursorVisitor_function = ffi.Int32 Function( + CXCursor cursor, CXCursor parent, CXClientData client_data); /// Describes how the traversal of the children of a particular /// cursor should proceed after visiting a particular child cursor. @@ -10425,13 +10425,13 @@ typedef DartClang_toggleCrashRecovery = void Function(int isEnabled); /// the second and third arguments provide the inclusion stack. The /// array is sorted in order of immediate inclusion. For example, /// the first element refers to the location that included 'included_file'. -typedef CXInclusionVisitor = ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - CXFile included_file, - ffi.Pointer inclusion_stack, - ffi.UnsignedInt include_len, - CXClientData client_data)>>; +typedef CXInclusionVisitor + = ffi.Pointer>; +typedef CXInclusionVisitor_function = ffi.Void Function( + CXFile included_file, + ffi.Pointer inclusion_stack, + ffi.UnsignedInt include_len, + CXClientData client_data); typedef NativeClang_getInclusions = ffi.Void Function( CXTranslationUnit tu, CXInclusionVisitor visitor, CXClientData client_data); typedef DartClang_getInclusions = void Function( @@ -11103,9 +11103,10 @@ typedef DartClang_indexLoc_getCXSourceLocation = CXSourceLocation Function( /// /// The visitor should return one of the \c CXVisitorResult values /// to direct \c clang_Type_visitFields. -typedef CXFieldVisitor = ffi.Pointer< - ffi - .NativeFunction>; +typedef CXFieldVisitor + = ffi.Pointer>; +typedef CXFieldVisitor_function = ffi.Int32 Function( + CXCursor C, CXClientData client_data); typedef NativeClang_Type_visitFields = ffi.UnsignedInt Function( CXType T, CXFieldVisitor visitor, CXClientData client_data); typedef DartClang_Type_visitFields = int Function( diff --git a/pkgs/ffigen/lib/src/code_generator/func_type.dart b/pkgs/ffigen/lib/src/code_generator/func_type.dart index d4c74f6866..675c85b15f 100644 --- a/pkgs/ffigen/lib/src/code_generator/func_type.dart +++ b/pkgs/ffigen/lib/src/code_generator/func_type.dart @@ -113,26 +113,35 @@ class FunctionType extends Type { /// Represents a NativeFunction. class NativeFunc extends Type { - final FunctionType type; + // Either a FunctionType or a Typealias of a FunctionType. + final Type _type; - NativeFunc(this.type); + NativeFunc(this._type) { + assert(_type is FunctionType || _type is Typealias); + } + + FunctionType get type { + if (_type is Typealias) { + return _type.typealiasType as FunctionType; + } + return _type as FunctionType; + } @override void addDependencies(Set dependencies) { - type.addDependencies(dependencies); + _type.addDependencies(dependencies); } @override String getCType(Writer w) => - '${w.ffiLibraryPrefix}.NativeFunction<${type.getCType(w)}>'; + '${w.ffiLibraryPrefix}.NativeFunction<${_type.getCType(w)}>'; @override - String getDartType(Writer w) => - '${w.ffiLibraryPrefix}.NativeFunction<${type.getCType(w)}>'; + String getDartType(Writer w) => getCType(w); @override - String toString() => 'NativeFunction<${type.toString()}>'; + String toString() => 'NativeFunction<${_type.toString()}>'; @override - String cacheKey() => 'NatFn(${type.cacheKey()})'; + String cacheKey() => 'NatFn(${_type.cacheKey()})'; } diff --git a/pkgs/ffigen/lib/src/code_generator/typealias.dart b/pkgs/ffigen/lib/src/code_generator/typealias.dart index 6a47f6182c..c7d95ca551 100644 --- a/pkgs/ffigen/lib/src/code_generator/typealias.dart +++ b/pkgs/ffigen/lib/src/code_generator/typealias.dart @@ -18,18 +18,47 @@ class Typealias extends BindingType { final Type type; final bool _useDartType; - Typealias({ + factory Typealias({ String? usr, String? originalName, String? dartDoc, required String name, - required this.type, + required Type type, /// If true, the binding string uses Dart type instead of C type. /// /// E.g if C type is ffi.Void func(ffi.Int32), Dart type is void func(int). bool useDartType = false, bool isInternal = false, + }) { + final funcType = _getFunctionTypeFromPointer(type); + if (funcType != null) { + type = PointerType(NativeFunc(Typealias._( + name: '${name}_function', + type: funcType, + useDartType: useDartType, + isInternal: isInternal, + ))); + } + return Typealias._( + usr: usr, + originalName: originalName, + dartDoc: dartDoc, + name: name, + type: type, + useDartType: useDartType, + isInternal: isInternal, + ); + } + + Typealias._({ + String? usr, + String? originalName, + String? dartDoc, + required String name, + required this.type, + bool useDartType = false, + bool isInternal = false, }) : _useDartType = useDartType, super( usr: usr, @@ -47,6 +76,13 @@ class Typealias extends BindingType { type.addDependencies(dependencies); } + static FunctionType? _getFunctionTypeFromPointer(Type type) { + if (type is! PointerType) return null; + final pointee = type.child; + if (pointee is! NativeFunc) return null; + return pointee.type; + } + @override BindingString toBindingString(Writer w) { final sb = StringBuffer(); diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart index 8455b7adfd..a6f44566f1 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart @@ -68,8 +68,8 @@ class NativeLibrary { late final _func4 = _func4Ptr.asFunction(); } -typedef Typedef1 - = ffi.Pointer>; +typedef Typedef1 = ffi.Pointer>; +typedef Typedef1_function = ffi.Void Function(ffi.Handle); final class Struct1 extends ffi.Opaque {} diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart index f77a57bfbe..ca4e5e615c 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart @@ -73,11 +73,16 @@ final class Struct extends ffi.Struct { } typedef WithTypedefReturnType - = ffi.Pointer>; -typedef InsideReturnType = ffi.Pointer>; + = ffi.Pointer>; +typedef WithTypedefReturnType_function = InsideReturnType Function(); +typedef InsideReturnType + = ffi.Pointer>; +typedef InsideReturnType_function = ffi.Void Function(); final class Struct2 extends ffi.Struct { external VoidFuncPointer constFuncPointer; } -typedef VoidFuncPointer = ffi.Pointer>; +typedef VoidFuncPointer + = ffi.Pointer>; +typedef VoidFuncPointer_function = ffi.Void Function(); diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_struct_fptr_fields_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_struct_fptr_fields_bindings.dart index 2a769db26e..8dc72979ac 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_struct_fptr_fields_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_struct_fptr_fields_bindings.dart @@ -69,4 +69,5 @@ final class S extends ffi.Struct { } typedef ArithmeticOperation - = ffi.Pointer>; + = ffi.Pointer>; +typedef ArithmeticOperation_function = ffi.Int Function(ffi.Int a, ffi.Int b); diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart index 885f6410ab..b0b171a057 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart @@ -92,7 +92,8 @@ final class Struct1 extends ffi.Struct { } typedef NamedFunctionProto - = ffi.Pointer>; + = ffi.Pointer>; +typedef NamedFunctionProto_function = ffi.Void Function(); final class AnonymousStructInTypedef extends ffi.Opaque {} diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index 2bc76881f2..d30109c4ce 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -7430,10 +7430,10 @@ abstract class CXChildVisitResult { } /// Visitor invoked for each cursor found by a traversal. -typedef CXCursorVisitor = ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function( - CXCursor cursor, CXCursor parent, CXClientData client_data)>>; +typedef CXCursorVisitor + = ffi.Pointer>; +typedef CXCursorVisitor_function = ffi.Int32 Function( + CXCursor cursor, CXCursor parent, CXClientData client_data); /// Opaque pointer representing client data that will be passed through to /// various callbacks and visitors. @@ -7761,13 +7761,13 @@ abstract class CXCompletionContext { /// Visitor invoked for each file in a translation unit (used with /// clang_getInclusions()). -typedef CXInclusionVisitor = ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - CXFile included_file, - ffi.Pointer inclusion_stack, - ffi.UnsignedInt include_len, - CXClientData client_data)>>; +typedef CXInclusionVisitor + = ffi.Pointer>; +typedef CXInclusionVisitor_function = ffi.Void Function( + CXFile included_file, + ffi.Pointer inclusion_stack, + ffi.UnsignedInt include_len, + CXClientData client_data); abstract class CXEvalResultKind { static const int CXEval_Int = 1; @@ -8224,9 +8224,10 @@ abstract class CXIndexOptFlags { } /// Visitor invoked for each field found by a traversal. -typedef CXFieldVisitor = ffi.Pointer< - ffi - .NativeFunction>; +typedef CXFieldVisitor + = ffi.Pointer>; +typedef CXFieldVisitor_function = ffi.Int32 Function( + CXCursor C, CXClientData client_data); const int CINDEX_VERSION_MAJOR = 0; diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index 984fad3c19..492da42957 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -10855,7 +10855,8 @@ final class sqlite3_vfs extends ffi.Struct { typedef sqlite3_int64 = sqlite_int64; typedef sqlite_int64 = ffi.LongLong; typedef sqlite3_syscall_ptr - = ffi.Pointer>; + = ffi.Pointer>; +typedef sqlite3_syscall_ptr_function = ffi.Void Function(); final class sqlite3_mem_methods extends ffi.Struct { /// Memory allocation function @@ -12008,14 +12009,14 @@ final class fts5_api extends ffi.Struct { xDestroy)>> xCreateFunction; } -typedef fts5_extension_function = ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer pApi, - ffi.Pointer pFts, - ffi.Pointer pCtx, - ffi.Int nVal, - ffi.Pointer> apVal)>>; +typedef fts5_extension_function + = ffi.Pointer>; +typedef fts5_extension_function_function = ffi.Void Function( + ffi.Pointer pApi, + ffi.Pointer pFts, + ffi.Pointer pCtx, + ffi.Int nVal, + ffi.Pointer> apVal); const String SQLITE_VERSION = '3.32.3'; From 5c7b78c3ef684c2adf546c6e8dc27d63ab02d78a Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Sun, 24 Sep 2023 16:33:51 -0700 Subject: [PATCH 260/276] [ffigen] Separate getDartType and getUserType (#623) * Separate getDartType and getUserType * Fix analysis * Document instancetype special casing * s/getDartType/getFfiDartType * s/getUserType/getDartType --- .../lib/src/code_generator/compound.dart | 4 +- .../lib/src/code_generator/enum_class.dart | 2 +- pkgs/ffigen/lib/src/code_generator/func.dart | 10 ++-- .../lib/src/code_generator/func_type.dart | 8 ++-- .../ffigen/lib/src/code_generator/global.dart | 2 +- .../ffigen/lib/src/code_generator/handle.dart | 2 +- .../lib/src/code_generator/imports.dart | 4 +- .../lib/src/code_generator/native_type.dart | 3 +- .../lib/src/code_generator/objc_block.dart | 29 ++++++----- .../src/code_generator/objc_interface.dart | 30 ++++-------- .../lib/src/code_generator/pointer.dart | 25 ++++++++-- pkgs/ffigen/lib/src/code_generator/type.dart | 18 +++++-- .../lib/src/code_generator/typealias.dart | 48 +++++++++++++++++-- 13 files changed, 123 insertions(+), 62 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/compound.dart b/pkgs/ffigen/lib/src/code_generator/compound.dart index db755826c9..c3eb55e95e 100644 --- a/pkgs/ffigen/lib/src/code_generator/compound.dart +++ b/pkgs/ffigen/lib/src/code_generator/compound.dart @@ -120,7 +120,7 @@ abstract class Compound extends BindingType { /// Marking type names because dart doesn't allow class member to have the /// same name as a type name used internally. for (final m in members) { - localUniqueNamer.markUsed(m.type.getDartType(w)); + localUniqueNamer.markUsed(m.type.getFfiDartType(w)); } /// Write @Packed(X) annotation if struct is packed. @@ -148,7 +148,7 @@ abstract class Compound extends BindingType { if (!sameDartAndCType(m.type, w)) { s.write('$depth@${m.type.getCType(w)}()\n'); } - s.write('${depth}external ${m.type.getDartType(w)} ${m.name};\n\n'); + s.write('${depth}external ${m.type.getFfiDartType(w)} ${m.name};\n\n'); } } s.write('}\n\n'); diff --git a/pkgs/ffigen/lib/src/code_generator/enum_class.dart b/pkgs/ffigen/lib/src/code_generator/enum_class.dart index 081c864f23..70d142b643 100644 --- a/pkgs/ffigen/lib/src/code_generator/enum_class.dart +++ b/pkgs/ffigen/lib/src/code_generator/enum_class.dart @@ -84,7 +84,7 @@ class EnumClass extends BindingType { String getCType(Writer w) => nativeType.getCType(w); @override - String getDartType(Writer w) => nativeType.getDartType(w); + String getFfiDartType(Writer w) => nativeType.getFfiDartType(w); @override String? getDefaultValue(Writer w, String nativeLib) => '0'; diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index f8d32e2414..f8a8177336 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -120,7 +120,7 @@ class Func extends LookUpBinding { : functionType.getCType(w, writeArgumentNames: false); final dartType = exposeFunctionTypedefs ? _exposedDartFunctionTypealias!.name - : functionType.getDartType(w, writeArgumentNames: false); + : functionType.getFfiDartType(w, writeArgumentNames: false); if (ffiNativeConfig.enabled) { final assetString = ffiNativeConfig.asset != null @@ -131,17 +131,17 @@ class Func extends LookUpBinding { "@${w.ffiLibraryPrefix}.Native<$cType>(symbol: '$originalName'$assetString$isLeafString)\n"); s.write( - 'external ${functionType.returnType.getDartType(w)} $enclosingFuncName(\n'); + 'external ${functionType.returnType.getFfiDartType(w)} $enclosingFuncName(\n'); for (final p in functionType.dartTypeParameters) { - s.write(' ${p.type.getDartType(w)} ${p.name},\n'); + s.write(' ${p.type.getFfiDartType(w)} ${p.name},\n'); } s.write(');\n\n'); } else { // Write enclosing function. s.write( - '${functionType.returnType.getDartType(w)} $enclosingFuncName(\n'); + '${functionType.returnType.getFfiDartType(w)} $enclosingFuncName(\n'); for (final p in functionType.dartTypeParameters) { - s.write(' ${p.type.getDartType(w)} ${p.name},\n'); + s.write(' ${p.type.getFfiDartType(w)} ${p.name},\n'); } s.write(') {\n'); s.write('return $funcVarName'); diff --git a/pkgs/ffigen/lib/src/code_generator/func_type.dart b/pkgs/ffigen/lib/src/code_generator/func_type.dart index 675c85b15f..3ee17d5933 100644 --- a/pkgs/ffigen/lib/src/code_generator/func_type.dart +++ b/pkgs/ffigen/lib/src/code_generator/func_type.dart @@ -65,16 +65,16 @@ class FunctionType extends Type { } @override - String getDartType(Writer w, {bool writeArgumentNames = true}) { + String getFfiDartType(Writer w, {bool writeArgumentNames = true}) { final sb = StringBuffer(); // Write return Type. - sb.write(returnType.getDartType(w)); + sb.write(returnType.getFfiDartType(w)); // Write Function. sb.write(' Function('); sb.write(dartTypeParameters.map((p) { - return '${p.type.getDartType(w)} ${writeArgumentNames ? p.name : ""}'; + return '${p.type.getFfiDartType(w)} ${writeArgumentNames ? p.name : ""}'; }).join(', ')); sb.write(')'); @@ -137,7 +137,7 @@ class NativeFunc extends Type { '${w.ffiLibraryPrefix}.NativeFunction<${_type.getCType(w)}>'; @override - String getDartType(Writer w) => getCType(w); + String getFfiDartType(Writer w) => getCType(w); @override String toString() => 'NativeFunction<${_type.toString()}>'; diff --git a/pkgs/ffigen/lib/src/code_generator/global.dart b/pkgs/ffigen/lib/src/code_generator/global.dart index 579d8ddaf4..5f2e6397c6 100644 --- a/pkgs/ffigen/lib/src/code_generator/global.dart +++ b/pkgs/ffigen/lib/src/code_generator/global.dart @@ -45,7 +45,7 @@ class Global extends LookUpBinding { s.write(makeDartDoc(dartDoc!)); } final pointerName = w.wrapperLevelUniqueNamer.makeUnique('_$globalVarName'); - final dartType = type.getDartType(w); + final dartType = type.getFfiDartType(w); final cType = type.getCType(w); s.write( diff --git a/pkgs/ffigen/lib/src/code_generator/handle.dart b/pkgs/ffigen/lib/src/code_generator/handle.dart index a1b2d47e3f..c3817f236d 100644 --- a/pkgs/ffigen/lib/src/code_generator/handle.dart +++ b/pkgs/ffigen/lib/src/code_generator/handle.dart @@ -16,7 +16,7 @@ class HandleType extends Type { String getCType(Writer w) => '${w.ffiLibraryPrefix}.Handle'; @override - String getDartType(Writer w) => 'Object'; + String getFfiDartType(Writer w) => 'Object'; @override String toString() => 'Handle'; diff --git a/pkgs/ffigen/lib/src/code_generator/imports.dart b/pkgs/ffigen/lib/src/code_generator/imports.dart index 93af5ad161..f75a26770f 100644 --- a/pkgs/ffigen/lib/src/code_generator/imports.dart +++ b/pkgs/ffigen/lib/src/code_generator/imports.dart @@ -40,7 +40,7 @@ class ImportedType extends Type { } @override - String getDartType(Writer w) => cType == dartType ? getCType(w) : dartType; + String getFfiDartType(Writer w) => cType == dartType ? getCType(w) : dartType; @override String toString() => '${libraryImport.name}.$cType'; @@ -62,7 +62,7 @@ class SelfImportedType extends Type { String getCType(Writer w) => cType; @override - String getDartType(Writer w) => dartType; + String getFfiDartType(Writer w) => dartType; @override String toString() => cType; diff --git a/pkgs/ffigen/lib/src/code_generator/native_type.dart b/pkgs/ffigen/lib/src/code_generator/native_type.dart index dfb43a574b..19425bab4e 100644 --- a/pkgs/ffigen/lib/src/code_generator/native_type.dart +++ b/pkgs/ffigen/lib/src/code_generator/native_type.dart @@ -54,7 +54,7 @@ class NativeType extends Type { String getCType(Writer w) => '${w.ffiLibraryPrefix}.$_cType'; @override - String getDartType(Writer w) => _dartType; + String getFfiDartType(Writer w) => _dartType; @override String toString() => _cType; @@ -67,7 +67,6 @@ class NativeType extends Type { } class BooleanType extends NativeType { - // Booleans are treated as uint8. const BooleanType._() : super._('Bool', 'bool', 'false'); static const _boolean = BooleanType._(); factory BooleanType() => _boolean; diff --git a/pkgs/ffigen/lib/src/code_generator/objc_block.dart b/pkgs/ffigen/lib/src/code_generator/objc_block.dart index 7bbb4c0e43..4c82a9130e 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_block.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_block.dart @@ -82,15 +82,15 @@ class ObjCBlock extends BindingType { '${w.ffiLibraryPrefix}.NativeCallable<${trampFuncType.getCType(w)}>'; // Write the function pointer based trampoline function. - s.write(returnType.getDartType(w)); + s.write(returnType.getFfiDartType(w)); s.write(' $funcPtrTrampoline(${blockPtr.getCType(w)} block'); for (int i = 0; i < params.length; ++i) { - s.write(', ${params[i].type.getDartType(w)} ${params[i].name}'); + s.write(', ${params[i].type.getFfiDartType(w)} ${params[i].name}'); } s.write(') {\n'); s.write(' ${isVoid ? '' : 'return '}block.ref.target.cast<' - '${natFnType.getDartType(w)}>().asFunction<' - '${funcType.getDartType(w)}>()('); + '${natFnType.getFfiDartType(w)}>().asFunction<' + '${funcType.getFfiDartType(w)}>()('); for (int i = 0; i < params.length; ++i) { s.write('${i == 0 ? '' : ', '}${params[i].name}'); } @@ -109,17 +109,17 @@ $voidPtr $registerClosure(Function fn) { '''); // Write the closure based trampoline function. - s.write(returnType.getDartType(w)); + s.write(returnType.getFfiDartType(w)); s.write(' $closureTrampoline(${blockPtr.getCType(w)} block'); for (int i = 0; i < params.length; ++i) { - s.write(', ${params[i].type.getDartType(w)} ${params[i].name}'); + s.write(', ${params[i].type.getFfiDartType(w)} ${params[i].name}'); } s.write(') {\n'); s.write(' ${isVoid ? '' : 'return '}'); s.write('($closureRegistry[block.ref.target.address]'); - s.write(' as ${returnType.getDartType(w)} Function('); + s.write(' as ${returnType.getFfiDartType(w)} Function('); for (int i = 0; i < params.length; ++i) { - s.write('${i == 0 ? '' : ', '}${params[i].type.getDartType(w)}'); + s.write('${i == 0 ? '' : ', '}${params[i].type.getFfiDartType(w)}'); } s.write('))'); s.write('('); @@ -154,7 +154,7 @@ class $name extends _ObjCBlockBase { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - $name.fromFunction(${w.className} lib, ${funcType.getDartType(w)} fn) : + $name.fromFunction(${w.className} lib, ${funcType.getFfiDartType(w)} fn) : this._(lib.${builtInFunctions.newBlock.name}( _dartFuncTrampoline ??= ${w.ffiLibraryPrefix}.Pointer.fromFunction< ${trampFuncType.getCType(w)}>($closureTrampoline @@ -175,7 +175,7 @@ class $name extends _ObjCBlockBase { /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - $name.listener(${w.className} lib, ${funcType.getDartType(w)} fn) : + $name.listener(${w.className} lib, ${funcType.getFfiDartType(w)} fn) : this._(lib.${builtInFunctions.newBlock.name}( (_dartFuncListenerTrampoline ??= $nativeCallableType.listener($closureTrampoline $exceptionalReturn)..keepIsolateAlive = false).nativeFunction.cast(), @@ -186,15 +186,15 @@ class $name extends _ObjCBlockBase { } // Call method. - s.write(' ${returnType.getDartType(w)} call('); + s.write(' ${returnType.getFfiDartType(w)} call('); for (int i = 0; i < params.length; ++i) { - s.write('${i == 0 ? '' : ', '}${params[i].type.getDartType(w)}'); + s.write('${i == 0 ? '' : ', '}${params[i].type.getFfiDartType(w)}'); s.write(' ${params[i].name}'); } s.write(''') { ${isVoid ? '' : 'return '}_id.ref.invoke.cast< ${natTrampFnType.getCType(w)}>().asFunction< - ${trampFuncType.getDartType(w)}>()(_id'''); + ${trampFuncType.getFfiDartType(w)}>()(_id'''); for (int i = 0; i < params.length; ++i) { s.write(', ${params[i].name}'); } @@ -222,6 +222,9 @@ class $name extends _ObjCBlockBase { String getCType(Writer w) => PointerType(builtInFunctions.blockStruct).getCType(w); + @override + String getDartType(Writer w) => name; + @override String toString() => '($returnType (^)(${argTypes.join(', ')}))'; } diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 782d75c9fa..12ebd14ee8 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -5,7 +5,6 @@ import 'package:ffigen/src/code_generator.dart'; import 'package:logging/logging.dart'; -import '../strings.dart' as strings; import 'binding_string.dart'; import 'utils.dart'; import 'writer.dart'; @@ -281,7 +280,7 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { if (m.isClass && !_excludedNSObjectClassMethods.contains(m.originalName)) { addMethod(m); - } else if (_isInstanceType(m.returnType)) { + } else if (m.returnType is ObjCInstanceType) { addMethod(m); } } @@ -355,13 +354,8 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { @override String getCType(Writer w) => PointerType(objCObjectType).getCType(w); - bool _isObject(Type type) => - type is PointerType && type.child == objCObjectType; - - bool _isInstanceType(Type type) => - type is Typealias && - type.originalName == strings.objcInstanceType && - _isObject(type.type); + @override + String getDartType(Writer w) => name; // Utils for converting between the internal types passed to native code, and // the external types visible to the user. For example, ObjCInterfaces are @@ -370,15 +364,11 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { bool _needsConverting(Type type) => type is ObjCInterface || type is ObjCBlock || - _isObject(type) || - _isInstanceType(type); + type is ObjCObjectPointer || + type is ObjCInstanceType; String _getConvertedType(Type type, Writer w, String enclosingClass) { - if (type is BooleanType) return 'bool'; - if (type is ObjCInterface) return type.name; - if (type is ObjCBlock) return type.name; - if (_isObject(type)) return 'NSObject'; - if (_isInstanceType(type)) return enclosingClass; + if (type is ObjCInstanceType) return enclosingClass; return type.getDartType(w); } @@ -393,8 +383,8 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { String _doArgConversion(ObjCMethodParam arg) { if (arg.type is ObjCInterface || - _isObject(arg.type) || - _isInstanceType(arg.type) || + arg.type is ObjCObjectPointer || + arg.type is ObjCInstanceType || arg.type is ObjCBlock) { if (arg.isNullable) { return '${arg.name}?._id ?? ffi.nullptr'; @@ -415,10 +405,10 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { if (type is ObjCBlock) { return '$prefix${type.name}._($value, $library)'; } - if (_isObject(type)) { + if (type is ObjCObjectPointer) { return '${prefix}NSObject._($value, $library, $ownerFlags)'; } - if (_isInstanceType(type)) { + if (type is ObjCInstanceType) { return '$prefix$enclosingClass._($value, $library, $ownerFlags)'; } return prefix + value; diff --git a/pkgs/ffigen/lib/src/code_generator/pointer.dart b/pkgs/ffigen/lib/src/code_generator/pointer.dart index cacb5b2f6e..f99ee53b5e 100644 --- a/pkgs/ffigen/lib/src/code_generator/pointer.dart +++ b/pkgs/ffigen/lib/src/code_generator/pointer.dart @@ -9,7 +9,15 @@ import 'writer.dart'; /// Represents a pointer. class PointerType extends Type { final Type child; - PointerType(this.child); + + PointerType._(this.child); + + factory PointerType(Type child) { + if (child == objCObjectType) { + return ObjCObjectPointer(); + } + return PointerType._(child); + } @override void addDependencies(Set dependencies) { @@ -33,7 +41,7 @@ class PointerType extends Type { /// Represents a constant array, which has a fixed size. class ConstantArray extends PointerType { final int length; - ConstantArray(this.length, Type child) : super(child); + ConstantArray(this.length, Type child) : super._(child); @override Type get baseArrayType => child.baseArrayType; @@ -50,7 +58,7 @@ class ConstantArray extends PointerType { /// Represents an incomplete array, which has an unknown size. class IncompleteArray extends PointerType { - IncompleteArray(Type child) : super(child); + IncompleteArray(Type child) : super._(child); @override Type get baseArrayType => child.baseArrayType; @@ -61,3 +69,14 @@ class IncompleteArray extends PointerType { @override String cacheKey() => '${child.cacheKey()}[]'; } + +/// A pointer to an NSObject. +class ObjCObjectPointer extends PointerType { + factory ObjCObjectPointer() => _inst; + + static final _inst = ObjCObjectPointer._(); + ObjCObjectPointer._() : super._(objCObjectType); + + @override + String getDartType(Writer w) => 'NSObject'; +} diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index 8468eca3a1..1a69b6070a 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -39,9 +39,14 @@ abstract class Type { /// passed to native code. String getCType(Writer w) => throw 'No mapping for type: $this'; - /// Returns the Dart type of the Type. This is the user visible type that is - /// passed to Dart code. - String getDartType(Writer w) => getCType(w); + /// Returns the Dart type of the Type. This is the type that is passed from + /// FFI to Dart code. + String getFfiDartType(Writer w) => getCType(w); + + /// Returns the user type of the Type. This is the type that is presented to + /// users by the ffigened API to users. For C bindings this is always the same + /// as getFfiDartType. For ObjC bindings this refers to the wrapper object. + String getDartType(Writer w) => getFfiDartType(w); /// Returns the string representation of the Type, for debugging purposes /// only. This string should not be printed as generated code. @@ -62,7 +67,7 @@ abstract class Type { } /// Function to check if the dart and C type string are same. -bool sameDartAndCType(Type t, Writer w) => t.getCType(w) == t.getDartType(w); +bool sameDartAndCType(Type t, Writer w) => t.getCType(w) == t.getFfiDartType(w); /// Base class for all Type bindings. /// @@ -97,7 +102,10 @@ abstract class BindingType extends NoLookUpBinding implements Type { bool get isIncompleteCompound => false; @override - String getDartType(Writer w) => getCType(w); + String getFfiDartType(Writer w) => getCType(w); + + @override + String getDartType(Writer w) => getFfiDartType(w); @override String toString() => originalName; diff --git a/pkgs/ffigen/lib/src/code_generator/typealias.dart b/pkgs/ffigen/lib/src/code_generator/typealias.dart index c7d95ca551..469a40b6f8 100644 --- a/pkgs/ffigen/lib/src/code_generator/typealias.dart +++ b/pkgs/ffigen/lib/src/code_generator/typealias.dart @@ -4,6 +4,7 @@ import 'package:ffigen/src/code_generator.dart'; +import '../strings.dart' as strings; import 'binding_string.dart'; import 'utils.dart'; import 'writer.dart'; @@ -40,6 +41,18 @@ class Typealias extends BindingType { isInternal: isInternal, ))); } + if ((originalName ?? name) == strings.objcInstanceType && + type is ObjCObjectPointer) { + return ObjCInstanceType._( + usr: usr, + originalName: originalName, + dartDoc: dartDoc, + name: name, + type: type, + useDartType: useDartType, + isInternal: isInternal, + ); + } return Typealias._( usr: usr, originalName: originalName, @@ -90,7 +103,7 @@ class Typealias extends BindingType { sb.write(makeDartDoc(dartDoc!)); } sb.write('typedef $name = '); - sb.write('${_useDartType ? type.getDartType(w) : type.getCType(w)};\n'); + sb.write('${_useDartType ? type.getFfiDartType(w) : type.getCType(w)};\n'); return BindingString( type: BindingStringType.typeDef, string: sb.toString()); } @@ -105,13 +118,13 @@ class Typealias extends BindingType { String getCType(Writer w) => name; @override - String getDartType(Writer w) { + String getFfiDartType(Writer w) { // Typealias cannot be used by name in Dart types unless both the C and Dart // type of the underlying types are same. if (sameDartAndCType(type, w)) { return name; } else { - return type.getDartType(w); + return type.getFfiDartType(w); } } @@ -122,3 +135,32 @@ class Typealias extends BindingType { String? getDefaultValue(Writer w, String nativeLib) => type.getDefaultValue(w, nativeLib); } + +/// Objective C's instancetype. +/// +/// This is an alias for an NSObject* that is special cased in code generation. +/// It's only valid as the return type of a method, and always appears as the +/// enclosing class's type, even in inherited methods. +class ObjCInstanceType extends Typealias { + ObjCInstanceType._({ + String? usr, + String? originalName, + String? dartDoc, + required String name, + required Type type, + + /// If true, the binding string uses Dart type instead of C type. + /// + /// E.g if C type is ffi.Void func(ffi.Int32), Dart type is void func(int). + bool useDartType = false, + bool isInternal = false, + }) : super._( + usr: usr, + originalName: originalName, + dartDoc: dartDoc, + name: name, + type: type, + useDartType: useDartType, + isInternal: isInternal, + ); +} From 24d7b679b92ad8759112bbabf6ee2163559f12dc Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Thu, 28 Sep 2023 13:12:44 -0700 Subject: [PATCH 261/276] [ffigen] Handle ObjC nullable annotations (#624) * Fix #334 * Fix analysis * fix swift test * Fix tests * Fix nullability bug * Fix formatting * Fix linker error * Fix static methods bug * fix objective_c_example_test --- pkgs/ffigen/lib/src/code_generator.dart | 1 + .../objc_built_in_functions.dart | 2 +- .../src/code_generator/objc_interface.dart | 107 +++++++++++------- .../lib/src/code_generator/objc_nullable.dart | 46 ++++++++ .../clang_bindings/clang_bindings.dart | 25 +++- pkgs/ffigen/lib/src/header_parser/parser.dart | 4 +- .../sub_parsers/objcinterfacedecl_parser.dart | 24 +--- .../type_extractor/extractor.dart | 20 +++- .../objective_c_example_test.dart | 6 +- .../native_objc_test/nullable_config.yaml | 2 +- .../nullable_inheritance_config.yaml | 14 +++ .../nullable_inheritance_test.dart | 74 ++++++++++++ .../nullable_inheritance_test.m | 69 +++++++++++ .../test/native_objc_test/nullable_test.dart | 21 ++-- pkgs/ffigen/tool/libclang_config.yaml | 1 + 15 files changed, 331 insertions(+), 85 deletions(-) create mode 100644 pkgs/ffigen/lib/src/code_generator/objc_nullable.dart create mode 100644 pkgs/ffigen/test/native_objc_test/nullable_inheritance_config.yaml create mode 100644 pkgs/ffigen/test/native_objc_test/nullable_inheritance_test.dart create mode 100644 pkgs/ffigen/test/native_objc_test/nullable_inheritance_test.m diff --git a/pkgs/ffigen/lib/src/code_generator.dart b/pkgs/ffigen/lib/src/code_generator.dart index 82b2ed6b32..5977439a03 100644 --- a/pkgs/ffigen/lib/src/code_generator.dart +++ b/pkgs/ffigen/lib/src/code_generator.dart @@ -19,6 +19,7 @@ export 'code_generator/native_type.dart'; export 'code_generator/objc_block.dart'; export 'code_generator/objc_built_in_functions.dart'; export 'code_generator/objc_interface.dart'; +export 'code_generator/objc_nullable.dart'; export 'code_generator/pointer.dart'; export 'code_generator/struct.dart'; export 'code_generator/type.dart'; diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index b092e738c0..b772861e8a 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -326,7 +326,7 @@ class $name implements ${w.ffiLibraryPrefix}.Finalizable { String toString() { final data = dataUsingEncoding_( 0x94000100 /* NSUTF16LittleEndianStringEncoding */); - return data.bytes.cast<${w.ffiPkgLibraryPrefix}.Utf16>().toDartString( + return data!.bytes.cast<${w.ffiPkgLibraryPrefix}.Utf16>().toDartString( length: length); } '''); diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 12ebd14ee8..325692abe9 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -76,10 +76,8 @@ class ObjCInterface extends BindingType { if (isStatic) { stringParams.add('${w.className} _lib'); } - stringParams.addAll(params.map((p) => - (_getConvertedType(p.type, w, name) + - (p.isNullable ? "? " : " ") + - p.name))); + stringParams.addAll( + params.map((p) => '${_getConvertedType(p.type, w, name)} ${p.name}')); return '(${stringParams.join(", ")})'; } @@ -146,8 +144,7 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { s.write(' '); if (isStatic) { s.write('static '); - s.write( - _getConvertedReturnType(returnType, w, name, m.isNullableReturn)); + s.write(_getConvertedType(returnType, w, name)); switch (m.kind) { case ObjCMethodKind.method: @@ -173,14 +170,12 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { switch (m.kind) { case ObjCMethodKind.method: // returnType methodName(...) - s.write(_getConvertedReturnType( - returnType, w, name, m.isNullableReturn)); + s.write(_getConvertedType(returnType, w, name)); s.write(' $methodName'); s.write(paramsToString(params, isStatic: false)); break; case ObjCMethodKind.propertyGetter: - s.write(_getConvertedReturnType( - returnType, w, name, m.isNullableReturn)); + s.write(_getConvertedType(returnType, w, name)); if (isStret) { // void getMethodName(Pointer stret, NativeLibrary _lib) s.write(' get'); @@ -219,8 +214,8 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { } s.write(');\n'); if (convertReturn) { - final result = _doReturnConversion(returnType, '_ret', name, '_lib', - m.isNullableReturn, m.isOwnedReturn); + final result = _doReturnConversion( + returnType, '_ret', name, '_lib', m.isOwnedReturn); s.write(' return $result;'); } @@ -263,6 +258,7 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { if (superType != null) { superType!.addDependencies(dependencies); _copyMethodsFromSuperType(); + _fixNullabilityOfOverriddenMethods(); } for (final m in methods.values) { @@ -280,12 +276,48 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { if (m.isClass && !_excludedNSObjectClassMethods.contains(m.originalName)) { addMethod(m); - } else if (m.returnType is ObjCInstanceType) { + } else if (_isInstanceType(m.returnType)) { addMethod(m); } } } + void _fixNullabilityOfOverriddenMethods() { + // ObjC ignores nullability when deciding if an override for an inherited + // method is valid. But in Dart it's invalid to override a method and change + // it's return type from non-null to nullable, or its arg type from nullable + // to non-null. So in these cases we have to make the non-null type + // nullable, to avoid Dart compile errors. + var superType_ = superType; + while (superType_ != null) { + for (final method in methods.values) { + final superMethod = superType_.methods[method.originalName]; + if (superMethod != null && !superMethod.isClass && !method.isClass) { + if (superMethod.returnType.typealiasType is! ObjCNullable && + method.returnType.typealiasType is ObjCNullable) { + superMethod.returnType = ObjCNullable(superMethod.returnType); + } + final numArgs = method.params.length < superMethod.params.length + ? method.params.length + : superMethod.params.length; + for (int i = 0; i < numArgs; ++i) { + final param = method.params[i]; + final superParam = superMethod.params[i]; + if (superParam.type.typealiasType is ObjCNullable && + param.type.typealiasType is! ObjCNullable) { + param.type = ObjCNullable(param.type); + } + } + } + } + superType_ = superType_.superType; + } + } + + static bool _isInstanceType(Type type) => + type is ObjCInstanceType || + (type is ObjCNullable && type.child is ObjCInstanceType); + void addMethod(ObjCMethod method) { final oldMethod = methods[method.originalName]; if (oldMethod != null) { @@ -365,39 +397,36 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { type is ObjCInterface || type is ObjCBlock || type is ObjCObjectPointer || - type is ObjCInstanceType; + type is ObjCInstanceType || + type is ObjCNullable; String _getConvertedType(Type type, Writer w, String enclosingClass) { if (type is ObjCInstanceType) return enclosingClass; - return type.getDartType(w); - } - - String _getConvertedReturnType( - Type type, Writer w, String enclosingClass, bool isNullableReturn) { - final result = _getConvertedType(type, w, enclosingClass); - if (isNullableReturn) { - return "$result?"; + if (type is ObjCNullable && type.child is ObjCInstanceType) { + return '$enclosingClass?'; } - return result; + return type.getDartType(w); } String _doArgConversion(ObjCMethodParam arg) { - if (arg.type is ObjCInterface || + if (arg.type is ObjCNullable) { + return '${arg.name}?._id ?? ffi.nullptr'; + } else if (arg.type is ObjCInterface || arg.type is ObjCObjectPointer || arg.type is ObjCInstanceType || arg.type is ObjCBlock) { - if (arg.isNullable) { - return '${arg.name}?._id ?? ffi.nullptr'; - } else { - return '${arg.name}._id'; - } + return '${arg.name}._id'; } return arg.name; } String _doReturnConversion(Type type, String value, String enclosingClass, - String library, bool isNullable, bool isOwnedReturn) { - final prefix = isNullable ? '$value.address == 0 ? null : ' : ''; + String library, bool isOwnedReturn) { + var prefix = ''; + if (type is ObjCNullable) { + prefix = '$value.address == 0 ? null : '; + type = type.child; + } final ownerFlags = 'retain: ${!isOwnedReturn}, release: true'; if (type is ObjCInterface) { return '$prefix${type.name}._($value, $library, $ownerFlags)'; @@ -432,8 +461,7 @@ class ObjCMethod { final String? dartDoc; final String originalName; final ObjCProperty? property; - final Type returnType; - final bool isNullableReturn; + Type returnType; final List params; final ObjCMethodKind kind; final bool isClass; @@ -448,7 +476,6 @@ class ObjCMethod { required this.kind, required this.isClass, required this.returnType, - this.isNullableReturn = false, List? params_, }) : params = params_ ?? []; @@ -488,7 +515,6 @@ class ObjCMethod { bool sameAs(ObjCMethod other) { if (originalName != other.originalName) return false; - if (isNullableReturn != other.isNullableReturn) return false; if (kind != other.kind) return false; if (isClass != other.isClass) return false; // msgSend is deduped by signature, so this check covers the signature. @@ -501,11 +527,16 @@ class ObjCMethod { originalName.startsWith('new') || originalName.startsWith('alloc') || originalName.contains(_copyRegExp); + + @override + String toString() => '$returnType $originalName(${params.join(', ')})'; } class ObjCMethodParam { - final Type type; + Type type; final String name; - final bool isNullable; - ObjCMethodParam(this.type, this.name, {this.isNullable = false}); + ObjCMethodParam(this.type, this.name); + + @override + String toString() => '$type $name'; } diff --git a/pkgs/ffigen/lib/src/code_generator/objc_nullable.dart b/pkgs/ffigen/lib/src/code_generator/objc_nullable.dart new file mode 100644 index 0000000000..2b0808279d --- /dev/null +++ b/pkgs/ffigen/lib/src/code_generator/objc_nullable.dart @@ -0,0 +1,46 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; + +import 'writer.dart'; + +/// An ObjC type annotated with nullable. Eg: +/// +(nullable NSObject*) methodWithNullableResult; +class ObjCNullable extends Type { + Type child; + + ObjCNullable(this.child) { + assert(isSupported(child)); + } + + static bool isSupported(Type type) => + type is ObjCInterface || + type is ObjCBlock || + type is ObjCObjectPointer || + type is ObjCInstanceType; + + @override + void addDependencies(Set dependencies) { + child.addDependencies(dependencies); + } + + @override + Type get baseType => child.baseType; + + @override + String getCType(Writer w) => child.getCType(w); + + @override + String getFfiDartType(Writer w) => child.getFfiDartType(w); + + @override + String getDartType(Writer w) => '${child.getDartType(w)}?'; + + @override + String toString() => '$child?'; + + @override + String cacheKey() => '${child.cacheKey()}?'; +} diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index fc5ca177ae..d5431a958f 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -915,6 +915,23 @@ class Clang { late final _clang_Type_getAlignOf = _clang_Type_getAlignOfPtr.asFunction(); + /// 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_Type_getModifiedType( + T, + ); + } + + late final _clang_Type_getModifiedTypePtr = + _lookup>( + 'clang_Type_getModifiedType'); + late final _clang_Type_getModifiedType = + _clang_Type_getModifiedTypePtr.asFunction(); + /// Determine whether the given cursor represents an anonymous /// tag or namespace int clang_Cursor_isAnonymous( @@ -2623,10 +2640,10 @@ abstract class CXChildVisitResult { /// /// The visitor should return one of the \c CXChildVisitResult values /// to direct clang_visitCursorChildren(). -typedef CXCursorVisitor = ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function( - CXCursor cursor, CXCursor parent, CXClientData client_data)>>; +typedef CXCursorVisitor + = ffi.Pointer>; +typedef CXCursorVisitor_function = ffi.Int32 Function( + CXCursor cursor, CXCursor parent, CXClientData client_data); /// Opaque pointer representing client data that will be passed through /// to various callbacks and visitors. diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index 871da44ef2..5be826fdf5 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -97,7 +97,9 @@ List parseToBindings() { 0, clang_types.CXTranslationUnit_Flags.CXTranslationUnit_SkipFunctionBodies | clang_types.CXTranslationUnit_Flags - .CXTranslationUnit_DetailedPreprocessingRecord, + .CXTranslationUnit_DetailedPreprocessingRecord | + clang_types + .CXTranslationUnit_Flags.CXTranslationUnit_IncludeAttributedTypes, ); if (tu == nullptr) { diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index 572190504f..dc3b78657c 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -175,9 +175,6 @@ void _parseProperty(clang_types.CXCursor cursor) { final isReadOnly = propertyAttributes & clang_types.CXObjCPropertyAttrKind.CXObjCPropertyAttr_readonly > 0; - // TODO(#334): Use the nullable attribute to decide this. - final isNullable = - cursor.type().kind == clang_types.CXTypeKind.CXType_ObjCObjectPointer; final property = ObjCProperty(fieldName); @@ -193,7 +190,6 @@ void _parseProperty(clang_types.CXCursor cursor) { kind: ObjCMethodKind.propertyGetter, isClass: isClass, returnType: fieldType, - isNullableReturn: isNullable, ); itf.addMethod(getter); @@ -208,8 +204,7 @@ void _parseProperty(clang_types.CXCursor cursor) { kind: ObjCMethodKind.propertySetter, isClass: isClass, returnType: NativeType(SupportedNativeType.Void)); - setter.params - .add(ObjCMethodParam(fieldType, 'value', isNullable: isNullable)); + setter.params.add(ObjCMethodParam(fieldType, 'value')); itf.addMethod(setter); } } @@ -264,22 +259,7 @@ int _parseMethodVisitor(clang_types.CXCursor cursor, } void _parseMethodParam(clang_types.CXCursor cursor) { - /* - TODO(#334): Change this to use: - - clang.clang_Type_getNullability(cursor.type()) == - clang_types.CXTypeNullabilityKind.CXTypeNullability_Nullable; - - NOTE: This will only work with the - - clang_types - .CXTranslationUnit_Flags.CXTranslationUnit_IncludeAttributedTypes - - option set. - */ final parsed = _methodStack.top; - final isNullable = - cursor.type().kind == clang_types.CXTypeKind.CXType_ObjCObjectPointer; final name = cursor.spelling(); final type = cursor.type().toCodeGenType(); if (type.isIncompleteCompound) { @@ -291,7 +271,7 @@ void _parseMethodParam(clang_types.CXCursor cursor) { } _logger.fine( ' >> Parameter: $type $name ${cursor.completeStringRepr()}'); - parsed.method.params.add(ObjCMethodParam(type, name, isNullable: isNullable)); + parsed.method.params.add(ObjCMethodParam(type, name)); } void _markMethodReturnsRetained(clang_types.CXCursor cursor) { diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart index c3c8054177..311c1e8b46 100644 --- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart +++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart @@ -116,8 +116,8 @@ Type getCodeGenType( case clang_types.CXTypeKind.CXType_FunctionNoProto: // Primarily used for function types with zero arguments. return _extractFromFunctionProto(cxtype, cursor: originalCursor); - case clang_types.CXTypeKind - .CXType_ConstantArray: // Primarily used for constant array in struct members. + case clang_types.CXTypeKind.CXType_ConstantArray: + // Primarily used for constant array in struct members. final numElements = clang.clang_getNumElements(cxtype); final elementType = clang.clang_getArrayElementType(cxtype).toCodeGenType(); @@ -125,13 +125,25 @@ Type getCodeGenType( return numElements == 0 ? IncompleteArray(elementType) : ConstantArray(numElements, elementType); - case clang_types.CXTypeKind - .CXType_IncompleteArray: // Primarily used for incomplete array in function parameters. + case clang_types.CXTypeKind.CXType_IncompleteArray: + // Primarily used for incomplete array in function parameters. return IncompleteArray( clang.clang_getArrayElementType(cxtype).toCodeGenType(), ); case clang_types.CXTypeKind.CXType_Bool: return BooleanType(); + case clang_types.CXTypeKind.CXType_Attributed: + case clang_types.CXTypeKind.CXType_Unexposed: + final innerType = getCodeGenType( + clang.clang_Type_getModifiedType(cxtype), + ignoreFilter: ignoreFilter, + originalCursor: originalCursor, + ); + final isNullable = clang.clang_Type_getNullability(cxtype) == + clang_types.CXTypeNullabilityKind.CXTypeNullability_Nullable; + return isNullable && ObjCNullable.isSupported(innerType) + ? ObjCNullable(innerType) + : innerType; default: var typeSpellKey = clang.clang_getTypeSpelling(cxtype).toStringAndDispose(); diff --git a/pkgs/ffigen/test/example_tests/objective_c_example_test.dart b/pkgs/ffigen/test/example_tests/objective_c_example_test.dart index b291edbc0b..eba22e6135 100644 --- a/pkgs/ffigen/test/example_tests/objective_c_example_test.dart +++ b/pkgs/ffigen/test/example_tests/objective_c_example_test.dart @@ -31,12 +31,12 @@ void main() { expect( output, contains( - 'static NSURL fileURLWithPath_(AVFAudio _lib, NSString? path) {')); + 'static NSURL fileURLWithPath_(AVFAudio _lib, NSString path) {')); expect(output, contains('class AVAudioPlayer extends NSObject {')); expect( output, - contains('AVAudioPlayer initWithContentsOfURL_error_(' - 'NSURL? url, ffi.Pointer> outError) {')); + contains('AVAudioPlayer? initWithContentsOfURL_error_(' + 'NSURL url, ffi.Pointer> outError) {')); expect(output, contains('double get duration {')); expect(output, contains('bool play() {')); }); diff --git a/pkgs/ffigen/test/native_objc_test/nullable_config.yaml b/pkgs/ffigen/test/native_objc_test/nullable_config.yaml index e46cf06078..eba9e77060 100644 --- a/pkgs/ffigen/test/native_objc_test/nullable_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/nullable_config.yaml @@ -1,5 +1,5 @@ name: NullableTestObjCLibrary -description: 'Tests calling Objective-C methods' +description: 'Tests nullability for Objective-C methods' language: objc output: 'nullable_bindings.dart' exclude-all-by-default: true diff --git a/pkgs/ffigen/test/native_objc_test/nullable_inheritance_config.yaml b/pkgs/ffigen/test/native_objc_test/nullable_inheritance_config.yaml new file mode 100644 index 0000000000..930a53129b --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/nullable_inheritance_config.yaml @@ -0,0 +1,14 @@ +name: NullableInheritanceTestObjCLibrary +description: 'Tests nullability of inherited Objective-C methods' +language: objc +output: 'nullable_inheritance_bindings.dart' +exclude-all-by-default: true +objc-interfaces: + include: + - NullableBase + - NullableChild +headers: + entry-points: + - 'nullable_inheritance_test.m' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/nullable_inheritance_test.dart b/pkgs/ffigen/test/native_objc_test/nullable_inheritance_test.dart new file mode 100644 index 0000000000..fd3052ce79 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/nullable_inheritance_test.dart @@ -0,0 +1,74 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:test/test.dart'; +import '../test_utils.dart'; +import 'nullable_inheritance_bindings.dart'; +import 'util.dart'; + +void main() { + late NullableInheritanceTestObjCLibrary lib; + late NullableBase nullableBase; + late NullableChild nullableChild; + late NSObject obj; + group('Nullable inheritance', () { + setUpAll(() { + logWarnings(); + final dylib = + File('test/native_objc_test/nullable_inheritance_test.dylib'); + verifySetupFile(dylib); + lib = NullableInheritanceTestObjCLibrary( + DynamicLibrary.open(dylib.absolute.path)); + nullableBase = NullableBase.new1(lib); + nullableChild = NullableChild.new1(lib); + obj = NSObject.new1(lib); + generateBindingsForCoverage('nullable'); + }); + + group('Base', () { + test('Nullable arguments', () { + expect(nullableBase.nullableArg_(obj), false); + expect(nullableBase.nullableArg_(null), true); + }); + + test('Non-null arguments', () { + expect(nullableBase.nonNullArg_(obj), false); + }); + + test('Nullable return', () { + expect(nullableBase.nullableReturn_(false), isA()); + expect(nullableBase.nullableReturn_(true), null); + }); + + test('Non-null return', () { + expect(nullableBase.nonNullReturn(), isA()); + }); + }); + + group('Child', () { + test('Nullable arguments, changed to non-null', () { + expect(nullableChild.nullableArg_(obj), false); + }); + + test('Non-null arguments, changed to nullable', () { + expect(nullableChild.nonNullArg_(obj), false); + expect(nullableChild.nonNullArg_(null), true); + }); + + test('Nullable return, changed to non-null', () { + expect(nullableChild.nullableReturn_(false), isA()); + }); + + test('Non-null return, changed to nullable', () { + expect(nullableChild.nonNullReturn(), null); + }); + }); + }); +} diff --git a/pkgs/ffigen/test/native_objc_test/nullable_inheritance_test.m b/pkgs/ffigen/test/native_objc_test/nullable_inheritance_test.m new file mode 100644 index 0000000000..035692cda4 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/nullable_inheritance_test.m @@ -0,0 +1,69 @@ +#import + +@interface NullableBase : NSObject {} + +-(BOOL) nullableArg:(nullable NSObject *)x; +-(BOOL) nonNullArg:(NSObject *)x; +-(nullable NSObject *) nullableReturn:(BOOL)r; +-(NSObject*) nonNullReturn; + +@end + +@implementation NullableBase + +-(BOOL) nullableArg:(nullable NSObject *)x { + return x == NULL; +} + +-(BOOL) nonNullArg:(NSObject *)x { + return x == NULL; +} + +-(nullable NSObject *) nullableReturn:(BOOL)r { + if (r) { + return nil; + } else { + return [NSObject new]; + } +} + +-(NSObject *) nonNullReturn { + return [NSObject new]; +} + +@end + +@interface NullableIntermediate : NullableBase {} +@end +@implementation NullableIntermediate +@end + +@interface NullableChild : NullableIntermediate {} + +// Redeclare the same methods with different nullability. +-(BOOL) nullableArg:(NSObject *)x; +-(BOOL) nonNullArg:(nullable NSObject *)x; +-(NSObject *) nullableReturn:(BOOL)r; +-(nullable NSObject *) nonNullReturn; + +@end + +@implementation NullableChild + +-(BOOL) nullableArg:(NSObject *)x { + return x == NULL; +} + +-(BOOL) nonNullArg:(nullable NSObject *)x { + return x == NULL; +} + +-(NSObject *) nullableReturn:(BOOL)r { + return [NSObject new]; +} + +-(nullable NSObject *) nonNullReturn { + return nil; +} + +@end diff --git a/pkgs/ffigen/test/native_objc_test/nullable_test.dart b/pkgs/ffigen/test/native_objc_test/nullable_test.dart index 8814dc5eff..9aed94e118 100644 --- a/pkgs/ffigen/test/native_objc_test/nullable_test.dart +++ b/pkgs/ffigen/test/native_objc_test/nullable_test.dart @@ -15,9 +15,9 @@ import 'util.dart'; void main() { late NullableTestObjCLibrary lib; - NullableInterface? nullableInterface; - NSObject? obj; - group('method calls', () { + late NullableInterface nullableInterface; + late NSObject obj; + group('Nullability', () { setUpAll(() { logWarnings(); final dylib = File('test/native_objc_test/nullable_test.dylib'); @@ -30,12 +30,12 @@ void main() { group('Nullable property', () { test('Not null', () { - nullableInterface!.nullableObjectProperty = obj!; - expect(nullableInterface!.nullableObjectProperty, obj!); + nullableInterface.nullableObjectProperty = obj; + expect(nullableInterface.nullableObjectProperty, obj); }); test('Null', () { - nullableInterface!.nullableObjectProperty = null; - expect(nullableInterface!.nullableObjectProperty, null); + nullableInterface.nullableObjectProperty = null; + expect(nullableInterface.nullableObjectProperty, null); }); }); @@ -46,12 +46,12 @@ void main() { test('Null', () { expect(NullableInterface.returnNil_(lib, true), null); }); - }, skip: "TODO(#334): enable this test"); + }); group('Nullable arguments', () { test('Not null', () { expect( - NullableInterface.isNullWithNullableNSObjectArg_(lib, obj!), false); + NullableInterface.isNullWithNullableNSObjectArg_(lib, obj), false); }); test('Null', () { expect( @@ -61,8 +61,7 @@ void main() { group('Not-nullable arguments', () { test('Not null', () { - expect( - NullableInterface.isNullWithNotNullableNSObjectPtrArg_(lib, obj!), + expect(NullableInterface.isNullWithNotNullableNSObjectPtrArg_(lib, obj), false); }); }); diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index b948e5ce1d..f569afd1c1 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -122,5 +122,6 @@ functions: - clang_Cursor_getObjCPropertyGetterName - clang_Cursor_getObjCPropertySetterName - clang_Type_getNullability + - clang_Type_getModifiedType - clang_Location_isInSystemHeader - clang_getClangVersion From f2b92916c75fb0d147dcb7ac4cb50cfcb29a1a5a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Oct 2023 22:42:03 +0000 Subject: [PATCH 262/276] [ffigen] Bump coverallsapp/github-action from 2.2.1 to 2.2.3 (#628) Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 2.2.1 to 2.2.3.
    Commits

    [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=coverallsapp/github-action&package-manager=github_actions&previous-version=2.2.1&new-version=2.2.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
    Dependabot commands and options
    You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    --- pkgs/ffigen/.github/workflows/test-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 75f4585131..82da061946 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -72,7 +72,7 @@ jobs: - name: Collect coverage run: ./tool/coverage.sh - name: Upload coverage - uses: coverallsapp/github-action@95b1a2355bd0e526ad2fd62da9fd386ad4c98474 + uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949 with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: lcov.info From 4b6894f5b5e7f712f60fb51350b02dfdb923ebc7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Oct 2023 22:42:05 +0000 Subject: [PATCH 263/276] [ffigen] Bump actions/checkout from 3.6.0 to 4.1.0 (#626) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/checkout](https://github.com/actions/checkout) from 3.6.0 to 4.1.0.
    Release notes

    Sourced from actions/checkout's releases.

    v4.1.0

    What's Changed

    New Contributors

    Full Changelog: https://github.com/actions/checkout/compare/v4.0.0...v4.1.0

    v4.0.0

    What's Changed

    New Contributors

    Full Changelog: https://github.com/actions/checkout/compare/v3...v4.0.0

    Changelog

    Sourced from actions/checkout's changelog.

    Changelog

    v4.1.0

    v4.0.0

    v3.6.0

    v3.5.3

    v3.5.2

    v3.5.1

    v3.5.0

    v3.4.0

    v3.3.0

    v3.2.0

    v3.1.0

    v3.0.2

    ... (truncated)

    Commits

    [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=3.6.0&new-version=4.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
    Dependabot commands and options
    You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    --- pkgs/ffigen/.github/workflows/test-package.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 82da061946..2954c843ac 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -22,7 +22,7 @@ jobs: # TODO: Change to 3.2.0 stable once it's released. sdk: [3.2.0-114.0.dev] steps: - - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: ${{ matrix.sdk }} @@ -42,7 +42,7 @@ jobs: needs: analyze runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: 3.2.0-114.0.dev @@ -59,7 +59,7 @@ jobs: needs: analyze runs-on: macos-latest steps: - - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: 3.2.0-114.0.dev @@ -81,7 +81,7 @@ jobs: needs: analyze runs-on: windows-latest steps: - - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: 3.2.0-114.0.dev @@ -106,7 +106,7 @@ jobs: needs: analyze runs-on: windows-latest steps: - - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa with: channel: "master" From 0f1ed374802d7fa0d3d0c3f506e39e5da7447133 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 18:25:13 +0000 Subject: [PATCH 264/276] [ffigen] Bump dart-lang/setup-dart from 1.5.0 to 1.5.1 (#627) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.5.0 to 1.5.1.
    Release notes

    Sourced from dart-lang/setup-dart's releases.

    v1.5.1

    • No longer test the setup-dart action on pre-2.12 SDKs.
    • Upgrade JS interop code to use extension types (the new name for inline classes).
    • The upcoming rename of the be channel to main is now supported with forward compatibility that switches when the rename happens.
    Changelog

    Sourced from dart-lang/setup-dart's changelog.

    v1.6.0

    • Enable provisioning of the latest Dart SDK patch release by specifying just the major and minor version (e.g. 3.2).

    v1.5.1

    • No longer test the setup-dart action on pre-2.12 SDKs.
    • Upgrade JS interop code to use extension types (the new name for inline classes).
    • The upcoming rename of the be channel to main is now supported with forward compatibility that switches when the rename happens.

    v1.5.0

    • Re-wrote the implementation of the action into Dart.
    • Auto-detect the platform architecture (x64, ia32, arm, arm64).
    • Improved the caching and download resilience of the sdk.
    • Added a new action output: dart-version - the installed version of the sdk.

    v1.4.0

    • Automatically create OIDC token for pub.dev.
    • Add a reusable workflow for publishing.

    v1.3.0

    • The install location of the Dart SDK is now available in an environment variable, DART_HOME (#43).
    • Fixed an issue where cached downloads could lead to unzip issues on self-hosted runners (#35).

    v1.2.0

    • Fixed a path issue impacting git dependencies on Windows.

    v1.1.0

    • Added a flavor option setup.sh to allow downloading unpublished builds.

    v1.0.0

    • Promoted to 1.0 stable.

    v0.5

    • Fixed a Windows pub global activate path issue.

    ... (truncated)

    Commits
    • 8a4b97e Support renaming the be channel to main. (#102)
    • 0970dcf Bump @​actions/http-client from 2.1.0 to 2.1.1 (#101)
    • e58aeb6 updates for the latest version of extension types (#100)
    • deafe40 Convert to extension types (#99)
    • cdb51ff Bump semver from 6.3.0 to 6.3.1 (#98)
    • e2fce12 update JS interop - remove JS typedef references (#97)
    • 42c988f set up a cron to build the action's javascript (#96)
    • 007c7cb blast_repo fixes (#92)
    • 08de7e0 Remove annotations no longer needed (#91)
    • bd8bef0 Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (#89)
    • Additional commits viewable in compare view

    [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=dart-lang/setup-dart&package-manager=github_actions&previous-version=1.5.0&new-version=1.5.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
    Dependabot commands and options
    You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    --- pkgs/ffigen/.github/workflows/test-package.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 2954c843ac..4cd755399e 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -23,7 +23,7 @@ jobs: sdk: [3.2.0-114.0.dev] steps: - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f + - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 with: sdk: ${{ matrix.sdk }} - id: install @@ -43,7 +43,7 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f + - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 with: sdk: 3.2.0-114.0.dev - name: Install dependencies @@ -60,7 +60,7 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f + - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 with: sdk: 3.2.0-114.0.dev - name: Install dependencies @@ -82,7 +82,7 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f + - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 with: sdk: 3.2.0-114.0.dev - name: Install dependencies From c71d38bd3ff63085bb9b68edd8787a5a1131404e Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Tue, 10 Oct 2023 07:29:11 -0700 Subject: [PATCH 265/276] [ffigen] Refactor `sameFfiDartAndCType` to not require a `Writer` (#629) --- pkgs/ffigen/lib/src/code_generator/compound.dart | 5 ++++- .../ffigen/lib/src/code_generator/enum_class.dart | 6 ++++++ pkgs/ffigen/lib/src/code_generator/func_type.dart | 15 +++++++++++++++ pkgs/ffigen/lib/src/code_generator/handle.dart | 3 +++ pkgs/ffigen/lib/src/code_generator/imports.dart | 6 ++++++ .../lib/src/code_generator/native_type.dart | 3 +++ .../ffigen/lib/src/code_generator/objc_block.dart | 6 ++++++ .../lib/src/code_generator/objc_interface.dart | 6 ++++++ .../lib/src/code_generator/objc_nullable.dart | 6 ++++++ pkgs/ffigen/lib/src/code_generator/pointer.dart | 7 +++++++ pkgs/ffigen/lib/src/code_generator/type.dart | 15 ++++++++++++--- pkgs/ffigen/lib/src/code_generator/typealias.dart | 8 +++++++- 12 files changed, 81 insertions(+), 5 deletions(-) diff --git a/pkgs/ffigen/lib/src/code_generator/compound.dart b/pkgs/ffigen/lib/src/code_generator/compound.dart index c3eb55e95e..ddc33c64d0 100644 --- a/pkgs/ffigen/lib/src/code_generator/compound.dart +++ b/pkgs/ffigen/lib/src/code_generator/compound.dart @@ -145,7 +145,7 @@ abstract class Compound extends BindingType { s.write('${depth}external ${_getInlineArrayTypeString(m.type, w)} '); s.write('${m.name};\n\n'); } else { - if (!sameDartAndCType(m.type, w)) { + if (!m.type.sameFfiDartAndCType) { s.write('$depth@${m.type.getCType(w)}()\n'); } s.write('${depth}external ${m.type.getFfiDartType(w)} ${m.name};\n\n'); @@ -173,6 +173,9 @@ abstract class Compound extends BindingType { @override String getCType(Writer w) => name; + + @override + bool get sameFfiDartAndCType => true; } class Member { diff --git a/pkgs/ffigen/lib/src/code_generator/enum_class.dart b/pkgs/ffigen/lib/src/code_generator/enum_class.dart index 70d142b643..089d7ed615 100644 --- a/pkgs/ffigen/lib/src/code_generator/enum_class.dart +++ b/pkgs/ffigen/lib/src/code_generator/enum_class.dart @@ -86,6 +86,12 @@ class EnumClass extends BindingType { @override String getFfiDartType(Writer w) => nativeType.getFfiDartType(w); + @override + bool get sameFfiDartAndCType => nativeType.sameFfiDartAndCType; + + @override + bool get sameDartAndCType => nativeType.sameDartAndCType; + @override String? getDefaultValue(Writer w, String nativeLib) => '0'; } diff --git a/pkgs/ffigen/lib/src/code_generator/func_type.dart b/pkgs/ffigen/lib/src/code_generator/func_type.dart index 3ee17d5933..e1d0793695 100644 --- a/pkgs/ffigen/lib/src/code_generator/func_type.dart +++ b/pkgs/ffigen/lib/src/code_generator/func_type.dart @@ -81,6 +81,18 @@ class FunctionType extends Type { return sb.toString(); } + @override + bool get sameFfiDartAndCType => + returnType.sameFfiDartAndCType && + parameters.every((p) => p.type.sameFfiDartAndCType) && + varArgParameters.every((p) => p.type.sameFfiDartAndCType); + + @override + bool get sameDartAndCType => + returnType.sameDartAndCType && + parameters.every((p) => p.type.sameDartAndCType) && + varArgParameters.every((p) => p.type.sameDartAndCType); + @override String toString() => _getCacheKeyString(false, (Type t) => t.toString()); @@ -139,6 +151,9 @@ class NativeFunc extends Type { @override String getFfiDartType(Writer w) => getCType(w); + @override + bool get sameFfiDartAndCType => true; + @override String toString() => 'NativeFunction<${_type.toString()}>'; diff --git a/pkgs/ffigen/lib/src/code_generator/handle.dart b/pkgs/ffigen/lib/src/code_generator/handle.dart index c3817f236d..aaa0649e76 100644 --- a/pkgs/ffigen/lib/src/code_generator/handle.dart +++ b/pkgs/ffigen/lib/src/code_generator/handle.dart @@ -18,6 +18,9 @@ class HandleType extends Type { @override String getFfiDartType(Writer w) => 'Object'; + @override + bool get sameFfiDartAndCType => false; + @override String toString() => 'Handle'; } diff --git a/pkgs/ffigen/lib/src/code_generator/imports.dart b/pkgs/ffigen/lib/src/code_generator/imports.dart index f75a26770f..e9dda1ccd2 100644 --- a/pkgs/ffigen/lib/src/code_generator/imports.dart +++ b/pkgs/ffigen/lib/src/code_generator/imports.dart @@ -42,6 +42,9 @@ class ImportedType extends Type { @override String getFfiDartType(Writer w) => cType == dartType ? getCType(w) : dartType; + @override + bool get sameFfiDartAndCType => cType == dartType; + @override String toString() => '${libraryImport.name}.$cType'; @@ -64,6 +67,9 @@ class SelfImportedType extends Type { @override String getFfiDartType(Writer w) => dartType; + @override + bool get sameFfiDartAndCType => cType == dartType; + @override String toString() => cType; } diff --git a/pkgs/ffigen/lib/src/code_generator/native_type.dart b/pkgs/ffigen/lib/src/code_generator/native_type.dart index 19425bab4e..93ed356114 100644 --- a/pkgs/ffigen/lib/src/code_generator/native_type.dart +++ b/pkgs/ffigen/lib/src/code_generator/native_type.dart @@ -56,6 +56,9 @@ class NativeType extends Type { @override String getFfiDartType(Writer w) => _dartType; + @override + bool get sameFfiDartAndCType => _cType == _dartType; + @override String toString() => _cType; diff --git a/pkgs/ffigen/lib/src/code_generator/objc_block.dart b/pkgs/ffigen/lib/src/code_generator/objc_block.dart index 4c82a9130e..e908abbcba 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_block.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_block.dart @@ -225,6 +225,12 @@ class $name extends _ObjCBlockBase { @override String getDartType(Writer w) => name; + @override + bool get sameFfiDartAndCType => true; + + @override + bool get sameDartAndCType => false; + @override String toString() => '($returnType (^)(${argTypes.join(', ')}))'; } diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 325692abe9..421a508dbf 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -389,6 +389,12 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { @override String getDartType(Writer w) => name; + @override + bool get sameFfiDartAndCType => true; + + @override + bool get sameDartAndCType => false; + // Utils for converting between the internal types passed to native code, and // the external types visible to the user. For example, ObjCInterfaces are // passed to native as Pointer, but the user sees the Dart wrapper diff --git a/pkgs/ffigen/lib/src/code_generator/objc_nullable.dart b/pkgs/ffigen/lib/src/code_generator/objc_nullable.dart index 2b0808279d..db57e5f3a6 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_nullable.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_nullable.dart @@ -38,6 +38,12 @@ class ObjCNullable extends Type { @override String getDartType(Writer w) => '${child.getDartType(w)}?'; + @override + bool get sameFfiDartAndCType => child.sameFfiDartAndCType; + + @override + bool get sameDartAndCType => false; + @override String toString() => '$child?'; diff --git a/pkgs/ffigen/lib/src/code_generator/pointer.dart b/pkgs/ffigen/lib/src/code_generator/pointer.dart index f99ee53b5e..7dfc7d6169 100644 --- a/pkgs/ffigen/lib/src/code_generator/pointer.dart +++ b/pkgs/ffigen/lib/src/code_generator/pointer.dart @@ -31,6 +31,10 @@ class PointerType extends Type { String getCType(Writer w) => '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>'; + // Both the C type and the FFI Dart type are 'Pointer<$cType>'. + @override + bool get sameFfiDartAndCType => true; + @override String toString() => '$child*'; @@ -79,4 +83,7 @@ class ObjCObjectPointer extends PointerType { @override String getDartType(Writer w) => 'NSObject'; + + @override + bool get sameDartAndCType => false; } diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index 1a69b6070a..6537a8584e 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -48,6 +48,12 @@ abstract class Type { /// as getFfiDartType. For ObjC bindings this refers to the wrapper object. String getDartType(Writer w) => getFfiDartType(w); + /// Returns whether the FFI dart type and C type string are same. + bool get sameFfiDartAndCType; + + /// Returns whether the dart type and C type string are same. + bool get sameDartAndCType => sameFfiDartAndCType; + /// Returns the string representation of the Type, for debugging purposes /// only. This string should not be printed as generated code. @override @@ -66,9 +72,6 @@ abstract class Type { String? getDefaultValue(Writer w, String nativeLib) => null; } -/// Function to check if the dart and C type string are same. -bool sameDartAndCType(Type t, Writer w) => t.getCType(w) == t.getFfiDartType(w); - /// Base class for all Type bindings. /// /// Since Dart doesn't have multiple inheritance, this type exists so that we @@ -107,6 +110,9 @@ abstract class BindingType extends NoLookUpBinding implements Type { @override String getDartType(Writer w) => getFfiDartType(w); + @override + bool get sameDartAndCType => sameFfiDartAndCType; + @override String toString() => originalName; @@ -125,4 +131,7 @@ class UnimplementedType extends Type { @override String toString() => '(Unimplemented: $reason)'; + + @override + bool get sameFfiDartAndCType => true; } diff --git a/pkgs/ffigen/lib/src/code_generator/typealias.dart b/pkgs/ffigen/lib/src/code_generator/typealias.dart index 469a40b6f8..5c5cc443a3 100644 --- a/pkgs/ffigen/lib/src/code_generator/typealias.dart +++ b/pkgs/ffigen/lib/src/code_generator/typealias.dart @@ -121,13 +121,19 @@ class Typealias extends BindingType { String getFfiDartType(Writer w) { // Typealias cannot be used by name in Dart types unless both the C and Dart // type of the underlying types are same. - if (sameDartAndCType(type, w)) { + if (type.sameFfiDartAndCType) { return name; } else { return type.getFfiDartType(w); } } + @override + bool get sameFfiDartAndCType => type.sameFfiDartAndCType; + + @override + bool get sameDartAndCType => type.sameDartAndCType; + @override String cacheKey() => type.cacheKey(); From 8b765d73bec55557b1262ab2ad7dc135308b985a Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 11 Oct 2023 14:18:46 -0700 Subject: [PATCH 266/276] [ffigen] Typedefs for Dart types (#625) * WIP fix #386 * Fix tests * fmt * Update test expectations * Update test expectations * Fix analysis * fmt * Fix more tests * WIP refactor * Refactor `sameFfiDartAndCType` to not require a `Writer` * Fix tests * Fix analysis * Update test expectations * Format * Fix typedef_test.dart * Fix nits * Fix tests * Fmt * Regenerate more test files * Regen more tests * Remove accidental commit --- .../c_json/cjson_generated_bindings.dart | 1 + .../libclang-example/generated_bindings.dart | 21 +++-- pkgs/ffigen/lib/src/code_generator/func.dart | 27 +++---- .../src/code_generator/objc_interface.dart | 52 ++++++------ .../lib/src/code_generator/typealias.dart | 64 +++++++++------ .../decl_decl_collision_test.dart | 50 ++---------- ...expected_decl_decl_collision_bindings.dart | 80 +++++++++++++++++++ ...d_reserved_keyword_collision_bindings.dart | 61 ++++++++++++++ .../reserved_keyword_collision_test.dart | 43 ++-------- .../_expected_dart_handle_bindings.dart | 5 +- ...expected_native_func_typedef_bindings.dart | 14 ++-- ..._expected_struct_fptr_fields_bindings.dart | 5 +- .../_expected_typedef_bindings.dart | 6 +- .../_expected_cjson_bindings.dart | 1 + .../_expected_libclang_bindings.dart | 21 +++-- .../_expected_sqlite_bindings.dart | 18 ++++- .../test/native_objc_test/typedef_config.yaml | 17 ++++ .../test/native_objc_test/typedef_test.dart | 35 ++++++++ .../test/native_objc_test/typedef_test.m | 20 +++++ pkgs/ffigen/test/regen.dart | 45 ++++------- pkgs/ffigen/test/test_utils.dart | 4 +- 21 files changed, 388 insertions(+), 202 deletions(-) create mode 100644 pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_decl_collision_bindings.dart create mode 100644 pkgs/ffigen/test/collision_tests/expected_bindings/_expected_reserved_keyword_collision_bindings.dart create mode 100644 pkgs/ffigen/test/native_objc_test/typedef_config.yaml create mode 100644 pkgs/ffigen/test/native_objc_test/typedef_test.dart create mode 100644 pkgs/ffigen/test/native_objc_test/typedef_test.m diff --git a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart index fa9e56efaa..38bc263f8d 100644 --- a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart +++ b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart @@ -1268,6 +1268,7 @@ final class cJSON_Hooks extends ffi.Struct { } typedef cJSON_bool = ffi.Int; +typedef DartcJSON_bool = int; const int CJSON_VERSION_MAJOR = 1; diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index a0ae7a2eb7..7cf663e388 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -9748,8 +9748,10 @@ typedef DartClang_getIBOutletCollectionType = CXType Function(CXCursor arg0); /// The visitor should return one of the \c CXChildVisitResult values /// to direct clang_visitCursorChildren(). typedef CXCursorVisitor - = ffi.Pointer>; -typedef CXCursorVisitor_function = ffi.Int32 Function( + = ffi.Pointer>; +typedef CXCursorVisitorFunction = ffi.Int32 Function( + CXCursor cursor, CXCursor parent, CXClientData client_data); +typedef DartCXCursorVisitorFunction = int Function( CXCursor cursor, CXCursor parent, CXClientData client_data); /// Describes how the traversal of the children of a particular @@ -10426,12 +10428,17 @@ typedef DartClang_toggleCrashRecovery = void Function(int isEnabled); /// array is sorted in order of immediate inclusion. For example, /// the first element refers to the location that included 'included_file'. typedef CXInclusionVisitor - = ffi.Pointer>; -typedef CXInclusionVisitor_function = ffi.Void Function( + = ffi.Pointer>; +typedef CXInclusionVisitorFunction = ffi.Void Function( CXFile included_file, ffi.Pointer inclusion_stack, ffi.UnsignedInt include_len, CXClientData client_data); +typedef DartCXInclusionVisitorFunction = void Function( + CXFile included_file, + ffi.Pointer inclusion_stack, + int include_len, + CXClientData client_data); typedef NativeClang_getInclusions = ffi.Void Function( CXTranslationUnit tu, CXInclusionVisitor visitor, CXClientData client_data); typedef DartClang_getInclusions = void Function( @@ -11104,8 +11111,10 @@ typedef DartClang_indexLoc_getCXSourceLocation = CXSourceLocation Function( /// The visitor should return one of the \c CXVisitorResult values /// to direct \c clang_Type_visitFields. typedef CXFieldVisitor - = ffi.Pointer>; -typedef CXFieldVisitor_function = ffi.Int32 Function( + = ffi.Pointer>; +typedef CXFieldVisitorFunction = ffi.Int32 Function( + CXCursor C, CXClientData client_data); +typedef DartCXFieldVisitorFunction = int Function( CXCursor C, CXClientData client_data); typedef NativeClang_Type_visitFields = ffi.UnsignedInt Function( CXType T, CXFieldVisitor visitor, CXClientData client_data); diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index f8a8177336..b3141ae11a 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -46,8 +46,7 @@ class Func extends LookUpBinding { late final String funcPointerName; /// Contains typealias for function type if [exposeFunctionTypedefs] is true. - Typealias? _exposedCFunctionTypealias; - Typealias? _exposedDartFunctionTypealias; + Typealias? _exposedFunctionTypealias; /// [originalName] is looked up in dynamic library, if not /// provided, takes the value of [name]. @@ -85,15 +84,10 @@ class Func extends LookUpBinding { // Get function name with first letter in upper case. final upperCaseName = name[0].toUpperCase() + name.substring(1); if (exposeFunctionTypedefs) { - _exposedCFunctionTypealias = Typealias( - name: 'Native$upperCaseName', + _exposedFunctionTypealias = Typealias( + name: upperCaseName, type: functionType, - isInternal: true, - ); - _exposedDartFunctionTypealias = Typealias( - name: 'Dart$upperCaseName', - type: functionType, - useDartType: true, + genFfiDartType: true, isInternal: true, ); } @@ -115,12 +109,10 @@ class Func extends LookUpBinding { p.name = paramNamer.makeUnique(p.name); } - final cType = exposeFunctionTypedefs - ? _exposedCFunctionTypealias!.name - : functionType.getCType(w, writeArgumentNames: false); - final dartType = exposeFunctionTypedefs - ? _exposedDartFunctionTypealias!.name - : functionType.getFfiDartType(w, writeArgumentNames: false); + final cType = _exposedFunctionTypealias?.getCType(w) ?? + functionType.getCType(w, writeArgumentNames: false); + final dartType = _exposedFunctionTypealias?.getFfiDartType(w) ?? + functionType.getFfiDartType(w, writeArgumentNames: false); if (ffiNativeConfig.enabled) { final assetString = ffiNativeConfig.asset != null @@ -180,8 +172,7 @@ class Func extends LookUpBinding { dependencies.add(this); functionType.addDependencies(dependencies); if (exposeFunctionTypedefs) { - _exposedCFunctionTypealias!.addDependencies(dependencies); - _exposedDartFunctionTypealias!.addDependencies(dependencies); + _exposedFunctionTypealias!.addDependencies(dependencies); } } } diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 421a508dbf..c79ccca118 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -314,9 +314,11 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { } } - static bool _isInstanceType(Type type) => - type is ObjCInstanceType || - (type is ObjCNullable && type.child is ObjCInstanceType); + static bool _isInstanceType(Type type) { + if (type is ObjCInstanceType) return true; + final baseType = type.typealiasType; + return baseType is ObjCNullable && baseType.child is ObjCInstanceType; + } void addMethod(ObjCMethod method) { final oldMethod = methods[method.originalName]; @@ -400,27 +402,29 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { // passed to native as Pointer, but the user sees the Dart wrapper // class. These methods need to be kept in sync. bool _needsConverting(Type type) => - type is ObjCInterface || - type is ObjCBlock || - type is ObjCObjectPointer || type is ObjCInstanceType || - type is ObjCNullable; + type.typealiasType is ObjCInterface || + type.typealiasType is ObjCBlock || + type.typealiasType is ObjCObjectPointer || + type.typealiasType is ObjCNullable; String _getConvertedType(Type type, Writer w, String enclosingClass) { if (type is ObjCInstanceType) return enclosingClass; - if (type is ObjCNullable && type.child is ObjCInstanceType) { + final baseType = type.typealiasType; + if (baseType is ObjCNullable && baseType.child is ObjCInstanceType) { return '$enclosingClass?'; } return type.getDartType(w); } String _doArgConversion(ObjCMethodParam arg) { - if (arg.type is ObjCNullable) { + final baseType = arg.type.typealiasType; + if (baseType is ObjCNullable) { return '${arg.name}?._id ?? ffi.nullptr'; - } else if (arg.type is ObjCInterface || - arg.type is ObjCObjectPointer || - arg.type is ObjCInstanceType || - arg.type is ObjCBlock) { + } else if (arg.type is ObjCInstanceType || + baseType is ObjCInterface || + baseType is ObjCObjectPointer || + baseType is ObjCBlock) { return '${arg.name}._id'; } return arg.name; @@ -429,22 +433,24 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { String _doReturnConversion(Type type, String value, String enclosingClass, String library, bool isOwnedReturn) { var prefix = ''; - if (type is ObjCNullable) { + var baseType = type.typealiasType; + if (baseType is ObjCNullable) { prefix = '$value.address == 0 ? null : '; - type = type.child; + type = baseType.child; + baseType = type.typealiasType; } final ownerFlags = 'retain: ${!isOwnedReturn}, release: true'; - if (type is ObjCInterface) { - return '$prefix${type.name}._($value, $library, $ownerFlags)'; + if (type is ObjCInstanceType) { + return '$prefix$enclosingClass._($value, $library, $ownerFlags)'; } - if (type is ObjCBlock) { - return '$prefix${type.name}._($value, $library)'; + if (baseType is ObjCInterface) { + return '$prefix${baseType.name}._($value, $library, $ownerFlags)'; } - if (type is ObjCObjectPointer) { - return '${prefix}NSObject._($value, $library, $ownerFlags)'; + if (baseType is ObjCBlock) { + return '$prefix${baseType.name}._($value, $library)'; } - if (type is ObjCInstanceType) { - return '$prefix$enclosingClass._($value, $library, $ownerFlags)'; + if (baseType is ObjCObjectPointer) { + return '${prefix}NSObject._($value, $library, $ownerFlags)'; } return prefix + value; } diff --git a/pkgs/ffigen/lib/src/code_generator/typealias.dart b/pkgs/ffigen/lib/src/code_generator/typealias.dart index 5c5cc443a3..ec9430e282 100644 --- a/pkgs/ffigen/lib/src/code_generator/typealias.dart +++ b/pkgs/ffigen/lib/src/code_generator/typealias.dart @@ -17,27 +17,28 @@ import 'writer.dart'; /// ``` class Typealias extends BindingType { final Type type; - final bool _useDartType; + String? _ffiDartAliasName; + String? _dartAliasName; + /// Creates a Typealias. + /// + /// If [genFfiDartType] is true, a binding is generated for the Ffi Dart type + /// in addition to the C type. See [Type.getFfiDartType]. factory Typealias({ String? usr, String? originalName, String? dartDoc, required String name, required Type type, - - /// If true, the binding string uses Dart type instead of C type. - /// - /// E.g if C type is ffi.Void func(ffi.Int32), Dart type is void func(int). - bool useDartType = false, + bool genFfiDartType = false, bool isInternal = false, }) { final funcType = _getFunctionTypeFromPointer(type); if (funcType != null) { type = PointerType(NativeFunc(Typealias._( - name: '${name}_function', + name: '${name}Function', type: funcType, - useDartType: useDartType, + genFfiDartType: genFfiDartType, isInternal: isInternal, ))); } @@ -49,7 +50,7 @@ class Typealias extends BindingType { dartDoc: dartDoc, name: name, type: type, - useDartType: useDartType, + genFfiDartType: genFfiDartType, isInternal: isInternal, ); } @@ -59,7 +60,7 @@ class Typealias extends BindingType { dartDoc: dartDoc, name: name, type: type, - useDartType: useDartType, + genFfiDartType: genFfiDartType, isInternal: isInternal, ); } @@ -70,12 +71,16 @@ class Typealias extends BindingType { String? dartDoc, required String name, required this.type, - bool useDartType = false, + bool genFfiDartType = false, bool isInternal = false, - }) : _useDartType = useDartType, + }) : _ffiDartAliasName = genFfiDartType ? 'Dart$name' : null, + _dartAliasName = + (!genFfiDartType && type is! Typealias && !type.sameDartAndCType) + ? 'Dart$name' + : null, super( usr: usr, - name: name, + name: genFfiDartType ? 'Native$name' : name, dartDoc: dartDoc, originalName: originalName, isInternal: isInternal, @@ -98,12 +103,24 @@ class Typealias extends BindingType { @override BindingString toBindingString(Writer w) { + if (_ffiDartAliasName != null) { + _ffiDartAliasName = w.topLevelUniqueNamer.makeUnique(_ffiDartAliasName!); + } + if (_dartAliasName != null) { + _dartAliasName = w.topLevelUniqueNamer.makeUnique(_dartAliasName!); + } + final sb = StringBuffer(); if (dartDoc != null) { sb.write(makeDartDoc(dartDoc!)); } - sb.write('typedef $name = '); - sb.write('${_useDartType ? type.getFfiDartType(w) : type.getCType(w)};\n'); + sb.write('typedef $name = ${type.getCType(w)};\n'); + if (_ffiDartAliasName != null) { + sb.write('typedef $_ffiDartAliasName = ${type.getFfiDartType(w)};\n'); + } + if (_dartAliasName != null) { + sb.write('typedef $_dartAliasName = ${type.getDartType(w)};\n'); + } return BindingString( type: BindingStringType.typeDef, string: sb.toString()); } @@ -119,15 +136,18 @@ class Typealias extends BindingType { @override String getFfiDartType(Writer w) { - // Typealias cannot be used by name in Dart types unless both the C and Dart - // type of the underlying types are same. - if (type.sameFfiDartAndCType) { + if (_ffiDartAliasName != null) { + return _ffiDartAliasName!; + } else if (type.sameFfiDartAndCType) { return name; } else { return type.getFfiDartType(w); } } + @override + String getDartType(Writer w) => _dartAliasName ?? type.getDartType(w); + @override bool get sameFfiDartAndCType => type.sameFfiDartAndCType; @@ -154,11 +174,7 @@ class ObjCInstanceType extends Typealias { String? dartDoc, required String name, required Type type, - - /// If true, the binding string uses Dart type instead of C type. - /// - /// E.g if C type is ffi.Void func(ffi.Int32), Dart type is void func(int). - bool useDartType = false, + bool genFfiDartType = false, bool isInternal = false, }) : super._( usr: usr, @@ -166,7 +182,7 @@ class ObjCInstanceType extends Typealias { dartDoc: dartDoc, name: name, type: type, - useDartType: useDartType, + genFfiDartType: genFfiDartType, isInternal: isInternal, ); } diff --git a/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart index 4529f29014..1edcaeb111 100644 --- a/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/decl_decl_collision_test.dart @@ -13,7 +13,7 @@ void main() { logWarnings(Level.SEVERE); }); test('declaration conflict', () { - final l1 = Library(name: 'Bindings', bindings: [ + final library = Library(name: 'Bindings', bindings: [ Struct(name: 'TestStruct'), Struct(name: 'TestStruct'), EnumClass(name: 'TestEnum'), @@ -53,49 +53,13 @@ void main() { Struct(name: 'ffi'), Func(name: 'ffi1', returnType: NativeType(SupportedNativeType.Void)), ]); - final l2 = Library(name: 'Bindings', bindings: [ - Struct(name: 'TestStruct'), - Struct(name: 'TestStruct1'), - EnumClass(name: 'TestEnum'), - EnumClass(name: 'TestEnum1'), - Func( - name: 'testFunc', - originalName: 'testFunc', - returnType: NativeType(SupportedNativeType.Void)), - Func( - name: 'testFunc1', - originalName: 'testFunc', - returnType: NativeType(SupportedNativeType.Void)), - Constant( - originalName: 'Test_Macro', - name: 'Test_Macro', - rawType: 'int', - rawValue: '0', - ), - Constant( - originalName: 'Test_Macro', - name: 'Test_Macro1', - rawType: 'int', - rawValue: '0', - ), - Typealias( - name: 'testAlias', type: NativeType(SupportedNativeType.Void)), - Typealias( - name: 'testAlias1', type: NativeType(SupportedNativeType.Void)), - Struct(name: 'testCrossDecl', originalName: 'testCrossDecl'), - Func( - name: 'testCrossDecl1', - originalName: 'testCrossDecl', - returnType: NativeType(SupportedNativeType.Void)), - Constant(name: 'testCrossDecl2', rawValue: '0', rawType: 'int'), - EnumClass(name: 'testCrossDecl3'), - Typealias( - name: 'testCrossDecl4', type: NativeType(SupportedNativeType.Void)), - Struct(name: 'ffi'), - Func(name: 'ffi1', returnType: NativeType(SupportedNativeType.Void)), + matchLibraryWithExpected( + library, 'decl_decl_collision_test_output.dart', [ + 'test', + 'collision_tests', + 'expected_bindings', + '_expected_decl_decl_collision_bindings.dart', ]); - - expect(l1.generate(), l2.generate()); }); }); } diff --git a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_decl_collision_bindings.dart b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_decl_collision_bindings.dart new file mode 100644 index 0000000000..32388b613d --- /dev/null +++ b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_decl_collision_bindings.dart @@ -0,0 +1,80 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +// ignore_for_file: type=lint +import 'dart:ffi' as ffi; + +class Bindings { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + Bindings(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + Bindings.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + void testFunc() { + return _testFunc(); + } + + late final _testFuncPtr = + _lookup>('testFunc'); + late final _testFunc = _testFuncPtr.asFunction(); + + void testFunc1() { + return _testFunc1(); + } + + late final _testFunc1Ptr = + _lookup>('testFunc'); + late final _testFunc1 = _testFunc1Ptr.asFunction(); + + void testCrossDecl1() { + return _testCrossDecl1(); + } + + late final _testCrossDecl1Ptr = + _lookup>('testCrossDecl'); + late final _testCrossDecl1 = _testCrossDecl1Ptr.asFunction(); + + void ffi1() { + return _ffi1(); + } + + late final _ffi1Ptr = + _lookup>('ffi1'); + late final _ffi1 = _ffi1Ptr.asFunction(); +} + +final class TestStruct extends ffi.Opaque {} + +final class TestStruct1 extends ffi.Opaque {} + +abstract class TestEnum {} + +abstract class TestEnum1 {} + +const int Test_Macro = 0; + +const int Test_Macro1 = 0; + +typedef testAlias = ffi.Void; +typedef DarttestAlias = void; +typedef testAlias1 = ffi.Void; +typedef DarttestAlias1 = void; + +final class testCrossDecl extends ffi.Opaque {} + +const int testCrossDecl2 = 0; + +abstract class testCrossDecl3 {} + +typedef testCrossDecl4 = ffi.Void; +typedef DarttestCrossDecl = void; + +final class ffi extends ffi.Opaque {} diff --git a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_reserved_keyword_collision_bindings.dart b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_reserved_keyword_collision_bindings.dart new file mode 100644 index 0000000000..c788b49cad --- /dev/null +++ b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_reserved_keyword_collision_bindings.dart @@ -0,0 +1,61 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +// ignore_for_file: type=lint +import 'dart:ffi' as ffi; + +class Bindings { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + Bindings(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + Bindings.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + void show1() { + return _show1(); + } + + late final _show1Ptr = + _lookup>('show'); + late final _show1 = _show1Ptr.asFunction(); + + void implements1( + int if1, + int abstract1, + int in1, + ) { + return _implements1( + if1, + abstract1, + in1, + ); + } + + late final _implements1Ptr = + _lookup>( + 'implements'); + late final _implements1 = + _implements1Ptr.asFunction(); +} + +final class abstract1 extends ffi.Opaque {} + +final class abstract2 extends ffi.Opaque {} + +final class if1 extends ffi.Opaque {} + +abstract class return1 {} + +abstract class export1 {} + +const int else1 = 0; + +typedef var1 = ffi.Void; +typedef Dartvar = void; diff --git a/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart b/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart index c6873f295c..88f353a7a4 100644 --- a/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/reserved_keyword_collision_test.dart @@ -14,7 +14,7 @@ void main() { logWarnings(Level.SEVERE); }); test('reserved keyword collision', () { - final l1 = Library(name: 'Bindings', bindings: [ + final library = Library(name: 'Bindings', bindings: [ Struct(name: 'abstract'), Struct(name: 'abstract'), Struct(name: 'if'), @@ -45,42 +45,13 @@ void main() { ), Typealias(name: 'var', type: NativeType(SupportedNativeType.Void)), ]); - final l2 = Library(name: 'Bindings', bindings: [ - Struct(name: 'abstract1'), - Struct(name: 'abstract2'), - Struct(name: 'if1'), - EnumClass(name: 'return1'), - EnumClass(name: 'export1'), - Func( - name: 'show1', - originalName: 'show', - returnType: NativeType(SupportedNativeType.Void)), - Func( - name: 'implements1', - originalName: 'implements', - parameters: [ - Parameter( - type: intType, - name: 'if1', - ), - Parameter( - type: intType, - name: 'abstract1', - ), - Parameter( - type: intType, - name: 'in1', - ), - ], - returnType: NativeType(SupportedNativeType.Void)), - Constant( - name: 'else1', - rawType: 'int', - rawValue: '0', - ), - Typealias(name: 'var1', type: NativeType(SupportedNativeType.Void)), + matchLibraryWithExpected( + library, 'reserved_keyword_collision_test_output.dart', [ + 'test', + 'collision_tests', + 'expected_bindings', + '_expected_reserved_keyword_collision_bindings.dart', ]); - expect(l1.generate(), l2.generate()); }); }); } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart index a6f44566f1..6106985239 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart @@ -68,8 +68,9 @@ class NativeLibrary { late final _func4 = _func4Ptr.asFunction(); } -typedef Typedef1 = ffi.Pointer>; -typedef Typedef1_function = ffi.Void Function(ffi.Handle); +typedef Typedef1 = ffi.Pointer>; +typedef Typedef1Function = ffi.Void Function(ffi.Handle); +typedef DartTypedef1Function = void Function(Object); final class Struct1 extends ffi.Opaque {} diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart index ca4e5e615c..b3063c46ea 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart @@ -73,16 +73,18 @@ final class Struct extends ffi.Struct { } typedef WithTypedefReturnType - = ffi.Pointer>; -typedef WithTypedefReturnType_function = InsideReturnType Function(); + = ffi.Pointer>; +typedef WithTypedefReturnTypeFunction = InsideReturnType Function(); typedef InsideReturnType - = ffi.Pointer>; -typedef InsideReturnType_function = ffi.Void Function(); + = ffi.Pointer>; +typedef InsideReturnTypeFunction = ffi.Void Function(); +typedef DartInsideReturnTypeFunction = void Function(); final class Struct2 extends ffi.Struct { external VoidFuncPointer constFuncPointer; } typedef VoidFuncPointer - = ffi.Pointer>; -typedef VoidFuncPointer_function = ffi.Void Function(); + = ffi.Pointer>; +typedef VoidFuncPointerFunction = ffi.Void Function(); +typedef DartVoidFuncPointerFunction = void Function(); diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_struct_fptr_fields_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_struct_fptr_fields_bindings.dart index 8dc72979ac..f5af81fc15 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_struct_fptr_fields_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_struct_fptr_fields_bindings.dart @@ -69,5 +69,6 @@ final class S extends ffi.Struct { } typedef ArithmeticOperation - = ffi.Pointer>; -typedef ArithmeticOperation_function = ffi.Int Function(ffi.Int a, ffi.Int b); + = ffi.Pointer>; +typedef ArithmeticOperationFunction = ffi.Int Function(ffi.Int a, ffi.Int b); +typedef DartArithmeticOperationFunction = int Function(int a, int b); diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart index b0b171a057..a33e9c8b5c 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart @@ -92,8 +92,9 @@ final class Struct1 extends ffi.Struct { } typedef NamedFunctionProto - = ffi.Pointer>; -typedef NamedFunctionProto_function = ffi.Void Function(); + = ffi.Pointer>; +typedef NamedFunctionProtoFunction = ffi.Void Function(); +typedef DartNamedFunctionProtoFunction = void Function(); final class AnonymousStructInTypedef extends ffi.Opaque {} @@ -113,6 +114,7 @@ abstract class _NamedEnumInTypedef { } typedef NestingASpecifiedType = ffi.IntPtr; +typedef DartNestingASpecifiedType = int; final class Struct2 extends ffi.Opaque {} diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart index f4edb598ec..cc66670e3e 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart @@ -1249,6 +1249,7 @@ final class cJSON_Hooks extends ffi.Struct { } typedef cJSON_bool = ffi.Int; +typedef DartcJSON_bool = int; const int CJSON_VERSION_MAJOR = 1; diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart index d30109c4ce..3d274994a3 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_libclang_bindings.dart @@ -7431,8 +7431,10 @@ abstract class CXChildVisitResult { /// Visitor invoked for each cursor found by a traversal. typedef CXCursorVisitor - = ffi.Pointer>; -typedef CXCursorVisitor_function = ffi.Int32 Function( + = ffi.Pointer>; +typedef CXCursorVisitorFunction = ffi.Int32 Function( + CXCursor cursor, CXCursor parent, CXClientData client_data); +typedef DartCXCursorVisitorFunction = int Function( CXCursor cursor, CXCursor parent, CXClientData client_data); /// Opaque pointer representing client data that will be passed through to @@ -7762,12 +7764,17 @@ abstract class CXCompletionContext { /// Visitor invoked for each file in a translation unit (used with /// clang_getInclusions()). typedef CXInclusionVisitor - = ffi.Pointer>; -typedef CXInclusionVisitor_function = ffi.Void Function( + = ffi.Pointer>; +typedef CXInclusionVisitorFunction = ffi.Void Function( CXFile included_file, ffi.Pointer inclusion_stack, ffi.UnsignedInt include_len, CXClientData client_data); +typedef DartCXInclusionVisitorFunction = void Function( + CXFile included_file, + ffi.Pointer inclusion_stack, + int include_len, + CXClientData client_data); abstract class CXEvalResultKind { static const int CXEval_Int = 1; @@ -8225,8 +8232,10 @@ abstract class CXIndexOptFlags { /// Visitor invoked for each field found by a traversal. typedef CXFieldVisitor - = ffi.Pointer>; -typedef CXFieldVisitor_function = ffi.Int32 Function( + = ffi.Pointer>; +typedef CXFieldVisitorFunction = ffi.Int32 Function( + CXCursor C, CXClientData client_data); +typedef DartCXFieldVisitorFunction = int Function( CXCursor C, CXClientData client_data); const int CINDEX_VERSION_MAJOR = 0; diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index 492da42957..5c6de76237 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -10854,9 +10854,11 @@ final class sqlite3_vfs extends ffi.Struct { typedef sqlite3_int64 = sqlite_int64; typedef sqlite_int64 = ffi.LongLong; +typedef Dartsqlite_int64 = int; typedef sqlite3_syscall_ptr - = ffi.Pointer>; -typedef sqlite3_syscall_ptr_function = ffi.Void Function(); + = ffi.Pointer>; +typedef sqlite3_syscall_ptrFunction = ffi.Void Function(); +typedef Dartsqlite3_syscall_ptrFunction = void Function(); final class sqlite3_mem_methods extends ffi.Struct { /// Memory allocation function @@ -10899,6 +10901,7 @@ final class sqlite3_mem_methods extends ffi.Struct { typedef sqlite3_uint64 = sqlite_uint64; typedef sqlite_uint64 = ffi.UnsignedLongLong; +typedef Dartsqlite_uint64 = int; final class sqlite3_stmt extends ffi.Opaque {} @@ -11507,6 +11510,7 @@ final class sqlite3_rtree_geometry extends ffi.Struct { } typedef sqlite3_rtree_dbl = ffi.Double; +typedef Dartsqlite3_rtree_dbl = double; /// A pointer to a structure of the following type is passed as the /// argument to scored geometry callback registered using @@ -12010,13 +12014,19 @@ final class fts5_api extends ffi.Struct { } typedef fts5_extension_function - = ffi.Pointer>; -typedef fts5_extension_function_function = ffi.Void Function( + = ffi.Pointer>; +typedef fts5_extension_functionFunction = ffi.Void Function( ffi.Pointer pApi, ffi.Pointer pFts, ffi.Pointer pCtx, ffi.Int nVal, ffi.Pointer> apVal); +typedef Dartfts5_extension_functionFunction = void Function( + ffi.Pointer pApi, + ffi.Pointer pFts, + ffi.Pointer pCtx, + int nVal, + ffi.Pointer> apVal); const String SQLITE_VERSION = '3.32.3'; diff --git a/pkgs/ffigen/test/native_objc_test/typedef_config.yaml b/pkgs/ffigen/test/native_objc_test/typedef_config.yaml new file mode 100644 index 0000000000..f375bfc7d1 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/typedef_config.yaml @@ -0,0 +1,17 @@ +name: TypedefTestObjCLibrary +description: 'Tests typedef' +language: objc +output: 'typedef_bindings.dart' +exclude-all-by-default: true +objc-interfaces: + include: + - SomeClass + - AnotherClass +typedefs: + include: + - SomeClassPtr +headers: + entry-points: + - 'typedef_test.m' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/typedef_test.dart b/pkgs/ffigen/test/native_objc_test/typedef_test.dart new file mode 100644 index 0000000000..7a47fdb835 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/typedef_test.dart @@ -0,0 +1,35 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:test/test.dart'; +import '../test_utils.dart'; +import 'typedef_bindings.dart'; +import 'util.dart'; + +void main() { + late TypedefTestObjCLibrary lib; + + group('typedef', () { + setUpAll(() { + logWarnings(); + final dylib = File('test/native_objc_test/typedef_test.dylib'); + verifySetupFile(dylib); + lib = TypedefTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); + generateBindingsForCoverage('typedef'); + }); + + test('Regression test for #386', () { + // https://github.com/dart-lang/ffigen/issues/386 + // Make sure that the typedef DartSomeClassPtr is for SomeClass. + final DartSomeClassPtr instance = SomeClass.new1(lib); + expect(instance.pointer, isNot(nullptr)); + }); + }); +} diff --git a/pkgs/ffigen/test/native_objc_test/typedef_test.m b/pkgs/ffigen/test/native_objc_test/typedef_test.m new file mode 100644 index 0000000000..c5972ab427 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/typedef_test.m @@ -0,0 +1,20 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#import + +@interface SomeClass : NSObject {} +@end + +@implementation SomeClass +@end + +typedef SomeClass* SomeClassPtr; + +@interface AnotherClass : NSObject {} +@property SomeClassPtr property; +@end + +@implementation AnotherClass +@end diff --git a/pkgs/ffigen/test/regen.dart b/pkgs/ffigen/test/regen.dart index 1617eda338..ec52964493 100644 --- a/pkgs/ffigen/test/regen.dart +++ b/pkgs/ffigen/test/regen.dart @@ -8,7 +8,7 @@ import 'dart:io'; import 'package:args/args.dart'; import 'package:ffigen/ffigen.dart'; import 'package:logging/logging.dart'; -import './test_utils.dart'; +import 'test_utils.dart'; const usage = r'''Regenerates the Dart FFI bindings used in tests and examples. @@ -18,12 +18,14 @@ e.g. with this command: $ dart run test/setup.dart && dart run test/regen.dart && dart test '''; -Future _regenConfig(File yamlConfig, File bindingOutput) async { - yamlConfig = yamlConfig.absolute; - bindingOutput = bindingOutput.absolute; - final config = testConfigFromPath(yamlConfig.path); - final library = parse(config); - library.generateFile(bindingOutput); +void _regenConfig(String yamlConfigPath, String bindingOutputPath) { + final yamlConfig = File(yamlConfigPath).absolute; + final bindingOutput = File(bindingOutputPath).absolute; + withChDir(yamlConfig.path, () { + final config = testConfigFromPath(yamlConfig.path); + final library = parse(config); + library.generateFile(bindingOutput); + }); } Future main(List args) async { @@ -50,25 +52,12 @@ Future main(List args) async { print('${record.level.name}: ${record.time}: ${record.message}'); }); - final nativeTestConfig = File('test/native_test/config.yaml').absolute; - final nativeTestOut = - File('test/native_test/_expected_native_test_bindings.dart').absolute; - await withChDir(nativeTestConfig.path, - () => _regenConfig(nativeTestConfig, nativeTestOut)); - - final libclangConfig = File('example/libclang-example/config.yaml').absolute; - final libclangOut = - File('example/libclang-example/generated_bindings.dart').absolute; - await withChDir( - libclangConfig.path, () => _regenConfig(libclangConfig, libclangOut)); - - final simpleConfig = File('example/simple/config.yaml').absolute; - final simpleOut = File('example/simple/generated_bindings.dart').absolute; - await withChDir( - simpleConfig.path, () => _regenConfig(simpleConfig, simpleOut)); - - final cJsonConfig = File('example/c_json/config.yaml').absolute; - final cJsonOut = - File('example/c_json/cjson_generated_bindings.dart').absolute; - await withChDir(cJsonConfig.path, () => _regenConfig(cJsonConfig, cJsonOut)); + _regenConfig('test/native_test/config.yaml', + 'test/native_test/_expected_native_test_bindings.dart'); + _regenConfig('example/libclang-example/config.yaml', + 'example/libclang-example/generated_bindings.dart'); + _regenConfig( + 'example/simple/config.yaml', 'example/simple/generated_bindings.dart'); + _regenConfig('example/c_json/config.yaml', + 'example/c_json/cjson_generated_bindings.dart'); } diff --git a/pkgs/ffigen/test/test_utils.dart b/pkgs/ffigen/test/test_utils.dart index 95434ff7de..9482b9ccf5 100644 --- a/pkgs/ffigen/test/test_utils.dart +++ b/pkgs/ffigen/test/test_utils.dart @@ -47,7 +47,7 @@ void verifySetupFile(File file) { // Remove '\r' for Windows compatibility, then apply user's normalizer. String _normalizeGeneratedCode( String generated, String Function(String)? codeNormalizer) { - final noCR = generated.replaceAll('\r', '').replaceAll(RegExp(r'\n+'), '\n'); + final noCR = generated.replaceAll('\r', ''); if (codeNormalizer == null) return noCR; return codeNormalizer(noCR); } @@ -103,7 +103,7 @@ void _matchFileWithExpected({ _normalizeGeneratedCode(file.readAsStringSync(), codeNormalizer); final expected = _normalizeGeneratedCode( File(path.joinAll(pathToExpected)).readAsStringSync(), codeNormalizer); - expect(actual, expected); + expect(actual.split('\n'), expected.split('\n')); if (file.existsSync()) { file.delete(); } From 86abba5378a2598714a96aa09322fbe17246627c Mon Sep 17 00:00:00 2001 From: Parker Lougheed Date: Sat, 14 Oct 2023 08:25:24 -0500 Subject: [PATCH 267/276] [ffigen] Enable use_super_parameters lint (#631) --- pkgs/ffigen/analysis_options.yaml | 2 ++ .../lib/src/code_generator/binding.dart | 18 ++++------ .../lib/src/code_generator/compound.dart | 19 ++++------ .../lib/src/code_generator/constant.dart | 15 +++----- .../lib/src/code_generator/enum_class.dart | 16 +++------ pkgs/ffigen/lib/src/code_generator/func.dart | 12 +++---- .../ffigen/lib/src/code_generator/global.dart | 15 +++----- .../lib/src/code_generator/objc_block.dart | 10 ++---- .../src/code_generator/objc_interface.dart | 9 ++--- .../lib/src/code_generator/pointer.dart | 2 +- .../ffigen/lib/src/code_generator/struct.dart | 28 +++++---------- pkgs/ffigen/lib/src/code_generator/type.dart | 18 ++++------ .../lib/src/code_generator/typealias.dart | 36 +++++++------------ pkgs/ffigen/lib/src/code_generator/union.dart | 25 +++++-------- 14 files changed, 75 insertions(+), 150 deletions(-) diff --git a/pkgs/ffigen/analysis_options.yaml b/pkgs/ffigen/analysis_options.yaml index 5028f95608..8c036c9a8b 100644 --- a/pkgs/ffigen/analysis_options.yaml +++ b/pkgs/ffigen/analysis_options.yaml @@ -19,5 +19,7 @@ linter: directives_ordering: true prefer_final_locals: true prefer_final_in_for_each: true + use_super_parameters: true + # Disabled. constant_identifier_names: false diff --git a/pkgs/ffigen/lib/src/code_generator/binding.dart b/pkgs/ffigen/lib/src/code_generator/binding.dart index 2e2f189ef2..6ad26ba790 100644 --- a/pkgs/ffigen/lib/src/code_generator/binding.dart +++ b/pkgs/ffigen/lib/src/code_generator/binding.dart @@ -44,15 +44,12 @@ abstract class LookUpBinding extends Binding { LookUpBinding({ String? usr, String? originalName, - required String name, - String? dartDoc, - bool isInternal = false, + required super.name, + super.dartDoc, + super.isInternal, }) : super( usr: usr ?? name, originalName: originalName ?? name, - name: name, - dartDoc: dartDoc, - isInternal: isInternal, ); } @@ -61,14 +58,11 @@ abstract class NoLookUpBinding extends Binding { NoLookUpBinding({ String? usr, String? originalName, - required String name, - String? dartDoc, - bool isInternal = false, + required super.name, + super.dartDoc, + super.isInternal, }) : super( usr: usr ?? name, originalName: originalName ?? name, - name: name, - dartDoc: dartDoc, - isInternal: isInternal, ); } diff --git a/pkgs/ffigen/lib/src/code_generator/compound.dart b/pkgs/ffigen/lib/src/code_generator/compound.dart index ddc33c64d0..1f9706e307 100644 --- a/pkgs/ffigen/lib/src/code_generator/compound.dart +++ b/pkgs/ffigen/lib/src/code_generator/compound.dart @@ -35,23 +35,16 @@ abstract class Compound extends BindingType { bool get isUnion => compoundType == CompoundType.union; Compound({ - String? usr, - String? originalName, - required String name, + super.usr, + super.originalName, + required super.name, required this.compoundType, this.isIncomplete = false, this.pack, - String? dartDoc, + super.dartDoc, List? members, - bool isInternal = false, - }) : members = members ?? [], - super( - usr: usr, - originalName: originalName, - name: name, - dartDoc: dartDoc, - isInternal: isInternal, - ); + super.isInternal, + }) : members = members ?? []; factory Compound.fromType({ required CompoundType type, diff --git a/pkgs/ffigen/lib/src/code_generator/constant.dart b/pkgs/ffigen/lib/src/code_generator/constant.dart index 8fd719169d..1f4c8d56cc 100644 --- a/pkgs/ffigen/lib/src/code_generator/constant.dart +++ b/pkgs/ffigen/lib/src/code_generator/constant.dart @@ -28,18 +28,13 @@ class Constant extends NoLookUpBinding { final String rawValue; Constant({ - String? usr, - String? originalName, - required String name, - String? dartDoc, + super.usr, + super.originalName, + required super.name, + super.dartDoc, required this.rawType, required this.rawValue, - }) : super( - usr: usr, - originalName: originalName, - name: name, - dartDoc: dartDoc, - ); + }); @override BindingString toBindingString(Writer w) { diff --git a/pkgs/ffigen/lib/src/code_generator/enum_class.dart b/pkgs/ffigen/lib/src/code_generator/enum_class.dart index 089d7ed615..92ffbfa9b2 100644 --- a/pkgs/ffigen/lib/src/code_generator/enum_class.dart +++ b/pkgs/ffigen/lib/src/code_generator/enum_class.dart @@ -29,18 +29,12 @@ class EnumClass extends BindingType { final List enumConstants; EnumClass({ - String? usr, - String? originalName, - required String name, - String? dartDoc, + super.usr, + super.originalName, + required super.name, + super.dartDoc, List? enumConstants, - }) : enumConstants = enumConstants ?? [], - super( - usr: usr, - originalName: originalName, - name: name, - dartDoc: dartDoc, - ); + }) : enumConstants = enumConstants ?? []; @override BindingString toBindingString(Writer w) { diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index b3141ae11a..5e081cf7e7 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -51,17 +51,17 @@ class Func extends LookUpBinding { /// [originalName] is looked up in dynamic library, if not /// provided, takes the value of [name]. Func({ - String? usr, + super.usr, required String name, - String? originalName, - String? dartDoc, + super.originalName, + super.dartDoc, required Type returnType, List? parameters, List? varArgParameters, this.exposeSymbolAddress = false, this.exposeFunctionTypedefs = false, this.isLeaf = false, - bool isInternal = false, + super.isInternal, this.ffiNativeConfig = const FfiNativeConfig(enabled: false), }) : functionType = FunctionType( returnType: returnType, @@ -69,11 +69,7 @@ class Func extends LookUpBinding { varArgParameters: varArgParameters ?? const [], ), super( - usr: usr, - originalName: originalName, name: name, - dartDoc: dartDoc, - isInternal: isInternal, ) { for (var i = 0; i < functionType.parameters.length; i++) { if (functionType.parameters[i].name.trim() == '') { diff --git a/pkgs/ffigen/lib/src/code_generator/global.dart b/pkgs/ffigen/lib/src/code_generator/global.dart index 5f2e6397c6..81f61a8e6b 100644 --- a/pkgs/ffigen/lib/src/code_generator/global.dart +++ b/pkgs/ffigen/lib/src/code_generator/global.dart @@ -24,18 +24,13 @@ class Global extends LookUpBinding { final bool exposeSymbolAddress; Global({ - String? usr, - String? originalName, - required String name, + super.usr, + super.originalName, + required super.name, required this.type, - String? dartDoc, + super.dartDoc, this.exposeSymbolAddress = false, - }) : super( - usr: usr, - originalName: originalName, - name: name, - dartDoc: dartDoc, - ); + }); @override BindingString toBindingString(Writer w) { diff --git a/pkgs/ffigen/lib/src/code_generator/objc_block.dart b/pkgs/ffigen/lib/src/code_generator/objc_block.dart index e908abbcba..eb891fcf5e 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_block.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_block.dart @@ -26,16 +26,12 @@ class ObjCBlock extends BindingType { ); ObjCBlock._({ - required String usr, - required String name, + required String super.usr, + required super.name, required this.returnType, required this.argTypes, required this.builtInFunctions, - }) : super( - usr: usr, - originalName: name, - name: name, - ); + }) : super(originalName: name); // Generates a human readable name for the block based on the args and return // type. These names will be pretty verbose and unweildy, but they're at least diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index c79ccca118..e4cf26072a 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -48,18 +48,15 @@ class ObjCInterface extends BindingType { late final ObjCMsgSendFunc _isKindOfClassMsgSend; ObjCInterface({ - String? usr, - required String originalName, + super.usr, + required String super.originalName, String? name, String? lookupName, - String? dartDoc, + super.dartDoc, required this.builtInFunctions, }) : lookupName = lookupName ?? originalName, super( - usr: usr, - originalName: originalName, name: name ?? originalName, - dartDoc: dartDoc, ) { builtInFunctions.registerInterface(this); } diff --git a/pkgs/ffigen/lib/src/code_generator/pointer.dart b/pkgs/ffigen/lib/src/code_generator/pointer.dart index 7dfc7d6169..753639571f 100644 --- a/pkgs/ffigen/lib/src/code_generator/pointer.dart +++ b/pkgs/ffigen/lib/src/code_generator/pointer.dart @@ -62,7 +62,7 @@ class ConstantArray extends PointerType { /// Represents an incomplete array, which has an unknown size. class IncompleteArray extends PointerType { - IncompleteArray(Type child) : super._(child); + IncompleteArray(super.child) : super._(); @override Type get baseArrayType => child.baseArrayType; diff --git a/pkgs/ffigen/lib/src/code_generator/struct.dart b/pkgs/ffigen/lib/src/code_generator/struct.dart index ae9e35bfda..7a95d67766 100644 --- a/pkgs/ffigen/lib/src/code_generator/struct.dart +++ b/pkgs/ffigen/lib/src/code_generator/struct.dart @@ -30,23 +30,13 @@ import 'package:ffigen/src/code_generator/compound.dart'; /// ``` class Struct extends Compound { Struct({ - String? usr, - String? originalName, - required String name, - bool isIncomplete = false, - int? pack, - String? dartDoc, - List? members, - bool isInternal = false, - }) : super( - usr: usr, - originalName: originalName, - name: name, - dartDoc: dartDoc, - isIncomplete: isIncomplete, - members: members, - pack: pack, - compoundType: CompoundType.struct, - isInternal: isInternal, - ); + super.usr, + super.originalName, + required super.name, + super.isIncomplete, + super.pack, + super.dartDoc, + super.members, + super.isInternal, + }) : super(compoundType: CompoundType.struct); } diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index 6537a8584e..454c783405 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -79,18 +79,12 @@ abstract class Type { /// to extend both NoLookUpBinding and Type. abstract class BindingType extends NoLookUpBinding implements Type { BindingType({ - String? usr, - String? originalName, - required String name, - String? dartDoc, - bool isInternal = false, - }) : super( - usr: usr, - originalName: originalName, - name: name, - dartDoc: dartDoc, - isInternal: isInternal, - ); + super.usr, + super.originalName, + required super.name, + super.dartDoc, + super.isInternal, + }); @override Type get baseType => this; diff --git a/pkgs/ffigen/lib/src/code_generator/typealias.dart b/pkgs/ffigen/lib/src/code_generator/typealias.dart index ec9430e282..834987b7fa 100644 --- a/pkgs/ffigen/lib/src/code_generator/typealias.dart +++ b/pkgs/ffigen/lib/src/code_generator/typealias.dart @@ -66,24 +66,20 @@ class Typealias extends BindingType { } Typealias._({ - String? usr, - String? originalName, - String? dartDoc, + super.usr, + super.originalName, + super.dartDoc, required String name, required this.type, bool genFfiDartType = false, - bool isInternal = false, + super.isInternal, }) : _ffiDartAliasName = genFfiDartType ? 'Dart$name' : null, _dartAliasName = (!genFfiDartType && type is! Typealias && !type.sameDartAndCType) ? 'Dart$name' : null, super( - usr: usr, name: genFfiDartType ? 'Native$name' : name, - dartDoc: dartDoc, - originalName: originalName, - isInternal: isInternal, ); @override @@ -169,20 +165,12 @@ class Typealias extends BindingType { /// enclosing class's type, even in inherited methods. class ObjCInstanceType extends Typealias { ObjCInstanceType._({ - String? usr, - String? originalName, - String? dartDoc, - required String name, - required Type type, - bool genFfiDartType = false, - bool isInternal = false, - }) : super._( - usr: usr, - originalName: originalName, - dartDoc: dartDoc, - name: name, - type: type, - genFfiDartType: genFfiDartType, - isInternal: isInternal, - ); + super.usr, + super.originalName, + super.dartDoc, + required super.name, + required super.type, + super.genFfiDartType, + super.isInternal, + }) : super._(); } diff --git a/pkgs/ffigen/lib/src/code_generator/union.dart b/pkgs/ffigen/lib/src/code_generator/union.dart index 8455004b02..65d9afbfe8 100644 --- a/pkgs/ffigen/lib/src/code_generator/union.dart +++ b/pkgs/ffigen/lib/src/code_generator/union.dart @@ -29,21 +29,12 @@ import 'package:ffigen/src/code_generator/compound.dart'; /// ``` class Union extends Compound { Union({ - String? usr, - String? originalName, - required String name, - bool isIncomplete = false, - int? pack, - String? dartDoc, - List? members, - }) : super( - usr: usr, - originalName: originalName, - name: name, - dartDoc: dartDoc, - isIncomplete: isIncomplete, - members: members, - pack: pack, - compoundType: CompoundType.union, - ); + super.usr, + super.originalName, + required super.name, + super.isIncomplete, + super.pack, + super.dartDoc, + super.members, + }) : super(compoundType: CompoundType.union); } From 8aeb62c9a65c4715e080e0f9d41a3d0fa74cf854 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Thu, 26 Oct 2023 17:38:24 -0700 Subject: [PATCH 268/276] [ffigen] Use getDartType rather than getFfiDartType in ObjC block codegen (#632) * Blocks returning proper user facing types * More tests and refactors * fmt * Fix test * Fix vararg test * Partial fix for block ref counts * More block ref counting fixes * fmt * Daco's comments --- pkgs/ffigen/CHANGELOG.md | 1 + .../lib/src/code_generator/func_type.dart | 81 ++-- .../lib/src/code_generator/objc_block.dart | 141 ++++--- .../objc_built_in_functions.dart | 5 + .../src/code_generator/objc_interface.dart | 82 ++--- .../lib/src/code_generator/objc_nullable.dart | 33 ++ .../lib/src/code_generator/pointer.dart | 18 + pkgs/ffigen/lib/src/code_generator/type.dart | 53 ++- .../lib/src/code_generator/typealias.dart | 55 ++- .../test/native_objc_test/block_config.yaml | 2 +- .../test/native_objc_test/block_test.dart | 347 ++++++++++++++++-- .../ffigen/test/native_objc_test/block_test.m | 63 ++++ .../test/native_objc_test/nullable_test.dart | 7 + .../test/native_objc_test/nullable_test.m | 5 + 14 files changed, 701 insertions(+), 192 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index d9d4b88050..2d90855d2c 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -8,6 +8,7 @@ - Fix ObjC methods returning instancetype having the wrong type in sublasses. - When generating typedefs for `Pointer>`, also generate a typedef for the `Function`. +- Use Dart wrapper types in args and returns of ObjCBlocks. - Bump min SDK version to 3.2.0-114.0.dev. # 9.0.1 diff --git a/pkgs/ffigen/lib/src/code_generator/func_type.dart b/pkgs/ffigen/lib/src/code_generator/func_type.dart index e1d0793695..1e734bc41f 100644 --- a/pkgs/ffigen/lib/src/code_generator/func_type.dart +++ b/pkgs/ffigen/lib/src/code_generator/func_type.dart @@ -23,81 +23,66 @@ class FunctionType extends Type { this.varArgParameters = const [], }); - String _getCacheKeyString( - bool writeArgumentNames, String Function(Type) typeToString) { - final sb = StringBuffer(); + String _getTypeImpl( + bool writeArgumentNames, String Function(Type) typeToString, + {String? varArgWrapper}) { + final params = varArgWrapper != null ? parameters : dartTypeParameters; + String? varArgPack; + if (varArgWrapper != null && varArgParameters.isNotEmpty) { + final varArgPackBuf = StringBuffer(); + varArgPackBuf.write("$varArgWrapper<("); + varArgPackBuf.write((varArgParameters).map((p) { + return '${typeToString(p.type)} ${writeArgumentNames ? p.name : ""}'; + }).join(', ')); + varArgPackBuf.write(",)>"); + varArgPack = varArgPackBuf.toString(); + } // Write return Type. + final sb = StringBuffer(); sb.write(typeToString(returnType)); // Write Function. sb.write(' Function('); - sb.write(parameters.map((p) { - return '${typeToString(p.type)} ${writeArgumentNames ? p.name : ""}'; - }).join(', ')); + sb.write([ + ...params.map((p) { + return '${typeToString(p.type)} ${writeArgumentNames ? p.name : ""}'; + }), + if (varArgPack != null) varArgPack, + ].join(', ')); sb.write(')'); return sb.toString(); } @override - String getCType(Writer w, {bool writeArgumentNames = true}) { - final sb = StringBuffer(); - - // Write return Type. - sb.write(returnType.getCType(w)); - - // Write Function. - sb.write(' Function('); - sb.write((parameters).map((p) { - return '${p.type.getCType(w)} ${writeArgumentNames ? p.name : ""}'; - }).join(', ')); - if (varArgParameters.isNotEmpty) { - sb.write(", ${w.ffiLibraryPrefix}.VarArgs<("); - sb.write((varArgParameters).map((p) { - return '${p.type.getCType(w)} ${writeArgumentNames ? p.name : ""}'; - }).join(', ')); - sb.write(",)>"); - } - sb.write(')'); - - return sb.toString(); - } + String getCType(Writer w, {bool writeArgumentNames = true}) => + _getTypeImpl(writeArgumentNames, (Type t) => t.getCType(w), + varArgWrapper: '${w.ffiLibraryPrefix}.VarArgs'); @override - String getFfiDartType(Writer w, {bool writeArgumentNames = true}) { - final sb = StringBuffer(); + String getFfiDartType(Writer w, {bool writeArgumentNames = true}) => + _getTypeImpl(writeArgumentNames, (Type t) => t.getFfiDartType(w)); - // Write return Type. - sb.write(returnType.getFfiDartType(w)); - - // Write Function. - sb.write(' Function('); - sb.write(dartTypeParameters.map((p) { - return '${p.type.getFfiDartType(w)} ${writeArgumentNames ? p.name : ""}'; - }).join(', ')); - sb.write(')'); - - return sb.toString(); - } + @override + String getDartType(Writer w, {bool writeArgumentNames = true}) => + _getTypeImpl(writeArgumentNames, (Type t) => t.getDartType(w)); @override bool get sameFfiDartAndCType => returnType.sameFfiDartAndCType && - parameters.every((p) => p.type.sameFfiDartAndCType) && - varArgParameters.every((p) => p.type.sameFfiDartAndCType); + dartTypeParameters.every((p) => p.type.sameFfiDartAndCType); @override bool get sameDartAndCType => returnType.sameDartAndCType && - parameters.every((p) => p.type.sameDartAndCType) && - varArgParameters.every((p) => p.type.sameDartAndCType); + dartTypeParameters.every((p) => p.type.sameDartAndCType); @override - String toString() => _getCacheKeyString(false, (Type t) => t.toString()); + String toString() => _getTypeImpl(false, (Type t) => t.toString()); @override - String cacheKey() => _getCacheKeyString(false, (Type t) => t.cacheKey()); + String cacheKey() => _getTypeImpl(false, (Type t) => t.cacheKey()); @override void addDependencies(Set dependencies) { diff --git a/pkgs/ffigen/lib/src/code_generator/objc_block.dart b/pkgs/ffigen/lib/src/code_generator/objc_block.dart index eb891fcf5e..b61efc7cfd 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_block.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_block.dart @@ -73,31 +73,36 @@ class ObjCBlock extends BindingType { final trampFuncType = FunctionType( returnType: returnType, parameters: [Parameter(type: blockPtr, name: 'block'), ...params]); - final natTrampFnType = NativeFunc(trampFuncType); + final trampFuncCType = trampFuncType.getCType(w, writeArgumentNames: false); + final trampFuncFfiDartType = + trampFuncType.getFfiDartType(w, writeArgumentNames: false); + final natTrampFnType = NativeFunc(trampFuncType).getCType(w); final nativeCallableType = - '${w.ffiLibraryPrefix}.NativeCallable<${trampFuncType.getCType(w)}>'; + '${w.ffiLibraryPrefix}.NativeCallable<$trampFuncCType>'; + final funcDartType = funcType.getDartType(w, writeArgumentNames: false); + final funcFfiDartType = + funcType.getFfiDartType(w, writeArgumentNames: false); + final returnFfiDartType = returnType.getFfiDartType(w); + final blockCType = blockPtr.getCType(w); + + final paramsNameOnly = params.map((p) => p.name).join(', '); + final paramsFfiDartType = + params.map((p) => '${p.type.getFfiDartType(w)} ${p.name}').join(', '); + final paramsDartType = + params.map((p) => '${p.type.getDartType(w)} ${p.name}').join(', '); // Write the function pointer based trampoline function. - s.write(returnType.getFfiDartType(w)); - s.write(' $funcPtrTrampoline(${blockPtr.getCType(w)} block'); - for (int i = 0; i < params.length; ++i) { - s.write(', ${params[i].type.getFfiDartType(w)} ${params[i].name}'); - } - s.write(') {\n'); - s.write(' ${isVoid ? '' : 'return '}block.ref.target.cast<' - '${natFnType.getFfiDartType(w)}>().asFunction<' - '${funcType.getFfiDartType(w)}>()('); - for (int i = 0; i < params.length; ++i) { - s.write('${i == 0 ? '' : ', '}${params[i].name}'); - } - s.write(');\n'); - s.write('}\n'); + s.write(''' +$returnFfiDartType $funcPtrTrampoline($blockCType block, $paramsFfiDartType) => + block.ref.target.cast<${natFnType.getFfiDartType(w)}>() + .asFunction<$funcFfiDartType>()($paramsNameOnly); +'''); // Write the closure registry function. s.write(''' -final $closureRegistry = {}; +final $closureRegistry = {}; int $closureRegistryIndex = 0; -$voidPtr $registerClosure(Function fn) { +$voidPtr $registerClosure($funcFfiDartType fn) { final id = ++$closureRegistryIndex; $closureRegistry[id] = fn; return $voidPtr.fromAddress(id); @@ -105,33 +110,30 @@ $voidPtr $registerClosure(Function fn) { '''); // Write the closure based trampoline function. - s.write(returnType.getFfiDartType(w)); - s.write(' $closureTrampoline(${blockPtr.getCType(w)} block'); - for (int i = 0; i < params.length; ++i) { - s.write(', ${params[i].type.getFfiDartType(w)} ${params[i].name}'); - } - s.write(') {\n'); - s.write(' ${isVoid ? '' : 'return '}'); - s.write('($closureRegistry[block.ref.target.address]'); - s.write(' as ${returnType.getFfiDartType(w)} Function('); - for (int i = 0; i < params.length; ++i) { - s.write('${i == 0 ? '' : ', '}${params[i].type.getFfiDartType(w)}'); - } - s.write('))'); - s.write('('); - for (int i = 0; i < params.length; ++i) { - s.write('${i == 0 ? '' : ', '}${params[i].name}'); - } - s.write(');\n'); - s.write('}\n'); + s.write(''' +$returnFfiDartType $closureTrampoline($blockCType block, $paramsFfiDartType) => + $closureRegistry[block.ref.target.address]!($paramsNameOnly); +'''); + + // Snippet that converts a Dart typed closure to FfiDart type. This snippet + // is used below. Note that the closure being converted is called `fn`. + final convertedFnArgs = params + .map((p) => p.type + .convertFfiDartTypeToDartType(w, p.name, 'lib', objCRetain: true)) + .join(', '); + final convFnInvocation = returnType.convertDartTypeToFfiDartType( + w, 'fn($convertedFnArgs)', + objCRetain: true); + final convFn = '($paramsFfiDartType) => $convFnInvocation'; // Write the wrapper class. final defaultValue = returnType.getDefaultValue(w, '_lib'); final exceptionalReturn = defaultValue == null ? '' : ', $defaultValue'; s.write(''' class $name extends _ObjCBlockBase { - $name._(${blockPtr.getCType(w)} id, ${w.className} lib) : - super._(id, lib, retain: false, release: true); + $name._($blockCType id, ${w.className} lib, + {bool retain = false, bool release = true}) : + super._(id, lib, retain: retain, release: release); /// Creates a block from a C function pointer. /// @@ -141,7 +143,7 @@ class $name extends _ObjCBlockBase { $name.fromFunctionPointer(${w.className} lib, $natFnPtr ptr) : this._(lib.${builtInFunctions.newBlock.name}( _cFuncTrampoline ??= ${w.ffiLibraryPrefix}.Pointer.fromFunction< - ${trampFuncType.getCType(w)}>($funcPtrTrampoline + $trampFuncCType>($funcPtrTrampoline $exceptionalReturn).cast(), ptr.cast()), lib); static $voidPtr? _cFuncTrampoline; @@ -150,11 +152,11 @@ class $name extends _ObjCBlockBase { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - $name.fromFunction(${w.className} lib, ${funcType.getFfiDartType(w)} fn) : + $name.fromFunction(${w.className} lib, $funcDartType fn) : this._(lib.${builtInFunctions.newBlock.name}( _dartFuncTrampoline ??= ${w.ffiLibraryPrefix}.Pointer.fromFunction< - ${trampFuncType.getCType(w)}>($closureTrampoline - $exceptionalReturn).cast(), $registerClosure(fn)), lib); + $trampFuncCType>($closureTrampoline + $exceptionalReturn).cast(), $registerClosure($convFn)), lib); static $voidPtr? _dartFuncTrampoline; '''); @@ -171,31 +173,30 @@ class $name extends _ObjCBlockBase { /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - $name.listener(${w.className} lib, ${funcType.getFfiDartType(w)} fn) : + $name.listener(${w.className} lib, $funcDartType fn) : this._(lib.${builtInFunctions.newBlock.name}( - (_dartFuncListenerTrampoline ??= $nativeCallableType.listener($closureTrampoline - $exceptionalReturn)..keepIsolateAlive = false).nativeFunction.cast(), - $registerClosure(fn)), lib); + (_dartFuncListenerTrampoline ??= $nativeCallableType.listener( + $closureTrampoline $exceptionalReturn)..keepIsolateAlive = + false).nativeFunction.cast(), + $registerClosure($convFn)), lib); static $nativeCallableType? _dartFuncListenerTrampoline; '''); } // Call method. - s.write(' ${returnType.getFfiDartType(w)} call('); - for (int i = 0; i < params.length; ++i) { - s.write('${i == 0 ? '' : ', '}${params[i].type.getFfiDartType(w)}'); - s.write(' ${params[i].name}'); - } - s.write(''') { - ${isVoid ? '' : 'return '}_id.ref.invoke.cast< - ${natTrampFnType.getCType(w)}>().asFunction< - ${trampFuncType.getFfiDartType(w)}>()(_id'''); - for (int i = 0; i < params.length; ++i) { - s.write(', ${params[i].name}'); - } - s.write('''); - }'''); + s.write(' ${returnType.getDartType(w)} call($paramsDartType) =>'); + final callMethodArgs = params + .map((p) => + p.type.convertDartTypeToFfiDartType(w, p.name, objCRetain: false)) + .join(', '); + final callMethodInvocation = ''' +_id.ref.invoke.cast<$natTrampFnType>().asFunction<$trampFuncFfiDartType>()( + _id, $callMethodArgs)'''; + s.write(returnType.convertFfiDartTypeToDartType( + w, callMethodInvocation, '_lib', + objCRetain: false)); + s.write(';\n'); s.write('}\n'); return BindingString( @@ -227,6 +228,24 @@ class $name extends _ObjCBlockBase { @override bool get sameDartAndCType => false; + @override + String convertDartTypeToFfiDartType( + Writer w, + String value, { + required bool objCRetain, + }) => + ObjCInterface.generateGetId(value, objCRetain); + + @override + String convertFfiDartTypeToDartType( + Writer w, + String value, + String library, { + required bool objCRetain, + String? objCEnclosingClass, + }) => + ObjCInterface.generateConstructor(name, value, library, objCRetain); + @override String toString() => '($returnType (^)(${argTypes.join(', ')}))'; } diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index b772861e8a..60c998b88f 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -239,6 +239,11 @@ class $name implements ${w.ffiLibraryPrefix}.Finalizable { /// Return a pointer to this object. $idType get pointer => _id; + + $idType _retainAndReturnId() { + _lib.$retain(_id.cast()); + return _id; + } } '''); } diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index e4cf26072a..2ed1f10e17 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -207,12 +207,19 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { s.write(isStatic ? '_lib.${_classObject.name}' : '_id'); s.write(', _lib.${m.selObject!.name}'); for (final p in m.params) { - s.write(', ${_doArgConversion(p)}'); + final convertedParam = + p.type.convertDartTypeToFfiDartType(w, p.name, objCRetain: false); + s.write(', $convertedParam'); } s.write(');\n'); if (convertReturn) { - final result = _doReturnConversion( - returnType, '_ret', name, '_lib', m.isOwnedReturn); + final result = returnType.convertFfiDartTypeToDartType( + w, + '_ret', + '_lib', + objCRetain: !m.isOwnedReturn, + objCEnclosingClass: name, + ); s.write(' return $result;'); } @@ -394,6 +401,37 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { @override bool get sameDartAndCType => false; + @override + String convertDartTypeToFfiDartType( + Writer w, + String value, { + required bool objCRetain, + }) => + ObjCInterface.generateGetId(value, objCRetain); + + static String generateGetId(String value, bool objCRetain) => + objCRetain ? '$value._retainAndReturnId()' : '$value._id'; + + @override + String convertFfiDartTypeToDartType( + Writer w, + String value, + String library, { + required bool objCRetain, + String? objCEnclosingClass, + }) => + ObjCInterface.generateConstructor(name, value, library, objCRetain); + + static String generateConstructor( + String className, + String value, + String library, + bool objCRetain, + ) { + final ownershipFlags = 'retain: $objCRetain, release: true'; + return '$className._($value, $library, $ownershipFlags)'; + } + // Utils for converting between the internal types passed to native code, and // the external types visible to the user. For example, ObjCInterfaces are // passed to native as Pointer, but the user sees the Dart wrapper @@ -413,44 +451,6 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { } return type.getDartType(w); } - - String _doArgConversion(ObjCMethodParam arg) { - final baseType = arg.type.typealiasType; - if (baseType is ObjCNullable) { - return '${arg.name}?._id ?? ffi.nullptr'; - } else if (arg.type is ObjCInstanceType || - baseType is ObjCInterface || - baseType is ObjCObjectPointer || - baseType is ObjCBlock) { - return '${arg.name}._id'; - } - return arg.name; - } - - String _doReturnConversion(Type type, String value, String enclosingClass, - String library, bool isOwnedReturn) { - var prefix = ''; - var baseType = type.typealiasType; - if (baseType is ObjCNullable) { - prefix = '$value.address == 0 ? null : '; - type = baseType.child; - baseType = type.typealiasType; - } - final ownerFlags = 'retain: ${!isOwnedReturn}, release: true'; - if (type is ObjCInstanceType) { - return '$prefix$enclosingClass._($value, $library, $ownerFlags)'; - } - if (baseType is ObjCInterface) { - return '$prefix${baseType.name}._($value, $library, $ownerFlags)'; - } - if (baseType is ObjCBlock) { - return '$prefix${baseType.name}._($value, $library)'; - } - if (baseType is ObjCObjectPointer) { - return '${prefix}NSObject._($value, $library, $ownerFlags)'; - } - return prefix + value; - } } enum ObjCMethodKind { diff --git a/pkgs/ffigen/lib/src/code_generator/objc_nullable.dart b/pkgs/ffigen/lib/src/code_generator/objc_nullable.dart index db57e5f3a6..a8d8c52285 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_nullable.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_nullable.dart @@ -44,6 +44,39 @@ class ObjCNullable extends Type { @override bool get sameDartAndCType => false; + @override + String convertDartTypeToFfiDartType( + Writer w, + String value, { + required bool objCRetain, + }) { + // This is a bit of a hack, but works for all the types that are allowed to + // be a child type. If we add more allowed child types, we may have to start + // special casing each type. Turns value._id into value?._id ?? nullptr. + final convertedValue = child.convertDartTypeToFfiDartType(w, '$value?', + objCRetain: objCRetain); + return '$convertedValue ?? ${w.ffiLibraryPrefix}.nullptr'; + } + + @override + String convertFfiDartTypeToDartType( + Writer w, + String value, + String library, { + required bool objCRetain, + String? objCEnclosingClass, + }) { + // All currently supported child types have a Pointer as their FfiDartType. + final convertedValue = child.convertFfiDartTypeToDartType( + w, + value, + library, + objCRetain: objCRetain, + objCEnclosingClass: objCEnclosingClass, + ); + return '$value.address == 0 ? null : $convertedValue'; + } + @override String toString() => '$child?'; diff --git a/pkgs/ffigen/lib/src/code_generator/pointer.dart b/pkgs/ffigen/lib/src/code_generator/pointer.dart index 753639571f..dcaf59731e 100644 --- a/pkgs/ffigen/lib/src/code_generator/pointer.dart +++ b/pkgs/ffigen/lib/src/code_generator/pointer.dart @@ -86,4 +86,22 @@ class ObjCObjectPointer extends PointerType { @override bool get sameDartAndCType => false; + + @override + String convertDartTypeToFfiDartType( + Writer w, + String value, { + required bool objCRetain, + }) => + ObjCInterface.generateGetId(value, objCRetain); + + @override + String convertFfiDartTypeToDartType( + Writer w, + String value, + String library, { + required bool objCRetain, + String? objCEnclosingClass, + }) => + ObjCInterface.generateConstructor('NSObject', value, library, objCRetain); } diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index 454c783405..fff7f0f03a 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -54,8 +54,39 @@ abstract class Type { /// Returns whether the dart type and C type string are same. bool get sameDartAndCType => sameFfiDartAndCType; - /// Returns the string representation of the Type, for debugging purposes - /// only. This string should not be printed as generated code. + /// Returns generated Dart code that converts the given value from its + /// DartType to its FfiDartType. + /// + /// [value] is the value to be converted. If [objCRetain] is true, the ObjC + /// object will be reained (ref count incremented) during conversion. + String convertDartTypeToFfiDartType( + Writer w, + String value, { + required bool objCRetain, + }) => + value; + + /// Returns generated Dart code that converts the given value from its + /// FfiDartType to its DartType. + /// + /// [value] is the value to be converted, and [library] is an instance of the + /// native library object. If [objCRetain] is true, the ObjC wrapper object + /// will retain (ref count increment) the wrapped object pointer. If this + /// conversion is occuring in the context of an ObjC class, then + /// [objCEnclosingClass] should be the name of the Dart wrapper class (this is + /// used by instancetype). + String convertFfiDartTypeToDartType( + Writer w, + String value, + String library, { + required bool objCRetain, + String? objCEnclosingClass, + }) => + value; + + /// Returns a human readable string representation of the Type. This is mostly + /// just for debugging, but it may also be used for non-functional code (eg to + /// name a variable or type in generated code). @override String toString(); @@ -107,6 +138,24 @@ abstract class BindingType extends NoLookUpBinding implements Type { @override bool get sameDartAndCType => sameFfiDartAndCType; + @override + String convertDartTypeToFfiDartType( + Writer w, + String value, { + required bool objCRetain, + }) => + value; + + @override + String convertFfiDartTypeToDartType( + Writer w, + String value, + String library, { + required bool objCRetain, + String? objCEnclosingClass, + }) => + value; + @override String toString() => originalName; diff --git a/pkgs/ffigen/lib/src/code_generator/typealias.dart b/pkgs/ffigen/lib/src/code_generator/typealias.dart index 834987b7fa..fe971a54df 100644 --- a/pkgs/ffigen/lib/src/code_generator/typealias.dart +++ b/pkgs/ffigen/lib/src/code_generator/typealias.dart @@ -142,7 +142,15 @@ class Typealias extends BindingType { } @override - String getDartType(Writer w) => _dartAliasName ?? type.getDartType(w); + String getDartType(Writer w) { + if (_dartAliasName != null) { + return _dartAliasName!; + } else if (type.sameDartAndCType) { + return getFfiDartType(w); + } else { + return type.getDartType(w); + } + } @override bool get sameFfiDartAndCType => type.sameFfiDartAndCType; @@ -150,6 +158,30 @@ class Typealias extends BindingType { @override bool get sameDartAndCType => type.sameDartAndCType; + @override + String convertDartTypeToFfiDartType( + Writer w, + String value, { + required bool objCRetain, + }) => + type.convertDartTypeToFfiDartType(w, value, objCRetain: objCRetain); + + @override + String convertFfiDartTypeToDartType( + Writer w, + String value, + String library, { + required bool objCRetain, + String? objCEnclosingClass, + }) => + type.convertFfiDartTypeToDartType( + w, + value, + library, + objCRetain: objCRetain, + objCEnclosingClass: objCEnclosingClass, + ); + @override String cacheKey() => type.cacheKey(); @@ -173,4 +205,25 @@ class ObjCInstanceType extends Typealias { super.genFfiDartType, super.isInternal, }) : super._(); + + @override + String convertDartTypeToFfiDartType( + Writer w, + String value, { + required bool objCRetain, + }) => + ObjCInterface.generateGetId(value, objCRetain); + + @override + String convertFfiDartTypeToDartType( + Writer w, + String value, + String library, { + required bool objCRetain, + String? objCEnclosingClass, + }) => + // objCEnclosingClass must be present, because instancetype can only + // occur inside a class. + ObjCInterface.generateConstructor( + objCEnclosingClass!, value, library, objCRetain); } diff --git a/pkgs/ffigen/test/native_objc_test/block_config.yaml b/pkgs/ffigen/test/native_objc_test/block_config.yaml index e83c6b70b8..841439e073 100644 --- a/pkgs/ffigen/test/native_objc_test/block_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/block_config.yaml @@ -1,5 +1,5 @@ name: BlockTestObjCLibrary -description: 'Tests calling Objective-C blocks' +description: 'Tests calling Objective-C blocks.' language: objc output: 'block_bindings.dart' exclude-all-by-default: true diff --git a/pkgs/ffigen/test/native_objc_test/block_test.dart b/pkgs/ffigen/test/native_objc_test/block_test.dart index 0253eaf1d8..7ca61d6ce8 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.dart +++ b/pkgs/ffigen/test/native_objc_test/block_test.dart @@ -21,6 +21,9 @@ typedef FloatBlock = ObjCBlock_ffiFloat_ffiFloat; typedef DoubleBlock = ObjCBlock_ffiDouble_ffiDouble; typedef Vec4Block = ObjCBlock_Vec4_Vec4; typedef VoidBlock = ObjCBlock_ffiVoid; +typedef ObjectBlock = ObjCBlock_DummyObject_DummyObject; +typedef NullableObjectBlock = ObjCBlock_DummyObject_DummyObject1; +typedef BlockBlock = ObjCBlock_Int32Int32_Int32Int32; void main() { late BlockTestObjCLibrary lib; @@ -125,41 +128,111 @@ void main() { }); test('Struct block', () { - final inputPtr = calloc(); - final input = inputPtr.ref; - input.x = 1.2; - input.y = 3.4; - input.z = 5.6; - input.w = 7.8; - - final tempPtr = calloc(); - final temp = tempPtr.ref; - final block = Vec4Block.fromFunction(lib, (Vec4 v) { - // Twiddle the Vec4 components. - temp.x = v.y; - temp.y = v.z; - temp.z = v.w; - temp.w = v.x; - return temp; - }); - - final result1 = block(input); - expect(result1.x, 3.4); - expect(result1.y, 5.6); - expect(result1.z, 7.8); - expect(result1.w, 1.2); - - final result2Ptr = calloc(); - final result2 = result2Ptr.ref; - BlockTester.callVec4Block_(lib, result2Ptr, block); - expect(result2.x, 3.4); - expect(result2.y, 5.6); - expect(result2.z, 7.8); - expect(result2.w, 1.2); - - calloc.free(inputPtr); - calloc.free(tempPtr); - calloc.free(result2Ptr); + using((Arena arena) { + final inputPtr = arena(); + final input = inputPtr.ref; + input.x = 1.2; + input.y = 3.4; + input.z = 5.6; + input.w = 7.8; + + final tempPtr = arena(); + final temp = tempPtr.ref; + final block = Vec4Block.fromFunction(lib, (Vec4 v) { + // Twiddle the Vec4 components. + temp.x = v.y; + temp.y = v.z; + temp.z = v.w; + temp.w = v.x; + return temp; + }); + + final result1 = block(input); + expect(result1.x, 3.4); + expect(result1.y, 5.6); + expect(result1.z, 7.8); + expect(result1.w, 1.2); + + final result2Ptr = arena(); + final result2 = result2Ptr.ref; + BlockTester.callVec4Block_(lib, result2Ptr, block); + expect(result2.x, 3.4); + expect(result2.y, 5.6); + expect(result2.z, 7.8); + expect(result2.w, 1.2); + }); + }); + + test('Object block', () { + bool isCalled = false; + final block = ObjectBlock.fromFunction(lib, (DummyObject x) { + isCalled = true; + return x; + }); + + final obj = DummyObject.new1(lib); + final result1 = block(obj); + expect(result1, obj); + expect(isCalled, isTrue); + + isCalled = false; + final result2 = BlockTester.callObjectBlock_(lib, block); + expect(result2, isNot(obj)); + expect(result2.pointer, isNot(nullptr)); + expect(isCalled, isTrue); + }); + + test('Nullable object block', () { + bool isCalled = false; + final block = NullableObjectBlock.fromFunction(lib, (DummyObject? x) { + isCalled = true; + return x; + }); + + final obj = DummyObject.new1(lib); + final result1 = block(obj); + expect(result1, obj); + expect(isCalled, isTrue); + + isCalled = false; + final result2 = block(null); + expect(result2, isNull); + expect(isCalled, isTrue); + + isCalled = false; + final result3 = BlockTester.callNullableObjectBlock_(lib, block); + expect(result3, isNull); + expect(isCalled, isTrue); + }); + + test('Block block', () { + final blockBlock = BlockBlock.fromFunction(lib, (IntBlock intBlock) { + return IntBlock.fromFunction(lib, (int x) { + return 3 * intBlock(x); + }); + }); + + final intBlock = IntBlock.fromFunction(lib, (int x) { + return 5 * x; + }); + final result1 = blockBlock(intBlock); + expect(result1(1), 15); + + final result2 = BlockTester.newBlock_withMult_(lib, blockBlock, 2); + expect(result2(1), 6); + }); + + test('Native block block', () { + final blockBlock = BlockTester.newBlockBlock_(lib, 7); + + final intBlock = IntBlock.fromFunction(lib, (int x) { + return 5 * x; + }); + final result1 = blockBlock(intBlock); + expect(result1(1), 35); + + final result2 = BlockTester.newBlock_withMult_(lib, blockBlock, 2); + expect(result2(1), 14); }); Pointer funcPointerBlockRefCountTest() { @@ -172,7 +245,7 @@ void main() { test('Function pointer block ref counting', () { final rawBlock = funcPointerBlockRefCountTest(); doGC(); - expect(BlockTester.getBlockRetainCount_(lib, rawBlock.cast()), 0); + expect(BlockTester.getBlockRetainCount_(lib, rawBlock), 0); }); Pointer funcBlockRefCountTest() { @@ -181,10 +254,208 @@ void main() { return block.pointer.cast(); } - test('Function pointer block ref counting', () { + test('Function block ref counting', () { final rawBlock = funcBlockRefCountTest(); doGC(); - expect(BlockTester.getBlockRetainCount_(lib, rawBlock.cast()), 0); + expect(BlockTester.getBlockRetainCount_(lib, rawBlock), 0); + }); + + (Pointer, Pointer, Pointer) + blockBlockDartCallRefCountTest() { + final inputBlock = IntBlock.fromFunction(lib, (int x) { + return 5 * x; + }); + final blockBlock = BlockBlock.fromFunction(lib, (IntBlock intBlock) { + return IntBlock.fromFunction(lib, (int x) { + return 3 * intBlock(x); + }); + }); + final outputBlock = blockBlock(inputBlock); + expect(outputBlock(1), 15); + doGC(); + + // One reference held by inputBlock object, another bound to the + // outputBlock lambda. + expect( + BlockTester.getBlockRetainCount_(lib, inputBlock.pointer.cast()), 2); + + expect( + BlockTester.getBlockRetainCount_(lib, blockBlock.pointer.cast()), 1); + expect( + BlockTester.getBlockRetainCount_(lib, outputBlock.pointer.cast()), 1); + return ( + inputBlock.pointer.cast(), + blockBlock.pointer.cast(), + outputBlock.pointer.cast() + ); + } + + test('Calling a block block from Dart has correct ref counting', () { + final (inputBlock, blockBlock, outputBlock) = + blockBlockDartCallRefCountTest(); + doGC(); + + // This leaks because block functions aren't cleaned up at the moment. + // TODO(https://github.com/dart-lang/ffigen/issues/428): Fix this leak. + expect(BlockTester.getBlockRetainCount_(lib, inputBlock), 1); + + expect(BlockTester.getBlockRetainCount_(lib, blockBlock), 0); + expect(BlockTester.getBlockRetainCount_(lib, outputBlock), 0); + }); + + (Pointer, Pointer, Pointer) + blockBlockObjCCallRefCountTest() { + late Pointer inputBlock; + final blockBlock = BlockBlock.fromFunction(lib, (IntBlock intBlock) { + inputBlock = intBlock.pointer.cast(); + return IntBlock.fromFunction(lib, (int x) { + return 3 * intBlock(x); + }); + }); + final outputBlock = BlockTester.newBlock_withMult_(lib, blockBlock, 2); + expect(outputBlock(1), 6); + doGC(); + + expect(BlockTester.getBlockRetainCount_(lib, inputBlock), 2); + expect( + BlockTester.getBlockRetainCount_(lib, blockBlock.pointer.cast()), 1); + expect( + BlockTester.getBlockRetainCount_(lib, outputBlock.pointer.cast()), 1); + return ( + inputBlock, + blockBlock.pointer.cast(), + outputBlock.pointer.cast() + ); + } + + test('Calling a block block from ObjC has correct ref counting', () { + final (inputBlock, blockBlock, outputBlock) = + blockBlockObjCCallRefCountTest(); + doGC(); + + // This leaks because block functions aren't cleaned up at the moment. + // TODO(https://github.com/dart-lang/ffigen/issues/428): Fix this leak. + expect(BlockTester.getBlockRetainCount_(lib, inputBlock), 2); + + expect(BlockTester.getBlockRetainCount_(lib, blockBlock), 0); + expect(BlockTester.getBlockRetainCount_(lib, outputBlock), 0); + }); + + (Pointer, Pointer, Pointer) + nativeBlockBlockDartCallRefCountTest() { + final inputBlock = IntBlock.fromFunction(lib, (int x) { + return 5 * x; + }); + final blockBlock = BlockTester.newBlockBlock_(lib, 7); + final outputBlock = blockBlock(inputBlock); + expect(outputBlock(1), 35); + doGC(); + + // One reference held by inputBlock object, another held internally by the + // ObjC implementation of the blockBlock. + expect( + BlockTester.getBlockRetainCount_(lib, inputBlock.pointer.cast()), 2); + + expect( + BlockTester.getBlockRetainCount_(lib, blockBlock.pointer.cast()), 1); + expect( + BlockTester.getBlockRetainCount_(lib, outputBlock.pointer.cast()), 1); + return ( + inputBlock.pointer.cast(), + blockBlock.pointer.cast(), + outputBlock.pointer.cast() + ); + } + + test('Calling a native block block from Dart has correct ref counting', () { + final (inputBlock, blockBlock, outputBlock) = + nativeBlockBlockDartCallRefCountTest(); + doGC(); + expect(BlockTester.getBlockRetainCount_(lib, inputBlock), 0); + expect(BlockTester.getBlockRetainCount_(lib, blockBlock), 0); + expect(BlockTester.getBlockRetainCount_(lib, outputBlock), 0); + }); + + (Pointer, Pointer) nativeBlockBlockObjCCallRefCountTest() { + final blockBlock = BlockTester.newBlockBlock_(lib, 7); + final outputBlock = BlockTester.newBlock_withMult_(lib, blockBlock, 2); + expect(outputBlock(1), 14); + doGC(); + + expect( + BlockTester.getBlockRetainCount_(lib, blockBlock.pointer.cast()), 1); + expect( + BlockTester.getBlockRetainCount_(lib, outputBlock.pointer.cast()), 1); + return (blockBlock.pointer.cast(), outputBlock.pointer.cast()); + } + + test('Calling a native block block from ObjC has correct ref counting', () { + final (blockBlock, outputBlock) = nativeBlockBlockObjCCallRefCountTest(); + doGC(); + expect(BlockTester.getBlockRetainCount_(lib, blockBlock), 0); + expect(BlockTester.getBlockRetainCount_(lib, outputBlock), 0); + }); + + (Pointer, Pointer) objectBlockRefCountTest(Allocator alloc) { + final inputCounter = alloc(); + final outputCounter = alloc(); + inputCounter.value = 0; + outputCounter.value = 0; + + final block = ObjectBlock.fromFunction(lib, (DummyObject x) { + return DummyObject.newWithCounter_(lib, outputCounter); + }); + + final inputObj = DummyObject.newWithCounter_(lib, inputCounter); + final outputObj = block(inputObj); + expect(inputCounter.value, 1); + expect(outputCounter.value, 1); + + return (inputCounter, outputCounter); + } + + test('Objects received and returned by blocks have correct ref counts', () { + using((Arena arena) { + final (inputCounter, outputCounter) = objectBlockRefCountTest(arena); + doGC(); + expect(inputCounter.value, 0); + expect(outputCounter.value, 0); + }); + }); + + (Pointer, Pointer) objectNativeBlockRefCountTest( + Allocator alloc) { + final inputCounter = alloc(); + final outputCounter = alloc(); + inputCounter.value = 0; + outputCounter.value = 0; + + final block = ObjectBlock.fromFunction(lib, (DummyObject x) { + x.setCounter_(inputCounter); + return DummyObject.newWithCounter_(lib, outputCounter); + }); + + final outputObj = BlockTester.callObjectBlock_(lib, block); + expect(inputCounter.value, 1); + expect(outputCounter.value, 1); + + return (inputCounter, outputCounter); + } + + test( + 'Objects received and returned by native blocks have correct ref counts', + () { + using((Arena arena) { + final (inputCounter, outputCounter) = + objectNativeBlockRefCountTest(arena); + doGC(); + + // This leaks because block functions aren't cleaned up at the moment. + // TODO(https://github.com/dart-lang/ffigen/issues/428): Fix this leak. + expect(inputCounter.value, 1); + + expect(outputCounter.value, 0); + }); }); test('Block fields have sensible values', () { diff --git a/pkgs/ffigen/test/native_objc_test/block_test.m b/pkgs/ffigen/test/native_objc_test/block_test.m index a864f2ef81..3dd4289d54 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.m +++ b/pkgs/ffigen/test/native_objc_test/block_test.m @@ -12,11 +12,47 @@ double w; } Vec4; +@interface DummyObject : NSObject { + int32_t* counter; +} ++ (instancetype)newWithCounter:(int32_t*) _counter; +- (instancetype)initWithCounter:(int32_t*) _counter; +- (void)setCounter:(int32_t*) _counter; +- (void)dealloc; +@end +@implementation DummyObject + ++ (instancetype)newWithCounter:(int32_t*) _counter { + return [[DummyObject alloc] initWithCounter: _counter]; +} + +- (instancetype)initWithCounter:(int32_t*) _counter { + counter = _counter; + ++*counter; + return [super init]; +} + +- (void)setCounter:(int32_t*) _counter { + counter = _counter; + ++*counter; +} + +- (void)dealloc { + if (counter != nil) --*counter; + [super dealloc]; +} + +@end + + typedef int32_t (^IntBlock)(int32_t); typedef float (^FloatBlock)(float); typedef double (^DoubleBlock)(double); typedef Vec4 (^Vec4Block)(Vec4); typedef void (^VoidBlock)(); +typedef DummyObject* (^ObjectBlock)(DummyObject*); +typedef DummyObject* _Nullable (^NullableObjectBlock)(DummyObject* _Nullable); +typedef IntBlock (^BlockBlock)(IntBlock); // Wrapper around a block, so that our Dart code can test creating and invoking // blocks in Objective C code. @@ -34,6 +70,10 @@ + (NSThread*)callOnNewThread:(VoidBlock)block; + (float)callFloatBlock:(FloatBlock)block; + (double)callDoubleBlock:(DoubleBlock)block; + (Vec4)callVec4Block:(Vec4Block)block; ++ (DummyObject*)callObjectBlock:(ObjectBlock)block NS_RETURNS_RETAINED; ++ (nullable DummyObject*)callNullableObjectBlock:(NullableObjectBlock)block; ++ (IntBlock)newBlock:(BlockBlock)block withMult:(int)mult; ++ (BlockBlock)newBlockBlock:(int)mult; @end @implementation BlockTester @@ -116,4 +156,27 @@ + (Vec4)callVec4Block:(Vec4Block)block { return block(vec4); } ++ (DummyObject*)callObjectBlock:(ObjectBlock)block NS_RETURNS_RETAINED { + return block([DummyObject new]); +} + ++ (nullable DummyObject*)callNullableObjectBlock:(NullableObjectBlock)block { + return block(nil); +} + ++ (IntBlock)newBlock:(BlockBlock)block withMult:(int)mult { + return block([^int(int x) { + return mult * x; + } copy]); + // ^ copy this stack allocated block to the heap. +} + ++ (BlockBlock)newBlockBlock:(int)mult { + return [^IntBlock(IntBlock block) { + return [^int(int x) { + return mult * block(x); + } copy]; + } copy]; +} + @end diff --git a/pkgs/ffigen/test/native_objc_test/nullable_test.dart b/pkgs/ffigen/test/native_objc_test/nullable_test.dart index 9aed94e118..b264531dd8 100644 --- a/pkgs/ffigen/test/native_objc_test/nullable_test.dart +++ b/pkgs/ffigen/test/native_objc_test/nullable_test.dart @@ -64,6 +64,13 @@ void main() { expect(NullableInterface.isNullWithNotNullableNSObjectPtrArg_(lib, obj), false); }); + + test('Explicit non null', () { + expect( + NullableInterface.isNullWithExplicitNonNullableNSObjectPtrArg_( + lib, obj), + false); + }); }); }); } diff --git a/pkgs/ffigen/test/native_objc_test/nullable_test.m b/pkgs/ffigen/test/native_objc_test/nullable_test.m index abf1b02b85..06d257d596 100644 --- a/pkgs/ffigen/test/native_objc_test/nullable_test.m +++ b/pkgs/ffigen/test/native_objc_test/nullable_test.m @@ -5,6 +5,7 @@ @interface NullableInterface : NSObject { +(BOOL) isNullWithNullableNSObjectArg:(nullable NSObject *)x; +(BOOL) isNullWithNotNullableNSObjectPtrArg:(NSObject *)x; ++(BOOL) isNullWithExplicitNonNullableNSObjectPtrArg:(nonnull NSObject *)x; +(nullable NSObject *) returnNil:(BOOL)r; @property (nullable, retain) NSObject *nullableObjectProperty; @@ -21,6 +22,10 @@ +(BOOL) isNullWithNotNullableNSObjectPtrArg:(NSObject *)x { return x == NULL; } ++(BOOL) isNullWithExplicitNonNullableNSObjectPtrArg:(nonnull NSObject *)x { + return x == NULL; +} + +(nullable NSObject *) returnNil:(BOOL)r { if (r) { return nil; From 0d205b90903f381924b0b92857a3377b242fa01a Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Wed, 1 Nov 2023 16:41:03 +0800 Subject: [PATCH 269/276] [ffigen] Fix generated asset/assetId property for ffi-native (#634) --- pkgs/ffigen/CHANGELOG.md | 1 + pkgs/ffigen/README.md | 2 +- pkgs/ffigen/example/ffinative/config.yaml | 4 ++-- .../{ => lib}/generated_bindings.dart | 18 +++++++++++++----- pkgs/ffigen/ffigen.schema.json | 4 ++-- pkgs/ffigen/lib/src/code_generator/func.dart | 4 ++-- .../lib/src/config_provider/config_types.dart | 4 ++-- .../lib/src/config_provider/spec_utils.dart | 2 +- pkgs/ffigen/lib/src/strings.dart | 2 +- pkgs/ffigen/test/native_test/native_test.dart | 2 ++ 10 files changed, 27 insertions(+), 16 deletions(-) rename pkgs/ffigen/example/ffinative/{ => lib}/generated_bindings.dart (52%) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 2d90855d2c..3de820dba9 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -10,6 +10,7 @@ generate a typedef for the `Function`. - Use Dart wrapper types in args and returns of ObjCBlocks. - Bump min SDK version to 3.2.0-114.0.dev. +- Renamed `asset` to `assetId` for `ffi-native`. # 9.0.1 diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 61464fdea5..3f2d0d8b85 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -543,7 +543,7 @@ type-map: ```yaml ffi-native: - asset: 'myasset' # Optional. + assetId: 'myasset' # Optional. ``` diff --git a/pkgs/ffigen/example/ffinative/config.yaml b/pkgs/ffigen/example/ffinative/config.yaml index 397dbba8f7..1bb3dac0c4 100644 --- a/pkgs/ffigen/example/ffinative/config.yaml +++ b/pkgs/ffigen/example/ffinative/config.yaml @@ -2,9 +2,9 @@ name: NativeLibrary ffi-native: - # asset: 'assetname' # (optional) + assetId: 'package:ffinative_example/generated_bindings.dart' # (optional) description: Bindings to `headers/example.h`. -output: 'generated_bindings.dart' +output: 'lib/generated_bindings.dart' headers: entry-points: - 'headers/example.h' diff --git a/pkgs/ffigen/example/ffinative/generated_bindings.dart b/pkgs/ffigen/example/ffinative/lib/generated_bindings.dart similarity index 52% rename from pkgs/ffigen/example/ffinative/generated_bindings.dart rename to pkgs/ffigen/example/ffinative/lib/generated_bindings.dart index 389620d8a6..13c7d2b9b3 100644 --- a/pkgs/ffigen/example/ffinative/generated_bindings.dart +++ b/pkgs/ffigen/example/ffinative/lib/generated_bindings.dart @@ -7,28 +7,35 @@ import 'dart:ffi' as ffi; /// Adds 2 integers. -@ffi.Native(symbol: 'sum') +@ffi.Native( + symbol: 'sum', assetId: 'package:ffinative_example/generated_bindings.dart') external int sum( int a, int b, ); /// Subtracts 2 integers. -@ffi.Native(symbol: 'subtract') +@ffi.Native( + symbol: 'subtract', + assetId: 'package:ffinative_example/generated_bindings.dart') external int subtract( int a, int b, ); /// Multiplies 2 integers, returns pointer to an integer,. -@ffi.Native Function(ffi.Int, ffi.Int)>(symbol: 'multiply') +@ffi.Native Function(ffi.Int, ffi.Int)>( + symbol: 'multiply', + assetId: 'package:ffinative_example/generated_bindings.dart') external ffi.Pointer multiply( int a, int b, ); /// Divides 2 integers, returns pointer to a float. -@ffi.Native Function(ffi.Int, ffi.Int)>(symbol: 'divide') +@ffi.Native Function(ffi.Int, ffi.Int)>( + symbol: 'divide', + assetId: 'package:ffinative_example/generated_bindings.dart') external ffi.Pointer divide( int a, int b, @@ -36,7 +43,8 @@ external ffi.Pointer divide( /// Divides 2 floats, returns a pointer to double. @ffi.Native Function(ffi.Float, ffi.Float)>( - symbol: 'dividePrecision') + symbol: 'dividePrecision', + assetId: 'package:ffinative_example/generated_bindings.dart') external ffi.Pointer dividePrecision( double a, double b, diff --git a/pkgs/ffigen/ffigen.schema.json b/pkgs/ffigen/ffigen.schema.json index a557a87cde..5c196f1f1c 100644 --- a/pkgs/ffigen/ffigen.schema.json +++ b/pkgs/ffigen/ffigen.schema.json @@ -418,12 +418,12 @@ "type": "object", "additionalProperties": false, "properties": { - "asset": { + "assetId": { "type": "string" } }, "required": [ - "asset" + "assetId" ] } ] diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index 5e081cf7e7..cbdebe7ef3 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -111,8 +111,8 @@ class Func extends LookUpBinding { functionType.getFfiDartType(w, writeArgumentNames: false); if (ffiNativeConfig.enabled) { - final assetString = ffiNativeConfig.asset != null - ? ", asset: '${ffiNativeConfig.asset}'" + final assetString = ffiNativeConfig.assetId != null + ? ", assetId: '${ffiNativeConfig.assetId}'" : ''; final isLeafString = isLeaf ? ', isLeaf: true' : ''; s.write( diff --git a/pkgs/ffigen/lib/src/config_provider/config_types.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart index 75d5fcaeed..a4cf1426fb 100644 --- a/pkgs/ffigen/lib/src/config_provider/config_types.dart +++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart @@ -384,9 +384,9 @@ class ObjCModulePrefixer { class FfiNativeConfig { final bool enabled; - final String? asset; + final String? assetId; - const FfiNativeConfig({required this.enabled, this.asset}); + const FfiNativeConfig({required this.enabled, this.assetId}); } class SymbolFile { diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index ff4e1b76e4..86a4bc5ac2 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -602,6 +602,6 @@ FfiNativeConfig ffiNativeExtractor(dynamic yamlConfig) { final yamlMap = yamlConfig as Map?; return FfiNativeConfig( enabled: true, - asset: yamlMap?[strings.ffiNativeAsset] as String?, + assetId: yamlMap?[strings.ffiNativeAsset] as String?, ); } diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 7613289a9a..0918f48e71 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -263,7 +263,7 @@ const doubleNaN = 'double.nan'; const dartHandleUsr = 'c:@S@_Dart_Handle'; const ffiNative = 'ffi-native'; -const ffiNativeAsset = 'asset'; +const ffiNativeAsset = 'assetId'; Directory? _tmpDir; diff --git a/pkgs/ffigen/test/native_test/native_test.dart b/pkgs/ffigen/test/native_test/native_test.dart index cc31709e39..9c734a5657 100644 --- a/pkgs/ffigen/test/native_test/native_test.dart +++ b/pkgs/ffigen/test/native_test/native_test.dart @@ -58,6 +58,7 @@ void main() { rethrow; } }); + test('bool', () { expect(bindings.Function1Bool(true), false); expect(bindings.Function1Bool(false), true); @@ -112,6 +113,7 @@ void main() { } } }); + test('Array Workaround: Range Errors', () { final struct1 = bindings.getStruct1(); // Index (get) above range. From 9dcd6ef6bf456460ab87cfbe2284e6401ed1a98b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 22:38:14 +0000 Subject: [PATCH 270/276] [ffigen] Bump subosito/flutter-action from 2.10.0 to 2.12.0 (#638) Bumps [subosito/flutter-action](https://github.com/subosito/flutter-action) from 2.10.0 to 2.12.0.
    Release notes

    Sourced from subosito/flutter-action's releases.

    v2.12.0

    No release notes provided.

    v2.11.0

    Allow git ref as version for master channel:

    steps:
    - uses: actions/checkout@v3
    - uses: subosito/flutter-action@v2
      with:
        flutter-version: '5b12b74' # tag, commit or branch
        channel: 'master'
    - run: flutter --version
    
    Commits

    [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=subosito/flutter-action&package-manager=github_actions&previous-version=2.10.0&new-version=2.12.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
    Dependabot commands and options
    You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    --- pkgs/ffigen/.github/workflows/test-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 4cd755399e..bb59c441bb 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -107,7 +107,7 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa + - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 with: channel: "master" - name: Install dependencies From bf2e60ddedd32e2b8125f377a905ffe638bb588f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 22:42:48 +0000 Subject: [PATCH 271/276] [ffigen] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#637) Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.5.1 to 1.6.0.
    Release notes

    Sourced from dart-lang/setup-dart's releases.

    v1.6.0

    • Enable provisioning of the latest Dart SDK patch release by specifying just the major and minor version (e.g. 3.2).
    Changelog

    Sourced from dart-lang/setup-dart's changelog.

    v1.6.0

    • Enable provisioning of the latest Dart SDK patch release by specifying just the major and minor version (e.g. 3.2).

    v1.5.1

    • No longer test the setup-dart action on pre-2.12 SDKs.
    • Upgrade JS interop code to use extension types (the new name for inline classes).
    • The upcoming rename of the be channel to main is now supported with forward compatibility that switches when the rename happens.

    v1.5.0

    • Re-wrote the implementation of the action into Dart.
    • Auto-detect the platform architecture (x64, ia32, arm, arm64).
    • Improved the caching and download resilience of the sdk.
    • Added a new action output: dart-version - the installed version of the sdk.

    v1.4.0

    • Automatically create OIDC token for pub.dev.
    • Add a reusable workflow for publishing.

    v1.3.0

    • The install location of the Dart SDK is now available in an environment variable, DART_HOME (#43).
    • Fixed an issue where cached downloads could lead to unzip issues on self-hosted runners (#35).

    v1.2.0

    • Fixed a path issue impacting git dependencies on Windows.

    v1.1.0

    • Added a flavor option setup.sh to allow downloading unpublished builds.

    v1.0.0

    • Promoted to 1.0 stable.

    v0.5

    • Fixed a Windows pub global activate path issue.

    ... (truncated)

    Commits

    [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=dart-lang/setup-dart&package-manager=github_actions&previous-version=1.5.1&new-version=1.6.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
    Dependabot commands and options
    You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    --- pkgs/ffigen/.github/workflows/test-package.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index bb59c441bb..6d25a755e4 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -23,7 +23,7 @@ jobs: sdk: [3.2.0-114.0.dev] steps: - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d with: sdk: ${{ matrix.sdk }} - id: install @@ -43,7 +43,7 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d with: sdk: 3.2.0-114.0.dev - name: Install dependencies @@ -60,7 +60,7 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d with: sdk: 3.2.0-114.0.dev - name: Install dependencies @@ -82,7 +82,7 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d with: sdk: 3.2.0-114.0.dev - name: Install dependencies From e2d6f4c9eb2a8226ac866562bd331be80d7a3178 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 22:43:26 +0000 Subject: [PATCH 272/276] [ffigen] Bump actions/checkout from 4.1.0 to 4.1.1 (#636) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ⚠️ **Dependabot is rebasing this PR** ⚠️ Rebasing might not happen immediately, so don't worry if this takes some time. Note: if you make any changes to this PR yourself, they will take precedence over the rebase. --- Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.0 to 4.1.1.
    Release notes

    Sourced from actions/checkout's releases.

    v4.1.1

    What's Changed

    New Contributors

    Full Changelog: https://github.com/actions/checkout/compare/v4.1.0...v4.1.1

    Commits

    [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=4.1.0&new-version=4.1.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
    Dependabot commands and options
    You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    --- pkgs/ffigen/.github/workflows/test-package.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index 6d25a755e4..d7d9d02c2c 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -22,7 +22,7 @@ jobs: # TODO: Change to 3.2.0 stable once it's released. sdk: [3.2.0-114.0.dev] steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d with: sdk: ${{ matrix.sdk }} @@ -42,7 +42,7 @@ jobs: needs: analyze runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d with: sdk: 3.2.0-114.0.dev @@ -59,7 +59,7 @@ jobs: needs: analyze runs-on: macos-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d with: sdk: 3.2.0-114.0.dev @@ -81,7 +81,7 @@ jobs: needs: analyze runs-on: windows-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d with: sdk: 3.2.0-114.0.dev @@ -106,7 +106,7 @@ jobs: needs: analyze runs-on: windows-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 with: channel: "master" From 2491826d4d5c91ac60448a8ab1d8ad69c7b6763c Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 1 Nov 2023 19:02:51 -0700 Subject: [PATCH 273/276] [ffigen] ObjC static functions (#633) * WIP static functions * Revert old code gen changes * Refactor function code gen * Arg and return conversions * fix bugs * Fix analysis, add more tests * fmt * Fix autorelease pool test * Handle NS_RETURNS_RETAINED * Daco's comments --- pkgs/ffigen/CHANGELOG.md | 1 + pkgs/ffigen/lib/src/code_generator/func.dart | 94 +++++++---- .../lib/src/code_generator/func_type.dart | 5 + .../lib/src/code_generator/objc_block.dart | 3 + .../src/code_generator/objc_interface.dart | 3 + .../lib/src/code_generator/objc_nullable.dart | 3 + .../lib/src/code_generator/pointer.dart | 3 + pkgs/ffigen/lib/src/code_generator/type.dart | 6 + .../lib/src/code_generator/typealias.dart | 3 + .../sub_parsers/functiondecl_parser.dart | 27 +++ .../automated_ref_count_test.m | 10 +- .../test/native_objc_test/block_config.yaml | 3 + .../test/native_objc_test/block_test.dart | 62 +++---- .../ffigen/test/native_objc_test/block_test.m | 30 +--- .../native_objc_test/static_func_config.yaml | 18 ++ .../static_func_native_config.yaml | 19 +++ .../static_func_native_test.dart | 156 ++++++++++++++++++ .../native_objc_test/static_func_test.dart | 156 ++++++++++++++++++ .../test/native_objc_test/static_func_test.m | 63 +++++++ pkgs/ffigen/test/native_objc_test/util.h | 35 ++++ 20 files changed, 603 insertions(+), 97 deletions(-) create mode 100644 pkgs/ffigen/test/native_objc_test/static_func_config.yaml create mode 100644 pkgs/ffigen/test/native_objc_test/static_func_native_config.yaml create mode 100644 pkgs/ffigen/test/native_objc_test/static_func_native_test.dart create mode 100644 pkgs/ffigen/test/native_objc_test/static_func_test.dart create mode 100644 pkgs/ffigen/test/native_objc_test/static_func_test.m create mode 100644 pkgs/ffigen/test/native_objc_test/util.h diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 3de820dba9..a1aef8cf17 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -9,6 +9,7 @@ - When generating typedefs for `Pointer>`, also generate a typedef for the `Function`. - Use Dart wrapper types in args and returns of ObjCBlocks. +- Use Dart wrapper types in args and returns of static functions. - Bump min SDK version to 3.2.0-114.0.dev. - Renamed `asset` to `assetId` for `ffi-native`. diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index cbdebe7ef3..766cc289ee 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -42,6 +42,7 @@ class Func extends LookUpBinding { final bool exposeSymbolAddress; final bool exposeFunctionTypedefs; final bool isLeaf; + final bool objCReturnsRetained; final FfiNativeConfig ffiNativeConfig; late final String funcPointerName; @@ -61,6 +62,7 @@ class Func extends LookUpBinding { this.exposeSymbolAddress = false, this.exposeFunctionTypedefs = false, this.isLeaf = false, + this.objCReturnsRetained = false, super.isInternal, this.ffiNativeConfig = const FfiNativeConfig(enabled: false), }) : functionType = FunctionType( @@ -93,8 +95,6 @@ class Func extends LookUpBinding { BindingString toBindingString(Writer w) { final s = StringBuffer(); final enclosingFuncName = name; - final funcVarName = w.wrapperLevelUniqueNamer.makeUnique('_$name'); - funcPointerName = w.wrapperLevelUniqueNamer.makeUnique('_${name}Ptr'); if (dartDoc != null) { s.write(makeDartDoc(dartDoc!)); @@ -109,37 +109,71 @@ class Func extends LookUpBinding { functionType.getCType(w, writeArgumentNames: false); final dartType = _exposedFunctionTypealias?.getFfiDartType(w) ?? functionType.getFfiDartType(w, writeArgumentNames: false); + final needsWrapper = !functionType.sameDartAndFfiDartType && !isInternal; + + final isLeafString = isLeaf ? 'isLeaf:true' : ''; + final funcVarName = w.wrapperLevelUniqueNamer.makeUnique('_$name'); + final ffiReturnType = functionType.returnType.getFfiDartType(w); + final ffiArgDeclString = functionType.dartTypeParameters + .map((p) => '${p.type.getFfiDartType(w)} ${p.name},\n') + .join(''); + + late final String dartReturnType; + late final String dartArgDeclString; + late final String funcImplCall; + if (needsWrapper) { + dartReturnType = functionType.returnType.getDartType(w); + dartArgDeclString = functionType.dartTypeParameters + .map((p) => '${p.type.getDartType(w)} ${p.name},\n') + .join(''); + + final argString = functionType.dartTypeParameters + .map((p) => + '${p.type.convertDartTypeToFfiDartType(w, p.name, objCRetain: false)},\n') + .join(''); + funcImplCall = functionType.returnType.convertFfiDartTypeToDartType( + w, + '$funcVarName($argString)', + ffiNativeConfig.enabled ? 'lib' : 'this', + objCRetain: !objCReturnsRetained, + ); + } else { + dartReturnType = ffiReturnType; + dartArgDeclString = ffiArgDeclString; + final argString = + functionType.dartTypeParameters.map((p) => '${p.name},\n').join(''); + funcImplCall = '$funcVarName($argString)'; + } if (ffiNativeConfig.enabled) { final assetString = ffiNativeConfig.assetId != null ? ", assetId: '${ffiNativeConfig.assetId}'" : ''; - final isLeafString = isLeaf ? ', isLeaf: true' : ''; - s.write( - "@${w.ffiLibraryPrefix}.Native<$cType>(symbol: '$originalName'$assetString$isLeafString)\n"); - - s.write( - 'external ${functionType.returnType.getFfiDartType(w)} $enclosingFuncName(\n'); - for (final p in functionType.dartTypeParameters) { - s.write(' ${p.type.getFfiDartType(w)} ${p.name},\n'); + final nativeFuncName = needsWrapper ? funcVarName : enclosingFuncName; + s.write(''' +@${w.ffiLibraryPrefix}.Native<$cType>(symbol: '$originalName'$assetString$isLeafString) +external $ffiReturnType $nativeFuncName($ffiArgDeclString); + +'''); + if (needsWrapper) { + final libArg = functionType.returnType.sameDartAndFfiDartType + ? '' + : '${w.className} lib, '; + s.write(''' +$dartReturnType $enclosingFuncName($libArg$dartArgDeclString) => $funcImplCall; + +'''); } - s.write(');\n\n'); } else { + funcPointerName = w.wrapperLevelUniqueNamer.makeUnique('_${name}Ptr'); + // Write enclosing function. - s.write( - '${functionType.returnType.getFfiDartType(w)} $enclosingFuncName(\n'); - for (final p in functionType.dartTypeParameters) { - s.write(' ${p.type.getFfiDartType(w)} ${p.name},\n'); - } - s.write(') {\n'); - s.write('return $funcVarName'); + s.write(''' +$dartReturnType $enclosingFuncName($dartArgDeclString) { + return $funcImplCall; +} - s.write('(\n'); - for (final p in functionType.dartTypeParameters) { - s.write(' ${p.name},\n'); - } - s.write(' );\n'); - s.write('}\n'); +'''); if (exposeSymbolAddress) { // Add to SymbolAddress in writer. @@ -150,12 +184,14 @@ class Func extends LookUpBinding { ptrName: funcPointerName, ); } + // Write function pointer. - s.write( - "late final $funcPointerName = ${w.lookupFuncIdentifier}<${w.ffiLibraryPrefix}.NativeFunction<$cType>>('$originalName');\n"); - final isLeafString = isLeaf ? 'isLeaf:true' : ''; - s.write( - 'late final $funcVarName = $funcPointerName.asFunction<$dartType>($isLeafString);\n\n'); + s.write(''' +late final $funcPointerName = ${w.lookupFuncIdentifier}< + ${w.ffiLibraryPrefix}.NativeFunction<$cType>>('$originalName'); +late final $funcVarName = $funcPointerName.asFunction<$dartType>($isLeafString); + +'''); } return BindingString(type: BindingStringType.func, string: s.toString()); diff --git a/pkgs/ffigen/lib/src/code_generator/func_type.dart b/pkgs/ffigen/lib/src/code_generator/func_type.dart index 1e734bc41f..49dcf605ba 100644 --- a/pkgs/ffigen/lib/src/code_generator/func_type.dart +++ b/pkgs/ffigen/lib/src/code_generator/func_type.dart @@ -78,6 +78,11 @@ class FunctionType extends Type { returnType.sameDartAndCType && dartTypeParameters.every((p) => p.type.sameDartAndCType); + @override + bool get sameDartAndFfiDartType => + returnType.sameDartAndFfiDartType && + dartTypeParameters.every((p) => p.type.sameDartAndFfiDartType); + @override String toString() => _getTypeImpl(false, (Type t) => t.toString()); diff --git a/pkgs/ffigen/lib/src/code_generator/objc_block.dart b/pkgs/ffigen/lib/src/code_generator/objc_block.dart index b61efc7cfd..d16ab11270 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_block.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_block.dart @@ -228,6 +228,9 @@ _id.ref.invoke.cast<$natTrampFnType>().asFunction<$trampFuncFfiDartType>()( @override bool get sameDartAndCType => false; + @override + bool get sameDartAndFfiDartType => false; + @override String convertDartTypeToFfiDartType( Writer w, diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 2ed1f10e17..495cdf18b5 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -401,6 +401,9 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { @override bool get sameDartAndCType => false; + @override + bool get sameDartAndFfiDartType => false; + @override String convertDartTypeToFfiDartType( Writer w, diff --git a/pkgs/ffigen/lib/src/code_generator/objc_nullable.dart b/pkgs/ffigen/lib/src/code_generator/objc_nullable.dart index a8d8c52285..f3c0b877ab 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_nullable.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_nullable.dart @@ -44,6 +44,9 @@ class ObjCNullable extends Type { @override bool get sameDartAndCType => false; + @override + bool get sameDartAndFfiDartType => false; + @override String convertDartTypeToFfiDartType( Writer w, diff --git a/pkgs/ffigen/lib/src/code_generator/pointer.dart b/pkgs/ffigen/lib/src/code_generator/pointer.dart index dcaf59731e..30e2e6ba78 100644 --- a/pkgs/ffigen/lib/src/code_generator/pointer.dart +++ b/pkgs/ffigen/lib/src/code_generator/pointer.dart @@ -87,6 +87,9 @@ class ObjCObjectPointer extends PointerType { @override bool get sameDartAndCType => false; + @override + bool get sameDartAndFfiDartType => false; + @override String convertDartTypeToFfiDartType( Writer w, diff --git a/pkgs/ffigen/lib/src/code_generator/type.dart b/pkgs/ffigen/lib/src/code_generator/type.dart index fff7f0f03a..c1d1e227fa 100644 --- a/pkgs/ffigen/lib/src/code_generator/type.dart +++ b/pkgs/ffigen/lib/src/code_generator/type.dart @@ -54,6 +54,9 @@ abstract class Type { /// Returns whether the dart type and C type string are same. bool get sameDartAndCType => sameFfiDartAndCType; + /// Returns whether the dart type and FFI dart type string are same. + bool get sameDartAndFfiDartType => true; + /// Returns generated Dart code that converts the given value from its /// DartType to its FfiDartType. /// @@ -138,6 +141,9 @@ abstract class BindingType extends NoLookUpBinding implements Type { @override bool get sameDartAndCType => sameFfiDartAndCType; + @override + bool get sameDartAndFfiDartType => true; + @override String convertDartTypeToFfiDartType( Writer w, diff --git a/pkgs/ffigen/lib/src/code_generator/typealias.dart b/pkgs/ffigen/lib/src/code_generator/typealias.dart index fe971a54df..e31d14882e 100644 --- a/pkgs/ffigen/lib/src/code_generator/typealias.dart +++ b/pkgs/ffigen/lib/src/code_generator/typealias.dart @@ -158,6 +158,9 @@ class Typealias extends BindingType { @override bool get sameDartAndCType => type.sameDartAndCType; + @override + bool get sameDartAndFfiDartType => type.sameDartAndFfiDartType; + @override String convertDartTypeToFfiDartType( Writer w, diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index f9d1121def..c2291b4a16 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'dart:ffi'; + import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/config_provider/config_types.dart'; import 'package:ffigen/src/header_parser/data.dart'; @@ -20,6 +22,7 @@ class _ParserFunc { List funcs = []; bool incompleteStructParameter = false; bool unimplementedParameterType = false; + bool objCReturnsRetained = false; _ParserFunc(); } @@ -69,6 +72,13 @@ List? parseFunctionDeclaration(clang_types.CXCursor cursor) { return _stack.pop().funcs; } + // Look for any annotations on the function. + clang.clang_visitChildren( + cursor, + _parseAnnotationVisitorPtr ??= Pointer.fromFunction( + _parseAnnotationVisitor, exceptional_visitor_return), + nullptr); + // Initialized with a single value with no prefix and empty var args. var varArgFunctions = [VarArgFunction('', [])]; if (config.varArgFunctions.containsKey(funcName)) { @@ -97,6 +107,7 @@ List? parseFunctionDeclaration(clang_types.CXCursor cursor) { exposeFunctionTypedefs: config.exposeFunctionTypedefs.shouldInclude(funcName), isLeaf: config.leafFunctions.shouldInclude(funcName), + objCReturnsRetained: _stack.top.objCReturnsRetained, ffiNativeConfig: config.ffiNativeConfig, )); } @@ -147,3 +158,19 @@ List _getParameters(clang_types.CXCursor cursor, String funcName) { Type _getParameterType(clang_types.CXCursor cursor) { return cursor.toCodeGenType(); } + +Pointer< + NativeFunction< + Int32 Function( + clang_types.CXCursor, clang_types.CXCursor, Pointer)>>? + _parseAnnotationVisitorPtr; +int _parseAnnotationVisitor(clang_types.CXCursor cursor, + clang_types.CXCursor parent, Pointer clientData) { + switch (cursor.kind) { + case clang_types.CXCursorKind.CXCursor_NSReturnsRetained: + _stack.top.objCReturnsRetained = true; + break; + default: + } + return clang_types.CXChildVisitResult.CXChildVisit_Continue; +} diff --git a/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m index d249389614..cf8ab3a1e8 100644 --- a/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m +++ b/pkgs/ffigen/test/native_objc_test/automated_ref_count_test.m @@ -89,12 +89,14 @@ - (ArcTestObject*)returnsRetained NS_RETURNS_RETAINED { @end -id createAutoreleasePool() { - return [NSAutoreleasePool new]; +// Pass around the NSAutoreleasePool as a void* to bypass the Dart wrappers so +// that we can precisely control the life cycle. +void* createAutoreleasePool() { + return (void*)[NSAutoreleasePool new]; } -void destroyAutoreleasePool(id pool) { - [pool release]; +void destroyAutoreleasePool(void* pool) { + [((NSAutoreleasePool*)pool) release]; } @implementation RefCounted diff --git a/pkgs/ffigen/test/native_objc_test/block_config.yaml b/pkgs/ffigen/test/native_objc_test/block_config.yaml index 841439e073..9f12686e3d 100644 --- a/pkgs/ffigen/test/native_objc_test/block_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/block_config.yaml @@ -6,6 +6,9 @@ exclude-all-by-default: true objc-interfaces: include: - BlockTester +functions: + include: + - getBlockRetainCount headers: entry-points: - 'block_test.m' diff --git a/pkgs/ffigen/test/native_objc_test/block_test.dart b/pkgs/ffigen/test/native_objc_test/block_test.dart index 7ca61d6ce8..d2068ced93 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.dart +++ b/pkgs/ffigen/test/native_objc_test/block_test.dart @@ -238,26 +238,26 @@ void main() { Pointer funcPointerBlockRefCountTest() { final block = IntBlock.fromFunctionPointer(lib, Pointer.fromFunction(_add100, 999)); - expect(BlockTester.getBlockRetainCount_(lib, block.pointer.cast()), 1); + expect(lib.getBlockRetainCount(block.pointer.cast()), 1); return block.pointer.cast(); } test('Function pointer block ref counting', () { final rawBlock = funcPointerBlockRefCountTest(); doGC(); - expect(BlockTester.getBlockRetainCount_(lib, rawBlock), 0); + expect(lib.getBlockRetainCount(rawBlock), 0); }); Pointer funcBlockRefCountTest() { final block = IntBlock.fromFunction(lib, makeAdder(4000)); - expect(BlockTester.getBlockRetainCount_(lib, block.pointer.cast()), 1); + expect(lib.getBlockRetainCount(block.pointer.cast()), 1); return block.pointer.cast(); } test('Function block ref counting', () { final rawBlock = funcBlockRefCountTest(); doGC(); - expect(BlockTester.getBlockRetainCount_(lib, rawBlock), 0); + expect(lib.getBlockRetainCount(rawBlock), 0); }); (Pointer, Pointer, Pointer) @@ -276,13 +276,10 @@ void main() { // One reference held by inputBlock object, another bound to the // outputBlock lambda. - expect( - BlockTester.getBlockRetainCount_(lib, inputBlock.pointer.cast()), 2); + expect(lib.getBlockRetainCount(inputBlock.pointer.cast()), 2); - expect( - BlockTester.getBlockRetainCount_(lib, blockBlock.pointer.cast()), 1); - expect( - BlockTester.getBlockRetainCount_(lib, outputBlock.pointer.cast()), 1); + expect(lib.getBlockRetainCount(blockBlock.pointer.cast()), 1); + expect(lib.getBlockRetainCount(outputBlock.pointer.cast()), 1); return ( inputBlock.pointer.cast(), blockBlock.pointer.cast(), @@ -297,10 +294,10 @@ void main() { // This leaks because block functions aren't cleaned up at the moment. // TODO(https://github.com/dart-lang/ffigen/issues/428): Fix this leak. - expect(BlockTester.getBlockRetainCount_(lib, inputBlock), 1); + expect(lib.getBlockRetainCount(inputBlock), 1); - expect(BlockTester.getBlockRetainCount_(lib, blockBlock), 0); - expect(BlockTester.getBlockRetainCount_(lib, outputBlock), 0); + expect(lib.getBlockRetainCount(blockBlock), 0); + expect(lib.getBlockRetainCount(outputBlock), 0); }); (Pointer, Pointer, Pointer) @@ -316,11 +313,9 @@ void main() { expect(outputBlock(1), 6); doGC(); - expect(BlockTester.getBlockRetainCount_(lib, inputBlock), 2); - expect( - BlockTester.getBlockRetainCount_(lib, blockBlock.pointer.cast()), 1); - expect( - BlockTester.getBlockRetainCount_(lib, outputBlock.pointer.cast()), 1); + expect(lib.getBlockRetainCount(inputBlock), 2); + expect(lib.getBlockRetainCount(blockBlock.pointer.cast()), 1); + expect(lib.getBlockRetainCount(outputBlock.pointer.cast()), 1); return ( inputBlock, blockBlock.pointer.cast(), @@ -335,10 +330,10 @@ void main() { // This leaks because block functions aren't cleaned up at the moment. // TODO(https://github.com/dart-lang/ffigen/issues/428): Fix this leak. - expect(BlockTester.getBlockRetainCount_(lib, inputBlock), 2); + expect(lib.getBlockRetainCount(inputBlock), 2); - expect(BlockTester.getBlockRetainCount_(lib, blockBlock), 0); - expect(BlockTester.getBlockRetainCount_(lib, outputBlock), 0); + expect(lib.getBlockRetainCount(blockBlock), 0); + expect(lib.getBlockRetainCount(outputBlock), 0); }); (Pointer, Pointer, Pointer) @@ -353,13 +348,10 @@ void main() { // One reference held by inputBlock object, another held internally by the // ObjC implementation of the blockBlock. - expect( - BlockTester.getBlockRetainCount_(lib, inputBlock.pointer.cast()), 2); + expect(lib.getBlockRetainCount(inputBlock.pointer.cast()), 2); - expect( - BlockTester.getBlockRetainCount_(lib, blockBlock.pointer.cast()), 1); - expect( - BlockTester.getBlockRetainCount_(lib, outputBlock.pointer.cast()), 1); + expect(lib.getBlockRetainCount(blockBlock.pointer.cast()), 1); + expect(lib.getBlockRetainCount(outputBlock.pointer.cast()), 1); return ( inputBlock.pointer.cast(), blockBlock.pointer.cast(), @@ -371,9 +363,9 @@ void main() { final (inputBlock, blockBlock, outputBlock) = nativeBlockBlockDartCallRefCountTest(); doGC(); - expect(BlockTester.getBlockRetainCount_(lib, inputBlock), 0); - expect(BlockTester.getBlockRetainCount_(lib, blockBlock), 0); - expect(BlockTester.getBlockRetainCount_(lib, outputBlock), 0); + expect(lib.getBlockRetainCount(inputBlock), 0); + expect(lib.getBlockRetainCount(blockBlock), 0); + expect(lib.getBlockRetainCount(outputBlock), 0); }); (Pointer, Pointer) nativeBlockBlockObjCCallRefCountTest() { @@ -382,18 +374,16 @@ void main() { expect(outputBlock(1), 14); doGC(); - expect( - BlockTester.getBlockRetainCount_(lib, blockBlock.pointer.cast()), 1); - expect( - BlockTester.getBlockRetainCount_(lib, outputBlock.pointer.cast()), 1); + expect(lib.getBlockRetainCount(blockBlock.pointer.cast()), 1); + expect(lib.getBlockRetainCount(outputBlock.pointer.cast()), 1); return (blockBlock.pointer.cast(), outputBlock.pointer.cast()); } test('Calling a native block block from ObjC has correct ref counting', () { final (blockBlock, outputBlock) = nativeBlockBlockObjCCallRefCountTest(); doGC(); - expect(BlockTester.getBlockRetainCount_(lib, blockBlock), 0); - expect(BlockTester.getBlockRetainCount_(lib, outputBlock), 0); + expect(lib.getBlockRetainCount(blockBlock), 0); + expect(lib.getBlockRetainCount(outputBlock), 0); }); (Pointer, Pointer) objectBlockRefCountTest(Allocator alloc) { diff --git a/pkgs/ffigen/test/native_objc_test/block_test.m b/pkgs/ffigen/test/native_objc_test/block_test.m index 3dd4289d54..d27a97c82d 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.m +++ b/pkgs/ffigen/test/native_objc_test/block_test.m @@ -5,6 +5,8 @@ #import #import +#include "util.h" + typedef struct { double x; double y; @@ -61,7 +63,6 @@ @interface BlockTester : NSObject { } + (BlockTester*)makeFromBlock:(IntBlock)block; + (BlockTester*)makeFromMultiplier:(int32_t)mult; -+ (uint64_t)getBlockRetainCount:(void*)block; - (int32_t)call:(int32_t)x; - (IntBlock)getBlock; - (void)pokeBlock; @@ -91,33 +92,6 @@ + (BlockTester*)makeFromMultiplier:(int32_t)mult { return bt; } -typedef struct { - void* isa; - int flags; - // There are other fields, but we just need the flags and isa. -} BlockRefCountExtractor; - -void* valid_block_isa = NULL; -+ (uint64_t)getBlockRetainCount:(void*)block { - BlockRefCountExtractor* b = (BlockRefCountExtractor*)block; - // HACK: The only way I can find to reliably figure out that a block has been - // deleted is to check the isa field (the lower bits of the flags field seem - // to be randomized, not just set to 0). But we also don't know the value this - // field has when it's constructed (copying the block changes it from - // _NSConcreteGlobalBlock to an internal value). So we assume that the first - // time this function is called, we have a valid block, and on subsequent - // calls we check to see if the isa field changed. - if (valid_block_isa == NULL) { - valid_block_isa = b->isa; - } - if (b->isa != valid_block_isa) { - return 0; - } - // The ref count is stored in the lower bits of the flags field, but skips the - // 0x1 bit. - return (b->flags & 0xFFFF) >> 1; -} - - (int32_t)call:(int32_t)x { return myBlock(x); } diff --git a/pkgs/ffigen/test/native_objc_test/static_func_config.yaml b/pkgs/ffigen/test/native_objc_test/static_func_config.yaml new file mode 100644 index 0000000000..bbafeaa78b --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/static_func_config.yaml @@ -0,0 +1,18 @@ +name: StaticFuncTestObjCLibrary +description: 'Test ObjC static functions' +language: objc +output: 'static_func_bindings.dart' +exclude-all-by-default: true +functions: + include: + - getBlockRetainCount + - staticFuncOfObject + - staticFuncOfNullableObject + - staticFuncOfBlock + - staticFuncReturnsRetained + - staticFuncReturnsRetainedArg +headers: + entry-points: + - 'static_func_test.m' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/static_func_native_config.yaml b/pkgs/ffigen/test/native_objc_test/static_func_native_config.yaml new file mode 100644 index 0000000000..2a591c9f70 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/static_func_native_config.yaml @@ -0,0 +1,19 @@ +name: StaticFuncTestObjCLibrary +description: 'Test ObjC static functions using @Native' +language: objc +output: 'static_func_native_bindings.dart' +exclude-all-by-default: true +ffi-native: +functions: + include: + - getBlockRetainCount + - staticFuncOfObject + - staticFuncOfNullableObject + - staticFuncOfBlock + - staticFuncReturnsRetained + - staticFuncReturnsRetainedArg +headers: + entry-points: + - 'static_func_test.m' +preamble: | + // ignore_for_file: camel_case_types, non_constant_identifier_names, unused_element, unused_field diff --git a/pkgs/ffigen/test/native_objc_test/static_func_native_test.dart b/pkgs/ffigen/test/native_objc_test/static_func_native_test.dart new file mode 100644 index 0000000000..93cbcad749 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/static_func_native_test.dart @@ -0,0 +1,156 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +// Keep in sync with static_func_test.dart. These are the same tests, but using +// @Native. + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:test/test.dart'; +import 'package:ffi/ffi.dart'; +import '../test_utils.dart'; +import 'static_func_native_bindings.dart'; +import 'util.dart'; + +typedef IntBlock = ObjCBlock_Int32_Int32; + +void main() { + late StaticFuncTestObjCLibrary lib; + late void Function(Pointer, Pointer) executeInternalCommand; + + group('static functions', () { + setUpAll(() { + logWarnings(); + final dylib = File('test/native_objc_test/static_func_test.dylib'); + verifySetupFile(dylib); + lib = StaticFuncTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); + + executeInternalCommand = DynamicLibrary.process().lookupFunction< + Void Function(Pointer, Pointer), + void Function( + Pointer, Pointer)>('Dart_ExecuteInternalCommand'); + + generateBindingsForCoverage('static_func'); + }); + + doGC() { + final gcNow = "gc-now".toNativeUtf8(); + executeInternalCommand(gcNow.cast(), nullptr); + calloc.free(gcNow); + } + + Pointer staticFuncOfObjectRefCountTest(Allocator alloc) { + final counter = alloc(); + counter.value = 0; + + final obj = StaticFuncTestObj.newWithCounter_(lib, counter); + expect(counter.value, 1); + + final outputObj = staticFuncOfObject(lib, obj); + expect(obj, outputObj); + expect(counter.value, 1); + + return counter; + } + + test('Objects passed through static functions have correct ref counts', () { + using((Arena arena) { + final (counter) = staticFuncOfObjectRefCountTest(arena); + doGC(); + expect(counter.value, 0); + }); + }); + + Pointer staticFuncOfNullableObjectRefCountTest(Allocator alloc) { + final counter = alloc(); + counter.value = 0; + + final obj = StaticFuncTestObj.newWithCounter_(lib, counter); + expect(counter.value, 1); + + final outputObj = staticFuncOfNullableObject(lib, obj); + expect(obj, outputObj); + expect(counter.value, 1); + + return counter; + } + + test('Nullables passed through static functions have correct ref counts', + () { + using((Arena arena) { + final (counter) = staticFuncOfNullableObjectRefCountTest(arena); + doGC(); + expect(counter.value, 0); + + expect(staticFuncOfNullableObject(lib, null), isNull); + }); + }); + + Pointer staticFuncOfBlockRefCountTest() { + final block = IntBlock.fromFunction(lib, (int x) => 2 * x); + expect(getBlockRetainCount(block.pointer.cast()), 1); + + final outputBlock = staticFuncOfBlock(lib, block); + expect(block, outputBlock); + expect(getBlockRetainCount(block.pointer.cast()), 2); + + return block.pointer.cast(); + } + + test('Blocks passed through static functions have correct ref counts', () { + final (rawBlock) = staticFuncOfBlockRefCountTest(); + doGC(); + expect(getBlockRetainCount(rawBlock), 0); + }); + + Pointer staticFuncReturnsRetainedRefCountTest(Allocator alloc) { + final counter = alloc(); + counter.value = 0; + + final outputObj = staticFuncReturnsRetained(lib, counter); + expect(counter.value, 1); + + return counter; + } + + test( + 'Objects returned from static functions with NS_RETURNS_RETAINED ' + 'have correct ref counts', () { + using((Arena arena) { + final (counter) = staticFuncReturnsRetainedRefCountTest(arena); + doGC(); + expect(counter.value, 0); + }); + }); + + Pointer staticFuncOfObjectReturnsRetainedRefCountTest( + Allocator alloc) { + final counter = alloc(); + counter.value = 0; + + final obj = StaticFuncTestObj.newWithCounter_(lib, counter); + expect(counter.value, 1); + + final outputObj = staticFuncReturnsRetainedArg(lib, obj); + expect(obj, outputObj); + expect(counter.value, 1); + + return counter; + } + + test( + 'Objects passed through static functions with NS_RETURNS_RETAINED ' + 'have correct ref counts', () { + using((Arena arena) { + final (counter) = staticFuncOfObjectReturnsRetainedRefCountTest(arena); + doGC(); + expect(counter.value, 0); + }); + }); + }); +} diff --git a/pkgs/ffigen/test/native_objc_test/static_func_test.dart b/pkgs/ffigen/test/native_objc_test/static_func_test.dart new file mode 100644 index 0000000000..f3d9c01be8 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/static_func_test.dart @@ -0,0 +1,156 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Objective C support is only available on mac. +@TestOn('mac-os') + +// Keep in sync with static_func_test.dart. These are the same tests, but +// without using @Native. + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:test/test.dart'; +import 'package:ffi/ffi.dart'; +import '../test_utils.dart'; +import 'static_func_bindings.dart'; +import 'util.dart'; + +typedef IntBlock = ObjCBlock_Int32_Int32; + +void main() { + late StaticFuncTestObjCLibrary lib; + late void Function(Pointer, Pointer) executeInternalCommand; + + group('static functions', () { + setUpAll(() { + logWarnings(); + final dylib = File('test/native_objc_test/static_func_test.dylib'); + verifySetupFile(dylib); + lib = StaticFuncTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); + + executeInternalCommand = DynamicLibrary.process().lookupFunction< + Void Function(Pointer, Pointer), + void Function( + Pointer, Pointer)>('Dart_ExecuteInternalCommand'); + + generateBindingsForCoverage('static_func'); + }); + + doGC() { + final gcNow = "gc-now".toNativeUtf8(); + executeInternalCommand(gcNow.cast(), nullptr); + calloc.free(gcNow); + } + + Pointer staticFuncOfObjectRefCountTest(Allocator alloc) { + final counter = alloc(); + counter.value = 0; + + final obj = StaticFuncTestObj.newWithCounter_(lib, counter); + expect(counter.value, 1); + + final outputObj = lib.staticFuncOfObject(obj); + expect(obj, outputObj); + expect(counter.value, 1); + + return counter; + } + + test('Objects passed through static functions have correct ref counts', () { + using((Arena arena) { + final (counter) = staticFuncOfObjectRefCountTest(arena); + doGC(); + expect(counter.value, 0); + }); + }); + + Pointer staticFuncOfNullableObjectRefCountTest(Allocator alloc) { + final counter = alloc(); + counter.value = 0; + + final obj = StaticFuncTestObj.newWithCounter_(lib, counter); + expect(counter.value, 1); + + final outputObj = lib.staticFuncOfNullableObject(obj); + expect(obj, outputObj); + expect(counter.value, 1); + + return counter; + } + + test('Nullables passed through static functions have correct ref counts', + () { + using((Arena arena) { + final (counter) = staticFuncOfNullableObjectRefCountTest(arena); + doGC(); + expect(counter.value, 0); + + expect(lib.staticFuncOfNullableObject(null), isNull); + }); + }); + + Pointer staticFuncOfBlockRefCountTest() { + final block = IntBlock.fromFunction(lib, (int x) => 2 * x); + expect(lib.getBlockRetainCount(block.pointer.cast()), 1); + + final outputBlock = lib.staticFuncOfBlock(block); + expect(block, outputBlock); + expect(lib.getBlockRetainCount(block.pointer.cast()), 2); + + return block.pointer.cast(); + } + + test('Blocks passed through static functions have correct ref counts', () { + final (rawBlock) = staticFuncOfBlockRefCountTest(); + doGC(); + expect(lib.getBlockRetainCount(rawBlock), 0); + }); + + Pointer staticFuncReturnsRetainedRefCountTest(Allocator alloc) { + final counter = alloc(); + counter.value = 0; + + final outputObj = lib.staticFuncReturnsRetained(counter); + expect(counter.value, 1); + + return counter; + } + + test( + 'Objects returned from static functions with NS_RETURNS_RETAINED ' + 'have correct ref counts', () { + using((Arena arena) { + final (counter) = staticFuncReturnsRetainedRefCountTest(arena); + doGC(); + expect(counter.value, 0); + }); + }); + + Pointer staticFuncOfObjectReturnsRetainedRefCountTest( + Allocator alloc) { + final counter = alloc(); + counter.value = 0; + + final obj = StaticFuncTestObj.newWithCounter_(lib, counter); + expect(counter.value, 1); + + final outputObj = lib.staticFuncReturnsRetainedArg(obj); + expect(obj, outputObj); + expect(counter.value, 1); + + return counter; + } + + test( + 'Objects passed through static functions with NS_RETURNS_RETAINED ' + 'have correct ref counts', () { + using((Arena arena) { + final (counter) = staticFuncOfObjectReturnsRetainedRefCountTest(arena); + doGC(); + expect(counter.value, 0); + }); + }); + }); +} diff --git a/pkgs/ffigen/test/native_objc_test/static_func_test.m b/pkgs/ffigen/test/native_objc_test/static_func_test.m new file mode 100644 index 0000000000..5fc3a14d72 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/static_func_test.m @@ -0,0 +1,63 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#import + +#include "util.h" + +@interface StaticFuncTestObj : NSObject { + int32_t* counter; +} ++ (instancetype)newWithCounter:(int32_t*) _counter; +- (instancetype)initWithCounter:(int32_t*) _counter; +- (void)setCounter:(int32_t*) _counter; +- (void)dealloc; +@end + +StaticFuncTestObj* staticFuncOfObject(StaticFuncTestObj* a) { + return a; +} + +StaticFuncTestObj* _Nullable staticFuncOfNullableObject( + StaticFuncTestObj* _Nullable a) { + return a; +} + +typedef int32_t (^IntBlock)(int32_t); +IntBlock staticFuncOfBlock(IntBlock a) { + return a; +} + +NS_RETURNS_RETAINED StaticFuncTestObj* staticFuncReturnsRetained( + int32_t* counter) { + return [StaticFuncTestObj newWithCounter: counter]; +} + +NS_RETURNS_RETAINED StaticFuncTestObj* staticFuncReturnsRetainedArg( + StaticFuncTestObj* a) { + return [a retain]; +} + + +@implementation StaticFuncTestObj ++ (instancetype)newWithCounter:(int32_t*) _counter { + return [[StaticFuncTestObj alloc] initWithCounter: _counter]; +} + +- (instancetype)initWithCounter:(int32_t*) _counter { + counter = _counter; + ++*counter; + return [super init]; +} + +- (void)setCounter:(int32_t*) _counter { + counter = _counter; + ++*counter; +} + +- (void)dealloc { + if (counter != nil) --*counter; + [super dealloc]; +} +@end diff --git a/pkgs/ffigen/test/native_objc_test/util.h b/pkgs/ffigen/test/native_objc_test/util.h new file mode 100644 index 0000000000..0694aea5d7 --- /dev/null +++ b/pkgs/ffigen/test/native_objc_test/util.h @@ -0,0 +1,35 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#ifndef _TEST_UTIL_H_ +#define _TEST_UTIL_H_ + +typedef struct { + void* isa; + int flags; + // There are other fields, but we just need the flags and isa. +} BlockRefCountExtractor; + +static void* valid_block_isa = NULL; +uint64_t getBlockRetainCount(void* block) { + BlockRefCountExtractor* b = (BlockRefCountExtractor*)block; + // HACK: The only way I can find to reliably figure out that a block has been + // deleted is to check the isa field (the lower bits of the flags field seem + // to be randomized, not just set to 0). But we also don't know the value this + // field has when it's constructed (copying the block changes it from + // _NSConcreteGlobalBlock to an internal value). So we assume that the first + // time this function is called, we have a valid block, and on subsequent + // calls we check to see if the isa field changed. + if (valid_block_isa == NULL) { + valid_block_isa = b->isa; + } + if (b->isa != valid_block_isa) { + return 0; + } + // The ref count is stored in the lower bits of the flags field, but skips the + // 0x1 bit. + return (b->flags & 0xFFFF) >> 1; +} + +#endif // _TEST_UTIL_H_ From 1920cc982354598de4ca7421d237f48345aceb28 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Sun, 12 Nov 2023 23:14:53 -0800 Subject: [PATCH 274/276] [ffigen] Prepare for merge into dart-lang/native (#641) --- .../ffigen/.github/workflows/test-package.yml | 8 +- pkgs/ffigen/CHANGELOG.md | 200 +++++++++--------- .../c_json/cjson_generated_bindings.dart | 10 +- pkgs/ffigen/example/c_json/pubspec.yaml | 2 +- pkgs/ffigen/example/ffinative/pubspec.yaml | 2 +- .../example/libclang-example/pubspec.yaml | 2 +- .../objective_c/avf_audio_bindings.dart | 125 ++++++----- pkgs/ffigen/example/objective_c/pubspec.yaml | 2 +- .../example/shared_bindings/pubspec.yaml | 2 +- .../example/simple/generated_bindings.dart | 5 +- pkgs/ffigen/example/simple/pubspec.yaml | 2 +- .../example/swift/swift_api_bindings.dart | 31 ++- pkgs/ffigen/pubspec.yaml | 2 +- .../_expected_boolean_dartbool_bindings.dart | 5 +- .../_expected_functions_bindings.dart | 5 +- .../_expected_cjson_bindings.dart | 10 +- .../_expected_sqlite_bindings.dart | 40 ++-- 17 files changed, 216 insertions(+), 237 deletions(-) diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/pkgs/ffigen/.github/workflows/test-package.yml index d7d9d02c2c..b809a9a752 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/pkgs/ffigen/.github/workflows/test-package.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: # TODO: Change to 3.2.0 stable once it's released. - sdk: [3.2.0-114.0.dev] + sdk: [3.2.0-210.4.beta] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d @@ -45,7 +45,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d with: - sdk: 3.2.0-114.0.dev + sdk: 3.2.0-210.4.beta - name: Install dependencies run: dart pub get - name: Install libclang-14-dev @@ -62,7 +62,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d with: - sdk: 3.2.0-114.0.dev + sdk: 3.2.0-210.4.beta - name: Install dependencies run: dart pub get - name: Build test dylib and bindings @@ -84,7 +84,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d with: - sdk: 3.2.0-114.0.dev + sdk: 3.2.0-210.4.beta - name: Install dependencies run: dart pub get - name: Build test dylib and bindings diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index a1aef8cf17..bda105b484 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,4 +1,4 @@ -# 10.0.0-dev.0 +## 10.0.0-dev.0 - Add support for ObjC Blocks that can be invoked from any thread, using NativeCallable.listener. @@ -10,44 +10,44 @@ generate a typedef for the `Function`. - Use Dart wrapper types in args and returns of ObjCBlocks. - Use Dart wrapper types in args and returns of static functions. -- Bump min SDK version to 3.2.0-114.0.dev. +- Bump min SDK version to 3.2.0-210.4.beta. - Renamed `asset` to `assetId` for `ffi-native`. -# 9.0.1 +## 9.0.1 - Fix doc comment missing on struct/union array fields. - Allow extern inline functions to be generated. -# 9.0.0 +## 9.0.0 - Added a JSON schema for FFIgen config files. -# 8.0.2 +## 8.0.2 - Fixed invalid code generated due to zero-length arrays in structs/union. -# 8.0.1 +## 8.0.1 - Fixed invalid code generated due to anonymous structs/unions with unsupported types. -# 8.0.0 +## 8.0.0 - Stable release for Dart 3.0 with support for class modifers, variadic arguments, and `@Native`s. -# 8.0.0-dev.3 +## 8.0.0-dev.3 - Added support for variadic functions using config `functions -> variadic-arguments`. -# 8.0.0-dev.2 +## 8.0.0-dev.2 - Use `@Native` syntax instead of deprecated `@FfiNative` syntax. -# 8.0.0-dev.1 +## 8.0.0-dev.1 - Fix invalid struct/enum member references due to multiple anonymous struct/enum in a declaration. -# 8.0.0-dev.0 +## 8.0.0-dev.0 - Adds `final` class modifier to generated sub types `Struct`, `Union` and `Opaque`. A class modifier is required in Dart 3.0 because the classes @@ -58,144 +58,144 @@ `Opaque` sub types is already disallowed by `dart:ffi` pre 3.0, so adding the `final` keyword is not a breaking change. - Bumps SDK lowerbound to 3.0. -# 7.2.11 +## 7.2.11 - Fix invalid struct/enum member references due to multiple anonymous struct/enum in a declaration. -# 7.2.10 +## 7.2.10 - Generate parameter names in function pointer fields and typedefs. -# 7.2.9 +## 7.2.9 - Detect LLVM installed using Scoop on Windows machines. -# 7.2.8 +## 7.2.8 - Automatically generate `ignore_for_file: type=lint` if not specified in preamble. -# 7.2.7 +## 7.2.7 - Fix some macros not being generated in some cases due to relative header paths. -# 7.2.6 +## 7.2.6 - Fix path normalization behaviour for absolute paths and globs starting with `**`. -# 7.2.5 +## 7.2.5 - Add support nested anonymous union/struct -# 7.2.4 +## 7.2.4 - Add new supported typedef - `uintptr_t` (mapped to `ffi.UintPtr`). -# 7.2.3 +## 7.2.3 - Change compiler option order so that user options can override built-in options. -# 7.2.2 +## 7.2.2 - Added newer versions of LLVM, to default `linuxDylibLocations`. -# 7.2.1 +## 7.2.1 - Fix helper methods sometimes missing from NSString. -# 7.2.0 +## 7.2.0 - Added support for sharing bindings using `symbol-file` config. (See `README.md` and examples/shared_bindings). -# 7.1.0 +## 7.1.0 - Handle declarations with definition accessible from a different entry-point. -# 7.0.0 +## 7.0.0 - Fix typedef include/exclude config. - Return `ObjCBlock` wrapper instead of raw pointer in more cases. -# 7.0.0-dev +## 7.0.0-dev - Relative paths in ffigen config files are now assumed to be relative to the config file, rather than the working directory of the tool invocation. -# 6.1.2 +## 6.1.2 - Fix bug where function bindings were not deduped correctly. -# 6.1.1 +## 6.1.1 - _EXPERIMENTAL_ support for `FfiNative`. The API and output might change at any point. -# 6.1.0 +## 6.1.0 - Added `exclude-all-by-default` config flag, which changes the default behavior of declaration filters to exclude everything, rather than include everything. -# 6.0.2 +## 6.0.2 - Bump `package:ffi` to 2.0.1. -# 6.0.1 +## 6.0.1 - Replace path separators in `include-directives` before matching file names. - Add more ways to find `libclang`. -# 6.0.0 +## 6.0.0 - Removed config `dart-bool`. Booleans are now always generated with `bool` and `ffi.Bool` as it's Dart and C Type respectively. -# 5.0.1 +## 5.0.1 - Add a the xcode tools llvm as default path on MacOS. -# 5.0.0 +## 5.0.0 - Stable release targeting Dart 2.17, supporting ABI-specific integer types. - _EXPERIMENTAL_ support for ObjectiveC on MacOS hosts. The API and output might change at any point. Feel free to report bugs if encountered. -# 5.0.0-dev.1 +## 5.0.0-dev.1 - Fixed invalid default dart types being generated for `size_t` and `wchar_t`. -# 5.0.0-dev.0 +## 5.0.0-dev.0 - Added support for generating ABI Specific integers. - Breaking: removed config keys - `size-map` and `typedef-map`. - Added config keys - `library-imports` and `type-map`. -# 4.1.3 +## 4.1.3 - Analyzer fixes. -# 4.1.2 +## 4.1.2 - Added fix for empty include list to exclude all -# 4.1.1 +## 4.1.1 - Added fix for errors due to name collision between member name and type name used internally in structs/unions. -# 4.1.0 +## 4.1.0 - Add config key `functions -> leaf` for specifying `isLeaf:true` for functions. -# 4.0.0 +## 4.0.0 - Release for Dart SDK `>=2.14`. -# 4.0.0-dev.2 +## 4.0.0-dev.2 - Added config key `functions -> expose-typedefs` to expose the typedef to Native and Dart type. - Config key `function`->`symbol-address` no longer exposes the typedef to Native type. Use `expose-typedefs` to get the native type. -# 4.0.0-dev.1 +## 4.0.0-dev.1 - This package now targets package:lints for the generated code. The generated code uses C symbol names as is. Use either `// ignore_for_file: lintRule1, lintRule2` in the `preamble`, or rename the symbols to make package:lints happy. - Name collisions are now resolved by suffixing `` instead of `_`. -# 4.0.0-dev.0 +## 4.0.0-dev.0 - Added support for generating typedefs (_referred_ typedefs only). @@ -231,197 +231,197 @@ used somewhere. by their actual name, or if they are unnamed then by the name of the first typedef that refers to them. -# 3.1.0-dev.1 +## 3.1.0-dev.1 - Users can now specify exact path to dynamic library in `llvm-path`. -# 3.1.0-dev.0 +## 3.1.0-dev.0 - Added support for generating unions. -# 3.0.0 +## 3.0.0 - Release for dart sdk `>=2.13` (Support for packed structs and inline arrays). -# 3.0.0-beta.0 +## 3.0.0-beta.0 - Added support for inline arrays in `Struct`s. - Remove config key `array-workaround`. - Remove deprecated key `llvm-lib` from config, Use `llvm-path` instead. -# 2.5.0-beta.1 +## 2.5.0-beta.1 - Added support for `Packed` structs. Packed annotations are generated automatically but can be overriden using `structs -> pack` config. - Updated sdk constraints to `>=2.13.0-211.6.beta`. -# 2.4.2 +## 2.4.2 - Fix issues due to declarations having duplicate names. - Fix name conflict of declaration with ffi library prefix. - Fix `char` not being recognized on platforms where it's unsigned by default. -# 2.4.1 +## 2.4.1 - Added `/usr/lib` to default dynamic library location for linux. -# 2.4.0 +## 2.4.0 - Added new config key `llvm-path` that accepts a list of `path/to/llvm`. - Deprecated config key `llvm-lib`. -# 2.3.0 +## 2.3.0 - Added config key `compiler-opts-automatic -> macos -> include-c-standard-library` (default: true) to automatically find and add C standard library on macOS. - Allow passing list of string to config key `compiler-opts`. -# 2.2.5 +## 2.2.5 - Added new command line flag `--compiler-opts` to the command line tool. -# 2.2.4 +## 2.2.4 - Fix `sort: true` not working. - Fix extra `//` or `///` in comments when using `comments -> style`: `full`. -# 2.2.3 +## 2.2.3 - Added new subkey `dependency-only` (options - `full (default) | opaque`) under `structs`. When set to `opaque`, ffigen will generate empty `Opaque` structs if structs were excluded in config (i.e added because they were a dependency) and only passed by reference(pointer). -# 2.2.2 +## 2.2.2 - Fixed generation of empty opaque structs due to forward declarations in header files. -# 2.2.1 +## 2.2.1 - Fixed generation of duplicate constants suffixed with `_` when using multiple entry points. -# 2.2.0 +## 2.2.0 - Added subkey `symbol-address` to expose native symbol pointers for `functions` and `globals`. -# 2.1.0 +## 2.1.0 - Added a new named constructor `NativeLibrary.fromLookup()` to support dynamic linking. - Updated dart SDK constraints to latest stable version `2.12.0`. -# 2.0.3 +## 2.0.3 - Ignore typedef to struct pointer when possible. - Recursively create directories for output file. -# 2.0.2 +## 2.0.2 - Fixed illegal use of `const` in name, crash due to unnamed inline structs and structs having `Opaque` members. -# 2.0.1 +## 2.0.1 - Switch to preview release of `package:quiver`. -# 2.0.0 +## 2.0.0 - Upgraded all dependencies. `package:ffigen` now runs with sound null safety. -# 2.0.0-dev.6 +## 2.0.0-dev.6 - Functions marked `inline` are now skipped. -# 2.0.0-dev.5 +## 2.0.0-dev.5 - Use `Opaque` for representing empty `Struct`s. -# 2.0.0-dev.4 +## 2.0.0-dev.4 - Add support for parsing and generating globals. -# 2.0.0-dev.3 +## 2.0.0-dev.3 - Removed the usage of `--no-sound-null-safety` flag. -# 2.0.0-dev.2 +## 2.0.0-dev.2 - Removed setup phase for ffigen. Added new optional config key `llvm-lib` to specify path to `llvm/lib` folder. -# 2.0.0-dev.1 +## 2.0.0-dev.1 - Added support for passing and returning struct by value in functions. -# 2.0.0-dev.0 +## 2.0.0-dev.0 - Added support for Nested structs. -# 2.0.0-nullsafety.1 +## 2.0.0-nullsafety.1 - Removed the need for `--no-sound-null-safety` flag. -# 2.0.0-nullsafety.0 +## 2.0.0-nullsafety.0 - Migrated to (unsound) null safety. -# 1.2.0 +## 1.2.0 - Added support for `Dart_Handle` from `dart_api.h`. -# 1.1.0 +## 1.1.0 - `typedef-map` can now be used to map a typedef name to a native type directly. -# 1.0.6 +## 1.0.6 - Fixed missing typedefs nested in another typedef's return types. -# 1.0.5 +## 1.0.5 - Fixed issues with generating macros of type `double.Infinity` and `double.NaN`. -# 1.0.4 +## 1.0.4 - Updated code to use `dart format` instead of `dartfmt` for sdk version `>= 2.10.0`. -# 1.0.3 +## 1.0.3 - Fixed errors due to extended ASCII and control characters in macro strings. -# 1.0.2 +## 1.0.2 - Fix indentation for pub's readme. -# 1.0.1 +## 1.0.1 - Fixed generation of `NativeFunction` parameters instead of `Pointer` in type signatures. -# 1.0.0 +## 1.0.0 - Bump version to 1.0.0. - Handle unimplememnted function pointers causing errors. - Log lexical/semantic issues in headers as SEVERE. -# 0.3.0 +## 0.3.0 - Added support for including/excluding/renaming _un-named enums_ using key `unnamed_enums`. -# 0.2.4+1 +## 0.2.4+1 - Minor changes to dylib creation error log. -# 0.2.4 +## 0.2.4 - Added support for C booleans as Uint8. - Added config `dart-bool` (default: true) to use dart bool instead of int in function parameters and return type. -# 0.2.3+3 +## 0.2.3+3 - Wrapper dynamic library version now uses ffigen version from its pubspec.yaml file. -# 0.2.3+2 +## 0.2.3+2 - Handle code formatting using dartfmt by finding dart-sdk. -# 0.2.3+1 +## 0.2.3+1 - Fixed missing typedefs of nested function pointers. -# 0.2.3 +## 0.2.3 - Fixed parsing structs with bitfields, all members of structs with bit field members will now be removed. See [#84](https://github.com/dart-lang/ffigen/issues/84) -# 0.2.2+1 +## 0.2.2+1 - Updated `package:meta` version to `^1.1.8` for compatibility with flutter sdk. -# 0.2.2 +## 0.2.2 - Fixed multiple generation/skipping of typedef enclosed declarations. - Typedef names are now given higher preference over inner names, See [#83](https://github.com/dart-lang/ffigen/pull/83). -# 0.2.1+1 +## 0.2.1+1 - Added FAQ to readme. -# 0.2.1 +## 0.2.1 - Fixed missing/duplicate typedef generation. -# 0.2.0 +## 0.2.0 - Updated header config. Header `entry-points` and `include-directives` are now specified under `headers` key. Glob syntax is allowed. - Updated declaration `include`/`exclude` config. These are now specified as a list. - Added Regexp based declaration renaming using `rename` subkey. - Added Regexp based member renaming for structs, enums and functions using `member-rename` subkey. `prefix` and `prefix-replacement` subkeys have been removed. -# 0.1.5 +## 0.1.5 - Added support for parsing macros and anonymous unnamed enums. These are generated as top level constants. -# 0.1.4 +## 0.1.4 - Comments config now has a style and length sub keys - `style: doxygen(default) | any`, `length: brief | full(default)`, and can be disabled by passing `comments: false`. -# 0.1.3 +## 0.1.3 - Handled function arguments - dart keyword name collision - Fix travis tests: the dynamic library is created using `pub run ffigen:setup` before running the tests. -# 0.1.2 +## 0.1.2 - Fixed wrapper not found error when running `pub run ffigen`. -# 0.1.1 +## 0.1.1 - Address pub score: follow dart File conventions, provide documentation, and pass static analysis. -# 0.1.0 +## 0.1.0 - Support for Functions, Structs and Enums. - Glob support for specifying headers. - HeaderFilter - Include/Exclude declarations from specific header files using name matching. diff --git a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart index 38bc263f8d..9ee0f81333 100644 --- a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart +++ b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart @@ -73,9 +73,8 @@ class CJson { } late final _cJSON_ParsePtr = _lookup< - ffi - .NativeFunction Function(ffi.Pointer)>>( - 'cJSON_Parse'); + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>>('cJSON_Parse'); late final _cJSON_Parse = _cJSON_ParsePtr .asFunction Function(ffi.Pointer)>(); @@ -110,9 +109,8 @@ class CJson { } late final _cJSON_PrintPtr = _lookup< - ffi - .NativeFunction Function(ffi.Pointer)>>( - 'cJSON_Print'); + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>>('cJSON_Print'); late final _cJSON_Print = _cJSON_PrintPtr .asFunction Function(ffi.Pointer)>(); diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index c1277a898b..f543823575 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -5,7 +5,7 @@ name: c_json_example environment: - sdk: ">=3.2.0-114.0.dev <4.0.0" + sdk: ">=3.2.0-210.4.beta <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/ffinative/pubspec.yaml b/pkgs/ffigen/example/ffinative/pubspec.yaml index 7be76fc128..122e5b978f 100644 --- a/pkgs/ffigen/example/ffinative/pubspec.yaml +++ b/pkgs/ffigen/example/ffinative/pubspec.yaml @@ -5,7 +5,7 @@ name: ffinative_example environment: - sdk: ">=3.2.0-114.0.dev <4.0.0" + sdk: ">=3.2.0-210.4.beta <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index a8ecc544b3..79860c7771 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -5,7 +5,7 @@ name: libclang_example environment: - sdk: ">=3.2.0-114.0.dev <4.0.0" + sdk: ">=3.2.0-210.4.beta <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart index eaa669d753..8d4936f874 100644 --- a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart +++ b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart @@ -22553,20 +22553,20 @@ class AVFAudio { ); } - late final __objc_msgSend_803Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi - .Pointer< + late final __objc_msgSend_803Ptr = + _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< ffi.NativeFunction< NSUInteger Function( ffi.Pointer)>>, - ffi.Bool)>> - Function(ffi.Pointer, ffi.Pointer)>>( - 'objc_msgSend'); + ffi.Bool)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); late final __objc_msgSend_803 = __objc_msgSend_803Ptr.asFunction< ffi.Pointer< ffi.NativeFunction< @@ -36092,17 +36092,16 @@ class ObjCBlock4 extends _ObjCBlockBase { NSUInteger arg1, ffi.Pointer arg2)>> ptr) : this._( - lib - ._newBlock1( - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSUInteger arg1, - ffi.Pointer arg2)>( - _ObjCBlock4_fnPtrTrampoline, false) - .cast(), - ptr.cast()), + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>( + _ObjCBlock4_fnPtrTrampoline, false) + .cast(), + ptr.cast()), lib); /// Creates a block from a Dart function. @@ -47404,16 +47403,15 @@ class ObjCBlock19 extends _ObjCBlockBase { ffi.Pointer arg1)>> ptr) : this._( - lib - ._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock19_fnPtrTrampoline) - .cast(), - ptr.cast()), + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock19_fnPtrTrampoline) + .cast(), + ptr.cast()), lib); /// Creates a block from a Dart function. @@ -47562,8 +47560,7 @@ class ObjCBlock21 extends _ObjCBlockBase { ObjCBlock21.fromFunctionPointer( AVFAudio lib, ffi.Pointer< - ffi - .NativeFunction< + ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, ffi.Pointer arg2)>> ptr) @@ -47657,16 +47654,15 @@ class ObjCBlock22 extends _ObjCBlockBase { ffi.Pointer arg1)>> ptr) : this._( - lib - ._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock22_fnPtrTrampoline) - .cast(), - ptr.cast()), + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock22_fnPtrTrampoline) + .cast(), + ptr.cast()), lib); /// Creates a block from a Dart function. @@ -47815,16 +47811,15 @@ class ObjCBlock24 extends _ObjCBlockBase { ffi.Pointer arg1)>> ptr) : this._( - lib - ._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock24_fnPtrTrampoline) - .cast(), - ptr.cast()), + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock24_fnPtrTrampoline) + .cast(), + ptr.cast()), lib); /// Creates a block from a Dart function. @@ -62447,8 +62442,7 @@ class ObjCBlock39 extends _ObjCBlockBase { ObjCBlock39.fromFunctionPointer( AVFAudio lib, ffi.Pointer< - ffi - .NativeFunction< + ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, ffi.Pointer arg2)>> ptr) @@ -63112,16 +63106,15 @@ class ObjCBlock40 extends _ObjCBlockBase { ffi.Pointer arg1)>> ptr) : this._( - lib - ._newBlock1( - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1)>( - _ObjCBlock40_fnPtrTrampoline) - .cast(), - ptr.cast()), + lib._newBlock1( + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock40_fnPtrTrampoline) + .cast(), + ptr.cast()), lib); /// Creates a block from a Dart function. diff --git a/pkgs/ffigen/example/objective_c/pubspec.yaml b/pkgs/ffigen/example/objective_c/pubspec.yaml index c06b7a0ab1..354250a431 100644 --- a/pkgs/ffigen/example/objective_c/pubspec.yaml +++ b/pkgs/ffigen/example/objective_c/pubspec.yaml @@ -5,7 +5,7 @@ name: objective_c_example environment: - sdk: ">=3.2.0-114.0.dev <4.0.0" + sdk: ">=3.2.0-210.4.beta <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/shared_bindings/pubspec.yaml b/pkgs/ffigen/example/shared_bindings/pubspec.yaml index 23008d23ac..005214cff1 100644 --- a/pkgs/ffigen/example/shared_bindings/pubspec.yaml +++ b/pkgs/ffigen/example/shared_bindings/pubspec.yaml @@ -5,7 +5,7 @@ name: shared_bindings environment: - sdk: ">=3.2.0-114.0.dev <4.0.0" + sdk: ">=3.2.0-210.4.beta <4.0.0" dependencies: cli_util: ^0.4.0 diff --git a/pkgs/ffigen/example/simple/generated_bindings.dart b/pkgs/ffigen/example/simple/generated_bindings.dart index b26a8ac7a7..71f0414a8f 100644 --- a/pkgs/ffigen/example/simple/generated_bindings.dart +++ b/pkgs/ffigen/example/simple/generated_bindings.dart @@ -81,9 +81,8 @@ class NativeLibrary { } late final _dividePtr = _lookup< - ffi - .NativeFunction Function(ffi.Int, ffi.Int)>>( - 'divide'); + ffi.NativeFunction< + ffi.Pointer Function(ffi.Int, ffi.Int)>>('divide'); late final _divide = _dividePtr.asFunction Function(int, int)>(); diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index bef37902c4..67b34996a9 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -5,7 +5,7 @@ name: simple_example environment: - sdk: ">=3.2.0-114.0.dev <4.0.0" + sdk: ">=3.2.0-210.4.beta <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/example/swift/swift_api_bindings.dart b/pkgs/ffigen/example/swift/swift_api_bindings.dart index 2a8783aa26..9d19d79b15 100644 --- a/pkgs/ffigen/example/swift/swift_api_bindings.dart +++ b/pkgs/ffigen/example/swift/swift_api_bindings.dart @@ -22558,20 +22558,20 @@ class SwiftLibrary { ); } - late final __objc_msgSend_803Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi - .Pointer< + late final __objc_msgSend_803Ptr = + _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< ffi.NativeFunction< NSUInteger Function( ffi.Pointer)>>, - ffi.Bool)>> - Function(ffi.Pointer, ffi.Pointer)>>( - 'objc_msgSend'); + ffi.Bool)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); late final __objc_msgSend_803 = __objc_msgSend_803Ptr.asFunction< ffi.Pointer< ffi.NativeFunction< @@ -34838,7 +34838,8 @@ class ObjCBlock4 extends _ObjCBlockBase { /// Creates a block from a C function pointer. ObjCBlock4.fromFunctionPointer( SwiftLibrary lib, - ffi.Pointer< + ffi + .Pointer< ffi .NativeFunction< ffi.Bool Function(ffi.Pointer arg0, @@ -46336,8 +46337,7 @@ class ObjCBlock21 extends _ObjCBlockBase { ObjCBlock21.fromFunctionPointer( SwiftLibrary lib, ffi.Pointer< - ffi - .NativeFunction< + ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, ffi.Pointer arg2)>> ptr) @@ -61245,8 +61245,7 @@ class ObjCBlock39 extends _ObjCBlockBase { ObjCBlock39.fromFunctionPointer( SwiftLibrary lib, ffi.Pointer< - ffi - .NativeFunction< + ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, ffi.Pointer arg2)>> ptr) diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index ae45a104d7..0e24c1c0e3 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -15,7 +15,7 @@ topics: - codegen environment: - sdk: ">=3.2.0-114.0.dev <4.0.0" + sdk: ">=3.2.0-210.4.beta <4.0.0" dependencies: ffi: ^2.0.1 diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart index ff7dc120a3..015821ea28 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart @@ -29,9 +29,8 @@ class Bindings { } late final _test1Ptr = _lookup< - ffi - .NativeFunction)>>( - 'test1'); + ffi.NativeFunction< + ffi.Bool Function(ffi.Bool, ffi.Pointer)>>('test1'); late final _test1 = _test1Ptr.asFunction)>(); } diff --git a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart index 7b6682c465..7475b09d3a 100644 --- a/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart +++ b/pkgs/ffigen/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart @@ -128,9 +128,8 @@ class NativeLibrary { } late final _diffCharsPtr = _lookup< - ffi - .NativeFunction>( - 'diffChars'); + ffi.NativeFunction< + ffi.Char Function(ffi.UnsignedChar, ffi.SignedChar)>>('diffChars'); late final _diffChars = _diffCharsPtr.asFunction(); late final addresses = _SymbolAddresses(this); diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart index cc66670e3e..9c5a3e10bb 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_cjson_bindings.dart @@ -54,9 +54,8 @@ class CJson { } late final _cJSON_ParsePtr = _lookup< - ffi - .NativeFunction Function(ffi.Pointer)>>( - 'cJSON_Parse'); + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>>('cJSON_Parse'); late final _cJSON_Parse = _cJSON_ParsePtr .asFunction Function(ffi.Pointer)>(); @@ -91,9 +90,8 @@ class CJson { } late final _cJSON_PrintPtr = _lookup< - ffi - .NativeFunction Function(ffi.Pointer)>>( - 'cJSON_Print'); + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>>('cJSON_Print'); late final _cJSON_Print = _cJSON_PrintPtr .asFunction Function(ffi.Pointer)>(); diff --git a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart index 5c6de76237..ae907ccb7f 100644 --- a/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/pkgs/ffigen/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -4733,11 +4733,10 @@ class SQLite { ffi.Pointer, ffi.Int, ffi.Pointer>)>>, - ffi - .Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer)>>)>>( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>( 'sqlite3_create_function'); late final _sqlite3_create_function = _sqlite3_create_functionPtr.asFunction< int Function( @@ -4811,11 +4810,10 @@ class SQLite { ffi.Pointer, ffi.Int, ffi.Pointer>)>>, - ffi - .Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer)>>)>>( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>( 'sqlite3_create_function16'); late final _sqlite3_create_function16 = _sqlite3_create_function16Ptr.asFunction< @@ -4896,10 +4894,9 @@ class SQLite { ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer)>>, - ffi - .Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>)>>( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( 'sqlite3_create_function_v2'); late final _sqlite3_create_function_v2 = _sqlite3_create_function_v2Ptr.asFunction< @@ -4990,10 +4987,9 @@ class SQLite { ffi.Pointer, ffi.Int, ffi.Pointer>)>>, - ffi - .Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>)>>( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( 'sqlite3_create_window_function'); late final _sqlite3_create_window_function = _sqlite3_create_window_functionPtr.asFunction< @@ -9760,9 +9756,8 @@ class SQLite { } late final _sqlite3_logPtr = _lookup< - ffi - .NativeFunction)>>( - 'sqlite3_log'); + ffi.NativeFunction< + ffi.Void Function(ffi.Int, ffi.Pointer)>>('sqlite3_log'); late final _sqlite3_log = _sqlite3_logPtr.asFunction)>(); @@ -10706,8 +10701,7 @@ class SQLite { ffi.Pointer)>>, ffi.Pointer, ffi.Pointer< - ffi - .NativeFunction< + ffi.NativeFunction< ffi.Void Function(ffi.Pointer)>>)>>( 'sqlite3_rtree_query_callback'); late final _sqlite3_rtree_query_callback = From 85e4257b34a37da5b16dffea4f50704ce9510aae Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Tue, 14 Nov 2023 11:17:59 +1300 Subject: [PATCH 275/276] [ffigen] Change ffigen to use dart-lang/native's directory stucture Also: - Delete dependabot.yml - Rename test-package.yml to ffigen.yml, and modify it to use pkgs/ffigen as its working dir --- .../workflows/ffigen.yml | 25 +++++++++++++++++-- pkgs/ffigen/.github/dependabot.yml | 11 -------- 2 files changed, 23 insertions(+), 13 deletions(-) rename pkgs/ffigen/.github/workflows/test-package.yml => .github/workflows/ffigen.yml (88%) delete mode 100644 pkgs/ffigen/.github/dependabot.yml diff --git a/pkgs/ffigen/.github/workflows/test-package.yml b/.github/workflows/ffigen.yml similarity index 88% rename from pkgs/ffigen/.github/workflows/test-package.yml rename to .github/workflows/ffigen.yml index b809a9a752..9bfb2910be 100644 --- a/pkgs/ffigen/.github/workflows/test-package.yml +++ b/.github/workflows/ffigen.yml @@ -1,11 +1,17 @@ -name: Dart CI +name: ffigen CI on: # Run on PRs and pushes to the default branch. push: branches: [main, stable] + paths: + - '.github/workflows/ffigen.yml' + - 'pkgs/ffigen/**' pull_request: branches: [main, stable] + paths: + - '.github/workflows/ffigen.yml' + - 'pkgs/ffigen/**' schedule: - cron: "0 0 * * 0" @@ -16,6 +22,9 @@ jobs: # Check code formatting and static analysis on a single OS (macos). analyze: runs-on: macos-latest + defaults: + run: + working-directory: pkgs/ffigen/ strategy: fail-fast: false matrix: @@ -41,6 +50,9 @@ jobs: test-linux: needs: analyze runs-on: ubuntu-22.04 + defaults: + run: + working-directory: pkgs/ffigen/ steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d @@ -58,6 +70,9 @@ jobs: test-mac: needs: analyze runs-on: macos-latest + defaults: + run: + working-directory: pkgs/ffigen/ steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d @@ -75,11 +90,14 @@ jobs: uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949 with: github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: lcov.info + path-to-lcov: pkgs/ffigen/lcov.info test-windows: needs: analyze runs-on: windows-latest + defaults: + run: + working-directory: pkgs/ffigen/ steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d @@ -105,6 +123,9 @@ jobs: test-windows-flutter: needs: analyze runs-on: windows-latest + defaults: + run: + working-directory: pkgs/ffigen/ steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 diff --git a/pkgs/ffigen/.github/dependabot.yml b/pkgs/ffigen/.github/dependabot.yml deleted file mode 100644 index 725f03af2e..0000000000 --- a/pkgs/ffigen/.github/dependabot.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Dependabot configuration file. -# See https://docs.github.com/en/code-security/dependabot/dependabot-version-updates -version: 2 - -updates: - - package-ecosystem: github-actions - directory: / - schedule: - interval: monthly - labels: - - autosubmit From ff474966705d455450354ec5a826186b903ec117 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Tue, 14 Nov 2023 11:40:50 +1300 Subject: [PATCH 276/276] Switch publish workflow to use the beta SDK This is needed because the ffigen package depends on the beta version of the SDK. --- .github/workflows/publish.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 4bac353257..4c00b141b6 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -17,3 +17,4 @@ jobs: pull-requests: write # Required for writing the pull request note with: write-comments: false + sdk: beta
    Release notes

    Sourced from actions/checkout's releases.

    v3.5.3

    What's Changed

    New Contributors

    Full Changelog: https://github.com/actions/checkout/compare/v3...v3.5.3